diff --git a/.asf.yaml b/.asf.yaml new file mode 100644 index 0000000000..4ea7043274 --- /dev/null +++ b/.asf.yaml @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# All configurations could be found here: https://github.com/apache/infrastructure-asfyaml/ + +github: + description: "Apache Libcloud is a Python library that hides differences between different cloud provider APIs and allows you to manage different cloud resources through a unified and easy-to-use API." + homepage: https://libcloud.apache.org + labels: + - python + - library + - cloud + - libcloud + - apache + features: + wiki: false + issues: true + projects: true + enabled_merge_buttons: + squash: true + merge: true + rebase: false + autolink_jira: + - LIBCLOUD + pull_requests: + allow_auto_merge: true + allow_update_branch: true + del_branch_on_merge: true + protected_branches: + trunk: + required_status_checks: + contexts: + - "Unit Tests (Python 3.10)" + - "Unit Tests (Python 3.11)" + - "Unit Tests (Python 3.12)" + - "Unit Tests (Python 3.13)" + - "Dependency Review" + - "Run Various Lint and Other Checks (3.12)" + - "Build and upload Documentation (3.12)" + +notifications: + jobs: notifications@libcloud.apache.org + issues: notifications@libcloud.apache.org + pullrequests: notifications@libcloud.apache.org + jira_options: link label comment diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000000..61caf6f465 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,19 @@ +coverage: + precision: 2 # decimal places to display: 0 <= value <= 4 + round: nearest + range: 50...90 # custom range of coverage colors from red -> yellow -> green + + status: + project: + default: + threshold: 2% + patch: yes + changes: no + +comment: + layout: "header, diff, tree" + behavior: default + require_changes: false # if true: only post the comment if coverage changes + branches: null + flags: null + paths: null diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 61014db9a3..0000000000 --- a/.coveragerc +++ /dev/null @@ -1,32 +0,0 @@ -# .coveragerc to control coverage.py -[run] -branch = True -source = libcloud - -[report] -# Regexes for lines to exclude from consideration -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about missing debug-only code: - def __repr__ - def __str__ - if self\.debug - - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - - # Don't complain if non-runnable code isn't run: - if 0: - if __name__ == .__main__.: - __all__ - import - deprecated_warning - in_development_warning - -ignore_errors = True - -[html] -directory = coverage_html_report diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..00ea2416ec --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# See http://editorconfig.org for more info. + +# This is the root-level config file. +root = true + +[*.py] +indent_style = space +indent_size = 4 + +[*.rst] +indent_style = space +indent_size = 2 + +[*.sh] +indent_style = space +indent_size = 4 + +[Makefile] +indent_style = tab diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000000..50b4e13d29 --- /dev/null +++ b/.flake8 @@ -0,0 +1,10 @@ +[flake8] +max-line-length = 100 +exclude=*.egg/*,build,dist + +# E501 is line length limit +# https://black.readthedocs.io/en/stable/the_black_code_style.html#line-length +# We don't really need line length rule since black formatting takes care of +# that. +extend-ignore = E203,E128,E402,E722,W504,E501,E203,W503 +ignore = E128,E402,E722,W504,E501,E203,W503 diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..df80318d2b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,19 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +## Summary + +Provide a quick summary of your bug report. + +## Detailed Information + +Provide detailed information of your bug report. + +This includes information about your environment (which Libcloud version are +you using, which Python version, which Operating System / distribution, etc.) +and steps which are needed to reproduce it. + +For more information on contributing, please see https://libcloud.readthedocs.io/en/latest/development.html diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..33d978826f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,13 @@ +--- +name: Feature request or proposal +about: Suggest an idea for this project + +--- + +## Feature Request + +Provide detailed information for your feature request or proposal, including +why you think it's a good idea and how it would benefit Libcloud users and +the broader community. + +For more information on contributing, please see https://libcloud.readthedocs.io/en/latest/development.html diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 0000000000..3bc7a39b65 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +name: Support request +about: Post any support requests on our mailing lists - https://libcloud.readthedocs.io/en/latest/developer_information.html#mailing-lists. + +--- + +For any questions about the project, please use our mailing lists - https://libcloud.readthedocs.io/en/latest/developer_information.html#mailing-lists. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..7a84798ea0 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,24 @@ +## Changes Title (replace this with a logical title for your changes) + +### Description + +Replace this with the PR description (mention the changes you have made, why +you have made them, provide some background and any references to the provider +documentation if needed, etc.). + +For more information on contributing, please see [Contributing](http://libcloud.readthedocs.org/en/latest/development.html#contributing) +section of our documentation. + +### Status + +Replace this: describe the PR status. Examples: + +- work in progress +- done, ready for review + +### Checklist (tick everything that applies) + +- [ ] [Code linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide) (required, can be done after the PR checks) +- [ ] Documentation +- [ ] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html) +- [ ] [ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes) (required for bigger changes) diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..7868071483 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 2 + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 2 diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000000..ab2a3707fa --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,52 @@ +# Configuration for probot-stale - https://github.com/probot/stale + +# Number of days of inactivity before an Issue or Pull Request becomes stale +daysUntilStale: 90 + +# Number of days of inactivity before a stale Issue or Pull Request is closed. +# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. +# NOTE: This is set to false because we only mark issues as stale, but don't automatically close them. +daysUntilClose: false + +# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable +exemptLabels: + - WIP + - work in progress + - important + - feature + - bug + - enhancement + +# Set to true to ignore issues in a project (defaults to false) +exemptProjects: true + +# Set to true to ignore issues in a milestone (defaults to false) +exemptMilestones: true + +# Label to use when marking as stale +staleLabel: stale + +# Comment to post when marking as stale. Set to `false` to disable +markComment: > + Thanks for contributing to this issue. As it has been 90 days since the last activity, + we are automatically marking is as stale. If this issue is not relevant or applicable + anymore (problem has been fixed in a new version or similar), please close the issue + or let us know so we can close it. On the contrary, if the issue is still relevant, + there is nothing you need to do, but if you have any additional details or context which + would help us when working on this issue, please include it as a comment to this issue. + +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false +# Comment to post when removing the stale label. +# unmarkComment: > +# Your comment here. + +# Comment to post when closing a stale Issue or Pull Request. +#closeComment: > +# Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues + +# Limit the number of actions per hour, from 1-30. Default is 30 +limitPerRun: 30 + +# Limit to only `issues` or `pulls` +#only: issues diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000..d43a2332d9 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,41 @@ +name: "CodeQL Analysis" + +on: + push: + branches: [ trunk ] + pull_request: + branches: [ trunk ] + schedule: + - cron: '0 3 * * *' + +permissions: + contents: read # for actions/checkout to fetch code + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + analyze: + permissions: + actions: read # for github/codeql-action/init to get workflow details + security-events: write # for github/codeql-action/autobuild to send a status report + name: Analyze + runs-on: ubuntu-latest + timeout-minutes: 15 + + strategy: + fail-fast: false + matrix: + language: [ 'python' ] + + steps: + - uses: actions/checkout@v7 + - name: Initialize CodeQL + uses: github/codeql-action/init@v4.39.3 + with: + languages: ${{ matrix.language }} + - name: Autobuild + uses: github/codeql-action/autobuild@v4.39.3 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4.39.3 diff --git a/.github/workflows/depsreview.yaml b/.github/workflows/depsreview.yaml new file mode 100644 index 0000000000..b9584fb1a0 --- /dev/null +++ b/.github/workflows/depsreview.yaml @@ -0,0 +1,28 @@ +name: Dependency Review + +on: + pull_request: + branches: [ trunk ] + +permissions: + contents: read # for actions/checkout to fetch code + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + dependency-review: + name: Dependency Review + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - uses: actions/checkout@v7 + - name: Dependency Review + uses: actions/dependency-review-action@v5 + # TODO: We really want one check for direct prod dependencies where we + # only allows ASF, MIT, BSD and nother one for testing / dev + # dependencies where we also allow GPL, etc. + #with: + # allow-licenses: MIT, Apache-2.0, BSD-3-Clause diff --git a/.github/workflows/install-tests.yml b/.github/workflows/install-tests.yml new file mode 100644 index 0000000000..f8b0fb1169 --- /dev/null +++ b/.github/workflows/install-tests.yml @@ -0,0 +1,58 @@ +# Workflow which verifies that the latest stable version can be installed from +# pip on all the supported Python versions +name: Install stable version using pip + +on: + schedule: + - cron: '0 13 * * *' + - cron: '0 2 * * *' + +permissions: + contents: read # for actions/checkout to fetch code + +jobs: + install_and_verify: + name: Install + runs-on: ubuntu-latest + timeout-minutes: 5 + + strategy: + fail-fast: false + matrix: + python_version: + + - "3.10" + - "3.11" + - "3.12" + - "3.13" + + - "pypy-3.10" + + steps: + - uses: actions/checkout@v7 + - name: Use Python ${{ matrix.python_version }} + uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python_version }} + + - name: Install Libcloud + run: | + python --version + pip show apache-libcloud && exit 1 + pip install apache-libcloud + pip show apache-libcloud + + # Job which verifies that the checksum for release artifacts for the latest + # stable version are the same for official ASF mirror and PyPi + verify_checksums: + name: Verify Artifacts Checksum + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v7 + - name: Verify Checksums + run: | + LAST_STABLE_VERSION=$(curl -s --fail https://pypi.org/pypi/apache-libcloud/json | jq ".releases | to_entries | last | .key" -r) + echo "Verifying checksums for version ${LAST_STABLE_VERSION}" + ./dist/verify_checksums.sh "apache-libcloud-${LAST_STABLE_VERSION}" diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 0000000000..ae4bac7f55 --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -0,0 +1,68 @@ +# NOTE: Integration tests are part of a separate workflow so we can re-run just +# this workflow on failure +name: Integration Tests + +on: + push: + branches: [ trunk ] + pull_request: + branches: [ trunk ] + schedule: + - cron: '0 1 * * *' + +permissions: + contents: read # for actions/checkout to fetch code + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + # Needed if we want colors in pytest output without tty and script -e -c wrapper + PY_COLORS: "1" + FORCE_COLOR: "1" + +jobs: + integration_tests: + name: Run Integration Tests + runs-on: ubuntu-latest + timeout-minutes: 15 + + strategy: + matrix: + python_version: [ "3.12" ] + + steps: + - uses: actions/checkout@v7 + - name: Use Python ${{ matrix.python_version }} + uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python_version }} + - name: Install uv + uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 + + - name: Install OS / deb dependencies + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev pkg-config + + - name: Cache uv + uses: actions/cache@v6 + with: + path: ~/.cache/uv + key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }} + restore-keys: | + ${{ runner.os }}-uv- + + - name: Install Python Dependencies + run: | + uv sync --group ci --no-dev + echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH" + + - name: Run tox target + run: | + tox -e integration-storage + env: + AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_ACCESS_KEY_SECRET: ${{ secrets.AWS_ACCESS_KEY_SECRET }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..43e9ff397a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,447 @@ +name: CI + +on: + push: + branches: + - trunk + pull_request: + branches: + - trunk + schedule: + - cron: '0 1 * * *' + +permissions: + contents: read # for actions/checkout to fetch code + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + # Needed if we want colors in pytest output without tty and script -e -c wrapper + PY_COLORS: "1" + FORCE_COLOR: "1" + +jobs: + unit_tests: + name: Unit Tests (Python ${{ matrix.python_version }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 8 + + strategy: + fail-fast: false + matrix: + python_version: + - "3.10" + - "3.11" + - "3.12" + - "3.13" + - "3.14" + # cryptography is not compatible with older PyPy versions + - "pypy-3.10" + os: + - ubuntu-latest + + steps: + - uses: actions/checkout@v7 + - name: Use Python ${{ matrix.python_version }} + uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python_version }} + - name: Install uv + uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 + + - name: Install OS / deb dependencies + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev pkg-config + + - name: Cache uv + uses: actions/cache@v6 + with: + path: ~/.cache/uv + key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }} + restore-keys: | + ${{ runner.os }}-uv- + + - name: Install Python Dependencies + run: uv sync --group ci --no-dev + + - name: Add .venv to PATH + run: echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH" + + - name: Run unit tests tox target + run: tox -e py${{ matrix.python_version }} + + - name: Run dist install checks tox target + if: ${{ matrix.python_version != 'pypy-3.10' }} + run: tox -e py${{ matrix.python_version }}-dist,py${{ matrix.python_version }}-dist-wheel + + code_coverage: + name: Generate Code Coverage + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write # for Codecov OIDC authentication + + strategy: + matrix: + python_version: [ "3.12" ] + + steps: + - uses: actions/checkout@v7 + - name: Use Python ${{ matrix.python_version }} + uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python_version }} + - name: Install uv + uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 + + - name: Install OS / deb dependencies + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev pkg-config + + - name: Cache uv + uses: actions/cache@v6 + with: + path: ~/.cache/uv + key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }} + restore-keys: | + ${{ runner.os }}-uv- + + - name: Install Python Dependencies + run: uv sync --group ci --no-dev + + - name: Add .venv to PATH + run: echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH" + + - name: Run Checks + run: tox -e coverage-ci + + - name: Upload Coverage to codecov.io + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + with: + use_oidc: true + fail_ci_if_error: true + verbose: true + + lint_checks: + name: Run Various Lint and Other Checks + runs-on: ubuntu-latest + + strategy: + matrix: + python_version: [ "3.12" ] + + steps: + - uses: actions/checkout@v7 + - name: Use Python ${{ matrix.python_version }} + uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python_version }} + - name: Install uv + uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 + + - name: Install OS / deb dependencies + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev pkg-config + + - name: Cache uv + uses: actions/cache@v6 + with: + path: ~/.cache/uv + key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }} + restore-keys: | + ${{ runner.os }}-uv- + + - name: Install Python Dependencies + run: uv sync --group ci --no-dev + + - name: Add .venv to PATH + run: echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH" + + - name: Run shellcheck + run: shellcheck dist/*.sh contrib/*.sh + + - name: Run Python Checks + run: tox -e black-check,isort-check,pyupgrade,checks,import-timings,lint,pylint,mypy + + build_test_release_artifact: + name: Build and Test Release Artifact + runs-on: ubuntu-latest + + strategy: + matrix: + python_version: [ "3.12" ] + + steps: + - uses: actions/checkout@v7 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y libvirt-dev pkg-config gcc + + - name: Use Python ${{ matrix.python_version }} + uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python_version }} + - name: Install uv + uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 + - name: Install OS / deb dependencies + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev pkg-config + + - name: Cache uv + uses: actions/cache@v6 + with: + path: ~/.cache/uv + key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }} + restore-keys: | + ${{ runner.os }}-uv- + + - name: Install Python Dependencies + run: | + uv sync --group ci --group build --no-dev + echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH" + + - name: Build Release Artifact + run: | + pip list installed + python -m build -vv + + - name: Set Environment + run: | + export PYTHONPATH=. + export VERSION=$(python -c "import libcloud ; print(libcloud.__version__)") + echo "VERSION=${VERSION}" >> "$GITHUB_ENV" + + - name: Verify Tarball Release Artifact + run: | + # Verify tarball file exists + export TARBALL_FILENAME="apache_libcloud-${VERSION}.tar.gz" + + ls -la "dist/${TARBALL_FILENAME}" + + cd dist/ + + # Unpack tarball and verify + run the tests + tar -xzvf "${TARBALL_FILENAME}" + + cd "apache_libcloud-${VERSION}/" + tox -c tox.ini -epy3.12 + + - name: Verify Wheel Release Artifact + run: | + # Verify wheel file exists + export WHEEL_FILENAME="apache_libcloud-${VERSION}-py3-none-any.whl" + + ls -la "dist/${WHEEL_FILENAME}" + + cd dist/ + + # Unpack wheel and verify + run tests + unzip "${WHEEL_FILENAME}" -d "wheel" + cd wheel + + # Since wheel doesn't include those files, we need to manually copy them over from + # repo root so we can run the tests + cp ../../tox.ini . + cp ../../pyproject.toml . + cp ../../libcloud/test/secrets.py-dist libcloud/test/secrets.py-dist + tox -c tox.ini -epy3.12 + + build_test_docker_image: + name: Build and Verify Docker Image + runs-on: ubuntu-latest + + strategy: + matrix: + python_version: [ "3.12" ] + + steps: + - uses: actions/checkout@v7 + - name: Build Testing Docker Image + run: docker build -f contrib/Dockerfile -t libcloud_runtest_img . + - name: Verify Image Works + # This step runs checks under various Python versions and it's slow so + # we only run it on nightly basis + if: ${{ github.event.schedule == '0 1 * * *' }} + run: | + docker run libcloud_runtest_img + + security_checks: + name: Run Security Checks + runs-on: ubuntu-latest + + strategy: + matrix: + python_version: [ "3.12" ] + + steps: + - uses: actions/checkout@v7 + - name: Use Python ${{ matrix.python_version }} + uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python_version }} + - name: Install uv + uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 + + - name: Install OS / deb dependencies + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev pkg-config + + - name: Cache uv + uses: actions/cache@v6 + with: + path: ~/.cache/uv + key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }} + restore-keys: | + ${{ runner.os }}-uv- + + - name: Install Python Dependencies + run: uv sync --group dev --group docs + + - name: Add .venv to PATH + run: echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH" + + - name: Ensure pip is available + run: | + python -m ensurepip --upgrade + python -m pip install --upgrade pip + + - name: Install Library Into Virtualenv + run: | + python -m venv venv/ + source venv/bin/activate + python -m pip install --upgrade pip + python -m pip install . + + - name: Run Pip Audit Check On Main Library Dependencies + uses: pypa/gh-action-pip-audit@1220774d901786e6f652ae159f7b6bc8fea6d266 # v1.1.0 + with: + virtual-environment: venv/ + # setuptools which we don't install or depend on directly + # PYSEC-2023-228 - pip vulnerability and we don't install pip directly + ignore-vulns: | + GHSA-r9hx-vwmv-q579 + PYSEC-2022-43012 + PYSEC-2023-228 + + - name: Cleanup + run: rm -rf venv/ || true + + - name: Run Pip Audit Check On All Development And Test Dependencies + uses: pypa/gh-action-pip-audit@1220774d901786e6f652ae159f7b6bc8fea6d266 # v1.1.0 + with: + virtual-environment: .venv + # setuptools which we don't install or depend on directly + ignore-vulns: | + GHSA-r9hx-vwmv-q579 + + - name: Run Bandit Check + run: tox -e bandit + + micro-benchmarks: + name: Micro Benchmarks + runs-on: ubuntu-latest + + strategy: + matrix: + python_version: [ "3.12" ] + + steps: + - uses: actions/checkout@v7 + - name: Use Python ${{ matrix.python_version }} + uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python_version }} + - name: Install uv + uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 + + - name: Install OS / deb dependencies + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev pkg-config + + - name: Cache uv + uses: actions/cache@v6 + with: + path: ~/.cache/uv + key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }} + restore-keys: | + ${{ runner.os }}-uv- + + - name: Install Python Dependencies + run: uv sync --group ci --no-dev + + - name: Add .venv to PATH + run: echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH" + + - name: Run Micro Benchmarks + run: tox -e micro-benchmarks + + docs: + name: Build and upload Documentation + runs-on: ubuntu-latest + + strategy: + matrix: + python_version: [ "3.12" ] + + steps: + - uses: actions/checkout@v7 + - name: Use Python ${{ matrix.python_version }} + uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python_version }} + - name: Install uv + uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 + + - name: Print Environment Info + run: printenv | sort + + - name: Install OS / deb dependencies + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev pkg-config + + - name: Cache uv + uses: actions/cache@v6 + with: + path: ~/.cache/uv + key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }} + restore-keys: | + ${{ runner.os }}-uv- + + - name: Install Python Dependencies + run: uv sync --locked --group ci --no-dev + + - name: Add .venv to PATH + run: echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH" + + - name: Build Docs + run: tox -e docs + + - name: Install PDF build dependencies + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \ + latexmk texlive-latex-recommended texlive-latex-extra \ + texlive-fonts-recommended tex-gyre xindy + + - name: Build PDF and EPUB + run: tox -e docs-formats + + - name: Trigger ReadTheDocs build + if: ${{ github.ref_name == 'trunk' }} + env: + RTD_TOKEN: ${{ secrets.RTD_TOKEN }} + BRANCH_NAME: "trunk" + run: | + uv pip install requests + python ./contrib/trigger_rtd_build.py diff --git a/.github/workflows/publish_dev_artifact.yml b/.github/workflows/publish_dev_artifact.yml new file mode 100644 index 0000000000..5fac9ff885 --- /dev/null +++ b/.github/workflows/publish_dev_artifact.yml @@ -0,0 +1,66 @@ +# Workflow which builds .tar.gz and .whl development artifact on each push to +# trunk and stores it as a Github Actions workflow artifact +# NOTE: Those artifacts are not persisted long term and are mostly meant to be +# used for testing and similar +name: Publish dev release bundle + +on: + workflow_run: + workflows: + - "CI" + branches: + - trunk + types: + - completed + +permissions: + contents: read # for actions/checkout to fetch code + +jobs: + generate_and_publish_dev_release_artifacts: + name: Generate and Publish Dev Release Artifacts + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v7 + - name: Use Python ${{ matrix.python_version }} + uses: actions/setup-python@v7 + with: + python-version: "3.12" + - name: Install uv + uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 + + - name: Print Environment Info + run: printenv | sort + - name: Install Dependencies + run: | + uv sync --group build --no-dev + echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH" + + - name: Create Dev Artifacts + run: | + python -m build + ls -la dist + + # Ensure artifacts have been created + ls -la dist | grep .tar.gz + ls -la dist | grep .whl + + - name: Store dev artifacts - .tar.gz + uses: actions/upload-artifact@v7 + with: + name: libcloud-dev-tarball + retention-days: 60 + compression-level: 0 + path: | + dist/*.tar.gz + + - name: Store dev artifacts - .whl + uses: actions/upload-artifact@v7 + with: + name: libcloud-dev-wheel + retention-days: 60 + compression-level: 0 + path: | + dist/*.whl diff --git a/.github/workflows/publish_pricing_to_s3.yml b/.github/workflows/publish_pricing_to_s3.yml new file mode 100644 index 0000000000..5cbc239aff --- /dev/null +++ b/.github/workflows/publish_pricing_to_s3.yml @@ -0,0 +1,51 @@ +# Workflow which runs on daily basis and publishes pricing data to S3 bucket +name: Publish pricing.json to S3 bucket + +on: + schedule: + - cron: '0 13 * * *' + - cron: '0 2 * * *' + +permissions: + contents: read # for actions/checkout to fetch code + +jobs: + generate_and_publish_pricing_data: + name: Generate and Publish Pricing file to S3 + runs-on: ubuntu-latest + timeout-minutes: 15 + + strategy: + matrix: + python_version: [ "3.12" ] + + steps: + - uses: actions/checkout@v7 + - name: Use Python ${{ matrix.python_version }} + uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python_version }} + - name: Install uv + uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 + + - name: Print Environment Info + run: printenv | sort + + - name: Install Python Dependencies + run: | + uv sync --group ci --no-dev + echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH" + + - name: Generate and publish pricing data + env: + GCE_API_KEY: ${{ secrets.GCE_API_KEY }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_ACCESS_KEY_SECRET: ${{ secrets.AWS_ACCESS_KEY_SECRET }} + run: script -e -c "tox -escrape-and-publish-provider-prices" + + - name: Verify files can be downloaded + # Verify that the permissions are correct and files can be downloaded publicly + run: | + curl --fail https://libcloud-pricing-data.s3.amazonaws.com/pricing.json + curl --fail https://libcloud-pricing-data.s3.amazonaws.com/pricing.json.sha256 + curl --fail https://libcloud-pricing-data.s3.amazonaws.com/pricing.json.sha512 diff --git a/.gitignore b/.gitignore index 45fbe88029..62e23cfe49 100644 --- a/.gitignore +++ b/.gitignore @@ -9,13 +9,32 @@ build MANIFEST /.ropeproject/config.py /.coverage +/.coverage* coverage_html_report/ +coverage.xml .idea dist/*apache-libcloud* dist/*apache_libcloud* +dist/wheel docs/apidocs/* _build/ apache_libcloud.egg-info/ .project .pydevproject .settings +.DS_Store +.eggs/ +.cache/ +.vscode/ +.Python +bin/ +include/ +lib/ +pip-selfcheck.json +report.html +.pytest_cache +.mypy_cache/ +libcloud/data/pricing.json.sha* +benchmark_histograms/ +.python-version +.venv diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..782344ed9a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,98 @@ +exclude: | + (?x)^( + docs/(?:.*/)?_supported_.*\.rst$| + libcloud/data/pricing\.json$ + ) + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v5.0.0" + hooks: + - id: check-case-conflict + - id: check-merge-conflict + - id: check-toml + - id: check-yaml + - id: check-json + exclude: | + (?x)^( + libcloud/test/dns/fixtures/pointdns/not_found\.json| + libcloud/test/dns/fixtures/godaddy/v1_domains_purchase_schema_com\.json| + libcloud/test/dns/fixtures/gandi_live/get_bad_zone\.json + )$ + - id: end-of-file-fixer + files: &text_files | + (?x)^( + libcloud/| + docs/| + demos/| + integration/| + scripts/| + contrib/| + pylint_plugins/| + \.github/| + [^/]+\.(py|rst|md|yml|yaml|toml|json|xml|txt|csv|ini|cfg|sh)$ + ) + exclude: &fixture_exclude | + (?x)^( + libcloud/test/.*/fixtures/| + integration/.*/fixtures/ + ) + - id: trailing-whitespace + files: *text_files + exclude: *fixture_exclude + + - repo: https://github.com/psf/black + rev: "25.1.0" + hooks: + - id: black + args: ["--config=pyproject.toml"] + files: &fmt_py_files | + (?x)^( + libcloud/| + docs/examples/| + docs/| + demos/| + contrib/| + pylint_plugins/| + integration/| + [^/]+\.py$ + ) + + - repo: https://github.com/pycqa/isort + rev: "6.0.1" + hooks: + - id: isort + args: ["--settings-path=pyproject.toml"] + files: *fmt_py_files + + - repo: https://github.com/pycqa/flake8 + rev: "5.0.4" + hooks: + - id: flake8 + args: ["--config=./.flake8"] + files: &lint_py_files | + (?x)^( + libcloud/| + libcloud/test/| + demos/| + integration/| + scripts/| + docs/examples/| + contrib/| + pylint_plugins/ + ) + + - repo: https://github.com/asottile/pyupgrade + rev: "v3.3.1" + hooks: + - id: pyupgrade + args: ["--py310-plus", "--py3-only"] + files: *lint_py_files + + - repo: https://github.com/codespell-project/codespell + rev: "v2.4.1" + hooks: + - id: codespell + additional_dependencies: ["tomli"] + args: ["--toml", "pyproject.toml"] + files: ^libcloud/ diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index 56d02c2ccd..0000000000 --- a/.pylintrc +++ /dev/null @@ -1,35 +0,0 @@ -[MASTER] -# Add to the black list. It should be a base name, not a -# path. You may set this option multiple times. -ignore=test - - -# Pickle collected data for later comparisons. -persistent=yes - -# List of plugins (as comma separated values of python modules names) to load, -# usually to register additional checkers. -load-plugins= - - -[MESSAGES CONTROL] -disable=redefined-builtin,too-many-arguments,too-few-public-methods,missing-docstring,invalid-name,abstract-method,no-self-use - - -[TYPECHECK] -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E0201 when accessed. Python regular -# expressions are accepted. -generated-members=async_request,objects - -[VARIABLES] - -# Tells wether we should check for unused import in __init__ files. -init-import=no - -# A regular expression matching names used for dummy variables (i.e. not used). -dummy-variables-rgx=_|dummy - -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid to define new builtins when possible. -additional-builtins= diff --git a/.ratignore b/.ratignore index ba54ecd9cd..346a627893 100644 --- a/.ratignore +++ b/.ratignore @@ -1,23 +1,21 @@ -RELEASING -MANIFEST MANIFEST.in .gitignore tox.ini -apidocs/ -CHANGES -HACKING -test/storage/fixtures/ -test/compute/fixtures/ -test/loadbalancer/fixtures/ -test/dns/fixtures/ -coverage_html_report/ -.coverage -.coveragerc +docs/apidocs.rst +CHANGES.rst +.codecov.rc +pyproject.toml libcloud/data/pricing.json libcloud/common/__init__.py libcloud/compute/__init__.py +libcloud/container/__init__.py libcloud/storage/__init__.py libcloud/loadbalancer/__init__.py libcloud/dns/__init__.py -test/storage/__init__.py -test/pricing_test.json +libcloud/test/storage/fixtures/ +libcloud/test/compute/fixtures/ +libcloud/test/loadbalancer/fixtures/ +libcloud/test/dns/fixtures/ +libcloud/test/container/fixtures/ +libcloud/test/storage/__init__.py +libcloud/test/pricing_test.json diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000000..eb49b9bdb8 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,26 @@ +# Read the Docs configuration file for Sphinx projects +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.10" + jobs: + pre_create_environment: + - python -m pip install --upgrade pip uv + create_environment: + - python -m uv venv "${READTHEDOCS_VIRTUALENV_PATH}" + install: + - UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" python -m uv sync --locked --group docs --no-dev + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/conf.py + +formats: + - pdf + - epub diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4a87d504b7..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: python -python: 2.7 -sudo: false -os: - - linux - - osx -env: - - TOX_ENV=lint - - TOX_ENV=py26 - - TOX_ENV=py27 - - TOX_ENV=pypy - - TOX_ENV=py32 - - TOX_ENV=py33 - - TOX_ENV=py34 - - TOX_ENV=docs - -install: - - pip install tox - -script: - - tox -e $TOX_ENV diff --git a/CHANGES.rst b/CHANGES.rst index d241f329f5..09dc688897 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,8 +1,4724 @@ Changelog ========= -Changes with Apache Libcloud in development -------------------------------------------- + +Changes in Apache Libcloud 4.0.0 +-------------------------------- + +Common +~~~~~~ + +- Accept bracketed IPv6 endpoint URLs, with default or explicit ports, in the + shared connection class. + (GITHUB-2220) + [Jatin Pandey - @satiricalguru] + +- Fix ``MinimalRetry`` and ``Retry`` skipping the initial request and raising + ``TypeError`` when the retry timeout is zero or negative. The initial request + now runs once, returning its result or propagating its exception without + sleeping. + (GITHUB-2199) + [Zhe Chen - @zhechen-cs] + +- Respect the ``no_proxy`` / ``NO_PROXY`` environment variable so an explicitly + configured proxy is bypassed for matching hosts. + (GITHUB-2077) + [Sanjay Santhanam - @Sanjays2402] + +- Move tests to python 3.12. + (#2152) + [Miguel Caballer - @micafer] + +- [Utils] Fix ``is_valid_ip_address`` raising ``ValueError`` instead of + returning ``False`` for an address containing an embedded null byte + (e.g. ``"1.2.3.4\x00"``). ``socket.inet_pton`` raises ``ValueError`` rather + than ``OSError`` in that case, which was not caught. + (#2185) + [Ashish - @Ashishjob] + +- [Utils] Fix ``get_pubkey_openssh_fingerprint`` returning a wrong fingerprint + for Ed25519 keys and raising ``binascii.Error`` for ECDSA keys. The function + assumed a 7 character ``ssh-rsa`` key type prefix. This also affects the + ``fingerprint`` attribute of key pairs returned by the Vultr driver. + (#2229) + [0z5a - @0z5a] + +Compute +~~~~~~~ + +- [OVH] Remove the static location mapping and use the location code returned + by the API as both the location ID and name, avoiding failures for codes not + known to Libcloud. + (#2219) + [Miguel Caballer - @micafer] + +- [OVH] Change the ``ex_keyname`` argument to ``auth`` in ``create_node()`` to + match the implementation in EC2. + (#2148) + [ali-corpo & Miguel Caballer - @micafer] + +- [CloudSigma] Fix ``ex_list_tags()`` in the API v2 driver to use ``/tags/`` + instead of ``/tags/detail/``, avoiding HTTP 404 errors when listing tags. + (GITHUB-2195) + [Robert Jenkin - @rjcloudsigma] + +- [GCE] Preserve completed results and pending node names on the exception + raised when bulk node creation times out, allowing callers to recover or + clean up resources without losing track of them. + (GITHUB-1589) + [Ishu Patel - @ishu7w] + +- [EC2] Allow Elastic IP association with a specific network interface, so + instances with multiple interfaces can select the required target. Existing + calls continue to associate by instance ID. + (GITHUB-1799) + [Ishu Patel - @ishu7w] + +- [OpenStack] Select service catalog endpoints by service type without filtering + by the default service name. The service name is only used as a filter when + explicitly provided via ``ex_force_service_name``. + + (#2074) + [Miguel Caballer - @micafer] + +- [Compute] Unify ``NodeDriver`` method signatures across drivers. + + Driver implementations now preserve the standard argument order and + optionality declared by ``NodeDriver``. Provider-specific arguments follow + the standard arguments and are optional. ``list_nodes`` is excluded because + its ``*args, **kwargs`` contract is intentionally unrestricted. + + This can be a backward-incompatible change for code which passes arguments + positionally to affected methods. + + (#2170) + [Miguel Caballer - @micafer] + +- [DigitalOcean] Include IPv6 addresses in ``Node.public_ips`` and + ``Node.private_ips``. Only the ``v4`` networks were inspected, and each + address overwrote the previous one, so a droplet's public IPv6 address was + silently dropped. + (GITHUB-1738) + [Sanjay Santhanam - @Sanjays2402] + +- [SSH] Support paramiko 4 + + RSA key support has been removed as of paramiko 4, so only import it + and check if the version number is less than 4. + (#2135) + [Steve Kowalik - @s-t-e-v-e-n-k] + +- [Azure ARM] Fix ``create_node`` failing with a JSON serialization error when + ``ex_customdata`` is provided. The base64 encoded custom data is now decoded + to a ``str`` and both ``str`` and ``bytes`` inputs are accepted. + (GITHUB-1893) + [Sanjay Santhanam - @Sanjays2402] + +- [UpCloud] + + Add new functions to complete the Upcloud driver and move it to the + last API version 1.3 + (#2147) + [Miguel Caballer - @micafer] + +Storage +~~~~~~~ + +- [Local Storage] Delete the partially written file when ``download_object_range`` + fails and ``delete_on_failure`` is set. + (GITHUB-2223) + [Rahul - @raamrutsagarb25-tech] + +- [S3] Fix ``get_object_cdn_url`` computing invalid signatures when using + a non-standard port + (#2222) + [Valentin Lorentz - @progval] + +- [S3] Add ``ex_allow_path_double_slashes`` to preserve object key slashes + per driver without changing the global URL normalization setting. + (GITHUB-1654) + [Shubham Padkonde - @Shubham-Padkonde] + +- [Local] Stream range downloads in bounded chunks without reading the entire + source file or buffering the complete range before writing it to disk. + (GITHUB-2191) + [Neha Mahesh - @mneha05] + +- [Local Storage] Fix upload errors being suppressed when locking is disabled + with ``ex_use_locking=False``. The original exception now propagates instead + of the upload appearing to succeed. + (#2204) + [@JunaidAhamed-7777] + +- [Local Storage] Release the thread lock if IPC lock acquisition fails, + allowing the same lock object to be reused after a timeout or error. + (#2203) + +- [Local Storage] Prevent source objects from being deleted when + ``download_object`` is called with a destination that resolves + to the source file. + (#2201) + [Zhe Chen - @zhechen-cs] + +- [Storage] Prevent path traversal when downloading objects to a directory by + using only the object name's basename as the local filename. + (#2206) + [Miguel Caballer - @micafer] + +- [Azure Blobs] Fix SAS signatures for percent-encoded object paths by using + the decoded path in the canonicalized resource while preserving the encoded + path in the returned URL. + (GITHUB-1805) + [Jack Chen - @nightcityblade] + +- [S3] Fix ``chunk_size`` argument being ignored by + ``download_object_as_stream`` and ``download_object_range_as_stream``. The + requested chunk size is now passed through to the underlying iterator + instead of the hardcoded default. + (GITHUB-1798) + + [Sanjay Santhanam - @Sanjays2402] + +- [Azure Blobs] Fix ``chunk_size`` argument being ignored by + ``download_object_as_stream`` and ``download_object_range_as_stream``. The + requested chunk size is now forwarded to the underlying iterator instead of + always using ``AZURE_DOWNLOAD_CHUNK_SIZE``. + (GITHUB-1698) + + [Sanjay Santhanam - @Sanjays2402] + +DNS + +- [Route53] Fix ``delete_record`` failing with ``RecordDoesNotExistError`` for + records which are part of a multi value record set (e.g. MX). Route53 only + accepts a DELETE changeset which lists every value in the record set, so the + values of the other records in the set are now included, mirroring how + ``update_record`` already handles multi value records. + (GITHUB-1831) + [Sanjay Santhanam - @Sanjays2402] + +- [Cloudflare] Fix ``list_record_types`` advertising the unsupported ``URL`` + record type instead of ``LOC``. The ``RECORD_TYPE_MAP`` entry was keyed on + ``RecordType.URL`` while its value was ``"LOC"``; the key is now + ``RecordType.LOC`` so Cloudflare's supported ``LOC`` record type is reported + and the unsupported ``URL`` type is not. + (#2175) + [Uttam Limbani - @uttam12331] + +- [BuddyNS, DNSPod, LuaDNS, NsOne] Fix the shared class-level ``errors`` and + ``objects`` lists in the four DNS response classes. The lists now live on + each response instance, so parsed records no longer accumulate across + responses and error state no longer leaks between requests. + (GITHUB-2216) + [Hisernberg - @Hisernberg] + +Container +~~~~~~~~~ + +- [Docker] Fix ``deploy_container()`` overriding the image's default command + with ``['None']`` when no command is supplied. Explicit commands retain + their existing parsing behavior. + (GITHUB-2226, #2228) + [@fbccsz] + +Changes in Apache Libcloud 3.9.1 +-------------------------------- + +Compute +~~~~~~~ + +- [VSphere] Add verify_ssl option + + Add verify_ssl option, to enable the user to avoid SSL verification explicitly. + (#2128) + [Miguel Caballer - @micafer] + +- [OpenStack] Initial Blazar support + + This is an initial implementation of Blazar support in Libcloud. It currently + supports listing the available leases and hosts. + (#2094) + [Miguel Caballer - @micafer] + + +- [Azure ARM] Update US GovCloud AD endpoint for AZURE_ARM provider. + (#2062) + [Chris Clifford - @CrCliff] + +- [OpenStack] Add hypervisor_hostname attribute to OpenStack node. + (#2063) + [Miguel Caballer - @micafer] + + +- [GCP] Use the fully-qualified name for the GCP IMDS endpoint. + (#2060) + [Frederic Hemery - @Arkelenia] + +- [Azure ARM, Amazon S3] Add signed upload to azure and s3. + (#2058) + [Pablo Nicolás Estevez - @Polandia94] + +- [RcodeZero]: Fix issue when adding a record where a record with a different type already exists + (#2038) + [Michael Braunöder - @MikeAT] + +DNS +~~~~ + +- [Cloudflare] Removal of zone_name from Cloudflare record response following API deprecation + + This change will cause that record name returned by the Cloudflare driver to be fully + qualified (e.g. "www.example.com") instead of relative to the zone (e.g. "www"). + This is due to the fact that Cloudflare has deprecated the "zone_name" field in their + API response and it is no longer available. + (#2068) + [Chris Smith - cha0tic87] + +- [Luadns] Fix example keyword arguments. + (#2064) + [Aaron Sierra - @aaron-sierra] + +Changes in Apache Libcloud 3.9.0 +-------------------------------- + +Common +~~~~~~ + +- Support for Python 3.9 which is EOL has been removed. + + If you still want to use Libcloud with Python 3.9, you should use an older + release which still supports Python 3.9. + (#2093, #2085) + [Zili Chen - @tisonkun, Chojan Shang - @PsiACE] + +- Indicate we also support Python 3.12 (non beta) and Python 3.13. + (#2050) + [Tomaz Muraus - @Kami] + +- Support for Python 3.8 which is EOL has been removed. + + If you still want to use Libcloud with Python 3.8, you should use an older + release which still supports Python 3.8. + (#2050) + [Tomaz Muraus - @Kami] + +- Support for Python 3.7 which is EOL has been removed. + + If you still want to use Libcloud with Python 3.7, you should use an older + release which still supports Python 3.7. + (#1941) + [Tomaz Muraus - @Kami] + +- Types inheriting from ``libcloud.common.types.Type`` have been made hashable. + This way they can be directly used for testing memberships in sets which + contain string representation of the type enum value + (e.g. ``NodeState.RUNNING in {"running"} == True``). + (#1944) + [Ricardo Branco - @ricardobranco777] + +- [NTT CIS] Fix invalid comparison in the ``XmlListConfig.__init__()`` method. + (#1940) + [@munahaf on behalf of OpenRefactory and Open Source Security Foundation] + +- Update versions of build and packaging tools required to build the package. + + Per report from Rui Chen (@chenrui333) ansible homebrew package which + depends on libcloud was failing to build with Libcloud 3.8.0. + + Special thanks to Rui Chen for their assistance with troubleshooting the issue + and testing v3.9.0 release candidate. + (#2047) + [Tomaz Muraus - @Kami, Rui Chen - @chenrui333] + +Compute +~~~~~~~ + +- [OpenStack] Add optional node port ID to attach the floating IP in OpenStack + ex_attach_floating_ip_to_node function. + (#2028) + [Miguel Caballer - @micafer] + +- [OpenStack] Add metadata fields ``os_distro`` and ``os_version`` provided + by OpenStack Image API (if set) to the ``extra`` field of the OpenStack NodeImage. + (#1982) + [Miguel Caballer - @micafer] + +- [LINODE] Add support for cloud-init metadata support to create_node() + Add new functions ``create_key_pair``, ``list_key_pairs``, and ``get_image`` + (#1946) + [Michael Galaxy - @mraygalaxy2] + +- [Azure ARM] Add a new argument to destroy_node() to also delete node's + managed OS disk as part of the node's deletion. + (#1957) + [Victor Herrero Otal - @vicwicker] + +- [ECS] Add VPC IP and Elastic IP to ECS node as private and public IP. + (#1954) + [Victor Herrero Otal - @vicwicker] + +- [Azure ARM] When deleting a node, delete VM OS disk if it's a managed disk. + (#1957) + [Victor Herrero Otal - @vicwicker] + +- [Azure ARM] Add ``ex_resize_node()`` method. + (#1964 #1965) + [@rajat-garg-del] + +- [Equinix Metal] Fix ``list_nodes()`` method so it correctly handles + NodeSize.ram attribute in case TB is returned. + + (#1973) + [Denis Lussier - @luss] + +- [Equinix Metal] Deprecate facility API and replace it with metros location. + + (#1971) + [Aayush Rangwala - @aayushrangwala] + +- [Equinix Metal] Remove all the methods for managing volumes and volume + snapshots. This functionality hasn't been supported on the server side + for many years already. + + Corresponding `disk` and `disk_size` argument has also been removed from + the `create_node()` method. + + (#1972) + [Aayush Rangwala - @aayushrangwala, Tomaz Muraus - @Kami] + +- [Amazon EC2] Update pricing and sizing data. + (#2012) + [Eric Anderson - @eric-anderson] + +- [OpenStack] Add `is_default` and `tags` extra fields to the OpenStack + Network Object (`OpenStackNetwork`). + (#2016) + [Miguel Caballer - @micafer] + +- [KubeVirt] Various improvements and fixes in the driver: + * Improve compatibility with the base NodeDriver class + * Support for deployment (`deploy_node()`) + * Support for general volume (disks) types that KubeVirt supports + * Add support for the `ex_template` parameter in `create_node()` method + * Various improvements in `_to_node()` related to node information parsing + * Improved test suite + * Code refactoring and improvements + + (#1983) + [@cdfmlr] + +- [Amazon S3] Add support for ``me-central-1`` region. + (#2030) + [@seifertdan] + +Storage +~~~~~~~ + +- [Amazon S3] Add support for ``eu-south-1`` region. + (#1950) + [@H3199] + +- [Amazon S3] Add support for ``eu-west-3`` region. + (#1996) + [Salih Kerem Dokuz - @keremdokuz] + +Other / Development +~~~~~~~~~~~~~~~~~~~ + +- Adopt uv for dependency management. + + This should make it easier to manage dependencies and update them in the + future. + + (#2102) + [Chojan Shang - @PsiACE] + +- pytest library used for running tests and microbenchmarks has been upgraded to + v8.1. + + Changes in the pytest test discovery and collection mechanism and ordering + have uncovered some race conditions and cross test pollution which has been + addressed. + + Now all the tests are passing, but it's possible that there are still some + race conditions hiding which many only pop up in the future (since we run + tests in parallel and order in which they run is not fully deterministic). + (#1994) + [Tomaz Muraus - @Kami] + +- Add a workaround so tests work with pytest >= 8.2. Also use latest version of + pytest for running tests. + (#2033) + [Steve Kowalik - @s-t-e-v-e-n-k] + +Changes in Apache Libcloud 3.8.0 +-------------------------------- + +Compute +~~~~~~~ + +- Remove obsolete compute driver where the provider is either dead or not + offering those services anymore: Bluebox, bsnlcloud, Cloudwatt, Enomaly, + ElasticHosts, ElasticStack, GoGrid, Gridspot, HostVirtual, Joyent, Med-1, + Nephoscale, 1on1, ProfitBricks, ServerLove, SkaliCloud, Softlayer, Voxel. + + (#1743, #1852) + [Anthony Monthe - @ZuluPro, Tomaz Muraus - @Kami] + +- [Outscale] Fix ``list_nodes()`` and ``list_volumes()`` method. + (#1877) + [Matthias Gatto - @outscale-mgo] + +- [Azure ARM] Implement pagination in the ``list_nodes()`` method. This fixes a + bug which would result in sometimes not all the nodes being returned. + (#1824, #1850) + [Jan Müller - @ojan-mue] + +- [Azure ARM] Implement pagination in the ``list_volumes()`` method. This fixes a + bug which would result in sometimes not all the volumes nodes being returned. + (#1891) + [Jan Müller - @ojan-mue] + +- [Azure ARM] Bump DISK_API_VERSION from ``2018-06-01`` to ``2023-01-02`` to + support premium v2 SSDs. + (#1904) + [John Wren Kennedy - @jwk404] + +- [AWS EC2] Add support for the following new arguments to the + ``ex_register_image()`` method: + * ``boot_mode`` - control bios vs uefi boot + * ``tpm_support`` - enable a tpm + * ``uefi_data`` - provide NV UEFI vars + * ``imds_support`` - require IMDSv2. + (#1906) + [Ross Vandegrift - @rvandegrift] + +Storage +~~~~~~~ + +- Optimize ``read_in_chunks()`` function implementation. + + This should result in large performance speedups and lower memory usage when + uploading or downloading a large file with a mismatching chunk size. + + Keep in mind that this only affects code paths where the function is called + with ``fill_size=True`` argument (such as in the S3 driver, etc). + (#1847) + [Tobias Biester - @Tobi995] + +- [Aliyun OSS] Fix ``upload_object()`` function. + (#1796) + [@shengwubin] + +- [S3] Support all available storage classes. Previously only "standard" and + "reduced_redundancy" were supported. + (#1875) + [Mohammad Aburadeh - @mohammad-aburadeh] + +- [CloudFiles] Fix ``get_endpoint_url()`` throwing an exception when being used + with ``use_internal_url=True`` argument. + (#1883, #1884) + [Marcus T - @llamasoft] + +- [CloudFiles] Update OpenStack connection handling code to only re-connect in + case connection details (scheme, host, port) have changed. + + This should result in significant performance improvements when downloading + objects since the underlying HTTP connection will be properly re-used. + (#1885, #1886) + [Marcus T - @llamasoft] + +- [Backblaze B2] Fix a bug which would result in an exception when passing + ``extra={"meta_data": {}}`` argument to the ``upload_object()`` method. + (#1916) + [Shepilov Vladislav - @shepilov-vladislav] + +Other +~~~~~ + +- Move Python tooling (pytest, bandit, pylint, mypy, coverage) config options + from separate config files into single pyproject.yaml config files. + + NOTE: This change only affects development process and nothing else. + (#1901) + [RS Nikhil Krishna - @rsnk96] + +- Fix minor typos in the code using codespell package and enforce this check as + part of our GHA CI system. + (#1923) + [Tomaz Muraus - @Kami] + +- Indicate we also support Python 3.12 (beta). + (#1920) + [Tomaz Muraus - @Kami] + +- Remove unused ``libcloud.security.SSL_VERSION`` constant / module level + variable. This variable has been unused and had no affect on the behavior + since we switched to the ``requests`` library for making HTTP(s) requests in + 2016. + [Tomaz Muraus - @Kami] + +- Packaging related metadata has been migrated from ``setup.py`` to + ``pyproject.yaml`` file. + (#1929) + [Tomaz Muraus - @Kami] + +- Deprecated and unsafe ``setup.py test`` convenience alias for running tests + using pytest has been removed in favor of running pytest directly. + (#1929) + [Tomaz Muraus - @Kami] + +- Script for building release artifacts has been updated to utilize ``build`` + Python package to build release artifacts (sdist + wheel) in an isolated + environment. + (#1929) + [Tomaz Muraus - @Kami] + +Changes in Apache Libcloud 3.7.0 +-------------------------------- + +Common +~~~~~~ + +- Support for Python 3.6 which has been EOL for more than a year now has been + removed. + + If you still want to use Libcloud with Python 3.6, you should use an older + release which still supports Python 3.6. + (#1611) + +Compute +~~~~~~~ + +- [CloudSigma] Update API URLs for US locations. + (#1781) + [Mohsen Hassani - @mohsen-hassani-cs] + +- [GCP] Fix OAuth2 desktop client login. + (#1806, #1807) + [Veith Röthlingshöfer - @RunOrVeith] + +Storage +~~~~~~~ + +- [Amazon S3] Add support for ``af-south-1`` region. + (#1821) + [@alier350] + +Other +~~~~~ + +- Also run unit tests under Python 3.11 on CI/CD and indicate we also support + Python 3.11. + (#1818) + +Changes in Apache Libcloud 3.6.1 +-------------------------------- + +Common +~~~~~~ + +- [OpenStack] Fix OpenStack Identitiy bug when auth url contains a path. + + (#1717, #1718) + [Dimitris Galanis - @dimgal1] + + +- Update EC2 price scraping script to utilize official pricing API endpoint. + + Pricing file has also been updated to include latest EC2 pricing data. + + Complete raw pricing data file size has grown by ~1 MB (from ~2 MB to + ~3 MB). + + By default when requesting pricing data we only cache pricing data in memory + for used / requested drivers so a slight memory increase due to the pricing + file size increase will only affect users who utilize pricing related + functionality in the EC2 driver. + + (#1715) + [Eis D. Zaster - @Eis-D-Z] + +Compute +~~~~~~~ + +- [EC2] Update ``list_images()`` method to better handle scenario when an image + doesn't contain ``creationDate`` attribute (previously the code would throw if + an image without ``creationDate`` was encountered). + + Reported by Juan Marcos Caicedo Mejía - @juanmarcosdev. + + (#1700, #1701) + [Tomaz Muraus - @Kami] + +- [Azure ARM] Allow user to create volume / disks in specific zone by passing + ``ex_zones`` argument to the ``create_volume()`` method. + + Also add new ``ex_sku_name`` and remove ``ex_account_type`` argument from + that method. + + Also change ``DISK_API_VERSION`` version from ``2016-04-30-preview`` to + ``2018-06-01``. This is needed to be able to support those changes. Code + has been updated to handle slightly different response format for the + volume API operations. + + (#1736) + [Palash Gandhi - @palashgandhi] + +- [GCE] Add improved support for retrieving GCE image pricing data using + ``libcloud.pricing.get_image_price("gce_images", ...)`` method. + + Existing way of retrieving image pricing using + ``libcloud.pricing.get_pricing("compute", "gce_images")`` method continues to + work. + + (#1699) + [Eis D. Zaster - @Eis-D-Z] + +- [Azure ARM] Add new ``ex_create_additional_capabilities()`` method which allows + user to set capabilities on a stopped node. This allows users to utilize ultra + SSDs and similar. + + Also add support for new ``ex_iops`` and ``ex_throughput`` argument to the + ``create_volume()`` method. + + (#1744) + [John Wren Kennedy - @jwk404] + +Storage +~~~~~~~ + +- [Azure Blobs] Fix ``get_container()`` method and make sure Container ``etag`` + extra attribute contains the correct scheme (https or http), depending on the + used endpoint. + + (#1703, #1712) + [@KatiRG] + +- [Azure Blobs] Fix `list_containers()`` method and make sure Container ``etag`` + extra attribute doesn't contain unncessary double quotes around the value + (``"0x8CFBAB7B5B82D8E"`` -> ``0x8CFBAB7B5B82D8E``). + + (#1712) + [Tomaz Muraus - @Kami] + +- [OVH] Add new driver for OVH Storage based on the S3 compatible storage + endpoints. + + (#1732) + [Olivier Picquenot - @pcqnt] + +Other / Development +~~~~~-------------- + +- All the imports in the code have been re-organized / sorted using the ``isort`` + library. + + Going forward, consistent import ordering will be automatically enforced + using ``isort`` check on the CI. + + Developers can run the isort check locally using + ``tox -e `` command. + + (#1761) + [Tomaz Muraus - @Kami] + +- Fix black config (``pyproject.toml``) and ensure max line length is correctly + set to 100 characters everywhere. + + Also re-format code with this fixed / updated config option. + + (#1761) + [Tomaz Muraus - @Kami] + +- Code has been reformatted using pyupgrade and Python 3.6 higher compatible + syntax. + + (#1765) + [Tomaz Muraus - @Kami] + +Changes in Apache Libcloud 3.6.0 +-------------------------------- + +Compute +~~~~~~~ + +- [OpenStack] Fix error attaching/detaching a Floating IP to an OpenStack node + when `ex_force_microversion` is set with 2.44 or newer microversion. + + (#1674) + [Miguel Caballer - @micafer] + +- [OpenStack] Error in volume api calls if microversion is set in OpenStack. + In previous version if `ex_force_microversion` is set, it is assumed to set + it to the compute service. Now if only a version is set `2.67`, compute + service is assumed but it can be also set the service name `volume 3.21`. + + (#1675) + [Miguel Caballer - @micafer] + +- [OpenStack] Fix error creating and getting node in OpenStack when + ex_force_microversion is set to a version newer than 2.47. + + (#1672) + [Miguel Caballer - @micafer] + +- [EC2] Add support for new ``af-south-1`` region. + (#1688) + [Balazs Baranyi - @balazsbaranyi] + +- [SSH] Update deploy node and ParamikoSSHClient related code so it works + with paramiko >= 2.9.0 and older OpenSSH server versions which doesn't + support SHA-2 variants of RSA key verification algorithm. + + paramiko v2.9.0 introduced a change to prefer SHA-2 variants of RSA key + verification algorithm. With this version paramiko would fail to connect + to older OpenSSH servers which don't support this algorithm (e.g. default + setup on Ubuntu 14.04) and throw authentication error. + + The code has been updated to be backward compatible. It first tries to + connect to the server using default preferred algorithm values and in case + this fails, it will fall back to the old approach with SHA-2 variants + disabled. + + This functionality can be disabled by setting + ``LIBCLOUD_PARAMIKO_SHA2_BACKWARD_COMPATIBILITY``environment variable to + ``false``. + + For security reasons (to prevent possible downgrade attacks and similar) you + are encouraged to do that in case you know you won't be connecting to any old + OpenSSH servers. + [Tomaz Muraus] + +Storage +~~~~~~~ + +- [Google Storage] Fix public objects retrieval. In some scenarios, Google + doesn't return ``etag`` header in the response (e.g. for gzip content + encoding). The code has been updated to take this into account and not + throw if the header is not present. + + (#1682, #1683) + [Veith Röthlingshöfer - @RunOrVeith] + +- [Azure Blobs] Add support for authenticating with Azure AD by passing + ``auth_type="azureAd"`` argument to the driver constructor. + + (#1663) + [Brooke White - @brookewhite9] + +DNS +~~~ + +- [GoDaddy] Fix ``list_zones()`` method so it doesn't throw if an item is + missing ``expires`` attribute. + (#1681) + [Dave Grenier - @livegrenier] + +Container +~~~~~~~~~ + +- [Kubernetes] Various improvements in the driver - implement list methods for + nodes, services, deployments, node/pod metrics, add more fields to Pods and + Containers, rename clusters to namespaces, add type annotations. + + (#1667) + [Dimitris Galanis - @dimgal1] + +Other +~~~~~ + +- Test code has been updated to utilize stdlib ``unittest.mock`` module instead + of 3rd party PyPi ``mock`` package. + + (GITHUG-1684) + Reported by @pgajdos. + +Changes in Apache Libcloud 3.5.1 +-------------------------------- + +Common +~~~~~~ + +- Update code which retries failed HTTP requests to also retry failed "raw" + requests and make sure we also wrap and retry piece of code where Response + class is instantiated and exceptions can be thrown. + [Daniel Draper - @Germandrummer92] + (#1592) + +Compute +~~~~~~~ + +- [GCE] Retrieve regions and zones lazily when they are first accessed (via + self.zone_{dict,list} and self.region_{dict,list} attribute) instead of + retrieving them inside the driver constructor. + + (#1661, #1661) + [Dimitris Galanis - @dimgal1] + +Changes in Apache Libcloud 3.5.0 +-------------------------------- + +Common +~~~~~~ + +- Support for Python 3.5 which has been EOL for more than a year now has been + removed. + + If you still want to use Libcloud with Python 3.5, you should use an older + release which still supports Python 3.5. + (#1620) + +- Update AWS error response parsing code so it also correctly handles error XML + responses without a namespace in the response body. + + In some scenarios AWS returns error response without the namespace in the body + and previous version of the code didn't handle that scenario. + [Tomaz Muraus - @Kami] + +Compute +~~~~~~~ + +- [EC2] Add support for new ``ap-east-1`` region. + (#1628) + [Arturo Noha - @r2ronoha, Tomaz Muraus - @Kami] + +- [OpenStack] Add Server Groups functions in OpenStack driver. + (#1629) + [Miguel Caballer - @micafer] + +- [OpenStack] OpenStack: Move floating IP functions to use network service + instead of nova. + + This change affects all the floating ip related functions of the + ``OpenStack_2_NodeDriver`` class. Two new classes have been added + ``OpenStack_2_FloatingIpPool`` and ``OpenStack_2_FloatingIpAddress``. + The main change applies to the FloatingIP class where ``node_id`` + property cannot be directly obtained from FloatingIP information and it + must be gotten from the related Port information with the ``get_node_id`` + method. + (#1638) + [Miguel Caballer - @micafer] + +- [OpenStack] Avoid raising exception if ip is not found. + (#1595) + [Miguel Caballer - @micafer] + +- [Azure ARM] Add option to create node from Compute Gallery image. + (#1643) + [Robert Harris - @rgharris] + +- [Azure ARM] Add create node OS disk delete option. + (#1644) + [Robert Harris - @rgharris] + +- [EC2] Add missing ``creation_date`` NodeImage extra. + (#1641) + [Thomas JOUANNOT - @mazerty] + +- [GCE] Allow ``credentials`` argument which is provided to the driver + constructor to also be either a Python dictionary with the credentials object + or a JSON string with the serialized credentials object. That's in addition + to supporting passing in path to the credentials file or string PEM version of + the key. + (#1214) + [@bverschueren] + +- [OpenStack] Personality field in the server requests of OpenStack must + be optional + (#1649) + [Miguel Caballer - @micafer] + +- [OpenStack] headers field are overwrited in case of POST of + PUT methods in OpenStack connection + (#1650) + [Miguel Caballer - @micafer] + +- [EC2] Update supported EC2 regions and instance sizes and add support + for eu-south-1 region. + (#1656) + [Arturo Noha - @r2ronoha] + +- [OpenStack] Add new ``ex_force_microversion`` constructor argument with which + user can specify which micro version to use ( + https://docs.openstack.org/api-guide/compute/microversions.html). + (#1647, #1648) + +- [GCE] Add ``paginated_request()`` method to GCEConnection and update + ``ex_list_project_images()`` method to utilize it. + (#1646, #1655) + [Miguel Caballer - @micafer] + +- [OpenStack] Fix regression which was inadvertently introduced in #1557 which + would cause some OpenStack authentication methods to not work and result in + an exception. + + Reported by @LanderOtto via #1659. + (#1659, #1660) + [Tomaz Muraus - @Kami] + +Storage +~~~~~~~ + +- [Local Storage] Fix object name prefix based filtering in the + ``list_container_objects()`` method. + + A change in the previous release inadvertently introduced a regression which + changed the behavior so the object name prefix based filtering didn't work + correctly in all the scenarios. + + Reported by @louis-van-der-stam. + (#1631) + [Tomaz Muraus - @Kami] + +- [Local Storage] Objects returned by the ``list_container_objects()`` method + are now returned sorted in the ascending order based on the object name. + + Previously the order was arbitrary and not stable and consistent across + different environments and runs. + + (#1631) + [Tomaz Muraus - @Kami] + +- [Scaleway] Add new driver for the Scaleway Object Storage. + (#1633) + [@reixd] + +Other +~~~~~ + +- Also run unit tests under Python 3.10 + Pyjion on CI/CD. + (#1626) + +- All the code has been reformatted using black v21.10b0 and we will enforce + black code style for all the new code going forward. + + Developers can re-format their code using new ``black`` tox target (``black + -etox``) and they can check if there are any violations by running + ``black-check`` target (``tox -eblack-check``). + (#1623, #1624) + +Changes in Apache Libcloud 3.4.1 +-------------------------------- + +.. note:: + + Libcloud depends on the ``requests`` library for performing HTTP(s) requests. + + Prior to ``requests`` v2.26.0, ``requests`` depended on ``chardet`` library + which is licensed under LGPL (requests library itself is licensed under the + Apache License 2.0 license). + + Since Libcloud is not an application, but a library which is usually used + along many other libraries in the same (virtual) environment, we can't have + a strict dependency on requests >= 2.26.0 since that would break a lot of + installations where users already depend on and have an older version of + requests installed. + + If you are using requests < 2.26.0 along the Libcloud library you are using + version of chardet library (chardet is a direct dependency of the requests + library) which license is not compatible with Apache Libcloud. + + If using a LGPL dependency is a problem for your application, you should + ensure you are using requests >= 2.26.0. + + It's also worth noting that Apache Libcloud doesn't bundle any 3rd party + dependencies with our release artifacts - we only provide source code + artifacts on our website. + + When installing Libcloud from PyPi using pip, pip will also download and use + the latest version of requests without the problematic chardet dependency, + unless you already have older version of the requests library installed in + the same environment where you also want to use Libcloud - in that case, + Libcloud will use the dependency which is already available and installed. + +Common +~~~~~~ + +- Fix a regression which was inadvertently introduced in v3.4.0 which prevented + users from installing Libcloud under Python 3.5. + + Also revert ``requests`` minimum version required change and relax the + minimum version requirement. + + Previous change would prevent Libcloud from being installed in environments + where a conflicting (lower) version of requests library is required and + already installed. + + As a library and not an application, Libcloud should specify as loose + requirements as possible to prevent issues with conflicting requirements + versions which could prevent Libcloud from being installed. + (#1594) + +Changes in Apache Libcloud 3.4.0 +-------------------------------- + +Common +~~~~~~ + +- Fix how we set HTTP request timeout on the underlying requests session + object. requests library has changed how timeout is set so our old + code had no affect. + + (#1575, #1576) + [Dimitris Galanis - @dimgal1] + +- Update setup.py metadata and indicate we also support Python 3.10. + +- [Google] Update Google authentication code so so we don't try to contact + GCE metadata server when determining auth credentials type when oAuth 2.0 / + installed app type of credentials are used. + + (#1591, #1621) + + Reported by Veith Röthlingshöfer - @RunOrVeith. + +- [Google] Update Google authentication code so we don't try to retry failed + request when trying to determine if GCE metadata server is available when + retrying is enabled globally (either via module level constant or via + environment variable value). + + This will speed up scenarios when trying is enabled globally, but GCE + metadata server is not available and different type of credentials are used + (e.g. oAuth 2). + + (#1591, #1621) + + Reported by Veith Röthlingshöfer - @RunOrVeith. + +- Update minimum ``requests`` version we require as part for install_requires + in setup.py to ``2.26.0`` when using Python >= 3.6. + + This was done to avoid licensing issue with transitive dependency + (``chardet``). + + NOTE: requests ``>=2.25.1`` will be used when using Python 3.5 since 2.26.0 + doesn't support Python 3.5 anymore. + + For more context, see https://github.com/psf/requests/pull/5797. + (#1594) + + Reported by Jarek Potiuk - @potiuk. + +- Update HTTP connection and request retry code to be more flexible so user + can specify and utilize custom retry logic which can be configured via + connection retryCls attribute + (``driver.connection.retryCls = MyRetryClass``). + + (#1558) + [Veith Röthlingshöfer - @RunOrVeith] + +- HTTP connection and request retry logic has been updated so we still respect + ``timeout`` argument when retrying requests due to rate limit being reached + errors. Previously, we would try to retry indefinitely on + ``RateLimitReachedError`` exceptions. + +Storage +~~~~~~~ + +- [Azure Blobs] Respect Content-Encoding, Content-Language and Cache-Control + headers when uploading blobs via stream. + + Reported by Veith Röthlingshöfer - @RunOrVeith. + (#1550) + +- [Azure Blobs] Enable the Azure storage driver to be used with + Azure Government, Azure China, and Azure Private Link by setting + the driver host argument to the endpoint suffix for the environment. + + Reported by Melissa Kersh - @mkcello96 + (#1551) + +- [Local Storage] Optimize ``iterate_container_objects`` method to perform + early filtering if ``prefix`` argument is provided. + (#1584) + [@Ido-Levi] + +Compute +~~~~~~~ + +- [Equinix Metal] Various improvements to the driver. + + (#1548) + [Dimitris Galanis - @dimgal1] + +- [OpenStack] Fix error getting non existing description of Ports. + + (#1543) + [Miguel Caballer - @micafer] + +- [Outscale] Various updates to the driver. + (#1549) + [Tio Gobin - @tgn-outscale] + +- [Ovh] Fix driver so it doesn't throw if a node is in resizing state. + (#1555) + [Rob Juffermans - @robjuffermans] + +- [OpenStack] Support volume v3 API endpoint in OpenStack driver. + + (#1561) + [Miguel Caballer - @micafer] + +- [GCE] Get accelerators field in the GCE machineType. + + (#1565) + [Miguel Caballer - @micafer] + +- [OpenStack] Support updating ``allowed_address_pairs`` on OpenStack ports + using ``ex_update_port`` method. + (#1569) + [@dpeschman] + +- [OpenStack] Enable to get Volume Quota details in OpenStack driver. + + (#1586) + [Miguel Caballer - @micafer] + +- [OpenStack] Add disabled property to OpenStack images. + + (#1615) + [Miguel Caballer - @micafer] + +- [CloudSigma] Various updates, improvements and new functionality in the + driver (support for new regions, instance types, additional standard API an + extension methods, etc.). + + (#1558) + [Dimitris Galanis - @dimgal1] + +- [OpenStack] Add binding:host_id value to the OpenStack port information. + (#1492) + [Miguel Caballer - @micafer] + +- [EC2] Add support for ``gp3`` and ``io2`` volume types. Also add + ``ex_throughput`` argument to the ``create_volume`` method. + (#1596) + [Palash Gandhi - @palashgandhi] + +- [OpenStack] Add support for authenticating using application credentials. + (#1597, #1598) + [Daniela Bauer - @marianne013] + +- [OpenStack] Add support for using optional external cache for auth tokens + + This cache can be shared by multiple processes which results in much less + tokens being allocated when many different instances / processes + are utilizing the same set of credentials. + + This functionality can be used by implementing a custom cache class with + caching logic (e.g. storing cache context on a local filesystem, external + system such as Redis or similar) + using ``ex_auth_cache`` driver constructor + argument. + (#1460, #1557) + [@dpeschman] + +- [Vultr] Implement support for Vultr API v2 and update driver to use v2 by + default. + (#1609, #1610) + [Dimitris Galanis - @dimgal1] + +DNS +~~~ + +- [CloudFlare] Enable authentication via API Tokens. + [Clemens Wolff - @c-w] + +- [DigitalOcean] Fix ``create_record()`` and ``update_record()`` method and + pass ``None`` instead of string value ``null`` for priority, port and weight + parameters if they are not provided as method arguments. + (#1570) + [Gasper Vozel - @karantan] + +- [NSOne] Fix MX records and root domain handling. + (#1571) + [Gasper Vozel - @karantan] + +- [Vultr] Implement support for Vultr API v2 and update driver to use v2 by + default. + (#1609, #1610) + [Dimitris Galanis - @dimgal1] + +Other +~~~~~ + +- Fix ``python_requires`` setup.py metadata item value. + (#1606) + [Michał Górny - @mgorny] + +- Update tox targets for unit tests to utilize ``pytest-xdist`` plugin to run + tests in parallel in multiple processes to speed up the test runs. + (#1625) + +Changes in Apache Libcloud 3.3.1 +-------------------------------- + +Compute +~~~~~~~ + +- [EC2] Fix a regression introduced in v3.3.0 which would break EC2 driver for + some regions because the driver would incorrectly try to use signature version + 2 for all the regions whereas some newer regions require signature version 4 + to be used. + + If you are unable to upgrade, you can use the following workaround, as long + as you only use code which supports / works with authentication signature + algorithm version 4: + + .. sourcecode:: python + + import libcloud.common.aws + libcloud.common.aws.DEFAULT_SIGNATURE_VERSION = "4" + + # Instantiate affected driver here... + + Reported by @olegrtecno. + (#1545, #1546) + +- [EC2] Allow user to override which signature algorithm version is used for + authentication by passing ``signature_version`` keyword argument to the EC2 + driver constructor. + (#1546) + +Storage +~~~~~~~ + +- [Google Cloud Storage] Fix a bug and make sure we also correctly handle + scenario in ``get_object()`` method when the object size is returned in + ``x-goog-stored-content-length`` and not ``content-length`` header. + + Reported by Veith Röthlingshöfer - @RunOrVeith. + (#1544, #1547) + +- [Google Cloud Storage] Update ``get_object()`` method and ensure + ``object.size`` attribute is an integer and not a string. This way it's + consistent with ``list_objects()`` method. + (#1547) + +Changes in Apache Libcloud 3.3.0 +-------------------------------- + +Common +~~~~~~ + +- Fix a bug which would cause some prepared requests with empty bodies to be + chunked which would cause some of the provider APIs such as OpenStack to + return HTTP 400 errors. + (#1487, #1488) + [Michael Spagon - @mspagon] + +- Optimize various code imports (remove unnecessary imports, make some lazy, + etc.), so now importing most of the modules is around ~20-40% faster (~70 + vs ~140 ms) and in some cases such as EC2 driver even more. + + Now majority of the import time is spent in importing ``requests`` library. + (#1519) + [Tomaz Muraus] + +- ``libcloud.pricing.get_size_price()`` function has been updated so it only + caches pricing data in memory for the requested drivers. + + This way we avoid caching data in memory for drivers which may never be + used. + + If you want to revert to old behavior (cache pricing data for all the + drivers in memory), you can do that by passing ``cache_all=True`` argument + to that function or set ``libcloud.pricing.CACHE_ALL_PRICING_DATA`` module + level variable to ``True``. + + Passing ``cache_all=True`` might come handy in situations where you know the + application will work with a lot of different drivers - this way you can + avoid multiple disk reads when requesting pricing data for different drivers. + (#1519) + [Tomaz Muraus] + +- Advertise Python 3.9 support in setup.py. + +Compute +~~~~~~~ + +- [GCE] Fix ``ex_set_image_labels`` method using incorrect API path. + (#1485) + [Poul Petersen - @petersen-poul] + +- [OpenStack] Fix error setting ``ex_force_XXX_url`` without setting + ``ex_force_base_url``. + (#1492) + [Miguel Caballer - @micafer] + +- [EC2] Update supported EC2 regions and instance sizes and add support + for eu-north-1 region. + (#1486) + [Arturo Noha - @r2ronoha] + +- [Ovh] Add support for multiple regions to the driver. User can select + a region (location) by passing ``location`` argument to the driver + constructor (e.g. ``location=ca``). + (#1494) + [Dan Hunsaker - @danhunsaker] + +- [GCE] Add support for creating nodes without a service account associated + with them. Now when an empty list is passed for ``ex_service_accounts`` + argument, VM will be created without service account attached. + + For backward compatibility reasons, default value of ``None`` still means to + use a default service account. + (#1497, #1495) + [David Tomaschik - Matir] + +- [VSphere] Add new VMware VSphere driver which utilizes ``pyvmomi`` library + and works under Python 3. + + If you want to use this driver, you need to install ``pyvmomi`` dependency - + ``pip install pyvmomi`` + (#1481) + [Eis D. Zaster - @Eis-D-Z] + +- [OpenStack] Enable to get Quota Set detail. + (#1495) + [Miguel Caballer - @micafer] + +- [OpenStack] Add ex_get_size_extra_specs function to OpenStack driver. + (#1517) + [Miguel Caballer - @micafer] + +- [OpenStack] Enable to get Neutron Quota details in OpenStack driver. + (#1514) + [Miguel Caballer - @micafer] + +- [DigitalOcean] ``_node_node`` method now ensures ``image`` and ``size`` + attributes are also set correctly and populated on the ``Node`` object. + (#1507, #1508) + [@sergerdn] + +- [Vultr] Make sure ``private_ips`` attribute on the ``Node`` object is + correctly populated when listing nodes. Also add additional values to the + ``node.extra`` dictionary. + (#1506) + [@sergerdn] + +- [EC2] Optimize EC2 driver imports and move all the large constant files to + separate modules in ``libcloud/compute/constants/ec2_*.py`` files. + + Previously all the constants were contained in + ``libcloud/compute/constants.py`` file. That file was imported when importing + EC2 driver which would add unnecessary import time and memory overhead in case + this data was not actually used. + + Now most of the large imports are lazy and only happen when that data is + needed (aka when ``list_sizes()`` method is called). + + ``libcloud/compute/constants.py`` file has also been removed. + (#1519) + [Tomaz Muraus - @Kami] + +- [Packet / Equinix Metal] Packet driver has been renamed to Equinix Metal. If + your code uses Packet.net driver, you need to update it as per example in + Upgrade Notes documentation section. + (#1511) + [Dimitris Galanis - @dimgal1] + +- [OutScale] Add various extension methods to the driver. For information on + available extenion methods, please refer to the driver documentation. + (#1499) + [@tgn-outscale] + +- [Linode] Add support for Linode's API v4. + (#1504) + [Dimitris Galanis - @dimgal1] + +Storage +~~~~~~~ + +- Deprecated ``lockfile`` library which is used by the Local Storage driver has + been replaced with ``fasteners`` library. + [Tomaz Muraus - @Kami] + +- [S3] Add support for ``us-gov-east-1`` region. + (#1509, #1510) + [Andy Spohn - @spohnan] + +- [DigitalOcean Spaces] Add support for sfo2 regon. + (#1525) + [Cristian Rasch - @cristianrasch] + +- [MinIO] Add new driver for MinIO object storage (https://min.io). + (#1528, #1454) + [Tomaz Muraus - @Kami] + +- [S3] Update S3 and other drivers which are based on the S3 one (Google + Storage, RGW, MinIO) to correctly throw ``ContainerAlreadyExistsError`` if + container creation fails because container with this name already exists. + + Previously in such scenario, ``InvalidContainerNameError`` exception which + does not comply with the Libcloud standard API was thrown. + (#1528) + [Tomaz Muraus - @Kami] + +- Add new ``libcloud.common.base.ALLOW_PATH_DOUBLE_SLASHES`` module level + variable. + + When this value is set to ``True`` (defaults to ``False`` for backward + compatibility reasons), Libcloud won't try to sanitize the URL path and + remove any double slashes. + + In most cases, this won't matter and sanitzing double slashes is a safer + default, but in some cases such as S3, where double slashes can be a valid + path (e.g. ``/my-bucket//path1/file.txt``), this option may come handy. + + When this variable is set to ``True``, behavior is also consistent with + Libcloud versions prior to v2.0.0. + + Reported by Jonathan Hanson - @triplepoint. + (#1529) + [Tomaz Muraus - @Kami] + +DNS +~~~ + +- [Common] Fix a bug with the header value returned by the + ``export_zone_to_bind_format`` method containing an invalid timestamp (value + for the minute part of the timestamp was wrong and contained month number + instead of the minutes value). + + Reported by Kurt Schwehr - @schwehr. + + (#1500) + [Tomaz Muraus - @Kami] + +- [CloudFlare DNS] Add support for creating ``SSHFP`` records. + (#1512, #1513) + [Will Hughes - @insertjokehere] + +- [DigitalOcean] Update driver and make sure request data is sent as part of + HTTP request body on POST and PUT operations (previously it was sent as + part of query params). + (#1505) + [Andrew Starr-Bochicchio - @andrewsomething] + +- [AuroraDNS] Throw correct exception on 403 authorization failed API error. + (#1521, #1522) + [Freek Dijkstra - @macfreek] + +- [Linode] Add support for Linode's API v4. + (#1504) + [Dimitris Galanis - @dimgal1] + +- [CloudFlare] Update driver so it correctly throws + ``RecordAlreadyExists`` error on various error responses which represent + this error. + [Tomaz Muraus - @Kami] + +Changes in Apache Libcloud 3.2.0 +-------------------------------- + +Common +~~~~~~ + +- ``libcloud.pricing.download_pricing_file`` function has been updated so it + tries to download latest ``pricing.json`` file from our public read-only S3 + bucket. + + We now run a daily job as part of our CI/CD which scrapes provider prices and + publishes the latest version of the ``pricing.json`` file to that bucket. + + For more information, please see + https://libcloud.readthedocs.io/en/latest/compute/pricing.html. + +Compute +~~~~~~~ + +- [OpenStack] Add `ex_get_network()` to the OpenStack driver to make it + possible to retrieve a single network by using the ID. + + (#1474) + [Sander Roosingh - @SanderRoosingh] + +- [OpenStack] Fix pagination in the ``list_images()`` method and make sure + method returns all the images, even if the result is spread across multiple + pages. + + (#1467) + [Thomas Bechtold - @toabctl] + +- [GCE] Add script for scraping GCE pricing data and improve price addition in + ``_to_node_size`` method. + (#1468) + [Eis D. Zaster - @Eis-D-Z] + +- [AWS EC2] Update script for scraping AWS EC2 pricing and update EC2 pricing + data. + (#1469) + [Eis D. Zaster - @Eis-D-Z] + +- [Deployment] Add new ``wait_period`` argument to the ``deploy_node`` method + and default it to 5 seconds. + + This argument tells Libcloud how long to wait between each poll interval when + waiting for a node to come online and have IP address assigned to it. + + Previously this argument was not exposed to the end user and defaulted to 3 + seconds which means it would be quite easy to reach rate limits with some + providers when spinning up many instances concurrently using the same + credentials. + [Tomaz Muraus - @Kami] + +- [Azure ARM] Add script for scraping Azure ARM instance pricing data. + (#1470) + [Eis D. Zaster - @Eis-D-Z] + +- Update ``deploy_node()`` method to try to re-connect to the server if we + receive "SSH connection not active" error when trying to run a deployment + step. + + In some scenarios, connection may get closed by the server for whatever + reason before finishing all the deployment steps and in this case only + re-connecting would help and result in a successful outcome. + [Tomaz Muraus - @Kami] + +- [Deployment] Make ``FileDeployment`` class much faster and more efficient + when working with large files or when running multiple ``FileDeployment`` + steps on a single node. + + This was achieved by implementing two changes on the ``ParamikoSSHClient`` + class: + + 1. ``put()`` method now tries to re-use the existing open SFTP connection + if one already exists instead of re-creating a new one for each + ``put()`` call. + 2. New ``putfo()`` method has been added to the ``ParamikoSSHClient`` class + which utilizes the underlying ``sftp.putfo()`` method. + + This method doesn't need to buffer the whole file content in memory and + also supports pipelining which makes uploads much faster and more + efficient for larger files. + + [Tomaz Muraus - @Kami] + +- [Deployment] Add ``__repr__()`` and ``__str__()`` methods to all the + Deployment classes. + [Tomaz Muraus - @Kami] + +- [Deployment] New ``keep_alive`` and ``use_compression`` arguments have been + added to the ``ParamikoSSHClient`` class constructor. + + Right now those are not exposed yet to the ``deploy_node()`` method. + [Tomaz Muraus - @Kami] + +- [Deployment] Update ``ParamikoSSHClient.put()`` method so it returns a + correct path when commands are being executed on a Windows machine. + + Also update related deployment classes so they correctly handle situation + when we are executing commands on a Windows server. + [Arthur Kamalov, Tomaz Muraus] + +- [Outscale] Add a new driver for the Outscale provider. Existing Outscale + driver utilizes the EC2 compatible API and this one utilizes native Outscale + API. + (#1476) + [Tio Gobin - @tgn-outscale] + +- [KubeVirt] Add new methods for managing services which allows users to expose + ports for the VMs (``ex_list_services``, ``ex_create_service``, + ``ex_delete_service``). + (#1478) + [Eis D. Zaster - @Eis-D-Z] + +Container +~~~~~~~~~ + +- [LXD] Add new methods for managing network and storage pool capabilities and + include other improvements in some of the existing methods. + (#1477) + [Eis D. Zaster - @Eis-D-Z] + +Changes in Apache Libcloud 3.1.0 +-------------------------------- + +Compute +~~~~~~~ + +- [GCE] Add latest Ubuntu image families (Ubuntu 20.04) to the driver. + + (#1449) + [Christopher Lambert - @XN137] + +- [DigitalOcean] Add ``location`` argument to the ``list_sizes()`` method. + + NOTE: Location filtering is performed on the client. + (#1455, #1456) + [RobertH1993] + +- Fix ``deploy_node()`` so an exception is not thrown if any of the output + (stdout / stderr) produced by the deployment script contains a non-valid utf-8 + character. + + Previously, user would see an error similar to "Failed after 3 tries: 'utf-8' + codec can't decode byte 0xc0 in position 37: invalid start byte". + + And now we simply ignore byte sequences which we can't decode and include + rest of the output which can be decoded. + + (#1459) + [Tomaz Muraus - @Kami] + +- Add new ``timeout`` argument to ``ScriptDeployment`` and + ``ScriptFileDeployment`` class constructor. + + With this argument, user can specify an optional run timeout for that + deployment step run. + (#1445) + [Tomaz Muraus - @Kami] + +- [GiG G8] Fix retry functionality when creating port forwards and add support + for automatically refresing the JWT auth token inside the connection class if + it's about to expire in 60 seconds or less. + (#1465) + [Jo De Boeck - @grimpy] + +- [Azure ARM] Update ``create_node`` so an exception is thrown if user passes + ``ex_use_managed_disks=False``, but doesn't provide a value for the + ``ex_storage_account`` argument. + (#1448) + [@antoinebourayne] + +Storage +~~~~~~~ + +- [AWS S3] Make sure driver works correctly for objects with ``~`` in the name. + + Now when sanitizing the object name, we don't url encode ``~`` character. + + Reported by Michael Militzer - @mmilitzer. + (#1452, #1457) + [Tomaz Muraus] + +DNS +~~~ + +- [CloudFlare] Update driver to include the whole error chain the thrown + exception message field. + + This makes various issues easier to debug since the whole error context is + included. + [Tomaz Muraus] + +- [Gandi Live, CloudFlare, GCE] Add support for managing ``CAA`` record types. + + When creating a ``CAA`` record, data field needs to be in the following + format: + + `` `` + + For example: + + - ``0 issue caa.example.com`` + - ``0 issuewild caa.example.com`` + - ``0 iodef https://example.com/reports`` + + (#1463, #1464) + [Tomaz Muraus] + +- [Gandi Live] Don't throw if ``extra['rrset_ttl']`` argument is not passed + to the ``create_record`` method. + (#1463) + [Tomaz Muraus] + +Other +~~~~~ + +- Update ``contrib/Dockerfile`` which can be used for running tests so + it only run tests with Python versions we support. This means dropping + support for Python < 3.5 and adding support for Python 3.7 and 3.8. + + Also update it to use a more recent Ubuntu version (18.04) and Python 3 + for running tox target. + (#1451) + [Tomaz Muraus - @Kami, HuiFeng Tang - @99Kies] + +Changes in Apache Libcloud 3.0.0 +-------------------------------- + +Common +~~~~~~ + +- Make sure ``auth_user_info`` variable on the OpenStack identify connection + class is populated when using auth version ``3.x_password`` and + ``3.x_oidc_access_token``. + + (#1436) + [@lln-ijinus, Tomaz Muraus) + +- [OpenStack] Update OpenStack identity driver so a custom project can be + selected using ``domain_name`` keyword argument containing a project id. + + Previously this argument value could only contain a project name, now the + value will be checked against project name and id. + + (#1439) + [Miguel Caballer - @micafer] + +Compute +~~~~~~~ + +- [GCE] Update ``create_node()`` method so it throws an exception if node + location can't be inferred and location is not specified by the user ( + either by passing ``datacenter`` constructor argument or by passing + ``location`` argument to the method). + + Reported by Kevin K. - @kbknapp. + (#1443) + [Tomaz Muraus] + +- [GCE] Update ``ex_get_disktype`` method so it works if ``zone`` argument is + not set. + (#1443) + [Tomaz Muraus] + +- [GiG G8] Add new driver for GiG G8 provider (https://gig.tech/). + (#1437) + [Jo De Boeck - @grimpy] + +- Add new ``at_exit_func`` argument to ``deploy_node()`` method. With this + argument user can specify which function will be called before exiting + with the created node in question if the deploy process has been canceled + after the node has been created, but before the method has fully finished. + + This comes handy since it simplifies various cleanup scenarios. + (#1445) + [Tomaz Muraus - @Kami] + +- [OpenStack] Fix auto assignment of volume device when using device name + ``auto`` in the ``attach_volume`` method. + (#1444) + [Joshua Hesketh - @jhesketh] + +- [Kamatera] Add new driver for Kamatera provider (https://www.kamatera.com). + (#1442) + [Ori Hoch - @OriHoch] + +Storage +~~~~~~~ + +- Add new ``download_object_range`` and ``download_object_range_as_stream`` + methods for downloading part of the object content (aka range downloads) to + the base storage API. + + Currently those methods are implemented for the local storage Azure Blobs, + CloudFiles, S3 and any other provider driver which is based on the S3 one + (such as Google Storage and DigitalOcean Spaces). + (#1431) + [Tomaz Muraus] + +- Add type annotations for the base storage API. + (#1410) + [Clemens Wolff - @c-w] + +- [Google Storage] Update the driver so it supports service account HMAC + credentials. + + There was a bug in the code where we used the user id length check to + determine the account type and that code check didn't take service + account HMAC credentials (which contain a longer string) into account. + + Reported by Patrick Mézard - pmezard. + (#1437, #1440) + [Yoan Tournade - @MonsieurV] + +DNS +~~~ + +- Add type annotations for the base DNS API. + (#1434) + [Tomaz Muraus] + +Container +~~~~~~~~~ + +- [Kubernetes] Add support for the client certificate and static token based + authentication to the driver. + (#1421) + [Tomaz Muraus] + +- Add type annotations for the base container API. + (#1435) + [Tomaz Muraus] + + +Changes in Apache Libcloud v2.8.3 +--------------------------------- + +Compute +~~~~~~~ + +- Fix ``deploy_node()`` so an exception is not thrown if any of the output + (stdout / stderr) produced by the deployment script contains a non-valid utf-8 + character. + + Previously, user would see an error similar to "Failed after 3 tries: 'utf-8' + codec can't decode byte 0xc0 in position 37: invalid start byte". + + And now we simply ignore byte sequences which we can't decode and include + rest of the output which can be decoded. + + (#1459) + [Tomaz Muraus - @Kami] + +Storage +~~~~~~~ + +- [AWS S3] Make sure driver works correctly for objects with ``~`` in the name. + + Now when sanitizing the object name, we don't url encode ``~`` character. + + Reported by Michael Militzer - @mmilitzer. + (#1452, #1457) + [Tomaz Muraus] + +Changes in Apache Libcloud v2.8.2 +--------------------------------- + +Compute +~~~~~~~ + +- Add support for Ed25519 private keys for ``deploy_node()`` functionality + when using paramiko >= 2.2.0. + (#1445) + [Tomaz Muraus - @Kami] + +- Fix ``deploy_node()`` so it correctly propagates an exception is a private key + which is used is password protected, but no password is specified. + + Previously it incorrectly tried to retry on such exception. This means the + exception would only bubble up after all the retry attempts have been + exhausted. + (#1445) + [Tomaz Muraus - @Kami] + +- Allow user to specify password for encrypted keys by passing + ``ssh_key_password`` argument to the ``deploy_node()`` method. + + Previously they + (#1445) + [Tomaz Muraus - @Kami] + +- Fix ``deploy_node()`` so it correctly propagates an exception if invalid + or unsupported private key is used. + + Previously it incorrectly tried to retry on such exception. This means the + exception would only bubble up after all the retry attempts have been + exhausted. + (#1445) + [Tomaz Muraus - @Kami] + +- Fix ``deploy_node()`` method so we don't retry on fatal + ``SSHCommandTimeoutError`` exception (exception which is thrown when a + command which is running on remote host times out). + (#1445) + [Tomaz Muraus - @Kami] + +- Add new ``timeout`` argument to ``ScriptDeployment`` and + ``ScriptFileDeployment`` class constructor. + + With this argument, user can specify an optional run timeout for that + deployment step run. + (#1445) + [Tomaz Muraus - @Kami] + +- Add new ``stdout`` and ``stderr`` attribute to ``SSHCommandTimeoutError`` + class. + + Those attributes contain value of stdout and stderr produced so far. + (#1445) + [Tomaz Muraus - @Kami] + +- [OpenStack] Fix auto assignment of volume device when using device name + ``auto`` in the ``attach_volume`` method. + (#1444) + [Joshua Hesketh - @jhesketh] + +Changes in Apache Libcloud v2.8.1 +--------------------------------- + +Common +~~~~~~ + +- Fix ``LIBCLOUD_DEBUG_PRETTY_PRINT_RESPONSE`` functionality and make sure it + works correctly under Python 3 when ``response.read()`` function returns + unicode and not bytes. + + (#1430) + [Tomaz Muraus] + +Compute +~~~~~~~ + +- [GCE] Fix ``list_nodes()`` method so it correctly handles pagination + and returns all the nodes if there are more than 500 nodes available + in total. + + Previously, only first 500 nodes were returned. + + Reported by @TheSushiChef. + (#1409, #1360) + [Tomaz Muraus] + +- Fix some incorrect type annotations in the base compute API. + + Reported by @dpeschman. + (#1413) + [Tomaz Muraus] + +- [OpenStack] Fix error with getting node id in ``_to_floating_ip`` method + when region is not called ``nova``. + (#1411, #1412) + [Miguel Caballer - @micafer] + +- [EC2] Fix ``ex_userdata`` keyword argument in the ``create_node()`` method + being ignored / not working correctly. + + NOTE: This regression has been inadvertently introduced in v2.8.0. + (#1426) + [Dan Chaffelson - @Chaffelson] + +- [EC2] Update ``create_volume`` method to automatically select first available + availability zone if one is not explicitly provided via ``location`` argument. + [Tomaz Muraus] + +Storage +~~~~~~~ + +- [AWS S3] Fix upload object code so uploaded data MD5 checksum check is not + performed at the end of the upload when AWS KMS server side encryption is + used. + + If AWS KMS server side object encryption is used, ETag header value in the + response doesn't contain data MD5 digest so we can't perform a checksum + check. + + Reported by Jonathan Harden - @jfharden. + (#1401, #1406) + [Tomaz Muraus - @Kami] + +- [Google Storage] Fix a bug when uploading an object would fail and result + in 401 "invalid signature" error when object mime type contained mixed + casing and when S3 Interoperability authentication method was used. + + Reported by Will Abson - wabson. + (#1417, #1418) + [Tomaz Muraus] + +- Fix ``upload_object_via_stream`` method so "Illegal seek" errors which + can arise when calculating iterator content hash are ignored. Those errors + likely indicate that the underlying file handle / iterator is a pipe which + doesn't support seek and that the error is not fatal and we should still + proceed. + + Reported by Per Buer - @perbu. + + (#1424, #1427) + [Tomaz Muraus] + +DNS +~~~ + +- [Gandi Live] Update the driver and make sure it matches the latest service / + API updates. + (#1416) + [Ryan Lee - @zepheiryan] + +- [CloudFlare] Fix ``export_zone_to_bind_format`` method. + + Previously it threw an exception, because ``record.extra`` dictionary + didn't contain ``priority`` key. + + Reported by James Montgomery - @gh-jamesmontgomery. + (#1428, #1429) + [Tomaz Muraus] + +Changes in Apache Libcloud v2.8.0 +--------------------------------- + +Common +~~~~~~ + +- Fix a regression with ``get_driver()`` method not working if ``provider`` + argument value was a string (e.g. using ``get_driver('openstack')`` + instead of ``get_driver(Provider.OPENSTACK)``). + + Only officially supported and recommended approach still is to use + ``Provider.FOO`` enum type constant, but since the string notation was + unofficially supported in the past, we will still support it until the next + major release. + + Reported by @dpeschman. + (#1391, #1390) + [Tomaz Muraus] + +- Include ``py.typed`` data file to signal that this package contains type + annotations / hints. + + NOTE: At the moment, type annotations are only available for the base + compute API. + [Tomaz Muraus] + +- Fix universal wheel METADATA and ensure conditional dependencies + (backports.ssl_match_hostname, typing, enum34) are handled correctly. + + Reported by Adam Terrey (@arterrey). + (#1392, #1393) + [Tomaz Muraus] + +Compute +~~~~~~~ + +- [DigitalOcean] Fix ``attach_volume`` and ``detach_volume`` methods. + Previously those two methods incorrectly passed volume id instead of + volume name to the API. (#1380) + [@mpempekos] + +- [GCE] Add ``ex_disk_size`` argument to the ``create_node`` method. + (#1386, #1388) + [Peter Yu - @yukw777] + +- [VMware vCloud] Various improvements, fixes and additions to the driver. + (#1373) + [OpenText Corporation] + +- Update ``deploy_node()`` method so it now only passes non-deploy node + keyword arguments + ``auth`` argument to the underlying ``create_node()`` + method. Previously it also passed ``deploy_node()`` specific arguments + such as ``deploy``, ``ssh_username``, ``max_tries``, etc. to it. + + Because of that, a lot of the compute drivers which support deploy + functionality needed to use ``**kwargs`` in ``create_node()`` method + signature which made code hard to read and error prone. + + Also update various affected drivers to explicitly declare supported + arguments in the ``create_node()`` method signature (Dummy, Abiquo, + Joyent, Bluebox, OpenStack, Gandy, VCL, vCloud, CloudStack, GoGrid + HostVirtual, CloudSigma, ElasticStack, RimuHosting, SoftLayer, Voxel, + Vpsnet, KTUcloud, BrightBox, ECP, OpenNebula, UPcloud). + + As part of this change, also various issues with invalid argument names + were identified and fixed. + (#1389) + [Tomaz Muraus] + +- Add MyPy type annotations for ``create_node()`` and ``deploy_node()`` + method. + (#1389) + [Tomaz Muraus] + +- [GCE] Update ``deploy_node()`` method so it complies with the base compute + API and accepts ``deploy`` argument. + + This method now also takes all the same keyword arguments which original + ``create_node()`` takes. + (#1387) + [Peter Yu - @yukw777, Tomaz Muraus] + +- [Common] To make debugging and troubleshooting easier, add ``__repr__`` + and ``__str__`` method to the ``ScriptDeployment`` class. + [Tomaz Muraus] + +- [Common] Add type annotations / hints for rest of the base compute API + classes and methods. + [Tomaz Muraus] + +Storage +~~~~~~~ + +- [AWS S3] Make sure ``host`` driver constructor argument has priority + over ``region`` argument. + + This means if you specify ``host`` and ``region`` argument, host won't be + inferred from the region, but ``host`` argument will be used for the actual + connection host value. + (#1384, #1383) + [@gluap] + +Changes in Apache Libcloud v2.7.0 +--------------------------------- + +General +~~~~~~~ + +- Test code with Python 3.8 and advertise that we also support Python 3.8. + (#1371, #1374) + [Tomaz Muraus] + +Common +~~~~~~ + +- [OpenStack] Fix OpenStack project scoped token authentication. The driver + constructors now accept ``ex_tenant_domain_id`` argument which tells + authentication service which domain id to use for the scoped authentication + token. (#1367) + [kshtsk] + +Compute +~~~~~~~ + +- Introduce type annotations for the base compute API methods. This means you + can now leverage mypy to type check (with some limitations) your code which + utilizes Libcloud compute API standard API methods. + + Keep in mind that at this point, type annotations are only available for + standard compute API methods. + (#1306) + [Tomaz Muraus] + +- [Azure ARM] Fix ``attach_volume`` method and allow maximum of 64 disks to be + added when LUN is not specified. Previously there was a bug and only a + maximum of 63 disks could be added. + (#1372) + [Palash Gandhi - @palashgandhi] + +- New ``start_node`` and ``stop_node`` methods have been added to the base + Libcloud compute API NodeDriver class. + + A lot of the existing compute drivers already implemented that functionality + via extension methods (``ex_start_node``, ``ex_stop_node``) so it was decided + to promote those methods to be part of the standard Libcloud compute API and + update all the affected drivers. + + For backward compatibility reasons, existing ``ex_start`` and ``ex_stop_node`` + methods will still work until a next major release. + + (#1375, #1364) + [Tomaz Muraus, @emakarov] + + - [GCE] Add new ``ex_set_volume_labels`` method for managing volume labels to + the driver. + (#1376) + [Rob Zimmerman - @zimventures] + +- [EC2] Add support for new ``inf1.*`` instance types. + [Tomaz Muraus] + +Storage +~~~~~~~ + +- [S3] Update S3 driver so a single driver class can be used for different + regions. + + Region which is used is controled by the ``region`` driver constructor + argument. + + Previously, that driver followed "driver class per region" approach. That + approach will be deprecated and removed in a future release. + + For more information, please refer to the Upgrade Notes documentation section. + (#1371) + [Tomaz Muras] + +- [S3] Add missing ``eu-north-1`` region to the S3 driver. (#1370) + [michaelsembwever] + +- [S3] Add missing regions (eu-west-3, ap-northeast-3, me-south-1) to the driver. + (#1371) + [Tomaz Muras] + +- [S3] Update the driver to throw more user-friendly error message if user is + using driver for a region X, but trying to upload / download object to / from + a region Y. (#1371) + [Tomaz Muras] + +Changes in Apache Libcloud 2.6.1 +-------------------------------- + +Compute +~~~~~~~ + +- [Packet] Update ``list_sizes`` method so it accepts ``ex_project_id`` argument + and works with project API tokens. (#1351) [Dimitris Moraitis - @d-mo] + +- [GCE] Fix ``GCEProject.set_common_instance_metadata`` and + ``GCEproject.set_usage_export_bucket`` method. (#1354) + [Aitor Zabala - @aitorzabala, Tomaz Muraus - @Kami] + +- [GCE] Add ``sync`` / ``ex_sync`` argument to the ``ex_stop_node``, + ``ex_start_node`` and ``destroy_node`` method. When this argument is set to + ``False``, method will return immediately without waiting polling and waiting + for a long running API operation to finish before returning. For backward + compatibility reasons, it defaults to ``True``. (#1357) + [Rob Zimmerman - zimventures] + +- [GCE] Update list of image projects and add new ``centos-8`` and + ``debian-10`` based images. (#1358) + [Christopher Lambert - XN137] + +- [OpenStack v2] Add new ``ex_image_ref`` argument to the ``create_volume`` + method. This way bootable volumes can be created from specific images. + (#1363) + [Rick van de Loo] + +- [OpenStack v2] Update ``create_node_method`` and allow users to create + nodes from bootable volumes without specifying ``image`` argument. + (#1362) + [Rick van de Loo] + +- [AWS] Re-generate and update available EC2 instance sizes and pricing data. + [Tomaz Muraus] + +Storage +~~~~~~~ + +- [Common, S3, GCS] Reuse TCP connections when uploading files (#1353) + [Quentin Pradet] + +Load Balancer +~~~~~~~~~~~~~ + +- [AWS] Implement various create methods in the driver. (#1349) + [Anton Kozyrev - @Irvan] + +Changes in Apache Libcloud 2.6.0 +-------------------------------- + +General +~~~~~~~ + +- [OpenStack] Update OpenStack identity driver so a custom project can be + selected using ``domain_name`` keyword argument. Previously, that wasn't + possible and the first project which was returned by the API was always + selected. (#1293) + [Miguel Caballer - @micafer] + +- Add new ``extra`` attribute to the base ``NodeLocation`` class. (#1282) + [Dimitris Moraitis - @d-mo] + +- Remove various code patterns which were in place for supporting multiple + Python versions, including 2.5 and 2.6. Libcloud hasn't supported Python < + 2.7 for a while now, so we can remove that code. (#1307) + [Tomaz Muraus] + +- Also run pylint on ``libcloud/compute/`` directory and fix various pylint + violations. (#1308) + [Tomaz Muraus] + +- [OpenStack] Remove unused variable in parse_error (#1260) + [Rick van de Loo] + +- Add support for HTTPS proxies and fix ``driver.set_http_proxy()`` method. + + HTTPS proxy can be set up by either setting ``https_proxy`` / ``http_proxy`` + environment variable or by using + ``driver.connection.connection.set_http_proxy`` method. + + For more information, please refer to the documentation - + https://libcloud.readthedocs.io/en/latest/other/using-http-proxy.html + (#1314, #1324) + [Jim Liu - @hldh214, Tomaz Muraus] + +- Fix paramiko debug logging which didn't work when using ``LIBCLOUD_DEBUG`` + environment variable. (#1315) + [Tomaz Muraaus] + +- Update paramiko SSH deployment client so it automatically tries to convert + private keys in PEM format with a header which paramiko doesn't recognize + into a format which paramiko recognizes. + + NOTE: Paramiko only supports keys in PEM format. This means keys which start + with "----BEGIN PRIVATE KEY-----". Keys in PKCS#8 and newer OpenSSH + format are not supported. + + For more information, see https://libcloud.readthedocs.io/en/latest/compute/deployment.html#supported-private-ssh-key-types + (#1314) + +- Update Paramiko SSH client to throw a more user-friendly error if a private + key file in an unsupported format is used. (#1314) + [Tomaz Muraus] + +- Fix HTTP(s) proxy support in the OpenStack drivers. (#1324) + [Gabe Van Engel - @gvengel] + +- Fix logging connection class so it also works when data type is ``bytearray`` + or ``bytes``. (#1339) + [Tomaz Muraus] + +Compute +~~~~~~~ + +- [Google Compute Engine] Fix the driver so ``list_nodes()`` method doesn't + throw if there is a node in a ``SUSPENDED`` state. + + Also update the code so it doesn't crash if an unknown node state which is + not defined locally is returned by the API when listing nodes. Such states + are now mapped to ``UNKNOWN``. (#1296, LIBCLOUD-1045) + + Reported by rafa alistair. + [Tomaz Muraus] + +- [OpenStack] Fix a bug with retrieving floating IP address when a + ``device_owner`` of a port is ``compute:None``. (#1295) + [Miguel Caballer - @micafer] +- [Packet] Add various new extension methods to Packet.net driver + (``ex_reinstall_node``, ``ex_list_projects``, + ``ex_get_bgp_config_for_project``, ``ex_get_bgp_config``, + ``ex_list_nodes_for_project``, etc.). (#1282) + [Dimitris Moraitis - @d-mo] + +- [Maxihost] Add new compute driver for Maxihost provider + (https://www.maxihost.com/). (#1298) + [Spyros Tzavaras - @mpempekos] + +- [Azure ARM] Add various improvements to the Azure ARM driver: + - Add functionality to resize a volume in Azure + - Add functionality to update the network profile of a node + - Add functionality to update a network interface's properties + - Add functionality to check IP address availability (#1244) + [Palash Gandhi - @palashgandhi] + +- [EC2] Allow user to pass arbitrary filters to ``list_volumes`` method by + passing a dictionary with filters as ``ex_filters`` method argument value. + (#1300) + [Palash Gandhi - @palashgandhi] + +- [GCE] Add new ``ex_instancegroupmanager_set_autohealingpolicies`` method to + the GCE driver. + + This method allows user to set the auto healing policies (health check to + use and initial delay) on GCE instance group. (#1286) + [Kenta Morris - @kentamorris] + +- [GCE] Update GCE driver to include new operating system images such as + Ubuntu 18.04, RHEL 8, etc. (#1304) + [Christopher Lambert - @XN137] + +- [GCE] Add new ``ex_resize_volume`` method to the driver. (#1301) + [Palash Gandhi - @palashgandhi] + +- [OpenStack] Add various router management methods to the OpenStack + driver. (#1281) + [Miguel Caballer - @micafer] + +- [OpenStack] Fix ``ex_resize`` method. (#1311) + [Miguel Caballer - @micafer] + +- [OpenStack] For consistency, rename ``ex_resize`` method to + ``ex_resize_node``. For backward compatibility reasons, leave ``ex_resize`` + alias in place. + [Tomaz Muraus] + +- [Gridscale] Add new driver for Gridscale provider (https://gridscale.io). + (#1305, #1315) + [Sydney Weber - @PrinceSydney] + +- [Oneandone] Update Oneandone driver to accomodate latest changes to the API. + This means removing deprecated ``ex_remove_server_firewall_policy`` method + and replacing ``port_from`` and ``port_to`` argument on the firewall policy + with a single ``port`` attribute. + (#1230) + [Amel Ajdinovic - @aajdinov] + +- [DigitalOcean] Update ``list_locations`` method in the DigitalOcean driver + to only returns regions which are available by default. If you want to list + all the regions, you need to pass ``ex_available=False`` argument to the + method. (#1001) + [Markos Gogoulos] + +- [EC2] Add new ``ex_modify_subnet_attribute`` method to the EC2 driver. + (#1205) + [Dan Hunsaker - @danhunsaker] + +- [Azure ARM] Add ``ex_delete_public_ip`` method to the Azure ARM driver. + (#1318) + [Reza Shahriari - redha1419] + +- [EC2] Update EC2 driver to throw a more user-friendly exception if a user / + developer tries to provide an invalid value type for an item value in the + request ``params`` dictionary. + + Request parameters are sent via query parameters and not via request body, + as such, only string values are supported. (#1329, #1321) + + Reported by James Bednell. + [Tomaz Muraus] + +- [OpenStack] Add new ``ex_remove_security_group_from_node`` method. + (#1331) + [Miguel Caballer - @micafer] + +- [OpenStack] Fix broken ``ex_update_port`` method. + (#1320) + [Miguel Caballer - @micafer] + +- [Softlayer] Fix a bug with driver incorrectly handling the value of + ``ex_hourly`` argument in the ``create_node()`` method which caused nodes + to always be created with hourly billing, even if this argument was set to + ``False``. (#1334, #1335) + [@r2ronoha] + +- [GCE] Add optional ``cpuPlatform`` and ``minCpuPlatform`` attributes to the + ``node.extra`` dictionary. (#1342, #1343) + [@yairshemla] + +Storage +~~~~~~~ + +- [Azure Blobs] Enable the Azure storage driver to be used with the Azurite + Storage Emulator and Azure Blob Storage on IoT Edge. + (LIBCLOUD-1037, #1278) + [Clemens Wolff - @c-w] + +- [Azure Blobs] Fix a bug with Azure storage driver works when used against a + storage account that was created using ``kind=BlobStrage``. This includes + updating the minimum API version used / supported by the storage driver from + ``2012-02-12`` to ``2014-02-14``. (LIBCLOUD-851, #1202, #1294) + [Clemens Wolff - @c-w, Davis Kirkendall - @daviskirk] + +- [Azure Blobs] Increase the maximum size of block blobs that can be created + to 100 MB. This includes updating the minimum API version used / supported + by the storage driver from ``2014-02-14`` to ``2016-05-31``. (#1340) + [Clemens Wolff - @c-w] + +- [Azure Blobs] Set the minimum required version of requests to ``2.5.0`` since + requests ``2.4.0`` and earlier exhibit XML parsing errors of Azure Storage + responses. (#1325, #1322) + [Clemens Wolff - @c-w] + +- [Azure Blobs] Detect bad version of requests that leads to errors in parsing + Azure Storage responses. This scenario is known to happen on RHEL 7.6 when + requests was installed via yum. (#1332, #1322) + [Clemens Wolff - @c-w] + +- [Common, CloudFiles] Fix ``upload_object_via_stream`` and ensure we start + from the beginning when calculating hash for the provided iterator. This way + we avoid hash mismatch errors in scenario where provided iterator is already + iterated / seeked upon before calculating the hash. (#1326) + [Gabe Van Engel - @gvengel, Tomaz Muraus] + +- [Backblaze B2] Fix a bug with driver not working correctly due to a + regression which was inadvertently introduced in one of the previous + releases. (#1338, #1339) + + Reported by Shawn Nock - @nocko. + [Tomaz Muraus] + +- [Backblaze B2] Fix ``upload_object_via_stream`` method. (#1339) + [Tomaz Muraus] + +DNS +~~~ + +- [Cloudflare] Re-write the Cloudflare DNS driver to use Cloudflare API v4. + (LIBCLOUD-1001, LIBCLOUD-994, #1292) + [Clemens Wolff - @c-w] + +- [Gandi LiveDNS] Add new driver for Gandi LiveDNS service. (#1323) + [Ryan Lee - @zepheiryan] + +- [PowerDNS] Update driver so it works with API v3 and v4. #1328 + [@biggosh] + +Changes in Apache Libcloud 2.5.0 +-------------------------------- + +General +~~~~~~~ + +- [NTT CIS] Add loadbalancer and compute drivers for NTT-CIS, rename + dimensiondata modules to NTT-CIS. (#1250) + [Mitch Raful] + +- [NTT CIS] Fix loadbalancer docs. (#1270) + [Mitch Raful] + +- Use assertIsNone instead of assertEqual with None in tests (#1264) + [Ken Dreyer] + +- Updating command line arguments to current version in Azure examples. + (#1273) + [mitar] + +- [GCE, SoftLayer] Update GCE and Softlayer drivers to utilize crypto + primitives from the ``cryptography`` library instead of deprecated and + unmaintained ``PyCrypto`` library. + + (#1280) + [Ryan Petrello] + +- Fix ``libcloud.enable_debug`` function so it doesn't leak open file handle + and closes the open file when the program exits when a debug mode is used. + [Tomaz Muraus] + +* Update various drivers (CloudFiles, NTT CIS etc.) so they don't leak open + file handles in some situations. + [Tomaz Muraus] + +Common +~~~~~~ + +- [OpenStack] Handle missing user enabled attribute (#1261) + [Ken Dreyer] + +- [Google Cloud Storage] Handle Interoperability access keys of more than 20 + characters. (#1272) + [Yoan Tournade] + +Compute +~~~~~~~ + +- [OpenStack] Implement OpenStack_1_1_NodeDriver ex_get_snapshot (#1257) + [Rick van de Loo] + +- [OpenStack] Pagination in various OpenStack_2_NodeDriver methods (#1263) + [Rick van de Loo] + +- [OpenStack] Implement OpenStack_2_NodeDriver ex_create_subnet (LIBCLOUD-874, + #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver ex_delete_subnet (LIBCLOUD-874, + #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver list_volumes (LIBCLOUD-874, + #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver ex_get_volume (LIBCLOUD-874, + #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver create_volume (LIBCLOUD-874, + #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver destroy_volume (LIBCLOUD-874, + #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver ex_list_snapshots (LIBCLOUD-874, + #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver create_volume_snapshot + (LIBCLOUD-874, #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver destroy_volume_snapshot + (LIBCLOUD-874, #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver ex_list_security_groups + (LIBCLOUD-874, #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver ex_create_security_group + (LIBCLOUD-874, #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver ex_delete_security_group + (LIBCLOUD-874, #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver ex_create_security_group_rule + (LIBCLOUD-874, #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver ex_delete_security_group_rule + (LIBCLOUD-874, #1242) + [Miguel Caballer] + +- [OpenStack] Implement OpenStack_2_NodeDriver ex_list_floating_ip_pools + (LIBCLOUD-874, #1242) + [Miguel Caballer] + +- [OpenStack] Fix parse_error if 'code' not in API response message + (#1242) + [Miguel Caballer] + +- [OpenStack] Adapt _to_port function to work with old OpenStack versions + (#1242) + [Miguel Caballer] + +- [OpenStack] Use SUSPENDED NodeState in OpenStack driver (#1269) + [Miguel Caballer] + +- [UpCloud] Update documentation for UpCloud driver (LIBCLOUD-1026, + #1259) + [Ilari Mäkelä] + +- [NTT CIS] Fix indenting in ex_initiate_drs_failover docstring (#1271) + [Rick van de Loo] + +- [NTT CIS] Change endpoint 'canada' to 'ca' in libcloud/common/nttcis.py + (#1270) + [Mitch Raful] + +- [OpenStack] Fix ``detach_volume`` method so it works with v2 volumes. + (#1267) + [Rick van de Loo] + +- [CloudSigma] Fix CloudSigma driver so it correctly handles subscription + objects without the ``start_time`` and / or ``end_time`` attribute. + (#1284, LIBCLOUD-1040) + [aki-k, Tomaz Muraus] + +Storage +~~~~~~~ + +- [Azure] Fix ``upload_object_via_stream`` method so it also works with + iterators which don't implement ``seek()`` method. If the iterator doesn't + support seek, entire iterator content will be buffered in memory. + (LIBCLOUD-1043, #1287) + [Clemens Wolff] +- [CloudFiles] Fix ``download_object_as_stream`` method in the CloudFiles + driver. This regression / bug was inadvertently introduced when migrating + code to ``requests``. + (LIBCLOUD-1039, #1283) + [Matt Seymour] +- [CloudFiles] Fix a bug with ``ChunkStreamReader`` class and make sure file + descriptor is also closed if the iterator isn't fully exhausted or if the + iterator is never read from. + + NOTE: This potential open file descriptor leakage only affected code which + utilized ``ex_multipart_upload_object`` method. + [Tomaz Muraus] + +Container +~~~~~~~~~ + +- [Docker] Improve docstring for RegistryClient (#1254) + [Ken Dreyer] + +DNS +~~~ + +- Add new driver for RcodeZero DNS (#1256, LIBCLOUD-1025) + [MikeAT] +- [DigitalOcean] Update DigitalOcean driver so it supports ``ttl`` attribute for + ``Record`` objects. This includes support for specifying a record ttl via + ``extra['ttl']`` attribute when creating and updating a record. (#1252 + LIBCLOUD-1022) [Kevin Roy] + +Storage +~~~~~~~ + +- Adds missing docs for param ex_prefix & adds to DummyStore. Add ex_prefix + kwarg to the `list_container_objects` methods in the base and dummy classes. + (#1275) + [RichardARPANET] + +Changes in Apache Libcloud 2.4.0 +-------------------------------- + +- Refuse installation with Python 2.6 and Python 3.3 (support was + already dropped in Libcloud 2.3.0) + +- Support Python 3.7 (#1227, #1236) + [Andreas Hasenack, Andrew Starr-Bochicchio, Quentin Pradet] + +- Cleanup various Python files + (#1182, #1183, #1185, #1186, #1187, #1188) + [Rémy Léone] + +- Allow running tests with http_proxy set (#1236) + [Andreas Hasenack] + +Common +~~~~~~ + +- [OpenStack] Document openstack_connection_kwargs method (#1219) + [Ken Dreyer] + +- [OpenStack] Handle missing user email in OpenStackIdentityUser (#1249) + [Ken Dreyer] + +Compute +~~~~~~~ + +- [ARM] Support OS disk size definition on node creation (#1196) + [Vojta Bartoš] + +- [Digital Ocean] Support floating IPs (#1177) + [Rick van de Loo] + +- [Digital Ocean] Support attach/detach for floating IPs (#1191) + [Rick van de Loo] + +- [Digital Ocean] Add ex_get_node_details (#1221) + [Rick van de Loo] + +- [Digital Ocean] Add tags extra attribute to create_node (#1212) + [Nikita Chebykin] + +- [Dimension Data] Fix IndexError in list_images (#1171) + [Adam Friedman] + +- [EC2] Add AWS eu-west-3 (Paris) region (#1175) + [Anthony Monthe] + +- [EC2] Add description to ex_authorize_security_group_ingress (#1122) + [Arturo Noha] + +- [EC2] Added script to automatically get EC2 instance sizes (#1211) + [Anthony Monthe, Quentin Pradet] + +- [EC2] Update instance sizes (#1238) + [Ward Vandewege] + +- [EC2] Accept tags when create a snapshot (LIBCLOUD-1014, #1240) + [Rafael Gonçalves] + +- [GCE] Expand Firewall options coverage (LIBCLOUD-960, #1144) + [maxlip] + +- [GCE] Expand network and subnetwork options coverage (LIBCLOUD-985, + #1181) + [maxlip] + +- [GCE] Extend ex_create_address to allow internal ip creation (#1174) + [Jeremy Solarz] + +- [GCE] Allow shared VPC in managed instance group creation (#1179) + [Boris Chazalet] + +- [GCE] Support disk_size parameter for boot disk when creating instance + (LIBCLOUD-973, #1162) + [Rahul Paigavan] + +- [GCE] Update public image projects list (LIBCLOUD-961, #1143) + [Sean Marlow] + +- [GCE] Fix _find_zone_or_region for >500 instances (#1203) + [Léo Ferlin-Sutton] + +- [GCE] Allow routing_mode=None in ex_create_network (#1217) + [Daniel Hunsaker] + +- [OpenStack] Implement Glance Image API v2 (#1151) + [Rick van de Loo] + +- [OpenStack] Fix spelling in ex_files description (#1197) + [Ken Dreyer] + +- [OpenStack v2] Allow listing image members (#1172) + [Rick van de Loo] + +- [OpenStack v2] Allow creating and accepting image members (#1176) + [Rick van de Loo] + +- [OpenStack v2] Fix image members methods (#1190) + [Rick van de Loo] + +- [OpenStack] Fix API doc for delete_floating_ip (#1218) + [Ken Dreyer] + +- [OpenStack] Implement port attaching/detaching (#1225) + [Rick van de Loo] + +- [OpenStack] Add methods for getting and creating ports (#1226) + [Alexander Grooff] + +- [OpenStack] Add get_user method (#1216) + [Ken Dreyer] + +- [OpenStack] Add ex_list_subnets to OpenStack_2_NodeDriver (#1215, + LIBCLOUD-604) + [Miguel Caballer] + +- [OpenStack] The OpenStack_2_NodeDriver uses two connections (#1215, + LIBCLOUD-997) + [Miguel Caballer] + +- [OpenStack] The OpenStack_2_NodeDriver /v2.0/networks instead of /os-networks + (#1215, LIBCLOUD-998) + [Miguel Caballer] + +- [Scaleway] New Scaleway driver (#1121, #1220) + [Daniel Hunsaker, Nándor István Krácser, Rémy Léone] + +- [Scaleway] Update Scaleway default API host (#1239) + [Rémy Léone] + +DNS +~~~ + +- [Google Cloud DNS] Document driver instantiation (#1198) + [Gareth McFarlane] + +Storage +~~~~~~~ + +- Update docstring for storage provider class (#1201) + [Clemens Wolff] + +- [Azure Blob Storage] Allow filtering lists by prefix (LIBCLOUD-986, + #1193) + [Joshua Hawkinson] + +- [Azure Blob Storage] Update driver documentation (#1208) + [Clemens Wolff] + +- [Azure Blob Storage] Fix upload/download streams (#1231) + [Michael Perel] + +- [Azure Blob Storage] Fix PageBlob headers (#1237) + [Andreas Hasenack] + +- [S3] Guess s3 upload content type (LIBCLOUD-958, #1195) + [Iuri de Silvio] + +- [S3] Add Amazon S3 (cn-northwest-1) Storage Driver (#1241) + [@yangkang55] + +Other +~~~~~ + +- Fixed spelling in 2.0 changes documentation (#1228) + [Jimmy Casey] + +Changes in Apache Libcloud 2.3.0 +-------------------------------- + +- Drop support for Python 2.6 and Python 3.3 + They're no longer supported, and the Python ecosystem is starting to + drop support: two of our test dependencies no longer support them. + [Quentin Pradet] + +- Made pytest-runner optional (#1167) + [Vlad Glagolev] + +Common +~~~~~~ + +- Improve warning when CA_CERTS_PATH is incorrectly passed as a list + (#1118) + [Quentin Pradet] + +- Cleaned up and corrected third-party drivers documentation (#1148) + [Daniel Hunsaker] + +- Modernized a few Python examples (#1164) + [Batuhan Osman Taşkaya] + +- [OpenStack] Authentify with updated Identity API + (LIBCLOUD-965, #1145) + [Miguel Caballer] + +Compute +~~~~~~~ + +- Fix "wait_until_running() method so it also works correctly and doesn't + append "None" to the addresses list if node has no IP address. + (#1156, LIBCLOUD-971) + [Tobias Paepke] + +- [ARM] Fix checking for "location is None" in several functions (LIBCLOUD-926, + #1098) + [Sameh Elsharkawy] + +- [ARM] Fix error when using SSH key auth with Python 3 (#1098) + [Sameh Elsharkawy] + +- [ARM] Fix API call on powerOff, understand PAUSED state (#1003) + [Markos Gogoulos] + +- [ARM] Delete VHDs more reliably in destroy_node(), raise exception on + unhandled errors (#1120) + [Lucas Di Pentima] + +- [ARM] Fix api version used to list and delete NICs (#1128) + [Peter Amstutz] + +- [ARM] Allow faster list_nodes() with ex_fetch_power_state=False + (#1126) + [Peter Amstutz, Lucas Di Pentima] + +- [ARM] Fix delete_old_vhd (#1137) + [Peter Amstutz, Lucas Di Pentima] + +- [ARM] Limit number of retries in destroy_node (#1134) + [Peter Amstutz, Lucas Di Pentima] + +- [ARM] Fix Retry-After header handling (#1139) + [Lucas Di Pentima] + +- [CloudStack] Handle NICs without addresses (#1141) + [Pierre-Yves Ritschard] + +- [CloudStack] Add change size and restore (LIBCLOUD-975, #1166) + [Mauro Murari] + +- [Digital Ocean] Add ex_enable_ipv6 in DigitalOcean_v2 driver + (#1130) + [Rick van de Loo] + +- [Digital Ocean] Add support for tags in list_nodes() + (LIBCLOUD-967, #1149) + [Mike Fischer] + +- [Digital Ocean] Add rebuild and resize commands + (LIBCLOUD-977, #1169) + [Adam Wight] + +- [EC2] Add new x1.16xlarge and x1e.32xlarge instance type. (#1101) + [Anthony Monthe] + +- [EC2] Add AWS EC2 c5 series (#1147) + [Anthony Monthe] + +- [EC2] Add AWS EC2 M5 sizes (#1159) + [Anthony Monthe] + +- [EC2] Update pricing information for EC2 instances. + [Tomaz Muraus] + +- [EC2] Allow cn-north-1 even without pricing information + (LIBCLOUD-954, #1127) + [Quentin Pradet] + +- [EC2] Fix EBS volume encryption (#1008) + [Sergey Babak] + +- [ECS Aliyun] Support modify_security_group_attributes (#1157) + [Zhang Yiming] + +- [GCE] Allow adding labels to images (#1138) + [Katriel Traum, Eric Johnson] + +- [GCE] Allow adding license strings to images (#1136) + [Katriel Traum, Eric Johnson] + +- [GCE] Support GCE node labels. (LIBCLOUD-934, #1115) + [@maxlip] + +- [GCE] Fix `GCEList` pagination. (#1095) + [Yap Sok Ann] + +- [GCE] Allow setting service account in instance templates (LIBCLOUD-947, + #1108) + [Evan Carter] + +- [GCE] Add support for private IP addresses in GCE instance creation + (LIBCLOUD-944, #1107) + [Gareth Mcfarlane] + +- [GCE] Allow for use of shared network (VPC) and subnetwork (#1165) + [Boris Chazalet] + +- [GCE] Add support for accelerators (LIBCLOUD-963, #1163) + [Michael Johnson] + +- [ProfitBricks] Update driver and add support for the new API v4. (#1103) + [Nurfet Becirevic] + +- [ProfitBricks] Fix list_snapshots() method (#1153) + [Chad Phillips] + +- [UpCloud] New driver for UpCloud (LIBCLOUD-938, #1102) + [Mika Lackman, Ilari Mäkelä] + +- [UpCloud] Use disk size and storage tier also when creating node from template + (LIBCLOUD-952, #1124) + [Mika Lackman] + +- [UpCloud] Allow to define hostname and username + (LIBCLOUD-951, LIBCLOUD-953, #1123, #1125) + [Mika Lackman] + +- [UpCloud] Add pricing information to list_sizes (LIBCLOUD-969, #1152) + [Mika Lackman] + +Storage +~~~~~~~ + +- Added Digital Ocean Spaces driver (LIBCLOUD-955, #1129) + [Andrew Starr-Bochicchio] + +- [Digital Ocean Spaces] Add support for AMS3 region (#1142) + [Andrew Starr-Bochicchio] + +- [Digital Ocean Spaces] Add support for SGP1 region (#1168) + [Andrew Starr-Bochicchio] + +- Fix a bug / regression which resulted in increased memory consumption when + using ``download_object`` method. This method would store whole object + content in memory even though there was no need for that. + + This regression was introduced in 2.0.0 when we moved to using ``requests`` + library. + (#1132) + [Quentin Pradet] + +- Fix a regression with hash computation performance and memory usage on object + upload inadvertently introduced in 2.0.0 and make it more efficient. + (#1135) + [Quentin Pradet] + +Changes in Apache Libcloud 2.2.1 +-------------------------------- + +Common +~~~~~~ + +- Fix an issue with installation failing on some operating system and file + systems combinations (e.g. ecryptfs layered on top of ext4) which don't + support file names longer than 143 characters. (LIBCLOUD-946, #1112) + + Reported by Cyrille Verrier. + [Tomaz Muraus] + +Compute +~~~~~~~ + +- [EC2] add g3 instance types + [#1101] + (@zulupro) + +- [EC2] add 'end' to ec2 reserved_node + [#1099] + (@xofer) + +- Decrease sleep delay (from 1.5 to 0.2 seconds) inside paramiko client which + is used to prevent busy waiting while waiting for data on the channel. + + This should cause deploy scripts which produce a lot of output in incremental + manner to finish faster. + [Tomaz Muraus] + +- Fix a regression in the Azure ARM driver which didn't allow custom storage + URI suffix to be used with create_node. (#1110) + [Lucas Di Pentima] + +Tests +~~~~~ + +- Make sure we normalize header values and cast all the numbers to strings in + base connection classes used by tests. (LIBCLOUD-945, #1111) + + Reported by Erich Eckner. + [Tomaz Muraus] + +Changes in Apache Libcloud 2.2.0 +-------------------------------- + +Compute +~~~~~~~ + +- [EC2] add g3 instance types + [#1101] + (@zulupro) + +- [EC2] add 'end' to ec2 reserved_node + [#1099] + (@xofer) + +Changes in Apache Libcloud 2.2.0 +-------------------------------- + +Common +~~~~~~ + +- [GCE] Scrape prices for GCE Australia Region + [#1085] + (Francisco Ros) + +Compute +~~~~~~~ + +- [ARM] Add option to create static public IP + [#1091, LIBCLOUD-918] + (Aki Ketolainen) + +- [SOFTLAYER] Add `get_image` method to class + [#1066] + (Francois Regnoult) + +- [ARM] Add Storage support, volumes, snapshots + [#1087] + (Sergey Babak) + +Container +~~~~~~~~~ + +- [DOCKER] Fixes to support TLS connection + [#1067] + (johnnyWalnut) + +DNS +~~~ + +- [ROUTE53] Fix for TXT and SPF records, when user didn't escapsulate data in + quotes, the API would fire error. As reported by @glyph + [LIBCLOUD-875, #1093] + (Anthony Shaw) + +- [LINODE] Add priority to the extra dictionary in record instances + [#1088] + (@mete0r) + +Load Balancer +~~~~~~~~~~~~~ + +- Fixed AWS ALB/ELB driver init method to instantiate nested connection object + properly + [LIBCLOUD-936, #1089] + (Anton Kozyrev) + +Storage +~~~~~~~ + +- [CLOUDFILES] Update OpenStackSwiftConnection to work with auth version 3.0 + [#1068] + (Hakan Carlsson) + +- [CLOUDFILES] Add SSL URI support + [#1076, LIBCLOUD-458] + (@ayleph) + +Changes in Apache Libcloud 2.1.0 +-------------------------------- + +Common +~~~~~~ + +- [AWS] Update prices and fix some region names + [#1056] + (Francisco Ros) + +- Fix bug in utils.decorators wrap exception method, used by vsphere driver + [#1054] + (Anthony Shaw) + +- Use PyTest as the unit testing runner + (Anthony Shaw) + +- Use of LXML is now disabled by defalt, use + ``libcloud.utils.py3.DEFAULT_LXML = True`` to reenable. LXML has + compatibility issues with a number of drivers and etree is a standard + package. + [#1038] + (Anthony Shaw) + +- Switch RawResponse class to use content body instead of text body, up to 10x + performance improvement for methods like StorageDriver.download_object + [#1053] + (Quentin Pradet) + +Compute +~~~~~~~ + +- [OPENSTACK] Add support for Nova 2.x and Keystone 3 + [#1052] + (Anthony Shaw) + +- [GCE] Add loadBalancingScheme parameter for + ex_create_forwarding_rule method in GCE driver. + [#1079] + (@sT331h0rs3) + +- [GCE] Fix error codes not being parsed in certain scenarios + [#1074, LIBCLOUD-925] + (micafer) + +- [EC2] Fix node's Block Device Mapping was parsed from incorrect mapping. + EbsInstanceBlockDevice is different from EbsBlockDevice. + [#1075] + (Gennadiy Stas) + +- [GANDI] Fixes the location name in image and instance type classes + [#1065] + (Sayoun) + +- [GCE] Fix method for create instance properties, it previously ignored the + disk type parameter and defaulted to pd-standard. + [#1064] + (Evan Carter) + +- Fix missing return data from EC2 billing product methods + [#1062] + (Alex Misstear) + +- Handle [VULTR] API rate limiting + [#1058] + (Francisco Ros) + +- Fix Kili driver not correctly fixing the auth version for openstack to + 2.0_password + [#1054] + (Anthony Shaw) + +- [EC2] Add i3 instance types for AWS + [#1038] + (Stephen Mullins) + +- [VULTR] Extend extra dict of Vultr sizes to include additional fields + (plan_type and available_locations) + [#1044] + (Francisco Ros) + +Container +~~~~~~~~~ + +- New driver for Google Container Engine + [#1059] + (Andy Maheshwari) + +- [KUBERNETES] Fix get_container method responding with None + [#1054] + (Anthony Shaw) + +- [DOCKER] Fix for start_container method + [#1049] + (@johnnyWalnut) + +- [DOCKER] fix add an extra check otherwise list_containers breaks with + AttributeError when fromImages is specified + [#1043] + (@johnnyWalnut) + +Storage +~~~~~~~ + +- [S3] Fix raise in s3.upload_object_via_stream + [LIBCLOUD-914, #1055] + (Quentin Pradet) + +Changes in Apache Libcloud 2.0.0 +-------------------------------- + +Common +~~~~~~ + +- Fix OpenStack drivers not correctly setting URLs when used with identity API, + would default to 127.0.0.1 and service catalog URLs were not adhered to. + [#1037, LIBCLOUD-912, LIBCLOUD-904] + (Anthony Shaw) + +- Fix Aliyun ECS, Load balancer and storage adapters when using unicode UTF-8 + characters in the names of resources in 2.0.0rc2 < it would fail as a + MalformedResponseError, Python 2.7 element tree was raising a unicode error + [#1032] [#994] + (Anthony Shaw) + +- Refactor the test classes to use the full libcloud.http and + libcloud.common.base modules, with Connection, Response all used with + requests_mock. This increases our test coverages and catches bugs in + drivers' custom parse_body and auth modules + [#1031] + (Anthony Shaw) + +- Rename libcloud.httplib_ssl to libcloud.http now that we don't use httplib + [#1028] + (Anthony Shaw) + +Compute +~~~~~~~ + +- [GOOGLE] Add test to check that can create a GCE volume at a given location + [#1048] + (Francisco Ros) + +- [GOOGLE] Fix GCENodeDriver.ex_get_volume() when zone param is of class + GCEZone or NodeLocation + [#1047] + (Francisco Ros) + +- [GOOGLE] Fix call to GCENodeDriver._ex_populate_volume_dict + [#1046] + (Francisco Ros) + +- [ARM] Add support for Azure Cloud Environments as well as Locations + [#969] + (Peter Amstutz) + +- [EC2] Add support for ModifyVolume and DescribeVolumesModifications + [#1036] + (Hennadii Stas) + +- [ARM] Fix string representation of the VhdImage type and fix listing of + Public IP addresses + [#1035] + (Anthony Shaw) + +- [GOOGLE] Remove validation checks for guestOsFeatures + [#1034] + (Max Illfelder) + +- [VSPHERE] Fix issue with authentication methods crashing + [#1031] + (Anthony Shaw) + +- [ARM] Add network security groups to azure ARM + [#1033] + (Joseph Hall) + +- [ARM] Add the ability to list resource groups + [#1032] + (Joseph Hall) + +- Add 1&1 compute driver + [LIBCLOUD-911] [#1029] + (Jasmin Gacic) + +- Fix Azure ARM driver condition for ex_list_publishers where location is + specified + [#1030] + (Joseph Hall) + +- Added Import Snapshot and Describe Import Snapshot to EC2 compute driver + [#1023] + (Nirzari Iyer) + +- Add price_monthly extra param to digitalocean sizes + [#1021] + (Francisco Ros) + +- Add aliyun ecs instance join leave security group + [#992] + (Jie Ren) + +- Add keypair management to OnApp driver + [#1018] + (Tinu Cleatus) + +- Add missing regions in AWS storage and compute drivers + [#1019] + (Alex Misstear) + +- Add SR-IOV net support to images in EC2 compute driver + [#1020] + (Alex Misstear) + +- Fix - update t2.small image size from 11 CPU to 1 + [#1022] + (Francisco Ros) + +- Added Billing Product for image in EC2 compute driver + [#1024] + (Nirzari Iyer) + +DNS +~~~ + +- Add OnApp driver + [#1017] [LIBCLOUD-907] + (Tinu Cleatus) + +Changes in Apache Libcloud 2.0.0rc2 +----------------------------------- + +Common +~~~~~~ + +- Fix LIBCLOUD_DEBUG trying to decompress already decompressed responses + [LIBCLOUD-910] + (Anthony Shaw) + +- Added an integration test API and a test suite for validating functionality + without mocking any libcloud subsystems + [#970] + (Anthony Shaw) + +- Fix for Linode classes since 2.0x + [#1026] + (Anthony Shaw) + +- Fix CertificateConnection not correctly signing requests in 2.0rc1, impacted + Azure classic driver, OpenStack and Docker driver + [#1015] + (Anthony Shaw) + +- Change Cloudscale to cloudscale.ch. + [#993] + (David Halter) + +- Explicitly check if response is None in RawResponse class + [#1006] [LIBCLOUD-901] + (Richard Xia) + +Compute +~~~~~~~ + +- Outscale SAS doc improvements and logo update + [#950] + (Javier M Mellid) + +- [GCE] Allow preemptible instances to be created + [#954] + (John Baublitz) + +- Add support for forcing detachment of EBS volumes to EC2 driver + [#1007] + (Sergey Babak) + +- Fix Public IP not assigned when creating NIC on Azure ARM + [#1013] [LIBCLOUD-906] + (Simone Ripamonti) + +- [ONAPP] Add list images support for OnApp driver + [#1011] + (Tinu Cleatus) + +- [EC2] Add r4 instance types for AWS + [#997] + (Jens Deppe) + +- [EC2] support for AWS eu-west-2 and ca-central-1 regions + [#1009] + (Marat Komarov) + +- [EC2] Add P2 GPU instance types + [#996] + (MJK) + +- [EC2] Add method to modify snapshot attribute for EC2 + [#990] + (Sayan Chowdhury) + +- [Linode] Add start, stop instance methods and fix incorrect state TERMINATED + to STOPPED + [#986] + (Markos Gogoulos) + +- [EC2] Add ENA support for EC2 compute images + [#983] + (Alex Misstear) + +- [Azure ARM] fix typeerror on ex_list_nics + [#979] + (Choi Jongu) + +- [GCE] allow delete instances from managed group + [#975] + (@zacharya19) + +Storage +~~~~~~~ + +- Reintroduce S3 multipart upload support with signature v4 + [#1005] [LIBCLOUD-834] + (Alex Misstear) + + +Changes Apache Libcloud 2.0.0rc1 +-------------------------------- + +Common +~~~~~~ + +- Fix DEBUG mode, also add support for using io.StringIO as the file handle + when calling libcloud.enable_debug. + (#978, LIBCLOUD-887) + [Anthony Shaw] + +- Introduction of the requests package as the mechanism for making HTTP + requests for all drivers. + (#928) + [Anthony Shaw] + +- Fix bug where custom port and secure flag would not get propagated to + connection class. + (#972) + [Anthony Shaw] + +- Fix bug where custom port would not get propagated to connection. + (#971) + [Anthony Shaw] + +- Fix bug where instantiating a connection from URL and then requesting an + action with a leading / would lead to a malformed URL. + (#976) + [Anthony Shaw] + +Compute +~~~~~~~ + +- Fix a bug in profitbricks driver where listing snapshots would request a + malformed URL. + [#976] + (Anthony Shaw) + +- Fix LIBCLOUD-806 bug where vsphere driver cannot be instantiated. + (#967) + [Anthony Shaw] + +- [google compute] Improve performance of list nodes by caching volume + information. + (#813, LIBCLOUD-826) + [Tom Melendez] + +Changes in Apache Libcloud 1.5.0 +-------------------------------- + +Common +~~~~~~ + +- Set Dimension Data compute, backup and load balancer to default to 2.4 API. + (#961) + [Samuel Chong] + +Compute +~~~~~~~ + +- [azure] New method for accessing rate cards. + (#957) + [Soren L. Hansen] + +- [gce] Allow multiple preemptible instances to be created. + (#954) + [John Baublitz] + +- [openstack] Add new Connection class to support VOMS proxys to keystone + servers. + (#959) + [micafer] + +- [outscale] Added support for changed API for describing quotas. + (#960) + [Javier M. Mellid] + +- [ec2] Added m4 instances to us-gov and brazil, added m4.16xlarge to all. + (#964) + [Matthew Tyas] + +- Add new CloudScale.ch driver + (#951) + [Dave Halter] + +- [google compute] Bug fix for ex_create_multiple_nodes Google Cloud disk auto + delete. + (#955) + [John Baublitz] + +- [google compute] Add "MULTI_IP_SUBNET" guestOsFeatures option. + (#956) + [Max Illfelder] + +- [dimensiondata] Added support for 2.4 API, added support for image import, + cloning. Add feature for changing NIC VLANs, add feature for changing NIC + order for a server. + (#953) + [Samuel Chong] + +- [ec2] Add US-EAST2 (Ohio). + (#946) + [Matthew Harris] + +- [google compute] Fix to allow multiple node creation with subnets. + (#949) + [John Baublitz] + +Container +~~~~~~~~~ + +- [rancher] The scheme (secure) and port no longer need to be explicitly + specified, allowing a user to simply copy in the string provided to them + from Rancher. + (#958) + [Matthew Ellison] + +Changes in Apache Libcloud 1.4.0 +-------------------------------- + +Compute +~~~~~~~ + +- Introduce new Azure ARM driver. + [Peter Amstulz] + +- [ec2] Fix the bug that created the node at ecs driver and implement the + method for creating public ip. + (#943) + [watermelo] + +- [profitbricks] changes to the ProfitBricks compute driver to drop support + for the old SOAP api (now end of life) and provide support for v3 of the + REST api. + (#938) + [Matt Finucane] + +- [cloudsigma] Added Warsaw (waw) region. + (#942) + [Kamil Chmielewski] + +- [google compute] List images fix for projects > 500 images. + (#939) + [Scott Crunkleton] + +- [ec2] Add st1 and sc1 volume types to valid types. + (#925) + [Sean Goller] + +- [digital ocean] add ex_change_kernel in DigitalOcean_v2 driver. + (#922) + [Rick van de Loo] + +- [digital ocean] add ex_hard_reboot in DigitalOcean_v2 driver. + (#920) + [Rick van de Loo] + +- [openstack] add ex_start_node for the openstack driver. + (#919) + [Rick van de Loo] + +- [vultr] Extra Attributes for Node Creation on Vultr. + (#917) + [Fahri Cihan Demirci] + +- [vultr] Implement SSH Key Create/Delete Methods for Vultr. + (#914) + [Fahri Cihan Demirci] + +- [dimension data] No longer throw error when powering off a node that is + already stopped. + (#912) + [Samuel Chong] + +- [dimension data] Refactor create_node for MCP2 to support CaaS API 2.3 feature. + Can now specify Network Adapter Name for primary and additional NIC. + Parameters in create_node function is tailored for MCP2. + (#902) + [Samuel Chong] + +- Volume snapshot operations, i.e. creating, listing and deleting volume + snapshots, for the Digital Ocean driver. + (LIBCLOUD-861, #909) + [Fahri Cihan Demirci] + +- Added snapshot management to OVH compute. + (#897) + [Anthony Monthe] + +- [GCE] Support for HTTP(S) proxies with BackendServices. + (#856) + [Tom Melendez] + +Container +~~~~~~~~~ + +- [docker] As reported in the corresponding bug, the docker daemon will respond + in an install_image call with all the messages produced during the procedure + parsed as json docs. In that case the response headers also contain the value + 'transfer-encoding':'chunked'. That kind of response can now be parsed + properly by the DockerResponse parse_body method. Also, another small change + is that previously the id of the new image was marked in the json document as + id, but now it's marked as sha256, so the regex used to discover the id has + been updated. + (#918) + [Pavlos Tzianos] + +Load Balancing +~~~~~~~~~~~~~~ + +- Introduce AWS Application Load Balancer (ALB) driver. + (LIBCLOUD-869, #936) + [Anton Kozyrev] + +- Fix bug where GCE Load balancer supposes that all VMs have public ips. + (LIBCLOUD-879, #952) + [Chris Walker] + +Storage +~~~~~~~ + +- [s3] Add AP-Southeast2 as region. + +- [google] Prevent GCE auth to hide S3 auth. + (#921) + [Quentin Pradet] + +- [GCS] Fixed some google_storage.py URL cleaning. + (#901) + [Scott Crunkleton] + +Changes in Apache Libcloud 1.3.0 +-------------------------------- + +General +~~~~~~~ + +- Introduced new base API for instantiating drivers. + (#822) + [Anthony Shaw] + +- Added certificate path for SLES12/OpenSUSE12. + (#884) + [Michael Calmer] + +- Deprecate DigitalOcean v1 API support in favour of v2 API. + (#889, #892) + [Andrew Starr-Bochicchio] + +- Deprecate RunAbove cloud drivers in favour of new OVH cloud driver. + (#891) + [Anthony Monthe] + + +Compute +~~~~~~~ + +- Fix reporting function for detailed admin logs in Dimension Data Driver. + (#898) + [Anthony Shaw] + +- Added edit firewall functionality to Dimension Data driver. + (#893) + [Samuel Chong] + +- Bugfix - Fixed listing nodes issue in Python 3. + (LIBCLOUD-858, #894) + [Fahri Cihan Demirci] + +- Added FCU (Flexible Compute Unit) support to the Outscale driver. + (#890) + [Javier M. Mellid] + +- [google compute] Add "WINDOWS" guestOsFeatures option. + (#861) + [Max Illfelder] + +- When creating volumes on OpenStack with defaults for `location` or + `volume_type`, newer OpenStack versions would throw errors. The OpenStack + driver will now only post those arguments if non-`NoneType`. + (#857) + [Allard Hoeve] + +- When fetching the node details of a non-existing node, OpenStack would raise + a `BaseHTTPError` instead of returning `None`, as was intended. Fixed tests + and code. + (#864) + +- Added `ex_stop_node` to the OpenStack driver. + (#865) + [Allard Hoeve] + +- When creating volume snapshot, the arguments `name` and `description` are + truely optional when working with newer OpenStack versions. The OpenStack + driver will now only post thost arguments if they are non-`NoneType`. + (#866) + [Allard Hoeve] + +- StorageVolumeSnapshot now has an attribute `name` that has the name of the + snapshot if the provider supports it. This used to be `.extra['name']`, but + that is inconsistent with `Node` and `StorageVolume`. The `extra` dict still + holds `name` for backwards compatibility. + (#867) + [Allard Hoeve] + +Container +~~~~~~~~~ + +- Introduced new Rancher driver + (#876) + [Mario Loria] + +- Fixed bug in Docker util library for fetching images from the docker hub API. + API was returning 301 and redirects were not being followed. + (#862) + [Anthony Shaw] + +Load Balancer +~~~~~~~~~~~~~ + +- Added fetch tags support in elb driver. + (#848) + [Anton Kozyrev] + +Storage +~~~~~~~ + +- Added storage permissions for Google Cloud Storage. + (#860) + [Scott Crunkleton] + +Changes in Apache Libcloud 1.2.1 +-------------------------------- + +Backup +~~~~~~ + +- Fix issue enabling backups on Dimension Data driver. + (#858) + [Mark Maglana, Jeff Dunham, Anthony Shaw] + +Changes in Apache Libcloud 1.2.0 +-------------------------------- + +General +~~~~~~~ + +- Fix caching of auth tokens in the Google Compute Engine drivers. Now we make + sure that the file is truncated before writing a new token. Not truncating + the file would cause issues if the new token is shorted then the existing one + which is cached in the file. + (#844, LIBCLOUD-835) + [Paul Tiplady] + +Compute +~~~~~~~ + +- [gce] Fix image undeprecation in GCE. + (#852) + [Max Illfelder] + +- [gce] Added Managed Instance Groups. + (#842) + [Tom Melendez] + +- [gce] Allow undeprecation of an image. + (#851) + [Max Illfelder] + +- [cloudstack] BUGFIX Values with wildcards failed signature validation. + (#846) + [Ronald van Zantvoot] + +- [cloudstack] Added StorageState-Migrating to the cloudstack driver. + (#847) + [Marc-Aurèle Brothier] + +- [google compute] Update copy image logic to match create image. + (#828) + [Max Illfelder] + +- Removed HD attribute from the Abiquo compute driver to support the 3.4 API. + (#840) + [David Freedman] + +- Add image and size details to `list_nodes` response in Dimension Data driver. + (#832) + [Anthony Shaw] + +- Add support for changing VM admin password in VMware driver. + (#833) + [Juan Font Alonso] + +- Add Barcelona (Spain) region to the Aurora Compute driver. + (#835) + [Wido den Hollander] + +- Various improvements in the libvirt driver. + (#838) + [Rene Kjellerup] + +Load balancer +~~~~~~~~~~~~~ + +- Add support for temporary IAM role credentials (token) to the AWS ELB driver. + (#843) + [Anton Kozyrev] + +DNS +~~~ + +- Updated the 'extra' parameter in `update_record()` to be optional in aurora + driver. + (#830) + [Wido den Hollander] + +- Support for iterating over records and zones in the Aurora DNS driver. + (#829) + [Wido den Hollander] + +- Add support for DS, PTR, SSFHFP and TLSA record type to the Aurora DNS + driver. + (#834) + [Wido den Hollander] + +Container +~~~~~~~~~ + +- Add network mode and labels when creating containers within docker driver. + (#831) + [Jamie Cressey] + +Storage +~~~~~~~ + +- Fix authentication issue in S3/China region, disabled multipart uploads as + not supported by region. + (#839) + [Luke Morfitt] + +Changes with Apache Libcloud 1.1.0 +---------------------------------- + +General +~~~~~~~ + +- Add support for automatic SNI (SSL extension) using the hostname + supplied to connect to. + + Note: This functionality is only available in Python 2.7.9 and + Python >= 3.2. + (LIBCLOUD-827, #808) + [David Freedman] + +Compute +~~~~~~~ + +- Add support image guest OS features in GCE driver. + (#825) + [Max Illfelder] + +- Added forceCustimization option for vcloud director driver. + (#824) + [Juan Font] + +- Add node lookup by UUID for libvirt driver. + (#823) + [Frank Wu] + +- Add block storage support to DigitalOcean node driver. + (#807) + [Adam Wolfe Gordon] + +- Add SASL auth support to libvirt driver. + (#809) + [Katana-Steel] + +- Allow VIPs in Dimension Data driver to bind to any port. + (#818) + [Mark Maglana] + +- Add support for deleting a security group to the Aliyun ECS driver. + (#816) + [Heng Wu] + +- Add ``ex_force_customization`` argument to the ``ex_deploy_node`` in vCloud + driver. + (#824) + [Juan Font] + +- Add support for listing attributes for a particular security group + (``ex_list_security_group_attributes``) to the Aliyun ECS driver. + (#826) + [Heng Wu] + +- Add new Mumbai, India region to the EC2 driver. + [Tomaz Muraus] + +- Add driver for the new AWS cn-north-1 region. + (#827, LIBCLOUD-820) + [Jamie Cressey] + +- Fix authentication with temporary IAM role credentials (token) in the EC2 + driver. + (#820) + [Alejandro González] + +Container +~~~~~~~~~ + +- Fixed API compatibility for Docker Container driver with API 1.24, set driver + to use versioned URL for all communication. Backported changes to 1.21 API + (#821) + [Anthony Shaw] + +Load Balancer +~~~~~~~~~~~~~ + +- Added additional parameters to the Rackspace driver in `list_balancers` for + filtering and searching. + (#803) + [João Paulo Raittes] + +Changes with Apache Libcloud 1.0.0 +---------------------------------- + +General +~~~~~~~ + +- Fix a regression with ``timeout`` argument provided via + ``_ex_connection_class_kwargs`` method being overriden with ``None`` inside + the ``BaseDriver`` constructor method. + + Reported by Jay Rolette. + (#755) + [Tomaz Muraus, Jay Rolette] + +- Fix OpenStack v3 authentication and allow user to provide a custom value for + the OpenStack ``domain`` parameter. Previously only possible value as a + default value of ``Default``. + (#744) + [Lionel Schaub] + +- Add support for authenticating against Keystone and OpenStack based clouds + using OpenID Connect tokens. + (#789) + [Miguel Caballer] + +Compute +~~~~~~~ + +- GCE nodes can be launched in a subnetwork + (#783) + [Lars Larsson] + +- Add Subnetworks to GCE driver + (#780) + [Eric Johnson] + +- Fix missing pricing data for GCE + (LIBCLOUD-713, #779) + [Eric Johnson] + +- Add Image Family support for GCE + (#778) + [Rick Wright] + +- Fix a race condition on GCE driver `list_nodes()`- Invoking GCE’s + `list_nodes()` while some VMs are being shutdown can result in the following + `libcloud.common.google.ResourceNotFoundError` exception to be raised. + (#727) + [Lénaïc Huard] + +- Allow user to filter nodes by location by adding optional `location` + argument to the `list_nodes()` method in the CloudStack driver. + (#737) + [Lionel Schaub] + +- Fix OpenStack IP type resolution - make sure IP addresses are correctly + categorized and assigned on `private_ips` and `public_ips` Node attribute. + (#738) + [Lionel Schaub] + +- Add new `Perth, Australia` and `Manila, Philippines` region to the CloudSigma + v2 driver. + [Tomaz Muraus] + +- Update libvirt driver so it returns false if a non-local libvirt URL is used + (right now only local instances are supported). + (LIBCLOUD-820, #788) + [René Kjellerup] + +- Update libvirt driver to use `ip neight` command instead of `arp` to retrieve + node MAC address if `arp` command is not available or the current user + doesn't have permission to use it. + (LIBCLOUD-820, #788) + [René Kjellerup] + +- Update ``create_volume`` method in the CloudStack driver and add + ``ex_volume_type`` argument to it. If this argument is provided, a volume + which names matches this argument value will be searched and selected among + the available disk offerings. + (#785) + [Greg Bishop] + +Storage +~~~~~~~ + +- Add support for AWS signature v4 to the Outscale storage driver. + (#736) + [Javier M. Mellid] + +- Add new S3 RGW storage driver. + (#786, #792) + [Javier M. Mellid] + +Loadbalancer +~~~~~~~~~~~~ + +- Update AWS ELB driver to use signature version 4 for authentication. This + way, the driver also work with the `eu-central-1` region. + (#796) + [Tobias Paepke] + +DNS +~~~ + +- Add BuddyNS driver. + (#742) + [Oltjano Terpollari] + +- Added DNSPod driver (https://www.dnspod.com). + (#787) + [Oltjano Terpollari] + +Changes with Apache Libcloud 1.0.0-rc2 +-------------------------------------- + +General +~~~~~~~ + +- Fix a bug with consuming stdout and stderr in the paramiko SSH client which + would manifest itself under very rare condition when a consumed chunk only + contained a single byte or part of a multi byte UTF-8 character. + [Lakshmi Kannan, Tomaz Muraus] + +- Increase default chunk size from ``1024`` to ``4096`` bytes in the paramiko + SSH client. This results in smaller number of receive calls on the average. + [Tomaz Muraus] + +- Fix to Dimension Data API address for Middle-East and Africa + (#700) + [Anthony Shaw] + +- Addition of Dimension Data Australia federal government region to dimension data + drivers. + (#700) + [Anthony Shaw] + +- Throw a more user-friendly exception on "No address associated with hostname". + (#711, #714, LIBCLOUD-803) + [Tomaz Muraus, Scott Crunkleton] + +* Remove deprecated provider constants with the region in the name and related + driver classes (e.g. ``EC2_US_EAST``, etc.). + + Those drivers have moved to single provider constant + ``region`` constructor + argument model. + [Tomaz Muraus] + +* Introduce new `list_regions`` class method on the base driver class. This + method is to be used with provider drivers which support multiple regions and + ``region`` constructor argument. It allows users to enumerate available / + supported regions. + [Tomaz Muraus] + +Compute +~~~~~~~ + +- [dimension data] added support for VMWare tools VM information inside list_nodes responses + (#734) + [Jeff Dunham] + +- [ec2] added ex_encrypted and ex_kms_key_id optional parameters to the create volume method + (#729) + [Viktor Ognev] + +- [dimension data] added support for managing host anti-affinity rules, added paging support to + all supported calls and added support for requesting priority ordering when creating ACL rules + (#726) + [Jeff Dunham] + +- [openstack] when creating floating IPs, added pool_id as an optional argument + (#725) + [marko-p] + +- [google compute] Added setMachineType method to allow for changing sizes of instances + (#721) + [Eric Johnson] + +- [google compute] allow bypassing image search in standard project list + (#713) + [Max Illfelder] + +- Add support for requesting a MKS token for accessing the remote console in VMware + vCloud driver + (#706) + [Juan Font Alonso] + +- Add support in VMware vCloud driver for v5.5 API, with snapshot support + (#658) + [Juan Font Alonso] + +- Added support for adding a family to an image on Google Compute Driver + (#704) + [Max Illfelder] + +- Deprecated IBM SCE, HP Helion, OpSource, Ninefold and CloudFrames drivers, removed + driver code and tests. + (#701, LIBCLOUD-801) + [Anthony Shaw] + +- Introduced error messages (`libcloud.compute.deprecated`) for deprecated drivers + (#701, LIBCLOUD-801) + [Anthony Shaw] + +- New Compute drivers- BSNL, Indosat, Med-1, NTT-America, Internet Solutions + (#700) + [Anthony Shaw] + +- Fix to set default signature version for AWS Seoul region to v4, removed + non-supported size (hs1.xlarge) + (#684) + [Geunwoo Shin] + +- Support filtering by location in list_nodes for dimension data compute driver + fix lack of paging support + (#691) + [Jeff Dunham] + +- Support for filtering by IPv4, IPv6, network, network domain, VLAN in Dimension + data driver. + (#694) + [Jeff Dunham] + +- Added `Node.created_at` which, on supported drivers, contains the datetime the + node was first started. + (#698) + [Allard Hoeve] [Rick van de Loo] + +- New driver for Aliyun Elastic Compute Service. + (LIBCLOUD-802, #712) + [Sam Song, Heng Wu] + +Storage +~~~~~~~ + +- Added Outscale storage driver + (#730) + [Javier M. Mellid] + +- Improvements to Google Auth for Storage and Compute and MIME bug fix + (LIBCLOUD-800, #689) + [Scott Crunkleton] + +- Implement ``get_container``, ``get_object`` and ``upload_object_via_stream`` + methods in the Backblaze B2 storage driver. + + Note: Backblaze API doesn't upload streaming uploads so when using + ``upload_object_via_stream`` whole file is read and buffered in memory. + (#696) + [Jay jshridha] + +- New driver for Aliyun OSS Storage Service. + (LIBCLOUD-802, #712) + [Sam Song] + +Loadbalancer +~~~~~~~~~~~~ + +- New driver for Aliyun SLB Loadbalancer Service. + (LIBCLOUD-802, #712) + [Sam Song] + +DNS +~~~~ + +- Added NearlyFreeSpeech.net (NSFN) driver + [Ken Drayer] + (#733) + +- Added Lua DNS driver + [Oltjano Terpollari] + (#732) + +- Added NSOne driver + [Oltjano Terpollari] + (#710) + +- Fix a bug in the GoDaddy driver - make sure ``host`` attribute on the + connection class is correctly set to the hostname. + [Tomaz Muraus] + +- Fix handling of ``MX`` records in the Gandi driver. + (#718) + [Ryan Lee] + +Backup +~~~~~~ + +- Dimension Data - added additional testing, fixed bug on client response naming, + added support for adding backup clients to a backup enabled node. + (#692, #693, #695) + [Jeff Dunham] + +Changes with Apache Libcloud 1.0.0-pre1 +--------------------------------------- + +General +~~~~~~~ + +- Introduction of container based drivers for Docker, Rkt and Container-as-a-service + providers + (LIBCLOUD-781, #666) + [Anthony Shaw] + +- Introduce a new ``libcloud.backup`` API for Backup as a Service projects and + products. + (#621) + [Anthony Shaw] + +- Also retry failed HTTP(s) requests upon transient "read operation timed out" + SSL error. + (#556, LIBCLOUD-728) + [Scott Kruger] + +- Throw a more user-friendly exception if a client fails to establish SSL / TLS + connection with a server because of an unsupported SSL / TLS version. + (#682) + [Tomaz Muraus] + +Compute +~~~~~~~ + +- Add ap-northeast-2 region to EC2 driver (South Korea) + (#681) + [Anthony Shaw] + +- Added Added volume type to EC2 volume extra to EC2 driver. + (#680) + [Gennadiy Stas] + +- Add LazyObject class that provides lazy-loading, see `GCELicense` for usage + (LIBCLOUD-786, #665) + [Scott Crunkleton] + +- Added t2.nano instance type to EC2 Compute driver + (#663) + [Anthony Shaw] + +- Support for passing the image ID as a string instead of an instance of image when + creating nodes in Dimension Data driver. + (#664) + [Anthony Shaw] + +DNS +~~~ + +- Add support for 'health checks' in Aurora DNS driver + (#672) + [Wido den Hollander] + +- Make sure ``ttl`` attribute is correctly parsed and added to the ``Record`` + ``extra`` dictionary. + (#675) + [Wido den Hollander] + +- Improve unit tests of Aurora DNS driver + (#679) + [Wido den Hollander] + +Changes with Apache Libcloud 0.20.1 +----------------------------------- + +Compute +~~~~~~~ + +- [google] Allow for old and new style service account client email address + (LIBCLOUD-785) + [Hoang Phan] + +Changes with Apache Libcloud 0.20.0 +----------------------------------- + +General +~~~~~~~ + +- Added .editorconfig file for easier editing + (#625) + [Misha Brukman] + +- Fix a bug with Libcloud accidentally setting paramiko root logger level to + DEBUG (this should only happen if ``LIBCLOUD_DEBUG`` environment variable is + provided). + + Reported by John Bresnahan. + (LIBCLOUD-765) + [Tomaz Muraus, John Bresnahan] + +- Simply travis and tox config (.travis.yml, tox.ini). + (#608) + [Anthony Monthe] + +- Fixed Python2.6 unit testing (and Google Cloud Storage tests) + (#648) + [Scott Crunkleton] + +Compute +~~~~~~~ + +- [google] Allow for old and new style service account client email address + (LIBCLOUD-785) + [Hoang Phan] + +- Minor security improvement for storing cached GCE credentials + (LIBCLOUD-718) + [Siim Põder] + +- Removed DreamHosts Compute Driver, DreamHosts users will now use the OpenStack Node driver since DreamHosts are OpenStack + API compliant + (#655) + [Stephano Maffulli] + +- Added additional kwargs to the create_node method for Dimension Data driver, allowing the user to specify the RAM and + CPU upfront. Added a ex_reconfigure_node method and ex_list_customer_images as well as updating the API to 2.1. + (LIBCLOUD-783, #656) + [Anthony Shaw] + +- The EC2 Instance Type updated with correct disk sizes (especially the disk size for the m3 instances), + conversion errors between GiB an M[i]B, disk count were the cause. + Added instance types - g2.8xlarge and t2.large. + (#646) + [Philipp Hahn] + +- Add update node, update VMware tools, add storage, change storage size or speed, remove storage to Dimension Data Driver. + (LIBCLOUD-775, #644) + [Anthony Shaw] + +- Include 'service_name' support in _parse_service_catalog_auth_v3 for Openstack Drivers + (#647) + [Steve Gregory] + +- Outscale inc & sas driver update + (#645) + [@LordShion] + +- Add new `eu-west-2` & `us-east-2` regions to the OUTSCALE_INC & OUTSCALE_SAS drivers. + [Filipe Silva /lordshion] + +- [google compute] add pricing data update script + (#464) + [Misha Brukman] + +- Fix a bug in the ``list_volumes`` method in the CloudStack driver so it + returns an empty list if no volumes are found. + (#617) + [Wido den Hollander] + +- Return proper volume state for CloudStack volumes. + (#615, LIBCLOUD-764) + [Wido den Hollander] + +- Add support for multiple regions in Aurora compute driver + (#623) + [Wido den Hollander] + +- Fix value of ``node.extra['ip_addresses']`` node attribute in the CloudStack + driver. + (LIBCLOUD-767, #627) + [Atsushi Sasaki] + +- Make sure that ``node.public_ips`` attribute in the CloudStack driver doesn't + contain duplicated values.. + (LIBCLOUD-766, #626) + [Atsushi Sasaki] + +- Allow user to wait for a resource to reach a desired state in the + Dimension Data driver by using new ``ex_wait_for_state`` method. + (LIBCLOUD-707, #631) + [Anthony Shaw] + +- Added M4 pricing and instance information to EC2 driver + (#634) + [Benjamin Zaitlen] + +- Added C4 instance information to EC2 driver + (#638) + [amitofs] + +- Allow location of the datacenter to be supplied in ProfitBricks driver + (LIBCLOUD-771, #635) + [Joel Reymont] + +- Reduce redundant API calls in CloudStack driver + (LIBCLOUD-590, #641) + [Atsushi Sasaki] + +- Add an additional argument to libcloud.compute.drivers.GCENodeDriver.create_node + to allow for creation of preemptible GCE instances + (#643) + [@blawney] + +- GoogleStorageDriver can now use either our S3 authentication or other Google Cloud Platform OAuth2 authentication methods. + (#633) + [Scott Crunkleton] + +- All NodeState, StorageVolumeState, VolumeSnapshotState and Provider attributes + are now strings instead of integers. + (#624) + [Allard Hoeve] + +Storage +~~~~~~~ + +Loadbalancer +~~~~~~~~~~~~ + +DNS +~~~ + +- RackSpace driver - New DNS driver methods: + - ex_iterate_ptr_records + - ex_get_ptr_record + - ex_create_ptr_record + - ex_update_ptr_record + - ex_delete_ptr_record + + This should cover all of the functionality offered by the Rackspace DNS API + in regards to RDNS. + (LIBCLOUD-780, #652) + [Greg Hill] + +- Update ``create_record`` in the WorldWideDNS driver so it automatically + selects a slot if one is not provided by the user via ``extra['entry']`` + argument. + (#621) + [Alejandro Pereira] + +- Introduce GoDaddy DNS Driver with examples and documentation. + (LIBCLOUD-772, #640, LIBCLOUD-778) + [Anthony Shaw] + +- Add new driver for CloudFlare DNS (https://www.cloudflare.com/dns/). + (#637) + [Tomaz Muraus] + +Changes with Apache Libcloud 0.19.0 +----------------------------------- + +General +~~~~~~~ + +- Update Rackspace AUTH_URL + (LIBCLOUD-738) + [Brian Curtin] + +- Fix ``LIBCLOUD_DEBUG`` mode so it works on Python 3.x. + [Tomaz Muraus] + +- Fix Libcloud code so it doesn't throw an exception if simplejson < 2.1.0 is + installed. + (LIBCLOUD-714, #577) + [Erik Johnson] + +- Fix endpoint URL for DimensionData Asia Pacific region. + (#585) + [Anthony Shaw] + +- Document potential time drift issue which could cause authentication in the + GCE drivers to fail. + (#571) + [Michal Tekel] + +- Update documentation for EC2 - make sure they reflect region changes from + 0.14 release. + (#606) + [James Guthrie] + +Compute +~~~~~~~ + +- Fixed malformed XML requests with Dimension Data driver. + (LIBCLOUD-760, #610) + [Anthony Shaw] + +- Update list of scopes for Google Compute Engine driver. + (#607) + [Otto Bretz] + +- Allow user to filter VPC by project in the CloudStack driver by passing + ``project`` argument to the ``ex_list_vps`` method. + (#516) + [Syed Mushtaq Ahmed] + +- Add volume management methods and other various improvements and fixes in the + RunAbove driver. + (#561) + [Anthony Monthe] + +- Add support and update Dimension Data driver to use API v2.0 by default. + (LIBCLOUD-736, #564) + [Anthony Shaw] + +- Add new ``ex_virtual_network_name`` and ``ex_network_config`` argument to the + `create_node`` method in the Azure driver. With those arguments user can now + specify which virtual network to use. + (#569) + [Jesaja Everling] + +- Fix ``create_node`` method in the GCE driver calling inexistent method + (ex_get_disk instead of ex_get_volume). + (#574) + [Alex Poms] + +- Allow user to pass ``proxy_url`` keyword argument to the VCloud driver + constructor. + (#578) + [Daniel Pool] + +- Various fixes and improvements in the DimensionData driver (support for + creating servers in MCP 1 and 2 data center, performance improvements in the + location fetching, etc.). + (#587, #593, LIBCLOUD-750, LIBCLOUD-753) + [Anthony Shaw] + +- Added ``ex_assign_public_ip`` argument to ``create_node`` in the EC2 driver. + (#590) + [Kyle Long] + +- Added ``ex_terminate_on_shutdown`` argument to ``create_node`` in the EC2 + driver. + (#595) + [Kyle Long] + +- Various fixes and improvements in the ``ex_authorize_security_group_ingress`` + in the CloudStack driver. + (LIBCLOUD-749, #580) + [Lionel Schaub] + +- Add pricing information for Softlayer. + (LIBCLOUD-759, #603) + [David Wilson] + +- Standardize VolumeSnapshot states into the ``state`` attribute. + (LIBCLOUD-758, #602) + [Allard Hoeve] + +Storage +~~~~~~~ + +- Add support for ``sa-east-1`` region to the Amazon S3 driver. + (#562) + [Iuri de Silvio] + +- Fix handling of binary data in Local storage driver on Python 3. Now the file + which is to be written or read from is opened in the binary mode (``b`` flag). + (LIBCLOUD-725, #568) + [Torf] + +Loadbalancer +~~~~~~~~~~~~ + +- Add a new driver for DimensionData load-balancing service + (http://cloud.dimensiondata.com/). + (LIBCLOUD-737, #567) + [Anthony Shaw] + +DNS +~~~ + +- Update Google Cloud DNS API from 'v1beta1' to 'v1' + (#583) + [Misha Brukman] + +- Add new driver for AuroraDNS service. + (#562, LIBCLOUD-735) + [Wido den Hollander] + +- Fix "_to_record" in the Route53 driver - make sure it doesn't throw if the + record TTL is not available. + [Tomaz Muraus] + +- Add new driver for WorldWideDNS service + (http://www.worldwidedns.net/home.asp). + (#566, LIBCLOUD-732) + [Alejandro Pereira] + +- Add new driver for DNSimple service (https://dnsimple.com/). + (#575, #604, LIBCLOUD-739) + [Alejandro Pereira, Patrick Humpal] + +- Add new driver for PointDNS service (https://pointhq.com). + (#576, #591, LIBCLOUD-740) + [Alejandro Pereira] + +- Add new driver for Vultr DNS service (https://www.vultr.com). + (#579, #596, LIBCLOUD-745) + [Alejandro Pereira, Janez Troha] + +- Add new driver for Liquidweb DNS service (http://www.liquidweb.com/). + (#581, LIBCLOUD-746) + [Oltjano Terpollari, Alejandro Pereira] + +- Add new driver for Zonomi DNS hosting service (http://zonomi.com/). + (#582, LIBCLOUD-747) + [Oltjano Terpollari, Alejandro Pereira] + +- Add new driver for Durable DNS service (https://durabledns.com/). + (#588, LIBCLOUD-748) + [Oltjano Terpollari, Alejandro Pereira] + +Changes with Apache Libcloud 0.18.0 +----------------------------------- General ~~~~~~~ @@ -15,19 +4731,45 @@ General - Add support for AWS Signature version 4. Note: Currently only GET HTTP method is supported. - (GITHUB-444) + (#444) [Gertjan Oude Lohuis] - Fix a bug in the debug mode logging (LIBCLOUD_DEBUG). Logging to the debug file would throw an exception if the text contained non-ascii characters. [Tomaz Muraus] +- Fix a bug with connection code throwing an exception if a port was a unicode + type and not a str or int. + (#533, LIBCLOUD-716) + [Avi Weit] + +- Update ``is_valid_ip_address`` function so it also works on Windows. + (#343, #498, LIBCLOUD-601, LIBCLOUD-686) + [Nicolas Fraison, Samuel Marks] + +- Add support for retrying failed HTTP requests. + + Retrying is off by default and can be enabled by setting + ``LIBCLOUD_RETRY_FAILED_HTTP_REQUESTS`` environment variable. + (#515, LIBCLOUD-360, LIBCLOUD-709) + +- Fix a bug in consuming stdout and stderr strams in Paramiko SSH client. + In some cases (like connecting to localhost via SSH), exit_status_ready + gets set immediately even before the while loop to consume the streams + kicks in. In those cases, we will not have consumed the streams at all. + (#558) + [Lakshmi Kannan] + Compute ~~~~~~~ +- Google Compute now supports paginated lists including filtering. + (#491) + [Lee Verberne] + - OpenStackNodeSize objects now support optional, additional fields that are supported in OpenStack 2.1: `ephemeral_disk`, `swap`, `extra`. - (GITHUB-488, LIBCLOUD-682) + (#488, LIBCLOUD-682) [Greg Hill] - StorageVolume objects now have an attribute `state` that holds a @@ -39,98 +4781,98 @@ Compute such states. A couple of drivers already put state fields in the `extra` fields of StorageVolumes. These fields were kept for backwards-compatibility and for reference. - (GITHUB-476) + (#476) [Allard Hoeve] - StorageVolume objects on EC2 and OpenStack now have a key called snapshot_id in their extra dicts containing the snapshot ID the volume was based on. - (GITHUB-479) + (#479) [Allard Hoeve] - OpenStack driver: deprecated ex_create_snapshot and ex_delete_snapshot in favor of create_volume_snapshot and destroy_volume_snapshot. Updated base driver method create_storage_volume argument name to be optional. - (GITHUB-478) + (#478) [Allard Hoeve] - Add support for creating volumes based on snapshots to EC2 and OS drivers. Also modify signature of base NodeDriver.create_volume to reflect the fact that all drivers expect a StorageSnapshot object as the snapshot argument. - (GITHUB-467, LIBCLOUD-672) + (#467, LIBCLOUD-672) [Allard Hoeve] - VolumeSnapshots now have a `created` attribute that is a `datetime` field showing the creation datetime of the snapshot. The field in VolumeSnapshot.extra containing the original string is maintained, so this is a backwards-compatible change. - (GITHUB-473) + (#473) [Allard Hoeve] - Improve GCE create_node, make sure ex_get_disktype function - (GITHUB-448) + (#448) [Markos Gogoulos] - GCE driver fix to handle unknown image projects - (GITHUB-447) + (#447) [Markos Gogoulos] - Allow user to pass ``ex_blockdevicemappings`` argument to the create_node method in the OpenStack driver. - (GITHUB-398, LIBCLOUD-637) + (#398, LIBCLOUD-637) [Allard Hoeve] - Fix ``list_volume_snapshots`` method in the EC2 driver so it comforms to the base API. - (LIBCLOUD-664, GITHUB-451) + (LIBCLOUD-664, #451) [Allard Hoeve] - Add ``volumes_attached`` attibute to ``node.extra`` in the OpenStack driver. - (LIBCLOUD-668, GITHUB-462) + (LIBCLOUD-668, #462) [Allard Hoeve] - Add the following new methods to the Linode driver: ``ex_list_volumes``, ``ex_create_volume``, ``ex_destroy_volume``. - (LIBCLOUD-649, GITHUB-430) + (LIBCLOUD-649, #430) [Wojciech Wirkijowski] - Add ``list_volume_snapshots`` method to the OpenStack driver. - (LIBCLOUD-663, GITHUB-450) + (LIBCLOUD-663, #450) [Allard Hoeve] - Add Site to Site VPN functionality to CloudStack driver. - (GITHUB-465) + (#465) [Avi Nanhkoesingh] - Add affinity group support to CloudStack driver - (LIBCLOUD-671, GITHUB-468) + (LIBCLOUD-671, #468) [Mateusz Korszun] - Add a support for a new AWS Frankfurt, Germany region (``eu-central-1``) to the EC2 driver using AWS Signature v4. - (GITHUB-444) + (#444) [Gertjan Oude Lohuis, Tomaz Muraus] - Allow Filtering in EC2 list_images() driver - (GITHUB-456, LIBCLOUD-667) + (#456, LIBCLOUD-667) [Katriel Traum] - Add ex_list_ip_forwarding_rules() to CloudStack driver - (GITHUB-483) + (#483) [Atsushi Sasaki] - Add AURORA compute driver - (LIBCLOUD-641, GITHUB-477) + (LIBCLOUD-641, #477) [Wido den Hollander] - Update ``ex_describe_tags`` method in the EC2 driver and allow user to list tags for any supported resource. Previously you could only list tags for a node or a storage volume. - (LIBCLOUD-676, GITHUB-482) + (LIBCLOUD-676, #482) [John Kinsella] - Various improvements in the HostVirual driver (code refactoring, support for managing "packages"). - (LIBCLOUD-670, GITHUB-472) + (LIBCLOUD-670, #472) [Dinesh Bhoopathy] - Add support for DigitalOcean API v2.0 while maintaining support for the old @@ -138,34 +4880,152 @@ Compute Note: API v2.0 is now used by default. To use the old API v1.0, pass ``api_version='1.0'`` argument to the driver constructor. - (GITHUB-442) + (#442) [Andrew Starr-Bochicchio] - Add new ``d4.`` instance types to the EC2 driver. Also update EC2 pricing data. - (GITHUB-490) + (#490) [Tomaz Muraus] - Add new driver for Microsft Azure Virtual Machines service. - (LIBCLOUD-556, GITHUB-305, GITHUB-499) + (LIBCLOUD-556, #305, #499, #538) [Michael Bennett, davidcrossland, Richard Conway, Matt Baldwin, Tomaz Muraus] - Fix VPC lookup method in CloudStack driver - (GITHUB-506) + (#506) [Avi Nanhkoesingh] +- Add new driver for the Dimension Data provider based on the OpSource driver. + (LIBCLOUD-698, #507, LIBCLOUD-700, #513) + [Anthony Shaw] + +- Add "virtualmachine_id" attribute to the ``CloudStackAddress`` class in the + CloudStack driver. + (LIBCLOUD-679, #485) + [Atsushi Sasaki] + +- Allow user to pass filters via arguments to the + ``ex_list_port_forwarding_rules`` in the CloudStack driver. + (LIBCLOUD-678, #484) + [Atsushi Sasaki] + +- Fix an issue with ``list_nodes`` in the CloudSigma driver throwing an + exception if a node in the list had a static IP. + (LIBCLOUD-707, #514) + [Chris O'Brien] + +- Don't throw an exception if a limit for a particular CloudStack resource is + "Unlimited" and not a number. + (#512) + [Syed Mushtaq Ahmed] + +- Allow user to pass ``ex_config_drive`` argument to the ``create_node`` method + in the OpenStack driver. + (LIBCLOUD-356, #330) + [Ryan Parrish] + +- Add new driver for Cloudwatt (https://www.cloudwatt.com/en/) provider. + (#338) + [Anthony Monthe] + +- Add new driver for Packet (https://www.packet.com/) provider. + (LIBCLOUD-703, #527) + [Aaron Welch] + +- Update Azure VM pricing information and add information for new D instance + types. + (#528) + [Michael Bennett] + +- Add ``ex_get_node`` and ``ex_get_volume`` methods to CloudStack driver. + (#532) + [Anthony Monthe] + +- Update CloudSigma driver so the "unavailable" and "paused" node state is + correctly mapped to "error" and "paused" respectively. + (#517) + [Chris O'Brien] + +- Add SSH key pair management methods to the Gandi driver. + (#534) + [Anthony Monthe] + +- Add ``ex_get_node`` and ``ex_get_volume`` methods to Gandi driver. + (#534) + [Anthony Monthe] + +- Add ``fault`` attribute to the ``extra`` dictionary of the ``Node`` instance + returned by the OpenStack driver. + (LIBCLOUD-730, #557) + [Nick Fox] + +- Add new driver for Onapp IaaS platform. + (LIBCLOUD-691, #502) + [Matthias Wiesner] + +- Allow user to inject custom data / script into the Azure node by passing + ``ex_custom_data`` argument to the ``create_node`` method. + (LIBCLOUD-726, #554) + [David Wilson] + +- Add ``ex_create_cloud_service`` and ``ex_destroy_cloud_service`` method to the + Azure driver. + (LIBCLOUD-724, #551) + [David Wilson] + +- Add support for passing user data when creating a DigitalOcean node + (``ex_user_data`` argument). + (LIBCLOUD-731, #559) + [David Wilson] + +- Allow user to specify which arguments are passed to ``list_nodes`` method + which is called inside ``wait_until_running`` by passing + ``ex_list_nodes_kwargs`` argument to the ``wait_until_running`` method. + (``ex_user_data`` argument). + (LIBCLOUD-723, #548) + [David Wilson] + +- Allow user to pass ``ex_volume_type`` argument to the ``create_volume`` method + in the OpennStack driver. + (#553) + [Rico Echwald-Tijsen] + +- Add new driver for RunAbove (https://www.runabove.com) provider. + (#550) + [Anthony Monthe] + +- Fix a bug with exception being throw inside the CloudStack driver when the + provider returned no error message in the body. + (#555) + [Konstantin Skaburskas] + +- Various improvements in the DigitalOcean driver: + - Increase page size to API maximum. + - Add ``ex_create_attr`` kwarg to ``create_node`` method. + - Update all the ``list_*`` methods to use paginated requests + - Allow user to specify page size by passing ``ex_per_page`` argument to the + constructor. + + (LIBCLOUD-717, #537) + [Javier Castillo II] + Storage ~~~~~~~ - Fix a bug with authentication in the OpenStack Swift driver. - (GITHUB-492, LIBCLOUD-635) + (#492, LIBCLOUD-635) [Tom Fifield] +- Add AuroraObjects Storage Driver. + (#540, LIBCLOUD-719) + [Wido den Hollander] + Loadbalancer ~~~~~~~~~~~~ - Add a new driver for Softlayer load-balancing service (https://www.softlayer.com/load-balancing). - (GITHUB-500, LIBCLOUD-688) + (#500, LIBCLOUD-688) [Avi Weit] DNS @@ -173,26 +5033,30 @@ DNS - Fix a bug when a ZoneDoesntExist exception was thrown when listing records for a zone which has no records in the HostVirtual driver. - (GITHUB-460) + (#460) [Vanč Levstik] - Correctly handle MX records priority in the Route53 driver. - (GITHUB-469) + (#469) [Vanč Levstik] - Allow user to create an A record which points directly to the domain zone name in the Route53 driver. - (GITHUB-469) + (#469) [Vanč Levstik] - Fix delete_zone method in the HostVirtual driver. - (GITHUB-461) + (#461) [Vanč Levstik] - Fix parsing of the record name in the HostVirtual driver. - (GITHUB-461) + (#461) [Vanč Levstik] +- Add new driver for DigitalOcean DNS service. + (#505) + [Javier Castillo II] + Changes with Apache Libcloud 0.17.0 ----------------------------------- @@ -202,162 +5066,165 @@ General - Use ``match_hostname`` function from ``backports.ssl_match_hostname`` package to verify the SSL certificate hostname instead of relying on our own logic. - (GITHUB-374) + (#374) [Alex Gaynor] Compute ~~~~~~~ +- Add new `eu-west-2` & `us-east-2` regions to the OUTSCALE_INC & OUTSCALE_SAS drivers. + [Filipe Silva /lordshion] + - GCE driver updated to include ex_stop_node() and ex_start_node() methods. - (GITHUB-442) + (#442) [Eric Johnson] - GCE driver now raises ResourceNotFoundError when the specified image is not found in any image project. Previously, this would return None but now raises the not-found exception instead. This fixes a bug where returning None caused ex_delete_image to raise an AttributeError. - (GITHUB-441) + (#441) [Eric Johnson] - GCE driver update to support JSON format Service Account files and a PY3 fix from Siim Põder for LIBCLOUD-627. - (LIBCLOUD-627, LIBCLOUD-657, GITHUB-438) + (LIBCLOUD-627, LIBCLOUD-657, #438) [Eric Johnson] - GCE driver fixed for missing param on ex_add_access_config. - (GITHUB-435) + (#435) [Peter Mooshammer] - GCE driver support for HTTP load-balancer resources. - (LIBCLOUD-605, GITHUB-429) + (LIBCLOUD-605, #429) [Lee Verberne] - GCE driver updated to make better use of GCEDiskTypes. - (GITHUB-428) + (#428) [Eric Johnson] - GCE driver list_images() now returns all non-deprecated images by default. - (LIBCLOUD-602, GITHUB-423) + (LIBCLOUD-602, #423) [Eric Johnson] - Improve GCE API coverage for create_node(). - (GITHUB-419) + (#419) [Eric Johnson] - GCE Licenses added to the GCE driver. - (GITHUB-420) + (#420) [Eric Johnson] - GCE Projects support common instance metadata and usage export buckets. - (GITHUB-409) + (#409) [Eric Johnson] - Improvements to TargetPool resource in GCE driver. - (GITHUB-414) + (#414) [Eric Johnson] - Adding TargetInstances resource to GCE driver. - (GITHUB-393) + (#393) [Eric Johnson] - Adding DiskTypes resource to GCE driver. - (GITHUB-391) + (#391) [Eric Johnson] - Fix boot disk auto_delete in GCE driver. - (GITHUB-412) + (#412) [Igor Bogomazov] - Add Routes to GCE driver. - (GITHUB-410) + (#410) [Eric Johnson] - Add missing ``ubuntu-os-cloud`` images to the GCE driver. - (LIBCLOUD-632, GITHUB-385) + (LIBCLOUD-632, #385) [Borja Martin] - Add new `us-east-2` and `us-east-3` region to the Joyent driver. - (GITHUB-386) - [ZuluPro] + (#386) + [Anthony Monthe] - Add missing t2. instance types to the us-west-1 region in the EC2 driver. - (GITHUB-388) + (#388) [Matt Lehman] - Add option to expunge VM on destroy in CloudStack driver. - (GITHUB-382) + (#382) [Roeland Kuipers] - Add extra attribute in list_images for CloudStack driver. - (GITHUB-389) + (#389) [Loic Lambiel] - Add ``ex_security_group_ids`` argument to the create_node method in the EC2 driver. This way users can launch VPC nodes with security groups. - (GITHUB-373) + (#373) [Itxaka Serrano] - Add description argument to GCE Network. - (GITHUB-397) + (#397) [Eric Johnson] - GCE: Improve MachineType (size) coverage of GCE API. - (GITHUB-396) + (#396) [Eric Johnson] - GCE: Improved Images coverage. - (GITHUB-395) + (#395) [Eric Johnson] - GCE: Support for global IP addresses. - (GITHUB-390, GITHUB-394) + (#390, #394) [Eric Johnson] - GCE: Add missing snapshot attributes. - (GITHUB-401) + (#401) [Eric Johnson] - AWS: Set proper disk size in c3.X instance types. - (GITHUB-405) + (#405) [Itxaka Serrano] - Fix a bug with handling of the ``ex_keyname`` argument in the Softlayer driver. - (GITHUB-416, LIBCLOUD-647) + (#416, LIBCLOUD-647) [Dustin Oberloh] - Update CloudSigma region list (remove Las Vegas, NV region and add new San Jose, CA and Miami, FL region). - (GITHUB-417) + (#417) [Viktor Petersson] - Add ``ex_get_node`` method to the Joyent driver. - (GITHUB-421) - [ZuluPro] + (#421) + [Anthony Monthe] - Add support for placement group management to the EC2 driver. - (GITHUB-418) + (#418) [Mikhail Ovsyannikov] - Add new tok02 region to the Softlayer driver. - (GITHUB-436, LIBCLOUD-656) + (#436, LIBCLOUD-656) [Dustin Oberloh] - Add new Honolulu, HI endpoint to the CloudSigma driver. - (GITHUB-439) + (#439) [Stephen D. Spencer] - Fix a bug with config_drive attribute in the OpenStack driver. New versions of OpenStack now return a boolean and not a string. - (GITHUB-433) + (#433) [quilombo] - Add support for Abiquo API v3.x, remove support for now obsolete API v2.x. - (GITHUB-433, LIBCLOUD-652) + (#433, LIBCLOUD-652) [David Freedman] - Allow rootdisksize parameter in create_node CloudStack driver - (GITHUB-440, LIBCLOUD-658) + (#440, LIBCLOUD-658) [Loic Lambiel] Storage @@ -367,7 +5234,7 @@ Storage ``upload_object_via_stream`` method. This way user can specify CORS headers with the drivers which support that. - (GITHUB-403, GITHUB-404) + (#403, #404) [Peter Schmidt] - Fix upload_object_via_stream so it works correctly under Python 3.x if user @@ -379,26 +5246,26 @@ Storage Previously, if iterator returned 1 byte in one iteration, we would directly send this as a single chunk to the API. - (GITHUB-408, LIBCLOUD-639) + (#408, LIBCLOUD-639) [Peter Schmidt] Loadbalancer ~~~~~~~~~~~~ - Updates to CloudStack driver. - (GITHUB-434) + (#434) [Jeroen de Korte] DNS ~~~ - New driver for Softlayer DNS service. - (GITHUB-413, LIBCLOUD-640) + (#413, LIBCLOUD-640) [Vanč Levstik] - Fix a bug with ``ex_create_multi_value_record`` method in the Route53 driver only returning a single record. - (GITHUB-431, LIBCLOUD-650) + (#431, LIBCLOUD-650) [Itxaka Serrano] Changes with Apache Libcloud 0.16.0 @@ -426,7 +5293,7 @@ Compute - Fix an issue with ``LIBCLOUD_DEBUG`` not working correctly with the Linode driver. [Tomaz Muraus, Juan Carlos Moreno] - (LIBCLOUD-598, GITHUB-342) + (LIBCLOUD-598, #342) - Add new driver for VMware vSphere (http://www.vmware.com/products/vsphere/) based clouds. @@ -442,11 +5309,11 @@ Compute [Atsushi Sasaki] - Create ``CloudStackFirewallRule`` class and corresponding methods. - (LIBCLOUD-594, GITHUB-337) + (LIBCLOUD-594, #337) [Atsushi Sasaki] - Add support for SSD disks to Google Compute driver. - (GITHUB-339) + (#339) [Eric Johnson] - Add utility ``get_regions`` and ``get_service_names`` methods to the @@ -461,12 +5328,12 @@ Compute [Tomaz Muraus] - Add ip_address parameter in CloudStack driver ``create_node`` method. - (GITHUB-346) + (#346) [Roeland Kuipers] - Fix ``ParamikoSSHClient.run`` and ``deploy_node`` method to work correctly under Python 3. - (GITHUB-347) + (#347) [Eddy Reyes] - Update OpenStack driver to map more node states to states recognized by @@ -475,11 +5342,11 @@ Compute - Fix a bug with ``ex_metadata`` argument handling in the Google Compute Engine driver ``create_node`` method. - (LIBCLOUD-544, GITHUB-349, GITHUB-353) + (LIBCLOUD-544, #349, #353) [Raphael Theberge] - Add SSH key pair management methods to the Softlayer driver. - (GITHUB-321, GITHUB-354) + (#321, #354) [Itxaka Serrano] - Correctly categorize node IP addresses into public and private when dealing @@ -499,84 +5366,84 @@ Compute [Tomaz Muraus, Xavier Barbosa] - Add new driver for ProfitBricks provider. - (LIBCLOUD-589, GITHUB-352) + (LIBCLOUD-589, #352) [Matt Baldwin] - Various improvements and bugs fixes in the GCE driver. For a list, see https://github.com/apache/libcloud/pull/360/commits - (GITHUB-360) + (#360) [Evgeny Egorochkin] - Allow user to specify virtualization type when registering an EC2 image by passing ``virtualization_type`` argument to the ``ex_register_image`` method. - (GITHUB-361) + (#361) [Andy Grimm] - Add ``ex_create_image`` method to the GCE driver. - (GITHUB-358, LIBCLOUD-611) + (#358, LIBCLOUD-611) [Katriel Traum] - Add some methods to CloudStack driver: create_volume_snapshot, list_snapshots, destroy_volume_snapshot create_snapshot_template, ex_list_os_types) - (GITHUB-363, LIBCLOUD-616) + (#363, LIBCLOUD-616) [Oleg Suharev] - Added VPC support and Egress Firewall rule support fo CloudStack - (GITHUB-363) + (#363) [Jeroen de Korte] - Add additional attributes to the ``extra`` dictionary of OpenStack StorageVolume object. - (GITHUB-366) + (#366) [Gertjan Oude Lohuis] - Fix ``create_volume`` method in the OpenStack driver to return a created volume object (instance of StorageVolume) on success, instead of a boolean indicating operation success. - (GITHUB-365) + (#365) [Gertjan Oude Lohuis] - Add optional project parameters for ex_list_networks() to CloudStack driver - (GITHUB-367, LIBCLOUD-615) + (#367, LIBCLOUD-615) [Rene Moser] - CLOUDSTACK: option to start VM in a STOPPED state - (GITHUB-368) + (#368) [Roeland Kuipers] - Support "config_drive" in the OpenStack driver. Allow users to pass ``ex_config_drive`` argument to the ``create_node`` and ``ex_rebuild_node`` method. - (GITHUB-370) + (#370) [Nirmal Ranganathan] - Add support for service scopes to the ``create_node`` method in the GCE driver. - (LIBCLOUD-578, GITHUB-373) + (LIBCLOUD-578, #373) [Eric Johnson] - Update GCE driver to allow for authentication with internal metadata service. - (LIBCLOUD-625, LIBCLOUD-276, GITHUB-276) + (LIBCLOUD-625, LIBCLOUD-276, #276) [Eric Johnson] - Fix a bug in Elasticstack node creation method where it would raise exceptions because of missing data in a response, and also fix pulling the IP from the proper data item. - (GITHUB-325) + (#325) [Michael Bennett] - Fix a bug which prevented user to connect and instantiate multiple EC2 driver instances for different regions at the same time. - (GITHUB-325) + (#325) [Michael Bennett] - Add methods in CloudStack driver to manage mutiple nics per vm. - (GITHUB-369) + (#369) [Roeland Kuipers] - Implements VPC network ACLs for CloudStack driver. - (GITHUB-371) + (#371) [Jeroen de Korte] Storage @@ -587,7 +5454,7 @@ Storage - Fix a bug with not being able to specify meta_data / tags when uploading an object using Google Storage driver. - (LIBCLOUD-612, GITHUB-356) + (LIBCLOUD-612, #356) [Stefan Friesel] Loadbalancer @@ -595,14 +5462,14 @@ Loadbalancer - Allow user to specify session affinity algorithm in the GCE driver by passing ``ex_session_affinity`` argument to the ``create_balancer`` method. - (LIBCLOUD-595, GITHUB-341) + (LIBCLOUD-595, #341) [Lee Verberne, Eric Johnson] DNS ~~~ - Various fixes in the Google DNS driver. - (GITHUB-378) + (#378) [Franck Cuny] Changes with Apache Libcloud 0.15.1 @@ -614,27 +5481,27 @@ Compute - Allow user to limit a list of subnets which are returned by passing ``subnet_ids`` and ``filters`` argument to the ``ex_list_subnets`` method in the EC2 driver. - (LIBCLOUD-571, GITHUB-306) + (LIBCLOUD-571, #306) [Lior Goikhburg] - Allow user to limit a list of internet gateways which are returned by passing ``gateway_ids`` and ``filters`` argument to the ``ex_list_internet_gateways`` method in the EC2 driver. - (LIBCLOUD-572, GITHUB-307) + (LIBCLOUD-572, #307) [Lior Goikhburg] - Allow user to filter which nodes are returned by passing ``ex_filters`` argument to the ``list_nodes`` method in the EC2 driver. - (LIBCLOUD-580, GITHUB-320) + (LIBCLOUD-580, #320) [Lior Goikhburg] - Add network_association_id to ex_list_public_ips and CloudstackAddress object - (GITHUB-327) + (#327) [Roeland Kuipers] - Allow user to specify admin password by passing ``ex_admin_pass`` argument to the ``create_node`` method in the Openstack driver. - (GITHUB-315) + (#315) [Marcus Devich] - Fix a possible race condition in deploy_node which would occur if node @@ -643,7 +5510,7 @@ Compute Previously, we would immediately throw if we can connect, but the SSH key hasn't been installed yet. - (GITHUB-331) + (#331) [David Gay] - Propagate an exception in ``deploy_node`` method if user specified an invalid @@ -682,17 +5549,17 @@ General * publickey._to_md5_fingerprint * publickey.get_pubkey_ssh2_fingerprint - (GITHUB-301) + (#301) [Csaba Hoch] - Update CA_CERTS_PATH to also look for CA cert bundle which comes with openssl Homebrew formula on OS x (/usr/local/etc/openssl/cert.pem). - (GITHUB-309) + (#309) [Pedro Romano] - Update Google drivers to allow simultaneous authornization for all the supported Google Services. - (GITHUB-302) + (#302) [Eric Johnson] Compute @@ -706,11 +5573,11 @@ Compute instead of NodeState.TERMINATED, "Stopping" to NodeState.PENDING instead of NodeState.TERMINATED and "Expunging" to NodeState.PENDING instead of NodeState.TERMINATED. - (GITHUB-246) + (#246) [Chris DeRamus, Tomaz Muraus] - Add ex_create_tags and ex_delete_tags method to the CloudStack driver. - (LIBCLOUD-514, GITHUB-248) + (LIBCLOUD-514, #248) [Chris DeRamus] - Add new G2 instances to the EC2 driver. @@ -718,15 +5585,15 @@ Compute - Add support for multiple API versions to the Eucalyptus driver and allows user to pass "api_version" argument to the driver constructor. - (LIBCLOUD-516, GITHUB-249) + (LIBCLOUD-516, #249) [Chris DeRamus] - Map "Powered Off" state in the vCloud driver from "TERMINATED" to "STOPPED". - (GITHUB-251) + (#251) [Ash Berlin] - Add ex_rename_node method to the DigitalOcean driver. - (GITHUB-252) + (#252) [Rahul Ranjan] - Improve error parsing in the DigitalOcean driver. @@ -736,28 +5603,28 @@ Compute - Add extension methods for the VPC internet gateway management to the EC2 driver. - (LIBCLOUD-525, GITHUB-255) + (LIBCLOUD-525, #255) [Chris DeRamus] - Add CloudStackProject class to the CloudStack driver and add option to select project and disk offering on node creation. - (LIBCLOUD-526, GITHUB-257) + (LIBCLOUD-526, #257) [Jim Divine] - Fix IP address handling in the OpenStack driver. - (LIBCLOUD-503, GITHUB-235) + (LIBCLOUD-503, #235) [Markos Gogoulos] - Ad new ex_delete_image and ex_deprecate_image method to the GCE driver. - (GITHUB-260) + (#260) [Franck Cuny] - Ad new ex_copy_image method to the GCE driver. - (GITHUB-258) + (#258) [Franck Cuny] - Ad new ex_set_volume_auto_delete method to the GCE driver. - (GITHUB-264) + (#264) [Franck Cuny] - Add ex_revoke_security_group_ingress method to the CloudStack driver. @@ -765,27 +5632,27 @@ Compute - Allow user to pass ex_ebs_optimized argument to the create_node method in the EC2 driver. - (GITHUB-272) + (#272) [zerthimon] - Add "deprecated" attribute to the Node object in the Google Compute Engine driver. - (GITHUB-276) + (#276) [Chris / bassdread] - Update Softlayer driver to use "fullyQualifiedDomainName" instead of "hostname" attribute for the node name. - (GITHUB-280) + (#280) [RoelVanNyen] - Allow user to specify target tags using target_tags attribute when creating a firewall rule in the GCE driver. - (GITHUB-278) + (#278) [zerthimon] - Add new standard API for image management and initial implementation for the EC2 and Rackspace driver. - (GITHUB-277) + (#277) [Matt Lehman] - Allow user to specify "displayname" attribute when creating a CloudStack node @@ -793,7 +5660,7 @@ Compute Also allow "name" argument to be empty (None). This way CloudStack automatically uses Node's UUID for the name. - (GITHUB-289) + (#289) [Jeff Moody] - Deprecate "key" argument in the SSHClient class in favor of new "key_files" @@ -807,12 +5674,12 @@ Compute - Use node id attribute instead of the name for the "lconfig" label in the Linode driver. This way the label is never longer than 48 characters. - (GITHUB-287) + (#287) [earthgecko] - Add a new driver for Outscale SAS and Outscale INC cloud (http://www.outscale.com). - (GITHUB-285, GITHUB-293, LIBCLOUD-536, LIBCLOUD-553) + (#285, #293, LIBCLOUD-536, LIBCLOUD-553) [Benoit Canet] - Add new driver for HP Public Cloud (Helion) available via Provider.HPCLOUD @@ -823,16 +5690,16 @@ Compute passing "ex_availability_zone" argument to the create_node method. Note: This will only work if the OpenStack installation is running availability zones extension. - (GITHUB-295, LIBCLOUD-555) + (#295, LIBCLOUD-555) [syndicut] - Allow user to pass filters to ex_list_networks method in the EC2 driver. - (GITHUB-294) + (#294) [zerthimon] - Allow user to retrieve container images using ex_get_image method in the Google Compute Engine driver. - (GITHUB-299, LIBCLOUD-562) + (#299, LIBCLOUD-562) [Magnus Andersson] - Add new driver for Kili public cloud (http://kili.io/) @@ -852,17 +5719,17 @@ Compute - Make "cidrs_ips" argument in the ex_authorize_security_group_egress method in the EC2 driver mandatory. - (GITHUB-301) + (#301) [Csaba Hoch] - Add extension methods for managing floating IPs (ex_get_floating_ip, ex_create_floating_ip, ex_delete_floating_ip) to the Openstack 1.1 driver. - (GITHUB-301) + (#301) [Csaba Hoch] - Fix bug in RimuHosting driver which caused driver not to work when the provider returned compressed (gzip'ed) response. - (LIBCLOUD-569, GITHUB-303) + (LIBCLOUD-569, #303) [amastracci] - Fix issue with overwriting the server memory values in the RimuHosting @@ -871,13 +5738,13 @@ Compute [Dustin Oberloh] - Add ex_all_tenants argument to the list_nodes method in the OpenStack driver. - (GITHUB-312) + (#312) [LIBCLOUD-575, Zak Estrada] - Add support for network management for advanced zones (ex_list_network_offerings, ex_create_network, ex_delete_network) in the CloudStack driver. - (GITHUB-316) + (#316) [Roeland Kuipers] - Add extension methods for routes and route table management to the EC2 @@ -885,7 +5752,7 @@ Compute ex_associate_route_table, ex_dissociate_route_table, ex_replace_route_table_association, ex_create_route, ex_delete_route, ex_replace_route) - (LIBCLOUD-574, GITHUB-313) + (LIBCLOUD-574, #313) [Lior Goikhburg] - Fix ex_list_snapshots for HP Helion OpenStack based driver. @@ -897,12 +5764,12 @@ Compute [Tomaz Muraus] - Fix ex_unpause_node method in the OpenStack driver. - (GITHUB-317) + (#317) [Pablo Orduña] - Allow user to launch EC2 node in a specific VPC subnet by passing ``ex_subnet`` argument to the create_node method. - (GITHUB-318) + (#318) [Lior Goikhburg] Storage @@ -920,14 +5787,14 @@ Storage - Fix a bug in the OpenStack Swift driver which prevented the driver to work with installations where region names in the service catalog weren't upper case. - (LIBCLOUD-576, GITHUB-311) + (LIBCLOUD-576, #311) [Zak Estrada] Load Balancer ~~~~~~~~~~~~~ - Add extension methods for policy managagement to the ELB driver. - (LIBCLOUD-522, GITHUB-253) + (LIBCLOUD-522, #253) [Rahul Ranjan] DNS @@ -942,7 +5809,7 @@ DNS [Tomaz Muraus] - Add new driver for Google DNS. - (GITHUB-269) + (#269) [Franck Cuny] Changes with Apache Libcloud 0.14.1 @@ -964,24 +5831,24 @@ Compute - Add the following extension methods to the OpenStack driver: ex_pause_node, ex_unpause_node, ex_suspend_node, ex_resume_node. - (LIBCLOUD-505, GITHUB-238) + (LIBCLOUD-505, #238) [Chris DeRamus] - Add ex_limits method to the CloudStack driver. - (LIBCLOUD-507, GITHUB-240) + (LIBCLOUD-507, #240) [Chris DeRamus] - Add "extra" dictionary to the CloudStackNode object and include more attributes in the "extra" dictionary of the network and volume object. - (LIBCLOUD-506, GITHUB-239) + (LIBCLOUD-506, #239) [Chris DeRamus] - Add ex_register_image method to the EC2 driver. - (LIBCLOUD-508, GITHUB-241) + (LIBCLOUD-508, #241) [Chris DeRamus] - Add methods for managing volume snapshots to the OpenStack driver. - (LIBCLOUD-512, GITHUB-245) + (LIBCLOUD-512, #245) [Chris DeRamus] Load Balancer @@ -996,7 +5863,7 @@ Storage - Allow user to use an internal endpoint in the CloudFiles driver by passing "use_internal_url" argument to the driver constructor. - (GITHUB-229, GITHUB-231) + (#229, #231) [John Obelenus] DNS @@ -1015,12 +5882,12 @@ DNS [Tomaz Muraus] - Update Rackspace driver to support paginating through zones and records. - (GITHUB-230) + (#230) [Roy Wellington] - Update Route53 driver so it supports handling records with multiple values (e.g. MX). - (LIBCLOUD-504, GITHUB-237) + (LIBCLOUD-504, #237) [Chris DeRamus] - Update Route53 driver to better handle SRV records. @@ -1041,7 +5908,7 @@ General [Dinesh Bhoopathy] - Add support for Amazon security token to the Amazon drivers. - (LIBCLOUD-498, GITHUB-223) + (LIBCLOUD-498, #223) [Noah Kantrowitz] Compute @@ -1127,7 +5994,7 @@ Compute - For consistency, rename "ex_add_ip_forwarding_rule" method to "ex_create_ip_forwarding_rule". - (GITHUB-196) + (#196) [Oleg Suharev] - Add support for new "i2" instance types to Amazon EC2 driver. Also @@ -1136,41 +6003,41 @@ Compute - Allow user to specify VPC id when creating a security group in the EC2 driver by passing "vpc_id" argument to ex_create_security_group method. - (LIBCLOUD-463, GITHUB-201) + (LIBCLOUD-463, #201) [Chris DeRamus] - Add extension methods for managing security group rules (ex_authorize_security_group_ingress, ex_authorize_security_group_egress, ex_revoke_security_group_ingress, ex_revoke_security_group_egress) to the - EC2 driver. (LIBCLOUD-466, GITHUB-202) + EC2 driver. (LIBCLOUD-466, #202) [Chris DeRamus] - Add extension methods for deleting security groups (ex_delete_security_group, ex_delete_security_group_by_id, ex_delete_security_group_by_name) to the EC2 driver. - (LIBCLOUD-464, GITHUB-199) + (LIBCLOUD-464, #199) [Chris DeRamus] - Add extension method for listing reserved instances - (ex_list_reserved_nodes) to the EC2 driver. (LIBCLOUD-469, GITHUB-205) + (ex_list_reserved_nodes) to the EC2 driver. (LIBCLOUD-469, #205) [Chris DeRamus] - Add extension methods for VPC management (ex_list_networks, ex_create_network, ex_delete_network) to the EC2 driver. - (LIBCLOUD-467, GITHUB-203) + (LIBCLOUD-467, #203) [Chris DeRamus] - Add extension methods for VPC subnet management (ex_list_subnets, ex_create_subnet, ex_delete_subnet) to the EC2 driver. - (LIBCLOUD-468, GITHUB-207) + (LIBCLOUD-468, #207) [Chris DeRamus] - Add ex_get_console_output extension method to the EC2 driver. - (LIBCLOUD-471, GITHUB-209) + (LIBCLOUD-471, #209) [Chris DeRamus] - Include additional provider-specific attributes in the 'extra' dictionary - of the StorageVolume class in the EC2 driver. (LIBCLOUD-473, GITHUB-210) + of the StorageVolume class in the EC2 driver. (LIBCLOUD-473, #210) [Chris DeRamus] - Change attribute name in the 'extra' dictionary of EC2 and CloudStack @@ -1186,14 +6053,14 @@ Compute Also modify create_volume_snapshot method to correctly handle "name" argument. Previous, "name" argument was used as a snapshot description, - now it's used as a Tag with a key "Name". (LIBCLOUD-480, GITHUB-214) + now it's used as a Tag with a key "Name". (LIBCLOUD-480, #214) [Chris DeRamus] - Store additional attributes (iops, tags, block_device_mapping) in the "extra" dictionary of the NodeImage object in the EC2 driver. Also fix ex_image_ids filtering in the list_images method. - (LIBCLOUD-481, GITHUB-215) + (LIBCLOUD-481, #215) [Chris DeRamus] - Add extension methods for network interface management @@ -1207,21 +6074,21 @@ Compute [Rick Wright] - Modify ParamikoSSHClient so that "password" and "key" arguments are not - mutually exclusive and both can be provided. (LIBCLOUD-461, GITHUB-194) + mutually exclusive and both can be provided. (LIBCLOUD-461, #194) [Markos Gogoulos] - Add extension methods for the Elastic IP management to the EC2 driver. Also modify "ex_allocate_address" and "ex_release_address" method to take "domain" argument so it also works with VPC. - (LIBCLOUD-470, GITHUB-208, GITHUB-220) + (LIBCLOUD-470, #208, #220) [Chris DeRamus] - Add additional provider specific attributes to the "extra" dictionary of - the Node object in the EC2 driver. (LIBCLOUD-493, GITHUB-221) + the Node object in the EC2 driver. (LIBCLOUD-493, #221) [Chris DeRamus] - Add ex_copy_image and ex_create_image_from_node method to the EC2 driver. - (LIBCLOUD-494, GITHUB-222) + (LIBCLOUD-494, #222) [Chris DeRamus] Storage @@ -1236,7 +6103,7 @@ Storage the CDN endpoint. This was broken in the 0.14.0-beta3 release when we migrated all the - Rackspace drivers to use auth 2.0 by default. (GITHUB-186) + Rackspace drivers to use auth 2.0 by default. (#186) [John Obelenus] - Update storage drivers to default to "application/octet-stream" @@ -1259,13 +6126,13 @@ Storage [Tomaz Muraus] - Add support for setting an ACL when uploading and object. - (LIBCLOUD-497, GITHUB-223) + (LIBCLOUD-497, #223) [Noah Kantrowitz] - Modify get_container method to use a more efficient "HEAD" approach instead of calling list_containers + doing late filterting. - (LIBCLOUD-498, GITHUB-223) + (LIBCLOUD-498, #223) [Noah Kantrowitz] DNS @@ -1284,7 +6151,7 @@ DNS [Tomaz Muraus] - Fix list_records method in the HostVirtual driver. - (LIBCLOUD-484, GITHUB-218) + (LIBCLOUD-484, #218) Reported by Andrew Udvare. [Dinesh Bhoopathy] @@ -2273,7 +7140,7 @@ Storage ~~~~~~~ - Add the following new methods to the CloudFiles driver: - ex_set_account_metadata_temp_url_key, ex_get_object_temp_url. (GITHUB-72) + ex_set_account_metadata_temp_url_key, ex_get_object_temp_url. (#72) [Shawn Smith] Load-balancer @@ -2631,7 +7498,7 @@ Compute [Tomaz Muraus] - Add support for ElasticHosts new United States (Los Angeles) and Canada - (Toronto) locations. (GITHUB-53) + (Toronto) locations. (#53) [Jaime Irurzun] - Add serverId attribute to the NodeImage object extra dictionary in the @@ -2848,11 +7715,11 @@ Compute - Update OpenStack 1.1 driver to comply with the API specs. Need to make another call to retrieve node name and ip addresses when creating a node, - because the first call only returns an id an the password. (GITHUB-40) + because the first call only returns an id an the password. (#40) [Dave King] - Add ex_node_ids argument to the EC2 driver list_nodes method. - (GITHUB-39) + (#39) [Suvish Vt] - If OpenStack Auth 2.0 API is used, also parse out tenant id and @@ -2980,7 +7847,7 @@ Compute [Hutson Betts] - Add more attributes to the extra dictionary in the EC2 driver. - (GITHUB-31) + (#31) [Juan Carlos Moreno] - Fix IP address assignment in the EC2 driver. Don't include "None" in the @@ -3075,7 +7942,7 @@ Compute - Add some extra methods to the Gandi.net driver (LIBCLOUD-115) [Aymeric Barantal] -- Add ex_delete_image method to the Rackspace driver. (GITHUB-27) +- Add ex_delete_image method to the Rackspace driver. (#27) [David Busby] - Linode driver now supports new 'Japan' location @@ -3105,7 +7972,7 @@ Compute [Tomaz Muraus] - Fix chmod argument value which is passed to the sftpclient.put - method; GITHUB-17 + method; #17 [John Carr] - New driver for Ninefold.com. (LIBCLOUD-98) @@ -3117,7 +7984,7 @@ Storage - New driver for Google Storage based on the v1.0 / legacy API [Tomaz Muraus] -- New driver for Ninefold.com. (GITHUB-19) +- New driver for Ninefold.com. (#19) [Benno Rice] - Fix a bug in uploading an object with some versions of Python 2.7 diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index f9696c63c1..04c7a0021c 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -5,7 +5,7 @@ We welcome contributions of any kind (ideas, code, tests, documentation, examples, ...). For more information on how to contribute and the guidelines you should follow, -please see the links listed bellow: +please see the links listed below: * Contributing to Libcloud - https://libcloud.readthedocs.org/en/latest/development.html#general-guidelines * General Guidelines - https://libcloud.readthedocs.org/en/latest/development.html#general-guidelines diff --git a/MANIFEST.in b/MANIFEST.in index 4d6ee91c6f..dfbd1f43ea 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,21 +1,40 @@ +# NOTE: We still need to use MANIFEST.in for backward compatibility with past +# distributions since pyproject.toml + setuptools backend doesn't support +# as flexible includes and excludes as we need. +global-exclude *.py[cod] +global-exclude .pytest_cache + +# Include common files at the repository root include LICENSE include NOTICE include example_*.py include CHANGES.rst include README.rst include tox.ini -include requirements-tests.txt +include pyproject.toml include libcloud/data/pricing.json -prune libcloud/test/secrets.py -include demos/* -include libcloud/test/*.py -include libcloud/test/pricing_test.json include libcloud/test/secrets.py-dist -include libcloud/test/compute/*.py -include libcloud/test/storage/*.py -include libcloud/test/loadbalancer/*.py -include libcloud/test/dns/*.py -include libcloud/test/compute/fixtures/*/* -include libcloud/test/storage/fixtures/*/* -include libcloud/test/loadbalancer/fixtures/*/* -include libcloud/test/dns/fixtures/*/* +include demos/* +include scripts/check_file_names.sh +recursive-exclude libcloud/test secrets.py +prune libcloud/test/secrets.py +prune dist +prune build +prune contrib/ +prune docs/ +prune demos/ +prune integration/ +prune pylint_plugins/ +prune __pycache__ + +# Recursively include all files under the fixture directories +recursive-include libcloud/test/backup/fixtures * +recursive-include libcloud/test/common/fixtures * +recursive-include libcloud/test/compute/fixtures * +recursive-include libcloud/test/container/fixtures * +recursive-include libcloud/test/dns/fixtures * +recursive-include libcloud/test/loadbalancer/fixtures * +recursive-include libcloud/test/storage/fixtures * + +# Exclude __pycache__ directories +prune **/__pycache__ diff --git a/NOTICE b/NOTICE index 5571eb0dbb..ba7a911c07 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache Libcloud -Copyright (c) 2010-2014 The Apache Software Foundation +Copyright (c) 2010-2026 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/README.rst b/README.rst index a89282c747..cfb0e3e7d3 100644 --- a/README.rst +++ b/README.rst @@ -1,27 +1,70 @@ -Apache Libcloud - a unified interface into the cloud +Apache Libcloud - a unified interface for the cloud ==================================================== -.. image:: https://pypip.in/version/apache-libcloud/badge.png - :target: https://pypi.python.org/pypi/apache-libcloud/ +Apache Libcloud is a Python library which hides differences between different +cloud provider APIs and allows you to manage different cloud resources +through a unified and easy to use API. + -.. image:: https://pypip.in/d/apache-libcloud/badge.png +.. image:: https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat + :target: https://libcloud.readthedocs.org + +.. image:: https://img.shields.io/pypi/v/apache-libcloud.svg :target: https://pypi.python.org/pypi/apache-libcloud/ -.. image:: https://secure.travis-ci.org/apache/libcloud.png?branch=trunk - :target: http://travis-ci.org/apache/libcloud +.. image:: https://github.com/apache/libcloud/actions/workflows/main.yml/badge.svg?branch=trunk + :target: https://github.com/apache/libcloud/actions?query=workflow%3ACI + +.. image:: https://github.com/apache/libcloud/actions/workflows/integration-tests.yml/badge.svg?branch=trunk + :target: https://github.com/apache/libcloud/actions/workflows/integration-tests.yml + +.. image:: https://github.com/apache/libcloud/actions/workflows/publish_pricing_to_s3.yml/badge.svg?branch=trunk + :target: https://github.com/apache/libcloud/actions?query=workflow%3A%22Publish+pricing.json+to+S3+bucket%22 + +.. image:: https://img.shields.io/codecov/c/github/apache/libcloud/trunk.svg + :target: https://codecov.io/github/apache/libcloud?branch=trunk -.. image:: https://pypip.in/py_versions/apache-libcloud/badge.png +.. image:: https://img.shields.io/pypi/pyversions/apache-libcloud.svg :target: https://pypi.python.org/pypi/apache-libcloud/ -.. image:: https://pypip.in/wheel/apache-libcloud/badge.png +.. image:: https://img.shields.io/pypi/wheel/apache-libcloud.svg :target: https://pypi.python.org/pypi/apache-libcloud/ -.. image:: https://pypip.in/license/apache-libcloud/badge.png +.. image:: https://img.shields.io/github/license/apache/libcloud.svg :target: https://github.com/apache/libcloud/blob/trunk/LICENSE -Apache Libcloud is a Python library which hides differences between different -cloud provider APIs and allows you to manage different cloud resources -through a unified and easy to use API. +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html + +.. image:: https://img.shields.io/pypi/dm/apache-libcloud + :target: https://pypi.org/project/apache-libcloud + +.. image:: https://bestpractices.coreinfrastructure.org/projects/152/badge + :target: https://bestpractices.coreinfrastructure.org/projects/152 + +.. image:: https://img.shields.io/github/contributors/apache/libcloud.svg?logo=github + :target: https://github.com/apache/libcloud/graphs/contributors + +.. image:: https://img.shields.io/github/stars/apache/libcloud.svg?logo=github + :target: https://github.com/apache/libcloud/stargazers + +.. image:: https://img.shields.io/github/forks/apache/libcloud.svg?logo=github + :target: https://github.com/apache/libcloud/network/members + +.. image:: https://repology.org/badge/tiny-repos/python:apache-libcloud.svg + :target: https://repology.org/project/python:apache-libcloud/versions + +:Code: https://github.com/apache/libcloud +:License: Apache 2.0; see LICENSE file +:Issues: https://issues.apache.org/jira/projects/LIBCLOUD/issues +:Website: https://libcloud.apache.org/ +:Documentation: https://libcloud.readthedocs.io +:Supported Python Versions: Python >= 3.10, PyPy >= 3.10, Python 3.10 + Pyjion + (Python 2.7 and Python 3.4 is supported by the + v2.8.x release series, last version which supports + Python 3.5 is v3.4.0, v3.6.x for Python 3.6, and + v3.9.x for Python 3.9, v3.8.x for Python 3.7 and + 3.8) Resources you can manage with Libcloud are divided into the following categories: @@ -31,6 +74,7 @@ Resources you can manage with Libcloud are divided into the following categories CloudFiles (``libcloud.storage.*``) * **Load Balancers** - Load Balancers as a Service, LBaaS (``libcloud.loadbalancer.*``) * **DNS** - DNS as a Service, DNSaaS (``libcloud.dns.*``) +* **Container** - Container virtualization services (``libcloud.container.*``) Apache Libcloud is an Apache project, see for more information. @@ -40,21 +84,59 @@ Documentation Documentation can be found at . +Note on Python Version Compatibility +==================================== + +Libcloud supports Python >= 3.10 and PyPy >= 3.10. + +* Support for Python 3.9 has been dropped. Last release series which supports + Python 3.9 is v3.9.x. +* Support for Python 3.7 and 3.8 has been dropped in v3.9.0 release. + Last release series which supports Python 3.7 and 3.8 is v3.8.x. +* Support for Python 3.6 has been dropped in v3.7.0 release. + Last release series which supports Python 3.6 is v3.6.x. +* Support for Python 3.5 has been dropped in v3.5.0 release. +* Last release series which supports Python 3.5 is v3.4.x. +* Support for Python 2.7 and 3.4 has been dropped in Libcloud v3.0.0 (last + release series which support Python 2.7 and Python 3.4 is v2.8.x). + Feedback ======== Please send feedback to the mailing list at , -or the JIRA at . +or Github repo at . Contributing ============ For information on how to contribute, please see the Contributing chapter in our documentation - +. + +Website +======= + +Source code for the website is available at +. License ======= Apache Libcloud is licensed under the Apache 2.0 license. For more information, -please see LICENSE and NOTICE file. +please see LICENSE_ and NOTICE_ file. + +Security +======== + +This is a project of the `Apache Software Foundation `_ and +follows the ASF +`vulnerability handling process `_. + +Reporting a Vulnerability +------------------------- + +To report a new vulnerability you have discovered please follow the +`ASF vulnerability reporting process `_. + +.. _LICENSE: https://github.com/apache/libcloud/blob/trunk/LICENSE +.. _NOTICE: https://github.com/apache/libcloud/blob/trunk/NOTICE diff --git a/contrib/Dockerfile b/contrib/Dockerfile index 0d64590353..64f52f2643 100644 --- a/contrib/Dockerfile +++ b/contrib/Dockerfile @@ -1,38 +1,61 @@ -FROM ubuntu:14.04 +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. -RUN set -e && \ - apt-get update && \ - apt-get install -y \ - software-properties-common \ - wget \ - ssh && \ - add-apt-repository ppa:fkrull/deadsnakes && \ - apt-get update && \ - apt-get -y install \ - python2.6 \ - python2.7 \ - python3.2 \ - python3.3 \ - python3.4 \ - python-dev \ - python2.6-dev \ - python2.7-dev \ - python3.2-dev \ - python3.3-dev \ - python3.4-dev \ - python-pip +# Docker image used for running tests the under all the supported Python +# versions +FROM ubuntu:24.04 -RUN set -e && \ - wget https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.0-linux64.tar.bz2 && \ - tar xf ./pypy-2.5.0-linux64.tar.bz2 -C /opt && \ - ln -s /opt/pypy-2.5.0-linux64/bin/pypy /usr/local/bin/pypy +ARG DEBIAN_FRONTEND=noninteractive RUN set -e && \ - pip install tox \ - mock \ - lockfile \ - coverage + apt-get update && \ + apt-get install -y \ + software-properties-common \ + wget \ + ssh && \ + add-apt-repository ppa:deadsnakes/ppa && \ + add-apt-repository ppa:pypy/ppa && \ + apt-get update && \ + apt-get -y install \ + python3.10 \ + python3.11 \ + python3.12 \ + python3.13 \ + python3-dev \ + python3.10-dev \ + python3.11-dev \ + python3.12-dev \ + python3.13-dev \ + # Uses 3.10 + pypy3 \ + pypy3-dev \ + python3-pip \ + libvirt-dev \ + # Needed by libvirt driver + pkg-config + COPY . /libcloud + +RUN if [ ! -f "/libcloud/README.rst" ]; then echo "libcloud/README.rst file not found, you are likely not running docker build from the repository root directory"; exit 1; fi + WORKDIR /libcloud -CMD tox -e py26,py27,pypy,py32,py33,py34,lint +ENV PATH="/libcloud/.venv/bin:${PATH}" + +RUN set -e && \ + python3.12 -m pip install --break-system-packages uv && \ + python3.12 -m uv sync --group ci --no-dev + +CMD ["tox", "-e", "lint,isort-check,black-check,bandit,py3.12,py3.10,py3.11,py3.13,pypypy3"] diff --git a/contrib/__init__.py b/contrib/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/contrib/apply-patch.ps1 b/contrib/apply-patch.ps1 new file mode 100644 index 0000000000..ecc0c35949 --- /dev/null +++ b/contrib/apply-patch.ps1 @@ -0,0 +1,9 @@ +param ($pull_request) +Write-Host "Applying patch ${pull_request}" + +git checkout trunk +Invoke-WebRequest https://patch-diff.githubusercontent.com/raw/apache/libcloud/pull/${pull_request}.patch -OutFile ${env:temp}/${pull_request}.patch +git am ${env:temp}/${pull_request}.patch +$last_message = git log -1 --pretty=%B +$new_message = $last_message+" Closes #${pull_request}" +git commit --amend -m "${new_message}" diff --git a/contrib/generate_contributor_list.py b/contrib/generate_contributor_list.py index 30057be5d4..4f1dcb5626 100755 --- a/contrib/generate_contributor_list.py +++ b/contrib/generate_contributor_list.py @@ -37,14 +37,13 @@ # --include-tickets # --versions 0.11.0 0.12.0 -from __future__ import with_statement import re import argparse from collections import defaultdict -JIRA_URL = 'https://issues.apache.org/jira/browse/LIBCLOUD-%s' -GITHUB_URL = 'https://github.com/apache/libcloud/pull/%s' +JIRA_URL = "https://issues.apache.org/jira/browse/LIBCLOUD-%s" +GITHUB_URL = "https://github.com/apache/libcloud/pull/%s" def parse_changes_file(file_path, versions=None): @@ -61,12 +60,11 @@ def parse_changes_file(file_path, versions=None): active_version = None active_tickets = [] - with open(file_path, 'r') as fp: + with open(file_path) as fp: for line in fp: line = line.strip() - match = re.search(r'Changes with Apache Libcloud ' - '(\d+\.\d+\.\d+(-\w+)?).*?$', line) + match = re.search(r"Changes with Apache Libcloud " r"(\d+\.\d+\.\d+(-\w+)?).*?$", line) if match: active_version = match.groups()[0] @@ -74,28 +72,30 @@ def parse_changes_file(file_path, versions=None): if versions and active_version not in versions: continue - if line.startswith('-') or line.startswith('*)'): + if line.startswith("-") or line.startswith("*)"): in_entry = True active_tickets = [] - if in_entry and line == '': + if in_entry and line == "": in_entry = False if in_entry: - match = re.search(r'\((.+?)\)$', line) + match = re.search(r"\((.+?)\)$", line) if match: active_tickets = match.groups()[0] - active_tickets = active_tickets.split(', ') - active_tickets = [ticket for ticket in active_tickets if - ticket.startswith('LIBCLOUD-') or - ticket.startswith('GITHUB-')] + active_tickets = active_tickets.split(", ") + active_tickets = [ + ticket + for ticket in active_tickets + if ticket.startswith("LIBCLOUD-") or ticket.startswith("GITHUB-") + ] - match = re.search(r'^\[(.+?)\]$', line) + match = re.search(r"^\[(.+?)\]$", line) if match: contributors = match.groups()[0] - contributors = contributors.split(',') + contributors = contributors.split(",") contributors = [name.strip() for name in contributors] for name in contributors: @@ -106,68 +106,79 @@ def parse_changes_file(file_path, versions=None): def convert_to_markdown(contributors_map, include_tickets=False): - # Contributors are sorted in ascending lexiographical order based on their # last name def compare(item1, item2): - lastname1 = item1.split(' ')[-1].lower() - lastname2 = item2.split(' ')[-1].lower() - return cmp(lastname1, lastname2) + lastname1 = item1.split(" ")[-1].lower() + lastname2 = item2.split(" ")[-1].lower() + + return (lastname1 > lastname2) - (lastname1 < lastname2) names = contributors_map.keys() names = sorted(names, cmp=compare) result = [] + for name in names: tickets = contributors_map[name] tickets_string = [] for ticket in tickets: - if '-' not in ticket: + if "-" not in ticket: # Invalid ticket number + continue - number = ticket.split('-')[1] + number = ticket.split("-")[1] - if ticket.startswith('LIBCLOUD-'): + if ticket.startswith("LIBCLOUD-"): url = JIRA_URL % (number) - elif ticket.startswith('GITHUB-') or ticket.startswith('GH-'): + elif ticket.startswith("GITHUB-") or ticket.startswith("GH-"): url = GITHUB_URL % (number) + else: + url = None - values = {'ticket': ticket, 'url': url} - tickets_string.append('[%(ticket)s](%(url)s)' % values) + values = {"ticket": ticket, "url": url} + tickets_string.append("[%(ticket)s](%(url)s)" % values) - tickets_string = ', '.join(tickets_string) + tickets_string = ", ".join(tickets_string) if include_tickets: - line = '* %(name)s: %(tickets)s' % {'name': name, - 'tickets': tickets_string} + line = "* {name}: {tickets}".format(name=name, tickets=tickets_string) else: - line = '* %(name)s' % {'name': name} + line = "* {name}".format(name=name) result.append(line.strip()) - result = '\n'.join(result) + result = "\n".join(result) + return result -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Assemble provider logos ' - ' in a single image') - parser.add_argument('--changes-path', action='store', required=True, - help='Path to the changes file') - parser.add_argument('--versions', action='store', nargs='+', - type=str, - help='Only return contributors for the provided ' - 'versions') - parser.add_argument('--include-tickets', action='store_true', - default=False, - help='Include ticket numbers') + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Assemble provider logos " " in a single image") + parser.add_argument( + "--changes-path", action="store", required=True, help="Path to the changes file" + ) + parser.add_argument( + "--versions", + action="store", + nargs="+", + type=str, + help="Only return contributors for the provided " "versions", + ) + parser.add_argument( + "--include-tickets", + action="store_true", + default=False, + help="Include ticket numbers", + ) args = parser.parse_args() - contributors_map = parse_changes_file(file_path=args.changes_path, - versions=args.versions) - markdown = convert_to_markdown(contributors_map=contributors_map, - include_tickets=args.include_tickets) + contributors_map = parse_changes_file(file_path=args.changes_path, versions=args.versions) + markdown = convert_to_markdown( + contributors_map=contributors_map, include_tickets=args.include_tickets + ) print(markdown) diff --git a/contrib/generate_provider_feature_matrix_table.py b/contrib/generate_provider_feature_matrix_table.py index 834a5144c1..a072dfe016 100755 --- a/contrib/generate_provider_feature_matrix_table.py +++ b/contrib/generate_provider_feature_matrix_table.py @@ -14,193 +14,321 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement import os import sys import inspect -from collections import OrderedDict from os.path import join as pjoin +from collections import OrderedDict -this_dir = os.path.abspath(os.path.split(__file__)[0]) -sys.path.insert(0, os.path.join(this_dir, '../')) - -from libcloud.compute .base import NodeDriver -from libcloud.compute.providers import get_driver as get_compute_driver -from libcloud.compute.providers import DRIVERS as COMPUTE_DRIVERS -from libcloud.compute.types import Provider as ComputeProvider - -from libcloud.loadbalancer.base import Driver as LBDriver -from libcloud.loadbalancer.providers import get_driver as get_lb_driver -from libcloud.loadbalancer.providers import DRIVERS as LB_DRIVERS -from libcloud.loadbalancer.types import Provider as LBProvider - -from libcloud.storage.base import StorageDriver -from libcloud.storage.providers import get_driver as get_storage_driver -from libcloud.storage.providers import DRIVERS as STORAGE_DRIVERS -from libcloud.storage.types import Provider as StorageProvider - -from libcloud.dns.base import DNSDriver -from libcloud.dns.providers import get_driver as get_dns_driver -from libcloud.dns.providers import DRIVERS as DNS_DRIVERS -from libcloud.dns.types import Provider as DNSProvider - -REQUIRED_DEPENDENCIES = [ - 'pysphere' -] - -for dependency in REQUIRED_DEPENDENCIES: - try: - __import__(dependency) - except ImportError: - msg = 'Missing required dependency: %s' % (dependency) - raise ImportError(msg) +# Add parent dir of this file's dir to sys.path (OS-agnostically) +BASE_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), os.path.pardir)) +sys.path.append(BASE_DIR) + +# isort:skip pragma is needed to make sure those imports are not moved above +# sys.path manipulation code (https://github.com/PyCQA/isort/issues/468) +from libcloud.dns.base import DNSDriver # isort:skip +from libcloud.dns.types import Provider as DNSProvider # isort:skip +from libcloud.backup.base import BackupDriver # isort:skip +from libcloud.backup.types import Provider as BackupProvider # isort:skip +from libcloud.compute.base import NodeDriver # isort:skip +from libcloud.storage.base import StorageDriver # isort:skip +from libcloud.compute.types import Provider as ComputeProvider # isort:skip +from libcloud.dns.providers import DRIVERS as DNS_DRIVERS # isort:skip +from libcloud.dns.providers import get_driver as get_dns_driver # isort:skip +from libcloud.storage.types import Provider as StorageProvider # isort:skip +from libcloud.container.base import ContainerDriver # isort:skip +from libcloud.container.types import Provider as ContainerProvider # isort:skip +from libcloud.backup.providers import DRIVERS as BACKUP_DRIVERS # isort:skip +from libcloud.backup.providers import get_driver as get_backup_driver # isort:skip +from libcloud.compute.providers import DRIVERS as COMPUTE_DRIVERS # isort:skip +from libcloud.compute.providers import get_driver as get_compute_driver # isort:skip +from libcloud.loadbalancer.base import Driver as LBDriver # isort:skip +from libcloud.storage.providers import DRIVERS as STORAGE_DRIVERS # isort:skip +from libcloud.storage.providers import get_driver as get_storage_driver # isort:skip +from libcloud.loadbalancer.types import Provider as LBProvider # isort:skip +from libcloud.container.providers import DRIVERS as CONTAINER_DRIVERS # isort:skip +from libcloud.loadbalancer.providers import DRIVERS as LB_DRIVERS # isort:skip +from libcloud.loadbalancer.providers import get_driver as get_lb_driver # isort:skip +from libcloud.container.providers import get_driver as get_container_driver # isort:skip + +HEADER = ( + ".. NOTE: This file has been generated automatically using " + "generate_provider_feature_matrix_table.py script, don't manually " + "edit it" +) BASE_API_METHODS = { - 'compute_main': ['list_nodes', 'create_node', 'reboot_node', - 'destroy_node', 'list_images', 'list_sizes', - 'deploy_node'], - 'compute_image_management': ['list_images', 'get_image', - 'create_image', 'delete_image', 'copy_image'], - 'compute_block_storage': ['list_volumes', 'create_volume', - 'destroy_volume', - 'attach_volume', 'detach_volume', - 'list_volume_snapshots', - 'create_volume_snapshot'], - 'compute_key_pair_management': ['list_key_pairs', 'get_key_pair', - 'create_key_pair', - 'import_key_pair_from_string', - 'import_key_pair_from_file', - 'delete_key_pair'], - 'loadbalancer': ['create_balancer', 'list_balancers', - 'balancer_list_members', 'balancer_attach_member', - 'balancer_detach_member', 'balancer_attach_compute_node'], - 'storage_main': ['list_containers', 'list_container_objects', - 'iterate_containers', 'iterate_container_objects', - 'create_container', 'delete_container', 'upload_object', - 'upload_object_via_stream', 'download_object', - 'download_object_as_stream', 'delete_object'], - 'storage_cdn': ['enable_container_cdn', 'enable_object_cdn', - 'get_container_cdn_url', 'get_object_cdn_url'], - 'dns': ['list_zones', 'list_records', 'iterate_zones', 'iterate_records', - 'create_zone', 'update_zone', 'create_record', 'update_record', - 'delete_zone', 'delete_record'] + "compute_main": [ + "list_nodes", + "create_node", + "reboot_node", + "destroy_node", + "start_node", + "stop_node", + "list_images", + "list_sizes", + "deploy_node", + ], + "compute_image_management": [ + "list_images", + "get_image", + "create_image", + "delete_image", + "copy_image", + ], + "compute_block_storage": [ + "list_volumes", + "create_volume", + "destroy_volume", + "attach_volume", + "detach_volume", + "list_volume_snapshots", + "create_volume_snapshot", + ], + "compute_key_pair_management": [ + "list_key_pairs", + "get_key_pair", + "create_key_pair", + "import_key_pair_from_string", + "import_key_pair_from_file", + "delete_key_pair", + ], + "loadbalancer": [ + "create_balancer", + "list_balancers", + "balancer_list_members", + "balancer_attach_member", + "balancer_detach_member", + "balancer_attach_compute_node", + ], + "storage_main": [ + "list_containers", + "list_container_objects", + "iterate_containers", + "iterate_container_objects", + "create_container", + "delete_container", + "upload_object", + "upload_object_via_stream", + "download_object", + "download_object_range", + "download_object_as_stream", + "download_object_range_as_stream", + "delete_object", + ], + "storage_cdn": [ + "enable_container_cdn", + "enable_object_cdn", + "get_container_cdn_url", + "get_object_cdn_url", + ], + "dns": [ + "list_zones", + "list_records", + "iterate_zones", + "iterate_records", + "create_zone", + "update_zone", + "create_record", + "update_record", + "delete_zone", + "delete_record", + ], + "container": [ + "install_image", + "list_images", + "deploy_container", + "get_container", + "start_container", + "stop_container", + "restart_container", + "destroy_container", + "list_containers", + "list_locations", + "create_cluster", + "destroy_cluster", + "list_clusters", + ], + "backup": [ + "get_supported_target_types", + "list_targets", + "create_target", + "create_target_from_node", + "create_target_from_storage_container", + "update_target", + "delete_target", + "list_recovery_points", + "recover_target", + "recover_target_out_of_place", + "list_target_jobs", + "create_target_job", + "resume_target_job", + "suspend_target_job", + "cancel_target_job", + ], } FRIENDLY_METHODS_NAMES = { - 'compute_main': { - 'list_nodes': 'list nodes', - 'create_node': 'create node', - 'reboot_node': 'reboot node', - 'destroy_node': 'destroy node', - 'list_images': 'list images', - 'list_sizes': 'list sizes', - 'deploy_node': 'deploy node' + "compute_main": { + "list_nodes": "list nodes", + "create_node": "create node", + "reboot_node": "reboot node", + "start_node": "start node", + "stop_node": "stop node", + "destroy_node": "destroy node", + "list_images": "list images", + "list_sizes": "list sizes", + "deploy_node": "deploy node", + }, + "compute_image_management": { + "list_images": "list images", + "get_image": "get image", + "create_image": "create image", + "copy_image": "copy image", + "delete_image": "delete image", }, - 'compute_image_management': { - 'list_images': 'list images', - 'get_image': 'get image', - 'create_image': 'create image', - 'copy_image': 'copy image', - 'delete_image': 'delete image' + "compute_block_storage": { + "list_volumes": "list volumes", + "create_volume": "create volume", + "destroy_volume": "destroy volume", + "attach_volume": "attach volume", + "detach_volume": "detach volume", + "list_volume_snapshots": "list snapshots", + "create_volume_snapshot": "create snapshot", }, - 'compute_block_storage': { - 'list_volumes': 'list volumes', - 'create_volume': 'create volume', - 'destroy_volume': 'destroy volume', - 'attach_volume': 'attach volume', - 'detach_volume': 'detach volume', - 'list_volume_snapshots': 'list snapshots', - 'create_volume_snapshot': 'create snapshot' + "compute_key_pair_management": { + "list_key_pairs": "list key pairs", + "get_key_pair": "get key pair", + "create_key_pair": "create key pair", + "import_key_pair_from_string": "import public key from string", + "import_key_pair_from_file": "import public key from file", + "delete_key_pair": "delete key pair", }, - 'compute_key_pair_management': { - 'list_key_pairs': 'list key pairs', - 'get_key_pair': 'get key pair', - 'create_key_pair': 'create key pair', - 'import_key_pair_from_string': 'import public key from string', - 'import_key_pair_from_file': 'import public key from file', - 'delete_key_pair': 'delete key pair' + "loadbalancer": { + "create_balancer": "create balancer", + "list_balancers": "list balancers", + "balancer_list_members": "list members", + "balancer_attach_member": "attach member", + "balancer_detach_member": "detach member", + "balancer_attach_compute_node": "attach compute node", }, - 'loadbalancer': { - 'create_balancer': 'create balancer', - 'list_balancers': 'list balancers', - 'balancer_list_members': 'list members', - 'balancer_attach_member': 'attach member', - 'balancer_detach_member': 'detach member', - 'balancer_attach_compute_node': 'attach compute node' + "storage_main": { + "list_containers": "list containers", + "list_container_objects": "list objects", + "create_container": "create container", + "delete_container": "delete container", + "upload_object": "upload object", + "upload_object_via_stream": "streaming object upload", + "download_object": "download object", + "download_object_as_stream": "streaming object download", + "download_object_range": "download part of an object", + "download_object_range_as_stream": "streaming partial object download", + "delete_object": "delete object", }, - 'storage_main': { - 'list_containers': 'list containers', - 'list_container_objects': 'list objects', - 'create_container': 'create container', - 'delete_container': 'delete container', - 'upload_object': 'upload object', - 'upload_object_via_stream': 'streaming object upload', - 'download_object': 'download object', - 'download_object_as_stream': 'streaming object download', - 'delete_object': 'delete object' + "storage_cdn": { + "enable_container_cdn": "enable container cdn", + "enable_object_cdn": "enable object cdn", + "get_container_cdn_url": "get container cdn URL", + "get_object_cdn_url": "get object cdn URL", }, - 'storage_cdn': { - 'enable_container_cdn': 'enable container cdn', - 'enable_object_cdn': 'enable object cdn', - 'get_container_cdn_url': 'get container cdn URL', - 'get_object_cdn_url': 'get object cdn URL', + "dns": { + "list_zones": "list zones", + "list_records": "list records", + "create_zone": "create zone", + "update_zone": "update zone", + "create_record": "create record", + "update_record": "update record", + "delete_zone": "delete zone", + "delete_record": "delete record", }, - 'dns': { - 'list_zones': 'list zones', - 'list_records': 'list records', - 'create_zone': 'create zone', - 'update_zone': 'update zone', - 'create_record': 'create record', - 'update_record': 'update record', - 'delete_zone': 'delete zone', - 'delete_record': 'delete record' + "container": { + "install_image": "install image", + "list_images": "list images", + "deploy_container": "deploy container", + "get_container": "get container", + "list_containers": "list containers", + "start_container": "start container", + "stop_container": "stop container", + "restart_container": "restart container", + "destroy_container": "destroy container", + "list_locations": "list locations", + "create_cluster": "create cluster", + "destroy_cluster": "destroy cluster", + "list_clusters": "list clusters", + }, + "backup": { + "get_supported_target_types": "get supported target types", + "list_targets": "list targets", + "create_target": "create target", + "create_target_from_node": "create target from node", + "create_target_from_storage_container": "create target from storage container", + "update_target": "update target", + "delete_target": "delete target", + "list_recovery_points": "list recovery points", + "recover_target": "recover target", + "recover_target_out_of_place": "recover target out of place", + "list_target_jobs": "list target jobs", + "create_target_job": "create target job", + "resume_target_job": "resume target job", + "suspend_target_job": "suspend target job", + "cancel_target_job": "cancel target job", }, } IGNORED_PROVIDERS = [ - 'dummy', - 'local', - + "dummy", # Deprecated constants - 'cloudsigma_us', - - 'cloudfiles_swift' + "cloudsigma_us", + "cloudfiles_swift", ] def get_provider_api_names(Provider): - names = [key for key, value in Provider.__dict__.items() if - not key.startswith('__')] + names = [key for key, value in Provider.__dict__.items() if not key.startswith("__")] return names def generate_providers_table(api): result = {} - if api in ['compute_main', 'compute_image_management', - 'compute_block_storage', 'compute_key_pair_management']: + if api in [ + "compute_main", + "compute_image_management", + "compute_block_storage", + "compute_key_pair_management", + ]: driver = NodeDriver drivers = COMPUTE_DRIVERS provider = ComputeProvider get_driver_method = get_compute_driver - elif api == 'loadbalancer': + elif api == "loadbalancer": driver = LBDriver drivers = LB_DRIVERS provider = LBProvider get_driver_method = get_lb_driver - elif api in ['storage_main', 'storage_cdn']: + elif api in ["storage_main", "storage_cdn"]: driver = StorageDriver drivers = STORAGE_DRIVERS provider = StorageProvider get_driver_method = get_storage_driver - elif api == 'dns': + elif api == "dns": driver = DNSDriver drivers = DNS_DRIVERS provider = DNSProvider get_driver_method = get_dns_driver + elif api == "container": + driver = ContainerDriver + drivers = CONTAINER_DRIVERS + provider = ContainerProvider + get_driver_method = get_container_driver + elif api == "backup": + driver = BackupDriver + drivers = BACKUP_DRIVERS + provider = BackupProvider + get_driver_method = get_backup_driver else: - raise Exception('Invalid api: %s' % (api)) + raise Exception("Invalid api: %s" % (api)) names = get_provider_api_names(provider) @@ -210,52 +338,81 @@ def generate_providers_table(api): try: cls = get_driver_method(enum) - except: + except Exception as e: # Deprecated providers throw an exception + print('Ignoring deprecated constant "{}": {}'.format(enum, str(e))) continue # Hack for providers which expose multiple classes and support multiple # API versions # TODO: Make entry per version - if name.lower() == 'cloudsigma': - from libcloud.compute.drivers.cloudsigma import \ - CloudSigma_2_0_NodeDriver + if name.lower() == "cloudsigma": + from libcloud.compute.drivers.cloudsigma import CloudSigma_2_0_NodeDriver + cls = CloudSigma_2_0_NodeDriver - elif name.lower() == 'digital_ocean': - from libcloud.compute.drivers.digitalocean import \ - DigitalOcean_v2_NodeDriver - cls = DigitalOcean_v2_NodeDriver - elif name.lower() == 'opennebula': - from libcloud.compute.drivers.opennebula import \ - OpenNebula_3_8_NodeDriver + elif name.lower() == "opennebula": + from libcloud.compute.drivers.opennebula import OpenNebula_3_8_NodeDriver + cls = OpenNebula_3_8_NodeDriver + elif name.lower() == "digital_ocean" and api.startswith("compute"): + from libcloud.compute.drivers.digitalocean import DigitalOcean_v2_NodeDriver + + cls = DigitalOcean_v2_NodeDriver + elif name.lower() == "linode" and api.startswith("compute"): + from libcloud.compute.drivers.linode import LinodeNodeDriverV4 + + cls = LinodeNodeDriverV4 + elif name.lower() == "linode" and api.startswith("dns"): + from libcloud.dns.drivers.linode import LinodeDNSDriverV4 + + cls = LinodeDNSDriverV4 + elif name.lower() == "vultr" and api.startswith("compute"): + from libcloud.compute.drivers.vultr import VultrNodeDriverV2 + + cls = VultrNodeDriverV2 + elif name.lower() == "vultr" and api.startswith("dns"): + from libcloud.dns.drivers.vultr import VultrDNSDriverV2 + + cls = VultrDNSDriverV2 if name.lower() in IGNORED_PROVIDERS: continue - driver_methods = dict(inspect.getmembers(cls, - predicate=inspect.ismethod)) - base_methods = dict(inspect.getmembers(driver, - predicate=inspect.ismethod)) + def is_function_or_method(*args, **kwargs): + return inspect.isfunction(*args, **kwargs) or inspect.ismethod(*args, **kwargs) + + driver_methods = dict(inspect.getmembers(cls, predicate=is_function_or_method)) + base_methods = dict(inspect.getmembers(driver, predicate=is_function_or_method)) base_api_methods = BASE_API_METHODS[api] - result[name] = {'name': cls.name, 'website': cls.website, - 'constant': name, 'module': drivers[enum][0], - 'class': drivers[enum][1], - 'methods': {}} + result[name] = { + "name": cls.name, + "website": cls.website, + "constant": name, + "module": drivers[enum][0], + "class": drivers[enum][1], + "cls": cls, + "methods": {}, + } + + print("Generating tables for provider: %s" % (name)) for method_name in base_api_methods: base_method = base_methods[method_name] - driver_method = driver_methods[method_name] - if method_name == 'deploy_node': - features = getattr(cls, 'features', {}).get('create_node', []) + if method_name == "deploy_node": + features = getattr(cls, "features", {}).get("create_node", []) is_implemented = len(features) >= 1 else: - is_implemented = (id(driver_method.im_func) != - id(base_method.im_func)) + if method_name not in driver_methods: + is_implemented = False + else: + driver_method = driver_methods[method_name] + # NOTE: id() is not safe + # is_implemented = (id(driver_method) != id(base_method)) + is_implemented = driver_method != base_method - result[name]['methods'][method_name] = is_implemented + result[name]["methods"][method_name] = is_implemented return result @@ -263,12 +420,11 @@ def generate_providers_table(api): def generate_rst_table(data): cols = len(data[0]) col_len = [max(len(r[i]) for r in data) for i in range(cols)] - formatter = ' '.join('{:<%d}' % c for c in col_len) + formatter = " ".join("{:<%d}" % c for c in col_len) - header = formatter.format(*['=' * c for c in col_len]) + header = formatter.format(*["=" * c for c in col_len]) rows = [formatter.format(*row) for row in data] - result = header + '\n' + rows[0] + '\n' + header + '\n' +\ - '\n'.join(rows[1:]) + '\n' + header + result = header + "\n" + rows[0] + "\n" + header + "\n" + "\n".join(rows[1:]) + "\n" + header return result @@ -276,81 +432,109 @@ def generate_rst_table(data): def generate_supported_methods_table(api, provider_matrix): base_api_methods = BASE_API_METHODS[api] data = [] - header = [FRIENDLY_METHODS_NAMES[api][method_name] for method_name in - base_api_methods if not method_name.startswith('iterate_')] - data.append(['Provider'] + header) + header = [ + FRIENDLY_METHODS_NAMES[api][method_name] + for method_name in base_api_methods + if not method_name.startswith("iterate_") + ] + data.append(["Provider"] + header) for provider, values in sorted(provider_matrix.items()): - provider_name = '`%s`_' % (values['name']) + provider_name = "`%s`_" % (values["name"]) row = [provider_name] # TODO: Make it nicer # list_* methods don't need to be implemented if iterate_* methods are # implemented - if api == 'storage_main': - if values['methods']['iterate_containers']: - values['methods']['list_containers'] = True + if api == "storage_main": + if values["methods"]["iterate_containers"]: + values["methods"]["list_containers"] = True - if values['methods']['iterate_container_objects']: - values['methods']['list_container_objects'] = True - elif api == 'dns': + if values["methods"]["iterate_container_objects"]: + values["methods"]["list_container_objects"] = True + elif api == "dns": # list_zones and list_records don't need to be implemented if - if values['methods']['iterate_zones']: - values['methods']['list_zones'] = True + if values["methods"]["iterate_zones"]: + values["methods"]["list_zones"] = True - if values['methods']['iterate_records']: - values['methods']['list_records'] = True + if values["methods"]["iterate_records"]: + values["methods"]["list_records"] = True for method in base_api_methods: # TODO: ghetto - if method.startswith('iterate_'): + if method.startswith("iterate_"): continue - supported = values['methods'][method] + supported = values["methods"][method] if supported: - row.append('yes') + row.append("yes") else: - row.append('no') + row.append("no") data.append(row) result = generate_rst_table(data) - result += '\n\n' + result += "\n\n" for provider, values in sorted(provider_matrix.items()): - result += '.. _`%s`: %s\n' % (values['name'], values['website']) + result += ".. _`{}`: {}\n".format(values["name"], values["website"]) return result def generate_supported_providers_table(api, provider_matrix): data = [] - header = ['Provider', 'Documentation', 'Provider constant', 'Module', - 'Class Name'] + header = [ + "Provider", + "Documentation", + "Provider Constant", + "Supported Regions", + "Module", + "Class Name", + ] data.append(header) for provider, values in sorted(provider_matrix.items()): - name_str = '`%s`_' % (values['name']) - module_str = ':mod:`%s`' % (values['module']) - class_str = ':class:`%s`' % (values['class']) + name_str = "`%s`_" % (values["name"]) + module_str = ":mod:`%s`" % (values["module"]) + class_str = ":class:`%s`" % (values["class"]) + + # Ignore old deprecated driver class per region S3 drivers + if "Amazon S3 (" in values["name"]: + continue - params = {'api': api, 'provider': provider.lower()} - driver_docs_path = pjoin(this_dir, - '../docs/%(api)s/drivers/%(provider)s.rst' - % params) + params = {"api": api, "provider": provider.lower()} + driver_docs_path = pjoin(BASE_DIR, "docs/%(api)s/drivers/%(provider)s.rst" % params) if os.path.exists(driver_docs_path): - docs_link = ':doc:`Click `' % params + docs_link = ":doc:`Click `" % params else: - docs_link = '' + docs_link = "" - row = [name_str, docs_link, values['constant'], module_str, class_str] + cls = values["cls"] + supported_regions = cls.list_regions() if hasattr(cls, "list_regions") else None + + if supported_regions: + # Sort the regions to achieve stable output + supported_regions = sorted(supported_regions) + supported_regions = ", ".join(supported_regions) + else: + supported_regions = "single region driver" + + row = [ + name_str, + docs_link, + values["constant"], + supported_regions, + module_str, + class_str, + ] data.append(row) result = generate_rst_table(data) - result += '\n\n' + result += "\n\n" for provider, values in sorted(provider_matrix.items()): - result += '.. _`%s`: %s\n' % (values['name'], values['website']) + result += ".. _`{}`: {}\n".format(values["name"], values["website"]) return result @@ -361,42 +545,43 @@ def generate_tables(): docs_dir = api - if api.startswith('compute'): - docs_dir = 'compute' - elif api.startswith('storage'): - docs_dir = 'storage' + if api.startswith("compute"): + docs_dir = "compute" + elif api.startswith("storage"): + docs_dir = "storage" - supported_providers = generate_supported_providers_table(docs_dir, - result) + supported_providers = generate_supported_providers_table(docs_dir, result) supported_methods = generate_supported_methods_table(api, result) current_path = os.path.dirname(__file__) - target_dir = os.path.abspath(pjoin(current_path, - '../docs/%s/' % (docs_dir))) - - file_name_1 = '_supported_providers.rst' - file_name_2 = '_supported_methods.rst' - - if api == 'compute_main': - file_name_2 = '_supported_methods_main.rst' - elif api == 'compute_image_management': - file_name_2 = '_supported_methods_image_management.rst' - elif api == 'compute_block_storage': - file_name_2 = '_supported_methods_block_storage.rst' - elif api == 'compute_key_pair_management': - file_name_2 = '_supported_methods_key_pair_management.rst' - elif api == 'storage_main': - file_name_2 = '_supported_methods_main.rst' - elif api == 'storage_cdn': - file_name_2 = '_supported_methods_cdn.rst' + target_dir = os.path.abspath(pjoin(current_path, "../docs/%s/" % (docs_dir))) + + file_name_1 = "_supported_providers.rst" + file_name_2 = "_supported_methods.rst" + + if api == "compute_main": + file_name_2 = "_supported_methods_main.rst" + elif api == "compute_image_management": + file_name_2 = "_supported_methods_image_management.rst" + elif api == "compute_block_storage": + file_name_2 = "_supported_methods_block_storage.rst" + elif api == "compute_key_pair_management": + file_name_2 = "_supported_methods_key_pair_management.rst" + elif api == "storage_main": + file_name_2 = "_supported_methods_main.rst" + elif api == "storage_cdn": + file_name_2 = "_supported_methods_cdn.rst" supported_providers_path = pjoin(target_dir, file_name_1) supported_methods_path = pjoin(target_dir, file_name_2) - with open(supported_providers_path, 'w') as fp: + with open(supported_providers_path, "w") as fp: + fp.write(HEADER + "\n\n") fp.write(supported_providers) - with open(supported_methods_path, 'w') as fp: + with open(supported_methods_path, "w") as fp: + fp.write(HEADER + "\n\n") fp.write(supported_methods) + generate_tables() diff --git a/contrib/generate_provider_logos_collage_image.py b/contrib/generate_provider_logos_collage_image.py index d2f4274cd9..358b8b6e30 100755 --- a/contrib/generate_provider_logos_collage_image.py +++ b/contrib/generate_provider_logos_collage_image.py @@ -28,16 +28,15 @@ import os import sys +import random import argparse import subprocess -import random - from os.path import join as pjoin -DIMENSIONS = '150x150' # Dimensions of the resized image (x) -GEOMETRY = '+4+4' # How to arrange images (++) +DIMENSIONS = "150x150" # Dimensions of the resized image (x) +GEOMETRY = "+4+4" # How to arrange images (++) -TO_CREATE_DIRS = ['resized/', 'final/'] +TO_CREATE_DIRS = ["resized/", "final/"] def setup(output_path): @@ -53,8 +52,7 @@ def setup(output_path): def get_logo_files(input_path): logo_files = os.listdir(input_path) - logo_files = [name for name in logo_files if - 'resized' not in name and name.endswith('png')] + logo_files = [name for name in logo_files if "resized" not in name and name.endswith("png")] logo_files = [pjoin(input_path, name) for name in logo_files] return logo_files @@ -65,14 +63,13 @@ def resize_images(logo_files, output_path): for logo_file in logo_files: name, ext = os.path.splitext(os.path.basename(logo_file)) - new_name = '%s%s' % (name, ext) - out_name = pjoin(output_path, 'resized/', new_name) + new_name = "{}{}".format(name, ext) + out_name = pjoin(output_path, "resized/", new_name) - print 'Resizing image: %(name)s' % {'name': logo_file} + print("Resizing image: {name}".format(name=logo_file)) - values = {'name': logo_file, 'out_name': out_name, - 'dimensions': DIMENSIONS} - cmd = 'convert %(name)s -resize %(dimensions)s %(out_name)s' + values = {"name": logo_file, "out_name": out_name, "dimensions": DIMENSIONS} + cmd = "convert %(name)s -resize %(dimensions)s %(out_name)s" cmd = cmd % values subprocess.call(cmd, shell=True) @@ -82,42 +79,46 @@ def resize_images(logo_files, output_path): def assemble_final_image(resized_images, output_path): - final_name = pjoin(output_path, 'final/logos.png') + final_name = pjoin(output_path, "final/logos.png") random.shuffle(resized_images) - values = {'images': ' '.join(resized_images), 'geometry': GEOMETRY, - 'out_name': final_name} - cmd = 'montage %(images)s -geometry %(geometry)s %(out_name)s' + values = { + "images": " ".join(resized_images), + "geometry": GEOMETRY, + "out_name": final_name, + } + cmd = "montage %(images)s -geometry %(geometry)s %(out_name)s" cmd = cmd % values - print 'Generating final image: %(name)s' % {'name': final_name} + print("Generating final image: {name}".format(name=final_name)) subprocess.call(cmd, shell=True) def main(input_path, output_path): if not os.path.exists(input_path): - print('Path doesn\'t exist: %s' % (input_path)) + print("Path doesn't exist: %s" % (input_path)) sys.exit(2) if not os.path.exists(output_path): - print('Path doesn\'t exist: %s' % (output_path)) + print("Path doesn't exist: %s" % (output_path)) sys.exit(2) logo_files = get_logo_files(input_path=input_path) setup(output_path=output_path) - resized_images = resize_images(logo_files=logo_files, - output_path=output_path) - assemble_final_image(resized_images=resized_images, - output_path=output_path) - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Assemble provider logos ' - ' in a single image') - parser.add_argument('--input-path', action='store', - help='Path to directory which contains provider ' - 'logo files') - parser.add_argument('--output-path', action='store', - help='Path where the new files will be written') + resized_images = resize_images(logo_files=logo_files, output_path=output_path) + assemble_final_image(resized_images=resized_images, output_path=output_path) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Assemble provider logos " " in a single image") + parser.add_argument( + "--input-path", + action="store", + help="Path to directory which contains provider " "logo files", + ) + parser.add_argument( + "--output-path", action="store", help="Path where the new files will be written" + ) args = parser.parse_args() input_path = os.path.abspath(args.input_path) diff --git a/contrib/migrate_paths.sh b/contrib/migrate_paths.sh deleted file mode 100755 index 3e07c49235..0000000000 --- a/contrib/migrate_paths.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# Script for migrating from the old style libcloud paths (pre 0.5) to the new -# ones. -# THIS SCRIPT WILL MODIFY FILES IN PLACE. BE SURE TO BACKUP THEM BEFORE RUNNING -# IT. LIBCLOUD TEAM CANNOT BE RESPONSIBLE FOR ANY DAMAGE CAUSED BY THIS SCRIPT. -# Note: If you are on OS X / FreeBSD, you need to install GNU sed. - -DIRECTORY=$1 - -SED=`which gsed gnused sed` - -for value in $SED -do - SED=${value} - break -done - -if [ ! $DIRECTORY ]; then - echo "Usage: ./migrate_paths.sh " - exit 1 -fi - -OLD_PATHS[0]="libcloud.base" -OLD_PATHS[1]="libcloud.deployment" -OLD_PATHS[2]="libcloud.drivers" -OLD_PATHS[3]="libcloud.ssh" -OLD_PATHS[4]="libcloud.types" -OLD_PATHS[5]="libcloud.providers" - -UPDATED_PATHS[0]="libcloud.compute.base" -UPDATED_PATHS[1]="libcloud.compute.deployment" -UPDATED_PATHS[2]="libcloud.compute.drivers" -UPDATED_PATHS[3]="libcloud.compute.ssh" -UPDATED_PATHS[4]="libcloud.compute.types" -UPDATED_PATHS[5]="libcloud.compute.providers" - -for (( i = 0 ; i < ${#OLD_PATHS[@]} ; i++ )) -do - old_path=${OLD_PATHS[$i]} - new_path=${UPDATED_PATHS[$i]} - - cmd1="find ${DIRECTORY} -name '*.py' -type f -print0 | xargs -0 ${SED} -i -e 's/^from ${old_path} import/from ${new_path} import/g'" - cmd2="find ${DIRECTORY} -name '*.py' -type f -print0 | xargs -0 ${SED} -i -e 's/^import ${old_path}/import ${new_path}/g'" - - echo "Migrating: ${old_path} -> ${new_path}" - eval "$cmd1" - eval "$cmd2" -done diff --git a/contrib/pre-commit.sh b/contrib/pre-commit.sh deleted file mode 100755 index 2a65aacd44..0000000000 --- a/contrib/pre-commit.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -files=$(git diff --cached --name-status | grep -v ^D | awk '$1 $2 { print $2}' | grep -e .py$) -array=(${files/// }) - -for file in "${array[@]}" -do - if [[ ${file} =~ "libcloud/test/" ]]; then - flake8 --max-line-length=160 ${file} - else - flake8 ${file} - fi -done diff --git a/contrib/run_tests.sh b/contrib/run_tests.sh index 45032d8c82..895ee91235 100755 --- a/contrib/run_tests.sh +++ b/contrib/run_tests.sh @@ -20,8 +20,7 @@ # The script needs docker to be installed. # # Script which builds a testing docker image and container, -# install the necessary packages: pypy, pip, python versions -# 2.6, 2.7, 3.2, 3.3, 3.4 (corresponding dev packages as well) +# install the necessary packages # and run the tox tests within the container. # The script has to be run from libcloud root. diff --git a/contrib/scrape-azure-prices.py b/contrib/scrape-azure-prices.py new file mode 100755 index 0000000000..854aa2c1dd --- /dev/null +++ b/contrib/scrape-azure-prices.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import os +import json +import time + +import requests + +PRICES_URL = "https://azure.microsoft.com/api/v3/pricing/" "virtual-machines/calculator/" +BASE_PATH = os.path.dirname(os.path.abspath(__file__)) +PRICING_FILE_PATH = os.path.join(BASE_PATH, "../libcloud/data/pricing.json") +PRICING_FILE_PATH = os.path.abspath(PRICING_FILE_PATH) + + +def get_azure_prices(): + prices_raw = requests.get(PRICES_URL).json() + region_map = {} + regions = [] + for region in prices_raw["regions"]: + regions.append(region["slug"]) + region_map[region["slug"]] = region["displayName"] + + result = {"windows": {}, "linux": {}} + parsed_sizes = {"lowpriority", "basic", "standard"} + for offer, value in prices_raw["offers"].items(): + size_raw = offer.split("-") + # Servers that go by the core with global price are not yet added + if len(size_raw) != 3 or size_raw[2] not in parsed_sizes: + continue + if size_raw[0] not in {"linux", "windows"}: + continue + size = size_raw[2] + size_raw[1] + prices = {} + if not value.get("prices", {}).get("perhour"): + continue + for reg, price in value["prices"]["perhour"].items(): + region = region_map[reg].lower().replace(" ", "") + region = region.replace("(public)", "") # for germany + region = region.replace("(sovereign)", "") # for germany + prices[region] = price["value"] + result[size_raw[0]][size] = prices + + return result + + +def write_azure_prices(file_path, prices): + with open(file_path) as f: + content = f.read() + + data = json.loads(content) + data["updated"] = int(time.time()) + data["compute"]["azure_linux"] = prices["linux"] + data["compute"]["azure_windows"] = prices["windows"] + + content = json.dumps(data, indent=4) + lines = content.splitlines() + lines = [line.rstrip() for line in lines] + content = "\n".join(lines) + + with open(file_path, "w") as fp: + fp.write(content) + + +def main(): + res = get_azure_prices() + write_azure_prices(PRICING_FILE_PATH, res) + + +if __name__ == "__main__": + main() diff --git a/contrib/scrape-ec2-prices.py b/contrib/scrape-ec2-prices.py index d4d07b60d9..8bf768043b 100755 --- a/contrib/scrape-ec2-prices.py +++ b/contrib/scrape-ec2-prices.py @@ -19,144 +19,259 @@ import os import re +import copy import json import time -from collections import defaultdict, OrderedDict +import atexit +from collections import OrderedDict, defaultdict +import tqdm # pylint: disable=import-error +import ijson # pylint: disable=import-error import requests -import demjson - -LINUX_PRICING_URLS = [ - # Deprecated instances (JSON format) - 'https://aws.amazon.com/ec2/pricing/json/linux-od.json', - # Previous generation instances (JavaScript file) - 'https://a0.awsstatic.com/pricing/1/ec2/previous-generation/linux-od.min.js', - # New generation instances (JavaScript file) - 'https://a0.awsstatic.com/pricing/1/ec2/linux-od.min.js' -] -EC2_REGIONS = [ - 'us-east-1', - 'us-west-1', - 'us-west-2', - 'eu-west-1', - 'eu-central-1', - 'ap-southeast-1', - 'ap-southeast-2', - 'ap-northeast-1', - 'sa-east-1' -] +# Buffer size for ijson.parse() function. Larger buffer size results in increased memory +# consumption, but faster parsing. +IJSON_BUF_SIZE = 30 * 65536 -EC2_INSTANCE_TYPES = [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'm3.medium', - 'm3.large', - 'm3.xlarge', - 'm3.2xlarge', - 'c1.medium', - 'c1.xlarge', - 'cc1.4xlarge', - 'cc2.8xlarge', - 'c3.large', - 'c3.xlarge', - 'c3.2xlarge', - 'c3.4xlarge', - 'c3.8xlarge', - 'd2.xlarge', - 'd2.2xlarge', - 'd2.4xlarge', - 'd2.8xlarge', - 'cg1.4xlarge', - 'g2.2xlarge', - 'cr1.8xlarge', - 'hs1.4xlarge', - 'hs1.8xlarge', - 'i2.xlarge', - 'i2.2xlarge', - 'i2.4xlarge', - 'i2.8xlarge', - 'r3.large', - 'r3.xlarge', - 'r3.2xlarge', - 'r3.4xlarge', - 'r3.8xlarge', - 't2.micro', - 't2.small', - 't2.medium' -] +# same URL as the one used by scrape-ec2-sizes.py, now it has official data on pricing +URL = "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.json" -# Maps EC2 region name to region name used in the pricing file -REGION_NAME_MAP = { - 'us-east': 'ec2_us_east', - 'us-east-1': 'ec2_us_east', - 'us-west': 'ec2_us_west', - 'us-west-1': 'ec2_us_west', - 'us-west-2': 'ec2_us_west_oregon', - 'eu-west-1': 'ec2_eu_west', - 'eu-ireland': 'ec2_eu_west', - 'eu-central-1': 'ec2_eu_central', - 'apac-sin': 'ec2_ap_southeast', - 'ap-southeast-1': 'ec2_ap_southeast', - 'apac-syd': 'ec2_ap_southeast_2', - 'ap-southeast-2': 'ec2_ap_southeast_2', - 'apac-tokyo': 'ec2_ap_northeast', - 'ap-northeast-1': 'ec2_ap_northeast', - 'sa-east-1': 'ec2_sa_east', - 'us-gov-west-1': 'ec2_us_govwest' -} +RE_NUMERIC_OTHER = re.compile(r"(?:([0-9]+)|([-A-Z_a-z]+)|([^-0-9A-Z_a-z]+))") BASE_PATH = os.path.dirname(os.path.abspath(__file__)) -PRICING_FILE_PATH = os.path.join(BASE_PATH, '../libcloud/data/pricing.json') +PRICING_FILE_PATH = os.path.join(BASE_PATH, "../libcloud/data/pricing.json") PRICING_FILE_PATH = os.path.abspath(PRICING_FILE_PATH) +FILEPATH = os.environ.get("TMP_JSON", "/tmp/ec.json") -def scrape_ec2_pricing(): - result = defaultdict(OrderedDict) - - for url in LINUX_PRICING_URLS: - response = requests.get(url) - - if re.match('.*?\.json$', url): - data = response.json() - elif re.match('.*?\.js$', url): - data = response.content - match = re.match('^.*callback\((.*?)\);?$', data, - re.MULTILINE | re.DOTALL) - data = match.group(1) - # demjson supports non-strict mode and can parse unquoted objects - data = demjson.decode(data) - - regions = data['config']['regions'] - - for region_data in regions: - region_name = region_data['region'] - libcloud_region_name = REGION_NAME_MAP[region_name] - instance_types = region_data['instanceTypes'] - - for instance_type in instance_types: - sizes = instance_type['sizes'] +INSTANCE_SIZES = [ + "micro", + "small", + "medium", + "large", + "xlarge", + "x-large", + "extra-large", +] - for size in sizes: - price = size['valueColumns'][0]['prices']['USD'] - result[libcloud_region_name][size['size']] = price - return result +def download_json(): + if os.path.isfile(FILEPATH): + mtime_str = time.strftime("%Y-%m-%d %H:%I:%S UTC", time.gmtime(os.path.getmtime(FILEPATH))) + print("Using data from existing cached file {} (mtime={})".format(FILEPATH, mtime_str)) + return open(FILEPATH), True + + def remove_partial_cached_file(): + if os.path.isfile(FILEPATH): + os.remove(FILEPATH) + + # File not cached locally, download data and cache it + with requests.get(URL, stream=True) as response: + atexit.register(remove_partial_cached_file) + + total_size_in_bytes = int(response.headers.get("content-length", 0)) + progress_bar = tqdm.tqdm(total=total_size_in_bytes, unit="iB", unit_scale=True) + + chunk_size = 10 * 1024 * 1024 + + with open(FILEPATH, "wb") as fp: + # NOTE: We use shutil.copyfileobj with large chunk size instead of + # response.iter_content with large chunk size since data we + # download is massive and copyfileobj is more efficient. + # shutil.copyfileobj(response.raw, fp, 10 * 1024 * 1024) + for chunk_data in response.iter_content(chunk_size): + progress_bar.update(len(chunk_data)) + fp.write(chunk_data) + + progress_bar.close() + atexit.unregister(remove_partial_cached_file) + + return FILEPATH, False + + +def get_json(): + if not os.path.isfile(FILEPATH): + return download_json()[0], False + + mtime_str = time.strftime("%Y-%m-%d %H:%I:%S UTC", time.gmtime(os.path.getmtime(FILEPATH))) + print("Using data from existing cached file {} (mtime={})".format(FILEPATH, mtime_str)) + return FILEPATH, True + + +# Prices and sizes are in different dicts and categorized by sku +def get_all_prices(): + # return variable + # prices = {sku : {price: int, unit: string}} + prices = {} + current_sku = "" + current_rate_code = "" + amazonEC2_offer_code = "JRTCKXETXF" + json_file, from_file = get_json() + with open(json_file) as f: + print("Starting to parse pricing data, this could take up to 15 minutes...") + parser = ijson.parse(f, buf_size=IJSON_BUF_SIZE) + # use parser because file is very large + for prefix, event, value in tqdm.tqdm(parser): + if "products" in prefix: + continue + if (prefix, event) == ("terms.OnDemand", "map_key"): + current_sku = value + prices[current_sku] = {} + elif (prefix, event) == ( + f"terms.OnDemand.{current_sku}.{current_sku}.{amazonEC2_offer_code}.priceDimensions", + "map_key", + ): + current_rate_code = value + elif (prefix, event) == ( + f"terms.OnDemand.{current_sku}.{current_sku}.{amazonEC2_offer_code}.priceDimensions" + f".{current_rate_code}.unit", + "string", + ): + prices[current_sku]["unit"] = value + elif (prefix, event) == ( + f"terms.OnDemand.{current_sku}.{current_sku}.{amazonEC2_offer_code}.priceDimensions" + f".{current_rate_code}.pricePerUnit.USD", + "string", + ): + prices[current_sku]["price"] = value + return prices + + +# For each combination of location - size - os the file has a different sku. +# For each sku we have a price +def scrape_ec2_pricing(): + skus = {} + prices = get_all_prices() + json_file, from_file = get_json() + with open(json_file) as f: + print("Starting to parse pricing data, this could take up to 15 minutes...") + # use parser because file is very large + parser = ijson.parse(f, buf_size=IJSON_BUF_SIZE) + current_sku = "" + + for prefix, event, value in tqdm.tqdm(parser): + if "terms" in prefix: + break + if (prefix, event) == ("products", "map_key"): + current_sku = value + skus[current_sku] = {"sku": value} + elif (prefix, event) == (f"products.{current_sku}.productFamily", "string"): + skus[current_sku]["family"] = value + elif (prefix, event) == ( + f"products.{current_sku}.attributes.location", + "string", + ): + skus[current_sku]["locationName"] = value + elif (prefix, event) == ( + f"products.{current_sku}.attributes.locationType", + "string", + ): + skus[current_sku]["locationType"] = value + elif (prefix, event) == ( + f"products.{current_sku}.attributes.instanceType", + "string", + ): + skus[current_sku]["size"] = value + elif (prefix, event) == ( + f"products.{current_sku}.attributes.operatingSystem", + "string", + ): + skus[current_sku]["os"] = value + elif (prefix, event) == ( + f"products.{current_sku}.attributes.usagetype", + "string", + ): + skus[current_sku]["usage_type"] = value + elif (prefix, event) == ( + f"products.{current_sku}.attributes.preInstalledSw", + "string", + ): + skus[current_sku]["preInstalledSw"] = value + elif (prefix, event) == ( + f"products.{current_sku}.attributes.regionCode", + "string", + ): + skus[current_sku]["location"] = value + # only get prices of compute instances atm + elif (prefix, event) == (f"products.{current_sku}", "end_map"): + family = skus[current_sku].get("family") + + if family is None or ( + "Compute Instance" not in family and "Dedicated Host" not in family + ): + del skus[current_sku] + + ec2_linux = defaultdict(OrderedDict) + ec2_windows = defaultdict(OrderedDict) + ec2_rhel = defaultdict(OrderedDict) + ec2_rhel_ha = defaultdict(OrderedDict) + ec2_suse = defaultdict(OrderedDict) + + os_map = { + "Linux": ec2_linux, + "Windows": ec2_windows, + "RHEL": ec2_rhel, + "SUSE": ec2_suse, + "Red Hat Enterprise Linux with HA": ec2_rhel_ha, + } + for sku in skus: + if skus[sku]["locationType"] != "AWS Region": + continue + # skip any SQL + if skus[sku].get("preInstalledSw") != "NA": + continue + + os = skus[sku]["os"] + if os == "NA": + continue + os_dict = os_map.get(os) + # new OS, until it is documented skip it + if os_dict is None: + print(f"Unexpected OS {os}") + continue + size = skus[sku]["size"] + location = skus[sku]["location"] + # size is first seen + if not os_dict.get(size): + os_dict[size] = {} + + # if price already exists pick the BoxUsage usage type which means on demand + if os_dict.get(size, {}).get(location) and "BoxUsage" not in skus[sku]["usage_type"]: + continue + + # if price is not a number then label it as not available + try: + price = float(prices[sku]["price"]) + os_dict[size][location] = price + except ValueError: + os_dict[size][location] = "n/a" + except KeyError: + # size is available only reserved + del os_dict[size] + return { + "ec2_linux": ec2_linux, + "ec2_windows": ec2_windows, + "ec2_rhel": ec2_rhel, + "ec2_suse": ec2_suse, + "ec2_rhel_ha": ec2_rhel_ha, + } def update_pricing_file(pricing_file_path, pricing_data): - with open(pricing_file_path, 'r') as fp: + with open(pricing_file_path) as fp: content = fp.read() data = json.loads(content) - data['updated'] = int(time.time()) - data['compute'].update(pricing_data) + original_data = copy.deepcopy(data) + + data["compute"].update(pricing_data) + + if data == original_data: + # Nothing has changed, bail out early and don't update "updated" attribute + print("Nothing has changed, skipping update.") + return + + data["updated"] = int(time.time()) # Always sort the pricing info data = sort_nested_dict(data) @@ -164,9 +279,9 @@ def update_pricing_file(pricing_file_path, pricing_data): content = json.dumps(data, indent=4) lines = content.splitlines() lines = [line.rstrip() for line in lines] - content = '\n'.join(lines) + content = "\n".join(lines) - with open(pricing_file_path, 'w') as fp: + with open(pricing_file_path, "w") as fp: fp.write(content) @@ -176,7 +291,7 @@ def sort_nested_dict(value): """ result = OrderedDict() - for key, value in sorted(value.items()): + for key, value in sorted(value.items(), key=sort_key_by_numeric_other): if isinstance(value, (dict, OrderedDict)): result[key] = sort_nested_dict(value) else: @@ -185,15 +300,34 @@ def sort_nested_dict(value): return result +def sort_key_by_numeric_other(key_value): + """ + Split key into numeric, alpha and other part and sort accordingly. + """ + result = [] + + for numeric, alpha, other in RE_NUMERIC_OTHER.findall(key_value[0]): + numeric = int(numeric) if numeric else -1 + alpha = INSTANCE_SIZES.index(alpha) if alpha in INSTANCE_SIZES else alpha + alpha = str(alpha) + item = tuple([numeric, alpha, other]) + result.append(item) + + return tuple(result) + + def main(): - print('Scraping EC2 pricing data') + print( + "Scraping EC2 pricing data (if this runs for the first time " + "it has to download a 7GB file, depending on your bandwith " + "it might take a while)...." + ) pricing_data = scrape_ec2_pricing() - update_pricing_file(pricing_file_path=PRICING_FILE_PATH, - pricing_data=pricing_data) + update_pricing_file(pricing_file_path=PRICING_FILE_PATH, pricing_data=pricing_data) - print('Pricing data updated') + print("Pricing data updated") -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/contrib/scrape-ec2-sizes.py b/contrib/scrape-ec2-sizes.py new file mode 100755 index 0000000000..a63df4dc2f --- /dev/null +++ b/contrib/scrape-ec2-sizes.py @@ -0,0 +1,446 @@ +#!/usr/bin/env python +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +""" +This script downloads and parses AWS EC2 from +https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.json. +It writes a Python module with constants about EC2's sizes and regions. + +Use it as following (run it in the root of the repo directory): + $ python contrib/scrape-ec2-sizes.py +""" + +import os +import re +import json +import atexit + +import tqdm # pylint: disable=import-error +import ijson # pylint: disable=import-error +import requests + +FILEPATH = os.environ.get("TMP_JSON", "/tmp/ec.json") +URL = "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.json" +IGNORED_FIELDS = ["locationType", "operatingSystem"] +REG1_STORAGE = re.compile(r"(\d+) x ([0-9,]+)") +REG2_STORAGE = re.compile(r"(\d+) GB.*?") +REG_BANDWIDTH = re.compile(r"\D*(\d+)\D*") +# From +REGION_DETAILS = { + # America + "US East (N. Virginia)": { + "id": "us-east-1", + "endpoint": "ec2.us-east-1.amazonaws.com", + "api_name": "ec2_us_east", + "country": "USA", + "signature_version": "2", + }, + "US East (Ohio)": { + "id": "us-east-2", + "endpoint": "ec2.us-east-2.amazonaws.com", + "api_name": "ec2_us_east_ohio", + "country": "USA", + "signature_version": "4", + }, + "US West (N. California)": { + "id": "us-west-1", + "endpoint": "ec2.us-west-1.amazonaws.com", + "api_name": "ec2_us_west", + "country": "USA", + "signature_version": "2", + }, + "US West (Oregon)": { + "id": "us-west-2", + "endpoint": "ec2.us-west-2.amazonaws.com", + "api_name": "ec2_us_west_oregon", + "country": "US", + "signature_version": "2", + }, + "Canada (Central)": { + "id": "ca-central-1", + "endpoint": "ec2.ca-central-1.amazonaws.com", + "api_name": "ec2_ca_central_1", + "country": "Canada", + "signature_version": "4", + }, + "South America (Sao Paulo)": { + "id": "sa-east-1", + "endpoint": "ec2.sa-east-1.amazonaws.com", + "api_name": "ec2_sa_east", + "country": "Brazil", + "signature_version": "2", + }, + "AWS GovCloud (US)": { + "id": "us-gov-west-1", + "endpoint": "ec2.us-gov-west-1.amazonaws.com", + "api_name": "ec2_us_govwest", + "country": "US", + "signature_version": "2", + }, + # Africa + "af-south-1": { + "id": "af-south-1", + "endpoint": "ec2.af-south-1.amazonaws.com", + "api_name": "ec2_af_south", + "country": "South Africa", + "signature_version": "4", + }, + # EU + "eu-west-1": { + "id": "eu-west-1", + "endpoint": "ec2.eu-west-1.amazonaws.com", + "api_name": "ec2_eu_west", + "country": "Ireland", + "signature_version": "2", + }, + "EU (Ireland)": { # Duplicate from AWS' JSON + "id": "eu-west-1", + "endpoint": "ec2.eu-west-1.amazonaws.com", + "api_name": "ec2_eu_west", + "country": "Ireland", + "signature_version": "2", + }, + "EU (London)": { + "id": "eu-west-2", + "endpoint": "ec2.eu-west-2.amazonaws.com", + "api_name": "ec2_eu_west_london", + "country": "United Kingdom", + "signature_version": "4", + }, + "EU (Milan)": { + "id": "eu-south-1", + "endpoint": "ec2.eu-south-1.amazonaws.com", + "api_name": "ec2_eu_south", + "country": "Italy", + "signature_version": "4", + }, + "EU (Paris)": { + "id": "eu-west-3", + "endpoint": "ec2.eu-west-3.amazonaws.com", + "api_name": "ec2_eu_west_paris", + "country": "France", + "signature_version": "4", + }, + "EU (Frankfurt)": { + "id": "eu-central-1", + "endpoint": "ec2.eu-central-1.amazonaws.com", + "api_name": "ec2_eu_central", + "country": "Frankfurt", + "signature_version": "4", + }, + "EU (Stockholm)": { + "id": "eu-north-1", + "endpoint": "ec2.eu-north-1.amazonaws.com", + "api_name": "ec2_eu_north_stockholm", + "country": "Stockholm", + "signature_version": "4", + }, + # Asia + "Asia Pacific (Mumbai)": { + "id": "ap-south-1", + "endpoint": "ec2.ap-south-1.amazonaws.com", + "api_name": "ec2_ap_south_1", + "country": "India", + "signature_version": "4", + }, + "Asia Pacific (Singapore)": { + "id": "ap-southeast-1", + "endpoint": "ec2.ap-southeast-1.amazonaws.com", + "api_name": "ec2_ap_southeast", + "country": "Singapore", + "signature_version": "2", + }, + "Asia Pacific (Sydney)": { + "id": "ap-southeast-2", + "endpoint": "ec2.ap-southeast-2.amazonaws.com", + "api_name": "ec2_ap_southeast_2", + "country": "Australia", + "signature_version": "2", + }, + "Asia Pacific (Tokyo)": { + "id": "ap-northeast-1", + "endpoint": "ec2.ap-northeast-1.amazonaws.com", + "api_name": "ec2_ap_northeast", + "country": "Japan", + "signature_version": "2", + }, + "Asia Pacific (Seoul)": { + "id": "ap-northeast-2", + "endpoint": "ec2.ap-northeast-2.amazonaws.com", + "api_name": "ec2_ap_northeast", + "country": "South Korea", + "signature_version": "4", + }, + "Asia Pacific (Osaka-Local)": { + "id": "ap-northeast-3", + "endpoint": "ec2.ap-northeast-3.amazonaws.com", + "api_name": "ec2_ap_northeast", + "country": "Japan", + "signature_version": "4", + }, + "Asia Pacific (Hong Kong)": { + "id": "ap-east-1", + "endpoint": "ec2.ap-east-1.amazonaws.com", + "api_name": "ec2_ap_east", + "country": "Hong Kong", + "signature_version": "2", + }, + # Not in JSON + "China (Beijing)": { + "id": "cn-north-1", + "endpoint": "ec2.cn-north-1.amazonaws.com.cn", + "api_name": "ec2_cn_north", + "country": "China", + "signature_version": "4", + }, + "China (Ningxia)": { + "id": "cn-northwest-1", + "endpoint": "ec2.cn-northwest-1.amazonaws.com.cn", + "api_name": "ec2_cn_northwest", + "country": "China", + "signature_version": "4", + }, +} + +FILE_HEADER = """ +# File generated by contrib/scrape-ec2-sizes.py script - DO NOT EDIT manually +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""".strip() + + +def download_json(): + if os.path.isfile(FILEPATH): + print("Using data from existing cached file %s" % (FILEPATH)) + return open(FILEPATH) + + def remove_partial_cached_file(): + if os.path.isfile(FILEPATH): + os.remove(FILEPATH) + + # File not cached locally, download data and cache it + with requests.get(URL, stream=True) as response: + atexit.register(remove_partial_cached_file) + + total_size_in_bytes = int(response.headers.get("content-length", 0)) + progress_bar = tqdm.tqdm(total=total_size_in_bytes, unit="iB", unit_scale=True) + + chunk_size = 10 * 1024 * 1024 + + with open(FILEPATH, "wb") as fp: + # NOTE: We use shutil.copyfileobj with large chunk size instead of + # response.iter_content with large chunk size since data we + # download is massive and copyfileobj is more efficient. + # shutil.copyfileobj(response.raw, fp, 10 * 1024 * 1024) + for chunk_data in response.iter_content(chunk_size): + progress_bar.update(len(chunk_data)) + fp.write(chunk_data) + + progress_bar.close() + atexit.unregister(remove_partial_cached_file) + + return open(FILEPATH) + + +def get_json(): + if not os.path.isfile(FILEPATH): + return download_json(), False + + print("Using data from existing cached file %s" % (FILEPATH)) + return open(FILEPATH), True + + +def filter_extras(extras): + return { + key: extras[key] + for key in extras + if key + not in [ + "capacitystatus", + "ebsOptimized", + "operation", + "licenseModel", + "preInstalledSw", + "tenancy", + "usagetype", + ] + } + + +def parse(): + # Set vars + sizes = {} + regions = {r["id"]: r for r in REGION_DETAILS.values()} + for region_id in regions: + regions[region_id]["instance_types"] = [] + # Parse + json_file, from_file = get_json() + products_data = ijson.items(json_file, "products") + + try: + products_data = next(products_data) + except ijson.common.IncompleteJSONError as e: + # This likely indicates that the cached file is incomplete or corrupt so we delete it and re + # download data + if from_file: + os.remove(FILEPATH) + json_file, from_file = get_json() + products_data = ijson.items(json_file, "products") + products_data = next(products_data) + else: + raise e + + for sku in products_data: + if products_data[sku].get("productFamily", "unknown") != "Compute Instance": + continue + location = products_data[sku]["attributes"].pop("location") + if location not in REGION_DETAILS: + continue + # Get region & size ID + region_id = REGION_DETAILS[location]["id"] + instance_type = products_data[sku]["attributes"]["instanceType"] + # Add size to region + if instance_type not in regions[region_id]["instance_types"]: + regions[region_id]["instance_types"].append(instance_type) + # Parse sizes + if instance_type not in sizes: + for field in IGNORED_FIELDS: + products_data[sku]["attributes"].pop(field, None) + # Compute RAM + ram = int( + float(products_data[sku]["attributes"]["memory"].split()[0].replace(",", "")) * 1024 + ) + # Compute bandwdith + bw_match = REG_BANDWIDTH.match(products_data[sku]["attributes"]["networkPerformance"]) + if bw_match is not None: + bandwidth = int(bw_match.groups()[0]) + else: + bandwidth = None + sizes[instance_type] = { + "id": instance_type, + "name": instance_type, + "ram": ram, + "bandwidth": bandwidth, + "extra": filter_extras(products_data[sku]["attributes"]), + } + if products_data[sku]["attributes"].get("storage") != "EBS only": + match = REG1_STORAGE.match(products_data[sku]["attributes"]["storage"]) + if match: + disk_number, disk_size = match.groups() + else: + match = REG2_STORAGE.match(products_data[sku]["attributes"]["storage"]) + if match: + disk_number, disk_size = 1, match.groups()[0] + else: + disk_number, disk_size = 0, "0" + disk_number, disk_size = ( + int(disk_number), + int(disk_size.replace(",", "")), + ) + sizes[instance_type]["disk"] = disk_number * disk_size + else: + sizes[instance_type]["disk"] = 0 + products_data[sku]["attributes"] + # Sort + for region in regions: + regions[region]["instance_types"] = sorted(regions[region]["instance_types"]) + return sizes, regions + + +def dump(): + print("Scraping size data, this may take up to 10-15 minutes...") + + sizes, regions = parse() + + separators = (",", ": ") + + # 1. Write file with instance types constants + file_path = "libcloud/compute/constants/ec2_instance_types.py" + with open(file_path, "w") as fp: + fp.write(FILE_HEADER + "\n") + fp.write("\n") + fp.write( + "INSTANCE_TYPES = " + + json.dumps(sizes, indent=4, sort_keys=True, separators=separators).replace( + "null", "None" + ) + ) + + print("") + print("Data written to %s" % (file_path)) + print("") + + # 2. Write file with full details for each region + file_path = "libcloud/compute/constants/ec2_region_details_complete.py" + with open(file_path, "w") as fp: + fp.write(FILE_HEADER + "\n") + fp.write("\n") + fp.write( + "REGION_DETAILS = " + + json.dumps(regions, indent=4, sort_keys=True, separators=separators).replace( + "null", "None" + ) + ) + + print("Data written to %s" % (file_path)) + print("") + + # 3. Write file with partial region details (everything except instance_types attribute) + regions_partial = {} + keys_to_keep = ["api_name", "country", "id", "endpoint", "signature_version"] + + for region_name, region_details in regions.items(): + regions_partial[region_name] = {} + + for key, value in region_details.items(): + if key not in keys_to_keep: + continue + + regions_partial[region_name][key] = value + + file_path = "libcloud/compute/constants/ec2_region_details_partial.py" + + with open(file_path, "w") as fp: + fp.write(FILE_HEADER + "\n") + fp.write("\n") + fp.write( + "REGION_DETAILS = " + + json.dumps(regions_partial, indent=4, sort_keys=True, separators=separators).replace( + "null", "None" + ) + ) + + print("Data written to %s" % (file_path)) + print("") + + +if __name__ == "__main__": + dump() diff --git a/contrib/scrape-gce-prices.py b/contrib/scrape-gce-prices.py new file mode 100755 index 0000000000..5f4f3c6925 --- /dev/null +++ b/contrib/scrape-gce-prices.py @@ -0,0 +1,494 @@ +#!/usr/bin/env python +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +""" +Price scraper for GCE. An api key is required +(https://cloud.google.com/docs/authentication/api-keys). + +Keep in mind that Cloud Billing API needs to be enabled for the account you use +to authenticate otherwise you will received 403 Forbidden error. + +It can be enabled at https://console.cloud.google.com/apis/library/cloudbilling.googleapis.com. + +Usage: + + python scrape-gce-prices.py APIKEY + +or if it is the first time using it and no skus are saved: + + python scrape-gce-prices.py --all APIKEY +""" + +import os +import copy +import json +import time +import argparse + +from requests import request + +GCE_SERVICE_ID = "6F81-5844-456A" +API_URL = "https://cloudbilling.googleapis.com/v1/services/" "{}/skus".format(GCE_SERVICE_ID) + +API_KEY = os.environ.get("GCE_API_KEY", None) + +usage_type_map = { + "OnDemand": "on_demand", + "Preemptible": "preemptible", + "Commit1Yr": "1yr_commitment", + "Commit3Yr": "3yr_commitment", +} +# compute -> gce_instances --> instance type --> +# usage type (On demand, preemptible, Commitment) --> +# region --> price/hour +compute = { + "gce_instances": { + "n1": { + "cpu": { + "description": "n1 predefined instance core", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + "ram": { + "description": "n1 predefined instance ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + "n1_custom": { + "cpu": { + "description": "custom instance core", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + "ram": { + "description": "custom instance ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + "n1_custom_extended": { + "cpu": {}, + "ram": { + "description": "custom extended instance ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + "n2": { + "cpu": { + "description": "n2 instance core", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + "ram": { + "description": "n2 instance ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + "n2_custom": { + "cpu": { + "description": "n2 custom instance core", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + "ram": { + "description": "n2 custom instance ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + "n2_custom_extended": { + "cpu": {}, + "ram": { + "description": "n2 custom extended instance ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + # E2 predefined and custom have same prices and no extended + "e2": { + "cpu": { + "description": "e2 instance core", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + "ram": { + "description": "e2 instance ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + "e2_custom": { + "cpu": { + "description": "e2 instance core", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + "ram": { + "description": "e2 instance ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + "n2d": { + "cpu": { + "description": "n2d amd instance core", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + "ram": { + "description": "n2d amd instance ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + "n2d_custom": { + "cpu": { + "description": "n2d amd custom instance core", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + "ram": { + "description": "n2d amd custom instance ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + "n2d_custom_extended": { + "cpu": {}, + "ram": { + "description": "n2d amd custom extended instance ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + # M1 memory optimized, no custom + "m1": { + "cpu": { + "description": "memory-optimized instance core", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + "ram": { + "description": "memory-optimized instance ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + "c2": { + "cpu": { + "description": "compute optimized core", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + "ram": { + "description": "compute optimized ram", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + "f1": { + "cpu": { # for consitency, this instance has only one price + "description": "micro instance", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + } + }, + "g1": { + "cpu": { # for consitency, this instance has only one price + "description": "small instance", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + } + }, + }, + "gce_disks": { + "Standard": {"description": "storage pd capacity", "on_demand": {}}, + "SSD": {"description": "ssd backed pd", "on_demand": {}}, + "Regional Standard": { + "description": "regional storage pd capacity", + "on_demand": {}, + }, + "Regional SSD": {"description": "ssd backed pd capacity", "on_demand": {}}, + "Local SSD": { + "description": "ssd backed local storage", + "on_demand": {}, + "preemptible": {}, + "1yr_commitment": {}, + "3yr_commitment": {}, + }, + }, + # The skus here have been hardcoded due to my inability of scraping them + # The SQL prices are also hardcoded since I couldn't even + # find the correct skus + "gce_images": { + "RHEL": { + "description": "RHEL7", + "4vcpu or less": {"price": 0, "sku": "57A4-6443-7F8D"}, + "6vcpu or more": {"price": 0, "sku": "9AAA-D8A1-1CA1"}, + }, + "RHEL with Update Services": { + "description": "Red Hat Enterprise Linux for SAP with Update Services", + "4vcpu or less": {"price": 0, "sku": "7E6E-54A7-319A"}, + "6vcpu or more": {"price": 0, "sku": "CB1D-70B4-22E0"}, + }, + "SLES": { + "f1": {"price": 0, "sku": "0469-B817-410A"}, + "g1": {"price": 0, "sku": "739A-8A87-1E79"}, + "any": {"price": 0, "sku": "42E1-070C-7F4E"}, + }, + "SLES for SAP": { + "6vcpu or more": {"price": 0, "sku": "5E02-C3BA-6290"}, + "3-4vcpu": {"price": 0, "sku": "86C1-64B7-1E72"}, + "1-2vcpu": {"price": 0, "sku": "EAF4-4289-40E6"}, + }, + "Windows Server": { + "any": {"price": 0, "sku": "00B2-37B0-B8BB"}, # this is per core per hour + "f1": {"price": 0, "sku": "151B-229F-68E1"}, + "g1": {"price": 0, "sku": "03F4-45F5-24A2"}, + }, + "SQL Server": { # prices are per core per hour + "enterprise": {"price": 0.399}, + "standard": {"price": 0.1645}, + "web": {"price": 0.011}, + }, + }, +} + +BASE_PATH = os.path.dirname(os.path.abspath(__file__)) +PRICING_FILE_PATH = os.path.join(BASE_PATH, "../libcloud/data/pricing.json") +PRICING_FILE_PATH = os.path.abspath(PRICING_FILE_PATH) + + +def get_all_skus(key): + # a valid google cloud account API key should be provided + # https://cloud.google.com/docs/authentication/api-keys + url = API_URL + params = {"key": key} + data = [] + has_next_page = True + while has_next_page: + try: + response = request(method="GET", url=url, params=params) + response.raise_for_status() + except Exception as e: + msg = str(e) + msg = msg.replace(key, "************") + raise Exception(msg) + + data.extend(response.json().get("skus", {})) + next_page = response.json().get("nextPageToken") + + if next_page: + params["pageToken"] = next_page + else: + has_next_page = False + + return data + + +def scrape_sku_price_info(key): + data = get_all_skus(key) + dict_ = compute + for sku in data: + # to make sure I get the correct memory optimized + if "Premium" in sku["description"]: + continue + for item in dict_["gce_instances"].values(): + for resource in {"cpu", "ram"}: + if resource in item: + description = item[resource].get("description", "-----") + else: + continue + if description in sku["description"].lower(): + location = sku["serviceRegions"][0] + usage_type = usage_type_map[sku["category"]["usageType"]] + price = price_from_sku(sku) + item[resource][usage_type][location] = {"price": price} + item[resource][usage_type][location]["sku"] = sku["skuId"] + for sku in data: + for item in dict_["gce_disks"].values(): + description = item["description"] + if description in sku["description"].lower(): + if "regional" in sku["description"].lower() and "regional" not in description: + continue + location = sku["serviceRegions"][0] + usage_type = usage_type_map[sku["category"]["usageType"]] + price = price_from_sku(sku) + # disk price is per month /720 to make it per hour + item[usage_type][location] = {"price": price / 720} + item[usage_type][location]["sku"] = sku["skuId"] + # images were done by hand + + return dict_ + + +def scrape_only_prices(key): + data = get_all_skus(key) + with open(PRICING_FILE_PATH) as fp: + content = fp.read() + dict_ = json.loads(content)["compute"] + for sku in data: + skuId = sku["skuId"] + for item in dict_["gce_instances"].values(): + for resource in item: + for usage_type in item[resource]: + if usage_type == "description": + continue + for location in item[resource][usage_type]: + if item[resource][usage_type][location].get("sku") == skuId: + price = price_from_sku(sku) + item[resource][usage_type][location]["price"] = price + for item in dict_["gce_disks"].values(): + for usage_type in item: + if usage_type == "description": + continue + for location in item[usage_type]: + if skuId == item[usage_type][location].get("sku"): + price = price_from_sku(sku) + # disk price is per month /720 to make it per hour + item[usage_type][location]["price"] = price / 720 + + for item in dict_["gce_images"].values(): + for type_ in item: + if type_ == "description": + continue + if skuId == item[type_].get("sku"): + price = price_from_sku(sku) + item[type_]["price"] = price + return dict_ + + +def price_from_sku(sku): + for tier_rate in sku["pricingInfo"][0]["pricingExpression"]["tieredRates"]: + units = tier_rate["unitPrice"]["units"] + nanos = tier_rate["unitPrice"]["nanos"] + nano = str(nanos) + nano = "0" * (9 - len(nano)) + nano + units = str(units) + price = units + "." + nano + if float(price) != 0: + break + return float(price) + + +def update_pricing_file(pricing_file_path, pricing_data): + with open(pricing_file_path) as fp: + content = fp.read() + + data = json.loads(content) + + original_data = copy.deepcopy(data) + + data["compute"].update(pricing_data) + + if data == original_data: + # Nothing has changed, bail out early and don't update "updated" attribute + print("Nothing has changed, skipping update.") + return + + data["updated"] = int(time.time()) + content = json.dumps(data, indent=4) + lines = content.splitlines() + lines = [line.rstrip() for line in lines] + content = "\n".join(lines) + + with open(pricing_file_path, "w") as fp: + fp.write(content) + + +def main(key, skus=False): + print("Scraping GCE pricing data (this may take a while)...") + + if skus: + pricing_data = scrape_sku_price_info(key) + else: + pricing_data = scrape_only_prices(key) + update_pricing_file(pricing_file_path=PRICING_FILE_PATH, pricing_data=pricing_data) + + print("Pricing data updated") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(prog="scrape gce prices") + help_msg = "If enabled both sku's and prices will be scraped" + parser.add_argument("--all", action="store_true", help=help_msg) + help_msg = "Google API key, visit https://cloud.google.com/" "docs/authentication/api-keys" + parser.add_argument("key", help=help_msg, nargs="?", default=API_KEY) + arg = parser.parse_args() + + if not arg.key: + raise ValueError( + "API key needs to provided either as a script " + "argument or via GCE_API_KEY environment " + "variable." + ) + main(arg.key, skus=arg.all) diff --git a/contrib/trigger_rtd_build.py b/contrib/trigger_rtd_build.py index b132e54c6a..99d5f35b2e 100755 --- a/contrib/trigger_rtd_build.py +++ b/contrib/trigger_rtd_build.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. @@ -14,12 +14,20 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os import sys -import urllib2 +import requests -key = sys.argv[1] -url = 'http://readthedocs.org/build/%s' % (key) -req = urllib2.Request(url, '') -f = urllib2.urlopen(req) -print f.read() +token = os.environ["RTD_TOKEN"] +branch = os.environ["BRANCH_NAME"] + +print(f"Using branch: {branch}") + +url = "https://readthedocs.org/api/v2/webhook/libcloud/87656/" +r = requests.post(url, data={"token": token, "branches": branch}) +print(r.text) + +if r.status_code != 200: + print("Triggering RTD build failed") + sys.exit(1) diff --git a/contrib/update_google_prices.py b/contrib/update_google_prices.py new file mode 100755 index 0000000000..82bb1cb172 --- /dev/null +++ b/contrib/update_google_prices.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Loads Google Cloud Platform prices and updates the `pricing.json` data file. +""" + +# pylint: skip-file + +import os +import sys +import json +import time + +import urllib2 + +import utils + +BASE_PATH = os.path.dirname(os.path.abspath(__file__)) +PRICING_FILE_PATH = os.path.join(BASE_PATH, "../libcloud/data/pricing.json") +PRICING_FILE_PATH = os.path.abspath(PRICING_FILE_PATH) + +GOOGLE_CLOUD_PRICES = "https://cloudpricingcalculator.appspot.com/static/data/pricelist.json" + + +def main(argv): + # Read the current pricing data. + libcloud_data = {} + with open(PRICING_FILE_PATH) as libcloud_in: + libcloud_data = json.loads(libcloud_in.read()) + + # Download the current Google Cloud Platform pricing. + req = urllib2.Request(GOOGLE_CLOUD_PRICES, "") + google_ext_prices = json.loads(urllib2.urlopen(req).read()) + if "gcp_price_list" not in google_ext_prices: + sys.stderr.write('Google Cloud pricing data missing "gcp_price_list" node\n') + sys.exit(1) + + # This is a map from regions used in the pricing JSON file to the regions as + # reflected in the Google Cloud Platform documentation and APIs. + pricing_to_region = { + "us": "us", + "eu": "europe", # alias for 'europe' + "europe": "europe", + "apac": "asia", # alias for 'asia' + "asia": "asia", + "au": "australia", # alias for 'australia' + "australia": "australia", + } + + # Initialize Google Cloud Platform regions. + for _, region in pricing_to_region.iteritems(): + libcloud_data["compute"]["google_%s" % region] = {} + + # Update Google Compute Engine pricing. + gcp_price_list = google_ext_prices["gcp_price_list"] + gce_vm_prefix = "CP-COMPUTEENGINE-VMIMAGE-" + for name, prices in gcp_price_list.iteritems(): + if not name.startswith(gce_vm_prefix): + continue + short_name = name[len(gce_vm_prefix) :] + machine_type = short_name.lower() + for key, price in prices.iteritems(): + if key in pricing_to_region: + region = pricing_to_region[key] + libcloud_data["compute"]["google_%s" % region][machine_type] = price + + # Update last-modified timestamp. + libcloud_data["updated"] = int(time.time()) + + # Write updated price list. + with open(PRICING_FILE_PATH, "w") as libcloud_out: + json_str = json.dumps( + libcloud_data, indent=4 * " ", item_sort_key=utils.sortKeysNumerically + ) + libcloud_out.write(json_str) + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) diff --git a/contrib/update_vultr_fixtures.sh b/contrib/update_vultr_fixtures.sh new file mode 100644 index 0000000000..5c04c6daef --- /dev/null +++ b/contrib/update_vultr_fixtures.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e +# set -x +# make sure: +# - you installed curl +# - you installed jq + +API_POINT="api.vultr.com" +FIXTURES_PATH="./libcloud/test/compute/fixtures/vultr" +[ ! -d "$FIXTURES_PATH" ] && echo "Please run command from root dir of project" && exit + +if ! [ -x "$(command -v curl)" ]; then + echo 'Error: curl is not installed.' >&2 + exit 1 +fi +if ! [ -x "$(command -v jq)" ]; then + echo 'Error: jq is not installed.' >&2 + exit 1 +fi +#unauthenticated_endpoints = { # {action: methods} +# '/v1/app/list': ['GET'], +# '/v1/os/list': ['GET'], +# '/v1/plans/list': ['GET'], +# '/v1/plans/list_vc2': ['GET'], +# '/v1/plans/list_vdc2': ['GET'], +# '/v1/regions/availability': ['GET'], +# '/v1/regions/list': ['GET'] +# } + +curl "https://$API_POINT/v1/os/list" | jq >"$FIXTURES_PATH/list_images.json" +curl "https://$API_POINT/v1/plans/list" | jq >"$FIXTURES_PATH/list_sizes.json" +curl "https://$API_POINT/v1/regions/list" | jq >"$FIXTURES_PATH/list_locations.json" diff --git a/contrib/upload-pricing-data-to-s3.py b/contrib/upload-pricing-data-to-s3.py new file mode 100755 index 0000000000..39f76068c0 --- /dev/null +++ b/contrib/upload-pricing-data-to-s3.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Script which uploads pricing data file (pricing.json) to an S3 bucket. + +Based on https://github.com/scalyr/scalyr-agent-2/blob/master/ +scripts/circleci/upload-coverage-data-to-s3.py (ASF 2.0) +""" + +import os +import sys + +from libcloud.storage.types import Provider +from libcloud.storage.providers import get_driver + +BUCKET_NAME = os.environ.get("PRICING_DATA_BUCKET_NAME", "libcloud-pricing-data") + +ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", None) +ACCESS_KEY_SECRET = os.environ.get("AWS_ACCESS_KEY_SECRET", None) +AWS_REGION = os.environ.get("AWS_REGION", "us-east-1") + +if not ACCESS_KEY_ID: + raise ValueError("AWS_ACCESS_KEY_ID env variable not set") + +if not ACCESS_KEY_SECRET: + raise ValueError("AWS_ACCESS_KEY_SECRET env variable not set") + + +def upload_file(file_path): + if not os.path.isfile(file_path): + raise ValueError("File %s doesn't exist" % (file_path)) + + print("Uploading pricing data files to S3") + + cls = get_driver(Provider.S3) + driver = cls(ACCESS_KEY_ID, ACCESS_KEY_SECRET, region=AWS_REGION) + + file_paths = [ + file_path, + "%s.sha256" % (file_path), + "%s.sha512" % (file_path), + ] + + for file_path in file_paths: + file_name = os.path.basename(file_path) + object_name = file_name + + container = driver.get_container(container_name=BUCKET_NAME) + obj = container.upload_object(file_path=file_path, object_name=object_name) + + print("Object uploaded to: {}/{}".format(BUCKET_NAME, object_name)) + print(obj) + + +if __name__ == "__main__": + file_path = os.path.abspath(sys.argv[1]) + upload_file(file_path) diff --git a/contrib/utils.py b/contrib/utils.py new file mode 100644 index 0000000000..27b4119b82 --- /dev/null +++ b/contrib/utils.py @@ -0,0 +1,48 @@ +#!/usr/bin/python +# +# Copyright 2015 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +import re + + +def splitStringWithNumbers(string): + """Splits input string into a list of items, numeric and otherwise. + + Returns a list of values, each either an interpreted number, or a substring + of the original input. + + E.g., 'abc-123-def' => ['abc-', 123, '-def'] + """ + rawParts = re.split(r"(\d+)", string) + + # Filter out empty strings. + nonEmptyParts = filter(None, rawParts) + + # Convert any numeric strings to numbers. + def splitHelper(nonEmptyParts): + for part in nonEmptyParts: + if re.match(r"\d+", part): + yield int(part) + else: + yield part + + return list(splitHelper(nonEmptyParts)) + + +def sortKeysNumerically(key_value): + key, value = key_value + return splitStringWithNumbers(key) diff --git a/contrib/utils_test.py b/contrib/utils_test.py new file mode 100644 index 0000000000..70257ffffc --- /dev/null +++ b/contrib/utils_test.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# Copyright 2015 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +# pylint: skip-file + +import json +import unittest + +import utils + + +class SplitStringToAlphaNumTest(unittest.TestCase): + def testInitial(self): + self.assertEqual(utils.splitStringWithNumbers("12-abc"), [12, "-abc"]) + + def testMiddle(self): + self.assertEqual(utils.splitStringWithNumbers("abc-345-def"), ["abc-", 345, "-def"]) + + def testFinal(self): + self.assertEqual(utils.splitStringWithNumbers("xyz-42"), ["xyz-", 42]) + + def testMultiple(self): + self.assertEqual( + utils.splitStringWithNumbers("Aaa-123-Bbb-456-Ccc"), + ["Aaa-", 123, "-Bbb-", 456, "-Ccc"], + ) + + +class SortKeysNumericallyTest(unittest.TestCase): + def testSimple(self): + input = { + "a-1": 1, + "a-12": 12, + "a-2": 2, + } + output = """\ +{ + "a-1": 1, + "a-2": 2, + "a-12": 12 +}\ +""" + self.assertEqual( + json.dumps(input, indent=4 * " ", item_sort_key=utils.sortKeysNumerically), + output, + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/demos/__init__.py b/demos/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/demos/compute_demo.py b/demos/compute_demo.py index 983b713239..474cd288a8 100644 --- a/demos/compute_demo.py +++ b/demos/compute_demo.py @@ -27,21 +27,21 @@ except ImportError: secrets = None -import os.path import sys +import os.path +from pprint import pprint # Add parent dir of this file's dir to sys.path (OS-agnostically) -sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), - os.path.pardir))) +sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), os.path.pardir))) -from libcloud.common.types import InvalidCredsError -from libcloud.compute.types import Provider -from libcloud.providers import get_driver +# isort:skip pragma is needed to make sure those imports are not moved above +# sys.path manipulation code (https://github.com/PyCQA/isort/issues/468) +from libcloud.common.types import InvalidCredsError # isort:skip +from libcloud.compute.types import Provider # isort:skip +from libcloud.compute.providers import get_driver # isort:skip -from pprint import pprint - -def get_demo_driver(provider_name='RACKSPACE', *args, **kwargs): +def get_demo_driver(provider_name="RACKSPACE", *args, **kwargs): """An easy way to play with a driver interactively. # Load credentials from secrets.py: @@ -71,15 +71,14 @@ def get_demo_driver(provider_name='RACKSPACE', *args, **kwargs): DriverClass = get_driver(getattr(Provider, provider_name)) if not args: - args = getattr(secrets, provider_name + '_PARAMS', ()) + args = getattr(secrets, provider_name + "_PARAMS", ()) if not kwargs: - kwargs = getattr(secrets, provider_name + '_KEYWORD_PARAMS', {}) + kwargs = getattr(secrets, provider_name + "_KEYWORD_PARAMS", {}) try: return DriverClass(*args, **kwargs) except InvalidCredsError: - raise InvalidCredsError( - 'valid values should be put in secrets.py') + raise InvalidCredsError("valid values should be put in secrets.py") def main(argv): @@ -95,8 +94,7 @@ def main(argv): """ try: driver = get_demo_driver() - except InvalidCredsError: - e = sys.exc_info()[1] + except InvalidCredsError as e: print("Invalid Credentials: " + e.value) return 1 @@ -109,10 +107,10 @@ def main(argv): print(">> Loading sizes... (showing up to 10)") pprint(driver.list_sizes()[:10]) - except Exception: - e = sys.exc_info()[1] + except Exception as e: print("A fatal error occurred: " + e) return 1 -if __name__ == '__main__': + +if __name__ == "__main__": sys.exit(main(sys.argv)) diff --git a/demos/example_aliyun_ecs.py b/demos/example_aliyun_ecs.py new file mode 100644 index 0000000000..537cfdfdd7 --- /dev/null +++ b/demos/example_aliyun_ecs.py @@ -0,0 +1,91 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys + +from libcloud.compute.base import NodeAuthPassword +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +ECSDriver = get_driver(Provider.ALIYUN_ECS) + +region = "cn-hangzhou" + +your_access_key_id = "" +your_access_key_secret = "" +ecs = ECSDriver(your_access_key_id, your_access_key_secret, region=region) + +sizes = ecs.list_sizes() +small = sizes[1] + +locations = ecs.list_locations() +location = None +for each in locations: + if each.id == region: + location = each + break +if location is None: + print("could not find cn-qingdao location") + sys.exit(-1) +print(location.name) + +images = ecs.list_images() +print("Found %d images" % len(images)) +for each in images: + if "ubuntu" in each.id.lower(): + image = each + break +else: + image = images[0] +print("Use image %s" % image) + +sgs = ecs.ex_list_security_groups() +print("Found %d security groups" % len(sgs)) +if len(sgs) == 0: + sg = ecs.ex_create_security_group(description="test") + print("Create security group %s" % sg) +else: + sg = sgs[0].id + print("Use security group %s" % sg) + +nodes = ecs.list_nodes() +print("Found %d nodes" % len(nodes)) +if len(nodes) == 0: + print("Starting create a new node") + data_disk = { + "size": 5, + "category": ecs.disk_categories.CLOUD, + "disk_name": "data_disk1", + "delete_with_instance": True, + } + + auth = NodeAuthPassword("P@$$w0rd") + + ex_internet_charge_type = ecs.internet_charge_types.BY_TRAFFIC + node = ecs.create_node( + image=image, + size=small, + name="test", + ex_security_group_id=sg, + ex_internet_charge_type=ex_internet_charge_type, + ex_internet_max_bandwidth_out=1, + ex_data_disk=data_disk, + auth=auth, + ) + print("Created node %s" % node) + nodes = ecs.list_nodes() + +for each in nodes: + print("Found node %s" % each) diff --git a/demos/example_aliyun_oss.py b/demos/example_aliyun_oss.py new file mode 100644 index 0000000000..3668140b89 --- /dev/null +++ b/demos/example_aliyun_oss.py @@ -0,0 +1,85 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.storage.types import Provider +from libcloud.storage.providers import get_driver + +OSSDriver = get_driver(Provider.ALIYUN_OSS) + +your_access_key_id = "" +your_access_key_secret = "" +oss = OSSDriver(your_access_key_id, your_access_key_secret) + +container_name = "CONTAINER_NAME_FOR_TEST" +object_name = "OBJECT_NAME_FOR_TEST" +local_file_path = "LOCAL_FILE_FULL_PATH_TO_UPLOAD" +upload_object_name = "OBJECT_NAME_FOR_UPLOAD_FILE" +for container in oss.iterate_containers(): + print("container: %s" % container) + +c1 = oss.get_container(container_name) +print("Got container %s:" % c1) + +objects = c1.list_objects() +count = len(objects) +print("Has %d objects" % count) + +objects = oss.list_container_objects(c1, prefix="en") +print('Has %d objects with prefix "en"' % len(objects)) +for each in objects: + print(each) + +obj = oss.get_object(container_name, object_name) +print("Got object %s:" % obj) + +# Download object +oss.download_object(obj, object_name, overwrite_existing=True) +for trunk in oss.download_object_as_stream(obj): + print(trunk) + +# Upload object +obj = oss.upload_object(local_file_path, c1, upload_object_name) + +# Upload multipart +uploads = list(oss.ex_iterate_multipart_uploads(c1)) +print("Found %d incompleted uploads" % len(uploads)) +if len(uploads) > 0: + oss.ex_abort_all_multipart_uploads(c1) + print("Abort them all") + + +def data_iter(limit): + i = 0 + while True: + yield i + i += 1 + if i >= limit: + break + + +print("Starting to upload 1MB using multipart api") +one_mb = 1024 * 1024 +obj = oss.upload_object_via_stream(data_iter(one_mb), c1, upload_object_name) +print("Finish uploading") + +# Delete objects +print("Delete object %s" % obj) +oss.delete_object(obj) + +# Create container +# c2 = oss.create_container(container_name='20160117') +# c2 = oss.create_container(container_name='20160117', +# ex_location='oss-cn-beijing') +# c2_got = oss.get_container('20160117') diff --git a/demos/example_aliyun_slb.py b/demos/example_aliyun_slb.py new file mode 100644 index 0000000000..050d01f570 --- /dev/null +++ b/demos/example_aliyun_slb.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.compute.types import Provider as NodeProvider +from libcloud.compute.providers import get_driver as get_node_driver +from libcloud.loadbalancer.base import Member, Algorithm +from libcloud.loadbalancer.types import Provider +from libcloud.loadbalancer.providers import get_driver + +SLBDriver = get_driver(Provider.ALIYUN_SLB) +ECSDriver = get_node_driver(NodeProvider.ALIYUN_ECS) + +region = "cn-hangzhou" + +your_access_key_id = "" +your_access_key_secret = "" +slb = SLBDriver(your_access_key_id, your_access_key_secret, region=region) +ecs = ECSDriver(your_access_key_id, your_access_key_secret, region=region) + +protos = slb.list_protocols() +print("Found %d protocols: %s" % (len(protos), protos)) + +balancers = slb.list_balancers() +print("Found %d load balancers" % len(balancers)) +print(balancers) + +if len(balancers) > 0: + b1 = balancers[0] + print("Delete %s" % b1) + slb.destroy_balancer(b1) +else: + extra = { + "AddressType": "internet", + "Bandwidth": 1, + "StickySession": "off", + "HealthCheck": "off", + } + nodes = ecs.list_nodes() + print("Found %d nodes" % len(nodes)) + members = [ + Member(node.id, node.public_ips[0], 80, extra={"Weight": 50 * (i + 1)}) + for i, node in enumerate(nodes) + ] + new_b = slb.create_balancer( + "test-balancer", 80, "http", Algorithm.WEIGHTED_ROUND_ROBIN, members, **extra + ) + print("Created balancer %s" % new_b) diff --git a/demos/example_openstack.py b/demos/example_openstack.py new file mode 100644 index 0000000000..e9cafe3c6c --- /dev/null +++ b/demos/example_openstack.py @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from pprint import pprint + +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +Openstack = get_driver(Provider.OPENSTACK) + +con = Openstack( + "admin", + "password", + ex_force_auth_url="http://23.12.198.36/identity/v3/auth/tokens", + ex_force_base_url="http://23.12.198.36:8774/v2.1", + api_version="2.0", + ex_tenant_name="demo", +) + +pprint(con.list_locations()) +pprint(con.list_images()) +pprint(con.list_nodes()) diff --git a/demos/gce_demo.py b/demos/gce_demo.py index cde874f3b1..d84d19bffa 100755 --- a/demos/gce_demo.py +++ b/demos/gce_demo.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - # This example performs several tasks on Google Compute Platform. It can be # run directly or can be imported into an interactive python session. This # can also serve as live integration tests. @@ -42,68 +41,65 @@ # gce_demo.main_dns() # 'dns only demo # gce_demo.main() # all demos / tests -import os.path import sys -import datetime import time +import os.path +import argparse +import datetime -try: - import argparse -except: - print('This script uses the python "argparse" module. Please use Python ' - '2.7 or greater.') - raise +# Add parent dir of this file's dir to sys.path (OS-agnostically) +sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), os.path.pardir))) + +# isort:skip pragma is needed to make sure those imports are not moved above +# sys.path manipulation code (https://github.com/PyCQA/isort/issues/468) +from libcloud.dns.base import Zone, Record # isort:skip +from libcloud.dns.types import Provider as Provider_dns # isort:skip +from libcloud.common.google import ResourceNotFoundError # isort:skip +from libcloud.compute.types import Provider # isort:skip +from libcloud.dns.providers import get_driver as get_driver_dns # isort:skip +from libcloud.compute.providers import get_driver # isort:skip +from libcloud.loadbalancer.types import Provider as Provider_lb # isort:skip +from libcloud.loadbalancer.providers import get_driver as get_driver_lb # isort:skip try: import secrets except ImportError: - print('"demos/secrets.py" not found.\n\n' - 'Please copy secrets.py-dist to secrets.py and update the GCE* ' - 'values with appropriate authentication information.\n' - 'Additional information about setting these values can be found ' - 'in the docstring for:\n' - 'libcloud/common/google.py\n') + print( + '"demos/secrets.py" not found.\n\n' + "Please copy secrets.py-dist to secrets.py and update the GCE* " + "values with appropriate authentication information.\n" + "Additional information about setting these values can be found " + "in the docstring for:\n" + "libcloud/common/google.py\n" + ) sys.exit(1) -# Add parent dir of this file's dir to sys.path (OS-agnostically) -sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), - os.path.pardir))) - -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver -from libcloud.common.google import ResourceNotFoundError -from libcloud.loadbalancer.types import Provider as Provider_lb -from libcloud.loadbalancer.providers import get_driver as get_driver_lb -from libcloud.dns.types import Provider as Provider_dns -from libcloud.dns.providers import get_driver as get_driver_dns -from libcloud.dns.base import Record, Zone -from libcloud.utils.py3 import PY3 -if PY3: - import urllib.request as url_req -else: - import urllib2 as url_req + +# pylint: disable=no-name-in-module,import-error +import urllib.request as url_req # Maximum number of 1-CPU nodes to allow to run simultaneously MAX_NODES = 5 # String that all resource names created by the demo will start with # WARNING: Any resource that has a matching name will be destroyed. -DEMO_BASE_NAME = 'lct' +DEMO_BASE_NAME = "lct" # Datacenter to create resources in -DATACENTER = 'us-central1-f' +DATACENTER = "us-central1-f" +BACKUP_DATACENTER = "us-east1-c" # Clean up resources at the end (can be set to false in order to # inspect resources at the end of the run). Resources will be cleaned # at the beginning regardless. CLEANUP = True -args = getattr(secrets, 'GCE_PARAMS', ()) -kwargs = getattr(secrets, 'GCE_KEYWORD_PARAMS', {}) +args = getattr(secrets, "GCE_PARAMS", ()) +kwargs = getattr(secrets, "GCE_KEYWORD_PARAMS", {}) # Add datacenter to kwargs for Python 2.5 compatibility kwargs = kwargs.copy() -kwargs['datacenter'] = DATACENTER +kwargs["datacenter"] = DATACENTER # ==== HELPER FUNCTIONS ==== @@ -136,6 +132,52 @@ def get_dns_driver(gce_driver=None): return driver +def create_mig(gce, mig_base_name, zone, template, postfix, num_instances=2): + """ + Creates MIG, sets named ports, modifies various text with 'postfix'. + + :param gce: An initalized GCE driver. + :type gce: :class`GCENodeDriver` + + :param zone: Zone to create Managed Instance Group in. + :type zone: :class:`GCEZone` or ``str`` + + :param template: Instance Template to use in creating MIG. + :type template: :class:`GCEInstanceTemplate` + + :param postfix: string to append to mig name, etc. Example: 'east', + 'central' + :type postfix: ``str`` + + :param num_instances: number of instances to create in MIG. Default is 2. + :type num_instances: ``int`` + + :returns: initialized Managed Instance Group. + :rtype: :class:`GCEInstanceGroupManager` + """ + mig_name = "{}-{}".format(mig_base_name, postfix) + mig = gce.ex_create_instancegroupmanager( + mig_name, + zone, + template, + num_instances, + base_instance_name=mig_name, + description="Demo for %s" % postfix, + ) + display(' Managed Instance Group [{}] "{}" created'.format(postfix.upper(), mig.name)) + display( + " ... MIG instances created: %s" + % ",".join([x["name"] for x in mig.list_managed_instances()]) + ) + + # set the named_ports on the Instance Group. + named_ports = [{"name": "%s-http" % DEMO_BASE_NAME, "port": 80}] + mig.set_named_ports(named_ports=named_ports) + display(" ... MIG ports set: %s" % named_ports) + + return mig + + def display(title, resource_list=[]): """ Display a list of resources. @@ -146,28 +188,114 @@ def display(title, resource_list=[]): :param resource_list: List of resources to display :type resource_list: Any ``object`` with a C{name} attribute """ - print('=> %s' % title) + print("=> %s" % title) for item in resource_list: if isinstance(item, Record): if item.name.startswith(DEMO_BASE_NAME): - print('=> name=%s, type=%s' % (item.name, item.type)) + print("=> name={}, type={}".format(item.name, item.type)) else: - print(' name=%s, type=%s' % (item.name, item.type)) + print(" name={}, type={}".format(item.name, item.type)) elif isinstance(item, Zone): if item.domain.startswith(DEMO_BASE_NAME): - print('=> name=%s, dnsname=%s' % (item.id, item.domain)) + print("=> name={}, dnsname={}".format(item.id, item.domain)) else: - print(' name=%s, dnsname=%s' % (item.id, item.domain)) - elif hasattr(item, 'name'): - if item.domain.startswith(DEMO_BASE_NAME): - print('=> %s' % item.domain) + print(" name={}, dnsname={}".format(item.id, item.domain)) + elif hasattr(item, "name"): + if item.name.startswith(DEMO_BASE_NAME): + print("=> %s" % item.name) else: - print(' %s' % item.domain) + print(" %s" % item.name) else: if item.startswith(DEMO_BASE_NAME): - print('=> %s' % item) + print("=> %s" % item) else: - print(' %s' % item) + print(" %s" % item) + + +def cleanup_only(): + start_time = datetime.datetime.now() + display("Clean-up start time: %s" % str(start_time)) + gce = get_gce_driver() + # Get project info and print name + project = gce.ex_get_project() + display("Project: %s" % project.name) + + # == Get Lists of Everything and Display the lists (up to 10) == + # These can either just return values for the current datacenter (zone) + # or for everything. + all_nodes = gce.list_nodes(ex_zone="all") + display("Nodes:", all_nodes) + + all_addresses = gce.ex_list_addresses(region="all") + display("Addresses:", all_addresses) + + all_volumes = gce.list_volumes(ex_zone="all") + display("Volumes:", all_volumes) + + # This can return everything, but there is a large amount of overlap, + # so we'll just get the sizes from the current zone. + sizes = gce.list_sizes() + display("Sizes:", sizes) + + # These are global + firewalls = gce.ex_list_firewalls() + display("Firewalls:", firewalls) + + networks = gce.ex_list_networks() + display("Networks:", networks) + + images = gce.list_images() + display("Images:", images) + + locations = gce.list_locations() + display("Locations:", locations) + + zones = gce.ex_list_zones() + display("Zones:", zones) + + snapshots = gce.ex_list_snapshots() + display("Snapshots:", snapshots) + + gfrs = gce.ex_list_forwarding_rules(global_rules=True) + display("Global Forwarding Rules", gfrs) + targetproxies = gce.ex_list_targethttpproxies() + display("Target HTTP Proxies", targetproxies) + urlmaps = gce.ex_list_urlmaps() + display("URLMaps", urlmaps) + bes = gce.ex_list_backendservices() + display("Backend Services", bes) + migs = gce.ex_list_instancegroupmanagers(zone="all") + display("Instance Group Managers", migs) + its = gce.ex_list_instancetemplates() + display("Instance Templates", its) + hcs = gce.ex_list_healthchecks() + display("Health Checks", hcs) + + # == Clean up any old demo resources == + display('Cleaning up any "%s" resources' % DEMO_BASE_NAME) + clean_up( + gce, + DEMO_BASE_NAME, + None, + gfrs + targetproxies + urlmaps + bes + hcs + migs + its, + ) + + # == Pause to let cleanup occur and repopulate volume and node lists == + if len(migs): + time.sleep(10) + all_volumes = gce.list_volumes(ex_zone="all") + all_nodes = gce.list_nodes(ex_zone="all") + + clean_up( + gce, + DEMO_BASE_NAME, + all_nodes, + all_addresses + all_volumes + firewalls + networks + snapshots, + ) + volumes = gce.list_volumes() + clean_up(gce, DEMO_BASE_NAME, None, volumes) + end_time = datetime.datetime.now() + display("Total runtime: %s" % str(end_time - start_time)) def clean_up(gce, base_name, node_list=None, resource_list=None): @@ -197,405 +325,668 @@ def clean_up(gce, base_name, node_list=None, resource_list=None): result = gce.ex_destroy_multiple_nodes(del_nodes) for i, success in enumerate(result): if success: - display(' Deleted %s' % del_nodes[i].name) + display(" Deleted %s" % del_nodes[i].name) else: - display(' Failed to delete %s' % del_nodes[i].name) + display(" Failed to delete %s" % del_nodes[i].name) # Destroy everything else with just the destroy method - for resource in resource_list: - if resource.name.startswith(base_name): + for resrc in resource_list: + if resrc.name.startswith(base_name): try: - resource.destroy() + resrc.destroy() + class_name = resrc.__class__.__name__ + display(" Deleted {} ({})".format(resrc.name, class_name)) except ResourceNotFoundError: - display(' Not found: %s(%s)' % (resource.name, - resource.__class__.__name__)) - except: - class_name = resource.__class__.__name__ - display(' Failed to Delete %s(%s)' % (resource.name, - class_name)) + display(" Not found: {} ({})".format(resrc.name, resrc.__class__.__name__)) + except Exception: + class_name = resrc.__class__.__name__ + display(" Failed to Delete {} ({})".format(resrc.name, class_name)) raise -# ==== COMPUTE CODE STARTS HERE ==== def main_compute(): start_time = datetime.datetime.now() - display('Compute demo/test start time: %s' % str(start_time)) + display("Compute demo/test start time: %s" % str(start_time)) gce = get_gce_driver() # Get project info and print name project = gce.ex_get_project() - display('Project: %s' % project.name) + display("Project: %s" % project.name) # == Get Lists of Everything and Display the lists (up to 10) == # These can either just return values for the current datacenter (zone) # or for everything. - all_nodes = gce.list_nodes(ex_zone='all') - display('Nodes:', all_nodes) + all_nodes = gce.list_nodes(ex_zone="all") + display("Nodes:", all_nodes) - all_addresses = gce.ex_list_addresses(region='all') - display('Addresses:', all_addresses) + all_addresses = gce.ex_list_addresses(region="all") + display("Addresses:", all_addresses) - all_volumes = gce.list_volumes(ex_zone='all') - display('Volumes:', all_volumes) + all_volumes = gce.list_volumes(ex_zone="all") + display("Volumes:", all_volumes) # This can return everything, but there is a large amount of overlap, # so we'll just get the sizes from the current zone. sizes = gce.list_sizes() - display('Sizes:', sizes) + display("Sizes:", sizes) # These are global firewalls = gce.ex_list_firewalls() - display('Firewalls:', firewalls) + display("Firewalls:", firewalls) + + subnetworks = gce.ex_list_subnetworks() + display("Subnetworks:", subnetworks) networks = gce.ex_list_networks() - display('Networks:', networks) + display("Networks:", networks) images = gce.list_images() - display('Images:', images) + display("Images:", images) locations = gce.list_locations() - display('Locations:', locations) + display("Locations:", locations) zones = gce.ex_list_zones() - display('Zones:', zones) + display("Zones:", zones) snapshots = gce.ex_list_snapshots() - display('Snapshots:', snapshots) + display("Snapshots:", snapshots) # == Clean up any old demo resources == display('Cleaning up any "%s" resources' % DEMO_BASE_NAME) - clean_up(gce, DEMO_BASE_NAME, all_nodes, - all_addresses + all_volumes + firewalls + networks + snapshots) + # Delete subnetworks first, networks last + clean_up(gce, DEMO_BASE_NAME, None, subnetworks) + clean_up( + gce, + DEMO_BASE_NAME, + all_nodes, + all_addresses + all_volumes + firewalls + snapshots + networks, + ) + + # == Create a Legacy Network == + display("Creating Legacy Network:") + name = "%s-legacy-network" % DEMO_BASE_NAME + cidr = "10.10.0.0/16" + network_legacy = gce.ex_create_network(name, cidr) + display(" Network %s created" % name) + + # == Delete the Legacy Network == + display("Delete Legacy Network:") + network_legacy.destroy() + display(" Network %s delete" % name) + + # == Create an auto network == + display("Creating Auto Network:") + name = "%s-auto-network" % DEMO_BASE_NAME + network_auto = gce.ex_create_network(name, cidr=None, mode="auto") + display(" AutoNetwork %s created" % network_auto.name) + + # == Display subnetworks from the auto network == + subnets = [] + for sn in network_auto.subnetworks: + subnets.append(gce.ex_get_subnetwork(sn)) + display("Display subnetworks:", subnets) + + # == Delete the auto network == + display("Delete Auto Network:") + network_auto.destroy() + display(" AutoNetwork %s deleted" % name) + + # == Create an custom network == + display("Creating Custom Network:") + name = "%s-custom-network" % DEMO_BASE_NAME + network_custom = gce.ex_create_network(name, cidr=None, mode="custom") + display(" Custom Network %s created" % network_custom.name) + + # == Create a subnetwork == + display("Creating Subnetwork:") + sname = "%s-subnetwork" % DEMO_BASE_NAME + region = "us-central1" + cidr = "192.168.17.0/24" + subnet = gce.ex_create_subnetwork(sname, cidr, network_custom, region) + display(" Subnetwork %s created" % subnet.name) + # Refresh object, now that it has a subnet + network_custom = gce.ex_get_network(name) + + # == Display subnetworks from the auto network == + subnets = [] + for sn in network_custom.subnetworks: + subnets.append(gce.ex_get_subnetwork(sn)) + display("Display custom subnetworks:", subnets) + + # == Launch instance in custom subnetwork == + display("Creating Node in custom subnetwork:") + name = "%s-subnet-node" % DEMO_BASE_NAME + node_1 = gce.create_node( + name, + "g1-small", + "debian-8", + ex_disk_auto_delete=True, + ex_network=network_custom, + ex_subnetwork=subnet, + ) + display(" Node %s created" % name) + + # == Destroy instance in custom subnetwork == + display("Destroying Node in custom subnetwork:") + node_1.destroy() + display(" Node %s destroyed" % name) + + # == Delete an subnetwork == + display("Delete Custom Subnetwork:") + subnet.destroy() + display(" Custom Subnetwork %s deleted" % sname) + is_deleted = False + while not is_deleted: + time.sleep(3) + try: + subnet = gce.ex_get_subnetwork(sname, region) + except ResourceNotFoundError: + is_deleted = True + + # == Delete the auto network == + display("Delete Custom Network:") + network_custom.destroy() + display(" Custom Network %s deleted" % name) # == Create Node with disk auto-created == if MAX_NODES > 1: - display('Creating a node with boot/local-ssd using GCE structure:') - name = '%s-gstruct' % DEMO_BASE_NAME + display("Creating a node with boot/local-ssd using GCE structure:") + name = "%s-gstruct" % DEMO_BASE_NAME img_url = "projects/debian-cloud/global/images/" img_url += "backports-debian-7-wheezy-v20141205" - disk_type_url = "projects/graphite-demos/zones/us-central1-f/" + disk_type_url = "projects/%s/zones/us-central1-f/" % project.name disk_type_url += "diskTypes/local-ssd" gce_disk_struct = [ { "type": "PERSISTENT", - "deviceName": '%s-gstruct' % DEMO_BASE_NAME, + "deviceName": "%s-gstruct" % DEMO_BASE_NAME, "initializeParams": { - "diskName": '%s-gstruct' % DEMO_BASE_NAME, - "sourceImage": img_url + "diskName": "%s-gstruct" % DEMO_BASE_NAME, + "sourceImage": img_url, }, "boot": True, - "autoDelete": True + "autoDelete": True, }, { "type": "SCRATCH", - "deviceName": '%s-gstruct-lssd' % DEMO_BASE_NAME, - "initializeParams": { - "diskType": disk_type_url - }, - "autoDelete": True - } + "deviceName": "%s-gstruct-lssd" % DEMO_BASE_NAME, + "initializeParams": {"diskType": disk_type_url}, + "autoDelete": True, + }, ] - node_gstruct = gce.create_node(name, 'n1-standard-1', None, - 'us-central1-f', - ex_disks_gce_struct=gce_disk_struct) - num_disks = len(node_gstruct.extra['disks']) - display(' Node %s created with %d disks' % (node_gstruct.name, - num_disks)) - - display('Creating Node with auto-created SSD:') - name = '%s-np-node' % DEMO_BASE_NAME - node_1 = gce.create_node(name, 'n1-standard-1', 'debian-7', - ex_tags=['libcloud'], ex_disk_type='pd-ssd', - ex_disk_auto_delete=False) - display(' Node %s created' % name) + node_gstruct = gce.create_node( + name, + "n1-standard-1", + None, + "us-central1-f", + ex_disks_gce_struct=gce_disk_struct, + ) + num_disks = len(node_gstruct.extra["disks"]) + display(" Node %s created with %d disks" % (node_gstruct.name, num_disks)) + + display("Creating Node with auto-created SSD:") + name = "%s-np-node" % DEMO_BASE_NAME + node_1 = gce.create_node( + name, + "n1-standard-1", + "debian-7", + ex_tags=["libcloud"], + ex_disk_type="pd-ssd", + ex_disk_auto_delete=False, + ) + display(" Node %s created" % name) + + # Stop the node and change to a custom machine type (e.g. size) + display("Stopping node, setting custom size, starting node:") + name = "%s-np-node" % DEMO_BASE_NAME + gce.ex_stop_node(node_1) + gce.ex_set_machine_type(node_1, "custom-2-4096") # 2 vCPU, 4GB RAM + gce.ex_start_node(node_1) + node_1 = gce.ex_get_node(name) + display(" {}: state={}, size={}".format(name, node_1.extra["status"], node_1.size)) # == Create, and attach a disk == - display('Creating a new disk:') - disk_name = '%s-attach-disk' % DEMO_BASE_NAME + display("Creating a new disk:") + disk_name = "%s-attach-disk" % DEMO_BASE_NAME volume = gce.create_volume(10, disk_name) - if volume.attach(node_1): - display(' Attached %s to %s' % (volume.name, node_1.name)) - display(' Disabled auto-delete for %s on %s' % (volume.name, - node_1.name)) + if gce.attach_volume(node_1, volume, ex_auto_delete=True): + display(" Attached {} to {}".format(volume.name, node_1.name)) + display(" Disabled auto-delete for {} on {}".format(volume.name, node_1.name)) gce.ex_set_volume_auto_delete(volume, node_1, auto_delete=False) if CLEANUP: # == Detach the disk == if gce.detach_volume(volume, ex_node=node_1): - display(' Detached %s from %s' % (volume.name, - node_1.name)) + display(" Detached {} from {}".format(volume.name, node_1.name)) # == Create Snapshot == - display('Creating a snapshot from existing disk:') + display("Creating a snapshot from existing disk:") # Create a disk to snapshot - vol_name = '%s-snap-template' % DEMO_BASE_NAME - image = gce.ex_get_image('debian-7') + vol_name = "%s-snap-template" % DEMO_BASE_NAME + image = gce.ex_get_image("debian-7") vol = gce.create_volume(None, vol_name, image=image) - display('Created disk %s to shapshot:' % DEMO_BASE_NAME) + display("Created disk %s to shapshot:" % DEMO_BASE_NAME) # Snapshot volume - snapshot = vol.snapshot('%s-snapshot' % DEMO_BASE_NAME) - display(' Snapshot %s created' % snapshot.name) + snapshot = vol.snapshot("%s-snapshot" % DEMO_BASE_NAME) + display(" Snapshot %s created" % snapshot.name) # == Create Node with existing disk == - display('Creating Node with existing disk:') - name = '%s-persist-node' % DEMO_BASE_NAME + display("Creating Node with existing disk:") + name = "%s-persist-node" % DEMO_BASE_NAME # Use objects this time instead of names # Get latest Debian 7 image - image = gce.ex_get_image('debian-7') + image = gce.ex_get_image("debian-7") # Get Machine Size - size = gce.ex_get_size('n1-standard-1') + size = gce.ex_get_size("n1-standard-1") # Create Disk from Snapshot created above - volume_name = '%s-boot-disk' % DEMO_BASE_NAME + volume_name = "%s-boot-disk" % DEMO_BASE_NAME volume = gce.create_volume(None, volume_name, snapshot=snapshot) - display(' Created %s from snapshot' % volume.name) + display(" Created %s from snapshot" % volume.name) # Create Node with Disk - node_2 = gce.create_node(name, size, image, ex_tags=['libcloud'], - ex_boot_disk=volume, - ex_disk_auto_delete=False) - display(' Node %s created with attached disk %s' % (node_2.name, - volume.name)) + node_2 = gce.create_node( + name, + size, + image, + ex_tags=["libcloud"], + ex_boot_disk=volume, + ex_disk_auto_delete=False, + ) + display(" Node {} created with attached disk {}".format(node_2.name, volume.name)) # == Update Tags for Node == - display('Updating Tags for %s:' % node_2.name) - tags = node_2.extra['tags'] - tags.append('newtag') + display("Updating Tags for %s:" % node_2.name) + tags = node_2.extra["tags"] + tags.append("newtag") if gce.ex_set_node_tags(node_2, tags): - display(' Tags updated for %s' % node_2.name) + display(" Tags updated for %s" % node_2.name) check_node = gce.ex_get_node(node_2.name) - display(' New tags: %s' % check_node.extra['tags']) + display(" New tags: %s" % check_node.extra["tags"]) # == Setting Metadata for Node == - display('Setting Metadata for %s:' % node_2.name) - if gce.ex_set_node_metadata(node_2, {'foo': 'bar', 'baz': 'foobarbaz'}): - display(' Metadata updated for %s' % node_2.name) + display("Setting Metadata for %s:" % node_2.name) + if gce.ex_set_node_metadata(node_2, {"foo": "bar", "baz": "foobarbaz"}): + display(" Metadata updated for %s" % node_2.name) check_node = gce.ex_get_node(node_2.name) - display(' New Metadata: %s' % check_node.extra['metadata']) + display(" New Metadata: %s" % check_node.extra["metadata"]) # == Create Multiple nodes at once == - base_name = '%s-multiple-nodes' % DEMO_BASE_NAME + base_name = "%s-multiple-nodes" % DEMO_BASE_NAME number = MAX_NODES - 2 if number > 0: - display('Creating Multiple Nodes (%s):' % number) - multi_nodes = gce.ex_create_multiple_nodes(base_name, size, image, - number, - ex_tags=['libcloud'], - ex_disk_auto_delete=True) + display("Creating Multiple Nodes (%s):" % number) + multi_nodes = gce.ex_create_multiple_nodes( + base_name, + size, + image, + number, + ex_tags=["libcloud"], + ex_disk_auto_delete=True, + ) for node in multi_nodes: - display(' Node %s created' % node.name) + display(" Node %s created" % node.name) # == Create a Network == - display('Creating Network:') - name = '%s-network' % DEMO_BASE_NAME - cidr = '10.10.0.0/16' + display("Creating Network:") + name = "%s-network" % DEMO_BASE_NAME + cidr = "10.10.0.0/16" network_1 = gce.ex_create_network(name, cidr) - display(' Network %s created' % network_1.name) + display(" Network %s created" % network_1.name) # == Create a Firewall == - display('Creating a Firewall:') - name = '%s-firewall' % DEMO_BASE_NAME - allowed = [{'IPProtocol': 'tcp', - 'ports': ['3141']}] - firewall_1 = gce.ex_create_firewall(name, allowed, network=network_1, - source_tags=['libcloud']) - display(' Firewall %s created' % firewall_1.name) + display("Creating a Firewall:") + name = "%s-firewall" % DEMO_BASE_NAME + allowed = [{"IPProtocol": "tcp", "ports": ["3141"]}] + firewall_1 = gce.ex_create_firewall(name, allowed, network=network_1, source_tags=["libcloud"]) + display(" Firewall %s created" % firewall_1.name) # == Create a Static Address == - display('Creating an Address:') - name = '%s-address' % DEMO_BASE_NAME + display("Creating an Address:") + name = "%s-address" % DEMO_BASE_NAME address_1 = gce.ex_create_address(name) - display(' Address %s created with IP %s' % (address_1.name, - address_1.address)) + display(" Address {} created with IP {}".format(address_1.name, address_1.address)) # == List Updated Resources in current zone/region == - display('Updated Resources in current zone/region') + display("Updated Resources in current zone/region") nodes = gce.list_nodes() - display('Nodes:', nodes) + display("Nodes:", nodes) addresses = gce.ex_list_addresses() - display('Addresses:', addresses) + display("Addresses:", addresses) firewalls = gce.ex_list_firewalls() - display('Firewalls:', firewalls) + display("Firewalls:", firewalls) + + subnetworks = gce.ex_list_subnetworks() + display("Subnetworks:", subnetworks) networks = gce.ex_list_networks() - display('Networks:', networks) + display("Networks:", networks) snapshots = gce.ex_list_snapshots() - display('Snapshots:', snapshots) + display("Snapshots:", snapshots) if CLEANUP: - display('Cleaning up %s resources created' % DEMO_BASE_NAME) - clean_up(gce, DEMO_BASE_NAME, nodes, - addresses + firewalls + networks + snapshots) + display("Cleaning up %s resources created" % DEMO_BASE_NAME) + clean_up(gce, DEMO_BASE_NAME, None, subnetworks) + clean_up(gce, DEMO_BASE_NAME, nodes, addresses + firewalls + snapshots + networks) volumes = gce.list_volumes() clean_up(gce, DEMO_BASE_NAME, None, volumes) end_time = datetime.datetime.now() - display('Total runtime: %s' % str(end_time - start_time)) + display("Total runtime: %s" % str(end_time - start_time)) # ==== LOAD BALANCER CODE STARTS HERE ==== def main_load_balancer(): start_time = datetime.datetime.now() - display('Load-balancer demo/test start time: %s' % str(start_time)) + display("Load-balancer demo/test start time: %s" % str(start_time)) gce = get_gce_driver() gcelb = get_gcelb_driver(gce) # Get project info and print name project = gce.ex_get_project() - display('Project: %s' % project.name) + display("Project: %s" % project.name) # Existing Balancers balancers = gcelb.list_balancers() - display('Load Balancers', balancers) + display("Load Balancers", balancers) # Protocols protocols = gcelb.list_protocols() - display('Protocols', protocols) + display("Protocols", protocols) # Healthchecks healthchecks = gcelb.ex_list_healthchecks() - display('Health Checks', healthchecks) + display("Health Checks", healthchecks) # This demo is based on the GCE Load Balancing Quickstart described here: # https://developers.google.com/compute/docs/load-balancing/lb-quickstart # == Clean-up and existing demo resources == - all_nodes = gce.list_nodes(ex_zone='all') + all_nodes = gce.list_nodes(ex_zone="all") firewalls = gce.ex_list_firewalls() display('Cleaning up any "%s" resources' % DEMO_BASE_NAME) - clean_up(gce, DEMO_BASE_NAME, all_nodes, - balancers + healthchecks + firewalls) + clean_up(gce, DEMO_BASE_NAME, all_nodes, balancers + healthchecks + firewalls) # == Create 3 nodes to balance between == - startup_script = ('apt-get -y update && ' - 'apt-get -y install apache2 && ' - 'hostname > /var/www/index.html') - tag = '%s-www' % DEMO_BASE_NAME - base_name = '%s-www' % DEMO_BASE_NAME - image = gce.ex_get_image('debian-7') - size = gce.ex_get_size('n1-standard-1') + startup_script = ( + "apt-get -y update && " "apt-get -y install apache2 && " "hostname > /var/www/index.html" + ) + tag = "%s-www" % DEMO_BASE_NAME + base_name = "%s-www" % DEMO_BASE_NAME + image = gce.ex_get_image("debian-7") + size = gce.ex_get_size("n1-standard-1") number = 3 - metadata = {'items': [{'key': 'startup-script', - 'value': startup_script}]} - lb_nodes = gce.ex_create_multiple_nodes(base_name, size, image, - number, ex_tags=[tag], - ex_metadata=metadata, - ignore_errors=False) - display('Created Nodes', lb_nodes) + display("Creating %d nodes" % number) + metadata = {"items": [{"key": "startup-script", "value": startup_script}]} + lb_nodes = gce.ex_create_multiple_nodes( + base_name, + size, + image, + number, + ex_tags=[tag], + ex_metadata=metadata, + ex_disk_auto_delete=True, + ignore_errors=False, + ) + display("Created Nodes", lb_nodes) # == Create a Firewall for instances == - display('Creating a Firewall') - name = '%s-firewall' % DEMO_BASE_NAME - allowed = [{'IPProtocol': 'tcp', - 'ports': ['80']}] - firewall = gce.ex_create_firewall(name, allowed, source_tags=[tag]) - display(' Firewall %s created' % firewall.name) + display("Creating a Firewall") + name = "%s-firewall" % DEMO_BASE_NAME + allowed = [{"IPProtocol": "tcp", "ports": ["80"]}] + firewall = gce.ex_create_firewall(name, allowed, target_tags=[tag]) + display(" Firewall %s created" % firewall.name) # == Create a Health Check == - display('Creating a HealthCheck') - name = '%s-healthcheck' % DEMO_BASE_NAME + display("Creating a HealthCheck") + name = "%s-healthcheck" % DEMO_BASE_NAME # These are all the default values, but listed here as an example. To # create a healthcheck with the defaults, only name is required. - hc = gcelb.ex_create_healthcheck(name, host=None, path='/', port='80', - interval=5, timeout=5, - unhealthy_threshold=2, - healthy_threshold=2) - display('Healthcheck %s created' % hc.name) + hc = gcelb.ex_create_healthcheck( + name, + host=None, + path="/", + port="80", + interval=5, + timeout=5, + unhealthy_threshold=2, + healthy_threshold=2, + ) + display("Healthcheck %s created" % hc.name) # == Create Load Balancer == - display('Creating Load Balancer') - name = '%s-lb' % DEMO_BASE_NAME + display("Creating Load Balancer") + name = "%s-lb" % DEMO_BASE_NAME port = 80 - protocol = 'tcp' + protocol = "tcp" algorithm = None members = lb_nodes[:2] # Only attach the first two initially healthchecks = [hc] - balancer = gcelb.create_balancer(name, port, protocol, algorithm, members, - ex_healthchecks=healthchecks) - display(' Load Balancer %s created' % balancer.name) + balancer = gcelb.create_balancer( + name, port, protocol, algorithm, members, ex_healthchecks=healthchecks + ) + display(" Load Balancer %s created" % balancer.name) # == Attach third Node == - display('Attaching additional node to Load Balancer') + display("Attaching additional node to Load Balancer") member = balancer.attach_compute_node(lb_nodes[2]) - display(' Attached %s to %s' % (member.id, balancer.name)) + display(" Attached {} to {}".format(member.id, balancer.name)) # == Show Balancer Members == members = balancer.list_members() - display('Load Balancer Members') + display("Load Balancer Members") for member in members: - display(' ID: %s IP: %s' % (member.id, member.ip)) + display(" ID: {} IP: {}".format(member.id, member.ip)) # == Remove a Member == - display('Removing a Member') + display("Removing a Member") detached = members[0] detach = balancer.detach_member(detached) if detach: - display(' Member %s detached from %s' % (detached.id, - balancer.name)) + display(" Member {} detached from {}".format(detached.id, balancer.name)) # == Show Updated Balancer Members == members = balancer.list_members() - display('Updated Load Balancer Members') + display("Updated Load Balancer Members") for member in members: - display(' ID: %s IP: %s' % (member.id, member.ip)) + display(" ID: {} IP: {}".format(member.id, member.ip)) # == Reattach Member == - display('Reattaching Member') + display("Reattaching Member") member = balancer.attach_member(detached) - display(' Member %s attached to %s' % (member.id, balancer.name)) + display(" Member {} attached to {}".format(member.id, balancer.name)) # == Test Load Balancer by connecting to it multiple times == PAUSE = 60 - display('Sleeping for %d seconds for LB members to serve...' % PAUSE) + display("Sleeping for %d seconds for LB members to serve..." % PAUSE) time.sleep(PAUSE) rounds = 200 - url = 'http://%s/' % balancer.ip + url = "http://%s/" % balancer.ip line_length = 75 - display('Connecting to %s %s times' % (url, rounds)) + display("Connecting to {} {} times".format(url, rounds)) for x in range(rounds): response = url_req.urlopen(url) - if PY3: - output = str(response.read(), encoding='utf-8').strip() - else: - output = response.read().strip() - if 'www-001' in output: + output = str(response.read(), encoding="utf-8").strip() + if "www-001" in output: padded_output = output.center(line_length) - elif 'www-002' in output: + elif "www-002" in output: padded_output = output.rjust(line_length) else: padded_output = output.ljust(line_length) - sys.stdout.write('\r%s' % padded_output) + sys.stdout.write("\r%s" % padded_output) sys.stdout.flush() - time.sleep(.25) + time.sleep(0.25) - print "" + print("") if CLEANUP: balancers = gcelb.list_balancers() healthchecks = gcelb.ex_list_healthchecks() - nodes = gce.list_nodes(ex_zone='all') + nodes = gce.list_nodes(ex_zone="all") firewalls = gce.ex_list_firewalls() - display('Cleaning up %s resources created' % DEMO_BASE_NAME) - clean_up(gce, DEMO_BASE_NAME, nodes, - balancers + healthchecks + firewalls) + display("Cleaning up %s resources created" % DEMO_BASE_NAME) + clean_up(gce, DEMO_BASE_NAME, nodes, balancers + healthchecks + firewalls) end_time = datetime.datetime.now() - display('Total runtime: %s' % str(end_time - start_time)) + display("Total runtime: %s" % str(end_time - start_time)) + + +# ==== BACKEND SERVICE LOAD BALANCER CODE STARTS HERE ==== +def main_backend_service(): + start_time = datetime.datetime.now() + display("Backend Service w/Global Forwarding Rule demo/test start time: %s" % str(start_time)) + gce = get_gce_driver() + # Get project info and print name + project = gce.ex_get_project() + display("Project: %s" % project.name) + + # Based on the instructions at: + # https://cloud.google.com/compute/docs/load-balancing/http/#overview + + zone_central = DATACENTER + zone_east = BACKUP_DATACENTER + it_name = "%s-instancetemplate" % DEMO_BASE_NAME + mig_name = "%s-mig" % DEMO_BASE_NAME + hc_name = "%s-healthcheck" % DEMO_BASE_NAME + bes_name = "%s-bes" % DEMO_BASE_NAME + urlmap_name = "%s-urlmap" % DEMO_BASE_NAME + targethttpproxy_name = "%s-httptargetproxy" % DEMO_BASE_NAME + address_name = "%s-address" % DEMO_BASE_NAME + gfr_name = "%s-gfr" % DEMO_BASE_NAME + firewall_name = "%s-firewall" % DEMO_BASE_NAME + + startup_script = ( + "apt-get -y update && " + "apt-get -y install apache2 && " + 'echo "$(hostname)" > /var/www/html/index.html' + ) + tag = "%s-mig-www" % DEMO_BASE_NAME + metadata = {"items": [{"key": "startup-script", "value": startup_script}]} + + mig_central = None + mig_east = None + bes = None + urlmap = None + tp = None + address = None + gfr = None + firewall = None + + display("Create a BackendService") + # == Create an Instance Template == + it = gce.ex_create_instancetemplate( + it_name, + size="n1-standard-1", + image="debian-8", + network="default", + metadata=metadata, + tags=[tag], + ) + display(' InstanceTemplate "%s" created' % it.name) + + # == Create a MIG == + mig_central = create_mig(gce, mig_name, zone_central, it, "central") + mig_east = create_mig(gce, mig_name, zone_east, it, "east") + + # == Create a Health Check == + hc = gce.ex_create_healthcheck( + hc_name, + host=None, + path="/", + port="80", + interval=30, + timeout=10, + unhealthy_threshold=10, + healthy_threshold=1, + ) + display(" Healthcheck %s created" % hc.name) + + # == Create a Backend Service == + be_central = gce.ex_create_backend(instance_group=mig_central.instance_group) + be_east = gce.ex_create_backend(instance_group=mig_east.instance_group) + bes = gce.ex_create_backendservice( + bes_name, + [hc], + backends=[be_central, be_east], + port_name="%s-http" % DEMO_BASE_NAME, + protocol="HTTP", + description="%s bes desc" % DEMO_BASE_NAME, + timeout_sec=60, + enable_cdn=False, + ) + display(' Backend Service "%s" created' % bes.name) + + # == Create a URLMap == + urlmap = gce.ex_create_urlmap(urlmap_name, default_service=bes) + display(' URLMap "%s" created' % urlmap.name) + + # == Create a Target (HTTP) Proxy == + tp = gce.ex_create_targethttpproxy(targethttpproxy_name, urlmap) + display(' TargetProxy "%s" created' % tp.name) + + # == Create a Static Address == + address = gce.ex_create_address(address_name, region="global") + display(' Address "{}" created with IP "{}"'.format(address.name, address.address)) + # == Create a Global Forwarding Rule == + gfr = gce.ex_create_forwarding_rule( + gfr_name, + target=tp, + address=address, + port_range="80", + description="%s libcloud forwarding rule http test" % DEMO_BASE_NAME, + global_rule=True, + ) + display(' Global Forwarding Rule "%s" created' % (gfr.name)) + + # == Create a Firewall for instances == + allowed = [{"IPProtocol": "tcp", "ports": ["80"]}] + firewall = gce.ex_create_firewall(firewall_name, allowed, target_tags=[tag]) + display(" Firewall %s created" % firewall.name) + + # TODO(supertom): launch instances to demostrate that it works + # take backends out of service. Adding in this functionality + # will also add 10-15 minutes to the demo. + # display("Sleeping for 10 minutes, starting at %s" % + # str(datetime.datetime.now())) + # time.sleep(600) + + if CLEANUP: + display("Cleaning up %s resources created" % DEMO_BASE_NAME) + clean_up( + gce, + DEMO_BASE_NAME, + None, + resource_list=[ + firewall, + gfr, + address, + tp, + urlmap, + bes, + hc, + mig_central, + mig_east, + it, + ], + ) + end_time = datetime.datetime.now() + display("Total runtime: %s" % str(end_time - start_time)) # ==== GOOGLE DNS CODE STARTS HERE ==== def main_dns(): start_time = datetime.datetime.now() - display('DNS demo/test start time: %s' % str(start_time)) + display("DNS demo/test start time: %s" % str(start_time)) gce = get_gce_driver() gdns = get_dns_driver() # Get project info and print name project = gce.ex_get_project() - display('Project: %s' % project.name) + display("Project: %s" % project.name) # Get list of managed zones zones = gdns.iterate_zones() - display('Zones', zones) + display("Zones", zones) # Get list of records zones = gdns.iterate_zones() @@ -610,25 +1001,48 @@ def main_dns(): # and propagation delays will introduce limits on what can be tested. end_time = datetime.datetime.now() - display('Total runtime: %s' % str(end_time - start_time)) - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description='Google Cloud Platform Demo / Live Test Script') - parser.add_argument("--skip-compute", - help="skip compute demo / live tests", - dest="compute", action="store_false") - parser.add_argument("--skip-load-balancer", - help="skip load-balancer demo / live tests", - dest="lb", action="store_false") - parser.add_argument("--skip-dns", - help="skip DNS demo / live tests", - dest="dns", action="store_false") + display("Total runtime: %s" % str(end_time - start_time)) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Google Cloud Platform Demo / Live Test Script") + parser.add_argument( + "--compute", + help="perform compute demo / live tests", + dest="compute", + action="store_true", + ) + parser.add_argument( + "--load-balancer", + help="perform load-balancer demo / live tests", + dest="lb", + action="store_true", + ) + parser.add_argument( + "--backend-service", + help="perform backend-service demo / live tests", + dest="bes", + action="store_true", + ) + parser.add_argument( + "--dns", help="perform DNS demo / live tests", dest="dns", action="store_true" + ) + parser.add_argument( + "--cleanup-only", + help="perform clean-up (skips all tests)", + dest="cleanup", + action="store_true", + ) cl_args = parser.parse_args() - if cl_args.compute: - main_compute() - if cl_args.lb: - main_load_balancer() - if cl_args.dns: - main_dns() + if cl_args.cleanup: + cleanup_only() + else: + if cl_args.compute: + main_compute() + if cl_args.lb: + main_load_balancer() + if cl_args.dns: + main_dns() + if cl_args.bes: + main_backend_service() diff --git a/demos/secrets.py-dist b/demos/secrets.py-dist index 981286da0e..9cee1e5434 100644 --- a/demos/secrets.py-dist +++ b/demos/secrets.py-dist @@ -16,14 +16,12 @@ # Make a copy of this file named 'secrets.py' and add your credentials there. # Note you can run unit tests without setting your credentials. -BLUEBOX_PARAMS = ('customer_id', 'api_key') BRIGHTBOX_PARAMS = ('client_id', 'client_secret') -DREAMHOST_PARAMS = ('key',) EC2_PARAMS = ('access_id', 'secret') -ECP_PARAMS = ('user_name', 'password') GANDI_PARAMS = ('user',) -GCE_PARAMS = ('email@developer.gserviceaccount.com', 'key') # Service Account Authentication -#GCE_PARAMS = ('client_id', 'client_secret') # Installed App Authentication +# Service Account Authentication +GCE_PARAMS = ('email@developer.gserviceaccount.com', 'key') +# GCE_PARAMS = ('client_id', 'client_secret') # Installed App Authentication GCE_KEYWORD_PARAMS = {'project': 'project_name'} HOSTINGCOM_PARAMS = ('user', 'secret') IBM_PARAMS = ('user', 'secret') @@ -33,7 +31,5 @@ OPENNEBULA_PARAMS = ('user', 'key') OPSOURCE_PARAMS = ('user', 'password') RACKSPACE_PARAMS = ('user', 'key') SLICEHOST_PARAMS = ('key',) -SOFTLAYER_PARAMS = ('user', 'api_key') VCLOUD_PARAMS = ('user', 'secret') -VOXEL_PARAMS = ('key', 'secret') VPSNET_PARAMS = ('user', 'key') diff --git a/dist/deploy.sh b/dist/deploy.sh new file mode 100755 index 0000000000..107ef01908 --- /dev/null +++ b/dist/deploy.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -e + +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) + +pushd "${SCRIPT_DIR}/../" + +# We redirect stderr to /dev/null since sometimes setuptools may print pyproject +# related warning +VERSION=$(grep -Po '(?<=^__version__ = ")[^"]+' libcloud/__init__.py) +popd + +pushd "${SCRIPT_DIR}" + +echo "Uploading packages" +# shellcheck disable=SC2086 +ls ./*$VERSION*.tar.gz ./*$VERSION*.whl ./*$VERSION*.tar.gz.asc +# shellcheck disable=SC2086 +twine check ./*$VERSION*.tar.gz ./*$VERSION*.whl +# shellcheck disable=SC2086 +twine upload ./*$VERSION*.tar.gz ./*$VERSION*.whl ./*$VERSION*.tar.gz.asc + +popd diff --git a/dist/hash-sign.sh b/dist/hash-sign.sh deleted file mode 100755 index 840b6a8921..0000000000 --- a/dist/hash-sign.sh +++ /dev/null @@ -1,147 +0,0 @@ -#!/bin/sh -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# hash-sign.sh : hash and sign the specified files -# -# USAGE: hash-sign.sh file1 file2 ... -# - -user="" -case "$1" in - -u) - shift - user="$1" - shift - ;; -esac - -allfiles=$* - - -split="---------------------------------------------------------------------" - -echo $split -echo "" -echo "Generating MD5/SHA1 checksum files ..." -echo "" - -# check for executables -gpg="`which gpg 2> /dev/null | head -1`" -pgp="`which pgp 2> /dev/null | head -1`" -openssl="`which openssl 2> /dev/null | head -1`" -md5sum="`which md5sum 2> /dev/null | head -1`" -sha1sum="`which sha1sum 2> /dev/null | head -1`" -md5="`which md5 2> /dev/null | head -1`" -sha1="`which sha1 2> /dev/null | head -1`" - -# if found we use openssl for generating the checksums -# and convert the results into machine-readable format. -if test -x "${openssl}"; then - for file in ${allfiles}; do - if test -f "${file}"; then - echo "openssl: creating md5 checksum file for ${file} ..." - ${openssl} md5 ${file} |\ - sed -e 's#^MD5(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.md5 - echo "openssl: creating sha1 checksum file for ${file} ..." - ${openssl} sha1 ${file} |\ - sed -e 's#^SHA1(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha1 - fi - done -# no openssl found - check if we have gpg -elif test -x "${gpg}"; then - for file in ${allfiles}; do - if test -f "${file}"; then - echo "gpg: creating md5 checksum file for ${file} ..." - ${gpg} --print-md md5 ${file} |\ - sed -e '{N;s#\n##;}' |\ - sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \ - -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.md5 - echo "gpg: creating sha1 checksum file for ${file} ..." - ${gpg} --print-md sha1 ${file} |\ - sed -e '{N;s#\n##;}' |\ - sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \ - -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.sha1 - fi - done -else - # no openssl or gpg found - check for md5sum - if test -x "${md5sum}"; then - for file in ${allfiles}; do - if test -f "${file}"; then - echo "md5sum: creating md5 checksum file for ${file} ..." - ${md5sum} -b ${file} > ${file}.md5 - fi - done - # no openssl or gpg found - check for md5 - elif test -x "${md5}"; then - for file in ${allfiles}; do - if test -f "${file}"; then - echo "md5: creating md5 checksum file for ${file} ..." - ${md5} -r ${file} | sed -e 's# # *#' > ${file}.md5 - fi - done - fi - # no openssl or gpg found - check for sha1sum - if test -x "${sha1sum}"; then - for file in ${allfiles}; do - if test -f "${file}"; then - echo "sha1sum: creating sha1 checksum file for ${file} ..." - ${sha1sum} -b ${file} > ${file}.sha1 - fi - done - # no openssl or gpg found - check for sha1 - elif test -x "${sha1}"; then - for file in ${allfiles}; do - if test -f "${file}"; then - echo "sha1: creating sha1 checksum file for ${file} ..." - ${sha1} -r ${file} | sed -e 's# # *#' > ${file}.sha1 - fi - done - fi -fi - -echo $split -echo "" -echo "Signing the files ..." -echo "" - -# if found we use pgp for signing the files -if test -x "${pgp}"; then - if test -n "${user}"; then - args="-u ${user}" - fi - for file in ${allfiles}; do - if test -f "${file}"; then - echo "pgp: creating asc signature file for ${file} ..." - ${pgp} -sba ${file} ${args} - fi - done -# no pgp found - check for gpg -elif test -x "${gpg}"; then - if test -z "${user}"; then - args="--default-key ${args}" - else - args="-u ${user} ${args}" - fi - for file in ${allfiles}; do - if test -f "${file}"; then - echo "gpg: creating asc signature file for ${file} ..." - ${gpg} --armor ${args} --detach-sign ${file} - fi - done -else - echo "PGP or GnuPG not found! Not signing release!" -fi diff --git a/dist/hash.py b/dist/hash.py new file mode 100755 index 0000000000..05f317ac29 --- /dev/null +++ b/dist/hash.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +"""Writes SHA-256 and SHA-512 hashes of files passed as arguments""" + +import hashlib +import sys + +for path in sys.argv[1:]: + for ext, hash in [('sha256', hashlib.sha256), ('sha512', hashlib.sha512)]: + written = '{}.{}'.format(path, ext) + with open(path, 'rb') as fin, open(written, 'w') as fout: + digest = hash(fin.read()).hexdigest() + print('{} *{}'.format(digest, path), file=fout) diff --git a/dist/release.sh b/dist/release.sh index 7d2aaaef24..a2e8fb0fc8 100755 --- a/dist/release.sh +++ b/dist/release.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. @@ -13,9 +13,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - set -e +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) + user="" case "$1" in -u) @@ -30,11 +31,15 @@ if test -z "${user}"; then exit 1 fi -cd .. +pushd "${SCRIPT_DIR}/../" + +python -m build + +popd -python setup.py sdist --formats=bztar,zip,gztar -python setup.py bdist_wheel +pushd "${SCRIPT_DIR}" -cd dist +./hash.py ./*.tar.gz ./*.whl +./sign.sh -u "${user}" ./*.tar.gz ./*.whl -./hash-sign.sh -u ${user} *.tar.bz2 *.tar.gz *.zip *.whl +popd diff --git a/dist/sign.sh b/dist/sign.sh new file mode 100755 index 0000000000..faaa73703f --- /dev/null +++ b/dist/sign.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# sign.sh : sign the specified files +# +# USAGE: sign.sh -u user file1 file2 ... +# +set -e + +user="" +case "$1" in + -u) + shift + user="$1" + shift + ;; +esac + +allfiles=$* + + + +gpg=$(which gpg 2> /dev/null | head -1) +pgp=$(which pgp 2> /dev/null | head -1) + +echo "---------------------------------------------------------------------" +echo "" +echo "Signing the files ..." +echo "" + +# if found we use pgp for signing the files +if test -x "${pgp}"; then + if test -n "${user}"; then + args="-u ${user}" + fi + for file in ${allfiles}; do + if test -f "${file}"; then + echo "pgp: creating asc signature file for ${file} ..." + # shellcheck disable=SC2086 + "${pgp}" -sba "${file}" ${args} + fi + done +# no pgp found - check for gpg +elif test -x "${gpg}"; then + if test -z "${user}"; then + args="--default-key ${args}" + else + args="-u ${user} ${args}" + fi + for file in ${allfiles}; do + if test -f "${file}"; then + echo "gpg: creating asc signature file for ${file} ..." + # shellcheck disable=SC2086 + "${gpg}" --armor ${args} --detach-sign "${file}" + fi + done +else + echo "PGP or GnuPG not found! Not signing release!" +fi diff --git a/dist/verify_checksums.sh b/dist/verify_checksums.sh index c739dd12b8..24babf328f 100755 --- a/dist/verify_checksums.sh +++ b/dist/verify_checksums.sh @@ -15,24 +15,49 @@ # limitations under the license. # This script downloads release artifacts from Apache server and PyPi server and -# verifies that the MD5 checksum of both archives matches. +# verifies that the SHA512 checksum of both archives matches. VERSION=$1 -if [ ! ${VERSION} ]; then +if [ ! "${VERSION}" ]; then echo "Usage: ${0} " - echo "For example: ${0} apache-libcloud-0.13.2" + echo "For example: ${0} apache-libcloud-3.7.0" exit 1 fi -TMP_DIR=`mktemp -d` +TMP_DIR=$(mktemp -d) -EXTENSIONS[0]="tar.gz" -EXTENSIONS[1]="tar.bz2" -EXTENSIONS[2]="zip" +# TODO: Use json endpoint + jq to parse out the url +# https://pypi.org/pypi/apache-libcloud/3.4.0/json +EXTENSIONS[0]=".tar.gz" +EXTENSIONS[1]=".whl" -APACHE_MIRROR_URL="http://www.apache.org/dist/libcloud" -PYPI_MIRROR_URL="https://pypi.python.org/packages/source/a/apache-libcloud" +# Get the download URL for the given extension from PyPi JSON API +function get_pypi_url() { + local extension=$1 + local pypi_version + + pypi_version=$(echo "${VERSION}" | sed -E "s/^apache[-_]libcloud-//") + + curl -s "https://pypi.org/pypi/apache-libcloud/${pypi_version}/json" | \ + jq -r --arg ext "${extension}" \ + '.urls[] | select(.filename | endswith($ext)) | .url' | \ + head -n 1 +} + +# Get the download URL for the given extension from Apache mirror +function get_apache_url() { + local extension=$1 + local apache_version + + apache_version=$(echo "${VERSION}" | sed -E "s/^apache[-_]libcloud-//") + + # List files from Apache directory and find the matching file + curl -s "https://downloads.apache.org/libcloud/" | \ + grep -oP "href=\"\K[^\"]*-${apache_version}[^\"]*${extension}" | \ + head -n 1 | \ + sed "s|^|https://downloads.apache.org/libcloud/|" +} # From http://tldp.org/LDP/abs/html/debugging.html#ASSERT function assert () # If condition false, @@ -49,7 +74,7 @@ function assert () # If condition false, lineno=$2 - if [ ! $1 ] + if [ ! "$1" ] then echo "Assertion failed: \"$1\"" echo "File \"$0\", line $lineno" # Give name of file and line number. @@ -65,10 +90,20 @@ echo "" for (( i = 0 ; i < ${#EXTENSIONS[@]} ; i++ )) do extension=${EXTENSIONS[$i]} - file_name="${VERSION}.${extension}" + file_name="${VERSION}${extension}" + + if [ "${extension}" = ".whl" ]; then + # shellcheck disable=SC2001 + file_name=$(echo "${file_name}" | sed "s/apache-libcloud/apache_libcloud/g") + fi - apache_url="${APACHE_MIRROR_URL}/${file_name}" - pypi_url="${PYPI_MIRROR_URL}/${file_name}" + apache_url=$(get_apache_url "${extension}") + pypi_url=$(get_pypi_url "${extension}") + + if [ -z "${pypi_url}" ]; then + echo "[ERR] Failed to resolve PyPi URL for ${file_name}" + exit 2 + fi assert "${apache_url} != ${pypi_url}", "URLs must be different" @@ -85,6 +120,7 @@ do echo "Downloading file from Apache mirror..." wget --quiet "${apache_url}" -O "${file_path_apache}" + # shellcheck disable=SC2181 if [ $? -ne 0 ]; then echo "[ERR] Failed to download file: ${apache_url}" exit 2 @@ -93,22 +129,23 @@ do echo "Downloading file from PyPi mirror..." wget --quiet "${pypi_url}" -O "${file_path_pypi}" + # shellcheck disable=SC2181 if [ $? -ne 0 ]; then echo "[ERR] Failed to download file: ${pypi_url}" exit 2 fi - md5sum_apache=$(md5sum "${file_path_apache}" | awk '{ print $1 }') - md5sum_pypi=$(md5sum "${file_path_pypi}"| awk '{ print $1 }') + sha512sum_apache=$(sha512sum "${file_path_apache}" | awk '{ print $1 }') + sha512sum_pypi=$(sha512sum "${file_path_pypi}"| awk '{ print $1 }') - if [ ${md5sum_apache} != ${md5sum_pypi} ]; then - echo "[ERROR] MD5 sum for file ${file_name} doesn\'t match" + if [ "${sha512sum_apache}" != "${sha512sum_pypi}" ]; then + echo "[ERROR] SHA512 sum for file ${file_name} doesn't match" echo "" - echo "${file_name_apache}: ${md5sum_apache}" - echo "${file_name_pypi}: ${md5sum_pypi}" + echo "${file_name_apache}: ${sha512sum_apache}" + echo "${file_name_pypi}: ${sha512sum_pypi}" exit 1 else - echo "[OK] MD5 sum for file ${file_name} matches" + echo "[OK] SHA512 sum for file ${file_name} matches" fi echo "" diff --git a/doap_libcloud.rdf b/doap_libcloud.rdf index 62baa4ab74..8fc39327d1 100644 --- a/doap_libcloud.rdf +++ b/doap_libcloud.rdf @@ -252,7 +252,309 @@ v0.17.0 - + + + 0.18.0 + 2015-08-12 + v0.18.0 + + + + + 0.19.0 + 2015-10-30 + v0.19.0 + + + + + 0.20.0 + 2015-12-15 + v0.20.0 + + + + + 0.20.1 + 2016-01-19 + v0.20.1 + + + + + 1.0.0-pre1 + 2016-01-26 + v1.0.0-pre1 + + + + + 1.0.0-rc2 + 2016-04-11 + v1.0.0-rc2 + + + + + 1.0.0 + 2016-06-21 + v1.0.0 + + + + + 1.1.0 + 2016-07-07 + v1.1.0 + + + + + 1.2.0 + 2016-09-15 + v1.2.0 + + + + + 1.2.1 + 2016-09-23 + v1.2.1 + + + + + 1.3.0 + 2016-10-14 + v1.3.0 + + + + + 1.4.0 + 2016-11-27 + v1.4.0 + + + + + 1.5.0 + 2016-12-28 + v1.5.0 + + + + + 2.0.0rc2 + 2017-04-08 + v2.0.0rc2 + + + + + 2.0.0 + 2017-04-25 + v2.0.0 + + + + + 2.1.0 + 2017-07-17 + v2.1.0 + + + + + 2.2.0 + 2017-09-04 + v2.2.0 + + + + + 2.2.1 + 2017-09-21 + v2.2.1 + + + + + 2.3.0 + 2018-02-08 + v2.3.0 + + + + + 2.4.0 + 2018-11-08 + v2.4.0 + + + + + 2.5.0 + 2019-05-30 + v2.5.0 + + + + + 2.6.0 + 2019-08-28 + v2.6.0 + + + + + 2.6.1 + 2019-11-18 + v2.6.1 + + + + + 2.7.0 + 2019-12-09 + v2.7.0 + + + + + 2.8.0 + 2020-01-02 + v2.8.0 + + + + + 3.0.0-rc1 + 2020-01-29 + v3.0.0-rc1 + + + + + 3.0.0-rc1 + 2020-03-03 + v3.0.0-rc1 + + + + + 2.8.2 + 2020-04-15 + v2.8.2 + + + + + 3.0.0 + 2020-04-15 + v3.0.0 + + + + + 2.8.3 + 2020-06-12 + v2.8.3 + + + + + 3.1.0 + 2020-06-12 + v3.1.0 + + + + + 3.2.0 + 2020-09-20 + v3.2.0 + + + + + 3.3.0 + 2021-01-02 + v3.3.0 + + + + + 3.3.1 + 2021-01-25 + v3.3.1 + + + + + 3.4.0 + 2021-11-11 + v3.4.0 + + + + + 3.4.1 + 2021-11-15 + v3.4.1 + + + + + 3.5.0 + 2022-03-11 + v3.5.0 + + + + + 3.6.0 + 2022-05-26 + v3.6.0 + + + + + 3.6.1 + 2022-10-10 + v3.6.1 + + + + + 3.7.0 + 2023-01-08 + v3.7.0 + + + + + 3.8.0 + 2023-08-10 + v3.8.0 + + + + + 3.9.0 + 2026-02-09 + v3.9.0 + + + + + 3.9.1 + 2026-04-16 + v3.9.1 + + + + diff --git a/docs/_static/images/misc/azure_blobs_manage_access_keys_1.png b/docs/_static/images/misc/azure_blobs_manage_access_keys_1.png index ca1b1c2e0e..ade9380b92 100644 Binary files a/docs/_static/images/misc/azure_blobs_manage_access_keys_1.png and b/docs/_static/images/misc/azure_blobs_manage_access_keys_1.png differ diff --git a/docs/_static/images/misc/azure_blobs_manage_access_keys_2.png b/docs/_static/images/misc/azure_blobs_manage_access_keys_2.png index 6337fcdf82..2596465f45 100644 Binary files a/docs/_static/images/misc/azure_blobs_manage_access_keys_2.png and b/docs/_static/images/misc/azure_blobs_manage_access_keys_2.png differ diff --git a/docs/_static/images/misc/gce/create_service_account.png b/docs/_static/images/misc/gce/create_service_account.png new file mode 100644 index 0000000000..92b5a96bc8 Binary files /dev/null and b/docs/_static/images/misc/gce/create_service_account.png differ diff --git a/docs/_static/images/misc/gce/iam_and_roles.png b/docs/_static/images/misc/gce/iam_and_roles.png new file mode 100644 index 0000000000..de7f9a96b6 Binary files /dev/null and b/docs/_static/images/misc/gce/iam_and_roles.png differ diff --git a/docs/_static/images/misc/gce/new_project.png b/docs/_static/images/misc/gce/new_project.png new file mode 100644 index 0000000000..ff6f4a9097 Binary files /dev/null and b/docs/_static/images/misc/gce/new_project.png differ diff --git a/docs/_static/images/misc/gce/project_dashboard.png b/docs/_static/images/misc/gce/project_dashboard.png new file mode 100644 index 0000000000..aad2b2fb3e Binary files /dev/null and b/docs/_static/images/misc/gce/project_dashboard.png differ diff --git a/docs/_static/images/misc/gce/view_service_accounts.png b/docs/_static/images/misc/gce/view_service_accounts.png new file mode 100644 index 0000000000..2d05cca112 Binary files /dev/null and b/docs/_static/images/misc/gce/view_service_accounts.png differ diff --git a/docs/_static/images/provider_logos/backblaze.png b/docs/_static/images/provider_logos/backblaze.png new file mode 100644 index 0000000000..5899a799be Binary files /dev/null and b/docs/_static/images/provider_logos/backblaze.png differ diff --git a/docs/_static/images/provider_logos/bsnl.png b/docs/_static/images/provider_logos/bsnl.png new file mode 100644 index 0000000000..a00fb9aa6a Binary files /dev/null and b/docs/_static/images/provider_logos/bsnl.png differ diff --git a/docs/_static/images/provider_logos/cloudflare.png b/docs/_static/images/provider_logos/cloudflare.png new file mode 100644 index 0000000000..1bb84dee2a Binary files /dev/null and b/docs/_static/images/provider_logos/cloudflare.png differ diff --git a/docs/_static/images/provider_logos/cloudscale.png b/docs/_static/images/provider_logos/cloudscale.png new file mode 100644 index 0000000000..c4de9c451c Binary files /dev/null and b/docs/_static/images/provider_logos/cloudscale.png differ diff --git a/docs/_static/images/provider_logos/cloudwatt.png b/docs/_static/images/provider_logos/cloudwatt.png new file mode 100644 index 0000000000..b9abdbcb13 Binary files /dev/null and b/docs/_static/images/provider_logos/cloudwatt.png differ diff --git a/docs/_static/images/provider_logos/digitalocean.png b/docs/_static/images/provider_logos/digitalocean.png index 9e24762235..ec1fd036ce 100644 Binary files a/docs/_static/images/provider_logos/digitalocean.png and b/docs/_static/images/provider_logos/digitalocean.png differ diff --git a/docs/_static/images/provider_logos/dimensiondata.png b/docs/_static/images/provider_logos/dimensiondata.png new file mode 100644 index 0000000000..6a15b863f5 Binary files /dev/null and b/docs/_static/images/provider_logos/dimensiondata.png differ diff --git a/docs/_static/images/provider_logos/dnsimple.png b/docs/_static/images/provider_logos/dnsimple.png new file mode 100644 index 0000000000..b7338ed863 Binary files /dev/null and b/docs/_static/images/provider_logos/dnsimple.png differ diff --git a/docs/_static/images/provider_logos/docker.png b/docs/_static/images/provider_logos/docker.png new file mode 100644 index 0000000000..8ff27ae939 Binary files /dev/null and b/docs/_static/images/provider_logos/docker.png differ diff --git a/docs/_static/images/provider_logos/equinixmetal.png b/docs/_static/images/provider_logos/equinixmetal.png new file mode 100644 index 0000000000..f7e2846a98 Binary files /dev/null and b/docs/_static/images/provider_logos/equinixmetal.png differ diff --git a/docs/_static/images/provider_logos/godaddy.png b/docs/_static/images/provider_logos/godaddy.png new file mode 100644 index 0000000000..730e4a29a9 Binary files /dev/null and b/docs/_static/images/provider_logos/godaddy.png differ diff --git a/docs/_static/images/provider_logos/gridscale.png b/docs/_static/images/provider_logos/gridscale.png new file mode 100644 index 0000000000..0021289c47 Binary files /dev/null and b/docs/_static/images/provider_logos/gridscale.png differ diff --git a/docs/_static/images/provider_logos/indosat.png b/docs/_static/images/provider_logos/indosat.png new file mode 100644 index 0000000000..9966502a6e Binary files /dev/null and b/docs/_static/images/provider_logos/indosat.png differ diff --git a/docs/_static/images/provider_logos/internetsolutions.png b/docs/_static/images/provider_logos/internetsolutions.png new file mode 100644 index 0000000000..e2dbd77b96 Binary files /dev/null and b/docs/_static/images/provider_logos/internetsolutions.png differ diff --git a/docs/_static/images/provider_logos/kamatera.png b/docs/_static/images/provider_logos/kamatera.png new file mode 100644 index 0000000000..0351fe6f31 Binary files /dev/null and b/docs/_static/images/provider_logos/kamatera.png differ diff --git a/docs/_static/images/provider_logos/kubernetes.png b/docs/_static/images/provider_logos/kubernetes.png new file mode 100644 index 0000000000..08da3fd146 Binary files /dev/null and b/docs/_static/images/provider_logos/kubernetes.png differ diff --git a/docs/_static/images/provider_logos/maxihost.png b/docs/_static/images/provider_logos/maxihost.png new file mode 100644 index 0000000000..86d623aef7 Binary files /dev/null and b/docs/_static/images/provider_logos/maxihost.png differ diff --git a/docs/_static/images/provider_logos/med-one.png b/docs/_static/images/provider_logos/med-one.png new file mode 100644 index 0000000000..8b047f5391 Binary files /dev/null and b/docs/_static/images/provider_logos/med-one.png differ diff --git a/docs/_static/images/provider_logos/minio.png b/docs/_static/images/provider_logos/minio.png new file mode 100644 index 0000000000..38f6ff9f01 Binary files /dev/null and b/docs/_static/images/provider_logos/minio.png differ diff --git a/docs/_static/images/provider_logos/ntt.png b/docs/_static/images/provider_logos/ntt.png new file mode 100644 index 0000000000..0f96ab7c87 Binary files /dev/null and b/docs/_static/images/provider_logos/ntt.png differ diff --git a/docs/_static/images/provider_logos/ntta.png b/docs/_static/images/provider_logos/ntta.png new file mode 100644 index 0000000000..273ee4b4f8 Binary files /dev/null and b/docs/_static/images/provider_logos/ntta.png differ diff --git a/docs/_static/images/provider_logos/onapp.png b/docs/_static/images/provider_logos/onapp.png new file mode 100644 index 0000000000..048f7cf7f5 Binary files /dev/null and b/docs/_static/images/provider_logos/onapp.png differ diff --git a/docs/_static/images/provider_logos/outscale.jpg b/docs/_static/images/provider_logos/outscale.jpg new file mode 100644 index 0000000000..3131e89066 Binary files /dev/null and b/docs/_static/images/provider_logos/outscale.jpg differ diff --git a/docs/_static/images/provider_logos/outscale.png b/docs/_static/images/provider_logos/outscale.png deleted file mode 100644 index c11c92a8f1..0000000000 Binary files a/docs/_static/images/provider_logos/outscale.png and /dev/null differ diff --git a/docs/_static/images/provider_logos/ovh.png b/docs/_static/images/provider_logos/ovh.png new file mode 100644 index 0000000000..95a9c50f07 Binary files /dev/null and b/docs/_static/images/provider_logos/ovh.png differ diff --git a/docs/_static/images/provider_logos/packet.png b/docs/_static/images/provider_logos/packet.png new file mode 100644 index 0000000000..d69bfb12ba Binary files /dev/null and b/docs/_static/images/provider_logos/packet.png differ diff --git a/docs/_static/images/provider_logos/pointdns.png b/docs/_static/images/provider_logos/pointdns.png new file mode 100644 index 0000000000..4b2e6af137 Binary files /dev/null and b/docs/_static/images/provider_logos/pointdns.png differ diff --git a/docs/_static/images/provider_logos/profitbricks.png b/docs/_static/images/provider_logos/profitbricks.png new file mode 100644 index 0000000000..de1a9eb328 Binary files /dev/null and b/docs/_static/images/provider_logos/profitbricks.png differ diff --git a/docs/_static/images/provider_logos/rancher.png b/docs/_static/images/provider_logos/rancher.png new file mode 100644 index 0000000000..82dde39b4c Binary files /dev/null and b/docs/_static/images/provider_logos/rancher.png differ diff --git a/docs/_static/images/provider_logos/rcodezero.png b/docs/_static/images/provider_logos/rcodezero.png new file mode 100644 index 0000000000..1dd0da969b Binary files /dev/null and b/docs/_static/images/provider_logos/rcodezero.png differ diff --git a/docs/_static/images/provider_logos/scaleway.png b/docs/_static/images/provider_logos/scaleway.png new file mode 100644 index 0000000000..2a2b9e0778 Binary files /dev/null and b/docs/_static/images/provider_logos/scaleway.png differ diff --git a/docs/_static/images/provider_logos/scaleway.svg b/docs/_static/images/provider_logos/scaleway.svg new file mode 100644 index 0000000000..07bac670c2 --- /dev/null +++ b/docs/_static/images/provider_logos/scaleway.svg @@ -0,0 +1,21 @@ + + + Logo Scaleway + + + + + + + + + + + + + + + + + + diff --git a/docs/_static/images/provider_logos/triton.png b/docs/_static/images/provider_logos/triton.png new file mode 100644 index 0000000000..6a20129d3a Binary files /dev/null and b/docs/_static/images/provider_logos/triton.png differ diff --git a/docs/_static/images/provider_logos/upcloud.png b/docs/_static/images/provider_logos/upcloud.png new file mode 100644 index 0000000000..55b123be49 Binary files /dev/null and b/docs/_static/images/provider_logos/upcloud.png differ diff --git a/docs/_static/images/provider_logos/zonomi.png b/docs/_static/images/provider_logos/zonomi.png new file mode 100644 index 0000000000..ab8b803f94 Binary files /dev/null and b/docs/_static/images/provider_logos/zonomi.png differ diff --git a/docs/_static/images/supported_providers.png b/docs/_static/images/supported_providers.png index 27645f6b54..7e78ae93da 100644 Binary files a/docs/_static/images/supported_providers.png and b/docs/_static/images/supported_providers.png differ diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index c926f1ef02..4b946a25fa 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -8,13 +8,22 @@ {% block footer %} {{ super() }} {% endblock %} diff --git a/docs/backup/_supported_methods.rst b/docs/backup/_supported_methods.rst new file mode 100644 index 0000000000..a4c7f64aec --- /dev/null +++ b/docs/backup/_supported_methods.rst @@ -0,0 +1,13 @@ +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it + +====================================== ========================== ============ ============= ======================= ==================================== ============= ============= ==================== ============== =========================== ================ ================= ================= ================== ================= +Provider get supported target types list targets create target create target from node create target from storage container update target delete target list recovery points recover target recover target out of place list target jobs create target job resume target job suspend target job cancel target job +====================================== ========================== ============ ============= ======================= ==================================== ============= ============= ==================== ============== =========================== ================ ================= ================= ================== ================= +`Dimension Data Backup`_ yes yes yes yes no yes yes yes yes yes yes yes yes yes yes +`Amazon EBS Backup Driver`_ yes yes yes yes no yes yes yes yes yes yes yes yes yes yes +`Google Compute Engine Backup Driver`_ yes yes yes yes no yes yes yes yes yes yes yes yes yes yes +====================================== ========================== ============ ============= ======================= ==================================== ============= ============= ==================== ============== =========================== ================ ================= ================= ================== ================= + +.. _`Dimension Data Backup`: https://cloud.dimensiondata.com/ +.. _`Amazon EBS Backup Driver`: http://aws.amazon.com/ebs/ +.. _`Google Compute Engine Backup Driver`: http://cloud.google.com/ diff --git a/docs/backup/_supported_providers.rst b/docs/backup/_supported_providers.rst new file mode 100644 index 0000000000..c7ee635180 --- /dev/null +++ b/docs/backup/_supported_providers.rst @@ -0,0 +1,13 @@ +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it + +====================================== ============================================ ================= ==================== ============================================ ================================== +Provider Documentation Provider Constant Supported Regions Module Class Name +====================================== ============================================ ================= ==================== ============================================ ================================== +`Dimension Data Backup`_ :doc:`Click ` DIMENSIONDATA single region driver :mod:`libcloud.backup.drivers.dimensiondata` :class:`DimensionDataBackupDriver` +`Amazon EBS Backup Driver`_ EBS single region driver :mod:`libcloud.backup.drivers.ebs` :class:`EBSBackupDriver` +`Google Compute Engine Backup Driver`_ GCE single region driver :mod:`libcloud.backup.drivers.gce` :class:`GCEBackupDriver` +====================================== ============================================ ================= ==================== ============================================ ================================== + +.. _`Dimension Data Backup`: https://cloud.dimensiondata.com/ +.. _`Amazon EBS Backup Driver`: http://aws.amazon.com/ebs/ +.. _`Google Compute Engine Backup Driver`: http://cloud.google.com/ diff --git a/docs/backup/api.rst b/docs/backup/api.rst new file mode 100644 index 0000000000..e24a08afc2 --- /dev/null +++ b/docs/backup/api.rst @@ -0,0 +1,22 @@ +:orphan: + +Backup Base API +=============== + +.. autoclass:: libcloud.backup.base.BackupDriver + :members: + +.. autoclass:: libcloud.backup.base.BackupTarget + :members: + +.. autoclass:: libcloud.backup.base.BackupTargetJob + :members: + +.. autoclass:: libcloud.backup.base.BackupTargetRecoveryPoint + :members: + +.. autoclass:: libcloud.backup.types.BackupTargetType + :members: + +.. autoclass:: libcloud.backup.types.BackupTargetJobStatusType + :members: diff --git a/docs/backup/drivers/dimensiondata.rst b/docs/backup/drivers/dimensiondata.rst new file mode 100644 index 0000000000..a13231e4ee --- /dev/null +++ b/docs/backup/drivers/dimensiondata.rst @@ -0,0 +1,66 @@ +Dimension Data Cloud Backup Driver Documentation +================================================ + +Dimension Data are a global IT Services company and form part of the NTT Group. +Dimension Data provide IT-as-a-Service to customers around the globe on their +cloud platform (Compute as a Service). The CaaS service is available either on +one of the public cloud instances or as a private instance on premises. + +.. figure:: /_static/images/provider_logos/dimensiondata.png + :align: center + :width: 300 + :target: http://cloud.dimensiondata.com/ + +Backup-as-a-Service includes Cloud Backup, Cloud Backup +has its own non-standard `API`_ , `libcloud` provides a Python +wrapper on top of this `API`_ with common methods with other IaaS solutions and +Public cloud providers. Therefore, you can use use the Dimension Data libcloud +driver to communicate with both the public and private clouds. + +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``user_id`` - Your Dimension Data Cloud username +* ``key`` - Your Dimension Data Cloud password +* ``region`` - The region key, one of the possible region keys + +Possible regions: + +* ``dd-na`` : Dimension Data North America (USA) +* ``dd-eu`` : Dimension Data Europe +* ``dd-af`` : Dimension Data Africa +* ``dd-au`` : Dimension Data Australia +* ``dd-latam`` : Dimension Data Latin America +* ``dd-ap`` : Dimension Data Asia Pacific +* ``dd-canada`` : Dimension Data Canada region + +The base `libcloud` API allows you to: + +* enable backups, add backup clients and configure backup clients + +Non-standard functionality and extension methods +------------------------------------------------ + +The Dimension Data driver exposes some `libcloud` non-standard +functionalities through extension methods and arguments. + +These functionalities include: + +* set retention periods +* configure secondary copes + +For information on how to use these functionalities please see the method +docstrings below. You can also use an interactive shell for exploration as +shown in the examples. + +API Docs +-------- + +.. autoclass:: libcloud.backup.drivers.dimensiondata.DimensionDataBackupDriver + :members: + :inherited-members: + +.. _`API`: http://cloud.dimensiondata.com/au/en/services/public-cloud/api diff --git a/docs/backup/drivers/index.rst b/docs/backup/drivers/index.rst new file mode 100644 index 0000000000..5dd4f6be67 --- /dev/null +++ b/docs/backup/drivers/index.rst @@ -0,0 +1,12 @@ +:orphan: + +Backup Drivers Documentation +============================ + +This chapter includes links to driver (provider) specific documentation pages. + +.. toctree:: + :glob: + :maxdepth: 1 + + * diff --git a/docs/backup/examples.rst b/docs/backup/examples.rst new file mode 100644 index 0000000000..3bc5a9b418 --- /dev/null +++ b/docs/backup/examples.rst @@ -0,0 +1,16 @@ +:orphan: + +Backup Examples +=============== + +Getting a node from a compute driver and enabling backup +--------------------------------------------------------- + +This example shows how to get a node using a remote Azure datacenter, enable backup +and backup the node. + +.. note:: + This example works with Libcloud version 0.20.0 and above. + +.. literalinclude:: /examples/backup/create_backup_from_node.py + :language: python diff --git a/docs/backup/index.rst b/docs/backup/index.rst new file mode 100644 index 0000000000..3b372194b9 --- /dev/null +++ b/docs/backup/index.rst @@ -0,0 +1,40 @@ +Backup +====== + +.. note:: + + Backup API is available in Libcloud 1.0.0-pre1 and higher. + +.. note:: + + This driver is **experimental** - please use to test functionality and develop new driver instances, not for production use. + +Backup API allows you to manage Backup as A Service and services such as EBS Snaps, +GCE volume snap and dimension data backup. + +Terminology +----------- + +* :class:`~libcloud.backup.base.BackupTarget` - Represents a backup target, like a Virtual Machine, a folder or a database. +* :class:`~libcloud.backup.base.BackupTargetRecoveryPoint` - Represents a copy of the data in the target, a recovery point can be + recovered to a backup target. An inplace restore is where you recover to the same target and an out-of-place restore is where you + recover to another target. +* :class:`~libcloud.backup.base.BackupTargetJob` - Represents a backup job running on backup target. + + +Supported Providers +------------------- + +For a list of supported providers see :doc:`supported providers page +`. + +Examples +-------- + +We have :doc:`examples of several common patterns `. + +API Reference +------------- + +For a full reference of all the classes and methods exposed by the Backup +API, see :doc:`this page `. diff --git a/docs/backup/supported_providers.rst b/docs/backup/supported_providers.rst new file mode 100644 index 0000000000..e34e5eba21 --- /dev/null +++ b/docs/backup/supported_providers.rst @@ -0,0 +1,14 @@ +:orphan: + +Supported Providers +=================== + +Provider Matrix +--------------- + +.. include:: _supported_providers.rst + +Supported Methods +----------------- + +.. include:: _supported_methods.rst diff --git a/docs/committer_guide.rst b/docs/committer_guide.rst index ec9fdc2d81..6faf0fb001 100644 --- a/docs/committer_guide.rst +++ b/docs/committer_guide.rst @@ -16,10 +16,9 @@ First congratulations and welcome to the team! 1. Subscribe to the public mailing lists ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If you haven't yet, subscribe to {dev,users,commits}@apache.libcloud.org -mailing lists. Committs mailing list is especially important because all of -the JIRA notification, Gihub Pull Request notifications and build notifications -are sent there. +If you haven't yet, subscribe to {dev,users,notifications}@libcloud.apache.org +mailing lists. Notifications mailing list is especially important because all of +Github Issue, Pull Request and build notifications are sent there. 2. Subscribe to the private mailing list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -42,48 +41,26 @@ After you have registered go to "`Your details `_" page and populate `PGP Key ID` field with your PGP key ID. -Applying a patch ----------------- +4. Link your ASF and Github account +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When applying a third-party patch created using ``git format-patch`` or -``git diff`` command, use the following command: +We use Github for managing issues and user contributions (pull requests). As +such, you need to link your Github.com account with your ASF account using +`Gitbox `_. This way you will get write +access to github.com/apache/libcloud repository and you will be able to +manage issues and pull request directly through our Github repository. -.. sourcecode:: bash - - git am --signoff < patch_name.patch - -``--signoff`` argument signs the patch and lets others know that you have -reviewed and merged a patch. - -If you are working with a Github pull request, you can obtain a patch file -by appending ``.patch`` to the end of the pull request URL. For example: - -.. sourcecode:: bash - - wget https://github.com/apache/libcloud/pull/.patch - git am --signoff < .patch - # rebase to squash commits / ammend - ... - -When working with a Github pull request, also don't forget to -update the commit message during rebase (or use ``git commit --amend`` if the -rebase was not necessary) to include the "Closes #prnumber" message. This way, -the corresponding Github pull request will get automatically closed once the -Github mirror is updated. - -For example:: - - ... - Original message - ... - - Closes #prnumber +Merging user contributions +-------------------------- -If the original patch author didn't squash all of the commits into one and you -think this is needed, you should squash all the commits yourself using -``git rebase`` after you have merged / applied the patch. +When a pull request with user contribution (changes) has been reviewed and +all the criteria for merging has been met (tests and code coverage, Travis +build is passing, user signed an ICLA, etc.), you can directly merge those +changes into trunk either by using Github web interface or doing it manually +on the command line. -After the patch has been applied, make sure to update ``CHANGES.rst`` file. +It's also important that you update changelog in ``CHANGES.rst`` file after +you merged the changes. Making a release (for release managers) --------------------------------------- @@ -91,33 +68,48 @@ Making a release (for release managers) This section contains information a release manager should follow when preparing a release. -1. Pre-release check list +0. Update committed files ~~~~~~~~~~~~~~~~~~~~~~~~~ -* Make sure tests pass on all the supported Python versions (``tox``) * Make sure ``CHANGES`` file is up to date * Make sure ``__version__`` string in ``libcloud/__init__.py`` is up to date +* Make sure ``version`` and ``release`` in ``docs/conf.py`` are up to date +* Update constants, pricing and other auto-generated data: ``tox -e scrape-ec2-sizes,scrape-ec2-prices,black,isort`` + +1. Pre-release check list +~~~~~~~~~~~~~~~~~~~~~~~~~ + +* Make sure tests pass on all the supported Python versions (``tox``) * Remove the ``tox`` directory with ``rm -rf .tox`` * Remove the _secrets_ file with ``rm libcloud/test/secrets.py`` +* Remove leftover builds from previous releases. ``rm -f dist/apache* ; rm -rf apache_libcloud.egg-info`` -2. Update JIRA -~~~~~~~~~~~~~~ +2. Update Github +~~~~~~~~~~~~~~~~~ -* Create a new JIRA version for the release in question (if one doesn't exist +* Create a new Github milestone for the release in question (if one doesn't exist yet) -* Close all the corresponding JIRA tickets and set ``Fix Version/s`` field - to the current version -* Release the JIRA version +* Update affected issues and pull requests and add the corresponding release + milestone to them 3. Creating release artifacts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -We have a script that runs the required setup.py commands and then hashes -and signs the files. You will need the latest version of ``pip`` and the ``wheel`` -package. To run it: +.. note:: + + It's important that you have the latest versions of ``build`` package + installed to ensure the generated wheel files contain correct metadata. + +We have a script that runs the required commands and then hashes and signs the +files. You will need the latest version of ``build`` package. + +To run it: .. sourcecode:: bash + # Install build dependencies + uv sync --group build --no-dev + cd dist ./release.sh -u @apache.org @@ -125,7 +117,7 @@ package. To run it: your local GPG database. This should result in a set of -``apache-libcloud-${VERSION}.{tar.bz2,tar.gz,zip,whl}{,asc,md5,sha1}`` files that +``apache-libcloud-${VERSION}.{tar.gz,whl}{,asc,md5,sha1}`` files that are suitable to be uploaded for a release. Copy the artifacts in another directory, unpack one of them and test it with ``tox``. @@ -143,7 +135,7 @@ For example: .. sourcecode:: bash - git tag v0.15.0-tentative 105b9610835f99704996d861d613c5a9a8b3f8b1 + git tag --sign v0.15.0-tentative 105b9610835f99704996d861d613c5a9a8b3f8b1 5. Upload the release artifacts and start a [VOTE] thread ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -154,6 +146,18 @@ space. Then start a [VOTE] thread on the dev@libcloud.apache.org mailing list. Once the vote has passed tag the release with a new tag, removing the ``-tentative`` postfix. Upload the release artifacts to Apache servers and Pypi. +For example: + +.. sourcecode:: bash + + git tag --sign v0.15.0 105b9610835f99704996d861d613c5a9a8b3f8b1 + +The commit SHA needs to be the one release artifacts are based on (aka the one +people voted on) and the same one you used for the ``-tentative`` tag. + +Keep in mind that it's important that you sign the commit / tag with your GPG +key. + 6. Uploading release artifacts to Apache servers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -172,21 +176,27 @@ Upload the release artifacts to Apache servers and Pypi. 7. Publishing package to PyPi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -**For consistency and security reasons packages are always uploaded to PyPi -manually using the web interface and not using the setup.py upload -command.** +We have a script that uploads the signed Python source files to PyPi. It +uses twine, so ensure you have twine available in your path `which twine` +before running. Twine can be downloaded from https://pypi.python.org/pypi/twine. + +You should also ensure you have 2FA / MFA enabled for your PyPi account and +generate a new API token with apache-libcloud project scope which gives +publish permission. -* Run ``python setup.py register`` command. This will register a new - version on PyPi, but it won't upload the actual release artifacts. +For more information on how to generate an API tokens and configure twine to +use this token, see: -* Go to the `PyPi release management page`_, find a new release and click on - "files" link. +* https://pypi.org/help/#apitoken +* https://kynan.github.io/blog/2020/05/23/how-to-upload-your-package-to-the-python-package-index-pypi-test-server -* Once you are there, upload all the release artifacts (.tar.bz2, .tar.gz, - .zip, and .whl). For ``File Type`` select ``Source`` (except for ``.whl`` - file where you should select ``Python Wheel``) and for ``Python Version`` - select ``Any (ie. pure Python)``. Make sure to also select and upload a PGP - signature for each file (``PGP signature (.asc)`` field). +.. sourcecode:: bash + + # Install publish dependencies + uv sync --group publish --no-dev + + cd dist + ./deploy.sh Once all the files have been uploaded, the page should look similar to the screenshot below. @@ -214,24 +224,40 @@ For example .. sourcecode:: bash - ./dist/verify_checksums.sh apache-libcloud-0.13.2 + ./dist/verify_checksums.sh apache-libcloud-3.5.0 -9. Updating doap_libcloud.rdf file -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +9. Updating doap_libcloud.rdf, __init__.py +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Add information about the new release to the ``doap_libcloud.rdf`` file in the root of the main code repository. +Update ``__version__`` attribute in ``libcloud/__init.py__`` file and indicate +we are now working on a new release by incrementing a number and adding ``-dev`` +suffix. For example, if version ``2.2.1`` has been released you would change +it from: + +.. sourcecode:: python + + __version__ = '2.2.1' + +To: + +.. sourcecode:: python + + __version__ = '2.2.2-dev' + 10. Updating website ~~~~~~~~~~~~~~~~~~~~ -Check out the website using SVN: ``svn co https://svn.apache.org/repos/asf/libcloud/site/trunk`` +Check out the website using git: ``git clone http://gitbox.apache.org/repos/asf/libcloud-site.git`` -* Upate the front page (``source/index.html`` file) +* Update the front page (``source/index.html`` file) * Update "Downloads" page (``source/downloads.md`` file) * Add a blog entry in the ``_posts`` directory. -Build the site locally and make sure everything is correct. Check the ``README.md`` file. +Build the site locally and make sure everything is correct before pushing website updated. Check +the ``README.md`` file in that repo on how to do that. 11. Sending announcements ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -305,7 +331,7 @@ Body:: This bug could manifest itself while uploading a file with some of the storage providers. Besides this bug fix, it includes a couple of other smaller bug fixes and changes. Full change log - can be found at https://git-wip-us.apache.org/repos/asf?p=libcloud.git;a=blob;f=CHANGES;h=b7747f777afdeb63bcacf496d1d034f1b3287c31;hb=c4b3daae946049652a500a8515929b4cbf14a6b4 + can be found at https://git.apache.org/repos/asf?p=libcloud.git;a=blob;f=CHANGES;h=b7747f777afdeb63bcacf496d1d034f1b3287c31;hb=c4b3daae946049652a500a8515929b4cbf14a6b4 Release artifacts can be found at http://people.apache.org/~tomaz/libcloud/. @@ -369,7 +395,7 @@ Body:: Bugs / Issues If you find any bug or issue, please report it on our issue tracker - . + . Don't forget to attach an example and / or test which reproduces your problem. Thanks @@ -397,7 +423,7 @@ Body:: Content-Length regression which broke create and update operations in the Bluebox Compute and Azure Storage driver (LIBCLOUD-362, LIBCLOUD-3901). - Full change log can be found at + Full change log can be found at Download @@ -430,13 +456,13 @@ Body:: Bugs / Issues If you find any bug or issue, please report it on our issue tracker - . + . Don't forget to attach an example and / or test which reproduces your problem. Thanks Thanks to everyone who contributed and made this release possible! Full list of people who contributed to this release can be found in the CHANGES file - . + . .. _`PyPi release management page`: https://pypi.python.org/pypi?%3Aaction=pkg_edit&name=apache-libcloud diff --git a/docs/compute/_supported_methods_block_storage.rst b/docs/compute/_supported_methods_block_storage.rst index 47f2097a7d..ff2763f1ff 100644 --- a/docs/compute/_supported_methods_block_storage.rst +++ b/docs/compute/_supported_methods_block_storage.rst @@ -1,137 +1,103 @@ -===================================== ============ ============= ============== ============= ============= ============== =============== -Provider list volumes create volume destroy volume attach volume detach volume list snapshots create snapshot -===================================== ============ ============= ============== ============= ============= ============== =============== -`Abiquo`_ no no no no no no no -`PCextreme AuroraCompute`_ yes yes yes yes yes no yes -`Azure Virtual machines`_ yes yes yes yes yes no yes -`Bluebox Blocks`_ no no no no no no no -`Brightbox`_ no no no no no no no -`CloudFrames`_ no no no no no no no -`CloudSigma (API v2.0)`_ no no no no no no no -`CloudStack`_ yes yes yes yes yes no yes -`DigitalOcean`_ no no no no no no no -`Dreamhost`_ no no no no no no no -`Amazon EC2`_ yes yes yes yes yes yes yes -`Amazon EC2 (ap-northeast-1)`_ yes yes yes yes yes yes yes -`Amazon EC2 (ap-southeast-1)`_ yes yes yes yes yes yes yes -`Amazon EC2 (ap-southeast-2)`_ yes yes yes yes yes yes yes -`Amazon EC2 (eu-west-1)`_ yes yes yes yes yes yes yes -`Amazon EC2 (eu-west-1)`_ yes yes yes yes yes yes yes -`Amazon EC2 (sa-east-1)`_ yes yes yes yes yes yes yes -`Amazon EC2`_ yes yes yes yes yes yes yes -`Amazon EC2 (us-west-1)`_ yes yes yes yes yes yes yes -`Amazon EC2 (us-west-2)`_ yes yes yes yes yes yes yes -`Enomaly Elastic Computing Platform`_ no no no no no no no -`ElasticHosts`_ no no no no no no no -`ElasticHosts (syd-y)`_ no no no no no no no -`ElasticHosts (tor-p)`_ no no no no no no no -`ElasticHosts (cn-1)`_ no no no no no no no -`ElasticHosts (lon-p)`_ no no no no no no no -`ElasticHosts (lon-b)`_ no no no no no no no -`ElasticHosts (sat-p)`_ no no no no no no no -`ElasticHosts (lax-p)`_ no no no no no no no -`ElasticHosts (sjc-c)`_ no no no no no no no -`Eucalyptus`_ yes yes yes yes yes yes yes -`Exoscale`_ yes yes yes yes yes no yes -`Gandi`_ yes yes yes yes yes no no -`Google Compute Engine`_ yes yes yes yes yes yes yes -`GoGrid`_ no no no no no no no -`HostVirtual`_ no no no no no no no -`HP Public Cloud (Helion)`_ yes yes yes yes yes yes yes -`IBM SmartCloud Enterprise`_ yes yes yes yes yes no no -`Ikoula`_ yes yes yes yes yes no yes -`Joyent`_ no no no no no no no -`Kili Public Cloud`_ yes yes yes yes yes yes yes -`KTUCloud`_ yes yes yes yes yes no yes -`Libvirt`_ no no no no no no no -`Linode`_ no no yes no no no no -`NephoScale`_ no no no no no no no -`Nimbus`_ yes yes yes yes yes yes yes -`Ninefold`_ yes yes yes yes yes no yes -`OpenNebula (v3.8)`_ yes yes yes yes yes no no -`OpenStack`_ yes yes yes yes yes no no -`Opsource`_ no no no no no no no -`Outscale INC`_ yes yes yes yes yes yes yes -`Outscale SAS`_ yes yes yes yes yes yes yes -`ProfitBricks`_ yes yes yes yes yes no no -`Rackspace Cloud (Next Gen)`_ yes yes yes yes yes yes yes -`Rackspace Cloud (First Gen)`_ yes yes yes yes yes no no -`RimuHosting`_ no no no no no no no -`ServerLove`_ no no no no no no no -`skalicloud`_ no no no no no no no -`SoftLayer`_ no no no no no no no -`vCloud`_ no no no no no no no -`VCL`_ no no no no no no no -`vCloud`_ no no no no no no no -`Voxel VoxCLOUD`_ no no no no no no no -`vps.net`_ no no no no no no no -`VMware vSphere`_ no no no no no no no -`Vultr`_ no no no no no no no -===================================== ============ ============= ============== ============= ============= ============== =============== +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it + +============================== ============ ============= ============== ============= ============= ============== =============== +Provider list volumes create volume destroy volume attach volume detach volume list snapshots create snapshot +============================== ============ ============= ============== ============= ============= ============== =============== +`Abiquo`_ no no no no no no no +`Aliyun ECS`_ yes yes yes yes yes yes yes +`PCextreme AuroraCompute`_ yes yes yes yes yes no yes +`Azure Virtual machines`_ yes yes yes yes yes no yes +`Azure Virtual machines`_ yes yes yes yes yes yes yes +`Brightbox`_ no no no no no no no +`Cloudscale`_ no no no no no no no +`CloudSigma (API v2.0)`_ yes yes yes yes yes no no +`CloudStack`_ yes yes yes yes yes no yes +`DigitalOcean`_ yes yes yes yes yes yes yes +`DimensionData`_ no no no no no no no +`Amazon EC2`_ yes yes yes yes yes yes yes +`EquinixMetal`_ no no no no no no no +`Eucalyptus`_ yes yes yes yes yes yes yes +`Exoscale`_ yes yes yes yes yes no yes +`Gandi`_ yes yes yes yes yes no no +`Google Compute Engine`_ yes yes yes yes yes yes yes +`GiG G8 Node Provider`_ yes yes yes yes yes no no +`Gridscale`_ yes yes yes yes yes yes yes +`Ikoula`_ yes yes yes yes yes no yes +`InternetSolutions`_ no no no no no no no +`Kamatera`_ no no no no no no no +`KTUCloud`_ yes yes yes yes yes no yes +`kubevirt`_ yes yes yes yes yes no no +`Libvirt`_ no no no no no no no +`Linode`_ yes yes yes yes yes no no +`Maxihost`_ no no no no no no no +`Nimbus`_ yes yes yes yes yes yes yes +`NTTAmerica`_ no no no no no no no +`NTTC-CIS`_ no no no no no no no +`OnApp`_ no no no no no no no +`OpenNebula (v3.8)`_ yes yes yes yes yes no no +`OpenStack`_ yes yes yes yes yes no no +`Outscale API`_ yes yes yes yes yes yes yes +`Outscale INC`_ yes yes yes yes yes yes yes +`Outscale SAS`_ yes yes yes yes yes yes yes +`Ovh`_ yes yes yes yes yes yes yes +`Rackspace Cloud (Next Gen)`_ yes yes yes yes yes yes yes +`Rackspace Cloud (First Gen)`_ yes yes yes yes yes no no +`RimuHosting`_ no no no no no no no +`Scaleway`_ yes yes yes no no yes yes +`vCloud`_ no no no no no no no +`Upcloud`_ no no no no no no no +`VCL`_ no no no no no no no +`vCloud`_ no no no no no no no +`vps.net`_ no no no no no no no +`VMware vSphere`_ no no no no no no no +`Vultr`_ yes yes yes yes yes no no +============================== ============ ============= ============== ============= ============= ============== =============== .. _`Abiquo`: http://www.abiquo.com/ -.. _`PCextreme AuroraCompute`: https://www.pcextreme.nl/aurora/ +.. _`Aliyun ECS`: https://www.aliyun.com/product/ecs +.. _`PCextreme AuroraCompute`: https://www.pcextreme.com/aurora/compute +.. _`Azure Virtual machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ .. _`Azure Virtual machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ -.. _`Bluebox Blocks`: http://bluebox.net .. _`Brightbox`: http://www.brightbox.co.uk/ -.. _`CloudFrames`: http://www.cloudframes.net/ +.. _`Cloudscale`: https://www.cloudscale.ch .. _`CloudSigma (API v2.0)`: http://www.cloudsigma.com/ .. _`CloudStack`: http://cloudstack.org/ .. _`DigitalOcean`: https://www.digitalocean.com -.. _`Dreamhost`: http://dreamhost.com/ -.. _`Amazon EC2`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-northeast-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-southeast-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-southeast-2)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (eu-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (eu-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (sa-east-1)`: http://aws.amazon.com/ec2/ +.. _`DimensionData`: http://www.dimensiondata.com/ .. _`Amazon EC2`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (us-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (us-west-2)`: http://aws.amazon.com/ec2/ -.. _`Enomaly Elastic Computing Platform`: http://www.enomaly.com/ -.. _`ElasticHosts`: http://www.elastichosts.com/ -.. _`ElasticHosts (syd-y)`: http://www.elastichosts.com/ -.. _`ElasticHosts (tor-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (cn-1)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lon-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lon-b)`: http://www.elastichosts.com/ -.. _`ElasticHosts (sat-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lax-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (sjc-c)`: http://www.elastichosts.com/ +.. _`EquinixMetal`: https://metal.equinix.com/ .. _`Eucalyptus`: http://www.eucalyptus.com/ -.. _`Exoscale`: https://www.exoscale.ch/ +.. _`Exoscale`: https://www.exoscale.com/ .. _`Gandi`: http://www.gandi.net/ .. _`Google Compute Engine`: https://cloud.google.com/ -.. _`GoGrid`: http://www.gogrid.com/ -.. _`HostVirtual`: http://www.hostvirtual.com -.. _`HP Public Cloud (Helion)`: http://www.hpcloud.com/ -.. _`IBM SmartCloud Enterprise`: http://ibm.com/services/us/en/cloud-enterprise/ +.. _`GiG G8 Node Provider`: https://gig.tech +.. _`Gridscale`: https://gridscale.io .. _`Ikoula`: http://express.ikoula.co.uk/cloudstack -.. _`Joyent`: http://www.joyentcloud.com -.. _`Kili Public Cloud`: http://kili.io/ +.. _`InternetSolutions`: http://www.is.co.za/ +.. _`Kamatera`: https://www.kamatera.com/ .. _`KTUCloud`: https://ucloudbiz.olleh.com/ +.. _`kubevirt`: https://www.kubevirt.io .. _`Libvirt`: http://libvirt.org/ .. _`Linode`: http://www.linode.com/ -.. _`NephoScale`: http://www.nephoscale.com +.. _`Maxihost`: https://www.maxihost.com/ .. _`Nimbus`: http://www.nimbusproject.org/ -.. _`Ninefold`: http://ninefold.com/ +.. _`NTTAmerica`: http://www.nttamerica.com/ +.. _`NTTC-CIS`: https://www.us.ntt.com/en/services/cloud/enterprise-cloud.html +.. _`OnApp`: http://onapp.com/ .. _`OpenNebula (v3.8)`: http://opennebula.org/ .. _`OpenStack`: http://openstack.org/ -.. _`Opsource`: http://www.opsource.net/ +.. _`Outscale API`: http://www.outscale.com .. _`Outscale INC`: http://www.outscale.com .. _`Outscale SAS`: http://www.outscale.com -.. _`ProfitBricks`: http://www.profitbricks.com +.. _`Ovh`: https://www.ovh.com/ .. _`Rackspace Cloud (Next Gen)`: http://www.rackspace.com .. _`Rackspace Cloud (First Gen)`: http://www.rackspace.com .. _`RimuHosting`: http://rimuhosting.com/ -.. _`ServerLove`: http://www.serverlove.com/ -.. _`skalicloud`: http://www.skalicloud.com/ -.. _`SoftLayer`: http://www.softlayer.com/ +.. _`Scaleway`: https://www.scaleway.com/ .. _`vCloud`: http://www.vmware.com/products/vcloud/ +.. _`Upcloud`: https://www.upcloud.com .. _`VCL`: http://incubator.apache.org/vcl/ .. _`vCloud`: http://www.vmware.com/products/vcloud/ -.. _`Voxel VoxCLOUD`: http://www.voxel.net/ .. _`vps.net`: http://vps.net/ .. _`VMware vSphere`: http://www.vmware.com/products/vsphere/ .. _`Vultr`: https://www.vultr.com diff --git a/docs/compute/_supported_methods_image_management.rst b/docs/compute/_supported_methods_image_management.rst index 81196e36e7..7c0bdf9eda 100644 --- a/docs/compute/_supported_methods_image_management.rst +++ b/docs/compute/_supported_methods_image_management.rst @@ -1,137 +1,103 @@ -===================================== =========== ========= ============ ============ ========== -Provider list images get image create image delete image copy image -===================================== =========== ========= ============ ============ ========== -`Abiquo`_ yes no no no no -`PCextreme AuroraCompute`_ yes no no no no -`Azure Virtual machines`_ yes no no no no -`Bluebox Blocks`_ yes no no no no -`Brightbox`_ yes no no no no -`CloudFrames`_ yes no no no no -`CloudSigma (API v2.0)`_ yes no no no no -`CloudStack`_ yes no no no no -`DigitalOcean`_ yes yes yes yes no -`Dreamhost`_ yes no no no no -`Amazon EC2`_ yes yes yes yes yes -`Amazon EC2 (ap-northeast-1)`_ yes yes yes yes yes -`Amazon EC2 (ap-southeast-1)`_ yes yes yes yes yes -`Amazon EC2 (ap-southeast-2)`_ yes yes yes yes yes -`Amazon EC2 (eu-west-1)`_ yes yes yes yes yes -`Amazon EC2 (eu-west-1)`_ yes yes yes yes yes -`Amazon EC2 (sa-east-1)`_ yes yes yes yes yes -`Amazon EC2`_ yes yes yes yes yes -`Amazon EC2 (us-west-1)`_ yes yes yes yes yes -`Amazon EC2 (us-west-2)`_ yes yes yes yes yes -`Enomaly Elastic Computing Platform`_ yes no no no no -`ElasticHosts`_ yes no no no no -`ElasticHosts (syd-y)`_ yes no no no no -`ElasticHosts (tor-p)`_ yes no no no no -`ElasticHosts (cn-1)`_ yes no no no no -`ElasticHosts (lon-p)`_ yes no no no no -`ElasticHosts (lon-b)`_ yes no no no no -`ElasticHosts (sat-p)`_ yes no no no no -`ElasticHosts (lax-p)`_ yes no no no no -`ElasticHosts (sjc-c)`_ yes no no no no -`Eucalyptus`_ yes yes yes yes yes -`Exoscale`_ yes no no no no -`Gandi`_ yes no no no no -`Google Compute Engine`_ yes no no no no -`GoGrid`_ yes no no no no -`HostVirtual`_ yes no no no no -`HP Public Cloud (Helion)`_ yes yes yes yes no -`IBM SmartCloud Enterprise`_ yes no yes no no -`Ikoula`_ yes no no no no -`Joyent`_ yes no no no no -`Kili Public Cloud`_ yes yes yes yes no -`KTUCloud`_ yes no no no no -`Libvirt`_ no no no no no -`Linode`_ yes no no no no -`NephoScale`_ yes no no no no -`Nimbus`_ yes yes yes yes yes -`Ninefold`_ yes no no no no -`OpenNebula (v3.8)`_ yes no no no no -`OpenStack`_ yes yes no no no -`Opsource`_ yes no no no no -`Outscale INC`_ yes yes yes yes yes -`Outscale SAS`_ yes yes yes yes yes -`ProfitBricks`_ yes no no no no -`Rackspace Cloud (Next Gen)`_ yes yes yes yes no -`Rackspace Cloud (First Gen)`_ yes yes yes yes no -`RimuHosting`_ yes no no no no -`ServerLove`_ yes no no no no -`skalicloud`_ yes no no no no -`SoftLayer`_ yes no no no no -`vCloud`_ yes no no no no -`VCL`_ yes no no no no -`vCloud`_ yes no no no no -`Voxel VoxCLOUD`_ yes no no no no -`vps.net`_ yes no no no no -`VMware vSphere`_ yes no no no no -`Vultr`_ yes no no no no -===================================== =========== ========= ============ ============ ========== +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it + +============================== =========== ========= ============ ============ ========== +Provider list images get image create image delete image copy image +============================== =========== ========= ============ ============ ========== +`Abiquo`_ yes no no no no +`Aliyun ECS`_ yes yes yes yes yes +`PCextreme AuroraCompute`_ yes no no no no +`Azure Virtual machines`_ yes no no no no +`Azure Virtual machines`_ yes yes no no no +`Brightbox`_ yes no no no no +`Cloudscale`_ yes no no no no +`CloudSigma (API v2.0)`_ yes no no no no +`CloudStack`_ yes no no no no +`DigitalOcean`_ yes yes yes yes no +`DimensionData`_ yes no no no no +`Amazon EC2`_ yes yes yes yes yes +`EquinixMetal`_ yes no no no no +`Eucalyptus`_ yes yes yes yes yes +`Exoscale`_ yes no no no no +`Gandi`_ yes no no no no +`Google Compute Engine`_ yes no no no no +`GiG G8 Node Provider`_ yes no no no no +`Gridscale`_ yes yes yes yes no +`Ikoula`_ yes no no no no +`InternetSolutions`_ yes no no no no +`Kamatera`_ yes no no no no +`KTUCloud`_ yes no no no no +`kubevirt`_ yes no no no no +`Libvirt`_ no no no no no +`Linode`_ yes yes yes yes no +`Maxihost`_ yes no no no no +`Nimbus`_ yes yes yes yes yes +`NTTAmerica`_ yes no no no no +`NTTC-CIS`_ yes no no no no +`OnApp`_ yes no no no no +`OpenNebula (v3.8)`_ yes no no no no +`OpenStack`_ yes yes no no no +`Outscale API`_ yes yes yes yes no +`Outscale INC`_ yes yes yes yes yes +`Outscale SAS`_ yes yes yes yes yes +`Ovh`_ yes yes no no no +`Rackspace Cloud (Next Gen)`_ yes yes yes yes no +`Rackspace Cloud (First Gen)`_ yes yes yes yes no +`RimuHosting`_ yes no no no no +`Scaleway`_ yes yes yes yes no +`vCloud`_ yes no no no no +`Upcloud`_ yes no no no no +`VCL`_ yes no no no no +`vCloud`_ yes no no no no +`vps.net`_ yes no no no no +`VMware vSphere`_ yes no no no no +`Vultr`_ yes no no no no +============================== =========== ========= ============ ============ ========== .. _`Abiquo`: http://www.abiquo.com/ -.. _`PCextreme AuroraCompute`: https://www.pcextreme.nl/aurora/ +.. _`Aliyun ECS`: https://www.aliyun.com/product/ecs +.. _`PCextreme AuroraCompute`: https://www.pcextreme.com/aurora/compute +.. _`Azure Virtual machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ .. _`Azure Virtual machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ -.. _`Bluebox Blocks`: http://bluebox.net .. _`Brightbox`: http://www.brightbox.co.uk/ -.. _`CloudFrames`: http://www.cloudframes.net/ +.. _`Cloudscale`: https://www.cloudscale.ch .. _`CloudSigma (API v2.0)`: http://www.cloudsigma.com/ .. _`CloudStack`: http://cloudstack.org/ .. _`DigitalOcean`: https://www.digitalocean.com -.. _`Dreamhost`: http://dreamhost.com/ -.. _`Amazon EC2`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-northeast-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-southeast-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-southeast-2)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (eu-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (eu-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (sa-east-1)`: http://aws.amazon.com/ec2/ +.. _`DimensionData`: http://www.dimensiondata.com/ .. _`Amazon EC2`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (us-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (us-west-2)`: http://aws.amazon.com/ec2/ -.. _`Enomaly Elastic Computing Platform`: http://www.enomaly.com/ -.. _`ElasticHosts`: http://www.elastichosts.com/ -.. _`ElasticHosts (syd-y)`: http://www.elastichosts.com/ -.. _`ElasticHosts (tor-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (cn-1)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lon-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lon-b)`: http://www.elastichosts.com/ -.. _`ElasticHosts (sat-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lax-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (sjc-c)`: http://www.elastichosts.com/ +.. _`EquinixMetal`: https://metal.equinix.com/ .. _`Eucalyptus`: http://www.eucalyptus.com/ -.. _`Exoscale`: https://www.exoscale.ch/ +.. _`Exoscale`: https://www.exoscale.com/ .. _`Gandi`: http://www.gandi.net/ .. _`Google Compute Engine`: https://cloud.google.com/ -.. _`GoGrid`: http://www.gogrid.com/ -.. _`HostVirtual`: http://www.hostvirtual.com -.. _`HP Public Cloud (Helion)`: http://www.hpcloud.com/ -.. _`IBM SmartCloud Enterprise`: http://ibm.com/services/us/en/cloud-enterprise/ +.. _`GiG G8 Node Provider`: https://gig.tech +.. _`Gridscale`: https://gridscale.io .. _`Ikoula`: http://express.ikoula.co.uk/cloudstack -.. _`Joyent`: http://www.joyentcloud.com -.. _`Kili Public Cloud`: http://kili.io/ +.. _`InternetSolutions`: http://www.is.co.za/ +.. _`Kamatera`: https://www.kamatera.com/ .. _`KTUCloud`: https://ucloudbiz.olleh.com/ +.. _`kubevirt`: https://www.kubevirt.io .. _`Libvirt`: http://libvirt.org/ .. _`Linode`: http://www.linode.com/ -.. _`NephoScale`: http://www.nephoscale.com +.. _`Maxihost`: https://www.maxihost.com/ .. _`Nimbus`: http://www.nimbusproject.org/ -.. _`Ninefold`: http://ninefold.com/ +.. _`NTTAmerica`: http://www.nttamerica.com/ +.. _`NTTC-CIS`: https://www.us.ntt.com/en/services/cloud/enterprise-cloud.html +.. _`OnApp`: http://onapp.com/ .. _`OpenNebula (v3.8)`: http://opennebula.org/ .. _`OpenStack`: http://openstack.org/ -.. _`Opsource`: http://www.opsource.net/ +.. _`Outscale API`: http://www.outscale.com .. _`Outscale INC`: http://www.outscale.com .. _`Outscale SAS`: http://www.outscale.com -.. _`ProfitBricks`: http://www.profitbricks.com +.. _`Ovh`: https://www.ovh.com/ .. _`Rackspace Cloud (Next Gen)`: http://www.rackspace.com .. _`Rackspace Cloud (First Gen)`: http://www.rackspace.com .. _`RimuHosting`: http://rimuhosting.com/ -.. _`ServerLove`: http://www.serverlove.com/ -.. _`skalicloud`: http://www.skalicloud.com/ -.. _`SoftLayer`: http://www.softlayer.com/ +.. _`Scaleway`: https://www.scaleway.com/ .. _`vCloud`: http://www.vmware.com/products/vcloud/ +.. _`Upcloud`: https://www.upcloud.com .. _`VCL`: http://incubator.apache.org/vcl/ .. _`vCloud`: http://www.vmware.com/products/vcloud/ -.. _`Voxel VoxCLOUD`: http://www.voxel.net/ .. _`vps.net`: http://vps.net/ .. _`VMware vSphere`: http://www.vmware.com/products/vsphere/ .. _`Vultr`: https://www.vultr.com diff --git a/docs/compute/_supported_methods_key_pair_management.rst b/docs/compute/_supported_methods_key_pair_management.rst index 4c691e4903..ddfed43900 100644 --- a/docs/compute/_supported_methods_key_pair_management.rst +++ b/docs/compute/_supported_methods_key_pair_management.rst @@ -1,137 +1,103 @@ -===================================== ============== ============ =============== ============================= =========================== =============== -Provider list key pairs get key pair create key pair import public key from string import public key from file delete key pair -===================================== ============== ============ =============== ============================= =========================== =============== -`Abiquo`_ no no no no no no -`PCextreme AuroraCompute`_ yes yes yes yes no yes -`Azure Virtual machines`_ no no no no no no -`Bluebox Blocks`_ no no no no no no -`Brightbox`_ no no no no no no -`CloudFrames`_ no no no no no no -`CloudSigma (API v2.0)`_ no no no no no no -`CloudStack`_ yes yes yes yes no yes -`DigitalOcean`_ yes no yes no no yes -`Dreamhost`_ no no no no no no -`Amazon EC2`_ yes yes yes yes no yes -`Amazon EC2 (ap-northeast-1)`_ yes yes yes yes no yes -`Amazon EC2 (ap-southeast-1)`_ yes yes yes yes no yes -`Amazon EC2 (ap-southeast-2)`_ yes yes yes yes no yes -`Amazon EC2 (eu-west-1)`_ yes yes yes yes no yes -`Amazon EC2 (eu-west-1)`_ yes yes yes yes no yes -`Amazon EC2 (sa-east-1)`_ yes yes yes yes no yes -`Amazon EC2`_ yes yes yes yes no yes -`Amazon EC2 (us-west-1)`_ yes yes yes yes no yes -`Amazon EC2 (us-west-2)`_ yes yes yes yes no yes -`Enomaly Elastic Computing Platform`_ no no no no no no -`ElasticHosts`_ no no no no no no -`ElasticHosts (syd-y)`_ no no no no no no -`ElasticHosts (tor-p)`_ no no no no no no -`ElasticHosts (cn-1)`_ no no no no no no -`ElasticHosts (lon-p)`_ no no no no no no -`ElasticHosts (lon-b)`_ no no no no no no -`ElasticHosts (sat-p)`_ no no no no no no -`ElasticHosts (lax-p)`_ no no no no no no -`ElasticHosts (sjc-c)`_ no no no no no no -`Eucalyptus`_ yes yes yes yes no yes -`Exoscale`_ yes yes yes yes no yes -`Gandi`_ no no no no no no -`Google Compute Engine`_ no no no no no no -`GoGrid`_ no no no no no no -`HostVirtual`_ no no no no no no -`HP Public Cloud (Helion)`_ yes yes yes yes no yes -`IBM SmartCloud Enterprise`_ no no no no no no -`Ikoula`_ yes yes yes yes no yes -`Joyent`_ no no no no no no -`Kili Public Cloud`_ yes yes yes yes no yes -`KTUCloud`_ yes yes yes yes no yes -`Libvirt`_ no no no no no no -`Linode`_ no no no no no no -`NephoScale`_ no no no no no no -`Nimbus`_ yes yes yes yes no yes -`Ninefold`_ yes yes yes yes no yes -`OpenNebula (v3.8)`_ no no no no no no -`OpenStack`_ no no no no no no -`Opsource`_ no no no no no no -`Outscale INC`_ yes yes yes yes no yes -`Outscale SAS`_ yes yes yes yes no yes -`ProfitBricks`_ no no no no no no -`Rackspace Cloud (Next Gen)`_ yes yes yes yes no yes -`Rackspace Cloud (First Gen)`_ no no no no no no -`RimuHosting`_ no no no no no no -`ServerLove`_ no no no no no no -`skalicloud`_ no no no no no no -`SoftLayer`_ yes yes yes yes no yes -`vCloud`_ no no no no no no -`VCL`_ no no no no no no -`vCloud`_ no no no no no no -`Voxel VoxCLOUD`_ no no no no no no -`vps.net`_ no no no no no no -`VMware vSphere`_ no no no no no no -`Vultr`_ no no no no no no -===================================== ============== ============ =============== ============================= =========================== =============== +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it + +============================== ============== ============ =============== ============================= =========================== =============== +Provider list key pairs get key pair create key pair import public key from string import public key from file delete key pair +============================== ============== ============ =============== ============================= =========================== =============== +`Abiquo`_ no no no no no no +`Aliyun ECS`_ no no no no no no +`PCextreme AuroraCompute`_ yes yes yes yes no yes +`Azure Virtual machines`_ no no no no no no +`Azure Virtual machines`_ no no no no no no +`Brightbox`_ no no no no no no +`Cloudscale`_ no no no no no no +`CloudSigma (API v2.0)`_ yes yes yes yes no yes +`CloudStack`_ yes yes yes yes no yes +`DigitalOcean`_ yes yes yes no no yes +`DimensionData`_ no no no no no no +`Amazon EC2`_ yes yes yes yes no yes +`EquinixMetal`_ yes no yes no no yes +`Eucalyptus`_ yes yes yes yes no yes +`Exoscale`_ yes yes yes yes no yes +`Gandi`_ yes yes no yes no yes +`Google Compute Engine`_ no no no no no no +`GiG G8 Node Provider`_ no no no no no no +`Gridscale`_ yes no no yes no no +`Ikoula`_ yes yes yes yes no yes +`InternetSolutions`_ no no no no no no +`Kamatera`_ no no no no no no +`KTUCloud`_ yes yes yes yes no yes +`kubevirt`_ no no no no no no +`Libvirt`_ no no no no no no +`Linode`_ yes no yes no no no +`Maxihost`_ yes no yes no no no +`Nimbus`_ yes yes yes yes no yes +`NTTAmerica`_ no no no no no no +`NTTC-CIS`_ no no no no no no +`OnApp`_ yes yes no yes no yes +`OpenNebula (v3.8)`_ no no no no no no +`OpenStack`_ no no no no no no +`Outscale API`_ yes yes yes no no yes +`Outscale INC`_ yes yes yes yes no yes +`Outscale SAS`_ yes yes yes yes no yes +`Ovh`_ yes yes no yes no yes +`Rackspace Cloud (Next Gen)`_ yes yes yes yes no yes +`Rackspace Cloud (First Gen)`_ no no no no no no +`RimuHosting`_ no no no no no no +`Scaleway`_ yes no no yes no yes +`vCloud`_ no no no no no no +`Upcloud`_ no no no no no no +`VCL`_ no no no no no no +`vCloud`_ no no no no no no +`vps.net`_ no no no no no no +`VMware vSphere`_ no no no no no no +`Vultr`_ yes yes no yes no yes +============================== ============== ============ =============== ============================= =========================== =============== .. _`Abiquo`: http://www.abiquo.com/ -.. _`PCextreme AuroraCompute`: https://www.pcextreme.nl/aurora/ +.. _`Aliyun ECS`: https://www.aliyun.com/product/ecs +.. _`PCextreme AuroraCompute`: https://www.pcextreme.com/aurora/compute +.. _`Azure Virtual machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ .. _`Azure Virtual machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ -.. _`Bluebox Blocks`: http://bluebox.net .. _`Brightbox`: http://www.brightbox.co.uk/ -.. _`CloudFrames`: http://www.cloudframes.net/ +.. _`Cloudscale`: https://www.cloudscale.ch .. _`CloudSigma (API v2.0)`: http://www.cloudsigma.com/ .. _`CloudStack`: http://cloudstack.org/ .. _`DigitalOcean`: https://www.digitalocean.com -.. _`Dreamhost`: http://dreamhost.com/ -.. _`Amazon EC2`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-northeast-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-southeast-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-southeast-2)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (eu-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (eu-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (sa-east-1)`: http://aws.amazon.com/ec2/ +.. _`DimensionData`: http://www.dimensiondata.com/ .. _`Amazon EC2`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (us-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (us-west-2)`: http://aws.amazon.com/ec2/ -.. _`Enomaly Elastic Computing Platform`: http://www.enomaly.com/ -.. _`ElasticHosts`: http://www.elastichosts.com/ -.. _`ElasticHosts (syd-y)`: http://www.elastichosts.com/ -.. _`ElasticHosts (tor-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (cn-1)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lon-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lon-b)`: http://www.elastichosts.com/ -.. _`ElasticHosts (sat-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lax-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (sjc-c)`: http://www.elastichosts.com/ +.. _`EquinixMetal`: https://metal.equinix.com/ .. _`Eucalyptus`: http://www.eucalyptus.com/ -.. _`Exoscale`: https://www.exoscale.ch/ +.. _`Exoscale`: https://www.exoscale.com/ .. _`Gandi`: http://www.gandi.net/ .. _`Google Compute Engine`: https://cloud.google.com/ -.. _`GoGrid`: http://www.gogrid.com/ -.. _`HostVirtual`: http://www.hostvirtual.com -.. _`HP Public Cloud (Helion)`: http://www.hpcloud.com/ -.. _`IBM SmartCloud Enterprise`: http://ibm.com/services/us/en/cloud-enterprise/ +.. _`GiG G8 Node Provider`: https://gig.tech +.. _`Gridscale`: https://gridscale.io .. _`Ikoula`: http://express.ikoula.co.uk/cloudstack -.. _`Joyent`: http://www.joyentcloud.com -.. _`Kili Public Cloud`: http://kili.io/ +.. _`InternetSolutions`: http://www.is.co.za/ +.. _`Kamatera`: https://www.kamatera.com/ .. _`KTUCloud`: https://ucloudbiz.olleh.com/ +.. _`kubevirt`: https://www.kubevirt.io .. _`Libvirt`: http://libvirt.org/ .. _`Linode`: http://www.linode.com/ -.. _`NephoScale`: http://www.nephoscale.com +.. _`Maxihost`: https://www.maxihost.com/ .. _`Nimbus`: http://www.nimbusproject.org/ -.. _`Ninefold`: http://ninefold.com/ +.. _`NTTAmerica`: http://www.nttamerica.com/ +.. _`NTTC-CIS`: https://www.us.ntt.com/en/services/cloud/enterprise-cloud.html +.. _`OnApp`: http://onapp.com/ .. _`OpenNebula (v3.8)`: http://opennebula.org/ .. _`OpenStack`: http://openstack.org/ -.. _`Opsource`: http://www.opsource.net/ +.. _`Outscale API`: http://www.outscale.com .. _`Outscale INC`: http://www.outscale.com .. _`Outscale SAS`: http://www.outscale.com -.. _`ProfitBricks`: http://www.profitbricks.com +.. _`Ovh`: https://www.ovh.com/ .. _`Rackspace Cloud (Next Gen)`: http://www.rackspace.com .. _`Rackspace Cloud (First Gen)`: http://www.rackspace.com .. _`RimuHosting`: http://rimuhosting.com/ -.. _`ServerLove`: http://www.serverlove.com/ -.. _`skalicloud`: http://www.skalicloud.com/ -.. _`SoftLayer`: http://www.softlayer.com/ +.. _`Scaleway`: https://www.scaleway.com/ .. _`vCloud`: http://www.vmware.com/products/vcloud/ +.. _`Upcloud`: https://www.upcloud.com .. _`VCL`: http://incubator.apache.org/vcl/ .. _`vCloud`: http://www.vmware.com/products/vcloud/ -.. _`Voxel VoxCLOUD`: http://www.voxel.net/ .. _`vps.net`: http://vps.net/ .. _`VMware vSphere`: http://www.vmware.com/products/vsphere/ .. _`Vultr`: https://www.vultr.com diff --git a/docs/compute/_supported_methods_main.rst b/docs/compute/_supported_methods_main.rst index 03a91f1f79..0fffc48a1b 100644 --- a/docs/compute/_supported_methods_main.rst +++ b/docs/compute/_supported_methods_main.rst @@ -1,137 +1,103 @@ -===================================== ========== =========== =========== ============ =========== ========== =========== -Provider list nodes create node reboot node destroy node list images list sizes deploy node -===================================== ========== =========== =========== ============ =========== ========== =========== -`Abiquo`_ yes yes yes yes yes yes no -`PCextreme AuroraCompute`_ yes yes yes yes yes yes yes -`Azure Virtual machines`_ yes yes yes yes yes yes yes -`Bluebox Blocks`_ yes yes yes yes yes yes yes -`Brightbox`_ yes yes no yes yes yes no -`CloudFrames`_ yes yes yes yes yes yes no -`CloudSigma (API v2.0)`_ yes yes no yes yes yes no -`CloudStack`_ yes yes yes yes yes yes yes -`DigitalOcean`_ yes yes yes yes yes yes no -`Dreamhost`_ yes yes yes yes yes yes no -`Amazon EC2`_ yes yes yes yes yes yes yes -`Amazon EC2 (ap-northeast-1)`_ yes yes yes yes yes yes yes -`Amazon EC2 (ap-southeast-1)`_ yes yes yes yes yes yes yes -`Amazon EC2 (ap-southeast-2)`_ yes yes yes yes yes yes yes -`Amazon EC2 (eu-west-1)`_ yes yes yes yes yes yes yes -`Amazon EC2 (eu-west-1)`_ yes yes yes yes yes yes yes -`Amazon EC2 (sa-east-1)`_ yes yes yes yes yes yes yes -`Amazon EC2`_ yes yes yes yes yes yes yes -`Amazon EC2 (us-west-1)`_ yes yes yes yes yes yes yes -`Amazon EC2 (us-west-2)`_ yes yes yes yes yes yes yes -`Enomaly Elastic Computing Platform`_ yes yes yes yes yes yes no -`ElasticHosts`_ yes yes yes yes yes yes yes -`ElasticHosts (syd-y)`_ yes yes yes yes yes yes yes -`ElasticHosts (tor-p)`_ yes yes yes yes yes yes yes -`ElasticHosts (cn-1)`_ yes yes yes yes yes yes yes -`ElasticHosts (lon-p)`_ yes yes yes yes yes yes yes -`ElasticHosts (lon-b)`_ yes yes yes yes yes yes yes -`ElasticHosts (sat-p)`_ yes yes yes yes yes yes yes -`ElasticHosts (lax-p)`_ yes yes yes yes yes yes yes -`ElasticHosts (sjc-c)`_ yes yes yes yes yes yes yes -`Eucalyptus`_ yes yes yes yes yes yes yes -`Exoscale`_ yes yes yes yes yes yes yes -`Gandi`_ yes yes yes yes yes yes no -`Google Compute Engine`_ yes yes yes yes yes yes no -`GoGrid`_ yes yes yes yes yes yes yes -`HostVirtual`_ yes yes yes yes yes yes yes -`HP Public Cloud (Helion)`_ yes yes yes yes yes yes yes -`IBM SmartCloud Enterprise`_ yes yes yes yes yes yes no -`Ikoula`_ yes yes yes yes yes yes yes -`Joyent`_ yes yes yes yes yes yes yes -`Kili Public Cloud`_ yes yes yes yes yes yes yes -`KTUCloud`_ yes yes yes yes yes yes yes -`Libvirt`_ yes no yes yes no no no -`Linode`_ yes yes yes yes yes yes yes -`NephoScale`_ yes yes yes yes yes yes yes -`Nimbus`_ yes yes yes yes yes yes yes -`Ninefold`_ yes yes yes yes yes yes yes -`OpenNebula (v3.8)`_ yes yes yes yes yes yes no -`OpenStack`_ yes no yes yes yes yes no -`Opsource`_ yes yes yes yes yes yes yes -`Outscale INC`_ yes yes yes yes yes yes yes -`Outscale SAS`_ yes yes yes yes yes yes yes -`ProfitBricks`_ yes yes yes yes yes yes no -`Rackspace Cloud (Next Gen)`_ yes yes yes yes yes yes yes -`Rackspace Cloud (First Gen)`_ yes yes yes yes yes yes yes -`RimuHosting`_ yes yes yes yes yes yes yes -`ServerLove`_ yes yes yes yes yes yes yes -`skalicloud`_ yes yes yes yes yes yes yes -`SoftLayer`_ yes yes yes yes yes yes yes -`vCloud`_ yes yes yes yes yes yes yes -`VCL`_ yes yes no yes yes yes no -`vCloud`_ yes yes yes yes yes yes yes -`Voxel VoxCLOUD`_ yes yes yes yes yes yes no -`vps.net`_ yes yes yes yes yes yes no -`VMware vSphere`_ yes no yes yes yes no no -`Vultr`_ yes yes yes yes yes yes no -===================================== ========== =========== =========== ============ =========== ========== =========== +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it + +============================== ========== =========== =========== ============ ========== ========= =========== ========== =========== +Provider list nodes create node reboot node destroy node start node stop node list images list sizes deploy node +============================== ========== =========== =========== ============ ========== ========= =========== ========== =========== +`Abiquo`_ yes yes yes yes no no yes yes no +`Aliyun ECS`_ yes yes yes yes yes yes yes yes yes +`PCextreme AuroraCompute`_ yes yes yes yes no no yes yes yes +`Azure Virtual machines`_ yes yes yes yes no no yes yes yes +`Azure Virtual machines`_ yes yes yes yes yes yes yes yes yes +`Brightbox`_ yes yes no yes no no yes yes no +`Cloudscale`_ yes yes yes yes yes yes yes yes no +`CloudSigma (API v2.0)`_ yes yes yes yes yes yes yes yes no +`CloudStack`_ yes yes yes yes no no yes yes yes +`DigitalOcean`_ yes yes yes yes no no yes yes no +`DimensionData`_ yes yes yes yes yes yes yes yes yes +`Amazon EC2`_ yes yes yes yes yes yes yes yes yes +`EquinixMetal`_ yes yes yes yes yes yes yes yes no +`Eucalyptus`_ yes yes yes yes yes yes yes yes yes +`Exoscale`_ yes yes yes yes no no yes yes yes +`Gandi`_ yes yes yes yes no no yes yes no +`Google Compute Engine`_ yes yes yes yes yes yes yes yes yes +`GiG G8 Node Provider`_ yes yes yes yes yes yes yes yes no +`Gridscale`_ yes yes yes yes yes no yes no yes +`Ikoula`_ yes yes yes yes no no yes yes yes +`InternetSolutions`_ yes yes yes yes yes yes yes yes yes +`Kamatera`_ yes yes yes yes yes yes yes yes yes +`KTUCloud`_ yes yes yes yes no no yes yes yes +`kubevirt`_ yes yes yes yes yes yes yes yes yes +`Libvirt`_ yes no yes yes yes yes no no no +`Linode`_ yes yes yes yes yes yes yes yes no +`Maxihost`_ yes yes yes yes yes yes yes yes no +`Nimbus`_ yes yes yes yes yes yes yes yes yes +`NTTAmerica`_ yes yes yes yes yes yes yes yes yes +`NTTC-CIS`_ yes yes yes yes yes yes yes yes yes +`OnApp`_ yes yes no yes no no yes no no +`OpenNebula (v3.8)`_ yes yes yes yes no no yes yes no +`OpenStack`_ yes no yes yes yes yes yes yes no +`Outscale API`_ yes yes yes yes yes yes yes no no +`Outscale INC`_ yes yes yes yes yes yes yes yes yes +`Outscale SAS`_ yes yes yes yes yes yes yes yes yes +`Ovh`_ yes yes no yes no no yes yes yes +`Rackspace Cloud (Next Gen)`_ yes yes yes yes yes yes yes yes yes +`Rackspace Cloud (First Gen)`_ yes yes yes yes yes yes yes yes yes +`RimuHosting`_ yes yes yes yes no no yes yes yes +`Scaleway`_ yes yes yes yes no no yes yes no +`vCloud`_ yes yes yes yes no no yes yes yes +`Upcloud`_ yes yes yes yes no no yes yes yes +`VCL`_ yes yes no yes no no yes yes no +`vCloud`_ yes yes yes yes no no yes yes yes +`vps.net`_ yes yes yes yes no no yes yes no +`VMware vSphere`_ yes yes yes yes yes yes yes yes no +`Vultr`_ yes yes yes yes yes yes yes yes no +============================== ========== =========== =========== ============ ========== ========= =========== ========== =========== .. _`Abiquo`: http://www.abiquo.com/ -.. _`PCextreme AuroraCompute`: https://www.pcextreme.nl/aurora/ +.. _`Aliyun ECS`: https://www.aliyun.com/product/ecs +.. _`PCextreme AuroraCompute`: https://www.pcextreme.com/aurora/compute +.. _`Azure Virtual machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ .. _`Azure Virtual machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ -.. _`Bluebox Blocks`: http://bluebox.net .. _`Brightbox`: http://www.brightbox.co.uk/ -.. _`CloudFrames`: http://www.cloudframes.net/ +.. _`Cloudscale`: https://www.cloudscale.ch .. _`CloudSigma (API v2.0)`: http://www.cloudsigma.com/ .. _`CloudStack`: http://cloudstack.org/ .. _`DigitalOcean`: https://www.digitalocean.com -.. _`Dreamhost`: http://dreamhost.com/ -.. _`Amazon EC2`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-northeast-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-southeast-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-southeast-2)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (eu-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (eu-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (sa-east-1)`: http://aws.amazon.com/ec2/ +.. _`DimensionData`: http://www.dimensiondata.com/ .. _`Amazon EC2`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (us-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (us-west-2)`: http://aws.amazon.com/ec2/ -.. _`Enomaly Elastic Computing Platform`: http://www.enomaly.com/ -.. _`ElasticHosts`: http://www.elastichosts.com/ -.. _`ElasticHosts (syd-y)`: http://www.elastichosts.com/ -.. _`ElasticHosts (tor-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (cn-1)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lon-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lon-b)`: http://www.elastichosts.com/ -.. _`ElasticHosts (sat-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lax-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (sjc-c)`: http://www.elastichosts.com/ +.. _`EquinixMetal`: https://metal.equinix.com/ .. _`Eucalyptus`: http://www.eucalyptus.com/ -.. _`Exoscale`: https://www.exoscale.ch/ +.. _`Exoscale`: https://www.exoscale.com/ .. _`Gandi`: http://www.gandi.net/ .. _`Google Compute Engine`: https://cloud.google.com/ -.. _`GoGrid`: http://www.gogrid.com/ -.. _`HostVirtual`: http://www.hostvirtual.com -.. _`HP Public Cloud (Helion)`: http://www.hpcloud.com/ -.. _`IBM SmartCloud Enterprise`: http://ibm.com/services/us/en/cloud-enterprise/ +.. _`GiG G8 Node Provider`: https://gig.tech +.. _`Gridscale`: https://gridscale.io .. _`Ikoula`: http://express.ikoula.co.uk/cloudstack -.. _`Joyent`: http://www.joyentcloud.com -.. _`Kili Public Cloud`: http://kili.io/ +.. _`InternetSolutions`: http://www.is.co.za/ +.. _`Kamatera`: https://www.kamatera.com/ .. _`KTUCloud`: https://ucloudbiz.olleh.com/ +.. _`kubevirt`: https://www.kubevirt.io .. _`Libvirt`: http://libvirt.org/ .. _`Linode`: http://www.linode.com/ -.. _`NephoScale`: http://www.nephoscale.com +.. _`Maxihost`: https://www.maxihost.com/ .. _`Nimbus`: http://www.nimbusproject.org/ -.. _`Ninefold`: http://ninefold.com/ +.. _`NTTAmerica`: http://www.nttamerica.com/ +.. _`NTTC-CIS`: https://www.us.ntt.com/en/services/cloud/enterprise-cloud.html +.. _`OnApp`: http://onapp.com/ .. _`OpenNebula (v3.8)`: http://opennebula.org/ .. _`OpenStack`: http://openstack.org/ -.. _`Opsource`: http://www.opsource.net/ +.. _`Outscale API`: http://www.outscale.com .. _`Outscale INC`: http://www.outscale.com .. _`Outscale SAS`: http://www.outscale.com -.. _`ProfitBricks`: http://www.profitbricks.com +.. _`Ovh`: https://www.ovh.com/ .. _`Rackspace Cloud (Next Gen)`: http://www.rackspace.com .. _`Rackspace Cloud (First Gen)`: http://www.rackspace.com .. _`RimuHosting`: http://rimuhosting.com/ -.. _`ServerLove`: http://www.serverlove.com/ -.. _`skalicloud`: http://www.skalicloud.com/ -.. _`SoftLayer`: http://www.softlayer.com/ +.. _`Scaleway`: https://www.scaleway.com/ .. _`vCloud`: http://www.vmware.com/products/vcloud/ +.. _`Upcloud`: https://www.upcloud.com .. _`VCL`: http://incubator.apache.org/vcl/ .. _`vCloud`: http://www.vmware.com/products/vcloud/ -.. _`Voxel VoxCLOUD`: http://www.voxel.net/ .. _`vps.net`: http://vps.net/ .. _`VMware vSphere`: http://www.vmware.com/products/vsphere/ .. _`Vultr`: https://www.vultr.com diff --git a/docs/compute/_supported_providers.rst b/docs/compute/_supported_providers.rst index 23556d9a0a..353ae00c8a 100644 --- a/docs/compute/_supported_providers.rst +++ b/docs/compute/_supported_providers.rst @@ -1,137 +1,103 @@ -===================================== ============================================= =================== ============================================== ==================================== -Provider Documentation Provider constant Module Class Name -===================================== ============================================= =================== ============================================== ==================================== -`Abiquo`_ ABIQUO :mod:`libcloud.compute.drivers.abiquo` :class:`AbiquoNodeDriver` -`PCextreme AuroraCompute`_ :doc:`Click ` AURORACOMPUTE :mod:`libcloud.compute.drivers.auroracompute` :class:`AuroraComputeNodeDriver` -`Azure Virtual machines`_ :doc:`Click ` AZURE :mod:`libcloud.compute.drivers.azure` :class:`AzureNodeDriver` -`Bluebox Blocks`_ BLUEBOX :mod:`libcloud.compute.drivers.bluebox` :class:`BlueboxNodeDriver` -`Brightbox`_ BRIGHTBOX :mod:`libcloud.compute.drivers.brightbox` :class:`BrightboxNodeDriver` -`CloudFrames`_ :doc:`Click ` CLOUDFRAMES :mod:`libcloud.compute.drivers.cloudframes` :class:`CloudFramesNodeDriver` -`CloudSigma (API v2.0)`_ :doc:`Click ` CLOUDSIGMA :mod:`libcloud.compute.drivers.cloudsigma` :class:`CloudSigmaNodeDriver` -`CloudStack`_ :doc:`Click ` CLOUDSTACK :mod:`libcloud.compute.drivers.cloudstack` :class:`CloudStackNodeDriver` -`DigitalOcean`_ :doc:`Click ` DIGITAL_OCEAN :mod:`libcloud.compute.drivers.digitalocean` :class:`DigitalOceanNodeDriver` -`Dreamhost`_ DREAMHOST :mod:`libcloud.compute.drivers.dreamhost` :class:`DreamhostNodeDriver` -`Amazon EC2`_ :doc:`Click ` EC2 :mod:`libcloud.compute.drivers.ec2` :class:`EC2NodeDriver` -`Amazon EC2 (ap-northeast-1)`_ EC2_AP_NORTHEAST :mod:`libcloud.compute.drivers.ec2` :class:`EC2APNENodeDriver` -`Amazon EC2 (ap-southeast-1)`_ EC2_AP_SOUTHEAST :mod:`libcloud.compute.drivers.ec2` :class:`EC2APSENodeDriver` -`Amazon EC2 (ap-southeast-2)`_ EC2_AP_SOUTHEAST2 :mod:`libcloud.compute.drivers.ec2` :class:`EC2APSESydneyNodeDriver` -`Amazon EC2 (eu-west-1)`_ EC2_EU :mod:`libcloud.compute.drivers.ec2` :class:`EC2EUNodeDriver` -`Amazon EC2 (eu-west-1)`_ EC2_EU_WEST :mod:`libcloud.compute.drivers.ec2` :class:`EC2EUNodeDriver` -`Amazon EC2 (sa-east-1)`_ EC2_SA_EAST :mod:`libcloud.compute.drivers.ec2` :class:`EC2SAEastNodeDriver` -`Amazon EC2`_ EC2_US_EAST :mod:`libcloud.compute.drivers.ec2` :class:`EC2NodeDriver` -`Amazon EC2 (us-west-1)`_ EC2_US_WEST :mod:`libcloud.compute.drivers.ec2` :class:`EC2USWestNodeDriver` -`Amazon EC2 (us-west-2)`_ EC2_US_WEST_OREGON :mod:`libcloud.compute.drivers.ec2` :class:`EC2USWestOregonNodeDriver` -`Enomaly Elastic Computing Platform`_ ECP :mod:`libcloud.compute.drivers.ecp` :class:`ECPNodeDriver` -`ElasticHosts`_ ELASTICHOSTS :mod:`libcloud.compute.drivers.elastichosts` :class:`ElasticHostsNodeDriver` -`ElasticHosts (syd-y)`_ ELASTICHOSTS_AU1 :mod:`libcloud.compute.drivers.elastichosts` :class:`ElasticHostsAU1NodeDriver` -`ElasticHosts (tor-p)`_ ELASTICHOSTS_CA1 :mod:`libcloud.compute.drivers.elastichosts` :class:`ElasticHostsCA1NodeDriver` -`ElasticHosts (cn-1)`_ ELASTICHOSTS_CN1 :mod:`libcloud.compute.drivers.elastichosts` :class:`ElasticHostsCN1NodeDriver` -`ElasticHosts (lon-p)`_ ELASTICHOSTS_UK1 :mod:`libcloud.compute.drivers.elastichosts` :class:`ElasticHostsUK1NodeDriver` -`ElasticHosts (lon-b)`_ ELASTICHOSTS_UK2 :mod:`libcloud.compute.drivers.elastichosts` :class:`ElasticHostsUK2NodeDriver` -`ElasticHosts (sat-p)`_ ELASTICHOSTS_US1 :mod:`libcloud.compute.drivers.elastichosts` :class:`ElasticHostsUS1NodeDriver` -`ElasticHosts (lax-p)`_ ELASTICHOSTS_US2 :mod:`libcloud.compute.drivers.elastichosts` :class:`ElasticHostsUS2NodeDriver` -`ElasticHosts (sjc-c)`_ ELASTICHOSTS_US3 :mod:`libcloud.compute.drivers.elastichosts` :class:`ElasticHostsUS3NodeDriver` -`Eucalyptus`_ EUCALYPTUS :mod:`libcloud.compute.drivers.ec2` :class:`EucNodeDriver` -`Exoscale`_ :doc:`Click ` EXOSCALE :mod:`libcloud.compute.drivers.exoscale` :class:`ExoscaleNodeDriver` -`Gandi`_ GANDI :mod:`libcloud.compute.drivers.gandi` :class:`GandiNodeDriver` -`Google Compute Engine`_ :doc:`Click ` GCE :mod:`libcloud.compute.drivers.gce` :class:`GCENodeDriver` -`GoGrid`_ GOGRID :mod:`libcloud.compute.drivers.gogrid` :class:`GoGridNodeDriver` -`HostVirtual`_ HOSTVIRTUAL :mod:`libcloud.compute.drivers.hostvirtual` :class:`HostVirtualNodeDriver` -`HP Public Cloud (Helion)`_ :doc:`Click ` HPCLOUD :mod:`libcloud.compute.drivers.hpcloud` :class:`HPCloudNodeDriver` -`IBM SmartCloud Enterprise`_ IBM :mod:`libcloud.compute.drivers.ibm_sce` :class:`IBMNodeDriver` -`Ikoula`_ :doc:`Click ` IKOULA :mod:`libcloud.compute.drivers.ikoula` :class:`IkoulaNodeDriver` -`Joyent`_ JOYENT :mod:`libcloud.compute.drivers.joyent` :class:`JoyentNodeDriver` -`Kili Public Cloud`_ :doc:`Click ` KILI :mod:`libcloud.compute.drivers.kili` :class:`KiliCloudNodeDriver` -`KTUCloud`_ KTUCLOUD :mod:`libcloud.compute.drivers.ktucloud` :class:`KTUCloudNodeDriver` -`Libvirt`_ :doc:`Click ` LIBVIRT :mod:`libcloud.compute.drivers.libvirt_driver` :class:`LibvirtNodeDriver` -`Linode`_ LINODE :mod:`libcloud.compute.drivers.linode` :class:`LinodeNodeDriver` -`NephoScale`_ NEPHOSCALE :mod:`libcloud.compute.drivers.nephoscale` :class:`NephoscaleNodeDriver` -`Nimbus`_ :doc:`Click ` NIMBUS :mod:`libcloud.compute.drivers.ec2` :class:`NimbusNodeDriver` -`Ninefold`_ NINEFOLD :mod:`libcloud.compute.drivers.ninefold` :class:`NinefoldNodeDriver` -`OpenNebula (v3.8)`_ OPENNEBULA :mod:`libcloud.compute.drivers.opennebula` :class:`OpenNebulaNodeDriver` -`OpenStack`_ :doc:`Click ` OPENSTACK :mod:`libcloud.compute.drivers.openstack` :class:`OpenStackNodeDriver` -`Opsource`_ OPSOURCE :mod:`libcloud.compute.drivers.opsource` :class:`OpsourceNodeDriver` -`Outscale INC`_ :doc:`Click ` OUTSCALE_INC :mod:`libcloud.compute.drivers.ec2` :class:`OutscaleINCNodeDriver` -`Outscale SAS`_ :doc:`Click ` OUTSCALE_SAS :mod:`libcloud.compute.drivers.ec2` :class:`OutscaleSASNodeDriver` -`ProfitBricks`_ PROFIT_BRICKS :mod:`libcloud.compute.drivers.profitbricks` :class:`ProfitBricksNodeDriver` -`Rackspace Cloud (Next Gen)`_ :doc:`Click ` RACKSPACE :mod:`libcloud.compute.drivers.rackspace` :class:`RackspaceNodeDriver` -`Rackspace Cloud (First Gen)`_ RACKSPACE_FIRST_GEN :mod:`libcloud.compute.drivers.rackspace` :class:`RackspaceFirstGenNodeDriver` -`RimuHosting`_ RIMUHOSTING :mod:`libcloud.compute.drivers.rimuhosting` :class:`RimuHostingNodeDriver` -`ServerLove`_ SERVERLOVE :mod:`libcloud.compute.drivers.serverlove` :class:`ServerLoveNodeDriver` -`skalicloud`_ SKALICLOUD :mod:`libcloud.compute.drivers.skalicloud` :class:`SkaliCloudNodeDriver` -`SoftLayer`_ SOFTLAYER :mod:`libcloud.compute.drivers.softlayer` :class:`SoftLayerNodeDriver` -`vCloud`_ TERREMARK :mod:`libcloud.compute.drivers.vcloud` :class:`TerremarkDriver` -`VCL`_ VCL :mod:`libcloud.compute.drivers.vcl` :class:`VCLNodeDriver` -`vCloud`_ :doc:`Click ` VCLOUD :mod:`libcloud.compute.drivers.vcloud` :class:`VCloudNodeDriver` -`Voxel VoxCLOUD`_ VOXEL :mod:`libcloud.compute.drivers.voxel` :class:`VoxelNodeDriver` -`vps.net`_ VPSNET :mod:`libcloud.compute.drivers.vpsnet` :class:`VPSNetNodeDriver` -`VMware vSphere`_ :doc:`Click ` VSPHERE :mod:`libcloud.compute.drivers.vsphere` :class:`VSphereNodeDriver` -`Vultr`_ :doc:`Click ` VULTR :mod:`libcloud.compute.drivers.vultr` :class:`VultrNodeDriver` -===================================== ============================================= =================== ============================================== ==================================== +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it + +============================== ================================================= =================== ======================================================================================================================================================================================================================================================================================================== ================================================= ==================================== +Provider Documentation Provider Constant Supported Regions Module Class Name +============================== ================================================= =================== ======================================================================================================================================================================================================================================================================================================== ================================================= ==================================== +`Abiquo`_ ABIQUO single region driver :mod:`libcloud.compute.drivers.abiquo` :class:`AbiquoNodeDriver` +`Aliyun ECS`_ :doc:`Click ` ALIYUN_ECS single region driver :mod:`libcloud.compute.drivers.ecs` :class:`ECSDriver` +`PCextreme AuroraCompute`_ :doc:`Click ` AURORACOMPUTE single region driver :mod:`libcloud.compute.drivers.auroracompute` :class:`AuroraComputeNodeDriver` +`Azure Virtual machines`_ :doc:`Click ` AZURE single region driver :mod:`libcloud.compute.drivers.azure` :class:`AzureNodeDriver` +`Azure Virtual machines`_ :doc:`Click ` AZURE_ARM single region driver :mod:`libcloud.compute.drivers.azure_arm` :class:`AzureNodeDriver` +`Brightbox`_ BRIGHTBOX single region driver :mod:`libcloud.compute.drivers.brightbox` :class:`BrightboxNodeDriver` +`Cloudscale`_ :doc:`Click ` CLOUDSCALE single region driver :mod:`libcloud.compute.drivers.cloudscale` :class:`CloudscaleNodeDriver` +`CloudSigma (API v2.0)`_ :doc:`Click ` CLOUDSIGMA single region driver :mod:`libcloud.compute.drivers.cloudsigma` :class:`CloudSigmaNodeDriver` +`CloudStack`_ :doc:`Click ` CLOUDSTACK single region driver :mod:`libcloud.compute.drivers.cloudstack` :class:`CloudStackNodeDriver` +`DigitalOcean`_ :doc:`Click ` DIGITAL_OCEAN single region driver :mod:`libcloud.compute.drivers.digitalocean` :class:`DigitalOceanNodeDriver` +`DimensionData`_ :doc:`Click ` DIMENSIONDATA single region driver :mod:`libcloud.compute.drivers.dimensiondata` :class:`DimensionDataNodeDriver` +`Amazon EC2`_ :doc:`Click ` EC2 af-south-1, ap-east-1, ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-southeast-1, ap-southeast-2, ca-central-1, cn-north-1, cn-northwest-1, eu-central-1, eu-north-1, eu-south-1, eu-west-1, eu-west-2, eu-west-3, sa-east-1, us-east-1, us-east-2, us-gov-west-1, us-west-1, us-west-2 :mod:`libcloud.compute.drivers.ec2` :class:`EC2NodeDriver` +`EquinixMetal`_ :doc:`Click ` EQUINIXMETAL single region driver :mod:`libcloud.compute.drivers.equinixmetal` :class:`EquinixMetalNodeDriver` +`Eucalyptus`_ EUCALYPTUS single region driver :mod:`libcloud.compute.drivers.ec2` :class:`EucNodeDriver` +`Exoscale`_ :doc:`Click ` EXOSCALE single region driver :mod:`libcloud.compute.drivers.exoscale` :class:`ExoscaleNodeDriver` +`Gandi`_ :doc:`Click ` GANDI single region driver :mod:`libcloud.compute.drivers.gandi` :class:`GandiNodeDriver` +`Google Compute Engine`_ :doc:`Click ` GCE single region driver :mod:`libcloud.compute.drivers.gce` :class:`GCENodeDriver` +`GiG G8 Node Provider`_ GIG_G8 single region driver :mod:`libcloud.compute.drivers.gig_g8` :class:`G8NodeDriver` +`Gridscale`_ :doc:`Click ` GRIDSCALE single region driver :mod:`libcloud.compute.drivers.gridscale` :class:`GridscaleNodeDriver` +`Ikoula`_ :doc:`Click ` IKOULA single region driver :mod:`libcloud.compute.drivers.ikoula` :class:`IkoulaNodeDriver` +`InternetSolutions`_ :doc:`Click ` INTERNETSOLUTIONS single region driver :mod:`libcloud.compute.drivers.internetsolutions` :class:`InternetSolutionsNodeDriver` +`Kamatera`_ :doc:`Click ` KAMATERA single region driver :mod:`libcloud.compute.drivers.kamatera` :class:`KamateraNodeDriver` +`KTUCloud`_ KTUCLOUD single region driver :mod:`libcloud.compute.drivers.ktucloud` :class:`KTUCloudNodeDriver` +`kubevirt`_ KUBEVIRT single region driver :mod:`libcloud.compute.drivers.kubevirt` :class:`KubeVirtNodeDriver` +`Libvirt`_ :doc:`Click ` LIBVIRT single region driver :mod:`libcloud.compute.drivers.libvirt_driver` :class:`LibvirtNodeDriver` +`Linode`_ LINODE single region driver :mod:`libcloud.compute.drivers.linode` :class:`LinodeNodeDriver` +`Maxihost`_ :doc:`Click ` MAXIHOST single region driver :mod:`libcloud.compute.drivers.maxihost` :class:`MaxihostNodeDriver` +`Nimbus`_ :doc:`Click ` NIMBUS single region driver :mod:`libcloud.compute.drivers.ec2` :class:`NimbusNodeDriver` +`NTTAmerica`_ :doc:`Click ` NTTA single region driver :mod:`libcloud.compute.drivers.ntta` :class:`NTTAmericaNodeDriver` +`NTTC-CIS`_ :doc:`Click ` NTTCIS single region driver :mod:`libcloud.compute.drivers.nttcis` :class:`NttCisNodeDriver` +`OnApp`_ :doc:`Click ` ONAPP single region driver :mod:`libcloud.compute.drivers.onapp` :class:`OnAppNodeDriver` +`OpenNebula (v3.8)`_ OPENNEBULA single region driver :mod:`libcloud.compute.drivers.opennebula` :class:`OpenNebulaNodeDriver` +`OpenStack`_ :doc:`Click ` OPENSTACK single region driver :mod:`libcloud.compute.drivers.openstack` :class:`OpenStackNodeDriver` +`Outscale API`_ :doc:`Click ` OUTSCALE single region driver :mod:`libcloud.compute.drivers.outscale` :class:`OutscaleNodeDriver` +`Outscale INC`_ :doc:`Click ` OUTSCALE_INC single region driver :mod:`libcloud.compute.drivers.ec2` :class:`OutscaleINCNodeDriver` +`Outscale SAS`_ :doc:`Click ` OUTSCALE_SAS single region driver :mod:`libcloud.compute.drivers.ec2` :class:`OutscaleSASNodeDriver` +`Ovh`_ :doc:`Click ` OVH ca, eu :mod:`libcloud.compute.drivers.ovh` :class:`OvhNodeDriver` +`Rackspace Cloud (Next Gen)`_ :doc:`Click ` RACKSPACE single region driver :mod:`libcloud.compute.drivers.rackspace` :class:`RackspaceNodeDriver` +`Rackspace Cloud (First Gen)`_ RACKSPACE_FIRST_GEN single region driver :mod:`libcloud.compute.drivers.rackspace` :class:`RackspaceFirstGenNodeDriver` +`RimuHosting`_ RIMUHOSTING single region driver :mod:`libcloud.compute.drivers.rimuhosting` :class:`RimuHostingNodeDriver` +`Scaleway`_ :doc:`Click ` SCALEWAY single region driver :mod:`libcloud.compute.drivers.scaleway` :class:`ScalewayNodeDriver` +`vCloud`_ TERREMARK single region driver :mod:`libcloud.compute.drivers.vcloud` :class:`TerremarkDriver` +`Upcloud`_ :doc:`Click ` UPCLOUD single region driver :mod:`libcloud.compute.drivers.upcloud` :class:`UpcloudDriver` +`VCL`_ VCL single region driver :mod:`libcloud.compute.drivers.vcl` :class:`VCLNodeDriver` +`vCloud`_ :doc:`Click ` VCLOUD single region driver :mod:`libcloud.compute.drivers.vcloud` :class:`VCloudNodeDriver` +`vps.net`_ VPSNET single region driver :mod:`libcloud.compute.drivers.vpsnet` :class:`VPSNetNodeDriver` +`VMware vSphere`_ :doc:`Click ` VSPHERE single region driver :mod:`libcloud.compute.drivers.vsphere` :class:`VSphereNodeDriver` +`Vultr`_ :doc:`Click ` VULTR single region driver :mod:`libcloud.compute.drivers.vultr` :class:`VultrNodeDriver` +============================== ================================================= =================== ======================================================================================================================================================================================================================================================================================================== ================================================= ==================================== .. _`Abiquo`: http://www.abiquo.com/ -.. _`PCextreme AuroraCompute`: https://www.pcextreme.nl/aurora/ +.. _`Aliyun ECS`: https://www.aliyun.com/product/ecs +.. _`PCextreme AuroraCompute`: https://www.pcextreme.com/aurora/compute +.. _`Azure Virtual machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ .. _`Azure Virtual machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ -.. _`Bluebox Blocks`: http://bluebox.net .. _`Brightbox`: http://www.brightbox.co.uk/ -.. _`CloudFrames`: http://www.cloudframes.net/ +.. _`Cloudscale`: https://www.cloudscale.ch .. _`CloudSigma (API v2.0)`: http://www.cloudsigma.com/ .. _`CloudStack`: http://cloudstack.org/ .. _`DigitalOcean`: https://www.digitalocean.com -.. _`Dreamhost`: http://dreamhost.com/ -.. _`Amazon EC2`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-northeast-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-southeast-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (ap-southeast-2)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (eu-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (eu-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (sa-east-1)`: http://aws.amazon.com/ec2/ +.. _`DimensionData`: http://www.dimensiondata.com/ .. _`Amazon EC2`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (us-west-1)`: http://aws.amazon.com/ec2/ -.. _`Amazon EC2 (us-west-2)`: http://aws.amazon.com/ec2/ -.. _`Enomaly Elastic Computing Platform`: http://www.enomaly.com/ -.. _`ElasticHosts`: http://www.elastichosts.com/ -.. _`ElasticHosts (syd-y)`: http://www.elastichosts.com/ -.. _`ElasticHosts (tor-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (cn-1)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lon-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lon-b)`: http://www.elastichosts.com/ -.. _`ElasticHosts (sat-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (lax-p)`: http://www.elastichosts.com/ -.. _`ElasticHosts (sjc-c)`: http://www.elastichosts.com/ +.. _`EquinixMetal`: https://metal.equinix.com/ .. _`Eucalyptus`: http://www.eucalyptus.com/ -.. _`Exoscale`: https://www.exoscale.ch/ +.. _`Exoscale`: https://www.exoscale.com/ .. _`Gandi`: http://www.gandi.net/ .. _`Google Compute Engine`: https://cloud.google.com/ -.. _`GoGrid`: http://www.gogrid.com/ -.. _`HostVirtual`: http://www.hostvirtual.com -.. _`HP Public Cloud (Helion)`: http://www.hpcloud.com/ -.. _`IBM SmartCloud Enterprise`: http://ibm.com/services/us/en/cloud-enterprise/ +.. _`GiG G8 Node Provider`: https://gig.tech +.. _`Gridscale`: https://gridscale.io .. _`Ikoula`: http://express.ikoula.co.uk/cloudstack -.. _`Joyent`: http://www.joyentcloud.com -.. _`Kili Public Cloud`: http://kili.io/ +.. _`InternetSolutions`: http://www.is.co.za/ +.. _`Kamatera`: https://www.kamatera.com/ .. _`KTUCloud`: https://ucloudbiz.olleh.com/ +.. _`kubevirt`: https://www.kubevirt.io .. _`Libvirt`: http://libvirt.org/ .. _`Linode`: http://www.linode.com/ -.. _`NephoScale`: http://www.nephoscale.com +.. _`Maxihost`: https://www.maxihost.com/ .. _`Nimbus`: http://www.nimbusproject.org/ -.. _`Ninefold`: http://ninefold.com/ +.. _`NTTAmerica`: http://www.nttamerica.com/ +.. _`NTTC-CIS`: https://www.us.ntt.com/en/services/cloud/enterprise-cloud.html +.. _`OnApp`: http://onapp.com/ .. _`OpenNebula (v3.8)`: http://opennebula.org/ .. _`OpenStack`: http://openstack.org/ -.. _`Opsource`: http://www.opsource.net/ +.. _`Outscale API`: http://www.outscale.com .. _`Outscale INC`: http://www.outscale.com .. _`Outscale SAS`: http://www.outscale.com -.. _`ProfitBricks`: http://www.profitbricks.com +.. _`Ovh`: https://www.ovh.com/ .. _`Rackspace Cloud (Next Gen)`: http://www.rackspace.com .. _`Rackspace Cloud (First Gen)`: http://www.rackspace.com .. _`RimuHosting`: http://rimuhosting.com/ -.. _`ServerLove`: http://www.serverlove.com/ -.. _`skalicloud`: http://www.skalicloud.com/ -.. _`SoftLayer`: http://www.softlayer.com/ +.. _`Scaleway`: https://www.scaleway.com/ .. _`vCloud`: http://www.vmware.com/products/vcloud/ +.. _`Upcloud`: https://www.upcloud.com .. _`VCL`: http://incubator.apache.org/vcl/ .. _`vCloud`: http://www.vmware.com/products/vcloud/ -.. _`Voxel VoxCLOUD`: http://www.voxel.net/ .. _`vps.net`: http://vps.net/ .. _`VMware vSphere`: http://www.vmware.com/products/vsphere/ .. _`Vultr`: https://www.vultr.com diff --git a/docs/compute/deployment.rst b/docs/compute/deployment.rst index bba91fc52a..900f285b53 100644 --- a/docs/compute/deployment.rst +++ b/docs/compute/deployment.rst @@ -17,10 +17,78 @@ As noted above, this functionality is there to help you bootstrap a server and is not a replacement for a configuration management software such as `Chef`_ `Puppet`_, `Salt`_, `CFEngine`_ and others. -Once your server has been bootstrapped, libcloud.deploy task should be done +Once your server has been bootstrapped, libcloud.deploy task should be finished and replaced by other tools such as previously mentioned configuration management software. +.. note:: + + paramiko v2.9.0 introduced a change to prefer SHA-2 variants of RSA key + verification algorithm. + + With this version paramiko would fail to connect to older OpenSSH + servers which don't support this algorithm (e.g. default setup on Ubuntu + 14.04) and throw authentication error. + + Libcloud code has been updated to be backward compatible. It first tries to + connect to the server using default preferred algorithm values and in case + that fails, it will fall back to the old approach with SHA-2 variants + disabled. + + This functionality can be disabled by setting + ``LIBCLOUD_PARAMIKO_SHA2_BACKWARD_COMPATIBILITY`` environment variable to + ``false``. + + For security reasons (to prevent possible downgrade attacks and similar) you + are encouraged to do that in case you know you won't be connecting to any old + OpenSSH servers. + +Supported private SSH key types +------------------------------- + +.. note:: + + paramiko v2.7.0 introduced support for OpenSSH 6.5 style private key files + so this section is only relevant for users using older versions of paramiko. + +`paramiko`_ Python library we use for deployment only supports RSA, DSS and +ECDSA private keys in PEM format. + +Since Libcloud v3.0.0, ``Ed25519`` private keys are also supported when using +paramiko 2.2.0 or higher + +If you try to use key in an other format such as newer OpenSSH and PKCS#8 +format an exception will be thrown and deployment will fail. + +Keys which contain the following header should generally work: + +* ``-----BEGIN RSA PRIVATE KEY-----`` +* ``-----BEGIN DSA PRIVATE KEY-----`` +* ``-----BEGIN EC PRIVATE KEY-----`` + +And keys which contain the following header won't work: + +* ``-----BEGIN OPENSSH PRIVATE KEY-----`` +* ``-----BEGIN PRIVATE KEY-----`` + +To generate a RSA key in a compatible format, you can use the following +commands: + +.. sourcecode:: bash + + ssh-keygen -m PEM -t rsa -b 4096 -C "comment" -f ~/.ssh/id_rsa_libcloud + # Newer versions of OpenSSH will include a header which paramiko doesn't + # recognize so we also need to change a header to a format paramiko + # recognizes + sed -i "s/-----BEGIN PRIVATE KEY-----/-----BEGIN RSA PRIVATE KEY-----/g" ~/.ssh/id_rsa_libcloud + sed -i "s/-----END PRIVATE KEY-----/-----END RSA PRIVATE KEY-----/g" ~/.ssh/id_rsa_libcloud + +For details / reference, see the following issues: + +* https://github.com/paramiko/paramiko/issues/1015 +* https://github.com/paramiko/paramiko/issues/1363 +* https://github.com/paramiko/paramiko/issues/1313 + Deployment classes ------------------ @@ -28,7 +96,7 @@ Deployment module exposes multiple classes which make running common bootstrap tasks such as installing a file and running a shell command on a server easier. -All the available classes are listed bellow. +All the available classes are listed below. .. autoclass:: libcloud.compute.deployment.SSHKeyDeployment .. autoclass:: libcloud.compute.deployment.FileDeployment @@ -42,8 +110,10 @@ Using deployment functionality This section describes how to use deployment functionality and :func:`libcloud.compute.base.NodeDriver.deploy_node` method. -deploy_node method allows you to create a cloud server and run bootstrap -commands on it. It works in the following steps: +deploy_node method allows you to create a server and run bootstrap commands on +it. + +This method performs the following operations: 1. Create a server (same as ``create_node``, in fact it calls ``create_node`` underneath) @@ -53,13 +123,13 @@ commands on it. It works in the following steps: As noted above, second step waits for node to become available which means it can take a while. If for some reason deploy_node is timing out, make sure you are using a correct ``ssh_username``. You can troubleshoot deployment issues -using LIBCLOUD_DEBUG method which is described on the +using ``LIBCLOUD_DEBUG`` method which is described on the :ref:`troubleshooting page `. :func:`libcloud.compute.base.NodeDriver.deploy_node` takes the same base keyword arguments as the :func:`libcloud.compute.base.NodeDriver.create_node` -method and couple of additional arguments. The most important ones are -``deploy`` and ``auth``: +method and a couple of additional arguments. The most important ones are +``deploy``, ``auth`` and ``ssh_key``: * ``deploy`` argument specifies which deployment step or steps to run after the server has been created. @@ -68,14 +138,39 @@ method and couple of additional arguments. The most important ones are password once the server has been created and this password is then used to log in. For more information, please see the create_node and deploy_node method docstring. +* ``ssh_key`` - A path to a private SSH key file which will be used to + authenticate. Key needs to be in a format which is supported by paramiko + (see section on supported key types above). +* ``ssh_username`` - SSH username used to login. If not provided, it defaults + to ``root``. +* ``ssh_port`` - Port of the SSH server. If not provided, it defaults to + ``22``. + +To view the output (stdout, stderr) and exit code of a specific deployment +step, you can access ``stdout``, ``stderr`` and ``exit_status`` instance +variables on the deployment class instance (``ScriptDeployment``, +``ScriptFileDeployment``) in question. + +For example: + +.. sourcecode:: python + + ... + step = ScriptDeployment("echo whoami ; date ; ls -la") + + node = driver.deploy_node(...) + + print('stdout: %s' % (step.stdout)) + print('stderr: %s' % (step.stderr)) + print('exit_code: %s' % (step.exit_status)) Some examples which demonstrate how this method can be used are displayed -bellow. +below. Run a single deploy step using ScriptDeployment class ----------------------------------------------------- -The example bellow runs a single step and installs your public key on the +The example below runs a single step and installs your public key on the server. .. literalinclude:: /examples/compute/deployment_single_step_install_public_key.py @@ -84,7 +179,7 @@ server. Run multiple deploy steps using MultiStepDeployment class --------------------------------------------------------- -The example bellow runs two steps on the server using ``MultiStepDeployment`` +The example below runs two steps on the server using ``MultiStepDeployment`` class. As a first step it installs you SSH key and as a second step it runs a shell script. @@ -95,3 +190,4 @@ shell script. .. _`Puppet`: http://puppetlabs.com/ .. _`Salt`: http://docs.saltstack.com/topics/ .. _`CFEngine`: http://cfengine.com/ +.. _`paramiko`: http://www.paramiko.org/ diff --git a/docs/compute/drivers/aliyun_ecs.rst b/docs/compute/drivers/aliyun_ecs.rst new file mode 100644 index 0000000000..4103c1047b --- /dev/null +++ b/docs/compute/drivers/aliyun_ecs.rst @@ -0,0 +1,101 @@ +Aliyun(AliCloud) ECS Driver Documentation +========================================= + +`Aliyun(AliCloud) Elastic Compute Service (ECS)`_ is a simple and efficient computing service, whose processing capacity is scalable. It can help you quickly build a more stable and secure application. It helps you improve the efficiency of operation and maintenance, and reduce the cost of IT. ECS enables you to focus on core business innovation. + +Regions +------- + +The Aliyun supports mutiple regions, which indicates the distinct physical location all over the world. The current available regions in China are Hangzhou, Qingdao, Beijing, and Shenzhen. Other regions available outside of Chinese Mainland are Hong Kong, Singapore, and United States. + +You can select the AliCloud region according to the customer base, cost effectiveness, disaster recovery site, or any compliance requirements. ECS instances in the same region can communicate with each other over intranet, whereas cross-region ECS communication requires the internet connection. + +A region equals to `NodeLocation` in libcloud. Users can list all available regions, for example: + +.. literalinclude:: /examples/compute/ecs/list_locations.py + :language: python + +ECS Instance Types +------------------ + +An instance type defines some computing capabilities, including CPU, memory, associated with a set of ECS instances. + +Aliyun provides two generations, three instance type families, and more than ten instance types to support different usecases. + +For more information, please refer to the `Instance Generations`_ section, `Instance Type Families`_ section and `Instance Type`_ section of the official documentation. + +An instance type equals to the `NodeSize` in libcloud. Users can list all available instance types, for example: + +.. literalinclude:: /examples/compute/ecs/list_sizes.py + :language: python + +Security Groups +--------------- + +A security group is a logical grouping which groups instances in the same region with the same security requirements and mutual trust. Security groups, like firewalls, are used to configure network access controls for one or more ECS instances. + +Each instance belongs to at least one security group and this must be specified at the time of creation. + +Users can list all defined security groups, for example: + +.. literalinclude:: /examples/compute/ecs/ex_list_security_groups.py + :language: python + +For more information, please refer to the `Security Groups`_ section of the official documentation. + +Images +------ + +An image is an ECS instance operating environment template. It generally includes the operating system and preloaded software. It equals to `NodeImage` in libcloud. + +Users can list all available images, for example: + +.. literalinclude:: /examples/compute/ecs/list_images.py + :language: python + +Storage +------- + +Aliyun ECS provides multiple types of storage disks for instances to meet the requirements of different application scenarios. An instance can use all these types of volumes independently. + +There are three types of disks: general cloud disk, SSD cloud disk and ephemeral SSD disk. + +Aliyun provides the snapshot mechanism. This creates a snapshot that retains a copy of the data on a disk at a certain time point manually or automatically. + +Aliyun storage disks equal to `StorageVolume` in libcloud. Users can manage volumes and snapshots, for example: + +.. literalinclude:: /examples/compute/ecs/manage_volumes_and_snapshots.py + :language: python + +For more information, please refer to the `Storage`_ section of the official documentation. + +IP Address +---------- + +IP addresses are an important means for users to access ECS instances and for ECS instances to provide external services. Each instance will be allocated a private network card and bound to a specific private IP and a public network card by default. + +Private IPs can be used for SLB load balancing, intranet mutual access between ECS instances or between an ECS instance and another cloud service within the same region. Data traffic through private IPs between instances in the same region is free. + +Public IPs are used to access the instance from the internet. Public network traffic is not free. + +Users can select different internet charge type and bandwidth limitations. + +Instance lifecycle management +----------------------------- + +.. literalinclude:: /examples/compute/ecs/manage_nodes.py + :language: python + +API Reference +------------- + +.. autoclass:: libcloud.compute.drivers.ecs.ECSDriver + :members: + :inherited-members: + +.. _`Aliyun(AliCloud) Elastic Compute Service (ECS)`: https://www.aliyun.com/product/ecs/?lang=en +.. _`Instance Generations`: https://docs.aliyun.com/en#/pub/ecs_en_us/product-introduction/instance&instancegeneration +.. _`Instance Type Families`: https://docs.aliyun.com/en#/pub/ecs_en_us/product-introduction/instance&instancetypefamily +.. _`Instance Type`: https://docs.aliyun.com/en#/pub/ecs_en_us/product-introduction/instance&type +.. _`Security Groups`: https://docs.aliyun.com/en#/pub/ecs_en_us/product-introduction/network&securitygroup +.. _`Storage`: https://docs.aliyun.com/en#/pub/ecs_en_us/product-introduction/storage&summary diff --git a/docs/compute/drivers/auroracompute.rst b/docs/compute/drivers/auroracompute.rst index 7a730a3554..42c6c6f779 100644 --- a/docs/compute/drivers/auroracompute.rst +++ b/docs/compute/drivers/auroracompute.rst @@ -1,21 +1,78 @@ AuroraCompute Computer Driver Documentation -====================================== +=========================================== `PCextreme B.V.`_ is a Dutch cloud provider. It provides a public cloud offering under the name AuroraCompute. All cloud services are under the family name Aurora. -The datacenters are located in Amsterdam and Rotterdam, The Netherlands. +The datacenters / availability zones are located in: + +- Amsterdam (NL) +- Rotterdam (NL) +- Miami (US) +- Los Angelos (US) +- Tokyo (JP) +- Barcelona (ES) + .. figure:: /_static/images/provider_logos/pcextreme.png :align: center :width: 300 - :target: https://www.pcextreme.nl/aurora + :target: https://www.pcextreme.com/aurora/compute The AuroraCompute driver is based on the CloudStack driver. Please refer to :doc:`CloudStack Compute Driver Documentation ` page for more information. +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``key`` - Your AuroraCompute API key +* ``secret`` - Your AuroraCompute secret key + +You can find your 'key' and 'secret' in the AuroraCompute `Control Panel`_ under +your users. + +With these credentials you can instantiate a driver: + +.. literalinclude:: /examples/compute/auroracompute/instantiate_driver.py + :language: python + + +Create a Virtual Machine (node) +------------------------------- + +Creating a Virtual Machine on AuroraCompute using libcloud works the same as on any +other platform. This example is just to show exactly that. + +This example will create a Virtual Machine in Amsterdam. Should you want to create +one in one of our other regions you should take a look at the example below which +shows how to use our different regions. + +.. literalinclude:: /examples/compute/auroracompute/create_node.py + :language: python + + +Using a different region +------------------------ + +By default the region AMS (Amsterdam) is selected by the driver. + +AuroraCompute supports multiple regions and when instantiating the driver you can +choose a region. + +Keep in mind that each region uses different credentials. These can be found in +the `Control Panel`_ under your users. + +In this example we select the Miami (MIA) region: + +.. literalinclude:: /examples/compute/auroracompute/instantiate_driver_region.py + :language: python + + API Docs -------- @@ -23,4 +80,5 @@ API Docs :members: :inherited-members: -.. _`PCextreme B.V.`: https://www.pcextreme.nl/ +.. _`PCextreme B.V.`: https://www.pcextreme.com/ +.. _`Control Panel`: https://cp.pcextreme.nl/ diff --git a/docs/compute/drivers/azure.rst b/docs/compute/drivers/azure.rst index 62c2fada8f..e13273d06d 100644 --- a/docs/compute/drivers/azure.rst +++ b/docs/compute/drivers/azure.rst @@ -1,8 +1,10 @@ -Azure Compute Driver Documentation -================================== +Azure ASM Compute Driver Documentation +====================================== Azure driver allows you to integrate with Microsoft `Azure Virtual Machines`_ -service. +service using the `Azure Service Management`_ (ASM) API. This is the "Classic" +API, please note that it is incompatible with the newer +`Azure Resource Management`_ (ARM) API, which is provideb by the `azure_arm`_ driver. .. figure:: /_static/images/provider_logos/azure.jpg :align: center @@ -61,3 +63,9 @@ API Docs :inherited-members: .. _`Azure Virtual Machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ + +.. _`Azure Service Management`: https://msdn.microsoft.com/en-us/library/azure/dn948465.aspx + +.. _`Azure Resource Management`: https://msdn.microsoft.com/en-us/library/azure/Dn948464.aspx + +.. _`azure_arm`: azure_arm.html diff --git a/docs/compute/drivers/azure_arm.rst b/docs/compute/drivers/azure_arm.rst new file mode 100644 index 0000000000..b19c811016 --- /dev/null +++ b/docs/compute/drivers/azure_arm.rst @@ -0,0 +1,64 @@ +Azure ARM Compute Driver Documentation +====================================== + +Azure driver allows you to integrate with Microsoft `Azure Virtual Machines`_ +provider using the `Azure Resource Management`_ (ARM) API. + +.. figure:: /_static/images/provider_logos/azure.jpg + :align: center + :width: 300 + :target: http://azure.microsoft.com/en-us/services/virtual-machines/ + +Azure Virtual Machine service allows you to launch Windows and Linux virtual +servers in many datacenters across the world. + +Connecting to Azure +------------------- + +To connect to Azure you need your tenant ID and subscription ID. Using the +Azure cross platform CLI, use ``az account list`` to get these +values. + +Creating a Service Principal +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The following directions are based on +https://azure.microsoft.com/en-us/documentation/articles/resource-group-authenticate-service-principal/ + +.. sourcecode:: bash + + az ad app create --display-name "" --identifier-uris "" --password + az ad sp create --id "" + az role assignment create --assignee "" --role Owner --scope /subscriptions/{subscriptionId}/ + +Instantiating a driver +~~~~~~~~~~~~~~~~~~~~~~ + +Use for "key" and the for "secret". + +Once you have the tenant id, subscription id, application id ("key"), and +password ("secret"), you can create an AzureNodeDriver: + +.. literalinclude:: /examples/compute/azure_arm/instantiate.py + :language: python + +Alternate Cloud Environments +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can select an alternate cloud environment using the "cloud_environment" +parameter to AzureNodeDriver constructor. Available alternate cloud +environments are 'AzureChinaCloud', 'AzureUSGovernment' and 'AzureGermanCloud'. +You can also supply explicit endpoints by providing a dict with the keys +'resourceManagerEndpointUrl', 'activeDirectoryEndpointUrl', +'activeDirectoryResourceId' and 'storageEndpointSuffix'. + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.azure_arm.AzureNodeDriver + :members: + :inherited-members: + +.. _`Azure Virtual Machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ + +.. _`Azure Resource Management`: https://msdn.microsoft.com/en-us/library/azure/Dn948464.aspx diff --git a/docs/compute/drivers/cloudscale.rst b/docs/compute/drivers/cloudscale.rst new file mode 100644 index 0000000000..668680adfb --- /dev/null +++ b/docs/compute/drivers/cloudscale.rst @@ -0,0 +1,75 @@ +cloudscale.ch Compute Driver Documentation +========================================== + +`cloudscale.ch`_ is a public cloud provider based in Switzerland. + +.. figure:: /_static/images/provider_logos/cloudscale.png + :align: center + :width: 200 + :target: http://www.cloudscale.ch + + +How to get an API Key +--------------------- + +Simply visit ``_ and generate +your key. + +You can generate read and read/write API keys. These token types give you more +access control. Revoking an API token is also possible. + +Using the API to the full extent +-------------------------------- + +Most of the `cloudscale.ch` API is covered by the simple commands: + +- ``driver.list_sizes()`` +- ``driver.list_images()`` +- ``driver.list_nodes()`` +- ``driver.reboot_node(node)`` +- ``driver.ex_start_node(node)`` +- ``driver.ex_stop_node(node)`` +- ``driver.ex_node_by_uuid(server_uuid)`` +- ``driver.destroy_node(node)`` +- ``driver.create_node(name, size, image, ex_create_attr={})`` + +In our :ref:`example ` below you can see how you use +``ex_create_attr`` when creating servers. Possible dictionary entries in +``ex_create_attr`` are: + +- ``ssh_keys`` (``list`` of ``str``) - A list of SSH public keys. +- ``volume_size_gb`` (``int``) - The size in GB of the root volume. +- ``bulk_volume_size_gb`` (``int``) - The size in GB of the bulk storage volume. +- ``use_public_network`` (``bool``) - Attaching/Detaching the public network interface. +- ``use_private_network`` (``bool``) - Attaching/Detaching the private network interface. +- ``use_ipv6`` (``bool``) - Enabling/Disabling IPv6. +- ``anti_affinity_with`` (``str``) - Pass the UUID of another server. +- ``user_data`` (``str``) - Cloud-init configuration (cloud-config). Provide YAML. + + +There's more extensive documentation on these parameters in our +`Server-Create API Documentation`_. + +.. _cloudscale-examples: + +Examples +-------- + +Create a cloudscale.ch server +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/compute/cloudscale/cloudscale_compute_simple.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.cloudscale.CloudscaleNodeDriver + :members: create_node, list_images, list_nodes, list_sizes, + wait_until_running, reboot_node, ex_start_node, ex_stop_node, + ex_node_by_uuid, destroy_node + :undoc-members: + +.. _`cloudscale.ch`: https://www.cloudscale.ch +.. _`cloudscale.ch API`: https://www.cloudscale.ch/en/api/v1 +.. _`Server-Create API Documentation`: https://www.cloudscale.ch/en/api/v1#servers-create diff --git a/docs/compute/drivers/cloudsigma.rst b/docs/compute/drivers/cloudsigma.rst index aa17f41429..cfa7431360 100644 --- a/docs/compute/drivers/cloudsigma.rst +++ b/docs/compute/drivers/cloudsigma.rst @@ -29,7 +29,7 @@ Available arguments: supported values: ``1.0`` (deprecated), ``2.0`` For information on how to use those arguments, see the `Examples`_ section -bellow. +below. Basics ------ @@ -62,7 +62,7 @@ are represented using method. For more information and examples on how to use the installation CD drives, see -the `Create a server using an installation CD`_ example bellow. +the `Create a server using an installation CD`_ example below. Library drives vs user drives ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -134,7 +134,7 @@ If you want to list all the available images and drives, you should use :meth:`libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.ex_list_library_drives` method. -The example bellow shows how to list all the available sizes, images and +The example below shows how to list all the available sizes, images and drives. .. literalinclude:: /examples/compute/cloudsigma/list_sizes_images_drives.py @@ -199,7 +199,7 @@ Creating a server using an installation CD means that you can't directly use the server after it has been created. Instead, you need to connect to the server using VNC and walk-through the installation process. -The example bellow shows how to create a server using FreeBSD 8.2 installation +The example below shows how to create a server using FreeBSD 8.2 installation CD. .. literalinclude:: /examples/compute/cloudsigma/create_server_using_installation_cd.py @@ -268,7 +268,7 @@ This helps make your infrastructure more highly available and is useful when you want to create a server in a different availability zone than the existing server. -The example bellow shows how to create a new server in a different availability +The example below shows how to create a new server in a different availability zone from all the existing servers. Keep in mind that `as noted in the CloudSigma documentation @@ -284,7 +284,7 @@ To check which servers and drives share the same physical compute / storage host, you can use the :meth:`libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.ex_list_servers_availability_groups` and :meth:`libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.ex_list_drives_availability_groups` -method as displayed bellow. +method as displayed below. .. literalinclude:: /examples/compute/cloudsigma/check_avail_groups.py :language: python @@ -309,7 +309,7 @@ When you purchase a subscription you need to supply the following arguments: ``cpu``, ``mem``, ``tx``, ``ip``, ``vlan`` * ``auto_renew`` - ``True`` to auto renew the subscription when it expires. -The example bellow shows how to purchase a single VLAN for a duration of +The example below shows how to purchase a single VLAN for a duration of 30 days which will be automatically renewed when it expires. .. literalinclude:: /examples/compute/cloudsigma/create_vlan_subscription.py diff --git a/docs/compute/drivers/cloudstack.rst b/docs/compute/drivers/cloudstack.rst index cff71e20ba..985df556bb 100644 --- a/docs/compute/drivers/cloudstack.rst +++ b/docs/compute/drivers/cloudstack.rst @@ -96,7 +96,7 @@ docstrings below. You can also use an interactive shell for exploration as shown in the examples. Basic Zone Examples --------------------- +------------------- To start experimenting with libcloud, starting an ipython interactive shell can be very handy. Tab completion and shell history are available. Below is an @@ -151,7 +151,7 @@ ssh key are passed as arguments as well as a list of scripts. :language: python Advanced Zone examples ------------------------ +---------------------- Advanced zones in CloudStack provide tenant isolation via VLANs or SDN technologies like GRE/STT meshes. In a typical advanced zones, users will @@ -160,7 +160,7 @@ Therefore one needs to specify the network a node needs to be deployed on, and needs to setup port forwarding or IP forwarding rules. 1. Start an interactive shell on Ikoula public cloud -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Instantiation of driver for an advanced zone is the same as with a basic zone, for example on the `ikoula`_ cloud: diff --git a/docs/compute/drivers/digital_ocean.rst b/docs/compute/drivers/digital_ocean.rst index 6b71ed3568..7d2d14b7c2 100644 --- a/docs/compute/drivers/digital_ocean.rst +++ b/docs/compute/drivers/digital_ocean.rst @@ -1,9 +1,9 @@ DigitalOcean Compute Driver Documentation ========================================= -`DigitalOcean`_ is an American virtual private server provider based in New York -City with data centers in New York, Amsterdam, San Francisco, London and -Singapore. +`DigitalOcean`_ is an American cloud provider based in New York City with data +centers in New York, Amsterdam, San Francisco, London, Singapore, Frankfurt, +Toronto, and Bangalore. .. figure:: /_static/images/provider_logos/digitalocean.png :align: center @@ -13,9 +13,9 @@ Singapore. Instantiating a driver ---------------------- -DigitalOcean driver supports two API versions - old API v1.0 and the new API -v2.0 which is currently in beta. Since trunk (to be libcloud v0.18.0), the -driver uses new API v2.0 by default. +The DigitalOcean driver supports API v2.0, requiring a Personal Access +Token to initialize as the key. The older API v1.0 `reached end of life on +November 9, 2015`_. Support for API v1.0 was removed in libcloud v1.2.2. Instantiating a driver using API v2.0 ------------------------------------- @@ -23,10 +23,10 @@ Instantiating a driver using API v2.0 .. literalinclude:: /examples/compute/digitalocean/instantiate_api_v2.0.py :language: python -Instantiating a driver using API v1.0 -------------------------------------- +Creating a Droplet using API v2.0 +--------------------------------- -.. literalinclude:: /examples/compute/digitalocean/instantiate_api_v1.0.py +.. literalinclude:: /examples/compute/digitalocean/create_api_v2.0.py :language: python API Docs @@ -39,11 +39,6 @@ API v2.0 :members: :inherited-members: -API v1.0 -~~~~~~~~ - -.. autoclass:: libcloud.compute.drivers.digitalocean.DigitalOcean_v1_NodeDriver - :members: - :inherited-members: .. _`DigitalOcean`: https://www.digitalocean.com/ +.. _`reached end of life on November 9, 2015`: https://developers.digitalocean.com/documentation/changelog/api-v1/sunsetting-api-v1/ diff --git a/docs/compute/drivers/dimensiondata.rst b/docs/compute/drivers/dimensiondata.rst new file mode 100644 index 0000000000..49928ea7b4 --- /dev/null +++ b/docs/compute/drivers/dimensiondata.rst @@ -0,0 +1,90 @@ +Dimension Data Cloud Compute Driver Documentation +================================================= + +Dimension Data are a global IT Services company and form part of the NTT Group. +Dimension Data provide IT-as-a-Service to customers around the globe on their +cloud platform (Compute as a Service). The CaaS service is available either on +one of the public cloud instances or as a private instance on premises. + +.. figure:: /_static/images/provider_logos/dimensiondata.png + :align: center + :width: 300 + :target: http://cloud.dimensiondata.com/ + +CaaS has its own non-standard `API`_ , `libcloud` provides a Python +wrapper on top of this `API`_ with common methods with other IaaS solutions and +Public cloud providers. Therefore, you can use use the Dimension Data libcloud +driver to communicate with both the public and private clouds. + +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``user_id`` - Your Dimension Data Cloud username +* ``key`` - Your Dimension Data Cloud password +* ``region`` - The region key, one of the possible region keys + +Possible regions: + +* ``dd-na`` : Dimension Data North America (USA) +* ``dd-eu`` : Dimension Data Europe +* ``dd-af`` : Dimension Data Africa +* ``dd-au`` : Dimension Data Australia +* ``dd-au-gov`` : Dimension Data Australia ACT (Canberra) +* ``dd-latam`` : Dimension Data Latin America +* ``dd-ap`` : Dimension Data Asia Pacific +* ``dd-canada`` : Dimension Data Canada region + +The base `libcloud` API allows you to: + +* list nodes, images, instance types, locations + +Non-standard functionality and extension methods +------------------------------------------------ + +The Dimension Data driver exposes some `libcloud` non-standard +functionalities through extension methods and arguments. + +These functionalities include: + +* start and stop a node +* list networks +* create firewalls, configure network address translation +* provision layer 3 networks + +For information on how to use these functionalities please see the method +docstrings below. You can also use an interactive shell for exploration as +shown in the examples. + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.dimensiondata.DimensionDataNodeDriver + :members: + :inherited-members: + +.. _`API`: http://cloud.dimensiondata.com/au/en/services/public-cloud/api + + +Debugging Tips +-------------- + +**Problem description: XML parsing issue for python version 2.7.5** + + *Example*:: + + ip_address_collection=ip_addr_collection, child_ip_address_lists=None) + File "/Users/andrewdas/Documents/Python/lib/python2.7/site-packages/libcloud/compute/drivers/dimensiondata.py", line 3185, in ex_edit_ip_address_list + 'xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance" + File "lxml.etree.pyx", line 2912, in lxml.etree.Element (src/lxml/lxml.etree.c:68681) + File "apihelpers.pxi", line 140, in lxml.etree._makeElement (src/lxml/lxml.etree.c:15242) + File "apihelpers.pxi", line 128, in lxml.etree._makeElement (src/lxml/lxml.etree.c:15125) + File "apihelpers.pxi", line 287, in lxml.etree._initNodeAttributes (src/lxml/lxml.etree.c:17012) + File "apihelpers.pxi", line 296, in lxml.etree._addAttributeToNode (src/lxml/lxml.etree.c:17180) + File "apihelpers.pxi", line 1583, in lxml.etree._attributeValidOrRaise (src/lxml/lxml.etree.c:29377) + ValueError: Invalid attribute name u'xmlns:xsi' + + *Solution*: + - Upgrade to python version 2.7.12 and above diff --git a/docs/compute/drivers/ec2.rst b/docs/compute/drivers/ec2.rst index b42ca53d51..f2aa428fdf 100644 --- a/docs/compute/drivers/ec2.rst +++ b/docs/compute/drivers/ec2.rst @@ -10,21 +10,32 @@ platform, Amazon Web Services (AWS). :width: 300 :target: https://aws.amazon.com/ec2/ -It allows users to rent virtual servers in more than 8 regions such as: +It allows users to rent virtual servers in more than 15 regions such as: * US East (Northern Virginia) Region +* US East (Ohio) Region * US West (Oregon) Region * US West (Northern California) Region -* EU (Ireland) Region +* GovCloud (US) Region +* Canada (Central) Region +* EU West (Ireland) Region +* EU West (London) Region +* EU Central (Frankfurt) Region * Asia Pacific (Singapore) Region * Asia Pacific (Sydney) Region * Asia Pacific (Tokyo) Region +* Asia Pacific (Seoul) Region +* Asia Pacific (Mumbai) Region +* China (Beijing) Region * South America (Sao Paulo) Region +Note that pricing information is not available for China (Beijing) +region. + Using temporary security credentials ------------------------------------ -Since Libcloud 0.14.0 above, all the Amazon drivers support using temporary +Since Libcloud 0.14.0, all the Amazon drivers support using temporary security credentials. Temporary credentials can be used by passing ``token`` argument to the driver diff --git a/docs/compute/drivers/equinixmetal.rst b/docs/compute/drivers/equinixmetal.rst new file mode 100644 index 0000000000..7b1b1a909f --- /dev/null +++ b/docs/compute/drivers/equinixmetal.rst @@ -0,0 +1,24 @@ +EquinixMetal Compute Driver Documentation +========================================= + +`EquinixMetal`_ is a dedicated bare metal cloud hosting provider + +.. figure:: /_static/images/provider_logos/equinixmetal.png + :align: center + :width: 300 + :target: https://metal.equinix.com/ + +Instantiating a driver and listing devices in a project +------------------------------------------------------- + +.. literalinclude:: /examples/compute/equinixmetal/instantiate_api_v1.0.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.equinixmetal.EquinixMetalNodeDriver + :members: + :inherited-members: + +.. _`EquinixMetal`: https://metal.equinix.com/ diff --git a/docs/compute/drivers/exoscale.rst b/docs/compute/drivers/exoscale.rst index c22e986e49..ecf13d8d6f 100644 --- a/docs/compute/drivers/exoscale.rst +++ b/docs/compute/drivers/exoscale.rst @@ -1,13 +1,13 @@ Exoscale Computer Driver Documentation ====================================== -`Exoscale`_ is a public cloud provider based in Switzerland with data centers -in Geneva, Switzerland. +`Exoscale`_ is a public European cloud provider with data centers in Germany, +Austria, and Switzerland. .. figure:: /_static/images/provider_logos/exoscale.png :align: center :width: 300 - :target: https://www.exoscale.ch + :target: https://www.exoscale.com Exoscale driver is based on the CloudStack one and uses basic zones. For more information and CloudStack specific documentation, please refer to diff --git a/docs/compute/drivers/gandi.rst b/docs/compute/drivers/gandi.rst new file mode 100644 index 0000000000..01d2a7a986 --- /dev/null +++ b/docs/compute/drivers/gandi.rst @@ -0,0 +1,36 @@ +Gandi Computer Driver Documentation +=================================== + +`Gandi SAS`_ is a registrar, web hosting and private and `public cloud`_ +provider based in France with data centers in France, Luxembourg and USA. + +.. figure:: /_static/images/provider_logos/gandi.png + :align: center + :width: 300 + :target: https://www.gandi.net/ + +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the API key and activate +the API platforms. See this `Gandi's documentation`_ for how to do it. + +Examples +-------- + +Create instance +~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/compute/gandi/create_node.py + + +.. _`Gandi SAS`: https://www.gandi.net/ +.. _`public cloud`: https://www.gandi.net/hebergement/serveur +.. _`Gandi's documentation`: https://wiki.gandi.net/en/xml-api/activate + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.gandi.GandiNodeDriver + :members: + :inherited-members: diff --git a/docs/compute/drivers/gce.rst b/docs/compute/drivers/gce.rst index 079b6f8f11..1aaf884692 100644 --- a/docs/compute/drivers/gce.rst +++ b/docs/compute/drivers/gce.rst @@ -41,8 +41,9 @@ Which one should I use? authorization is your Project ID. Once you have set up the authentication as described below, you pass the -authentication information to the driver as described in `Examples`_ - +authentication information to the driver as described in `Examples`_. Also +bear in mind that large clock drift (difference in time) between authenticating +host and google will cause authentication to fail. Service Account ~~~~~~~~~~~~~~~ @@ -51,9 +52,18 @@ To set up Service Account authentication, you will need to download the corresponding private key file in either the new JSON (preferred) format, or the legacy P12 format. -1. Follow the instructions at - https://developers.google.com/console/help/new/#serviceaccounts - to create and download the private key. +1. Go to Google Cloud Console (https://console.cloud.google.com/) and create a + new project (https://console.cloud.google.com/projectcreate) or re-use an + existing one. + +.. figure:: /_static/images/misc/gce/create_service_account.png + :align: center + :width: 500 + +2. Select the existing or newly created project and go to IAM & Admin -> + Service Accounts -> Create service account to create a new service account. + Select "Furnish a new private key" to create and download new private key you will + use to authenticate. a. If you opt for the new preferred JSON format, download the file and save it to a secure location. @@ -66,11 +76,41 @@ the legacy P12 format. Move the .pem file to a safe location -2. You will need the Service Account's "Email Address" and the path to the + +.. figure:: /_static/images/misc/gce/iam_and_roles.png + :align: center + :width: 500 + +.. figure:: /_static/images/misc/gce/create_service_account.png + :align: center + :width: 500 + +3. You will need the Service Account's "Email Address" and the path to the key file for authentication. -3. You will also need your "Project ID" (a string, not a numerical value) that + +.. figure:: /_static/images/misc/gce/view_service_accounts.png + :align: center + :width: 500 + +4. You will also need your "Project ID" (a string, not a numerical value) that can be found by clicking on the "Overview" link on the left sidebar. +.. figure:: /_static/images/misc/gce/project_dashboard.png + :align: center + :width: 500 + +5. You will also need to have billing information associated and enabled for + that project. If billing is not yet enabled for that project an error + message similar to the one below will be printed when you first run the code + which uses GCE driver: + +.. sourcecode:: python + + libcloud.common.google.GoogleBaseError: {u'domain': u'usageLimits', u'message': u'Access Not Configured. Compute Engine API has not been used in project 1029894677594 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/compute.googleapis.com/overview?project=1029894677594 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.', u'reason': u'accessNotConfigured', u'extendedHelp': u'https://console.developers.google.com/apis/api/compute.googleapis.com/overview?project=YYYYYYYY'} + +You can simply follow the link in the error message to configure and enable +billing. + Installed Application ~~~~~~~~~~~~~~~~~~~~~ @@ -90,7 +130,7 @@ Internal Authentication To use GCE's internal metadata service to authenticate, simply specify your Project ID and let the driver handle the rest. See the -`5. Using GCE Internal Authorization`_ example bellow. +`5. Using GCE Internal Authorization`_ example below. Accessing Google Cloud services from your Libcloud nodes -------------------------------------------------------- @@ -103,14 +143,30 @@ illustrate how to use Service Account Scopes. Examples -------- +Keep in mind that a lot of the driver methods depend on the zone / location +being set. + +For that reason, you are advised to pass ``datacenter`` argument to the driver +constructor. This value should contain a name of the zone where you want your +operations to be performed (e.g. ``us-east1-b``). + +Some of the methods allow this value to be overridden on per method invocation +basis - either by specifying ``zone`` or ``location`` method argument. + Additional example code can be found in the "demos" directory of Libcloud here: https://github.com/apache/libcloud/blob/trunk/demos/gce_demo.py 1. Getting Driver with Service Account authentication ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +With local key file: + .. literalinclude:: /examples/compute/gce/gce_service_account.py +With Service Account credentials as dict: + +.. literalinclude:: /examples/compute/gce/gce_service_account_infile.py + 2. Getting Driver with Installed Application authentication ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -131,6 +187,11 @@ https://github.com/apache/libcloud/blob/trunk/demos/gce_demo.py .. literalinclude:: /examples/compute/gce/gce_internal_auth.py +6. Using deploy_node() functionality +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/compute/gce/deploy_node.py + API Docs -------- diff --git a/docs/compute/drivers/gridscale.rst b/docs/compute/drivers/gridscale.rst new file mode 100644 index 0000000000..2e9a831193 --- /dev/null +++ b/docs/compute/drivers/gridscale.rst @@ -0,0 +1,45 @@ +gridscale Compute Driver Documentation +====================================== + +`gridscale`_ is a German cloud provider with focus on awesome user experience. + +.. figure:: /_static/images/provider_logos/gridscale.png + :align: center + :width: 300 + :target: https://www.gridscale.io/ + +Instantiating a driver +---------------------- + +The gridscale driver requires your User_Uuid and your API-Token. +You will have to generate a API-Token first, to be able to do that, +you want to make an account and create a token under the API-Key option in +the panel. + +.. literalinclude:: /examples/compute/gridscale/instantiate_driver.py + :language: python + +Creating a Server +----------------- + +.. literalinclude:: /examples/compute/gridscale/create_node.py + :language: python + +Create a server, SSH into it and run deployment script on it +------------------------------------------------------------ + +.. literalinclude:: /examples/compute/gridscale/deploy_node.py + :language: python + +API Docs +-------- + +API +~~~ + +.. autoclass:: libcloud.compute.drivers.gridscale.GridscaleNodeDriver + :members: + :inherited-members: + + +.. _`gridscale`: https://www.gridscale.io/ diff --git a/docs/compute/drivers/hpcloud.rst b/docs/compute/drivers/hpcloud.rst index 26450f3ad3..03f3e158c4 100644 --- a/docs/compute/drivers/hpcloud.rst +++ b/docs/compute/drivers/hpcloud.rst @@ -21,10 +21,10 @@ Examples Unlike other OpenStack based providers, HP cloud also requires you to specify tenant name when connecting to their cloud. You can do that by passing ``tenant_name`` argument to the driver constructor as shown in the code example -bellow. +below. This attribute represents a project name and can be obtained in the `HP Cloud -console`_ as shown in the picture bellow. +console`_ as shown in the picture below. .. figure:: /_static/images/misc/hp_cloud_console_projects.jpg :align: center diff --git a/docs/compute/drivers/internetsolutions.rst b/docs/compute/drivers/internetsolutions.rst new file mode 100644 index 0000000000..454a615c25 --- /dev/null +++ b/docs/compute/drivers/internetsolutions.rst @@ -0,0 +1,69 @@ +Internet Solutions Compute Driver Documentation +=============================================== + +Internet Solutions (IS) is the first commericial ISP in South Africa and currently the largest in +the southern cape. IS offer a public cloud service based called Compute-as-a-Service (CAAS). +The CaaS service is available on one of the public cloud instances. + +.. figure:: /_static/images/provider_logos/internetsolutions.png + :align: center + :width: 300 + :target: http://www.cloud.is.co.za/ + +CaaS has its own non-standard `API`_ , `libcloud` provides a Python +wrapper on top of this `API`_ with common methods with other IaaS solutions and +Public cloud providers. Therefore, you can use use the Internet Solutions libcloud +driver to communicate with both the public and private clouds. + +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``user_id`` - Your Internet Solutions Cloud username +* ``key`` - Your Internet Solutions Cloud password +* ``region`` - The region key, one of the possible region keys + +Possible regions: + +* ``is-na`` : Internet Solutions North America (USA) +* ``is-eu`` : Internet Solutions Europe +* ``is-af`` : Internet Solutions Africa - **Default** +* ``is-au`` : Internet Solutions Australia +* ``is-latam`` : Internet Solutions Latin America +* ``is-ap`` : Internet Solutions Asia Pacific +* ``is-canada`` : Internet Solutions Canada region + +.. literalinclude:: /examples/compute/internetsolutions/instantiate_driver.py + :language: python + +The base `libcloud` API allows you to: + +* list nodes, images, instance types, locations + +Non-standard functionality and extension methods +------------------------------------------------ + +The Internet Solutions driver exposes some `libcloud` non-standard +functionalities through extension methods and arguments. + +These functionalities include: + +* start and stop a node +* list networks +* create firewalls, configure network address translation +* provision layer 3 networks + +For information on how to use these functionalities please see the method +docstrings below. You can also use an interactive shell for exploration as +shown in the examples. + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.internetsolutions.InternetSolutionsNodeDriver + :members: + :inherited-members: + +.. _`API`: http://www.cloud.is.co.za/IS-Public-CaaS/Pages/REST-based-API.aspx diff --git a/docs/compute/drivers/kamatera.rst b/docs/compute/drivers/kamatera.rst new file mode 100644 index 0000000000..1345104d5f --- /dev/null +++ b/docs/compute/drivers/kamatera.rst @@ -0,0 +1,41 @@ +Kamatera Driver Documentation +=============================== +`Kamatera`_ is a global cloud services platform provider, providing enterprise-grade cloud infrastructure products. +Kamatera is operating in 13 global data centers, with thousands of servers worldwide, serving tens of thousands of +clients including start-ups, application developers, international enterprises, and SaaS providers. + +.. figure:: /_static/images/provider_logos/kamatera.png + :align: center + :width: 300 + :target: https://www.kamatera.com/ + +Enabling API access +------------------- + +To allow API access to your Kamatera account, you first need to add an API key +by visiting `Kamatera Console`_ and adding a new key under API Keys. Use the +created key Client ID and Secret as the arguments to the driver constructor. + +.. _`Kamatera`: https://www.kamatera.com/ +.. _`Kamatera Console`: https://console.kamatera.com/ + +Examples +-------- + +Instantiating a driver +~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/compute/kamatera/instantiate_driver.py + :language: python + +Create Node +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/compute/kamatera/create_node.py + :language: python + +Run node operations +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/compute/kamatera/node_operations.py + :language: python diff --git a/docs/compute/drivers/kili.rst b/docs/compute/drivers/kili.rst deleted file mode 100644 index 71a93e24a0..0000000000 --- a/docs/compute/drivers/kili.rst +++ /dev/null @@ -1,35 +0,0 @@ -Kili Cloud Computer Driver Documentation -======================================== - -`Kili Cloud`_ is a public cloud provider based in Africa. - -Kili Cloud driver is based on the OpenStack one. For more information -information and OpenStack specific documentation, please refer to -:doc:`OpenStack Compute Driver Documentation ` page. - -Examples --------- - -1. Instantiating the driver -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Unlike other OpenStack based providers, Kili cloud also requires you to specify -tenant name when connecting to their cloud. You can do that by passing -``tenant_name`` argument to the driver constructor as shown in the code example -bellow. - -This attribute represents a company name you have entered while signing up for -Kili. - -.. literalinclude:: /examples/compute/openstack/kilicloud_native.py - :language: python - -API Docs --------- - -.. autoclass:: libcloud.compute.drivers.kili.KiliCloudNodeDriver - :members: - :inherited-members: - -.. _`Kili Cloud`: http://kili.io/ -.. _`Kili Cloud dashboard`: https://dash.kili.io diff --git a/docs/compute/drivers/maxihost.rst b/docs/compute/drivers/maxihost.rst new file mode 100644 index 0000000000..f0535406cd --- /dev/null +++ b/docs/compute/drivers/maxihost.rst @@ -0,0 +1,31 @@ +Maxihost Compute Driver Documentation +===================================== + +`Maxihost` is a cloud platform for bare metal servers. +.. figure:: /_static/images/provider_logos/maxihost.png + +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the following argument to the +driver constructor: + +* ``api_key`` - Your API key. Can be obtained from https://control.maxihost.com/api + +Example +------- + +.. code-block:: python + + from libcloud.compute.types import Provider + from libcloud.compute.providers import get_driver + + cls = get_driver(Provider.MAXIHOST) + + driver = cls('api token') + +API Docs +-------- + +.. _`Maxihost`: http://maxihost.com/ +.. _`API`: https://developers.maxihost.com diff --git a/docs/compute/drivers/ntta.rst b/docs/compute/drivers/ntta.rst new file mode 100644 index 0000000000..b7491735c6 --- /dev/null +++ b/docs/compute/drivers/ntta.rst @@ -0,0 +1,77 @@ +NTT America Public Cloud Compute Driver Documentation +===================================================== + +The NTT America Cloud delivers enterprise-class infrastructure that allows customers +to scale to meet demand in real time, and then shut down those resources when they +are no longer needed. The deployment of private networks, each with their own +customizable firewall, enables test and development environments to be logically +separated, but still in the same VMware environment in which the applications will run. + +Private networks, firewalls, load balancing and servers are deployed in +minutes through the easy-to-use web-based control panel, or through standards based APIs. +The support of burstable CPU means that capacity is always available when needed. +The flexible payment and reporting options mean customers can get detailed reports on +activity across their organization, allocate costs where appropriate, and receive +valuable information for management and budgeting purposes. + + +.. figure:: /_static/images/provider_logos/ntta.png + :align: center + :width: 300 + :target: http://www.us.ntt.com/ + +CaaS has its own non-standard `API`_ , `libcloud` provides a Python +wrapper on top of this `API`_ with common methods with other IaaS solutions and +Public cloud providers. Therefore, you can use use the NTT America libcloud +driver to communicate with both the public and private clouds. + +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``user_id`` - Your NTT America Cloud username +* ``key`` - Your NTT America Cloud password +* ``region`` - The region key, one of the possible region keys + +Possible regions: + +* ``ntta-na`` : NTT America North America (USA) - **Default** +* ``ntta-eu`` : NTT America Europe +* ``ntta-af`` : NTT America Africa +* ``ntta-au`` : NTT America Australia +* ``ntta-ap`` : NTT America Asia Pacific + +.. literalinclude:: /examples/compute/ntta/instantiate_driver.py + :language: python + +The base `libcloud` API allows you to: + +* list nodes, images, instance types, locations + +Non-standard functionality and extension methods +------------------------------------------------ + +The NTT America driver exposes some `libcloud` non-standard +functionalities through extension methods and arguments. + +These functionalities include: + +* start and stop a node +* list networks +* create firewalls, configure network address translation +* provision layer 3 networks + +For information on how to use these functionalities please see the method +docstrings below. You can also use an interactive shell for exploration as +shown in the examples. + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.ntta.NTTAmericaNodeDriver + :members: + :inherited-members: + +.. _`API`: http://www.us.ntt.com/en/services/cloud/public-cloud.html diff --git a/docs/compute/drivers/nttcis.rst b/docs/compute/drivers/nttcis.rst new file mode 100644 index 0000000000..de34b7ce55 --- /dev/null +++ b/docs/compute/drivers/nttcis.rst @@ -0,0 +1,89 @@ +NTTC-CIS Compute Driver Documentation +================================================= + +NTT Communications has a cloud offering known as Cloud Infrastructure Services (NTTC-CIS). +NTT-CIS provides IT-as-a-Service to customers around the globe on their +cloud platform (Compute as a Service). The CaaS service is available either on +one a hybrid cloud instance or as a private instance on premises. + +.. figure:: /_static/images/provider_logos/ntt.png + :align: center + :width: 300 + :target: http://www.ntt.com/en/services/cloud/enterprise-cloud.html/ + +CaaS has its own non-standard `API`_ , `libcloud` provides a Python +wrapper on top of this `API`_ with common methods with other IaaS solutions and +Public cloud providers. Therefore, you can use use the NTTC-CIS libcloud +driver to communicate with both the public and private clouds. Currently `libcloud` +supports `API`_ versions >= 2.4. + +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``user_id`` - Your Dimension Data Cloud username +* ``key`` - Your Dimension Data Cloud password +* ``region`` - The region key, one of the possible region keys + +Possible regions: + +* ``na`` : NTTC-CIS North America (USA) +* ``eu`` : NTTC-CIS Europe +* ``af`` : NTTC-CIS Africa +* ``au`` : NTTC-CIS Australia +* ``ap`` : NTTC-CIS Asia Pacific +* ``ca`` : Dimension Data Canada region + +The base `libcloud` API allows you to: + +* list nodes, images, instance types, locations + +Non-standard functionality and extension methods +------------------------------------------------ + +The NTTC-CIS driver exposes some `libcloud` non-standard +functionalities through extension methods and arguments. + +These functionalities include: + +* start and stop a node +* list networks +* create firewalls, configure network address translation +* provision layer 3 networks + +For information on how to use these functionalities please see the method +docstrings below. You can also use an interactive shell for exploration as +shown in the examples. + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.nttcis.NttCisNodeDriver + :members: + :inherited-members: + +.. _`API`: https://docs.mcp-services.net/display/CCD/API+2 + + +Debugging Tips +-------------- + +**Problem description: XML parsing issue for python version 2.7.5** + + *Example*:: + + ip_address_collection=ip_addr_collection, child_ip_address_lists=None) + File "/Users/andrewdas/Documents/Python/lib/python2.7/site-packages/libcloud/compute/drivers/dimensiondata.py", line 3185, in ex_edit_ip_address_list + 'xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance" + File "lxml.etree.pyx", line 2912, in lxml.etree.Element (src/lxml/lxml.etree.c:68681) + File "apihelpers.pxi", line 140, in lxml.etree._makeElement (src/lxml/lxml.etree.c:15242) + File "apihelpers.pxi", line 128, in lxml.etree._makeElement (src/lxml/lxml.etree.c:15125) + File "apihelpers.pxi", line 287, in lxml.etree._initNodeAttributes (src/lxml/lxml.etree.c:17012) + File "apihelpers.pxi", line 296, in lxml.etree._addAttributeToNode (src/lxml/lxml.etree.c:17180) + File "apihelpers.pxi", line 1583, in lxml.etree._attributeValidOrRaise (src/lxml/lxml.etree.c:29377) + ValueError: Invalid attribute name u'xmlns:xsi' + + *Solution*: + - Upgrade to python version 2.7.12 and above diff --git a/docs/compute/drivers/onapp.rst b/docs/compute/drivers/onapp.rst new file mode 100644 index 0000000000..492df36f40 --- /dev/null +++ b/docs/compute/drivers/onapp.rst @@ -0,0 +1,51 @@ +OnApp Compute Driver Documentation +================================== + +`OnApp`_ software enables Infrastructure-as-a-Service for hosts, telcos and +other service providers. It's a turnkey platform for selling cloud, VPS, +dedicated servers, CDN and more through a "single pane of glass" control panel, +and now supports Xen, KVM, VMware and Amazon EC2. + +.. figure:: /_static/images/provider_logos/onapp.png + :align: center + :width: 382 + :target: http://onapp.com/ + +`OnApp`_ has its own non-standard `API`_ , `libcloud` provides a Python +wrapper on top of this `API`_ with common methods with other IaaS solutions and +Public cloud providers. Therefore, you can use the `OnApp` libcloud +driver to communicate with OnApp public clouds. + +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``key`` - Your OnApp username +* ``secret`` - Your OnApp password +* ``host`` - The host of your OnApp endpoint +* ``path`` - The path to your OnApp endpoint + (e.g ``/client/api`` for ``http://onapp.test/client/api``) +* ``url`` - The url to your OnApp endpoint, mutually exclusive with + ``host`` and ``path`` +* ``secure`` - True or False. True by default + +To authenticate using API key, put your account email as ``key`` and the API key +to the server as ``secret``. + +Example +------- + +.. literalinclude:: /examples/compute/onapp/functionality.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.onapp.OnAppNodeDriver + :members: + :inherited-members: + +.. _`OnApp`: http://onapp.com/ +.. _`API`: https://docs.onapp.com/display/31API/OnApp+3.1+API+Guide diff --git a/docs/compute/drivers/openstack.rst b/docs/compute/drivers/openstack.rst index ce172cae6e..34deba679f 100644 --- a/docs/compute/drivers/openstack.rst +++ b/docs/compute/drivers/openstack.rst @@ -2,7 +2,7 @@ OpenStack Compute Driver Documentation ====================================== `OpenStack`_ is an open-source project which allows you to build and run your -own public or a private cloud. +own public or private cloud. .. figure:: /_static/images/provider_logos/openstack.png :align: center @@ -13,6 +13,32 @@ Among many other private clouds, it also powers Rackspace's Public Cloud. .. _connecting-to-openstack-installation: +Selecting the Nova API version +------------------------------ + +Along with your connection criteria, you can specify the Nova version with `api_version`, +currently supported versions of Nova are: + +- 1.0 +- 1.1 +- 2.0 +- 2.1 (v12) +- 2.2 (v13) + +.. code-block:: python + + from libcloud.compute.providers import get_driver + from libcloud.compute.types import Provider + + Openstack = get_driver(Provider.OPENSTACK) + + con = Openstack( + 'admin', 'password', + ex_force_base_url='http://23.12.198.36:8774/v2.1', + api_version='2.0', + ex_tenant_name='demo') + + Connecting to the OpenStack installation ---------------------------------------- @@ -45,9 +71,14 @@ Available arguments: and API key * ``2.0_password`` - authenticate against keystone with a username and password + * ``2.0_voms`` - 2.0 VOMS key + * ``3.x_password`` - 3.x keystone password + * ``3.x_appcred`` - 3.x keystone with application credential + * ``3.x_oidc_access_token`` - OIDC access token + Unless you are working with a very old version of OpenStack you will either - want to use ``2.0_apikey`` or ``2.0_password``. + want to use ``2.0_*`` or ``3.x_*``. * ``ex_tenant_name`` - tenant / project name * ``ex_force_auth_token`` - token which is used for authentication. If this argument is provided, normal authentication flow is skipped and the OpenStack @@ -58,12 +89,26 @@ Available arguments: * ``ex_force_service_type`` * ``ex_force_service_name`` * ``ex_force_service_region`` -* ``ex_force_base_url`` - Base URL to the OpenStack API endpoint. By default, +* ``ex_force_base_url`` - Base URL to the OpenStack nova API endpoint. By default, driver obtains API endpoint URL from the server catalog, but if this argument is provided, this step is skipped and the provided value is used directly. +* ``ex_force_network_url`` - Base URL to the OpenStack neutron API endpoint. By default, + driver obtains API endpoint URL from the server catalog, but if this argument + is provided, this step is skipped and the provided value is used directly. Only valid + in case of api_version >= 2.0. +* ``ex_force_image_url`` - Base URL to the OpenStack glance API endpoint. By default, + driver obtains API endpoint URL from the server catalog, but if this argument + is provided, this step is skipped and the provided value is used directly. Only valid + in case of api_version >= 2.0. +* ``ex_force_volume_url`` - Base URL to the OpenStack cinder API endpoint. By default, + driver obtains API endpoint URL from the server catalog, but if this argument + is provided, this step is skipped and the provided value is used directly. Only valid + in case of api_version >= 2.0. +* ``ex_force_microversion`` - Microversion of the API to interact with OpenStack. + Only valid in case of api_version >= 2.0. Some examples which show how to use this arguments can be found in the section -bellow. +below. Examples -------- @@ -84,7 +129,7 @@ Examples ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keep in mind that the base url must also contain tenant id as the last -component of the URL (``12345`` in the example bellow). +component of the URL (``12345`` in the example below). .. literalinclude:: /examples/compute/openstack/force_base_url.py :language: python @@ -122,7 +167,7 @@ Connecting to HP Cloud US West and US East (OpenStack Havana). .. literalinclude:: /examples/compute/openstack/hpcloud.py :language: python -7. Using Cloud-Init with Openstack +7. Using Cloud-Init with OpenStack ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This example shows how to use cloud-init using the ``ex_config_drive`` and @@ -136,6 +181,21 @@ public cloud providers support it. :language: python .. _`Cloud-Init examples`: http://cloudinit.readthedocs.org/en/latest/topics/examples.html +8. Authentication token cache +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Since version ???, authentication tokens can be stored in an external cache. +This enables multiple processes to reuse the tokens, reducing the number of +token allocations in the OpenStack authentication service. + +.. literalinclude:: /examples/compute/openstack/auth_cache.py + :language: python + +If the cache implementation stores tokens somewhere outside the process - for +instance, to disk or a remote system - running this program twice will +allocate a token from OpenStack, store it in the cache, then reuse that token +on the second run. + Non-standard functionality and extension methods ------------------------------------------------ @@ -150,7 +210,7 @@ This functionality includes: * key-pair management For information on how to use this functionality please see the method -docstrings bellow. +docstrings below. Other Information ----------------- @@ -167,6 +227,9 @@ token on the first request or if the auth token is about to expire. As noted in the example 4 above, this doesn't hold true if you use ``ex_force_auth_token`` argument. +Tokens can also be stored in an external cache for shared use among multiple +processes; see example 8 above. + Troubleshooting --------------- @@ -217,16 +280,23 @@ are supported by two different subclasses of the OpenStackNodeDriver. The default is the 1.1 API. The 1.0 API is supported to be able to connect to OpenStack instances which do not yet support the version 1.1 API. -Compute 1.1 API version (current) +Compute 2.0 API version (current) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. autoclass:: libcloud.compute.drivers.openstack.OpenStack_1_1_NodeDriver +.. autoclass:: libcloud.compute.drivers.openstack.OpenStack_2_NodeDriver :members: :inherited-members: -Compute 1.0 API version (old installations) +Compute 1.1 API version (old installations) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. autoclass:: libcloud.compute.drivers.openstack.OpenStack_1_1_NodeDriver + :members: + :inherited-members: + +Compute 1.0 API version (older installations) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + .. autoclass:: libcloud.compute.drivers.openstack.OpenStack_1_0_NodeDriver :members: :inherited-members: diff --git a/docs/compute/drivers/outscale.rst b/docs/compute/drivers/outscale.rst new file mode 100644 index 0000000000..ab3ebcfa6d --- /dev/null +++ b/docs/compute/drivers/outscale.rst @@ -0,0 +1,357 @@ +Outscale Driver Documentation +================================= + +`Outscale`_ provides an IaaS platform allowing +developers to benefit from all the flexibility of the Cloud. +This IaaS platform relies on TINA OS, its Cloud manager whose purpose is to +provide great performances on the Cloud. +TINA OS is software developed by Outscale. + +.. figure:: /_static/images/provider_logos/outscale.jpg + :align: center + :width: 300 + :target: https://www.outscale.com/ + +Outscale users can start virtual machines in the following regions: + +* cloudgouv-west-1, France +* eu-west-2, France +* us-est-2, US +* us-west-1, US +* cn-southeast-1, China + +Outscale is an European company and is priced in Euros. + +Instantiating a driver +~~~~~~~~~~~~~~~~~~~~~~ + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``key`` - Your Outscale access key +* ``secret`` - Your Outscale secret key +* ``region`` - The region you want to make action on +* ``service`` - The Outscale service you want to use + +Once you have some credentials you can instantiate the driver as shown below. + +.. literalinclude:: /examples/compute/outscale/instantiate.py + :language: python + +List the Virtual Machines (node) +-------------------------------- + +Listing the Virtual Machines on Outscale using libcloud works the same as on any +other platform. This example is just to show exactly that. + +This example will list the Virtual Machines in eu-west-2 region. + +.. literalinclude:: /examples/compute/outscale/list_nodes.py + :language: python + + +API Documentation +----------------- + +.. autoclass:: libcloud.compute.drivers.outscale.OutscaleNodeDriver + :members: + :inherited-members: + +.. _`Outscale`: https://docs.outscale.com/api +.. _`Outscale Inc.`: outscale_inc.html + +Outscale Implementation of Libcloud +----------------------------------- + +The Outscale driver implements the following ``NodeDriver`` functions: + +Regions +------- +* ``list_locations`` - Returns a list of ``NodeLocation`` + +Nodes +----- +* ``create_node`` - Creates a ``Node`` +* ``reboot_node`` - Reboots a ``Node`` +* ``list_nodes`` - Returns a list of ``Node`` +* ``destroy_node`` - Destroys an existing ``Node`` +* ``start_node`` - Start a ``Node`` +* ``stop_node`` - Stop a ``Node`` + +Images +------ +* ``create_images`` - Returns a ``NodeImage`` +* ``list_images`` - Returns a list of ``NodeImage`` +* ``get_image`` - Returns a ``NodeImage`` +* ``delete_image`` - Return a ``bool`` +* ``ex_create_image_export_task`` - Returns a ``dict`` +* ``ex_list_image_export_task`` - Returns a ``list`` of ``dict`` +* ``ex_update_image`` - Returns a ``dict`` + +Key Pairs +_________ +* ``create_key_pair`` - Returns a ``KeyPair`` +* ``list_key_pairs`` - Returns a list of ``KeyPair`` +* ``get_key_pair`` - Returns a ``KeyPair`` +* ``delete_key_pair`` - Returns a ``bool`` + +Snapshots +--------- +* ``create_volume_snapshot`` - Returns a ``VolumeSnapshot`` +* ``list_snapshots`` - Returns a list of ``VolumeSnapshot`` +* ``destroy_volume_snapshot`` - Returns a ``bool`` +* ``list_volume_snapshots`` - Returns a list of ``VolumeSnapshot`` +* ``ex_create_snapshot_export_task`` - Returns a ``dict`` +* ``ex_list_snapshot_export_tasks`` - Returns a ``list`` of ``dict`` +* ``ex_update_snapshot`` - Returns a ``dict`` + +Volumes +------- +* ``create_volume`` - Returns a ``StorageVolume`` +* ``list_volumes`` - Returns a list of ``StorageVolume`` +* ``destroy_volume`` - Returns a ``bool`` +* ``attach_volume`` - Return a ``bool`` +* ``detach_volume`` - Returns a ``bool`` + +Outscale Extra Functions +------------------------ + +The Outscale driver implement the following extra methods: + +Public IPs +---------- +* ``ex_create_public_ip`` - Returns a ``bool`` +* ``ex_delete_public_ip`` - Returns a ``bool`` +* ``ex_list_public_ips`` - Returns a ``dict`` +* ``ex_list_public_ip_ranges`` - Returns a ``dict`` +* ``ex_attach_public_ip`` - Returns a ``bool`` +* ``ex_detach_public_ip`` - Returns a ``bool`` + +Accounts +-------- +* ``ex_check_account`` - Returns a ``bool`` +* ``ex_read_account`` - Returns a ``dict`` +* ``ex_reset_account_password`` - Returns a ``dict`` +* ``ex_send_reset_password_email`` - Returns a ``bool`` +* ``ex_create_account`` - Returns a ``bool`` +* ``ex_update_account`` - Returns a ``dict`` +* ``ex_list_consumption_account`` - Returns a ``list`` of ``dict`` + +Tags +---- +* ``ex_create_tag`` - Returns a ``bool`` +* ``ex_create_tags`` - Returns a ``bool`` +* ``ex_delete_tags`` - Returns a ``bool`` +* ``ex_list_tags`` - Returns a ``dict`` + +Regions and SubRegions +---------------------- +* ``ex_list_regions`` - Returns a ``list`` of ``dict`` +* ``ex_list_subregions`` - Returns a ``list`` of ``dict`` + +Access Keys +----------- +* ``ex_create_access_key`` - Returns a ``dict`` +* ``ex_delete_access_key`` - Returns a ``bool`` +* ``ex_list_access_keys`` - Returns a ``list`` of ``dict`` +* ``ex_list_secret_access_key`` - Returns a ``dict`` +* ``ex_update_access_key`` - Returns a ``dict`` + +Client Gateways +--------------- +* ``ex_create_client_gateway`` - Returns a ``dict`` +* ``ex_delete_client_gateway`` - Returns a ``bool`` +* ``ex_list_client_gateways`` - Returns a ``list`` of ``dict`` + +Dhcp Options +------------ +* ``ex_create_dhcp_options`` - Returns a ``dict`` +* ``ex_delete_dhcp_options`` - Returns a ``bool`` +* ``ex_list_dhcp_options`` - Returns a ``list`` of ``dict`` + +Direct Links +------------ +* ``ex_create_direct_link`` - Returns a ``dict`` +* ``ex_delete_direct_link`` - Returns a ``bool`` +* ``ex_list_direct_links`` - Returns a ``list`` of ``dict`` + +Direct Link Interfaces +---------------------- +* ``ex_create_direct_link_interface`` - Returns a ``dict`` +* ``ex_delete_direct_link_interface`` - Returns a ``bool`` +* ``ex_list_direct_link_interfaces`` - Returns a ``list`` of ``dict`` + +Flexible GPU +------------ +* ``ex_create_flexible_gpu`` - Returns a ``dict`` +* ``ex_delete_flexible_gpu`` - Returns a ``bool`` +* ``ex_link_flexible_gpu`` - Returns a ``bool`` +* ``ex_unlink_flexible_gpu`` - Returns a ``bool`` +* ``ex_list_flexible_gpu_catalog`` - Returns a ``list`` of ``dict`` +* ``ex_list_flexible_gpus`` - Returns a ``list`` of ``dict`` +* ``ex_update_flexible_gpu`` - Returns a ``dict`` + +Internet Services +----------------- +* ``ex_create_internet_service`` - Returns a ``dict`` +* ``ex_delete_internet_service`` - Returns a ``bool`` +* ``ex_link_internet_service`` - Returns a ``bool`` +* ``ex_unlink_internet_service`` - Returns a ``bool`` +* ``ex_list_internet_services`` - Returns a ``list`` of ``dict`` + +Listener +-------- +* ``ex_create_listener_rule`` - Returns a ``dict`` +* ``ex_create_load_balancer_listeners`` - Returns a ``dict`` +* ``ex_delete_listener_rule`` - Returns a ``bool`` +* ``ex_delete_load_balancer_listeners`` - Returns a ``bool`` +* ``ex_list_listener_rules`` - Returns a ``bool`` +* ``ex_update_listener_rule`` - Returns a ``dict`` + +Load Balancers +-------------- +* ``ex_create_load_balancer`` - Returns a ``dict`` +* ``ex_update_load_balancer`` - Returns a ``dict`` +* ``ex_create_load_balancer_tags`` - Returns a ``bool`` +* ``ex_delete_load_balancer`` - Returns a ``bool`` +* ``ex_delete_load_balancer_tags`` - Returns a ``bool`` +* ``ex_deregister_vms_in_load_balancer`` - Returns a ``bool`` +* ``ex_register_vms_in_load_balancer`` - Returns a ``bool`` +* ``ex_list_load_balancer_tags`` - Returns a ``list`` of ``dict`` +* ``ex_list_vms_health`` - Returns a ``list`` of ``dict`` +* ``ex_list_load_balancers`` - Returns a ``list`` of ``dict`` + +Load Balancer Policies +---------------------- +* ``ex_create_load_balancer_policy`` - Returns a ``dict`` +* ``ex_delete_load_balancer_policy`` - Returns a ``bool`` + +Nat Services +------------ +* ``ex_create_nat_service`` - Returns a ``dict`` +* ``ex_delete_nat_service`` - Returns a ``bool`` +* ``ex_list_nat_services`` - Returns a ``list`` of ``dict`` + +Net +--- +* ``ex_create_net`` - Returns a ``dict`` +* ``ex_delete_net`` - Returns a ``bool`` +* ``ex_list_nets`` - Returns a ``list`` of ``dict`` +* ``ex_update_net`` - Returns a ``dict`` + +Net Access Point +---------------- +* ``ex_create_net_access_point`` - Returns a ``dict`` +* ``ex_delete_net_access_point`` - Returns a ``bool`` +* ``ex_list_net_access_point_services`` - Returns a ``list`` of ``dict`` +* ``ex_list_net_access_points`` - Returns a ``list`` of ``dict`` +* ``ex_update_net_access_point`` - Returns a ``dict`` + +Net Peerings +------------ +* ``ex_accept_net_peering`` - Returns a ``dict`` +* ``ex_create_net_peering`` - Returns a ``dict`` +* ``ex_delete_net_peering`` - Returns a ``bool`` +* ``ex_list_net_peerings`` - Returns a ``list`` of ``dict`` +* ``ex_reject_net_peering`` - Returns a ``dict`` + +Nics +---- +* ``ex_create_nic`` - Returns a ``dict`` +* ``ex_delete_nic`` - Returns a ``bool`` +* ``ex_link_nic`` - Returns a ``bool`` +* ``ex_unlink_nic`` - Returns a ``bool`` +* ``ex_link_private_ips`` - Returns a ``bool`` +* ``ex_list_nics`` - Returns a ``list`` of ``dict`` +* ``ex_unlink_private_ips`` - Returns a ``bool`` +* ``ex_update_nic`` - Returns a ``dict`` + +Product Types +------------- +* ``ex_list_product_types`` - Returns a ``list`` of ``dict`` + +Quotas +------ +* ``ex_list_quotas`` - Returns a ``list`` of ``dict`` + +Routes +------ +* ``ex_create_route`` - Returns a ``dict`` +* ``ex_delete_route`` - Returns a ``bool`` +* ``ex_update_route`` - Returns a ``dict`` + +Route Tables +------------ +* ``ex_create_route_table`` - Returns a ``dict`` +* ``ex_delete_route_table`` - Returns a ``bool`` +* ``ex_link_route_table`` - Returns a ``bool`` +* ``ex_list_route_tables`` - Returns a ``list`` of ``dict`` +* ``ex_unlink_route_table`` - Returns a ``bool`` + +Server Certificates +------------------- +* ``ex_create_server_certificate`` - Returns a ``dict`` +* ``ex_delete_server_certificate`` - Returns a ``bool`` +* ``ex_list_server_certificates`` - Returns a ``list`` of ``dict`` +* ``ex_update_server_certificate`` - Returns a ``dict`` + +Virtual Gateways +---------------- +* ``ex_create_virtual_gateway`` - Returns a ``dict`` +* ``ex_delete_virtual_gateway`` - Returns a ``bool`` +* ``ex_link_virtual_gateway`` - Returns a ``dict`` +* ``ex_list_virtual_gateways`` - Returns a ``list`` of ``dict`` +* ``ex_unlink_virtual_gateway`` - Returns a ``bool`` +* ``ex_update_route_propagation`` - Returns a ``dict`` + +Security Groups +--------------- +* ``ex_create_security_group`` - Returns a ``dict`` +* ``ex_delete_security_group`` - Returns a ``bool`` +* ``ex_list_security_groups`` - Returns a ``list`` of ``dict`` + +Security Group Rules +-------------------- +* ``ex_create_security_group_rule`` - Returns a ``dict`` +* ``ex_delete_security_group_rule`` - Returns a ``dict`` + + +Subnets +------- +* ``ex_create_subnet`` - Returns a ``dict`` +* ``ex_delete_subnet`` - Returns a ``bool`` +* ``ex_list_subnets`` - Returns a ``list`` of ``dict`` +* ``ex_update_subnet`` - Returns a ``dict`` + +Tasks +----- +* ``ex_delete_export_task`` - Returns a ``bool`` + +Vpn Connections +--------------- +* ``ex_create_vpn_connection`` - Returns a ``dict`` +* ``ex_create_vpn_connection_route`` - Returns a ``bool`` +* ``ex_delete_vpn_connection`` - Returns a ``bool`` +* ``ex_delete_vpn_connection_route`` - Returns a ``bool`` +* ``ex_list_vpn_connections`` - Returns a ``list`` of ``dict`` + +Nodes +----- +* ``ex_read_admin_password_node`` - Returns a ``str`` +* ``ex_read_console_output_node`` - Returns a ``str`` +* ``ex_list_node_types`` - Returns a ``list`` of ``dict`` +* ``ex_list_nodes_states`` - Returns a ``list`` of ``dict`` +* ``ex_update_node`` - Returns a ``list`` of ``dict`` + +Certificate Authority +--------------------- +* ``ex_create_certificate_authority`` - Returns a ``dict`` +* ``ex_delete_certificate_authority`` - Returns a ``bool`` +* ``ex_read_certificate_authorities`` - Returns a ``list`` of ``dict`` + +API Access Rules +---------------- +* ``ex_create_api_access_rule`` - Returns a ``dict`` +* ``ex_delete_api_access_rule`` - Returns a ``bool`` +* ``ex_read_api_access_rules`` - Returns a ``list`` of ``dict`` +* ``ex_update_api_access_rule`` - Returns a ``dict`` diff --git a/docs/compute/drivers/outscale_inc.rst b/docs/compute/drivers/outscale_inc.rst index a6786a2bd4..bcfb313c00 100644 --- a/docs/compute/drivers/outscale_inc.rst +++ b/docs/compute/drivers/outscale_inc.rst @@ -3,11 +3,11 @@ Outscale INC Driver Documentation `Outscale INC`_ provides an IaaS platform allowing developers to benefit from all the flexibility of the Cloud. -This IaaS platform relies on TINA OS, its Cloud manager which purpose is to +This IaaS platform relies on TINA OS, its Cloud manager whose purpose is to provide great performances on the Cloud. -TINA OS is an own developed software with APIs compatible with AWS EC2 (TM). +TINA OS is software developed by Outscale with APIs compatible with AWS EC2 (TM). -.. figure:: /_static/images/provider_logos/outscale.png +.. figure:: /_static/images/provider_logos/outscale.jpg :align: center :width: 300 :target: https://www.outscale.com/ @@ -19,7 +19,9 @@ Outscale users can start virtual machines in the following regions: * (Soon) US East (New Jersey) Region * (Soon) Asia (Hong Kong) Region -Outscale INC is an American company: prices are in $. +For other Regions, see the `Outscale SAS`_ documentation. + +Outscale INC is an American company and is priced in United States Dollars. API Docs -------- @@ -29,3 +31,4 @@ API Docs :inherited-members: .. _`Outscale INC`: https://www.outscale.com/ +.. _`Outscale SAS`: outscale_sas.html diff --git a/docs/compute/drivers/outscale_sas.rst b/docs/compute/drivers/outscale_sas.rst index 441febcab0..4177d23882 100644 --- a/docs/compute/drivers/outscale_sas.rst +++ b/docs/compute/drivers/outscale_sas.rst @@ -3,29 +3,30 @@ Outscale SAS Driver Documentation `Outscale SAS`_ provides an IaaS platform allowing developers to benefit from all the flexibility of the Cloud. -This IaaS platform relies on TINA OS, its Cloud manager which purpose is to +This IaaS platform relies on TINA OS, its Cloud manager whose purpose is to provide great performances on the Cloud. -TINA OS is an own developed software with APIs compatible with AWS EC2 (TM). +TINA OS is software developed by Outscale with APIs compatible with AWS EC2 (TM). -.. figure:: /_static/images/provider_logos/outscale.png +.. figure:: /_static/images/provider_logos/outscale.jpg :align: center :width: 300 :target: https://www.outscale.com/ Outscale users can start virtual machines in the following regions: -* EU West (Paris France) Region -* US East (Boston US) Region -* (Soon) US East (New Jersey) Region -* (Soon) Asia (Hong Kong) Region +* eu-west-1, France (Paris) +* eu-west-2, France (Paris) -Outscale SAS is a European company: prices are in €. +For other Regions, see the `Outscale Inc.`_ documentation. -API Docs --------- +Outscale SAS is European company and is priced in Euros. + +API Documentation +----------------- .. autoclass:: libcloud.compute.drivers.ec2.OutscaleSASNodeDriver :members: :inherited-members: .. _`Outscale SAS`: https://www.outscale.com/ +.. _`Outscale Inc.`: outscale_inc.html diff --git a/docs/compute/drivers/ovh.rst b/docs/compute/drivers/ovh.rst new file mode 100644 index 0000000000..f394a03cd1 --- /dev/null +++ b/docs/compute/drivers/ovh.rst @@ -0,0 +1,81 @@ +OVH Compute Driver Documentation +================================ + +`OVH`_ is an Internet Service Provider providing dedicated servers, shared and +cloud hosting, domain registration, and VOIP telephony services. + +.. figure:: /_static/images/provider_logos/ovh.png + :align: center + :width: 300 + :target: https://www.ovh.com + +OVH driver uses a REST API, for more information about that, please refer to +`API console`_. + +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``key`` - Application key +* ``secret`` - Application secret +* ``ex_project_id`` - Project ID +* ``ex_consumer_key`` - Consumer key + +For get application key and secret, you must register an application +at https://eu.api.ovh.com/createApp/. Next step, create a consumer key with +following command: :: + + curl -X POST \ + -H 'X-Ovh-Application: youApplicationKey' \ + -H 'Content-Type: application/json' \ + -d '{ + "accessRules": + [ + {"method":"GET","path":"/*"}, + {"method":"POST","path":"/*"}, + {"method":"DELETE","path":"/*"}, + {"method":"PUT","path":"/*"} + ], + "redirection":"http://ovh.com" + }' \ + https://eu.api.ovh.com/1.0/auth/credential + +This will answer a JSON like below with inside your Consumer Key and +``validationUrl``. Follow this link for valid your key. :: + + { + "validationUrl":"https://eu.api.ovh.com/auth/?credentialToken=fIDK6KCVHfEMuSTP3LV84D3CsHTq4T3BhOrmEEdd2hQ0CNcfVgGVWZRqIlolDJ3W", + "consumerKey":"y7epYeHCIqoO17BzBgxluvB4XLedpba9", + "state":"pendingValidation" + } + + +Secondly, you must create a cloud project and retrieve its ID, from URL for +example. + +Now you have and can use you credentials with Libcloud. + +Examples +-------- + +Create node +~~~~~~~~~~~ + +.. literalinclude:: /examples/compute/ovh/create_node.py + +Create and attach a volume to a node +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/compute/ovh/attach_volume.py + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.ovh.OvhNodeDriver + :members: + :inherited-members: + +.. _`OVH`: https://www.ovh.com +.. _`API console`: https://api.ovh.com/console/#/ diff --git a/docs/compute/drivers/rackspace.rst b/docs/compute/drivers/rackspace.rst index c0bbf1bdbd..1604c3a2cb 100644 --- a/docs/compute/drivers/rackspace.rst +++ b/docs/compute/drivers/rackspace.rst @@ -53,7 +53,7 @@ Examples ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Rackspace recently announced new 'performance' flavors of their cloud servers. -The example bellow shows how to use this new flavors. +The example below shows how to use this new flavors. Keep in mind that this new flavors are currently only supported in the following regions: ``iad``, ``ord``, ``lon``. diff --git a/docs/compute/drivers/scaleway.rst b/docs/compute/drivers/scaleway.rst new file mode 100644 index 0000000000..0afffeca75 --- /dev/null +++ b/docs/compute/drivers/scaleway.rst @@ -0,0 +1,30 @@ +Scaleway Compute Driver Documentation +===================================== + +`Scaleway`_ is a dedicated bare metal cloud hosting provider based in Paris + +.. figure:: /_static/images/provider_logos/scaleway.png + :align: center + :width: 300 + :target: https://www.scaleway.com/ + +Instantiating a driver and listing nodes +---------------------------------------- + +.. literalinclude:: /examples/compute/scaleway/list_nodes.py + :language: python + +Instantiating a driver and listing volumes +------------------------------------------ + +.. literalinclude:: /examples/compute/scaleway/list_volumes.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.scaleway.ScalewayNodeDriver + :members: + :inherited-members: + +.. _`Scaleway`: https://www.scaleway.com/ diff --git a/docs/compute/drivers/upcloud.rst b/docs/compute/drivers/upcloud.rst new file mode 100644 index 0000000000..6cc8888a3f --- /dev/null +++ b/docs/compute/drivers/upcloud.rst @@ -0,0 +1,85 @@ +UpCloud Driver Documentation +=============================== +`UpCloud`_ is a Finnish IaaS provider offering high performance servers +from data centers based in multiple countries. + +.. figure:: /_static/images/provider_logos/upcloud.png + :align: center + :width: 300 + :target: https://upcloud.com/ + +UpCloud currently operates globally from eight (8) data centers: + +* Amsterdam, Netherlands +* Chicago, USA +* Frankfurt, Germany +* Helsinki 1, Finland +* Helsinki 2, Finland +* London, UK +* San Jose, USA +* Singapore, Singapore + +This driver uses the UpCloud API 1.3 endpoints. + +Firewall rules +-------------- + +UpCloud manages network access through per-server firewall rules instead of +reusable security groups. The driver exposes those rules through extension +methods: + +* ``ex_list_firewall_rules(node)`` +* ``ex_get_firewall_rule(node, position)`` +* ``ex_create_firewall_rule(node, rule)`` +* ``ex_create_firewall_rules(node, rules)`` +* ``ex_delete_firewall_rule(node, position)`` + +Instantiating a driver +---------------------- + +When you instantiate a driver you can authenticate with an API bearer token: + +* ``token`` - Your UpCloud API bearer token + +For example: + +.. code-block:: python + + from libcloud.compute.types import Provider + from libcloud.compute.providers import get_driver + + cls = get_driver(Provider.UPCLOUD) + driver = cls(token="ucat_...") + +You can also use basic authentication with an API enabled user: + +* ``username`` - Your API access enabled users username +* ``password`` - Your API access enabled users password + +For example: + +.. code-block:: python + + from libcloud.compute.types import Provider + from libcloud.compute.providers import get_driver + + cls = get_driver(Provider.UPCLOUD) + driver = cls("username", "password") + +Enabling API access +------------------- + +To allow API access to your UpCloud account, you first need to enable the API +permissions by visiting `People`_ in your UpCloud Control +Panel. We recommend you to set up a sub-account specifically for the API usage +with its own username and password, as it allows you to assign specific permissions +for increased security. + +Click **Add user** and fill in the required details, and check the +“**Allow API connections**” checkbox to enable API for the user. You can also +limit the API connections to a specific IP address or address range for additional +security. Once you are done entering the user information, hit the **Save** button +at the bottom of the page to create the new username. + +.. _`UpCloud`: https://upcloud.com/ +.. _`People`: https://hub.upcloud.com/people diff --git a/docs/compute/drivers/vsphere.rst b/docs/compute/drivers/vsphere.rst index 243b63f28e..274fd0c9dd 100644 --- a/docs/compute/drivers/vsphere.rst +++ b/docs/compute/drivers/vsphere.rst @@ -1,86 +1,13 @@ VMware vSphere Compute Driver Documentation =========================================== -`VMware vSphere`_ is VMware's cloud computing operating system which allows -you to run your own private cloud. +.. note:: -.. figure:: /_static/images/provider_logos/vmware_vsphere.png - :align: center - :width: 200 - :target: http://www.vmware.com/products/vsphere/ + VMware vSphere driver relies on ``pysphere`` library which is unmaintained + and doesn't support Python 3. -Requirements ------------- + Libcloud v3.0.0 removed supprt for Python versions older than v3.5.0 and as + such, vSphere driver was removed. -VMware vSphere driver depends on the `pysphere`_ Python library which needs to -be installed for the driver to work. - -This library can be installed using pip as shown bellow: - -.. sourcecode:: bash - - pip install pysphere - -Connecting to vSphere installation ----------------------------------- - -To connect to the vSphere installation you need to pass the following arguments -to the driver constructor - -* ``host`` - hostname or IP address of your vSphere installation. Note: if your - installation is using or accessible via a different port, you should use the - ``url`` argument which is described bellow instead. -* ``url`` - full URL to your vSphere installation client endpoint - e.g. - ``https:///sdk/``. Note: This argument is mutually exclusive with - ``host`` argument which means you need to provide either ``host`` or ``url`` - argument, but not both. -* ``username`` - username used to log in -* ``password`` - password used to log in - -Examples --------- - -1. Connect by specifying a host -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. literalinclude:: /examples/compute/vsphere/connect_host.py - :language: python - -2. Connect by specifying a url -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. literalinclude:: /examples/compute/vsphere/connect_url.py - :language: python - -3. Connect by specifying a url (custom port) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. literalinclude:: /examples/compute/vsphere/connect_url_custom_port.py - :language: python - -Troubleshooting ---------------- - -How do I know if I'm connecting to the correct URL? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you are connecting by provider ``url`` argument and you get the -``Response is "text", not "text/xml"`` or similar error back, this most likely -means you have specified an invalid URL (e.g. you forgot to specify a path). - -You can test if the url you are using is valid by adding ``/vimService.wsdl`` -to it (e.g. ``https:///sdk/vimService.wsdl``). When you visit this page, -you should get an XML response back. - -API Docs --------- - -VMware vSphere v5.5 -~~~~~~~~~~~~~~~~~~~ - -.. autoclass:: libcloud.compute.drivers.vsphere.VSphere_5_5_NodeDriver - :members: - :inherited-members: - -.. _`VMware vSphere`: http://www.vmware.com/products/vsphere/ -.. _`pysphere`: https://pypi.python.org/pypi/pysphere + If you still need to use that driver, you can use latest Libcloud release + which still supports Python 2.7 (Libcloud v2.8.0). diff --git a/docs/compute/index.rst b/docs/compute/index.rst index dbefcb4e5c..f483416de1 100644 --- a/docs/compute/index.rst +++ b/docs/compute/index.rst @@ -13,7 +13,7 @@ configuration management tool (such as Puppet, Chef, or cfengine) on it. Besides managing cloud and virtual servers, compute component also allows you to manage cloud block storage (not to be confused with cloud object storage) for providers which support it. -Block storage management is lives under compute API, because it is in most cases +Block storage management lives under compute API, because it is in most cases tightly coupled with compute resources. Terminology @@ -32,8 +32,8 @@ Compute * :class:`~libcloud.compute.base.NodeLocation` - represents a physical location where a server can be. * :class:`~libcloud.compute.types.NodeState` - represents a node state. - Standard states are: ``running``, ``stopped``, ``rebooting``, ``terminated``, - ``pending``, and ``unknown``. + Standard states are: ``running``, ``rebooting``, ``terminated``, ``pending``, + ``stopped``, ``suspended``, ``paused``, ``erro``, ``unknown``. Key Pair Management ~~~~~~~~~~~~~~~~~~~ diff --git a/docs/compute/pricing.rst b/docs/compute/pricing.rst index f44ba3e99c..36a9dae1e1 100644 --- a/docs/compute/pricing.rst +++ b/docs/compute/pricing.rst @@ -9,12 +9,12 @@ on the :class:`NodeSize` object. :attr:`price` attribute is a :func:`float` type and tells user how much it costs (in US dollars) to run a ``Node`` with a specified :class:`NodeSize` for an hour. -Example bellow shows how to retrieve pricing for ``NodeSize`` objects using +Example below shows how to retrieve pricing for ``NodeSize`` objects using :func:`list_sizes` method. .. literalinclude:: /examples/compute/pricing.py :language: python - :emphasize-lines: 11-19 + :emphasize-lines: 11-18 As noted above this pricing information is an estimate and should only be used as such. You should always check your provider website / control panel @@ -29,14 +29,65 @@ Where does the Libcloud pricing data come from? ----------------------------------------------- Most of the providers don't provide pricing information via the API which means -most of the pricing information is scrapped directly from the provider +most of the pricing information is scraped directly from the provider websites. -Pricing data which is scrapped from the provider websites is located in a +Pricing data which is scraped from the provider websites is located in a JSON file (``data/pricing.json``) which is bundled with each release. This pricing data is only updated once you install a new release which means it could be out of date. +Downloading latest pricing data from an S3 Bucket +------------------------------------------------- + +Since July 2020, we now run a daily job as part of our CI/CD system which +scrapes pricing data for various providers and publishes pricing data to a +public read-only S3 bucket. + +Pricing file data is available at the following locations: + +* https://libcloud-pricing-data.s3.amazonaws.com/pricing.json +* https://libcloud-pricing-data.s3.amazonaws.com/pricing.json.sha256 +* https://libcloud-pricing-data.s3.amazonaws.com/pricing.json.sha512 + +First file contains the actual pricing JSON file and the second and third +contain SHA 256 and SHA 512 sum of that file content. + +We are providing this service free of charge so it's important that you don't +abuse it. This means you should not download this file more than once per day +(it makes no sense to do it more often, since it only gets updated once per +day if there are any changes) and you should utilize one of the caching +approaches described below and only download ``pricing.json`` file when there +are any changes / updates. + +You can use the content of the sha sum files to implement efficient file +downloads and only download pricing.json file if the content has changed. + +You can do that by fetching the sha sum file, caching the sha sum and only +downloading ``pricing.json`` file is the sha sum value has changed. + +An alternative to using the content of the sha sum file is caching the value +of the ``ETag`` HTTP response header which you can retrieve by issuing HTTP +``HEAD`` request against the ``pricing.json`` URL. HEAD request will only +return the object metadata without the actual content. + +For example: + +.. sourcecode:: bash + + curl --head https://libcloud-pricing-data.s3.amazonaws.com/pricing.json + + HTTP/1.1 200 OK + x-amz-id-2: c8Mer3VtRYWGeKtKlbgwebn3BsVQt+Z/WKKPjk3NcsRSK23BzE6OQDIogzIR2oJGJRmOtS4ydjA= + x-amz-request-id: 9A790A3B3587478D + Date: Sat, 11 Jul 2020 16:01:39 GMT + Last-Modified: Sat, 11 Jul 2020 15:55:50 GMT + ETag: "e46324663d76dedafc7d9b09537b18a7" + Accept-Ranges: bytes + Content-Type: application/json + Content-Length: 549390 + Server: AmazonS3 + .. _using-custom-pricing-file: Using a custom pricing file @@ -48,9 +99,9 @@ Using a custom pricing file By default Libcloud reads pricing data from ``data/pricing.json`` file which is included in the release package. If you want to use a custom pricing file, -simply move your custom pricing file to ``~/.libcloud.pricing.json``. +simply move your custom pricing file to ``~/.libcloud/pricing.json``. -If ``~/.libcloud.pricing.json`` file is available, Libcloud will use it instead +If ``~/.libcloud/pricing.json`` file is available, Libcloud will use it instead of the default pricing file which comes bundled with the release. Updating pricing @@ -60,9 +111,9 @@ Updating pricing This functionality is only available in Libcloud 0.14.0 and above. -Currently only way to update pricing is programmatically using -:func:`libcloud.pricing.download_pricing_file` function. By default this -function retrieves the latest pricing file from our git repository and saves it -to ``~/.libcloud.pricing.json``. +Currently the only way to update pricing is programmatically using +:func:`libcloud.pricing.download_pricing_file`. By default, this function +retrieves the latest pricing file from the public S3 bucket and saves it to +``~/.libcloud/pricing.json``. .. autofunction:: libcloud.pricing.download_pricing_file diff --git a/docs/conf.py b/docs/conf.py index 6bd17cb7d6..f361b99c56 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,218 +11,227 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os -import subprocess +import os +import re +import sys +import glob +import shutil +import datetime -# Detect if we are running on read the docs -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' +from sphinx.ext import apidoc +from sphinx.domains.python import PythonDomain -if on_rtd: - cmd = 'sphinx-apidoc -d 3 -o apidocs/ ../libcloud/' - subprocess.call(cmd, shell=True) +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) +BASE_DIR = os.path.abspath(BASE_DIR) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('../')) +sys.path.insert(0, os.path.abspath("../")) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode'] +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", + "sphinx_rtd_theme", +] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix of source filenames. -source_suffix = '.rst' +source_suffix = ".rst" # The encoding of source files. -#source_encoding = 'utf-8-sig' +# source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. -project = u'Apache Libcloud' -copyright = u'2013, The Apache Software Foundation' +now = datetime.datetime.utcnow() +project = "Apache Libcloud" +copyright = ( + "Copyright (C) 2009 - %s The Apache Software Foundation. Apache Libcloud, Libcloud, Apache, the Apache feather, and the Apache Libcloud project logo are trademarks of the Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners" + % (now.year) +) + +html_show_sphinx = False # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '0.14.0' +version = "3.9.0" + # The full version, including alpha/beta/rc tags. -release = '0.14.0-dev' +release = "3.9.0" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -#language = None +# language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -#today = '' +# today = '' # Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' +# today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = [ - '_build', - '*/_*.rst' -] +exclude_patterns = ["_build", "*/_*.rst"] # The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None +# default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +# add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -#add_module_names = True +# add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -#show_authors = False +# show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] +# modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. - -if on_rtd: - html_theme = 'default' - RTD_NEW_THEME = True -else: - html_theme = 'nature' +html_theme = "sphinx_rtd_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +# html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +# html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -#html_title = None +# html_title = None # A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None +# html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +# html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -#html_favicon = None +# html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static', '_static/images/'] +html_static_path = ["_static", "_static/images/"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' +# html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -#html_use_smartypants = True +# html_use_smartypants = True # Custom sidebar templates, maps document names to template names. -#html_sidebars = {} +# html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. -#html_additional_pages = {} +# html_additional_pages = {} # If false, no module index is generated. -#html_domain_indices = True +# html_domain_indices = True # If false, no index is generated. -#html_use_index = True +# html_use_index = True # If true, the index is split into individual pages for each letter. -#html_split_index = False +# html_split_index = False # If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +# html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True +# html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True +# html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -#html_use_opensearch = '' +# html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None +# html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'ApacheLibclouddoc' +htmlhelp_basename = "ApacheLibclouddoc" # -- Options for LaTeX output -------------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'ApacheLibcloud.tex', u'Apache Libcloud Documentation', - u'The Apache Software Foundation', 'manual'), + ( + "index", + "ApacheLibcloud.tex", + "Apache Libcloud Documentation", + "The Apache Software Foundation", + "manual", + ), ] # The name of an image file (relative to this directory) to place at the top of # the title page. -#latex_logo = None +# latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -#latex_use_parts = False +# latex_use_parts = False # If true, show page references after internal links. -#latex_show_pagerefs = False +# latex_show_pagerefs = False # If true, show URL addresses after external links. -#latex_show_urls = False +# latex_show_urls = False # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] # If false, no module index is generated. -#latex_domain_indices = True +# latex_domain_indices = True # -- Options for manual page output -------------------------------------------- @@ -230,12 +239,17 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'apachelibcloud', u'Apache Libcloud Documentation', - [u'The Apache Software Foundation'], 1) + ( + "index", + "apachelibcloud", + "Apache Libcloud Documentation", + ["The Apache Software Foundation"], + 1, + ) ] # If true, show URL addresses after external links. -#man_show_urls = False +# man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ @@ -244,22 +258,111 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'ApacheLibcloud', u'Apache Libcloud Documentation', - u'The Apache Software Foundation', 'ApacheLibcloud', 'One line description of project.', - 'Miscellaneous'), + ( + "index", + "ApacheLibcloud", + "Apache Libcloud Documentation", + "The Apache Software Foundation", + "ApacheLibcloud", + "One line description of project.", + "Miscellaneous", + ), ] # Documents to append as an appendix to all manuals. -#texinfo_appendices = [] +# texinfo_appendices = [] # If false, no module index is generated. -#texinfo_domain_indices = True +# texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' - +# texinfo_show_urls = 'footnote' # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'http://docs.python.org/': None} +intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} + +autoclass_content = "both" + +# Ignore "more than one target found for cross-reference" errors which are false +# non fatal / false positive +autodoc_warningiserror = False + +suppress_warnings = [ + "ref.python", + "autodoc.*", + "misc.highlighting_failure", +] + + +def add_orphan_tag_to_apidocs(app, docname, source): + """ + Add :orphan: tag to apidocs/modules.rst file to avoid errors during docs build. + """ + + if docname == "apidocs/modules": + source[0] = ":orphan:" + "\n\n" + source[0] + + +# Taken and based from code in the sphinx project (BSD 2.0 license) +# https://github.com/sphinx-doc/sphinx/blob/master/doc/conf.py +def linkify_issues_in_changelog(app, docname, source): + """ + Linkify issue references in changelog to GitHub and Jira. + """ + + if docname == "changelog": + changelog_path = os.path.join(BASE_DIR, "../CHANGES.rst") + + with open(changelog_path, encoding="utf-8") as f: + changelog = f.read() + + def linkify_github_issues(match): + url = "https://github.com/apache/libcloud/issues/" + match[1] + + return f"`{match[0]} <{url}>`_" + + def linkify_jira_issues(match): + url = "https://issues.apache.org/jira/browse/LIBCLOUD-" + match[1] + + return f"`{match[0]} <{url}>`_" + + linkified_changelog = re.sub(r"(?:PR)?#([0-9]+)\b", linkify_github_issues, changelog) + linkified_changelog = re.sub( + r"GITHUB-([0-9]+)\b", linkify_github_issues, linkified_changelog + ) + linkified_changelog = re.sub( + r"LIBCLOUD-([0-9]+)\b", linkify_jira_issues, linkified_changelog + ) + + source[0] = source[0].replace(".. include:: ../CHANGES.rst", linkified_changelog) + + +def run_apidoc(_): + # ignore test modules + ignore_paths = glob.glob("../libcloud/test/**/*.py", recursive=True) + # Problematic driver with hundreds of issues + ignore_paths += ["../libcloud/compute/drivers/outscale.py"] + + # Remove existing api docs directory if it exists so we start with a clean environment + apidocs_dir = os.path.abspath(os.path.join(BASE_DIR, "apidocs/")) + shutil.rmtree(apidocs_dir, ignore_errors=True) + + argv = [ + "--force", # Overwrite output files + "--follow-links", # Follow symbolic links + "--module-first", # Put module documentation before submodule + "--separate", + "--maxdepth", + "4", + "-o", + "apidocs", # Output path + "../libcloud", # include path + ] + ignore_paths + + apidoc.main(argv) + -autoclass_content = 'both' +def setup(app): + app.connect("builder-inited", run_apidoc) + app.connect("source-read", linkify_issues_in_changelog) + app.connect("source-read", add_orphan_tag_to_apidocs) diff --git a/docs/container/_supported_methods.rst b/docs/container/_supported_methods.rst new file mode 100644 index 0000000000..e95bcfa903 --- /dev/null +++ b/docs/container/_supported_methods.rst @@ -0,0 +1,19 @@ +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it + +=================================== ============= =========== ================ ============= =============== ============== ================= ================= =============== ============== ============== =============== ============= +Provider install image list images deploy container get container start container stop container restart container destroy container list containers list locations create cluster destroy cluster list clusters +=================================== ============= =========== ================ ============= =============== ============== ================= ================= =============== ============== ============== =============== ============= +`Docker`_ yes yes yes yes yes yes yes yes yes no no no no +`Amazon Elastic Container Service`_ no yes yes yes yes yes yes yes yes no yes yes yes +`Google Container Engine`_ no no yes yes no no no yes yes no no no yes +`Kubernetes`_ no no yes yes no no no yes yes no no no no +`LXD`_ yes yes yes yes yes yes yes yes yes no no no no +`Rancher`_ no no yes yes yes yes no yes yes no no no no +=================================== ============= =========== ================ ============= =============== ============== ================= ================= =============== ============== ============== =============== ============= + +.. _`Docker`: http://docker.io +.. _`Amazon Elastic Container Service`: https://aws.amazon.com/ecs/details/ +.. _`Google Container Engine`: https://container.googleapis.com +.. _`Kubernetes`: http://kubernetes.io +.. _`LXD`: https://linuxcontainers.org/ +.. _`Rancher`: http://rancher.com diff --git a/docs/container/_supported_providers.rst b/docs/container/_supported_providers.rst new file mode 100644 index 0000000000..9b3e6a24c1 --- /dev/null +++ b/docs/container/_supported_providers.rst @@ -0,0 +1,19 @@ +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it + +=================================== ============================================ ================= ==================== ============================================ ================================== +Provider Documentation Provider Constant Supported Regions Module Class Name +=================================== ============================================ ================= ==================== ============================================ ================================== +`Docker`_ :doc:`Click ` DOCKER single region driver :mod:`libcloud.container.drivers.docker` :class:`DockerContainerDriver` +`Amazon Elastic Container Service`_ :doc:`Click ` ECS single region driver :mod:`libcloud.container.drivers.ecs` :class:`ElasticContainerDriver` +`Google Container Engine`_ :doc:`Click ` GKE single region driver :mod:`libcloud.container.drivers.gke` :class:`GKEContainerDriver` +`Kubernetes`_ :doc:`Click ` KUBERNETES single region driver :mod:`libcloud.container.drivers.kubernetes` :class:`KubernetesContainerDriver` +`LXD`_ LXD single region driver :mod:`libcloud.container.drivers.lxd` :class:`LXDContainerDriver` +`Rancher`_ :doc:`Click ` RANCHER single region driver :mod:`libcloud.container.drivers.rancher` :class:`RancherContainerDriver` +=================================== ============================================ ================= ==================== ============================================ ================================== + +.. _`Docker`: http://docker.io +.. _`Amazon Elastic Container Service`: https://aws.amazon.com/ecs/details/ +.. _`Google Container Engine`: https://container.googleapis.com +.. _`Kubernetes`: http://kubernetes.io +.. _`LXD`: https://linuxcontainers.org/ +.. _`Rancher`: http://rancher.com diff --git a/docs/container/api.rst b/docs/container/api.rst new file mode 100644 index 0000000000..257b1a7fd0 --- /dev/null +++ b/docs/container/api.rst @@ -0,0 +1,19 @@ +:orphan: + +Container Base API +================== + +.. autoclass:: libcloud.container.base.ContainerDriver + :members: + +.. autoclass:: libcloud.container.base.Container + :members: + +.. autoclass:: libcloud.container.base.ContainerImage + :members: + +.. autoclass:: libcloud.container.base.ContainerCluster + :members: + +.. autoclass:: libcloud.container.base.ClusterLocation + :members: diff --git a/docs/container/drivers/docker.rst b/docs/container/drivers/docker.rst new file mode 100644 index 0000000000..0dc7922d9f --- /dev/null +++ b/docs/container/drivers/docker.rst @@ -0,0 +1,26 @@ +Docker Container Driver Documentation +===================================== + +`Docker`_ containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: +code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, +regardless of the environment it is running in. + +.. figure:: /_static/images/provider_logos/docker.png + :align: center + :width: 300 + :target: http://docker.io/ + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/container/docker/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.container.drivers.docker.DockerContainerDriver + :members: + :inherited-members: + +.. _`Docker`: https://docker.io/ diff --git a/docs/container/drivers/ecs.rst b/docs/container/drivers/ecs.rst new file mode 100644 index 0000000000..066ea56a64 --- /dev/null +++ b/docs/container/drivers/ecs.rst @@ -0,0 +1,58 @@ +Amazon Elastic Container Service Documentation +============================================== + +Elastic Container Service is a container-as-a-service feature of `AWS`_. + +.. figure:: /_static/images/provider_logos/aws.png + :align: center + :width: 300 + :target: http://aws.amazon.com/ + +To provide API key access, you should apply one of the roles: +* AmazonEC2ContainerServiceFullAccess +* AmazonEC2ContainerServiceReadOnlyAccess + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/container/ecs/instantiate_driver.py + :language: python + +Deploying a container +--------------------- + +.. literalinclude:: /examples/container/ecs/deploy_container.py + :language: python + +Deploying a container from Docker Hub +------------------------------------- + +Docker Hub Client :class:`~libcloud.container.utils.docker.HubClient` is a shared utility class for interfacing to the public Docker Hub Service. + +You can use this class for fetching images to deploy to services like ECS + +.. literalinclude:: /examples/container/docker_hub.py + :language: python + +Deploying a container from Amazon Elastic Container Registry (ECR) +------------------------------------------------------------------ + +Amazon ECR is a combination of the Docker Registry V2 API and a proprietary API. The ECS driver includes methods for talking to both APIs. + +Docker Registry API Client :class:`~libcloud.container.utils.docker.RegistryClient` is a shared utility class for interfacing to the public Docker Hub Service. + +You can use a factory method to generate an instance of RegsitryClient from the ECS driver. This will request a 12 hour token from the Amazon API and instantiate a :class:`~libcloud.container.utils.docker.RegistryClient` +object with those credentials. + +.. literalinclude:: /examples/container/ecs/container_registry.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.container.drivers.ecs.ElasticContainerDriver + :members: + :inherited-members: + + +.. _`AWS`: https://aws.amazon.com/ diff --git a/docs/container/drivers/gke.rst b/docs/container/drivers/gke.rst new file mode 100644 index 0000000000..61c0d6b2e9 --- /dev/null +++ b/docs/container/drivers/gke.rst @@ -0,0 +1,28 @@ +Google Container Driver Documentation +============================================ + +`Google Container Platform`_ is a Kubernetes hosting service, provided by Google. +Docker-native tools and elastic hosts make deploying on Google Cloud as easy as running Docker on your laptop. +There is no special software to install or configure. +Mix Kubernetes containers with container-native Linux to extend the benefits of containerization to legacy applications and stateful services. + +Examples +-------- + +Additional example code can be found in the "demos" directory of Libcloud here: +https://github.com/apache/libcloud/blob/trunk/demos/gce_demo.py + +1. Getting Driver with Service Account authentication +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/compute/gce/gce_service_account.py + + +API Docs +-------- + +.. autoclass:: libcloud.container.drivers.gke.GKEContainerDriver + :members: + :inherited-members: + +.. _`Google Container Platform`: https://cloud.google.com/container-engine/ diff --git a/docs/container/drivers/index.rst b/docs/container/drivers/index.rst new file mode 100644 index 0000000000..1a25d2887a --- /dev/null +++ b/docs/container/drivers/index.rst @@ -0,0 +1,12 @@ +:orphan: + +Container Drivers Documentation +=============================== + +This chapter includes links to driver (provider) specific documentation pages. + +.. toctree:: + :glob: + :maxdepth: 1 + + * diff --git a/docs/container/drivers/kubernetes.rst b/docs/container/drivers/kubernetes.rst new file mode 100644 index 0000000000..d5e7d8f09f --- /dev/null +++ b/docs/container/drivers/kubernetes.rst @@ -0,0 +1,80 @@ +Kubernetes Documentation +======================== + +.. note:: + + This Kubernetes driver will be subject to change from community feedback. How to map the core assets (pods, clusters) to API + entities will be subject to testing and further community feedback. + +Kubernetes is an open source orchestration system for Docker containers. It handles scheduling onto nodes in a compute cluster and actively manages workloads to ensure that their state matches the users declared intentions. Using the concepts of "labels" and "pods", +it groups the containers which make up an application into logical units for easy management and discovery. + +.. figure:: /_static/images/provider_logos/kubernetes.png + :align: center + :width: 300 + :target: http://kubernetes.io/ + +Authentication +-------------- + +Authentication currently supported with the following methods: + +* Client certificate auth (recommended) - https://kubernetes.io/docs/reference/access-authn-authz/authentication/#x509-client-certs +* Bearer token auth - https://kubernetes.io/docs/reference/access-authn-authz/authentication/#static-token-file +* Basic HTTP Authentication (deprecated) - https://kubernetes.io/docs/reference/access-authn-authz/authentication/#static-password-file +* No authentication (testing only) + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/container/kubernetes/instantiate_driver.py + :language: python + +Instantiating the driver (minikube installation - cert file auth) +----------------------------------------------------------------- + +This example shows how to connect to a local minikube Kubernetes cluster +which utilizes certifcate based authentication. + +.. literalinclude:: /examples/container/kubernetes/instantiate_driver_minikube_cert_auth.py + :language: python + +Instantiating the driver (minikube installation - basic auth) +------------------------------------------------------------- + +This example shows how to connect to a local minikube Kubernetes cluster +which utilizes basic auth authentication. + +When using basic auth, you need to start the minikube as shown below. + +.. sourcecode:: bash + + $ cat users.csv + pass123,user1,developers + +.. sourcecode:: python + + # Mount a share with a local users file + minikube mount /home/libcloud/users.csv:/var/lib/docker/users.csv + + # Start miniube + minikube --extra-config=apiserver.basic-auth-file=/var/lib/docker/users.csv start + +.. literalinclude:: /examples/container/kubernetes/instantiate_driver_minikube_basic_auth.py + :language: python + +------------------------------------- + +Docker Hub Client :class:`~libcloud.container.utils.docker.HubClient` is a shared utility class for interfacing to the public Docker Hub Service. + +You can use this class for fetching images to deploy to services like ECS + +.. literalinclude:: /examples/container/kubernetes/docker_hub.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.container.drivers.kubernetes.KubernetesContainerDriver + :members: + :inherited-members: diff --git a/docs/container/drivers/rancher.rst b/docs/container/drivers/rancher.rst new file mode 100644 index 0000000000..293c74faf6 --- /dev/null +++ b/docs/container/drivers/rancher.rst @@ -0,0 +1,72 @@ +Rancher Container Service Documentation +======================================= + +Rancher is a container orchestration platform. + +.. figure:: /_static/images/provider_logos/rancher.png + :align: center + :width: 300 + :target: http://rancher.com/ + +This driver supports the main top-level interactions for handling containers, +services, and stacks in a Rancher Environment. + +Here are some notes around this driver: + +- Does not support user based API credentials, only Environment API + credentials (one env, no cluster support) +- Does not support images other than docker formatted images. ``docker:`` + prefix is forced! +- Images follow a standardized format. See deploy_container docstring! +- ``launchConfig`` options for ``ex_deploy_service`` can all be defined at the + top level then get slipstreamed appropriately. +- Passing your own cert/key of any sort for SSL/TLS is not presently supported. + +To enable API access, obtain an Environment API Key from your Rancher Server +for the specific environment you want to control. + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/container/rancher/instantiate_driver.py + :language: python + +Deploying a container +--------------------- + +.. literalinclude:: /examples/container/rancher/deploy_container.py + :language: python + +Deploying a service +------------------- + +.. literalinclude:: /examples/container/rancher/deploy_service.py + :language: python + +Deploying a stack +----------------- + +.. literalinclude:: /examples/container/rancher/deploy_stack.py + :language: python + +Searching for a container +------------------------- + +.. literalinclude:: /examples/container/rancher/search_containers.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.container.drivers.rancher.RancherContainerDriver + :members: + :inherited-members: + +Contributors +------------ + +For the first version of this driver, Mario Loria of Arroyo Networks wrote most +of the code. He received help from Anthony Shaw, a core libcloud contributor +and Vincent Fiduccia, software architect at Rancher Labs. + +.. _`Rancher`: https://rancher.com/ diff --git a/docs/container/examples.rst b/docs/container/examples.rst new file mode 100644 index 0000000000..00020ae4cd --- /dev/null +++ b/docs/container/examples.rst @@ -0,0 +1,33 @@ +:orphan: + +Container Examples +================== + +Installing a container image and deploying it +--------------------------------------------- + +This example shows how to get install a container image, deploy and start that container. + +.. note:: + This example works with Libcloud version 0.21.0 and above. + +.. literalinclude:: /examples/container/install_and_deploy.py + :language: python + +Working with cluster supported providers +---------------------------------------- + +This example shows listing the clusters, find a specific named cluster and deploying a container to it. + +.. literalinclude:: /examples/container/working_with_clusters.py + :language: python + +Working with docker hub +----------------------- + +Docker Hub Client :class:`~libcloud.container.utils.docker.HubClient` is a shared utility class for interfacing to the public Docker Hub Service. + +You can use this class for fetching images to deploy to services like ECS + +.. literalinclude:: /examples/container/docker_hub.py + :language: python diff --git a/docs/container/index.rst b/docs/container/index.rst new file mode 100644 index 0000000000..7a9fde8d89 --- /dev/null +++ b/docs/container/index.rst @@ -0,0 +1,83 @@ +Container +========= + +.. note:: + + Container API is available in Libcloud 1.0.0-pre1 and higher. + +.. note:: + + Container API is currently in an EXPERIMENTAL state. + +Container API allows users to install and deploy containers onto container based virtualization platforms. This is designed to target both +on-premise installations of software like Docker as well as interfacing with Cloud Service Providers that offer Container-as-a-Service APIs. + +For a working example of the container driver with cluster support, see the example for Amazon's Elastic Container Service: + +.. literalinclude:: /examples/container/ecs/deploy_container.py + :language: python + +For an example of the simple container support, see the Docker example: + +.. literalinclude:: /examples/container/docker/deploy_container.py + :language: python + +Drivers +------- +Container-as-a-Service providers will implement the `ContainerDriver` class to provide functionality for : + +* Listing deployed containers +* Starting, stopping and restarting containers (where supported) +* Destroying containers +* Creating/deploying containers +* Listing container images +* Installing container images (pulling an image from a local copy or remote repository) + +Driver base API documentation is found here: + +* :class:`~libcloud.container.base.ContainerDriver` - A driver for interfacing to a container provider + + +Simple Container Support +------------------------ + +* :class:`~libcloud.container.base.ContainerImage` - Represents an image that can be deployed, like an application or an operating system +* :class:`~libcloud.container.base.Container` - Represents a deployed container image running on a container host + +Cluster Suppport +---------------- + +Cluster support extends on the basic driver functions, but where drivers implement the class-level attribute `supports_clusters` as True +clusters may be listed, created and destroyed. When containers are deployed, the target cluster can be specified. + +* :class:`~libcloud.container.base.ContainerCluster` - Represents a deployed container image running on a container host +* :class:`~libcloud.container.base.ClusterLocation` - Represents a location for clusters to be deployed + +Bootstrapping Docker with Compute Drivers +----------------------------------------- + +The compute and container drivers can be combined using the :doc:`deployment ` feature of the compute driver to bootstrap an installation of a container virtualization provider like Docker. +Then using the Container driver, you can connect to that API and install images and deploy containers. + +Supported Providers +------------------- + +For a list of supported providers see :doc:`supported providers page +`. + +Examples +-------- + +We have :doc:`examples of several common patterns `. + +API Reference +------------- + +For a full reference of all the classes and methods exposed by the Container +API, see :doc:`this page `. + +Utility Classes +--------------- + +There are some utility classes for example, a Docker Hub API client for fetching images +and iterating through repositories see :doc:`this page `. diff --git a/docs/container/supported_providers.rst b/docs/container/supported_providers.rst new file mode 100644 index 0000000000..e34e5eba21 --- /dev/null +++ b/docs/container/supported_providers.rst @@ -0,0 +1,14 @@ +:orphan: + +Supported Providers +=================== + +Provider Matrix +--------------- + +.. include:: _supported_providers.rst + +Supported Methods +----------------- + +.. include:: _supported_methods.rst diff --git a/docs/container/utilities.rst b/docs/container/utilities.rst new file mode 100644 index 0000000000..2afdceb921 --- /dev/null +++ b/docs/container/utilities.rst @@ -0,0 +1,10 @@ +:orphan: + +Container Utility API +===================== + +.. autoclass:: libcloud.container.utils.docker.RegistryClient + :members: + +.. autoclass:: libcloud.container.utils.docker.HubClient + :members: diff --git a/docs/copyright.rst b/docs/copyright.rst new file mode 100644 index 0000000000..e77485b4d5 --- /dev/null +++ b/docs/copyright.rst @@ -0,0 +1,10 @@ +:orphan: + +Copyright +========= + +Copyright © 2009 - 2023 `The Apache Software Foundation. `_ + +Apache Libcloud, Libcloud, Apache, the Apache feather, and the Apache Libcloud +project logo are trademarks of the Apache Software Foundation. All other marks +mentioned may be trademarks or registered trademarks of their respective owners. diff --git a/docs/developer_information.rst b/docs/developer_information.rst index 045a10d8b8..ee5e2c9140 100644 --- a/docs/developer_information.rst +++ b/docs/developer_information.rst @@ -1,6 +1,53 @@ Developer Information ===================== +Type Annotations +---------------- + +Python type annotations / hints for the base Libcloud compute API have been +added in v2.8.0. + +The goal behind type annotations is to make developer lives easier by +introducing optional static typing for Python programs. + +This allows you to catch bugs and issues which are related to variable types +earlier and faster (aka when you run ``mypy`` locally either manually or +integrated in your editor / IDE and also as part of you CI/CD build +pipeline). + +An example of how to use type annotations correctly is shown below. + +.. literalinclude:: /examples/compute/example_compute.py + +If you reference an invalid object attribute or a method, you would +see an error similar to the one beloe when running mypy: + +.. sourcecode:: python + + ... + print(nodes[0].name) + print(nodes[0].invalid) + print(nodes[0].rebbot()) + print(nodes[0].reboot(foo='invalid')) + ... + +.. sourcecode:: bash + + $ mypy --no-incremental example_compute.py + example_compute.py:41: error: "Node" has no attribute "invalid" + example_compute.py:42: error: "Node" has no attribute "rebbot"; maybe "reboot"? + example_compute.py:43: error: Unexpected keyword argument "foo" for "reboot" of "Node" + +If you are using driver methods which are not part of the Libcloud standard +API, you need to use ``cast()`` method as shown below to cast the driver class +to the correct type. If you don't do that, ``mypy`` will only be aware of the +methods which are part of the Libcloud base compute API (aka +``BaseNodeDriver`` class). + +This is needed because of how Libcloud utilizes meta programming for the +``get_driver()`` and related methods (there is no other way without writing +a mypy plugin to achieve that). + .. _mailing-lists: Mailing Lists @@ -32,15 +79,15 @@ Archive of old incubator mailing lists: IRC --- -* #libcloud on Freenode +* #libcloud on Libera.chat (https://libera.chat) .. _issue-tracker: Issue Tracker ------------- -For bug and issue tracking we use JIRA located at -https://issues.apache.org/jira/browse/LIBCLOUD. +For bug and issue tracking we use Github issues located at +https://github.com/apache/libcloud/issues. Testing ------- @@ -48,23 +95,29 @@ Testing For information how to run the tests and how to generate the test coverage report, please see the :doc:`Testing page `. +.. _ci-cd: + Continuous Integration ---------------------- -For continuous integration we use Apache buildbot instance and Travis-CI. You -can find build reports on the following two links: +For continuous integration we use Travis-CI. You can find build reports on the +following links: -* https://ci.apache.org/waterfall?builder=libcloud-trunk-tox&builder=libcloud-site-staging * https://travis-ci.org/apache/libcloud Travis-CI builder is also integrated with Github which means that if you open a pull request there, Travis-CI will automatically build it. +If you want to validate the build before raising the PR, Travis-CI can be enabled for personal +accounts and branches separately. + +.. _code-coverage: + Test Coverage ------------- Test coverage report is automatically generated after every push and can be -found at http://ci.apache.org/projects/libcloud/coverage. +found at https://codecov.io/github/apache/libcloud?branch=trunk. .. _`announce@libcloud.apache.org`: mailto:announce-subscribe@libcloud.apache.org .. _`users@libcloud.apache.org`: mailto:users-subscribe@libcloud.apache.org diff --git a/docs/development.rst b/docs/development.rst index 09cfe2b13f..5c304c5c45 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -17,6 +17,50 @@ assist you. Getting started with contributing to Libcloud --------------------------------------------- +We use ``uv`` to lock and manage development dependencies. Dependency groups are +defined under ``[dependency-groups]`` in ``pyproject.toml`` and ``uv.lock`` is +the source of truth for local development and documentation tooling. + +To create or update the lockfile, run: + +.. sourcecode:: bash + + uv lock + +If ``uv lock`` fails while building ``libvirt-python``, install the system +dependencies (``pkg-config`` and ``libvirt-dev``). + +To set up a local development environment with common tooling (tests, linting, +type checking, tox): + +.. sourcecode:: bash + + uv sync --group dev + +If you only need a subset, sync just those groups (for example, tests only): + +.. sourcecode:: bash + + uv sync --group test --no-dev + +If you also work on documentation, add the docs group: + +.. sourcecode:: bash + + uv sync --group dev --group docs + +Commit ``uv.lock`` whenever dependency versions change. + +Build the HTML documentation with ``uv run tox -e docs``. To also validate the +PDF and EPUB formats published on Read the Docs, run ``uv run tox -e docs-formats``. +PDF builds require ``make``, ``latexmk``, ``xindy``, the recommended and extra +LaTeX packages, and the recommended and TeX Gyre fonts. On Ubuntu, install these with: + +.. sourcecode:: bash + + sudo apt-get install make latexmk xindy texlive-latex-recommended \ + texlive-latex-extra texlive-fonts-recommended tex-gyre + General contribution guidelines ------------------------------- @@ -24,21 +68,26 @@ General contribution guidelines :doc:`Testing page `. * All the functions and methods must contain Sphinx docstrings which are used to generate the API documentation. For more information, refer to the - :ref:`Docstring conventions ` section bellow. + :ref:`Docstring conventions ` section below. * If you are adding a new feature, make sure to add a corresponding documentation. Code style guide ---------------- -* We follow `PEP8 Python Style Guide`_ +* We follow `The Black code style`_ and automatically enforce it for all the + new code using black tool. You can re-format your code using black by + running ``black`` tox target (``tox -eblack``). +* We enforce consistent import ordering using the isort library. Imports can be + automatically re-ordered / sorted by using ``isort`` tox target (``tox -e + isort``). * Use 4 spaces for a tab -* Use 79 characters in a line +* Use 100 characters in a line * Make sure edited file doesn't contain any trailing whitespace -* You can verify that your modifications don't break any rules by running the - ``flake8`` script - e.g. ``flake8 libcloud/edited_file.py`` or - ``tox -e lint``. - Second command will run flake8 on all the files in the repository. +* Make sure new code contains type annotations +* You can verify that your changes don't break any rules by running the + following tox targets - ``lint,pylint,black`` - ``tox + -elint,pylint,black,isort``. And most importantly, follow the existing style in the file you are editing and **be consistent**. @@ -46,20 +95,20 @@ And most importantly, follow the existing style in the file you are editing and Git pre-commit hook ------------------- -To make complying with our style guide easier, we provide a git pre-commit hook -which automatically checks modified Python files for violations of our style -guide. - -You can install it by running following command in the root of the repository -checkout: +We use `pre-commit` configuration with `prek` to run formatting and linting +hooks before commits. Install the tooling (including ``prek``) and register the +git hook from the repository root: .. sourcecode:: bash - ln -s contrib/pre-commit.sh .git/hooks/pre-commit + uv sync --extra lint + uv run prek install -After you have installed this hook it will automatically check modified Python -files for violations before a commit. If a violation is found, commit will be -aborted. +To run all hooks on all files: + +.. sourcecode:: bash + + uv run prek run -a .. _code-conventions: @@ -138,10 +187,10 @@ For example: def list_nodes(self): pass - def list_images(self): + def list_images(self, location=None): pass - def create_node(self): + def create_node(self, name, size, image, location=None, auth=None): pass def reboot_node(self): @@ -227,7 +276,7 @@ contains. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When checking if a variable is provided or defined, prefer to use -``is foo is not None`` instead of ``if foo``. +``if foo is not None`` instead of ``if foo``. If you use ``if foo`` approach, it's easy to make a mistake when a valid value can also be falsy (e.g. a number ``0``). @@ -249,7 +298,7 @@ Docstring conventions --------------------- For documenting the API we we use Sphinx and reStructuredText syntax. Docstring -conventions to which you should adhere to are described bellow. +conventions to which you should adhere to are described below. * Docstrings should always be used to describe the purpose of methods, functions, classes, and modules. @@ -279,13 +328,57 @@ For more information and examples, please refer to the following links: * Sphinx Documentation - http://sphinx-doc.org/markup/desc.html#info-field-lists * Example Libcloud module with documentation - https://github.com/apache/libcloud/blob/trunk/libcloud/compute/base.py +Updating compute node sizing data +--------------------------------- + +Node sizing data for most providers is stored in-line as a module level +constant in the corresponding provide module. + +An exception to that is AWS EC2 which sizing data is automatically generated +and scraped from AWS API as documented below. + +Updating EC2 sizing and supported regions data +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To update EC2 sizing data, you just need to run ``scrape-ec2-sizes`` tox target +and commit the changed files +(``libcloud/compute/constants/ec2_instance_types.py``, +``libcloud/compute/constants/ec2_region_details_complete.py``). + +To add a new region update ``contrib/scrape-ec2-prices.py`` and +``contrib/scrape-ec2-sizes.py`` file (example +https://github.com/apache/libcloud/commit/762f0e5623b6f9837204ffe27d825b236c9c9970) +and then re-run corresponding tox targets as shown below: + +.. sourcecode:: bash + + tox -escrape-ec2-sizes,scrape-ec2-prices + +Updating compute node pricing data +---------------------------------- + +Pricing data for some provides is automatically scraped using +``scrape-and-publish-provider-prices`` tox target (this target required valid +AWS and Google Cloud API keys to be set for it to work). + +This tox target is ran before making a new release which means that each +release includes pricing data which has been updated on the day of the release. + +In addition to that, that tox target runs daily as part of our CI/CD system +and the latest version of that file is published to a public read-only S3 +bucket. + +For more information on how to utilize that pricing data, please see +:doc:`Pricing ` page. + Contribution workflow --------------------- -1. Start a discussion on the mailing list -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +1. Start a discussion on our Github repository or on the mailing list +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you are implementing a big feature or a change, start a discussion on the +:ref:`issue tracker ` or the :ref:`mailing list ` first. 2. Open a new issue on our issue tracker @@ -307,7 +400,7 @@ For example: .. sourcecode:: bash - git checkout -b _ + git checkout -b 5. Make your changes ~~~~~~~~~~~~~~~~~~~~ @@ -318,20 +411,22 @@ For example: Make sure that all the code you have added or modified has appropriate test coverage. Also make sure all the tests including the existing ones still pass. +Use ``libcloud.test.unittest`` as the unit testing package to ensure that +your tests work with older versions of Python. + For more information on how to write and run tests, please see :doc:`Testing page `. 7. Commit your changes ~~~~~~~~~~~~~~~~~~~~~~ -Make a single commit for your changes. If a corresponding JIRA ticket exists, -make sure the commit message contains the ticket number. +Commit your changes. For example: .. sourcecode:: bash - git commit -a -m "[LIBCLOUD-123] Add a new compute driver for CloudStack based providers." + git commit -m "Add a new compute driver for CloudStack based providers." 8. Open a pull request with your changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -339,106 +434,11 @@ For example: Go to https://github.com/apache/libcloud/ and open a new pull request with your changes. Your pull request will appear at https://github.com/apache/libcloud/pulls. -Make sure the pull request name is prefixed with a JIRA ticket number, e.g. -``[LIBCLOUD-436] Improvements to DigitalOcean compute driver`` and that the -pull request description contains link to the JIRA ticket. - 9. Wait for the review ~~~~~~~~~~~~~~~~~~~~~~ Wait for your changes to be reviewed and address any outstanding comments. -10. Squash the commits and generate the patch -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Once the changes has been reviewed, all the outstanding issues have been -addressed and the pull request has been +1'ed, close the pull request, squash -the commits (if necessary) and generate a patch. - -.. sourcecode:: bash - - git format-patch --stdout trunk > patch_name.patch - -Make sure to use ``git format-patch`` and not ``git diff`` so we can preserve -the commit authorship. - -Note #1: Before you generate the patch and squash the commits, make sure to -synchronize your branch with the latest trunk (run ``git pull upstream trunk`` -in your branch), otherwise we might have problems applying it cleanly. - -Note #2: If you have never used rebase and squashed the commits before, you can -find instructions on how to do that in the following guide: -`squashing commits with rebase`_. - -11. Attach a final patch with your changes to the corresponding JIRA ticket -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Attach the generated patch to the JIRA issue you have created earlier. - -Note about Github -~~~~~~~~~~~~~~~~~ - -Github repository is a read-only mirror of the official Apache git repository -(``https://git-wip-us.apache.org/repos/asf/libcloud.git``). This mirror script -runs only a couple of times per day which means this mirror can be slightly out -of date. - -You are advised to add a separate remote for the official upstream repository: - -.. sourcecode:: bash - - git remote add upstream https://git-wip-us.apache.org/repos/asf/libcloud.git - -Github read-only mirror is used only for pull requests and code review. Once a -pull request has been reviewed, all the comments have been addresses and it's -ready to be merged, user who submitted the pull request must close the pull -request, create a patch and attach it to the original JIRA ticket. - -Syncing your git(hub) repository with an official upstream git repository -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This section describes how to synchronize your git clone / Github fork with -an official upstream repository. - -It's important that your repository is in-sync with the upstream one when you -start working on a new branch and before you generate a final patch. If the -repository is not in-sync, generated patch will be out of sync and we won't be -able to cleanly merge it into trunk. - -To synchronize it, follow the steps bellow in your git clone: - -1. Add upstream remote if you haven't added it yet - -.. sourcecode:: bash - - git remote add upstream https://git-wip-us.apache.org/repos/asf/libcloud.git - -2. Synchronize your ``trunk`` branch with an upstream one - -.. sourcecode:: bash - - git checkout trunk - git pull upstream trunk - -3. Create a branch for your changes and start working on it - -.. sourcecode:: bash - - git checkout -b my_new_branch - -4. Before generating a final patch which is to be attached to the JIRA ticket, - make sure your repository and branch is still in-sync - -.. sourcecode:: bash - - git pull upstream trunk - -5. Generate a patch which can be attached to the JIRA ticket - -.. sourcecode:: bash - - git format-patch --stdout remotes/upstream/trunk > patch_name.patch - Contributing Bigger Changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -459,31 +459,14 @@ Libcloud supports a variety of Python versions so your code also needs to work with all the supported versions. This means that in some cases you will need to include extra code to make sure it works in all the supported versions. -Some examples which show how to handle those cases are described bellow. +Some examples which show how to handle those cases are described below. -Context Managers +Type annotation for unions ~~~~~~~~~~~~~~~~ -Context managers aren't available in Python 2.5 by default. If you want to use -them make sure to put from ``__future__ import with_statement`` on top of the -file where you use them. - -Exception Handling -~~~~~~~~~~~~~~~~~~ - -There is no unified way to handle exceptions and extract the exception object -in Python 2.5 and Python 3.x. This means you need to use a -``sys.exc_info()[1]`` approach to extract the raised exception object. - -For example: - -.. sourcecode:: python - - try: - some code - except Exception: - e = sys.exc_info()[1] - print e +In Python 3.9 and below, the pipe character (``|``) cannot be used for union +types in type annotations. Instead, you should use ``Union`` from the ``typing`` +module: Utility functions for cross-version compatibility ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -496,8 +479,9 @@ code work with multiple versions on the following link - `Lessons learned while porting Libcloud to Python 3`_ .. _`PEP8 Python Style Guide`: http://www.python.org/dev/peps/pep-0008/ -.. _`Issue tracker`: https://issues.apache.org/jira/browse/LIBCLOUD +.. _`Issue tracker`: https://github.com/apache/libcloud/issues .. _`Github git repository`: https://github.com/apache/libcloud .. _`Apache website`: https://www.apache.org/licenses/#clas .. _`Lessons learned while porting Libcloud to Python 3`: http://www.tomaz.me/2011/12/03/lessons-learned-while-porting-libcloud-to-python-3.html .. _`squashing commits with rebase`: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html +.. _`The Black code style`: https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html diff --git a/docs/dns/_supported_methods.rst b/docs/dns/_supported_methods.rst index 507999a161..168a30fdfb 100644 --- a/docs/dns/_supported_methods.rst +++ b/docs/dns/_supported_methods.rst @@ -1,25 +1,57 @@ -===================== ========== ============ =========== =========== ============= ============= =========== ============= -Provider list zones list records create zone update zone create record update record delete zone delete record -===================== ========== ============ =========== =========== ============= ============= =========== ============= -`Gandi DNS`_ yes yes yes yes yes yes yes yes -`Google DNS`_ yes yes yes no yes no yes yes -`Host Virtual DNS`_ yes yes yes yes yes yes yes yes -`Linode DNS`_ yes yes yes yes yes yes yes yes -`Rackspace DNS`_ yes yes yes yes yes yes yes yes -`Rackspace DNS (UK)`_ yes yes yes yes yes yes yes yes -`Rackspace DNS (US)`_ yes yes yes yes yes yes yes yes -`Route53 DNS`_ yes yes yes no yes yes yes yes -`Softlayer DNS`_ yes yes yes no yes yes yes yes -`Zerigo DNS`_ yes yes yes yes yes yes yes yes -===================== ========== ============ =========== =========== ============= ============= =========== ============= +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it +================= ========== ============ =========== =========== ============= ============= =========== ============= +Provider list zones list records create zone update zone create record update record delete zone delete record +================= ========== ============ =========== =========== ============= ============= =========== ============= +`AuroraDNS`_ yes yes yes no yes yes yes yes +`BuddyNS DNS`_ yes no yes no no no yes no +`CloudFlare DNS`_ yes yes yes yes yes yes yes yes +`DigitalOcean`_ yes yes yes no yes yes yes yes +`DNSimple`_ yes yes yes no yes yes yes yes +`DurableDNS`_ yes yes yes yes yes yes yes yes +`Gandi DNS`_ yes yes yes yes yes yes yes yes +`Gandi LiveDNS`_ yes yes yes no yes yes no yes +`GoDaddy DNS`_ yes yes no no yes yes yes no +`Google DNS`_ yes yes yes no yes no yes yes +`Linode DNS`_ yes yes yes yes yes yes yes yes +`Liquidweb DNS`_ yes yes yes no yes yes yes yes +`Luadns`_ yes yes yes no yes no yes yes +`NFSN DNS`_ no yes no no yes no no yes +`NS1 DNS`_ yes yes yes no yes yes yes yes +`OnApp`_ yes yes yes no yes yes yes yes +`Point DNS`_ yes yes yes yes yes yes yes yes +`PowerDNS`_ yes yes yes no yes yes yes yes +`Rackspace DNS`_ yes yes yes yes yes yes yes yes +`RcodeZero DNS`_ yes yes yes yes yes yes yes yes +`Route53 DNS`_ yes yes yes no yes yes yes yes +`Vultr DNS`_ yes yes yes no yes yes yes yes +`World Wide DNS`_ yes yes yes yes yes yes yes yes +`Zerigo DNS`_ yes yes yes yes yes yes yes yes +`Zonomi DNS`_ yes yes yes no yes no yes yes +================= ========== ============ =========== =========== ============= ============= =========== ============= + +.. _`AuroraDNS`: https://www.pcextreme.nl/en/aurora/dns +.. _`BuddyNS DNS`: https://www.buddyns.com +.. _`CloudFlare DNS`: https://www.cloudflare.com +.. _`DigitalOcean`: https://www.digitalocean.com +.. _`DNSimple`: https://dnsimple.com/ +.. _`DurableDNS`: https://durabledns.com .. _`Gandi DNS`: http://www.gandi.net/domain +.. _`Gandi LiveDNS`: http://www.gandi.net/domain +.. _`GoDaddy DNS`: https://www.godaddy.com/ .. _`Google DNS`: https://cloud.google.com/ -.. _`Host Virtual DNS`: https://www.hostvirtual.com/ .. _`Linode DNS`: http://www.linode.com/ +.. _`Liquidweb DNS`: https://www.liquidweb.com +.. _`Luadns`: https://www.luadns.com +.. _`NFSN DNS`: https://www.nearlyfreespeech.net +.. _`NS1 DNS`: https://ns1.com +.. _`OnApp`: http://onapp.com/ +.. _`Point DNS`: https://pointhq.com/ +.. _`PowerDNS`: https://www.powerdns.com/ .. _`Rackspace DNS`: http://www.rackspace.com/ -.. _`Rackspace DNS (UK)`: http://www.rackspace.com/ -.. _`Rackspace DNS (US)`: http://www.rackspace.com/ +.. _`RcodeZero DNS`: https://www.rcodezero.at/ .. _`Route53 DNS`: http://aws.amazon.com/route53/ -.. _`Softlayer DNS`: https://www.softlayer.com +.. _`Vultr DNS`: https://www.vultr.com +.. _`World Wide DNS`: https://www.worldwidedns.net/ .. _`Zerigo DNS`: http://www.zerigo.com/ +.. _`Zonomi DNS`: https://zonomi.com diff --git a/docs/dns/_supported_providers.rst b/docs/dns/_supported_providers.rst index 0665a3378f..39da462b90 100644 --- a/docs/dns/_supported_providers.rst +++ b/docs/dns/_supported_providers.rst @@ -1,25 +1,57 @@ -===================== ======================================= ================= ======================================= ============================= -Provider Documentation Provider constant Module Class Name -===================== ======================================= ================= ======================================= ============================= -`Gandi DNS`_ GANDI :mod:`libcloud.dns.drivers.gandi` :class:`GandiDNSDriver` -`Google DNS`_ GOOGLE :mod:`libcloud.dns.drivers.google` :class:`GoogleDNSDriver` -`Host Virtual DNS`_ :doc:`Click ` HOSTVIRTUAL :mod:`libcloud.dns.drivers.hostvirtual` :class:`HostVirtualDNSDriver` -`Linode DNS`_ LINODE :mod:`libcloud.dns.drivers.linode` :class:`LinodeDNSDriver` -`Rackspace DNS`_ RACKSPACE :mod:`libcloud.dns.drivers.rackspace` :class:`RackspaceDNSDriver` -`Rackspace DNS (UK)`_ RACKSPACE_UK :mod:`libcloud.dns.drivers.rackspace` :class:`RackspaceUKDNSDriver` -`Rackspace DNS (US)`_ RACKSPACE_US :mod:`libcloud.dns.drivers.rackspace` :class:`RackspaceUSDNSDriver` -`Route53 DNS`_ ROUTE53 :mod:`libcloud.dns.drivers.route53` :class:`Route53DNSDriver` -`Softlayer DNS`_ SOFTLAYER :mod:`libcloud.dns.drivers.softlayer` :class:`SoftLayerDNSDriver` -`Zerigo DNS`_ ZERIGO :mod:`libcloud.dns.drivers.zerigo` :class:`ZerigoDNSDriver` -===================== ======================================= ================= ======================================= ============================= +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it +================= ========================================= ================= ==================== ======================================== ============================== +Provider Documentation Provider Constant Supported Regions Module Class Name +================= ========================================= ================= ==================== ======================================== ============================== +`AuroraDNS`_ :doc:`Click ` AURORADNS single region driver :mod:`libcloud.dns.drivers.auroradns` :class:`AuroraDNSDriver` +`BuddyNS DNS`_ :doc:`Click ` BUDDYNS single region driver :mod:`libcloud.dns.drivers.buddyns` :class:`BuddyNSDNSDriver` +`CloudFlare DNS`_ :doc:`Click ` CLOUDFLARE single region driver :mod:`libcloud.dns.drivers.cloudflare` :class:`CloudFlareDNSDriver` +`DigitalOcean`_ :doc:`Click ` DIGITAL_OCEAN single region driver :mod:`libcloud.dns.drivers.digitalocean` :class:`DigitalOceanDNSDriver` +`DNSimple`_ :doc:`Click ` DNSIMPLE single region driver :mod:`libcloud.dns.drivers.dnsimple` :class:`DNSimpleDNSDriver` +`DurableDNS`_ :doc:`Click ` DURABLEDNS single region driver :mod:`libcloud.dns.drivers.durabledns` :class:`DurableDNSDriver` +`Gandi DNS`_ GANDI single region driver :mod:`libcloud.dns.drivers.gandi` :class:`GandiDNSDriver` +`Gandi LiveDNS`_ GANDI_LIVE single region driver :mod:`libcloud.dns.drivers.gandi_live` :class:`GandiLiveDNSDriver` +`GoDaddy DNS`_ :doc:`Click ` GODADDY single region driver :mod:`libcloud.dns.drivers.godaddy` :class:`GoDaddyDNSDriver` +`Google DNS`_ :doc:`Click ` GOOGLE single region driver :mod:`libcloud.dns.drivers.google` :class:`GoogleDNSDriver` +`Linode DNS`_ LINODE single region driver :mod:`libcloud.dns.drivers.linode` :class:`LinodeDNSDriver` +`Liquidweb DNS`_ :doc:`Click ` LIQUIDWEB single region driver :mod:`libcloud.dns.drivers.liquidweb` :class:`LiquidWebDNSDriver` +`Luadns`_ :doc:`Click ` LUADNS single region driver :mod:`libcloud.dns.drivers.luadns` :class:`LuadnsDNSDriver` +`NFSN DNS`_ :doc:`Click ` NFSN single region driver :mod:`libcloud.dns.drivers.nfsn` :class:`NFSNDNSDriver` +`NS1 DNS`_ NSONE single region driver :mod:`libcloud.dns.drivers.nsone` :class:`NsOneDNSDriver` +`OnApp`_ :doc:`Click ` ONAPP single region driver :mod:`libcloud.dns.drivers.onapp` :class:`OnAppDNSDriver` +`Point DNS`_ :doc:`Click ` POINTDNS single region driver :mod:`libcloud.dns.drivers.pointdns` :class:`PointDNSDriver` +`PowerDNS`_ :doc:`Click ` POWERDNS single region driver :mod:`libcloud.dns.drivers.powerdns` :class:`PowerDNSDriver` +`Rackspace DNS`_ RACKSPACE uk, us :mod:`libcloud.dns.drivers.rackspace` :class:`RackspaceDNSDriver` +`RcodeZero DNS`_ :doc:`Click ` RCODEZERO single region driver :mod:`libcloud.dns.drivers.rcodezero` :class:`RcodeZeroDNSDriver` +`Route53 DNS`_ ROUTE53 single region driver :mod:`libcloud.dns.drivers.route53` :class:`Route53DNSDriver` +`Vultr DNS`_ :doc:`Click ` VULTR single region driver :mod:`libcloud.dns.drivers.vultr` :class:`VultrDNSDriver` +`World Wide DNS`_ :doc:`Click ` WORLDWIDEDNS single region driver :mod:`libcloud.dns.drivers.worldwidedns` :class:`WorldWideDNSDriver` +`Zerigo DNS`_ ZERIGO single region driver :mod:`libcloud.dns.drivers.zerigo` :class:`ZerigoDNSDriver` +`Zonomi DNS`_ :doc:`Click ` ZONOMI single region driver :mod:`libcloud.dns.drivers.zonomi` :class:`ZonomiDNSDriver` +================= ========================================= ================= ==================== ======================================== ============================== + +.. _`AuroraDNS`: https://www.pcextreme.nl/en/aurora/dns +.. _`BuddyNS DNS`: https://www.buddyns.com +.. _`CloudFlare DNS`: https://www.cloudflare.com +.. _`DigitalOcean`: https://www.digitalocean.com +.. _`DNSimple`: https://dnsimple.com/ +.. _`DurableDNS`: https://durabledns.com .. _`Gandi DNS`: http://www.gandi.net/domain +.. _`Gandi LiveDNS`: http://www.gandi.net/domain +.. _`GoDaddy DNS`: https://www.godaddy.com/ .. _`Google DNS`: https://cloud.google.com/ -.. _`Host Virtual DNS`: https://www.hostvirtual.com/ .. _`Linode DNS`: http://www.linode.com/ +.. _`Liquidweb DNS`: https://www.liquidweb.com +.. _`Luadns`: https://www.luadns.com +.. _`NFSN DNS`: https://www.nearlyfreespeech.net +.. _`NS1 DNS`: https://ns1.com +.. _`OnApp`: http://onapp.com/ +.. _`Point DNS`: https://pointhq.com/ +.. _`PowerDNS`: https://www.powerdns.com/ .. _`Rackspace DNS`: http://www.rackspace.com/ -.. _`Rackspace DNS (UK)`: http://www.rackspace.com/ -.. _`Rackspace DNS (US)`: http://www.rackspace.com/ +.. _`RcodeZero DNS`: https://www.rcodezero.at/ .. _`Route53 DNS`: http://aws.amazon.com/route53/ -.. _`Softlayer DNS`: https://www.softlayer.com +.. _`Vultr DNS`: https://www.vultr.com +.. _`World Wide DNS`: https://www.worldwidedns.net/ .. _`Zerigo DNS`: http://www.zerigo.com/ +.. _`Zonomi DNS`: https://zonomi.com diff --git a/docs/dns/drivers/auroradns.rst b/docs/dns/drivers/auroradns.rst new file mode 100644 index 0000000000..61831f629c --- /dev/null +++ b/docs/dns/drivers/auroradns.rst @@ -0,0 +1,82 @@ +AuroraDNS DNS driver documentation +================================== + +`PCextreme B.V.`_ is a Dutch cloud provider. It provides a public cloud offering +under the name AuroraCompute. All cloud services are under the family name +Aurora. + +`AuroraDNS`_ is a highly available DNS service which also provides health +checking. + +Records can be attached to a health check. When this health check becomes +unhealthy this record will no longer be served. + +This provides the possibility to create loadbalancing over multiple servers +without the requirement of a central loadbalancer in the network. It is also +provider agnostic, health checks can point to any IP/Host on the internet. + +IPv6 +---- +AuroraDNS fully supports IPv6: + +* DNS queries over IPv6 +* AAAA records +* Health checks over IPv6 + +Instantiating a driver +---------------------- + +When you instantiate a driver, you need to pass a your ``key`` and ``secret`` +to the driver constructor. These can be obtained in the control panel of +AuroraDNS. + +For example: + +.. literalinclude:: /examples/dns/auroradns/instantiate_driver.py + :language: python + +Disabling and enabling records +------------------------------ + +Records in can be disabled and enabled. By default all new records are enabled, +but this property can be set during creation and can be updated. + +For example: + +.. literalinclude:: /examples/dns/auroradns/instantiate_driver.py + :language: python + +In this example we create a record, but disable it. This means it will not be +served. + +Afterwards we enable the record and this make the DNS server serve this specific +record. + +Health Checks +------------- + +AuroraDNS has support for Health Checks which will disable all records attached +to that health check should it fail. With this you can create DNS based +loadbalancing over multiple records. + +In the example below we create a health check and afterwards attach a newly +created record to this health check. + +For example: + +.. literalinclude:: /examples/dns/auroradns/health_checks.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.auroradns.AuroraDNSDriver + :members: + :inherited-members: + +.. autoclass:: libcloud.dns.drivers.auroradns.AuroraDNSHealthCheck + :members: + :inherited-members: + +.. _`PCextreme B.V.`: https://www.pcextreme.nl/ +.. _`AuroraDNS`: https://www.pcextreme.nl/en/aurora/dns diff --git a/docs/dns/drivers/buddyns.rst b/docs/dns/drivers/buddyns.rst new file mode 100644 index 0000000000..b4eeb41d76 --- /dev/null +++ b/docs/dns/drivers/buddyns.rst @@ -0,0 +1,23 @@ +BuddyNS Driver Documentation +============================ + +BuddyNS.com is part of FrontDam GmbH, a small swiss company making +systems for uptime of Internet services, and run by a tribe of passionate +people who work great together. + +Read more at: https://www.buddyns.com/about/ + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/dns/buddyns/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.buddyns.BuddyNSDNSDriver + :members: + :inherited-members: + +.. https://www.buddyns.com/support/api/v2/ diff --git a/docs/dns/drivers/cloudflare.rst b/docs/dns/drivers/cloudflare.rst new file mode 100644 index 0000000000..fb814d77b0 --- /dev/null +++ b/docs/dns/drivers/cloudflare.rst @@ -0,0 +1,36 @@ +CloudFlare DNS Driver Documentation +=================================== + +`CloudFlare`_, Inc. is a U.S. company that provides a content delivery network +and distributed domain name server services. + +.. figure:: /_static/images/provider_logos/cloudflare.png + :align: center + :width: 300 + :target: https://www.cloudflare.com + +Instantiating the driver +------------------------ + +To instantiate the driver you need to pass email address associated with your +account and a Global API key available on the `account page`_ to the driver constructor +as shown below. + +.. literalinclude:: /examples/dns/cloudflare/instantiate_driver.py + :language: python + +Alternatively, authentication can also be done via an API Token as shown below. +It is recommended that the token at least has the Zone.DNS permissions. + +.. literalinclude:: /examples/dns/cloudflare/instantiate_driver_token.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.cloudflare.CloudFlareDNSDriver + :members: + :inherited-members: + +.. _`CloudFlare`: https://www.cloudflare.com/ +.. _`account page`: https://dash.cloudflare.com/profile diff --git a/docs/dns/drivers/digital_ocean.rst b/docs/dns/drivers/digital_ocean.rst new file mode 100644 index 0000000000..8d6b8c0012 --- /dev/null +++ b/docs/dns/drivers/digital_ocean.rst @@ -0,0 +1,32 @@ +DigitalOcean DNS Driver Documentation +===================================== + +`DigitalOcean`_ is an American cloud provider based in New York City with data +centers in New York, Amsterdam, San Francisco, London, Singapore, Frankfurt, +Toronto, and Bangalore. + +.. figure:: /_static/images/provider_logos/digitalocean.png + :align: center + :width: 300 + :target: https://www.digitalocean.com/ + +Instantiating a driver +---------------------- + +The DigitalOcean DNS driver only supports the v2.0 API requiring a Personal +Access Token to initialize as the key. + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/dns/digitalocean/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.digitalocean.DigitalOceanDNSDriver + :members: + :inherited-members: + +.. _`DigitalOcean`: https://www.digitalocean.com/ diff --git a/docs/dns/drivers/dnsimple.rst b/docs/dns/drivers/dnsimple.rst new file mode 100644 index 0000000000..f2b8793e79 --- /dev/null +++ b/docs/dns/drivers/dnsimple.rst @@ -0,0 +1,22 @@ +DNSimple DNS Driver Documentation +================================= + +`DNSimple`_ is a hosted DNS Service Provider that you can use to manage your +domains. Offers both a web interface and an iPhone application for adding and +removing domains and DNS records as well as an HTTP API with various code +libraries and tools. + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/dns/dnsimple/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.dnsimple.DNSimpleDNSDriver + :members: + :inherited-members: + +.. _`DNSimple`: https://dnsimple.com/ diff --git a/docs/dns/drivers/durabledns.rst b/docs/dns/drivers/durabledns.rst new file mode 100644 index 0000000000..ab788fb5e1 --- /dev/null +++ b/docs/dns/drivers/durabledns.rst @@ -0,0 +1,27 @@ +Durable DNS Driver Documentation +================================ + +`DurableDNS`_ provides DNS hosting solutions for customers of all +sizes. Works with all hosting arrangements - shared web hosting, virtual +private servers, dedicated servers, and servers hosted on dynamic IP addresses. +The servers are located in data centers located in different areas of North +America. This geographic separation ensures that your DNS records are never +off-line due to network problems, natural disasters, data center failures, or +supplier failures. + +See more at https://durabledns.com/ + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/dns/durabledns/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.durabledns.DurableDNSDriver + :members: + :inherited-members: + +.. _`DurableDNS`: https://durabledns.com/ diff --git a/docs/dns/drivers/godaddy.rst b/docs/dns/drivers/godaddy.rst new file mode 100644 index 0000000000..24865066b3 --- /dev/null +++ b/docs/dns/drivers/godaddy.rst @@ -0,0 +1,116 @@ +GoDaddy DNS Driver Documentation +================================ + +`GoDaddy`_ provide domain name registration and are the worlds largest with over 13 million customers. They also provide nameservers and DNS hosting as +well as cloud and website hosting. + +.. figure:: /_static/images/provider_logos/godaddy.png + :align: center + :width: 300 + :target: https://www.godaddy.com/ + +Further information on `GoDaddy`_ API is available on the `GoDaddy API Website`_ + +Driver features +--------------- + +* Manage the records for GoDaddy hosted domains +* Price and purchase domains with an existing GoDaddy account +* Fetch legal agreements required to register and purchase domains for a range of TLDs +* Submit completed agreements to purchase domains + +Instantiating the driver +------------------------ + +Before you instantiate a driver, you will need a GoDaddy account. + +Once you have an account you need to request a Production key on the GoDaddy API website: +https://developer.godaddy.com/getstarted#access + +You can then use these details to instantiate a driver with the arguments: + +* `shopper_id` - Your customer ID +* `key` - An API key +* `secret` - The matching secret for the API key + +.. literalinclude:: /examples/dns/godaddy/instantiate_driver.py + :language: python + +Listing zones +------------- + +.. literalinclude:: /examples/dns/godaddy/listing_zones.py + :language: python + +Returns + +:: + + Zone : wassle-layer.com + Expires: 2018-09-30T18:22:00Z + Zone : wizzle-wobble.org + Expires: 2017-01-04T04:02:07Z + +Listing records +--------------- + +.. literalinclude:: /examples/dns/godaddy/listing_records.py + :language: python + +Returns + +:: + + Type : CNAME + Data: @ + TTL: 3600 + Type : CNAME + Data: @ + TTL: 3600 + Type : MX + Data: mailstore1.secureserver.net + TTL: 3600 + Type : MX + Data: smtp.secureserver.net + TTL: 3600 + +Adding records +-------------- + +.. literalinclude:: /examples/dns/godaddy/adding_records.py + :language: python + +Updating records +---------------- + +.. literalinclude:: /examples/dns/godaddy/updating_records.py + :language: python + +It is important to note that the GoDaddy API does not give records a unique identifier. +So if you have multiple existing records for a single data and type, e.g. 2 A records for www, they will both be replaced with 1 record if you run the update_records method + +Pricing a domain +---------------- + +The driver supports checking the availability of a domain that you would like to purchase. + +.. literalinclude:: /examples/dns/godaddy/pricing_domain.py + :language: python + +Purchasing a domain +------------------- + +Domains can be purchased by requesting the agreement schema, which is a JSON schema and submitted a completed document. + +.. literalinclude:: /examples/dns/godaddy/purchasing_domain.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.godaddy.GoDaddyDNSDriver + :members: + :inherited-members: + +.. _`GoDaddy`: https://godaddy.com/ +.. _`GoDaddy API Website`: https://developer.godaddy.com/doc diff --git a/docs/dns/drivers/google.rst b/docs/dns/drivers/google.rst new file mode 100644 index 0000000000..54fb3d7948 --- /dev/null +++ b/docs/dns/drivers/google.rst @@ -0,0 +1,51 @@ +Google DNS Driver Documentation +=================================== + +Google Cloud DNS is a scalable, reliable and managed authoritative +Domain Name System (DNS) service running on the same infrastructure as Google. + +.. figure:: /_static/images/provider_logos/gcp.png + :align: center + :width: 500 + :target: https://cloud.google.com/ + +Instantiating the driver +------------------------ + +The Google Cloud DNS driver supports three methods of authentication: +* Service accounts +* Installed Application +* Internal authentication + +To instantiate the driver, pass authentication tokens to the constructor as +shown below: + +1. Getting Driver with Service Account authentication +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +With local key file: + +.. literalinclude:: /examples/dns/google/dns_service_account.py + +With Service Account credentials as dict: + +.. literalinclude:: /examples/dns/google/dns_service_account_infile.py + +2. Getting Driver with Installed Application authentication +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/dns/google/dns_installed_application.py + + +3. Using GCE Internal Authorization +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/dns/google/dns_internal_auth.py + + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.google.GoogleDNSDriver + :members: + :inherited-members: diff --git a/docs/dns/drivers/hostvirtual.rst b/docs/dns/drivers/hostvirtual.rst deleted file mode 100644 index fd1337e7b1..0000000000 --- a/docs/dns/drivers/hostvirtual.rst +++ /dev/null @@ -1,18 +0,0 @@ -HostVirtual DNS Driver Documentation -==================================== - -`Host Virtual`_ is a cloud hosting provider that operates dual-stack IPv4 -and IPv6 IaaS clouds in 15 locations worldwide. - -Instantiating a driver ----------------------- - -When you instantiate a driver, you need to pass a single ``key`` argument to -the driver constructor. This argument represents your API secret key. - -For example: - -.. literalinclude:: /examples/dns/hostvirtual/instantiate_driver.py - :language: python - -.. _`Host Virtual`: https://www.hostvirtual.com/ diff --git a/docs/dns/drivers/liquidweb.rst b/docs/dns/drivers/liquidweb.rst new file mode 100644 index 0000000000..3a43c97cd9 --- /dev/null +++ b/docs/dns/drivers/liquidweb.rst @@ -0,0 +1,23 @@ +Liquid Web DNS Driver Documentation +=================================== + +`Liquid Web`_ Liquid Web Inc. is a privately held, managed web hosting company +founded in 1997 with three wholly-owned data centers in Lansing, and a fourth +location in Scottsdale, AZ. + +Read more at: https://www.liquidweb.com + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/dns/liquidweb/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.liquidweb.LiquidWebDNSDriver + :members: + :inherited-members: + +.. _`Liquid Web`: https://www.liquidweb.com diff --git a/docs/dns/drivers/luadns.rst b/docs/dns/drivers/luadns.rst new file mode 100644 index 0000000000..0c1a99618c --- /dev/null +++ b/docs/dns/drivers/luadns.rst @@ -0,0 +1,25 @@ +Luadns DNS Driver Documentation +=============================== + +I was a happy user of a free DNS hosting service for many years, when this service was acquired by a competitor in august 2011, I was forced to move somewhere else. + +While migrating my zone files I realized that I don't like Bind syntax files neither administering tens of domains through a web interface. I've started to experiment on how it should look a perfect DNS service for me. I've realized that I would love to store my configuration files in a Git repository and I would need some configuration language for templating (Lua). + +This is how LuaDNS was born on October, 2011. + +Read more at: http://luadns.com/ + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/dns/luadns/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.luadns.LuadnsDNSDriver + :members: + :inherited-members: + +.. _`Luadns`: http://luadns.com/ diff --git a/docs/dns/drivers/nfsn.rst b/docs/dns/drivers/nfsn.rst new file mode 100644 index 0000000000..89551f470e --- /dev/null +++ b/docs/dns/drivers/nfsn.rst @@ -0,0 +1,25 @@ +NFSN DNS Driver Documentation +=================================== + +`NFSN`_, Inc. is a U.S. company that provides web hosting and domain name +server services. + +Instantiating the driver +------------------------ + +To instantiate the driver you need to pass the account name and API key to the +driver constructor as shown below. Obtain your API key from NFSN by submitting +a secure support request via the `control panel`_. + +.. literalinclude:: /examples/dns/nfsn/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.nfsn.NFSNDNSDriver + :members: + :inherited-members: + +.. _`NFSN`: https://www.nearlyfreespeech.net/ +.. _`control panel`: https://members.nearlyfreespeech.net/ diff --git a/docs/dns/drivers/onapp.rst b/docs/dns/drivers/onapp.rst new file mode 100644 index 0000000000..b5cde10e97 --- /dev/null +++ b/docs/dns/drivers/onapp.rst @@ -0,0 +1,23 @@ +OnApp DNS Driver Documentation +================================= + +`OnApp`_ Cloud integrates its fully redundant DNS network into the OnApp +Control Panel, so you can manage DNS for your own domains, and your customers’ +domains. Its Anycast DNS service is hosted at datacenters around the world, +and it’s free of charge for customers running the full version of OnApp Cloud, +with CDN enabled. Get fast, fully redundant DNS for free! + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/dns/onapp/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.onapp.OnAppDNSDriver + :members: + :inherited-members: + +.. _`OnApp`: http://onapp.com/ diff --git a/docs/dns/drivers/pointdns.rst b/docs/dns/drivers/pointdns.rst new file mode 100644 index 0000000000..b27509b438 --- /dev/null +++ b/docs/dns/drivers/pointdns.rst @@ -0,0 +1,23 @@ +Point DNS Driver Documentation +============================== + +`PointDNS`_ provides an API that gives access to point zone, records, http and +email redirects management. The API is built using RESTful principles. + +XML and JSON are supported as responses to API calls but this provider only +support JSON. + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/dns/pointdns/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.pointdns.PointDNSDriver + :members: + :inherited-members: + +.. _`PointDNS`: https://pointhq.com diff --git a/docs/dns/drivers/powerdns.rst b/docs/dns/drivers/powerdns.rst new file mode 100644 index 0000000000..1bc13e41e8 --- /dev/null +++ b/docs/dns/drivers/powerdns.rst @@ -0,0 +1,43 @@ +PowerDNS Driver Documentation +============================= + +`PowerDNS`_ is an open-source DNS server. + +The current libcloud PowerDNS driver uses the HTTP API from PowerDNS 3.x by +default. Please read the `PowerDNS 3 HTTP API documentation`_ to enable the +HTTP API on your PowerDNS server. Specifically, you will need to set the +following in ``pdns.conf``:: + + experimental-json-interface=yes + experimental-api-key=changeme + webserver=yes + +For PowerDNS 4.x, please read the `PowerDNS 4 HTTP API documentation`_. The +``pdns.conf`` options are slightly different (the options are no longer +prefixed with ``experimental-``, and ``json-interface`` is no longer +required.):: + + api-key=changeme + webserver=yes + +Be sure to reload the pdns service after any configuration changes. + +Instantiating the driver +------------------------ + +To instantiate the driver you need to pass the API key, hostname, and webserver +HTTP port to the driver constructor as shown below. + +.. literalinclude:: /examples/dns/powerdns/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.powerdns.PowerDNSDriver + :members: + :inherited-members: + +.. _`PowerDNS`: https://doc.powerdns.com/ +.. _`PowerDNS 3 HTTP API documentation`: https://doc.powerdns.com/3/httpapi/README/ +.. _`PowerDNS 4 HTTP API documentation`: https://doc.powerdns.com/authoritative/http-api/ diff --git a/docs/dns/drivers/rcodezero.rst b/docs/dns/drivers/rcodezero.rst new file mode 100644 index 0000000000..01d5e7983f --- /dev/null +++ b/docs/dns/drivers/rcodezero.rst @@ -0,0 +1,42 @@ +RcodeZero DNS Driver Documentation +================================== + +.. figure:: /_static/images/provider_logos/rcodezero.png + :align: center + :width: 300 + :target: https://www.rcodezero.at/en + +`RcodeZero`_ is a European Anycast DNS service provided by nic.at. + +Supported Features: + +- more than 35 nodes +- two separate clouds with different ASes +- full IPv4/IPv6 support +- primary as well as secondary Nameservers +- DNSSEC signing +- ANAME(ALIAS) records +- extensive statistics +- management via web interface or a REST based API +- DDoS mitigation +- dedicated IP addresses (optional) + +Read more at https://www.rcodezero.at/en or get the API documentation +at https://my.rcodezero.at/openapi + +Instantiating the driver +------------------------ + +Log into https://my.rcodezero.at/ and get your API key. Pass the API key, +hostname and port to the driver constructor as shown below. + +.. literalinclude:: /examples/dns/rcodezero/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.rcodezero.RcodeZeroDNSDriver + :members: + +.. _`RcodeZero`: https://my.rcodezero.at/en diff --git a/docs/dns/drivers/vultr.rst b/docs/dns/drivers/vultr.rst new file mode 100644 index 0000000000..0890fc8d4e --- /dev/null +++ b/docs/dns/drivers/vultr.rst @@ -0,0 +1,24 @@ +Vultr Driver Documentation +========================== + +`Vultr`_ was built by the same team that created Choopa.com and +GameServers.com, has tackled hosting solutions, delivering industry +leading performance and reliability while building out one highly available +worldwide network. + +Read more at: https://www.vultr.com/about/ + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/dns/vultr/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.vultr.VultrDNSDriver + :members: + :inherited-members: + +.. _`Vultr`: https://www.vultr.com diff --git a/docs/dns/drivers/worldwidedns.rst b/docs/dns/drivers/worldwidedns.rst new file mode 100644 index 0000000000..b1127d30eb --- /dev/null +++ b/docs/dns/drivers/worldwidedns.rst @@ -0,0 +1,22 @@ +World Wide DNS Driver Documentation +=================================== + +`WorldWideDNS`_ provides Primary DNS services, Secondary DNS services, and +Dynamic DNS hosting services for thousands of businesses, website hosting, +website developers, and consumers. Resellers can completely private +label / white label DNS services with custom name servers. + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/dns/worldwidedns/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.worldwidedns.WorldWideDNSDriver + :members: + :inherited-members: + +.. _`WorldWideDNS`: https://www.worldwidedns.net/ diff --git a/docs/dns/drivers/zonomi.rst b/docs/dns/drivers/zonomi.rst new file mode 100644 index 0000000000..c5d0655b30 --- /dev/null +++ b/docs/dns/drivers/zonomi.rst @@ -0,0 +1,25 @@ +Zonomi DNS Driver Documentation +=============================== + +`Zonomi`_ name servers are spread around the globe (London, Dallas, New York +and Auckland). It offers Fully redundant, fault-tolerant, reliable name +servers, Instant updates, Low TTLs, Wildcard domain names, Any DNS record type, +Dynamic DNS, DNS API, Round robin DNS, No need to transfer your domain name +registrar, Integrates with Pingability's DNS fail over, Vanity name servers. + +Read more at: http://zonomi.com/ + +Instantiating the driver +------------------------ + +.. literalinclude:: /examples/dns/zonomi/instantiate_driver.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.zonomi.ZonomiDNSDriver + :members: + :inherited-members: + +.. _`Zonomi`: http://zonomi.com/ diff --git a/docs/dns/examples.rst b/docs/dns/examples.rst index b02e51a25c..f27c0f192a 100644 --- a/docs/dns/examples.rst +++ b/docs/dns/examples.rst @@ -31,6 +31,21 @@ example shows how to do that. .. literalinclude:: /examples/dns/create_record_with_priority.py :language: python +Create a CAA record +------------------- + +.. note:: + + Support for CAA record type has been introduced in Libcloud v3.1.0. At this + point it has only been implemented and tested with CloudFlare and Gandii + Live DNS drivers. + +When creating a CAA record, data fields needs to be in the following format: +`` `` as shown below. + +.. literalinclude:: /examples/dns/create_record_caa_record_type.py + :language: python + Export Libcloud Zone to BIND zone format ---------------------------------------- diff --git a/docs/examples/__init__.py b/docs/examples/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/backup/__init__.py b/docs/examples/backup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/backup/create_backup_from_node.py b/docs/examples/backup/create_backup_from_node.py new file mode 100644 index 0000000000..ccf5f2a495 --- /dev/null +++ b/docs/examples/backup/create_backup_from_node.py @@ -0,0 +1,38 @@ +import time +from pprint import pprint + +from libcloud.backup.types import Provider as BackupProvider +from libcloud.backup.types import BackupTargetJobStatusType +from libcloud.compute.types import Provider as ComputeProvider +from libcloud.backup.providers import get_driver as get_backup_driver +from libcloud.compute.providers import get_driver as get_compute_driver + +backup_driver = get_backup_driver(BackupProvider.DIMENSIONDATA)("username", "api key") +compute_driver = get_compute_driver(ComputeProvider.DIMENSIONDATA)("username", "api key") + +nodes = compute_driver.list_nodes() + +# Backup the first node in the pool +selected_node = nodes[0] + +print("Enabling backup for node") +new_target = backup_driver.create_target_from_node(selected_node) + +print("Starting backup of node") +job = backup_driver.create_target_job(new_target) + +print("Waiting for job to complete") +while True: + if job.status != BackupTargetJobStatusType.RUNNING: + break + else: + job = backup_driver.get_target_job(job.id) + + print("Job is now at %s percent complete" % (job.progress)) + time.sleep(20) + +print("Job is completed with status- %s" % (job.status)) + +print("Getting a list of recovery points") +recovery_points = backup_driver.list_recovery_points(new_target) +pprint(recovery_points) diff --git a/docs/examples/compute/__init__.py b/docs/examples/compute/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/auroracompute/__init__.py b/docs/examples/compute/auroracompute/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/auroracompute/create_node.py b/docs/examples/compute/auroracompute/create_node.py new file mode 100644 index 0000000000..b49e2e56ff --- /dev/null +++ b/docs/examples/compute/auroracompute/create_node.py @@ -0,0 +1,22 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +apikey = "mykey" +secretkey = "mysecret" + +Driver = get_driver(Provider.AURORACOMPUTE) +driver = Driver(key=apikey, secret=secretkey) + +images = driver.list_images() +sizes = driver.list_sizes() + +# Find a Agile Offering with 2GB of Memory +size = [s for s in sizes if s.ram == 2048 and s.name.startswith("Agile")][0] + +# Search for the Ubuntu 16.04 image +image = [i for i in images if i.name == "Ubuntu 16.04"][0] + +# Create the new Virtual Machine +node = driver.create_node(image=image, size=size) + +print(node) diff --git a/docs/examples/compute/auroracompute/instantiate_driver.py b/docs/examples/compute/auroracompute/instantiate_driver.py new file mode 100644 index 0000000000..1918099a8d --- /dev/null +++ b/docs/examples/compute/auroracompute/instantiate_driver.py @@ -0,0 +1,8 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +apikey = "mykey" +secretkey = "mysecret" + +Driver = get_driver(Provider.AURORACOMPUTE) +conn = Driver(key=apikey, secret=secretkey) diff --git a/docs/examples/compute/auroracompute/instantiate_driver_region.py b/docs/examples/compute/auroracompute/instantiate_driver_region.py new file mode 100644 index 0000000000..2d2201e2f5 --- /dev/null +++ b/docs/examples/compute/auroracompute/instantiate_driver_region.py @@ -0,0 +1,9 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver +from libcloud.compute.drivers.auroracompute import AuroraComputeRegion + +apikey = "mykey" +secretkey = "mysecret" + +Driver = get_driver(Provider.AURORACOMPUTE) +conn = Driver(key=apikey, secret=secretkey, region=AuroraComputeRegion.MIA) diff --git a/docs/examples/compute/azure/__init__.py b/docs/examples/compute/azure/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/azure/instantiate.py b/docs/examples/compute/azure/instantiate.py index 3ccf548d69..f761ccec09 100644 --- a/docs/examples/compute/azure/instantiate.py +++ b/docs/examples/compute/azure/instantiate.py @@ -2,5 +2,4 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.AZURE) -driver = cls(subscription_id='subscription-id', - key_file='/path/to/azure_cert.cer') +driver = cls(subscription_id="subscription-id", key_file="/path/to/azure_cert.pem") diff --git a/docs/examples/compute/azure_arm/__init__.py b/docs/examples/compute/azure_arm/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/azure_arm/instantiate.py b/docs/examples/compute/azure_arm/instantiate.py new file mode 100644 index 0000000000..653c6e5523 --- /dev/null +++ b/docs/examples/compute/azure_arm/instantiate.py @@ -0,0 +1,10 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +cls = get_driver(Provider.AZURE_ARM) +driver = cls( + tenant_id="tenant_id", + subscription_id="subscription_id", + key="application_id", + secret="password", +) diff --git a/docs/examples/compute/bootstrapping_puppet_on_node.py b/docs/examples/compute/bootstrapping_puppet_on_node.py index 6cf780ce4b..8152dccc3f 100644 --- a/docs/examples/compute/bootstrapping_puppet_on_node.py +++ b/docs/examples/compute/bootstrapping_puppet_on_node.py @@ -1,22 +1,19 @@ -from __future__ import with_statement - import os from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -from libcloud.compute.deployment import MultiStepDeployment -from libcloud.compute.deployment import ScriptDeployment, SSHKeyDeployment +from libcloud.compute.deployment import ScriptDeployment, SSHKeyDeployment, MultiStepDeployment # Path to the public key you would like to install -KEY_PATH = os.path.expanduser('~/.ssh/id_rsa.pub') +KEY_PATH = os.path.expanduser("~/.ssh/id_rsa.pub") # Shell script to run on the remote server -SCRIPT = '''#!/usr/bin/env bash +SCRIPT = """#!/usr/bin/env bash apt-get -y update && apt-get -y install puppet -''' +""" -RACKSPACE_USER = 'your username' -RACKSPACE_KEY = 'your key' +RACKSPACE_USER = "your username" +RACKSPACE_KEY = "your key" Driver = get_driver(Provider.RACKSPACE) conn = Driver(RACKSPACE_USER, RACKSPACE_KEY) @@ -37,5 +34,4 @@ sizes = conn.list_sizes() # deploy_node takes the same base keyword arguments as create_node. -node = conn.deploy_node(name='test', image=images[0], size=sizes[0], - deploy=msd) +node = conn.deploy_node(name="test", image=images[0], size=sizes[0], deploy=msd) diff --git a/docs/examples/compute/cloudframes/__init__.py b/docs/examples/compute/cloudframes/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/cloudframes/auth_kwargs.py b/docs/examples/compute/cloudframes/auth_kwargs.py index c04df681fb..8fe9473956 100644 --- a/docs/examples/compute/cloudframes/auth_kwargs.py +++ b/docs/examples/compute/cloudframes/auth_kwargs.py @@ -2,5 +2,4 @@ from libcloud.compute.providers import get_driver CloudFrames = get_driver(Provider.CLOUDFRAMES) -driver = CloudFrames(key='admin', secret='admin', secure=False, - host='cloudframes', port=80) +driver = CloudFrames(key="admin", secret="admin", secure=False, host="cloudframes", port=80) diff --git a/docs/examples/compute/cloudframes/auth_url.py b/docs/examples/compute/cloudframes/auth_url.py index df1cee5f09..8623cc4063 100644 --- a/docs/examples/compute/cloudframes/auth_url.py +++ b/docs/examples/compute/cloudframes/auth_url.py @@ -2,4 +2,4 @@ from libcloud.compute.providers import get_driver CloudFrames = get_driver(Provider.CLOUDFRAMES) -driver = CloudFrames(url='http://admin:admin@cloudframes:80/appserver/xmlrpc') +driver = CloudFrames(url="http://admin:admin@cloudframes:80/appserver/xmlrpc") diff --git a/docs/examples/compute/cloudframes/functionality.py b/docs/examples/compute/cloudframes/functionality.py index 6325e92380..da30b14e54 100644 --- a/docs/examples/compute/cloudframes/functionality.py +++ b/docs/examples/compute/cloudframes/functionality.py @@ -4,7 +4,7 @@ from libcloud.compute.providers import get_driver CloudFrames = get_driver(Provider.CLOUDFRAMES) -driver = CloudFrames(url='http://admin:admin@cloudframes:80/appserver/xmlrpc') +driver = CloudFrames(url="http://admin:admin@cloudframes:80/appserver/xmlrpc") # get an available location location = driver.list_locations()[0] @@ -14,8 +14,7 @@ size = driver.list_sizes()[0] # use these to create a node -node = driver.create_node(image=image, name='TEST_%s' % uuid.uuid4(), - size=size, location=location) +node = driver.create_node(image=image, name="TEST_%s" % uuid.uuid4(), size=size, location=location) # snapshot a node, rollback to the snapshot and destroy the snaphost snapshot = driver.ex_snapshot_node(node) @@ -23,8 +22,7 @@ driver.ex_destroy_snapshot(node, snapshot) # list running nodes -nodes = [n for n in driver.list_nodes() - if n.state == NodeState.RUNNING] +nodes = [n for n in driver.list_nodes() if n.state == NodeState.RUNNING] # reboot node driver.reboot_node(node) # destroy the node diff --git a/docs/examples/compute/cloudscale/__init__.py b/docs/examples/compute/cloudscale/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/cloudscale/cloudscale_compute_simple.py b/docs/examples/compute/cloudscale/cloudscale_compute_simple.py new file mode 100644 index 0000000000..5b98a1ce62 --- /dev/null +++ b/docs/examples/compute/cloudscale/cloudscale_compute_simple.py @@ -0,0 +1,24 @@ +from pprint import pprint + +import libcloud + +cls = libcloud.get_driver(libcloud.DriverType.COMPUTE, libcloud.DriverType.COMPUTE.CLOUDSCALE) + +TOKEN = "3pjzjh3h3rfynqa4iemvtvc33pyfzss2" +driver = cls(TOKEN) + +sizes = driver.list_sizes() +images = driver.list_images() +pprint(sizes) +pprint(images) + +new_node = driver.create_node( + name="hello-darkness-my-old-friend", + size=sizes[0], + image=images[0], + ex_create_attr=dict( + ssh_keys=["ssh-rsa AAAAB3Nza..."], + use_private_network=True, + ), +) +pprint(new_node) diff --git a/docs/examples/compute/cloudsigma/__init__.py b/docs/examples/compute/cloudsigma/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/cloudsigma/attach_firewall_policy.py b/docs/examples/compute/cloudsigma/attach_firewall_policy.py index a2c93c284a..11f9513c20 100644 --- a/docs/examples/compute/cloudsigma/attach_firewall_policy.py +++ b/docs/examples/compute/cloudsigma/attach_firewall_policy.py @@ -2,10 +2,10 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") tags = driver.ex_list_tags() -tag = [tag for tag in tags if tag.name == 'database-server'][0] +tag = [tag for tag in tags if tag.name == "database-server"][0] nodes = driver.list_nodes(ex_tag=tag) policy = driver.ex_list_firewall_policies()[0] diff --git a/docs/examples/compute/cloudsigma/check_avail_groups.py b/docs/examples/compute/cloudsigma/check_avail_groups.py index c770007081..1467bc02d6 100644 --- a/docs/examples/compute/cloudsigma/check_avail_groups.py +++ b/docs/examples/compute/cloudsigma/check_avail_groups.py @@ -2,7 +2,7 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") servers_groups = driver.ex_list_servers_availability_groups() drives_groups = driver.ex_list_drives_availability_groups() diff --git a/docs/examples/compute/cloudsigma/connect_to_api_1_0.py b/docs/examples/compute/cloudsigma/connect_to_api_1_0.py index dac1d4efcc..46cc6909a1 100644 --- a/docs/examples/compute/cloudsigma/connect_to_api_1_0.py +++ b/docs/examples/compute/cloudsigma/connect_to_api_1_0.py @@ -2,4 +2,4 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='1.0') +driver = cls("username", "password", region="zrh", api_version="1.0") diff --git a/docs/examples/compute/cloudsigma/connect_to_api_2_0.py b/docs/examples/compute/cloudsigma/connect_to_api_2_0.py index 608c46fd51..3c665da334 100644 --- a/docs/examples/compute/cloudsigma/connect_to_api_2_0.py +++ b/docs/examples/compute/cloudsigma/connect_to_api_2_0.py @@ -4,4 +4,4 @@ cls = get_driver(Provider.CLOUDSIGMA) # "api_version" argument can be left out since it defaults to 2.0 -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") diff --git a/docs/examples/compute/cloudsigma/create_node_ex_avoid.py b/docs/examples/compute/cloudsigma/create_node_ex_avoid.py index 9126d6730d..c09a08ec9d 100644 --- a/docs/examples/compute/cloudsigma/create_node_ex_avoid.py +++ b/docs/examples/compute/cloudsigma/create_node_ex_avoid.py @@ -2,9 +2,9 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") -name = 'test node avoid mode' +name = "test node avoid mode" size = driver.list_sizes()[0] image = driver.list_images()[0] @@ -12,6 +12,5 @@ existing_node_uuids = [node.id for node in existing_nodes] -node = driver.create_node(name=name, size=size, image=image, - ex_avoid=existing_node_uuids) +node = driver.create_node(name=name, size=size, image=image, ex_avoid=existing_node_uuids) print(node) diff --git a/docs/examples/compute/cloudsigma/create_server_custom_size.py b/docs/examples/compute/cloudsigma/create_server_custom_size.py index 231bc2b48e..e0f2ed69b8 100644 --- a/docs/examples/compute/cloudsigma/create_server_custom_size.py +++ b/docs/examples/compute/cloudsigma/create_server_custom_size.py @@ -3,13 +3,21 @@ from libcloud.compute.drivers.cloudsigma import CloudSigmaNodeSize cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") -name = 'test node custom size' +name = "test node custom size" image = driver.list_images()[0] # Custom node size with 56 GB of ram, 5000 MHz CPU and 200 GB SSD drive -size = CloudSigmaNodeSize(id=1, name='my size', cpu=5000, ram=5600, disk=200, - bandwidth=None, price=0, driver=driver) +size = CloudSigmaNodeSize( + id=1, + name="my size", + cpu=5000, + ram=5600, + disk=200, + bandwidth=None, + price=0, + driver=driver, +) node = driver.create_node(name=name, size=size, image=image) print(node) diff --git a/docs/examples/compute/cloudsigma/create_server_using_installation_cd.py b/docs/examples/compute/cloudsigma/create_server_using_installation_cd.py index 16f0fe902e..270e6bf5af 100644 --- a/docs/examples/compute/cloudsigma/create_server_using_installation_cd.py +++ b/docs/examples/compute/cloudsigma/create_server_using_installation_cd.py @@ -2,14 +2,13 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") -name = 'test node' +name = "test node" size = driver.list_sizes()[0] drives = driver.ex_list_library_drives() -image = [drive for drive in drives if drive.name == 'FreeBSD 8.2' and - drive.media == 'cdrom'][0] +image = [drive for drive in drives if drive.name == "FreeBSD 8.2" and drive.media == "cdrom"][0] # 1. Create a node node = driver.create_node(name=name, size=size, image=image) @@ -22,5 +21,5 @@ # through the installation process tunnel_url = driver.ex_open_vnc_tunnel(node=node) -print('VNC tunnel URL: %s' % (tunnel_url)) -print('VNC password: %s' % (node.extra['vnc_password'])) +print("VNC tunnel URL: %s" % (tunnel_url)) +print("VNC password: %s" % (node.extra["vnc_password"])) diff --git a/docs/examples/compute/cloudsigma/create_server_with_metadata.py b/docs/examples/compute/cloudsigma/create_server_with_metadata.py index 0087a8c632..9b58c08866 100644 --- a/docs/examples/compute/cloudsigma/create_server_with_metadata.py +++ b/docs/examples/compute/cloudsigma/create_server_with_metadata.py @@ -2,15 +2,17 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") -name = 'test node sizeth metadata' +name = "test node sizeth metadata" size = driver.list_sizes()[0] image = driver.list_images()[0] -metadata = {'ssh_public_key': 'my public key', 'role': 'database server', - 'region': 'zrh'} +metadata = { + "ssh_public_key": "my public key", + "role": "database server", + "region": "zrh", +} -node = driver.create_node(name=name, size=size, image=image, - ex_metadata=metadata) +node = driver.create_node(name=name, size=size, image=image, ex_metadata=metadata) print(node) diff --git a/docs/examples/compute/cloudsigma/create_server_with_vlan.py b/docs/examples/compute/cloudsigma/create_server_with_vlan.py index c48d8b3661..cd473add58 100644 --- a/docs/examples/compute/cloudsigma/create_server_with_vlan.py +++ b/docs/examples/compute/cloudsigma/create_server_with_vlan.py @@ -2,18 +2,18 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") -name = 'test node with vlan' +name = "test node with vlan" size = driver.list_sizes()[0] image = driver.list_images()[0] # 1. Create a VLAN. VLANs are created by purchasing a subscription. -subscription = driver.ex_create_subscription(amount=1, period='1 month', - resource='vlan', auto_renew=True) +subscription = driver.ex_create_subscription( + amount=1, period="1 month", resource="vlan", auto_renew=True +) vlan_uuid = subscription.subscribed_object # 2. Create a node with a VLAN -node = driver.create_node(name=name, size=size, image=image, - ex_vlan=vlan_uuid) +node = driver.create_node(name=name, size=size, image=image, ex_vlan=vlan_uuid) print(node) diff --git a/docs/examples/compute/cloudsigma/create_vlan_subscription.py b/docs/examples/compute/cloudsigma/create_vlan_subscription.py index a29e239426..cdf4972d72 100644 --- a/docs/examples/compute/cloudsigma/create_vlan_subscription.py +++ b/docs/examples/compute/cloudsigma/create_vlan_subscription.py @@ -2,8 +2,9 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") -subscription = driver.ex_create_subscription(amount=1, period='30 days', - resource='vlan', auto_renew=True) +subscription = driver.ex_create_subscription( + amount=1, period="30 days", resource="vlan", auto_renew=True +) print(subscription) diff --git a/docs/examples/compute/cloudsigma/get_account_balance.py b/docs/examples/compute/cloudsigma/get_account_balance.py index 29d55e2caa..292e35fc75 100644 --- a/docs/examples/compute/cloudsigma/get_account_balance.py +++ b/docs/examples/compute/cloudsigma/get_account_balance.py @@ -2,9 +2,9 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") balance = driver.ex_get_balance() -values = {'balance': balance['balance'], 'currency': balance['currency']} -print('Account balance: %(balance)s %(currency)s' % values) +values = {"balance": balance["balance"], "currency": balance["currency"]} +print("Account balance: %(balance)s %(currency)s" % values) diff --git a/docs/examples/compute/cloudsigma/list_sizes_images_drives.py b/docs/examples/compute/cloudsigma/list_sizes_images_drives.py index c306054c79..3dca573c4f 100644 --- a/docs/examples/compute/cloudsigma/list_sizes_images_drives.py +++ b/docs/examples/compute/cloudsigma/list_sizes_images_drives.py @@ -2,7 +2,7 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") sizes = driver.list_sizes() print(sizes) diff --git a/docs/examples/compute/cloudsigma/open_vnc_tunnel.py b/docs/examples/compute/cloudsigma/open_vnc_tunnel.py index 428490ae58..14d58a2c74 100644 --- a/docs/examples/compute/cloudsigma/open_vnc_tunnel.py +++ b/docs/examples/compute/cloudsigma/open_vnc_tunnel.py @@ -2,15 +2,15 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") node = driver.list_nodes()[0] vnc_url = driver.ex_open_vnc_tunnel(node=node) -vnc_password = node.extra['vnc_password'] +vnc_password = node.extra["vnc_password"] -values = {'url': vnc_url, 'password': vnc_password} -print('URL: %(url)s, Password: %(password)s' % values) +values = {"url": vnc_url, "password": vnc_password} +print("URL: %(url)s, Password: %(password)s" % values) # When you are done driver.ex_close_vnc_tunnel(node=node) diff --git a/docs/examples/compute/cloudsigma/tag_server.py b/docs/examples/compute/cloudsigma/tag_server.py index b9030fd461..7115d34748 100644 --- a/docs/examples/compute/cloudsigma/tag_server.py +++ b/docs/examples/compute/cloudsigma/tag_server.py @@ -2,21 +2,17 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.CLOUDSIGMA) -driver = cls('username', 'password', region='zrh', api_version='2.0') +driver = cls("username", "password", region="zrh", api_version="2.0") node = driver.list_nodes()[0] -tag_names = [ - 'zrh', - 'database-server', - 'monited' -] +tag_names = ["zrh", "database-server", "monited"] tags = [] # 1. Create necessary tags for tag_name in tag_names: - tag = driver.ex_create_tag(name='database-servers') + tag = driver.ex_create_tag(name="database-servers") tags.append(tag) # 2. Tag node with the created tags diff --git a/docs/examples/compute/cloudstack/__init__.py b/docs/examples/compute/cloudstack/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/cloudstack/create_cloudstack_node_keypair_secgroup.py b/docs/examples/compute/cloudstack/create_cloudstack_node_keypair_secgroup.py index b912fbfe29..5ebb3b258a 100644 --- a/docs/examples/compute/cloudstack/create_cloudstack_node_keypair_secgroup.py +++ b/docs/examples/compute/cloudstack/create_cloudstack_node_keypair_secgroup.py @@ -1,29 +1,32 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' -HOST = 'hostname or ip address of your management server' -PATH = 'path to the api endpoint, e.g: /client/api' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" +HOST = "hostname or ip address of your management server" +PATH = "path to the api endpoint, e.g: /client/api" -SIZE_ID = 'id of the computer offering you want to use' -IMAGE_ID = 'id of the template you want to use' +SIZE_ID = "id of the computer offering you want to use" +IMAGE_ID = "id of the template you want to use" # Name of the existing keypair you want to use -KEYPAIR_NAME = 'keypairname' +KEYPAIR_NAME = "keypairname" # The security groups you want this node to be added to -SECURITY_GROUP_NAMES = ['secgroup1', 'secgroup2'] +SECURITY_GROUP_NAMES = ["secgroup1", "secgroup2"] cls = get_driver(Provider.CLOUDSTACK) -driver = cls(key=ACCESS_ID, secret=SECRET_KEY, secure=True, - host=HOST, path=PATH) +driver = cls(key=ACCESS_ID, secret=SECRET_KEY, secure=True, host=HOST, path=PATH) sizes = driver.list_sizes() images = driver.list_images() size = [s for s in sizes if s.id == SIZE_ID][0] image = [i for i in images if i.id == IMAGE_ID][0] -node = driver.create_node(name='test-node-1', image=image, size=size, - ex_security_groups=SECURITY_GROUP_NAMES, - ex_keyname=KEYPAIR_NAME) +node = driver.create_node( + name="test-node-1", + image=image, + size=size, + ex_security_groups=SECURITY_GROUP_NAMES, + ex_keyname=KEYPAIR_NAME, +) diff --git a/docs/examples/compute/cloudstack/create_node_advanced_zone.py b/docs/examples/compute/cloudstack/create_node_advanced_zone.py index 5f7beae297..09d2c8d4d7 100644 --- a/docs/examples/compute/cloudstack/create_node_advanced_zone.py +++ b/docs/examples/compute/cloudstack/create_node_advanced_zone.py @@ -3,8 +3,8 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -apikey = 'your api key' -secretkey = 'your secret key' +apikey = "your api key" +secretkey = "your secret key" Driver = get_driver(Provider.IKOULA) driver = Driver(key=apikey, secret=secretkey) @@ -22,8 +22,7 @@ # Create the node # This returns a Node object -node = driver.create_node(name='libcloud', image=images[0], - size=sizes[0], networks=[nets[0]]) +node = driver.create_node(name="libcloud", image=images[0], size=sizes[0], networks=[nets[0]]) # The node has a private IP in the guest network used # No public IPs and no rules diff --git a/docs/examples/compute/cloudstack/deploy_node_with_keypair_security_group.py b/docs/examples/compute/cloudstack/deploy_node_with_keypair_security_group.py index bef682c41e..fdf9747047 100755 --- a/docs/examples/compute/cloudstack/deploy_node_with_keypair_security_group.py +++ b/docs/examples/compute/cloudstack/deploy_node_with_keypair_security_group.py @@ -4,23 +4,26 @@ from libcloud.compute.providers import get_driver # Import the deployment specific modules -from libcloud.compute.deployment import ScriptDeployment -from libcloud.compute.deployment import MultiStepDeployment +from libcloud.compute.deployment import ScriptDeployment, MultiStepDeployment cls = get_driver(Provider.EXOSCALE) -driver = cls('api key', 'api secret key') +driver = cls("api key", "api secret key") image = driver.list_images()[0] size = driver.list_sizes()[0] # Define the scripts that you want to run during deployment -script = ScriptDeployment('/bin/date') +script = ScriptDeployment("/bin/date") msd = MultiStepDeployment([script]) -node = driver.deploy_node(name='test', image=image, size=size, - ssh_key='~/.ssh/id_rsa_test', - ex_keyname='test-keypair', - deploy=msd) +node = driver.deploy_node( + name="test", + image=image, + size=size, + ssh_key="~/.ssh/id_rsa_test", + ex_keyname="test-keypair", + deploy=msd, +) # The stdout of the deployment can be checked on the `script` object pprint(script.stdout) diff --git a/docs/examples/compute/cloudstack/instantiate_driver_host_path.py b/docs/examples/compute/cloudstack/instantiate_driver_host_path.py index 22fb9de763..786428a514 100644 --- a/docs/examples/compute/cloudstack/instantiate_driver_host_path.py +++ b/docs/examples/compute/cloudstack/instantiate_driver_host_path.py @@ -1,10 +1,10 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -apikey = 'your api key' -secretkey = 'your secret key' -host = 'example.com' -path = '/path/to/api' +apikey = "your api key" +secretkey = "your secret key" +host = "example.com" +path = "/path/to/api" Driver = get_driver(Provider.CLOUDSTACK) conn = Driver(key=apikey, secret=secretkey, host=host, path=path) diff --git a/docs/examples/compute/cloudstack/instantiate_driver_insecure_port.py b/docs/examples/compute/cloudstack/instantiate_driver_insecure_port.py index 0acca19eb2..3b72e2ac14 100644 --- a/docs/examples/compute/cloudstack/instantiate_driver_insecure_port.py +++ b/docs/examples/compute/cloudstack/instantiate_driver_insecure_port.py @@ -1,12 +1,11 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -apikey = 'your api key' -secretkey = 'your secret key' -host = 'localhost' -path = '/path/to/api' +apikey = "your api key" +secretkey = "your secret key" +host = "localhost" +path = "/path/to/api" port = 8080 Driver = get_driver(Provider.CLOUDSTACK) -conn = Driver(key=apikey, secret=secretkey, host=host, - path=path, port=port, secure=False) +conn = Driver(key=apikey, secret=secretkey, host=host, path=path, port=port, secure=False) diff --git a/docs/examples/compute/cloudstack/instantiate_driver_url.py b/docs/examples/compute/cloudstack/instantiate_driver_url.py index 8307380463..4986e956d7 100644 --- a/docs/examples/compute/cloudstack/instantiate_driver_url.py +++ b/docs/examples/compute/cloudstack/instantiate_driver_url.py @@ -1,9 +1,9 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -apikey = 'your api key' -secretkey = 'your secret key' -url = 'http://example.com/path/to/api' +apikey = "your api key" +secretkey = "your secret key" +url = "http://example.com/path/to/api" Driver = get_driver(Provider.CLOUDSTACK) conn = Driver(key=apikey, secret=secretkey, url=url) diff --git a/docs/examples/compute/cloudstack/port_forwarding_management.py b/docs/examples/compute/cloudstack/port_forwarding_management.py index e767dfc1ca..aa2197972a 100644 --- a/docs/examples/compute/cloudstack/port_forwarding_management.py +++ b/docs/examples/compute/cloudstack/port_forwarding_management.py @@ -4,7 +4,7 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.EXOSCALE) -driver = cls('api key', 'api secret key') +driver = cls("api key", "api secret key") # Allocate a public IP # This returns a CloudStackAddress object @@ -17,10 +17,10 @@ # Create a port forwarding rule for the node # This returns a CloudStackPortForwardingRule object -rule = driver.ex_create_port_forwarding_rule(ip, 22, 22, 'TCP', node) +rule = driver.ex_create_port_forwarding_rule(ip, 22, 22, "TCP", node) pprint(rule) # The node now has a public IP and a rule associated to it -print node -print node.extra +print(node) +print(node.extra) diff --git a/docs/examples/compute/cloudstack/security_groups_management.py b/docs/examples/compute/cloudstack/security_groups_management.py index be89b3385b..4e11fcafea 100644 --- a/docs/examples/compute/cloudstack/security_groups_management.py +++ b/docs/examples/compute/cloudstack/security_groups_management.py @@ -4,26 +4,28 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.EXOSCALE) -driver = cls('api key', 'api secret key') +driver = cls("api key", "api secret key") # List all security groups sg = driver.ex_list_security_groups() pprint(sg) # Create a new security group. -security_group = driver.ex_create_security_group(name='test-security-group') +security_group = driver.ex_create_security_group(name="test-security-group") pprint(security_group) # Authorize an ingress rule on a security group # If `startport` is used alone, this will be the only port open # If `endport` is also used then the entire range will be authorized sg = driver.ex_authorize_security_group_ingress( - securitygroupname='test-security-group', protocol='tcp', startport='22', - cidrlist='0.0.0.0/0' + securitygroupname="test-security-group", + protocol="tcp", + startport="22", + cidrlist="0.0.0.0/0", ) pprint(sg) # Delete a security group we have previously created -status = driver.ex_delete_security_group(name='test-security-group') +status = driver.ex_delete_security_group(name="test-security-group") pprint(status) diff --git a/docs/examples/compute/cloudstack/ssh_keypairs_management_exoscale.py b/docs/examples/compute/cloudstack/ssh_keypairs_management_exoscale.py index 0779754bce..36f267a469 100644 --- a/docs/examples/compute/cloudstack/ssh_keypairs_management_exoscale.py +++ b/docs/examples/compute/cloudstack/ssh_keypairs_management_exoscale.py @@ -5,22 +5,21 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.EXOSCALE) -driver = cls('api key', 'api secret key') +driver = cls("api key", "api secret key") # Create a new key pair. Most providers will return generated private key in # the response which can be accessed at key_pair.private_key -key_pair = driver.create_key_pair(name='test-key-pair-1') +key_pair = driver.create_key_pair(name="test-key-pair-1") pprint(key_pair) # Import an existing public key from a file. If you have public key as a # string, you can use import_key_pair_from_string method instead. -key_file_path = os.path.expanduser('~/.ssh/id_rsa_test.pub') -key_pair = driver.import_key_pair_from_file(name='test-key-pair-2', - key_file_path=key_file_path) +key_file_path = os.path.expanduser("~/.ssh/id_rsa_test.pub") +key_pair = driver.import_key_pair_from_file(name="test-key-pair-2", key_file_path=key_file_path) pprint(key_pair) # Retrieve information about previously created key pair -key_pair = driver.get_key_pair(name='test-key-pair-1') +key_pair = driver.get_key_pair(name="test-key-pair-1") pprint(key_pair) # Delete a key pair we have previously created diff --git a/docs/examples/compute/cloudstack/start_interactive_shell_exoscale.py b/docs/examples/compute/cloudstack/start_interactive_shell_exoscale.py index 979a6b7701..6be5ca5f51 100755 --- a/docs/examples/compute/cloudstack/start_interactive_shell_exoscale.py +++ b/docs/examples/compute/cloudstack/start_interactive_shell_exoscale.py @@ -1,16 +1,17 @@ import os +# pylint: disable=import-error from IPython.terminal.embed import InteractiveShellEmbed from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -apikey = os.getenv('EXOSCALE_API_KEY') -secretkey = os.getenv('EXOSCALE_SECRET_KEY') +apikey = os.getenv("EXOSCALE_API_KEY") +secretkey = os.getenv("EXOSCALE_SECRET_KEY") Driver = get_driver(Provider.EXOSCALE) conn = Driver(key=apikey, secret=secretkey) -shell = InteractiveShellEmbed(banner1='Hello from Libcloud Shell !!') +shell = InteractiveShellEmbed(banner1="Hello from Libcloud Shell !!") shell() diff --git a/docs/examples/compute/cloudstack/start_interactive_shell_ikoula.py b/docs/examples/compute/cloudstack/start_interactive_shell_ikoula.py index 0b25765647..7a4846bb77 100755 --- a/docs/examples/compute/cloudstack/start_interactive_shell_ikoula.py +++ b/docs/examples/compute/cloudstack/start_interactive_shell_ikoula.py @@ -1,16 +1,17 @@ import os +# pylint: disable=import-error from IPython.terminal.embed import InteractiveShellEmbed from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -apikey = os.getenv('IKOULA_API_KEY') -secretkey = os.getenv('IKOULA_SECRET_KEY') +apikey = os.getenv("IKOULA_API_KEY") +secretkey = os.getenv("IKOULA_SECRET_KEY") Driver = get_driver(Provider.IKOULA) conn = Driver(key=apikey, secret=secretkey) -shell = InteractiveShellEmbed(banner1='Hello from Libcloud Shell !!') +shell = InteractiveShellEmbed(banner1="Hello from Libcloud Shell !!") shell() diff --git a/docs/examples/compute/cloudstack/turn_off_ssl_verification.py b/docs/examples/compute/cloudstack/turn_off_ssl_verification.py index d7ace6185e..a984831a44 100644 --- a/docs/examples/compute/cloudstack/turn_off_ssl_verification.py +++ b/docs/examples/compute/cloudstack/turn_off_ssl_verification.py @@ -1,2 +1,3 @@ import libcloud.security as sec + sec.VERIFY_SSL_CERT = False diff --git a/docs/examples/compute/create_ec2_node.py b/docs/examples/compute/create_ec2_node.py index 88894106f5..a71deabcb9 100644 --- a/docs/examples/compute/create_ec2_node.py +++ b/docs/examples/compute/create_ec2_node.py @@ -1,14 +1,14 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" -IMAGE_ID = 'ami-c8052d8d' -SIZE_ID = 't1.micro' +IMAGE_ID = "ami-c8052d8d" +SIZE_ID = "t1.micro" -cls = get_driver(Provider.EC2_US_WEST) -driver = cls(ACCESS_ID, SECRET_KEY) +cls = get_driver(Provider.EC2) +driver = cls(ACCESS_ID, SECRET_KEY, region="us-west-1") # Here we select size and image sizes = driver.list_sizes() @@ -17,4 +17,4 @@ size = [s for s in sizes if s.id == SIZE_ID][0] image = [i for i in images if i.id == IMAGE_ID][0] -node = driver.create_node(name='test-node', image=image, size=size) +node = driver.create_node(name="test-node", image=image, size=size) diff --git a/docs/examples/compute/create_ec2_node_and_associate_elastic_ip.py b/docs/examples/compute/create_ec2_node_and_associate_elastic_ip.py index 5d2c65c5ec..6f554c439a 100644 --- a/docs/examples/compute/create_ec2_node_and_associate_elastic_ip.py +++ b/docs/examples/compute/create_ec2_node_and_associate_elastic_ip.py @@ -1,14 +1,14 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" -IMAGE_ID = 'ami-c8052d8d' -SIZE_ID = 't1.micro' +IMAGE_ID = "ami-c8052d8d" +SIZE_ID = "t1.micro" -cls = get_driver(Provider.EC2_US_WEST) -driver = cls(ACCESS_ID, SECRET_KEY) +cls = get_driver(Provider.EC2) +driver = cls(ACCESS_ID, SECRET_KEY, region="us-west-1") sizes = driver.list_sizes() images = driver.list_images() @@ -16,7 +16,7 @@ size = [s for s in sizes if s.id == SIZE_ID][0] image = [i for i in images if i.id == IMAGE_ID][0] -node = driver.create_node(name='test-node', image=image, size=size) +node = driver.create_node(name="test-node", image=image, size=size) # Here we allocate and associate an elastic IP elastic_ip = driver.ex_allocate_address() diff --git a/docs/examples/compute/create_ec2_node_custom_ami.py b/docs/examples/compute/create_ec2_node_custom_ami.py index 4d70d5880a..bcc5db8c08 100644 --- a/docs/examples/compute/create_ec2_node_custom_ami.py +++ b/docs/examples/compute/create_ec2_node_custom_ami.py @@ -1,24 +1,24 @@ +from libcloud.compute.base import NodeImage from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -from libcloud.compute.base import NodeImage -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" # Image with Netflix Asgard available in us-west-1 region # https://github.com/Answers4AWS/netflixoss-ansible/wiki/AMIs-for-NetflixOSS -AMI_ID = 'ami-c8052d8d' +AMI_ID = "ami-c8052d8d" -SIZE_ID = 't1.micro' +SIZE_ID = "t1.micro" # 'us-west-1' region is available in Libcloud under EC2_US_WEST provider # constant -cls = get_driver(Provider.EC2_US_WEST) -driver = cls(ACCESS_ID, SECRET_KEY) +cls = get_driver(Provider.EC2) +driver = cls(ACCESS_ID, SECRET_KEY, region="us-west-1") # Here we select sizes = driver.list_sizes() -size = [s for s in sizes if s.id == 't1.micro'][0] -image = NodeImage(id=AMI_ID, name=None, driver=driver) +size = [s for s in sizes if s.id == "t1.micro"][0] +image = NodeImage(id=AMI_ID, name="Netflix Asgard", driver=driver) -node = driver.create_node(name='test-node', image=image, size=size) +node = driver.create_node(name="test-node", image=image, size=size) diff --git a/docs/examples/compute/create_ec2_node_iam.py b/docs/examples/compute/create_ec2_node_iam.py index 917267353e..7e9bde006b 100644 --- a/docs/examples/compute/create_ec2_node_iam.py +++ b/docs/examples/compute/create_ec2_node_iam.py @@ -1,14 +1,14 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' -IAM_PROFILE = 'your IAM profile arn or IAM profile name' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" +IAM_PROFILE = "your IAM profile arn or IAM profile name" -IMAGE_ID = 'ami-c8052d8d' -SIZE_ID = 't1.micro' -cls = get_driver(Provider.EC2_US_WEST) -driver = cls(ACCESS_ID, SECRET_KEY) +IMAGE_ID = "ami-c8052d8d" +SIZE_ID = "t1.micro" +cls = get_driver(Provider.EC2) +driver = cls(ACCESS_ID, SECRET_KEY, region="us-west-1") # Here we select size and image sizes = driver.list_sizes() @@ -17,5 +17,4 @@ size = [s for s in sizes if s.id == SIZE_ID][0] image = [i for i in images if i.id == IMAGE_ID][0] -node = driver.create_node(name='test-node', image=image, size=size, - ex_iamprofile=IAM_PROFILE) +node = driver.create_node(name="test-node", image=image, size=size, ex_iamprofile=IAM_PROFILE) diff --git a/docs/examples/compute/create_ec2_node_keypair_and_to_secgroup.py b/docs/examples/compute/create_ec2_node_keypair_and_to_secgroup.py index 40f96a4ea9..b82f55a1f5 100644 --- a/docs/examples/compute/create_ec2_node_keypair_and_to_secgroup.py +++ b/docs/examples/compute/create_ec2_node_keypair_and_to_secgroup.py @@ -1,25 +1,29 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" -SIZE_ID = 't1.micro' +SIZE_ID = "t1.micro" # Name of the existing keypair you want to use -KEYPAIR_NAME = 'keypairname' +KEYPAIR_NAME = "keypairname" # A list of security groups you want this node to be added to -SECURITY_GROUP_NAMES = ['secgroup1', 'secgroup2'] +SECURITY_GROUP_NAMES = ["secgroup1", "secgroup2"] cls = get_driver(Provider.EC2) driver = cls(ACCESS_ID, SECRET_KEY) sizes = driver.list_sizes() images = driver.list_images() -size = [s for s in sizes if s.id == 't1.micro'][0] +size = [s for s in sizes if s.id == "t1.micro"][0] image = images[0] -node = driver.create_node(name='test-node-1', image=image, size=size, - ex_keyname=KEYPAIR_NAME, - ex_securitygroup=SECURITY_GROUP_NAMES) +node = driver.create_node( + name="test-node-1", + image=image, + size=size, + ex_keyname=KEYPAIR_NAME, + ex_securitygroup=SECURITY_GROUP_NAMES, +) diff --git a/docs/examples/compute/create_ec2_node_manual_instantiation.py b/docs/examples/compute/create_ec2_node_manual_instantiation.py index db43c4ce9b..9b40d095ee 100644 --- a/docs/examples/compute/create_ec2_node_manual_instantiation.py +++ b/docs/examples/compute/create_ec2_node_manual_instantiation.py @@ -1,18 +1,25 @@ +from libcloud.compute.base import NodeSize, NodeImage from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -from libcloud.compute.base import NodeSize, NodeImage -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" -IMAGE_ID = 'ami-c8052d8d' -SIZE_ID = 't1.micro' +IMAGE_ID = "ami-c8052d8d" +SIZE_ID = "t1.micro" -cls = get_driver(Provider.EC2_US_WEST) -driver = cls(ACCESS_ID, SECRET_KEY) +cls = get_driver(Provider.EC2) +driver = cls(ACCESS_ID, SECRET_KEY, region="us-west-1") -size = NodeSize(id=SIZE_ID, name=None, ram=None, disk=None, bandwidth=None, - price=None, driver=driver) +size = NodeSize( + id=SIZE_ID, + name=None, + ram=None, + disk=None, + bandwidth=None, + price=None, + driver=driver, +) image = NodeImage(id=IMAGE_ID, name=None, driver=driver) -node = driver.create_node(name='test-node', image=image, size=size) +node = driver.create_node(name="test-node", image=image, size=size) diff --git a/docs/examples/compute/create_ibm_sce_windows_node.py b/docs/examples/compute/create_ibm_sce_windows_node.py index bb940e8e68..a9ce3c73bc 100644 --- a/docs/examples/compute/create_ibm_sce_windows_node.py +++ b/docs/examples/compute/create_ibm_sce_windows_node.py @@ -5,19 +5,19 @@ conn = Driver("user@name.com", "ibm_sce_password") images = conn.list_images() -image = [i for i in images if i.id == '20014110'][0] +image = [i for i in images if i.id == "20014110"][0] locations = conn.list_locations() -location = [l for l in locations if l.id == '82'][0] +location = [loc for loc in locations if loc.id == "82"][0] sizes = conn.list_sizes() -size = [s for s in sizes if s.id == 'COP32.1/2048/60'][0] +size = [s for s in sizes if s.id == "COP32.1/2048/60"][0] -node = conn.create_node(name="windows box", - image=image, - size=size, - ex_configurationData={ - 'UserName': 'someone', - 'Password': 'Wind0wsPass'}, - location=location) +node = conn.create_node( + name="windows box", + image=image, + size=size, + ex_configurationData={"UserName": "someone", "Password": "Wind0wsPass"}, + location=location, +) print(conn.list_nodes()) diff --git a/docs/examples/compute/create_key_pair.py b/docs/examples/compute/create_key_pair.py index d6f8bf7a8a..0f5cf1c81a 100644 --- a/docs/examples/compute/create_key_pair.py +++ b/docs/examples/compute/create_key_pair.py @@ -1,13 +1,13 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -EC2_ACCESS_ID = 'your access id' -EC2_SECRET_KEY = 'your secret key' +EC2_ACCESS_ID = "your access id" +EC2_SECRET_KEY = "your secret key" Driver = get_driver(Provider.EC2) conn = Driver(EC2_ACCESS_ID, EC2_SECRET_KEY) -key_pair = conn.create_key_pair(name='my-key-pair-1') +key_pair = conn.create_key_pair(name="my-key-pair-1") # Private key which provided generated on your behalf should be available # through key_pair.private_key attribute. diff --git a/docs/examples/compute/create_node.py b/docs/examples/compute/create_node.py index 9a645c84ea..281f0c9686 100644 --- a/docs/examples/compute/create_node.py +++ b/docs/examples/compute/create_node.py @@ -1,8 +1,8 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -RACKSPACE_USER = 'your username' -RACKSPACE_KEY = 'your key' +RACKSPACE_USER = "your username" +RACKSPACE_KEY = "your key" Driver = get_driver(Provider.RACKSPACE) conn = Driver(RACKSPACE_USER, RACKSPACE_KEY) @@ -14,6 +14,6 @@ # [, ...] # create node with first image and first size -node = conn.create_node(name='test', image=images[0], size=sizes[0]) +node = conn.create_node(name="test", image=images[0], size=sizes[0]) # diff --git a/docs/examples/compute/deployment_single_step_install_public_key.py b/docs/examples/compute/deployment_single_step_install_public_key.py index 787f8739dc..1bbe3d7e57 100644 --- a/docs/examples/compute/deployment_single_step_install_public_key.py +++ b/docs/examples/compute/deployment_single_step_install_public_key.py @@ -1,16 +1,17 @@ -from __future__ import with_statement - import os from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver from libcloud.compute.deployment import SSHKeyDeployment +# Path to the private SSH key file used to authenticate +PRIVATE_SSH_KEY_PATH = os.path.expanduser("~/.ssh/id_rsa") + # Path to the public key you would like to install -KEY_PATH = os.path.expanduser('~/.ssh/id_rsa.pub') +KEY_PATH = os.path.expanduser("~/.ssh/id_rsa.pub") -RACKSPACE_USER = 'your username' -RACKSPACE_KEY = 'your key' +RACKSPACE_USER = "your username" +RACKSPACE_KEY = "your key" Driver = get_driver(Provider.RACKSPACE) conn = Driver(RACKSPACE_USER, RACKSPACE_KEY) @@ -26,5 +27,10 @@ sizes = conn.list_sizes() # deploy_node takes the same base keyword arguments as create_node. -node = conn.deploy_node(name='test', image=images[0], size=sizes[0], - deploy=step) +node = conn.deploy_node( + name="test", + image=images[0], + size=sizes[0], + deploy=step, + ssh_key=PRIVATE_SSH_KEY_PATH, +) diff --git a/docs/examples/compute/digitalocean/__init__.py b/docs/examples/compute/digitalocean/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/digitalocean/create_api_v2.0.py b/docs/examples/compute/digitalocean/create_api_v2.0.py new file mode 100644 index 0000000000..473d9dc14a --- /dev/null +++ b/docs/examples/compute/digitalocean/create_api_v2.0.py @@ -0,0 +1,15 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +cls = get_driver(Provider.DIGITAL_OCEAN) + +driver = cls("access token", api_version="v2") + +options = {"backups": True, "private_networking": True, "ssh_keys": [123456, 123457]} + +name = "test.domain.tld" +size = driver.list_sizes()[0] +image = driver.list_images()[0] +location = driver.list_locations()[0] + +node = driver.create_node(name, size, image, location, ex_create_attr=options) diff --git a/docs/examples/compute/digitalocean/instantiate_api_v1.0.py b/docs/examples/compute/digitalocean/instantiate_api_v1.0.py deleted file mode 100644 index ea498d1934..0000000000 --- a/docs/examples/compute/digitalocean/instantiate_api_v1.0.py +++ /dev/null @@ -1,5 +0,0 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver - -cls = get_driver(Provider.DIGITAL_OCEAN) -driver = cls('client id', 'api key', api_version='v1') diff --git a/docs/examples/compute/digitalocean/instantiate_api_v2.0.py b/docs/examples/compute/digitalocean/instantiate_api_v2.0.py index c2c950a68a..a63ea96a63 100644 --- a/docs/examples/compute/digitalocean/instantiate_api_v2.0.py +++ b/docs/examples/compute/digitalocean/instantiate_api_v2.0.py @@ -3,7 +3,4 @@ cls = get_driver(Provider.DIGITAL_OCEAN) -driver = cls('access token', api_version='v2') -# Note: Driver defaults to v2.0 so api_version argument can be omitted and the -# following is the same -driver = cls('access token') +driver = cls("access token", api_version="v2") diff --git a/docs/examples/compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py b/docs/examples/compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py new file mode 100644 index 0000000000..831671c12d --- /dev/null +++ b/docs/examples/compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py @@ -0,0 +1,57 @@ +from pprint import pprint + +import libcloud.security +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +# Get dimension data driver +libcloud.security.VERIFY_SSL_CERT = True +cls = get_driver(Provider.DIMENSIONDATA) +driver = cls("myusername", "mypassword", region="dd-au") + +# Get location +location = driver.ex_get_location_by_id(id="AU9") + +# Get network domain by location +networkDomainName = "Test Apache Libcloud" +network_domains = driver.ex_list_network_domains(location=location) +my_network_domain = [d for d in network_domains if d.name == networkDomainName][0] + +vlan = driver.ex_list_vlans(name="Libcloud Test VLAN")[0] + +# Get Image +images = driver.ex_list_customer_images(location=location) +image = images[1] + +tags = driver.ex_list_tags() +pprint(tags) + +ex_tagname_value_pairs = {} +ex_tagname_value_pairs["AA_Tag1"] = "demo 1" +ex_tagname_value_pairs["AA_Tag2"] = "demo 2" + +ex_tagid_value_pairs = {} +ex_tagid_value_pairs["4927c8fd-7f41-4206-a7d5-c5def927c6d2"] = "demo 1" +ex_tagid_value_pairs["2579fc7c-a89c-47cd-ac3b-67999dded93b"] = "demo 2" + + +# Create node using vlan instead of private IPv4 +node = driver.ex_create_node_uncustomized( + name="test_server_05", + image=image, + ex_network_domain=my_network_domain, + ex_is_started=False, + ex_description=None, + ex_cluster_id=None, + ex_cpu_specification=None, + ex_memory_gb=None, + ex_primary_nic_private_ipv4=None, + ex_primary_nic_vlan=vlan, + ex_primary_nic_network_adapter=None, + ex_additional_nics=None, + ex_disks=None, + ex_tagid_value_pairs=ex_tagid_value_pairs, + ex_tagname_value_pairs=None, +) + +pprint(node) diff --git a/docs/examples/compute/dimensiondata/__init__.py b/docs/examples/compute/dimensiondata/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/ec2/__init__.py b/docs/examples/compute/ec2/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/ec2/create_general_purpose_ssd_volume.py b/docs/examples/compute/ec2/create_general_purpose_ssd_volume.py index d924103bdf..3240944f9b 100644 --- a/docs/examples/compute/ec2/create_general_purpose_ssd_volume.py +++ b/docs/examples/compute/ec2/create_general_purpose_ssd_volume.py @@ -1,8 +1,7 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -cls = get_driver(Provider.EC2, region='us-east-i1') -driver = cls('access key', 'secret key') +cls = get_driver(Provider.EC2) +driver = cls("access key", "secret key", region="us-east-i1") -volume = driver.create_volume(size=100, name='Test GP volume', - ex_volume_type='gp2') +volume = driver.create_volume(size=100, name="Test GP volume", ex_volume_type="gp2") diff --git a/docs/examples/compute/ec2/create_provisioned_iops_volume.py b/docs/examples/compute/ec2/create_provisioned_iops_volume.py index 6414790a30..5a72a43346 100644 --- a/docs/examples/compute/ec2/create_provisioned_iops_volume.py +++ b/docs/examples/compute/ec2/create_provisioned_iops_volume.py @@ -1,8 +1,7 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -cls = get_driver(Provider.EC2, region='us-east-i1') -driver = cls('access key', 'secret key') +cls = get_driver(Provider.EC2) +driver = cls("access key", "secret key", region="us-east-i1") -volume = driver.create_volume(size=100, name='Test IOPS volume', - ex_volume_type='io1', ex_iops=1000) +volume = driver.create_volume(size=100, name="Test IOPS volume", ex_volume_type="io1", ex_iops=1000) diff --git a/docs/examples/compute/ec2/temporary_credentials.py b/docs/examples/compute/ec2/temporary_credentials.py index b1e78e60b2..528fc06a1b 100644 --- a/docs/examples/compute/ec2/temporary_credentials.py +++ b/docs/examples/compute/ec2/temporary_credentials.py @@ -1,6 +1,10 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -cls = get_driver(Provider.EC2_US_WEST) -driver = cls('temporary access key', 'temporary secret key', - token='temporary session token') +cls = get_driver(Provider.EC2) +driver = cls( + "temporary access key", + "temporary secret key", + token="temporary session token", + region="us-west-1", +) diff --git a/docs/examples/compute/ecs/__init__.py b/docs/examples/compute/ecs/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/ecs/ex_list_security_groups.py b/docs/examples/compute/ecs/ex_list_security_groups.py new file mode 100644 index 0000000000..5622bb71a5 --- /dev/null +++ b/docs/examples/compute/ecs/ex_list_security_groups.py @@ -0,0 +1,15 @@ +import pprint + +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +ECSDriver = get_driver(Provider.ALIYUN_ECS) + +region = "cn-hangzhou" +access_key_id = "CHANGE IT" +access_key_secret = "CHANGE IT" + +driver = ECSDriver(access_key_id, access_key_secret, region=region) + +sec_groups = driver.ex_list_security_groups() +pprint.pprint(sec_groups) diff --git a/docs/examples/compute/ecs/list_images.py b/docs/examples/compute/ecs/list_images.py new file mode 100644 index 0000000000..3c5af59726 --- /dev/null +++ b/docs/examples/compute/ecs/list_images.py @@ -0,0 +1,15 @@ +import pprint + +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +ECSDriver = get_driver(Provider.ALIYUN_ECS) + +region = "cn-hangzhou" +access_key_id = "CHANGE IT" +access_key_secret = "CHANGE IT" + +driver = ECSDriver(access_key_id, access_key_secret, region=region) + +images = driver.list_images() +pprint.pprint(images) diff --git a/docs/examples/compute/ecs/list_locations.py b/docs/examples/compute/ecs/list_locations.py new file mode 100644 index 0000000000..3a395fd243 --- /dev/null +++ b/docs/examples/compute/ecs/list_locations.py @@ -0,0 +1,14 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +ECSDriver = get_driver(Provider.ALIYUN_ECS) + +region = "cn-hangzhou" +access_key_id = "CHANGE IT" +access_key_secret = "CHANGE IT" + +driver = ECSDriver(access_key_id, access_key_secret, region=region) + +locations = driver.list_locations() +for each in locations: + print("id: {:>16s}".format(each.id)) diff --git a/docs/examples/compute/ecs/list_sizes.py b/docs/examples/compute/ecs/list_sizes.py new file mode 100644 index 0000000000..563018521e --- /dev/null +++ b/docs/examples/compute/ecs/list_sizes.py @@ -0,0 +1,15 @@ +import pprint + +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +ECSDriver = get_driver(Provider.ALIYUN_ECS) + +region = "cn-hangzhou" +access_key_id = "CHANGE IT" +access_key_secret = "CHANGE IT" + +driver = ECSDriver(access_key_id, access_key_secret, region=region) + +sizes = driver.list_sizes() +pprint.pprint(sizes) diff --git a/docs/examples/compute/ecs/manage_nodes.py b/docs/examples/compute/ecs/manage_nodes.py new file mode 100644 index 0000000000..4cf9961dad --- /dev/null +++ b/docs/examples/compute/ecs/manage_nodes.py @@ -0,0 +1,60 @@ +from libcloud.compute.base import NodeAuthPassword +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +ECSDriver = get_driver(Provider.ALIYUN_ECS) + +region = "cn-hangzhou" +access_key_id = "CHANGE IT" +access_key_secret = "CHANGE IT" + +driver = ECSDriver(access_key_id, access_key_secret, region=region) + +# Query the size ecs.t1.small +sizes = driver.list_sizes() +t1_small = sizes[1] +# Query the first ubuntu OS image +images = driver.list_images() +for each in images: + if "ubuntu" in each.id.lower(): + ubuntu = each + break +else: + ubuntu = images[0] +# Query the default security group +sg = driver.ex_list_security_groups()[0] + +# Create a cloud type data disk which is 5GB and deleted with the node +data_disk = { + "size": 5, + "category": driver.disk_categories.CLOUD, + "disk_name": "data_disk1", + "delete_with_instance": True, +} + +# Set a password to access the guest OS +auth = NodeAuthPassword("P@$$w0rd") + +# Create the node +node = driver.create_node( + image=ubuntu, + size=t1_small, + name="test_node", + ex_security_group_id=sg.id, + ex_internet_charge_type=driver.internet_charge_types.BY_TRAFFIC, + ex_internet_max_bandwidth_out=1, + ex_data_disks=data_disk, + auth=auth, +) + +# Reboot the node +node.reboot() + +# Stop the node +driver.ex_stop_node(node) + +# Start the node +driver.ex_start_node(node) + +# Destroy the node +node.destroy() diff --git a/docs/examples/compute/ecs/manage_volumes_and_snapshots.py b/docs/examples/compute/ecs/manage_volumes_and_snapshots.py new file mode 100644 index 0000000000..16f6f5c18d --- /dev/null +++ b/docs/examples/compute/ecs/manage_volumes_and_snapshots.py @@ -0,0 +1,27 @@ +import time + +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +ECSDriver = get_driver(Provider.ALIYUN_ECS) + +region = "cn-hangzhou" +access_key_id = "CHANGE IT" +access_key_secret = "CHANGE IT" + +driver = ECSDriver(access_key_id, access_key_secret, region=region) + +node = driver.list_nodes()[0] +zone = driver.ex_list_zones()[0] + +new_volume = driver.create_volume( + size=5, + name="data_volume1", + ex_zone_id=zone.id, + ex_disk_category=driver.disk_categories.CLOUD, +) +driver.attach_volume(node, new_volume) +# Wait 10s for attaching finished +time.sleep(10) + +snapshot = driver.create_volume_snapshot(new_volume, name="data_volume1_snapshot1") diff --git a/docs/examples/compute/equinixmetal/__init__.py b/docs/examples/compute/equinixmetal/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/equinixmetal/instantiate_api_v1.0.py b/docs/examples/compute/equinixmetal/instantiate_api_v1.0.py new file mode 100644 index 0000000000..16b98acc0c --- /dev/null +++ b/docs/examples/compute/equinixmetal/instantiate_api_v1.0.py @@ -0,0 +1,10 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +cls = get_driver(Provider.EQUINIXMETAL) + +driver = cls("your API auth token") + +nodes = driver.list_nodes("project-id") +for node in nodes: + print(node) diff --git a/docs/examples/compute/example_compute.py b/docs/examples/compute/example_compute.py new file mode 100644 index 0000000000..3942095003 --- /dev/null +++ b/docs/examples/compute/example_compute.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Type, cast + +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver +from libcloud.compute.drivers.ec2 import EC2NodeDriver +from libcloud.compute.drivers.rackspace import RackspaceNodeDriver + +ec2_cls = get_driver(Provider.EC2) +rackspace_cls = get_driver(Provider.RACKSPACE) + +# NOTE: If you are using driver methods which are not part of the standard API, +# you need to explicitly cast the driver class reference to the correct class +# for type checking to work correctly +EC2 = cast(Type[EC2NodeDriver], ec2_cls) +Rackspace = cast(Type[RackspaceNodeDriver], rackspace_cls) + +drivers = [ + EC2("access key id", "secret key", region="us-east-1"), + Rackspace("username", "api key", region="iad"), +] + +nodes = [] +for driver in drivers: + nodes.extend(driver.list_nodes()) + +print(nodes) +# [ , +# , ... ] + +# grab the node named "test" +node = [n for n in nodes if n.name == "test"][0] + +# reboot "test" +node.reboot() diff --git a/docs/examples/compute/gandi/__init__.py b/docs/examples/compute/gandi/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/gandi/create_node.py b/docs/examples/compute/gandi/create_node.py new file mode 100644 index 0000000000..5176d5079a --- /dev/null +++ b/docs/examples/compute/gandi/create_node.py @@ -0,0 +1,18 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +Gandi = get_driver(Provider.GANDI) +driver = Gandi("api_key") + +image = [i for i in driver.list_images() if "Debian 8 64" in i.name][0] +size = [s for s in driver.list_sizes() if s.name == "Medium instance"][0] +location = [loc for loc in driver.list_locations() if loc.name == "FR-SD2"][0] + +node = driver.create_node( + name="yournode", + size=size, + image=image, + location=location, + login="youruser", + password="pass", +) diff --git a/docs/examples/compute/gce/__init__.py b/docs/examples/compute/gce/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/gce/deploy_node.py b/docs/examples/compute/gce/deploy_node.py new file mode 100644 index 0000000000..37ab4c0eca --- /dev/null +++ b/docs/examples/compute/gce/deploy_node.py @@ -0,0 +1,69 @@ +import os + +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver +from libcloud.compute.deployment import ScriptDeployment + +# Path to the private SSH key file used to authenticate +PRIVATE_SSH_KEY_PATH = os.path.expanduser("~/.ssh/id_rsa_gce") + +# Path to the public SSH key file which will be installed on the server for +# the root user +PUBLIC_SSH_KEY_PATH = os.path.expanduser("~/.ssh/id_rsa_gce.pub") + +with open(PUBLIC_SSH_KEY_PATH) as fp: + PUBLIC_SSH_KEY_CONTENT = fp.read().strip() + +# GCE authentication related info +SERVICE_ACCOUNT_USERNAME = "@.iam.gserviceaccount.com" +SERVICE_ACCOUNT_CREDENTIALS_JSON_FILE_PATH = "/path/to/sac.json" + +PROJECT_ID = "my-gcp-project" + +Driver = get_driver(Provider.GCE) +driver = Driver( + SERVICE_ACCOUNT_USERNAME, + SERVICE_ACCOUNT_CREDENTIALS_JSON_FILE_PATH, + project=PROJECT_ID, + datacenter="us-central1-a", +) + +step = ScriptDeployment("echo whoami ; date ; ls -la") + +images = driver.list_images() +sizes = driver.list_sizes() + +image = [i for i in images if i.name == "ubuntu-1604-xenial-v20191217"][0] +size = [s for s in sizes if s.name == "e2-micro"][0] + +print("Using image: %s" % (image)) +print("Using size: %s" % (size)) + +# NOTE: We specify which public key is installed on the instance using +# metadata functionality. +# Keep in mind that this step is only needed if you want to install a specific +# key which is used to run the deployment script. +# If you are using a VM image with a public SSH key already pre-baked in or if +# you use project wide ssh-keys GCP functionality, you can remove ex_metadata +# argument, but you still need to make sure the private key you use inside this +# script matches the one which is installed / available on the server. +ex_metadata = metadata = { + "items": [{"key": "ssh-keys", "value": "root: %s" % (PUBLIC_SSH_KEY_CONTENT)}] +} + +# deploy_node takes the same base keyword arguments as create_node. +node = driver.deploy_node( + name="libcloud-deploy-demo-1", + image=image, + size=size, + ex_metadata=metadata, + deploy=step, + ssh_key=PRIVATE_SSH_KEY_PATH, +) + +print("") +print("Node: %s" % (node)) +print("") +print("stdout: %s" % (step.stdout)) +print("stderr: %s" % (step.stderr)) +print("exit_code: %s" % (step.exit_status)) diff --git a/docs/examples/compute/gce/gce_datacenter.py b/docs/examples/compute/gce/gce_datacenter.py index d192d39e6d..1f648e2a3f 100644 --- a/docs/examples/compute/gce/gce_datacenter.py +++ b/docs/examples/compute/gce/gce_datacenter.py @@ -4,6 +4,9 @@ ComputeEngine = get_driver(Provider.GCE) # Datacenter is set to 'us-central1-a' as an example, but can be set to any # zone, like 'us-central1-b' or 'europe-west1-a' -driver = ComputeEngine('your_service_account_email', 'path_to_pem_file', - datacenter='us-central1-a', - project='your_project_id') +driver = ComputeEngine( + "your_service_account_email", + "path_to_pem_file", + datacenter="us-central1-a", + project="your_project_id", +) diff --git a/docs/examples/compute/gce/gce_installed_application.py b/docs/examples/compute/gce/gce_installed_application.py index d6a10ce224..b4fe229ab7 100644 --- a/docs/examples/compute/gce/gce_installed_application.py +++ b/docs/examples/compute/gce/gce_installed_application.py @@ -2,5 +2,9 @@ from libcloud.compute.providers import get_driver ComputeEngine = get_driver(Provider.GCE) -driver = ComputeEngine('your_client_id', 'your_client_secret', - project='your_project_id') +driver = ComputeEngine( + "your_client_id", + "your_client_secret", + datacenter="us-central1-a", + project="your_project_id", +) diff --git a/docs/examples/compute/gce/gce_internal_auth.py b/docs/examples/compute/gce/gce_internal_auth.py index 4118a74ba8..66f1605806 100644 --- a/docs/examples/compute/gce/gce_internal_auth.py +++ b/docs/examples/compute/gce/gce_internal_auth.py @@ -9,4 +9,4 @@ # You must still place placeholder empty strings for user_id / key # due to the nature of the driver's __init__() params. ComputeEngine = get_driver(Provider.GCE) -driver = ComputeEngine('', '', project='your_project_id') +driver = ComputeEngine("", "", project="your_project_id", datacenter="us-central1-a") diff --git a/docs/examples/compute/gce/gce_service_account.py b/docs/examples/compute/gce/gce_service_account.py index edc941515b..6f348f1e4e 100644 --- a/docs/examples/compute/gce/gce_service_account.py +++ b/docs/examples/compute/gce/gce_service_account.py @@ -4,5 +4,9 @@ ComputeEngine = get_driver(Provider.GCE) # Note that the 'PEM file' argument can either be the JSON format or # the P12 format. -driver = ComputeEngine('your_service_account_email', 'path_to_pem_file', - project='your_project_id') +driver = ComputeEngine( + "your_service_account_email", + "path_to_pem_file", + project="your_project_id", + datacenter="us-central1-a", +) diff --git a/docs/examples/compute/gce/gce_service_account_infile.py b/docs/examples/compute/gce/gce_service_account_infile.py new file mode 100644 index 0000000000..4dda35e7b0 --- /dev/null +++ b/docs/examples/compute/gce/gce_service_account_infile.py @@ -0,0 +1,13 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +credentials = { + "type": "service_account", + "project_id": "my_project", + "private_key": "-----BEGIN PRIVATE KEY-----\nmy_private_key_data\n" + "-----END PRIVATE KEY-----\n", + "client_email": "my_email", +} + +ComputeEngine = get_driver(Provider.GCE) +driver = ComputeEngine("your_service_account_email", credentials, project="your_project_id") diff --git a/docs/examples/compute/gce/gce_service_account_scopes.py b/docs/examples/compute/gce/gce_service_account_scopes.py index f5f9be9fd9..9c1f66eaf0 100644 --- a/docs/examples/compute/gce/gce_service_account_scopes.py +++ b/docs/examples/compute/gce/gce_service_account_scopes.py @@ -3,27 +3,22 @@ driver = None # Define common example attributes -s = 'n1-standard-1' -i = 'debian-7' -z = 'us-central1-a' +s = "n1-standard-1" +i = "debian-7" +z = "us-central1-a" # Service Account Scopes require a list of dictionaries. Each dictionary # can have an optional 'email' address specifying the Service Account # address, and list of 'scopes'. The default Service Account Scopes for # new nodes will effectively use: -sa_scopes = [ - { - 'email': 'default', - 'scopes': ['storage-ro'] - } -] +sa_scopes = [{"email": "default", "scopes": ["storage-ro"]}] # The expected scenario will likely use the default Service Account email # address, but allow users to override the default list of scopes. # For example, create a new node with full access to Google Cloud Storage # and Google Compute Engine: -sa_scopes = [{'scopes': ['compute', 'storage-full']}] +sa_scopes = [{"scopes": ["compute", "storage-full"]}] node_1 = driver.create_node("n1", s, i, z, ex_service_accounts=sa_scopes) # See Google's documentation for Accessing other Google Cloud services from diff --git a/docs/examples/compute/gridscale/create_node.py b/docs/examples/compute/gridscale/create_node.py new file mode 100644 index 0000000000..e68a73d1f6 --- /dev/null +++ b/docs/examples/compute/gridscale/create_node.py @@ -0,0 +1,39 @@ +from libcloud.compute.base import NodeSize +from libcloud.compute.type import Provider +from libcloud.compute.providers import get_driver + +cls = get_driver(Provider.GRIDSCALE) +driver = cls("USER-UUID", "API-TOKEN") + +# We don't feature packages containing a fix size so you will have to +# built your own size object. Make sure to use a multiple of 1024MB when +# asigning RAM +size_name = "my-node-size" +ram = 1024 # amout of ram In MB +disk = 10 # disk size in GB +cores = 1 # numer of cores node should have +size = NodeSize( + id=0, + bandwidth=0, + price=0, + name=size_name, + ram=ram, + disk=disk, + driver=driver, + extra={"cores": cores}, +) + +ssh_key = driver.list_key_pairs()[0] +ssh_key_uuid = ssh_key.fingerprint + +node_name = "MyServer" + +images = driver.list_images() +image = [i for i in images if i.name == "Ubuntu 18.04 LTS"][0] + +locations = driver.list_locations() +location = [loc for loc in locations if loc.name == "de/fra"][0] + +node = driver.create_node( + name=node_name, size=size, image=image, location=location, ex_ssh_key_ids=ssh_key +) diff --git a/docs/examples/compute/gridscale/deploy_node.py b/docs/examples/compute/gridscale/deploy_node.py new file mode 100644 index 0000000000..678c15020f --- /dev/null +++ b/docs/examples/compute/gridscale/deploy_node.py @@ -0,0 +1,70 @@ +import os + +from libcloud.compute.base import NodeSize +from libcloud.compute.type import Provider +from libcloud.compute.providers import get_driver +from libcloud.compute.deployment import ScriptDeployment + +cls = get_driver(Provider.GRIDSCALE) +driver = cls("USER-UUID", "API-TOKEN") + +# We don't feature packages containing a fix size so you will have to +# built your own size object. Make sure to use a multiple of 1024MB when +# asigning RAM +size_name = "my-node-size" +ram = 1024 # amout of ram In MB +disk = 10 # disk size in GB +cores = 1 # numer of cores node should have +size = NodeSize( + id=0, + bandwidth=0, + price=0, + name=size_name, + ram=ram, + disk=disk, + driver=driver, + extra={"cores": cores}, +) + +ssh_key = driver.list_key_pairs()[0] +ssh_key_uuid = ssh_key.fingerprint + +node_name = "MyServer" + +images = driver.list_images() +image = [i for i in images if i.name == "Ubuntu 18.04 LTS"][0] + +locations = driver.list_locations() +location = [loc for loc in locations if loc.name == "de/fra"][0] + +# Check if a key pair object with the provided name already exists +# If it already exists, using an existing key, otherwise import a new one +key_pair_name = "libcloud-key-pair" +key_pairs = driver.list_key_pairs() +key_pairs = [kp for kp in key_pairs if kp.name == key_pair_name] + +public_key_file_path = os.path.expanduser("~/.ssh/id_rsa_gridscale.pub") +private_key_file_path = os.path.expanduser("~/.ssh/id_rsa_gridscale") + +if key_pairs: + print("Re-using existing SSH Key") + key_pair = key_pairs[0] +else: + print("Importing / creating new SSH Key") + key_pair = driver.import_key_pair_from_file( + name=key_pair_name, key_file_path=public_key_file_path + ) # NOQA + + +step = ScriptDeployment("echo whoami ; date ; ls -la") + +node = driver.deploy_node( + name=node_name, + size=size, + image=image, + location=location, + ex_ssh_key_ids=[key_pair.fingerprint], + deploy=step, + ssh_key=private_key_file_path, +) +print(node) diff --git a/docs/examples/compute/gridscale/instantiate_driver.py b/docs/examples/compute/gridscale/instantiate_driver.py new file mode 100644 index 0000000000..fe0ed1cd15 --- /dev/null +++ b/docs/examples/compute/gridscale/instantiate_driver.py @@ -0,0 +1,6 @@ +from libcloud.compute.type import Provider +from libcloud.compute.providers import get_driver + +driver = get_driver(Provider.GRIDSCALE) + +driver = driver("USER-UUID", "API-TOKEN") diff --git a/docs/examples/compute/import_key_pair_from_file.py b/docs/examples/compute/import_key_pair_from_file.py index 2079cef991..8d7ce0872a 100644 --- a/docs/examples/compute/import_key_pair_from_file.py +++ b/docs/examples/compute/import_key_pair_from_file.py @@ -3,12 +3,11 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -EC2_ACCESS_ID = 'your access id' -EC2_SECRET_KEY = 'your secret key' +EC2_ACCESS_ID = "your access id" +EC2_SECRET_KEY = "your secret key" Driver = get_driver(Provider.EC2) conn = Driver(EC2_ACCESS_ID, EC2_SECRET_KEY) -key_file_path = os.path.expanduser('~/.ssh/id_rsa_my_key_pair_1.pub') -key_pair = conn.import_key_pair_from_file(name='my_key', - key_file_path=key_file_path) +key_file_path = os.path.expanduser("~/.ssh/id_rsa_my_key_pair_1.pub") +key_pair = conn.import_key_pair_from_file(name="my_key", key_file_path=key_file_path) diff --git a/docs/examples/compute/import_key_pair_from_string.py b/docs/examples/compute/import_key_pair_from_string.py index b465449532..6a79ccfbcb 100644 --- a/docs/examples/compute/import_key_pair_from_string.py +++ b/docs/examples/compute/import_key_pair_from_string.py @@ -1,20 +1,17 @@ -from __future__ import with_statement - import os from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -EC2_ACCESS_ID = 'your access id' -EC2_SECRET_KEY = 'your secret key' +EC2_ACCESS_ID = "your access id" +EC2_SECRET_KEY = "your secret key" Driver = get_driver(Provider.EC2) conn = Driver(EC2_ACCESS_ID, EC2_SECRET_KEY) -key_file_path = os.path.expanduser('~/.ssh/id_rsa_my_key_pair_1.pub') +key_file_path = os.path.expanduser("~/.ssh/id_rsa_my_key_pair_1.pub") -with open(key_file_path, 'r') as fp: +with open(key_file_path) as fp: key_material = fp.read() -key_pair = conn.import_key_pair_from_string(name='my_key', - key_material=key_material) +key_pair = conn.import_key_pair_from_string(name="my_key", key_material=key_material) diff --git a/docs/examples/compute/internetsolutions/__init__.py b/docs/examples/compute/internetsolutions/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/internetsolutions/instantiate_driver.py b/docs/examples/compute/internetsolutions/instantiate_driver.py new file mode 100644 index 0000000000..3cd4b3f072 --- /dev/null +++ b/docs/examples/compute/internetsolutions/instantiate_driver.py @@ -0,0 +1,9 @@ +from pprint import pprint + +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +cls = get_driver(Provider.INTERNETSOLUTIONS) +driver = cls("my username", "my password", region="is-af") + +pprint(driver.list_nodes()) diff --git a/docs/examples/compute/kamatera/create_node.py b/docs/examples/compute/kamatera/create_node.py new file mode 100644 index 0000000000..3a41d40ed4 --- /dev/null +++ b/docs/examples/compute/kamatera/create_node.py @@ -0,0 +1,154 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +cls = get_driver(Provider.KAMATERA) +driver = cls("KAMATERA API CLIENT ID", "KAMATERA API SECRET") + +# select a location + +locations = {location.id: location for location in driver.list_locations()} +for location in locations.values(): + print(location) + +# , 'dailybackup': False, +# 'managed': False} + +# list all nodes with full details (slower operation) + +nodes = driver.list_nodes(ex_full_details=True) + +node = nodes[0] + +# run operations + +driver.start_node(node) +driver.stop_node(node) +driver.reboot_node(node) +driver.destroy_node(node) diff --git a/docs/examples/compute/libvirt/__init__.py b/docs/examples/compute/libvirt/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/libvirt/connect_qemu_kvm.py b/docs/examples/compute/libvirt/connect_qemu_kvm.py index 775ddd2b40..ac4dfd99a9 100644 --- a/docs/examples/compute/libvirt/connect_qemu_kvm.py +++ b/docs/examples/compute/libvirt/connect_qemu_kvm.py @@ -2,4 +2,4 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.LIBVIRT) -driver = cls(uri='qemu:///system') +driver = cls(uri="qemu:///system") diff --git a/docs/examples/compute/libvirt/connect_virtualbox.py b/docs/examples/compute/libvirt/connect_virtualbox.py index af2c3de197..760d2bf13f 100644 --- a/docs/examples/compute/libvirt/connect_virtualbox.py +++ b/docs/examples/compute/libvirt/connect_virtualbox.py @@ -2,4 +2,4 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.LIBVIRT) -driver = cls(uri='vbox:///session') +driver = cls(uri="vbox:///session") diff --git a/docs/examples/compute/list_nodes.py b/docs/examples/compute/list_nodes.py index 97afdcf6c0..f320269ec1 100644 --- a/docs/examples/compute/list_nodes.py +++ b/docs/examples/compute/list_nodes.py @@ -1,8 +1,8 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -EC2_ACCESS_ID = 'your access id' -EC2_SECRET_KEY = 'your secret key' +EC2_ACCESS_ID = "your access id" +EC2_SECRET_KEY = "your secret key" Driver = get_driver(Provider.EC2) conn = Driver(EC2_ACCESS_ID, EC2_SECRET_KEY) diff --git a/docs/examples/compute/list_nodes_across_multiple_providers.py b/docs/examples/compute/list_nodes_across_multiple_providers.py index f8ebb0c64f..ae2ccbb0bf 100644 --- a/docs/examples/compute/list_nodes_across_multiple_providers.py +++ b/docs/examples/compute/list_nodes_across_multiple_providers.py @@ -1,23 +1,25 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -EC2_ACCESS_ID = 'your access id' -EC2_SECRET_KEY = 'your secret key' -RACKSPACE_USER = 'your username' -RACKSPACE_KEY = 'your key' +EC2_ACCESS_ID = "your access id" +EC2_SECRET_KEY = "your secret key" +RACKSPACE_USER = "your username" +RACKSPACE_KEY = "your key" EC2Driver = get_driver(Provider.EC2) RackspaceDriver = get_driver(Provider.RACKSPACE) -drivers = [EC2Driver(EC2_ACCESS_ID, EC2_SECRET_KEY), - RackspaceDriver(RACKSPACE_USER, RACKSPACE_KEY)] +drivers = [ + EC2Driver(EC2_ACCESS_ID, EC2_SECRET_KEY), + RackspaceDriver(RACKSPACE_USER, RACKSPACE_KEY), +] nodes = [] for driver in drivers: nodes += driver.list_nodes() -print nodes +print(nodes) # [ , # , ... ] # Reboot all nodes named 'test' -[node.reboot() for node in nodes if node.name == 'test'] +[node.reboot() for node in nodes if node.name == "test"] diff --git a/docs/examples/compute/ntta/__init__.py b/docs/examples/compute/ntta/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/ntta/instantiate_driver.py b/docs/examples/compute/ntta/instantiate_driver.py new file mode 100644 index 0000000000..406ba728af --- /dev/null +++ b/docs/examples/compute/ntta/instantiate_driver.py @@ -0,0 +1,9 @@ +from pprint import pprint + +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +cls = get_driver(Provider.NTTA) +driver = cls("my username", "my password", region="ntta-na") + +pprint(driver.list_nodes()) diff --git a/docs/examples/compute/nttcis/Firewall_Create_Complex_Firewall_Rule.py b/docs/examples/compute/nttcis/Firewall_Create_Complex_Firewall_Rule.py new file mode 100644 index 0000000000..3de3555984 --- /dev/null +++ b/docs/examples/compute/nttcis/Firewall_Create_Complex_Firewall_Rule.py @@ -0,0 +1,73 @@ +import libcloud.security +from libcloud.common.nttcis import NttCisPort, NttCisIpAddress, NttCisFirewallAddress +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +# Get nttcis driver +libcloud.security.VERIFY_SSL_CERT = True +cls = get_driver(Provider.NTTCIS) +driver = cls("myusername", "mypassword", region="eu") +# Get location +location = driver.ex_get_location_by_id(id="EU6") + +# Get network domain by location +networkDomainName = "sdk_test_1" +network_domains = driver.ex_list_network_domains(location=location.id) +my_network_domain = [d for d in network_domains if d.name == networkDomainName][0] + +# Create an instance of NttCisFirewallAddress for source +source_firewall_address = NttCisFirewallAddress(any_ip="ANY") + +# Create an instance of NttCisIpAddress for an Address List for the destination +address_list_name = "sdk_test_address_list" +description = "A test address list" +ip_version = "IPV4" +# An optional prefix list can be specified as a named argument, prefix_size= +address_obj = [NttCisIpAddress("10.2.0.1", end="10.2.0.11")] + +result = driver.ex_create_ip_address_list( + my_network_domain.id, address_list_name, description, ip_version, address_obj +) + +try: + assert result is True +except Exception: + raise RuntimeError("Something went wrong in address list creation.") +else: + addr_list = driver.ex_list_ip_address_list(my_network_domain.id) + addr_list = [al for al in addr_list if al.name == address_list_name][0] + +# Instead of a single port or list of ports, create a port +# list for the destianation +port_list_name = "sdk_test_port_list" +description = "A test port list" + +# rerquires an instance of NttCisPort object +ports = [NttCisPort(begin="8000", end="8080")] +result = driver.ex_create_portlist(my_network_domain.id, port_list_name, description, ports) + +try: + assert result is True +except Exception: + raise RuntimeError("Something went wrong in address list creation.") +else: + port_list = driver.ex_list_portlist(my_network_domain.id) + port_list = [pl for pl in port_list if pl.name == port_list_name][0] + +# Create an instance of NttCisFirewallAddress for destination +dest_firewall_address = NttCisFirewallAddress( + address_list_id=addr_list.id, port_list_id=port_list.id +) + +# Finally create firewall rule +rule = driver.ex_create_firewall_rule( + my_network_domain.id, + "sdk_test_firewall_rule", + "ACCEPT_DECISIVELY", + "IPV4", + "TCP", + source_firewall_address, + dest_firewall_address, + "LAST", +) +print(rule) diff --git a/docs/examples/compute/nttcis/Firewall_Create_Simple_Rule.py b/docs/examples/compute/nttcis/Firewall_Create_Simple_Rule.py new file mode 100644 index 0000000000..f530864649 --- /dev/null +++ b/docs/examples/compute/nttcis/Firewall_Create_Simple_Rule.py @@ -0,0 +1,31 @@ +from pprint import pprint + +import libcloud.security +from libcloud.common.nttcis import NttCisFirewallAddress +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +# Get nttcis driver +libcloud.security.VERIFY_SSL_CERT = True +cls = get_driver(Provider.NTTCIS) +driver = cls("myusername", "mypassword", region="eu") + +domain_name = "sdk_test_1" +domains = driver.ex_list_network_domains(location="EU6") +net_domain = [d for d in domains if d.name == domain_name] +source_firewall_address = NttCisFirewallAddress(any_ip="ANY") +dest_firewall_address = NttCisFirewallAddress( + ip_address="10.2.0.0", ip_prefix_size="16", port_begin="8000", port_end="8080" +) + +rule = driver.ex_create_firewall_rule( + net_domain[0], + "sdk_test_firewall_rule_2", + "ACCEPT_DECISIVELY", + "IPV4", + "TCP", + source_firewall_address, + dest_firewall_address, + "LAST", +) +pprint(rule) diff --git a/docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py b/docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py new file mode 100644 index 0000000000..6160963f48 --- /dev/null +++ b/docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py @@ -0,0 +1,30 @@ +import libcloud.security +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +# Get nttcis driver +libcloud.security.VERIFY_SSL_CERT = True +cls = get_driver(Provider.NTTCIS) +driver = cls("myusername", "mypassword", region="eu") +image_name = "SLES 12 64-bit" +images = driver.list_images(location="EU6") +image = [i for i in images if i.name == image_name][0] +domain_name = "test_1" +domains = driver.ex_list_network_domains(location="EU6") +net_domain = [d for d in domains if d.name == domain_name][0] +psswd = "mypassword123!" +vlan_name = "vlan1" +vlans = driver.ex_list_vlans() +vlan = [v for v in vlans if v.name == vlan_name][0] +new_node = driver.create_node( + name="Suse_12", + size=None, + image=image, + auth=psswd, + ex_description="Customized_Suse server", + ex_network_domain=net_domain, + ex_primary_nic_vlan=vlan, + ex_primary_nic_network_adapter="VMXNET3", + ex_memory_gb=8, +) +driver.ex_wait_for_state("running", driver.ex_get_node_by_id, 20, 420, new_node.id) diff --git a/docs/examples/compute/nttcis/Nodes_Create_mcp2_Uncustomised.py b/docs/examples/compute/nttcis/Nodes_Create_mcp2_Uncustomised.py new file mode 100644 index 0000000000..2cb77cfc0c --- /dev/null +++ b/docs/examples/compute/nttcis/Nodes_Create_mcp2_Uncustomised.py @@ -0,0 +1,57 @@ +from pprint import pprint + +import libcloud.security +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +# Get nttcis driver +libcloud.security.VERIFY_SSL_CERT = True +cls = get_driver(Provider.NTTCIS) +driver = cls("myusername", "mypassword", region="eu") + +# Get location +location = driver.ex_get_location_by_id(id="EU7") + +# Get network domain by location +networkDomainName = "Test Apache Libcloud" +network_domains = driver.ex_list_network_domains(location=location) +my_network_domain = [d for d in network_domains if d.name == networkDomainName][0] + +vlan = driver.ex_list_vlans(name="Libcloud Test VLAN")[0] + +# Get Image +images = driver.ex_list_customer_images(location=location) +image = images[1] + +tags = driver.ex_list_tags() +pprint(tags) + +ex_tagname_value_pairs = {} +ex_tagname_value_pairs["AA_Tag1"] = "demo 1" +ex_tagname_value_pairs["AA_Tag2"] = "demo 2" + +ex_tagid_value_pairs = {} +ex_tagid_value_pairs["4927c8fd-7f41-4206-a7d5-c5def927c6d2"] = "demo 1" +ex_tagid_value_pairs["2579fc7c-a89c-47cd-ac3b-67999dded93b"] = "demo 2" + + +# Create node using vlan instead of private IPv4 +node = driver.ex_create_node_uncustomized( + name="test_server_05", + image=image, + ex_network_domain=my_network_domain, + ex_is_started=False, + ex_description=None, + ex_cluster_id=None, + ex_cpu_specification=None, + ex_memory_gb=None, + ex_primary_nic_private_ipv4=None, + ex_primary_nic_vlan=vlan, + ex_primary_nic_network_adapter=None, + ex_additional_nics=None, + ex_disks=None, + ex_tagid_value_pairs=ex_tagid_value_pairs, + ex_tagname_value_pairs=None, +) + +pprint(node) diff --git a/docs/examples/compute/nttcis/__init__.py b/docs/examples/compute/nttcis/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/onapp/__init__.py b/docs/examples/compute/onapp/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/onapp/functionality.py b/docs/examples/compute/onapp/functionality.py new file mode 100644 index 0000000000..9e40815b8a --- /dev/null +++ b/docs/examples/compute/onapp/functionality.py @@ -0,0 +1,96 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +# +# Instantiate driver +# +username = "your account username" +password = "your account password" +host = "onapp.test" + +cls = get_driver(Provider.ONAPP) +driver = cls(key=username, secret=password, host=host) + +# +# Create node +# +name = "virtual_servers_name" # user-friendly VS description +memory = 2 * 1024 # amount of RAM assigned to the VS in MB +cpus = 2 # number of CPUs assigned to the VS +cpu_shares = 100 +# For KVM hypervisor the CPU priority value is always 100. For XEN, set a +# custom value. The default value for XEN is 1 +hostname = "vshostname" # set the host name for this VS +template_id = 8 # the ID of a template from which a VS should be built +primary_disk_size = 100 # set the disk space for this VS +swap_disk_size = None # set swap space + +# optional parameter, but recommended +rate_limit = None +# set max port speed. If none set, the system sets port speed to unlimited + +node = driver.create_node( + name=name, + size=None, + image=None, + ex_memory=memory, + ex_cpus=cpus, + ex_cpu_shares=cpu_shares, + ex_hostname=hostname, + ex_template_id=template_id, + ex_primary_disk_size=primary_disk_size, + ex_swap_disk_size=swap_disk_size, + ex_rate_limit=rate_limit, +) + +# +# List nodes +# +for node in driver.list_nodes(): + print(node) + +# +# Destroy node +# +identifier = "nodesidentifier" + +(node,) = (n for n in driver.list_nodes() if n.id == identifier) + +driver.destroy_node(node) + +# +# List images +# +for image in driver.list_images(): + print(image) + +# +# List key pairs +# +for key_pair in driver.list_key_pairs(): + print(key_pair) + +# +# Get key pair +# +id = 2 # ID of key pair +key_pair = driver.get_key_pair(id) +print(key_pair) + +# +# Import key pair from string +# +name = "example" # this param is unused +key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8uuUq..." +key_pair = driver.import_key_pair_from_string(name, key) + +# +# Import key pair from file +# +driver.import_key_pair_from_file("example", "~/.ssh/id_rsa.pub") + +# +# Delete key pair +# +key_pair = driver.list_key_pairs()[0] +driver.delete_key_pair(key_pair) diff --git a/docs/examples/compute/openstack/__init__.py b/docs/examples/compute/openstack/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/openstack/auth_cache.py b/docs/examples/compute/openstack/auth_cache.py new file mode 100644 index 0000000000..649a41a822 --- /dev/null +++ b/docs/examples/compute/openstack/auth_cache.py @@ -0,0 +1,21 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver +from libcloud.common.openstack_identity import OpenStackAuthenticationCache + + +class MyAuthenticationCache(OpenStackAuthenticationCache): + pass # implement... + + +auth_cache = MyAuthenticationCache(...) + +OpenStack = get_driver(Provider.OPENSTACK) +driver = OpenStack( + "your_auth_username", + "your_auth_password", + ex_force_auth_url="http://192.168.1.101:5000", + ex_force_auth_version="3.x_password", + ex_auth_cache=auth_cache, +) + +driver.list_sizes() diff --git a/docs/examples/compute/openstack/cloud_init.py b/docs/examples/compute/openstack/cloud_init.py index 5aafb92768..1ababab97e 100644 --- a/docs/examples/compute/openstack/cloud_init.py +++ b/docs/examples/compute/openstack/cloud_init.py @@ -1,7 +1,6 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver - cloud_init_config = """ #cloud-config @@ -17,12 +16,20 @@ OpenStack = get_driver(Provider.OPENSTACK) -driver = OpenStack('your_auth_username', 'your_auth_password', - ex_force_auth_url='http://192.168.1.101:5000', - ex_force_auth_version='2.0_password') - -image = driver.get_image('image_id') +driver = OpenStack( + "your_auth_username", + "your_auth_password", + ex_force_auth_url="http://192.168.1.101:5000", + ex_force_auth_version="2.0_password", +) + +image = driver.get_image("image_id") size = driver.list_sizes()[0] -node = driver.create_node(name='cloud_init', image=image, size=size, - ex_userdata=cloud_init_config, ex_config_drive=True) +node = driver.create_node( + name="cloud_init", + image=image, + size=size, + ex_userdata=cloud_init_config, + ex_config_drive=True, +) diff --git a/docs/examples/compute/openstack/custom_service_catalog_selection_args.py b/docs/examples/compute/openstack/custom_service_catalog_selection_args.py index 663a3d8f79..b967c9b02f 100644 --- a/docs/examples/compute/openstack/custom_service_catalog_selection_args.py +++ b/docs/examples/compute/openstack/custom_service_catalog_selection_args.py @@ -1,8 +1,7 @@ +import libcloud.security from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -import libcloud.security - # This assumes you don't have SSL set up. # Note: Code like this poses a security risk (MITM attack) and # that's the reason why you should never use it for anything else @@ -10,9 +9,12 @@ libcloud.security.VERIFY_SSL_CERT = False OpenStack = get_driver(Provider.OPENSTACK) -driver = OpenStack('your_auth_username', 'your_auth_password', - ex_force_auth_url='http://192.168.1.101:5000', - ex_force_auth_version='2.0_password', - ex_force_service_type='compute', - ex_force_service_name='novaCompute', - ex_force_service_region='MyRegion') +driver = OpenStack( + "your_auth_username", + "your_auth_password", + ex_force_auth_url="http://192.168.1.101:5000", + ex_force_auth_version="2.0_password", + ex_force_service_type="compute", + ex_force_service_name="novaCompute", + ex_force_service_region="MyRegion", +) diff --git a/docs/examples/compute/openstack/force_auth_token.py b/docs/examples/compute/openstack/force_auth_token.py index f926186786..1b7e31e0b5 100644 --- a/docs/examples/compute/openstack/force_auth_token.py +++ b/docs/examples/compute/openstack/force_auth_token.py @@ -1,8 +1,7 @@ +import libcloud.security from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -import libcloud.security - # This assumes you don't have SSL set up. # Note: Code like this poses a security risk (MITM attack) and # that's the reason why you should never use it for anything else @@ -10,7 +9,10 @@ libcloud.security.VERIFY_SSL_CERT = False OpenStack = get_driver(Provider.OPENSTACK) -driver = OpenStack('your_auth_username', 'your_auth_password', - ex_force_auth_url='http://192.168.1.101:5000', - ex_force_auth_version='2.0_password', - ex_force_auth_token='authtoken') +driver = OpenStack( + "your_auth_username", + "your_auth_password", + ex_force_auth_url="http://192.168.1.101:5000", + ex_force_auth_version="2.0_password", + ex_force_auth_token="authtoken", +) diff --git a/docs/examples/compute/openstack/force_base_url.py b/docs/examples/compute/openstack/force_base_url.py index 797df23bb1..4008e709e5 100644 --- a/docs/examples/compute/openstack/force_base_url.py +++ b/docs/examples/compute/openstack/force_base_url.py @@ -1,8 +1,7 @@ +import libcloud.security from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -import libcloud.security - # This assumes you don't have SSL set up. # Note: Code like this poses a security risk (MITM attack) and # that's the reason why you should never use it for anything else @@ -10,7 +9,10 @@ libcloud.security.VERIFY_SSL_CERT = False OpenStack = get_driver(Provider.OPENSTACK) -driver = OpenStack('your_auth_username', 'your_auth_password', - ex_force_auth_url='http://192.168.1.101:5000', - ex_force_auth_version='2.0_password', - ex_force_base_url='http://192.168.1.101:3000/v1/12345') +driver = OpenStack( + "your_auth_username", + "your_auth_password", + ex_force_auth_url="http://192.168.1.101:5000", + ex_force_auth_version="2.0_password", + ex_force_base_url="http://192.168.1.101:3000/v1/12345", +) diff --git a/docs/examples/compute/openstack/hpcloud.py b/docs/examples/compute/openstack/hpcloud.py index cbfda3d9a1..68ebe232ee 100644 --- a/docs/examples/compute/openstack/hpcloud.py +++ b/docs/examples/compute/openstack/hpcloud.py @@ -1,25 +1,29 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -HPCLOUD_AUTH_URL_USWEST = \ - 'https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens' -HPCLOUD_AUTH_URL_USEAST = \ - 'https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens' +HPCLOUD_AUTH_URL_USWEST = "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens" +HPCLOUD_AUTH_URL_USEAST = "https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens" OpenStack = get_driver(Provider.OPENSTACK) # HP Cloud US West -driver = OpenStack('your_auth_username', 'your_auth_password', - ex_force_auth_version='2.0_password', - ex_force_auth_url=HPCLOUD_AUTH_URL_USWEST, - ex_tenant_name='your_tenant_name', - ex_force_service_region='region-a.geo-1', - ex_force_service_name='Compute') +driver = OpenStack( + "your_auth_username", + "your_auth_password", + ex_force_auth_version="2.0_password", + ex_force_auth_url=HPCLOUD_AUTH_URL_USWEST, + ex_tenant_name="your_tenant_name", + ex_force_service_region="region-a.geo-1", + ex_force_service_name="Compute", +) # HP Cloud US East -driver = OpenStack('your_auth_username', 'your_auth_password', - ex_force_auth_version='2.0_password', - ex_force_auth_url=HPCLOUD_AUTH_URL_USEAST, - ex_tenant_name='your_tenant_name', - ex_force_service_region='region-b.geo-1', - ex_force_service_name='Compute') +driver = OpenStack( + "your_auth_username", + "your_auth_password", + ex_force_auth_version="2.0_password", + ex_force_auth_url=HPCLOUD_AUTH_URL_USEAST, + ex_tenant_name="your_tenant_name", + ex_force_service_region="region-b.geo-1", + ex_force_service_name="Compute", +) diff --git a/docs/examples/compute/openstack/hpcloud_native.py b/docs/examples/compute/openstack/hpcloud_native.py index 592d18914a..61daac9fbf 100644 --- a/docs/examples/compute/openstack/hpcloud_native.py +++ b/docs/examples/compute/openstack/hpcloud_native.py @@ -1,13 +1,11 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver - -USERNAME = 'your account username' -PASSWORD = 'your account password' -TENANT_NAME = 'project name' -REGION = 'region-b.geo-1' +USERNAME = "your account username" +PASSWORD = "your account password" +TENANT_NAME = "project name" +REGION = "region-b.geo-1" cls = get_driver(Provider.HPCLOUD) -driver = cls(USERNAME, PASSWORD, tenant_name=TENANT_NAME, - region=REGION) +driver = cls(USERNAME, PASSWORD, tenant_name=TENANT_NAME, region=REGION) print(driver.list_nodes()) diff --git a/docs/examples/compute/openstack/kilicloud_native.py b/docs/examples/compute/openstack/kilicloud_native.py deleted file mode 100644 index 2c83e12fb6..0000000000 --- a/docs/examples/compute/openstack/kilicloud_native.py +++ /dev/null @@ -1,10 +0,0 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver - -USERNAME = 'your account username' -PASSWORD = 'your account password' -TENANT_NAME = 'project name' - -cls = get_driver(Provider.KILI) -driver = cls(USERNAME, PASSWORD, tenant_name=TENANT_NAME) -print(driver.list_nodes()) diff --git a/docs/examples/compute/openstack/simple_auth.py b/docs/examples/compute/openstack/simple_auth.py index 8a5ea791f6..aec754c12e 100644 --- a/docs/examples/compute/openstack/simple_auth.py +++ b/docs/examples/compute/openstack/simple_auth.py @@ -1,8 +1,7 @@ +import libcloud.security from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -import libcloud.security - # This assumes you don't have SSL set up. # Note: Code like this poses a security risk (MITM attack) and # that's the reason why you should never use it for anything else @@ -10,6 +9,9 @@ libcloud.security.VERIFY_SSL_CERT = False OpenStack = get_driver(Provider.OPENSTACK) -driver = OpenStack('your_auth_username', 'your_auth_password', - ex_force_auth_url='http://192.168.1.101:5000', - ex_force_auth_version='2.0_password') +driver = OpenStack( + "your_auth_username", + "your_auth_password", + ex_force_auth_url="http://192.168.1.101:5000", + ex_force_auth_version="2.0_password", +) diff --git a/docs/examples/compute/openstack/tenant_name.py b/docs/examples/compute/openstack/tenant_name.py index bc5d7f4c91..b32b4b13ef 100644 --- a/docs/examples/compute/openstack/tenant_name.py +++ b/docs/examples/compute/openstack/tenant_name.py @@ -1,9 +1,11 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver - OpenStack = get_driver(Provider.OPENSTACK) -driver = OpenStack('your_auth_username', 'your_auth_password', - ex_tenant_name='mytenant', - ex_force_auth_url='http://192.168.1.101:5000', - ex_force_auth_version='2.0_password') +driver = OpenStack( + "your_auth_username", + "your_auth_password", + ex_tenant_name="mytenant", + ex_force_auth_url="http://192.168.1.101:5000", + ex_force_auth_version="2.0_password", +) diff --git a/docs/examples/compute/openstack_floating_ips.py b/docs/examples/compute/openstack_floating_ips.py index 9f7eb76738..b713365918 100644 --- a/docs/examples/compute/openstack_floating_ips.py +++ b/docs/examples/compute/openstack_floating_ips.py @@ -1,8 +1,7 @@ +import libcloud.security from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -import libcloud.security - # This assumes you don't have SSL set up. # Note: Code like this poses a security risk (MITM attack) and # that's the reason why you should never use it for anything else @@ -10,10 +9,13 @@ libcloud.security.VERIFY_SSL_CERT = False OpenStack = get_driver(Provider.OPENSTACK) -driver = OpenStack('your_auth_username', 'your_auth_password', - ex_force_auth_url='http://10.0.4.1:5000', - ex_force_auth_version='2.0_password', - ex_tenant_name='your_tenant') +driver = OpenStack( + "your_auth_username", + "your_auth_password", + ex_force_auth_url="http://10.0.4.1:5000", + ex_force_auth_version="2.0_password", + ex_tenant_name="your_tenant", +) # get the first pool - public by default pool = driver.ex_list_floating_ip_pools()[0] @@ -22,7 +24,7 @@ floating_ip = pool.create_floating_ip() # get the node, note: change the node id to the some id you have -node = driver.ex_get_node_details('922a4381-a18c-487f-b816-cc31c9060853') +node = driver.ex_get_node_details("922a4381-a18c-487f-b816-cc31c9060853") # attach the ip to the node driver.ex_attach_floating_ip_to_node(node, floating_ip) diff --git a/docs/examples/compute/openstack_simple.py b/docs/examples/compute/openstack_simple.py index 8a5ea791f6..aec754c12e 100644 --- a/docs/examples/compute/openstack_simple.py +++ b/docs/examples/compute/openstack_simple.py @@ -1,8 +1,7 @@ +import libcloud.security from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -import libcloud.security - # This assumes you don't have SSL set up. # Note: Code like this poses a security risk (MITM attack) and # that's the reason why you should never use it for anything else @@ -10,6 +9,9 @@ libcloud.security.VERIFY_SSL_CERT = False OpenStack = get_driver(Provider.OPENSTACK) -driver = OpenStack('your_auth_username', 'your_auth_password', - ex_force_auth_url='http://192.168.1.101:5000', - ex_force_auth_version='2.0_password') +driver = OpenStack( + "your_auth_username", + "your_auth_password", + ex_force_auth_url="http://192.168.1.101:5000", + ex_force_auth_version="2.0_password", +) diff --git a/docs/examples/compute/outscale/__init__.py b/docs/examples/compute/outscale/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/outscale/instantiate.py b/docs/examples/compute/outscale/instantiate.py new file mode 100644 index 0000000000..9ba407eae9 --- /dev/null +++ b/docs/examples/compute/outscale/instantiate.py @@ -0,0 +1,5 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +cls = get_driver(Provider.OUTSCALE) +driver = cls(key="my_key", secret="my_secret", region="my_region", service="my_service") diff --git a/docs/examples/compute/outscale/list_nodes.py b/docs/examples/compute/outscale/list_nodes.py new file mode 100644 index 0000000000..ddc09f1516 --- /dev/null +++ b/docs/examples/compute/outscale/list_nodes.py @@ -0,0 +1,14 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +key = "my_key" +secret = "my_secret" +region = "eu-west-2" +service = "api" + +Driver = get_driver(Provider.OUTSCALE) +driver = Driver(key=key, secret=secret, region=region, service=service) + +nodes = driver.list_nodes() + +print(nodes) diff --git a/docs/examples/compute/ovh/__init__.py b/docs/examples/compute/ovh/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/ovh/attach_volume.py b/docs/examples/compute/ovh/attach_volume.py new file mode 100644 index 0000000000..5b56f81814 --- /dev/null +++ b/docs/examples/compute/ovh/attach_volume.py @@ -0,0 +1,11 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +Ovh = get_driver(Provider.OVH) +driver = Ovh("yourAppKey", "yourAppSecret", "youProjectId", "yourConsumerKey") + +location = [loc for loc in driver.list_locations() if loc.id == "SBG1"][0] +node = driver.list_nodes()[0] + +volume = driver.create_volume(size=10, location=location) +driver.attach_volume(node=node, volume=volume) diff --git a/docs/examples/compute/ovh/create_node.py b/docs/examples/compute/ovh/create_node.py new file mode 100644 index 0000000000..b93f2f63c8 --- /dev/null +++ b/docs/examples/compute/ovh/create_node.py @@ -0,0 +1,11 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +Ovh = get_driver(Provider.OVH) +driver = Ovh("yourAppKey", "yourAppSecret", "yourProjectId", "yourConsumerKey") + +location = [loc for loc in driver.list_locations() if loc.id == "SBG1"][0] +image = [i for i in driver.list_images() if "Debian 8" == i.name][0] +size = [s for s in driver.list_sizes() if s.name == "vps-ssd-1"][0] + +node = driver.create_node(name="yournode", size=size, image=image, location=location) diff --git a/docs/examples/compute/pricing.py b/docs/examples/compute/pricing.py index 3a9e886b02..adfb36b801 100644 --- a/docs/examples/compute/pricing.py +++ b/docs/examples/compute/pricing.py @@ -1,8 +1,8 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -EC2_ACCESS_ID = 'your access id' -EC2_SECRET_KEY = 'your secret key' +EC2_ACCESS_ID = "your access id" +EC2_SECRET_KEY = "your secret key" cls = get_driver(Provider.EC2) driver = cls(EC2_ACCESS_ID, EC2_SECRET_KEY) diff --git a/docs/examples/compute/rackspace/__init__.py b/docs/examples/compute/rackspace/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/rackspace/instantiate_first_gen.py b/docs/examples/compute/rackspace/instantiate_first_gen.py index 534a73f95b..cbef11c483 100644 --- a/docs/examples/compute/rackspace/instantiate_first_gen.py +++ b/docs/examples/compute/rackspace/instantiate_first_gen.py @@ -3,5 +3,5 @@ cls = get_driver(Provider.RACKSPACE_FIRST_GEN) -driver_us = cls('username', 'api key', region='us') -driver_uk = cls('username', 'api key', region='uk') +driver_us = cls("username", "api key", region="us") +driver_uk = cls("username", "api key", region="uk") diff --git a/docs/examples/compute/rackspace/instantiate_next_gen.py b/docs/examples/compute/rackspace/instantiate_next_gen.py index fb03cf03db..3becd57d8f 100644 --- a/docs/examples/compute/rackspace/instantiate_next_gen.py +++ b/docs/examples/compute/rackspace/instantiate_next_gen.py @@ -2,4 +2,4 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.RACKSPACE) -driver = cls('username', 'api key', region='iad') +driver = cls("username", "api key", region="iad") diff --git a/docs/examples/compute/rackspace/performance_flavors.py b/docs/examples/compute/rackspace/performance_flavors.py index bfe2b98c88..781a4688e3 100644 --- a/docs/examples/compute/rackspace/performance_flavors.py +++ b/docs/examples/compute/rackspace/performance_flavors.py @@ -2,11 +2,11 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.RACKSPACE) -driver = cls('username', 'api key', region='iad') +driver = cls("username", "api key", region="iad") sizes = driver.list_sizes() -performance_sizes = [size for size in sizes if 'performance' in size.id] +performance_sizes = [size for size in sizes if "performance" in size.id] for size in performance_sizes: print(size) diff --git a/docs/examples/compute/register_3rd_party_driver.py b/docs/examples/compute/register_3rd_party_driver.py index c8dab050a0..cb4a8a4eb2 100644 --- a/docs/examples/compute/register_3rd_party_driver.py +++ b/docs/examples/compute/register_3rd_party_driver.py @@ -1,11 +1,7 @@ -from libcloud.compute.providers import get_driver -from libcloud.compute.providers import set_driver +from libcloud.compute.providers import get_driver, set_driver - -set_driver('stratuslab', - 'stratuslab.libcloud.stratuslab_driver', - 'StratusLabNodeDriver') +set_driver("stratuslab", "stratuslab.libcloud.stratuslab_driver", "StratusLabNodeDriver") # Your code which uses the driver. # For example: -driver = get_driver('stratuslab') +driver = get_driver("stratuslab") diff --git a/docs/examples/compute/scaleway/create_node.py b/docs/examples/compute/scaleway/create_node.py new file mode 100644 index 0000000000..7c648a4f90 --- /dev/null +++ b/docs/examples/compute/scaleway/create_node.py @@ -0,0 +1,16 @@ +import os + +from libcloud.compute.drivers.scaleway import ScalewayNodeDriver + +driver = ScalewayNodeDriver(key=os.environ["SCW_ACCESS_KEY"], secret=os.environ["SCW_TOKEN"]) + +images = [ + x for x in driver.list_images(region="par1") if x.id == "89457135-d446-41ba-a8df-d53e5bb54710" +] +sizes = [x for x in driver.list_sizes() if x.name == "C2S"] + +# We create the node +driver.create_node("foobar", size=sizes[0], image=images[0], region="par1") + +# We delete it right after +driver.destroy_node("foobar") diff --git a/docs/examples/compute/scaleway/list_nodes.py b/docs/examples/compute/scaleway/list_nodes.py new file mode 100644 index 0000000000..bf11204555 --- /dev/null +++ b/docs/examples/compute/scaleway/list_nodes.py @@ -0,0 +1,9 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +cls = get_driver(Provider.SCALEWAY) +driver = cls("SCALEWAY_ACCESS_KEY", "SCALEWAY_SECRET_TOKEN") + +nodes = driver.list_nodes() +for node in nodes: + print(node) diff --git a/docs/examples/compute/scaleway/list_volumes.py b/docs/examples/compute/scaleway/list_volumes.py new file mode 100644 index 0000000000..dc8b32fa73 --- /dev/null +++ b/docs/examples/compute/scaleway/list_volumes.py @@ -0,0 +1,12 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +cls = get_driver(Provider.SCALEWAY) +driver = cls("SCALEWAY_ACCESS_KEY", "SCALEWAY_SECRET_TOKEN") + +volumes = driver.list_volumes() +for volume in volumes: + print(volume) + snapshots = driver.list_volume_snapshots(volume) + for snapshot in snapshots: + print(" snapshot-%s" % snapshot) diff --git a/docs/examples/compute/trystack.py b/docs/examples/compute/trystack.py index c3db4a2f64..a9e33a56a3 100644 --- a/docs/examples/compute/trystack.py +++ b/docs/examples/compute/trystack.py @@ -1,8 +1,7 @@ +import libcloud.security from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -import libcloud.security - # At the time this example was written, https://nova-api.trystack.org:5443 # was using a certificate issued by a Certificate Authority (CA) which is # not included in the default Ubuntu certificates bundle (ca-certificates). @@ -13,15 +12,18 @@ OpenStack = get_driver(Provider.OPENSTACK) -driver = OpenStack('your username', 'your password', - ex_force_auth_url='https://nova-api.trystack.org:5443', - ex_force_auth_version='2.0_password') +driver = OpenStack( + "your username", + "your password", + ex_force_auth_url="https://nova-api.trystack.org:5443", + ex_force_auth_version="2.0_password", +) nodes = driver.list_nodes() images = driver.list_images() sizes = driver.list_sizes() size = [s for s in sizes if s.ram == 512][0] -image = [i for i in images if i.name == 'natty-server-cloudimg-amd64'][0] +image = [i for i in images if i.name == "natty-server-cloudimg-amd64"][0] -node = driver.create_node(name='test node', image=image, size=size) +node = driver.create_node(name="test node", image=image, size=size) diff --git a/docs/examples/compute/vmware_vcloud_1.5.py b/docs/examples/compute/vmware_vcloud_1.5.py index 5498a8f906..493feffb44 100644 --- a/docs/examples/compute/vmware_vcloud_1.5.py +++ b/docs/examples/compute/vmware_vcloud_1.5.py @@ -1,8 +1,7 @@ +import libcloud.security from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -import libcloud.security - # Skip this step if you are launching nodes on an official vCloud # provider. It is intended only for self signed SSL certs in # vanilla vCloud Director v1.5 test deployments. @@ -13,41 +12,51 @@ vcloud = get_driver(Provider.VCLOUD) -driver = vcloud('you username@organisation', 'your password', - host='vcloud.local', api_version='1.5') +driver = vcloud( + "you username@organisation", "your password", host="vcloud.local", api_version="1.5" +) # List all instantiated vApps nodes = driver.list_nodes() # List all VMs within the first vApp instance -print nodes[0].extra['vms'] +print(nodes[0].extra["vms"]) # List all available vApp Templates images = driver.list_images() -image = [i for i in images if i.name == 'natty-server-cloudimg-amd64'][0] +image = [i for i in images if i.name == "natty-server-cloudimg-amd64"][0] # Create node with minimum set of parameters -node = driver.create_node(name='test node 1', image=image) +node = driver.create_node(name="test node 1", size=None, image=image) # Destroy the node driver.destroy_node(node) # Create node without deploying and powering it on -node = driver.create_node(name='test node 2', image=image, ex_deploy=False) +node = driver.create_node(name="test node 2", size=None, image=image, ex_deploy=False) # Create node with custom CPU & Memory values -node = driver.create_node(name='test node 3', image=image, ex_vm_cpu=3, - ex_vm_memory=1024) +node = driver.create_node( + name="test node 3", size=None, image=image, ex_vm_cpu=3, ex_vm_memory=1024 +) # Create node with customised networking parameters (eg. for OVF # imported images) -node = driver.create_node(name='test node 4', image=image, - ex_vm_network='your vm net name', - ex_network='your org net name', - ex_vm_fence='bridged', ex_vm_ipmode='DHCP') +node = driver.create_node( + name="test node 4", + size=None, + image=image, + ex_vm_network="your vm net name", + ex_network="your org net name", + ex_vm_fence="bridged", + ex_vm_ipmode="DHCP", +) # Create node in a custom virtual data center -node = driver.create_node(name='test node 4', image=image, - ex_vdc='your vdc name') +node = driver.create_node(name="test node 4", size=None, image=image, ex_vdc="your vdc name") # Create node with guest OS customisation script to be run at first boot -node = driver.create_node(name='test node 5', image=image, - ex_vm_script='filesystem path to your script') +node = driver.create_node( + name="test node 5", + size=None, + image=image, + ex_vm_script="filesystem path to your script", +) diff --git a/docs/examples/compute/vsphere/connect_host.py b/docs/examples/compute/vsphere/connect_host.py deleted file mode 100644 index da587b7187..0000000000 --- a/docs/examples/compute/vsphere/connect_host.py +++ /dev/null @@ -1,8 +0,0 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver - -cls = get_driver(Provider.VSPHERE) -driver = cls(host='192.168.1.100', - username='admin', password='admin') -print(driver.list_nodes()) -# ... diff --git a/docs/examples/compute/vsphere/connect_url.py b/docs/examples/compute/vsphere/connect_url.py deleted file mode 100644 index de48298de5..0000000000 --- a/docs/examples/compute/vsphere/connect_url.py +++ /dev/null @@ -1,8 +0,0 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver - -cls = get_driver(Provider.VSPHERE) -driver = cls(url='https://192.168.1.100/sdk/', - username='admin', password='admin') -print(driver.list_nodes()) -# ... diff --git a/docs/examples/compute/vsphere/connect_url_custom_port.py b/docs/examples/compute/vsphere/connect_url_custom_port.py deleted file mode 100644 index 0f5a0dc83d..0000000000 --- a/docs/examples/compute/vsphere/connect_url_custom_port.py +++ /dev/null @@ -1,8 +0,0 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver - -cls = get_driver(Provider.VSPHERE) -driver = cls(url='https://192.168.1.100:8080/sdk/', - username='admin', password='admin') -print(driver.list_nodes()) -# ... diff --git a/docs/examples/compute/vultr/__init__.py b/docs/examples/compute/vultr/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/compute/vultr/vultr_compute_simple.py b/docs/examples/compute/vultr/vultr_compute_simple.py index 5db958b0a7..c445e1ec71 100644 --- a/docs/examples/compute/vultr/vultr_compute_simple.py +++ b/docs/examples/compute/vultr/vultr_compute_simple.py @@ -2,4 +2,4 @@ from libcloud.compute.providers import get_driver cls = get_driver(Provider.VULTR) -driver = cls('your api key') +driver = cls("your api key") diff --git a/docs/examples/container/__init__.py b/docs/examples/container/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/container/docker/__init__.py b/docs/examples/container/docker/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/container/docker/deploy_container.py b/docs/examples/container/docker/deploy_container.py new file mode 100644 index 0000000000..eb8c6c536d --- /dev/null +++ b/docs/examples/container/docker/deploy_container.py @@ -0,0 +1,9 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +cls = get_driver(Provider.DOCKER) + +driver = cls(host="https://198.61.239.128", port=4243, key_file="key.pem", cert_file="cert.pem") + +image = driver.install_image("tomcat:8.0") +container = driver.deploy_container("tomcat", image) diff --git a/docs/examples/container/docker/instantiate_driver.py b/docs/examples/container/docker/instantiate_driver.py new file mode 100644 index 0000000000..bece44d3a9 --- /dev/null +++ b/docs/examples/container/docker/instantiate_driver.py @@ -0,0 +1,8 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +cls = get_driver(Provider.DOCKER) + +conn = cls(host="https://198.61.239.128", port=4243, key_file="key.pem", cert_file="cert.pem") + +conn.list_images() diff --git a/docs/examples/container/docker_hub.py b/docs/examples/container/docker_hub.py new file mode 100644 index 0000000000..a5a4e60271 --- /dev/null +++ b/docs/examples/container/docker_hub.py @@ -0,0 +1,19 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver +from libcloud.container.utils.docker import HubClient + +cls = get_driver(Provider.ECS) + +conn = cls( + access_id="SDHFISJDIFJSIDFJ", + secret="THIS_IS)+_MY_SECRET_KEY+I6TVkv68o4H", + region="ap-southeast-2", +) +hub = HubClient() + +image = hub.get_image("ubuntu", "latest") + +for cluster in conn.list_clusters(): + print(cluster.name) + if cluster.name == "default": + container = conn.deploy_container(cluster=cluster, name="my-simple-app", image=image) diff --git a/docs/examples/container/ecs/__init__.py b/docs/examples/container/ecs/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/container/ecs/container_registry.py b/docs/examples/container/ecs/container_registry.py new file mode 100644 index 0000000000..e3eacfe0c1 --- /dev/null +++ b/docs/examples/container/ecs/container_registry.py @@ -0,0 +1,28 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +cls = get_driver(Provider.ECS) + +# Connect to AWS +conn = cls( + access_id="SDHFISJDIFJSIDFJ", + secret="THIS_IS)+_MY_SECRET_KEY+I6TVkv68o4H", + region="ap-southeast-2", +) + +# Get a Registry API client for an existing repository +client = conn.ex_get_registry_client("my-image") + +# List all the images +for image in client.list_images("my-image"): + print(image.name) + +# Get a specific image +image = client.get_image("my-image", "14.04") + +print(image.path) +# >> 647433528374.dkr.ecr.region.amazonaws.com/my-image:14.04 + +# Deploy that image +cluster = conn.list_clusters()[0] +container = conn.deploy_container(cluster=cluster, name="my-simple-app", image=image) diff --git a/docs/examples/container/ecs/deploy_container.py b/docs/examples/container/ecs/deploy_container.py new file mode 100644 index 0000000000..71f8b2ff1a --- /dev/null +++ b/docs/examples/container/ecs/deploy_container.py @@ -0,0 +1,22 @@ +from libcloud.container.base import ContainerImage +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +cls = get_driver(Provider.ECS) + +conn = cls( + access_id="SDHFISJDIFJSIDFJ", + secret="THIS_IS)+_MY_SECRET_KEY+I6TVkv68o4H", + region="ap-southeast-2", +) + +for cluster in conn.list_clusters(): + print(cluster.name) + if cluster.name == "default": + container = conn.deploy_container( + cluster=cluster, + name="my-simple-app", + image=ContainerImage( + id=None, name="simple-app", path="simple-app", version=None, driver=conn + ), + ) diff --git a/docs/examples/container/ecs/instantiate_driver.py b/docs/examples/container/ecs/instantiate_driver.py new file mode 100644 index 0000000000..dbd6cd13f5 --- /dev/null +++ b/docs/examples/container/ecs/instantiate_driver.py @@ -0,0 +1,16 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +cls = get_driver(Provider.ECS) + +conn = cls( + access_id="SDHFISJDIFJSIDFJ", + secret="THIS_IS)+_MY_SECRET_KEY+I6TVkv68o4H", + region="ap-southeast-2", +) + +for container in conn.list_containers(): + print(container.name) + +for cluster in conn.list_clusters(): + print(cluster.name) diff --git a/docs/examples/container/gke/__init__.py b/docs/examples/container/gke/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/container/gke/instantiate_driver.py b/docs/examples/container/gke/instantiate_driver.py new file mode 100644 index 0000000000..3bb52d20a8 --- /dev/null +++ b/docs/examples/container/gke/instantiate_driver.py @@ -0,0 +1,12 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +cls = get_driver(Provider.GKE) + +conn = cls( + "testaccount-XXX@testproject.iam.gserviceaccount.com", + "libcloud.json", + project="testproject", +) + +conn.list_clusters() diff --git a/docs/examples/container/install_and_deploy.py b/docs/examples/container/install_and_deploy.py new file mode 100644 index 0000000000..84367154c4 --- /dev/null +++ b/docs/examples/container/install_and_deploy.py @@ -0,0 +1,12 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +CREDS = ("user", "api key") + +Cls = get_driver(Provider.DOCKER) +driver = Cls(*CREDS) + +image = driver.install_image("tomcat:8.0") +container = driver.deploy_container("tomcat", image) + +container.restart() diff --git a/docs/examples/container/joyent/__init__.py b/docs/examples/container/joyent/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/container/joyent/instantiate_driver.py b/docs/examples/container/joyent/instantiate_driver.py new file mode 100644 index 0000000000..44fc2e57e2 --- /dev/null +++ b/docs/examples/container/joyent/instantiate_driver.py @@ -0,0 +1,13 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +cls = get_driver(Provider.JOYENT) + +conn = cls( + host="us-east-1.docker.joyent.com", + port=2376, + key_file="key.pem", + cert_file="~/.sdc/docker/admin/ca.pem", +) + +conn.list_images() diff --git a/docs/examples/container/kubernetes/__init__.py b/docs/examples/container/kubernetes/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/container/kubernetes/docker_hub.py b/docs/examples/container/kubernetes/docker_hub.py new file mode 100644 index 0000000000..641eb5d2d1 --- /dev/null +++ b/docs/examples/container/kubernetes/docker_hub.py @@ -0,0 +1,15 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver +from libcloud.container.utils.docker import HubClient + +cls = get_driver(Provider.KUBERNETES) + +conn = cls(key="my_username", secret="THIS_IS)+_MY_SECRET_KEY+I6TVkv68o4H", host="126.32.21.4") +hub = HubClient() + +image = hub.get_image("ubuntu", "latest") + +for cluster in conn.list_clusters(): + print(cluster.name) + if cluster.name == "default": + container = conn.deploy_container(cluster=cluster, name="my-simple-app", image=image) diff --git a/docs/examples/container/kubernetes/instantiate_driver.py b/docs/examples/container/kubernetes/instantiate_driver.py new file mode 100644 index 0000000000..3547f9bb94 --- /dev/null +++ b/docs/examples/container/kubernetes/instantiate_driver.py @@ -0,0 +1,26 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +cls = get_driver(Provider.KUBERNETES) + +# 1. Client side cert auth +conn = cls( + host="192.168.99.103", + port=8443, + secure=True, + key_file="/home/user/.minikube/client.key", + cert_file="/home/user/.minikube/client.crt", + ca_cert="/home/user/.minikube/ca.crt", +) + +# 2. Bearer bootstrap token auth +conn = cls(key="my_token", host="126.32.21.4", ex_token_bearer_auth=True) + +# 3. Basic auth +conn = cls(key="my_username", secret="THIS_IS)+_MY_SECRET_KEY+I6TVkv68o4H", host="126.32.21.4") + +for container in conn.list_containers(): + print(container.name) + +for cluster in conn.list_clusters(): + print(cluster.name) diff --git a/docs/examples/container/kubernetes/instantiate_driver_minikube_basic_auth.py b/docs/examples/container/kubernetes/instantiate_driver_minikube_basic_auth.py new file mode 100644 index 0000000000..1fb23b9a50 --- /dev/null +++ b/docs/examples/container/kubernetes/instantiate_driver_minikube_basic_auth.py @@ -0,0 +1,18 @@ +import libcloud.security +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +# Disable cert vertification when running minikube locally using self signed +# cert +libcloud.security.VERIFY_SSL_CERT = False + +cls = get_driver(Provider.KUBERNETES) + +# You can retrieve cluster ip by running "minikube ip" command +conn = cls(key="user1", secret="pass123", host="192.168.99.100", port=8443, secure=True) + +for container in conn.list_containers(): + print(container.name) + +for cluster in conn.list_clusters(): + print(cluster.name) diff --git a/docs/examples/container/kubernetes/instantiate_driver_minikube_cert_auth.py b/docs/examples/container/kubernetes/instantiate_driver_minikube_cert_auth.py new file mode 100644 index 0000000000..660f71ac2c --- /dev/null +++ b/docs/examples/container/kubernetes/instantiate_driver_minikube_cert_auth.py @@ -0,0 +1,25 @@ +import libcloud.security +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +# Disable cert vertification when running minikube locally using self signed +# cert +libcloud.security.VERIFY_SSL_CERT = False + +cls = get_driver(Provider.KUBERNETES) + +# You can retrieve cluster ip by running "minikube ip" command +conn = cls( + host="192.168.99.103", + port=8443, + secure=True, + key_file="/home/user/.minikube/client.key", + cert_file="/home/user/.minikube/client.crt", + ca_cert="/home/user/.minikube/ca.crt", +) + +for container in conn.list_containers(): + print(container.name) + +for cluster in conn.list_clusters(): + print(cluster.name) diff --git a/docs/examples/container/lxd/example_lxd.py b/docs/examples/container/lxd/example_lxd.py new file mode 100644 index 0000000000..55932af6d6 --- /dev/null +++ b/docs/examples/container/lxd/example_lxd.py @@ -0,0 +1,248 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# flake8: noqa + +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + + +def work_with_containers(): + print("Working with containers...") + + # LXD API specification can be found at: + # https://github.com/lxc/lxd/blob/master/doc/rest-api.md#10containersnamemetadata + + # LXD host change accordingly + host_lxd = "https://192.168.2.4" + + # port that LXD server is listening at + # change this according to your configuration + port_id = 8443 + + # get the libcloud LXD driver + lxd_driver = get_driver(Provider.LXD) + + # acquire the connection. + # certificates should have been added to the LXD server + # here we assume they are on the same directory change + # accordingly + conn = lxd_driver( + key="", + secret="", + secure=False, + host=host_lxd, + port=port_id, + key_file="lxd.key", + cert_file="lxd.crt", + ) + + # this API call does not require authentication + api_end_points = conn.ex_get_api_endpoints() + print(api_end_points) + + # this API call is allowed for everyone (but result varies) + api_version = conn.ex_get_server_configuration() + print(api_version) + + # get the list of the containers + containers = conn.list_containers() + + if len(containers) == 0: + print("\tNo containers have been created") + else: + print("\tNumber of containers: %s" % len(containers)) + for container in containers: + print("\t\tContainer: {} is: {}".format(container.name, container.state)) + + # start the first container + print("\tStarting container: %s" % containers[0].name) + container = conn.start_container(container=containers[0]) + print("\tContainer: {} is: {}".format(container.name, container.state)) + + # stop the container returned + print("\tStopping container: %s" % containers[0].name) + container = conn.stop_container(container=container) + print("\tContainer: {} is: {}".format(container.name, container.state)) + + # restart the container + print("\tRestarting container: %s" % container.name) + container = conn.restart_container(container=container) + print("\tContainer: {} is: {}".format(container.name, container.state)) + + """ + if len(containers) == 2: + + # delete the second container + print("\tDeleting container: %s" % containers[1].name) + response = conn.destroy_container(container=containers[1]) + print("\tResponse from attempting to delete container %s " % (containers[1].name), " ", response) + + # get the list of the containers + containers = conn.list_containers() + + # create a new container + name = 'third-lxd-container' + + if name not in [container.name for container in containers]: + + print("\tCreating container: %s" % name) + + image = ContainerImage(id='ubuntu-xenial', name='ubuntu-xenial', + path=None, version=None, driver=lxd_driver) + + # Input (container based on a local image identified by its fingerprint): + # change fingerprint accordingly + img_parameters = {"type": "image", "alias":image.name, + "fingerprint": "7ed08b435c92cd8a8a884c88e8722f2e7546a51e891982a90ea9c15619d7df9b"} + container = conn.deploy_container(name=name, image=image, parameters=img_parameters, + architecture="x86_64", ephemeral=False, profiles=["default"]) + print("\tResponse from attempting to create container: ", container) + + # get the list of the containers + containers = conn.list_containers() + + if len(containers) == 0: + print("\tNo containers have been created") + else: + print("\tNumber of containers: %s" % len(containers)) + for container in containers: + print("\t\tContainer: %s is: %s" % (container.name, container.state)) + """ + + +def work_with_images(): + print("Working with images...") + + # LXD host change accordingly + host_lxd = "https://192.168.2.4" + + # port that LXD server is listening at + # change this according to your configuration + port_id = 8443 + + # get the libcloud LXD driver + lxd_driver = get_driver(Provider.LXD) + + # acquire the connection. + # certificates should have been added to the LXD server + # here we assume they are on the same directory change + # accordingly + conn = lxd_driver( + key="", + secret="", + secure=False, + host=host_lxd, + port=port_id, + key_file="lxd.key", + cert_file="lxd.crt", + ) + + # get the images this LXD server is publishing + images = conn.list_images() + + print("Number of images: ", len(images)) + + for image in images: + print("Image: ", image.name) + print("\tPath ", image.path) + print("\tVersion ", image.version) + + conn.create_image() + + +def work_with_storage_pools(): + print("Working with storage pools...") + + # LXD host change accordingly + host_lxd = "https://192.168.2.4" + + # port that LXD server is listening at + # change this according to your configuration + port_id = 8443 + + # get the libcloud LXD driver + lxd_driver = get_driver(Provider.LXD) + + # acquire the connection. + # certificates should have been added to the LXD server + # here we assume they are on the same directory change + # accordingly + conn = lxd_driver( + key="", + secret="", + secure=False, + host=host_lxd, + port=port_id, + key_file="lxd.key", + cert_file="lxd.crt", + ) + + # get the images this LXD server is publishing + pools = conn.ex_list_storage_pools() + + print("Number of storage pools: ", len(pools)) + + for pool in pools: + print("\tPool: ", pool.name) + print("\t\tDriver: ", pool.driver) + print("\t\tUsed by: ", pool.used_by) + print("\t\tConfig: ", pool.config) + + # conn.ex_delete_storage_pool(id="Pool100") + + definition = {"driver": "zfs", "name": "Pool100", "config": {"size": "70MB"}} + + # conn.ex_create_storage_pool(definition=definition) + + # conn.ex_delete_storage_pool_volume(storage_pool_id="Pool100", type="custom", name="vol1") + + volumes = conn.ex_list_storage_pool_volumes(storage_pool_id="Pool100") + + for volume in volumes: + print(volume.name) + + definition = { + "config": { + "block.filesystem": "ext4", + "block.mount_options": "discard", + "size": "10737418240", + }, + "name": "vol1", + "type": "custom", + } + volume = conn.ex_create_storage_pool_volume(storage_pool_id="Pool100", definition=definition) + + print("Volume name: ", volume.name) + print("Volume size: ", volume.size) + + definition = { + "config": { + "block.filesystem": "ext4", + "block.mount_options": "discard", + "size": "8737418240", + } + } + volume = conn.ex_replace_storage_volume_config( + storage_pool_id="Pool100", type="custom", name="vol1", definition=definition + ) + + print("Volume name: ", volume.name) + print("Volume size: ", volume.size) + + +if __name__ == "__main__": + work_with_containers() + # work_with_images() + # work_with_storage_pools() diff --git a/docs/examples/container/rancher/__init__.py b/docs/examples/container/rancher/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/container/rancher/deploy_container.py b/docs/examples/container/rancher/deploy_container.py new file mode 100644 index 0000000000..a5e495960f --- /dev/null +++ b/docs/examples/container/rancher/deploy_container.py @@ -0,0 +1,19 @@ +from libcloud.container.base import ContainerImage +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +driver = get_driver(Provider.RANCHER) + +connection = driver( + "MYRANCHERACCESSKEY", + "MYRANCHERSECRETKEY", + host="172.30.0.100", + port=8080, + secure=False, +) + +image = ContainerImage("hastebin", "hastebin", "rlister/hastebin", "latest", driver=None) + +new_container = connection.deploy_container( + name="awesomecontainer", image=image, networkMode="managed" +) diff --git a/docs/examples/container/rancher/deploy_service.py b/docs/examples/container/rancher/deploy_service.py new file mode 100644 index 0000000000..845401924d --- /dev/null +++ b/docs/examples/container/rancher/deploy_service.py @@ -0,0 +1,16 @@ +from libcloud.container.base import ContainerImage +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +driver = get_driver(Provider.RANCHER) + +connection = driver("MYRANCHERACCESSKEY", "MYRANCHERSECRETKEY", host="17.23.66.4", port=443) + +image = ContainerImage("hastebin", "hastebin", "rlister/hastebin", "latest", driver=None) + +new_service = connection.ex_deploy_service( + name="excitingservice", + image=image, + environmentid="1e2", + environment={"STORAGE_TYPE": "file"}, +) diff --git a/docs/examples/container/rancher/deploy_stack.py b/docs/examples/container/rancher/deploy_stack.py new file mode 100644 index 0000000000..6d942cd0f8 --- /dev/null +++ b/docs/examples/container/rancher/deploy_stack.py @@ -0,0 +1,18 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +driver = get_driver(Provider.RANCHER) + +connection = driver( + "MYRANCHERACCESSKEY", + "MYRANCHERSECRETKEY", + host="172.30.0.100", + port=8080, + secure=False, +) + +new_stack = connection.ex_deploy_stack( + name="GhostBlog", description="Contains services for the" "ghost blog." +) + +id_of_new_stack = new_stack["id"] diff --git a/docs/examples/container/rancher/instantiate_driver.py b/docs/examples/container/rancher/instantiate_driver.py new file mode 100644 index 0000000000..a6f2e438af --- /dev/null +++ b/docs/examples/container/rancher/instantiate_driver.py @@ -0,0 +1,14 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +driver = get_driver(Provider.RANCHER) + +connection = driver( + "MYRANCHERACCESSKEY", + "MYRANCHERSECRETKEY", + host="172.30.0.100", + port=8080, + secure=False, +) + +connection.list_containers() diff --git a/docs/examples/container/rancher/search_containers.py b/docs/examples/container/rancher/search_containers.py new file mode 100644 index 0000000000..0703cc2c7f --- /dev/null +++ b/docs/examples/container/rancher/search_containers.py @@ -0,0 +1,18 @@ +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +driver = get_driver(Provider.RANCHER) + +connection = driver( + "MYRANCHERACCESSKEY", + "MYRANCHERSECRETKEY", + host="172.30.22.1", + port=8080, + secure=False, +) + +search_results = connection.ex_search_containers( + search_params={"imageUuid": "docker:mysql", "state": "running"} +) + +id_of_first_result = search_results[0]["id"] diff --git a/docs/examples/container/working_with_clusters.py b/docs/examples/container/working_with_clusters.py new file mode 100644 index 0000000000..4c32474d0e --- /dev/null +++ b/docs/examples/container/working_with_clusters.py @@ -0,0 +1,23 @@ +from libcloud.container.base import ContainerImage +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +cls = get_driver(Provider.ECS) + +conn = cls( + access_id="SDHFISJDIFJSIDFJ", + secret="THIS_IS)+_MY_SECRET_KEY+I6TVkv68o4H", + region="ap-southeast-2", +) + +for cluster in conn.list_clusters(): + print(cluster.name) + if cluster.name == "my-cluster": + conn.list_containers(cluster=cluster) + container = conn.deploy_container( + name="my-simple-app", + image=ContainerImage( + id=None, name="simple-app", path="simple-app", version=None, driver=conn + ), + cluster=cluster, + ) diff --git a/docs/examples/dns/__init__.py b/docs/examples/dns/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/auroradns/__init__.py b/docs/examples/dns/auroradns/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/auroradns/enable_disable_record.py b/docs/examples/dns/auroradns/enable_disable_record.py new file mode 100644 index 0000000000..4f29d1cbf5 --- /dev/null +++ b/docs/examples/dns/auroradns/enable_disable_record.py @@ -0,0 +1,13 @@ +from libcloud.dns.types import Provider, RecordType +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.AURORADNS) + +driver = cls("myapikey", "mysecret") + +zone = driver.get_zone("auroradns.eu") + +record = zone.create_record( + name="www", type=RecordType.AAAA, data="2a00:f10:452::1", ex_disabled=True +) +record.update(ex_disabled=False) diff --git a/docs/examples/dns/auroradns/health_checks.py b/docs/examples/dns/auroradns/health_checks.py new file mode 100644 index 0000000000..e60c873b5d --- /dev/null +++ b/docs/examples/dns/auroradns/health_checks.py @@ -0,0 +1,26 @@ +from libcloud.dns.types import Provider, RecordType +from libcloud.dns.providers import get_driver +from libcloud.dns.drivers.auroradns import AuroraDNSHealthCheckType + +cls = get_driver(Provider.AURORADNS) + +driver = cls("myapikey", "mysecret") + +zone = driver.get_zone("auroradns.eu") + +health_check = driver.ex_create_healthcheck( + zone=zone, + type=AuroraDNSHealthCheckType.HTTP, + hostname="web01.auroradns.eu", + path="/", + port=80, + interval=10, + threshold=5, +) + +record = zone.create_record( + name="www", + type=RecordType.AAAA, + data="2a00:f10:452::1", + extra={"health_check_id": health_check.id}, +) diff --git a/docs/examples/dns/auroradns/instantiate_driver.py b/docs/examples/dns/auroradns/instantiate_driver.py new file mode 100644 index 0000000000..e582fa555d --- /dev/null +++ b/docs/examples/dns/auroradns/instantiate_driver.py @@ -0,0 +1,6 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.AURORADNS) + +driver = cls("myapikey", "mysecret") diff --git a/docs/examples/dns/buddyns/__init__.py b/docs/examples/dns/buddyns/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/buddyns/instantiate_driver.py b/docs/examples/dns/buddyns/instantiate_driver.py new file mode 100644 index 0000000000..164323f177 --- /dev/null +++ b/docs/examples/dns/buddyns/instantiate_driver.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.BUDDYNS) +driver = cls("") diff --git a/docs/examples/dns/cloudflare/__init__.py b/docs/examples/dns/cloudflare/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/cloudflare/instantiate_driver.py b/docs/examples/dns/cloudflare/instantiate_driver.py new file mode 100644 index 0000000000..ad8fae74ef --- /dev/null +++ b/docs/examples/dns/cloudflare/instantiate_driver.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.CLOUDFLARE) +driver = cls("", "") diff --git a/docs/examples/dns/cloudflare/instantiate_driver_token.py b/docs/examples/dns/cloudflare/instantiate_driver_token.py new file mode 100644 index 0000000000..c5f3ab4c61 --- /dev/null +++ b/docs/examples/dns/cloudflare/instantiate_driver_token.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.CLOUDFLARE) +driver = cls("") diff --git a/docs/examples/dns/create_a_record_for_all_rackspace_nodes.py b/docs/examples/dns/create_a_record_for_all_rackspace_nodes.py index 93147c10e0..00361da379 100644 --- a/docs/examples/dns/create_a_record_for_all_rackspace_nodes.py +++ b/docs/examples/dns/create_a_record_for_all_rackspace_nodes.py @@ -1,13 +1,13 @@ from pprint import pprint -from libcloud.compute.providers import get_driver as get_compute_driver -from libcloud.compute.types import Provider as ComputeProvider -from libcloud.dns.providers import get_driver as get_dns_driver from libcloud.dns.types import Provider as DNSProvider from libcloud.dns.types import RecordType +from libcloud.compute.types import Provider as ComputeProvider +from libcloud.dns.providers import get_driver as get_dns_driver +from libcloud.compute.providers import get_driver as get_compute_driver -CREDENTIALS_RACKSPACE = ('username', 'api key') -CREDENTIALS_ZERIGO = ('email', 'api key') +CREDENTIALS_RACKSPACE = ("username", "api key") +CREDENTIALS_ZERIGO = ("email", "api key") cls = get_compute_driver(ComputeProvider.RACKSPACE) compute_driver = cls(*CREDENTIALS_RACKSPACE) @@ -19,7 +19,7 @@ nodes = compute_driver.list_nodes() # Create a new zone -zone = dns_driver.create_zone(domain='mydomain2.com') +zone = dns_driver.create_zone(domain="mydomain2.com") created = [] @@ -31,9 +31,9 @@ if not ip: continue - print('Creating %s record (data=%s) for node %s' % ('A', ip, name)) + print("Creating {} record (data={}) for node {}".format("A", ip, name)) record = zone.create_record(name=name, type=RecordType.A, data=ip) created.append(record) -print 'Done, created %d records' % (len(created)) +print("Done, created %d records" % (len(created))) pprint(created) diff --git a/docs/examples/dns/create_record_caa_record_type.py b/docs/examples/dns/create_record_caa_record_type.py new file mode 100644 index 0000000000..33264069c3 --- /dev/null +++ b/docs/examples/dns/create_record_caa_record_type.py @@ -0,0 +1,18 @@ +from libcloud.dns.types import Provider, RecordType +from libcloud.dns.providers import get_driver + +CREDENTIALS = ("email", "api key") + +cls = get_driver(Provider.CLOUDFLARE) +driver = cls(*CREDENTIALS) + +zone = [z for z in driver.list_zones() if z.domain == "example.com"][0] + +# 1. issue tag +print(zone.create_record(name="www", type=RecordType.CAA, data="0 issue caa.domain.com")) + +# 2. issuewild tag +print(zone.create_record(name="www", type=RecordType.CAA, data="0 issuewild caa.domain.com")) + +# 3. iodef tag +print(zone.create_record(name="www", type=RecordType.CAA, data="0 iodef caa.domain.com/report")) diff --git a/docs/examples/dns/create_record_custom_ttl.py b/docs/examples/dns/create_record_custom_ttl.py index 4632a57fb0..1e8001247c 100644 --- a/docs/examples/dns/create_record_custom_ttl.py +++ b/docs/examples/dns/create_record_custom_ttl.py @@ -1,13 +1,12 @@ -from libcloud.dns.providers import get_driver from libcloud.dns.types import Provider, RecordType +from libcloud.dns.providers import get_driver -CREDENTIALS_ZERIGO = ('email', 'api key') +CREDENTIALS_ZERIGO = ("email", "api key") cls = get_driver(Provider.ZERIGO) driver = cls(*CREDENTIALS_ZERIGO) -zone = [z for z in driver.list_zones() if z.domain == 'example.com'][0] +zone = [z for z in driver.list_zones() if z.domain == "example.com"][0] -extra = {'ttl': 900} -record = zone.create_record(name='www', type=RecordType.A, data='127.0.0.1', - extra=extra) +ttl = 900 +record = zone.create_record(name="www", type=RecordType.A, data="127.0.0.1", ttl=ttl) diff --git a/docs/examples/dns/create_record_with_priority.py b/docs/examples/dns/create_record_with_priority.py index ddcbcaf767..34f26bff4d 100644 --- a/docs/examples/dns/create_record_with_priority.py +++ b/docs/examples/dns/create_record_with_priority.py @@ -1,13 +1,12 @@ -from libcloud.dns.providers import get_driver from libcloud.dns.types import Provider, RecordType +from libcloud.dns.providers import get_driver -CREDENTIALS_ZERIGO = ('email', 'api key') +CREDENTIALS_ZERIGO = ("email", "api key") cls = get_driver(Provider.ZERIGO) driver = cls(*CREDENTIALS_ZERIGO) -zone = [z for z in driver.list_zones() if z.domain == 'example.com'][0] +zone = [z for z in driver.list_zones() if z.domain == "example.com"][0] -extra = {'priority': 10} -record = zone.create_record(name=None, type=RecordType.MX, - data='aspmx.l.google.com', extra=extra) +extra = {"priority": 10} +record = zone.create_record(name=None, type=RecordType.MX, data="aspmx.l.google.com", extra=extra) diff --git a/docs/examples/dns/digitalocean/__init__.py b/docs/examples/dns/digitalocean/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/digitalocean/instantiate_driver.py b/docs/examples/dns/digitalocean/instantiate_driver.py new file mode 100644 index 0000000000..4c15503542 --- /dev/null +++ b/docs/examples/dns/digitalocean/instantiate_driver.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.DIGITAL_OCEAN) +driver = cls(key="access token") diff --git a/docs/examples/dns/dnsimple/__init__.py b/docs/examples/dns/dnsimple/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/dnsimple/instantiate_driver.py b/docs/examples/dns/dnsimple/instantiate_driver.py new file mode 100644 index 0000000000..cb969ac69a --- /dev/null +++ b/docs/examples/dns/dnsimple/instantiate_driver.py @@ -0,0 +1,6 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.DNSIMPLE) + +driver = cls("username", "apikey") diff --git a/docs/examples/dns/durabledns/__init__.py b/docs/examples/dns/durabledns/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/durabledns/instantiate_driver.py b/docs/examples/dns/durabledns/instantiate_driver.py new file mode 100644 index 0000000000..ce767bcf11 --- /dev/null +++ b/docs/examples/dns/durabledns/instantiate_driver.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.DURABLEDNS) +driver = cls("api_user", "api_key") diff --git a/docs/examples/dns/export_zone_to_bind_format.py b/docs/examples/dns/export_zone_to_bind_format.py index c8d72eaf0d..55d960390f 100644 --- a/docs/examples/dns/export_zone_to_bind_format.py +++ b/docs/examples/dns/export_zone_to_bind_format.py @@ -1,8 +1,8 @@ -from libcloud.dns.providers import get_driver from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver -CREDENTIALS_ZERIGO = ('email', 'api key') -ZONE_ID = 'example.myzone.com' +CREDENTIALS_ZERIGO = ("email", "api key") +ZONE_ID = "example.myzone.com" Cls = get_driver(Provider.ZERIGO) driver = Cls(*CREDENTIALS_ZERIGO) diff --git a/docs/examples/dns/export_zone_to_bind_format_file.py b/docs/examples/dns/export_zone_to_bind_format_file.py index cd70990c96..0e3f01de7f 100644 --- a/docs/examples/dns/export_zone_to_bind_format_file.py +++ b/docs/examples/dns/export_zone_to_bind_format_file.py @@ -1,11 +1,11 @@ -from libcloud.dns.providers import get_driver from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver -CREDENTIALS_ZERIGO = ('email', 'api key') -ZONE_ID = 'example.myzone.com' +CREDENTIALS_ZERIGO = ("email", "api key") +ZONE_ID = "example.myzone.com" Cls = get_driver(Provider.ZERIGO) driver = Cls(*CREDENTIALS_ZERIGO) zone = driver.get_zone(zone_id=ZONE_ID) -zone.export_to_bind_zone_file(file_path='/home/user/example.com') +zone.export_to_bind_zone_file(file_path="/home/user/example.com") diff --git a/docs/examples/dns/godaddy/__init__.py b/docs/examples/dns/godaddy/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/godaddy/adding_records.py b/docs/examples/dns/godaddy/adding_records.py new file mode 100644 index 0000000000..06a44c3410 --- /dev/null +++ b/docs/examples/dns/godaddy/adding_records.py @@ -0,0 +1,7 @@ +from libcloud.dns.types import Provider, RecordType +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.GODADDY) +driver = cls("customer_id", "api_key", "api_secret") +zone = driver.get_zone("waffle-machines.com") +record = zone.create_record(name="www", type=RecordType.A, data="127.0.0.1", ttl=5) diff --git a/docs/examples/dns/godaddy/instantiate_driver.py b/docs/examples/dns/godaddy/instantiate_driver.py new file mode 100644 index 0000000000..e9f18787f0 --- /dev/null +++ b/docs/examples/dns/godaddy/instantiate_driver.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.GODADDY) +driver = cls("customer_id", "api_key", "api_secret") diff --git a/docs/examples/dns/godaddy/listing_records.py b/docs/examples/dns/godaddy/listing_records.py new file mode 100644 index 0000000000..5aca237c3d --- /dev/null +++ b/docs/examples/dns/godaddy/listing_records.py @@ -0,0 +1,12 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.GODADDY) +driver = cls("customer_id", "api_key", "api_secret") + +zone = driver.get_zone("wazzle-flooble.com") +records = driver.list_records(zone) +for record in records: + print("Type : {}".format(record.type)) + print("Data: {}".format(record.data)) + print("TTL: {}".format(record.ttl)) diff --git a/docs/examples/dns/godaddy/listing_zones.py b/docs/examples/dns/godaddy/listing_zones.py new file mode 100644 index 0000000000..4a2cf13b89 --- /dev/null +++ b/docs/examples/dns/godaddy/listing_zones.py @@ -0,0 +1,10 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.GODADDY) +driver = cls("customer_id", "api_key", "api_secret") + +zones = driver.list_zones() +for zone in zones: + print("Domain : {}".format(zone.domain)) + print("Expires: {}".format(zone.extra["expires"])) diff --git a/docs/examples/dns/godaddy/pricing_domain.py b/docs/examples/dns/godaddy/pricing_domain.py new file mode 100644 index 0000000000..6e960d21f2 --- /dev/null +++ b/docs/examples/dns/godaddy/pricing_domain.py @@ -0,0 +1,11 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.GODADDY) +driver = cls("customer_id", "api_key", "api_secret") + +check = driver.ex_check_availability("wazzlewobbleflooble.com") +if check.available is True: + print("Domain is available for {} {}".format(check.price, check.currency)) +else: + print("Domain is taken") diff --git a/docs/examples/dns/godaddy/purchasing_domain.py b/docs/examples/dns/godaddy/purchasing_domain.py new file mode 100644 index 0000000000..7c1169cafc --- /dev/null +++ b/docs/examples/dns/godaddy/purchasing_domain.py @@ -0,0 +1,16 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.GODADDY) +driver = cls("customer_id", "api_key", "api_secret") + +# Get the JSON schema for the domain +schema = driver.ex_get_purchase_schema("com") + +# Use this schema to prepare a purchase request document + +# Load a JSON document that has the completed purchase request +file = open("purchase_request.json") +document = file.read() +order = driver.ex_purchase_domain(document) +print("Made request : order ID : %s" % order.order_id) diff --git a/docs/examples/dns/godaddy/updating_records.py b/docs/examples/dns/godaddy/updating_records.py new file mode 100644 index 0000000000..7faef2af8c --- /dev/null +++ b/docs/examples/dns/godaddy/updating_records.py @@ -0,0 +1,8 @@ +from libcloud.dns.types import Provider, RecordType +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.GODADDY) +driver = cls("customer_id", "api_key", "api_secret") + +record = driver.get_record("waffle-machines.com", "www:A") +record = driver.update_record(record=record, name="www", type=RecordType.A, data="50.63.202.22") diff --git a/docs/examples/dns/google/dns_installed_application.py b/docs/examples/dns/google/dns_installed_application.py new file mode 100644 index 0000000000..ed8af99d5c --- /dev/null +++ b/docs/examples/dns/google/dns_installed_application.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +DNSDriver = get_driver(Provider.GOOGLE) +driver = DNSDriver("client ID", "client secret", project="project ID") diff --git a/docs/examples/dns/google/dns_internal_auth.py b/docs/examples/dns/google/dns_internal_auth.py new file mode 100644 index 0000000000..6a469f6d10 --- /dev/null +++ b/docs/examples/dns/google/dns_internal_auth.py @@ -0,0 +1,7 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +# This example assumes you are running an instance within Google Compute Engine +# in which case you only need to provide the project ID. +DNSDriver = get_driver(Provider.GOOGLE) +driver = DNSDriver("", "", project="project ID") diff --git a/docs/examples/dns/google/dns_service_account.py b/docs/examples/dns/google/dns_service_account.py new file mode 100644 index 0000000000..54c9b23e4b --- /dev/null +++ b/docs/examples/dns/google/dns_service_account.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +DNSDriver = get_driver(Provider.GOOGLE) +driver = DNSDriver("service account email", "keyfile location", project="project ID") diff --git a/docs/examples/dns/google/dns_service_account_infile.py b/docs/examples/dns/google/dns_service_account_infile.py new file mode 100644 index 0000000000..d446e2a8cb --- /dev/null +++ b/docs/examples/dns/google/dns_service_account_infile.py @@ -0,0 +1,13 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +credentials = { + "type": "service_account", + "project_id": "my_project", + "private_key": "-----BEGIN PRIVATE KEY-----\nmy_private_key_data\n" + "-----END PRIVATE KEY-----\n", + "client_email": "my_email", +} + +DNSDriver = get_driver(Provider.GOOGLE) +driver = DNSDriver("your_service_account_email", credentials, "your_project_id") diff --git a/docs/examples/dns/hostvirtual/instantiate_driver.py b/docs/examples/dns/hostvirtual/instantiate_driver.py deleted file mode 100644 index 51aa0f718f..0000000000 --- a/docs/examples/dns/hostvirtual/instantiate_driver.py +++ /dev/null @@ -1,5 +0,0 @@ -from libcloud.dns.types import Provider -from libcloud.dns.providers import get_driver - -cls = get_driver(Provider.HOSTVIRTUAL) -driver = cls(key='my secret key') diff --git a/docs/examples/dns/liquidweb/__init__.py b/docs/examples/dns/liquidweb/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/liquidweb/instantiate_driver.py b/docs/examples/dns/liquidweb/instantiate_driver.py new file mode 100644 index 0000000000..604c8efb3e --- /dev/null +++ b/docs/examples/dns/liquidweb/instantiate_driver.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.LIQUIDWEB) +driver = cls(user_id="user", key="api_key") diff --git a/docs/examples/dns/list_zone_records.py b/docs/examples/dns/list_zone_records.py index 86e4987f6c..fbbe2cb56f 100644 --- a/docs/examples/dns/list_zone_records.py +++ b/docs/examples/dns/list_zone_records.py @@ -1,8 +1,8 @@ -from libcloud.dns.providers import get_driver from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver -CREDENTIALS_ZERIGO = ('email', 'api key') -ZONE_ID = 'example.myzone.com' +CREDENTIALS_ZERIGO = ("email", "api key") +ZONE_ID = "example.myzone.com" Cls = get_driver(Provider.ZERIGO) driver = Cls(*CREDENTIALS_ZERIGO) diff --git a/docs/examples/dns/list_zone_records_manual_instantiation.py b/docs/examples/dns/list_zone_records_manual_instantiation.py index e6d77f294c..2aecd85786 100644 --- a/docs/examples/dns/list_zone_records_manual_instantiation.py +++ b/docs/examples/dns/list_zone_records_manual_instantiation.py @@ -1,13 +1,12 @@ from libcloud.dns.base import Zone -from libcloud.dns.providers import get_driver from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver -CREDENTIALS_ZERIGO = ('email', 'api key') -ZONE_ID = 'example.myzone.com' +CREDENTIALS_ZERIGO = ("email", "api key") +ZONE_ID = "example.myzone.com" Cls = get_driver(Provider.ZERIGO) driver = Cls(*CREDENTIALS_ZERIGO) -zone = Zone(ZONE_ID, domain=None, type=None, ttl=None, - driver=driver) +zone = Zone(ZONE_ID, domain=None, type=None, ttl=None, driver=driver) records = driver.list_records(zone=zone) diff --git a/docs/examples/dns/luadns/__init__.py b/docs/examples/dns/luadns/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/luadns/instantiate_driver.py b/docs/examples/dns/luadns/instantiate_driver.py new file mode 100644 index 0000000000..425bcb38e5 --- /dev/null +++ b/docs/examples/dns/luadns/instantiate_driver.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.LUADNS) +driver = cls(key="user", secret="api_key") diff --git a/docs/examples/dns/nfsn/__init__.py b/docs/examples/dns/nfsn/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/nfsn/instantiate_driver.py b/docs/examples/dns/nfsn/instantiate_driver.py new file mode 100644 index 0000000000..c1c965eb80 --- /dev/null +++ b/docs/examples/dns/nfsn/instantiate_driver.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.NFSN) +driver = cls("", "") diff --git a/docs/examples/dns/onapp/__init__.py b/docs/examples/dns/onapp/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/onapp/instantiate_driver.py b/docs/examples/dns/onapp/instantiate_driver.py new file mode 100644 index 0000000000..ad88a6cf21 --- /dev/null +++ b/docs/examples/dns/onapp/instantiate_driver.py @@ -0,0 +1,9 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +username = "your account username" +password = "your account password" +host = "onapp.test" + +cls = get_driver(Provider.ONAPP) +driver = cls(key=username, secret=password, host=host) diff --git a/docs/examples/dns/pointdns/__init__.py b/docs/examples/dns/pointdns/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/pointdns/instantiate_driver.py b/docs/examples/dns/pointdns/instantiate_driver.py new file mode 100644 index 0000000000..048f795b60 --- /dev/null +++ b/docs/examples/dns/pointdns/instantiate_driver.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.POINTDNS) +driver = cls("username", "apikey") diff --git a/docs/examples/dns/powerdns/__init__.py b/docs/examples/dns/powerdns/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/powerdns/instantiate_driver.py b/docs/examples/dns/powerdns/instantiate_driver.py new file mode 100644 index 0000000000..1afc1eb4f3 --- /dev/null +++ b/docs/examples/dns/powerdns/instantiate_driver.py @@ -0,0 +1,12 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.POWERDNS) + +# powerdns3.example.com is running PowerDNS v3.x. +driver = cls(key="changeme", host="powerdns3.example.com", port=8081) + +# OR: + +# powerdns4.example.com is running PowerDNS v4.x, so it uses api_version v1. +driver = cls(key="changeme", host="powerdns4.example.com", port=8081, api_version="v1") diff --git a/docs/examples/dns/rcodezero/__init__.py b/docs/examples/dns/rcodezero/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/rcodezero/instantiate_driver.py b/docs/examples/dns/rcodezero/instantiate_driver.py new file mode 100644 index 0000000000..9a04c259df --- /dev/null +++ b/docs/examples/dns/rcodezero/instantiate_driver.py @@ -0,0 +1,10 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.RCODEZERO) + +APIKEY_RCODEZERO = "secrettoken" +API_HOST = "my.rcodezero.at" + +cls = get_driver(Provider.RCODEZERO) +driver = cls(APIKEY_RCODEZERO, host=API_HOST) diff --git a/docs/examples/dns/vultr/__init__.py b/docs/examples/dns/vultr/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/vultr/instantiate_driver.py b/docs/examples/dns/vultr/instantiate_driver.py new file mode 100644 index 0000000000..aed5cd1c63 --- /dev/null +++ b/docs/examples/dns/vultr/instantiate_driver.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.VULTR) +driver = cls(key="api_key") diff --git a/docs/examples/dns/worldwidedns/__init__.py b/docs/examples/dns/worldwidedns/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/worldwidedns/instantiate_driver.py b/docs/examples/dns/worldwidedns/instantiate_driver.py new file mode 100644 index 0000000000..cf3267f11e --- /dev/null +++ b/docs/examples/dns/worldwidedns/instantiate_driver.py @@ -0,0 +1,10 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.WORLDWIDEDNS) + +# Normal account +driver = cls("username", "apikey") + +# Reseller account +driver = cls("username", "apikey", reseller_id="reseller_id") diff --git a/docs/examples/dns/zonomi/__init__.py b/docs/examples/dns/zonomi/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/dns/zonomi/instantiate_driver.py b/docs/examples/dns/zonomi/instantiate_driver.py new file mode 100644 index 0000000000..88a91f296d --- /dev/null +++ b/docs/examples/dns/zonomi/instantiate_driver.py @@ -0,0 +1,5 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +cls = get_driver(Provider.ZONOMI) +driver = cls("apikey") diff --git a/docs/examples/http_proxy/__init__.py b/docs/examples/http_proxy/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/http_proxy/constructor_argument.py b/docs/examples/http_proxy/constructor_argument.py index 3542bebd48..a50c131e09 100644 --- a/docs/examples/http_proxy/constructor_argument.py +++ b/docs/examples/http_proxy/constructor_argument.py @@ -1,7 +1,13 @@ -from libcloud.compute.drivers.dreamhost import DreamhostConnection +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver -PROXY_URL_NO_AUTH = 'http://:' -PROXY_URL_BASIC_AUTH = 'http://:@:' +HTTP_PROXY_URL_NO_AUTH_1 = "http://:" +HTTPS_PROXY_URL_NO_AUTH_1 = "https://:" -conn = DreamhostConnection(host='dreamhost.com', port=443, - timeout=None, proxy_url=PROXY_URL_NO_AUTH) +cls = get_driver(Provider.RACKSPACE) + +# 1. Use http proxy +driver = cls("username", "api key", region="ord", proxy_url=HTTP_PROXY_URL_NO_AUTH_1) + +# 2. Use https proxy +driver = cls("username", "api key", region="ord", proxy_url=HTTPS_PROXY_URL_NO_AUTH_1) diff --git a/docs/examples/http_proxy/https_proxy.py b/docs/examples/http_proxy/https_proxy.py new file mode 100644 index 0000000000..94449d7317 --- /dev/null +++ b/docs/examples/http_proxy/https_proxy.py @@ -0,0 +1,19 @@ +import os.path +from pprint import pprint + +import libcloud.security +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +HTTPS_PROXY_URL_NO_AUTH = "https://:" + +# 1. Use a custom CA bundle which is used by proxy server +# This example uses CA cert bundle used by mitmproxy proxy server +libcloud.security.CA_CERTS_PATH = os.path.expanduser("~/.mitmproxy/mitmproxy-ca-cert.pem") + +# User an https proxy for subsequent requests +cls = get_driver(Provider.RACKSPACE) +driver = cls("username", "api key") + +driver.connection.connection.set_http_proxy(proxy_url=HTTPS_PROXY_URL_NO_AUTH) +pprint(driver.list_nodes()) diff --git a/docs/examples/http_proxy/set_http_proxy_method.py b/docs/examples/http_proxy/set_http_proxy_method.py index 9cebf971b3..e3d0bbcb20 100644 --- a/docs/examples/http_proxy/set_http_proxy_method.py +++ b/docs/examples/http_proxy/set_http_proxy_method.py @@ -3,17 +3,17 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver -PROXY_URL_NO_AUTH_1 = 'http://:' -PROXY_URL_NO_AUTH_2 = 'http://:' -PROXY_URL_BASIC_AUTH = 'http://:@:' +HTTP_PROXY_URL_NO_AUTH_1 = "http://:" +HTTP_PROXY_URL_NO_AUTH_2 = "http://:" +HTTP_PROXY_URL_BASIC_AUTH = "http://:@:" cls = get_driver(Provider.RACKSPACE) -driver = cls('username', 'api key', region='ord') +driver = cls("username", "api key", region="ord") # Use proxy 1 for this request -driver.connection.set_http_proxy(proxy_url=PROXY_URL_NO_AUTH_1) +driver.connection.connection.set_http_proxy(proxy_url=HTTP_PROXY_URL_NO_AUTH_1) pprint(driver.list_nodes()) # Use proxy 2 for this request -driver.connection.set_http_proxy(proxy_url=PROXY_URL_NO_AUTH_2) +driver.connection.connection.set_http_proxy(proxy_url=HTTP_PROXY_URL_NO_AUTH_2) pprint(driver.list_nodes()) diff --git a/docs/examples/loadbalancer/__init__.py b/docs/examples/loadbalancer/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/loadbalancer/create_lb_wait_for_ready.py b/docs/examples/loadbalancer/create_lb_wait_for_ready.py index f67d98d2cf..46e83f2027 100644 --- a/docs/examples/loadbalancer/create_lb_wait_for_ready.py +++ b/docs/examples/loadbalancer/create_lb_wait_for_ready.py @@ -5,30 +5,31 @@ from libcloud.loadbalancer.types import State, Provider from libcloud.loadbalancer.providers import get_driver +driver = get_driver(Provider.RACKSPACE_US)("username", "api key") -driver = get_driver(Provider.RACKSPACE_US)('username', 'api key') +name = "test-lb" +members = (Member(None, "192.168.86.1", 8080), Member(None, "192.168.86.2", 8080)) -name = 'test-lb' -members = (Member(None, '192.168.86.1', 8080), - Member(None, '192.168.86.2', 8080)) +print("Creating load balancer") +new_balancer = driver.create_balancer( + name=name, + algorithm=Algorithm.ROUND_ROBIN, + port=80, + protocol="http", + members=members, +) -print 'Creating load balancer' -new_balancer = driver.create_balancer(name=name, - algorithm=Algorithm.ROUND_ROBIN, - port=80, protocol='http', - members=members) - -print 'Waiting for load balancer to become ready...' +print("Waiting for load balancer to become ready...") while True: balancer = driver.get_balancer(balancer_id=new_balancer.id) if balancer.state == State.RUNNING: break - print 'Load balancer not ready yet, sleeping 20 seconds...' + print("Load balancer not ready yet, sleeping 20 seconds...") time.sleep(20) -print 'Load balancer is ready' +print("Load balancer is ready") pprint(balancer) # fetch list of members diff --git a/docs/examples/loadbalancer/elb/__init__.py b/docs/examples/loadbalancer/elb/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/loadbalancer/elb/complete_tut.py b/docs/examples/loadbalancer/elb/complete_tut.py index 7191ddc8d6..df5b703c05 100644 --- a/docs/examples/loadbalancer/elb/complete_tut.py +++ b/docs/examples/loadbalancer/elb/complete_tut.py @@ -2,9 +2,8 @@ from libcloud.loadbalancer.types import Provider from libcloud.loadbalancer.providers import get_driver - -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" def main(): @@ -14,47 +13,48 @@ def main(): print(driver.list_balancers()) # members associated with the load balancer - members = (Member(None, '192.168.88.1', 8000), - Member(None, '192.168.88.2', 8080)) + members = (Member(None, "192.168.88.1", 8000), Member(None, "192.168.88.2", 8080)) # creates a new balancer named 'MyLB' new_balancer = driver.create_balancer( - name='MyLB', + name="MyLB", algorithm=Algorithm.ROUND_ROBIN, port=80, - protocol='http', - members=members) + protocol="http", + members=members, + ) print(new_balancer) # create load balancer policy - print driver.ex_create_balancer_policy( - name='MyLB', - policy_name='EnableProxyProtocol', - policy_type='ProxyProtocolPolicyType', - policy_attributes={'ProxyProtocol': 'true'}) + print( + driver.ex_create_balancer_policy( + name="MyLB", + policy_name="EnableProxyProtocol", + policy_type="ProxyProtocolPolicyType", + policy_attributes={"ProxyProtocol": "true"}, + ) + ) # delete load balancer policy - print driver.ex_delete_balancer_policy( - name='MyLB', - policy_name='EnableProxyProtocol') + print(driver.ex_delete_balancer_policy(name="MyLB", policy_name="EnableProxyProtocol")) # set load balancer policies for backend server - print driver.ex_set_balancer_policies_backend_server( - name='MyLB', - port=80, - policies=['MyDurationStickyPolicy']) + print( + driver.ex_set_balancer_policies_backend_server( + name="MyLB", port=80, policies=["MyDurationStickyPolicy"] + ) + ) # create the listeners for the balancers - print driver.ex_create_balancer_listeners( - name='MyLB', - listeners=[[1024, 65533, 'HTTPS', - 'arn:aws:iam::123456789012:server-certificate/servercert']]) + uid = "arn:aws:iam::123456789012:server-certificate/servercert" + print(driver.ex_create_balancer_listeners(name="MyLB", listeners=[[1024, 65533, "HTTPS", uid]])) # set the listeners policies for the balancers - print driver.ex_set_balancer_policies_listener( - name='MyLB', - port=80, - policies=['MyDurationStickyPolicy']) + print( + driver.ex_set_balancer_policies_listener( + name="MyLB", port=80, policies=["MyDurationStickyPolicy"] + ) + ) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/docs/examples/loadbalancer/elb/create_lb_connection_for_aws.py b/docs/examples/loadbalancer/elb/create_lb_connection_for_aws.py index 62a767da0b..aa890a548f 100644 --- a/docs/examples/loadbalancer/elb/create_lb_connection_for_aws.py +++ b/docs/examples/loadbalancer/elb/create_lb_connection_for_aws.py @@ -1,8 +1,8 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver +from libcloud.loadbalancer.types import Provider +from libcloud.loadbalancer.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" cls = get_driver(Provider.ELB) driver = cls(key=ACCESS_ID, secret=SECRET_KEY) diff --git a/docs/examples/loadbalancer/elb/create_lb_policy.py b/docs/examples/loadbalancer/elb/create_lb_policy.py index faa6645c6d..9eea95730b 100644 --- a/docs/examples/loadbalancer/elb/create_lb_policy.py +++ b/docs/examples/loadbalancer/elb/create_lb_policy.py @@ -1,8 +1,8 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver +from libcloud.loadbalancer.types import Provider +from libcloud.loadbalancer.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" cls = get_driver(Provider.ELB) driver = cls(key=ACCESS_ID, secret=SECRET_KEY) @@ -11,7 +11,8 @@ # create load balancer policy driver.ex_create_balancer_policy( - name='MyLB', - policy_name='EnableProxyProtocol', - policy_type='ProxyProtocolPolicyType', - policy_attributes={'ProxyProtocol': 'true'}) + name="MyLB", + policy_name="EnableProxyProtocol", + policy_type="ProxyProtocolPolicyType", + policy_attributes={"ProxyProtocol": "true"}, +) diff --git a/docs/examples/loadbalancer/elb/create_load_balancer.py b/docs/examples/loadbalancer/elb/create_load_balancer.py index 26735774cb..577db66bf6 100644 --- a/docs/examples/loadbalancer/elb/create_load_balancer.py +++ b/docs/examples/loadbalancer/elb/create_load_balancer.py @@ -1,9 +1,9 @@ from libcloud.loadbalancer.base import Member, Algorithm -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver +from libcloud.loadbalancer.types import Provider +from libcloud.loadbalancer.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" cls = get_driver(Provider.ELB) driver = cls(key=ACCESS_ID, secret=SECRET_KEY) @@ -11,13 +11,13 @@ print(driver.list_balancers()) # members associated with the load balancer -members = (Member(None, '192.168.88.1', 8000), - Member(None, '192.168.88.2', 8080)) +members = (Member(None, "192.168.88.1", 8000), Member(None, "192.168.88.2", 8080)) new_balancer = driver.create_balancer( - name='MyLB', + name="MyLB", algorithm=Algorithm.ROUND_ROBIN, port=80, - protocol='http', - members=members) + protocol="http", + members=members, +) print(new_balancer) diff --git a/docs/examples/loadbalancer/elb/ex_create_balancer_listeners.py b/docs/examples/loadbalancer/elb/ex_create_balancer_listeners.py index d735d3a76a..6d6df8d267 100644 --- a/docs/examples/loadbalancer/elb/ex_create_balancer_listeners.py +++ b/docs/examples/loadbalancer/elb/ex_create_balancer_listeners.py @@ -1,13 +1,20 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver +from libcloud.loadbalancer.types import Provider +from libcloud.loadbalancer.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" cls = get_driver(Provider.ELB) driver = cls(key=ACCESS_ID, secret=SECRET_KEY) driver.ex_create_balancer_listeners( - name='MyLB', - listeners=[[1024, 65533, 'HTTPS', - 'arn:aws:iam::123456789012:server-certificate/servercert']]) + name="MyLB", + listeners=[ + [ + 1024, + 65533, + "HTTPS", + "arn:aws:iam::123456789012:server-certificate/servercert", + ] + ], +) diff --git a/docs/examples/loadbalancer/elb/ex_delete_balancer_policy.py b/docs/examples/loadbalancer/elb/ex_delete_balancer_policy.py index d041c6f639..8ddefb64eb 100644 --- a/docs/examples/loadbalancer/elb/ex_delete_balancer_policy.py +++ b/docs/examples/loadbalancer/elb/ex_delete_balancer_policy.py @@ -1,12 +1,10 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver +from libcloud.loadbalancer.types import Provider +from libcloud.loadbalancer.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" cls = get_driver(Provider.ELB) driver = cls(key=ACCESS_ID, secret=SECRET_KEY) -driver.ex_delete_balancer_policy( - name='MyLB', - policy_name='EnableProxyProtocol') +driver.ex_delete_balancer_policy(name="MyLB", policy_name="EnableProxyProtocol") diff --git a/docs/examples/loadbalancer/elb/ex_list_balancer_policies.py b/docs/examples/loadbalancer/elb/ex_list_balancer_policies.py index 1356df1602..2dc1f7d98a 100644 --- a/docs/examples/loadbalancer/elb/ex_list_balancer_policies.py +++ b/docs/examples/loadbalancer/elb/ex_list_balancer_policies.py @@ -1,8 +1,8 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver +from libcloud.loadbalancer.types import Provider +from libcloud.loadbalancer.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" cls = get_driver(Provider.ELB) driver = cls(key=ACCESS_ID, secret=SECRET_KEY) diff --git a/docs/examples/loadbalancer/elb/ex_list_balancer_policy_types.py b/docs/examples/loadbalancer/elb/ex_list_balancer_policy_types.py index 198a9f2dde..b4c933b8e9 100644 --- a/docs/examples/loadbalancer/elb/ex_list_balancer_policy_types.py +++ b/docs/examples/loadbalancer/elb/ex_list_balancer_policy_types.py @@ -1,8 +1,8 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver +from libcloud.loadbalancer.types import Provider +from libcloud.loadbalancer.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" cls = get_driver(Provider.ELB) driver = cls(key=ACCESS_ID, secret=SECRET_KEY) diff --git a/docs/examples/loadbalancer/elb/ex_set_balancer_policies_backend_server.py b/docs/examples/loadbalancer/elb/ex_set_balancer_policies_backend_server.py index 5168040abd..86150778b5 100644 --- a/docs/examples/loadbalancer/elb/ex_set_balancer_policies_backend_server.py +++ b/docs/examples/loadbalancer/elb/ex_set_balancer_policies_backend_server.py @@ -1,13 +1,12 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver +from libcloud.loadbalancer.types import Provider +from libcloud.loadbalancer.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" cls = get_driver(Provider.ELB) driver = cls(key=ACCESS_ID, secret=SECRET_KEY) driver.ex_set_balancer_policies_backend_server( - name='MyLB', - port=80, - policies=['MyDurationStickyPolicy']) + name="MyLB", port=80, policies=["MyDurationStickyPolicy"] +) diff --git a/docs/examples/loadbalancer/elb/ex_set_balancer_policies_listener.py b/docs/examples/loadbalancer/elb/ex_set_balancer_policies_listener.py index 2abfa86e1b..37ebffeaf7 100644 --- a/docs/examples/loadbalancer/elb/ex_set_balancer_policies_listener.py +++ b/docs/examples/loadbalancer/elb/ex_set_balancer_policies_listener.py @@ -1,13 +1,10 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver +from libcloud.loadbalancer.types import Provider +from libcloud.loadbalancer.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" cls = get_driver(Provider.ELB) driver = cls(key=ACCESS_ID, secret=SECRET_KEY) -driver.ex_set_balancer_policies_listener( - name='MyLB', - port=80, - policies=['MyDurationStickyPolicy']) +driver.ex_set_balancer_policies_listener(name="MyLB", port=80, policies=["MyDurationStickyPolicy"]) diff --git a/docs/examples/loadbalancer/elb/list_load_balancer.py b/docs/examples/loadbalancer/elb/list_load_balancer.py index 5b5c834b4f..4a558c3551 100644 --- a/docs/examples/loadbalancer/elb/list_load_balancer.py +++ b/docs/examples/loadbalancer/elb/list_load_balancer.py @@ -1,8 +1,8 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver +from libcloud.loadbalancer.types import Provider +from libcloud.loadbalancer.providers import get_driver -ACCESS_ID = 'your access id' -SECRET_KEY = 'your secret key' +ACCESS_ID = "your access id" +SECRET_KEY = "your secret key" cls = get_driver(Provider.ELB) driver = cls(key=ACCESS_ID, secret=SECRET_KEY) diff --git a/docs/examples/loadbalancer/gce/__init__.py b/docs/examples/loadbalancer/gce/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/loadbalancer/gce/gce_authentication.py b/docs/examples/loadbalancer/gce/gce_authentication.py index 1d6c7df98e..8a4aaf6172 100644 --- a/docs/examples/loadbalancer/gce/gce_authentication.py +++ b/docs/examples/loadbalancer/gce/gce_authentication.py @@ -2,6 +2,8 @@ from libcloud.loadbalancer.providers import get_driver LoadBalancer = get_driver(Provider.GCE) -driver = LoadBalancer('service_account_email_or_client_id', - 'pem_file_or_client_secret', - project='your_project_id') +driver = LoadBalancer( + "service_account_email_or_client_id", + "pem_file_or_client_secret", + project="your_project_id", +) diff --git a/docs/examples/loadbalancer/gce/gce_driver.py b/docs/examples/loadbalancer/gce/gce_driver.py index c26f15eb32..fa52f42276 100644 --- a/docs/examples/loadbalancer/gce/gce_driver.py +++ b/docs/examples/loadbalancer/gce/gce_driver.py @@ -1,13 +1,14 @@ from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver - from libcloud.loadbalancer.types import Provider as LBProvider from libcloud.loadbalancer.providers import get_driver as lb_get_driver ComputeEngine = get_driver(Provider.GCE) -gce_driver = ComputeEngine('service_account_email_or_client_id', - 'pem_file_or_client_secret', - project='your_project_id') +gce_driver = ComputeEngine( + "service_account_email_or_client_id", + "pem_file_or_client_secret", + project="your_project_id", +) LoadBalancer = lb_get_driver(LBProvider.GCE) lb_driver = LoadBalancer(gce_driver=gce_driver) diff --git a/docs/examples/loadbalancer/gce/gce_service_account_infile.py b/docs/examples/loadbalancer/gce/gce_service_account_infile.py new file mode 100644 index 0000000000..52a1b6c1a1 --- /dev/null +++ b/docs/examples/loadbalancer/gce/gce_service_account_infile.py @@ -0,0 +1,13 @@ +from libcloud.loadbalancer.types import Provider +from libcloud.loadbalancer.providers import get_driver + +credentials = { + "type": "service_account", + "project_id": "my_project", + "private_key": "-----BEGIN PRIVATE KEY-----\nmy_private_key_data\n" + "-----END PRIVATE KEY-----\n", + "client_email": "my_email", +} + +LoadBalancer = get_driver(Provider.GCE) +driver = LoadBalancer("your_service_account_email", credentials, project="your_project_id") diff --git a/docs/examples/loadbalancer/nttcis/LoadBalancer_create_members.py b/docs/examples/loadbalancer/nttcis/LoadBalancer_create_members.py new file mode 100644 index 0000000000..f397e1daa1 --- /dev/null +++ b/docs/examples/loadbalancer/nttcis/LoadBalancer_create_members.py @@ -0,0 +1,40 @@ +# This example assumes servers to load balance +# already exist and will be pool members +import libcloud +from libcloud.loadbalancer.base import Algorithm + + +def create_load_balancer(): + # Compute driver to retrieve servers to be pool members (the nodes) + cls = libcloud.get_driver(libcloud.DriverType.COMPUTE, libcloud.DriverType.COMPUTE.NTTCIS) + compute_driver = cls("my_username", "my_pass", region="eu") + net_domain_name = "sdk_test_1" + net_domains = compute_driver.ex_list_network_domains(location="EU6") + net_domain_id = [d for d in net_domains if d.name == net_domain_name][0].id + # Load balancer driver to create and/or edit load balanceers + cls = libcloud.get_driver( + libcloud.DriverType.LOADBALANCER, libcloud.DriverType.LOADBALANCER.NTTCIS + ) + lbdriver = cls("my_username", net_domain_id, "my_pass", region="eu") + + member1 = compute_driver.list_nodes(ex_name="web1")[0] + member2 = compute_driver.list_nodes(ex_name="web2")[0] + members = [member1, member2] + name = "sdk_test_balancer" + port = "80" + listener_port = "8000" + protocol = "TCP" + algorithm = Algorithm.LEAST_CONNECTIONS_MEMBER + members = [m for m in members] + ex_listener_ip_address = "168.128.13.127" + lb = lbdriver.create_balancer( + name, + listener_port=listener_port, + port=port, + protocol=protocol, + algorithm=algorithm, + members=members, + optimization_profile="TCP", + ex_listener_ip_address=ex_listener_ip_address, + ) + print(lb) diff --git a/docs/examples/loadbalancer/nttcis/Load_balancer_add_pool_mon.py b/docs/examples/loadbalancer/nttcis/Load_balancer_add_pool_mon.py new file mode 100644 index 0000000000..1c57e32bbb --- /dev/null +++ b/docs/examples/loadbalancer/nttcis/Load_balancer_add_pool_mon.py @@ -0,0 +1,39 @@ +# This example adds monitoring to a pool + +import libcloud + + +def update_health_monitors(driver, network_domain, monitor_id): + pool_name = "sdk_test_balancer" + pools = driver.ex_get_pools(ex_network_domain_id=network_domain.id) + pool = [p for p in pools if p.name == pool_name][0] + pool.health_monitor_id = monitor_id + result = lbdriver.ex_update_pool(pool) + return result + + +def health_monitors(driver, network_domain): + monitors = driver.ex_get_default_health_monitors(network_domain) + return monitors + + +# Compute driver to create/edit virtual servers +cls = libcloud.get_driver(libcloud.DriverType.COMPUTE, libcloud.DriverType.COMPUTE.NTTCIS) +compute_driver = cls("my_username", "my_pass", region="eu") + +# Load balancer driver to create and/or edit load balanceers +cls = libcloud.get_driver(libcloud.DriverType.LOADBALANCER, libcloud.DriverType.LOADBALANCER.NTTCIS) + +net_domain_name = "sdk_test_1" +net_domains = compute_driver.ex_list_network_domains(location="EU6") +net_domain_id = [d for d in net_domains if d.name == net_domain_name][0].id +lbdriver = cls("my_username", net_domain_id, "my_pass", region="eu") + +# Get available health monitors +results = health_monitors(lbdriver, net_domains[0]) +for result in results: + print(result) + +# Add desired health monitor +result = update_health_monitors(lbdriver, net_domains[0], "9f79487a-1b6d-11e5-8d4f-180373fb68df") +assert result is True diff --git a/docs/examples/loadbalancer/nttcis/__init__.py b/docs/examples/loadbalancer/nttcis/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/loadbalancer/nttcis/create_ssl_offload_profile.py b/docs/examples/loadbalancer/nttcis/create_ssl_offload_profile.py new file mode 100644 index 0000000000..cc04e269dc --- /dev/null +++ b/docs/examples/loadbalancer/nttcis/create_ssl_offload_profile.py @@ -0,0 +1,28 @@ +# Create an SSL Offload Profile + +import libcloud + + +def create_ssl_profile(lbdriver): + # Identify the network domain to insert the profile into + net_domain_id = "6aafcf08-cb0b-432c-9c64-7371265db086" + name = "ssl_offload" + # Retrieve the domain certificate to be used int the profile + domain_cert = lbdriver.ex_list_ssl_domain_certs(name="alice")[0] + result = lbdriver.ex_create_ssl_offload_profile( + net_domain_id, name, domain_cert.id, ciphers="!ECDHE+AES-GCM:" + ) + assert result is True + + +def lbdriver(): + cls = libcloud.get_driver( + libcloud.DriverType.LOADBALANCER, libcloud.DriverType.LOADBALANCER.NTTCIS + ) + driver = cls("mitchgeo-test", "Snmpv2c!", region="eu") + return driver + + +if __name__ == "__main__": + lb = lbdriver() + create_ssl_profile(lb) diff --git a/docs/examples/loadbalancer/nttcis/edit_ssl_offload_profile.py b/docs/examples/loadbalancer/nttcis/edit_ssl_offload_profile.py new file mode 100644 index 0000000000..6430d465d3 --- /dev/null +++ b/docs/examples/loadbalancer/nttcis/edit_ssl_offload_profile.py @@ -0,0 +1,37 @@ +# This script demonstrates how to edit a profile + +import libcloud + + +def edit_ssl_offload_profile(lbdriver): + # Identify the wich profile by name to be edited + profile_name = "ssl_offload" + datacenter_id = "EU6" + profile = lbdriver.ex_list_ssl_offload_profiles(name=profile_name, datacenter_id=datacenter_id)[ + 0 + ] + # All elements must be passed to the edit method that + # would be required in creating a profile as well as what currently exists + # such as the current ciphers, unless ciphers were to be changed. + # Here a new description is being added. + result = lbdriver.ex_edit_ssl_offload_profile( + profile.id, + profile.name, + profile.sslDomainCertificate.id, + ciphers=profile.ciphers, + description="A test edit of an offload profile", + ) + assert result is True + + +def lbdriver(): + cls = libcloud.get_driver( + libcloud.DriverType.LOADBALANCER, libcloud.DriverType.LOADBALANCER.NTTCIS + ) + driver = cls("mitchgeo-test", "Snmpv2c!", region="eu") + return driver + + +if __name__ == "__main__": + lb = lbdriver() + edit_ssl_offload_profile(lb) diff --git a/docs/examples/loadbalancer/nttcis/import_ssl_cert.py b/docs/examples/loadbalancer/nttcis/import_ssl_cert.py new file mode 100644 index 0000000000..912659d914 --- /dev/null +++ b/docs/examples/loadbalancer/nttcis/import_ssl_cert.py @@ -0,0 +1,34 @@ +# This example shows importing an SSL Domain Certificate + +import libcloud + + +def insert_ssl(lbdriver, compute_driver): + net_dom_name = "sdk_test_1" + net_dom = compute_driver.ex_list_network_domains(name=net_dom_name)[0] + cert = "/home/mraful/client/bob.crt" + key = "/home/mraful/client/bob.key" + result = lbdriver.ex_import_ssl_domain_certificate( + net_dom.id, "bob", cert, key, description="test cert" + ) + assert result is True + + +def lbdriver(): + cls = libcloud.get_driver( + libcloud.DriverType.LOADBALANCER, libcloud.DriverType.LOADBALANCER.NTTCIS + ) + driver = cls("mitchgeo-test", "Snmpv2c!", region="eu") + return driver + + +def compute_driver(): + cls = libcloud.get_driver(libcloud.DriverType.COMPUTE, libcloud.DriverType.COMPUTE.NTTCIS) + driver = cls("mitchgeo-test", "Snmpv2c!", region="eu") + return driver + + +if __name__ == "__main__": + lb = lbdriver() + cd = compute_driver() + insert_ssl(lb, cd) diff --git a/docs/examples/loadbalancer/softlayer/add_list_remove_balancer_members.py b/docs/examples/loadbalancer/softlayer/add_list_remove_balancer_members.py deleted file mode 100644 index ad5bd3980c..0000000000 --- a/docs/examples/loadbalancer/softlayer/add_list_remove_balancer_members.py +++ /dev/null @@ -1,27 +0,0 @@ -from libcloud.loadbalancer.base import DEFAULT_ALGORITHM, Member -from libcloud.loadbalancer.types import Provider -from libcloud.loadbalancer.providers import get_driver - -USER_NAME = 'your user name' -SECRET_KEY = 'your secret key' - -cls = get_driver(Provider.SOFTLAYER) -driver = cls(key=USER_NAME, secret=SECRET_KEY) - -balancer = driver.list_balancers()[0] - -if balancer.port < 0: - # no front-end port defined, configure it with such one - driver.ex_configure_load_balancer(balancer, port=80, protocol='http', - algorithm=DEFAULT_ALGORITHM) - -member1 = balancer.attach_member(Member(None, '192.168.88.1', 8000)) -member2 = balancer.attach_member(Member(None, '192.168.88.2', 8080)) - -print(balancer.list_members()) - -balancer.detach_member(member1) -print(balancer.list_members()) - -balancer.detach_member(member2) -print(balancer.list_members()) diff --git a/docs/examples/loadbalancer/softlayer/destroy_balancer.py b/docs/examples/loadbalancer/softlayer/destroy_balancer.py deleted file mode 100644 index 4ccc0d8429..0000000000 --- a/docs/examples/loadbalancer/softlayer/destroy_balancer.py +++ /dev/null @@ -1,11 +0,0 @@ -from libcloud.loadbalancer.types import Provider -from libcloud.loadbalancer.providers import get_driver - -USER_NAME = 'your user name' -SECRET_KEY = 'your secret key' - -cls = get_driver(Provider.SOFTLAYER) -driver = cls(key=USER_NAME, secret=SECRET_KEY) - -balancer = driver.list_balancers()[0] -balancer.destroy() diff --git a/docs/examples/loadbalancer/softlayer/ex_place_balancer_order.py b/docs/examples/loadbalancer/softlayer/ex_place_balancer_order.py deleted file mode 100644 index ad921993d9..0000000000 --- a/docs/examples/loadbalancer/softlayer/ex_place_balancer_order.py +++ /dev/null @@ -1,24 +0,0 @@ -from libcloud.compute.base import NodeLocation - -from libcloud.loadbalancer.types import Provider -from libcloud.loadbalancer.providers import get_driver - -USER_NAME = 'your user name' -SECRET_KEY = 'your secret key' - -cls = get_driver(Provider.SOFTLAYER) -driver = cls(key=USER_NAME, secret=SECRET_KEY) - -# order loadbalancer with a capacity of 50 connections -CAPACITY = 50 -# create the balancer in Dallas 5 datacenter -DATACENTER = 'dal05' - -# select package to create balancer from -packages = driver.ex_list_balancer_packages() -lb_package = [p for p in packages if p.capacity == CAPACITY][0] - -driver.ex_place_balancer_order(lb_package, - NodeLocation(DATACENTER, None, None, None)) - -print('Successfully submitted oder request, from package %s' % (lb_package)) diff --git a/docs/examples/loadbalancer/softlayer/list_balancers.py b/docs/examples/loadbalancer/softlayer/list_balancers.py deleted file mode 100644 index 18e68414e8..0000000000 --- a/docs/examples/loadbalancer/softlayer/list_balancers.py +++ /dev/null @@ -1,13 +0,0 @@ -from libcloud.loadbalancer.types import Provider -from libcloud.loadbalancer.providers import get_driver - -USER_NAME = 'your user name' -SECRET_KEY = 'your secret key' - -cls = get_driver(Provider.SOFTLAYER) -driver = cls(key=USER_NAME, secret=SECRET_KEY) - -balancers = driver.list_balancers() - -for balancer in balancers: - print('%s %s' % (balancer, balancer.extra)) diff --git a/docs/examples/misc/__init__.py b/docs/examples/misc/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/misc/twisted_create_node.py b/docs/examples/misc/twisted_create_node.py index e0109e17d7..755f286654 100644 --- a/docs/examples/misc/twisted_create_node.py +++ b/docs/examples/misc/twisted_create_node.py @@ -1,23 +1,22 @@ -from __future__ import absolute_import - from pprint import pprint -from twisted.internet import defer, threads, reactor +# pylint: disable=import-error +from twisted.internet import defer, reactor, threads + from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver @defer.inlineCallbacks def create_node(name): - node = yield threads.deferToThread(_thread_create_node, - name=name) + node = yield threads.deferToThread(_thread_create_node, name=name) pprint(node) reactor.stop() def _thread_create_node(name): Driver = get_driver(Provider.RACKSPACE) - conn = Driver('username', 'api key') + conn = Driver("username", "api key") image = conn.list_images()[0] size = conn.list_sizes()[0] node = conn.create_node(name=name, image=image, size=size) @@ -27,8 +26,9 @@ def _thread_create_node(name): def stop(*args, **kwargs): reactor.stop() -d = create_node(name='my-lc-node') -d.addCallback(stop) -d.addErrback(stop) + +d = create_node(name="my-lc-node") +d.addCallback(stop) # pylint: disable=no-member +d.addErrback(stop) # pylint: disable=no-member reactor.run() diff --git a/docs/examples/storage/__init__.py b/docs/examples/storage/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/storage/auroraobjects/__init__.py b/docs/examples/storage/auroraobjects/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/storage/auroraobjects/instantiate.py b/docs/examples/storage/auroraobjects/instantiate.py new file mode 100644 index 0000000000..86229967d2 --- /dev/null +++ b/docs/examples/storage/auroraobjects/instantiate.py @@ -0,0 +1,8 @@ +from libcloud.storage.types import Provider +from libcloud.storage.providers import get_driver + +access_key = "XXXXXX" +secret_key = "YYYYYY" + +cls = get_driver(Provider.AURORAOBJECTS) +driver = cls(access_key, secret_key) diff --git a/docs/examples/storage/azure/__init__.py b/docs/examples/storage/azure/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/storage/azure/instantiate.py b/docs/examples/storage/azure/instantiate.py index bc0a62aef1..ed32ca704d 100644 --- a/docs/examples/storage/azure/instantiate.py +++ b/docs/examples/storage/azure/instantiate.py @@ -3,5 +3,4 @@ cls = get_driver(Provider.AZURE_BLOBS) -driver = cls(key='your storage account name', - secret='your access key') +driver = cls(key="your storage account name", secret="your access key") diff --git a/docs/examples/storage/azure/instantiate_azure_ad.py b/docs/examples/storage/azure/instantiate_azure_ad.py new file mode 100644 index 0000000000..15c7dc5a91 --- /dev/null +++ b/docs/examples/storage/azure/instantiate_azure_ad.py @@ -0,0 +1,12 @@ +from build.lib.libcloud.storage.types import Provider +from build.lib.libcloud.storage.providers import get_driver + +cls = get_driver(Provider.AZURE_BLOBS) + +driver = cls( + key="your storage account name", + secret="your service principal secret key", + tenant_id="your tenant id", + identity="your service principal application id", + auth_type="azureAd", +) diff --git a/docs/examples/storage/azure/instantiate_azurite.py b/docs/examples/storage/azure/instantiate_azurite.py new file mode 100644 index 0000000000..f796537305 --- /dev/null +++ b/docs/examples/storage/azure/instantiate_azurite.py @@ -0,0 +1,13 @@ +from libcloud.storage.types import Provider +from libcloud.storage.providers import get_driver + +cls = get_driver(Provider.AZURE_BLOBS) + +driver = cls( + key="devstoreaccount1", + secret="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6" + "IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==", + host="localhost", + port=10000, + secure=False, +) diff --git a/docs/examples/storage/azure/instantiate_gov.py b/docs/examples/storage/azure/instantiate_gov.py new file mode 100644 index 0000000000..f983b95293 --- /dev/null +++ b/docs/examples/storage/azure/instantiate_gov.py @@ -0,0 +1,10 @@ +from libcloud.storage.types import Provider +from libcloud.storage.providers import get_driver + +cls = get_driver(Provider.AZURE_BLOBS) + +driver = cls( + key="your storage account name", + secret="your access key", + host="blob.core.usgovcloudapi.net", +) diff --git a/docs/examples/storage/backblaze_b2/__init__.py b/docs/examples/storage/backblaze_b2/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/storage/backblaze_b2/instantiate.py b/docs/examples/storage/backblaze_b2/instantiate.py new file mode 100644 index 0000000000..759b1d8cab --- /dev/null +++ b/docs/examples/storage/backblaze_b2/instantiate.py @@ -0,0 +1,8 @@ +from libcloud.storage.types import Provider +from libcloud.storage.providers import get_driver + +key_id = "XXXXXX" +application_key = "YYYYYY" + +cls = get_driver(Provider.BACKBLAZE_B2) +driver = cls(key_id, application_key) diff --git a/docs/examples/storage/concurrent_file_download_using_gevent.py b/docs/examples/storage/concurrent_file_download_using_gevent.py index 3bd90831c8..215f446d06 100644 --- a/docs/examples/storage/concurrent_file_download_using_gevent.py +++ b/docs/examples/storage/concurrent_file_download_using_gevent.py @@ -1,14 +1,16 @@ import os.path -from gevent import monkey -from gevent.pool import Pool -monkey.patch_all() +from gevent import monkey # pylint: disable=import-error +from gevent.pool import Pool # pylint: disable=import-error -from libcloud.storage.providers import get_driver from libcloud.storage.types import Provider +from libcloud.storage.providers import get_driver -USERNAME = 'username' -API_KEY = 'api key' +monkey.patch_all() + + +USERNAME = "username" +API_KEY = "api key" cls = get_driver(Provider.CLOUDFILES_US) driver = cls(USERNAME, API_KEY) @@ -16,13 +18,13 @@ def download_obj(container, obj): driver = cls(USERNAME, API_KEY) - obj = driver.get_object(container_name=container.name, - object_name=obj.name) + obj = driver.get_object(container_name=container.name, object_name=obj.name) filename = os.path.basename(obj.name) - path = os.path.join(os.path.expanduser('~/Downloads'), filename) - print 'Downloading: %s to %s' % (obj.name, path) + path = os.path.join(os.path.expanduser("~/Downloads"), filename) + print("Downloading: {} to {}".format(obj.name, path)) obj.download(destination_path=path) + containers = driver.list_containers() jobs = [] @@ -35,4 +37,4 @@ def download_obj(container, obj): pool.spawn(download_obj, container, obj) pool.join() -print 'Done' +print("Done") diff --git a/docs/examples/storage/create_directory_backup_stream_to_cf.py b/docs/examples/storage/create_directory_backup_stream_to_cf.py index 0c32617403..e3544d2fb9 100644 --- a/docs/examples/storage/create_directory_backup_stream_to_cf.py +++ b/docs/examples/storage/create_directory_backup_stream_to_cf.py @@ -4,13 +4,13 @@ from libcloud.storage.types import Provider, ContainerDoesNotExistError from libcloud.storage.providers import get_driver -driver = get_driver(Provider.CLOUDFILES_US)('username', 'api key') +driver = get_driver(Provider.CLOUDFILES_US)("username", "api key") -directory = '/home/some/path' -cmd = 'tar cvzpf - %s' % (directory) +directory = "/home/some/path" +cmd = "tar cvzpf - %s" % (directory) -object_name = 'backup-%s.tar.gz' % (datetime.now().strftime('%Y-%m-%d')) -container_name = 'backups' +object_name = "backup-%s.tar.gz" % (datetime.now().strftime("%Y-%m-%d")) +container_name = "backups" # Create a container if it doesn't already exist try: @@ -21,12 +21,11 @@ pipe = subprocess.Popen(cmd, bufsize=0, shell=True, stdout=subprocess.PIPE) return_code = pipe.poll() -print 'Uploading object...' +print("Uploading object...") while return_code is None: # Compress data in our directory and stream it directly to CF - obj = container.upload_object_via_stream(iterator=pipe.stdout, - object_name=object_name) + obj = container.upload_object_via_stream(iterator=pipe.stdout, object_name=object_name) return_code = pipe.poll() -print 'Upload complete, transferred: %s KB' % ((obj.size / 1024)) +print("Upload complete, transferred: %s KB" % (obj.size / 1024)) diff --git a/docs/examples/storage/digitalocean_spaces/__init__.py b/docs/examples/storage/digitalocean_spaces/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/storage/digitalocean_spaces/instantiate.py b/docs/examples/storage/digitalocean_spaces/instantiate.py new file mode 100644 index 0000000000..9aaf885489 --- /dev/null +++ b/docs/examples/storage/digitalocean_spaces/instantiate.py @@ -0,0 +1,6 @@ +from libcloud.storage.types import Provider +from libcloud.storage.providers import get_driver + +cls = get_driver(Provider.DIGITALOCEAN_SPACES) + +driver = cls(key="DO_ACCESS_KEY", secret="DO_SECRET_KEY") diff --git a/docs/examples/storage/digitalocean_spaces/upload_object_acls.py b/docs/examples/storage/digitalocean_spaces/upload_object_acls.py new file mode 100644 index 0000000000..9625efc198 --- /dev/null +++ b/docs/examples/storage/digitalocean_spaces/upload_object_acls.py @@ -0,0 +1,17 @@ +from libcloud.storage.types import Provider +from libcloud.storage.providers import get_driver + +FILE_PATH = "/home/user/myfile.tar.gz" + +cls = get_driver(Provider.DIGITALOCEAN_SPACES) +driver = cls("api key", "api secret key") + +container = driver.get_container(container_name="my-backups-12345") + +# This method blocks until all the parts have been uploaded. +extra = {"content_type": "application/octet-stream", "acl": "public-read"} + +with open(FILE_PATH, "rb") as iterator: + obj = driver.upload_object_via_stream( + iterator=iterator, container=container, object_name="backup.tar.gz", extra=extra + ) diff --git a/docs/examples/storage/digitalocean_spaces/v4sig.py b/docs/examples/storage/digitalocean_spaces/v4sig.py new file mode 100644 index 0000000000..f49a6f1a26 --- /dev/null +++ b/docs/examples/storage/digitalocean_spaces/v4sig.py @@ -0,0 +1,6 @@ +from libcloud.storage.types import Provider +from libcloud.storage.providers import get_driver + +cls = get_driver(Provider.DIGITALOCEAN_SPACES) + +driver = cls(key="DO_ACCESS_KEY", secret="DO_SECRET_KEY", signature_version="4") diff --git a/docs/examples/storage/minio/docker_example.py b/docs/examples/storage/minio/docker_example.py new file mode 100644 index 0000000000..923a178e59 --- /dev/null +++ b/docs/examples/storage/minio/docker_example.py @@ -0,0 +1,20 @@ +from libcloud.storage.types import Provider, ContainerAlreadyExistsError +from libcloud.storage.providers import get_driver + +FILE_PATH = "/home/user/myfile.tar.gz" + +cls = get_driver(Provider.MINIO) +driver = cls("api key", "api secret key", secure=False, host="127.0.0.1", port=9000) + +try: + driver.create_container(container_name="my-backups-12345") +except ContainerAlreadyExistsError: + pass + +container = driver.get_container(container_name="my-backups-12345") + +# This method blocks until all the parts have been uploaded. +with open(FILE_PATH, "rb") as iterator: + obj = driver.upload_object_via_stream( + iterator=iterator, container=container, object_name="backup.tar.gz" + ) diff --git a/docs/examples/storage/partial_object_download.py b/docs/examples/storage/partial_object_download.py new file mode 100644 index 0000000000..69546b09d2 --- /dev/null +++ b/docs/examples/storage/partial_object_download.py @@ -0,0 +1,14 @@ +from libcloud.storage.types import Provider +from libcloud.storage.providers import get_driver + +Driver = get_driver(Provider.AZURE_BLOBS) +driver = Driver("storagename", "key") + +container = driver.list_containers()[0] +obj = container.list_objects()[0] + +# Download first 5 bytes of an object (aka bytes 0, 1, 2, 3 and 4) +print(next(driver.download_object_range_as_stream(obj=obj, start_bytes=0, end_bytes=5))) + +# Download bytes 5-8 (inclusive) of an object +print(next(driver.download_object_range_as_stream(obj=obj, start_bytes=5, end_bytes=9))) diff --git a/docs/examples/storage/publish_static_website_on_cf.py b/docs/examples/storage/publish_static_website_on_cf.py index a4fdd385fb..50419fe1a3 100644 --- a/docs/examples/storage/publish_static_website_on_cf.py +++ b/docs/examples/storage/publish_static_website_on_cf.py @@ -5,24 +5,26 @@ CloudFiles = get_driver(Provider.CLOUDFILES_US) -driver = CloudFiles('username', 'api key') +driver = CloudFiles("username", "api key") -container = driver.create_container(container_name='my_website') +container = driver.create_container(container_name="my_website") -iterator1 = StringIO('

Hello World from Libcloud!

') -iterator2 = StringIO('

Oh, noez, 404!!

') -iterator3 = StringIO('

Oh, noez, 401!!

') +iterator1 = StringIO("

Hello World from Libcloud!

") +iterator2 = StringIO("

Oh, noez, 404!!

") +iterator3 = StringIO("

Oh, noez, 401!!

") -driver.upload_object_via_stream(iterator=iterator1, container=container, - object_name='index.html') -driver.upload_object_via_stream(iterator=iterator2, container=container, - object_name='404error.html') -driver.upload_object_via_stream(iterator=iterator3, container=container, - object_name='401error.html') +driver.upload_object_via_stream(iterator=iterator1, container=container, object_name="index.html") +driver.upload_object_via_stream( + iterator=iterator2, container=container, object_name="404error.html" +) +driver.upload_object_via_stream( + iterator=iterator3, container=container, object_name="401error.html" +) driver.ex_enable_static_website(container=container) -driver.ex_set_error_page(container=container, file_name='error.html') +driver.ex_set_error_page(container=container, file_name="error.html") driver.enable_container_cdn(container=container) -print('All done you can view the website at: ' + - driver.get_container_cdn_url(container=container)) +print( + "All done you can view the website at: %s" % (driver.get_container_cdn_url(container=container)) +) diff --git a/docs/examples/storage/s3/__init__.py b/docs/examples/storage/s3/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/storage/s3/multipart_large_file_upload.py b/docs/examples/storage/s3/multipart_large_file_upload.py index 61e4e411a4..e2fe02d98c 100644 --- a/docs/examples/storage/s3/multipart_large_file_upload.py +++ b/docs/examples/storage/s3/multipart_large_file_upload.py @@ -2,18 +2,17 @@ from libcloud.storage.providers import get_driver # Path to a very large file you want to upload -FILE_PATH = '/home/user/myfile.tar.gz' +FILE_PATH = "/home/user/myfile.tar.gz" cls = get_driver(Provider.S3) -driver = cls('api key', 'api secret key') +driver = cls("api key", "api secret key") -container = driver.get_container(container_name='my-backups-12345') +container = driver.get_container(container_name="my-backups-12345") # This method blocks until all the parts have been uploaded. -extra = {'content_type': 'application/octet-stream'} +extra = {"content_type": "application/octet-stream"} -with open(FILE_PATH, 'rb') as iterator: - obj = driver.upload_object_via_stream(iterator=iterator, - container=container, - object_name='backup.tar.gz', - extra=extra) +with open(FILE_PATH, "rb") as iterator: + obj = driver.upload_object_via_stream( + iterator=iterator, container=container, object_name="backup.tar.gz", extra=extra + ) diff --git a/docs/examples/storage/s3/upload_object_acls.py b/docs/examples/storage/s3/upload_object_acls.py index 9f074624d1..1452e17b26 100644 --- a/docs/examples/storage/s3/upload_object_acls.py +++ b/docs/examples/storage/s3/upload_object_acls.py @@ -1,19 +1,17 @@ from libcloud.storage.types import Provider from libcloud.storage.providers import get_driver -FILE_PATH = '/home/user/myfile.tar.gz' +FILE_PATH = "/home/user/myfile.tar.gz" cls = get_driver(Provider.S3) -driver = cls('api key', 'api secret key') +driver = cls("api key", "api secret key") -container = driver.get_container(container_name='my-backups-12345') +container = driver.get_container(container_name="my-backups-12345") # This method blocks until all the parts have been uploaded. -extra = {'content_type': 'application/octet-stream', - 'acl': 'public-read'} +extra = {"content_type": "application/octet-stream", "acl": "public-read"} -with open(FILE_PATH, 'rb') as iterator: - obj = driver.upload_object_via_stream(iterator=iterator, - container=container, - object_name='backup.tar.gz', - extra=extra) +with open(FILE_PATH, "rb") as iterator: + obj = driver.upload_object_via_stream( + iterator=iterator, container=container, object_name="backup.tar.gz", extra=extra + ) diff --git a/docs/examples/storage/scaleway/upload_example.py b/docs/examples/storage/scaleway/upload_example.py new file mode 100644 index 0000000000..41b4a912ac --- /dev/null +++ b/docs/examples/storage/scaleway/upload_example.py @@ -0,0 +1,20 @@ +from libcloud.storage.types import Provider +from libcloud.storage.providers import get_driver + +FILE_PATH = "/home/user/myfile.tar.gz" + +cls = get_driver(Provider.SCALEWAY) + +driver = cls("api key", "api secret key", region="fr-par") + +container = driver.get_container(container_name="") + +extra = { + "meta_data": {"owner": "myuser", "created": "2001-05-25"}, + "acl": "public-read", +} + +with open(FILE_PATH, "rb") as iterator: + obj = driver.upload_object_via_stream( + iterator=iterator, container=container, object_name="backup.tar.gz", extra=extra + ) diff --git a/docs/examples/storage/swift/__init__.py b/docs/examples/storage/swift/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/storage/swift/connect_to_rackspace_cloudfiles.py b/docs/examples/storage/swift/connect_to_rackspace_cloudfiles.py index 095b49254f..974e58507a 100644 --- a/docs/examples/storage/swift/connect_to_rackspace_cloudfiles.py +++ b/docs/examples/storage/swift/connect_to_rackspace_cloudfiles.py @@ -3,10 +3,13 @@ cls = get_driver(Provider.OPENSTACK_SWIFT) -driver = cls('username', 'api key', - region='ord', - ex_force_auth_url='https://auth.api.rackspacecloud.com:443', - ex_force_service_type='object-store', - ex_force_service_name='cloudFiles') +driver = cls( + "username", + "api key", + region="ord", + ex_force_auth_url="https://auth.api.rackspacecloud.com:443", + ex_force_service_type="object-store", + ex_force_service_name="cloudFiles", +) print(driver.list_containers()) diff --git a/docs/examples/storage/swift/connect_to_swift.py b/docs/examples/storage/swift/connect_to_swift.py index b641c0876b..8116efc051 100644 --- a/docs/examples/storage/swift/connect_to_swift.py +++ b/docs/examples/storage/swift/connect_to_swift.py @@ -3,10 +3,13 @@ cls = get_driver(Provider.OPENSTACK_SWIFT) -driver = cls('username', 'api key', - region='ord', - ex_force_auth_url='http://192.168.1.101:5000', - ex_force_service_type='object-store', - ex_force_service_name='Object Storage Service') +driver = cls( + "username", + "api key", + region="ord", + ex_force_auth_url="http://192.168.1.101:5000", + ex_force_service_type="object-store", + ex_force_service_name="Object Storage Service", +) print(driver.list_containers()) diff --git a/docs/examples/storage/upload_with_metadata.py b/docs/examples/storage/upload_with_metadata.py index 907e9ec16d..eb859f8cdb 100644 --- a/docs/examples/storage/upload_with_metadata.py +++ b/docs/examples/storage/upload_with_metadata.py @@ -1,17 +1,16 @@ from libcloud.storage.types import Provider from libcloud.storage.providers import get_driver -FILE_PATH = '/home/user/myfile.tar.gz' +FILE_PATH = "/home/user/myfile.tar.gz" cls = get_driver(Provider.S3) -driver = cls('api key', 'api secret key') +driver = cls("api key", "api secret key") -container = driver.get_container(container_name='my-backups-12345') +container = driver.get_container(container_name="my-backups-12345") -extra = {'meta_data': {'owner': 'myuser', 'created': '2014-02-2'}} +extra = {"meta_data": {"owner": "myuser", "created": "2014-02-2"}} -with open(FILE_PATH, 'rb') as iterator: - obj = driver.upload_object_via_stream(iterator=iterator, - container=container, - object_name='backup.tar.gz', - extra=extra) +with open(FILE_PATH, "rb") as iterator: + obj = driver.upload_object_via_stream( + iterator=iterator, container=container, object_name="backup.tar.gz", extra=extra + ) diff --git a/docs/faq.rst b/docs/faq.rst index 49d33a87c2..bd46e3ed22 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -55,7 +55,7 @@ I want do add a new provider driver what should I do? For now the best thing to do is to look at an existing driver and test cases for examples. -Libcloud currently supports more than 25 different providers. This means we +Libcloud currently supports more than 60 different providers. This means we have a broad range of examples of different APIs and authentication methods. APIs range from simple JSON based REST APIs to SOAP APIs. Authentication methods range from simple shared token and digest auth to HMAC signed requests. @@ -103,4 +103,3 @@ Example #2 (code): import libcloud libcloud.__version__ - diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 29ddb4b0ed..20b8907926 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -17,7 +17,7 @@ You can install latest development version from our Git repository: .. sourcecode:: bash - pip install -e git+https://git-wip-us.apache.org/repos/asf/libcloud.git@trunk#egg=apache-libcloud + pip install -e git+https://git.apache.org/repos/asf/libcloud.git@trunk#egg=apache-libcloud Upgrading --------- @@ -40,10 +40,10 @@ with any of the Libcloud drivers. from pprint import pprint - from libcloud.compute.types import Provider - from libcloud.compute.providers import get_driver + import libcloud + + cls = libcloud.get_driver(libcloud.DriverType.COMPUTE, libcloud.DriverType.COMPUTE.RACKSPACE) - cls = get_driver(Provider.RACKSPACE) 2. Instantiate the driver with your provider credentials @@ -70,10 +70,10 @@ see provider-specific documentation and the driver docstrings. from pprint import pprint - from libcloud.compute.types import Provider - from libcloud.compute.providers import get_driver + import libcloud + + cls = libcloud.get_driver(libcloud.DriverType.COMPUTE, libcloud.DriverType.COMPUTE.RACKSPACE) - cls = get_driver(Provider.RACKSPACE) driver = cls('my username', 'my api key') pprint(driver.list_sizes()) diff --git a/docs/index.rst b/docs/index.rst index 2f75dd6730..760325cca3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,6 +1,21 @@ Welcome to Apache Libcloud's documentation! =========================================== +.. note:: + Libcloud now only supports Python >= 3.10. Support for Python 3.9 has been + dropped. + + Libcloud v3.5.0 dropped support for Python 3.5 and now only supports Python + >= 3.6. + + Libcloud v3.0.0 dropped support for Python 2.7 and Python 3.4 and now only + supports Python >= 3.5. + + If you still need to us Libcloud with one of the now unsupported Python + versions, you can do that by using an older release of Libcloud which still + supports that Python version (Libcloud v3.9.x for Python 3.9, Libcloud + v3.4.x for Python 3.5 and Libcloud v2.8.x for Python 2.7 and Python 3.4). + Apache Libcloud is a Python library which hides differences between different cloud provider APIs and allows you to manage different cloud resources through a unified and easy to use API. @@ -11,8 +26,10 @@ Resource you can manage with Libcloud are divided in the following categories: Rackspace CloudServers * :doc:`Cloud Object Storage and CDN ` - services such as Amazon S3 and Rackspace CloudFiles -* :doc:`Load Balancers as a Service ` - services such as Amazon Elastic Load Balancer and GoGrid LoadBalancers +* :doc:`Load Balancers as a Service ` - services such as Amazon Elastic Load Balancer * :doc:`DNS as a Service ` - services such as Amazon Route 53 and Zerigo +* :doc:`Container Services ` - container virtualization like Docker and Rkt as well as container based services +* :doc:`Backup as a Service ` - services such as Amazon EBS and OpenStack Freezer .. figure:: /_static/images/supported_providers.png :align: center @@ -31,15 +48,22 @@ Main getting_started supported_providers + supported_python_versions third_party_drivers compute/index storage/index loadbalancer/index dns/index + container/index + backup/index troubleshooting api_docs faq - other/* + other/registering-a-third-party-driver + other/ssl-certificate-validation + other/using-http-proxy + other/working-with-oo-apis + other/using-libcloud-in-multithreaded-and-async-environments Developer Information --------------------- diff --git a/docs/loadbalancer/_supported_methods.rst b/docs/loadbalancer/_supported_methods.rst index 14697faaa3..c08ccd50bc 100644 --- a/docs/loadbalancer/_supported_methods.rst +++ b/docs/loadbalancer/_supported_methods.rst @@ -1,25 +1,27 @@ +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it + ====================================== =============== ============== ============ ============= ============= =================== Provider create balancer list balancers list members attach member detach member attach compute node ====================================== =============== ============== ============ ============= ============= =================== +`Amazon Application Load Balancing`_ yes yes no no no no +`Aliyun Server Load Balancer`_ yes yes yes yes yes yes `Brightbox`_ yes yes yes yes yes yes `CloudStack`_ yes yes yes yes yes no +`Dimension Data Load Balancer`_ yes yes yes yes yes no `Amazon Elastic Load Balancing`_ yes yes yes no yes yes `Google Compute Engine Load Balancer`_ yes yes yes yes yes yes -`GoGrid LB`_ yes yes yes yes yes no `Ninefold LB`_ yes yes yes yes yes no +`NTTC-CIS Load Balancer`_ yes yes yes yes yes no `Rackspace LB`_ yes yes yes yes yes no -`Rackspace LB`_ yes yes yes yes yes no -`Rackspace LB`_ yes yes yes yes yes no -`Softlayer Load Balancing`_ no yes yes yes yes no ====================================== =============== ============== ============ ============= ============= =================== +.. _`Amazon Application Load Balancing`: http://aws.amazon.com/elasticloadbalancing/ +.. _`Aliyun Server Load Balancer`: https://www.aliyun.com/product/slb .. _`Brightbox`: http://www.brightbox.co.uk/ .. _`CloudStack`: http://cloudstack.org/ +.. _`Dimension Data Load Balancer`: https://cloud.dimensiondata.com/ .. _`Amazon Elastic Load Balancing`: http://aws.amazon.com/elasticloadbalancing/ .. _`Google Compute Engine Load Balancer`: https://cloud.google.com/ -.. _`GoGrid LB`: http://www.gogrid.com/ .. _`Ninefold LB`: http://ninefold.com/ +.. _`NTTC-CIS Load Balancer`: https://cloud.nttcis.com/ .. _`Rackspace LB`: http://www.rackspace.com/ -.. _`Rackspace LB`: http://www.rackspace.com/ -.. _`Rackspace LB`: http://www.rackspace.com/ -.. _`Softlayer Load Balancing`: http://www.softlayer.com/ diff --git a/docs/loadbalancer/_supported_providers.rst b/docs/loadbalancer/_supported_providers.rst index 3ae6c969ac..543d163b9e 100644 --- a/docs/loadbalancer/_supported_providers.rst +++ b/docs/loadbalancer/_supported_providers.rst @@ -1,25 +1,27 @@ -====================================== ======================================== ================= =============================================== ============================ -Provider Documentation Provider constant Module Class Name -====================================== ======================================== ================= =============================================== ============================ -`Brightbox`_ BRIGHTBOX :mod:`libcloud.loadbalancer.drivers.brightbox` :class:`BrightboxLBDriver` -`CloudStack`_ CLOUDSTACK :mod:`libcloud.loadbalancer.drivers.cloudstack` :class:`CloudStackLBDriver` -`Amazon Elastic Load Balancing`_ :doc:`Click ` ELB :mod:`libcloud.loadbalancer.drivers.elb` :class:`ElasticLBDriver` -`Google Compute Engine Load Balancer`_ :doc:`Click ` GCE :mod:`libcloud.loadbalancer.drivers.gce` :class:`GCELBDriver` -`GoGrid LB`_ GOGRID :mod:`libcloud.loadbalancer.drivers.gogrid` :class:`GoGridLBDriver` -`Ninefold LB`_ NINEFOLD :mod:`libcloud.loadbalancer.drivers.ninefold` :class:`NinefoldLBDriver` -`Rackspace LB`_ RACKSPACE :mod:`libcloud.loadbalancer.drivers.rackspace` :class:`RackspaceLBDriver` -`Rackspace LB`_ RACKSPACE_UK :mod:`libcloud.loadbalancer.drivers.rackspace` :class:`RackspaceUKLBDriver` -`Rackspace LB`_ RACKSPACE_US :mod:`libcloud.loadbalancer.drivers.rackspace` :class:`RackspaceLBDriver` -`Softlayer Load Balancing`_ SOFTLAYER :mod:`libcloud.loadbalancer.drivers.softlayer` :class:`SoftlayerLBDriver` -====================================== ======================================== ================= =============================================== ============================ +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it +====================================== ================================================== ================= ============================ ================================================== ============================== +Provider Documentation Provider Constant Supported Regions Module Class Name +====================================== ================================================== ================= ============================ ================================================== ============================== +`Amazon Application Load Balancing`_ ALB single region driver :mod:`libcloud.loadbalancer.drivers.alb` :class:`ApplicationLBDriver` +`Aliyun Server Load Balancer`_ ALIYUN_SLB single region driver :mod:`libcloud.loadbalancer.drivers.slb` :class:`SLBDriver` +`Brightbox`_ BRIGHTBOX single region driver :mod:`libcloud.loadbalancer.drivers.brightbox` :class:`BrightboxLBDriver` +`CloudStack`_ CLOUDSTACK single region driver :mod:`libcloud.loadbalancer.drivers.cloudstack` :class:`CloudStackLBDriver` +`Dimension Data Load Balancer`_ :doc:`Click ` DIMENSIONDATA single region driver :mod:`libcloud.loadbalancer.drivers.dimensiondata` :class:`DimensionDataLBDriver` +`Amazon Elastic Load Balancing`_ :doc:`Click ` ELB single region driver :mod:`libcloud.loadbalancer.drivers.elb` :class:`ElasticLBDriver` +`Google Compute Engine Load Balancer`_ :doc:`Click ` GCE single region driver :mod:`libcloud.loadbalancer.drivers.gce` :class:`GCELBDriver` +`Ninefold LB`_ NINEFOLD single region driver :mod:`libcloud.loadbalancer.drivers.ninefold` :class:`NinefoldLBDriver` +`NTTC-CIS Load Balancer`_ :doc:`Click ` NTTCIS single region driver :mod:`libcloud.loadbalancer.drivers.nttcis` :class:`NttCisLBDriver` +`Rackspace LB`_ RACKSPACE dfw, hkg, iad, lon, ord, syd :mod:`libcloud.loadbalancer.drivers.rackspace` :class:`RackspaceLBDriver` +====================================== ================================================== ================= ============================ ================================================== ============================== + +.. _`Amazon Application Load Balancing`: http://aws.amazon.com/elasticloadbalancing/ +.. _`Aliyun Server Load Balancer`: https://www.aliyun.com/product/slb .. _`Brightbox`: http://www.brightbox.co.uk/ .. _`CloudStack`: http://cloudstack.org/ +.. _`Dimension Data Load Balancer`: https://cloud.dimensiondata.com/ .. _`Amazon Elastic Load Balancing`: http://aws.amazon.com/elasticloadbalancing/ .. _`Google Compute Engine Load Balancer`: https://cloud.google.com/ -.. _`GoGrid LB`: http://www.gogrid.com/ .. _`Ninefold LB`: http://ninefold.com/ +.. _`NTTC-CIS Load Balancer`: https://cloud.nttcis.com/ .. _`Rackspace LB`: http://www.rackspace.com/ -.. _`Rackspace LB`: http://www.rackspace.com/ -.. _`Rackspace LB`: http://www.rackspace.com/ -.. _`Softlayer Load Balancing`: http://www.softlayer.com/ diff --git a/docs/loadbalancer/drivers/dimensiondata.rst b/docs/loadbalancer/drivers/dimensiondata.rst new file mode 100644 index 0000000000..65289d7323 --- /dev/null +++ b/docs/loadbalancer/drivers/dimensiondata.rst @@ -0,0 +1,66 @@ +Dimension Data Load Balancer Driver Documentation +================================================= + +Dimension Data are a global IT Services company and form part of the NTT Group. +Dimension Data provide IT-as-a-Service to customers around the globe on their +cloud platform (Compute as a Service). The CaaS service is available either on +one of the public cloud instances or as a private instance on premises. + +.. figure:: /_static/images/provider_logos/dimensiondata.png + :align: center + :width: 300 + :target: http://cloud.dimensiondata.com/ + +CaaS has its own non-standard `API`_ , `libcloud` provides a Python +wrapper on top of this `API`_ with common methods with other IaaS solutions and +Public cloud providers. Therefore, you can use use the Dimension Data libcloud +driver to communicate with both the public and private clouds. + +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``user_id`` - Your Dimension Data Cloud username +* ``key`` - Your Dimension Data Cloud password +* ``region`` - The region key, one of the possible region keys + +Possible regions: + +* ``dd-na`` : Dimension Data North America (USA) +* ``dd-eu`` : Dimension Data Europe +* ``dd-af`` : Dimension Data Africa +* ``dd-au`` : Dimension Data Australia +* ``dd-latam`` : Dimension Data Latin America +* ``dd-ap`` : Dimension Data Asia Pacific +* ``dd-canada`` : Dimension Data Canada region + +The base `libcloud` API allows you to: + +* create balancers, add members and destroy members + +Non-standard functionality and extension methods +------------------------------------------------ + +The Dimension Data driver exposes some `libcloud` non-standard +functionalities through extension methods and arguments. + +These functionalities include: + +* list nodes +* list pools +* set the network domain (zone) + +For information on how to use these functionalities please see the method +docstrings below. You can also use an interactive shell for exploration as +shown in the examples. + +API Docs +-------- + +.. autoclass:: libcloud.loadbalancer.drivers.dimensiondata.DimensionDataLBDriver + :members: + :inherited-members: + +.. _`API`: http://cloud.dimensiondata.com/au/en/services/public-cloud/api diff --git a/docs/loadbalancer/drivers/elb.rst b/docs/loadbalancer/drivers/elb.rst index 26b63f9826..aaac8e3ad7 100644 --- a/docs/loadbalancer/drivers/elb.rst +++ b/docs/loadbalancer/drivers/elb.rst @@ -18,7 +18,7 @@ Elastic Load Balancing, so your servers can focus on their main task. Ok Now Tell me some advantages of using Elastic Load Balancing ---------------------------------------------------------------- +-------------------------------------------------------------- * Distribution of requests to Amazon EC2 instances (servers)in multiple vailability Zones so that the risk of overloading one single instance @@ -61,7 +61,7 @@ Now lets dive into the tutorial which will focus on libcloud Elastic Load Balancing interface for AWS. 1. Creating a Connection -------------------------- +------------------------ The first step in accessing ELB is to create a connection to the service. @@ -91,7 +91,7 @@ The base `libcloud` ELB API allows you to: * list protocols related to load balancer Non-standard functionality and extension methods -------------------------------------------------- +------------------------------------------------ The AWS ELB driver exposes a lot of `libcloud` non-standard functionalities through extension methods and arguments. @@ -105,7 +105,7 @@ These functionalities include: * enable/disable policies on backend server & listeners 2. Getting Existing Load Balancers ------------------------------------ +---------------------------------- To retrieve any exiting load balancers available @@ -116,7 +116,7 @@ this will return you a list of load balancers ``[]`` 3. Creating New Load Balancers -------------------------------- +------------------------------ To create new load balancer initialise some members for the load balancer first @@ -166,7 +166,7 @@ To delete a policy associated with the load balancer Will return ``True`` if it deletes the policy successfully. 5. Enable/Disable Policy on Backend server -------------------------------------------- +------------------------------------------ Wait! first tell me about Policies ---------------------------------- @@ -194,7 +194,7 @@ To disable the policy you just need to pass the policies parameter as empty list 6. Enable/Diable Policy on Listeners -------------------------------------- +------------------------------------ I don't have any idea about ``listeners``? ------------------------------------------ diff --git a/docs/loadbalancer/drivers/gce.rst b/docs/loadbalancer/drivers/gce.rst index 15983cbaaf..55605225ea 100644 --- a/docs/loadbalancer/drivers/gce.rst +++ b/docs/loadbalancer/drivers/gce.rst @@ -1,5 +1,5 @@ Google Load Balancer Driver Documentation -========================================== +========================================= Loadbalancing in Compute Engine is native to Google Compute Engine. @@ -28,19 +28,24 @@ Additional example code can be found in the "demos" directory of Libcloud here: https://github.com/apache/libcloud/blob/trunk/demos/gce_lb_demo.py 1. Getting Driver with GCE Driver -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. literalinclude:: /examples/loadbalancer/gce/gce_driver.py 2. Getting Driver with Authentication Information -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +With local key file: .. literalinclude:: /examples/loadbalancer/gce/gce_authentication.py +With Service Account credentials as dict: + +.. literalinclude:: /examples/loadbalancer/gce/gce_service_account_infile.py + API Docs -------- .. autoclass:: libcloud.loadbalancer.drivers.gce.GCELBDriver :members: :inherited-members: - diff --git a/docs/loadbalancer/drivers/index.rst b/docs/loadbalancer/drivers/index.rst index d37aad565b..aac9cb3480 100644 --- a/docs/loadbalancer/drivers/index.rst +++ b/docs/loadbalancer/drivers/index.rst @@ -1,7 +1,7 @@ :orphan: -Load BalancerDrivers Documentation -================================== +Load Balancer Drivers Documentation +=================================== This chapter includes links to driver (provider) specific documentation pages. diff --git a/docs/loadbalancer/drivers/nttcis.rst b/docs/loadbalancer/drivers/nttcis.rst new file mode 100644 index 0000000000..bc95ce577d --- /dev/null +++ b/docs/loadbalancer/drivers/nttcis.rst @@ -0,0 +1,64 @@ +NTTC-CIS Load Balancer Driver Documentation +================================================= + +NTT Communications provide IT-as-a-Service to customers around the globe on their +cloud platform (Compute as a Service). The CaaS service is available either on +one of the public cloud instances or as a private instance on premises. + +.. figure:: /_static/images/provider_logos/ntt.png + :align: center + :width: 300 + :target: http://www.ntt.com/en/services/cloud/enterprise-cloud.html/ + +CaaS has its own non-standard `API`_, `libcloud` provides a Python +wrapper on top of this `API`_ with common methods with other IaaS solutions and +Public cloud providers. Therefore, you can use use the NTTC-CIS libcloud +driver to communicate with both the public and private clouds. + +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``user_id`` - Your Dimension Data Cloud username +* ``key`` - Your Dimension Data Cloud password +* ``region`` - The region key, one of the possible region keys + +Possible regions: + +* ``na`` : NTTC-CIS North America (USA) +* ``eu`` : NTTC-CIS Europe +* ``af`` : NTTC-CIS Africa +* ``au`` : NTTC-CIS Australia +* ``ap`` : NTTC-CIS Asia Pacific +* ``ca`` : Dimension Data Canada region + +The base `libcloud` API allows you to: + +* create balancers, add members and destroy members + +Non-standard functionality and extension methods +------------------------------------------------ + +The NTTC-CIS driver exposes some `libcloud` non-standard +functionalities through extension methods and arguments. + +These functionalities include: + +* list nodes +* list pools +* set the network domain (zone) + +For information on how to use these functionalities please see the method +docstrings below. You can also use an interactive shell for exploration as +shown in the examples. + +API Docs +-------- + +.. autoclass:: libcloud.loadbalancer.drivers.nttcis.NttCisLBDriver + :members: + :inherited-members: + +.. _`API`: https://docs.mcp-services.net/display/CCD/API+2 diff --git a/docs/loadbalancer/index.rst b/docs/loadbalancer/index.rst index fd681140bf..febcc0b6dd 100644 --- a/docs/loadbalancer/index.rst +++ b/docs/loadbalancer/index.rst @@ -6,8 +6,7 @@ Load Balancer Load Balancer API is available in Libcloud 0.5.0 and higher. Load Balancer API allows you to manage Load Balancers as a service and services -such as Rackspace Cloud Load Balancers, GoGrid Load Balancers and Ninefold Load -Balancers. +such as Rackspace Cloud Load Balancers and Ninefold Load Balancers. Terminology ----------- diff --git a/docs/other/changes_in_2_0.rst b/docs/other/changes_in_2_0.rst new file mode 100644 index 0000000000..16b177fb93 --- /dev/null +++ b/docs/other/changes_in_2_0.rst @@ -0,0 +1,133 @@ +:orphan: + +Changes in Apache Libcloud v2.0 +=============================== + +Replacement of httplib with `requests` +-------------------------------------- + +Apache Libcloud supports Python 2.6, 2.7 - 3.3 and beyond. To achieve this a package was written within the +Libcloud library to create a generic HTTP client for Python 2 and 3. This package has a custom implementation of a certificate store, searching and TLS preference configuration. One of the first errors to greet new users of Libcloud would be "No CA Certificates were found in CA_CERTS_PATH."... + +In 2.0 this implementation has been replaced with the `requests` package, and SSL verification should work against any publicly signed HTTPS endpoint by default, without having to provide a CA cert store. + +Other changes include: + +* Enabling HTTP redirects +* Allowing both global and driver-specific HTTP proxy configuration +* Consolidation of the LibcloudHTTPSConnection and LibcloudHTTPConnection into a single class, LibcloudConnection +* Support for streaming responses +* Support for mocking HTTP responses without having to mock the Connection class +* 10% typical performance improvement with the use of persistent TCP connections for each driver instance +* Access to the low-level TCP session is no longer available. Access to .read() on a raw connection will bind around `requests` body or iter_content methods. +* Temporary removal of the S3 very-large file support using the custom multi-part APIs. This will be added back in subsequent release candidates. + +Allow redirects is enabled by default +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +HTTP redirects are allowed by default in 2.0. To disable redirects, set this global variable to False. + +.. code-block:: Python + + import libcloud.http + libcloud.http.ALLOW_REDIRECTS = False + +HTTP/HTTPS Proxies +~~~~~~~~~~~~~~~~~~ + +Enabling a HTTP/HTTPS proxy is still supported and accessed via the driver's connection property or via the 'http_proxy' environment variable. Applying it to a driver will set the proxy for that driver only, using the environment +variable will make a global change. + +.. code-block:: Python + + # option 1 + import os + os.environ.get('http_proxy', 'http://localhost:8888/') + + # option 2 + driver.connection.connection.set_http_proxy(proxy_url='http://localhost:8888') + + +Adding support for Python 3.6 and deprecation of Python 3.2 +----------------------------------------------------------- + +In Apache Libcloud 2.0.0, Python 3.6 is `now supported `_ as a primary distribution. + +Python 3.2 support has been dropped in this release and users should either upgrade to 3.3 or a newer version of Python. + +SSL CA certificates are now bundled with the package +---------------------------------------------------- + +In Apache Libcloud 2.0.0, the `Mozilla Trusted Root Store `_ is bundled with the package, as part of the `requests` package bundle. +This means that users no longer have to set the path to a CA file either via installing the certifi package, downloading a PEM file or providing a directory in an environment variable. +All connections in Libcloud will assume HTTPS by default, now with 2.0.0, if those HTTPS endpoints have a signed certificate with a trusted CA authority, they will work with Libcloud by default. + +Providing a custom client-side certificate, for example for a development server or a HTTPS proxy is still supported given providing a value to `libcloud.security.CA_CERTS_PATH`. + +This code example would set a HTTP/HTTPS proxy and use a client-generated certificate to verify. + +.. code-block:: Python + + import os + os.environ.set('http_proxy', 'http://localhost:8888/') + + import libcloud.security + libcloud.security.VERIFY_SSL_CERT = True + libcloud.security.CA_CERTS_PATH = '/Users/anthonyshaw/charles.pem' + + +Providing a list of CA trusts is no longer supported +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In Apache Libcloud 2.0.0 if you provide a list of more than 1 path or certificate file in `libcloud.security.CA_CERTS_PATH` you will receive a warning and only the first path will be used. This path should be to a .cert or .pem file. +The environment variable REQUESTS_CA_BUNDLE can be used to access the requests library's list of trusted CAs. + +Performance improvements and introduction of sessions +----------------------------------------------------- + +Each instance of libcloud.common.base.Connection will have a LibcloudConnection instance under the `connection` property. In 1.5.0<, there would be 2 connection +class instances, LibcloudHttpConnection and LibcloudHttpsConnection, stored as an instance property `conn_classes`. In 2.0.0 this has been replaced with a single type, +:class:`libcloud.common.base.LibcloudHTTPConnection` that handles both HTTP and HTTPS connections. + +.. code-block:: Python + + def test(): + import libcloud + import libcloud.compute.providers + + d = libcloud.get_driver(libcloud.DriverType.COMPUTE, libcloud.DriverType.COMPUTE.DIMENSIONDATA) + instance = d('anthony', 'mypassword!', 'dd-au') + instance.list_nodes() # is paged + instance.list_images() # is paged + + if __name__ == '__main__': + import timeit + print(timeit.timeit("test()", setup="from __main__ import test", number=5)) + + +This simple test shows a 10% performance improvement between Libcloud 1.5.0 and 2.0.0. + +Changes to the storage API +-------------------------- + +Support for Buffered IO Streams +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The methods `upload_object_via_stream` now supports `file` objects, `BytesIO`, `StringIO` and generators as the iterator. + +.. code-block:: Python + + with open('my_file_to_upload', 'rb') as iterator: + obj = driver.upload_object_via_stream(iterator=iterator, + container=containers[0], + object_name='me.jpg', + extra=extra) + +Other minor changes +------------------- + +- :class:`libcloud.common.base.Connection` will now use `urljoin` to combine the `request_path` and `method` URLs. This means that the URL action will always have a leading slash. + +- The underlying connection classes do not assume HTTP if a non-standard port is used. They will use the preference set in the `secure` flag to the initializer of `Connection`. + +- The storage download_object_as_stream method no longer buffers out file streams twice. diff --git a/docs/other/hacktoberfest.txt b/docs/other/hacktoberfest.txt new file mode 100644 index 0000000000..6465de069b --- /dev/null +++ b/docs/other/hacktoberfest.txt @@ -0,0 +1,19 @@ +Accounts raising spam pull requests as part of hacktoberfest: + +@hamzagsarwari +@saadaouad +@amadorfreedompop +@kcccccc +@JurgensSmit +@MattG401 +@go4st +@ShyamW +@lin31504 +@blusoul12 +@ghost +@thejonnyhall +@bguru +@haucke +@vilnitskiy +@htrueman +@thomas104 diff --git a/docs/other/ssl-certificate-validation.rst b/docs/other/ssl-certificate-validation.rst index 2ba4dca983..fdc83472a0 100644 --- a/docs/other/ssl-certificate-validation.rst +++ b/docs/other/ssl-certificate-validation.rst @@ -1,5 +1,5 @@ -SSL Certificate Validation -========================== +SSL Certificate Validation in : python my_script.py -With basic auth authentication: +Without authentication (https proxy): -.. sourcecode:: python +.. sourcecode:: bash + + http_proxy=https://: python my_script.py + # or + https_proxy=https://: python my_script.py + + +With basic auth authentication (http proxy): + +.. sourcecode:: bash http_proxy=http://:@: python my_script.py -2. Passing ``http_proxy`` argument to the connection class constructor +2. Passing ``proxy_url`` argument to the connection class constructor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -By passing ``http_proxy`` argument to the +. note:: + + Some drivers don't correctly pass ``proxy_url`` argument to the connection + class and don't support ``proxy_url`` constructor argument. + + If you pass this argument to the driver constructor, but it doesn't appear + to be working, it's likely the driver doesn't support this method. + + In such scenarios, you are advised to use some other method of setting a + proxy (e.g. by setting an environment variable or by using + :meth:`libcloud.common.base.LibcloudConnection.set_http_proxy` method). + +By passing ``proxy_url`` argument to the :class:`libcloud.common.base.Connection` class constructor, you can specify which proxy to use for a particular connection. @@ -74,7 +102,26 @@ Calling ``set_http_proxy`` method allows you to specify which proxy to use for all the outgoing requests which follow ``set_http_proxy`` method call. This method also allows you to use a different proxy for each request as shown -in the example bellow. +in the example below. .. literalinclude:: /examples/http_proxy/set_http_proxy_method.py :language: python + +4. Using an HTTPS proxy +~~~~~~~~~~~~~~~~~~~~~~~ + +This example shows how to use an HTTPS proxy. + +.. literalinclude:: /examples/http_proxy/https_proxy.py + :language: python + +To use an HTTPS proxy, you also need to configure Libcloud to use CA cert bundle +which is used by the HTTPS proxy server, to verify outgoing https request. If you +don't do that, you will see errors similar to the one below: + +.. sourcecode:: python + + SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed + +Keep in mind that you will also receive a similar error message if you try to +use HTTP proxy for HTTPS requests. diff --git a/docs/other/using-libcloud-in-multithreaded-and-async-environments.rst b/docs/other/using-libcloud-in-multithreaded-and-async-environments.rst index 0a9a316d23..3b3acdec76 100644 --- a/docs/other/using-libcloud-in-multithreaded-and-async-environments.rst +++ b/docs/other/using-libcloud-in-multithreaded-and-async-environments.rst @@ -43,7 +43,7 @@ You need to do two things when you want to use Libcloud with gevent: * Create a separate driver instance for each Greenlet. This is necessary because a driver instance reuses the same Connection class. -For an example see Efficiently download multiple files using gevent. +For an example see :doc:`Efficiently download multiple files using gevent `. Using Libcloud with Twisted --------------------------- @@ -60,10 +60,8 @@ calls inside a thread. In Twisted this can be achieved using ``threads.deferToThread`` which runs a provided method inside the Twisted thread pool. -The example bellow demonstrates how to create a new node inside a thread +The example below demonstrates how to create a new node inside a thread without blocking the whole reactor. .. literalinclude:: /examples/misc/twisted_create_node.py :language: python - - diff --git a/docs/other/working-with-oo-apis.rst b/docs/other/working-with-oo-apis.rst index 96b29b62bc..1d4f4409af 100644 --- a/docs/other/working-with-oo-apis.rst +++ b/docs/other/working-with-oo-apis.rst @@ -16,7 +16,7 @@ id. To obtain a reference to this resource, Libcloud providers corresponding get and / or list methods. -A couple of examples are shown bellow. +A couple of examples are shown below. Example 1 - listing records for a zone with a known id ------------------------------------------------------ @@ -24,7 +24,8 @@ Example 1 - listing records for a zone with a known id .. literalinclude:: /examples/dns/list_zone_records.py :language: python -In this example, :func:`driver.get_zone` method call results in an HTTP call. +In this example, the :func:`driver.get_zone` method call results in an HTTP +call. Example 2 - creating an EC2 instance with a known ``NodeSize`` and ``NodeImage`` id ----------------------------------------------------------------------------------- @@ -32,8 +33,8 @@ Example 2 - creating an EC2 instance with a known ``NodeSize`` and ``NodeImage`` .. literalinclude:: /examples/compute/create_ec2_node.py :language: python -In this example, both :func:`driver.list_sizes` an :func:`driver.list_images` -method calls result in an HTTP call. +In this example, both the :func:`driver.list_sizes` and +:func:`driver.list_images` method calls result in HTTP calls. As you can see above, most of those getter methods retrieve extra information about the resource from the provider API and result in an HTTP request. @@ -46,7 +47,7 @@ There are some cases when you might not want this: * You want to avoid holding a reference to the resource object If that is true for you, you can directly instantiate a resource with a known -id. You can see how to do this in the examples bellow. +id. You can see how to do this in the examples below. Example 1 - listing records for a zone with a known id ------------------------------------------------------ diff --git a/docs/security.rst b/docs/security.rst index 222eb1614a..3b010e1ecd 100644 --- a/docs/security.rst +++ b/docs/security.rst @@ -8,10 +8,10 @@ Reporting a vulnerability .. note:: - Please do **not** report security issues using our public JIRA instance. Use - the private mailing list described bellow. + Please do **not** report security issues using our public Github instance. Use + the private mailing list described below. -If you believe you found a security issue or a vulnerability, please send a +If you believe you've found a security issue or a vulnerability, please send a description of it to our private mailing list at security@libcloud.apache.org You are also encouraged to encrypt this email using PGP. Keys of our developers diff --git a/docs/storage/_supported_methods.rst b/docs/storage/_supported_methods.rst index eb317fa0a5..02b5515b87 100644 --- a/docs/storage/_supported_methods.rst +++ b/docs/storage/_supported_methods.rst @@ -16,6 +16,7 @@ Provider list containers list objects create container dele `Amazon S3 (us-west-1)`_ yes no yes yes yes yes yes yes no `Amazon S3 (standard)`_ yes no yes yes yes yes yes yes no `CloudFiles (SWIFT)`_ yes no yes yes yes yes yes yes no +`PCextreme AuroraObjects`_ yes yes yes yes yes yes yes yes yes ============================= =============== ============ ================ ================ ============= ======================= =============== ========================= ============= .. _`Dummy Storage Provider`: http://example.com @@ -33,3 +34,4 @@ Provider list containers list objects create container dele .. _`Amazon S3 (us-west-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (standard)`: http://aws.amazon.com/s3/ .. _`CloudFiles (SWIFT)`: http://www.rackspace.com/ +.. _`PCextreme AuroraObjects`: https://www.pcextreme.nl/en/aurora/objects diff --git a/docs/storage/_supported_methods_cdn.rst b/docs/storage/_supported_methods_cdn.rst index 6abdc9a5b4..31fb7bc3b6 100644 --- a/docs/storage/_supported_methods_cdn.rst +++ b/docs/storage/_supported_methods_cdn.rst @@ -1,35 +1,79 @@ +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it + ============================= ==================== ================= ===================== ================== Provider enable container cdn enable object cdn get container cdn URL get object cdn URL ============================= ==================== ================= ===================== ================== -`Microsoft Azure (blobs)`_ no no no no +`Aliyun OSS`_ no no no no +`PCextreme AuroraObjects`_ yes yes yes yes +`Microsoft Azure (blobs)`_ no no no yes +`Backblaze B2`_ no no no no `CloudFiles`_ yes no yes yes -`CloudFiles (UK)`_ yes no yes yes -`CloudFiles (US)`_ yes no yes yes -`Google Storage`_ no no no no +`DigitalOcean Spaces`_ no no no no +`Google Cloud Storage`_ no no no no `KTUCloud Storage`_ yes no yes yes +`Local Storage`_ yes yes yes yes +`MinIO Storage Driver`_ no no no no `Nimbus.io`_ no no no no `Ninefold`_ no yes no yes `OpenStack Swift`_ yes no yes yes -`Amazon S3 (standard)`_ no no no no -`Amazon S3 (ap-northeast-1)`_ no no no no -`Amazon S3 (ap-southeast-1)`_ no no no no -`Amazon S3 (eu-west-1)`_ no no no no -`Amazon S3 (us-west-1)`_ no no no no -`Amazon S3 (us-west-2)`_ no no no no +`Ovh Storage Driver`_ no no no yes +`Amazon S3`_ no no no yes +`Amazon S3 (ap-northeast-1)`_ no no no yes +`Amazon S3 (ap-northeast-1)`_ no no no yes +`Amazon S3 (ap-northeast-2)`_ no no no yes +`Amazon S3 (ap-south-1)`_ no no no yes +`Amazon S3 (ap-southeast-1)`_ no no no yes +`Amazon S3 (ap-southeast-2)`_ no no no yes +`Amazon S3 (ca-central-1)`_ no no no yes +`Amazon S3 (cn-north-1)`_ no no no yes +`Amazon S3 (cn-northwest-1)`_ no no no yes +`Amazon S3 (eu-central-1)`_ no no no yes +`Amazon S3 (eu-north-1)`_ no no no yes +`Amazon S3 (eu-west-1)`_ no no no yes +`Amazon S3 (eu-west-2)`_ no no no yes +`Ceph RGW`_ no no no no +`RGW Outscale`_ no no no no +`Amazon S3 (sa-east-1)`_ no no no yes +`Amazon S3 (us-east-2)`_ no no no yes +`Amazon S3 (us-gov-west-1)`_ no no no yes +`Amazon S3 (us-west-1)`_ no no no yes +`Amazon S3 (us-west-2)`_ no no no yes +`Scaleway Storage Driver`_ no no no yes ============================= ==================== ================= ===================== ================== +.. _`Aliyun OSS`: http://www.aliyun.com/product/oss +.. _`PCextreme AuroraObjects`: https://www.pcextreme.com/aurora/objects .. _`Microsoft Azure (blobs)`: http://windows.azure.com/ +.. _`Backblaze B2`: https://www.backblaze.com/b2/ .. _`CloudFiles`: http://www.rackspace.com/ -.. _`CloudFiles (UK)`: http://www.rackspace.com/ -.. _`CloudFiles (US)`: http://www.rackspace.com/ -.. _`Google Storage`: http://cloud.google.com/ +.. _`DigitalOcean Spaces`: https://www.digitalocean.com/products/object-storage/ +.. _`Google Cloud Storage`: http://cloud.google.com/storage .. _`KTUCloud Storage`: http://www.rackspace.com/ +.. _`Local Storage`: http://example.com +.. _`MinIO Storage Driver`: https://min.io/ .. _`Nimbus.io`: https://nimbus.io/ .. _`Ninefold`: http://ninefold.com/ .. _`OpenStack Swift`: http://www.rackspace.com/ -.. _`Amazon S3 (standard)`: http://aws.amazon.com/s3/ +.. _`Ovh Storage Driver`: https://www.ovhcloud.com/en/public-cloud/object-storage/ +.. _`Amazon S3`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ap-northeast-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (ap-northeast-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ap-northeast-2)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ap-south-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (ap-southeast-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ap-southeast-2)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ca-central-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (cn-north-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (cn-northwest-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (eu-central-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (eu-north-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (eu-west-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (eu-west-2)`: http://aws.amazon.com/s3/ +.. _`Ceph RGW`: http://ceph.com/ +.. _`RGW Outscale`: https://en.outscale.com/ +.. _`Amazon S3 (sa-east-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (us-east-2)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (us-gov-west-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (us-west-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (us-west-2)`: http://aws.amazon.com/s3/ +.. _`Scaleway Storage Driver`: https://www.scaleway.com/en/object-storage/ diff --git a/docs/storage/_supported_methods_main.rst b/docs/storage/_supported_methods_main.rst index 8f3423b3bc..81a021dec6 100644 --- a/docs/storage/_supported_methods_main.rst +++ b/docs/storage/_supported_methods_main.rst @@ -1,35 +1,79 @@ -============================= =============== ============ ================ ================ ============= ======================= =============== ========================= ============= -Provider list containers list objects create container delete container upload object streaming object upload download object streaming object download delete object -============================= =============== ============ ================ ================ ============= ======================= =============== ========================= ============= -`Microsoft Azure (blobs)`_ yes yes yes yes yes yes yes yes yes -`CloudFiles`_ yes yes yes yes yes yes yes yes yes -`CloudFiles (UK)`_ yes yes yes yes yes yes yes yes yes -`CloudFiles (US)`_ yes yes yes yes yes yes yes yes yes -`Google Storage`_ yes yes yes yes yes yes yes yes yes -`KTUCloud Storage`_ yes yes yes yes yes yes yes yes yes -`Nimbus.io`_ yes no yes no no no no no no -`Ninefold`_ yes yes yes yes yes yes yes yes yes -`OpenStack Swift`_ yes yes yes yes yes yes yes yes yes -`Amazon S3 (standard)`_ yes yes yes yes yes yes yes yes yes -`Amazon S3 (ap-northeast-1)`_ yes yes yes yes yes yes yes yes yes -`Amazon S3 (ap-southeast-1)`_ yes yes yes yes yes yes yes yes yes -`Amazon S3 (eu-west-1)`_ yes yes yes yes yes yes yes yes yes -`Amazon S3 (us-west-1)`_ yes yes yes yes yes yes yes yes yes -`Amazon S3 (us-west-2)`_ yes yes yes yes yes yes yes yes yes -============================= =============== ============ ================ ================ ============= ======================= =============== ========================= ============= +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it +============================= =============== ============ ================ ================ ============= ======================= =============== ========================== ========================= ================================= ============= +Provider list containers list objects create container delete container upload object streaming object upload download object download part of an object streaming object download streaming partial object download delete object +============================= =============== ============ ================ ================ ============= ======================= =============== ========================== ========================= ================================= ============= +`Aliyun OSS`_ yes yes yes yes yes yes yes no yes no yes +`PCextreme AuroraObjects`_ yes yes yes yes yes yes yes yes yes yes yes +`Microsoft Azure (blobs)`_ yes yes yes yes yes yes yes yes yes yes yes +`Backblaze B2`_ yes yes yes yes yes yes yes no yes no yes +`CloudFiles`_ yes yes yes yes yes yes yes yes yes yes yes +`DigitalOcean Spaces`_ yes yes yes yes yes yes yes yes yes yes yes +`Google Cloud Storage`_ yes yes yes yes yes yes yes yes yes yes yes +`KTUCloud Storage`_ yes yes yes yes yes yes yes yes yes yes yes +`Local Storage`_ yes yes yes yes yes yes yes yes yes yes yes +`MinIO Storage Driver`_ yes yes yes yes yes yes yes yes yes yes yes +`Nimbus.io`_ yes no yes no no no no no no no no +`Ninefold`_ yes yes yes yes yes yes yes no yes no yes +`OpenStack Swift`_ yes yes yes yes yes yes yes yes yes yes yes +`Ovh Storage Driver`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (ap-northeast-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (ap-northeast-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (ap-northeast-2)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (ap-south-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (ap-southeast-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (ap-southeast-2)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (ca-central-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (cn-north-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (cn-northwest-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (eu-central-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (eu-north-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (eu-west-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (eu-west-2)`_ yes yes yes yes yes yes yes yes yes yes yes +`Ceph RGW`_ yes yes yes yes yes yes yes yes yes yes yes +`RGW Outscale`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (sa-east-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (us-east-2)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (us-gov-west-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (us-west-1)`_ yes yes yes yes yes yes yes yes yes yes yes +`Amazon S3 (us-west-2)`_ yes yes yes yes yes yes yes yes yes yes yes +`Scaleway Storage Driver`_ yes yes yes yes yes yes yes yes yes yes yes +============================= =============== ============ ================ ================ ============= ======================= =============== ========================== ========================= ================================= ============= + +.. _`Aliyun OSS`: http://www.aliyun.com/product/oss +.. _`PCextreme AuroraObjects`: https://www.pcextreme.com/aurora/objects .. _`Microsoft Azure (blobs)`: http://windows.azure.com/ +.. _`Backblaze B2`: https://www.backblaze.com/b2/ .. _`CloudFiles`: http://www.rackspace.com/ -.. _`CloudFiles (UK)`: http://www.rackspace.com/ -.. _`CloudFiles (US)`: http://www.rackspace.com/ -.. _`Google Storage`: http://cloud.google.com/ +.. _`DigitalOcean Spaces`: https://www.digitalocean.com/products/object-storage/ +.. _`Google Cloud Storage`: http://cloud.google.com/storage .. _`KTUCloud Storage`: http://www.rackspace.com/ +.. _`Local Storage`: http://example.com +.. _`MinIO Storage Driver`: https://min.io/ .. _`Nimbus.io`: https://nimbus.io/ .. _`Ninefold`: http://ninefold.com/ .. _`OpenStack Swift`: http://www.rackspace.com/ -.. _`Amazon S3 (standard)`: http://aws.amazon.com/s3/ +.. _`Ovh Storage Driver`: https://www.ovhcloud.com/en/public-cloud/object-storage/ +.. _`Amazon S3`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ap-northeast-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (ap-northeast-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ap-northeast-2)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ap-south-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (ap-southeast-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ap-southeast-2)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ca-central-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (cn-north-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (cn-northwest-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (eu-central-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (eu-north-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (eu-west-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (eu-west-2)`: http://aws.amazon.com/s3/ +.. _`Ceph RGW`: http://ceph.com/ +.. _`RGW Outscale`: https://en.outscale.com/ +.. _`Amazon S3 (sa-east-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (us-east-2)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (us-gov-west-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (us-west-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (us-west-2)`: http://aws.amazon.com/s3/ +.. _`Scaleway Storage Driver`: https://www.scaleway.com/en/object-storage/ diff --git a/docs/storage/_supported_providers.rst b/docs/storage/_supported_providers.rst index bffae46f64..c13c6eadd5 100644 --- a/docs/storage/_supported_providers.rst +++ b/docs/storage/_supported_providers.rst @@ -1,35 +1,61 @@ -============================= =============================================== ================= ============================================== ==================================== -Provider Documentation Provider constant Module Class Name -============================= =============================================== ================= ============================================== ==================================== -`Microsoft Azure (blobs)`_ :doc:`Click ` AZURE_BLOBS :mod:`libcloud.storage.drivers.azure_blobs` :class:`AzureBlobsStorageDriver` -`CloudFiles`_ CLOUDFILES :mod:`libcloud.storage.drivers.cloudfiles` :class:`CloudFilesStorageDriver` -`CloudFiles (UK)`_ CLOUDFILES_UK :mod:`libcloud.storage.drivers.cloudfiles` :class:`CloudFilesUKStorageDriver` -`CloudFiles (US)`_ CLOUDFILES_US :mod:`libcloud.storage.drivers.cloudfiles` :class:`CloudFilesUSStorageDriver` -`Google Storage`_ :doc:`Click ` GOOGLE_STORAGE :mod:`libcloud.storage.drivers.google_storage` :class:`GoogleStorageDriver` -`KTUCloud Storage`_ KTUCLOUD :mod:`libcloud.storage.drivers.ktucloud` :class:`KTUCloudStorageDriver` -`Nimbus.io`_ NIMBUS :mod:`libcloud.storage.drivers.nimbus` :class:`NimbusStorageDriver` -`Ninefold`_ NINEFOLD :mod:`libcloud.storage.drivers.ninefold` :class:`NinefoldStorageDriver` -`OpenStack Swift`_ :doc:`Click ` OPENSTACK_SWIFT :mod:`libcloud.storage.drivers.cloudfiles` :class:`OpenStackSwiftStorageDriver` -`Amazon S3 (standard)`_ :doc:`Click ` S3 :mod:`libcloud.storage.drivers.s3` :class:`S3StorageDriver` -`Amazon S3 (ap-northeast-1)`_ S3_AP_NORTHEAST :mod:`libcloud.storage.drivers.s3` :class:`S3APNEStorageDriver` -`Amazon S3 (ap-southeast-1)`_ S3_AP_SOUTHEAST :mod:`libcloud.storage.drivers.s3` :class:`S3APSEStorageDriver` -`Amazon S3 (eu-west-1)`_ S3_EU_WEST :mod:`libcloud.storage.drivers.s3` :class:`S3EUWestStorageDriver` -`Amazon S3 (us-west-1)`_ S3_US_WEST :mod:`libcloud.storage.drivers.s3` :class:`S3USWestStorageDriver` -`Amazon S3 (us-west-2)`_ S3_US_WEST_OREGON :mod:`libcloud.storage.drivers.s3` :class:`S3USWestOregonStorageDriver` -============================= =============================================== ================= ============================================== ==================================== +.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it +========================== =================================================== =================== =================================================================================================================================================================================================================================================================================================================================== =================================================== ======================================== +Provider Documentation Provider Constant Supported Regions Module Class Name +========================== =================================================== =================== =================================================================================================================================================================================================================================================================================================================================== =================================================== ======================================== +`Aliyun OSS`_ ALIYUN_OSS single region driver :mod:`libcloud.storage.drivers.oss` :class:`OSSStorageDriver` +`PCextreme AuroraObjects`_ :doc:`Click ` AURORAOBJECTS single region driver :mod:`libcloud.storage.drivers.auroraobjects` :class:`AuroraObjectsStorageDriver` +`Microsoft Azure (blobs)`_ :doc:`Click ` AZURE_BLOBS single region driver :mod:`libcloud.storage.drivers.azure_blobs` :class:`AzureBlobsStorageDriver` +`Backblaze B2`_ :doc:`Click ` BACKBLAZE_B2 single region driver :mod:`libcloud.storage.drivers.backblaze_b2` :class:`BackblazeB2StorageDriver` +`CloudFiles`_ CLOUDFILES dfw, hkg, iad, lon, ord, syd :mod:`libcloud.storage.drivers.cloudfiles` :class:`CloudFilesStorageDriver` +`DigitalOcean Spaces`_ :doc:`Click ` DIGITALOCEAN_SPACES single region driver :mod:`libcloud.storage.drivers.digitalocean_spaces` :class:`DigitalOceanSpacesStorageDriver` +`Google Cloud Storage`_ :doc:`Click ` GOOGLE_STORAGE single region driver :mod:`libcloud.storage.drivers.google_storage` :class:`GoogleStorageDriver` +`KTUCloud Storage`_ KTUCLOUD dfw, hkg, iad, lon, ord, syd :mod:`libcloud.storage.drivers.ktucloud` :class:`KTUCloudStorageDriver` +`Local Storage`_ LOCAL single region driver :mod:`libcloud.storage.drivers.local` :class:`LocalStorageDriver` +`MinIO Storage Driver`_ :doc:`Click ` MINIO single region driver :mod:`libcloud.storage.drivers.minio` :class:`MinIOStorageDriver` +`Nimbus.io`_ NIMBUS single region driver :mod:`libcloud.storage.drivers.nimbus` :class:`NimbusStorageDriver` +`Ninefold`_ NINEFOLD single region driver :mod:`libcloud.storage.drivers.ninefold` :class:`NinefoldStorageDriver` +`OpenStack Swift`_ :doc:`Click ` OPENSTACK_SWIFT dfw, hkg, iad, lon, ord, syd :mod:`libcloud.storage.drivers.cloudfiles` :class:`OpenStackSwiftStorageDriver` +`Ovh Storage Driver`_ OVH gra, sbg :mod:`libcloud.storage.drivers.ovh` :class:`OvhStorageDriver` +`Amazon S3`_ :doc:`Click ` S3 af-south-1, ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-southeast-1, ap-southeast-2, ca-central-1, cn-north-1, cn-northwest-1, eu-central-1, eu-north-1, eu-south-1, eu-west-1, eu-west-2, eu-west-3, me-south-1, sa-east-1, sa-east-2, us-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2 :mod:`libcloud.storage.drivers.s3` :class:`S3StorageDriver` +`Ceph RGW`_ S3_RGW single region driver :mod:`libcloud.storage.drivers.rgw` :class:`S3RGWStorageDriver` +`RGW Outscale`_ S3_RGW_OUTSCALE single region driver :mod:`libcloud.storage.drivers.rgw` :class:`S3RGWOutscaleStorageDriver` +`Scaleway Storage Driver`_ :doc:`Click ` SCALEWAY fr-par, nl-ams, pl-waw :mod:`libcloud.storage.drivers.scaleway` :class:`ScalewayStorageDriver` +========================== =================================================== =================== =================================================================================================================================================================================================================================================================================================================================== =================================================== ======================================== + +.. _`Aliyun OSS`: http://www.aliyun.com/product/oss +.. _`PCextreme AuroraObjects`: https://www.pcextreme.com/aurora/objects .. _`Microsoft Azure (blobs)`: http://windows.azure.com/ +.. _`Backblaze B2`: https://www.backblaze.com/b2/ .. _`CloudFiles`: http://www.rackspace.com/ -.. _`CloudFiles (UK)`: http://www.rackspace.com/ -.. _`CloudFiles (US)`: http://www.rackspace.com/ -.. _`Google Storage`: http://cloud.google.com/ +.. _`DigitalOcean Spaces`: https://www.digitalocean.com/products/object-storage/ +.. _`Google Cloud Storage`: http://cloud.google.com/storage .. _`KTUCloud Storage`: http://www.rackspace.com/ +.. _`Local Storage`: http://example.com +.. _`MinIO Storage Driver`: https://min.io/ .. _`Nimbus.io`: https://nimbus.io/ .. _`Ninefold`: http://ninefold.com/ .. _`OpenStack Swift`: http://www.rackspace.com/ -.. _`Amazon S3 (standard)`: http://aws.amazon.com/s3/ +.. _`Ovh Storage Driver`: https://www.ovhcloud.com/en/public-cloud/object-storage/ +.. _`Amazon S3`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ap-northeast-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (ap-northeast-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ap-northeast-2)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ap-south-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (ap-southeast-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ap-southeast-2)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (ca-central-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (cn-north-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (cn-northwest-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (eu-central-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (eu-north-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (eu-west-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (eu-west-2)`: http://aws.amazon.com/s3/ +.. _`Ceph RGW`: http://ceph.com/ +.. _`RGW Outscale`: https://en.outscale.com/ +.. _`Amazon S3 (sa-east-1)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (us-east-2)`: http://aws.amazon.com/s3/ +.. _`Amazon S3 (us-gov-west-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (us-west-1)`: http://aws.amazon.com/s3/ .. _`Amazon S3 (us-west-2)`: http://aws.amazon.com/s3/ +.. _`Scaleway Storage Driver`: https://www.scaleway.com/en/object-storage/ diff --git a/docs/storage/drivers/auroraobjects.rst b/docs/storage/drivers/auroraobjects.rst new file mode 100644 index 0000000000..11eedbcda8 --- /dev/null +++ b/docs/storage/drivers/auroraobjects.rst @@ -0,0 +1,68 @@ +AuroraObjects Storage Driver Documentation +========================================== + +`PCextreme B.V.`_ is a Dutch cloud provider. It provides a public cloud offering +under the name AuroraCompute. All cloud services are under the family name Aurora. + +All data is stored on servers in the European Union. + +.. figure:: /_static/images/provider_logos/pcextreme.png + :align: center + :width: 300 + :target: https://www.pcextreme.com/aurora/objects + +Protocol +-------- + +AuroraObjects talks the Amazon S3 protocol and thus supports almost all functions +which the Amazon S3 storage driver supports. + +It however does not support CDN support. Calling any of the CDN functions will raise +a LibcloudError. + +As a backend AuroraObjects uses `Ceph`_ for storage. + +Instantiating a driver +---------------------- + +When instantiating the AuroraObjects you need a access key and secret key. +These can be obtained from the `Control Panel`_ of AuroraObjects. + +With these credentials you can instantiate the driver: + +.. literalinclude:: /examples/storage/auroraobjects/instantiate.py + :language: python + +Multipart uploads +----------------- + +AuroraObjects storage driver supports multipart uploads which means you can +upload objects with a total size of up to 5 TB. + +Multipart upload works similar to Amazon S3. After uploading all the parts the +AuroraObjects servers combine the parts into one large object. + +If you use +:meth:`libcloud.storage.base.StorageDriver.upload_object_via_stream` method, +Libcloud transparently handles all the splitting and uploading of the parts +for you. + +By default, to prevent excessive buffering and use of memory, each part is +5 MB in size. This is also the smallest size of a part you can use with the +multi part upload. + +Examples +-------- + +Please refer to the Amazon S3 storage driver documentation for examples. + +API Docs +-------- + +.. autoclass:: libcloud.storage.drivers.auroraobjects.AuroraObjectsStorageDriver + :members: + :inherited-members: + +.. _`PCextreme B.V.`: https://www.pcextreme.com/ +.. _`Ceph`: https://ceph.com/ +.. _`Control Panel`: https://cp.pcextreme.nl/ diff --git a/docs/storage/drivers/azure_blobs.rst b/docs/storage/drivers/azure_blobs.rst index 043b1e008a..f7015ec7fe 100644 --- a/docs/storage/drivers/azure_blobs.rst +++ b/docs/storage/drivers/azure_blobs.rst @@ -7,7 +7,7 @@ Connecting to Azure Blobs To connect to Azure Blobs you need your storage account name and access key. You can retrieve this information in the Azure Management Portal by going to -Storage -> Manage Access Keys as shown on the screenshots below. +"Storage Accounts" -> "Access Keys" as shown on the screenshots below. .. figure:: /_static/images/misc/azure_blobs_manage_access_keys_1.png :align: center @@ -16,7 +16,13 @@ Storage -> Manage Access Keys as shown on the screenshots below. .. figure:: /_static/images/misc/azure_blobs_manage_access_keys_2.png :align: center - :width: 500 + :width: 900 + +The following types of storage accounts are supported in libcloud: + +- `General-purpose v2 accounts`_ +- `General-purpose v1 accounts`_ +- `BlockBlobStorage accounts`_ Instantiating a driver ~~~~~~~~~~~~~~~~~~~~~~ @@ -26,3 +32,47 @@ below. .. literalinclude:: /examples/storage/azure/instantiate.py :language: python + +Connecting to Azure Government +------------------------------ + +To target an `Azure Government`_ storage account, you can instantiate the driver +by setting a custom storage host argument as shown below. + +.. literalinclude:: /examples/storage/azure/instantiate_gov.py + :language: python + +Setting a custom host argument can also be leveraged to customize the blob +endpoint and connect to a storage account in `Azure China`_ or +`Azure Private Link`_. + +Connecting to self-hosted Azure Storage implementations +------------------------------------------------------- + +To facilitate integration testing, libcloud supports connecting to the +`Azurite storage emulator`_. After starting the emulator, you can +instantiate the driver as shown below. + +.. literalinclude:: /examples/storage/azure/instantiate_azurite.py + :language: python + +This instantiation strategy can also be adapted to connect to other self-hosted +Azure Storage implementations such as `Azure Blob Storage on IoT Edge`_. + +Connecting with Azure AD +------------------------------ +Create a service principal in the same tenant as your storage account. +Once you have obtained your credentials you can instantiate the driver as shown +below. + +.. literalinclude:: /examples/storage/azure/instantiate_azure_ad.py + :language: python + +.. _`General-purpose v2 accounts`: https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview#general-purpose-v2-accounts +.. _`General-purpose v1 accounts`: https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview#general-purpose-v1-accounts +.. _`BlockBlobStorage accounts`: https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview#blockblobstorage-accounts +.. _`Azurite storage emulator`: https://github.com/Azure/Azurite +.. _`Azure Blob Storage on IoT Edge`: https://docs.microsoft.com/en-us/azure/iot-edge/how-to-store-data-blob +.. _`Azure Government`: https://docs.microsoft.com/en-us/azure/azure-government/documentation-government-developer-guide +.. _`Azure China`: https://docs.microsoft.com/en-us/azure/china/resources-developer-guide +.. _`Azure Private Link`: https://docs.microsoft.com/en-us/azure/private-link/private-link-overview diff --git a/docs/storage/drivers/backblaze_b2.rst b/docs/storage/drivers/backblaze_b2.rst new file mode 100644 index 0000000000..b918fc714c --- /dev/null +++ b/docs/storage/drivers/backblaze_b2.rst @@ -0,0 +1,39 @@ +Backblaze B2 Storage Driver Documentation +========================================= + +`Backblaze`_ is an online backup tool that allows Windows and Mac OS X users to +back up their data to an offsite data center. + +`Backblaze B2`_ is their cloud object storage offering similar to Amazon S3 and +other object storage services. + +.. figure:: /_static/images/provider_logos/backblaze.png + :align: center + :width: 300 + :target: https://www.backblaze.com/b2/cloud-storage.html + +Instantiating a driver +---------------------- + +To instantiate the driver you need to pass your key id and application key to +the driver constructor as shown below. + +To access the credentials, you can login to +https://secure.backblaze.com/user_signin.htm, then click "App Keys" or go +to https://secure.backblaze.com/app_keys.htm directly. + +``keyID`` serves as the first and ``applicationKey`` as the second argument to +the driver constructor. + +.. literalinclude:: /examples/storage/backblaze_b2/instantiate.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.storage.drivers.backblaze_b2.BackblazeB2StorageDriver + :members: + :inherited-members: + +.. _`Backblaze`: https://www.backblaze.com/ +.. _`Backblaze B2`: https://www.backblaze.com/b2/cloud-storage.html diff --git a/docs/storage/drivers/digitalocean_spaces.rst b/docs/storage/drivers/digitalocean_spaces.rst new file mode 100644 index 0000000000..26deb806ff --- /dev/null +++ b/docs/storage/drivers/digitalocean_spaces.rst @@ -0,0 +1,56 @@ +DigitalOcean Spaces Storage Driver Documentation +================================================ + +`Spaces`_ is an `S3-interoperable`_ object storage service from cloud provider +DigitalOcean. + +Connecting to Spaces +-------------------- + +To connect to DigitalOcean Spaces you need an access key and secret key. These +can be retrieved on the "`Applications & API`_" page of the DigitalOcean control +panel. + +Instantiating a driver +~~~~~~~~~~~~~~~~~~~~~~ + +Once you have obtained your credentials you can instantiate the driver as shown +below. + +.. literalinclude:: /examples/storage/digitalocean_spaces/instantiate.py + :language: python + +Spaces supports both the v2 and v4 AWS signature types. By default, this driver +will use v2. You can configure it to use v4 by passing the ``signature_version`` +argument when instantiating the driver as shown below. + +.. literalinclude:: /examples/storage/digitalocean_spaces/v4sig.py + :language: python + +Specifying canned ACLs +~~~~~~~~~~~~~~~~~~~~~~ + +Spaces supports a limited set of canned ACLs. In order to specify an ACL when +uploading an object, you can pass an ``extra`` argument with the ``acl`` +attribute to the upload methods. + +For example: + +.. literalinclude:: /examples/storage/digitalocean_spaces/upload_object_acls.py + :language: python + +At this time, valid values for this attribute are only: + +* ``private`` (default) +* ``public-read`` + +API Docs +-------- + +.. autoclass:: libcloud.storage.drivers.digitalocean_spaces.DigitalOceanSpacesStorageDriver + :members: + :inherited-members: + +.. _`Spaces`: https://www.digitalocean.com/products/object-storage/ +.. _`Applications & API`: https://cloud.digitalocean.com/settings/api/tokens +.. _`S3-interoperable`: https://developers.digitalocean.com/documentation/spaces/ diff --git a/docs/storage/drivers/google_storage.rst b/docs/storage/drivers/google_storage.rst index d21e95c9dc..efd3acdc39 100644 --- a/docs/storage/drivers/google_storage.rst +++ b/docs/storage/drivers/google_storage.rst @@ -1,5 +1,5 @@ -Google Storage Storage Driver Documentation -=========================================== +Google Storage Driver Documentation +=================================== Current version of the Google Storage driver in Libcloud uses S3 compatibility layer and as such, only supports `XML API v1.0`_. @@ -16,7 +16,22 @@ project id header. Known limitations ----------------- -1. Meta data / tags aren't returned when using list_container_objects method +1. Only lower case values are supported for metadata keys +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Google Storage driver is implemented on top of the S3 compatible XML API. In +the XML API (and per AWS API docs), metadata values are sent as part of HTTP +request headers which means mixed casing is not supported for metadata keys ( +all the metadata keys are lower cased). + +Native Google Storage JSON API does support mixed casing for metadata keys, +but that API is not supported by Libcloud. + +To make migrating across different providers easier and for compatibility +reasons, you are encouraged to not rely on mixed casing for metadata header keys +even with the providers which support it. + +2. Meta data / tags aren't returned when using list_container_objects method ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Meta data / tags associated with an object are only returned when using diff --git a/docs/storage/drivers/minio.rst b/docs/storage/drivers/minio.rst new file mode 100644 index 0000000000..84d9c7884e --- /dev/null +++ b/docs/storage/drivers/minio.rst @@ -0,0 +1,27 @@ +MinIO Storage Driver Documentation +================================== + +`MinIO`_ is high performance, Kubernetes native object storage which exposes S3 +compatible API. + +.. figure:: /_static/images/provider_logos/minio.png + :align: center + :width: 300 + :target: https://min.io + +Libcloud MinIO driver utilizes ``BaseS3StorageDriver`` class which utilizes S3 +API. + +Examples +-------- + +1. Connect to local MinIO installation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This example show how to connect to local MinIO installation which is running +using Docker containers (https://docs.min.io/docs/minio-docker-quickstart-guide.html). + +.. literalinclude:: /examples/storage/minio/docker_example.py + :language: python + +.. _`MinIO`: https://min.io diff --git a/docs/storage/drivers/s3.rst b/docs/storage/drivers/s3.rst index 20776e5786..fe0fc18f2c 100644 --- a/docs/storage/drivers/s3.rst +++ b/docs/storage/drivers/s3.rst @@ -4,8 +4,35 @@ Amazon S3 Storage Driver Documentation `Amazon Simple Storage Service (Amazon S3)`_ is an online cloud storage service from Amazon Web Services. +.. note:: + + If you are upgrading from Libcloud v2.3.0 or older versions and are + utilizing paths with duplicated slashes (e.g. ``/my-bucket//path/1.txt``) + or a root bucket named as ``/``, enable the per-driver option described + below or use the global ``libcloud.common.base.ALLOW_PATH_DOUBLE_SLASHES`` + variable added in Libcloud v3.3.0. + + For more information, please refer to the "Upgrade Notes". + +Object names containing repeated slashes +---------------------------------------- + +S3 treats slashes as part of an object's name. To preserve leading or repeated +slashes when accessing these objects, enable the per-driver option:: + + driver = S3StorageDriver(key, secret, ex_allow_path_double_slashes=True) + +This applies to object requests, including uploads, downloads, and deletions. +Without this option or the global ``ALLOW_PATH_DOUBLE_SLASHES`` setting, a name +such as ``/path/to/object`` can be normalized to ``path/to/object``. S3 may then +report a successful deletion even though the intended object still exists. + +The option defaults to ``False`` for compatibility. It does not alter other +driver instances or the global setting. The global setting continues to apply +when the per-driver option is not enabled. + Multipart uploads ------------------- +----------------- Amazon S3 driver supports multipart uploads which means you can upload objects with a total size of up to 5 TB. diff --git a/docs/storage/drivers/scaleway.rst b/docs/storage/drivers/scaleway.rst new file mode 100644 index 0000000000..3d4a511ee3 --- /dev/null +++ b/docs/storage/drivers/scaleway.rst @@ -0,0 +1,27 @@ +Scaleway Storage Driver Documentation +===================================== + +Scaleway Object Storage is an Object Storage service based on the S3 protocol. + +.. figure:: /_static/images/provider_logos/scaleway.svg + :align: center + :width: 300 + :target: https://www.scaleway.com/ + +Libcloud Scaleway Object Storage driver utilizes ``BaseS3StorageDriver`` class which utilizes S3 +API. + +Examples +-------- + +1. Upload a file to Scaleway's Object Storage +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This example shows how to upload a local file to Scaleway's Object Storage. + +Requirements: You have an account, credentials and have created an Object Storage Bucket (https://console.scaleway.com/object-storage/buckets). + +.. literalinclude:: /examples/storage/scaleway/upload_example.py + :language: python + +.. _`Scaleway`: https://www.scaleway.com/ diff --git a/docs/storage/examples.rst b/docs/storage/examples.rst index 8b0a50fab6..fca0185423 100644 --- a/docs/storage/examples.rst +++ b/docs/storage/examples.rst @@ -17,6 +17,29 @@ As you can see in the example above, meta-data is specified by including ``meta_data`` key in the ``extra`` dictionary argument which gets passed to all the upload methods. +Download part of an object +-------------------------- + +To perform a partial (range) object download, you can utilize new +:meth:`libcloud.storage.base.StorageDriver.download_object_range` +and :meth:`libcloud.storage.base.StorageDriver.download_object_range_as_stream` +methods which have been added in Libcloud v3.0.0. + +``start_bytes`` and ``end_bytes`` behave in the same manner as Python +indexing which means that ``start_bytes`` is inclusive and ``end_bytes`` +is non-inclusive. + +For example, if the object content is ``0123456789``, here is what +would be returned for various values of start and end bytes arguments: + +* start_bytes=0, end_bytes=1 -> 0 +* start_bytes=0, end_bytes=2 -> 01 +* start_bytes=5, end_bytes=6 -> 5 +* start_bytes=5, end_bytes=10 -> 56789 + +.. literalinclude:: /examples/storage/partial_object_download.py + :language: python + Create a backup of a directory and directly stream it to CloudFiles ------------------------------------------------------------------- diff --git a/docs/storage/supported_providers.rst b/docs/storage/supported_providers.rst index c4d5da54b1..2a99c75807 100644 --- a/docs/storage/supported_providers.rst +++ b/docs/storage/supported_providers.rst @@ -13,7 +13,7 @@ Supported Methods (storage) .. include:: _supported_methods_main.rst -Supported Methods (CND) +Supported Methods (CDN) ----------------------- .. include:: _supported_methods_cdn.rst diff --git a/docs/supported_providers.rst b/docs/supported_providers.rst index c7f58ef079..f7f24645ac 100644 --- a/docs/supported_providers.rst +++ b/docs/supported_providers.rst @@ -57,6 +57,32 @@ Supported Methods (CDN) .. include:: storage/_supported_methods_cdn.rst +Container +--------- + +Provider Matrix +~~~~~~~~~~~~~~~ + +.. include:: container/_supported_providers.rst + +Supported Methods +~~~~~~~~~~~~~~~~~ + +.. include:: container/_supported_methods.rst + +Backup +------ + +Provider Matrix +~~~~~~~~~~~~~~~ + +.. include:: backup/_supported_providers.rst + +Supported Methods +~~~~~~~~~~~~~~~~~ + +.. include:: backup/_supported_methods.rst + DNS --- diff --git a/docs/supported_python_versions.rst b/docs/supported_python_versions.rst new file mode 100644 index 0000000000..45fcbcb06c --- /dev/null +++ b/docs/supported_python_versions.rst @@ -0,0 +1,44 @@ +Supported Python Versions +========================= + +Currently Supported Python Versions +----------------------------------- + +Libcloud supports CPython >= 3.10 and PyPy >= 3.10. + +Those are also the versions we continuously run our tests with on Github Actions +(https://travis-ci.org/apache/libcloud). + +Python 3.9 +---------- + +Support for CPython 3.9 and PyPy 3.9 has been dropped. If you still need to use +Libcloud with one of those versions, you can use Libcloud v3.9.x which is the +last release series which supports those Python versions. + +Python 3.5 +---------- + +Support for CPython 3.5 was dropped in Libcloud v3.5.0. + +If you still need to use Libcloud with one of those versions, you can use +Libcloud v3.4.x which is the last release which supports those Python +versions. + +Python 2.7 and Python 3.4 +------------------------- + +Support for CPython 2.7, CPython 3.4 and PyPy 2 was dropped in Libcloud v3.0.0. + +If you still need to use Libcloud with one of those versions, you can use +Libcloud v2.8.0 which is the last release which supports those Python +versions. + +Older Python Versions +--------------------- + +Support for Python 2.4 has been dropped in Libcloud 0.4.0, Python 2.5 in 2016 +and Python 2.6 and 3.3 in Libcloud 2.3.0 in 2018. + +Keep in mind that those Libcloud versions are now very old and out of date and +shouldn't be used. diff --git a/docs/testing.rst b/docs/testing.rst index c408e4c622..12ae324352 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -8,17 +8,26 @@ Prerequisites .. note:: - If you use the tox method described bellow you don't need to install any + If you use the tox method described below you don't need to install any dependencies, because tox automatically installs them for you in an virtual environment. -To run the libcloud test suite you need to have the following extra -dependencies installed: +If you use ``uv``, you can install all test dependencies in one step: + +.. sourcecode:: bash + + uv sync --group test --group ci --no-dev + +Drop ``--group ci`` if you don't plan to run ``tox``. +If ``uv.lock`` is missing or out of date, run ``uv lock`` first. + +If you don't use ``uv``, you need to have the following additional dependencies +installed: * ``tox`` (``pip install tox``) - you only need this library if you want to use tox to run the tests with all the supported Python versions -* ``mock`` (``pip install mock``) -* ``lockfile`` (``pip install lockfile``) - only used in the local storage +* ``pytest`` (``pip install pytest``) - test runner we use to run the tests +* ``fasteners`` (``pip install fasteners``) - only used in the local storage driver * ``coverage`` (``pip install coverage``) - you only need this library if you want to generate a test coverage report @@ -34,10 +43,7 @@ To run the tests on all the supported Python versions run the following command: .. sourcecode:: bash - sudo tox - -You need to run this command as a root user, because Python 2.5 depends on ssl -module and you need root permissions to install it. + tox Running Tests Manually ---------------------- @@ -48,7 +54,7 @@ following command: .. sourcecode:: bash - PYTHONPATH=. python setup.py test + pytest -s -vvv Running a Single Test File -------------------------- @@ -58,13 +64,20 @@ repository and run the following command: .. sourcecode:: bash - PYTHONPATH=. python libcloud/test/ + pytest -s -vvv libcloud/test/ For example: .. sourcecode:: bash - PYTHONPATH=. python libcloud/test/compute/test_ec2.py + pytest -s -vvv libcloud/test/compute/test_ec2.py + +You can also run single test in a test file by using ``-k`` flag as shown +below: + +.. sourcecode:: bash + + pytest -s -vvv libcloud/test/compute/test_ec2.py -k "test_list_nodes" Generating Test Coverage Report ------------------------------- @@ -73,7 +86,7 @@ To generate the test coverage run the following command: .. sourcecode:: bash - PYTHONPATH=. python setup.py coverage + tox -e coverage_html_report When it completes you should see a new ``coverage_html_report`` directory which contains the test coverage. @@ -81,7 +94,7 @@ contains the test coverage. Running tests inside a Docker container --------------------------------------- -To run the tests on all the supported Python versions (minus Python 2.5), run +To run the tests on all the supported Python versions, run the following command: .. sourcecode:: bash diff --git a/docs/third_party_drivers.rst b/docs/third_party_drivers.rst index 0e06de943a..07b23e3bf9 100644 --- a/docs/third_party_drivers.rst +++ b/docs/third_party_drivers.rst @@ -14,30 +14,30 @@ guarantee the quality of those drivers. Compute ------- -+-------------------+---------------------------------+--------------------------------------+ -| Provider | PyPi package | Source code | -+===================+=================================+======================================+ -| `StratusLab`_ | | `StratusLab/libcloud-drivers`_ | -+-------------------+---------------------------------+--------------------------------------+ -| `Snooze`_ | `stratuslab-libcloud-drivers`_ | `snooze-libcloud`_ | -+-------------------+---------------------------------+--------------------------------------+ ++----------------+---------------------------------+---------------------------------+ +| Provider | PyPi package | Source code | ++================+=================================+=================================+ +| `StratusLab`_ | `stratuslab-libcloud-drivers`_ | `StratusLab/libcloud-drivers`_ | ++----------------+---------------------------------+---------------------------------+ +| `Snooze`_ | | `msimonin/snooze-libcloud`_ | ++----------------+---------------------------------+---------------------------------+ DNS ---- -+-------------------+--------------------------+--------------------------------------+ -| Provider | PyPi package | Source code | -+===================+==========================+======================================+ -| `DNSMadeEasy`_ | `libcloud-dnsmadeeasy`_ | `moses-palmer/libcloud-dnsmadeeasy`_ | -+-------------------+--------------------------+--------------------------------------+ ++-----------------+--------------------------+---------------------------------------+ +| Provider | PyPi package | Source code | ++=================+==========================+=======================================+ +| `DNSMadeEasy`_ | `libcloud-dnsmadeeasy`_ | `moses-palmer/libcloud-dnsmadeeasy`_ | ++-----------------+--------------------------+---------------------------------------+ .. _`StratusLab`: http://stratuslab.eu/ -.. _`Snooze`: http://snooze.inria.fr -.. _`snooze-libcloud`: https://github.com/msimonin/snooze-libcloud - .. _`stratuslab-libcloud-drivers`: https://pypi.python.org/pypi/stratuslab-libcloud-drivers .. _`StratusLab/libcloud-drivers`: https://github.com/StratusLab/libcloud-drivers +.. _`Snooze`: http://snooze.inria.fr +.. _`msimonin/snooze-libcloud`: https://github.com/msimonin/snooze-libcloud + .. _`DNSMadeEasy`: http://www.dnsmadeeasy.com/ -.. _`libcloud-dnsmadeeasy`: https://pypi.python.org/pypi/libcloud-dnsmadeeasy/1.0 +.. _`libcloud-dnsmadeeasy`: https://pypi.python.org/pypi/libcloud-dnsmadeeasy .. _`moses-palmer/libcloud-dnsmadeeasy`: https://github.com/moses-palmer/libcloud-dnsmadeeasy diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index 8c121031bd..f4b299a725 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -41,6 +41,15 @@ only works for non-chunked responses. Example 1 - Logging output to standard error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. note:: + + Some Linux distributions don't allow /dev/{stderr,stdout} to be opened in + append mode which means paramiko logger will return and error that it + can't log to that file. + In such scenario, it's recommended you specify actual file path and then + you can use "tail -F" in another terminal window to view the output in + real-time. + If you want the output to be logged to the standard error (on Linux) you can set it to ``/dev/stderr``: diff --git a/docs/upgrade_notes.rst b/docs/upgrade_notes.rst index 6b8bce22df..4a8f228148 100644 --- a/docs/upgrade_notes.rst +++ b/docs/upgrade_notes.rst @@ -5,8 +5,444 @@ This page describes how to upgrade from a previous version to a new version which contains backward incompatible or semi-incompatible changes and how to preserve the old behavior when this is possible. -Development ------------ +Libcloud 4.0.0 +-------------- + +Compute driver implementations now use the same argument order and optionality +as the corresponding methods on ``NodeDriver``. Provider-specific arguments +are optional and appear after the standard arguments. ``list_nodes`` is not +affected because its ``*args, **kwargs`` contract is intentionally +unrestricted. + +This affects methods including ``create_node``, ``list_sizes``, +``list_images``, image management, key pair management, and block storage +operations. Code which passes arguments positionally may need to be updated. +Using keyword arguments for provider-specific options is recommended. + +For example, the standard node creation signature is: + +.. sourcecode:: python + + def create_node(self, name, size, image, location=None, auth=None, ...) + +The standard volume creation signature is: + +.. sourcecode:: python + + def create_volume(self, size, name, location=None, snapshot=None, ...) + +Libcloud 3.9.0 +-------------- + +* Support for Python 3.7, 3.8 and 3.9 which have been EOL has been removed. + + If you still want to use Libcloud with Python 3.7, 3.8 or 3.9, you should + use an older release which still supports Python 3.7, 3.8 and 3.9. + +* [AZURE ARM] Added a new argument to destroy_node() to also delete node's managed + OS disk as part of the node's deletion. Defaults to true. This can be reverted by + setting the argument to false in the call: + + .. sourcecode:: python + + destroy_node(..., ex_destroy_os_disk=False) + +* [Equinix Metal] All the volume and volume snapshot management methods which + have been unsupported on the server side since 2021 have been removed from the + driver. In addition to that, `disk` and `disk_size` argument has been removed + from the `create_node()` method. + + If your code is using those arguments / passing them to the `create_node()` + method it needs to be updated and those arguments removed. + +* [KubeVirt] Changes to the `create_node()` method: + + - The `ports` argument has been renamed to `ex_ports`. + - The `ex_disks` argument has been redefined to support all volume types. + + The deprecated `ex_disks` format, which only supports `PersistentVolumeClaim`, + is as follows: + + .. sourcecode:: python + + ex_disks=[{"bus": "", "device": "", "disk_type": "", "name": "", "claim_name": "", "size": "", "storage_class_name": "", "volume_mode": "", "access_mode": ""}] + + The new format is: + + .. sourcecode:: python + + ex_disks=[{"bus": "", "device": "", "disk_type": "", "name": "", "volume_spec": {...}}] + + Here, `volume_spec` is the `disk_type` specific settings, which aligns with the + KubeVirt user guide on disks and volumes + (https://kubevirt.io/user-guide/virtual_machines/disks_and_volumes). + + For example, for PVC: + + .. sourcecode:: python + + ex_disks=[{ ..., "volume_spec": {{"claim_name": "", "size": "", "storage_class_name": "", "volume_mode": "", "access_mode": ""} }] + + If your code uses these arguments or passes them to the `create_node()` + method, it will need to be updated accordingly. + + +Libcloud 3.8.0 +-------------- + +* [LINODE API v4] Order of arguments to create_node() was changed. The order of the + arguments for name and size were not consistent with the rest of the codebase + and with the standard Libcloud API. + + This is possibly a breaking change for anyone using a previous version. + + New method signature: + + .. sourcecode:: python + + def create_node(self, location, name, size, image, ...) + + Old method signature: + + .. sourcecode:: python + + def create_node(self, location, size=None, image=None, name=None, ...) + +Libcloud 3.7.0 +-------------- + +* Support for Python 3.6 which has been EOL for more than a year now has been + removed. + + If you still want to use Libcloud with Python 3.6, you should use an older + release which still supports Python 3.6. + +Libcloud 3.6.0 +-------------- + +* Compatibility layer has been introduced for paramiko SSH based deployment + functionality. + + paramiko v2.9.0 introduced a change to prefer SHA-2 variants of RSA key + verification algorithm (https://github.com/paramiko/paramiko/blob/2.9.0/sites/www/changelog.rst#changelog). + With this version paramiko would fail to connect to older OpenSSH + servers which don't support this algorithm (e.g. default setup on Ubuntu + 14.04) and throw authentication error. + + The code has been updated to be backward compatible. It first tries to + connect to the server using default preferred algorithm values and in case + that fails, it will fall back to the old approach with SHA-2 variants + disabled. + + This functionality can be disabled by setting + ``LIBCLOUD_PARAMIKO_SHA2_BACKWARD_COMPATIBILITY``environment variable to + ``false``. + + For security reasons (to prevent possible downgrade attacks and similar) you + are encouraged to do that in case you know you won't be connecting to any old + +Libcloud 3.5.0 +-------------- + +* Support for Python 3.5 which has been EOL for more than a year now has been + removed. + + If you still want to use Libcloud with Python 3.5, you should use an older + release which still supports Python 3.5. + +* The OpenStack compute driver has moved the floating ip related functions + from nova to neutron. This change affects all the floating ip related + functions of the ``OpenStack_2_NodeDriver`` class. Two new classes have been + added ``OpenStack_2_FloatingIpPool`` and ``OpenStack_2_FloatingIpAddress``. + The main change applies to the FloatingIP class where ``node_id`` property + cannot be directly obtained from FloatingIP information and it must be + gotten from the related Port information with the ``get_node_id()`` method. + +Libcloud 3.4.0 +-------------- + +* Exception message changed in OpenStack drivers + + Attempting to use an identity API that requires authentication without an + authentication token raises a ValueError. The exception message used to be + "Not to be authenticated to perform this request", but has now been changed + to "Need to be authenticated to perform this request". + +* Code which retries HTTP requests on 429 rate limit reached status code has + been updated to respect ``timeout`` argument and stop retrying if timeout + has been reached. + + Previously if API kept returning 429 status code back to the client, the code + would try to retry for ever and in some scenarios when Retry-After value is + not available in the response headers, also use 0 seconds for the sleep / + retry delay which would cause busy waiting. + + If you want to preserve old behavior, you can do that by setting + ``retryCls`` variable on the driver connection instance to + ``RetryForeverOnRateLimitError`` as shown below.: + + .. sourcecode:: python + + from libcloud.utils.retry import RetryForeverOnRateLimitError + + driver.connection.retryCls = RetryForeverOnRateLimitError + ... + +Libcloud 3.3.0 +-------------- + +* ``libcloud.pricing.get_size_pricing()`` now only caches pricing data in + memory for the requested drivers. + + This way we avoid unnecessary overhead of caching data in memory for all the + drivers. + + If you want to revert to the old behavior (cache pricing data for all the + drivers in memory), you can do that by passing ``cache_all=True`` argument + to that function as shown below: + + .. sourcecode:: python + + from libcloud.pricing import get_size_pricing + + price = get_size_price("compute", "bluebox", cache_all=True) + + Or by setting ``libcloud.pricing.CACHE_ALL_PRICING_DATA`` module level + variable to ``True``: + + .. sourcecode:: python + + import libcloud.pricing + + libcloud.pricing.CACHE_ALL_PRICING_DATA = True + + # Your code here + # ... + + Passing ``cache_all=True`` might come handy in situations where you know the + application will work with a lot of different drivers - this way you can + avoid multiple disk reads when requesting pricing data for different drivers. + +* Packet driver has been renamed to Equinix Metal. Provider name + has changed from ``Provider.PACKET`` to ``Provider.EQUINIXMETAL``, + while everything else works as before. + + Before: + + .. sourcecode:: python + + from libcloud.compute.types import Provider + from libcloud.compute.providers import get_driver + + cls = get_driver(Provider.PACKET) + driver = cls('api_key') + + After: + + .. sourcecode:: python + + from libcloud.compute.types import Provider + from libcloud.compute.providers import get_driver + + cls = get_driver(Provider.EQUINIXMETAL) + driver = cls('api_key') + +* New ``libcloud.common.base.ALLOW_PATH_DOUBLE_SLASHES`` module level variable + has been added which defaults to ``False`` for backward compatibility reasons. + + When set to ``True``, Libcloud code won't perform any URL path sanitization + and will allow URL paths with double slashes (e.g. + ``/my-bucket//foo/1.txt``). + + This may come handy to the users who have S3 paths which contains double + slashes or similar and are upgrading from Libcloud ``v2.3.0`` or older where + no path sanitization was performed. + + Example S3 bucket layout with this option disabled (default) and enabled. + + Object with the following name: ``/my-bucket/sub-directory/file.txt`` + + .. code-block:: bash + + # Disabled + + root + +-- my-bucket/ + +-- sub-directory/ + +-- file.txt + + # Enabled + + root + +-- / + +-- my-bucket/ + +-- sub-directory/ + +-- file.txt + + Object with the following name: ``/my-bucket//directory1/file.txt`` + + .. code-block:: bash + + # Disabled + + root + +-- my-bucket/ + +-- directory1/ + +-- file.txt + + # Enabled + + root + +-- / + +-- my-bucket/ + +-- / + +-- directory1/ + +-- file.txt + + As you can see from the examples above, directory layout is not the same + with this option enabled and disabled so you should be careful when you + use it. + + This change affects all the drivers which are used when that module level + variable is set. + +Libcloud 3.2.0 +-------------- + +* To accommodate for more complex pricing schemes, pricing data format for AWS + EC2 inside ``libcloud/data/pricing.json`` file has changes. + + Previously, it contained a mapping of ``_`` -> + ```` -> ```` and now the pricing is in the following + format: ``ec_{linux,windows}`` -> ```` -> ```` -> + ````. + + This format gives us more flexibility for more complex pricing schemes and + also allows us to store prices for non-Linux instances. + +Libcloud 3.0.0 +-------------- + +* This release drops support for Python versions older than 3.5.0. + + If you still need to use Libcloud with Python 2.7 or Python 3.4 you can do + that by using the latest release which still supported those Python versions + (Libcloud v2.8.0). + +* This release removes VMware vSphere driver which relied on old and + unmaintained ``pysphere`` library which doesn't support Python 3. + +* This release removes support for PageBlob objects from the Azure Blobs + storage driver. The ``ex_blob_type`` and ``ex_page_blob_size`` arguments + have been removed from the ``upload_object`` and ``upload_object_via_stream`` + methods. + +* The ``ex_prefix`` keyword argument in the ``iterate_container_objects`` + and ``list_container_objects`` methods in all storage drivers has been + renamed to ``prefix`` to indicate the promotion of the argument to the + standard storage driver API. + +Libcloud 2.8.0 +-------------- + +* ``deploy_node()`` method in the GCE driver has been updated so it complies + with the base compute API. + + This means that the method now takes the same argument as the base + ``deploy_node()`` method (``deployment``, ``ssh_username``, ``ssh_port``, + etc.) plus all the keyword arguments which are supported by the + ``create_node()`` method. + +* ``group_name`` keyword argument in the ``create_node()`` method in the + Abiquo driver has been renamed to ``ex_group_name`` to comply with the + convention for naming non-standard arguments (arguments which are not + part of the standard compute API). + +Libcloud 2.7.0 +-------------- + +* AWS S3 driver has moved from "driver class per region" model to "single driver + class with ``region`` constructor argument" model. This means this driver now + follows the same approach as other multi region drivers. + + Before: + + .. sourcecode:: python + + from libcloud.storage.types import Provider + from libcloud.storage.providers import get_driver + + S3_EU_CENTRAL = get_driver(Provider.S3_EU_CENTRAL) + S3_EU_WEST_1 = get_driver(Provider.S3_EU_WEST) + + driver_eu_central = S3_EU_CENTRAL('api key', 'api secret') + driver_eu_west_1 = S3_EU_WEST_1('api key', 'api secret') + + After: + + .. sourcecode:: python + + from libcloud.storage.types import Provider + from libcloud.storage.providers import get_driver + + S3 = get_driver(Provider.S3) + + driver_eu_central = S3('api key', 'api secret', region='eu-central-1') + driver_eu_west_1 = S3('api key', 'api secret', region='eu-west-1') + + For now, old approach will still work, but it will be deprecated and fully + removed in a future release. Deprecation and removal will be announced well in + advance. + +- New ``start_node`` and ``stop_node`` methods have been added to the base + Libcloud compute API NodeDriver class. + + A lot of the existing compute drivers already implemented that functionality + via extension methods (``ex_start_node``, ``ex_stop_node``) so it was decided + to promote those methods to be part of the standard Libcloud compute API and + update all the affected drivers. + + For backward compatibility reasons, existing ``ex_start`` and ``ex_stop_node`` + methods will still work until a next major release. + + If you are relying on code which uses ``ex_start`` and ``ex_stop_node`` + methods, you are encouraged to update it to utilize new ``start_node`` and + ``stop_node`` methods since those ``ex_`` methods are now deprecated and will + be removed in a future major release. + +Libcloud 1.0.0 +-------------- + +* Per-region provider constants and related driver classes which have been + deprecated in Libcloud 0.14.0 have now been fully removed. + + Those provider drivers have moved to the single provider constant + + ``region`` constructor argument in Libcloud 0.14.0. + +Libcloud 0.20.0 +--------------- + +* New optional ``ttl`` argument has been added to ``libcloud.dns.base.Record`` + class constructor before the existing ``extra`` argument. + + If you have previously manually instantiated this class and didn't use + keyword arguments, you need to update your code to correctly pass arguments + to the constructor (you are encouraged to use keyword arguments to avoid such + issues in the future). + +* All NodeState, StorageVolumeState, VolumeSnapshotState and Provider attributes + are now strings instead of integers. + + If you are using the ``tostring`` and ``fromstring`` methods of NodeState, + you are fine. If you are using NodeState.RUNNING and the like, you are also fine. + + However, if you have previously depended on these being integers, + you need to update your code to depend on strings. You should consider starting + using the ``tostring`` and ``fromstring`` methods as the output of these functions + will not change in future versions, while the implementation might. + +Libcloud 0.19.0 +--------------- * The base signature of NodeDriver.create_volume has changed. The snapshot argument is now expected to be a VolumeSnapshot instead of a string. @@ -38,12 +474,12 @@ Changes in the OpenStack authentication and service catalog classes .. note:: If you are only working with the driver classes and have never dorectly - touched the classes mentioned bellow, then you aren't affected and those + touched the classes mentioned below, then you aren't affected and those changes are fully backward compatible. To make OpenStack authentication and identity related classes more extensible, easier to main and easier to use, those classes have been refactored. All of -the changes are described bellow. +the changes are described below. * New ``libcloud.common.openstack_identity`` module has been added. This module contains code for working with OpenStack Identity (Keystone) service. @@ -95,7 +531,7 @@ this version is move away from the old "one class per region" model to a new single class plus ``region`` argument model. More information on how this affects existing drivers and your code can be -found bellow. +found below. Default Content-Type is now provided if none is supplied and none can be guessed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -316,7 +752,7 @@ value: * ``RACKSPACE_AU`` -> ``syd`` More examples which show how to update your code to work with a new version can -be found bellow. +be found below. Old code (connecting to a first-gen provider): @@ -375,7 +811,7 @@ CloudStack compute driver changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CloudStack driver received a lot of changes and additions which will make it -more pleasant to use. Backward incompatible changes are listed bellow: +more pleasant to use. Backward incompatible changes are listed below: * ``CloudStackForwardingRule`` class has been renamed to ``CloudStackIPForwardingRule`` @@ -740,7 +1176,7 @@ Libcloud 0.8 instance. For a full list of changes, please see the `CHANGES file -`__. +`__. Libcloud 0.7 ------------ @@ -774,7 +1210,7 @@ Updated code: code you need to do it now, otherwise it won't work with 0.7 and future releases. -Bellow is a list of old paths and their new locations: +Below is a list of old paths and their new locations: * ``libcloud.base`` -> ``libcloud.compute.base`` * ``libcloud.deployment`` -> ``libcloud.compute.deployment`` @@ -787,7 +1223,7 @@ In the ``contrib/`` directory you can also find a simple bash script which can perform a search and replace for you - `migrate_paths.py `_. For a full list of changes, please see the `CHANGES file -`__. +`__. Libcloud 0.6 ------------ diff --git a/example_compute.py b/example_compute.py index 346e7d4684..5b93d6372b 100644 --- a/example_compute.py +++ b/example_compute.py @@ -13,23 +13,31 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Type, cast + from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver +from libcloud.compute.drivers.ec2 import EC2NodeDriver +from libcloud.compute.drivers.rackspace import RackspaceNodeDriver EC2 = get_driver(Provider.EC2) Rackspace = get_driver(Provider.RACKSPACE) -drivers = [EC2('access key id', 'secret key', region='us-east-1'), - Rackspace('username', 'api key', region='iad')] +drivers = [ + EC2("access key id", "secret key", region="us-east-1"), + Rackspace("username", "api key", region="iad"), +] -nodes = [driver.list_nodes() for driver in drivers] +nodes = [] +for driver in drivers: + nodes.extend(driver.list_nodes()) print(nodes) # [ , # , ... ] # grab the node named "test" -node = [n for n in nodes if n.name == 'test'][0] +node = [n for n in nodes if n.name == "test"][0] # reboot "test" node.reboot() diff --git a/example_container.py b/example_container.py new file mode 100644 index 0000000000..6b1476a288 --- /dev/null +++ b/example_container.py @@ -0,0 +1,28 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.container.types import Provider +from libcloud.container.providers import get_driver + +cls = get_driver(Provider.KUBERNETES) + +# You can retrieve cluster ip by running "minikube ip" command +conn = cls(key="my_token", host="126.32.21.4", ex_token_bearer_auth=True) + +for cluster in conn.list_clusters(): + print(cluster.name) + +for container in conn.list_containers(): + print(container.name) diff --git a/example_dns.py b/example_dns.py index b99756be01..918b14d602 100644 --- a/example_dns.py +++ b/example_dns.py @@ -20,7 +20,7 @@ Zerigo = get_driver(Provider.ZERIGO) -driver = Zerigo('email', 'key') +driver = Zerigo("email", "key") zones = driver.list_zones() pprint(zones) diff --git a/example_loadbalancer.py b/example_loadbalancer.py index d47a0febcf..a4bfe45adb 100644 --- a/example_loadbalancer.py +++ b/example_loadbalancer.py @@ -19,13 +19,13 @@ import time from libcloud.loadbalancer.base import Member, Algorithm -from libcloud.loadbalancer.types import Provider, State +from libcloud.loadbalancer.types import State, Provider from libcloud.loadbalancer.providers import get_driver def main(): cls = get_driver(Provider.RACKSPACE) - driver = cls('username', 'api key', region='ord') + driver = cls("username", "api key", region="ord") balancers = driver.list_balancers() @@ -34,14 +34,15 @@ def main(): # creating a balancer which balances traffic across two # nodes: 192.168.86.1:80 and 192.168.86.2:8080. Balancer # itself listens on port 80/tcp - new_balancer_name = 'testlb' + os.urandom(4).encode('hex') - members = (Member(None, '192.168.86.1', 80), - Member(None, '192.168.86.2', 8080)) - new_balancer = driver.create_balancer(name=new_balancer_name, - algorithm=Algorithm.ROUND_ROBIN, - port=80, - protocol='http', - members=members) + new_balancer_name = "testlb" + os.urandom(4).encode("hex") + members = (Member(None, "192.168.86.1", 80), Member(None, "192.168.86.2", 8080)) + new_balancer = driver.create_balancer( + name=new_balancer_name, + algorithm=Algorithm.ROUND_ROBIN, + port=80, + protocol="http", + members=members, + ) print(new_balancer) @@ -54,7 +55,7 @@ def main(): if balancer.state == State.RUNNING: break - print('sleeping for 30 seconds for balancers to become ready') + print("sleeping for 30 seconds for balancers to become ready") time.sleep(30) # fetch list of members @@ -67,5 +68,6 @@ def main(): # remove the balancer driver.destroy_balancer(new_balancer) -if __name__ == '__main__': + +if __name__ == "__main__": main() diff --git a/example_storage.py b/example_storage.py index be3058c9e1..05e9cca23a 100644 --- a/example_storage.py +++ b/example_storage.py @@ -20,7 +20,7 @@ CloudFiles = get_driver(Provider.CLOUDFILES) -driver = CloudFiles('access key id', 'secret key', region='ord') +driver = CloudFiles("access key id", "secret key", region="ord") containers = driver.list_containers() container_objects = driver.list_container_objects(containers[0]) diff --git a/integration/__init__.py b/integration/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/compute/README.rst b/integration/compute/README.rst new file mode 100644 index 0000000000..0dbd209f97 --- /dev/null +++ b/integration/compute/README.rst @@ -0,0 +1,19 @@ +Compute Integration Test Module +=============================== + +This test suite is for running a live API endpoint and testing the apache-libcloud compute functionality as a full integration test + +Running the API service +----------------------- + +.. code-block:: bash + + uv sync --group integration-compute + python -m integration.compute.api + +Running the tests +----------------- + +.. code-block:: bash + + python -m integration.compute diff --git a/integration/compute/__init__.py b/integration/compute/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/compute/__main__.py b/integration/compute/__main__.py new file mode 100644 index 0000000000..a307328896 --- /dev/null +++ b/integration/compute/__main__.py @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest + +from integration.compute.api.data import NODES, REPORT_DATA +from integration.compute.driver.test import TestNodeDriver + + +class IntegrationTest(unittest.TestCase): + def setUp(self): + self.instance = TestNodeDriver( + "apache", "libcloud", secure=False, host="localhost", port=9898 + ) + + def test_nodes(self): + """ + Test that you can list nodes and that the responding objects + match basic values, list (ip), and dict (extra). + """ + nodes = self.instance.list_nodes() + for node in NODES: + match = [n for n in nodes if n.id == node["id"]] + self.assertTrue(len(match) == 1) + match = match[0] + self.assertEqual(match.id, node["id"]) + self.assertEqual(match.name, node["name"]) + self.assertEqual(match.private_ips, node["private_ips"]) + self.assertEqual(match.public_ips, node["public_ips"]) + self.assertEqual(match.extra, node["extra"]) + + def test_ex_report_data(self): + """ + Test that a raw request can correctly return the data + """ + data = self.instance.ex_report_data() + self.assertEqual(data, REPORT_DATA) + + +if __name__ == "__main__": + import libcloud + + with open("/tmp/testing.log", "w") as f: + libcloud.enable_debug(f) + sys.exit(unittest.main()) diff --git a/integration/compute/api/__init__.py b/integration/compute/api/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/compute/api/__main__.py b/integration/compute/api/__main__.py new file mode 100644 index 0000000000..d215c50ae5 --- /dev/null +++ b/integration/compute/api/__main__.py @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from bottle import run + +import integration.api.routes # noqa + +if __name__ == "__main__": + run(host="localhost", port=9898) diff --git a/integration/compute/api/data.py b/integration/compute/api/data.py new file mode 100644 index 0000000000..459677cf92 --- /dev/null +++ b/integration/compute/api/data.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +NODES = [ + { + "id": "1234a", + "name": "test-1", + "state": "RUNNING", + "public_ips": ["4.4.4.4", "8.8.8.8"], + "private_ips": ["10.0.0.1", "192.168.1.1"], + "size": "test-size-1", + "created_at": "2017-01-09T05:25:12+00:00", + "image": "test-image-1", + "extra": {"test-key": "test-value"}, + }, + { + "id": "4567a", + "name": "test-2", + "state": "RUNNING", + "public_ips": ["4.4.4.5", "8.8.8.8"], + "private_ips": ["10.0.0.2", "192.168.1.1"], + "size": "test-size-1", + "created_at": "2017-01-09T05:25:12+00:00", + "image": "test-image-1", + "extra": {"test-key": "test-value"}, + }, +] + +REPORT_DATA = "Around the ragged rocks, the ragged rascal ran. \r\n" diff --git a/integration/compute/api/routes.py b/integration/compute/api/routes.py new file mode 100644 index 0000000000..2f9d264262 --- /dev/null +++ b/integration/compute/api/routes.py @@ -0,0 +1,33 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json + +from bottle import route + +from integration.compute.api.data import NODES, REPORT_DATA +from integration.compute.api.util import secure + + +@route("/compute/nodes", method="GET") +@secure +def list_nodes(): + return json.dumps(NODES) + + +@route("/compute/report_data", method="GET") +@secure +def ex_report_data(): + return REPORT_DATA diff --git a/integration/compute/api/util.py b/integration/compute/api/util.py new file mode 100644 index 0000000000..0fbdd58aa4 --- /dev/null +++ b/integration/compute/api/util.py @@ -0,0 +1,35 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from functools import wraps + +from bottle import request + +from integration.compute.config import EXPECTED_AUTH + + +def secure(f): + @wraps(f) + def secure_route(*args, **kwargs): + if "Authorization" not in request.headers: + raise Exception("Argghhhh") + else: + auth = request.headers["Authorization"] + + if auth != EXPECTED_AUTH: + raise Exception("Bad authentication") + return f(*args, **kwargs) + + return secure_route diff --git a/integration/compute/config.py b/integration/compute/config.py new file mode 100644 index 0000000000..16584c69f4 --- /dev/null +++ b/integration/compute/config.py @@ -0,0 +1,22 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import base64 + +from libcloud.utils.py3 import b + +API_AUTH = ("apache", "libcloud") + +EXPECTED_AUTH = "Basic %s" % (base64.b64encode(b("%s:%s" % API_AUTH))) diff --git a/integration/compute/driver/__init__.py b/integration/compute/driver/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/compute/driver/test.py b/integration/compute/driver/test.py new file mode 100644 index 0000000000..2a1db01973 --- /dev/null +++ b/integration/compute/driver/test.py @@ -0,0 +1,84 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import base64 + +from libcloud.utils.py3 import b +from libcloud.common.base import JsonResponse, ConnectionUserAndKey +from libcloud.compute.base import Node, NodeDriver + + +class TestResponseType(JsonResponse): + pass + + +class TestConnection(ConnectionUserAndKey): + host = "localhost" + secure = True + responseCls = TestResponseType + + allow_insecure = True + + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + api_version=None, + **conn_kwargs, + ): + super().__init__( + user_id=user_id, + key=key, + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + proxy_url=proxy_url, + ) + + def add_default_headers(self, headers): + user_b64 = base64.b64encode(b("{}:{}".format(self.user_id, self.key))) + headers["Authorization"] = "Basic %s" % (user_b64) + return headers + + +class TestNodeDriver(NodeDriver): + connectionCls = TestConnection + type = "testing" + api_name = "testing" + name = "Test Compute Driver" + website = "http://libcloud.apache.org" + features = {"create_node": ["ssh_key", "password"]} + + def __init__(self, key, secret=None, secure=True, host=None, port=None, **kwargs): + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port, **kwargs) + + def list_nodes(self): + r = self.connection.request("/compute/nodes") + nodes = [] + for node in r.object: + nodes.append(Node(driver=self, **node)) + return nodes + + def ex_report_data(self): + r = self.connection.request("/compute/report_data", raw=True) + return r.response.read() diff --git a/integration/storage/README.rst b/integration/storage/README.rst new file mode 100644 index 0000000000..b80fc8a4bb --- /dev/null +++ b/integration/storage/README.rst @@ -0,0 +1,18 @@ +Storage Integration Test Module +=============================== + +This test suite is for validating the apache-libcloud storage functionality against live storage backends. + +Setting up the test suite +------------------------- + +.. code-block:: bash + + uv sync --group integration-storage + +Running the tests +----------------- + +.. code-block:: bash + + python -m integration.storage diff --git a/integration/storage/__init__.py b/integration/storage/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/storage/__main__.py b/integration/storage/__main__.py new file mode 100644 index 0000000000..64e2668a54 --- /dev/null +++ b/integration/storage/__main__.py @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import sys +import unittest + +if __name__ == "__main__": + loader = unittest.TestLoader() + tests = loader.discover(os.path.dirname(__file__)) + runner = unittest.runner.TextTestRunner(verbosity=3) + result = runner.run(tests) + sys.exit(len(result.errors)) diff --git a/integration/storage/base.py b/integration/storage/base.py new file mode 100644 index 0000000000..5bf334f219 --- /dev/null +++ b/integration/storage/base.py @@ -0,0 +1,452 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import io +import os +import re +import sys +import gzip +import time +import atexit +import random +import socket +import string +import tempfile +import unittest + +import requests + +import libcloud.http +from libcloud.storage import types, providers +from libcloud.common.types import LibcloudError + +try: + import docker +except ImportError: + docker = None + + +libcloud.http.DEFAULT_REQUEST_TIMEOUT = 10 + + +MB = 1024 * 1024 + + +def get_content_iter_with_chunk_size(content, chunk_size=1024): + """ + Return iterator for the provided content which will return chunks of the specified size. + + For performance reasons, larger chunks should be used with very large content to speed up the + tests (since in some cases each iteration may result in an TCP send). + """ + # Ensure we still use multiple chunks and iterations + assert (len(content) / chunk_size) >= 10 + content = iter([content[i : i + chunk_size] for i in range(0, len(content), chunk_size)]) + return content + + +class Integration: + class TestBase(unittest.TestCase): + provider = None + account = None + secret = None + + container_name_prefix = "lcsit" + container_name_max_length = 63 + + def setUp(self): + for required in "provider", "account", "secret": + value = getattr(self, required, None) + if value is None: + raise unittest.SkipTest("config {} not set".format(required)) + + kwargs = {"key": self.account, "secret": self.secret} + + for optional in "host", "port", "secure": + value = getattr(self, optional, None) + if value is not None: + kwargs[optional] = value + + driver_class = providers.get_driver(self.provider) + self.driver = driver_class(**kwargs) + + def tearDown(self): + for container in self.driver.list_containers(): + if not container.name.startswith(self.container_name_prefix): + continue + + for obj in container.list_objects(): + try: + obj.delete() + except LibcloudError as ex: + print( + "Unable to delete object {} in container {}: {}." + "Delete it manually.".format(obj.name, container.name, ex), + file=sys.stderr, + ) + + try: + container.delete() + except LibcloudError as ex: + print( + "Unable to delete container {}: {}." + "Delete it manually.".format(container.name, ex), + file=sys.stderr, + ) + + def test_containers(self): + # make a new container + container_name = self._random_container_name() + container = self.driver.create_container(container_name) + self.assertEqual(container.name, container_name) + container = self.driver.get_container(container_name) + self.assertEqual(container.name, container_name) + + self.assert_existing_container_cannot_be_recreated(container) + + # check that the new container can be listed + containers = self.driver.list_containers() + self.assertIn(container_name, [c.name for c in containers]) + + # delete the container + self.driver.delete_container(container) + + # check that a deleted container can't be looked up + with self.assertRaises(types.ContainerDoesNotExistError): + self.driver.get_container(container_name) + + # check that the container is deleted + containers = self.driver.list_containers() + self.assertNotIn(container_name, [c.name for c in containers]) + + def _test_objects(self, do_upload, do_download, size=1 * MB): + content = os.urandom(size) + blob_name = "testblob" + container = self.driver.create_container(self._random_container_name()) + + # upload a file + obj = do_upload(container, blob_name, content) + self.assertEqual(obj.name, blob_name) + obj = self.driver.get_object(container.name, blob_name) + + # check that the file can be listed + blobs = self.driver.list_container_objects(container) + self.assertEqual([blob.name for blob in blobs], [blob_name]) + + # upload another file and check it's excluded in prefix listing + do_upload(container, blob_name[::-1], content[::-1]) + blobs = self.driver.list_container_objects(container, prefix=blob_name[0:3]) + self.assertEqual([blob.name for blob in blobs], [blob_name]) + + # check that the file can be read back + downloaded_content = do_download(obj) + self.assertEqual(len(downloaded_content), size) + self.assertEqual(downloaded_content, content) + + # delete the file + self.driver.delete_object(obj) + + # check that a missing file can't be deleted or looked up + self.assert_file_is_missing(container, obj) + + # check that the file is deleted + blobs = self.driver.list_container_objects(container) + self.assertEqual([blob.name for blob in blobs], [blob_name[::-1]]) + + def assert_existing_container_cannot_be_recreated(self, container): + with self.assertRaises(types.ContainerAlreadyExistsError): + self.driver.create_container(container.name) + + def assert_file_is_missing(self, container, obj): + with self.assertRaises(types.ObjectDoesNotExistError): + self.driver.delete_object(obj) + with self.assertRaises(types.ObjectDoesNotExistError): + self.driver.get_object(container.name, obj.name) + + def test_objects(self, size=1 * MB): + def do_upload(container, blob_name, content): + infile = self._create_tempfile(content=content) + return self.driver.upload_object(infile, container, blob_name) + + def do_download(obj): + outfile = self._create_tempfile() + self.driver.download_object(obj, outfile, overwrite_existing=True) + with open(outfile, "rb") as fobj: + return fobj.read() + + self._test_objects(do_upload, do_download, size) + + def test_objects_range_downloads(self): + blob_name = "testblob-range" + content = b"0123456789" + container = self.driver.create_container(self._random_container_name()) + + obj = self.driver.upload_object( + self._create_tempfile(content=content), container, blob_name + ) + self.assertEqual(obj.name, blob_name) + self.assertEqual(obj.size, len(content)) + + obj = self.driver.get_object(container.name, blob_name) + self.assertEqual(obj.name, blob_name) + self.assertEqual(obj.size, len(content)) + + values = [ + {"start_bytes": 0, "end_bytes": 1, "expected_content": b"0"}, + {"start_bytes": 1, "end_bytes": 5, "expected_content": b"1234"}, + {"start_bytes": 5, "end_bytes": None, "expected_content": b"56789"}, + {"start_bytes": 5, "end_bytes": len(content), "expected_content": b"56789"}, + {"start_bytes": 0, "end_bytes": None, "expected_content": b"0123456789"}, + {"start_bytes": 0, "end_bytes": len(content), "expected_content": b"0123456789"}, + ] + + for value in values: + # 1. download_object_range + start_bytes = value["start_bytes"] + end_bytes = value["end_bytes"] + outfile = self._create_tempfile() + + result = self.driver.download_object_range( + obj, + outfile, + start_bytes=start_bytes, + end_bytes=end_bytes, + overwrite_existing=True, + ) + self.assertTrue(result) + + with open(outfile, "rb") as fobj: + downloaded_content = fobj.read() + + if end_bytes is not None: + expected_content = content[start_bytes:end_bytes] + else: + expected_content = content[start_bytes:] + + msg = 'Expected "{}", got "{}" for values: {}'.format( + expected_content, + downloaded_content, + str(value), + ) + self.assertEqual(downloaded_content, expected_content, msg) + self.assertEqual(downloaded_content, value["expected_content"], msg) + + # 2. download_object_range_as_stream + downloaded_content = read_stream( + self.driver.download_object_range_as_stream( + obj, start_bytes=start_bytes, end_bytes=end_bytes + ) + ) + self.assertEqual(downloaded_content, expected_content) + + @unittest.skipUnless(os.getenv("LARGE_FILE_SIZE_MB"), "config not set") + def test_objects_large(self): + size = int(float(os.environ["LARGE_FILE_SIZE_MB"]) * MB) + self.test_objects(size) + + def test_objects_stream_io(self): + def do_upload(container, blob_name, content): + content = io.BytesIO(content) + return self.driver.upload_object_via_stream(content, container, blob_name) + + def do_download(obj): + return read_stream(self.driver.download_object_as_stream(obj)) + + self._test_objects(do_upload, do_download) + + def test_objects_stream_iterable(self): + def do_upload(container, blob_name, content): + # NOTE: We originally used a chunk size of 1 which resulted in many requests and as + # such, very slow tests. To speed things up, we use a longer chunk size. + assert (len(content) / 1024) >= 500 + content = get_content_iter_with_chunk_size(content, 1024) + return self.driver.upload_object_via_stream(content, container, blob_name) + + def do_download(obj): + return read_stream(self.driver.download_object_as_stream(obj)) + + self._test_objects(do_upload, do_download) + + def test_upload_via_stream_with_content_encoding(self): + object_name = "content_encoding.gz" + content = gzip.compress(os.urandom(MB // 100)) + container = self.driver.create_container(self._random_container_name()) + self.driver.upload_object_via_stream( + get_content_iter_with_chunk_size(content, 1000), + container, + object_name, + headers={"Content-Encoding": "gzip"}, + ) + + obj = self.driver.get_object(container.name, object_name) + + self.assertEqual(obj.extra.get("content_encoding"), "gzip") + + def test_cdn_url(self): + content = os.urandom(MB // 100) + container = self.driver.create_container(self._random_container_name()) + content_iter = get_content_iter_with_chunk_size(content, 1000) + obj = self.driver.upload_object_via_stream(content_iter, container, "cdn") + + response = requests.get(self.driver.get_object_cdn_url(obj)) + response.raise_for_status() + + self.assertEqual(response.content, content) + + def _create_tempfile(self, prefix="", content=b""): + fobj, path = tempfile.mkstemp(prefix=prefix, text=False) + + try: + os.write(fobj, content) + finally: + os.close(fobj) + + self.addCleanup(os.remove, path) + return path + + @classmethod + def _random_container_name(cls): + suffix = random_string(cls.container_name_max_length) + name = cls.container_name_prefix + suffix + name = re.sub("[^a-z0-9-]", "-", name) + name = re.sub("-+", "-", name) + name = name[: cls.container_name_max_length] + name = name.lower() + return name + + class ContainerTestBase(TestBase): + image = None + version = "latest" + environment = {} + command = None + ready_message = None + + host = "localhost" + port = None + secure = False + + client = None + container = None + verbose = False + + container_ready_timeout = 20 + + @classmethod + def setUpClass(cls): + if docker is None: + raise unittest.SkipTest("missing docker library") + + try: + cls.client = docker.from_env() + except docker.errors.DockerException: + raise unittest.SkipTest("unable to create docker client") + + for required in "image", "port": + value = getattr(cls, required, None) + if value is None: + raise unittest.SkipTest("config {} not set".format(required)) + + cls.container = cls.client.containers.run( + "{}:{}".format(cls.image, cls.version), + command=cls.command, + detach=True, + auto_remove=True, + ports={cls.port: cls.port}, + environment=cls.environment, + ) + + # We register atexit handler to ensure container is always killed, even if for some + # reason tearDownClass is sometimes not called (happened locally a couple of times) + atexit.register(cls._kill_container) + + wait_for(cls.port, cls.host) + + container_ready = cls.ready_message is None + + start_ts = int(time.time()) + timeout_ts = start_ts + cls.container_ready_timeout + + while not container_ready: + time.sleep(1) + + container_ready = any( + cls.ready_message in line for line in cls.container.logs().splitlines() + ) + + now_ts = int(time.time()) + + if now_ts >= timeout_ts: + raise ValueError( + "Container %s failed to start and become ready in %s seconds " + '(did not find "%s" message in container logs).\n\n' + "Container Logs:\n%s" + % ( + cls.container.short_id, + cls.container_ready_timeout, + cls.ready_message.decode("utf-8"), + cls.container.logs().decode("utf-8"), + ) + ) + + @classmethod + def tearDownClass(cls): + cls._kill_container() + atexit.unregister(cls._kill_container) + + @classmethod + def _kill_container(cls): + if cls.verbose: + print("Killing / stopping container with id %s..." % (cls.container.short_id)) + + if cls.verbose: + for line in cls.container.logs().splitlines(): + print(line) + + try: + cls.container.kill() + except docker.errors.DockerException as ex: + print( + "Unable to terminate docker container {}: {}." + "Stop it manually.".format(cls.container.short_id, ex), + file=sys.stderr, + ) + + +def wait_for(port, host="localhost", timeout=10): + start_time = time.perf_counter() + + while True: + try: + with socket.create_connection((host, port), timeout=timeout): + break + except OSError as ex: + if time.perf_counter() - start_time >= timeout: + raise TimeoutError( + "Waited too long for the port {} on host {} to start accepting " + "connections.".format(port, host) + ) from ex + + time.sleep(1) + + +def random_string(length, alphabet=string.ascii_lowercase + string.digits): + return "".join(random.choice(alphabet) for _ in range(length)) + + +def read_stream(stream): + buffer = io.BytesIO() + buffer.writelines(stream) + buffer.seek(0) + return buffer.read() diff --git a/integration/storage/test_azure_blobs.py b/integration/storage/test_azure_blobs.py new file mode 100644 index 0000000000..ddea64b6b4 --- /dev/null +++ b/integration/storage/test_azure_blobs.py @@ -0,0 +1,212 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the 'License'); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an 'AS IS' BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import sys +import time +import base64 +import string +import datetime +import unittest + +from integration.storage.base import Integration, random_string + +try: + from azure import identity + from azure.mgmt import storage, resource + from azure.mgmt.storage import models as storage_models + from azure.mgmt.resource.resources import models as resource_models +except ImportError as e: + print("Failed to import from azure module: %s" % (str(e))) + identity = resource = storage = resource_models = storage_models = None + + +# Prefix which is added to all the groups created by tests +RESOURCE_GROUP_NAME_PREFIX = "libclouditests" +DEFAULT_TIMEOUT_SECONDS = 300 +DEFAULT_AZURE_LOCATION = "EastUS2" +MAX_STORAGE_ACCOUNT_NAME_LENGTH = 24 + + +class AzuriteStorageTest(Integration.ContainerTestBase): + provider = "azure_blobs" + + account = "devstoreaccount1" + secret = ( + "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" + ) + + image = "arafato/azurite" + port = 10000 + environment = {"executable": "blob"} + ready_message = b"Azure Blob Storage Emulator listening" + + has_sas_support = False + + def test_cdn_url(self): + if not self.has_sas_support: + self.skipTest("Storage backend has no account SAS support") + + +class AzuriteV3StorageTest(AzuriteStorageTest): + image = "mcr.microsoft.com/azure-storage/azurite" + ready_message = b"Azurite Blob service is successfully listening" + + has_sas_support = True + + def test_upload_via_stream_with_content_encoding(self): + self.skipTest("Possible bug in AzuriteV3, see https://github.com/Azure/Azurite/issues/629") + + +class IotedgeStorageTest(Integration.ContainerTestBase): + provider = "azure_blobs" + + account = random_string(10, string.ascii_lowercase) + secret = base64.b64encode(random_string(20).encode("ascii")).decode("ascii") + + image = "mcr.microsoft.com/azure-blob-storage" + port = 11002 + environment = {"LOCAL_STORAGE_ACCOUNT_NAME": account, "LOCAL_STORAGE_ACCOUNT_KEY": secret} + ready_message = b"BlobService - StartAsync completed" + + +class StorageTest(Integration.TestBase): + provider = "azure_blobs" + + kind = storage_models.Kind.STORAGE_V2 + access_tier = None # type: storage_models.AccessTier + + @classmethod + def setUpClass(cls): + if identity is None: + raise unittest.SkipTest("missing azure-identity library") + + if resource is None or resource_models is None: + raise unittest.SkipTest("missing azure-mgmt-resource library") + + if storage is None or storage_models is None: + raise unittest.SkipTest("missing azure-mgmt-storage library") + + config = { + key: os.getenv(key) + for key in ( + "AZURE_TENANT_ID", + "AZURE_SUBSCRIPTION_ID", + "AZURE_CLIENT_ID", + "AZURE_CLIENT_SECRET", + ) + } + + for key, value in config.items(): + if not value: + raise unittest.SkipTest("missing environment variable %s" % key) + + credentials = identity.ClientSecretCredential( + tenant_id=config["AZURE_TENANT_ID"], + client_id=config["AZURE_CLIENT_ID"], + client_secret=config["AZURE_CLIENT_SECRET"], + ) + + resource_client = resource.resources.ResourceManagementClient( + credentials, + config["AZURE_SUBSCRIPTION_ID"], + ) + + storage_client = storage.StorageManagementClient( + credentials, + config["AZURE_SUBSCRIPTION_ID"], + ) + + location = os.getenv("AZURE_LOCATION", DEFAULT_AZURE_LOCATION) + name = RESOURCE_GROUP_NAME_PREFIX + name += random_string(MAX_STORAGE_ACCOUNT_NAME_LENGTH - len(name)) + timeout = float(os.getenv("AZURE_TIMEOUT_SECONDS", DEFAULT_TIMEOUT_SECONDS)) + + # We clean up any left over resource groups from previous runs on setUpClass. If tests on + # CI get terminated non-gracefully, old resources will be left laying around and we want + # to clean those up to ensure we dont hit any limits. + # To avoid deleting groups from concurrent runs, we only delete resources older than a + # couple (6) of hours + print("Checking and cleaning up any old stray resource groups...") + + resource_groups = resource_client.resource_groups.list() + now_ts = int(time.time()) + delete_threshold_ts = now_ts - int(datetime.timedelta(hours=6).total_seconds()) + + for resource_group in resource_groups: + # NOTE (Tomaz): It looks like that for some reason .tags property is sometimes None + # We simply skip those. Could be resources created outside the tests + if not resource_group.tags: + continue + + resource_create_ts = int(resource_group.tags.get("create_ts", now_ts)) + + if ( + resource_group.name.startswith(RESOURCE_GROUP_NAME_PREFIX) + and resource_group.location.lower() == location.lower() + and "test" in resource_group.tags + and resource_create_ts <= delete_threshold_ts + ): + assert resource_group.name.startswith(RESOURCE_GROUP_NAME_PREFIX) + print("Deleting old stray resource group: %s..." % (resource_group.name)) + + try: + resource_client.resource_groups.begin_delete(resource_group.name) + except Exception as e: + print("Failed to delete resource group: %s" % (str(e)), file=sys.stderr) + + group = resource_client.resource_groups.create_or_update( + resource_group_name=name, + parameters=resource_models.ResourceGroup( + location=location, + tags={ + "test": cls.__name__, + "create_ts": str(now_ts), + "gh_run_id": os.getenv("GITHUB_RUN_ID", "unknown"), + "gh_job_id": os.getenv("GITHUB_JOB_ID", "unknown"), + "gh_sha": os.getenv("GITHUB_SHA", "unknown"), + "gh_ref": os.getenv("GITHUB_REF", "unknown"), + }, + ), + timeout=timeout, + ) + + cls.addClassCleanup( + lambda: resource_client.resource_groups.begin_delete(group.name).result(timeout) + ) + + account = storage_client.storage_accounts.begin_create( + resource_group_name=group.name, + account_name=name, + parameters=storage_models.StorageAccountCreateParameters( + sku=storage_models.Sku(name=storage_models.SkuName.STANDARD_LRS), + access_tier=cls.access_tier, + kind=cls.kind, + location=location, + ), + ).result(timeout) + + keys = storage_client.storage_accounts.list_keys( + resource_group_name=group.name, + account_name=account.name, + timeout=timeout, + ) + + cls.account = account.name + cls.secret = keys["keys"][0]["value"] + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/integration/storage/test_minio.py b/integration/storage/test_minio.py new file mode 100644 index 0000000000..78602662f9 --- /dev/null +++ b/integration/storage/test_minio.py @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the 'License'); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an 'AS IS' BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest + +from libcloud.storage import types +from integration.storage.base import Integration + + +class MinioTest(Integration.ContainerTestBase): + provider = "minio" + + account = "minioaccount" + secret = "miniopassword" + + image = "pgsty/silo" + port = 9000 + environment = {"MINIO_ROOT_USER": account, "MINIO_ROOT_PASSWORD": secret} + command = ["server", "/data"] + # Output seemed to have changed recently, see + # https://github.com/apache/libcloud/runs/7481114211?check_suite_focus=true + # ready_message = b'Console endpoint is listening on a dynamic port' + # ready_message = b"1 Online" + ready_message = b"Silo Object Storage Server" + + def test_cdn_url(self): + self.skipTest("Not implemented in driver") + + def assert_file_is_missing(self, container, obj): + with self.assertRaises(types.ObjectDoesNotExistError): + self.driver.get_object(container.name, obj.name) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/integration/storage/test_s3.py b/integration/storage/test_s3.py new file mode 100644 index 0000000000..3a2b1197ef --- /dev/null +++ b/integration/storage/test_s3.py @@ -0,0 +1,78 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the 'License'); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an 'AS IS' BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import os +import sys +import unittest + +from libcloud.storage import types +from integration.storage.base import Integration + +try: + import boto3 +except ImportError: + boto3 = None + + +class S3Test(Integration.TestBase): + provider = "s3" + + @classmethod + def setUpClass(cls): + if boto3 is None: + raise unittest.SkipTest("missing boto3 library") + + config = { + key: os.getenv(key) + for key in ( + "AWS_ACCESS_KEY_ID", + "AWS_ACCESS_KEY_SECRET", + ) + } + + for key, value in config.items(): + if not value: + raise unittest.SkipTest("missing environment variable %s" % key) + + cls.account = config["AWS_ACCESS_KEY_ID"] + cls.secret = config["AWS_ACCESS_KEY_SECRET"] + + @classmethod + def tearDownClass(cls): + client = boto3.Session( + aws_access_key_id=cls.account, + aws_secret_access_key=cls.secret, + ).client("s3") + + buckets = ( + item["Name"] + for item in client.list_buckets()["Buckets"] + if item["Name"].startswith(cls.container_name_prefix) + ) + + for name in buckets: + bucket = boto3.resource("s3").Bucket(name) + bucket.objects.delete() + client.delete_bucket(name) + + def assert_existing_container_cannot_be_recreated(self, container): + pass + + def assert_file_is_missing(self, container, obj): + with self.assertRaises(types.ObjectDoesNotExistError): + self.driver.get_object(container.name, obj.name) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/__init__.py b/libcloud/__init__.py index 0e8c950e5d..ba9be95dcf 100644 --- a/libcloud/__init__.py +++ b/libcloud/__init__.py @@ -19,17 +19,27 @@ :var __version__: Current version of libcloud """ -__all__ = ['__version__', 'enable_debug'] -__version__ = '0.17.1-dev' - import os +import atexit import codecs +from libcloud.base import DriverType # NOQA +from libcloud.base import DriverTypeFactoryMap # NOQA +from libcloud.base import get_driver # NOQA + try: - import paramiko - have_paramiko = True + # TODO: This import is slow and adds overhead in situations when no + # requests are made but it's necessary for detecting bad version of + # requests + import requests # NOQA + + have_requests = True except ImportError: - have_paramiko = False + have_requests = False + +__all__ = ["__version__", "enable_debug"] + +__version__ = "4.0.0.dev0" def enable_debug(fo): @@ -39,13 +49,33 @@ def enable_debug(fo): :param fo: Where to append debugging information :type fo: File like object, only write operations are used. """ - from libcloud.common.base import (Connection, - LoggingHTTPConnection, - LoggingHTTPSConnection) - LoggingHTTPSConnection.log = fo - LoggingHTTPConnection.log = fo - Connection.conn_classes = (LoggingHTTPConnection, - LoggingHTTPSConnection) + from libcloud.common.base import Connection + from libcloud.utils.loggingconnection import LoggingConnection + + LoggingConnection.log = fo + Connection.conn_class = LoggingConnection + + # Ensure the file handle is closed on exit + def close_file(fd): + try: + fd.close() + except Exception: + pass + + atexit.register(close_file, fo) + + +def reset_debug(): + """ + Reset debugging functionality (if set). + + NOTE: This function is only meant to be used in the tests. + """ + from libcloud.common.base import Connection, LibcloudConnection + from libcloud.utils.loggingconnection import LoggingConnection + + LoggingConnection.log = None + Connection.conn_class = LibcloudConnection def _init_once(): @@ -54,13 +84,57 @@ def _init_once(): This checks for the LIBCLOUD_DEBUG environment variable, which if it exists is where we will log debug information about the provider transports. + + This also checks for known environment/dependency incompatibilities. """ - path = os.getenv('LIBCLOUD_DEBUG') + path = os.getenv("LIBCLOUD_DEBUG") + if path: - fo = codecs.open(path, 'a', encoding='utf8') + mode = "a" + + # Special case for /dev/stderr and /dev/stdout on Python 3. + from libcloud.utils.py3 import PY3 + + # Opening those files in append mode will throw "illegal seek" + # exception there. + # Late import to avoid setup.py related side affects + if path in ["/dev/stderr", "/dev/stdout"] and PY3: + mode = "w" + + fo = codecs.open(path, mode, encoding="utf8") enable_debug(fo) - if have_paramiko: - paramiko.common.logging.basicConfig(level=paramiko.common.DEBUG) + # NOTE: We use lazy import to avoid unnecessary import time overhead + try: + import paramiko # NOQA + + have_paramiko = True + except ImportError: + have_paramiko = False + + if have_paramiko and hasattr(paramiko.util, "log_to_file"): + import logging + + # paramiko always tries to open file path in append mode which + # won't work with /dev/{stdout, stderr} so we just ignore those + # errors + try: + paramiko.util.log_to_file(filename=path, level=logging.DEBUG) + except OSError as e: + if "illegal seek" not in str(e).lower(): + raise e + + # check for broken `yum install python-requests` + if have_requests and requests.__version__ == "2.6.0": + chardet_version = requests.packages.chardet.__version__ + required_chardet_version = "2.3.0" + assert chardet_version == required_chardet_version, ( + "Known bad version of requests detected! This can happen when " + "requests was installed from a source other than PyPI, e.g. via " + "a package manager such as yum. Please either install requests " + "from PyPI or run `pip install chardet==%s` to resolve this " + "issue." % required_chardet_version + ) + _init_once() diff --git a/libcloud/backup/__init__.py b/libcloud/backup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/backup/base.py b/libcloud/backup/base.py new file mode 100644 index 0000000000..0a2975b569 --- /dev/null +++ b/libcloud/backup/base.py @@ -0,0 +1,472 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.common.base import BaseDriver, ConnectionUserAndKey +from libcloud.backup.types import BackupTargetType + +__all__ = [ + "BackupTarget", + "BackupDriver", + "BackupTargetJob", + "BackupTargetRecoveryPoint", +] + + +class BackupTarget: + """ + A backup target + """ + + def __init__(self, id, name, address, type, driver, extra=None): + """ + :param id: Target id + :type id: ``str`` + + :param name: Name of the target + :type name: ``str`` + + :param address: Hostname, FQDN, IP, file path etc. + :type address: ``str`` + + :param type: Backup target type (Physical, Virtual, ...). + :type type: :class:`.BackupTargetType` + + :param driver: BackupDriver instance. + :type driver: :class:`.BackupDriver` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + """ + self.id = str(id) if id else None + self.name = name + self.address = address + self.type = type + self.driver = driver + self.extra = extra or {} + + def update(self, name=None, address=None, extra=None): + return self.driver.update_target(target=self, name=name, address=address, extra=extra) + + def delete(self): + return self.driver.delete_target(target=self) + + def _get_numeric_id(self): + target_id = self.id + + if target_id.isdigit(): + target_id = int(target_id) + + return target_id + + def __repr__(self): + return "" % ( + self.id, + self.name, + self.address, + self.type, + self.driver.name, + ) + + +class BackupTargetJob: + """ + A backup target job + """ + + def __init__(self, id, status, progress, target, driver, extra=None): + """ + :param id: Job id + :type id: ``str`` + + :param status: Status of the job + :type status: :class:`BackupTargetJobStatusType` + + :param progress: Progress of the job, as a percentage + :type progress: ``int`` + + :param target: BackupTarget instance. + :type target: :class:`.BackupTarget` + + :param driver: BackupDriver instance. + :type driver: :class:`.BackupDriver` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + """ + self.id = str(id) if id else None + self.status = status + self.progress = progress + self.target = target + self.driver = driver + self.extra = extra or {} + + def cancel(self): + return self.driver.cancel_target_job(job=self) + + def suspend(self): + return self.driver.suspend_target_job(job=self) + + def resume(self): + return self.driver.resume_target_job(job=self) + + def __repr__(self): + return "" % ( + self.id, + self.status, + self.progress, + self.target.id, + self.driver.name, + ) + + +class BackupTargetRecoveryPoint: + """ + A backup target recovery point + """ + + def __init__(self, id, date, target, driver, extra=None): + """ + :param id: Job id + :type id: ``str`` + + :param date: The date taken + :type date: :class:`datetime.datetime` + + :param target: BackupTarget instance. + :type target: :class:`.BackupTarget` + + :param driver: BackupDriver instance. + :type driver: :class:`.BackupDriver` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + """ + self.id = str(id) if id else None + self.date = date + self.target = target + self.driver = driver + self.extra = extra or {} + + def recover(self, path=None): + """ + Recover this recovery point + + :param path: The part of the recovery point to recover (optional) + :type path: ``str`` + + :rtype: Instance of :class:`.BackupTargetJob` + """ + return self.driver.recover_target(target=self.target, recovery_point=self, path=path) + + def recover_to(self, recovery_target, path=None): + """ + Recover this recovery point out of place + + :param recovery_target: Backup target with to recover the data to + :type recovery_target: Instance of :class:`.BackupTarget` + + :param path: The part of the recovery point to recover (optional) + :type path: ``str`` + + :rtype: Instance of :class:`.BackupTargetJob` + """ + return self.driver.recover_target_out_of_place( + target=self.target, + recovery_point=self, + recovery_target=recovery_target, + path=path, + ) + + def __repr__(self): + return "" % ( + self.id, + self.date, + self.target.id, + self.driver.name, + ) + + +class BackupDriver(BaseDriver): + """ + A base BackupDriver class to derive from + + This class is always subclassed by a specific driver. + """ + + connectionCls = ConnectionUserAndKey + name = None + website = None + + def __init__(self, key, secret=None, secure=True, host=None, port=None, **kwargs): + """ + :param key: API key or username to used (required) + :type key: ``str`` + + :param secret: Secret password to be used (required) + :type secret: ``str`` + + :param secure: Whether to use HTTPS or HTTP. Note: Some providers + only support HTTPS, and it is on by default. + :type secure: ``bool`` + + :param host: Override hostname used for connections. + :type host: ``str`` + + :param port: Override port used for connections. + :type port: ``int`` + + :return: ``None`` + """ + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port, **kwargs) + + def get_supported_target_types(self): + """ + Get a list of backup target types this driver supports + + :return: ``list`` of :class:``BackupTargetType`` + """ + raise NotImplementedError("get_supported_target_types not implemented for this driver") + + def list_targets(self): + """ + List all backuptargets + + :rtype: ``list`` of :class:`.BackupTarget` + """ + raise NotImplementedError("list_targets not implemented for this driver") + + def create_target(self, name, address, type=BackupTargetType.VIRTUAL, extra=None): + """ + Creates a new backup target + + :param name: Name of the target + :type name: ``str`` + + :param address: Hostname, FQDN, IP, file path etc. + :type address: ``str`` + + :param type: Backup target type (Physical, Virtual, ...). + :type type: :class:`BackupTargetType` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`.BackupTarget` + """ + raise NotImplementedError("create_target not implemented for this driver") + + def create_target_from_node(self, node, type=BackupTargetType.VIRTUAL, extra=None): + """ + Creates a new backup target from an existing node. + By default, this will use the first public IP of the node + + :param node: The Node to backup + :type node: ``Node`` + + :param type: Backup target type (Physical, Virtual, ...). + :type type: :class:`BackupTargetType` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`.BackupTarget` + """ + return self.create_target(name=node.name, address=node.public_ips[0], type=type, extra=None) + + def create_target_from_storage_container( + self, container, type=BackupTargetType.OBJECT, extra=None + ): + """ + Creates a new backup target from an existing storage container + + :param node: The Container to backup + :type node: ``Container`` + + :param type: Backup target type (Physical, Virtual, ...). + :type type: :class:`BackupTargetType` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`.BackupTarget` + """ + return self.create_target( + name=container.name, address=container.get_cdn_url(), type=type, extra=None + ) + + def update_target(self, target, name, address, extra): + """ + Update the properties of a backup target + + :param target: Backup target to update + :type target: Instance of :class:`.BackupTarget` + + :param name: Name of the target + :type name: ``str`` + + :param address: Hostname, FQDN, IP, file path etc. + :type address: ``str`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`.BackupTarget` + """ + raise NotImplementedError("update_target not implemented for this driver") + + def delete_target(self, target): + """ + Delete a backup target + + :param target: Backup target to delete + :type target: Instance of :class:`.BackupTarget` + """ + raise NotImplementedError("delete_target not implemented for this driver") + + def list_recovery_points(self, target, start_date=None, end_date=None): + """ + List the recovery points available for a target + + :param target: Backup target to delete + :type target: Instance of :class:`.BackupTarget` + + :param start_date: The start date to show jobs between (optional) + :type start_date: :class:`datetime.datetime` + + :param end_date: The end date to show jobs between (optional) + :type end_date: :class:`datetime.datetime`` + + :rtype: ``list`` of :class:`.BackupTargetRecoveryPoint` + """ + raise NotImplementedError("list_recovery_points not implemented for this driver") + + def recover_target(self, target, recovery_point, path=None): + """ + Recover a backup target to a recovery point + + :param target: Backup target to delete + :type target: Instance of :class:`.BackupTarget` + + :param recovery_point: Backup target with the backup data + :type recovery_point: Instance of :class:`.BackupTarget` + + :param path: The part of the recovery point to recover (optional) + :type path: ``str`` + + :rtype: Instance of :class:`.BackupTargetJob` + """ + raise NotImplementedError("recover_target not implemented for this driver") + + def recover_target_out_of_place(self, target, recovery_point, recovery_target, path=None): + """ + Recover a backup target to a recovery point out-of-place + + :param target: Backup target with the backup data + :type target: Instance of :class:`.BackupTarget` + + :param recovery_point: Backup target with the backup data + :type recovery_point: Instance of :class:`.BackupTarget` + + :param recovery_target: Backup target with to recover the data to + :type recovery_target: Instance of :class:`.BackupTarget` + + :param path: The part of the recovery point to recover (optional) + :type path: ``str`` + + :rtype: Instance of :class:`BackupTargetJob` + """ + raise NotImplementedError("recover_target_out_of_place not implemented for this driver") + + def get_target_job(self, target, id): + """ + Get a specific backup job by ID + + :param target: Backup target with the backup data + :type target: Instance of :class:`.BackupTarget` + + :param id: Backup target with the backup data + :type id: Instance of :class:`.BackupTarget` + + :rtype: :class:`BackupTargetJob` + """ + jobs = self.list_target_jobs(target) + return list(filter(lambda x: x.id == id, jobs))[0] + + def list_target_jobs(self, target): + """ + List the backup jobs on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`.BackupTarget` + + :rtype: ``list`` of :class:`.BackupTargetJob` + """ + raise NotImplementedError("list_target_jobs not implemented for this driver") + + def create_target_job(self, target, extra=None): + """ + Create a new backup job on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`.BackupTarget` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTargetJob` + """ + raise NotImplementedError("create_target_job not implemented for this driver") + + def resume_target_job(self, job): + """ + Resume a suspended backup job on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`.BackupTarget` + + :param job: Backup target job to resume + :type job: Instance of :class:`.BackupTargetJob` + + :rtype: ``bool`` + """ + raise NotImplementedError("resume_target_job not implemented for this driver") + + def suspend_target_job(self, job): + """ + Suspend a running backup job on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`.BackupTarget` + + :param job: Backup target job to suspend + :type job: Instance of :class:`.BackupTargetJob` + + :rtype: ``bool`` + """ + raise NotImplementedError("suspend_target_job not implemented for this driver") + + def cancel_target_job(self, job): + """ + Cancel a backup job on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`.BackupTarget` + + :param job: Backup target job to cancel + :type job: Instance of :class:`.BackupTargetJob` + + :rtype: ``bool`` + """ + raise NotImplementedError("cancel_target_job not implemented for this driver") diff --git a/libcloud/backup/drivers/__init__.py b/libcloud/backup/drivers/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/backup/drivers/dimensiondata.py b/libcloud/backup/drivers/dimensiondata.py new file mode 100644 index 0000000000..4ea775067b --- /dev/null +++ b/libcloud/backup/drivers/dimensiondata.py @@ -0,0 +1,671 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.utils.py3 import ET +from libcloud.utils.xml import findall, findtext, fixxpath +from libcloud.backup.base import BackupDriver, BackupTarget, BackupTargetJob +from libcloud.backup.types import Provider, BackupTargetType +from libcloud.common.dimensiondata import ( + BACKUP_NS, + TYPES_URN, + GENERAL_NS, + API_ENDPOINTS, + DEFAULT_REGION, + DimensionDataConnection, + DimensionDataBackupClient, + DimensionDataBackupDetails, + DimensionDataBackupClientType, + DimensionDataBackupClientAlert, + DimensionDataBackupStoragePolicy, + DimensionDataBackupSchedulePolicy, + dd_object_to_id, +) + +# pylint: disable=no-member + +DEFAULT_BACKUP_PLAN = "Advanced" + + +class DimensionDataBackupDriver(BackupDriver): + """ + DimensionData backup driver. + """ + + selected_region = None + connectionCls = DimensionDataConnection + name = "Dimension Data Backup" + website = "https://cloud.dimensiondata.com/" + type = Provider.DIMENSIONDATA + api_version = 1.0 + + network_domain_id = None + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=DEFAULT_REGION, + **kwargs, + ): + if region not in API_ENDPOINTS and host is None: + raise ValueError("Invalid region: %s, no host specified" % (region)) + if region is not None: + self.selected_region = API_ENDPOINTS[region] + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + api_version=api_version, + region=region, + **kwargs, + ) + + def _ex_connection_class_kwargs(self): + """ + Add the region to the kwargs before the connection is instantiated + """ + + kwargs = super()._ex_connection_class_kwargs() + kwargs["region"] = self.selected_region + return kwargs + + def get_supported_target_types(self): + """ + Get a list of backup target types this driver supports + + :return: ``list`` of :class:``BackupTargetType`` + """ + return [BackupTargetType.VIRTUAL] + + def list_targets(self): + """ + List all backuptargets + + :rtype: ``list`` of :class:`BackupTarget` + """ + targets = self._to_targets(self.connection.request_with_orgId_api_2("server/server").object) + return targets + + def create_target(self, name, address, type=BackupTargetType.VIRTUAL, extra=None): + """ + Creates a new backup target + + :param name: Name of the target (not used) + :type name: ``str`` + + :param address: The ID of the node in Dimension Data Cloud + :type address: ``str`` + + :param type: Backup target type, only Virtual supported + :type type: :class:`BackupTargetType` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTarget` + """ + if extra is not None: + service_plan = extra.get("servicePlan", DEFAULT_BACKUP_PLAN) + else: + service_plan = DEFAULT_BACKUP_PLAN + extra = {"servicePlan": service_plan} + + create_node = ET.Element("NewBackup", {"xmlns": BACKUP_NS}) + create_node.set("servicePlan", service_plan) + + response = self.connection.request_with_orgId_api_1( + "server/%s/backup" % (address), method="POST", data=ET.tostring(create_node) + ).object + + asset_id = None + for info in findall(response, "additionalInformation", GENERAL_NS): + if info.get("name") == "assetId": + asset_id = findtext(info, "value", GENERAL_NS) + + return BackupTarget( + id=asset_id, name=name, address=address, type=type, extra=extra, driver=self + ) + + def create_target_from_node(self, node, type=BackupTargetType.VIRTUAL, extra=None): + """ + Creates a new backup target from an existing node + + :param node: The Node to backup + :type node: ``Node`` + + :param type: Backup target type (Physical, Virtual, ...). + :type type: :class:`BackupTargetType` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTarget` + """ + return self.create_target( + name=node.name, address=node.id, type=BackupTargetType.VIRTUAL, extra=extra + ) + + def create_target_from_container(self, container, type=BackupTargetType.OBJECT, extra=None): + """ + Creates a new backup target from an existing storage container + + :param node: The Container to backup + :type node: ``Container`` + + :param type: Backup target type (Physical, Virtual, ...). + :type type: :class:`BackupTargetType` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTarget` + """ + return NotImplementedError("create_target_from_container not supported for this driver") + + def update_target(self, target, name=None, address=None, extra=None): + """ + Update the properties of a backup target, only changing the serviceplan + is supported. + + :param target: Backup target to update + :type target: Instance of :class:`BackupTarget` or ``str`` + + :param name: Name of the target + :type name: ``str`` + + :param address: Hostname, FQDN, IP, file path etc. + :type address: ``str`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTarget` + """ + if extra is not None: + service_plan = extra.get("servicePlan", DEFAULT_BACKUP_PLAN) + else: + service_plan = DEFAULT_BACKUP_PLAN + request = ET.Element("ModifyBackup", {"xmlns": BACKUP_NS}) + request.set("servicePlan", service_plan) + server_id = self._target_to_target_address(target) + self.connection.request_with_orgId_api_1( + "server/%s/backup/modify" % (server_id), + method="POST", + data=ET.tostring(request), + ).object + if isinstance(target, BackupTarget): + target.extra = extra + else: + target = self.ex_get_target_by_id(server_id) + return target + + def delete_target(self, target): + """ + Delete a backup target + + :param target: Backup target to delete + :type target: Instance of :class:`BackupTarget` or ``str`` + + :rtype: ``bool`` + """ + server_id = self._target_to_target_address(target) + response = self.connection.request_with_orgId_api_1( + "server/%s/backup?disable" % (server_id), method="GET" + ).object + response_code = findtext(response, "result", GENERAL_NS) + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def list_recovery_points(self, target, start_date=None, end_date=None): + """ + List the recovery points available for a target + + :param target: Backup target to delete + :type target: Instance of :class:`BackupTarget` + + :param start_date: The start date to show jobs between (optional) + :type start_date: :class:`datetime.datetime` + + :param end_date: The end date to show jobs between (optional) + :type end_date: :class:`datetime.datetime`` + + :rtype: ``list`` of :class:`BackupTargetRecoveryPoint` + """ + raise NotImplementedError("list_recovery_points not implemented for this driver") + + def recover_target(self, target, recovery_point, path=None): + """ + Recover a backup target to a recovery point + + :param target: Backup target to delete + :type target: Instance of :class:`BackupTarget` + + :param recovery_point: Backup target with the backup data + :type recovery_point: Instance of :class:`BackupTarget` + + :param path: The part of the recovery point to recover (optional) + :type path: ``str`` + + :rtype: Instance of :class:`BackupTargetJob` + """ + raise NotImplementedError("recover_target not implemented for this driver") + + def recover_target_out_of_place(self, target, recovery_point, recovery_target, path=None): + """ + Recover a backup target to a recovery point out-of-place + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param recovery_point: Backup target with the backup data + :type recovery_point: Instance of :class:`BackupTarget` + + :param recovery_target: Backup target with to recover the data to + :type recovery_target: Instance of :class:`BackupTarget` + + :param path: The part of the recovery point to recover (optional) + :type path: ``str`` + + :rtype: Instance of :class:`BackupTargetJob` + """ + raise NotImplementedError("recover_target_out_of_place not implemented for this driver") + + def get_target_job(self, target, id): + """ + Get a specific backup job by ID + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param id: Backup target with the backup data + :type id: Instance of :class:`BackupTarget` + + :rtype: :class:`BackupTargetJob` + """ + jobs = self.list_target_jobs(target) + return list(filter(lambda x: x.id == id, jobs))[0] + + def list_target_jobs(self, target): + """ + List the backup jobs on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :rtype: ``list`` of :class:`BackupTargetJob` + """ + raise NotImplementedError("list_target_jobs not implemented for this driver") + + def create_target_job(self, target, extra=None): + """ + Create a new backup job on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTargetJob` + """ + raise NotImplementedError("create_target_job not implemented for this driver") + + def resume_target_job(self, target, job): + """ + Resume a suspended backup job on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param job: Backup target job to resume + :type job: Instance of :class:`BackupTargetJob` + + :rtype: ``bool`` + """ + raise NotImplementedError("resume_target_job not implemented for this driver") + + def suspend_target_job(self, target, job): + """ + Suspend a running backup job on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param job: Backup target job to suspend + :type job: Instance of :class:`BackupTargetJob` + + :rtype: ``bool`` + """ + raise NotImplementedError("suspend_target_job not implemented for this driver") + + def cancel_target_job(self, job, ex_client=None, ex_target=None): + """ + Cancel a backup job on a target + + :param job: Backup target job to cancel. If it is ``None`` + ex_client and ex_target must be set + :type job: Instance of :class:`BackupTargetJob` or ``None`` + + :param ex_client: Client of the job to cancel. + Not necessary if job is specified. + DimensionData only has 1 job per client + :type ex_client: Instance of :class:`DimensionDataBackupClient` + or ``str`` + + :param ex_target: Target to cancel a job from. + Not necessary if job is specified. + :type ex_target: Instance of :class:`BackupTarget` or ``str`` + + :rtype: ``bool`` + """ + if job is None: + if ex_client is None or ex_target is None: + raise ValueError("Either job or ex_client and " "ex_target have to be set") + server_id = self._target_to_target_address(ex_target) + client_id = self._client_to_client_id(ex_client) + else: + server_id = job.target.address + client_id = job.extra["clientId"] + + response = self.connection.request_with_orgId_api_1( + "server/{}/backup/client/{}?cancelJob".format(server_id, client_id), + method="GET", + ).object + response_code = findtext(response, "result", GENERAL_NS) + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_get_target_by_id(self, id): + """ + Get a target by server id + + :param id: The id of the target you want to get + :type id: ``str`` + + :rtype: :class:`BackupTarget` + """ + node = self.connection.request_with_orgId_api_2("server/server/%s" % id).object + return self._to_target(node) + + def ex_add_client_to_target( + self, target, client_type, storage_policy, schedule_policy, trigger, email + ): + """ + Add a client to a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` or ``str`` + + :param client: Client to add to the target + :type client: Instance of :class:`DimensionDataBackupClientType` + or ``str`` + + :param storage_policy: The storage policy for the client + :type storage_policy: Instance of + :class:`DimensionDataBackupStoragePolicy` + or ``str`` + + :param schedule_policy: The schedule policy for the client + :type schedule_policy: Instance of + :class:`DimensionDataBackupSchedulePolicy` + or ``str`` + + :param trigger: The notify trigger for the client + :type trigger: ``str`` + + :param email: The notify email for the client + :type email: ``str`` + + :rtype: ``bool`` + """ + server_id = self._target_to_target_address(target) + + backup_elm = ET.Element("NewBackupClient", {"xmlns": BACKUP_NS}) + if isinstance(client_type, DimensionDataBackupClientType): + ET.SubElement(backup_elm, "type").text = client_type.type + else: + ET.SubElement(backup_elm, "type").text = client_type + + if isinstance(storage_policy, DimensionDataBackupStoragePolicy): + ET.SubElement(backup_elm, "storagePolicyName").text = storage_policy.name + else: + ET.SubElement(backup_elm, "storagePolicyName").text = storage_policy + + if isinstance(schedule_policy, DimensionDataBackupSchedulePolicy): + ET.SubElement(backup_elm, "schedulePolicyName").text = schedule_policy.name + else: + ET.SubElement(backup_elm, "schedulePolicyName").text = schedule_policy + + alerting_elm = ET.SubElement(backup_elm, "alerting") + alerting_elm.set("trigger", trigger) + ET.SubElement(alerting_elm, "emailAddress").text = email + + response = self.connection.request_with_orgId_api_1( + "server/%s/backup/client" % (server_id), + method="POST", + data=ET.tostring(backup_elm), + ).object + response_code = findtext(response, "result", GENERAL_NS) + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_remove_client_from_target(self, target, backup_client): + """ + Removes a client from a backup target + + :param target: The backup target to remove the client from + :type target: :class:`BackupTarget` or ``str`` + + :param backup_client: The backup client to remove + :type backup_client: :class:`DimensionDataBackupClient` or ``str`` + + :rtype: ``bool`` + """ + server_id = self._target_to_target_address(target) + client_id = self._client_to_client_id(backup_client) + response = self.connection.request_with_orgId_api_1( + "server/{}/backup/client/{}?disable".format(server_id, client_id), method="GET" + ).object + response_code = findtext(response, "result", GENERAL_NS) + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_get_backup_details_for_target(self, target): + """ + Returns a backup details object for a target + + :param target: The backup target to get details for + :type target: :class:`BackupTarget` or ``str`` + + :rtype: :class:`DimensionDataBackupDetails` + """ + if not isinstance(target, BackupTarget): + target = self.ex_get_target_by_id(target) + if target is None: + return + response = self.connection.request_with_orgId_api_1( + "server/%s/backup" % (target.address), method="GET" + ).object + return self._to_backup_details(response, target) + + def ex_list_available_client_types(self, target): + """ + Returns a list of available backup client types + + :param target: The backup target to list available types for + :type target: :class:`BackupTarget` or ``str`` + + :rtype: ``list`` of :class:`DimensionDataBackupClientType` + """ + server_id = self._target_to_target_address(target) + response = self.connection.request_with_orgId_api_1( + "server/%s/backup/client/type" % (server_id), method="GET" + ).object + return self._to_client_types(response) + + def ex_list_available_storage_policies(self, target): + """ + Returns a list of available backup storage policies + + :param target: The backup target to list available policies for + :type target: :class:`BackupTarget` or ``str`` + + :rtype: ``list`` of :class:`DimensionDataBackupStoragePolicy` + """ + server_id = self._target_to_target_address(target) + response = self.connection.request_with_orgId_api_1( + "server/%s/backup/client/storagePolicy" % (server_id), method="GET" + ).object + return self._to_storage_policies(response) + + def ex_list_available_schedule_policies(self, target): + """ + Returns a list of available backup schedule policies + + :param target: The backup target to list available policies for + :type target: :class:`BackupTarget` or ``str`` + + :rtype: ``list`` of :class:`DimensionDataBackupSchedulePolicy` + """ + server_id = self._target_to_target_address(target) + response = self.connection.request_with_orgId_api_1( + "server/%s/backup/client/schedulePolicy" % (server_id), method="GET" + ).object + return self._to_schedule_policies(response) + + def _to_storage_policies(self, object): + elements = object.findall(fixxpath("storagePolicy", BACKUP_NS)) + + return [self._to_storage_policy(el) for el in elements] + + def _to_storage_policy(self, element): + return DimensionDataBackupStoragePolicy( + retention_period=int(element.get("retentionPeriodInDays")), + name=element.get("name"), + secondary_location=element.get("secondaryLocation"), + ) + + def _to_schedule_policies(self, object): + elements = object.findall(fixxpath("schedulePolicy", BACKUP_NS)) + + return [self._to_schedule_policy(el) for el in elements] + + def _to_schedule_policy(self, element): + return DimensionDataBackupSchedulePolicy( + name=element.get("name"), description=element.get("description") + ) + + def _to_client_types(self, object): + elements = object.findall(fixxpath("backupClientType", BACKUP_NS)) + + return [self._to_client_type(el) for el in elements] + + def _to_client_type(self, element): + description = element.get("description") + if description is None: + description = findtext(element, "description", BACKUP_NS) + return DimensionDataBackupClientType( + type=element.get("type"), + description=description, + is_file_system=bool(element.get("isFileSystem") == "true"), + ) + + def _to_backup_details(self, object, target): + return DimensionDataBackupDetails( + asset_id=object.get("assetId"), + service_plan=object.get("servicePlan"), + status=object.get("state"), + clients=self._to_clients(object, target), + ) + + def _to_clients(self, object, target): + elements = object.findall(fixxpath("backupClient", BACKUP_NS)) + + return [self._to_client(el, target) for el in elements] + + def _to_client(self, element, target): + client_id = element.get("id") + return DimensionDataBackupClient( + id=client_id, + type=self._to_client_type(element), + status=element.get("status"), + schedule_policy=findtext(element, "schedulePolicyName", BACKUP_NS), + storage_policy=findtext(element, "storagePolicyName", BACKUP_NS), + download_url=findtext(element, "downloadUrl", BACKUP_NS), + running_job=self._to_backup_job(element, target, client_id), + alert=self._to_alert(element), + ) + + def _to_alert(self, element): + alert = element.find(fixxpath("alerting", BACKUP_NS)) + if alert is not None: + notify_list = [ + email_addr.text for email_addr in alert.findall(fixxpath("emailAddress", BACKUP_NS)) + ] + return DimensionDataBackupClientAlert( + trigger=element.get("trigger"), notify_list=notify_list + ) + return None + + def _to_backup_job(self, element, target, client_id): + running_job = element.find(fixxpath("runningJob", BACKUP_NS)) + if running_job is not None: + return BackupTargetJob( + id=running_job.get("id"), + status=running_job.get("status"), + progress=int(running_job.get("percentageComplete")), + driver=self.connection.driver, + target=target, + extra={"clientId": client_id}, + ) + return None + + def _to_targets(self, object): + node_elements = object.findall(fixxpath("server", TYPES_URN)) + + return [self._to_target(el) for el in node_elements] + + def _to_target(self, element): + backup = findall(element, "backup", TYPES_URN) + if len(backup) == 0: + return + extra = { + "description": findtext(element, "description", TYPES_URN), + "sourceImageId": findtext(element, "sourceImageId", TYPES_URN), + "datacenterId": element.get("datacenterId"), + "deployedTime": findtext(element, "createTime", TYPES_URN), + "servicePlan": backup[0].get("servicePlan"), + } + + n = BackupTarget( + id=backup[0].get("assetId"), + name=findtext(element, "name", TYPES_URN), + address=element.get("id"), + driver=self.connection.driver, + type=BackupTargetType.VIRTUAL, + extra=extra, + ) + return n + + @staticmethod + def _client_to_client_id(backup_client): + return dd_object_to_id(backup_client, DimensionDataBackupClient) + + @staticmethod + def _target_to_target_address(target): + return dd_object_to_id(target, BackupTarget, id_value="address") diff --git a/libcloud/backup/drivers/dummy.py b/libcloud/backup/drivers/dummy.py new file mode 100644 index 0000000000..a6805eb187 --- /dev/null +++ b/libcloud/backup/drivers/dummy.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.backup.base import BackupDriver + + +class DummyBackupDriver(BackupDriver): + """ + Dummy Backup driver. + + >>> from libcloud.backup.drivers.dummy import DummyBackupDriver + >>> driver = DummyBackupDriver('key', 'secret') + >>> driver.name + 'Dummy Backup Provider' + """ + + name = "Dummy Backup Provider" + website = "http://example.com" + + def __init__(self, api_key, api_secret): + """ + :param api_key: API key or username to used (required) + :type api_key: ``str`` + + :param api_secret: Secret password to be used (required) + :type api_secret: ``str`` + + :rtype: ``None`` + """ diff --git a/libcloud/backup/drivers/ebs.py b/libcloud/backup/drivers/ebs.py new file mode 100644 index 0000000000..b0d667d2ef --- /dev/null +++ b/libcloud/backup/drivers/ebs.py @@ -0,0 +1,386 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__all__ = ["EBSBackupDriver"] + + +from libcloud.utils.xml import findall, findtext +from libcloud.common.aws import AWSGenericResponse, SignedAWSConnection +from libcloud.backup.base import ( + BackupDriver, + BackupTarget, + BackupTargetJob, + BackupTargetRecoveryPoint, +) +from libcloud.backup.types import BackupTargetType, BackupTargetJobStatusType +from libcloud.utils.iso8601 import parse_date + +VERSION = "2015-10-01" +HOST = "ec2.amazonaws.com" +ROOT = "/%s/" % (VERSION) +NS = "http://ec2.amazonaws.com/doc/{}/".format(VERSION) + + +class EBSResponse(AWSGenericResponse): + """ + Amazon EBS response class. + """ + + namespace = NS + exceptions = {} + xpath = "Error" + + +class EBSConnection(SignedAWSConnection): + version = VERSION + host = HOST + responseCls = EBSResponse + service_name = "backup" + + +class EBSBackupDriver(BackupDriver): + name = "Amazon EBS Backup Driver" + website = "http://aws.amazon.com/ebs/" + connectionCls = EBSConnection + + def __init__(self, access_id, secret, region): + super().__init__(access_id, secret) + self.region = region + self.connection.host = HOST % (region) + + def get_supported_target_types(self): + """ + Get a list of backup target types this driver supports + + :return: ``list`` of :class:``BackupTargetType`` + """ + return [BackupTargetType.VOLUME] + + def list_targets(self): + """ + List all backuptargets + + :rtype: ``list`` of :class:`BackupTarget` + """ + raise NotImplementedError("list_targets not implemented for this driver") + + def create_target(self, name, address, type=BackupTargetType.VOLUME, extra=None): + """ + Creates a new backup target + + :param name: Name of the target + :type name: ``str`` + + :param address: The volume ID. + :type address: ``str`` + + :param type: Backup target type (Physical, Virtual, ...). + :type type: :class:`BackupTargetType` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTarget` + """ + # Does nothing since any volume can be snapped at anytime. + return self.ex_get_target_by_volume_id(address) + + def create_target_from_node(self, node, type=BackupTargetType.VIRTUAL, extra=None): + """ + Creates a new backup target from an existing node + + :param node: The Node to backup + :type node: ``Node`` + + :param type: Backup target type (Physical, Virtual, ...). + :type type: :class:`BackupTargetType` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTarget` + """ + # Get the first EBS volume. + device_mapping = node.extra["block_device_mapping"] + if device_mapping is not None: + return self.create_target( + name=node.name, + address=device_mapping["ebs"][0]["volume_id"], + type=BackupTargetType.VOLUME, + extra=None, + ) + else: + raise RuntimeError("Node does not have any block devices") + + def create_target_from_container(self, container, type=BackupTargetType.OBJECT, extra=None): + """ + Creates a new backup target from an existing storage container + + :param node: The Container to backup + :type node: ``Container`` + + :param type: Backup target type (Physical, Virtual, ...). + :type type: :class:`BackupTargetType` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTarget` + """ + raise NotImplementedError("create_target_from_container not implemented for this driver") + + def update_target(self, target, name, address, extra): + """ + Update the properties of a backup target + + :param target: Backup target to update + :type target: Instance of :class:`BackupTarget` + + :param name: Name of the target + :type name: ``str`` + + :param address: Hostname, FQDN, IP, file path etc. + :type address: ``str`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTarget` + """ + # Does nothing since any volume can be snapped at anytime. + return self.ex_get_target_by_volume_id(address) + + def delete_target(self, target): + """ + Delete a backup target + + :param target: Backup target to delete + :type target: Instance of :class:`BackupTarget` + """ + raise NotImplementedError("delete_target not implemented for this driver") + + def list_recovery_points(self, target, start_date=None, end_date=None): + """ + List the recovery points available for a target + + :param target: Backup target to delete + :type target: Instance of :class:`BackupTarget` + + :param start_date: The start date to show jobs between (optional) + :type start_date: :class:`datetime.datetime` + + :param end_date: The end date to show jobs between (optional) + :type end_date: :class:`datetime.datetime`` + + :rtype: ``list`` of :class:`BackupTargetRecoveryPoint` + """ + params = { + "Action": "DescribeSnapshots", + "Filter.1.Name": "volume-id", + "Filter.1.Value": target.extra["volume-id"], + } + data = self.connection.request(ROOT, params=params).object + return self._to_recovery_points(data, target) + + def recover_target(self, target, recovery_point, path=None): + """ + Recover a backup target to a recovery point + + :param target: Backup target to delete + :type target: Instance of :class:`BackupTarget` + + :param recovery_point: Backup target with the backup data + :type recovery_point: Instance of :class:`BackupTarget` + + :param path: The part of the recovery point to recover (optional) + :type path: ``str`` + + :rtype: Instance of :class:`BackupTargetJob` + """ + raise NotImplementedError("delete_target not implemented for this driver") + + def recover_target_out_of_place(self, target, recovery_point, recovery_target, path=None): + """ + Recover a backup target to a recovery point out-of-place + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param recovery_point: Backup target with the backup data + :type recovery_point: Instance of :class:`BackupTarget` + + :param recovery_target: Backup target with to recover the data to + :type recovery_target: Instance of :class:`BackupTarget` + + :param path: The part of the recovery point to recover (optional) + :type path: ``str`` + + :rtype: Instance of :class:`BackupTargetJob` + """ + raise NotImplementedError("delete_target not implemented for this driver") + + def get_target_job(self, target, id): + """ + Get a specific backup job by ID + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param id: Backup target with the backup data + :type id: Instance of :class:`BackupTarget` + + :rtype: :class:`BackupTargetJob` + """ + jobs = self.list_target_jobs(target) + return list(filter(lambda x: x.id == id, jobs))[0] + + def list_target_jobs(self, target): + """ + List the backup jobs on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :rtype: ``list`` of :class:`BackupTargetJob` + """ + params = { + "Action": "DescribeSnapshots", + "Filter.1.Name": "volume-id", + "Filter.1.Value": target.extra["volume-id"], + "Filter.2.Name": "status", + "Filter.2.Value": "pending", + } + data = self.connection.request(ROOT, params=params).object + return self._to_jobs(data) + + def create_target_job(self, target, extra=None): + """ + Create a new backup job on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTargetJob` + """ + params = {"Action": "CreateSnapshot", "VolumeId": target.extra["volume-id"]} + data = self.connection.request(ROOT, params=params).object + xpath = "CreateSnapshotResponse" + return self._to_job(findall(element=data, xpath=xpath, namespace=NS)[0]) + + def resume_target_job(self, job): + """ + Resume a suspended backup job on a target + + :param job: Backup target job to resume + :type job: Instance of :class:`BackupTargetJob` + + :rtype: ``bool`` + """ + raise NotImplementedError("resume_target_job not supported for this driver") + + def suspend_target_job(self, job): + """ + Suspend a running backup job on a target + + :param job: Backup target job to suspend + :type job: Instance of :class:`BackupTargetJob` + + :rtype: ``bool`` + """ + raise NotImplementedError("suspend_target_job not supported for this driver") + + def cancel_target_job(self, job): + """ + Cancel a backup job on a target + + :param job: Backup target job to cancel + :type job: Instance of :class:`BackupTargetJob` + + :rtype: ``bool`` + """ + raise NotImplementedError("cancel_target_job not supported for this driver") + + def _to_recovery_points(self, data, target): + xpath = "DescribeSnapshotsResponse/snapshotSet/item" + return [ + self._to_recovery_point(el, target) + for el in findall(element=data, xpath=xpath, namespace=NS) + ] + + def _to_recovery_point(self, el, target): + id = findtext(element=el, xpath="snapshotId", namespace=NS) + date = parse_date(findtext(element=el, xpath="startTime", namespace=NS)) + tags = self._get_resource_tags(el) + point = BackupTargetRecoveryPoint( + id=id, + date=date, + target=target, + driver=self.connection.driver, + extra={"snapshot-id": id, "tags": tags}, + ) + return point + + def _to_jobs(self, data): + xpath = "DescribeSnapshotsResponse/snapshotSet/item" + return [self._to_job(el) for el in findall(element=data, xpath=xpath, namespace=NS)] + + def _to_job(self, el): + id = findtext(element=el, xpath="snapshotId", namespace=NS) + progress = findtext(element=el, xpath="progress", namespace=NS).replace("%", "") + volume_id = findtext(element=el, xpath="volumeId", namespace=NS) + target = self.ex_get_target_by_volume_id(volume_id) + job = BackupTargetJob( + id=id, + status=BackupTargetJobStatusType.PENDING, + progress=int(progress), + target=target, + driver=self.connection.driver, + extra={}, + ) + return job + + def ex_get_target_by_volume_id(self, volume_id): + return BackupTarget( + id=volume_id, + name=volume_id, + address=volume_id, + type=BackupTargetType.VOLUME, + driver=self.connection.driver, + extra={"volume-id": volume_id}, + ) + + def _get_resource_tags(self, element): + """ + Parse tags from the provided element and return a dictionary with + key/value pairs. + + :rtype: ``dict`` + """ + tags = {} + + # Get our tag set by parsing the element + tag_set = findall(element=element, xpath="tagSet/item", namespace=NS) + + for tag in tag_set: + key = findtext(element=tag, xpath="key", namespace=NS) + + value = findtext(element=tag, xpath="value", namespace=NS) + + tags[key] = value + + return tags diff --git a/libcloud/backup/drivers/gce.py b/libcloud/backup/drivers/gce.py new file mode 100644 index 0000000000..b04b5c00a5 --- /dev/null +++ b/libcloud/backup/drivers/gce.py @@ -0,0 +1,473 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__all__ = ["GCEBackupDriver"] + +from libcloud.backup.base import ( + BackupDriver, + BackupTarget, + BackupTargetJob, + BackupTargetRecoveryPoint, +) +from libcloud.backup.types import BackupTargetType, BackupTargetJobStatusType +from libcloud.common.google import GoogleResponse, GoogleBaseConnection +from libcloud.utils.iso8601 import parse_date + +API_VERSION = "v1" +DEFAULT_TASK_COMPLETION_TIMEOUT = 180 + + +class GCEResponse(GoogleResponse): + pass + + +class GCEConnection(GoogleBaseConnection): + """ + Connection class for the GCE driver. + + GCEConnection extends :class:`google.GoogleBaseConnection` for 2 reasons: + 1. modify request_path for GCE URI. + 2. Implement gce_params functionality described below. + + If the parameter gce_params is set to a dict prior to calling request(), + the URL parameters will be updated to include those key/values FOR A + SINGLE REQUEST. If the response contains a nextPageToken, + gce_params['pageToken'] will be set to its value. This can be used to + implement paging in list: + + >>> params, more_results = {'maxResults': 2}, True + >>> while more_results: + ... driver.connection.gce_params=params + ... driver.ex_list_urlmaps() + ... more_results = 'pageToken' in params + ... + [, ] + [] + """ + + host = "www.googleapis.com" + responseCls = GCEResponse + + def __init__( + self, + user_id, + key, + secure, + auth_type=None, + credential_file=None, + project=None, + **kwargs, + ): + super().__init__( + user_id, + key, + secure=secure, + auth_type=auth_type, + credential_file=credential_file, + **kwargs, + ) + self.request_path = "/compute/{}/projects/{}".format(API_VERSION, project) + self.gce_params = {} + + def pre_connect_hook(self, params, headers): + """ + Update URL parameters with values from self.gce_params. + + @inherits: :class:`GoogleBaseConnection.pre_connect_hook` + """ + params, headers = super().pre_connect_hook(params, headers) + if self.gce_params: + params.update(self.gce_params) + return params, headers + + def request(self, *args, **kwargs): + """ + Perform request then do GCE-specific processing of URL params. + + @inherits: :class:`GoogleBaseConnection.request` + """ + response = super().request(*args, **kwargs) + + # If gce_params has been set, then update the pageToken with the + # nextPageToken so it can be used in the next request. + if self.gce_params: + if "nextPageToken" in response.object: + self.gce_params["pageToken"] = response.object["nextPageToken"] + elif "pageToken" in self.gce_params: + del self.gce_params["pageToken"] + self.gce_params = {} + + return response + + +class GCEBackupDriver(BackupDriver): + name = "Google Compute Engine Backup Driver" + website = "http://cloud.google.com/" + connectionCls = GCEConnection + + def __init__( + self, + user_id, + key=None, + project=None, + auth_type=None, + scopes=None, + credential_file=None, + **kwargs, + ): + """ + :param user_id: The email address (for service accounts) or Client ID + (for installed apps) to be used for authentication. + :type user_id: ``str`` + + :param key: The RSA Key (for service accounts) or file path containing + key or Client Secret (for installed apps) to be used for + authentication. + :type key: ``str`` + + :keyword project: Your GCE project name. (required) + :type project: ``str`` + + :keyword auth_type: Accepted values are "SA" or "IA" or "GCE" + ("Service Account" or "Installed Application" or + "GCE" if libcloud is being used on a GCE instance + with service account enabled). + If not supplied, auth_type will be guessed based + on value of user_id or if the code is being + executed in a GCE instance. + :type auth_type: ``str`` + + :keyword scopes: List of authorization URLs. Default is empty and + grants read/write to Compute, Storage, DNS. + :type scopes: ``list`` + + :keyword credential_file: Path to file for caching authentication + information used by GCEConnection. + :type credential_file: ``str`` + """ + if not project: + raise ValueError("Project name must be specified using " '"project" keyword.') + + self.auth_type = auth_type + self.project = project + self.scopes = scopes + self.credential_file = credential_file or "~/.gce_libcloud_auth" + "." + self.project + + super().__init__(user_id, key, **kwargs) + + # Cache Zone and Region information to reduce API calls and + # increase speed + self.base_path = "/compute/{}/projects/{}".format(API_VERSION, self.project) + + def get_supported_target_types(self): + """ + Get a list of backup target types this driver supports + + :return: ``list`` of :class:``BackupTargetType`` + """ + return [BackupTargetType.VOLUME] + + def list_targets(self): + """ + List all backuptargets + + :rtype: ``list`` of :class:`BackupTarget` + """ + raise NotImplementedError("list_targets not implemented for this driver") + + def create_target(self, name, address, type=BackupTargetType.VOLUME, extra=None): + """ + Creates a new backup target + + :param name: Name of the target + :type name: ``str`` + + :param address: The volume ID. + :type address: ``str`` + + :param type: Backup target type (Physical, Virtual, ...). + :type type: :class:`BackupTargetType` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTarget` + """ + # Does nothing since any volume can be snapped at anytime. + return self.ex_get_target_by_source(address) + + def create_target_from_node(self, node, type=BackupTargetType.VIRTUAL, extra=None): + """ + Creates a new backup target from an existing node + + :param node: The Node to backup + :type node: ``Node`` + + :param type: Backup target type (Physical, Virtual, ...). + :type type: :class:`BackupTargetType` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTarget` + """ + # Get the first persistent disk + disks = node.extra["disks"] + if disks is not None: + return self.create_target( + name=node.name, + address=disks[0]["source"], + type=BackupTargetType.VOLUME, + extra=None, + ) + else: + raise RuntimeError("Node does not have any block devices") + + def create_target_from_container(self, container, type=BackupTargetType.OBJECT, extra=None): + """ + Creates a new backup target from an existing storage container + + :param node: The Container to backup + :type node: ``Container`` + + :param type: Backup target type (Physical, Virtual, ...). + :type type: :class:`BackupTargetType` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTarget` + """ + raise NotImplementedError("create_target_from_container not implemented for this driver") + + def update_target(self, target, name, address, extra): + """ + Update the properties of a backup target + + :param target: Backup target to update + :type target: Instance of :class:`BackupTarget` + + :param name: Name of the target + :type name: ``str`` + + :param address: Hostname, FQDN, IP, file path etc. + :type address: ``str`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTarget` + """ + # Does nothing since any volume can be snapped at anytime. + return self.ex_get_target_by_source(address) + + def delete_target(self, target): + """ + Delete a backup target + + :param target: Backup target to delete + :type target: Instance of :class:`BackupTarget` + """ + raise NotImplementedError("delete_target not implemented for this driver") + + def list_recovery_points(self, target, start_date=None, end_date=None): + """ + List the recovery points available for a target + + :param target: Backup target to delete + :type target: Instance of :class:`BackupTarget` + + :param start_date: The start date to show jobs between (optional) + :type start_date: :class:`datetime.datetime` + + :param end_date: The end date to show jobs between (optional) + :type end_date: :class:`datetime.datetime`` + + :rtype: ``list`` of :class:`BackupTargetRecoveryPoint` + """ + request = "/global/snapshots" + response = self.connection.request(request, method="GET").object + return self._to_recovery_points(response, target) + + def recover_target(self, target, recovery_point, path=None): + """ + Recover a backup target to a recovery point + + :param target: Backup target to delete + :type target: Instance of :class:`BackupTarget` + + :param recovery_point: Backup target with the backup data + :type recovery_point: Instance of :class:`BackupTarget` + + :param path: The part of the recovery point to recover (optional) + :type path: ``str`` + + :rtype: Instance of :class:`BackupTargetJob` + """ + raise NotImplementedError("recover_target not implemented for this driver") + + def recover_target_out_of_place(self, target, recovery_point, recovery_target, path=None): + """ + Recover a backup target to a recovery point out-of-place + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param recovery_point: Backup target with the backup data + :type recovery_point: Instance of :class:`BackupTarget` + + :param recovery_target: Backup target with to recover the data to + :type recovery_target: Instance of :class:`BackupTarget` + + :param path: The part of the recovery point to recover (optional) + :type path: ``str`` + + :rtype: Instance of :class:`BackupTargetJob` + """ + raise NotImplementedError("recover_target_out_of_place not implemented for this driver") + + def get_target_job(self, target, id): + """ + Get a specific backup job by ID + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param id: Backup target with the backup data + :type id: Instance of :class:`BackupTarget` + + :rtype: :class:`BackupTargetJob` + """ + jobs = self.list_target_jobs(target) + return list(filter(lambda x: x.id == id, jobs))[0] + + def list_target_jobs(self, target): + """ + List the backup jobs on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :rtype: ``list`` of :class:`BackupTargetJob` + """ + return [] + + def create_target_job(self, target, extra=None): + """ + Create a new backup job on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: Instance of :class:`BackupTargetJob` + """ + name = target.name + request = "/zones/{}/disks/{}/createSnapshot".format( + target.extra["zone"].name, + target.name, + ) + snapshot_data = {"source": target.extra["source"]} + self.connection.async_request(request, method="POST", data=snapshot_data) + return self._to_job(self.ex_get_snapshot(name), target) + + def resume_target_job(self, target, job): + """ + Resume a suspended backup job on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param job: Backup target job to resume + :type job: Instance of :class:`BackupTargetJob` + + :rtype: ``bool`` + """ + raise NotImplementedError("resume_target_job not supported for this driver") + + def suspend_target_job(self, target, job): + """ + Suspend a running backup job on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param job: Backup target job to suspend + :type job: Instance of :class:`BackupTargetJob` + + :rtype: ``bool`` + """ + raise NotImplementedError("suspend_target_job not supported for this driver") + + def cancel_target_job(self, target, job): + """ + Cancel a backup job on a target + + :param target: Backup target with the backup data + :type target: Instance of :class:`BackupTarget` + + :param job: Backup target job to cancel + :type job: Instance of :class:`BackupTargetJob` + + :rtype: ``bool`` + """ + raise NotImplementedError("cancel_target_job not supported for this driver") + + def _to_recovery_points(self, data, target): + return [self._to_recovery_point(item, target) for item in data.items] + + def _to_recovery_point(self, item, target): + id = item.id + date = parse_date(item.creationTimestamp) + point = BackupTargetRecoveryPoint( + id=id, + date=date, + target=target, + driver=self.connection.driver, + extra={"snapshot-id": id}, + ) + return point + + def _to_jobs(self, data, target): + return [self._to_job(item, target) for item in data.items] + + def _to_job(self, item, target): + id = item.id + job = BackupTargetJob( + id=id, + status=BackupTargetJobStatusType.PENDING, + progress=0, + target=target, + driver=self.connection.driver, + extra={}, + ) + return job + + def ex_get_snapshot(self, name): + request = "/global/snapshots/%s" % (name) + response = self.connection.request(request, method="GET").object + return response + + def ex_get_target_by_source(self, source): + return BackupTarget( + id=source, + name=source, + address=source, + type=BackupTargetType.VOLUME, + driver=self.connection.driver, + extra={"source": source}, + ) diff --git a/libcloud/backup/providers.py b/libcloud/backup/providers.py new file mode 100644 index 0000000000..8a56f0112e --- /dev/null +++ b/libcloud/backup/providers.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.backup.types import Provider +from libcloud.common.providers import get_driver as _get_provider_driver +from libcloud.common.providers import set_driver as _set_provider_driver + +DRIVERS = { + Provider.DUMMY: ("libcloud.backup.drivers.dummy", "DummyBackupDriver"), + Provider.EBS: ("libcloud.backup.drivers.ebs", "EBSBackupDriver"), + Provider.GCE: ("libcloud.backup.drivers.gce", "GCEBackupDriver"), + Provider.DIMENSIONDATA: ( + "libcloud.backup.drivers.dimensiondata", + "DimensionDataBackupDriver", + ), +} + + +def get_driver(provider): + return _get_provider_driver(drivers=DRIVERS, provider=provider) + + +def set_driver(provider, module, klass): + return _set_provider_driver(drivers=DRIVERS, provider=provider, module=module, klass=klass) diff --git a/libcloud/backup/types.py b/libcloud/backup/types.py new file mode 100644 index 0000000000..912f90b520 --- /dev/null +++ b/libcloud/backup/types.py @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__all__ = ["Provider", "BackupTargetType", "BackupTargetJobStatusType"] + + +class Provider: + """ + Defines for each of the supported providers + + Non-Dummy drivers are sorted in alphabetical order. Please preserve this + ordering when adding new drivers. + """ + + DUMMY = "dummy" + DIMENSIONDATA = "dimensiondata" + EBS = "ebs" + GCE = "gce" + + +class BackupTargetType: + """ + Backup Target type. + """ + + VIRTUAL = "Virtual" + """ Denotes a virtual host """ + + PHYSICAL = "Physical" + """ Denotes a physical host """ + + FILESYSTEM = "Filesystem" + """ Denotes a file system (e.g. NAS) """ + + DATABASE = "Database" + """ Denotes a database target """ + + OBJECT = "Object" + """ Denotes an object based file system """ + + VOLUME = "Volume" + """ Denotes a block storage volume """ + + +class BackupTargetJobStatusType: + """ + The status of a backup target job + """ + + RUNNING = "Running" + CANCELLED = "Cancelled" + FAILED = "Failed" + COMPLETED = "Completed" + PENDING = "Pending" diff --git a/libcloud/base.py b/libcloud/base.py new file mode 100644 index 0000000000..ac3e823925 --- /dev/null +++ b/libcloud/base.py @@ -0,0 +1,78 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Dict + +from libcloud.dns.providers import Provider as DnsProvider +from libcloud.dns.providers import get_driver as get_dns_driver +from libcloud.backup.providers import Provider as BackupProvider +from libcloud.backup.providers import get_driver as get_backup_driver +from libcloud.compute.providers import Provider as ComputeProvider +from libcloud.compute.providers import get_driver as get_compute_driver +from libcloud.storage.providers import Provider as StorageProvider +from libcloud.storage.providers import get_driver as get_storage_driver +from libcloud.container.providers import Provider as ContainerProvider +from libcloud.container.providers import get_driver as get_container_driver +from libcloud.loadbalancer.providers import Provider as LoadBalancerProvider +from libcloud.loadbalancer.providers import get_driver as get_loadbalancer_driver + + +class DriverType: + """Backup-as-a-service driver""" + + BACKUP = BackupProvider + + """ Compute-as-a-Service driver """ + COMPUTE = ComputeProvider + + """ Container-as-a-Service driver """ + CONTAINER = ContainerProvider + + """ DNS service provider driver """ + DNS = DnsProvider + + """ Load balancer provider-driver """ + LOADBALANCER = LoadBalancerProvider + + """ Storage-as-a-Service driver """ + STORAGE = StorageProvider + + +DriverTypeFactoryMap = { + DriverType.BACKUP: get_backup_driver, + DriverType.COMPUTE: get_compute_driver, + DriverType.CONTAINER: get_container_driver, + DriverType.DNS: get_dns_driver, + DriverType.LOADBALANCER: get_loadbalancer_driver, + DriverType.STORAGE: get_storage_driver, +} # type: Dict + + +class DriverTypeNotFoundError(KeyError): + def __init__(self, type): + self.message = "Driver type '%s' not found." % type + + def __repr__(self): + return self.message + + +def get_driver(type, provider): + """ + Get a driver + """ + try: + return DriverTypeFactoryMap[type](provider) + except KeyError: + raise DriverTypeNotFoundError(type) diff --git a/libcloud/common/abiquo.py b/libcloud/common/abiquo.py index 0d52fd713c..eabc361d27 100644 --- a/libcloud/common/abiquo.py +++ b/libcloud/common/abiquo.py @@ -17,14 +17,12 @@ Common utilities needed by the :class:`AbiquoNodeDriver`. """ + import base64 -from libcloud.common.base import ConnectionUserAndKey, PollingConnection -from libcloud.common.base import XmlResponse -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlparse -from libcloud.utils.py3 import b +from libcloud.utils.py3 import b, httplib, urlparse +from libcloud.common.base import XmlResponse, PollingConnection, ConnectionUserAndKey +from libcloud.common.types import LibcloudError, InvalidCredsError from libcloud.compute.base import NodeState @@ -76,19 +74,19 @@ def get_href(element, rel): :rtype: ``str`` :return: the 'href' value according to the 'rel' input parameter """ - links = element.findall('link') + links = element.findall("link") for link in links: - if link.attrib['rel'] == rel: - href = link.attrib['href'] + if link.attrib["rel"] == rel: + href = link.attrib["href"] # href is something like: # # 'http://localhost:80/api/admin/enterprises' # # we are only interested in '/admin/enterprises/' part - needle = '/api/' + needle = "/api/" url_path = urlparse.urlparse(href).path index = url_path.find(needle) - result = url_path[index + len(needle) - 1:] + result = url_path[index + len(needle) - 1 :] return result @@ -102,14 +100,14 @@ class AbiquoResponse(XmlResponse): # Map between abiquo state and Libcloud State NODE_STATE_MAP = { - 'NOT_ALLOCATED': NodeState.TERMINATED, - 'ALLOCATED': NodeState.PENDING, - 'CONFIGURED': NodeState.PENDING, - 'ON': NodeState.RUNNING, - 'PAUSED': NodeState.PENDING, - 'OFF': NodeState.PENDING, - 'LOCKED': NodeState.PENDING, - 'UNKNOWN': NodeState.UNKNOWN + "NOT_ALLOCATED": NodeState.TERMINATED, + "ALLOCATED": NodeState.PENDING, + "CONFIGURED": NodeState.PENDING, + "ON": NodeState.RUNNING, + "PAUSED": NodeState.PENDING, + "OFF": NodeState.PENDING, + "LOCKED": NodeState.PENDING, + "UNKNOWN": NodeState.UNKNOWN, } def parse_error(self): @@ -126,13 +124,13 @@ def parse_error(self): elif self.status == httplib.FORBIDDEN: raise ForbiddenError(self.connection.driver) elif self.status == httplib.NOT_ACCEPTABLE: - raise LibcloudError('Not Acceptable') + raise LibcloudError("Not Acceptable") else: parsebody = self.parse_body() - if parsebody is not None and hasattr(parsebody, 'findall'): - errors = self.parse_body().findall('error') + if parsebody is not None and hasattr(parsebody, "findall"): + errors = self.parse_body().findall("error") # Most of the exceptions only have one error - raise LibcloudError(errors[0].findtext('message')) + raise LibcloudError(errors[0].findtext("message")) else: raise LibcloudError(self.body) @@ -145,15 +143,19 @@ def success(self): :rtype: ``bool`` :return: successful request or not. """ - return self.status in [httplib.OK, httplib.CREATED, httplib.NO_CONTENT, - httplib.ACCEPTED] + return self.status in [ + httplib.OK, + httplib.CREATED, + httplib.NO_CONTENT, + httplib.ACCEPTED, + ] def async_success(self): """ Determinate if async request was successful. An async_request retrieves for a task object that can be successfully - retrieved (self.status == OK), but the asyncronous task (the body of + retrieved (self.status == OK), but the asynchronous task (the body of the HTTP response) which we are asking for has finished with an error. So this method checks if the status code is 'OK' and if the task has finished successfully. @@ -164,7 +166,7 @@ def async_success(self): if self.success(): # So we have a 'task' object in the body task = self.parse_body() - return task.findtext('state') == 'FINISHED_SUCCESSFULLY' + return task.findtext("state") == "FINISHED_SUCCESSFULLY" else: return False @@ -179,12 +181,31 @@ class AbiquoConnection(ConnectionUserAndKey, PollingConnection): responseCls = AbiquoResponse - def __init__(self, user_id, key, secure=True, host=None, port=None, - url=None, timeout=None): - super(AbiquoConnection, self).__init__(user_id=user_id, key=key, - secure=secure, - host=host, port=port, - url=url, timeout=timeout) + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + retry_delay=None, + backoff=None, + proxy_url=None, + ): + super().__init__( + user_id=user_id, + key=key, + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + retry_delay=retry_delay, + backoff=backoff, + proxy_url=proxy_url, + ) # This attribute stores data cached across multiple request self.cache = {} @@ -203,12 +224,12 @@ def add_default_headers(self, headers): :return: Default input headers with the 'Authorization' header """ - b64string = b('%s:%s' % (self.user_id, self.key)) - encoded = base64.b64encode(b64string).decode('utf-8') + b64string = b("{}:{}".format(self.user_id, self.key)) + encoded = base64.b64encode(b64string).decode("utf-8") - authorization = 'Basic ' + encoded + authorization = "Basic " + encoded - headers['Authorization'] = authorization + headers["Authorization"] = authorization return headers def get_poll_request_kwargs(self, response, context, request_kwargs): @@ -235,14 +256,14 @@ def get_poll_request_kwargs(self, response, context, request_kwargs): :return: Modified keyword arguments """ accepted_request_obj = response.object - link_poll = get_href(accepted_request_obj, 'status') - hdr_poll = {'Accept': 'application/vnd.abiquo.task+xml'} + link_poll = get_href(accepted_request_obj, "status") + hdr_poll = {"Accept": "application/vnd.abiquo.task+xml"} # Override the 'action', 'method' and 'headers' # keys of the previous dict - request_kwargs['action'] = link_poll - request_kwargs['method'] = 'GET' - request_kwargs['headers'] = hdr_poll + request_kwargs["action"] = link_poll + request_kwargs["method"] = "GET" + request_kwargs["headers"] = hdr_poll return request_kwargs def has_completed(self, response): @@ -255,9 +276,12 @@ def has_completed(self, response): :return: Whether the job has completed """ task = response.object - task_state = task.findtext('state') - return task_state in ['FINISHED_SUCCESSFULLY', 'ABORTED', - 'FINISHED_UNSUCCESSFULLY'] + task_state = task.findtext("state") + return task_state in [ + "FINISHED_SUCCESSFULLY", + "ABORTED", + "FINISHED_UNSUCCESSFULLY", + ] class ForbiddenError(LibcloudError): @@ -266,5 +290,5 @@ class ForbiddenError(LibcloudError): """ def __init__(self, driver): - message = 'User has not permission to perform this task.' - super(LibcloudError, self).__init__(message, driver) + message = "User has not permission to perform this task." + super().__init__(message, driver) diff --git a/libcloud/common/aliyun.py b/libcloud/common/aliyun.py new file mode 100644 index 0000000000..2414432df4 --- /dev/null +++ b/libcloud/common/aliyun.py @@ -0,0 +1,246 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import hmac +import time +import uuid +import base64 +import hashlib + +from libcloud.utils.py3 import ET, b, u, urlquote +from libcloud.utils.xml import findtext +from libcloud.common.base import XmlResponse, ConnectionUserAndKey +from libcloud.common.types import MalformedResponseError + +__all__ = [ + "AliyunXmlResponse", + "AliyunRequestSigner", + "AliyunRequestSignerAlgorithmV1_0", + "SignedAliyunConnection", + "AliyunConnection", + "SIGNATURE_VERSION_1_0", + "DEFAULT_SIGNATURE_VERSION", +] + +SIGNATURE_VERSION_1_0 = "1.0" +DEFAULT_SIGNATURE_VERSION = SIGNATURE_VERSION_1_0 + + +class AliyunXmlResponse(XmlResponse): + namespace = None + + def success(self): + return 200 <= self.status < 300 + + def parse_body(self): + """ + Each response from Aliyun contains a request id and a host id. + The response body is in utf-8 encoding. + """ + if len(self.body) == 0 and not self.parse_zero_length_body: + return self.body + + try: + parser = ET.XMLParser(encoding="utf-8") + body = ET.XML(self.body.encode("utf-8"), parser=parser) + except Exception: + raise MalformedResponseError( + "Failed to parse XML", body=self.body, driver=self.connection.driver + ) + self.request_id = findtext(element=body, xpath="RequestId", namespace=self.namespace) + self.host_id = findtext(element=body, xpath="HostId", namespace=self.namespace) + return body + + def parse_error(self): + """ + Parse error responses from Aliyun. + """ + body = super().parse_error() + code, message = self._parse_error_details(element=body) + request_id = findtext(element=body, xpath="RequestId", namespace=self.namespace) + host_id = findtext(element=body, xpath="HostId", namespace=self.namespace) + error = { + "code": code, + "message": message, + "request_id": request_id, + "host_id": host_id, + } + return u(error) + + def _parse_error_details(self, element): + """ + Parse error code and message from the provided error element. + + :return: ``tuple`` with two elements: (code, message) + :rtype: ``tuple`` + """ + code = findtext(element=element, xpath="Code", namespace=self.namespace) + message = findtext(element=element, xpath="Message", namespace=self.namespace) + + return (code, message) + + +class AliyunRequestSigner: + """ + Class handles signing the outgoing Aliyun requests. + """ + + def __init__(self, access_key, access_secret, version): + """ + :param access_key: Access key. + :type access_key: ``str`` + + :param access_secret: Access secret. + :type access_secret: ``str`` + + :param version: API version. + :type version: ``str`` + """ + self.access_key = access_key + self.access_secret = access_secret + self.version = version + + def get_request_params(self, params, method="GET", path="/"): + return params + + def get_request_headers(self, params, headers, method="GET", path="/"): + return params, headers + + +class AliyunRequestSignerAlgorithmV1_0(AliyunRequestSigner): + """Aliyun request signer using signature version 1.0.""" + + def get_request_params(self, params, method="GET", path="/"): + params["Format"] = "XML" + params["Version"] = self.version + params["AccessKeyId"] = self.access_key + params["SignatureMethod"] = "HMAC-SHA1" + params["SignatureVersion"] = SIGNATURE_VERSION_1_0 + params["SignatureNonce"] = _get_signature_nonce() + # TODO: Support 'ResourceOwnerAccount' + params["Timestamp"] = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) + params["Signature"] = self._sign_request(params, method, path) + return params + + def _sign_request(self, params, method, path): + """ + Sign Aliyun requests parameters and get the signature. + + StringToSign = HTTPMethod + '&' + + percentEncode('/') + '&' + + percentEncode(CanonicalizedQueryString) + """ + keys = list(params.keys()) + keys.sort() + pairs = [] + for key in keys: + pairs.append("{}={}".format(_percent_encode(key), _percent_encode(params[key]))) + qs = urlquote("&".join(pairs), safe="-_.~") + string_to_sign = "&".join((method, urlquote(path, safe=""), qs)) + b64_hmac = base64.b64encode( + hmac.new( + b(self._get_access_secret()), b(string_to_sign), digestmod=hashlib.sha1 + ).digest() + ) + + return b64_hmac.decode("utf8") + + def _get_access_secret(self): + return "%s&" % self.access_secret + + +class AliyunConnection(ConnectionUserAndKey): + pass + + +class SignedAliyunConnection(AliyunConnection): + api_version = None + + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + retry_delay=None, + backoff=None, + api_version=None, + signature_version=DEFAULT_SIGNATURE_VERSION, + ): + super().__init__( + user_id=user_id, + key=key, + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + proxy_url=proxy_url, + retry_delay=retry_delay, + backoff=backoff, + ) + + self.signature_version = str(signature_version) + + if self.signature_version == "1.0": + signer_cls = AliyunRequestSignerAlgorithmV1_0 + else: + raise ValueError("Unsupported signature_version: %s" % signature_version) + + if api_version is not None: + self.api_version = str(api_version) + else: + if self.api_version is None: + raise ValueError("Unsupported null api_version") + + self.signer = signer_cls( + access_key=self.user_id, access_secret=self.key, version=self.api_version + ) + + def add_default_params(self, params): + params = self.signer.get_request_params(params=params, method=self.method, path=self.action) + return params + + +def _percent_encode(encode_str): + """ + Encode string to utf8, quote for url and replace '+' with %20, + '*' with %2A and keep '~' not converted. + + :param src_str: ``str`` in the same encoding with sys.stdin, + default to encoding cp936. + :return: ``str`` represents the encoded result + :rtype: ``str`` + """ + encoding = sys.stdin.encoding or "cp936" + decoded = str(encode_str) + + if isinstance(encode_str, bytes): + decoded = encode_str.decode(encoding) + + res = urlquote(decoded.encode("utf8"), "") + res = res.replace("+", "%20") + res = res.replace("*", "%2A") + res = res.replace("%7E", "~") + return res + + +def _get_signature_nonce(): + return str(uuid.uuid4()) diff --git a/libcloud/common/aws.py b/libcloud/common/aws.py index 45239e6e3b..70a395bd58 100644 --- a/libcloud/common/aws.py +++ b/libcloud/common/aws.py @@ -13,37 +13,54 @@ # See the License for the specific language governing permissions and # limitations under the License. -import base64 -from datetime import datetime -import hashlib import hmac import time +import base64 +import hashlib +from typing import Dict, Type, Optional from hashlib import sha256 +from datetime import datetime, timezone + +from libcloud.utils.py3 import ET, b, httplib, urlquote, basestring, _real_unicode +from libcloud.utils.xml import findall_ignore_namespace, findtext_ignore_namespace +from libcloud.common.base import BaseDriver, XmlResponse, JsonResponse, ConnectionUserAndKey +from libcloud.common.types import InvalidCredsError, MalformedResponseError try: - from lxml import etree as ET + import simplejson as json except ImportError: - from xml.etree import ElementTree as ET + import json # type: ignore -from libcloud.common.base import ConnectionUserAndKey, XmlResponse, BaseDriver -from libcloud.common.types import InvalidCredsError, MalformedResponseError -from libcloud.utils.py3 import b, httplib, urlquote -from libcloud.utils.xml import findtext, findall __all__ = [ - 'AWSBaseResponse', - 'AWSGenericResponse', + "AWSBaseResponse", + "AWSGenericResponse", + "AWSTokenConnection", + "SignedAWSConnection", + "AWSRequestSignerAlgorithmV2", + "AWSRequestSignerAlgorithmV4", + "AWSDriver", +] - 'AWSTokenConnection', - 'SignedAWSConnection', +DEFAULT_SIGNATURE_VERSION = "2" +UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD" - 'AWSRequestSignerAlgorithmV2', - 'AWSRequestSignerAlgorithmV4', +PARAMS_NOT_STRING_ERROR_MSG = """ +"params" dictionary contains an attribute "%s" which value (%s, %s) is not a +string. - 'AWSDriver' -] +Parameters are sent via query parameters and not via request body and as such, +all the values need to be of a simple type (string, int, bool). -DEFAULT_SIGNATURE_VERSION = '2' +For arrays and other complex types, you should use notation similar to this +one: + +params['TagSpecification.1.Tag.Value'] = 'foo' +params['TagSpecification.2.Tag.Value'] = 'bar' + +See https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html +for details. +""".strip() class AWSBaseResponse(XmlResponse): @@ -56,10 +73,10 @@ def _parse_error_details(self, element): :return: ``tuple`` with two elements: (code, message) :rtype: ``tuple`` """ - code = findtext(element=element, xpath='Code', - namespace=self.namespace) - message = findtext(element=element, xpath='Message', - namespace=self.namespace) + code = findtext_ignore_namespace(element=element, xpath="Code", namespace=self.namespace) + message = findtext_ignore_namespace( + element=element, xpath="Message", namespace=self.namespace + ) return code, message @@ -74,7 +91,7 @@ class AWSGenericResponse(AWSBaseResponse): # exception class that is raised immediately. # If a custom exception class is not defined, errors are accumulated and # returned from the parse_error method. - expections = {} + exceptions = {} # type: Dict[str, Type[Exception]] def success(self): return self.status in [httplib.OK, httplib.CREATED, httplib.ACCEPTED] @@ -87,20 +104,21 @@ def parse_error(self): # corresponding XML. if status == httplib.FORBIDDEN: if not self.body: - raise InvalidCredsError(str(self.status) + ': ' + self.error) + raise InvalidCredsError(str(self.status) + ": " + self.error) else: raise InvalidCredsError(self.body) try: body = ET.XML(self.body) except Exception: - raise MalformedResponseError('Failed to parse XML', - body=self.body, - driver=self.connection.driver) + raise MalformedResponseError( + "Failed to parse XML", body=self.body, driver=self.connection.driver + ) if self.xpath: - errs = findall(element=body, xpath=self.xpath, - namespace=self.namespace) + errs = findall_ignore_namespace( + element=body, xpath=self.xpath, namespace=self.namespace + ) else: errs = [body] @@ -110,44 +128,64 @@ def parse_error(self): exceptionCls = self.exceptions.get(code, None) if exceptionCls is None: - msgs.append('%s: %s' % (code, message)) + msgs.append("{}: {}".format(code, message)) continue # Custom exception class is defined, immediately throw an exception params = {} - if hasattr(exceptionCls, 'kwargs'): + if hasattr(exceptionCls, "kwargs"): for key in exceptionCls.kwargs: if key in context: params[key] = context[key] - raise exceptionCls(value=message, driver=self.connection.driver, - **params) + raise exceptionCls(value=message, driver=self.connection.driver, **params) return "\n".join(msgs) class AWSTokenConnection(ConnectionUserAndKey): - def __init__(self, user_id, key, secure=True, - host=None, port=None, url=None, timeout=None, token=None): + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + token=None, + retry_delay=None, + backoff=None, + ): self.token = token - super(AWSTokenConnection, self).__init__(user_id, key, secure=secure, - host=host, port=port, url=url, - timeout=timeout) + super().__init__( + user_id, + key, + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + retry_delay=retry_delay, + backoff=backoff, + proxy_url=proxy_url, + ) def add_default_params(self, params): # Even though we are adding it to the headers, we need it here too # so that the token is added to the signature. if self.token: - params['x-amz-security-token'] = self.token - return super(AWSTokenConnection, self).add_default_params(params) + params["x-amz-security-token"] = self.token + return super().add_default_params(params) def add_default_headers(self, headers): if self.token: - headers['x-amz-security-token'] = self.token - return super(AWSTokenConnection, self).add_default_headers(headers) + headers["x-amz-security-token"] = self.token + return super().add_default_headers(headers) -class AWSRequestSigner(object): +class AWSRequestSigner: """ Class which handles signing the outgoing AWS requests. """ @@ -172,28 +210,26 @@ def __init__(self, access_key, access_secret, version, connection): # TODO: Remove cycling dependency between connection and signer self.connection = connection - def get_request_params(self, params, method='GET', path='/'): + def get_request_params(self, params, method="GET", path="/"): return params - def get_request_headers(self, params, headers, method='GET', path='/'): + def get_request_headers(self, params, headers, method="GET", path="/", data=None): return params, headers class AWSRequestSignerAlgorithmV2(AWSRequestSigner): - def get_request_params(self, params, method='GET', path='/'): - params['SignatureVersion'] = '2' - params['SignatureMethod'] = 'HmacSHA256' - params['AWSAccessKeyId'] = self.access_key - params['Version'] = self.version - params['Timestamp'] = time.strftime('%Y-%m-%dT%H:%M:%SZ', - time.gmtime()) - params['Signature'] = self._get_aws_auth_param( - params=params, - secret_key=self.access_secret, - path=path) + def get_request_params(self, params, method="GET", path="/"): + params["SignatureVersion"] = "2" + params["SignatureMethod"] = "HmacSHA256" + params["AWSAccessKeyId"] = self.access_key + params["Version"] = self.version + params["Timestamp"] = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) + params["Signature"] = self._get_aws_auth_param( + params=params, secret_key=self.access_secret, path=path + ) return params - def _get_aws_auth_param(self, params, secret_key, path='/'): + def _get_aws_auth_param(self, params, secret_key, path="/"): """ Creates the signature required for AWS, per http://bit.ly/aR7GaQ [docs.amazonwebservices.com]: @@ -210,156 +246,240 @@ def _get_aws_auth_param(self, params, secret_key, path='/'): pairs = [] for key in keys: value = str(params[key]) - pairs.append(urlquote(key, safe='') + '=' + - urlquote(value, safe='-_~')) + pairs.append(urlquote(key, safe="") + "=" + urlquote(value, safe="-_~")) - qs = '&'.join(pairs) + qs = "&".join(pairs) hostname = connection.host - if (connection.secure and connection.port != 443) or \ - (not connection.secure and connection.port != 80): - hostname += ':' + str(connection.port) + if (connection.secure and connection.port != 443) or ( + not connection.secure and connection.port != 80 + ): + hostname += ":" + str(connection.port) - string_to_sign = '\n'.join(('GET', hostname, path, qs)) + string_to_sign = "\n".join(("GET", hostname, path, qs)) b64_hmac = base64.b64encode( - hmac.new(b(secret_key), b(string_to_sign), - digestmod=sha256).digest() + hmac.new(b(secret_key), b(string_to_sign), digestmod=sha256).digest() ) - return b64_hmac.decode('utf-8') + return b64_hmac.decode("utf-8") class AWSRequestSignerAlgorithmV4(AWSRequestSigner): - def get_request_params(self, params, method='GET', path='/'): - params['Version'] = self.version + def get_request_params(self, params, method="GET", path="/"): + if method == "GET": + params["Version"] = self.version return params - def get_request_headers(self, params, headers, method='GET', path='/'): - now = datetime.utcnow() - headers['X-AMZ-Date'] = now.strftime('%Y%m%dT%H%M%SZ') - headers['Authorization'] = \ - self._get_authorization_v4_header(params=params, headers=headers, - dt=now, method=method, path=path) + def get_request_headers(self, params, headers, method="GET", path="/", data=None): + now = datetime.now(timezone.utc).replace(tzinfo=None) + headers["X-AMZ-Date"] = now.strftime("%Y%m%dT%H%M%SZ") + headers["X-AMZ-Content-SHA256"] = self._get_payload_hash(method, data) + headers["Authorization"] = self._get_authorization_v4_header( + params=params, headers=headers, dt=now, method=method, path=path, data=data + ) return params, headers - def _get_authorization_v4_header(self, params, headers, dt, method='GET', - path='/'): - assert method == 'GET', 'AWS Signature V4 not implemented for ' \ - 'other methods than GET' - + def _get_authorization_v4_header(self, params, headers, dt, method="GET", path="/", data=None): credentials_scope = self._get_credential_scope(dt=dt) signed_headers = self._get_signed_headers(headers=headers) - signature = self._get_signature(params=params, headers=headers, - dt=dt, method=method, path=path) - - return 'AWS4-HMAC-SHA256 Credential=%(u)s/%(c)s, ' \ - 'SignedHeaders=%(sh)s, Signature=%(s)s' % { - 'u': self.access_key, - 'c': credentials_scope, - 'sh': signed_headers, - 's': signature - } - - def _get_signature(self, params, headers, dt, method, path): + signature = self._get_signature( + params=params, headers=headers, dt=dt, method=method, path=path, data=data + ) + + return ( + "AWS4-HMAC-SHA256 Credential=%(u)s/%(c)s, " + "SignedHeaders=%(sh)s, Signature=%(s)s" + % { + "u": self.access_key, + "c": credentials_scope, + "sh": signed_headers, + "s": signature, + } + ) + + def _get_signature(self, params, headers, dt, method, path, data): key = self._get_key_to_sign_with(dt) - string_to_sign = self._get_string_to_sign(params=params, - headers=headers, dt=dt, - method=method, path=path) + string_to_sign = self._get_string_to_sign( + params=params, headers=headers, dt=dt, method=method, path=path, data=data + ) return _sign(key=key, msg=string_to_sign, hex=True) def _get_key_to_sign_with(self, dt): return _sign( _sign( _sign( - _sign(('AWS4' + self.access_secret), - dt.strftime('%Y%m%d')), - self.connection.driver.region_name), - self.connection.service_name), - 'aws4_request') - - def _get_string_to_sign(self, params, headers, dt, method, path): - canonical_request = self._get_canonical_request(params=params, - headers=headers, - method=method, - path=path) - - return '\n'.join(['AWS4-HMAC-SHA256', - dt.strftime('%Y%m%dT%H%M%SZ'), - self._get_credential_scope(dt), - _hash(canonical_request)]) + _sign(("AWS4" + self.access_secret), dt.strftime("%Y%m%d")), + self.connection.driver.region_name, + ), + self.connection.service_name, + ), + "aws4_request", + ) + + def _get_string_to_sign(self, params, headers, dt, method, path, data): + canonical_request = self._get_canonical_request( + params=params, headers=headers, method=method, path=path, data=data + ) + + return "\n".join( + [ + "AWS4-HMAC-SHA256", + dt.strftime("%Y%m%dT%H%M%SZ"), + self._get_credential_scope(dt), + _hash(canonical_request), + ] + ) def _get_credential_scope(self, dt): - return '/'.join([dt.strftime('%Y%m%d'), - self.connection.driver.region_name, - self.connection.service_name, - 'aws4_request']) + return "/".join( + [ + dt.strftime("%Y%m%d"), + self.connection.driver.region_name, + self.connection.service_name, + "aws4_request", + ] + ) def _get_signed_headers(self, headers): - return ';'.join([k.lower() for k in sorted(headers.keys())]) + return ";".join([k.lower() for k in sorted(headers.keys(), key=str.lower)]) def _get_canonical_headers(self, headers): - return '\n'.join([':'.join([k.lower(), v.strip()]) - for k, v in sorted(headers.items())]) + '\n' + return ( + "\n".join( + [ + ":".join([k.lower(), str(v).strip()]) + for k, v in sorted(headers.items(), key=lambda k: k[0].lower()) + ] + ) + + "\n" + ) - def _get_payload_hash(self): - return _hash('') + def _get_payload_hash(self, method, data=None): + if data is UnsignedPayloadSentinel: + return UNSIGNED_PAYLOAD + if method in ("POST", "PUT"): + if data: + if hasattr(data, "next") or hasattr(data, "__next__"): + # File upload; don't try to read the entire payload + return UNSIGNED_PAYLOAD + return _hash(data) + else: + return UNSIGNED_PAYLOAD + else: + return _hash("") def _get_request_params(self, params): # For self.method == GET - return '&'.join(["%s=%s" % - (urlquote(k, safe=''), urlquote(str(v), safe='~')) - for k, v in sorted(params.items())]) + return "&".join( + [ + "{}={}".format(urlquote(k, safe=""), urlquote(str(v), safe="~")) + for k, v in sorted(params.items()) + ] + ) + + def _get_canonical_request(self, params, headers, method, path, data): + return "\n".join( + [ + method, + path, + self._get_request_params(params), + self._get_canonical_headers(headers), + self._get_signed_headers(headers), + self._get_payload_hash(method, data), + ] + ) + - def _get_canonical_request(self, params, headers, method, path): - return '\n'.join([ - method, - path, - self._get_request_params(params), - self._get_canonical_headers(headers), - self._get_signed_headers(headers), - self._get_payload_hash() - ]) +class UnsignedPayloadSentinel: + pass class SignedAWSConnection(AWSTokenConnection): - def __init__(self, user_id, key, secure=True, host=None, port=None, - url=None, timeout=None, token=None, - signature_version=DEFAULT_SIGNATURE_VERSION): - super(SignedAWSConnection, self).__init__(user_id=user_id, key=key, - secure=secure, host=host, - port=port, url=url, - timeout=timeout, token=token) + version = None # type: Optional[str] + + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + token=None, + retry_delay=None, + backoff=None, + signature_version=DEFAULT_SIGNATURE_VERSION, + ): + super().__init__( + user_id=user_id, + key=key, + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + token=token, + retry_delay=retry_delay, + backoff=backoff, + proxy_url=proxy_url, + ) self.signature_version = str(signature_version) - if self.signature_version == '2': + if self.signature_version == "2": signer_cls = AWSRequestSignerAlgorithmV2 - elif signature_version == '4': + elif self.signature_version == "4": signer_cls = AWSRequestSignerAlgorithmV4 else: - raise ValueError('Unsupported signature_version: %s' % - (signature_version)) + raise ValueError("Unsupported signature_version: %s" % (signature_version)) - self.signer = signer_cls(access_key=self.user_id, - access_secret=self.key, - version=self.version, - connection=self) + self.signer = signer_cls( + access_key=self.user_id, + access_secret=self.key, + version=self.version, + connection=self, + ) def add_default_params(self, params): - params = self.signer.get_request_params(params=params, - method=self.method, - path=self.action) + params = self.signer.get_request_params(params=params, method=self.method, path=self.action) + + # Verify that params only contain simple types and no nested + # dictionaries. + # params are sent via query params so only strings are supported + for key, value in params.items(): + if not isinstance(value, (_real_unicode, basestring, int, bool)): + msg = PARAMS_NOT_STRING_ERROR_MSG % (key, value, type(value)) + raise ValueError(msg) + return params def pre_connect_hook(self, params, headers): - params, headers = self.signer.get_request_headers(params=params, - headers=headers, - method=self.method, - path=self.action) + params, headers = self.signer.get_request_headers( + params=params, + headers=headers, + method=self.method, + path=self.action, + data=self.data, + ) return params, headers +class AWSJsonResponse(JsonResponse): + """ + Amazon ECS response class. + ECS API uses JSON unlike the s3, elb drivers + """ + + def parse_error(self): + response = json.loads(self.body) + code = response["__type"] + message = response.get("Message", response["message"]) + return "{}: {}".format(code, message) + + def _sign(key, msg, hex=False): if hex: return hmac.new(b(key), b(msg), hashlib.sha256).hexdigest() @@ -372,15 +492,32 @@ def _hash(msg): class AWSDriver(BaseDriver): - def __init__(self, key, secret=None, secure=True, host=None, port=None, - api_version=None, region=None, token=None, **kwargs): + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=None, + token=None, + **kwargs, + ): self.token = token - super(AWSDriver, self).__init__(key, secret=secret, secure=secure, - host=host, port=port, - api_version=api_version, region=region, - token=token, **kwargs) + super().__init__( + key, + secret=secret, + secure=secure, + host=host, + port=port, + api_version=api_version, + region=region, + token=token, + **kwargs, + ) def _ex_connection_class_kwargs(self): - kwargs = super(AWSDriver, self)._ex_connection_class_kwargs() - kwargs['token'] = self.token + kwargs = super()._ex_connection_class_kwargs() + kwargs["token"] = self.token return kwargs diff --git a/libcloud/common/azure.py b/libcloud/common/azure.py index bd3c5040ce..cce42df901 100644 --- a/libcloud/common/azure.py +++ b/libcloud/common/azure.py @@ -13,50 +13,45 @@ # See the License for the specific language governing permissions and # limitations under the License. -import copy import os +import copy +import hmac import time import base64 -import hmac - from hashlib import sha256 -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import b -from libcloud.utils.xml import fixxpath - -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET -from libcloud.common.types import InvalidCredsError -from libcloud.common.types import LibcloudError, MalformedResponseError -from libcloud.common.base import ConnectionUserAndKey, RawResponse -from libcloud.common.base import CertificateConnection -from libcloud.common.base import XmlResponse - -# Azure API version -API_VERSION = '2012-02-12' +from libcloud.http import LibcloudConnection +from libcloud.utils.py3 import ET, b, httplib, urlparse, urlencode, basestring +from libcloud.utils.xml import fixxpath +from libcloud.common.base import ( + BaseDriver, + RawResponse, + XmlResponse, + ConnectionUserAndKey, + CertificateConnection, +) +from libcloud.common.types import LibcloudError, InvalidCredsError, MalformedResponseError +from libcloud.common.azure_arm import AzureAuthJsonResponse, publicEnvironments # The time format for headers in Azure requests -AZURE_TIME_FORMAT = '%a, %d %b %Y %H:%M:%S GMT' +AZURE_TIME_FORMAT = "%a, %d %b %Y %H:%M:%S GMT" class AzureRedirectException(Exception): - def __init__(self, response): - self.location = response.headers['location'] + self.location = response.headers["location"] class AzureResponse(XmlResponse): - valid_response_codes = [ httplib.NOT_FOUND, httplib.CONFLICT, httplib.BAD_REQUEST, - httplib.TEMPORARY_REDIRECT # added TEMPORARY_REDIRECT as this can sometimes be # sent by azure instead of a success or fail response + httplib.TEMPORARY_REDIRECT, + # Used by Azure Blobs range downloads + httplib.PARTIAL_CONTENT, ] def success(self): @@ -64,32 +59,30 @@ def success(self): return 200 <= i <= 299 or i in self.valid_response_codes def parse_error(self, msg=None): - error_msg = 'Unknown error' + error_msg = "Unknown error" try: # Azure does give some meaningful errors, but is inconsistent # Some APIs respond with an XML error. Others just dump HTML body = self.parse_body() + # pylint: disable=no-member if type(body) == ET.Element: - code = body.findtext(fixxpath(xpath='Code')) - message = body.findtext(fixxpath(xpath='Message')) - message = message.split('\n')[0] - error_msg = '%s: %s' % (code, message) + code = body.findtext(fixxpath(xpath="Code")) + message = body.findtext(fixxpath(xpath="Message")) + message = message.split("\n")[0] + error_msg = "{}: {}".format(code, message) except MalformedResponseError: pass if msg: - error_msg = '%s - %s' % (msg, error_msg) + error_msg = "{} - {}".format(msg, error_msg) if self.status in [httplib.UNAUTHORIZED, httplib.FORBIDDEN]: raise InvalidCredsError(error_msg) - raise LibcloudError( - '%s Status code: %d.' % (error_msg, self.status), - driver=self - ) + raise LibcloudError("%s Status code: %d." % (error_msg, self.status), driver=self) def parse_body(self): is_redirect = int(self.status) == httplib.TEMPORARY_REDIRECT @@ -97,13 +90,125 @@ def parse_body(self): if is_redirect and self.connection.driver.follow_redirects: raise AzureRedirectException(self) else: - return super(AzureResponse, self).parse_body() + return super().parse_body() class AzureRawResponse(RawResponse): pass +class AzureBaseDriver(BaseDriver): + name = "Microsoft Azure Service Management API" + + +class AzureActiveDirectoryConnection(ConnectionUserAndKey): + """ + Represents a single connection to Azure using Azure AD for Blob + """ + + conn_class = LibcloudConnection + driver = AzureBaseDriver + name = "Azure AD Auth" + responseCls = AzureResponse + rawResponseCls = AzureRawResponse + + API_VERSION = "2017-11-09" + + def __init__( + self, + key, + secret, + secure=True, + host=None, + port=None, + tenant_id=None, + identity=None, + cloud_environment="default", + **kwargs, + ): + super().__init__(identity, secret, **kwargs) + if isinstance(cloud_environment, basestring): + cloud_environment = publicEnvironments[cloud_environment] + if not isinstance(cloud_environment, dict): + raise Exception( + "cloud_environment must be one of '%s' or a dict " + "containing keys 'resourceManagerEndpointUrl', " + "'activeDirectoryEndpointUrl', " + "'activeDirectoryResourceId', " + "'storageEndpointSuffix'" % ("', '".join(publicEnvironments.keys())) + ) + + self.login_host = urlparse.urlparse( + cloud_environment["activeDirectoryEndpointUrl"] + ).hostname + self.login_resource = cloud_environment["activeDirectoryResourceId"] + self.host = host + self.identity = identity + self.tenant_id = tenant_id + self.storage_account_id = key + + def add_default_headers(self, headers): + headers["x-ms-date"] = time.strftime(AZURE_TIME_FORMAT, time.gmtime()) + headers["x-ms-version"] = self.API_VERSION + headers["Content-Type"] = "application/xml" + headers["Authorization"] = "Bearer %s" % self.access_token + return headers + + def get_client_credentials(self): + """ + Log in and get bearer token used to authorize API requests. + """ + conn = self.conn_class(self.login_host, 443, timeout=self.timeout) + conn.connect() + params = urlencode( + { + "grant_type": "client_credentials", + "client_id": self.user_id, + "client_secret": self.key, + "resource": "https://storage.azure.com/", + } + ) + headers = {"Content-type": "application/x-www-form-urlencoded"} + conn.request("POST", "/%s/oauth2/token" % self.tenant_id, params, headers) + js = AzureAuthJsonResponse(conn.getresponse(), conn) + self.access_token = js.object["access_token"] + self.expires_on = js.object["expires_on"] + + def connect(self, **kwargs): + self.get_client_credentials() + return super().connect(**kwargs) + + def request( + self, + action, + params=None, + data=None, + headers=None, + method="GET", + raw=False, + stream=False, + json=None, + retry_failed=None, + *kwargs, + ): + # Log in again if the token has expired or is going to expire soon + # (next 5 minutes). + if (time.time() + 300) >= int(self.expires_on): + self.get_client_credentials() + + return super().request( + action, + params=params, + data=data, + headers=headers, + method=method, + raw=raw, + stream=stream, + json=json, + retry_failed=retry_failed, + ) + + class AzureConnection(ConnectionUserAndKey): """ Represents a single connection to Azure @@ -112,6 +217,8 @@ class AzureConnection(ConnectionUserAndKey): responseCls = AzureResponse rawResponseCls = AzureRawResponse + API_VERSION = "2012-02-12" + def add_default_params(self, params): return params @@ -119,31 +226,25 @@ def pre_connect_hook(self, params, headers): headers = copy.deepcopy(headers) # We have to add a date header in GMT - headers['x-ms-date'] = time.strftime(AZURE_TIME_FORMAT, time.gmtime()) - headers['x-ms-version'] = API_VERSION + headers["x-ms-date"] = time.strftime(AZURE_TIME_FORMAT, time.gmtime()) + headers["x-ms-version"] = self.API_VERSION # Add the authorization header - headers['Authorization'] = self._get_azure_auth_signature( + headers["Authorization"] = self._get_azure_auth_signature( method=self.method, headers=headers, params=params, account=self.user_id, secret_key=self.key, - path=self.action + path=self.action, ) # Azure cribs about this in 'raw' connections - headers.pop('Host', None) + headers.pop("Host", None) return params, headers - def _get_azure_auth_signature(self, - method, - headers, - params, - account, - secret_key, - path='/'): + def _get_azure_auth_signature(self, method, headers, params, account, secret_key, path="/"): """ Signature = Base64( HMAC-SHA1( YourSecretAccessKeyID, UTF-8-Encoding-Of( StringToSign ) ) ) ); @@ -163,22 +264,8 @@ def _get_azure_auth_signature(self, CanonicalizedHeaders + CanonicalizedResource; """ - special_header_values = [] xms_header_values = [] param_list = [] - special_header_keys = [ - 'content-encoding', - 'content-language', - 'content-length', - 'content-md5', - 'content-type', - 'date', - 'if-modified-since', - 'if-match', - 'if-none-match', - 'if-unmodified-since', - 'range' - ] # Split the x-ms headers and normal headers and make everything # lower case @@ -186,18 +273,13 @@ def _get_azure_auth_signature(self, for header, value in headers.items(): header = header.lower() value = str(value).strip() - if header.startswith('x-ms-'): + if header.startswith("x-ms-"): xms_header_values.append((header, value)) else: headers_copy[header] = value # Get the values for the headers in the specific order - for header in special_header_keys: - header = header.lower() # Just for safety - if header in headers_copy: - special_header_values.append(headers_copy[header]) - else: - special_header_values.append('') + special_header_values = self._format_special_header_values(headers_copy, method) # Prepare the first section of the string to be signed values_to_sign = [method] + special_header_values @@ -207,10 +289,10 @@ def _get_azure_auth_signature(self, xms_header_values.sort() for header, value in xms_header_values: - values_to_sign.append('%s:%s' % (header, value)) + values_to_sign.append("{}:{}".format(header, value)) # Add the canonicalized path - values_to_sign.append('/%s%s' % (account, path)) + values_to_sign.append("/{}{}".format(account, path)) # URL query parameters (sorted and lower case) for key, value in params.items(): @@ -219,19 +301,46 @@ def _get_azure_auth_signature(self, param_list.sort() for key, value in param_list: - values_to_sign.append('%s:%s' % (key, value)) + values_to_sign.append("{}:{}".format(key, value)) - string_to_sign = b('\n'.join(values_to_sign)) + string_to_sign = b("\n".join(values_to_sign)) secret_key = b(secret_key) - b64_hmac = base64.b64encode( - hmac.new(secret_key, string_to_sign, digestmod=sha256).digest() - ) + b64_hmac = base64.b64encode(hmac.new(secret_key, string_to_sign, digestmod=sha256).digest()) - return 'SharedKey %s:%s' % (self.user_id, b64_hmac.decode('utf-8')) + return "SharedKey {}:{}".format(self.user_id, b64_hmac.decode("utf-8")) + def _format_special_header_values(self, headers, method): + is_change = method not in ("GET", "HEAD") + is_old_api = self.API_VERSION <= "2014-02-14" -class AzureBaseDriver(object): - name = "Microsoft Azure Service Management API" + special_header_keys = [ + "content-encoding", + "content-language", + "content-length", + "content-md5", + "content-type", + "date", + "if-modified-since", + "if-match", + "if-none-match", + "if-unmodified-since", + "range", + ] + + special_header_values = [] + + for header in special_header_keys: + header = header.lower() # Just for safety + if header in headers: + special_header_values.append(headers[header]) + elif header == "content-length" and is_change and is_old_api: + # For old API versions, the Content-Length header must be '0' + # https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key#content-length-header-in-version-2014-02-14-and-earlier + special_header_values.append("0") + else: + special_header_values.append("") + + return special_header_values class AzureServiceManagementConnection(CertificateConnection): @@ -249,8 +358,8 @@ class AzureServiceManagementConnection(CertificateConnection): driver = AzureBaseDriver responseCls = AzureResponse rawResponseCls = AzureRawResponse - name = 'Azure Service Management API Connection' - host = 'management.core.windows.net' + name = "Azure Service Management API Connection" + host = "management.core.windows.net" keyfile = "" def __init__(self, subscription_id, key_file, *args, **kwargs): @@ -265,11 +374,7 @@ def __init__(self, subscription_id, key_file, *args, **kwargs): :type key_file: ``str`` """ - super(AzureServiceManagementConnection, self).__init__( - key_file, - *args, - **kwargs - ) + super().__init__(key_file, *args, **kwargs) self.subscription_id = subscription_id @@ -278,8 +383,8 @@ def __init__(self, subscription_id, key_file, *args, **kwargs): is_file_path = os.path.exists(keypath) and os.path.isfile(keypath) if not is_file_path: raise InvalidCredsError( - 'You need an certificate PEM file to authenticate with ' - 'Microsoft Azure. This can be found in the portal.' + "You need an certificate PEM file to authenticate with " + "Microsoft Azure. This can be found in the portal." ) self.key_file = key_file @@ -288,7 +393,7 @@ def add_default_headers(self, headers): @inherits: :class:`Connection.add_default_headers` TODO: move to constant.. """ - headers['x-ms-version'] = "2014-05-01" - headers['x-ms-date'] = time.strftime(AZURE_TIME_FORMAT, time.gmtime()) + headers["x-ms-version"] = "2014-05-01" + headers["x-ms-date"] = time.strftime(AZURE_TIME_FORMAT, time.gmtime()) # headers['host'] = self.host return headers diff --git a/libcloud/common/azure_arm.py b/libcloud/common/azure_arm.py new file mode 100644 index 0000000000..3a60c15b56 --- /dev/null +++ b/libcloud/common/azure_arm.py @@ -0,0 +1,219 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import simplejson as json +except ImportError: + import json # type: ignore + +import time + +from libcloud.http import LibcloudConnection +from libcloud.utils.py3 import urlparse, urlencode, basestring +from libcloud.common.base import BaseDriver, RawResponse, JsonResponse, ConnectionUserAndKey + + +class AzureBaseDriver(BaseDriver): + name = "Microsoft Azure Resource Management API" + + +class AzureJsonResponse(JsonResponse): + def parse_error(self): + b = self.parse_body() + + if isinstance(b, basestring): + return b + elif isinstance(b, dict) and "error" in b: + return "[{}] {}".format(b["error"].get("code"), b["error"].get("message")) + else: + return str(b) + + +class AzureAuthJsonResponse(JsonResponse): + def parse_error(self): + b = self.parse_body() + + if isinstance(b, basestring): + return b + elif isinstance(b, dict) and "error_description" in b: + return b["error_description"] + else: + return str(b) + + +# Based on +# https://github.com/Azure/azure-xplat-cli/blob/master/lib/util/profile/environment.js +publicEnvironments = { + "default": { + "name": "default", + "portalUrl": "http://go.microsoft.com/fwlink/?LinkId=254433", + "publishingProfileUrl": "http://go.microsoft.com/fwlink/?LinkId=254432", + "managementEndpointUrl": "https://management.core.windows.net", + "resourceManagerEndpointUrl": "https://management.azure.com/", + "sqlManagementEndpointUrl": "https://management.core.windows.net:8443/", + "sqlServerHostnameSuffix": ".database.windows.net", + "galleryEndpointUrl": "https://gallery.azure.com/", + "activeDirectoryEndpointUrl": "https://login.microsoftonline.com", + "activeDirectoryResourceId": "https://management.core.windows.net/", + "activeDirectoryGraphResourceId": "https://graph.windows.net/", + "activeDirectoryGraphApiVersion": "2013-04-05", + "storageEndpointSuffix": ".core.windows.net", + "keyVaultDnsSuffix": ".vault.azure.net", + "azureDataLakeStoreFileSystemEndpointSuffix": "azuredatalakestore.net", + "azureDataLakeAnalyticsCatalogAndJobEndpointSuffix": "azuredatalakeanalytics.net", + }, + "AzureChinaCloud": { + "name": "AzureChinaCloud", + "portalUrl": "http://go.microsoft.com/fwlink/?LinkId=301902", + "publishingProfileUrl": "http://go.microsoft.com/fwlink/?LinkID=301774", + "managementEndpointUrl": "https://management.core.chinacloudapi.cn", + "resourceManagerEndpointUrl": "https://management.chinacloudapi.cn", + "sqlManagementEndpointUrl": "https://management.core.chinacloudapi.cn:8443/", + "sqlServerHostnameSuffix": ".database.chinacloudapi.cn", + "galleryEndpointUrl": "https://gallery.chinacloudapi.cn/", + "activeDirectoryEndpointUrl": "https://login.chinacloudapi.cn", + "activeDirectoryResourceId": "https://management.core.chinacloudapi.cn/", + "activeDirectoryGraphResourceId": "https://graph.chinacloudapi.cn/", + "activeDirectoryGraphApiVersion": "2013-04-05", + "storageEndpointSuffix": ".core.chinacloudapi.cn", + "keyVaultDnsSuffix": ".vault.azure.cn", + "azureDataLakeStoreFileSystemEndpointSuffix": "N/A", + "azureDataLakeAnalyticsCatalogAndJobEndpointSuffix": "N/A", + }, + "AzureUSGovernment": { + "name": "AzureUSGovernment", + "portalUrl": "https://manage.windowsazure.us", + "publishingProfileUrl": "https://manage.windowsazure.us/publishsettings/index", + "managementEndpointUrl": "https://management.core.usgovcloudapi.net", + "resourceManagerEndpointUrl": "https://management.usgovcloudapi.net", + "sqlManagementEndpointUrl": "https://management.core.usgovcloudapi.net:8443/", + "sqlServerHostnameSuffix": ".database.usgovcloudapi.net", + "galleryEndpointUrl": "https://gallery.usgovcloudapi.net/", + "activeDirectoryEndpointUrl": "https://login.microsoftonline.us", + "activeDirectoryResourceId": "https://management.core.usgovcloudapi.net/", + "activeDirectoryGraphResourceId": "https://graph.windows.net/", + "activeDirectoryGraphApiVersion": "2013-04-05", + "storageEndpointSuffix": ".core.usgovcloudapi.net", + "keyVaultDnsSuffix": ".vault.usgovcloudapi.net", + "azureDataLakeStoreFileSystemEndpointSuffix": "N/A", + "azureDataLakeAnalyticsCatalogAndJobEndpointSuffix": "N/A", + }, + "AzureGermanCloud": { + "name": "AzureGermanCloud", + "portalUrl": "http://portal.microsoftazure.de/", + "publishingProfileUrl": "https://manage.microsoftazure.de/publishsettings/index", + "managementEndpointUrl": "https://management.core.cloudapi.de", + "resourceManagerEndpointUrl": "https://management.microsoftazure.de", + "sqlManagementEndpointUrl": "https://management.core.cloudapi.de:8443/", + "sqlServerHostnameSuffix": ".database.cloudapi.de", + "galleryEndpointUrl": "https://gallery.cloudapi.de/", + "activeDirectoryEndpointUrl": "https://login.microsoftonline.de", + "activeDirectoryResourceId": "https://management.core.cloudapi.de/", + "activeDirectoryGraphResourceId": "https://graph.cloudapi.de/", + "activeDirectoryGraphApiVersion": "2013-04-05", + "storageEndpointSuffix": ".core.cloudapi.de", + "keyVaultDnsSuffix": ".vault.microsoftazure.de", + "azureDataLakeStoreFileSystemEndpointSuffix": "N/A", + "azureDataLakeAnalyticsCatalogAndJobEndpointSuffix": "N/A", + }, +} + + +class AzureResourceManagementConnection(ConnectionUserAndKey): + """ + Represents a single connection to Azure + """ + + conn_class = LibcloudConnection + driver = AzureBaseDriver + name = "Azure AD Auth" + responseCls = AzureJsonResponse + rawResponseCls = RawResponse + + def __init__( + self, + key, + secret, + secure=True, + tenant_id=None, + subscription_id=None, + cloud_environment=None, + **kwargs, + ): + super().__init__(key, secret, **kwargs) + if not cloud_environment: + cloud_environment = "default" + if isinstance(cloud_environment, basestring): + cloud_environment = publicEnvironments[cloud_environment] + if not isinstance(cloud_environment, dict): + raise Exception( + "cloud_environment must be one of '%s' or a dict " + "containing keys 'resourceManagerEndpointUrl', " + "'activeDirectoryEndpointUrl', " + "'activeDirectoryResourceId', " + "'storageEndpointSuffix'" % ("', '".join(publicEnvironments.keys())) + ) + self.host = urlparse.urlparse(cloud_environment["resourceManagerEndpointUrl"]).hostname + self.login_host = urlparse.urlparse( + cloud_environment["activeDirectoryEndpointUrl"] + ).hostname + self.login_resource = cloud_environment["activeDirectoryResourceId"] + self.storage_suffix = cloud_environment["storageEndpointSuffix"] + self.tenant_id = tenant_id + self.subscription_id = subscription_id + + def add_default_headers(self, headers): + headers["Content-Type"] = "application/json" + headers["Authorization"] = "Bearer %s" % self.access_token + return headers + + def encode_data(self, data): + """Encode data to JSON""" + return json.dumps(data) + + def get_token_from_credentials(self): + """ + Log in and get bearer token used to authorize API requests. + """ + + conn = self.conn_class(self.login_host, 443, timeout=self.timeout) + conn.connect() + params = urlencode( + { + "grant_type": "client_credentials", + "client_id": self.user_id, + "client_secret": self.key, + "resource": self.login_resource, + } + ) + headers = {"Content-type": "application/x-www-form-urlencoded"} + conn.request("POST", "/%s/oauth2/token" % self.tenant_id, params, headers) + js = AzureAuthJsonResponse(conn.getresponse(), conn) + self.access_token = js.object["access_token"] + self.expires_on = js.object["expires_on"] + + def connect(self, **kwargs): + self.get_token_from_credentials() + return super().connect(**kwargs) + + def request(self, action, params=None, data=None, headers=None, method="GET", raw=False): + # Log in again if the token has expired or is going to expire soon + # (next 5 minutes). + if (time.time() + 300) >= int(self.expires_on): + self.get_token_from_credentials() + + return super().request( + action, params=params, data=data, headers=headers, method=method, raw=raw + ) diff --git a/libcloud/common/base.py b/libcloud/common/base.py index fa2f82a1d2..a46cf879bd 100644 --- a/libcloud/common/base.py +++ b/libcloud/common/base.py @@ -14,42 +14,81 @@ # limitations under the License. import os -import sys import ssl import copy -import binascii +import json import time - -import xml.dom.minidom - -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - -from pipes import quote as pquote - -try: - import simplejson as json -except: - import json +import socket +import binascii +from typing import Any, Dict, Type, Union, Optional import libcloud - -from libcloud.utils.py3 import PY3, PY25 -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlparse -from libcloud.utils.py3 import urlencode -from libcloud.utils.py3 import StringIO -from libcloud.utils.py3 import u -from libcloud.utils.py3 import b - +from libcloud.http import LibcloudConnection, HttpLibResponseProxy +from libcloud.utils.py3 import ET, httplib, urlparse, urlencode from libcloud.utils.misc import lowercase_keys -from libcloud.utils.compression import decompress_data +from libcloud.utils.retry import Retry from libcloud.common.types import LibcloudError, MalformedResponseError - -from libcloud.httplib_ssl import LibcloudHTTPConnection -from libcloud.httplib_ssl import LibcloudHTTPSConnection +from libcloud.common.exceptions import exception_from_message + +__all__ = [ + "RETRY_FAILED_HTTP_REQUESTS", + "BaseDriver", + "Connection", + "PollingConnection", + "ConnectionKey", + "ConnectionUserAndKey", + "CertificateConnection", + "Response", + "HTTPResponse", + "JsonResponse", + "XmlResponse", + "RawResponse", +] + +# Module level variable indicates if the failed HTTP requests should be retried +RETRY_FAILED_HTTP_REQUESTS = False + +# Set to True to allow double slashes in the URL path. This way +# morph_action_hook() won't strip potentially double slashes in the URLs. +# This is to support scenarios such as this one - +# https://github.com/apache/libcloud/issues/1529. +# We default it to False for backward compatibility reasons. +ALLOW_PATH_DOUBLE_SLASHES = False + + +class LazyObject: + """An object that doesn't get initialized until accessed.""" + + @classmethod + def _proxy(cls, *lazy_init_args, **lazy_init_kwargs): + class Proxy(cls): + _lazy_obj = None + + def __init__(self): + # Must override the lazy_cls __init__ + pass + + def __getattribute__(self, attr): + lazy_obj = object.__getattribute__(self, "_get_lazy_obj")() + return getattr(lazy_obj, attr) + + def __setattr__(self, attr, value): + lazy_obj = object.__getattribute__(self, "_get_lazy_obj")() + setattr(lazy_obj, attr, value) + + def _get_lazy_obj(self): + lazy_obj = object.__getattribute__(self, "_lazy_obj") + if lazy_obj is None: + lazy_obj = cls(*lazy_init_args, **lazy_init_kwargs) + object.__setattr__(self, "_lazy_obj", lazy_obj) + return lazy_obj + + return Proxy() + + @classmethod + def lazy(cls, *lazy_init_args, **lazy_init_kwargs): + """Create a lazily instantiated instance of the subclass, cls.""" + return cls._proxy(*lazy_init_args, **lazy_init_kwargs) class HTTPResponse(httplib.HTTPResponse): @@ -60,24 +99,30 @@ class HTTPResponse(httplib.HTTPResponse): # This applies the behaviour from 2.7, fixing the hangs. def read(self, amt=None): if self.fp is None: - return '' + return "" - if self._method == 'HEAD': + if self._method == "HEAD": self.close() - return '' + return "" return httplib.HTTPResponse.read(self, amt) -class Response(object): +class Response: """ A base Response class to derive from. """ - status = httplib.OK # Response status code - headers = {} # Response headers - body = None # Raw response body - object = None # Parsed response body + # Response status code + status = httplib.OK # type: int + # Response headers + headers = {} # type: dict + + # Raw response body + body = None + + # Parsed response body + object = None error = None # Reason returned by the server. connection = None # Parent connection class @@ -95,26 +140,22 @@ def __init__(self, response, connection): # http.client In Python 3 doesn't automatically lowercase the header # names - self.headers = lowercase_keys(dict(response.getheaders())) + self.headers = lowercase_keys(dict(response.headers)) self.error = response.reason - self.status = response.status + self.status = response.status_code + self.request = response.request + self.iter_content = response.iter_content - # This attribute is set when using LoggingConnection. - original_data = getattr(response, '_original_data', None) - - if original_data: - # LoggingConnection already decompresses data so it can log it - # which means we don't need to decompress it here. - self.body = response._original_data - else: - self.body = self._decompress_response(body=response.read(), - headers=self.headers) - - if PY3: - self.body = b(self.body).decode('utf-8') + self.body = ( + response.text.strip() + if response.text is not None and hasattr(response.text, "strip") + else "" + ) if not self.success(): - raise Exception(self.parse_error()) + raise exception_from_message( + code=self.status, message=self.parse_error(), headers=self.headers + ) self.object = self.parse_body() @@ -127,7 +168,7 @@ def parse_body(self): :return: Parsed body. :rtype: ``str`` """ - return self.body + return self.body if self.body is not None else "" def parse_error(self): """ @@ -150,31 +191,16 @@ def success(self): :rtype: ``bool`` :return: ``True`` or ``False`` """ - return self.status in [httplib.OK, httplib.CREATED] + # pylint: disable=E1101 + import requests - def _decompress_response(self, body, headers): - """ - Decompress a response body if it is using deflate or gzip encoding. - - :param body: Response body. - :type body: ``str`` - - :param headers: Response headers. - :type headers: ``dict`` - - :return: Decompressed response - :rtype: ``str`` - """ - encoding = headers.get('content-encoding', None) - - if encoding in ['zlib', 'deflate']: - body = decompress_data('zlib', body) - elif encoding in ['gzip', 'x-gzip']: - body = decompress_data('gzip', body) - else: - body = body.strip() - - return body + return self.status in [ + requests.codes.ok, + requests.codes.created, + httplib.OK, + httplib.CREATED, + httplib.ACCEPTED, + ] class JsonResponse(Response): @@ -188,11 +214,10 @@ def parse_body(self): try: body = json.loads(self.body) - except: + except Exception: raise MalformedResponseError( - 'Failed to parse JSON', - body=self.body, - driver=self.connection.driver) + "Failed to parse JSON", body=self.body, driver=self.connection.driver + ) return body parse_error = parse_body @@ -208,19 +233,22 @@ def parse_body(self): return self.body try: - body = ET.XML(self.body) - except: - raise MalformedResponseError('Failed to parse XML', - body=self.body, - driver=self.connection.driver) + try: + body = ET.XML(self.body) + except ValueError: + # lxml wants a bytes and tests are basically hard-coded to str + body = ET.XML(self.body.encode("utf-8")) + except Exception: + raise MalformedResponseError( + "Failed to parse XML", body=self.body, driver=self.connection.driver + ) return body parse_error = parse_body class RawResponse(Response): - - def __init__(self, connection): + def __init__(self, connection, response=None): """ :param connection: Parent connection object. :type connection: :class:`.Connection` @@ -231,27 +259,51 @@ def __init__(self, connection): self._error = None self._reason = None self.connection = connection + if response is not None: + self.headers = lowercase_keys(dict(response.headers)) + self.error = response.reason + self.status = response.status_code + self.request = response.request + self.iter_content = response.iter_content + + if not self.success(): + self.parse_error() + + def success(self): + """ + Determine if our request was successful. + + The meaning of this can be arbitrary; did we receive OK status? Did + the node get created? Were we authenticated? + + :rtype: ``bool`` + :return: ``True`` or ``False`` + """ + # pylint: disable=E1101 + import requests + + return self.status in [ + requests.codes.ok, + requests.codes.created, + httplib.OK, + httplib.CREATED, + httplib.ACCEPTED, + ] @property def response(self): if not self._response: response = self.connection.connection.getresponse() - self._response, self.body = response, response + self._response = HttpLibResponseProxy(response) if not self.success(): self.parse_error() return self._response @property - def status(self): - if not self._status: - self._status = self.response.status - return self._status - - @property - def headers(self): - if not self._headers: - self._headers = lowercase_keys(dict(self.response.getheaders())) - return self._headers + def body(self): + # Note: We use property to avoid saving whole response body into RAM + # See https://github.com/apache/libcloud/pull/1132 for details + return self.response.body @property def reason(self): @@ -260,211 +312,40 @@ def reason(self): return self._reason -# TODO: Move this to a better location/package -class LoggingConnection(): - """ - Debug class to log all HTTP(s) requests as they could be made - with the curl command. - - :cvar log: file-like object that logs entries are written to. - """ - - log = None - http_proxy_used = False - - def _log_response(self, r): - rv = "# -------- begin %d:%d response ----------\n" % (id(self), id(r)) - ht = "" - v = r.version - if r.version == 10: - v = "HTTP/1.0" - if r.version == 11: - v = "HTTP/1.1" - ht += "%s %s %s\r\n" % (v, r.status, r.reason) - body = r.read() - for h in r.getheaders(): - ht += "%s: %s\r\n" % (h[0].title(), h[1]) - ht += "\r\n" - - # this is evil. laugh with me. ha arharhrhahahaha - class fakesock: - def __init__(self, s): - self.s = s - - def makefile(self, *args, **kwargs): - if PY3: - from io import BytesIO - cls = BytesIO - else: - cls = StringIO - - return cls(self.s) - rr = r - headers = lowercase_keys(dict(r.getheaders())) - - encoding = headers.get('content-encoding', None) - content_type = headers.get('content-type', None) - - if encoding in ['zlib', 'deflate']: - body = decompress_data('zlib', body) - elif encoding in ['gzip', 'x-gzip']: - body = decompress_data('gzip', body) - - pretty_print = os.environ.get('LIBCLOUD_DEBUG_PRETTY_PRINT_RESPONSE', - False) - - if r.chunked: - ht += "%x\r\n" % (len(body)) - ht += body.decode('utf-8') - ht += "\r\n0\r\n" - else: - if pretty_print and content_type == 'application/json': - try: - body = json.loads(body.decode('utf-8')) - body = json.dumps(body, sort_keys=True, indent=4) - except: - # Invalid JSON or server is lying about content-type - pass - elif pretty_print and content_type == 'text/xml': - try: - elem = xml.dom.minidom.parseString(body.decode('utf-8')) - body = elem.toprettyxml() - except Exception: - # Invalid XML - pass - - ht += u(body) - - if sys.version_info >= (2, 6) and sys.version_info < (2, 7): - cls = HTTPResponse - else: - cls = httplib.HTTPResponse - - rr = cls(sock=fakesock(ht), method=r._method, - debuglevel=r.debuglevel) - rr.begin() - rv += ht - rv += ("\n# -------- end %d:%d response ----------\n" - % (id(self), id(r))) - - rr._original_data = body - return (rr, rv) - - def _log_curl(self, method, url, body, headers): - cmd = ["curl"] - - if self.http_proxy_used: - if self.proxy_username and self.proxy_password: - proxy_url = 'http://%s:%s@%s:%s' % (self.proxy_username, - self.proxy_password, - self.proxy_host, - self.proxy_port) - else: - proxy_url = 'http://%s:%s' % (self.proxy_host, - self.proxy_port) - proxy_url = pquote(proxy_url) - cmd.extend(['--proxy', proxy_url]) - - cmd.extend(['-i']) - - if method.lower() == 'head': - # HEAD method need special handling - cmd.extend(["--head"]) - else: - cmd.extend(["-X", pquote(method)]) - - for h in headers: - cmd.extend(["-H", pquote("%s: %s" % (h, headers[h]))]) - - cert_file = getattr(self, 'cert_file', None) - - if cert_file: - cmd.extend(["--cert", pquote(cert_file)]) - - # TODO: in python 2.6, body can be a file-like object. - if body is not None and len(body) > 0: - cmd.extend(["--data-binary", pquote(body)]) - - cmd.extend(["--compress"]) - cmd.extend([pquote("%s://%s:%d%s" % (self.protocol, self.host, - self.port, url))]) - return " ".join(cmd) - - -class LoggingHTTPSConnection(LoggingConnection, LibcloudHTTPSConnection): - """ - Utility Class for logging HTTPS connections - """ - - protocol = 'https' - - def getresponse(self): - r = LibcloudHTTPSConnection.getresponse(self) - if self.log is not None: - r, rv = self._log_response(r) - self.log.write(rv + "\n") - self.log.flush() - return r - - def request(self, method, url, body=None, headers=None): - headers.update({'X-LC-Request-ID': str(id(self))}) - if self.log is not None: - pre = "# -------- begin %d request ----------\n" % id(self) - self.log.write(pre + - self._log_curl(method, url, body, headers) + "\n") - self.log.flush() - return LibcloudHTTPSConnection.request(self, method, url, body, - headers) - - -class LoggingHTTPConnection(LoggingConnection, LibcloudHTTPConnection): - """ - Utility Class for logging HTTP connections - """ - - protocol = 'http' - - def getresponse(self): - r = LibcloudHTTPConnection.getresponse(self) - if self.log is not None: - r, rv = self._log_response(r) - self.log.write(rv + "\n") - self.log.flush() - return r - - def request(self, method, url, body=None, headers=None): - headers.update({'X-LC-Request-ID': str(id(self))}) - if self.log is not None: - pre = '# -------- begin %d request ----------\n' % id(self) - self.log.write(pre + - self._log_curl(method, url, body, headers) + "\n") - self.log.flush() - return LibcloudHTTPConnection.request(self, method, url, - body, headers) - - -class Connection(object): +class Connection: """ A Base Connection class to derive from. """ - # conn_classes = (LoggingHTTPSConnection) - conn_classes = (LibcloudHTTPConnection, LibcloudHTTPSConnection) + + conn_class = LibcloudConnection responseCls = Response rawResponseCls = RawResponse + retryCls = Retry connection = None - host = '127.0.0.1' + host = "127.0.0.1" # type: str port = 443 - timeout = None + timeout = None # type: Optional[Union[int, float]] secure = 1 - driver = None + driver = None # type: Type[BaseDriver] action = None cache_busting = False + backoff = None + retry_delay = None allow_insecure = True - def __init__(self, secure=True, host=None, port=None, url=None, - timeout=None, proxy_url=None): + def __init__( + self, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + retry_delay=None, + backoff=None, + ): self.secure = secure and 1 or 0 self.ua = [] self.context = {} @@ -472,10 +353,9 @@ def __init__(self, secure=True, host=None, port=None, url=None, if not self.allow_insecure and not secure: # TODO: We should eventually switch to whitelist instead of # blacklist approach - raise ValueError('Non https connections are not allowed (use ' - 'secure=True)') + raise ValueError("Non https connections are not allowed (use " "secure=True)") - self.request_path = '' + self.request_path = "" if host: self.host = host @@ -489,29 +369,38 @@ def __init__(self, secure=True, host=None, port=None, url=None, self.port = 80 if url: - (self.host, self.port, self.secure, - self.request_path) = self._tuple_from_url(url) - - if timeout: - self.timeout = timeout - + ( + self.host, + self.port, + self.secure, + self.request_path, + ) = self._tuple_from_url(url) + + self.timeout = timeout or self.timeout + self.retry_delay = retry_delay + self.backoff = backoff self.proxy_url = proxy_url def set_http_proxy(self, proxy_url): """ - Set a HTTP proxy which will be used with this connection. + Set a HTTP / HTTPS proxy which will be used with this connection. :param proxy_url: Proxy URL (e.g. http://: without authentication and - http://:@: for - basic auth authentication information. + ://:@: + for basic auth authentication information. :type proxy_url: ``str`` """ self.proxy_url = proxy_url + # NOTE: Because of the way connection instantion works, we need to call + # self.connection.set_http_proxy() here. Just setting "self.proxy_url" + # won't work. + self.connection.set_http_proxy(proxy_url=proxy_url) + def set_context(self, context): if not isinstance(context, dict): - raise TypeError('context needs to be a dictionary') + raise TypeError("context needs to be a dictionary") self.context = context @@ -521,18 +410,21 @@ def reset_context(self): def _tuple_from_url(self, url): secure = 1 port = None - (scheme, netloc, request_path, param, - query, fragment) = urlparse.urlparse(url) + parsed_url = urlparse.urlparse(url) + scheme, netloc, request_path, param, query, fragment = parsed_url - if scheme not in ['http', 'https']: - raise LibcloudError('Invalid scheme: %s in url %s' % (scheme, url)) + if scheme not in ["http", "https"]: + raise LibcloudError("Invalid scheme: {} in url {}".format(scheme, url)) if scheme == "http": secure = 0 - if ":" in netloc: + if netloc.startswith("["): + port = parsed_url.port + netloc = netloc[: netloc.index("]") + 1] + elif ":" in netloc: netloc, port = netloc.rsplit(":") - port = port + port = int(port) if not port: if scheme == "http": @@ -541,6 +433,7 @@ def _tuple_from_url(self, url): port = 443 host = netloc + port = int(port) return (host, port, secure, request_path) @@ -560,57 +453,58 @@ def connect(self, host=None, port=None, base_url=None, **kwargs): connection = None secure = self.secure - if getattr(self, 'base_url', None) and base_url is None: - (host, port, - secure, request_path) = self._tuple_from_url(self.base_url) + if getattr(self, "base_url", None) and base_url is None: + host, port, secure, request_path = self._tuple_from_url(getattr(self, "base_url")) elif base_url is not None: - (host, port, - secure, request_path) = self._tuple_from_url(base_url) + host, port, secure, request_path = self._tuple_from_url(base_url) else: host = host or self.host port = port or self.port - if not hasattr(kwargs, 'host'): - kwargs.update({'host': host}) + # Make sure port is an int + port = int(port) - if not hasattr(kwargs, 'port'): - kwargs.update({'port': port}) + if not hasattr(kwargs, "host"): + kwargs.update({"host": host}) - if not hasattr(kwargs, 'key_file') and hasattr(self, 'key_file'): - kwargs.update({'key_file': self.key_file}) + if not hasattr(kwargs, "port"): + kwargs.update({"port": port}) - if not hasattr(kwargs, 'cert_file') and hasattr(self, 'cert_file'): - kwargs.update({'cert_file': self.cert_file}) + if not hasattr(kwargs, "secure"): + kwargs.update({"secure": self.secure}) - # kwargs = {'host': host, 'port': int(port)} + if not hasattr(kwargs, "key_file") and hasattr(self, "key_file"): + kwargs.update({"key_file": getattr(self, "key_file")}) - # Timeout is only supported in Python 2.6 and later - # http://docs.python.org/library/httplib.html#httplib.HTTPConnection - if self.timeout and not PY25: - kwargs.update({'timeout': self.timeout}) + if not hasattr(kwargs, "cert_file") and hasattr(self, "cert_file"): + kwargs.update({"cert_file": getattr(self, "cert_file")}) + + if self.timeout: + kwargs.update({"timeout": self.timeout}) if self.proxy_url: - kwargs.update({'proxy_url': self.proxy_url}) + kwargs.update({"proxy_url": self.proxy_url}) - connection = self.conn_classes[secure](**kwargs) - # You can uncoment this line, if you setup a reverse proxy server + connection = self.conn_class(**kwargs) + # You can uncomment this line, if you setup a reverse proxy server # which proxies to your endpoint, and lets you easily capture # connections in cleartext when you setup the proxy to do SSL # for you - # connection = self.conn_classes[False]("127.0.0.1", 8080) + # connection = self.conn_class("127.0.0.1", 8080) self.connection = connection def _user_agent(self): - user_agent_suffix = ' '.join(['(%s)' % x for x in self.ua]) + user_agent_suffix = " ".join(["(%s)" % x for x in self.ua]) if self.driver: - user_agent = 'libcloud/%s (%s) %s' % ( + user_agent = "libcloud/{} ({}) {}".format( libcloud.__version__, - self.driver.name, user_agent_suffix) + self.driver.name, + user_agent_suffix, + ) else: - user_agent = 'libcloud/%s %s' % ( - libcloud.__version__, user_agent_suffix) + user_agent = "libcloud/{} {}".format(libcloud.__version__, user_agent_suffix) return user_agent @@ -626,8 +520,18 @@ def user_agent_append(self, token): """ self.ua.append(token) - def request(self, action, params=None, data=None, headers=None, - method='GET', raw=False): + def request( + self, + action, + params=None, + data=None, + headers=None, + method="GET", + raw=False, + stream=False, + json=None, + retry_failed=None, + ): """ Request a given `action`. @@ -657,6 +561,15 @@ def request(self, action, params=None, data=None, headers=None, and use the rawResponseCls class. This is used with storage API when uploading a file. + :type stream: ``bool`` + :param stream: True to return an iterator in Response.iter_content + and allow streaming of the response data + (for downloading large files) + + :param retry_failed: True if failed requests should be retried. This + argument can override module level constant and + environment variable value on per-request basis. + :return: An :class:`Response` instance. :rtype: :class:`Response` instance @@ -671,83 +584,129 @@ def request(self, action, params=None, data=None, headers=None, else: headers = copy.copy(headers) + retry_enabled = ( + os.environ.get("LIBCLOUD_RETRY_FAILED_HTTP_REQUESTS", False) + or RETRY_FAILED_HTTP_REQUESTS + ) + + # Method level argument has precedence over module level constant and + # environment variable + if retry_failed is not None: + retry_enabled = retry_failed + action = self.morph_action_hook(action) self.action = action self.method = method + self.data = data # Extend default parameters params = self.add_default_params(params) # Add cache busting parameters (if enabled) - if self.cache_busting and method == 'GET': + if self.cache_busting and method == "GET": params = self._add_cache_busting_to_params(params=params) # Extend default headers headers = self.add_default_headers(headers) # We always send a user-agent header - headers.update({'User-Agent': self._user_agent()}) + headers.update({"User-Agent": self._user_agent()}) # Indicate that we support gzip and deflate compression - headers.update({'Accept-Encoding': 'gzip,deflate'}) + headers.update({"Accept-Encoding": "gzip,deflate"}) port = int(self.port) if port not in (80, 443): - headers.update({'Host': "%s:%d" % (self.host, port)}) + headers.update({"Host": "%s:%d" % (self.host, port)}) else: - headers.update({'Host': self.host}) + headers.update({"Host": self.host}) if data: data = self.encode_data(data) - headers['Content-Length'] = str(len(data)) - elif method.upper() in ['POST', 'PUT'] and not raw: - # Only send Content-Length 0 with POST and PUT request. - # - # Note: Content-Length is not added when using "raw" mode means - # means that headers are upfront and the body is sent at some point - # later on. With raw mode user can specify Content-Length with - # "data" not being set. - headers['Content-Length'] = '0' params, headers = self.pre_connect_hook(params, headers) if params: - if '?' in action: - url = '&'.join((action, urlencode(params, doseq=True))) + if "?" in action: + url = "&".join((action, urlencode(params, doseq=True))) else: - url = '?'.join((action, urlencode(params, doseq=True))) + url = "?".join((action, urlencode(params, doseq=True))) else: url = action - # Removed terrible hack...this a less-bad hack that doesn't execute a - # request twice, but it's still a hack. - self.connect() + # IF connection has not yet been established + if self.connection is None: + self.connect() + + request_to_be_executed = self._retryable_request + + if retry_enabled: + retry_request = self.retryCls( + retry_delay=self.retry_delay, timeout=self.timeout, backoff=self.backoff + ) + request_to_be_executed = retry_request(self._retryable_request) + + return request_to_be_executed( + url=url, method=method, raw=raw, stream=stream, headers=headers, data=data + ) + + def _retryable_request( + self, + url: str, + data: bytes, + headers: Dict[str, Any], + method: str, + raw: bool, + stream: bool, + ) -> Union[RawResponse, Response]: try: # @TODO: Should we just pass File object as body to request method # instead of dealing with splitting and sending the file ourselves? - if raw: - self.connection.putrequest(method, url) + assert self.connection is not None - for key, value in list(headers.items()): - self.connection.putheader(key, str(value)) - - self.connection.endheaders() + if raw: + self.connection.prepared_request( + method=method, + url=url, + body=data, + headers=headers, + raw=raw, + stream=stream, + ) else: - self.connection.request(method=method, url=url, body=data, - headers=headers) - except ssl.SSLError: - e = sys.exc_info()[1] + self.connection.request( + method=method, url=url, body=data, headers=headers, stream=stream + ) + + except socket.gaierror as e: + message = str(e) + errno = getattr(e, "errno", None) + + if errno == -5: + # Throw a more-friendly exception on "no address associated + # with hostname" error. This error could simply indicate that + # "host" Connection class attribute is set to an incorrect + # value + class_name = self.__class__.__name__ + msg = ( + '%s. Perhaps "host" Connection class attribute ' + "(%s.connection) is set to an invalid, non-hostname " + "value (%s)?" % (message, class_name, self.host) + ) + raise socket.gaierror(msg) # type: ignore + self.reset_context() + raise e + except ssl.SSLError as e: self.reset_context() raise ssl.SSLError(str(e)) if raw: responseCls = self.rawResponseCls - kwargs = {'connection': self} + kwargs = {"connection": self, "response": self.connection.getresponse()} else: responseCls = self.responseCls - kwargs = {'connection': self, - 'response': self.connection.getresponse()} + kwargs = {"connection": self, "response": self.connection.getresponse()} try: response = responseCls(**kwargs) @@ -758,7 +717,26 @@ def request(self, action, params=None, data=None, headers=None, return response def morph_action_hook(self, action): - return self.request_path + action + """ + Here we strip any duplicated leading or trailing slashes to + prevent typos and other issues where some APIs don't correctly + handle double slashes. + + Keep in mind that in some situations, "/" is a valid path name + so we have a module flag which disables this behavior + (https://github.com/apache/libcloud/issues/1529). + """ + if ALLOW_PATH_DOUBLE_SLASHES: + # Special case to support scenarios where double slashes are + # valid - e.g. for S3 paths - /bucket//path1/path2.txt + return self.request_path + action + + url = urlparse.urljoin(self.request_path.lstrip("/").rstrip("/") + "/", action.lstrip("/")) + + if not url.startswith("/"): + return "/" + url + else: + return url def add_default_params(self, params): """ @@ -810,12 +788,12 @@ def _add_cache_busting_to_params(self, params): Note: This should only be used with *naughty* providers which use excessive caching of responses. """ - cache_busting_value = binascii.hexlify(os.urandom(8)).decode('ascii') + cache_busting_value = binascii.hexlify(os.urandom(8)).decode("ascii") if isinstance(params, dict): - params['cache-busting'] = cache_busting_value + params["cache-busting"] = cache_busting_value else: - params.append(('cache-busting', cache_busting_value)) + params.append(("cache-busting", cache_busting_value)) return params @@ -828,12 +806,14 @@ class PollingConnection(Connection): waits until the job has finished. If job doesn't finish in timeout seconds, an Exception thrown. """ + poll_interval = 0.5 timeout = 200 - request_method = 'request' + request_method = "request" - def async_request(self, action, params=None, data=None, headers=None, - method='GET', context=None): + def async_request( + self, action, params=None, data=None, headers=None, method="GET", context=None + ): """ Perform an 'async' request to the specified path. Keep in mind that this function is *blocking* and 'async' in this case means that the @@ -876,14 +856,18 @@ def async_request(self, action, params=None, data=None, headers=None, """ request = getattr(self, self.request_method) - kwargs = self.get_request_kwargs(action=action, params=params, - data=data, headers=headers, - method=method, - context=context) + kwargs = self.get_request_kwargs( + action=action, + params=params, + data=data, + headers=headers, + method=method, + context=context, + ) response = request(**kwargs) - kwargs = self.get_poll_request_kwargs(response=response, - context=context, - request_kwargs=kwargs) + kwargs = self.get_poll_request_kwargs( + response=response, context=context, request_kwargs=kwargs + ) end = time.time() + self.timeout completed = False @@ -894,19 +878,24 @@ def async_request(self, action, params=None, data=None, headers=None, time.sleep(self.poll_interval) if not completed: - raise LibcloudError('Job did not complete in %s seconds' % - (self.timeout)) + raise LibcloudError("Job did not complete in %s seconds" % (self.timeout)) return response - def get_request_kwargs(self, action, params=None, data=None, headers=None, - method='GET', context=None): + def get_request_kwargs( + self, action, params=None, data=None, headers=None, method="GET", context=None + ): """ Arguments which are passed to the initial request() call inside async_request. """ - kwargs = {'action': action, 'params': params, 'data': data, - 'headers': headers, 'method': method} + kwargs = { + "action": action, + "params": params, + "data": data, + "headers": headers, + "method": method, + } return kwargs def get_poll_request_kwargs(self, response, context, request_kwargs): @@ -923,7 +912,7 @@ def get_poll_request_kwargs(self, response, context, request_kwargs): :return ``dict`` Keyword arguments """ - raise NotImplementedError('get_poll_request_kwargs not implemented') + raise NotImplementedError("get_poll_request_kwargs not implemented") def has_completed(self, response): """ @@ -934,23 +923,40 @@ def has_completed(self, response): :return ``bool`` True if the job has completed, False otherwise. """ - raise NotImplementedError('has_completed not implemented') + raise NotImplementedError("has_completed not implemented") class ConnectionKey(Connection): """ Base connection class which accepts a single ``key`` argument. """ - def __init__(self, key, secure=True, host=None, port=None, url=None, - timeout=None, proxy_url=None): + + def __init__( + self, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + backoff=None, + retry_delay=None, + ): """ Initialize `user_id` and `key`; set `secure` to an ``int`` based on passed value. """ - super(ConnectionKey, self).__init__(secure=secure, host=host, - port=port, url=url, - timeout=timeout, - proxy_url=proxy_url) + super().__init__( + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + proxy_url=proxy_url, + backoff=backoff, + retry_delay=retry_delay, + ) self.key = key @@ -958,44 +964,130 @@ class CertificateConnection(Connection): """ Base connection class which accepts a single ``cert_file`` argument. """ - def __init__(self, cert_file, secure=True, host=None, port=None, url=None, - timeout=None): + + def __init__( + self, + cert_file, + secure=True, + host=None, + port=None, + url=None, + proxy_url=None, + timeout=None, + backoff=None, + retry_delay=None, + ): """ Initialize `cert_file`; set `secure` to an ``int`` based on passed value. """ - super(CertificateConnection, self).__init__(secure=secure, host=host, - port=port, url=url, - timeout=timeout) + super().__init__( + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + backoff=backoff, + retry_delay=retry_delay, + proxy_url=proxy_url, + ) self.cert_file = cert_file +class KeyCertificateConnection(CertificateConnection): + """ + Base connection class which accepts both ``key_file`` and ``cert_file`` + argument. + """ + + key_file = None + + def __init__( + self, + key_file, + cert_file, + secure=True, + host=None, + port=None, + url=None, + proxy_url=None, + timeout=None, + backoff=None, + retry_delay=None, + ca_cert=None, + ): + """ + Initialize `cert_file`; set `secure` to an ``int`` based on + passed value. + """ + super().__init__( + cert_file, + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + backoff=backoff, + retry_delay=retry_delay, + proxy_url=proxy_url, + ) + + self.key_file = key_file + + class ConnectionUserAndKey(ConnectionKey): """ Base connection class which accepts a ``user_id`` and ``key`` argument. """ - user_id = None - - def __init__(self, user_id, key, secure=True, host=None, port=None, - url=None, timeout=None, proxy_url=None): - super(ConnectionUserAndKey, self).__init__(key, secure=secure, - host=host, port=port, - url=url, timeout=timeout, - proxy_url=proxy_url) + user_id = None # type: int + + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + backoff=None, + retry_delay=None, + ): + super().__init__( + key, + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + backoff=backoff, + retry_delay=retry_delay, + proxy_url=proxy_url, + ) self.user_id = user_id -class BaseDriver(object): +class BaseDriver: """ Base driver class from which other classes can inherit from. """ - connectionCls = ConnectionKey - - def __init__(self, key, secret=None, secure=True, host=None, port=None, - api_version=None, region=None, **kwargs): + connectionCls = ConnectionKey # type: Type[Connection] + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=None, + **kwargs, + ): """ :param key: API key or username to be used (required) :type key: ``str`` @@ -1003,7 +1095,7 @@ def __init__(self, key, secret=None, secure=True, host=None, port=None, :param secret: Secret password to be used (required) :type secret: ``str`` - :param secure: Weither to use HTTPS or HTTP. Note: Some providers + :param secure: Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default. :type secure: ``bool`` @@ -1027,6 +1119,19 @@ def __init__(self, key, secret=None, secure=True, host=None, port=None, self.key = key self.secret = secret self.secure = secure + self.api_version = api_version + self.region = region + + conn_kwargs = self._ex_connection_class_kwargs() + conn_kwargs.update( + { + "timeout": kwargs.pop("timeout", None), + "retry_delay": kwargs.pop("retry_delay", None), + "backoff": kwargs.pop("backoff", None), + "proxy_url": kwargs.pop("proxy_url", None), + } + ) + args = [self.key] if self.secret is not None: @@ -1034,18 +1139,15 @@ def __init__(self, key, secret=None, secure=True, host=None, port=None, args.append(secure) + host = conn_kwargs.pop("host", None) or host + if host is not None: args.append(host) if port is not None: args.append(port) - self.api_version = api_version - self.region = region - - conn_kwargs = self._ex_connection_class_kwargs() self.connection = self.connectionCls(*args, **conn_kwargs) - self.connection.driver = self self.connection.connect() diff --git a/libcloud/common/brightbox.py b/libcloud/common/brightbox.py index 1943dda0d2..f14318f658 100644 --- a/libcloud/common/brightbox.py +++ b/libcloud/common/brightbox.py @@ -13,40 +13,36 @@ # See the License for the specific language governing permissions and # limitations under the License. -import base64 - -from libcloud.common.base import ConnectionUserAndKey, JsonResponse +from libcloud.utils.py3 import b, httplib, base64_encode_string +from libcloud.common.base import JsonResponse, ConnectionUserAndKey from libcloud.compute.types import InvalidCredsError -from libcloud.utils.py3 import b -from libcloud.utils.py3 import httplib - try: import simplejson as json except ImportError: - import json + import json # type: ignore class BrightboxResponse(JsonResponse): def success(self): - return self.status >= httplib.OK and self.status < httplib.BAD_REQUEST + return httplib.OK <= self.status < httplib.BAD_REQUEST def parse_body(self): - if self.headers['content-type'].split(';')[0] == 'application/json': - return super(BrightboxResponse, self).parse_body() + if self.headers["content-type"].split(";")[0] == "application/json": + return super().parse_body() else: return self.body def parse_error(self): - response = super(BrightboxResponse, self).parse_body() + response = super().parse_body() - if 'error' in response: - if response['error'] in ['invalid_client', 'unauthorized_client']: - raise InvalidCredsError(response['error']) + if "error" in response: + if response["error"] in ["invalid_client", "unauthorized_client"]: + raise InvalidCredsError(response["error"]) - return response['error'] - elif 'error_name' in response: - return '%s: %s' % (response['error_name'], response['errors'][0]) + return response["error"] + elif "error_name" in response: + return "{}: {}".format(response["error_name"], response["errors"][0]) return self.body @@ -56,44 +52,43 @@ class BrightboxConnection(ConnectionUserAndKey): Connection class for the Brightbox driver """ - host = 'api.gb1.brightbox.com' + host = "api.gb1.brightbox.com" responseCls = BrightboxResponse def _fetch_oauth_token(self): - body = json.dumps({'client_id': self.user_id, 'grant_type': 'none'}) + body = json.dumps({"client_id": self.user_id, "grant_type": "none"}) - authorization = 'Basic ' + str(base64.encodestring(b('%s:%s' % - (self.user_id, self.key)))).rstrip() + authorization = ( + "Basic " + str(base64_encode_string(b("{}:{}".format(self.user_id, self.key)))).rstrip() + ) self.connect() headers = { - 'Host': self.host, - 'User-Agent': self._user_agent(), - 'Authorization': authorization, - 'Content-Type': 'application/json', - 'Content-Length': str(len(body)) + "Host": self.host, + "User-Agent": self._user_agent(), + "Authorization": authorization, + "Content-Type": "application/json", + "Content-Length": str(len(body)), } - response = self.connection.request(method='POST', url='/token', - body=body, headers=headers) - - response = self.connection.getresponse() + # pylint: disable=assignment-from-no-return + response = self.connection.request(method="POST", url="/token", body=body, headers=headers) if response.status == httplib.OK: - return json.loads(response.read())['access_token'] + return json.loads(response.read())["access_token"] else: - responseCls = BrightboxResponse(response=response, connection=self) + responseCls = BrightboxResponse(response=response.getresponse(), connection=self) message = responseCls.parse_error() raise InvalidCredsError(message) def add_default_headers(self, headers): try: - headers['Authorization'] = 'OAuth ' + self.token + headers["Authorization"] = "OAuth " + self.token except AttributeError: self.token = self._fetch_oauth_token() - headers['Authorization'] = 'OAuth ' + self.token + headers["Authorization"] = "OAuth " + self.token return headers diff --git a/libcloud/common/buddyns.py b/libcloud/common/buddyns.py new file mode 100644 index 0000000000..c8ac78c529 --- /dev/null +++ b/libcloud/common/buddyns.py @@ -0,0 +1,77 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Dict, List + +from libcloud.common.base import JsonResponse, ConnectionKey + +__all__ = ["API_HOST", "BuddyNSException", "BuddyNSResponse", "BuddyNSConnection"] + +# Endpoint for buddyns api +API_HOST = "www.buddyns.com" + + +class BuddyNSResponse(JsonResponse): + errors: List[Dict] + objects: List[Dict] + + def __init__(self, response, connection): + # Use fresh per-instance lists: the previous class-level lists were + # shared by every response object of the process, so parsed entries + # (including errors) leaked between requests and made success() + # report stale failures. They must exist before super().__init__(), + # which calls success(). + self.errors = [] + self.objects = [] + super().__init__(response=response, connection=connection) + self.errors, self.objects = self.parse_body_and_errors() + if not self.success(): + raise BuddyNSException(code=self.status, message=self.errors.pop()["detail"]) + + def parse_body_and_errors(self): + js = super().parse_body() + if "detail" in js: + self.errors.append(js) + else: + self.objects.append(js) + + return self.errors, self.objects + + def success(self): + return len(self.errors) == 0 + + +class BuddyNSConnection(ConnectionKey): + host = API_HOST + responseCls = BuddyNSResponse + + def add_default_headers(self, headers): + headers["content-type"] = "application/json" + headers["Authorization"] = "Token" + " " + self.key + + return headers + + +class BuddyNSException(Exception): + def __init__(self, code, message): + self.code = code + self.message = message + self.args = (code, message) + + def __str__(self): + return "{} {}".format(self.code, self.message) + + def __repr__(self): + return "BuddyNSException {} {}".format(self.code, self.message) diff --git a/libcloud/common/cloudsigma.py b/libcloud/common/cloudsigma.py index 339bfc2f3f..81c43656a6 100644 --- a/libcloud/common/cloudsigma.py +++ b/libcloud/common/cloudsigma.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. @@ -15,141 +14,287 @@ # limitations under the License. __all__ = [ - 'API_ENDPOINTS_1_0', - 'API_ENDPOINTS_2_0', - 'API_VERSIONS', - 'INSTANCE_TYPES' + "API_ENDPOINTS_1_0", + "API_ENDPOINTS_2_0", + "API_VERSIONS", + "INSTANCE_TYPES", + "MAX_VIRTIO_CONTROLLERS", + "MAX_VIRTIO_UNITS", ] # API end-points API_ENDPOINTS_1_0 = { - 'zrh': { - 'name': 'Zurich', - 'country': 'Switzerland', - 'host': 'api.zrh.cloudsigma.com' - }, - 'lvs': { - 'name': 'Las Vegas', - 'country': 'United States', - 'host': 'api.lvs.cloudsigma.com' - } + "zrh": { + "name": "Zurich", + "country": "Switzerland", + "host": "api.zrh.cloudsigma.com", + }, + "lvs": { + "name": "Las Vegas", + "country": "United States", + "host": "api.lvs.cloudsigma.com", + }, } API_ENDPOINTS_2_0 = { - 'zrh': { - 'name': 'Zurich', - 'country': 'Switzerland', - 'host': 'zrh.cloudsigma.com' - }, - 'sjc': { - 'name': 'San Jose, CA', - 'country': 'United States', - 'host': 'sjc.cloudsigma.com' - }, - 'mia': { - 'name': 'Miami, FL', - 'country': 'United States', - 'host': 'mia.cloudsigma.com' - }, - 'wdc': { - 'name': 'Washington, DC', - 'country': 'United States', - 'host': 'wdc.cloudsigma.com' - }, - 'hnl': { - 'name': 'Honolulu, HI', - 'country': 'United States', - 'host': 'hnl.cloudsigma.com' - } + "zrh": { + "name": "Zurich, Switzerland", + "country": "Switzerland", + "host": "zrh.cloudsigma.com", + }, + "sjc": { + "name": "San Jose, CA", + "country": "United States", + "host": "sjc.alpha3cloud.com", + }, + "wdc": { + "name": "Washington, DC", + "country": "United States", + "host": "wdc.alpha3cloud.com", + }, + "hnl": { + "name": "Honolulu, HI", + "country": "United States", + "host": "hnl.cloudsigma.com", + }, + "per": { + "name": "Perth, Australia", + "country": "Australia", + "host": "per.cloudsigma.com", + }, + "mnl": { + "name": "Manila, Philippines", + "country": "Philippines", + "host": "mnl.cloudsigma.com", + }, + "fra": { + "name": "Frankfurt, Germany", + "country": "Germany", + "host": "fra.cloudsigma.com", + }, + "mel": { + "name": "Melbourne, Australia", + "country": "Australia", + "host": "mel.cloudsigma.com", + }, + "dbl": { + "name": "Dublin, Ireland", + "country": "Ireland", + "host": "ec.servecentric.com", + }, + "tyo": {"name": "Tokyo, Japan", "country": "Japan", "host": "tyo.cloudsigma.com"}, + "crk": { + "name": "Clark, Philippines", + "country": "Philippines", + "host": "crk.cloudsigma.com", + }, + "mnl2": { + "name": "Manila-2, Philippines", + "country": "Philippines", + "host": "mnl2.cloudsigma.com", + }, + "ruh": { + "name": "Riyadh, Saudi Arabia", + "country": "Saudi Arabia", + "host": "ruh.cloudsigma.com", + }, + "bdn": {"name": "Boden, Sweden", "country": "Sweden", "host": "cloud.hydro66.com"}, + "gva": { + "name": "Geneva, Switzerland", + "country": "Switzerland", + "host": "gva.cloudsigma.com", + }, } -DEFAULT_REGION = 'zrh' +DEFAULT_REGION = "zrh" # Supported API versions. -API_VERSIONS = [ - '1.0' # old and deprecated - '2.0' -] +API_VERSIONS = ["1.0" "2.0"] # old and deprecated -DEFAULT_API_VERSION = '2.0' +DEFAULT_API_VERSION = "2.0" # CloudSigma doesn't specify special instance types. # Basically for CPU any value between 0.5 GHz and 20.0 GHz should work, # 500 MB to 32000 MB for ram # and 1 GB to 1024 GB for hard drive size. -# Plans in this file are based on examples listed on http://www.cloudsigma -# .com/en/pricing/price-schedules +# Plans in this file are based on examples listed on https://cloudsigma +# .com/pricing/ INSTANCE_TYPES = [ { - 'id': 'micro-regular', - 'name': 'Micro/Regular instance', - 'cpu': 1100, - 'memory': 640, - 'disk': 10 + 3, - 'bandwidth': None, + "id": "small-1", + "name": "small-1, 1 CPUs, 512MB RAM, 50GB disk", + "cpu": 1, + "memory": 512, + "disk": 50, + "bandwidth": None, }, { - 'id': 'micro-high-cpu', - 'name': 'Micro/High CPU instance', - 'cpu': 2200, - 'memory': 640, - 'disk': 80, - 'bandwidth': None, + "id": "small-2", + "name": "small-2, 1 CPUs, 1024MB RAM, 50GB disk", + "cpu": 1, + "memory": 1024, + "disk": 50, + "bandwidth": None, }, { - 'id': 'standard-small', - 'name': 'Standard/Small instance', - 'cpu': 1100, - 'memory': 1741, - 'disk': 50, - 'bandwidth': None, + "id": "small-3", + "name": "small-3, 1 CPUs, 2048MB RAM, 50GB disk", + "cpu": 1, + "memory": 2048, + "disk": 50, + "bandwidth": None, }, { - 'id': 'standard-large', - 'name': 'Standard/Large instance', - 'cpu': 4400, - 'memory': 7680, - 'disk': 250, - 'bandwidth': None, + "id": "medium-1", + "name": "medium-1, 2 CPUs, 2048MB RAM, 50GB disk", + "cpu": 2, + "memory": 2048, + "disk": 50, + "bandwidth": None, }, { - 'id': 'standard-extra-large', - 'name': 'Standard/Extra Large instance', - 'cpu': 8800, - 'memory': 15360, - 'disk': 500, - 'bandwidth': None, + "id": "medium-2", + "name": "medium-2, 2 CPUs, 4096MB RAM, 60GB disk", + "cpu": 2, + "memory": 4096, + "disk": 60, + "bandwidth": None, }, { - 'id': 'high-memory-extra-large', - 'name': 'High Memory/Extra Large instance', - 'cpu': 7150, - 'memory': 17510, - 'disk': 250, - 'bandwidth': None, + "id": "medium-3", + "name": "medium-3, 4 CPUs, 8192MB RAM, 80GB disk", + "cpu": 4, + "memory": 8192, + "disk": 80, + "bandwidth": None, }, { - 'id': 'high-memory-double-extra-large', - 'name': 'High Memory/Double Extra Large instance', - 'cpu': 14300, - 'memory': 32768, - 'disk': 500, - 'bandwidth': None, + "id": "large-1", + "name": "large-1, 8 CPUs, 16384MB RAM, 160GB disk", + "cpu": 8, + "memory": 16384, + "disk": 160, + "bandwidth": None, }, { - 'id': 'high-cpu-medium', - 'name': 'High CPU/Medium instance', - 'cpu': 5500, - 'memory': 1741, - 'disk': 150, - 'bandwidth': None, + "id": "large-2", + "name": "large-2, 12 CPUs, 32768MB RAM, 320GB disk", + "cpu": 12, + "memory": 32768, + "disk": 320, + "bandwidth": None, }, { - 'id': 'high-cpu-extra-large', - 'name': 'High CPU/Extra Large instance', - 'cpu': 20000, - 'memory': 7168, - 'disk': 500, - 'bandwidth': None, - } + "id": "large-3", + "name": "large-3, 16 CPUs, 49152MB RAM, 480GB disk", + "cpu": 16, + "memory": 49152, + "disk": 480, + "bandwidth": None, + }, + { + "id": "xlarge", + "name": "xlarge, 20 CPUs, 65536MB RAM, 640GB disk", + "cpu": 20, + "memory": 65536, + "disk": 640, + "bandwidth": None, + }, ] + +# mapping between cpus, ram, disk to example size attributes +SPECS_TO_SIZE = { + (1, 512, 50): { + "id": "small-1", + "name": "small-1, 1 CPUs, 512MB RAM, 50GB disk", + "cpu": 1, + "ram": 512, + "disk": 50, + "bandwidth": None, + "price": None, + }, + (1, 1024, 50): { + "id": "small-2", + "name": "small-2, 1 CPUs, 1024MB RAM, 50GB disk", + "cpu": 1, + "ram": 1024, + "disk": 50, + "bandwidth": None, + "price": None, + }, + (1, 2048, 50): { + "id": "small-3", + "name": "small-3, 1 CPUs, 2048MB RAM, 50GB disk", + "cpu": 1, + "ram": 2048, + "disk": 50, + "bandwidth": None, + "price": None, + }, + (2, 2048, 50): { + "id": "medium-1", + "name": "medium-1, 2 CPUs, 2048MB RAM, 50GB disk", + "cpu": 2, + "ram": 2048, + "disk": 50, + "bandwidth": None, + "price": None, + }, + (2, 4096, 60): { + "id": "medium-2", + "name": "medium-2, 2 CPUs, 4096MB RAM, 60GB disk", + "cpu": 2, + "ram": 4096, + "disk": 60, + "bandwidth": None, + "price": None, + }, + (4, 8192, 80): { + "id": "medium-3", + "name": "medium-3, 4 CPUs, 8192MB RAM, 80GB disk", + "cpu": 4, + "ram": 8192, + "disk": 80, + "bandwidth": None, + "price": None, + }, + (8, 16384, 160): { + "id": "large-1", + "name": "large-1, 8 CPUs, 16384MB RAM, 160GB disk", + "cpu": 8, + "ram": 16384, + "disk": 160, + "bandwidth": None, + "price": None, + }, + (12, 32768, 320): { + "id": "large-2", + "name": "large-2, 12 CPUs, 32768MB RAM, 320GB disk", + "cpu": 12, + "ram": 32768, + "disk": 320, + "bandwidth": None, + "price": None, + }, + (16, 49152, 480): { + "id": "large-3", + "name": "large-3, 16 CPUs, 49152MB RAM, 480GB disk", + "cpu": 16, + "ram": 49152, + "disk": 480, + "bandwidth": None, + "price": None, + }, + (20, 65536, 640): { + "id": "xlarge", + "name": "xlarge, 20 CPUs, 65536MB RAM, 640GB disk", + "cpu": 20, + "ram": 65536, + "disk": 640, + "bandwidth": None, + "price": None, + }, +} + +MAX_VIRTIO_CONTROLLERS = 203 +MAX_VIRTIO_UNITS = 4 diff --git a/libcloud/common/cloudstack.py b/libcloud/common/cloudstack.py index b23d4539ee..b2ecb5967d 100644 --- a/libcloud/common/cloudstack.py +++ b/libcloud/common/cloudstack.py @@ -13,45 +13,42 @@ # See the License for the specific language governing permissions and # limitations under the License. -import base64 -import hashlib import copy import hmac +import base64 +import hashlib -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlencode -from libcloud.utils.py3 import urlquote -from libcloud.utils.py3 import b - -from libcloud.common.types import ProviderError -from libcloud.common.base import ConnectionUserAndKey, PollingConnection -from libcloud.common.base import JsonResponse -from libcloud.common.types import MalformedResponseError +from libcloud.utils.py3 import b, httplib, urlquote, urlencode +from libcloud.common.base import JsonResponse, PollingConnection, ConnectionUserAndKey +from libcloud.common.types import ProviderError, MalformedResponseError from libcloud.compute.types import InvalidCredsError class CloudStackResponse(JsonResponse): def parse_error(self): if self.status == httplib.UNAUTHORIZED: - raise InvalidCredsError('Invalid provider credentials') + raise InvalidCredsError("Invalid provider credentials") + value = None body = self.parse_body() - values = list(body.values())[0] - - if 'errortext' in values: - value = values['errortext'] - else: + if hasattr(body, "values"): + values = list(body.values())[0] + if "errortext" in values: + value = values["errortext"] + if value is None: value = self.body - error = ProviderError(value=value, http_code=self.status, - driver=self.connection.driver) + if not value: + value = "WARNING: error message text sent by provider was empty." + + error = ProviderError(value=value, http_code=self.status, driver=self.connection.driver) raise error class CloudStackConnection(ConnectionUserAndKey, PollingConnection): responseCls = CloudStackResponse poll_interval = 1 - request_method = '_sync_request' + request_method = "_sync_request" timeout = 600 ASYNC_PENDING = 0 @@ -75,68 +72,87 @@ def _make_signature(self, params): pairs = [] for pair in signature: - key = urlquote(str(pair[0]), safe='[]') - value = urlquote(str(pair[1]), safe='[]') - item = '%s=%s' % (key, value) - pairs .append(item) + key = urlquote(str(pair[0]), safe="[]") + value = urlquote(str(pair[1]), safe="[]*") + item = "{}={}".format(key, value) + pairs.append(item) - signature = '&'.join(pairs) + signature = "&".join(pairs) - signature = signature.lower().replace('+', '%20') - signature = hmac.new(b(self.key), msg=b(signature), - digestmod=hashlib.sha1) + signature = signature.lower().replace("+", "%20") + signature = hmac.new(b(self.key), msg=b(signature), digestmod=hashlib.sha1) return base64.b64encode(b(signature.digest())) def add_default_params(self, params): - params['apiKey'] = self.user_id - params['response'] = 'json' + params["apiKey"] = self.user_id + params["response"] = "json" return params def pre_connect_hook(self, params, headers): - params['signature'] = self._make_signature(params) + params["signature"] = self._make_signature(params) return params, headers - def _async_request(self, command, action=None, params=None, data=None, - headers=None, method='GET', context=None): + def _async_request( + self, + command, + action=None, + params=None, + data=None, + headers=None, + method="GET", + context=None, + ): if params: context = copy.deepcopy(params) else: context = {} # Command is specified as part of GET call - context['command'] = command - result = super(CloudStackConnection, self).async_request( - action=action, params=params, data=data, headers=headers, - method=method, context=context) - return result['jobresult'] - - def get_request_kwargs(self, action, params=None, data='', headers=None, - method='GET', context=None): - command = context['command'] - request_kwargs = {'command': command, 'action': action, - 'params': params, 'data': data, - 'headers': headers, 'method': method} + context["command"] = command + result = super().async_request( + action=action, + params=params, + data=data, + headers=headers, + method=method, + context=context, + ) + return result["jobresult"] + + def get_request_kwargs( + self, action, params=None, data="", headers=None, method="GET", context=None + ): + command = context["command"] + request_kwargs = { + "command": command, + "action": action, + "params": params, + "data": data, + "headers": headers, + "method": method, + } return request_kwargs def get_poll_request_kwargs(self, response, context, request_kwargs): - job_id = response['jobid'] - params = {'jobid': job_id} - kwargs = {'command': 'queryAsyncJobResult', 'params': params} + job_id = response["jobid"] + params = {"jobid": job_id} + kwargs = {"command": "queryAsyncJobResult", "params": params} return kwargs def has_completed(self, response): - status = response.get('jobstatus', self.ASYNC_PENDING) + status = response.get("jobstatus", self.ASYNC_PENDING) if status == self.ASYNC_FAILURE: - msg = response.get('jobresult', {}).get('errortext', status) + msg = response.get("jobresult", {}).get("errortext", status) raise Exception(msg) return status == self.ASYNC_SUCCESS - def _sync_request(self, command, action=None, params=None, data=None, - headers=None, method='GET'): + def _sync_request( + self, command, action=None, params=None, data=None, headers=None, method="GET" + ): """ This method handles synchronous calls which are generally fast information retrieval requests and thus return 'quickly'. @@ -147,30 +163,41 @@ def _sync_request(self, command, action=None, params=None, data=None, else: params = {} - params['command'] = command - result = self.request(action=self.driver.path, params=params, - data=data, headers=headers, method=method) + params["command"] = command + # pylint: disable=maybe-no-member + result = self.request( + action=self.driver.path, + params=params, + data=data, + headers=headers, + method=method, + ) command = command.lower() - # Work around for older verions which don't return "response" suffix + # Work around for older versions which don't return "response" suffix # in delete ingress rule response command name - if (command == 'revokesecuritygroupingress' and - 'revokesecuritygroupingressresponse' not in result.object): + if ( + command == "revokesecuritygroupingress" + and "revokesecuritygroupingressresponse" not in result.object + ): command = command + elif command == "restorevirtualmachine" and "restorevmresponse" in result.object: + command = "restorevmresponse" else: - command = command + 'response' + command = command + "response" if command not in result.object: raise MalformedResponseError( - "Unknown response format", + "Unknown response format {}".format(command), body=result.body, - driver=self.driver) + driver=self.driver, + ) result = result.object[command] return result -class CloudStackDriverMixIn(object): +class CloudStackDriverMixIn: host = None path = None @@ -178,18 +205,36 @@ class CloudStackDriverMixIn(object): def __init__(self, key, secret=None, secure=True, host=None, port=None): host = host or self.host - super(CloudStackDriverMixIn, self).__init__(key, secret, secure, host, - port) - - def _sync_request(self, command, action=None, params=None, data=None, - headers=None, method='GET'): - return self.connection._sync_request(command=command, action=action, - params=params, data=data, - headers=headers, method=method) - - def _async_request(self, command, action=None, params=None, data=None, - headers=None, method='GET', context=None): - return self.connection._async_request(command=command, action=action, - params=params, data=data, - headers=headers, method=method, - context=context) + super().__init__(key, secret, secure, host, port) + + def _sync_request( + self, command, action=None, params=None, data=None, headers=None, method="GET" + ): + return self.connection._sync_request( # pylint: disable=maybe-no-member + command=command, + action=action, + params=params, + data=data, + headers=headers, + method=method, + ) + + def _async_request( + self, + command, + action=None, + params=None, + data=None, + headers=None, + method="GET", + context=None, + ): + return self.connection._async_request( # pylint: disable=maybe-no-member + command=command, + action=action, + params=params, + data=data, + headers=headers, + method=method, + context=context, + ) diff --git a/libcloud/common/digitalocean.py b/libcloud/common/digitalocean.py new file mode 100644 index 0000000000..9b814460a7 --- /dev/null +++ b/libcloud/common/digitalocean.py @@ -0,0 +1,220 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Common settings and connection objects for DigitalOcean Cloud +""" + +from libcloud.utils.py3 import httplib, parse_qs, urlparse +from libcloud.common.base import BaseDriver, JsonResponse, ConnectionKey +from libcloud.common.types import LibcloudError, InvalidCredsError + +__all__ = [ + "DigitalOcean_v2_Response", + "DigitalOcean_v2_Connection", + "DigitalOceanBaseDriver", +] + + +class DigitalOcean_v1_Error(LibcloudError): + """ + Exception for when attempting to use version 1 + of the DigitalOcean API which is no longer + supported. + """ + + def __init__( + self, + value=( + "Driver no longer supported: Version 1 of the " + "DigitalOcean API reached end of life on November 9, " + "2015. Use the v2 driver. Please visit: " + "https://developers.digitalocean.com/documentation/changelog/api-v1/sunsetting-api-v1/" + ), # noqa: E501 + driver=None, + ): + super().__init__(value, driver=driver) + + +class DigitalOcean_v2_Response(JsonResponse): + valid_response_codes = [ + httplib.OK, + httplib.ACCEPTED, + httplib.CREATED, + httplib.NO_CONTENT, + ] + + def parse_error(self): + if self.status == httplib.UNAUTHORIZED: + body = self.parse_body() + raise InvalidCredsError(body["message"]) + else: + body = self.parse_body() + if "message" in body: + error = "{} (code: {})".format(body["message"], self.status) + else: + error = body + return error + + def success(self): + return self.status in self.valid_response_codes + + +class DigitalOcean_v2_Connection(ConnectionKey): + """ + Connection class for the DigitalOcean (v2) driver. + """ + + host = "api.digitalocean.com" + responseCls = DigitalOcean_v2_Response + + def add_default_headers(self, headers): + """ + Add headers that are necessary for every request + + This method adds ``token`` to the request. + """ + headers["Authorization"] = "Bearer %s" % (self.key) + headers["Content-Type"] = "application/json" + return headers + + def add_default_params(self, params): + """ + Add parameters that are necessary for every request + + This method adds ``per_page`` to the request to reduce the total + number of paginated requests to the API. + """ + # pylint: disable=maybe-no-member + params["per_page"] = self.driver.ex_per_page + return params + + +class DigitalOceanConnection(DigitalOcean_v2_Connection): + """ + Connection class for the DigitalOcean driver. + """ + + pass + + +class DigitalOceanResponse(DigitalOcean_v2_Response): + pass + + +class DigitalOceanBaseDriver(BaseDriver): + """ + DigitalOcean BaseDriver + """ + + name = "DigitalOcean" + website = "https://www.digitalocean.com" + + def __new__(cls, key, secret=None, api_version="v2", **kwargs): + if cls is DigitalOceanBaseDriver: + if api_version == "v1" or secret is not None: + raise DigitalOcean_v1_Error() + elif api_version == "v2": + cls = DigitalOcean_v2_BaseDriver + else: + raise NotImplementedError("Unsupported API version: %s" % (api_version)) + return super().__new__(cls, **kwargs) + + def ex_account_info(self): + raise NotImplementedError("ex_account_info not implemented for this driver") + + def ex_list_events(self): + raise NotImplementedError("ex_list_events not implemented for this driver") + + def ex_get_event(self, event_id): + raise NotImplementedError("ex_get_event not implemented for this driver") + + def _paginated_request(self, url, obj): + raise NotImplementedError("_paginated_requests not implemented for this driver") + + +class DigitalOcean_v2_BaseDriver(DigitalOceanBaseDriver): + """ + DigitalOcean BaseDriver using v2 of the API. + + Supports `ex_per_page` ``int`` value keyword parameter to adjust per page + requests against the API. + """ + + connectionCls = DigitalOcean_v2_Connection + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=None, + ex_per_page=200, + **kwargs, + ): + self.ex_per_page = ex_per_page + super().__init__(key, **kwargs) + + def ex_account_info(self): + return self.connection.request("/v2/account").object["account"] + + def ex_list_events(self): + return self._paginated_request("/v2/actions", "actions") + + def ex_get_event(self, event_id): + """ + Get an event object + + :param event_id: Event id (required) + :type event_id: ``str`` + """ + params = {} + return self.connection.request("/v2/actions/%s" % event_id, params=params).object["action"] + + def _paginated_request(self, url, obj): + """ + Perform multiple calls in order to have a full list of elements when + the API responses are paginated. + + :param url: API endpoint + :type url: ``str`` + + :param obj: Result object key + :type obj: ``str`` + + :return: ``list`` of API response objects + :rtype: ``list`` + """ + params = {} + data = self.connection.request(url) + try: + query = urlparse.urlparse(data.object["links"]["pages"]["last"]) + # The query[4] references the query parameters from the url + pages = parse_qs(query[4])["page"][0] + values = data.object[obj] + for page in range(2, int(pages) + 1): + params.update({"page": page}) + new_data = self.connection.request(url, params=params) + + more_values = new_data.object[obj] + for value in more_values: + values.append(value) + data = values + except KeyError: # No pages. + data = data.object[obj] + return data diff --git a/libcloud/common/dimensiondata.py b/libcloud/common/dimensiondata.py new file mode 100644 index 0000000000..09aa088e2b --- /dev/null +++ b/libcloud/common/dimensiondata.py @@ -0,0 +1,1871 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Dimension Data Common Components +""" + +from time import sleep +from base64 import b64encode + +# TODO: use distutils.version when Travis CI fixed the pylint issue with version +# from distutils.version import LooseVersion +from libcloud.utils.py3 import b, httplib, basestring +from libcloud.utils.xml import findtext +from libcloud.common.base import RawResponse, XmlResponse, ConnectionUserAndKey +from libcloud.compute.base import Node +from libcloud.compute.types import LibcloudError, InvalidCredsError + +# Roadmap / TODO: +# +# 1.0 - Copied from OpSource API, named provider details. + +# setup a few variables to represent all of the DimensionData cloud namespaces +NAMESPACE_BASE = "http://oec.api.opsource.net/schemas" +ORGANIZATION_NS = NAMESPACE_BASE + "/organization" +SERVER_NS = NAMESPACE_BASE + "/server" +NETWORK_NS = NAMESPACE_BASE + "/network" +DIRECTORY_NS = NAMESPACE_BASE + "/directory" +GENERAL_NS = NAMESPACE_BASE + "/general" +BACKUP_NS = NAMESPACE_BASE + "/backup" + +# API 2.0 Namespaces and URNs +TYPES_URN = "urn:didata.com:api:cloud:types" + +# API end-points +API_ENDPOINTS = { + "dd-na": { + "name": "North America (NA)", + "host": "api-na.dimensiondata.com", + "vendor": "DimensionData", + }, + "dd-eu": { + "name": "Europe (EU)", + "host": "api-eu.dimensiondata.com", + "vendor": "DimensionData", + }, + "dd-au": { + "name": "Australia (AU)", + "host": "api-au.dimensiondata.com", + "vendor": "DimensionData", + }, + "dd-au-gov": { + "name": "Australia Canberra ACT (AU)", + "host": "api-canberra.dimensiondata.com", + "vendor": "DimensionData", + }, + "dd-af": { + "name": "Africa (AF)", + "host": "api-mea.dimensiondata.com", + "vendor": "DimensionData", + }, + "dd-ap": { + "name": "Asia Pacific (AP)", + "host": "api-ap.dimensiondata.com", + "vendor": "DimensionData", + }, + "dd-latam": { + "name": "South America (LATAM)", + "host": "api-latam.dimensiondata.com", + "vendor": "DimensionData", + }, + "dd-canada": { + "name": "Canada (CA)", + "host": "api-canada.dimensiondata.com", + "vendor": "DimensionData", + }, + "is-na": { + "name": "North America (NA)", + "host": "usapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "is-eu": { + "name": "Europe (EU)", + "host": "euapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "is-au": { + "name": "Australia (AU)", + "host": "auapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "is-af": { + "name": "Africa (AF)", + "host": "meaapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "is-ap": { + "name": "Asia Pacific (AP)", + "host": "apapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "is-latam": { + "name": "South America (LATAM)", + "host": "latamapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "is-canada": { + "name": "Canada (CA)", + "host": "canadaapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "ntta-na": { + "name": "North America (NA)", + "host": "cloudapi.nttamerica.com", + "vendor": "NTTNorthAmerica", + }, + "ntta-eu": { + "name": "Europe (EU)", + "host": "eucloudapi.nttamerica.com", + "vendor": "NTTNorthAmerica", + }, + "ntta-au": { + "name": "Australia (AU)", + "host": "aucloudapi.nttamerica.com", + "vendor": "NTTNorthAmerica", + }, + "ntta-af": { + "name": "Africa (AF)", + "host": "sacloudapi.nttamerica.com", + "vendor": "NTTNorthAmerica", + }, + "ntta-ap": { + "name": "Asia Pacific (AP)", + "host": "hkcloudapi.nttamerica.com", + "vendor": "NTTNorthAmerica", + }, + "cisco-na": { + "name": "North America (NA)", + "host": "iaas-api-na.cisco-ccs.com", + "vendor": "Cisco", + }, + "cisco-eu": { + "name": "Europe (EU)", + "host": "iaas-api-eu.cisco-ccs.com", + "vendor": "Cisco", + }, + "cisco-au": { + "name": "Australia (AU)", + "host": "iaas-api-au.cisco-ccs.com", + "vendor": "Cisco", + }, + "cisco-af": { + "name": "Africa (AF)", + "host": "iaas-api-mea.cisco-ccs.com", + "vendor": "Cisco", + }, + "cisco-ap": { + "name": "Asia Pacific (AP)", + "host": "iaas-api-ap.cisco-ccs.com", + "vendor": "Cisco", + }, + "cisco-latam": { + "name": "South America (LATAM)", + "host": "iaas-api-sa.cisco-ccs.com", + "vendor": "Cisco", + }, + "cisco-canada": { + "name": "Canada (CA)", + "host": "iaas-api-ca.cisco-ccs.com", + "vendor": "Cisco", + }, +} + +# Default API end-point for the base connection class. +DEFAULT_REGION = "dd-na" + +BAD_CODE_XML_ELEMENTS = ( + ("responseCode", SERVER_NS), + ("responseCode", TYPES_URN), + ("result", GENERAL_NS), +) + +BAD_MESSAGE_XML_ELEMENTS = ( + ("message", SERVER_NS), + ("message", TYPES_URN), + ("resultDetail", GENERAL_NS), +) + + +def dd_object_to_id(obj, obj_type, id_value="id"): + """ + Takes in a DD object or string and prints out it's id + This is a helper method, as many of our functions can take either an object + or a string, and we need an easy way of converting them + + :param obj: The object to get the id for + :type obj: ``object`` + + :param func: The function to call, e.g. ex_get_vlan. Note: This + function needs to return an object which has ``status`` + attribute. + :type func: ``function`` + + :rtype: ``str`` + """ + if isinstance(obj, obj_type): + return getattr(obj, id_value) + elif isinstance(obj, (basestring)): + return obj + else: + raise TypeError( + "Invalid type {} looking for basestring or {}".format( + type(obj).__name__, obj_type.__name__ + ) + ) + + +# TODO: use distutils.version when Travis CI fixed the pylint issue with version +# This is a temporary workaround. +def LooseVersion(version): + return float(version) + + +class NetworkDomainServicePlan: + ESSENTIALS = "ESSENTIALS" + ADVANCED = "ADVANCED" + + +class DimensionDataRawResponse(RawResponse): + pass + + +class DimensionDataResponse(XmlResponse): + def parse_error(self): + if self.status == httplib.UNAUTHORIZED: + raise InvalidCredsError(self.body) + elif self.status == httplib.FORBIDDEN: + raise InvalidCredsError(self.body) + + body = self.parse_body() + + if self.status == httplib.BAD_REQUEST: + for response_code in BAD_CODE_XML_ELEMENTS: + code = findtext(body, response_code[0], response_code[1]) + if code is not None: + break + for message in BAD_MESSAGE_XML_ELEMENTS: + message = findtext(body, message[0], message[1]) + if message is not None: + break + raise DimensionDataAPIException(code=code, msg=message, driver=self.connection.driver) + if self.status is not httplib.OK: + raise DimensionDataAPIException( + code=self.status, msg=body, driver=self.connection.driver + ) + + return self.body + + +class DimensionDataAPIException(LibcloudError): + def __init__(self, code, msg, driver): + self.code = code + self.msg = msg + self.driver = driver + + def __str__(self): + return "{}: {}".format(self.code, self.msg) + + def __repr__(self): + return "".format( + self.code, + self.msg, + ) + + +class DimensionDataConnection(ConnectionUserAndKey): + """ + Connection class for the DimensionData driver + """ + + api_path_version_1 = "/oec" + api_path_version_2 = "/caas" + api_version_1 = 0.9 + + # Earliest version supported + oldest_api_version = "2.2" + + # Latest version supported + latest_api_version = "2.4" + + # Default api version + active_api_version = "2.4" + + _orgId = None + responseCls = DimensionDataResponse + rawResponseCls = DimensionDataRawResponse + + allow_insecure = False + + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + api_version=None, + **conn_kwargs, + ): + super().__init__( + user_id=user_id, + key=key, + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + proxy_url=proxy_url, + ) + + if conn_kwargs["region"]: + self.host = conn_kwargs["region"]["host"] + + if api_version: + if LooseVersion(api_version) < LooseVersion(self.oldest_api_version): + msg = ( + "API Version specified is too old. No longer " + "supported. Please upgrade to the latest version {}".format( + self.active_api_version + ) + ) + + raise DimensionDataAPIException(code=None, msg=msg, driver=self.driver) + elif LooseVersion(api_version) > LooseVersion(self.latest_api_version): + msg = ( + "Unsupported API Version. The version specified is " + "not release yet. Please use the latest supported " + "version {}".format(self.active_api_version) + ) + + raise DimensionDataAPIException(code=None, msg=msg, driver=self.driver) + + else: + # Overwrite default version using the version user specified + self.active_api_version = api_version + + def add_default_headers(self, headers): + headers["Authorization"] = "Basic %s" % b64encode( + b("{}:{}".format(self.user_id, self.key)) + ).decode("utf-8") + headers["Content-Type"] = "application/xml" + return headers + + def request_api_1(self, action, params=None, data="", headers=None, method="GET"): + action = "{}/{}/{}".format(self.api_path_version_1, self.api_version_1, action) + + return super().request( + action=action, params=params, data=data, method=method, headers=headers + ) + + def request_api_2(self, path, action, params=None, data="", headers=None, method="GET"): + action = "{}/{}/{}/{}".format( + self.api_path_version_2, + self.active_api_version, + path, + action, + ) + + return super().request( + action=action, params=params, data=data, method=method, headers=headers + ) + + def raw_request_with_orgId_api_1( + self, action, params=None, data="", headers=None, method="GET" + ): + action = "{}/{}".format(self.get_resource_path_api_1(), action) + return super().request( + action=action, + params=params, + data=data, + method=method, + headers=headers, + raw=True, + ) + + def request_with_orgId_api_1(self, action, params=None, data="", headers=None, method="GET"): + action = "{}/{}".format(self.get_resource_path_api_1(), action) + + return super().request( + action=action, params=params, data=data, method=method, headers=headers + ) + + def request_with_orgId_api_2(self, action, params=None, data="", headers=None, method="GET"): + action = "{}/{}".format(self.get_resource_path_api_2(), action) + + return super().request( + action=action, params=params, data=data, method=method, headers=headers + ) + + def paginated_request_with_orgId_api_2( + self, action, params=None, data="", headers=None, method="GET", page_size=250 + ): + """ + A paginated request to the MCP2.0 API + This essentially calls out to request_with_orgId_api_2 for each page + and yields the response to make a generator + This generator can be looped through to grab all the pages. + + :param action: The resource to access (i.e. 'network/vlan') + :type action: ``str`` + + :param params: Parameters to give to the action + :type params: ``dict`` or ``None`` + + :param data: The data payload to be added to the request + :type data: ``str`` + + :param headers: Additional header to be added to the request + :type headers: ``str`` or ``dict`` or ``None`` + + :param method: HTTP Method for the request (i.e. 'GET', 'POST') + :type method: ``str`` + + :param page_size: The size of each page to be returned + Note: Max page size in MCP2.0 is currently 250 + :type page_size: ``int`` + """ + if params is None: + params = {} + params["pageSize"] = page_size + + resp = self.request_with_orgId_api_2(action, params, data, headers, method).object + yield resp + if len(resp) <= 0: + return + + pcount = resp.get("pageCount") # pylint: disable=no-member + psize = resp.get("pageSize") # pylint: disable=no-member + pnumber = resp.get("pageNumber") # pylint: disable=no-member + + while int(pcount) >= int(psize): + params["pageNumber"] = int(pnumber) + 1 + resp = self.request_with_orgId_api_2(action, params, data, headers, method).object + pcount = resp.get("pageCount") # pylint: disable=no-member + psize = resp.get("pageSize") # pylint: disable=no-member + pnumber = resp.get("pageNumber") # pylint: disable=no-member + yield resp + + def get_resource_path_api_1(self): + """ + This method returns a resource path which is necessary for referencing + resources that require a full path instead of just an ID, such as + networks, and customer snapshots. + """ + return "{}/{}/{}".format( + self.api_path_version_1, + self.api_version_1, + self._get_orgId(), + ) + + def get_resource_path_api_2(self): + """ + This method returns a resource path which is necessary for referencing + resources that require a full path instead of just an ID, such as + networks, and customer snapshots. + """ + return "{}/{}/{}".format( + self.api_path_version_2, + self.active_api_version, + self._get_orgId(), + ) + + def wait_for_state(self, state, func, poll_interval=2, timeout=60, *args, **kwargs): + """ + Wait for the function which returns a instance with field status/state + to match. + + Keep polling func until one of the desired states is matched + + :param state: Either the desired state (`str`) or a `list` of states + :type state: ``str`` or ``list`` + + :param func: The function to call, e.g. ex_get_vlan. Note: This + function needs to return an object which has ``status`` + attribute. + :type func: ``function`` + + :param poll_interval: The number of seconds to wait between checks + :type poll_interval: `int` + + :param timeout: The total number of seconds to wait to reach a state + :type timeout: `int` + + :param args: The arguments for func + :type args: Positional arguments + + :param kwargs: The arguments for func + :type kwargs: Keyword arguments + + :return: Result from the calling function. + """ + cnt = 0 + result = None + object_state = None + while cnt < timeout / poll_interval: + result = func(*args, **kwargs) + if isinstance(result, Node): + object_state = result.state + else: + object_state = result.status + + if object_state is state or str(object_state) in state: + return result + + sleep(poll_interval) + cnt += 1 + + msg = "Status check for object %s timed out" % (result) + raise DimensionDataAPIException(code=object_state, msg=msg, driver=self.driver) + + def _get_orgId(self): + """ + Send the /myaccount API request to DimensionData cloud and parse the + 'orgId' from the XML response object. We need the orgId to use most + of the other API functions + """ + if self._orgId is None: + body = self.request_api_1("myaccount").object + self._orgId = findtext(body, "orgId", DIRECTORY_NS) + return self._orgId + + def get_account_details(self): + """ + Get the details of this account + + :rtype: :class:`DimensionDataAccountDetails` + """ + body = self.request_api_1("myaccount").object + return DimensionDataAccountDetails( + user_name=findtext(body, "userName", DIRECTORY_NS), + full_name=findtext(body, "fullName", DIRECTORY_NS), + first_name=findtext(body, "firstName", DIRECTORY_NS), + last_name=findtext(body, "lastName", DIRECTORY_NS), + email=findtext(body, "emailAddress", DIRECTORY_NS), + ) + + +class DimensionDataAccountDetails: + """ + Dimension Data account class details + """ + + def __init__(self, user_name, full_name, first_name, last_name, email): + self.user_name = user_name + self.full_name = full_name + self.first_name = first_name + self.last_name = last_name + self.email = email + + +class DimensionDataStatus: + """ + DimensionData API pending operation status class + action, request_time, user_name, number_of_steps, update_time, + step.name, step.number, step.percent_complete, failure_reason, + """ + + def __init__( + self, + action=None, + request_time=None, + user_name=None, + number_of_steps=None, + update_time=None, + step_name=None, + step_number=None, + step_percent_complete=None, + failure_reason=None, + ): + self.action = action + self.request_time = request_time + self.user_name = user_name + self.number_of_steps = number_of_steps + self.update_time = update_time + self.step_name = step_name + self.step_number = step_number + self.step_percent_complete = step_percent_complete + self.failure_reason = failure_reason + + def __repr__(self): + return ( + "" + ) % ( + self.action, + self.request_time, + self.user_name, + self.number_of_steps, + self.update_time, + self.step_name, + self.step_number, + self.step_percent_complete, + self.failure_reason, + ) + + +class DimensionDataNetwork: + """ + DimensionData network with location. + """ + + def __init__(self, id, name, description, location, private_net, multicast, status): + self.id = str(id) + self.name = name + self.description = description + self.location = location + self.private_net = private_net + self.multicast = multicast + self.status = status + + def __repr__(self): + return ( + "" + ) % ( + self.id, + self.name, + self.description, + self.location, + self.private_net, + self.multicast, + ) + + +class DimensionDataNetworkDomain: + """ + DimensionData network domain with location. + """ + + def __init__(self, id, name, description, location, status, plan): + self.id = str(id) + self.name = name + self.description = description + self.location = location + self.status = status + self.plan = plan + + def __repr__(self): + return ( + "" + ) % ( + self.id, + self.name, + self.description, + self.location, + self.status, + self.plan, + ) + + +class DimensionDataPublicIpBlock: + """ + DimensionData Public IP Block with location. + """ + + def __init__(self, id, base_ip, size, location, network_domain, status): + self.id = str(id) + self.base_ip = base_ip + self.size = size + self.location = location + self.network_domain = network_domain + self.status = status + + def __repr__(self): + return ( + "" + ) % (self.id, self.base_ip, self.size, self.location, self.status) + + +class DimensionDataServerCpuSpecification: + """ + A class that represents the specification of the CPU(s) for a + node + """ + + def __init__(self, cpu_count, cores_per_socket, performance): + """ + Instantiate a new :class:`DimensionDataServerCpuSpecification` + + :param cpu_count: The number of CPUs + :type cpu_count: ``int`` + + :param cores_per_socket: The number of cores per socket, the + recommendation is 1 + :type cores_per_socket: ``int`` + + :param performance: The performance type, e.g. HIGHPERFORMANCE + :type performance: ``str`` + """ + self.cpu_count = cpu_count + self.cores_per_socket = cores_per_socket + self.performance = performance + + def __repr__(self): + return ( + "" + ) % (self.cpu_count, self.cores_per_socket, self.performance) + + +class DimensionDataServerDisk: + """ + A class that represents the disk on a server + """ + + def __init__(self, id=None, scsi_id=None, size_gb=None, speed=None, state=None): + """ + Instantiate a new :class:`DimensionDataServerDisk` + + :param id: The id of the disk + :type id: ``str`` + + :param scsi_id: Representation for scsi + :type scsi_id: ``int`` + + :param size_gb: Size of the disk + :type size_gb: ``int`` + + :param speed: Speed of the disk (i.e. STANDARD) + :type speed: ``str`` + + :param state: State of the disk (i.e. PENDING) + :type state: ``str`` + """ + self.id = id + self.scsi_id = scsi_id + self.size_gb = size_gb + self.speed = speed + self.state = state + + def __repr__(self): + return ("" + ) % (self.status, self.version_status, self.api_version) + + +class DimensionDataFirewallRule: + """ + DimensionData Firewall Rule for a network domain + """ + + def __init__( + self, + id, + name, + action, + location, + network_domain, + status, + ip_version, + protocol, + source, + destination, + enabled, + ): + self.id = str(id) + self.name = name + self.action = action + self.location = location + self.network_domain = network_domain + self.status = status + self.ip_version = ip_version + self.protocol = protocol + self.source = source + self.destination = destination + self.enabled = enabled + + def __repr__(self): + return ( + "" + ) % ( + self.id, + self.name, + self.action, + self.location, + self.network_domain, + self.status, + self.ip_version, + self.protocol, + self.source, + self.destination, + self.enabled, + ) + + +class DimensionDataFirewallAddress: + """ + The source or destination model in a firewall rule + """ + + def __init__( + self, + any_ip, + ip_address, + ip_prefix_size, + port_begin, + port_end, + address_list_id, + port_list_id, + ): + self.any_ip = any_ip + self.ip_address = ip_address + self.ip_prefix_size = ip_prefix_size + self.port_list_id = port_list_id + self.port_begin = port_begin + self.port_end = port_end + self.address_list_id = address_list_id + self.port_list_id = port_list_id + + def __repr__(self): + return ( + "" + % ( + self.any_ip, + self.ip_address, + self.ip_prefix_size, + self.port_begin, + self.port_end, + self.address_list_id, + self.port_list_id, + ) + ) + + +class DimensionDataNatRule: + """ + An IP NAT rule in a network domain + """ + + def __init__(self, id, network_domain, internal_ip, external_ip, status): + self.id = id + self.network_domain = network_domain + self.internal_ip = internal_ip + self.external_ip = external_ip + self.status = status + + def __repr__(self): + return ("") % (self.id, self.status) + + +class DimensionDataAntiAffinityRule: + """ + Anti-Affinity rule for DimensionData + + An Anti-Affinity rule ensures that servers in the rule will + not reside on the same VMware ESX host. + """ + + def __init__(self, id, node_list): + """ + Instantiate a new :class:`DimensionDataAntiAffinityRule` + + :param id: The ID of the Anti-Affinity rule + :type id: ``str`` + + :param node_list: List of node ids that belong in this rule + :type node_list: ``list`` of ``str`` + """ + self.id = id + self.node_list = node_list + + def __repr__(self): + return ("") % (self.id) + + +class DimensionDataVlan: + """ + DimensionData VLAN. + """ + + def __init__( + self, + id, + name, + description, + location, + network_domain, + status, + private_ipv4_range_address, + private_ipv4_range_size, + ipv6_range_address, + ipv6_range_size, + ipv4_gateway, + ipv6_gateway, + ): + """ + Initialize an instance of ``DimensionDataVlan`` + + :param id: The ID of the VLAN + :type id: ``str`` + + :param name: The name of the VLAN + :type name: ``str`` + + :param description: Plan text description of the VLAN + :type description: ``str`` + + :param location: The location (data center) of the VLAN + :type location: ``NodeLocation`` + + :param network_domain: The Network Domain that owns this VLAN + :type network_domain: :class:`DimensionDataNetworkDomain` + + :param status: The status of the VLAN + :type status: :class:`DimensionDataStatus` + + :param private_ipv4_range_address: The host address of the VLAN + IP space + :type private_ipv4_range_address: ``str`` + + :param private_ipv4_range_size: The size (e.g. '24') of the VLAN + as a CIDR range size + :type private_ipv4_range_size: ``int`` + + :param ipv6_range_address: The host address of the VLAN + IP space + :type ipv6_range_address: ``str`` + + :param ipv6_range_size: The size (e.g. '32') of the VLAN + as a CIDR range size + :type ipv6_range_size: ``int`` + + :param ipv4_gateway: The IPv4 default gateway address + :type ipv4_gateway: ``str`` + + :param ipv6_gateway: The IPv6 default gateway address + :type ipv6_gateway: ``str`` + """ + self.id = str(id) + self.name = name + self.location = location + self.description = description + self.network_domain = network_domain + self.status = status + self.private_ipv4_range_address = private_ipv4_range_address + self.private_ipv4_range_size = private_ipv4_range_size + self.ipv6_range_address = ipv6_range_address + self.ipv6_range_size = ipv6_range_size + self.ipv4_gateway = ipv4_gateway + self.ipv6_gateway = ipv6_gateway + + def __repr__(self): + return ( + "" + ) % (self.id, self.name, self.description, self.location, self.status) + + +class DimensionDataPool: + """ + DimensionData VIP Pool. + """ + + def __init__( + self, + id, + name, + description, + status, + load_balance_method, + health_monitor_id, + service_down_action, + slow_ramp_time, + ): + """ + Initialize an instance of ``DimensionDataPool`` + + :param id: The ID of the pool + :type id: ``str`` + + :param name: The name of the pool + :type name: ``str`` + + :param description: Plan text description of the pool + :type description: ``str`` + + :param status: The status of the pool + :type status: :class:`DimensionDataStatus` + + :param load_balance_method: The load balancer method + :type load_balance_method: ``str`` + + :param health_monitor_id: The ID of the health monitor + :type health_monitor_id: ``str`` + + :param service_down_action: Action to take when pool is down + :type service_down_action: ``str`` + + :param slow_ramp_time: The ramp-up time for service recovery + :type slow_ramp_time: ``int`` + """ + self.id = str(id) + self.name = name + self.description = description + self.status = status + self.load_balance_method = load_balance_method + self.health_monitor_id = health_monitor_id + self.service_down_action = service_down_action + self.slow_ramp_time = slow_ramp_time + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.description, + self.status, + ) + + +class DimensionDataPoolMember: + """ + DimensionData VIP Pool Member. + """ + + def __init__(self, id, name, status, ip, port, node_id): + """ + Initialize an instance of ``DimensionDataPoolMember`` + + :param id: The ID of the pool member + :type id: ``str`` + + :param name: The name of the pool member + :type name: ``str`` + + :param status: The status of the pool + :type status: :class:`DimensionDataStatus` + + :param ip: The IP of the pool member + :type ip: ``str`` + + :param port: The port of the pool member + :type port: ``int`` + + :param node_id: The ID of the associated node + :type node_id: ``str`` + """ + self.id = str(id) + self.name = name + self.status = status + self.ip = ip + self.port = port + self.node_id = node_id + + def __repr__(self): + return ( + "" + ) % (self.id, self.name, self.ip, self.status, self.port, self.node_id) + + +class DimensionDataVIPNode: + def __init__( + self, + id, + name, + status, + ip, + connection_limit="10000", + connection_rate_limit="10000", + ): + """ + Initialize an instance of :class:`DimensionDataVIPNode` + + :param id: The ID of the node + :type id: ``str`` + + :param name: The name of the node + :type name: ``str`` + + :param status: The status of the node + :type status: :class:`DimensionDataStatus` + + :param ip: The IP of the node + :type ip: ``str`` + + :param connection_limit: The total connection limit for the node + :type connection_limit: ``int`` + + :param connection_rate_limit: The rate limit for the node + :type connection_rate_limit: ``int`` + """ + self.id = str(id) + self.name = name + self.status = status + self.ip = ip + self.connection_limit = connection_limit + self.connection_rate_limit = connection_rate_limit + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.status, + self.ip, + ) + + +class DimensionDataVirtualListener: + """ + DimensionData Virtual Listener. + """ + + def __init__(self, id, name, status, ip): + """ + Initialize an instance of :class:`DimensionDataVirtualListener` + + :param id: The ID of the listener + :type id: ``str`` + + :param name: The name of the listener + :type name: ``str`` + + :param status: The status of the listener + :type status: :class:`DimensionDataStatus` + + :param ip: The IP of the listener + :type ip: ``str`` + """ + self.id = str(id) + self.name = name + self.status = status + self.ip = ip + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.status, + self.ip, + ) + + +class DimensionDataDefaultHealthMonitor: + """ + A default health monitor for a VIP (node, pool or listener) + """ + + def __init__(self, id, name, node_compatible, pool_compatible): + """ + Initialize an instance of :class:`DimensionDataDefaultHealthMonitor` + + :param id: The ID of the monitor + :type id: ``str`` + + :param name: The name of the monitor + :type name: ``str`` + + :param node_compatible: Is a monitor capable of monitoring nodes + :type node_compatible: ``bool`` + + :param pool_compatible: Is a monitor capable of monitoring pools + :type pool_compatible: ``bool`` + """ + self.id = id + self.name = name + self.node_compatible = node_compatible + self.pool_compatible = pool_compatible + + def __repr__(self): + return ("") % ( + self.id, + self.name, + ) + + +class DimensionDataPersistenceProfile: + """ + Each Persistence Profile declares the combination of Virtual Listener + type and protocol with which it is + compatible and whether or not it is compatible as a + Fallback Persistence Profile. + """ + + def __init__(self, id, name, compatible_listeners, fallback_compatible): + """ + Initialize an instance of :class:`DimensionDataPersistenceProfile` + + :param id: The ID of the profile + :type id: ``str`` + + :param name: The name of the profile + :type name: ``str`` + + :param compatible_listeners: List of compatible Virtual Listener types + :type compatible_listeners: ``list`` of + :class:`DimensionDataVirtualListenerCompatibility` + + :param fallback_compatible: Is capable as a fallback profile + :type fallback_compatible: ``bool`` + """ + self.id = id + self.name = name + self.compatible_listeners = compatible_listeners + self.fallback_compatible = fallback_compatible + + def __repr__(self): + return ("") % ( + self.id, + self.name, + ) + + +class DimensionDataDefaultiRule: + """ + A default iRule for a network domain, can be applied to a listener + """ + + def __init__(self, id, name, compatible_listeners): + """ + Initialize an instance of :class:`DimensionDataDefaultiRule` + + :param id: The ID of the iRule + :type id: ``str`` + + :param name: The name of the iRule + :type name: ``str`` + + :param compatible_listeners: List of compatible Virtual Listener types + :type compatible_listeners: ``list`` of + :class:`DimensionDataVirtualListenerCompatibility` + """ + self.id = id + self.name = name + self.compatible_listeners = compatible_listeners + + def __repr__(self): + return ("") % (self.id, self.name) + + +class DimensionDataVirtualListenerCompatibility: + """ + A compatibility preference for a persistence profile or iRule + specifies which virtual listener types this profile or iRule can be + applied to. + """ + + def __init__(self, type, protocol): + self.type = type + self.protocol = protocol + + def __repr__(self): + return ("") % ( + self.type, + self.protocol, + ) + + +class DimensionDataBackupDetails: + """ + Dimension Data Backup Details represents information about + a targets backups configuration + """ + + def __init__(self, asset_id, service_plan, status, clients=None): + """ + Initialize an instance of :class:`DimensionDataBackupDetails` + + :param asset_id: Asset identification for backups + :type asset_id: ``str`` + + :param service_plan: The service plan for backups. i.e (Essentials) + :type service_plan: ``str`` + + :param status: The overall status this backup target. + i.e. (unregistered) + :type status: ``str`` + + :param clients: Backup clients attached to this target + :type clients: ``list`` of :class:`DimensionDataBackupClient` + """ + self.asset_id = asset_id + self.service_plan = service_plan + self.status = status + self.clients = clients + + def __repr__(self): + return ("") % (self.asset_id) + + +class DimensionDataBackupClient: + """ + An object that represents a backup client + """ + + def __init__( + self, + id, + type, + status, + schedule_policy, + storage_policy, + download_url, + alert=None, + running_job=None, + ): + """ + Initialize an instance of :class:`DimensionDataBackupClient` + + :param id: Unique ID for the client + :type id: ``str`` + + :param type: The type of client that this client is + :type type: :class:`DimensionDataBackupClientType` + + :param status: The states of this particular backup client. + i.e. (Unregistered) + :type status: ``str`` + + :param schedule_policy: The schedule policy for this client + NOTE: Dimension Data only sends back the name + of the schedule policy, no further details + :type schedule_policy: ``str`` + + :param storage_policy: The storage policy for this client + NOTE: Dimension Data only sends back the name + of the storage policy, no further details + :type storage_policy: ``str`` + + :param download_url: The download url for this client + :type download_url: ``str`` + + :param alert: The alert configured for this backup client (optional) + :type alert: :class:`DimensionDataBackupClientAlert` + + :param alert: The running job for the client (optional) + :type alert: :class:`DimensionDataBackupClientRunningJob` + """ + self.id = id + self.type = type + self.status = status + self.schedule_policy = schedule_policy + self.storage_policy = storage_policy + self.download_url = download_url + self.alert = alert + self.running_job = running_job + + def __repr__(self): + return ("") % (self.id) + + +class DimensionDataBackupClientAlert: + """ + An alert for a backup client + """ + + def __init__(self, trigger, notify_list=[]): + """ + Initialize an instance of :class:`DimensionDataBackupClientAlert` + + :param trigger: Trigger type for the client i.e. ON_FAILURE + :type trigger: ``str`` + + :param notify_list: List of email addresses that are notified + when the alert is fired + :type notify_list: ``list`` of ``str`` + """ + self.trigger = trigger + self.notify_list = notify_list + + def __repr__(self): + return ("") % (self.trigger) + + +class DimensionDataBackupClientRunningJob: + """ + A running job for a given backup client + """ + + def __init__(self, id, status, percentage=0): + """ + Initialize an instance of :class:`DimensionDataBackupClientRunningJob` + + :param id: The unique ID of the job + :type id: ``str`` + + :param status: The status of the job i.e. Waiting + :type status: ``str`` + + :param percentage: The percentage completion of the job + :type percentage: ``int`` + """ + self.id = id + self.percentage = percentage + self.status = status + + def __repr__(self): + return ("") % (self.id) + + +class DimensionDataBackupClientType: + """ + A client type object for backups + """ + + def __init__(self, type, is_file_system, description): + """ + Initialize an instance of :class:`DimensionDataBackupClientType` + + :param type: The type of client i.e. (FA.Linux, MySQL, etc.) + :type type: ``str`` + + :param is_file_system: The name of the iRule + :type is_file_system: ``bool`` + + :param description: Description of the client + :type description: ``str`` + """ + self.type = type + self.is_file_system = is_file_system + self.description = description + + def __repr__(self): + return ("") % (self.type) + + +class DimensionDataBackupStoragePolicy: + """ + A representation of a storage policy + """ + + def __init__(self, name, retention_period, secondary_location): + """ + Initialize an instance of :class:`DimensionDataBackupStoragePolicy` + + :param name: The name of the storage policy i.e. 14 Day Storage Policy + :type name: ``str`` + + :param retention_period: How long to keep the backup in days + :type retention_period: ``int`` + + :param secondary_location: The secondary location i.e. Primary + :type secondary_location: ``str`` + """ + self.name = name + self.retention_period = retention_period + self.secondary_location = secondary_location + + def __repr__(self): + return ("") % (self.name) + + +class DimensionDataBackupSchedulePolicy: + """ + A representation of a schedule policy + """ + + def __init__(self, name, description): + """ + Initialize an instance of :class:`DimensionDataBackupSchedulePolicy` + + :param name: The name of the policy i.e 12AM - 6AM + :type name: ``str`` + + :param description: Short summary of the details of the policy + :type description: ``str`` + """ + self.name = name + self.description = description + + def __repr__(self): + return ("") % (self.name) + + +class DimensionDataTag: + """ + A representation of a Tag in Dimension Data + A Tag first must have a Tag Key, then an asset is tag with + a key and an option value. Tags can be queried later to filter assets + and also show up on usage report if so desired. + """ + + def __init__(self, asset_type, asset_id, asset_name, datacenter, key, value): + """ + Initialize an instance of :class:`DimensionDataTag` + + :param asset_type: The type of asset. Current asset types: + SERVER, VLAN, NETWORK_DOMAIN, CUSTOMER_IMAGE, + PUBLIC_IP_BLOCK, ACCOUNT + :type asset_type: ``str`` + + :param asset_id: The GUID of the asset that is tagged + :type asset_id: ``str`` + + :param asset_name: The name of the asset that is tagged + :type asset_name: ``str`` + + :param datacenter: The short datacenter name of the tagged asset + :type datacenter: ``str`` + + :param key: The tagged key + :type key: :class:`DimensionDataTagKey` + + :param value: The tagged value + :type value: ``None`` or ``str`` + """ + self.asset_type = asset_type + self.asset_id = asset_id + self.asset_name = asset_name + self.datacenter = datacenter + self.key = key + self.value = value + + def __repr__(self): + return ("") % ( + self.asset_name, + self.key.name, + self.value, + ) + + +class DimensionDataTagKey: + """ + A representation of a Tag Key in Dimension Data + A tag key is required to tag an asset + """ + + def __init__(self, id, name, description, value_required, display_on_report): + """ + Initialize an instance of :class:`DimensionDataTagKey` + + :param id: GUID of the tag key + :type id: ``str`` + + :param name: Name of the tag key + :type name: ``str`` + + :param description: Description of the tag key + :type description: ``str`` + + :param value_required: If a value is required for this tag key + :type value_required: ``bool`` + + :param display_on_report: If this tag key should be displayed on + usage reports + :type display_on_report: ``bool`` + """ + self.id = id + self.name = name + self.description = description + self.value_required = value_required + self.display_on_report = display_on_report + + def __repr__(self): + return ("") % (self.name) + + +class DimensionDataIpAddressList: + """ + DimensionData IP Address list + """ + + def __init__( + self, + id, + name, + description, + ip_version, + ip_address_collection, + state, + create_time, + child_ip_address_lists=None, + ): + """" + Initialize an instance of :class:`DimensionDataIpAddressList` + + :param id: GUID of the IP Address List key + :type id: ``str`` + + :param name: Name of the IP Address List + :type name: ``str`` + + :param description: Description of the IP Address List + :type description: ``str`` + + :param ip_version: IP version. E.g. IPV4, IPV6 + :type ip_version: ``str`` + + :param ip_address_collection: Collection of DimensionDataIpAddress + :type ip_address_collection: ``List`` + + :param state: IP Address list state + :type state: ``str`` + + :param create_time: IP Address List created time + :type create_time: ``date time`` + + :param child_ip_address_lists: List of IP address list to be included + :type child_ip_address_lists: List \ + of :class:'DimensionDataIpAddressList' + """ + self.id = id + self.name = name + self.description = description + self.ip_version = ip_version + self.ip_address_collection = ip_address_collection + self.state = state + self.create_time = create_time + self.child_ip_address_lists = child_ip_address_lists + + def __repr__(self): + return ( + "" + % ( + self.id, + self.name, + self.description, + self.ip_version, + self.ip_address_collection, + self.state, + self.create_time, + self.child_ip_address_lists, + ) + ) + + +class DimensionDataChildIpAddressList: + """ + DimensionData Child IP Address list + """ + + def __init__(self, id, name): + """ " + Initialize an instance of :class:`DimensionDataChildIpAddressList` + + :param id: GUID of the IP Address List key + :type id: ``str`` + + :param name: Name of the IP Address List + :type name: ``str`` + + """ + self.id = id + self.name = name + + def __repr__(self): + return "".format( + self.id, + self.name, + ) + + +class DimensionDataIpAddress: + """ + A representation of IP Address in Dimension Data + """ + + def __init__(self, begin, end=None, prefix_size=None): + """ + Initialize an instance of :class:`DimensionDataIpAddress` + + :param begin: IP Address Begin + :type begin: ``str`` + + :param end: IP Address end + :type end: ``str`` + + :param prefixSize: IP Address prefix size + :type prefixSize: ``int`` + """ + self.begin = begin + self.end = end + self.prefix_size = prefix_size + + def __repr__(self): + return "".format( + self.begin, + self.end, + self.prefix_size, + ) + + +class DimensionDataPortList: + """ + DimensionData Port list + """ + + def __init__( + self, + id, + name, + description, + port_collection, + child_portlist_list, + state, + create_time, + ): + """ " + Initialize an instance of :class:`DimensionDataPortList` + + :param id: GUID of the Port List key + :type id: ``str`` + + :param name: Name of the Port List + :type name: ``str`` + + :param description: Description of the Port List + :type description: ``str`` + + :param port_collection: Collection of DimensionDataPort + :type port_collection: ``List`` + + :param child_portlist_list: Collection of DimensionDataChildPort + :type child_portlist_list: ``List`` + + :param state: Port list state + :type state: ``str`` + + :param create_time: Port List created time + :type create_time: ``date time`` + """ + self.id = id + self.name = name + self.description = description + self.port_collection = port_collection + self.child_portlist_list = child_portlist_list + self.state = state + self.create_time = create_time + + def __repr__(self): + return ( + "" + % ( + self.id, + self.name, + self.description, + self.port_collection, + self.child_portlist_list, + self.state, + self.create_time, + ) + ) + + +class DimensionDataChildPortList: + """ + DimensionData Child Port list + """ + + def __init__(self, id, name): + """ " + Initialize an instance of :class:`DimensionDataChildIpAddressList` + + :param id: GUID of the child port list key + :type id: ``str`` + + :param name: Name of the child port List + :type name: ``str`` + + """ + self.id = id + self.name = name + + def __repr__(self): + return "".format(self.id, self.name) + + +class DimensionDataPort: + """ + A representation of Port in Dimension Data + """ + + def __init__(self, begin, end=None): + """ + Initialize an instance of :class:`DimensionDataPort` + + :param begin: Port Number Begin + :type begin: ``str`` + + :param end: Port Number end + :type end: ``str`` + """ + self.begin = begin + self.end = end + + def __repr__(self): + return "".format(self.begin, self.end) + + +class DimensionDataNic: + """ + A representation of Network Adapter in Dimension Data + """ + + def __init__(self, private_ip_v4=None, vlan=None, network_adapter_name=None): + """ + Initialize an instance of :class:`DimensionDataNic` + + :param private_ip_v4: IPv4 + :type private_ip_v4: ``str`` + + :param vlan: Network VLAN + :type vlan: class: DimensionDataVlan or ``str`` + + :param network_adapter_name: Network Adapter Name + :type network_adapter_name: ``str`` + """ + self.private_ip_v4 = private_ip_v4 + self.vlan = vlan + self.network_adapter_name = network_adapter_name + + def __repr__(self): + return "" % ( + self.private_ip_v4, + self.vlan, + self.network_adapter_name, + ) diff --git a/libcloud/common/dnsimple.py b/libcloud/common/dnsimple.py new file mode 100644 index 0000000000..d01ba17515 --- /dev/null +++ b/libcloud/common/dnsimple.py @@ -0,0 +1,51 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.utils.py3 import httplib +from libcloud.common.base import JsonResponse, ConnectionUserAndKey + + +class DNSimpleDNSResponse(JsonResponse): + def success(self): + """ + Determine if our request was successful. + + The meaning of this can be arbitrary; did we receive OK status? Did + the node get created? Were we authenticated? + + :rtype: ``bool`` + :return: ``True`` or ``False`` + """ + # response.success() only checks for 200 and 201 codes. Should we + # add 204? + return self.status in [httplib.OK, httplib.CREATED, httplib.NO_CONTENT] + + +class DNSimpleDNSConnection(ConnectionUserAndKey): + host = "api.dnsimple.com" + responseCls = DNSimpleDNSResponse + + def add_default_headers(self, headers): + """ + Add headers that are necessary for every request + + This method adds ``token`` to the request. + """ + # TODO: fijarse sobre que info se paso como parametro y en base + # a esto, fijar el header + headers["X-DNSimple-Token"] = "{}:{}".format(self.user_id, self.key) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + return headers diff --git a/libcloud/common/dnspod.py b/libcloud/common/dnspod.py new file mode 100644 index 0000000000..464df6fbd9 --- /dev/null +++ b/libcloud/common/dnspod.py @@ -0,0 +1,77 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Dict, List + +from libcloud.common.base import JsonResponse, ConnectionKey + +__all__ = ["API_HOST", "DNSPodException", "DNSPodResponse", "DNSPodConnection"] + +# Endpoint for dnspod api +API_HOST = "api.dnspod.com" + + +class DNSPodResponse(JsonResponse): + errors: List[Dict] + objects: List[Dict] + + def __init__(self, response, connection): + # Use fresh per-instance lists: the previous class-level lists were + # shared by every response object of the process, so parsed entries + # (including errors) leaked between requests and made success() + # report stale failures. They must exist before super().__init__(), + # which calls success(). + self.errors = [] + self.objects = [] + super().__init__(response=response, connection=connection) + self.errors, self.objects = self.parse_body_and_errors() + if not self.success(): + raise DNSPodException(code=self.status, message=self.errors.pop()["status"]["message"]) + + def parse_body_and_errors(self): + js = super().parse_body() + if "status" in js and js["status"]["code"] != "1": + self.errors.append(js) + else: + self.objects.append(js) + + return self.errors, self.objects + + def success(self): + return len(self.errors) == 0 + + +class DNSPodConnection(ConnectionKey): + host = API_HOST + responseCls = DNSPodResponse + + def add_default_headers(self, headers): + headers["Content-Type"] = "application/x-www-form-urlencoded" + headers["Accept"] = "text/json" + + return headers + + +class DNSPodException(Exception): + def __init__(self, code, message): + self.code = code + self.message = message + self.args = (code, message) + + def __str__(self): + return "{} {}".format(self.code, self.message) + + def __repr__(self): + return "DNSPodException {} {}".format(self.code, self.message) diff --git a/libcloud/common/durabledns.py b/libcloud/common/durabledns.py new file mode 100644 index 0000000000..1516409983 --- /dev/null +++ b/libcloud/common/durabledns.py @@ -0,0 +1,318 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import re +from typing import Dict, List +from xml.etree import ElementTree as ET # noqa + +from libcloud.common.base import XmlResponse, ConnectionUserAndKey + +# API HOST to connect +API_HOST = "durabledns.com" + + +def _schema_builder(urn_nid, method, attributes): + """ + Return a xml schema used to do an API request. + + :param urn_nid: API urn namespace id. + :type urn_nid: type: ``str`` + + :param method: API method. + :type method: type: ``str`` + + :param attributes: List of attributes to include. + :type attributes: ``list`` of ``str`` + + rtype: :class:`Element` + """ + soap = ET.Element("soap:Body", {"xmlns:m": "https://durabledns.com/services/dns/%s" % method}) + urn = ET.SubElement(soap, "urn:{}:{}".format(urn_nid, method)) + # Attributes specification + for attribute in attributes: + ET.SubElement(urn, "urn:{}:{}".format(urn_nid, attribute)) + return soap + + +SCHEMA_BUILDER_MAP = { + "list_zones": { + "urn_nid": "listZoneswsdl", + "method": "listZones", + "attributes": ["apiuser", "apikey"], + }, + "list_records": { + "urn_nid": "listRecordswsdl", + "method": "listRecords", + "attributes": ["apiuser", "apikey", "zonename"], + }, + "get_zone": { + "urn_nid": "getZonewsdl", + "method": "getZone", + "attributes": ["apiuser", "apikey", "zonename"], + }, + "get_record": { + "urn_nid": "getRecordwsdl", + "method": "getRecord", + "attributes": ["apiuser", "apikey", "zonename", "recordid"], + }, + "create_zone": { + "urn_nid": "createZonewsdl", + "method": "createZone", + "attributes": [ + "apiuser", + "apikey", + "zonename", + "ns", + "mbox", + "refresh", + "retry", + "expire", + "minimum", + "ttl", + "xfer", + "update_acl", + ], + }, + "create_record": { + "urn_nid": "createRecordwsdl", + "method": "createRecord", + "attributes": [ + "apiuser", + "apikey", + "zonename", + "name", + "type", + "data", + "aux", + "ttl", + "ddns_enabled", + ], + }, + "update_zone": { + "urn_nid": "updateZonewsdl", + "method": "updateZone", + "attributes": [ + "apiuser", + "apikey", + "zonename", + "ns", + "mbox", + "refresh", + "retry", + "expire", + "minimum", + "ttl", + "xfer", + "update_acl", + ], + }, + "update_record": { + "urn_nid": "updateRecordwsdl", + "method": "updateRecord", + "attributes": [ + "apiuser", + "apikey", + "zonename", + "id", + "name", + "aux", + "data", + "ttl", + "ddns_enabled", + ], + }, + "delete_zone": { + "urn_nid": "deleteZonewsdl", + "method": "deleteZone", + "attributes": ["apiuser", "apikey", "zonename"], + }, + "delete_record": { + "urn_nid": "deleteRecordwsdl", + "method": "deleteRecord", + "attributes": ["apiuser", "apikey", "zonename", "id"], + }, +} + + +class DurableDNSException(Exception): + def __init__(self, code, message): + self.code = code + self.message = message + self.args = (code, message) + + def __str__(self): + return "{} {}".format(self.code, self.message) + + def __repr__(self): + return "DurableDNSException {} {}".format(self.code, self.message) + + +class DurableResponse(XmlResponse): + errors = [] # type: List[Dict] + objects = [] # type: List[Dict] + + def __init__(self, response, connection): + super().__init__(response=response, connection=connection) + + self.objects, self.errors = self.parse_body_and_error() + if self.errors: + raise self._make_excp(self.errors[0]) + + def parse_body_and_error(self): + """ + Used to parse body from httplib.HttpResponse object. + """ + objects = [] + errors = [] + error_dict = {} + extra = {} + zone_dict = {} + record_dict = {} + xml_obj = self.parse_body() + + # pylint: disable=no-member + envelop_body = list(xml_obj)[0] + method_resp = list(envelop_body)[0] + # parse the xml_obj + # handle errors + if "Fault" in method_resp.tag: + fault = [fault for fault in list(method_resp) if fault.tag == "faultstring"][0] + error_dict["ERRORMESSAGE"] = fault.text.strip() + error_dict["ERRORCODE"] = self.status + errors.append(error_dict) + + # parsing response from listZonesResponse + if "listZonesResponse" in method_resp.tag: + answer = list(method_resp)[0] + for element in answer: + zone_dict["id"] = list(element)[0].text + objects.append(zone_dict) + # reset the zone_dict + zone_dict = {} + # parse response from listRecordsResponse + if "listRecordsResponse" in method_resp.tag: + answer = list(method_resp)[0] + for element in answer: + for child in list(element): + if child.tag == "id": + record_dict["id"] = child.text.strip() + objects.append(record_dict) + # reset the record_dict for later usage + record_dict = {} + # parse response from getZoneResponse + if "getZoneResponse" in method_resp.tag: + for child in list(method_resp): + if child.tag == "origin": + zone_dict["id"] = child.text.strip() + zone_dict["domain"] = child.text.strip() + elif child.tag == "ttl": + zone_dict["ttl"] = int(child.text.strip()) + elif child.tag == "retry": + extra["retry"] = int(child.text.strip()) + elif child.tag == "expire": + extra["expire"] = int(child.text.strip()) + elif child.tag == "minimum": + extra["minimum"] = int(child.text.strip()) + else: + if child.text: + extra[child.tag] = child.text.strip() + else: + extra[child.tag] = "" + zone_dict["extra"] = extra + objects.append(zone_dict) + # parse response from getRecordResponse + if "getRecordResponse" in method_resp.tag: + answer = list(method_resp)[0] + for child in list(method_resp): + if child.tag == "id" and child.text: + record_dict["id"] = child.text.strip() + elif child.tag == "name" and child.text: + record_dict["name"] = child.text.strip() + elif child.tag == "type" and child.text: + record_dict["type"] = child.text.strip() + elif child.tag == "data" and child.text: + record_dict["data"] = child.text.strip() + elif child.tag == "aux" and child.text: + record_dict["aux"] = child.text.strip() + elif child.tag == "ttl" and child.text: + record_dict["ttl"] = child.text.strip() + if not record_dict: + error_dict["ERRORMESSAGE"] = "Record does not exist" + error_dict["ERRORCODE"] = 404 + errors.append(error_dict) + objects.append(record_dict) + record_dict = {} + if "createZoneResponse" in method_resp.tag: + answer = list(method_resp)[0] + if answer.tag == "return" and answer.text: + record_dict["id"] = answer.text.strip() + objects.append(record_dict) + # catch Record does not exists error when deleting record + if "deleteRecordResponse" in method_resp.tag: + answer = list(method_resp)[0] + if "Record does not exists" in answer.text.strip(): + errors.append({"ERRORMESSAGE": answer.text.strip(), "ERRORCODE": self.status}) + # parse response in createRecordResponse + if "createRecordResponse" in method_resp.tag: + answer = list(method_resp)[0] + record_dict["id"] = answer.text.strip() + objects.append(record_dict) + record_dict = {} + + return (objects, errors) + + def parse_body(self): + # A problem arise in the api response because there are undeclared + # xml namespaces. In order to fix that at the moment, we use the + # _fix_response method to clean up since we won't always have lxml + # library. + self._fix_response() + body = super().parse_body() + return body + + def success(self): + """ + Used to determine if the request was successful. + """ + return len(self.errors) == 0 + + def _make_excp(self, error): + return DurableDNSException(error["ERRORCODE"], error["ERRORMESSAGE"]) + + def _fix_response(self): + items = re.findall('', self.body, flags=0) + for item in items: + parts = item.split(" ") + prefix = parts[0].replace("<", "").split(":")[1] + new_item = "<" + prefix + ">" + close_tag = "" + new_close_tag = "" + self.body = self.body.replace(item, new_item) + self.body = self.body.replace(close_tag, new_close_tag) + + +class DurableConnection(ConnectionUserAndKey): + host = API_HOST + responseCls = DurableResponse + + def add_default_params(self, params): + params["user_id"] = self.user_id + params["key"] = self.key + return params + + def add_default_headers(self, headers): + headers["Content-Type"] = "text/xml" + headers["Content-Encoding"] = "gzip; charset=ISO-8859-1" + return headers diff --git a/libcloud/common/exceptions.py b/libcloud/common/exceptions.py new file mode 100644 index 0000000000..6c6bcfa186 --- /dev/null +++ b/libcloud/common/exceptions.py @@ -0,0 +1,90 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import time +from email.utils import mktime_tz, parsedate_tz + +__all__ = ["BaseHTTPError", "RateLimitReachedError", "exception_from_message"] + + +class BaseHTTPError(Exception): + """ + The base exception class for all HTTP related exceptions. + """ + + def __init__(self, code, message, headers=None): + self.code = code + self.message = message + self.headers = headers + # preserve old exception behavior for tests that + # look for e.args[0] + super().__init__(message) + + def __str__(self): + return self.message + + +class RateLimitReachedError(BaseHTTPError): + """ + HTTP 429 - Rate limit: you've sent too many requests for this time period. + """ + + code = 429 + message = "%s Rate limit exceeded" % (code) + + def __init__(self, *args, **kwargs): + headers = kwargs.pop("headers", None) + super().__init__(self.code, self.message, headers) + if self.headers is not None: + self.retry_after = float(self.headers.get("retry-after", 0)) + else: + self.retry_after = 0 + + +_error_classes = [RateLimitReachedError] +_code_map = {c.code: c for c in _error_classes} + + +def exception_from_message(code, message, headers=None): + """ + Return an instance of BaseHTTPException or subclass based on response code. + + If headers include Retry-After, RFC 2616 says that its value may be one of + two formats: HTTP-date or delta-seconds, for example: + + Retry-After: Fri, 31 Dec 1999 23:59:59 GMT + Retry-After: 120 + + If Retry-After comes in HTTP-date, it'll be translated to a positive + delta-seconds value when passing it to the exception constructor. + + Also, RFC 2616 says that Retry-After isn't just only applicable to 429 + HTTP status, but also to other responses, like 503 and 3xx. + + Usage:: + raise exception_from_message(code=self.status, + message=self.parse_error(), + headers=self.headers) + """ + kwargs = {"code": code, "message": message, "headers": headers} + + if headers and "retry-after" in headers: + http_date = parsedate_tz(headers["retry-after"]) + if http_date is not None: + # Convert HTTP-date to delay-seconds + delay = max(0, int(mktime_tz(http_date) - time.time())) + headers["retry-after"] = str(delay) + cls = _code_map.get(code, BaseHTTPError) + return cls(**kwargs) diff --git a/libcloud/common/gandi.py b/libcloud/common/gandi.py index 11e96221b8..6d76c0ff9f 100644 --- a/libcloud/common/gandi.py +++ b/libcloud/common/gandi.py @@ -18,28 +18,31 @@ import time import hashlib -import sys from libcloud.utils.py3 import b - from libcloud.common.base import ConnectionKey from libcloud.common.xmlrpc import XMLRPCResponse, XMLRPCConnection # Global constants -DEFAULT_TIMEOUT = 600 # operation pooling max seconds -DEFAULT_INTERVAL = 20 # seconds between 2 operation.info +DEFAULT_TIMEOUT = 600 # operation pooling max seconds +DEFAULT_INTERVAL = 20 # seconds between 2 operation.info class GandiException(Exception): """ Exception class for Gandi driver """ + def __str__(self): - return '(%u) %s' % (self.args[0], self.args[1]) + # pylint: disable=unsubscriptable-object + + return "({}) {}".format(self.args[0], self.args[1]) def __repr__(self): - return '' % (self.args[0], self.args[1]) + # pylint: disable=unsubscriptable-object + + return ''.format(self.args[0], self.args[1]) class GandiResponse(XMLRPCResponse): @@ -54,57 +57,75 @@ class GandiConnection(XMLRPCConnection, ConnectionKey): """ responseCls = GandiResponse - host = 'rpc.gandi.net' - endpoint = '/xmlrpc/' - - def __init__(self, key, secure=True): + host = "rpc.gandi.net" + endpoint = "/xmlrpc/" + + def __init__( + self, + key, + secure=True, + timeout=None, + retry_delay=None, + backoff=None, + proxy_url=None, + ): # Note: Method resolution order in this case is # XMLRPCConnection -> Connection and Connection doesn't take key as the # first argument so we specify a keyword argument instead. # Previously it was GandiConnection -> ConnectionKey so it worked fine. - super(GandiConnection, self).__init__(key=key, secure=secure) + super().__init__( + key=key, + secure=secure, + timeout=timeout, + retry_delay=retry_delay, + backoff=backoff, + proxy_url=proxy_url, + ) self.driver = BaseGandiDriver def request(self, method, *args): - args = (self.key, ) + args - return super(GandiConnection, self).request(method, *args) + args = (self.key,) + args + + return super().request(method, *args) -class BaseGandiDriver(object): +class BaseGandiDriver: """ Gandi base driver """ + connectionCls = GandiConnection - name = 'Gandi' + name = "Gandi" # Specific methods for gandi - def _wait_operation(self, id, timeout=DEFAULT_TIMEOUT, - check_interval=DEFAULT_INTERVAL): - """ Wait for an operation to succeed""" + def _wait_operation(self, id, timeout=DEFAULT_TIMEOUT, check_interval=DEFAULT_INTERVAL): + """Wait for an operation to succeed""" for i in range(0, timeout, check_interval): try: - op = self.connection.request('operation.info', int(id)).object + # pylint: disable=no-member + op = self.connection.request("operation.info", int(id)).object - if op['step'] == 'DONE': + if op["step"] == "DONE": return True - if op['step'] in ['ERROR', 'CANCEL']: + + if op["step"] in ["ERROR", "CANCEL"]: return False except (KeyError, IndexError): pass - except Exception: - e = sys.exc_info()[1] + except Exception as e: raise GandiException(1002, e) time.sleep(check_interval) + return False -class BaseObject(object): +class BaseObject: """Base class for objects not conventional""" - uuid_prefix = '' + uuid_prefix = "" def __init__(self, id, state, driver): self.id = str(id) if id else None @@ -130,9 +151,9 @@ def get_uuid(self): Note, for example, that this example will always produce the same UUID! """ - hashstring = '%s:%s:%s' % \ - (self.uuid_prefix, self.id, self.driver.type) - return hashlib.sha1(b(hashstring)).hexdigest() + hashstring = "{}:{}:{}".format(self.uuid_prefix, self.id, self.driver.type) + + return hashlib.sha1(b(hashstring)).hexdigest() # nosec class IPAddress(BaseObject): @@ -140,17 +161,21 @@ class IPAddress(BaseObject): Provide a common interface for ip addresses """ - uuid_prefix = 'inet:' + uuid_prefix = "inet:" def __init__(self, id, state, inet, driver, version=4, extra=None): - super(IPAddress, self).__init__(id, state, driver) + super().__init__(id, state, driver) self.inet = inet self.version = version self.extra = extra or {} def __repr__(self): - return (('') - % (self.id, self.inet, self.state, self.driver.name)) + return ("") % ( + self.id, + self.inet, + self.state, + self.driver.name, + ) class NetworkInterface(BaseObject): @@ -158,32 +183,40 @@ class NetworkInterface(BaseObject): Provide a common interface for network interfaces """ - uuid_prefix = 'if:' + uuid_prefix = "if:" - def __init__(self, id, state, mac_address, driver, - ips=None, node_id=None, extra=None): - super(NetworkInterface, self).__init__(id, state, driver) + def __init__(self, id, state, mac_address, driver, ips=None, node_id=None, extra=None): + super().__init__(id, state, driver) self.mac = mac_address self.ips = ips or {} self.node_id = node_id self.extra = extra or {} def __repr__(self): - return (('') - % (self.id, self.mac, self.state, self.driver.name)) + return ("") % ( + self.id, + self.mac, + self.state, + self.driver.name, + ) class Disk(BaseObject): """ Gandi disk component """ + def __init__(self, id, state, name, driver, size, extra=None): - super(Disk, self).__init__(id, state, driver) + super().__init__(id, state, driver) self.name = name self.size = size self.extra = extra or {} def __repr__(self): - return ( - ('') - % (self.id, self.name, self.state, self.size, self.driver.name)) + return ("") % ( + self.id, + self.name, + self.state, + self.size, + self.driver.name, + ) diff --git a/libcloud/common/gandi_live.py b/libcloud/common/gandi_live.py new file mode 100644 index 0000000000..84099a87b2 --- /dev/null +++ b/libcloud/common/gandi_live.py @@ -0,0 +1,251 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Gandi Live driver base classes +""" + +import json + +from libcloud.utils.py3 import httplib +from libcloud.common.base import JsonResponse, ConnectionKey +from libcloud.common.types import ProviderError + +__all__ = [ + "API_HOST", + "GandiLiveBaseError", + "JsonParseError", + "ResourceNotFoundError", + "InvalidRequestError", + "ResourceConflictError", + "GandiLiveResponse", + "GandiLiveConnection", + "BaseGandiLiveDriver", +] + +API_HOST = "dns.api.gandi.net" + + +class GandiLiveBaseError(ProviderError): + """ + Exception class for Gandi Live driver + """ + + pass + + +class JsonParseError(GandiLiveBaseError): + pass + + +# Example: +# { +# "code": 404, +# "message": "Unknown zone", +# "object": "LocalizedHTTPNotFound", +# "cause": "Not Found" +# } +class ResourceNotFoundError(GandiLiveBaseError): + pass + + +# Example: +# { +# "code": 400, +# "message": "zone or zone_uuid must be set", +# "object": "HTTPBadRequest", +# "cause": "No zone set.", +# "errors": [ +# { +# "location": "body", +# "name": "zone_uuid", +# "description": "\"FAKEUUID\" is not a UUID" +# } +# ] +# } +class InvalidRequestError(GandiLiveBaseError): + pass + + +# Examples: +# { +# "code": 409, +# "message": "Zone Testing already exists", +# "object": "HTTPConflict", +# "cause": "Duplicate Entry" +# } +# { +# "code": 409, +# "message": "The domain example.org already exists", +# "object": "HTTPConflict", +# "cause": "Duplicate Entry" +# } +# { +# "code": 409, +# "message": "This zone is still used by 1 domains", +# "object": "HTTPConflict", +# "cause": "In use" +# } +class ResourceConflictError(GandiLiveBaseError): + pass + + +class GandiLiveResponse(JsonResponse): + """ + A Base Gandi Live Response class to derive from. + """ + + def success(self): + """ + Determine if our request was successful. + + For the Gandi Live response class, tag all responses as successful and + raise appropriate Exceptions from parse_body. + + :return: C{True} + """ + + return True + + def parse_body(self): + """ + Parse the JSON response body, or raise exceptions as appropriate. + + :return: JSON dictionary + :rtype: ``dict`` + """ + json_error = False + try: + body = json.loads(self.body) + except Exception: + # If there is both a JSON parsing error and an unsuccessful http + # response (like a 404), we want to raise the http error and not + # the JSON one, so don't raise JsonParseError here. + body = self.body + json_error = True + + # Service does not appear to return HTTP 202 Accepted for anything. + valid_http_codes = [ + httplib.OK, + httplib.CREATED, + ] + if self.status in valid_http_codes: + if json_error: + raise JsonParseError(body, self.status) + else: + return body + elif self.status == httplib.NO_CONTENT: + # Parse error for empty body is acceptable, but a non-empty body + # is not. + if len(body) > 0: + msg = '"No Content" response contained content' + raise GandiLiveBaseError(msg, self.status) + else: + return {} + elif self.status == httplib.NOT_FOUND: + message = self._get_error(body, json_error) + raise ResourceNotFoundError(message, self.status) + elif self.status == httplib.BAD_REQUEST: + message = self._get_error(body, json_error) + raise InvalidRequestError(message, self.status) + elif self.status == httplib.CONFLICT: + message = self._get_error(body, json_error) + raise ResourceConflictError(message, self.status) + else: + message = self._get_error(body, json_error) + raise GandiLiveBaseError(message, self.status) + + # Errors are not described at all in Gandi's official documentation. + # It appears when an error arises, a JSON object is returned along with + # an HTTP 4xx class code. The object is structured as: + # { + # code: , + # object: , + # message: , + # cause: , + # errors: [ + # { + # location: , + # name: , + # description: + # } + # ] + # } + # where + # is a number equal to the HTTP response status code + # is a string with some internal name for the status code + # is a string detailing what the problem is + # is a string that comes from a set of succinct problem summaries + # errors is optional; if present: + # is a string for which part of the request to look in + # is a string naming the parameter + # is a string detailing what the problem is + # Here we ignore object and combine message and cause along with an error + # if one or more exists. + def _get_error(self, body, json_error): + """ + Get the error code and message from a JSON response. + + Incorporate the first error if there are multiple errors. + + :param body: The body of the JSON response dictionary + :type body: ``dict`` + + :return: String containing error message + :rtype: ``str`` + """ + if not json_error and "cause" in body: + message = "{}: {}".format(body["cause"], body["message"]) + if "errors" in body: + err = body["errors"][0] + message = "{} ({} in {}: {})".format( + message, + err.get("location"), + err.get("name"), + err.get("description"), + ) + else: + message = body + + return message + + +class GandiLiveConnection(ConnectionKey): + """ + Connection class for the Gandi Live driver + """ + + responseCls = GandiLiveResponse + host = API_HOST + + def add_default_headers(self, headers): + """ + Returns default headers as a dictionary. + """ + headers["Content-Type"] = "application/json" + headers["X-Api-Key"] = self.key + return headers + + def encode_data(self, data): + """Encode data to JSON""" + return json.dumps(data) + + +class BaseGandiLiveDriver: + """ + Gandi Live base driver + """ + + connectionCls = GandiLiveConnection + name = "GandiLive" diff --git a/libcloud/common/gig_g8.py b/libcloud/common/gig_g8.py new file mode 100644 index 0000000000..603f869a60 --- /dev/null +++ b/libcloud/common/gig_g8.py @@ -0,0 +1,111 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import json +import time +import base64 + +import requests + +from libcloud.common.base import JsonResponse, ConnectionKey + +# normally we only use itsyou.online but you might want to work +# against staging.itsyou.online for some testing +IYO_URL = os.environ.get("IYO_URL", "https://itsyou.online") + + +class G8Connection(ConnectionKey): + """ + Connection class for G8 + """ + + responseCls = JsonResponse + + def add_default_headers(self, headers): + """ + Add headers that are necessary for every request + """ + self.driver.key = maybe_update_jwt(self.driver.key) + headers["Authorization"] = "bearer {}".format(self.driver.key) + headers["Content-Type"] = "application/json" + return headers + + +def base64url_decode(input): + """ + Helper method to base64url_decode a string. + + :param input: Input to decode + :type input: str + + :rtype: str + """ + rem = len(input) % 4 + + if rem > 0: + input += b"=" * (4 - rem) + return base64.urlsafe_b64decode(input) + + +def is_jwt_expired(jwt): + """ + Check if jwt is expired + + :param jwt: jwt token to validate expiration + :type jwt: str + + :rtype: bool + """ + jwt = jwt.encode("utf-8") + signing_input, _ = jwt.rsplit(b".", 1) + _, claims_segment = signing_input.split(b".", 1) + claimsdata = base64url_decode(claims_segment) + if isinstance(claimsdata, bytes): + claimsdata = claimsdata.decode("utf-8") + data = json.loads(claimsdata) + # check if it's about to expire in the next minute + return data["exp"] < time.time() + 60 + + +def maybe_update_jwt(jwt): + """ + Update jwt if it is expired + + :param jwt: jwt token to validate expiration + :type jwt: str + + :rtype: str + """ + + if is_jwt_expired(jwt): + return refresh_jwt(jwt) + return jwt + + +def refresh_jwt(jwt): + """ + Refresh jwt + + :param jwt: jwt token to refresh + :type jwt: str + + :rtype: str + """ + url = IYO_URL + "/v1/oauth/jwt/refresh" + headers = {"Authorization": "bearer {}".format(jwt)} + response = requests.get(url, headers=headers) + response.raise_for_status() + return response.text diff --git a/libcloud/common/gogrid.py b/libcloud/common/gogrid.py deleted file mode 100644 index e2448debdd..0000000000 --- a/libcloud/common/gogrid.py +++ /dev/null @@ -1,183 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import hashlib -import time - -from libcloud.utils.py3 import b - -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.common.types import MalformedResponseError -from libcloud.common.base import ConnectionUserAndKey, JsonResponse -from libcloud.compute.base import NodeLocation - -HOST = 'api.gogrid.com' -PORTS_BY_SECURITY = {True: 443, False: 80} -API_VERSION = '1.8' - -__all__ = [ - "GoGridResponse", - "GoGridConnection", - "GoGridIpAddress", - "BaseGoGridDriver", -] - - -class GoGridResponse(JsonResponse): - - def __init__(self, *args, **kwargs): - self.driver = BaseGoGridDriver - super(GoGridResponse, self).__init__(*args, **kwargs) - - def success(self): - if self.status == 403: - raise InvalidCredsError('Invalid credentials', self.driver) - if self.status == 401: - raise InvalidCredsError('API Key has insufficient rights', - self.driver) - if not self.body: - return None - try: - return self.parse_body()['status'] == 'success' - except ValueError: - raise MalformedResponseError('Malformed reply', - body=self.body, - driver=self.driver) - - def parse_error(self): - try: - return self.parse_body()["list"][0]["message"] - except (ValueError, KeyError): - return None - - -class GoGridConnection(ConnectionUserAndKey): - """ - Connection class for the GoGrid driver - """ - - host = HOST - responseCls = GoGridResponse - - def add_default_params(self, params): - params["api_key"] = self.user_id - params["v"] = API_VERSION - params["format"] = 'json' - params["sig"] = self.get_signature(self.user_id, self.key) - - return params - - def get_signature(self, key, secret): - """ create sig from md5 of key + secret + time """ - m = hashlib.md5(b(key + secret + str(int(time.time())))) - return m.hexdigest() - - def request(self, action, params=None, data='', headers=None, method='GET', - raw=False): - return super(GoGridConnection, self).request(action, params, data, - headers, method, raw) - - -class GoGridIpAddress(object): - """ - IP Address - """ - - def __init__(self, id, ip, public, state, subnet): - self.id = id - self.ip = ip - self.public = public - self.state = state - self.subnet = subnet - - -class BaseGoGridDriver(object): - """GoGrid has common object model for services they - provide, like locations and IP, so keep handling of - these things in a single place.""" - - name = "GoGrid" - - def _get_ip(self, element): - return element.get('ip').get('ip') - - def _to_ip(self, element): - ip = GoGridIpAddress(id=element['id'], - ip=element['ip'], - public=element['public'], - subnet=element['subnet'], - state=element["state"]["name"]) - ip.location = self._to_location(element['datacenter']) - return ip - - def _to_ips(self, object): - return [self._to_ip(el) - for el in object['list']] - - def _to_location(self, element): - location = NodeLocation(id=element['id'], - name=element['name'], - country="US", - driver=self.connection.driver) - return location - - def _to_locations(self, object): - return [self._to_location(el) - for el in object['list']] - - def ex_list_ips(self, **kwargs): - """Return list of IP addresses assigned to - the account. - - :keyword public: set to True to list only - public IPs or False to list only - private IPs. Set to None or not specify - at all not to filter by type - :type public: ``bool`` - - :keyword assigned: set to True to list only addresses - assigned to servers, False to list unassigned - addresses and set to None or don't set at all - not no filter by state - :type assigned: ``bool`` - - :keyword location: filter IP addresses by location - :type location: :class:`NodeLocation` - - :rtype: ``list`` of :class:`GoGridIpAddress` - """ - - params = {} - - if "public" in kwargs and kwargs["public"] is not None: - params["ip.type"] = {True: "Public", - False: "Private"}[kwargs["public"]] - if "assigned" in kwargs and kwargs["assigned"] is not None: - params["ip.state"] = {True: "Assigned", - False: "Unassigned"}[kwargs["assigned"]] - if "location" in kwargs and kwargs['location'] is not None: - params['datacenter'] = kwargs['location'].id - - response = self.connection.request('/api/grid/ip/list', params=params) - ips = self._to_ips(response.object) - return ips - - def _get_first_ip(self, location=None): - ips = self.ex_list_ips(public=True, assigned=False, location=location) - try: - return ips[0].ip - except IndexError: - raise LibcloudError('No public unassigned IPs left', - self.driver) diff --git a/libcloud/common/google.py b/libcloud/common/google.py index 694cf9369a..64610d2fe3 100644 --- a/libcloud/common/google.py +++ b/libcloud/common/google.py @@ -21,10 +21,10 @@ For libcloud, there are two basic methods for authenticating to Google using OAUTH2: Service Accounts and Client IDs for Installed Applications. -Both are initially set up from the Cloud Console_ -_Console: https://cloud.google.com/console +Both are initially set up from the Cloud Console Console - +https://cloud.google.com/console -Setting up Service Account authentication (note that you need the PyCrypto +Setting up Service Account authentication (note that you need the cryptography package installed to use this): - Go to the Console @@ -32,13 +32,14 @@ - Click on "Credentials" - Click on "Create New Client ID..." - Select "Service account" and click on "Create Client ID" -- Download the Private Key (should happen automatically). -- The key that you download is a PKCS12 key. It needs to be converted to - the PEM format. -- Convert the key using OpenSSL (the default password is 'notasecret'): - ``openssl pkcs12 -in YOURPRIVKEY.p12 -nodes -nocerts - -passin pass:notasecret | openssl rsa -out PRIV.pem`` -- Move the .pem file to a safe location. +- Download the Private Key (should happen automatically). The key you download + is in JSON format. +- Move the .json file to a safe location. +- Optionally, you may choose to Generate a PKCS12 key from the Console. + It needs to be converted to the PEM format. Please note, the PKCS12 format + is deprecated and may be removed in a future release. + - Convert the key using OpenSSL (the default password is 'notasecret'). + - Move the .pem file to a safe location. - To Authenticate, you will need to pass the Service Account's "Email address" in as the user_id and the path to the .pem file as the key. @@ -63,55 +64,70 @@ Please remember to secure your keys and access tokens. """ -from __future__ import with_statement -try: - import simplejson as json -except ImportError: - import json - -import base64 -import errno -import time -import datetime import os -import socket import sys +import time +import errno +import base64 +import logging +import datetime +import urllib.parse +from typing import Optional +from http.server import HTTPServer, BaseHTTPRequestHandler +from libcloud.utils.py3 import b, httplib, urlparse, urlencode +from libcloud.common.base import BaseDriver, JsonResponse, PollingConnection, ConnectionUserAndKey +from libcloud.common.types import LibcloudError, ProviderError from libcloud.utils.connection import get_response_object -from libcloud.utils.py3 import b, httplib, urlencode, urlparse, PY3 -from libcloud.common.base import (ConnectionUserAndKey, JsonResponse, - PollingConnection) -from libcloud.common.types import (ProviderError, - LibcloudError) try: - from Crypto.Hash import SHA256 - from Crypto.PublicKey import RSA - from Crypto.Signature import PKCS1_v1_5 - import Crypto.Random - Crypto.Random.atfork() + import simplejson as json except ImportError: - # The pycrypto library is unavailable - SHA256 = None - RSA = None - PKCS1_v1_5 = None + import json # type: ignore -TIMESTAMP_FORMAT = '%Y-%m-%dT%H:%M:%SZ' +try: + from cryptography import exceptions + from cryptography.hazmat.backends import default_backend + from cryptography.hazmat.primitives import serialization + from cryptography.hazmat.primitives.hashes import SHA256 + from cryptography.hazmat.primitives.asymmetric.padding import PKCS1v15 +except ImportError: + # The cryptography library is unavailable + SHA256 = None # type: ignore -def _is_gce(): - http_code, http_reason, body = _get_gce_metadata() - if http_code == httplib.OK and body: - return True - return False +UTC_TIMESTAMP_FORMAT = "%Y-%m-%dT%H:%M:%SZ" +LOG = logging.getLogger(__name__) -def _get_gce_metadata(path=''): + +def _utcnow(): + """ + Mocked in libcloud.test.common.google.GoogleTestCase. + """ + return datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None) + + +def _utc_timestamp(datetime_obj): + """ + Return string of datetime_obj in the UTC Timestamp Format + """ + return datetime_obj.strftime(UTC_TIMESTAMP_FORMAT) + + +def _from_utc_timestamp(timestamp): + """ + Return datetime obj where date and time are pulled from timestamp string. + """ + return datetime.datetime.strptime(timestamp, UTC_TIMESTAMP_FORMAT) + + +def _get_gce_metadata(path="", retry_failed: Optional[bool] = None): try: - url = "http://metadata/computeMetadata/v1/" + path.lstrip('/') - headers = {'Metadata-Flavor': 'Google'} - response = get_response_object(url, headers=headers) + url = "http://metadata.google.internal/computeMetadata/v1/" + path.lstrip("/") + headers = {"Metadata-Flavor": "Google"} + response = get_response_object(url, headers=headers, retry_failed=retry_failed) return response.status, "", response.body except Exception as e: return -1, str(e), None @@ -119,6 +135,7 @@ def _get_gce_metadata(path=''): class GoogleAuthError(LibcloudError): """Generic Error class for various authentication errors.""" + def __init__(self, value): self.value = value @@ -129,7 +146,7 @@ def __repr__(self): class GoogleBaseError(ProviderError): def __init__(self, value, http_code, code, driver=None): self.code = code - super(GoogleBaseError, self).__init__(value, http_code, driver) + super().__init__(value, http_code, driver) class InvalidRequestError(GoogleBaseError): @@ -143,14 +160,19 @@ class JsonParseError(GoogleBaseError): class ResourceNotFoundError(GoogleBaseError): def __init__(self, value, http_code, code, driver=None): self.code = code - if isinstance(value, dict) and 'message' in value and \ - value['message'].count('/') == 1 and \ - value['message'].count('projects/') == 1: - value['message'] = value['message'] + ". A missing project " \ - "error may be an authentication issue. " \ - "Please ensure your auth credentials match " \ + if ( + isinstance(value, dict) + and "message" in value + and value["message"].count("/") == 1 + and value["message"].count("projects/") == 1 + ): + value["message"] = ( + value["message"] + ". A missing project " + "error may be an authentication issue. " + "Please ensure your auth credentials match " "your project. " - super(GoogleBaseError, self).__init__(value, http_code, driver) + ) + super().__init__(value, http_code, driver) class QuotaExceededError(GoogleBaseError): @@ -169,6 +191,7 @@ class GoogleResponse(JsonResponse): """ Google Base Response class. """ + def success(self): """ Determine if the request was successful. @@ -192,17 +215,19 @@ def _get_error(self, body): :return: Tuple containing error code and message :rtype: ``tuple`` of ``str`` or ``int`` """ - if 'errors' in body['error']: - err = body['error']['errors'][0] + if "errors" in body["error"]: + err = body["error"]["errors"][0] else: - err = body['error'] + err = body["error"] - if 'code' in err: - code = err.get('code') - message = err.get('message') + if "code" in err: + code = err.get("code") + message = err.get("message") else: - code = err.get('reason', None) - message = body.get('error_description', err) + code = None + if "reason" in err: + code = err.get("reason") + message = body.get("error_description", err) return (code, message) @@ -219,7 +244,7 @@ def parse_body(self): json_error = False try: body = json.loads(self.body) - except: + except Exception: # If there is both a JSON parsing error and an unsuccessful http # response (like a 404), we want to raise the http error and not # the JSON one, so don't raise JsonParseError here. @@ -235,15 +260,15 @@ def parse_body(self): if self.status in valid_http_codes: if json_error: raise JsonParseError(body, self.status, None) - elif 'error' in body: - (code, message) = self._get_error(body) - if code == 'QUOTA_EXCEEDED': + elif "error" in body: + code, message = self._get_error(body) + if code == "QUOTA_EXCEEDED": raise QuotaExceededError(message, self.status, code) - elif code == 'RESOURCE_ALREADY_EXISTS': + elif code == "RESOURCE_ALREADY_EXISTS": raise ResourceExistsError(message, self.status, code) - elif code == 'alreadyExists': + elif code == "alreadyExists": raise ResourceExistsError(message, self.status, code) - elif code.startswith('RESOURCE_IN_USE'): + elif code.startswith("RESOURCE_IN_USE"): raise ResourceInUseError(message, self.status, code) else: raise GoogleBaseError(message, self.status, code) @@ -251,31 +276,31 @@ def parse_body(self): return body elif self.status == httplib.NOT_FOUND: - if (not json_error) and ('error' in body): - (code, message) = self._get_error(body) + if (not json_error) and ("error" in body): + code, message = self._get_error(body) else: message = body code = None raise ResourceNotFoundError(message, self.status, code) elif self.status == httplib.BAD_REQUEST: - if (not json_error) and ('error' in body): - (code, message) = self._get_error(body) + if (not json_error) and ("error" in body): + code, message = self._get_error(body) else: message = body code = None raise InvalidRequestError(message, self.status, code) else: - if (not json_error) and ('error' in body): - (code, message) = self._get_error(body) + if (not json_error) and ("error" in body): + code, message = self._get_error(body) else: message = body code = None raise GoogleBaseError(message, self.status, code) -class GoogleBaseDriver(object): +class GoogleBaseDriver(BaseDriver): name = "Google API" @@ -284,15 +309,23 @@ class GoogleBaseAuthConnection(ConnectionUserAndKey): Base class for Google Authentication. Should be subclassed for specific types of authentication. """ + driver = GoogleBaseDriver responseCls = GoogleResponse - name = 'Google Auth' - host = 'accounts.google.com' - auth_path = '/o/oauth2/auth' - - def __init__(self, user_id, key=None, scopes=None, - redirect_uri='urn:ietf:wg:oauth:2.0:oob', - login_hint=None, **kwargs): + name = "Google Auth" + host = "accounts.google.com" + auth_path = "/o/oauth2/auth" + redirect_uri_port = 8087 + + def __init__( + self, + user_id, + key=None, + scopes=None, + redirect_uri="http://127.0.0.1", + login_hint=None, + **kwargs, + ): """ :param user_id: The email address (for service accounts) or Client ID (for installed apps) to be used for authentication. @@ -322,14 +355,14 @@ def __init__(self, user_id, key=None, scopes=None, self.redirect_uri = redirect_uri self.login_hint = login_hint - super(GoogleBaseAuthConnection, self).__init__(user_id, key, **kwargs) - - def _now(self): - return datetime.datetime.utcnow() + super().__init__(user_id, key, **kwargs) def add_default_headers(self, headers): - headers['Content-Type'] = "application/x-www-form-urlencoded" - headers['Host'] = self.host + """ + Add defaults for 'Content-Type' and 'Host' headers. + """ + headers["Content-Type"] = "application/x-www-form-urlencoded" + headers["Host"] = self.host return headers def _token_request(self, request_body): @@ -344,18 +377,16 @@ def _token_request(self, request_body): :rtype: ``dict`` """ data = urlencode(request_body) - now = self._now() try: - response = self.request('/o/oauth2/token', method='POST', - data=data) + response = self.request("/o/oauth2/token", method="POST", data=data) except AttributeError: - raise GoogleAuthError('Invalid authorization response, please ' - 'check your credentials.') + raise GoogleAuthError( + "Invalid authorization response, please " "check your credentials and time drift." + ) token_info = response.object - if 'expires_in' in token_info: - expire_time = now + datetime.timedelta( - seconds=token_info['expires_in']) - token_info['expire_time'] = expire_time.strftime(TIMESTAMP_FORMAT) + if "expires_in" in token_info: + expire_time = _utcnow() + datetime.timedelta(seconds=token_info["expires_in"]) + token_info["expire_time"] = _utc_timestamp(expire_time) return token_info def refresh_token(self, token_info): @@ -371,36 +402,40 @@ def refresh_token(self, token_info): :return: A dictionary containing updated token information. :rtype: ``dict`` """ + # pylint: disable=no-member return self.get_new_token() class GoogleInstalledAppAuthConnection(GoogleBaseAuthConnection): """Authentication connection for "Installed Application" authentication.""" + + _state = "Libcloud Request" + def get_code(self): """ - Give the user a URL that they can visit to authenticate and obtain a - code. This method will ask for that code that the user can paste in. + Give the user a URL that they can visit to authenticate. + + Mocked in libcloud.test.common.google.GoogleTestCase. :return: Code supplied by the user after authenticating :rtype: ``str`` """ - auth_params = {'response_type': 'code', - 'client_id': self.user_id, - 'redirect_uri': self.redirect_uri, - 'scope': self.scopes, - 'state': 'Libcloud Request'} + auth_params = { + "response_type": "code", + "client_id": self.user_id, + "redirect_uri": self._redirect_uri_with_port, + "scope": self.scopes, + "state": self._state, + } if self.login_hint: - auth_params['login_hint'] = self.login_hint + auth_params["login_hint"] = self.login_hint data = urlencode(auth_params) - url = 'https://%s%s?%s' % (self.host, self.auth_path, data) - print('\nPlease Go to the following URL and sign in:') + url = "https://{}{}?{}".format(self.host, self.auth_path, data) + print("\nPlease Go to the following URL and sign in:") print(url) - if PY3: - code = input('Enter Code: ') - else: - code = raw_input('Enter Code: ') + code = self._receive_code_through_local_loopback() return code def get_new_token(self): @@ -411,14 +446,15 @@ def get_new_token(self): :return: Dictionary containing token information :rtype: ``dict`` """ - # Ask the user for a code code = self.get_code() - token_request = {'code': code, - 'client_id': self.user_id, - 'client_secret': self.key, - 'redirect_uri': self.redirect_uri, - 'grant_type': 'authorization_code'} + token_request = { + "code": code, + "client_id": self.user_id, + "client_secret": self.key, + "redirect_uri": self._redirect_uri_with_port, + "grant_type": "authorization_code", + } return self._token_request(token_request) @@ -432,54 +468,143 @@ def refresh_token(self, token_info): :return: A dictionary containing updated token information. :rtype: ``dict`` """ - if 'refresh_token' not in token_info: + if "refresh_token" not in token_info: return self.get_new_token() - refresh_request = {'refresh_token': token_info['refresh_token'], - 'client_id': self.user_id, - 'client_secret': self.key, - 'grant_type': 'refresh_token'} + refresh_request = { + "refresh_token": token_info["refresh_token"], + "client_id": self.user_id, + "client_secret": self.key, + "grant_type": "refresh_token", + } new_token = self._token_request(refresh_request) - if 'refresh_token' not in new_token: - new_token['refresh_token'] = token_info['refresh_token'] + if "refresh_token" not in new_token: + new_token["refresh_token"] = token_info["refresh_token"] return new_token + @property + def _redirect_uri_with_port(self): + return self.redirect_uri + ":" + str(self.redirect_uri_port) + + def _receive_code_through_local_loopback(self): + """ + Start a local HTTP server that listens to a single GET request that is expected to be made + by the loopback in the sign-in process and stops again afterwards. + See https://developers.google.com/identity/protocols/oauth2/native-app#redirect-uri_loopback + + :return: The access code that was extracted from the local loopback GET request + :rtype: ``str`` + """ + access_code = None + + class AccessCodeReceiver(BaseHTTPRequestHandler): + # noinspection PyMethodParameters,PyPep8Naming + def do_GET(self_): # pylint: disable=no-self-argument + query = urlparse.urlparse(self_.path).query + query_components = dict(qc.split("=") for qc in query.split("&")) + if "state" in query_components and query_components["state"] != urllib.parse.quote( + self._state + ): + raise ValueError( + "States do not match: {} != {}, can't trust authentication".format( + self._state, query_components["state"] + ) + ) + nonlocal access_code + access_code = query_components["code"] + self_.send_response(200) + self_.send_header("Content-type", "text/html") + self_.end_headers() + self_.wfile.write(b"Libcloud Sign-In") + self_.wfile.write(b"

You can now close this tab

") + + if ( + "127.0.0.1" in self.redirect_uri + or "[::1]" in self.redirect_uri + or "localhost" in self.redirect_uri + ): + # HTTPServer does not understand localhost unless you explicitly call it so + server_address = "localhost", self.redirect_uri_port + else: + server_address = self.redirect_uri, self.redirect_uri_port + + server = HTTPServer(server_address=server_address, RequestHandlerClass=AccessCodeReceiver) + # Only waits for a single request and stops afterwards + server.handle_request() + if access_code is None: + raise RuntimeError( + "Could not receive OAuth2 code: could not extract code though loopback" + ) + return access_code + class GoogleServiceAcctAuthConnection(GoogleBaseAuthConnection): """Authentication class for "Service Account" authentication.""" + def __init__(self, user_id, key, *args, **kwargs): """ - Check to see if PyCrypto is available, and convert key file path into a - key string if the key is in a file. + Check to see if cryptography is available, and convert PEM key file + into a key string, or extract the key from JSON object, string or + file. :param user_id: Email address to be used for Service Account authentication. :type user_id: ``str`` - :param key: The RSA Key or path to file containing the key. - :type key: ``str`` + :param key: The path to a PEM/JSON file containing the private RSA + key, or a str/dict containing the PEM/JSON. + :type key: ``str`` or ``dict`` + """ if SHA256 is None: - raise GoogleAuthError('PyCrypto library required for ' - 'Service Account Authentication.') - # Check to see if 'key' is a file and read the file if it is. - if key.find("PRIVATE KEY---") == -1: - # key is a file - keypath = os.path.expanduser(key) - is_file_path = os.path.exists(keypath) and os.path.isfile(keypath) - if not is_file_path: - raise ValueError("Missing (or not readable) key " - "file: '%s'" % key) - with open(keypath, 'r') as f: - contents = f.read() - try: - key = json.loads(contents) - key = key['private_key'] - except ValueError: - key = contents + raise GoogleAuthError( + "cryptography library required for " "Service Account Authentication." + ) + + if isinstance(key, dict): + # if it's a dict, assume it's containing parsed JSON + key_content = key + key = None + else: + key_path = os.path.expanduser(key) + if os.path.exists(key_path) and os.path.isfile(key_path): + # Assume it's a file and read it + try: + with open(key_path) as f: + key_content = f.read() + except OSError: + raise GoogleAuthError("Missing (or unreadable) key " "file: '%s'" % key) + else: + # assume it's a PEM str or serialized JSON str + key_content = key + key = None - super(GoogleServiceAcctAuthConnection, self).__init__( - user_id, key, *args, **kwargs) + try: + key_content = json.loads(key_content) + # check if serialized JSON given + except TypeError: + # already a dict + pass + except ValueError: + # it's been a PEM string all along + pass + finally: + if "private_key" in key_content: + key = key_content["private_key"] + else: + key = key_content + + try: + # check if the key is actually a PEM encoded private key + serialization.load_pem_private_key(b(key), password=None, backend=default_backend()) + except ValueError as e: + raise GoogleAuthError("Unable to decode provided PEM key: %s" % e) + except TypeError as e: + raise GoogleAuthError("Unable to decode provided PEM key: %s" % e) + except exceptions.UnsupportedAlgorithm as e: + raise GoogleAuthError("Unable to decode provided PEM key: %s" % e) + + super().__init__(user_id, key, *args, **kwargs) def get_new_token(self): """ @@ -489,37 +614,43 @@ def get_new_token(self): :rtype: ``dict`` """ # The header is always the same - header = {'alg': 'RS256', 'typ': 'JWT'} + header = {"alg": "RS256", "typ": "JWT"} header_enc = base64.urlsafe_b64encode(b(json.dumps(header))) # Construct a claim set - claim_set = {'iss': self.user_id, - 'scope': self.scopes, - 'aud': 'https://accounts.google.com/o/oauth2/token', - 'exp': int(time.time()) + 3600, - 'iat': int(time.time())} + claim_set = { + "iss": self.user_id, + "scope": self.scopes, + "aud": "https://accounts.google.com/o/oauth2/token", + "exp": int(time.time()) + 3600, + "iat": int(time.time()), + } claim_set_enc = base64.urlsafe_b64encode(b(json.dumps(claim_set))) # The message contains both the header and claim set - message = b'.'.join((header_enc, claim_set_enc)) + message = b".".join((header_enc, claim_set_enc)) # Then the message is signed using the key supplied - key = RSA.importKey(self.key) - hash_func = SHA256.new(message) - signer = PKCS1_v1_5.new(key) - signature = base64.urlsafe_b64encode(signer.sign(hash_func)) + key = serialization.load_pem_private_key( + b(self.key), password=None, backend=default_backend() + ) + signature = key.sign(data=b(message), padding=PKCS1v15(), algorithm=SHA256()) + signature = base64.urlsafe_b64encode(signature) # Finally the message and signature are sent to get a token - jwt = b'.'.join((message, signature)) - request = {'grant_type': 'urn:ietf:params:oauth:grant-type:jwt-bearer', - 'assertion': jwt} + jwt = b".".join((message, signature)) + request = { + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "assertion": jwt, + } return self._token_request(request) class GoogleGCEServiceAcctAuthConnection(GoogleBaseAuthConnection): """Authentication class for self-authentication when used with a GCE - istance that supports serviceAccounts. + instance that supports serviceAccounts. """ + def get_new_token(self): """ Get a new token from the internal metadata service. @@ -527,32 +658,203 @@ def get_new_token(self): :return: Dictionary containing token information :rtype: ``dict`` """ - path = '/instance/service-accounts/default/token' + path = "/instance/service-accounts/default/token" http_code, http_reason, token_info = _get_gce_metadata(path) if http_code == httplib.NOT_FOUND: - raise ValueError("Service Accounts are not enabled for this " - "GCE instance.") + raise ValueError("Service Accounts are not enabled for this " "GCE instance.") if http_code != httplib.OK: - raise ValueError("Internal GCE Authorization failed: " - "'%s'" % str(http_reason)) + raise ValueError("Internal GCE Authorization failed: " "'%s'" % str(http_reason)) token_info = json.loads(token_info) - if 'expires_in' in token_info: - expire_time = self._now() + datetime.timedelta( - seconds=token_info['expires_in']) - token_info['expire_time'] = expire_time.strftime(TIMESTAMP_FORMAT) + if "expires_in" in token_info: + expire_time = _utcnow() + datetime.timedelta(seconds=token_info["expires_in"]) + token_info["expire_time"] = _utc_timestamp(expire_time) return token_info +class GoogleAuthType: + """ + SA (Service Account), + IA (Installed Application), + GCE (Auth from a GCE instance with service account enabled) + GCS_S3 (Cloud Storage S3 interoperability authentication) + """ + + SA = "SA" + IA = "IA" + GCE = "GCE" + GCS_S3 = "GCS_S3" + + ALL_TYPES = [SA, IA, GCE, GCS_S3] + OAUTH2_TYPES = [SA, IA, GCE] + + @classmethod + def guess_type(cls, user_id): + if cls._is_sa(user_id): + return cls.SA + elif cls._is_gcs_s3(user_id): + return cls.GCS_S3 + elif cls._is_installed_application(user_id): + # NOTE: This should be before "_is_gce()" call so we avoid + # querying GCE metadata service if that's not necessary + return cls.IA + elif cls._is_gce(): + return cls.GCE + else: + # TODO: It's probably safe to throw here, but we return cls.IA + # for backward compatibility reasons + return cls.IA + + @classmethod + def is_oauth2(cls, auth_type): + return auth_type in cls.OAUTH2_TYPES + + @staticmethod + def _is_installed_application(user_id): + return user_id.endswith("apps.googleusercontent.com") + + @staticmethod + def _is_gce(): + """ + Checks if we can access the GCE metadata server. + Mocked in libcloud.test.common.google.GoogleTestCase. + """ + # When using oAuth credentials we check for metadata server first, so + # if server is unavailable and we retry many times before timing out, + # this will slow down the driver instantiation when retrying failed + # requests is enabled globally. + http_code, http_reason, body = _get_gce_metadata(retry_failed=False) + if http_code == httplib.OK and body: + return True + return False + + @staticmethod + def _is_gcs_s3(user_id): + """ + Checks S3 key format: alphanumeric chars starting with GOOG. + """ + return user_id.startswith("GOOG") + + @staticmethod + def _is_sa(user_id): + return user_id.endswith(".gserviceaccount.com") + + +class GoogleOAuth2Credential: + default_credential_file = "~/.google_libcloud_auth" + + def __init__(self, user_id, key, auth_type=None, credential_file=None, scopes=None, **kwargs): + self.auth_type = auth_type or GoogleAuthType.guess_type(user_id) + if self.auth_type not in GoogleAuthType.ALL_TYPES: + raise GoogleAuthError("Invalid auth type: %s" % self.auth_type) + if not GoogleAuthType.is_oauth2(self.auth_type): + raise GoogleAuthError("Auth type %s cannot be used with OAuth2" % self.auth_type) + self.user_id = user_id + self.key = key + + default_credential_file = ".".join([self.default_credential_file, user_id]) + self.credential_file = credential_file or default_credential_file + # Default scopes to read/write for compute, storage, and dns. + self.scopes = scopes or [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite", + ] + + self.token = self._get_token_from_file() + + if self.auth_type == GoogleAuthType.GCE: + self.oauth2_conn = GoogleGCEServiceAcctAuthConnection( + self.user_id, self.scopes, **kwargs + ) + elif self.auth_type == GoogleAuthType.SA: + self.oauth2_conn = GoogleServiceAcctAuthConnection( + self.user_id, self.key, self.scopes, **kwargs + ) + elif self.auth_type == GoogleAuthType.IA: + self.oauth2_conn = GoogleInstalledAppAuthConnection( + self.user_id, self.key, self.scopes, **kwargs + ) + else: + raise GoogleAuthError("Invalid auth_type: %s" % str(self.auth_type)) + + if self.token is None: + self.token = self.oauth2_conn.get_new_token() + self._write_token_to_file() + + @property + def access_token(self): + if self.token_expire_utc_datetime < _utcnow(): + self._refresh_token() + return self.token["access_token"] + + @property + def token_expire_utc_datetime(self): + return _from_utc_timestamp(self.token["expire_time"]) + + def _refresh_token(self): + self.token = self.oauth2_conn.refresh_token(self.token) + self._write_token_to_file() + + def _get_token_from_file(self): + """ + Read credential file and return token information. + Mocked in libcloud.test.common.google.GoogleTestCase. + + :return: Token information dictionary, or None + :rtype: ``dict`` or ``None`` + """ + token = None + filename = os.path.realpath(os.path.expanduser(self.credential_file)) + + try: + with open(filename) as f: + data = f.read() + token = json.loads(data) + except (OSError, ValueError) as e: + # Note: File related errors (IOError) and errors related to json + # parsing of the data (ValueError) are not fatal. + LOG.info('Failed to read cached auth token from file "%s": %s', filename, str(e)) + + return token + + def _write_token_to_file(self): + """ + Write token to credential file. + Mocked in libcloud.test.common.google.GoogleTestCase. + """ + filename = os.path.expanduser(self.credential_file) + filename = os.path.realpath(filename) + + try: + data = json.dumps(self.token) + write_flags = os.O_CREAT | os.O_WRONLY | os.O_TRUNC + with os.fdopen(os.open(filename, write_flags, int("600", 8)), "w") as f: + f.write(data) + except Exception as e: + # Note: Failure to write (cache) token in a file is not fatal. It + # simply means degraded performance since we will need to acquire a + # new token each time script runs. + LOG.info('Failed to write auth token to file "%s": %s', filename, str(e)) + + class GoogleBaseConnection(ConnectionUserAndKey, PollingConnection): """Base connection class for interacting with Google APIs.""" + driver = GoogleBaseDriver responseCls = GoogleResponse - host = 'www.googleapis.com' + host = "www.googleapis.com" poll_interval = 2.0 timeout = 180 - def __init__(self, user_id, key=None, auth_type=None, - credential_file=None, scopes=None, **kwargs): + def __init__( + self, + user_id, + key=None, + auth_type=None, + credential_file=None, + scopes=None, + **kwargs, + ): """ Determine authentication type, set up appropriate authentication connection and get initial authentication information. @@ -566,13 +868,8 @@ def __init__(self, user_id, key=None, auth_type=None, authentication. :type key: ``str`` - :keyword auth_type: Accepted values are "SA" or "IA" or "GCE" - ("Service Account" or "Installed Application" or - "GCE" if libcloud is being used on a GCE instance - with service account enabled). - If not supplied, auth_type will be guessed based - on value of user_id or if the code is being - executed in a GCE instance.). + :keyword auth_type: See GoogleAuthType class for list and description + of accepted values. If not supplied, auth_type will be guessed based on value of user_id or if the code is running on a GCE instance. @@ -586,66 +883,26 @@ def __init__(self, user_id, key=None, auth_type=None, read/write access to Compute, Storage, and DNS. :type scopes: ``list`` """ - self.credential_file = credential_file or '~/.gce_libcloud_auth' + super().__init__(user_id, key, **kwargs) - if auth_type is None: - # Try to guess. - if '@' in user_id: - auth_type = 'SA' - elif _is_gce(): - auth_type = 'GCE' - else: - auth_type = 'IA' - - # Default scopes to read/write for compute, storage, and dns. Can - # override this when calling get_driver() or setting in secrets.py - self.scopes = scopes - if not self.scopes: - self.scopes = [ - 'https://www.googleapis.com/auth/compute', - 'https://www.googleapis.com/auth/devstorage.full_control', - 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', - ] - self.token_info = self._get_token_info_from_file() - - if auth_type == 'GCE': - self.auth_conn = GoogleGCEServiceAcctAuthConnection( - user_id, self.scopes, **kwargs) - elif auth_type == 'SA': - if '@' not in user_id: - raise GoogleAuthError('Service Account auth requires a ' - 'valid email address') - self.auth_conn = GoogleServiceAcctAuthConnection( - user_id, key, self.scopes, **kwargs) - elif auth_type == 'IA': - self.auth_conn = GoogleInstalledAppAuthConnection( - user_id, key, self.scopes, **kwargs) - else: - raise GoogleAuthError('Invalid auth_type: %s' % str(auth_type)) + self.oauth2_credential = GoogleOAuth2Credential( + user_id, key, auth_type, credential_file, scopes, **kwargs + ) - if self.token_info is None: - self.token_info = self.auth_conn.get_new_token() - self._write_token_info_to_file() - - self.token_expire_time = datetime.datetime.strptime( - self.token_info['expire_time'], TIMESTAMP_FORMAT) - - super(GoogleBaseConnection, self).__init__(user_id, key, **kwargs) - - python_ver = '%s.%s.%s' % (sys.version_info[0], sys.version_info[1], - sys.version_info[2]) - ver_platform = 'Python %s/%s' % (python_ver, sys.platform) + python_ver = "{}.{}.{}".format( + sys.version_info[0], + sys.version_info[1], + sys.version_info[2], + ) + ver_platform = "Python {}/{}".format(python_ver, sys.platform) self.user_agent_append(ver_platform) - def _now(self): - return datetime.datetime.utcnow() - def add_default_headers(self, headers): """ @inherits: :class:`Connection.add_default_headers` """ - headers['Content-Type'] = "application/json" - headers['Host'] = self.host + headers["Content-Type"] = "application/json" + headers["Host"] = self.host return headers def pre_connect_hook(self, params, headers): @@ -655,15 +912,7 @@ def pre_connect_hook(self, params, headers): @inherits: :class:`Connection.pre_connect_hook` """ - now = self._now() - if self.token_expire_time < now: - self.token_info = self.auth_conn.refresh_token(self.token_info) - self.token_expire_time = datetime.datetime.strptime( - self.token_info['expire_time'], TIMESTAMP_FORMAT) - self._write_token_info_to_file() - headers['Authorization'] = 'Bearer %s' % ( - self.token_info['access_token']) - + headers["Authorization"] = "Bearer " + self.oauth2_credential.access_token return params, headers def encode_data(self, data): @@ -680,43 +929,14 @@ def request(self, *args, **kwargs): tries = 0 while tries < (retries - 1): try: - return super(GoogleBaseConnection, self).request( - *args, **kwargs) - except socket.error: - e = sys.exc_info()[1] + return super().request(*args, **kwargs) + except OSError as e: if e.errno == errno.ECONNRESET: tries = tries + 1 else: raise e # One more time, then give up. - return super(GoogleBaseConnection, self).request(*args, **kwargs) - - def _get_token_info_from_file(self): - """ - Read credential file and return token information. - - :return: Token information dictionary, or None - :rtype: ``dict`` or ``None`` - """ - token_info = None - filename = os.path.realpath(os.path.expanduser(self.credential_file)) - - try: - with open(filename, 'r') as f: - data = f.read() - token_info = json.loads(data) - except IOError: - pass - return token_info - - def _write_token_info_to_file(self): - """ - Write token_info to credential file. - """ - filename = os.path.realpath(os.path.expanduser(self.credential_file)) - data = json.dumps(self.token_info) - with open(filename, 'w') as f: - f.write(data) + return super().request(*args, **kwargs) def has_completed(self, response): """ @@ -728,7 +948,7 @@ def has_completed(self, response): :return: True if complete, False otherwise :rtype: ``bool`` """ - if response.object['status'] == 'DONE': + if response.object["status"] == "DONE": return True else: return False @@ -737,7 +957,7 @@ def get_poll_request_kwargs(self, response, context, request_kwargs): """ @inherits: :class:`PollingConnection.get_poll_request_kwargs` """ - return {'action': response.object['selfLink']} + return {"action": response.object["selfLink"]} def morph_action_hook(self, action): """ @@ -754,9 +974,9 @@ def morph_action_hook(self, action): :return: The modified request based on the action :rtype: ``str`` """ - if action.startswith('https://'): + if action.startswith("https://"): u = urlparse.urlsplit(action) - request = urlparse.urlunsplit(('', '', u[2], u[3], u[4])) + request = urlparse.urlunsplit(("", "", u[2], u[3], u[4])) else: request = self.request_path + action return request diff --git a/libcloud/common/gridscale.py b/libcloud/common/gridscale.py new file mode 100644 index 0000000000..7f8bf360cb --- /dev/null +++ b/libcloud/common/gridscale.py @@ -0,0 +1,123 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Common settings and connection objects for gridscale +""" + +try: + import simplejson as json +except Exception: + import json # type: ignore + +from libcloud.utils.py3 import httplib +from libcloud.common.base import BaseDriver, JsonResponse, PollingConnection, ConnectionUserAndKey +from libcloud.common.types import InvalidCredsError +from libcloud.compute.types import NodeState + +NODE_STATE_MAP = { + "ACTIVE": NodeState.RUNNING, + "STOPPED": NodeState.STOPPED, + "UNKNOWN": NodeState.UNKNOWN, +} + + +class GridscaleResponse(JsonResponse): + """ + Gridscale API Response + """ + + valid_response_codes = [httplib.OK, httplib.ACCEPTED, httplib.NO_CONTENT] + + def parse_error(self): + body = self.parse_body() + if self.status == httplib.UNAUTHORIZED: + raise InvalidCredsError(body["message"]) + if self.status == httplib.NOT_FOUND: + raise Exception("The resource you are looking for has not been found.") + return self.body + + def success(self): + return self.status in self.valid_response_codes + + +class GridscaleConnection(ConnectionUserAndKey, PollingConnection): + """ + gridscale connection class + Authentication using uuid and api token + + """ + + host = "api.gridscale.io" + responseCls = GridscaleResponse + + def encode_data(self, data): + return json.dumps(data) + + def add_default_headers(self, headers): + """ + add parameters that are necessary for each request to be successful + + :param headers: Authentication token + :type headers: ``str`` + :return: None + """ + headers["X-Auth-UserId"] = self.user_id + headers["X-Auth-Token"] = self.key + headers["Content-Type"] = "application/json" + + return headers + + def async_request(self, *poargs, **kwargs): + self.async_request_counter = 0 + self.request_method = "_poll_request_initial" + return super().async_request(*poargs, **kwargs) + + def _poll_request_initial(self, **kwargs): + if self.async_request_counter == 0: + self.poll_response_initial = super().request(**kwargs) + r = self.poll_response_initial + self.async_request_counter += 1 + else: + r = self.request(**kwargs) + + return r + + def get_poll_request_kwargs(self, response, context, request_kwargs): + endpoint_url = "requests/{}".format(response.object["request_uuid"]) + kwargs = {"action": endpoint_url} + return kwargs + + def has_completed(self, response): + if response.status == 200: + request_uuid = self.poll_response_initial.object["request_uuid"] + request_status = response.object[request_uuid]["status"] + if request_status == "done": + return True + return False + + +class GridscaleBaseDriver(BaseDriver): + name = "gridscale" + website = "https://gridscale.io" + connectionCls = GridscaleConnection + + def __init__(self, user_id, key, **kwargs): + super().__init__(user_id, key, **kwargs) + + def _sync_request(self, data=None, endpoint=None, method="GET"): + raw_result = self.connection.request(endpoint, data=data, method=method) + + return raw_result diff --git a/libcloud/common/hostvirtual.py b/libcloud/common/hostvirtual.py deleted file mode 100644 index e7ce14daba..0000000000 --- a/libcloud/common/hostvirtual.py +++ /dev/null @@ -1,77 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License.You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import simplejson as json -except ImportError: - import json - -from libcloud.utils.py3 import httplib -from libcloud.common.base import ConnectionKey, JsonResponse -from libcloud.compute.types import InvalidCredsError -from libcloud.common.types import LibcloudError - -API_HOST = 'vapi.vr.org' - - -class HostVirtualException(LibcloudError): - def __init__(self, code, message): - self.code = code - self.message = message - self.args = (code, message) - - def __str__(self): - return self.__repr__() - - def __repr__(self): - return '' % (self.code, self.message) - - -class HostVirtualConnection(ConnectionKey): - host = API_HOST - - allow_insecure = False - - def add_default_params(self, params): - params['key'] = self.key - return params - - -class HostVirtualResponse(JsonResponse): - valid_response_codes = [httplib.OK, httplib.ACCEPTED, httplib.CREATED, - httplib.NO_CONTENT] - - def parse_body(self): - if not self.body: - return None - - data = json.loads(self.body) - return data - - def parse_error(self): - data = self.parse_body() - - if self.status == httplib.UNAUTHORIZED: - raise InvalidCredsError('%(code)s:%(message)s' % (data['error'])) - elif self.status == httplib.PRECONDITION_FAILED: - raise HostVirtualException( - data['error']['code'], data['error']['message']) - elif self.status == httplib.NOT_FOUND: - raise HostVirtualException( - data['error']['code'], data['error']['message']) - - return self.body - - def success(self): - return self.status in self.valid_response_codes diff --git a/libcloud/common/kubernetes.py b/libcloud/common/kubernetes.py new file mode 100644 index 0000000000..f4fadf68a2 --- /dev/null +++ b/libcloud/common/kubernetes.py @@ -0,0 +1,296 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Module which contains common Kubernetes related code. +""" + +import os +import base64 +import warnings +from typing import Optional + +from libcloud.utils.py3 import b, httplib +from libcloud.common.base import ( + JsonResponse, + ConnectionKey, + ConnectionUserAndKey, + KeyCertificateConnection, +) +from libcloud.common.types import InvalidCredsError + +__all__ = [ + "KubernetesException", + "KubernetesBasicAuthConnection", + "KubernetesTLSAuthConnection", + "KubernetesTokenAuthConnection", + "KubernetesDriverMixin", + "VALID_RESPONSE_CODES", +] + +VALID_RESPONSE_CODES = [ + httplib.OK, + httplib.ACCEPTED, + httplib.CREATED, + httplib.NO_CONTENT, +] + + +class KubernetesException(Exception): + def __init__(self, code, message): + self.code = code + self.message = message + self.args = (code, message) + + def __str__(self): + return "{} {}".format(self.code, self.message) + + def __repr__(self): + return "KubernetesException {} {}".format(self.code, self.message) + + +class KubernetesResponse(JsonResponse): + valid_response_codes = [ + httplib.OK, + httplib.ACCEPTED, + httplib.CREATED, + httplib.NO_CONTENT, + ] + + def parse_error(self): + if self.status == 401: + raise InvalidCredsError("Invalid credentials") + return self.body + + def success(self): + return self.status in self.valid_response_codes + + +class KubernetesTLSAuthConnection(KeyCertificateConnection): + responseCls = KubernetesResponse + timeout = 60 + + def __init__( + self, + key, + secure=True, + host="localhost", + port="6443", + key_file=None, + cert_file=None, + **kwargs, + ): + super().__init__( + key_file=key_file, + cert_file=cert_file, + secure=secure, + host=host, + port=port, + url=None, + proxy_url=None, + timeout=None, + backoff=None, + retry_delay=None, + ) + + if key_file: + keypath = os.path.expanduser(key_file) + is_file_path = os.path.exists(keypath) and os.path.isfile(keypath) + + if not is_file_path: + raise InvalidCredsError( + "You need an key PEM file to authenticate " + "via tls. For more info please visit:" + "https://kubernetes.io/docs/concepts/" + "cluster-administration/certificates/" + ) + + self.key_file = key_file + + certpath = os.path.expanduser(cert_file) + is_file_path = os.path.exists(certpath) and os.path.isfile(certpath) + + if not is_file_path: + raise InvalidCredsError( + "You need an certificate PEM file to authenticate " + "via tls. For more info please visit:" + "https://kubernetes.io/docs/concepts/" + "cluster-administration/certificates/" + ) + + self.cert_file = cert_file + + def add_default_headers(self, headers): + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return headers + + +class KubernetesTokenAuthConnection(ConnectionKey): + responseCls = KubernetesResponse + timeout = 60 + + def add_default_headers(self, headers): + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + if self.key: + headers["Authorization"] = "Bearer " + self.key + else: + raise ValueError("Please provide a valid token in the key param") + return headers + + +class KubernetesBasicAuthConnection(ConnectionUserAndKey): + responseCls = KubernetesResponse + timeout = 60 + + def add_default_headers(self, headers): + """ + Add parameters that are necessary for every request + If user and password are specified, include a base http auth + header + """ + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + + if self.user_id and self.key: + auth_string = b("{}:{}".format(self.user_id, self.key)) + user_b64 = base64.b64encode(auth_string) + headers["Authorization"] = "Basic %s" % (user_b64.decode("utf-8")) + return headers + + +class KubernetesDriverMixin: + """ + Base driver class to be used with various Kubernetes drivers. + + NOTE: This base class can be used in different APIs such as container and + compute one. + """ + + def __init__( + self, + key=None, + secret=None, + secure=False, + host="localhost", + port=4243, + key_file=None, + cert_file=None, + ca_cert=None, + ex_token_bearer_auth=False, + ): + """ + :param key: API key or username to be used (required) + :type key: ``str`` + + :param secret: Secret password to be used (required) + :type secret: ``str`` + + :param secure: Whether to use HTTPS or HTTP. Note: Some providers + only support HTTPS, and it is on by default. + :type secure: ``bool`` + + :param host: Override hostname used for connections. + :type host: ``str`` + + :param port: Override port used for connections. + :type port: ``int`` + + :param key_file: Path to the key file used to authenticate (when + using key file auth). + :type key_file: ``str`` + + :param cert_file: Path to the cert file used to authenticate (when + using key file auth). + :type cert_file: ``str`` + + :param ex_token_bearer_auth: True to use token bearer auth. + :type ex_token_bearer_auth: ``bool`` + + :return: ``None`` + """ + if ex_token_bearer_auth: + self.connectionCls = KubernetesTokenAuthConnection + if not key: + msg = 'The token must be a string provided via "key" argument' + raise ValueError(msg) + secure = True + + if key_file or cert_file: + # Certificate based auth is used + if not (key_file and cert_file): + raise ValueError("Both key and certificate files are needed") + + if key_file: + self.connectionCls = KubernetesTLSAuthConnection + self.key_file = key_file + self.cert_file = cert_file + secure = True + + if host and host.startswith("https://"): + secure = True + + host = self._santize_host(host=host) + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + key_file=key_file, + cert_file=cert_file, + ) + + if ca_cert: + self.connection.connection.ca_cert = ca_cert + else: + # do not verify SSL certificate + warnings.warn( + "Kubernetes has its own CA, since you didn't supply " + "a CA certificate be aware that SSL verification " + "will be disabled for this session." + ) + self.connection.connection.ca_cert = False + + self.connection.secure = secure + self.connection.host = host + + if port is not None: + self.connection.port = port + + def _ex_connection_class_kwargs(self): + kwargs = {} + if hasattr(self, "key_file"): + kwargs["key_file"] = self.key_file + if hasattr(self, "cert_file"): + kwargs["cert_file"] = self.cert_file + return kwargs + + def _santize_host(self, host=None): + # type: (Optional[str]) -> Optional[str] + """ + Sanitize "host" argument any remove any protocol prefix (if specified). + """ + if not host: + return None + + prefixes = ["http://", "https://"] + for prefix in prefixes: + if host.startswith(prefix): + host = host.lstrip(prefix) + + return host diff --git a/libcloud/common/linode.py b/libcloud/common/linode.py index c99169517c..fb1fe24ec8 100644 --- a/libcloud/common/linode.py +++ b/libcloud/common/linode.py @@ -13,174 +13,147 @@ # See the License for the specific language governing permissions and # limitations under the License. -from libcloud.common.base import ConnectionKey, JsonResponse -from libcloud.common.types import InvalidCredsError - -from libcloud.utils.py3 import PY3 -from libcloud.utils.py3 import b +from libcloud.utils.py3 import httplib +from libcloud.common.base import JsonResponse, ConnectionKey +from libcloud.common.gandi import BaseObject +from libcloud.common.types import LibcloudError, InvalidCredsError __all__ = [ - 'API_HOST', - 'API_ROOT', - 'LinodeException', - 'LinodeResponse', - 'LinodeConnection' + "API_HOST", + "DEFAULT_API_VERSION", + "LinodeResponseV4", + "LinodeConnectionV4", + "LinodeExceptionV4", + "LinodeDisk", + "LinodeIPAddress", ] # Endpoint for the Linode API -API_HOST = 'api.linode.com' -API_ROOT = '/' - -# Constants that map a RAM figure to a PlanID (updated 2014-08-25) -LINODE_PLAN_IDS = {1024: '1', - 2048: '2', - 4096: '4', - 8192: '6', - 16384: '7', - 32768: '8', - 49152: '9', - 65536: '10', - 98304: '12'} +API_HOST = "api.linode.com" -# Available filesystems for disk creation -LINODE_DISK_FILESYSTEMS = ['ext3', 'ext4', 'swap', 'raw'] +DEFAULT_API_VERSION = "4.0" +# Available filesystems for disk creation +LINODE_DISK_FILESYSTEMS_V4 = ["ext3", "ext4", "swap", "raw", "initrd"] -class LinodeException(Exception): - """Error originating from the Linode API - This class wraps a Linode API error, a list of which is available in the - API documentation. All Linode API errors are a numeric code and a - human-readable description. - """ - def __init__(self, code, message): - self.code = code +class LinodeExceptionV4(Exception): + def __init__(self, message): self.message = message - self.args = (code, message) def __str__(self): - return "(%u) %s" % (self.code, self.message) + return "%s" % self.message def __repr__(self): - return "" % (self.code, self.message) - - -class LinodeResponse(JsonResponse): - """ - Linode API response - - Wraps the HTTP response returned by the Linode API. - - libcloud does not take advantage of batching, so a response will always - reflect the above format. A few weird quirks are caught here as well. - """ + return "" % self.message - objects = None - def __init__(self, response, connection): - """Instantiate a LinodeResponse from the HTTP response +class LinodeResponseV4(JsonResponse): + valid_response_codes = [ + httplib.OK, + httplib.NO_CONTENT, + ] - :keyword response: The raw response returned by urllib - :return: parsed :class:`LinodeResponse`""" - - self.connection = connection - - self.headers = dict(response.getheaders()) - self.error = response.reason - self.status = response.status - - # This attribute is set when using LoggingConnection. - original_data = getattr(response, '_original_data', None) + def parse_body(self): + """Parse the body of the response into JSON objects + :return: ``dict`` of objects""" + return super().parse_body() - if original_data: - # LoggingConnection already decompresses data so it can log it - # which means we don't need to decompress it here. - self.body = response._original_data + def parse_error(self): + """ + Parse the error body and raise the appropriate exception + """ + status = int(self.status) + data = self.parse_body() + # Use only the first error, as there'll be only one most of the time + error = data["errors"][0] + reason = error.get("reason") + # The field in the request that caused this error + field = error.get("field") + + if field is not None: + error_msg = "{}-{}".format(reason, field) else: - self.body = self._decompress_response(body=response.read(), - headers=self.headers) - - if PY3: - self.body = b(self.body).decode('utf-8') - - self.invalid = LinodeException(0xFF, - "Invalid JSON received from server") + error_msg = reason - # Move parse_body() to here; we can't be sure of failure until we've - # parsed the body into JSON. - self.objects, self.errors = self.parse_body() + if status in [httplib.UNAUTHORIZED, httplib.FORBIDDEN]: + raise InvalidCredsError(value=error_msg) - if not self.success(): - # Raise the first error, as there will usually only be one - raise self.errors[0] - - def parse_body(self): - """Parse the body of the response into JSON objects - - If the response chokes the parser, action and data will be returned as - None and errorarray will indicate an invalid JSON exception. - - :return: ``list`` of objects and ``list`` of errors""" - js = super(LinodeResponse, self).parse_body() - - try: - if isinstance(js, dict): - # solitary response - promote to list - js = [js] - ret = [] - errs = [] - for obj in js: - if ("DATA" not in obj or "ERRORARRAY" not in obj or - "ACTION" not in obj): - ret.append(None) - errs.append(self.invalid) - continue - ret.append(obj["DATA"]) - errs.extend(self._make_excp(e) for e in obj["ERRORARRAY"]) - return (ret, errs) - except: - return (None, [self.invalid]) + raise LibcloudError( + "%s Status code: %d." % (error_msg, status), driver=self.connection.driver + ) def success(self): """Check the response for success - - The way we determine success is by the presence of an error in - ERRORARRAY. If one is there, we assume the whole request failed. - :return: ``bool`` indicating a successful request""" - return len(self.errors) == 0 - - def _make_excp(self, error): - """Convert an API error to a LinodeException instance - - :keyword error: JSON object containing ``ERRORCODE`` and - ``ERRORMESSAGE`` - :type error: dict""" - if "ERRORCODE" not in error or "ERRORMESSAGE" not in error: - return None - if error["ERRORCODE"] == 4: - return InvalidCredsError(error["ERRORMESSAGE"]) - return LinodeException(error["ERRORCODE"], error["ERRORMESSAGE"]) + return self.status in self.valid_response_codes -class LinodeConnection(ConnectionKey): +class LinodeConnectionV4(ConnectionKey): """ A connection to the Linode API - Wraps SSL connections to the Linode API, automagically injecting the - parameters that the API needs for each request. + Wraps SSL connections to the Linode API """ + host = API_HOST - responseCls = LinodeResponse + responseCls = LinodeResponseV4 + + def add_default_headers(self, headers): + """ + Add headers that are necessary for every request + + This method adds ``token`` to the request. + """ + headers["Authorization"] = "Bearer %s" % (self.key) + headers["Content-Type"] = "application/json" + return headers def add_default_params(self, params): """ Add parameters that are necessary for every request - This method adds ``api_key`` and ``api_responseFormat`` to - the request. + This method adds ``page_size`` to the request to reduce the total + number of paginated requests to the API. """ - params["api_key"] = self.key - # Be explicit about this in case the default changes. - params["api_responseFormat"] = "json" + # pylint: disable=maybe-no-member + params["page_size"] = 25 return params + + +class LinodeDisk(BaseObject): + def __init__(self, id, state, name, filesystem, driver, size, extra=None): + super().__init__(id, state, driver) + self.name = name + self.size = size + self.filesystem = filesystem + self.extra = extra or {} + + def __repr__(self): + return ( + "" + ) % ( + self.id, + self.name, + self.state, + self.size, + self.filesystem, + self.driver.name, + ) + + +class LinodeIPAddress: + def __init__(self, inet, public, version, driver, extra=None): + self.inet = inet + self.public = public + self.version = version + self.driver = driver + self.extra = extra or {} + + def __repr__(self): + return ("") % ( + self.inet, + self.public, + self.version, + self.driver.name, + ) diff --git a/libcloud/common/liquidweb.py b/libcloud/common/liquidweb.py new file mode 100644 index 0000000000..8a7635daec --- /dev/null +++ b/libcloud/common/liquidweb.py @@ -0,0 +1,168 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import base64 + +from libcloud.utils.py3 import b +from libcloud.common.base import JsonResponse, ConnectionUserAndKey +from libcloud.common.types import ProviderError + +__all__ = [ + "API_HOST", + "LiquidWebException", + "LiquidWebResponse", + "LiquidWebConnection", +] + + +# Endpoint for liquidweb api. +API_HOST = "api.stormondemand.com" + + +class LiquidWebException(ProviderError): + """The base class for other Liquidweb exceptions""" + + def __init__(self, value, http_code, extra=None): + """ + :param value: message contained in error + :type value: ``str`` + + :param http_code: error code + :type http_code: ``int`` + + :param extra: extra fields specific to error type + :type extra: ``list`` + """ + self.extra = extra + super().__init__(value, http_code, driver=None) + + def __str__(self): + return "{} {}".format(self.http_code, self.value) + + def __repr__(self): + return "LiquidWebException {} {}".format(self.http_code, self.value) + + +class APIException(LiquidWebException): + def __init__(self, error_class, full_msg, http_code, extra=None): + self.error_class = error_class + super().__init__(full_msg, http_code, extra=extra) + + def __str__(self): + return "{}: {}".format(self.error_class, self.value) + + def __repr__(self): + return "{}: {}".format(self.error_class, self.value) + + +EXCEPTIONS_FIELDS = { + "LW::Exception::API::Internal": {"fields": []}, + "LW::Exception::API::InvalidEncoding": {"fields": ["encoding"]}, + "LW::Exception::API::InvalidMethod": {"fields": ["method"]}, + "LW::Exception::API::Maintenance": {"fields": []}, + "LW::Exception::API::RateLimit": {"fields": ["account", "ip", "method"]}, + "LW::Exception::Authorization": {"fields": ["username"]}, + "LW::Exception::DNS::NoResponse": {"fields": ["nameservers"]}, + "LW::Exception::DNS::Servfail": {"fields": ["nameservers"]}, + "LW::Exception::Deserialize": {"fields": ["data", "encoding"]}, + "LW::Exception::DuplicateRecord": {"fields": ["field", "input", "statement"]}, + "LW::Exception::Forbidden": {"fields": []}, + "LW::Exception::Incapable": {"fields": ["capability", "thing"]}, + "LW::Exception::Input": {"fields": ["field"]}, + "LW::Exception::Input::Disallowed": {"fields": ["field"]}, + "LW::Exception::Input::Multiple": {"fields": ["errors", "field", "type"]}, + "LW::Exception::Input::NotInRealm": {"fields": ["field", "valid", "value"]}, + "LW::Exception::Input::OutOfBounds": {"fields": ["field", "max", "min", "value"]}, + "LW::Exception::Input::Required": {"fields": ["field", "position"]}, + "LW::Exception::Input::Unknown": {"fields": ["field", "value"]}, + "LW::Exception::Input::Validation": {"fields": ["field", "type", "value"]}, + "LW::Exception::Permission": {"fields": ["account", "identifier"]}, + "LW::Exception::RecordNotFound": {"fields": ["field", "input"]}, + "LW::Exception::RemoteService::Authorization": {"fields": ["url"]}, + "LW::Exception::Resource": {"fields": ["resource"]}, + "LW::Exception::Resource::Insufficient": {"fields": ["available", "requested", "resource"]}, + "LW::Exception::Resource::Unavailable": {"fields": ["resource"]}, + "LW::Exception::Serialize": {"fields": ["data", "encoding"]}, + "LW::Exception::Workflow::Conflict": {"fields": ["conflict", "workflow"]}, +} + + +class LiquidWebResponse(JsonResponse): + objects = None + errors = None + + def __init__(self, response, connection): + self.errors = [] + super().__init__(response=response, connection=connection) + self.objects, self.errors = self.parse_body_and_errors() + if self.errors: + error = self.errors.pop() + raise self._make_excp(error, self.status) + + def parse_body_and_errors(self): + data = [] + errors = [] + js = super().parse_body() + if "items" in js: + data.append(js["items"]) + + if "name" in js: + data.append(js) + + if "deleted" in js: + data.append(js["deleted"]) + + if "error_class" in js: + errors.append(js) + + return (data, errors) + + def success(self): + """ + Returns ``True`` if our request is successful. + """ + return len(self.errors) == 0 + + def _make_excp(self, error, status): + """ + Raise LiquidWebException. + """ + exc_type = error.get("error_class") + message = error.get("full_message") + try: + _type = EXCEPTIONS_FIELDS[exc_type] + fields = _type.get("fields") + extra = {} + except KeyError: + fields = [] + + for field in fields: + extra[field] = error.get(field) + return APIException(exc_type, message, status, extra=extra) + + +class LiquidWebConnection(ConnectionUserAndKey): + host = API_HOST + responseCls = LiquidWebResponse + + def add_default_headers(self, headers): + b64string = b("{}:{}".format(self.user_id, self.key)) + encoded = base64.b64encode(b64string).decode("utf-8") + authorization = "Basic " + encoded + + headers["Authorization"] = authorization + headers["Content-Type"] = "application/json" + + return headers diff --git a/libcloud/common/luadns.py b/libcloud/common/luadns.py new file mode 100644 index 0000000000..8db6d89906 --- /dev/null +++ b/libcloud/common/luadns.py @@ -0,0 +1,83 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import base64 +from typing import Dict, List + +from libcloud.utils.py3 import b +from libcloud.common.base import JsonResponse, ConnectionUserAndKey + +__all__ = ["API_HOST", "LuadnsException", "LuadnsResponse", "LuadnsConnection"] + +# Endpoint for luadns api +API_HOST = "api.luadns.com" + + +class LuadnsResponse(JsonResponse): + errors: List[Dict] + objects: List[Dict] + + def __init__(self, response, connection): + # Use fresh per-instance lists: the previous class-level lists were + # shared by every response object of the process, so parsed entries + # (including errors) leaked between requests and made success() + # report stale failures. They must exist before super().__init__(), + # which calls success(). + self.errors = [] + self.objects = [] + super().__init__(response=response, connection=connection) + self.errors, self.objects = self.parse_body_and_errors() + if not self.success(): + raise LuadnsException(code=self.status, message=self.errors.pop()["message"]) + + def parse_body_and_errors(self): + js = super().parse_body() + if "message" in js: + self.errors.append(js) + else: + self.objects.append(js) + + return self.errors, self.objects + + def success(self): + return len(self.errors) == 0 + + +class LuadnsConnection(ConnectionUserAndKey): + host = API_HOST + responseCls = LuadnsResponse + + def add_default_headers(self, headers): + b64string = b("{}:{}".format(self.user_id, self.key)) + encoded = base64.b64encode(b64string).decode("utf-8") + authorization = "Basic " + encoded + + headers["Accept"] = "application/json" + headers["Authorization"] = authorization + + return headers + + +class LuadnsException(Exception): + def __init__(self, code, message): + self.code = code + self.message = message + self.args = (code, message) + + def __str__(self): + return "{} {}".format(self.code, self.message) + + def __repr__(self): + return "Luadns {} {}".format(self.code, self.message) diff --git a/libcloud/common/maxihost.py b/libcloud/common/maxihost.py new file mode 100644 index 0000000000..36b6a5113d --- /dev/null +++ b/libcloud/common/maxihost.py @@ -0,0 +1,62 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.utils.py3 import httplib +from libcloud.common.base import JsonResponse, ConnectionKey +from libcloud.common.types import InvalidCredsError + + +class MaxihostResponse(JsonResponse): + valid_response_codes = [ + httplib.OK, + httplib.ACCEPTED, + httplib.CREATED, + httplib.NO_CONTENT, + ] + + def parse_error(self): + if self.status == httplib.UNAUTHORIZED: + body = self.parse_body() + raise InvalidCredsError(body["message"]) + else: + body = self.parse_body() + if "message" in body: + error = "{} (code: {})".format(body["message"], self.status) + else: + error = body + return error + + def success(self): + return self.status in self.valid_response_codes + + +class MaxihostConnection(ConnectionKey): + """ + Connection class for the Maxihost driver. + """ + + host = "api.maxihost.com" + responseCls = MaxihostResponse + + def add_default_headers(self, headers): + """ + Add headers that are necessary for every request + + This method adds apikey to the request. + """ + headers["Authorization"] = "Bearer %s" % (self.key) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/vnd.maxihost.v1.1+json" + return headers diff --git a/libcloud/common/nfsn.py b/libcloud/common/nfsn.py new file mode 100644 index 0000000000..426e843835 --- /dev/null +++ b/libcloud/common/nfsn.py @@ -0,0 +1,119 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import time +import random +import string +import hashlib + +from libcloud.utils.py3 import httplib, urlencode, basestring +from libcloud.common.base import JsonResponse, ConnectionUserAndKey +from libcloud.common.types import ProviderError, InvalidCredsError + +SALT_CHARACTERS = string.ascii_letters + string.digits + + +class NFSNException(ProviderError): + def __init__(self, value, http_code, code, driver=None): + self.code = code + super().__init__(value, http_code, driver) + + +class NFSNResponse(JsonResponse): + def parse_error(self): + if self.status == httplib.UNAUTHORIZED: + raise InvalidCredsError("Invalid provider credentials") + + body = self.parse_body() + + if isinstance(body, basestring): + return body + " (HTTP Code: %d)" % self.status + + error = body.get("error", None) + debug = body.get("debug", None) + # If we only have one of "error" or "debug", use the one that we have. + # If we have both, use both, with a space character in between them. + value = "No message specified" + + if error is not None: + value = error + + if debug is not None: + value = debug + + if error is not None and value is not None: + value = error + " " + value + value = value + " (HTTP Code: %d)" % self.status + + return value + + +class NFSNConnection(ConnectionUserAndKey): + host = "api.nearlyfreespeech.net" + responseCls = NFSNResponse + allow_insecure = False + + def _header(self, action, data): + """Build the contents of the X-NFSN-Authentication HTTP header. See + https://members.nearlyfreespeech.net/wiki/API/Introduction for + more explanation.""" + login = self.user_id + timestamp = self._timestamp() + salt = self._salt() + api_key = self.key + data = urlencode(data) + data_hash = hashlib.sha1(data.encode("utf-8")).hexdigest() # nosec + + string = ";".join((login, timestamp, salt, api_key, action, data_hash)) + string_hash = hashlib.sha1(string.encode("utf-8")).hexdigest() # nosec + + return ";".join((login, timestamp, salt, string_hash)) + + def request(self, action, params=None, data="", headers=None, method="GET"): + """Add the X-NFSN-Authentication header to an HTTP request.""" + + if not headers: + headers = {} + + if not params: + params = {} + header = self._header(action, data) + + headers["X-NFSN-Authentication"] = header + + if method == "POST": + headers["Content-Type"] = "application/x-www-form-urlencoded" + + return ConnectionUserAndKey.request(self, action, params, data, headers, method) + + def encode_data(self, data): + """NFSN expects the body to be regular key-value pairs that are not + JSON-encoded.""" + + if data: + data = urlencode(data) + + return data + + def _salt(self): + """Return a 16-character alphanumeric string.""" + r = random.SystemRandom() + + return "".join(r.choice(SALT_CHARACTERS) for _ in range(16)) + + def _timestamp(self): + """Return the current number of seconds since the Unix epoch, + as a string.""" + + return str(int(time.time())) diff --git a/libcloud/common/nsone.py b/libcloud/common/nsone.py new file mode 100644 index 0000000000..da6a1c2473 --- /dev/null +++ b/libcloud/common/nsone.py @@ -0,0 +1,77 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Dict, List + +from libcloud.common.base import JsonResponse, ConnectionKey + +__all__ = ["API_HOST", "NsOneException", "NsOneResponse", "NsOneConnection"] + +# Endpoint for nsone api +API_HOST = "api.nsone.net" + + +class NsOneResponse(JsonResponse): + errors: List[Dict] + objects: List[Dict] + + def __init__(self, response, connection): + # Use fresh per-instance lists: the previous class-level lists were + # shared by every response object of the process, so parsed entries + # (including errors) leaked between requests and made success() + # report stale failures. They must exist before super().__init__(), + # which calls success(). + self.errors = [] + self.objects = [] + super().__init__(response=response, connection=connection) + self.errors, self.objects = self.parse_body_and_errors() + if not self.success(): + raise NsOneException(code=self.status, message=self.errors.pop()["message"]) + + def parse_body_and_errors(self): + js = super().parse_body() + if "message" in js: + self.errors.append(js) + else: + self.objects.append(js) + + return self.errors, self.objects + + def success(self): + return len(self.errors) == 0 + + +class NsOneConnection(ConnectionKey): + host = API_HOST + responseCls = NsOneResponse + + def add_default_headers(self, headers): + headers["Content-Type"] = "application/json" + headers["X-NSONE-KEY"] = self.key + + return headers + + +class NsOneException(Exception): + def __init__(self, code, message): + self.code = code + self.message = message + self.args = (code, message) + + def __str__(self): + return "{} {}".format(self.code, self.message) + + def __repr__(self): + return "NsOneException {} {}".format(self.code, self.message) diff --git a/libcloud/common/nttcis.py b/libcloud/common/nttcis.py new file mode 100644 index 0000000000..fba02289a5 --- /dev/null +++ b/libcloud/common/nttcis.py @@ -0,0 +1,2343 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +NTTCIS Common Components +""" + +import re +import xml.etree.ElementTree as etree +from io import BytesIO +from copy import deepcopy +from time import sleep +from base64 import b64encode +from typing import Dict +from functools import wraps + +# TODO: use distutils.version when Travis CI fixed the pylint issue with version +# from distutils.version import LooseVersion +from libcloud.utils.py3 import b, httplib, basestring +from libcloud.utils.xml import findtext +from libcloud.common.base import RawResponse, XmlResponse, ConnectionUserAndKey +from libcloud.compute.base import Node +from libcloud.compute.types import LibcloudError, InvalidCredsError + +try: + from collections.abc import Mapping, MutableSequence +except ImportError: + from collections.abc import Mapping, MutableSequence + + +# Roadmap / TODO: +# +# 1.0 - Copied from OpSource API, named provider details. + +# setup a few variables to represent all of the NTTC-CIS cloud namespaces +NAMESPACE_BASE = "http://oec.api.opsource.net/schemas" +ORGANIZATION_NS = NAMESPACE_BASE + "/organization" +SERVER_NS = NAMESPACE_BASE + "/server" +NETWORK_NS = NAMESPACE_BASE + "/network" +DIRECTORY_NS = NAMESPACE_BASE + "/directory" +GENERAL_NS = NAMESPACE_BASE + "/general" +BACKUP_NS = NAMESPACE_BASE + "/backup" + +# API 2.0 Namespaces and URNs +TYPES_URN = "urn:didata.com:api:cloud:types" + +# API end-points +API_ENDPOINTS = { + "na": { + "name": "North America (NA)", + "host": "api-na.dimensiondata.com", + "vendor": "NTTC-CIS", + }, + "eu": { + "name": "Europe (EU)", + "host": "api-eu.dimensiondata.com", + "vendor": "NTTC-CIS", + }, + "au": { + "name": "Australia (AU)", + "host": "api-au.dimensiondata.com", + "vendor": "NTTC-CIS", + }, + "au-gov": { + "name": "Australia Canberra ACT (AU)", + "host": "api-canberra.dimensiondata.com", + "vendor": "NTTC-CIS", + }, + "af": { + "name": "Africa (AF)", + "host": "api-mea.dimensiondata.com", + "vendor": "NTTC-CIS", + }, + "ap": { + "name": "Asia Pacific (AP)", + "host": "api-ap.dimensiondata.com", + "vendor": "NTTC-CIS", + }, + "ca": { + "name": "Canada (CA)", + "host": "api-canada.dimensiondata.com", + "vendor": "NTTC-CIS", + }, + "is-na": { + "name": "North America (NA)", + "host": "usapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "is-eu": { + "name": "Europe (EU)", + "host": "euapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "is-au": { + "name": "Australia (AU)", + "host": "auapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "is-af": { + "name": "Africa (AF)", + "host": "meaapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "is-ap": { + "name": "Asia Pacific (AP)", + "host": "apapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "is-latam": { + "name": "South America (LATAM)", + "host": "latamapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "is-canada": { + "name": "Canada (CA)", + "host": "canadaapi.cloud.is.co.za", + "vendor": "InternetSolutions", + }, + "ntta-na": { + "name": "North America (NA)", + "host": "cloudapi.nttamerica.com", + "vendor": "NTTNorthAmerica", + }, + "ntta-eu": { + "name": "Europe (EU)", + "host": "eucloudapi.nttamerica.com", + "vendor": "NTTNorthAmerica", + }, + "ntta-au": { + "name": "Australia (AU)", + "host": "aucloudapi.nttamerica.com", + "vendor": "NTTNorthAmerica", + }, + "ntta-af": { + "name": "Africa (AF)", + "host": "sacloudapi.nttamerica.com", + "vendor": "NTTNorthAmerica", + }, + "ntta-ap": { + "name": "Asia Pacific (AP)", + "host": "hkcloudapi.nttamerica.com", + "vendor": "NTTNorthAmerica", + }, + "cisco-na": { + "name": "North America (NA)", + "host": "iaas-api-na.cisco-ccs.com", + "vendor": "Cisco", + }, + "cisco-eu": { + "name": "Europe (EU)", + "host": "iaas-api-eu.cisco-ccs.com", + "vendor": "Cisco", + }, + "cisco-au": { + "name": "Australia (AU)", + "host": "iaas-api-au.cisco-ccs.com", + "vendor": "Cisco", + }, + "cisco-af": { + "name": "Africa (AF)", + "host": "iaas-api-mea.cisco-ccs.com", + "vendor": "Cisco", + }, + "cisco-ap": { + "name": "Asia Pacific (AP)", + "host": "iaas-api-ap.cisco-ccs.com", + "vendor": "Cisco", + }, + "cisco-latam": { + "name": "South America (LATAM)", + "host": "iaas-api-sa.cisco-ccs.com", + "vendor": "Cisco", + }, + "cisco-canada": { + "name": "Canada (CA)", + "host": "iaas-api-ca.cisco-ccs.com", + "vendor": "Cisco", + }, +} + +# Default API end-point for the base connection class. +DEFAULT_REGION = "na" + +BAD_CODE_XML_ELEMENTS = ( + ("responseCode", SERVER_NS), + ("responseCode", TYPES_URN), + ("result", GENERAL_NS), +) + +BAD_MESSAGE_XML_ELEMENTS = ( + ("message", SERVER_NS), + ("message", TYPES_URN), + ("resultDetail", GENERAL_NS), +) + + +def get_params(func): + @wraps(func) + def paramed(*args, **kwargs): + if kwargs: + params = {} + for k, v in kwargs.items(): + matches = re.findall(r"_(\w)", k) + for match in matches: + k = k.replace("_" + match, match.upper()) + params[k] = v + result = func(args[0], params) + else: + result = func(args[0]) + return result + + return paramed + + +def dd_object_to_id(obj, obj_type, id_value="id"): + """ + Takes in a DD object or string and prints out it's id + This is a helper method, as many of our functions can take either an object + or a string, and we need an easy way of converting them + + :param obj: The object to get the id for + :type obj: ``object`` + + :param func: The function to call, e.g. ex_get_vlan. Note: This + function needs to return an object which has ``status`` + attribute. + :type func: ``function`` + + :rtype: ``str`` + """ + if isinstance(obj, obj_type): + return getattr(obj, id_value) + elif isinstance(obj, (basestring)): + return obj + else: + raise TypeError( + "Invalid type {} looking for basestring or {}".format( + type(obj).__name__, obj_type.__name__ + ) + ) + + +# TODO: use distutils.version when Travis CI fixed the pylint issue with version +# This is a temporary workaround. +def LooseVersion(version): + return float(version) + + +class NetworkDomainServicePlan: + ESSENTIALS = "ESSENTIALS" + ADVANCED = "ADVANCED" + + +class NttCisRawResponse(RawResponse): + pass + + +class NttCisResponse(XmlResponse): + def parse_error(self): + if self.status == httplib.UNAUTHORIZED: + raise InvalidCredsError(self.body) + elif self.status == httplib.FORBIDDEN: + raise InvalidCredsError(self.body) + + body = self.parse_body() + + if self.status == httplib.BAD_REQUEST: + for response_code in BAD_CODE_XML_ELEMENTS: + code = findtext(body, response_code[0], response_code[1]) + if code is not None: + break + for message in BAD_MESSAGE_XML_ELEMENTS: + message = findtext(body, message[0], message[1]) + if message is not None: + break + raise NttCisAPIException(code=code, msg=message, driver=self.connection.driver) + if self.status is not httplib.OK: + raise NttCisAPIException(code=self.status, msg=body, driver=self.connection.driver) + + return self.body + + +class NttCisAPIException(LibcloudError): + def __init__(self, code, msg, driver): + self.code = code + self.msg = msg + self.driver = driver + + def __str__(self): + return "{}: {}".format(self.code, self.msg) + + def __repr__(self): + return "".format(self.code, self.msg) + + +class NttCisConnection(ConnectionUserAndKey): + """ + Connection class for the NttCis driver + """ + + api_path_version_1 = "/oec" + api_path_version_2 = "/caas" + api_version_1 = 0.9 + + # Earliest version supported + oldest_api_version = "2.2" + + # Latest version supported + latest_api_version = "2.7" + + # Default api version + active_api_version = "2.7" + + _orgId = None + responseCls = NttCisResponse + rawResponseCls = NttCisRawResponse + + allow_insecure = False + + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + api_version=None, + **conn_kwargs, + ): + super().__init__( + user_id=user_id, + key=key, + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + proxy_url=proxy_url, + ) + + if conn_kwargs["region"]: + self.host = conn_kwargs["region"]["host"] + + if api_version: + if LooseVersion(api_version) < LooseVersion(self.oldest_api_version): + msg = ( + "API Version specified is too old. No longer " + "supported. Please upgrade to the latest version {}".format( + self.active_api_version + ) + ) + + raise NttCisAPIException(code=None, msg=msg, driver=self.driver) + elif LooseVersion(api_version) > LooseVersion(self.latest_api_version): + msg = ( + "Unsupported API Version. The version specified is " + "not release yet. Please use the latest supported " + "version {}".format(self.active_api_version) + ) + + raise NttCisAPIException(code=None, msg=msg, driver=self.driver) + + else: + # Overwrite default version using the version user specified + self.active_api_version = api_version + + def add_default_headers(self, headers): + headers["Authorization"] = "Basic %s" % b64encode( + b("{}:{}".format(self.user_id, self.key)) + ).decode("utf-8") + headers["Content-Type"] = "application/xml" + return headers + + def request_api_1(self, action, params=None, data="", headers=None, method="GET"): + action = "{}/{}/{}".format(self.api_path_version_1, self.api_version_1, action) + + return super().request( + action=action, params=params, data=data, method=method, headers=headers + ) + + def request_api_2(self, path, action, params=None, data="", headers=None, method="GET"): + action = "{}/{}/{}/{}".format( + self.api_path_version_2, + self.active_api_version, + path, + action, + ) + + return super().request( + action=action, params=params, data=data, method=method, headers=headers + ) + + def raw_request_with_orgId_api_1( + self, action, params=None, data="", headers=None, method="GET" + ): + action = "{}/{}".format(self.get_resource_path_api_1(), action) + return super().request( + action=action, + params=params, + data=data, + method=method, + headers=headers, + raw=True, + ) + + def request_with_orgId_api_1(self, action, params=None, data="", headers=None, method="GET"): + action = "{}/{}".format(self.get_resource_path_api_1(), action) + + return super().request( + action=action, params=params, data=data, method=method, headers=headers + ) + + def request_with_orgId_api_2(self, action, params=None, data="", headers=None, method="GET"): + action = "{}/{}".format(self.get_resource_path_api_2(), action) + + return super().request( + action=action, params=params, data=data, method=method, headers=headers + ) + + def paginated_request_with_orgId_api_2( + self, action, params=None, data="", headers=None, method="GET", page_size=250 + ): + """ + A paginated request to the MCP2.0 API + This essentially calls out to request_with_orgId_api_2 for each page + and yields the response to make a generator + This generator can be looped through to grab all the pages. + + :param action: The resource to access (i.e. 'network/vlan') + :type action: ``str`` + + :param params: Parameters to give to the action + :type params: ``dict`` or ``None`` + + :param data: The data payload to be added to the request + :type data: ``str`` + + :param headers: Additional header to be added to the request + :type headers: ``str`` or ``dict`` or ``None`` + + :param method: HTTP Method for the request (i.e. 'GET', 'POST') + :type method: ``str`` + + :param page_size: The size of each page to be returned + Note: Max page size in MCP2.0 is currently 250 + :type page_size: ``int`` + """ + if params is None: + params = {} + params["pageSize"] = page_size + + resp = self.request_with_orgId_api_2(action, params, data, headers, method).object + yield resp + if len(resp) <= 0: + return + + pcount = resp.get("pageCount") # pylint: disable=no-member + psize = resp.get("pageSize") # pylint: disable=no-member + pnumber = resp.get("pageNumber") # pylint: disable=no-member + + while int(pcount) >= int(psize): + params["pageNumber"] = int(pnumber) + 1 + resp = self.request_with_orgId_api_2(action, params, data, headers, method).object + pcount = resp.get("pageCount") # pylint: disable=no-member + psize = resp.get("pageSize") # pylint: disable=no-member + pnumber = resp.get("pageNumber") # pylint: disable=no-member + yield resp + + def get_resource_path_api_1(self): + """ + This method returns a resource path which is necessary for referencing + resources that require a full path instead of just an ID, such as + networks, and customer snapshots. + """ + return "{}/{}/{}".format( + self.api_path_version_1, + self.api_version_1, + self._get_orgId(), + ) + + def get_resource_path_api_2(self): + """ + This method returns a resource path which is necessary for referencing + resources that require a full path instead of just an ID, such as + networks, and customer snapshots. + """ + return "{}/{}/{}".format( + self.api_path_version_2, + self.active_api_version, + self._get_orgId(), + ) + + def wait_for_state(self, state, func, poll_interval=2, timeout=60, *args, **kwargs): + """ + Wait for the function which returns a instance with field status/state + to match. + + Keep polling func until one of the desired states is matched + + :param state: Either the desired state (`str`) or a `list` of states + :type state: ``str`` or ``list`` + + :param func: The function to call, e.g. ex_get_vlan. Note: This + function needs to return an object which has ``status`` + attribute. + :type func: ``function`` + + :param poll_interval: The number of seconds to wait between checks + :type poll_interval: `int` + + :param timeout: The total number of seconds to wait to reach a state + :type timeout: `int` + + :param args: The arguments for func + :type args: Positional arguments + + :param kwargs: The arguments for func + :type kwargs: Keyword arguments + + :return: Result from the calling function. + """ + cnt = 0 + result = None + object_state = None + state = state.lower() + while cnt < timeout / poll_interval: + result = func(*args, **kwargs) + if isinstance(result, Node): + object_state = result.state.lower() + else: + # BUG: need to use result.status.lower() or + # will never match if client uses lower case + object_state = result.status.lower() + if object_state is state or object_state in state: + return result + sleep(poll_interval) + cnt += 1 + + msg = "Status check for object %s timed out" % (result) + raise NttCisAPIException(code=object_state, msg=msg, driver=self.driver) + + def _get_orgId(self): + """ + Send the /myaccount API request to NTTC-CIS cloud and parse the + 'orgId' from the XML response object. We need the orgId to use most + of the other API functions + """ + if self._orgId is None: + body = self.request_api_1("myaccount").object + self._orgId = findtext(body, "orgId", DIRECTORY_NS) + return self._orgId + + def get_account_details(self): + """ + Get the details of this account + + :rtype: :class:`DimensionDataAccountDetails` + """ + body = self.request_api_1("myaccount").object + return NttCisAccountDetails( + user_name=findtext(body, "userName", DIRECTORY_NS), + full_name=findtext(body, "fullName", DIRECTORY_NS), + first_name=findtext(body, "firstName", DIRECTORY_NS), + last_name=findtext(body, "lastName", DIRECTORY_NS), + email=findtext(body, "emailAddress", DIRECTORY_NS), + ) + + +class NttCisAccountDetails: + """ + NTTCIS account class details + """ + + def __init__(self, user_name, full_name, first_name, last_name, email): + self.user_name = user_name + self.full_name = full_name + self.first_name = first_name + self.last_name = last_name + self.email = email + + +class NttCisStatus: + """ + NTTCIS API pending operation status class + action, request_time, user_name, number_of_steps, update_time, + step.name, step.number, step.percent_complete, failure_reason, + """ + + def __init__( + self, + action=None, + request_time=None, + user_name=None, + number_of_steps=None, + update_time=None, + step_name=None, + step_number=None, + step_percent_complete=None, + failure_reason=None, + ): + self.action = action + self.request_time = request_time + self.user_name = user_name + self.number_of_steps = number_of_steps + self.update_time = update_time + self.step_name = step_name + self.step_number = step_number + self.step_percent_complete = step_percent_complete + self.failure_reason = failure_reason + + def __repr__(self): + return ( + "" + ) % ( + self.action, + self.request_time, + self.user_name, + self.number_of_steps, + self.update_time, + self.step_name, + self.step_number, + self.step_percent_complete, + self.failure_reason, + ) + + +class NttCisNetwork: + """ + NTTCIS network with location. + """ + + def __init__(self, id, name, description, location, private_net, multicast, status): + self.id = str(id) + self.name = name + self.description = description + self.location = location + self.private_net = private_net + self.multicast = multicast + self.status = status + + def __repr__(self): + return ( + "" + ) % ( + self.id, + self.name, + self.description, + self.location, + self.private_net, + self.multicast, + ) + + +class NttCisNetworkDomain: + """ + NttCis network domain with location. + """ + + def __init__(self, id, name, description, location, status, plan): + self.id = str(id) + self.name = name + self.description = description + self.location = location + self.status = status + self.plan = plan + + def __repr__(self): + return ( + "" + ) % ( + self.id, + self.name, + self.description, + self.location, + self.status, + self.plan, + ) + + +class NttCisPublicIpBlock: + """ + NTTCIS Public IP Block with location. + """ + + def __init__(self, id, base_ip, size, location, network_domain, status): + self.id = str(id) + self.base_ip = base_ip + self.size = size + self.location = location + self.network_domain = network_domain + self.status = status + + def __repr__(self): + return ("") % ( + self.id, + self.base_ip, + self.size, + self.location, + self.status, + ) + + +class NttCisServerCpuSpecification: + """ + A class that represents the specification of the CPU(s) for a + node + """ + + def __init__(self, cpu_count, cores_per_socket, performance): + """ + Instantiate a new :class:`NttCisServerCpuSpecification` + + :param cpu_count: The number of CPUs + :type cpu_count: ``int`` + + :param cores_per_socket: The number of cores per socket, the + recommendation is 1 + :type cores_per_socket: ``int`` + + :param performance: The performance type, e.g. HIGHPERFORMANCE + :type performance: ``str`` + """ + self.cpu_count = cpu_count + self.cores_per_socket = cores_per_socket + self.performance = performance + + def __repr__(self): + return ( + "" + ) % (self.cpu_count, self.cores_per_socket, self.performance) + + +class NttCisServerDisk: + """ + A class that represents the disk on a server + """ + + def __init__(self, id=None, scsi_id=None, size_gb=None, speed=None, state=None): + """ + Instantiate a new :class:`DimensionDataServerDisk` + + :param id: The id of the disk + :type id: ``str`` + + :param scsi_id: Representation for scsi + :type scsi_id: ``int`` + + :param size_gb: Size of the disk + :type size_gb: ``int`` + + :param speed: Speed of the disk (i.e. STANDARD) + :type speed: ``str`` + + :param state: State of the disk (i.e. PENDING) + :type state: ``str`` + """ + self.id = id + self.scsi_id = scsi_id + self.size_gb = size_gb + self.speed = speed + self.state = state + + def __repr__(self): + return ("") % ( + self.status, + self.version_status, + self.api_version, + ) + + +class NttCisSnapshot: + """ + NTTCIS Class representing server snapshots + """ + + def __init__( + self, + server_id, + service_plan, + id=None, + window_id=None, + start_time=None, + state=None, + end_time=None, + type=None, + expiry_time=None, + action=None, + ): + self.server_id = server_id + self.service_plan = service_plan + self.id = id + self.window_id = window_id + self.start_time = start_time + self.end_time = end_time + self.state = state + self.end_time = end_time + self.type = type + self.expiry_time = expiry_time + self.action = action + + def __repr__(self): + return ( + "" + ) % ( + self.id, + self.start_time, + self.end_time, + self.type, + self.expiry_time, + self.state, + ) + + +class NttCisReservedIpAddress: + """ + NTTCIS Rerverse IPv4 address + """ + + def __init__(self, datacenter_id, exclusive, vlan_id, ip, description=None): + self.datacenter_id = datacenter_id + self.exclusive = exclusive + self.vlan_id = vlan_id + self.ip = ip + self.description = description + + def __repr__(self): + return ( + "" + ) % ( + self.id, + self.name, + self.action, + self.location, + self.network_domain, + self.status, + self.ip_version, + self.protocol, + self.source, + self.destination, + self.enabled, + ) + + +""" +class NttCisFirewallAddress(object): + The source or destination model in a firewall rule + def __init__(self, any_ip, ip_address, ip_prefix_size, + port_begin, port_end, address_list_id, + port_list_id): + self.any_ip = any_ip + self.ip_address = ip_address + self.ip_prefix_size = ip_prefix_size + self.port_list_id = port_list_id + self.port_begin = port_begin + self.port_end = port_end + self.address_list_id = address_list_id + self.port_list_id = port_list_id + def __repr__(self): + return ( + '' + % (self.any_ip, self.ip_address, self.ip_prefix_size, + self.port_begin, self.port_end, self.address_list_id, + self.port_list_id)) +""" + + +class NttCisFirewallAddress: + """ + The source or destination model in a firewall rule + 9/4/18: Editing Class to use with ex_create_firewall_rtule method. + Will haved to circle back and test for any other uses. + """ + + def __init__( + self, + any_ip=None, + ip_address=None, + ip_prefix_size=None, + port_begin=None, + port_end=None, + address_list_id=None, + port_list_id=None, + ): + """ + :param any_ip: used to set ip address to "ANY" + :param ip_address: Optional, an ip address of either IPv4 decimal + notation or an IPv6 address + :type ``str`` + + :param ip_prefix_size: An integer denoting prefix size. + :type ``int`` + + :param port_begin: integer for an individual port or start of a list + of ports if not using a port list + :type ``int`` + + :param port_end: integer required if using a list of ports + (NOT a port list but a list starting with port begin) + :type ``int`` + + :param address_list_id: An id identifying an address list + :type ``str`` + + :param port_list_id: An id identifying a port list + :type ``str`` + """ + self.any_ip = any_ip + self.ip_address = ip_address + self.ip_prefix_size = ip_prefix_size + self.port_list_id = port_list_id + self.port_begin = port_begin + self.port_end = port_end + self.address_list_id = address_list_id + self.port_list_id = port_list_id + + def __repr__(self): + return ( + "" + % ( + self.any_ip, + self.ip_address, + self.ip_prefix_size, + self.port_begin, + self.port_end, + self.address_list_id, + self.port_list_id, + ) + ) + + +class NttCisNatRule: + """ + An IP NAT rule in a network domain + """ + + def __init__(self, id, network_domain, internal_ip, external_ip, status): + self.id = id + self.network_domain = network_domain + self.internal_ip = internal_ip + self.external_ip = external_ip + self.status = status + + def __repr__(self): + return ("") % (self.id, self.status) + + +class NttCisAntiAffinityRule: + """ + Anti-Affinity rule for NTTCIS + + An Anti-Affinity rule ensures that servers in the rule will + not reside on the same VMware ESX host. + """ + + def __init__(self, id, node_list): + """ + Instantiate a new :class:`NttCisDataAntiAffinityRule` + + :param id: The ID of the Anti-Affinity rule + :type id: ``str`` + + :param node_list: List of node ids that belong in this rule + :type node_list: ``list`` of ``str`` + """ + self.id = id + self.node_list = node_list + + def __repr__(self): + return ("") % (self.id) + + +class NttCisVlan: + """ + NTTCIS VLAN. + """ + + def __init__( + self, + id, + name, + description, + location, + network_domain, + status, + private_ipv4_range_address, + private_ipv4_range_size, + ipv6_range_address, + ipv6_range_size, + ipv4_gateway, + ipv6_gateway, + ): + """ + Initialize an instance of ``DimensionDataVlan`` + + :param id: The ID of the VLAN + :type id: ``str`` + + :param name: The name of the VLAN + :type name: ``str`` + + :param description: Plan text description of the VLAN + :type description: ``str`` + + :param location: The location (data center) of the VLAN + :type location: ``NodeLocation`` + + :param network_domain: The Network Domain that owns this VLAN + :type network_domain: :class:`DimensionDataNetworkDomain` + + :param status: The status of the VLAN + :type status: :class:`DimensionDataStatus` + + :param private_ipv4_range_address: The host address of the VLAN + IP space + :type private_ipv4_range_address: ``str`` + + :param private_ipv4_range_size: The size (e.g. '24') of the VLAN + as a CIDR range size + :type private_ipv4_range_size: ``int`` + + :param ipv6_range_address: The host address of the VLAN + IP space + :type ipv6_range_address: ``str`` + + :param ipv6_range_size: The size (e.g. '32') of the VLAN + as a CIDR range size + :type ipv6_range_size: ``int`` + + :param ipv4_gateway: The IPv4 default gateway address + :type ipv4_gateway: ``str`` + + :param ipv6_gateway: The IPv6 default gateway address + :type ipv6_gateway: ``str`` + """ + self.id = str(id) + self.name = name + self.location = location + self.description = description + self.network_domain = network_domain + self.status = status + self.private_ipv4_range_address = private_ipv4_range_address + self.private_ipv4_range_size = private_ipv4_range_size + self.ipv6_range_address = ipv6_range_address + self.ipv6_range_size = ipv6_range_size + self.ipv4_gateway = ipv4_gateway + self.ipv6_gateway = ipv6_gateway + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.description, + self.location, + self.status, + ) + + +class NttCisPool: + """ + NttCis VIP Pool. + """ + + def __init__( + self, + id, + name, + description, + status, + load_balance_method, + health_monitor_id, + service_down_action, + slow_ramp_time, + ): + """ + Initialize an instance of ``NttCisPool`` + + :param id: The ID of the pool + :type id: ``str`` + + :param name: The name of the pool + :type name: ``str`` + + :param description: Plan text description of the pool + :type description: ``str`` + + :param status: The status of the pool + :type status: :class:NttCisStatus` + + :param load_balance_method: The load balancer method + :type load_balance_method: ``str`` + + :param health_monitor_id: The ID of the health monitor + :type health_monitor_id: ``str`` + + :param service_down_action: Action to take when pool is down + :type service_down_action: ``str`` + + :param slow_ramp_time: The ramp-up time for service recovery + :type slow_ramp_time: ``int`` + """ + self.id = str(id) + self.name = name + self.description = description + self.status = status + self.load_balance_method = load_balance_method + self.health_monitor_id = health_monitor_id + self.service_down_action = service_down_action + self.slow_ramp_time = slow_ramp_time + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.description, + self.status, + ) + + +class NttCisPoolMember: + """ + NTTCIS VIP Pool Member. + """ + + def __init__(self, id, name, status, ip, port, node_id): + """ + Initialize an instance of ``NttCisPoolMember`` + + :param id: The ID of the pool member + :type id: ``str`` + + :param name: The name of the pool member + :type name: ``str`` + + :param status: The status of the pool + :type status: :class:`NttCisStatus` + + :param ip: The IP of the pool member + :type ip: ``str`` + + :param port: The port of the pool member + :type port: ``int`` + + :param node_id: The ID of the associated node + :type node_id: ``str`` + """ + self.id = str(id) + self.name = name + self.status = status + self.ip = ip + self.port = port + self.node_id = node_id + + def __repr__(self): + return ("NttCisPoolMember: id=%s, name=%s, " "ip=%s, status=%s, port=%s, node_id=%s>") % ( + self.id, + self.name, + self.ip, + self.status, + self.port, + self.node_id, + ) + + +class NttCisVIPNode: + def __init__( + self, + id, + name, + status, + ip, + connection_limit="10000", + connection_rate_limit="10000", + health_monitor=None, + ): + """ + Initialize an instance of :class:`NttCisVIPNode` + + :param id: The ID of the node + :type id: ``str`` + + :param name: The name of the node + :type name: ``str`` + + :param status: The status of the node + :type status: :class:`NttCisStatus` + + :param ip: The IP of the node + :type ip: ``str`` + + :param connection_limit: The total connection limit for the node + :type connection_limit: ``int`` + + :param connection_rate_limit: The rate limit for the node + :type connection_rate_limit: ``int`` + """ + self.id = str(id) + self.name = name + self.status = status + self.ip = ip + self.connection_limit = connection_limit + self.connection_rate_limit = connection_rate_limit + if health_monitor is not None: + self.health_monitor_id = health_monitor + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.status, + self.ip, + ) + + +class NttCisVirtualListener: + """ + NTTCIS Virtual Listener. + """ + + def __init__(self, id, name, status, ip): + """ + Initialize an instance of :class:`NttCisVirtualListener` + + :param id: The ID of the listener + :type id: ``str`` + + :param name: The name of the listener + :type name: ``str`` + + :param status: The status of the listener + :type status: :class:`NttCisStatus` + + :param ip: The IP of the listener + :type ip: ``str`` + """ + self.id = str(id) + self.name = name + self.status = status + self.ip = ip + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.status, + self.ip, + ) + + +class NttCisDefaultHealthMonitor: + """ + A default health monitor for a VIP (node, pool or listener) + """ + + def __init__(self, id, name, node_compatible, pool_compatible): + """ + Initialize an instance of :class:`NttCisDefaultHealthMonitor` + + :param id: The ID of the monitor + :type id: ``str`` + + :param name: The name of the monitor + :type name: ``str`` + + :param node_compatible: Is a monitor capable of monitoring nodes + :type node_compatible: ``bool`` + + :param pool_compatible: Is a monitor capable of monitoring pools + :type pool_compatible: ``bool`` + """ + self.id = id + self.name = name + self.node_compatible = node_compatible + self.pool_compatible = pool_compatible + + def __repr__(self): + return ("") % (self.id, self.name) + + +class NttCisPersistenceProfile: + """ + Each Persistence Profile declares the combination of Virtual Listener + type and protocol with which it is + compatible and whether or not it is compatible as a + Fallback Persistence Profile. + """ + + def __init__(self, id, name, compatible_listeners, fallback_compatible): + """ + Initialize an instance of :class:`NttCisPersistenceProfile` + + :param id: The ID of the profile + :type id: ``str`` + + :param name: The name of the profile + :type name: ``str`` + + :param compatible_listeners: List of compatible Virtual Listener types + :type compatible_listeners: ``list`` of + :class:`NttCisVirtualListenerCompatibility` + + :param fallback_compatible: Is capable as a fallback profile + :type fallback_compatible: ``bool`` + """ + self.id = id + self.name = name + self.compatible_listeners = compatible_listeners + self.fallback_compatible = fallback_compatible + + def __repr__(self): + return ("NttCisPersistenceProfile: id=%s, name=%s>") % (self.id, self.name) + + +class NttCisDefaultiRule: + """ + A default iRule for a network domain, can be applied to a listener + """ + + def __init__(self, id, name, compatible_listeners): + """ + Initialize an instance of :class:`NttCisefaultiRule` + + :param id: The ID of the iRule + :type id: ``str`` + + :param name: The name of the iRule + :type name: ``str`` + + :param compatible_listeners: List of compatible Virtual Listener types + :type compatible_listeners: ``list`` of + :class:`NttCisVirtualListenerCompatibility` + """ + self.id = id + self.name = name + self.compatible_listeners = compatible_listeners + + def __repr__(self): + return ("") % (self.id, self.name) + + +class NttCisVirtualListenerCompatibility: + """ + A compatibility preference for a persistence profile or iRule + specifies which virtual listener types this profile or iRule can be + applied to. + """ + + def __init__(self, type, protocol): + self.type = type + self.protocol = protocol + + def __repr__(self): + return ("") % ( + self.type, + self.protocol, + ) + + +class NttCisBackupDetails: + """ + NTTCIS Backup Details represents information about + a targets backups configuration + """ + + def __init__(self, asset_id, service_plan, status, clients=None): + """ + Initialize an instance of :class:`NttCisBackupDetails` + + :param asset_id: Asset identification for backups + :type asset_id: ``str`` + + :param service_plan: The service plan for backups. i.e (Essentials) + :type service_plan: ``str`` + + :param status: The overall status this backup target. + i.e. (unregistered) + :type status: ``str`` + + :param clients: Backup clients attached to this target + :type clients: ``list`` of :class:`NttCisBackupClient` + """ + self.asset_id = asset_id + self.service_plan = service_plan + self.status = status + self.clients = clients + + def __repr__(self): + return ("") % (self.asset_id) + + +class NttCisBackupClient: + """ + An object that represents a backup client + """ + + def __init__( + self, + id, + type, + status, + schedule_policy, + storage_policy, + download_url, + alert=None, + running_job=None, + ): + """ + Initialize an instance of this class. + + :param id: Unique ID for the client + :type id: ``str`` + :param type: The type of client that this client is + :type type: :class:`NttCisBackupClientType` + :param status: The states of this particular backup client. + i.e. (Unregistered) + :type status: ``str`` + :param schedule_policy: The schedule policy for this client + NOTE: NTTCIS only sends back the name + of the schedule policy, no further details + :type schedule_policy: ``str`` + :param storage_policy: The storage policy for this client + NOTE: NTTCIS only sends back the name + of the storage policy, no further details + :type storage_policy: ``str`` + :param download_url: The download url for this client + :type download_url: ``str`` + :param alert: The alert configured for this backup client (optional) + :type alert: :class:`NttCisBackupClientAlert` + :param alert: The running job for the client (optional) + :type alert: :class:`NttCisBackupClientRunningJob` + """ + self.id = id + self.type = type + self.status = status + self.schedule_policy = schedule_policy + self.storage_policy = storage_policy + self.download_url = download_url + self.alert = alert + self.running_job = running_job + + def __repr__(self): + return ("") % (self.id) + + +class NttCisBackupClientAlert: + """ + An alert for a backup client + """ + + def __init__(self, trigger, notify_list=[]): + """ + Initialize an instance of :class:`NttCisBackupClientAlert` + + :param trigger: Trigger type for the client i.e. ON_FAILURE + :type trigger: ``str`` + + :param notify_list: List of email addresses that are notified + when the alert is fired + :type notify_list: ``list`` of ``str`` + """ + self.trigger = trigger + self.notify_list = notify_list + + def __repr__(self): + return ("") % (self.trigger) + + +class NttCisBackupClientRunningJob: + """ + A running job for a given backup client + """ + + def __init__(self, id, status, percentage=0): + """ + Initialize an instance of :class:`NttCisBackupClientRunningJob` + + :param id: The unique ID of the job + :type id: ``str`` + + :param status: The status of the job i.e. Waiting + :type status: ``str`` + + :param percentage: The percentage completion of the job + :type percentage: ``int`` + """ + self.id = id + self.percentage = percentage + self.status = status + + def __repr__(self): + return ("") % (self.id) + + +class NttCisBackupClientType: + """ + A client type object for backups + """ + + def __init__(self, type, is_file_system, description): + """ + Initialize an instance of :class:`NttCisBackupClientType` + + :param type: The type of client i.e. (FA.Linux, MySQL, etc.) + :type type: ``str`` + + :param is_file_system: The name of the iRule + :type is_file_system: ``bool`` + + :param description: Description of the client + :type description: ``str`` + """ + self.type = type + self.is_file_system = is_file_system + self.description = description + + def __repr__(self): + return ("") % (self.type) + + +class NttCisBackupStoragePolicy: + """ + A representation of a storage policy + """ + + def __init__(self, name, retention_period, secondary_location): + """ + Initialize an instance of :class:`NttCisBackupStoragePolicy` + + :param name: The name of the storage policy i.e. 14 Day Storage Policy + :type name: ``str`` + + :param retention_period: How long to keep the backup in days + :type retention_period: ``int`` + + :param secondary_location: The secondary location i.e. Primary + :type secondary_location: ``str`` + """ + self.name = name + self.retention_period = retention_period + self.secondary_location = secondary_location + + def __repr__(self): + return ("") % (self.name) + + +class NttCisBackupSchedulePolicy: + """ + A representation of a schedule policy + """ + + def __init__(self, name, description): + """ + Initialize an instance of :class:`NttCisBackupSchedulePolicy` + + :param name: The name of the policy i.e 12AM - 6AM + :type name: ``str`` + + :param description: Short summary of the details of the policy + :type description: ``str`` + """ + self.name = name + self.description = description + + def __repr__(self): + return ("") % (self.name) + + +class NttCisTag: + """ + A representation of a Tag in NTTCIS + A Tag first must have a Tag Key, then an asset is tag with + a key and an option value. Tags can be queried later to filter assets + and also show up on usage report if so desired. + """ + + def __init__(self, asset_type, asset_id, asset_name, datacenter, key, value): + """ + Initialize an instance of :class:`NttCisTag` + + :param asset_type: The type of asset. Current asset types: + SERVER, VLAN, NETWORK_DOMAIN, CUSTOMER_IMAGE, + PUBLIC_IP_BLOCK, ACCOUNT + :type asset_type: ``str`` + + :param asset_id: The GUID of the asset that is tagged + :type asset_id: ``str`` + + :param asset_name: The name of the asset that is tagged + :type asset_name: ``str`` + + :param datacenter: The short datacenter name of the tagged asset + :type datacenter: ``str`` + + :param key: The tagged key + :type key: :class:`NttCisTagKey` + + :param value: The tagged value + :type value: ``None`` or ``str`` + """ + self.asset_type = asset_type + self.asset_id = asset_id + self.asset_name = asset_name + self.datacenter = datacenter + self.key = key + self.value = value + + def __repr__(self): + return ("") % ( + self.asset_name, + self.key.name, + self.value, + ) + + +class NttCisTagKey: + """ + A representation of a Tag Key in NTTCIS + A tag key is required to tag an asset + """ + + def __init__(self, id, name, description, value_required, display_on_report): + """ + Initialize an instance of :class:`NttCisTagKey` + + :param id: GUID of the tag key + :type id: ``str`` + + :param name: Name of the tag key + :type name: ``str`` + + :param description: Description of the tag key + :type description: ``str`` + + :param value_required: If a value is required for this tag key + :type value_required: ``bool`` + + :param display_on_report: If this tag key should be displayed on + usage reports + :type display_on_report: ``bool`` + """ + self.id = id + self.name = name + self.description = description + self.value_required = value_required + self.display_on_report = display_on_report + + def __repr__(self): + return ("NttCisTagKey: id=%s name=%s>") % (self.id, self.name) + + +class NttCisIpAddressList: + """ + NttCis IP Address list + """ + + def __init__( + self, + id, + name, + description, + ip_version, + ip_address_collection, + state, + create_time, + child_ip_address_lists=None, + ): + """ " + Initialize an instance of :class:`NttCisIpAddressList` + + :param id: GUID of the IP Address List key + :type id: ``str`` + + :param name: Name of the IP Address List + :type name: ``str`` + + :param description: Description of the IP Address List + :type description: ``str`` + + :param ip_version: IP version. E.g. IPV4, IPV6 + :type ip_version: ``str`` + + :param ip_address_collection: Collection of NttCisIpAddress + :type ip_address_collection: ``List`` + + :param state: IP Address list state + :type state: ``str`` + + :param create_time: IP Address List created time + :type create_time: ``date time`` + + :param child_ip_address_lists: List of IP address list to be included + :type child_ip_address_lists: List + of :class:'NttCisIpAddressList' + """ + self.id = id + self.name = name + self.description = description + self.ip_version = ip_version + self.ip_address_collection = ip_address_collection + self.state = state + self.create_time = create_time + self.child_ip_address_lists = child_ip_address_lists + + def __repr__(self): + return ( + "" + % ( + self.id, + self.name, + self.description, + self.ip_version, + self.ip_address_collection, + self.state, + self.create_time, + self.child_ip_address_lists, + ) + ) + + +class NttCisChildIpAddressList: + """ + NttCis Child IP Address list + """ + + def __init__(self, id, name): + """ " + Initialize an instance of :class:`NttCisDataChildIpAddressList` + + :param id: GUID of the IP Address List key + :type id: ``str`` + + :param name: Name of the IP Address List + :type name: ``str`` + + """ + self.id = id + self.name = name + + def __repr__(self): + return "".format(self.id, self.name) + + +class NttCisIpAddress: + """ + A representation of IP Address in NttCis + """ + + def __init__(self, begin, end=None, prefix_size=None): + """ + Initialize an instance of :class:`NttCisIpAddress` + + :param begin: IP Address Begin + :type begin: ``str`` + + :param end: IP Address end + :type end: ``str`` + + :param prefixSize: IP Address prefix size + :type prefixSize: ``int`` + """ + self.begin = begin + self.end = end + self.prefix_size = prefix_size + + def __repr__(self): + return "".format( + self.begin, + self.end, + self.prefix_size, + ) + + +class NttCisPortList: + """ + NttCis Port list + """ + + def __init__( + self, + id, + name, + description, + port_collection, + child_portlist_list, + state, + create_time, + ): + """ " + Initialize an instance of :class:`DNttCisPortList` + + :param id: GUID of the Port List key + :type id: ``str`` + + :param name: Name of the Port List + :type name: ``str`` + + :param description: Description of the Port List + :type description: ``str`` + + :param port_collection: Collection of NttCisPort + :type port_collection: ``List`` + + :param child_portlist_list: Collection of NttCisChildPort + :type child_portlist_list: ``List`` + + :param state: Port list state + :type state: ``str`` + + :param create_time: Port List created time + :type create_time: ``date time`` + """ + self.id = id + self.name = name + self.description = description + self.port_collection = port_collection + self.child_portlist_list = child_portlist_list + self.state = state + self.create_time = create_time + + def __repr__(self): + return ( + "" + % ( + self.id, + self.name, + self.description, + self.port_collection, + self.child_portlist_list, + self.state, + self.create_time, + ) + ) + + +class NttCisChildPortList: + """ + NttCis Child Port list + """ + + def __init__(self, id, name): + """ " + Initialize an instance of :class:`NttCisChildIpAddressList` + + :param id: GUID of the child port list key + :type id: ``str`` + + :param name: Name of the child port List + :type name: ``str`` + + """ + self.id = id + self.name = name + + def __repr__(self): + return "".format(self.id, self.name) + + +class NttCisPort: + """ + A representation of Port in NTTCIS + """ + + def __init__(self, begin, end=None): + """ + Initialize an instance of :class:`NttCisPort` + + :param begin: Port Number Begin + :type begin: ``str`` + + :param end: Port Number end + :type end: ``str`` + """ + self.begin = begin + self.end = end + + def __repr__(self): + return "".format(self.begin, self.end) + + +class NttCisNic: + """ + A representation of Network Adapter in NTTCIS + """ + + def __init__(self, private_ip_v4=None, vlan=None, network_adapter_name=None): + """ + Initialize an instance of :class:`NttCisNic` + + :param private_ip_v4: IPv4 + :type private_ip_v4: ``str`` + + :param vlan: Network VLAN + :type vlan: class: NttCisVlan or ``str`` + + :param network_adapter_name: Network Adapter Name + :type network_adapter_name: ``str`` + """ + self.private_ip_v4 = private_ip_v4 + self.vlan = vlan + self.network_adapter_name = network_adapter_name + + def __repr__(self): + return "" % ( + self.private_ip_v4, + self.vlan, + self.network_adapter_name, + ) + + +# Dynamically create classes from returned XML. Leaves the API as the +# single authoritative source. + + +class ClassFactory: + pass + + +attrs = {} # type: Dict[str, str] + + +def processor(mapping, name=None): + """ + Closure that keeps the deepcopy of the original dict + converted to XML current. + :param mapping: The converted XML to dict/lists + :type mapping: ``dict`` + :param name: (Optional) what becomes the class name if provided + :type: ``str`` + :return: Nothing + """ + mapping = mapping + # the map_copy will have keys deleted after the key and value are processed + map_copy = deepcopy(mapping) + + def add_items(key, value, name=None): + """ + Add items to the global attr dict, then delete key, value from map copy + :param key: from the process function becomes the attribute name + :type key: ``str`` + :param value: The value of the property and may be a dict + :type value: ``str`` + :param name: Name of class, often same as key + :type: name" ``str`` + """ + if name in attrs: + attrs[name].update({key: value}) + elif name is not None: + attrs[name] = value + + else: + attrs.update({key: value}) + # trim the copy of the mapping + if key in map_copy: + del map_copy[key] + elif key in map_copy[name]: + del map_copy[name][key] + if len(map_copy[name]) == 0: + del map_copy[name] + + def handle_map(map, name): + tmp = {} + types = [type(x) for x in map.values()] + if XmlListConfig not in types and XmlDictConfig not in types and dict not in types: + return map + + elif XmlListConfig in types: + result = handle_seq(map, name) + return result + else: + for k, v in map.items(): + if isinstance(v, str): + tmp.update({k: v}) + if isinstance(v, dict): + cls = build_class(k.capitalize(), v) + tmp.update({k: cls}) + elif isinstance(v, XmlDictConfig): + cls = build_class(k.capitalize(), v) + return (k, cls) + return tmp + + def handle_seq(seq, name): + tmp = {} + if isinstance(seq, list): + tmp = [] + for _ in seq: + cls = build_class(name.capitalize(), _) + tmp.append(cls) + return tmp + for k, v in seq.items(): + if isinstance(v, MutableSequence): + for _ in v: + if isinstance(_, Mapping): + types = [type(x) for x in _.values()] + if XmlDictConfig in types: + result = handle_map(_, k) + if isinstance(result, tuple): + tmp.update({result[0]: result[1]}) + else: + tmp.update({k: result}) + else: + tmp_list = [build_class(k.capitalize(), i) for i in v] + tmp[k] = tmp_list + elif isinstance(v, str): + tmp.update({k: v}) + return tmp + + def build_class(key, value): + klass = class_factory(key.capitalize(), value) + return klass(value) + + def process(mapping): + """ + This function is recursive, creating attributes for the class factory + by taking apart the elements in the dictionary. Thus, the calls to + handle_seq or handle_map + :param mapping: the dictionary converted from XML + :return: itself (recursive) + """ + for k1, v1 in mapping.items(): + if isinstance(v1, Mapping): + types = [type(v) for v in v1.values()] + if MutableSequence not in types and dict not in types: + result = handle_map(v1, k1) + cls = build_class(k1.capitalize(), result) + add_items(k1, cls) + elif XmlListConfig in types: + result = handle_seq(v1, k1) + cls = build_class(list(v1)[0], result) + add_items(k1, cls) + elif dict in types: + result = handle_map(v1, k1) + cls = build_class(k1.capitalize(), result) + add_items(k1, cls, k1) + elif isinstance(v1, list): + tmp1 = {} + tmp2 = {} + tmp2[k1] = [] + for i, j in enumerate(v1): + if isinstance(j, dict): + key = list(j)[0] + result = handle_map(j, key) + tmp1[k1 + str(i)] = build_class(k1, result) + tmp2[k1].append(tmp1[k1 + str(i)]) + if tmp2: + add_items(k1, tmp2[k1], k1) + elif isinstance(v1, str): + add_items(k1, v1) + + if len(map_copy) == 0: + return 1 + return process(mapping) + + +def class_factory(cls_name, attrs): + """ + This class takes a name and a dictionary to create a class. + The clkass has an init method, an iter for retrieving properties, + and, finally, a repr for returning the instance + :param cls_name: The name to be tacked onto the suffix NttCis + :type cls_name: ``str`` + :param attrs: The attributes and values for an instance + :type attrs: ``dict`` + :return: a class that inherits from ClassFactory + :rtype: ``ClassFactory`` + """ + + def __init__(self, *args, **kwargs): + for key in attrs: + setattr(self, key, attrs[key]) + if cls_name == "NttCisServer": + self.state = self._get_state() + + def __iter__(self): + for name in self.__dict__: + yield getattr(self, name) + + def __repr__(self): + values = ", ".join("{}={!r}".format(*i) for i in zip(self.__dict__, self)) + return "{}({})".format(self.__class__.__name__, values) + + cls_attrs = dict(__init__=__init__, __iter__=__iter__, __repr__=__repr__) + + return type("NttCis{}".format(cls_name), (ClassFactory,), cls_attrs) + + +class XmlListConfig(list): + """ + Creates a class from XML elements that make a list. If a list of + XML elements with attributes, the attributes are passed to XmlDictConfig. + """ + + def __init__(self, elem_list): + for element in elem_list: + if element is not None and len(element) > 1: + # treat like dict + if element[0].tag != element[1].tag: + self.append(XmlDictConfig(element)) + # treat like list + else: + # property refers to an element used repeatedly + # in the XML for data centers only + if "property" in element.tag: + self.append({element.attrib.get("name"): element.attrib.get("value")}) + else: + self.append(element.attrib) + elif element.text: + text = element.text.strip() + if text: + self.append(text) + + +class XmlDictConfig(dict): + """ + Inherits from dict. Looks for XML elements, such as attrib, that + can be converted to a dictionary. Any XML element that contains + other XML elements, will be passed to XmlListConfig + """ + + def __init__(self, parent_element): + if parent_element.items(): + if "property" in parent_element.tag: + self.update({parent_element.attrib.get("name"): parent_element.attrib.get("value")}) + else: + self.update(dict(parent_element.items())) + for element in parent_element: + if len(element) > 0: + # treat like dict - we assume that if the first two tags + # in a series are different, then they are all different. + if len(element) == 1 or element[0].tag != element[1].tag: + elem_dict = XmlDictConfig(element) + + # treat like list - we assume that if the first two tags + # in a series are the same, then the rest are the same. + else: + # here, we put the list in dictionary; the key is the + # tag name the list elements all share in common, and + # the value is the list itself + elem_dict = {element[0].tag.split("}")[1]: XmlListConfig(element)} + + # if the tag has attributes, add those to the dict + if element.items(): + elem_dict.update(dict(element.items())) + self.update({element.tag.split("}")[1]: elem_dict}) + # this assumes that if you've got an attribute in a tag, + # you won't be having any text. This may or may not be a + # good idea -- time will tell. It works for the way we are + # currently doing XML configuration files... + elif element.items(): + # It is possible to have duplicate element tags. + # If so, convert to a dict of lists + if element.tag.split("}")[1] in self: + if isinstance(self[element.tag.split("}")[1]], list): + self[element.tag.split("}")[1]].append(dict(element.items())) + else: + tmp_list = list() + tmp_dict = dict() + for k, v in self[element.tag.split("}")[1]].items(): + if isinstance(k, XmlListConfig): + tmp_list.append(k) + else: + tmp_dict.update({k: v}) + tmp_list.append(tmp_dict) + tmp_list.append(dict(element.items())) + self[element.tag.split("}")[1]] = tmp_list + else: + self.update({element.tag.split("}")[1]: dict(element.items())}) + # finally, if there are no child tags and no attributes, extract + # the text + else: + self.update({element.tag.split("}")[1]: element.text}) + + +def process_xml(xml): + """ + Take the xml and put it into a dictionary. The process the dictionary + recursively. This returns a class based on the XML API. Thus, properties + will have the camel case found in the Java XML. This a trade-off + to reduce the number of "static" classes that all have to be synchronized + with any changes in the API. + :param xml: The serialized version of the XML returned from Cloud Control + :return: a dynamic class that inherits from ClassFactory + :rtype: `ClassFactory` + """ + global attrs + tree = etree.parse(BytesIO(xml)) + root = tree.getroot() + elem = root.tag.split("}")[1].capitalize() + items = dict(root.items()) + + if "pageNumber" in items: + converted_xml = XmlListConfig(root) + processor(converted_xml[0]) + else: + converted_xml = XmlDictConfig(root) + processor(converted_xml) + klass = class_factory(elem.capitalize(), attrs) + cls = klass(attrs) + attrs = {} + return cls diff --git a/libcloud/common/onapp.py b/libcloud/common/onapp.py new file mode 100644 index 0000000000..e7131bc1ef --- /dev/null +++ b/libcloud/common/onapp.py @@ -0,0 +1,63 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from base64 import b64encode + +from libcloud.utils.py3 import b, httplib +from libcloud.common.base import JsonResponse, ConnectionUserAndKey + + +class OnAppResponse(JsonResponse): + """ + OnApp response class + """ + + def success(self): + """ + Determine if our request was successful. + + The meaning of this can be arbitrary; did we receive OK status? Did + the node get created? Were we authenticated? + + :rtype: ``bool`` + :return: ``True`` or ``False`` + """ + return self.status in [httplib.OK, httplib.CREATED, httplib.NO_CONTENT] + + +class OnAppConnection(ConnectionUserAndKey): + """ + OnApp connection class + """ + + responseCls = OnAppResponse + + def add_default_headers(self, headers): + """ + Add Basic Authentication header to all the requests. + It injects the "Authorization: Basic Base64String===" header + in each request + + :type headers: ``dict`` + :param headers: Default input headers + + :rtype: ``dict`` + :return: Default input headers with the "Authorization" header. + """ + b64string = b("{}:{}".format(self.user_id, self.key)) + encoded = b64encode(b64string).decode("utf-8") + + headers["Authorization"] = "Basic " + encoded + return headers diff --git a/libcloud/common/openstack.py b/libcloud/common/openstack.py index e44d144789..c361972f34 100644 --- a/libcloud/common/openstack.py +++ b/libcloud/common/openstack.py @@ -17,50 +17,46 @@ Common utilities for OpenStack """ -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - -from libcloud.utils.py3 import httplib - -from libcloud.common.base import ConnectionUserAndKey, Response +from libcloud.utils.py3 import ET, httplib +from libcloud.common.base import Response, ConnectionUserAndKey from libcloud.common.types import ProviderError -from libcloud.compute.types import (LibcloudError, MalformedResponseError) -from libcloud.compute.types import KeyPairDoesNotExistError -from libcloud.common.openstack_identity import get_class_for_auth_version +from libcloud.compute.types import LibcloudError, MalformedResponseError, KeyPairDoesNotExistError +from libcloud.common.exceptions import BaseHTTPError # Imports for backward compatibility reasons -from libcloud.common.openstack_identity import OpenStackServiceCatalog - +from libcloud.common.openstack_identity import ( + AUTH_TOKEN_HEADER, + OpenStackServiceCatalog, + OpenStackIdentityTokenScope, + get_class_for_auth_version, +) try: import simplejson as json except ImportError: - import json + import json # type: ignore -AUTH_API_VERSION = '1.1' +AUTH_API_VERSION = "1.1" # Auth versions which contain token expiration information. AUTH_VERSIONS_WITH_EXPIRES = [ - '1.1', - '2.0', - '2.0_apikey', - '2.0_password', - '3.x', - '3.x_password' + "1.1", + "2.0", + "2.0_apikey", + "2.0_password", + "3.x", + "3.x_password", ] __all__ = [ - 'OpenStackBaseConnection', - 'OpenStackResponse', - 'OpenStackException', - 'OpenStackDriverMixin' + "OpenStackBaseConnection", + "OpenStackResponse", + "OpenStackException", + "OpenStackDriverMixin", ] class OpenStackBaseConnection(ConnectionUserAndKey): - """ Base class for OpenStack connections. @@ -74,82 +70,144 @@ class OpenStackBaseConnection(ConnectionUserAndKey): :type secure: ``bool`` :param ex_force_base_url: Base URL for connection requests. If - not specified, this will be determined by authenticating. + not specified, this will be determined by + authenticating. :type ex_force_base_url: ``str`` :param ex_force_auth_url: Base URL for authentication requests. :type ex_force_auth_url: ``str`` :param ex_force_auth_version: Authentication version to use. If - not specified, defaults to AUTH_API_VERSION. + not specified, defaults to AUTH_API_VERSION. :type ex_force_auth_version: ``str`` - :param ex_force_auth_token: Authentication token to use for - connection requests. If specified, the connection will not attempt - to authenticate, and the value of ex_force_base_url will be used to - determine the base request URL. If ex_force_auth_token is passed in, - ex_force_base_url must also be provided. + :param ex_force_auth_token: Authentication token to use for connection + requests. If specified, the connection will + not attempt to authenticate, and the value + of ex_force_base_url will be used to + determine the base request URL. If + ex_force_auth_token is passed in, + ex_force_base_url must also be provided. :type ex_force_auth_token: ``str`` - :param ex_tenant_name: When authenticating, provide this tenant - name to the identity service. A scoped token will be returned. - Some cloud providers require the tenant name to be provided at - authentication time. Others will use a default tenant if none - is provided. + :param token_scope: Whether to scope a token to a "project", a + "domain" or "unscoped". + :type token_scope: ``str`` + + :param ex_domain_name: When authenticating, provide this domain name to + the identity service. A scoped token will be + returned. Some cloud providers require the domain + name to be provided at authentication time. Others + will use a default domain if none is provided. + :type ex_domain_name: ``str`` + + :param ex_tenant_name: When authenticating, provide this tenant name to the + identity service. A scoped token will be returned. + Some cloud providers require the tenant name to be + provided at authentication time. Others will use a + default tenant if none is provided. :type ex_tenant_name: ``str`` + :param ex_tenant_domain_id: When authenticating, provide this tenant + domain id to the identity service. + A scoped token will be returned. + Some cloud providers require the tenant + domain id to be provided at authentication + time. Others will use a default tenant + domain id if none is provided. + :type ex_tenant_domain_id: ``str`` + :param ex_force_service_type: Service type to use when selecting an - service. If not specified, a provider specific default will be used. + service. If not specified, a provider + specific default will be used. :type ex_force_service_type: ``str`` :param ex_force_service_name: Service name to use when selecting an - service. If not specified, a provider specific default will be used. + service. If not specified, a provider + specific default will be used. :type ex_force_service_name: ``str`` - :param ex_force_service_region: Region to use when selecting an - service. If not specified, a provider specific default will be used. + :param ex_force_service_region: Region to use when selecting an service. + If not specified, a provider specific + default will be used. :type ex_force_service_region: ``str`` + + :param ex_auth_cache: External cache where authentication tokens are + stored for reuse by other processes. Tokens are + always cached in memory on the driver instance. To + share tokens among multiple drivers, processes, or + systems, pass a cache here. + :type ex_auth_cache: :class:`OpenStackAuthenticationCache` """ - auth_url = None - auth_token = None + auth_url = None # type: str + auth_token = None # type: str auth_token_expires = None auth_user_info = None service_catalog = None service_type = None service_name = None service_region = None - _auth_version = None - - def __init__(self, user_id, key, secure=True, - host=None, port=None, timeout=None, - ex_force_base_url=None, - ex_force_auth_url=None, - ex_force_auth_version=None, - ex_force_auth_token=None, - ex_tenant_name=None, - ex_force_service_type=None, - ex_force_service_name=None, - ex_force_service_region=None): - super(OpenStackBaseConnection, self).__init__( - user_id, key, secure=secure, timeout=timeout) + accept_format = None + _auth_version = None # type: str + + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + timeout=None, + proxy_url=None, + ex_force_base_url=None, + ex_force_auth_url=None, + ex_force_auth_version=None, + ex_force_auth_token=None, + ex_token_scope=OpenStackIdentityTokenScope.PROJECT, + ex_domain_name="Default", + ex_tenant_name=None, + ex_tenant_domain_id="default", + ex_force_service_type=None, + ex_force_service_name=None, + ex_force_service_region=None, + ex_force_microversion=None, + ex_auth_cache=None, + retry_delay=None, + backoff=None, + ): + super().__init__( + user_id, + key, + secure=secure, + timeout=timeout, + retry_delay=retry_delay, + backoff=backoff, + proxy_url=proxy_url, + ) if ex_force_auth_version: self._auth_version = ex_force_auth_version + self.base_url = ex_force_base_url self._ex_force_base_url = ex_force_base_url self._ex_force_auth_url = ex_force_auth_url self._ex_force_auth_token = ex_force_auth_token + self._ex_token_scope = ex_token_scope + self._ex_domain_name = ex_domain_name self._ex_tenant_name = ex_tenant_name + self._ex_tenant_domain_id = ex_tenant_domain_id self._ex_force_service_type = ex_force_service_type self._ex_force_service_name = ex_force_service_name self._ex_force_service_region = ex_force_service_region + self._ex_force_microversion = ex_force_microversion + self._ex_auth_cache = ex_auth_cache self._osa = None if ex_force_auth_token and not ex_force_base_url: raise LibcloudError( - 'Must also provide ex_force_base_url when specifying ' - 'ex_force_auth_token.') + "Must also provide ex_force_base_url when specifying " "ex_force_auth_token." + ) if ex_force_auth_token: self.auth_token = ex_force_auth_token @@ -160,8 +218,7 @@ def __init__(self, user_id, key, secure=True, auth_url = self._get_auth_url() if not auth_url: - raise LibcloudError('OpenStack instance must ' + - 'have auth_url set') + raise LibcloudError("OpenStack instance must " + "have auth_url set") def get_auth_class(self): """ @@ -173,31 +230,45 @@ def get_auth_class(self): auth_url = self._get_auth_url() cls = get_class_for_auth_version(auth_version=self._auth_version) - self._osa = cls(auth_url=auth_url, - user_id=self.user_id, - key=self.key, - tenant_name=self._ex_tenant_name, - timeout=self.timeout, - parent_conn=self) + self._osa = cls( + auth_url=auth_url, + user_id=self.user_id, + key=self.key, + tenant_name=self._ex_tenant_name, + tenant_domain_id=self._ex_tenant_domain_id, + domain_name=self._ex_domain_name, + token_scope=self._ex_token_scope, + timeout=self.timeout, + proxy_url=self.proxy_url, + parent_conn=self, + auth_cache=self._ex_auth_cache, + ) return self._osa - def request(self, action, params=None, data='', headers=None, - method='GET', raw=False): + def request(self, action, params=None, data="", headers=None, method="GET", raw=False): headers = headers or {} params = params or {} # Include default content-type for POST and PUT request (if available) - default_content_type = getattr(self, 'default_content_type', None) - if method.upper() in ['POST', 'PUT'] and default_content_type: - headers = {'Content-Type': default_content_type} - - return super(OpenStackBaseConnection, self).request(action=action, - params=params, - data=data, - method=method, - headers=headers, - raw=raw) + default_content_type = getattr(self, "default_content_type", None) + if method.upper() in ["POST", "PUT"] and default_content_type: + headers["Content-Type"] = default_content_type + + try: + return super().request( + action=action, + params=params, + data=data, + method=method, + headers=headers, + raw=raw, + ) + except BaseHTTPError as ex: + # Evict cached auth token if we receive Unauthorized while using it + if ex.code == httplib.UNAUTHORIZED and self._ex_force_auth_token is None: + self.get_auth_class().clear_cached_auth_context() + raise def _get_auth_url(self): """ @@ -217,6 +288,18 @@ def get_service_catalog(self): return self.service_catalog + def get_service_name(self): + """ + Gets the service name used to look up the endpoint in the service + catalog. + + :return: name of the service in the catalog + """ + if self._ex_force_service_name: + return self._ex_force_service_name + + return self.service_name + def get_endpoint(self): """ Selects the endpoint to use based on provider specific values, @@ -225,7 +308,7 @@ def get_endpoint(self): :returns: url of the relevant endpoint for the driver """ service_type = self.service_type - service_name = self.service_name + service_name = None service_region = self.service_region if self._ex_force_service_type: @@ -235,29 +318,66 @@ def get_endpoint(self): if self._ex_force_service_region: service_region = self._ex_force_service_region - endpoint = self.service_catalog.get_endpoint(service_type=service_type, - name=service_name, - region=service_region) + try: + endpoint = self.service_catalog.get_endpoint( + service_type=service_type, name=service_name, region=service_region + ) + except ValueError: + # An explicitly provided service name is a strict filter. When no + # name was provided, first allow the service type and region to + # identify the endpoint on their own, and only use the driver's + # default service name to resolve an ambiguous result. + if service_name or not self.service_name: + raise + + endpoint = self.service_catalog.get_endpoint( + service_type=service_type, + name=self.service_name, + region=service_region, + ) url = endpoint.url if not url: - raise LibcloudError('Could not find specified endpoint') + raise LibcloudError("Could not find specified endpoint") return url def add_default_headers(self, headers): - headers['X-Auth-Token'] = self.auth_token - headers['Accept'] = self.accept_format + headers[AUTH_TOKEN_HEADER] = self.auth_token + headers["Accept"] = self.accept_format + if self._ex_force_microversion: + # If service not set in microversion, assume compute + microversion = self._ex_force_microversion.strip().split() + if len(microversion) == 2: + service_type = microversion[0] + microversion = microversion[1] + elif len(microversion) == 1: + service_type = "compute" + microversion = microversion[0] + else: + raise LibcloudError("Invalid microversion format: servicename X.XX") + + if self.service_type and self.service_type.startswith(service_type): + headers["OpenStack-API-Version"] = "{} {}".format( + service_type, + microversion, + ) return headers def morph_action_hook(self, action): self._populate_hosts_and_request_paths() - return super(OpenStackBaseConnection, self).morph_action_hook(action) + return super().morph_action_hook(action) def _set_up_connection_info(self, url): + prev_conn = (self.host, self.port, self.secure) result = self._tuple_from_url(url) - (self.host, self.port, self.secure, self.request_path) = result + self.host, self.port, self.secure, self.request_path = result + new_conn = (self.host, self.port, self.secure) + if new_conn != prev_conn: + # We only call connect in case connection details have changed - this way we correctly + # reuse connection in case nothing has changed + self.connect() def _populate_hosts_and_request_paths(self): """ @@ -278,22 +398,23 @@ def _populate_hosts_and_request_paths(self): if not osa.is_token_valid(): # Token is not available or it has expired. Need to retrieve a # new one. - if self._auth_version == '2.0_apikey': - kwargs = {'auth_type': 'api_key'} - elif self._auth_version == '2.0_password': - kwargs = {'auth_type': 'password'} + if self._auth_version == "2.0_apikey": + kwargs = {"auth_type": "api_key"} + elif self._auth_version == "2.0_password": + kwargs = {"auth_type": "password"} else: kwargs = {} + # pylint: disable=unexpected-keyword-arg osa = osa.authenticate(**kwargs) # may throw InvalidCreds + # pylint: enable=unexpected-keyword-arg self.auth_token = osa.auth_token self.auth_token_expires = osa.auth_token_expires self.auth_user_info = osa.auth_user_info # Pull out and parse the service catalog - osc = OpenStackServiceCatalog(service_catalog=osa.urls, - auth_version=self._auth_version) + osc = OpenStackServiceCatalog(service_catalog=osa.urls, auth_version=self._auth_version) self.service_catalog = osc url = self._ex_force_base_url or self.get_endpoint() @@ -309,10 +430,10 @@ class OpenStackResponse(Response): def success(self): i = int(self.status) - return i >= 200 and i <= 299 + return 200 <= i <= 299 def has_content_type(self, content_type): - content_type_value = self.headers.get('content-type') or '' + content_type_value = self.headers.get("content-type") or "" content_type_value = content_type_value.lower() return content_type_value.find(content_type.lower()) > -1 @@ -320,46 +441,45 @@ def parse_body(self): if self.status == httplib.NO_CONTENT or not self.body: return None - if self.has_content_type('application/xml'): + if self.has_content_type("application/xml"): try: return ET.XML(self.body) - except: + except Exception: raise MalformedResponseError( - 'Failed to parse XML', - body=self.body, - driver=self.node_driver) + "Failed to parse XML", body=self.body, driver=self.node_driver + ) - elif self.has_content_type('application/json'): + elif self.has_content_type("application/json"): try: return json.loads(self.body) - except: + except Exception: raise MalformedResponseError( - 'Failed to parse JSON', - body=self.body, - driver=self.node_driver) + "Failed to parse JSON", body=self.body, driver=self.node_driver + ) else: return self.body def parse_error(self): - text = None body = self.parse_body() - if self.has_content_type('application/xml'): - text = '; '.join([err.text or '' for err in body.getiterator() - if err.text]) - elif self.has_content_type('application/json'): + if self.has_content_type("application/xml"): + text = "; ".join([err.text or "" for err in body.getiterator() if err.text]) + elif self.has_content_type("application/json"): values = list(body.values()) context = self.connection.context driver = self.connection.driver - key_pair_name = context.get('key_pair_name', None) - - if len(values) > 0 and values[0]['code'] == 404 and key_pair_name: - raise KeyPairDoesNotExistError(name=key_pair_name, - driver=driver) - elif len(values) > 0 and 'message' in values[0]: - text = ';'.join([fault_data['message'] for fault_data - in values]) + key_pair_name = context.get("key_pair_name", None) + + if ( + len(values) > 0 + and "code" in values[0] + and values[0]["code"] == 404 + and key_pair_name + ): + raise KeyPairDoesNotExistError(name=key_pair_name, driver=driver) + elif len(values) > 0 and "message" in values[0]: + text = ";".join([fault_data["message"] for fault_data in values]) else: text = body else: @@ -369,42 +489,73 @@ def parse_error(self): # it along as the whole response body in the text variable. text = body - return '%s %s %s' % (self.status, self.error, text) - - -class OpenStackDriverMixin(object): - - def __init__(self, *args, **kwargs): - self._ex_force_base_url = kwargs.get('ex_force_base_url', None) - self._ex_force_auth_url = kwargs.get('ex_force_auth_url', None) - self._ex_force_auth_version = kwargs.get('ex_force_auth_version', None) - self._ex_force_auth_token = kwargs.get('ex_force_auth_token', None) - self._ex_tenant_name = kwargs.get('ex_tenant_name', None) - self._ex_force_service_type = kwargs.get('ex_force_service_type', None) - self._ex_force_service_name = kwargs.get('ex_force_service_name', None) - self._ex_force_service_region = kwargs.get('ex_force_service_region', - None) + return "{} {} {}".format(self.status, self.error, text) + + +class OpenStackDriverMixin: + def __init__( + self, + ex_force_base_url=None, + ex_force_auth_url=None, + ex_force_auth_version=None, + ex_force_auth_token=None, + ex_token_scope=OpenStackIdentityTokenScope.PROJECT, + ex_domain_name="Default", + ex_tenant_name=None, + ex_tenant_domain_id="default", + ex_force_service_type=None, + ex_force_service_name=None, + ex_force_service_region=None, + ex_auth_cache=None, + ex_force_microversion=None, + *args, + **kwargs, + ): + self._ex_force_base_url = ex_force_base_url + self._ex_force_auth_url = ex_force_auth_url + self._ex_force_auth_version = ex_force_auth_version + self._ex_force_auth_token = ex_force_auth_token + self._ex_token_scope = ex_token_scope + self._ex_domain_name = ex_domain_name + self._ex_tenant_name = ex_tenant_name + self._ex_tenant_domain_id = ex_tenant_domain_id + self._ex_force_service_type = ex_force_service_type + self._ex_force_service_name = ex_force_service_name + self._ex_force_service_region = ex_force_service_region + self._ex_auth_cache = ex_auth_cache + self._ex_force_microversion = ex_force_microversion def openstack_connection_kwargs(self): """ + Returns certain ``ex_*`` parameters for this connection. :rtype: ``dict`` """ rv = {} if self._ex_force_base_url: - rv['ex_force_base_url'] = self._ex_force_base_url + rv["ex_force_base_url"] = self._ex_force_base_url if self._ex_force_auth_token: - rv['ex_force_auth_token'] = self._ex_force_auth_token + rv["ex_force_auth_token"] = self._ex_force_auth_token if self._ex_force_auth_url: - rv['ex_force_auth_url'] = self._ex_force_auth_url + rv["ex_force_auth_url"] = self._ex_force_auth_url if self._ex_force_auth_version: - rv['ex_force_auth_version'] = self._ex_force_auth_version + rv["ex_force_auth_version"] = self._ex_force_auth_version + if self._ex_token_scope: + rv["ex_token_scope"] = self._ex_token_scope + if self._ex_domain_name: + rv["ex_domain_name"] = self._ex_domain_name if self._ex_tenant_name: - rv['ex_tenant_name'] = self._ex_tenant_name + rv["ex_tenant_name"] = self._ex_tenant_name + if self._ex_tenant_domain_id: + rv["ex_tenant_domain_id"] = self._ex_tenant_domain_id if self._ex_force_service_type: - rv['ex_force_service_type'] = self._ex_force_service_type + rv["ex_force_service_type"] = self._ex_force_service_type if self._ex_force_service_name: - rv['ex_force_service_name'] = self._ex_force_service_name + rv["ex_force_service_name"] = self._ex_force_service_name if self._ex_force_service_region: - rv['ex_force_service_region'] = self._ex_force_service_region + rv["ex_force_service_region"] = self._ex_force_service_region + if self._ex_auth_cache is not None: + rv["ex_auth_cache"] = self._ex_auth_cache + if self._ex_force_microversion: + rv["ex_force_microversion"] = self._ex_force_microversion return rv diff --git a/libcloud/common/openstack_identity.py b/libcloud/common/openstack_identity.py index 3eb0d14c53..3b8dcaa51e 100644 --- a/libcloud/common/openstack_identity.py +++ b/libcloud/common/openstack_identity.py @@ -18,34 +18,36 @@ service (Keystone). """ -import sys import datetime +from collections import namedtuple from libcloud.utils.py3 import httplib +from libcloud.common.base import Response, ConnectionUserAndKey, CertificateConnection +from libcloud.compute.types import LibcloudError, InvalidCredsError, MalformedResponseError from libcloud.utils.iso8601 import parse_date -from libcloud.common.base import ConnectionUserAndKey, Response -from libcloud.compute.types import (LibcloudError, InvalidCredsError, - MalformedResponseError) - try: import simplejson as json except ImportError: - import json + import json # type: ignore -AUTH_API_VERSION = '1.1' +AUTH_API_VERSION = "1.1" +AUTH_TOKEN_HEADER = "X-Auth-Token" # Auth versions which contain token expiration information. AUTH_VERSIONS_WITH_EXPIRES = [ - '1.1', - '2.0', - '2.0_apikey', - '2.0_password', - '3.0', - '3.x_password' + "1.1", + "2.0", + "2.0_apikey", + "2.0_password", + "2.0_voms", + "3.0", + "3.x_password", + "3.x_appcred", + "3.x_oidc_access_token", ] -# How many seconds to substract from the auth token expiration time before +# How many seconds to subtract from the auth token expiration time before # testing if the token is still valid. # The time is subtracted to account for the HTTP request latency and prevent # user from getting "InvalidCredsError" if token is about to expire. @@ -53,46 +55,125 @@ __all__ = [ - 'OpenStackIdentityVersion', - 'OpenStackIdentityDomain', - 'OpenStackIdentityProject', - 'OpenStackIdentityUser', - 'OpenStackIdentityRole', - - 'OpenStackServiceCatalog', - 'OpenStackServiceCatalogEntry', - 'OpenStackServiceCatalogEntryEndpoint', - 'OpenStackIdentityEndpointType', - - 'OpenStackIdentityConnection', - 'OpenStackIdentity_1_0_Connection', - 'OpenStackIdentity_1_1_Connection', - 'OpenStackIdentity_2_0_Connection', - 'OpenStackIdentity_3_0_Connection', - - 'get_class_for_auth_version' + "OpenStackAuthenticationCache", + "OpenStackAuthenticationCacheKey", + "OpenStackAuthenticationContext", + "OpenStackIdentityVersion", + "OpenStackIdentityDomain", + "OpenStackIdentityProject", + "OpenStackIdentityUser", + "OpenStackIdentityRole", + "OpenStackServiceCatalog", + "OpenStackServiceCatalogEntry", + "OpenStackServiceCatalogEntryEndpoint", + "OpenStackIdentityEndpointType", + "OpenStackIdentityConnection", + "OpenStackIdentity_1_0_Connection", + "OpenStackIdentity_1_1_Connection", + "OpenStackIdentity_2_0_Connection", + "OpenStackIdentity_2_0_Connection_VOMS", + "OpenStackIdentity_3_0_Connection", + "OpenStackIdentity_3_0_Connection_AppCred", + "OpenStackIdentity_3_0_Connection_OIDC_access_token", + "get_class_for_auth_version", ] -class OpenStackIdentityEndpointType(object): +class OpenStackAuthenticationCache: + """ + Base class for external OpenStack authentication caches. + + Authentication tokens are always cached in memory in + :class:`OpenStackIdentityConnection`.auth_token and related fields. These + tokens are lost when the driver is garbage collected. To share tokens + among multiple drivers, processes, or systems, use an + :class:`OpenStackAuthenticationCache` in + OpenStackIdentityConnection.auth_cache. + + Cache implementers should inherit this class and define the methods below. + """ + + def get(self, key): + """ + Get an authentication context from the cache. + + :param key: Key to fetch. + :type key: :class:`.OpenStackAuthenticationCacheKey` + + :return: The cached context for the given key, if present; None if not. + :rtype: :class:`OpenStackAuthenticationContext` + """ + raise NotImplementedError + + def put(self, key, context): + """ + Put an authentication context into the cache. + + :param key: Key where the context will be stored. + :type key: :class:`.OpenStackAuthenticationCacheKey` + + :param context: The context to cache. + :type context: :class:`.OpenStackAuthenticationContext` + """ + raise NotImplementedError + + def clear(self, key): + """ + Clear an authentication context from the cache. + + :param key: Key to clear. + :type key: :class:`.OpenStackAuthenticationCacheKey` + """ + raise NotImplementedError + + +OpenStackAuthenticationCacheKey = namedtuple( + "OpenStackAuthenticationCacheKey", + [ + "auth_url", + "user_id", + "token_scope", + "tenant_name", + "domain_name", + "tenant_domain_id", + ], +) + + +class OpenStackAuthenticationContext: + """ + An authentication token and related context. + """ + + def __init__(self, token, expiration=None, user=None, roles=None, urls=None): + self.token = token + self.expiration = expiration + self.user = user + self.roles = roles + self.urls = urls + + +class OpenStackIdentityEndpointType: """ Enum class for openstack identity endpoint type. """ - INTERNAL = 'internal' - EXTERNAL = 'external' - ADMIN = 'admin' + INTERNAL = "internal" + EXTERNAL = "external" + ADMIN = "admin" -class OpenStackIdentityTokenScope(object): + +class OpenStackIdentityTokenScope: """ Enum class for openstack identity token scope. """ - PROJECT = 'project' - DOMAIN = 'domain' - UNSCOPED = 'unscoped' + + PROJECT = "project" + DOMAIN = "domain" + UNSCOPED = "unscoped" -class OpenStackIdentityVersion(object): +class OpenStackIdentityVersion: def __init__(self, version, status, updated, url): self.version = version self.status = status @@ -100,23 +181,29 @@ def __init__(self, version, status, updated, url): self.url = url def __repr__(self): - return (('' % - (self.version, self.status, self.updated, self.url))) + return "" % ( + self.version, + self.status, + self.updated, + self.url, + ) -class OpenStackIdentityDomain(object): +class OpenStackIdentityDomain: def __init__(self, id, name, enabled): self.id = id self.name = name self.enabled = enabled def __repr__(self): - return (('' % - (self.id, self.name, self.enabled))) + return "".format( + self.id, + self.name, + self.enabled, + ) -class OpenStackIdentityProject(object): +class OpenStackIdentityProject: def __init__(self, id, name, description, enabled, domain_id=None): self.id = id self.name = name @@ -125,12 +212,15 @@ def __init__(self, id, name, description, enabled, domain_id=None): self.domain_id = domain_id def __repr__(self): - return (('' % - (self.id, self.domain_id, self.name, self.enabled))) + return "" % ( + self.id, + self.domain_id, + self.name, + self.enabled, + ) -class OpenStackIdentityRole(object): +class OpenStackIdentityRole: def __init__(self, id, name, description, enabled): self.id = id self.name = name @@ -138,12 +228,15 @@ def __init__(self, id, name, description, enabled): self.enabled = enabled def __repr__(self): - return (('' % (self.id, self.name, self.description, - self.enabled))) + return "" % ( + self.id, + self.name, + self.description, + self.enabled, + ) -class OpenStackIdentityUser(object): +class OpenStackIdentityUser: def __init__(self, id, domain_id, name, email, description, enabled): self.id = id self.domain_id = domain_id @@ -153,16 +246,20 @@ def __init__(self, id, domain_id, name, email, description, enabled): self.enabled = enabled def __repr__(self): - return (('' % (self.id, self.domain_id, self.name, - self.email, self.enabled))) + return "" % ( + self.id, + self.domain_id, + self.name, + self.email, + self.enabled, + ) -class OpenStackServiceCatalog(object): +class OpenStackServiceCatalog: """ http://docs.openstack.org/api/openstack-identity-service/2.0/content/ - This class should be instanciated with the contents of the + This class should be instantiated with the contents of the 'serviceCatalog' in the auth response. This will do the work of figuring out which services actually exist in the catalog as well as split them up by type, name, and region if available @@ -176,22 +273,17 @@ def __init__(self, service_catalog, auth_version=AUTH_API_VERSION): # Check this way because there are a couple of different 2.0_* # auth types. - if '3.x' in self._auth_version: - entries = self._parse_service_catalog_auth_v3( - service_catalog=service_catalog) - elif '2.0' in self._auth_version: - entries = self._parse_service_catalog_auth_v2( - service_catalog=service_catalog) - elif ('1.1' in self._auth_version) or ('1.0' in self._auth_version): - entries = self._parse_service_catalog_auth_v1( - service_catalog=service_catalog) + if "3.x" in self._auth_version: + entries = self._parse_service_catalog_auth_v3(service_catalog=service_catalog) + elif "2.0" in self._auth_version: + entries = self._parse_service_catalog_auth_v2(service_catalog=service_catalog) + elif ("1.1" in self._auth_version) or ("1.0" in self._auth_version): + entries = self._parse_service_catalog_auth_v1(service_catalog=service_catalog) else: - raise LibcloudError('auth version "%s" not supported' - % (self._auth_version)) + raise LibcloudError('auth version "%s" not supported' % (self._auth_version)) # Force consistent ordering by sorting the entries - entries = sorted(entries, - key=lambda x: x.service_type + (x.service_name or '')) + entries = sorted(entries, key=lambda x: x.service_type + (x.service_name or "")) self._entries = entries # stories all the service catalog entries def get_entries(self): @@ -213,8 +305,7 @@ def get_public_urls(self, service_type=None, name=None): Retrieve all the available public (external) URLs for the provided service type and name. """ - endpoints = self.get_endpoints(service_type=service_type, - name=name) + endpoints = self.get_endpoints(service_type=service_type, name=name) result = [] for endpoint in endpoints: @@ -233,6 +324,10 @@ def get_endpoints(self, service_type=None, name=None): endpoints = [] for entry in self._entries: + # Note: "if XXX and YYY != XXX" comparison is used to support + # partial lookups. + # This allows user to pass in only one argument to the method (only + # service_type or name), both of them or neither. if service_type and entry.service_type != service_type: continue @@ -244,8 +339,13 @@ def get_endpoints(self, service_type=None, name=None): return endpoints - def get_endpoint(self, service_type=None, name=None, region=None, - endpoint_type=OpenStackIdentityEndpointType.EXTERNAL): + def get_endpoint( + self, + service_type=None, + name=None, + region=None, + endpoint_type=OpenStackIdentityEndpointType.EXTERNAL, + ): """ Retrieve a single endpoint using the provided criteria. @@ -273,9 +373,9 @@ def get_endpoint(self, service_type=None, name=None, region=None, if len(endpoints) == 1: return endpoints[0] elif len(endpoints) > 1: - raise ValueError('Found more than 1 matching endpoint') + raise ValueError("Found more than 1 matching endpoint") else: - raise LibcloudError('Could not find specified endpoint') + raise LibcloudError("Could not find specified endpoint") def get_regions(self, service_type=None): """ @@ -334,8 +434,8 @@ def get_service_names(self, service_type=None, region=None): """ names = set() - if '2.0' not in self._auth_version: - raise ValueError('Unsupported version: %s' % (self._auth_version)) + if "2.0" not in self._auth_version: + raise ValueError("Unsupported version: %s" % (self._auth_version)) for entry in self._entries: if service_type and entry.service_type != service_type: @@ -358,25 +458,28 @@ def _parse_service_catalog_auth_v1(self, service_catalog): for service, endpoints in service_catalog.items(): entry_endpoints = [] for endpoint in endpoints: - region = endpoint.get('region', None) + region = endpoint.get("region", None) - public_url = endpoint.get('publicURL', None) - private_url = endpoint.get('internalURL', None) + public_url = endpoint.get("publicURL", None) + private_url = endpoint.get("internalURL", None) if public_url: entry_endpoint = OpenStackServiceCatalogEntryEndpoint( - region=region, url=public_url, - endpoint_type=OpenStackIdentityEndpointType.EXTERNAL) + region=region, + url=public_url, + endpoint_type=OpenStackIdentityEndpointType.EXTERNAL, + ) entry_endpoints.append(entry_endpoint) if private_url: entry_endpoint = OpenStackServiceCatalogEntryEndpoint( - region=region, url=private_url, - endpoint_type=OpenStackIdentityEndpointType.INTERNAL) + region=region, + url=private_url, + endpoint_type=OpenStackIdentityEndpointType.INTERNAL, + ) entry_endpoints.append(entry_endpoint) - entry = OpenStackServiceCatalogEntry(service_type=service, - endpoints=entry_endpoints) + entry = OpenStackServiceCatalogEntry(service_type=service, endpoints=entry_endpoints) entries.append(entry) return entries @@ -385,31 +488,37 @@ def _parse_service_catalog_auth_v2(self, service_catalog): entries = [] for service in service_catalog: - service_type = service['type'] - service_name = service.get('name', None) + service_type = service["type"] + service_name = service.get("name", None) entry_endpoints = [] - for endpoint in service.get('endpoints', []): - region = endpoint.get('region', None) + for endpoint in service.get("endpoints", []): + region = endpoint.get("region", None) - public_url = endpoint.get('publicURL', None) - private_url = endpoint.get('internalURL', None) + public_url = endpoint.get("publicURL", None) + private_url = endpoint.get("internalURL", None) if public_url: entry_endpoint = OpenStackServiceCatalogEntryEndpoint( - region=region, url=public_url, - endpoint_type=OpenStackIdentityEndpointType.EXTERNAL) + region=region, + url=public_url, + endpoint_type=OpenStackIdentityEndpointType.EXTERNAL, + ) entry_endpoints.append(entry_endpoint) if private_url: entry_endpoint = OpenStackServiceCatalogEntryEndpoint( - region=region, url=private_url, - endpoint_type=OpenStackIdentityEndpointType.INTERNAL) + region=region, + url=private_url, + endpoint_type=OpenStackIdentityEndpointType.INTERNAL, + ) entry_endpoints.append(entry_endpoint) - entry = OpenStackServiceCatalogEntry(service_type=service_type, - endpoints=entry_endpoints, - service_name=service_name) + entry = OpenStackServiceCatalogEntry( + service_type=service_type, + endpoints=entry_endpoints, + service_name=service_name, + ) entries.append(entry) return entries @@ -418,33 +527,38 @@ def _parse_service_catalog_auth_v3(self, service_catalog): entries = [] for item in service_catalog: - service_type = item['type'] + service_type = item["type"] + service_name = item.get("name", None) entry_endpoints = [] - for endpoint in item['endpoints']: - region = endpoint.get('region', None) - url = endpoint['url'] - endpoint_type = endpoint['interface'] + for endpoint in item["endpoints"]: + region = endpoint.get("region", None) + url = endpoint["url"] + endpoint_type = endpoint["interface"] - if endpoint_type == 'internal': + if endpoint_type == "internal": endpoint_type = OpenStackIdentityEndpointType.INTERNAL - elif endpoint_type == 'public': + elif endpoint_type == "public": endpoint_type = OpenStackIdentityEndpointType.EXTERNAL - elif endpoint_type == 'admin': + elif endpoint_type == "admin": endpoint_type = OpenStackIdentityEndpointType.ADMIN entry_endpoint = OpenStackServiceCatalogEntryEndpoint( - region=region, url=url, endpoint_type=endpoint_type) + region=region, url=url, endpoint_type=endpoint_type + ) entry_endpoints.append(entry_endpoint) - entry = OpenStackServiceCatalogEntry(service_type=service_type, - endpoints=entry_endpoints) + entry = OpenStackServiceCatalogEntry( + service_type=service_type, + service_name=service_name, + endpoints=entry_endpoints, + ) entries.append(entry) return entries -class OpenStackServiceCatalogEntry(object): +class OpenStackServiceCatalogEntry: def __init__(self, service_type, endpoints=None, service_name=None): """ :param service_type: Service type. @@ -461,30 +575,34 @@ def __init__(self, service_type, endpoints=None, service_name=None): self.service_name = service_name # For consistency, sort the endpoints - self.endpoints = sorted(self.endpoints, key=lambda x: x.url or '') + self.endpoints = sorted(self.endpoints, key=lambda x: x.url or "") def __eq__(self, other): - return (self.service_type == other.service_type and - self.endpoints == other.endpoints and - other.service_name == self.service_name) + return ( + self.service_type == other.service_type + and self.endpoints == other.endpoints + and other.service_name == self.service_name + ) def __ne__(self, other): return not self.__eq__(other=other) def __repr__(self): - return ((' str + """Return the string representation of the state object attribute + :param str value: the state object to turn into string + :return: the uppercase string that represents the state object + :rtype: str + """ + value = cast(Enum, value) + return str(value._value_).upper() + + @classmethod + def fromstring(cls, value): + # type: (str) -> Optional[str] + """Return the state object attribute that matches the string + :param str value: the string to look up + :return: the state object attribute that matches the string + :rtype: str + """ + return getattr(cls, value.upper(), None) + + """ + NOTE: These methods are here for backward compatibility reasons where + Type values were simple strings and Type didn't inherit from Enum. + """ + + def __eq__(self, other): + if isinstance(other, Type): + return other.value == self.value + elif isinstance(other, str): + return self.value == other + + return super().__eq__(other) + + def upper(self): + return self.value.upper() # pylint: disable=no-member + + def lower(self): + return self.value.lower() # pylint: disable=no-member + + def __ne__(self, other): + return not self.__eq__(other) + + def __str__(self): + return str(self.value) + + def __repr__(self): + return self.value + + def __hash__(self): + return hash(self.value) + + class LibcloudError(Exception): """The base class for other libcloud exceptions""" def __init__(self, value, driver=None): - super(LibcloudError, self).__init__(value) + # type: (str, Optional[BaseDriver]) -> None + super().__init__(value) self.value = value self.driver = driver @@ -37,10 +98,7 @@ def __str__(self): return self.__repr__() def __repr__(self): - return ("") + return "" class MalformedResponseError(LibcloudError): @@ -49,6 +107,7 @@ class MalformedResponseError(LibcloudError): '

something

' due to some error on their side.""" def __init__(self, value, body=None, driver=None): + # type: (str, Optional[str], Optional[BaseDriver]) -> None self.value = value self.driver = driver self.body = body @@ -57,12 +116,14 @@ def __str__(self): return self.__repr__() def __repr__(self): - return (": " + - repr(self.body)) + return ( + ": " + + repr(self.body) + ) class ProviderError(LibcloudError): @@ -70,13 +131,14 @@ class ProviderError(LibcloudError): Exception used when provider gives back error response (HTTP 4xx, 5xx) for a request. - Specific sub types can be derieved for errors like + Specific sub types can be derived for errors like HTTP 401 : InvalidCredsError HTTP 404 : NodeNotFoundError, ContainerDoesNotExistError """ def __init__(self, value, http_code, driver=None): - super(ProviderError, self).__init__(value=value, driver=driver) + # type: (str, int, Optional[BaseDriver]) -> None + super().__init__(value=value, driver=driver) self.http_code = http_code def __str__(self): @@ -89,21 +151,31 @@ def __repr__(self): class InvalidCredsError(ProviderError): """Exception used when invalid credentials are used on a provider.""" - def __init__(self, value='Invalid credentials with the provider', - driver=None): - super(InvalidCredsError, self).__init__(value, - http_code=httplib.UNAUTHORIZED, - driver=driver) + def __init__(self, value="Invalid credentials with the provider", driver=None): + # type: (str, Optional[BaseDriver]) -> None + # NOTE: We don't use http.client constants here since that adds ~20ms + # import time overhead + super().__init__(value, http_code=401, driver=driver) # Deprecated alias of :class:`InvalidCredsError` InvalidCredsException = InvalidCredsError -class LazyList(object): +class ServiceUnavailableError(ProviderError): + """Exception used when a provider returns 503 Service Unavailable.""" + + def __init__(self, value="Service unavailable at provider", driver=None): + # type: (str, Optional[BaseDriver]) -> None + # NOTE: We don't use http.client constants here since that adds ~20ms + # import time overhead + super().__init__(value, http_code=503, driver=driver) + +class LazyList: def __init__(self, get_more, value_dict=None): - self._data = [] + # type: (Callable, Optional[dict]) -> None + self._data = [] # type: list self._last_key = None self._exhausted = False self._all_loaded = False @@ -115,8 +187,7 @@ def __iter__(self): self._load_all() data = self._data - for i in data: - yield i + yield from data def __getitem__(self, index): if index >= len(self._data) and not self._all_loaded: @@ -130,14 +201,14 @@ def __len__(self): def __repr__(self): self._load_all() - repr_string = ', ' .join([repr(item) for item in self._data]) - repr_string = '[%s]' % (repr_string) + repr_string = ", ".join([repr(item) for item in self._data]) + repr_string = "[%s]" % (repr_string) return repr_string def _load_all(self): while not self._exhausted: - newdata, self._last_key, self._exhausted = \ - self._get_more(last_key=self._last_key, - value_dict=self._value_dict) + newdata, self._last_key, self._exhausted = self._get_more( + last_key=self._last_key, value_dict=self._value_dict + ) self._data.extend(newdata) self._all_loaded = True diff --git a/libcloud/common/upcloud.py b/libcloud/common/upcloud.py new file mode 100644 index 0000000000..797629cfdc --- /dev/null +++ b/libcloud/common/upcloud.py @@ -0,0 +1,314 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import json +import time + +from libcloud.common.types import LibcloudError +from libcloud.common.exceptions import BaseHTTPError + + +class UpcloudTimeoutException(LibcloudError): + pass + + +class UpcloudCreateNodeRequestBody: + """ + Body of the create_node request + + Takes the create_node arguments (**kwargs) and constructs the request body + + :param name: Name of the created server (required) + :type name: ``str`` + + :param size: The size of resources allocated to this node. + :type size: :class:`.NodeSize` + + :param image: OS Image to boot on node. + :type image: :class:`.NodeImage` + + :param location: Which data center to create a node in. If empty, + undefined behavior will be selected. (optional) + :type location: :class:`.NodeLocation` + + :param auth: Initial authentication information for the node + (optional) + :type auth: :class:`.NodeAuthSSHKey` + + :param ex_hostname: Hostname. Default is 'localhost'. (optional) + :type ex_hostname: ``str`` + + :param ex_username: User's username, which is created. + Default is 'root'. (optional) + :type ex_username: ``str`` + + :param ex_storage_devices: Additional UpCloud storage_device dictionaries. + (optional) + :type ex_storage_devices: ``list`` of ``dict`` + + :param ex_metadata: Whether to enable the UpCloud metadata service, + ``"yes"`` or ``"no"``. Cloud-init templates require + this to be enabled. (optional) + :type ex_metadata: ``str`` + """ + + def __init__( + self, + name, + size, + image, + location, + auth=None, + ex_hostname="localhost", + ex_username="root", + ex_storage_devices=None, + ex_metadata=None, + ): + storage_devices = _StorageDevice(image, size).to_dict() + if ex_storage_devices: + storage_devices["storage_device"].extend(ex_storage_devices) + + self.body = { + "server": { + "title": name, + "hostname": ex_hostname, + "plan": size.id, + "zone": location.id, + "login_user": _LoginUser(ex_username, auth).to_dict(), + "storage_devices": storage_devices, + } + } + if ex_metadata is not None: + self.body["server"]["metadata"] = ex_metadata + + def to_json(self): + """ + Serializes the body to json + + :return: JSON string + :rtype: ``str`` + """ + return json.dumps(self.body) + + +class UpcloudNodeDestroyer: + """ + Helper class for destroying node. + Node must be first stopped and then it can be + destroyed + + :param upcloud_node_operations: UpcloudNodeOperations instance + :type upcloud_node_operations: :class:`.UpcloudNodeOperations` + + :param sleep_func: Callable function, which sleeps. + Takes int argument to sleep in seconds (optional) + :type sleep_func: ``function`` + + """ + + WAIT_AMOUNT = 2 + SLEEP_COUNT_TO_TIMEOUT = 20 + + def __init__(self, upcloud_node_operations, sleep_func=None): + self._operations = upcloud_node_operations + self._sleep_func = sleep_func or time.sleep + self._sleep_count = 0 + + def destroy_node(self, node_id): + """ + Destroys the given node. + + :param node_id: Id of the Node. + :type node_id: ``int`` + """ + self._stop_called = False + self._sleep_count = 0 + return self._do_destroy_node(node_id) + + def _do_destroy_node(self, node_id): + state = self._operations.get_node_state(node_id) + if state == "stopped": + self._operations.destroy_node(node_id) + return True + elif state == "error": + return False + elif state == "started": + if not self._stop_called: + self._operations.stop_node(node_id) + self._stop_called = True + else: + # Waiting for started state to change and + # not calling stop again + self._sleep() + return self._do_destroy_node(node_id) + elif state == "maintenance": + # Lets wait maintenance state to go away and retry destroy + self._sleep() + return self._do_destroy_node(node_id) + elif state is None: # Server not found any more + return True + + def _sleep(self): + if self._sleep_count > self.SLEEP_COUNT_TO_TIMEOUT: + raise UpcloudTimeoutException("Timeout, could not destroy node") + self._sleep_count += 1 + self._sleep_func(self.WAIT_AMOUNT) + + +class UpcloudNodeOperations: + """ + Helper class to start and stop node. + + :param connection: Connection instance + :type connection: :class:`.UpcloudConnection` + """ + + def __init__(self, connection): + self.connection = connection + + def stop_node(self, node_id): + """ + Stops the node + + :param node_id: Id of the Node + :type node_id: ``int`` + """ + body = {"stop_server": {"stop_type": "hard"}} + self.connection.request( + "1.3/server/{}/stop".format(node_id), method="POST", data=json.dumps(body) + ) + + def start_node(self, node_id): + """ + Starts the node + + :param node_id: Id of the Node + :type node_id: ``int`` + """ + self.connection.request("1.3/server/{}/start".format(node_id), method="POST") + + def get_node_state(self, node_id): + """ + Get the state of the node. + + :param node_id: Id of the Node + :type node_id: ``int`` + + :rtype: ``str`` + """ + + action = "1.3/server/{}".format(node_id) + try: + response = self.connection.request(action) + return response.object["server"]["state"] + except BaseHTTPError as e: + if e.code == 404: + return None + raise + + def destroy_node(self, node_id): + """ + Destroys the node. + + :param node_id: Id of the Node + :type node_id: ``int`` + """ + self.connection.request("1.3/server/{}".format(node_id), method="DELETE") + + +class PlanPrice: + """ + Helper class to construct plan price in different zones + + :param zone_prices: List of prices in different zones in UpCloud + :type zone_prices: ```list``` + + """ + + def __init__(self, zone_prices): + self._zone_prices = zone_prices + + def get_price(self, plan_name, location=None): + """ + Returns the plan's price in location. If location + is not provided returns None + + :param plan_name: Name of the plan + :type plan_name: ```str``` + + :param location: Location, which price is returned (optional) + :type location: :class:`.NodeLocation` + + + rtype: ``float`` + """ + if location is None: + return None + server_plan_name = "server_plan_" + plan_name + + for zone_price in self._zone_prices: + if zone_price["name"] == location.id: + return zone_price.get(server_plan_name, {}).get("price") + return None + + +class _LoginUser: + def __init__(self, user_id, auth=None): + self.user_id = user_id + self.auth = auth + + def to_dict(self): + login_user = {"username": self.user_id} + if self.auth is not None: + login_user["ssh_keys"] = {"ssh_key": [self.auth.pubkey]} + else: + login_user["create_password"] = "yes" + + return login_user + + +class _StorageDevice: + def __init__(self, image, size): + self.image = image + self.size = size + + def to_dict(self): + extra = self.image.extra + if extra["type"] == "template": + return self._storage_device_for_template_image() + elif extra["type"] == "cdrom": + return self._storage_device_for_cdrom_image() + + def _storage_device_for_template_image(self): + hdd_device = {"action": "clone", "storage": self.image.id} + hdd_device.update(self._common_hdd_device()) + return {"storage_device": [hdd_device]} + + def _storage_device_for_cdrom_image(self): + hdd_device = {"action": "create"} + hdd_device.update(self._common_hdd_device()) + storage_devices = { + "storage_device": [ + hdd_device, + {"action": "attach", "storage": self.image.id, "type": "cdrom"}, + ] + } + return storage_devices + + def _common_hdd_device(self): + return { + "title": self.image.name, + "size": self.size.disk, + "tier": self.size.extra.get("storage_tier", "maxiops"), + } diff --git a/libcloud/common/vultr.py b/libcloud/common/vultr.py new file mode 100644 index 0000000000..0415715217 --- /dev/null +++ b/libcloud/common/vultr.py @@ -0,0 +1,220 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Any, Dict, Optional + +from libcloud.utils.py3 import httplib +from libcloud.common.base import JsonResponse, ConnectionKey +from libcloud.compute.base import VolumeSnapshot + +__all__ = [ + "API_HOST", + "VultrConnection", + "VultrException", + "VultrResponse", + "DEFAULT_API_VERSION", + "VultrResponseV2", + "VultrConnectionV2", + "VultrNetwork", + "VultrNodeSnapshot", +] + +# Endpoint for the Vultr API +API_HOST = "api.vultr.com" + +DEFAULT_API_VERSION = "2" + + +class VultrResponse(JsonResponse): + objects = None + error_dict = {} # type: Dict[str, str] + errors = None + ERROR_CODE_MAP = { + 400: "Invalid API location. Check the URL that you are using.", + 403: "Invalid or missing API key. Check that your API key is present" + + " and matches your assigned key.", + 405: "Invalid HTTP method. Check that the method (POST|GET) matches" + + " what the documentation indicates.", + 412: "Request failed. Check the response body for a more detailed" + " description.", + 500: "Internal server error. Try again at a later time.", + 503: "Rate limit hit. API requests are limited to an average of 1/s." + + " Try your request again later.", + } + + def __init__(self, response, connection): + self.errors = [] + super().__init__(response=response, connection=connection) + self.objects, self.errors = self.parse_body_and_errors() + if not self.success(): + raise self._make_excp(self.errors[0]) + + def parse_body_and_errors(self): + """ + Returns JSON data in a python list. + """ + json_objects = [] + errors = [] + + if self.status in self.ERROR_CODE_MAP: + self.error_dict["ERRORCODE"] = self.status + self.error_dict["ERRORMESSAGE"] = self.ERROR_CODE_MAP[self.status] + errors.append(self.error_dict) + + js = super().parse_body() + if isinstance(js, dict): + js = [js] + + json_objects.append(js) + + return (json_objects, errors) + + def _make_excp(self, error): + """ + Convert API error to a VultrException instance + """ + + return VultrException(error["ERRORCODE"], error["ERRORMESSAGE"]) + + def success(self): + return len(self.errors) == 0 + + +class VultrConnection(ConnectionKey): + """ + A connection to the Vultr API + """ + + host = API_HOST + responseCls = VultrResponse + + def add_default_params(self, params): + """ + Returns default params such as api_key which is + needed to perform an action.Returns a dictionary. + Example:/v1/server/upgrade_plan?api_key=self.key + """ + params["api_key"] = self.key + + return params + + def add_default_headers(self, headers): + """ + Returns default headers such as content-type. + Returns a dictionary. + """ + headers["Content-Type"] = "application/x-www-form-urlencoded" + headers["Accept"] = "text/plain" + + return headers + + def set_path(self): + self.path = "/v/" + return self.path + + +class VultrResponseV2(JsonResponse): + valid_response_codes = [ + httplib.OK, + httplib.CREATED, + httplib.ACCEPTED, + httplib.NO_CONTENT, + ] + + def parse_error(self): + """ + Parse the error body and raise the appropriate exception + """ + status = self.status + data = self.parse_body() + error_msg = data.get("error", "") + + raise VultrException(code=status, message=error_msg) + + def success(self): + """Check the response for success + + :return: ``bool`` indicating a successful request + """ + return self.status in self.valid_response_codes + + +class VultrConnectionV2(ConnectionKey): + """ + A connection to the Vultr API v2 + """ + + host = API_HOST + responseCls = VultrResponseV2 + + def add_default_headers(self, headers): + headers["Authorization"] = "Bearer %s" % (self.key) + headers["Content-Type"] = "application/json" + return headers + + def add_default_params(self, params): + params["per_page"] = 500 + return params + + +class VultrException(Exception): + """ + Error originating from the Vultr API + """ + + def __init__(self, code, message): + self.code = code + self.message = message + self.args = (code, message) + + def __str__(self): + return "(%u) %s" % (self.code, self.message) + + def __repr__(self): + return "VultrException code %u '%s'" % (self.code, self.message) + + +class VultrNetwork: + """ + Represents information about a Vultr private network. + """ + + def __init__( + self, + id: str, + cidr_block: str, + location: str, + extra: Optional[Dict[str, Any]] = None, + ) -> None: + self.id = id + self.cidr_block = cidr_block + self.location = location + self.extra = extra or {} + + def __repr__(self): + return "".format( + self.id, + self.cidr_block, + self.location, + ) + + +class VultrNodeSnapshot(VolumeSnapshot): + def __repr__(self): + return "".format( + self.id, + self.size, + self.driver.name, + self.state, + ) diff --git a/libcloud/common/worldwidedns.py b/libcloud/common/worldwidedns.py new file mode 100644 index 0000000000..07b3074fdc --- /dev/null +++ b/libcloud/common/worldwidedns.py @@ -0,0 +1,196 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import re + +from libcloud.common.base import Response, ConnectionUserAndKey +from libcloud.common.types import ProviderError + +OK_CODES = ["200", "211", "212", "213"] +ERROR_CODES = [ + "401", + "403", + "405", + "406", + "407", + "408", + "409", + "410", + "411", + "412", + "413", + "414", + "450", + "451", +] + + +class WorldWideDNSException(ProviderError): + def __init__(self, value, http_code, code, driver=None): + self.code = code + super().__init__(value, http_code, driver) + + +class SuspendedAccount(WorldWideDNSException): + def __init__(self, http_code, driver=None): + value = "Login ID you supplied is SUSPENDED, you need to renew" + " your account" + super().__init__(value, http_code, 401, driver) + + +class LoginOrPasswordNotMatch(WorldWideDNSException): + def __init__(self, http_code, driver=None): + value = "Login ID and/or Password you supplied is not on file or" + " does not match" + super().__init__(value, http_code, 403, driver) + + +class NonExistentDomain(WorldWideDNSException): + def __init__(self, http_code, driver=None): + value = "Domain name supplied is not in your account" + super().__init__(value, http_code, 405, driver) + + +class CouldntRemoveDomain(WorldWideDNSException): + def __init__(self, http_code, driver=None): + value = "Error occurred removing domain from name server, try again" + super().__init__(value, http_code, 406, driver) + + +class LimitExceeded(WorldWideDNSException): + def __init__(self, http_code, driver=None): + value = "Your limit was exceeded, you need to upgrade your account" + super().__init__(value, http_code, 407, driver) + + +class ExistentDomain(WorldWideDNSException): + def __init__(self, http_code, driver=None): + value = "Domain already exists on our servers" + super().__init__(value, http_code, 408, driver) + + +class DomainBanned(WorldWideDNSException): + def __init__(self, http_code, driver=None): + value = "Domain is listed in DNSBL and is banned from our servers" + super().__init__(value, http_code, 409, driver) + + +class InvalidDomainName(WorldWideDNSException): + def __init__(self, http_code, driver=None): + value = "Invalid domain name" + super().__init__(value, http_code, 410, driver) + + +class ErrorOnReloadInNameServer(WorldWideDNSException): + def __init__(self, server, http_code, driver=None): + value, code = "unknown", "unknown" + if server == 1: + value = "Name server #1 kicked an error on reload, contact support" + code = 411 + elif server == 2: + value = "Name server #2 kicked an error on reload, contact support" + code = 412 + elif server == 3: + value = "Name server #3 kicked an error on reload, contact support" + code = 413 + super().__init__(value, http_code, code, driver) + + +class NewUserNotValid(WorldWideDNSException): + def __init__(self, http_code, driver=None): + value = "New userid is not valid" + super().__init__(value, http_code, 414, driver) + + +class CouldntReachNameServer(WorldWideDNSException): + def __init__(self, http_code, driver=None): + value = "Couldn't reach the name server, try again later" + super().__init__(value, http_code, 450, driver) + + +class NoZoneFile(WorldWideDNSException): + def __init__(self, http_code, driver=None): + value = "No zone file in the name server queried" + super().__init__(value, http_code, 451, driver) + + +ERROR_CODE_TO_EXCEPTION_CLS = { + "401": SuspendedAccount, + "403": LoginOrPasswordNotMatch, + "405": NonExistentDomain, + "406": CouldntRemoveDomain, + "407": LimitExceeded, + "408": ExistentDomain, + "409": DomainBanned, + "410": InvalidDomainName, + "411": ErrorOnReloadInNameServer, + "412": ErrorOnReloadInNameServer, + "413": ErrorOnReloadInNameServer, + "414": NewUserNotValid, + "450": CouldntReachNameServer, + "451": NoZoneFile, +} + + +class WorldWideDNSResponse(Response): + def parse_body(self): + """ + Parse response body. + + :return: Parsed body. + :rtype: ``str`` + """ + if self._code_response(self.body): + codes = re.split("\r?\n", self.body) + for code in codes: + if code in OK_CODES: + continue + elif code in ERROR_CODES: + exception = ERROR_CODE_TO_EXCEPTION_CLS.get(code) + if code in ["411", "412", "413"]: + server = int(code[2]) + raise exception(server, self.status) + raise exception(self.status) + return self.body + + def _code_response(self, body): + """ + Checks if the response body contains code status. + + :rtype: ``bool`` + """ + available_response_codes = OK_CODES + ERROR_CODES + codes = re.split("\r?\n", body) + if codes[0] in available_response_codes: + return True + return False + + +class WorldWideDNSConnection(ConnectionUserAndKey): + host = "www.worldwidedns.net" + responseCls = WorldWideDNSResponse + + def add_default_params(self, params): + """ + Add parameters that are necessary for every request + + This method adds ``NAME`` and ``PASSWORD`` to + the request. + """ + params["NAME"] = self.user_id + params["PASSWORD"] = self.key + + reseller_id = getattr(self, "reseller_id", None) + if reseller_id: + params["ID"] = reseller_id + + return params diff --git a/libcloud/common/xmlrpc.py b/libcloud/common/xmlrpc.py index 2502ea6093..e22d913726 100644 --- a/libcloud/common/xmlrpc.py +++ b/libcloud/common/xmlrpc.py @@ -12,22 +12,23 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + """ Base classes for working with xmlrpc APIs """ -import sys +from typing import Dict, Type -from libcloud.utils.py3 import xmlrpclib -from libcloud.utils.py3 import httplib +from libcloud.utils.py3 import httplib, xmlrpclib from libcloud.common.base import Response, Connection +from libcloud.common.types import LibcloudError class ProtocolError(Exception): pass -class ErrorCodeMixin(object): +class ErrorCodeMixin: """ This is a helper for API's that have a well defined collection of error codes that are easily parsed out of error messages. It acts as a factory: @@ -35,7 +36,7 @@ class ErrorCodeMixin(object): needs from the context and raises it. """ - exceptions = {} + exceptions = {} # type: Dict[str, Type[LibcloudError]] def raise_exception_for_error(self, error_code, message): exceptionCls = self.exceptions.get(error_code, None) @@ -44,7 +45,7 @@ def raise_exception_for_error(self, error_code, message): context = self.connection.context driver = self.connection.driver params = {} - if hasattr(exceptionCls, 'kwargs'): + if hasattr(exceptionCls, "kwargs"): for key in exceptionCls.kwargs: if key in context: params[key] = context[key] @@ -52,8 +53,7 @@ def raise_exception_for_error(self, error_code, message): class XMLRPCResponse(ErrorCodeMixin, Response): - - defaultExceptionCls = Exception + defaultExceptionCls = Exception # type: Type[Exception] def success(self): return self.status == httplib.OK @@ -64,14 +64,13 @@ def parse_body(self): if len(params) == 1: params = params[0] return params - except xmlrpclib.Fault: - e = sys.exc_info()[1] + except xmlrpclib.Fault as e: self.raise_exception_for_error(e.faultCode, e.faultString) - error_string = '%s: %s' % (e.faultCode, e.faultString) + error_string = "{}: {}".format(e.faultCode, e.faultString) raise self.defaultExceptionCls(error_string) def parse_error(self): - msg = 'Server returned an invalid xmlrpc response (%d)' % (self.status) + msg = "Server returned an invalid xmlrpc response (%d)" % (self.status) raise ProtocolError(msg) @@ -85,9 +84,10 @@ class XMLRPCConnection(Connection): """ responseCls = XMLRPCResponse + endpoint = None # type: str def add_default_headers(self, headers): - headers['Content-Type'] = 'text/xml' + headers["Content-Type"] = "text/xml" return headers def request(self, method_name, *args, **kwargs): @@ -101,8 +101,6 @@ def request(self, method_name, *args, **kwargs): :type args: ``tuple`` :param args: Arguments to invoke with method with. """ - endpoint = kwargs.get('endpoint', self.endpoint) + endpoint = kwargs.get("endpoint", self.endpoint) data = xmlrpclib.dumps(args, methodname=method_name, allow_none=True) - return super(XMLRPCConnection, self).request(endpoint, - data=data, - method='POST') + return super().request(endpoint, data=data, method="POST") diff --git a/libcloud/common/zonomi.py b/libcloud/common/zonomi.py new file mode 100644 index 0000000000..78afab7030 --- /dev/null +++ b/libcloud/common/zonomi.py @@ -0,0 +1,134 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License.You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.common.base import XmlResponse, ConnectionKey + +__all__ = ["ZonomiException", "ZonomiResponse", "ZonomiConnection"] + +# Endpoint for Zonomi API. +API_HOST = "zonomi.com" + +SPECIAL_ERRORS = [ + "Not found.", + "ERROR: This zone is already in your zone list.", + "Record not deleted.", +] + + +class ZonomiException(Exception): + def __init__(self, code, message): + self.code = code + self.message = message + self.args = (code, message) + + def __str__(self): + return "{} {}".format(self.code, self.message) + + def __repr__(self): + return "ZonomiException {} {}".format(self.code, self.message) + + +class ZonomiResponse(XmlResponse): + errors = None + objects = None + + def __init__(self, response, connection): + self.errors = [] + super().__init__(response=response, connection=connection) + self.objects, self.errors = self.parse_body_and_errors() + if self.errors: + raise self._make_excp(self.errors[0]) + + def parse_body_and_errors(self): + error_dict = {} + actions = None + result_counts = None + action_childrens = None + data = [] + errors = [] + xml_body = super().parse_body() + + # pylint: disable=no-member + # Error handling + if xml_body.text is not None and xml_body.tag == "error": + error_dict["ERRORCODE"] = self.status + if xml_body.text.startswith("ERROR: No zone found for"): + error_dict["ERRORCODE"] = "404" + error_dict["ERRORMESSAGE"] = "Not found." + else: + error_dict["ERRORMESSAGE"] = xml_body.text + errors.append(error_dict) + + # Data handling + children = list(xml_body) + if len(children) == 3: + result_counts = children[1] + actions = children[2] + + if actions is not None: + actions_childrens = list(actions) + action = actions_childrens[0] + action_childrens = list(action) + + if action_childrens is not None: + for child in action_childrens: + if child.tag == "zone" or child.tag == "record": + data.append(child.attrib) + + if result_counts is not None and result_counts.attrib.get("deleted") == "1": + data.append("DELETED") + + if ( + result_counts is not None + and result_counts.attrib.get("deleted") == "0" + and action.get("action") == "DELETE" + ): + error_dict["ERRORCODE"] = self.status + error_dict["ERRORMESSAGE"] = "Record not deleted." + errors.append(error_dict) + + return (data, errors) + + def success(self): + return len(self.errors) == 0 + + def _make_excp(self, error): + """ + :param error: contains error code and error message + :type error: dict + """ + return ZonomiException(error["ERRORCODE"], error["ERRORMESSAGE"]) + + +class ZonomiConnection(ConnectionKey): + host = API_HOST + responseCls = ZonomiResponse + + def add_default_params(self, params): + """ + Adds default parameters to perform a request, + such as api_key. + """ + params["api_key"] = self.key + + return params + + def add_default_headers(self, headers): + """ + Adds default headers needed to perform a successful + request such as Content-Type, User-Agent. + """ + headers["Content-Type"] = "text/xml;charset=UTF-8" + + return headers diff --git a/libcloud/compute/__init__.py b/libcloud/compute/__init__.py index 6d0970a00c..267acd14bd 100644 --- a/libcloud/compute/__init__.py +++ b/libcloud/compute/__init__.py @@ -1,3 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Module for working with Cloud Servers """ diff --git a/libcloud/compute/base.py b/libcloud/compute/base.py index 7c9066caf8..a6ae592095 100644 --- a/libcloud/compute/base.py +++ b/libcloud/compute/base.py @@ -17,39 +17,57 @@ Provides base classes for working with drivers """ -from __future__ import with_statement - -import sys -import time -import hashlib import os -import socket +import re +import time +import atexit import random +import socket +import hashlib import binascii - -from libcloud.utils.py3 import b +import datetime +import traceback +from typing import TYPE_CHECKING, Any, Dict, List, Type, Tuple, Union, Callable, Optional import libcloud.compute.ssh from libcloud.pricing import get_size_price -from libcloud.compute.types import NodeState, StorageVolumeState,\ - DeploymentError -from libcloud.compute.ssh import SSHClient -from libcloud.common.base import ConnectionKey -from libcloud.common.base import BaseDriver +from libcloud.utils.py3 import b +from libcloud.common.base import BaseDriver, Connection, ConnectionKey +from libcloud.compute.ssh import SSHClient, BaseSSHClient, SSHCommandTimeoutError, have_paramiko from libcloud.common.types import LibcloudError -from libcloud.compute.ssh import have_paramiko +from libcloud.compute.types import ( + Provider, + NodeState, + DeploymentError, + StorageVolumeState, + NodeImageMemberState, +) +from libcloud.utils.networking import is_private_subnet, is_valid_ip_address -from libcloud.utils.networking import is_private_subnet -from libcloud.utils.networking import is_valid_ip_address +if TYPE_CHECKING: + from libcloud.compute.deployment import Deployment -if have_paramiko: - from paramiko.ssh_exception import SSHException - from paramiko.ssh_exception import AuthenticationException - SSH_TIMEOUT_EXCEPTION_CLASSES = (AuthenticationException, SSHException, - IOError, socket.gaierror, socket.error) +if have_paramiko: + from paramiko.ssh_exception import SSHException, AuthenticationException + + SSH_TIMEOUT_EXCEPTION_CLASSES = ( + AuthenticationException, + SSHException, + IOError, + socket.gaierror, + socket.error, + ) else: - SSH_TIMEOUT_EXCEPTION_CLASSES = (IOError, socket.gaierror, socket.error) + SSH_TIMEOUT_EXCEPTION_CLASSES = ( + IOError, # type: ignore + socket.gaierror, # type: ignore + socket.error, + ) # type: ignore + +T_Auth = Union["NodeAuthSSHKey", "NodeAuthPassword"] + +T_Ssh_key = Union[List[str], str] # How long to wait for the node to come online after creating it NODE_ONLINE_WAIT_TIMEOUT = 10 * 60 @@ -58,34 +76,49 @@ # script. SSH_CONNECT_TIMEOUT = 5 * 60 +# Error message which should be considered fatal for deploy_node() method and +# on which we should abort retrying and immediately propagate the error +SSH_FATAL_ERROR_MSGS = [ + # Propagate (key) file doesn't exist errors + # NOTE: Paramiko only supports PEM private key format + # See https://github.com/paramiko/paramiko/issues/1313 + # for details + "no such file or directory", + "invalid key", + "not a valid ", + "invalid or unsupported key type", + "private file is encrypted", + "private key file is encrypted", + "private key file checkints do not match", + "invalid password provided", +] __all__ = [ - 'Node', - 'NodeState', - 'NodeSize', - 'NodeImage', - 'NodeLocation', - 'NodeAuthSSHKey', - 'NodeAuthPassword', - 'NodeDriver', - - 'StorageVolume', - 'StorageVolumeState', - 'VolumeSnapshot', - + "Node", + "NodeState", + "NodeSize", + "NodeImage", + "NodeImageMember", + "NodeLocation", + "NodeAuthSSHKey", + "NodeAuthPassword", + "NodeDriver", + "StorageVolume", + "StorageVolumeState", + "VolumeSnapshot", # Deprecated, moved to libcloud.utils.networking - 'is_private_subnet', - 'is_valid_ip_address' + "is_private_subnet", + "is_valid_ip_address", ] -class UuidMixin(object): +class UuidMixin: """ Mixin class for get_uuid function. """ - def __init__(self): - self._uuid = None + def __init__(self) -> None: + self._uuid = None # type: Optional[str] def get_uuid(self): """ @@ -94,10 +127,10 @@ def get_uuid(self): The hash is a function of an SHA1 hash of the node, node image, or node size's ID and its driver which means that it should be unique between all objects of its type. - In some subclasses (e.g. GoGridNode) there is no ID - available so the public IP address is used. This means that, - unlike a properly done system UUID, the same UUID may mean a - different system install at a different time + In some subclasses there is no ID available so the public IP + address is used. This means that, unlike a properly done system + UUID, the same UUID may mean a different system install at a + different time >>> from libcloud.compute.drivers.dummy import DummyNodeDriver >>> driver = DummyNodeDriver(0) @@ -110,14 +143,18 @@ def get_uuid(self): :rtype: ``str`` """ + if not self._uuid: - self._uuid = hashlib.sha1(b('%s:%s' % - (self.id, self.driver.type))).hexdigest() + self._uuid = hashlib.sha1( + b("{}:{}".format(self.id, self.driver.type)) + ).hexdigest() # nosec return self._uuid @property def uuid(self): + # type: () -> str + return self.get_uuid() @@ -166,8 +203,19 @@ class Node(UuidMixin): {'foo': 'bar'} """ - def __init__(self, id, name, state, public_ips, private_ips, - driver, size=None, image=None, extra=None): + def __init__( + self, + id, # type: str + name, # type: str + state, # type: NodeState + public_ips, # type: List[str] + private_ips, # type: List[str] + driver, + size=None, # type: Optional[NodeSize] + image=None, # type: Optional[NodeImage] + extra=None, # type: Optional[dict] + created_at=None, # type: Optional[datetime.datetime] + ): """ :param id: Node ID. :type id: ``str`` @@ -178,6 +226,7 @@ def __init__(self, id, name, state, public_ips, private_ips, :param state: Node state. :type state: :class:`libcloud.compute.types.NodeState` + :param public_ips: Public IP addresses associated with this node. :type public_ips: ``list`` @@ -191,7 +240,10 @@ def __init__(self, id, name, state, public_ips, private_ips, :type size: :class:`.NodeSize` :param image: Image of this node. (optional) - :type size: :class:`.NodeImage` + :type image: :class:`.NodeImage` + + :param created_at: The datetime this node was created (optional) + :type created_at: :class: `datetime.datetime` :param extra: Optional provider specific attributes associated with this node. @@ -205,11 +257,13 @@ def __init__(self, id, name, state, public_ips, private_ips, self.private_ips = private_ips if private_ips else [] self.driver = driver self.size = size + self.created_at = created_at self.image = image self.extra = extra or {} UuidMixin.__init__(self) def reboot(self): + # type: () -> bool """ Reboot this node @@ -229,9 +283,31 @@ def reboot(self): >>> node.state == NodeState.REBOOTING True """ + return self.driver.reboot_node(self) + def start(self): + # type: () -> bool + """ + Start this node. + + :return: ``bool`` + """ + + return self.driver.start_node(self) + + def stop_node(self): + # type: () -> bool + """ + Stop (shutdown) this node. + + :return: ``bool`` + """ + + return self.driver.stop_node(self) + def destroy(self): + # type: () -> bool """ Destroy this node @@ -251,15 +327,22 @@ def destroy(self): False """ + return self.driver.destroy_node(self) def __repr__(self): state = NodeState.tostring(self.state) - return (('') - % (self.uuid, self.name, state, self.public_ips, - self.private_ips, self.driver.name)) + return ( + "" + ) % ( + self.uuid, + self.name, + state, + self.public_ips, + self.private_ips, + self.driver.name, + ) class NodeSize(UuidMixin): @@ -286,8 +369,17 @@ class NodeSize(UuidMixin): 4 """ - def __init__(self, id, name, ram, disk, bandwidth, price, - driver, extra=None): + def __init__( + self, + id, # type: str + name, # type: str + ram, # type: int + disk, # type: int + bandwidth, # type: Optional[int] + price, # type: float + driver, # type: NodeDriver + extra=None, # type: Optional[dict] + ): """ :param id: Size ID. :type id: ``str`` @@ -325,10 +417,17 @@ def __init__(self, id, name, ram, disk, bandwidth, price, UuidMixin.__init__(self) def __repr__(self): - return (('') - % (self.id, self.name, self.ram, self.disk, self.bandwidth, - self.price, self.driver.name)) + return ( + "" + ) % ( + self.id, + self.name, + self.ram, + self.disk, + self.bandwidth, + self.price, + self.driver.name, + ) class NodeImage(UuidMixin): @@ -353,7 +452,13 @@ class NodeImage(UuidMixin): >>> node = driver.create_node(image=image) """ - def __init__(self, id, name, driver, extra=None): + def __init__( + self, + id, # type: str + name, # type: str + driver, # type: NodeDriver + extra=None, # type: Optional[dict] + ): """ :param id: Image ID. :type id: ``str`` @@ -375,11 +480,76 @@ def __init__(self, id, name, driver, extra=None): UuidMixin.__init__(self) def __repr__(self): - return (('') - % (self.id, self.name, self.driver.name)) + return ("") % ( + self.id, + self.name, + self.driver.name, + ) + + +class NodeImageMember(UuidMixin): + """ + A member of an image. At some cloud providers there is a mechanism + to share images. Once an image is shared with another account that + user will be a 'member' of the image. + For example, see the image members schema in the OpenStack Image + Service API v2 documentation. https://developer.openstack.org/ + api-ref/image/v2/index.html#image-members-schema -class NodeLocation(object): + NodeImageMember objects are typically returned by the driver for the + cloud provider in response to the list_image_members method + """ + + def __init__( + self, + id, # type: str + image_id, # type: str + state, # type: NodeImageMemberState + driver, # type: NodeDriver + created=None, # type: Optional[datetime.datetime] + extra=None, # type: Optional[dict] + ): + """ + :param id: Image member ID. + :type id: ``str`` + + :param id: The associated image ID. + :type id: ``str`` + + :param state: State of the NodeImageMember. If not + provided, will default to UNKNOWN. + :type state: :class:`.NodeImageMemberState` + + :param driver: Driver this image belongs to. + :type driver: :class:`.NodeDriver` + + :param created: A datetime object that represents when the + image member was created + :type created: ``datetime.datetime`` + + :param extra: Optional provided specific attributes associated with + this image. + :type extra: ``dict`` + """ + self.id = str(id) + self.image_id = str(image_id) + self.state = state + self.driver = driver + self.created = created + self.extra = extra or {} + UuidMixin.__init__(self) + + def __repr__(self): + return ("") % ( + self.id, + self.image_id, + self.state, + self.driver.name, + ) + + +class NodeLocation: """ A physical location where nodes can be. @@ -390,7 +560,14 @@ class NodeLocation(object): 'US' """ - def __init__(self, id, name, country, driver): + def __init__( + self, + id, # type: str + name, # type: str + country, # type: str + driver, # type: NodeDriver + extra=None, # type: Optional[dict] + ): """ :param id: Location ID. :type id: ``str`` @@ -403,18 +580,27 @@ def __init__(self, id, name, country, driver): :param driver: Driver this location belongs to. :type driver: :class:`.NodeDriver` + + :param extra: Optional provided specific attributes associated with + this location. + :type extra: ``dict`` """ self.id = str(id) self.name = name self.country = country self.driver = driver + self.extra = extra or {} def __repr__(self): - return (('') - % (self.id, self.name, self.country, self.driver.name)) + return ("") % ( + self.id, + self.name, + self.country, + self.driver.name, + ) -class NodeAuthSSHKey(object): +class NodeAuthSSHKey: """ An SSH key to be installed for authentication to a node. @@ -429,21 +615,24 @@ class NodeAuthSSHKey(object): """ def __init__(self, pubkey): + # type: (str) -> None """ - :param pubkey: Public key matetiral. + :param pubkey: Public key material. :type pubkey: ``str`` """ self.pubkey = pubkey def __repr__(self): - return '' + return "" -class NodeAuthPassword(object): +class NodeAuthPassword: """ A password to be used for authentication to a node. """ + def __init__(self, password, generated=False): + # type: (str, bool) -> None """ :param password: Password. :type password: ``str`` @@ -455,7 +644,7 @@ def __init__(self, password, generated=False): self.generated = generated def __repr__(self): - return '' + return "" class StorageVolume(UuidMixin): @@ -463,8 +652,16 @@ class StorageVolume(UuidMixin): A base StorageVolume class to derive from. """ - def __init__(self, id, name, size, driver, - state=None, extra=None): + def __init__( + self, + id, # type: str + name, # type: str + size, # type: int + driver, # type: NodeDriver + state=None, # type: Optional[StorageVolumeState] + extra=None, # type: Optional[Dict] + ): + # type: (...) -> None """ :param id: Storage volume ID. :type id: ``str`` @@ -494,12 +691,15 @@ def __init__(self, id, name, size, driver, UuidMixin.__init__(self) def list_snapshots(self): + # type: () -> List[VolumeSnapshot] """ :rtype: ``list`` of ``VolumeSnapshot`` """ + return self.driver.list_volume_snapshots(volume=self) def attach(self, node, device=None): + # type: (Node, Optional[str]) -> bool """ Attach this volume to a node. @@ -517,6 +717,7 @@ def attach(self, node, device=None): return self.driver.attach_volume(node=node, volume=self, device=device) def detach(self): + # type: () -> bool """ Detach this volume from its node @@ -527,15 +728,18 @@ def detach(self): return self.driver.detach_volume(volume=self) def snapshot(self, name): + # type: (str) -> VolumeSnapshot """ Creates a snapshot of this volume. :return: Created snapshot. :rtype: ``VolumeSnapshot`` """ + return self.driver.create_volume_snapshot(volume=self, name=name) def destroy(self): + # type: () -> bool """ Destroy this storage volume. @@ -546,15 +750,29 @@ def destroy(self): return self.driver.destroy_volume(volume=self) def __repr__(self): - return '' % ( - self.id, self.size, self.driver.name) + return "".format( + self.id, + self.size, + self.driver.name, + ) -class VolumeSnapshot(object): +class VolumeSnapshot: """ A base VolumeSnapshot class to derive from. """ - def __init__(self, id, driver, size=None, extra=None, created=None): + + def __init__( + self, + id, # type: str + driver, # type: NodeDriver + size=None, # type: Optional[int] + extra=None, # type: Optional[Dict] + created=None, # type: Optional[datetime.datetime] + state=None, # type: Optional[StorageVolumeState] + name=None, # type: Optional[str] + ): + # type: (...) -> None """ VolumeSnapshot constructor. @@ -574,33 +792,57 @@ def __init__(self, id, driver, size=None, extra=None, created=None): :param created: A datetime object that represents when the snapshot was created :type created: ``datetime.datetime`` + + :param state: A string representing the state the snapshot is + in. See `libcloud.compute.types.StorageVolumeState`. + :type state: ``StorageVolumeState`` + + :param name: A string representing the name of the snapshot + :type name: ``str`` """ self.id = id self.driver = driver self.size = size self.extra = extra or {} self.created = created + self.state = state + self.name = name def destroy(self): + # type: () -> bool """ Destroys this snapshot. :rtype: ``bool`` """ + return self.driver.destroy_volume_snapshot(snapshot=self) def __repr__(self): - return ('' % - (self.id, self.size, self.driver.name)) + return ''.format( + self.name, + self.id, + self.size, + self.driver.name, + self.state, + ) -class KeyPair(object): +class KeyPair: """ Represents a SSH key pair. """ - def __init__(self, name, public_key, fingerprint, driver, private_key=None, - extra=None): + def __init__( + self, + name, # type: str + public_key, # type: str + fingerprint, # type: str + driver, # type: NodeDriver + private_key=None, # type: Optional[str] + extra=None, # type: Optional[Dict] + ): + # type: (...) -> None """ Constructor. @@ -628,8 +870,11 @@ def __init__(self, name, public_key, fingerprint, driver, private_key=None, self.extra = extra or {} def __repr__(self): - return ('' % - (self.name, self.fingerprint, self.driver.name)) + return "".format( + self.name, + self.fingerprint, + self.driver.name, + ) class NodeDriver(BaseDriver): @@ -639,14 +884,15 @@ class NodeDriver(BaseDriver): This class is always subclassed by a specific driver. For examples of base behavior of most functions (except deploy node) see the dummy driver. - """ - connectionCls = ConnectionKey - name = None - type = None - port = None - features = {'create_node': []} + connectionCls = ConnectionKey # type: Type[Connection] + name = None # type: str + api_name = None # type: str + website = None # type: str + type = None # type: Union[Provider,str] + port = None # type: int + features = {"create_node": []} # type: Dict[str, List[str]] """ List of available features for a driver. @@ -660,25 +906,20 @@ class NodeDriver(BaseDriver): object returned from creation. """ - NODE_STATE_MAP = {} + NODE_STATE_MAP = {} # type: Dict[str, NodeState] - def __init__(self, key, secret=None, secure=True, host=None, port=None, - api_version=None, **kwargs): - super(NodeDriver, self).__init__(key=key, secret=secret, secure=secure, - host=host, port=port, - api_version=api_version, **kwargs) - - def list_nodes(self): + def list_nodes(self, *args, **kwargs): + # type: (Any, Any) -> List[Node] """ List all nodes. :return: list of node objects :rtype: ``list`` of :class:`.Node` """ - raise NotImplementedError( - 'list_nodes not implemented for this driver') + raise NotImplementedError("list_nodes not implemented for this driver") def list_sizes(self, location=None): + # type: (Optional[NodeLocation]) -> List[NodeSize] """ List sizes on a provider @@ -688,20 +929,27 @@ def list_sizes(self, location=None): :return: list of node size objects :rtype: ``list`` of :class:`.NodeSize` """ - raise NotImplementedError( - 'list_sizes not implemented for this driver') + raise NotImplementedError("list_sizes not implemented for this driver") def list_locations(self): + # type: () -> List[NodeLocation] """ List data centers for a provider :return: list of node location objects :rtype: ``list`` of :class:`.NodeLocation` """ - raise NotImplementedError( - 'list_locations not implemented for this driver') + raise NotImplementedError("list_locations not implemented for this driver") - def create_node(self, **kwargs): + def create_node( + self, + name, # type: str + size, # type: NodeSize + image, # type: NodeImage + location=None, # type: Optional[NodeLocation] + auth=None, # type: Optional[T_Auth] + ): + # type: (...) -> Node """ Create a new node instance. This instance will be started automatically. @@ -781,10 +1029,26 @@ def create_node(self, **kwargs): :return: The newly created node. :rtype: :class:`.Node` """ - raise NotImplementedError( - 'create_node not implemented for this driver') - - def deploy_node(self, **kwargs): + raise NotImplementedError("create_node not implemented for this driver") + + def deploy_node( + self, + deploy, # type: Deployment + ssh_username="root", # type: str + ssh_alternate_usernames=None, # type: Optional[List[str]] + ssh_port=22, # type: int + ssh_timeout=10, # type: int + ssh_key=None, # type: Optional[T_Ssh_key] + ssh_key_password=None, # type: Optional[str] + auth=None, # type: Optional[T_Auth] + timeout=SSH_CONNECT_TIMEOUT, # type: int + max_tries=3, # type: int + ssh_interface="public_ips", # type: str + at_exit_func=None, # type: Optional[Callable] + wait_period=5, # type: int + **create_node_kwargs, + ): + # type: (...) -> Node """ Create a new node, and start deployment. @@ -858,6 +1122,9 @@ def deploy_node(self, **kwargs): to attempt to authenticate. (optional) :type ssh_key: ``str`` or ``list`` of ``str`` + :param ssh_key_password: Optional password used for encrypted keys. + :type ssh_key_password: ``str`` + :param timeout: How many seconds to wait before timing out. (default is 600) :type timeout: ``int`` @@ -869,87 +1136,164 @@ def deploy_node(self, **kwargs): :param ssh_interface: The interface to wait for. Default is 'public_ips', other option is 'private_ips'. :type ssh_interface: ``str`` + + :param at_exit_func: Optional atexit handler function which will be + registered and called with created node if user + cancels the deploy process (e.g. CTRL+C), after + the node has been created, but before the deploy + process has finished. + + This method gets passed in two keyword arguments: + + - driver -> node driver in question + - node -> created Node object + + Keep in mind that this function will only be + called in such scenario. In case the method + finishes (this includes throwing an exception), + at exit handler function won't be called. + :type at_exit_func: ``func`` + + :param wait_period: How many seconds to wait between each iteration + while waiting for node to transition into + running state and have IP assigned. (default is 5) + :type wait_period: ``int`` + """ + if not libcloud.compute.ssh.have_paramiko: - raise RuntimeError('paramiko is not installed. You can install ' + - 'it using pip: pip install paramiko') + raise RuntimeError( + "paramiko is not installed. You can install " + "it using pip: pip install paramiko" + ) - if 'auth' in kwargs: - auth = kwargs['auth'] + if auth: if not isinstance(auth, (NodeAuthSSHKey, NodeAuthPassword)): raise NotImplementedError( - 'If providing auth, only NodeAuthSSHKey or' - 'NodeAuthPassword is supported') - elif 'ssh_key' in kwargs: + "If providing auth, only NodeAuthSSHKey or" "NodeAuthPassword is supported" + ) + elif ssh_key: # If an ssh_key is provided we can try deploy_node pass - elif 'create_node' in self.features: - f = self.features['create_node'] - if 'generates_password' not in f and "password" not in f: - raise NotImplementedError( - 'deploy_node not implemented for this driver') + elif "create_node" in self.features: + f = self.features["create_node"] + + if "generates_password" not in f and "password" not in f: + raise NotImplementedError("deploy_node not implemented for this driver") else: - raise NotImplementedError( - 'deploy_node not implemented for this driver') + raise NotImplementedError("deploy_node not implemented for this driver") + + # NOTE 1: This is a workaround for legacy code. Sadly a lot of legacy + # code uses **kwargs in "create_node()" method and simply ignores + # "deploy_node()" arguments which are passed to it. + # That's obviously far from idea that's why we first try to pass only + # non-deploy node arguments to the "create_node()" methods and if it + # that doesn't work, fall back to the old approach and simply pass in + # all the arguments + # NOTE 2: Some drivers which use password based SSH authentication + # rely on password being stored on the "auth" argument and that's why + # we also propagate that argument to "create_node()" method. + try: + # NOTE: We only pass auth to the method if auth argument is + # provided - node = self.create_node(**kwargs) - max_tries = kwargs.get('max_tries', 3) + if auth: + node = self.create_node(auth=auth, **create_node_kwargs) + else: + node = self.create_node(**create_node_kwargs) + except TypeError as e: + msg_1_re = r"create_node\(\) missing \d+ required " "positional arguments.*" + msg_2_re = r"create_node\(\) takes at least \d+ arguments.*" + + if re.match(msg_1_re, str(e)) or re.match(msg_2_re, str(e)): + # pylint: disable=unexpected-keyword-arg + node = self.create_node( # type: ignore + deploy=deploy, + ssh_username=ssh_username, + ssh_alternate_usernames=ssh_alternate_usernames, + ssh_port=ssh_port, + ssh_timeout=ssh_timeout, + ssh_key=ssh_key, + auth=auth, + timeout=timeout, + max_tries=max_tries, + ssh_interface=ssh_interface, + **create_node_kwargs, + ) + # pylint: enable=unexpected-keyword-arg + else: + raise e + + if at_exit_func: + atexit.register(at_exit_func, driver=self, node=node) password = None - if 'auth' in kwargs: - if isinstance(kwargs['auth'], NodeAuthPassword): - password = kwargs['auth'].password - elif 'password' in node.extra: - password = node.extra['password'] - ssh_interface = kwargs.get('ssh_interface', 'public_ips') + if auth: + if isinstance(auth, NodeAuthPassword): + password = auth.password + elif "password" in node.extra: + password = node.extra["password"] + + wait_timeout = timeout or NODE_ONLINE_WAIT_TIMEOUT # Wait until node is up and running and has IP assigned try: node, ip_addresses = self.wait_until_running( nodes=[node], - wait_period=3, - timeout=kwargs.get('timeout', NODE_ONLINE_WAIT_TIMEOUT), - ssh_interface=ssh_interface)[0] - except Exception: - e = sys.exc_info()[1] + wait_period=wait_period, + timeout=wait_timeout, + ssh_interface=ssh_interface, + )[0] + except Exception as e: + if at_exit_func: + atexit.unregister(at_exit_func) + raise DeploymentError(node=node, original_exception=e, driver=self) - ssh_username = kwargs.get('ssh_username', 'root') - ssh_alternate_usernames = kwargs.get('ssh_alternate_usernames', []) - ssh_port = kwargs.get('ssh_port', 22) - ssh_timeout = kwargs.get('ssh_timeout', 10) - ssh_key_file = kwargs.get('ssh_key', None) - timeout = kwargs.get('timeout', SSH_CONNECT_TIMEOUT) + ssh_alternate_usernames = ssh_alternate_usernames or [] + deploy_timeout = timeout or SSH_CONNECT_TIMEOUT deploy_error = None - for username in ([ssh_username] + ssh_alternate_usernames): + for username in [ssh_username] + ssh_alternate_usernames: try: self._connect_and_run_deployment_script( - task=kwargs['deploy'], node=node, - ssh_hostname=ip_addresses[0], ssh_port=ssh_port, - ssh_username=username, ssh_password=password, - ssh_key_file=ssh_key_file, ssh_timeout=ssh_timeout, - timeout=timeout, max_tries=max_tries) - except Exception: + task=deploy, + node=node, + ssh_hostname=ip_addresses[0], + ssh_port=ssh_port, + ssh_username=username, + ssh_password=password, + ssh_key_file=ssh_key, + ssh_key_password=ssh_key_password, + ssh_timeout=ssh_timeout, + timeout=deploy_timeout, + max_tries=max_tries, + ) + except Exception as e: # Try alternate username # Todo: Need to fix paramiko so we can catch a more specific # exception - e = sys.exc_info()[1] deploy_error = e else: # Script successfully executed, don't try alternate username deploy_error = None + break if deploy_error is not None: - raise DeploymentError(node=node, original_exception=deploy_error, - driver=self) + if at_exit_func: + atexit.unregister(at_exit_func) + + raise DeploymentError(node=node, original_exception=deploy_error, driver=self) + + if at_exit_func: + atexit.unregister(at_exit_func) return node def reboot_node(self, node): + # type: (Node) -> bool """ Reboot a node. @@ -959,10 +1303,36 @@ def reboot_node(self, node): :return: True if the reboot was successful, otherwise False :rtype: ``bool`` """ - raise NotImplementedError( - 'reboot_node not implemented for this driver') + raise NotImplementedError("reboot_node not implemented for this driver") + + def start_node(self, node): + # type: (Node) -> bool + """ + Start a node. + + :param node: The node to be started + :type node: :class:`.Node` + + :return: True if the start was successful, otherwise False + :rtype: ``bool`` + """ + raise NotImplementedError("start_node not implemented for this driver") + + def stop_node(self, node): + # type: (Node) -> bool + """ + Stop a node + + :param node: The node to be stopped. + :type node: :class:`.Node` + + :return: True if the stop was successful, otherwise False + :rtype: ``bool`` + """ + raise NotImplementedError("stop_node not implemented for this driver") def destroy_node(self, node): + # type: (Node) -> bool """ Destroy a node. @@ -975,32 +1345,38 @@ def destroy_node(self, node): :return: True if the destroy was successful, False otherwise. :rtype: ``bool`` """ - raise NotImplementedError( - 'destroy_node not implemented for this driver') + raise NotImplementedError("destroy_node not implemented for this driver") ## # Volume and snapshot management methods ## def list_volumes(self): + # type: () -> List[StorageVolume] """ List storage volumes. :rtype: ``list`` of :class:`.StorageVolume` """ - raise NotImplementedError( - 'list_volumes not implemented for this driver') + raise NotImplementedError("list_volumes not implemented for this driver") def list_volume_snapshots(self, volume): + # type: (StorageVolume) -> List[VolumeSnapshot] """ List snapshots for a storage volume. :rtype: ``list`` of :class:`VolumeSnapshot` """ - raise NotImplementedError( - 'list_volume_snapshots not implemented for this driver') + raise NotImplementedError("list_volume_snapshots not implemented for this driver") - def create_volume(self, size, name, location=None, snapshot=None): + def create_volume( + self, + size, # type: int + name, # type: str + location=None, # Optional[NodeLocation] + snapshot=None, # Optional[VolumeSnapshot] + ): + # type: (...) -> StorageVolume """ Create a new volume. @@ -1022,25 +1398,25 @@ def create_volume(self, size, name, location=None, snapshot=None): :return: The newly created volume. :rtype: :class:`StorageVolume` """ - raise NotImplementedError( - 'create_volume not implemented for this driver') + raise NotImplementedError("create_volume not implemented for this driver") def create_volume_snapshot(self, volume, name=None): + # type: (StorageVolume, Optional[str]) -> VolumeSnapshot """ Creates a snapshot of the storage volume. :param volume: The StorageVolume to create a VolumeSnapshot from - :type volume: :class:`.VolumeSnapshot` + :type volume: :class:`.StorageVolume` :param name: Name of created snapshot (optional) :type name: `str` :rtype: :class:`VolumeSnapshot` """ - raise NotImplementedError( - 'create_volume_snapshot not implemented for this driver') + raise NotImplementedError("create_volume_snapshot not implemented for this driver") def attach_volume(self, node, volume, device=None): + # type: (Node, StorageVolume, Optional[str]) -> bool """ Attaches volume to node. @@ -1055,9 +1431,10 @@ def attach_volume(self, node, volume, device=None): :rytpe: ``bool`` """ - raise NotImplementedError('attach not implemented for this driver') + raise NotImplementedError("attach not implemented for this driver") def detach_volume(self, volume): + # type: (StorageVolume) -> bool """ Detaches a volume from a node. @@ -1067,9 +1444,10 @@ def detach_volume(self, volume): :rtype: ``bool`` """ - raise NotImplementedError('detach not implemented for this driver') + raise NotImplementedError("detach not implemented for this driver") def destroy_volume(self, volume): + # type: (StorageVolume) -> bool """ Destroys a storage volume. @@ -1079,10 +1457,10 @@ def destroy_volume(self, volume): :rtype: ``bool`` """ - raise NotImplementedError( - 'destroy_volume not implemented for this driver') + raise NotImplementedError("destroy_volume not implemented for this driver") def destroy_volume_snapshot(self, snapshot): + # type: (VolumeSnapshot) -> bool """ Destroys a snapshot. @@ -1091,14 +1469,14 @@ def destroy_volume_snapshot(self, snapshot): :rtype: :class:`bool` """ - raise NotImplementedError( - 'destroy_volume_snapshot not implemented for this driver') + raise NotImplementedError("destroy_volume_snapshot not implemented for this driver") ## # Image management methods ## def list_images(self, location=None): + # type: (Optional[NodeLocation]) -> List[NodeImage] """ List images on a provider. @@ -1108,10 +1486,10 @@ def list_images(self, location=None): :return: list of node image objects. :rtype: ``list`` of :class:`.NodeImage` """ - raise NotImplementedError( - 'list_images not implemented for this driver') + raise NotImplementedError("list_images not implemented for this driver") def create_image(self, node, name, description=None): + # type: (Node, str, Optional[str]) -> List[NodeImage] """ Creates an image from a node object. @@ -1128,10 +1506,10 @@ def create_image(self, node, name, description=None): :return: NodeImage instance on success. """ - raise NotImplementedError( - 'create_image not implemented for this driver') + raise NotImplementedError("create_image not implemented for this driver") def delete_image(self, node_image): + # type: (NodeImage) -> bool """ Deletes a node image from a provider. @@ -1142,23 +1520,23 @@ def delete_image(self, node_image): :rtype: ``bool`` """ - raise NotImplementedError( - 'delete_image not implemented for this driver') + raise NotImplementedError("delete_image not implemented for this driver") def get_image(self, image_id): + # type: (str) -> NodeImage """ Returns a single node image from a provider. - :param image_id: Node to run the task on. + :param image_id: Image identifier. :type image_id: ``str`` - :rtype :class:`.NodeImage`: + :rtype: :class:`.NodeImage` :return: NodeImage instance on success. """ - raise NotImplementedError( - 'get_image not implemented for this driver') + raise NotImplementedError("get_image not implemented for this driver") def copy_image(self, source_region, node_image, name, description=None): + # type: (str, NodeImage, str, Optional[str]) -> NodeImage """ Copies an image from a source region to the current region. @@ -1177,23 +1555,23 @@ def copy_image(self, source_region, node_image, name, description=None): :rtype: :class:`.NodeImage`: :return: NodeImage instance on success. """ - raise NotImplementedError( - 'copy_image not implemented for this driver') + raise NotImplementedError("copy_image not implemented for this driver") ## # SSH key pair management methods ## def list_key_pairs(self): + # type: () -> List[KeyPair] """ List all the available key pair objects. :rtype: ``list`` of :class:`.KeyPair` objects """ - raise NotImplementedError( - 'list_key_pairs not implemented for this driver') + raise NotImplementedError("list_key_pairs not implemented for this driver") def get_key_pair(self, name): + # type: (str) -> KeyPair """ Retrieve a single key pair. @@ -1202,20 +1580,22 @@ def get_key_pair(self, name): :rtype: :class:`.KeyPair` """ - raise NotImplementedError( - 'get_key_pair not implemented for this driver') + raise NotImplementedError("get_key_pair not implemented for this driver") def create_key_pair(self, name): + # type: (str) -> KeyPair """ Create a new key pair object. :param name: Key pair name. :type name: ``str`` + + :rtype: :class:`.KeyPair` object """ - raise NotImplementedError( - 'create_key_pair not implemented for this driver') + raise NotImplementedError("create_key_pair not implemented for this driver") def import_key_pair_from_string(self, name, key_material): + # type: (str, str) -> KeyPair """ Import a new public key from string. @@ -1227,10 +1607,10 @@ def import_key_pair_from_string(self, name, key_material): :rtype: :class:`.KeyPair` object """ - raise NotImplementedError( - 'import_key_pair_from_string not implemented for this driver') + raise NotImplementedError("import_key_pair_from_string not implemented for this driver") def import_key_pair_from_file(self, name, key_file_path): + # type: (str, str) -> KeyPair """ Import a new public key from string. @@ -1244,24 +1624,33 @@ def import_key_pair_from_file(self, name, key_file_path): """ key_file_path = os.path.expanduser(key_file_path) - with open(key_file_path, 'r') as fp: - key_material = fp.read() + with open(key_file_path) as fp: + key_material = fp.read().strip() - return self.import_key_pair_from_string(name=name, - key_material=key_material) + return self.import_key_pair_from_string(name=name, key_material=key_material) def delete_key_pair(self, key_pair): + # type: (KeyPair) -> bool """ Delete an existing key pair. :param key_pair: Key pair object. :type key_pair: :class:`.KeyPair` + + :rtype: ``bool`` """ - raise NotImplementedError( - 'delete_key_pair not implemented for this driver') + raise NotImplementedError("delete_key_pair not implemented for this driver") - def wait_until_running(self, nodes, wait_period=3, timeout=600, - ssh_interface='public_ips', force_ipv4=True): + def wait_until_running( + self, + nodes, # type: List[Node] + wait_period=5, # type: float + timeout=600, # type: int + ssh_interface="public_ips", # type: str + force_ipv4=True, # type: bool + ex_list_nodes_kwargs=None, # type: Optional[Dict] + ): + # type: (...) -> List[Tuple[Node, List[str]]] """ Block until the provided nodes are considered running. @@ -1287,61 +1676,77 @@ def wait_until_running(self, nodes, wait_period=3, timeout=600, :param force_ipv4: Ignore IPv6 addresses (default is True). :type force_ipv4: ``bool`` + :param ex_list_nodes_kwargs: Optional driver-specific keyword arguments + which are passed to the ``list_nodes`` + method. + :type ex_list_nodes_kwargs: ``dict`` + :return: ``[(Node, ip_addresses)]`` list of tuple of Node instance and list of ip_address on success. :rtype: ``list`` of ``tuple`` """ + ex_list_nodes_kwargs = ex_list_nodes_kwargs or {} + def is_supported(address): + # type: (str) -> bool """ Return True for supported address. """ - if force_ipv4 and not is_valid_ip_address(address=address, - family=socket.AF_INET): + + if force_ipv4 and not is_valid_ip_address(address=address, family=socket.AF_INET): return False + return True def filter_addresses(addresses): + # type: (List[str]) -> List[str] """ Return list of supported addresses. """ + return [address for address in addresses if is_supported(address)] - if ssh_interface not in ['public_ips', 'private_ips']: - raise ValueError('ssh_interface argument must either be' + - 'public_ips or private_ips') + if ssh_interface not in ["public_ips", "private_ips"]: + raise ValueError("ssh_interface argument must either be " + "public_ips or private_ips") start = time.time() end = start + timeout - uuids = set([node.uuid for node in nodes]) + uuids = {node.uuid for node in nodes} while time.time() < end: - all_nodes = self.list_nodes() - matching_nodes = list([node for node in all_nodes - if node.uuid in uuids]) + all_nodes = self.list_nodes(**ex_list_nodes_kwargs) + matching_nodes = list(node for node in all_nodes if node.uuid in uuids) if len(matching_nodes) > len(uuids): found_uuids = [node.uuid for node in matching_nodes] - msg = ('Unable to match specified uuids ' + - '(%s) with existing nodes. Found ' % (uuids) + - 'multiple nodes with same uuid: (%s)' % (found_uuids)) + msg = ( + "Unable to match specified uuids " + + "(%s) with existing nodes. Found " % (uuids) + + "multiple nodes with same uuid: (%s)" % (found_uuids) + ) raise LibcloudError(value=msg, driver=self) - running_nodes = [node for node in matching_nodes - if node.state == NodeState.RUNNING] - addresses = [filter_addresses(getattr(node, ssh_interface)) - for node in running_nodes] + running_nodes = [node for node in matching_nodes if node.state == NodeState.RUNNING] + addresses = [] + + for node in running_nodes: + node_addresses = filter_addresses(getattr(node, ssh_interface)) + + if len(node_addresses) >= 1: + addresses.append(node_addresses) if len(running_nodes) == len(uuids) == len(addresses): return list(zip(running_nodes, addresses)) else: time.sleep(wait_period) + continue - raise LibcloudError(value='Timed out after %s seconds' % (timeout), - driver=self) + raise LibcloudError(value="Timed out after %s seconds" % (timeout), driver=self) def _get_and_check_auth(self, auth): + # type: (T_Auth) -> T_Auth """ Helper function for providers supporting :class:`.NodeAuthPassword` or :class:`.NodeAuthSSHKey` @@ -1354,26 +1759,29 @@ def _get_and_check_auth(self, auth): """ if isinstance(auth, NodeAuthPassword): - if 'password' in self.features['create_node']: + if "password" in self.features["create_node"]: return auth raise LibcloudError( - 'Password provided as authentication information, but password' - 'not supported', driver=self) + "Password provided as authentication information, but password" "not supported", + driver=self, + ) if isinstance(auth, NodeAuthSSHKey): - if 'ssh_key' in self.features['create_node']: + if "ssh_key" in self.features["create_node"]: return auth raise LibcloudError( - 'SSH Key provided as authentication information, but SSH Key' - 'not supported', driver=self) + "SSH Key provided as authentication information, but SSH Key" "not supported", + driver=self, + ) - if 'password' in self.features['create_node']: + if "password" in self.features["create_node"]: value = os.urandom(16) - value = binascii.hexlify(value).decode('ascii') + value = binascii.hexlify(value).decode("ascii") # Some providers require password to also include uppercase # characters so convert some characters to uppercase - password = '' + password = "" + for char in value: if not char.isdigit() and char.islower(): if random.randint(0, 1) == 1: @@ -1386,18 +1794,32 @@ def _get_and_check_auth(self, auth): if auth: raise LibcloudError( '"auth" argument provided, but it was not a NodeAuthPassword' - 'or NodeAuthSSHKey object', driver=self) - - def _wait_until_running(self, node, wait_period=3, timeout=600, - ssh_interface='public_ips', force_ipv4=True): + "or NodeAuthSSHKey object", + driver=self, + ) + + def _wait_until_running( + self, + node, + wait_period=3, + timeout=600, + ssh_interface="public_ips", + force_ipv4=True, + ): + # type: (Node, float, int, str, bool) -> List[Tuple[Node, List[str]]] # This is here for backward compatibility and will be removed in the # next major release - return self.wait_until_running(nodes=[node], wait_period=wait_period, - timeout=timeout, - ssh_interface=ssh_interface, - force_ipv4=force_ipv4) + + return self.wait_until_running( + nodes=[node], + wait_period=wait_period, + timeout=timeout, + ssh_interface=ssh_interface, + force_ipv4=force_ipv4, + ) def _ssh_client_connect(self, ssh_client, wait_period=1.5, timeout=300): + # type: (BaseSSHClient, float, int) -> BaseSSHClient """ Try to connect to the remote SSH server. If a connection times out or is refused it is retried up to timeout number of seconds. @@ -1421,30 +1843,49 @@ def _ssh_client_connect(self, ssh_client, wait_period=1.5, timeout=300): while time.time() < end: try: ssh_client.connect() - except SSH_TIMEOUT_EXCEPTION_CLASSES: - e = sys.exc_info()[1] + except SSH_TIMEOUT_EXCEPTION_CLASSES as e: + # Errors which represent fatal invalid key files which should + # be propagated to the user without us retrying message = str(e).lower() - expected_msg = 'no such file or directory' - if isinstance(e, IOError) and expected_msg in message: - # Propagate (key) file doesn't exist errors - raise e + for fatal_msg in SSH_FATAL_ERROR_MSGS: + if fatal_msg in message: + raise e # Retry if a connection is refused, timeout occurred, # or the connection fails due to failed authentication. - ssh_client.close() + try: + ssh_client.close() + except Exception: + # Exception on close() should not be fatal since client + # socket might already be closed + pass + time.sleep(wait_period) + continue else: return ssh_client - raise LibcloudError(value='Could not connect to the remote SSH ' + - 'server. Giving up.', driver=self) - - def _connect_and_run_deployment_script(self, task, node, ssh_hostname, - ssh_port, ssh_username, - ssh_password, ssh_key_file, - ssh_timeout, timeout, max_tries): + raise LibcloudError( + value="Could not connect to the remote SSH " + "server. Giving up.", + driver=self, + ) + + def _connect_and_run_deployment_script( + self, + task, # type: Deployment + node, # type: Node + ssh_hostname, # type: str + ssh_port, # type: int + ssh_username, # type: str + ssh_password, # type: Optional[str] + ssh_key_file, # type: Optional[T_Ssh_key] + ssh_key_password, # type: Optional[str] + ssh_timeout, # type: int + timeout, # type: int + max_tries, # type: int + ): """ Establish an SSH connection to the node and run the provided deployment task. @@ -1452,22 +1893,26 @@ def _connect_and_run_deployment_script(self, task, node, ssh_hostname, :rtype: :class:`.Node`: :return: Node instance on success. """ - ssh_client = SSHClient(hostname=ssh_hostname, - port=ssh_port, username=ssh_username, - password=ssh_password, - key_files=ssh_key_file, - timeout=ssh_timeout) + ssh_client = SSHClient( + hostname=ssh_hostname, + port=ssh_port, + username=ssh_username, + password=ssh_key_password or ssh_password, + key_files=ssh_key_file, + timeout=ssh_timeout, + ) - ssh_client = self._ssh_client_connect(ssh_client=ssh_client, - timeout=timeout) + ssh_client = self._ssh_client_connect(ssh_client=ssh_client, timeout=timeout) # Execute the deployment task - node = self._run_deployment_script(task=task, node=node, - ssh_client=ssh_client, - max_tries=max_tries) + node = self._run_deployment_script( + task=task, node=node, ssh_client=ssh_client, max_tries=max_tries + ) + return node def _run_deployment_script(self, task, node, ssh_client, max_tries=3): + # type: (Deployment, Node, BaseSSHClient, int) -> Node """ Run the deployment script on the provided node. At this point it is assumed that SSH connection has already been established. @@ -1493,27 +1938,51 @@ def _run_deployment_script(self, task, node, ssh_client, max_tries=3): while tries < max_tries: try: node = task.run(node, ssh_client) - except Exception: + except SSHCommandTimeoutError as e: + # Command timeout exception is fatal so we don't retry it. + raise e + except Exception as e: tries += 1 + if "ssh session not active" in str(e).lower(): + # Sometimes connection gets closed or disconnected half + # way through for whatever reason. + # If this happens, we try to re-connect before + # re-attempting to run the step. + try: + ssh_client.close() + except Exception: + # Non fatal since connection is most likely already + # closed at this point + pass + + timeout = int(ssh_client.timeout) if ssh_client.timeout else 10 + ssh_client = self._ssh_client_connect(ssh_client=ssh_client, timeout=timeout) + if tries >= max_tries: - e = sys.exc_info()[1] - raise LibcloudError(value='Failed after %d tries: %s' - % (max_tries, str(e)), driver=self) + tb = traceback.format_exc() + raise LibcloudError( + value="Failed after %d tries: %s.\n%s" % (max_tries, str(e), tb), + driver=self, + ) else: # Deployment succeeded ssh_client.close() + return node + return node + def _get_size_price(self, size_id): + # type: (str) -> Optional[float] """ Return pricing information for the provided size id. """ - return get_size_price(driver_type='compute', - driver_name=self.api_name, - size_id=size_id) + return get_size_price(driver_type="compute", driver_name=self.api_name, size_id=size_id) -if __name__ == '__main__': + +if __name__ == "__main__": import doctest + doctest.testmod() diff --git a/libcloud/compute/constants/__init__.py b/libcloud/compute/constants/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/compute/constants/ec2_instance_types.py b/libcloud/compute/constants/ec2_instance_types.py new file mode 100644 index 0000000000..4fd4262a2c --- /dev/null +++ b/libcloud/compute/constants/ec2_instance_types.py @@ -0,0 +1,28578 @@ +# File generated by contrib/scrape-ec2-sizes.py script - DO NOT EDIT manually +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +INSTANCE_TYPES = { + "a1.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "a1.2xlarge", + "instancesku": "A6PYBM8K8FAMKCGJ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "a1.2xlarge", + "name": "a1.2xlarge", + "ram": 16384, + }, + "a1.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "a1.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "a1.4xlarge", + "name": "a1.4xlarge", + "ram": 32768, + }, + "a1.large": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "a1.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "a1.large", + "name": "a1.large", + "ram": 4096, + }, + "a1.medium": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "a1.medium", + "instancesku": "6H6ECBH6BV59BRSN", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "a1.medium", + "name": "a1.medium", + "ram": 2048, + }, + "a1.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "a1.xlarge", + "instancesku": "MPNJUDSDMWJQYKGQ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "a1.xlarge", + "name": "a1.xlarge", + "ram": 8192, + }, + "c1.medium": { + "bandwidth": None, + "disk": 350, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "currentGeneration": "No", + "ecu": "5", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c1.medium", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1.7 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "2", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "32-bit or 64-bit", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 350 SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c1.medium", + "name": "c1.medium", + "ram": 1740, + }, + "c1.xlarge": { + "bandwidth": None, + "disk": 1680, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "currentGeneration": "No", + "ecu": "20", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c1.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "7 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 420 SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c1.xlarge", + "name": "c1.xlarge", + "ram": 7168, + }, + "c3.2xlarge": { + "bandwidth": None, + "disk": 160, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.8 GHz", + "currentGeneration": "No", + "ecu": "28", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c3.2xlarge", + "instancesku": "YCNS7SECEMFTZFYH", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "15 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2680 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 80 SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c3.2xlarge", + "name": "c3.2xlarge", + "ram": 15360, + }, + "c3.4xlarge": { + "bandwidth": None, + "disk": 320, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.8 GHz", + "currentGeneration": "No", + "ecu": "55", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c3.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "30 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon E5-2680 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 160 SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c3.4xlarge", + "name": "c3.4xlarge", + "ram": 30720, + }, + "c3.8xlarge": { + "bandwidth": 10, + "disk": 640, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.8 GHz", + "currentGeneration": "No", + "ecu": "108", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c3.8xlarge", + "instancesku": "FKFNCVGF8F4VBXQ4", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "60 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2680 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 320 SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c3.8xlarge", + "name": "c3.8xlarge", + "ram": 61440, + }, + "c3.large": { + "bandwidth": None, + "disk": 32, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.8 GHz", + "currentGeneration": "No", + "ecu": "7", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c3.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "3.75 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon E5-2680 v2 (Ivy Bridge)", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 16 SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c3.large", + "name": "c3.large", + "ram": 3840, + }, + "c3.xlarge": { + "bandwidth": None, + "disk": 80, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.8 GHz", + "currentGeneration": "No", + "ecu": "14", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c3.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "7.5 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon E5-2680 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 40 SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c3.xlarge", + "name": "c3.xlarge", + "ram": 7680, + }, + "c4.2xlarge": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "1000 Mbps", + "ecu": "31", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c4.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "15 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2666 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c4.2xlarge", + "name": "c4.2xlarge", + "ram": 15360, + }, + "c4.4xlarge": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2000 Mbps", + "ecu": "62", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c4.4xlarge", + "instancesku": "RGU9HRNUAS2TX83W", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "30 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon E5-2666 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c4.4xlarge", + "name": "c4.4xlarge", + "ram": 30720, + }, + "c4.8xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4000 Mbps", + "ecu": "132", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c4.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "60 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2666 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "36", + "vpcnetworkingsupport": "true", + }, + "id": "c4.8xlarge", + "name": "c4.8xlarge", + "ram": 61440, + }, + "c4.large": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "500 Mbps", + "ecu": "8", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c4.large", + "instancesku": "TX5YYKC8NVXPN43D", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "3.75 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon E5-2666 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c4.large", + "name": "c4.large", + "ram": 3840, + }, + "c4.xlarge": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "750 Mbps", + "ecu": "16", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c4.xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "7.5 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon E5-2666 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c4.xlarge", + "name": "c4.xlarge", + "ram": 7680, + }, + "c5.12xlarge": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "188", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5.12xlarge", + "instancesku": "B2D6JZJWM7HPMFFP", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8275L", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Deep Learning Boost; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c5.12xlarge", + "name": "c5.12xlarge", + "ram": 98304, + }, + "c5.18xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9000 Mbps", + "ecu": "281", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5.18xlarge", + "instancesku": "H2XX5A4Y823VVMXZ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "144 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "144", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "72", + "vpcnetworkingsupport": "true", + }, + "id": "c5.18xlarge", + "name": "c5.18xlarge", + "ram": 147456, + }, + "c5.24xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "375", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5.24xlarge", + "instancesku": "GB2CVQJXDU9FR8GT", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8275L", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Deep Learning Boost; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "c5.24xlarge", + "name": "c5.24xlarge", + "ram": 196608, + }, + "c5.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2250 Mbps", + "ecu": "39", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5.2xlarge", + "instancesku": "A5V9YQVUZMY5XA83", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c5.2xlarge", + "name": "c5.2xlarge", + "ram": 16384, + }, + "c5.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2250 Mbps", + "ecu": "73", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c5.4xlarge", + "name": "c5.4xlarge", + "ram": 32768, + }, + "c5.9xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4500 Mbps", + "ecu": "139", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5.9xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "72 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "72", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "36", + "vpcnetworkingsupport": "true", + }, + "id": "c5.9xlarge", + "name": "c5.9xlarge", + "ram": 73728, + }, + "c5.large": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2250 Mbps", + "ecu": "10", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c5.large", + "name": "c5.large", + "ram": 4096, + }, + "c5.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2250 Mbps", + "ecu": "20", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5.xlarge", + "instancesku": "K6WNSK6Q2CWEYGHX", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c5.xlarge", + "name": "c5.xlarge", + "ram": 8192, + }, + "c5a.12xlarge": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4750 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5a.12xlarge", + "instancesku": "EGSVE9S2NJJWJ3SC", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c5a.12xlarge", + "name": "c5a.12xlarge", + "ram": 98304, + }, + "c5a.16xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "6300 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5a.16xlarge", + "instancesku": "3YMAUTFQ8JZCV6VS", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c5a.16xlarge", + "name": "c5a.16xlarge", + "ram": 131072, + }, + "c5a.24xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5a.24xlarge", + "instancesku": "DPHJ9PS8GF7ZRFEF", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "c5a.24xlarge", + "name": "c5a.24xlarge", + "ram": 196608, + }, + "c5a.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5a.2xlarge", + "instancesku": "F4FFZANT2KEGQPZU", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c5a.2xlarge", + "name": "c5a.2xlarge", + "ram": 16384, + }, + "c5a.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5a.4xlarge", + "instancesku": "FXZCY68C879B2BXD", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c5a.4xlarge", + "name": "c5a.4xlarge", + "ram": 32768, + }, + "c5a.8xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5a.8xlarge", + "instancesku": "2MVSRPHH92E3542M", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c5a.8xlarge", + "name": "c5a.8xlarge", + "ram": 65536, + }, + "c5a.large": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5a.large", + "instancesku": "TPQTDU7RNDMJK6KP", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c5a.large", + "name": "c5a.large", + "ram": 4096, + }, + "c5a.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5a.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c5a.xlarge", + "name": "c5a.xlarge", + "ram": 8192, + }, + "c5ad.12xlarge": { + "bandwidth": 12, + "disk": 1800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4750 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5ad.12xlarge", + "instancesku": "FXDEW36Z8YRSGM2S", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 900 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c5ad.12xlarge", + "name": "c5ad.12xlarge", + "ram": 98304, + }, + "c5ad.16xlarge": { + "bandwidth": 20, + "disk": 2400, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "6300 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5ad.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1200 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c5ad.16xlarge", + "name": "c5ad.16xlarge", + "ram": 131072, + }, + "c5ad.24xlarge": { + "bandwidth": 20, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5ad.24xlarge", + "instancesku": "NKHYKUFYUFS54VHC", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "c5ad.24xlarge", + "name": "c5ad.24xlarge", + "ram": 196608, + }, + "c5ad.2xlarge": { + "bandwidth": 10, + "disk": 300, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5ad.2xlarge", + "instancesku": "34Z2EYXRD347K3SA", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 300 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c5ad.2xlarge", + "name": "c5ad.2xlarge", + "ram": 16384, + }, + "c5ad.4xlarge": { + "bandwidth": 10, + "disk": 600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5ad.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 300 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c5ad.4xlarge", + "name": "c5ad.4xlarge", + "ram": 32768, + }, + "c5ad.8xlarge": { + "bandwidth": 10, + "disk": 1200, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5ad.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 600 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c5ad.8xlarge", + "name": "c5ad.8xlarge", + "ram": 65536, + }, + "c5ad.large": { + "bandwidth": 10, + "disk": 75, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5ad.large", + "instancesku": "HT8MSHND4S9PP8YT", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 75 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c5ad.large", + "name": "c5ad.large", + "ram": 4096, + }, + "c5ad.xlarge": { + "bandwidth": 10, + "disk": 150, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5ad.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 150 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c5ad.xlarge", + "name": "c5ad.xlarge", + "ram": 8192, + }, + "c5d.12xlarge": { + "bandwidth": 12, + "disk": 1800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "188", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5d.12xlarge", + "instancesku": "SYZAEXP42ASXK43Y", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8275L", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Deep Learning Boost; Intel Turbo", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 900 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c5d.12xlarge", + "name": "c5d.12xlarge", + "ram": 98304, + }, + "c5d.18xlarge": { + "bandwidth": 25, + "disk": 1800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9000 Mbps", + "ecu": "281", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5d.18xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "144 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "144", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 900 NVMe SSD", + "vcpu": "72", + "vpcnetworkingsupport": "true", + }, + "id": "c5d.18xlarge", + "name": "c5d.18xlarge", + "ram": 147456, + }, + "c5d.24xlarge": { + "bandwidth": 25, + "disk": 3600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "375", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5d.24xlarge", + "instancesku": "CBCNASX9DSMBPMQW", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8275L", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Deep Learning Boost; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 900 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "c5d.24xlarge", + "name": "c5d.24xlarge", + "ram": 196608, + }, + "c5d.2xlarge": { + "bandwidth": 10, + "disk": 200, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2250 Mbps", + "ecu": "39", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5d.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 200 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c5d.2xlarge", + "name": "c5d.2xlarge", + "ram": 16384, + }, + "c5d.4xlarge": { + "bandwidth": 10, + "disk": 400, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2250 Mbps", + "ecu": "73", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5d.4xlarge", + "instancesku": "FUGNF8J88PBAQDYT", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 400 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c5d.4xlarge", + "name": "c5d.4xlarge", + "ram": 32768, + }, + "c5d.9xlarge": { + "bandwidth": 10, + "disk": 900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4500 Mbps", + "ecu": "139", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5d.9xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "72 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "72", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 900 NVMe SSD", + "vcpu": "36", + "vpcnetworkingsupport": "true", + }, + "id": "c5d.9xlarge", + "name": "c5d.9xlarge", + "ram": 73728, + }, + "c5d.large": { + "bandwidth": 10, + "disk": 50, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2250 Mbps", + "ecu": "10", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5d.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 50 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c5d.large", + "name": "c5d.large", + "ram": 4096, + }, + "c5d.xlarge": { + "bandwidth": 10, + "disk": 100, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2250 Mbps", + "ecu": "20", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5d.xlarge", + "instancesku": "BEKRK57J4EHTR2VJ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 100 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c5d.xlarge", + "name": "c5d.xlarge", + "ram": 8192, + }, + "c5n.18xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "281", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5n.18xlarge", + "instancesku": "4VUXUHRQ7ZTHKVDG", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "144", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "72", + "vpcnetworkingsupport": "true", + }, + "id": "c5n.18xlarge", + "name": "c5n.18xlarge", + "ram": 196608, + }, + "c5n.2xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "39", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5n.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "21 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c5n.2xlarge", + "name": "c5n.2xlarge", + "ram": 21504, + }, + "c5n.4xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "73", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5n.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "42 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c5n.4xlarge", + "name": "c5n.4xlarge", + "ram": 43008, + }, + "c5n.9xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "139", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5n.9xlarge", + "instancesku": "R6T5FWW48CMRQ55E", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "72", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "36", + "vpcnetworkingsupport": "true", + }, + "id": "c5n.9xlarge", + "name": "c5n.9xlarge", + "ram": 98304, + }, + "c5n.large": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "10", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5n.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "5.25 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c5n.large", + "name": "c5n.large", + "ram": 5376, + }, + "c5n.xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "20", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c5n.xlarge", + "instancesku": "9S2WRMC8XXXDEGVU", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "10.5 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8124M", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c5n.xlarge", + "name": "c5n.xlarge", + "ram": 10752, + }, + "c6a.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6a.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c6a.12xlarge", + "name": "c6a.12xlarge", + "ram": 98304, + }, + "c6a.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "13333 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6a.16xlarge", + "instancesku": "RS7S28QKZJKJSZNJ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c6a.16xlarge", + "name": "c6a.16xlarge", + "ram": 131072, + }, + "c6a.24xlarge": { + "bandwidth": 37500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6a.24xlarge", + "instancesku": "8ZKSQWSAQGRJ5U9F", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "c6a.24xlarge", + "name": "c6a.24xlarge", + "ram": 196608, + }, + "c6a.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6a.2xlarge", + "instancesku": "GFUW4QDP4XTQR6QV", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c6a.2xlarge", + "name": "c6a.2xlarge", + "ram": 16384, + }, + "c6a.32xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "26667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6a.32xlarge", + "instancesku": "5N3P5DVUANCGQA54", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "c6a.32xlarge", + "name": "c6a.32xlarge", + "ram": 262144, + }, + "c6a.48xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6a.48xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "c6a.48xlarge", + "name": "c6a.48xlarge", + "ram": 393216, + }, + "c6a.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6a.4xlarge", + "instancesku": "Z8JWH2QQ3K4VX624", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c6a.4xlarge", + "name": "c6a.4xlarge", + "ram": 32768, + }, + "c6a.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6a.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c6a.8xlarge", + "name": "c6a.8xlarge", + "ram": 65536, + }, + "c6a.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6a.large", + "instancesku": "RR9ZPGTHWWC4U5NQ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c6a.large", + "name": "c6a.large", + "ram": 4096, + }, + "c6a.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6a.xlarge", + "instancesku": "A32CS95FPD6HAU69", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c6a.xlarge", + "name": "c6a.xlarge", + "ram": 8192, + }, + "c6g.12xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "13500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6g.12xlarge", + "instancesku": "AY5FPVXQ2UDEUWN3", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c6g.12xlarge", + "name": "c6g.12xlarge", + "ram": 98304, + }, + "c6g.16xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6g.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c6g.16xlarge", + "name": "c6g.16xlarge", + "ram": 131072, + }, + "c6g.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6g.2xlarge", + "instancesku": "64UAZ5JQ6EFAVPMB", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c6g.2xlarge", + "name": "c6g.2xlarge", + "ram": 16384, + }, + "c6g.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6g.4xlarge", + "instancesku": "MFVUP7HCAZXZGZ4E", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c6g.4xlarge", + "name": "c6g.4xlarge", + "ram": 32768, + }, + "c6g.8xlarge": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6g.8xlarge", + "instancesku": "PB5P6ZJYNWR2SRGE", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c6g.8xlarge", + "name": "c6g.8xlarge", + "ram": 65536, + }, + "c6g.large": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6g.large", + "instancesku": "6PQ4U29URPRQ2MYZ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c6g.large", + "name": "c6g.large", + "ram": 4096, + }, + "c6g.medium": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6g.medium", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "c6g.medium", + "name": "c6g.medium", + "ram": 2048, + }, + "c6g.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6g.xlarge", + "instancesku": "URHNUKBP5VQJSGKX", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c6g.xlarge", + "name": "c6g.xlarge", + "ram": 8192, + }, + "c6gd.12xlarge": { + "bandwidth": 20, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "13500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gd.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c6gd.12xlarge", + "name": "c6gd.12xlarge", + "ram": 98304, + }, + "c6gd.16xlarge": { + "bandwidth": 25, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "18000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gd.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c6gd.16xlarge", + "name": "c6gd.16xlarge", + "ram": 131072, + }, + "c6gd.2xlarge": { + "bandwidth": 10, + "disk": 475, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gd.2xlarge", + "instancesku": "TDQ7AUJRCKNXMPDK", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 475 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c6gd.2xlarge", + "name": "c6gd.2xlarge", + "ram": 16384, + }, + "c6gd.4xlarge": { + "bandwidth": 10, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gd.4xlarge", + "instancesku": "5BHRV5TW4H89DRKT", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c6gd.4xlarge", + "name": "c6gd.4xlarge", + "ram": 32768, + }, + "c6gd.8xlarge": { + "bandwidth": 12, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gd.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c6gd.8xlarge", + "name": "c6gd.8xlarge", + "ram": 65536, + }, + "c6gd.large": { + "bandwidth": 10, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gd.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c6gd.large", + "name": "c6gd.large", + "ram": 4096, + }, + "c6gd.medium": { + "bandwidth": 10, + "disk": 59, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gd.medium", + "instancesku": "YE6EEQZMKGT4KERM", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 59 NVMe SSD", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "c6gd.medium", + "name": "c6gd.medium", + "ram": 2048, + }, + "c6gd.xlarge": { + "bandwidth": 10, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gd.xlarge", + "instancesku": "GGZTRMP3FBJ7M5QD", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c6gd.xlarge", + "name": "c6gd.xlarge", + "ram": 8192, + }, + "c6gn.12xlarge": { + "bandwidth": 75, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "28500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gn.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "75 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c6gn.12xlarge", + "name": "c6gn.12xlarge", + "ram": 98304, + }, + "c6gn.16xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "38000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gn.16xlarge", + "instancesku": "Y9DP6NNEHBSYS443", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c6gn.16xlarge", + "name": "c6gn.16xlarge", + "ram": 131072, + }, + "c6gn.2xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gn.2xlarge", + "instancesku": "M6MVR7VW6XTWPHQ5", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c6gn.2xlarge", + "name": "c6gn.2xlarge", + "ram": 16384, + }, + "c6gn.4xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gn.4xlarge", + "instancesku": "5472CKGEUNZGUDSP", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c6gn.4xlarge", + "name": "c6gn.4xlarge", + "ram": 32768, + }, + "c6gn.8xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gn.8xlarge", + "instancesku": "NX8CJEX2JY5HXHQR", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c6gn.8xlarge", + "name": "c6gn.8xlarge", + "ram": 65536, + }, + "c6gn.large": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gn.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c6gn.large", + "name": "c6gn.large", + "ram": 4096, + }, + "c6gn.medium": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gn.medium", + "instancesku": "KETXG4986RNYCQJ8", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "c6gn.medium", + "name": "c6gn.medium", + "ram": 2048, + }, + "c6gn.xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6gn.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c6gn.xlarge", + "name": "c6gn.xlarge", + "ram": 8192, + }, + "c6i.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6i.12xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c6i.12xlarge", + "name": "c6i.12xlarge", + "ram": 98304, + }, + "c6i.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6i.16xlarge", + "instancesku": "U2QZS64THC8FN76P", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c6i.16xlarge", + "name": "c6i.16xlarge", + "ram": 131072, + }, + "c6i.24xlarge": { + "bandwidth": 37500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6i.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "c6i.24xlarge", + "name": "c6i.24xlarge", + "ram": 196608, + }, + "c6i.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6i.2xlarge", + "instancesku": "BQT6TD2YB6MSN4G4", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c6i.2xlarge", + "name": "c6i.2xlarge", + "ram": 16384, + }, + "c6i.32xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6i.32xlarge", + "instancesku": "QNUQSM3BUHRHUWTU", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "c6i.32xlarge", + "name": "c6i.32xlarge", + "ram": 262144, + }, + "c6i.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6i.4xlarge", + "instancesku": "KBFT9CRJ8V4C6W5F", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c6i.4xlarge", + "name": "c6i.4xlarge", + "ram": 32768, + }, + "c6i.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6i.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c6i.8xlarge", + "name": "c6i.8xlarge", + "ram": 65536, + }, + "c6i.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6i.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c6i.large", + "name": "c6i.large", + "ram": 4096, + }, + "c6i.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6i.xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c6i.xlarge", + "name": "c6i.xlarge", + "ram": 8192, + }, + "c6id.12xlarge": { + "bandwidth": 18750, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6id.12xlarge", + "instancesku": "FQE85V2GX4ZFSD2S", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c6id.12xlarge", + "name": "c6id.12xlarge", + "ram": 98304, + }, + "c6id.16xlarge": { + "bandwidth": 25000, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6id.16xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c6id.16xlarge", + "name": "c6id.16xlarge", + "ram": 131072, + }, + "c6id.24xlarge": { + "bandwidth": 37500, + "disk": 5700, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6id.24xlarge", + "instancesku": "Y4ZVY5VNPN8STK52", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1425 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "c6id.24xlarge", + "name": "c6id.24xlarge", + "ram": 196608, + }, + "c6id.2xlarge": { + "bandwidth": 12500, + "disk": 474, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6id.2xlarge", + "instancesku": "X9N8F8866QWAPQNP", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 474 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c6id.2xlarge", + "name": "c6id.2xlarge", + "ram": 16384, + }, + "c6id.32xlarge": { + "bandwidth": 50000, + "disk": 7600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6id.32xlarge", + "instancesku": "MG4MW9ZM927UDCXJ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1900 NVMe SSD", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "c6id.32xlarge", + "name": "c6id.32xlarge", + "ram": 262144, + }, + "c6id.4xlarge": { + "bandwidth": 12500, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6id.4xlarge", + "instancesku": "ZZSD3B794W6EQUBC", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c6id.4xlarge", + "name": "c6id.4xlarge", + "ram": 32768, + }, + "c6id.8xlarge": { + "bandwidth": 12500, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6id.8xlarge", + "instancesku": "6NA33DRTEUAMJA2N", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c6id.8xlarge", + "name": "c6id.8xlarge", + "ram": 65536, + }, + "c6id.large": { + "bandwidth": 12500, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6id.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c6id.large", + "name": "c6id.large", + "ram": 4096, + }, + "c6id.xlarge": { + "bandwidth": 12500, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6id.xlarge", + "instancesku": "6KDKHB5SQW6BX8N2", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c6id.xlarge", + "name": "c6id.xlarge", + "ram": 8192, + }, + "c6in.12xlarge": { + "bandwidth": 75000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "37500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6in.12xlarge", + "instancesku": "F8D9XRE64QEESJRE", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "75000 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c6in.12xlarge", + "name": "c6in.12xlarge", + "ram": 98304, + }, + "c6in.16xlarge": { + "bandwidth": 100000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "50000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6in.16xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "100000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c6in.16xlarge", + "name": "c6in.16xlarge", + "ram": 131072, + }, + "c6in.24xlarge": { + "bandwidth": 150000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "75000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6in.24xlarge", + "instancesku": "A9XBZ7SQVVKSY9AF", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "150000 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "c6in.24xlarge", + "name": "c6in.24xlarge", + "ram": 196608, + }, + "c6in.2xlarge": { + "bandwidth": 40000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6in.2xlarge", + "instancesku": "4MHZEWP3BBH6PYGB", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 40000 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c6in.2xlarge", + "name": "c6in.2xlarge", + "ram": 16384, + }, + "c6in.32xlarge": { + "bandwidth": 200000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "100000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6in.32xlarge", + "instancesku": "C9DWEPQPKMXGXS4T", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "200000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "c6in.32xlarge", + "name": "c6in.32xlarge", + "ram": 262144, + }, + "c6in.4xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6in.4xlarge", + "instancesku": "H38WNUZQAFK88DC3", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 50000 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c6in.4xlarge", + "name": "c6in.4xlarge", + "ram": 32768, + }, + "c6in.8xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6in.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c6in.8xlarge", + "name": "c6in.8xlarge", + "ram": 65536, + }, + "c6in.large": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6in.large", + "instancesku": "GSXW7HA3ADXKUQCG", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 25000 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c6in.large", + "name": "c6in.large", + "ram": 4096, + }, + "c6in.xlarge": { + "bandwidth": 30000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c6in.xlarge", + "instancesku": "EHH289PRYCPUP9HQ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 30000 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c6in.xlarge", + "name": "c6in.xlarge", + "ram": 8192, + }, + "c7a.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7a.12xlarge", + "instancesku": "BVWGQB6MV968URSH", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c7a.12xlarge", + "name": "c7a.12xlarge", + "ram": 98304, + }, + "c7a.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7a.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c7a.16xlarge", + "name": "c7a.16xlarge", + "ram": 131072, + }, + "c7a.24xlarge": { + "bandwidth": 37500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7a.24xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "c7a.24xlarge", + "name": "c7a.24xlarge", + "ram": 196608, + }, + "c7a.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7a.2xlarge", + "instancesku": "463W6TZN959Y4KDR", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c7a.2xlarge", + "name": "c7a.2xlarge", + "ram": 16384, + }, + "c7a.32xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7a.32xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "c7a.32xlarge", + "name": "c7a.32xlarge", + "ram": 262144, + }, + "c7a.48xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7a.48xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "c7a.48xlarge", + "name": "c7a.48xlarge", + "ram": 393216, + }, + "c7a.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7a.4xlarge", + "instancesku": "KA3N6AD5GYB9SBDF", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c7a.4xlarge", + "name": "c7a.4xlarge", + "ram": 32768, + }, + "c7a.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7a.8xlarge", + "instancesku": "3VCTVAWBTY8WBYEZ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c7a.8xlarge", + "name": "c7a.8xlarge", + "ram": 65536, + }, + "c7a.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7a.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c7a.large", + "name": "c7a.large", + "ram": 4096, + }, + "c7a.medium": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7a.medium", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "c7a.medium", + "name": "c7a.medium", + "ram": 2048, + }, + "c7a.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7a.xlarge", + "instancesku": "HPPW7E3GCHGU3MUQ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c7a.xlarge", + "name": "c7a.xlarge", + "ram": 8192, + }, + "c7g.12xlarge": { + "bandwidth": 22500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7g.12xlarge", + "instancesku": "TN8APU5VNTFQQR2R", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "22500 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c7g.12xlarge", + "name": "c7g.12xlarge", + "ram": 98304, + }, + "c7g.16xlarge": { + "bandwidth": 30, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7g.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "30 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c7g.16xlarge", + "name": "c7g.16xlarge", + "ram": 131072, + }, + "c7g.2xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7g.2xlarge", + "instancesku": "VVFTAGMDE2YV8AT3", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c7g.2xlarge", + "name": "c7g.2xlarge", + "ram": 16384, + }, + "c7g.4xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7g.4xlarge", + "instancesku": "GMSXGX25V8JBVJJU", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c7g.4xlarge", + "name": "c7g.4xlarge", + "ram": 32768, + }, + "c7g.8xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7g.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "15 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c7g.8xlarge", + "name": "c7g.8xlarge", + "ram": 65536, + }, + "c7g.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7g.large", + "instancesku": "XCUDUSUEF98YBBJ8", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c7g.large", + "name": "c7g.large", + "ram": 4096, + }, + "c7g.medium": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7g.medium", + "instancesku": "7SPG6TBVVQVTJ6ZS", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "c7g.medium", + "name": "c7g.medium", + "ram": 2048, + }, + "c7g.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7g.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c7g.xlarge", + "name": "c7g.xlarge", + "ram": 8192, + }, + "c7gd.12xlarge": { + "bandwidth": 22500, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gd.12xlarge", + "instancesku": "Q9QQTXJNDFQ6E9NY", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "22500 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c7gd.12xlarge", + "name": "c7gd.12xlarge", + "ram": 98304, + }, + "c7gd.16xlarge": { + "bandwidth": 30, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gd.16xlarge", + "instancesku": "SYVPBBHHCKHGVNNG", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "30 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c7gd.16xlarge", + "name": "c7gd.16xlarge", + "ram": 131072, + }, + "c7gd.2xlarge": { + "bandwidth": 15, + "disk": 475, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gd.2xlarge", + "instancesku": "XMAWGNWQEVXWGXFW", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 475 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c7gd.2xlarge", + "name": "c7gd.2xlarge", + "ram": 16384, + }, + "c7gd.4xlarge": { + "bandwidth": 15, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gd.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c7gd.4xlarge", + "name": "c7gd.4xlarge", + "ram": 32768, + }, + "c7gd.8xlarge": { + "bandwidth": 15, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gd.8xlarge", + "instancesku": "5VF8FN2TYA4Y2QN3", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "15 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c7gd.8xlarge", + "name": "c7gd.8xlarge", + "ram": 65536, + }, + "c7gd.large": { + "bandwidth": 12500, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gd.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c7gd.large", + "name": "c7gd.large", + "ram": 4096, + }, + "c7gd.medium": { + "bandwidth": 12500, + "disk": 59, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gd.medium", + "instancesku": "Q99HFCWCDYUBU7AG", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 59 NVMe SSD", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "c7gd.medium", + "name": "c7gd.medium", + "ram": 2048, + }, + "c7gd.xlarge": { + "bandwidth": 12500, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gd.xlarge", + "instancesku": "NTATYNX8P99WK9HF", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c7gd.xlarge", + "name": "c7gd.xlarge", + "ram": 8192, + }, + "c7gn.12xlarge": { + "bandwidth": 150, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gn.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "150 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c7gn.12xlarge", + "name": "c7gn.12xlarge", + "ram": 98304, + }, + "c7gn.16xlarge": { + "bandwidth": 200, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gn.16xlarge", + "instancesku": "BCDJJ8FFU9DWK4VB", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "200 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c7gn.16xlarge", + "name": "c7gn.16xlarge", + "ram": 131072, + }, + "c7gn.2xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gn.2xlarge", + "instancesku": "N33ZDXWC2PTAH9YP", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 50 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c7gn.2xlarge", + "name": "c7gn.2xlarge", + "ram": 16384, + }, + "c7gn.4xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gn.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c7gn.4xlarge", + "name": "c7gn.4xlarge", + "ram": 32768, + }, + "c7gn.8xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gn.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c7gn.8xlarge", + "name": "c7gn.8xlarge", + "ram": 65536, + }, + "c7gn.large": { + "bandwidth": 30, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gn.large", + "instancesku": "DFN9T3JRTY8JSEEH", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 30 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c7gn.large", + "name": "c7gn.large", + "ram": 4096, + }, + "c7gn.medium": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gn.medium", + "instancesku": "JMMFJ8Y2RWTYNHYY", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "c7gn.medium", + "name": "c7gn.medium", + "ram": 2048, + }, + "c7gn.xlarge": { + "bandwidth": 40, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7gn.xlarge", + "instancesku": "UV36UAT5A9U55K8X", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 40 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c7gn.xlarge", + "name": "c7gn.xlarge", + "ram": 8192, + }, + "c7i-flex.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i-flex.12xlarge", + "instancesku": "GSZ3E5T2PQ9RTMN8", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "Up to 18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c7i-flex.12xlarge", + "name": "c7i-flex.12xlarge", + "ram": 98304, + }, + "c7i-flex.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i-flex.16xlarge", + "instancesku": "47ZF4F474QNTMXH3", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c7i-flex.16xlarge", + "name": "c7i-flex.16xlarge", + "ram": 131072, + }, + "c7i-flex.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i-flex.2xlarge", + "instancesku": "UPFYFUG8AKV7JU8V", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c7i-flex.2xlarge", + "name": "c7i-flex.2xlarge", + "ram": 16384, + }, + "c7i-flex.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i-flex.4xlarge", + "instancesku": "644ZZ3N8ZX2T6Q64", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c7i-flex.4xlarge", + "name": "c7i-flex.4xlarge", + "ram": 32768, + }, + "c7i-flex.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i-flex.8xlarge", + "instancesku": "5PYKYM2ECW7NZ3XH", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c7i-flex.8xlarge", + "name": "c7i-flex.8xlarge", + "ram": 65536, + }, + "c7i-flex.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i-flex.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c7i-flex.large", + "name": "c7i-flex.large", + "ram": 4096, + }, + "c7i-flex.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i-flex.xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c7i-flex.xlarge", + "name": "c7i-flex.xlarge", + "ram": 8192, + }, + "c7i.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i.12xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c7i.12xlarge", + "name": "c7i.12xlarge", + "ram": 98304, + }, + "c7i.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i.16xlarge", + "instancesku": "GZ7MV6V72WV899QY", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c7i.16xlarge", + "name": "c7i.16xlarge", + "ram": 131072, + }, + "c7i.24xlarge": { + "bandwidth": 37500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i.24xlarge", + "instancesku": "WA98FAHPNWDDK979", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "c7i.24xlarge", + "name": "c7i.24xlarge", + "ram": 196608, + }, + "c7i.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c7i.2xlarge", + "name": "c7i.2xlarge", + "ram": 16384, + }, + "c7i.48xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i.48xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "c7i.48xlarge", + "name": "c7i.48xlarge", + "ram": 393216, + }, + "c7i.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i.4xlarge", + "instancesku": "WHKNSAQ832PRZBXT", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c7i.4xlarge", + "name": "c7i.4xlarge", + "ram": 32768, + }, + "c7i.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i.8xlarge", + "instancesku": "AWQZUQWQZPJN8RVW", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c7i.8xlarge", + "name": "c7i.8xlarge", + "ram": 65536, + }, + "c7i.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c7i.large", + "name": "c7i.large", + "ram": 4096, + }, + "c7i.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c7i.xlarge", + "instancesku": "QS2EVUNVY9DVPKDQ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c7i.xlarge", + "name": "c7i.xlarge", + "ram": 8192, + }, + "c8g.12xlarge": { + "bandwidth": 22, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c8g.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "22.5 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "c8g.12xlarge", + "name": "c8g.12xlarge", + "ram": 98304, + }, + "c8g.16xlarge": { + "bandwidth": 30, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c8g.16xlarge", + "instancesku": "MWCSPTWX23NYB7VQ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "30 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "c8g.16xlarge", + "name": "c8g.16xlarge", + "ram": 131072, + }, + "c8g.24xlarge": { + "bandwidth": 40, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c8g.24xlarge", + "instancesku": "36F49S5R44BPRKQ6", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "40 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "c8g.24xlarge", + "name": "c8g.24xlarge", + "ram": 196608, + }, + "c8g.2xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c8g.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "c8g.2xlarge", + "name": "c8g.2xlarge", + "ram": 16384, + }, + "c8g.48xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c8g.48xlarge", + "instancesku": "PWHPJCNBRZJ5K579", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "c8g.48xlarge", + "name": "c8g.48xlarge", + "ram": 393216, + }, + "c8g.4xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c8g.4xlarge", + "instancesku": "5CJ8R29XEESN6RMA", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "c8g.4xlarge", + "name": "c8g.4xlarge", + "ram": 32768, + }, + "c8g.8xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c8g.8xlarge", + "instancesku": "CV8NXT6RRMWZNU7Y", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "15 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "c8g.8xlarge", + "name": "c8g.8xlarge", + "ram": 65536, + }, + "c8g.large": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c8g.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12.5 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "c8g.large", + "name": "c8g.large", + "ram": 4096, + }, + "c8g.medium": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c8g.medium", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Up to 12.5 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "c8g.medium", + "name": "c8g.medium", + "ram": 2048, + }, + "c8g.xlarge": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "c8g.xlarge", + "instancesku": "N36XWBCR85XKHG87", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12.5 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "c8g.xlarge", + "name": "c8g.xlarge", + "ram": 8192, + }, + "cc2.8xlarge": { + "bandwidth": 10, + "disk": 3360, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.6 GHz", + "currentGeneration": "No", + "ecu": "88", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "cc2.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "60.5 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2670", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 840 SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "cc2.8xlarge", + "name": "cc2.8xlarge", + "ram": 61952, + }, + "cr1.8xlarge": { + "bandwidth": 10, + "disk": 240, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "currentGeneration": "No", + "dedicatedEbsThroughput": "400 Mbps", + "ecu": "88", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "cr1.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "244 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2670", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 120 SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "cr1.8xlarge", + "name": "cr1.8xlarge", + "ram": 249856, + }, + "d2.2xlarge": { + "bandwidth": None, + "disk": 12000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.4 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "1000 Mbps", + "ecu": "28", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d2.2xlarge", + "instancesku": "MMEKDXY58RD4JWKV", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "61 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2676 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "6 x 2000 HDD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "d2.2xlarge", + "name": "d2.2xlarge", + "ram": 62464, + }, + "d2.4xlarge": { + "bandwidth": None, + "disk": 24000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.4 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "2000 Mbps", + "ecu": "56", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d2.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "122 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon E5-2676 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "12 x 2000 HDD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "d2.4xlarge", + "name": "d2.4xlarge", + "ram": 124928, + }, + "d2.8xlarge": { + "bandwidth": 10, + "disk": 48000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.4 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "4000 Mbps", + "ecu": "116", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d2.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "244 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2676 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "24 x 2000 HDD", + "vcpu": "36", + "vpcnetworkingsupport": "true", + }, + "id": "d2.8xlarge", + "name": "d2.8xlarge", + "ram": 249856, + }, + "d2.xlarge": { + "bandwidth": None, + "disk": 6000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.4 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "750 Mbps", + "ecu": "14", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d2.xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "30.5 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon E5-2676 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "3 x 2000 HDD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "d2.xlarge", + "name": "d2.xlarge", + "ram": 31232, + }, + "d3.2xlarge": { + "bandwidth": 15, + "disk": 12000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2800 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d3.2xlarge", + "instancesku": "5TGGFNPG4M6GTUKU", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "6 x 2000 HDD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "d3.2xlarge", + "name": "d3.2xlarge", + "ram": 65536, + }, + "d3.4xlarge": { + "bandwidth": 15, + "disk": 24000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2800 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d3.4xlarge", + "instancesku": "4DVAYKJPKD2C77C6", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "12 x 2000 HDD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "d3.4xlarge", + "name": "d3.4xlarge", + "ram": 131072, + }, + "d3.8xlarge": { + "bandwidth": 25, + "disk": 48000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d3.8xlarge", + "instancesku": "4KEDQSATUFFFFRGR", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "24 x 2000 HDD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "d3.8xlarge", + "name": "d3.8xlarge", + "ram": 262144, + }, + "d3.xlarge": { + "bandwidth": 15, + "disk": 6000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2800 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d3.xlarge", + "instancesku": "E6KXGC3UNB34ACFA", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "3 x 2000 HDD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "d3.xlarge", + "name": "d3.xlarge", + "ram": 32768, + }, + "d3en.12xlarge": { + "bandwidth": 75, + "disk": 336000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d3en.12xlarge", + "instancesku": "GANWKN2KAMKGJ986", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "75 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "24 x 14000 HDD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "d3en.12xlarge", + "name": "d3en.12xlarge", + "ram": 196608, + }, + "d3en.2xlarge": { + "bandwidth": 25, + "disk": 56000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2800 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d3en.2xlarge", + "instancesku": "AW2HWMVHERHTXRQB", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 14000 HDD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "d3en.2xlarge", + "name": "d3en.2xlarge", + "ram": 32768, + }, + "d3en.4xlarge": { + "bandwidth": 25, + "disk": 112000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2800 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d3en.4xlarge", + "instancesku": "24U62KWPMYB8EJ5M", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 14000 HDD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "d3en.4xlarge", + "name": "d3en.4xlarge", + "ram": 65536, + }, + "d3en.6xlarge": { + "bandwidth": 40, + "disk": 168000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d3en.6xlarge", + "instancesku": "VRB5UKVQRHGS88H2", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "40 Gigabit", + "normalizationSizeFactor": "48", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "12 x 14000 HDD", + "vcpu": "24", + "vpcnetworkingsupport": "true", + }, + "id": "d3en.6xlarge", + "name": "d3en.6xlarge", + "ram": 98304, + }, + "d3en.8xlarge": { + "bandwidth": 50, + "disk": 224000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d3en.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "16 x 14000 HDD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "d3en.8xlarge", + "name": "d3en.8xlarge", + "ram": 131072, + }, + "d3en.xlarge": { + "bandwidth": 25, + "disk": 28000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2800 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "d3en.xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 14000 HDD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "d3en.xlarge", + "name": "d3en.xlarge", + "ram": 16384, + }, + "dl1.24xlarge": { + "bandwidth": 400, + "disk": 4000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "dl1.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "400 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8275L", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1000 GB NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "dl1.24xlarge", + "name": "dl1.24xlarge", + "ram": 786432, + }, + "dl2q.24xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "128 GiB", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "dl2q.24xlarge", + "instancesku": "EQGU7KRQR4RA2DPN", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "dl2q.24xlarge", + "name": "dl2q.24xlarge", + "ram": 786432, + }, + "f1.16xlarge": { + "bandwidth": 25, + "disk": 3760, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "201", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "FPGA Instances", + "instanceType": "f1.16xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "976 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 940 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "f1.16xlarge", + "name": "f1.16xlarge", + "ram": 999424, + }, + "f1.2xlarge": { + "bandwidth": 10, + "disk": 470, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "1700 Mbps", + "ecu": "31", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "FPGA Instances", + "instanceType": "f1.2xlarge", + "instancesku": "MXDPYTEVHNYM6QTA", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "122 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 470 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "f1.2xlarge", + "name": "f1.2xlarge", + "ram": 124928, + }, + "f1.4xlarge": { + "bandwidth": 10, + "disk": 940, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "58", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "FPGA Instances", + "instanceType": "f1.4xlarge", + "instancesku": "6YUJAEPDDF47NZUQ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "244 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 940 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "f1.4xlarge", + "name": "f1.4xlarge", + "ram": 249856, + }, + "f2.12xlarge": { + "bandwidth": 25, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.95 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "FPGA Instances", + "instanceType": "f2.12xlarge", + "instancesku": "J9RXNF7DMTERX3WW", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 950 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "f2.12xlarge", + "name": "f2.12xlarge", + "ram": 524288, + }, + "f2.48xlarge": { + "bandwidth": 100, + "disk": 7600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.95 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "60000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "FPGA Instances", + "instanceType": "f2.48xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2048 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 950 NVMe SSD", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "f2.48xlarge", + "name": "f2.48xlarge", + "ram": 2097152, + }, + "f2.6xlarge": { + "bandwidth": 12, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.95 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "FPGA Instances", + "instanceType": "f2.6xlarge", + "instancesku": "Y3UUMR6W3G63ZRUW", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "12.5 Gigabit", + "normalizationSizeFactor": "48", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "24", + "vpcnetworkingsupport": "true", + }, + "id": "f2.6xlarge", + "name": "f2.6xlarge", + "ram": 262144, + }, + "g2.2xlarge": { + "bandwidth": None, + "disk": 60, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.6 GHz", + "currentGeneration": "No", + "ecu": "26", + "enhancedNetworkingSupported": "No", + "gpu": "1", + "gpuMemory": "NA", + "instanceFamily": "GPU instance", + "instanceType": "g2.2xlarge", + "instancesku": "GYTDXWQD9F7S5WN2", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "15 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2670 (Sandy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 60 SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "g2.2xlarge", + "name": "g2.2xlarge", + "ram": 15360, + }, + "g2.8xlarge": { + "bandwidth": None, + "disk": 240, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.6 GHz", + "currentGeneration": "No", + "ecu": "104", + "enhancedNetworkingSupported": "No", + "gpu": "4", + "gpuMemory": "NA", + "instanceFamily": "GPU instance", + "instanceType": "g2.8xlarge", + "instancesku": "GP54RNQ37B9N43MJ", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "60 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2670 (Sandy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 120 SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "g2.8xlarge", + "name": "g2.8xlarge", + "ram": 61440, + }, + "g3.16xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "201", + "enhancedNetworkingSupported": "Yes", + "gpu": "4", + "gpuMemory": "32 GB", + "instanceFamily": "GPU instance", + "instanceType": "g3.16xlarge", + "instancesku": "TFGPCCSSAM9DNFGT", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "488 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "g3.16xlarge", + "name": "g3.16xlarge", + "ram": 499712, + }, + "g3.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "58", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "8 GB", + "instanceFamily": "GPU instance", + "instanceType": "g3.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "122 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "g3.4xlarge", + "name": "g3.4xlarge", + "ram": 124928, + }, + "g3.8xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "97", + "enhancedNetworkingSupported": "Yes", + "gpu": "2", + "gpuMemory": "16 GB", + "instanceFamily": "GPU instance", + "instanceType": "g3.8xlarge", + "instancesku": "5BWHVPBAG2VXEG2N", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "244 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "g3.8xlarge", + "name": "g3.8xlarge", + "ram": 249856, + }, + "g3s.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "100 Mbps", + "ecu": "13", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "8 GB", + "instanceFamily": "GPU instance", + "instanceType": "g3s.xlarge", + "instancesku": "H33F2YFNF92GTBPB", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "30.5 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "g3s.xlarge", + "name": "g3s.xlarge", + "ram": 31232, + }, + "g4ad.16xlarge": { + "bandwidth": 25, + "disk": 2400, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "6000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "4", + "gpuMemory": "32 GB", + "instanceFamily": "GPU instance", + "instanceType": "g4ad.16xlarge", + "instancesku": "WKWR9U6CWSY34FJZ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2400 GB NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "g4ad.16xlarge", + "name": "g4ad.16xlarge", + "ram": 262144, + }, + "g4ad.2xlarge": { + "bandwidth": 10, + "disk": 300, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "8 GB", + "instanceFamily": "GPU instance", + "instanceType": "g4ad.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "19.97394", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "300 GB NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "g4ad.2xlarge", + "name": "g4ad.2xlarge", + "ram": 32768, + }, + "g4ad.4xlarge": { + "bandwidth": 10, + "disk": 600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "8 GB", + "instanceFamily": "GPU instance", + "instanceType": "g4ad.4xlarge", + "instancesku": "9VMBVH3KEV82T8ZW", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "600 GB NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "g4ad.4xlarge", + "name": "g4ad.4xlarge", + "ram": 65536, + }, + "g4ad.8xlarge": { + "bandwidth": 15, + "disk": 1200, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "2", + "gpuMemory": "16 GB", + "instanceFamily": "GPU instance", + "instanceType": "g4ad.8xlarge", + "instancesku": "7FPHMYTC7W39FTM5", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "15 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1200 GB NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "g4ad.8xlarge", + "name": "g4ad.8xlarge", + "ram": 131072, + }, + "g4ad.xlarge": { + "bandwidth": 10, + "disk": 150, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "8 GB", + "instanceFamily": "GPU instance", + "instanceType": "g4ad.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "13.97113", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "150 GB NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "g4ad.xlarge", + "name": "g4ad.xlarge", + "ram": 16384, + }, + "g4dn.12xlarge": { + "bandwidth": 50, + "disk": 900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "4", + "gpuMemory": "64 GB", + "instanceFamily": "GPU instance", + "instanceType": "g4dn.12xlarge", + "instancesku": "TPYSQ64R6HTY3C2M", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "7.437262357", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "900 GB NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "g4dn.12xlarge", + "name": "g4dn.12xlarge", + "ram": 196608, + }, + "g4dn.16xlarge": { + "bandwidth": 50, + "disk": 900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "16 GB", + "instanceFamily": "GPU instance", + "instanceType": "g4dn.16xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "8.273764259", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "900 GB NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "g4dn.16xlarge", + "name": "g4dn.16xlarge", + "ram": 262144, + }, + "g4dn.2xlarge": { + "bandwidth": 25, + "disk": 225, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "16 GB", + "instanceFamily": "GPU instance", + "instanceType": "g4dn.2xlarge", + "instancesku": "K24CAS4K6W4HJXN8", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "1.429657795", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "225 GB NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "g4dn.2xlarge", + "name": "g4dn.2xlarge", + "ram": 32768, + }, + "g4dn.4xlarge": { + "bandwidth": 25, + "disk": 225, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "16 GB", + "instanceFamily": "GPU instance", + "instanceType": "g4dn.4xlarge", + "instancesku": "YMZGCYKDK8626BJT", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "2.288973384", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "225 GB NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "g4dn.4xlarge", + "name": "g4dn.4xlarge", + "ram": 65536, + }, + "g4dn.8xlarge": { + "bandwidth": 50, + "disk": 900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "16 GB", + "instanceFamily": "GPU instance", + "instanceType": "g4dn.8xlarge", + "instancesku": "AE5GUKCAC8GSBSBD", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "4.136882129", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "900 GB NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "g4dn.8xlarge", + "name": "g4dn.8xlarge", + "ram": 131072, + }, + "g4dn.xlarge": { + "bandwidth": 25, + "disk": 125, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "16 GB", + "instanceFamily": "GPU instance", + "instanceType": "g4dn.xlarge", + "instancesku": "N5MXSK5M9ZYYBS9Y", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "1", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "125 GB NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "g4dn.xlarge", + "name": "g4dn.xlarge", + "ram": 16384, + }, + "g5.12xlarge": { + "bandwidth": 40, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "16000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "4", + "gpuMemory": "96 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5.12xlarge", + "instancesku": "Z22N58R7N3GKA4C3", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "40 Gigabit", + "normalizationSizeFactor": "5.638170974", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 3800 GB NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "g5.12xlarge", + "name": "g5.12xlarge", + "ram": 196608, + }, + "g5.16xlarge": { + "bandwidth": 25, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "16000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "24 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "4.071570577", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 GB NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "g5.16xlarge", + "name": "g5.16xlarge", + "ram": 262144, + }, + "g5.24xlarge": { + "bandwidth": 50, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "4", + "gpuMemory": "96 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5.24xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "8.095427435", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 3800 GB NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "g5.24xlarge", + "name": "g5.24xlarge", + "ram": 393216, + }, + "g5.2xlarge": { + "bandwidth": 10, + "disk": 450, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "24 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5.2xlarge", + "instancesku": "3V2YRDDASNUNHK8Q", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "1.204771372", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 450 GB NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "g5.2xlarge", + "name": "g5.2xlarge", + "ram": 32768, + }, + "g5.48xlarge": { + "bandwidth": 100, + "disk": 7600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "8", + "gpuMemory": "192 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5.48xlarge", + "instancesku": "DPNNR9TE888NYC83", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "16.190854871", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 3800 GB NVMe SSD", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "g5.48xlarge", + "name": "g5.48xlarge", + "ram": 786432, + }, + "g5.4xlarge": { + "bandwidth": 25, + "disk": 600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "8000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "24 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5.4xlarge", + "instancesku": "VKEJ46YCBF7V8WVN", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "1.614314115", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 600 GB NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "g5.4xlarge", + "name": "g5.4xlarge", + "ram": 65536, + }, + "g5.8xlarge": { + "bandwidth": 25, + "disk": 900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "16000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "24 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5.8xlarge", + "instancesku": "G77E9FGSFGQ5XBQR", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "2.433399602", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 900 GB NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "g5.8xlarge", + "name": "g5.8xlarge", + "ram": 131072, + }, + "g5.xlarge": { + "bandwidth": 10, + "disk": 250, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.8 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "24 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5.xlarge", + "instancesku": "RGX2TRWU27FJXUD4", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "1", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 250 GB NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "g5.xlarge", + "name": "g5.xlarge", + "ram": 16384, + }, + "g5g.16xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "2", + "gpuMemory": "32 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5g.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "6.533333333", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "g5g.16xlarge", + "name": "g5g.16xlarge", + "ram": 131072, + }, + "g5g.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "16 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5g.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "1.323809524", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "g5g.2xlarge", + "name": "g5g.2xlarge", + "ram": 16384, + }, + "g5g.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4750 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "16 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5g.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "1.971428571", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "g5g.4xlarge", + "name": "g5g.4xlarge", + "ram": 32768, + }, + "g5g.8xlarge": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "16 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5g.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12 Gigabit", + "normalizationSizeFactor": "3.266666667", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "g5g.8xlarge", + "name": "g5g.8xlarge", + "ram": 65536, + }, + "g5g.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "16 GB", + "instanceFamily": "GPU instance", + "instanceType": "g5g.xlarge", + "instancesku": "GWKJ7SBX9EJ97KHP", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "1", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "g5g.xlarge", + "name": "g5g.xlarge", + "ram": 8192, + }, + "g6.12xlarge": { + "bandwidth": 40, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "4", + "gpuMemory": "96 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6.12xlarge", + "instancesku": "DQTH69PA6TQYJEPB", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "40 Gigabit", + "normalizationSizeFactor": "5.717693837", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 X 940 GB NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "g6.12xlarge", + "name": "g6.12xlarge", + "ram": 196608, + }, + "g6.16xlarge": { + "bandwidth": 25, + "disk": 1880, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "24 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6.16xlarge", + "instancesku": "4V4FU9YKANXV8G2A", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "4.220675944", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 940 GB NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "g6.16xlarge", + "name": "g6.16xlarge", + "ram": 262144, + }, + "g6.24xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "4", + "gpuMemory": "96 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6.24xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "8.294234592", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 X 940 GB NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "g6.24xlarge", + "name": "g6.24xlarge", + "ram": 393216, + }, + "g6.2xlarge": { + "bandwidth": 10, + "disk": 450, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "24 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "1.21471173", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 450 GB NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "g6.2xlarge", + "name": "g6.2xlarge", + "ram": 32768, + }, + "g6.48xlarge": { + "bandwidth": 100, + "disk": 7520, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "60000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "8", + "gpuMemory": "192 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6.48xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "16.58846918", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 940 NVMe SSD", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "g6.48xlarge", + "name": "g6.48xlarge", + "ram": 786432, + }, + "g6.4xlarge": { + "bandwidth": 25, + "disk": 600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "8000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "24 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "1.644135189", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 600 GB NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "g6.4xlarge", + "name": "g6.4xlarge", + "ram": 65536, + }, + "g6.8xlarge": { + "bandwidth": 25, + "disk": 900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "16000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "24 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6.8xlarge", + "instancesku": "U9KYRQSBZJZ7BEY5", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "2.502982107", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 450 GB NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "g6.8xlarge", + "name": "g6.8xlarge", + "ram": 131072, + }, + "g6.xlarge": { + "bandwidth": 10, + "disk": 250, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "24 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6.xlarge", + "instancesku": "8YJMSK4Z67XAC3JS", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "1", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 250 GB NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "g6.xlarge", + "name": "g6.xlarge", + "ram": 16384, + }, + "g6e.12xlarge": { + "bandwidth": 100, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "4", + "gpuMemory": "192 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6e.12xlarge", + "instancesku": "J5MZWTDZVU6CFEG9", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "5.638170974", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 GB NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "g6e.12xlarge", + "name": "g6e.12xlarge", + "ram": 393216, + }, + "g6e.16xlarge": { + "bandwidth": 35, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "48 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6e.16xlarge", + "instancesku": "8RMS4UXRV9DKB4VU", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "35 Gigabit", + "normalizationSizeFactor": "4.071570577", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 GB NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "g6e.16xlarge", + "name": "g6e.16xlarge", + "ram": 524288, + }, + "g6e.24xlarge": { + "bandwidth": 200, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "4", + "gpuMemory": "192 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6e.24xlarge", + "instancesku": "65MPARB6D8YCD2G7", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "200 Gigabit", + "normalizationSizeFactor": "8.095427435", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 GB NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "g6e.24xlarge", + "name": "g6e.24xlarge", + "ram": 786432, + }, + "g6e.2xlarge": { + "bandwidth": 20, + "disk": 450, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "48 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6e.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 20 Gigabit", + "normalizationSizeFactor": "1.204771372", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 450 GB NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "g6e.2xlarge", + "name": "g6e.2xlarge", + "ram": 65536, + }, + "g6e.48xlarge": { + "bandwidth": 400, + "disk": 7600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "60000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "8", + "gpuMemory": "384 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6e.48xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1536 GiB", + "networkPerformance": "400 Gigabit", + "normalizationSizeFactor": "16.19085487", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1900 GB NVMe SSD", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "g6e.48xlarge", + "name": "g6e.48xlarge", + "ram": 1572864, + }, + "g6e.4xlarge": { + "bandwidth": 20, + "disk": 600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "8000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "48 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6e.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "1.614314115", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 600 GB NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "g6e.4xlarge", + "name": "g6e.4xlarge", + "ram": 131072, + }, + "g6e.8xlarge": { + "bandwidth": 25, + "disk": 900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "16000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "48 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6e.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "2.433399602", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 900 GB NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "g6e.8xlarge", + "name": "g6e.8xlarge", + "ram": 262144, + }, + "g6e.xlarge": { + "bandwidth": 20, + "disk": 250, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "48 GB", + "instanceFamily": "GPU instance", + "instanceType": "g6e.xlarge", + "instancesku": "F6VQKF62RGG5EV6F", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 20 Gigabit", + "normalizationSizeFactor": "1", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 250 GB NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "g6e.xlarge", + "name": "g6e.xlarge", + "ram": 32768, + }, + "gr6.4xlarge": { + "bandwidth": 25, + "disk": 600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "8000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "24 GB", + "instanceFamily": "GPU instance", + "instanceType": "gr6.4xlarge", + "instancesku": "PG8KYKPFQ8JZ6KAD", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "1", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 600 GB NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "gr6.4xlarge", + "name": "gr6.4xlarge", + "ram": 131072, + }, + "gr6.8xlarge": { + "bandwidth": 25, + "disk": 900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "16000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "24 GB", + "instanceFamily": "GPU instance", + "instanceType": "gr6.8xlarge", + "instancesku": "ARXY4W4A3M6DUEFT", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "1.589397089", + "physicalProcessor": "AMD EPYC 7R32", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 450 GB NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "gr6.8xlarge", + "name": "gr6.8xlarge", + "ram": 262144, + }, + "h1.16xlarge": { + "bandwidth": 25, + "disk": 16000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "201", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "h1.16xlarge", + "instancesku": "QZQ8KAA8X77EH39R", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 2000 HDD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "h1.16xlarge", + "name": "h1.16xlarge", + "ram": 262144, + }, + "h1.2xlarge": { + "bandwidth": 10, + "disk": 2000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "1750 Mbps", + "ecu": "31", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "h1.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 2000 HDD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "h1.2xlarge", + "name": "h1.2xlarge", + "ram": 32768, + }, + "h1.4xlarge": { + "bandwidth": 10, + "disk": 4000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "58", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "h1.4xlarge", + "instancesku": "DA8WABW4PXZEM9CX", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 2000 HDD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "h1.4xlarge", + "name": "h1.4xlarge", + "ram": 65536, + }, + "h1.8xlarge": { + "bandwidth": 10, + "disk": 8000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "97", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "h1.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 2000 HDD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "h1.8xlarge", + "name": "h1.8xlarge", + "ram": 131072, + }, + "hpc6a.48xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.95 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "hpc6a.48xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "hpc6a.48xlarge", + "name": "hpc6a.48xlarge", + "ram": 393216, + }, + "hpc6id.32xlarge": { + "bandwidth": 200, + "disk": 15200, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "hpc6id.32xlarge", + "instancesku": "BFH769F89NTNBEEA", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "200 Gigabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 3800 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "hpc6id.32xlarge", + "name": "hpc6id.32xlarge", + "ram": 1048576, + }, + "hpc7a.12xlarge": { + "bandwidth": 300, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "87 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "hpc7a.12xlarge", + "instancesku": "DXRKH4UU6G9GDZ8Z", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "300 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "24", + "vpcnetworkingsupport": "true", + }, + "id": "hpc7a.12xlarge", + "name": "hpc7a.12xlarge", + "ram": 786432, + }, + "hpc7a.24xlarge": { + "bandwidth": 300, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "87 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "hpc7a.24xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "300 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "hpc7a.24xlarge", + "name": "hpc7a.24xlarge", + "ram": 786432, + }, + "hpc7a.48xlarge": { + "bandwidth": 300, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "87 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "hpc7a.48xlarge", + "instancesku": "HYBMTYWPBDAV2BTJ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "300 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "hpc7a.48xlarge", + "name": "hpc7a.48xlarge", + "ram": 786432, + }, + "hpc7a.96xlarge": { + "bandwidth": 300, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "87 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "hpc7a.96xlarge", + "instancesku": "DP7DTFB5J8SYZRPC", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "300 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "hpc7a.96xlarge", + "name": "hpc7a.96xlarge", + "ram": 786432, + }, + "hpc7g.16xlarge": { + "bandwidth": 200, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "87 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "hpc7g.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "200 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "hpc7g.16xlarge", + "name": "hpc7g.16xlarge", + "ram": 131072, + }, + "hpc7g.4xlarge": { + "bandwidth": 200, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "87 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "hpc7g.4xlarge", + "instancesku": "4BRATKTQX2BNMYX8", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "200 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "hpc7g.4xlarge", + "name": "hpc7g.4xlarge", + "ram": 131072, + }, + "hpc7g.8xlarge": { + "bandwidth": 200, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "87 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Compute optimized", + "instanceType": "hpc7g.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "200 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "hpc7g.8xlarge", + "name": "hpc7g.8xlarge", + "ram": 131072, + }, + "hs1.8xlarge": { + "bandwidth": 10, + "disk": 48000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2 GHz", + "currentGeneration": "No", + "ecu": "35", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "hs1.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "117 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2650", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "24 x 2000 HDD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "hs1.8xlarge", + "name": "hs1.8xlarge", + "ram": 119808, + }, + "i2.2xlarge": { + "bandwidth": None, + "disk": 1600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "1500 Mbps", + "ecu": "27", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i2.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "61 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 800 SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "i2.2xlarge", + "name": "i2.2xlarge", + "ram": 62464, + }, + "i2.4xlarge": { + "bandwidth": None, + "disk": 3200, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "1500 Mbps", + "ecu": "53", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i2.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "122 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 800 SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "i2.4xlarge", + "name": "i2.4xlarge", + "ram": 124928, + }, + "i2.8xlarge": { + "bandwidth": 10, + "disk": 6400, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "1500 Mbps", + "ecu": "104", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i2.8xlarge", + "instancesku": "2UP3NPVY4NG62NY2", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "244 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 800 SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "i2.8xlarge", + "name": "i2.8xlarge", + "ram": 249856, + }, + "i2.large": { + "bandwidth": None, + "disk": 800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "ecu": "7", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i2.large", + "instancesku": "WURYYYF99XGKXXRH", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "15 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 800 SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "i2.large", + "name": "i2.large", + "ram": 15360, + }, + "i2.xlarge": { + "bandwidth": None, + "disk": 800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "750 Mbps", + "ecu": "14", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i2.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "30.5 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 800 SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "i2.xlarge", + "name": "i2.xlarge", + "ram": 31232, + }, + "i3.16xlarge": { + "bandwidth": 20, + "disk": 15200, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "201", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3.16xlarge", + "instancesku": "QVUP8HT625VGM28B", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "488 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "i3.16xlarge", + "name": "i3.16xlarge", + "ram": 499712, + }, + "i3.2xlarge": { + "bandwidth": 10, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "1750 Mbps", + "ecu": "31", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3.2xlarge", + "instancesku": "344DF3TUKYKVUUYB", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "61 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "i3.2xlarge", + "name": "i3.2xlarge", + "ram": 62464, + }, + "i3.4xlarge": { + "bandwidth": 10, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "58", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "122 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "i3.4xlarge", + "name": "i3.4xlarge", + "ram": 124928, + }, + "i3.8xlarge": { + "bandwidth": 10, + "disk": 7600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "97", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "244 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1900 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "i3.8xlarge", + "name": "i3.8xlarge", + "ram": 249856, + }, + "i3.large": { + "bandwidth": 10, + "disk": 475, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "425 Mbps", + "ecu": "8", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3.large", + "instancesku": "T2R7DYXSCP5QZZGU", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "15.25 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 475 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "i3.large", + "name": "i3.large", + "ram": 15616, + }, + "i3.xlarge": { + "bandwidth": 10, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "850 Mbps", + "ecu": "16", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3.xlarge", + "instancesku": "DQBUA3WF2ZKB94XE", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "30.5 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "i3.xlarge", + "name": "i3.xlarge", + "ram": 31232, + }, + "i3en.12xlarge": { + "bandwidth": 50, + "disk": 30000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "168", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3en.12xlarge", + "instancesku": "8RE9VN3MCA27FAPN", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 7500 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "i3en.12xlarge", + "name": "i3en.12xlarge", + "ram": 393216, + }, + "i3en.24xlarge": { + "bandwidth": 100, + "disk": 60000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "337", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3en.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 7500 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "i3en.24xlarge", + "name": "i3en.24xlarge", + "ram": 786432, + }, + "i3en.2xlarge": { + "bandwidth": 25, + "disk": 5000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "37", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3en.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 2500 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "i3en.2xlarge", + "name": "i3en.2xlarge", + "ram": 65536, + }, + "i3en.3xlarge": { + "bandwidth": 25, + "disk": 7500, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3en.3xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "24", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 7500 NVMe SSD", + "vcpu": "12", + "vpcnetworkingsupport": "true", + }, + "id": "i3en.3xlarge", + "name": "i3en.3xlarge", + "ram": 98304, + }, + "i3en.6xlarge": { + "bandwidth": 25, + "disk": 15000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3en.6xlarge", + "instancesku": "JFUSUE6PEJ7BEWFW", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "48", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 7500 NVMe SSD", + "vcpu": "24", + "vpcnetworkingsupport": "true", + }, + "id": "i3en.6xlarge", + "name": "i3en.6xlarge", + "ram": 196608, + }, + "i3en.large": { + "bandwidth": 25, + "disk": 1250, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "10", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3en.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1250 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "i3en.large", + "name": "i3en.large", + "ram": 16384, + }, + "i3en.xlarge": { + "bandwidth": 25, + "disk": 2500, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i3en.xlarge", + "instancesku": "KFX9MBMD2FPV9EAG", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 2500 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "i3en.xlarge", + "name": "i3en.xlarge", + "ram": 32768, + }, + "i4g.16xlarge": { + "bandwidth": 37500, + "disk": 15000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4g.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 3750 SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "i4g.16xlarge", + "name": "i4g.16xlarge", + "ram": 524288, + }, + "i4g.2xlarge": { + "bandwidth": 12, + "disk": 1875, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4g.2xlarge", + "instancesku": "6V9FAVBEUJNF7Y5N", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1875 SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "i4g.2xlarge", + "name": "i4g.2xlarge", + "ram": 65536, + }, + "i4g.4xlarge": { + "bandwidth": 25, + "disk": 3750, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4g.4xlarge", + "instancesku": "QMEDNTDHFBJ5TBVK", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 3750 SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "i4g.4xlarge", + "name": "i4g.4xlarge", + "ram": 131072, + }, + "i4g.8xlarge": { + "bandwidth": 18750, + "disk": 7500, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4g.8xlarge", + "instancesku": "88CKZ2RR64QV2SEC", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 3750 SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "i4g.8xlarge", + "name": "i4g.8xlarge", + "ram": 262144, + }, + "i4g.large": { + "bandwidth": 10, + "disk": 468, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4g.large", + "instancesku": "ECPX7S99F7RP3PWS", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 468 SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "i4g.large", + "name": "i4g.large", + "ram": 16384, + }, + "i4g.xlarge": { + "bandwidth": 10, + "disk": 937, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4g.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 937 SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "i4g.xlarge", + "name": "i4g.xlarge", + "ram": 32768, + }, + "i4i.12xlarge": { + "bandwidth": 28125, + "disk": 11250, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4i.12xlarge", + "instancesku": "5DP3MFBEZAWKNNU4", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "28125 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "3 x 3750 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "i4i.12xlarge", + "name": "i4i.12xlarge", + "ram": 393216, + }, + "i4i.16xlarge": { + "bandwidth": 35000, + "disk": 15000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4i.16xlarge", + "instancesku": "5PHSTUESTSJBSFAK", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "35000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 3750 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "i4i.16xlarge", + "name": "i4i.16xlarge", + "ram": 524288, + }, + "i4i.24xlarge": { + "bandwidth": 56250, + "disk": 22500, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4i.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "56250 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "6 x 3750 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "i4i.24xlarge", + "name": "i4i.24xlarge", + "ram": 786432, + }, + "i4i.2xlarge": { + "bandwidth": 12, + "disk": 1875, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4i.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1875 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "i4i.2xlarge", + "name": "i4i.2xlarge", + "ram": 65536, + }, + "i4i.32xlarge": { + "bandwidth": 75000, + "disk": 30000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4i.32xlarge", + "instancesku": "44CRDAV8AJ9ZMF4W", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "75000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 3750 SSD", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "i4i.32xlarge", + "name": "i4i.32xlarge", + "ram": 1048576, + }, + "i4i.4xlarge": { + "bandwidth": 25, + "disk": 3750, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4i.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 3750 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "i4i.4xlarge", + "name": "i4i.4xlarge", + "ram": 131072, + }, + "i4i.8xlarge": { + "bandwidth": 18750, + "disk": 7500, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4i.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 3750 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "i4i.8xlarge", + "name": "i4i.8xlarge", + "ram": 262144, + }, + "i4i.large": { + "bandwidth": 10, + "disk": 468, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4i.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 468 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "i4i.large", + "name": "i4i.large", + "ram": 16384, + }, + "i4i.xlarge": { + "bandwidth": 10, + "disk": 937, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i4i.xlarge", + "instancesku": "DU36AKRSXVPX42VR", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 937 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "i4i.xlarge", + "name": "i4i.xlarge", + "ram": 32768, + }, + "i7ie.12xlarge": { + "bandwidth": 50, + "disk": 30000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i7ie.12xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "Up to 50 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Scalable (Emerald Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 7500 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "i7ie.12xlarge", + "name": "i7ie.12xlarge", + "ram": 393216, + }, + "i7ie.18xlarge": { + "bandwidth": 75, + "disk": 45000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "22500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i7ie.18xlarge", + "instancesku": "DUZ3BPZ8C9RT7UHP", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "576 GiB", + "networkPerformance": "Up to 75 Gigabit", + "normalizationSizeFactor": "144", + "physicalProcessor": "Intel Xeon Scalable (Emerald Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "6 x 7500 NVMe SSD", + "vcpu": "72", + "vpcnetworkingsupport": "true", + }, + "id": "i7ie.18xlarge", + "name": "i7ie.18xlarge", + "ram": 589824, + }, + "i7ie.24xlarge": { + "bandwidth": 100, + "disk": 60000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i7ie.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "Up to 100 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Scalable (Emerald Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 7500 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "i7ie.24xlarge", + "name": "i7ie.24xlarge", + "ram": 786432, + }, + "i7ie.2xlarge": { + "bandwidth": 25, + "disk": 5000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i7ie.2xlarge", + "instancesku": "6G4AS3J58SHH7Q39", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Scalable (Emerald Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 2500 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "i7ie.2xlarge", + "name": "i7ie.2xlarge", + "ram": 65536, + }, + "i7ie.3xlarge": { + "bandwidth": 25, + "disk": 7500, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i7ie.3xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "24", + "physicalProcessor": "Intel Xeon Scalable (Emerald Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 7500 NVMe SSD", + "vcpu": "12", + "vpcnetworkingsupport": "true", + }, + "id": "i7ie.3xlarge", + "name": "i7ie.3xlarge", + "ram": 98304, + }, + "i7ie.48xlarge": { + "bandwidth": 100, + "disk": 120000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "60000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i7ie.48xlarge", + "instancesku": "K2Z4WKVRUR836V25", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1536 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "Intel Xeon Scalable (Emerald Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "16 x 7500 NVMe SSD", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "i7ie.48xlarge", + "name": "i7ie.48xlarge", + "ram": 1572864, + }, + "i7ie.6xlarge": { + "bandwidth": 25, + "disk": 15000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i7ie.6xlarge", + "instancesku": "BGVYBGUGSTSR3XZJ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "48", + "physicalProcessor": "Intel Xeon Scalable (Emerald Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 7500 NVMe SSD", + "vcpu": "24", + "vpcnetworkingsupport": "true", + }, + "id": "i7ie.6xlarge", + "name": "i7ie.6xlarge", + "ram": 196608, + }, + "i7ie.large": { + "bandwidth": 25, + "disk": 1250, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i7ie.large", + "instancesku": "VTAGUBST7RFQV7SE", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Scalable (Emerald Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1250 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "i7ie.large", + "name": "i7ie.large", + "ram": 16384, + }, + "i7ie.xlarge": { + "bandwidth": 25, + "disk": 2500, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i7ie.xlarge", + "instancesku": "GSC68K245DZH7G3P", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Scalable (Emerald Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 2500 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "i7ie.xlarge", + "name": "i7ie.xlarge", + "ram": 32768, + }, + "i8g.12xlarge": { + "bandwidth": 28, + "disk": 11250, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i8g.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "Up to 28.125 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "3 x 3750GB", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "i8g.12xlarge", + "name": "i8g.12xlarge", + "ram": 393216, + }, + "i8g.16xlarge": { + "bandwidth": 37, + "disk": 15000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i8g.16xlarge", + "instancesku": "MPZ5GEWS9NFBFXYX", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "Up to 37.5 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 3750GB", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "i8g.16xlarge", + "name": "i8g.16xlarge", + "ram": 524288, + }, + "i8g.24xlarge": { + "bandwidth": 56, + "disk": 22500, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i8g.24xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "Up to 56.25 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "6 x 3750GB", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "i8g.24xlarge", + "name": "i8g.24xlarge", + "ram": 786432, + }, + "i8g.2xlarge": { + "bandwidth": 12, + "disk": 1875, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i8g.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1875GB", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "i8g.2xlarge", + "name": "i8g.2xlarge", + "ram": 65536, + }, + "i8g.4xlarge": { + "bandwidth": 25, + "disk": 3750, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i8g.4xlarge", + "instancesku": "TJX3WPXPT52JFXS6", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 3750GB", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "i8g.4xlarge", + "name": "i8g.4xlarge", + "ram": 131072, + }, + "i8g.8xlarge": { + "bandwidth": 25, + "disk": 7500, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i8g.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 3750GB", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "i8g.8xlarge", + "name": "i8g.8xlarge", + "ram": 262144, + }, + "i8g.large": { + "bandwidth": 10, + "disk": 468, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i8g.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 468GB", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "i8g.large", + "name": "i8g.large", + "ram": 16384, + }, + "i8g.xlarge": { + "bandwidth": 10, + "disk": 937, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "i8g.xlarge", + "instancesku": "9WTCK83TR9JKZQF3", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 937GB", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "i8g.xlarge", + "name": "i8g.xlarge", + "ram": 32768, + }, + "im4gn.16xlarge": { + "bandwidth": 100, + "disk": 30000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "38000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "im4gn.16xlarge", + "instancesku": "78JF8766XR25JQ4E", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 7500 SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "im4gn.16xlarge", + "name": "im4gn.16xlarge", + "ram": 262144, + }, + "im4gn.2xlarge": { + "bandwidth": 25, + "disk": 3750, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "im4gn.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 3750 SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "im4gn.2xlarge", + "name": "im4gn.2xlarge", + "ram": 32768, + }, + "im4gn.4xlarge": { + "bandwidth": 25, + "disk": 7500, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "im4gn.4xlarge", + "instancesku": "GJU6C8CQMRJKD374", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 7500 SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "im4gn.4xlarge", + "name": "im4gn.4xlarge", + "ram": 65536, + }, + "im4gn.8xlarge": { + "bandwidth": 50, + "disk": 15000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "im4gn.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 7500 SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "im4gn.8xlarge", + "name": "im4gn.8xlarge", + "ram": 131072, + }, + "im4gn.large": { + "bandwidth": 25, + "disk": 937, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "im4gn.large", + "instancesku": "PQ6Y8UKZTPWYA3CM", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 937 SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "im4gn.large", + "name": "im4gn.large", + "ram": 8192, + }, + "im4gn.xlarge": { + "bandwidth": 25, + "disk": 1875, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "im4gn.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1875 SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "im4gn.xlarge", + "name": "im4gn.xlarge", + "ram": 16384, + }, + "inf1.24xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "inf1.24xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "NA", + "physicalProcessor": "Intel Xeon Platinum 8275CL (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "ap-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "inf1.24xlarge", + "name": "inf1.24xlarge", + "ram": 196608, + }, + "inf1.2xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "875 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "inf1.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "NA", + "physicalProcessor": "Intel Xeon Platinum 8275CL (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "inf1.2xlarge", + "name": "inf1.2xlarge", + "ram": 16384, + }, + "inf1.6xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "inf1.6xlarge", + "instancesku": "JE9QJJXKVRAHGWSA", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "48 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "NA", + "physicalProcessor": "Intel Xeon Platinum 8275CL (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "24", + "vpcnetworkingsupport": "true", + }, + "id": "inf1.6xlarge", + "name": "inf1.6xlarge", + "ram": 49152, + }, + "inf1.xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "875 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "inf1.xlarge", + "instancesku": "26TMKJU38MB7PCPQ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "NA", + "physicalProcessor": "Intel Xeon Platinum 8275CL (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "inf1.xlarge", + "name": "inf1.xlarge", + "ram": 8192, + }, + "inf2.24xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.95 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "192 GB", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "inf2.24xlarge", + "instancesku": "KDEF377GZKPPYTN8", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "8.560582329", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "inf2.24xlarge", + "name": "inf2.24xlarge", + "ram": 393216, + }, + "inf2.48xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.95 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "60 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "384 GB", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "inf2.48xlarge", + "instancesku": "XXQA8QTRGVP45XRD", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "17.12116466", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "inf2.48xlarge", + "name": "inf2.48xlarge", + "ram": 786432, + }, + "inf2.8xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.95 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "32 GB", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "inf2.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "2.595436335", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "inf2.8xlarge", + "name": "inf2.8xlarge", + "ram": 131072, + }, + "inf2.xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.95 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "32 GB", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "inf2.xlarge", + "instancesku": "V4BCUZVAZY7AJT2E", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "1", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "inf2.xlarge", + "name": "inf2.xlarge", + "ram": 16384, + }, + "is4gen.2xlarge": { + "bandwidth": 25, + "disk": 7500, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "is4gen.2xlarge", + "instancesku": "NY5C5H7P4B6UW9HK", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "48 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 7500 SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "is4gen.2xlarge", + "name": "is4gen.2xlarge", + "ram": 49152, + }, + "is4gen.4xlarge": { + "bandwidth": 25, + "disk": 15000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "is4gen.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 7500 SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "is4gen.4xlarge", + "name": "is4gen.4xlarge", + "ram": 98304, + }, + "is4gen.8xlarge": { + "bandwidth": 50, + "disk": 30000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "is4gen.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 7500 SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "is4gen.8xlarge", + "name": "is4gen.8xlarge", + "ram": 196608, + }, + "is4gen.large": { + "bandwidth": 25, + "disk": 1875, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "is4gen.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "12 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1875 SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "is4gen.large", + "name": "is4gen.large", + "ram": 12288, + }, + "is4gen.medium": { + "bandwidth": 25, + "disk": 937, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "is4gen.medium", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "6 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 937 SSD", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "is4gen.medium", + "name": "is4gen.medium", + "ram": 6144, + }, + "is4gen.xlarge": { + "bandwidth": 25, + "disk": 3750, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Storage optimized", + "instanceType": "is4gen.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "24 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 3750 SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "is4gen.xlarge", + "name": "is4gen.xlarge", + "ram": 24576, + }, + "m1.large": { + "bandwidth": None, + "disk": 840, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "currentGeneration": "No", + "ecu": "4", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m1.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "7.5 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 420 SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m1.large", + "name": "m1.large", + "ram": 7680, + }, + "m1.medium": { + "bandwidth": None, + "disk": 410, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "currentGeneration": "No", + "ecu": "2", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m1.medium", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "3.75 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "2", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "32-bit or 64-bit", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 410 SSD", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "m1.medium", + "name": "m1.medium", + "ram": 3840, + }, + "m1.small": { + "bandwidth": None, + "disk": 160, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "currentGeneration": "No", + "ecu": "1", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m1.small", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1.7 GiB", + "networkPerformance": "Low", + "normalizationSizeFactor": "1", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "32-bit or 64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 160 SSD", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "m1.small", + "name": "m1.small", + "ram": 1740, + }, + "m1.xlarge": { + "bandwidth": None, + "disk": 1680, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "currentGeneration": "No", + "ecu": "8", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m1.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "15 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 420 SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m1.xlarge", + "name": "m1.xlarge", + "ram": 15360, + }, + "m2.2xlarge": { + "bandwidth": None, + "disk": 850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "currentGeneration": "No", + "ecu": "13", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "m2.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "34.2 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 850 SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m2.2xlarge", + "name": "m2.2xlarge", + "ram": 35020, + }, + "m2.4xlarge": { + "bandwidth": None, + "disk": 1680, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "currentGeneration": "No", + "ecu": "26", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "m2.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "68.4 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 840 SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m2.4xlarge", + "name": "m2.4xlarge", + "ram": 70041, + }, + "m2.xlarge": { + "bandwidth": None, + "disk": 420, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "currentGeneration": "No", + "ecu": "6.5", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "m2.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "17.1 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 420 SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m2.xlarge", + "name": "m2.xlarge", + "ram": 17510, + }, + "m3.2xlarge": { + "bandwidth": None, + "disk": 160, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "1000 Mbps", + "ecu": "26", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m3.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "30 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge/Sandy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 80 SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m3.2xlarge", + "name": "m3.2xlarge", + "ram": 30720, + }, + "m3.large": { + "bandwidth": None, + "disk": 32, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "ecu": "6.5", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m3.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "7.5 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge/Sandy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 32 SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m3.large", + "name": "m3.large", + "ram": 7680, + }, + "m3.medium": { + "bandwidth": None, + "disk": 4, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "ecu": "3", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m3.medium", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "3.75 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "2", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge/Sandy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 4 SSD", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "m3.medium", + "name": "m3.medium", + "ram": 3840, + }, + "m3.xlarge": { + "bandwidth": None, + "disk": 80, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "dedicatedEbsThroughput": "500 Mbps", + "ecu": "13", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m3.xlarge", + "instancesku": "JCFYMXQEQ3BA57K3", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "15 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge/Sandy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 40 SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m3.xlarge", + "name": "m3.xlarge", + "ram": 15360, + }, + "m4.10xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4000 Mbps", + "ecu": "124.5", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m4.10xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "160 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "80", + "physicalProcessor": "Intel Xeon E5-2676 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "40", + "vpcnetworkingsupport": "true", + }, + "id": "m4.10xlarge", + "name": "m4.10xlarge", + "ram": 163840, + }, + "m4.16xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "188", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m4.16xlarge", + "instancesku": "9RRW6TTJ2K77NSDQ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m4.16xlarge", + "name": "m4.16xlarge", + "ram": 262144, + }, + "m4.2xlarge": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "1000 Mbps", + "ecu": "26", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m4.2xlarge", + "instancesku": "4DP9JW528SDT7HRV", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2676 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m4.2xlarge", + "name": "m4.2xlarge", + "ram": 32768, + }, + "m4.4xlarge": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2000 Mbps", + "ecu": "53.5", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m4.4xlarge", + "instancesku": "B5A2KQPVUB48X3ES", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon E5-2676 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m4.4xlarge", + "name": "m4.4xlarge", + "ram": 65536, + }, + "m4.large": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "450 Mbps", + "ecu": "6.5", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m4.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon E5-2676 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m4.large", + "name": "m4.large", + "ram": 8192, + }, + "m4.xlarge": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "750 Mbps", + "ecu": "13", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m4.xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon E5-2676 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m4.xlarge", + "name": "m4.xlarge", + "ram": 16384, + }, + "m5.12xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "168", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5.12xlarge", + "instancesku": "5SY86D6JMSFHE3FJ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m5.12xlarge", + "name": "m5.12xlarge", + "ram": 196608, + }, + "m5.16xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "256", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5.16xlarge", + "instancesku": "ZXZ774GKQ54RUX72", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m5.16xlarge", + "name": "m5.16xlarge", + "ram": 262144, + }, + "m5.24xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "12000 Mbps", + "ecu": "337", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m5.24xlarge", + "name": "m5.24xlarge", + "ram": 393216, + }, + "m5.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "37", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5.2xlarge", + "instancesku": "7DHN2N5PWU2GRR8X", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m5.2xlarge", + "name": "m5.2xlarge", + "ram": 32768, + }, + "m5.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2120 Mbps", + "ecu": "70", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m5.4xlarge", + "name": "m5.4xlarge", + "ram": 65536, + }, + "m5.8xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "128", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m5.8xlarge", + "name": "m5.8xlarge", + "ram": 131072, + }, + "m5.large": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "10", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m5.large", + "name": "m5.large", + "ram": 8192, + }, + "m5.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "16", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5.xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m5.xlarge", + "name": "m5.xlarge", + "ram": 16384, + }, + "m5a.12xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5a.12xlarge", + "instancesku": "6BBZ8RXFRQR2EXD6", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m5a.12xlarge", + "name": "m5a.12xlarge", + "ram": 196608, + }, + "m5a.16xlarge": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5a.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m5a.16xlarge", + "name": "m5a.16xlarge", + "ram": 262144, + }, + "m5a.24xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5a.24xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m5a.24xlarge", + "name": "m5a.24xlarge", + "ram": 393216, + }, + "m5a.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5a.2xlarge", + "instancesku": "NP557QB7VFTC48QX", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m5a.2xlarge", + "name": "m5a.2xlarge", + "ram": 32768, + }, + "m5a.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5a.4xlarge", + "instancesku": "YRM7GSGQEF9HKS2Q", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m5a.4xlarge", + "name": "m5a.4xlarge", + "ram": 65536, + }, + "m5a.8xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5a.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m5a.8xlarge", + "name": "m5a.8xlarge", + "ram": 131072, + }, + "m5a.large": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5a.large", + "instancesku": "JP2HVYDRPYGCX6DK", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m5a.large", + "name": "m5a.large", + "ram": 8192, + }, + "m5a.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5a.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m5a.xlarge", + "name": "m5a.xlarge", + "ram": 16384, + }, + "m5ad.12xlarge": { + "bandwidth": 10, + "disk": 1800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5ad.12xlarge", + "instancesku": "QMMYQRZBSV7ANC3N", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 900 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m5ad.12xlarge", + "name": "m5ad.12xlarge", + "ram": 196608, + }, + "m5ad.16xlarge": { + "bandwidth": 12, + "disk": 2400, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5ad.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 600 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m5ad.16xlarge", + "name": "m5ad.16xlarge", + "ram": 262144, + }, + "m5ad.24xlarge": { + "bandwidth": 20, + "disk": 3600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5ad.24xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 900 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m5ad.24xlarge", + "name": "m5ad.24xlarge", + "ram": 393216, + }, + "m5ad.2xlarge": { + "bandwidth": 10, + "disk": 300, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5ad.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 300 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m5ad.2xlarge", + "name": "m5ad.2xlarge", + "ram": 32768, + }, + "m5ad.4xlarge": { + "bandwidth": 10, + "disk": 600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5ad.4xlarge", + "instancesku": "BQ3N5HBDC5RD4EQK", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 300 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m5ad.4xlarge", + "name": "m5ad.4xlarge", + "ram": 65536, + }, + "m5ad.8xlarge": { + "bandwidth": 10, + "disk": 1200, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5ad.8xlarge", + "instancesku": "ZSG6WH8AYEW9Y5M2", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 600 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m5ad.8xlarge", + "name": "m5ad.8xlarge", + "ram": 131072, + }, + "m5ad.large": { + "bandwidth": 10, + "disk": 75, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5ad.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 75 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m5ad.large", + "name": "m5ad.large", + "ram": 8192, + }, + "m5ad.xlarge": { + "bandwidth": 10, + "disk": 150, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5ad.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 150 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m5ad.xlarge", + "name": "m5ad.xlarge", + "ram": 16384, + }, + "m5d.12xlarge": { + "bandwidth": 10, + "disk": 1800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "6000 Mbps", + "ecu": "168", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5d.12xlarge", + "instancesku": "UBWKCRY37QGF892F", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 900 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m5d.12xlarge", + "name": "m5d.12xlarge", + "ram": 196608, + }, + "m5d.16xlarge": { + "bandwidth": 20, + "disk": 2400, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "256", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5d.16xlarge", + "instancesku": "Z9BCFKSJEVHVJTTP", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 600 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m5d.16xlarge", + "name": "m5d.16xlarge", + "ram": 262144, + }, + "m5d.24xlarge": { + "bandwidth": 25, + "disk": 3600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "12000 Mbps", + "ecu": "337", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5d.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 900 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m5d.24xlarge", + "name": "m5d.24xlarge", + "ram": 393216, + }, + "m5d.2xlarge": { + "bandwidth": 10, + "disk": 300, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "37", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5d.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 300 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m5d.2xlarge", + "name": "m5d.2xlarge", + "ram": 32768, + }, + "m5d.4xlarge": { + "bandwidth": 10, + "disk": 600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2120 Mbps", + "ecu": "70", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5d.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 300 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m5d.4xlarge", + "name": "m5d.4xlarge", + "ram": 65536, + }, + "m5d.8xlarge": { + "bandwidth": 10, + "disk": 1200, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "128", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5d.8xlarge", + "instancesku": "EQ35NJ6KDC4A3TS8", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 600 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m5d.8xlarge", + "name": "m5d.8xlarge", + "ram": 131072, + }, + "m5d.large": { + "bandwidth": 10, + "disk": 75, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "10", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5d.large", + "instancesku": "PE8JXAQ4QGZHB9GT", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 75 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m5d.large", + "name": "m5d.large", + "ram": 8192, + }, + "m5d.xlarge": { + "bandwidth": 10, + "disk": 150, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "16", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5d.xlarge", + "instancesku": "GKEVTCW4GXTX52AW", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 150 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m5d.xlarge", + "name": "m5d.xlarge", + "ram": 16384, + }, + "m5dn.12xlarge": { + "bandwidth": 50, + "disk": 1800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5dn.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 900 GB NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m5dn.12xlarge", + "name": "m5dn.12xlarge", + "ram": 196608, + }, + "m5dn.16xlarge": { + "bandwidth": 75, + "disk": 2400, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5dn.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "75 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 600 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m5dn.16xlarge", + "name": "m5dn.16xlarge", + "ram": 262144, + }, + "m5dn.24xlarge": { + "bandwidth": 100, + "disk": 3600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5dn.24xlarge", + "instancesku": "G9H536RMY737GEM4", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 900 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m5dn.24xlarge", + "name": "m5dn.24xlarge", + "ram": 393216, + }, + "m5dn.2xlarge": { + "bandwidth": 25, + "disk": 300, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5dn.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 300 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m5dn.2xlarge", + "name": "m5dn.2xlarge", + "ram": 32768, + }, + "m5dn.4xlarge": { + "bandwidth": 25, + "disk": 600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5dn.4xlarge", + "instancesku": "3Y5Q72YU4JNPU6S5", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 300 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m5dn.4xlarge", + "name": "m5dn.4xlarge", + "ram": 65536, + }, + "m5dn.8xlarge": { + "bandwidth": 25, + "disk": 1200, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5dn.8xlarge", + "instancesku": "622SFRZSP5NFDFPF", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 600 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m5dn.8xlarge", + "name": "m5dn.8xlarge", + "ram": 131072, + }, + "m5dn.large": { + "bandwidth": 25, + "disk": 75, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5dn.large", + "instancesku": "SVUJNCR3NN2359RD", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 75 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m5dn.large", + "name": "m5dn.large", + "ram": 8192, + }, + "m5dn.xlarge": { + "bandwidth": 25, + "disk": 150, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5dn.xlarge", + "instancesku": "ZKG2QXGKGMNM2V2Q", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 150 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m5dn.xlarge", + "name": "m5dn.xlarge", + "ram": 16384, + }, + "m5n.12xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5n.12xlarge", + "instancesku": "BEXX757YG98NCW3T", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m5n.12xlarge", + "name": "m5n.12xlarge", + "ram": 196608, + }, + "m5n.16xlarge": { + "bandwidth": 75, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5n.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "75 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m5n.16xlarge", + "name": "m5n.16xlarge", + "ram": 262144, + }, + "m5n.24xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5n.24xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m5n.24xlarge", + "name": "m5n.24xlarge", + "ram": 393216, + }, + "m5n.2xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5n.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m5n.2xlarge", + "name": "m5n.2xlarge", + "ram": 32768, + }, + "m5n.4xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5n.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m5n.4xlarge", + "name": "m5n.4xlarge", + "ram": 65536, + }, + "m5n.8xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5n.8xlarge", + "instancesku": "B9H9FBY9ZKWXQT4E", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m5n.8xlarge", + "name": "m5n.8xlarge", + "ram": 131072, + }, + "m5n.large": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5n.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m5n.large", + "name": "m5n.large", + "ram": 8192, + }, + "m5n.xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5n.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m5n.xlarge", + "name": "m5n.xlarge", + "ram": 16384, + }, + "m5zn.12xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5zn.12xlarge", + "instancesku": "USMQJ4AAYGRVZ5AP", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8252", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m5zn.12xlarge", + "name": "m5zn.12xlarge", + "ram": 196608, + }, + "m5zn.2xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5zn.2xlarge", + "instancesku": "39TEUH9AS6NUZN5P", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8252", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m5zn.2xlarge", + "name": "m5zn.2xlarge", + "ram": 32768, + }, + "m5zn.3xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4750 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5zn.3xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "48 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "24", + "physicalProcessor": "Intel Xeon Platinum 8252", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "12", + "vpcnetworkingsupport": "true", + }, + "id": "m5zn.3xlarge", + "name": "m5zn.3xlarge", + "ram": 49152, + }, + "m5zn.6xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5zn.6xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "48", + "physicalProcessor": "Intel Xeon Platinum 8252", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "24", + "vpcnetworkingsupport": "true", + }, + "id": "m5zn.6xlarge", + "name": "m5zn.6xlarge", + "ram": 98304, + }, + "m5zn.large": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5zn.large", + "instancesku": "ZBF4HFE69XQJW6D8", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8252", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m5zn.large", + "name": "m5zn.large", + "ram": 8192, + }, + "m5zn.xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m5zn.xlarge", + "instancesku": "Z5KETQXBVZT4M8PQ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8252", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m5zn.xlarge", + "name": "m5zn.xlarge", + "ram": 16384, + }, + "m6a.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6a.12xlarge", + "instancesku": "KFZ2VQU4FWHRV75J", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m6a.12xlarge", + "name": "m6a.12xlarge", + "ram": 196608, + }, + "m6a.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "13333 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6a.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m6a.16xlarge", + "name": "m6a.16xlarge", + "ram": 262144, + }, + "m6a.24xlarge": { + "bandwidth": 37500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6a.24xlarge", + "instancesku": "6XNGM5G79WDEEFRP", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m6a.24xlarge", + "name": "m6a.24xlarge", + "ram": 393216, + }, + "m6a.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6a.2xlarge", + "instancesku": "FSC3WZK998TWNN9R", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m6a.2xlarge", + "name": "m6a.2xlarge", + "ram": 32768, + }, + "m6a.32xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "26667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6a.32xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "m6a.32xlarge", + "name": "m6a.32xlarge", + "ram": 524288, + }, + "m6a.48xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6a.48xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "m6a.48xlarge", + "name": "m6a.48xlarge", + "ram": 786432, + }, + "m6a.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6a.4xlarge", + "instancesku": "VE3T4952S7TVX7NF", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m6a.4xlarge", + "name": "m6a.4xlarge", + "ram": 65536, + }, + "m6a.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6a.8xlarge", + "instancesku": "TP4UNYCCECX5SY5U", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m6a.8xlarge", + "name": "m6a.8xlarge", + "ram": 131072, + }, + "m6a.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6a.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m6a.large", + "name": "m6a.large", + "ram": 8192, + }, + "m6a.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6a.xlarge", + "instancesku": "ZW78VK6K5BBFETQM", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m6a.xlarge", + "name": "m6a.xlarge", + "ram": 16384, + }, + "m6g.12xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "13500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6g.12xlarge", + "instancesku": "PZEND6REAYMUS8YC", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m6g.12xlarge", + "name": "m6g.12xlarge", + "ram": 196608, + }, + "m6g.16xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "18000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6g.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m6g.16xlarge", + "name": "m6g.16xlarge", + "ram": 262144, + }, + "m6g.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2250 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6g.2xlarge", + "instancesku": "PM34ANGUVKS67VQH", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m6g.2xlarge", + "name": "m6g.2xlarge", + "ram": 32768, + }, + "m6g.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6g.4xlarge", + "instancesku": "KFJKZ424RWQ9548M", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m6g.4xlarge", + "name": "m6g.4xlarge", + "ram": 65536, + }, + "m6g.8xlarge": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6g.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m6g.8xlarge", + "name": "m6g.8xlarge", + "ram": 131072, + }, + "m6g.large": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "600 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6g.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m6g.large", + "name": "m6g.large", + "ram": 8192, + }, + "m6g.medium": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "300 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6g.medium", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "m6g.medium", + "name": "m6g.medium", + "ram": 4096, + }, + "m6g.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "1125 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6g.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m6g.xlarge", + "name": "m6g.xlarge", + "ram": 16384, + }, + "m6gd.12xlarge": { + "bandwidth": 20, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "13500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6gd.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m6gd.12xlarge", + "name": "m6gd.12xlarge", + "ram": 196608, + }, + "m6gd.16xlarge": { + "bandwidth": 25, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "18000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6gd.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m6gd.16xlarge", + "name": "m6gd.16xlarge", + "ram": 262144, + }, + "m6gd.2xlarge": { + "bandwidth": 10, + "disk": 475, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6gd.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 475 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m6gd.2xlarge", + "name": "m6gd.2xlarge", + "ram": 32768, + }, + "m6gd.4xlarge": { + "bandwidth": 10, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6gd.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m6gd.4xlarge", + "name": "m6gd.4xlarge", + "ram": 65536, + }, + "m6gd.8xlarge": { + "bandwidth": 12, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6gd.8xlarge", + "instancesku": "HKW2CNJU63NTP3VD", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m6gd.8xlarge", + "name": "m6gd.8xlarge", + "ram": 131072, + }, + "m6gd.large": { + "bandwidth": 10, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6gd.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m6gd.large", + "name": "m6gd.large", + "ram": 8192, + }, + "m6gd.medium": { + "bandwidth": 10, + "disk": 59, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6gd.medium", + "instancesku": "6H7QZUZ9TJ7BPSXV", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 59 NVMe SSD", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "m6gd.medium", + "name": "m6gd.medium", + "ram": 4096, + }, + "m6gd.xlarge": { + "bandwidth": 10, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6gd.xlarge", + "instancesku": "TR5SD9T2SF7Q89SF", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m6gd.xlarge", + "name": "m6gd.xlarge", + "ram": 16384, + }, + "m6i.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6i.12xlarge", + "instancesku": "XWT95UWVSUQJ3HFY", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m6i.12xlarge", + "name": "m6i.12xlarge", + "ram": 196608, + }, + "m6i.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6i.16xlarge", + "instancesku": "QGFHA8Q4X2J9XPN7", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m6i.16xlarge", + "name": "m6i.16xlarge", + "ram": 262144, + }, + "m6i.24xlarge": { + "bandwidth": 37500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6i.24xlarge", + "instancesku": "FMKFHSXPVWDFY6YQ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m6i.24xlarge", + "name": "m6i.24xlarge", + "ram": 393216, + }, + "m6i.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6i.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m6i.2xlarge", + "name": "m6i.2xlarge", + "ram": 32768, + }, + "m6i.32xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6i.32xlarge", + "instancesku": "J2589GXE2X4QGE87", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "m6i.32xlarge", + "name": "m6i.32xlarge", + "ram": 524288, + }, + "m6i.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6i.4xlarge", + "instancesku": "T9KPTQ9DG8SF4SU7", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m6i.4xlarge", + "name": "m6i.4xlarge", + "ram": 65536, + }, + "m6i.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6i.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m6i.8xlarge", + "name": "m6i.8xlarge", + "ram": 131072, + }, + "m6i.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6i.large", + "instancesku": "3QKHM8YZH37EMM3S", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m6i.large", + "name": "m6i.large", + "ram": 8192, + }, + "m6i.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6i.xlarge", + "instancesku": "XA69DJ9RU98WA2XQ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m6i.xlarge", + "name": "m6i.xlarge", + "ram": 16384, + }, + "m6id.12xlarge": { + "bandwidth": 18750, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6id.12xlarge", + "instancesku": "SJT6DHS3Q4CSDS65", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m6id.12xlarge", + "name": "m6id.12xlarge", + "ram": 196608, + }, + "m6id.16xlarge": { + "bandwidth": 25000, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6id.16xlarge", + "instancesku": "V8NNMRT3FKM7YMWP", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m6id.16xlarge", + "name": "m6id.16xlarge", + "ram": 262144, + }, + "m6id.24xlarge": { + "bandwidth": 37500, + "disk": 5700, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6id.24xlarge", + "instancesku": "EQ5KP8HDGVJZRZ2Z", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1425 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m6id.24xlarge", + "name": "m6id.24xlarge", + "ram": 393216, + }, + "m6id.2xlarge": { + "bandwidth": 12500, + "disk": 474, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6id.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 474 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m6id.2xlarge", + "name": "m6id.2xlarge", + "ram": 32768, + }, + "m6id.32xlarge": { + "bandwidth": 50000, + "disk": 7600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6id.32xlarge", + "instancesku": "9WB3HXHUUECTE545", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1900 NVMe SSD", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "m6id.32xlarge", + "name": "m6id.32xlarge", + "ram": 524288, + }, + "m6id.4xlarge": { + "bandwidth": 12500, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6id.4xlarge", + "instancesku": "HJ9BZE6MX5MKXYEQ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m6id.4xlarge", + "name": "m6id.4xlarge", + "ram": 65536, + }, + "m6id.8xlarge": { + "bandwidth": 12500, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6id.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m6id.8xlarge", + "name": "m6id.8xlarge", + "ram": 131072, + }, + "m6id.large": { + "bandwidth": 12500, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6id.large", + "instancesku": "RXJZCED6FJWF8QJ2", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m6id.large", + "name": "m6id.large", + "ram": 8192, + }, + "m6id.xlarge": { + "bandwidth": 12500, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6id.xlarge", + "instancesku": "5AD6W95DBZ8CEEMB", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m6id.xlarge", + "name": "m6id.xlarge", + "ram": 16384, + }, + "m6idn.12xlarge": { + "bandwidth": 75000, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "37500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6idn.12xlarge", + "instancesku": "9K8VZMWCJENAA2F5", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "75000 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m6idn.12xlarge", + "name": "m6idn.12xlarge", + "ram": 196608, + }, + "m6idn.16xlarge": { + "bandwidth": 100000, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "50000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6idn.16xlarge", + "instancesku": "JB3UMKUBCXFM8QEP", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "100000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m6idn.16xlarge", + "name": "m6idn.16xlarge", + "ram": 262144, + }, + "m6idn.24xlarge": { + "bandwidth": 150000, + "disk": 5700, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "75000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6idn.24xlarge", + "instancesku": "QW53MBRRTP449U9U", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "150000 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1425 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m6idn.24xlarge", + "name": "m6idn.24xlarge", + "ram": 393216, + }, + "m6idn.2xlarge": { + "bandwidth": 40000, + "disk": 474, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6idn.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 40000 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 474 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m6idn.2xlarge", + "name": "m6idn.2xlarge", + "ram": 32768, + }, + "m6idn.32xlarge": { + "bandwidth": 200000, + "disk": 7600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "100000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6idn.32xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "200000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1900 NVMe SSD", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "m6idn.32xlarge", + "name": "m6idn.32xlarge", + "ram": 524288, + }, + "m6idn.4xlarge": { + "bandwidth": 50000, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6idn.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 50000 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m6idn.4xlarge", + "name": "m6idn.4xlarge", + "ram": 65536, + }, + "m6idn.8xlarge": { + "bandwidth": 50000, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6idn.8xlarge", + "instancesku": "TBYR7R7YDPZEXZHZ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m6idn.8xlarge", + "name": "m6idn.8xlarge", + "ram": 131072, + }, + "m6idn.large": { + "bandwidth": 25000, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6idn.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 25000 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m6idn.large", + "name": "m6idn.large", + "ram": 8192, + }, + "m6idn.xlarge": { + "bandwidth": 30000, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6idn.xlarge", + "instancesku": "5U57Y2C6X36HMCDU", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 30000 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m6idn.xlarge", + "name": "m6idn.xlarge", + "ram": 16384, + }, + "m6in.12xlarge": { + "bandwidth": 75000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "37500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6in.12xlarge", + "instancesku": "3G8D9HES8QGQK6RD", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "75000 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m6in.12xlarge", + "name": "m6in.12xlarge", + "ram": 196608, + }, + "m6in.16xlarge": { + "bandwidth": 100000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "50000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6in.16xlarge", + "instancesku": "E9REQNG3Y4NJ4J96", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "100000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m6in.16xlarge", + "name": "m6in.16xlarge", + "ram": 262144, + }, + "m6in.24xlarge": { + "bandwidth": 150000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "75000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6in.24xlarge", + "instancesku": "H24WAFC9E87MTRGD", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "150000 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m6in.24xlarge", + "name": "m6in.24xlarge", + "ram": 393216, + }, + "m6in.2xlarge": { + "bandwidth": 40000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6in.2xlarge", + "instancesku": "KC365TBZWZYP44X4", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 40000 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m6in.2xlarge", + "name": "m6in.2xlarge", + "ram": 32768, + }, + "m6in.32xlarge": { + "bandwidth": 200000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "100000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6in.32xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "200000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "m6in.32xlarge", + "name": "m6in.32xlarge", + "ram": 524288, + }, + "m6in.4xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6in.4xlarge", + "instancesku": "TQ9XX6PAN3H74WPV", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 50000 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m6in.4xlarge", + "name": "m6in.4xlarge", + "ram": 65536, + }, + "m6in.8xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6in.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m6in.8xlarge", + "name": "m6in.8xlarge", + "ram": 131072, + }, + "m6in.large": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6in.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 25000 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m6in.large", + "name": "m6in.large", + "ram": 8192, + }, + "m6in.xlarge": { + "bandwidth": 30000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m6in.xlarge", + "instancesku": "KU4YBKEN6838UZCE", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 30000 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m6in.xlarge", + "name": "m6in.xlarge", + "ram": 16384, + }, + "m7a.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7a.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m7a.12xlarge", + "name": "m7a.12xlarge", + "ram": 196608, + }, + "m7a.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7a.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m7a.16xlarge", + "name": "m7a.16xlarge", + "ram": 262144, + }, + "m7a.24xlarge": { + "bandwidth": 37500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7a.24xlarge", + "instancesku": "WD4GMXW9CSWQQ676", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m7a.24xlarge", + "name": "m7a.24xlarge", + "ram": 393216, + }, + "m7a.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7a.2xlarge", + "instancesku": "TTV4V7G52BN2MHHJ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m7a.2xlarge", + "name": "m7a.2xlarge", + "ram": 32768, + }, + "m7a.32xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7a.32xlarge", + "instancesku": "MPXAFP6AXX98RT7Z", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "m7a.32xlarge", + "name": "m7a.32xlarge", + "ram": 524288, + }, + "m7a.48xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7a.48xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "m7a.48xlarge", + "name": "m7a.48xlarge", + "ram": 786432, + }, + "m7a.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7a.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m7a.4xlarge", + "name": "m7a.4xlarge", + "ram": 65536, + }, + "m7a.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7a.8xlarge", + "instancesku": "AJ4DT835ZFN2SHZK", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m7a.8xlarge", + "name": "m7a.8xlarge", + "ram": 131072, + }, + "m7a.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7a.large", + "instancesku": "4J24EAVW8MK2ZBUZ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m7a.large", + "name": "m7a.large", + "ram": 8192, + }, + "m7a.medium": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7a.medium", + "instancesku": "CHCMF8EXG35ZCG8C", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "m7a.medium", + "name": "m7a.medium", + "ram": 4096, + }, + "m7a.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7a.xlarge", + "instancesku": "2387YVTKZPXRK3D8", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m7a.xlarge", + "name": "m7a.xlarge", + "ram": 16384, + }, + "m7g.12xlarge": { + "bandwidth": 22500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7g.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "22500 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m7g.12xlarge", + "name": "m7g.12xlarge", + "ram": 196608, + }, + "m7g.16xlarge": { + "bandwidth": 30, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7g.16xlarge", + "instancesku": "GGHDPF534R2KZS4J", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "30 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m7g.16xlarge", + "name": "m7g.16xlarge", + "ram": 262144, + }, + "m7g.2xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7g.2xlarge", + "instancesku": "SAV6N5BX7BW94B2X", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m7g.2xlarge", + "name": "m7g.2xlarge", + "ram": 32768, + }, + "m7g.4xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7g.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m7g.4xlarge", + "name": "m7g.4xlarge", + "ram": 65536, + }, + "m7g.8xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7g.8xlarge", + "instancesku": "J7ZYG6NVGP3KXF6T", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "15 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m7g.8xlarge", + "name": "m7g.8xlarge", + "ram": 131072, + }, + "m7g.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7g.large", + "instancesku": "QV8RCNQE2XGXV9J7", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m7g.large", + "name": "m7g.large", + "ram": 8192, + }, + "m7g.medium": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7g.medium", + "instancesku": "PYT8U3X9MJ82GKR9", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "m7g.medium", + "name": "m7g.medium", + "ram": 4096, + }, + "m7g.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7g.xlarge", + "instancesku": "A5ZDYYD96FGXHU22", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m7g.xlarge", + "name": "m7g.xlarge", + "ram": 16384, + }, + "m7gd.12xlarge": { + "bandwidth": 22500, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7gd.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "22500 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m7gd.12xlarge", + "name": "m7gd.12xlarge", + "ram": 196608, + }, + "m7gd.16xlarge": { + "bandwidth": 30, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7gd.16xlarge", + "instancesku": "3SRUAFSQTGMDY2B8", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "30 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m7gd.16xlarge", + "name": "m7gd.16xlarge", + "ram": 262144, + }, + "m7gd.2xlarge": { + "bandwidth": 15, + "disk": 475, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7gd.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 475 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m7gd.2xlarge", + "name": "m7gd.2xlarge", + "ram": 32768, + }, + "m7gd.4xlarge": { + "bandwidth": 15, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7gd.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m7gd.4xlarge", + "name": "m7gd.4xlarge", + "ram": 65536, + }, + "m7gd.8xlarge": { + "bandwidth": 15, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7gd.8xlarge", + "instancesku": "SVZECXW4DYGVAZAA", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "15 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m7gd.8xlarge", + "name": "m7gd.8xlarge", + "ram": 131072, + }, + "m7gd.large": { + "bandwidth": 12500, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7gd.large", + "instancesku": "KY3EMBYV494XVNZC", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m7gd.large", + "name": "m7gd.large", + "ram": 8192, + }, + "m7gd.medium": { + "bandwidth": 12500, + "disk": 59, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7gd.medium", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 59 NVMe SSD", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "m7gd.medium", + "name": "m7gd.medium", + "ram": 4096, + }, + "m7gd.xlarge": { + "bandwidth": 12500, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7gd.xlarge", + "instancesku": "DX78QR4R4G9TEN68", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m7gd.xlarge", + "name": "m7gd.xlarge", + "ram": 16384, + }, + "m7i-flex.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i-flex.12xlarge", + "instancesku": "T434T6R9XBK6XNCH", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "Up to 18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m7i-flex.12xlarge", + "name": "m7i-flex.12xlarge", + "ram": 196608, + }, + "m7i-flex.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i-flex.16xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "Up to 25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m7i-flex.16xlarge", + "name": "m7i-flex.16xlarge", + "ram": 262144, + }, + "m7i-flex.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i-flex.2xlarge", + "instancesku": "WQZ9EGYW4VCTDNC6", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m7i-flex.2xlarge", + "name": "m7i-flex.2xlarge", + "ram": 32768, + }, + "m7i-flex.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i-flex.4xlarge", + "instancesku": "3CECDFXBGJUVXA2K", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m7i-flex.4xlarge", + "name": "m7i-flex.4xlarge", + "ram": 65536, + }, + "m7i-flex.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i-flex.8xlarge", + "instancesku": "PR36FCC4XVPUX2RA", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m7i-flex.8xlarge", + "name": "m7i-flex.8xlarge", + "ram": 131072, + }, + "m7i-flex.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i-flex.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m7i-flex.large", + "name": "m7i-flex.large", + "ram": 8192, + }, + "m7i-flex.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i-flex.xlarge", + "instancesku": "G48VQNBX7U5V442V", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m7i-flex.xlarge", + "name": "m7i-flex.xlarge", + "ram": 16384, + }, + "m7i.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i.12xlarge", + "instancesku": "86SAJ2BS2H9N34K8", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m7i.12xlarge", + "name": "m7i.12xlarge", + "ram": 196608, + }, + "m7i.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i.16xlarge", + "instancesku": "KFXDGYA5B6TGN7C3", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m7i.16xlarge", + "name": "m7i.16xlarge", + "ram": 262144, + }, + "m7i.24xlarge": { + "bandwidth": 37500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m7i.24xlarge", + "name": "m7i.24xlarge", + "ram": 393216, + }, + "m7i.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i.2xlarge", + "instancesku": "2K3M2YB5KMHAWPSU", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m7i.2xlarge", + "name": "m7i.2xlarge", + "ram": 32768, + }, + "m7i.48xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i.48xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "m7i.48xlarge", + "name": "m7i.48xlarge", + "ram": 786432, + }, + "m7i.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m7i.4xlarge", + "name": "m7i.4xlarge", + "ram": 65536, + }, + "m7i.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m7i.8xlarge", + "name": "m7i.8xlarge", + "ram": 131072, + }, + "m7i.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i.large", + "instancesku": "RFCGCPF2C7PHAQ6U", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m7i.large", + "name": "m7i.large", + "ram": 8192, + }, + "m7i.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m7i.xlarge", + "instancesku": "2AJT6K2EBSS7QZFR", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m7i.xlarge", + "name": "m7i.xlarge", + "ram": 16384, + }, + "m8g.12xlarge": { + "bandwidth": 22, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m8g.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "22.5 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "m8g.12xlarge", + "name": "m8g.12xlarge", + "ram": 196608, + }, + "m8g.16xlarge": { + "bandwidth": 30, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m8g.16xlarge", + "instancesku": "XBV98BGWRJ7QUGPC", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "30 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "m8g.16xlarge", + "name": "m8g.16xlarge", + "ram": 262144, + }, + "m8g.24xlarge": { + "bandwidth": 40, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m8g.24xlarge", + "instancesku": "MYF3RF37SMVHCN94", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "40 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "m8g.24xlarge", + "name": "m8g.24xlarge", + "ram": 393216, + }, + "m8g.2xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m8g.2xlarge", + "instancesku": "VHR6K5EGBNXFEVFY", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "m8g.2xlarge", + "name": "m8g.2xlarge", + "ram": 32768, + }, + "m8g.48xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m8g.48xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "m8g.48xlarge", + "name": "m8g.48xlarge", + "ram": 786432, + }, + "m8g.4xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m8g.4xlarge", + "instancesku": "Y4GWK766P3Q4AD72", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "m8g.4xlarge", + "name": "m8g.4xlarge", + "ram": 65536, + }, + "m8g.8xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m8g.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "15 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "m8g.8xlarge", + "name": "m8g.8xlarge", + "ram": 131072, + }, + "m8g.large": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m8g.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12.5 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "m8g.large", + "name": "m8g.large", + "ram": 8192, + }, + "m8g.medium": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m8g.medium", + "instancesku": "HT8KKMMTD48AR8U8", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 12.5 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "m8g.medium", + "name": "m8g.medium", + "ram": 4096, + }, + "m8g.xlarge": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "m8g.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12.5 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "m8g.xlarge", + "name": "m8g.xlarge", + "ram": 16384, + }, + "p2.16xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "201", + "enhancedNetworkingSupported": "Yes", + "gpu": "16", + "gpuMemory": "NA", + "instanceFamily": "GPU instance", + "instanceType": "p2.16xlarge", + "instancesku": "8NZJVJPUUPFQD5XT", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "732 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "p2.16xlarge", + "name": "p2.16xlarge", + "ram": 749568, + }, + "p2.8xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "97", + "enhancedNetworkingSupported": "Yes", + "gpu": "8", + "gpuMemory": "NA", + "instanceFamily": "GPU instance", + "instanceType": "p2.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "488 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "p2.8xlarge", + "name": "p2.8xlarge", + "ram": 499712, + }, + "p2.xlarge": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "750 Mbps", + "ecu": "16", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "NA", + "instanceFamily": "GPU instance", + "instanceType": "p2.xlarge", + "instancesku": "BKKRW325YG73QXYH", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "61 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "p2.xlarge", + "name": "p2.xlarge", + "ram": 62464, + }, + "p3.16xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "201", + "enhancedNetworkingSupported": "Yes", + "gpu": "8", + "gpuMemory": "128 GiB", + "instanceFamily": "GPU instance", + "instanceType": "p3.16xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "488 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "p3.16xlarge", + "name": "p3.16xlarge", + "ram": 499712, + }, + "p3.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "1750 Mbps", + "ecu": "31", + "enhancedNetworkingSupported": "Yes", + "gpu": "1", + "gpuMemory": "16 GiB", + "instanceFamily": "GPU instance", + "instanceType": "p3.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "61 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "p3.2xlarge", + "name": "p3.2xlarge", + "ram": 62464, + }, + "p3.8xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "97", + "enhancedNetworkingSupported": "Yes", + "gpu": "4", + "gpuMemory": "64 GiB", + "instanceFamily": "GPU instance", + "instanceType": "p3.8xlarge", + "instancesku": "HCAHXPK7A9MBBZGN", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "244 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "p3.8xlarge", + "name": "p3.8xlarge", + "ram": 249856, + }, + "p3dn.24xlarge": { + "bandwidth": 100, + "disk": 1800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "337", + "enhancedNetworkingSupported": "Yes", + "gpu": "8", + "gpuMemory": "256 GiB", + "instanceFamily": "GPU instance", + "instanceType": "p3dn.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8175 (Skylake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 900 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "p3dn.24xlarge", + "name": "p3dn.24xlarge", + "ram": 786432, + }, + "p4d.24xlarge": { + "bandwidth": 400, + "disk": 8000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "345", + "enhancedNetworkingSupported": "No", + "gpu": "8", + "gpuMemory": "320 GB HBM2", + "instanceFamily": "GPU instance", + "instanceType": "p4d.24xlarge", + "instancesku": "2Z7ARVXU7PT7RXSJ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1152 GiB", + "networkPerformance": "400 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8275L", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 1000 SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "p4d.24xlarge", + "name": "p4d.24xlarge", + "ram": 1179648, + }, + "p4de.24xlarge": { + "bandwidth": 400, + "disk": 8000, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "345", + "enhancedNetworkingSupported": "No", + "gpu": "8", + "gpuMemory": "640 GB HBM2e", + "instanceFamily": "GPU instance", + "instanceType": "p4de.24xlarge", + "instancesku": "DSNTTSZSNTPZW8NS", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1152 GiB", + "networkPerformance": "400 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8275L", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 1000 SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "p4de.24xlarge", + "name": "p4de.24xlarge", + "ram": 1179648, + }, + "p5.48xlarge": { + "bandwidth": 3200, + "disk": 30720, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.95 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "80 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "8", + "gpuMemory": "640 GB HBM3", + "instanceFamily": "GPU instance", + "instanceType": "p5.48xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2048 GiB", + "networkPerformance": "3200 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 3840 GB SSD", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "p5.48xlarge", + "name": "p5.48xlarge", + "ram": 2097152, + }, + "p5e.48xlarge": { + "bandwidth": 3200, + "disk": 30720, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.95 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "80 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "8", + "gpuMemory": "1128 GB HBM3", + "instanceFamily": "GPU instance", + "instanceType": "p5e.48xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "CapacityBlock", + "memory": "2048 GiB", + "networkPerformance": "3200 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 3840 GB SSD", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "p5e.48xlarge", + "name": "p5e.48xlarge", + "ram": 2097152, + }, + "p5en.48xlarge": { + "bandwidth": 3200, + "disk": 30720, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "100 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpu": "8", + "gpuMemory": "141 GB HBM3e", + "instanceFamily": "GPU instance", + "instanceType": "p5en.48xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "CapacityBlock", + "memory": "2048 GiB", + "networkPerformance": "3200 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "8 x 3840 NVMe SSD", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "p5en.48xlarge", + "name": "p5en.48xlarge", + "ram": 2097152, + }, + "r3.2xlarge": { + "bandwidth": None, + "disk": 160, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "ecu": "26", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r3.2xlarge", + "instancesku": "MYE2APSUBDYT5XGN", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "61 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 160 SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r3.2xlarge", + "name": "r3.2xlarge", + "ram": 62464, + }, + "r3.4xlarge": { + "bandwidth": None, + "disk": 320, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "ecu": "52", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r3.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "122 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 320 SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r3.4xlarge", + "name": "r3.4xlarge", + "ram": 124928, + }, + "r3.8xlarge": { + "bandwidth": 10, + "disk": 640, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "ecu": "104", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r3.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "244 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 320 SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r3.8xlarge", + "name": "r3.8xlarge", + "ram": 249856, + }, + "r3.large": { + "bandwidth": None, + "disk": 32, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "ecu": "6.5", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r3.large", + "instancesku": "JXRNUMXAZNYRPC72", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "15.25 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 32 SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r3.large", + "name": "r3.large", + "ram": 15616, + }, + "r3.xlarge": { + "bandwidth": None, + "disk": 80, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "true", + "clockSpeed": "2.5 GHz", + "currentGeneration": "No", + "ecu": "13", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r3.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "30.5 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon E5-2670 v2 (Ivy Bridge)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 80 SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r3.xlarge", + "name": "r3.xlarge", + "ram": 31232, + }, + "r4.16xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "12000 Mbps", + "ecu": "201", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r4.16xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "488 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r4.16xlarge", + "name": "r4.16xlarge", + "ram": 499712, + }, + "r4.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "1600 Mbps", + "ecu": "31", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r4.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "61 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r4.2xlarge", + "name": "r4.2xlarge", + "ram": 62464, + }, + "r4.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3000 Mbps", + "ecu": "58", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r4.4xlarge", + "instancesku": "C9S5QU5S5T9EP9E3", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "122 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r4.4xlarge", + "name": "r4.4xlarge", + "ram": 124928, + }, + "r4.8xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "6000 Mbps", + "ecu": "97", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r4.8xlarge", + "instancesku": "6QBU7TR6TCVBPJC3", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "244 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r4.8xlarge", + "name": "r4.8xlarge", + "ram": 249856, + }, + "r4.large": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "400 Mbps", + "ecu": "8", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r4.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "15.25 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r4.large", + "name": "r4.large", + "ram": 15616, + }, + "r4.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "800 Mbps", + "ecu": "16", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r4.xlarge", + "instancesku": "MSR496BA8MMSSHES", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "30.5 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon E5-2686 v4 (Broadwell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r4.xlarge", + "name": "r4.xlarge", + "ram": 31232, + }, + "r5.12xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9500 Mbps", + "ecu": "168", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5.12xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r5.12xlarge", + "name": "r5.12xlarge", + "ram": 393216, + }, + "r5.16xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "13600 Mbps", + "ecu": "256", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5.16xlarge", + "instancesku": "NAT7A478TMR4QGPN", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r5.16xlarge", + "name": "r5.16xlarge", + "ram": 524288, + }, + "r5.24xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "337", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r5.24xlarge", + "name": "r5.24xlarge", + "ram": 786432, + }, + "r5.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4750 Mbps", + "ecu": "37", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r5.2xlarge", + "name": "r5.2xlarge", + "ram": 65536, + }, + "r5.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4750 Mbps", + "ecu": "70", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r5.4xlarge", + "name": "r5.4xlarge", + "ram": 131072, + }, + "r5.8xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "6800 Mbps", + "ecu": "128", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5.8xlarge", + "instancesku": "5Q2X664FUPK733XT", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r5.8xlarge", + "name": "r5.8xlarge", + "ram": 262144, + }, + "r5.large": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4750 Mbps", + "ecu": "10", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r5.large", + "name": "r5.large", + "ram": 16384, + }, + "r5.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4750 Mbps", + "ecu": "19", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5.xlarge", + "instancesku": "8UGGWQHV44F4KH8W", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r5.xlarge", + "name": "r5.xlarge", + "ram": 32768, + }, + "r5a.12xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5a.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r5a.12xlarge", + "name": "r5a.12xlarge", + "ram": 393216, + }, + "r5a.16xlarge": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5a.16xlarge", + "instancesku": "2B3VAYDSHV6M39S6", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r5a.16xlarge", + "name": "r5a.16xlarge", + "ram": 524288, + }, + "r5a.24xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5a.24xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r5a.24xlarge", + "name": "r5a.24xlarge", + "ram": 786432, + }, + "r5a.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5a.2xlarge", + "instancesku": "4YMCRU5MXH67KH3C", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r5a.2xlarge", + "name": "r5a.2xlarge", + "ram": 65536, + }, + "r5a.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5a.4xlarge", + "instancesku": "BCXRZNBDWWSKS95T", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r5a.4xlarge", + "name": "r5a.4xlarge", + "ram": 131072, + }, + "r5a.8xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5a.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r5a.8xlarge", + "name": "r5a.8xlarge", + "ram": 262144, + }, + "r5a.large": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5a.large", + "instancesku": "HXFJ8J7KRRDCUQDF", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r5a.large", + "name": "r5a.large", + "ram": 16384, + }, + "r5a.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5a.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r5a.xlarge", + "name": "r5a.xlarge", + "ram": 32768, + }, + "r5ad.12xlarge": { + "bandwidth": 10, + "disk": 1800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5ad.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 900 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r5ad.12xlarge", + "name": "r5ad.12xlarge", + "ram": 393216, + }, + "r5ad.16xlarge": { + "bandwidth": 12, + "disk": 2400, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5ad.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 600 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r5ad.16xlarge", + "name": "r5ad.16xlarge", + "ram": 524288, + }, + "r5ad.24xlarge": { + "bandwidth": 20, + "disk": 3600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5ad.24xlarge", + "instancesku": "AYARQMMWY3KRT3Z8", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 900 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r5ad.24xlarge", + "name": "r5ad.24xlarge", + "ram": 786432, + }, + "r5ad.2xlarge": { + "bandwidth": 10, + "disk": 300, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5ad.2xlarge", + "instancesku": "UQNYM2QVMBNC9SBD", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 300 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r5ad.2xlarge", + "name": "r5ad.2xlarge", + "ram": 65536, + }, + "r5ad.4xlarge": { + "bandwidth": 10, + "disk": 600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5ad.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 300 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r5ad.4xlarge", + "name": "r5ad.4xlarge", + "ram": 131072, + }, + "r5ad.8xlarge": { + "bandwidth": 10, + "disk": 1200, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5ad.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 600 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r5ad.8xlarge", + "name": "r5ad.8xlarge", + "ram": 262144, + }, + "r5ad.large": { + "bandwidth": 10, + "disk": 75, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5ad.large", + "instancesku": "ZT4UK6N7AH37F6Q2", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 75 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r5ad.large", + "name": "r5ad.large", + "ram": 16384, + }, + "r5ad.xlarge": { + "bandwidth": 10, + "disk": 150, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5ad.xlarge", + "instancesku": "HZJ8V6JGDWGUM5QF", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 150 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r5ad.xlarge", + "name": "r5ad.xlarge", + "ram": 32768, + }, + "r5b.12xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5b.12xlarge", + "instancesku": "XFAAGEXXCF8D5UCC", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r5b.12xlarge", + "name": "r5b.12xlarge", + "ram": 393216, + }, + "r5b.16xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5b.16xlarge", + "instancesku": "6U7DBQWKEUPM26YD", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r5b.16xlarge", + "name": "r5b.16xlarge", + "ram": 524288, + }, + "r5b.24xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "60 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5b.24xlarge", + "instancesku": "ACQGXR86YVD63UND", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r5b.24xlarge", + "name": "r5b.24xlarge", + "ram": 786432, + }, + "r5b.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 12.5 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5b.2xlarge", + "instancesku": "UMH7BAMYN73TQGWY", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r5b.2xlarge", + "name": "r5b.2xlarge", + "ram": 65536, + }, + "r5b.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5b.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r5b.4xlarge", + "name": "r5b.4xlarge", + "ram": 131072, + }, + "r5b.8xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5b.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r5b.8xlarge", + "name": "r5b.8xlarge", + "ram": 262144, + }, + "r5b.large": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5b.large", + "instancesku": "P8BAP4U25KDKYSE7", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r5b.large", + "name": "r5b.large", + "ram": 16384, + }, + "r5b.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5b.xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r5b.xlarge", + "name": "r5b.xlarge", + "ram": 32768, + }, + "r5d.12xlarge": { + "bandwidth": 10, + "disk": 1800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "6000 Mbps", + "ecu": "168", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5d.12xlarge", + "instancesku": "JD26ZJK92H6X64TZ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 900 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r5d.12xlarge", + "name": "r5d.12xlarge", + "ram": 393216, + }, + "r5d.16xlarge": { + "bandwidth": 20, + "disk": 2400, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "256", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5d.16xlarge", + "instancesku": "XJ5CFKTMG2X7XGD7", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 600 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r5d.16xlarge", + "name": "r5d.16xlarge", + "ram": 524288, + }, + "r5d.24xlarge": { + "bandwidth": 25, + "disk": 3600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "12000 Mbps", + "ecu": "337", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5d.24xlarge", + "instancesku": "9H8W7UEREMEYWDWH", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 900 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r5d.24xlarge", + "name": "r5d.24xlarge", + "ram": 786432, + }, + "r5d.2xlarge": { + "bandwidth": 10, + "disk": 300, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "37", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5d.2xlarge", + "instancesku": "W5UKUYPDGRSFBTEH", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 300 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r5d.2xlarge", + "name": "r5d.2xlarge", + "ram": 65536, + }, + "r5d.4xlarge": { + "bandwidth": 10, + "disk": 600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2120 Mbps", + "ecu": "70", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5d.4xlarge", + "instancesku": "XV8MVPMGEYQC3PX7", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 300 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r5d.4xlarge", + "name": "r5d.4xlarge", + "ram": 131072, + }, + "r5d.8xlarge": { + "bandwidth": 10, + "disk": 1200, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "128", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5d.8xlarge", + "instancesku": "QCJ53WA9MJMS6BDC", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 600 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r5d.8xlarge", + "name": "r5d.8xlarge", + "ram": 262144, + }, + "r5d.large": { + "bandwidth": 10, + "disk": 75, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "10", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5d.large", + "instancesku": "CUZ6G9ZCUKT64FJS", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 75 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r5d.large", + "name": "r5d.large", + "ram": 16384, + }, + "r5d.xlarge": { + "bandwidth": 10, + "disk": 150, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "19", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5d.xlarge", + "instancesku": "2NUFS4WQ7FCZY3CX", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8175", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 150 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r5d.xlarge", + "name": "r5d.xlarge", + "ram": 32768, + }, + "r5dn.12xlarge": { + "bandwidth": 50, + "disk": 1800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "6000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5dn.12xlarge", + "instancesku": "KP8X3ZRFBR5BE2QG", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 900 GB NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r5dn.12xlarge", + "name": "r5dn.12xlarge", + "ram": 393216, + }, + "r5dn.16xlarge": { + "bandwidth": 75, + "disk": 2400, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5dn.16xlarge", + "instancesku": "HESW5QVR6YKYRWZ8", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "75 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 600 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r5dn.16xlarge", + "name": "r5dn.16xlarge", + "ram": 524288, + }, + "r5dn.24xlarge": { + "bandwidth": 100, + "disk": 3600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "12000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5dn.24xlarge", + "instancesku": "8PAUA987J4Q8MTRH", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 900 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r5dn.24xlarge", + "name": "r5dn.24xlarge", + "ram": 786432, + }, + "r5dn.2xlarge": { + "bandwidth": 25, + "disk": 300, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5dn.2xlarge", + "instancesku": "5TFDK9PHN5A9RS5A", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "eu-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 300 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r5dn.2xlarge", + "name": "r5dn.2xlarge", + "ram": 65536, + }, + "r5dn.4xlarge": { + "bandwidth": 25, + "disk": 600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5dn.4xlarge", + "instancesku": "PVTMYYCT833KAG2E", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 300 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r5dn.4xlarge", + "name": "r5dn.4xlarge", + "ram": 131072, + }, + "r5dn.8xlarge": { + "bandwidth": 25, + "disk": 1200, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5dn.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 600 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r5dn.8xlarge", + "name": "r5dn.8xlarge", + "ram": 262144, + }, + "r5dn.large": { + "bandwidth": 25, + "disk": 75, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5dn.large", + "instancesku": "K4T5UGP4HDGJPFH7", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 75 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r5dn.large", + "name": "r5dn.large", + "ram": 16384, + }, + "r5dn.xlarge": { + "bandwidth": 25, + "disk": 150, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5dn.xlarge", + "instancesku": "PTAK6AMJWZ33TRF6", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 150 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r5dn.xlarge", + "name": "r5dn.xlarge", + "ram": 32768, + }, + "r5n.12xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "6000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5n.12xlarge", + "instancesku": "SMH7GCC45SZ6USV6", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r5n.12xlarge", + "name": "r5n.12xlarge", + "ram": 393216, + }, + "r5n.16xlarge": { + "bandwidth": 75, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5n.16xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "75 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r5n.16xlarge", + "name": "r5n.16xlarge", + "ram": 524288, + }, + "r5n.24xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "12000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5n.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r5n.24xlarge", + "name": "r5n.24xlarge", + "ram": 786432, + }, + "r5n.2xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5n.2xlarge", + "instancesku": "E73XR9X29XEVC78A", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r5n.2xlarge", + "name": "r5n.2xlarge", + "ram": 65536, + }, + "r5n.4xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5n.4xlarge", + "instancesku": "XAPBMPSJVJ5EWR55", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r5n.4xlarge", + "name": "r5n.4xlarge", + "ram": 131072, + }, + "r5n.8xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "5000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5n.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r5n.8xlarge", + "name": "r5n.8xlarge", + "ram": 262144, + }, + "r5n.large": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5n.large", + "instancesku": "6WD6N47RFBKDZDF8", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r5n.large", + "name": "r5n.large", + "ram": 16384, + }, + "r5n.xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2120 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r5n.xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8259 (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r5n.xlarge", + "name": "r5n.xlarge", + "ram": 32768, + }, + "r6a.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6a.12xlarge", + "instancesku": "5RG27YCVCH2MSGJR", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r6a.12xlarge", + "name": "r6a.12xlarge", + "ram": 393216, + }, + "r6a.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "13333 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6a.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r6a.16xlarge", + "name": "r6a.16xlarge", + "ram": 524288, + }, + "r6a.24xlarge": { + "bandwidth": 37500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6a.24xlarge", + "instancesku": "MSN6FFMJFF9MMQVA", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r6a.24xlarge", + "name": "r6a.24xlarge", + "ram": 786432, + }, + "r6a.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6a.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r6a.2xlarge", + "name": "r6a.2xlarge", + "ram": 65536, + }, + "r6a.32xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "26667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6a.32xlarge", + "instancesku": "7BSD878TFSBBCHD2", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "r6a.32xlarge", + "name": "r6a.32xlarge", + "ram": 1048576, + }, + "r6a.48xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6a.48xlarge", + "instancesku": "TUKRAD8KDFD7PMUX", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1536 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "r6a.48xlarge", + "name": "r6a.48xlarge", + "ram": 1572864, + }, + "r6a.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6a.4xlarge", + "instancesku": "VM2H22UZVW5658C9", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r6a.4xlarge", + "name": "r6a.4xlarge", + "ram": 131072, + }, + "r6a.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6a.8xlarge", + "instancesku": "GHFUUFQUYNGYV4M3", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r6a.8xlarge", + "name": "r6a.8xlarge", + "ram": 262144, + }, + "r6a.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6a.large", + "instancesku": "RTBTCPPPNNMZZZRE", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r6a.large", + "name": "r6a.large", + "ram": 16384, + }, + "r6a.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.6 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 6667 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6a.xlarge", + "instancesku": "M6ZJ4JJYJXW3FH72", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 7R13 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r6a.xlarge", + "name": "r6a.xlarge", + "ram": 32768, + }, + "r6g.12xlarge": { + "bandwidth": 20, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "13500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6g.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r6g.12xlarge", + "name": "r6g.12xlarge", + "ram": 393216, + }, + "r6g.16xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "18000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6g.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r6g.16xlarge", + "name": "r6g.16xlarge", + "ram": 524288, + }, + "r6g.2xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6g.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r6g.2xlarge", + "name": "r6g.2xlarge", + "ram": 65536, + }, + "r6g.4xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6g.4xlarge", + "instancesku": "G9CVKPRNCE3JEHNA", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r6g.4xlarge", + "name": "r6g.4xlarge", + "ram": 131072, + }, + "r6g.8xlarge": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6g.8xlarge", + "instancesku": "JU3XS3CSJVG9PG6T", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r6g.8xlarge", + "name": "r6g.8xlarge", + "ram": 262144, + }, + "r6g.large": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6g.large", + "instancesku": "3F7S3UNTHN3MP78B", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r6g.large", + "name": "r6g.large", + "ram": 16384, + }, + "r6g.medium": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6g.medium", + "instancesku": "94RYVQHX4TWDPAUG", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "r6g.medium", + "name": "r6g.medium", + "ram": 8192, + }, + "r6g.xlarge": { + "bandwidth": 10, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6g.xlarge", + "instancesku": "QCPDTQPKB7E87SYY", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r6g.xlarge", + "name": "r6g.xlarge", + "ram": 32768, + }, + "r6gd.12xlarge": { + "bandwidth": 20, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "13500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6gd.12xlarge", + "instancesku": "DQHFFY2N32GJ4KHG", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r6gd.12xlarge", + "name": "r6gd.12xlarge", + "ram": 393216, + }, + "r6gd.16xlarge": { + "bandwidth": 25, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "18000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6gd.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r6gd.16xlarge", + "name": "r6gd.16xlarge", + "ram": 524288, + }, + "r6gd.2xlarge": { + "bandwidth": 10, + "disk": 475, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6gd.2xlarge", + "instancesku": "NKKKMUC8VTHJGNJ3", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 475 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r6gd.2xlarge", + "name": "r6gd.2xlarge", + "ram": 65536, + }, + "r6gd.4xlarge": { + "bandwidth": 10, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6gd.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r6gd.4xlarge", + "name": "r6gd.4xlarge", + "ram": 131072, + }, + "r6gd.8xlarge": { + "bandwidth": 12, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6gd.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r6gd.8xlarge", + "name": "r6gd.8xlarge", + "ram": 262144, + }, + "r6gd.large": { + "bandwidth": 10, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6gd.large", + "instancesku": "E4YG7JC73SCP7EKG", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r6gd.large", + "name": "r6gd.large", + "ram": 16384, + }, + "r6gd.medium": { + "bandwidth": 10, + "disk": 59, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6gd.medium", + "instancesku": "6UT3UMQBXYMNWFKU", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 59 NVMe SSD", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "r6gd.medium", + "name": "r6gd.medium", + "ram": 8192, + }, + "r6gd.xlarge": { + "bandwidth": 10, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6gd.xlarge", + "instancesku": "T8TGZ93MC3QPTCKS", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r6gd.xlarge", + "name": "r6gd.xlarge", + "ram": 32768, + }, + "r6i.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6i.12xlarge", + "instancesku": "KBT26J6CP63QFBHJ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r6i.12xlarge", + "name": "r6i.12xlarge", + "ram": 393216, + }, + "r6i.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6i.16xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r6i.16xlarge", + "name": "r6i.16xlarge", + "ram": 524288, + }, + "r6i.24xlarge": { + "bandwidth": 37500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6i.24xlarge", + "instancesku": "KAZ35PTYHRGQXF48", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r6i.24xlarge", + "name": "r6i.24xlarge", + "ram": 786432, + }, + "r6i.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6i.2xlarge", + "instancesku": "GCMURA7T4XN4SCDF", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r6i.2xlarge", + "name": "r6i.2xlarge", + "ram": 65536, + }, + "r6i.32xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6i.32xlarge", + "instancesku": "NAXJMGJV4T3ATM9C", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "r6i.32xlarge", + "name": "r6i.32xlarge", + "ram": 1048576, + }, + "r6i.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6i.4xlarge", + "instancesku": "VT8HNM5SDM24MGDZ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r6i.4xlarge", + "name": "r6i.4xlarge", + "ram": 131072, + }, + "r6i.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6i.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r6i.8xlarge", + "name": "r6i.8xlarge", + "ram": 262144, + }, + "r6i.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6i.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r6i.large", + "name": "r6i.large", + "ram": 16384, + }, + "r6i.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6i.xlarge", + "instancesku": "29ZSGZP5P8R5RKJF", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r6i.xlarge", + "name": "r6i.xlarge", + "ram": 32768, + }, + "r6id.12xlarge": { + "bandwidth": 18750, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6id.12xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r6id.12xlarge", + "name": "r6id.12xlarge", + "ram": 393216, + }, + "r6id.16xlarge": { + "bandwidth": 25000, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6id.16xlarge", + "instancesku": "BBCJTJTX4TBRMRTH", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r6id.16xlarge", + "name": "r6id.16xlarge", + "ram": 524288, + }, + "r6id.24xlarge": { + "bandwidth": 37500, + "disk": 5700, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6id.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1425 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r6id.24xlarge", + "name": "r6id.24xlarge", + "ram": 786432, + }, + "r6id.2xlarge": { + "bandwidth": 12500, + "disk": 474, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6id.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 474 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r6id.2xlarge", + "name": "r6id.2xlarge", + "ram": 65536, + }, + "r6id.32xlarge": { + "bandwidth": 50000, + "disk": 7600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6id.32xlarge", + "instancesku": "XYMMETJ9Z87XA8TR", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1900 NVMe SSD", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "r6id.32xlarge", + "name": "r6id.32xlarge", + "ram": 1048576, + }, + "r6id.4xlarge": { + "bandwidth": 12500, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6id.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r6id.4xlarge", + "name": "r6id.4xlarge", + "ram": 131072, + }, + "r6id.8xlarge": { + "bandwidth": 12500, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6id.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r6id.8xlarge", + "name": "r6id.8xlarge", + "ram": 262144, + }, + "r6id.large": { + "bandwidth": 12500, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6id.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r6id.large", + "name": "r6id.large", + "ram": 16384, + }, + "r6id.xlarge": { + "bandwidth": 12500, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6id.xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r6id.xlarge", + "name": "r6id.xlarge", + "ram": 32768, + }, + "r6idn.12xlarge": { + "bandwidth": 75000, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "37500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6idn.12xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "75000 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r6idn.12xlarge", + "name": "r6idn.12xlarge", + "ram": 393216, + }, + "r6idn.16xlarge": { + "bandwidth": 100000, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "50000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6idn.16xlarge", + "instancesku": "6BH5ZTEN6R6YJ3YG", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "100000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r6idn.16xlarge", + "name": "r6idn.16xlarge", + "ram": 524288, + }, + "r6idn.24xlarge": { + "bandwidth": 150000, + "disk": 5700, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "75000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6idn.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "150000 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1425 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r6idn.24xlarge", + "name": "r6idn.24xlarge", + "ram": 786432, + }, + "r6idn.2xlarge": { + "bandwidth": 40000, + "disk": 474, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6idn.2xlarge", + "instancesku": "2CCXZVH7FXHA6NM3", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 40000 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 474 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r6idn.2xlarge", + "name": "r6idn.2xlarge", + "ram": 65536, + }, + "r6idn.32xlarge": { + "bandwidth": 200000, + "disk": 7600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "100000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6idn.32xlarge", + "instancesku": "C6KYJ3WR8DKTBUC6", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "200000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1900 NVMe SSD", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "r6idn.32xlarge", + "name": "r6idn.32xlarge", + "ram": 1048576, + }, + "r6idn.4xlarge": { + "bandwidth": 50000, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6idn.4xlarge", + "instancesku": "5CN8UXJSHXERVCZU", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 50000 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r6idn.4xlarge", + "name": "r6idn.4xlarge", + "ram": 131072, + }, + "r6idn.8xlarge": { + "bandwidth": 50000, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6idn.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r6idn.8xlarge", + "name": "r6idn.8xlarge", + "ram": 262144, + }, + "r6idn.large": { + "bandwidth": 25000, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6idn.large", + "instancesku": "5CDH8SVCHUP5NGE8", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25000 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r6idn.large", + "name": "r6idn.large", + "ram": 16384, + }, + "r6idn.xlarge": { + "bandwidth": 30000, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6idn.xlarge", + "instancesku": "VYK62GH26Z3UYC53", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 30000 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r6idn.xlarge", + "name": "r6idn.xlarge", + "ram": 32768, + }, + "r6in.12xlarge": { + "bandwidth": 75000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "37500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6in.12xlarge", + "instancesku": "PMW3R75PXPMWGBG2", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "75000 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r6in.12xlarge", + "name": "r6in.12xlarge", + "ram": 393216, + }, + "r6in.16xlarge": { + "bandwidth": 100000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "50000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6in.16xlarge", + "instancesku": "EDNTTCS2UZXSQU8Q", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "100000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r6in.16xlarge", + "name": "r6in.16xlarge", + "ram": 524288, + }, + "r6in.24xlarge": { + "bandwidth": 150000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "75000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6in.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "150000 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r6in.24xlarge", + "name": "r6in.24xlarge", + "ram": 786432, + }, + "r6in.2xlarge": { + "bandwidth": 40000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6in.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 40000 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r6in.2xlarge", + "name": "r6in.2xlarge", + "ram": 65536, + }, + "r6in.32xlarge": { + "bandwidth": 200000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "100000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6in.32xlarge", + "instancesku": "HK566QER6ER83H8R", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "200000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "r6in.32xlarge", + "name": "r6in.32xlarge", + "ram": 1048576, + }, + "r6in.4xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6in.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 50000 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r6in.4xlarge", + "name": "r6in.4xlarge", + "ram": 131072, + }, + "r6in.8xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6in.8xlarge", + "instancesku": "BMWXPVMCNAC4V8NB", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r6in.8xlarge", + "name": "r6in.8xlarge", + "ram": 262144, + }, + "r6in.large": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6in.large", + "instancesku": "W8E4N62D3S8UQRGJ", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 25000 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r6in.large", + "name": "r6in.large", + "ram": 16384, + }, + "r6in.xlarge": { + "bandwidth": 30000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 25000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r6in.xlarge", + "instancesku": "F9ARFW2XYSF59Y7G", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 30000 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon 8375C (Ice Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r6in.xlarge", + "name": "r6in.xlarge", + "ram": 32768, + }, + "r7a.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7a.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r7a.12xlarge", + "name": "r7a.12xlarge", + "ram": 393216, + }, + "r7a.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7a.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r7a.16xlarge", + "name": "r7a.16xlarge", + "ram": 524288, + }, + "r7a.24xlarge": { + "bandwidth": 37500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7a.24xlarge", + "instancesku": "RDZ28YFNQ8W3XZ48", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r7a.24xlarge", + "name": "r7a.24xlarge", + "ram": 786432, + }, + "r7a.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7a.2xlarge", + "instancesku": "7B3NKAHPX6WJAATD", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r7a.2xlarge", + "name": "r7a.2xlarge", + "ram": 65536, + }, + "r7a.32xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7a.32xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "r7a.32xlarge", + "name": "r7a.32xlarge", + "ram": 1048576, + }, + "r7a.48xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7a.48xlarge", + "instancesku": "3SR9U89YWT5BCY6S", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1536 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "r7a.48xlarge", + "name": "r7a.48xlarge", + "ram": 1572864, + }, + "r7a.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7a.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r7a.4xlarge", + "name": "r7a.4xlarge", + "ram": 131072, + }, + "r7a.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7a.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r7a.8xlarge", + "name": "r7a.8xlarge", + "ram": 262144, + }, + "r7a.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7a.large", + "instancesku": "EGGQMFNY6FSM369C", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r7a.large", + "name": "r7a.large", + "ram": 16384, + }, + "r7a.medium": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7a.medium", + "instancesku": "3UZ6JNF8DAUTDUHR", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "r7a.medium", + "name": "r7a.medium", + "ram": 8192, + }, + "r7a.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7a.xlarge", + "instancesku": "MKGAUZQRFHDZD57A", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 9R14 Processor", + "processorArchitecture": "64-bit", + "processorFeatures": "AMD Turbo; AVX; AVX2; AVX512", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r7a.xlarge", + "name": "r7a.xlarge", + "ram": 32768, + }, + "r7g.12xlarge": { + "bandwidth": 22500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7g.12xlarge", + "instancesku": "GJFFKNW2JFBP36PV", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "22500 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r7g.12xlarge", + "name": "r7g.12xlarge", + "ram": 393216, + }, + "r7g.16xlarge": { + "bandwidth": 30, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7g.16xlarge", + "instancesku": "KHYZNNC6CFHUE2YN", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "30 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r7g.16xlarge", + "name": "r7g.16xlarge", + "ram": 524288, + }, + "r7g.2xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7g.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r7g.2xlarge", + "name": "r7g.2xlarge", + "ram": 65536, + }, + "r7g.4xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7g.4xlarge", + "instancesku": "GM47ZT3HEKXK2RKU", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r7g.4xlarge", + "name": "r7g.4xlarge", + "ram": 131072, + }, + "r7g.8xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7g.8xlarge", + "instancesku": "5EKNZY9FZ533ACBN", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "15 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-north-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r7g.8xlarge", + "name": "r7g.8xlarge", + "ram": 262144, + }, + "r7g.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7g.large", + "instancesku": "ECFYSTX74KPXVVBN", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r7g.large", + "name": "r7g.large", + "ram": 16384, + }, + "r7g.medium": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7g.medium", + "instancesku": "5WTHGR8KRJSXYPA8", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "r7g.medium", + "name": "r7g.medium", + "ram": 8192, + }, + "r7g.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7g.xlarge", + "instancesku": "G2VJQNCYXP7J952P", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r7g.xlarge", + "name": "r7g.xlarge", + "ram": 32768, + }, + "r7gd.12xlarge": { + "bandwidth": 22500, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7gd.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "22500 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r7gd.12xlarge", + "name": "r7gd.12xlarge", + "ram": 393216, + }, + "r7gd.16xlarge": { + "bandwidth": 30, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7gd.16xlarge", + "instancesku": "TVR3W2FB44WKUYV6", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "30 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r7gd.16xlarge", + "name": "r7gd.16xlarge", + "ram": 524288, + }, + "r7gd.2xlarge": { + "bandwidth": 15, + "disk": 475, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7gd.2xlarge", + "instancesku": "JUT7C97SGGH6FUFE", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 475 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r7gd.2xlarge", + "name": "r7gd.2xlarge", + "ram": 65536, + }, + "r7gd.4xlarge": { + "bandwidth": 15, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7gd.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r7gd.4xlarge", + "name": "r7gd.4xlarge", + "ram": 131072, + }, + "r7gd.8xlarge": { + "bandwidth": 15, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7gd.8xlarge", + "instancesku": "HRPNCHQ7TZK3VWSX", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "15 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r7gd.8xlarge", + "name": "r7gd.8xlarge", + "ram": 262144, + }, + "r7gd.large": { + "bandwidth": 12500, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7gd.large", + "instancesku": "TQWXHKT9PHTUXMS2", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r7gd.large", + "name": "r7gd.large", + "ram": 16384, + }, + "r7gd.medium": { + "bandwidth": 12500, + "disk": 59, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7gd.medium", + "instancesku": "P88JQHEPPAWA6HWH", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 59 NVMe SSD", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "r7gd.medium", + "name": "r7gd.medium", + "ram": 8192, + }, + "r7gd.xlarge": { + "bandwidth": 12500, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7gd.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton3 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r7gd.xlarge", + "name": "r7gd.xlarge", + "ram": 32768, + }, + "r7i.12xlarge": { + "bandwidth": 18750, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7i.12xlarge", + "instancesku": "PUAUGZRCARPYB6F2", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "18750 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r7i.12xlarge", + "name": "r7i.12xlarge", + "ram": 393216, + }, + "r7i.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7i.16xlarge", + "instancesku": "K8DRJU2WDAMWWK5U", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r7i.16xlarge", + "name": "r7i.16xlarge", + "ram": 524288, + }, + "r7i.24xlarge": { + "bandwidth": 37500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7i.24xlarge", + "instancesku": "HCZYPAMGW7QGVAQ3", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "37500 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r7i.24xlarge", + "name": "r7i.24xlarge", + "ram": 786432, + }, + "r7i.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7i.2xlarge", + "instancesku": "SZBRE2RJ4H5KATWH", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r7i.2xlarge", + "name": "r7i.2xlarge", + "ram": 65536, + }, + "r7i.48xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7i.48xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1536 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "r7i.48xlarge", + "name": "r7i.48xlarge", + "ram": 1572864, + }, + "r7i.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7i.4xlarge", + "instancesku": "387ET9W6QRE2GUMT", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r7i.4xlarge", + "name": "r7i.4xlarge", + "ram": 131072, + }, + "r7i.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7i.8xlarge", + "instancesku": "YUBX7VNGA8N2NN3H", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r7i.8xlarge", + "name": "r7i.8xlarge", + "ram": 262144, + }, + "r7i.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7i.large", + "instancesku": "GYCBG8CFZPAFMUVW", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r7i.large", + "name": "r7i.large", + "ram": 16384, + }, + "r7i.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.2 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7i.xlarge", + "instancesku": "J68SFC7TSST5CN33", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo; Intel AMX", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r7i.xlarge", + "name": "r7i.xlarge", + "ram": 32768, + }, + "r7iz.12xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7iz.12xlarge", + "instancesku": "23CZCQDT39K4N3KW", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r7iz.12xlarge", + "name": "r7iz.12xlarge", + "ram": 393216, + }, + "r7iz.16xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7iz.16xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r7iz.16xlarge", + "name": "r7iz.16xlarge", + "ram": 524288, + }, + "r7iz.2xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7iz.2xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r7iz.2xlarge", + "name": "r7iz.2xlarge", + "ram": 65536, + }, + "r7iz.32xlarge": { + "bandwidth": 50000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7iz.32xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "50000 Megabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "r7iz.32xlarge", + "name": "r7iz.32xlarge", + "ram": 1048576, + }, + "r7iz.4xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7iz.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r7iz.4xlarge", + "name": "r7iz.4xlarge", + "ram": 131072, + }, + "r7iz.8xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7iz.8xlarge", + "instancesku": "W75AYZKNFC94DB6X", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r7iz.8xlarge", + "name": "r7iz.8xlarge", + "ram": 262144, + }, + "r7iz.large": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7iz.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r7iz.large", + "name": "r7iz.large", + "ram": 16384, + }, + "r7iz.xlarge": { + "bandwidth": 12500, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r7iz.xlarge", + "instancesku": "7UQ2FKMSY3B4NNSV", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12500 Megabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r7iz.xlarge", + "name": "r7iz.xlarge", + "ram": 32768, + }, + "r8g.12xlarge": { + "bandwidth": 22, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r8g.12xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "22.5 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "r8g.12xlarge", + "name": "r8g.12xlarge", + "ram": 393216, + }, + "r8g.16xlarge": { + "bandwidth": 30, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r8g.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "30 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "r8g.16xlarge", + "name": "r8g.16xlarge", + "ram": 524288, + }, + "r8g.24xlarge": { + "bandwidth": 40, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r8g.24xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "40 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "r8g.24xlarge", + "name": "r8g.24xlarge", + "ram": 786432, + }, + "r8g.2xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r8g.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "r8g.2xlarge", + "name": "r8g.2xlarge", + "ram": 65536, + }, + "r8g.48xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r8g.48xlarge", + "instancesku": "SKK3R9PTMH7JC22C", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1536 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "r8g.48xlarge", + "name": "r8g.48xlarge", + "ram": 1572864, + }, + "r8g.4xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r8g.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "r8g.4xlarge", + "name": "r8g.4xlarge", + "ram": 131072, + }, + "r8g.8xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r8g.8xlarge", + "instancesku": "HSKTJRMDSCHDSSPK", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "15 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "r8g.8xlarge", + "name": "r8g.8xlarge", + "ram": 262144, + }, + "r8g.large": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r8g.large", + "instancesku": "5794PT5PDVXVMAWQ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12.5 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "r8g.large", + "name": "r8g.large", + "ram": 16384, + }, + "r8g.medium": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r8g.medium", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 12.5 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "r8g.medium", + "name": "r8g.medium", + "ram": 8192, + }, + "r8g.xlarge": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "r8g.xlarge", + "instancesku": "9Y46XFXK69WBSHFC", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12.5 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "r8g.xlarge", + "name": "r8g.xlarge", + "ram": 32768, + }, + "t1.micro": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "No", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Micro instances", + "instanceType": "t1.micro", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "0.613 GiB", + "networkPerformance": "Very Low", + "normalizationSizeFactor": "0.5", + "physicalProcessor": "Variable", + "processorArchitecture": "32-bit or 64-bit", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "t1.micro", + "name": "t1.micro", + "ram": 627, + }, + "t2.2xlarge": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.3 GHz", + "currentGeneration": "Yes", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t2.2xlarge", + "instancesku": "WTCBDF8NTYFUN3ES", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "t2.2xlarge", + "name": "t2.2xlarge", + "ram": 32768, + }, + "t2.large": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.3 GHz", + "currentGeneration": "Yes", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t2.large", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Low to Moderate", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t2.large", + "name": "t2.large", + "ram": 8192, + }, + "t2.medium": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.3 GHz", + "currentGeneration": "Yes", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t2.medium", + "instancesku": "DY99AWFYB6SX74KD", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Low to Moderate", + "normalizationSizeFactor": "2", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t2.medium", + "name": "t2.medium", + "ram": 4096, + }, + "t2.micro": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.3 GHz", + "currentGeneration": "Yes", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t2.micro", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1 GiB", + "networkPerformance": "Low to Moderate", + "normalizationSizeFactor": "0.5", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "t2.micro", + "name": "t2.micro", + "ram": 1024, + }, + "t2.nano": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.3 GHz", + "currentGeneration": "Yes", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t2.nano", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "0.5 GiB", + "networkPerformance": "Low", + "normalizationSizeFactor": "0.25", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "t2.nano", + "name": "t2.nano", + "ram": 512, + }, + "t2.small": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.3 GHz", + "currentGeneration": "Yes", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t2.small", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Low to Moderate", + "normalizationSizeFactor": "1", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "t2.small", + "name": "t2.small", + "ram": 2048, + }, + "t2.xlarge": { + "bandwidth": None, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.3 GHz", + "currentGeneration": "Yes", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t2.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Moderate", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Family", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "t2.xlarge", + "name": "t2.xlarge", + "ram": 16384, + }, + "t3.2xlarge": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2780 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3.2xlarge", + "instancesku": "CAB4TUSN8KCWWMKW", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Skylake E5 2686 v5", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "t3.2xlarge", + "name": "t3.2xlarge", + "ram": 32768, + }, + "t3.large": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2780 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3.large", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Skylake E5 2686 v5", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t3.large", + "name": "t3.large", + "ram": 8192, + }, + "t3.medium": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3.medium", + "instancesku": "YZ5V7FVMR7UMXETK", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "Intel Skylake E5 2686 v5", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t3.medium", + "name": "t3.medium", + "ram": 4096, + }, + "t3.micro": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3.micro", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "0.5", + "physicalProcessor": "Intel Skylake E5 2686 v5", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t3.micro", + "name": "t3.micro", + "ram": 1024, + }, + "t3.nano": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3.nano", + "instancesku": "WEW9WBCCJASKWNJU", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "0.5 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "0.25", + "physicalProcessor": "Intel Skylake E5 2686 v5", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t3.nano", + "name": "t3.nano", + "ram": 512, + }, + "t3.small": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3.small", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "1", + "physicalProcessor": "Intel Skylake E5 2686 v5", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t3.small", + "name": "t3.small", + "ram": 2048, + }, + "t3.xlarge": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2780 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3.xlarge", + "instancesku": "24GPMCAUP9P4GSC6", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Skylake E5 2686 v5", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "t3.xlarge", + "name": "t3.xlarge", + "ram": 16384, + }, + "t3a.2xlarge": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2780 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3a.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "t3a.2xlarge", + "name": "t3a.2xlarge", + "ram": 32768, + }, + "t3a.large": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2780 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3a.large", + "instancesku": "9W9WUN8874RQJPYR", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t3a.large", + "name": "t3a.large", + "ram": 8192, + }, + "t3a.medium": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3a.medium", + "instancesku": "UMAHZUQPRB2BAWBS", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t3a.medium", + "name": "t3a.medium", + "ram": 4096, + }, + "t3a.micro": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3a.micro", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "0.5", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t3a.micro", + "name": "t3a.micro", + "ram": 1024, + }, + "t3a.nano": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3a.nano", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "0.5 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "0.25", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t3a.nano", + "name": "t3a.nano", + "ram": 512, + }, + "t3a.small": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3a.small", + "instancesku": "R84E3TQPGUP973B4", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "1", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t3a.small", + "name": "t3a.small", + "ram": 2048, + }, + "t3a.xlarge": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2780 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t3a.xlarge", + "instancesku": "YUQH22HS49VU8AJK", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AMD EPYC 7571", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; AVX2; AMD Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "t3a.xlarge", + "name": "t3a.xlarge", + "ram": 16384, + }, + "t4g.2xlarge": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2780 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t4g.2xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "t4g.2xlarge", + "name": "t4g.2xlarge", + "ram": 32768, + }, + "t4g.large": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2780 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t4g.large", + "instancesku": "DP29NV5PDAV9G9SM", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "8 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t4g.large", + "name": "t4g.large", + "ram": 8192, + }, + "t4g.medium": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t4g.medium", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "4 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t4g.medium", + "name": "t4g.medium", + "ram": 4096, + }, + "t4g.micro": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t4g.micro", + "instancesku": "BQXJ8V9R6Y2TPCGG", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "0.5", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t4g.micro", + "name": "t4g.micro", + "ram": 1024, + }, + "t4g.nano": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t4g.nano", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "0.5 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "0.25", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t4g.nano", + "name": "t4g.nano", + "ram": 512, + }, + "t4g.small": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2085 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t4g.small", + "instancesku": "Y33CHC2PYKBQ7U2C", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "2 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "1", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "t4g.small", + "name": "t4g.small", + "ram": 2048, + }, + "t4g.xlarge": { + "bandwidth": 5, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2780 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "General purpose", + "instanceType": "t4g.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 5 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "t4g.xlarge", + "name": "t4g.xlarge", + "ram": 16384, + }, + "trn1.2xlarge": { + "bandwidth": 12500, + "disk": 475, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 20 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "32 GB", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "trn1.2xlarge", + "instancesku": "CSMRGVUPNG9UETH8", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "12500 Megabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 475 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "trn1.2xlarge", + "name": "trn1.2xlarge", + "ram": 32768, + }, + "trn1.32xlarge": { + "bandwidth": 800, + "disk": 7600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 80 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "512 GB", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "trn1.32xlarge", + "instancesku": "XPNPN2N6VY2GVQ9X", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "800 Gigabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1900 NVMe SSD", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "trn1.32xlarge", + "name": "trn1.32xlarge", + "ram": 524288, + }, + "trn1n.32xlarge": { + "bandwidth": 1600, + "disk": 7600, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "80 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "512 GB", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "trn1n.32xlarge", + "instancesku": "49HTVZD5D4J22XE8", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "1600 Gigabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "4 x 1900 NVMe SSD", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "trn1n.32xlarge", + "name": "trn1n.32xlarge", + "ram": 524288, + }, + "trn2.48xlarge": { + "bandwidth": 3200, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "Up to 3.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "80 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "1536 GB HBM3", + "instanceFamily": "Machine Learning ASIC Instances", + "instanceType": "trn2.48xlarge", + "instancesku": "A7RS779QCEMNJV96", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "CapacityBlock", + "memory": "2048 GiB", + "networkPerformance": "3200 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AMX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "trn2.48xlarge", + "name": "trn2.48xlarge", + "ram": 2097152, + }, + "u-12tb1.112xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "38000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u-12tb1.112xlarge", + "instancesku": "REVYCR94A28EU37G", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "12288 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "NA", + "physicalProcessor": "Intel Xeon Scalable (Skylake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "448", + "vpcnetworkingsupport": "true", + }, + "id": "u-12tb1.112xlarge", + "name": "u-12tb1.112xlarge", + "ram": 12582912, + }, + "u-18tb1.112xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "38000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u-18tb1.112xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "18432 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "NA", + "physicalProcessor": "Intel Xeon Platinum 8280L (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "448", + "vpcnetworkingsupport": "true", + }, + "id": "u-18tb1.112xlarge", + "name": "u-18tb1.112xlarge", + "ram": 18874368, + }, + "u-24tb1.112xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "38000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u-24tb1.112xlarge", + "instancesku": "3B3GWRWTH7FF4A6F", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "24576 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "NA", + "physicalProcessor": "Intel Xeon Platinum 8280L (Cascade Lake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "448", + "vpcnetworkingsupport": "true", + }, + "id": "u-24tb1.112xlarge", + "name": "u-24tb1.112xlarge", + "ram": 25165824, + }, + "u-3tb1.56xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.1 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u-3tb1.56xlarge", + "instancesku": "SAPP6Y5NAHGYJNTE", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "3072 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "448", + "physicalProcessor": "Intel Xeon Scalable (Skylake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX2; Intel AVX; Intel AVX2", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "224", + "vpcnetworkingsupport": "true", + }, + "id": "u-3tb1.56xlarge", + "name": "u-3tb1.56xlarge", + "ram": 3145728, + }, + "u-6tb1.112xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "38000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u-6tb1.112xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "6144 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "NA", + "physicalProcessor": "Intel Xeon Scalable (Skylake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; Intel AVX; Intel AVX2", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "448", + "vpcnetworkingsupport": "true", + }, + "id": "u-6tb1.112xlarge", + "name": "u-6tb1.112xlarge", + "ram": 6291456, + }, + "u-6tb1.56xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "38000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u-6tb1.56xlarge", + "instancesku": "PVJMNB8VSNPYZ6GP", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "6144 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "NA", + "physicalProcessor": "Intel Xeon Scalable (Skylake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; Intel AVX; Intel AVX2", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "224", + "vpcnetworkingsupport": "true", + }, + "id": "u-6tb1.56xlarge", + "name": "u-6tb1.56xlarge", + "ram": 6291456, + }, + "u-9tb1.112xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "38000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u-9tb1.112xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "9216 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "NA", + "physicalProcessor": "Intel Xeon Scalable (Skylake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "448", + "vpcnetworkingsupport": "true", + }, + "id": "u-9tb1.112xlarge", + "name": "u-9tb1.112xlarge", + "ram": 9437184, + }, + "u7i-12tb.224xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "60 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u7i-12tb.224xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "12288 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "1792", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "896", + "vpcnetworkingsupport": "true", + }, + "id": "u7i-12tb.224xlarge", + "name": "u7i-12tb.224xlarge", + "ram": 12582912, + }, + "u7i-6tb.112xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "60 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u7i-6tb.112xlarge", + "instancesku": "JREF953XJBJQXJNH", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "6144 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "896", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "448", + "vpcnetworkingsupport": "true", + }, + "id": "u7i-6tb.112xlarge", + "name": "u7i-6tb.112xlarge", + "ram": 6291456, + }, + "u7i-8tb.112xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "60 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u7i-8tb.112xlarge", + "instancesku": "Y8G9PN7FHBAQMPX6", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "8192 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "896", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "448", + "vpcnetworkingsupport": "true", + }, + "id": "u7i-8tb.112xlarge", + "name": "u7i-8tb.112xlarge", + "ram": 8388608, + }, + "u7in-16tb.224xlarge": { + "bandwidth": 200, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "100 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u7in-16tb.224xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16384 GiB", + "networkPerformance": "200 Gigabit", + "normalizationSizeFactor": "1792", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "32-bit or 64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "896", + "vpcnetworkingsupport": "true", + }, + "id": "u7in-16tb.224xlarge", + "name": "u7in-16tb.224xlarge", + "ram": 16777216, + }, + "u7in-24tb.224xlarge": { + "bandwidth": 200, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "100 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u7in-24tb.224xlarge", + "instancesku": "2QFYY9495W6NNN5X", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "24576 GiB", + "networkPerformance": "200 Gigabit", + "normalizationSizeFactor": "1792", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "896", + "vpcnetworkingsupport": "true", + }, + "id": "u7in-24tb.224xlarge", + "name": "u7in-24tb.224xlarge", + "ram": 25165824, + }, + "u7in-32tb.224xlarge": { + "bandwidth": 200, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.9 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "100 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "u7in-32tb.224xlarge", + "instancesku": "63TTCGZUVQKPK53D", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32768 GiB", + "networkPerformance": "200 Gigabit", + "normalizationSizeFactor": "1792", + "physicalProcessor": "Intel Xeon Scalable (Sapphire Rapids)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "896", + "vpcnetworkingsupport": "true", + }, + "id": "u7in-32tb.224xlarge", + "name": "u7in-32tb.224xlarge", + "ram": 33554432, + }, + "vt1.24xlarge": { + "bandwidth": 25000, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Media Accelerator Instances", + "instanceType": "vt1.24xlarge", + "instancesku": "9GT74VMCJEP299FD", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "25000 Megabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Platinum 8259CL", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "vt1.24xlarge", + "name": "vt1.24xlarge", + "ram": 196608, + }, + "vt1.3xlarge": { + "bandwidth": 3125, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2375 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Media Accelerator Instances", + "instanceType": "vt1.3xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "24 GiB", + "networkPerformance": "3125 Megabit", + "normalizationSizeFactor": "24", + "physicalProcessor": "Intel Xeon Platinum 8259CL", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "12", + "vpcnetworkingsupport": "true", + }, + "id": "vt1.3xlarge", + "name": "vt1.3xlarge", + "ram": 24576, + }, + "vt1.6xlarge": { + "bandwidth": 6250, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4750 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "No", + "gpuMemory": "NA", + "instanceFamily": "Media Accelerator Instances", + "instanceType": "vt1.6xlarge", + "instancesku": "PY3K83PMVBEUYB32", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "48 GiB", + "networkPerformance": "6250 Megabit", + "normalizationSizeFactor": "48", + "physicalProcessor": "Intel Xeon Platinum 8259CL", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "24", + "vpcnetworkingsupport": "true", + }, + "id": "vt1.6xlarge", + "name": "vt1.6xlarge", + "ram": 49152, + }, + "x1.16xlarge": { + "bandwidth": None, + "disk": 1920, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "174.5", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x1.16xlarge", + "instancesku": "7DHPBJ9UTU6S6WK4", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "976 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "128", + "physicalProcessor": "High Frequency Intel Xeon E7-8880 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1920 SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "x1.16xlarge", + "name": "x1.16xlarge", + "ram": 999424, + }, + "x1.32xlarge": { + "bandwidth": None, + "disk": 3840, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "349", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x1.32xlarge", + "instancesku": "STYK7K6FHHBSRAHM", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1952 GiB", + "networkPerformance": "High", + "normalizationSizeFactor": "256", + "physicalProcessor": "High Frequency Intel Xeon E7-8880 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1920 SSD", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "x1.32xlarge", + "name": "x1.32xlarge", + "ram": 1998848, + }, + "x1e.16xlarge": { + "bandwidth": 10, + "disk": 1920, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "179", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x1e.16xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1952 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "High Frequency Intel Xeon E7-8880 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1920 SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "x1e.16xlarge", + "name": "x1e.16xlarge", + "ram": 1998848, + }, + "x1e.2xlarge": { + "bandwidth": 10, + "disk": 240, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "1000 Mbps", + "ecu": "23", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x1e.2xlarge", + "instancesku": "BKRMPKCEC6DFW9NP", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "244 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "High Frequency Intel Xeon E7-8880 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 240 SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "x1e.2xlarge", + "name": "x1e.2xlarge", + "ram": 249856, + }, + "x1e.32xlarge": { + "bandwidth": 25, + "disk": 3840, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "340", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x1e.32xlarge", + "instancesku": "YAS88XT2MXM4B2ZV", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "3904 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "High Frequency Intel Xeon E7-8880 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2", + "regionCode": "sa-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1920 SSD", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "x1e.32xlarge", + "name": "x1e.32xlarge", + "ram": 3997696, + }, + "x1e.4xlarge": { + "bandwidth": 10, + "disk": 480, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "1750 Mbps", + "ecu": "47", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x1e.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "488 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "High Frequency Intel Xeon E7-8880 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 480 SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "x1e.4xlarge", + "name": "x1e.4xlarge", + "ram": 499712, + }, + "x1e.8xlarge": { + "bandwidth": 10, + "disk": 960, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "91", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x1e.8xlarge", + "instancesku": "QDBZKZSM8J22BVE7", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "976 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "High Frequency Intel Xeon E7-8880 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 960 SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "x1e.8xlarge", + "name": "x1e.8xlarge", + "ram": 999424, + }, + "x1e.xlarge": { + "bandwidth": 10, + "disk": 120, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.3 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "500 Mbps", + "ecu": "12", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x1e.xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "122 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "High Frequency Intel Xeon E7-8880 v3 (Haswell)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 120 SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "x1e.xlarge", + "name": "x1e.xlarge", + "ram": 124928, + }, + "x2gd.12xlarge": { + "bandwidth": 20, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14250 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2gd.12xlarge", + "instancesku": "YHYZ8JNVTJ3DYNPQ", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "20 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "x2gd.12xlarge", + "name": "x2gd.12xlarge", + "ram": 786432, + }, + "x2gd.16xlarge": { + "bandwidth": 25, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2gd.16xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "x2gd.16xlarge", + "name": "x2gd.16xlarge", + "ram": 1048576, + }, + "x2gd.2xlarge": { + "bandwidth": 10, + "disk": 474, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4750 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2gd.2xlarge", + "instancesku": "6SJMXRTFPNNB7XBT", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 474 SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "x2gd.2xlarge", + "name": "x2gd.2xlarge", + "ram": 131072, + }, + "x2gd.4xlarge": { + "bandwidth": 10, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4750 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2gd.4xlarge", + "instancesku": "KTMUE4YKBZGAERNT", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "x2gd.4xlarge", + "name": "x2gd.4xlarge", + "ram": 262144, + }, + "x2gd.8xlarge": { + "bandwidth": 12, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2gd.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "12 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "x2gd.8xlarge", + "name": "x2gd.8xlarge", + "ram": 524288, + }, + "x2gd.large": { + "bandwidth": 10, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4750 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2gd.large", + "instancesku": "NGCWNHNPM4YG27T7", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "x2gd.large", + "name": "x2gd.large", + "ram": 32768, + }, + "x2gd.medium": { + "bandwidth": 10, + "disk": 59, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4750 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2gd.medium", + "instancesku": "NGA7RTWTM43FWF3H", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 59 SSD", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "x2gd.medium", + "name": "x2gd.medium", + "ram": 16384, + }, + "x2gd.xlarge": { + "bandwidth": 10, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 4750 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2gd.xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton2 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "x2gd.xlarge", + "name": "x2gd.xlarge", + "ram": 65536, + }, + "x2idn.16xlarge": { + "bandwidth": 50, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2idn.16xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-3", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "x2idn.16xlarge", + "name": "x2idn.16xlarge", + "ram": 1048576, + }, + "x2idn.24xlarge": { + "bandwidth": 75, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "60 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2idn.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1536 GiB", + "networkPerformance": "75 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "x2idn.24xlarge", + "name": "x2idn.24xlarge", + "ram": 1572864, + }, + "x2idn.32xlarge": { + "bandwidth": 100, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "80 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2idn.32xlarge", + "instancesku": "AWRN7KUZ5WUQ9AE5", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "2048 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "AVX; Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ca-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "x2idn.32xlarge", + "name": "x2idn.32xlarge", + "ram": 2097152, + }, + "x2iedn.16xlarge": { + "bandwidth": 50, + "disk": 1900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2iedn.16xlarge", + "instancesku": "73JJFGR8GMZVC524", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "2048 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 1900 NVMe SSD", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "x2iedn.16xlarge", + "name": "x2iedn.16xlarge", + "ram": 2097152, + }, + "x2iedn.24xlarge": { + "bandwidth": 75, + "disk": 2850, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "60000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2iedn.24xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "3072 GiB", + "networkPerformance": "75 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1425 NVMe SSD", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "x2iedn.24xlarge", + "name": "x2iedn.24xlarge", + "ram": 3145728, + }, + "x2iedn.2xlarge": { + "bandwidth": 25, + "disk": 237, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2iedn.2xlarge", + "instancesku": "63BDVCXPJJ8Q4CK7", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 237 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "x2iedn.2xlarge", + "name": "x2iedn.2xlarge", + "ram": 262144, + }, + "x2iedn.32xlarge": { + "bandwidth": 100, + "disk": 3800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "80000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2iedn.32xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "4096 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "256", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-south-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 1900 NVMe SSD", + "vcpu": "128", + "vpcnetworkingsupport": "true", + }, + "id": "x2iedn.32xlarge", + "name": "x2iedn.32xlarge", + "ram": 4194304, + }, + "x2iedn.4xlarge": { + "bandwidth": 25, + "disk": 475, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2iedn.4xlarge", + "instancesku": "MB6XH84AX23GRQ36", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 475 NVMe SSD", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "x2iedn.4xlarge", + "name": "x2iedn.4xlarge", + "ram": 524288, + }, + "x2iedn.8xlarge": { + "bandwidth": 25, + "disk": 950, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2iedn.8xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 950 NVMe SSD", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "x2iedn.8xlarge", + "name": "x2iedn.8xlarge", + "ram": 1048576, + }, + "x2iedn.xlarge": { + "bandwidth": 25, + "disk": 118, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "3.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 20000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2iedn.xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Scalable (Icelake)", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 118 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "x2iedn.xlarge", + "name": "x2iedn.xlarge", + "ram": 131072, + }, + "x2iezn.12xlarge": { + "bandwidth": 100, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "19000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2iezn.12xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1536 GiB", + "networkPerformance": "100 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8252", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "x2iezn.12xlarge", + "name": "x2iezn.12xlarge", + "ram": 1572864, + }, + "x2iezn.2xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3170 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2iezn.2xlarge", + "instancesku": "D9NTTVU6X5ZXW8XW", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8252", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "x2iezn.2xlarge", + "name": "x2iezn.2xlarge", + "ram": 262144, + }, + "x2iezn.4xlarge": { + "bandwidth": 25, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "4750 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2iezn.4xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "Up to 25 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "Intel Xeon Platinum 8252", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "x2iezn.4xlarge", + "name": "x2iezn.4xlarge", + "ram": 524288, + }, + "x2iezn.6xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "9500 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2iezn.6xlarge", + "instancesku": "8S5BF3CQBGR6BV8B", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "48", + "physicalProcessor": "Intel Xeon Platinum 8252", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "24", + "vpcnetworkingsupport": "true", + }, + "id": "x2iezn.6xlarge", + "name": "x2iezn.6xlarge", + "ram": 786432, + }, + "x2iezn.8xlarge": { + "bandwidth": 75, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4.5 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "12000 Mbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x2iezn.8xlarge", + "instancesku": "7349Q766H4JGZ9AW", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "75 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "Intel Xeon Platinum 8252", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "x2iezn.8xlarge", + "name": "x2iezn.8xlarge", + "ram": 1048576, + }, + "x8g.12xlarge": { + "bandwidth": 22, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "15 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x8g.12xlarge", + "instancesku": "XTRBSN3Y6XH6M6W5", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "768 GiB", + "networkPerformance": "22.5 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "x8g.12xlarge", + "name": "x8g.12xlarge", + "ram": 786432, + }, + "x8g.16xlarge": { + "bandwidth": 30, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "20 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x8g.16xlarge", + "instancesku": "W3K52Q2ANTFXD2VC", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1024 GiB", + "networkPerformance": "30 Gigabit", + "normalizationSizeFactor": "128", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "64", + "vpcnetworkingsupport": "true", + }, + "id": "x8g.16xlarge", + "name": "x8g.16xlarge", + "ram": 1048576, + }, + "x8g.24xlarge": { + "bandwidth": 40, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "30 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x8g.24xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "1536 GiB", + "networkPerformance": "40 Gigabit", + "normalizationSizeFactor": "192", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "96", + "vpcnetworkingsupport": "true", + }, + "id": "x8g.24xlarge", + "name": "x8g.24xlarge", + "ram": 1572864, + }, + "x8g.2xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x8g.2xlarge", + "instancesku": "DYZFKST25Q3D7D8G", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "128 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "x8g.2xlarge", + "name": "x8g.2xlarge", + "ram": 131072, + }, + "x8g.48xlarge": { + "bandwidth": 50, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "40 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x8g.48xlarge", + "instancesku": "CFJS22QC729XBQZR", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "3072 GiB", + "networkPerformance": "50 Gigabit", + "normalizationSizeFactor": "384", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "192", + "vpcnetworkingsupport": "true", + }, + "id": "x8g.48xlarge", + "name": "x8g.48xlarge", + "ram": 3145728, + }, + "x8g.4xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x8g.4xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "256 GiB", + "networkPerformance": "Up to 15 Gigabit", + "normalizationSizeFactor": "32", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "16", + "vpcnetworkingsupport": "true", + }, + "id": "x8g.4xlarge", + "name": "x8g.4xlarge", + "ram": 262144, + }, + "x8g.8xlarge": { + "bandwidth": 15, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x8g.8xlarge", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "512 GiB", + "networkPerformance": "15 Gigabit", + "normalizationSizeFactor": "64", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "32", + "vpcnetworkingsupport": "true", + }, + "id": "x8g.8xlarge", + "name": "x8g.8xlarge", + "ram": 524288, + }, + "x8g.large": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x8g.large", + "instancesku": "8DZHQBW3QMV56WF8", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 12.5 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "x8g.large", + "name": "x8g.large", + "ram": 32768, + }, + "x8g.medium": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x8g.medium", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 12.5 Gigabit", + "normalizationSizeFactor": "2", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "us-west-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "1", + "vpcnetworkingsupport": "true", + }, + "id": "x8g.medium", + "name": "x8g.medium", + "ram": 16384, + }, + "x8g.xlarge": { + "bandwidth": 12, + "disk": 0, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "2.7 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 10 Gbps", + "ecu": "NA", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "x8g.xlarge", + "instancesku": "D45QVQ5D8P59AAQW", + "intelAvx2Available": "No", + "intelAvxAvailable": "No", + "intelTurboAvailable": "No", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 12.5 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "AWS Graviton4 Processor", + "processorArchitecture": "64-bit", + "regionCode": "eu-central-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "EBS only", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "x8g.xlarge", + "name": "x8g.xlarge", + "ram": 65536, + }, + "z1d.12xlarge": { + "bandwidth": 25, + "disk": 1800, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "14000 Mbps", + "ecu": "235", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "z1d.12xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "384 GiB", + "networkPerformance": "25 Gigabit", + "normalizationSizeFactor": "96", + "physicalProcessor": "Intel Xeon Platinum 8151", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-southeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "2 x 900 NVMe SSD", + "vcpu": "48", + "vpcnetworkingsupport": "true", + }, + "id": "z1d.12xlarge", + "name": "z1d.12xlarge", + "ram": 393216, + }, + "z1d.2xlarge": { + "bandwidth": 10, + "disk": 300, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "2333 Mbps", + "ecu": "45", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "z1d.2xlarge", + "instancesku": "TJN3TJCJX99J6MMW", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "64 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "16", + "physicalProcessor": "Intel Xeon Platinum 8151", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 300 NVMe SSD", + "vcpu": "8", + "vpcnetworkingsupport": "true", + }, + "id": "z1d.2xlarge", + "name": "z1d.2xlarge", + "ram": 65536, + }, + "z1d.3xlarge": { + "bandwidth": 10, + "disk": 450, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "3500 Mbps", + "ecu": "64", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "z1d.3xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "96 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "24", + "physicalProcessor": "Intel Xeon Platinum 8151", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 450 NVMe SSD", + "vcpu": "12", + "vpcnetworkingsupport": "true", + }, + "id": "z1d.3xlarge", + "name": "z1d.3xlarge", + "ram": 98304, + }, + "z1d.6xlarge": { + "bandwidth": 10, + "disk": 900, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "7000 Mbps", + "ecu": "116", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "z1d.6xlarge", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "192 GiB", + "networkPerformance": "10 Gigabit", + "normalizationSizeFactor": "48", + "physicalProcessor": "Intel Xeon Platinum 8151", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "eu-west-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 900 NVMe SSD", + "vcpu": "24", + "vpcnetworkingsupport": "true", + }, + "id": "z1d.6xlarge", + "name": "z1d.6xlarge", + "ram": 196608, + }, + "z1d.large": { + "bandwidth": 10, + "disk": 75, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2333 Mbps", + "ecu": "12", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "z1d.large", + "instancesku": "TC5JJ4DDT49HWM6A", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "16 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "4", + "physicalProcessor": "Intel Xeon Platinum 8151", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "us-east-1", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 75 NVMe SSD", + "vcpu": "2", + "vpcnetworkingsupport": "true", + }, + "id": "z1d.large", + "name": "z1d.large", + "ram": 16384, + }, + "z1d.xlarge": { + "bandwidth": 10, + "disk": 150, + "extra": { + "availabilityzone": "NA", + "classicnetworkingsupport": "false", + "clockSpeed": "4 GHz", + "currentGeneration": "Yes", + "dedicatedEbsThroughput": "Up to 2333 Mbps", + "ecu": "23", + "enhancedNetworkingSupported": "Yes", + "gpuMemory": "NA", + "instanceFamily": "Memory optimized", + "instanceType": "z1d.xlarge", + "instancesku": "85BM84CW7NC939FV", + "intelAvx2Available": "Yes", + "intelAvxAvailable": "Yes", + "intelTurboAvailable": "Yes", + "marketoption": "OnDemand", + "memory": "32 GiB", + "networkPerformance": "Up to 10 Gigabit", + "normalizationSizeFactor": "8", + "physicalProcessor": "Intel Xeon Platinum 8151", + "processorArchitecture": "64-bit", + "processorFeatures": "Intel AVX; Intel AVX2; Intel AVX512; Intel Turbo", + "regionCode": "ap-northeast-2", + "servicecode": "AmazonEC2", + "servicename": "Amazon Elastic Compute Cloud", + "storage": "1 x 150 NVMe SSD", + "vcpu": "4", + "vpcnetworkingsupport": "true", + }, + "id": "z1d.xlarge", + "name": "z1d.xlarge", + "ram": 32768, + }, +} diff --git a/libcloud/compute/constants/ec2_region_details_complete.py b/libcloud/compute/constants/ec2_region_details_complete.py new file mode 100644 index 0000000000..cf1fec7027 --- /dev/null +++ b/libcloud/compute/constants/ec2_region_details_complete.py @@ -0,0 +1,10292 @@ +# File generated by contrib/scrape-ec2-sizes.py script - DO NOT EDIT manually +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +REGION_DETAILS = { + "af-south-1": { + "api_name": "ec2_af_south", + "country": "South Africa", + "endpoint": "ec2.af-south-1.amazonaws.com", + "id": "af-south-1", + "instance_types": [], + "signature_version": "4", + }, + "ap-east-1": { + "api_name": "ec2_ap_east", + "country": "Hong Kong", + "endpoint": "ec2.ap-east-1.amazonaws.com", + "id": "ap-east-1", + "instance_types": [ + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5d.18xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7gd.12xlarge", + "r7gd.16xlarge", + "r7gd.2xlarge", + "r7gd.4xlarge", + "r7gd.8xlarge", + "r7gd.large", + "r7gd.medium", + "r7gd.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-3tb1.56xlarge", + "x1.16xlarge", + "x1.32xlarge", + ], + "signature_version": "2", + }, + "ap-northeast-1": { + "api_name": "ec2_ap_northeast", + "country": "Japan", + "endpoint": "ec2.ap-northeast-1.amazonaws.com", + "id": "ap-northeast-1", + "instance_types": [ + "a1.2xlarge", + "a1.4xlarge", + "a1.large", + "a1.medium", + "a1.xlarge", + "c1.medium", + "c1.xlarge", + "c3.2xlarge", + "c3.4xlarge", + "c3.8xlarge", + "c3.large", + "c3.xlarge", + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6id.12xlarge", + "c6id.16xlarge", + "c6id.24xlarge", + "c6id.2xlarge", + "c6id.32xlarge", + "c6id.4xlarge", + "c6id.8xlarge", + "c6id.large", + "c6id.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7a.12xlarge", + "c7a.16xlarge", + "c7a.24xlarge", + "c7a.2xlarge", + "c7a.32xlarge", + "c7a.48xlarge", + "c7a.4xlarge", + "c7a.8xlarge", + "c7a.large", + "c7a.medium", + "c7a.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7gd.12xlarge", + "c7gd.16xlarge", + "c7gd.2xlarge", + "c7gd.4xlarge", + "c7gd.8xlarge", + "c7gd.large", + "c7gd.medium", + "c7gd.xlarge", + "c7gn.12xlarge", + "c7gn.16xlarge", + "c7gn.2xlarge", + "c7gn.4xlarge", + "c7gn.8xlarge", + "c7gn.large", + "c7gn.medium", + "c7gn.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "cc2.8xlarge", + "cr1.8xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "d3.2xlarge", + "d3.4xlarge", + "d3.8xlarge", + "d3.xlarge", + "d3en.12xlarge", + "d3en.2xlarge", + "d3en.4xlarge", + "d3en.6xlarge", + "d3en.8xlarge", + "d3en.xlarge", + "g2.2xlarge", + "g2.8xlarge", + "g3.16xlarge", + "g3.4xlarge", + "g3.8xlarge", + "g3s.xlarge", + "g4ad.16xlarge", + "g4ad.2xlarge", + "g4ad.4xlarge", + "g4ad.8xlarge", + "g4ad.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "g5g.16xlarge", + "g5g.2xlarge", + "g5g.4xlarge", + "g5g.8xlarge", + "g5g.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "g6e.12xlarge", + "g6e.16xlarge", + "g6e.24xlarge", + "g6e.2xlarge", + "g6e.48xlarge", + "g6e.4xlarge", + "g6e.8xlarge", + "g6e.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "hpc7g.16xlarge", + "hpc7g.4xlarge", + "hpc7g.8xlarge", + "hs1.8xlarge", + "i2.2xlarge", + "i2.4xlarge", + "i2.8xlarge", + "i2.large", + "i2.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "i7ie.12xlarge", + "i7ie.18xlarge", + "i7ie.24xlarge", + "i7ie.2xlarge", + "i7ie.3xlarge", + "i7ie.48xlarge", + "i7ie.6xlarge", + "i7ie.large", + "i7ie.xlarge", + "im4gn.16xlarge", + "im4gn.2xlarge", + "im4gn.4xlarge", + "im4gn.8xlarge", + "im4gn.large", + "im4gn.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "is4gen.2xlarge", + "is4gen.4xlarge", + "is4gen.8xlarge", + "is4gen.large", + "is4gen.medium", + "is4gen.xlarge", + "m1.large", + "m1.medium", + "m1.small", + "m1.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "m2.xlarge", + "m3.2xlarge", + "m3.large", + "m3.medium", + "m3.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m5dn.12xlarge", + "m5dn.16xlarge", + "m5dn.24xlarge", + "m5dn.2xlarge", + "m5dn.4xlarge", + "m5dn.8xlarge", + "m5dn.large", + "m5dn.xlarge", + "m5n.12xlarge", + "m5n.16xlarge", + "m5n.24xlarge", + "m5n.2xlarge", + "m5n.4xlarge", + "m5n.8xlarge", + "m5n.large", + "m5n.xlarge", + "m5zn.12xlarge", + "m5zn.2xlarge", + "m5zn.3xlarge", + "m5zn.6xlarge", + "m5zn.large", + "m5zn.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m6idn.12xlarge", + "m6idn.16xlarge", + "m6idn.24xlarge", + "m6idn.2xlarge", + "m6idn.32xlarge", + "m6idn.4xlarge", + "m6idn.8xlarge", + "m6idn.large", + "m6idn.xlarge", + "m6in.12xlarge", + "m6in.16xlarge", + "m6in.24xlarge", + "m6in.2xlarge", + "m6in.32xlarge", + "m6in.4xlarge", + "m6in.8xlarge", + "m6in.large", + "m6in.xlarge", + "m7a.12xlarge", + "m7a.16xlarge", + "m7a.24xlarge", + "m7a.2xlarge", + "m7a.32xlarge", + "m7a.48xlarge", + "m7a.4xlarge", + "m7a.8xlarge", + "m7a.large", + "m7a.medium", + "m7a.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "p2.16xlarge", + "p2.8xlarge", + "p2.xlarge", + "p3.16xlarge", + "p3.2xlarge", + "p3.8xlarge", + "p3dn.24xlarge", + "p4d.24xlarge", + "p5.48xlarge", + "p5en.48xlarge", + "r3.2xlarge", + "r3.4xlarge", + "r3.8xlarge", + "r3.large", + "r3.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5dn.12xlarge", + "r5dn.16xlarge", + "r5dn.24xlarge", + "r5dn.2xlarge", + "r5dn.4xlarge", + "r5dn.8xlarge", + "r5dn.large", + "r5dn.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6a.12xlarge", + "r6a.16xlarge", + "r6a.24xlarge", + "r6a.2xlarge", + "r6a.32xlarge", + "r6a.48xlarge", + "r6a.4xlarge", + "r6a.8xlarge", + "r6a.large", + "r6a.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r6id.12xlarge", + "r6id.16xlarge", + "r6id.24xlarge", + "r6id.2xlarge", + "r6id.32xlarge", + "r6id.4xlarge", + "r6id.8xlarge", + "r6id.large", + "r6id.xlarge", + "r6idn.12xlarge", + "r6idn.16xlarge", + "r6idn.24xlarge", + "r6idn.2xlarge", + "r6idn.32xlarge", + "r6idn.4xlarge", + "r6idn.8xlarge", + "r6idn.large", + "r6idn.xlarge", + "r6in.12xlarge", + "r6in.16xlarge", + "r6in.24xlarge", + "r6in.2xlarge", + "r6in.32xlarge", + "r6in.4xlarge", + "r6in.8xlarge", + "r6in.large", + "r6in.xlarge", + "r7a.12xlarge", + "r7a.16xlarge", + "r7a.24xlarge", + "r7a.2xlarge", + "r7a.32xlarge", + "r7a.48xlarge", + "r7a.4xlarge", + "r7a.8xlarge", + "r7a.large", + "r7a.medium", + "r7a.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7gd.12xlarge", + "r7gd.16xlarge", + "r7gd.2xlarge", + "r7gd.4xlarge", + "r7gd.8xlarge", + "r7gd.large", + "r7gd.medium", + "r7gd.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "r7iz.12xlarge", + "r7iz.16xlarge", + "r7iz.2xlarge", + "r7iz.32xlarge", + "r7iz.4xlarge", + "r7iz.8xlarge", + "r7iz.large", + "r7iz.xlarge", + "r8g.12xlarge", + "r8g.16xlarge", + "r8g.24xlarge", + "r8g.2xlarge", + "r8g.48xlarge", + "r8g.4xlarge", + "r8g.8xlarge", + "r8g.large", + "r8g.medium", + "r8g.xlarge", + "t1.micro", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-12tb1.112xlarge", + "u-3tb1.56xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "vt1.24xlarge", + "vt1.3xlarge", + "vt1.6xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x1e.16xlarge", + "x1e.2xlarge", + "x1e.32xlarge", + "x1e.4xlarge", + "x1e.8xlarge", + "x1e.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + "x2iezn.12xlarge", + "x2iezn.2xlarge", + "x2iezn.4xlarge", + "x2iezn.6xlarge", + "x2iezn.8xlarge", + "z1d.12xlarge", + "z1d.2xlarge", + "z1d.3xlarge", + "z1d.6xlarge", + "z1d.large", + "z1d.xlarge", + ], + "signature_version": "2", + }, + "ap-northeast-2": { + "api_name": "ec2_ap_northeast", + "country": "South Korea", + "endpoint": "ec2.ap-northeast-2.amazonaws.com", + "id": "ap-northeast-2", + "instance_types": [ + "c3.2xlarge", + "c3.4xlarge", + "c3.8xlarge", + "c3.large", + "c3.xlarge", + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6id.12xlarge", + "c6id.16xlarge", + "c6id.24xlarge", + "c6id.2xlarge", + "c6id.32xlarge", + "c6id.4xlarge", + "c6id.8xlarge", + "c6id.large", + "c6id.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "g2.2xlarge", + "g2.8xlarge", + "g3.16xlarge", + "g3.4xlarge", + "g3.8xlarge", + "g3s.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "g5g.16xlarge", + "g5g.2xlarge", + "g5g.4xlarge", + "g5g.8xlarge", + "g5g.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "i2.2xlarge", + "i2.4xlarge", + "i2.8xlarge", + "i2.large", + "i2.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "m3.2xlarge", + "m3.large", + "m3.medium", + "m3.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m5zn.12xlarge", + "m5zn.2xlarge", + "m5zn.3xlarge", + "m5zn.6xlarge", + "m5zn.large", + "m5zn.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "p2.16xlarge", + "p2.8xlarge", + "p2.xlarge", + "p3.16xlarge", + "p3.2xlarge", + "p3.8xlarge", + "p4d.24xlarge", + "p5en.48xlarge", + "r3.2xlarge", + "r3.4xlarge", + "r3.8xlarge", + "r3.large", + "r3.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5dn.12xlarge", + "r5dn.16xlarge", + "r5dn.24xlarge", + "r5dn.2xlarge", + "r5dn.4xlarge", + "r5dn.8xlarge", + "r5dn.large", + "r5dn.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r6id.12xlarge", + "r6id.16xlarge", + "r6id.24xlarge", + "r6id.2xlarge", + "r6id.32xlarge", + "r6id.4xlarge", + "r6id.8xlarge", + "r6id.large", + "r6id.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-12tb1.112xlarge", + "u-24tb1.112xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "u7i-6tb.112xlarge", + "u7i-8tb.112xlarge", + "u7in-16tb.224xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x1e.16xlarge", + "x1e.2xlarge", + "x1e.32xlarge", + "x1e.4xlarge", + "x1e.8xlarge", + "x1e.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + "z1d.12xlarge", + "z1d.2xlarge", + "z1d.3xlarge", + "z1d.6xlarge", + "z1d.large", + "z1d.xlarge", + ], + "signature_version": "4", + }, + "ap-northeast-3": { + "api_name": "ec2_ap_northeast", + "country": "Japan", + "endpoint": "ec2.ap-northeast-3.amazonaws.com", + "id": "ap-northeast-3", + "instance_types": [], + "signature_version": "4", + }, + "ap-south-1": { + "api_name": "ec2_ap_south_1", + "country": "India", + "endpoint": "ec2.ap-south-1.amazonaws.com", + "id": "ap-south-1", + "instance_types": [ + "a1.2xlarge", + "a1.4xlarge", + "a1.large", + "a1.medium", + "a1.xlarge", + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7gd.12xlarge", + "c7gd.16xlarge", + "c7gd.2xlarge", + "c7gd.4xlarge", + "c7gd.8xlarge", + "c7gd.large", + "c7gd.medium", + "c7gd.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "d3.2xlarge", + "d3.4xlarge", + "d3.8xlarge", + "d3.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "i2.2xlarge", + "i2.4xlarge", + "i2.8xlarge", + "i2.large", + "i2.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "is4gen.2xlarge", + "is4gen.4xlarge", + "is4gen.8xlarge", + "is4gen.large", + "is4gen.medium", + "is4gen.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m6idn.12xlarge", + "m6idn.16xlarge", + "m6idn.24xlarge", + "m6idn.2xlarge", + "m6idn.32xlarge", + "m6idn.4xlarge", + "m6idn.8xlarge", + "m6idn.large", + "m6idn.xlarge", + "m6in.12xlarge", + "m6in.16xlarge", + "m6in.24xlarge", + "m6in.2xlarge", + "m6in.32xlarge", + "m6in.4xlarge", + "m6in.8xlarge", + "m6in.large", + "m6in.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "p2.16xlarge", + "p2.8xlarge", + "p2.xlarge", + "p4d.24xlarge", + "p5.48xlarge", + "p5en.48xlarge", + "r3.2xlarge", + "r3.4xlarge", + "r3.8xlarge", + "r3.large", + "r3.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6a.12xlarge", + "r6a.16xlarge", + "r6a.24xlarge", + "r6a.2xlarge", + "r6a.32xlarge", + "r6a.48xlarge", + "r6a.4xlarge", + "r6a.8xlarge", + "r6a.large", + "r6a.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r6id.12xlarge", + "r6id.16xlarge", + "r6id.24xlarge", + "r6id.2xlarge", + "r6id.32xlarge", + "r6id.4xlarge", + "r6id.8xlarge", + "r6id.large", + "r6id.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7gd.12xlarge", + "r7gd.16xlarge", + "r7gd.2xlarge", + "r7gd.4xlarge", + "r7gd.8xlarge", + "r7gd.large", + "r7gd.medium", + "r7gd.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "r8g.12xlarge", + "r8g.16xlarge", + "r8g.24xlarge", + "r8g.2xlarge", + "r8g.48xlarge", + "r8g.4xlarge", + "r8g.8xlarge", + "r8g.large", + "r8g.medium", + "r8g.xlarge", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-12tb1.112xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x1e.16xlarge", + "x1e.2xlarge", + "x1e.32xlarge", + "x1e.4xlarge", + "x1e.8xlarge", + "x1e.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + "z1d.12xlarge", + "z1d.2xlarge", + "z1d.3xlarge", + "z1d.6xlarge", + "z1d.large", + "z1d.xlarge", + ], + "signature_version": "4", + }, + "ap-southeast-1": { + "api_name": "ec2_ap_southeast", + "country": "Singapore", + "endpoint": "ec2.ap-southeast-1.amazonaws.com", + "id": "ap-southeast-1", + "instance_types": [ + "a1.2xlarge", + "a1.4xlarge", + "a1.large", + "a1.medium", + "a1.xlarge", + "c1.medium", + "c1.xlarge", + "c3.2xlarge", + "c3.4xlarge", + "c3.8xlarge", + "c3.large", + "c3.xlarge", + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5ad.12xlarge", + "c5ad.16xlarge", + "c5ad.24xlarge", + "c5ad.2xlarge", + "c5ad.4xlarge", + "c5ad.8xlarge", + "c5ad.large", + "c5ad.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6id.12xlarge", + "c6id.16xlarge", + "c6id.24xlarge", + "c6id.2xlarge", + "c6id.32xlarge", + "c6id.4xlarge", + "c6id.8xlarge", + "c6id.large", + "c6id.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7gd.12xlarge", + "c7gd.16xlarge", + "c7gd.2xlarge", + "c7gd.4xlarge", + "c7gd.8xlarge", + "c7gd.large", + "c7gd.medium", + "c7gd.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "d3.2xlarge", + "d3.4xlarge", + "d3.8xlarge", + "d3.xlarge", + "d3en.12xlarge", + "d3en.2xlarge", + "d3en.4xlarge", + "d3en.6xlarge", + "d3en.8xlarge", + "d3en.xlarge", + "g2.2xlarge", + "g2.8xlarge", + "g3.16xlarge", + "g3.4xlarge", + "g3.8xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5g.16xlarge", + "g5g.2xlarge", + "g5g.4xlarge", + "g5g.8xlarge", + "g5g.xlarge", + "hpc6a.48xlarge", + "hs1.8xlarge", + "i2.2xlarge", + "i2.4xlarge", + "i2.8xlarge", + "i2.large", + "i2.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4g.16xlarge", + "i4g.2xlarge", + "i4g.4xlarge", + "i4g.8xlarge", + "i4g.large", + "i4g.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "im4gn.16xlarge", + "im4gn.2xlarge", + "im4gn.4xlarge", + "im4gn.8xlarge", + "im4gn.large", + "im4gn.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "is4gen.2xlarge", + "is4gen.4xlarge", + "is4gen.8xlarge", + "is4gen.large", + "is4gen.medium", + "is4gen.xlarge", + "m1.large", + "m1.medium", + "m1.small", + "m1.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "m2.xlarge", + "m3.2xlarge", + "m3.large", + "m3.medium", + "m3.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m5dn.12xlarge", + "m5dn.16xlarge", + "m5dn.24xlarge", + "m5dn.2xlarge", + "m5dn.4xlarge", + "m5dn.8xlarge", + "m5dn.large", + "m5dn.xlarge", + "m5n.12xlarge", + "m5n.16xlarge", + "m5n.24xlarge", + "m5n.2xlarge", + "m5n.4xlarge", + "m5n.8xlarge", + "m5n.large", + "m5n.xlarge", + "m5zn.12xlarge", + "m5zn.2xlarge", + "m5zn.3xlarge", + "m5zn.6xlarge", + "m5zn.large", + "m5zn.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m6idn.12xlarge", + "m6idn.16xlarge", + "m6idn.24xlarge", + "m6idn.2xlarge", + "m6idn.32xlarge", + "m6idn.4xlarge", + "m6idn.8xlarge", + "m6idn.large", + "m6idn.xlarge", + "m6in.12xlarge", + "m6in.16xlarge", + "m6in.24xlarge", + "m6in.2xlarge", + "m6in.32xlarge", + "m6in.4xlarge", + "m6in.8xlarge", + "m6in.large", + "m6in.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "p2.16xlarge", + "p2.8xlarge", + "p2.xlarge", + "p3.16xlarge", + "p3.2xlarge", + "p3.8xlarge", + "p4d.24xlarge", + "p4de.24xlarge", + "r3.2xlarge", + "r3.4xlarge", + "r3.8xlarge", + "r3.large", + "r3.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5dn.12xlarge", + "r5dn.16xlarge", + "r5dn.24xlarge", + "r5dn.2xlarge", + "r5dn.4xlarge", + "r5dn.8xlarge", + "r5dn.large", + "r5dn.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6a.12xlarge", + "r6a.16xlarge", + "r6a.24xlarge", + "r6a.2xlarge", + "r6a.32xlarge", + "r6a.48xlarge", + "r6a.4xlarge", + "r6a.8xlarge", + "r6a.large", + "r6a.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r6id.12xlarge", + "r6id.16xlarge", + "r6id.24xlarge", + "r6id.2xlarge", + "r6id.32xlarge", + "r6id.4xlarge", + "r6id.8xlarge", + "r6id.large", + "r6id.xlarge", + "r6idn.12xlarge", + "r6idn.16xlarge", + "r6idn.24xlarge", + "r6idn.2xlarge", + "r6idn.32xlarge", + "r6idn.4xlarge", + "r6idn.8xlarge", + "r6idn.large", + "r6idn.xlarge", + "r6in.12xlarge", + "r6in.16xlarge", + "r6in.24xlarge", + "r6in.2xlarge", + "r6in.32xlarge", + "r6in.4xlarge", + "r6in.8xlarge", + "r6in.large", + "r6in.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7gd.12xlarge", + "r7gd.16xlarge", + "r7gd.2xlarge", + "r7gd.4xlarge", + "r7gd.8xlarge", + "r7gd.large", + "r7gd.medium", + "r7gd.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "t1.micro", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-12tb1.112xlarge", + "u-3tb1.56xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x1e.16xlarge", + "x1e.2xlarge", + "x1e.32xlarge", + "x1e.4xlarge", + "x1e.8xlarge", + "x1e.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + "z1d.12xlarge", + "z1d.2xlarge", + "z1d.3xlarge", + "z1d.6xlarge", + "z1d.large", + "z1d.xlarge", + ], + "signature_version": "2", + }, + "ap-southeast-2": { + "api_name": "ec2_ap_southeast_2", + "country": "Australia", + "endpoint": "ec2.ap-southeast-2.amazonaws.com", + "id": "ap-southeast-2", + "instance_types": [ + "a1.2xlarge", + "a1.4xlarge", + "a1.large", + "a1.medium", + "a1.xlarge", + "c1.medium", + "c1.xlarge", + "c3.2xlarge", + "c3.4xlarge", + "c3.8xlarge", + "c3.large", + "c3.xlarge", + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5ad.12xlarge", + "c5ad.16xlarge", + "c5ad.24xlarge", + "c5ad.2xlarge", + "c5ad.4xlarge", + "c5ad.8xlarge", + "c5ad.large", + "c5ad.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6id.12xlarge", + "c6id.16xlarge", + "c6id.24xlarge", + "c6id.2xlarge", + "c6id.32xlarge", + "c6id.4xlarge", + "c6id.8xlarge", + "c6id.large", + "c6id.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7gd.12xlarge", + "c7gd.16xlarge", + "c7gd.2xlarge", + "c7gd.4xlarge", + "c7gd.8xlarge", + "c7gd.large", + "c7gd.medium", + "c7gd.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "d3.2xlarge", + "d3.4xlarge", + "d3.8xlarge", + "d3.xlarge", + "d3en.12xlarge", + "d3en.2xlarge", + "d3en.4xlarge", + "d3en.6xlarge", + "d3en.8xlarge", + "d3en.xlarge", + "f1.16xlarge", + "f1.2xlarge", + "f1.4xlarge", + "f2.12xlarge", + "f2.48xlarge", + "f2.6xlarge", + "g2.2xlarge", + "g2.8xlarge", + "g3.16xlarge", + "g3.4xlarge", + "g3.8xlarge", + "g3s.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "hpc6a.48xlarge", + "hs1.8xlarge", + "i2.2xlarge", + "i2.4xlarge", + "i2.8xlarge", + "i2.large", + "i2.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "im4gn.16xlarge", + "im4gn.2xlarge", + "im4gn.4xlarge", + "im4gn.8xlarge", + "im4gn.large", + "im4gn.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "is4gen.2xlarge", + "is4gen.4xlarge", + "is4gen.8xlarge", + "is4gen.large", + "is4gen.medium", + "is4gen.xlarge", + "m1.large", + "m1.medium", + "m1.small", + "m1.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "m2.xlarge", + "m3.2xlarge", + "m3.large", + "m3.medium", + "m3.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m5zn.12xlarge", + "m5zn.2xlarge", + "m5zn.3xlarge", + "m5zn.6xlarge", + "m5zn.large", + "m5zn.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m6idn.12xlarge", + "m6idn.16xlarge", + "m6idn.24xlarge", + "m6idn.2xlarge", + "m6idn.32xlarge", + "m6idn.4xlarge", + "m6idn.8xlarge", + "m6idn.large", + "m6idn.xlarge", + "m6in.12xlarge", + "m6in.16xlarge", + "m6in.24xlarge", + "m6in.2xlarge", + "m6in.32xlarge", + "m6in.4xlarge", + "m6in.8xlarge", + "m6in.large", + "m6in.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "p2.16xlarge", + "p2.8xlarge", + "p2.xlarge", + "p3.16xlarge", + "p3.2xlarge", + "p3.8xlarge", + "p4d.24xlarge", + "p5.48xlarge", + "r3.2xlarge", + "r3.4xlarge", + "r3.8xlarge", + "r3.large", + "r3.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5dn.12xlarge", + "r5dn.16xlarge", + "r5dn.24xlarge", + "r5dn.2xlarge", + "r5dn.4xlarge", + "r5dn.8xlarge", + "r5dn.large", + "r5dn.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6a.12xlarge", + "r6a.16xlarge", + "r6a.24xlarge", + "r6a.2xlarge", + "r6a.32xlarge", + "r6a.48xlarge", + "r6a.4xlarge", + "r6a.8xlarge", + "r6a.large", + "r6a.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r6id.12xlarge", + "r6id.16xlarge", + "r6id.24xlarge", + "r6id.2xlarge", + "r6id.32xlarge", + "r6id.4xlarge", + "r6id.8xlarge", + "r6id.large", + "r6id.xlarge", + "r6idn.12xlarge", + "r6idn.16xlarge", + "r6idn.24xlarge", + "r6idn.2xlarge", + "r6idn.32xlarge", + "r6idn.4xlarge", + "r6idn.8xlarge", + "r6idn.large", + "r6idn.xlarge", + "r6in.12xlarge", + "r6in.16xlarge", + "r6in.24xlarge", + "r6in.2xlarge", + "r6in.32xlarge", + "r6in.4xlarge", + "r6in.8xlarge", + "r6in.large", + "r6in.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7gd.12xlarge", + "r7gd.16xlarge", + "r7gd.2xlarge", + "r7gd.4xlarge", + "r7gd.8xlarge", + "r7gd.large", + "r7gd.medium", + "r7gd.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "r8g.12xlarge", + "r8g.16xlarge", + "r8g.24xlarge", + "r8g.2xlarge", + "r8g.48xlarge", + "r8g.4xlarge", + "r8g.8xlarge", + "r8g.large", + "r8g.medium", + "r8g.xlarge", + "t1.micro", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-12tb1.112xlarge", + "u-3tb1.56xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u7in-16tb.224xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x1e.16xlarge", + "x1e.2xlarge", + "x1e.32xlarge", + "x1e.4xlarge", + "x1e.8xlarge", + "x1e.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + "z1d.12xlarge", + "z1d.2xlarge", + "z1d.3xlarge", + "z1d.6xlarge", + "z1d.large", + "z1d.xlarge", + ], + "signature_version": "2", + }, + "ca-central-1": { + "api_name": "ec2_ca_central_1", + "country": "Canada", + "endpoint": "ec2.ca-central-1.amazonaws.com", + "id": "ca-central-1", + "instance_types": [ + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6id.12xlarge", + "c6id.16xlarge", + "c6id.24xlarge", + "c6id.2xlarge", + "c6id.32xlarge", + "c6id.4xlarge", + "c6id.8xlarge", + "c6id.large", + "c6id.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "d3.2xlarge", + "d3.4xlarge", + "d3.8xlarge", + "d3.xlarge", + "g3.16xlarge", + "g3.4xlarge", + "g3.8xlarge", + "g4ad.16xlarge", + "g4ad.2xlarge", + "g4ad.4xlarge", + "g4ad.8xlarge", + "g4ad.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4g.16xlarge", + "i4g.2xlarge", + "i4g.4xlarge", + "i4g.8xlarge", + "i4g.large", + "i4g.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "im4gn.16xlarge", + "im4gn.2xlarge", + "im4gn.4xlarge", + "im4gn.8xlarge", + "im4gn.large", + "im4gn.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "is4gen.2xlarge", + "is4gen.4xlarge", + "is4gen.8xlarge", + "is4gen.large", + "is4gen.medium", + "is4gen.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m6idn.12xlarge", + "m6idn.16xlarge", + "m6idn.24xlarge", + "m6idn.2xlarge", + "m6idn.32xlarge", + "m6idn.4xlarge", + "m6idn.8xlarge", + "m6idn.large", + "m6idn.xlarge", + "m6in.12xlarge", + "m6in.16xlarge", + "m6in.24xlarge", + "m6in.2xlarge", + "m6in.32xlarge", + "m6in.4xlarge", + "m6in.8xlarge", + "m6in.large", + "m6in.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "p3.16xlarge", + "p3.2xlarge", + "p3.8xlarge", + "p4d.24xlarge", + "p5.48xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6a.12xlarge", + "r6a.16xlarge", + "r6a.24xlarge", + "r6a.2xlarge", + "r6a.32xlarge", + "r6a.48xlarge", + "r6a.4xlarge", + "r6a.8xlarge", + "r6a.large", + "r6a.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-3tb1.56xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x1e.16xlarge", + "x1e.2xlarge", + "x1e.32xlarge", + "x1e.4xlarge", + "x1e.8xlarge", + "x1e.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + ], + "signature_version": "4", + }, + "cn-north-1": { + "api_name": "ec2_cn_north", + "country": "China", + "endpoint": "ec2.cn-north-1.amazonaws.com.cn", + "id": "cn-north-1", + "instance_types": [], + "signature_version": "4", + }, + "cn-northwest-1": { + "api_name": "ec2_cn_northwest", + "country": "China", + "endpoint": "ec2.cn-northwest-1.amazonaws.com.cn", + "id": "cn-northwest-1", + "instance_types": [], + "signature_version": "4", + }, + "eu-central-1": { + "api_name": "ec2_eu_central", + "country": "Frankfurt", + "endpoint": "ec2.eu-central-1.amazonaws.com", + "id": "eu-central-1", + "instance_types": [ + "a1.2xlarge", + "a1.4xlarge", + "a1.large", + "a1.medium", + "a1.xlarge", + "c3.2xlarge", + "c3.4xlarge", + "c3.8xlarge", + "c3.large", + "c3.xlarge", + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5ad.12xlarge", + "c5ad.16xlarge", + "c5ad.24xlarge", + "c5ad.2xlarge", + "c5ad.4xlarge", + "c5ad.8xlarge", + "c5ad.large", + "c5ad.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6id.12xlarge", + "c6id.16xlarge", + "c6id.24xlarge", + "c6id.2xlarge", + "c6id.32xlarge", + "c6id.4xlarge", + "c6id.8xlarge", + "c6id.large", + "c6id.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7a.12xlarge", + "c7a.16xlarge", + "c7a.24xlarge", + "c7a.2xlarge", + "c7a.32xlarge", + "c7a.48xlarge", + "c7a.4xlarge", + "c7a.8xlarge", + "c7a.large", + "c7a.medium", + "c7a.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7gd.12xlarge", + "c7gd.16xlarge", + "c7gd.2xlarge", + "c7gd.4xlarge", + "c7gd.8xlarge", + "c7gd.large", + "c7gd.medium", + "c7gd.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "c8g.12xlarge", + "c8g.16xlarge", + "c8g.24xlarge", + "c8g.2xlarge", + "c8g.48xlarge", + "c8g.4xlarge", + "c8g.8xlarge", + "c8g.large", + "c8g.medium", + "c8g.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "d3.2xlarge", + "d3.4xlarge", + "d3.8xlarge", + "d3.xlarge", + "d3en.12xlarge", + "d3en.2xlarge", + "d3en.4xlarge", + "d3en.6xlarge", + "d3en.8xlarge", + "d3en.xlarge", + "dl2q.24xlarge", + "f1.2xlarge", + "f1.4xlarge", + "g2.2xlarge", + "g2.8xlarge", + "g3.16xlarge", + "g3.4xlarge", + "g3.8xlarge", + "g3s.xlarge", + "g4ad.16xlarge", + "g4ad.2xlarge", + "g4ad.4xlarge", + "g4ad.8xlarge", + "g4ad.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "g5g.16xlarge", + "g5g.2xlarge", + "g5g.4xlarge", + "g5g.8xlarge", + "g5g.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "g6e.12xlarge", + "g6e.16xlarge", + "g6e.24xlarge", + "g6e.2xlarge", + "g6e.48xlarge", + "g6e.4xlarge", + "g6e.8xlarge", + "g6e.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "i2.2xlarge", + "i2.4xlarge", + "i2.8xlarge", + "i2.large", + "i2.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "i7ie.12xlarge", + "i7ie.18xlarge", + "i7ie.24xlarge", + "i7ie.2xlarge", + "i7ie.3xlarge", + "i7ie.48xlarge", + "i7ie.6xlarge", + "i7ie.large", + "i7ie.xlarge", + "i8g.12xlarge", + "i8g.16xlarge", + "i8g.24xlarge", + "i8g.2xlarge", + "i8g.4xlarge", + "i8g.8xlarge", + "i8g.large", + "i8g.xlarge", + "im4gn.16xlarge", + "im4gn.2xlarge", + "im4gn.4xlarge", + "im4gn.8xlarge", + "im4gn.large", + "im4gn.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "is4gen.2xlarge", + "is4gen.4xlarge", + "is4gen.8xlarge", + "is4gen.large", + "is4gen.medium", + "is4gen.xlarge", + "m3.2xlarge", + "m3.large", + "m3.medium", + "m3.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m5dn.12xlarge", + "m5dn.16xlarge", + "m5dn.24xlarge", + "m5dn.2xlarge", + "m5dn.4xlarge", + "m5dn.8xlarge", + "m5dn.large", + "m5dn.xlarge", + "m5n.12xlarge", + "m5n.16xlarge", + "m5n.24xlarge", + "m5n.2xlarge", + "m5n.4xlarge", + "m5n.8xlarge", + "m5n.large", + "m5n.xlarge", + "m5zn.12xlarge", + "m5zn.2xlarge", + "m5zn.3xlarge", + "m5zn.6xlarge", + "m5zn.large", + "m5zn.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m6idn.12xlarge", + "m6idn.16xlarge", + "m6idn.24xlarge", + "m6idn.2xlarge", + "m6idn.32xlarge", + "m6idn.4xlarge", + "m6idn.8xlarge", + "m6idn.large", + "m6idn.xlarge", + "m6in.12xlarge", + "m6in.16xlarge", + "m6in.24xlarge", + "m6in.2xlarge", + "m6in.32xlarge", + "m6in.4xlarge", + "m6in.8xlarge", + "m6in.large", + "m6in.xlarge", + "m7a.12xlarge", + "m7a.16xlarge", + "m7a.24xlarge", + "m7a.2xlarge", + "m7a.32xlarge", + "m7a.48xlarge", + "m7a.4xlarge", + "m7a.8xlarge", + "m7a.large", + "m7a.medium", + "m7a.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "m8g.12xlarge", + "m8g.16xlarge", + "m8g.24xlarge", + "m8g.2xlarge", + "m8g.48xlarge", + "m8g.4xlarge", + "m8g.8xlarge", + "m8g.large", + "m8g.medium", + "m8g.xlarge", + "p2.16xlarge", + "p2.8xlarge", + "p2.xlarge", + "p3.16xlarge", + "p3.2xlarge", + "p3.8xlarge", + "p4d.24xlarge", + "p4de.24xlarge", + "r3.2xlarge", + "r3.4xlarge", + "r3.8xlarge", + "r3.large", + "r3.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5dn.12xlarge", + "r5dn.16xlarge", + "r5dn.24xlarge", + "r5dn.2xlarge", + "r5dn.4xlarge", + "r5dn.8xlarge", + "r5dn.large", + "r5dn.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6a.12xlarge", + "r6a.16xlarge", + "r6a.24xlarge", + "r6a.2xlarge", + "r6a.32xlarge", + "r6a.48xlarge", + "r6a.4xlarge", + "r6a.8xlarge", + "r6a.large", + "r6a.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r6id.12xlarge", + "r6id.16xlarge", + "r6id.24xlarge", + "r6id.2xlarge", + "r6id.32xlarge", + "r6id.4xlarge", + "r6id.8xlarge", + "r6id.large", + "r6id.xlarge", + "r6idn.12xlarge", + "r6idn.16xlarge", + "r6idn.24xlarge", + "r6idn.2xlarge", + "r6idn.32xlarge", + "r6idn.4xlarge", + "r6idn.8xlarge", + "r6idn.large", + "r6idn.xlarge", + "r6in.12xlarge", + "r6in.16xlarge", + "r6in.24xlarge", + "r6in.2xlarge", + "r6in.32xlarge", + "r6in.4xlarge", + "r6in.8xlarge", + "r6in.large", + "r6in.xlarge", + "r7a.12xlarge", + "r7a.16xlarge", + "r7a.24xlarge", + "r7a.2xlarge", + "r7a.32xlarge", + "r7a.48xlarge", + "r7a.4xlarge", + "r7a.8xlarge", + "r7a.large", + "r7a.medium", + "r7a.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7gd.12xlarge", + "r7gd.16xlarge", + "r7gd.2xlarge", + "r7gd.4xlarge", + "r7gd.8xlarge", + "r7gd.large", + "r7gd.medium", + "r7gd.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "r7iz.12xlarge", + "r7iz.16xlarge", + "r7iz.2xlarge", + "r7iz.32xlarge", + "r7iz.4xlarge", + "r7iz.8xlarge", + "r7iz.large", + "r7iz.xlarge", + "r8g.12xlarge", + "r8g.16xlarge", + "r8g.24xlarge", + "r8g.2xlarge", + "r8g.48xlarge", + "r8g.4xlarge", + "r8g.8xlarge", + "r8g.large", + "r8g.medium", + "r8g.xlarge", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-12tb1.112xlarge", + "u-18tb1.112xlarge", + "u-3tb1.56xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x1e.16xlarge", + "x1e.2xlarge", + "x1e.32xlarge", + "x1e.4xlarge", + "x1e.8xlarge", + "x1e.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + "x8g.12xlarge", + "x8g.16xlarge", + "x8g.24xlarge", + "x8g.2xlarge", + "x8g.48xlarge", + "x8g.4xlarge", + "x8g.8xlarge", + "x8g.large", + "x8g.medium", + "x8g.xlarge", + "z1d.12xlarge", + "z1d.2xlarge", + "z1d.3xlarge", + "z1d.6xlarge", + "z1d.large", + "z1d.xlarge", + ], + "signature_version": "4", + }, + "eu-north-1": { + "api_name": "ec2_eu_north_stockholm", + "country": "Stockholm", + "endpoint": "ec2.eu-north-1.amazonaws.com", + "id": "eu-north-1", + "instance_types": [ + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7a.12xlarge", + "c7a.16xlarge", + "c7a.24xlarge", + "c7a.2xlarge", + "c7a.32xlarge", + "c7a.48xlarge", + "c7a.4xlarge", + "c7a.8xlarge", + "c7a.large", + "c7a.medium", + "c7a.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7gd.12xlarge", + "c7gd.16xlarge", + "c7gd.2xlarge", + "c7gd.4xlarge", + "c7gd.8xlarge", + "c7gd.large", + "c7gd.medium", + "c7gd.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "c8g.12xlarge", + "c8g.16xlarge", + "c8g.24xlarge", + "c8g.2xlarge", + "c8g.48xlarge", + "c8g.4xlarge", + "c8g.8xlarge", + "c8g.large", + "c8g.medium", + "c8g.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "g6e.12xlarge", + "g6e.16xlarge", + "g6e.24xlarge", + "g6e.2xlarge", + "g6e.48xlarge", + "g6e.4xlarge", + "g6e.8xlarge", + "g6e.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "hpc6a.48xlarge", + "hpc6id.32xlarge", + "hpc7a.12xlarge", + "hpc7a.24xlarge", + "hpc7a.48xlarge", + "hpc7a.96xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6idn.12xlarge", + "m6idn.16xlarge", + "m6idn.24xlarge", + "m6idn.2xlarge", + "m6idn.32xlarge", + "m6idn.4xlarge", + "m6idn.8xlarge", + "m6idn.large", + "m6idn.xlarge", + "m6in.12xlarge", + "m6in.16xlarge", + "m6in.24xlarge", + "m6in.2xlarge", + "m6in.32xlarge", + "m6in.4xlarge", + "m6in.8xlarge", + "m6in.large", + "m6in.xlarge", + "m7a.12xlarge", + "m7a.16xlarge", + "m7a.24xlarge", + "m7a.2xlarge", + "m7a.32xlarge", + "m7a.48xlarge", + "m7a.4xlarge", + "m7a.8xlarge", + "m7a.large", + "m7a.medium", + "m7a.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "m8g.12xlarge", + "m8g.16xlarge", + "m8g.24xlarge", + "m8g.2xlarge", + "m8g.48xlarge", + "m8g.4xlarge", + "m8g.8xlarge", + "m8g.large", + "m8g.medium", + "m8g.xlarge", + "p5.48xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5dn.12xlarge", + "r5dn.16xlarge", + "r5dn.24xlarge", + "r5dn.2xlarge", + "r5dn.4xlarge", + "r5dn.8xlarge", + "r5dn.large", + "r5dn.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r6idn.12xlarge", + "r6idn.16xlarge", + "r6idn.24xlarge", + "r6idn.2xlarge", + "r6idn.32xlarge", + "r6idn.4xlarge", + "r6idn.8xlarge", + "r6idn.large", + "r6idn.xlarge", + "r6in.12xlarge", + "r6in.16xlarge", + "r6in.24xlarge", + "r6in.2xlarge", + "r6in.32xlarge", + "r6in.4xlarge", + "r6in.8xlarge", + "r6in.large", + "r6in.xlarge", + "r7a.12xlarge", + "r7a.16xlarge", + "r7a.24xlarge", + "r7a.2xlarge", + "r7a.32xlarge", + "r7a.48xlarge", + "r7a.4xlarge", + "r7a.8xlarge", + "r7a.large", + "r7a.medium", + "r7a.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7gd.12xlarge", + "r7gd.16xlarge", + "r7gd.2xlarge", + "r7gd.4xlarge", + "r7gd.8xlarge", + "r7gd.large", + "r7gd.medium", + "r7gd.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "r8g.12xlarge", + "r8g.16xlarge", + "r8g.24xlarge", + "r8g.2xlarge", + "r8g.48xlarge", + "r8g.4xlarge", + "r8g.8xlarge", + "r8g.large", + "r8g.medium", + "r8g.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + ], + "signature_version": "4", + }, + "eu-south-1": { + "api_name": "ec2_eu_south", + "country": "Italy", + "endpoint": "ec2.eu-south-1.amazonaws.com", + "id": "eu-south-1", + "instance_types": [ + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5ad.12xlarge", + "c5ad.16xlarge", + "c5ad.24xlarge", + "c5ad.2xlarge", + "c5ad.4xlarge", + "c5ad.8xlarge", + "c5ad.large", + "c5ad.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5dn.12xlarge", + "r5dn.16xlarge", + "r5dn.24xlarge", + "r5dn.2xlarge", + "r5dn.4xlarge", + "r5dn.8xlarge", + "r5dn.large", + "r5dn.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-12tb1.112xlarge", + "u-3tb1.56xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + ], + "signature_version": "4", + }, + "eu-west-1": { + "api_name": "ec2_eu_west", + "country": "Ireland", + "endpoint": "ec2.eu-west-1.amazonaws.com", + "id": "eu-west-1", + "instance_types": [ + "a1.2xlarge", + "a1.4xlarge", + "a1.large", + "a1.medium", + "a1.xlarge", + "c1.medium", + "c1.xlarge", + "c3.2xlarge", + "c3.4xlarge", + "c3.8xlarge", + "c3.large", + "c3.xlarge", + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5ad.12xlarge", + "c5ad.16xlarge", + "c5ad.24xlarge", + "c5ad.2xlarge", + "c5ad.4xlarge", + "c5ad.8xlarge", + "c5ad.large", + "c5ad.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6id.12xlarge", + "c6id.16xlarge", + "c6id.24xlarge", + "c6id.2xlarge", + "c6id.32xlarge", + "c6id.4xlarge", + "c6id.8xlarge", + "c6id.large", + "c6id.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7a.12xlarge", + "c7a.16xlarge", + "c7a.24xlarge", + "c7a.2xlarge", + "c7a.32xlarge", + "c7a.48xlarge", + "c7a.4xlarge", + "c7a.8xlarge", + "c7a.large", + "c7a.medium", + "c7a.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7gd.12xlarge", + "c7gd.16xlarge", + "c7gd.2xlarge", + "c7gd.4xlarge", + "c7gd.8xlarge", + "c7gd.large", + "c7gd.medium", + "c7gd.xlarge", + "c7gn.12xlarge", + "c7gn.16xlarge", + "c7gn.2xlarge", + "c7gn.4xlarge", + "c7gn.8xlarge", + "c7gn.large", + "c7gn.medium", + "c7gn.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "c8g.12xlarge", + "c8g.16xlarge", + "c8g.24xlarge", + "c8g.2xlarge", + "c8g.48xlarge", + "c8g.4xlarge", + "c8g.8xlarge", + "c8g.large", + "c8g.medium", + "c8g.xlarge", + "cc2.8xlarge", + "cr1.8xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "d3.2xlarge", + "d3.4xlarge", + "d3.8xlarge", + "d3.xlarge", + "d3en.12xlarge", + "d3en.2xlarge", + "d3en.4xlarge", + "d3en.6xlarge", + "d3en.8xlarge", + "d3en.xlarge", + "f1.16xlarge", + "f1.2xlarge", + "f1.4xlarge", + "g2.2xlarge", + "g2.8xlarge", + "g3.16xlarge", + "g3.4xlarge", + "g3.8xlarge", + "g3s.xlarge", + "g4ad.16xlarge", + "g4ad.2xlarge", + "g4ad.4xlarge", + "g4ad.8xlarge", + "g4ad.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "h1.16xlarge", + "h1.2xlarge", + "h1.4xlarge", + "h1.8xlarge", + "hpc7a.12xlarge", + "hpc7a.24xlarge", + "hpc7a.48xlarge", + "hpc7a.96xlarge", + "hpc7g.16xlarge", + "hpc7g.4xlarge", + "hpc7g.8xlarge", + "hs1.8xlarge", + "i2.2xlarge", + "i2.4xlarge", + "i2.8xlarge", + "i2.large", + "i2.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4g.16xlarge", + "i4g.2xlarge", + "i4g.4xlarge", + "i4g.8xlarge", + "i4g.large", + "i4g.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "im4gn.16xlarge", + "im4gn.2xlarge", + "im4gn.4xlarge", + "im4gn.8xlarge", + "im4gn.large", + "im4gn.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "is4gen.2xlarge", + "is4gen.4xlarge", + "is4gen.8xlarge", + "is4gen.large", + "is4gen.medium", + "is4gen.xlarge", + "m1.large", + "m1.medium", + "m1.small", + "m1.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "m2.xlarge", + "m3.2xlarge", + "m3.large", + "m3.medium", + "m3.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m5dn.12xlarge", + "m5dn.16xlarge", + "m5dn.24xlarge", + "m5dn.2xlarge", + "m5dn.4xlarge", + "m5dn.8xlarge", + "m5dn.large", + "m5dn.xlarge", + "m5n.12xlarge", + "m5n.16xlarge", + "m5n.24xlarge", + "m5n.2xlarge", + "m5n.4xlarge", + "m5n.8xlarge", + "m5n.large", + "m5n.xlarge", + "m5zn.12xlarge", + "m5zn.2xlarge", + "m5zn.3xlarge", + "m5zn.6xlarge", + "m5zn.large", + "m5zn.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m6idn.12xlarge", + "m6idn.16xlarge", + "m6idn.24xlarge", + "m6idn.2xlarge", + "m6idn.32xlarge", + "m6idn.4xlarge", + "m6idn.8xlarge", + "m6idn.large", + "m6idn.xlarge", + "m6in.12xlarge", + "m6in.16xlarge", + "m6in.24xlarge", + "m6in.2xlarge", + "m6in.32xlarge", + "m6in.4xlarge", + "m6in.8xlarge", + "m6in.large", + "m6in.xlarge", + "m7a.12xlarge", + "m7a.16xlarge", + "m7a.24xlarge", + "m7a.2xlarge", + "m7a.32xlarge", + "m7a.48xlarge", + "m7a.4xlarge", + "m7a.8xlarge", + "m7a.large", + "m7a.medium", + "m7a.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "p2.16xlarge", + "p2.8xlarge", + "p2.xlarge", + "p3.16xlarge", + "p3.2xlarge", + "p3.8xlarge", + "p3dn.24xlarge", + "p4d.24xlarge", + "r3.2xlarge", + "r3.4xlarge", + "r3.8xlarge", + "r3.large", + "r3.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5dn.12xlarge", + "r5dn.16xlarge", + "r5dn.24xlarge", + "r5dn.2xlarge", + "r5dn.4xlarge", + "r5dn.8xlarge", + "r5dn.large", + "r5dn.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6a.12xlarge", + "r6a.16xlarge", + "r6a.24xlarge", + "r6a.2xlarge", + "r6a.32xlarge", + "r6a.48xlarge", + "r6a.4xlarge", + "r6a.8xlarge", + "r6a.large", + "r6a.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r6id.12xlarge", + "r6id.16xlarge", + "r6id.24xlarge", + "r6id.2xlarge", + "r6id.32xlarge", + "r6id.4xlarge", + "r6id.8xlarge", + "r6id.large", + "r6id.xlarge", + "r6idn.12xlarge", + "r6idn.16xlarge", + "r6idn.24xlarge", + "r6idn.2xlarge", + "r6idn.32xlarge", + "r6idn.4xlarge", + "r6idn.8xlarge", + "r6idn.large", + "r6idn.xlarge", + "r6in.12xlarge", + "r6in.16xlarge", + "r6in.24xlarge", + "r6in.2xlarge", + "r6in.32xlarge", + "r6in.4xlarge", + "r6in.8xlarge", + "r6in.large", + "r6in.xlarge", + "r7a.12xlarge", + "r7a.16xlarge", + "r7a.24xlarge", + "r7a.2xlarge", + "r7a.32xlarge", + "r7a.48xlarge", + "r7a.4xlarge", + "r7a.8xlarge", + "r7a.large", + "r7a.medium", + "r7a.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7gd.12xlarge", + "r7gd.16xlarge", + "r7gd.2xlarge", + "r7gd.4xlarge", + "r7gd.8xlarge", + "r7gd.large", + "r7gd.medium", + "r7gd.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "r7iz.12xlarge", + "r7iz.16xlarge", + "r7iz.2xlarge", + "r7iz.32xlarge", + "r7iz.4xlarge", + "r7iz.8xlarge", + "r7iz.large", + "r7iz.xlarge", + "r8g.12xlarge", + "r8g.16xlarge", + "r8g.24xlarge", + "r8g.2xlarge", + "r8g.48xlarge", + "r8g.4xlarge", + "r8g.8xlarge", + "r8g.large", + "r8g.medium", + "r8g.xlarge", + "t1.micro", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-12tb1.112xlarge", + "u-18tb1.112xlarge", + "u-3tb1.56xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "vt1.24xlarge", + "vt1.3xlarge", + "vt1.6xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x1e.16xlarge", + "x1e.2xlarge", + "x1e.32xlarge", + "x1e.4xlarge", + "x1e.8xlarge", + "x1e.xlarge", + "x2gd.12xlarge", + "x2gd.16xlarge", + "x2gd.2xlarge", + "x2gd.4xlarge", + "x2gd.8xlarge", + "x2gd.large", + "x2gd.medium", + "x2gd.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + "x2iezn.12xlarge", + "x2iezn.2xlarge", + "x2iezn.4xlarge", + "x2iezn.6xlarge", + "x2iezn.8xlarge", + "z1d.12xlarge", + "z1d.2xlarge", + "z1d.3xlarge", + "z1d.6xlarge", + "z1d.large", + "z1d.xlarge", + ], + "signature_version": "2", + }, + "eu-west-2": { + "api_name": "ec2_eu_west_london", + "country": "United Kingdom", + "endpoint": "ec2.eu-west-2.amazonaws.com", + "id": "eu-west-2", + "instance_types": [ + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6id.12xlarge", + "c6id.16xlarge", + "c6id.24xlarge", + "c6id.2xlarge", + "c6id.32xlarge", + "c6id.4xlarge", + "c6id.8xlarge", + "c6id.large", + "c6id.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "d3.2xlarge", + "d3.4xlarge", + "d3.8xlarge", + "d3.xlarge", + "f1.2xlarge", + "f1.4xlarge", + "f2.12xlarge", + "f2.48xlarge", + "f2.6xlarge", + "g3.16xlarge", + "g3.4xlarge", + "g3.8xlarge", + "g3s.xlarge", + "g4ad.16xlarge", + "g4ad.2xlarge", + "g4ad.4xlarge", + "g4ad.8xlarge", + "g4ad.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "i2.large", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "i7ie.12xlarge", + "i7ie.18xlarge", + "i7ie.24xlarge", + "i7ie.2xlarge", + "i7ie.3xlarge", + "i7ie.48xlarge", + "i7ie.6xlarge", + "i7ie.large", + "i7ie.xlarge", + "im4gn.16xlarge", + "im4gn.2xlarge", + "im4gn.4xlarge", + "im4gn.8xlarge", + "im4gn.large", + "im4gn.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "is4gen.2xlarge", + "is4gen.4xlarge", + "is4gen.8xlarge", + "is4gen.large", + "is4gen.medium", + "is4gen.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "m8g.12xlarge", + "m8g.16xlarge", + "m8g.24xlarge", + "m8g.2xlarge", + "m8g.48xlarge", + "m8g.4xlarge", + "m8g.8xlarge", + "m8g.large", + "m8g.medium", + "m8g.xlarge", + "p3.16xlarge", + "p3.2xlarge", + "p3.8xlarge", + "p5.48xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r6id.12xlarge", + "r6id.16xlarge", + "r6id.24xlarge", + "r6id.2xlarge", + "r6id.32xlarge", + "r6id.4xlarge", + "r6id.8xlarge", + "r6id.large", + "r6id.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + "z1d.12xlarge", + "z1d.2xlarge", + "z1d.3xlarge", + "z1d.6xlarge", + "z1d.large", + "z1d.xlarge", + ], + "signature_version": "4", + }, + "eu-west-3": { + "api_name": "ec2_eu_west_paris", + "country": "France", + "endpoint": "ec2.eu-west-3.amazonaws.com", + "id": "eu-west-3", + "instance_types": [ + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5d.18xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "d3.2xlarge", + "d3.4xlarge", + "d3.8xlarge", + "d3.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "hpc6id.32xlarge", + "hpc7a.12xlarge", + "hpc7a.24xlarge", + "hpc7a.48xlarge", + "hpc7a.96xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "im4gn.16xlarge", + "im4gn.2xlarge", + "im4gn.4xlarge", + "im4gn.8xlarge", + "im4gn.large", + "im4gn.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "is4gen.2xlarge", + "is4gen.4xlarge", + "is4gen.8xlarge", + "is4gen.large", + "is4gen.medium", + "is4gen.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5dn.12xlarge", + "r5dn.16xlarge", + "r5dn.24xlarge", + "r5dn.2xlarge", + "r5dn.4xlarge", + "r5dn.8xlarge", + "r5dn.large", + "r5dn.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + ], + "signature_version": "4", + }, + "sa-east-1": { + "api_name": "ec2_sa_east", + "country": "Brazil", + "endpoint": "ec2.sa-east-1.amazonaws.com", + "id": "sa-east-1", + "instance_types": [ + "c1.medium", + "c1.xlarge", + "c3.2xlarge", + "c3.4xlarge", + "c3.8xlarge", + "c3.large", + "c3.xlarge", + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5ad.12xlarge", + "c5ad.16xlarge", + "c5ad.24xlarge", + "c5ad.2xlarge", + "c5ad.4xlarge", + "c5ad.8xlarge", + "c5ad.large", + "c5ad.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6id.12xlarge", + "c6id.16xlarge", + "c6id.24xlarge", + "c6id.2xlarge", + "c6id.32xlarge", + "c6id.4xlarge", + "c6id.8xlarge", + "c6id.large", + "c6id.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "g2.2xlarge", + "g2.8xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "i2.2xlarge", + "i2.4xlarge", + "i2.8xlarge", + "i2.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "m1.large", + "m1.medium", + "m1.small", + "m1.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "m2.xlarge", + "m3.2xlarge", + "m3.large", + "m3.medium", + "m3.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m5zn.12xlarge", + "m5zn.2xlarge", + "m5zn.3xlarge", + "m5zn.6xlarge", + "m5zn.large", + "m5zn.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "p4d.24xlarge", + "p5.48xlarge", + "r3.2xlarge", + "r3.4xlarge", + "r3.8xlarge", + "r3.large", + "r3.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "t1.micro", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "u-12tb1.112xlarge", + "u-18tb1.112xlarge", + "u-3tb1.56xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x1e.16xlarge", + "x1e.2xlarge", + "x1e.32xlarge", + "x1e.4xlarge", + "x1e.8xlarge", + "x1e.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + ], + "signature_version": "2", + }, + "us-east-1": { + "api_name": "ec2_us_east", + "country": "USA", + "endpoint": "ec2.us-east-1.amazonaws.com", + "id": "us-east-1", + "instance_types": [ + "a1.2xlarge", + "a1.4xlarge", + "a1.large", + "a1.medium", + "a1.xlarge", + "c1.medium", + "c1.xlarge", + "c3.2xlarge", + "c3.4xlarge", + "c3.8xlarge", + "c3.large", + "c3.xlarge", + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5ad.12xlarge", + "c5ad.16xlarge", + "c5ad.24xlarge", + "c5ad.2xlarge", + "c5ad.4xlarge", + "c5ad.8xlarge", + "c5ad.large", + "c5ad.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6id.12xlarge", + "c6id.16xlarge", + "c6id.24xlarge", + "c6id.2xlarge", + "c6id.32xlarge", + "c6id.4xlarge", + "c6id.8xlarge", + "c6id.large", + "c6id.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7a.12xlarge", + "c7a.16xlarge", + "c7a.24xlarge", + "c7a.2xlarge", + "c7a.32xlarge", + "c7a.48xlarge", + "c7a.4xlarge", + "c7a.8xlarge", + "c7a.large", + "c7a.medium", + "c7a.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7gd.12xlarge", + "c7gd.16xlarge", + "c7gd.2xlarge", + "c7gd.4xlarge", + "c7gd.8xlarge", + "c7gd.large", + "c7gd.medium", + "c7gd.xlarge", + "c7gn.12xlarge", + "c7gn.16xlarge", + "c7gn.2xlarge", + "c7gn.4xlarge", + "c7gn.8xlarge", + "c7gn.large", + "c7gn.medium", + "c7gn.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "c8g.12xlarge", + "c8g.16xlarge", + "c8g.24xlarge", + "c8g.2xlarge", + "c8g.48xlarge", + "c8g.4xlarge", + "c8g.8xlarge", + "c8g.large", + "c8g.medium", + "c8g.xlarge", + "cc2.8xlarge", + "cr1.8xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "d3.2xlarge", + "d3.4xlarge", + "d3.8xlarge", + "d3.xlarge", + "d3en.12xlarge", + "d3en.2xlarge", + "d3en.4xlarge", + "d3en.6xlarge", + "d3en.8xlarge", + "d3en.xlarge", + "dl1.24xlarge", + "f1.16xlarge", + "f1.2xlarge", + "f1.4xlarge", + "f2.12xlarge", + "f2.48xlarge", + "f2.6xlarge", + "g2.2xlarge", + "g2.8xlarge", + "g3.16xlarge", + "g3.4xlarge", + "g3.8xlarge", + "g3s.xlarge", + "g4ad.16xlarge", + "g4ad.2xlarge", + "g4ad.4xlarge", + "g4ad.8xlarge", + "g4ad.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "g5g.16xlarge", + "g5g.2xlarge", + "g5g.4xlarge", + "g5g.8xlarge", + "g5g.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "g6e.12xlarge", + "g6e.16xlarge", + "g6e.24xlarge", + "g6e.2xlarge", + "g6e.48xlarge", + "g6e.4xlarge", + "g6e.8xlarge", + "g6e.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "h1.16xlarge", + "h1.2xlarge", + "h1.4xlarge", + "h1.8xlarge", + "hpc7g.16xlarge", + "hpc7g.4xlarge", + "hpc7g.8xlarge", + "hs1.8xlarge", + "i2.2xlarge", + "i2.4xlarge", + "i2.8xlarge", + "i2.large", + "i2.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4g.16xlarge", + "i4g.2xlarge", + "i4g.4xlarge", + "i4g.8xlarge", + "i4g.large", + "i4g.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "i7ie.12xlarge", + "i7ie.18xlarge", + "i7ie.24xlarge", + "i7ie.2xlarge", + "i7ie.3xlarge", + "i7ie.48xlarge", + "i7ie.6xlarge", + "i7ie.large", + "i7ie.xlarge", + "i8g.12xlarge", + "i8g.16xlarge", + "i8g.24xlarge", + "i8g.2xlarge", + "i8g.4xlarge", + "i8g.8xlarge", + "i8g.large", + "i8g.xlarge", + "im4gn.16xlarge", + "im4gn.2xlarge", + "im4gn.4xlarge", + "im4gn.8xlarge", + "im4gn.large", + "im4gn.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "is4gen.2xlarge", + "is4gen.4xlarge", + "is4gen.8xlarge", + "is4gen.large", + "is4gen.medium", + "is4gen.xlarge", + "m1.large", + "m1.medium", + "m1.small", + "m1.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "m2.xlarge", + "m3.2xlarge", + "m3.large", + "m3.medium", + "m3.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m5dn.12xlarge", + "m5dn.16xlarge", + "m5dn.24xlarge", + "m5dn.2xlarge", + "m5dn.4xlarge", + "m5dn.8xlarge", + "m5dn.large", + "m5dn.xlarge", + "m5n.12xlarge", + "m5n.16xlarge", + "m5n.24xlarge", + "m5n.2xlarge", + "m5n.4xlarge", + "m5n.8xlarge", + "m5n.large", + "m5n.xlarge", + "m5zn.12xlarge", + "m5zn.2xlarge", + "m5zn.3xlarge", + "m5zn.6xlarge", + "m5zn.large", + "m5zn.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m6idn.12xlarge", + "m6idn.16xlarge", + "m6idn.24xlarge", + "m6idn.2xlarge", + "m6idn.32xlarge", + "m6idn.4xlarge", + "m6idn.8xlarge", + "m6idn.large", + "m6idn.xlarge", + "m6in.12xlarge", + "m6in.16xlarge", + "m6in.24xlarge", + "m6in.2xlarge", + "m6in.32xlarge", + "m6in.4xlarge", + "m6in.8xlarge", + "m6in.large", + "m6in.xlarge", + "m7a.12xlarge", + "m7a.16xlarge", + "m7a.24xlarge", + "m7a.2xlarge", + "m7a.32xlarge", + "m7a.48xlarge", + "m7a.4xlarge", + "m7a.8xlarge", + "m7a.large", + "m7a.medium", + "m7a.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "m8g.12xlarge", + "m8g.16xlarge", + "m8g.24xlarge", + "m8g.2xlarge", + "m8g.48xlarge", + "m8g.4xlarge", + "m8g.8xlarge", + "m8g.large", + "m8g.medium", + "m8g.xlarge", + "p2.16xlarge", + "p2.8xlarge", + "p2.xlarge", + "p3.16xlarge", + "p3.2xlarge", + "p3.8xlarge", + "p3dn.24xlarge", + "p4d.24xlarge", + "p4de.24xlarge", + "p5.48xlarge", + "r3.2xlarge", + "r3.4xlarge", + "r3.8xlarge", + "r3.large", + "r3.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5dn.12xlarge", + "r5dn.16xlarge", + "r5dn.24xlarge", + "r5dn.2xlarge", + "r5dn.4xlarge", + "r5dn.8xlarge", + "r5dn.large", + "r5dn.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6a.12xlarge", + "r6a.16xlarge", + "r6a.24xlarge", + "r6a.2xlarge", + "r6a.32xlarge", + "r6a.48xlarge", + "r6a.4xlarge", + "r6a.8xlarge", + "r6a.large", + "r6a.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r6id.12xlarge", + "r6id.16xlarge", + "r6id.24xlarge", + "r6id.2xlarge", + "r6id.32xlarge", + "r6id.4xlarge", + "r6id.8xlarge", + "r6id.large", + "r6id.xlarge", + "r6idn.12xlarge", + "r6idn.16xlarge", + "r6idn.24xlarge", + "r6idn.2xlarge", + "r6idn.32xlarge", + "r6idn.4xlarge", + "r6idn.8xlarge", + "r6idn.large", + "r6idn.xlarge", + "r6in.12xlarge", + "r6in.16xlarge", + "r6in.24xlarge", + "r6in.2xlarge", + "r6in.32xlarge", + "r6in.4xlarge", + "r6in.8xlarge", + "r6in.large", + "r6in.xlarge", + "r7a.12xlarge", + "r7a.16xlarge", + "r7a.24xlarge", + "r7a.2xlarge", + "r7a.32xlarge", + "r7a.48xlarge", + "r7a.4xlarge", + "r7a.8xlarge", + "r7a.large", + "r7a.medium", + "r7a.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7gd.12xlarge", + "r7gd.16xlarge", + "r7gd.2xlarge", + "r7gd.4xlarge", + "r7gd.8xlarge", + "r7gd.large", + "r7gd.medium", + "r7gd.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "r7iz.12xlarge", + "r7iz.16xlarge", + "r7iz.2xlarge", + "r7iz.32xlarge", + "r7iz.4xlarge", + "r7iz.8xlarge", + "r7iz.large", + "r7iz.xlarge", + "r8g.12xlarge", + "r8g.16xlarge", + "r8g.24xlarge", + "r8g.2xlarge", + "r8g.48xlarge", + "r8g.4xlarge", + "r8g.8xlarge", + "r8g.large", + "r8g.medium", + "r8g.xlarge", + "t1.micro", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "trn1.2xlarge", + "trn1.32xlarge", + "trn1n.32xlarge", + "u-12tb1.112xlarge", + "u-18tb1.112xlarge", + "u-24tb1.112xlarge", + "u-3tb1.56xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "u7i-12tb.224xlarge", + "u7i-6tb.112xlarge", + "u7i-8tb.112xlarge", + "u7in-16tb.224xlarge", + "u7in-24tb.224xlarge", + "u7in-32tb.224xlarge", + "vt1.24xlarge", + "vt1.3xlarge", + "vt1.6xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x1e.16xlarge", + "x1e.2xlarge", + "x1e.32xlarge", + "x1e.4xlarge", + "x1e.8xlarge", + "x1e.xlarge", + "x2gd.12xlarge", + "x2gd.16xlarge", + "x2gd.2xlarge", + "x2gd.4xlarge", + "x2gd.8xlarge", + "x2gd.large", + "x2gd.medium", + "x2gd.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + "x2iezn.12xlarge", + "x2iezn.2xlarge", + "x2iezn.4xlarge", + "x2iezn.6xlarge", + "x2iezn.8xlarge", + "x8g.12xlarge", + "x8g.16xlarge", + "x8g.24xlarge", + "x8g.2xlarge", + "x8g.48xlarge", + "x8g.4xlarge", + "x8g.8xlarge", + "x8g.large", + "x8g.medium", + "x8g.xlarge", + "z1d.12xlarge", + "z1d.2xlarge", + "z1d.3xlarge", + "z1d.6xlarge", + "z1d.large", + "z1d.xlarge", + ], + "signature_version": "2", + }, + "us-east-2": { + "api_name": "ec2_us_east_ohio", + "country": "USA", + "endpoint": "ec2.us-east-2.amazonaws.com", + "id": "us-east-2", + "instance_types": [ + "a1.2xlarge", + "a1.4xlarge", + "a1.large", + "a1.medium", + "a1.xlarge", + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5ad.12xlarge", + "c5ad.16xlarge", + "c5ad.24xlarge", + "c5ad.2xlarge", + "c5ad.4xlarge", + "c5ad.8xlarge", + "c5ad.large", + "c5ad.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6id.12xlarge", + "c6id.16xlarge", + "c6id.24xlarge", + "c6id.2xlarge", + "c6id.32xlarge", + "c6id.4xlarge", + "c6id.8xlarge", + "c6id.large", + "c6id.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7a.12xlarge", + "c7a.16xlarge", + "c7a.24xlarge", + "c7a.2xlarge", + "c7a.32xlarge", + "c7a.48xlarge", + "c7a.4xlarge", + "c7a.8xlarge", + "c7a.large", + "c7a.medium", + "c7a.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7gd.12xlarge", + "c7gd.16xlarge", + "c7gd.2xlarge", + "c7gd.4xlarge", + "c7gd.8xlarge", + "c7gd.large", + "c7gd.medium", + "c7gd.xlarge", + "c7gn.12xlarge", + "c7gn.16xlarge", + "c7gn.2xlarge", + "c7gn.4xlarge", + "c7gn.8xlarge", + "c7gn.large", + "c7gn.medium", + "c7gn.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "c8g.12xlarge", + "c8g.16xlarge", + "c8g.24xlarge", + "c8g.2xlarge", + "c8g.48xlarge", + "c8g.4xlarge", + "c8g.8xlarge", + "c8g.large", + "c8g.medium", + "c8g.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "d3.2xlarge", + "d3.4xlarge", + "d3.8xlarge", + "d3.xlarge", + "g3.16xlarge", + "g3.4xlarge", + "g3.8xlarge", + "g3s.xlarge", + "g4ad.16xlarge", + "g4ad.2xlarge", + "g4ad.4xlarge", + "g4ad.8xlarge", + "g4ad.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "g6e.12xlarge", + "g6e.16xlarge", + "g6e.24xlarge", + "g6e.2xlarge", + "g6e.48xlarge", + "g6e.4xlarge", + "g6e.8xlarge", + "g6e.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "h1.16xlarge", + "h1.2xlarge", + "h1.4xlarge", + "h1.8xlarge", + "hpc6a.48xlarge", + "hpc6id.32xlarge", + "hpc7a.12xlarge", + "hpc7a.24xlarge", + "hpc7a.48xlarge", + "hpc7a.96xlarge", + "i2.2xlarge", + "i2.4xlarge", + "i2.8xlarge", + "i2.large", + "i2.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4g.16xlarge", + "i4g.2xlarge", + "i4g.4xlarge", + "i4g.8xlarge", + "i4g.large", + "i4g.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "i7ie.12xlarge", + "i7ie.18xlarge", + "i7ie.24xlarge", + "i7ie.2xlarge", + "i7ie.3xlarge", + "i7ie.48xlarge", + "i7ie.6xlarge", + "i7ie.large", + "i7ie.xlarge", + "im4gn.16xlarge", + "im4gn.2xlarge", + "im4gn.4xlarge", + "im4gn.8xlarge", + "im4gn.large", + "im4gn.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "is4gen.2xlarge", + "is4gen.4xlarge", + "is4gen.8xlarge", + "is4gen.large", + "is4gen.medium", + "is4gen.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m5dn.12xlarge", + "m5dn.16xlarge", + "m5dn.24xlarge", + "m5dn.2xlarge", + "m5dn.4xlarge", + "m5dn.8xlarge", + "m5dn.large", + "m5dn.xlarge", + "m5n.12xlarge", + "m5n.16xlarge", + "m5n.24xlarge", + "m5n.2xlarge", + "m5n.4xlarge", + "m5n.8xlarge", + "m5n.large", + "m5n.xlarge", + "m5zn.12xlarge", + "m5zn.2xlarge", + "m5zn.3xlarge", + "m5zn.6xlarge", + "m5zn.large", + "m5zn.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m6idn.12xlarge", + "m6idn.16xlarge", + "m6idn.24xlarge", + "m6idn.2xlarge", + "m6idn.32xlarge", + "m6idn.4xlarge", + "m6idn.8xlarge", + "m6idn.large", + "m6idn.xlarge", + "m6in.12xlarge", + "m6in.16xlarge", + "m6in.24xlarge", + "m6in.2xlarge", + "m6in.32xlarge", + "m6in.4xlarge", + "m6in.8xlarge", + "m6in.large", + "m6in.xlarge", + "m7a.12xlarge", + "m7a.16xlarge", + "m7a.24xlarge", + "m7a.2xlarge", + "m7a.32xlarge", + "m7a.48xlarge", + "m7a.4xlarge", + "m7a.8xlarge", + "m7a.large", + "m7a.medium", + "m7a.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "m8g.12xlarge", + "m8g.16xlarge", + "m8g.24xlarge", + "m8g.2xlarge", + "m8g.48xlarge", + "m8g.4xlarge", + "m8g.8xlarge", + "m8g.large", + "m8g.medium", + "m8g.xlarge", + "p2.16xlarge", + "p2.8xlarge", + "p2.xlarge", + "p3.16xlarge", + "p3.2xlarge", + "p3.8xlarge", + "p4d.24xlarge", + "p5.48xlarge", + "p5e.48xlarge", + "p5en.48xlarge", + "r3.2xlarge", + "r3.4xlarge", + "r3.8xlarge", + "r3.large", + "r3.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5dn.12xlarge", + "r5dn.16xlarge", + "r5dn.24xlarge", + "r5dn.2xlarge", + "r5dn.4xlarge", + "r5dn.8xlarge", + "r5dn.large", + "r5dn.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6a.12xlarge", + "r6a.16xlarge", + "r6a.24xlarge", + "r6a.2xlarge", + "r6a.32xlarge", + "r6a.48xlarge", + "r6a.4xlarge", + "r6a.8xlarge", + "r6a.large", + "r6a.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r6id.12xlarge", + "r6id.16xlarge", + "r6id.24xlarge", + "r6id.2xlarge", + "r6id.32xlarge", + "r6id.4xlarge", + "r6id.8xlarge", + "r6id.large", + "r6id.xlarge", + "r6idn.12xlarge", + "r6idn.16xlarge", + "r6idn.24xlarge", + "r6idn.2xlarge", + "r6idn.32xlarge", + "r6idn.4xlarge", + "r6idn.8xlarge", + "r6idn.large", + "r6idn.xlarge", + "r6in.12xlarge", + "r6in.16xlarge", + "r6in.24xlarge", + "r6in.2xlarge", + "r6in.32xlarge", + "r6in.4xlarge", + "r6in.8xlarge", + "r6in.large", + "r6in.xlarge", + "r7a.12xlarge", + "r7a.16xlarge", + "r7a.24xlarge", + "r7a.2xlarge", + "r7a.32xlarge", + "r7a.48xlarge", + "r7a.4xlarge", + "r7a.8xlarge", + "r7a.large", + "r7a.medium", + "r7a.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7gd.12xlarge", + "r7gd.16xlarge", + "r7gd.2xlarge", + "r7gd.4xlarge", + "r7gd.8xlarge", + "r7gd.large", + "r7gd.medium", + "r7gd.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "r7iz.12xlarge", + "r7iz.16xlarge", + "r7iz.2xlarge", + "r7iz.32xlarge", + "r7iz.4xlarge", + "r7iz.8xlarge", + "r7iz.large", + "r7iz.xlarge", + "r8g.12xlarge", + "r8g.16xlarge", + "r8g.24xlarge", + "r8g.2xlarge", + "r8g.48xlarge", + "r8g.4xlarge", + "r8g.8xlarge", + "r8g.large", + "r8g.medium", + "r8g.xlarge", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "trn1.2xlarge", + "trn1.32xlarge", + "trn1n.32xlarge", + "trn2.48xlarge", + "u-12tb1.112xlarge", + "u-3tb1.56xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x1e.16xlarge", + "x1e.2xlarge", + "x1e.32xlarge", + "x1e.4xlarge", + "x1e.8xlarge", + "x1e.xlarge", + "x2gd.12xlarge", + "x2gd.16xlarge", + "x2gd.2xlarge", + "x2gd.4xlarge", + "x2gd.8xlarge", + "x2gd.large", + "x2gd.medium", + "x2gd.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + "z1d.12xlarge", + "z1d.2xlarge", + "z1d.3xlarge", + "z1d.6xlarge", + "z1d.large", + "z1d.xlarge", + ], + "signature_version": "4", + }, + "us-gov-west-1": { + "api_name": "ec2_us_govwest", + "country": "US", + "endpoint": "ec2.us-gov-west-1.amazonaws.com", + "id": "us-gov-west-1", + "instance_types": [], + "signature_version": "2", + }, + "us-west-1": { + "api_name": "ec2_us_west", + "country": "USA", + "endpoint": "ec2.us-west-1.amazonaws.com", + "id": "us-west-1", + "instance_types": [ + "c1.medium", + "c1.xlarge", + "c3.2xlarge", + "c3.4xlarge", + "c3.8xlarge", + "c3.large", + "c3.xlarge", + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7gd.12xlarge", + "c7gd.16xlarge", + "c7gd.2xlarge", + "c7gd.4xlarge", + "c7gd.8xlarge", + "c7gd.large", + "c7gd.medium", + "c7gd.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "g2.2xlarge", + "g2.8xlarge", + "g3.16xlarge", + "g3.4xlarge", + "g3.8xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "i2.2xlarge", + "i2.4xlarge", + "i2.8xlarge", + "i2.large", + "i2.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "m1.large", + "m1.medium", + "m1.small", + "m1.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "m2.xlarge", + "m3.2xlarge", + "m3.large", + "m3.medium", + "m3.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m5zn.12xlarge", + "m5zn.2xlarge", + "m5zn.3xlarge", + "m5zn.6xlarge", + "m5zn.large", + "m5zn.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6idn.12xlarge", + "m6idn.16xlarge", + "m6idn.24xlarge", + "m6idn.2xlarge", + "m6idn.32xlarge", + "m6idn.4xlarge", + "m6idn.8xlarge", + "m6idn.large", + "m6idn.xlarge", + "m6in.12xlarge", + "m6in.16xlarge", + "m6in.24xlarge", + "m6in.2xlarge", + "m6in.32xlarge", + "m6in.4xlarge", + "m6in.8xlarge", + "m6in.large", + "m6in.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "p5.48xlarge", + "r3.2xlarge", + "r3.4xlarge", + "r3.8xlarge", + "r3.large", + "r3.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6a.12xlarge", + "r6a.16xlarge", + "r6a.24xlarge", + "r6a.2xlarge", + "r6a.32xlarge", + "r6a.48xlarge", + "r6a.4xlarge", + "r6a.8xlarge", + "r6a.large", + "r6a.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7gd.12xlarge", + "r7gd.16xlarge", + "r7gd.2xlarge", + "r7gd.4xlarge", + "r7gd.8xlarge", + "r7gd.large", + "r7gd.medium", + "r7gd.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "t1.micro", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + "z1d.12xlarge", + "z1d.2xlarge", + "z1d.3xlarge", + "z1d.6xlarge", + "z1d.large", + "z1d.xlarge", + ], + "signature_version": "2", + }, + "us-west-2": { + "api_name": "ec2_us_west_oregon", + "country": "US", + "endpoint": "ec2.us-west-2.amazonaws.com", + "id": "us-west-2", + "instance_types": [ + "a1.2xlarge", + "a1.4xlarge", + "a1.large", + "a1.medium", + "a1.xlarge", + "c1.medium", + "c1.xlarge", + "c3.2xlarge", + "c3.4xlarge", + "c3.8xlarge", + "c3.large", + "c3.xlarge", + "c4.2xlarge", + "c4.4xlarge", + "c4.8xlarge", + "c4.large", + "c4.xlarge", + "c5.12xlarge", + "c5.18xlarge", + "c5.24xlarge", + "c5.2xlarge", + "c5.4xlarge", + "c5.9xlarge", + "c5.large", + "c5.xlarge", + "c5a.12xlarge", + "c5a.16xlarge", + "c5a.24xlarge", + "c5a.2xlarge", + "c5a.4xlarge", + "c5a.8xlarge", + "c5a.large", + "c5a.xlarge", + "c5ad.12xlarge", + "c5ad.16xlarge", + "c5ad.24xlarge", + "c5ad.2xlarge", + "c5ad.4xlarge", + "c5ad.8xlarge", + "c5ad.large", + "c5ad.xlarge", + "c5d.12xlarge", + "c5d.18xlarge", + "c5d.24xlarge", + "c5d.2xlarge", + "c5d.4xlarge", + "c5d.9xlarge", + "c5d.large", + "c5d.xlarge", + "c5n.18xlarge", + "c5n.2xlarge", + "c5n.4xlarge", + "c5n.9xlarge", + "c5n.large", + "c5n.xlarge", + "c6a.12xlarge", + "c6a.16xlarge", + "c6a.24xlarge", + "c6a.2xlarge", + "c6a.32xlarge", + "c6a.48xlarge", + "c6a.4xlarge", + "c6a.8xlarge", + "c6a.large", + "c6a.xlarge", + "c6g.12xlarge", + "c6g.16xlarge", + "c6g.2xlarge", + "c6g.4xlarge", + "c6g.8xlarge", + "c6g.large", + "c6g.medium", + "c6g.xlarge", + "c6gd.12xlarge", + "c6gd.16xlarge", + "c6gd.2xlarge", + "c6gd.4xlarge", + "c6gd.8xlarge", + "c6gd.large", + "c6gd.medium", + "c6gd.xlarge", + "c6gn.12xlarge", + "c6gn.16xlarge", + "c6gn.2xlarge", + "c6gn.4xlarge", + "c6gn.8xlarge", + "c6gn.large", + "c6gn.medium", + "c6gn.xlarge", + "c6i.12xlarge", + "c6i.16xlarge", + "c6i.24xlarge", + "c6i.2xlarge", + "c6i.32xlarge", + "c6i.4xlarge", + "c6i.8xlarge", + "c6i.large", + "c6i.xlarge", + "c6id.12xlarge", + "c6id.16xlarge", + "c6id.24xlarge", + "c6id.2xlarge", + "c6id.32xlarge", + "c6id.4xlarge", + "c6id.8xlarge", + "c6id.large", + "c6id.xlarge", + "c6in.12xlarge", + "c6in.16xlarge", + "c6in.24xlarge", + "c6in.2xlarge", + "c6in.32xlarge", + "c6in.4xlarge", + "c6in.8xlarge", + "c6in.large", + "c6in.xlarge", + "c7a.12xlarge", + "c7a.16xlarge", + "c7a.24xlarge", + "c7a.2xlarge", + "c7a.32xlarge", + "c7a.48xlarge", + "c7a.4xlarge", + "c7a.8xlarge", + "c7a.large", + "c7a.medium", + "c7a.xlarge", + "c7g.12xlarge", + "c7g.16xlarge", + "c7g.2xlarge", + "c7g.4xlarge", + "c7g.8xlarge", + "c7g.large", + "c7g.medium", + "c7g.xlarge", + "c7gd.12xlarge", + "c7gd.16xlarge", + "c7gd.2xlarge", + "c7gd.4xlarge", + "c7gd.8xlarge", + "c7gd.large", + "c7gd.medium", + "c7gd.xlarge", + "c7gn.12xlarge", + "c7gn.16xlarge", + "c7gn.2xlarge", + "c7gn.4xlarge", + "c7gn.8xlarge", + "c7gn.large", + "c7gn.medium", + "c7gn.xlarge", + "c7i-flex.12xlarge", + "c7i-flex.16xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i.12xlarge", + "c7i.16xlarge", + "c7i.24xlarge", + "c7i.2xlarge", + "c7i.48xlarge", + "c7i.4xlarge", + "c7i.8xlarge", + "c7i.large", + "c7i.xlarge", + "c8g.12xlarge", + "c8g.16xlarge", + "c8g.24xlarge", + "c8g.2xlarge", + "c8g.48xlarge", + "c8g.4xlarge", + "c8g.8xlarge", + "c8g.large", + "c8g.medium", + "c8g.xlarge", + "cc2.8xlarge", + "cr1.8xlarge", + "d2.2xlarge", + "d2.4xlarge", + "d2.8xlarge", + "d2.xlarge", + "d3.2xlarge", + "d3.4xlarge", + "d3.8xlarge", + "d3.xlarge", + "d3en.12xlarge", + "d3en.2xlarge", + "d3en.4xlarge", + "d3en.6xlarge", + "d3en.8xlarge", + "d3en.xlarge", + "dl1.24xlarge", + "dl2q.24xlarge", + "f1.16xlarge", + "f1.2xlarge", + "f1.4xlarge", + "f2.12xlarge", + "f2.48xlarge", + "f2.6xlarge", + "g2.2xlarge", + "g2.8xlarge", + "g3.16xlarge", + "g3.4xlarge", + "g3.8xlarge", + "g3s.xlarge", + "g4ad.16xlarge", + "g4ad.2xlarge", + "g4ad.4xlarge", + "g4ad.8xlarge", + "g4ad.xlarge", + "g4dn.12xlarge", + "g4dn.16xlarge", + "g4dn.2xlarge", + "g4dn.4xlarge", + "g4dn.8xlarge", + "g4dn.xlarge", + "g5.12xlarge", + "g5.16xlarge", + "g5.24xlarge", + "g5.2xlarge", + "g5.48xlarge", + "g5.4xlarge", + "g5.8xlarge", + "g5.xlarge", + "g5g.16xlarge", + "g5g.2xlarge", + "g5g.4xlarge", + "g5g.8xlarge", + "g5g.xlarge", + "g6.12xlarge", + "g6.16xlarge", + "g6.24xlarge", + "g6.2xlarge", + "g6.48xlarge", + "g6.4xlarge", + "g6.8xlarge", + "g6.xlarge", + "g6e.12xlarge", + "g6e.16xlarge", + "g6e.24xlarge", + "g6e.2xlarge", + "g6e.48xlarge", + "g6e.4xlarge", + "g6e.8xlarge", + "g6e.xlarge", + "gr6.4xlarge", + "gr6.8xlarge", + "h1.16xlarge", + "h1.2xlarge", + "h1.4xlarge", + "h1.8xlarge", + "hs1.8xlarge", + "i2.2xlarge", + "i2.4xlarge", + "i2.8xlarge", + "i2.large", + "i2.xlarge", + "i3.16xlarge", + "i3.2xlarge", + "i3.4xlarge", + "i3.8xlarge", + "i3.large", + "i3.xlarge", + "i3en.12xlarge", + "i3en.24xlarge", + "i3en.2xlarge", + "i3en.3xlarge", + "i3en.6xlarge", + "i3en.large", + "i3en.xlarge", + "i4g.16xlarge", + "i4g.2xlarge", + "i4g.4xlarge", + "i4g.8xlarge", + "i4g.large", + "i4g.xlarge", + "i4i.12xlarge", + "i4i.16xlarge", + "i4i.24xlarge", + "i4i.2xlarge", + "i4i.32xlarge", + "i4i.4xlarge", + "i4i.8xlarge", + "i4i.large", + "i4i.xlarge", + "i7ie.12xlarge", + "i7ie.18xlarge", + "i7ie.24xlarge", + "i7ie.2xlarge", + "i7ie.3xlarge", + "i7ie.48xlarge", + "i7ie.6xlarge", + "i7ie.large", + "i7ie.xlarge", + "i8g.12xlarge", + "i8g.16xlarge", + "i8g.24xlarge", + "i8g.2xlarge", + "i8g.4xlarge", + "i8g.8xlarge", + "i8g.large", + "i8g.xlarge", + "im4gn.16xlarge", + "im4gn.2xlarge", + "im4gn.4xlarge", + "im4gn.8xlarge", + "im4gn.large", + "im4gn.xlarge", + "inf1.24xlarge", + "inf1.2xlarge", + "inf1.6xlarge", + "inf1.xlarge", + "inf2.24xlarge", + "inf2.48xlarge", + "inf2.8xlarge", + "inf2.xlarge", + "is4gen.2xlarge", + "is4gen.4xlarge", + "is4gen.8xlarge", + "is4gen.large", + "is4gen.medium", + "is4gen.xlarge", + "m1.large", + "m1.medium", + "m1.small", + "m1.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "m2.xlarge", + "m3.2xlarge", + "m3.large", + "m3.medium", + "m3.xlarge", + "m4.10xlarge", + "m4.16xlarge", + "m4.2xlarge", + "m4.4xlarge", + "m4.large", + "m4.xlarge", + "m5.12xlarge", + "m5.16xlarge", + "m5.24xlarge", + "m5.2xlarge", + "m5.4xlarge", + "m5.8xlarge", + "m5.large", + "m5.xlarge", + "m5a.12xlarge", + "m5a.16xlarge", + "m5a.24xlarge", + "m5a.2xlarge", + "m5a.4xlarge", + "m5a.8xlarge", + "m5a.large", + "m5a.xlarge", + "m5ad.12xlarge", + "m5ad.16xlarge", + "m5ad.24xlarge", + "m5ad.2xlarge", + "m5ad.4xlarge", + "m5ad.8xlarge", + "m5ad.large", + "m5ad.xlarge", + "m5d.12xlarge", + "m5d.16xlarge", + "m5d.24xlarge", + "m5d.2xlarge", + "m5d.4xlarge", + "m5d.8xlarge", + "m5d.large", + "m5d.xlarge", + "m5dn.12xlarge", + "m5dn.16xlarge", + "m5dn.24xlarge", + "m5dn.2xlarge", + "m5dn.4xlarge", + "m5dn.8xlarge", + "m5dn.large", + "m5dn.xlarge", + "m5n.12xlarge", + "m5n.16xlarge", + "m5n.24xlarge", + "m5n.2xlarge", + "m5n.4xlarge", + "m5n.8xlarge", + "m5n.large", + "m5n.xlarge", + "m5zn.12xlarge", + "m5zn.2xlarge", + "m5zn.3xlarge", + "m5zn.6xlarge", + "m5zn.large", + "m5zn.xlarge", + "m6a.12xlarge", + "m6a.16xlarge", + "m6a.24xlarge", + "m6a.2xlarge", + "m6a.32xlarge", + "m6a.48xlarge", + "m6a.4xlarge", + "m6a.8xlarge", + "m6a.large", + "m6a.xlarge", + "m6g.12xlarge", + "m6g.16xlarge", + "m6g.2xlarge", + "m6g.4xlarge", + "m6g.8xlarge", + "m6g.large", + "m6g.medium", + "m6g.xlarge", + "m6gd.12xlarge", + "m6gd.16xlarge", + "m6gd.2xlarge", + "m6gd.4xlarge", + "m6gd.8xlarge", + "m6gd.large", + "m6gd.medium", + "m6gd.xlarge", + "m6i.12xlarge", + "m6i.16xlarge", + "m6i.24xlarge", + "m6i.2xlarge", + "m6i.32xlarge", + "m6i.4xlarge", + "m6i.8xlarge", + "m6i.large", + "m6i.xlarge", + "m6id.12xlarge", + "m6id.16xlarge", + "m6id.24xlarge", + "m6id.2xlarge", + "m6id.32xlarge", + "m6id.4xlarge", + "m6id.8xlarge", + "m6id.large", + "m6id.xlarge", + "m6idn.12xlarge", + "m6idn.16xlarge", + "m6idn.24xlarge", + "m6idn.2xlarge", + "m6idn.32xlarge", + "m6idn.4xlarge", + "m6idn.8xlarge", + "m6idn.large", + "m6idn.xlarge", + "m6in.12xlarge", + "m6in.16xlarge", + "m6in.24xlarge", + "m6in.2xlarge", + "m6in.32xlarge", + "m6in.4xlarge", + "m6in.8xlarge", + "m6in.large", + "m6in.xlarge", + "m7a.12xlarge", + "m7a.16xlarge", + "m7a.24xlarge", + "m7a.2xlarge", + "m7a.32xlarge", + "m7a.48xlarge", + "m7a.4xlarge", + "m7a.8xlarge", + "m7a.large", + "m7a.medium", + "m7a.xlarge", + "m7g.12xlarge", + "m7g.16xlarge", + "m7g.2xlarge", + "m7g.4xlarge", + "m7g.8xlarge", + "m7g.large", + "m7g.medium", + "m7g.xlarge", + "m7gd.12xlarge", + "m7gd.16xlarge", + "m7gd.2xlarge", + "m7gd.4xlarge", + "m7gd.8xlarge", + "m7gd.large", + "m7gd.medium", + "m7gd.xlarge", + "m7i-flex.12xlarge", + "m7i-flex.16xlarge", + "m7i-flex.2xlarge", + "m7i-flex.4xlarge", + "m7i-flex.8xlarge", + "m7i-flex.large", + "m7i-flex.xlarge", + "m7i.12xlarge", + "m7i.16xlarge", + "m7i.24xlarge", + "m7i.2xlarge", + "m7i.48xlarge", + "m7i.4xlarge", + "m7i.8xlarge", + "m7i.large", + "m7i.xlarge", + "m8g.12xlarge", + "m8g.16xlarge", + "m8g.24xlarge", + "m8g.2xlarge", + "m8g.48xlarge", + "m8g.4xlarge", + "m8g.8xlarge", + "m8g.large", + "m8g.medium", + "m8g.xlarge", + "p2.16xlarge", + "p2.8xlarge", + "p2.xlarge", + "p3.16xlarge", + "p3.2xlarge", + "p3.8xlarge", + "p3dn.24xlarge", + "p4d.24xlarge", + "p4de.24xlarge", + "p5.48xlarge", + "p5en.48xlarge", + "r3.2xlarge", + "r3.4xlarge", + "r3.8xlarge", + "r3.large", + "r3.xlarge", + "r4.16xlarge", + "r4.2xlarge", + "r4.4xlarge", + "r4.8xlarge", + "r4.large", + "r4.xlarge", + "r5.12xlarge", + "r5.16xlarge", + "r5.24xlarge", + "r5.2xlarge", + "r5.4xlarge", + "r5.8xlarge", + "r5.large", + "r5.xlarge", + "r5a.12xlarge", + "r5a.16xlarge", + "r5a.24xlarge", + "r5a.2xlarge", + "r5a.4xlarge", + "r5a.8xlarge", + "r5a.large", + "r5a.xlarge", + "r5ad.12xlarge", + "r5ad.16xlarge", + "r5ad.24xlarge", + "r5ad.2xlarge", + "r5ad.4xlarge", + "r5ad.8xlarge", + "r5ad.large", + "r5ad.xlarge", + "r5b.12xlarge", + "r5b.16xlarge", + "r5b.24xlarge", + "r5b.2xlarge", + "r5b.4xlarge", + "r5b.8xlarge", + "r5b.large", + "r5b.xlarge", + "r5d.12xlarge", + "r5d.16xlarge", + "r5d.24xlarge", + "r5d.2xlarge", + "r5d.4xlarge", + "r5d.8xlarge", + "r5d.large", + "r5d.xlarge", + "r5dn.12xlarge", + "r5dn.16xlarge", + "r5dn.24xlarge", + "r5dn.2xlarge", + "r5dn.4xlarge", + "r5dn.8xlarge", + "r5dn.large", + "r5dn.xlarge", + "r5n.12xlarge", + "r5n.16xlarge", + "r5n.24xlarge", + "r5n.2xlarge", + "r5n.4xlarge", + "r5n.8xlarge", + "r5n.large", + "r5n.xlarge", + "r6a.12xlarge", + "r6a.16xlarge", + "r6a.24xlarge", + "r6a.2xlarge", + "r6a.32xlarge", + "r6a.48xlarge", + "r6a.4xlarge", + "r6a.8xlarge", + "r6a.large", + "r6a.xlarge", + "r6g.12xlarge", + "r6g.16xlarge", + "r6g.2xlarge", + "r6g.4xlarge", + "r6g.8xlarge", + "r6g.large", + "r6g.medium", + "r6g.xlarge", + "r6gd.12xlarge", + "r6gd.16xlarge", + "r6gd.2xlarge", + "r6gd.4xlarge", + "r6gd.8xlarge", + "r6gd.large", + "r6gd.medium", + "r6gd.xlarge", + "r6i.12xlarge", + "r6i.16xlarge", + "r6i.24xlarge", + "r6i.2xlarge", + "r6i.32xlarge", + "r6i.4xlarge", + "r6i.8xlarge", + "r6i.large", + "r6i.xlarge", + "r6id.12xlarge", + "r6id.16xlarge", + "r6id.24xlarge", + "r6id.2xlarge", + "r6id.32xlarge", + "r6id.4xlarge", + "r6id.8xlarge", + "r6id.large", + "r6id.xlarge", + "r6idn.12xlarge", + "r6idn.16xlarge", + "r6idn.24xlarge", + "r6idn.2xlarge", + "r6idn.32xlarge", + "r6idn.4xlarge", + "r6idn.8xlarge", + "r6idn.large", + "r6idn.xlarge", + "r6in.12xlarge", + "r6in.16xlarge", + "r6in.24xlarge", + "r6in.2xlarge", + "r6in.32xlarge", + "r6in.4xlarge", + "r6in.8xlarge", + "r6in.large", + "r6in.xlarge", + "r7a.12xlarge", + "r7a.16xlarge", + "r7a.24xlarge", + "r7a.2xlarge", + "r7a.32xlarge", + "r7a.48xlarge", + "r7a.4xlarge", + "r7a.8xlarge", + "r7a.large", + "r7a.medium", + "r7a.xlarge", + "r7g.12xlarge", + "r7g.16xlarge", + "r7g.2xlarge", + "r7g.4xlarge", + "r7g.8xlarge", + "r7g.large", + "r7g.medium", + "r7g.xlarge", + "r7gd.12xlarge", + "r7gd.16xlarge", + "r7gd.2xlarge", + "r7gd.4xlarge", + "r7gd.8xlarge", + "r7gd.large", + "r7gd.medium", + "r7gd.xlarge", + "r7i.12xlarge", + "r7i.16xlarge", + "r7i.24xlarge", + "r7i.2xlarge", + "r7i.48xlarge", + "r7i.4xlarge", + "r7i.8xlarge", + "r7i.large", + "r7i.xlarge", + "r7iz.12xlarge", + "r7iz.16xlarge", + "r7iz.2xlarge", + "r7iz.32xlarge", + "r7iz.4xlarge", + "r7iz.8xlarge", + "r7iz.large", + "r7iz.xlarge", + "r8g.12xlarge", + "r8g.16xlarge", + "r8g.24xlarge", + "r8g.2xlarge", + "r8g.48xlarge", + "r8g.4xlarge", + "r8g.8xlarge", + "r8g.large", + "r8g.medium", + "r8g.xlarge", + "t1.micro", + "t2.2xlarge", + "t2.large", + "t2.medium", + "t2.micro", + "t2.nano", + "t2.small", + "t2.xlarge", + "t3.2xlarge", + "t3.large", + "t3.medium", + "t3.micro", + "t3.nano", + "t3.small", + "t3.xlarge", + "t3a.2xlarge", + "t3a.large", + "t3a.medium", + "t3a.micro", + "t3a.nano", + "t3a.small", + "t3a.xlarge", + "t4g.2xlarge", + "t4g.large", + "t4g.medium", + "t4g.micro", + "t4g.nano", + "t4g.small", + "t4g.xlarge", + "trn1.2xlarge", + "trn1.32xlarge", + "trn1n.32xlarge", + "u-12tb1.112xlarge", + "u-18tb1.112xlarge", + "u-24tb1.112xlarge", + "u-3tb1.56xlarge", + "u-6tb1.112xlarge", + "u-6tb1.56xlarge", + "u-9tb1.112xlarge", + "u7i-12tb.224xlarge", + "u7i-6tb.112xlarge", + "u7in-16tb.224xlarge", + "u7in-24tb.224xlarge", + "u7in-32tb.224xlarge", + "vt1.24xlarge", + "vt1.3xlarge", + "vt1.6xlarge", + "x1.16xlarge", + "x1.32xlarge", + "x1e.16xlarge", + "x1e.2xlarge", + "x1e.32xlarge", + "x1e.4xlarge", + "x1e.8xlarge", + "x1e.xlarge", + "x2gd.12xlarge", + "x2gd.16xlarge", + "x2gd.2xlarge", + "x2gd.4xlarge", + "x2gd.8xlarge", + "x2gd.large", + "x2gd.medium", + "x2gd.xlarge", + "x2idn.16xlarge", + "x2idn.24xlarge", + "x2idn.32xlarge", + "x2iedn.16xlarge", + "x2iedn.24xlarge", + "x2iedn.2xlarge", + "x2iedn.32xlarge", + "x2iedn.4xlarge", + "x2iedn.8xlarge", + "x2iedn.xlarge", + "x2iezn.12xlarge", + "x2iezn.2xlarge", + "x2iezn.4xlarge", + "x2iezn.6xlarge", + "x2iezn.8xlarge", + "x8g.12xlarge", + "x8g.16xlarge", + "x8g.24xlarge", + "x8g.2xlarge", + "x8g.48xlarge", + "x8g.4xlarge", + "x8g.8xlarge", + "x8g.large", + "x8g.medium", + "x8g.xlarge", + "z1d.12xlarge", + "z1d.2xlarge", + "z1d.3xlarge", + "z1d.6xlarge", + "z1d.large", + "z1d.xlarge", + ], + "signature_version": "2", + }, +} diff --git a/libcloud/compute/constants/ec2_region_details_partial.py b/libcloud/compute/constants/ec2_region_details_partial.py new file mode 100644 index 0000000000..f4728e72e2 --- /dev/null +++ b/libcloud/compute/constants/ec2_region_details_partial.py @@ -0,0 +1,179 @@ +# File generated by contrib/scrape-ec2-sizes.py script - DO NOT EDIT manually +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +REGION_DETAILS = { + "af-south-1": { + "api_name": "ec2_af_south", + "country": "South Africa", + "endpoint": "ec2.af-south-1.amazonaws.com", + "id": "af-south-1", + "signature_version": "4", + }, + "ap-east-1": { + "api_name": "ec2_ap_east", + "country": "Hong Kong", + "endpoint": "ec2.ap-east-1.amazonaws.com", + "id": "ap-east-1", + "signature_version": "2", + }, + "ap-northeast-1": { + "api_name": "ec2_ap_northeast", + "country": "Japan", + "endpoint": "ec2.ap-northeast-1.amazonaws.com", + "id": "ap-northeast-1", + "signature_version": "2", + }, + "ap-northeast-2": { + "api_name": "ec2_ap_northeast", + "country": "South Korea", + "endpoint": "ec2.ap-northeast-2.amazonaws.com", + "id": "ap-northeast-2", + "signature_version": "4", + }, + "ap-northeast-3": { + "api_name": "ec2_ap_northeast", + "country": "Japan", + "endpoint": "ec2.ap-northeast-3.amazonaws.com", + "id": "ap-northeast-3", + "signature_version": "4", + }, + "ap-south-1": { + "api_name": "ec2_ap_south_1", + "country": "India", + "endpoint": "ec2.ap-south-1.amazonaws.com", + "id": "ap-south-1", + "signature_version": "4", + }, + "ap-southeast-1": { + "api_name": "ec2_ap_southeast", + "country": "Singapore", + "endpoint": "ec2.ap-southeast-1.amazonaws.com", + "id": "ap-southeast-1", + "signature_version": "2", + }, + "ap-southeast-2": { + "api_name": "ec2_ap_southeast_2", + "country": "Australia", + "endpoint": "ec2.ap-southeast-2.amazonaws.com", + "id": "ap-southeast-2", + "signature_version": "2", + }, + "ca-central-1": { + "api_name": "ec2_ca_central_1", + "country": "Canada", + "endpoint": "ec2.ca-central-1.amazonaws.com", + "id": "ca-central-1", + "signature_version": "4", + }, + "cn-north-1": { + "api_name": "ec2_cn_north", + "country": "China", + "endpoint": "ec2.cn-north-1.amazonaws.com.cn", + "id": "cn-north-1", + "signature_version": "4", + }, + "cn-northwest-1": { + "api_name": "ec2_cn_northwest", + "country": "China", + "endpoint": "ec2.cn-northwest-1.amazonaws.com.cn", + "id": "cn-northwest-1", + "signature_version": "4", + }, + "eu-central-1": { + "api_name": "ec2_eu_central", + "country": "Frankfurt", + "endpoint": "ec2.eu-central-1.amazonaws.com", + "id": "eu-central-1", + "signature_version": "4", + }, + "eu-north-1": { + "api_name": "ec2_eu_north_stockholm", + "country": "Stockholm", + "endpoint": "ec2.eu-north-1.amazonaws.com", + "id": "eu-north-1", + "signature_version": "4", + }, + "eu-south-1": { + "api_name": "ec2_eu_south", + "country": "Italy", + "endpoint": "ec2.eu-south-1.amazonaws.com", + "id": "eu-south-1", + "signature_version": "4", + }, + "eu-west-1": { + "api_name": "ec2_eu_west", + "country": "Ireland", + "endpoint": "ec2.eu-west-1.amazonaws.com", + "id": "eu-west-1", + "signature_version": "2", + }, + "eu-west-2": { + "api_name": "ec2_eu_west_london", + "country": "United Kingdom", + "endpoint": "ec2.eu-west-2.amazonaws.com", + "id": "eu-west-2", + "signature_version": "4", + }, + "eu-west-3": { + "api_name": "ec2_eu_west_paris", + "country": "France", + "endpoint": "ec2.eu-west-3.amazonaws.com", + "id": "eu-west-3", + "signature_version": "4", + }, + "sa-east-1": { + "api_name": "ec2_sa_east", + "country": "Brazil", + "endpoint": "ec2.sa-east-1.amazonaws.com", + "id": "sa-east-1", + "signature_version": "2", + }, + "us-east-1": { + "api_name": "ec2_us_east", + "country": "USA", + "endpoint": "ec2.us-east-1.amazonaws.com", + "id": "us-east-1", + "signature_version": "2", + }, + "us-east-2": { + "api_name": "ec2_us_east_ohio", + "country": "USA", + "endpoint": "ec2.us-east-2.amazonaws.com", + "id": "us-east-2", + "signature_version": "4", + }, + "us-gov-west-1": { + "api_name": "ec2_us_govwest", + "country": "US", + "endpoint": "ec2.us-gov-west-1.amazonaws.com", + "id": "us-gov-west-1", + "signature_version": "2", + }, + "us-west-1": { + "api_name": "ec2_us_west", + "country": "USA", + "endpoint": "ec2.us-west-1.amazonaws.com", + "id": "us-west-1", + "signature_version": "2", + }, + "us-west-2": { + "api_name": "ec2_us_west_oregon", + "country": "US", + "endpoint": "ec2.us-west-2.amazonaws.com", + "id": "us-west-2", + "signature_version": "2", + }, +} diff --git a/libcloud/compute/deployment.py b/libcloud/compute/deployment.py index 018c5f86dc..8ba63a3dcf 100644 --- a/libcloud/compute/deployment.py +++ b/libcloud/compute/deployment.py @@ -17,20 +17,23 @@ Provides generic deployment steps for machines post boot. """ -from __future__ import with_statement - import os +import re import binascii +from typing import IO, List, Union, Optional, cast -from libcloud.utils.py3 import basestring, PY3 +from libcloud.utils.py3 import basestring +from libcloud.compute.ssh import BaseSSHClient +from libcloud.compute.base import Node -class Deployment(object): +class Deployment: """ Base class for deployment tasks. """ def run(self, node, client): + # type: (Node, BaseSSHClient) -> Node """ Runs this deployment task on node using the client provided. @@ -42,16 +45,15 @@ def run(self, node, client): :return: :class:`Node` """ - raise NotImplementedError( - 'run not implemented for this deployment') + raise NotImplementedError("run not implemented for this deployment") def _get_string_value(self, argument_name, argument_value): - if not isinstance(argument_value, basestring) and \ - not hasattr(argument_value, 'read'): - raise TypeError('%s argument must be a string or a file-like ' - 'object' % (argument_name)) + if not isinstance(argument_value, basestring) and not hasattr(argument_value, "read"): + raise TypeError( + "%s argument must be a string or a file-like " "object" % (argument_name) + ) - if hasattr(argument_value, 'read'): + if hasattr(argument_value, "read"): argument_value = argument_value.read() return argument_value @@ -63,23 +65,31 @@ class SSHKeyDeployment(Deployment): """ def __init__(self, key): + # type: (Union[str, IO]) -> None """ :type key: ``str`` or :class:`File` object :keyword key: Contents of the public key write or a file object which can be read. """ - self.key = self._get_string_value(argument_name='key', - argument_value=key) + self.key = self._get_string_value(argument_name="key", argument_value=key) def run(self, node, client): + # type: (Node, BaseSSHClient) -> Node """ Installs SSH key into ``.ssh/authorized_keys`` See also :class:`Deployment.run` """ - client.put(".ssh/authorized_keys", contents=self.key, mode='a') + client.put(".ssh/authorized_keys", contents=self.key, mode="a") return node + def __str__(self): + return self.__repr__() + + def __repr__(self): + key = self.key[:100] + return "" % (key) + class FileDeployment(Deployment): """ @@ -87,6 +97,7 @@ class FileDeployment(Deployment): """ def __init__(self, source, target): + # type: (str, str) -> None """ :type source: ``str`` :keyword source: Local path of file to be installed @@ -98,6 +109,7 @@ def __init__(self, source, target): self.target = target def run(self, node, client): + # type: (Node, BaseSSHClient) -> Node """ Upload the file, retaining permissions. @@ -105,27 +117,38 @@ def run(self, node, client): """ perms = int(oct(os.stat(self.source).st_mode)[4:], 8) - with open(self.source, 'rb') as fp: - content = fp.read() - - client.put(path=self.target, chmod=perms, - contents=content) + with open(self.source, "rb") as fp: + client.putfo(path=self.target, chmod=perms, fo=fp) return node + def __str__(self): + return self.__repr__() + + def __repr__(self): + return "".format(self.source, self.target) + class ScriptDeployment(Deployment): """ Runs an arbitrary shell script on the server. This step works by first writing the content of the shell script (script - argument) in a \*.sh file on a remote server and then running that file. + argument) in a *.sh file on a remote server and then running that file. If you are running a non-shell script, make sure to put the appropriate shebang to the top of the script. You are also advised to do that even if you are running a plan shell script. """ - def __init__(self, script, args=None, name=None, delete=False): + def __init__( + self, + script, # type: str + args=None, # type: Optional[List[str]] + name=None, # type: Optional[str] + delete=False, # type bool + timeout=None, # type: Optional[float] + ): + # type: (...) -> None """ :type script: ``str`` :keyword script: Contents of the script to run. @@ -140,56 +163,86 @@ def __init__(self, script, args=None, name=None, delete=False): :type delete: ``bool`` :keyword delete: Whether to delete the script on completion. + + :param timeout: Optional run timeout for this command. + :type timeout: ``float`` """ - script = self._get_string_value(argument_name='script', - argument_value=script) + script = self._get_string_value(argument_name="script", argument_value=script) self.script = script self.args = args or [] - self.stdout = None - self.stderr = None - self.exit_status = None + self.stdout = None # type: Optional[str] + self.stderr = None # type: Optional[str] + self.exit_status = None # type: Optional[int] self.delete = delete - self.name = name + self.timeout = timeout + self.name = name # type: Optional[str] if self.name is None: # File is put under user's home directory # (~/libcloud_deployment_.sh) + random_string = "" # type: Union[str, bytes] random_string = binascii.hexlify(os.urandom(4)) - random_string = random_string.decode('ascii') - self.name = 'libcloud_deployment_%s.sh' % (random_string) + random_string = cast(bytes, random_string) + random_string = random_string.decode("ascii") + self.name = "libcloud_deployment_%s.sh" % (random_string) def run(self, node, client): + # type: (Node, BaseSSHClient) -> Node """ Uploads the shell script and then executes it. See also :class:`Deployment.run` """ - file_path = client.put(path=self.name, chmod=int('755', 8), - contents=self.script) - - # Pre-pend cwd if user specified a relative path - if self.name[0] != '/': + self.name = cast(str, self.name) + file_path = client.put(path=self.name, chmod=int("755", 8), contents=self.script) + # Prepend cwd if user specified a relative path + if self.name and (self.name[0] not in ["/", "\\"] and not re.match(r"^\w\:.*$", file_path)): base_path = os.path.dirname(file_path) name = os.path.join(base_path, self.name) + elif self.name and (self.name[0] == "\\" or re.match(r"^\w\:.*$", file_path)): + # Absolute Windows path + name = file_path else: + self.name = cast(str, self.name) name = self.name cmd = name if self.args: # Append arguments to the command - cmd = '%s %s' % (name, ' '.join(self.args)) + cmd = "{} {}".format(name, " ".join(self.args)) else: cmd = name - self.stdout, self.stderr, self.exit_status = client.run(cmd) + self.stdout, self.stderr, self.exit_status = client.run(cmd, timeout=self.timeout) if self.delete: client.delete(self.name) return node + def __str__(self): + return self.__repr__() + + def __repr__(self): + script = self.script[:15] + "..." + exit_status = self.exit_status + + if exit_status is not None: + stdout = self.stdout[:30] + "..." + stderr = self.stderr[:30] + "..." + else: + exit_status = "script didn't run yet" + stdout = None + stderr = None + return "" % ( + script, + exit_status, + stdout, + stderr, + ) + class ScriptFileDeployment(ScriptDeployment): """ @@ -198,7 +251,15 @@ class ScriptFileDeployment(ScriptDeployment): the script content. """ - def __init__(self, script_file, args=None, name=None, delete=False): + def __init__( + self, + script_file, # type: str + args=None, # type: Optional[List[str]] + name=None, # type: Optional[str] + delete=False, # type bool + timeout=None, # type: Optional[float] + ): + # type: (...) -> None """ :type script_file: ``str`` :keyword script_file: Path to a file containing the script to run. @@ -214,45 +275,51 @@ def __init__(self, script_file, args=None, name=None, delete=False): :type delete: ``bool`` :keyword delete: Whether to delete the script on completion. + + :param timeout: Optional run timeout for this command. + :type timeout: ``float`` """ - with open(script_file, 'rb') as fp: - content = fp.read() + with open(script_file, "rb") as fp: + content = fp.read() # type: Union[bytes, str] - if PY3: - content = content.decode('utf-8') + content = cast(bytes, content) + content = content.decode("utf-8") - super(ScriptFileDeployment, self).__init__(script=content, - args=args, - name=name, - delete=delete) + super().__init__(script=content, args=args, name=name, delete=delete, timeout=timeout) class MultiStepDeployment(Deployment): """ Runs a chain of Deployment steps. """ + def __init__(self, add=None): + # type: (Optional[Union[Deployment, List[Deployment]]]) -> None """ :type add: ``list`` :keyword add: Deployment steps to add. """ - self.steps = [] - self.add(add) + self.steps = [] # type: list + + if add: + self.add(add) def add(self, add): + # type: (Union[Deployment, List[Deployment]]) -> None """ Add a deployment to this chain. :type add: Single :class:`Deployment` or a ``list`` of :class:`Deployment` :keyword add: Adds this deployment to the others already in this - object. + object. """ if add is not None: add = add if isinstance(add, (list, tuple)) else [add] self.steps.extend(add) def run(self, node, client): + # type: (Node, BaseSSHClient) -> Node """ Run each deployment that has been added. @@ -261,3 +328,16 @@ def run(self, node, client): for s in self.steps: node = s.run(node, client) return node + + def __str__(self): + return self.__repr__() + + def __repr__(self): + steps = [] + + for step in self.steps: + steps.append(str(step)) + + steps = ", ".join(steps) + + return "" % (steps) diff --git a/libcloud/compute/deprecated.py b/libcloud/compute/deprecated.py new file mode 100644 index 0000000000..e60c2ec0f9 --- /dev/null +++ b/libcloud/compute/deprecated.py @@ -0,0 +1,52 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Database of deprecated drivers +""" + +from libcloud.compute.types import Provider + +DEPRECATED_DRIVERS = { + Provider.OPSOURCE: { + "reason": "OpSource cloud is now part of Dimension Data, " + "use the DIMENSIONDATA provider instead.", + "url": "http://www.ntt.co.jp/news2011/1107e/110701a.html", + }, + Provider.NINEFOLD: { + "reason": "We will shortly notify our customers that we " + "will be sunsetting our Public Cloud Computing " + "(Server) platform, the last day of operation " + "being January 30, 2016", + "url": "https://ninefold.com/news/", + }, + Provider.IBM: { + "reason": "IBM SmartCloud Enterprise has been deprecated " + "in favour of IBM SoftLayer Public Cloud, please" + " use the SOFTLAYER provider.", + "url": "http://www.ibm.com/midmarket/us/en/article_cloud6_1310.html", + }, + Provider.HPCLOUD: { + "reason": "HP Helion Public Cloud was shut down in January 2016.", + "url": "http://libcloud.apache.org/blog/" "2016/02/16/new-drivers-deprecated-drivers.html", + }, + Provider.CLOUDFRAMES: { + "reason": "The CloudFrames Provider is no longer supported", + "url": "http://libcloud.apache.org/blog/2016/02/16/new-drivers-" "deprecated-drivers.html", + }, + Provider.RUNABOVE: { + "reason": "The RunAbove compute is no longer supported. " "Use the OVH one instead.", + "url": "https://www.runabove.com/cloud-instance.xml", + }, +} diff --git a/libcloud/compute/drivers/__init__.py b/libcloud/compute/drivers/__init__.py index ab02a6b186..ba5af84270 100644 --- a/libcloud/compute/drivers/__init__.py +++ b/libcloud/compute/drivers/__init__.py @@ -18,25 +18,20 @@ """ __all__ = [ - 'abiquo', - 'brightbox', - 'bluebox', - 'dummy', - 'ec2', - 'ecp', - 'elasticstack', - 'elastichosts', - 'cloudsigma', - 'gce', - 'gogrid', - 'hostvirtual', - 'ibm_sce', - 'linode', - 'opennebula', - 'rackspace', - 'rimuhosting', - 'softlayer', - 'vcloud', - 'voxel', - 'vpsnet', + "abiquo", + "brightbox", + "dimensiondata", + "dummy", + "ec2", + "cloudsigma", + "gce", + "linode", + "nttcis", + "opennebula", + "rackspace", + "rimuhosting", + "vcloud", + "vpsnet", + "onapp", + "equinixmetal", ] diff --git a/libcloud/compute/drivers/abiquo.py b/libcloud/compute/drivers/abiquo.py index f8afdfd0a6..305c618a10 100644 --- a/libcloud/compute/drivers/abiquo.py +++ b/libcloud/compute/drivers/abiquo.py @@ -18,16 +18,13 @@ The driver implements the compute Abiquo functionality for the Abiquo API. This version is compatible with the following versions of Abiquo: - * Abiquo 3.1 (http://wiki.abiquo.com/display/ABI31/The+Abiquo+API) + * Abiquo 3.4 (http://wiki.abiquo.com/display/ABI34/The+Abiquo+API) """ -import xml.etree.ElementTree as ET -from libcloud.compute.base import NodeDriver, NodeSize +from libcloud.utils.py3 import ET, tostring +from libcloud.compute.base import Node, NodeSize, NodeImage, NodeDriver, NodeLocation +from libcloud.common.abiquo import AbiquoResponse, AbiquoConnection, get_href from libcloud.compute.types import Provider, LibcloudError -from libcloud.common.abiquo import (AbiquoConnection, get_href, - AbiquoResponse) -from libcloud.compute.base import NodeLocation, NodeImage, Node -from libcloud.utils.py3 import tostring class AbiquoNodeDriver(NodeDriver): @@ -36,28 +33,28 @@ class AbiquoNodeDriver(NodeDriver): """ type = Provider.ABIQUO - name = 'Abiquo' - website = 'http://www.abiquo.com/' + name = "Abiquo" + website = "http://www.abiquo.com/" connectionCls = AbiquoConnection timeout = 2000 # some images take a lot of time! # Media Types - NODES_MIME_TYPE = 'application/vnd.abiquo.virtualmachines+xml' - NODE_MIME_TYPE = 'application/vnd.abiquo.virtualmachine+xml' - VAPPS_MIME_TYPE = 'application/vnd.abiquo.virtualappliances+xml' - VAPP_MIME_TYPE = 'application/vnd.abiquo.virtualappliance+xml' - VM_TASK_MIME_TYPE = 'application/vnd.abiquo.virtualmachinetask+xml' - USER_MIME_TYPE = 'application/vnd.abiquo.user+xml' - ENT_MIME_TYPE = 'application/vnd.abiquo.enterprise+xml' - VDCS_MIME_TYPE = 'application/vnd.abiquo.virtualdatacenters+xml' - VDC_MIME_TYPE = 'application/vnd.abiquo.virtualdatacenter+xml' - DCS_MIME_TYPE = 'application/vnd.abiquo.datacenters+xml' - VMTPLS_MIME_TYPE = 'application/vnd.abiquo.virtualmachinetemplates+xml' - VMTPL_MIME_TYPE = 'application/vnd.abiquo.virtualmachinetemplate+xml' - NICS_MIME_TYPE = 'application/vnd.abiquo.nics+xml' - DCRS_MIME_TYPE = 'application/vnd.abiquo.datacenterrepositories+xml' - DCR_MIME_TYPE = 'application/vnd.abiquo.datacenterrepository+xml' - AR_MIME_TYPE = 'application/vnd.abiquo.acceptedrequest+xml' + NODES_MIME_TYPE = "application/vnd.abiquo.virtualmachines+xml" + NODE_MIME_TYPE = "application/vnd.abiquo.virtualmachine+xml" + VAPPS_MIME_TYPE = "application/vnd.abiquo.virtualappliances+xml" + VAPP_MIME_TYPE = "application/vnd.abiquo.virtualappliance+xml" + VM_TASK_MIME_TYPE = "application/vnd.abiquo.virtualmachinetask+xml" + USER_MIME_TYPE = "application/vnd.abiquo.user+xml" + ENT_MIME_TYPE = "application/vnd.abiquo.enterprise+xml" + VDCS_MIME_TYPE = "application/vnd.abiquo.virtualdatacenters+xml" + VDC_MIME_TYPE = "application/vnd.abiquo.virtualdatacenter+xml" + DCS_MIME_TYPE = "application/vnd.abiquo.datacenters+xml" + VMTPLS_MIME_TYPE = "application/vnd.abiquo.virtualmachinetemplates+xml" + VMTPL_MIME_TYPE = "application/vnd.abiquo.virtualmachinetemplate+xml" + NICS_MIME_TYPE = "application/vnd.abiquo.nics+xml" + DCRS_MIME_TYPE = "application/vnd.abiquo.datacenterrepositories+xml" + DCR_MIME_TYPE = "application/vnd.abiquo.datacenterrepository+xml" + AR_MIME_TYPE = "application/vnd.abiquo.acceptedrequest+xml" # Others constants GIGABYTE = 1073741824 @@ -76,12 +73,10 @@ def __init__(self, user_id, secret, endpoint, **kwargs): :type endpoint: ``str`` that can be parsed as URL """ self.endpoint = endpoint - super(AbiquoNodeDriver, self).__init__(key=user_id, secret=secret, - secure=False, host=None, - port=None, **kwargs) + super().__init__(key=user_id, secret=secret, secure=False, host=None, port=None, **kwargs) self.ex_populate_cache() - def create_node(self, **kwargs): + def create_node(self, name, size, image, location=None, auth=None, ex_group_name=None): """ Create a new node instance in Abiquo @@ -113,13 +108,13 @@ def create_node(self, **kwargs): undefined behavior will be selected. (optional) :type location: :class:`NodeLocation` - :keyword group_name: Which group this node belongs to. If empty, - it will be created into 'libcloud' group. If - it does not found any group in the target - location (random location if you have not set - the parameter), then it will create a new - group with this name. - :type group_name: c{str} + :keyword ex_group_name: Which group this node belongs to. If empty, + it will be created into 'libcloud' group. If + it does not found any group in the target + location (random location if you have not + set the parameter), then it will create a + new group with this name. + :type ex_group_name: c{str} :return: The newly created node. :rtype: :class:`Node` @@ -128,21 +123,22 @@ def create_node(self, **kwargs): # To be clear: # 'xml_loc' is the xml element we navigate into (we need links) # 'loc' is the :class:`NodeLocation` entity - xml_loc, loc = self._define_create_node_location(**kwargs) + xml_loc, loc = self._define_create_node_location(image=image, location=location) # Define the Group - group = self._define_create_node_group(xml_loc, loc, **kwargs) + group = self._define_create_node_group(xml_loc, loc, ex_group_name) # Register the Node - vm = self._define_create_node_node(group, **kwargs) + vm = self._define_create_node_node(group, name=name, size=size, image=image) # Execute the 'create' in hypervisor action self._deploy_remote(vm) # Retrieve it again, to get some schedule-time defined values - edit_vm = get_href(vm, 'edit') - headers = {'Accept': self.NODE_MIME_TYPE} + edit_vm = get_href(vm, "edit") + headers = {"Accept": self.NODE_MIME_TYPE} vm = self.connection.request(edit_vm, headers=headers).object + return self._to_node(vm, self) def destroy_node(self, node): @@ -160,33 +156,41 @@ def destroy_node(self, node): """ # Refresh node state - headers = {'Accept': self.NODE_MIME_TYPE} - e_vm = self.connection.request(node.extra['uri_id'], - headers=headers).object + headers = {"Accept": self.NODE_MIME_TYPE} + e_vm = self.connection.request(node.extra["uri_id"], headers=headers).object + + state = e_vm.findtext("state") - state = e_vm.findtext('state') + if state in ["ALLOCATED", "CONFIGURED", "LOCKED", "UNKNOWN"]: + raise LibcloudError("Invalid Node state", self) - if state in ['ALLOCATED', 'CONFIGURED', 'LOCKED', 'UNKNOWN']: - raise LibcloudError('Invalid Node state', self) + res = None - if state != 'NOT_ALLOCATED': + if state != "NOT_ALLOCATED": # prepare the element that forces the undeploy - vm_task = ET.Element('virtualmachinetask') - force_undeploy = ET.SubElement(vm_task, 'forceUndeploy') - force_undeploy.text = 'True' + vm_task = ET.Element("virtualmachinetask") + force_undeploy = ET.SubElement(vm_task, "forceUndeploy") + force_undeploy.text = "True" # Set the URI - destroy_uri = node.extra['uri_id'] + '/action/undeploy' + destroy_uri = node.extra["uri_id"] + "/action/undeploy" # Prepare the headers - headers = {'Accept': self.AR_MIME_TYPE, - 'Content-type': self.VM_TASK_MIME_TYPE} - res = self.connection.async_request(action=destroy_uri, - method='POST', - data=tostring(vm_task), - headers=headers) - - if state == 'NOT_ALLOCATED' or res.async_success(): - self.connection.request(action=node.extra['uri_id'], - method='DELETE') + headers = { + "Accept": self.AR_MIME_TYPE, + "Content-type": self.VM_TASK_MIME_TYPE, + } + res = self.connection.async_request( + action=destroy_uri, + method="POST", + data=tostring(vm_task), + headers=headers, + ) + + # pylint: disable=maybe-no-member + + if state == "NOT_ALLOCATED" or (res and res.async_success()): + # pylint: enable=maybe-no-member + self.connection.request(action=node.extra["uri_id"], method="DELETE") + return True else: return False @@ -214,11 +218,11 @@ def ex_run_node(self, node): :rtype: :class:`Node` """ # Refresh node state - e_vm = self.connection.request(node.extra['uri_id']).object - state = e_vm.findtext('state') + e_vm = self.connection.request(node.extra["uri_id"]).object + state = e_vm.findtext("state") - if state != 'NOT_ALLOCATED': - raise LibcloudError('Invalid Node state', self) + if state != "NOT_ALLOCATED": + raise LibcloudError("Invalid Node state", self) # -------------------------------------------------------- # Deploy the Node @@ -229,9 +233,10 @@ def ex_run_node(self, node): # Retrieve it again, to get some schedule-defined # values. # -------------------------------------------------------- - edit_vm = get_href(e_vm, 'edit') - headers = {'Accept': self.NODE_MIME_TYPE} + edit_vm = get_href(e_vm, "edit") + headers = {"Accept": self.NODE_MIME_TYPE} e_vm = self.connection.request(edit_vm, headers=headers).object + return self._to_node(e_vm, self) def ex_populate_cache(self): @@ -252,37 +257,38 @@ def ex_populate_cache(self): refresh the list of locations any time. """ - user_headers = {'Accept': self.USER_MIME_TYPE} - user = self.connection.request('/login', headers=user_headers).object - self.connection.cache['user'] = user - e_ent = get_href(self.connection.cache['user'], - 'enterprise') - ent_headers = {'Accept': self.ENT_MIME_TYPE} + user_headers = {"Accept": self.USER_MIME_TYPE} + user = self.connection.request("/login", headers=user_headers).object + self.connection.cache["user"] = user + e_ent = get_href(self.connection.cache["user"], "enterprise") + ent_headers = {"Accept": self.ENT_MIME_TYPE} ent = self.connection.request(e_ent, headers=ent_headers).object - self.connection.cache['enterprise'] = ent + self.connection.cache["enterprise"] = ent - vdcs_headers = {'Accept': self.VDCS_MIME_TYPE} - uri_vdcs = '/cloud/virtualdatacenters' + vdcs_headers = {"Accept": self.VDCS_MIME_TYPE} + uri_vdcs = "/cloud/virtualdatacenters" e_vdcs = self.connection.request(uri_vdcs, headers=vdcs_headers).object params = {"idEnterprise": self._get_enterprise_id()} - dcs_headers = {'Accept': self.DCS_MIME_TYPE} - e_dcs = self.connection.request('/admin/datacenters', - headers=dcs_headers, - params=params).object + dcs_headers = {"Accept": self.DCS_MIME_TYPE} + e_dcs = self.connection.request( + "/admin/datacenters", headers=dcs_headers, params=params + ).object dc_dict = {} - for dc in e_dcs.findall('datacenter'): - key = get_href(dc, 'self') + + for dc in e_dcs.findall("datacenter"): + key = get_href(dc, "self") dc_dict[key] = dc # Populate locations name cache - self.connection.cache['locations'] = {} - for e_vdc in e_vdcs.findall('virtualDatacenter'): - loc = get_href(e_vdc, 'location') + self.connection.cache["locations"] = {} + + for e_vdc in e_vdcs.findall("virtualDatacenter"): + loc = get_href(e_vdc, "location") + if loc is not None: - self.connection.cache['locations'][loc] = get_href(e_vdc, - 'edit') + self.connection.cache["locations"][loc] = get_href(e_vdc, "edit") def ex_create_group(self, name, location=None): """ @@ -300,36 +306,35 @@ def ex_create_group(self, name, location=None): :rtype: :class:`NodeGroup` """ # prepare the element - vapp = ET.Element('virtualAppliance') - vapp_name = ET.SubElement(vapp, 'name') + vapp = ET.Element("virtualAppliance") + vapp_name = ET.SubElement(vapp, "name") vapp_name.text = name if location is None: location = self.list_locations()[0] elif location not in self.list_locations(): - raise LibcloudError('Location does not exist') + raise LibcloudError("Location does not exist") - link_vdc = self.connection.cache['locations'][location] - hdr_vdc = {'Accept': self.VDC_MIME_TYPE} + link_vdc = self.connection.cache["locations"][location] + hdr_vdc = {"Accept": self.VDC_MIME_TYPE} e_vdc = self.connection.request(link_vdc, headers=hdr_vdc).object - creation_link = get_href(e_vdc, 'virtualappliances') - headers = {'Accept': self.VAPP_MIME_TYPE, - 'Content-type': self.VAPP_MIME_TYPE} - vapp = self.connection.request(creation_link, data=tostring(vapp), - headers=headers, method='POST').object + creation_link = get_href(e_vdc, "virtualappliances") + headers = {"Accept": self.VAPP_MIME_TYPE, "Content-type": self.VAPP_MIME_TYPE} + vapp = self.connection.request( + creation_link, data=tostring(vapp), headers=headers, method="POST" + ).object - uri_vapp = get_href(vapp, 'edit') + uri_vapp = get_href(vapp, "edit") - return NodeGroup(self, vapp.findtext('name'), - uri=uri_vapp) + return NodeGroup(self, vapp.findtext("name"), uri=uri_vapp) def ex_destroy_group(self, group): """ Destroy a group. - Be careful! Destroying a group means destroying all the :class:`Node`s - there and the group itself! + Be careful! Destroying a group means destroying all the :class:`Node` + instances there and the group itself! If there is currently any action over any :class:`Node` of the :class:`NodeGroup`, then the method will raise an exception. @@ -342,33 +347,42 @@ def ex_destroy_group(self, group): """ # Refresh group state e_group = self.connection.request(group.uri).object - state = e_group.findtext('state') + state = e_group.findtext("state") - if state not in ['NOT_DEPLOYED', 'DEPLOYED']: - error = 'Can not destroy group because of current state' + if state not in ["NOT_DEPLOYED", "DEPLOYED"]: + error = "Can not destroy group because of current state" raise LibcloudError(error, self) - if state == 'DEPLOYED': + res = None + + if state == "DEPLOYED": # prepare the element that forces the undeploy - vm_task = ET.Element('virtualmachinetask') - force_undeploy = ET.SubElement(vm_task, 'forceUndeploy') - force_undeploy.text = 'True' + vm_task = ET.Element("virtualmachinetask") + force_undeploy = ET.SubElement(vm_task, "forceUndeploy") + force_undeploy.text = "True" # Set the URI - undeploy_uri = group.uri + '/action/undeploy' + undeploy_uri = group.uri + "/action/undeploy" # Prepare the headers - headers = {'Accept': self.AR_MIME_TYPE, - 'Content-type': self.VM_TASK_MIME_TYPE} - res = self.connection.async_request(action=undeploy_uri, - method='POST', - data=tostring(vm_task), - headers=headers) - - if state == 'NOT_DEPLOYED' or res.async_success(): + headers = { + "Accept": self.AR_MIME_TYPE, + "Content-type": self.VM_TASK_MIME_TYPE, + } + res = self.connection.async_request( + action=undeploy_uri, + method="POST", + data=tostring(vm_task), + headers=headers, + ) + + # pylint: disable=maybe-no-member + + if state == "NOT_DEPLOYED" or (res and res.async_success()): + # pylint: enable=maybe-no-member # The node is no longer deployed. Unregister it. - self.connection.request(action=group.uri, - method='DELETE') + self.connection.request(action=group.uri, method="DELETE") + return True else: return False @@ -383,23 +397,24 @@ def ex_list_groups(self, location=None): :return: the list of :class:`NodeGroup` """ groups = [] + for vdc in self._get_locations(location): - link_vdc = self.connection.cache['locations'][vdc] - hdr_vdc = {'Accept': self.VDC_MIME_TYPE} + link_vdc = self.connection.cache["locations"][vdc] + hdr_vdc = {"Accept": self.VDC_MIME_TYPE} e_vdc = self.connection.request(link_vdc, headers=hdr_vdc).object - apps_link = get_href(e_vdc, 'virtualappliances') - hdr_vapps = {'Accept': self.VAPPS_MIME_TYPE} - vapps = self.connection.request(apps_link, - headers=hdr_vapps).object - for vapp in vapps.findall('virtualAppliance'): + apps_link = get_href(e_vdc, "virtualappliances") + hdr_vapps = {"Accept": self.VAPPS_MIME_TYPE} + vapps = self.connection.request(apps_link, headers=hdr_vapps).object + + for vapp in vapps.findall("virtualAppliance"): nodes = [] - vms_link = get_href(vapp, 'virtualmachines') - headers = {'Accept': self.NODES_MIME_TYPE} + vms_link = get_href(vapp, "virtualmachines") + headers = {"Accept": self.NODES_MIME_TYPE} vms = self.connection.request(vms_link, headers=headers).object - for vm in vms.findall('virtualMachine'): + + for vm in vms.findall("virtualMachine"): nodes.append(self._to_node(vm, self)) - group = NodeGroup(self, vapp.findtext('name'), - nodes, get_href(vapp, 'edit')) + group = NodeGroup(self, vapp.findtext("name"), nodes, get_href(vapp, "edit")) groups.append(group) return groups @@ -415,39 +430,41 @@ def list_images(self, location=None): :rtype: ``list`` of :class:`NodeImage` """ enterprise_id = self._get_enterprise_id() - uri = '/admin/enterprises/%s/datacenterrepositories/' % (enterprise_id) - repos_hdr = {'Accept': self.DCRS_MIME_TYPE} + uri = "/admin/enterprises/%s/datacenterrepositories/" % (enterprise_id) + repos_hdr = {"Accept": self.DCRS_MIME_TYPE} repos = self.connection.request(uri, headers=repos_hdr).object images = [] - for repo in repos.findall('datacenterRepository'): + + for repo in repos.findall("datacenterRepository"): # filter by location. Skips when the name of the location # is different from the 'datacenterRepository' element + for vdc in self._get_locations(location): # Check if the virtual datacenter belongs to this repo - link_vdc = self.connection.cache['locations'][vdc] - hdr_vdc = {'Accept': self.VDC_MIME_TYPE} - e_vdc = self.connection.request(link_vdc, - headers=hdr_vdc).object - dc_link_vdc = get_href(e_vdc, 'location') - dc_link_repo = get_href(repo, 'datacenter') + link_vdc = self.connection.cache["locations"][vdc] + hdr_vdc = {"Accept": self.VDC_MIME_TYPE} + e_vdc = self.connection.request(link_vdc, headers=hdr_vdc).object + dc_link_vdc = get_href(e_vdc, "location") + dc_link_repo = get_href(repo, "datacenter") if dc_link_vdc.split("/")[-1] == dc_link_repo.split("/")[-1]: # Filter the template in case we don't have it yet - url_templates = get_href(repo, 'virtualmachinetemplates') - hypervisor_type = e_vdc.findtext('hypervisorType') - params = {'hypervisorTypeName': hypervisor_type} - headers = {'Accept': self.VMTPLS_MIME_TYPE} - templates = self.connection.request(url_templates, params, - headers=headers).object - for templ in templates.findall('virtualMachineTemplate'): + url_templates = get_href(repo, "virtualmachinetemplates") + hypervisor_type = e_vdc.findtext("hypervisorType") + params = {"hypervisorTypeName": hypervisor_type} + headers = {"Accept": self.VMTPLS_MIME_TYPE} + templates = self.connection.request( + url_templates, params, headers=headers + ).object + + for templ in templates.findall("virtualMachineTemplate"): # Avoid duplicated templates - id_template = templ.findtext('id') + id_template = templ.findtext("id") ids = [image.id for image in images] + if id_template not in ids: - images.append(self._to_nodeimage(templ, self, - get_href(repo, - 'edit'))) + images.append(self._to_nodeimage(templ, self, get_href(repo, "edit"))) return images @@ -459,7 +476,8 @@ def list_locations(self): user :rtype: ``list`` of :class:`NodeLocation` """ - return list(self.connection.cache['locations'].keys()) + + return list(self.connection.cache["locations"].keys()) def list_nodes(self, location=None): """ @@ -489,40 +507,49 @@ def list_sizes(self, location=None): If you call the method :class:`AbiquoNodeDriver.create_node` with the size informed, it will just override the 'ram' value of the 'image' - template. So it is no too much usefull work with sizes... + template. So it is no too much useful work with sizes... :return: The list of sizes :rtype: ``list`` of :class:`NodeSizes` """ + return [ - NodeSize(id=1, - name='Small', - ram=128, - disk=4, - bandwidth=None, - price=None, - driver=self), - NodeSize(id=2, - name='Medium', - ram=512, - disk=16, - bandwidth=None, - price=None, - driver=self), - NodeSize(id=3, - name='Big', - ram=4096, - disk=32, - bandwidth=None, - price=None, - driver=self), - NodeSize(id=4, - name="XXL Big", - ram=4096 * 2, - disk=32 * 4, - bandwidth=None, - price=None, - driver=self) + NodeSize( + id=1, + name="Small", + ram=128, + disk=4, + bandwidth=None, + price=None, + driver=self, + ), + NodeSize( + id=2, + name="Medium", + ram=512, + disk=16, + bandwidth=None, + price=None, + driver=self, + ), + NodeSize( + id=3, + name="Big", + ram=4096, + disk=32, + bandwidth=None, + price=None, + driver=self, + ), + NodeSize( + id=4, + name="XXL Big", + ram=4096 * 2, + disk=32 * 4, + bandwidth=None, + price=None, + driver=self, + ), ] def reboot_node(self, node): @@ -535,14 +562,14 @@ def reboot_node(self, node): :return: True if the reboot was successful, otherwise False :rtype: ``bool`` """ - reboot_uri = node.extra['uri_id'] + '/action/reset' - reboot_hdr = {'Accept': self.AR_MIME_TYPE} - res = self.connection.async_request(action=reboot_uri, - method='POST', headers=reboot_hdr) - return res.async_success() + reboot_uri = node.extra["uri_id"] + "/action/reset" + reboot_hdr = {"Accept": self.AR_MIME_TYPE} + res = self.connection.async_request(action=reboot_uri, method="POST", headers=reboot_hdr) + + return res.async_success() # pylint: disable=maybe-no-member # ------------------------- - # Extenstion methods + # Extension methods # ------------------------- def _ex_connection_class_kwargs(self): @@ -555,7 +582,7 @@ def _ex_connection_class_kwargs(self): :return: ``dict`` of :class:`AbiquoConnection` input arguments """ - return {'url': self.endpoint} + return {"url": self.endpoint} def _deploy_remote(self, e_vm): """ @@ -565,97 +592,108 @@ def _deploy_remote(self, e_vm): # Deploy the Node # -------------------------------------------------------- # prepare the element that forces the deploy - vm_task = ET.Element('virtualmachinetask') - force_deploy = ET.SubElement(vm_task, 'forceEnterpriseSoftLimits') - force_deploy.text = 'True' + vm_task = ET.Element("virtualmachinetask") + force_deploy = ET.SubElement(vm_task, "forceEnterpriseSoftLimits") + force_deploy.text = "True" # Prepare the headers - headers = {'Accept': self.AR_MIME_TYPE, - 'Content-type': self.VM_TASK_MIME_TYPE} - link_deploy = get_href(e_vm, 'deploy') - res = self.connection.async_request(action=link_deploy, method='POST', - data=tostring(vm_task), - headers=headers) - if not res.async_success(): - raise LibcloudError('Could not run the node', self) + headers = {"Accept": self.AR_MIME_TYPE, "Content-type": self.VM_TASK_MIME_TYPE} + link_deploy = get_href(e_vm, "deploy") + res = self.connection.async_request( + action=link_deploy, method="POST", data=tostring(vm_task), headers=headers + ) + + if not res.async_success(): # pylint: disable=maybe-no-member + raise LibcloudError("Could not run the node", self) def _to_location(self, vdc, dc, driver): """ Generates the :class:`NodeLocation` class. """ - identifier = vdc.findtext('id') - name = vdc.findtext('name') - country = dc.findtext('name') + identifier = vdc.findtext("id") + name = vdc.findtext("name") + country = dc.findtext("name") + return NodeLocation(identifier, name, country, driver) def _to_node(self, vm, driver): """ Generates the :class:`Node` class. """ - identifier = vm.findtext('id') - name = vm.findtext('label') - state = AbiquoResponse.NODE_STATE_MAP[vm.findtext('state')] + identifier = vm.findtext("id") + name = vm.findtext("label") + state = AbiquoResponse.NODE_STATE_MAP[vm.findtext("state")] - link_image = get_href(vm, 'virtualmachinetemplate') - link_hdr = {'Accept': self.VMTPL_MIME_TYPE} - image_element = self.connection.request(link_image, - headers=link_hdr).object - repo_link = get_href(image_element, 'datacenterrepository') + link_image = get_href(vm, "virtualmachinetemplate") + link_hdr = {"Accept": self.VMTPL_MIME_TYPE} + image_element = self.connection.request(link_image, headers=link_hdr).object + repo_link = get_href(image_element, "datacenterrepository") image = self._to_nodeimage(image_element, self, repo_link) # Fill the 'ips' data private_ips = [] public_ips = [] - nics_hdr = {'Accept': self.NICS_MIME_TYPE} - nics_element = self.connection.request(get_href(vm, 'nics'), - headers=nics_hdr).object - for nic in nics_element.findall('nic'): - ip = nic.findtext('ip') - for link in nic.findall('link'): - rel = link.attrib['rel'] - if rel == 'privatenetwork': + nics_hdr = {"Accept": self.NICS_MIME_TYPE} + nics_element = self.connection.request(get_href(vm, "nics"), headers=nics_hdr).object + + for nic in nics_element.findall("nic"): + ip = nic.findtext("ip") + + for link in nic.findall("link"): + rel = link.attrib["rel"] + + if rel == "privatenetwork": private_ips.append(ip) - elif rel in ['publicnetwork', 'externalnetwork', - 'unmanagednetwork']: + elif rel in ["publicnetwork", "externalnetwork", "unmanagednetwork"]: public_ips.append(ip) - extra = {'uri_id': get_href(vm, 'edit')} + extra = {"uri_id": get_href(vm, "edit")} - if vm.find('vdrpIp') is not None: - extra['vdrp_ip'] = vm.findtext('vdrpIP') - extra['vdrp_port'] = vm.findtext('vdrpPort') + if vm.find("vdrpIp") is not None: + extra["vdrp_ip"] = vm.findtext("vdrpIP") + extra["vdrp_port"] = vm.findtext("vdrpPort") - return Node(identifier, name, state, public_ips, private_ips, - driver, image=image, extra=extra) + return Node( + identifier, + name, + state, + public_ips, + private_ips, + driver, + image=image, + extra=extra, + ) def _to_nodeimage(self, template, driver, repo): """ Generates the :class:`NodeImage` class. """ - identifier = template.findtext('id') - name = template.findtext('name') - url = get_href(template, 'edit') - hdreqd = template.findtext('hdRequired') - extra = {'repo': repo, 'url': url, 'hdrequired': hdreqd} + identifier = template.findtext("id") + name = template.findtext("name") + url = get_href(template, "edit") + hdreqd = template.findtext("hdRequired") + extra = {"repo": repo, "url": url, "hdrequired": hdreqd} + return NodeImage(identifier, name, driver, extra) def _get_locations(self, location=None): """ Returns the locations as a generator. """ + if location is not None: yield location else: - for loc in self.list_locations(): - yield loc + yield from self.list_locations() def _get_enterprise_id(self): """ Returns the identifier of the logged user's enterprise. """ - return self.connection.cache['enterprise'].findtext('id') - def _define_create_node_location(self, **kwargs): + return self.connection.cache["enterprise"].findtext("id") + + def _define_create_node_location(self, image, location): """ Search for a location where to create the node. @@ -663,103 +701,106 @@ def _define_create_node_location(self, **kwargs): location will be created. """ # First, get image location - if 'image' not in kwargs: + + if not image: error = "'image' parameter is mandatory" raise LibcloudError(error, self) - image = kwargs['image'] - # Get the location argument - location = None - if 'location' in kwargs: - location = kwargs['location'] + + if location: if location not in self.list_locations(): - raise LibcloudError('Location does not exist') + raise LibcloudError("Location does not exist") # Check if the image is compatible with any of the locations or # the input location loc = None target_loc = None + for candidate_loc in self._get_locations(location): - link_vdc = self.connection.cache['locations'][candidate_loc] - hdr_vdc = {'Accept': self.VDC_MIME_TYPE} + link_vdc = self.connection.cache["locations"][candidate_loc] + hdr_vdc = {"Accept": self.VDC_MIME_TYPE} e_vdc = self.connection.request(link_vdc, headers=hdr_vdc).object + for img in self.list_images(candidate_loc): if img.id == image.id: loc = e_vdc target_loc = candidate_loc + break if loc is None: - error = 'The image can not be used in any location' + error = "The image can not be used in any location" raise LibcloudError(error, self) return loc, target_loc - def _define_create_node_group(self, xml_loc, loc, **kwargs): + def _define_create_node_group(self, xml_loc, loc, group_name=None): """ Search for a group where to create the node. If we can not find any group, create it into argument 'location' """ - if 'group_name' not in kwargs: + + if not group_name: group_name = NodeGroup.DEFAULT_GROUP_NAME - else: - group_name = kwargs['group_name'] # We search if the group is already defined into the location - groups_link = get_href(xml_loc, 'virtualappliances') - groups_hdr = {'Accept': self.VAPPS_MIME_TYPE} - vapps_element = self.connection.request(groups_link, - headers=groups_hdr).object + groups_link = get_href(xml_loc, "virtualappliances") + groups_hdr = {"Accept": self.VAPPS_MIME_TYPE} + vapps_element = self.connection.request(groups_link, headers=groups_hdr).object target_group = None - for vapp in vapps_element.findall('virtualAppliance'): - if vapp.findtext('name') == group_name: - uri_vapp = get_href(vapp, 'edit') - return NodeGroup(self, vapp.findtext('name'), uri=uri_vapp) + + for vapp in vapps_element.findall("virtualAppliance"): + if vapp.findtext("name") == group_name: + uri_vapp = get_href(vapp, "edit") + + return NodeGroup(self, vapp.findtext("name"), uri=uri_vapp) # target group not found: create it. Since it is an extension of # the basic 'libcloud' functionality, we try to be as flexible as # possible. + if target_group is None: return self.ex_create_group(group_name, loc) - def _define_create_node_node(self, group, **kwargs): + def _define_create_node_node(self, group, name=None, size=None, image=None): """ Defines the node before to create. In Abiquo, you first need to 'register' or 'define' the node in the API before to create it into the target hypervisor. """ - vm = ET.Element('virtualMachine') - if 'name' in kwargs: - vmname = ET.SubElement(vm, 'label') - vmname.text = kwargs['name'] - attrib = {'type': self.VMTPL_MIME_TYPE, - 'rel': 'virtualmachinetemplate', - 'href': kwargs['image'].extra['url']} - ET.SubElement(vm, 'link', attrib=attrib) - headers = {'Accept': self.NODE_MIME_TYPE, - 'Content-type': self.NODE_MIME_TYPE} - - if 'size' in kwargs: + vm = ET.Element("virtualMachine") + + if name: + vmname = ET.SubElement(vm, "label") + vmname.text = name + attrib = { + "type": self.VMTPL_MIME_TYPE, + "rel": "virtualmachinetemplate", + "href": image.extra["url"], + } + ET.SubElement(vm, "link", attrib=attrib) + headers = {"Accept": self.NODE_MIME_TYPE, "Content-type": self.NODE_MIME_TYPE} + + if size: # Override the 'NodeSize' data - ram = ET.SubElement(vm, 'ram') - ram.text = str(kwargs['size'].ram) - hd = ET.SubElement(vm, 'hdInBytes') - hd.text = str(int(kwargs['size'].disk) * self.GIGABYTE) + ram = ET.SubElement(vm, "ram") + ram.text = str(size.ram) # Create the virtual machine - nodes_link = group.uri + '/virtualmachines' - vm = self.connection.request(nodes_link, data=tostring(vm), - headers=headers, method='POST').object - edit_vm = get_href(vm, 'edit') - headers = {'Accept': self.NODE_MIME_TYPE} + nodes_link = group.uri + "/virtualmachines" + vm = self.connection.request( + nodes_link, data=tostring(vm), headers=headers, method="POST" + ).object + edit_vm = get_href(vm, "edit") + headers = {"Accept": self.NODE_MIME_TYPE} return self.connection.request(edit_vm, headers=headers).object -class NodeGroup(object): +class NodeGroup: """ Group of virtual machines that can be managed together @@ -772,9 +813,10 @@ class NodeGroup(object): If the user does not want to handle groups, all the virtual machines will be created inside a group named 'libcloud' """ - DEFAULT_GROUP_NAME = 'libcloud' - def __init__(self, driver, name=DEFAULT_GROUP_NAME, nodes=[], uri=''): + DEFAULT_GROUP_NAME = "libcloud" + + def __init__(self, driver, name=DEFAULT_GROUP_NAME, nodes=[], uri=""): """ Initialize a new group object. """ @@ -784,12 +826,15 @@ def __init__(self, driver, name=DEFAULT_GROUP_NAME, nodes=[], uri=''): self.uri = uri def __repr__(self): - return (('') - % (self.name, ",".join(map(str, self.nodes)))) + return ("") % ( + self.name, + ",".join(map(str, self.nodes)), + ) def destroy(self): """ Destroys the group delegating the execution to :class:`AbiquoNodeDriver`. """ + return self.driver.ex_destroy_group(self) diff --git a/libcloud/compute/drivers/auroracompute.py b/libcloud/compute/drivers/auroracompute.py index 19847fb092..58177976a9 100644 --- a/libcloud/compute/drivers/auroracompute.py +++ b/libcloud/compute/drivers/auroracompute.py @@ -16,14 +16,38 @@ from libcloud.compute.providers import Provider from libcloud.compute.drivers.cloudstack import CloudStackNodeDriver -__all__ = [ - 'AuroraComputeNodeDriver' -] +__all__ = ["AuroraComputeRegion", "AuroraComputeNodeDriver"] + + +class AuroraComputeRegion: + AMS = "Amsterdam" + RTD = "Rotterdam" + MIA = "Miami" + LAX = "Los Angeles" + TYO = "Tokyo" + BCN = "Barcelona" + + +REGION_ENDPOINT_MAP = { + AuroraComputeRegion.AMS: "/ams", + AuroraComputeRegion.RTD: "/rtd", + AuroraComputeRegion.MIA: "/mia", + AuroraComputeRegion.LAX: "/lax", + AuroraComputeRegion.TYO: "/tyo", + AuroraComputeRegion.BCN: "/bcn", +} class AuroraComputeNodeDriver(CloudStackNodeDriver): type = Provider.AURORACOMPUTE - name = 'PCextreme AuroraCompute' - website = 'https://www.pcextreme.nl/aurora/' - host = 'cloud.pcextreme.nl' - path = '/api' + name = "PCextreme AuroraCompute" + website = "https://www.pcextreme.com/aurora/compute" + + def __init__(self, key, secret, path=None, host=None, url=None, region=None): + if host is None: + host = "api.auroracompute.eu" + + if path is None: + path = REGION_ENDPOINT_MAP.get(region, "/ams") + + super().__init__(key=key, secret=secret, host=host, path=path, secure=True) diff --git a/libcloud/compute/drivers/azure.py b/libcloud/compute/drivers/azure.py index 75404a977b..81388f14b5 100644 --- a/libcloud/compute/drivers/azure.py +++ b/libcloud/compute/drivers/azure.py @@ -20,200 +20,308 @@ """ import re -import time -import collections -import random -import sys import copy +import time import base64 - -from datetime import datetime +import random +import collections from xml.dom import minidom +from datetime import datetime from xml.sax.saxutils import escape as xml_escape -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - -from libcloud.common.azure import AzureServiceManagementConnection -from libcloud.common.azure import AzureRedirectException -from libcloud.compute.providers import Provider -from libcloud.compute.base import Node, NodeDriver, NodeLocation, NodeSize -from libcloud.compute.base import NodeImage, StorageVolume -from libcloud.compute.types import NodeState -from libcloud.common.types import LibcloudError -from libcloud.utils.py3 import _real_unicode -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlparse -from libcloud.utils.py3 import ensure_string +from libcloud.utils.py3 import ET, httplib, urlparse from libcloud.utils.py3 import urlquote as url_quote +from libcloud.utils.py3 import _real_unicode, ensure_string from libcloud.utils.misc import ReprMixin +from libcloud.common.azure import AzureRedirectException, AzureServiceManagementConnection +from libcloud.common.types import LibcloudError +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, +) +from libcloud.compute.types import NodeState +from libcloud.compute.providers import Provider HTTPSConnection = httplib.HTTPSConnection -if sys.version_info < (3,): - _unicode_type = unicode - - def _str(value): - if isinstance(value, unicode): - return value.encode('utf-8') +_str = str +_unicode_type = str - return str(value) -else: - _str = str - _unicode_type = str +AZURE_SERVICE_MANAGEMENT_HOST = "management.core.windows.net" +X_MS_VERSION = "2013-08-01" -AZURE_SERVICE_MANAGEMENT_HOST = 'management.core.windows.net' -X_MS_VERSION = '2013-08-01' - -WINDOWS_SERVER_REGEX = re.compile( - r'Win|SQL|SharePoint|Visual|Dynamics|DynGP|BizTalk' -) +WINDOWS_SERVER_REGEX = re.compile(r"Win|SQL|SharePoint|Visual|Dynamics|DynGP|BizTalk") """ Sizes must be hardcoded because Microsoft doesn't provide an API to fetch them From http://msdn.microsoft.com/en-us/library/windowsazure/dn197896.aspx + +Prices are for Linux instances in East US data center. To see what pricing will +actually be, visit: +http://azure.microsoft.com/en-gb/pricing/details/virtual-machines/ """ AZURE_COMPUTE_INSTANCE_TYPES = { - 'A0': { - 'id': 'ExtraSmall', - 'name': 'Extra Small Instance', - 'ram': 768, - 'disk': 127, - 'bandwidth': None, - 'price': '0.02', - 'max_data_disks': 1, - 'cores': 'Shared' + "A0": { + "id": "ExtraSmall", + "name": "Extra Small Instance", + "ram": 768, + "disk": 127, + "bandwidth": None, + "price": "0.0211", + "max_data_disks": 1, + "cores": "Shared", }, - 'A1': { - 'id': 'Small', - 'name': 'Small Instance', - 'ram': 1792, - 'disk': 127, - 'bandwidth': None, - 'price': '0.09', - 'max_data_disks': 2, - 'cores': 1 + "A1": { + "id": "Small", + "name": "Small Instance", + "ram": 1792, + "disk": 127, + "bandwidth": None, + "price": "0.0633", + "max_data_disks": 2, + "cores": 1, }, - 'A2': { - 'id': 'Medium', - 'name': 'Medium Instance', - 'ram': 3584, - 'disk': 127, - 'bandwidth': None, - 'price': '0.18', - 'max_data_disks': 4, - 'cores': 2 + "A2": { + "id": "Medium", + "name": "Medium Instance", + "ram": 3584, + "disk": 127, + "bandwidth": None, + "price": "0.1266", + "max_data_disks": 4, + "cores": 2, }, - 'A3': { - 'id': 'Large', - 'name': 'Large Instance', - 'ram': 7168, - 'disk': 127, - 'bandwidth': None, - 'price': '0.36', - 'max_data_disks': 8, - 'cores': 4 + "A3": { + "id": "Large", + "name": "Large Instance", + "ram": 7168, + "disk": 127, + "bandwidth": None, + "price": "0.2531", + "max_data_disks": 8, + "cores": 4, }, - 'A4': { - 'id': 'ExtraLarge', - 'name': 'Extra Large Instance', - 'ram': 14336, - 'disk': 127, - 'bandwidth': None, - 'price': '0.72', - 'max_data_disks': 16, - 'cores': 8 + "A4": { + "id": "ExtraLarge", + "name": "Extra Large Instance", + "ram": 14336, + "disk": 127, + "bandwidth": None, + "price": "0.5062", + "max_data_disks": 16, + "cores": 8, }, - 'A5': { - 'id': 'A5', - 'name': 'Memory Intensive Instance', - 'ram': 14336, - 'disk': 127, - 'bandwidth': None, - 'price': '0.40', - 'max_data_disks': 4, - 'cores': 2 + "A5": { + "id": "A5", + "name": "Memory Intensive Instance", + "ram": 14336, + "disk": 127, + "bandwidth": None, + "price": "0.2637", + "max_data_disks": 4, + "cores": 2, }, - 'A6': { - 'id': 'A6', - 'name': 'A6 Instance', - 'ram': 28672, - 'disk': 127, - 'bandwidth': None, - 'price': '0.80', - 'max_data_disks': 8, - 'cores': 4 + "A6": { + "id": "A6", + "name": "A6 Instance", + "ram": 28672, + "disk": 127, + "bandwidth": None, + "price": "0.5273", + "max_data_disks": 8, + "cores": 4, + }, + "A7": { + "id": "A7", + "name": "A7 Instance", + "ram": 57344, + "disk": 127, + "bandwidth": None, + "price": "1.0545", + "max_data_disks": 16, + "cores": 8, + }, + "A8": { + "id": "A8", + "name": "A8 Instance", + "ram": 57344, + "disk": 127, + "bandwidth": None, + "price": "2.0774", + "max_data_disks": 16, + "cores": 8, + }, + "A9": { + "id": "A9", + "name": "A9 Instance", + "ram": 114688, + "disk": 127, + "bandwidth": None, + "price": "4.7137", + "max_data_disks": 16, + "cores": 16, + }, + "A10": { + "id": "A10", + "name": "A10 Instance", + "ram": 57344, + "disk": 127, + "bandwidth": None, + "price": "1.2233", + "max_data_disks": 16, + "cores": 8, + }, + "A11": { + "id": "A11", + "name": "A11 Instance", + "ram": 114688, + "disk": 127, + "bandwidth": None, + "price": "2.1934", + "max_data_disks": 16, + "cores": 16, + }, + "D1": { + "id": "Standard_D1", + "name": "D1 Faster Compute Instance", + "ram": 3584, + "disk": 127, + "bandwidth": None, + "price": "0.0992", + "max_data_disks": 2, + "cores": 1, + }, + "D2": { + "id": "Standard_D2", + "name": "D2 Faster Compute Instance", + "ram": 7168, + "disk": 127, + "bandwidth": None, + "price": "0.1983", + "max_data_disks": 4, + "cores": 2, + }, + "D3": { + "id": "Standard_D3", + "name": "D3 Faster Compute Instance", + "ram": 14336, + "disk": 127, + "bandwidth": None, + "price": "0.3965", + "max_data_disks": 8, + "cores": 4, + }, + "D4": { + "id": "Standard_D4", + "name": "D4 Faster Compute Instance", + "ram": 28672, + "disk": 127, + "bandwidth": None, + "price": "0.793", + "max_data_disks": 16, + "cores": 8, + }, + "D11": { + "id": "Standard_D11", + "name": "D11 Faster Compute Instance", + "ram": 14336, + "disk": 127, + "bandwidth": None, + "price": "0.251", + "max_data_disks": 4, + "cores": 2, + }, + "D12": { + "id": "Standard_D12", + "name": "D12 Faster Compute Instance", + "ram": 28672, + "disk": 127, + "bandwidth": None, + "price": "0.502", + "max_data_disks": 8, + "cores": 4, + }, + "D13": { + "id": "Standard_D13", + "name": "D13 Faster Compute Instance", + "ram": 57344, + "disk": 127, + "bandwidth": None, + "price": "0.9038", + "max_data_disks": 16, + "cores": 8, + }, + "D14": { + "id": "Standard_D14", + "name": "D14 Faster Compute Instance", + "ram": 114688, + "disk": 127, + "bandwidth": None, + "price": "1.6261", + "max_data_disks": 32, + "cores": 16, }, - 'A7': { - 'id': 'A7', - 'name': 'A7 Instance', - 'ram': 57344, - 'disk': 127, - 'bandwidth': None, - 'price': '1.60', - 'max_data_disks': 16, - 'cores': 8 - } } _KNOWN_SERIALIZATION_XFORMS = { - 'include_apis': 'IncludeAPIs', - 'message_id': 'MessageId', - 'content_md5': 'Content-MD5', - 'last_modified': 'Last-Modified', - 'cache_control': 'Cache-Control', - 'account_admin_live_email_id': 'AccountAdminLiveEmailId', - 'service_admin_live_email_id': 'ServiceAdminLiveEmailId', - 'subscription_id': 'SubscriptionID', - 'fqdn': 'FQDN', - 'private_id': 'PrivateID', - 'os_virtual_hard_disk': 'OSVirtualHardDisk', - 'logical_disk_size_in_gb': 'LogicalDiskSizeInGB', - 'logical_size_in_gb': 'LogicalSizeInGB', - 'os': 'OS', - 'persistent_vm_downtime_info': 'PersistentVMDowntimeInfo', - 'copy_id': 'CopyId', - 'os_disk_configuration': 'OSDiskConfiguration', - 'is_dns_programmed': 'IsDnsProgrammed' + "include_apis": "IncludeAPIs", + "message_id": "MessageId", + "content_md5": "Content-MD5", + "last_modified": "Last-Modified", + "cache_control": "Cache-Control", + "account_admin_live_email_id": "AccountAdminLiveEmailId", + "service_admin_live_email_id": "ServiceAdminLiveEmailId", + "subscription_id": "SubscriptionID", + "fqdn": "FQDN", + "private_id": "PrivateID", + "os_virtual_hard_disk": "OSVirtualHardDisk", + "logical_disk_size_in_gb": "LogicalDiskSizeInGB", + "logical_size_in_gb": "LogicalSizeInGB", + "os": "OS", + "persistent_vm_downtime_info": "PersistentVMDowntimeInfo", + "copy_id": "CopyId", + "os_disk_configuration": "OSDiskConfiguration", + "is_dns_programmed": "IsDnsProgrammed", } class AzureNodeDriver(NodeDriver): connectionCls = AzureServiceManagementConnection - name = 'Azure Virtual machines' - website = 'http://azure.microsoft.com/en-us/services/virtual-machines/' + name = "Azure Virtual machines" + website = "http://azure.microsoft.com/en-us/services/virtual-machines/" type = Provider.AZURE _instance_types = AZURE_COMPUTE_INSTANCE_TYPES _blob_url = ".blob.core.windows.net" - features = {'create_node': ['password']} + features = {"create_node": ["password"]} service_location = collections.namedtuple( - 'service_location', - ['is_affinity_group', 'service_location'] + "service_location", ["is_affinity_group", "service_location"] ) NODE_STATE_MAP = { - 'RoleStateUnknown': NodeState.UNKNOWN, - 'CreatingVM': NodeState.PENDING, - 'StartingVM': NodeState.PENDING, - 'Provisioning': NodeState.PENDING, - 'CreatingRole': NodeState.PENDING, - 'StartingRole': NodeState.PENDING, - 'ReadyRole': NodeState.RUNNING, - 'BusyRole': NodeState.PENDING, - 'StoppingRole': NodeState.PENDING, - 'StoppingVM': NodeState.PENDING, - 'DeletingVM': NodeState.PENDING, - 'StoppedVM': NodeState.STOPPED, - 'RestartingRole': NodeState.REBOOTING, - 'CyclingRole': NodeState.TERMINATED, - 'FailedStartingRole': NodeState.TERMINATED, - 'FailedStartingVM': NodeState.TERMINATED, - 'UnresponsiveRole': NodeState.TERMINATED, - 'StoppedDeallocated': NodeState.TERMINATED, + "RoleStateUnknown": NodeState.UNKNOWN, + "CreatingVM": NodeState.PENDING, + "StartingVM": NodeState.PENDING, + "Provisioning": NodeState.PENDING, + "CreatingRole": NodeState.PENDING, + "StartingRole": NodeState.PENDING, + "ReadyRole": NodeState.RUNNING, + "BusyRole": NodeState.PENDING, + "StoppingRole": NodeState.PENDING, + "StoppingVM": NodeState.PENDING, + "DeletingVM": NodeState.PENDING, + "StoppedVM": NodeState.STOPPED, + "RestartingRole": NodeState.REBOOTING, + "CyclingRole": NodeState.TERMINATED, + "FailedStartingRole": NodeState.TERMINATED, + "FailedStartingVM": NodeState.TERMINATED, + "UnresponsiveRole": NodeState.TERMINATED, + "StoppedDeallocated": NodeState.TERMINATED, } def __init__(self, subscription_id=None, key_file=None, **kwargs): @@ -223,15 +331,13 @@ def __init__(self, subscription_id=None, key_file=None, **kwargs): """ self.subscription_id = subscription_id self.key_file = key_file - self.follow_redirects = kwargs.get('follow_redirects', True) - super(AzureNodeDriver, self).__init__( - self.subscription_id, - self.key_file, - secure=True, - **kwargs - ) + self.follow_redirects = kwargs.get("follow_redirects", True) + super().__init__(self.subscription_id, self.key_file, secure=True, **kwargs) - def list_sizes(self): + def list_sizes( + self, + location=None, + ): """ Lists all sizes @@ -239,7 +345,7 @@ def list_sizes(self): """ sizes = [] - for key, values in self._instance_types.items(): + for _, values in self._instance_types.items(): node_size = self._to_node_size(copy.deepcopy(values)) sizes.append(node_size) @@ -253,20 +359,13 @@ def list_images(self, location=None): """ data = self._perform_get(self._get_image_path(), Images) - custom_image_data = self._perform_get( - self._get_vmimage_path(), - VMImages - ) + custom_image_data = self._perform_get(self._get_vmimage_path(), VMImages) images = [self._to_image(i) for i in data] images.extend(self._vm_to_image(j) for j in custom_image_data) if location is not None: - images = [ - image - for image in images - if location in image.extra["location"] - ] + images = [image for image in images if location in image.extra["location"]] return images @@ -276,12 +375,9 @@ def list_locations(self): :rtype: ``list`` of :class:`NodeLocation` """ - data = self._perform_get( - '/' + self.subscription_id + '/locations', - Locations - ) + data = self._perform_get("/" + self.subscription_id + "/locations", Locations) - return [self._to_location(l) for l in data] + return [self._to_location(location) for location in data] def list_nodes(self, ex_cloud_service_name): """ @@ -298,9 +394,8 @@ def list_nodes(self, ex_cloud_service_name): :rtype: ``list`` of :class:`Node` """ response = self._perform_get( - self._get_hosted_service_path(ex_cloud_service_name) + - '?embed-detail=True', - None + self._get_hosted_service_path(ex_cloud_service_name) + "?embed-detail=True", + None, ) self.raise_for_response(response, 200) @@ -308,8 +403,7 @@ def list_nodes(self, ex_cloud_service_name): vips = None - if (len(data.deployments) > 0 and - data.deployments[0].virtual_ips is not None): + if len(data.deployments) > 0 and data.deployments[0].virtual_ips is not None: vips = [vip.address for vip in data.deployments[0].virtual_ips] try: @@ -320,8 +414,7 @@ def list_nodes(self, ex_cloud_service_name): except IndexError: return [] - def reboot_node(self, node, ex_cloud_service_name=None, - ex_deployment_slot=None): + def reboot_node(self, node, ex_cloud_service_name=None, ex_deployment_slot=None): """ Reboots a node. @@ -341,9 +434,7 @@ def reboot_node(self, node, ex_cloud_service_name=None, """ if ex_cloud_service_name is None: if node.extra is not None: - ex_cloud_service_name = node.extra.get( - 'ex_cloud_service_name' - ) + ex_cloud_service_name = node.extra.get("ex_cloud_service_name") if not ex_cloud_service_name: raise ValueError("ex_cloud_service_name is required.") @@ -352,17 +443,16 @@ def reboot_node(self, node, ex_cloud_service_name=None, ex_deployment_slot = "Production" _deployment_name = self._get_deployment( - service_name=ex_cloud_service_name, - deployment_slot=ex_deployment_slot + service_name=ex_cloud_service_name, deployment_slot=ex_deployment_slot ).name try: response = self._perform_post( - self._get_deployment_path_using_name( - ex_cloud_service_name, - _deployment_name - ) + '/roleinstances/' + _str(node.id) + '?comp=reboot', - '' + self._get_deployment_path_using_name(ex_cloud_service_name, _deployment_name) + + "/roleinstances/" + + _str(node.id) + + "?comp=reboot", + "", ) self.raise_for_response(response, 202) @@ -377,7 +467,7 @@ def reboot_node(self, node, ex_cloud_service_name=None, def list_volumes(self, node=None): """ Lists volumes of the disks in the image repository that are - associated with the specificed subscription. + associated with the specified subscription. Pass Node object to scope the list of volumes to a single instance. @@ -389,10 +479,24 @@ def list_volumes(self, node=None): volumes = [self._to_volume(volume=v, node=node) for v in data] return volumes - def create_node(self, name, size, image, ex_cloud_service_name, - ex_storage_service_name=None, ex_new_deployment=False, - ex_deployment_slot="Production", ex_deployment_name=None, - ex_admin_user_id="azureuser", auth=None, **kwargs): + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_cloud_service_name=None, + ex_storage_service_name=None, + ex_new_deployment=False, + ex_deployment_slot="Production", + ex_deployment_name=None, + ex_admin_user_id="azureuser", + ex_custom_data=None, + ex_virtual_network_name=None, + ex_network_config=None, + **kwargs, + ): """ Create Azure Virtual Machine @@ -446,9 +550,22 @@ def create_node(self, name, size, image, ex_cloud_service_name, to using the Cloud Service name. :type ex_deployment_name: ``str`` + :type ex_custom_data: ``str`` + :keyword ex_custom_data: Optional script or other data which is + injected into the VM when it's beginning + provisioned. :keyword ex_admin_user_id: Optional. Defaults to 'azureuser'. :type ex_admin_user_id: ``str`` + + :keyword ex_virtual_network_name: Optional. If this is not passed + in no virtual network is used. + :type ex_virtual_network_name: ``str`` + + :keyword ex_network_config: Optional. The ConfigurationSet to use + for network configuration + :type ex_network_config: `ConfigurationSet` + """ # TODO: Refactor this method to make it more readable, split it into # multiple smaller methods @@ -456,22 +573,24 @@ def create_node(self, name, size, image, ex_cloud_service_name, password = auth.password if not isinstance(size, NodeSize): - raise ValueError('Size must be an instance of NodeSize') + raise ValueError("Size must be an instance of NodeSize") if not isinstance(image, NodeImage): - raise ValueError( - "Image must be an instance of NodeImage, " - "produced by list_images()" - ) + raise ValueError("Image must be an instance of NodeImage, " "produced by list_images()") # Retrieve a list of currently available nodes for the provided cloud # service - node_list = self.list_nodes( - ex_cloud_service_name=ex_cloud_service_name - ) + node_list = self.list_nodes(ex_cloud_service_name=ex_cloud_service_name) - network_config = ConfigurationSet() - network_config.configuration_set_type = 'NetworkConfiguration' + if ex_network_config is None: + network_config = ConfigurationSet() + else: + network_config = ex_network_config + network_config.configuration_set_type = "NetworkConfiguration" + + # Base64 encode custom data if provided + if ex_custom_data: + ex_custom_data = self._encode_base64(data=ex_custom_data) # We do this because we need to pass a Configuration to the # method. This will be either Linux or Windows. @@ -479,7 +598,7 @@ def create_node(self, name, size, image, ex_cloud_service_name, machine_config = WindowsConfigurationSet( computer_name=name, admin_password=password, - admin_user_name=ex_admin_user_id + admin_user_name=ex_admin_user_id, ) machine_config.domain_join = None @@ -490,23 +609,22 @@ def create_node(self, name, size, image, ex_cloud_service_name, port = random.randint(41952, 65535) endpoints = self._get_deployment( service_name=ex_cloud_service_name, - deployment_slot=ex_deployment_slot + deployment_slot=ex_deployment_slot, ) for instances in endpoints.role_instance_list: - ports = [ep.public_port for ep in - instances.instance_endpoints] + ports = [ep.public_port for ep in instances.instance_endpoints] while port in ports: port = random.randint(41952, 65535) endpoint = ConfigurationSetInputEndpoint( - name='Remote Desktop', - protocol='tcp', + name="Remote Desktop", + protocol="tcp", port=port, - local_port='3389', + local_port="3389", load_balanced_endpoint_set_name=None, - enable_direct_server_return=False + enable_direct_server_return=False, ) else: if not node_list or ex_new_deployment: @@ -515,7 +633,7 @@ def create_node(self, name, size, image, ex_cloud_service_name, port = random.randint(41952, 65535) endpoints = self._get_deployment( service_name=ex_cloud_service_name, - deployment_slot=ex_deployment_slot + deployment_slot=ex_deployment_slot, ) for instances in endpoints.role_instance_list: @@ -528,42 +646,32 @@ def create_node(self, name, size, image, ex_cloud_service_name, port = random.randint(41952, 65535) endpoint = ConfigurationSetInputEndpoint( - name='SSH', - protocol='tcp', + name="SSH", + protocol="tcp", port=port, - local_port='22', + local_port="22", load_balanced_endpoint_set_name=None, - enable_direct_server_return=False + enable_direct_server_return=False, ) machine_config = LinuxConfigurationSet( - name, - ex_admin_user_id, - password, - False + name, ex_admin_user_id, password, False, ex_custom_data ) network_config.input_endpoints.items.append(endpoint) - _storage_location = self._get_cloud_service_location( - service_name=ex_cloud_service_name - ) + _storage_location = self._get_cloud_service_location(service_name=ex_cloud_service_name) if ex_storage_service_name is None: ex_storage_service_name = ex_cloud_service_name ex_storage_service_name = re.sub( - r'[\W_-]+', - '', - ex_storage_service_name.lower(), - flags=re.UNICODE + r"[\W_-]+", "", ex_storage_service_name.lower(), flags=re.UNICODE ) - if self._is_storage_service_unique( - service_name=ex_storage_service_name): - + if self._is_storage_service_unique(service_name=ex_storage_service_name): self._create_storage_account( service_name=ex_storage_service_name, location=_storage_location.service_location, - is_affinity_group=_storage_location.is_affinity_group + is_affinity_group=_storage_location.is_affinity_group, ) # OK, bit annoying here. You must create a deployment before @@ -581,21 +689,20 @@ def create_node(self, name, size, image, ex_cloud_service_name, vm_image_id = None disk_config = None - if image.extra.get('vm_image', False): + if image.extra.get("vm_image", False): vm_image_id = image.id # network_config = None else: - blob_url = "http://%s.blob.core.windows.net" % ( - ex_storage_service_name) + blob_url = "http://%s.blob.core.windows.net" % (ex_storage_service_name) # Azure's pattern in the UI. - disk_name = "%s-%s-%s.vhd" % ( + disk_name = "{}-{}-{}.vhd".format( ex_cloud_service_name, name, - time.strftime("%Y-%m-%d") + time.strftime("%Y-%m-%d"), ) - media_link = "%s/vhds/%s" % (blob_url, disk_name) + media_link = "{}/vhds/{}".format(blob_url, disk_name) disk_config = OSVirtualHardDisk(image.id, media_link) @@ -608,39 +715,36 @@ def create_node(self, name, size, image, ex_cloud_service_name, name, machine_config, disk_config, - 'PersistentVMRole', + "PersistentVMRole", network_config, None, None, size.id, - None, - vm_image_id - ) + ex_virtual_network_name, + vm_image_id, + ), ) self.raise_for_response(response, 202) self._ex_complete_async_azure_operation(response) else: _deployment_name = self._get_deployment( - service_name=ex_cloud_service_name, - deployment_slot=ex_deployment_slot + service_name=ex_cloud_service_name, deployment_slot=ex_deployment_slot ).name vm_image_id = None disk_config = None - if image.extra.get('vm_image', False): + if image.extra.get("vm_image", False): vm_image_id = image.id # network_config = None else: - blob_url = "http://%s.blob.core.windows.net" % ( - ex_storage_service_name - ) - disk_name = "%s-%s-%s.vhd" % ( + blob_url = "http://%s.blob.core.windows.net" % (ex_storage_service_name) + disk_name = "{}-{}-{}.vhd".format( ex_cloud_service_name, name, - time.strftime("%Y-%m-%d") + time.strftime("%Y-%m-%d"), ) - media_link = "%s/vhds/%s" % (blob_url, disk_name) + media_link = "{}/vhds/{}".format(blob_url, disk_name) disk_config = OSVirtualHardDisk(image.id, media_link) path = self._get_role_path(ex_cloud_service_name, _deployment_name) @@ -648,12 +752,12 @@ def create_node(self, name, size, image, ex_cloud_service_name, name, # role_name machine_config, # system_config disk_config, # os_virtual_hard_disk - 'PersistentVMRole', # role_type + "PersistentVMRole", # role_type network_config, # network_config None, # availability_set_name None, # data_virtual_hard_disks vm_image_id, # vm_image - size.id # role_size + size.id, # role_size ) response = self._perform_post(path, body) @@ -667,13 +771,10 @@ def create_node(self, name, size, image, ex_cloud_service_name, public_ips=[], private_ips=[], driver=self.connection.driver, - extra={ - 'ex_cloud_service_name': ex_cloud_service_name - } + extra={"ex_cloud_service_name": ex_cloud_service_name}, ) - def destroy_node(self, node, ex_cloud_service_name=None, - ex_deployment_slot="Production"): + def destroy_node(self, node, ex_cloud_service_name=None, ex_deployment_slot="Production"): """ Remove Azure Virtual Machine @@ -696,14 +797,13 @@ def destroy_node(self, node, ex_cloud_service_name=None, raise ValueError("A libcloud Node object is required.") if ex_cloud_service_name is None and node.extra is not None: - ex_cloud_service_name = node.extra.get('ex_cloud_service_name') + ex_cloud_service_name = node.extra.get("ex_cloud_service_name") if not ex_cloud_service_name: raise ValueError("Unable to get ex_cloud_service_name from Node.") _deployment = self._get_deployment( - service_name=ex_cloud_service_name, - deployment_slot=ex_deployment_slot + service_name=ex_cloud_service_name, deployment_slot=ex_deployment_slot ) _deployment_name = _deployment.name @@ -711,31 +811,20 @@ def destroy_node(self, node, ex_cloud_service_name=None, _server_deployment_count = len(_deployment.role_instance_list) if _server_deployment_count > 1: - path = self._get_role_path( - ex_cloud_service_name, - _deployment_name, - node.id - ) + path = self._get_role_path(ex_cloud_service_name, _deployment_name, node.id) else: - path = self._get_deployment_path_using_name( - ex_cloud_service_name, - _deployment_name - ) + path = self._get_deployment_path_using_name(ex_cloud_service_name, _deployment_name) - path += '?comp=media' + path += "?comp=media" self._perform_delete(path) return True def ex_list_cloud_services(self): - return self._perform_get( - self._get_hosted_service_path(), - HostedServices - ) + return self._perform_get(self._get_hosted_service_path(), HostedServices) - def ex_create_cloud_service(self, name, location, description=None, - extended_properties=None): + def ex_create_cloud_service(self, name, location, description=None, extended_properties=None): """ Create an azure cloud service. @@ -762,8 +851,8 @@ def ex_create_cloud_service(self, name, location, description=None, description, location, None, - extended_properties - ) + extended_properties, + ), ) self.raise_for_response(response, 201) @@ -779,129 +868,189 @@ def ex_destroy_cloud_service(self, name): :rtype: ``bool`` """ - # TODO: add check to ensure all nodes have been deleted - response = self._perform_cloud_service_delete( - self._get_hosted_service_path(name) - ) + response = self._perform_cloud_service_delete(self._get_hosted_service_path(name)) self.raise_for_response(response, 200) return True - def ex_add_instance_endpoints(self, node, endpoints, - ex_deployment_slot="Production"): + def ex_add_instance_endpoints(self, node, endpoints, ex_deployment_slot="Production"): all_endpoints = [ { "name": endpoint.name, "protocol": endpoint.protocol, "port": endpoint.public_port, "local_port": endpoint.local_port, - } - for endpoint in node.extra['instance_endpoints'] + for endpoint in node.extra["instance_endpoints"] ] all_endpoints.extend(endpoints) - result = self.ex_set_instance_endpoints(node, all_endpoints, - ex_deployment_slot) + # pylint: disable=assignment-from-no-return + result = self.ex_set_instance_endpoints(node, all_endpoints, ex_deployment_slot) return result - def ex_set_instance_endpoints(self, node, endpoints, - ex_deployment_slot="Production"): - """ - endpoint = ConfigurationSetInputEndpoint( - name='SSH', - protocol='tcp', - port=port, - local_port='22', - load_balanced_endpoint_set_name=None, - enable_direct_server_return=False - ) - { - 'name': 'SSH', - 'protocol': 'tcp', - 'port': port, - 'local_port': '22' - } + def ex_set_instance_endpoints(self, node, endpoints, ex_deployment_slot="Production"): """ + For example:: - ex_cloud_service_name = node.extra['ex_cloud_service_name'] + endpoint = ConfigurationSetInputEndpoint( + name='SSH', + protocol='tcp', + port=port, + local_port='22', + load_balanced_endpoint_set_name=None, + enable_direct_server_return=False + ) + { + 'name': 'SSH', + 'protocol': 'tcp', + 'port': port, + 'local_port': '22' + } + """ + ex_cloud_service_name = node.extra["ex_cloud_service_name"] vm_role_name = node.name network_config = ConfigurationSet() - network_config.configuration_set_type = 'NetworkConfiguration' + network_config.configuration_set_type = "NetworkConfiguration" for endpoint in endpoints: new_endpoint = ConfigurationSetInputEndpoint(**endpoint) network_config.input_endpoints.items.append(new_endpoint) _deployment_name = self._get_deployment( - service_name=ex_cloud_service_name, - deployment_slot=ex_deployment_slot + service_name=ex_cloud_service_name, deployment_slot=ex_deployment_slot ).name response = self._perform_put( - self._get_role_path( - ex_cloud_service_name, - _deployment_name, - vm_role_name - ), + self._get_role_path(ex_cloud_service_name, _deployment_name, vm_role_name), AzureXmlSerializer.add_role_to_xml( None, # role_name None, # system_config None, # os_virtual_hard_disk - 'PersistentVMRole', # role_type + "PersistentVMRole", # role_type network_config, # network_config None, # availability_set_name None, # data_virtual_hard_disks None, # vm_image - None # role_size - ) + None, # role_size + ), ) self.raise_for_response(response, 202) - """ - Functions not implemented - """ + def ex_create_storage_service( + self, + name, + location, + description=None, + affinity_group=None, + extended_properties=None, + ): + """ + Create an azure storage service. - def create_volume_snapshot(self): - raise NotImplementedError( - 'You cannot create snapshots of ' - 'Azure VMs at this time.' - ) + :param name: Name of the service to create + :type name: ``str`` - def attach_volume(self): - raise NotImplementedError( - 'attach_volume is not supported ' - 'at this time.' - ) + :param location: Standard azure location string + :type location: ``str`` - def create_volume(self): - raise NotImplementedError( - 'create_volume is not supported ' - 'at this time.' - ) + :param description: (Optional) Description of storage service. + :type description: ``str`` - def detach_volume(self): - raise NotImplementedError( - 'detach_volume is not supported ' - 'at this time.' - ) + :param affinity_group: (Optional) Azure affinity group. + :type affinity_group: ``str`` - def destroy_volume(self): - raise NotImplementedError( - 'destroy_volume is not supported ' - 'at this time.' + :param extended_properties: (Optional) Additional configuration + options support by Azure. + :type extended_properties: ``dict`` + + :rtype: ``bool`` + """ + + response = self._perform_storage_service_create( + self._get_storage_service_path(), + AzureXmlSerializer.create_storage_service_to_xml( + service_name=name, + label=self._encode_base64(name), + description=description, + location=location, + affinity_group=affinity_group, + extended_properties=extended_properties, + ), ) + self.raise_for_response(response, 202) + + return True + + def ex_destroy_storage_service(self, name): + """ + Destroy storage service. Storage service must not have any active + blobs. Sometimes Azure likes to hold onto volumes after they are + deleted for an inordinate amount of time, so sleep before calling + this method after volume deletion. + + :param name: Name of storage service. + :type name: ``str`` + + :rtype: ``bool`` + """ + + response = self._perform_storage_service_delete(self._get_storage_service_path(name)) + self.raise_for_response(response, 200) + + return True + + """ + Functions not implemented + """ + + def create_volume_snapshot( + self, + volume, + name=None, + ): + raise NotImplementedError("You cannot create snapshots of " "Azure VMs at this time.") + + def attach_volume( + self, + node, + volume, + device=None, + ): + raise NotImplementedError("attach_volume is not supported " "at this time.") + + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + ): + raise NotImplementedError("create_volume is not supported " "at this time.") + + def detach_volume( + self, + volume, + ): + raise NotImplementedError("detach_volume is not supported " "at this time.") + + def destroy_volume( + self, + volume, + ): + raise NotImplementedError("destroy_volume is not supported " "at this time.") + """ Private Functions """ def _perform_cloud_service_create(self, path, data): request = AzureHTTPRequest() - request.method = 'POST' + request.method = "POST" request.host = AZURE_SERVICE_MANAGEMENT_HOST request.path = path request.body = data @@ -913,7 +1062,30 @@ def _perform_cloud_service_create(self, path, data): def _perform_cloud_service_delete(self, path): request = AzureHTTPRequest() - request.method = 'DELETE' + request.method = "DELETE" + request.host = AZURE_SERVICE_MANAGEMENT_HOST + request.path = path + request.path, request.query = self._update_request_uri_query(request) + request.headers = self._update_management_header(request) + response = self._perform_request(request) + + return response + + def _perform_storage_service_create(self, path, data): + request = AzureHTTPRequest() + request.method = "POST" + request.host = AZURE_SERVICE_MANAGEMENT_HOST + request.path = path + request.body = data + request.path, request.query = self._update_request_uri_query(request) + request.headers = self._update_management_header(request) + response = self._perform_request(request) + + return response + + def _perform_storage_service_delete(self, path): + request = AzureHTTPRequest() + request.method = "DELETE" request.host = AZURE_SERVICE_MANAGEMENT_HOST request.path = path request.path, request.query = self._update_request_uri_query(request) @@ -927,8 +1099,8 @@ def _to_node(self, data, ex_cloud_service_name=None, virtual_ips=None): Convert the data from a Azure response object into a Node """ - remote_desktop_port = '' - ssh_port = '' + remote_desktop_port = "" + ssh_port = "" public_ips = virtual_ips or [] if data.instance_endpoints is not None: @@ -936,7 +1108,7 @@ def _to_node(self, data, ex_cloud_service_name=None, virtual_ips=None): public_ips = [data.instance_endpoints[0].vip] for port in data.instance_endpoints: - if port.name == 'Remote Desktop': + if port.name == "Remote Desktop": remote_desktop_port = port.public_port if port.name == "SSH": @@ -945,21 +1117,18 @@ def _to_node(self, data, ex_cloud_service_name=None, virtual_ips=None): return Node( id=data.role_name, name=data.role_name, - state=self.NODE_STATE_MAP.get( - data.instance_status, - NodeState.UNKNOWN - ), + state=self.NODE_STATE_MAP.get(data.instance_status, NodeState.UNKNOWN), public_ips=public_ips, private_ips=[data.ip_address], driver=self.connection.driver, extra={ - 'instance_endpoints': data.instance_endpoints, - 'remote_desktop_port': remote_desktop_port, - 'ssh_port': ssh_port, - 'power_state': data.power_state, - 'instance_size': data.instance_size, - 'ex_cloud_service_name': ex_cloud_service_name - } + "instance_endpoints": data.instance_endpoints, + "remote_desktop_port": remote_desktop_port, + "ssh_port": ssh_port, + "power_state": data.power_state, + "instance_size": data.instance_size, + "ex_cloud_service_name": ex_cloud_service_name, + }, ) def _to_location(self, data): @@ -991,7 +1160,7 @@ def _to_location(self, data): country=country, driver=self.connection.driver, available_services=data.available_services, - virtual_machine_role_sizes=vm_role_sizes + virtual_machine_role_sizes=vm_role_sizes, ) def _to_node_size(self, data): @@ -1006,10 +1175,7 @@ def _to_node_size(self, data): bandwidth=data["bandwidth"], price=data["price"], driver=self.connection.driver, - extra={ - 'max_data_disks': data["max_data_disks"], - 'cores': data["cores"] - } + extra={"max_data_disks": data["max_data_disks"], "cores": data["cores"]}, ) def _to_image(self, data): @@ -1018,14 +1184,14 @@ def _to_image(self, data): name=data.label, driver=self.connection.driver, extra={ - 'os': data.os, - 'category': data.category, - 'description': data.description, - 'location': data.location, - 'affinity_group': data.affinity_group, - 'media_link': data.media_link, - 'vm_image': False - } + "os": data.os, + "category": data.category, + "description": data.description, + "location": data.location, + "affinity_group": data.affinity_group, + "media_link": data.media_link, + "vm_image": False, + }, ) def _vm_to_image(self, data): @@ -1034,46 +1200,38 @@ def _vm_to_image(self, data): name=data.label, driver=self.connection.driver, extra={ - 'os': data.os_disk_configuration.os, - 'category': data.category, - 'location': data.location, - 'media_link': data.os_disk_configuration.media_link, - 'affinity_group': data.affinity_group, - 'deployment_name': data.deployment_name, - 'vm_image': True - } + "os": data.os_disk_configuration.os, + "category": data.category, + "location": data.location, + "media_link": data.os_disk_configuration.media_link, + "affinity_group": data.affinity_group, + "deployment_name": data.deployment_name, + "vm_image": True, + }, ) def _to_volume(self, volume, node): extra = { - 'affinity_group': volume.affinity_group, - 'os': volume.os, - 'location': volume.location, - 'media_link': volume.media_link, - 'source_image_name': volume.source_image_name + "affinity_group": volume.affinity_group, + "os": volume.os, + "location": volume.location, + "media_link": volume.media_link, + "source_image_name": volume.source_image_name, } - role_name = getattr(volume.attached_to, 'role_name', None) - hosted_service_name = getattr( - volume.attached_to, - 'hosted_service_name', - None - ) + role_name = getattr(volume.attached_to, "role_name", None) + hosted_service_name = getattr(volume.attached_to, "hosted_service_name", None) - deployment_name = getattr( - volume.attached_to, - 'deployment_name', - None - ) + deployment_name = getattr(volume.attached_to, "deployment_name", None) if role_name is not None: - extra['role_name'] = role_name + extra["role_name"] = role_name if hosted_service_name is not None: - extra['hosted_service_name'] = hosted_service_name + extra["hosted_service_name"] = hosted_service_name if deployment_name is not None: - extra['deployment_name'] = deployment_name + extra["deployment_name"] = deployment_name if node: if role_name is not None and role_name == node.id: @@ -1082,7 +1240,7 @@ def _to_volume(self, volume, node): name=volume.name, size=int(volume.logical_disk_size_in_gb), driver=self.connection.driver, - extra=extra + extra=extra, ) else: return StorageVolume( @@ -1090,19 +1248,15 @@ def _to_volume(self, volume, node): name=volume.name, size=int(volume.logical_disk_size_in_gb), driver=self.connection.driver, - extra=extra + extra=extra, ) def _get_deployment(self, **kwargs): - _service_name = kwargs['service_name'] - _deployment_slot = kwargs['deployment_slot'] + _service_name = kwargs["service_name"] + _deployment_slot = kwargs["deployment_slot"] response = self._perform_get( - self._get_deployment_path_using_slot( - _service_name, - _deployment_slot - ), - None + self._get_deployment_path_using_slot(_service_name, _deployment_slot), None ) self.raise_for_response(response, 200) @@ -1114,16 +1268,14 @@ def _get_cloud_service_location(self, service_name=None): raise ValueError("service_name is required.") res = self._perform_get( - '%s?embed-detail=False' % ( - self._get_hosted_service_path(service_name) - ), - HostedService + "%s?embed-detail=False" % (self._get_hosted_service_path(service_name)), + HostedService, ) _affinity_group = res.hosted_service_properties.affinity_group _cloud_service_location = res.hosted_service_properties.location - if _affinity_group is not None and _affinity_group is not '': + if _affinity_group is not None and _affinity_group != "": return self.service_location(True, _affinity_group) elif _cloud_service_location is not None: return self.service_location(False, _cloud_service_location) @@ -1135,12 +1287,9 @@ def _is_storage_service_unique(self, service_name=None): raise ValueError("service_name is required.") _check_availability = self._perform_get( - '%s/operations/isavailable/%s%s' % ( - self._get_storage_service_path(), - _str(service_name), - '' - ), - AvailabilityResponse + "%s/operations/isavailable/%s%s" + % (self._get_storage_service_path(), _str(service_name), ""), + AvailabilityResponse, ) self.raise_for_response(_check_availability, 200) @@ -1148,18 +1297,18 @@ def _is_storage_service_unique(self, service_name=None): return _check_availability.result def _create_storage_account(self, **kwargs): - if kwargs['is_affinity_group'] is True: + if kwargs["is_affinity_group"] is True: response = self._perform_post( self._get_storage_service_path(), AzureXmlSerializer.create_storage_service_input_to_xml( - kwargs['service_name'], - kwargs['service_name'], - self._encode_base64(kwargs['service_name']), - kwargs['location'], + kwargs["service_name"], + kwargs["service_name"], + self._encode_base64(kwargs["service_name"]), + kwargs["location"], None, # Location True, # geo_replication_enabled - None # extended_properties - ) + None, # extended_properties + ), ) self.raise_for_response(response, 202) @@ -1168,34 +1317,30 @@ def _create_storage_account(self, **kwargs): response = self._perform_post( self._get_storage_service_path(), AzureXmlSerializer.create_storage_service_input_to_xml( - kwargs['service_name'], - kwargs['service_name'], - self._encode_base64(kwargs['service_name']), + kwargs["service_name"], + kwargs["service_name"], + self._encode_base64(kwargs["service_name"]), None, # Affinity Group - kwargs['location'], # Location + kwargs["location"], # Location True, # geo_replication_enabled - None # extended_properties - ) + None, # extended_properties + ), ) self.raise_for_response(response, 202) # We need to wait for this to be created before we can # create the storage container and the instance. - self._ex_complete_async_azure_operation( - response, - "create_storage_account" - ) + self._ex_complete_async_azure_operation(response, "create_storage_account") def _get_operation_status(self, request_id): return self._perform_get( - '/' + self.subscription_id + '/operations/' + _str(request_id), - Operation + "/" + self.subscription_id + "/operations/" + _str(request_id), Operation ) def _perform_get(self, path, response_type): request = AzureHTTPRequest() - request.method = 'GET' + request.method = "GET" request.host = AZURE_SERVICE_MANAGEMENT_HOST request.path = path request.path, request.query = self._update_request_uri_query(request) @@ -1207,9 +1352,9 @@ def _perform_get(self, path, response_type): return response - def _perform_post(self, path, body, response_type=None, async=False): + def _perform_post(self, path, body, response_type=None): request = AzureHTTPRequest() - request.method = 'POST' + request.method = "POST" request.host = AZURE_SERVICE_MANAGEMENT_HOST request.path = path request.body = ensure_string(self._get_request_body(body)) @@ -1219,9 +1364,9 @@ def _perform_post(self, path, body, response_type=None, async=False): return response - def _perform_put(self, path, body, response_type=None, async=False): + def _perform_put(self, path, body, response_type=None): request = AzureHTTPRequest() - request.method = 'PUT' + request.method = "PUT" request.host = AZURE_SERVICE_MANAGEMENT_HOST request.path = path request.body = ensure_string(self._get_request_body(body)) @@ -1231,9 +1376,9 @@ def _perform_put(self, path, body, response_type=None, async=False): return response - def _perform_delete(self, path, async=False): + def _perform_delete(self, path): request = AzureHTTPRequest() - request.method = 'DELETE' + request.method = "DELETE" request.host = AZURE_SERVICE_MANAGEMENT_HOST request.path = path request.path, request.query = self._update_request_uri_query(request) @@ -1242,19 +1387,15 @@ def _perform_delete(self, path, async=False): self.raise_for_response(response, 202) - if async: - return self._parse_response_for_async_op(response) - def _perform_request(self, request): try: return self.connection.request( action=request.path, data=request.body, headers=request.headers, - method=request.method + method=request.method, ) - except AzureRedirectException: - e = sys.exc_info()[1] + except AzureRedirectException as e: parsed_url = urlparse.urlparse(e.location) request.host = parsed_url.netloc return self._perform_request(request) @@ -1268,27 +1409,23 @@ def _update_request_uri_query(self, request): query parameters on the request the parameters in the URI will appear after the existing parameters """ - if '?' in request.path: - request.path, _, query_string = request.path.partition('?') + if "?" in request.path: + request.path, _, query_string = request.path.partition("?") if query_string: - query_params = query_string.split('&') + query_params = query_string.split("&") for query in query_params: - if '=' in query: - name, _, value = query.partition('=') + if "=" in query: + name, _, value = query.partition("=") request.query.append((name, value)) - request.path = url_quote(request.path, '/()$=\',') + request.path = url_quote(request.path, "/()$=',") # add encoded queries to request.path. if request.query: - request.path += '?' + request.path += "?" for name, value in request.query: if value is not None: - request.path += '%s=%s%s' % ( - name, - url_quote(value, '/()$=\','), - '&' - ) + request.path += "{}={}{}".format(name, url_quote(value, "/()$=',"), "&") request.path = request.path[:-1] return request.path, request.query @@ -1298,19 +1435,19 @@ def _update_management_header(self, request): Add additional headers for management. """ - if request.method in ['PUT', 'POST', 'MERGE', 'DELETE']: - request.headers['Content-Length'] = str(len(request.body)) + if request.method in ["PUT", "POST", "MERGE", "DELETE"]: + request.headers["Content-Length"] = str(len(request.body)) # append additional headers base on the service # request.headers.append(('x-ms-version', X_MS_VERSION)) # if it is not GET or HEAD request, must set content-type. - if request.method not in ['GET', 'HEAD']: + if request.method not in ["GET", "HEAD"]: for key in request.headers: - if 'content-type' == key.lower(): + if "content-type" == key.lower(): break else: - request.headers['Content-Type'] = 'application/xml' + request.headers["Content-Type"] = "application/xml" return request.headers @@ -1320,10 +1457,7 @@ def _parse_response(self, response, return_type): return_type. """ - return self._parse_response_body_from_xml_text( - response=response, - return_type=return_type - ) + return self._parse_response_body_from_xml_text(response=response, return_type=return_type) def _parse_response_body_from_xml_text(self, response, return_type): """ @@ -1343,8 +1477,11 @@ def _parse_response_body_from_xml_text(self, response, return_type): return return_obj def _get_child_nodes(self, node, tag_name): - return [childNode for childNode in node.getElementsByTagName(tag_name) - if childNode.parentNode == node] + return [ + childNode + for childNode in node.getElementsByTagName(tag_name) + if childNode.parentNode == node + ] def _fill_data_to_return_object(self, node, return_obj): members = dict(vars(return_obj)) @@ -1353,11 +1490,7 @@ def _fill_data_to_return_object(self, node, return_obj): setattr( return_obj, name, - self._fill_list_of( - node, - value.list_type, - value.xml_element_name - ) + self._fill_list_of(node, value.list_type, value.xml_element_name), ) elif isinstance(value, ScalarListOf): setattr( @@ -1367,8 +1500,8 @@ def _fill_data_to_return_object(self, node, return_obj): node, value.list_type, self._get_serialization_name(name), - value.xml_element_name - ) + value.xml_element_name, + ), ) elif isinstance(value, _DictOf): setattr( @@ -1379,26 +1512,23 @@ def _fill_data_to_return_object(self, node, return_obj): self._get_serialization_name(name), value.pair_xml_element_name, value.key_xml_element_name, - value.value_xml_element_name - ) + value.value_xml_element_name, + ), ) elif isinstance(value, WindowsAzureData): setattr( return_obj, name, - self._fill_instance_child(node, name, value.__class__) + self._fill_instance_child(node, name, value.__class__), ) elif isinstance(value, dict): setattr( return_obj, name, - self._fill_dict( - node, - self._get_serialization_name(name) - ) + self._fill_dict(node, self._get_serialization_name(name)), ) elif isinstance(value, _Base64String): - value = self._fill_data_minidom(node, name, '') + value = self._fill_data_minidom(node, name, "") if value is not None: value = self._decode_base64_to_text(value) # always set the attribute, @@ -1426,29 +1556,19 @@ def _parse_response_body_from_xml_node(self, node, return_type): return return_obj - def _fill_scalar_list_of(self, - xmldoc, - element_type, - parent_xml_element_name, - xml_element_name): + def _fill_scalar_list_of(self, xmldoc, element_type, parent_xml_element_name, xml_element_name): xmlelements = self._get_child_nodes(xmldoc, parent_xml_element_name) if xmlelements: - xmlelements = self._get_child_nodes( - xmlelements[0], - xml_element_name - ) - return [ - self._get_node_value(xmlelement, element_type) - for xmlelement in xmlelements - ] + xmlelements = self._get_child_nodes(xmlelements[0], xml_element_name) + return [self._get_node_value(xmlelement, element_type) for xmlelement in xmlelements] def _get_node_value(self, xmlelement, data_type): value = xmlelement.firstChild.nodeValue if data_type is datetime: return self._to_datetime(value) elif data_type is bool: - return value.lower() != 'false' + return value.lower() != "false" else: return data_type(value) @@ -1461,30 +1581,32 @@ def _get_serialization_name(self, element_name): if known is not None: return known - if element_name.startswith('x_ms_'): - return element_name.replace('_', '-') + if element_name.startswith("x_ms_"): + return element_name.replace("_", "-") - if element_name.endswith('_id'): - element_name = element_name.replace('_id', 'ID') + if element_name.endswith("_id"): + element_name = element_name.replace("_id", "ID") - for name in ['content_', 'last_modified', 'if_', 'cache_control']: + for name in ["content_", "last_modified", "if_", "cache_control"]: if element_name.startswith(name): - element_name = element_name.replace('_', '-_') - - return ''.join(name.capitalize() for name in element_name.split('_')) - - def _fill_dict_of(self, xmldoc, parent_xml_element_name, - pair_xml_element_name, key_xml_element_name, - value_xml_element_name): + element_name = element_name.replace("_", "-_") + + return "".join(name.capitalize() for name in element_name.split("_")) + + def _fill_dict_of( + self, + xmldoc, + parent_xml_element_name, + pair_xml_element_name, + key_xml_element_name, + value_xml_element_name, + ): return_obj = {} xmlelements = self._get_child_nodes(xmldoc, parent_xml_element_name) if xmlelements: - xmlelements = self._get_child_nodes( - xmlelements[0], - pair_xml_element_name - ) + xmlelements = self._get_child_nodes(xmlelements[0], pair_xml_element_name) for pair in xmlelements: keys = self._get_child_nodes(pair, key_xml_element_name) values = self._get_child_nodes(pair, value_xml_element_name) @@ -1499,10 +1621,7 @@ def _fill_instance_child(self, xmldoc, element_name, return_type): """ Converts a child of the current dom element to the specified type. """ - xmlelements = self._get_child_nodes( - xmldoc, - self._get_serialization_name(element_name) - ) + xmlelements = self._get_child_nodes(xmldoc, self._get_serialization_name(element_name)) if not xmlelements: return None @@ -1524,24 +1643,21 @@ def _fill_dict(self, xmldoc, element_name): def _encode_base64(self, data): if isinstance(data, _unicode_type): - data = data.encode('utf-8') + data = data.encode("utf-8") encoded = base64.b64encode(data) - return encoded.decode('utf-8') + return encoded.decode("utf-8") def _decode_base64_to_bytes(self, data): if isinstance(data, _unicode_type): - data = data.encode('utf-8') + data = data.encode("utf-8") return base64.b64decode(data) def _decode_base64_to_text(self, data): decoded_bytes = self._decode_base64_to_bytes(data) - return decoded_bytes.decode('utf-8') + return decoded_bytes.decode("utf-8") def _fill_data_minidom(self, xmldoc, element_name, data_member): - xmlelements = self._get_child_nodes( - xmldoc, - self._get_serialization_name(element_name) - ) + xmlelements = self._get_child_nodes(xmldoc, self._get_serialization_name(element_name)) if not xmlelements or not xmlelements[0].childNodes: return None @@ -1553,7 +1669,7 @@ def _fill_data_minidom(self, xmldoc, element_name, data_member): elif isinstance(data_member, datetime): return self._to_datetime(value) elif type(data_member) is bool: - return value.lower() != 'false' + return value.lower() != "false" elif type(data_member) is str: return _real_unicode(value) else: @@ -1564,7 +1680,7 @@ def _to_datetime(self, strtime): def _get_request_body(self, request_body): if request_body is None: - return b'' + return b"" if isinstance(request_body, WindowsAzureData): request_body = self._convert_class_to_xml(request_body) @@ -1573,11 +1689,11 @@ def _get_request_body(self, request_body): return request_body if isinstance(request_body, _unicode_type): - return request_body.encode('utf-8') + return request_body.encode("utf-8") request_body = str(request_body) if isinstance(request_body, _unicode_type): - return request_body.encode('utf-8') + return request_body.encode("utf-8") return request_body @@ -1585,7 +1701,7 @@ def _convert_class_to_xml(self, source, xml_prefix=True): root = ET.Element() doc = self._construct_element_tree(source, root) - result = ensure_string(ET.tostring(doc, encoding='utf8', method='xml')) + result = ensure_string(ET.tostring(doc, encoding="utf-8", method="xml")) return result def _construct_element_tree(self, source, etree): @@ -1602,11 +1718,8 @@ def _construct_element_tree(self, source, etree): for name, value in vars(source).items(): if value is not None: - if (isinstance(value, list) or - isinstance(value, WindowsAzureData)): - etree.append( - self._construct_element_tree(value, etree) - ) + if isinstance(value, list) or isinstance(value, WindowsAzureData): + etree.append(self._construct_element_tree(value, etree)) else: ele = ET.Element(self._get_serialization_name(name)) ele.text = xml_escape(str(value)) @@ -1622,63 +1735,54 @@ def _parse_response_for_async_op(self, response): result = AsynchronousOperationResult() if response.headers: for name, value in response.headers.items(): - if name.lower() == 'x-ms-request-id': + if name.lower() == "x-ms-request-id": result.request_id = value return result - def _get_deployment_path_using_name(self, service_name, - deployment_name=None): - components = [ - 'services/hostedservices/', - _str(service_name), - '/deployments' - ] - resource = ''.join(components) + def _get_deployment_path_using_name(self, service_name, deployment_name=None): + components = ["services/hostedservices/", _str(service_name), "/deployments"] + resource = "".join(components) return self._get_path(resource, deployment_name) def _get_path(self, resource, name): - path = '/' + self.subscription_id + '/' + resource + path = "/" + self.subscription_id + "/" + resource if name is not None: - path += '/' + _str(name) + path += "/" + _str(name) return path def _get_image_path(self, image_name=None): - return self._get_path('services/images', image_name) + return self._get_path("services/images", image_name) def _get_vmimage_path(self, image_name=None): - return self._get_path('services/vmimages', image_name) + return self._get_path("services/vmimages", image_name) def _get_hosted_service_path(self, service_name=None): - return self._get_path('services/hostedservices', service_name) + return self._get_path("services/hostedservices", service_name) def _get_deployment_path_using_slot(self, service_name, slot=None): return self._get_path( - 'services/hostedservices/%s/deploymentslots' % ( - _str(service_name) - ), - slot + "services/hostedservices/%s/deploymentslots" % (_str(service_name)), slot ) def _get_disk_path(self, disk_name=None): - return self._get_path('services/disks', disk_name) + return self._get_path("services/disks", disk_name) def _get_role_path(self, service_name, deployment_name, role_name=None): components = [ - 'services/hostedservices/', + "services/hostedservices/", _str(service_name), - '/deployments/', + "/deployments/", deployment_name, - '/roles' + "/roles", ] - resource = ''.join(components) + resource = "".join(components) return self._get_path(resource, role_name) def _get_storage_service_path(self, service_name=None): - return self._get_path('services/storageservices', service_name) + return self._get_path("services/storageservices", service_name) - def _ex_complete_async_azure_operation(self, response=None, - operation_type='create_node'): + def _ex_complete_async_azure_operation(self, response=None, operation_type="create_node"): request_id = self._parse_response_for_async_op(response) operation_status = self._get_operation_status(request_id.request_id) @@ -1694,19 +1798,19 @@ def _ex_complete_async_azure_operation(self, response=None, waittime += interval time.sleep(interval) - if operation_status.status == 'Failed': + if operation_status.status == "Failed": raise LibcloudError( - 'Message: Async request for operation %s has failed' % - operation_type, - driver=self.connection.driver + "Message: Async request for operation %s has failed" % operation_type, + driver=self.connection.driver, ) def raise_for_response(self, response, valid_response): if response.status != valid_response: values = (response.error, response.body, response.status) - message = 'Message: %s, Body: %s, Status code: %s' % (values) + message = "Message: %s, Body: %s, Status code: %s" % (values) raise LibcloudError(message, driver=self) + """ XML Serializer @@ -1720,379 +1824,359 @@ def _lower(text): return text.lower() -class AzureXmlSerializer(object): - +class AzureXmlSerializer: @staticmethod - def create_storage_service_input_to_xml(service_name, - description, - label, - affinity_group, - location, - geo_replication_enabled, - extended_properties): + def create_storage_service_input_to_xml( + service_name, + description, + label, + affinity_group, + location, + geo_replication_enabled, + extended_properties, + ): return AzureXmlSerializer.doc_from_data( - 'CreateStorageServiceInput', + "CreateStorageServiceInput", [ - ('ServiceName', service_name), - ('Description', description), - ('Label', label), - ('AffinityGroup', affinity_group), - ('Location', location), - ('GeoReplicationEnabled', geo_replication_enabled, _lower) + ("ServiceName", service_name), + ("Description", description), + ("Label", label), + ("AffinityGroup", affinity_group), + ("Location", location), + ("GeoReplicationEnabled", geo_replication_enabled, _lower), ], - extended_properties + extended_properties, ) @staticmethod - def update_storage_service_input_to_xml(description, - label, - geo_replication_enabled, - extended_properties): + def update_storage_service_input_to_xml( + description, label, geo_replication_enabled, extended_properties + ): return AzureXmlSerializer.doc_from_data( - 'UpdateStorageServiceInput', + "UpdateStorageServiceInput", [ - ('Description', description), - ('Label', label, AzureNodeDriver._encode_base64), - ('GeoReplicationEnabled', geo_replication_enabled, _lower) + ("Description", description), + ("Label", label, AzureNodeDriver._encode_base64), + ("GeoReplicationEnabled", geo_replication_enabled, _lower), ], - extended_properties + extended_properties, ) @staticmethod def regenerate_keys_to_xml(key_type): - return AzureXmlSerializer.doc_from_data( - 'RegenerateKeys', - [('KeyType', key_type)] - ) + return AzureXmlSerializer.doc_from_data("RegenerateKeys", [("KeyType", key_type)]) @staticmethod def update_hosted_service_to_xml(label, description, extended_properties): return AzureXmlSerializer.doc_from_data( - 'UpdateHostedService', + "UpdateHostedService", [ - ('Label', label, AzureNodeDriver._encode_base64), - ('Description', description) + ("Label", label, AzureNodeDriver._encode_base64), + ("Description", description), ], - extended_properties + extended_properties, ) @staticmethod - def create_hosted_service_to_xml(service_name, - label, - description, - location, - affinity_group, - extended_properties): + def create_hosted_service_to_xml( + service_name, + label, + description, + location, + affinity_group=None, + extended_properties=None, + ): + if affinity_group: + return AzureXmlSerializer.doc_from_data( + "CreateHostedService", + [ + ("ServiceName", service_name), + ("Label", label), + ("Description", description), + ("AffinityGroup", affinity_group), + ], + extended_properties, + ) + return AzureXmlSerializer.doc_from_data( - 'CreateHostedService', + "CreateHostedService", [ - ('ServiceName', service_name), - ('Label', label), - ('Description', description), - ('Location', location), - ('AffinityGroup', affinity_group) + ("ServiceName", service_name), + ("Label", label), + ("Description", description), + ("Location", location), ], - extended_properties + extended_properties, ) @staticmethod - def create_deployment_to_xml(name, - package_url, - label, - configuration, - start_deployment, - treat_warnings_as_error, - extended_properties): + def create_storage_service_to_xml( + service_name, + label, + description, + location, + affinity_group, + extended_properties=None, + ): return AzureXmlSerializer.doc_from_data( - 'CreateDeployment', + "CreateStorageServiceInput", [ - ('Name', name), - ('PackageUrl', package_url), - ('Label', label, AzureNodeDriver._encode_base64), - ('Configuration', configuration), - ('StartDeployment', start_deployment, _lower), - ('TreatWarningsAsError', treat_warnings_as_error, _lower) + ("ServiceName", service_name), + ("Label", label), + ("Description", description), + ("Location", location), + ("AffinityGroup", affinity_group), ], - extended_properties + extended_properties, ) @staticmethod - def swap_deployment_to_xml(production, source_deployment): + def create_deployment_to_xml( + name, + package_url, + label, + configuration, + start_deployment, + treat_warnings_as_error, + extended_properties, + ): return AzureXmlSerializer.doc_from_data( - 'Swap', + "CreateDeployment", [ - ('Production', production), - ('SourceDeployment', source_deployment) - ] + ("Name", name), + ("PackageUrl", package_url), + ("Label", label, AzureNodeDriver._encode_base64), + ("Configuration", configuration), + ("StartDeployment", start_deployment, _lower), + ("TreatWarningsAsError", treat_warnings_as_error, _lower), + ], + extended_properties, ) @staticmethod - def update_deployment_status_to_xml(status): + def swap_deployment_to_xml(production, source_deployment): return AzureXmlSerializer.doc_from_data( - 'UpdateDeploymentStatus', - [('Status', status)] + "Swap", + [("Production", production), ("SourceDeployment", source_deployment)], ) @staticmethod - def change_deployment_to_xml(configuration, - treat_warnings_as_error, - mode, - extended_properties): + def update_deployment_status_to_xml(status): + return AzureXmlSerializer.doc_from_data("UpdateDeploymentStatus", [("Status", status)]) + + @staticmethod + def change_deployment_to_xml(configuration, treat_warnings_as_error, mode, extended_properties): return AzureXmlSerializer.doc_from_data( - 'ChangeConfiguration', + "ChangeConfiguration", [ - ('Configuration', configuration), - ('TreatWarningsAsError', treat_warnings_as_error, _lower), - ('Mode', mode) + ("Configuration", configuration), + ("TreatWarningsAsError", treat_warnings_as_error, _lower), + ("Mode", mode), ], - extended_properties + extended_properties, ) @staticmethod - def upgrade_deployment_to_xml(mode, - package_url, - configuration, - label, - role_to_upgrade, - force, - extended_properties): + def upgrade_deployment_to_xml( + mode, + package_url, + configuration, + label, + role_to_upgrade, + force, + extended_properties, + ): return AzureXmlSerializer.doc_from_data( - 'UpgradeDeployment', + "UpgradeDeployment", [ - ('Mode', mode), - ('PackageUrl', package_url), - ('Configuration', configuration), - ('Label', label, AzureNodeDriver._encode_base64), - ('RoleToUpgrade', role_to_upgrade), - ('Force', force, _lower) + ("Mode", mode), + ("PackageUrl", package_url), + ("Configuration", configuration), + ("Label", label, AzureNodeDriver._encode_base64), + ("RoleToUpgrade", role_to_upgrade), + ("Force", force, _lower), ], - extended_properties + extended_properties, ) @staticmethod def rollback_upgrade_to_xml(mode, force): return AzureXmlSerializer.doc_from_data( - 'RollbackUpdateOrUpgrade', - [ - ('Mode', mode), - ('Force', force, _lower) - ] + "RollbackUpdateOrUpgrade", [("Mode", mode), ("Force", force, _lower)] ) @staticmethod def walk_upgrade_domain_to_xml(upgrade_domain): return AzureXmlSerializer.doc_from_data( - 'WalkUpgradeDomain', - [('UpgradeDomain', upgrade_domain)] + "WalkUpgradeDomain", [("UpgradeDomain", upgrade_domain)] ) @staticmethod def certificate_file_to_xml(data, certificate_format, password): return AzureXmlSerializer.doc_from_data( - 'CertificateFile', + "CertificateFile", [ - ('Data', data), - ('CertificateFormat', certificate_format), - ('Password', password) - ] + ("Data", data), + ("CertificateFormat", certificate_format), + ("Password", password), + ], ) @staticmethod def create_affinity_group_to_xml(name, label, description, location): return AzureXmlSerializer.doc_from_data( - 'CreateAffinityGroup', + "CreateAffinityGroup", [ - ('Name', name), - ('Label', label, AzureNodeDriver._encode_base64), - ('Description', description), - ('Location', location) - ] + ("Name", name), + ("Label", label, AzureNodeDriver._encode_base64), + ("Description", description), + ("Location", location), + ], ) @staticmethod def update_affinity_group_to_xml(label, description): return AzureXmlSerializer.doc_from_data( - 'UpdateAffinityGroup', + "UpdateAffinityGroup", [ - ('Label', label, AzureNodeDriver._encode_base64), - ('Description', description) - ] + ("Label", label, AzureNodeDriver._encode_base64), + ("Description", description), + ], ) @staticmethod def subscription_certificate_to_xml(public_key, thumbprint, data): return AzureXmlSerializer.doc_from_data( - 'SubscriptionCertificate', + "SubscriptionCertificate", [ - ('SubscriptionCertificatePublicKey', public_key), - ('SubscriptionCertificateThumbprint', thumbprint), - ('SubscriptionCertificateData', data) - ] + ("SubscriptionCertificatePublicKey", public_key), + ("SubscriptionCertificateThumbprint", thumbprint), + ("SubscriptionCertificateData", data), + ], ) @staticmethod def os_image_to_xml(label, media_link, name, os): return AzureXmlSerializer.doc_from_data( - 'OSImage', - [ - ('Label', label), - ('MediaLink', media_link), - ('Name', name), - ('OS', os) - ] + "OSImage", + [("Label", label), ("MediaLink", media_link), ("Name", name), ("OS", os)], ) @staticmethod - def data_virtual_hard_disk_to_xml(host_caching, - disk_label, - disk_name, - lun, - logical_disk_size_in_gb, - media_link, - source_media_link): + def data_virtual_hard_disk_to_xml( + host_caching, + disk_label, + disk_name, + lun, + logical_disk_size_in_gb, + media_link, + source_media_link, + ): return AzureXmlSerializer.doc_from_data( - 'DataVirtualHardDisk', + "DataVirtualHardDisk", [ - ('HostCaching', host_caching), - ('DiskLabel', disk_label), - ('DiskName', disk_name), - ('Lun', lun), - ('LogicalDiskSizeInGB', logical_disk_size_in_gb), - ('MediaLink', media_link), - ('SourceMediaLink', source_media_link) - ] + ("HostCaching", host_caching), + ("DiskLabel", disk_label), + ("DiskName", disk_name), + ("Lun", lun), + ("LogicalDiskSizeInGB", logical_disk_size_in_gb), + ("MediaLink", media_link), + ("SourceMediaLink", source_media_link), + ], ) @staticmethod def disk_to_xml(has_operating_system, label, media_link, name, os): return AzureXmlSerializer.doc_from_data( - 'Disk', + "Disk", [ - ('HasOperatingSystem', has_operating_system, _lower), - ('Label', label), - ('MediaLink', media_link), - ('Name', name), - ('OS', os) - ] + ("HasOperatingSystem", has_operating_system, _lower), + ("Label", label), + ("MediaLink", media_link), + ("Name", name), + ("OS", os), + ], ) @staticmethod def restart_role_operation_to_xml(): xml = ET.Element("OperationType") xml.text = "RestartRoleOperation" - doc = AzureXmlSerializer.doc_from_xml( - 'RestartRoleOperation', - xml - ) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + doc = AzureXmlSerializer.doc_from_xml("RestartRoleOperation", xml) + result = ensure_string(ET.tostring(doc, encoding="utf-8")) return result @staticmethod def shutdown_role_operation_to_xml(): xml = ET.Element("OperationType") xml.text = "ShutdownRoleOperation" - doc = AzureXmlSerializer.doc_from_xml( - 'ShutdownRoleOperation', - xml - ) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + doc = AzureXmlSerializer.doc_from_xml("ShutdownRoleOperation", xml) + result = ensure_string(ET.tostring(doc, encoding="utf-8")) return result @staticmethod def start_role_operation_to_xml(): xml = ET.Element("OperationType") xml.text = "StartRoleOperation" - doc = AzureXmlSerializer.doc_from_xml( - 'StartRoleOperation', - xml - ) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + doc = AzureXmlSerializer.doc_from_xml("StartRoleOperation", xml) + result = ensure_string(ET.tostring(doc, encoding="utf-8")) return result @staticmethod def windows_configuration_to_xml(configuration, xml): AzureXmlSerializer.data_to_xml( - [('ConfigurationSetType', configuration.configuration_set_type)], - xml - ) - AzureXmlSerializer.data_to_xml( - [('ComputerName', configuration.computer_name)], - xml - ) - AzureXmlSerializer.data_to_xml( - [('AdminPassword', configuration.admin_password)], - xml + [("ConfigurationSetType", configuration.configuration_set_type)], xml ) + AzureXmlSerializer.data_to_xml([("ComputerName", configuration.computer_name)], xml) + AzureXmlSerializer.data_to_xml([("AdminPassword", configuration.admin_password)], xml) AzureXmlSerializer.data_to_xml( [ ( - 'ResetPasswordOnFirstLogon', + "ResetPasswordOnFirstLogon", configuration.reset_password_on_first_logon, - _lower + _lower, ) ], - xml + xml, ) AzureXmlSerializer.data_to_xml( [ ( - 'EnableAutomaticUpdates', + "EnableAutomaticUpdates", configuration.enable_automatic_updates, - _lower + _lower, ) ], - xml + xml, ) - AzureXmlSerializer.data_to_xml( - [('TimeZone', configuration.time_zone)], - xml - ) + AzureXmlSerializer.data_to_xml([("TimeZone", configuration.time_zone)], xml) if configuration.domain_join is not None: - domain = ET.xml("DomainJoin") - creds = ET.xml("Credentials") + domain = ET.xml("DomainJoin") # pylint: disable=no-member + creds = ET.xml("Credentials") # pylint: disable=no-member domain.appemnd(creds) xml.append(domain) AzureXmlSerializer.data_to_xml( - [('Domain', configuration.domain_join.credentials.domain)], - creds + [("Domain", configuration.domain_join.credentials.domain)], creds ) AzureXmlSerializer.data_to_xml( - [ - ( - 'Username', - configuration.domain_join.credentials.username - ) - ], - creds + [("Username", configuration.domain_join.credentials.username)], creds ) AzureXmlSerializer.data_to_xml( - [ - ( - 'Password', - configuration.domain_join.credentials.password - ) - ], - creds + [("Password", configuration.domain_join.credentials.password)], creds ) AzureXmlSerializer.data_to_xml( - [('JoinDomain', configuration.domain_join.join_domain)], - domain + [("JoinDomain", configuration.domain_join.join_domain)], domain ) AzureXmlSerializer.data_to_xml( - [ - ( - 'MachineObjectOU', - configuration.domain_join.machine_object_ou - ) - ], - domain + [("MachineObjectOU", configuration.domain_join.machine_object_ou)], + domain, ) if configuration.stored_certificate_settings is not None: @@ -2102,51 +2186,32 @@ def windows_configuration_to_xml(configuration, xml): cert_setting = ET.Element("CertificateSetting") cert_settings.append(cert_setting) - cert_setting.append(AzureXmlSerializer.data_to_xml( - [('StoreLocation', cert.store_location)]) - ) - AzureXmlSerializer.data_to_xml( - [('StoreName', cert.store_name)], - cert_setting - ) - AzureXmlSerializer.data_to_xml( - [('Thumbprint', cert.thumbprint)], - cert_setting + cert_setting.append( + AzureXmlSerializer.data_to_xml([("StoreLocation", cert.store_location)]) ) + AzureXmlSerializer.data_to_xml([("StoreName", cert.store_name)], cert_setting) + AzureXmlSerializer.data_to_xml([("Thumbprint", cert.thumbprint)], cert_setting) - AzureXmlSerializer.data_to_xml( - [('AdminUsername', configuration.admin_user_name)], - xml - ) + AzureXmlSerializer.data_to_xml([("AdminUsername", configuration.admin_user_name)], xml) return xml @staticmethod def linux_configuration_to_xml(configuration, xml): AzureXmlSerializer.data_to_xml( - [('ConfigurationSetType', configuration.configuration_set_type)], - xml - ) - AzureXmlSerializer.data_to_xml( - [('HostName', configuration.host_name)], - xml - ) - AzureXmlSerializer.data_to_xml( - [('UserName', configuration.user_name)], - xml - ) - AzureXmlSerializer.data_to_xml( - [('UserPassword', configuration.user_password)], - xml + [("ConfigurationSetType", configuration.configuration_set_type)], xml ) + AzureXmlSerializer.data_to_xml([("HostName", configuration.host_name)], xml) + AzureXmlSerializer.data_to_xml([("UserName", configuration.user_name)], xml) + AzureXmlSerializer.data_to_xml([("UserPassword", configuration.user_password)], xml) AzureXmlSerializer.data_to_xml( [ ( - 'DisableSshPasswordAuthentication', + "DisableSshPasswordAuthentication", configuration.disable_ssh_password_authentication, - _lower + _lower, ) ], - xml + xml, ) if configuration.ssh is not None: @@ -2160,28 +2225,24 @@ def linux_configuration_to_xml(configuration, xml): for key in configuration.ssh.public_keys: pkey = ET.Element("PublicKey") pkeys.append(pkey) - AzureXmlSerializer.data_to_xml( - [('Fingerprint', key.fingerprint)], - pkey - ) - AzureXmlSerializer.data_to_xml([('Path', key.path)], pkey) + AzureXmlSerializer.data_to_xml([("Fingerprint", key.fingerprint)], pkey) + AzureXmlSerializer.data_to_xml([("Path", key.path)], pkey) for key in configuration.ssh.key_pairs: kpair = ET.Element("KeyPair") kpairs.append(kpair) - AzureXmlSerializer.data_to_xml( - [('Fingerprint', key.fingerprint)], - kpair - ) - AzureXmlSerializer.data_to_xml([('Path', key.path)], kpair) + AzureXmlSerializer.data_to_xml([("Fingerprint", key.fingerprint)], kpair) + AzureXmlSerializer.data_to_xml([("Path", key.path)], kpair) + + if configuration.custom_data is not None: + AzureXmlSerializer.data_to_xml([("CustomData", configuration.custom_data)], xml) return xml @staticmethod def network_configuration_to_xml(configuration, xml): AzureXmlSerializer.data_to_xml( - [('ConfigurationSetType', configuration.configuration_set_type)], - xml + [("ConfigurationSetType", configuration.configuration_set_type)], xml ) input_endpoints = ET.Element("InputEndpoints") @@ -2194,84 +2255,69 @@ def network_configuration_to_xml(configuration, xml): AzureXmlSerializer.data_to_xml( [ ( - 'LoadBalancedEndpointSetName', - endpoint.load_balanced_endpoint_set_name + "LoadBalancedEndpointSetName", + endpoint.load_balanced_endpoint_set_name, ) ], - input_endpoint + input_endpoint, ) - AzureXmlSerializer.data_to_xml( - [('LocalPort', endpoint.local_port)], - input_endpoint - ) - AzureXmlSerializer.data_to_xml( - [('Name', endpoint.name)], - input_endpoint - ) - AzureXmlSerializer.data_to_xml( - [('Port', endpoint.port)], - input_endpoint - ) - - if (endpoint.load_balancer_probe.path or - endpoint.load_balancer_probe.port or - endpoint.load_balancer_probe.protocol): + AzureXmlSerializer.data_to_xml([("LocalPort", endpoint.local_port)], input_endpoint) + AzureXmlSerializer.data_to_xml([("Name", endpoint.name)], input_endpoint) + AzureXmlSerializer.data_to_xml([("Port", endpoint.port)], input_endpoint) + if ( + endpoint.load_balancer_probe.path + or endpoint.load_balancer_probe.port + or endpoint.load_balancer_probe.protocol + ): load_balancer_probe = ET.Element("LoadBalancerProbe") input_endpoint.append(load_balancer_probe) AzureXmlSerializer.data_to_xml( - [('Path', endpoint.load_balancer_probe.path)], - load_balancer_probe + [("Path", endpoint.load_balancer_probe.path)], load_balancer_probe ) AzureXmlSerializer.data_to_xml( - [('Port', endpoint.load_balancer_probe.port)], - load_balancer_probe + [("Port", endpoint.load_balancer_probe.port)], load_balancer_probe ) AzureXmlSerializer.data_to_xml( - [('Protocol', endpoint.load_balancer_probe.protocol)], - load_balancer_probe + [("Protocol", endpoint.load_balancer_probe.protocol)], + load_balancer_probe, ) - AzureXmlSerializer.data_to_xml( - [('Protocol', endpoint.protocol)], - input_endpoint - ) + AzureXmlSerializer.data_to_xml([("Protocol", endpoint.protocol)], input_endpoint) AzureXmlSerializer.data_to_xml( [ ( - 'EnableDirectServerReturn', + "EnableDirectServerReturn", endpoint.enable_direct_server_return, - _lower + _lower, ) ], - input_endpoint + input_endpoint, ) subnet_names = ET.Element("SubnetNames") xml.append(subnet_names) for name in configuration.subnet_names: - AzureXmlSerializer.data_to_xml( - [('SubnetName', name)], - subnet_names - ) + AzureXmlSerializer.data_to_xml([("SubnetName", name)], subnet_names) return xml @staticmethod - def role_to_xml(availability_set_name, - data_virtual_hard_disks, - network_configuration_set, - os_virtual_hard_disk, - vm_image_name, - role_name, - role_size, - role_type, - system_configuration_set, - xml): - - AzureXmlSerializer.data_to_xml([('RoleName', role_name)], xml) - AzureXmlSerializer.data_to_xml([('RoleType', role_type)], xml) + def role_to_xml( + availability_set_name, + data_virtual_hard_disks, + network_configuration_set, + os_virtual_hard_disk, + vm_image_name, + role_name, + role_size, + role_type, + system_configuration_set, + xml, + ): + AzureXmlSerializer.data_to_xml([("RoleName", role_name)], xml) + AzureXmlSerializer.data_to_xml([("RoleType", role_type)], xml) config_sets = ET.Element("ConfigurationSets") xml.append(config_sets) @@ -2282,29 +2328,19 @@ def role_to_xml(availability_set_name, if isinstance(system_configuration_set, WindowsConfigurationSet): AzureXmlSerializer.windows_configuration_to_xml( - system_configuration_set, - config_set + system_configuration_set, config_set ) elif isinstance(system_configuration_set, LinuxConfigurationSet): - AzureXmlSerializer.linux_configuration_to_xml( - system_configuration_set, - config_set - ) + AzureXmlSerializer.linux_configuration_to_xml(system_configuration_set, config_set) if network_configuration_set is not None: config_set = ET.Element("ConfigurationSet") config_sets.append(config_set) - AzureXmlSerializer.network_configuration_to_xml( - network_configuration_set, - config_set - ) + AzureXmlSerializer.network_configuration_to_xml(network_configuration_set, config_set) if availability_set_name is not None: - AzureXmlSerializer.data_to_xml( - [('AvailabilitySetName', availability_set_name)], - xml - ) + AzureXmlSerializer.data_to_xml([("AvailabilitySetName", availability_set_name)], xml) if data_virtual_hard_disks is not None: vhds = ET.Element("DataVirtualHardDisks") @@ -2313,77 +2349,47 @@ def role_to_xml(availability_set_name, for hd in data_virtual_hard_disks: vhd = ET.Element("DataVirtualHardDisk") vhds.append(vhd) + AzureXmlSerializer.data_to_xml([("HostCaching", hd.host_caching)], vhd) + AzureXmlSerializer.data_to_xml([("DiskLabel", hd.disk_label)], vhd) + AzureXmlSerializer.data_to_xml([("DiskName", hd.disk_name)], vhd) + AzureXmlSerializer.data_to_xml([("Lun", hd.lun)], vhd) AzureXmlSerializer.data_to_xml( - [('HostCaching', hd.host_caching)], - vhd - ) - AzureXmlSerializer.data_to_xml( - [('DiskLabel', hd.disk_label)], - vhd - ) - AzureXmlSerializer.data_to_xml( - [('DiskName', hd.disk_name)], - vhd - ) - AzureXmlSerializer.data_to_xml( - [('Lun', hd.lun)], - vhd - ) - AzureXmlSerializer.data_to_xml( - [('LogicalDiskSizeInGB', hd.logical_disk_size_in_gb)], - vhd - ) - AzureXmlSerializer.data_to_xml( - [('MediaLink', hd.media_link)], - vhd + [("LogicalDiskSizeInGB", hd.logical_disk_size_in_gb)], vhd ) + AzureXmlSerializer.data_to_xml([("MediaLink", hd.media_link)], vhd) if os_virtual_hard_disk is not None: hd = ET.Element("OSVirtualHardDisk") xml.append(hd) + AzureXmlSerializer.data_to_xml([("HostCaching", os_virtual_hard_disk.host_caching)], hd) + AzureXmlSerializer.data_to_xml([("DiskLabel", os_virtual_hard_disk.disk_label)], hd) + AzureXmlSerializer.data_to_xml([("DiskName", os_virtual_hard_disk.disk_name)], hd) + AzureXmlSerializer.data_to_xml([("MediaLink", os_virtual_hard_disk.media_link)], hd) AzureXmlSerializer.data_to_xml( - [('HostCaching', os_virtual_hard_disk.host_caching)], - hd - ) - AzureXmlSerializer.data_to_xml( - [('DiskLabel', os_virtual_hard_disk.disk_label)], - hd - ) - AzureXmlSerializer.data_to_xml( - [('DiskName', os_virtual_hard_disk.disk_name)], - hd - ) - AzureXmlSerializer.data_to_xml( - [('MediaLink', os_virtual_hard_disk.media_link)], - hd - ) - AzureXmlSerializer.data_to_xml( - [('SourceImageName', os_virtual_hard_disk.source_image_name)], - hd + [("SourceImageName", os_virtual_hard_disk.source_image_name)], hd ) if vm_image_name is not None: - AzureXmlSerializer.data_to_xml( - [('VMImageName', vm_image_name)], - xml - ) + AzureXmlSerializer.data_to_xml([("VMImageName", vm_image_name)], xml) if role_size is not None: - AzureXmlSerializer.data_to_xml([('RoleSize', role_size)], xml) + AzureXmlSerializer.data_to_xml([("RoleSize", role_size)], xml) return xml @staticmethod - def add_role_to_xml(role_name, - system_configuration_set, - os_virtual_hard_disk, - role_type, - network_configuration_set, - availability_set_name, - data_virtual_hard_disks, - vm_image_name, - role_size): - doc = AzureXmlSerializer.doc_from_xml('PersistentVMRole') + def add_role_to_xml( + role_name, + system_configuration_set, + os_virtual_hard_disk, + role_type, + network_configuration_set, + availability_set_name, + data_virtual_hard_disks, + vm_image_name, + role_size, + ): + doc = AzureXmlSerializer.doc_from_xml("PersistentVMRole") xml = AzureXmlSerializer.role_to_xml( availability_set_name, data_virtual_hard_disks, @@ -2394,22 +2400,23 @@ def add_role_to_xml(role_name, role_size, role_type, system_configuration_set, - doc + doc, ) - result = ensure_string(ET.tostring(xml, encoding='utf8')) + result = ensure_string(ET.tostring(xml, encoding="utf-8")) return result @staticmethod - def update_role_to_xml(role_name, - os_virtual_hard_disk, - role_type, - network_configuration_set, - availability_set_name, - data_virtual_hard_disks, - vm_image_name, - role_size): - - doc = AzureXmlSerializer.doc_from_xml('PersistentVMRole') + def update_role_to_xml( + role_name, + os_virtual_hard_disk, + role_type, + network_configuration_set, + availability_set_name, + data_virtual_hard_disks, + vm_image_name, + role_size, + ): + doc = AzureXmlSerializer.doc_from_xml("PersistentVMRole") AzureXmlSerializer.role_to_xml( availability_set_name, data_virtual_hard_disks, @@ -2420,24 +2427,21 @@ def update_role_to_xml(role_name, role_size, role_type, None, - doc + doc, ) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + result = ensure_string(ET.tostring(doc, encoding="utf-8")) return result @staticmethod - def capture_role_to_xml(post_capture_action, - target_image_name, - target_image_label, - provisioning_configuration): - xml = AzureXmlSerializer.data_to_xml( - [('OperationType', 'CaptureRoleOperation')] - ) - AzureXmlSerializer.data_to_xml( - [('PostCaptureAction', post_capture_action)], - xml - ) + def capture_role_to_xml( + post_capture_action, + target_image_name, + target_image_label, + provisioning_configuration, + ): + xml = AzureXmlSerializer.data_to_xml([("OperationType", "CaptureRoleOperation")]) + AzureXmlSerializer.data_to_xml([("PostCaptureAction", post_capture_action)], xml) if provisioning_configuration is not None: provisioning_config = ET.Element("ProvisioningConfiguration") @@ -2445,49 +2449,39 @@ def capture_role_to_xml(post_capture_action, if isinstance(provisioning_configuration, WindowsConfigurationSet): AzureXmlSerializer.windows_configuration_to_xml( - provisioning_configuration, - provisioning_config + provisioning_configuration, provisioning_config ) elif isinstance(provisioning_configuration, LinuxConfigurationSet): AzureXmlSerializer.linux_configuration_to_xml( - provisioning_configuration, - provisioning_config + provisioning_configuration, provisioning_config ) - AzureXmlSerializer.data_to_xml( - [('TargetImageLabel', target_image_label)], - xml - ) - AzureXmlSerializer.data_to_xml( - [('TargetImageName', target_image_name)], - xml - ) - doc = AzureXmlSerializer.doc_from_xml('CaptureRoleOperation', xml) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + AzureXmlSerializer.data_to_xml([("TargetImageLabel", target_image_label)], xml) + AzureXmlSerializer.data_to_xml([("TargetImageName", target_image_name)], xml) + doc = AzureXmlSerializer.doc_from_xml("CaptureRoleOperation", xml) + result = ensure_string(ET.tostring(doc, encoding="utf-8")) return result @staticmethod - def virtual_machine_deployment_to_xml(deployment_name, - deployment_slot, - label, - role_name, - system_configuration_set, - os_virtual_hard_disk, - role_type, - network_configuration_set, - availability_set_name, - data_virtual_hard_disks, - role_size, - virtual_network_name, - vm_image_name): - - doc = AzureXmlSerializer.doc_from_xml('Deployment') - AzureXmlSerializer.data_to_xml([('Name', deployment_name)], doc) - AzureXmlSerializer.data_to_xml( - [('DeploymentSlot', deployment_slot)], - doc - ) - AzureXmlSerializer.data_to_xml([('Label', label)], doc) + def virtual_machine_deployment_to_xml( + deployment_name, + deployment_slot, + label, + role_name, + system_configuration_set, + os_virtual_hard_disk, + role_type, + network_configuration_set, + availability_set_name, + data_virtual_hard_disks, + role_size, + virtual_network_name, + vm_image_name, + ): + doc = AzureXmlSerializer.doc_from_xml("Deployment") + AzureXmlSerializer.data_to_xml([("Name", deployment_name)], doc) + AzureXmlSerializer.data_to_xml([("DeploymentSlot", deployment_slot)], doc) + AzureXmlSerializer.data_to_xml([("Label", label)], doc) role_list = ET.Element("RoleList") role = ET.Element("Role") @@ -2504,17 +2498,15 @@ def virtual_machine_deployment_to_xml(deployment_name, role_size, role_type, system_configuration_set, - role + role, ) if virtual_network_name is not None: doc.append( - AzureXmlSerializer.data_to_xml( - [('VirtualNetworkName', virtual_network_name)] - ) + AzureXmlSerializer.data_to_xml([("VirtualNetworkName", virtual_network_name)]) ) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + result = ensure_string(ET.tostring(doc, encoding="utf-8")) return result @staticmethod @@ -2578,17 +2570,14 @@ def doc_from_data(document_element_name, data, extended_properties=None): AzureXmlSerializer.data_to_xml(data, doc) if extended_properties is not None: doc.append( - AzureXmlSerializer.extended_properties_dict_to_xml_fragment( - extended_properties - ) + AzureXmlSerializer.extended_properties_dict_to_xml_fragment(extended_properties) ) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + result = ensure_string(ET.tostring(doc, encoding="utf-8")) return result @staticmethod def extended_properties_dict_to_xml_fragment(extended_properties): - if extended_properties is not None and len(extended_properties) > 0: xml = ET.Element("ExtendedProperties") for key, val in extended_properties.items(): @@ -2604,6 +2593,7 @@ def extended_properties_dict_to_xml_fragment(extended_properties): return xml + """ Data Classes @@ -2611,17 +2601,16 @@ def extended_properties_dict_to_xml_fragment(extended_properties): """ -class WindowsAzureData(object): - +class WindowsAzureData: """ This is the base of data class. It is only used to check whether it is instance or not. """ + pass class WindowsAzureDataTypedList(WindowsAzureData): - list_type = None xml_element_name = None @@ -2639,43 +2628,51 @@ def __getitem__(self, index): class OSVirtualHardDisk(WindowsAzureData): - - def __init__(self, source_image_name=None, media_link=None, - host_caching=None, disk_label=None, disk_name=None): + def __init__( + self, + source_image_name=None, + media_link=None, + host_caching=None, + disk_label=None, + disk_name=None, + ): self.source_image_name = source_image_name self.media_link = media_link self.host_caching = host_caching self.disk_label = disk_label self.disk_name = disk_name - self.os = '' # undocumented, not used when adding a role + self.os = "" # undocumented, not used when adding a role class LinuxConfigurationSet(WindowsAzureData): - - def __init__(self, - host_name=None, - user_name=None, - user_password=None, - disable_ssh_password_authentication=None): - self.configuration_set_type = 'LinuxProvisioningConfiguration' + def __init__( + self, + host_name=None, + user_name=None, + user_password=None, + disable_ssh_password_authentication=None, + custom_data=None, + ): + self.configuration_set_type = "LinuxProvisioningConfiguration" self.host_name = host_name self.user_name = user_name self.user_password = user_password - self.disable_ssh_password_authentication = \ - disable_ssh_password_authentication + self.disable_ssh_password_authentication = disable_ssh_password_authentication self.ssh = SSH() + self.custom_data = custom_data class WindowsConfigurationSet(WindowsAzureData): - - def __init__(self, - computer_name=None, - admin_password=None, - reset_password_on_first_logon=None, - enable_automatic_updates=None, - time_zone=None, - admin_user_name=None): - self.configuration_set_type = 'WindowsProvisioningConfiguration' + def __init__( + self, + computer_name=None, + admin_password=None, + reset_password_on_first_logon=None, + enable_automatic_updates=None, + time_zone=None, + admin_user_name=None, + ): + self.configuration_set_type = "WindowsProvisioningConfiguration" self.computer_name = computer_name self.admin_password = admin_password self.reset_password_on_first_logon = reset_password_on_first_logon @@ -2687,23 +2684,20 @@ def __init__(self, class DomainJoin(WindowsAzureData): - def __init__(self): self.credentials = Credentials() - self.join_domain = '' - self.machine_object_ou = '' + self.join_domain = "" + self.machine_object_ou = "" class Credentials(WindowsAzureData): - def __init__(self): - self.domain = '' - self.username = '' - self.password = '' + self.domain = "" + self.username = "" + self.password = "" class CertificateSetting(WindowsAzureData): - """ Initializes a certificate setting. @@ -2718,7 +2712,7 @@ class CertificateSetting(WindowsAzureData): The only supported value is LocalMachine. """ - def __init__(self, thumbprint='', store_name='', store_location=''): + def __init__(self, thumbprint="", store_name="", store_location=""): self.thumbprint = thumbprint self.store_name = store_name self.store_location = store_location @@ -2727,21 +2721,17 @@ def __init__(self, thumbprint='', store_name='', store_location=''): class StoredCertificateSettings(WindowsAzureDataTypedList): list_type = CertificateSetting - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class SSH(WindowsAzureData): - def __init__(self): self.public_keys = PublicKeys() self.key_pairs = KeyPairs() class PublicKey(WindowsAzureData): - - def __init__(self, fingerprint='', path=''): + def __init__(self, fingerprint="", path=""): self.fingerprint = fingerprint self.path = path @@ -2749,14 +2739,11 @@ def __init__(self, fingerprint='', path=''): class PublicKeys(WindowsAzureDataTypedList): list_type = PublicKey - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class AzureKeyPair(WindowsAzureData): - - def __init__(self, fingerprint='', path=''): + def __init__(self, fingerprint="", path=""): self.fingerprint = fingerprint self.path = path @@ -2764,45 +2751,40 @@ def __init__(self, fingerprint='', path=''): class KeyPairs(WindowsAzureDataTypedList): list_type = AzureKeyPair - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class LoadBalancerProbe(WindowsAzureData): - def __init__(self): - self.path = '' - self.port = '' - self.protocol = '' + self.path = "" + self.port = "" + self.protocol = "" class ConfigurationSet(WindowsAzureData): - def __init__(self): - self.configuration_set_type = '' - self.role_type = '' + self.configuration_set_type = "" + self.role_type = "" self.input_endpoints = ConfigurationSetInputEndpoints() - self.subnet_names = ScalarListOf(str, 'SubnetName') + self.subnet_names = ScalarListOf(str, "SubnetName") class ConfigurationSets(WindowsAzureDataTypedList): list_type = ConfigurationSet - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class ConfigurationSetInputEndpoint(WindowsAzureData): - - def __init__(self, - name='', - protocol='', - port='', - local_port='', - load_balanced_endpoint_set_name='', - enable_direct_server_return=False): + def __init__( + self, + name="", + protocol="", + port="", + local_port="", + load_balanced_endpoint_set_name="", + enable_direct_server_return=False, + ): self.enable_direct_server_return = enable_direct_server_return self.load_balanced_endpoint_set_name = load_balanced_endpoint_set_name self.local_port = local_port @@ -2814,112 +2796,93 @@ def __init__(self, class ConfigurationSetInputEndpoints(WindowsAzureDataTypedList): list_type = ConfigurationSetInputEndpoint - xml_element_name = 'InputEndpoint' + xml_element_name = "InputEndpoint" - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class Location(WindowsAzureData): - def __init__(self): - self.name = '' - self.display_name = '' - self.available_services = ScalarListOf(str, 'AvailableService') + self.name = "" + self.display_name = "" + self.available_services = ScalarListOf(str, "AvailableService") self.compute_capabilities = ComputeCapability() class Locations(WindowsAzureDataTypedList): list_type = Location - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class ComputeCapability(WindowsAzureData): - def __init__(self): - self.virtual_machines_role_sizes = ScalarListOf(str, 'RoleSize') + self.virtual_machines_role_sizes = ScalarListOf(str, "RoleSize") class VirtualMachinesRoleSizes(WindowsAzureData): - def __init__(self): - self.role_size = ScalarListOf(str, 'RoleSize') + self.role_size = ScalarListOf(str, "RoleSize") class OSImage(WindowsAzureData): - def __init__(self): - self.affinity_group = '' - self.category = '' - self.location = '' + self.affinity_group = "" + self.category = "" + self.location = "" self.logical_size_in_gb = 0 - self.label = '' - self.media_link = '' - self.name = '' - self.os = '' - self.eula = '' - self.description = '' + self.label = "" + self.media_link = "" + self.name = "" + self.os = "" + self.eula = "" + self.description = "" class Images(WindowsAzureDataTypedList): list_type = OSImage - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class VMImage(WindowsAzureData): - def __init__(self): - self.name = '' - self.label = '' - self.category = '' + self.name = "" + self.label = "" + self.category = "" self.os_disk_configuration = OSDiskConfiguration() - self.service_name = '' - self.deployment_name = '' - self.role_name = '' - self.location = '' - self.affinity_group = '' + self.service_name = "" + self.deployment_name = "" + self.role_name = "" + self.location = "" + self.affinity_group = "" class VMImages(WindowsAzureDataTypedList): list_type = VMImage - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class VirtualIP(WindowsAzureData): - def __init__(self): - self.address = '' - self.is_dns_programmed = '' - self.name = '' + self.address = "" + self.is_dns_programmed = "" + self.name = "" class VirtualIPs(WindowsAzureDataTypedList): list_type = VirtualIP - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class HostedService(WindowsAzureData, ReprMixin): - _repr_attributes = [ - 'service_name', - 'url' - ] + _repr_attributes = ["service_name", "url"] def __init__(self): - self.url = '' - self.service_name = '' + self.url = "" + self.service_name = "" self.hosted_service_properties = HostedServiceProperties() self.deployments = Deployments() @@ -2927,214 +2890,178 @@ def __init__(self): class HostedServices(WindowsAzureDataTypedList, ReprMixin): list_type = HostedService - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class HostedServiceProperties(WindowsAzureData): - def __init__(self): - self.description = '' - self.location = '' - self.affinity_group = '' + self.description = "" + self.location = "" + self.affinity_group = "" self.label = _Base64String() - self.status = '' - self.date_created = '' - self.date_last_modified = '' - self.extended_properties = _DictOf( - 'ExtendedProperty', - 'Name', - 'Value' - ) + self.status = "" + self.date_created = "" + self.date_last_modified = "" + self.extended_properties = _DictOf("ExtendedProperty", "Name", "Value") class Deployment(WindowsAzureData): - def __init__(self): - self.name = '' - self.deployment_slot = '' - self.private_id = '' - self.status = '' + self.name = "" + self.deployment_slot = "" + self.private_id = "" + self.status = "" self.label = _Base64String() - self.url = '' + self.url = "" self.configuration = _Base64String() self.role_instance_list = RoleInstanceList() self.upgrade_status = UpgradeStatus() - self.upgrade_domain_count = '' + self.upgrade_domain_count = "" self.role_list = RoleList() - self.sdk_version = '' + self.sdk_version = "" self.input_endpoint_list = InputEndpoints() self.locked = False self.rollback_allowed = False self.persistent_vm_downtime_info = PersistentVMDowntimeInfo() - self.created_time = '' - self.last_modified_time = '' - self.extended_properties = _DictOf( - 'ExtendedProperty', - 'Name', - 'Value' - ) + self.created_time = "" + self.last_modified_time = "" + self.extended_properties = _DictOf("ExtendedProperty", "Name", "Value") self.virtual_ips = VirtualIPs() class Deployments(WindowsAzureDataTypedList): list_type = Deployment - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class UpgradeStatus(WindowsAzureData): - def __init__(self): - self.upgrade_type = '' - self.current_upgrade_domain_state = '' - self.current_upgrade_domain = '' + self.upgrade_type = "" + self.current_upgrade_domain_state = "" + self.current_upgrade_domain = "" class RoleInstance(WindowsAzureData): - def __init__(self): - self.role_name = '' - self.instance_name = '' - self.instance_status = '' + self.role_name = "" + self.instance_name = "" + self.instance_status = "" self.instance_upgrade_domain = 0 self.instance_fault_domain = 0 - self.instance_size = '' - self.instance_state_details = '' - self.instance_error_code = '' - self.ip_address = '' + self.instance_size = "" + self.instance_state_details = "" + self.instance_error_code = "" + self.ip_address = "" self.instance_endpoints = InstanceEndpoints() - self.power_state = '' - self.fqdn = '' - self.host_name = '' + self.power_state = "" + self.fqdn = "" + self.host_name = "" class RoleInstanceList(WindowsAzureDataTypedList): list_type = RoleInstance - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class InstanceEndpoint(WindowsAzureData): - def __init__(self): - self.name = '' - self.vip = '' - self.public_port = '' - self.local_port = '' - self.protocol = '' + self.name = "" + self.vip = "" + self.public_port = "" + self.local_port = "" + self.protocol = "" class InstanceEndpoints(WindowsAzureDataTypedList): list_type = InstanceEndpoint - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class InputEndpoint(WindowsAzureData): - def __init__(self): - self.role_name = '' - self.vip = '' - self.port = '' + self.role_name = "" + self.vip = "" + self.port = "" class InputEndpoints(WindowsAzureDataTypedList): list_type = InputEndpoint - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class Role(WindowsAzureData): - def __init__(self): - self.role_name = '' - self.os_version = '' + self.role_name = "" + self.os_version = "" class RoleList(WindowsAzureDataTypedList): list_type = Role - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class PersistentVMDowntimeInfo(WindowsAzureData): - def __init__(self): - self.start_time = '' - self.end_time = '' - self.status = '' + self.start_time = "" + self.end_time = "" + self.status = "" class AsynchronousOperationResult(WindowsAzureData): - def __init__(self, request_id=None): self.request_id = request_id class Disk(WindowsAzureData): - def __init__(self): - self.affinity_group = '' + self.affinity_group = "" self.attached_to = AttachedTo() - self.has_operating_system = '' - self.is_corrupted = '' - self.location = '' + self.has_operating_system = "" + self.is_corrupted = "" + self.location = "" self.logical_disk_size_in_gb = 0 - self.label = '' - self.media_link = '' - self.name = '' - self.os = '' - self.source_image_name = '' + self.label = "" + self.media_link = "" + self.name = "" + self.os = "" + self.source_image_name = "" class Disks(WindowsAzureDataTypedList): list_type = Disk - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class AttachedTo(WindowsAzureData): - def __init__(self): - self.hosted_service_name = '' - self.deployment_name = '' - self.role_name = '' + self.hosted_service_name = "" + self.deployment_name = "" + self.role_name = "" class OperationError(WindowsAzureData): - def __init__(self): - self.code = '' - self.message = '' + self.code = "" + self.message = "" class Operation(WindowsAzureData): - def __init__(self): - self.id = '' - self.status = '' - self.http_status_code = '' + self.id = "" + self.status = "" + self.http_status_code = "" self.error = OperationError() class OperatingSystem(WindowsAzureData): - def __init__(self): - self.version = '' + self.version = "" self.label = _Base64String() self.is_default = True self.is_active = True @@ -3143,28 +3070,24 @@ def __init__(self): class OSDiskConfiguration(WindowsAzureData): - def __init__(self): - self.name = '' - self.host_caching = '' - self.os_state = '' - self.os = '' - self.media_link = '' + self.name = "" + self.host_caching = "" + self.os_state = "" + self.os = "" + self.media_link = "" self.logical_disk_size_in_gb = 0 class OperatingSystems(WindowsAzureDataTypedList): list_type = OperatingSystem - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class OperatingSystemFamily(WindowsAzureData): - def __init__(self): - self.name = '' + self.name = "" self.label = _Base64String() self.operating_systems = OperatingSystems() @@ -3172,19 +3095,16 @@ def __init__(self): class OperatingSystemFamilies(WindowsAzureDataTypedList): list_type = OperatingSystemFamily - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] class Subscription(WindowsAzureData): - def __init__(self): - self.subscription_id = '' - self.subscription_name = '' - self.subscription_status = '' - self.account_admin_live_email_id = '' - self.service_admin_live_email_id = '' + self.subscription_id = "" + self.subscription_name = "" + self.subscription_status = "" + self.account_admin_live_email_id = "" + self.service_admin_live_email_id = "" self.max_core_count = 0 self.max_storage_accounts = 0 self.max_hosted_services = 0 @@ -3197,46 +3117,43 @@ def __init__(self): class AvailabilityResponse(WindowsAzureData): - def __init__(self): self.result = False class SubscriptionCertificate(WindowsAzureData): - def __init__(self): - self.subscription_certificate_public_key = '' - self.subscription_certificate_thumbprint = '' - self.subscription_certificate_data = '' - self.created = '' + self.subscription_certificate_public_key = "" + self.subscription_certificate_thumbprint = "" + self.subscription_certificate_data = "" + self.created = "" class SubscriptionCertificates(WindowsAzureDataTypedList): list_type = SubscriptionCertificate - _repr_attributes = [ - 'items' - ] + _repr_attributes = ["items"] -class AzureHTTPRequest(object): +class AzureHTTPRequest: def __init__(self): - self.host = '' - self.method = '' - self.path = '' - self.query = [] # list of (name, value) - self.headers = {} # list of (header name, header value) - self.body = '' + self.host = "" + self.method = "" + self.path = "" + self.query = [] # list of (name, value) + self.headers = {} # list of (header name, header value) + self.body = "" self.protocol_override = None -class AzureHTTPResponse(object): +class AzureHTTPResponse: def __init__(self, status, message, headers, body): self.status = status self.message = message self.headers = headers self.body = body + """ Helper classes and functions. """ @@ -3247,7 +3164,6 @@ class _Base64String(str): class _ListOf(list): - """ A list which carries with it the type that's expected to go in it. Used for deserializaion and construction of the lists @@ -3259,11 +3175,10 @@ def __init__(self, list_type, xml_element_name=None): self.xml_element_name = list_type.__name__ else: self.xml_element_name = xml_element_name - super(_ListOf, self).__init__() + super().__init__() class ScalarListOf(list): - """ A list of scalar types which carries with it the type that's expected to go in it along with its xml element name. @@ -3273,47 +3188,40 @@ class ScalarListOf(list): def __init__(self, list_type, xml_element_name): self.list_type = list_type self.xml_element_name = xml_element_name - super(ScalarListOf, self).__init__() + super().__init__() class _DictOf(dict): - """ A dict which carries with it the xml element names for key,val. Used for deserializaion and construction of the lists """ - def __init__(self, - pair_xml_element_name, - key_xml_element_name, - value_xml_element_name): + def __init__(self, pair_xml_element_name, key_xml_element_name, value_xml_element_name): self.pair_xml_element_name = pair_xml_element_name self.key_xml_element_name = key_xml_element_name self.value_xml_element_name = value_xml_element_name - super(_DictOf, self).__init__() + super().__init__() class AzureNodeLocation(NodeLocation): # we can also have something in here for available services which is an # extra to the API with Azure - def __init__(self, id, name, country, driver, available_services, - virtual_machine_role_sizes): - super(AzureNodeLocation, self).__init__(id, name, country, driver) + def __init__(self, id, name, country, driver, available_services, virtual_machine_role_sizes): + super().__init__(id, name, country, driver) self.available_services = available_services self.virtual_machine_role_sizes = virtual_machine_role_sizes def __repr__(self): return ( - ( - '' - ) % ( - self.id, - self.name, - self.country, - self.driver.name, - ','.join(self.available_services), - ','.join(self.virtual_machine_role_sizes) - ) + "" + ) % ( + self.id, + self.name, + self.country, + self.driver.name, + ",".join(self.available_services), + ",".join(self.virtual_machine_role_sizes), ) diff --git a/libcloud/compute/drivers/azure_arm.py b/libcloud/compute/drivers/azure_arm.py new file mode 100644 index 0000000000..68868b254e --- /dev/null +++ b/libcloud/compute/drivers/azure_arm.py @@ -0,0 +1,2488 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Driver for Microsoft Azure Resource Manager (ARM) Virtual Machines provider. + +http://azure.microsoft.com/en-us/services/virtual-machines/ +""" + +import os +import time +import base64 +import binascii + +from libcloud.utils import iso8601 +from libcloud.utils.py3 import parse_qs, urlparse, basestring +from libcloud.common.types import LibcloudError +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, + NodeAuthSSHKey, + VolumeSnapshot, + NodeAuthPassword, +) +from libcloud.compute.types import NodeState, StorageVolumeState, VolumeSnapshotState +from libcloud.storage.types import ObjectDoesNotExistError +from libcloud.common.azure_arm import AzureResourceManagementConnection +from libcloud.common.exceptions import BaseHTTPError +from libcloud.compute.providers import Provider +from libcloud.storage.drivers.azure_blobs import AzureBlobsStorageDriver + +RESOURCE_API_VERSION = "2016-04-30-preview" +DISK_API_VERSION = "2023-01-02" +IMAGES_API_VERSION = "2015-06-15" +INSTANCE_VIEW_API_VERSION = "2015-06-15" +IP_API_VERSION = "2019-06-01" +LOCATIONS_API_VERSION = "2015-01-01" +NIC_API_VERSION = "2018-06-01" +NSG_API_VERSION = "2016-09-01" +RATECARD_API_VERSION = "2016-08-31-preview" +RESOURCE_GROUP_API_VERSION = "2016-09-01" +SNAPSHOT_API_VERSION = "2016-04-30-preview" +STORAGE_ACCOUNT_API_VERSION = "2015-05-01-preview" +SUBNET_API_VERSION = "2015-06-15" +TAG_API_VERSION = "2018-06-01" +VIRTUAL_NETWORK_API_VERSION = "2018-06-01" +VM_API_VERSION = "2021-11-01" +VM_EXTENSION_API_VERSION = "2015-06-15" +VM_SIZE_API_VERSION = "2015-06-15" # this API is deprecated + +# If pagination code in the list_nodes() method has still not completed after this mount of +# seconds, we will break early from while True loop to avoid infinite loop under edge conditions. +# Keep in mind that we want this timeout relatively high since each `_to_node()` method call which +# is called for each node can result in additional HTTP requests (to retrieve power state, nics, +# etc). +LIST_NODES_PAGINATION_TIMEOUT = 300 + +# Pagination timeout for list_volumes() method. +LIST_VOLUMES_PAGINATION_TIMEOUT = 300 + + +class AzureImage(NodeImage): + """Represents a Marketplace node image that an Azure VM can boot from.""" + + def __init__(self, version, sku, offer, publisher, location, driver): + self.publisher = publisher + self.offer = offer + self.sku = sku + self.version = version + self.location = location + urn = "{}:{}:{}:{}".format(self.publisher, self.offer, self.sku, self.version) + name = "{} {} {} {}".format(self.publisher, self.offer, self.sku, self.version) + super().__init__(urn, name, driver) + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.location, + ) + + +class AzureVhdImage(NodeImage): + """Represents a VHD node image that an Azure VM can boot from.""" + + def __init__(self, storage_account, blob_container, name, driver): + urn = "https://{}.blob{}/{}/{}".format( + storage_account, + driver.connection.storage_suffix, + blob_container, + name, + ) + super().__init__(urn, name, driver) + + def __repr__(self): + return ("") % (self.id, self.name) + + +class AzureComputeGalleryImage(NodeImage): + """Represents a Compute Gallery image that an Azure VM can boot from.""" + + def __init__(self, subscription_id, resource_group, gallery, name, driver): + id = ( + "/subscriptions/%s/resourceGroups/%s/" + "providers/Microsoft.Compute/galleries/%s/images/%s" + % ( + subscription_id, + resource_group, + gallery, + name, + ) + ) + super().__init__(id, name, driver) + + def __repr__(self): + return ("") % (self.id, self.name) + + +class AzureResourceGroup: + """Represent an Azure resource group.""" + + def __init__(self, id, name, location, extra): + self.id = id + self.name = name + self.location = location + self.extra = extra + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.location, + ) + + +class AzureNetworkSecurityGroup: + """Represent an Azure network security group.""" + + def __init__(self, id, name, location, extra): + self.id = id + self.name = name + self.location = location + self.extra = extra + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.location, + ) + + +class AzureNetwork: + """Represent an Azure virtual network.""" + + def __init__(self, id, name, location, extra): + self.id = id + self.name = name + self.location = location + self.extra = extra + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.location, + ) + + +class AzureSubnet: + """Represents a subnet of an Azure virtual network.""" + + def __init__(self, id, name, extra): + self.id = id + self.name = name + self.extra = extra + + def __repr__(self): + return ("") % (self.id, self.name) + + +class AzureNic: + """Represents an Azure virtual network interface controller (NIC).""" + + def __init__(self, id, name, location, extra): + self.id = id + self.name = name + self.location = location + self.extra = extra + + def __repr__(self): + return ("") % (self.id, self.name) + + +class AzureIPAddress: + """Represents an Azure public IP address resource.""" + + def __init__(self, id, name, extra): + self.id = id + self.name = name + self.extra = extra + + def __repr__(self): + return ("") % (self.id, self.name) + + +class AzureNodeDriver(NodeDriver): + """Compute node driver for Azure Resource Manager.""" + + connectionCls = AzureResourceManagementConnection + name = "Azure Virtual machines" + website = "http://azure.microsoft.com/en-us/services/virtual-machines/" + type = Provider.AZURE_ARM + features = {"create_node": ["ssh_key", "password"]} + + # The API doesn't provide state or country information, so fill it in. + # Information from https://azure.microsoft.com/en-us/regions/ + _location_to_country = { + "centralus": "Iowa, USA", + "eastus": "Virginia, USA", + "eastus2": "Virginia, USA", + "usgoviowa": "Iowa, USA", + "usgovvirginia": "Virginia, USA", + "northcentralus": "Illinois, USA", + "southcentralus": "Texas, USA", + "westus": "California, USA", + "northeurope": "Ireland", + "westeurope": "Netherlands", + "eastasia": "Hong Kong", + "southeastasia": "Singapore", + "japaneast": "Tokyo, Japan", + "japanwest": "Osaka, Japan", + "brazilsouth": "Sao Paulo State, Brazil", + "australiaeast": "New South Wales, Australia", + "australiasoutheast": "Victoria, Australia", + } + + SNAPSHOT_STATE_MAP = { + "creating": VolumeSnapshotState.CREATING, + "updating": VolumeSnapshotState.UPDATING, + "succeeded": VolumeSnapshotState.AVAILABLE, + "failed": VolumeSnapshotState.ERROR, + } + + def __init__( + self, + tenant_id, + subscription_id, + key, + secret, + secure=True, + host=None, + port=None, + api_version=None, + region=None, + **kwargs, + ): + self.tenant_id = tenant_id + self.subscription_id = subscription_id + self.cloud_environment = kwargs.get("cloud_environment") + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + api_version=api_version, + region=region, + **kwargs, + ) + if self.region is not None: + loc_id = self.region.lower().replace(" ", "") + country = self._location_to_country.get(loc_id) + self.default_location = NodeLocation(loc_id, self.region, country, self) + else: + self.default_location = None + + def list_locations(self): + """ + List data centers available with the current subscription. + + :return: list of node location objects + :rtype: ``list`` of :class:`.NodeLocation` + """ + + action = "/subscriptions/%s/providers/Microsoft.Compute" % (self.subscription_id) + r = self.connection.request(action, params={"api-version": LOCATIONS_API_VERSION}) + + for rt in r.object["resourceTypes"]: + if rt["resourceType"] == "virtualMachines": + return [self._to_location(location) for location in rt["locations"]] + + return [] + + def list_sizes(self, location=None): + """ + List available VM sizes. + + :param location: The location at which to list sizes + (if None, use default location specified as 'region' in __init__) + :type location: :class:`.NodeLocation` + + :return: list of node size objects + :rtype: ``list`` of :class:`.NodeSize` + """ + + if location is None: + if self.default_location: + location = self.default_location + else: + raise ValueError("location is required.") + action = "/subscriptions/%s/providers/Microsoft" ".Compute/locations/%s/vmSizes" % ( + self.subscription_id, + location.id, + ) + r = self.connection.request(action, params={"api-version": VM_SIZE_API_VERSION}) + return [self._to_node_size(d) for d in r.object["value"]] + + def list_images( + self, + location=None, + ex_publisher=None, + ex_offer=None, + ex_sku=None, + ex_version=None, + ): + """ + List available VM images to boot from. + + :param location: The location at which to list images + (if None, use default location specified as 'region' in __init__) + :type location: :class:`.NodeLocation` + + :param ex_publisher: Filter by publisher, or None to list + all publishers. + :type ex_publisher: ``str`` + + :param ex_offer: Filter by offer, or None to list all offers. + :type ex_offer: ``str`` + + :param ex_sku: Filter by sku, or None to list all skus. + :type ex_sku: ``str`` + + :param ex_version: Filter by version, or None to list all versions. + :type ex_version: ``str`` + + :return: list of node image objects. + :rtype: ``list`` of :class:`.AzureImage` + """ + + images = [] + + if location is None: + locations = [self.default_location] + else: + locations = [location] + + for loc in locations: + if not ex_publisher: + publishers = self.ex_list_publishers(loc) + else: + publishers = [ + ( + "/subscriptions/%s/providers/Microsoft" + ".Compute/locations/%s/publishers/%s" + % (self.subscription_id, loc.id, ex_publisher), + ex_publisher, + ) + ] + + for pub in publishers: + if not ex_offer: + offers = self.ex_list_offers(pub[0]) + else: + offers = [ + ( + "{}/artifacttypes/vmimage/offers/{}".format(pub[0], ex_offer), + ex_offer, + ) + ] + + for off in offers: + if not ex_sku: + skus = self.ex_list_skus(off[0]) + else: + skus = [("{}/skus/{}".format(off[0], ex_sku), ex_sku)] + + for sku in skus: + if not ex_version: + versions = self.ex_list_image_versions(sku[0]) + else: + versions = [("{}/versions/{}".format(sku[0], ex_version), ex_version)] + + for v in versions: + images.append( + AzureImage( + v[1], + sku[1], + off[1], + pub[1], + loc.id, + self.connection.driver, + ) + ) + return images + + def get_image(self, image_id, location=None): + """Returns a single node image from a provider. + + :param image_id: Either an image urn in the form + `Publisher:Offer:Sku:Version` or a Azure blob store URI in the form + `http://storageaccount.blob.core.windows.net/container/image.vhd` + pointing to a VHD file. + :type image_id: ``str`` + + :param location: The location at which to search for the image + (if None, use default location specified as 'region' in __init__) + :type location: :class:`.NodeLocation` + + :rtype :class:`.AzureImage`: or :class:`.AzureVhdImage`: + :return: AzureImage or AzureVhdImage instance on success. + + """ + + if image_id.startswith("http"): + storageAccount, blobContainer, blob = _split_blob_uri(image_id) + return AzureVhdImage(storageAccount, blobContainer, blob, self) + else: + ex_publisher, ex_offer, ex_sku, ex_version = image_id.split(":") + i = self.list_images(location, ex_publisher, ex_offer, ex_sku, ex_version) + return i[0] if i else None + + def list_nodes(self, ex_resource_group=None, ex_fetch_nic=True, ex_fetch_power_state=True): + """ + List all nodes. + + :param ex_resource_group: The resource group to list all nodes from. + :type ex_resource_group: ``str`` + + :param ex_fetch_nic: Fetch NIC resources in order to get + IP address information for nodes. If True, requires an extra API + call for each NIC of each node. If False, IP addresses will not + be returned. + :type ex_fetch_nic: ``bool`` + + :param ex_fetch_power_state: Fetch node power state. If True, requires + an extra API call for each node. If False, node state + will be returned based on provisioning state only. + :type ex_fetch_power_state: ``bool`` + + :return: list of node objects + :rtype: ``list`` of :class:`.Node` + + NOTE: With the default arguments, the function may result in M * (1 + (N * 3)) HTTP + requests where M is number of API pages and N is number of nodes returned per page. + """ + if ex_resource_group: + action = ( + "/subscriptions/%s/resourceGroups/%s/" + "providers/Microsoft.Compute/virtualMachines" + % (self.subscription_id, ex_resource_group) + ) + else: + action = "/subscriptions/%s/providers/Microsoft.Compute/" "virtualMachines" % ( + self.subscription_id + ) + params = {"api-version": VM_API_VERSION} + + now_ts = int(time.time()) + deadline_ts = now_ts + LIST_NODES_PAGINATION_TIMEOUT + + nodes = [] + while time.time() < deadline_ts: + r = self.connection.request(action, params=params) + nodes.extend( + self._to_node(n, fetch_nic=ex_fetch_nic, fetch_power_state=ex_fetch_power_state) + for n in r.object["value"] + ) + if not r.object.get("nextLink"): + # No next page + break + parsed_next_link = urlparse.urlparse(r.object["nextLink"]) + params.update({k: v[0] for k, v in parse_qs(parsed_next_link.query).items()}) + action = parsed_next_link.path + return nodes + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_resource_group=None, + ex_storage_account=None, + ex_blob_container="vhds", + ex_user_name="azureuser", + ex_network=None, + ex_subnet=None, + ex_nic=None, + ex_tags={}, + ex_customdata="", + ex_use_managed_disks=False, + ex_disk_size=None, + ex_storage_account_type="Standard_LRS", + ex_os_disk_delete=False, + ): + """Create a new node instance. This instance will be started + automatically. + + This driver supports the ``ssh_key`` feature flag for ``created_node`` + so you can upload a public key into the new instance:: + + >>> from libcloud.compute.drivers.azure_arm import AzureNodeDriver + >>> driver = AzureNodeDriver(...) + >>> auth = NodeAuthSSHKey('pubkey data here') + >>> node = driver.create_node("test_node", auth=auth) + + This driver also supports the ``password`` feature flag for + ``create_node`` + so you can set a password:: + + >>> driver = AzureNodeDriver(...) + >>> auth = NodeAuthPassword('mysecretpassword') + >>> node = driver.create_node("test_node", auth=auth, ...) + + If you don't provide the ``auth`` argument libcloud will assign + a password: + + >>> driver = AzureNodeDriver(...) + >>> node = driver.create_node("test_node", ...) + >>> password = node.extra["properties"] \ + ["osProfile"]["adminPassword"] + + :param name: String with a name for this new node (required) + :type name: ``str`` + + :param size: The size of resources allocated to this node. + (required) + :type size: :class:`.NodeSize` + + :param image: OS Image to boot on node (required) + :type image: :class:`.AzureImage` or :class:`.AzureVhdImage` or :class:`.AzureComputeGalleryImage` + + :param location: Which data center to create a node in. + (if None, use default location specified as 'region' in __init__) + :type location: :class:`.NodeLocation` + + :param auth: Initial authentication information for the node + (optional) + :type auth: :class:`.NodeAuthSSHKey` or :class:`NodeAuthPassword` + + :param ex_resource_group: The resource group in which to create the + node + :type ex_resource_group: ``str`` + + :param ex_storage_account: The storage account id in which to store + the node's disk image. + Note: when booting from a user image (AzureVhdImage) + the source image and the node image must use the same storage account. + :type ex_storage_account: ``str`` + + :param ex_blob_container: The name of the blob container on the + storage account in which to store the node's disk image (optional, + default "vhds") + :type ex_blob_container: ``str`` + + :param ex_user_name: User name for the initial admin user + (optional, default "azureuser") + :type ex_user_name: ``str`` + + :param ex_network: The virtual network the node will be attached to. + Must provide either `ex_network` (to create a default NIC for the + node on the given network) or `ex_nic` (to supply the NIC explicitly). + :type ex_network: ``str`` + + :param ex_subnet: If ex_network is provided, the subnet of the + virtual network the node will be attached to. Optional, default + is the "default" subnet. + :type ex_subnet: ``str`` + + :param ex_nic: A virtual NIC to attach to this Node, from + `ex_create_network_interface` or `ex_get_nic`. + Must provide either `ex_nic` (to supply the NIC explicitly) or + ex_network (to create a default NIC for the node on the + given network). + :type ex_nic: :class:`AzureNic` + + :param ex_tags: Optional tags to associate with this node. + :type ex_tags: ``dict`` + + :param ex_customdata: Custom data that will + be placed in the file /var/lib/waagent/CustomData + https://azure.microsoft.com/en-us/documentation/ \ + articles/virtual-machines-how-to-inject-custom-data/ + :type ex_customdata: ``str`` or ``bytes`` + + :param ex_use_managed_disks: Enable this feature to have Azure + automatically manage the availability of disks to provide data + redundancy and fault tolerance, without creating and managing + storage accounts on your own. Managed disks may not be available + in all regions (default False). + :type ex_use_managed_disks: ``bool`` + + :param ex_disk_size: Custom OS disk size in GB + :type ex_disk_size: ``int`` + + :param ex_storage_account_type: The Storage Account type, + ``Standard_LRS``(HDD disks) or ``Premium_LRS``(SSD disks). + :type ex_storage_account_type: str + + :param ex_os_disk_delete: Enable this feature to have Azure + automatically delete the OS disk when you delete the VM. + :type ex_os_disk_delete: ``bool`` + + :return: The newly created node. + :rtype: :class:`.Node` + """ + if not ex_use_managed_disks and ex_storage_account is None: + raise ValueError("ex_use_managed_disks is False, " "must provide ex_storage_account") + + if location is None: + location = self.default_location + if ex_nic is None: + if ex_network is None: + raise ValueError("Must provide either ex_network or ex_nic") + if ex_subnet is None: + ex_subnet = "default" + + subnet_id = ( + "/subscriptions/%s/resourceGroups/%s/providers" + "/Microsoft.Network/virtualnetworks/%s/subnets/%s" + % (self.subscription_id, ex_resource_group, ex_network, ex_subnet) + ) + subnet = AzureSubnet(subnet_id, ex_subnet, {}) + ex_nic = self.ex_create_network_interface( + name + "-nic", subnet, ex_resource_group, location + ) + + auth = self._get_and_check_auth(auth) + + target = ( + "/subscriptions/%s/resourceGroups/%s/providers" + "/Microsoft.Compute/virtualMachines/%s" + % (self.subscription_id, ex_resource_group, name) + ) + + if isinstance(image, AzureVhdImage): + instance_vhd = self._get_instance_vhd( + name=name, + ex_resource_group=ex_resource_group, + ex_storage_account=ex_storage_account, + ex_blob_container=ex_blob_container, + ) + storage_profile = { + "osDisk": { + "name": name, + "osType": "linux", + "caching": "ReadWrite", + "createOption": "FromImage", + "image": {"uri": image.id}, + "vhd": {"uri": instance_vhd}, + } + } + if ex_os_disk_delete: + storage_profile["osDisk"]["deleteOption"] = "Delete" + if ex_use_managed_disks: + raise LibcloudError( + "Creating managed OS disk from %s image " "type is not supported." % type(image) + ) + elif isinstance(image, AzureImage) or isinstance(image, AzureComputeGalleryImage): + if isinstance(image, AzureImage): + imageReference = { + "publisher": image.publisher, + "offer": image.offer, + "sku": image.sku, + "version": image.version, + } + else: + imageReference = {"id": image.id} + storage_profile = { + "imageReference": imageReference, + "osDisk": { + "name": name, + "osType": "linux", + "caching": "ReadWrite", + "createOption": "FromImage", + }, + } + if ex_os_disk_delete: + storage_profile["osDisk"]["deleteOption"] = "Delete" + if ex_use_managed_disks: + storage_profile["osDisk"]["managedDisk"] = { + "storageAccountType": ex_storage_account_type + } + else: + instance_vhd = self._get_instance_vhd( + name=name, + ex_resource_group=ex_resource_group, + ex_storage_account=ex_storage_account, + ex_blob_container=ex_blob_container, + ) + storage_profile["osDisk"]["vhd"] = {"uri": instance_vhd} + else: + raise LibcloudError( + "Unknown image type %s, expected one of AzureImage, " + "AzureVhdImage, AzureComputeGalleryImage." % type(image) + ) + + data = { + "id": target, + "name": name, + "type": "Microsoft.Compute/virtualMachines", + "location": location.id, + "tags": ex_tags, + "properties": { + "hardwareProfile": {"vmSize": size.id}, + "storageProfile": storage_profile, + "osProfile": {"computerName": name}, + "networkProfile": {"networkInterfaces": [{"id": ex_nic.id}]}, + }, + } + + if ex_disk_size: + data["properties"]["storageProfile"]["osDisk"].update({"diskSizeGB": ex_disk_size}) + + if ex_customdata: + if isinstance(ex_customdata, str): + ex_customdata = ex_customdata.encode("utf-8") + data["properties"]["osProfile"]["customData"] = base64.b64encode(ex_customdata).decode( + "utf-8" + ) + + data["properties"]["osProfile"]["adminUsername"] = ex_user_name + + if isinstance(auth, NodeAuthSSHKey): + data["properties"]["osProfile"]["adminPassword"] = binascii.hexlify( + os.urandom(20) + ).decode("utf-8") + data["properties"]["osProfile"]["linuxConfiguration"] = { + "disablePasswordAuthentication": "true", + "ssh": { + "publicKeys": [ + { + "path": "/home/%s/.ssh/authorized_keys" % (ex_user_name), + "keyData": auth.pubkey, # pylint: disable=no-member + } + ] + }, + } + elif isinstance(auth, NodeAuthPassword): + data["properties"]["osProfile"]["linuxConfiguration"] = { + "disablePasswordAuthentication": "false" + } + data["properties"]["osProfile"]["adminPassword"] = auth.password + else: + raise ValueError("Must provide NodeAuthSSHKey or NodeAuthPassword in auth") + + r = self.connection.request( + target, + params={"api-version": VM_API_VERSION}, + data=data, + method="PUT", + ) + + node = self._to_node(r.object) + node.size = size + node.image = image + return node + + def reboot_node(self, node): + """ + Reboot a node. + + :param node: The node to be rebooted + :type node: :class:`.Node` + + :return: True if the reboot was successful, otherwise False + :rtype: ``bool`` + """ + + target = "%s/restart" % node.id + try: + self.connection.request(target, params={"api-version": VM_API_VERSION}, method="POST") + return True + except BaseHTTPError as h: + if h.code == 202: + return True + else: + return False + + def destroy_node( + self, + node, + ex_destroy_nic=True, + ex_destroy_vhd=True, + ex_poll_qty=10, + ex_poll_wait=10, + ex_destroy_os_disk=True, + ): + """ + Destroy a node. + + :param node: The node to be destroyed + :type node: :class:`.Node` + + :param ex_destroy_nic: Destroy the NICs associated with + this node (default True). + :type node: ``bool`` + + :param ex_destroy_vhd: Destroy the OS disk blob associated with + this node (default True). + :type node: ``bool`` + + :param ex_poll_qty: Number of retries checking if the node + is gone, destroying the NIC or destroying the VHD (default 10). + :type node: ``int`` + + :param ex_poll_wait: Delay in seconds between retries (default 10). + :type node: ``int`` + + :param ex_destroy_os_disk: Destroy the OS disk associated with + this node either if it is a managed disk (default True). + :type node: ``bool`` + + :return: True if the destroy was successful, raises exception + otherwise. + :rtype: ``bool`` + """ + + do_node_polling = ex_destroy_nic or ex_destroy_vhd or ex_destroy_os_disk + + # This returns a 202 (Accepted) which means that the delete happens + # asynchronously. + # If returns 404, we may be retrying a previous destroy_node call that + # failed to clean up its related resources, so it isn't taken as a + # failure. + try: + self.connection.request( + node.id, params={"api-version": VM_API_VERSION}, method="DELETE" + ) + except BaseHTTPError as h: + if h.code == 202: + pass + elif h.code == 204: + # Returns 204 if node already deleted. + do_node_polling = False + else: + raise + + # Poll until the node actually goes away (otherwise attempt to delete + # NIC, VHD and OS Disk will fail with "resource in use" errors). + retries = ex_poll_qty + while do_node_polling and retries > 0: + try: + time.sleep(ex_poll_wait) + self.connection.request(node.id, params={"api-version": VM_API_VERSION}) + retries -= 1 + except BaseHTTPError as h: + if h.code in (204, 404): + # Node is gone + break + else: + raise + + # Optionally clean up the network + # interfaces that were attached to this node. + interfaces = node.extra["properties"]["networkProfile"]["networkInterfaces"] + if ex_destroy_nic: + for nic in interfaces: + retries = ex_poll_qty + while retries > 0: + try: + self.ex_destroy_nic(self._to_nic(nic)) + break + except BaseHTTPError as h: + retries -= 1 + if h.code == 400 and h.message.startswith("[NicInUse]") and retries > 0: + time.sleep(ex_poll_wait) + else: + raise + + # Optionally clean up OS disk VHD. + vhd = node.extra["properties"]["storageProfile"]["osDisk"].get("vhd") + if ex_destroy_vhd and vhd is not None: + retries = ex_poll_qty + resourceGroup = node.id.split("/")[4] + while retries > 0: + try: + if self._ex_delete_old_vhd(resourceGroup, vhd["uri"]): + break + # Unfortunately lease errors usually result in it returning + # "False" with no more information. Need to wait and try + # again. + except LibcloudError as e: + retries -= 1 + if "LeaseIdMissing" in str(e) and retries > 0: + # Unfortunately lease errors + # (which occur if the vhd blob + # hasn't yet been released by the VM being destroyed) + # get raised as plain + # LibcloudError. Wait a bit and try again. + time.sleep(ex_poll_wait) + else: + raise + time.sleep(10) + + # Optionally destroy the OS managed disk + managed_disk = ( + node.extra.get("properties", {}) + .get("storageProfile", {}) + .get("osDisk", {}) + .get("managedDisk") + ) + if ex_destroy_os_disk and managed_disk is not None: + managed_disk_id = managed_disk["id"] + try: + self.connection.request( + managed_disk_id, params={"api-version": DISK_API_VERSION}, method="DELETE" + ) + except BaseHTTPError as h: + if h.code not in (202, 204): + # 202 or 204 mean destroy is accepted (but deferred) or already destroyed + raise + + return True + + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + ex_resource_group=None, + ex_sku_name=None, + ex_tags=None, + ex_zones=None, + ex_iops=None, + ex_throughput=None, + ): + """ + Create a new managed volume. + + :param size: Size of volume in gigabytes. + :type size: ``int`` + + :param name: Name of the volume to be created. + :type name: ``str`` + + :param location: Which data center to create a volume in. (required) + :type location: :class:`NodeLocation` + + :param snapshot: Snapshot from which to create the new volume. + :type snapshot: :class:`VolumeSnapshot` + + :param ex_resource_group: The name of resource group in which to + create the volume. (required) + :type ex_resource_group: ``str`` + + :param ex_sku_name: The Disk SKU name. Refer to the API reference for + options. + :type ex_sku_name: ``str`` + + :param ex_tags: Optional tags to associate with this resource. + :type ex_tags: ``dict`` + + :param ex_zones: The list of availability zones to create the volume + in. Options are any or all of ["1", "2", "3"]. (optional) + :type ex_zones: ``list`` of ``str`` + + :param ex_iops: The max IOPS this volume is capable of. + :type ex_iops: ``int`` + + :param ex_throughput: The max throughput of this volume in MBps. + :type ex_throughput: ``int`` + + :return: The newly created volume. + :rtype: :class:`StorageVolume` + """ + if location is None: + raise ValueError("Must provide `location` value.") + + if ex_resource_group is None: + raise ValueError("Must provide `ex_resource_group` value.") + + action = ( + "/subscriptions/{subscription_id}/resourceGroups/{resource_group}" + "/providers/Microsoft.Compute/disks/{volume_name}" + ).format( + subscription_id=self.subscription_id, + resource_group=ex_resource_group, + volume_name=name, + ) + tags = ex_tags if ex_tags is not None else {} + + creation_data = ( + {"createOption": "Empty"} + if snapshot is None + else {"createOption": "Copy", "sourceUri": snapshot.id} + ) + data = { + "location": location.id, + "tags": tags, + "properties": {"creationData": creation_data, "diskSizeGB": size}, + } + if ex_sku_name is not None: + data["sku"] = {"name": ex_sku_name} + + if ex_zones is not None: + data["zones"] = ex_zones + + if ex_iops is not None: + data["properties"]["diskIopsReadWrite"] = ex_iops + + if ex_throughput is not None: + data["properties"]["diskMBpsReadWrite"] = ex_throughput + + response = self.connection.request( + action, + method="PUT", + params={"api-version": DISK_API_VERSION}, + data=data, + ) + + return self._to_volume(response.object, name=name, ex_resource_group=ex_resource_group) + + def list_volumes(self, ex_resource_group=None): + """ + Lists all the disks under a resource group or subscription. + + :param ex_resource_group: The identifier of your subscription + where the managed disks are located. + :type ex_resource_group: ``str`` + + :rtype: list of :class:`StorageVolume` + """ + if ex_resource_group: + action = ( + "/subscriptions/{subscription_id}/resourceGroups" + "/{resource_group}/providers/Microsoft.Compute/disks" + ) + else: + action = "/subscriptions/{subscription_id}" "/providers/Microsoft.Compute/disks" + + action = action.format( + subscription_id=self.subscription_id, resource_group=ex_resource_group + ) + params = {"api-version": DISK_API_VERSION} + + now_ts = int(time.time()) + deadline_ts = now_ts + LIST_VOLUMES_PAGINATION_TIMEOUT + + volumes = [] + while time.time() < deadline_ts: + response = self.connection.request(action, method="GET", params=params) + volumes.extend(self._to_volume(volume) for volume in response.object["value"]) + if not response.object.get("nextLink"): + # No next page + break + parsed_next_link = urlparse.urlparse(response.object["nextLink"]) + params.update({k: v[0] for k, v in parse_qs(parsed_next_link.query).items()}) + action = parsed_next_link.path + return volumes + + def attach_volume( + self, + node, + volume, + device=None, + ex_lun=None, + ex_vhd_uri=None, + ex_vhd_create=False, + ): + """ + Attach a volume to node. + + :param node: A node to attach volume. + :type node: :class:`Node` + + :param volume: A volume to attach. + :type volume: :class:`StorageVolume` + + :param ex_lun: Specifies the logical unit number (LUN) location for + the data drive in the virtual machine. Each data disk must have + a unique LUN. + :type ex_lun: ``int`` + + :param ex_vhd_uri: Attach old-style unmanaged disk from VHD + blob. (optional) + :type ex_vhd_uri: ``str`` + + :param ex_vhd_create: Create a new VHD blob for unmanaged disk. + (optional) + :type ex_vhd_create: ``bool`` + + :rtype: ``bool`` + """ + action = node.extra["id"] + location = node.extra["location"] + disks = node.extra["properties"]["storageProfile"]["dataDisks"] + + if ex_lun is None: + # find the smallest unused logical unit number + used_luns = [disk["lun"] for disk in disks] + free_luns = [lun for lun in range(0, 64) if lun not in used_luns] + if len(free_luns) > 0: + ex_lun = free_luns[0] + else: + raise LibcloudError("No LUN available to attach new disk.") + + if ex_vhd_uri is not None: + new_disk = { + "name": volume.name, + "diskSizeGB": volume.size, + "lun": ex_lun, + "createOption": "empty" if ex_vhd_create else "attach", + "vhd": {"uri": ex_vhd_uri}, + } + else: + # attach existing managed disk + new_disk = { + "lun": ex_lun, + "createOption": "attach", + "managedDisk": {"id": volume.id}, + } + + disks.append(new_disk) + self.connection.request( + action, + method="PUT", + params={"api-version": VM_API_VERSION}, + data={ + "properties": {"storageProfile": {"dataDisks": disks}}, + "location": location, + }, + ) + return True + + def ex_resize_volume(self, volume, new_size, resource_group): + """ + Resize a volume. + + :param volume: A volume to resize. + :type volume: :class:`StorageVolume` + + :param new_size: The new size to resize the volume to in Gib. + :type new_size: ``int`` + + :param resource_group: The name of the resource group in which to + create the volume. + :type resource_group: ``str`` + + """ + action = ( + "/subscriptions/{subscription_id}/resourceGroups/{resource_group}" + "/providers/Microsoft.Compute/disks/{volume_name}" + ).format( + subscription_id=self.subscription_id, + resource_group=resource_group, + volume_name=volume.name, + ) + + data = { + "location": volume.extra["location"], + "properties": { + "diskSizeGB": new_size, + "creationData": volume.extra["properties"]["creationData"], + }, + } + + response = self.connection.request( + action, + method="PUT", + params={"api-version": DISK_API_VERSION}, + data=data, + ) + + return self._to_volume(response.object, name=volume.name, ex_resource_group=resource_group) + + def detach_volume(self, volume, ex_node=None): + """ + Detach a managed volume from a node. + """ + if ex_node is None: + raise ValueError("Must provide `ex_node` value.") + + action = ex_node.extra["id"] + location = ex_node.extra["location"] + disks = ex_node.extra["properties"]["storageProfile"]["dataDisks"] + + # remove volume from `properties.storageProfile.dataDisks` + disks[:] = [ + disk + for disk in disks + if disk.get("name") != volume.name + and disk.get("managedDisk", {}).get("id") != volume.id + ] + + self.connection.request( + action, + method="PUT", + params={"api-version": VM_API_VERSION}, + data={ + "properties": {"storageProfile": {"dataDisks": disks}}, + "location": location, + }, + ) + return True + + def destroy_volume(self, volume): + """ + Delete a volume. + """ + self.ex_delete_resource(volume) + return True + + def create_volume_snapshot( + self, volume, name=None, location=None, ex_resource_group=None, ex_tags=None + ): + """ + Create snapshot from volume. + + :param volume: Instance of ``StorageVolume``. + :type volume: :class`StorageVolume` + + :param name: Name of snapshot. (required) + :type name: ``str`` + + :param location: Which data center to create a volume in. (required) + :type location: :class:`NodeLocation` + + :param ex_resource_group: The name of resource group in which to + create the snapshot. (required) + :type ex_resource_group: ``str`` + + :param ex_tags: Optional tags to associate with this resource. + :type ex_tags: ``dict`` + + :rtype: :class:`VolumeSnapshot` + """ + if name is None: + raise ValueError("Must provide `name` value") + if location is None: + raise ValueError("Must provide `location` value") + if ex_resource_group is None: + raise ValueError("Must provide `ex_resource_group` value") + + snapshot_id = ( + "/subscriptions/{subscription_id}" + "/resourceGroups/{resource_group}" + "/providers/Microsoft.Compute" + "/snapshots/{snapshot_name}" + ).format( + subscription_id=self.subscription_id, + resource_group=ex_resource_group, + snapshot_name=name, + ) + tags = ex_tags if ex_tags is not None else {} + + data = { + "location": location.id, + "tags": tags, + "properties": { + "creationData": {"createOption": "Copy", "sourceUri": volume.id}, + }, + } + response = self.connection.request( + snapshot_id, + method="PUT", + data=data, + params={"api-version": SNAPSHOT_API_VERSION}, + ) + + return self._to_snapshot(response.object, name=name, ex_resource_group=ex_resource_group) + + def list_volume_snapshots(self, volume): + return [ + snapshot + for snapshot in self.list_snapshots() + if snapshot.extra["source_id"] == volume.id + ] + + def list_snapshots(self, ex_resource_group=None): + """ + Lists all the snapshots under a resource group or subscription. + + :param ex_resource_group: The identifier of your subscription + where the managed snapshots are located (optional). + :type ex_resource_group: ``str`` + + :rtype: list of :class:`VolumeSnapshot` + """ + if ex_resource_group: + action = ( + "/subscriptions/{subscription_id}/resourceGroups" + "/{resource_group}/providers/Microsoft.Compute/snapshots" + ) + else: + action = "/subscriptions/{subscription_id}" "/providers/Microsoft.Compute/snapshots" + + action = action.format( + subscription_id=self.subscription_id, resource_group=ex_resource_group + ) + + response = self.connection.request( + action, method="GET", params={"api-version": SNAPSHOT_API_VERSION} + ) + return [self._to_snapshot(snap) for snap in response.object["value"]] + + def destroy_volume_snapshot(self, snapshot): + """ + Delete a snapshot. + """ + self.ex_delete_resource(snapshot) + return True + + def _to_volume(self, volume_obj, name=None, ex_resource_group=None): + """ + Parse the JSON element and return a StorageVolume object. + + :param volume_obj: A volume object from an azure response. + :type volume_obj: ``dict`` + + :param name: An optional name for the volume. + :type name: ``str`` + + :param ex_resource_group: An optional resource group for the volume. + :type ex_resource_group: ``str`` + + :rtype: :class:`StorageVolume` + """ + volume_id = volume_obj.get("id") + volume_name = volume_obj.get("name") + extra = dict(volume_obj) + properties = extra["properties"] + size = properties.get("diskSizeGB") + if size is not None: + size = int(size) + + provisioning_state = properties.get("provisioningState", "").lower() + disk_state = properties.get("diskState", "").lower() + + if provisioning_state == "creating": + state = StorageVolumeState.CREATING + elif provisioning_state == "updating": + state = StorageVolumeState.UPDATING + elif provisioning_state == "succeeded": + if disk_state in ("attached", "reserved", "activesas"): + state = StorageVolumeState.INUSE + elif disk_state == "unattached": + state = StorageVolumeState.AVAILABLE + else: + state = StorageVolumeState.UNKNOWN + else: + state = StorageVolumeState.UNKNOWN + + if volume_id is None and ex_resource_group is not None and name is not None: + volume_id = ( + "/subscriptions/{subscription_id}" + "/resourceGroups/{resource_group}" + "/providers/Microsoft.Compute/disks/{volume_name}" + ).format( + subscription_id=self.subscription_id, + resource_group=ex_resource_group, + volume_name=name, + ) + if volume_name is None and name is not None: + volume_name = name + + return StorageVolume( + id=volume_id, + name=volume_name, + size=size, + driver=self, + state=state, + extra=extra, + ) + + def _to_snapshot(self, snapshot_obj, name=None, ex_resource_group=None): + """ + Parse the JSON element and return a VolumeSnapshot object. + + :param snapshot_obj: A snapshot object from an azure response. + :type snapshot_obj: ``dict`` + + :param name: An optional name for the volume. + :type name: ``str`` + + :param ex_resource_group: An optional resource group for the volume. + :type ex_resource_group: ``str`` + + :rtype: :class:`VolumeSnapshot` + """ + snapshot_id = snapshot_obj.get("id") + name = snapshot_obj.get("name", name) + properties = snapshot_obj["properties"] + size = properties.get("diskSizeGB") + if size is not None: + size = int(size) + extra = dict(snapshot_obj) + extra["source_id"] = properties["creationData"]["sourceUri"] + if "/providers/Microsoft.Compute/disks/" in extra["source_id"]: + extra["volume_id"] = extra["source_id"] + state = self.SNAPSHOT_STATE_MAP.get( + properties.get("provisioningState", "").lower(), VolumeSnapshotState.UNKNOWN + ) + try: + created_at = iso8601.parse_date(properties.get("timeCreated")) + except (TypeError, ValueError, iso8601.ParseError): + created_at = None + + if snapshot_id is None and ex_resource_group is not None and name is not None: + snapshot_id = ( + "/subscriptions/{subscription_id}" + "/resourceGroups/{resource_group}" + "/providers/Microsoft.Compute/snapshots/{snapshot_name}" + ).format( + subscription_id=self.subscription_id, + resource_group=ex_resource_group, + snapshot_name=name, + ) + + return VolumeSnapshot( + snapshot_id, + name=name, + size=size, + driver=self, + state=state, + extra=extra, + created=created_at, + ) + + def ex_delete_resource(self, resource): + """ + Delete a resource. + """ + if not isinstance(resource, basestring): + resource = resource.id + r = self.connection.request( + resource, + method="DELETE", + params={"api-version": RESOURCE_API_VERSION}, + ) + return r.status in [200, 202, 204] + + def ex_get_ratecard(self, offer_durable_id, currency="USD", locale="en-US", region="US"): + """ + Get rate card + + :param offer_durable_id: ID of the offer applicable for this + user account. (e.g. "0026P") + See http://azure.microsoft.com/en-us/support/legal/offer-details/ + :type offer_durable_id: str + + :param currency: Desired currency for the response (default: "USD") + :type currency: ``str`` + + :param locale: Locale (default: "en-US") + :type locale: ``str`` + + :param region: Region (two-letter code) (default: "US") + :type region: ``str`` + + :return: A dictionary of rates whose ID's correspond to nothing at all + :rtype: ``dict`` + """ + + action = "/subscriptions/%s/providers/Microsoft.Commerce/" "RateCard" % ( + self.subscription_id, + ) + params = { + "api-version": RATECARD_API_VERSION, + "$filter": "OfferDurableId eq 'MS-AZR-%s' and " + "Currency eq '%s' and " + "Locale eq '%s' and " + "RegionInfo eq '%s'" % (offer_durable_id, currency, locale, region), + } + r = self.connection.request(action, params=params) + return r.object + + def ex_list_publishers(self, location=None): + """ + List node image publishers. + + :param location: The location at which to list publishers + (if None, use default location specified as 'region' in __init__) + :type location: :class:`.NodeLocation` + + :return: A list of tuples in the form + ("publisher id", "publisher name") + :rtype: ``list`` + """ + + if location is None: + if self.default_location: + location = self.default_location + else: + raise ValueError("location is required.") + + action = "/subscriptions/%s/providers/Microsoft.Compute/" "locations/%s/publishers" % ( + self.subscription_id, + location.id, + ) + r = self.connection.request(action, params={"api-version": IMAGES_API_VERSION}) + return [(p["id"], p["name"]) for p in r.object] + + def ex_list_offers(self, publisher): + """ + List node image offers from a publisher. + + :param publisher: The complete resource path to a publisher + (as returned by `ex_list_publishers`) + :type publisher: ``str`` + + :return: A list of tuples in the form + ("offer id", "offer name") + :rtype: ``list`` + """ + + action = "%s/artifacttypes/vmimage/offers" % (publisher) + r = self.connection.request(action, params={"api-version": IMAGES_API_VERSION}) + return [(p["id"], p["name"]) for p in r.object] + + def ex_list_skus(self, offer): + """ + List node image skus in an offer. + + :param offer: The complete resource path to an offer (as returned by + `ex_list_offers`) + :type offer: ``str`` + + :return: A list of tuples in the form + ("sku id", "sku name") + :rtype: ``list`` + """ + + action = "%s/skus" % offer + r = self.connection.request(action, params={"api-version": IMAGES_API_VERSION}) + return [(sku["id"], sku["name"]) for sku in r.object] + + def ex_list_image_versions(self, sku): + """ + List node image versions in a sku. + + :param sku: The complete resource path to a sku (as returned by + `ex_list_skus`) + :type publisher: ``str`` + + :return: A list of tuples in the form + ("version id", "version name") + :rtype: ``list`` + """ + + action = "%s/versions" % (sku) + r = self.connection.request(action, params={"api-version": IMAGES_API_VERSION}) + return [(img["id"], img["name"]) for img in r.object] + + def ex_list_resource_groups(self): + """ + List resource groups. + + :return: A list of resource groups. + :rtype: ``list`` of :class:`.AzureResourceGroup` + """ + + action = "/subscriptions/%s/resourceGroups/" % (self.subscription_id) + r = self.connection.request(action, params={"api-version": RESOURCE_GROUP_API_VERSION}) + return [ + AzureResourceGroup(grp["id"], grp["name"], grp["location"], grp["properties"]) + for grp in r.object["value"] + ] + + def ex_list_network_security_groups(self, resource_group): + """ + List network security groups. + + :param resource_group: List security groups in a specific resource + group. + :type resource_group: ``str`` + + :return: A list of network security groups. + :rtype: ``list`` of :class:`.AzureNetworkSecurityGroup` + """ + + action = ( + "/subscriptions/%s/resourceGroups/%s/providers/" + "Microsoft.Network/networkSecurityGroups" % (self.subscription_id, resource_group) + ) + r = self.connection.request(action, params={"api-version": NSG_API_VERSION}) + return [ + AzureNetworkSecurityGroup(net["id"], net["name"], net["location"], net["properties"]) + for net in r.object["value"] + ] + + def ex_create_network_security_group(self, name, resource_group, location=None): + """ + Update tags on any resource supporting tags. + + :param name: Name of the network security group to create + :type name: ``str`` + + :param resource_group: The resource group to create the network + security group in + :type resource_group: ``str`` + + :param location: The location at which to create the network security + group (if None, use default location specified as 'region' in __init__) + :type location: :class:`.NodeLocation` + """ + + if location is None: + if self.default_location: + location = self.default_location + else: + raise ValueError("location is required.") + + target = ( + "/subscriptions/%s/resourceGroups/%s/" + "providers/Microsoft.Network/networkSecurityGroups/%s" + % (self.subscription_id, resource_group, name) + ) + data = { + "location": location.id, + } + self.connection.request( + target, params={"api-version": NSG_API_VERSION}, data=data, method="PUT" + ) + + def ex_delete_network_security_group(self, name, resource_group, location=None): + """ + Update tags on any resource supporting tags. + + :param name: Name of the network security group to delete + :type name: ``str`` + + :param resource_group: The resource group to create the network + security group in + :type resource_group: ``str`` + + :param location: The location at which to create the network security + group (if None, use default location specified as 'region' in __init__) + :type location: :class:`.NodeLocation` + """ + + if location is None: + if self.default_location: + location = self.default_location + else: + raise ValueError("location is required.") + + target = ( + "/subscriptions/%s/resourceGroups/%s/" + "providers/Microsoft.Network/networkSecurityGroups/%s" + % (self.subscription_id, resource_group, name) + ) + data = { + "location": location.id, + } + self.connection.request( + target, params={"api-version": NSG_API_VERSION}, data=data, method="DELETE" + ) + + def ex_list_networks(self): + """ + List virtual networks. + + :return: A list of virtual networks. + :rtype: ``list`` of :class:`.AzureNetwork` + """ + + action = "/subscriptions/%s/providers/" "Microsoft.Network/virtualnetworks" % ( + self.subscription_id + ) + r = self.connection.request(action, params={"api-version": VIRTUAL_NETWORK_API_VERSION}) + return [ + AzureNetwork(net["id"], net["name"], net["location"], net["properties"]) + for net in r.object["value"] + ] + + def ex_list_subnets(self, network): + """ + List subnets of a virtual network. + + :param network: The virtual network containing the subnets. + :type network: :class:`.AzureNetwork` + + :return: A list of subnets. + :rtype: ``list`` of :class:`.AzureSubnet` + """ + + action = "%s/subnets" % (network.id) + r = self.connection.request(action, params={"api-version": SUBNET_API_VERSION}) + return [AzureSubnet(net["id"], net["name"], net["properties"]) for net in r.object["value"]] + + def ex_list_nics(self, resource_group=None): + """ + List available virtual network interface controllers + in a resource group + + :param resource_group: List NICS in a specific resource group + containing the NICs(optional). + :type resource_group: ``str`` + + :return: A list of NICs. + :rtype: ``list`` of :class:`.AzureNic` + """ + if resource_group is None: + action = ( + "/subscriptions/%s/providers/Microsoft.Network" + "/networkInterfaces" % self.subscription_id + ) + else: + action = ( + "/subscriptions/%s/resourceGroups/%s/providers" + "/Microsoft.Network/networkInterfaces" % (self.subscription_id, resource_group) + ) + r = self.connection.request(action, params={"api-version": NIC_API_VERSION}) + return [self._to_nic(net) for net in r.object["value"]] + + def ex_get_nic(self, id): + """ + Fetch information about a NIC. + + :param id: The complete resource path to the NIC resource. + :type id: ``str`` + + :return: The NIC object + :rtype: :class:`.AzureNic` + """ + + r = self.connection.request(id, params={"api-version": NIC_API_VERSION}) + return self._to_nic(r.object) + + def ex_update_nic_properties(self, network_interface, resource_group, properties): + """ + Update the properties of an already existing virtual network + interface (NIC). + + :param network_interface: The NIC to update. + :type network_interface: :class:`.AzureNic` + + :param resource_group: The resource group to check the ip address in. + :type resource_group: ``str`` + + :param properties: The dictionary of the NIC's properties + :type properties: ``dict`` + + :return: The NIC object + :rtype: :class:`.AzureNic` + """ + + target = ( + "/subscriptions/%s/resourceGroups/%s/providers" + "/Microsoft.Network/networkInterfaces/%s" + % (self.subscription_id, resource_group, network_interface.name) + ) + + data = { + "properties": properties, + "location": network_interface.location, + } + + r = self.connection.request( + target, params={"api-version": NIC_API_VERSION}, data=data, method="PUT" + ) + return AzureNic( + r.object["id"], + r.object["name"], + r.object["location"], + r.object["properties"], + ) + + def ex_update_network_profile_of_node(self, node, network_profile): + """ + Update the network profile of a node. This method can be used to + attach or detach a NIC to a node. + + :param node: A node to attach the network interface to. + :type node: :class:`Node` + + :param network_profile: The new network profile to update. + :type network_profile: ``dict`` + """ + action = node.extra["id"] + location = node.extra["location"] + self.connection.request( + action, + method="PUT", + params={"api-version": VM_API_VERSION}, + data={ + "id": node.id, + "name": node.name, + "type": "Microsoft.Compute/virtualMachines", + "location": location, + "properties": {"networkProfile": network_profile}, + }, + ) + + def ex_destroy_nic(self, nic): + """ + Destroy a NIC. + + :param nic: The NIC to destroy. + :type nic: ``.AzureNic`` + + :return: True on success + :rtype: ``bool`` + """ + + try: + self.connection.request( + nic.id, params={"api-version": NIC_API_VERSION}, method="DELETE" + ) + return True + except BaseHTTPError as h: + if h.code in (202, 204): + # Deletion is accepted (but deferred), or NIC is already + # deleted + return True + else: + raise + + def ex_check_ip_address_availability(self, resource_group, network, ip_address): + """ + Checks whether a private IP address is available for use. Also + returns an object that contains the available IPs in the subnet. + + :param resource_group: The resource group to check the ip address in. + :type resource_group: ``str`` + + :param network: The virtual network. + :type network: :class:`.AzureNetwork` + + :param ip_address: The private IP address to be verified. + :type ip_address: ``str`` + """ + params = {"api-version": VIRTUAL_NETWORK_API_VERSION} + action = ( + "/subscriptions/%s/resourceGroups/%s/providers" + "/Microsoft.Network/virtualNetworks/%s/" + "CheckIPAddressAvailability" % (self.subscription_id, resource_group, network.name) + ) + if ip_address is not None: + params["ipAddress"] = ip_address + r = self.connection.request(action, params=params) + return r.object + + def ex_get_node(self, id): + """ + Fetch information about a node. + + :param id: The complete resource path to the node resource. + :type id: ``str`` + + :return: The Node object + :rtype: :class:`.Node` + """ + + r = self.connection.request(id, params={"api-version": VM_API_VERSION}) + return self._to_node(r.object) + + def ex_get_volume(self, id): + """ + Fetch information about a volume. + + :param id: The complete resource path to the volume resource. + :type id: ``str`` + + :return: The StorageVolume object + :rtype: :class:`.StorageVolume` + """ + + r = self.connection.request(id, params={"api-version": DISK_API_VERSION}) + return self._to_volume(r.object) + + def ex_get_snapshot(self, id): + """ + Fetch information about a snapshot. + + :param id: The complete resource path to the snapshot resource. + :type id: ``str`` + + :return: The VolumeSnapshot object + :rtype: :class:`.VolumeSnapshot` + """ + + r = self.connection.request(id, params={"api-version": SNAPSHOT_API_VERSION}) + return self._to_snapshot(r.object) + + def ex_get_public_ip(self, id): + """ + Fetch information about a public IP resource. + + :param id: The complete resource path to the public IP resource. + :type id: ``str` + + :return: The public ip object + :rtype: :class:`.AzureIPAddress` + """ + + r = self.connection.request(id, params={"api-version": IP_API_VERSION}) + return self._to_ip_address(r.object) + + def ex_list_public_ips(self, resource_group): + """ + List public IP resources. + + :param resource_group: List public IPs in a specific resource group. + :type resource_group: ``str`` + + :return: List of public ip objects + :rtype: ``list`` of :class:`.AzureIPAddress` + """ + + action = ( + "/subscriptions/%s/resourceGroups/%s/" + "providers/Microsoft.Network/publicIPAddresses" % (self.subscription_id, resource_group) + ) + r = self.connection.request(action, params={"api-version": IP_API_VERSION}) + return [self._to_ip_address(net) for net in r.object["value"]] + + def ex_create_public_ip( + self, name, resource_group, location=None, public_ip_allocation_method=None + ): + """ + Create a public IP resources. + + :param name: Name of the public IP resource + :type name: ``str`` + + :param resource_group: The resource group to create the public IP + :type resource_group: ``str`` + + :param location: The location at which to create the public IP + (if None, use default location specified as 'region' in __init__) + :type location: :class:`.NodeLocation` + + :param public_ip_allocation_method: Call ex_create_public_ip with + public_ip_allocation_method="Static" to create a static public + IP address + :type public_ip_allocation_method: ``str`` + + :return: The newly created public ip object + :rtype: :class:`.AzureIPAddress` + """ + + if location is None: + if self.default_location: + location = self.default_location + else: + raise ValueError("location is required.") + + target = ( + "/subscriptions/%s/resourceGroups/%s/" + "providers/Microsoft.Network/publicIPAddresses/%s" + % (self.subscription_id, resource_group, name) + ) + data = { + "location": location.id, + "tags": {}, + "properties": {"publicIPAllocationMethod": "Dynamic"}, + } + + if public_ip_allocation_method == "Static": + data["properties"]["publicIPAllocationMethod"] = "Static" + + r = self.connection.request( + target, params={"api-version": IP_API_VERSION}, data=data, method="PUT" + ) + return self._to_ip_address(r.object) + + def ex_delete_public_ip(self, public_ip): + """ + Delete a public ip address resource. + + :param public_ip: Public ip address resource to delete + :type public_ip: `.AzureIPAddress` + """ + # NOTE: This operation requires API version 2018-11-01 so + # "ex_delete_resource" won't work for deleting an IP address + resource = public_ip.id + r = self.connection.request( + resource, + method="DELETE", + params={"api-version": IP_API_VERSION}, + ) + + return r.status in [200, 202, 204] + + def ex_create_network_interface( + self, name, subnet, resource_group, location=None, public_ip=None + ): + """ + Create a virtual network interface (NIC). + + :param name: Name of the NIC resource + :type name: ``str`` + + :param subnet: The subnet to attach the NIC + :type subnet: :class:`.AzureSubnet` + + :param resource_group: The resource group to create the NIC + :type resource_group: ``str`` + + :param location: The location at which to create the NIC + (if None, use default location specified as 'region' in __init__) + :type location: :class:`.NodeLocation` + + :param public_ip: Associate a public IP resource with this NIC + (optional). + :type public_ip: :class:`.AzureIPAddress` + + :return: The newly created NIC + :rtype: :class:`.AzureNic` + """ + + if location is None: + if self.default_location: + location = self.default_location + else: + raise ValueError("location is required.") + + target = ( + "/subscriptions/%s/resourceGroups/%s/providers" + "/Microsoft.Network/networkInterfaces/%s" % (self.subscription_id, resource_group, name) + ) + + data = { + "location": location.id, + "tags": {}, + "properties": { + "ipConfigurations": [ + { + "name": "myip1", + "properties": { + "subnet": {"id": subnet.id}, + "privateIPAllocationMethod": "Dynamic", + }, + } + ] + }, + } + + if public_ip: + ip_config = data["properties"]["ipConfigurations"][0] + ip_config["properties"]["publicIPAddress"] = {"id": public_ip.id} + + r = self.connection.request( + target, params={"api-version": NIC_API_VERSION}, data=data, method="PUT" + ) + return AzureNic( + r.object["id"], + r.object["name"], + r.object["location"], + r.object["properties"], + ) + + def ex_create_tags(self, resource, tags, replace=False): + """ + Update tags on any resource supporting tags. + + :param resource: The resource to update. + :type resource: ``str`` or Azure object with an ``id`` attribute. + + :param tags: The tags to set. + :type tags: ``dict`` + + :param replace: If true, replace all tags with the new tags. + If false (default) add or update tags. + :type replace: ``bool`` + """ + + if not isinstance(resource, basestring): + resource = resource.id + r = self.connection.request(resource, params={"api-version": TAG_API_VERSION}) + if replace: + r.object["tags"] = tags + else: + r.object["tags"].update(tags) + self.connection.request( + resource, + data={"tags": r.object["tags"]}, + params={"api-version": TAG_API_VERSION}, + method="PATCH", + ) + + def ex_create_additional_capabilities( + self, + node, + additional_capabilities, + resource_group, + ): + """ + Set the additional capabilities on a stopped node. + + :param node: The node to be updated + :type node: :class:`.Node` + + :param ex_additional_capabilities: Optional additional capabilities + allowing Ultra SSD and hibernation on this node. + :type ex_additional_capabilities: ``dict`` + + :param resource_group: The resource group of the node to be updated + :type resource_group: ``str`` + + :return: True if the update was successful, otherwise False + :rtype: ``bool`` + """ + + target = ( + "/subscriptions/%s/resourceGroups/%s/providers" + "/Microsoft.Compute/virtualMachines/%s" + % (self.subscription_id, resource_group, node.name) + ) + + data = { + "location": node.extra["location"], + "properties": {"additionalCapabilities": additional_capabilities}, + } + + r = self.connection.request( + target, + data=data, + params={"api-version": VM_API_VERSION}, + method="PUT", + ) + + return r.status in [200, 202, 204] + + def start_node(self, node): + """ + Start a stopped node. + + :param node: The node to be started + :type node: :class:`.Node` + """ + + target = "%s/start" % node.id + r = self.connection.request(target, params={"api-version": VM_API_VERSION}, method="POST") + return r.object + + def stop_node(self, node, ex_deallocate=True): + """ + Stop a running node. + + :param node: The node to be stopped + :type node: :class:`.Node` + + :param deallocate: If True (default) stop and then deallocate the node + (release the hardware allocated to run the node). If False, stop the + node but maintain the hardware allocation. If the node is not + deallocated, the subscription will continue to be billed as if it + were running. + :type deallocate: ``bool`` + """ + if ex_deallocate: + target = "%s/deallocate" % node.id + else: + target = "%s/powerOff" % node.id + r = self.connection.request(target, params={"api-version": VM_API_VERSION}, method="POST") + return r.object + + def ex_start_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.start_node(node=node) + + def ex_stop_node(self, node, deallocate=True): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.stop_node(node=node, ex_deallocate=deallocate) + + def ex_resize_node(self, node, size): + """ + Resize the node to a different machine size. + + :param node: Node to resize + :type node: :class:`Node` + + :param size: New size for this machine + :type node: :class:`NodeSize` + """ + target = "%s/resize" % node.id + data = {"size": size.id} + r = self.connection.request( + target, params={"api-version": VM_API_VERSION}, data=data, method="POST" + ) + return r.object + + def ex_get_storage_account_keys(self, resource_group, storage_account): + """ + Get account keys required to access to a storage account + (using AzureBlobsStorageDriver). + + :param resource_group: The resource group + containing the storage account + :type resource_group: ``str`` + + :param storage_account: Storage account to access + :type storage_account: ``str`` + + :return: The account keys, in the form `{"key1": "XXX", "key2": "YYY"}` + :rtype: ``.dict`` + """ + + action = ( + "/subscriptions/%s/resourceGroups/%s/" + "providers/Microsoft.Storage/storageAccounts/%s/listKeys" + % (self.subscription_id, resource_group, storage_account) + ) + + r = self.connection.request( + action, params={"api-version": STORAGE_ACCOUNT_API_VERSION}, method="POST" + ) + return r.object + + def ex_run_command( + self, + node, + command, + filerefs=[], + timestamp=0, + storage_account_name=None, + storage_account_key=None, + location=None, + ): + """ + Run a command on the node as root. + + Does not require ssh to log in, + uses Windows Azure Agent (waagent) running + on the node. + + :param node: The node on which to run the command. + :type node: :class:``.Node`` + + :param command: The actual command to run. Note this is parsed + into separate arguments according to shell quoting rules but is + executed directly as a subprocess, not a shell command. + :type command: ``str`` + + :param filerefs: Optional files to fetch by URI from Azure blob store + (must provide storage_account_name and storage_account_key), + or regular HTTP. + :type command: ``list`` of ``str`` + + :param location: The location of the virtual machine + (if None, use default location specified as 'region' in __init__) + :type location: :class:`.NodeLocation` + + :param storage_account_name: The storage account + from which to fetch files in `filerefs` + :type storage_account_name: ``str`` + + :param storage_account_key: The storage key to + authorize to the blob store. + :type storage_account_key: ``str`` + + :type: ``list`` of :class:`.NodeLocation` + + """ + + if location is None: + if self.default_location: + location = self.default_location + else: + raise ValueError("location is required.") + + name = "init" + + target = node.id + "/extensions/" + name + + data = { + "location": location.id, + "name": name, + "properties": { + "publisher": "Microsoft.OSTCExtensions", + "type": "CustomScriptForLinux", + "typeHandlerVersion": "1.3", + "settings": { + "fileUris": filerefs, + "commandToExecute": command, + "timestamp": timestamp, + }, + }, + } + + if storage_account_name and storage_account_key: + data["properties"]["protectedSettings"] = { + "storageAccountName": storage_account_name, + "storageAccountKey": storage_account_key, + } + + r = self.connection.request( + target, + params={"api-version": VM_EXTENSION_API_VERSION}, + data=data, + method="PUT", + ) + return r.object + + def _ex_delete_old_vhd(self, resource_group, uri): + try: + storageAccount, blobContainer, blob = _split_blob_uri(uri) + keys = self.ex_get_storage_account_keys(resource_group, storageAccount) + blobdriver = AzureBlobsStorageDriver( + storageAccount, + keys["key1"], + host="{}.blob{}".format(storageAccount, self.connection.storage_suffix), + ) + return blobdriver.delete_object(blobdriver.get_object(blobContainer, blob)) + except ObjectDoesNotExistError: + return True + + def _ex_connection_class_kwargs(self): + kwargs = super()._ex_connection_class_kwargs() + kwargs["tenant_id"] = self.tenant_id + kwargs["subscription_id"] = self.subscription_id + kwargs["cloud_environment"] = self.cloud_environment + return kwargs + + def _fetch_power_state(self, data): + state = NodeState.UNKNOWN + try: + action = "%s/InstanceView" % (data["id"]) + r = self.connection.request(action, params={"api-version": INSTANCE_VIEW_API_VERSION}) + for status in r.object["statuses"]: + if status["code"] in ["ProvisioningState/creating"]: + state = NodeState.PENDING + break + elif status["code"] == "ProvisioningState/deleting": + state = NodeState.TERMINATED + break + elif status["code"].startswith("ProvisioningState/failed"): + state = NodeState.ERROR + break + elif status["code"] == "ProvisioningState/updating": + state = NodeState.UPDATING + break + elif status["code"] == "ProvisioningState/succeeded": + pass + + if status["code"] == "PowerState/deallocated": + state = NodeState.STOPPED + break + elif status["code"] == "PowerState/stopped": + state = NodeState.PAUSED + break + elif status["code"] == "PowerState/deallocating": + state = NodeState.PENDING + break + elif status["code"] == "PowerState/running": + state = NodeState.RUNNING + except BaseHTTPError: + pass + return state + + def _to_node(self, data, fetch_nic=True, fetch_power_state=True): + private_ips = [] + public_ips = [] + nics = data["properties"]["networkProfile"]["networkInterfaces"] + if fetch_nic: + for nic in nics: + try: + n = self.ex_get_nic(nic["id"]) + priv = n.extra["ipConfigurations"][0]["properties"].get("privateIPAddress") + if priv: + private_ips.append(priv) + pub = n.extra["ipConfigurations"][0]["properties"].get("publicIPAddress") + if pub: + pub_addr = self.ex_get_public_ip(pub["id"]) + addr = pub_addr.extra.get("ipAddress") + if addr: + public_ips.append(addr) + except BaseHTTPError: + pass + + state = NodeState.UNKNOWN + if fetch_power_state: + state = self._fetch_power_state(data) + else: + ps = data["properties"]["provisioningState"].lower() + if ps == "creating": + state = NodeState.PENDING + elif ps == "deleting": + state = NodeState.TERMINATED + elif ps == "failed": + state = NodeState.ERROR + elif ps == "updating": + state = NodeState.UPDATING + elif ps == "succeeded": + state = NodeState.RUNNING + + node = Node( + data["id"], + data["name"], + state, + public_ips, + private_ips, + driver=self.connection.driver, + extra=data, + ) + + return node + + def _to_node_size(self, data): + return NodeSize( + id=data["name"], + name=data["name"], + ram=data["memoryInMB"], + # convert to disk from MB to GB + disk=data["resourceDiskSizeInMB"] / 1024, + bandwidth=0, + price=0, + driver=self.connection.driver, + extra={ + "numberOfCores": data["numberOfCores"], + "osDiskSizeInMB": data["osDiskSizeInMB"], + "maxDataDiskCount": data["maxDataDiskCount"], + }, + ) + + def _to_nic(self, data): + return AzureNic(data["id"], data.get("name"), data.get("location"), data.get("properties")) + + def _to_ip_address(self, data): + return AzureIPAddress(data["id"], data["name"], data["properties"]) + + def _to_location(self, loc): + # XXX for some reason the API returns location names like + # "East US" instead of "eastus" which is what is actually needed + # for other API calls, so do a name->id fixup. + loc_id = loc.lower().replace(" ", "") + return NodeLocation( + loc_id, loc, self._location_to_country.get(loc_id), self.connection.driver + ) + + def _get_instance_vhd( + self, name, ex_resource_group, ex_storage_account, ex_blob_container="vhds" + ): + n = 0 + errors = [] + while n < 10: + try: + instance_vhd = "https://%s.blob%s" "/%s/%s-os_%i.vhd" % ( + ex_storage_account, + self.connection.storage_suffix, + ex_blob_container, + name, + n, + ) + if self._ex_delete_old_vhd(ex_resource_group, instance_vhd): + # We were able to remove it or it doesn't exist, + # so we can use it. + return instance_vhd + except LibcloudError as lce: + errors.append(str(lce)) + n += 1 + raise LibcloudError( + "Unable to find a name for a VHD to use for " + "instance in 10 tries, errors were:\n - %s" % ("\n - ".join(errors)) + ) + + +def _split_blob_uri(uri): + uri = uri.split("/") + storage_account = uri[2].split(".")[0] + blob_container = uri[3] + blob_name = "/".join(uri[4:]) + return storage_account, blob_container, blob_name diff --git a/libcloud/compute/drivers/bluebox.py b/libcloud/compute/drivers/bluebox.py deleted file mode 100644 index 204e0de6bf..0000000000 --- a/libcloud/compute/drivers/bluebox.py +++ /dev/null @@ -1,235 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -libcloud driver for the Blue Box Blocks API - -This driver implements all libcloud functionality for the Blue Box Blocks API. - -Blue Box home page http://bluebox.net -Blue Box API documentation https://boxpanel.bluebox -.net/public/the_vault/index.php/Blocks_API -""" - -import copy -import base64 - -from libcloud.utils.py3 import urlencode -from libcloud.utils.py3 import b - -from libcloud.common.base import JsonResponse, ConnectionUserAndKey -from libcloud.compute.providers import Provider -from libcloud.compute.types import NodeState, InvalidCredsError -from libcloud.compute.base import Node, NodeDriver -from libcloud.compute.base import NodeSize, NodeImage, NodeLocation -from libcloud.compute.base import NodeAuthPassword, NodeAuthSSHKey - -# Current end point for Blue Box API. -BLUEBOX_API_HOST = "boxpanel.bluebox.net" - -# The API doesn't currently expose all of the required values for libcloud, -# so we simply list what's available right now, along with all of the various -# attributes that are needed by libcloud. -BLUEBOX_INSTANCE_TYPES = { - '1gb': { - 'id': '94fd37a7-2606-47f7-84d5-9000deda52ae', - 'name': 'Block 1GB Virtual Server', - 'ram': 1024, - 'disk': 20, - 'cpu': 0.5 - }, - '2gb': { - 'id': 'b412f354-5056-4bf0-a42f-6ddd998aa092', - 'name': 'Block 2GB Virtual Server', - 'ram': 2048, - 'disk': 25, - 'cpu': 1 - }, - '4gb': { - 'id': '0cd183d3-0287-4b1a-8288-b3ea8302ed58', - 'name': 'Block 4GB Virtual Server', - 'ram': 4096, - 'disk': 50, - 'cpu': 2 - }, - '8gb': { - 'id': 'b9b87a5b-2885-4a2e-b434-44a163ca6251', - 'name': 'Block 8GB Virtual Server', - 'ram': 8192, - 'disk': 100, - 'cpu': 4 - } -} - -RAM_PER_CPU = 2048 - -NODE_STATE_MAP = {'queued': NodeState.PENDING, - 'building': NodeState.PENDING, - 'running': NodeState.RUNNING, - 'error': NodeState.TERMINATED, - 'unknown': NodeState.UNKNOWN} - - -class BlueboxResponse(JsonResponse): - def parse_error(self): - if int(self.status) == 401: - if not self.body: - raise InvalidCredsError(str(self.status) + ': ' + self.error) - else: - raise InvalidCredsError(self.body) - return self.body - - -class BlueboxNodeSize(NodeSize): - def __init__(self, id, name, cpu, ram, disk, price, driver): - self.id = id - self.name = name - self.cpu = cpu - self.ram = ram - self.disk = disk - self.price = price - self.driver = driver - - def __repr__(self): - return (( - '') - % (self.id, self.name, self.cpu, self.ram, self.disk, - self.price, self.driver.name)) - - -class BlueboxConnection(ConnectionUserAndKey): - """ - Connection class for the Bluebox driver - """ - - host = BLUEBOX_API_HOST - secure = True - responseCls = BlueboxResponse - - allow_insecure = False - - def add_default_headers(self, headers): - user_b64 = base64.b64encode(b('%s:%s' % (self.user_id, self.key))) - headers['Authorization'] = 'Basic %s' % (user_b64) - return headers - - -class BlueboxNodeDriver(NodeDriver): - """ - Bluebox Blocks node driver - """ - - connectionCls = BlueboxConnection - type = Provider.BLUEBOX - api_name = 'bluebox' - name = 'Bluebox Blocks' - website = 'http://bluebox.net' - features = {'create_node': ['ssh_key', 'password']} - - def list_nodes(self): - result = self.connection.request('/api/blocks.json') - return [self._to_node(i) for i in result.object] - - def list_sizes(self, location=None): - sizes = [] - for key, values in list(BLUEBOX_INSTANCE_TYPES.items()): - attributes = copy.deepcopy(values) - attributes.update({'price': self._get_size_price(size_id=key)}) - sizes.append(BlueboxNodeSize(driver=self.connection.driver, - **attributes)) - - return sizes - - def list_images(self, location=None): - result = self.connection.request('/api/block_templates.json') - images = [] - for image in result.object: - images.extend([self._to_image(image)]) - - return images - - def create_node(self, **kwargs): - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - size = kwargs["size"] - - name = kwargs['name'] - image = kwargs['image'] - size = kwargs['size'] - - auth = self._get_and_check_auth(kwargs.get('auth')) - - data = { - 'hostname': name, - 'product': size.id, - 'template': image.id - } - - ssh = None - password = None - - if isinstance(auth, NodeAuthSSHKey): - ssh = auth.pubkey - data.update(ssh_public_key=ssh) - elif isinstance(auth, NodeAuthPassword): - password = auth.password - data.update(password=password) - - if "ex_username" in kwargs: - data.update(username=kwargs["ex_username"]) - - if not ssh and not password: - raise Exception("SSH public key or password required.") - - params = urlencode(data) - result = self.connection.request('/api/blocks.json', headers=headers, - data=params, method='POST') - node = self._to_node(result.object) - - if getattr(auth, "generated", False): - node.extra['password'] = auth.password - - return node - - def destroy_node(self, node): - url = '/api/blocks/%s.json' % (node.id) - result = self.connection.request(url, method='DELETE') - - return result.status == 200 - - def list_locations(self): - return [NodeLocation(0, "Blue Box Seattle US", 'US', self)] - - def reboot_node(self, node): - url = '/api/blocks/%s/reboot.json' % (node.id) - result = self.connection.request(url, method="PUT") - return result.status == 200 - - def _to_node(self, vm): - state = NODE_STATE_MAP[vm.get('status', NodeState.UNKNOWN)] - n = Node(id=vm['id'], - name=vm['hostname'], - state=state, - public_ips=[ip['address'] for ip in vm['ips']], - private_ips=[], - extra={'storage': vm['storage'], 'cpu': vm['cpu']}, - driver=self.connection.driver) - return n - - def _to_image(self, image): - image = NodeImage(id=image['id'], - name=image['description'], - driver=self.connection.driver) - return image diff --git a/libcloud/compute/drivers/brightbox.py b/libcloud/compute/drivers/brightbox.py index 8798332ff0..655ee7242c 100644 --- a/libcloud/compute/drivers/brightbox.py +++ b/libcloud/compute/drivers/brightbox.py @@ -16,22 +16,18 @@ Brightbox Driver """ -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import b - -from libcloud.common.brightbox import BrightboxConnection -from libcloud.compute.types import Provider, NodeState -from libcloud.compute.base import NodeDriver -from libcloud.compute.base import Node, NodeImage, NodeSize, NodeLocation - import base64 +from libcloud.utils.py3 import b, httplib +from libcloud.compute.base import Node, NodeSize, NodeImage, NodeDriver, NodeLocation +from libcloud.compute.types import Provider, NodeState +from libcloud.common.brightbox import BrightboxConnection -API_VERSION = '1.0' +API_VERSION = "1.0" def _extract(d, keys): - return dict((k, d[k]) for k in keys if k in d and d[k] is not None) + return {k: d[k] for k in keys if k in d and d[k] is not None} class BrightboxNodeDriver(NodeDriver): @@ -42,106 +38,139 @@ class BrightboxNodeDriver(NodeDriver): connectionCls = BrightboxConnection type = Provider.BRIGHTBOX - name = 'Brightbox' - website = 'http://www.brightbox.co.uk/' - - NODE_STATE_MAP = {'creating': NodeState.PENDING, - 'active': NodeState.RUNNING, - 'inactive': NodeState.UNKNOWN, - 'deleting': NodeState.UNKNOWN, - 'deleted': NodeState.TERMINATED, - 'failed': NodeState.UNKNOWN, - 'unavailable': NodeState.UNKNOWN} - - def __init__(self, key, secret=None, secure=True, host=None, port=None, - api_version=API_VERSION, **kwargs): - super(BrightboxNodeDriver, self).__init__(key=key, secret=secret, - secure=secure, - host=host, port=port, - api_version=api_version, - **kwargs) + name = "Brightbox" + website = "http://www.brightbox.co.uk/" + + NODE_STATE_MAP = { + "creating": NodeState.PENDING, + "active": NodeState.RUNNING, + "inactive": NodeState.UNKNOWN, + "deleting": NodeState.UNKNOWN, + "deleted": NodeState.TERMINATED, + "failed": NodeState.UNKNOWN, + "unavailable": NodeState.UNKNOWN, + } + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=API_VERSION, + **kwargs, + ): + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + api_version=api_version, + **kwargs, + ) def _to_node(self, data): - extra_data = _extract(data, ['fqdn', 'user_data', 'status', - 'interfaces', 'snapshots', - 'server_groups', 'hostname', - 'started_at', 'created_at', - 'deleted_at']) - extra_data['zone'] = self._to_location(data['zone']) + extra_data = _extract( + data, + [ + "fqdn", + "user_data", + "status", + "interfaces", + "snapshots", + "server_groups", + "hostname", + "started_at", + "created_at", + "deleted_at", + ], + ) + extra_data["zone"] = self._to_location(data["zone"]) - ipv6_addresses = [interface['ipv6_address'] for interface - in data['interfaces'] if 'ipv6_address' in interface] + ipv6_addresses = [ + interface["ipv6_address"] + for interface in data["interfaces"] + if "ipv6_address" in interface + ] - private_ips = [interface['ipv4_address'] - for interface in data['interfaces'] - if 'ipv4_address' in interface] + private_ips = [ + interface["ipv4_address"] + for interface in data["interfaces"] + if "ipv4_address" in interface + ] - public_ips = [cloud_ip['public_ip'] for cloud_ip in data['cloud_ips']] + public_ips = [cloud_ip["public_ip"] for cloud_ip in data["cloud_ips"]] public_ips += ipv6_addresses return Node( - id=data['id'], - name=data['name'], - state=self.NODE_STATE_MAP[data['status']], + id=data["id"], + name=data["name"], + state=self.NODE_STATE_MAP[data["status"]], private_ips=private_ips, public_ips=public_ips, driver=self.connection.driver, - size=self._to_size(data['server_type']), - image=self._to_image(data['image']), - extra=extra_data + size=self._to_size(data["server_type"]), + image=self._to_image(data["image"]), + extra=extra_data, ) def _to_image(self, data): - extra_data = _extract(data, ['arch', 'compatibility_mode', - 'created_at', 'description', - 'disk_size', 'min_ram', 'official', - 'owner', 'public', 'source', - 'source_type', 'status', 'username', - 'virtual_size', 'licence_name']) - - if data.get('ancestor', None): - extra_data['ancestor'] = self._to_image(data['ancestor']) - - return NodeImage( - id=data['id'], - name=data['name'], - driver=self, - extra=extra_data + extra_data = _extract( + data, + [ + "arch", + "compatibility_mode", + "created_at", + "description", + "disk_size", + "min_ram", + "official", + "owner", + "public", + "source", + "source_type", + "status", + "username", + "virtual_size", + "licence_name", + ], ) + if data.get("ancestor", None): + extra_data["ancestor"] = self._to_image(data["ancestor"]) + + return NodeImage(id=data["id"], name=data["name"], driver=self, extra=extra_data) + def _to_size(self, data): return NodeSize( - id=data['id'], - name=data['name'], - ram=data['ram'], - disk=data['disk_size'], + id=data["id"], + name=data["name"], + ram=data["ram"], + disk=data["disk_size"], bandwidth=0, price=0, - driver=self + driver=self, ) def _to_location(self, data): if data: - return NodeLocation( - id=data['id'], - name=data['handle'], - country='GB', - driver=self - ) + return NodeLocation(id=data["id"], name=data["handle"], country="GB", driver=self) else: return None def _post(self, path, data={}): - headers = {'Content-Type': 'application/json'} - return self.connection.request(path, data=data, headers=headers, - method='POST') + headers = {"Content-Type": "application/json"} + return self.connection.request(path, data=data, headers=headers, method="POST") def _put(self, path, data={}): - headers = {'Content-Type': 'application/json'} - return self.connection.request(path, data=data, headers=headers, - method='PUT') + headers = {"Content-Type": "application/json"} + return self.connection.request(path, data=data, headers=headers, method="PUT") - def create_node(self, **kwargs): + def create_node( + self, name, size, image, location=None, auth=None, ex_userdata=None, ex_servergroup=None + ): """Create a new Brightbox node Reference: https://api.gb1.brightbox.com/1.0/#server_create_server @@ -156,47 +185,48 @@ def create_node(self, **kwargs): :type ex_servergroup: ``str`` or ``list`` of ``str`` """ data = { - 'name': kwargs['name'], - 'server_type': kwargs['size'].id, - 'image': kwargs['image'].id, + "name": name, + "server_type": size.id, + "image": image.id, } - if 'ex_userdata' in kwargs: - data['user_data'] = base64.b64encode(b(kwargs['ex_userdata'])) \ - .decode('ascii') + if ex_userdata: + data["user_data"] = base64.b64encode(b(ex_userdata)).decode("ascii") - if 'location' in kwargs: - data['zone'] = kwargs['location'].id + if location: + data["zone"] = location.id - if 'ex_servergroup' in kwargs: - if not isinstance(kwargs['ex_servergroup'], list): - kwargs['ex_servergroup'] = [kwargs['ex_servergroup']] - data['server_groups'] = kwargs['ex_servergroup'] + if ex_servergroup: + if not isinstance(ex_servergroup, list): + ex_servergroup = [ex_servergroup] + data["server_groups"] = ex_servergroup - data = self._post('/%s/servers' % self.api_version, data).object + data = self._post("/%s/servers" % self.api_version, data).object return self._to_node(data) def destroy_node(self, node): response = self.connection.request( - '/%s/servers/%s' % (self.api_version, node.id), - method='DELETE') + "/{}/servers/{}".format(self.api_version, node.id), method="DELETE" + ) return response.status == httplib.ACCEPTED def list_nodes(self): - data = self.connection.request('/%s/servers' % self.api_version).object + data = self.connection.request("/%s/servers" % self.api_version).object return list(map(self._to_node, data)) def list_images(self, location=None): - data = self.connection.request('/%s/images' % self.api_version).object + data = self.connection.request("/%s/images" % self.api_version).object return list(map(self._to_image, data)) - def list_sizes(self): - data = self.connection.request('/%s/server_types' % self.api_version) \ - .object + def list_sizes( + self, + location=None, + ): + data = self.connection.request("/%s/server_types" % self.api_version).object return list(map(self._to_size, data)) def list_locations(self): - data = self.connection.request('/%s/zones' % self.api_version).object + data = self.connection.request("/%s/zones" % self.api_version).object return list(map(self._to_location, data)) def ex_list_cloud_ips(self): @@ -207,8 +237,7 @@ def ex_list_cloud_ips(self): :rtype: ``list`` of ``dict`` """ - return self.connection.request('/%s/cloud_ips' % self.api_version) \ - .object + return self.connection.request("/%s/cloud_ips" % self.api_version).object def ex_create_cloud_ip(self, reverse_dns=None): """ @@ -224,9 +253,9 @@ def ex_create_cloud_ip(self, reverse_dns=None): params = {} if reverse_dns: - params['reverse_dns'] = reverse_dns + params["reverse_dns"] = reverse_dns - return self._post('/%s/cloud_ips' % self.api_version, params).object + return self._post("/%s/cloud_ips" % self.api_version, params).object def ex_update_cloud_ip(self, cloud_ip_id, reverse_dns): """ @@ -242,9 +271,10 @@ def ex_update_cloud_ip(self, cloud_ip_id, reverse_dns): :rtype: ``dict`` """ - response = self._put('/%s/cloud_ips/%s' % (self.api_version, - cloud_ip_id), - {'reverse_dns': reverse_dns}) + response = self._put( + "/{}/cloud_ips/{}".format(self.api_version, cloud_ip_id), + {"reverse_dns": reverse_dns}, + ) return response.status == httplib.OK def ex_map_cloud_ip(self, cloud_ip_id, interface_id): @@ -264,9 +294,10 @@ def ex_map_cloud_ip(self, cloud_ip_id, interface_id): :return: True if the mapping was successful. :rtype: ``bool`` """ - response = self._post('/%s/cloud_ips/%s/map' % (self.api_version, - cloud_ip_id), - {'destination': interface_id}) + response = self._post( + "/{}/cloud_ips/{}/map".format(self.api_version, cloud_ip_id), + {"destination": interface_id}, + ) return response.status == httplib.ACCEPTED def ex_unmap_cloud_ip(self, cloud_ip_id): @@ -283,8 +314,7 @@ def ex_unmap_cloud_ip(self, cloud_ip_id): :return: True if the unmap was successful. :rtype: ``bool`` """ - response = self._post('/%s/cloud_ips/%s/unmap' % (self.api_version, - cloud_ip_id)) + response = self._post("/{}/cloud_ips/{}/unmap".format(self.api_version, cloud_ip_id)) return response.status == httplib.ACCEPTED def ex_destroy_cloud_ip(self, cloud_ip_id): @@ -300,7 +330,6 @@ def ex_destroy_cloud_ip(self, cloud_ip_id): :rtype: ``bool`` """ response = self.connection.request( - '/%s/cloud_ips/%s' % (self.api_version, - cloud_ip_id), - method='DELETE') + "/{}/cloud_ips/{}".format(self.api_version, cloud_ip_id), method="DELETE" + ) return response.status == httplib.OK diff --git a/libcloud/compute/drivers/cloudframes.py b/libcloud/compute/drivers/cloudframes.py deleted file mode 100644 index 9902f5dbb9..0000000000 --- a/libcloud/compute/drivers/cloudframes.py +++ /dev/null @@ -1,431 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -CloudFrames Driver - -""" - -# (name, ram, disk, bandwidth, price, vcpus) -SIZES = [ - ('512mb_1core_10gb', 512, 10, 512, 0.025, 1), - ('1024mb_1core_20gb', 1024, 20, 512, 0.05, 1), - ('2048mb_2core_50gb', 2048, 50, 1024, 0.10, 2), - ('4096mb_2core_100gb', 4096, 100, 2048, 0.20, 2), - ('8192mb_4core_200gb', 8192, 200, 2048, 0.40, 4), - ('16384mb_4core_400gb', 16384, 400, 4096, 0.80, 4), -] - -import base64 -import random - -from libcloud.utils.py3 import urlparse, b -from libcloud.common.base import ConnectionKey -from libcloud.common.xmlrpc import XMLRPCResponse, XMLRPCConnection -from libcloud.common.types import ProviderError -from libcloud.compute.base import NodeImage, NodeSize, Node, NodeLocation -from libcloud.compute.base import NodeDriver -from libcloud.compute.types import Provider, NodeState - - -class CloudFramesException(ProviderError): - pass - - -class CloudFramesComponent(object): - """ - Represents a node in the cloudapi path. - """ - - def __init__(self, cloudFramesConnection, name): - self.cloudFramesConnection = cloudFramesConnection - self.name = name - - def __getattr__(self, key): - return self.method(key) - - def method(self, methodname): - def foo(*args, **kwargs): - async = kwargs.get('async', False) - args = list(args) - args.append('') # jobguid - args.append({'wait': False} if async else {}) # executionparams - response = self.cloudFramesConnection.request( - 'cloud_api_%s.%s' % (self.name, methodname), *args) - if not response.success(): - response.parse_error() - if async: - return response.parse_body()['jobguid'] - else: - return response.parse_body()['result'] - return foo - - -class CloudFramesNodeSize(NodeSize): - - def __init__(self, id, name, ram, disk, bandwidth, price, driver, - vcpus=None): - super(CloudFramesNodeSize, self).__init__( - id, name, ram, disk, bandwidth, price, driver) - self.vcpus = vcpus - - -class CloudFramesNode(Node): - - def list_snapshots(self): - return self.driver.ex_list_snapshots(self) - - def snapshot(self, label='', description=''): - return self.driver.ex_snapshot_node(self, label, description) - - def rollback(self, snapshot): - return self.driver.ex_rollback_node(self, snapshot) - - -class CloudFramesSnapshot(object): - - def __init__(self, id, timestamp, label, description, driver): - self.id = id - self.timestamp = timestamp - self.label = label - self.description = description - self.driver = driver - - def destroy(self): - self.driver.ex_destroy_snapshot(self) - - -class CloudFramesConnection(XMLRPCConnection, ConnectionKey): - """ - Cloudapi connection class - """ - - repsonseCls = XMLRPCResponse - base_url = None - - def __init__(self, key=None, secret=None, secure=True, - host=None, port=None, url=None, timeout=None): - """ - :param key: The username to connect with to the cloudapi - :type key: ``str`` - - :param secret: The password to connect with to the cloudapi - :type secret: ``str`` - - :param secure: Should always be false at the moment - :type secure: ``bool`` - - :param host: The hostname of the cloudapi - :type host: ``str`` - - :param port: The port on which to connect to the cloudapi - :type port: ``int`` - - :param url: Url to the cloudapi (can replace all above) - :type url: ``str`` - """ - - super(CloudFramesConnection, self).__init__(key=key, secure=secure, - host=host, port=port, - url=url, timeout=timeout) - self._auth = base64.b64encode( - b('%s:%s' % (key, secret))).decode('utf-8') - self.endpoint = url - - def __getattr__(self, key): - return CloudFramesComponent(self, key) - - def add_default_headers(self, headers): - headers['Authorization'] = 'Basic %s' % self._auth - return headers - - -class CloudFramesNodeDriver(NodeDriver): - """ - CloudFrames node driver - """ - - connectionCls = CloudFramesConnection - - name = 'CloudFrames' - api_name = 'cloudframes' - website = 'http://www.cloudframes.net/' - type = Provider.CLOUDFRAMES - - NODE_STATE_MAP = { - 'CONFIGURED': NodeState.PENDING, - 'CREATED': NodeState.PENDING, - 'DELETING': NodeState.PENDING, - 'HALTED': NodeState.TERMINATED, - 'IMAGEONLY': NodeState.UNKNOWN, - 'ISCSIEXPOSED': NodeState.PENDING, - 'MOVING': NodeState.PENDING, - 'OVERLOADED': NodeState.UNKNOWN, - 'PAUSED': NodeState.TERMINATED, - 'RUNNING': NodeState.RUNNING, - 'STARTING': NodeState.PENDING, - 'STOPPING': NodeState.PENDING, - 'SYNCING': NodeState.PENDING, - 'TODELETE': NodeState.PENDING, - } - - # subclassed internal methods - def __init__(self, key=None, secret=None, secure=True, - host=None, port=None, url=None, **kwargs): - if not port: - port = 443 if secure else 80 - if url: - if not url.endswith('/'): - url += '/' - scheme, netloc, _, _, _, _ = urlparse.urlparse(url) - secure = (scheme == 'https') - if '@' in netloc: - auth, hostport = netloc.rsplit('@', 1) - if ':' in auth: - key, secret = auth.split(':', 1) - else: - key = auth - else: - hostport = netloc - if ':' in hostport: - host, port = hostport.split(':') - else: - host = hostport - hostport = '%s:%s' % (host, port) - url = url.replace(netloc, hostport) - else: - url = '%s://%s:%s/appserver/xmlrpc/' % ( - 'https' if secure else 'http', host, port) - - if secure: - raise NotImplementedError( - 'The cloudapi only supports unsecure connections') - - if key is None or secret is None: - raise NotImplementedError( - 'Unauthenticated support to the cloudapi is not supported') - - # connection url - self._url = url - - # cached attributes - self.__cloudspaceguid = None - self.__languid = None - self.__locations = [] - - super(CloudFramesNodeDriver, self).__init__( - key, secret, secure, host, port, **kwargs) - - def _ex_connection_class_kwargs(self): - return {'url': self._url} - - # internal methods - @property - def _cloudspaceguid(self): - if not self.__cloudspaceguid: - self.__cloudspaceguid = self.connection.cloudspace.find( - '', '', 'cloud', '')[0] - return self.__cloudspaceguid - - @property - def _languid(self): - if not self.__languid: - self.__languid = self.connection.lan.find( - '', '', 'public_virtual', '', '', '', '', '', '', '', '', '', - '', '', '', '', '')[0] - return self.__languid - - def _get_machine_data(self, guid): - """ - Looks up some basic data related to the given machine guid. - """ - try: - d = self.connection.machine.list('', '', '', guid, '')[0] - except IndexError: - raise CloudFramesException('VM no longer exists', 404, self) - d['public_ips'] = [] - d['private_ips'] = [] - d['size'] = None - d['image'] = None - return d - - def _machine_find(self, template=False, machinetype=None, - machinerole=None): - # the cloudframes xmlrpc api requires you to pass all args and kwargs - # as positional arguments, you can't use keywords arguments - if not machinetype: - guids = [] - for machinetype in ['VIRTUALSERVER', 'VIRTUALDESKTOP']: - guids += self.connection.machine.find( - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', machinetype, template, '', '', '', '', '', '', '', - '', '', '', '', '', '', '') - else: - guids = self.connection.machine.find( - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', machinetype, '', '', '', '', '', '', '', '', - machinerole, '', '', '', '', '', '') - return guids - - def _to_image(self, image_dict): - return NodeImage(id=image_dict['guid'], - name=image_dict['name'], - driver=self.connection.driver) - - def _to_size(self, id, name, ram, disk, bandwidth, price, vcpus): - return CloudFramesNodeSize( - id, name, ram, disk, bandwidth, price, self, vcpus) - - def _to_location(self, location_dict): - return NodeLocation(id=location_dict['guid'], - name=location_dict['name'], - country=None, - driver=self) - - def _to_node(self, node_dict): - # only return nodes which can be worked with - # (ignore cloudframes internal autotests and deleted nodes) - if node_dict['status'] == 'CONFIGURED': - return None - return CloudFramesNode(id=node_dict['guid'], - name=node_dict['name'], - state=self.NODE_STATE_MAP.get( - node_dict['status'], NodeState.UNKNOWN), - public_ips=node_dict['public_ips'], - private_ips=node_dict['private_ips'], - driver=self.connection.driver, - size=node_dict['size'], - image=node_dict['image'], - extra={}) - - def _to_snapshot(self, snapshot_dict): - return CloudFramesSnapshot(id=snapshot_dict['guid'], - timestamp=snapshot_dict['timestamp'], - label=snapshot_dict['backuplabel'], - description=snapshot_dict['description'], - driver=self) - - # subclassed public methods, and provider specific public methods - def list_images(self, location=None): - image_ids = self._machine_find(template=True) - image_list = [] - for image_id in image_ids: - image_list.append(self._to_image(self._get_machine_data(image_id))) - return image_list - - def list_sizes(self, location=None): - sizes = [] - for id in range(len(SIZES)): - sizes.append(self._to_size(id, *SIZES[id])) - return sizes - - def list_locations(self, ex_use_cached=True): - if not self.__locations or not ex_use_cached: - self.__locations = [] - for location_id in self._machine_find(machinetype='PHYSICAL', - machinerole='COMPUTENODE'): - self.__locations.append( - self._to_location(self._get_machine_data(location_id))) - return self.__locations - - def list_nodes(self): - node_ids = self._machine_find() - node_list = [] - for node_id in node_ids: - node = self._to_node(self._get_machine_data(node_id)) - if node: - node_list.append(node) - return node_list - - def create_node(self, **kwargs): - """ - Creates a new node, by cloning the template provided. - - If no location object is passed, a random location will be used. - - - :param image: The template to be cloned (required) - :type image: ``list`` of :class:`NodeImage` - - :param name: The name for the new node (required) - :type name: ``str`` - - :param size: The size of the new node (required) - :type size: ``list`` of :class:`NodeSize` - - :param location: The location to create the new node - :type location: ``list`` of :class:`NodeLocation` - - :param default_gateway: The default gateway to be used - :type default_gateway: ``str`` - - :param extra: Additional requirements (extra disks fi.) - :type extra: ``dict`` - - - :returns: ``list`` of :class:`Node` -- The newly created Node object - - :raises: CloudFramesException - """ - - additionalinfo = kwargs.get('extra', {}) - additionalinfo.update({ - 'memory': kwargs['size'].ram, - 'cpu': kwargs['size'].vcpus, - }) - guid = self.connection.machine.createFromTemplate( - self._cloudspaceguid, kwargs['image'].id, kwargs['name'], - [{'languid': self._languid}], kwargs['name'], - kwargs.get('location', random.choice(self.list_locations())).id, - kwargs.get('default_gateway', ''), None, additionalinfo) - if not self.connection.machine.start(guid): - raise CloudFramesException( - 'failed to start machine after creation', 500, self) - return self._to_node(self._get_machine_data(guid)) - - def destroy_node(self, node): - return self.connection.machine.delete(node.id, False) - - def reboot_node(self, node, ex_clean=True): - return self.connection.machine.reboot(node.id, ex_clean) - - def ex_snapshot_node(self, node, label='', description=''): - guid = self.connection.machine.snapshot( - node.id, label, description, False, False, 'PAUSED') - for snapshot in self.ex_list_snapshots(node): - if snapshot.id == guid: - return snapshot - else: - raise CloudFramesException('Snapshot creation failed', 500, self) - - def ex_rollback_node(self, node, snapshot): - if not node.state == NodeState.TERMINATED: - self.connection.machine.stop(node.id, False, 930) - success = self.connection.machine.rollback(node.id, snapshot.id) - self.connection.machine.start(node.id) - return success - - def ex_list_snapshots(self, node): - return [self._to_snapshot(snapshot_dict) for snapshot_dict in - self.connection.machine.listSnapshots(node.id, False, '', '')] - - def ex_destroy_snapshot(self, node, snapshot): - return self.connection.machine.delete(snapshot.id, False) - - -if __name__ == "__main__": - import doctest - - doctest.testmod() diff --git a/libcloud/compute/drivers/cloudscale.py b/libcloud/compute/drivers/cloudscale.py new file mode 100644 index 0000000000..d16a9b3101 --- /dev/null +++ b/libcloud/compute/drivers/cloudscale.py @@ -0,0 +1,265 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +A driver for cloudscale.ch. +""" + +import json + +from libcloud.utils.py3 import httplib +from libcloud.common.base import JsonResponse, ConnectionKey +from libcloud.common.types import InvalidCredsError +from libcloud.compute.base import Node, NodeSize, NodeImage, NodeDriver +from libcloud.compute.types import Provider, NodeState + + +class CloudscaleResponse(JsonResponse): + valid_response_codes = [ + httplib.OK, + httplib.ACCEPTED, + httplib.CREATED, + httplib.NO_CONTENT, + ] + + def parse_error(self): + body = self.parse_body() + if self.status == httplib.UNAUTHORIZED: + raise InvalidCredsError(body["detail"]) + else: + # We are taking the first issue here. There might be multiple ones, + # but that doesn't really matter. It's nicer if the error is just + # one error (because it's a Python API and there's only one + # exception. + return next(iter(body.values())) + + def success(self): + return self.status in self.valid_response_codes + + +class CloudscaleConnection(ConnectionKey): + """ + Connection class for the cloudscale.ch driver. + """ + + host = "api.cloudscale.ch" + responseCls = CloudscaleResponse + + def add_default_headers(self, headers): + """ + Add headers that are necessary for every request + + This method adds ``token`` to the request. + """ + headers["Authorization"] = "Bearer %s" % (self.key) + headers["Content-Type"] = "application/json" + return headers + + +class CloudscaleNodeDriver(NodeDriver): + """ + Cloudscale's node driver. + """ + + connectionCls = CloudscaleConnection + + type = Provider.CLOUDSCALE + name = "Cloudscale" + website = "https://www.cloudscale.ch" + + NODE_STATE_MAP = dict( + changing=NodeState.PENDING, + running=NodeState.RUNNING, + stopped=NodeState.STOPPED, + paused=NodeState.PAUSED, + ) + + def __init__(self, key, **kwargs): + super().__init__(key, **kwargs) + + def list_nodes(self): + """ + List all your existing compute nodes. + """ + return self._list_resources("/v1/servers", self._to_node) + + def list_sizes( + self, + location=None, + ): + """ + Lists all available sizes. On cloudscale these are known as flavors. + """ + return self._list_resources("/v1/flavors", self._to_size) + + def list_images( + self, + location=None, + ): + """ + List all images. + + Images are identified by slugs on cloudscale.ch. This means that minor + version upgrades (e.g. Ubuntu 16.04.1 to Ubuntu 16.04.2) will be + possible within the same id ``ubuntu-16.04``. + """ + return self._list_resources("/v1/images", self._to_image) + + def create_node(self, name, size, image, location=None, auth=None, ex_create_attr=None): + """ + Create a node. + + The `ex_create_attr` parameter can include the following dictionary + key and value pairs: + + * `ssh_keys`: ``list`` of ``str`` ssh public keys + * `volume_size_gb`: ``int`` defaults to 10. + * `bulk_volume_size_gb`: defaults to None. + * `use_public_network`: ``bool`` defaults to True + * `use_private_network`: ``bool`` defaults to False + * `use_ipv6`: ``bool`` defaults to True + * `anti_affinity_with`: ``uuid`` of a server to create an anti-affinity + group with that server or add it to the same group as that server. + * `user_data`: ``str`` for optional cloud-config data + + :keyword ex_create_attr: A dictionary of optional attributes for + droplet creation + :type ex_create_attr: ``dict`` + + :return: The newly created node. + :rtype: :class:`Node` + """ + ex_create_attr = ex_create_attr or {} + attr = dict(ex_create_attr) + attr.update( + name=name, + image=image.id, + flavor=size.id, + ) + result = self.connection.request("/v1/servers", data=json.dumps(attr), method="POST") + return self._to_node(result.object) + + def reboot_node(self, node): + """ + Reboot a node. It's also possible to use ``node.reboot()``. + """ + return self._action(node, "reboot") + + def start_node(self, node): + """ + Start a node. This is only possible if the node is stopped. + """ + return self._action(node, "start") + + def stop_node(self, node): + """ + Stop a specific node. Similar to ``shutdown -h now``. This is only + possible if the node is running. + """ + return self._action(node, "stop") + + def ex_start_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.start_node(node=node) + + def ex_stop_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.stop_node(node=node) + + def ex_node_by_uuid(self, uuid): + """ + :param str ex_user_data: A valid uuid that references your existing + cloudscale.ch server. + :type ex_user_data: ``str`` + + :return: The server node you asked for. + :rtype: :class:`Node` + """ + res = self.connection.request(self._get_server_url(uuid)) + return self._to_node(res.object) + + def destroy_node(self, node): + """ + Delete a node. It's also possible to use ``node.destroy()``. + This will irreversibly delete the cloudscale.ch server and all its + volumes. So please be cautious. + """ + res = self.connection.request(self._get_server_url(node.id), method="DELETE") + return res.status == httplib.NO_CONTENT + + def _get_server_url(self, uuid): + return "/v1/servers/%s" % uuid + + def _action(self, node, action_name): + response = self.connection.request( + self._get_server_url(node.id) + "/" + action_name, method="POST" + ) + return response.status == httplib.OK + + def _list_resources(self, url, tranform_func): + data = self.connection.request(url, method="GET").object + return [tranform_func(obj) for obj in data] + + def _to_node(self, data): + state = self.NODE_STATE_MAP.get(data["status"], NodeState.UNKNOWN) + extra_keys_exclude = ["uuid", "name", "status", "flavor", "image"] + extra = {} + for k, v in data.items(): + if k not in extra_keys_exclude: + extra[k] = v + + public_ips = [] + private_ips = [] + for interface in data["interfaces"]: + if interface["type"] == "public": + ips = public_ips + else: + ips = private_ips + for address_obj in interface["addresses"]: + ips.append(address_obj["address"]) + + return Node( + id=data["uuid"], + name=data["name"], + state=state, + public_ips=public_ips, + private_ips=private_ips, + extra=extra, + driver=self, + image=self._to_image(data["image"]), + size=self._to_size(data["flavor"]), + ) + + def _to_size(self, data): + extra = {"vcpu_count": data["vcpu_count"]} + ram = data["memory_gb"] * 1024 + + return NodeSize( + id=data["slug"], + name=data["name"], + ram=ram, + disk=10, + bandwidth=0, + price=0, + extra=extra, + driver=self, + ) + + def _to_image(self, data): + extra = {"operating_system": data["operating_system"]} + return NodeImage(id=data["slug"], name=data["name"], extra=extra, driver=self) diff --git a/libcloud/compute/drivers/cloudsigma.py b/libcloud/compute/drivers/cloudsigma.py index 29b65cb21b..0bb2b48371 100644 --- a/libcloud/compute/drivers/cloudsigma.py +++ b/libcloud/compute/drivers/cloudsigma.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. @@ -19,79 +18,95 @@ """ import re -import time import copy +import time import base64 +import hashlib + +from libcloud.utils.py3 import b, httplib +from libcloud.utils.misc import dict2str, str2list, str2dicts, get_secure_random_string +from libcloud.common.base import Response, JsonResponse, ConnectionUserAndKey +from libcloud.common.types import ProviderError, InvalidCredsError +from libcloud.compute.base import Node, KeyPair, NodeSize, NodeImage, NodeDriver, is_private_subnet +from libcloud.compute.types import Provider, NodeState +from libcloud.utils.iso8601 import parse_date +from libcloud.common.cloudsigma import ( + SPECS_TO_SIZE, + DEFAULT_REGION, + INSTANCE_TYPES, + MAX_VIRTIO_UNITS, + API_ENDPOINTS_1_0, + API_ENDPOINTS_2_0, + DEFAULT_API_VERSION, + MAX_VIRTIO_CONTROLLERS, +) try: import simplejson as json -except: +except Exception: import json -from libcloud.utils.py3 import b -from libcloud.utils.py3 import httplib - -from libcloud.utils.misc import str2dicts, str2list, dict2str -from libcloud.common.base import ConnectionUserAndKey, JsonResponse, Response -from libcloud.common.types import InvalidCredsError, ProviderError -from libcloud.common.cloudsigma import INSTANCE_TYPES -from libcloud.common.cloudsigma import API_ENDPOINTS_1_0 -from libcloud.common.cloudsigma import API_ENDPOINTS_2_0 -from libcloud.common.cloudsigma import DEFAULT_API_VERSION, DEFAULT_REGION -from libcloud.compute.types import NodeState, Provider -from libcloud.compute.base import NodeDriver, NodeSize, Node -from libcloud.compute.base import NodeImage -from libcloud.compute.base import is_private_subnet -from libcloud.utils.iso8601 import parse_date -from libcloud.utils.misc import get_secure_random_string __all__ = [ - 'CloudSigmaNodeDriver', - 'CloudSigma_1_0_NodeDriver', - 'CloudSigma_2_0_NodeDriver', - 'CloudSigmaError', - - 'CloudSigmaNodeSize', - 'CloudSigmaDrive', - 'CloudSigmaTag', - 'CloudSigmaSubscription', - 'CloudSigmaFirewallPolicy', - 'CloudSigmaFirewallPolicyRule' + "CloudSigmaNodeDriver", + "CloudSigma_1_0_NodeDriver", + "CloudSigma_2_0_NodeDriver", + "CloudSigmaError", + "CloudSigmaNodeSize", + "CloudSigmaDrive", + "CloudSigmaTag", + "CloudSigmaSubscription", + "CloudSigmaFirewallPolicy", + "CloudSigmaFirewallPolicyRule", ] class CloudSigmaNodeDriver(NodeDriver): - name = 'CloudSigma' - website = 'http://www.cloudsigma.com/' - - def __new__(cls, key, secret=None, secure=True, host=None, port=None, - api_version=DEFAULT_API_VERSION, **kwargs): + name = "CloudSigma" + website = "http://www.cloudsigma.com/" + + def __new__( + cls, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=DEFAULT_API_VERSION, + **kwargs, + ): if cls is CloudSigmaNodeDriver: - if api_version == '1.0': + if api_version == "1.0": cls = CloudSigma_1_0_NodeDriver - elif api_version == '2.0': + elif api_version == "2.0": cls = CloudSigma_2_0_NodeDriver else: - raise NotImplementedError('Unsupported API version: %s' % - (api_version)) - return super(CloudSigmaNodeDriver, cls).__new__(cls) + raise NotImplementedError("Unsupported API version: %s" % (api_version)) + + return super().__new__(cls) class CloudSigmaException(Exception): def __str__(self): + # pylint: disable=unsubscriptable-object + return self.args[0] def __repr__(self): + # pylint: disable=unsubscriptable-object + return "" % (self.args[0]) class CloudSigmaInsufficientFundsException(Exception): def __repr__(self): + # pylint: disable=unsubscriptable-object + return "" % (self.args[0]) class CloudSigmaNodeSize(NodeSize): - def __init__(self, id, name, cpu, ram, disk, bandwidth, price, driver): + def __init__(self, id, name, cpu, ram, disk, bandwidth, price, driver, extra=None): self.id = id self.name = name self.cpu = cpu @@ -100,12 +115,22 @@ def __init__(self, id, name, cpu, ram, disk, bandwidth, price, driver): self.bandwidth = bandwidth self.price = price self.driver = driver + self.extra = extra or {} def __repr__(self): - return (('') - % (self.id, self.name, self.cpu, self.ram, self.disk, - self.bandwidth, self.price, self.driver.name)) + return ( + "" + ) % ( + self.id, + self.name, + self.cpu, + self.ram, + self.disk, + self.bandwidth, + self.price, + self.driver.name, + ) class CloudSigma_1_0_Response(Response): @@ -113,7 +138,7 @@ def success(self): if self.status == httplib.UNAUTHORIZED: raise InvalidCredsError() - return self.status >= 200 and self.status <= 299 + return 200 <= self.status <= 299 def parse_body(self): if not self.body: @@ -122,51 +147,64 @@ def parse_body(self): return str2dicts(self.body) def parse_error(self): - return 'Error: %s' % (self.body.replace('errors:', '').strip()) + return "Error: %s" % (self.body.replace("errors:", "").strip()) class CloudSigma_1_0_Connection(ConnectionUserAndKey): - host = API_ENDPOINTS_1_0[DEFAULT_REGION]['host'] + host = API_ENDPOINTS_1_0[DEFAULT_REGION]["host"] responseCls = CloudSigma_1_0_Response def add_default_headers(self, headers): - headers['Accept'] = 'application/json' - headers['Content-Type'] = 'application/json' + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + + headers["Authorization"] = "Basic %s" % ( + base64.b64encode(b("{}:{}".format(self.user_id, self.key))).decode("utf-8") + ) - headers['Authorization'] = 'Basic %s' % (base64.b64encode( - b('%s:%s' % (self.user_id, self.key))).decode('utf-8')) return headers class CloudSigma_1_0_NodeDriver(CloudSigmaNodeDriver): type = Provider.CLOUDSIGMA - name = 'CloudSigma (API v1.0)' - website = 'http://www.cloudsigma.com/' + name = "CloudSigma (API v1.0)" + website = "http://www.cloudsigma.com/" connectionCls = CloudSigma_1_0_Connection IMAGING_TIMEOUT = 20 * 60 # Default timeout (in seconds) for the drive # imaging process NODE_STATE_MAP = { - 'active': NodeState.RUNNING, - 'stopped': NodeState.TERMINATED, - 'dead': NodeState.TERMINATED, - 'dumped': NodeState.TERMINATED, + "active": NodeState.RUNNING, + "stopped": NodeState.TERMINATED, + "dead": NodeState.TERMINATED, + "dumped": NodeState.TERMINATED, } - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region=DEFAULT_REGION, **kwargs): + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + region=DEFAULT_REGION, + **kwargs, + ): if region not in API_ENDPOINTS_1_0: - raise ValueError('Invalid region: %s' % (region)) + raise ValueError("Invalid region: %s" % (region)) self._host_argument_set = host is not None - self.api_name = 'cloudsigma_%s' % (region) - super(CloudSigma_1_0_NodeDriver, self).__init__(key=key, secret=secret, - secure=secure, - host=host, - port=port, - region=region, - **kwargs) + self.api_name = "cloudsigma_%s" % (region) + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + region=region, + **kwargs, + ) def reboot_node(self, node): """ @@ -186,8 +224,7 @@ def reboot_node(self, node): stopped = True if not stopped: - raise CloudSigmaException( - 'Could not stop node with id %s' % (node.id)) + raise CloudSigmaException("Could not stop node with id %s" % (node.id)) success = self.ex_start_node(node) @@ -205,18 +242,17 @@ def destroy_node(self, node): state = node.state # Node cannot be destroyed while running so it must be stopped first + if state == NodeState.RUNNING: stopped = self.ex_stop_node(node) else: stopped = True if not stopped: - raise CloudSigmaException( - 'Could not stop node with id %s' % (node.id)) + raise CloudSigmaException("Could not stop node with id %s" % (node.id)) + + response = self.connection.request(action="/servers/%s/destroy" % (node.id), method="POST") - response = self.connection.request( - action='/servers/%s/destroy' % (node.id), - method='POST') return response.status == 204 def list_images(self, location=None): @@ -226,45 +262,67 @@ def list_images(self, location=None): @inherits: :class:`NodeDriver.list_images` """ - response = self.connection.request( - action='/drives/standard/info').object + response = self.connection.request(action="/drives/standard/info").object images = [] + for value in response: - if value.get('type'): - if value['type'] == 'disk': - image = NodeImage(id=value['drive'], name=value['name'], - driver=self.connection.driver, - extra={'size': value['size']}) + if value.get("type"): + if value["type"] == "disk": + image = NodeImage( + id=value["drive"], + name=value["name"], + driver=self.connection.driver, + extra={"size": value["size"]}, + ) images.append(image) return images def list_sizes(self, location=None): sizes = [] + for value in INSTANCE_TYPES: - key = value['id'] - size = CloudSigmaNodeSize(id=value['id'], name=value['name'], - cpu=value['cpu'], ram=value['memory'], - disk=value['disk'], - bandwidth=value['bandwidth'], - price=self._get_size_price(size_id=key), - driver=self.connection.driver) + key = value["id"] + size = CloudSigmaNodeSize( + id=value["id"], + name=value["name"], + cpu=value["cpu"], + ram=value["memory"], + disk=value["disk"], + bandwidth=value["bandwidth"], + price=self._get_size_price(size_id=key), + driver=self.connection.driver, + ) sizes.append(size) return sizes def list_nodes(self): - response = self.connection.request(action='/servers/info').object + response = self.connection.request(action="/servers/info").object nodes = [] + for data in response: node = self._to_node(data) + if node: nodes.append(node) + return nodes - def create_node(self, **kwargs): + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + smp="auto", + nic_model="e1000", + vnc_password=None, + drive_type="hdd", + ): """ Creates a CloudSigma instance @@ -274,11 +332,11 @@ def create_node(self, **kwargs): :type name: ``str`` :keyword smp: Number of virtual processors or None to calculate - based on the cpu speed + based on the cpu speed. :type smp: ``int`` :keyword nic_model: e1000, rtl8139 or virtio (is not specified, - e1000 is used) + e1000 is used) :type nic_model: ``str`` :keyword vnc_password: If not set, VNC access is disabled. @@ -287,69 +345,70 @@ def create_node(self, **kwargs): :keyword drive_type: Drive type (ssd|hdd). Defaults to hdd. :type drive_type: ``str`` """ - size = kwargs['size'] - image = kwargs['image'] - smp = kwargs.get('smp', 'auto') - nic_model = kwargs.get('nic_model', 'e1000') - vnc_password = kwargs.get('vnc_password', None) - drive_type = kwargs.get('drive_type', 'hdd') - if nic_model not in ['e1000', 'rtl8139', 'virtio']: - raise CloudSigmaException('Invalid NIC model specified') + if nic_model not in ["e1000", "rtl8139", "virtio"]: + raise CloudSigmaException("Invalid NIC model specified") - if drive_type not in ['hdd', 'ssd']: - raise CloudSigmaException('Invalid drive type "%s". Valid types' - ' are: hdd, ssd' % (drive_type)) + if drive_type not in ["hdd", "ssd"]: + raise CloudSigmaException( + 'Invalid drive type "%s". Valid types' " are: hdd, ssd" % (drive_type) + ) drive_data = {} - drive_data.update({'name': kwargs['name'], - 'size': '%sG' % (kwargs['size'].disk), - 'driveType': drive_type}) + drive_data.update({"name": name, "size": "%sG" % (size.disk), "driveType": drive_type}) response = self.connection.request( - action='/drives/%s/clone' % image.id, + action="/drives/%s/clone" % image.id, data=dict2str(drive_data), - method='POST').object + method="POST", + ).object if not response: - raise CloudSigmaException('Drive creation failed') + raise CloudSigmaException("Drive creation failed") - drive_uuid = response[0]['drive'] + drive_uuid = response[0]["drive"] - response = self.connection.request( - action='/drives/%s/info' % (drive_uuid)).object + response = self.connection.request(action="/drives/%s/info" % (drive_uuid)).object imaging_start = time.time() - while 'imaging' in response[0]: - response = self.connection.request( - action='/drives/%s/info' % (drive_uuid)).object + + while "imaging" in response[0]: + response = self.connection.request(action="/drives/%s/info" % (drive_uuid)).object elapsed_time = time.time() - imaging_start timed_out = elapsed_time >= self.IMAGING_TIMEOUT - if 'imaging' in response[0] and timed_out: - raise CloudSigmaException('Drive imaging timed out') + + if "imaging" in response[0] and timed_out: + raise CloudSigmaException("Drive imaging timed out") time.sleep(1) node_data = {} node_data.update( - {'name': kwargs['name'], 'cpu': size.cpu, 'mem': size.ram, - 'ide:0:0': drive_uuid, 'boot': 'ide:0:0', 'smp': smp}) - node_data.update({'nic:0:model': nic_model, 'nic:0:dhcp': 'auto'}) + { + "name": name, + "cpu": size.cpu, + "mem": size.ram, + "ide:0:0": drive_uuid, + "boot": "ide:0:0", + "smp": smp, + } + ) + node_data.update({"nic:0:model": nic_model, "nic:0:dhcp": "auto"}) if vnc_password: - node_data.update({'vnc:ip': 'auto', 'vnc:password': vnc_password}) + node_data.update({"vnc:ip": "auto", "vnc:password": vnc_password}) - response = self.connection.request(action='/servers/create', - data=dict2str(node_data), - method='POST').object + response = self.connection.request( + action="/servers/create", data=dict2str(node_data), method="POST" + ).object if not isinstance(response, list): response = [response] node = self._to_node(response[0]) + if node is None: # Insufficient funds, destroy created drive self.ex_drive_destroy(drive_uuid) - raise CloudSigmaInsufficientFundsException( - 'Insufficient funds, node creation failed') + raise CloudSigmaInsufficientFundsException("Insufficient funds, node creation failed") # Start the node after it has been created started = self.ex_start_node(node) @@ -371,11 +430,13 @@ def ex_destroy_node_and_drives(self, node): node = self._get_node_info(node) drive_uuids = [] + for key, value in node.items(): - if (key.startswith('ide:') or key.startswith( - 'scsi') or key.startswith('block')) and\ - not (key.endswith(':bytes') or - key.endswith(':requests') or key.endswith('media')): + if ( + key.startswith("ide:") or key.startswith("scsi") or key.startswith("block") + ) and not ( + key.endswith(":bytes") or key.endswith(":requests") or key.endswith("media") + ): drive_uuids.append(value) node_destroyed = self.destroy_node(self._to_node(node)) @@ -394,13 +455,13 @@ def ex_static_ip_list(self): :rtype: ``list`` of ``str`` """ - response = self.connection.request(action='/resources/ip/list', - method='GET') + response = self.connection.request(action="/resources/ip/list", method="GET") if response.status != 200: - raise CloudSigmaException('Could not retrieve IP list') + raise CloudSigmaException("Could not retrieve IP list") ips = str2list(response.body) + return ips def ex_drives_list(self): @@ -409,9 +470,10 @@ def ex_drives_list(self): :rtype: ``list`` of ``dict`` """ - response = self.connection.request(action='/drives/info', method='GET') + response = self.connection.request(action="/drives/info", method="GET") result = str2dicts(response.body) + return result def ex_static_ip_create(self): @@ -420,10 +482,10 @@ def ex_static_ip_create(self): :rtype: ``list`` of ``dict`` """ - response = self.connection.request(action='/resources/ip/create', - method='GET') + response = self.connection.request(action="/resources/ip/create", method="GET") result = str2dicts(response.body) + return result def ex_static_ip_destroy(self, ip_address): @@ -436,7 +498,8 @@ def ex_static_ip_destroy(self, ip_address): :rtype: ``bool`` """ response = self.connection.request( - action='/resources/ip/%s/destroy' % (ip_address), method='GET') + action="/resources/ip/%s/destroy" % (ip_address), method="GET" + ) return response.status == 204 @@ -451,7 +514,8 @@ def ex_drive_destroy(self, drive_uuid): :rtype: ``bool`` """ response = self.connection.request( - action='/drives/%s/destroy' % (drive_uuid), method='POST') + action="/drives/%s/destroy" % (drive_uuid), method="POST" + ) return response.status == 204 @@ -468,35 +532,51 @@ def ex_set_node_configuration(self, node, **kwargs): :rtype: ``bool`` """ - valid_keys = ('^name$', '^parent$', '^cpu$', '^smp$', '^mem$', - '^boot$', '^nic:0:model$', '^nic:0:dhcp', - '^nic:1:model$', '^nic:1:vlan$', '^nic:1:mac$', - '^vnc:ip$', '^vnc:password$', '^vnc:tls', - '^ide:[0-1]:[0-1](:media)?$', '^scsi:0:[0-7](:media)?$', - '^block:[0-7](:media)?$') + valid_keys = ( + "^name$", + "^parent$", + "^cpu$", + "^smp$", + "^mem$", + "^boot$", + "^nic:0:model$", + "^nic:0:dhcp", + "^nic:1:model$", + "^nic:1:vlan$", + "^nic:1:mac$", + "^vnc:ip$", + "^vnc:password$", + "^vnc:tls", + "^ide:[0-1]:[0-1](:media)?$", + "^scsi:0:[0-7](:media)?$", + "^block:[0-7](:media)?$", + ) invalid_keys = [] keys = list(kwargs.keys()) + for key in keys: matches = False + for regex in valid_keys: if re.match(regex, key): matches = True + break + if not matches: invalid_keys.append(key) if invalid_keys: raise CloudSigmaException( - 'Invalid configuration key specified: %s' % - (',' .join(invalid_keys))) + "Invalid configuration key specified: %s" % (",".join(invalid_keys)) + ) response = self.connection.request( - action='/servers/%s/set' % (node.id), - data=dict2str(kwargs), - method='POST') + action="/servers/%s/set" % (node.id), data=dict2str(kwargs), method="POST" + ) - return (response.status == 200 and response.body != '') + return response.status == 200 and response.body != "" def ex_start_node(self, node): """ @@ -507,13 +587,18 @@ def ex_start_node(self, node): :rtype: ``bool`` """ - response = self.connection.request( - action='/servers/%s/start' % (node.id), - method='POST') + response = self.connection.request(action="/servers/%s/start" % (node.id), method="POST") return response.status == 200 def ex_stop_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + + return self.stop_node(node=node) + + def stop_node(self, node): """ Stop (shutdown) a node. @@ -522,9 +607,8 @@ def ex_stop_node(self, node): :rtype: ``bool`` """ - response = self.connection.request( - action='/servers/%s/stop' % (node.id), - method='POST') + response = self.connection.request(action="/servers/%s/stop" % (node.id), method="POST") + return response.status == 204 def ex_shutdown_node(self, node): @@ -533,6 +617,7 @@ def ex_shutdown_node(self, node): @inherits: :class:`CloudSigmaBaseNodeDriver.ex_stop_node` """ + return self.ex_stop_node(node) def ex_destroy_drive(self, drive_uuid): @@ -545,8 +630,9 @@ def ex_destroy_drive(self, drive_uuid): :rtype: ``bool`` """ response = self.connection.request( - action='/drives/%s/destroy' % (drive_uuid), - method='POST') + action="/drives/%s/destroy" % (drive_uuid), method="POST" + ) + return response.status == 204 def _ex_connection_class_kwargs(self): @@ -554,40 +640,48 @@ def _ex_connection_class_kwargs(self): Return the host value based on the user supplied region. """ kwargs = {} + if not self._host_argument_set: - kwargs['host'] = API_ENDPOINTS_1_0[self.region]['host'] + kwargs["host"] = API_ENDPOINTS_1_0[self.region]["host"] return kwargs def _to_node(self, data): if data: try: - state = self.NODE_STATE_MAP[data['status']] + state = self.NODE_STATE_MAP[data["status"]] except KeyError: state = NodeState.UNKNOWN - if 'server' not in data: + if "server" not in data: # Response does not contain server UUID if the server # creation failed because of insufficient funds. + return None public_ips = [] - if 'nic:0:dhcp' in data: - if isinstance(data['nic:0:dhcp'], list): - public_ips = data['nic:0:dhcp'] + + if "nic:0:dhcp" in data: + if isinstance(data["nic:0:dhcp"], list): + public_ips = data["nic:0:dhcp"] else: - public_ips = [data['nic:0:dhcp']] + public_ips = [data["nic:0:dhcp"]] extra = {} - extra_keys = [('cpu', 'int'), ('smp', 'auto'), ('mem', 'int'), - ('status', 'str')] + extra_keys = [ + ("cpu", "int"), + ("smp", "auto"), + ("mem", "int"), + ("status", "str"), + ] + for key, value_type in extra_keys: if key in data: value = data[key] - if value_type == 'int': + if value_type == "int": value = int(value) - elif value_type == 'auto': + elif value_type == "auto": try: value = int(value) except ValueError: @@ -595,16 +689,21 @@ def _to_node(self, data): extra.update({key: value}) - if 'vnc:ip' in data and 'vnc:password' in data: - extra.update({'vnc_ip': data['vnc:ip'], - 'vnc_password': data['vnc:password']}) + if "vnc:ip" in data and "vnc:password" in data: + extra.update({"vnc_ip": data["vnc:ip"], "vnc_password": data["vnc:password"]}) - node = Node(id=data['server'], name=data['name'], state=state, - public_ips=public_ips, private_ips=None, - driver=self.connection.driver, - extra=extra) + node = Node( + id=data["server"], + name=data["name"], + state=state, + public_ips=public_ips, + private_ips=None, + driver=self.connection.driver, + extra=extra, + ) return node + return None def _get_node(self, node_id): @@ -612,16 +711,15 @@ def _get_node(self, node_id): node = [node for node in nodes if node.id == node.id] if not node: - raise CloudSigmaException( - 'Node with id %s does not exist' % (node_id)) + raise CloudSigmaException("Node with id %s does not exist" % (node_id)) return node[0] def _get_node_info(self, node): - response = self.connection.request( - action='/servers/%s/info' % (node.id)) + response = self.connection.request(action="/servers/%s/info" % (node.id)) result = str2dicts(response.body) + return result[0] @@ -629,30 +727,34 @@ class CloudSigmaZrhConnection(CloudSigma_1_0_Connection): """ Connection class for the CloudSigma driver for the Zurich end-point """ - host = API_ENDPOINTS_1_0['zrh']['host'] + + host = API_ENDPOINTS_1_0["zrh"]["host"] class CloudSigmaZrhNodeDriver(CloudSigma_1_0_NodeDriver): """ CloudSigma node driver for the Zurich end-point """ + connectionCls = CloudSigmaZrhConnection - api_name = 'cloudsigma_zrh' + api_name = "cloudsigma_zrh" class CloudSigmaLvsConnection(CloudSigma_1_0_Connection): """ Connection class for the CloudSigma driver for the Las Vegas end-point """ - host = API_ENDPOINTS_1_0['lvs']['host'] + + host = API_ENDPOINTS_1_0["lvs"]["host"] class CloudSigmaLvsNodeDriver(CloudSigma_1_0_NodeDriver): """ CloudSigma node driver for the Las Vegas end-point """ + connectionCls = CloudSigmaLvsConnection - api_name = 'cloudsigma_lvs' + api_name = "cloudsigma_lvs" class CloudSigmaError(ProviderError): @@ -676,20 +778,30 @@ def __init__(self, http_code, error_type, error_msg, error_point, driver): :param error_point: Point at which the error occurred. Can be None. :type error_point: ``str`` or ``None`` """ - super(CloudSigmaError, self).__init__(http_code=http_code, - value=error_msg, driver=driver) + super().__init__(http_code=http_code, value=error_msg, driver=driver) self.error_type = error_type self.error_msg = error_msg self.error_point = error_point -class CloudSigmaSubscription(object): +class CloudSigmaSubscription: """ Represents CloudSigma subscription. """ - def __init__(self, id, resource, amount, period, status, price, start_time, - end_time, auto_renew, subscribed_object=None): + def __init__( + self, + id, + resource, + amount, + period, + status, + price, + start_time, + end_time, + auto_renew, + subscribed_object=None, + ): """ :param id: Subscription ID. :type id: ``str`` @@ -733,13 +845,14 @@ def __str__(self): return self.__repr__() def __repr__(self): - return ('' % - (self.id, self.resource, self.amount, self.period, - self.subscribed_object)) + return ( + "" + % (self.id, self.resource, self.amount, self.period, self.subscribed_object) + ) -class CloudSigmaTag(object): +class CloudSigmaTag: """ Represents a CloudSigma tag object. """ @@ -763,8 +876,11 @@ def __str__(self): return self.__repr__() def __repr__(self): - return ('' % - (self.id, self.name, repr(self.resources))) + return "".format( + self.id, + self.name, + repr(self.resources), + ) class CloudSigmaDrive(NodeImage): @@ -780,8 +896,8 @@ def __init__(self, id, name, size, media, status, driver, extra=None): :param name: Drive name. :type name: ``str`` - :param size: Drive size (in bytes). - :type size: ``int`` + :param size: Drive size (in GBs). + :type size: ``float`` :param media: Drive media (cdrom / disk). :type media: ``str`` @@ -789,8 +905,7 @@ def __init__(self, id, name, size, media, status, driver, extra=None): :param status: Drive status (unmounted / mounted). :type status: ``str`` """ - super(CloudSigmaDrive, self).__init__(id=id, name=name, driver=driver, - extra=extra) + super().__init__(id=id, name=name, driver=driver, extra=extra) self.size = size self.media = media self.status = status @@ -799,12 +914,16 @@ def __str__(self): return self.__repr__() def __repr__(self): - return (('') % - (self.id, self.name, self.size, self.media, self.status)) + return ("") % ( + self.id, + self.name, + self.size, + self.media, + self.status, + ) -class CloudSigmaFirewallPolicy(object): +class CloudSigmaFirewallPolicy: """ Represents a CloudSigma firewall policy. """ @@ -828,17 +947,29 @@ def __str__(self): return self.__repr__() def __repr__(self): - return (('') % - (self.id, self.name, repr(self.rules))) + return ("") % ( + self.id, + self.name, + repr(self.rules), + ) -class CloudSigmaFirewallPolicyRule(object): +class CloudSigmaFirewallPolicyRule: """ Represents a CloudSigma firewall policy rule. """ - def __init__(self, action, direction, ip_proto=None, src_ip=None, - src_port=None, dst_ip=None, dst_port=None, comment=None): + def __init__( + self, + action, + direction, + ip_proto=None, + src_ip=None, + src_port=None, + dst_ip=None, + dst_port=None, + comment=None, + ): """ :param action: Action (drop / accept). :type action: ``str`` @@ -877,8 +1008,10 @@ def __str__(self): return self.__repr__() def __repr__(self): - return (('') % - (self.action, self.direction)) + return ("") % ( + self.action, + self.direction, + ) class CloudSigma_2_0_Response(JsonResponse): @@ -886,7 +1019,7 @@ class CloudSigma_2_0_Response(JsonResponse): httplib.OK, httplib.ACCEPTED, httplib.NO_CONTENT, - httplib.CREATED + httplib.CREATED, ] def success(self): @@ -894,7 +1027,7 @@ def success(self): def parse_error(self): if int(self.status) == httplib.UNAUTHORIZED: - raise InvalidCredsError('Invalid credentials') + raise InvalidCredsError("Invalid credentials") body = self.parse_body() errors = self._parse_errors_from_body(body=body) @@ -918,60 +1051,68 @@ def _parse_errors_from_body(self, body): return None for item in body: - if 'error_type' not in item: + if "error_type" not in item: # Unrecognized error + continue - error = CloudSigmaError(http_code=self.status, - error_type=item['error_type'], - error_msg=item['error_message'], - error_point=item['error_point'], - driver=self.connection.driver) + error = CloudSigmaError( + http_code=self.status, + error_type=item["error_type"], + error_msg=item["error_message"], + error_point=item["error_point"], + driver=self.connection.driver, + ) errors.append(error) return errors class CloudSigma_2_0_Connection(ConnectionUserAndKey): - host = API_ENDPOINTS_2_0[DEFAULT_REGION]['host'] + host = API_ENDPOINTS_2_0[DEFAULT_REGION]["host"] responseCls = CloudSigma_2_0_Response - api_prefix = '/api/2.0' + api_prefix = "/api/2.0" def add_default_headers(self, headers): - headers['Accept'] = 'application/json' - headers['Content-Type'] = 'application/json' + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + + headers["Authorization"] = "Basic %s" % ( + base64.b64encode(b("{}:{}".format(self.user_id, self.key))).decode("utf-8") + ) - headers['Authorization'] = 'Basic %s' % (base64.b64encode( - b('%s:%s' % (self.user_id, self.key))).decode('utf-8')) return headers def encode_data(self, data): data = json.dumps(data) + return data - def request(self, action, params=None, data=None, headers=None, - method='GET', raw=False): + def request(self, action, params=None, data=None, headers=None, method="GET", raw=False): params = params or {} action = self.api_prefix + action - if method == 'GET': - params['limit'] = 0 # we want all the items back + if method == "GET": + params["limit"] = 0 # we want all the items back - return super(CloudSigma_2_0_Connection, self).request(action=action, - params=params, - data=data, - headers=headers, - method=method, - raw=raw) + return super().request( + action=action, + params=params, + data=data, + headers=headers, + method=method, + raw=raw, + ) class CloudSigma_2_0_NodeDriver(CloudSigmaNodeDriver): """ Driver for CloudSigma API v2.0. """ - name = 'CloudSigma (API v2.0)' - api_name = 'cloudsigma_zrh' - website = 'http://www.cloudsigma.com/' + + name = "CloudSigma (API v2.0)" + api_name = "cloudsigma_zrh" + website = "http://www.cloudsigma.com/" connectionCls = CloudSigma_2_0_Connection # Default drive transition timeout in seconds @@ -982,32 +1123,43 @@ class CloudSigma_2_0_NodeDriver(CloudSigmaNodeDriver): DRIVE_TRANSITION_SLEEP_INTERVAL = 5 NODE_STATE_MAP = { - 'starting': NodeState.PENDING, - 'stopping': NodeState.PENDING, - 'unavailable': NodeState.PENDING, - 'running': NodeState.RUNNING, - 'stopped': NodeState.STOPPED, - 'paused': NodeState.STOPPED + "starting": NodeState.PENDING, + "stopping": NodeState.PENDING, + "unavailable": NodeState.ERROR, + "running": NodeState.RUNNING, + "stopped": NodeState.STOPPED, + "paused": NodeState.PAUSED, } - def __init__(self, key, secret, secure=True, host=None, port=None, - region=DEFAULT_REGION, **kwargs): + def __init__( + self, + key, + secret, + secure=True, + host=None, + port=None, + region=DEFAULT_REGION, + **kwargs, + ): if region not in API_ENDPOINTS_2_0: - raise ValueError('Invalid region: %s' % (region)) + raise ValueError("Invalid region: %s" % (region)) if not secure: # CloudSigma drive uses Basic Auth authentication and we don't want # to allow user to accidentally send credentials over the wire in # plain-text - raise ValueError('CloudSigma driver only supports a ' - 'secure connection') + raise ValueError("CloudSigma driver only supports a " "secure connection") self._host_argument_set = host is not None - super(CloudSigma_2_0_NodeDriver, self).__init__(key=key, secret=secret, - secure=secure, - host=host, port=port, - region=region, - **kwargs) + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + region=region, + **kwargs, + ) def list_nodes(self, ex_tag=None): """ @@ -1017,33 +1169,46 @@ def list_nodes(self, ex_tag=None): provided tag. :type ex_tag: :class:`CloudSigmaTag` """ + if ex_tag: - action = '/tags/%s/servers/detail/' % (ex_tag.id) + action = "/tags/%s/servers/detail/" % (ex_tag.id) else: - action = '/servers/detail/' + action = "/servers/detail/" + + response = self.connection.request(action=action, method="GET").object + nodes = [self._to_node(data=item) for item in response["objects"]] - response = self.connection.request(action=action, method='GET').object - nodes = [self._to_node(data=item) for item in response['objects']] return nodes - def list_sizes(self): + def list_sizes( + self, + location=None, + ): """ List available sizes. """ sizes = [] + for value in INSTANCE_TYPES: - key = value['id'] - size = CloudSigmaNodeSize(id=value['id'], name=value['name'], - cpu=value['cpu'], ram=value['memory'], - disk=value['disk'], - bandwidth=value['bandwidth'], - price=self._get_size_price(size_id=key), - driver=self.connection.driver) + key = value["id"] + size = CloudSigmaNodeSize( + id=value["id"], + name=value["name"], + cpu=value["cpu"], + ram=value["memory"], + disk=value["disk"], + bandwidth=value["bandwidth"], + price=self._get_size_price(size_id=key), + driver=self.connection.driver, + ) sizes.append(size) return sizes - def list_images(self): + def list_images( + self, + location=None, + ): """ Return a list of available pre-installed library drives. @@ -1051,18 +1216,29 @@ def list_images(self): pre-installed and installation CDs), use :meth:`ex_list_library_drives` method. """ - response = self.connection.request(action='/libdrives/').object - images = [self._to_image(data=item) for item in response['objects']] + response = self.connection.request(action="/libdrives/").object + images = [self._to_image(data=item) for item in response["objects"]] # We filter out non pre-installed library drives by default because # they can't be used directly following a default Libcloud server # creation flow. - images = [image for image in images if - image.extra['image_type'] == 'preinst'] + images = [image for image in images if image.extra["image_type"] == "preinst"] + return images - def create_node(self, name, size, image, ex_metadata=None, - ex_vnc_password=None, ex_avoid=None, ex_vlan=None): + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_metadata=None, + ex_vnc_password=None, + ex_avoid=None, + ex_vlan=None, + public_keys=None, + ): """ Create a new server. @@ -1097,6 +1273,9 @@ def create_node(self, name, size, image, ex_metadata=None, server will have two nics assigned - 1 with a public ip and 1 with the provided VLAN. :type ex_vlan: ``str`` + + :param public_keys: Optional list of SSH key UUIDs + :type public_keys: ``list`` of ``str`` """ is_installation_cd = self._is_installation_cd(image=image) @@ -1106,27 +1285,25 @@ def create_node(self, name, size, image, ex_metadata=None, # VNC password is not provided, generate a random one. vnc_password = get_secure_random_string(size=12) - drive_name = '%s-drive' % (name) + drive_name = "%s-drive" % (name) - # size is specified in GB - drive_size = (size.disk * 1024 * 1024 * 1024) + drive_size = size.disk if not is_installation_cd: # 1. Clone library drive so we can use it drive = self.ex_clone_drive(drive=image, name=drive_name) # Wait for drive clone to finish - drive = self._wait_for_drive_state_transition(drive=drive, - state='unmounted') + drive = self._wait_for_drive_state_transition(drive=drive, state="unmounted") # 2. Resize drive to the desired disk size if the desired disk size # is larger than the cloned drive size. + if drive_size > drive.size: drive = self.ex_resize_drive(drive=drive, size=drive_size) # Wait for drive resize to finish - drive = self._wait_for_drive_state_transition(drive=drive, - state='unmounted') + drive = self._wait_for_drive_state_transition(drive=drive, state="unmounted") else: # No need to clone installation CDs drive = image @@ -1134,76 +1311,113 @@ def create_node(self, name, size, image, ex_metadata=None, # 3. Create server and attach cloned drive # ide 0:0 data = {} - data['name'] = name - data['cpu'] = size.cpu - data['mem'] = (size.ram * 1024 * 1024) - data['vnc_password'] = vnc_password + data["name"] = name + # cloudsigma uses MHz to measure cpu cores, + # where 1 cpu core equals 2000MHz + data["cpu"] = size.cpu * 2000 + data["mem"] = size.ram * 1024 * 1024 + data["vnc_password"] = vnc_password + + if public_keys: + data["pubkeys"] = public_keys if ex_metadata: - data['meta'] = ex_metadata + data["meta"] = ex_metadata # Assign 1 public interface (DHCP) to the node - nic = { - 'boot_order': None, - 'ip_v4_conf': { - 'conf': 'dhcp', - }, - 'ip_v6_conf': None - } + nic = {"boot_order": None, "ip_v4_conf": {"conf": "dhcp"}, "ip_v6_conf": None} nics = [nic] if ex_vlan: # Assign another interface for VLAN nic = { - 'boot_order': None, - 'ip_v4_conf': None, - 'ip_v6_conf': None, - 'vlan': ex_vlan + "boot_order": None, + "ip_v4_conf": None, + "ip_v6_conf": None, + "vlan": ex_vlan, } nics.append(nic) # Need to use IDE for installation CDs + if is_installation_cd: - device_type = 'ide' + device_type = "ide" else: - device_type = 'virtio' + device_type = "virtio" drive = { - 'boot_order': 1, - 'dev_channel': '0:0', - 'device': device_type, - 'drive': drive.id + "boot_order": 1, + "dev_channel": "0:0", + "device": device_type, + "drive": drive.id, } drives = [drive] - data['nics'] = nics - data['drives'] = drives + data["nics"] = nics + data["drives"] = drives - action = '/servers/' - response = self.connection.request(action=action, method='POST', - data=data) - node = self._to_node(response.object['objects'][0]) + action = "/servers/" + response = self.connection.request(action=action, method="POST", data=data) + node = self._to_node(response.object["objects"][0]) # 4. Start server self.ex_start_node(node=node, ex_avoid=ex_avoid) return node - def destroy_node(self, node): + def destroy_node(self, node, ex_delete_drives=False): """ Destroy the node and all the associated drives. :return: ``True`` on success, ``False`` otherwise. :rtype: ``bool`` """ - action = '/servers/%s/' % (node.id) - params = {'recurse': 'all_drives'} - response = self.connection.request(action=action, method='DELETE', - params=params) + action = "/servers/%s/" % (node.id) + + if ex_delete_drives is True: + params = {"recurse": "all_drives"} + else: + params = None + response = self.connection.request(action=action, method="DELETE", params=params) + return response.status == httplib.NO_CONTENT + def reboot_node(self, node): + """ + Reboot a node. + + Because Cloudsigma API does not provide native reboot call, + it's emulated using stop and start. + + :param node: Node to reboot. + :type node: :class:`libcloud.compute.base.Node` + """ + state = node.state + + if state == NodeState.RUNNING: + stopped = self.stop_node(node) + else: + stopped = True + + if not stopped: + raise CloudSigmaException("Could not stop node with id %s" % (node.id)) + + success = False + + for _ in range(5): + try: + success = self.start_node(node) + except CloudSigmaError: + time.sleep(1) + + continue + else: + break + + return success + # Server extension methods def ex_edit_node(self, node, params): @@ -1223,24 +1437,24 @@ def ex_edit_node(self, node, params): # name, cpu, mem and vnc_password attributes must always be present so # we just copy them from the to-be-edited node - data['name'] = node.name - data['cpu'] = node.extra['cpu'] - data['mem'] = node.extra['mem'] - data['vnc_password'] = node.extra['vnc_password'] + data["name"] = node.name + data["cpu"] = node.extra["cpus"] + data["mem"] = node.extra["memory"] + data["vnc_password"] = node.extra["vnc_password"] - nics = copy.deepcopy(node.extra.get('nics', [])) + nics = copy.deepcopy(node.extra.get("nics", [])) - data['nics'] = nics + data["nics"] = nics data.update(params) - action = '/servers/%s/' % (node.id) - response = self.connection.request(action=action, method='PUT', - data=data).object + action = "/servers/%s/" % (node.id) + response = self.connection.request(action=action, method="PUT", data=data).object node = self._to_node(data=response) + return node - def ex_start_node(self, node, ex_avoid=None): + def start_node(self, node, ex_avoid=None): """ Start a node. @@ -1257,22 +1471,35 @@ def ex_start_node(self, node, ex_avoid=None): params = {} if ex_avoid: - params['avoid'] = ','.join(ex_avoid) + params["avoid"] = ",".join(ex_avoid) + + path = "/servers/%s/action/" % (node.id) + response = self._perform_action(path=path, action="start", params=params, method="POST") + + return response.status == httplib.ACCEPTED + + def stop_node(self, node): + path = "/servers/%s/action/" % (node.id) + response = self._perform_action(path=path, action="stop", method="POST") - path = '/servers/%s/action/' % (node.id) - response = self._perform_action(path=path, action='start', - params=params, - method='POST') return response.status == httplib.ACCEPTED + def ex_start_node(self, node, ex_avoid=None): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + + return self.start_node(node=node, ex_avoid=ex_avoid) + def ex_stop_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 """ Stop a node. """ - path = '/servers/%s/action/' % (node.id) - response = self._perform_action(path=path, action='stop', - method='POST') - return response.status == httplib.ACCEPTED + + return self.stop_node(node=node) def ex_clone_node(self, node, name=None, random_vnc_password=None): """ @@ -1291,15 +1518,24 @@ def ex_clone_node(self, node, name=None, random_vnc_password=None): """ data = {} - data['name'] = name - data['random_vnc_password'] = random_vnc_password + data["name"] = name + data["random_vnc_password"] = random_vnc_password - path = '/servers/%s/action/' % (node.id) - response = self._perform_action(path=path, action='clone', - method='POST', data=data).object + path = "/servers/%s/action/" % (node.id) + response = self._perform_action(path=path, action="clone", method="POST", data=data).object node = self._to_node(data=response) + return node + def ex_get_node(self, node_id, return_json=False): + action = "/servers/%s/" % (node_id) + response = self.connection.request(action=action).object + + if return_json is True: + return response + + return self._to_node(response) + def ex_open_vnc_tunnel(self, node): """ Open a VNC tunnel to the provided node and return the VNC url. @@ -1310,10 +1546,10 @@ def ex_open_vnc_tunnel(self, node): :return: URL of the opened VNC tunnel. :rtype: ``str`` """ - path = '/servers/%s/action/' % (node.id) - response = self._perform_action(path=path, action='open_vnc', - method='POST').object - vnc_url = response['vnc_url'] + path = "/servers/%s/action/" % (node.id) + response = self._perform_action(path=path, action="open_vnc", method="POST").object + vnc_url = response["vnc_url"] + return vnc_url def ex_close_vnc_tunnel(self, node): @@ -1326,9 +1562,9 @@ def ex_close_vnc_tunnel(self, node): :return: ``True`` on success, ``False`` otherwise. :rtype: ``bool`` """ - path = '/servers/%s/action/' % (node.id) - response = self._perform_action(path=path, action='close_vnc', - method='POST') + path = "/servers/%s/action/" % (node.id) + response = self._perform_action(path=path, action="close_vnc", method="POST") + return response.status == httplib.ACCEPTED # Drive extension methods @@ -1340,8 +1576,9 @@ def ex_list_library_drives(self): :rtype: ``list`` of :class:`.CloudSigmaDrive` objects """ - response = self.connection.request(action='/libdrives/').object - drives = [self._to_drive(data=item) for item in response['objects']] + response = self.connection.request(action="/libdrives/").object + drives = [self._to_drive(data=item) for item in response["objects"]] + return drives def ex_list_user_drives(self): @@ -1350,18 +1587,22 @@ def ex_list_user_drives(self): :rtype: ``list`` of :class:`.CloudSigmaDrive` objects """ - response = self.connection.request(action='/drives/detail/').object - drives = [self._to_drive(data=item) for item in response['objects']] + response = self.connection.request(action="/drives/detail/").object + drives = [self._to_drive(data=item) for item in response["objects"]] + return drives - def ex_create_drive(self, name, size, media='disk', ex_avoid=None): + def list_volumes(self): + return self.ex_list_user_drives() + + def ex_create_drive(self, name, size, media="disk", ex_avoid=None): """ Create a new drive. :param name: Drive name. :type name: ``str`` - :param size: Drive size in bytes. + :param size: Drive size in GBs. :type size: ``int`` :param media: Drive media type (cdrom, disk). @@ -1378,21 +1619,30 @@ def ex_create_drive(self, name, size, media='disk', ex_avoid=None): :rtype: :class:`.CloudSigmaDrive` """ params = {} - data = { - 'name': name, - 'size': size, - 'media': media - } + data = {"name": name, "size": size * 1024 * 1024 * 1024, "media": media} if ex_avoid: - params['avoid'] = ','.join(ex_avoid) + params["avoid"] = ",".join(ex_avoid) + + action = "/drives/" + response = self.connection.request( + action=action, method="POST", params=params, data=data + ).object + drive = self._to_drive(data=response["objects"][0]) - action = '/drives/' - response = self.connection.request(action=action, method='POST', - params=params, data=data).object - drive = self._to_drive(data=response['objects'][0]) return drive + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + media="disk", + ex_avoid=None, + ): + return self.ex_create_drive(name=name, size=size, media=media, ex_avoid=ex_avoid) + def ex_clone_drive(self, drive, name=None, ex_avoid=None): """ Clone a library or a standard drive. @@ -1418,16 +1668,17 @@ def ex_clone_drive(self, drive, name=None, ex_avoid=None): data = {} if ex_avoid: - params['avoid'] = ','.join(ex_avoid) + params["avoid"] = ",".join(ex_avoid) if name: - data['name'] = name + data["name"] = name + + path = "/drives/%s/action/" % (drive.id) + response = self._perform_action( + path=path, action="clone", params=params, data=data, method="POST" + ) + drive = self._to_drive(data=response.object["objects"][0]) - path = '/drives/%s/action/' % (drive.id) - response = self._perform_action(path=path, action='clone', - params=params, data=data, - method='POST') - drive = self._to_drive(data=response.object['objects'][0]) return drive def ex_resize_drive(self, drive, size): @@ -1436,26 +1687,88 @@ def ex_resize_drive(self, drive, size): :param drive: Drive to resize. - :param size: New drive size in bytes. + :param size: New drive size in GBs. :type size: ``int`` :return: Drive object which is being resized. :rtype: :class:`.CloudSigmaDrive` """ - path = '/drives/%s/action/' % (drive.id) - data = {'name': drive.name, 'size': size, 'media': 'disk'} - response = self._perform_action(path=path, action='resize', - method='POST', data=data) + path = "/drives/%s/action/" % (drive.id) + data = {"name": drive.name, "size": size * 1024 * 1024 * 1024, "media": "disk"} + response = self._perform_action(path=path, action="resize", method="POST", data=data) + + drive = self._to_drive(data=response.object["objects"][0]) - drive = self._to_drive(data=response.object['objects'][0]) return drive - def ex_attach_drive(self, node): + def ex_attach_drive(self, node, drive): """ - Attach a drive to the provided node. + Attach drive to node + + :param node: Node to attach the drive to. + :type node: :class:`libcloud.compute.base.Node` + + :param drive: Drive to attach. + :type drive: :class:`.CloudSigmaDrive` + + :return: ``True`` on success, ``False`` otherwise. + :rtype: ``bool`` """ - # TODO - pass + data = self.ex_get_node(node.id, return_json=True) + # find the first available device channel to attach the drive + # device channel format is: {controller}:{unit} + # total of 920 virtio drives are supported + # 0:0, …, 0:3, …, 1:0, …, 1:3, … + # https://cloudsigma-docs.readthedocs.io/en/2.14.3/servers_kvm.html?highlight=dev%20channel#device-channel + dev_channels = [item["dev_channel"] for item in data["drives"]] + dev_channel = None + + for controller in range(MAX_VIRTIO_CONTROLLERS): + for unit in range(MAX_VIRTIO_UNITS): + if "{}:{}".format(controller, unit) not in dev_channels: + dev_channel = "{}:{}".format(controller, unit) + + break + + if dev_channel: + break + else: + raise CloudSigmaException("Could not attach drive to %s" % (node.id)) + + item = { + "boot_order": None, + "dev_channel": dev_channel, + "device": "virtio", + "drive": str(drive.id), + } + data["drives"].append(item) + action = "/servers/%s/" % (node.id) + response = self.connection.request(action=action, data=data, method="PUT") + + return response.status == 200 + + def attach_volume( + self, + node, + volume, + device=None, + ): + return self.ex_attach_drive(node=node, drive=volume) + + def ex_detach_drive(self, node, drive): + data = self.ex_get_node(node.id, return_json=True) + data["drives"] = [item for item in data["drives"] if item["drive"]["uuid"] != drive.id] + action = "/servers/%s/" % (node.id) + response = self.connection.request(action=action, data=data, method="PUT") + + return response.status == 200 + + def detach_volume( + self, + volume, + node=None, + ): + return self.ex_detach_drive(node=node, drive=volume) def ex_get_drive(self, drive_id): """ @@ -1467,11 +1780,25 @@ def ex_get_drive(self, drive_id): :return: Drive object. :rtype: :class:`.CloudSigmaDrive` """ - action = '/drives/%s/' % (drive_id) + action = "/drives/%s/" % (drive_id) response = self.connection.request(action=action).object drive = self._to_drive(data=response) + return drive + def ex_destroy_drive(self, drive): + action = "/drives/%s/" % (drive.id) + response = self.connection.request(action=action, method="DELETE") + + return response.status == httplib.NO_CONTENT + + def destroy_volume( + self, + volume, + ): + drive = volume + return self.ex_destroy_drive(drive=drive) + # Firewall policies extension methods def ex_list_firewall_policies(self): @@ -1480,10 +1807,10 @@ def ex_list_firewall_policies(self): :rtype: ``list`` of :class:`.CloudSigmaFirewallPolicy` """ - action = '/fwpolicies/detail/' - response = self.connection.request(action=action, method='GET').object - policies = [self._to_firewall_policy(data=item) for item - in response['objects']] + action = "/fwpolicies/detail/" + response = self.connection.request(action=action, method="GET").object + policies = [self._to_firewall_policy(data=item) for item in response["objects"]] + return policies def ex_create_firewall_policy(self, name, rules=None): @@ -1502,17 +1829,17 @@ def ex_create_firewall_policy(self, name, rules=None): """ data = {} obj = {} - obj['name'] = name + obj["name"] = name if rules: - obj['rules'] = rules + obj["rules"] = rules + + data["objects"] = [obj] - data['objects'] = [obj] + action = "/fwpolicies/" + response = self.connection.request(action=action, method="POST", data=data).object + policy = self._to_firewall_policy(data=response["objects"][0]) - action = '/fwpolicies/' - response = self.connection.request(action=action, method='POST', - data=data).object - policy = self._to_firewall_policy(data=response['objects'][0]) return policy def ex_attach_firewall_policy(self, policy, node, nic_mac=None): @@ -1533,22 +1860,22 @@ def ex_attach_firewall_policy(self, policy, node, nic_mac=None): :return: Node object to which the policy was attached to. :rtype: :class:`libcloud.compute.base.Node` """ - nics = copy.deepcopy(node.extra.get('nics', [])) + nics = copy.deepcopy(node.extra.get("nics", [])) if nic_mac: - nic = [n for n in nics if n['mac'] == nic_mac] + nic = [n for n in nics if n["mac"] == nic_mac] else: nic = nics if len(nic) == 0: - raise ValueError('Cannot find the NIC interface to attach ' - 'a policy to') + raise ValueError("Cannot find the NIC interface to attach " "a policy to") nic = nic[0] - nic['firewall_policy'] = policy.id + nic["firewall_policy"] = policy.id - params = {'nics': nics} + params = {"nics": nics} node = self.ex_edit_node(node=node, params=params) + return node def ex_delete_firewall_policy(self, policy): @@ -1561,8 +1888,9 @@ def ex_delete_firewall_policy(self, policy): :return: ``True`` on success, ``False`` otherwise. :rtype: ``bool`` """ - action = '/fwpolicies/%s/' % (policy.id) - response = self.connection.request(action=action, method='DELETE') + action = "/fwpolicies/%s/" % (policy.id) + response = self.connection.request(action=action, method="DELETE") + return response.status == httplib.NO_CONTENT # Availability groups extension methods @@ -1576,8 +1904,9 @@ def ex_list_servers_availability_groups(self): the same list index. :rtype: ``list`` of ``list`` """ - action = '/servers/availability_groups/' - response = self.connection.request(action=action, method='GET') + action = "/servers/availability_groups/" + response = self.connection.request(action=action, method="GET") + return response.object def ex_list_drives_availability_groups(self): @@ -1589,8 +1918,9 @@ def ex_list_drives_availability_groups(self): the same list index. :rtype: ``list`` of ``list`` """ - action = '/drives/availability_groups/' - response = self.connection.request(action=action, method='GET') + action = "/drives/availability_groups/" + response = self.connection.request(action=action, method="GET") + return response.object # Tag extension methods @@ -1601,9 +1931,9 @@ def ex_list_tags(self): :rtype: ``list`` of :class:`.CloudSigmaTag` objects """ - action = '/tags/detail/' - response = self.connection.request(action=action, method='GET').object - tags = [self._to_tag(data=item) for item in response['objects']] + action = "/tags/" + response = self.connection.request(action=action, method="GET").object + tags = [self._to_tag(data=item) for item in response["objects"]] return tags @@ -1616,9 +1946,10 @@ def ex_get_tag(self, tag_id): :rtype: ``list`` of :class:`.CloudSigmaTag` objects """ - action = '/tags/%s/' % (tag_id) - response = self.connection.request(action=action, method='GET').object + action = "/tags/%s/" % (tag_id) + response = self.connection.request(action=action, method="GET").object tag = self._to_tag(data=response) + return tag def ex_create_tag(self, name, resource_uuids=None): @@ -1636,19 +1967,15 @@ def ex_create_tag(self, name, resource_uuids=None): :rtype: :class:`.CloudSigmaTag` """ data = {} - data['objects'] = [ - { - 'name': name - } - ] + data["objects"] = [{"name": name}] if resource_uuids: - data['resources'] = resource_uuids + data["resources"] = resource_uuids + + action = "/tags/" + response = self.connection.request(action=action, method="POST", data=data).object + tag = self._to_tag(data=response["objects"][0]) - action = '/tags/' - response = self.connection.request(action=action, method='POST', - data=data).object - tag = self._to_tag(data=response['objects'][0]) return tag def ex_tag_resource(self, resource, tag): @@ -1665,8 +1992,9 @@ def ex_tag_resource(self, resource, tag): :return: Updated tag object. :rtype: :class:`.CloudSigmaTag` """ - if not hasattr(resource, 'id'): - raise ValueError('Resource doesn\'t have id attribute') + + if not hasattr(resource, "id"): + raise ValueError("Resource doesn't have id attribute") return self.ex_tag_resources(resources=[resource], tag=tag) @@ -1688,22 +2016,19 @@ def ex_tag_resources(self, resources, tag): resources = tag.resources[:] for resource in resources: - if not hasattr(resource, 'id'): - raise ValueError('Resource doesn\'t have id attribute') + if not hasattr(resource, "id"): + raise ValueError("Resource doesn't have id attribute") resources.append(resource.id) resources = list(set(resources)) - data = { - 'name': tag.name, - 'resources': resources - } + data = {"name": tag.name, "resources": resources} - action = '/tags/%s/' % (tag.id) - response = self.connection.request(action=action, method='PUT', - data=data).object + action = "/tags/%s/" % (tag.id) + response = self.connection.request(action=action, method="PUT", data=data).object tag = self._to_tag(data=response) + return tag def ex_delete_tag(self, tag): @@ -1716,32 +2041,35 @@ def ex_delete_tag(self, tag): :return: ``True`` on success, ``False`` otherwise. :rtype: ``bool`` """ - action = '/tags/%s/' % (tag.id) - response = self.connection.request(action=action, method='DELETE') + action = "/tags/%s/" % (tag.id) + response = self.connection.request(action=action, method="DELETE") + return response.status == httplib.NO_CONTENT # Account extension methods def ex_get_balance(self): """ - Retrueve account balance information. + Retrieve account balance information. :return: Dictionary with two items ("balance" and "currency"). :rtype: ``dict`` """ - action = '/balance/' - response = self.connection.request(action=action, method='GET') + action = "/balance/" + response = self.connection.request(action=action, method="GET") + return response.object def ex_get_pricing(self): """ - Retrive pricing information that are applicable to the cloud. + Retrieve pricing information that are applicable to the cloud. :return: Dictionary with pricing information. :rtype: ``dict`` """ - action = '/pricing/' - response = self.connection.request(action=action, method='GET') + action = "/pricing/" + response = self.connection.request(action=action, method="GET") + return response.object def ex_get_usage(self): @@ -1751,11 +2079,12 @@ def ex_get_usage(self): :return: Dictionary with two items ("balance" and "usage"). :rtype: ``dict`` """ - action = '/currentusage/' - response = self.connection.request(action=action, method='GET') + action = "/currentusage/" + response = self.connection.request(action=action, method="GET") + return response.object - def ex_list_subscriptions(self, status='all', resources=None): + def ex_list_subscriptions(self, status="all", resources=None): """ List subscriptions for this account. @@ -1771,14 +2100,14 @@ def ex_list_subscriptions(self, status='all', resources=None): params = {} if status: - params['status'] = status + params["status"] = status if resources: - params['resource'] = ','.join(resources) + params["resource"] = ",".join(resources) - response = self.connection.request(action='/subscriptions/', - params=params).object + response = self.connection.request(action="/subscriptions/", params=params).object subscriptions = self._to_subscriptions(data=response) + return subscriptions def ex_toggle_subscription_auto_renew(self, subscription): @@ -1791,13 +2120,12 @@ def ex_toggle_subscription_auto_renew(self, subscription): :return: ``True`` on success, ``False`` otherwise. :rtype: ``bool`` """ - path = '/subscriptions/%s/action/' % (subscription.id) - response = self._perform_action(path=path, action='auto_renew', - method='POST') + path = "/subscriptions/%s/action/" % (subscription.id) + response = self._perform_action(path=path, action="auto_renew", method="POST") + return response.status == httplib.OK - def ex_create_subscription(self, amount, period, resource, - auto_renew=False): + def ex_create_subscription(self, amount, period, resource, auto_renew=False): """ Create a new subscription. @@ -1817,17 +2145,17 @@ def ex_create_subscription(self, amount, period, resource, """ data = [ { - 'amount': amount, - 'period': period, - 'auto_renew': auto_renew, - 'resource': resource + "amount": amount, + "period": period, + "auto_renew": auto_renew, + "resource": resource, } ] - response = self.connection.request(action='/subscriptions/', - data=data, method='POST') - data = response.object['objects'][0] + response = self.connection.request(action="/subscriptions/", data=data, method="POST") + data = response.object["objects"][0] subscription = self._to_subscription(data=data) + return subscription # Misc extension methods @@ -1838,12 +2166,89 @@ def ex_list_capabilities(self): :rtype: ``dict`` """ - action = '/capabilities/' - response = self.connection.request(action=action, - method='GET') + action = "/capabilities/" + response = self.connection.request(action=action, method="GET") capabilities = response.object + return capabilities + def list_key_pairs(self): + """ + List all the available key pair objects. + + :rtype: ``list`` of :class:`KeyPair` objects + """ + action = "/keypairs" + response = self.connection.request(action=action, method="GET").object + + keys = [self._to_key_pair(data=item) for item in response["objects"]] + + return keys + + def get_key_pair( + self, + name, + ): + """ + Retrieve a single key pair. + + :param name: The uuid of the key pair to retrieve. + :type name: ``str`` + + :rtype: :class:`.KeyPair` + """ + key_uuid = name + action = "/keypairs/%s/" % (key_uuid) + response = self.connection.request(action=action, method="GET").object + + return self._to_key_pair(response) + + def create_key_pair(self, name): + """ + Create a new SSH key. + + :param name: Key pair name. + :type name: ``str`` + """ + + action = "/keypairs/" + data = {"objects": [{"name": name}]} + response = self.connection.request(action=action, method="POST", data=data).object + + return self._to_key_pair(response["objects"][0]) + + def import_key_pair_from_string(self, name, key_material): + """ + Import a new public key from string. + + :param name: Key pair name. + :type name: ``str`` + + :param key_material: Public key material. + :type key_material: ``str`` + + :rtype: :class:`.KeyPair` object + """ + action = "/keypairs/" + data = {"objects": [{"name": name, "public_key": key_material.replace("\n", "")}]} + response = self.connection.request(action=action, method="POST", data=data).object + + return self._to_key_pair(response["objects"][0]) + + def delete_key_pair(self, key_pair): + """ + Delete an existing key pair. + + :param key_pair: Key pair object + :type key_pair: :class:`.KeyPair` + + :rtype: ``bool`` + """ + action = "/keypairs/%s/" % (key_pair.extra["uuid"]) + response = self.connection.request(action=action, method="DELETE") + + return response.status == 204 + def _parse_ips_from_nic(self, nic): """ Parse private and public IP addresses from the provided network @@ -1857,11 +2262,14 @@ def _parse_ips_from_nic(self, nic): """ public_ips, private_ips = [], [] - ipv4_conf = nic['ip_v4_conf'] - ipv6_conf = nic['ip_v6_conf'] + ipv4_conf = nic["ip_v4_conf"] + ipv6_conf = nic["ip_v6_conf"] - ipv4 = ipv4_conf['ip'] if ipv4_conf else None - ipv6 = ipv6_conf['ip'] if ipv6_conf else None + ip_v4 = ipv4_conf["ip"] if ipv4_conf else None + ip_v6 = ipv6_conf["ip"] if ipv6_conf else None + + ipv4 = ip_v4["uuid"] if ip_v4 else None + ipv6 = ip_v4["uuid"] if ip_v6 else None ips = [] @@ -1871,13 +2279,13 @@ def _parse_ips_from_nic(self, nic): if ipv6: ips.append(ipv6) - runtime = nic['runtime'] + runtime = nic["runtime"] - ip_v4 = runtime['ip_v4'] if nic['runtime'] else None - ip_v6 = runtime['ip_v6'] if nic['runtime'] else None + ip_v4 = runtime["ip_v4"] if nic["runtime"] else None + ip_v6 = runtime["ip_v6"] if nic["runtime"] else None - ipv4 = ip_v4['uuid'] if ip_v4 else None - ipv6 = ip_v4['uuid'] if ip_v6 else None + ipv4 = ip_v4["uuid"] if ip_v4 else None + ipv6 = ip_v4["uuid"] if ip_v6 else None if ipv4: ips.append(ipv4) @@ -1896,115 +2304,219 @@ def _parse_ips_from_nic(self, nic): return public_ips, private_ips def _to_node(self, data): - extra_keys = ['cpu', 'mem', 'nics', 'vnc_password', 'meta'] - - id = data['uuid'] - name = data['name'] - state = self.NODE_STATE_MAP.get(data['status'], NodeState.UNKNOWN) + id = data["uuid"] + name = data["name"] + state = self.NODE_STATE_MAP.get(data["status"], NodeState.UNKNOWN) public_ips = [] private_ips = [] - extra = self._extract_values(obj=data, keys=extra_keys) + extra = { + "cpus": data["cpu"] / 2000, + "memory": data["mem"] / 1024 / 1024, + "nics": data["nics"], + "vnc_password": data["vnc_password"], + "meta": data["meta"], + "runtime": data["runtime"], + "drives": data["drives"], + } + # find image name and boot drive size + image = None + drive_size = 0 + + for item in extra["drives"]: + if item["boot_order"] == 1: + drive = self.ex_get_drive(item["drive"]["uuid"]) + drive_size = drive.size + image = "{} {}".format( + drive.extra.get("distribution", ""), drive.extra.get("version", "") + ) - for nic in data['nics']: + break + # try to find if node size is from example sizes given by CloudSigma + try: + kwargs = SPECS_TO_SIZE[(extra["cpus"], extra["memory"], drive_size)] + size = CloudSigmaNodeSize(**kwargs, driver=self) + except KeyError: + id_to_hash = str(extra["cpus"]) + str(extra["memory"]) + str(drive_size) + size_id = hashlib.md5(id_to_hash.encode("utf-8")).hexdigest() # nosec + size_name = "custom, {} CPUs, {}MB RAM, {}GB disk".format( + extra["cpus"], extra["memory"], drive_size + ) # noqa + size = CloudSigmaNodeSize( + id=size_id, + name=size_name, + cpu=extra["cpus"], + ram=extra["memory"], + disk=drive_size, + bandwidth=None, + price=0, + driver=self, + ) + + for nic in data["nics"]: _public_ips, _private_ips = self._parse_ips_from_nic(nic=nic) public_ips.extend(_public_ips) private_ips.extend(_private_ips) - node = Node(id=id, name=name, state=state, public_ips=public_ips, - private_ips=private_ips, driver=self, extra=extra) + node = Node( + id=id, + name=name, + state=state, + public_ips=public_ips, + image=image, + private_ips=private_ips, + driver=self, + size=size, + extra=extra, + ) + return node def _to_image(self, data): - extra_keys = ['description', 'arch', 'image_type', 'os', 'licenses', - 'media', 'meta'] + extra_keys = [ + "description", + "arch", + "image_type", + "os", + "licenses", + "media", + "meta", + ] - id = data['uuid'] - name = data['name'] + id = data["uuid"] + name = data["name"] extra = self._extract_values(obj=data, keys=extra_keys) image = NodeImage(id=id, name=name, driver=self, extra=extra) + return image def _to_drive(self, data): - id = data['uuid'] - name = data['name'] - size = data['size'] - media = data['media'] - status = data['status'] - extra = {} + id = data["uuid"] + name = data["name"] + size = data["size"] / 1024 / 1024 / 1024 + media = data["media"] + status = data["status"] + extra = { + "mounted_on": data.get("mounted_on", []), + "storage_type": data.get("storage_type", ""), + "distribution": data["meta"].get("distribution", ""), + "version": data["meta"].get("version", ""), + "os": data["meta"].get("os", ""), + "paid": data["meta"].get("paid", ""), + "architecture": data["meta"].get("arch", ""), + "created_at": data["meta"].get("created_at", ""), + } - drive = CloudSigmaDrive(id=id, name=name, size=size, media=media, - status=status, driver=self, extra=extra) + drive = CloudSigmaDrive( + id=id, + name=name, + size=size, + media=media, + status=status, + driver=self, + extra=extra, + ) return drive def _to_tag(self, data): - resources = data['resources'] - resources = [resource['uuid'] for resource in resources] + resources = data["resources"] + resources = [resource["uuid"] for resource in resources] + + tag = CloudSigmaTag(id=data["uuid"], name=data["name"], resources=resources) - tag = CloudSigmaTag(id=data['uuid'], name=data['name'], - resources=resources) return tag def _to_subscriptions(self, data): subscriptions = [] - for item in data['objects']: + for item in data["objects"]: subscription = self._to_subscription(data=item) subscriptions.append(subscription) return subscriptions def _to_subscription(self, data): - start_time = parse_date(data['start_time']) - end_time = parse_date(data['end_time']) - obj_uuid = data['subscribed_object'] - - subscription = CloudSigmaSubscription(id=data['id'], - resource=data['resource'], - amount=int(data['amount']), - period=data['period'], - status=data['status'], - price=data['price'], - start_time=start_time, - end_time=end_time, - auto_renew=data['auto_renew'], - subscribed_object=obj_uuid) + if data.get("start_time", None): + start_time = parse_date(data["start_time"]) + else: + start_time = None + + if data.get("end_time", None): + end_time = parse_date(data["end_time"]) + else: + end_time = None + + obj_uuid = data["subscribed_object"] + + subscription = CloudSigmaSubscription( + id=data["id"], + resource=data["resource"], + amount=int(data["amount"]), + period=data["period"], + status=data["status"], + price=data["price"], + start_time=start_time, + end_time=end_time, + auto_renew=data["auto_renew"], + subscribed_object=obj_uuid, + ) + return subscription def _to_firewall_policy(self, data): rules = [] - for item in data.get('rules', []): - rule = CloudSigmaFirewallPolicyRule(action=item['action'], - direction=item['direction'], - ip_proto=item['ip_proto'], - src_ip=item['src_ip'], - src_port=item['src_port'], - dst_ip=item['dst_ip'], - dst_port=item['dst_port'], - comment=item['comment']) + for item in data.get("rules", []): + rule = CloudSigmaFirewallPolicyRule( + action=item["action"], + direction=item["direction"], + ip_proto=item["ip_proto"], + src_ip=item["src_ip"], + src_port=item["src_port"], + dst_ip=item["dst_ip"], + dst_port=item["dst_port"], + comment=item["comment"], + ) rules.append(rule) - policy = CloudSigmaFirewallPolicy(id=data['uuid'], name=data['name'], - rules=rules) + policy = CloudSigmaFirewallPolicy(id=data["uuid"], name=data["name"], rules=rules) + return policy - def _perform_action(self, path, action, method='POST', params=None, - data=None): + def _to_key_pair(self, data): + extra = { + "uuid": data["uuid"], + "tags": data["tags"], + "resource_uri": data["resource_uri"], + "permissions": data["permissions"], + "meta": data["meta"], + } + + return KeyPair( + name=data["name"], + public_key=data["public_key"], + fingerprint=data["fingerprint"], + driver=self, + private_key=data["private_key"], + extra=extra, + ) + + def _perform_action(self, path, action, method="POST", params=None, data=None): """ Perform API action and return response object. """ + if params: params = params.copy() else: params = {} - params['do'] = action - response = self.connection.request(action=path, method=method, - params=params, data=data) + params["do"] = action + response = self.connection.request(action=path, method=method, params=params, data=data) + return response def _is_installation_cd(self, image): @@ -2013,7 +2525,8 @@ def _is_installation_cd(self, image): :rtype: ``bool`` """ - if isinstance(image, CloudSigmaDrive) and image.media == 'cdrom': + + if isinstance(image, CloudSigmaDrive) and image.media == "cdrom": return True return False @@ -2039,8 +2552,7 @@ def _extract_values(self, obj, keys): return result - def _wait_for_drive_state_transition(self, drive, state, - timeout=DRIVE_TRANSITION_TIMEOUT): + def _wait_for_drive_state_transition(self, drive, state, timeout=DRIVE_TRANSITION_TIMEOUT): """ Wait for a drive to transition to the provided state. @@ -2070,11 +2582,12 @@ def _wait_for_drive_state_transition(self, drive, state, break current_time = time.time() - delta = (current_time - start_time) + delta = current_time - start_time if delta >= timeout: - msg = ('Timed out while waiting for drive transition ' - '(timeout=%s seconds)' % (timeout)) + msg = "Timed out while waiting for drive transition " "(timeout=%s seconds)" % ( + timeout + ) raise Exception(msg) time.sleep(self.DRIVE_TRANSITION_SLEEP_INTERVAL) @@ -2088,6 +2601,6 @@ def _ex_connection_class_kwargs(self): kwargs = {} if not self._host_argument_set: - kwargs['host'] = API_ENDPOINTS_2_0[self.region]['host'] + kwargs["host"] = API_ENDPOINTS_2_0[self.region]["host"] return kwargs diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py index db89f2760d..bec45459c1 100644 --- a/libcloud/compute/drivers/cloudstack.py +++ b/libcloud/compute/drivers/cloudstack.py @@ -13,380 +13,302 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement import base64 import warnings -from libcloud.utils.py3 import b -from libcloud.utils.py3 import urlparse - -from libcloud.compute.providers import Provider -from libcloud.common.cloudstack import CloudStackDriverMixIn -from libcloud.compute.base import Node, NodeDriver, NodeImage, NodeLocation -from libcloud.compute.base import NodeSize, StorageVolume, VolumeSnapshot -from libcloud.compute.base import KeyPair -from libcloud.compute.types import NodeState, LibcloudError -from libcloud.compute.types import KeyPairDoesNotExistError +from libcloud.utils.py3 import b, urlparse +from libcloud.compute.base import ( + Node, + KeyPair, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, + VolumeSnapshot, +) +from libcloud.compute.types import ( + NodeState, + LibcloudError, + StorageVolumeState, + KeyPairDoesNotExistError, +) from libcloud.utils.networking import is_private_subnet +from libcloud.common.cloudstack import CloudStackDriverMixIn +from libcloud.compute.providers import Provider + + +# Utility functions +def transform_int_or_unlimited(value): + try: + return int(value) + except ValueError as e: + if str(value).lower() == "unlimited": + return -1 + + raise e """ Define the extra dictionary for specific resources """ RESOURCE_EXTRA_ATTRIBUTES_MAP = { - 'network': { - 'broadcast_domain_type': { - 'key_name': 'broadcastdomaintype', - 'transform_func': str - }, - 'traffic_type': { - 'key_name': 'traffictype', - 'transform_func': str + "network": { + "broadcast_domain_type": { + "key_name": "broadcastdomaintype", + "transform_func": str, }, - 'zone_name': { - 'key_name': 'zonename', - 'transform_func': str + "traffic_type": {"key_name": "traffictype", "transform_func": str}, + "zone_name": {"key_name": "zonename", "transform_func": str}, + "network_offering_name": { + "key_name": "networkofferingname", + "transform_func": str, }, - 'network_offering_name': { - 'key_name': 'networkofferingname', - 'transform_func': str + "network_offeringdisplay_text": { + "key_name": "networkofferingdisplaytext", + "transform_func": str, }, - 'network_offeringdisplay_text': { - 'key_name': 'networkofferingdisplaytext', - 'transform_func': str + "network_offering_availability": { + "key_name": "networkofferingavailability", + "transform_func": str, }, - 'network_offering_availability': { - 'key_name': 'networkofferingavailability', - 'transform_func': str - }, - 'is_system': { - 'key_name': 'issystem', - 'transform_func': str - }, - 'state': { - 'key_name': 'state', - 'transform_func': str - }, - 'dns1': { - 'key_name': 'dns1', - 'transform_func': str - }, - 'dns2': { - 'key_name': 'dns2', - 'transform_func': str - }, - 'type': { - 'key_name': 'type', - 'transform_func': str - }, - 'acl_type': { - 'key_name': 'acltype', - 'transform_func': str - }, - 'subdomain_access': { - 'key_name': 'subdomainaccess', - 'transform_func': str + "is_system": {"key_name": "issystem", "transform_func": str}, + "state": {"key_name": "state", "transform_func": str}, + "dns1": {"key_name": "dns1", "transform_func": str}, + "dns2": {"key_name": "dns2", "transform_func": str}, + "type": {"key_name": "type", "transform_func": str}, + "acl_type": {"key_name": "acltype", "transform_func": str}, + "subdomain_access": {"key_name": "subdomainaccess", "transform_func": str}, + "network_domain": {"key_name": "networkdomain", "transform_func": str}, + "physical_network_id": {"key_name": "physicalnetworkid", "transform_func": str}, + "can_use_for_deploy": {"key_name": "canusefordeploy", "transform_func": str}, + "gateway": {"key_name": "gateway", "transform_func": str}, + "netmask": {"key_name": "netmask", "transform_func": str}, + "vpc_id": {"key_name": "vpcid", "transform_func": str}, + "project_id": {"key_name": "projectid", "transform_func": str}, + }, + "node": { + "haenable": {"key_name": "haenable", "transform_func": str}, + "zone_id": {"key_name": "zoneid", "transform_func": str}, + "zone_name": {"key_name": "zonename", "transform_func": str}, + "key_name": {"key_name": "keypair", "transform_func": str}, + "password": {"key_name": "password", "transform_func": str}, + "image_id": {"key_name": "templateid", "transform_func": str}, + "image_name": {"key_name": "templatename", "transform_func": str}, + "template_display_text": { + "key_name": "templatdisplaytext", + "transform_func": str, }, - 'network_domain': { - 'key_name': 'networkdomain', - 'transform_func': str + "password_enabled": {"key_name": "passwordenabled", "transform_func": str}, + "size_id": {"key_name": "serviceofferingid", "transform_func": str}, + "size_name": {"key_name": "serviceofferingname", "transform_func": str}, + "root_device_id": {"key_name": "rootdeviceid", "transform_func": str}, + "root_device_type": {"key_name": "rootdevicetype", "transform_func": str}, + "hypervisor": {"key_name": "hypervisor", "transform_func": str}, + "project": {"key_name": "project", "transform_func": str}, + "project_id": {"key_name": "projectid", "transform_func": str}, + "nics:": {"key_name": "nic", "transform_func": list}, + }, + "volume": { + "created": {"key_name": "created", "transform_func": str}, + "device_id": { + "key_name": "deviceid", + "transform_func": transform_int_or_unlimited, }, - 'physical_network_id': { - 'key_name': 'physicalnetworkid', - 'transform_func': str + "instance_id": {"key_name": "virtualmachineid", "transform_func": str}, + "serviceoffering_id": {"key_name": "serviceofferingid", "transform_func": str}, + "state": {"key_name": "state", "transform_func": str}, + "volume_type": {"key_name": "type", "transform_func": str}, + "zone_id": {"key_name": "zoneid", "transform_func": str}, + "zone_name": {"key_name": "zonename", "transform_func": str}, + }, + "vpc": { + "created": {"key_name": "created", "transform_func": str}, + "domain": {"key_name": "domain", "transform_func": str}, + "domain_id": { + "key_name": "domainid", + "transform_func": transform_int_or_unlimited, }, - 'can_use_for_deploy': { - 'key_name': 'canusefordeploy', - 'transform_func': str + "network_domain": {"key_name": "networkdomain", "transform_func": str}, + "state": {"key_name": "state", "transform_func": str}, + "vpc_offering_id": {"key_name": "vpcofferingid", "transform_func": str}, + "zone_name": {"key_name": "zonename", "transform_func": str}, + "zone_id": {"key_name": "zoneid", "transform_func": str}, + }, + "project": { + "account": {"key_name": "account", "transform_func": str}, + "cpuavailable": { + "key_name": "cpuavailable", + "transform_func": transform_int_or_unlimited, }, - 'gateway': { - 'key_name': 'gateway', - 'transform_func': str + "cpulimit": { + "key_name": "cpulimit", + "transform_func": transform_int_or_unlimited, }, - 'netmask': { - 'key_name': 'netmask', - 'transform_func': str + "cputotal": { + "key_name": "cputotal", + "transform_func": transform_int_or_unlimited, }, - 'vpc_id': { - 'key_name': 'vpcid', - 'transform_func': str + "domain": {"key_name": "domain", "transform_func": str}, + "domainid": {"key_name": "domainid", "transform_func": str}, + "ipavailable": { + "key_name": "ipavailable", + "transform_func": transform_int_or_unlimited, }, - 'project_id': { - 'key_name': 'projectid', - 'transform_func': str - } - }, - 'node': { - 'haenable': { - 'key_name': 'haenable', - 'transform_func': str + "iplimit": { + "key_name": "iplimit", + "transform_func": transform_int_or_unlimited, }, - 'zone_id': { - 'key_name': 'zoneid', - 'transform_func': str + "iptotal": { + "key_name": "iptotal", + "transform_func": transform_int_or_unlimited, }, - 'zone_name': { - 'key_name': 'zonename', - 'transform_func': str + "memoryavailable": { + "key_name": "memoryavailable", + "transform_func": transform_int_or_unlimited, }, - 'key_name': { - 'key_name': 'keypair', - 'transform_func': str + "memorylimit": { + "key_name": "memorylimit", + "transform_func": transform_int_or_unlimited, }, - 'password': { - 'key_name': 'password', - 'transform_func': str + "memorytotal": { + "key_name": "memorytotal", + "transform_func": transform_int_or_unlimited, }, - 'image_id': { - 'key_name': 'templateid', - 'transform_func': str + "networkavailable": { + "key_name": "networkavailable", + "transform_func": transform_int_or_unlimited, }, - 'image_name': { - 'key_name': 'templatename', - 'transform_func': str + "networklimit": { + "key_name": "networklimit", + "transform_func": transform_int_or_unlimited, }, - 'template_display_text': { - 'key_name': 'templatdisplaytext', - 'transform_func': str + "networktotal": { + "key_name": "networktotal", + "transform_func": transform_int_or_unlimited, }, - 'password_enabled': { - 'key_name': 'passwordenabled', - 'transform_func': str + "primarystorageavailable": { + "key_name": "primarystorageavailable", + "transform_func": transform_int_or_unlimited, }, - 'size_id': { - 'key_name': 'serviceofferingid', - 'transform_func': str + "primarystoragelimit": { + "key_name": "primarystoragelimit", + "transform_func": transform_int_or_unlimited, }, - 'size_name': { - 'key_name': 'serviceofferingname', - 'transform_func': str + "primarystoragetotal": { + "key_name": "primarystoragetotal", + "transform_func": transform_int_or_unlimited, }, - 'root_device_id': { - 'key_name': 'rootdeviceid', - 'transform_func': str + "secondarystorageavailable": { + "key_name": "secondarystorageavailable", + "transform_func": transform_int_or_unlimited, }, - 'root_device_type': { - 'key_name': 'rootdevicetype', - 'transform_func': str + "secondarystoragelimit": { + "key_name": "secondarystoragelimit", + "transform_func": transform_int_or_unlimited, }, - 'hypervisor': { - 'key_name': 'hypervisor', - 'transform_func': str + "secondarystoragetotal": { + "key_name": "secondarystoragetotal", + "transform_func": transform_int_or_unlimited, }, - 'project': { - 'key_name': 'project', - 'transform_func': str + "snapshotavailable": { + "key_name": "snapshotavailable", + "transform_func": transform_int_or_unlimited, }, - 'project_id': { - 'key_name': 'projectid', - 'transform_func': str + "snapshotlimit": { + "key_name": "snapshotlimit", + "transform_func": transform_int_or_unlimited, }, - 'nics:': { - 'key_name': 'nic', - 'transform_func': list - } - }, - 'volume': { - 'created': { - 'key_name': 'created', - 'transform_func': str + "snapshottotal": { + "key_name": "snapshottotal", + "transform_func": transform_int_or_unlimited, }, - 'device_id': { - 'key_name': 'deviceid', - 'transform_func': int + "state": {"key_name": "state", "transform_func": str}, + "tags": {"key_name": "tags", "transform_func": str}, + "templateavailable": { + "key_name": "templateavailable", + "transform_func": transform_int_or_unlimited, }, - 'instance_id': { - 'key_name': 'virtualmachineid', - 'transform_func': str + "templatelimit": { + "key_name": "templatelimit", + "transform_func": transform_int_or_unlimited, }, - 'serviceoffering_id': { - 'key_name': 'serviceofferingid', - 'transform_func': str + "templatetotal": { + "key_name": "templatetotal", + "transform_func": transform_int_or_unlimited, }, - 'state': { - 'key_name': 'state', - 'transform_func': str + "vmavailable": { + "key_name": "vmavailable", + "transform_func": transform_int_or_unlimited, }, - 'volume_type': { - 'key_name': 'type', - 'transform_func': str + "vmlimit": { + "key_name": "vmlimit", + "transform_func": transform_int_or_unlimited, }, - 'zone_id': { - 'key_name': 'zoneid', - 'transform_func': str + "vmrunning": { + "key_name": "vmrunning", + "transform_func": transform_int_or_unlimited, }, - 'zone_name': { - 'key_name': 'zonename', - 'transform_func': str - } - }, - 'vpc': { - 'created': { - 'key_name': 'created', - 'transform_func': str + "vmtotal": { + "key_name": "vmtotal", + "transform_func": transform_int_or_unlimited, }, - 'domain': { - 'key_name': 'domain', - 'transform_func': str + "volumeavailable": { + "key_name": "volumeavailable", + "transform_func": transform_int_or_unlimited, }, - 'domain_id': { - 'key_name': 'domainid', - 'transform_func': int + "volumelimit": { + "key_name": "volumelimit", + "transform_func": transform_int_or_unlimited, }, - 'network_domain': { - 'key_name': 'networkdomain', - 'transform_func': str + "volumetotal": { + "key_name": "volumetotal", + "transform_func": transform_int_or_unlimited, }, - 'state': { - 'key_name': 'state', - 'transform_func': str + "vpcavailable": { + "key_name": "vpcavailable", + "transform_func": transform_int_or_unlimited, }, - 'vpc_offering_id': { - 'key_name': 'vpcofferingid', - 'transform_func': str + "vpclimit": { + "key_name": "vpclimit", + "transform_func": transform_int_or_unlimited, }, - 'zone_name': { - 'key_name': 'zonename', - 'transform_func': str + "vpctotal": { + "key_name": "vpctotal", + "transform_func": transform_int_or_unlimited, }, - 'zone_id': { - 'key_name': 'zoneid', - 'transform_func': str - } }, - 'project': { - 'account': {'key_name': 'account', 'transform_func': str}, - 'cpuavailable': {'key_name': 'cpuavailable', 'transform_func': int}, - 'cpulimit': {'key_name': 'cpulimit', 'transform_func': int}, - 'cputotal': {'key_name': 'cputotal', 'transform_func': int}, - 'domain': {'key_name': 'domain', 'transform_func': str}, - 'domainid': {'key_name': 'domainid', 'transform_func': str}, - 'ipavailable': {'key_name': 'ipavailable', 'transform_func': int}, - 'iplimit': {'key_name': 'iplimit', 'transform_func': int}, - 'iptotal': {'key_name': 'iptotal', 'transform_func': int}, - 'memoryavailable': {'key_name': 'memoryavailable', - 'transform_func': int}, - 'memorylimit': {'key_name': 'memorylimit', 'transform_func': int}, - 'memorytotal': {'key_name': 'memorytotal', 'transform_func': int}, - 'networkavailable': {'key_name': 'networkavailable', - 'transform_func': int}, - 'networklimit': {'key_name': 'networklimit', 'transform_func': int}, - 'networktotal': {'key_name': 'networktotal', 'transform_func': int}, - 'primarystorageavailable': {'key_name': 'primarystorageavailable', - 'transform_func': int}, - 'primarystoragelimit': {'key_name': 'primarystoragelimit', - 'transform_func': int}, - 'primarystoragetotal': {'key_name': 'primarystoragetotal', - 'transform_func': int}, - 'secondarystorageavailable': {'key_name': 'secondarystorageavailable', - 'transform_func': int}, - 'secondarystoragelimit': {'key_name': 'secondarystoragelimit', - 'transform_func': int}, - 'secondarystoragetotal': {'key_name': 'secondarystoragetotal', - 'transform_func': int}, - 'snapshotavailable': {'key_name': 'snapshotavailable', - 'transform_func': int}, - 'snapshotlimit': {'key_name': 'snapshotlimit', 'transform_func': int}, - 'snapshottotal': {'key_name': 'snapshottotal', 'transform_func': int}, - 'state': {'key_name': 'state', 'transform_func': str}, - 'tags': {'key_name': 'tags', 'transform_func': str}, - 'templateavailable': {'key_name': 'templateavailable', - 'transform_func': int}, - 'templatelimit': {'key_name': 'templatelimit', 'transform_func': int}, - 'templatetotal': {'key_name': 'templatetotal', 'transform_func': int}, - 'vmavailable': {'key_name': 'vmavailable', 'transform_func': int}, - 'vmlimit': {'key_name': 'vmlimit', 'transform_func': int}, - 'vmrunning': {'key_name': 'vmrunning', 'transform_func': int}, - 'vmtotal': {'key_name': 'vmtotal', 'transform_func': int}, - 'volumeavailable': {'key_name': 'volumeavailable', - 'transform_func': int}, - 'volumelimit': {'key_name': 'volumelimit', 'transform_func': int}, - 'volumetotal': {'key_name': 'volumetotal', 'transform_func': int}, - 'vpcavailable': {'key_name': 'vpcavailable', 'transform_func': int}, - 'vpclimit': {'key_name': 'vpclimit', 'transform_func': int}, - 'vpctotal': {'key_name': 'vpctotal', 'transform_func': int} + "nic": {"secondary_ip": {"key_name": "secondaryip", "transform_func": list}}, + "vpngateway": { + "for_display": {"key_name": "fordisplay", "transform_func": str}, + "project": {"key_name": "project", "transform_func": str}, + "project_id": {"key_name": "projectid", "transform_func": str}, + "removed": {"key_name": "removed", "transform_func": str}, }, - 'nic': { - 'secondary_ip': { - 'key_name': 'secondaryip', - 'transform_func': list - } - }, - 'vpngateway': { - 'for_display': { - 'key_name': 'fordisplay', - 'transform_func': str - }, - 'project': { - 'key_name': 'project', - 'transform_func': str + "vpncustomergateway": { + "account": {"key_name": "account", "transform_func": str}, + "domain": {"key_name": "domain", "transform_func": str}, + "domain_id": {"key_name": "domainid", "transform_func": str}, + "dpd": {"key_name": "dpd", "transform_func": bool}, + "esp_lifetime": { + "key_name": "esplifetime", + "transform_func": transform_int_or_unlimited, }, - 'project_id': { - 'key_name': 'projectid', - 'transform_func': str + "ike_lifetime": { + "key_name": "ikelifetime", + "transform_func": transform_int_or_unlimited, }, - 'removed': { - 'key_name': 'removed', - 'transform_func': str - } + "name": {"key_name": "name", "transform_func": str}, }, - 'vpncustomergateway': { - 'account': { - 'key_name': 'account', - 'transform_func': str - }, - 'domain': { - 'key_name': 'domain', - 'transform_func': str - }, - 'domain_id': { - 'key_name': 'domainid', - 'transform_func': str - }, - 'dpd': { - 'key_name': 'dpd', - 'transform_func': bool - }, - 'esp_lifetime': { - 'key_name': 'esplifetime', - 'transform_func': int - }, - 'ike_lifetime': { - 'key_name': 'ikelifetime', - 'transform_func': int - }, - 'name': { - 'key_name': 'name', - 'transform_func': str - } + "vpnconnection": { + "account": {"key_name": "account", "transform_func": str}, + "domain": {"key_name": "domain", "transform_func": str}, + "domain_id": {"key_name": "domainid", "transform_func": str}, + "for_display": {"key_name": "fordisplay", "transform_func": str}, + "project": {"key_name": "project", "transform_func": str}, + "project_id": {"key_name": "projectid", "transform_func": str}, }, - 'vpnconnection': { - 'account': { - 'key_name': 'account', - 'transform_func': str - }, - 'domain': { - 'key_name': 'domain', - 'transform_func': str - }, - 'domain_id': { - 'key_name': 'domainid', - 'transform_func': str - }, - 'for_display': { - 'key_name': 'fordisplay', - 'transform_func': str - }, - 'project': { - 'key_name': 'project', - 'transform_func': str - }, - 'project_id': { - 'key_name': 'projectid', - 'transform_func': str - } - } } @@ -407,31 +329,41 @@ def ex_release_public_ip(self, address): """ return self.driver.ex_release_public_ip(self, address) - def ex_create_ip_forwarding_rule(self, address, protocol, - start_port, end_port=None): + def ex_create_ip_forwarding_rule(self, address, protocol, start_port, end_port=None): """ Add a NAT/firewall forwarding rule for a port or ports. """ - return self.driver.ex_create_ip_forwarding_rule(node=self, - address=address, - protocol=protocol, - start_port=start_port, - end_port=end_port) - - def ex_create_port_forwarding_rule(self, address, - private_port, public_port, - protocol, - public_end_port=None, - private_end_port=None, - openfirewall=True): + return self.driver.ex_create_ip_forwarding_rule( + node=self, + address=address, + protocol=protocol, + start_port=start_port, + end_port=end_port, + ) + + def ex_create_port_forwarding_rule( + self, + address, + private_port, + public_port, + protocol, + public_end_port=None, + private_end_port=None, + openfirewall=True, + ): """ Add a port forwarding rule for port or ports. """ return self.driver.ex_create_port_forwarding_rule( - node=self, address=address, private_port=private_port, - public_port=public_port, protocol=protocol, - public_end_port=public_end_port, private_end_port=private_end_port, - openfirewall=openfirewall) + node=self, + address=address, + private_port=private_port, + public_port=public_port, + protocol=protocol, + public_end_port=public_end_port, + private_end_port=private_end_port, + openfirewall=openfirewall, + ) def ex_delete_ip_forwarding_rule(self, rule): """ @@ -445,6 +377,18 @@ def ex_delete_port_forwarding_rule(self, rule): """ return self.driver.ex_delete_port_forwarding_rule(node=self, rule=rule) + def ex_restore(self, template=None): + """ + Restore virtual machine + """ + return self.driver.ex_restore(node=self, template=template) + + def ex_change_node_size(self, offering): + """ + Change virtual machine offering/size + """ + return self.driver.ex_change_node_size(node=self, offering=offering) + def ex_start(self): """ Starts a stopped virtual machine. @@ -458,7 +402,7 @@ def ex_stop(self): return self.driver.ex_stop(node=self) -class CloudStackAddress(object): +class CloudStackAddress: """ A public IP address. @@ -474,15 +418,27 @@ class CloudStackAddress(object): :param vpc_id: VPC the ip belongs to :type vpc_id: ``str`` + + :param virtualmachine_id: The ID of virtual machine this address + is assigned to + :type virtualmachine_id: ``str`` """ - def __init__(self, id, address, driver, associated_network_id=None, - vpc_id=None): + def __init__( + self, + id, + address, + driver, + associated_network_id=None, + vpc_id=None, + virtualmachine_id=None, + ): self.id = id self.address = address self.driver = driver self.associated_network_id = associated_network_id self.vpc_id = vpc_id + self.virtualmachine_id = virtualmachine_id def release(self): self.driver.ex_release_public_ip(address=self) @@ -494,15 +450,22 @@ def __eq__(self, other): return self.__class__ is other.__class__ and self.id == other.id -class CloudStackFirewallRule(object): +class CloudStackFirewallRule: """ A firewall rule. """ - def __init__(self, id, address, cidr_list, protocol, - icmp_code=None, icmp_type=None, - start_port=None, end_port=None): - + def __init__( + self, + id, + address, + cidr_list, + protocol, + icmp_code=None, + icmp_type=None, + start_port=None, + end_port=None, + ): """ A Firewall rule. @@ -549,15 +512,22 @@ def __eq__(self, other): return self.__class__ is other.__class__ and self.id == other.id -class CloudStackEgressFirewallRule(object): +class CloudStackEgressFirewallRule: """ A egress firewall rule. """ - def __init__(self, id, network_id, cidr_list, protocol, - icmp_code=None, icmp_type=None, - start_port=None, end_port=None): - + def __init__( + self, + id, + network_id, + cidr_list, + protocol, + icmp_code=None, + icmp_type=None, + start_port=None, + end_port=None, + ): """ A egress firewall rule. @@ -605,7 +575,7 @@ def __eq__(self, other): return self.__class__ is other.__class__ and self.id == other.id -class CloudStackIPForwardingRule(object): +class CloudStackIPForwardingRule: """ A NAT/firewall forwarding rule. """ @@ -651,14 +621,23 @@ def __eq__(self, other): return self.__class__ is other.__class__ and self.id == other.id -class CloudStackPortForwardingRule(object): +class CloudStackPortForwardingRule: """ A Port forwarding rule for Source NAT. """ - def __init__(self, node, rule_id, address, protocol, public_port, - private_port, public_end_port=None, private_end_port=None, - network_id=None): + def __init__( + self, + node, + rule_id, + address, + protocol, + public_port, + private_port, + public_end_port=None, + private_end_port=None, + network_id=None, + ): """ A Port forwarding rule for Source NAT. @@ -714,7 +693,7 @@ def __eq__(self, other): return self.__class__ is other.__class__ and self.id == other.id -class CloudStackNetworkACLList(object): +class CloudStackNetworkACLList: """ a Network ACL for the given VPC """ @@ -748,19 +727,27 @@ def __init__(self, acl_id, name, vpc_id, driver, description=None): self.description = description def __repr__(self): - return (('') - % (self.id, self.name, self.vpc_id, - self.driver.name, self.description)) + return ( + "" + ) % (self.id, self.name, self.vpc_id, self.driver.name, self.description) -class CloudStackNetworkACL(object): +class CloudStackNetworkACL: """ a ACL rule in the given network (the network has to belong to VPC) """ - def __init__(self, id, protocol, acl_id, action, cidr_list, - start_port, end_port, traffic_type=None): + def __init__( + self, + id, + protocol, + acl_id, + action, + cidr_list, + start_port, + end_port, + traffic_type=None, + ): """ a ACL rule in the given network (the network has to belong to VPC) @@ -772,7 +759,7 @@ def __init__(self, id, protocol, acl_id, action, cidr_list, :type id ``int`` :param protocol: the protocol for the ACL rule. Valid values are - TCP/UDP/ICMP/ALL or valid protocol number + TCP/UDP/ICMP/ALL or valid protocol number :type protocol: ``string`` :param acl_id: Name of the network ACL List @@ -791,7 +778,8 @@ def __init__(self, id, protocol, acl_id, action, cidr_list, :type end_port: ``str`` :param traffic_type: the traffic type for the ACL,can be Ingress - or Egress, defaulted to Ingress if not specified + or Egress, defaulted to Ingress if not + specified :type traffic_type: ``str`` :rtype: :class:`CloudStackNetworkACL` @@ -810,7 +798,7 @@ def __eq__(self, other): return self.__class__ is other.__class__ and self.id == other.id -class CloudStackDiskOffering(object): +class CloudStackDiskOffering: """ A disk offering within CloudStack. """ @@ -825,13 +813,12 @@ def __eq__(self, other): return self.__class__ is other.__class__ and self.id == other.id -class CloudStackNetwork(object): +class CloudStackNetwork: """ Class representing a CloudStack Network. """ - def __init__(self, displaytext, name, networkofferingid, id, zoneid, - driver, extra=None): + def __init__(self, displaytext, name, networkofferingid, id, zoneid, driver, extra=None): self.displaytext = displaytext self.name = name self.networkofferingid = networkofferingid @@ -841,20 +828,36 @@ def __init__(self, displaytext, name, networkofferingid, id, zoneid, self.extra = extra or {} def __repr__(self): - return (('') - % (self.displaytext, self.name, self.networkofferingid, - self.id, self.zoneid, self.driver.name)) - - -class CloudStackNetworkOffering(object): + return ( + "" + ) % ( + self.displaytext, + self.name, + self.networkofferingid, + self.id, + self.zoneid, + self.driver.name, + ) + + +class CloudStackNetworkOffering: """ Class representing a CloudStack Network Offering. """ - def __init__(self, name, display_text, guest_ip_type, id, - service_offering_id, for_vpc, driver, extra=None): + def __init__( + self, + name, + display_text, + guest_ip_type, + id, + service_offering_id, + for_vpc, + driver, + extra=None, + ): self.display_text = display_text self.name = name self.guest_ip_type = guest_ip_type @@ -865,21 +868,38 @@ def __init__(self, name, display_text, guest_ip_type, id, self.extra = extra or {} def __repr__(self): - return (('') - % (self.id, self.name, self.display_text, - self.guest_ip_type, self.service_offering_id, self.for_vpc, - self.driver.name)) - - -class CloudStackNic(object): + return ( + "" + ) % ( + self.id, + self.name, + self.display_text, + self.guest_ip_type, + self.service_offering_id, + self.for_vpc, + self.driver.name, + ) + + +class CloudStackNic: """ Class representing a CloudStack Network Interface. """ - def __init__(self, id, network_id, net_mask, gateway, ip_address, - is_default, mac_address, driver, extra=None): + def __init__( + self, + id, + network_id, + net_mask, + gateway, + ip_address, + is_default, + mac_address, + driver, + extra=None, + ): self.id = id self.network_id = network_id self.net_mask = net_mask @@ -891,24 +911,41 @@ def __init__(self, id, network_id, net_mask, gateway, ip_address, self.extra = extra or {} def __repr__(self): - return (('') - % (self.id, self.network_id, self.net_mask, - self.gateway, self.ip_address, self.is_default, - self.mac_address, self.driver.name)) + return ( + "" + ) % ( + self.id, + self.network_id, + self.net_mask, + self.gateway, + self.ip_address, + self.is_default, + self.mac_address, + self.driver.name, + ) def __eq__(self, other): return self.__class__ is other.__class__ and self.id == other.id -class CloudStackVPC(object): +class CloudStackVPC: """ Class representing a CloudStack VPC. """ - def __init__(self, name, vpc_offering_id, id, cidr, driver, - zone_id=None, display_text=None, extra=None): + def __init__( + self, + name, + vpc_offering_id, + id, + cidr, + driver, + zone_id=None, + display_text=None, + extra=None, + ): self.display_text = display_text self.name = name self.vpc_offering_id = vpc_offering_id @@ -919,20 +956,26 @@ def __init__(self, name, vpc_offering_id, id, cidr, driver, self.extra = extra or {} def __repr__(self): - return (('') - % (self.name, self.vpc_offering_id, self.id, - self.cidr, self.driver.name, self.zone_id, - self.display_text)) - - -class CloudStackVPCOffering(object): + return ( + "" + ) % ( + self.name, + self.vpc_offering_id, + self.id, + self.cidr, + self.driver.name, + self.zone_id, + self.display_text, + ) + + +class CloudStackVPCOffering: """ Class representing a CloudStack VPC Offering. """ - def __init__(self, name, display_text, id, - driver, extra=None): + def __init__(self, name, display_text, id, driver, extra=None): self.name = name self.display_text = display_text self.id = id @@ -940,19 +983,20 @@ def __init__(self, name, display_text, id, self.extra = extra or {} def __repr__(self): - return (('') - % (self.name, self.display_text, self.id, - self.driver.name)) + return ("") % ( + self.name, + self.display_text, + self.id, + self.driver.name, + ) -class CloudStackVpnGateway(object): +class CloudStackVpnGateway: """ Class representing a CloudStack VPN Gateway. """ - def __init__(self, id, account, domain, domain_id, - public_ip, vpc_id, driver, extra=None): + + def __init__(self, id, account, domain, domain_id, public_ip, vpc_id, driver, extra=None): self.id = id self.account = account self.domain = domain @@ -968,25 +1012,43 @@ def vpc(self): if self.vpc_id == vpc.id: return vpc - raise LibcloudError('VPC with id=%s not found' % self.vpc_id) + raise LibcloudError("VPC with id=%s not found" % self.vpc_id) def delete(self): return self.driver.ex_delete_vpn_gateway(vpn_gateway=self) def __repr__(self): - return (('') - % (self.account, self.domain, self.domain_id, - self.id, self.public_ip, self.vpc_id, self.driver.name)) - - -class CloudStackVpnCustomerGateway(object): + return ( + "" + ) % ( + self.account, + self.domain, + self.domain_id, + self.id, + self.public_ip, + self.vpc_id, + self.driver.name, + ) + + +class CloudStackVpnCustomerGateway: """ Class representing a CloudStack VPN Customer Gateway. """ - def __init__(self, id, cidr_list, esp_policy, gateway, - ike_policy, ipsec_psk, driver, extra=None): + + def __init__( + self, + id, + cidr_list, + esp_policy, + gateway, + ike_policy, + ipsec_psk, + driver, + extra=None, + ): self.id = id self.cidr_list = cidr_list self.esp_policy = esp_policy @@ -997,23 +1059,39 @@ def __init__(self, id, cidr_list, esp_policy, gateway, self.extra = extra or {} def delete(self): - return self.driver.ex_delete_vpn_customer_gateway( - vpn_customer_gateway=self) + return self.driver.ex_delete_vpn_customer_gateway(vpn_customer_gateway=self) def __repr__(self): - return (('') - % (self.id, self.cidr_list, self.esp_policy, self.gateway, - self.ike_policy, self.ipsec_psk, self.driver.name)) - - -class CloudStackVpnConnection(object): + return ( + "" + ) % ( + self.id, + self.cidr_list, + self.esp_policy, + self.gateway, + self.ike_policy, + self.ipsec_psk, + self.driver.name, + ) + + +class CloudStackVpnConnection: """ Class representing a CloudStack VPN Connection. """ - def __init__(self, id, passive, vpn_customer_gateway_id, - vpn_gateway_id, state, driver, extra=None): + + def __init__( + self, + id, + passive, + vpn_customer_gateway_id, + vpn_gateway_id, + state, + driver, + extra=None, + ): self.id = id self.passive = passive self.vpn_customer_gateway_id = vpn_customer_gateway_id @@ -1025,32 +1103,38 @@ def __init__(self, id, passive, vpn_customer_gateway_id, @property def vpn_customer_gateway(self): try: - return self.driver.ex_list_vpn_customer_gateways( - id=self.vpn_customer_gateway_id)[0] + return self.driver.ex_list_vpn_customer_gateways(id=self.vpn_customer_gateway_id)[0] except IndexError: - raise LibcloudError('VPN Customer Gateway with id=%s not found' % - self.vpn_customer_gateway_id) + raise LibcloudError( + "VPN Customer Gateway with id=%s not found" % self.vpn_customer_gateway_id + ) @property def vpn_gateway(self): try: return self.driver.ex_list_vpn_gateways(id=self.vpn_gateway_id)[0] except IndexError: - raise LibcloudError('VPN Gateway with id=%s not found' % - self.vpn_gateway_id) + raise LibcloudError("VPN Gateway with id=%s not found" % self.vpn_gateway_id) def delete(self): return self.driver.ex_delete_vpn_connection(vpn_connection=self) def __repr__(self): - return (('') - % (self.id, self.passive, self.vpn_customer_gateway_id, - self.vpn_gateway_id, self.state, self.driver.name)) - - -class CloudStackRouter(object): + return ( + "" + ) % ( + self.id, + self.passive, + self.vpn_customer_gateway_id, + self.vpn_gateway_id, + self.state, + self.driver.name, + ) + + +class CloudStackRouter: """ Class representing a CloudStack Router. """ @@ -1064,13 +1148,19 @@ def __init__(self, id, name, state, public_ip, vpc_id, driver): self.driver = driver def __repr__(self): - return (('') - % (self.id, self.name, self.state, - self.public_ip, self.vpc_id, self.driver.name)) - - -class CloudStackProject(object): + return ( + "" + ) % ( + self.id, + self.name, + self.state, + self.public_ip, + self.vpc_id, + self.driver.name, + ) + + +class CloudStackProject: """ Class representing a CloudStack Project. """ @@ -1083,19 +1173,30 @@ def __init__(self, id, name, display_text, driver, extra=None): self.extra = extra or {} def __repr__(self): - return (('') - % (self.id, self.display_text, self.name, - self.driver.name)) + return ("") % ( + self.id, + self.display_text, + self.name, + self.driver.name, + ) -class CloudStackAffinityGroup(object): +class CloudStackAffinityGroup: """ Class representing a CloudStack AffinityGroup. """ - def __init__(self, id, account, description, domain, domainid, name, - group_type, virtualmachine_ids): + def __init__( + self, + id, + account, + description, + domain, + domainid, + name, + group_type, + virtualmachine_ids, + ): """ A CloudStack Affinity Group. @@ -1141,11 +1242,14 @@ def __init__(self, id, account, description, domain, domainid, name, self.virtualmachine_ids = virtualmachine_ids def __repr__(self): - return (('') - % (self.id, self.name, self.type)) + return ("") % ( + self.id, + self.name, + self.type, + ) -class CloudStackAffinityGroupType(object): +class CloudStackAffinityGroupType: """ Class representing a CloudStack AffinityGroupType. """ @@ -1165,7 +1269,7 @@ def __init__(self, type_name): self.type = type_name def __repr__(self): - return (('') % self.type) + return ("") % self.type class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver): @@ -1178,25 +1282,49 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver): job completion. :type async_poll_frequency: ``int``""" - name = 'CloudStack' - api_name = 'cloudstack' - website = 'http://cloudstack.org/' + name = "CloudStack" + api_name = "cloudstack" + website = "http://cloudstack.org/" type = Provider.CLOUDSTACK - features = {'create_node': ['generates_password']} + features = {"create_node": ["generates_password"]} NODE_STATE_MAP = { - 'Running': NodeState.RUNNING, - 'Starting': NodeState.REBOOTING, - 'Stopped': NodeState.STOPPED, - 'Stopping': NodeState.PENDING, - 'Destroyed': NodeState.TERMINATED, - 'Expunging': NodeState.PENDING, - 'Error': NodeState.TERMINATED + "Running": NodeState.RUNNING, + "Starting": NodeState.REBOOTING, + "Migrating": NodeState.MIGRATING, + "Stopped": NodeState.STOPPED, + "Stopping": NodeState.PENDING, + "Destroyed": NodeState.TERMINATED, + "Expunging": NodeState.PENDING, + "Error": NodeState.TERMINATED, } - def __init__(self, key, secret=None, secure=True, host=None, - path=None, port=None, url=None, *args, **kwargs): + VOLUME_STATE_MAP = { + "Creating": StorageVolumeState.CREATING, + "Destroying": StorageVolumeState.DELETING, + "Expunging": StorageVolumeState.DELETING, + "Destroy": StorageVolumeState.DELETED, + "Expunged": StorageVolumeState.DELETED, + "Allocated": StorageVolumeState.AVAILABLE, + "Ready": StorageVolumeState.AVAILABLE, + "Snapshotting": StorageVolumeState.BACKUP, + "UploadError": StorageVolumeState.ERROR, + "Migrating": StorageVolumeState.MIGRATING, + } + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + path=None, + port=None, + url=None, + *args, + **kwargs, + ): """ :inherits: :class:`NodeDriver.__init__` @@ -1216,12 +1344,12 @@ def __init__(self, key, secret=None, secure=True, host=None, path = parsed.path scheme = parsed.scheme - split = parsed.netloc.split(':') + split = parsed.netloc.split(":") if len(split) == 1: # No port provided, use the default one host = parsed.netloc - port = 443 if scheme == 'https' else 80 + port = 443 if scheme == "https" else 80 else: host = split[0] port = int(split[1]) @@ -1236,60 +1364,57 @@ def __init__(self, key, secret=None, secure=True, host=None, self.host = host if (self.type == Provider.CLOUDSTACK) and (not host or not path): - raise Exception('When instantiating CloudStack driver directly ' - 'you also need to provide url or host and path ' - 'argument') + raise Exception( + "When instantiating CloudStack driver directly " + "you also need to provide url or host and path " + "argument" + ) - super(CloudStackNodeDriver, self).__init__(key=key, - secret=secret, - secure=secure, - host=host, - port=port) + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port) def list_images(self, location=None): - args = { - 'templatefilter': 'executable' - } + args = {"templatefilter": "executable"} if location is not None: - args['zoneid'] = location.id + args["zoneid"] = location.id - imgs = self._sync_request(command='listTemplates', - params=args, - method='GET') + imgs = self._sync_request(command="listTemplates", params=args, method="GET") images = [] - for img in imgs.get('template', []): - - extra = {'hypervisor': img['hypervisor'], - 'format': img['format'], - 'os': img['ostypename'], - 'displaytext': img['displaytext']} + for img in imgs.get("template", []): + extra = { + "hypervisor": img["hypervisor"], + "format": img["format"], + "os": img["ostypename"], + "displaytext": img["displaytext"], + } - size = img.get('size', None) + size = img.get("size", None) if size is not None: - extra.update({'size': img['size']}) - - images.append(NodeImage( - id=img['id'], - name=img['name'], - driver=self.connection.driver, - extra=extra)) + extra.update({"size": img["size"]}) + + images.append( + NodeImage( + id=img["id"], + name=img["name"], + driver=self.connection.driver, + extra=extra, + ) + ) return images def list_locations(self): """ :rtype ``list`` of :class:`NodeLocation` """ - locs = self._sync_request('listZones') + locs = self._sync_request("listZones") locations = [] - for loc in locs['zone']: - location = NodeLocation(str(loc['id']), loc['name'], 'Unknown', - self) + for loc in locs["zone"]: + location = NodeLocation(str(loc["id"]), loc["name"], "Unknown", self) locations.append(location) return locations - def list_nodes(self, project=None): + def list_nodes(self, project=None, location=None): """ @inherits: :class:`NodeDriver.list_nodes` @@ -1297,86 +1422,198 @@ def list_nodes(self, project=None): the defined project. :type project: :class:`.CloudStackProject` + :keyword location: Limit nodes returned to those in the defined + location. + :type location: :class:`.NodeLocation` + :rtype: ``list`` of :class:`CloudStackNode` """ args = {} + if project: - args['projectid'] = project.id - vms = self._sync_request('listVirtualMachines', params=args) - addrs = self._sync_request('listPublicIpAddresses', params=args) + args["projectid"] = project.id + + if location is not None: + args["zoneid"] = location.id + + vms = self._sync_request("listVirtualMachines", params=args) + addrs = self._sync_request("listPublicIpAddresses", params=args) + port_forwarding_rules = self._sync_request("listPortForwardingRules") + ip_forwarding_rules = self._sync_request("listIpForwardingRules") public_ips_map = {} - for addr in addrs.get('publicipaddress', []): - if 'virtualmachineid' not in addr: + for addr in addrs.get("publicipaddress", []): + if "virtualmachineid" not in addr: continue - vm_id = str(addr['virtualmachineid']) + vm_id = str(addr["virtualmachineid"]) if vm_id not in public_ips_map: public_ips_map[vm_id] = {} - public_ips_map[vm_id][addr['ipaddress']] = addr['id'] + public_ips_map[vm_id][addr["ipaddress"]] = addr["id"] nodes = [] - for vm in vms.get('virtualmachine', []): - public_ips = public_ips_map.get(str(vm['id']), {}).keys() + for vm in vms.get("virtualmachine", []): + public_ips = public_ips_map.get(str(vm["id"]), {}).keys() public_ips = list(public_ips) node = self._to_node(data=vm, public_ips=public_ips) - addresses = public_ips_map.get(vm['id'], {}).items() - addresses = [CloudStackAddress(node, v, k) for k, v in addresses] - node.extra['ip_addresses'] = addresses + addresses = public_ips_map.get(str(vm["id"]), {}).items() + addresses = [ + CloudStackAddress(id=address_id, address=address, driver=node.driver) + for address, address_id in addresses + ] + node.extra["ip_addresses"] = addresses rules = [] for addr in addresses: - result = self._sync_request('listIpForwardingRules') - for r in result.get('ipforwardingrule', []): - if str(r['virtualmachineid']) == node.id: - rule = CloudStackIPForwardingRule(node, r['id'], - addr, - r['protocol'] - .upper(), - r['startport'], - r['endport']) + for r in ip_forwarding_rules.get("ipforwardingrule", []): + if str(r["virtualmachineid"]) == node.id: + rule = CloudStackIPForwardingRule( + node, + r["id"], + addr, + r["protocol"].upper(), + r["startport"], + r["endport"], + ) rules.append(rule) - node.extra['ip_forwarding_rules'] = rules + node.extra["ip_forwarding_rules"] = rules rules = [] - public_ips = self.ex_list_public_ips() - result = self._sync_request('listPortForwardingRules') - for r in result.get('portforwardingrule', []): - if str(r['virtualmachineid']) == node.id: - addr = [a for a in public_ips if - a.address == r['ipaddress']] - rule = CloudStackPortForwardingRule(node, r['id'], - addr[0], - r['protocol'].upper(), - r['publicport'], - r['privateport'], - r['publicendport'], - r['privateendport']) + for r in port_forwarding_rules.get("portforwardingrule", []): + if str(r["virtualmachineid"]) == node.id: + addr = [ + CloudStackAddress(id=a["id"], address=a["ipaddress"], driver=node.driver) + for a in addrs.get("publicipaddress", []) + if a["ipaddress"] == r["ipaddress"] + ] + rule = CloudStackPortForwardingRule( + node, + r["id"], + addr[0], + r["protocol"].upper(), + r["publicport"], + r["privateport"], + r["publicendport"], + r["privateendport"], + ) if not addr[0].address in node.public_ips: node.public_ips.append(addr[0].address) rules.append(rule) - node.extra['port_forwarding_rules'] = rules + node.extra["port_forwarding_rules"] = rules nodes.append(node) return nodes + def ex_get_node(self, node_id, project=None): + """ + Return a Node object based on its ID. + + :param node_id: The id of the node + :type node_id: ``str`` + + :keyword project: Limit node returned to those configured under + the defined project. + :type project: :class:`.CloudStackProject` + + :rtype: :class:`CloudStackNode` + """ + list_nodes_args = {"id": node_id} + list_ips_args = {} + if project: + list_nodes_args["projectid"] = project.id + list_ips_args["projectid"] = project.id + vms = self._sync_request("listVirtualMachines", params=list_nodes_args) + if not vms: + raise Exception("Node '%s' not found" % node_id) + vm = vms["virtualmachine"][0] + addrs = self._sync_request("listPublicIpAddresses", params=list_ips_args) + + public_ips = {} + for addr in addrs.get("publicipaddress", []): + if "virtualmachineid" not in addr: + continue + public_ips[addr["ipaddress"]] = addr["id"] + + node = self._to_node(data=vm, public_ips=list(public_ips.keys())) + + addresses = [ + CloudStackAddress(id=address_id, address=address, driver=node.driver) + for address, address_id in public_ips.items() + ] + node.extra["ip_addresses"] = addresses + + rules = [] + list_fw_rules = {"virtualmachineid": node_id} + for addr in addresses: + result = self._sync_request("listIpForwardingRules", params=list_fw_rules) + for r in result.get("ipforwardingrule", []): + if str(r["virtualmachineid"]) == node.id: + rule = CloudStackIPForwardingRule( + node, + r["id"], + addr, + r["protocol"].upper(), + r["startport"], + r["endport"], + ) + rules.append(rule) + node.extra["ip_forwarding_rules"] = rules + + rules = [] + public_ips = self.ex_list_public_ips() + result = self._sync_request("listPortForwardingRules", params=list_fw_rules) + for r in result.get("portforwardingrule", []): + if str(r["virtualmachineid"]) == node.id: + addr = [a for a in public_ips if a.address == r["ipaddress"]] + rule = CloudStackPortForwardingRule( + node, + r["id"], + addr[0], + r["protocol"].upper(), + r["publicport"], + r["privateport"], + r["publicendport"], + r["privateendport"], + ) + if not addr[0].address in node.public_ips: + node.public_ips.append(addr[0].address) + rules.append(rule) + node.extra["port_forwarding_rules"] = rules + return node + def list_sizes(self, location=None): """ :rtype ``list`` of :class:`NodeSize` """ - szs = self._sync_request(command='listServiceOfferings', - method='GET') + szs = self._sync_request(command="listServiceOfferings", method="GET") sizes = [] - for sz in szs['serviceoffering']: - extra = {'cpu': sz['cpunumber']} - sizes.append(NodeSize(sz['id'], sz['name'], sz['memory'], 0, 0, - 0, self, extra=extra)) + for sz in szs["serviceoffering"]: + extra = {"cpu": sz["cpunumber"]} + sizes.append(NodeSize(sz["id"], sz["name"], sz["memory"], 0, 0, 0, self, extra=extra)) return sizes - def create_node(self, **kwargs): + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + networks=None, + project=None, + diskoffering=None, + ex_keyname=None, + ex_userdata=None, + ex_security_groups=None, + ex_displayname=None, + ex_ip_address=None, + ex_start_vm=False, + ex_rootdisksize=None, + ex_affinity_groups=None, + ): """ Create a new node @@ -1426,85 +1663,102 @@ def create_node(self, **kwargs): :rtype: :class:`.CloudStackNode` """ - server_params = self._create_args_to_params(None, **kwargs) - - data = self._async_request(command='deployVirtualMachine', - params=server_params, - method='GET')['virtualmachine'] + server_params = self._create_args_to_params( + node=None, + name=name, + size=size, + image=image, + location=location, + networks=networks, + diskoffering=diskoffering, + ex_keyname=ex_keyname, + ex_userdata=ex_userdata, + ex_security_groups=ex_security_groups, + ex_displayname=ex_displayname, + ex_ip_address=ex_ip_address, + ex_start_vm=ex_start_vm, + ex_rootdisksize=ex_rootdisksize, + ex_affinity_groups=ex_affinity_groups, + ) + + data = self._async_request( + command="deployVirtualMachine", params=server_params, method="GET" + )["virtualmachine"] node = self._to_node(data=data) return node - def _create_args_to_params(self, node, **kwargs): + def _create_args_to_params( + self, + node, + name, + size, + image, + location=None, + networks=None, + project=None, + diskoffering=None, + ex_keyname=None, + ex_userdata=None, + ex_security_groups=None, + ex_displayname=None, + ex_ip_address=None, + ex_start_vm=False, + ex_rootdisksize=None, + ex_affinity_groups=None, + ): server_params = {} - # TODO: Refactor and use "kwarg_to_server_params" map - name = kwargs.get('name', None) - size = kwargs.get('size', None) - image = kwargs.get('image', None) - location = kwargs.get('location', None) - networks = kwargs.get('networks', None) - project = kwargs.get('project', None) - diskoffering = kwargs.get('diskoffering', None) - ex_key_name = kwargs.get('ex_keyname', None) - ex_user_data = kwargs.get('ex_userdata', None) - ex_security_groups = kwargs.get('ex_security_groups', None) - ex_displayname = kwargs.get('ex_displayname', None) - ex_ip_address = kwargs.get('ex_ip_address', None) - ex_start_vm = kwargs.get('ex_start_vm', None) - ex_rootdisksize = kwargs.get('ex_rootdisksize', None) - ex_affinity_groups = kwargs.get('ex_affinity_groups', None) - if name: - server_params['name'] = name + server_params["name"] = name if ex_displayname: - server_params['displayname'] = ex_displayname + server_params["displayname"] = ex_displayname if size: - server_params['serviceofferingid'] = size.id + server_params["serviceofferingid"] = size.id if image: - server_params['templateid'] = image.id + server_params["templateid"] = image.id if location: - server_params['zoneid'] = location.id + server_params["zoneid"] = location.id else: # Use a default location - server_params['zoneid'] = self.list_locations()[0].id + server_params["zoneid"] = self.list_locations()[0].id if networks: - networks = ','.join([str(network.id) for network in networks]) - server_params['networkids'] = networks + networks = ",".join([str(network.id) for network in networks]) + server_params["networkids"] = networks if project: - server_params['projectid'] = project.id + server_params["projectid"] = project.id if diskoffering: - server_params['diskofferingid'] = diskoffering.id + server_params["diskofferingid"] = diskoffering.id - if ex_key_name: - server_params['keypair'] = ex_key_name + if ex_keyname: + server_params["keypair"] = ex_keyname - if ex_user_data: - ex_user_data = base64.b64encode(b(ex_user_data).decode('ascii')) - server_params['userdata'] = ex_user_data + if ex_userdata: + ex_userdata = base64.b64encode(b(ex_userdata)).decode("ascii") + server_params["userdata"] = ex_userdata if ex_security_groups: - ex_security_groups = ','.join(ex_security_groups) - server_params['securitygroupnames'] = ex_security_groups + ex_security_groups = ",".join(ex_security_groups) + server_params["securitygroupnames"] = ex_security_groups if ex_ip_address: - server_params['ipaddress'] = ex_ip_address + server_params["ipaddress"] = ex_ip_address if ex_rootdisksize: - server_params['rootdisksize'] = ex_rootdisksize + server_params["rootdisksize"] = ex_rootdisksize if ex_start_vm is not None: - server_params['startvm'] = ex_start_vm + server_params["startvm"] = ex_start_vm if ex_affinity_groups: - affinity_group_ids = ','.join(ag.id for ag in ex_affinity_groups) - server_params['affinitygroupids'] = affinity_group_ids + affinity_group_ids = ",".join(ag.id for ag in ex_affinity_groups) + server_params["affinitygroupids"] = affinity_group_ids return server_params @@ -1521,15 +1775,13 @@ def destroy_node(self, node, ex_expunge=False): """ args = { - 'id': node.id, + "id": node.id, } if ex_expunge: - args['expunge'] = ex_expunge + args["expunge"] = ex_expunge - self._async_request(command='destroyVirtualMachine', - params=args, - method='GET') + self._async_request(command="destroyVirtualMachine", params=args, method="GET") return True def reboot_node(self, node): @@ -1539,11 +1791,47 @@ def reboot_node(self, node): :rtype: ``bool`` """ - self._async_request(command='rebootVirtualMachine', - params={'id': node.id}, - method='GET') + self._async_request(command="rebootVirtualMachine", params={"id": node.id}, method="GET") return True + def ex_restore(self, node, template=None): + """ + Restore virtual machine + + :param node: Node to restore + :type node: :class:`CloudStackNode` + + :param template: Optional new template + :type template: :class:`NodeImage` + + :rtype ``str`` + """ + params = {"virtualmachineid": node.id} + if template: + params["templateid"] = template.id + + res = self._async_request(command="restoreVirtualMachine", params=params, method="GET") + return res["virtualmachine"]["templateid"] + + def ex_change_node_size(self, node, offering): + """ + Change offering/size of a virtual machine + + :param node: Node to change size + :type node: :class:`CloudStackNode` + + :param offering: The new offering + :type offering: :class:`NodeSize` + + :rtype ``str`` + """ + res = self._async_request( + command="scaleVirtualMachine", + params={"id": node.id, "serviceofferingid": offering.id}, + method="GET", + ) + return res["virtualmachine"]["serviceofferingid"] + def ex_start(self, node): """ Starts/Resumes a stopped virtual machine @@ -1559,10 +1847,10 @@ def ex_start(self, node): :rtype ``str`` """ - res = self._async_request(command='startVirtualMachine', - params={'id': node.id}, - method='GET') - return res['virtualmachine']['state'] + res = self._async_request( + command="startVirtualMachine", params={"id": node.id}, method="GET" + ) + return res["virtualmachine"]["state"] def ex_stop(self, node): """ @@ -1573,10 +1861,10 @@ def ex_stop(self, node): :rtype: ``str`` """ - res = self._async_request(command='stopVirtualMachine', - params={'id': node.id}, - method='GET') - return res['virtualmachine']['state'] + res = self._async_request( + command="stopVirtualMachine", params={"id": node.id}, method="GET" + ) + return res["virtualmachine"]["state"] def ex_list_disk_offerings(self): """ @@ -1587,15 +1875,16 @@ def ex_list_disk_offerings(self): diskOfferings = [] - diskOfferResponse = self._sync_request(command='listDiskOfferings', - method='GET') - for diskOfferDict in diskOfferResponse.get('diskoffering', ()): + diskOfferResponse = self._sync_request(command="listDiskOfferings", method="GET") + for diskOfferDict in diskOfferResponse.get("diskoffering", ()): diskOfferings.append( CloudStackDiskOffering( - id=diskOfferDict['id'], - name=diskOfferDict['name'], - size=diskOfferDict['disksize'], - customizable=diskOfferDict['iscustomized'])) + id=diskOfferDict["id"], + name=diskOfferDict["name"], + size=diskOfferDict["disksize"], + customizable=diskOfferDict["iscustomized"], + ) + ) return diskOfferings @@ -1612,29 +1901,30 @@ def ex_list_networks(self, project=None): args = {} if project is not None: - args['projectid'] = project.id + args["projectid"] = project.id - res = self._sync_request(command='listNetworks', - params=args, - method='GET') - nets = res.get('network', []) + res = self._sync_request(command="listNetworks", params=args, method="GET") + nets = res.get("network", []) networks = [] - extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['network'] + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["network"] for net in nets: extra = self._get_extra_dict(net, extra_map) - if 'tags' in net: - extra['tags'] = self._get_resource_tags(net['tags']) - - networks.append(CloudStackNetwork( - net['displaytext'], - net['name'], - net['networkofferingid'], - net['id'], - net['zoneid'], - self, - extra=extra)) + if "tags" in net: + extra["tags"] = self._get_resource_tags(net["tags"]) + + networks.append( + CloudStackNetwork( + net["displaytext"], + net["name"], + net["networkofferingid"], + net["id"], + net["zoneid"], + self, + extra=extra, + ) + ) return networks @@ -1644,27 +1934,38 @@ def ex_list_network_offerings(self): :rtype ``list`` of :class:`CloudStackNetworkOffering` """ - res = self._sync_request(command='listNetworkOfferings', - method='GET') - netoffers = res.get('networkoffering', []) + res = self._sync_request(command="listNetworkOfferings", method="GET") + netoffers = res.get("networkoffering", []) networkofferings = [] for netoffer in netoffers: - networkofferings.append(CloudStackNetworkOffering( - netoffer['name'], - netoffer['displaytext'], - netoffer['guestiptype'], - netoffer['id'], - netoffer['serviceofferingid'], - netoffer['forvpc'], - self)) + networkofferings.append( + CloudStackNetworkOffering( + netoffer["name"], + netoffer["displaytext"], + netoffer["guestiptype"], + netoffer["id"], + netoffer["serviceofferingid"], + netoffer["forvpc"], + self, + ) + ) return networkofferings - def ex_create_network(self, display_text, name, network_offering, - location, gateway=None, netmask=None, - network_domain=None, vpc_id=None, project_id=None): + def ex_create_network( + self, + display_text, + name, + network_offering, + location, + gateway=None, + netmask=None, + network_domain=None, + vpc_id=None, + project_id=None, + ): """ Creates a Network, only available in advanced zones. @@ -1700,29 +2001,29 @@ def ex_create_network(self, display_text, name, network_offering, """ - extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['network'] + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["network"] args = { - 'displaytext': display_text, - 'name': name, - 'networkofferingid': network_offering.id, - 'zoneid': location.id, + "displaytext": display_text, + "name": name, + "networkofferingid": network_offering.id, + "zoneid": location.id, } if gateway is not None: - args['gateway'] = gateway + args["gateway"] = gateway if netmask is not None: - args['netmask'] = netmask + args["netmask"] = netmask if network_domain is not None: - args['networkdomain'] = network_domain + args["networkdomain"] = network_domain if vpc_id is not None: - args['vpcid'] = vpc_id + args["vpcid"] = vpc_id if project_id is not None: - args['projectid'] = project_id + args["projectid"] = project_id """ Cloudstack allows for duplicate network names, this should be handled in the code leveraging libcloud @@ -1733,20 +2034,20 @@ def ex_create_network(self, display_text, name, network_offering, # if name == net.name: # raise LibcloudError('This network name already exists') - result = self._sync_request(command='createNetwork', - params=args, - method='GET') + result = self._sync_request(command="createNetwork", params=args, method="GET") - result = result['network'] + result = result["network"] extra = self._get_extra_dict(result, extra_map) - network = CloudStackNetwork(display_text, - name, - network_offering.id, - result['id'], - location.id, - self, - extra=extra) + network = CloudStackNetwork( + display_text, + name, + network_offering.id, + result["id"], + location.id, + self, + extra=extra, + ) return network @@ -1765,11 +2066,9 @@ def ex_delete_network(self, network, force=None): """ - args = {'id': network.id, 'forced': force} + args = {"id": network.id, "forced": force} - self._async_request(command='deleteNetwork', - params=args, - method='GET') + self._async_request(command="deleteNetwork", params=args, method="GET") return True def ex_list_vpc_offerings(self): @@ -1778,43 +2077,51 @@ def ex_list_vpc_offerings(self): :rtype ``list`` of :class:`CloudStackVPCOffering` """ - res = self._sync_request(command='listVPCOfferings', - method='GET') - vpcoffers = res.get('vpcoffering', []) + res = self._sync_request(command="listVPCOfferings", method="GET") + vpcoffers = res.get("vpcoffering", []) vpcofferings = [] for vpcoffer in vpcoffers: - vpcofferings.append(CloudStackVPCOffering( - vpcoffer['name'], - vpcoffer['displaytext'], - vpcoffer['id'], - self)) + vpcofferings.append( + CloudStackVPCOffering( + vpcoffer["name"], vpcoffer["displaytext"], vpcoffer["id"], self + ) + ) return vpcofferings - def ex_list_vpcs(self): + def ex_list_vpcs(self, project=None): """ List the available VPCs + :keyword project: Optional project under which VPCs are present. + :type project: :class:`.CloudStackProject` + :rtype ``list`` of :class:`CloudStackVPC` """ - res = self._sync_request(command='listVPCs', - method='GET') - vpcs = res.get('vpc', []) + args = {} + + if project is not None: + args["projectid"] = project.id + + res = self._sync_request(command="listVPCs", params=args, method="GET") + vpcs = res.get("vpc", []) networks = [] for vpc in vpcs: - - networks.append(CloudStackVPC( - vpc['name'], - vpc['vpcofferingid'], - vpc['id'], - vpc['cidr'], - self, - vpc['zoneid'], - vpc['displaytext'])) + networks.append( + CloudStackVPC( + vpc["name"], + vpc["vpcofferingid"], + vpc["id"], + vpc["cidr"], + self, + vpc["zoneid"], + vpc["displaytext"], + ) + ) return networks @@ -1828,28 +2135,27 @@ def ex_list_routers(self, vpc_id=None): args = {} if vpc_id is not None: - args['vpcid'] = vpc_id + args["vpcid"] = vpc_id - res = self._sync_request(command='listRouters', - params=args, - method='GET') - rts = res.get('router', []) + res = self._sync_request(command="listRouters", params=args, method="GET") + rts = res.get("router", []) routers = [] for router in rts: - - routers.append(CloudStackRouter( - router['id'], - router['name'], - router['state'], - router['publicip'], - router['vpcid'], - self)) + routers.append( + CloudStackRouter( + router["id"], + router["name"], + router["state"], + router["publicip"], + router["vpcid"], + self, + ) + ) return routers - def ex_create_vpc(self, cidr, display_text, name, vpc_offering, - zone_id, network_domain=None): + def ex_create_vpc(self, cidr, display_text, name, vpc_offering, zone_id, network_domain=None): """ Creates a VPC, only available in advanced zones. @@ -1878,33 +2184,33 @@ def ex_create_vpc(self, cidr, display_text, name, vpc_offering, """ - extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['vpc'] + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["vpc"] args = { - 'cidr': cidr, - 'displaytext': display_text, - 'name': name, - 'vpcofferingid': vpc_offering.id, - 'zoneid': zone_id, + "cidr": cidr, + "displaytext": display_text, + "name": name, + "vpcofferingid": vpc_offering.id, + "zoneid": zone_id, } if network_domain is not None: - args['networkdomain'] = network_domain + args["networkdomain"] = network_domain - result = self._sync_request(command='createVPC', - params=args, - method='GET') + result = self._sync_request(command="createVPC", params=args, method="GET") extra = self._get_extra_dict(result, extra_map) - vpc = CloudStackVPC(name, - vpc_offering.id, - result['id'], - cidr, - self, - zone_id, - display_text, - extra=extra) + vpc = CloudStackVPC( + name, + vpc_offering.id, + result["id"], + cidr, + self, + zone_id, + display_text, + extra=extra, + ) return vpc @@ -1920,11 +2226,9 @@ def ex_delete_vpc(self, vpc): """ - args = {'id': vpc.id} + args = {"id": vpc.id} - self._async_request(command='deleteVPC', - params=args, - method='GET') + self._async_request(command="deleteVPC", params=args, method="GET") return True def ex_list_projects(self): @@ -1934,68 +2238,81 @@ def ex_list_projects(self): :rtype ``list`` of :class:`CloudStackProject` """ - res = self._sync_request(command='listProjects', - method='GET') - projs = res.get('project', []) + res = self._sync_request(command="listProjects", method="GET") + projs = res.get("project", []) projects = [] - extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['project'] + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["project"] for proj in projs: extra = self._get_extra_dict(proj, extra_map) - if 'tags' in proj: - extra['tags'] = self._get_resource_tags(proj['tags']) + if "tags" in proj: + extra["tags"] = self._get_resource_tags(proj["tags"]) - projects.append(CloudStackProject( - id=proj['id'], - name=proj['name'], - display_text=proj['displaytext'], - driver=self, - extra=extra)) + projects.append( + CloudStackProject( + id=proj["id"], + name=proj["name"], + display_text=proj["displaytext"], + driver=self, + extra=extra, + ) + ) return projects - def create_volume(self, size, name, location=None, snapshot=None): + def create_volume(self, size, name, location=None, snapshot=None, ex_volume_type=None): """ Creates a data volume Defaults to the first location """ - for diskOffering in self.ex_list_disk_offerings(): - if diskOffering.size == size or diskOffering.customizable: - break + if ex_volume_type is None: + for diskOffering in self.ex_list_disk_offerings(): + if diskOffering.size == size or diskOffering.customizable: + break + else: + raise LibcloudError("Disk offering with size=%s not found" % size) else: - raise LibcloudError( - 'Disk offering with size=%s not found' % size) + for diskOffering in self.ex_list_disk_offerings(): + if diskOffering.name == ex_volume_type: + if not diskOffering.customizable: + size = diskOffering.size + break + else: + raise LibcloudError("Volume type with name=%s not found" % ex_volume_type) if location is None: location = self.list_locations()[0] - params = {'name': name, - 'diskOfferingId': diskOffering.id, - 'zoneId': location.id} + params = { + "name": name, + "diskOfferingId": diskOffering.id, + "zoneId": location.id, + } if diskOffering.customizable: - params['size'] = size + params["size"] = size + + requestResult = self._async_request(command="createVolume", params=params, method="GET") - requestResult = self._async_request(command='createVolume', - params=params, - method='GET') + volumeResponse = requestResult["volume"] - volumeResponse = requestResult['volume'] + state = self._to_volume_state(volumeResponse) - return StorageVolume(id=volumeResponse['id'], - name=name, - size=size, - driver=self, - extra=dict(name=volumeResponse['name'])) + return StorageVolume( + id=volumeResponse["id"], + name=name, + size=size, + state=state, + driver=self, + extra=dict(name=volumeResponse["name"]), + ) def destroy_volume(self, volume): """ :rtype: ``bool`` """ - self._sync_request(command='deleteVolume', - params={'id': volume.id}, - method='GET') + self._sync_request(command="deleteVolume", params={"id": volume.id}, method="GET") return True def attach_volume(self, node, volume, device=None): @@ -2006,19 +2323,18 @@ def attach_volume(self, node, volume, device=None): :rtype: ``bool`` """ # TODO Add handling for device name - self._async_request(command='attachVolume', - params={'id': volume.id, - 'virtualMachineId': node.id}, - method='GET') + self._async_request( + command="attachVolume", + params={"id": volume.id, "virtualMachineId": node.id}, + method="GET", + ) return True def detach_volume(self, volume): """ :rtype: ``bool`` """ - self._async_request(command='detachVolume', - params={'id': volume.id}, - method='GET') + self._async_request(command="detachVolume", params={"id": volume.id}, method="GET") return True def list_volumes(self, node=None): @@ -2031,28 +2347,76 @@ def list_volumes(self, node=None): :rtype: ``list`` of :class:`StorageVolume` """ if node: - volumes = self._sync_request(command='listVolumes', - params={'virtualmachineid': node.id}, - method='GET') + volumes = self._sync_request( + command="listVolumes", + params={"virtualmachineid": node.id}, + method="GET", + ) else: - volumes = self._sync_request(command='listVolumes', - method='GET') + volumes = self._sync_request(command="listVolumes", method="GET") list_volumes = [] - extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['volume'] - for vol in volumes['volume']: - extra = self._get_extra_dict(vol, extra_map) - if 'tags' in vol: - extra['tags'] = self._get_resource_tags(vol['tags']) + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["volume"] + for vol in volumes.get("volume", []): + extra = self._get_extra_dict(vol, extra_map) - list_volumes.append(StorageVolume(id=vol['id'], - name=vol['name'], - size=vol['size'], - driver=self, - extra=extra)) + if "tags" in vol: + extra["tags"] = self._get_resource_tags(vol["tags"]) + + state = self._to_volume_state(vol) + + list_volumes.append( + StorageVolume( + id=vol["id"], + name=vol["name"], + size=vol["size"], + state=state, + driver=self, + extra=extra, + ) + ) return list_volumes + def ex_get_volume(self, volume_id, project=None): + """ + Return a StorageVolume object based on its ID. + + :param volume_id: The id of the volume + :type volume_id: ``str`` + + :keyword project: Limit volume returned to those configured under + the defined project. + :type project: :class:`.CloudStackProject` + + :rtype: :class:`CloudStackNode` + """ + args = {"id": volume_id} + if project: + args["projectid"] = project.id + volumes = self._sync_request(command="listVolumes", params=args) + if not volumes: + raise Exception("Volume '%s' not found" % volume_id) + vol = volumes["volume"][0] + + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["volume"] + extra = self._get_extra_dict(vol, extra_map) + + if "tags" in vol: + extra["tags"] = self._get_resource_tags(vol["tags"]) + + state = self._to_volume_state(vol) + + volume = StorageVolume( + id=vol["id"], + name=vol["name"], + state=state, + size=vol["size"], + driver=self, + extra=extra, + ) + return volume + def list_key_pairs(self, **kwargs): """ List registered key pairs. @@ -2101,19 +2465,23 @@ def list_key_pairs(self, **kwargs): :rtype: ``list`` of :class:`libcloud.compute.base.KeyPair` """ extra_args = kwargs.copy() - res = self._sync_request(command='listSSHKeyPairs', - params=extra_args, - method='GET') - key_pairs = res.get('sshkeypair', []) + res = self._sync_request(command="listSSHKeyPairs", params=extra_args, method="GET") + key_pairs = res.get("sshkeypair", []) key_pairs = self._to_key_pairs(data=key_pairs) return key_pairs def get_key_pair(self, name): - params = {'name': name} - res = self._sync_request(command='listSSHKeyPairs', - params=params, - method='GET') - key_pairs = res.get('sshkeypair', []) + """ + Retrieve a single key pair. + + :param name: Name of the key pair to retrieve. + :type name: ``str`` + + :rtype: :class:`.KeyPair` + """ + params = {"name": name} + res = self._sync_request(command="listSSHKeyPairs", params=params, method="GET") + key_pairs = res.get("sshkeypair", []) if len(key_pairs) == 0: raise KeyPairDoesNotExistError(name=name, driver=self) @@ -2148,13 +2516,11 @@ def create_key_pair(self, name, **kwargs): """ extra_args = kwargs.copy() - params = {'name': name} + params = {"name": name} params.update(extra_args) - res = self._sync_request(command='createSSHKeyPair', - params=params, - method='GET') - key_pair = self._to_key_pair(data=res['keypair']) + res = self._sync_request(command="createSSHKeyPair", params=params, method="GET") + key_pair = self._to_key_pair(data=res["keypair"]) return key_pair def import_key_pair_from_string(self, name, key_material): @@ -2170,11 +2536,12 @@ def import_key_pair_from_string(self, name, key_material): :return: Imported key pair object. :rtype: :class:`libcloud.compute.base.KeyPair` """ - res = self._sync_request(command='registerSSHKeyPair', - params={'name': name, - 'publickey': key_material}, - method='GET') - key_pair = self._to_key_pair(data=res['keypair']) + res = self._sync_request( + command="registerSSHKeyPair", + params={"name": name, "publickey": key_material}, + method="GET", + ) + key_pair = self._to_key_pair(data=res["keypair"]) return key_pair def delete_key_pair(self, key_pair, **kwargs): @@ -2199,13 +2566,11 @@ def delete_key_pair(self, key_pair, **kwargs): """ extra_args = kwargs.copy() - params = {'name': key_pair.name} + params = {"name": key_pair.name} params.update(extra_args) - res = self._sync_request(command='deleteSSHKeyPair', - params=params, - method='GET') - return res['success'] == 'true' + res = self._sync_request(command="deleteSSHKeyPair", params=params, method="GET") + return res["success"] == "true" def ex_list_public_ips(self): """ @@ -2215,23 +2580,27 @@ def ex_list_public_ips(self): """ ips = [] - res = self._sync_request(command='listPublicIpAddresses', - method='GET') + res = self._sync_request(command="listPublicIpAddresses", method="GET") # Workaround for basic zones if not res: return ips - for ip in res['publicipaddress']: - ips.append(CloudStackAddress(ip['id'], - ip['ipaddress'], - self, - ip.get('associatednetworkid', []))) + for ip in res["publicipaddress"]: + ips.append( + CloudStackAddress( + ip["id"], + ip["ipaddress"], + self, + ip.get("associatednetworkid", []), + ip.get("vpcid"), + ip.get("virtualmachineid"), + ) + ) return ips - def ex_allocate_public_ip(self, vpc_id=None, network_id=None, - location=None): + def ex_allocate_public_ip(self, vpc_id=None, network_id=None, location=None): """ Allocate a public IP. @@ -2250,21 +2619,19 @@ def ex_allocate_public_ip(self, vpc_id=None, network_id=None, args = {} if location is not None: - args['zoneid'] = location.id + args["zoneid"] = location.id else: - args['zoneid'] = self.list_locations()[0].id + args["zoneid"] = self.list_locations()[0].id if vpc_id is not None: - args['vpcid'] = vpc_id + args["vpcid"] = vpc_id if network_id is not None: - args['networkid'] = network_id + args["networkid"] = network_id - addr = self._async_request(command='associateIpAddress', - params=args, - method='GET') - addr = addr['ipaddress'] - addr = CloudStackAddress(addr['id'], addr['ipaddress'], self) + addr = self._async_request(command="associateIpAddress", params=args, method="GET") + addr = addr["ipaddress"] + addr = CloudStackAddress(addr["id"], addr["ipaddress"], self) return addr def ex_release_public_ip(self, address): @@ -2276,10 +2643,10 @@ def ex_release_public_ip(self, address): :rtype: ``bool`` """ - res = self._async_request(command='disassociateIpAddress', - params={'id': address.id}, - method='GET') - return res['success'] + res = self._async_request( + command="disassociateIpAddress", params={"id": address.id}, method="GET" + ) + return res["success"] def ex_list_firewall_rules(self): """ @@ -2288,30 +2655,39 @@ def ex_list_firewall_rules(self): :rtype: ``list`` of :class:`CloudStackFirewallRule` """ rules = [] - result = self._sync_request(command='listFirewallRules', - method='GET') + result = self._sync_request(command="listFirewallRules", method="GET") if result != {}: public_ips = self.ex_list_public_ips() - for rule in result['firewallrule']: - addr = [a for a in public_ips if - a.address == rule['ipaddress']] - - rules.append(CloudStackFirewallRule(rule['id'], - addr[0], - rule['cidrlist'], - rule['protocol'], - rule.get('icmpcode'), - rule.get('icmptype'), - rule.get('startport'), - rule.get('endport'))) + for rule in result["firewallrule"]: + addr = [a for a in public_ips if a.address == rule["ipaddress"]] + + rules.append( + CloudStackFirewallRule( + rule["id"], + addr[0], + rule["cidrlist"], + rule["protocol"], + rule.get("icmpcode"), + rule.get("icmptype"), + rule.get("startport"), + rule.get("endport"), + ) + ) return rules - def ex_create_firewall_rule(self, address, cidr_list, protocol, - icmp_code=None, icmp_type=None, - start_port=None, end_port=None): + def ex_create_firewall_rule( + self, + address, + cidr_list, + protocol, + icmp_code=None, + icmp_type=None, + start_port=None, + end_port=None, + ): """ - Creates a Firewalle Rule + Creates a Firewall Rule :param address: External IP address :type address: :class:`CloudStackAddress` @@ -2336,74 +2712,80 @@ def ex_create_firewall_rule(self, address, cidr_list, protocol, :rtype: :class:`CloudStackFirewallRule` """ - args = { - 'ipaddressid': address.id, - 'cidrlist': cidr_list, - 'protocol': protocol - } + args = {"ipaddressid": address.id, "cidrlist": cidr_list, "protocol": protocol} if icmp_code is not None: - args['icmpcode'] = int(icmp_code) + args["icmpcode"] = int(icmp_code) if icmp_type is not None: - args['icmptype'] = int(icmp_type) + args["icmptype"] = int(icmp_type) if start_port is not None: - args['startport'] = int(start_port) + args["startport"] = int(start_port) if end_port is not None: - args['endport'] = int(end_port) - result = self._async_request(command='createFirewallRule', - params=args, - method='GET') - rule = CloudStackFirewallRule(result['firewallrule']['id'], - address, - cidr_list, - protocol, - icmp_code, - icmp_type, - start_port, - end_port) + args["endport"] = int(end_port) + result = self._async_request(command="createFirewallRule", params=args, method="GET") + rule = CloudStackFirewallRule( + result["firewallrule"]["id"], + address, + cidr_list, + protocol, + icmp_code, + icmp_type, + start_port, + end_port, + ) return rule def ex_delete_firewall_rule(self, firewall_rule): """ - Remove a Firewall rule. + Remove a Firewall Rule. :param firewall_rule: Firewall rule which should be used :type firewall_rule: :class:`CloudStackFirewallRule` :rtype: ``bool`` """ - res = self._async_request(command='deleteFirewallRule', - params={'id': firewall_rule.id}, - method='GET') - return res['success'] + res = self._async_request( + command="deleteFirewallRule", params={"id": firewall_rule.id}, method="GET" + ) + return res["success"] def ex_list_egress_firewall_rules(self): """ - Lists all agress Firewall Rules + Lists all egress Firewall Rules :rtype: ``list`` of :class:`CloudStackEgressFirewallRule` """ rules = [] - result = self._sync_request(command='listEgressFirewallRules', - method='GET') - for rule in result['firewallrule']: - rules.append(CloudStackEgressFirewallRule(rule['id'], - rule['networkid'], - rule['cidrlist'], - rule['protocol'], - rule.get('icmpcode'), - rule.get('icmptype'), - rule.get('startport'), - rule.get('endport'))) + result = self._sync_request(command="listEgressFirewallRules", method="GET") + for rule in result["firewallrule"]: + rules.append( + CloudStackEgressFirewallRule( + rule["id"], + rule["networkid"], + rule["cidrlist"], + rule["protocol"], + rule.get("icmpcode"), + rule.get("icmptype"), + rule.get("startport"), + rule.get("endport"), + ) + ) return rules - def ex_create_egress_firewall_rule(self, network_id, cidr_list, protocol, - icmp_code=None, icmp_type=None, - start_port=None, end_port=None): + def ex_create_egress_firewall_rule( + self, + network_id, + cidr_list, + protocol, + icmp_code=None, + icmp_type=None, + start_port=None, + end_port=None, + ): """ - Creates a Firewalle Rule + Creates a Firewall Rule - :param network_id: the id network network for the egress firwall + :param network_id: the id network network for the egress firewall services :type network_id: ``str`` @@ -2427,32 +2809,28 @@ def ex_create_egress_firewall_rule(self, network_id, cidr_list, protocol, :rtype: :class:`CloudStackEgressFirewallRule` """ - args = { - 'networkid': network_id, - 'cidrlist': cidr_list, - 'protocol': protocol - } + args = {"networkid": network_id, "cidrlist": cidr_list, "protocol": protocol} if icmp_code is not None: - args['icmpcode'] = int(icmp_code) + args["icmpcode"] = int(icmp_code) if icmp_type is not None: - args['icmptype'] = int(icmp_type) + args["icmptype"] = int(icmp_type) if start_port is not None: - args['startport'] = int(start_port) + args["startport"] = int(start_port) if end_port is not None: - args['endport'] = int(end_port) - - result = self._async_request(command='createEgressFirewallRule', - params=args, - method='GET') - - rule = CloudStackEgressFirewallRule(result['firewallrule']['id'], - network_id, - cidr_list, - protocol, - icmp_code, - icmp_type, - start_port, - end_port) + args["endport"] = int(end_port) + + result = self._async_request(command="createEgressFirewallRule", params=args, method="GET") + + rule = CloudStackEgressFirewallRule( + result["firewallrule"]["id"], + network_id, + cidr_list, + protocol, + icmp_code, + icmp_type, + start_port, + end_port, + ) return rule def ex_delete_egress_firewall_rule(self, firewall_rule): @@ -2464,47 +2842,150 @@ def ex_delete_egress_firewall_rule(self, firewall_rule): :rtype: ``bool`` """ - res = self._async_request(command='deleteEgressFirewallRule', - params={'id': firewall_rule.id}, - method='GET') - return res['success'] - - def ex_list_port_forwarding_rules(self): + res = self._async_request( + command="deleteEgressFirewallRule", + params={"id": firewall_rule.id}, + method="GET", + ) + return res["success"] + + def ex_list_port_forwarding_rules( + self, + account=None, + domain_id=None, + id=None, + ipaddress_id=None, + is_recursive=None, + keyword=None, + list_all=None, + network_id=None, + page=None, + page_size=None, + project_id=None, + ): """ Lists all Port Forwarding Rules + :param account: List resources by account. + Must be used with the domainId parameter + :type account: ``str`` + + :param domain_id: List only resources belonging to + the domain specified + :type domain_id: ``str`` + + :param for_display: List resources by display flag (only root + admin is eligible to pass this parameter). + :type for_display: ``bool`` + + :param id: Lists rule with the specified ID + :type id: ``str`` + + :param ipaddress_id: list the rule belonging to + this public ip address + :type ipaddress_id: ``str`` + + :param is_recursive: Defaults to false, but if true, + lists all resources from + the parent specified by the + domainId till leaves. + :type is_recursive: ``bool`` + + :param keyword: List by keyword + :type keyword: ``str`` + + :param list_all: If set to false, list only resources + belonging to the command's caller; + if set to true - list resources that + the caller is authorized to see. + Default value is false + :type list_all: ``bool`` + + :param network_id: list port forwarding rules for certain network + :type network_id: ``string`` + + :param page: The page to list the keypairs from + :type page: ``int`` + + :param page_size: The number of results per page + :type page_size: ``int`` + + :param project_id: list objects by project + :type project_id: ``str`` + :rtype: ``list`` of :class:`CloudStackPortForwardingRule` """ + + args = {} + + if account is not None: + args["account"] = account + + if domain_id is not None: + args["domainid"] = domain_id + + if id is not None: + args["id"] = id + + if ipaddress_id is not None: + args["ipaddressid"] = ipaddress_id + + if is_recursive is not None: + args["isrecursive"] = is_recursive + + if keyword is not None: + args["keyword"] = keyword + + if list_all is not None: + args["listall"] = list_all + + if network_id is not None: + args["networkid"] = network_id + + if page is not None: + args["page"] = page + + if page_size is not None: + args["pagesize"] = page_size + + if project_id is not None: + args["projectid"] = project_id + rules = [] - result = self._sync_request(command='listPortForwardingRules', - method='GET') + result = self._sync_request(command="listPortForwardingRules", params=args, method="GET") if result != {}: public_ips = self.ex_list_public_ips() nodes = self.list_nodes() - for rule in result['portforwardingrule']: - node = [n for n in nodes - if n.id == str(rule['virtualmachineid'])] - addr = [a for a in public_ips if - a.address == rule['ipaddress']] - rules.append(CloudStackPortForwardingRule - (node[0], - rule['id'], - addr[0], - rule['protocol'], - rule['publicport'], - rule['privateport'], - rule['publicendport'], - rule['privateendport'])) + for rule in result["portforwardingrule"]: + node = [n for n in nodes if n.id == str(rule["virtualmachineid"])] + addr = [a for a in public_ips if a.address == rule["ipaddress"]] + rules.append( + CloudStackPortForwardingRule( + node[0], + rule["id"], + addr[0], + rule["protocol"], + rule["publicport"], + rule["privateport"], + rule["publicendport"], + rule["privateendport"], + ) + ) return rules - def ex_create_port_forwarding_rule(self, node, address, - private_port, public_port, - protocol, - public_end_port=None, - private_end_port=None, - openfirewall=True, - network_id=None): + def ex_create_port_forwarding_rule( + self, + node, + address, + private_port, + public_port, + protocol, + public_end_port=None, + private_end_port=None, + openfirewall=True, + network_id=None, + ): """ Creates a Port Forwarding Rule, used for Source NAT @@ -2532,34 +3013,33 @@ def ex_create_port_forwarding_rule(self, node, address, :rtype: :class:`CloudStackPortForwardingRule` """ args = { - 'ipaddressid': address.id, - 'protocol': protocol, - 'privateport': int(private_port), - 'publicport': int(public_port), - 'virtualmachineid': node.id, - 'openfirewall': openfirewall + "ipaddressid": address.id, + "protocol": protocol, + "privateport": int(private_port), + "publicport": int(public_port), + "virtualmachineid": node.id, + "openfirewall": openfirewall, } if public_end_port: - args['publicendport'] = int(public_end_port) + args["publicendport"] = int(public_end_port) if private_end_port: - args['privateendport'] = int(private_end_port) + args["privateendport"] = int(private_end_port) if network_id: - args['networkid'] = network_id - - result = self._async_request(command='createPortForwardingRule', - params=args, - method='GET') - rule = CloudStackPortForwardingRule(node, - result['portforwardingrule'] - ['id'], - address, - protocol, - public_port, - private_port, - public_end_port, - private_end_port, - network_id) - node.extra['port_forwarding_rules'].append(rule) + args["networkid"] = network_id + + result = self._async_request(command="createPortForwardingRule", params=args, method="GET") + rule = CloudStackPortForwardingRule( + node, + result["portforwardingrule"]["id"], + address, + protocol, + public_port, + private_port, + public_end_port, + private_end_port, + network_id, + ) + node.extra["port_forwarding_rules"].append(rule) node.public_ips.append(address.address) return rule @@ -2576,18 +3056,27 @@ def ex_delete_port_forwarding_rule(self, node, rule): :rtype: ``bool`` """ - node.extra['port_forwarding_rules'].remove(rule) + node.extra["port_forwarding_rules"].remove(rule) node.public_ips.remove(rule.address.address) - res = self._async_request(command='deletePortForwardingRule', - params={'id': rule.id}, - method='GET') - return res['success'] - - def ex_list_ip_forwarding_rules(self, account=None, domain_id=None, - id=None, ipaddress_id=None, - is_recursive=None, keyword=None, - list_all=None, page=None, page_size=None, - project_id=None, virtualmachine_id=None): + res = self._async_request( + command="deletePortForwardingRule", params={"id": rule.id}, method="GET" + ) + return res["success"] + + def ex_list_ip_forwarding_rules( + self, + account=None, + domain_id=None, + id=None, + ipaddress_id=None, + is_recursive=None, + keyword=None, + list_all=None, + page=None, + page_size=None, + project_id=None, + virtualmachine_id=None, + ): """ Lists all NAT/firewall forwarding rules @@ -2641,62 +3130,60 @@ def ex_list_ip_forwarding_rules(self, account=None, domain_id=None, args = {} if account is not None: - args['account'] = account + args["account"] = account if domain_id is not None: - args['domainid'] = domain_id + args["domainid"] = domain_id if id is not None: - args['id'] = id + args["id"] = id if ipaddress_id is not None: - args['ipaddressid'] = ipaddress_id + args["ipaddressid"] = ipaddress_id if is_recursive is not None: - args['isrecursive'] = is_recursive + args["isrecursive"] = is_recursive if keyword is not None: - args['keyword'] = keyword + args["keyword"] = keyword if list_all is not None: - args['listall'] = list_all + args["listall"] = list_all if page is not None: - args['page'] = page + args["page"] = page if page_size is not None: - args['pagesize'] = page_size + args["pagesize"] = page_size if project_id is not None: - args['projectid'] = project_id + args["projectid"] = project_id if virtualmachine_id is not None: - args['virtualmachineid'] = virtualmachine_id + args["virtualmachineid"] = virtualmachine_id - result = self._sync_request(command='listIpForwardingRules', - params=args, - method='GET') + result = self._sync_request(command="listIpForwardingRules", params=args, method="GET") rules = [] if result != {}: public_ips = self.ex_list_public_ips() nodes = self.list_nodes() - for rule in result['ipforwardingrule']: - node = [n for n in nodes - if n.id == str(rule['virtualmachineid'])] - addr = [a for a in public_ips if - a.address == rule['ipaddress']] - rules.append(CloudStackIPForwardingRule - (node[0], - rule['id'], - addr[0], - rule['protocol'], - rule['startport'], - rule['endport'])) + for rule in result["ipforwardingrule"]: + node = [n for n in nodes if n.id == str(rule["virtualmachineid"])] + addr = [a for a in public_ips if a.address == rule["ipaddress"]] + rules.append( + CloudStackIPForwardingRule( + node[0], + rule["id"], + addr[0], + rule["protocol"], + rule["startport"], + rule["endport"], + ) + ) return rules - def ex_create_ip_forwarding_rule(self, node, address, protocol, - start_port, end_port=None): + def ex_create_ip_forwarding_rule(self, node, address, protocol, start_port, end_port=None): """ "Add a NAT/firewall forwarding rule. @@ -2719,24 +3206,23 @@ def ex_create_ip_forwarding_rule(self, node, address, protocol, """ protocol = protocol.upper() - if protocol not in ('TCP', 'UDP'): + if protocol not in ("TCP", "UDP"): return None args = { - 'ipaddressid': address.id, - 'protocol': protocol, - 'startport': int(start_port) + "ipaddressid": address.id, + "protocol": protocol, + "startport": int(start_port), } if end_port is not None: - args['endport'] = int(end_port) - - result = self._async_request(command='createIpForwardingRule', - params=args, - method='GET') - result = result['ipforwardingrule'] - rule = CloudStackIPForwardingRule(node, result['id'], address, - protocol, start_port, end_port) - node.extra['ip_forwarding_rules'].append(rule) + args["endport"] = int(end_port) + + result = self._async_request(command="createIpForwardingRule", params=args, method="GET") + result = result["ipforwardingrule"] + rule = CloudStackIPForwardingRule( + node, result["id"], address, protocol, start_port, end_port + ) + node.extra["ip_forwarding_rules"].append(rule) return rule def ex_delete_ip_forwarding_rule(self, node, rule): @@ -2752,10 +3238,8 @@ def ex_delete_ip_forwarding_rule(self, node, rule): :rtype: ``bool`` """ - node.extra['ip_forwarding_rules'].remove(rule) - self._async_request(command='deleteIpForwardingRule', - params={'id': rule.id}, - method='GET') + node.extra["ip_forwarding_rules"].remove(rule) + self._async_request(command="deleteIpForwardingRule", params={"id": rule.id}, method="GET") return True def ex_create_network_acllist(self, name, vpc_id, description=None): @@ -2774,27 +3258,25 @@ def ex_create_network_acllist(self, name, vpc_id, description=None): :rtype: :class:`CloudStackNetworkACLList` """ - args = { - 'name': name, - 'vpcid': vpc_id - } + args = {"name": name, "vpcid": vpc_id} if description: - args['description'] = description + args["description"] = description - result = self._sync_request(command='createNetworkACLList', - params=args, - method='GET') + result = self._sync_request(command="createNetworkACLList", params=args, method="GET") - acl_list = CloudStackNetworkACLList(result['id'], - name, - vpc_id, - self, - description) + acl_list = CloudStackNetworkACLList(result["id"], name, vpc_id, self, description) return acl_list - def ex_create_network_acl(self, protocol, acl_id, cidr_list, - start_port, end_port, action=None, - traffic_type=None): + def ex_create_network_acl( + self, + protocol, + acl_id, + cidr_list, + start_port, + end_port, + action=None, + traffic_type=None, + ): """ Creates an ACL rule in the given network (the network has to belong to VPC) @@ -2826,33 +3308,33 @@ def ex_create_network_acl(self, protocol, acl_id, cidr_list, """ args = { - 'protocol': protocol, - 'aclid': acl_id, - 'cidrlist': cidr_list, - 'startport': start_port, - 'endport': end_port + "protocol": protocol, + "aclid": acl_id, + "cidrlist": cidr_list, + "startport": start_port, + "endport": end_port, } if action: - args['action'] = action + args["action"] = action else: action = "allow" if traffic_type: - args['traffictype'] = traffic_type + args["traffictype"] = traffic_type - result = self._async_request(command='createNetworkACL', - params=args, - method='GET') + result = self._async_request(command="createNetworkACL", params=args, method="GET") - acl = CloudStackNetworkACL(result['networkacl']['id'], - protocol, - acl_id, - action, - cidr_list, - start_port, - end_port, - traffic_type) + acl = CloudStackNetworkACL( + result["networkacl"]["id"], + protocol, + acl_id, + action, + cidr_list, + start_port, + end_port, + traffic_type, + ) return acl @@ -2864,18 +3346,21 @@ def ex_list_network_acllists(self): """ acllists = [] - result = self._sync_request(command='listNetworkACLLists', - method='GET') + result = self._sync_request(command="listNetworkACLLists", method="GET") if not result: return acllists - for acllist in result['networkacllist']: - acllists.append(CloudStackNetworkACLList(acllist['id'], - acllist['name'], - acllist.get('vpcid', []), - self, - acllist['description'])) + for acllist in result["networkacllist"]: + acllists.append( + CloudStackNetworkACLList( + acllist["id"], + acllist["name"], + acllist.get("vpcid", []), + self, + acllist["description"], + ) + ) return acllists @@ -2893,14 +3378,9 @@ def ex_replace_network_acllist(self, acl_id, network_id): :rtype: :class:`CloudStackNetworkACLList` """ - args = { - 'aclid': acl_id, - 'networkid': network_id - } + args = {"aclid": acl_id, "networkid": network_id} - self._async_request(command='replaceNetworkACLList', - params=args, - method='GET') + self._async_request(command="replaceNetworkACLList", params=args, method="GET") return True @@ -2912,21 +3392,24 @@ def ex_list_network_acl(self): """ acls = [] - result = self._sync_request(command='listNetworkACLs', - method='GET') + result = self._sync_request(command="listNetworkACLs", method="GET") if not result: return acls - for acl in result['networkacl']: - acls.append(CloudStackNetworkACL(acl['id'], - acl['protocol'], - acl['aclid'], - acl['action'], - acl['cidrlist'], - acl.get('startport', []), - acl.get('endport', []), - acl['traffictype'])) + for acl in result["networkacl"]: + acls.append( + CloudStackNetworkACL( + acl["id"], + acl["protocol"], + acl["aclid"], + acl["action"], + acl["cidrlist"], + acl.get("startport", []), + acl.get("endport", []), + acl["traffictype"], + ) + ) return acls @@ -2977,8 +3460,7 @@ def ex_list_keypairs(self, **kwargs): :return: A list of keypair dictionaries :rtype: ``list`` of ``dict`` """ - warnings.warn('This method has been deprecated in favor of ' - 'list_key_pairs method') + warnings.warn("This method has been deprecated in favor of " "list_key_pairs method") key_pairs = self.list_key_pairs(**kwargs) @@ -2986,9 +3468,9 @@ def ex_list_keypairs(self, **kwargs): for key_pair in key_pairs: item = { - 'name': key_pair.name, - 'fingerprint': key_pair.fingerprint, - 'privateKey': key_pair.private_key + "name": key_pair.name, + "fingerprint": key_pair.fingerprint, + "privateKey": key_pair.private_key, } result.append(item) @@ -3016,15 +3498,14 @@ def ex_create_keypair(self, name, **kwargs): :return: A keypair dictionary :rtype: ``dict`` """ - warnings.warn('This method has been deprecated in favor of ' - 'create_key_pair method') + warnings.warn("This method has been deprecated in favor of " "create_key_pair method") key_pair = self.create_key_pair(name=name, **kwargs) result = { - 'name': key_pair.name, - 'fingerprint': key_pair.fingerprint, - 'privateKey': key_pair.private_key + "name": key_pair.name, + "fingerprint": key_pair.fingerprint, + "privateKey": key_pair.private_key, } return result @@ -3041,15 +3522,12 @@ def ex_import_keypair_from_string(self, name, key_material): :rtype: ``dict`` """ - warnings.warn('This method has been deprecated in favor of ' - 'import_key_pair_from_string method') + warnings.warn( + "This method has been deprecated in favor of " "import_key_pair_from_string method" + ) - key_pair = self.import_key_pair_from_string(name=name, - key_material=key_material) - result = { - 'keyName': key_pair.name, - 'keyFingerprint': key_pair.fingerprint - } + key_pair = self.import_key_pair_from_string(name=name, key_material=key_material) + result = {"keyName": key_pair.name, "keyFingerprint": key_pair.fingerprint} return result @@ -3065,15 +3543,12 @@ def ex_import_keypair(self, name, keyfile): :rtype: ``dict`` """ - warnings.warn('This method has been deprecated in favor of ' - 'import_key_pair_from_file method') + warnings.warn( + "This method has been deprecated in favor of " "import_key_pair_from_file method" + ) - key_pair = self.import_key_pair_from_file(name=name, - key_file_path=keyfile) - result = { - 'keyName': key_pair.name, - 'keyFingerprint': key_pair.fingerprint - } + key_pair = self.import_key_pair_from_file(name=name, key_file_path=keyfile) + result = {"keyName": key_pair.name, "keyFingerprint": key_pair.fingerprint} return result @@ -3097,11 +3572,9 @@ def ex_delete_keypair(self, keypair, **kwargs): :return: True of False based on success of Keypair deletion :rtype: ``bool`` """ - warnings.warn('This method has been deprecated in favor of ' - 'delete_key_pair method') + warnings.warn("This method has been deprecated in favor of " "delete_key_pair method") - key_pair = KeyPair(name=keypair, public_key=None, fingerprint=None, - driver=self) + key_pair = KeyPair(name=keypair, public_key=None, fingerprint=None, driver=self) return self.delete_key_pair(key_pair=key_pair) @@ -3155,11 +3628,9 @@ def ex_list_security_groups(self, **kwargs): :rtype ``list`` """ extra_args = kwargs.copy() - res = self._sync_request(command='listSecurityGroups', - params=extra_args, - method='GET') + res = self._sync_request(command="listSecurityGroups", params=extra_args, method="GET") - security_groups = res.get('securitygroup', []) + security_groups = res.get("securitygroup", []) return security_groups def ex_create_security_group(self, name, **kwargs): @@ -3190,15 +3661,15 @@ def ex_create_security_group(self, name, **kwargs): extra_args = kwargs.copy() for sg in self.ex_list_security_groups(): - if name in sg['name']: - raise LibcloudError('This Security Group name already exists') + if name in sg["name"]: + raise LibcloudError("This Security Group name already exists") - params = {'name': name} + params = {"name": name} params.update(extra_args) - return self._sync_request(command='createSecurityGroup', - params=params, - method='GET')['securitygroup'] + return self._sync_request(command="createSecurityGroup", params=params, method="GET")[ + "securitygroup" + ] def ex_delete_security_group(self, name): """ @@ -3226,78 +3697,118 @@ def ex_delete_security_group(self, name): :rtype: ``bool`` """ - return self._sync_request(command='deleteSecurityGroup', - params={'name': name}, - method='GET')['success'] + return self._sync_request( + command="deleteSecurityGroup", params={"name": name}, method="GET" + )["success"] - def ex_authorize_security_group_ingress(self, securitygroupname, - protocol, cidrlist, startport, - endport=None): + def ex_authorize_security_group_ingress( + self, + securitygroupname, + protocol, + cidrlist, + startport=None, + endport=None, + icmptype=None, + icmpcode=None, + **kwargs, + ): """ Creates a new Security Group Ingress rule - :param domainid: An optional domainId for the security group. - If the account parameter is used, - domainId must also be used. - :type domainid: ``str`` + :param securitygroupname: The name of the security group. + Mutually exclusive with securitygroupid. + :type securitygroupname: ``str`` - :param startport: Start port for this ingress rule - :type startport: ``int`` + :param protocol: Can be TCP, UDP or ICMP. + Sometime other protocols can be used like AH, ESP + or GRE. + :type protocol: ``str`` - :param securitygroupid: The ID of the security group. - Mutually exclusive with securityGroupName - parameter - :type securitygroupid: ``str`` + :param cidrlist: Source address CIDR for which this rule applies. + :type cidrlist: ``str`` - :param cidrlist: The cidr list associated - :type cidrlist: ``list`` + :param startport: Start port of the range for this ingress rule. + Applies to protocols TCP and UDP. + :type startport: ``int`` - :param usersecuritygrouplist: user to security group mapping - :type usersecuritygrouplist: ``dict`` + :param endport: End port of the range for this ingress rule. + It can be None to set only one port. + Applies to protocols TCP and UDP. + :type endport: ``int`` - :param securitygroupname: The name of the security group. - Mutually exclusive with - securityGroupName parameter - :type securitygroupname: ``str`` + :param icmptype: Type of the ICMP packet (eg: 8 for Echo Request). + -1 or None means "all types". + Applies to protocol ICMP. + :type icmptype: ``int`` - :param account: An optional account for the security group. - Must be used with domainId. - :type account: ``str`` + :param icmpcode: Code of the ICMP packet for the specified type. + If the specified type doesn't require a code set + this value to 0. + -1 or None means "all codes". + Applies to protocol ICMP. + :type icmpcode: ``int`` - :param icmpcode: Error code for this icmp message - :type icmpcode: ``int`` + :keyword account: An optional account for the security group. + Must be used with domainId. + :type account: ``str`` - :param protocol: TCP is default. UDP is the other supported protocol - :type protocol: ``str`` + :keyword domainid: An optional domainId for the security group. + If the account parameter is used, domainId must also + be used. - :param icmptype: type of the icmp message being sent - :type icmptype: ``int`` + :keyword projectid: An optional project of the security group + :type projectid: ``str`` - :param projectid: An optional project of the security group - :type projectid: ``str`` + :keyword securitygroupid: The ID of the security group. + Mutually exclusive with securitygroupname + :type securitygroupid: ``str`` - :param endport: end port for this ingress rule - :type endport: ``int`` + :keyword usersecuritygrouplist: User to security group mapping + :type usersecuritygrouplist: ``dict`` - :rtype: ``list`` + :rtype: ``dict`` """ + args = kwargs.copy() protocol = protocol.upper() - if protocol not in ('TCP', 'ICMP'): - raise LibcloudError('Only TCP and ICMP are allowed') - args = { - 'securitygroupname': securitygroupname, - 'protocol': protocol, - 'startport': int(startport), - 'cidrlist': cidrlist - } - if endport is None: - args['endport'] = int(startport) + args.update( + { + "securitygroupname": securitygroupname, + "protocol": protocol, + "cidrlist": cidrlist, + } + ) + + if protocol not in ("TCP", "UDP") and (startport is not None or endport is not None): + raise LibcloudError( + '"startport" and "endport" are only valid ' "with protocol TCP or UDP." + ) + + if protocol != "ICMP" and (icmptype is not None or icmpcode is not None): + raise LibcloudError('"icmptype" and "icmpcode" are only valid ' "with protocol ICMP.") + + if protocol in ("TCP", "UDP"): + if startport is None: + raise LibcloudError( + "Protocols TCP and UDP require at least " '"startport" to be set.' + ) + if startport is not None and endport is None: + endport = startport + + args.update({"startport": startport, "endport": endport}) - return self._async_request(command='authorizeSecurityGroupIngress', - params=args, - method='GET')['securitygroup'] + if protocol == "ICMP": + if icmptype is None: + icmptype = -1 + if icmpcode is None: + icmpcode = -1 + + args.update({"icmptype": icmptype, "icmpcode": icmpcode}) + + return self._async_request( + command="authorizeSecurityGroupIngress", params=args, method="GET" + )["securitygroup"] def ex_revoke_security_group_ingress(self, rule_id): """ @@ -3309,9 +3820,9 @@ def ex_revoke_security_group_ingress(self, rule_id): :rtype: ``bool`` """ - self._async_request(command='revokeSecurityGroupIngress', - params={'id': rule_id}, - method='GET') + self._async_request( + command="revokeSecurityGroupIngress", params={"id": rule_id}, method="GET" + ) return True def ex_create_affinity_group(self, name, group_type): @@ -3336,15 +3847,13 @@ def ex_create_affinity_group(self, name, group_type): for ag in self.ex_list_affinity_groups(): if name == ag.name: - raise LibcloudError('This Affinity Group name already exists') + raise LibcloudError("This Affinity Group name already exists") - params = {'name': name, 'type': group_type.type} + params = {"name": name, "type": group_type.type} - result = self._async_request(command='createAffinityGroup', - params=params, - method='GET') + result = self._async_request(command="createAffinityGroup", params=params, method="GET") - return self._to_affinity_group(result['affinitygroup']) + return self._to_affinity_group(result["affinitygroup"]) def ex_delete_affinity_group(self, affinity_group): """ @@ -3355,9 +3864,11 @@ def ex_delete_affinity_group(self, affinity_group): :rtype ``bool`` """ - return self._async_request(command='deleteAffinityGroup', - params={'id': affinity_group.id}, - method='GET')['success'] + return self._async_request( + command="deleteAffinityGroup", + params={"id": affinity_group.id}, + method="GET", + )["success"] def ex_update_node_affinity_group(self, node, affinity_group_list): """ @@ -3374,14 +3885,14 @@ def ex_update_node_affinity_group(self, node, affinity_group_list): :rtype :class:`CloudStackNode` """ - affinity_groups = ','.join(ag.id for ag in affinity_group_list) + affinity_groups = ",".join(ag.id for ag in affinity_group_list) - result = self._async_request(command='updateVMAffinityGroup', - params={ - 'id': node.id, - 'affinitygroupids': affinity_groups}, - method='GET') - return self._to_node(data=result['virtualmachine']) + result = self._async_request( + command="updateVMAffinityGroup", + params={"id": node.id, "affinitygroupids": affinity_groups}, + method="GET", + ) + return self._to_node(data=result["virtualmachine"]) def ex_list_affinity_groups(self): """ @@ -3389,13 +3900,13 @@ def ex_list_affinity_groups(self): :rtype ``list`` of :class:`CloudStackAffinityGroup` """ - result = self._sync_request(command='listAffinityGroups', method='GET') + result = self._sync_request(command="listAffinityGroups", method="GET") - if not result.get('count'): + if not result.get("count"): return [] affinity_groups = [] - for ag in result['affinitygroup']: + for ag in result["affinitygroup"]: affinity_groups.append(self._to_affinity_group(ag)) return affinity_groups @@ -3406,16 +3917,14 @@ def ex_list_affinity_group_types(self): :rtype ``list`` of :class:`CloudStackAffinityGroupTypes` """ - result = self._sync_request(command='listAffinityGroupTypes', - method='GET') + result = self._sync_request(command="listAffinityGroupTypes", method="GET") - if not result.get('count'): + if not result.get("count"): return [] affinity_group_types = [] - for agt in result['affinityGroupType']: - affinity_group_types.append( - CloudStackAffinityGroupType(agt['type'])) + for agt in result["affinityGroupType"]: + affinity_group_types.append(CloudStackAffinityGroupType(agt["type"])) return affinity_group_types @@ -3437,25 +3946,17 @@ def ex_register_iso(self, name, url, location=None, **kwargs): if location is None: location = self.list_locations()[0] - params = {'name': name, - 'displaytext': name, - 'url': url, - 'zoneid': location.id} - params['bootable'] = kwargs.pop('bootable', False) - if params['bootable']: - os_type_id = kwargs.pop('ostypeid', None) + params = {"name": name, "displaytext": name, "url": url, "zoneid": location.id} + params["bootable"] = kwargs.pop("bootable", False) + if params["bootable"]: + os_type_id = kwargs.pop("ostypeid", None) if not os_type_id: - raise LibcloudError('If bootable=True, ostypeid is required!') + raise LibcloudError("If bootable=True, ostypeid is required!") - params['ostypeid'] = os_type_id + params["ostypeid"] = os_type_id - return self._sync_request(command='registerIso', - name=name, - displaytext=name, - url=url, - zoneid=location.id, - params=params) + return self._sync_request(command="registerIso", params=params) def ex_limits(self): """ @@ -3472,31 +3973,30 @@ def ex_limits(self): :rtype: ``dict`` """ - result = self._sync_request(command='listResourceLimits', - method='GET') + result = self._sync_request(command="listResourceLimits", method="GET") limits = {} resource_map = { - 0: 'max_instances', - 1: 'max_public_ips', - 2: 'max_volumes', - 3: 'max_snapshots', - 4: 'max_images', - 5: 'max_projects', - 6: 'max_networks', - 7: 'max_vpc', - 8: 'max_cpu', - 9: 'max_memory', - 10: 'max_primary_storage', - 11: 'max_secondary_storage' + 0: "max_instances", + 1: "max_public_ips", + 2: "max_volumes", + 3: "max_snapshots", + 4: "max_images", + 5: "max_projects", + 6: "max_networks", + 7: "max_vpc", + 8: "max_cpu", + 9: "max_memory", + 10: "max_primary_storage", + 11: "max_secondary_storage", } - for limit in result.get('resourcelimit', []): + for limit in result.get("resourcelimit", []): # We will ignore unknown types - resource = resource_map.get(int(limit['resourcetype']), None) + resource = resource_map.get(int(limit["resourcetype"]), None) if not resource: continue - limits[resource] = int(limit['max']) + limits[resource] = int(limit["max"]) return limits @@ -3520,16 +4020,13 @@ def ex_create_tags(self, resource_ids, resource_type, tags): :rtype: ``bool`` """ - params = {'resourcetype': resource_type, - 'resourceids': ','.join(resource_ids)} + params = {"resourcetype": resource_type, "resourceids": ",".join(resource_ids)} for i, key in enumerate(tags): - params['tags[%d].key' % i] = key - params['tags[%d].value' % i] = tags[key] + params["tags[%d].key" % i] = key + params["tags[%d].value" % i] = tags[key] - self._async_request(command='createTags', - params=params, - method='GET') + self._async_request(command="createTags", params=params, method="GET") return True def ex_delete_tags(self, resource_ids, resource_type, tag_keys): @@ -3551,15 +4048,12 @@ def ex_delete_tags(self, resource_ids, resource_type, tag_keys): :rtype: ``bool`` """ - params = {'resourcetype': resource_type, - 'resourceids': ','.join(resource_ids)} + params = {"resourcetype": resource_type, "resourceids": ",".join(resource_ids)} for i, key in enumerate(tag_keys): - params['tags[%s].key' % i] = key + params["tags[%s].key" % i] = key - self._async_request(command='deleteTags', - params=params, - method='GET') + self._async_request(command="deleteTags", params=params, method="GET") return True @@ -3569,11 +4063,10 @@ def list_snapshots(self): :rtype: ``list`` of :class:`VolumeSnapshot` """ - snapshots = self._sync_request('listSnapshots', - method='GET') + snapshots = self._sync_request("listSnapshots", method="GET") list_snapshots = [] - for snap in snapshots['snapshot']: + for snap in snapshots["snapshot"]: list_snapshots.append(self._to_snapshot(snap)) return list_snapshots @@ -3590,19 +4083,16 @@ def create_volume_snapshot(self, volume, name=None): :rtype: :class:`VolumeSnapshot` """ - snapshot = self._async_request(command='createSnapshot', - params={'volumeid': volume.id}, - method='GET') - return self._to_snapshot(snapshot['snapshot']) + snapshot = self._async_request( + command="createSnapshot", params={"volumeid": volume.id}, method="GET" + ) + return self._to_snapshot(snapshot["snapshot"]) def destroy_volume_snapshot(self, snapshot): - self._async_request(command='deleteSnapshot', - params={'id': snapshot.id}, - method='GET') + self._async_request(command="deleteSnapshot", params={"id": snapshot.id}, method="GET") return True - def ex_create_snapshot_template(self, snapshot, name, ostypeid, - displaytext=None): + def ex_create_snapshot_template(self, snapshot, name, ostypeid, displaytext=None): """ Create a template from a snapshot @@ -3622,23 +4112,23 @@ def ex_create_snapshot_template(self, snapshot, name, ostypeid, """ if not displaytext: displaytext = name - resp = self._async_request(command='createTemplate', - params={ - 'displaytext': displaytext, - 'name': name, - 'ostypeid': ostypeid, - 'snapshotid': snapshot.id}) - img = resp.get('template') + resp = self._async_request( + command="createTemplate", + params={ + "displaytext": displaytext, + "name": name, + "ostypeid": ostypeid, + "snapshotid": snapshot.id, + }, + ) + img = resp.get("template") extra = { - 'hypervisor': img['hypervisor'], - 'format': img['format'], - 'os': img['ostypename'], - 'displaytext': img['displaytext'] + "hypervisor": img["hypervisor"], + "format": img["format"], + "os": img["ostypename"], + "displaytext": img["displaytext"], } - return NodeImage(id=img['id'], - name=img['name'], - driver=self.connection.driver, - extra=extra) + return NodeImage(id=img["id"], name=img["name"], driver=self.connection.driver, extra=extra) def ex_list_os_types(self): """ @@ -3646,8 +4136,8 @@ def ex_list_os_types(self): :rtype: ``list`` """ - ostypes = self._sync_request('listOsTypes') - return ostypes['ostype'] + ostypes = self._sync_request("listOsTypes") + return ostypes["ostype"] def ex_list_nics(self, node): """ @@ -3659,26 +4149,29 @@ def ex_list_nics(self, node): :rtype ``list`` of :class:`CloudStackNic` """ - res = self._sync_request(command='listNics', - params={'virtualmachineid': node.id}, - method='GET') - items = res.get('nic', []) + res = self._sync_request( + command="listNics", params={"virtualmachineid": node.id}, method="GET" + ) + items = res.get("nic", []) nics = [] - extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['nic'] + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["nic"] for item in items: extra = self._get_extra_dict(item, extra_map) - nics.append(CloudStackNic( - id=item['id'], - network_id=item['networkid'], - net_mask=item['netmask'], - gateway=item['gateway'], - ip_address=item['ipaddress'], - is_default=item['isdefault'], - mac_address=item['macaddress'], - driver=self, - extra=extra)) + nics.append( + CloudStackNic( + id=item["id"], + network_id=item["networkid"], + net_mask=item["netmask"], + gateway=item["gateway"], + ip_address=item["ipaddress"], + is_default=item["isdefault"], + mac_address=item["macaddress"], + driver=self, + extra=extra, + ) + ) return nics @@ -3699,20 +4192,15 @@ def ex_attach_nic_to_node(self, node, network, ip_address=None): :rtype: ``bool`` """ - args = { - 'virtualmachineid': node.id, - 'networkid': network.id - } + args = {"virtualmachineid": node.id, "networkid": network.id} if ip_address is not None: - args['ipaddress'] = ip_address + args["ipaddress"] = ip_address - self._async_request(command='addNicToVirtualMachine', - params=args) + self._async_request(command="addNicToVirtualMachine", params=args) return True def ex_detach_nic_from_node(self, nic, node): - """ Remove Nic from a VM @@ -3725,16 +4213,27 @@ def ex_detach_nic_from_node(self, nic, node): :rtype: ``bool`` """ - self._async_request(command='removeNicFromVirtualMachine', - params={'nicid': nic.id, - 'virtualmachineid': node.id}) + self._async_request( + command="removeNicFromVirtualMachine", + params={"nicid": nic.id, "virtualmachineid": node.id}, + ) return True - def ex_list_vpn_gateways(self, account=None, domain_id=None, - for_display=None, id=None, is_recursive=None, - keyword=None, list_all=None, page=None, - page_size=None, project_id=None, vpc_id=None): + def ex_list_vpn_gateways( + self, + account=None, + domain_id=None, + for_display=None, + id=None, + is_recursive=None, + keyword=None, + list_all=None, + page=None, + page_size=None, + project_id=None, + vpc_id=None, + ): """ List VPN Gateways. @@ -3784,58 +4283,59 @@ def ex_list_vpn_gateways(self, account=None, domain_id=None, args = {} if account is not None: - args['account'] = account + args["account"] = account if domain_id is not None: - args['domainid'] = domain_id + args["domainid"] = domain_id if for_display is not None: - args['fordisplay'] = for_display + args["fordisplay"] = for_display if id is not None: - args['id'] = id + args["id"] = id if is_recursive is not None: - args['isrecursive'] = is_recursive + args["isrecursive"] = is_recursive if keyword is not None: - args['keyword'] = keyword + args["keyword"] = keyword if list_all is not None: - args['listall'] = list_all + args["listall"] = list_all if page is not None: - args['page'] = page + args["page"] = page if page_size is not None: - args['pagesize'] = page_size + args["pagesize"] = page_size if project_id is not None: - args['projectid'] = project_id + args["projectid"] = project_id if vpc_id is not None: - args['vpcid'] = vpc_id + args["vpcid"] = vpc_id - res = self._sync_request(command='listVpnGateways', - params=args, - method='GET') + res = self._sync_request(command="listVpnGateways", params=args, method="GET") - items = res.get('vpngateway', []) + items = res.get("vpngateway", []) vpn_gateways = [] - extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['vpngateway'] + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["vpngateway"] for item in items: extra = self._get_extra_dict(item, extra_map) - vpn_gateways.append(CloudStackVpnGateway( - id=item['id'], - account=item['account'], - domain=item['domain'], - domain_id=item['domainid'], - public_ip=item['publicip'], - vpc_id=item['vpcid'], - driver=self, - extra=extra)) + vpn_gateways.append( + CloudStackVpnGateway( + id=item["id"], + account=item["account"], + domain=item["domain"], + domain_id=item["domainid"], + public_ip=item["publicip"], + vpc_id=item["vpcid"], + driver=self, + extra=extra, + ) + ) return vpn_gateways @@ -3852,28 +4352,27 @@ def ex_create_vpn_gateway(self, vpc, for_display=None): :rtype: :class: `CloudStackVpnGateway` """ args = { - 'vpcid': vpc.id, + "vpcid": vpc.id, } if for_display is not None: - args['fordisplay'] = for_display + args["fordisplay"] = for_display - res = self._async_request(command='createVpnGateway', - params=args, - method='GET') + res = self._async_request(command="createVpnGateway", params=args, method="GET") - item = res['vpngateway'] - extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['vpngateway'] + item = res["vpngateway"] + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["vpngateway"] - return CloudStackVpnGateway(id=item['id'], - account=item['account'], - domain=item['domain'], - domain_id=item['domainid'], - public_ip=item['publicip'], - vpc_id=vpc.id, - driver=self, - extra=self._get_extra_dict(item, - extra_map)) + return CloudStackVpnGateway( + id=item["id"], + account=item["account"], + domain=item["domain"], + domain_id=item["domainid"], + public_ip=item["publicip"], + vpc_id=vpc.id, + driver=self, + extra=self._get_extra_dict(item, extra_map), + ) def ex_delete_vpn_gateway(self, vpn_gateway): """ @@ -3884,17 +4383,24 @@ def ex_delete_vpn_gateway(self, vpn_gateway): :rtype: ``bool`` """ - res = self._async_request(command='deleteVpnGateway', - params={'id': vpn_gateway.id}, - method='GET') - - return res['success'] - - def ex_list_vpn_customer_gateways(self, account=None, domain_id=None, - id=None, is_recursive=None, - keyword=None, list_all=None, - page=None, page_size=None, - project_id=None): + res = self._async_request( + command="deleteVpnGateway", params={"id": vpn_gateway.id}, method="GET" + ) + + return res["success"] + + def ex_list_vpn_customer_gateways( + self, + account=None, + domain_id=None, + id=None, + is_recursive=None, + keyword=None, + list_all=None, + page=None, + page_size=None, + project_id=None, + ): """ List VPN Customer Gateways. @@ -3937,60 +4443,70 @@ def ex_list_vpn_customer_gateways(self, account=None, domain_id=None, args = {} if account is not None: - args['account'] = account + args["account"] = account if domain_id is not None: - args['domainid'] = domain_id + args["domainid"] = domain_id if id is not None: - args['id'] = id + args["id"] = id if is_recursive is not None: - args['isrecursive'] = is_recursive + args["isrecursive"] = is_recursive if keyword is not None: - args['keyword'] = keyword + args["keyword"] = keyword if list_all is not None: - args['listall'] = list_all + args["listall"] = list_all if page is not None: - args['page'] = page + args["page"] = page if page_size is not None: - args['pagesize'] = page_size + args["pagesize"] = page_size if project_id is not None: - args['projectid'] = project_id + args["projectid"] = project_id - res = self._sync_request(command='listVpnCustomerGateways', - params=args, - method='GET') + res = self._sync_request(command="listVpnCustomerGateways", params=args, method="GET") - items = res.get('vpncustomergateway', []) + items = res.get("vpncustomergateway", []) vpn_customer_gateways = [] - extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['vpncustomergateway'] + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["vpncustomergateway"] for item in items: extra = self._get_extra_dict(item, extra_map) - vpn_customer_gateways.append(CloudStackVpnCustomerGateway( - id=item['id'], - cidr_list=item['cidrlist'], - esp_policy=item['esppolicy'], - gateway=item['gateway'], - ike_policy=item['ikepolicy'], - ipsec_psk=item['ipsecpsk'], - driver=self, - extra=extra)) + vpn_customer_gateways.append( + CloudStackVpnCustomerGateway( + id=item["id"], + cidr_list=item["cidrlist"], + esp_policy=item["esppolicy"], + gateway=item["gateway"], + ike_policy=item["ikepolicy"], + ipsec_psk=item["ipsecpsk"], + driver=self, + extra=extra, + ) + ) return vpn_customer_gateways - def ex_create_vpn_customer_gateway(self, cidr_list, esp_policy, gateway, - ike_policy, ipsec_psk, account=None, - domain_id=None, dpd=None, - esp_lifetime=None, ike_lifetime=None, - name=None): + def ex_create_vpn_customer_gateway( + self, + cidr_list, + esp_policy, + gateway, + ike_policy, + ipsec_psk, + account=None, + domain_id=None, + dpd=None, + esp_lifetime=None, + ike_lifetime=None, + name=None, + ): """ Creates a VPN Customer Gateway. @@ -4037,47 +4553,46 @@ def ex_create_vpn_customer_gateway(self, cidr_list, esp_policy, gateway, :rtype: :class: `CloudStackVpnCustomerGateway` """ args = { - 'cidrlist': cidr_list, - 'esppolicy': esp_policy, - 'gateway': gateway, - 'ikepolicy': ike_policy, - 'ipsecpsk': ipsec_psk + "cidrlist": cidr_list, + "esppolicy": esp_policy, + "gateway": gateway, + "ikepolicy": ike_policy, + "ipsecpsk": ipsec_psk, } if account is not None: - args['account'] = account + args["account"] = account if domain_id is not None: - args['domainid'] = domain_id + args["domainid"] = domain_id if dpd is not None: - args['dpd'] = dpd + args["dpd"] = dpd if esp_lifetime is not None: - args['esplifetime'] = esp_lifetime + args["esplifetime"] = esp_lifetime if ike_lifetime is not None: - args['ikelifetime'] = ike_lifetime + args["ikelifetime"] = ike_lifetime if name is not None: - args['name'] = name + args["name"] = name - res = self._async_request(command='createVpnCustomerGateway', - params=args, - method='GET') + res = self._async_request(command="createVpnCustomerGateway", params=args, method="GET") - item = res['vpncustomergateway'] - extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['vpncustomergateway'] + item = res["vpncustomergateway"] + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["vpncustomergateway"] - return CloudStackVpnCustomerGateway(id=item['id'], - cidr_list=cidr_list, - esp_policy=esp_policy, - gateway=gateway, - ike_policy=ike_policy, - ipsec_psk=ipsec_psk, - driver=self, - extra=self._get_extra_dict( - item, extra_map)) + return CloudStackVpnCustomerGateway( + id=item["id"], + cidr_list=cidr_list, + esp_policy=esp_policy, + gateway=gateway, + ike_policy=ike_policy, + ipsec_psk=ipsec_psk, + driver=self, + extra=self._get_extra_dict(item, extra_map), + ) def ex_delete_vpn_customer_gateway(self, vpn_customer_gateway): """ @@ -4088,16 +4603,28 @@ def ex_delete_vpn_customer_gateway(self, vpn_customer_gateway): :rtype: ``bool`` """ - res = self._async_request(command='deleteVpnCustomerGateway', - params={'id': vpn_customer_gateway.id}, - method='GET') - - return res['success'] - - def ex_list_vpn_connections(self, account=None, domain_id=None, - for_display=None, id=None, is_recursive=None, - keyword=None, list_all=None, page=None, - page_size=None, project_id=None, vpc_id=None): + res = self._async_request( + command="deleteVpnCustomerGateway", + params={"id": vpn_customer_gateway.id}, + method="GET", + ) + + return res["success"] + + def ex_list_vpn_connections( + self, + account=None, + domain_id=None, + for_display=None, + id=None, + is_recursive=None, + keyword=None, + list_all=None, + page=None, + page_size=None, + project_id=None, + vpc_id=None, + ): """ List VPN Connections. @@ -4147,62 +4674,64 @@ def ex_list_vpn_connections(self, account=None, domain_id=None, args = {} if account is not None: - args['account'] = account + args["account"] = account if domain_id is not None: - args['domainid'] = domain_id + args["domainid"] = domain_id if for_display is not None: - args['fordisplay'] = for_display + args["fordisplay"] = for_display if id is not None: - args['id'] = id + args["id"] = id if is_recursive is not None: - args['isrecursive'] = is_recursive + args["isrecursive"] = is_recursive if keyword is not None: - args['keyword'] = keyword + args["keyword"] = keyword if list_all is not None: - args['listall'] = list_all + args["listall"] = list_all if page is not None: - args['page'] = page + args["page"] = page if page_size is not None: - args['pagesize'] = page_size + args["pagesize"] = page_size if project_id is not None: - args['projectid'] = project_id + args["projectid"] = project_id if vpc_id is not None: - args['vpcid'] = vpc_id + args["vpcid"] = vpc_id - res = self._sync_request(command='listVpnConnections', - params=args, - method='GET') + res = self._sync_request(command="listVpnConnections", params=args, method="GET") - items = res.get('vpnconnection', []) + items = res.get("vpnconnection", []) vpn_connections = [] - extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['vpnconnection'] + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["vpnconnection"] for item in items: extra = self._get_extra_dict(item, extra_map) - vpn_connections.append(CloudStackVpnConnection( - id=item['id'], - passive=item['passive'], - vpn_customer_gateway_id=item['s2scustomergatewayid'], - vpn_gateway_id=item['s2svpngatewayid'], - state=item['state'], - driver=self, - extra=extra)) + vpn_connections.append( + CloudStackVpnConnection( + id=item["id"], + passive=item["passive"], + vpn_customer_gateway_id=item["s2scustomergatewayid"], + vpn_gateway_id=item["s2svpngatewayid"], + state=item["state"], + driver=self, + extra=extra, + ) + ) return vpn_connections - def ex_create_vpn_connection(self, vpn_customer_gateway, vpn_gateway, - for_display=None, passive=None): + def ex_create_vpn_connection( + self, vpn_customer_gateway, vpn_gateway, for_display=None, passive=None + ): """ Creates a VPN Connection. @@ -4221,31 +4750,30 @@ def ex_create_vpn_connection(self, vpn_customer_gateway, vpn_gateway, :rtype: :class: `CloudStackVpnConnection` """ args = { - 's2scustomergatewayid': vpn_customer_gateway.id, - 's2svpngatewayid': vpn_gateway.id, + "s2scustomergatewayid": vpn_customer_gateway.id, + "s2svpngatewayid": vpn_gateway.id, } if for_display is not None: - args['fordisplay'] = for_display + args["fordisplay"] = for_display if passive is not None: - args['passive'] = passive + args["passive"] = passive - res = self._async_request(command='createVpnConnection', - params=args, - method='GET') + res = self._async_request(command="createVpnConnection", params=args, method="GET") - item = res['vpnconnection'] - extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['vpnconnection'] + item = res["vpnconnection"] + extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["vpnconnection"] return CloudStackVpnConnection( - id=item['id'], - passive=item['passive'], + id=item["id"], + passive=item["passive"], vpn_customer_gateway_id=vpn_customer_gateway.id, vpn_gateway_id=vpn_gateway.id, - state=item['state'], + state=item["state"], driver=self, - extra=self._get_extra_dict(item, extra_map)) + extra=self._get_extra_dict(item, extra_map), + ) def ex_delete_vpn_connection(self, vpn_connection): """ @@ -4256,11 +4784,13 @@ def ex_delete_vpn_connection(self, vpn_connection): :rtype: ``bool`` """ - res = self._async_request(command='deleteVpnConnection', - params={'id': vpn_connection.id}, - method='GET') + res = self._async_request( + command="deleteVpnConnection", + params={"id": vpn_connection.id}, + method="GET", + ) - return res['success'] + return res["success"] def _to_snapshot(self, data): """ @@ -4272,11 +4802,11 @@ def _to_snapshot(self, data): :rtype: :class:`VolumeSnapshot` """ extra = { - 'tags': data.get('tags', None), - 'name': data.get('name', None), - 'volume_id': data.get('volumeid', None), + "tags": data.get("tags", None), + "name": data.get("name", None), + "volume_id": data.get("volumeid", None), } - return VolumeSnapshot(data['id'], driver=self, extra=extra) + return VolumeSnapshot(data["id"], driver=self, extra=extra) def _to_node(self, data, public_ips=None): """ @@ -4287,55 +4817,62 @@ def _to_node(self, data, public_ips=None): this node. (optional) :type public_ips: ``list`` or ``None`` """ - id = data['id'] + id = data["id"] - if 'name' in data: - name = data['name'] - elif 'displayname' in data: - name = data['displayname'] + if "name" in data: + name = data["name"] + elif "displayname" in data: + name = data["displayname"] else: name = None - state = self.NODE_STATE_MAP[data['state']] + state = self.NODE_STATE_MAP[data["state"]] public_ips = public_ips if public_ips else [] private_ips = [] - for nic in data['nic']: - if is_private_subnet(nic['ipaddress']): - private_ips.append(nic['ipaddress']) + for nic in data["nic"]: + if "ipaddress" not in nic: + continue + if is_private_subnet(nic["ipaddress"]): + private_ips.append(nic["ipaddress"]) else: - public_ips.append(nic['ipaddress']) + public_ips.append(nic["ipaddress"]) - security_groups = data.get('securitygroup', []) + security_groups = data.get("securitygroup", []) if security_groups: - security_groups = [sg['name'] for sg in security_groups] + security_groups = [sg["name"] for sg in security_groups] - affinity_groups = data.get('affinitygroup', []) + affinity_groups = data.get("affinitygroup", []) if affinity_groups: - affinity_groups = [ag['id'] for ag in affinity_groups] + affinity_groups = [ag["id"] for ag in affinity_groups] - created = data.get('created', False) + created = data.get("created", False) - extra = self._get_extra_dict(data, - RESOURCE_EXTRA_ATTRIBUTES_MAP['node']) + extra = self._get_extra_dict(data, RESOURCE_EXTRA_ATTRIBUTES_MAP["node"]) # Add additional parameters to extra - extra['security_group'] = security_groups - extra['affinity_group'] = affinity_groups - extra['ip_addresses'] = [] - extra['ip_forwarding_rules'] = [] - extra['port_forwarding_rules'] = [] - extra['created'] = created - - if 'tags' in data: - extra['tags'] = self._get_resource_tags(data['tags']) - - node = CloudStackNode(id=id, name=name, state=state, - public_ips=public_ips, private_ips=private_ips, - driver=self, extra=extra) + extra["security_group"] = security_groups + extra["affinity_group"] = affinity_groups + extra["ip_addresses"] = [] + extra["ip_forwarding_rules"] = [] + extra["port_forwarding_rules"] = [] + extra["created"] = created + + if "tags" in data: + extra["tags"] = self._get_resource_tags(data["tags"]) + + node = CloudStackNode( + id=id, + name=name, + state=state, + public_ips=list(set(public_ips)), + private_ips=private_ips, + driver=self, + extra=extra, + ) return node def _to_key_pairs(self, data): @@ -4343,23 +4880,26 @@ def _to_key_pairs(self, data): return key_pairs def _to_key_pair(self, data): - key_pair = KeyPair(name=data['name'], - fingerprint=data['fingerprint'], - public_key=data.get('publickey', None), - private_key=data.get('privatekey', None), - driver=self) + key_pair = KeyPair( + name=data["name"], + fingerprint=data["fingerprint"], + public_key=data.get("publickey", None), + private_key=data.get("privatekey", None), + driver=self, + ) return key_pair def _to_affinity_group(self, data): affinity_group = CloudStackAffinityGroup( - id=data['id'], - name=data['name'], - group_type=CloudStackAffinityGroupType(data['type']), - account=data.get('account', ''), - domain=data.get('domain', ''), - domainid=data.get('domainid', ''), - description=data.get('description', ''), - virtualmachine_ids=data.get('virtualmachineIds', '')) + id=data["id"], + name=data["name"], + group_type=CloudStackAffinityGroupType(data["type"]), + account=data.get("account", ""), + domain=data.get("domain", ""), + domainid=data.get("domainid", ""), + description=data.get("description", ""), + virtualmachine_ids=data.get("virtualmachineIds", ""), + ) return affinity_group @@ -4376,10 +4916,9 @@ def _get_resource_tags(self, tag_set): tags = {} for tag in tag_set: - for key, value in tag.iteritems(): - key = tag['key'] - value = tag['value'] - tags[key] = value + key = tag["key"] + value = tag["value"] + tags[key] = value return tags @@ -4398,8 +4937,8 @@ def _get_extra_dict(self, response, mapping): """ extra = {} for attribute, values in mapping.items(): - transform_func = values['transform_func'] - value = response.get(values['key_name'], None) + transform_func = values["transform_func"] + value = response.get(values["key_name"], None) if value is not None: extra[attribute] = transform_func(value) @@ -4407,3 +4946,13 @@ def _get_extra_dict(self, response, mapping): extra[attribute] = None return extra + + def _to_volume_state(self, vol): + state = self.VOLUME_STATE_MAP.get(vol["state"], StorageVolumeState.UNKNOWN) + + # If a volume is 'Ready' and is attached to a virtualmachine, set + # the status to INUSE + if state == StorageVolumeState.AVAILABLE and "virtualmachineid" in vol: + state = StorageVolumeState.INUSE + + return state diff --git a/libcloud/compute/drivers/digitalocean.py b/libcloud/compute/drivers/digitalocean.py index 32dd199630..5bbe28f729 100644 --- a/libcloud/compute/drivers/digitalocean.py +++ b/libcloud/compute/drivers/digitalocean.py @@ -13,541 +13,843 @@ # See the License for the specific language governing permissions and # limitations under the License. """ -Digital Ocean Driver +DigitalOcean Driver """ -from libcloud.utils.py3 import httplib - -from libcloud.common.base import ConnectionUserAndKey, ConnectionKey -from libcloud.common.base import JsonResponse -from libcloud.compute.types import Provider, NodeState, InvalidCredsError -from libcloud.compute.base import NodeDriver, Node -from libcloud.compute.base import NodeImage, NodeSize, NodeLocation, KeyPair +import json +import warnings -__all__ = [ - 'DigitalOceanNodeDriver', - 'DigitalOcean_v1_NodeDriver', - 'DigitalOcean_v1_NodeDriver' -] +from libcloud.utils.py3 import httplib +from libcloud.common.types import InvalidCredsError +from libcloud.compute.base import ( + Node, + KeyPair, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, + VolumeSnapshot, +) +from libcloud.compute.types import Provider, NodeState +from libcloud.utils.iso8601 import parse_date +from libcloud.common.digitalocean import DigitalOcean_v1_Error, DigitalOcean_v2_BaseDriver + +__all__ = ["DigitalOceanNodeDriver", "DigitalOcean_v2_NodeDriver"] class DigitalOceanNodeDriver(NodeDriver): """ DigitalOcean NodeDriver defaulting to using APIv2. - :keyword api_version: Specifies the API version to use. ``v1`` and - ``v2`` are the only valid options. Defaults to - using ``v2`` (optional) + :keyword key: Personal Access Token required for authentication. + :type key: ``str`` + + :keyword secret: Previously used with API version ``v1``. (deprecated) + :type secret: ``str`` + + :keyword api_version: Specifies the API version to use. Defaults to + using ``v2``, currently the only valid option. + (optional) :type api_version: ``str`` """ + type = Provider.DIGITAL_OCEAN - name = 'DigitalOcean' - website = 'https://www.digitalocean.com' + name = "DigitalOcean" + website = "https://www.digitalocean.com" - def __new__(cls, key, secret=None, api_version='v2', **kwargs): + def __new__(cls, key, secret=None, api_version="v2", **kwargs): if cls is DigitalOceanNodeDriver: - if api_version == 'v1': - cls = DigitalOcean_v1_NodeDriver - elif api_version == 'v2': + if api_version == "v1" or secret is not None: + if secret is not None and api_version == "v2": + raise InvalidCredsError("secret not accepted for v2 authentication") + raise DigitalOcean_v1_Error() + elif api_version == "v2": cls = DigitalOcean_v2_NodeDriver else: - raise NotImplementedError('Unsupported API version: %s' % - (api_version)) - return super(DigitalOceanNodeDriver, cls).__new__(cls, **kwargs) - - -class DigitalOcean_v1_Response(JsonResponse): - def parse_error(self): - if self.status == httplib.FOUND and '/api/error' in self.body: - # Hacky, but DigitalOcean error responses are awful - raise InvalidCredsError(self.body) - elif self.status == httplib.UNAUTHORIZED: - body = self.parse_body() - raise InvalidCredsError(body['message']) - else: - body = self.parse_body() - - if 'error_message' in body: - error = '%s (code: %s)' % (body['error_message'], self.status) - else: - error = body - return error - - -class DigitalOcean_v2_Response(JsonResponse): - valid_response_codes = [httplib.OK, httplib.ACCEPTED, httplib.CREATED, - httplib.NO_CONTENT] - - def parse_error(self): - if self.status == httplib.UNAUTHORIZED: - body = self.parse_body() - raise InvalidCredsError(body['message']) - else: - body = self.parse_body() - if 'message' in body: - error = '%s (code: %s)' % (body['message'], self.status) - else: - error = body - return error + raise NotImplementedError("Unsupported API version: %s" % (api_version)) + return super().__new__(cls, **kwargs) - def success(self): - return self.status in self.valid_response_codes - -class SSHKey(object): +# TODO Implement v1 driver using KeyPair +class SSHKey: def __init__(self, id, name, pub_key): self.id = id self.name = name self.pub_key = pub_key def __repr__(self): - return (('') % - (self.id, self.name, self.pub_key)) + return ("") % ( + self.id, + self.name, + self.pub_key, + ) -class DigitalOcean_v1_Connection(ConnectionUserAndKey): +class DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver, DigitalOceanNodeDriver): """ - Connection class for the DigitalOcean (v1) driver. + DigitalOcean NodeDriver using v2 of the API. """ - host = 'api.digitalocean.com' - responseCls = DigitalOcean_v1_Response + NODE_STATE_MAP = { + "new": NodeState.PENDING, + "off": NodeState.STOPPED, + "active": NodeState.RUNNING, + "archive": NodeState.TERMINATED, + } - def add_default_params(self, params): + EX_CREATE_ATTRIBUTES = ["backups", "ipv6", "private_networking", "tags", "ssh_keys"] + + def list_images( + self, + location=None, + ): + data = self._paginated_request("/v2/images", "images") + return list(map(self._to_image, data)) + + def list_key_pairs(self): """ - Add parameters that are necessary for every request + List all the available SSH keys. - This method adds ``client_id`` and ``api_key`` to - the request. + :return: Available SSH keys. + :rtype: ``list`` of :class:`KeyPair` """ - params['client_id'] = self.user_id - params['api_key'] = self.key - return params + data = self._paginated_request("/v2/account/keys", "ssh_keys") + return list(map(self._to_key_pair, data)) + def list_locations(self, ex_available=True): + """ + List locations -class DigitalOcean_v2_Connection(ConnectionKey): - """ - Connection class for the DigitalOcean (v2) driver. - """ + :param ex_available: Only return locations which are available. + :type ex_evailable: ``bool`` + """ + locations = [] + data = self._paginated_request("/v2/regions", "regions") + for location in data: + if ex_available: + if location.get("available"): + locations.append(self._to_location(location)) + else: + locations.append(self._to_location(location)) + return locations - host = 'api.digitalocean.com' - responseCls = DigitalOcean_v2_Response + def list_nodes(self): + data = self._paginated_request("/v2/droplets", "droplets") + return list(map(self._to_node, data)) - def add_default_headers(self, headers): + def list_sizes(self, location=None): + data = self._paginated_request("/v2/sizes", "sizes") + sizes = list(map(self._to_size, data)) + if location: + sizes = [size for size in sizes if location.id in size.extra.get("regions", [])] + return sizes + + def list_volumes(self): + data = self._paginated_request("/v2/volumes", "volumes") + return list(map(self._to_volume, data)) + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_create_attr=None, + ex_ssh_key_ids=None, + ex_user_data=None, + ): """ - Add headers that are necessary for every request + Create a node. + + The `ex_create_attr` parameter can include the following dictionary + key and value pairs: + + * `backups`: ``bool`` defaults to False + * `ipv6`: ``bool`` defaults to False + * `private_networking`: ``bool`` defaults to False + * `tags`: ``list`` of ``str`` tags + * `user_data`: ``str`` for cloud-config data + * `ssh_keys`: ``list`` of ``int`` key ids or ``str`` fingerprints + + `ex_create_attr['ssh_keys']` will override `ex_ssh_key_ids` assignment. + + :keyword ex_create_attr: A dictionary of optional attributes for + droplet creation + :type ex_create_attr: ``dict`` - This method adds ``token`` to the request. + :keyword ex_ssh_key_ids: A list of ssh key ids which will be added + to the server. (optional) + :type ex_ssh_key_ids: ``list`` of ``int`` key ids or ``str`` + key fingerprints + + :keyword ex_user_data: User data to be added to the node on create. + (optional) + :type ex_user_data: ``str`` + + :return: The newly created node. + :rtype: :class:`Node` """ - headers['Authorization'] = 'Bearer %s' % (self.key) - headers['Content-Type'] = 'application/json' - return headers + attr = { + "name": name, + "size": size.name, + "image": image.id, + "region": location.id, + "user_data": ex_user_data, + } + if ex_ssh_key_ids: + warnings.warn( + "The ex_ssh_key_ids parameter has been deprecated in" + " favor of the ex_create_attr parameter." + ) + attr["ssh_keys"] = ex_ssh_key_ids -class DigitalOcean_v1_NodeDriver(DigitalOceanNodeDriver): - """ - DigitalOcean NodeDriver using v1 of the API. - """ + ex_create_attr = ex_create_attr or {} + for key in ex_create_attr.keys(): + if key in self.EX_CREATE_ATTRIBUTES: + attr[key] = ex_create_attr[key] - connectionCls = DigitalOcean_v1_Connection + res = self.connection.request("/v2/droplets", data=json.dumps(attr), method="POST") - NODE_STATE_MAP = {'new': NodeState.PENDING, - 'off': NodeState.REBOOTING, - 'active': NodeState.RUNNING} + data = res.object["droplet"] + # TODO: Handle this in the response class + status = res.object.get("status", "OK") + if status == "ERROR": + message = res.object.get("message", None) + error_message = res.object.get("error_message", message) + raise ValueError("Failed to create node: %s" % (error_message)) - def list_nodes(self): - data = self.connection.request('/v1/droplets').object['droplets'] - return list(map(self._to_node, data)) + return self._to_node(data=data) - def list_locations(self): - data = self.connection.request('/v1/regions').object['regions'] - return list(map(self._to_location, data)) + def destroy_node(self, node): + res = self.connection.request("/v2/droplets/%s" % (node.id), method="DELETE") + return res.status == httplib.NO_CONTENT - def list_images(self): - data = self.connection.request('/v1/images').object['images'] - return list(map(self._to_image, data)) + def reboot_node(self, node): + attr = {"type": "reboot"} + res = self.connection.request( + "/v2/droplets/%s/actions" % (node.id), data=json.dumps(attr), method="POST" + ) + return res.status == httplib.CREATED + + def create_image( + self, + node, + name, + description=None, + ): + """ + Create an image from a Node. + + @inherits: :class:`NodeDriver.create_image` + + :param node: Node to use as base for image + :type node: :class:`Node` - def list_sizes(self): - data = self.connection.request('/v1/sizes').object['sizes'] - return list(map(self._to_size, data)) + :param name: Name for image + :type name: ``str`` - def create_node(self, name, size, image, location, ex_ssh_key_ids=None): + :param description: Optional image description. + :type description: ``str`` + + :rtype: ``bool`` """ - Create a node. + attr = {"type": "snapshot", "name": name} + res = self.connection.request( + "/v2/droplets/%s/actions" % (node.id), data=json.dumps(attr), method="POST" + ) + return res.status == httplib.CREATED + + def delete_image( + self, + node_image, + ): + """Delete an image for node. - :keyword ex_ssh_key_ids: A list of ssh key ids which will be added - to the server. (optional) - :type ex_ssh_key_ids: ``list`` of ``str`` + @inherits: :class:`NodeDriver.delete_image` - :return: The newly created node. - :rtype: :class:`Node` + :param node_image: the image to be deleted + :type node_image: :class:`NodeImage` + + :rtype: ``bool`` """ - params = {'name': name, 'size_id': size.id, 'image_id': image.id, - 'region_id': location.id} + image = node_image + res = self.connection.request("/v2/images/%s" % (image.id), method="DELETE") + return res.status == httplib.NO_CONTENT - if ex_ssh_key_ids: - params['ssh_key_ids'] = ','.join(ex_ssh_key_ids) + def get_image(self, image_id): + """ + Get an image based on an image_id - data = self.connection.request('/v1/droplets/new', params=params) + @inherits: :class:`NodeDriver.get_image` - # TODO: Handle this in the response class - status = data.object.get('status', 'OK') - if status == 'ERROR': - message = data.object.get('message', None) - error_message = data.object.get('error_message', message) - raise ValueError('Failed to create node: %s' % (error_message)) + :param image_id: Image identifier + :type image_id: ``int`` - return self._to_node(data=data.object['droplet']) + :return: A NodeImage object + :rtype: :class:`NodeImage` + """ + data = self._paginated_request("/v2/images/%s" % (image_id), "image") + return self._to_image(data) - def reboot_node(self, node): - res = self.connection.request('/v1/droplets/%s/reboot/' % (node.id)) - return res.status == httplib.OK + def ex_change_kernel(self, node, kernel_id): + attr = {"type": "change_kernel", "kernel": kernel_id} + res = self.connection.request( + "/v2/droplets/%s/actions" % (node.id), data=json.dumps(attr), method="POST" + ) + return res.status == httplib.CREATED - def destroy_node(self, node): - params = {'scrub_data': '1'} - res = self.connection.request('/v1/droplets/%s/destroy/' % (node.id), - params=params) - return res.status == httplib.OK + def ex_enable_ipv6(self, node): + attr = {"type": "enable_ipv6"} + res = self.connection.request( + "/v2/droplets/%s/actions" % (node.id), data=json.dumps(attr), method="POST" + ) + return res.status == httplib.CREATED def ex_rename_node(self, node, name): - params = {'name': name} - res = self.connection.request('/v1/droplets/%s/rename/' % (node.id), - params=params) - return res.status == httplib.OK + attr = {"type": "rename", "name": name} + res = self.connection.request( + "/v2/droplets/%s/actions" % (node.id), data=json.dumps(attr), method="POST" + ) + return res.status == httplib.CREATED + + def ex_shutdown_node(self, node): + attr = {"type": "shutdown"} + res = self.connection.request( + "/v2/droplets/%s/actions" % (node.id), data=json.dumps(attr), method="POST" + ) + return res.status == httplib.CREATED + + def ex_hard_reboot(self, node): + attr = {"type": "power_cycle"} + res = self.connection.request( + "/v2/droplets/%s/actions" % (node.id), data=json.dumps(attr), method="POST" + ) + return res.status == httplib.CREATED + + def ex_power_on_node(self, node): + attr = {"type": "power_on"} + res = self.connection.request( + "/v2/droplets/%s/actions" % (node.id), data=json.dumps(attr), method="POST" + ) + return res.status == httplib.CREATED - def ex_list_ssh_keys(self): + def ex_rebuild_node(self, node): """ - List all the available SSH keys. + Destroy and rebuild the node using its base image. - :return: Available SSH keys. - :rtype: ``list`` of :class:`SSHKey` + :param node: Node to rebuild + :type node: :class:`Node` + + :return True if the operation began successfully + :rtype ``bool`` + """ + attr = {"type": "rebuild", "image": node.extra["image"]["id"]} + res = self.connection.request( + "/v2/droplets/%s/actions" % (node.id), data=json.dumps(attr), method="POST" + ) + return res.status == httplib.CREATED + + def ex_resize_node(self, node, size): """ - data = self.connection.request('/v1/ssh_keys').object['ssh_keys'] - return list(map(self._to_ssh_key, data)) + Resize the node to a different machine size. Note that some resize + operations are reversible, and others are irreversible. + + :param node: Node to rebuild + :type node: :class:`Node` + + :param size: New size for this machine + :type node: :class:`NodeSize` - def ex_create_ssh_key(self, name, ssh_key_pub): + :return True if the operation began successfully + :rtype ``bool`` + """ + attr = {"type": "resize", "size": size.name} + res = self.connection.request( + "/v2/droplets/%s/actions" % (node.id), data=json.dumps(attr), method="POST" + ) + return res.status == httplib.CREATED + + def create_key_pair(self, name, public_key=""): """ Create a new SSH key. :param name: Key name (required) :type name: ``str`` - :param name: Valid public key string (required) - :type name: ``str`` + :param public_key: Valid public key string (required) + :type public_key: ``str`` """ - params = {'name': name, 'ssh_pub_key': ssh_key_pub} - data = self.connection.request('/v1/ssh_keys/new/', method='GET', - params=params).object - assert 'ssh_key' in data - return self._to_ssh_key(data=data['ssh_key']) + attr = {"name": name, "public_key": public_key} + res = self.connection.request("/v2/account/keys", method="POST", data=json.dumps(attr)) - def ex_destroy_ssh_key(self, key_id): + data = res.object["ssh_key"] + + return self._to_key_pair(data=data) + + def delete_key_pair( + self, + key_pair, + ): """ Delete an existing SSH key. - :param key_id: SSH key id (required) - :type key_id: ``str`` + :param key_pair: SSH key (required) + :type key_pair: :class:`KeyPair` """ - res = self.connection.request('/v1/ssh_keys/%s/destroy/' % (key_id)) - return res.status == httplib.OK + key = key_pair + key_id = key.extra["id"] + res = self.connection.request("/v2/account/keys/%s" % (key_id), method="DELETE") + return res.status == httplib.NO_CONTENT - def _to_node(self, data): - extra_keys = ['backups_active', 'region_id', 'image_id', 'size_id'] - if 'status' in data: - state = self.NODE_STATE_MAP.get(data['status'], NodeState.UNKNOWN) - else: - state = NodeState.UNKNOWN + def get_key_pair(self, name): + """ + Retrieve a single key pair. - if 'ip_address' in data and data['ip_address'] is not None: - public_ips = [data['ip_address']] - else: - public_ips = [] + :param name: Name of the key pair to retrieve. + :type name: ``str`` - extra = {} - for key in extra_keys: - if key in data: - extra[key] = data[key] + :rtype: :class:`.KeyPair` + """ + qkey = [k for k in self.list_key_pairs() if k.name == name][0] + data = self.connection.request("/v2/account/keys/%s" % qkey.extra["id"]).object["ssh_key"] + return self._to_key_pair(data=data) - node = Node(id=data['id'], name=data['name'], state=state, - public_ips=public_ips, private_ips=None, extra=extra, - driver=self) - return node + def create_volume(self, size, name, location=None, snapshot=None): + """ + Create a new volume. - def _to_image(self, data): - extra = {'distribution': data['distribution']} - return NodeImage(id=data['id'], name=data['name'], extra=extra, - driver=self) + :param size: Size of volume in gigabytes (required) + :type size: ``int`` - def _to_location(self, data): - return NodeLocation(id=data['id'], name=data['name'], country=None, - driver=self) + :param name: Name of the volume to be created + :type name: ``str`` - def _to_size(self, data): - ram = data['name'].lower() + :param location: Which data center to create a volume in. If + empty, undefined behavior will be selected. + (optional) + :type location: :class:`.NodeLocation` - if 'mb' in ram: - ram = int(ram.replace('mb', '')) - elif 'gb' in ram: - ram = int(ram.replace('gb', '')) * 1024 + :param snapshot: Snapshot from which to create the new + volume. (optional) + :type snapshot: :class:`.VolumeSnapshot` - return NodeSize(id=data['id'], name=data['name'], ram=ram, disk=0, - bandwidth=0, price=0, driver=self) + :return: The newly created volume. + :rtype: :class:`StorageVolume` + """ + attr = {"name": name, "size_gigabytes": size, "region": location.id} - def _to_ssh_key(self, data): - return SSHKey(id=data['id'], name=data['name'], - pub_key=data.get('ssh_pub_key', None)) + res = self.connection.request("/v2/volumes", data=json.dumps(attr), method="POST") + data = res.object["volume"] + status = res.object.get("status", "OK") + if status == "ERROR": + message = res.object.get("message", None) + error_message = res.object.get("error_message", message) + raise ValueError("Failed to create volume: %s" % (error_message)) + return self._to_volume(data=data) -class DigitalOcean_v2_NodeDriver(DigitalOceanNodeDriver): - """ - DigitalOcean NodeDriver using v2 of the API. - """ + def destroy_volume(self, volume): + """ + Destroys a storage volume. - connectionCls = DigitalOcean_v2_Connection + :param volume: Volume to be destroyed + :type volume: :class:`StorageVolume` - NODE_STATE_MAP = {'new': NodeState.PENDING, - 'off': NodeState.STOPPED, - 'active': NodeState.RUNNING, - 'archive': NodeState.TERMINATED} + :rtype: ``bool`` + """ + res = self.connection.request("/v2/volumes/%s" % volume.id, method="DELETE") + return res.status == httplib.NO_CONTENT - def list_nodes(self): - data = self._paginated_request('/v2/droplets', 'droplets') - return list(map(self._to_node, data)) + def attach_volume(self, node, volume, device=None): + """ + Attaches volume to node. - def list_locations(self): - data = self.connection.request('/v2/regions').object['regions'] - return list(map(self._to_location, data)) + :param node: Node to attach volume to. + :type node: :class:`.Node` - def list_images(self): - data = self._paginated_request('/v2/images', 'images') - return list(map(self._to_image, data)) + :param volume: Volume to attach. + :type volume: :class:`.StorageVolume` - def list_sizes(self): - data = self.connection.request('/v2/sizes').object['sizes'] - return list(map(self._to_size, data)) + :param device: Where the device is exposed, e.g. '/dev/sdb' + :type device: ``str`` - def create_node(self, name, size, image, location, ex_ssh_key_ids=None): + :rytpe: ``bool`` """ - Create a node. + attr = { + "type": "attach", + "droplet_id": node.id, + "volume_name": volume.name, + "region": volume.extra["region_slug"], + } - :keyword ex_ssh_key_ids: A list of ssh key ids which will be added - to the server. (optional) - :type ex_ssh_key_ids: ``list`` of ``str`` + res = self.connection.request("/v2/volumes/actions", data=json.dumps(attr), method="POST") - :return: The newly created node. - :rtype: :class:`Node` - """ - params = {'name': name, 'size': size.name, 'image': image.id, - 'region': location.id} + return res.status == httplib.ACCEPTED - if ex_ssh_key_ids: - params['ssh_key_ids'] = ','.join(ex_ssh_key_ids) + def detach_volume(self, volume): + """ + Detaches a volume from a node. - data = self.connection.request('/v2/droplets', - params=params, method='POST').object + :param volume: Volume to be detached + :type volume: :class:`.StorageVolume` - # TODO: Handle this in the response class - status = data.object.get('status', 'OK') - if status == 'ERROR': - message = data.object.get('message', None) - error_message = data.object.get('error_message', message) - raise ValueError('Failed to create node: %s' % (error_message)) + :rtype: ``bool`` + """ + attr = { + "type": "detach", + "volume_name": volume.name, + "region": volume.extra["region_slug"], + } + + responses = [] + for droplet_id in volume.extra["droplet_ids"]: + attr["droplet_id"] = droplet_id + res = self.connection.request( + "/v2/volumes/actions", data=json.dumps(attr), method="POST" + ) + responses.append(res) + + return all([r.status == httplib.ACCEPTED for r in responses]) + + def create_volume_snapshot( + self, + volume, + name=None, + ): + """ + Create a new volume snapshot. - return self._to_node(data=data['droplet']) + :param volume: Volume to create a snapshot for + :type volume: class:`StorageVolume` - def reboot_node(self, node): - params = {'type': 'reboot'} - res = self.connection.request('/v2/droplets/%s/actions' % (node.id), - params=params, method='POST') - return res.status == httplib.CREATED + :return: The newly created volume snapshot. + :rtype: :class:`VolumeSnapshot` + """ + attr = {"name": name} + res = self.connection.request( + "/v2/volumes/%s/snapshots" % (volume.id), + data=json.dumps(attr), + method="POST", + ) + data = res.object["snapshot"] + return self._to_volume_snapshot(data=data) + + def list_volume_snapshots(self, volume): + """ + List snapshots for a volume. - def destroy_node(self, node): - res = self.connection.request('/v2/droplets/%s' % (node.id), - method='DELETE') - return res.status == httplib.NO_CONTENT + :param volume: Volume to list snapshots for + :type volume: class:`StorageVolume` - def get_image(self, image_id): + :return: List of volume snapshots. + :rtype: ``list`` of :class: `StorageVolume` """ - Get an image based on an image_id + data = self._paginated_request("/v2/volumes/%s/snapshots" % (volume.id), "snapshots") + return list(map(self._to_volume_snapshot, data)) - @inherits: :class:`NodeDriver.get_image` + def delete_volume_snapshot(self, snapshot): + """ + Delete a volume snapshot - :param image_id: Image identifier - :type image_id: ``int`` + :param snapshot: volume snapshot to delete + :type snapshot: class:`VolumeSnapshot` - :return: A NodeImage object - :rtype: :class:`NodeImage` + :rtype: ``bool`` """ - res = self.connection.request('/v2/images/%s' % (image_id)) - data = res.object['image'] - return self._to_image(data) + res = self.connection.request("v2/snapshots/%s" % (snapshot.id), method="DELETE") + return res.status == httplib.NO_CONTENT - def create_image(self, node, name): + def ex_get_node_details(self, node_id): """ - Create an image fron a Node. + Lists details of the specified server. - @inherits: :class:`NodeDriver.create_image` + :param node_id: ID of the node which should be used + :type node_id: ``str`` - :param node: Node to use as base for image - :type node: :class:`Node` - - :param node: Name for image - :type node: ``str`` + :rtype: :class:`Node` + """ + data = self._paginated_request("/v2/droplets/{}".format(node_id), "droplet") + return self._to_node(data) - :rtype: ``bool`` + def ex_create_floating_ip(self, location): """ - params = {'type': 'snapshot', 'name': name} - res = self.connection.request('/v2/droplets/%s/actions' % (node.id), - params=params, method='POST') - return res.status == httplib.CREATED + Create new floating IP reserved to a region. - def delete_image(self, image): - """Delete an image for node. + The newly created floating IP will not be associated to a Droplet. - @inherits: :class:`NodeDriver.delete_image` + See https://developers.digitalocean.com/documentation/v2/#floating-ips - :param image: the image to be deleted - :type image: :class:`NodeImage` + :param location: Which data center to create the floating IP in. + :type location: :class:`.NodeLocation` - :rtype: ``bool`` + :rtype: :class:`DigitalOcean_v2_FloatingIpAddress` """ - res = self.connection.request('/v2/images/%s' % (image.id), - method='DELETE') - return res.status == httplib.NO_CONTENT + attr = {"region": location.id} + resp = self.connection.request("/v2/floating_ips", data=json.dumps(attr), method="POST") + return self._to_floating_ip(resp.object["floating_ip"]) - def ex_rename_node(self, node, name): - params = {'type': 'rename', 'name': name} - res = self.connection.request('/v2/droplets/%s/actions' % (node.id), - params=params, method='POST') - return res.status == httplib.CREATED + def ex_delete_floating_ip(self, ip): + """ + Delete specified floating IP - def ex_shutdown_node(self, node): - params = {'type': 'shutdown'} - res = self.connection.request('/v2/droplets/%s/actions' % (node.id), - params=params, method='POST') - return res.status == httplib.CREATED + :param ip: floating IP to remove + :type ip: :class:`DigitalOcean_v2_FloatingIpAddress` - def ex_power_on_node(self, node): - params = {'type': 'power_on'} - res = self.connection.request('/v2/droplets/%s/actions' % (node.id), - params=params, method='POST') - return res.status == httplib.CREATED + :rtype: ``bool`` + """ + resp = self.connection.request("/v2/floating_ips/{}".format(ip.id), method="DELETE") + return resp.status == httplib.NO_CONTENT - def list_key_pairs(self): + def ex_list_floating_ips(self): """ - List all the available SSH keys. + List floating IPs - :return: Available SSH keys. - :rtype: ``list`` of :class:`KeyPair` + :rtype: ``list`` of :class:`DigitalOcean_v2_FloatingIpAddress` """ - data = self.connection.request('/v2/account/keys').object['ssh_keys'] - return list(map(self._to_key_pairs, data)) + return self._to_floating_ips(self._paginated_request("/v2/floating_ips", "floating_ips")) - def create_key_pair(self, name, public_key): + def ex_get_floating_ip(self, ip): """ - Create a new SSH key. + Get specified floating IP - :param name: Key name (required) - :type name: ``str`` + :param ip: floating IP to get + :type ip: ``str`` - :param public_key: Valid public key string (required) - :type public_key: ``str`` + :rtype: :class:`DigitalOcean_v2_FloatingIpAddress` """ - params = {'name': name, 'public_key': public_key} - data = self.connection.request('/v2/account/keys', method='POST', - params=params).object['ssh_key'] - return self._to_key_pairs(data=data) + floating_ips = self.ex_list_floating_ips() + matching_ips = [x for x in floating_ips if x.ip_address == ip] + if not matching_ips: + raise ValueError("Floating ip %s not found" % ip) + return matching_ips[0] - def delete_key_pair(self, key): + def ex_attach_floating_ip_to_node(self, node, ip): """ - Delete an existing SSH key. + Attach the floating IP to the node - :param key: SSH key (required) - :type key: :class:`KeyPair` - """ - key_id = key.extra['id'] - res = self.connection.request('/v2/account/keys/%s' % (key_id), - method='DELETE') - return res.status == httplib.NO_CONTENT + :param node: node + :type node: :class:`Node` + + :param ip: floating IP to attach + :type ip: ``str`` or :class:`DigitalOcean_v2_FloatingIpAddress` - def _paginated_request(self, url, obj): + :rtype: ``bool`` """ - Perform multiple calls in order to have a full list of elements - when the API are paginated. + data = {"type": "assign", "droplet_id": node.id} + resp = self.connection.request( + "/v2/floating_ips/%s/actions" % ip.ip_address, + data=json.dumps(data), + method="POST", + ) + return resp.status == httplib.CREATED + + def ex_detach_floating_ip_from_node(self, node, ip): """ - params = {} - data = self.connection.request(url) - try: - pages = data.object['links']['pages']['last'].split('=')[-1] - values = data.object[obj] - for page in range(2, int(pages) + 1): - params.update({'page': page}) - new_data = self.connection.request(url, params=params) + Detach a floating IP from the given node + + Note: the 'node' object is not used in this method but it is added + to the signature of ex_detach_floating_ip_from_node anyway so it + conforms to the interface of the method of the same name for other + drivers like for example OpenStack. - more_values = new_data.object[obj] - for value in more_values: - values.append(value) - data = values - except KeyError: # No pages. - data = data.object[obj] + :param node: Node from which the IP should be detached + :type node: :class:`Node` - return data + :param ip: Floating IP to detach + :type ip: :class:`DigitalOcean_v2_FloatingIpAddress` + + :rtype: ``bool`` + """ + data = {"type": "unassign"} + resp = self.connection.request( + "/v2/floating_ips/%s/actions" % ip.ip_address, + data=json.dumps(data), + method="POST", + ) + return resp.status == httplib.CREATED def _to_node(self, data): - extra_keys = ['memory', 'vcpus', 'disk', 'region', 'image', - 'size_slug', 'locked', 'created_at', 'networks', - 'kernel', 'backup_ids', 'snapshot_ids', 'features'] - if 'status' in data: - state = self.NODE_STATE_MAP.get(data['status'], NodeState.UNKNOWN) + extra_keys = [ + "memory", + "vcpus", + "disk", + "image", + "size", + "size_slug", + "locked", + "created_at", + "networks", + "kernel", + "backup_ids", + "snapshot_ids", + "features", + "tags", + ] + if "status" in data: + state = self.NODE_STATE_MAP.get(data["status"], NodeState.UNKNOWN) else: state = NodeState.UNKNOWN - networks = data['networks'] + created = parse_date(data["created_at"]) + networks = data["networks"] private_ips = [] public_ips = [] if networks: - for net in networks['v4']: - if net['type'] == 'private': - private_ips = [net['ip_address']] - if net['type'] == 'public': - public_ips = [net['ip_address']] + for net in networks.get("v4", []) + networks.get("v6", []): + if net["type"] == "private": + private_ips.append(net["ip_address"]) + if net["type"] == "public": + public_ips.append(net["ip_address"]) extra = {} for key in extra_keys: if key in data: extra[key] = data[key] + extra["region"] = data.get("region", {}).get("name") - node = Node(id=data['id'], name=data['name'], state=state, - public_ips=public_ips, private_ips=private_ips, - extra=extra, driver=self) + # Untouched extra values, backwards compatibility + resolve_data = data.get("image") + if resolve_data: + image = self._to_image(resolve_data) + else: + image = None + + resolve_data = extra.get("size") + if resolve_data: + size = self._to_size(resolve_data) + else: + size = None + + node = Node( + id=data["id"], + name=data["name"], + state=state, + image=image, + size=size, + public_ips=public_ips, + private_ips=private_ips, + created_at=created, + driver=self, + extra=extra, + ) return node def _to_image(self, data): - extra = {'distribution': data['distribution'], - 'public': data['public'], - 'slug': data['slug'], - 'regions': data['regions'], - 'min_disk_size': data['min_disk_size'], - 'created_at': data['created_at']} - return NodeImage(id=data['id'], name=data['name'], extra=extra, - driver=self) + extra = { + "distribution": data["distribution"], + "public": data["public"], + "slug": data["slug"], + "regions": data["regions"], + "min_disk_size": data["min_disk_size"], + "created_at": data["created_at"], + } + return NodeImage(id=data["id"], name=data["name"], driver=self, extra=extra) + + def _to_volume(self, data): + extra = { + "created_at": data["created_at"], + "droplet_ids": data["droplet_ids"], + "region": data["region"], + "region_slug": data["region"]["slug"], + } + + return StorageVolume( + id=data["id"], + name=data["name"], + size=data["size_gigabytes"], + driver=self, + extra=extra, + ) def _to_location(self, data): - return NodeLocation(id=data['slug'], name=data['name'], country=None, - driver=self) + extra = data.get("features", []) + return NodeLocation( + id=data["slug"], name=data["name"], country=None, extra=extra, driver=self + ) def _to_size(self, data): - extra = {'vcpus': data['vcpus'], - 'regions': data['regions']} - return NodeSize(id=data['slug'], name=data['slug'], ram=data['memory'], - disk=data['disk'], bandwidth=data['transfer'], - price=data['price_hourly'], driver=self, extra=extra) - - def _to_key_pairs(self, data): - extra = {'id': data['id']} - return KeyPair(name=data['name'], - fingerprint=data['fingerprint'], - public_key=data['public_key'], - private_key=None, - driver=self, - extra=extra) + extra = { + "vcpus": data["vcpus"], + "regions": data["regions"], + "price_monthly": data["price_monthly"], + } + return NodeSize( + id=data["slug"], + name=data["slug"], + ram=data["memory"], + disk=data["disk"], + bandwidth=data["transfer"], + price=data["price_hourly"], + driver=self, + extra=extra, + ) + + def _to_key_pair(self, data): + extra = {"id": data["id"]} + return KeyPair( + name=data["name"], + fingerprint=data["fingerprint"], + public_key=data["public_key"], + private_key=None, + driver=self, + extra=extra, + ) + + def _to_volume_snapshot(self, data): + extra = { + "created_at": data["created_at"], + "resource_id": data["resource_id"], + "regions": data["regions"], + "min_disk_size": data["min_disk_size"], + } + return VolumeSnapshot( + id=data["id"], + name=data["name"], + size=data["size_gigabytes"], + driver=self, + extra=extra, + ) + + def _to_floating_ips(self, obj): + return [self._to_floating_ip(ip) for ip in obj] + + def _to_floating_ip(self, obj): + return DigitalOcean_v2_FloatingIpAddress( + # There is no ID, but the IP is unique so we can use that + id=obj["ip"], + ip_address=obj["ip"], + node_id=obj["droplet"]["id"] if obj["droplet"] else None, + extra={"region": obj["region"]}, + driver=self, + ) + + +class DigitalOcean_v2_FloatingIpAddress: + """ + Floating IP info. + """ + + def __init__(self, id, ip_address, node_id=None, extra=None, driver=None): + self.id = str(id) + self.ip_address = ip_address + self.extra = extra + self.node_id = node_id + self.driver = driver + + def delete(self): + """ + Delete this floating IP + + :rtype: ``bool`` + """ + return self.driver.ex_delete_floating_ip(self) + + def __repr__(self): + return "" % ( + self.id, + self.ip_address, + self.driver, + ) diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py new file mode 100644 index 0000000000..db837171ad --- /dev/null +++ b/libcloud/compute/drivers/dimensiondata.py @@ -0,0 +1,4563 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Dimension Data Driver +""" + +from libcloud.utils.py3 import ET, urlencode, basestring, ensure_string +from libcloud.utils.xml import findall, findtext, fixxpath +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + NodeAuthPassword, +) +from libcloud.compute.types import Provider, NodeState +from libcloud.common.exceptions import BaseHTTPError +from libcloud.common.dimensiondata import ( + SERVER_NS, + TYPES_URN, + GENERAL_NS, + NETWORK_NS, + API_ENDPOINTS, + DEFAULT_REGION, + LooseVersion, + DimensionDataNic, + DimensionDataTag, + DimensionDataPort, + DimensionDataVlan, + DimensionDataStatus, + DimensionDataTagKey, + DimensionDataNatRule, + DimensionDataNetwork, + DimensionDataPortList, + DimensionDataIpAddress, + DimensionDataConnection, + DimensionDataServerDisk, + NetworkDomainServicePlan, + DimensionDataAPIException, + DimensionDataFirewallRule, + DimensionDataChildPortList, + DimensionDataIpAddressList, + DimensionDataNetworkDomain, + DimensionDataPublicIpBlock, + DimensionDataFirewallAddress, + DimensionDataAntiAffinityRule, + DimensionDataServerVMWareTools, + DimensionDataChildIpAddressList, + DimensionDataServerCpuSpecification, + dd_object_to_id, +) + +# Node state map is a dictionary with the keys as tuples +# These tuples represent: +# (, , ) +NODE_STATE_MAP = { + ("NORMAL", "false", None): NodeState.STOPPED, + ("PENDING_CHANGE", "false", None): NodeState.PENDING, + ("PENDING_CHANGE", "false", "CHANGE_NETWORK_ADAPTER"): NodeState.PENDING, + ("PENDING_CHANGE", "true", "CHANGE_NETWORK_ADAPTER"): NodeState.PENDING, + ("PENDING_CHANGE", "false", "EXCHANGE_NIC_VLANS"): NodeState.PENDING, + ("PENDING_CHANGE", "true", "EXCHANGE_NIC_VLANS"): NodeState.PENDING, + ("NORMAL", "true", None): NodeState.RUNNING, + ("PENDING_CHANGE", "true", "START_SERVER"): NodeState.STARTING, + ("PENDING_ADD", "true", "DEPLOY_SERVER"): NodeState.STARTING, + ("PENDING_ADD", "true", "DEPLOY_SERVER_WITH_DISK_SPEED"): NodeState.STARTING, + ("PENDING_CHANGE", "true", "SHUTDOWN_SERVER"): NodeState.STOPPING, + ("PENDING_CHANGE", "true", "POWER_OFF_SERVER"): NodeState.STOPPING, + ("PENDING_CHANGE", "true", "REBOOT_SERVER"): NodeState.REBOOTING, + ("PENDING_CHANGE", "true", "RESET_SERVER"): NodeState.REBOOTING, + ("PENDING_CHANGE", "true", "RECONFIGURE_SERVER"): NodeState.RECONFIGURING, +} + +OBJECT_TO_TAGGING_ASSET_TYPE_MAP = { + "Node": "SERVER", + "NodeImage": "CUSTOMER_IMAGE", + "DimensionDataNetworkDomain": "NETWORK_DOMAIN", + "DimensionDataVlan": "VLAN", + "DimensionDataPublicIpBlock": "PUBLIC_IP_BLOCK", +} + + +class DimensionDataNodeDriver(NodeDriver): + """ + DimensionData node driver. + Default api_version is used unless specified. + """ + + selected_region = None + connectionCls = DimensionDataConnection + name = "DimensionData" + website = "http://www.dimensiondata.com/" + type = Provider.DIMENSIONDATA + features = {"create_node": ["password"]} + api_version = 1.0 + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=DEFAULT_REGION, + **kwargs, + ): + if region not in API_ENDPOINTS and host is None: + raise ValueError("Invalid region: %s, no host specified" % (region)) + if region is not None: + self.selected_region = API_ENDPOINTS[region] + + if api_version is not None: + self.api_version = api_version + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + api_version=api_version, + region=region, + **kwargs, + ) + + def _ex_connection_class_kwargs(self): + """ + Add the region to the kwargs before the connection is instantiated + """ + + kwargs = super()._ex_connection_class_kwargs() + kwargs["region"] = self.selected_region + kwargs["api_version"] = self.api_version + return kwargs + + def _create_node_mcp1( + self, + name, + image, + auth, + ex_description, + ex_network=None, + ex_memory_gb=None, + ex_cpu_specification=None, + ex_is_started=True, + ex_primary_dns=None, + ex_secondary_dns=None, + **kwargs, + ): + """ + Create a new DimensionData node + + :keyword name: String with a name for this new node (required) + :type name: ``str`` + + :keyword image: OS Image to boot on node. (required) + :type image: :class:`NodeImage` or ``str`` + + :keyword auth: Initial authentication information for the + node. (If this is a customer LINUX + image auth will be ignored) + :type auth: :class:`NodeAuthPassword` or ``str`` or + ``None`` + + :keyword ex_description: description for this node (required) + :type ex_description: ``str`` + + :keyword ex_network: Network to create the node within + (required unless using ex_network_domain + or ex_primary_ipv4) + + :type ex_network: :class:`DimensionDataNetwork` or ``str`` + + :keyword ex_memory_gb: The amount of memory in GB for the + server + :type ex_memory_gb: ``int`` + + :keyword ex_cpu_specification: The spec of CPU to deploy ( + optional) + :type ex_cpu_specification: + :class:`DimensionDataServerCpuSpecification` + + :keyword ex_is_started: Start server after creation? default + true (required) + :type ex_is_started: ``bool`` + + :keyword ex_primary_dns: The node's primary DNS + + :type ex_primary_dns: ``str`` + + :keyword ex_secondary_dns: The node's secondary DNS + + :type ex_secondary_dns: ``str`` + + :return: The newly created :class:`Node`. + :rtype: :class:`Node` + """ + password = None + image_needs_auth = self._image_needs_auth(image) + if image_needs_auth: + if isinstance(auth, basestring): + auth_obj = NodeAuthPassword(password=auth) + password = auth + else: + auth_obj = self._get_and_check_auth(auth) + password = auth_obj.password + + server_elm = ET.Element("deployServer", {"xmlns": TYPES_URN}) + ET.SubElement(server_elm, "name").text = name + ET.SubElement(server_elm, "description").text = ex_description + image_id = self._image_to_image_id(image) + ET.SubElement(server_elm, "imageId").text = image_id + ET.SubElement(server_elm, "start").text = str(ex_is_started).lower() + if password is not None: + ET.SubElement(server_elm, "administratorPassword").text = password + + if ex_cpu_specification is not None: + cpu = ET.SubElement(server_elm, "cpu") + cpu.set("speed", ex_cpu_specification.performance) + cpu.set("count", str(ex_cpu_specification.cpu_count)) + cpu.set("coresPerSocket", str(ex_cpu_specification.cores_per_socket)) + + if ex_memory_gb is not None: + ET.SubElement(server_elm, "memoryGb").text = str(ex_memory_gb) + + if ex_network is not None: + network_elm = ET.SubElement(server_elm, "network") + network_id = self._network_to_network_id(ex_network) + ET.SubElement(network_elm, "networkId").text = network_id + + if ex_primary_dns: + dns_elm = ET.SubElement(server_elm, "primaryDns") + dns_elm.text = ex_primary_dns + + if ex_secondary_dns: + dns_elm = ET.SubElement(server_elm, "secondaryDns") + dns_elm.text = ex_secondary_dns + + response = self.connection.request_with_orgId_api_2( + "server/deployServer", method="POST", data=ET.tostring(server_elm) + ).object + + node_id = None + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "serverId": + node_id = info.get("value") + + node = self.ex_get_node_by_id(node_id) + + if image_needs_auth: + if getattr(auth_obj, "generated", False): + node.extra["password"] = auth_obj.password + + return node + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_network_domain=None, + ex_primary_nic_private_ipv4=None, + ex_primary_nic_vlan=None, + ex_primary_nic_network_adapter=None, + ex_additional_nics=None, + ex_description=None, + ex_disks=None, + ex_cpu_specification=None, + ex_memory_gb=None, + ex_is_started=True, + ex_primary_dns=None, + ex_secondary_dns=None, + ex_ipv4_gateway=None, + ex_microsoft_time_zone=None, + **kwargs, + ): + """ + Create a new DimensionData node in MCP2. However, it is still + backward compatible for MCP1 for a limited time. Please consider + using MCP2 datacenter as MCP1 will phase out soon. + + Legacy Create Node for MCP1 datacenter + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.base import NodeAuthPassword + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = False + >>> DimensionData = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Password + >>> root_pw = NodeAuthPassword('password123') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU1') + >>> + >>> # Get network by location + >>> my_network = driver.list_networks(location=location)[0] + >>> pprint(my_network) + >>> + >>> # Get Image + >>> images = driver.list_images(location=location) + >>> image = images[0] + >>> + >>> node = driver.create_node(name='test_blah_2', image=image, + >>> auth=root_pw, + >>> ex_description='test3 node', + >>> ex_network=my_network, + >>> ex_is_started=False) + >>> pprint(node) + + + Create Node in MCP2 Data Center + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.base import NodeAuthPassword + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Password + >>> root_pw = NodeAuthPassword('password123') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + networkDomainName][0] + >>> + >>> vlan = driver.ex_list_vlans(location=location, + >>> network_domain=my_network_domain)[0] + >>> pprint(vlan) + >>> + >>> # Get Image + >>> images = driver.list_images(location=location) + >>> image = images[0] + >>> + >>> # Create node using vlan instead of private IPv4 + >>> node = driver.create_node(name='test_server_01', image=image, + >>> auth=root_pw, + >>> ex_description='test2 node', + >>> ex_network_domain=my_network_domain, + >>> ex_primary_nic_vlan=vlan, + >>> ex_is_started=False) + >>> + >>> # Option: Create node using private IPv4 instead of vlan + >>> # node = driver.create_node(name='test_server_02', image=image, + >>> # auth=root_pw, + >>> # ex_description='test2 node', + >>> # ex_network_domain=my_network_domain, + >>> # ex_primary_nic_private_ipv4='10.1.1.7', + >>> # ex_is_started=False) + >>> + >>> # Option: Create node using by specifying Network Adapter + >>> # node = driver.create_node(name='test_server_03', image=image, + >>> # auth=root_pw, + >>> # ex_description='test2 node', + >>> # ex_network_domain=my_network_domain, + >>> # ex_primary_nic_vlan=vlan, + >>> # ex_primary_nic_network_adapter='E1000', + >>> # ex_is_started=False) + >>> + + :keyword name: (required) String with a name for this new node + :type name: ``str`` + + :keyword image: (required) OS Image to boot on node. + :type image: :class:`NodeImage` or ``str`` + + :keyword auth: Initial authentication information for the + node. (If this is a customer LINUX + image auth will be ignored) + :type auth: :class:`NodeAuthPassword` or ``str`` or ``None`` + + :keyword ex_description: (optional) description for this node + :type ex_description: ``str`` + + + :keyword ex_network_domain: (required) Network Domain or Network + Domain ID to create the node + :type ex_network_domain: :class:`DimensionDataNetworkDomain` + or ``str`` + + :keyword ex_primary_nic_private_ipv4: Provide private IPv4. Ignore + if ex_primary_nic_vlan is + provided. Use one or the + other. Not both. + :type ex_primary_nic_private_ipv4: :``str`` + + :keyword ex_primary_nic_vlan: Provide VLAN for the node if + ex_primary_nic_private_ipv4 NOT + provided. One or the other. Not both. + :type ex_primary_nic_vlan: :class: DimensionDataVlan or ``str`` + + :keyword ex_primary_nic_network_adapter: (Optional) Default value + for the Operating System + will be used if leave + empty. Example: "E1000". + :type ex_primary_nic_network_adapter: :``str`` + + :keyword ex_additional_nics: (optional) List + :class:'DimensionDataNic' or None + :type ex_additional_nics: ``list`` of :class:'DimensionDataNic' + or ``str`` + + :keyword ex_memory_gb: (optional) The amount of memory in GB for + the server Can be used to override the + memory value inherited from the source + Server Image. + :type ex_memory_gb: ``int`` + + :keyword ex_cpu_specification: (optional) The spec of CPU to deploy + :type ex_cpu_specification: + :class:`DimensionDataServerCpuSpecification` + + :keyword ex_is_started: (required) Start server after creation. + Default is set to true. + :type ex_is_started: ``bool`` + + :keyword ex_primary_dns: (Optional) The node's primary DNS + :type ex_primary_dns: ``str`` + + :keyword ex_secondary_dns: (Optional) The node's secondary DNS + :type ex_secondary_dns: ``str`` + + :keyword ex_ipv4_gateway: (Optional) IPv4 address in dot-decimal + notation, which will be used as the + Primary NIC gateway instead of the default + gateway assigned by the system. If + ipv4Gateway is provided it does not have + to be on the VLAN of the Primary NIC + but MUST be reachable or the Guest OS + will not be configured correctly. + :type ex_ipv4_gateway: ``str`` + + :keyword ex_disks: (optional) Dimensiondata disks. Optional disk + elements can be used to define the disk speed + that each disk on the Server; inherited from the + source Server Image will be deployed to. It is + not necessary to include a diskelement for every + disk; only those that you wish to set a disk + speed value for. Note that scsiId 7 cannot be + used.Up to 13 disks can be present in addition to + the required OS disk on SCSI ID 0. Refer to + https://docs.mcp-services.net/x/UwIu for disk + + :type ex_disks: List or tuple of :class:'DimensionDataServerDisk` + + :keyword ex_microsoft_time_zone: (optional) For use with + Microsoft Windows source Server Images only. For the exact + value to use please refer to the table of time zone + indexes in the following Microsoft Technet + documentation. If none is supplied, the default time + zone for the data center geographic region will be used. + :type ex_microsoft_time_zone: `str`` + + + :return: The newly created :class:`Node`. + :rtype: :class:`Node` + """ + + # Neither legacy MCP1 network nor MCP2 network domain provided + if ex_network_domain is None and "ex_network" not in kwargs: + raise ValueError( + "You must provide either ex_network_domain " + "for MCP2 or ex_network for legacy MCP1" + ) + + # Ambiguous parameter provided. Can't determine if it is MCP 1 or 2. + if ex_network_domain is not None and "ex_network" in kwargs: + raise ValueError( + "You can only supply either " + "ex_network_domain " + "for MCP2 or ex_network for legacy MCP1" + ) + + # Set ex_is_started to False by default if none bool data type provided + if not isinstance(ex_is_started, bool): + ex_is_started = True + + # Handle MCP1 legacy + if "ex_network" in kwargs: + new_node = self._create_node_mcp1( + name=name, + image=image, + auth=auth, + ex_network=kwargs.get("ex_network"), + ex_description=ex_description, + ex_memory_gb=ex_memory_gb, + ex_cpu_specification=ex_cpu_specification, + ex_is_started=ex_is_started, + ex_primary_ipv4=ex_primary_nic_private_ipv4, + ex_disks=ex_disks, + ex_additional_nics_vlan=kwargs.get("ex_additional_nics_vlan"), + ex_additional_nics_ipv4=kwargs.get("ex_additional_nics_ipv4"), + ex_primary_dns=ex_primary_dns, + ex_secondary_dns=ex_secondary_dns, + ) + else: + # Handle MCP2 legacy. CaaS api 2.2 or earlier + if "ex_vlan" in kwargs: + ex_primary_nic_vlan = kwargs.get("ex_vlan") + + if "ex_primary_ipv4" in kwargs: + ex_primary_nic_private_ipv4 = kwargs.get("ex_primary_ipv4") + + additional_nics = [] + + if "ex_additional_nics_vlan" in kwargs: + vlans = kwargs.get("ex_additional_nics_vlan") + if isinstance(vlans, (list, tuple)): + for v in vlans: + add_nic = DimensionDataNic(vlan=v) + additional_nics.append(add_nic) + else: + raise TypeError("ex_additional_nics_vlan must " "be None or a tuple/list") + + if "ex_additional_nics_ipv4" in kwargs: + ips = kwargs.get("ex_additional_nics_ipv4") + + if isinstance(ips, (list, tuple)): + for ip in ips: + add_nic = DimensionDataNic(private_ip_v4=ip) + additional_nics.append(add_nic) + else: + if ips is not None: + raise TypeError("ex_additional_nics_ipv4 must " "be None or a tuple/list") + + if "ex_additional_nics_vlan" in kwargs or "ex_additional_nics_ipv4" in kwargs: + ex_additional_nics = additional_nics + + # Handle MCP2 latest. CaaS API 2.3 onwards + if ex_network_domain is None: + raise ValueError("ex_network_domain must be specified") + + password = None + image_needs_auth = self._image_needs_auth(image) + if image_needs_auth: + if isinstance(auth, basestring): + auth_obj = NodeAuthPassword(password=auth) + password = auth + else: + auth_obj = self._get_and_check_auth(auth) + password = auth_obj.password + + server_elm = ET.Element("deployServer", {"xmlns": TYPES_URN}) + ET.SubElement(server_elm, "name").text = name + ET.SubElement(server_elm, "description").text = ex_description + image_id = self._image_to_image_id(image) + ET.SubElement(server_elm, "imageId").text = image_id + ET.SubElement(server_elm, "start").text = str(ex_is_started).lower() + if password is not None: + ET.SubElement(server_elm, "administratorPassword").text = password + + if ex_cpu_specification is not None: + cpu = ET.SubElement(server_elm, "cpu") + cpu.set("speed", ex_cpu_specification.performance) + cpu.set("count", str(ex_cpu_specification.cpu_count)) + cpu.set("coresPerSocket", str(ex_cpu_specification.cores_per_socket)) + + if ex_memory_gb is not None: + ET.SubElement(server_elm, "memoryGb").text = str(ex_memory_gb) + + if ex_primary_nic_private_ipv4 is None and ex_primary_nic_vlan is None: + raise ValueError( + "Missing argument. Either " + "ex_primary_nic_private_ipv4 or " + "ex_primary_nic_vlan " + "must be specified." + ) + + if ex_primary_nic_private_ipv4 is not None and ex_primary_nic_vlan is not None: + raise ValueError( + "Either ex_primary_nic_private_ipv4 or " + "ex_primary_nic_vlan " + "be specified. Not both." + ) + + network_elm = ET.SubElement(server_elm, "networkInfo") + + net_domain_id = self._network_domain_to_network_domain_id(ex_network_domain) + + network_elm.set("networkDomainId", net_domain_id) + + pri_nic = ET.SubElement(network_elm, "primaryNic") + + if ex_primary_nic_private_ipv4 is not None: + ET.SubElement(pri_nic, "privateIpv4").text = ex_primary_nic_private_ipv4 + + if ex_primary_nic_vlan is not None: + vlan_id = self._vlan_to_vlan_id(ex_primary_nic_vlan) + ET.SubElement(pri_nic, "vlanId").text = vlan_id + + if ex_primary_nic_network_adapter is not None: + ET.SubElement(pri_nic, "networkAdapter").text = ex_primary_nic_network_adapter + + if isinstance(ex_additional_nics, (list, tuple)): + for nic in ex_additional_nics: + additional_nic = ET.SubElement(network_elm, "additionalNic") + + if nic.private_ip_v4 is None and nic.vlan is None: + raise ValueError( + "Either a vlan or private_ip_v4 " + "must be specified for each " + "additional nic." + ) + + if nic.private_ip_v4 is not None and nic.vlan is not None: + raise ValueError( + "Either a vlan or private_ip_v4 " + "must be specified for each " + "additional nic. Not both." + ) + + if nic.private_ip_v4 is not None: + ET.SubElement(additional_nic, "privateIpv4").text = nic.private_ip_v4 + + if nic.vlan is not None: + vlan_id = self._vlan_to_vlan_id(nic.vlan) + ET.SubElement(additional_nic, "vlanId").text = vlan_id + + if nic.network_adapter_name is not None: + ET.SubElement(additional_nic, "networkAdapter").text = ( + nic.network_adapter_name + ) + elif ex_additional_nics is not None: + raise TypeError("ex_additional_NICs must be None or tuple/list") + + if ex_primary_dns: + dns_elm = ET.SubElement(server_elm, "primaryDns") + dns_elm.text = ex_primary_dns + + if ex_secondary_dns: + dns_elm = ET.SubElement(server_elm, "secondaryDns") + dns_elm.text = ex_secondary_dns + + if ex_ipv4_gateway: + ET.SubElement(server_elm, "ipv4Gateway").text = ex_ipv4_gateway + + if isinstance(ex_disks, (list, tuple)): + for disk in ex_disks: + disk_elm = ET.SubElement(server_elm, "disk") + disk_elm.set("scsiId", disk.scsi_id) + disk_elm.set("speed", disk.speed) + elif ex_disks is not None: + raise TypeError("ex_disks must be None or tuple/list") + + if ex_microsoft_time_zone: + ET.SubElement(server_elm, "microsoftTimeZone").text = ex_microsoft_time_zone + + response = self.connection.request_with_orgId_api_2( + "server/deployServer", method="POST", data=ET.tostring(server_elm) + ).object + + node_id = None + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "serverId": + node_id = info.get("value") + + new_node = self.ex_get_node_by_id(node_id) + + if image_needs_auth: + if getattr(auth_obj, "generated", False): + new_node.extra["password"] = auth_obj.password + + return new_node + + def destroy_node(self, node): + """ + Deletes a node, node must be stopped before deletion + + + :keyword node: The node to delete + :type node: :class:`Node` + + :rtype: ``bool`` + """ + request_elm = ET.Element("deleteServer", {"xmlns": TYPES_URN, "id": node.id}) + body = self.connection.request_with_orgId_api_2( + "server/deleteServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def reboot_node(self, node): + """ + Reboots a node by requesting the OS restart via the hypervisor + + + :keyword node: The node to reboot + :type node: :class:`Node` + + :rtype: ``bool`` + """ + request_elm = ET.Element("rebootServer", {"xmlns": TYPES_URN, "id": node.id}) + body = self.connection.request_with_orgId_api_2( + "server/rebootServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def list_nodes( + self, + ex_location=None, + ex_name=None, + ex_ipv6=None, + ex_ipv4=None, + ex_vlan=None, + ex_image=None, + ex_deployed=None, + ex_started=None, + ex_state=None, + ex_network=None, + ex_network_domain=None, + ): + """ + List nodes deployed for your organization. + + :keyword ex_location: Filters the node list to nodes that are + located in this location + :type ex_location: :class:`NodeLocation` or ``str`` + + :keyword ex_name: Filters the node list to nodes that have this name + :type ex_name ``str`` + + :keyword ex_ipv6: Filters the node list to nodes that have this + ipv6 address + :type ex_ipv6: ``str`` + + :keyword ex_ipv4: Filters the node list to nodes that have this + ipv4 address + :type ex_ipv4: ``str`` + + :keyword ex_vlan: Filters the node list to nodes that are in this VLAN + :type ex_vlan: :class:`DimensionDataVlan` or ``str`` + + :keyword ex_image: Filters the node list to nodes that have this image + :type ex_image: :class:`NodeImage` or ``str`` + + :keyword ex_deployed: Filters the node list to nodes that are + deployed or not + :type ex_deployed: ``bool`` + + :keyword ex_started: Filters the node list to nodes that are + started or not + :type ex_started: ``bool`` + + :keyword ex_state: Filters the node list by nodes that are in + this state + :type ex_state: ``str`` + + :keyword ex_network: Filters the node list to nodes in this network + :type ex_network: :class:`DimensionDataNetwork` or ``str`` + + :keyword ex_network_domain: Filters the node list to nodes in this + network domain + :type ex_network_domain: :class:`DimensionDataNetworkDomain` + or ``str`` + + :return: a list of `Node` objects + :rtype: ``list`` of :class:`Node` + """ + node_list = [] + for nodes in self.ex_list_nodes_paginated( + location=ex_location, + name=ex_name, + ipv6=ex_ipv6, + ipv4=ex_ipv4, + vlan=ex_vlan, + image=ex_image, + deployed=ex_deployed, + started=ex_started, + state=ex_state, + network=ex_network, + network_domain=ex_network_domain, + ): + node_list.extend(nodes) + + return node_list + + def list_images(self, location=None): + """ + List images available + + Note: Currently only returns the default 'base OS images' + provided by DimensionData. Customer images (snapshots) + use ex_list_customer_images + + :keyword ex_location: Filters the node list to nodes that are + located in this location + :type ex_location: :class:`NodeLocation` or ``str`` + + :return: List of images available + :rtype: ``list`` of :class:`NodeImage` + """ + params = {} + if location is not None: + params["datacenterId"] = self._location_to_location_id(location) + + return self._to_images( + self.connection.request_with_orgId_api_2("image/osImage", params=params).object + ) + + def list_sizes(self, location=None): + """ + return a list of available sizes + Currently, the size of the node is dictated by the chosen OS base + image, they cannot be set explicitly. + + @inherits: :class:`NodeDriver.list_sizes` + """ + return [ + NodeSize( + id=1, + name="default", + ram=0, + disk=0, + bandwidth=0, + price=0, + driver=self.connection.driver, + ), + ] + + def list_locations(self, ex_id=None): + """ + List locations (datacenters) available for instantiating servers and + networks. + + :keyword ex_id: Filters the location list to this id + :type ex_id: ``str`` + + :return: List of locations + :rtype: ``list`` of :class:`NodeLocation` + """ + params = {} + if ex_id is not None: + params["id"] = ex_id + + return self._to_locations( + self.connection.request_with_orgId_api_2( + "infrastructure/datacenter", params=params + ).object + ) + + def list_networks(self, location=None): + """ + List networks deployed across all data center locations for your + organization. The response includes the location of each network. + + + :keyword location: The location + :type location: :class:`NodeLocation` or ``str`` + + :return: a list of DimensionDataNetwork objects + :rtype: ``list`` of :class:`DimensionDataNetwork` + """ + url_ext = "" + if location is not None: + url_ext = "/" + self._location_to_location_id(location) + + return self._to_networks( + self.connection.request_with_orgId_api_1("networkWithLocation%s" % url_ext).object + ) + + def import_image( + self, + ovf_package_name, + name, + cluster_id=None, + datacenter_id=None, + description=None, + is_guest_os_customization=None, + tagkey_name_value_dictionaries=None, + ): + """ + Import image + + :param ovf_package_name: Image OVF package name + :type ovf_package_name: ``str`` + + :param name: Image name + :type name: ``str`` + + :param cluster_id: Provide either cluster_id or datacenter_id + :type cluster_id: ``str`` + + :param datacenter_id: Provide either cluster_id or datacenter_id + :type datacenter_id: ``str`` + + :param description: Optional. Description of image + :type description: ``str`` + + :param is_guest_os_customization: Optional. true for NGOC image + :type is_guest_os_customization: ``bool`` + + :param tagkey_name_value_dictionaries: Optional tagkey name value dict + :type tagkey_name_value_dictionaries: dictionaries + + :return: Return true if successful + :rtype: ``bool`` + """ + + # Unsupported for version lower than 2.4 + if LooseVersion(self.connection.active_api_version) < LooseVersion("2.4"): + raise Exception( + "import image is feature is NOT supported in " "api version earlier than 2.4" + ) + elif cluster_id is None and datacenter_id is None: + raise ValueError("Either cluster_id or datacenter_id must be " "provided") + elif cluster_id is not None and datacenter_id is not None: + raise ValueError( + "Cannot accept both cluster_id and " "datacenter_id. Please provide either one" + ) + else: + import_image_elem = ET.Element("urn:importImage", {"xmlns:urn": TYPES_URN}) + + ET.SubElement(import_image_elem, "urn:ovfPackage").text = ovf_package_name + + ET.SubElement(import_image_elem, "urn:name").text = name + + if description is not None: + ET.SubElement(import_image_elem, "urn:description").text = description + + if cluster_id is not None: + ET.SubElement(import_image_elem, "urn:clusterId").text = cluster_id + else: + ET.SubElement(import_image_elem, "urn:datacenterId").text = datacenter_id + + if is_guest_os_customization is not None: + ET.SubElement(import_image_elem, "urn:guestOsCustomization").text = ( + is_guest_os_customization + ) + + if len(tagkey_name_value_dictionaries) > 0: + for k, v in tagkey_name_value_dictionaries.items(): + tag_elem = ET.SubElement(import_image_elem, "urn:tag") + ET.SubElement(tag_elem, "urn:tagKeyName").text = k + + if v is not None: + ET.SubElement(tag_elem, "urn:value").text = v + + response = self.connection.request_with_orgId_api_2( + "image/importImage", method="POST", data=ET.tostring(import_image_elem) + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def start_node(self, node): + """ + Powers on an existing deployed server + + :param node: Node which should be used + :type node: :class:`Node` + + :rtype: ``bool`` + """ + request_elm = ET.Element("startServer", {"xmlns": TYPES_URN, "id": node.id}) + body = self.connection.request_with_orgId_api_2( + "server/startServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def stop_node(self, node): + """ + This function will attempt to "gracefully" stop a server by + initiating a shutdown sequence within the guest operating system. + A successful response on this function means the system has + successfully passed the request into the operating system. + + :param node: Node which should be used + :type node: :class:`Node` + + :rtype: ``bool`` + """ + request_elm = ET.Element("shutdownServer", {"xmlns": TYPES_URN, "id": node.id}) + body = self.connection.request_with_orgId_api_2( + "server/shutdownServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_nodes_paginated( + self, + name=None, + location=None, + ipv6=None, + ipv4=None, + vlan=None, + image=None, + deployed=None, + started=None, + state=None, + network=None, + network_domain=None, + ): + """ + Return a generator which yields node lists in pages + + :keyword location: Filters the node list to nodes that are + located in this location + :type location: :class:`NodeLocation` or ``str`` + + :keyword name: Filters the node list to nodes that have this name + :type name ``str`` + + :keyword ipv6: Filters the node list to nodes that have this + ipv6 address + :type ipv6: ``str`` + + :keyword ipv4: Filters the node list to nodes that have this + ipv4 address + :type ipv4: ``str`` + + :keyword vlan: Filters the node list to nodes that are in this VLAN + :type vlan: :class:`DimensionDataVlan` or ``str`` + + :keyword image: Filters the node list to nodes that have this image + :type image: :class:`NodeImage` or ``str`` + + :keyword deployed: Filters the node list to nodes that are + deployed or not + :type deployed: ``bool`` + + :keyword started: Filters the node list to nodes that are + started or not + :type started: ``bool`` + + :keyword state: Filters the node list to nodes that are in + this state + :type state: ``str`` + + :keyword network: Filters the node list to nodes in this network + :type network: :class:`DimensionDataNetwork` or ``str`` + + :keyword network_domain: Filters the node list to nodes in this + network domain + :type network_domain: :class:`DimensionDataNetworkDomain` + or ``str`` + + :return: a list of `Node` objects + :rtype: ``generator`` of `list` of :class:`Node` + """ + + params = {} + if location is not None: + params["datacenterId"] = self._location_to_location_id(location) + if ipv6 is not None: + params["ipv6"] = ipv6 + if ipv4 is not None: + params["privateIpv4"] = ipv4 + if state is not None: + params["state"] = state + if started is not None: + params["started"] = started + if deployed is not None: + params["deployed"] = deployed + if name is not None: + params["name"] = name + if network_domain is not None: + params["networkDomainId"] = self._network_domain_to_network_domain_id(network_domain) + if network is not None: + params["networkId"] = self._network_to_network_id(network) + if vlan is not None: + params["vlanId"] = self._vlan_to_vlan_id(vlan) + if image is not None: + params["sourceImageId"] = self._image_to_image_id(image) + + nodes_obj = self._list_nodes_single_page(params) + yield self._to_nodes(nodes_obj) + + while nodes_obj.get("pageCount") >= nodes_obj.get("pageSize"): + params["pageNumber"] = int(nodes_obj.get("pageNumber")) + 1 + nodes_obj = self._list_nodes_single_page(params) + yield self._to_nodes(nodes_obj) + + def ex_start_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.start_node(node=node) + + def ex_shutdown_graceful(self, node): + return self.stop_node(node=node) + + def ex_power_off(self, node): + """ + This function will abruptly power-off a server. Unlike + ex_shutdown_graceful, success ensures the node will stop but some OS + and application configurations may be adversely affected by the + equivalent of pulling the power plug out of the machine. + + :param node: Node which should be used + :type node: :class:`Node` + + :rtype: ``bool`` + """ + request_elm = ET.Element("powerOffServer", {"xmlns": TYPES_URN, "id": node.id}) + + try: + body = self.connection.request_with_orgId_api_2( + "server/powerOffServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + except (DimensionDataAPIException, NameError, BaseHTTPError): + r = self.ex_get_node_by_id(node.id) + response_code = r.state.upper() + + return response_code in ["IN_PROGRESS", "OK", "STOPPED", "STOPPING"] + + def ex_reset(self, node): + """ + This function will abruptly reset a server. Unlike + reboot_node, success ensures the node will restart but some OS + and application configurations may be adversely affected by the + equivalent of pulling the power plug out of the machine. + + :param node: Node which should be used + :type node: :class:`Node` + + :rtype: ``bool`` + """ + request_elm = ET.Element("resetServer", {"xmlns": TYPES_URN, "id": node.id}) + body = self.connection.request_with_orgId_api_2( + "server/resetServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_update_vm_tools(self, node): + """ + This function triggers an update of the VMware Tools + software running on the guest OS of a Server. + + :param node: Node which should be used + :type node: :class:`Node` + + :rtype: ``bool`` + """ + request_elm = ET.Element("updateVmwareTools", {"xmlns": TYPES_URN, "id": node.id}) + body = self.connection.request_with_orgId_api_2( + "server/updateVmwareTools", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_update_node(self, node, name=None, description=None, cpu_count=None, ram_mb=None): + """ + Update the node, the name, CPU or RAM + + :param node: Node which should be used + :type node: :class:`Node` + + :param name: The new name (optional) + :type name: ``str`` + + :param description: The new description (optional) + :type description: ``str`` + + :param cpu_count: The new CPU count (optional) + :type cpu_count: ``int`` + + :param ram_mb: The new Memory in MB (optional) + :type ram_mb: ``int`` + + :rtype: ``bool`` + """ + data = {} + if name is not None: + data["name"] = name + if description is not None: + data["description"] = description + if cpu_count is not None: + data["cpuCount"] = str(cpu_count) + if ram_mb is not None: + data["memory"] = str(ram_mb) + body = self.connection.request_with_orgId_api_1( + "server/%s" % (node.id), method="POST", data=urlencode(data, True) + ).object + response_code = findtext(body, "result", GENERAL_NS) + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_create_anti_affinity_rule(self, node_list): + """ + Create an anti affinity rule given a list of nodes + Anti affinity rules ensure that servers will not reside + on the same VMware ESX host + + :param node_list: The list of nodes to create a rule for + :type node_list: ``list`` of :class:`Node` or + ``list`` of ``str`` + + :rtype: ``bool`` + """ + if not isinstance(node_list, (list, tuple)): + raise TypeError("Node list must be a list or a tuple.") + anti_affinity_xml_request = ET.Element("NewAntiAffinityRule", {"xmlns": SERVER_NS}) + for node in node_list: + ET.SubElement(anti_affinity_xml_request, "serverId").text = self._node_to_node_id(node) + result = self.connection.request_with_orgId_api_1( + "antiAffinityRule", + method="POST", + data=ET.tostring(anti_affinity_xml_request), + ).object + response_code = findtext(result, "result", GENERAL_NS) + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_delete_anti_affinity_rule(self, anti_affinity_rule): + """ + Remove anti affinity rule + + :param anti_affinity_rule: The anti affinity rule to delete + :type anti_affinity_rule: :class:`DimensionDataAntiAffinityRule` or + ``str`` + + :rtype: ``bool`` + """ + rule_id = self._anti_affinity_rule_to_anti_affinity_rule_id(anti_affinity_rule) + result = self.connection.request_with_orgId_api_1( + "antiAffinityRule/%s?delete" % (rule_id), method="GET" + ).object + response_code = findtext(result, "result", GENERAL_NS) + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_list_anti_affinity_rules( + self, + network=None, + network_domain=None, + node=None, + filter_id=None, + filter_state=None, + ): + """ + List anti affinity rules for a network, network domain, or node + + :param network: The network to list anti affinity rules for + One of network, network_domain, or node is required + :type network: :class:`DimensionDataNetwork` or ``str`` + + :param network_domain: The network domain to list anti affinity rules + One of network, network_domain, + or node is required + :type network_domain: :class:`DimensionDataNetworkDomain` or ``str`` + + :param node: The node to list anti affinity rules for + One of network, netwok_domain, or node is required + :type node: :class:`Node` or ``str`` + + :param filter_id: This will allow you to filter the rules + by this node id + :type filter_id: ``str`` + + :type filter_state: This will allow you to filter rules by + node state (i.e. NORMAL) + :type filter_state: ``str`` + + :rtype: ``list`` of :class:`DimensionDataAntiAffinityRule` + """ + not_none_arguments = [key for key in (network, network_domain, node) if key is not None] + if len(not_none_arguments) != 1: + raise ValueError("One and ONLY one of network, " "network_domain, or node must be set") + + params = {} + if network_domain is not None: + params["networkDomainId"] = self._network_domain_to_network_domain_id(network_domain) + if network is not None: + params["networkId"] = self._network_to_network_id(network) + if node is not None: + params["serverId"] = self._node_to_node_id(node) + if filter_id is not None: + params["id"] = filter_id + if filter_state is not None: + params["state"] = filter_state + + paged_result = self.connection.paginated_request_with_orgId_api_2( + "server/antiAffinityRule", method="GET", params=params + ) + + rules = [] + for result in paged_result: + rules.extend(self._to_anti_affinity_rules(result)) + return rules + + def ex_attach_node_to_vlan(self, node, vlan=None, private_ipv4=None): + """ + Attach a node to a VLAN by adding an additional NIC to + the node on the target VLAN. The IP will be automatically + assigned based on the VLAN IP network space. Alternatively, provide + a private IPv4 address instead of VLAN information, and this will + be assigned to the node on corresponding NIC. + + :param node: Node which should be used + :type node: :class:`Node` + + :param vlan: VLAN to attach the node to + (required unless private_ipv4) + :type vlan: :class:`DimensionDataVlan` + + :keyword private_ipv4: Private nic IPv4 Address + (required unless vlan) + :type private_ipv4: ``str`` + + :rtype: ``bool`` + """ + request = ET.Element("addNic", {"xmlns": TYPES_URN}) + ET.SubElement(request, "serverId").text = node.id + nic = ET.SubElement(request, "nic") + + if vlan is not None: + ET.SubElement(nic, "vlanId").text = vlan.id + elif private_ipv4 is not None: + ET.SubElement(nic, "privateIpv4").text = private_ipv4 + else: + raise ValueError("One of vlan or primary_ipv4 " "must be specified") + + response = self.connection.request_with_orgId_api_2( + "server/addNic", method="POST", data=ET.tostring(request) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_destroy_nic(self, nic_id): + """ + Remove a NIC on a node, removing the node from a VLAN + + :param nic_id: The identifier of the NIC to remove + :type nic_id: ``str`` + + :rtype: ``bool`` + """ + request = ET.Element("removeNic", {"xmlns": TYPES_URN, "id": nic_id}) + + response = self.connection.request_with_orgId_api_2( + "server/removeNic", method="POST", data=ET.tostring(request) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_networks(self, location=None): + """ + List networks deployed across all data center locations for your + organization. The response includes the location of each network. + + :param location: The target location + :type location: :class:`NodeLocation` or ``str`` + + :return: a list of DimensionDataNetwork objects + :rtype: ``list`` of :class:`DimensionDataNetwork` + """ + return self.list_networks(location=location) + + def ex_create_network(self, location, name, description=None): + """ + Create a new network in an MCP 1.0 location + + :param location: The target location (MCP1) + :type location: :class:`NodeLocation` or ``str`` + + :param name: The name of the network + :type name: ``str`` + + :param description: Additional description of the network + :type description: ``str`` + + :return: A new instance of `DimensionDataNetwork` + :rtype: Instance of :class:`DimensionDataNetwork` + """ + network_location = self._location_to_location_id(location) + + create_node = ET.Element("NewNetworkWithLocation", {"xmlns": NETWORK_NS}) + ET.SubElement(create_node, "name").text = name + if description is not None: + ET.SubElement(create_node, "description").text = description + ET.SubElement(create_node, "location").text = network_location + + self.connection.request_with_orgId_api_1( + "networkWithLocation", method="POST", data=ET.tostring(create_node) + ) + + # MCP1 API does not return the ID, but name is unique for location + network = list(filter(lambda x: x.name == name, self.ex_list_networks(location)))[0] + + return network + + def ex_delete_network(self, network): + """ + Delete a network from an MCP 1 data center + + :param network: The network to delete + :type network: :class:`DimensionDataNetwork` + + :rtype: ``bool`` + """ + response = self.connection.request_with_orgId_api_1( + "network/%s?delete" % network.id, method="GET" + ).object + response_code = findtext(response, "result", GENERAL_NS) + return response_code == "SUCCESS" + + def ex_rename_network(self, network, new_name): + """ + Rename a network in MCP 1 data center + + :param network: The network to rename + :type network: :class:`DimensionDataNetwork` + + :param new_name: The new name of the network + :type new_name: ``str`` + + :rtype: ``bool`` + """ + response = self.connection.request_with_orgId_api_1( + "network/%s" % network.id, method="POST", data="name=%s" % new_name + ).object + response_code = findtext(response, "result", GENERAL_NS) + return response_code == "SUCCESS" + + def ex_get_network_domain(self, network_domain_id): + """ + Get an individual Network Domain, by identifier + + :param network_domain_id: The identifier of the network domain + :type network_domain_id: ``str`` + + :rtype: :class:`DimensionDataNetworkDomain` + """ + locations = self.list_locations() + net = self.connection.request_with_orgId_api_2( + "network/networkDomain/%s" % network_domain_id + ).object + return self._to_network_domain(net, locations) + + def ex_list_network_domains(self, location=None, name=None, service_plan=None, state=None): + """ + List networks domains deployed across all data center locations domain. + + for your organization. + The response includes the location of each network + :param location: Only network domains in the location (optional) + :type location: :class:`NodeLocation` or ``str`` + + :param name: Only network domains of this name (optional) + :type name: ``str`` + + :param service_plan: Only network domains of this type (optional) + :type service_plan: ``str`` + + :param state: Only network domains in this state (optional) + :type state: ``str`` + + :return: a list of `DimensionDataNetwork` objects + :rtype: ``list`` of :class:`DimensionDataNetwork` + """ + params = {} + if location is not None: + params["datacenterId"] = self._location_to_location_id(location) + if name is not None: + params["name"] = name + if service_plan is not None: + params["type"] = service_plan + if state is not None: + params["state"] = state + + response = self.connection.request_with_orgId_api_2( + "network/networkDomain", params=params + ).object + return self._to_network_domains(response) + + def ex_create_network_domain(self, location, name, service_plan, description=None): + """ + Deploy a new network domain to a data center + + :param location: The data center to list + :type location: :class:`NodeLocation` or ``str`` + + :param name: The name of the network domain to create + :type name: ``str`` + + :param service_plan: The service plan, either "ESSENTIALS" + or "ADVANCED" + :type service_plan: ``str`` + + :param description: An additional description of + the network domain + :type description: ``str`` + + :return: an instance of `DimensionDataNetworkDomain` + :rtype: :class:`DimensionDataNetworkDomain` + """ + create_node = ET.Element("deployNetworkDomain", {"xmlns": TYPES_URN}) + ET.SubElement(create_node, "datacenterId").text = self._location_to_location_id(location) + + ET.SubElement(create_node, "name").text = name + if description is not None: + ET.SubElement(create_node, "description").text = description + ET.SubElement(create_node, "type").text = service_plan + + response = self.connection.request_with_orgId_api_2( + "network/deployNetworkDomain", method="POST", data=ET.tostring(create_node) + ).object + + network_domain_id = None + + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "networkDomainId": + network_domain_id = info.get("value") + + return DimensionDataNetworkDomain( + id=network_domain_id, + name=name, + description=description, + location=location, + status=NodeState.RUNNING, + plan=service_plan, + ) + + def ex_update_network_domain(self, network_domain): + """ + Update the properties of a network domain + + :param network_domain: The network domain with updated properties + :type network_domain: :class:`DimensionDataNetworkDomain` + + :return: an instance of `DimensionDataNetworkDomain` + :rtype: :class:`DimensionDataNetworkDomain` + """ + edit_node = ET.Element("editNetworkDomain", {"xmlns": TYPES_URN}) + edit_node.set("id", network_domain.id) + ET.SubElement(edit_node, "name").text = network_domain.name + if network_domain.description is not None: + ET.SubElement(edit_node, "description").text = network_domain.description + ET.SubElement(edit_node, "type").text = network_domain.plan + + self.connection.request_with_orgId_api_2( + "network/editNetworkDomain", method="POST", data=ET.tostring(edit_node) + ).object + + return network_domain + + def ex_delete_network_domain(self, network_domain): + """ + Delete a network domain + + :param network_domain: The network domain to delete + :type network_domain: :class:`DimensionDataNetworkDomain` + + :rtype: ``bool`` + """ + delete_node = ET.Element("deleteNetworkDomain", {"xmlns": TYPES_URN}) + delete_node.set("id", network_domain.id) + result = self.connection.request_with_orgId_api_2( + "network/deleteNetworkDomain", method="POST", data=ET.tostring(delete_node) + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_create_vlan( + self, + network_domain, + name, + private_ipv4_base_address, + description=None, + private_ipv4_prefix_size=24, + ): + """ + Deploy a new VLAN to a network domain + + :param network_domain: The network domain to add the VLAN to + :type network_domain: :class:`DimensionDataNetworkDomain` + + :param name: The name of the VLAN to create + :type name: ``str`` + + :param private_ipv4_base_address: The base IPv4 address + e.g. 192.168.1.0 + :type private_ipv4_base_address: ``str`` + + :param description: An additional description of the VLAN + :type description: ``str`` + + :param private_ipv4_prefix_size: The size of the IPv4 + address space, e.g 24 + :type private_ipv4_prefix_size: ``int`` + + :return: an instance of `DimensionDataVlan` + :rtype: :class:`DimensionDataVlan` + """ + create_node = ET.Element("deployVlan", {"xmlns": TYPES_URN}) + ET.SubElement(create_node, "networkDomainId").text = network_domain.id + ET.SubElement(create_node, "name").text = name + if description is not None: + ET.SubElement(create_node, "description").text = description + ET.SubElement(create_node, "privateIpv4BaseAddress").text = private_ipv4_base_address + ET.SubElement(create_node, "privateIpv4PrefixSize").text = str(private_ipv4_prefix_size) + + response = self.connection.request_with_orgId_api_2( + "network/deployVlan", method="POST", data=ET.tostring(create_node) + ).object + + vlan_id = None + + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "vlanId": + vlan_id = info.get("value") + + return self.ex_get_vlan(vlan_id) + + def ex_get_vlan(self, vlan_id): + """ + Get a single VLAN, by it's identifier + + :param vlan_id: The identifier of the VLAN + :type vlan_id: ``str`` + + :return: an instance of `DimensionDataVlan` + :rtype: :class:`DimensionDataVlan` + """ + locations = self.list_locations() + vlan = self.connection.request_with_orgId_api_2("network/vlan/%s" % vlan_id).object + return self._to_vlan(vlan, locations) + + def ex_update_vlan(self, vlan): + """ + Updates the properties of the given VLAN + Only name and description are updated + + :param vlan: The VLAN to update + :type vlan: :class:`DimensionDataNetworkDomain` + + :return: an instance of `DimensionDataVlan` + :rtype: :class:`DimensionDataVlan` + """ + edit_node = ET.Element("editVlan", {"xmlns": TYPES_URN}) + edit_node.set("id", vlan.id) + ET.SubElement(edit_node, "name").text = vlan.name + if vlan.description is not None: + ET.SubElement(edit_node, "description").text = vlan.description + + self.connection.request_with_orgId_api_2( + "network/editVlan", method="POST", data=ET.tostring(edit_node) + ).object + + return vlan + + def ex_expand_vlan(self, vlan): + """ + Expands the VLAN to the prefix size in private_ipv4_range_size + The expansion will + not be permitted if the proposed IP space overlaps with an + already deployed VLANs IP space. + + :param vlan: The VLAN to update + :type vlan: :class:`DimensionDataNetworkDomain` + + :return: an instance of `DimensionDataVlan` + :rtype: :class:`DimensionDataVlan` + """ + edit_node = ET.Element("expandVlan", {"xmlns": TYPES_URN}) + edit_node.set("id", vlan.id) + ET.SubElement(edit_node, "privateIpv4PrefixSize").text = vlan.private_ipv4_range_size + + self.connection.request_with_orgId_api_2( + "network/expandVlan", method="POST", data=ET.tostring(edit_node) + ).object + + return vlan + + def ex_delete_vlan(self, vlan): + """ + Deletes an existing VLAN + + :param vlan: The VLAN to delete + :type vlan: :class:`DimensionDataNetworkDomain` + + :rtype: ``bool`` + """ + delete_node = ET.Element("deleteVlan", {"xmlns": TYPES_URN}) + delete_node.set("id", vlan.id) + result = self.connection.request_with_orgId_api_2( + "network/deleteVlan", method="POST", data=ET.tostring(delete_node) + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_vlans( + self, + location=None, + network_domain=None, + name=None, + ipv4_address=None, + ipv6_address=None, + state=None, + ): + """ + List VLANs available, can filter by location and/or network domain + + :param location: Only VLANs in this location (optional) + :type location: :class:`NodeLocation` or ``str`` + + :param network_domain: Only VLANs in this domain (optional) + :type network_domain: :class:`DimensionDataNetworkDomain` + + :param name: Only VLANs with this name (optional) + :type name: ``str`` + + :param ipv4_address: Only VLANs with this ipv4 address (optional) + :type ipv4_address: ``str`` + + :param ipv6_address: Only VLANs with this ipv6 address (optional) + :type ipv6_address: ``str`` + + :param state: Only VLANs with this state (optional) + :type state: ``str`` + + :return: a list of DimensionDataVlan objects + :rtype: ``list`` of :class:`DimensionDataVlan` + """ + params = {} + if location is not None: + params["datacenterId"] = self._location_to_location_id(location) + if network_domain is not None: + params["networkDomainId"] = self._network_domain_to_network_domain_id(network_domain) + if name is not None: + params["name"] = name + if ipv4_address is not None: + params["privateIpv4Address"] = ipv4_address + if ipv6_address is not None: + params["ipv6Address"] = ipv6_address + if state is not None: + params["state"] = state + response = self.connection.request_with_orgId_api_2("network/vlan", params=params).object + return self._to_vlans(response) + + def ex_add_public_ip_block_to_network_domain(self, network_domain): + add_node = ET.Element("addPublicIpBlock", {"xmlns": TYPES_URN}) + ET.SubElement(add_node, "networkDomainId").text = network_domain.id + + response = self.connection.request_with_orgId_api_2( + "network/addPublicIpBlock", method="POST", data=ET.tostring(add_node) + ).object + + block_id = None + + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "ipBlockId": + block_id = info.get("value") + return self.ex_get_public_ip_block(block_id) + + def ex_list_public_ip_blocks(self, network_domain): + params = {} + params["networkDomainId"] = network_domain.id + + response = self.connection.request_with_orgId_api_2( + "network/publicIpBlock", params=params + ).object + return self._to_ip_blocks(response) + + def ex_get_public_ip_block(self, block_id): + locations = self.list_locations() + block = self.connection.request_with_orgId_api_2( + "network/publicIpBlock/%s" % block_id + ).object + return self._to_ip_block(block, locations) + + def ex_delete_public_ip_block(self, block): + delete_node = ET.Element("removePublicIpBlock", {"xmlns": TYPES_URN}) + delete_node.set("id", block.id) + result = self.connection.request_with_orgId_api_2( + "network/removePublicIpBlock", method="POST", data=ET.tostring(delete_node) + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_get_node_by_id(self, id): + node = self.connection.request_with_orgId_api_2("server/server/%s" % id).object + return self._to_node(node) + + def ex_list_firewall_rules(self, network_domain, page_size=50, page_number=1): + params = {"pageSize": page_size, "pageNumber": page_number} + params["networkDomainId"] = self._network_domain_to_network_domain_id(network_domain) + + response = self.connection.request_with_orgId_api_2( + "network/firewallRule", params=params + ).object + return self._to_firewall_rules(response, network_domain) + + def ex_create_firewall_rule( + self, network_domain, rule, position, position_relative_to_rule=None + ): + """ + Creates a firewall rule + + :param network_domain: The network domain in which to create + the firewall rule + :type network_domain: :class:`DimensionDataNetworkDomain` or ``str`` + + :param rule: The rule in which to create + :type rule: :class:`DimensionDataFirewallRule` + + :param position: The position in which to create the rule + There are two types of positions + with position_relative_to_rule arg and without it + With: 'BEFORE' or 'AFTER' + Without: 'FIRST' or 'LAST' + :type position: ``str`` + + :param position_relative_to_rule: The rule or rule name in + which to decide positioning by + :type position_relative_to_rule: + :class:`DimensionDataFirewallRule` or ``str`` + + :rtype: ``bool`` + """ + positions_without_rule = ("FIRST", "LAST") + positions_with_rule = ("BEFORE", "AFTER") + + create_node = ET.Element("createFirewallRule", {"xmlns": TYPES_URN}) + ET.SubElement(create_node, "networkDomainId").text = ( + self._network_domain_to_network_domain_id(network_domain) + ) + ET.SubElement(create_node, "name").text = rule.name + ET.SubElement(create_node, "action").text = rule.action + ET.SubElement(create_node, "ipVersion").text = rule.ip_version + ET.SubElement(create_node, "protocol").text = rule.protocol + # Setup source port rule + source = ET.SubElement(create_node, "source") + if rule.source.address_list_id is not None: + source_ip = ET.SubElement(source, "ipAddressListId") + source_ip.text = rule.source.address_list_id + else: + source_ip = ET.SubElement(source, "ip") + if rule.source.any_ip: + source_ip.set("address", "ANY") + else: + source_ip.set("address", rule.source.ip_address) + if rule.source.ip_prefix_size is not None: + source_ip.set("prefixSize", str(rule.source.ip_prefix_size)) + if rule.source.port_list_id is not None: + source_port = ET.SubElement(source, "portListId") + source_port.text = rule.source.port_list_id + else: + if rule.source.port_begin is not None: + source_port = ET.SubElement(source, "port") + source_port.set("begin", rule.source.port_begin) + if rule.source.port_end is not None: + source_port.set("end", rule.source.port_end) + # Setup destination port rule + dest = ET.SubElement(create_node, "destination") + if rule.destination.address_list_id is not None: + dest_ip = ET.SubElement(dest, "ipAddressListId") + dest_ip.text = rule.destination.address_list_id + else: + dest_ip = ET.SubElement(dest, "ip") + if rule.destination.any_ip: + dest_ip.set("address", "ANY") + else: + dest_ip.set("address", rule.destination.ip_address) + if rule.destination.ip_prefix_size is not None: + dest_ip.set("prefixSize", rule.destination.ip_prefix_size) + if rule.destination.port_list_id is not None: + dest_port = ET.SubElement(dest, "portListId") + dest_port.text = rule.destination.port_list_id + else: + if rule.destination.port_begin is not None: + dest_port = ET.SubElement(dest, "port") + dest_port.set("begin", rule.destination.port_begin) + if rule.destination.port_end is not None: + dest_port.set("end", rule.destination.port_end) + # Set up positioning of rule + ET.SubElement(create_node, "enabled").text = str(rule.enabled).lower() + placement = ET.SubElement(create_node, "placement") + if position_relative_to_rule is not None: + if position not in positions_with_rule: + raise ValueError( + "When position_relative_to_rule is specified" + " position must be %s" % ", ".join(positions_with_rule) + ) + if isinstance(position_relative_to_rule, DimensionDataFirewallRule): + rule_name = position_relative_to_rule.name + else: + rule_name = position_relative_to_rule + placement.set("relativeToRule", rule_name) + else: + if position not in positions_without_rule: + raise ValueError( + "When position_relative_to_rule is not" + " specified position must be %s" % ", ".join(positions_without_rule) + ) + placement.set("position", position) + + response = self.connection.request_with_orgId_api_2( + "network/createFirewallRule", method="POST", data=ET.tostring(create_node) + ).object + + rule_id = None + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "firewallRuleId": + rule_id = info.get("value") + rule.id = rule_id + return rule + + def ex_edit_firewall_rule(self, rule, position, relative_rule_for_position=None): + """ + Edit a firewall rule + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + networkDomainName][0] + >>> + >>> + >>> # List firewall rules + >>> firewall_rules = driver.ex_list_firewall_rules(my_network_domain) + >>> + >>> # Get Firewall Rule by name + >>> pprint("List specific firewall rule by name") + >>> fire_rule_under_test = (list(filter(lambda x: x.name == + 'My_New_Firewall_Rule', firewall_rules))[0]) + >>> pprint(fire_rule_under_test.source) + >>> pprint(fire_rule_under_test.destination) + >>> + >>> # Edit Firewall + >>> fire_rule_under_test.destination.address_list_id = + '5e7c323f-c885-4e4b-9a27-94c44217dbd3' + >>> fire_rule_under_test.destination.port_list_id = + 'b6557c5a-45fa-4138-89bd-8fe68392691b' + >>> result = driver.ex_edit_firewall_rule(fire_rule_under_test, 'LAST') + >>> pprint(result) + + :param rule: (required) The rule in which to create + :type rule: :class:`DimensionDataFirewallRule` + + :param position: (required) There are two types of positions + with position_relative_to_rule arg and without it + With: 'BEFORE' or 'AFTER' + Without: 'FIRST' or 'LAST' + :type position: ``str`` + + :param relative_rule_for_position: (optional) The rule or rule name in + which to decide the relative rule + for positioning. + :type relative_rule_for_position: + :class:`DimensionDataFirewallRule` or ``str`` + + :rtype: ``bool`` + """ + + positions_without_rule = ("FIRST", "LAST") + positions_with_rule = ("BEFORE", "AFTER") + + edit_node = ET.Element("editFirewallRule", {"xmlns": TYPES_URN, "id": rule.id}) + ET.SubElement(edit_node, "action").text = rule.action + ET.SubElement(edit_node, "protocol").text = rule.protocol + + # Source address + source = ET.SubElement(edit_node, "source") + if rule.source.address_list_id is not None: + source_ip = ET.SubElement(source, "ipAddressListId") + source_ip.text = rule.source.address_list_id + else: + source_ip = ET.SubElement(source, "ip") + if rule.source.any_ip: + source_ip.set("address", "ANY") + else: + source_ip.set("address", rule.source.ip_address) + if rule.source.ip_prefix_size is not None: + source_ip.set("prefixSize", str(rule.source.ip_prefix_size)) + + # Setup source port rule + if rule.source.port_list_id is not None: + source_port = ET.SubElement(source, "portListId") + source_port.text = rule.source.port_list_id + else: + if rule.source.port_begin is not None: + source_port = ET.SubElement(source, "port") + source_port.set("begin", rule.source.port_begin) + if rule.source.port_end is not None: + source_port.set("end", rule.source.port_end) + # Setup destination port rule + dest = ET.SubElement(edit_node, "destination") + if rule.destination.address_list_id is not None: + dest_ip = ET.SubElement(dest, "ipAddressListId") + dest_ip.text = rule.destination.address_list_id + else: + dest_ip = ET.SubElement(dest, "ip") + if rule.destination.any_ip: + dest_ip.set("address", "ANY") + else: + dest_ip.set("address", rule.destination.ip_address) + if rule.destination.ip_prefix_size is not None: + dest_ip.set("prefixSize", rule.destination.ip_prefix_size) + if rule.destination.port_list_id is not None: + dest_port = ET.SubElement(dest, "portListId") + dest_port.text = rule.destination.port_list_id + else: + if rule.destination.port_begin is not None: + dest_port = ET.SubElement(dest, "port") + dest_port.set("begin", rule.destination.port_begin) + if rule.destination.port_end is not None: + dest_port.set("end", rule.destination.port_end) + # Set up positioning of rule + ET.SubElement(edit_node, "enabled").text = str(rule.enabled).lower() + placement = ET.SubElement(edit_node, "placement") + if relative_rule_for_position is not None: + if position not in positions_with_rule: + raise ValueError( + "When position_relative_to_rule is specified" + " position must be %s" % ", ".join(positions_with_rule) + ) + if isinstance(relative_rule_for_position, DimensionDataFirewallRule): + rule_name = relative_rule_for_position.name + else: + rule_name = relative_rule_for_position + placement.set("relativeToRule", rule_name) + else: + if position not in positions_without_rule: + raise ValueError( + "When position_relative_to_rule is not" + " specified position must be %s" % ", ".join(positions_without_rule) + ) + placement.set("position", position) + + response = self.connection.request_with_orgId_api_2( + "network/editFirewallRule", method="POST", data=ET.tostring(edit_node) + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_get_firewall_rule(self, network_domain, rule_id): + locations = self.list_locations() + rule = self.connection.request_with_orgId_api_2("network/firewallRule/%s" % rule_id).object + return self._to_firewall_rule(rule, locations, network_domain) + + def ex_set_firewall_rule_state(self, rule, state): + """ + Change the state (enabled or disabled) of a rule + + :param rule: The rule to delete + :type rule: :class:`DimensionDataFirewallRule` + + :param state: The desired state enabled (True) or disabled (False) + :type state: ``bool`` + + :rtype: ``bool`` + """ + update_node = ET.Element("editFirewallRule", {"xmlns": TYPES_URN}) + update_node.set("id", rule.id) + ET.SubElement(update_node, "enabled").text = str(state).lower() + result = self.connection.request_with_orgId_api_2( + "network/editFirewallRule", method="POST", data=ET.tostring(update_node) + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_delete_firewall_rule(self, rule): + """ + Delete a firewall rule + + :param rule: The rule to delete + :type rule: :class:`DimensionDataFirewallRule` + + :rtype: ``bool`` + """ + update_node = ET.Element("deleteFirewallRule", {"xmlns": TYPES_URN}) + update_node.set("id", rule.id) + result = self.connection.request_with_orgId_api_2( + "network/deleteFirewallRule", method="POST", data=ET.tostring(update_node) + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_create_nat_rule(self, network_domain, internal_ip, external_ip): + """ + Create a NAT rule + + :param network_domain: The network domain the rule belongs to + :type network_domain: :class:`DimensionDataNetworkDomain` + + :param internal_ip: The IPv4 address internally + :type internal_ip: ``str`` + + :param external_ip: The IPv4 address externally + :type external_ip: ``str`` + + :rtype: :class:`DimensionDataNatRule` + """ + create_node = ET.Element("createNatRule", {"xmlns": TYPES_URN}) + ET.SubElement(create_node, "networkDomainId").text = network_domain.id + ET.SubElement(create_node, "internalIp").text = internal_ip + ET.SubElement(create_node, "externalIp").text = external_ip + result = self.connection.request_with_orgId_api_2( + "network/createNatRule", method="POST", data=ET.tostring(create_node) + ).object + + rule_id = None + for info in findall(result, "info", TYPES_URN): + if info.get("name") == "natRuleId": + rule_id = info.get("value") + + return DimensionDataNatRule( + id=rule_id, + network_domain=network_domain, + internal_ip=internal_ip, + external_ip=external_ip, + status=NodeState.RUNNING, + ) + + def ex_list_nat_rules(self, network_domain): + """ + Get NAT rules for the network domain + + :param network_domain: The network domain the rules belongs to + :type network_domain: :class:`DimensionDataNetworkDomain` + + :rtype: ``list`` of :class:`DimensionDataNatRule` + """ + params = {} + params["networkDomainId"] = network_domain.id + + response = self.connection.request_with_orgId_api_2("network/natRule", params=params).object + return self._to_nat_rules(response, network_domain) + + def ex_get_nat_rule(self, network_domain, rule_id): + """ + Get a NAT rule by ID + + :param network_domain: The network domain the rule belongs to + :type network_domain: :class:`DimensionDataNetworkDomain` + + :param rule_id: The ID of the NAT rule to fetch + :type rule_id: ``str`` + + :rtype: :class:`DimensionDataNatRule` + """ + rule = self.connection.request_with_orgId_api_2("network/natRule/%s" % rule_id).object + return self._to_nat_rule(rule, network_domain) + + def ex_delete_nat_rule(self, rule): + """ + Delete an existing NAT rule + + :param rule: The rule to delete + :type rule: :class:`DimensionDataNatRule` + + :rtype: ``bool`` + """ + update_node = ET.Element("deleteNatRule", {"xmlns": TYPES_URN}) + update_node.set("id", rule.id) + result = self.connection.request_with_orgId_api_2( + "network/deleteNatRule", method="POST", data=ET.tostring(update_node) + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_get_location_by_id(self, id): + """ + Get location by ID. + + :param id: ID of the node location which should be used + :type id: ``str`` + + :rtype: :class:`NodeLocation` + """ + location = None + if id is not None: + location = self.list_locations(ex_id=id)[0] + return location + + def ex_wait_for_state(self, state, func, poll_interval=2, timeout=60, *args, **kwargs): + """ + Wait for the function which returns a instance + with field status to match + + Keep polling func until one of the desired states is matched + + :param state: Either the desired state (`str`) or a `list` of states + :type state: ``str`` or ``list`` + + :param func: The function to call, e.g. ex_get_vlan + :type func: ``function`` + + :param poll_interval: The number of seconds to wait between checks + :type poll_interval: `int` + + :param timeout: The total number of seconds to wait to reach a state + :type timeout: `int` + + :param args: The arguments for func + :type args: Positional arguments + + :param kwargs: The arguments for func + :type kwargs: Keyword arguments + """ + return self.connection.wait_for_state(state, func, poll_interval, timeout, *args, **kwargs) + + def ex_enable_monitoring(self, node, service_plan="ESSENTIALS"): + """ + Enables cloud monitoring on a node + + :param node: The node to monitor + :type node: :class:`Node` + + :param service_plan: The service plan, one of ESSENTIALS or + ADVANCED + :type service_plan: ``str`` + + :rtype: ``bool`` + """ + update_node = ET.Element("enableServerMonitoring", {"xmlns": TYPES_URN}) + update_node.set("id", node.id) + ET.SubElement(update_node, "servicePlan").text = service_plan + result = self.connection.request_with_orgId_api_2( + "server/enableServerMonitoring", + method="POST", + data=ET.tostring(update_node), + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_update_monitoring_plan(self, node, service_plan="ESSENTIALS"): + """ + Updates the service plan on a node with monitoring + + :param node: The node to monitor + :type node: :class:`Node` + + :param service_plan: The service plan, one of ESSENTIALS or + ADVANCED + :type service_plan: ``str`` + + :rtype: ``bool`` + """ + update_node = ET.Element("changeServerMonitoringPlan", {"xmlns": TYPES_URN}) + update_node.set("id", node.id) + ET.SubElement(update_node, "servicePlan").text = service_plan + result = self.connection.request_with_orgId_api_2( + "server/changeServerMonitoringPlan", + method="POST", + data=ET.tostring(update_node), + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_disable_monitoring(self, node): + """ + Disables cloud monitoring for a node + + :param node: The node to stop monitoring + :type node: :class:`Node` + + :rtype: ``bool`` + """ + update_node = ET.Element("disableServerMonitoring", {"xmlns": TYPES_URN}) + update_node.set("id", node.id) + result = self.connection.request_with_orgId_api_2( + "server/disableServerMonitoring", + method="POST", + data=ET.tostring(update_node), + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_add_storage_to_node(self, node, amount, speed="STANDARD", scsi_id=None): + """ + Add storage to the node + + :param node: The server to add storage to + :type node: :class:`Node` + + :param amount: The amount of storage to add, in GB + :type amount: ``int`` + + :param speed: The disk speed type + :type speed: ``str`` + + :param scsi_id: The target SCSI ID (optional) + :type scsi_id: ``int`` + + :rtype: ``bool`` + """ + update_node = ET.Element("addDisk", {"xmlns": TYPES_URN}) + update_node.set("id", node.id) + ET.SubElement(update_node, "sizeGb").text = str(amount) + ET.SubElement(update_node, "speed").text = speed.upper() + if scsi_id is not None: + ET.SubElement(update_node, "scsiId").text = str(scsi_id) + + result = self.connection.request_with_orgId_api_2( + "server/addDisk", method="POST", data=ET.tostring(update_node) + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_remove_storage_from_node(self, node, scsi_id): + """ + Remove storage from a node + + :param node: The server to add storage to + :type node: :class:`Node` + + :param scsi_id: The ID of the disk to remove + :type scsi_id: ``str`` + + :rtype: ``bool`` + """ + disk = [disk for disk in node.extra["disks"] if disk.scsi_id == scsi_id][0] + return self.ex_remove_storage(disk.id) + + def ex_remove_storage(self, disk_id): + """ + Remove storage from a node + + :param node: The server to add storage to + :type node: :class:`Node` + + :param disk_id: The ID of the disk to remove + :type disk_id: ``str`` + + :rtype: ``bool`` + """ + remove_disk = ET.Element("removeDisk", {"xmlns": TYPES_URN}) + remove_disk.set("id", disk_id) + result = self.connection.request_with_orgId_api_2( + "server/removeDisk", method="POST", data=ET.tostring(remove_disk) + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_change_storage_speed(self, node, disk_id, speed): + """ + Change the speed (disk tier) of a disk + + :param node: The server to change the disk speed of + :type node: :class:`Node` + + :param disk_id: The ID of the disk to change + :type disk_id: ``str`` + + :param speed: The disk speed type e.g. STANDARD + :type speed: ``str`` + + :rtype: ``bool`` + """ + create_node = ET.Element("ChangeDiskSpeed", {"xmlns": SERVER_NS}) + ET.SubElement(create_node, "speed").text = speed + result = self.connection.request_with_orgId_api_1( + "server/{}/disk/{}/changeSpeed".format(node.id, disk_id), + method="POST", + data=ET.tostring(create_node), + ).object + response_code = findtext(result, "result", GENERAL_NS) + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_change_storage_size(self, node, disk_id, size): + """ + Change the size of a disk + + :param node: The server to change the disk of + :type node: :class:`Node` + + :param disk_id: The ID of the disk to resize + :type disk_id: ``str`` + + :param size: The disk size in GB + :type size: ``int`` + + :rtype: ``bool`` + """ + create_node = ET.Element("ChangeDiskSize", {"xmlns": SERVER_NS}) + ET.SubElement(create_node, "newSizeGb").text = str(size) + result = self.connection.request_with_orgId_api_1( + "server/{}/disk/{}/changeSize".format(node.id, disk_id), + method="POST", + data=ET.tostring(create_node), + ).object + response_code = findtext(result, "result", GENERAL_NS) + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_reconfigure_node(self, node, memory_gb, cpu_count, cores_per_socket, cpu_performance): + """ + Reconfigure the virtual hardware specification of a node + + :param node: The server to change + :type node: :class:`Node` + + :param memory_gb: The amount of memory in GB (optional) + :type memory_gb: ``int`` + + :param cpu_count: The number of CPU (optional) + :type cpu_count: ``int`` + + :param cores_per_socket: Number of CPU cores per socket (optional) + :type cores_per_socket: ``int`` + + :param cpu_performance: CPU Performance type (optional) + :type cpu_performance: ``str`` + + :rtype: ``bool`` + """ + update = ET.Element("reconfigureServer", {"xmlns": TYPES_URN}) + update.set("id", node.id) + if memory_gb is not None: + ET.SubElement(update, "memoryGb").text = str(memory_gb) + if cpu_count is not None: + ET.SubElement(update, "cpuCount").text = str(cpu_count) + if cpu_performance is not None: + ET.SubElement(update, "cpuSpeed").text = cpu_performance + if cores_per_socket is not None: + ET.SubElement(update, "coresPerSocket").text = str(cores_per_socket) + result = self.connection.request_with_orgId_api_2( + "server/reconfigureServer", method="POST", data=ET.tostring(update) + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_clone_node_to_image( + self, + node, + image_name, + image_description=None, + cluster_id=None, + is_guest_Os_Customization=None, + tag_key_id=None, + tag_value=None, + ): + """ + Clone a server into a customer image. + + :param node: The server to clone + :type node: :class:`Node` + + :param image_name: The name of the clone image + :type image_name: ``str`` + + :param description: The description of the image + :type description: ``str`` + + :rtype: ``bool`` + """ + if image_description is None: + image_description = "" + + node_id = self._node_to_node_id(node) + + # Version 2.3 and lower + if LooseVersion(self.connection.active_api_version) < LooseVersion("2.4"): + response = self.connection.request_with_orgId_api_1( + "server/{}?clone={}&desc={}".format(node_id, image_name, image_description) + ).object + + # Version 2.4 and higher + else: + clone_server_elem = ET.Element("cloneServer", {"id": node_id, "xmlns": TYPES_URN}) + + ET.SubElement(clone_server_elem, "imageName").text = image_name + + if image_description is not None: + ET.SubElement(clone_server_elem, "description").text = image_description + + if cluster_id is not None: + ET.SubElement(clone_server_elem, "clusterId").text = cluster_id + + if is_guest_Os_Customization is not None: + ET.SubElement(clone_server_elem, "guestOsCustomization").text = ( + is_guest_Os_Customization + ) + + if tag_key_id is not None: + tag_elem = ET.SubElement(clone_server_elem, "tagById") + ET.SubElement(tag_elem, "tagKeyId").text = tag_key_id + + if tag_value is not None: + ET.SubElement(tag_elem, "value").text = tag_value + + response = self.connection.request_with_orgId_api_2( + "server/cloneServer", method="POST", data=ET.tostring(clone_server_elem) + ).object + + # Version 2.3 and lower + if LooseVersion(self.connection.active_api_version) < LooseVersion("2.4"): + response_code = findtext(response, "result", GENERAL_NS) + else: + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_clean_failed_deployment(self, node): + """ + Removes a node that has failed to deploy + + :param node: The failed node to clean + :type node: :class:`Node` or ``str`` + """ + node_id = self._node_to_node_id(node) + request_elm = ET.Element("cleanServer", {"xmlns": TYPES_URN, "id": node_id}) + body = self.connection.request_with_orgId_api_2( + "server/cleanServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_customer_images(self, location=None): + """ + Return a list of customer imported images + + :param location: The target location + :type location: :class:`NodeLocation` or ``str`` + + :rtype: ``list`` of :class:`NodeImage` + """ + params = {} + if location is not None: + params["datacenterId"] = self._location_to_location_id(location) + + return self._to_images( + self.connection.request_with_orgId_api_2("image/customerImage", params=params).object, + "customerImage", + ) + + def ex_get_base_image_by_id(self, id): + """ + Gets a Base image in the Dimension Data Cloud given the id + + :param id: The id of the image + :type id: ``str`` + + :rtype: :class:`NodeImage` + """ + image = self.connection.request_with_orgId_api_2("image/osImage/%s" % id).object + return self._to_image(image) + + def ex_get_customer_image_by_id(self, id): + """ + Gets a Customer image in the Dimension Data Cloud given the id + + :param id: The id of the image + :type id: ``str`` + + :rtype: :class:`NodeImage` + """ + image = self.connection.request_with_orgId_api_2("image/customerImage/%s" % id).object + return self._to_image(image) + + def ex_get_image_by_id(self, id): + """ + Gets a Base/Customer image in the Dimension Data Cloud given the id + + Note: This first checks the base image + If it is not a base image we check if it is a customer image + If it is not in either of these a DimensionDataAPIException + is thrown + + :param id: The id of the image + :type id: ``str`` + + :rtype: :class:`NodeImage` + """ + try: + return self.ex_get_base_image_by_id(id) + except DimensionDataAPIException as e: + if e.code != "RESOURCE_NOT_FOUND": + raise e + return self.ex_get_customer_image_by_id(id) + + def ex_create_tag_key( + self, name, description=None, value_required=True, display_on_report=True + ): + """ + Creates a tag key in the Dimension Data Cloud + + :param name: The name of the tag key (required) + :type name: ``str`` + + :param description: The description of the tag key + :type description: ``str`` + + :param value_required: If a value is required for the tag + Tags themselves can be just a tag, + or be a key/value pair + :type value_required: ``bool`` + + :param display_on_report: Should this key show up on the usage reports + :type display_on_report: ``bool`` + + :rtype: ``bool`` + """ + create_tag_key = ET.Element("createTagKey", {"xmlns": TYPES_URN}) + ET.SubElement(create_tag_key, "name").text = name + if description is not None: + ET.SubElement(create_tag_key, "description").text = description + ET.SubElement(create_tag_key, "valueRequired").text = str(value_required).lower() + ET.SubElement(create_tag_key, "displayOnReport").text = str(display_on_report).lower() + response = self.connection.request_with_orgId_api_2( + "tag/createTagKey", method="POST", data=ET.tostring(create_tag_key) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_tag_keys(self, id=None, name=None, value_required=None, display_on_report=None): + """ + List tag keys in the Dimension Data Cloud + + :param id: Filter the list to the id of the tag key + :type id: ``str`` + + :param name: Filter the list to the name of the tag key + :type name: ``str`` + + :param value_required: Filter the list to if a value is required + for a tag key + :type value_required: ``bool`` + + :param display_on_report: Filter the list to if the tag key should + show up on usage reports + :type display_on_report: ``bool`` + + :rtype: ``list`` of :class:`DimensionDataTagKey` + """ + params = {} + if id is not None: + params["id"] = id + if name is not None: + params["name"] = name + if value_required is not None: + params["valueRequired"] = str(value_required).lower() + if display_on_report is not None: + params["displayOnReport"] = str(display_on_report).lower() + + paged_result = self.connection.paginated_request_with_orgId_api_2( + "tag/tagKey", method="GET", params=params + ) + + tag_keys = [] + for result in paged_result: + tag_keys.extend(self._to_tag_keys(result)) + return tag_keys + + def ex_get_tag_key_by_id(self, id): + """ + Get a specific tag key by ID + + :param id: ID of the tag key you want (required) + :type id: ``str`` + + :rtype: :class:`DimensionDataTagKey` + """ + tag_key = self.connection.request_with_orgId_api_2("tag/tagKey/%s" % id).object + return self._to_tag_key(tag_key) + + def ex_get_tag_key_by_name(self, name): + """ + Get a specific tag key by Name + + :param name: Name of the tag key you want (required) + :type name: ``str`` + + :rtype: :class:`DimensionDataTagKey` + """ + tag_keys = self.ex_list_tag_keys(name=name) + if len(tag_keys) != 1: + raise ValueError("No tags found with name %s" % name) + return tag_keys[0] + + def ex_modify_tag_key( + self, + tag_key, + name=None, + description=None, + value_required=None, + display_on_report=None, + ): + """ + Modify a specific tag key + + :param tag_key: The tag key you want to modify (required) + :type tag_key: :class:`DimensionDataTagKey` or ``str`` + + :param name: Set to modify the name of the tag key + :type name: ``str`` + + :param description: Set to modify the description of the tag key + :type description: ``str`` + + :param value_required: Set to modify if a value is required for + the tag key + :type value_required: ``bool`` + + :param display_on_report: Set to modify if this tag key should display + on the usage reports + :type display_on_report: ``bool`` + + :rtype: ``bool`` + """ + tag_key_id = self._tag_key_to_tag_key_id(tag_key) + modify_tag_key = ET.Element("editTagKey", {"xmlns": TYPES_URN, "id": tag_key_id}) + if name is not None: + ET.SubElement(modify_tag_key, "name").text = name + if description is not None: + ET.SubElement(modify_tag_key, "description").text = description + if value_required is not None: + ET.SubElement(modify_tag_key, "valueRequired").text = str(value_required).lower() + if display_on_report is not None: + ET.SubElement(modify_tag_key, "displayOnReport").text = str(display_on_report).lower() + + response = self.connection.request_with_orgId_api_2( + "tag/editTagKey", method="POST", data=ET.tostring(modify_tag_key) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_remove_tag_key(self, tag_key): + """ + Modify a specific tag key + + :param tag_key: The tag key you want to remove (required) + :type tag_key: :class:`DimensionDataTagKey` or ``str`` + + :rtype: ``bool`` + """ + tag_key_id = self._tag_key_to_tag_key_id(tag_key) + remove_tag_key = ET.Element("deleteTagKey", {"xmlns": TYPES_URN, "id": tag_key_id}) + response = self.connection.request_with_orgId_api_2( + "tag/deleteTagKey", method="POST", data=ET.tostring(remove_tag_key) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_apply_tag_to_asset(self, asset, tag_key, value=None): + """ + Apply a tag to a Dimension Data Asset + + :param asset: The asset to apply a tag to. (required) + :type asset: :class:`Node` or :class:`NodeImage` or + :class:`DimensionDataNewtorkDomain` or + :class:`DimensionDataVlan` or + :class:`DimensionDataPublicIpBlock` + + :param tag_key: The tag_key to apply to the asset. (required) + :type tag_key: :class:`DimensionDataTagKey` or ``str`` + + :param value: The value to be assigned to the tag key + This is only required if the :class:`DimensionDataTagKey` + requires it + :type value: ``str`` + + :rtype: ``bool`` + """ + asset_type = self._get_tagging_asset_type(asset) + tag_key_name = self._tag_key_to_tag_key_name(tag_key) + + apply_tags = ET.Element("applyTags", {"xmlns": TYPES_URN}) + ET.SubElement(apply_tags, "assetType").text = asset_type + ET.SubElement(apply_tags, "assetId").text = asset.id + + tag_ele = ET.SubElement(apply_tags, "tag") + ET.SubElement(tag_ele, "tagKeyName").text = tag_key_name + if value is not None: + ET.SubElement(tag_ele, "value").text = value + + response = self.connection.request_with_orgId_api_2( + "tag/applyTags", method="POST", data=ET.tostring(apply_tags) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_remove_tag_from_asset(self, asset, tag_key): + """ + Remove a tag from an asset + + :param asset: The asset to remove a tag from. (required) + :type asset: :class:`Node` or :class:`NodeImage` or + :class:`DimensionDataNewtorkDomain` or + :class:`DimensionDataVlan` or + :class:`DimensionDataPublicIpBlock` + + :param tag_key: The tag key you want to remove (required) + :type tag_key: :class:`DimensionDataTagKey` or ``str`` + + :rtype: ``bool`` + """ + asset_type = self._get_tagging_asset_type(asset) + tag_key_name = self._tag_key_to_tag_key_name(tag_key) + + apply_tags = ET.Element("removeTags", {"xmlns": TYPES_URN}) + ET.SubElement(apply_tags, "assetType").text = asset_type + ET.SubElement(apply_tags, "assetId").text = asset.id + ET.SubElement(apply_tags, "tagKeyName").text = tag_key_name + response = self.connection.request_with_orgId_api_2( + "tag/removeTags", method="POST", data=ET.tostring(apply_tags) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_tags( + self, + asset_id=None, + asset_type=None, + location=None, + tag_key_name=None, + tag_key_id=None, + value=None, + value_required=None, + display_on_report=None, + ): + """ + List tags in the Dimension Data Cloud + + :param asset_id: Filter the list by asset id + :type asset_id: ``str`` + + :param asset_type: Filter the list by asset type + :type asset_type: ``str`` + + :param location: Filter the list by the assets location + :type location: :class:``NodeLocation`` or ``str`` + + :param tag_key_name: Filter the list by a tag key name + :type tag_key_name: ``str`` + + :param tag_key_id: Filter the list by a tag key id + :type tag_key_id: ``str`` + + :param value: Filter the list by a tag value + :type value: ``str`` + + :param value_required: Filter the list to if a value is required + for a tag + :type value_required: ``bool`` + + :param display_on_report: Filter the list to if the tag should + show up on usage reports + :type display_on_report: ``bool`` + + :rtype: ``list`` of :class:`DimensionDataTag` + """ + params = {} + if asset_id is not None: + params["assetId"] = asset_id + if asset_type is not None: + params["assetType"] = asset_type + if location is not None: + params["datacenterId"] = self._location_to_location_id(location) + if tag_key_name is not None: + params["tagKeyName"] = tag_key_name + if tag_key_id is not None: + params["tagKeyId"] = tag_key_id + if value is not None: + params["value"] = value + if value_required is not None: + params["valueRequired"] = str(value_required).lower() + if display_on_report is not None: + params["displayOnReport"] = str(display_on_report).lower() + + paged_result = self.connection.paginated_request_with_orgId_api_2( + "tag/tag", method="GET", params=params + ) + + tags = [] + for result in paged_result: + tags.extend(self._to_tags(result)) + return tags + + def ex_summary_usage_report(self, start_date, end_date): + """ + Get summary usage information + + :param start_date: Start date for the report + :type start_date: ``str`` in format YYYY-MM-DD + + :param end_date: End date for the report + :type end_date: ``str`` in format YYYY-MM-DD + + :rtype: ``list`` of ``list`` + """ + result = self.connection.raw_request_with_orgId_api_1( + "report/usage?startDate={}&endDate={}".format(start_date, end_date) + ) + return self._format_csv(result.response) + + def ex_detailed_usage_report(self, start_date, end_date): + """ + Get detailed usage information + + :param start_date: Start date for the report + :type start_date: ``str`` in format YYYY-MM-DD + + :param end_date: End date for the report + :type end_date: ``str`` in format YYYY-MM-DD + + :rtype: ``list`` of ``list`` + """ + result = self.connection.raw_request_with_orgId_api_1( + "report/usageDetailed?startDate={}&endDate={}".format(start_date, end_date) + ) + return self._format_csv(result.response) + + def ex_software_usage_report(self, start_date, end_date): + """ + Get detailed software usage reports + + :param start_date: Start date for the report + :type start_date: ``str`` in format YYYY-MM-DD + + :param end_date: End date for the report + :type end_date: ``str`` in format YYYY-MM-DD + + :rtype: ``list`` of ``list`` + """ + result = self.connection.raw_request_with_orgId_api_1( + "report/usageSoftwareUnits?startDate={}&endDate={}".format(start_date, end_date) + ) + return self._format_csv(result.response) + + def ex_audit_log_report(self, start_date, end_date): + """ + Get audit log report + + :param start_date: Start date for the report + :type start_date: ``str`` in format YYYY-MM-DD + + :param end_date: End date for the report + :type end_date: ``str`` in format YYYY-MM-DD + + :rtype: ``list`` of ``list`` + """ + result = self.connection.raw_request_with_orgId_api_1( + "auditlog?startDate={}&endDate={}".format(start_date, end_date) + ) + return self._format_csv(result.response) + + def ex_backup_usage_report(self, start_date, end_date, location): + """ + Get audit log report + + :param start_date: Start date for the report + :type start_date: ``str`` in format YYYY-MM-DD + + :param end_date: End date for the report + :type end_date: ``str`` in format YYYY-MM-DD + + :keyword location: Filters the node list to nodes that are + located in this location + :type location: :class:`NodeLocation` or ``str`` + + :rtype: ``list`` of ``list`` + """ + datacenter_id = self._location_to_location_id(location) + result = self.connection.raw_request_with_orgId_api_1( + "backup/detailedUsageReport?datacenterId=%s&fromDate=%s&toDate=%s" + % (datacenter_id, start_date, end_date) + ) + return self._format_csv(result.response) + + def ex_list_ip_address_list(self, ex_network_domain): + """ + List IP Address List by network domain ID specified + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + networkDomainName][0] + >>> + >>> # List IP Address List of network domain + >>> ipaddresslist_list = driver.ex_list_ip_address_list( + >>> ex_network_domain=my_network_domain) + >>> pprint(ipaddresslist_list) + + :param ex_network_domain: The network domain or network domain ID + :type ex_network_domain: :class:`DimensionDataNetworkDomain` or 'str' + + :return: a list of DimensionDataIpAddressList objects + :rtype: ``list`` of :class:`DimensionDataIpAddressList` + """ + params = {"networkDomainId": self._network_domain_to_network_domain_id(ex_network_domain)} + response = self.connection.request_with_orgId_api_2( + "network/ipAddressList", params=params + ).object + return self._to_ip_address_lists(response) + + def ex_get_ip_address_list(self, ex_network_domain, ex_ip_address_list_name): + """ + Get IP Address List by name in network domain specified + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + networkDomainName][0] + >>> + >>> # Get IP Address List by Name + >>> ipaddresslist_list_by_name = driver.ex_get_ip_address_list( + >>> ex_network_domain=my_network_domain, + >>> ex_ip_address_list_name='My_IP_AddressList_1') + >>> pprint(ipaddresslist_list_by_name) + + + :param ex_network_domain: (required) The network domain or network + domain ID in which ipaddresslist resides. + :type ex_network_domain: :class:`DimensionDataNetworkDomain` or 'str' + + :param ex_ip_address_list_name: (required) Get 'IP Address List' by + name + :type ex_ip_address_list_name: :``str`` + + :return: a list of DimensionDataIpAddressList objects + :rtype: ``list`` of :class:`DimensionDataIpAddressList` + """ + + ip_address_lists = self.ex_list_ip_address_list(ex_network_domain) + return list(filter(lambda x: x.name == ex_ip_address_list_name, ip_address_lists)) + + def ex_create_ip_address_list( + self, + ex_network_domain, + name, + description, + ip_version, + ip_address_collection, + child_ip_address_list=None, + ): + """ + Create IP Address List. IP Address list. + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> from libcloud.common.dimensiondata import DimensionDataIpAddress + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + networkDomainName][0] + >>> + >>> # IP Address collection + >>> ipAddress_1 = DimensionDataIpAddress(begin='190.2.2.100') + >>> ipAddress_2 = DimensionDataIpAddress(begin='190.2.2.106', + end='190.2.2.108') + >>> ipAddress_3 = DimensionDataIpAddress(begin='190.2.2.0', + prefix_size='24') + >>> ip_address_collection = [ipAddress_1, ipAddress_2, ipAddress_3] + >>> + >>> # Create IPAddressList + >>> result = driver.ex_create_ip_address_list( + >>> ex_network_domain=my_network_domain, + >>> name='My_IP_AddressList_2', + >>> ip_version='IPV4', + >>> description='Test only', + >>> ip_address_collection=ip_address_collection, + >>> child_ip_address_list='08468e26-eeb3-4c3d-8ff2-5351fa6d8a04' + >>> ) + >>> + >>> pprint(result) + + + :param ex_network_domain: The network domain or network domain ID + :type ex_network_domain: :class:`DimensionDataNetworkDomain` or 'str' + + :param name: IP Address List Name (required) + :type name: :``str`` + + :param description: IP Address List Description (optional) + :type description: :``str`` + + :param ip_version: IP Version of ip address (required) + :type ip_version: :``str`` + + :param ip_address_collection: List of IP Address. At least one + ipAddress element or one + childIpAddressListId element must + be provided. + :type ip_address_collection: :``str`` + + :param child_ip_address_list: Child IP Address List or id to be + included in this IP Address List. + At least one ipAddress or + one childIpAddressListId + must be provided. + :type child_ip_address_list: + :class:'DimensionDataChildIpAddressList` or `str`` + + :return: a list of DimensionDataIpAddressList objects + :rtype: ``list`` of :class:`DimensionDataIpAddressList` + """ + if ip_address_collection is None and child_ip_address_list is None: + raise ValueError( + "At least one ipAddress element or one " + "childIpAddressListId element must be " + "provided." + ) + + create_ip_address_list = ET.Element("createIpAddressList", {"xmlns": TYPES_URN}) + ET.SubElement(create_ip_address_list, "networkDomainId").text = ( + self._network_domain_to_network_domain_id(ex_network_domain) + ) + + ET.SubElement(create_ip_address_list, "name").text = name + + ET.SubElement(create_ip_address_list, "description").text = description + + ET.SubElement(create_ip_address_list, "ipVersion").text = ip_version + + for ip in ip_address_collection: + ip_address = ET.SubElement( + create_ip_address_list, + "ipAddress", + ) + ip_address.set("begin", ip.begin) + + if ip.end: + ip_address.set("end", ip.end) + + if ip.prefix_size: + ip_address.set("prefixSize", ip.prefix_size) + + if child_ip_address_list is not None: + ET.SubElement(create_ip_address_list, "childIpAddressListId").text = ( + self._child_ip_address_list_to_child_ip_address_list_id(child_ip_address_list) + ) + + response = self.connection.request_with_orgId_api_2( + "network/createIpAddressList", + method="POST", + data=ET.tostring(create_ip_address_list), + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_edit_ip_address_list( + self, + ex_ip_address_list, + description, + ip_address_collection, + child_ip_address_lists=None, + ): + """ + Edit IP Address List. IP Address list. + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> from libcloud.common.dimensiondata import DimensionDataIpAddress + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # IP Address collection + >>> ipAddress_1 = DimensionDataIpAddress(begin='190.2.2.100') + >>> ipAddress_2 = DimensionDataIpAddress(begin='190.2.2.106', + >>> end='190.2.2.108') + >>> ipAddress_3 = DimensionDataIpAddress( + >>> begin='190.2.2.0', prefix_size='24') + >>> ip_address_collection = [ipAddress_1, ipAddress_2, ipAddress_3] + >>> + >>> # Edit IP Address List + >>> ip_address_list_id = '5e7c323f-c885-4e4b-9a27-94c44217dbd3' + >>> result = driver.ex_edit_ip_address_list( + >>> ex_ip_address_list=ip_address_list_id, + >>> description="Edit Test", + >>> ip_address_collection=ip_address_collection, + >>> child_ip_address_lists=None + >>> ) + >>> pprint(result) + + :param ex_ip_address_list: (required) IpAddressList object or + IpAddressList ID + :type ex_ip_address_list: :class:'DimensionDataIpAddressList' + or ``str`` + + :param description: IP Address List Description + :type description: :``str`` + + :param ip_address_collection: List of IP Address + :type ip_address_collection: ''list'' of + :class:'DimensionDataIpAddressList' + + :param child_ip_address_lists: Child IP Address List or id to be + included in this IP Address List + :type child_ip_address_lists: ``list`` of + :class:'DimensionDataChildIpAddressList' + or ``str`` + + :return: a list of DimensionDataIpAddressList objects + :rtype: ``list`` of :class:`DimensionDataIpAddressList` + """ + edit_ip_address_list = ET.Element( + "editIpAddressList", + { + "xmlns": TYPES_URN, + "id": self._ip_address_list_to_ip_address_list_id(ex_ip_address_list), + "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + }, + ) + + ET.SubElement(edit_ip_address_list, "description").text = description + + for ip in ip_address_collection: + ip_address = ET.SubElement( + edit_ip_address_list, + "ipAddress", + ) + ip_address.set("begin", ip.begin) + + if ip.end: + ip_address.set("end", ip.end) + + if ip.prefix_size: + ip_address.set("prefixSize", ip.prefix_size) + + if child_ip_address_lists is not None: + ET.SubElement(edit_ip_address_list, "childIpAddressListId").text = ( + self._child_ip_address_list_to_child_ip_address_list_id(child_ip_address_lists) + ) + else: + ET.SubElement(edit_ip_address_list, "childIpAddressListId", {"xsi:nil": "true"}) + + response = self.connection.request_with_orgId_api_2( + "network/editIpAddressList", + method="POST", + data=ET.tostring(edit_ip_address_list), + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_delete_ip_address_list(self, ex_ip_address_list): + """ + Delete IP Address List by ID + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> ip_address_list_id = '5e7c323f-c885-4e4b-9a27-94c44217dbd3' + >>> result = driver.ex_delete_ip_address_list(ip_address_list_id) + >>> pprint(result) + + :param ex_ip_address_list: IP Address List object or IP Address + List ID (required) + :type ex_ip_address_list: :class:'DimensionDataIpAddressList' + or ``str`` + + :rtype: ``bool`` + """ + + delete_ip_address_list = ET.Element( + "deleteIpAddressList", + { + "xmlns": TYPES_URN, + "id": self._ip_address_list_to_ip_address_list_id(ex_ip_address_list), + }, + ) + + response = self.connection.request_with_orgId_api_2( + "network/deleteIpAddressList", + method="POST", + data=ET.tostring(delete_ip_address_list), + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_portlist(self, ex_network_domain): + """ + List Portlist by network domain ID specified + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + >>> networkDomainName][0] + >>> + >>> # List portlist + >>> portLists = driver.ex_list_portlist( + >>> ex_network_domain=my_network_domain) + >>> pprint(portLists) + >>> + + :param ex_network_domain: The network domain or network domain ID + :type ex_network_domain: :class:`DimensionDataNetworkDomain` or 'str' + + :return: a list of DimensionDataPortList objects + :rtype: ``list`` of :class:`DimensionDataPortList` + """ + params = {"networkDomainId": self._network_domain_to_network_domain_id(ex_network_domain)} + response = self.connection.request_with_orgId_api_2( + "network/portList", params=params + ).object + return self._to_port_lists(response) + + def ex_get_portlist(self, ex_portlist_id): + """ + Get Port List + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get specific portlist by ID + >>> portlist_id = '27dd8c66-80ff-496b-9f54-2a3da2fe679e' + >>> portlist = driver.ex_get_portlist(portlist_id) + >>> pprint(portlist) + + :param ex_portlist_id: The ex_port_list or ex_port_list ID + :type ex_portlist_id: :class:`DimensionDataNetworkDomain` or 'str' + + :return: DimensionDataPortList object + :rtype: :class:`DimensionDataPort` + """ + + url_path = "network/portList/%s" % ex_portlist_id + response = self.connection.request_with_orgId_api_2(url_path).object + return self._to_port_list(response) + + def ex_create_portlist( + self, + ex_network_domain, + name, + description, + port_collection, + child_portlist_list=None, + ): + """ + Create Port List. + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> from libcloud.common.dimensiondata import DimensionDataPort + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + networkDomainName][0] + >>> + >>> # Port Collection + >>> port_1 = DimensionDataPort(begin='1000') + >>> port_2 = DimensionDataPort(begin='1001', end='1003') + >>> port_collection = [port_1, port_2] + >>> + >>> # Create Port List + >>> new_portlist = driver.ex_create_portlist( + >>> ex_network_domain=my_network_domain, + >>> name='MyPortListX', + >>> description="Test only", + >>> port_collection=port_collection, + >>> child_portlist_list={'a9cd4984-6ff5-4f93-89ff-8618ab642bb9'} + >>> ) + >>> pprint(new_portlist) + + :param ex_network_domain: (required) The network domain in + which to create PortList. Provide + networkdomain object or its id. + :type ex_network_domain: :``str`` + + :param name: Port List Name + :type name: :``str`` + + :param description: IP Address List Description + :type description: :``str`` + + :param port_collection: List of Port Address + :type port_collection: :``str`` + + :param child_portlist_list: List of Child Portlist to be + included in this Port List + :type child_portlist_list: :``str`` or ''list of + :class:'DimensionDataChildPortList' + + :return: result of operation + :rtype: ``bool`` + """ + new_port_list = ET.Element("createPortList", {"xmlns": TYPES_URN}) + ET.SubElement(new_port_list, "networkDomainId").text = ( + self._network_domain_to_network_domain_id(ex_network_domain) + ) + + ET.SubElement(new_port_list, "name").text = name + + ET.SubElement(new_port_list, "description").text = description + + for port in port_collection: + p = ET.SubElement(new_port_list, "port") + p.set("begin", port.begin) + + if port.end: + p.set("end", port.end) + + if child_portlist_list is not None: + for child in child_portlist_list: + ET.SubElement(new_port_list, "childPortListId").text = ( + self._child_port_list_to_child_port_list_id(child) + ) + + response = self.connection.request_with_orgId_api_2( + "network/createPortList", method="POST", data=ET.tostring(new_port_list) + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_edit_portlist(self, ex_portlist, description, port_collection, child_portlist_list=None): + """ + Edit Port List. + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> from libcloud.common.dimensiondata import DimensionDataPort + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Port Collection + >>> port_1 = DimensionDataPort(begin='4200') + >>> port_2 = DimensionDataPort(begin='4201', end='4210') + >>> port_collection = [port_1, port_2] + >>> + >>> # Edit Port List + >>> editPortlist = driver.ex_get_portlist( + '27dd8c66-80ff-496b-9f54-2a3da2fe679e') + >>> + >>> result = driver.ex_edit_portlist( + >>> ex_portlist=editPortlist.id, + >>> description="Make Changes in portlist", + >>> port_collection=port_collection, + >>> child_portlist_list={'a9cd4984-6ff5-4f93-89ff-8618ab642bb9'} + >>> ) + >>> pprint(result) + + :param ex_portlist: Port List to be edited + (required) + :type ex_portlist: :``str`` or :class:'DimensionDataPortList' + + :param description: Port List Description + :type description: :``str`` + + :param port_collection: List of Ports + :type port_collection: :``str`` + + :param child_portlist_list: Child PortList to be included in + this IP Address List + :type child_portlist_list: :``list`` of + :class'DimensionDataChildPortList' + or ''str'' + + :return: a list of DimensionDataPortList objects + :rtype: ``list`` of :class:`DimensionDataPortList` + """ + + existing_port_address_list = ET.Element( + "editPortList", + { + "id": self._port_list_to_port_list_id(ex_portlist), + "xmlns": TYPES_URN, + "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + }, + ) + + ET.SubElement(existing_port_address_list, "description").text = description + + for port in port_collection: + p = ET.SubElement(existing_port_address_list, "port") + p.set("begin", port.begin) + + if port.end: + p.set("end", port.end) + + if child_portlist_list is not None: + for child in child_portlist_list: + ET.SubElement(existing_port_address_list, "childPortListId").text = ( + self._child_port_list_to_child_port_list_id(child) + ) + else: + ET.SubElement(existing_port_address_list, "childPortListId", {"xsi:nil": "true"}) + + response = self.connection.request_with_orgId_api_2( + "network/editPortList", + method="POST", + data=ET.tostring(existing_port_address_list), + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_delete_portlist(self, ex_portlist): + """ + Delete Port List + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get dimension data driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.DIMENSIONDATA) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Delete Port List + >>> portlist_id = '157531ce-77d4-493c-866b-d3d3fc4a912a' + >>> response = driver.ex_delete_portlist(portlist_id) + >>> pprint(response) + + :param ex_portlist: Port List to be deleted + :type ex_portlist: :``str`` or :class:'DimensionDataPortList' + + :rtype: ``bool`` + """ + + delete_port_list = ET.Element( + "deletePortList", + {"xmlns": TYPES_URN, "id": self._port_list_to_port_list_id(ex_portlist)}, + ) + + response = self.connection.request_with_orgId_api_2( + "network/deletePortList", method="POST", data=ET.tostring(delete_port_list) + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_exchange_nic_vlans(self, nic_id_1, nic_id_2): + """ + Exchange NIC Vlans + + :param nic_id_1: Nic ID 1 + :type nic_id_1: :``str`` + + :param nic_id_2: Nic ID 2 + :type nic_id_2: :``str`` + + :rtype: ``bool`` + """ + + exchange_elem = ET.Element("urn:exchangeNicVlans", {"xmlns:urn": TYPES_URN}) + + ET.SubElement(exchange_elem, "urn:nicId1").text = nic_id_1 + ET.SubElement(exchange_elem, "urn:nicId2").text = nic_id_2 + + response = self.connection.request_with_orgId_api_2( + "server/exchangeNicVlans", method="POST", data=ET.tostring(exchange_elem) + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_change_nic_network_adapter(self, nic_id, network_adapter_name): + """ + Change network adapter of a NIC on a cloud server + + :param nic_id: Nic ID + :type nic_id: :``str`` + + :param network_adapter_name: Network adapter name + :type network_adapter_name: :``str`` + + :rtype: ``bool`` + """ + + change_elem = ET.Element("changeNetworkAdapter", {"nicId": nic_id, "xmlns": TYPES_URN}) + + ET.SubElement(change_elem, "networkAdapter").text = network_adapter_name + + response = self.connection.request_with_orgId_api_2( + "server/changeNetworkAdapter", method="POST", data=ET.tostring(change_elem) + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_create_node_uncustomized( + self, + name, + image, + ex_network_domain, + ex_is_started=True, + ex_description=None, + ex_cluster_id=None, + ex_cpu_specification=None, + ex_memory_gb=None, + ex_primary_nic_private_ipv4=None, + ex_primary_nic_vlan=None, + ex_primary_nic_network_adapter=None, + ex_additional_nics=None, + ex_disks=None, + ex_tagid_value_pairs=None, + ex_tagname_value_pairs=None, + ): + """ + This MCP 2.0 only function deploys a new Cloud Server from a + CloudControl compatible Server Image, which does not utilize + VMware Guest OS Customization process. + + Create Node in MCP2 Data Center + + :keyword name: (required) String with a name for this new node + :type name: ``str`` + + :keyword image: (UUID of the Server Image being used as the target + for the new Server deployment. The source Server + Image (OS Image or Customer Image) must have + osCustomization set to true. See Get/List OS + Image(s) and Get/List Customer Image(s). + :type image: :class:`NodeImage` or ``str`` + + + :keyword ex_network_domain: (required) Network Domain or Network + Domain ID to create the node + :type ex_network_domain: :class:`DimensionDataNetworkDomain` + or ``str`` + + :keyword ex_description: (optional) description for this node + :type ex_description: ``str`` + + :keyword ex_cluster_id: (optional) For multiple cluster + environments, it is possible to set a destination cluster for the new + Customer Image. Note that performance of this function is optimal when + either the Server cluster and destination are the same or when shared + data storage is in place for the multiple clusters. + :type ex_cluster_id: ``str`` + + + :keyword ex_primary_nic_private_ipv4: Provide private IPv4. Ignore + if ex_primary_nic_vlan is + provided. Use one or the + other. Not both. + :type ex_primary_nic_private_ipv4: :``str`` + + :keyword ex_primary_nic_vlan: Provide VLAN for the node if + ex_primary_nic_private_ipv4 NOT + provided. One or the other. Not both. + :type ex_primary_nic_vlan: :class: DimensionDataVlan or ``str`` + + :keyword ex_primary_nic_network_adapter: (Optional) Default value + for the Operating System + will be used if leave + empty. Example: "E1000". + :type ex_primary_nic_network_adapter: :``str`` + + :keyword ex_additional_nics: (optional) List + :class:'DimensionDataNic' or None + :type ex_additional_nics: ``list`` of :class:'DimensionDataNic' + or ``str`` + + :keyword ex_memory_gb: (optional) The amount of memory in GB for + the server Can be used to override the + memory value inherited from the source + Server Image. + :type ex_memory_gb: ``int`` + + :keyword ex_cpu_specification: (optional) The spec of CPU to deploy + :type ex_cpu_specification: + :class:`DimensionDataServerCpuSpecification` + + :keyword ex_is_started: (required) Start server after creation. + Default is set to true. + :type ex_is_started: ``bool`` + + :keyword ex_disks: (optional) Dimensiondata disks. Optional disk + elements can be used to define the disk speed + that each disk on the Server; inherited from the + source Server Image will be deployed to. It is + not necessary to include a diskelement for every + disk; only those that you wish to set a disk + speed value for. Note that scsiId 7 cannot be + used.Up to 13 disks can be present in addition to + the required OS disk on SCSI ID 0. Refer to + https://docs.mcp-services.net/x/UwIu for disk + + :type ex_disks: List or tuple of :class:'DimensionDataServerDisk` + + :keyword ex_tagid_value_pairs: + (Optional) up to 10 tag elements may be provided. + A combination of tagById and tag name cannot be + supplied in the same request. + Note: ex_tagid_value_pairs and + ex_tagname_value_pairs is + mutually exclusive. Use one or other. + + :type ex_tagname_value_pairs: ``dict``. Value can be None. + + :keyword ex_tagname_value_pairs: + (Optional) up to 10 tag elements may be provided. + A combination of tagById and tag name cannot be + supplied in the same request. + Note: ex_tagid_value_pairs and + ex_tagname_value_pairs is + mutually exclusive. Use one or other. + + :type ex_tagname_value_pairs: ``dict```. + + :return: The newly created :class:`Node`. + :rtype: :class:`Node` + """ + + # Unsupported for version lower than 2.4 + if LooseVersion(self.connection.active_api_version) < LooseVersion("2.4"): + raise Exception("This feature is NOT supported in " "earlier api version of 2.4") + + # Default start to true if input is invalid + if not isinstance(ex_is_started, bool): + ex_is_started = True + print("Warning: ex_is_started input value is invalid. Default" "to True") + + server_uncustomized_elm = ET.Element("deployUncustomizedServer", {"xmlns": TYPES_URN}) + ET.SubElement(server_uncustomized_elm, "name").text = name + ET.SubElement(server_uncustomized_elm, "description").text = ex_description + image_id = self._image_to_image_id(image) + ET.SubElement(server_uncustomized_elm, "imageId").text = image_id + + if ex_cluster_id: + dns_elm = ET.SubElement(server_uncustomized_elm, "primaryDns") + dns_elm.text = ex_cluster_id + + if ex_is_started is not None: + ET.SubElement(server_uncustomized_elm, "start").text = str(ex_is_started).lower() + + if ex_cpu_specification is not None: + cpu = ET.SubElement(server_uncustomized_elm, "cpu") + cpu.set("speed", ex_cpu_specification.performance) + cpu.set("count", str(ex_cpu_specification.cpu_count)) + cpu.set("coresPerSocket", str(ex_cpu_specification.cores_per_socket)) + + if ex_memory_gb is not None: + ET.SubElement(server_uncustomized_elm, "memoryGb").text = str(ex_memory_gb) + + if ex_primary_nic_private_ipv4 is None and ex_primary_nic_vlan is None: + raise ValueError( + "Missing argument. Either " + "ex_primary_nic_private_ipv4 or " + "ex_primary_nic_vlan " + "must be specified." + ) + + if ex_primary_nic_private_ipv4 is not None and ex_primary_nic_vlan is not None: + raise ValueError( + "Either ex_primary_nic_private_ipv4 or " + "ex_primary_nic_vlan " + "be specified. Not both." + ) + + network_elm = ET.SubElement(server_uncustomized_elm, "networkInfo") + + net_domain_id = self._network_domain_to_network_domain_id(ex_network_domain) + network_elm.set("networkDomainId", net_domain_id) + + pri_nic = ET.SubElement(network_elm, "primaryNic") + + if ex_primary_nic_private_ipv4 is not None: + ET.SubElement(pri_nic, "privateIpv4").text = ex_primary_nic_private_ipv4 + + if ex_primary_nic_vlan is not None: + vlan_id = self._vlan_to_vlan_id(ex_primary_nic_vlan) + ET.SubElement(pri_nic, "vlanId").text = vlan_id + + if ex_primary_nic_network_adapter is not None: + ET.SubElement(pri_nic, "networkAdapter").text = ex_primary_nic_network_adapter + + if isinstance(ex_additional_nics, (list, tuple)): + for nic in ex_additional_nics: + additional_nic = ET.SubElement(network_elm, "additionalNic") + + if nic.private_ip_v4 is None and nic.vlan is None: + raise ValueError( + "Either a vlan or private_ip_v4 " + "must be specified for each " + "additional nic." + ) + + if nic.private_ip_v4 is not None and nic.vlan is not None: + raise ValueError( + "Either a vlan or private_ip_v4 " + "must be specified for each " + "additional nic. Not both." + ) + + if nic.private_ip_v4 is not None: + ET.SubElement(additional_nic, "privateIpv4").text = nic.private_ip_v4 + + if nic.vlan is not None: + vlan_id = self._vlan_to_vlan_id(nic.vlan) + ET.SubElement(additional_nic, "vlanId").text = vlan_id + + if nic.network_adapter_name is not None: + ET.SubElement(additional_nic, "networkAdapter").text = nic.network_adapter_name + elif ex_additional_nics is not None: + raise TypeError("ex_additional_NICs must be None or tuple/list") + + if isinstance(ex_disks, (list, tuple)): + for disk in ex_disks: + disk_elm = ET.SubElement(server_uncustomized_elm, "disk") + disk_elm.set("scsiId", disk.scsi_id) + disk_elm.set("speed", disk.speed) + elif ex_disks is not None: + raise TypeError("ex_disks must be None or tuple/list") + + # tagid and tagname value pair should not co-exists + if ex_tagid_value_pairs is not None and ex_tagname_value_pairs is not None: + raise ValueError( + "ex_tagid_value_pairs and ex_tagname_value_pairs" + "is mutually exclusive. Use one or the other." + ) + + # Tag by ID + if ex_tagid_value_pairs is not None: + if not isinstance(ex_tagid_value_pairs, dict): + raise ValueError("ex_tagid_value_pairs must be a dictionary.") + + for k, v in ex_tagid_value_pairs.items(): + tag_elem = ET.SubElement(server_uncustomized_elm, "tagById") + ET.SubElement(tag_elem, "tagKeyId").text = k + + if v is not None: + ET.SubElement(tag_elem, "value").text = v + + if ex_tagname_value_pairs is not None: + if not isinstance(ex_tagname_value_pairs, dict): + raise ValueError("ex_tagname_value_pairs must be a dictionary") + + for k, v in ex_tagname_value_pairs.items(): + tag_name_elem = ET.SubElement(server_uncustomized_elm, "tag") + ET.SubElement(tag_name_elem, "tagKeyName").text = k + + if v is not None: + ET.SubElement(tag_name_elem, "value").text = v + + response = self.connection.request_with_orgId_api_2( + "server/deployUncustomizedServer", + method="POST", + data=ET.tostring(server_uncustomized_elm), + ).object + + node_id = None + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "serverId": + node_id = info.get("value") + + new_node = self.ex_get_node_by_id(node_id) + + return new_node + + def _format_csv(self, http_response): + text = http_response.read() + lines = str.splitlines(ensure_string(text)) + return [line.split(",") for line in lines] + + @staticmethod + def _get_tagging_asset_type(asset): + objecttype = type(asset) + if objecttype.__name__ in OBJECT_TO_TAGGING_ASSET_TYPE_MAP: + return OBJECT_TO_TAGGING_ASSET_TYPE_MAP[objecttype.__name__] + raise TypeError("Asset type %s cannot be tagged" % objecttype.__name__) + + def _list_nodes_single_page(self, params={}): + nodes = self.connection.request_with_orgId_api_2("server/server", params=params).object + return nodes + + def _to_tags(self, object): + tags = [] + for element in object.findall(fixxpath("tag", TYPES_URN)): + tags.append(self._to_tag(element)) + return tags + + def _to_tag(self, element): + tag_key = self._to_tag_key(element, from_tag_api=True) + return DimensionDataTag( + asset_type=findtext(element, "assetType", TYPES_URN), + asset_id=findtext(element, "assetId", TYPES_URN), + asset_name=findtext(element, "assetName", TYPES_URN), + datacenter=findtext(element, "datacenterId", TYPES_URN), + key=tag_key, + value=findtext(element, "value", TYPES_URN), + ) + + def _to_tag_keys(self, object): + keys = [] + for element in object.findall(fixxpath("tagKey", TYPES_URN)): + keys.append(self._to_tag_key(element)) + return keys + + def _to_tag_key(self, element, from_tag_api=False): + if from_tag_api: + id = findtext(element, "tagKeyId", TYPES_URN) + name = findtext(element, "tagKeyName", TYPES_URN) + else: + id = element.get("id") + name = findtext(element, "name", TYPES_URN) + + return DimensionDataTagKey( + id=id, + name=name, + description=findtext(element, "description", TYPES_URN), + value_required=self._str2bool(findtext(element, "valueRequired", TYPES_URN)), + display_on_report=self._str2bool(findtext(element, "displayOnReport", TYPES_URN)), + ) + + def _to_images(self, object, el_name="osImage"): + images = [] + locations = self.list_locations() + + # The CloudControl API will return all images + # in the current geographic region (even ones in + # datacenters the user's organisation does not have access to) + # + # We therefore need to filter out those images (since we can't + # get a NodeLocation for them) + location_ids = {location.id for location in locations} + + for element in object.findall(fixxpath(el_name, TYPES_URN)): + location_id = element.get("datacenterId") + if location_id in location_ids: + images.append(self._to_image(element, locations)) + + return images + + def _to_image(self, element, locations=None): + location_id = element.get("datacenterId") + if locations is None: + locations = self.list_locations(location_id) + + location = [loc for loc in locations if loc.id == location_id][0] + cpu_spec = self._to_cpu_spec(element.find(fixxpath("cpu", TYPES_URN))) + + if LooseVersion(self.connection.active_api_version) > LooseVersion("2.3"): + os_el = element.find(fixxpath("guest/operatingSystem", TYPES_URN)) + else: + os_el = element.find(fixxpath("operatingSystem", TYPES_URN)) + + if element.tag.endswith("customerImage"): + is_customer_image = True + else: + is_customer_image = False + extra = { + "description": findtext(element, "description", TYPES_URN), + "OS_type": os_el.get("family"), + "OS_displayName": os_el.get("displayName"), + "cpu": cpu_spec, + "memoryGb": findtext(element, "memoryGb", TYPES_URN), + "osImageKey": findtext(element, "osImageKey", TYPES_URN), + "created": findtext(element, "createTime", TYPES_URN), + "location": location, + "isCustomerImage": is_customer_image, + } + + return NodeImage( + id=element.get("id"), + name=str(findtext(element, "name", TYPES_URN)), + extra=extra, + driver=self.connection.driver, + ) + + def _to_nat_rules(self, object, network_domain): + rules = [] + for element in findall(object, "natRule", TYPES_URN): + rules.append(self._to_nat_rule(element, network_domain)) + + return rules + + def _to_nat_rule(self, element, network_domain): + return DimensionDataNatRule( + id=element.get("id"), + network_domain=network_domain, + internal_ip=findtext(element, "internalIp", TYPES_URN), + external_ip=findtext(element, "externalIp", TYPES_URN), + status=findtext(element, "state", TYPES_URN), + ) + + def _to_anti_affinity_rules(self, object): + rules = [] + for element in findall(object, "antiAffinityRule", TYPES_URN): + rules.append(self._to_anti_affinity_rule(element)) + return rules + + def _to_anti_affinity_rule(self, element): + node_list = [] + for node in findall(element, "serverSummary", TYPES_URN): + node_list.append(node.get("id")) + return DimensionDataAntiAffinityRule(id=element.get("id"), node_list=node_list) + + def _to_firewall_rules(self, object, network_domain): + rules = [] + locations = self.list_locations() + for element in findall(object, "firewallRule", TYPES_URN): + rules.append(self._to_firewall_rule(element, locations, network_domain)) + + return rules + + def _to_firewall_rule(self, element, locations, network_domain): + location_id = element.get("datacenterId") + location = list(filter(lambda x: x.id == location_id, locations))[0] + + return DimensionDataFirewallRule( + id=element.get("id"), + network_domain=network_domain, + name=findtext(element, "name", TYPES_URN), + action=findtext(element, "action", TYPES_URN), + ip_version=findtext(element, "ipVersion", TYPES_URN), + protocol=findtext(element, "protocol", TYPES_URN), + enabled=findtext(element, "enabled", TYPES_URN), + source=self._to_firewall_address(element.find(fixxpath("source", TYPES_URN))), + destination=self._to_firewall_address(element.find(fixxpath("destination", TYPES_URN))), + location=location, + status=findtext(element, "state", TYPES_URN), + ) + + def _to_firewall_address(self, element): + ip = element.find(fixxpath("ip", TYPES_URN)) + port = element.find(fixxpath("port", TYPES_URN)) + port_list = element.find(fixxpath("portList", TYPES_URN)) + address_list = element.find(fixxpath("ipAddressList", TYPES_URN)) + if address_list is None: + return DimensionDataFirewallAddress( + any_ip=ip.get("address") == "ANY", + ip_address=ip.get("address"), + ip_prefix_size=ip.get("prefixSize"), + port_begin=port.get("begin") if port is not None else None, + port_end=port.get("end") if port is not None else None, + port_list_id=port_list.get("id", None) if port_list is not None else None, + address_list_id=address_list.get("id") if address_list is not None else None, + ) + else: + return DimensionDataFirewallAddress( + any_ip=False, + ip_address=None, + ip_prefix_size=None, + port_begin=None, + port_end=None, + port_list_id=port_list.get("id", None) if port_list is not None else None, + address_list_id=address_list.get("id") if address_list is not None else None, + ) + + def _to_ip_blocks(self, object): + blocks = [] + locations = self.list_locations() + for element in findall(object, "publicIpBlock", TYPES_URN): + blocks.append(self._to_ip_block(element, locations)) + + return blocks + + def _to_ip_block(self, element, locations): + location_id = element.get("datacenterId") + location = list(filter(lambda x: x.id == location_id, locations))[0] + + return DimensionDataPublicIpBlock( + id=element.get("id"), + network_domain=self.ex_get_network_domain( + findtext(element, "networkDomainId", TYPES_URN) + ), + base_ip=findtext(element, "baseIp", TYPES_URN), + size=findtext(element, "size", TYPES_URN), + location=location, + status=findtext(element, "state", TYPES_URN), + ) + + def _to_networks(self, object): + networks = [] + locations = self.list_locations() + for element in findall(object, "network", NETWORK_NS): + networks.append(self._to_network(element, locations)) + + return networks + + def _to_network(self, element, locations): + multicast = False + if findtext(element, "multicast", NETWORK_NS) == "true": + multicast = True + + status = self._to_status(element.find(fixxpath("status", NETWORK_NS))) + + location_id = findtext(element, "location", NETWORK_NS) + location = list(filter(lambda x: x.id == location_id, locations))[0] + + return DimensionDataNetwork( + id=findtext(element, "id", NETWORK_NS), + name=findtext(element, "name", NETWORK_NS), + description=findtext(element, "description", NETWORK_NS), + location=location, + private_net=findtext(element, "privateNet", NETWORK_NS), + multicast=multicast, + status=status, + ) + + def _to_network_domains(self, object): + network_domains = [] + locations = self.list_locations() + for element in findall(object, "networkDomain", TYPES_URN): + network_domains.append(self._to_network_domain(element, locations)) + + return network_domains + + def _to_network_domain(self, element, locations): + location_id = element.get("datacenterId") + location = list(filter(lambda x: x.id == location_id, locations))[0] + plan = findtext(element, "type", TYPES_URN) + if plan == "ESSENTIALS": + plan_type = NetworkDomainServicePlan.ESSENTIALS + else: + plan_type = NetworkDomainServicePlan.ADVANCED + return DimensionDataNetworkDomain( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + description=findtext(element, "description", TYPES_URN), + plan=plan_type, + location=location, + status=findtext(element, "state", TYPES_URN), + ) + + def _to_vlans(self, object): + vlans = [] + locations = self.list_locations() + for element in findall(object, "vlan", TYPES_URN): + vlans.append(self._to_vlan(element, locations=locations)) + + return vlans + + def _to_vlan(self, element, locations): + location_id = element.get("datacenterId") + location = list(filter(lambda x: x.id == location_id, locations))[0] + ip_range = element.find(fixxpath("privateIpv4Range", TYPES_URN)) + ip6_range = element.find(fixxpath("ipv6Range", TYPES_URN)) + network_domain_el = element.find(fixxpath("networkDomain", TYPES_URN)) + network_domain = self.ex_get_network_domain(network_domain_el.get("id")) + return DimensionDataVlan( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + description=findtext(element, "description", TYPES_URN), + network_domain=network_domain, + private_ipv4_range_address=ip_range.get("address"), + private_ipv4_range_size=int(ip_range.get("prefixSize")), + ipv6_range_address=ip6_range.get("address"), + ipv6_range_size=int(ip6_range.get("prefixSize")), + ipv4_gateway=findtext(element, "ipv4GatewayAddress", TYPES_URN), + ipv6_gateway=findtext(element, "ipv6GatewayAddress", TYPES_URN), + location=location, + status=findtext(element, "state", TYPES_URN), + ) + + def _to_locations(self, object): + locations = [] + for element in object.findall(fixxpath("datacenter", TYPES_URN)): + locations.append(self._to_location(element)) + + return locations + + def _to_location(self, element): + loc = NodeLocation( + id=element.get("id"), + name=findtext(element, "displayName", TYPES_URN), + country=findtext(element, "country", TYPES_URN), + driver=self, + ) + return loc + + def _to_cpu_spec(self, element): + return DimensionDataServerCpuSpecification( + cpu_count=int(element.get("count")), + cores_per_socket=int(element.get("coresPerSocket")), + performance=element.get("speed"), + ) + + def _to_vmware_tools(self, element): + status = None + if hasattr(element, "runningStatus"): + status = element.get("runningStatus") + + version_status = None + if hasattr(element, "version_status"): + version_status = element.get("version_status") + + api_version = None + if hasattr(element, "apiVersion"): + api_version = element.get("apiVersion") + + return DimensionDataServerVMWareTools( + status=status, version_status=version_status, api_version=api_version + ) + + def _to_disks(self, object): + disk_elements = object.findall(fixxpath("disk", TYPES_URN)) + return [self._to_disk(el) for el in disk_elements] + + def _to_disk(self, element): + return DimensionDataServerDisk( + id=element.get("id"), + scsi_id=int(element.get("scsiId")), + size_gb=int(element.get("sizeGb")), + speed=element.get("speed"), + state=element.get("state"), + ) + + def _to_nodes(self, object): + node_elements = object.findall(fixxpath("server", TYPES_URN)) + return [self._to_node(el) for el in node_elements] + + def _to_node(self, element): + started = findtext(element, "started", TYPES_URN) + status = self._to_status(element.find(fixxpath("progress", TYPES_URN))) + dd_state = findtext(element, "state", TYPES_URN) + + node_state = self._get_node_state(dd_state, started, status.action) + + has_network_info = element.find(fixxpath("networkInfo", TYPES_URN)) is not None + cpu_spec = self._to_cpu_spec(element.find(fixxpath("cpu", TYPES_URN))) + disks = self._to_disks(element) + + # Vmware Tools + + # Version 2.3 or earlier + if LooseVersion(self.connection.active_api_version) < LooseVersion("2.4"): + vmware_tools = self._to_vmware_tools(element.find(fixxpath("vmwareTools", TYPES_URN))) + operation_system = element.find(fixxpath("operatingSystem", TYPES_URN)) + # Version 2.4 or later + else: + # vmtools_elm = fixxpath('guest/vmTools', TYPES_URN) + vmtools_elm = element.find(fixxpath("guest/vmTools", TYPES_URN)) + if vmtools_elm is not None: + vmware_tools = self._to_vmware_tools(vmtools_elm) + else: + vmware_tools = DimensionDataServerVMWareTools( + status=None, version_status=None, api_version=None + ) + operation_system = element.find(fixxpath("guest/operatingSystem", TYPES_URN)) + + extra = { + "description": findtext(element, "description", TYPES_URN), + "sourceImageId": findtext(element, "sourceImageId", TYPES_URN), + "networkId": findtext(element, "networkId", TYPES_URN), + "networkDomainId": ( + element.find(fixxpath("networkInfo", TYPES_URN)).get("networkDomainId") + if has_network_info + else None + ), + "datacenterId": element.get("datacenterId"), + "deployedTime": findtext(element, "createTime", TYPES_URN), + "cpu": cpu_spec, + "memoryMb": int(findtext(element, "memoryGb", TYPES_URN)) * 1024, + "OS_id": operation_system.get("id"), + "OS_type": operation_system.get("family"), + "OS_displayName": operation_system.get("displayName"), + "status": status, + "disks": disks, + "vmWareTools": vmware_tools, + } + + public_ip = findtext(element, "publicIpAddress", TYPES_URN) + + private_ip = ( + element.find(fixxpath("networkInfo/primaryNic", TYPES_URN)).get("privateIpv4") + if has_network_info + else element.find(fixxpath("nic", TYPES_URN)).get("privateIpv4") + ) + + extra["ipv6"] = ( + element.find(fixxpath("networkInfo/primaryNic", TYPES_URN)).get("ipv6") + if has_network_info + else element.find(fixxpath("nic", TYPES_URN)).get("ipv6") + ) + + n = Node( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + state=node_state, + public_ips=[public_ip] if public_ip is not None else [], + private_ips=[private_ip] if private_ip is not None else [], + size=self.list_sizes()[0], + image=NodeImage( + extra["sourceImageId"], extra["OS_displayName"], self.connection.driver + ), + driver=self.connection.driver, + extra=extra, + ) + return n + + def _to_status(self, element): + if element is None: + return DimensionDataStatus() + s = DimensionDataStatus( + action=findtext(element, "action", TYPES_URN), + request_time=findtext(element, "requestTime", TYPES_URN), + user_name=findtext(element, "userName", TYPES_URN), + number_of_steps=findtext(element, "numberOfSteps", TYPES_URN), + step_name=findtext(element, "step/name", TYPES_URN), + step_number=findtext(element, "step_number", TYPES_URN), + step_percent_complete=findtext(element, "step/percentComplete", TYPES_URN), + failure_reason=findtext(element, "failureReason", TYPES_URN), + ) + return s + + def _to_ip_address_lists(self, object): + ip_address_lists = [] + for element in findall(object, "ipAddressList", TYPES_URN): + ip_address_lists.append(self._to_ip_address_list(element)) + + return ip_address_lists + + def _to_ip_address_list(self, element): + ipAddresses = [] + for ip in findall(element, "ipAddress", TYPES_URN): + ipAddresses.append(self._to_ip_address(ip)) + + child_ip_address_lists = [] + for child_ip_list in findall(element, "childIpAddressList", TYPES_URN): + child_ip_address_lists.append(self._to_child_ip_list(child_ip_list)) + + return DimensionDataIpAddressList( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + description=findtext(element, "description", TYPES_URN), + ip_version=findtext(element, "ipVersion", TYPES_URN), + ip_address_collection=ipAddresses, + state=findtext(element, "state", TYPES_URN), + create_time=findtext(element, "createTime", TYPES_URN), + child_ip_address_lists=child_ip_address_lists, + ) + + def _to_child_ip_list(self, element): + return DimensionDataChildIpAddressList(id=element.get("id"), name=element.get("name")) + + def _to_ip_address(self, element): + return DimensionDataIpAddress( + begin=element.get("begin"), + end=element.get("end"), + prefix_size=element.get("prefixSize"), + ) + + def _to_port_lists(self, object): + port_lists = [] + for element in findall(object, "portList", TYPES_URN): + port_lists.append(self._to_port_list(element)) + + return port_lists + + def _to_port_list(self, element): + ports = [] + for port in findall(element, "port", TYPES_URN): + ports.append(self._to_port(element=port)) + + child_portlist_list = [] + for child in findall(element, "childPortList", TYPES_URN): + child_portlist_list.append(self._to_child_port_list(element=child)) + + return DimensionDataPortList( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + description=findtext(element, "description", TYPES_URN), + port_collection=ports, + child_portlist_list=child_portlist_list, + state=findtext(element, "state", TYPES_URN), + create_time=findtext(element, "createTime", TYPES_URN), + ) + + def _image_needs_auth(self, image): + if not isinstance(image, NodeImage): + image = self.ex_get_image_by_id(image) + if image.extra["isCustomerImage"] and image.extra["OS_type"] == "UNIX": + return False + return True + + @staticmethod + def _to_port(element): + return DimensionDataPort(begin=element.get("begin"), end=element.get("end")) + + @staticmethod + def _to_child_port_list(element): + return DimensionDataChildPortList(id=element.get("id"), name=element.get("name")) + + @staticmethod + def _get_node_state(state, started, action): + try: + return NODE_STATE_MAP[(state, started, action)] + except KeyError: + if started == "true": + return NodeState.RUNNING + else: + return NodeState.TERMINATED + + @staticmethod + def _node_to_node_id(node): + return dd_object_to_id(node, Node) + + @staticmethod + def _location_to_location_id(location): + return dd_object_to_id(location, NodeLocation) + + @staticmethod + def _vlan_to_vlan_id(vlan): + return dd_object_to_id(vlan, DimensionDataVlan) + + @staticmethod + def _image_to_image_id(image): + return dd_object_to_id(image, NodeImage) + + @staticmethod + def _network_to_network_id(network): + return dd_object_to_id(network, DimensionDataNetwork) + + @staticmethod + def _anti_affinity_rule_to_anti_affinity_rule_id(rule): + return dd_object_to_id(rule, DimensionDataAntiAffinityRule) + + @staticmethod + def _network_domain_to_network_domain_id(network_domain): + return dd_object_to_id(network_domain, DimensionDataNetworkDomain) + + @staticmethod + def _tag_key_to_tag_key_id(tag_key): + return dd_object_to_id(tag_key, DimensionDataTagKey) + + @staticmethod + def _tag_key_to_tag_key_name(tag_key): + return dd_object_to_id(tag_key, DimensionDataTagKey, id_value="name") + + @staticmethod + def _ip_address_list_to_ip_address_list_id(ip_addr_list): + return dd_object_to_id(ip_addr_list, DimensionDataIpAddressList, id_value="id") + + @staticmethod + def _child_ip_address_list_to_child_ip_address_list_id(child_ip_addr_list): + return dd_object_to_id(child_ip_addr_list, DimensionDataChildIpAddressList, id_value="id") + + @staticmethod + def _port_list_to_port_list_id(port_list): + return dd_object_to_id(port_list, DimensionDataPortList, id_value="id") + + @staticmethod + def _child_port_list_to_child_port_list_id(child_port_list): + return dd_object_to_id(child_port_list, DimensionDataChildPortList, id_value="id") + + @staticmethod + def _str2bool(string): + return string.lower() in ("true") diff --git a/libcloud/compute/drivers/dreamhost.py b/libcloud/compute/drivers/dreamhost.py deleted file mode 100644 index cba445c39f..0000000000 --- a/libcloud/compute/drivers/dreamhost.py +++ /dev/null @@ -1,242 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -DreamHost Driver -""" - -import copy - -from libcloud.common.base import ConnectionKey, JsonResponse -from libcloud.common.types import InvalidCredsError -from libcloud.compute.base import Node, NodeDriver, NodeSize -from libcloud.compute.base import NodeImage -from libcloud.compute.types import Provider, NodeState - -# DreamHost Private Servers can be resized on the fly, but Libcloud doesn't -# currently support extensions to its interface, so we'll put some basic sizes -# in for node creation. - -DH_PS_SIZES = { - 'minimum': { - 'id': 'minimum', - 'name': 'Minimum DH PS size', - 'ram': 300, - 'disk': None, - 'bandwidth': None - }, - 'maximum': { - 'id': 'maximum', - 'name': 'Maximum DH PS size', - 'ram': 4000, - 'disk': None, - 'bandwidth': None - }, - 'default': { - 'id': 'default', - 'name': 'Default DH PS size', - 'ram': 2300, - 'disk': None, - 'bandwidth': None - }, - 'low': { - 'id': 'low', - 'name': 'DH PS with 1GB RAM', - 'ram': 1000, - 'disk': None, - 'bandwidth': None - }, - 'high': { - 'id': 'high', - 'name': 'DH PS with 3GB RAM', - 'ram': 3000, - 'disk': None, - 'bandwidth': None - }, -} - - -class DreamhostAPIException(Exception): - def __str__(self): - return self.args[0] - - def __repr__(self): - return "" % (self.args[0]) - - -class DreamhostResponse(JsonResponse): - """ - Response class for DreamHost PS - """ - - def parse_body(self): - resp = super(DreamhostResponse, self).parse_body() - if resp['result'] != 'success': - raise Exception(self._api_parse_error(resp)) - return resp['data'] - - def parse_error(self): - raise Exception - - def _api_parse_error(self, response): - if 'data' in response: - if response['data'] == 'invalid_api_key': - raise InvalidCredsError( - "Oops! You've entered an invalid API key") - else: - raise DreamhostAPIException(response['data']) - else: - raise DreamhostAPIException("Unknown problem: %s" % (self.body)) - - -class DreamhostConnection(ConnectionKey): - """ - Connection class to connect to DreamHost's API servers - """ - - host = 'api.dreamhost.com' - responseCls = DreamhostResponse - format = 'json' - - def add_default_params(self, params): - """ - Add key and format parameters to the request. Eventually should add - unique_id to prevent re-execution of a single request. - """ - params['key'] = self.key - params['format'] = self.format - # params['unique_id'] = generate_unique_id() - return params - - -class DreamhostNodeDriver(NodeDriver): - """ - Node Driver for DreamHost PS - """ - type = Provider.DREAMHOST - api_name = 'dreamhost' - name = "Dreamhost" - website = 'http://dreamhost.com/' - connectionCls = DreamhostConnection - - _sizes = DH_PS_SIZES - - def create_node(self, **kwargs): - """Create a new Dreamhost node - - @inherits: :class:`NodeDriver.create_node` - - :keyword ex_movedata: Copy all your existing users to this new PS - :type ex_movedata: ``str`` - """ - size = kwargs['size'].ram - params = { - 'cmd': 'dreamhost_ps-add_ps', - 'movedata': kwargs.get('movedata', 'no'), - 'type': kwargs['image'].name, - 'size': size - } - data = self.connection.request('/', params).object - return Node( - id=data['added_web'], - name=data['added_web'], - state=NodeState.PENDING, - public_ips=[], - private_ips=[], - driver=self.connection.driver, - extra={ - 'type': kwargs['image'].name - } - ) - - def destroy_node(self, node): - params = { - 'cmd': 'dreamhost_ps-remove_ps', - 'ps': node.id - } - try: - return self.connection.request('/', params).success() - except DreamhostAPIException: - return False - - def reboot_node(self, node): - params = { - 'cmd': 'dreamhost_ps-reboot', - 'ps': node.id - } - try: - return self.connection.request('/', params).success() - except DreamhostAPIException: - return False - - def list_nodes(self, **kwargs): - data = self.connection.request( - '/', {'cmd': 'dreamhost_ps-list_ps'}).object - return [self._to_node(n) for n in data] - - def list_images(self, **kwargs): - data = self.connection.request( - '/', {'cmd': 'dreamhost_ps-list_images'}).object - images = [] - for img in data: - images.append(NodeImage( - id=img['image'], - name=img['image'], - driver=self.connection.driver - )) - return images - - def list_sizes(self, **kwargs): - sizes = [] - for key, values in self._sizes.items(): - attributes = copy.deepcopy(values) - attributes.update({'price': self._get_size_price(size_id=key)}) - sizes.append(NodeSize(driver=self.connection.driver, **attributes)) - - return sizes - - def list_locations(self, **kwargs): - raise NotImplementedError( - 'You cannot select a location for ' - 'DreamHost Private Servers at this time.') - - def _resize_node(self, node, size): - if (size < 300 or size > 4000): - return False - - params = { - 'cmd': 'dreamhost_ps-set_size', - 'ps': node.id, - 'size': size - } - try: - return self.connection.request('/', params).success() - except DreamhostAPIException: - return False - - def _to_node(self, data): - """ - Convert the data from a DreamhostResponse object into a Node - """ - return Node( - id=data['ps'], - name=data['ps'], - state=NodeState.UNKNOWN, - public_ips=[data['ip']], - private_ips=[], - driver=self.connection.driver, - extra={ - 'current_size': data['memory_mb'], - 'account_id': data['account_id'], - 'type': data['type']}) diff --git a/libcloud/compute/drivers/dummy.py b/libcloud/compute/drivers/dummy.py index 982433525b..a3fee5fd8a 100644 --- a/libcloud/compute/drivers/dummy.py +++ b/libcloud/compute/drivers/dummy.py @@ -17,14 +17,13 @@ @note: This driver is out of date """ + import uuid import socket import struct from libcloud.common.base import ConnectionKey -from libcloud.compute.base import NodeImage, NodeSize, Node -from libcloud.compute.base import NodeDriver, NodeLocation -from libcloud.compute.base import KeyPair +from libcloud.compute.base import Node, KeyPair, NodeSize, NodeImage, NodeDriver, NodeLocation from libcloud.compute.types import Provider, NodeState @@ -65,7 +64,7 @@ class DummyNodeDriver(NodeDriver): """ name = "Dummy Node Provider" - website = 'http://example.com' + website = "http://example.com" type = Provider.DUMMY def __init__(self, creds): @@ -82,34 +81,40 @@ def __init__(self, creds): num = None if num: self.nl = [] - startip = _ip_to_int('127.0.0.1') + startip = _ip_to_int("127.0.0.1") for i in range(num): ip = _int_to_ip(startip + i) self.nl.append( - Node(id=i, - name='dummy-%d' % (i), - state=NodeState.RUNNING, - public_ips=[ip], - private_ips=[], - driver=self, - extra={'foo': 'bar'}) + Node( + id=i, + name="dummy-%d" % (i), + state=NodeState.RUNNING, + public_ips=[ip], + private_ips=[], + driver=self, + extra={"foo": "bar"}, + ) ) else: self.nl = [ - Node(id=1, - name='dummy-1', - state=NodeState.RUNNING, - public_ips=['127.0.0.1'], - private_ips=[], - driver=self, - extra={'foo': 'bar'}), - Node(id=2, - name='dummy-2', - state=NodeState.RUNNING, - public_ips=['127.0.0.1'], - private_ips=[], - driver=self, - extra={'foo': 'bar'}), + Node( + id=1, + name="dummy-1", + state=NodeState.RUNNING, + public_ips=["127.0.0.1"], + private_ips=[], + driver=self, + extra={"foo": "bar"}, + ), + Node( + id=2, + name="dummy-2", + state=NodeState.RUNNING, + public_ips=["127.0.0.1"], + private_ips=[], + driver=self, + extra={"foo": "bar"}, + ), ] self.connection = DummyConnection(self.creds) @@ -234,34 +239,34 @@ def list_sizes(self, location=None): """ return [ - NodeSize(id=1, - name="Small", - ram=128, - disk=4, - bandwidth=500, - price=4, - driver=self), - NodeSize(id=2, - name="Medium", - ram=512, - disk=16, - bandwidth=1500, - price=8, - driver=self), - NodeSize(id=3, - name="Big", - ram=4096, - disk=32, - bandwidth=2500, - price=32, - driver=self), - NodeSize(id=4, - name="XXL Big", - ram=4096 * 2, - disk=32 * 4, - bandwidth=2500 * 3, - price=32 * 2, - driver=self), + NodeSize(id=1, name="Small", ram=128, disk=4, bandwidth=500, price=4, driver=self), + NodeSize( + id=2, + name="Medium", + ram=512, + disk=16, + bandwidth=1500, + price=8, + driver=self, + ), + NodeSize( + id=3, + name="Big", + ram=4096, + disk=32, + bandwidth=2500, + price=32, + driver=self, + ), + NodeSize( + id=4, + name="XXL Big", + ram=4096 * 2, + disk=32 * 4, + bandwidth=2500 * 3, + price=32 * 2, + driver=self, + ), ] def list_locations(self): @@ -277,21 +282,12 @@ def list_locations(self): @inherits: :class:`NodeDriver.list_locations` """ return [ - NodeLocation(id=1, - name="Paul's Room", - country='US', - driver=self), - NodeLocation(id=2, - name="London Loft", - country='GB', - driver=self), - NodeLocation(id=3, - name="Island Datacenter", - country='FJ', - driver=self), + NodeLocation(id=1, name="Paul's Room", country="US", driver=self), + NodeLocation(id=2, name="London Loft", country="GB", driver=self), + NodeLocation(id=3, name="Island Datacenter", country="FJ", driver=self), ] - def create_node(self, **kwargs): + def create_node(self, name, size, image, location=None, auth=None): """ Creates a dummy node; the node id is equal to the number of nodes in the node list @@ -312,36 +308,47 @@ def create_node(self, **kwargs): @inherits: :class:`NodeDriver.create_node` """ - l = len(self.nl) + 1 - n = Node(id=l, - name='dummy-%d' % l, - state=NodeState.RUNNING, - public_ips=['127.0.0.%d' % l], - private_ips=[], - driver=self, - size=NodeSize(id='s1', name='foo', ram=2048, - disk=160, bandwidth=None, price=0.0, - driver=self), - image=NodeImage(id='i2', name='image', driver=self), - extra={'foo': 'bar'}) + num = len(self.nl) + 1 + n = Node( + id=num, + name="dummy-%d" % (num), + state=NodeState.RUNNING, + public_ips=["127.0.0.%d" % (num)], + private_ips=[], + driver=self, + size=NodeSize( + id="s1", + name="foo", + ram=2048, + disk=160, + bandwidth=None, + price=0.0, + driver=self, + ), + image=NodeImage(id="i2", name="image", driver=self), + extra={"foo": "bar"}, + ) self.nl.append(n) return n def import_key_pair_from_string(self, name, key_material): - key_pair = KeyPair(name=name, - public_key=key_material, - fingerprint='fingerprint', - private_key='private_key', - driver=self) + key_pair = KeyPair( + name=name, + public_key=key_material, + fingerprint="fingerprint", + private_key="private_key", + driver=self, + ) return key_pair def _ip_to_int(ip): - return socket.htonl(struct.unpack('I', socket.inet_aton(ip))[0]) + return socket.htonl(struct.unpack("I", socket.inet_aton(ip))[0]) def _int_to_ip(ip): - return socket.inet_ntoa(struct.pack('I', socket.ntohl(ip))) + return socket.inet_ntoa(struct.pack("I", socket.ntohl(ip))) + if __name__ == "__main__": import doctest diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py index 5c4763e635..5e1f0a7a4f 100644 --- a/libcloud/compute/drivers/ec2.py +++ b/libcloud/compute/drivers/ec2.py @@ -18,1060 +18,326 @@ """ import re -import sys -import base64 import copy +import time +import base64 import warnings - -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - -from libcloud.utils.py3 import b, basestring, ensure_string - -from libcloud.utils.xml import fixxpath, findtext, findattr, findall -from libcloud.utils.publickey import get_pubkey_ssh2_fingerprint -from libcloud.utils.publickey import get_pubkey_comment -from libcloud.utils.iso8601 import parse_date -from libcloud.common.aws import AWSBaseResponse, SignedAWSConnection -from libcloud.common.aws import DEFAULT_SIGNATURE_VERSION -from libcloud.common.types import (InvalidCredsError, MalformedResponseError, - LibcloudError) +from typing import List + +from libcloud.pricing import get_size_price +from libcloud.utils.py3 import ET, b, basestring, ensure_string +from libcloud.utils.xml import findall, findattr, findtext, fixxpath +from libcloud.common.aws import DEFAULT_SIGNATURE_VERSION, AWSBaseResponse, SignedAWSConnection +from libcloud.common.types import LibcloudError, InvalidCredsError, MalformedResponseError +from libcloud.compute.base import ( + Node, + KeyPair, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, + VolumeSnapshot, +) +from libcloud.compute.types import ( + NodeState, + StorageVolumeState, + VolumeSnapshotState, + KeyPairDoesNotExistError, +) +from libcloud.utils.iso8601 import parse_date, parse_date_allow_empty +from libcloud.utils.publickey import get_pubkey_comment, get_pubkey_ssh2_fingerprint from libcloud.compute.providers import Provider -from libcloud.compute.base import Node, NodeDriver, NodeLocation, NodeSize -from libcloud.compute.base import NodeImage, StorageVolume, VolumeSnapshot -from libcloud.compute.base import KeyPair -from libcloud.compute.types import NodeState, KeyPairDoesNotExistError, \ - StorageVolumeState +from libcloud.compute.constants.ec2_region_details_partial import ( + REGION_DETAILS as REGION_DETAILS_PARTIAL, +) __all__ = [ - 'API_VERSION', - 'NAMESPACE', - 'INSTANCE_TYPES', - 'OUTSCALE_INSTANCE_TYPES', - 'OUTSCALE_SAS_REGION_DETAILS', - 'OUTSCALE_INC_REGION_DETAILS', - 'DEFAULT_EUCA_API_VERSION', - 'EUCA_NAMESPACE', - - 'EC2NodeDriver', - 'BaseEC2NodeDriver', - - 'NimbusNodeDriver', - 'EucNodeDriver', - - 'OutscaleSASNodeDriver', - 'OutscaleINCNodeDriver', - - 'EC2NodeLocation', - 'EC2ReservedNode', - 'EC2SecurityGroup', - 'EC2PlacementGroup', - 'EC2Network', - 'EC2NetworkSubnet', - 'EC2NetworkInterface', - 'EC2RouteTable', - 'EC2Route', - 'EC2SubnetAssociation', - 'ExEC2AvailabilityZone', - - 'IdempotentParamError' + "API_VERSION", + "NAMESPACE", + "OUTSCALE_INSTANCE_TYPES", + "OUTSCALE_SAS_REGION_DETAILS", + "OUTSCALE_INC_REGION_DETAILS", + "DEFAULT_EUCA_API_VERSION", + "EUCA_NAMESPACE", + "EC2NodeDriver", + "BaseEC2NodeDriver", + "NimbusNodeDriver", + "EucNodeDriver", + "OutscaleSASNodeDriver", + "OutscaleINCNodeDriver", + "EC2NodeLocation", + "EC2ReservedNode", + "EC2SecurityGroup", + "EC2ImportSnapshotTask", + "EC2PlacementGroup", + "EC2Network", + "EC2NetworkSubnet", + "EC2NetworkInterface", + "EC2RouteTable", + "EC2Route", + "EC2SubnetAssociation", + "ExEC2AvailabilityZone", + "IdempotentParamError", ] -API_VERSION = '2013-10-15' -NAMESPACE = 'http://ec2.amazonaws.com/doc/%s/' % (API_VERSION) +API_VERSION = "2016-11-15" +NAMESPACE = "http://ec2.amazonaws.com/doc/%s/" % (API_VERSION) # Eucalyptus Constants -DEFAULT_EUCA_API_VERSION = '3.3.0' -EUCA_NAMESPACE = 'http://msgs.eucalyptus.com/%s' % (DEFAULT_EUCA_API_VERSION) - -""" -Sizes must be hardcoded, because Amazon doesn't provide an API to fetch them. -From http://aws.amazon.com/ec2/instance-types/ -""" -INSTANCE_TYPES = { - 't1.micro': { - 'id': 't1.micro', - 'name': 'Micro Instance', - 'ram': 613, - 'disk': 15, - 'bandwidth': None - }, - 'm1.small': { - 'id': 'm1.small', - 'name': 'Small Instance', - 'ram': 1740, - 'disk': 160, - 'bandwidth': None - }, - 'm1.medium': { - 'id': 'm1.medium', - 'name': 'Medium Instance', - 'ram': 3700, - 'disk': 410, - 'bandwidth': None - }, - 'm1.large': { - 'id': 'm1.large', - 'name': 'Large Instance', - 'ram': 7680, - 'disk': 850, - 'bandwidth': None - }, - 'm1.xlarge': { - 'id': 'm1.xlarge', - 'name': 'Extra Large Instance', - 'ram': 15360, - 'disk': 1690, - 'bandwidth': None - }, - 'c1.medium': { - 'id': 'c1.medium', - 'name': 'High-CPU Medium Instance', - 'ram': 1740, - 'disk': 350, - 'bandwidth': None - }, - 'c1.xlarge': { - 'id': 'c1.xlarge', - 'name': 'High-CPU Extra Large Instance', - 'ram': 7680, - 'disk': 1690, - 'bandwidth': None - }, - 'm2.xlarge': { - 'id': 'm2.xlarge', - 'name': 'High-Memory Extra Large Instance', - 'ram': 17510, - 'disk': 420, - 'bandwidth': None - }, - 'm2.2xlarge': { - 'id': 'm2.2xlarge', - 'name': 'High-Memory Double Extra Large Instance', - 'ram': 35021, - 'disk': 850, - 'bandwidth': None - }, - 'm2.4xlarge': { - 'id': 'm2.4xlarge', - 'name': 'High-Memory Quadruple Extra Large Instance', - 'ram': 70042, - 'disk': 1690, - 'bandwidth': None - }, - 'm3.medium': { - 'id': 'm3.medium', - 'name': 'Medium Instance', - 'ram': 3840, - 'disk': 4000, - 'bandwidth': None - }, - 'm3.large': { - 'id': 'm3.large', - 'name': 'Large Instance', - 'ram': 7168, - 'disk': 32000, - 'bandwidth': None - }, - 'm3.xlarge': { - 'id': 'm3.xlarge', - 'name': 'Extra Large Instance', - 'ram': 15360, - 'disk': 80000, - 'bandwidth': None - }, - 'm3.2xlarge': { - 'id': 'm3.2xlarge', - 'name': 'Double Extra Large Instance', - 'ram': 30720, - 'disk': 160000, - 'bandwidth': None - }, - 'cg1.4xlarge': { - 'id': 'cg1.4xlarge', - 'name': 'Cluster GPU Quadruple Extra Large Instance', - 'ram': 22528, - 'disk': 1690, - 'bandwidth': None - }, - 'g2.2xlarge': { - 'id': 'g2.2xlarge', - 'name': 'Cluster GPU G2 Double Extra Large Instance', - 'ram': 15000, - 'disk': 60, - 'bandwidth': None, - }, - 'cc1.4xlarge': { - 'id': 'cc1.4xlarge', - 'name': 'Cluster Compute Quadruple Extra Large Instance', - 'ram': 23552, - 'disk': 1690, - 'bandwidth': None - }, - 'cc2.8xlarge': { - 'id': 'cc2.8xlarge', - 'name': 'Cluster Compute Eight Extra Large Instance', - 'ram': 63488, - 'disk': 3370, - 'bandwidth': None - }, - # c3 instances have 2 SSDs of the specified disk size - 'c3.large': { - 'id': 'c3.large', - 'name': 'Compute Optimized Large Instance', - 'ram': 3750, - 'disk': 32, # x2 - 'bandwidth': None - }, - 'c3.xlarge': { - 'id': 'c3.xlarge', - 'name': 'Compute Optimized Extra Large Instance', - 'ram': 7500, - 'disk': 80, # x2 - 'bandwidth': None - }, - 'c3.2xlarge': { - 'id': 'c3.2xlarge', - 'name': 'Compute Optimized Double Extra Large Instance', - 'ram': 15000, - 'disk': 160, # x2 - 'bandwidth': None - }, - 'c3.4xlarge': { - 'id': 'c3.4xlarge', - 'name': 'Compute Optimized Quadruple Extra Large Instance', - 'ram': 30000, - 'disk': 320, # x2 - 'bandwidth': None - }, - 'c3.8xlarge': { - 'id': 'c3.8xlarge', - 'name': 'Compute Optimized Eight Extra Large Instance', - 'ram': 60000, - 'disk': 640, # x2 - 'bandwidth': None - }, - 'cr1.8xlarge': { - 'id': 'cr1.8xlarge', - 'name': 'High Memory Cluster Eight Extra Large', - 'ram': 244000, - 'disk': 240, - 'bandwidth': None - }, - 'hs1.4xlarge': { - 'id': 'hs1.4xlarge', - 'name': 'High Storage Quadruple Extra Large Instance', - 'ram': 61952, - 'disk': 2048, - 'bandwidth': None - }, - 'hs1.8xlarge': { - 'id': 'hs1.8xlarge', - 'name': 'High Storage Eight Extra Large Instance', - 'ram': 119808, - 'disk': 48000, - 'bandwidth': None - }, - # i2 instances have up to eight SSD drives - 'i2.xlarge': { - 'id': 'i2.xlarge', - 'name': 'High Storage Optimized Extra Large Instance', - 'ram': 31232, - 'disk': 800, - 'bandwidth': None - }, - 'i2.2xlarge': { - 'id': 'i2.2xlarge', - 'name': 'High Storage Optimized Double Extra Large Instance', - 'ram': 62464, - 'disk': 1600, - 'bandwidth': None - }, - 'i2.4xlarge': { - 'id': 'i2.4xlarge', - 'name': 'High Storage Optimized Quadruple Large Instance', - 'ram': 124928, - 'disk': 3200, - 'bandwidth': None - }, - 'i2.8xlarge': { - 'id': 'i2.8xlarge', - 'name': 'High Storage Optimized Eight Extra Large Instance', - 'ram': 249856, - 'disk': 6400, - 'bandwidth': None - }, - 'd2.xlarge': { - 'id': 'd2.xlarge', - 'name': 'High Storage Optimized Extra Large Instance', - 'ram': 30050, - 'disk': 6000, # 3 x 2 TB - 'bandwidth': None - }, - 'd2.2xlarge': { - 'id': 'd2.2xlarge', - 'name': 'High Storage Optimized Double Extra Large Instance', - 'ram': 61952, - 'disk': 12000, # 6 x 2 TB - 'bandwidth': None - }, - 'd2.4xlarge': { - 'id': 'd2.4xlarge', - 'name': 'High Storage Optimized Quadruple Extra Large Instance', - 'ram': 122000, - 'disk': 24000, # 12 x 2 TB - 'bandwidth': None - }, - 'd2.8xlarge': { - 'id': 'd2.8xlarge', - 'name': 'High Storage Optimized Eight Extra Large Instance', - 'ram': 244000, - 'disk': 48000, # 24 x 2 TB - 'bandwidth': None - }, - # 1x SSD - 'r3.large': { - 'id': 'r3.large', - 'name': 'Memory Optimized Large instance', - 'ram': 15000, - 'disk': 32, - 'bandwidth': None - }, - 'r3.xlarge': { - 'id': 'r3.xlarge', - 'name': 'Memory Optimized Extra Large instance', - 'ram': 30500, - 'disk': 80, - 'bandwidth': None - }, - 'r3.2xlarge': { - 'id': 'r3.2xlarge', - 'name': 'Memory Optimized Double Extra Large instance', - 'ram': 61000, - 'disk': 160, - 'bandwidth': None - }, - 'r3.4xlarge': { - 'id': 'r3.4xlarge', - 'name': 'Memory Optimized Quadruple Extra Large instance', - 'ram': 122000, - 'disk': 320, - 'bandwidth': None - }, - 'r3.8xlarge': { - 'id': 'r3.8xlarge', - 'name': 'Memory Optimized Eight Extra Large instance', - 'ram': 244000, - 'disk': 320, # x2 - 'bandwidth': None - }, - 't2.micro': { - 'id': 't2.micro', - 'name': 'Burstable Performance Micro Instance', - 'ram': 1024, - 'disk': 0, # EBS Only - 'bandwidth': None, - 'extra': { - 'cpu': 1 - } - }, - # Burstable Performance General Purpose - 't2.small': { - 'id': 't2.small', - 'name': 'Burstable Performance Small Instance', - 'ram': 2048, - 'disk': 0, # EBS Only - 'bandwidth': None, - 'extra': { - 'cpu': 11 - } - }, - 't2.medium': { - 'id': 't2.medium', - 'name': 'Burstable Performance Medium Instance', - 'ram': 4028, - 'disk': 0, # EBS Only - 'bandwidth': None, - 'extra': { - 'cpu': 2 - } - } +DEFAULT_EUCA_API_VERSION = "3.3.0" +EUCA_NAMESPACE = "http://msgs.eucalyptus.com/%s" % (DEFAULT_EUCA_API_VERSION) + +# Outscale Constants +DEFAULT_OUTSCALE_API_VERSION = "2016-04-01" +OUTSCALE_NAMESPACE = "http://api.outscale.com/wsdl/fcuext/2014-04-15/" + +# Add Nimbus region +REGION_DETAILS_NIMBUS = { + # Nimbus clouds have 3 EC2-style instance types but their particular + # RAM allocations are configured by the admin + "country": "custom", + "signature_version": "2", + "instance_types": ["m1.small", "m1.large", "m1.xlarge"], } -REGION_DETAILS = { - # US East (Northern Virginia) Region - 'us-east-1': { - 'endpoint': 'ec2.us-east-1.amazonaws.com', - 'api_name': 'ec2_us_east', - 'country': 'USA', - 'signature_version': '2', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'm3.medium', - 'm3.large', - 'm3.xlarge', - 'm3.2xlarge', - 'c1.medium', - 'c1.xlarge', - 'cc2.8xlarge', - 'c3.large', - 'c3.xlarge', - 'c3.2xlarge', - 'c3.4xlarge', - 'c3.8xlarge', - 'cg1.4xlarge', - 'g2.2xlarge', - 'cr1.8xlarge', - 'hs1.8xlarge', - 'i2.xlarge', - 'i2.2xlarge', - 'i2.4xlarge', - 'i2.8xlarge', - 'd2.xlarge', - 'd2.2xlarge', - 'd2.4xlarge', - 'd2.8xlarge', - 'r3.large', - 'r3.xlarge', - 'r3.2xlarge', - 'r3.4xlarge', - 'r3.8xlarge', - 't2.micro', - 't2.small', - 't2.medium' - ] - }, - # US West (Northern California) Region - 'us-west-1': { - 'endpoint': 'ec2.us-west-1.amazonaws.com', - 'api_name': 'ec2_us_west', - 'country': 'USA', - 'signature_version': '2', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'm3.medium', - 'm3.large', - 'm3.xlarge', - 'm3.2xlarge', - 'c1.medium', - 'c1.xlarge', - 'g2.2xlarge', - 'c3.large', - 'c3.xlarge', - 'c3.2xlarge', - 'c3.4xlarge', - 'c3.8xlarge', - 'i2.xlarge', - 'i2.2xlarge', - 'i2.4xlarge', - 'i2.8xlarge', - 'r3.large', - 'r3.xlarge', - 'r3.2xlarge', - 'r3.4xlarge', - 'r3.8xlarge', - 't2.micro', - 't2.small', - 't2.medium' - ] - }, - # US West (Oregon) Region - 'us-west-2': { - 'endpoint': 'ec2.us-west-2.amazonaws.com', - 'api_name': 'ec2_us_west_oregon', - 'country': 'US', - 'signature_version': '2', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'm3.medium', - 'm3.large', - 'm3.xlarge', - 'm3.2xlarge', - 'c1.medium', - 'c1.xlarge', - 'g2.2xlarge', - 'c3.large', - 'c3.xlarge', - 'c3.2xlarge', - 'c3.4xlarge', - 'c3.8xlarge', - 'hs1.8xlarge', - 'cc2.8xlarge', - 'i2.xlarge', - 'i2.2xlarge', - 'i2.4xlarge', - 'i2.8xlarge', - 'd2.xlarge', - 'd2.2xlarge', - 'd2.4xlarge', - 'd2.8xlarge', - 'r3.large', - 'r3.xlarge', - 'r3.2xlarge', - 'r3.4xlarge', - 'r3.8xlarge', - 't2.micro', - 't2.small', - 't2.medium' - ] - }, - # EU (Ireland) Region - 'eu-west-1': { - 'endpoint': 'ec2.eu-west-1.amazonaws.com', - 'api_name': 'ec2_eu_west', - 'country': 'Ireland', - 'signature_version': '2', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'm3.medium', - 'm3.large', - 'm3.xlarge', - 'm3.2xlarge', - 'c1.medium', - 'c1.xlarge', - 'g2.2xlarge', - 'c3.large', - 'c3.xlarge', - 'c3.2xlarge', - 'c3.4xlarge', - 'c3.8xlarge', - 'hs1.8xlarge', - 'cc2.8xlarge', - 'i2.xlarge', - 'i2.2xlarge', - 'i2.4xlarge', - 'i2.8xlarge', - 'd2.xlarge', - 'd2.2xlarge', - 'd2.4xlarge', - 'd2.8xlarge', - 'r3.large', - 'r3.xlarge', - 'r3.2xlarge', - 'r3.4xlarge', - 'r3.8xlarge', - 't2.micro', - 't2.small', - 't2.medium' - ] - }, - # EU (Frankfurt) Region - 'eu-central-1': { - 'endpoint': 'ec2.eu-central-1.amazonaws.com', - 'api_name': 'ec2_eu_central', - 'country': 'Frankfurt', - 'signature_version': '4', - 'instance_types': [ - 'm3.medium', - 'm3.large', - 'm3.xlarge', - 'm3.2xlarge', - 'c3.large', - 'c3.xlarge', - 'c3.2xlarge', - 'c3.4xlarge', - 'c3.8xlarge', - 'i2.xlarge', - 'i2.2xlarge', - 'i2.4xlarge', - 'i2.8xlarge', - 'd2.xlarge', - 'd2.2xlarge', - 'd2.4xlarge', - 'd2.8xlarge', - 'r3.large', - 'r3.xlarge', - 'r3.2xlarge', - 'r3.4xlarge', - 'r3.8xlarge', - 't2.micro', - 't2.small', - 't2.medium' - ] - }, - # Asia Pacific (Singapore) Region - 'ap-southeast-1': { - 'endpoint': 'ec2.ap-southeast-1.amazonaws.com', - 'api_name': 'ec2_ap_southeast', - 'country': 'Singapore', - 'signature_version': '2', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'm3.medium', - 'm3.large', - 'm3.xlarge', - 'm3.2xlarge', - 'c1.medium', - 'c1.xlarge', - 'c3.large', - 'c3.xlarge', - 'c3.2xlarge', - 'c3.4xlarge', - 'c3.8xlarge', - 'hs1.8xlarge', - 'i2.xlarge', - 'i2.2xlarge', - 'i2.4xlarge', - 'i2.8xlarge', - 'd2.xlarge', - 'd2.2xlarge', - 'd2.4xlarge', - 'd2.8xlarge', - 't2.micro', - 't2.small', - 't2.medium' - ] - }, - # Asia Pacific (Tokyo) Region - 'ap-northeast-1': { - 'endpoint': 'ec2.ap-northeast-1.amazonaws.com', - 'api_name': 'ec2_ap_northeast', - 'country': 'Japan', - 'signature_version': '2', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'm3.medium', - 'm3.large', - 'm3.xlarge', - 'm3.2xlarge', - 'c1.medium', - 'g2.2xlarge', - 'c1.xlarge', - 'c3.large', - 'c3.xlarge', - 'c3.2xlarge', - 'c3.4xlarge', - 'c3.8xlarge', - 'hs1.8xlarge', - 'i2.xlarge', - 'i2.2xlarge', - 'i2.4xlarge', - 'i2.8xlarge', - 'd2.xlarge', - 'd2.2xlarge', - 'd2.4xlarge', - 'd2.8xlarge', - 'r3.large', - 'r3.xlarge', - 'r3.2xlarge', - 'r3.4xlarge', - 'r3.8xlarge', - 't2.micro', - 't2.small', - 't2.medium' - ] - }, - # South America (Sao Paulo) Region - 'sa-east-1': { - 'endpoint': 'ec2.sa-east-1.amazonaws.com', - 'api_name': 'ec2_sa_east', - 'country': 'Brazil', - 'signature_version': '2', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'm3.medium', - 'm3.large', - 'm3.xlarge', - 'm3.2xlarge', - 'c1.medium', - 'c1.xlarge', - 't2.micro', - 't2.small', - 't2.medium' - ] - }, - # Asia Pacific (Sydney) Region - 'ap-southeast-2': { - 'endpoint': 'ec2.ap-southeast-2.amazonaws.com', - 'api_name': 'ec2_ap_southeast_2', - 'country': 'Australia', - 'signature_version': '2', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'm3.medium', - 'm3.large', - 'm3.xlarge', - 'm3.2xlarge', - 'c1.medium', - 'c1.xlarge', - 'c3.large', - 'c3.xlarge', - 'c3.2xlarge', - 'c3.4xlarge', - 'c3.8xlarge', - 'hs1.8xlarge', - 'i2.xlarge', - 'i2.2xlarge', - 'i2.4xlarge', - 'i2.8xlarge', - 'd2.xlarge', - 'd2.2xlarge', - 'd2.4xlarge', - 'd2.8xlarge', - 'r3.large', - 'r3.xlarge', - 'r3.2xlarge', - 'r3.4xlarge', - 'r3.8xlarge', - 't2.micro', - 't2.small', - 't2.medium' - ] - }, - 'us-gov-west-1': { - 'endpoint': 'ec2.us-gov-west-1.amazonaws.com', - 'api_name': 'ec2_us_govwest', - 'country': 'US', - 'signature_version': '2', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'm3.medium', - 'm3.large', - 'm3.xlarge', - 'm3.2xlarge', - 'c1.medium', - 'c1.xlarge', - 'g2.2xlarge', - 'c3.large', - 'c3.xlarge', - 'c3.2xlarge', - 'c3.4xlarge', - 'c3.8xlarge', - 'hs1.4xlarge', - 'hs1.8xlarge', - 'i2.xlarge', - 'i2.2xlarge', - 'i2.4xlarge', - 'i2.8xlarge', - 'r3.large', - 'r3.xlarge', - 'r3.2xlarge', - 'r3.4xlarge', - 'r3.8xlarge', - 't2.micro', - 't2.small', - 't2.medium' - ] - }, - 'nimbus': { - # Nimbus clouds have 3 EC2-style instance types but their particular - # RAM allocations are configured by the admin - 'country': 'custom', - 'signature_version': '2', - 'instance_types': [ - 'm1.small', - 'm1.large', - 'm1.xlarge' - ] - } -} - - """ Sizes must be hardcoded because Outscale doesn't provide an API to fetch them. Outscale cloud instances share some names with EC2 but have different specifications so declare them in another constant. """ OUTSCALE_INSTANCE_TYPES = { - 't1.micro': { - 'id': 't1.micro', - 'name': 'Micro Instance', - 'ram': 615, - 'disk': 0, - 'bandwidth': None + "t1.micro": { + "id": "t1.micro", + "name": "Micro Instance", + "ram": 615, + "disk": 0, + "bandwidth": None, }, - 'm1.small': { - 'id': 'm1.small', - 'name': 'Standard Small Instance', - 'ram': 1740, - 'disk': 150, - 'bandwidth': None + "m1.small": { + "id": "m1.small", + "name": "Standard Small Instance", + "ram": 1740, + "disk": 150, + "bandwidth": None, }, - 'm1.medium': { - 'id': 'm1.medium', - 'name': 'Standard Medium Instance', - 'ram': 3840, - 'disk': 420, - 'bandwidth': None + "m1.medium": { + "id": "m1.medium", + "name": "Standard Medium Instance", + "ram": 3840, + "disk": 420, + "bandwidth": None, }, - 'm1.large': { - 'id': 'm1.large', - 'name': 'Standard Large Instance', - 'ram': 7680, - 'disk': 840, - 'bandwidth': None + "m1.large": { + "id": "m1.large", + "name": "Standard Large Instance", + "ram": 7680, + "disk": 840, + "bandwidth": None, }, - 'm1.xlarge': { - 'id': 'm1.xlarge', - 'name': 'Standard Extra Large Instance', - 'ram': 15360, - 'disk': 1680, - 'bandwidth': None + "m1.xlarge": { + "id": "m1.xlarge", + "name": "Standard Extra Large Instance", + "ram": 15360, + "disk": 1680, + "bandwidth": None, }, - 'c1.medium': { - 'id': 'c1.medium', - 'name': 'Compute Optimized Medium Instance', - 'ram': 1740, - 'disk': 340, - 'bandwidth': None + "c1.medium": { + "id": "c1.medium", + "name": "Compute Optimized Medium Instance", + "ram": 1740, + "disk": 340, + "bandwidth": None, }, - 'c1.xlarge': { - 'id': 'c1.xlarge', - 'name': 'Compute Optimized Extra Large Instance', - 'ram': 7168, - 'disk': 1680, - 'bandwidth': None + "c1.xlarge": { + "id": "c1.xlarge", + "name": "Compute Optimized Extra Large Instance", + "ram": 7168, + "disk": 1680, + "bandwidth": None, }, - 'c3.large': { - 'id': 'c3.large', - 'name': 'Compute Optimized Large Instance', - 'ram': 3840, - 'disk': 32, - 'bandwidth': None + "c3.large": { + "id": "c3.large", + "name": "Compute Optimized Large Instance", + "ram": 3840, + "disk": 32, + "bandwidth": None, }, - 'c3.xlarge': { - 'id': 'c3.xlarge', - 'name': 'Compute Optimized Extra Large Instance', - 'ram': 7168, - 'disk': 80, - 'bandwidth': None + "c3.xlarge": { + "id": "c3.xlarge", + "name": "Compute Optimized Extra Large Instance", + "ram": 7168, + "disk": 80, + "bandwidth": None, }, - 'c3.2xlarge': { - 'id': 'c3.2xlarge', - 'name': 'Compute Optimized Double Extra Large Instance', - 'ram': 15359, - 'disk': 160, - 'bandwidth': None + "c3.2xlarge": { + "id": "c3.2xlarge", + "name": "Compute Optimized Double Extra Large Instance", + "ram": 15359, + "disk": 160, + "bandwidth": None, }, - 'c3.4xlarge': { - 'id': 'c3.4xlarge', - 'name': 'Compute Optimized Quadruple Extra Large Instance', - 'ram': 30720, - 'disk': 320, - 'bandwidth': None + "c3.4xlarge": { + "id": "c3.4xlarge", + "name": "Compute Optimized Quadruple Extra Large Instance", + "ram": 30720, + "disk": 320, + "bandwidth": None, }, - 'c3.8xlarge': { - 'id': 'c3.8xlarge', - 'name': 'Compute Optimized Eight Extra Large Instance', - 'ram': 61440, - 'disk': 640, - 'bandwidth': None + "c3.8xlarge": { + "id": "c3.8xlarge", + "name": "Compute Optimized Eight Extra Large Instance", + "ram": 61440, + "disk": 640, + "bandwidth": None, }, - 'm2.xlarge': { - 'id': 'm2.xlarge', - 'name': 'High Memory Extra Large Instance', - 'ram': 17510, - 'disk': 420, - 'bandwidth': None + "m2.xlarge": { + "id": "m2.xlarge", + "name": "High Memory Extra Large Instance", + "ram": 17510, + "disk": 420, + "bandwidth": None, }, - 'm2.2xlarge': { - 'id': 'm2.2xlarge', - 'name': 'High Memory Double Extra Large Instance', - 'ram': 35020, - 'disk': 840, - 'bandwidth': None + "m2.2xlarge": { + "id": "m2.2xlarge", + "name": "High Memory Double Extra Large Instance", + "ram": 35020, + "disk": 840, + "bandwidth": None, }, - 'm2.4xlarge': { - 'id': 'm2.4xlarge', - 'name': 'High Memory Quadruple Extra Large Instance', - 'ram': 70042, - 'disk': 1680, - 'bandwidth': None + "m2.4xlarge": { + "id": "m2.4xlarge", + "name": "High Memory Quadruple Extra Large Instance", + "ram": 70042, + "disk": 1680, + "bandwidth": None, }, - 'nv1.small': { - 'id': 'nv1.small', - 'name': 'GPU Small Instance', - 'ram': 1739, - 'disk': 150, - 'bandwidth': None + "nv1.small": { + "id": "nv1.small", + "name": "GPU Small Instance", + "ram": 1739, + "disk": 150, + "bandwidth": None, }, - 'nv1.medium': { - 'id': 'nv1.medium', - 'name': 'GPU Medium Instance', - 'ram': 3839, - 'disk': 420, - 'bandwidth': None + "nv1.medium": { + "id": "nv1.medium", + "name": "GPU Medium Instance", + "ram": 3839, + "disk": 420, + "bandwidth": None, }, - 'nv1.large': { - 'id': 'nv1.large', - 'name': 'GPU Large Instance', - 'ram': 7679, - 'disk': 840, - 'bandwidth': None + "nv1.large": { + "id": "nv1.large", + "name": "GPU Large Instance", + "ram": 7679, + "disk": 840, + "bandwidth": None, }, - 'nv1.xlarge': { - 'id': 'nv1.xlarge', - 'name': 'GPU Extra Large Instance', - 'ram': 15358, - 'disk': 1680, - 'bandwidth': None + "nv1.xlarge": { + "id": "nv1.xlarge", + "name": "GPU Extra Large Instance", + "ram": 15358, + "disk": 1680, + "bandwidth": None, }, - 'g2.2xlarge': { - 'id': 'g2.2xlarge', - 'name': 'GPU Double Extra Large Instance', - 'ram': 15360, - 'disk': 60, - 'bandwidth': None + "g2.2xlarge": { + "id": "g2.2xlarge", + "name": "GPU Double Extra Large Instance", + "ram": 15360, + "disk": 60, + "bandwidth": None, }, - 'cc1.4xlarge': { - 'id': 'cc1.4xlarge', - 'name': 'Cluster Compute Quadruple Extra Large Instance', - 'ram': 24576, - 'disk': 1680, - 'bandwidth': None + "cc1.4xlarge": { + "id": "cc1.4xlarge", + "name": "Cluster Compute Quadruple Extra Large Instance", + "ram": 24576, + "disk": 1680, + "bandwidth": None, }, - 'cc2.8xlarge': { - 'id': 'cc2.8xlarge', - 'name': 'Cluster Compute Eight Extra Large Instance', - 'ram': 65536, - 'disk': 3360, - 'bandwidth': None + "cc2.8xlarge": { + "id": "cc2.8xlarge", + "name": "Cluster Compute Eight Extra Large Instance", + "ram": 65536, + "disk": 3360, + "bandwidth": None, }, - 'hi1.xlarge': { - 'id': 'hi1.xlarge', - 'name': 'High Storage Extra Large Instance', - 'ram': 15361, - 'disk': 1680, - 'bandwidth': None + "hi1.xlarge": { + "id": "hi1.xlarge", + "name": "High Storage Extra Large Instance", + "ram": 15361, + "disk": 1680, + "bandwidth": None, }, - 'm3.xlarge': { - 'id': 'm3.xlarge', - 'name': 'High Storage Optimized Extra Large Instance', - 'ram': 15357, - 'disk': 0, - 'bandwidth': None + "m3.xlarge": { + "id": "m3.xlarge", + "name": "High Storage Optimized Extra Large Instance", + "ram": 15357, + "disk": 0, + "bandwidth": None, }, - 'm3.2xlarge': { - 'id': 'm3.2xlarge', - 'name': 'High Storage Optimized Double Extra Large Instance', - 'ram': 30720, - 'disk': 0, - 'bandwidth': None + "m3.2xlarge": { + "id": "m3.2xlarge", + "name": "High Storage Optimized Double Extra Large Instance", + "ram": 30720, + "disk": 0, + "bandwidth": None, }, - 'm3s.xlarge': { - 'id': 'm3s.xlarge', - 'name': 'High Storage Optimized Extra Large Instance', - 'ram': 15359, - 'disk': 0, - 'bandwidth': None + "m3s.xlarge": { + "id": "m3s.xlarge", + "name": "High Storage Optimized Extra Large Instance", + "ram": 15359, + "disk": 0, + "bandwidth": None, }, - 'm3s.2xlarge': { - 'id': 'm3s.2xlarge', - 'name': 'High Storage Optimized Double Extra Large Instance', - 'ram': 30719, - 'disk': 0, - 'bandwidth': None + "m3s.2xlarge": { + "id": "m3s.2xlarge", + "name": "High Storage Optimized Double Extra Large Instance", + "ram": 30719, + "disk": 0, + "bandwidth": None, }, - 'cr1.8xlarge': { - 'id': 'cr1.8xlarge', - 'name': 'Memory Optimized Eight Extra Large Instance', - 'ram': 249855, - 'disk': 240, - 'bandwidth': None + "cr1.8xlarge": { + "id": "cr1.8xlarge", + "name": "Memory Optimized Eight Extra Large Instance", + "ram": 249855, + "disk": 240, + "bandwidth": None, }, - 'os1.2xlarge': { - 'id': 'os1.2xlarge', - 'name': 'Memory Optimized, High Storage, Passthrough NIC Double Extra ' - 'Large Instance', - 'ram': 65536, - 'disk': 60, - 'bandwidth': None + "os1.2xlarge": { + "id": "os1.2xlarge", + "name": "Memory Optimized, High Storage, Passthrough NIC Double Extra " "Large Instance", + "ram": 65536, + "disk": 60, + "bandwidth": None, }, - 'os1.4xlarge': { - 'id': 'os1.4xlarge', - 'name': 'Memory Optimized, High Storage, Passthrough NIC Quadruple Ext' - 'ra Large Instance', - 'ram': 131072, - 'disk': 120, - 'bandwidth': None + "os1.4xlarge": { + "id": "os1.4xlarge", + "name": "Memory Optimized, High Storage, Passthrough NIC Quadruple Ext" "ra Large Instance", + "ram": 131072, + "disk": 120, + "bandwidth": None, }, - 'os1.8xlarge': { - 'id': 'os1.8xlarge', - 'name': 'Memory Optimized, High Storage, Passthrough NIC Eight Extra L' - 'arge Instance', - 'ram': 249856, - 'disk': 500, - 'bandwidth': None + "os1.8xlarge": { + "id": "os1.8xlarge", + "name": "Memory Optimized, High Storage, Passthrough NIC Eight Extra L" "arge Instance", + "ram": 249856, + "disk": 500, + "bandwidth": None, }, - 'oc1.4xlarge': { - 'id': 'oc1.4xlarge', - 'name': 'Outscale Quadruple Extra Large Instance', - 'ram': 24575, - 'disk': 1680, - 'bandwidth': None + "oc1.4xlarge": { + "id": "oc1.4xlarge", + "name": "Outscale Quadruple Extra Large Instance", + "ram": 24575, + "disk": 1680, + "bandwidth": None, + }, + "oc2.8xlarge": { + "id": "oc2.8xlarge", + "name": "Outscale Eight Extra Large Instance", + "ram": 65535, + "disk": 3360, + "bandwidth": None, }, - 'oc2.8xlarge': { - 'id': 'oc2.8xlarge', - 'name': 'Outscale Eight Extra Large Instance', - 'ram': 65535, - 'disk': 3360, - 'bandwidth': None - } } @@ -1081,172 +347,283 @@ regions in some other constants. """ OUTSCALE_SAS_REGION_DETAILS = { - 'eu-west-3': { - 'endpoint': 'api-ppd.outscale.com', - 'api_name': 'osc_sas_eu_west_3', - 'country': 'FRANCE', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'c1.medium', - 'c1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'nv1.small', - 'nv1.medium', - 'nv1.large', - 'nv1.xlarge', - 'cc1.4xlarge', - 'cc2.8xlarge', - 'm3.xlarge', - 'm3.2xlarge', - 'cr1.8xlarge', - 'os1.8xlarge' - ] + "eu-west-3": { + "endpoint": "api-ppd.outscale.com", + "api_name": "osc_sas_eu_west_3", + "country": "FRANCE", + "instance_types": [ + "t1.micro", + "m1.small", + "m1.medium", + "m1.large", + "m1.xlarge", + "c1.medium", + "c1.xlarge", + "m2.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "nv1.small", + "nv1.medium", + "nv1.large", + "nv1.xlarge", + "cc1.4xlarge", + "cc2.8xlarge", + "m3.xlarge", + "m3.2xlarge", + "cr1.8xlarge", + "os1.8xlarge", + ], }, - 'eu-west-1': { - 'endpoint': 'api.eu-west-1.outscale.com', - 'api_name': 'osc_sas_eu_west_1', - 'country': 'FRANCE', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'c1.medium', - 'c1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'nv1.small', - 'nv1.medium', - 'nv1.large', - 'nv1.xlarge', - 'cc1.4xlarge', - 'cc2.8xlarge', - 'm3.xlarge', - 'm3.2xlarge', - 'cr1.8xlarge', - 'os1.8xlarge' - ] + "eu-west-1": { + "endpoint": "api.eu-west-1.outscale.com", + "api_name": "osc_sas_eu_west_1", + "country": "FRANCE", + "instance_types": [ + "t1.micro", + "m1.small", + "m1.medium", + "m1.large", + "m1.xlarge", + "c1.medium", + "c1.xlarge", + "m2.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "nv1.small", + "nv1.medium", + "nv1.large", + "nv1.xlarge", + "cc1.4xlarge", + "cc2.8xlarge", + "m3.xlarge", + "m3.2xlarge", + "cr1.8xlarge", + "os1.8xlarge", + ], + }, + "eu-west-2": { + "endpoint": "fcu.eu-west-2.outscale.com", + "api_name": "osc_sas_eu_west_2", + "country": "FRANCE", + "instance_types": [ + "t1.micro", + "m1.small", + "m1.medium", + "m1.large", + "m1.xlarge", + "c1.medium", + "c1.xlarge", + "m2.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "nv1.small", + "nv1.medium", + "nv1.large", + "nv1.xlarge", + "cc1.4xlarge", + "cc2.8xlarge", + "m3.xlarge", + "m3.2xlarge", + "cr1.8xlarge", + "os1.8xlarge", + ], + }, + "us-east-1": { + "endpoint": "api.us-east-1.outscale.com", + "api_name": "osc_sas_us_east_1", + "country": "USA", + "instance_types": [ + "t1.micro", + "m1.small", + "m1.medium", + "m1.large", + "m1.xlarge", + "c1.medium", + "c1.xlarge", + "m2.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "nv1.small", + "nv1.medium", + "nv1.large", + "nv1.xlarge", + "cc1.4xlarge", + "cc2.8xlarge", + "m3.xlarge", + "m3.2xlarge", + "cr1.8xlarge", + "os1.8xlarge", + ], + }, + "us-east-2": { + "endpoint": "fcu.us-east-2.outscale.com", + "api_name": "osc_sas_us_east_2", + "country": "USA", + "instance_types": [ + "t1.micro", + "m1.small", + "m1.medium", + "m1.large", + "m1.xlarge", + "c1.medium", + "c1.xlarge", + "m2.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "nv1.small", + "nv1.medium", + "nv1.large", + "nv1.xlarge", + "cc1.4xlarge", + "cc2.8xlarge", + "m3.xlarge", + "m3.2xlarge", + "cr1.8xlarge", + "os1.8xlarge", + ], }, - 'us-east-1': { - 'endpoint': 'api.us-east-1.outscale.com', - 'api_name': 'osc_sas_us_east_1', - 'country': 'USA', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'c1.medium', - 'c1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'nv1.small', - 'nv1.medium', - 'nv1.large', - 'nv1.xlarge', - 'cc1.4xlarge', - 'cc2.8xlarge', - 'm3.xlarge', - 'm3.2xlarge', - 'cr1.8xlarge', - 'os1.8xlarge' - ] - } } OUTSCALE_INC_REGION_DETAILS = { - 'eu-west-1': { - 'endpoint': 'api.eu-west-1.outscale.com', - 'api_name': 'osc_inc_eu_west_1', - 'country': 'FRANCE', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'c1.medium', - 'c1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'nv1.small', - 'nv1.medium', - 'nv1.large', - 'nv1.xlarge', - 'cc1.4xlarge', - 'cc2.8xlarge', - 'm3.xlarge', - 'm3.2xlarge', - 'cr1.8xlarge', - 'os1.8xlarge' - ] + "eu-west-1": { + "endpoint": "api.eu-west-1.outscale.com", + "api_name": "osc_inc_eu_west_1", + "country": "FRANCE", + "instance_types": [ + "t1.micro", + "m1.small", + "m1.medium", + "m1.large", + "m1.xlarge", + "c1.medium", + "c1.xlarge", + "m2.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "p2.xlarge", + "p2.8xlarge", + "p2.16xlarge", + "nv1.small", + "nv1.medium", + "nv1.large", + "nv1.xlarge", + "cc1.4xlarge", + "cc2.8xlarge", + "m3.xlarge", + "m3.2xlarge", + "cr1.8xlarge", + "os1.8xlarge", + ], }, - 'eu-west-3': { - 'endpoint': 'api-ppd.outscale.com', - 'api_name': 'osc_inc_eu_west_3', - 'country': 'FRANCE', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'c1.medium', - 'c1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'nv1.small', - 'nv1.medium', - 'nv1.large', - 'nv1.xlarge', - 'cc1.4xlarge', - 'cc2.8xlarge', - 'm3.xlarge', - 'm3.2xlarge', - 'cr1.8xlarge', - 'os1.8xlarge' - ] + "eu-west-2": { + "endpoint": "fcu.eu-west-2.outscale.com", + "api_name": "osc_inc_eu_west_2", + "country": "FRANCE", + "instance_types": [ + "t1.micro", + "m1.small", + "m1.medium", + "m1.large", + "m1.xlarge", + "c1.medium", + "c1.xlarge", + "m2.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "nv1.small", + "nv1.medium", + "nv1.large", + "nv1.xlarge", + "cc1.4xlarge", + "cc2.8xlarge", + "m3.xlarge", + "m3.2xlarge", + "cr1.8xlarge", + "os1.8xlarge", + ], + }, + "eu-west-3": { + "endpoint": "api-ppd.outscale.com", + "api_name": "osc_inc_eu_west_3", + "country": "FRANCE", + "instance_types": [ + "t1.micro", + "m1.small", + "m1.medium", + "m1.large", + "m1.xlarge", + "c1.medium", + "c1.xlarge", + "m2.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "nv1.small", + "nv1.medium", + "nv1.large", + "nv1.xlarge", + "cc1.4xlarge", + "cc2.8xlarge", + "m3.xlarge", + "m3.2xlarge", + "cr1.8xlarge", + "os1.8xlarge", + ], + }, + "us-east-1": { + "endpoint": "api.us-east-1.outscale.com", + "api_name": "osc_inc_us_east_1", + "country": "USA", + "instance_types": [ + "t1.micro", + "m1.small", + "m1.medium", + "m1.large", + "m1.xlarge", + "c1.medium", + "c1.xlarge", + "m2.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "nv1.small", + "nv1.medium", + "nv1.large", + "nv1.xlarge", + "cc1.4xlarge", + "cc2.8xlarge", + "m3.xlarge", + "m3.2xlarge", + "cr1.8xlarge", + "os1.8xlarge", + ], + }, + "us-east-2": { + "endpoint": "fcu.us-east-2.outscale.com", + "api_name": "osc_inc_us_east_2", + "country": "USA", + "instance_types": [ + "t1.micro", + "m1.small", + "m1.medium", + "m1.large", + "m1.xlarge", + "c1.medium", + "c1.xlarge", + "m2.xlarge", + "m2.2xlarge", + "m2.4xlarge", + "nv1.small", + "nv1.medium", + "nv1.large", + "nv1.xlarge", + "cc1.4xlarge", + "cc2.8xlarge", + "m3.xlarge", + "m3.2xlarge", + "cr1.8xlarge", + "os1.8xlarge", + ], }, - 'us-east-1': { - 'endpoint': 'api.us-east-1.outscale.com', - 'api_name': 'osc_inc_us_east_1', - 'country': 'USA', - 'instance_types': [ - 't1.micro', - 'm1.small', - 'm1.medium', - 'm1.large', - 'm1.xlarge', - 'c1.medium', - 'c1.xlarge', - 'm2.xlarge', - 'm2.2xlarge', - 'm2.4xlarge', - 'nv1.small', - 'nv1.medium', - 'nv1.large', - 'nv1.xlarge', - 'cc1.4xlarge', - 'cc2.8xlarge', - 'm3.xlarge', - 'm3.2xlarge', - 'cr1.8xlarge', - 'os1.8xlarge' - ] - } } @@ -1254,472 +631,211 @@ Define the extra dictionary for specific resources """ RESOURCE_EXTRA_ATTRIBUTES_MAP = { - 'ebs_volume': { - 'snapshot_id': { - 'xpath': 'ebs/snapshotId', - 'transform_func': str - }, - 'volume_id': { - 'xpath': 'ebs/volumeId', - 'transform_func': str - }, - 'volume_size': { - 'xpath': 'ebs/volumeSize', - 'transform_func': int - }, - 'delete': { - 'xpath': 'ebs/deleteOnTermination', - 'transform_func': str + "ebs_instance_block_device": { + "attach_time": { + "xpath": "ebs/attachTime", + "transform_func": parse_date_allow_empty, }, - 'volume_type': { - 'xpath': 'ebs/volumeType', - 'transform_func': str - }, - 'iops': { - 'xpath': 'ebs/iops', - 'transform_func': int - } + "delete": {"xpath": "ebs/deleteOnTermination", "transform_func": str}, + "status": {"xpath": "ebs/status", "transform_func": str}, + "volume_id": {"xpath": "ebs/volumeId", "transform_func": str}, }, - 'elastic_ip': { - 'allocation_id': { - 'xpath': 'allocationId', - 'transform_func': str, - }, - 'association_id': { - 'xpath': 'associationId', - 'transform_func': str, - }, - 'interface_id': { - 'xpath': 'networkInterfaceId', - 'transform_func': str, - }, - 'owner_id': { - 'xpath': 'networkInterfaceOwnerId', - 'transform_func': str, - }, - 'private_ip': { - 'xpath': 'privateIp', - 'transform_func': str, - } + "ebs_volume": { + "snapshot_id": {"xpath": "ebs/snapshotId", "transform_func": str}, + "volume_id": {"xpath": "ebs/volumeId", "transform_func": str}, + "volume_size": {"xpath": "ebs/volumeSize", "transform_func": int}, + "delete": {"xpath": "ebs/deleteOnTermination", "transform_func": str}, + "volume_type": {"xpath": "ebs/volumeType", "transform_func": str}, + "iops": {"xpath": "ebs/iops", "transform_func": int}, }, - 'image': { - 'state': { - 'xpath': 'imageState', - 'transform_func': str - }, - 'owner_id': { - 'xpath': 'imageOwnerId', - 'transform_func': str - }, - 'owner_alias': { - 'xpath': 'imageOwnerAlias', - 'transform_func': str - }, - 'is_public': { - 'xpath': 'isPublic', - 'transform_func': str - }, - 'architecture': { - 'xpath': 'architecture', - 'transform_func': str - }, - 'image_type': { - 'xpath': 'imageType', - 'transform_func': str - }, - 'image_location': { - 'xpath': 'imageLocation', - 'transform_func': str - }, - 'platform': { - 'xpath': 'platform', - 'transform_func': str - }, - 'description': { - 'xpath': 'description', - 'transform_func': str - }, - 'root_device_type': { - 'xpath': 'rootDeviceType', - 'transform_func': str - }, - 'virtualization_type': { - 'xpath': 'virtualizationType', - 'transform_func': str - }, - 'hypervisor': { - 'xpath': 'hypervisor', - 'transform_func': str - }, - 'kernel_id': { - 'xpath': 'kernelId', - 'transform_func': str - }, - 'ramdisk_id': { - 'xpath': 'ramdiskId', - 'transform_func': str - } + "elastic_ip": { + "allocation_id": {"xpath": "allocationId", "transform_func": str}, + "association_id": {"xpath": "associationId", "transform_func": str}, + "interface_id": {"xpath": "networkInterfaceId", "transform_func": str}, + "owner_id": {"xpath": "networkInterfaceOwnerId", "transform_func": str}, + "private_ip": {"xpath": "privateIp", "transform_func": str}, }, - 'network': { - 'state': { - 'xpath': 'state', - 'transform_func': str - }, - 'dhcp_options_id': { - 'xpath': 'dhcpOptionsId', - 'transform_func': str + "image": { + "state": {"xpath": "imageState", "transform_func": str}, + "owner_id": {"xpath": "imageOwnerId", "transform_func": str}, + "owner_alias": {"xpath": "imageOwnerAlias", "transform_func": str}, + "is_public": {"xpath": "isPublic", "transform_func": str}, + "architecture": {"xpath": "architecture", "transform_func": str}, + "image_type": {"xpath": "imageType", "transform_func": str}, + "image_location": {"xpath": "imageLocation", "transform_func": str}, + "platform": {"xpath": "platform", "transform_func": str}, + "description": {"xpath": "description", "transform_func": str}, + "root_device_type": {"xpath": "rootDeviceType", "transform_func": str}, + "virtualization_type": {"xpath": "virtualizationType", "transform_func": str}, + "hypervisor": {"xpath": "hypervisor", "transform_func": str}, + "kernel_id": {"xpath": "kernelId", "transform_func": str}, + "ramdisk_id": {"xpath": "ramdiskId", "transform_func": str}, + "ena_support": {"xpath": "enaSupport", "transform_func": str}, + "sriov_net_support": {"xpath": "sriovNetSupport", "transform_func": str}, + "creation_date": { + "xpath": "creationDate", + "transform_func": parse_date_allow_empty, }, - 'instance_tenancy': { - 'xpath': 'instanceTenancy', - 'transform_func': str - }, - 'is_default': { - 'xpath': 'isDefault', - 'transform_func': str - } }, - 'network_interface': { - 'subnet_id': { - 'xpath': 'subnetId', - 'transform_func': str - }, - 'vpc_id': { - 'xpath': 'vpcId', - 'transform_func': str - }, - 'zone': { - 'xpath': 'availabilityZone', - 'transform_func': str - }, - 'description': { - 'xpath': 'description', - 'transform_func': str - }, - 'owner_id': { - 'xpath': 'ownerId', - 'transform_func': str - }, - 'mac_address': { - 'xpath': 'macAddress', - 'transform_func': str - }, - 'private_dns_name': { - 'xpath': 'privateIpAddressesSet/privateDnsName', - 'transform_func': str - }, - 'source_dest_check': { - 'xpath': 'sourceDestCheck', - 'transform_func': str - } + "network": { + "state": {"xpath": "state", "transform_func": str}, + "dhcp_options_id": {"xpath": "dhcpOptionsId", "transform_func": str}, + "instance_tenancy": {"xpath": "instanceTenancy", "transform_func": str}, + "is_default": {"xpath": "isDefault", "transform_func": str}, }, - 'network_interface_attachment': { - 'attachment_id': { - 'xpath': 'attachment/attachmentId', - 'transform_func': str - }, - 'instance_id': { - 'xpath': 'attachment/instanceId', - 'transform_func': str - }, - 'owner_id': { - 'xpath': 'attachment/instanceOwnerId', - 'transform_func': str - }, - 'device_index': { - 'xpath': 'attachment/deviceIndex', - 'transform_func': int - }, - 'status': { - 'xpath': 'attachment/status', - 'transform_func': str + "network_interface": { + "subnet_id": {"xpath": "subnetId", "transform_func": str}, + "vpc_id": {"xpath": "vpcId", "transform_func": str}, + "zone": {"xpath": "availabilityZone", "transform_func": str}, + "description": {"xpath": "description", "transform_func": str}, + "owner_id": {"xpath": "ownerId", "transform_func": str}, + "mac_address": {"xpath": "macAddress", "transform_func": str}, + "private_dns_name": { + "xpath": "privateIpAddressesSet/privateDnsName", + "transform_func": str, }, - 'attach_time': { - 'xpath': 'attachment/attachTime', - 'transform_func': parse_date - }, - 'delete': { - 'xpath': 'attachment/deleteOnTermination', - 'transform_func': str - } + "source_dest_check": {"xpath": "sourceDestCheck", "transform_func": str}, }, - 'node': { - 'availability': { - 'xpath': 'placement/availabilityZone', - 'transform_func': str - }, - 'architecture': { - 'xpath': 'architecture', - 'transform_func': str - }, - 'client_token': { - 'xpath': 'clientToken', - 'transform_func': str - }, - 'dns_name': { - 'xpath': 'dnsName', - 'transform_func': str - }, - 'hypervisor': { - 'xpath': 'hypervisor', - 'transform_func': str - }, - 'iam_profile': { - 'xpath': 'iamInstanceProfile/id', - 'transform_func': str - }, - 'image_id': { - 'xpath': 'imageId', - 'transform_func': str - }, - 'instance_id': { - 'xpath': 'instanceId', - 'transform_func': str - }, - 'instance_lifecycle': { - 'xpath': 'instanceLifecycle', - 'transform_func': str - }, - 'instance_tenancy': { - 'xpath': 'placement/tenancy', - 'transform_func': str - }, - 'instance_type': { - 'xpath': 'instanceType', - 'transform_func': str - }, - 'key_name': { - 'xpath': 'keyName', - 'transform_func': str - }, - 'launch_index': { - 'xpath': 'amiLaunchIndex', - 'transform_func': int - }, - 'launch_time': { - 'xpath': 'launchTime', - 'transform_func': str - }, - 'kernel_id': { - 'xpath': 'kernelId', - 'transform_func': str - }, - 'monitoring': { - 'xpath': 'monitoring/state', - 'transform_func': str + "network_interface_attachment": { + "attachment_id": {"xpath": "attachment/attachmentId", "transform_func": str}, + "instance_id": {"xpath": "attachment/instanceId", "transform_func": str}, + "owner_id": {"xpath": "attachment/instanceOwnerId", "transform_func": str}, + "device_index": {"xpath": "attachment/deviceIndex", "transform_func": int}, + "status": {"xpath": "attachment/status", "transform_func": str}, + "attach_time": { + "xpath": "attachment/attachTime", + "transform_func": parse_date_allow_empty, }, - 'platform': { - 'xpath': 'platform', - 'transform_func': str - }, - 'private_dns': { - 'xpath': 'privateDnsName', - 'transform_func': str - }, - 'ramdisk_id': { - 'xpath': 'ramdiskId', - 'transform_func': str - }, - 'root_device_type': { - 'xpath': 'rootDeviceType', - 'transform_func': str - }, - 'root_device_name': { - 'xpath': 'rootDeviceName', - 'transform_func': str - }, - 'reason': { - 'xpath': 'reason', - 'transform_func': str - }, - 'source_dest_check': { - 'xpath': 'sourceDestCheck', - 'transform_func': str - }, - 'status': { - 'xpath': 'instanceState/name', - 'transform_func': str - }, - 'subnet_id': { - 'xpath': 'subnetId', - 'transform_func': str - }, - 'virtualization_type': { - 'xpath': 'virtualizationType', - 'transform_func': str - }, - 'ebs_optimized': { - 'xpath': 'ebsOptimized', - 'transform_func': str - }, - 'vpc_id': { - 'xpath': 'vpcId', - 'transform_func': str - } + "delete": {"xpath": "attachment/deleteOnTermination", "transform_func": str}, }, - 'reserved_node': { - 'instance_type': { - 'xpath': 'instanceType', - 'transform_func': str - }, - 'availability': { - 'xpath': 'availabilityZone', - 'transform_func': str - }, - 'start': { - 'xpath': 'start', - 'transform_func': str - }, - 'duration': { - 'xpath': 'duration', - 'transform_func': int - }, - 'usage_price': { - 'xpath': 'usagePrice', - 'transform_func': float - }, - 'fixed_price': { - 'xpath': 'fixedPrice', - 'transform_func': float - }, - 'instance_count': { - 'xpath': 'instanceCount', - 'transform_func': int - }, - 'description': { - 'xpath': 'productDescription', - 'transform_func': str - }, - 'instance_tenancy': { - 'xpath': 'instanceTenancy', - 'transform_func': str - }, - 'currency_code': { - 'xpath': 'currencyCode', - 'transform_func': str - }, - 'offering_type': { - 'xpath': 'offeringType', - 'transform_func': str - } + "node": { + "availability": {"xpath": "placement/availabilityZone", "transform_func": str}, + "architecture": {"xpath": "architecture", "transform_func": str}, + "client_token": {"xpath": "clientToken", "transform_func": str}, + "dns_name": {"xpath": "dnsName", "transform_func": str}, + "hypervisor": {"xpath": "hypervisor", "transform_func": str}, + "iam_profile": {"xpath": "iamInstanceProfile/id", "transform_func": str}, + "image_id": {"xpath": "imageId", "transform_func": str}, + "instance_id": {"xpath": "instanceId", "transform_func": str}, + "instance_lifecycle": {"xpath": "instanceLifecycle", "transform_func": str}, + "instance_tenancy": {"xpath": "placement/tenancy", "transform_func": str}, + "instance_type": {"xpath": "instanceType", "transform_func": str}, + "key_name": {"xpath": "keyName", "transform_func": str}, + "launch_index": {"xpath": "amiLaunchIndex", "transform_func": int}, + "launch_time": {"xpath": "launchTime", "transform_func": str}, + "kernel_id": {"xpath": "kernelId", "transform_func": str}, + "monitoring": {"xpath": "monitoring/state", "transform_func": str}, + "platform": {"xpath": "platform", "transform_func": str}, + "private_dns": {"xpath": "privateDnsName", "transform_func": str}, + "ramdisk_id": {"xpath": "ramdiskId", "transform_func": str}, + "root_device_type": {"xpath": "rootDeviceType", "transform_func": str}, + "root_device_name": {"xpath": "rootDeviceName", "transform_func": str}, + "reason": {"xpath": "reason", "transform_func": str}, + "source_dest_check": {"xpath": "sourceDestCheck", "transform_func": str}, + "status": {"xpath": "instanceState/name", "transform_func": str}, + "subnet_id": {"xpath": "subnetId", "transform_func": str}, + "virtualization_type": {"xpath": "virtualizationType", "transform_func": str}, + "ebs_optimized": {"xpath": "ebsOptimized", "transform_func": str}, + "vpc_id": {"xpath": "vpcId", "transform_func": str}, }, - 'security_group': { - 'vpc_id': { - 'xpath': 'vpcId', - 'transform_func': str - }, - 'description': { - 'xpath': 'groupDescription', - 'transform_func': str - }, - 'owner_id': { - 'xpath': 'ownerId', - 'transform_func': str - } + "reserved_node": { + "instance_type": {"xpath": "instanceType", "transform_func": str}, + "availability": {"xpath": "availabilityZone", "transform_func": str}, + "start": {"xpath": "start", "transform_func": str}, + "end": {"xpath": "end", "transform_func": str}, + "duration": {"xpath": "duration", "transform_func": int}, + "usage_price": {"xpath": "usagePrice", "transform_func": float}, + "fixed_price": {"xpath": "fixedPrice", "transform_func": float}, + "instance_count": {"xpath": "instanceCount", "transform_func": int}, + "description": {"xpath": "productDescription", "transform_func": str}, + "instance_tenancy": {"xpath": "instanceTenancy", "transform_func": str}, + "currency_code": {"xpath": "currencyCode", "transform_func": str}, + "offering_type": {"xpath": "offeringType", "transform_func": str}, }, - 'snapshot': { - 'volume_id': { - 'xpath': 'volumeId', - 'transform_func': str - }, - 'state': { - 'xpath': 'status', - 'transform_func': str - }, - 'description': { - 'xpath': 'description', - 'transform_func': str - }, - 'progress': { - 'xpath': 'progress', - 'transform_func': str - }, - 'start_time': { - 'xpath': 'startTime', - 'transform_func': parse_date - } + "security_group": { + "vpc_id": {"xpath": "vpcId", "transform_func": str}, + "description": {"xpath": "groupDescription", "transform_func": str}, + "owner_id": {"xpath": "ownerId", "transform_func": str}, }, - 'subnet': { - 'cidr_block': { - 'xpath': 'cidrBlock', - 'transform_func': str - }, - 'available_ips': { - 'xpath': 'availableIpAddressCount', - 'transform_func': int - }, - 'zone': { - 'xpath': 'availabilityZone', - 'transform_func': str - }, - 'vpc_id': { - 'xpath': 'vpcId', - 'transform_func': str - } + "snapshot": { + "volume_id": {"xpath": "volumeId", "transform_func": str}, + "state": {"xpath": "status", "transform_func": str}, + "description": {"xpath": "description", "transform_func": str}, + "progress": {"xpath": "progress", "transform_func": str}, + "start_time": {"xpath": "startTime", "transform_func": parse_date_allow_empty}, }, - 'volume': { - 'device': { - 'xpath': 'attachmentSet/item/device', - 'transform_func': str - }, - 'snapshot_id': { - 'xpath': 'snapshotId', - 'transform_func': lambda v: str(v) or None - }, - 'iops': { - 'xpath': 'iops', - 'transform_func': int + "subnet": { + "cidr_block": {"xpath": "cidrBlock", "transform_func": str}, + "available_ips": {"xpath": "availableIpAddressCount", "transform_func": int}, + "zone": {"xpath": "availabilityZone", "transform_func": str}, + "vpc_id": {"xpath": "vpcId", "transform_func": str}, + }, + "volume": { + "device": {"xpath": "attachmentSet/item/device", "transform_func": str}, + "snapshot_id": { + "xpath": "snapshotId", + "transform_func": lambda v: str(v) or None, }, - 'zone': { - 'xpath': 'availabilityZone', - 'transform_func': str + "iops": {"xpath": "iops", "transform_func": int}, + "zone": {"xpath": "availabilityZone", "transform_func": str}, + "create_time": { + "xpath": "createTime", + "transform_func": parse_date_allow_empty, }, - 'create_time': { - 'xpath': 'createTime', - 'transform_func': parse_date + "state": {"xpath": "status", "transform_func": str}, + "encrypted": { + "xpath": "encrypted", + "transform_func": lambda x: {"true": True, "false": False}.get(x), }, - 'state': { - 'xpath': 'status', - 'transform_func': str + "attach_time": { + "xpath": "attachmentSet/item/attachTime", + "transform_func": parse_date_allow_empty, }, - 'attach_time': { - 'xpath': 'attachmentSet/item/attachTime', - 'transform_func': parse_date + "attachment_status": { + "xpath": "attachmentSet/item/status", + "transform_func": str, }, - 'attachment_status': { - 'xpath': 'attachmentSet/item/status', - 'transform_func': str + "instance_id": { + "xpath": "attachmentSet/item/instanceId", + "transform_func": str, }, - 'instance_id': { - 'xpath': 'attachmentSet/item/instanceId', - 'transform_func': str + "delete": { + "xpath": "attachmentSet/item/deleteOnTermination", + "transform_func": str, }, - 'delete': { - 'xpath': 'attachmentSet/item/deleteOnTermination', - 'transform_func': str - } + "volume_type": {"xpath": "volumeType", "transform_func": str}, }, - 'route_table': { - 'vpc_id': { - 'xpath': 'vpcId', - 'transform_func': str - } - } + "route_table": {"vpc_id": {"xpath": "vpcId", "transform_func": str}}, } -VALID_EC2_REGIONS = REGION_DETAILS.keys() -VALID_EC2_REGIONS = [r for r in VALID_EC2_REGIONS if r != 'nimbus'] +VOLUME_MODIFICATION_ATTRIBUTE_MAP = { + "end_time": {"xpath": "endTime", "transform_func": parse_date_allow_empty}, + "modification_state": {"xpath": "modificationState", "transform_func": str}, + "original_iops": {"xpath": "originalIops", "transform_func": int}, + "original_size": {"xpath": "originalSize", "transform_func": int}, + "original_volume_type": {"xpath": "originalVolumeType", "transform_func": str}, + "progress": {"xpath": "progress", "transform_func": int}, + "start_time": {"xpath": "startTime", "transform_func": parse_date_allow_empty}, + "status_message": {"xpath": "statusMessage", "transform_func": str}, + "target_iops": {"xpath": "targetIops", "transform_func": int}, + "target_size": {"xpath": "targetSize", "transform_func": int}, + "target_volume_type": {"xpath": "targetVolumeType", "transform_func": str}, + "volume_id": {"xpath": "volumeId", "transform_func": str}, +} + +VALID_EC2_REGIONS = REGION_DETAILS_PARTIAL.keys() +VALID_VOLUME_TYPES = ["standard", "io1", "io2", "gp2", "gp3", "st1", "sc1"] class EC2NodeLocation(NodeLocation): def __init__(self, id, name, country, driver, availability_zone): - super(EC2NodeLocation, self).__init__(id, name, country, driver) + super().__init__(id, name, country, driver) self.availability_zone = availability_zone def __repr__(self): - return (('') - % (self.id, self.name, self.country, - self.availability_zone, self.driver.name)) + return ( + "" + ) % (self.id, self.name, self.country, self.availability_zone, self.driver.name) class EC2Response(AWSBaseResponse): @@ -1732,40 +848,40 @@ def parse_error(self): # Okay, so for Eucalyptus, you can get a 403, with no body, # if you are using the wrong user/password. msg = "Failure: 403 Forbidden" - if self.status == 403 and self.body[:len(msg)] == msg: + if self.status == 403 and self.body[: len(msg)] == msg: raise InvalidCredsError(msg) try: body = ET.XML(self.body) - except: - raise MalformedResponseError("Failed to parse XML", - body=self.body, driver=EC2NodeDriver) - - for err in body.findall('Errors/Error'): - code, message = err.getchildren() - err_list.append('%s: %s' % (code.text, message.text)) - if code.text == 'InvalidClientTokenId': + except Exception: + raise MalformedResponseError( + "Failed to parse XML", body=self.body, driver=EC2NodeDriver + ) + + for err in body.findall("Errors/Error"): + code, message = list(err) + err_list.append("{}: {}".format(code.text, message.text)) + if code.text == "InvalidClientTokenId": raise InvalidCredsError(err_list[-1]) - if code.text == 'SignatureDoesNotMatch': + if code.text == "SignatureDoesNotMatch": raise InvalidCredsError(err_list[-1]) - if code.text == 'AuthFailure': + if code.text == "AuthFailure": raise InvalidCredsError(err_list[-1]) - if code.text == 'OptInRequired': + if code.text == "OptInRequired": raise InvalidCredsError(err_list[-1]) - if code.text == 'IdempotentParameterMismatch': + if code.text == "IdempotentParameterMismatch": raise IdempotentParamError(err_list[-1]) - if code.text == 'InvalidKeyPair.NotFound': + if code.text == "InvalidKeyPair.NotFound": # TODO: Use connection context instead - match = re.match(r'.*\'(.+?)\'.*', message.text) + match = re.match(r".*\'(.+?)\'.*", message.text) if match: name = match.groups()[0] else: name = None - raise KeyPairDoesNotExistError(name=name, - driver=self.connection.driver) - return '\n'.join(err_list) + raise KeyPairDoesNotExistError(name=name, driver=self.connection.driver) + return "\n".join(err_list) class EC2Connection(SignedAWSConnection): @@ -1774,12 +890,12 @@ class EC2Connection(SignedAWSConnection): """ version = API_VERSION - host = REGION_DETAILS['us-east-1']['endpoint'] + host = REGION_DETAILS_PARTIAL["us-east-1"]["endpoint"] responseCls = EC2Response - service_name = 'ec2' + service_name = "ec2" -class ExEC2AvailabilityZone(object): +class ExEC2AvailabilityZone: """ Extension class which stores information about an EC2 availability zone. @@ -1792,9 +908,11 @@ def __init__(self, name, zone_state, region_name): self.region_name = region_name def __repr__(self): - return (('') - % (self.name, self.zone_state, self.region_name)) + return ("") % ( + self.name, + self.zone_state, + self.region_name, + ) class EC2ReservedNode(Node): @@ -1806,16 +924,21 @@ class EC2ReservedNode(Node): """ def __init__(self, id, state, driver, size=None, image=None, extra=None): - super(EC2ReservedNode, self).__init__(id=id, name=None, state=state, - public_ips=None, - private_ips=None, - driver=driver, extra=extra) + super().__init__( + id=id, + name=None, + state=state, + public_ips=None, + private_ips=None, + driver=driver, + extra=extra, + ) def __repr__(self): - return (('') % (self.id)) + return ("") % (self.id) -class EC2SecurityGroup(object): +class EC2SecurityGroup: """ Represents information about a Security group @@ -1830,27 +953,44 @@ def __init__(self, id, name, ingress_rules, egress_rules, extra=None): self.extra = extra or {} def __repr__(self): - return (('' % (self.name, - self.strategy) + return "".format(self.name, self.strategy) -class EC2Network(object): +class EC2Network: """ Represents information about a VPC (Virtual Private Cloud) network @@ -1864,11 +1004,10 @@ def __init__(self, id, name, cidr_block, extra=None): self.extra = extra or {} def __repr__(self): - return (('') - % (self.ip, self.domain, self.instance_id)) + return ("") % ( + self.ip, + self.domain, + self.instance_id, + ) -class VPCInternetGateway(object): +class VPCInternetGateway: """ Class which stores information about VPC Internet Gateways. @@ -1952,18 +1093,17 @@ def __init__(self, id, name, vpc_id, state, driver, extra=None): self.extra = extra or {} def __repr__(self): - return (('') % (self.id)) + return ("") % (self.id) -class EC2RouteTable(object): +class EC2RouteTable: """ Class which stores information about VPC Route Tables. Note: This class is VPC specific. """ - def __init__(self, id, name, routes, subnet_associations, - propagating_gateway_ids, extra=None): + def __init__(self, id, name, routes, subnet_associations, propagating_gateway_ids, extra=None): """ :param id: The ID of the route table. :type id: ``str`` @@ -1993,18 +1133,27 @@ def __init__(self, id, name, routes, subnet_associations, self.extra = extra or {} def __repr__(self): - return (('') % (self.id)) + return ("") % (self.id) -class EC2Route(object): +class EC2Route: """ Class which stores information about a Route. Note: This class is VPC specific. """ - def __init__(self, cidr, gateway_id, instance_id, owner_id, - interface_id, state, origin, vpc_peering_connection_id): + def __init__( + self, + cidr, + gateway_id, + instance_id, + owner_id, + interface_id, + state, + origin, + vpc_peering_connection_id, + ): """ :param cidr: The CIDR block used for the destination match. :type cidr: ``str`` @@ -2042,10 +1191,10 @@ def __init__(self, cidr, gateway_id, instance_id, owner_id, self.vpc_peering_connection_id = vpc_peering_connection_id def __repr__(self): - return (('') % (self.cidr)) + return ("") % (self.cidr) -class EC2SubnetAssociation(object): +class EC2SubnetAssociation: """ Class which stores information about Route Table associated with a given Subnet in a VPC @@ -2074,7 +1223,65 @@ def __init__(self, id, route_table_id, subnet_id, main=False): self.main = main def __repr__(self): - return (('') % (self.id)) + return ("") % (self.id) + + +class EC2VolumeModification: + """ + Describes the modification status of an EBS volume. + + If the volume has never been modified, some element values will be null. + """ + + def __init__( + self, + end_time=None, + modification_state=None, + original_iops=None, + original_size=None, + original_volume_type=None, + progress=None, + start_time=None, + status_message=None, + target_iops=None, + target_size=None, + target_volume_type=None, + volume_id=None, + ): + self.end_time = end_time + self.modification_state = modification_state + self.original_iops = original_iops + self.original_size = original_size + self.original_volume_type = original_volume_type + self.progress = progress + self.start_time = start_time + self.status_message = status_message + self.target_iops = target_iops + self.target_size = target_size + self.target_volume_type = target_volume_type + self.volume_id = volume_id + + def __repr__(self): + return ( + "" + ) % ( + self.end_time, + self.modification_state, + self.original_iops, + self.original_size, + self.original_volume_type, + self.progress, + self.start_time, + self.status_message, + self.target_iops, + self.target_size, + self.target_volume_type, + self.volume_id, + ) class BaseEC2NodeDriver(NodeDriver): @@ -2085,50 +1292,59 @@ class BaseEC2NodeDriver(NodeDriver): """ connectionCls = EC2Connection - features = {'create_node': ['ssh_key']} - path = '/' + features = {"create_node": ["ssh_key"]} + path = "/" + region_name = "" + country = "" signature_version = DEFAULT_SIGNATURE_VERSION NODE_STATE_MAP = { - 'pending': NodeState.PENDING, - 'running': NodeState.RUNNING, - 'shutting-down': NodeState.UNKNOWN, - 'terminated': NodeState.TERMINATED + "pending": NodeState.PENDING, + "running": NodeState.RUNNING, + "shutting-down": NodeState.UNKNOWN, + "terminated": NodeState.TERMINATED, } # http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Volume.html VOLUME_STATE_MAP = { - 'available': StorageVolumeState.AVAILABLE, - 'in-use': StorageVolumeState.INUSE, - 'error': StorageVolumeState.ERROR, - 'creating': StorageVolumeState.CREATING, - 'deleting': StorageVolumeState.DELETING, - 'deleted': StorageVolumeState.DELETED, - 'error_deleting': StorageVolumeState.ERROR + "available": StorageVolumeState.AVAILABLE, + "in-use": StorageVolumeState.INUSE, + "error": StorageVolumeState.ERROR, + "creating": StorageVolumeState.CREATING, + "deleting": StorageVolumeState.DELETING, + "deleted": StorageVolumeState.DELETED, + "error_deleting": StorageVolumeState.ERROR, + } + + SNAPSHOT_STATE_MAP = { + "pending": VolumeSnapshotState.CREATING, + "completed": VolumeSnapshotState.AVAILABLE, + "error": VolumeSnapshotState.ERROR, } def list_nodes(self, ex_node_ids=None, ex_filters=None): + # type: (str, str) -> List[Node] """ - List all nodes + Lists all nodes. Ex_node_ids parameter is used to filter the list of nodes that should be returned. Only the nodes - with the corresponding node ids will be returned. + with the corresponding node IDs will be returned. :param ex_node_ids: List of ``node.id`` :type ex_node_ids: ``list`` of ``str`` - :param ex_filters: The filters so that the response includes - information for only certain nodes. + :param ex_filters: The filters so that the list includes + information for certain nodes only. :type ex_filters: ``dict`` :rtype: ``list`` of :class:`Node` """ - params = {'Action': 'DescribeInstances'} + params = {"Action": "DescribeInstances"} if ex_node_ids: - params.update(self._pathlist('InstanceId', ex_node_ids)) + params.update(self._pathlist("InstanceId", ex_node_ids)) if ex_filters: params.update(self._build_filters(ex_filters)) @@ -2136,9 +1352,8 @@ def list_nodes(self, ex_node_ids=None, ex_filters=None): elem = self.connection.request(self.path, params=params).object nodes = [] - for rs in findall(element=elem, xpath='reservationSet/item', - namespace=NAMESPACE): - nodes += self._to_nodes(rs, 'instancesSet/item') + for rs in findall(element=elem, xpath="reservationSet/item", namespace=NAMESPACE): + nodes += self._to_nodes(rs, "instancesSet/item") nodes_elastic_ips_mappings = self.ex_describe_addresses(nodes) @@ -2149,26 +1364,51 @@ def list_nodes(self, ex_node_ids=None, ex_filters=None): return nodes def list_sizes(self, location=None): - available_types = REGION_DETAILS[self.region_name]['instance_types'] + # NOTE: Those two imports are intentionally here and made lazy to + # avoid importing massive constant file in case it's not actually + # needed + from libcloud.compute.constants.ec2_instance_types import INSTANCE_TYPES + from libcloud.compute.constants.ec2_region_details_complete import REGION_DETAILS + + available_types = REGION_DETAILS[self.region_name]["instance_types"] sizes = [] for instance_type in available_types: attributes = INSTANCE_TYPES[instance_type] attributes = copy.deepcopy(attributes) - price = self._get_size_price(size_id=instance_type) - attributes.update({'price': price}) + try: + # we are only interested in pure size price so linux + price = get_size_price( + driver_type="compute", + driver_name="ec2_linux", + size_id=instance_type, + region=self.region_name, + ) + if price is None: + # it is a weird bare metal instance + attributes["price"] = None + else: + attributes["price"] = price + except KeyError: + attributes["price"] = None # pricing not available sizes.append(NodeSize(driver=self, **attributes)) return sizes - def list_images(self, location=None, ex_image_ids=None, ex_owner=None, - ex_executableby=None, ex_filters=None): + def list_images( + self, + location=None, + ex_image_ids=None, + ex_owner=None, + ex_executableby=None, + ex_filters=None, + ): """ - List all images + Lists all images @inherits: :class:`NodeDriver.list_images` Ex_image_ids parameter is used to filter the list of images that should be returned. Only the images - with the corresponding image ids will be returned. + with the corresponding image IDs will be returned. Ex_owner parameter is used to filter the list of images that should be returned. Only the images @@ -2184,7 +1424,7 @@ def list_images(self, location=None, ex_image_ids=None, ex_owner=None, Valid values: all|self|aws id Ex_filters parameter is used to filter the list of - images that should be returned. Only images matchind + images that should be returned. Only images matching the filter will be returned. :param ex_image_ids: List of ``NodeImage.id`` @@ -2201,30 +1441,28 @@ def list_images(self, location=None, ex_image_ids=None, ex_owner=None, :rtype: ``list`` of :class:`NodeImage` """ - params = {'Action': 'DescribeImages'} + params = {"Action": "DescribeImages"} if ex_owner: - params.update({'Owner.1': ex_owner}) + params.update({"Owner.1": ex_owner}) if ex_executableby: - params.update({'ExecutableBy.1': ex_executableby}) + params.update({"ExecutableBy.1": ex_executableby}) if ex_image_ids: for index, image_id in enumerate(ex_image_ids): index += 1 - params.update({'ImageId.%s' % (index): image_id}) + params.update({"ImageId.%s" % (index): image_id}) if ex_filters: params.update(self._build_filters(ex_filters)) - images = self._to_images( - self.connection.request(self.path, params=params).object - ) + images = self._to_images(self.connection.request(self.path, params=params).object) return images def get_image(self, image_id): """ - Get an image based on an image_id + Gets an image based on an image_id. :param image_id: Image identifier :type image_id: ``str`` @@ -2240,29 +1478,73 @@ def get_image(self, image_id): def list_locations(self): locations = [] - for index, availability_zone in \ - enumerate(self.ex_list_availability_zones()): - locations.append(EC2NodeLocation( - index, availability_zone.name, self.country, self, - availability_zone) - ) + + iterator = enumerate(self.ex_list_availability_zones()) + for index, availability_zone in iterator: + locations.append( + EC2NodeLocation( + index, availability_zone.name, self.country, self, availability_zone + ) + ) return locations - def list_volumes(self, node=None): + def list_volumes(self, node=None, ex_filters=None): + """ + List volumes that are attached to a node, if specified and those that + satisfy the filters, if specified. + + :param node: The node to which the volumes are attached. + :type node: :class:`Node` + + :param ex_filters: The dictionary of additional filters. + :type ex_filters: ``dict`` + + :return: The list of volumes that match the criteria. + :rtype: ``list`` of :class:`StorageVolume` + """ params = { - 'Action': 'DescribeVolumes', + "Action": "DescribeVolumes", } + if not ex_filters: + ex_filters = {} if node: - filters = {'attachment.instance-id': node.id} - params.update(self._build_filters(filters)) + ex_filters["attachment.instance-id"] = node.id + if node or ex_filters: + params.update(self._build_filters(ex_filters)) response = self.connection.request(self.path, params=params).object - volumes = [self._to_volume(el) for el in response.findall( - fixxpath(xpath='volumeSet/item', namespace=NAMESPACE)) + volumes = [ + self._to_volume(el) + for el in response.findall(fixxpath(xpath="volumeSet/item", namespace=NAMESPACE)) ] return volumes - def create_node(self, **kwargs): + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_keyname=None, + ex_userdata=None, + ex_security_groups=None, + ex_securitygroup=None, + ex_security_group_ids=None, + ex_metadata=None, + ex_mincount=1, + ex_maxcount=1, + ex_clienttoken=None, + ex_blockdevicemappings=None, + ex_iamprofile=None, + ex_ebs_optimized=None, + ex_subnet=None, + ex_placement_group=None, + ex_assign_public_ip=False, + ex_terminate_on_shutdown=False, + ex_spot=False, + ex_spot_max_price=None, + ): """ Create a new EC2 node. @@ -2300,8 +1582,8 @@ def create_node(self, **kwargs): mappings. :type ex_blockdevicemappings: ``list`` of ``dict`` - :keyword ex_iamprofile: Name or ARN of IAM profile - :type ex_iamprofile: ``str`` + :keyword ex_iam_profile: Name or ARN of IAM profile + :type ex_iam_profile: ``str`` :keyword ex_ebs_optimized: EBS-Optimized if True :type ex_ebs_optimized: ``bool`` @@ -2312,24 +1594,52 @@ def create_node(self, **kwargs): :keyword ex_placement_group: The name of the placement group to launch the instance into. :type ex_placement_group: ``str`` + + :keyword ex_assign_public_ip: If True, the instance will + be assigned a public ip address. + Note : It takes takes a short + while for the instance to be + assigned the public ip so the + node returned will NOT have + the public ip assigned yet. + :type ex_assign_public_ip: ``bool`` + + :keyword ex_terminate_on_shutdown: Indicates if the instance + should be terminated instead + of just shut down when using + the operating systems command + for system shutdown. + :type ex_terminate_on_shutdown: ``bool`` + + :keyword ex_spot: If true, ask for a Spot Instance instead of + requesting On-Demand. + :type ex_spot: ``bool`` + + :keyword ex_spot_max_price: Maximum price to pay for the spot + instance. If not specified, the + on-demand price will be used. + :type ex_spot_max_price: ``float`` """ - image = kwargs["image"] - size = kwargs["size"] params = { - 'Action': 'RunInstances', - 'ImageId': image.id, - 'MinCount': str(kwargs.get('ex_mincount', '1')), - 'MaxCount': str(kwargs.get('ex_maxcount', '1')), - 'InstanceType': size.id + "Action": "RunInstances", + "ImageId": image.id, + "MinCount": str(ex_mincount), + "MaxCount": str(ex_maxcount), + "InstanceType": size.id, } - if 'ex_security_groups' in kwargs and 'ex_securitygroup' in kwargs: - raise ValueError('You can only supply ex_security_groups or' - ' ex_securitygroup') + if ex_terminate_on_shutdown: + params["InstanceInitiatedShutdownBehavior"] = "terminate" + + if ex_spot: + params["InstanceMarketOptions.MarketType"] = "spot" + if ex_spot_max_price is not None: + params["InstanceMarketOptions.SpotOptions.MaxPrice"] = str(ex_spot_max_price) + + if ex_security_groups and ex_securitygroup: + raise ValueError("You can only supply ex_security_groups or" " ex_securitygroup") # ex_securitygroup is here for backward compatibility - ex_security_groups = kwargs.get('ex_security_groups', None) - ex_securitygroup = kwargs.get('ex_securitygroup', None) security_groups = ex_security_groups or ex_securitygroup if security_groups: @@ -2337,87 +1647,116 @@ def create_node(self, **kwargs): security_groups = [security_groups] for sig in range(len(security_groups)): - params['SecurityGroup.%d' % (sig + 1,)] =\ - security_groups[sig] + params["SecurityGroup.%d" % (sig + 1,)] = security_groups[sig] - if 'ex_security_group_ids' in kwargs and 'ex_subnet' not in kwargs: - raise ValueError('You can only supply ex_security_group_ids' - ' combinated with ex_subnet') + if ex_security_group_ids and not ex_subnet: + raise ValueError("You can only supply ex_security_group_ids" " combined with ex_subnet") - security_group_ids = kwargs.get('ex_security_group_ids', None) + security_group_ids = ex_security_group_ids + security_group_id_params = {} if security_group_ids: if not isinstance(security_group_ids, (tuple, list)): security_group_ids = [security_group_ids] for sig in range(len(security_group_ids)): - params['SecurityGroupId.%d' % (sig + 1,)] =\ - security_group_ids[sig] + security_group_id_params["SecurityGroupId.%d" % (sig + 1,)] = security_group_ids[ + sig + ] - if 'location' in kwargs: - availability_zone = getattr(kwargs['location'], - 'availability_zone', None) + if location: + availability_zone = getattr(location, "availability_zone", None) if availability_zone: if availability_zone.region_name != self.region_name: - raise AttributeError('Invalid availability zone: %s' - % (availability_zone.name)) - params['Placement.AvailabilityZone'] = availability_zone.name + raise AttributeError("Invalid availability zone: %s" % (availability_zone.name)) + params["Placement.AvailabilityZone"] = availability_zone.name - if 'auth' in kwargs and 'ex_keyname' in kwargs: - raise AttributeError('Cannot specify auth and ex_keyname together') + if auth and ex_keyname: + raise AttributeError("Cannot specify auth and ex_keyname together") - if 'auth' in kwargs: - auth = self._get_and_check_auth(kwargs['auth']) + if auth: + auth = self._get_and_check_auth(auth) + # pylint: disable=no-member key = self.ex_find_or_import_keypair_by_key_material(auth.pubkey) - params['KeyName'] = key['keyName'] + params["KeyName"] = key["keyName"] - if 'ex_keyname' in kwargs: - params['KeyName'] = kwargs['ex_keyname'] + if ex_keyname: + params["KeyName"] = ex_keyname - if 'ex_userdata' in kwargs: - params['UserData'] = base64.b64encode(b(kwargs['ex_userdata']))\ - .decode('utf-8') + if ex_userdata: + params["UserData"] = base64.b64encode(b(ex_userdata)).decode("utf-8") - if 'ex_clienttoken' in kwargs: - params['ClientToken'] = kwargs['ex_clienttoken'] + if ex_clienttoken: + params["ClientToken"] = ex_clienttoken - if 'ex_blockdevicemappings' in kwargs: - params.update(self._get_block_device_mapping_params( - kwargs['ex_blockdevicemappings'])) + if ex_blockdevicemappings: + params.update(self._get_block_device_mapping_params(ex_blockdevicemappings)) - if 'ex_iamprofile' in kwargs: - if not isinstance(kwargs['ex_iamprofile'], basestring): - raise AttributeError('ex_iamprofile not string') + if ex_iamprofile: + if not isinstance(ex_iamprofile, basestring): + raise AttributeError("ex_iamprofile not string") - if kwargs['ex_iamprofile'].startswith('arn:aws:iam:'): - params['IamInstanceProfile.Arn'] = kwargs['ex_iamprofile'] + if ex_iamprofile.startswith("arn:aws:iam:"): + params["IamInstanceProfile.Arn"] = ex_iamprofile else: - params['IamInstanceProfile.Name'] = kwargs['ex_iamprofile'] - - if 'ex_ebs_optimized' in kwargs: - params['EbsOptimized'] = kwargs['ex_ebs_optimized'] - - if 'ex_subnet' in kwargs: - params['SubnetId'] = kwargs['ex_subnet'].id - - if 'ex_placement_group' in kwargs and kwargs['ex_placement_group']: - params['Placement.GroupName'] = kwargs['ex_placement_group'] + params["IamInstanceProfile.Name"] = ex_iamprofile + + if ex_ebs_optimized: + params["EbsOptimized"] = ex_ebs_optimized + + subnet_id = None + if ex_subnet: + subnet_id = ex_subnet.id + + if ex_placement_group: + params["Placement.GroupName"] = ex_placement_group + + assign_public_ip = ex_assign_public_ip + # In the event that a public ip is requested a NetworkInterface + # needs to be specified. Some properties that would + # normally be at the root (security group ids and subnet id) + # need to be moved to the level of the NetworkInterface because + # the NetworkInterface is no longer created implicitly + if assign_public_ip: + root_key = "NetworkInterface.1." + params[root_key + "AssociatePublicIpAddress"] = "true" + # This means that when the instance is terminated, the + # NetworkInterface we created for the instance will be + # deleted automatically + params[root_key + "DeleteOnTermination"] = "true" + # Required to be 0 if we are associating a public ip + params[root_key + "DeviceIndex"] = "0" + + if subnet_id: + params[root_key + "SubnetId"] = subnet_id + + for key, security_group_id in security_group_id_params.items(): + key = root_key + key + params[key] = security_group_id + else: + params.update(security_group_id_params) + if subnet_id: + params["SubnetId"] = subnet_id + + # Specify tags at instance creation time + tags = {"Name": name} + if ex_metadata: + tags.update(ex_metadata) + tagspec_root = "TagSpecification.1." + params[tagspec_root + "ResourceType"] = "instance" + tag_nr = 1 + for k, v in tags.items(): + tag_root = tagspec_root + "Tag.%d." % tag_nr + params[tag_root + "Key"] = k + params[tag_root + "Value"] = v + tag_nr += 1 object = self.connection.request(self.path, params=params).object - nodes = self._to_nodes(object, 'instancesSet/item') + nodes = self._to_nodes(object, "instancesSet/item") for node in nodes: - tags = {'Name': kwargs['name']} - if 'ex_metadata' in kwargs: - tags.update(kwargs['ex_metadata']) - - try: - self.ex_create_tags(resource=node, tags=tags) - except Exception: - continue - - node.name = kwargs['name'] - node.extra.update({'tags': tags}) + node.name = name + node.extra.update({"tags": tags}) if len(nodes) == 1: return nodes[0] @@ -2425,19 +1764,29 @@ def create_node(self, **kwargs): return nodes def reboot_node(self, node): - params = {'Action': 'RebootInstances'} - params.update(self._pathlist('InstanceId', [node.id])) + params = {"Action": "RebootInstances"} + params.update(self._pathlist("InstanceId", [node.id])) res = self.connection.request(self.path, params=params).object return self._get_boolean(res) def destroy_node(self, node): - params = {'Action': 'TerminateInstances'} - params.update(self._pathlist('InstanceId', [node.id])) + params = {"Action": "TerminateInstances"} + params.update(self._pathlist("InstanceId", [node.id])) res = self.connection.request(self.path, params=params).object return self._get_terminate_boolean(res) - def create_volume(self, size, name, location=None, snapshot=None, - ex_volume_type='standard', ex_iops=None): + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + ex_volume_type="standard", + ex_iops=None, + ex_encrypted=False, + ex_kms_key_id=None, + ex_throughput=None, + ): """ Create a new volume. @@ -2462,71 +1811,101 @@ def create_volume(self, size, name, location=None, snapshot=None, :param ex_volume_type: Type of volume to create. :type ex_volume_type: ``str`` - :param iops: The number of I/O operations per second (IOPS) + :param ex_iops: The number of I/O operations per second (IOPS) that the volume supports. Only used if ex_volume_type - is io1. - :type iops: ``int`` + is io1, io2 or gp3. + :type ex_iops: ``int`` + + :param ex_encrypted: Specifies whether the volume should be encrypted. + :type ex_encrypted: ``bool`` + + :param ex_kms_key_id: The full ARN of the AWS Key Management + Service (AWS KMS) customer master key (CMK) to use + when creating the encrypted volume. + Example: + arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123 + -456a-a12b-a123b4cd56ef. + Only used if encrypted is set to True. + :type ex_kms_key_id: ``str`` + + :param ex_throughput: The throughput to provision for a volume, with a + maximum of 1,000 MiB/s. Only used if ex_volume_type + is gp3. + :type ex_throughput: ``int`` :return: The newly created volume. :rtype: :class:`StorageVolume` """ - valid_volume_types = ['standard', 'io1', 'gp2'] - params = { - 'Action': 'CreateVolume', - 'Size': str(size)} + params = {"Action": "CreateVolume", "Size": str(size)} - if ex_volume_type and ex_volume_type not in valid_volume_types: - raise ValueError('Invalid volume type specified: %s' % - (ex_volume_type)) + if ex_volume_type and ex_volume_type not in VALID_VOLUME_TYPES: + raise ValueError("Invalid volume type specified: %s" % (ex_volume_type)) if snapshot: - params['SnapshotId'] = snapshot.id + params["SnapshotId"] = snapshot.id - if location is not None: - params['AvailabilityZone'] = location.availability_zone.name + # AvailabilityZone argument is mandatory so if one is not provided, + # we select one + if not location: + location = self.list_locations()[0] + + params["AvailabilityZone"] = location.availability_zone.name if ex_volume_type: - params['VolumeType'] = ex_volume_type + params["VolumeType"] = ex_volume_type + + if ex_volume_type in ["io1", "io2", "gp3"] and ex_iops: + params["Iops"] = ex_iops - if ex_volume_type == 'io1' and ex_iops: - params['Iops'] = ex_iops + if ex_encrypted: + params["Encrypted"] = 1 + + if ex_kms_key_id is not None: + params["KmsKeyId"] = ex_kms_key_id + + if ex_volume_type == "gp3" and ex_throughput: + params["Throughput"] = ex_throughput volume = self._to_volume( - self.connection.request(self.path, params=params).object, - name=name) + self.connection.request(self.path, params=params).object, name=name + ) - if self.ex_create_tags(volume, {'Name': name}): - volume.extra['tags']['Name'] = name + if self.ex_create_tags(volume, {"Name": name}): + volume.extra["tags"]["Name"] = name return volume - def attach_volume(self, node, volume, device): + def attach_volume( + self, + node, + volume, + device=None, + ): params = { - 'Action': 'AttachVolume', - 'VolumeId': volume.id, - 'InstanceId': node.id, - 'Device': device} + "Action": "AttachVolume", + "VolumeId": volume.id, + "InstanceId": node.id, + "Device": device, + } self.connection.request(self.path, params=params) return True - def detach_volume(self, volume): - params = { - 'Action': 'DetachVolume', - 'VolumeId': volume.id} + def detach_volume(self, volume, ex_force=False): + params = {"Action": "DetachVolume", "VolumeId": volume.id} + if ex_force: + params["Force"] = 1 self.connection.request(self.path, params=params) return True def destroy_volume(self, volume): - params = { - 'Action': 'DeleteVolume', - 'VolumeId': volume.id} + params = {"Action": "DeleteVolume", "VolumeId": volume.id} response = self.connection.request(self.path, params=params).object return self._get_boolean(response) - def create_volume_snapshot(self, volume, name=None): + def create_volume_snapshot(self, volume, name=None, ex_metadata=None): """ Create snapshot from volume @@ -2536,96 +1915,88 @@ def create_volume_snapshot(self, volume, name=None): :param name: Name of snapshot (optional) :type name: ``str`` + :keyword ex_metadata: The Key/Value metadata to associate + with a snapshot (optional) + :type ex_metadata: ``dict`` + :rtype: :class:`VolumeSnapshot` """ params = { - 'Action': 'CreateSnapshot', - 'VolumeId': volume.id, + "Action": "CreateSnapshot", + "VolumeId": volume.id, } if name: - params.update({ - 'Description': name, - }) + params.update({"Description": name}) + if ex_metadata is None: + ex_metadata = {} + response = self.connection.request(self.path, params=params).object snapshot = self._to_snapshot(response, name) - if name and self.ex_create_tags(snapshot, {'Name': name}): - snapshot.extra['tags']['Name'] = name + ex_metadata.update(**{"Name": name} if name else {}) + if self.ex_create_tags(snapshot, ex_metadata): + snapshot.extra["tags"] = ex_metadata return snapshot def list_volume_snapshots(self, volume): - return [snapshot for snapshot in self.list_snapshots(owner='self') - if snapshot.extra["volume_id"] == volume.id] + return [ + snapshot + for snapshot in self.list_snapshots(owner="self") + if snapshot.extra["volume_id"] == volume.id + ] def list_snapshots(self, snapshot=None, owner=None): """ - Describe all snapshots. + Describes all snapshots. - :param snapshot: If provided, only return snapshot information for the + :param snapshot: If provided, only returns snapshot information for the provided snapshot. - :param owner: Owner for snapshot: self|amazon|ID + :param owner: The owner of the snapshot: self|amazon|ID :type owner: ``str`` :rtype: ``list`` of :class:`VolumeSnapshot` """ params = { - 'Action': 'DescribeSnapshots', + "Action": "DescribeSnapshots", } if snapshot: - params.update({ - 'SnapshotId.1': snapshot.id, - }) + params.update({"SnapshotId.1": snapshot.id}) if owner: - params.update({ - 'Owner.1': owner, - }) + params.update({"Owner.1": owner}) response = self.connection.request(self.path, params=params).object snapshots = self._to_snapshots(response) return snapshots def destroy_volume_snapshot(self, snapshot): - params = { - 'Action': 'DeleteSnapshot', - 'SnapshotId': snapshot.id - } + params = {"Action": "DeleteSnapshot", "SnapshotId": snapshot.id} response = self.connection.request(self.path, params=params).object return self._get_boolean(response) # Key pair management methods def list_key_pairs(self): - params = { - 'Action': 'DescribeKeyPairs' - } + params = {"Action": "DescribeKeyPairs"} response = self.connection.request(self.path, params=params) - elems = findall(element=response.object, xpath='keySet/item', - namespace=NAMESPACE) + elems = findall(element=response.object, xpath="keySet/item", namespace=NAMESPACE) key_pairs = self._to_key_pairs(elems=elems) return key_pairs def get_key_pair(self, name): - params = { - 'Action': 'DescribeKeyPairs', - 'KeyName': name - } + params = {"Action": "DescribeKeyPairs", "KeyName": name} response = self.connection.request(self.path, params=params) - elems = findall(element=response.object, xpath='keySet/item', - namespace=NAMESPACE) + elems = findall(element=response.object, xpath="keySet/item", namespace=NAMESPACE) key_pair = self._to_key_pairs(elems=elems)[0] return key_pair def create_key_pair(self, name): - params = { - 'Action': 'CreateKeyPair', - 'KeyName': name - } + params = {"Action": "CreateKeyPair", "KeyName": name} response = self.connection.request(self.path, params=params) elem = response.object @@ -2636,9 +2007,9 @@ def import_key_pair_from_string(self, name, key_material): base64key = ensure_string(base64.b64encode(b(key_material))) params = { - 'Action': 'ImportKeyPair', - 'KeyName': name, - 'PublicKeyMaterial': base64key + "Action": "ImportKeyPair", + "KeyName": name, + "PublicKeyMaterial": base64key, } response = self.connection.request(self.path, params=params) @@ -2647,15 +2018,18 @@ def import_key_pair_from_string(self, name, key_material): return key_pair def delete_key_pair(self, key_pair): - params = { - 'Action': 'DeleteKeyPair', - 'KeyName': key_pair.name - } + params = {"Action": "DeleteKeyPair", "KeyName": key_pair.name} res = self.connection.request(self.path, params=params).object return self._get_boolean(res) - def copy_image(self, image, source_region, name=None, description=None): + def copy_image( + self, + source_region, + node_image, + name, + description=None, + ): """ Copy an Amazon Machine Image from the specified source region to the current region. @@ -2665,8 +2039,8 @@ def copy_image(self, image, source_region, name=None, description=None): :param source_region: The region where the image resides :type source_region: ``str`` - :param image: Instance of class NodeImage - :type image: :class:`NodeImage` + :param node_image: Instance of class NodeImage + :type node_image: :class:`NodeImage` :param name: The name of the new image :type name: ``str`` @@ -2677,23 +2051,24 @@ def copy_image(self, image, source_region, name=None, description=None): :return: Instance of class ``NodeImage`` :rtype: :class:`NodeImage` """ - params = {'Action': 'CopyImage', - 'SourceRegion': source_region, - 'SourceImageId': image.id} + image = node_image + params = { + "Action": "CopyImage", + "SourceRegion": source_region, + "SourceImageId": image.id, + } if name is not None: - params['Name'] = name + params["Name"] = name if description is not None: - params['Description'] = description + params["Description"] = description - image = self._to_image( - self.connection.request(self.path, params=params).object) + image = self._to_image(self.connection.request(self.path, params=params).object) return image - def create_image(self, node, name, description=None, reboot=False, - block_device_mapping=None): + def create_image(self, node, name, description=None, reboot=False, block_device_mapping=None): """ Create an Amazon Machine Image based off of an EBS-backed instance. @@ -2730,72 +2105,238 @@ def create_image(self, node, name, description=None, reboot=False, :return: Instance of class ``NodeImage`` :rtype: :class:`NodeImage` """ - params = {'Action': 'CreateImage', - 'InstanceId': node.id, - 'Name': name, - 'NoReboot': not reboot} + params = { + "Action": "CreateImage", + "InstanceId": node.id, + "Name": name, + "NoReboot": not reboot, + } if description is not None: - params['Description'] = description + params["Description"] = description if block_device_mapping is not None: - params.update(self._get_block_device_mapping_params( - block_device_mapping)) + params.update(self._get_block_device_mapping_params(block_device_mapping)) - image = self._to_image( - self.connection.request(self.path, params=params).object) + image = self._to_image(self.connection.request(self.path, params=params).object) return image - def delete_image(self, image): + def delete_image( + self, + node_image, + ): """ Deletes an image at Amazon given a NodeImage object @inherits: :class:`NodeDriver.delete_image` - :param image: Instance of ``NodeImage`` - :type image: :class: `NodeImage` + :param node_image: Instance of ``NodeImage`` + :type node_image: :class: `NodeImage` :rtype: ``bool`` """ - params = {'Action': 'DeregisterImage', - 'ImageId': image.id} + image = node_image + params = {"Action": "DeregisterImage", "ImageId": image.id} response = self.connection.request(self.path, params=params).object return self._get_boolean(response) + def start_node(self, node): + """ + Starts the node by passing in the node object, does not work with + instance store backed instances. + + :param node: The node to be used + :type node: :class:`Node` + + :rtype: ``bool`` + """ + params = {"Action": "StartInstances"} + params.update(self._pathlist("InstanceId", [node.id])) + res = self.connection.request(self.path, params=params).object + return self._get_state_boolean(res) + + def stop_node(self, node): + """ + Stops the node by passing in the node object, does not work with + instance store backed instances + + :param node: The node to be used + :type node: :class:`Node` + + :rtype: ``bool`` + """ + params = {"Action": "StopInstances"} + params.update(self._pathlist("InstanceId", [node.id])) + res = self.connection.request(self.path, params=params).object + return self._get_state_boolean(res) + def ex_create_placement_group(self, name): """ - Creates new Placement Group + Creates a new placement group. - :param name: Name for new placement Group + :param name: The name for the new placement group :type name: ``str`` :rtype: ``bool`` """ - params = {'Action': 'CreatePlacementGroup', - 'Strategy': 'cluster', - 'GroupName': name} + params = { + "Action": "CreatePlacementGroup", + "Strategy": "cluster", + "GroupName": name, + } response = self.connection.request(self.path, params=params).object return self._get_boolean(response) def ex_delete_placement_group(self, name): """ - Deletes Placement Group + Deletes a placement group. - :param name: Placement Group name + :param name: The placement group name :type name: ``str`` :rtype: ``bool`` """ - params = {'Action': 'DeletePlacementGroup', - 'GroupName': name} + params = {"Action": "DeletePlacementGroup", "GroupName": name} response = self.connection.request(self.path, params=params).object return self._get_boolean(response) + def ex_import_snapshot( + self, + client_data=None, + client_token=None, + description=None, + disk_container=None, + dry_run=None, + role_name=None, + ): + """ + Imports a disk into an EBS snapshot. More information can be found + at https://goo.gl/sbXkYA. + + :param client_data: Describes the client specific data (optional) + :type client_data: ``dict`` + + :param client_token: The token to enable idempotency for VM + (optional) + :type client_token: ``str`` + + :param description: The description string for the + import snapshot task.(optional) + :type description: ``str`` + + :param disk_container:The disk container object for the + import snapshot request. + :type disk_container:``dict`` + + :param dry_run: Checks whether you have the permission for + the action, without actually making the request, + and provides an error response.(optional) + :type dry_run: ``bool`` + + :param role_name: The name of the role to use when not using the + default role, 'vmimport'.(optional) + :type role_name: ``str`` + + :rtype: :class: ``VolumeSnapshot`` + """ + + params = {"Action": "ImportSnapshot"} + + # TODO: This method isn't defined anywhere? + # if client_data is not None: + # params.update(self._get_client_date_params(client_data)) + + if client_token is not None: + params["ClientToken"] = client_token + + if description is not None: + params["Description"] = description + + if disk_container is not None: + params.update(self._get_disk_container_params(disk_container)) + + if dry_run is not None: + params["DryRun"] = dry_run + + if role_name is not None: + params["RoleName"] = role_name + + importSnapshot = self.connection.request(self.path, params=params).object + + importTaskId = findtext(element=importSnapshot, xpath="importTaskId", namespace=NAMESPACE) + + volumeSnapshot = self._wait_for_import_snapshot_completion( + import_task_id=importTaskId, timeout=1800, interval=15 + ) + + return volumeSnapshot + + def _wait_for_import_snapshot_completion(self, import_task_id, timeout=1800, interval=15): + """ + It waits for import snapshot to be completed + + :param import_task_id: Import task Id for the + current Import Snapshot Task + :type import_task_id: ``str`` + + :param timeout: Timeout value for snapshot generation + :type timeout: ``float`` + + :param interval: Time interval for repetitive describe + import snapshot tasks requests + :type interval: ``float`` + + :rtype: :class:``VolumeSnapshot`` + """ + start_time = time.time() + snapshotId = None + while snapshotId is None: + if time.time() - start_time >= timeout: + raise Exception("Timeout while waiting " "for import task Id %s" % import_task_id) + res = self.ex_describe_import_snapshot_tasks(import_task_id) + snapshotId = res.snapshotId + + if snapshotId is None: + time.sleep(interval) + + volumeSnapshot = VolumeSnapshot(snapshotId, driver=self) + return volumeSnapshot + + def ex_describe_import_snapshot_tasks(self, import_task_id, dry_run=None): + """ + Describes your import snapshot tasks. More information can be found + at https://goo.gl/CI0MdS. + + :param import_task_id: Import task Id for the current + Import Snapshot Task + :type import_task_id: ``str`` + + :param dry_run: Checks whether you have the permission for + the action, without actually making the request, + and provides an error response.(optional) + :type dry_run: ``bool`` + + :rtype: :class:``DescribeImportSnapshotTasks Object`` + + """ + params = {"Action": "DescribeImportSnapshotTasks"} + + if dry_run is not None: + params["DryRun"] = dry_run + + # This can be extended for multiple import snapshot tasks + params["ImportTaskId.1"] = import_task_id + + res = self._to_import_snapshot_task( + self.connection.request(self.path, params=params).object + ) + return res + def ex_list_placement_groups(self, names=None): """ - List Placement Groups + A list of placement groups. :param names: Placement Group names :type names: ``list`` of ``str`` @@ -2803,18 +2344,33 @@ def ex_list_placement_groups(self, names=None): :rtype: ``list`` of :class:`.EC2PlacementGroup` """ names = names or [] - params = {'Action': 'DescribePlacementGroups'} + params = {"Action": "DescribePlacementGroups"} for index, name in enumerate(names): - params['GroupName.%s' % index + 1] = name + params["GroupName.%s" % index + 1] = name response = self.connection.request(self.path, params=params).object return self._to_placement_groups(response) - def ex_register_image(self, name, description=None, architecture=None, - image_location=None, root_device_name=None, - block_device_mapping=None, kernel_id=None, - ramdisk_id=None, virtualization_type=None): + def ex_register_image( + self, + name, + description=None, + architecture=None, + image_location=None, + root_device_name=None, + block_device_mapping=None, + kernel_id=None, + ramdisk_id=None, + virtualization_type=None, + ena_support=None, + billing_products=None, + sriov_net_support=None, + boot_mode: str = None, + tpm_support: str = None, + uefi_data: str = None, + imds_support: str = None, + ): """ Registers an Amazon Machine Image based off of an EBS-backed instance. Can also be used to create images from snapshots. More information @@ -2854,73 +2410,114 @@ def ex_register_image(self, name, description=None, architecture=None, or hvm (optional) :type virtualization_type: ``str`` + :param ena_support: Enable enhanced networking with Elastic + Network Adapter for the AMI + :type ena_support: ``bool`` + + :param billing_products: The billing product codes + :type billing_products: ''list'' + + :param sriov_net_support: Set to "simple" to enable enhanced + networking with the Intel 82599 Virtual + Function interface + :type sriov_net_support: ``str`` + + :param boot_mode: desired boot mode for the AMI. + :type boot_mode: ``str`` + + :param tpm_support: set to ``v2.0`` to enable TPM support. + :type tpm_support: ``str`` + + :param uefi_data: base64 representation of the non-volatile UEFI + variable store. + :type uefi_data: ``str`` + + :param imds_support: set to ``v2.0`` to require HTTP tokens when + accessing the IMDS on instances launched + from the resulting image. + :type imds_support: ``str`` + :rtype: :class:`NodeImage` """ - params = {'Action': 'RegisterImage', - 'Name': name} + params = {"Action": "RegisterImage", "Name": name} if description is not None: - params['Description'] = description + params["Description"] = description if architecture is not None: - params['Architecture'] = architecture + params["Architecture"] = architecture if image_location is not None: - params['ImageLocation'] = image_location + params["ImageLocation"] = image_location if root_device_name is not None: - params['RootDeviceName'] = root_device_name + params["RootDeviceName"] = root_device_name if block_device_mapping is not None: - params.update(self._get_block_device_mapping_params( - block_device_mapping)) + params.update(self._get_block_device_mapping_params(block_device_mapping)) if kernel_id is not None: - params['KernelId'] = kernel_id + params["KernelId"] = kernel_id if ramdisk_id is not None: - params['RamDiskId'] = ramdisk_id + params["RamDiskId"] = ramdisk_id if virtualization_type is not None: - params['VirtualizationType'] = virtualization_type + params["VirtualizationType"] = virtualization_type - image = self._to_image( - self.connection.request(self.path, params=params).object - ) + if ena_support is not None: + params["EnaSupport"] = ena_support + + if billing_products is not None: + params.update(self._get_billing_product_params(billing_products)) + + if sriov_net_support is not None: + params["SriovNetSupport"] = sriov_net_support + + if boot_mode is not None: + params["BootMode"] = boot_mode + + if tpm_support is not None: + params["TpmSupport"] = tpm_support + + if uefi_data is not None: + params["UefiData"] = uefi_data + + if imds_support is not None: + params["ImdsSupport"] = imds_support + + image = self._to_image(self.connection.request(self.path, params=params).object) return image def ex_list_networks(self, network_ids=None, filters=None): """ - Return a list of :class:`EC2Network` objects for the + Returns a list of :class:`EC2Network` objects for the current region. - :param network_ids: Return only networks matching the provided + :param network_ids: Returns only networks matching the provided network IDs. If not specified, a list of all the networks in the corresponding region is returned. :type network_ids: ``list`` - :param filters: The filters so that the response includes - information for only certain networks. + :param filters: The filters so that the list returned includes + information for certain networks only. :type filters: ``dict`` :rtype: ``list`` of :class:`EC2Network` """ - params = {'Action': 'DescribeVpcs'} + params = {"Action": "DescribeVpcs"} if network_ids: - params.update(self._pathlist('VpcId', network_ids)) + params.update(self._pathlist("VpcId", network_ids)) if filters: params.update(self._build_filters(filters)) - return self._to_networks( - self.connection.request(self.path, params=params).object - ) + return self._to_networks(self.connection.request(self.path, params=params).object) - def ex_create_network(self, cidr_block, name=None, - instance_tenancy='default'): + def ex_create_network(self, cidr_block, name=None, instance_tenancy="default"): """ Create a network/VPC @@ -2938,18 +2535,19 @@ def ex_create_network(self, cidr_block, name=None, :return: Dictionary of network properties :rtype: ``dict`` """ - params = {'Action': 'CreateVpc', - 'CidrBlock': cidr_block, - 'InstanceTenancy': instance_tenancy} + params = { + "Action": "CreateVpc", + "CidrBlock": cidr_block, + "InstanceTenancy": instance_tenancy, + } response = self.connection.request(self.path, params=params).object - element = response.findall(fixxpath(xpath='vpc', - namespace=NAMESPACE))[0] + element = response.findall(fixxpath(xpath="vpc", namespace=NAMESPACE))[0] network = self._to_network(element, name) - if name and self.ex_create_tags(network, {'Name': name}): - network.extra['tags']['Name'] = name + if name and self.ex_create_tags(network, {"Name": name}): + network.extra["tags"]["Name"] = name return network @@ -2962,7 +2560,7 @@ def ex_delete_network(self, vpc): :rtype: ``bool`` """ - params = {'Action': 'DeleteVpc', 'VpcId': vpc.id} + params = {"Action": "DeleteVpc", "VpcId": vpc.id} res = self.connection.request(self.path, params=params).object @@ -2970,37 +2568,34 @@ def ex_delete_network(self, vpc): def ex_list_subnets(self, subnet_ids=None, filters=None): """ - Return a list of :class:`EC2NetworkSubnet` objects for the + Returns a list of :class:`EC2NetworkSubnet` objects for the current region. - :param subnet_ids: Return only subnets matching the provided + :param subnet_ids: Returns only subnets matching the provided subnet IDs. If not specified, a list of all the subnets in the corresponding region is returned. :type subnet_ids: ``list`` - :param filters: The filters so that the response includes - information for only certain subnets. + :param filters: The filters so that the list returned includes + information for certain subnets only. :type filters: ``dict`` :rtype: ``list`` of :class:`EC2NetworkSubnet` """ - params = {'Action': 'DescribeSubnets'} + params = {"Action": "DescribeSubnets"} if subnet_ids: - params.update(self._pathlist('SubnetId', subnet_ids)) + params.update(self._pathlist("SubnetId", subnet_ids)) if filters: params.update(self._build_filters(filters)) - return self._to_subnets( - self.connection.request(self.path, params=params).object - ) + return self._to_subnets(self.connection.request(self.path, params=params).object) - def ex_create_subnet(self, vpc_id, cidr_block, - availability_zone, name=None): + def ex_create_subnet(self, vpc_id, cidr_block, availability_zone, name=None): """ - Create a network subnet within a VPC + Creates a network subnet within a VPC. :param vpc_id: The ID of the VPC that the subnet should be associated with @@ -3018,22 +2613,57 @@ def ex_create_subnet(self, vpc_id, cidr_block, :rtype: :class: `EC2NetworkSubnet` """ - params = {'Action': 'CreateSubnet', - 'VpcId': vpc_id, - 'CidrBlock': cidr_block, - 'AvailabilityZone': availability_zone} + params = { + "Action": "CreateSubnet", + "VpcId": vpc_id, + "CidrBlock": cidr_block, + "AvailabilityZone": availability_zone, + } response = self.connection.request(self.path, params=params).object - element = response.findall(fixxpath(xpath='subnet', - namespace=NAMESPACE))[0] + element = response.findall(fixxpath(xpath="subnet", namespace=NAMESPACE))[0] subnet = self._to_subnet(element, name) - if name and self.ex_create_tags(subnet, {'Name': name}): - subnet.extra['tags']['Name'] = name + if name and self.ex_create_tags(subnet, {"Name": name}): + subnet.extra["tags"]["Name"] = name return subnet + def ex_modify_subnet_attribute(self, subnet, attribute="auto_public_ip", value=False): + """ + Modifies a subnet attribute. + You can only modify one attribute at a time. + + :param subnet: The subnet to delete + :type subnet: :class:`.EC2NetworkSubnet` + + :param attribute: The attribute to set on the subnet; one of: + ``'auto_public_ip'``: Automatically allocate a + public IP address when a server is created + ``'auto_ipv6'``: Automatically assign an IPv6 + address when a server is created + :type attribute: ``str`` + + :param value: The value to set the subnet attribute to + (defaults to ``False``) + :type value: ``bool`` + + :rtype: ``bool`` + """ + params = {"Action": "ModifySubnetAttribute", "SubnetId": subnet.id} + + if attribute == "auto_public_ip": + params["MapPublicIpOnLaunch.Value"] = value + elif attribute == "auto_ipv6": + params["AssignIpv6AddressOnCreation.Value"] = value + else: + raise ValueError("Unsupported attribute: %s" % (attribute)) + + res = self.connection.request(self.path, params=params).object + + return self._get_boolean(res) + def ex_delete_subnet(self, subnet): """ Deletes a VPC subnet. @@ -3043,7 +2673,7 @@ def ex_delete_subnet(self, subnet): :rtype: ``bool`` """ - params = {'Action': 'DeleteSubnet', 'SubnetId': subnet.id} + params = {"Action": "DeleteSubnet", "SubnetId": subnet.id} res = self.connection.request(self.path, params=params).object @@ -3051,54 +2681,51 @@ def ex_delete_subnet(self, subnet): def ex_list_security_groups(self): """ - List existing Security Groups. + Lists existing Security Groups. @note: This is a non-standard extension API, and only works for EC2. :rtype: ``list`` of ``str`` """ - params = {'Action': 'DescribeSecurityGroups'} + params = {"Action": "DescribeSecurityGroups"} response = self.connection.request(self.path, params=params).object groups = [] - for group in findall(element=response, xpath='securityGroupInfo/item', - namespace=NAMESPACE): - name = findtext(element=group, xpath='groupName', - namespace=NAMESPACE) + for group in findall(element=response, xpath="securityGroupInfo/item", namespace=NAMESPACE): + name = findtext(element=group, xpath="groupName", namespace=NAMESPACE) groups.append(name) return groups - def ex_get_security_groups(self, group_ids=None, - group_names=None, filters=None): + def ex_get_security_groups(self, group_ids=None, group_names=None, filters=None): """ - Return a list of :class:`EC2SecurityGroup` objects for the + Returns a list of :class:`EC2SecurityGroup` objects for the current region. - :param group_ids: Return only groups matching the provided + :param group_ids: Returns only groups matching the provided group IDs. :type group_ids: ``list`` - :param group_names: Return only groups matching the provided + :param group_names: Returns only groups matching the provided group names. :type group_ids: ``list`` - :param filters: The filters so that the response includes - information for only specific security groups. + :param filters: The filters so that the list returned includes + information for specific security groups only. :type filters: ``dict`` :rtype: ``list`` of :class:`EC2SecurityGroup` """ - params = {'Action': 'DescribeSecurityGroups'} + params = {"Action": "DescribeSecurityGroups"} if group_ids: - params.update(self._pathlist('GroupId', group_ids)) + params.update(self._pathlist("GroupId", group_ids)) if group_names: for name_idx, group_name in enumerate(group_names): name_idx += 1 # We want 1-based indexes - name_key = 'GroupName.%s' % (name_idx) + name_key = "GroupName.%s" % (name_idx) params[name_key] = group_name if filters: @@ -3111,7 +2738,7 @@ def ex_create_security_group(self, name, description, vpc_id=None): """ Creates a new Security Group in EC2-Classic or a targeted VPC. - :param name: The name of the security group to Create. + :param name: The name of the security group to create. This must be unique. :type name: ``str`` @@ -3124,30 +2751,29 @@ def ex_create_security_group(self, name, description, vpc_id=None): :rtype: ``dict`` """ - params = {'Action': 'CreateSecurityGroup', - 'GroupName': name, - 'GroupDescription': description} + params = { + "Action": "CreateSecurityGroup", + "GroupName": name, + "GroupDescription": description, + } if vpc_id is not None: - params['VpcId'] = vpc_id + params["VpcId"] = vpc_id response = self.connection.request(self.path, params=params).object - group_id = findattr(element=response, xpath='groupId', - namespace=NAMESPACE) - return { - 'group_id': group_id - } + group_id = findattr(element=response, xpath="groupId", namespace=NAMESPACE) + return {"group_id": group_id} def ex_delete_security_group_by_id(self, group_id): """ - Deletes a new Security Group using the group id. + Deletes a new Security Group using the group ID. :param group_id: The ID of the security group :type group_id: ``str`` :rtype: ``bool`` """ - params = {'Action': 'DeleteSecurityGroup', 'GroupId': group_id} + params = {"Action": "DeleteSecurityGroup", "GroupId": group_id} res = self.connection.request(self.path, params=params).object @@ -3162,7 +2788,7 @@ def ex_delete_security_group_by_name(self, group_name): :rtype: ``bool`` """ - params = {'Action': 'DeleteSecurityGroup', 'GroupName': group_name} + params = {"Action": "DeleteSecurityGroup", "GroupName": group_name} res = self.connection.request(self.path, params=params).object @@ -3170,7 +2796,7 @@ def ex_delete_security_group_by_name(self, group_name): def ex_delete_security_group(self, name): """ - Wrapper method which calls ex_delete_security_group_by_name. + A wrapper method which calls ex_delete_security_group_by_name. :param name: The name of the security group :type name: ``str`` @@ -3179,8 +2805,7 @@ def ex_delete_security_group(self, name): """ return self.ex_delete_security_group_by_name(name) - def ex_authorize_security_group(self, name, from_port, to_port, cidr_ip, - protocol='tcp'): + def ex_authorize_security_group(self, name, from_port, to_port, cidr_ip, protocol="tcp"): """ Edit a Security Group to allow specific traffic. @@ -3204,24 +2829,31 @@ def ex_authorize_security_group(self, name, from_port, to_port, cidr_ip, :rtype: ``bool`` """ - params = {'Action': 'AuthorizeSecurityGroupIngress', - 'GroupName': name, - 'IpProtocol': protocol, - 'FromPort': str(from_port), - 'ToPort': str(to_port), - 'CidrIp': cidr_ip} + params = { + "Action": "AuthorizeSecurityGroupIngress", + "GroupName": name, + "IpProtocol": protocol, + "FromPort": str(from_port), + "ToPort": str(to_port), + "CidrIp": cidr_ip, + } try: - res = self.connection.request( - self.path, params=params.copy()).object + res = self.connection.request(self.path, params=params.copy()).object return self._get_boolean(res) - except Exception: - e = sys.exc_info()[1] - if e.args[0].find('InvalidPermission.Duplicate') == -1: + except Exception as e: + if e.args[0].find("InvalidPermission.Duplicate") == -1: raise e - def ex_authorize_security_group_ingress(self, id, from_port, to_port, - cidr_ips=None, group_pairs=None, - protocol='tcp'): + def ex_authorize_security_group_ingress( + self, + id, + from_port, + to_port, + cidr_ips=None, + group_pairs=None, + protocol="tcp", + description=None, + ): """ Edit a Security Group to allow specific ingress traffic using CIDR blocks or either a group ID, group name or user ID (account). @@ -3235,7 +2867,7 @@ def ex_authorize_security_group_ingress(self, id, from_port, to_port, :param to_port: The end of the port range to open :type to_port: ``int`` - :param cidr_ips: The list of ip ranges to allow traffic for. + :param cidr_ips: The list of IP ranges to allow traffic for. :type cidr_ips: ``list`` :param group_pairs: Source user/group pairs to allow traffic for. @@ -3246,8 +2878,8 @@ def ex_authorize_security_group_ingress(self, id, from_port, to_port, [{'group_name': 'default', 'user_id': '1234567890'}] - VPC Example: Allow access from any system associated with - security group sg-47ad482e on your own account + VPC example: To allow access from any system associated + with security group sg-47ad482e on your own account [{'group_id': ' sg-47ad482e'}] :type group_pairs: ``list`` of ``dict`` @@ -3255,25 +2887,25 @@ def ex_authorize_security_group_ingress(self, id, from_port, to_port, :param protocol: tcp/udp/icmp :type protocol: ``str`` + :param description: description to be added to the rules inserted + :type description: ``str`` + :rtype: ``bool`` """ - params = self._get_common_security_group_params(id, - protocol, - from_port, - to_port, - cidr_ips, - group_pairs) + params = self._get_common_security_group_params( + id, protocol, from_port, to_port, cidr_ips, group_pairs, description + ) - params["Action"] = 'AuthorizeSecurityGroupIngress' + params["Action"] = "AuthorizeSecurityGroupIngress" res = self.connection.request(self.path, params=params).object return self._get_boolean(res) - def ex_authorize_security_group_egress(self, id, from_port, to_port, - cidr_ips, group_pairs=None, - protocol='tcp'): + def ex_authorize_security_group_egress( + self, id, from_port, to_port, cidr_ips, group_pairs=None, protocol="tcp" + ): """ Edit a Security Group to allow specific egress traffic using CIDR blocks or either a group ID, group name or user ID (account). @@ -3312,27 +2944,24 @@ def ex_authorize_security_group_egress(self, id, from_port, to_port, :rtype: ``bool`` """ - params = self._get_common_security_group_params(id, - protocol, - from_port, - to_port, - cidr_ips, - group_pairs) + params = self._get_common_security_group_params( + id, protocol, from_port, to_port, cidr_ips, group_pairs + ) - params["Action"] = 'AuthorizeSecurityGroupEgress' + params["Action"] = "AuthorizeSecurityGroupEgress" res = self.connection.request(self.path, params=params).object return self._get_boolean(res) - def ex_revoke_security_group_ingress(self, id, from_port, to_port, - cidr_ips=None, group_pairs=None, - protocol='tcp'): + def ex_revoke_security_group_ingress( + self, id, from_port, to_port, cidr_ips=None, group_pairs=None, protocol="tcp" + ): """ - Edit a Security Group to revoke specific ingress traffic using + Edits a Security Group to revoke specific ingress traffic using CIDR blocks or either a group ID, group name or user ID (account). - :param id: The id of the security group to edit + :param id: The ID of the security group to edit :type id: ``str`` :param from_port: The beginning of the port range to open @@ -3364,22 +2993,19 @@ def ex_revoke_security_group_ingress(self, id, from_port, to_port, :rtype: ``bool`` """ - params = self._get_common_security_group_params(id, - protocol, - from_port, - to_port, - cidr_ips, - group_pairs) + params = self._get_common_security_group_params( + id, protocol, from_port, to_port, cidr_ips, group_pairs + ) - params["Action"] = 'RevokeSecurityGroupIngress' + params["Action"] = "RevokeSecurityGroupIngress" res = self.connection.request(self.path, params=params).object return self._get_boolean(res) - def ex_revoke_security_group_egress(self, id, from_port, to_port, - cidr_ips=None, group_pairs=None, - protocol='tcp'): + def ex_revoke_security_group_egress( + self, id, from_port, to_port, cidr_ips=None, group_pairs=None, protocol="tcp" + ): """ Edit a Security Group to revoke specific egress traffic using CIDR blocks or either a group ID, group name or user ID (account). @@ -3418,14 +3044,11 @@ def ex_revoke_security_group_egress(self, id, from_port, to_port, :rtype: ``bool`` """ - params = self._get_common_security_group_params(id, - protocol, - from_port, - to_port, - cidr_ips, - group_pairs) + params = self._get_common_security_group_params( + id, protocol, from_port, to_port, cidr_ips, group_pairs + ) - params['Action'] = 'RevokeSecurityGroupEgress' + params["Action"] = "RevokeSecurityGroupEgress" res = self.connection.request(self.path, params=params).object @@ -3444,84 +3067,70 @@ def ex_authorize_security_group_permissive(self, name): """ results = [] - params = {'Action': 'AuthorizeSecurityGroupIngress', - 'GroupName': name, - 'IpProtocol': 'tcp', - 'FromPort': '0', - 'ToPort': '65535', - 'CidrIp': '0.0.0.0/0'} + params = { + "Action": "AuthorizeSecurityGroupIngress", + "GroupName": name, + "IpProtocol": "tcp", + "FromPort": "0", + "ToPort": "65535", + "CidrIp": "0.0.0.0/0", + } try: - results.append( - self.connection.request(self.path, params=params.copy()).object - ) - except Exception: - e = sys.exc_info()[1] + results.append(self.connection.request(self.path, params=params.copy()).object) + except Exception as e: if e.args[0].find("InvalidPermission.Duplicate") == -1: raise e - params['IpProtocol'] = 'udp' + params["IpProtocol"] = "udp" try: - results.append( - self.connection.request(self.path, params=params.copy()).object - ) - except Exception: - e = sys.exc_info()[1] + results.append(self.connection.request(self.path, params=params.copy()).object) + except Exception as e: if e.args[0].find("InvalidPermission.Duplicate") == -1: raise e - params.update({'IpProtocol': 'icmp', 'FromPort': '-1', 'ToPort': '-1'}) + params.update({"IpProtocol": "icmp", "FromPort": "-1", "ToPort": "-1"}) try: - results.append( - self.connection.request(self.path, params=params.copy()).object - ) - except Exception: - e = sys.exc_info()[1] - + results.append(self.connection.request(self.path, params=params.copy()).object) + except Exception as e: if e.args[0].find("InvalidPermission.Duplicate") == -1: raise e return results def ex_list_availability_zones(self, only_available=True): """ - Return a list of :class:`ExEC2AvailabilityZone` objects for the + Returns a list of :class:`ExEC2AvailabilityZone` objects for the current region. Note: This is an extension method and is only available for EC2 driver. - :keyword only_available: If true, return only availability zones + :keyword only_available: If true, returns only availability zones with state 'available' :type only_available: ``str`` :rtype: ``list`` of :class:`ExEC2AvailabilityZone` """ - params = {'Action': 'DescribeAvailabilityZones'} + params = {"Action": "DescribeAvailabilityZones"} - filters = {'region-name': self.region_name} + filters = {"region-name": self.region_name} if only_available: - filters['state'] = 'available' + filters["state"] = "available" params.update(self._build_filters(filters)) - result = self.connection.request(self.path, - params=params.copy()).object + result = self.connection.request(self.path, params=params.copy()).object availability_zones = [] - for element in findall(element=result, - xpath='availabilityZoneInfo/item', - namespace=NAMESPACE): - name = findtext(element=element, xpath='zoneName', - namespace=NAMESPACE) - zone_state = findtext(element=element, xpath='zoneState', - namespace=NAMESPACE) - region_name = findtext(element=element, xpath='regionName', - namespace=NAMESPACE) + for element in findall( + element=result, xpath="availabilityZoneInfo/item", namespace=NAMESPACE + ): + name = findtext(element=element, xpath="zoneName", namespace=NAMESPACE) + zone_state = findtext(element=element, xpath="zoneState", namespace=NAMESPACE) + region_name = findtext(element=element, xpath="regionName", namespace=NAMESPACE) availability_zone = ExEC2AvailabilityZone( - name=name, - zone_state=zone_state, - region_name=region_name + name=name, zone_state=zone_state, region_name=region_name ) availability_zones.append(availability_zone) @@ -3529,21 +3138,19 @@ def ex_list_availability_zones(self, only_available=True): def ex_describe_tags(self, resource): """ - Return a dictionary of tags for a resource (e.g. Node or + Returns a dictionary of tags for a resource (e.g. Node or StorageVolume). - :param resource: resource which should be used + :param resource: The resource to be used :type resource: any resource class, such as :class:`Node,` :class:`StorageVolume,` or :class:NodeImage` - :return: dict Node tags + :return: A dictionary of Node tags :rtype: ``dict`` """ - params = {'Action': 'DescribeTags'} + params = {"Action": "DescribeTags"} - filters = { - 'resource-id': resource.id - } + filters = {"resource-id": resource.id} params.update(self._build_filters(filters)) @@ -3553,9 +3160,9 @@ def ex_describe_tags(self, resource): def ex_create_tags(self, resource, tags): """ - Create tags for a resource (Node or StorageVolume). + Creates tags for a resource (Node or StorageVolume). - :param resource: Resource to be tagged + :param resource: The resource to be tagged :type resource: :class:`Node` or :class:`StorageVolume` or :class:`VolumeSnapshot` @@ -3568,22 +3175,20 @@ def ex_create_tags(self, resource, tags): if not tags: return - params = {'Action': 'CreateTags', - 'ResourceId.0': resource.id} + params = {"Action": "CreateTags", "ResourceId.0": resource.id} for i, key in enumerate(tags): - params['Tag.%d.Key' % i] = key - params['Tag.%d.Value' % i] = tags[key] + params["Tag.%d.Key" % i] = key + params["Tag.%d.Value" % i] = tags[key] - res = self.connection.request(self.path, - params=params.copy()).object + res = self.connection.request(self.path, params=params.copy()).object return self._get_boolean(res) def ex_delete_tags(self, resource, tags): """ - Delete tags from a resource. + Deletes tags from a resource. - :param resource: Resource to be tagged + :param resource: The resource to be tagged :type resource: :class:`Node` or :class:`StorageVolume` :param tags: A dictionary or other mapping of strings to strings, @@ -3595,20 +3200,19 @@ def ex_delete_tags(self, resource, tags): if not tags: return - params = {'Action': 'DeleteTags', - 'ResourceId.0': resource.id} + params = {"Action": "DeleteTags", "ResourceId.0": resource.id} for i, key in enumerate(tags): - params['Tag.%d.Key' % i] = key - params['Tag.%d.Value' % i] = tags[key] + params["Tag.%d.Key" % i] = key + if tags[key] is not None: + params["Tag.%d.Value" % i] = tags[key] - res = self.connection.request(self.path, - params=params.copy()).object + res = self.connection.request(self.path, params=params.copy()).object return self._get_boolean(res) def ex_get_metadata_for_node(self, node): """ - Return the metadata associated with the node. + Returns the metadata associated with the node. :param node: Node instance :type node: :class:`Node` @@ -3617,9 +3221,9 @@ def ex_get_metadata_for_node(self, node): associating tag names with tag values. :rtype tags: ``dict`` """ - return node.extra['tags'] + return node.extra["tags"] - def ex_allocate_address(self, domain='standard'): + def ex_allocate_address(self, domain="standard"): """ Allocate a new Elastic IP address for EC2 classic or VPC @@ -3630,10 +3234,10 @@ def ex_allocate_address(self, domain='standard'): :return: Instance of ElasticIP :rtype: :class:`ElasticIP` """ - params = {'Action': 'AllocateAddress'} + params = {"Action": "AllocateAddress"} - if domain == 'vpc': - params['Domain'] = domain + if domain == "vpc": + params["Domain"] = domain response = self.connection.request(self.path, params=params).object @@ -3641,8 +3245,8 @@ def ex_allocate_address(self, domain='standard'): def ex_release_address(self, elastic_ip, domain=None): """ - Release an Elastic IP address using the IP (EC2-Classic) or - using the allocation ID (VPC) + Releases an Elastic IP address using the IP (EC2-Classic) or + using the allocation ID (VPC). :param elastic_ip: Elastic IP instance :type elastic_ip: :class:`ElasticIP` @@ -3653,32 +3257,32 @@ def ex_release_address(self, elastic_ip, domain=None): :return: True on success, False otherwise. :rtype: ``bool`` """ - params = {'Action': 'ReleaseAddress'} + params = {"Action": "ReleaseAddress"} - if domain is not None and domain != 'vpc': - raise AttributeError('Domain can only be set to vpc') + if domain is not None and domain != "vpc": + raise AttributeError("Domain can only be set to vpc") if domain is None: - params['PublicIp'] = elastic_ip.ip + params["PublicIp"] = elastic_ip.ip else: - params['AllocationId'] = elastic_ip.extra['allocation_id'] + params["AllocationId"] = elastic_ip.extra["allocation_id"] response = self.connection.request(self.path, params=params).object return self._get_boolean(response) def ex_describe_all_addresses(self, only_associated=False): """ - Return all the Elastic IP addresses for this account - optionally, return only addresses associated with nodes + Returns all the Elastic IP addresses for this account + optionally, returns only addresses associated with nodes. - :param only_associated: If true, return only those addresses + :param only_associated: If true, return only the addresses that are associated with an instance. :type only_associated: ``bool`` - :return: List of ElasticIP instances. + :return: List of Elastic IP addresses. :rtype: ``list`` of :class:`ElasticIP` """ - params = {'Action': 'DescribeAddresses'} + params = {"Action": "DescribeAddresses"} response = self.connection.request(self.path, params=params).object @@ -3686,7 +3290,7 @@ def ex_describe_all_addresses(self, only_associated=False): # shape how the return data is sent back return self._to_addresses(response, only_associated) - def ex_associate_address_with_node(self, node, elastic_ip, domain=None): + def ex_associate_address_with_node(self, node, elastic_ip, domain=None, network_interface=None): """ Associate an Elastic IP address with a particular node. @@ -3699,41 +3303,53 @@ def ex_associate_address_with_node(self, node, elastic_ip, domain=None): :param domain: The domain where the IP resides (vpc only) :type domain: ``str`` + :param network_interface: Optional interface to associate the IP + with instead of the node. Required for nodes with multiple + network interfaces. + :type network_interface: :class:`EC2NetworkInterface` + + For a VPC address on an instance with multiple interfaces, pass + ``domain="vpc"`` and the desired interface from + :meth:`ex_list_network_interfaces`. The request uses its interface ID + instead of the instance ID, as required by EC2. + :return: A string representation of the association ID which is required for VPC disassociation. EC2/standard addresses return None :rtype: ``None`` or ``str`` """ - params = {'Action': 'AssociateAddress', 'InstanceId': node.id} + params = {"Action": "AssociateAddress"} + if network_interface is not None: + params["NetworkInterfaceId"] = network_interface.id + else: + params["InstanceId"] = node.id - if domain is not None and domain != 'vpc': - raise AttributeError('Domain can only be set to vpc') + if domain is not None and domain != "vpc": + raise AttributeError("Domain can only be set to vpc") if domain is None: - params.update({'PublicIp': elastic_ip.ip}) + params.update({"PublicIp": elastic_ip.ip}) else: - params.update({'AllocationId': elastic_ip.extra['allocation_id']}) + params.update({"AllocationId": elastic_ip.extra["allocation_id"]}) response = self.connection.request(self.path, params=params).object - association_id = findtext(element=response, - xpath='associationId', - namespace=NAMESPACE) + association_id = findtext(element=response, xpath="associationId", namespace=NAMESPACE) return association_id - def ex_associate_addresses(self, node, elastic_ip, domain=None): + def ex_associate_addresses(self, node, elastic_ip, domain=None, network_interface=None): """ Note: This method has been deprecated in favor of the ex_associate_address_with_node method. """ - return self.ex_associate_address_with_node(node=node, - elastic_ip=elastic_ip, - domain=domain) + return self.ex_associate_address_with_node( + node=node, elastic_ip=elastic_ip, domain=domain, network_interface=network_interface + ) def ex_disassociate_address(self, elastic_ip, domain=None): """ - Disassociate an Elastic IP address using the IP (EC2-Classic) - or the association ID (VPC) + Disassociates an Elastic IP address using the IP (EC2-Classic) + or the association ID (VPC). :param elastic_ip: ElasticIP instance :type elastic_ip: :class:`ElasticIP` @@ -3744,25 +3360,25 @@ def ex_disassociate_address(self, elastic_ip, domain=None): :return: True on success, False otherwise. :rtype: ``bool`` """ - params = {'Action': 'DisassociateAddress'} + params = {"Action": "DisassociateAddress"} - if domain is not None and domain != 'vpc': - raise AttributeError('Domain can only be set to vpc') + if domain is not None and domain != "vpc": + raise AttributeError("Domain can only be set to vpc") if domain is None: - params['PublicIp'] = elastic_ip.ip + params["PublicIp"] = elastic_ip.ip else: - params['AssociationId'] = elastic_ip.extra['association_id'] + params["AssociationId"] = elastic_ip.extra["association_id"] res = self.connection.request(self.path, params=params).object return self._get_boolean(res) def ex_describe_addresses(self, nodes): """ - Return Elastic IP addresses for all the nodes in the provided list. + Returns Elastic IP addresses for all the nodes in the provided list. - :param nodes: List of :class:`Node` instances + :param nodes: A list of :class:`Node` instances :type nodes: ``list`` of :class:`Node` :return: Dictionary where a key is a node ID and the value is a @@ -3773,7 +3389,7 @@ def ex_describe_addresses(self, nodes): if not nodes: return {} - params = {'Action': 'DescribeAddresses'} + params = {"Action": "DescribeAddresses"} if len(nodes) == 1: self._add_instance_filter(params, nodes[0]) @@ -3789,25 +3405,22 @@ def ex_describe_addresses(self, nodes): for node_id in node_instance_ids: nodes_elastic_ip_mappings.setdefault(node_id, []) - for addr in self._to_addresses(result, - only_associated): - + for addr in self._to_addresses(result, only_associated): instance_id = addr.instance_id if node_id == instance_id: - nodes_elastic_ip_mappings[instance_id].append( - addr.ip) + nodes_elastic_ip_mappings[instance_id].append(addr.ip) return nodes_elastic_ip_mappings def ex_describe_addresses_for_node(self, node): """ - Return a list of Elastic IP addresses associated with this node. + Returns a list of Elastic IP Addresses associated with this node. :param node: Node instance :type node: :class:`Node` - :return: list Elastic IP addresses attached to this node. + :return: List Elastic IP Addresses attached to this node. :rtype: ``list`` of ``str`` """ node_elastic_ips = self.ex_describe_addresses([node]) @@ -3817,20 +3430,18 @@ def ex_describe_addresses_for_node(self, node): def ex_list_network_interfaces(self): """ - Return all network interfaces + Returns all network interfaces. :return: List of EC2NetworkInterface instances :rtype: ``list`` of :class `EC2NetworkInterface` """ - params = {'Action': 'DescribeNetworkInterfaces'} + params = {"Action": "DescribeNetworkInterfaces"} - return self._to_interfaces( - self.connection.request(self.path, params=params).object - ) + return self._to_interfaces(self.connection.request(self.path, params=params).object) - def ex_create_network_interface(self, subnet, name=None, - description=None, - private_ip_address=None): + def ex_create_network_interface( + self, subnet, name=None, description=None, private_ip_address=None + ): """ Create a network interface within a VPC subnet. @@ -3855,24 +3466,22 @@ def ex_create_network_interface(self, subnet, name=None, :return: EC2NetworkInterface instance :rtype: :class `EC2NetworkInterface` """ - params = {'Action': 'CreateNetworkInterface', - 'SubnetId': subnet.id} + params = {"Action": "CreateNetworkInterface", "SubnetId": subnet.id} if description: - params['Description'] = description + params["Description"] = description if private_ip_address: - params['PrivateIpAddress'] = private_ip_address + params["PrivateIpAddress"] = private_ip_address response = self.connection.request(self.path, params=params).object - element = response.findall(fixxpath(xpath='networkInterface', - namespace=NAMESPACE))[0] + element = response.findall(fixxpath(xpath="networkInterface", namespace=NAMESPACE))[0] interface = self._to_interface(element, name) - if name and self.ex_create_tags(interface, {'Name': name}): - interface.extra['tags']['Name'] = name + if name and self.ex_create_tags(interface, {"Name": name}): + interface.extra["tags"]["Name"] = name return interface @@ -3885,15 +3494,16 @@ def ex_delete_network_interface(self, network_interface): :rtype: ``bool`` """ - params = {'Action': 'DeleteNetworkInterface', - 'NetworkInterfaceId': network_interface.id} + params = { + "Action": "DeleteNetworkInterface", + "NetworkInterfaceId": network_interface.id, + } res = self.connection.request(self.path, params=params).object return self._get_boolean(res) - def ex_attach_network_interface_to_node(self, network_interface, - node, device_index): + def ex_attach_network_interface_to_node(self, network_interface, node, device_index): """ Attach a network interface to an instance. @@ -3910,14 +3520,15 @@ def ex_attach_network_interface_to_node(self, network_interface, This is required to detach the interface. :rtype: ``str`` """ - params = {'Action': 'AttachNetworkInterface', - 'NetworkInterfaceId': network_interface.id, - 'InstanceId': node.id, - 'DeviceIndex': device_index} + params = { + "Action": "AttachNetworkInterface", + "NetworkInterfaceId": network_interface.id, + "InstanceId": node.id, + "DeviceIndex": device_index, + } response = self.connection.request(self.path, params=params).object - attachment_id = findattr(element=response, xpath='attachmentId', - namespace=NAMESPACE) + attachment_id = findattr(element=response, xpath="attachmentId", namespace=NAMESPACE) return attachment_id @@ -3935,11 +3546,10 @@ def ex_detach_network_interface(self, attachment_id, force=False): :return: ``True`` on successful detachment, ``False`` otherwise. :rtype: ``bool`` """ - params = {'Action': 'DetachNetworkInterface', - 'AttachmentId': attachment_id} + params = {"Action": "DetachNetworkInterface", "AttachmentId": attachment_id} if force: - params['Force'] = True + params["Force"] = True res = self.connection.request(self.path, params=params).object @@ -3960,37 +3570,58 @@ def ex_modify_instance_attribute(self, node, attributes): :rtype: ``bool`` """ attributes = attributes or {} - attributes.update({'InstanceId': node.id}) + attributes.update({"InstanceId": node.id}) + + params = {"Action": "ModifyInstanceAttribute"} + params.update(attributes) + + res = self.connection.request(self.path, params=params.copy()).object + + return self._get_boolean(res) + + def ex_modify_snapshot_attribute(self, snapshot, attributes): + """ + Modify Snapshot attributes. + + :param snapshot: VolumeSnapshot instance + :type snanpshot: :class:`VolumeSnapshot` + + :param attributes: Dictionary with snapshot attributes + :type attributes: ``dict`` + + :return: True on success, False otherwise. + :rtype: ``bool`` + """ + attributes = attributes or {} + attributes.update({"SnapshotId": snapshot.id}) - params = {'Action': 'ModifyInstanceAttribute'} + params = {"Action": "ModifySnapshotAttribute"} params.update(attributes) - res = self.connection.request(self.path, - params=params.copy()).object + res = self.connection.request(self.path, params=params.copy()).object return self._get_boolean(res) def ex_modify_image_attribute(self, image, attributes): """ - Modify image attributes. + Modifies image attributes. :param image: NodeImage instance :type image: :class:`NodeImage` - :param attributes: Dictionary with node attributes + :param attributes: A dictionary with node attributes :type attributes: ``dict`` :return: True on success, False otherwise. :rtype: ``bool`` """ attributes = attributes or {} - attributes.update({'ImageId': image.id}) + attributes.update({"ImageId": image.id}) - params = {'Action': 'ModifyImageAttribute'} + params = {"Action": "ModifyImageAttribute"} params.update(attributes) - res = self.connection.request(self.path, - params=params.copy()).object + res = self.connection.request(self.path, params=params.copy()).object return self._get_boolean(res) @@ -4002,95 +3633,67 @@ def ex_change_node_size(self, node, new_size): :param node: Node instance :type node: :class:`Node` - :param new_size: NodeSize intance + :param new_size: NodeSize instance :type new_size: :class:`NodeSize` :return: True on success, False otherwise. :rtype: ``bool`` """ - if 'instancetype' in node.extra: - current_instance_type = node.extra['instancetype'] + if "instancetype" in node.extra: + current_instance_type = node.extra["instancetype"] if current_instance_type == new_size.id: - raise ValueError('New instance size is the same as' + - 'the current one') + raise ValueError("New instance size is the same as" + "the current one") - attributes = {'InstanceType.Value': new_size.id} - return self.ex_modify_instance_attribute(node, attributes) + attributes = {"InstanceType.Value": new_size.id} + return self.ex_modify_instance_attribute(node=node, attributes=attributes) def ex_start_node(self, node): - """ - Start the node by passing in the node object, does not work with - instance store backed instances - - :param node: Node which should be used - :type node: :class:`Node` - - :rtype: ``bool`` - """ - params = {'Action': 'StartInstances'} - params.update(self._pathlist('InstanceId', [node.id])) - res = self.connection.request(self.path, params=params).object - return self._get_state_boolean(res) + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.start_node(node=node) def ex_stop_node(self, node): - """ - Stop the node by passing in the node object, does not work with - instance store backed instances - - :param node: Node which should be used - :type node: :class:`Node` - - :rtype: ``bool`` - """ - params = {'Action': 'StopInstances'} - params.update(self._pathlist('InstanceId', [node.id])) - res = self.connection.request(self.path, params=params).object - return self._get_state_boolean(res) + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.stop_node(node=node) def ex_get_console_output(self, node): """ - Get console output for the node. + Gets console output for the node. :param node: Node which should be used :type node: :class:`Node` - :return: Dictionary with the following keys: + :return: A dictionary with the following keys: - instance_id (``str``) - - timestamp (``datetime.datetime``) - ts of the last output + - timestamp (``datetime.datetime``) - last output timestamp - output (``str``) - console output :rtype: ``dict`` """ - params = { - 'Action': 'GetConsoleOutput', - 'InstanceId': node.id - } + params = {"Action": "GetConsoleOutput", "InstanceId": node.id} response = self.connection.request(self.path, params=params).object - timestamp = findattr(element=response, - xpath='timestamp', - namespace=NAMESPACE) + timestamp = findattr(element=response, xpath="timestamp", namespace=NAMESPACE) - encoded_string = findattr(element=response, - xpath='output', - namespace=NAMESPACE) + encoded_string = findattr(element=response, xpath="output", namespace=NAMESPACE) timestamp = parse_date(timestamp) if encoded_string: - output = base64.b64decode(b(encoded_string)).decode('utf-8') + output = base64.b64decode(b(encoded_string)).decode("utf-8") else: # No console output output = None - return {'instance_id': node.id, - 'timestamp': timestamp, - 'output': output} + return {"instance_id": node.id, "timestamp": timestamp, "output": output} def ex_list_reserved_nodes(self): """ - List all reserved instances/nodes which can be purchased from Amazon + Lists all reserved instances/nodes which can be purchased from Amazon for one or three year terms. Reservations are made at a region level and reduce the hourly charge for instances. @@ -4098,11 +3701,11 @@ def ex_list_reserved_nodes(self): :rtype: ``list`` of :class:`.EC2ReservedNode` """ - params = {'Action': 'DescribeReservedInstances'} + params = {"Action": "DescribeReservedInstances"} response = self.connection.request(self.path, params=params).object - return self._to_reserved_nodes(response, 'reservedInstancesSet/item') + return self._to_reserved_nodes(response, "reservedInstancesSet/item") # Account specific methods @@ -4112,30 +3715,29 @@ def ex_get_limits(self): :rtype: ``dict`` """ - attributes = ['max-instances', 'max-elastic-ips', - 'vpc-max-elastic-ips'] + attributes = ["max-instances", "max-elastic-ips", "vpc-max-elastic-ips"] params = {} - params['Action'] = 'DescribeAccountAttributes' + params["Action"] = "DescribeAccountAttributes" for index, attribute in enumerate(attributes): - params['AttributeName.%s' % (index)] = attribute + params["AttributeName.%s" % (index)] = attribute response = self.connection.request(self.path, params=params) data = response.object - elems = data.findall(fixxpath(xpath='accountAttributeSet/item', - namespace=NAMESPACE)) + elems = data.findall(fixxpath(xpath="accountAttributeSet/item", namespace=NAMESPACE)) - result = {'resource': {}} + result = {"resource": {}} for elem in elems: - name = findtext(element=elem, xpath='attributeName', - namespace=NAMESPACE) - value = findtext(element=elem, - xpath='attributeValueSet/item/attributeValue', - namespace=NAMESPACE) + name = findtext(element=elem, xpath="attributeName", namespace=NAMESPACE) + value = findtext( + element=elem, + xpath="attributeValueSet/item/attributeValue", + namespace=NAMESPACE, + ) - result['resource'][name] = int(value) + result["resource"][name] = int(value) return result @@ -4147,8 +3749,7 @@ def ex_list_keypairs(self): :rtype: ``list`` of ``dict`` """ - warnings.warn('This method has been deprecated in favor of ' - 'list_key_pairs method') + warnings.warn("This method has been deprecated in favor of " "list_key_pairs method") key_pairs = self.list_key_pairs() @@ -4156,8 +3757,8 @@ def ex_list_keypairs(self): for key_pair in key_pairs: item = { - 'keyName': key_pair.name, - 'keyFingerprint': key_pair.fingerprint, + "keyName": key_pair.name, + "keyFingerprint": key_pair.fingerprint, } result.append(item) @@ -4165,7 +3766,7 @@ def ex_list_keypairs(self): def ex_describe_all_keypairs(self): """ - Return names for all the available key pairs. + Returns names for all the available key pairs. @note: This is a non-standard extension API, and only works for EC2. @@ -4192,21 +3793,14 @@ def ex_describe_keypair(self, name): :rtype: ``dict`` """ - params = { - 'Action': 'DescribeKeyPairs', - 'KeyName.1': name - } + params = {"Action": "DescribeKeyPairs", "KeyName.1": name} response = self.connection.request(self.path, params=params).object - key_name = findattr(element=response, xpath='keySet/item/keyName', - namespace=NAMESPACE) - fingerprint = findattr(element=response, - xpath='keySet/item/keyFingerprint', - namespace=NAMESPACE).strip() - return { - 'keyName': key_name, - 'keyFingerprint': fingerprint - } + key_name = findattr(element=response, xpath="keySet/item/keyName", namespace=NAMESPACE) + fingerprint = findattr( + element=response, xpath="keySet/item/keyFingerprint", namespace=NAMESPACE + ).strip() + return {"keyName": key_name, "keyFingerprint": fingerprint} def ex_create_keypair(self, name): """ @@ -4220,21 +3814,20 @@ def ex_create_keypair(self, name): :rtype: ``dict`` """ - warnings.warn('This method has been deprecated in favor of ' - 'create_key_pair method') + warnings.warn("This method has been deprecated in favor of " "create_key_pair method") key_pair = self.create_key_pair(name=name) result = { - 'keyMaterial': key_pair.private_key, - 'keyFingerprint': key_pair.fingerprint + "keyMaterial": key_pair.private_key, + "keyFingerprint": key_pair.fingerprint, } return result def ex_delete_keypair(self, keypair): """ - Delete a key pair by name. + Deletes a key pair by name. @note: This is a non-standard extension API, and only works with EC2. @@ -4243,17 +3836,15 @@ def ex_delete_keypair(self, keypair): :rtype: ``bool`` """ - warnings.warn('This method has been deprecated in favor of ' - 'delete_key_pair method') + warnings.warn("This method has been deprecated in favor of " "delete_key_pair method") - keypair = KeyPair(name=keypair, public_key=None, fingerprint=None, - driver=self) + keypair = KeyPair(name=keypair, public_key=None, fingerprint=None, driver=self) return self.delete_key_pair(keypair) def ex_import_keypair_from_string(self, name, key_material): """ - imports a new public key where the public key is passed in as a string + Imports a new public key where the public key is passed in as a string. @note: This is a non-standard extension API, and only works for EC2. @@ -4266,43 +3857,39 @@ def ex_import_keypair_from_string(self, name, key_material): :rtype: ``dict`` """ - warnings.warn('This method has been deprecated in favor of ' - 'import_key_pair_from_string method') + warnings.warn( + "This method has been deprecated in favor of " "import_key_pair_from_string method" + ) - key_pair = self.import_key_pair_from_string(name=name, - key_material=key_material) + key_pair = self.import_key_pair_from_string(name=name, key_material=key_material) - result = { - 'keyName': key_pair.name, - 'keyFingerprint': key_pair.fingerprint - } + result = {"keyName": key_pair.name, "keyFingerprint": key_pair.fingerprint} return result def ex_import_keypair(self, name, keyfile): """ - imports a new public key where the public key is passed via a filename + Imports a new public key where the public key is passed via a filename. @note: This is a non-standard extension API, and only works for EC2. :param name: The name of the public key to import. This must be - unique, otherwise an InvalidKeyPair.Duplicate exception is raised. + unique, otherwise an InvalidKeyPair. Duplicate + exception is raised. :type name: ``str`` - :param keyfile: The filename with path of the public key to import. + :param keyfile: The filename with the path of the public key + to import. :type keyfile: ``str`` :rtype: ``dict`` """ - warnings.warn('This method has been deprecated in favor of ' - 'import_key_pair_from_file method') + warnings.warn( + "This method has been deprecated in favor of " "import_key_pair_from_file method" + ) - key_pair = self.import_key_pair_from_file(name=name, - key_file_path=keyfile) + key_pair = self.import_key_pair_from_file(name=name, key_file_path=keyfile) - result = { - 'keyName': key_pair.name, - 'keyFingerprint': key_pair.fingerprint - } + result = {"keyName": key_pair.name, "keyFingerprint": key_pair.fingerprint} return result def ex_find_or_import_keypair_by_key_material(self, pubkey): @@ -4315,19 +3902,15 @@ def ex_find_or_import_keypair_by_key_material(self, pubkey): :rtype: ``dict`` """ key_fingerprint = get_pubkey_ssh2_fingerprint(pubkey) - key_comment = get_pubkey_comment(pubkey, default='unnamed') - key_name = '%s-%s' % (key_comment, key_fingerprint) + key_comment = get_pubkey_comment(pubkey, default="unnamed") + key_name = "{}-{}".format(key_comment, key_fingerprint) key_pairs = self.list_key_pairs() - key_pairs = [key_pair for key_pair in key_pairs if - key_pair.fingerprint == key_fingerprint] + key_pairs = [key_pair for key_pair in key_pairs if key_pair.fingerprint == key_fingerprint] if len(key_pairs) >= 1: key_pair = key_pairs[0] - result = { - 'keyName': key_pair.name, - 'keyFingerprint': key_pair.fingerprint - } + result = {"keyName": key_pair.name, "keyFingerprint": key_pair.fingerprint} else: result = self.ex_import_keypair_from_string(key_name, pubkey) @@ -4339,30 +3922,30 @@ def ex_list_internet_gateways(self, gateway_ids=None, filters=None): attached to a VPC. These are required for VPC nodes to communicate over the Internet. - :param gateway_ids: Return only intenet gateways matching the - provided internet gateway IDs. If not - specified, a list of all the internet + :param gateway_ids: Returns only Internet gateways matching the + provided Internet gateway IDs. If not + specified, a list of all the Internet gateways in the corresponding region is returned. :type gateway_ids: ``list`` - :param filters: The filters so that the response includes - information for only certain gateways. + :param filters: The filters so the list returned includes + information for certain gateways only. :type filters: ``dict`` :rtype: ``list`` of :class:`.VPCInternetGateway` """ - params = {'Action': 'DescribeInternetGateways'} + params = {"Action": "DescribeInternetGateways"} if gateway_ids: - params.update(self._pathlist('InternetGatewayId', gateway_ids)) + params.update(self._pathlist("InternetGatewayId", gateway_ids)) if filters: params.update(self._build_filters(filters)) response = self.connection.request(self.path, params=params).object - return self._to_internet_gateways(response, 'internetGatewaySet/item') + return self._to_internet_gateways(response, "internetGatewaySet/item") def ex_create_internet_gateway(self, name=None): """ @@ -4370,31 +3953,29 @@ def ex_create_internet_gateway(self, name=None): :rtype: ``bool`` """ - params = {'Action': 'CreateInternetGateway'} + params = {"Action": "CreateInternetGateway"} resp = self.connection.request(self.path, params=params).object - element = resp.findall(fixxpath(xpath='internetGateway', - namespace=NAMESPACE)) + element = resp.findall(fixxpath(xpath="internetGateway", namespace=NAMESPACE)) gateway = self._to_internet_gateway(element[0], name) - if name and self.ex_create_tags(gateway, {'Name': name}): - gateway.extra['tags']['Name'] = name + if name and self.ex_create_tags(gateway, {"Name": name}): + gateway.extra["tags"]["Name"] = name return gateway def ex_delete_internet_gateway(self, gateway): """ - Delete a VPC Internet gateway + Deletes a VPC Internet gateway. :param gateway: The gateway to delete :type gateway: :class:`.VPCInternetGateway` :rtype: ``bool`` """ - params = {'Action': 'DeleteInternetGateway', - 'InternetGatewayId': gateway.id} + params = {"Action": "DeleteInternetGateway", "InternetGatewayId": gateway.id} res = self.connection.request(self.path, params=params).object @@ -4412,9 +3993,11 @@ def ex_attach_internet_gateway(self, gateway, network): :rtype: ``bool`` """ - params = {'Action': 'AttachInternetGateway', - 'InternetGatewayId': gateway.id, - 'VpcId': network.id} + params = { + "Action": "AttachInternetGateway", + "InternetGatewayId": gateway.id, + "VpcId": network.id, + } res = self.connection.request(self.path, params=params).object @@ -4422,7 +4005,7 @@ def ex_attach_internet_gateway(self, gateway, network): def ex_detach_internet_gateway(self, gateway, network): """ - Detach an Internet gateway from a VPC + Detaches an Internet gateway from a VPC. :param gateway: The gateway to detach :type gateway: :class:`.VPCInternetGateway` @@ -4432,9 +4015,11 @@ def ex_detach_internet_gateway(self, gateway, network): :rtype: ``bool`` """ - params = {'Action': 'DetachInternetGateway', - 'InternetGatewayId': gateway.id, - 'VpcId': network.id} + params = { + "Action": "DetachInternetGateway", + "InternetGatewayId": gateway.id, + "VpcId": network.id, + } res = self.connection.request(self.path, params=params).object @@ -4445,22 +4030,22 @@ def ex_list_route_tables(self, route_table_ids=None, filters=None): Describes one or more of a VPC's route tables. These are used to determine where network traffic is directed. - :param route_table_ids: Return only route tables matching the + :param route_table_ids: Returns only route tables matching the provided route table IDs. If not specified, a list of all the route tables in the corresponding region is returned. :type route_table_ids: ``list`` - :param filters: The filters so that the response includes - information for only certain route tables. + :param filters: The filters so that the list returned includes + information for certain route tables only. :type filters: ``dict`` :rtype: ``list`` of :class:`.EC2RouteTable` """ - params = {'Action': 'DescribeRouteTables'} + params = {"Action": "DescribeRouteTables"} if route_table_ids: - params.update(self._pathlist('RouteTableId', route_table_ids)) + params.update(self._pathlist("RouteTableId", route_table_ids)) if filters: params.update(self._build_filters(filters)) @@ -4471,24 +4056,22 @@ def ex_list_route_tables(self, route_table_ids=None, filters=None): def ex_create_route_table(self, network, name=None): """ - Create a route table within a VPC. + Creates a route table within a VPC. :param vpc_id: The VPC that the subnet should be created in. :type vpc_id: :class:`.EC2Network` :rtype: :class: `.EC2RouteTable` """ - params = {'Action': 'CreateRouteTable', - 'VpcId': network.id} + params = {"Action": "CreateRouteTable", "VpcId": network.id} response = self.connection.request(self.path, params=params).object - element = response.findall(fixxpath(xpath='routeTable', - namespace=NAMESPACE))[0] + element = response.findall(fixxpath(xpath="routeTable", namespace=NAMESPACE))[0] route_table = self._to_route_table(element, name=name) - if name and self.ex_create_tags(route_table, {'Name': name}): - route_table.extra['tags']['Name'] = name + if name and self.ex_create_tags(route_table, {"Name": name}): + route_table.extra["tags"]["Name"] = name return route_table @@ -4502,8 +4085,7 @@ def ex_delete_route_table(self, route_table): :rtype: ``bool`` """ - params = {'Action': 'DeleteRouteTable', - 'RouteTableId': route_table.id} + params = {"Action": "DeleteRouteTable", "RouteTableId": route_table.id} res = self.connection.request(self.path, params=params).object @@ -4525,14 +4107,14 @@ def ex_associate_route_table(self, route_table, subnet): :rtype: ``str`` """ - params = {'Action': 'AssociateRouteTable', - 'RouteTableId': route_table.id, - 'SubnetId': subnet.id} + params = { + "Action": "AssociateRouteTable", + "RouteTableId": route_table.id, + "SubnetId": subnet.id, + } result = self.connection.request(self.path, params=params).object - association_id = findtext(element=result, - xpath='associationId', - namespace=NAMESPACE) + association_id = findtext(element=result, xpath="associationId", namespace=NAMESPACE) return association_id @@ -4553,15 +4135,16 @@ def ex_dissociate_route_table(self, subnet_association): else: subnet_association_id = subnet_association - params = {'Action': 'DisassociateRouteTable', - 'AssociationId': subnet_association_id} + params = { + "Action": "DisassociateRouteTable", + "AssociationId": subnet_association_id, + } res = self.connection.request(self.path, params=params).object return self._get_boolean(res) - def ex_replace_route_table_association(self, subnet_association, - route_table): + def ex_replace_route_table_association(self, subnet_association, route_table): """ Changes the route table associated with a given subnet in a VPC. @@ -4577,7 +4160,7 @@ def ex_replace_route_table_association(self, subnet_association, :param route_table: The new route table to associate. :type route_table: :class:`.EC2RouteTable` - :return: New route table association ID. + :return: A new route table association ID. :rtype: ``str`` """ @@ -4586,20 +4169,26 @@ def ex_replace_route_table_association(self, subnet_association, else: subnet_association_id = subnet_association - params = {'Action': 'ReplaceRouteTableAssociation', - 'AssociationId': subnet_association_id, - 'RouteTableId': route_table.id} + params = { + "Action": "ReplaceRouteTableAssociation", + "AssociationId": subnet_association_id, + "RouteTableId": route_table.id, + } result = self.connection.request(self.path, params=params).object - new_association_id = findtext(element=result, - xpath='newAssociationId', - namespace=NAMESPACE) + new_association_id = findtext(element=result, xpath="newAssociationId", namespace=NAMESPACE) return new_association_id - def ex_create_route(self, route_table, cidr, - internet_gateway=None, node=None, - network_interface=None, vpc_peering_connection=None): + def ex_create_route( + self, + route_table, + cidr, + internet_gateway=None, + node=None, + network_interface=None, + vpc_peering_connection=None, + ): """ Creates a route entry in the route table. @@ -4609,7 +4198,7 @@ def ex_create_route(self, route_table, cidr, :param cidr: The CIDR block used for the destination match. :type cidr: ``str`` - :param internet_gateway: The internet gateway to route + :param internet_gateway: The Internet gateway to route traffic through. :type internet_gateway: :class:`.VPCInternetGateway` @@ -4629,21 +4218,23 @@ def ex_create_route(self, route_table, cidr, node, network_interface, vpc_peering_connection. """ - params = {'Action': 'CreateRoute', - 'RouteTableId': route_table.id, - 'DestinationCidrBlock': cidr} + params = { + "Action": "CreateRoute", + "RouteTableId": route_table.id, + "DestinationCidrBlock": cidr, + } if internet_gateway: - params['GatewayId'] = internet_gateway.id + params["GatewayId"] = internet_gateway.id if node: - params['InstanceId'] = node.id + params["InstanceId"] = node.id if network_interface: - params['NetworkInterfaceId'] = network_interface.id + params["NetworkInterfaceId"] = network_interface.id if vpc_peering_connection: - params['VpcPeeringConnectionId'] = vpc_peering_connection.id + params["VpcPeeringConnectionId"] = vpc_peering_connection.id res = self.connection.request(self.path, params=params).object @@ -4662,17 +4253,25 @@ def ex_delete_route(self, route_table, cidr): :rtype: ``bool`` """ - params = {'Action': 'DeleteRoute', - 'RouteTableId': route_table.id, - 'DestinationCidrBlock': cidr} + params = { + "Action": "DeleteRoute", + "RouteTableId": route_table.id, + "DestinationCidrBlock": cidr, + } res = self.connection.request(self.path, params=params).object return self._get_boolean(res) - def ex_replace_route(self, route_table, cidr, - internet_gateway=None, node=None, - network_interface=None, vpc_peering_connection=None): + def ex_replace_route( + self, + route_table, + cidr, + internet_gateway=None, + node=None, + network_interface=None, + vpc_peering_connection=None, + ): """ Replaces an existing route entry within a route table in a VPC. @@ -4702,102 +4301,185 @@ def ex_replace_route(self, route_table, cidr, node, network_interface, vpc_peering_connection. """ - params = {'Action': 'ReplaceRoute', - 'RouteTableId': route_table.id, - 'DestinationCidrBlock': cidr} + params = { + "Action": "ReplaceRoute", + "RouteTableId": route_table.id, + "DestinationCidrBlock": cidr, + } if internet_gateway: - params['GatewayId'] = internet_gateway.id + params["GatewayId"] = internet_gateway.id if node: - params['InstanceId'] = node.id + params["InstanceId"] = node.id if network_interface: - params['NetworkInterfaceId'] = network_interface.id + params["NetworkInterfaceId"] = network_interface.id if vpc_peering_connection: - params['VpcPeeringConnectionId'] = vpc_peering_connection.id + params["VpcPeeringConnectionId"] = vpc_peering_connection.id res = self.connection.request(self.path, params=params).object return self._get_boolean(res) + def ex_modify_volume(self, volume, parameters): + """ + Modify volume parameters. + A list of valid parameters can be found at https://goo.gl/N0rPEQ + + :param volume: Volume instance + :type volume: :class:`Volume` + + :param parameters: Dictionary with updated volume parameters + :type parameters: ``dict`` + + :return: Volume modification status object + :rtype: :class:`VolumeModification + """ + parameters = parameters or {} + + volume_type = parameters.get("VolumeType") + if volume_type and volume_type not in VALID_VOLUME_TYPES: + raise ValueError("Invalid volume type specified: %s" % volume_type) + + parameters.update({"Action": "ModifyVolume", "VolumeId": volume.id}) + response = self.connection.request(self.path, params=parameters.copy()).object + + return self._to_volume_modification( + response.findall(fixxpath(xpath="volumeModification", namespace=NAMESPACE))[0] + ) + + def ex_describe_volumes_modifications(self, dry_run=False, volume_ids=None, filters=None): + """ + Describes one or more of your volume modifications. + + :param dry_run: dry_run + :type dry_run: ``bool`` + + :param volume_ids: The volume_ids so that the response includes + information for only said volumes + :type volume_ids: ``dict`` + + :param filters: The filters so that the response includes + information for only certain volumes + :type filters: ``dict`` + + :return: List of volume modification status objects + :rtype: ``list`` of :class:`VolumeModification + """ + params = {"Action": "DescribeVolumesModifications"} + + if dry_run: + params.update({"DryRun": dry_run}) + + if volume_ids: + params.update(self._pathlist("VolumeId", volume_ids)) + + if filters: + params.update(self._build_filters(filters)) + + response = self.connection.request(self.path, params=params).object + + return self._to_volume_modifications(response) + def _ex_connection_class_kwargs(self): - kwargs = super(BaseEC2NodeDriver, self)._ex_connection_class_kwargs() - kwargs['signature_version'] = self.signature_version + kwargs = super()._ex_connection_class_kwargs() + # pylint: disable=no-member + if hasattr(self, "token") and self.token is not None: + kwargs["token"] = self.token + # Force signature_version 4 for tokens or auth breaks + kwargs["signature_version"] = "4" + else: + kwargs["signature_version"] = self.signature_version + return kwargs def _to_nodes(self, object, xpath): - return [self._to_node(el) - for el in object.findall(fixxpath(xpath=xpath, - namespace=NAMESPACE))] + return [ + self._to_node(el) for el in object.findall(fixxpath(xpath=xpath, namespace=NAMESPACE)) + ] def _to_node(self, element): try: - state = self.NODE_STATE_MAP[findattr(element=element, - xpath="instanceState/name", - namespace=NAMESPACE) - ] + state = self.NODE_STATE_MAP[ + findattr(element=element, xpath="instanceState/name", namespace=NAMESPACE) + ] except KeyError: state = NodeState.UNKNOWN - instance_id = findtext(element=element, xpath='instanceId', - namespace=NAMESPACE) - public_ip = findtext(element=element, xpath='ipAddress', - namespace=NAMESPACE) + created = parse_date_allow_empty( + findtext(element=element, xpath="launchTime", namespace=NAMESPACE) + ) + instance_id = findtext(element=element, xpath="instanceId", namespace=NAMESPACE) + public_ip = findtext(element=element, xpath="ipAddress", namespace=NAMESPACE) public_ips = [public_ip] if public_ip else [] - private_ip = findtext(element=element, xpath='privateIpAddress', - namespace=NAMESPACE) + private_ip = findtext(element=element, xpath="privateIpAddress", namespace=NAMESPACE) private_ips = [private_ip] if private_ip else [] product_codes = [] - for p in findall(element=element, - xpath="productCodesSet/item/productCode", - namespace=NAMESPACE): + for p in findall( + element=element, + xpath="productCodesSet/item/productCode", + namespace=NAMESPACE, + ): product_codes.append(p) # Get our tags tags = self._get_resource_tags(element) - name = tags.get('Name', instance_id) + name = tags.get("Name", instance_id) # Get our extra dictionary - extra = self._get_extra_dict( - element, RESOURCE_EXTRA_ATTRIBUTES_MAP['node']) + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["node"]) # Add additional properties to our extra dictionary - extra['block_device_mapping'] = self._to_device_mappings(element) - extra['groups'] = self._get_security_groups(element) - extra['network_interfaces'] = self._to_interfaces(element) - extra['product_codes'] = product_codes - extra['tags'] = tags - - return Node(id=instance_id, name=name, state=state, - public_ips=public_ips, private_ips=private_ips, - driver=self.connection.driver, extra=extra) + extra["block_device_mapping"] = self._to_instance_device_mappings(element) + extra["groups"] = self._get_security_groups(element) + extra["network_interfaces"] = self._to_interfaces(element) + extra["product_codes"] = product_codes + extra["tags"] = tags + + return Node( + id=instance_id, + name=name, + state=state, + public_ips=public_ips, + private_ips=private_ips, + driver=self.connection.driver, + created_at=created, + extra=extra, + ) def _to_images(self, object): - return [self._to_image(el) for el in object.findall( - fixxpath(xpath='imagesSet/item', namespace=NAMESPACE)) + return [ + self._to_image(el) + for el in object.findall(fixxpath(xpath="imagesSet/item", namespace=NAMESPACE)) ] def _to_image(self, element): - - id = findtext(element=element, xpath='imageId', namespace=NAMESPACE) - name = findtext(element=element, xpath='name', namespace=NAMESPACE) + id = findtext(element=element, xpath="imageId", namespace=NAMESPACE) + name = findtext(element=element, xpath="name", namespace=NAMESPACE) # Build block device mapping block_device_mapping = self._to_device_mappings(element) + billing_products = [] + for p in findall( + element=element, + xpath="billingProducts/item/billingProduct", + namespace=NAMESPACE, + ): + billing_products.append(p.text) + # Get our tags tags = self._get_resource_tags(element) # Get our extra dictionary - extra = self._get_extra_dict( - element, RESOURCE_EXTRA_ATTRIBUTES_MAP['image']) + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["image"]) # Add our tags and block device mapping - extra['tags'] = tags - extra['block_device_mapping'] = block_device_mapping - + extra["tags"] = tags + extra["block_device_mapping"] = block_device_mapping + extra["billing_products"] = billing_products return NodeImage(id=id, name=name, driver=self, extra=extra) def _to_volume(self, element, name=None): @@ -4812,126 +4494,155 @@ def _to_volume(self, element, name=None): :rtype: :class:`StorageVolume` """ - volId = findtext(element=element, xpath='volumeId', - namespace=NAMESPACE) - size = findtext(element=element, xpath='size', namespace=NAMESPACE) - raw_state = findtext(element=element, xpath='status', - namespace=NAMESPACE) + volId = findtext(element=element, xpath="volumeId", namespace=NAMESPACE) + size = findtext(element=element, xpath="size", namespace=NAMESPACE) + raw_state = findtext(element=element, xpath="status", namespace=NAMESPACE) - state = self.VOLUME_STATE_MAP.get(raw_state, - StorageVolumeState.UNKNOWN) + state = self.VOLUME_STATE_MAP.get(raw_state, StorageVolumeState.UNKNOWN) # Get our tags tags = self._get_resource_tags(element) # If name was not passed into the method then # fall back then use the volume id - name = name if name else tags.get('Name', volId) + name = name if name else tags.get("Name", volId) # Get our extra dictionary - extra = self._get_extra_dict( - element, RESOURCE_EXTRA_ATTRIBUTES_MAP['volume']) + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["volume"]) + + extra["tags"] = tags + + return StorageVolume( + id=volId, name=name, size=int(size), driver=self, state=state, extra=extra + ) + + def _to_volume_modifications(self, object): + return [ + self._to_volume_modification(el) + for el in object.findall( + fixxpath(xpath="volumeModificationSet/item", namespace=NAMESPACE) + ) + ] - extra['tags'] = tags + def _to_volume_modification(self, element): + """ + Parse the XML element and return a StorageVolume object. + + :rtype: :class:`EC2VolumeModification` + """ + params = self._get_extra_dict(element, VOLUME_MODIFICATION_ATTRIBUTE_MAP) - return StorageVolume(id=volId, - name=name, - size=int(size), - driver=self, - state=state, - extra=extra) + return EC2VolumeModification(**params) def _to_snapshots(self, response): - return [self._to_snapshot(el) for el in response.findall( - fixxpath(xpath='snapshotSet/item', namespace=NAMESPACE)) + return [ + self._to_snapshot(el) + for el in response.findall(fixxpath(xpath="snapshotSet/item", namespace=NAMESPACE)) ] def _to_snapshot(self, element, name=None): - snapId = findtext(element=element, xpath='snapshotId', - namespace=NAMESPACE) - size = findtext(element=element, xpath='volumeSize', - namespace=NAMESPACE) - created = parse_date(findtext(element=element, xpath='startTime', - namespace=NAMESPACE)) + snapId = findtext(element=element, xpath="snapshotId", namespace=NAMESPACE) + size = findtext(element=element, xpath="volumeSize", namespace=NAMESPACE) + created = parse_date_allow_empty( + findtext(element=element, xpath="startTime", namespace=NAMESPACE) + ) # Get our tags tags = self._get_resource_tags(element) # If name was not passed into the method then # fall back then use the snapshot id - name = name if name else tags.get('Name', snapId) + name = name if name else tags.get("Name", snapId) # Get our extra dictionary - extra = self._get_extra_dict( - element, RESOURCE_EXTRA_ATTRIBUTES_MAP['snapshot']) + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["snapshot"]) # Add tags and name to the extra dict - extra['tags'] = tags - extra['name'] = name + extra["tags"] = tags + extra["name"] = name + + # state + state = self.SNAPSHOT_STATE_MAP.get(extra["state"], VolumeSnapshotState.UNKNOWN) + + return VolumeSnapshot( + snapId, + size=int(size), + driver=self, + extra=extra, + created=created, + state=state, + name=name, + ) + + def _to_import_snapshot_task(self, element): + status = findtext( + element=element, + xpath="importSnapshotTaskSet/item/" "snapshotTaskDetail/status", + namespace=NAMESPACE, + ) - return VolumeSnapshot(snapId, size=int(size), - driver=self, extra=extra, created=created) + if status != "completed": + snapshotId = None + else: + xpath = "importSnapshotTaskSet/item/snapshotTaskDetail/snapshotId" + snapshotId = findtext(element=element, xpath=xpath, namespace=NAMESPACE) + + return EC2ImportSnapshotTask(status, snapshotId=snapshotId) def _to_key_pairs(self, elems): key_pairs = [self._to_key_pair(elem=elem) for elem in elems] return key_pairs def _to_key_pair(self, elem): - name = findtext(element=elem, xpath='keyName', namespace=NAMESPACE) - fingerprint = findtext(element=elem, xpath='keyFingerprint', - namespace=NAMESPACE).strip() - private_key = findtext(element=elem, xpath='keyMaterial', - namespace=NAMESPACE) - - key_pair = KeyPair(name=name, - public_key=None, - fingerprint=fingerprint, - private_key=private_key, - driver=self) + name = findtext(element=elem, xpath="keyName", namespace=NAMESPACE) + fingerprint = findtext(element=elem, xpath="keyFingerprint", namespace=NAMESPACE).strip() + private_key = findtext(element=elem, xpath="keyMaterial", namespace=NAMESPACE) + + key_pair = KeyPair( + name=name, + public_key=None, + fingerprint=fingerprint, + private_key=private_key, + driver=self, + ) return key_pair def _to_security_groups(self, response): - return [self._to_security_group(el) for el in response.findall( - fixxpath(xpath='securityGroupInfo/item', namespace=NAMESPACE)) + return [ + self._to_security_group(el) + for el in response.findall( + fixxpath(xpath="securityGroupInfo/item", namespace=NAMESPACE) + ) ] def _to_security_group(self, element): # security group id - sg_id = findtext(element=element, - xpath='groupId', - namespace=NAMESPACE) + sg_id = findtext(element=element, xpath="groupId", namespace=NAMESPACE) # security group name - name = findtext(element=element, - xpath='groupName', - namespace=NAMESPACE) + name = findtext(element=element, xpath="groupName", namespace=NAMESPACE) # Get our tags tags = self._get_resource_tags(element) # Get our extra dictionary - extra = self._get_extra_dict( - element, RESOURCE_EXTRA_ATTRIBUTES_MAP['security_group']) + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["security_group"]) # Add tags to the extra dict - extra['tags'] = tags + extra["tags"] = tags # Get ingress rules - ingress_rules = self._to_security_group_rules( - element, 'ipPermissions/item' - ) + ingress_rules = self._to_security_group_rules(element, "ipPermissions/item") # Get egress rules - egress_rules = self._to_security_group_rules( - element, 'ipPermissionsEgress/item' - ) + egress_rules = self._to_security_group_rules(element, "ipPermissionsEgress/item") - return EC2SecurityGroup(sg_id, name, ingress_rules, - egress_rules, extra=extra) + return EC2SecurityGroup(sg_id, name, ingress_rules, egress_rules, extra=extra) def _to_security_group_rules(self, element, xpath): - return [self._to_security_group_rule(el) for el in element.findall( - fixxpath(xpath=xpath, namespace=NAMESPACE)) + return [ + self._to_security_group_rule(el) + for el in element.findall(fixxpath(xpath=xpath, namespace=NAMESPACE)) ] def _to_security_group_rule(self, element): @@ -4942,86 +4653,58 @@ def _to_security_group_rule(self, element): """ rule = {} - rule['protocol'] = findtext(element=element, - xpath='ipProtocol', - namespace=NAMESPACE) + rule["protocol"] = findtext(element=element, xpath="ipProtocol", namespace=NAMESPACE) - rule['from_port'] = findtext(element=element, - xpath='fromPort', - namespace=NAMESPACE) + rule["from_port"] = findtext(element=element, xpath="fromPort", namespace=NAMESPACE) - rule['to_port'] = findtext(element=element, - xpath='toPort', - namespace=NAMESPACE) + rule["to_port"] = findtext(element=element, xpath="toPort", namespace=NAMESPACE) # get security groups - elements = element.findall(fixxpath( - xpath='groups/item', - namespace=NAMESPACE - )) + elements = element.findall(fixxpath(xpath="groups/item", namespace=NAMESPACE)) - rule['group_pairs'] = [] + rule["group_pairs"] = [] for element in elements: item = { - 'user_id': findtext( - element=element, - xpath='userId', - namespace=NAMESPACE), - 'group_id': findtext( - element=element, - xpath='groupId', - namespace=NAMESPACE), - 'group_name': findtext( - element=element, - xpath='groupName', - namespace=NAMESPACE) + "user_id": findtext(element=element, xpath="userId", namespace=NAMESPACE), + "group_id": findtext(element=element, xpath="groupId", namespace=NAMESPACE), + "group_name": findtext(element=element, xpath="groupName", namespace=NAMESPACE), } - rule['group_pairs'].append(item) + rule["group_pairs"].append(item) # get ip ranges - elements = element.findall(fixxpath( - xpath='ipRanges/item', - namespace=NAMESPACE - )) - - rule['cidr_ips'] = [ - findtext( - element=element, - xpath='cidrIp', - namespace=NAMESPACE - ) for element in elements] + elements = element.findall(fixxpath(xpath="ipRanges/item", namespace=NAMESPACE)) + + rule["cidr_ips"] = [ + findtext(element=element, xpath="cidrIp", namespace=NAMESPACE) for element in elements + ] return rule def _to_networks(self, response): - return [self._to_network(el) for el in response.findall( - fixxpath(xpath='vpcSet/item', namespace=NAMESPACE)) + return [ + self._to_network(el) + for el in response.findall(fixxpath(xpath="vpcSet/item", namespace=NAMESPACE)) ] def _to_network(self, element, name=None): # Get the network id - vpc_id = findtext(element=element, - xpath='vpcId', - namespace=NAMESPACE) + vpc_id = findtext(element=element, xpath="vpcId", namespace=NAMESPACE) # Get our tags tags = self._get_resource_tags(element) # Set our name if the Name key/value if available # If we don't get anything back then use the vpc_id - name = name if name else tags.get('Name', vpc_id) + name = name if name else tags.get("Name", vpc_id) - cidr_block = findtext(element=element, - xpath='cidrBlock', - namespace=NAMESPACE) + cidr_block = findtext(element=element, xpath="cidrBlock", namespace=NAMESPACE) # Get our extra dictionary - extra = self._get_extra_dict( - element, RESOURCE_EXTRA_ATTRIBUTES_MAP['network']) + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["network"]) # Add tags to the extra dict - extra['tags'] = tags + extra["tags"] = tags return EC2Network(vpc_id, name, cidr_block, extra=extra) @@ -5037,8 +4720,7 @@ def _to_addresses(self, response, only_associated): :rtype: ``list`` of :class:`ElasticIP` """ addresses = [] - for el in response.findall(fixxpath(xpath='addressesSet/item', - namespace=NAMESPACE)): + for el in response.findall(fixxpath(xpath="addressesSet/item", namespace=NAMESPACE)): addr = self._to_address(el, only_associated) if addr is not None: addresses.append(addr) @@ -5046,20 +4728,14 @@ def _to_addresses(self, response, only_associated): return addresses def _to_address(self, element, only_associated): - instance_id = findtext(element=element, xpath='instanceId', - namespace=NAMESPACE) + instance_id = findtext(element=element, xpath="instanceId", namespace=NAMESPACE) - public_ip = findtext(element=element, - xpath='publicIp', - namespace=NAMESPACE) + public_ip = findtext(element=element, xpath="publicIp", namespace=NAMESPACE) - domain = findtext(element=element, - xpath='domain', - namespace=NAMESPACE) + domain = findtext(element=element, xpath="domain", namespace=NAMESPACE) # Build our extra dict - extra = self._get_extra_dict( - element, RESOURCE_EXTRA_ATTRIBUTES_MAP['elastic_ip']) + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["elastic_ip"]) # Return NoneType if only associated IPs are requested if only_associated and not instance_id: @@ -5068,56 +4744,51 @@ def _to_address(self, element, only_associated): return ElasticIP(public_ip, domain, instance_id, extra=extra) def _to_placement_groups(self, response): - return [self._to_placement_group(el) - for el in response.findall( - fixxpath(xpath='placementGroupSet/item', - namespace=NAMESPACE))] + return [ + self._to_placement_group(el) + for el in response.findall( + fixxpath(xpath="placementGroupSet/item", namespace=NAMESPACE) + ) + ] def _to_placement_group(self, element): - name = findtext(element=element, - xpath='groupName', - namespace=NAMESPACE) - state = findtext(element=element, - xpath='state', - namespace=NAMESPACE) - strategy = findtext(element=element, - xpath='strategy', - namespace=NAMESPACE) + name = findtext(element=element, xpath="groupName", namespace=NAMESPACE) + state = findtext(element=element, xpath="state", namespace=NAMESPACE) + strategy = findtext(element=element, xpath="strategy", namespace=NAMESPACE) return EC2PlacementGroup(name, state, strategy) def _to_subnets(self, response): - return [self._to_subnet(el) for el in response.findall( - fixxpath(xpath='subnetSet/item', namespace=NAMESPACE)) + return [ + self._to_subnet(el) + for el in response.findall(fixxpath(xpath="subnetSet/item", namespace=NAMESPACE)) ] def _to_subnet(self, element, name=None): # Get the subnet ID - subnet_id = findtext(element=element, - xpath='subnetId', - namespace=NAMESPACE) + subnet_id = findtext(element=element, xpath="subnetId", namespace=NAMESPACE) # Get our tags tags = self._get_resource_tags(element) # If we don't get anything back then use the subnet_id - name = name if name else tags.get('Name', subnet_id) + name = name if name else tags.get("Name", subnet_id) - state = findtext(element=element, - xpath='state', - namespace=NAMESPACE) + state = findtext(element=element, xpath="state", namespace=NAMESPACE) # Get our extra dictionary - extra = self._get_extra_dict( - element, RESOURCE_EXTRA_ATTRIBUTES_MAP['subnet']) + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["subnet"]) # Also include our tags - extra['tags'] = tags + extra["tags"] = tags return EC2NetworkSubnet(subnet_id, name, state, extra=extra) def _to_interfaces(self, response): - return [self._to_interface(el) for el in response.findall( - fixxpath(xpath='networkInterfaceSet/item', namespace=NAMESPACE)) + return [ + self._to_interface(el) + for el in response.findall( + fixxpath(xpath="networkInterfaceSet/item", namespace=NAMESPACE) + ) ] def _to_interface(self, element, name=None): @@ -5133,59 +4804,56 @@ def _to_interface(self, element, name=None): :rtype: :class: `EC2NetworkInterface` """ - interface_id = findtext(element=element, - xpath='networkInterfaceId', - namespace=NAMESPACE) + interface_id = findtext(element=element, xpath="networkInterfaceId", namespace=NAMESPACE) - state = findtext(element=element, - xpath='status', - namespace=NAMESPACE) + state = findtext(element=element, xpath="status", namespace=NAMESPACE) # Get tags tags = self._get_resource_tags(element) - name = name if name else tags.get('Name', interface_id) + name = name if name else tags.get("Name", interface_id) # Build security groups groups = self._get_security_groups(element) # Build private IPs priv_ips = [] - for item in findall(element=element, - xpath='privateIpAddressesSet/item', - namespace=NAMESPACE): - - priv_ips.append({'private_ip': findtext(element=item, - xpath='privateIpAddress', - namespace=NAMESPACE), - 'private_dns': findtext(element=item, - xpath='privateDnsName', - namespace=NAMESPACE), - 'primary': findtext(element=item, - xpath='primary', - namespace=NAMESPACE)}) + for item in findall( + element=element, xpath="privateIpAddressesSet/item", namespace=NAMESPACE + ): + priv_ips.append( + { + "private_ip": findtext( + element=item, xpath="privateIpAddress", namespace=NAMESPACE + ), + "private_dns": findtext( + element=item, xpath="privateDnsName", namespace=NAMESPACE + ), + "primary": findtext(element=item, xpath="primary", namespace=NAMESPACE), + } + ) # Build our attachment dictionary which we will add into extra later - attributes_map = \ - RESOURCE_EXTRA_ATTRIBUTES_MAP['network_interface_attachment'] + attributes_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["network_interface_attachment"] attachment = self._get_extra_dict(element, attributes_map) # Build our extra dict - attributes_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['network_interface'] + attributes_map = RESOURCE_EXTRA_ATTRIBUTES_MAP["network_interface"] extra = self._get_extra_dict(element, attributes_map) # Include our previously built items as well - extra['tags'] = tags - extra['attachment'] = attachment - extra['private_ips'] = priv_ips - extra['groups'] = groups + extra["tags"] = tags + extra["attachment"] = attachment + extra["private_ips"] = priv_ips + extra["groups"] = groups return EC2NetworkInterface(interface_id, name, state, extra=extra) def _to_reserved_nodes(self, object, xpath): - return [self._to_reserved_node(el) - for el in object.findall(fixxpath(xpath=xpath, - namespace=NAMESPACE))] + return [ + self._to_reserved_node(el) + for el in object.findall(fixxpath(xpath=xpath, namespace=NAMESPACE)) + ] def _to_reserved_node(self, element): """ @@ -5194,28 +4862,25 @@ def _to_reserved_node(self, element): """ # Get our extra dictionary - extra = self._get_extra_dict( - element, RESOURCE_EXTRA_ATTRIBUTES_MAP['reserved_node']) + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["reserved_node"]) try: - size = [size for size in self.list_sizes() if - size.id == extra['instance_type']][0] + size = [size for size in self.list_sizes() if size.id == extra["instance_type"]][0] except IndexError: size = None - return EC2ReservedNode(id=findtext(element=element, - xpath='reservedInstancesId', - namespace=NAMESPACE), - state=findattr(element=element, - xpath='state', - namespace=NAMESPACE), - driver=self, - size=size, - extra=extra) + return EC2ReservedNode( + id=findtext(element=element, xpath="reservedInstancesId", namespace=NAMESPACE), + state=findattr(element=element, xpath="state", namespace=NAMESPACE), + driver=self, + size=size, + extra=extra, + ) def _to_device_mappings(self, object): - return [self._to_device_mapping(el) for el in object.findall( - fixxpath(xpath='blockDeviceMapping/item', namespace=NAMESPACE)) + return [ + self._to_device_mapping(el) + for el in object.findall(fixxpath(xpath="blockDeviceMapping/item", namespace=NAMESPACE)) ] def _to_device_mapping(self, element): @@ -5229,100 +4894,123 @@ def _to_device_mapping(self, element): """ mapping = {} - mapping['device_name'] = findattr(element=element, - xpath='deviceName', - namespace=NAMESPACE) + mapping["device_name"] = findattr(element=element, xpath="deviceName", namespace=NAMESPACE) - mapping['virtual_name'] = findattr(element=element, - xpath='virtualName', - namespace=NAMESPACE) + mapping["virtual_name"] = findattr( + element=element, xpath="virtualName", namespace=NAMESPACE + ) # If virtual name does not exist then this is an EBS volume. # Build the EBS dictionary leveraging the _get_extra_dict method. - if mapping['virtual_name'] is None: - mapping['ebs'] = self._get_extra_dict( - element, RESOURCE_EXTRA_ATTRIBUTES_MAP['ebs_volume']) + if mapping["virtual_name"] is None: + mapping["ebs"] = self._get_extra_dict( + element, RESOURCE_EXTRA_ATTRIBUTES_MAP["ebs_volume"] + ) + + return mapping + + def _to_instance_device_mappings(self, object): + return [ + self._to_instance_device_mapping(el) + for el in object.findall(fixxpath(xpath="blockDeviceMapping/item", namespace=NAMESPACE)) + ] + + def _to_instance_device_mapping(self, element): + """ + Parse the XML element and return a dictionary of device properties. + Additional information can be found at https://goo.gl/OGK88a. + + :rtype: ``dict`` + """ + mapping = {} + + mapping["device_name"] = findattr(element=element, xpath="deviceName", namespace=NAMESPACE) + mapping["ebs"] = self._get_extra_dict( + element, RESOURCE_EXTRA_ATTRIBUTES_MAP["ebs_instance_block_device"] + ) return mapping def _to_internet_gateways(self, object, xpath): - return [self._to_internet_gateway(el) - for el in object.findall(fixxpath(xpath=xpath, - namespace=NAMESPACE))] + return [ + self._to_internet_gateway(el) + for el in object.findall(fixxpath(xpath=xpath, namespace=NAMESPACE)) + ] def _to_internet_gateway(self, element, name=None): - id = findtext(element=element, - xpath='internetGatewayId', - namespace=NAMESPACE) + id = findtext(element=element, xpath="internetGatewayId", namespace=NAMESPACE) - vpc_id = findtext(element=element, - xpath='attachmentSet/item/vpcId', - namespace=NAMESPACE) + vpc_id = findtext(element=element, xpath="attachmentSet/item/vpcId", namespace=NAMESPACE) - state = findtext(element=element, - xpath='attachmentSet/item/state', - namespace=NAMESPACE) + state = findtext(element=element, xpath="attachmentSet/item/state", namespace=NAMESPACE) # If there's no attachment state, let's # set it to available if not state: - state = 'available' + state = "available" # Get our tags tags = self._get_resource_tags(element) # If name was not passed into the method then # fall back then use the gateway id - name = name if name else tags.get('Name', id) - - return VPCInternetGateway(id=id, name=name, vpc_id=vpc_id, - state=state, driver=self.connection.driver, - extra={'tags': tags}) + name = name if name else tags.get("Name", id) + + return VPCInternetGateway( + id=id, + name=name, + vpc_id=vpc_id, + state=state, + driver=self.connection.driver, + extra={"tags": tags}, + ) def _to_route_tables(self, response): - return [self._to_route_table(el) for el in response.findall( - fixxpath(xpath='routeTableSet/item', namespace=NAMESPACE)) + return [ + self._to_route_table(el) + for el in response.findall(fixxpath(xpath="routeTableSet/item", namespace=NAMESPACE)) ] def _to_route_table(self, element, name=None): # route table id - route_table_id = findtext(element=element, - xpath='routeTableId', - namespace=NAMESPACE) + route_table_id = findtext(element=element, xpath="routeTableId", namespace=NAMESPACE) # Get our tags tags = self._get_resource_tags(element) # Get our extra dictionary - extra = self._get_extra_dict( - element, RESOURCE_EXTRA_ATTRIBUTES_MAP['route_table']) + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["route_table"]) # Add tags to the extra dict - extra['tags'] = tags + extra["tags"] = tags # Get routes - routes = self._to_routes(element, 'routeSet/item') + routes = self._to_routes(element, "routeSet/item") # Get subnet associations - subnet_associations = self._to_subnet_associations( - element, 'associationSet/item') + subnet_associations = self._to_subnet_associations(element, "associationSet/item") # Get propagating routes virtual private gateways (VGW) IDs propagating_gateway_ids = [] - for el in element.findall(fixxpath(xpath='propagatingVgwSet/item', - namespace=NAMESPACE)): - propagating_gateway_ids.append(findtext(element=el, - xpath='gatewayId', - namespace=NAMESPACE)) + for el in element.findall(fixxpath(xpath="propagatingVgwSet/item", namespace=NAMESPACE)): + propagating_gateway_ids.append( + findtext(element=el, xpath="gatewayId", namespace=NAMESPACE) + ) - name = name if name else tags.get('Name', id) + name = name if name else tags.get("Name", id) - return EC2RouteTable(route_table_id, name, routes, subnet_associations, - propagating_gateway_ids, extra=extra) + return EC2RouteTable( + route_table_id, + name, + routes, + subnet_associations, + propagating_gateway_ids, + extra=extra, + ) def _to_routes(self, element, xpath): - return [self._to_route(el) for el in element.findall( - fixxpath(xpath=xpath, namespace=NAMESPACE)) + return [ + self._to_route(el) for el in element.findall(fixxpath(xpath=xpath, namespace=NAMESPACE)) ] def _to_route(self, element): @@ -5332,44 +5020,41 @@ def _to_route(self, element): :rtype: :class: `EC2Route` """ - destination_cidr = findtext(element=element, - xpath='destinationCidrBlock', - namespace=NAMESPACE) + destination_cidr = findtext( + element=element, xpath="destinationCidrBlock", namespace=NAMESPACE + ) - gateway_id = findtext(element=element, - xpath='gatewayId', - namespace=NAMESPACE) + gateway_id = findtext(element=element, xpath="gatewayId", namespace=NAMESPACE) - instance_id = findtext(element=element, - xpath='instanceId', - namespace=NAMESPACE) + instance_id = findtext(element=element, xpath="instanceId", namespace=NAMESPACE) - owner_id = findtext(element=element, - xpath='instanceOwnerId', - namespace=NAMESPACE) + owner_id = findtext(element=element, xpath="instanceOwnerId", namespace=NAMESPACE) - interface_id = findtext(element=element, - xpath='networkInterfaceId', - namespace=NAMESPACE) + interface_id = findtext(element=element, xpath="networkInterfaceId", namespace=NAMESPACE) - state = findtext(element=element, - xpath='state', - namespace=NAMESPACE) + state = findtext(element=element, xpath="state", namespace=NAMESPACE) - origin = findtext(element=element, - xpath='origin', - namespace=NAMESPACE) + origin = findtext(element=element, xpath="origin", namespace=NAMESPACE) - vpc_peering_connection_id = findtext(element=element, - xpath='vpcPeeringConnectionId', - namespace=NAMESPACE) + vpc_peering_connection_id = findtext( + element=element, xpath="vpcPeeringConnectionId", namespace=NAMESPACE + ) - return EC2Route(destination_cidr, gateway_id, instance_id, owner_id, - interface_id, state, origin, vpc_peering_connection_id) + return EC2Route( + destination_cidr, + gateway_id, + instance_id, + owner_id, + interface_id, + state, + origin, + vpc_peering_connection_id, + ) def _to_subnet_associations(self, element, xpath): - return [self._to_subnet_association(el) for el in element.findall( - fixxpath(xpath=xpath, namespace=NAMESPACE)) + return [ + self._to_subnet_association(el) + for el in element.findall(fixxpath(xpath=xpath, namespace=NAMESPACE)) ] def _to_subnet_association(self, element): @@ -5379,26 +5064,19 @@ def _to_subnet_association(self, element): :rtype: :class: `EC2SubnetAssociation` """ - association_id = findtext(element=element, - xpath='routeTableAssociationId', - namespace=NAMESPACE) + association_id = findtext( + element=element, xpath="routeTableAssociationId", namespace=NAMESPACE + ) - route_table_id = findtext(element=element, - xpath='routeTableId', - namespace=NAMESPACE) + route_table_id = findtext(element=element, xpath="routeTableId", namespace=NAMESPACE) - subnet_id = findtext(element=element, - xpath='subnetId', - namespace=NAMESPACE) + subnet_id = findtext(element=element, xpath="subnetId", namespace=NAMESPACE) - main = findtext(element=element, - xpath='main', - namespace=NAMESPACE) + main = findtext(element=element, xpath="main", namespace=NAMESPACE) main = True if main else False - return EC2SubnetAssociation(association_id, route_table_id, - subnet_id, main) + return EC2SubnetAssociation(association_id, route_table_id, subnet_id, main) def _pathlist(self, key, arr): """ @@ -5409,25 +5087,23 @@ def _pathlist(self, key, arr): for value in arr: i += 1 - params['%s.%s' % (key, i)] = value + params["{}.{}".format(key, i)] = value return params def _get_boolean(self, element): - tag = '{%s}%s' % (NAMESPACE, 'return') - return element.findtext(tag) == 'true' + tag = "{{{}}}{}".format(NAMESPACE, "return") + return element.findtext(tag) == "true" def _get_terminate_boolean(self, element): - status = element.findtext(".//{%s}%s" % (NAMESPACE, 'name')) - return any([term_status == status - for term_status - in ('shutting-down', 'terminated')]) + status = element.findtext(".//{{{}}}{}".format(NAMESPACE, "name")) + return any([term_status == status for term_status in ("shutting-down", "terminated")]) def _add_instance_filter(self, params, node): """ Add instance filter to the provided params dictionary. """ - filters = {'instance-id': node.id} + filters = {"instance-id": node.id} params.update(self._build_filters(filters)) return params @@ -5436,11 +5112,13 @@ def _get_state_boolean(self, element): """ Checks for the instances's state """ - state = findall(element=element, - xpath='instancesSet/item/currentState/name', - namespace=NAMESPACE)[0].text + state = findall( + element=element, + xpath="instancesSet/item/currentState/name", + namespace=NAMESPACE, + )[0].text - return state in ('stopping', 'pending', 'starting') + return state in ("stopping", "pending", "starting") def _get_extra_dict(self, element, mapping): """ @@ -5457,10 +5135,8 @@ def _get_extra_dict(self, element, mapping): """ extra = {} for attribute, values in mapping.items(): - transform_func = values['transform_func'] - value = findattr(element=element, - xpath=values['xpath'], - namespace=NAMESPACE) + transform_func = values["transform_func"] + value = findattr(element=element, xpath=values["xpath"], namespace=NAMESPACE) if value is not None: extra[attribute] = transform_func(value) else: @@ -5478,18 +5154,12 @@ def _get_resource_tags(self, element): tags = {} # Get our tag set by parsing the element - tag_set = findall(element=element, - xpath='tagSet/item', - namespace=NAMESPACE) + tag_set = findall(element=element, xpath="tagSet/item", namespace=NAMESPACE) for tag in tag_set: - key = findtext(element=tag, - xpath='key', - namespace=NAMESPACE) + key = findtext(element=tag, xpath="key", namespace=NAMESPACE) - value = findtext(element=tag, - xpath='value', - namespace=NAMESPACE) + value = findtext(element=tag, xpath="value", namespace=NAMESPACE) tags[key] = value @@ -5508,47 +5178,136 @@ def _get_block_device_mapping_params(self, block_device_mapping): """ if not isinstance(block_device_mapping, (list, tuple)): - raise AttributeError( - 'block_device_mapping not list or tuple') + raise AttributeError("block_device_mapping not list or tuple") params = {} for idx, mapping in enumerate(block_device_mapping): idx += 1 # We want 1-based indexes if not isinstance(mapping, dict): - raise AttributeError( - 'mapping %s in block_device_mapping ' - 'not a dict' % mapping) + raise AttributeError("mapping %s in block_device_mapping " "not a dict" % mapping) for k, v in mapping.items(): if not isinstance(v, dict): - params['BlockDeviceMapping.%d.%s' % (idx, k)] = str(v) + params["BlockDeviceMapping.%d.%s" % (idx, k)] = str(v) + else: + for key, value in v.items(): + params["BlockDeviceMapping.%d.%s.%s" % (idx, k, key)] = str(value) + return params + + def _get_billing_product_params(self, billing_products): + """ + Return a list of dictionaries with valid param for billing product. + + :param billing_product: List of billing code values(str) + :type billing product: ``list`` + + :return: Dictionary representation of the billing product codes + :rtype: ``dict`` + """ + + if not isinstance(billing_products, (list, tuple)): + raise AttributeError("billing_products not list or tuple") + + params = {} + + for idx, v in enumerate(billing_products): + idx += 1 # We want 1-based indexes + params["BillingProduct.%d" % (idx)] = str(v) + + return params + + def _get_disk_container_params(self, disk_container): + """ + Return a list of dictionaries with query parameters for + a valid disk container. + + :param disk_container: List of dictionaries with + disk_container details + :type disk_container: ``list`` or ``dict`` + + :return: Dictionary representation of the disk_container + :rtype: ``dict`` + """ + + if not isinstance(disk_container, (list, tuple)): + raise AttributeError("disk_container not list or tuple") + + params = {} + + for idx, content in enumerate(disk_container): + idx += 1 # We want 1-based indexes + if not isinstance(content, dict): + raise AttributeError("content %s in disk_container not a dict" % content) + + for k, v in content.items(): + if not isinstance(v, dict): + params["DiskContainer.%s" % (k)] = str(v) + else: for key, value in v.items(): - params['BlockDeviceMapping.%d.%s.%s' - % (idx, k, key)] = str(value) + params["DiskContainer.{}.{}".format(k, key)] = str(value) + + return params + + def _get_client_data_params(self, client_data): + """ + Return a dictionary with query parameters for + a valid client data. + + :param client_data: List of dictionaries with the disk + upload details + :type client_data: ``dict`` + + :return: Dictionary representation of the client data + :rtype: ``dict`` + """ + + if not isinstance(client_data, (list, tuple)): + raise AttributeError("client_data not list or tuple") + + params = {} + + for idx, content in enumerate(client_data): + idx += 1 # We want 1-based indexes + if not isinstance(content, dict): + raise AttributeError("content %s in client_data" "not a dict" % content) + + for k, v in content.items(): + params["ClientData.%s" % (k)] = str(v) + return params - def _get_common_security_group_params(self, group_id, protocol, - from_port, to_port, cidr_ips, - group_pairs): + def _get_common_security_group_params( + self, + group_id, + protocol, + from_port, + to_port, + cidr_ips, + group_pairs, + description=None, + ): """ Return a dictionary with common query parameters which are used when operating on security groups. :rtype: ``dict`` """ - params = {'GroupId': group_id, - 'IpPermissions.1.IpProtocol': protocol, - 'IpPermissions.1.FromPort': from_port, - 'IpPermissions.1.ToPort': to_port} + params = { + "GroupId": group_id, + "IpPermissions.1.IpProtocol": protocol, + "IpPermissions.1.FromPort": from_port, + "IpPermissions.1.ToPort": to_port, + } if cidr_ips is not None: ip_ranges = {} for index, cidr_ip in enumerate(cidr_ips): index += 1 - ip_ranges['IpPermissions.1.IpRanges.%s.CidrIp' - % (index)] = cidr_ip + ip_ranges["IpPermissions.1.IpRanges.%s.CidrIp" % (index)] = cidr_ip + if description is not None: + ip_ranges["IpPermissions.1.IpRanges.%s.Description" % (index)] = description params.update(ip_ranges) @@ -5557,17 +5316,20 @@ def _get_common_security_group_params(self, group_id, protocol, for index, group_pair in enumerate(group_pairs): index += 1 - if 'group_id' in group_pair.keys(): - user_groups['IpPermissions.1.Groups.%s.GroupId' - % (index)] = group_pair['group_id'] + if "group_id" in group_pair.keys(): + user_groups["IpPermissions.1.Groups.%s.GroupId" % (index)] = group_pair[ + "group_id" + ] - if 'group_name' in group_pair.keys(): - user_groups['IpPermissions.1.Groups.%s.GroupName' - % (index)] = group_pair['group_name'] + if "group_name" in group_pair.keys(): + user_groups["IpPermissions.1.Groups.%s.GroupName" % (index)] = group_pair[ + "group_name" + ] - if 'user_id' in group_pair.keys(): - user_groups['IpPermissions.1.Groups.%s.UserId' - % (index)] = group_pair['user_id'] + if "user_id" in group_pair.keys(): + user_groups["IpPermissions.1.Groups.%s.UserId" % (index)] = group_pair[ + "user_id" + ] params.update(user_groups) @@ -5576,23 +5338,19 @@ def _get_common_security_group_params(self, group_id, protocol, def _get_security_groups(self, element): """ Parse security groups from the provided element and return a - list of security groups with the id ane name key/value pairs. + list of security groups with the id and name key/value pairs. :rtype: ``list`` of ``dict`` """ groups = [] - for item in findall(element=element, - xpath='groupSet/item', - namespace=NAMESPACE): - groups.append({ - 'group_id': findtext(element=item, - xpath='groupId', - namespace=NAMESPACE), - 'group_name': findtext(element=item, - xpath='groupName', - namespace=NAMESPACE) - }) + for item in findall(element=element, xpath="groupSet/item", namespace=NAMESPACE): + groups.append( + { + "group_id": findtext(element=item, xpath="groupId", namespace=NAMESPACE), + "group_name": findtext(element=item, xpath="groupName", namespace=NAMESPACE), + } + ) return groups @@ -5612,17 +5370,16 @@ def _build_filters(self, filters): for filter_idx, filter_data in enumerate(filters.items()): filter_idx += 1 # We want 1-based indexes filter_name, filter_values = filter_data - filter_key = 'Filter.%s.Name' % (filter_idx) + filter_key = "Filter.%s.Name" % (filter_idx) filter_entries[filter_key] = filter_name if isinstance(filter_values, list): for value_idx, value in enumerate(filter_values): value_idx += 1 # We want 1-based indexes - value_key = 'Filter.%s.Value.%s' % (filter_idx, - value_idx) + value_key = "Filter.{}.Value.{}".format(filter_idx, value_idx) filter_entries[value_key] = value else: - value_key = 'Filter.%s.Value.1' % (filter_idx) + value_key = "Filter.%s.Value.1" % (filter_idx) filter_entries[value_key] = filter_values return filter_entries @@ -5635,38 +5392,60 @@ class EC2NodeDriver(BaseEC2NodeDriver): connectionCls = EC2Connection type = Provider.EC2 - name = 'Amazon EC2' - website = 'http://aws.amazon.com/ec2/' - path = '/' + name = "Amazon EC2" + website = "http://aws.amazon.com/ec2/" + path = "/" NODE_STATE_MAP = { - 'pending': NodeState.PENDING, - 'running': NodeState.RUNNING, - 'shutting-down': NodeState.UNKNOWN, - 'terminated': NodeState.TERMINATED, - 'stopped': NodeState.STOPPED + "pending": NodeState.PENDING, + "running": NodeState.RUNNING, + "shutting-down": NodeState.UNKNOWN, + "terminated": NodeState.TERMINATED, + "stopped": NodeState.STOPPED, } - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region='us-east-1', **kwargs): - if hasattr(self, '_region'): - region = self._region - - if region not in VALID_EC2_REGIONS: - raise ValueError('Invalid region: %s' % (region)) - - details = REGION_DETAILS[region] + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + region="us-east-1", + token=None, + signature_version=None, + **kwargs, + ): + if hasattr(self, "_region"): + region = self._region # pylint: disable=no-member + + valid_regions = self.list_regions() + if region not in valid_regions: + raise ValueError("Invalid region: %s" % (region)) + + details = REGION_DETAILS_PARTIAL[region] self.region_name = region - self.api_name = details['api_name'] - self.country = details['country'] - self.signature_version = details.pop('signature_version', - DEFAULT_SIGNATURE_VERSION) + self.token = token + self.api_name = details["api_name"] + self.country = details["country"] + + # Precedence goes as follows from highest to lowest: + # 1. signature_version constructor argument + # 2. signature_version from ec2_region_details_partial.py constants + # file + # 3. DEFAULT_SIGNATURE_VERSION constant + if signature_version: + self.signature_version = signature_version + else: + self.signature_version = details.get("signature_version", DEFAULT_SIGNATURE_VERSION) - host = host or details['endpoint'] + host = host or details["endpoint"] - super(EC2NodeDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, **kwargs) + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port, **kwargs) + + @classmethod + def list_regions(cls): + return VALID_EC2_REGIONS class IdempotentParamError(LibcloudError): @@ -5679,62 +5458,6 @@ def __str__(self): return repr(self.value) -class EC2EUNodeDriver(EC2NodeDriver): - """ - Driver class for EC2 in the Western Europe Region. - """ - name = 'Amazon EC2 (eu-west-1)' - _region = 'eu-west-1' - - -class EC2USWestNodeDriver(EC2NodeDriver): - """ - Driver class for EC2 in the Western US Region - """ - name = 'Amazon EC2 (us-west-1)' - _region = 'us-west-1' - - -class EC2USWestOregonNodeDriver(EC2NodeDriver): - """ - Driver class for EC2 in the US West Oregon region. - """ - name = 'Amazon EC2 (us-west-2)' - _region = 'us-west-2' - - -class EC2APSENodeDriver(EC2NodeDriver): - """ - Driver class for EC2 in the Southeast Asia Pacific Region. - """ - name = 'Amazon EC2 (ap-southeast-1)' - _region = 'ap-southeast-1' - - -class EC2APNENodeDriver(EC2NodeDriver): - """ - Driver class for EC2 in the Northeast Asia Pacific Region. - """ - name = 'Amazon EC2 (ap-northeast-1)' - _region = 'ap-northeast-1' - - -class EC2SAEastNodeDriver(EC2NodeDriver): - """ - Driver class for EC2 in the South America (Sao Paulo) Region. - """ - name = 'Amazon EC2 (sa-east-1)' - _region = 'sa-east-1' - - -class EC2APSESydneyNodeDriver(EC2NodeDriver): - """ - Driver class for EC2 in the Southeast Asia Pacific (Sydney) Region. - """ - name = 'Amazon EC2 (ap-southeast-2)' - _region = 'ap-southeast-2' - - class EucConnection(EC2Connection): """ Connection class for Eucalyptus @@ -5748,15 +5471,23 @@ class EucNodeDriver(BaseEC2NodeDriver): Driver class for Eucalyptus """ - name = 'Eucalyptus' - website = 'http://www.eucalyptus.com/' - api_name = 'ec2_us_east' - region_name = 'us-east-1' + name = "Eucalyptus" + website = "http://www.eucalyptus.com/" + api_name = "ec2_us_east" + region_name = "us-east-1" connectionCls = EucConnection - signature_version = '2' - - def __init__(self, key, secret=None, secure=True, host=None, - path=None, port=None, api_version=DEFAULT_EUCA_API_VERSION): + signature_version = "2" + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + path=None, + port=None, + api_version=DEFAULT_EUCA_API_VERSION, + ): """ @inherits: :class:`EC2NodeDriver.__init__` @@ -5767,55 +5498,52 @@ def __init__(self, key, secret=None, secure=True, host=None, Eucalyptus proprietary API calls :type api_version: ``str`` """ - super(EucNodeDriver, self).__init__(key, secret, secure, host, port) + super().__init__(key, secret, secure, host, port) if path is None: - path = '/services/Eucalyptus' + path = "/services/Eucalyptus" self.path = path - self.EUCA_NAMESPACE = 'http://msgs.eucalyptus.com/%s' % (api_version) + self.EUCA_NAMESPACE = "http://msgs.eucalyptus.com/%s" % (api_version) def list_locations(self): - raise NotImplementedError( - 'list_locations not implemented for this driver') + raise NotImplementedError("list_locations not implemented for this driver") def _to_sizes(self, response): - return [self._to_size(el) for el in response.findall( - fixxpath(xpath='instanceTypeDetails/item', - namespace=self.EUCA_NAMESPACE))] + return [ + self._to_size(el) + for el in response.findall( + fixxpath(xpath="instanceTypeDetails/item", namespace=self.EUCA_NAMESPACE) + ) + ] def _to_size(self, el): - name = findtext(element=el, - xpath='name', - namespace=self.EUCA_NAMESPACE) - cpu = findtext(element=el, - xpath='cpu', - namespace=self.EUCA_NAMESPACE) - disk = findtext(element=el, - xpath='disk', - namespace=self.EUCA_NAMESPACE) - memory = findtext(element=el, - xpath='memory', - namespace=self.EUCA_NAMESPACE) - - return NodeSize(id=name, - name=name, - ram=int(memory), - disk=int(disk), - bandwidth=None, - price=None, - driver=EucNodeDriver, - extra={ - 'cpu': int(cpu) - }) - - def list_sizes(self): - """ - List available instance flavors/sizes + name = findtext(element=el, xpath="name", namespace=self.EUCA_NAMESPACE) + cpu = findtext(element=el, xpath="cpu", namespace=self.EUCA_NAMESPACE) + disk = findtext(element=el, xpath="disk", namespace=self.EUCA_NAMESPACE) + memory = findtext(element=el, xpath="memory", namespace=self.EUCA_NAMESPACE) + + return NodeSize( + id=name, + name=name, + ram=int(memory), + disk=int(disk), + bandwidth=None, + price=None, + driver=EucNodeDriver, + extra={"cpu": int(cpu)}, + ) + + def list_sizes( + self, + location=None, + ): + """ + Lists available nodes sizes. :rtype: ``list`` of :class:`NodeSize` """ - params = {'Action': 'DescribeInstanceTypes'} + params = {"Action": "DescribeInstanceTypes"} response = self.connection.request(self.path, params=params).object return self._to_sizes(response) @@ -5842,14 +5570,28 @@ class NimbusNodeDriver(BaseEC2NodeDriver): """ type = Provider.NIMBUS - name = 'Nimbus' - website = 'http://www.nimbusproject.org/' - country = 'Private' - api_name = 'nimbus' - region_name = 'nimbus' - friendly_name = 'Nimbus Private Cloud' + name = "Nimbus" + website = "http://www.nimbusproject.org/" + country = "Private" + api_name = "nimbus" + region_name = "nimbus" + friendly_name = "Nimbus Private Cloud" connectionCls = NimbusConnection - signature_version = '2' + signature_version = "2" + + def list_sizes(self, location=None): + from libcloud.compute.constants.ec2_instance_types import INSTANCE_TYPES + + available_types = REGION_DETAILS_NIMBUS["instance_types"] + sizes = [] + + for instance_type in available_types: + attributes = INSTANCE_TYPES[instance_type] + attributes = copy.deepcopy(attributes) + attributes["price"] = None # pricing not available + sizes.append(NodeSize(driver=self, **attributes)) + + return sizes def ex_describe_addresses(self, nodes): """ @@ -5877,6 +5619,7 @@ class OutscaleConnection(EC2Connection): Connection class for Outscale """ + version = DEFAULT_OUTSCALE_API_VERSION host = None @@ -5888,71 +5631,79 @@ class OutscaleNodeDriver(BaseEC2NodeDriver): """ connectionCls = OutscaleConnection - name = 'Outscale' - website = 'http://www.outscale.com' - path = '/' - signature_version = '2' + name = "Outscale" + website = "http://www.outscale.com" + path = "/" + signature_version = "2" NODE_STATE_MAP = { - 'pending': NodeState.PENDING, - 'running': NodeState.RUNNING, - 'shutting-down': NodeState.UNKNOWN, - 'terminated': NodeState.TERMINATED, - 'stopped': NodeState.STOPPED + "pending": NodeState.PENDING, + "running": NodeState.RUNNING, + "shutting-down": NodeState.UNKNOWN, + "terminated": NodeState.TERMINATED, + "stopped": NodeState.STOPPED, } - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region='us-east-1', region_details=None, **kwargs): - if hasattr(self, '_region'): - region = self._region + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + region="us-east-1", + region_details=None, + **kwargs, + ): + if hasattr(self, "_region"): + region = getattr(self, "_region", None) if region_details is None: - raise ValueError('Invalid region_details argument') + raise ValueError("Invalid region_details argument") if region not in region_details.keys(): - raise ValueError('Invalid region: %s' % (region)) + raise ValueError("Invalid region: %s" % (region)) self.region_name = region self.region_details = region_details details = self.region_details[region] - self.api_name = details['api_name'] - self.country = details['country'] + self.api_name = details["api_name"] + self.country = details["country"] - self.connectionCls.host = details['endpoint'] + self.connectionCls.host = details["endpoint"] - self._not_implemented_msg =\ - 'This method is not supported in the Outscale driver' + self._not_implemented_msg = "This method is not supported in the Outscale driver" - super(BaseEC2NodeDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, **kwargs) + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port, **kwargs) - def create_node(self, **kwargs): + def create_node(self, name, size, image, location=None, auth=None, **kwargs): """ - Create a new Outscale node. The ex_iamprofile keyword is not supported. + Creates a new Outscale node. The ex_iamprofile keyword + is not supported. @inherits: :class:`BaseEC2NodeDriver.create_node` :keyword ex_keyname: The name of the key pair :type ex_keyname: ``str`` - :keyword ex_userdata: User data + :keyword ex_userdata: The user data :type ex_userdata: ``str`` :keyword ex_security_groups: A list of names of security groups to assign to the node. :type ex_security_groups: ``list`` - :keyword ex_metadata: Key/Value metadata to associate with a node + :keyword ex_metadata: The Key/Value metadata to associate + with a node. :type ex_metadata: ``dict`` - :keyword ex_mincount: Minimum number of instances to launch + :keyword ex_mincount: The minimum number of nodes to launch :type ex_mincount: ``int`` - :keyword ex_maxcount: Maximum number of instances to launch + :keyword ex_maxcount: The maximum number of nodes to launch :type ex_maxcount: ``int`` - :keyword ex_clienttoken: Unique identifier to ensure idempotency + :keyword ex_clienttoken: A unique identifier to ensure idempotency :type ex_clienttoken: ``str`` :keyword ex_blockdevicemappings: ``list`` of ``dict`` block device @@ -5962,13 +5713,20 @@ def create_node(self, **kwargs): :keyword ex_ebs_optimized: EBS-Optimized if True :type ex_ebs_optimized: ``bool`` """ - if 'ex_iamprofile' in kwargs: + if "ex_iamprofile" in kwargs: raise NotImplementedError("ex_iamprofile not implemented") - return super(OutscaleNodeDriver, self).create_node(**kwargs) + return super().create_node( + name=name, + size=size, + image=image, + location=location, + auth=auth, + **kwargs, + ) def ex_create_network(self, cidr_block, name=None): """ - Create a network/VPC. Outscale does not support instance_tenancy. + Creates a network/VPC. Outscale does not support instance_tenancy. :param cidr_block: The CIDR block assigned to the network :type cidr_block: ``str`` @@ -5979,16 +5737,22 @@ def ex_create_network(self, cidr_block, name=None): :return: Dictionary of network properties :rtype: ``dict`` """ - return super(OutscaleNodeDriver, self).ex_create_network(cidr_block, - name=name) - - def ex_modify_instance_attribute(self, node, disable_api_termination=None, - ebs_optimized=None, group_id=None, - source_dest_check=None, user_data=None, - instance_type=None): - """ - Modify node attributes. - Ouscale support the following attributes: + return super().ex_create_network(cidr_block, name=name) + + def ex_modify_instance_attribute( + self, + node, + disable_api_termination=None, + ebs_optimized=None, + group_id=None, + source_dest_check=None, + user_data=None, + instance_type=None, + attributes=None, + ): + """ + Modifies node attributes. + Ouscale supports the following attributes: 'DisableApiTermination.Value', 'EbsOptimized', 'GroupId.n', 'SourceDestCheck.Value', 'UserData.Value', 'InstanceType.Value' @@ -5996,32 +5760,37 @@ def ex_modify_instance_attribute(self, node, disable_api_termination=None, :param node: Node instance :type node: :class:`Node` - :param attributes: Dictionary with node attributes + :param attributes: A dictionary with node attributes :type attributes: ``dict`` :return: True on success, False otherwise. :rtype: ``bool`` """ - attributes = {} + attributes = attributes or {} if disable_api_termination is not None: - attributes['DisableApiTermination.Value'] = disable_api_termination + attributes["DisableApiTermination.Value"] = disable_api_termination if ebs_optimized is not None: - attributes['EbsOptimized'] = ebs_optimized + attributes["EbsOptimized"] = ebs_optimized if group_id is not None: - attributes['GroupId.n'] = group_id + attributes["GroupId.n"] = group_id if source_dest_check is not None: - attributes['SourceDestCheck.Value'] = source_dest_check + attributes["SourceDestCheck.Value"] = source_dest_check if user_data is not None: - attributes['UserData.Value'] = user_data + attributes["UserData.Value"] = user_data if instance_type is not None: - attributes['InstanceType.Value'] = instance_type + attributes["InstanceType.Value"] = instance_type - return super(OutscaleNodeDriver, self).ex_modify_instance_attribute( - node, attributes) + return super().ex_modify_instance_attribute(node, attributes) - def ex_register_image(self, name, description=None, architecture=None, - root_device_name=None, block_device_mapping=None): + def ex_register_image( + self, + name, + description=None, + architecture=None, + root_device_name=None, + block_device_mapping=None, + ): """ Registers a Machine Image based off of an EBS-backed instance. Can also be used to create images from snapshots. @@ -6048,10 +5817,13 @@ def ex_register_image(self, name, description=None, architecture=None, :rtype: :class:`NodeImage` """ - return super(OutscaleNodeDriver, self).ex_register_image( - name, description=description, architecture=architecture, + return super().ex_register_image( + name, + description=description, + architecture=architecture, root_device_name=root_device_name, - block_device_mapping=block_device_mapping) + block_device_mapping=block_device_mapping, + ) def ex_copy_image(self, source_region, image, name=None, description=None): """ @@ -6069,9 +5841,9 @@ def ex_get_limits(self): """ raise NotImplementedError(self._not_implemented_msg) - def ex_create_network_interface(self, subnet, name=None, - description=None, - private_ip_address=None): + def ex_create_network_interface( + self, subnet, name=None, description=None, private_ip_address=None + ): """ Outscale does not support creating a network interface within a VPC. @@ -6087,8 +5859,7 @@ def ex_delete_network_interface(self, network_interface): """ raise NotImplementedError(self._not_implemented_msg) - def ex_attach_network_interface_to_node(self, network_interface, - node, device_index): + def ex_attach_network_interface_to_node(self, network_interface, node, device_index): """ Outscale does not support attaching a network interface. @@ -6106,50 +5877,362 @@ def ex_detach_network_interface(self, attachment_id, force=False): def list_sizes(self, location=None): """ - List available instance flavors/sizes + Lists available nodes sizes. - This override the EC2 default method in order to use Outscale infos. + This overrides the EC2 default method in order to use Outscale + information or data. :rtype: ``list`` of :class:`NodeSize` """ - available_types =\ - self.region_details[self.region_name]['instance_types'] + available_types = self.region_details[self.region_name]["instance_types"] sizes = [] for instance_type in available_types: attributes = OUTSCALE_INSTANCE_TYPES[instance_type] attributes = copy.deepcopy(attributes) - price = self._get_size_price(size_id=instance_type) - attributes.update({'price': price}) + price = get_size_price( + driver_type="compute", + driver_name="ec2_linux", + size_id=instance_type, + region=self.region_name, + ) + if price is None: + attributes["price"] = None + else: + attributes["price"] = price + attributes.update({"price": price}) sizes.append(NodeSize(driver=self, **attributes)) return sizes + def ex_modify_instance_keypair(self, instance_id, key_name=None): + """ + Modifies the keypair associated with a specified instance. + Once the modification is done, you must restart the instance. + + :param instance_id: The ID of the instance + :type instance_id: ``string`` + + :param key_name: The name of the keypair + :type key_name: ``string`` + """ + + params = {"Action": "ModifyInstanceKeypair"} + + params.update({"instanceId": instance_id}) + + if key_name is not None: + params.update({"keyName": key_name}) + + response = self.connection.request(self.path, params=params, method="GET").object + + return findtext(element=response, xpath="return", namespace=OUTSCALE_NAMESPACE) == "true" + + def _to_quota(self, elem): + """ + To Quota + """ + + quota = {} + for reference_quota_item in findall( + element=elem, xpath="referenceQuotaSet/item", namespace=OUTSCALE_NAMESPACE + ): + reference = findtext( + element=reference_quota_item, + xpath="reference", + namespace=OUTSCALE_NAMESPACE, + ) + quota_set = [] + for quota_item in findall( + element=reference_quota_item, + xpath="quotaSet/item", + namespace=OUTSCALE_NAMESPACE, + ): + ownerId = findtext( + element=quota_item, xpath="ownerId", namespace=OUTSCALE_NAMESPACE + ) + name = findtext(element=quota_item, xpath="name", namespace=OUTSCALE_NAMESPACE) + displayName = findtext( + element=quota_item, + xpath="displayName", + namespace=OUTSCALE_NAMESPACE, + ) + description = findtext( + element=quota_item, + xpath="description", + namespace=OUTSCALE_NAMESPACE, + ) + groupName = findtext( + element=quota_item, xpath="groupName", namespace=OUTSCALE_NAMESPACE + ) + maxQuotaValue = findtext( + element=quota_item, + xpath="maxQuotaValue", + namespace=OUTSCALE_NAMESPACE, + ) + usedQuotaValue = findtext( + element=quota_item, + xpath="usedQuotaValue", + namespace=OUTSCALE_NAMESPACE, + ) + quota_set.append( + { + "ownerId": ownerId, + "name": name, + "displayName": displayName, + "description": description, + "groupName": groupName, + "maxQuotaValue": maxQuotaValue, + "usedQuotaValue": usedQuotaValue, + } + ) + quota[reference] = quota_set + + return quota + + def ex_describe_quotas(self, dry_run=False, filters=None, max_results=None, marker=None): + """ + Describes one or more of your quotas. + + :param dry_run: dry_run + :type dry_run: ``bool`` + + :param filters: The filters so that the response returned includes + information for certain quotas only. + :type filters: ``dict`` + + :param max_results: The maximum number of items that can be + returned in a single page (by default, 100) + :type max_results: ``int`` + + :param marker: Set quota marker + :type marker: ``string`` + + :return: (is_truncated, quota) tuple + :rtype: ``(bool, dict)`` + """ + + if filters: + raise NotImplementedError("quota filters are not implemented") + + if marker: + raise NotImplementedError("quota marker is not implemented") + + params = {"Action": "DescribeQuotas"} + + if dry_run: + params.update({"DryRun": dry_run}) + + if max_results: + params.update({"MaxResults": max_results}) + + response = self.connection.request(self.path, params=params, method="GET").object + + quota = self._to_quota(response) + + is_truncated = findtext(element=response, xpath="isTruncated", namespace=OUTSCALE_NAMESPACE) + + return is_truncated, quota + + def _to_product_type(self, elem): + productTypeId = findtext(element=elem, xpath="productTypeId", namespace=OUTSCALE_NAMESPACE) + description = findtext(element=elem, xpath="description", namespace=OUTSCALE_NAMESPACE) + + return {"productTypeId": productTypeId, "description": description} + + def ex_get_product_type(self, image_id, snapshot_id=None): + """ + Gets the product type of a specified OMI or snapshot. + + :param image_id: The ID of the OMI + :type image_id: ``string`` + + :param snapshot_id: The ID of the snapshot + :type snapshot_id: ``string`` + + :return: A product type + :rtype: ``dict`` + """ + + params = {"Action": "GetProductType"} + + params.update({"ImageId": image_id}) + if snapshot_id is not None: + params.update({"SnapshotId": snapshot_id}) + + response = self.connection.request(self.path, params=params, method="GET").object + + product_type = self._to_product_type(response) + + return product_type + + def _to_product_types(self, elem): + product_types = [] + for product_types_item in findall( + element=elem, xpath="productTypeSet/item", namespace=OUTSCALE_NAMESPACE + ): + productTypeId = findtext( + element=product_types_item, + xpath="productTypeId", + namespace=OUTSCALE_NAMESPACE, + ) + description = findtext( + element=product_types_item, + xpath="description", + namespace=OUTSCALE_NAMESPACE, + ) + product_types.append({"productTypeId": productTypeId, "description": description}) + + return product_types + + def ex_describe_product_types(self, filters=None): + """ + Describes product types. + + :param filters: The filters so that the list returned includes + information for certain quotas only. + :type filters: ``dict`` + + :return: A product types list + :rtype: ``list`` + """ + + params = {"Action": "DescribeProductTypes"} + + if filters: + params.update(self._build_filters(filters)) + + response = self.connection.request(self.path, params=params, method="GET").object + + product_types = self._to_product_types(response) + + return product_types + + def _to_instance_types(self, elem): + instance_types = [] + for instance_types_item in findall( + element=elem, xpath="instanceTypeSet/item", namespace=OUTSCALE_NAMESPACE + ): + name = findtext(element=instance_types_item, xpath="name", namespace=OUTSCALE_NAMESPACE) + vcpu = findtext(element=instance_types_item, xpath="vcpu", namespace=OUTSCALE_NAMESPACE) + memory = findtext( + element=instance_types_item, + xpath="memory", + namespace=OUTSCALE_NAMESPACE, + ) + storageSize = findtext( + element=instance_types_item, + xpath="storageSize", + namespace=OUTSCALE_NAMESPACE, + ) + storageCount = findtext( + element=instance_types_item, + xpath="storageCount", + namespace=OUTSCALE_NAMESPACE, + ) + maxIpAddresses = findtext( + element=instance_types_item, + xpath="maxIpAddresses", + namespace=OUTSCALE_NAMESPACE, + ) + ebsOptimizedAvailable = findtext( + element=instance_types_item, + xpath="ebsOptimizedAvailable", + namespace=OUTSCALE_NAMESPACE, + ) + d = { + "name": name, + "vcpu": vcpu, + "memory": memory, + "storageSize": storageSize, + "storageCount": storageCount, + "maxIpAddresses": maxIpAddresses, + "ebsOptimizedAvailable": ebsOptimizedAvailable, + } + instance_types.append(d) + + return instance_types + + def ex_describe_instance_types(self, filters=None): + """ + Describes instance types. + + :param filters: The filters so that the list returned includes + information for instance types only + :type filters: ``dict`` + + :return: A instance types list + :rtype: ``list`` + """ + + params = {"Action": "DescribeInstanceTypes"} + + if filters: + params.update(self._build_filters(filters)) + + response = self.connection.request(self.path, params=params, method="GET").object + + instance_types = self._to_instance_types(response) + + return instance_types + class OutscaleSASNodeDriver(OutscaleNodeDriver): """ Outscale SAS node driver """ - name = 'Outscale SAS' + + name = "Outscale SAS" type = Provider.OUTSCALE_SAS - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region='us-east-1', region_details=None, **kwargs): - super(OutscaleSASNodeDriver, self).__init__( - key=key, secret=secret, secure=secure, host=host, port=port, - region=region, region_details=OUTSCALE_SAS_REGION_DETAILS, - **kwargs) + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + region="us-east-1", + region_details=None, + **kwargs, + ): + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + region=region, + region_details=OUTSCALE_SAS_REGION_DETAILS, + **kwargs, + ) class OutscaleINCNodeDriver(OutscaleNodeDriver): """ Outscale INC node driver """ - name = 'Outscale INC' + + name = "Outscale INC" type = Provider.OUTSCALE_INC - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region='us-east-1', region_details=None, **kwargs): - super(OutscaleINCNodeDriver, self).__init__( - key=key, secret=secret, secure=secure, host=host, port=port, - region=region, region_details=OUTSCALE_INC_REGION_DETAILS, - **kwargs) + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + region="us-east-1", + region_details=None, + **kwargs, + ): + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + region=region, + region_details=OUTSCALE_INC_REGION_DETAILS, + **kwargs, + ) diff --git a/libcloud/compute/drivers/ecp.py b/libcloud/compute/drivers/ecp.py deleted file mode 100644 index 79b57fa5b2..0000000000 --- a/libcloud/compute/drivers/ecp.py +++ /dev/null @@ -1,385 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Enomaly ECP driver -""" -import time -import base64 -import os -import socket -import binascii - -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import b - -# JSON is included in the standard library starting with Python 2.6. For 2.5 -# and 2.4, there's a simplejson egg at: http://pypi.python.org/pypi/simplejson -try: - import simplejson as json -except ImportError: - import json - -from libcloud.common.base import Response, ConnectionUserAndKey -from libcloud.compute.base import NodeDriver, NodeSize, NodeLocation -from libcloud.compute.base import NodeImage, Node -from libcloud.compute.types import Provider, NodeState, InvalidCredsError -from libcloud.utils.networking import is_private_subnet - -# Defaults -API_HOST = '' -API_PORT = (80, 443) - - -class ECPResponse(Response): - def success(self): - if self.status == httplib.OK or self.status == httplib.CREATED: - try: - j_body = json.loads(self.body) - except ValueError: - self.error = "JSON response cannot be decoded." - return False - if j_body['errno'] == 0: - return True - else: - self.error = "ECP error: %s" % j_body['message'] - return False - elif self.status == httplib.UNAUTHORIZED: - raise InvalidCredsError() - else: - self.error = "HTTP Error Code: %s" % self.status - return False - - def parse_error(self): - return self.error - - # Interpret the json responses - no error checking required - def parse_body(self): - return json.loads(self.body) - - def getheaders(self): - return self.headers - - -class ECPConnection(ConnectionUserAndKey): - """ - Connection class for the Enomaly ECP driver - """ - - responseCls = ECPResponse - host = API_HOST - port = API_PORT - - def add_default_headers(self, headers): - # Authentication - username = self.user_id - password = self.key - base64string = base64.encodestring( - b('%s:%s' % (username, password)))[:-1] - authheader = "Basic %s" % base64string - headers['Authorization'] = authheader - - return headers - - def _encode_multipart_formdata(self, fields): - """ - Based on Wade Leftwich's function: - http://code.activestate.com/recipes/146306/ - """ - # use a random boundary that does not appear in the fields - boundary = '' - while boundary in ''.join(fields): - boundary = binascii.hexlify(os.urandom(16)).decode('utf-8') - L = [] - for i in fields: - L.append('--' + boundary) - L.append('Content-Disposition: form-data; name="%s"' % i) - L.append('') - L.append(fields[i]) - L.append('--' + boundary + '--') - L.append('') - body = '\r\n'.join(L) - content_type = 'multipart/form-data; boundary=%s' % boundary - header = {'Content-Type': content_type} - return header, body - - -class ECPNodeDriver(NodeDriver): - """ - Enomaly ECP node driver - """ - - name = "Enomaly Elastic Computing Platform" - website = 'http://www.enomaly.com/' - type = Provider.ECP - connectionCls = ECPConnection - - def list_nodes(self): - """ - Returns a list of all running Nodes - - :rtype: ``list`` of :class:`Node` - """ - - # Make the call - res = self.connection.request('/rest/hosting/vm/list').parse_body() - - # Put together a list of node objects - nodes = [] - for vm in res['vms']: - node = self._to_node(vm) - if node is not None: - nodes.append(node) - - # And return it - return nodes - - def _to_node(self, vm): - """ - Turns a (json) dictionary into a Node object. - This returns only running VMs. - """ - - # Check state - if not vm['state'] == "running": - return None - - # IPs - iplist = [interface['ip'] for interface in vm['interfaces'] if - interface['ip'] != '127.0.0.1'] - - public_ips = [] - private_ips = [] - for ip in iplist: - try: - socket.inet_aton(ip) - except socket.error: - # not a valid ip - continue - if is_private_subnet(ip): - private_ips.append(ip) - else: - public_ips.append(ip) - - # Create the node object - n = Node( - id=vm['uuid'], - name=vm['name'], - state=NodeState.RUNNING, - public_ips=public_ips, - private_ips=private_ips, - driver=self, - ) - - return n - - def reboot_node(self, node): - """ - Shuts down a VM and then starts it again. - - @inherits: :class:`NodeDriver.reboot_node` - """ - - # Turn the VM off - # Black magic to make the POST requests work - d = self.connection._encode_multipart_formdata({'action': 'stop'}) - self.connection.request( - '/rest/hosting/vm/%s' % node.id, - method='POST', - headers=d[0], - data=d[1] - ).parse_body() - - node.state = NodeState.REBOOTING - # Wait for it to turn off and then continue (to turn it on again) - while node.state == NodeState.REBOOTING: - # Check if it's off. - response = self.connection.request( - '/rest/hosting/vm/%s' % node.id - ).parse_body() - if response['vm']['state'] == 'off': - node.state = NodeState.TERMINATED - else: - time.sleep(5) - - # Turn the VM back on. - # Black magic to make the POST requests work - d = self.connection._encode_multipart_formdata({'action': 'start'}) - self.connection.request( - '/rest/hosting/vm/%s' % node.id, - method='POST', - headers=d[0], - data=d[1] - ).parse_body() - - node.state = NodeState.RUNNING - return True - - def destroy_node(self, node): - """ - Shuts down and deletes a VM. - - @inherits: :class:`NodeDriver.destroy_node` - """ - - # Shut down first - # Black magic to make the POST requests work - d = self.connection._encode_multipart_formdata({'action': 'stop'}) - self.connection.request( - '/rest/hosting/vm/%s' % node.id, - method='POST', - headers=d[0], - data=d[1] - ).parse_body() - - # Ensure there was no applicationl level error - node.state = NodeState.PENDING - # Wait for the VM to turn off before continuing - while node.state == NodeState.PENDING: - # Check if it's off. - response = self.connection.request( - '/rest/hosting/vm/%s' % node.id - ).parse_body() - if response['vm']['state'] == 'off': - node.state = NodeState.TERMINATED - else: - time.sleep(5) - - # Delete the VM - # Black magic to make the POST requests work - d = self.connection._encode_multipart_formdata({'action': 'delete'}) - self.connection.request( - '/rest/hosting/vm/%s' % (node.id), - method='POST', - headers=d[0], - data=d[1] - ).parse_body() - - return True - - def list_images(self, location=None): - """ - Returns a list of all package templates aka appiances aka images. - - @inherits: :class:`NodeDriver.list_images` - """ - - # Make the call - response = self.connection.request( - '/rest/hosting/ptemplate/list').parse_body() - - # Turn the response into an array of NodeImage objects - images = [] - for ptemplate in response['packages']: - images.append(NodeImage( - id=ptemplate['uuid'], - name='%s: %s' % (ptemplate['name'], ptemplate['description']), - driver=self,) - ) - - return images - - def list_sizes(self, location=None): - """ - Returns a list of all hardware templates - - @inherits: :class:`NodeDriver.list_sizes` - """ - - # Make the call - response = self.connection.request( - '/rest/hosting/htemplate/list').parse_body() - - # Turn the response into an array of NodeSize objects - sizes = [] - for htemplate in response['templates']: - sizes.append(NodeSize( - id=htemplate['uuid'], - name=htemplate['name'], - ram=htemplate['memory'], - disk=0, # Disk is independent of hardware template. - bandwidth=0, # There is no way to keep track of bandwidth. - price=0, # The billing system is external. - driver=self,) - ) - - return sizes - - def list_locations(self): - """ - This feature does not exist in ECP. Returns hard coded dummy location. - - :rtype: ``list`` of :class:`NodeLocation` - """ - return [NodeLocation(id=1, - name="Cloud", - country='', - driver=self), - ] - - def create_node(self, **kwargs): - """ - Creates a virtual machine. - - :keyword name: String with a name for this new node (required) - :type name: ``str`` - - :keyword size: The size of resources allocated to this node . - (required) - :type size: :class:`NodeSize` - - :keyword image: OS Image to boot on node. (required) - :type image: :class:`NodeImage` - - :rtype: :class:`Node` - """ - - # Find out what network to put the VM on. - res = self.connection.request( - '/rest/hosting/network/list').parse_body() - - # Use the first / default network because there is no way to specific - # which one - network = res['networks'][0]['uuid'] - - # Prepare to make the VM - data = { - 'name': str(kwargs['name']), - 'package': str(kwargs['image'].id), - 'hardware': str(kwargs['size'].id), - 'network_uuid': str(network), - 'disk': '' - } - - # Black magic to make the POST requests work - d = self.connection._encode_multipart_formdata(data) - response = self.connection.request( - '/rest/hosting/vm/', - method='PUT', - headers=d[0], - data=d[1] - ).parse_body() - - # Create a node object and return it. - n = Node( - id=response['machine_id'], - name=data['name'], - state=NodeState.PENDING, - public_ips=[], - private_ips=[], - driver=self, - ) - - return n diff --git a/libcloud/compute/drivers/ecs.py b/libcloud/compute/drivers/ecs.py new file mode 100644 index 0000000000..45f0501918 --- /dev/null +++ b/libcloud/compute/drivers/ecs.py @@ -0,0 +1,1594 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Node driver for Aliyun. +""" + +try: + import simplejson as json +except ImportError: + import json + +import time + +from libcloud.utils.py3 import _real_unicode as u +from libcloud.utils.xml import findall, findattr, findtext +from libcloud.common.types import LibcloudError +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, + VolumeSnapshot, +) +from libcloud.common.aliyun import AliyunXmlResponse, SignedAliyunConnection +from libcloud.compute.types import NodeState, StorageVolumeState, VolumeSnapshotState + +__all__ = [ + "DiskCategory", + "InternetChargeType", + "ECS_API_VERSION", + "ECSDriver", + "ECSSecurityGroup", + "ECSZone", +] + +ECS_API_VERSION = "2014-05-26" +ECS_API_ENDPOINT = "ecs.aliyuncs.com" +DEFAULT_SIGNATURE_VERSION = "1.0" + + +def _parse_bool(value): + if isinstance(value, bool): + return value + if u(value).lower() == "true": + return True + return False + + +""" +Define the extra dictionary for specific resources +""" +RESOURCE_EXTRA_ATTRIBUTES_MAP = { + "node": { + "description": {"xpath": "Description", "transform_func": u}, + "image_id": {"xpath": "ImageId", "transform_func": u}, + "zone_id": {"xpath": "ZoneId", "transform_func": u}, + "instance_type": {"xpath": "InstanceType", "transform_func": u}, + "instance_type_family": {"xpath": "InstanceTypeFamily", "transform_func": u}, + "hostname": {"xpath": "HostName", "transform_func": u}, + "serial_number": {"xpath": "SerialNumber", "transform_func": u}, + "internet_charge_type": {"xpath": "InternetChargeType", "transform_func": u}, + "creation_time": {"xpath": "CreationTime", "transform_func": u}, + "instance_network_type": {"xpath": "InstanceNetworkType", "transform_func": u}, + "instance_charge_type": {"xpath": "InstanceChargeType", "transform_func": u}, + "device_available": {"xpath": "DeviceAvailable", "transform_func": u}, + "io_optimized": {"xpath": "IoOptimized", "transform_func": u}, + "expired_time": {"xpath": "ExpiredTime", "transform_func": u}, + }, + "vpc_attributes": { + "vpc_id": {"xpath": "VpcId", "transform_func": u}, + "vswitch_id": {"xpath": "VSwitchId", "transform_func": u}, + "private_ip_address": { + "xpath": "PrivateIpAddress/IpAddress", + "transform_func": u, + }, + "nat_ip_address": {"xpath": "NatIpAddress", "transform_func": u}, + }, + "eip_address_associate": { + "allocation_id": {"xpath": "AllocationId", "transform_func": u}, + "ip_address": {"xpath": "IpAddress", "transform_func": u}, + "bandwidth": {"xpath": "Bandwidth", "transform_func": int}, + "internet_charge_type": {"xpath": "InternetChargeType", "transform_func": u}, + }, + "operation_locks": {"lock_reason": {"xpath": "LockReason", "transform_func": u}}, + "volume": { + "region_id": {"xpath": "RegionId", "transform_func": u}, + "zone_id": {"xpath": "ZoneId", "transform_func": u}, + "description": {"xpath": "Description", "transform_func": u}, + "type": {"xpath": "Type", "transform_func": u}, + "category": {"xpath": "Category", "transform_func": u}, + "image_id": {"xpath": "ImageId", "transform_func": u}, + "source_snapshot_id": {"xpath": "SourceSnapshotId", "transform_func": u}, + "product_code": {"xpath": "ProductCode", "transform_func": u}, + "portable": {"xpath": "Portable", "transform_func": _parse_bool}, + "instance_id": {"xpath": "InstanceId", "transform_func": u}, + "device": {"xpath": "Device", "transform_func": u}, + "delete_with_instance": { + "xpath": "DeleteWithInstance", + "transform_func": _parse_bool, + }, + "enable_auto_snapshot": { + "xpath": "EnableAutoSnapshot", + "transform_func": _parse_bool, + }, + "creation_time": {"xpath": "CreationTime", "transform_func": u}, + "attached_time": {"xpath": "AttachedTime", "transform_func": u}, + "detached_time": {"xpath": "DetachedTime", "transform_func": u}, + "disk_charge_type": {"xpath": "DiskChargeType", "transform_func": u}, + }, + "snapshot": { + "snapshot_name": {"xpath": "SnapshotName", "transform_func": u}, + "description": {"xpath": "Description", "transform_func": u}, + "progress": {"xpath": "Progress", "transform_func": u}, + "source_disk_id": {"xpath": "SourceDiskId", "transform_func": u}, + "source_disk_size": {"xpath": "SourceDiskSize", "transform_func": int}, + "source_disk_type": {"xpath": "SourceDiskType", "transform_func": u}, + "product_code": {"xpath": "ProductCode", "transform_func": u}, + "usage": {"xpath": "Usage", "transform_func": u}, + }, + "image": { + "image_version": {"xpath": "ImageVersion", "transform_func": u}, + "os_type": {"xpath": "OSType", "transform_func": u}, + "platform": {"xpath": "Platform", "transform_func": u}, + "architecture": {"xpath": "Architecture", "transform_func": u}, + "description": {"xpath": "Description", "transform_func": u}, + "size": {"xpath": "Size", "transform_func": int}, + "image_owner_alias": {"xpath": "ImageOwnerAlias", "transform_func": u}, + "os_name": {"xpath": "OSName", "transform_func": u}, + "product_code": {"xpath": "ProductCode", "transform_func": u}, + "is_subscribed": {"xpath": "IsSubscribed", "transform_func": _parse_bool}, + "progress": {"xpath": "Progress", "transform_func": u}, + "creation_time": {"xpath": "CreationTime", "transform_func": u}, + "usage": {"xpath": "Usage", "transform_func": u}, + "is_copied": {"xpath": "IsCopied", "transform_func": _parse_bool}, + }, + "disk_device_mapping": { + "snapshot_id": {"xpath": "SnapshotId", "transform_func": u}, + "size": {"xpath": "Size", "transform_func": int}, + "device": {"xpath": "Device", "transform_func": u}, + "format": {"xpath": "Format", "transform_func": u}, + "import_oss_bucket": {"xpath": "ImportOSSBucket", "transform_func": u}, + "import_oss_object": {"xpath": "ImportOSSObject", "transform_func": u}, + }, +} + + +class ECSConnection(SignedAliyunConnection): + """ + Represents a single connection to the Aliyun ECS Endpoint. + """ + + api_version = ECS_API_VERSION + host = ECS_API_ENDPOINT + responseCls = AliyunXmlResponse + service_name = "ecs" + + +class ECSSecurityGroup: + """ + Security group used to control nodes internet and intranet accessibility. + """ + + def __init__(self, id, name, description=None, driver=None, vpc_id=None, creation_time=None): + self.id = id + self.name = name + self.description = description + self.driver = driver + self.vpc_id = vpc_id + self.creation_time = creation_time + + def __repr__(self): + return "".format( + self.id, + self.name, + self.driver.name, + ) + + +class ECSSecurityGroupAttribute: + """ + Security group attribute. + """ + + def __init__( + self, + ip_protocol=None, + port_range=None, + source_group_id=None, + policy=None, + nic_type=None, + ): + self.ip_protocol = ip_protocol + self.port_range = port_range + self.source_group_id = source_group_id + self.policy = policy + self.nic_type = nic_type + + def __repr__(self): + return "" % (self.ip_protocol) + + +class ECSZone: + """ + ECSZone used to represent an availability zone in a region. + """ + + def __init__( + self, + id, + name, + driver=None, + available_resource_types=None, + available_instance_types=None, + available_disk_categories=None, + ): + self.id = id + self.name = name + self.driver = driver + self.available_resource_types = available_resource_types + self.available_instance_types = available_instance_types + self.available_disk_categories = available_disk_categories + + def __repr__(self): + return "".format( + self.id, + self.name, + self.driver, + ) + + +class InternetChargeType: + """ + Internet connection billing types for Aliyun Nodes. + """ + + BY_BANDWIDTH = "PayByBandwidth" + BY_TRAFFIC = "PayByTraffic" + + +class DiskCategory: + """ + Enum defined disk types supported by Aliyun system and data disks. + """ + + CLOUD = "cloud" + CLOUD_EFFICIENCY = "cloud_efficiency" + CLOUD_SSD = "cloud_ssd" + EPHEMERAL_SSD = "ephemeral_ssd" + + +class Pagination: + """ + Pagination used to describe the multiple pages results. + """ + + def __init__(self, total, size, current): + """ + Create a pagination. + + :param total: the total count of the results + :param size: the page size of each page + :param current: the current page number, 1-based + """ + self.total = total + self.size = size + self.current = current + + def next(self): + """ + Switch to the next page. + :return: the new pagination or None when no more page + :rtype: ``Pagination`` + """ + if self.total is None or (self.size * self.current >= self.total): + return None + self.current += 1 + return self + + def to_dict(self): + return {"PageNumber": self.current, "PageSize": self.size} + + def __repr__(self): + return "" % ( + self.total, + self.size, + self.current, + ) + + +class ECSDriver(NodeDriver): + """ + Aliyun ECS node driver. + + Used for Aliyun ECS service. + + TODO: + Get guest OS root password + Adjust internet bandwidth settings + Manage security groups and rules + """ + + name = "Aliyun ECS" + website = "https://www.aliyun.com/product/ecs" + connectionCls = ECSConnection + features = {"create_node": ["password"]} + namespace = None + path = "/" + + internet_charge_types = InternetChargeType + disk_categories = DiskCategory + + NODE_STATE_MAPPING = { + "Starting": NodeState.PENDING, + "Running": NodeState.RUNNING, + "Stopping": NodeState.PENDING, + "Stopped": NodeState.STOPPED, + } + + VOLUME_STATE_MAPPING = { + "In_use": StorageVolumeState.INUSE, + "Available": StorageVolumeState.AVAILABLE, + "Attaching": StorageVolumeState.ATTACHING, + "Detaching": StorageVolumeState.INUSE, + "Creating": StorageVolumeState.CREATING, + "ReIniting": StorageVolumeState.CREATING, + } + + SNAPSHOT_STATE_MAPPING = { + "progressing": VolumeSnapshotState.CREATING, + "accomplished": VolumeSnapshotState.AVAILABLE, + "failed": VolumeSnapshotState.ERROR, + } + + def list_nodes(self, ex_node_ids=None, ex_filters=None): + """ + List all nodes. + + @inherits: :class:`NodeDriver.create_node` + + :keyword ex_node_ids: a list of node's ids used to filter nodes. + Only the nodes which's id in this list + will be returned. + :type ex_node_ids: ``list`` of ``str`` + :keyword ex_filters: node attribute and value pairs to filter nodes. + Only the nodes which matches all the pairs will + be returned. + If the filter attribute need a json array value, + use ``list`` object, the driver will convert it. + :type ex_filters: ``dict`` + """ + + params = {"Action": "DescribeInstances", "RegionId": self.region} + + if ex_node_ids: + if isinstance(ex_node_ids, list): + params["InstanceIds"] = self._list_to_json_array(ex_node_ids) + else: + raise AttributeError("ex_node_ids should be a list of " "node ids.") + + if ex_filters: + if isinstance(ex_filters, dict): + params.update(ex_filters) + else: + raise AttributeError("ex_filters should be a dict of " "node attributes.") + + nodes = self._request_multiple_pages(self.path, params, self._to_nodes) + return nodes + + def list_sizes(self, location=None): + params = {"Action": "DescribeInstanceTypes"} + + resp_body = self.connection.request(self.path, params).object + size_elements = findall(resp_body, "InstanceTypes/InstanceType", namespace=self.namespace) + sizes = [self._to_size(each) for each in size_elements] + return sizes + + def list_locations(self): + params = {"Action": "DescribeRegions"} + + resp_body = self.connection.request(self.path, params).object + location_elements = findall(resp_body, "Regions/Region", namespace=self.namespace) + locations = [self._to_location(each) for each in location_elements] + return locations + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_security_group_id=None, + ex_description=None, + ex_internet_charge_type=None, + ex_internet_max_bandwidth_out=None, + ex_internet_max_bandwidth_in=None, + ex_hostname=None, + ex_io_optimized=None, + ex_system_disk=None, + ex_data_disks=None, + ex_vswitch_id=None, + ex_private_ip_address=None, + ex_client_token=None, + **kwargs, + ): + """ + @inherits: :class:`NodeDriver.create_node` + + :param name: The name for this new node (required) + :type name: ``str`` + + :param image: The image to use when creating this node (required) + :type image: `NodeImage` + + :param size: The size of the node to create (required) + :type size: `NodeSize` + + :keyword auth: Initial authentication information for the node + (optional) + :type auth: :class:`NodeAuthSSHKey` or :class:`NodeAuthPassword` + + :keyword ex_security_group_id: The id of the security group the + new created node is attached to. + (required) + :type ex_security_group_id: ``str`` + + :keyword ex_description: A description string for this node (optional) + :type ex_description: ``str`` + + :keyword ex_internet_charge_type: The internet charge type (optional) + :type ex_internet_charge_type: a ``str`` of 'PayByTraffic' + or 'PayByBandwidth' + + :keyword ex_internet_max_bandwidth_out: The max output bandwidth, + in Mbps (optional) + Required for 'PayByTraffic' + internet charge type + :type ex_internet_max_bandwidth_out: a ``int`` in range [0, 100] + a ``int`` in range [1, 100] for + 'PayByTraffic' internet charge + type + + :keyword ex_internet_max_bandwidth_in: The max input bandwidth, + in Mbps (optional) + :type ex_internet_max_bandwidth_in: a ``int`` in range [1, 200] + default to 200 in server side + + :keyword ex_hostname: The hostname for the node (optional) + :type ex_hostname: ``str`` + + :keyword ex_io_optimized: Whether the node is IO optimized (optional) + :type ex_io_optimized: ``boll`` + + :keyword ex_system_disk: The system disk for the node (optional) + :type ex_system_disk: ``dict`` + + :keyword ex_data_disks: The data disks for the node (optional) + :type ex_data_disks: a `list` of `dict` + + :keyword ex_vswitch_id: The id of vswitch for a VPC type node + (optional) + :type ex_vswitch_id: ``str`` + + :keyword ex_private_ip_address: The IP address in private network + (optional) + :type ex_private_ip_address: ``str`` + + :keyword ex_client_token: A token generated by client to keep + requests idempotency (optional) + :type keyword ex_client_token: ``str`` + """ + + params = { + "Action": "CreateInstance", + "RegionId": self.region, + "ImageId": image.id, + "InstanceType": size.id, + "InstanceName": name, + } + + if not ex_security_group_id: + raise AttributeError("ex_security_group_id is mandatory") + params["SecurityGroupId"] = ex_security_group_id + + if ex_description: + params["Description"] = ex_description + + inet_params = self._get_internet_related_params( + ex_internet_charge_type, + ex_internet_max_bandwidth_in, + ex_internet_max_bandwidth_out, + ) + if inet_params: + params.update(inet_params) + + if ex_hostname: + params["HostName"] = ex_hostname + + if auth: + auth = self._get_and_check_auth(auth) + params["Password"] = auth.password + + if ex_io_optimized is not None: + optimized = ex_io_optimized + if isinstance(optimized, bool): + optimized = "optimized" if optimized else "none" + params["IoOptimized"] = optimized + + if ex_system_disk: + system_disk = self._get_system_disk(ex_system_disk) + if system_disk: + params.update(system_disk) + + if ex_data_disks: + data_disks = self._get_data_disks(ex_data_disks) + if data_disks: + params.update(data_disks) + + if ex_vswitch_id: + params["VSwitchId"] = ex_vswitch_id + + if ex_private_ip_address: + if not ex_vswitch_id: + raise AttributeError( + "must provide ex_private_ip_address " "and ex_vswitch_id at the same time" + ) + else: + params["PrivateIpAddress"] = ex_private_ip_address + + if ex_client_token: + params["ClientToken"] = ex_client_token + + resp = self.connection.request(self.path, params=params) + node_id = findtext(resp.object, xpath="InstanceId", namespace=self.namespace) + nodes = self.list_nodes(ex_node_ids=[node_id]) + if len(nodes) != 1: + raise LibcloudError( + "could not find the new created node " "with id %s. " % node_id, + driver=self, + ) + node = nodes[0] + self.ex_start_node(node) + self._wait_until_state(nodes, NodeState.RUNNING) + return node + + def reboot_node(self, node, ex_force_stop=False): + """ + Reboot the given node + + @inherits :class:`NodeDriver.reboot_node` + + :keyword ex_force_stop: if ``True``, stop node force (maybe lose data) + otherwise, stop node normally, + default to ``False`` + :type ex_force_stop: ``bool`` + """ + params = { + "Action": "RebootInstance", + "InstanceId": node.id, + "ForceStop": u(ex_force_stop).lower(), + } + resp = self.connection.request(self.path, params=params) + return resp.success() and self._wait_until_state([node], NodeState.RUNNING) + + def destroy_node(self, node): + nodes = self.list_nodes(ex_node_ids=[node.id]) + if len(nodes) != 1 and node.id != nodes[0].id: + raise LibcloudError("could not find the node with id %s." % node.id) + current = nodes[0] + if current.state == NodeState.RUNNING: + # stop node first + self.ex_stop_node(node) + self._wait_until_state(nodes, NodeState.STOPPED) + params = {"Action": "DeleteInstance", "InstanceId": node.id} + resp = self.connection.request(self.path, params) + return resp.success() + + def start_node(self, node): + """ + Start node to running state. + + :param node: the ``Node`` object to start + :type node: ``Node`` + + :return: starting operation result. + :rtype: ``bool`` + """ + params = {"Action": "StartInstance", "InstanceId": node.id} + resp = self.connection.request(self.path, params) + return resp.success() and self._wait_until_state([node], NodeState.RUNNING) + + def stop_node(self, node, ex_force_stop=False): + """ + Stop a running node. + + :param node: The node to stop + :type node: :class:`Node` + + :keyword ex_force_stop: if ``True``, stop node force (maybe lose data) + otherwise, stop node normally, + default to ``False`` + :type ex_force_stop: ``bool`` + + :return: stopping operation result. + :rtype: ``bool`` + """ + params = { + "Action": "StopInstance", + "InstanceId": node.id, + "ForceStop": u(ex_force_stop).lower(), + } + resp = self.connection.request(self.path, params) + return resp.success() and self._wait_until_state([node], NodeState.STOPPED) + + def ex_start_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.start_node(node=node) + + def ex_stop_node(self, node, ex_force_stop=False): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.stop_node(node=node, ex_force_stop=ex_force_stop) + + def ex_create_security_group(self, description=None, client_token=None): + """ + Create a new security group. + + :keyword description: security group description + :type description: ``unicode`` + + :keyword client_token: a token generated by client to identify + each request. + :type client_token: ``str`` + """ + params = {"Action": "CreateSecurityGroup", "RegionId": self.region} + + if description: + params["Description"] = description + if client_token: + params["ClientToken"] = client_token + resp = self.connection.request(self.path, params) + return findtext(resp.object, "SecurityGroupId", namespace=self.namespace) + + def ex_delete_security_group_by_id(self, group_id=None): + """ + Delete a new security group. + + :keyword group_id: security group id + :type group_id: ``str`` + """ + params = { + "Action": "DeleteSecurityGroup", + "RegionId": self.region, + "SecurityGroupId": group_id, + } + resp = self.connection.request(self.path, params) + return resp.success() + + def ex_modify_security_group_by_id(self, group_id=None, name=None, description=None): + """ + Modify a new security group. + :keyword group_id: id of the security group + :type group_id: ``str`` + :keyword name: new name of the security group + :type name: ``unicode`` + :keyword description: new description of the security group + :type description: ``unicode`` + """ + + params = {"Action": "ModifySecurityGroupAttribute", "RegionId": self.region} + if not group_id: + raise AttributeError("group_id is required") + params["SecurityGroupId"] = group_id + + if name: + params["SecurityGroupName"] = name + if description: + params["Description"] = description + + resp = self.connection.request(self.path, params) + return resp.success() + + def ex_list_security_groups(self, ex_filters=None): + """ + List security groups in the current region. + + :keyword ex_filters: security group attributes to filter results. + :type ex_filters: ``dict`` + + :return: a list of defined security groups + :rtype: ``list`` of ``ECSSecurityGroup`` + """ + params = {"Action": "DescribeSecurityGroups", "RegionId": self.region} + + if ex_filters and isinstance(ex_filters, dict): + ex_filters.update(params) + params = ex_filters + + def _parse_response(resp_object): + sg_elements = findall( + resp_object, "SecurityGroups/SecurityGroup", namespace=self.namespace + ) + sgs = [self._to_security_group(el) for el in sg_elements] + return sgs + + return self._request_multiple_pages(self.path, params, _parse_response) + + def ex_list_security_group_attributes(self, group_id=None, nic_type="internet"): + """ + List security group attributes in the current region. + + :keyword group_id: security group id. + :type group_id: ``str`` + + :keyword nic_type: internet|intranet. + :type nic_type: ``str`` + + :return: a list of defined security group Attributes + :rtype: ``list`` of ``ECSSecurityGroupAttribute`` + """ + params = { + "Action": "DescribeSecurityGroupAttribute", + "RegionId": self.region, + "NicType": nic_type, + } + + if group_id is None: + raise AttributeError("group_id is required") + params["SecurityGroupId"] = group_id + + resp_object = self.connection.request(self.path, params).object + sga_elements = findall(resp_object, "Permissions/Permission", namespace=self.namespace) + return [self._to_security_group_attribute(el) for el in sga_elements] + + def ex_join_security_group(self, node, group_id=None): + """ + Join a node into security group. + + :param node: The node to join security group + :type node: :class:`Node` + + :param group_id: security group id. + :type group_id: ``str`` + + + :return: join operation result. + :rtype: ``bool`` + """ + if group_id is None: + raise AttributeError("group_id is required") + + if node.state != NodeState.RUNNING and node.state != NodeState.STOPPED: + raise LibcloudError("The node state with id % s need\ + be running or stopped ." % node.id) + + params = { + "Action": "JoinSecurityGroup", + "InstanceId": node.id, + "SecurityGroupId": group_id, + } + resp = self.connection.request(self.path, params) + return resp.success() + + def ex_leave_security_group(self, node, group_id=None): + """ + Leave a node from security group. + + :param node: The node to leave security group + :type node: :class:`Node` + + :param group_id: security group id. + :type group_id: ``str`` + + + :return: leave operation result. + :rtype: ``bool`` + """ + if group_id is None: + raise AttributeError("group_id is required") + + if node.state != NodeState.RUNNING and node.state != NodeState.STOPPED: + raise LibcloudError("The node state with id % s need\ + be running or stopped ." % node.id) + + params = { + "Action": "LeaveSecurityGroup", + "InstanceId": node.id, + "SecurityGroupId": group_id, + } + resp = self.connection.request(self.path, params) + return resp.success() + + def ex_list_zones(self, region_id=None): + """ + List availability zones in the given region or the current region. + + :keyword region_id: the id of the region to query zones from + :type region_id: ``str`` + + :return: list of zones + :rtype: ``list`` of ``ECSZone`` + """ + params = {"Action": "DescribeZones"} + if region_id: + params["RegionId"] = region_id + else: + params["RegionId"] = self.region + resp_body = self.connection.request(self.path, params).object + zone_elements = findall(resp_body, "Zones/Zone", namespace=self.namespace) + zones = [self._to_zone(el) for el in zone_elements] + return zones + + ## + # Volume and snapshot management methods + ## + + def list_volumes(self, ex_volume_ids=None, ex_filters=None): + """ + List all volumes. + + @inherits: :class:`NodeDriver.list_volumes` + + :keyword ex_volume_ids: a list of volume's ids used to filter volumes. + Only the volumes which's id in this list + will be returned. + :type ex_volume_ids: ``list`` of ``str`` + + :keyword ex_filters: volume attribute and value pairs to filter + volumes. Only the volumes which matches all will + be returned. + If the filter attribute need a json array value, + use ``list`` object, the driver will convert it. + :type ex_filters: ``dict`` + """ + params = {"Action": "DescribeDisks", "RegionId": self.region} + + if ex_volume_ids: + if isinstance(ex_volume_ids, list): + params["DiskIds"] = self._list_to_json_array(ex_volume_ids) + else: + raise AttributeError("ex_volume_ids should be a list of " "volume ids.") + + if ex_filters: + if not isinstance(ex_filters, dict): + raise AttributeError("ex_filters should be a dict of " "volume attributes.") + else: + for key in ex_filters.keys(): + params[key] = ex_filters[key] + + def _parse_response(resp_object): + disk_elements = findall(resp_object, "Disks/Disk", namespace=self.namespace) + volumes = [self._to_volume(each) for each in disk_elements] + return volumes + + return self._request_multiple_pages(self.path, params, _parse_response) + + def list_volume_snapshots(self, volume, ex_snapshot_ids=[], ex_filters=None): + """ + List snapshots for a storage volume. + + @inherites :class:`NodeDriver.list_volume_snapshots` + + :keyword ex_snapshot_ids: a list of snapshot ids to filter the + snapshots returned. + :type ex_snapshot_ids: ``list`` of ``str`` + + :keyword ex_filters: snapshot attribute and value pairs to filter + snapshots. Only the snapshot which matches all + the pairs will be returned. + If the filter attribute need a json array value, + use ``list`` object, the driver will convert it. + :type ex_filters: ``dict`` + """ + params = {"Action": "DescribeSnapshots", "RegionId": self.region} + + if volume: + params["DiskId"] = volume.id + if ex_snapshot_ids and isinstance(ex_snapshot_ids, list): + params["SnapshotIds"] = self._list_to_json_array(ex_snapshot_ids) + if ex_filters and isinstance(ex_filters, dict): + for key in ex_filters.keys(): + params[key] = ex_filters[key] + + def _parse_response(resp_body): + snapshot_elements = findall(resp_body, "Snapshots/Snapshot", namespace=self.namespace) + snapshots = [self._to_snapshot(each) for each in snapshot_elements] + return snapshots + + return self._request_multiple_pages(self.path, params, _parse_response) + + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + ex_zone_id=None, + ex_description=None, + ex_disk_category=None, + ex_client_token=None, + ): + """ + Create a new volume. + + @inherites :class:`NodeDriver.create_volume` + + :keyword ex_zone_id: the availability zone id (required) + :type ex_zone_id: ``str`` + + :keyword ex_description: volume description + :type ex_description: ``unicode`` + + :keyword ex_disk_category: disk category for data disk + :type ex_disk_category: ``str`` + + :keyword ex_client_token: a token generated by client to identify + each request. + :type ex_client_token: ``str`` + """ + params = { + "Action": "CreateDisk", + "RegionId": self.region, + "DiskName": name, + "Size": size, + } + if ex_zone_id is None: + raise AttributeError("ex_zone_id is required") + params["ZoneId"] = ex_zone_id + + if snapshot is not None and isinstance(snapshot, VolumeSnapshot): + params["SnapshotId"] = snapshot.id + if ex_description: + params["Description"] = ex_description + if ex_disk_category: + params["DiskCategory"] = ex_disk_category + if ex_client_token: + params["ClientToken"] = ex_client_token + resp = self.connection.request(self.path, params).object + volume_id = findtext(resp, "DiskId", namespace=self.namespace) + volumes = self.list_volumes(ex_volume_ids=[volume_id]) + if len(volumes) != 1: + raise LibcloudError( + "could not find the new create volume " "with id %s." % volume_id, + driver=self, + ) + return volumes[0] + + def create_volume_snapshot(self, volume, name=None, ex_description=None, ex_client_token=None): + """ + Creates a snapshot of the storage volume. + + @inherits :class:`NodeDriver.create_volume_snapshot` + + :keyword ex_description: description of the snapshot. + :type ex_description: ``unicode`` + + :keyword ex_client_token: a token generated by client to identify + each request. + :type ex_client_token: ``str`` + """ + params = {"Action": "CreateSnapshot", "DiskId": volume.id} + if name: + params["SnapshotName"] = name + if ex_description: + params["Description"] = ex_description + if ex_client_token: + params["ClientToken"] = ex_client_token + + snapshot_elements = self.connection.request(self.path, params).object + snapshot_id = findtext(snapshot_elements, "SnapshotId", namespace=self.namespace) + snapshots = self.list_volume_snapshots(volume=None, ex_snapshot_ids=[snapshot_id]) + if len(snapshots) != 1: + raise LibcloudError( + "could not find new created snapshot with " "id %s." % snapshot_id, + driver=self, + ) + return snapshots[0] + + def attach_volume(self, node, volume, device=None, ex_delete_with_instance=None): + """ + Attaches volume to node. + + @inherits :class:`NodeDriver.attach_volume` + + :keyword device: device path allocated for this attached volume + :type device: ``str`` between /dev/xvdb to xvdz, + if empty, allocated by the system + :keyword ex_delete_with_instance: if to delete this volume when the + instance is deleted. + :type ex_delete_with_instance: ``bool`` + """ + params = {"Action": "AttachDisk", "InstanceId": node.id, "DiskId": volume.id} + + if device: + params["Device"] = device + if ex_delete_with_instance: + params["DeleteWithInstance"] = str(bool(ex_delete_with_instance)).lower() + resp = self.connection.request(self.path, params) + return resp.success() + + def detach_volume(self, volume, ex_instance_id=None): + """ + Detaches a volume from a node. + + @inherits :class:`NodeDriver.detach_volume` + + :keyword ex_instance_id: the id of the instance from which the volume + is detached. + :type ex_instance_id: ``str`` + """ + params = {"Action": "DetachDisk", "DiskId": volume.id} + + if ex_instance_id: + params["InstanceId"] = ex_instance_id + else: + volumes = self.list_volumes(ex_volume_ids=[volume.id]) + if len(volumes) != 1: + raise AttributeError( + "could not find the instance id " + "the volume %s attached to, " + "ex_instance_id is required." % volume.id + ) + params["InstanceId"] = volumes[0].extra["instance_id"] + + resp = self.connection.request(self.path, params) + return resp.success() + + def destroy_volume(self, volume): + params = {"Action": "DeleteDisk", "DiskId": volume.id} + volumes = self.list_volumes(ex_volume_ids=[volume.id]) + if len(volumes) != 1: + raise LibcloudError("could not find the volume with id %s." % volume.id, driver=self) + if volumes[0].state != StorageVolumeState.AVAILABLE: + raise LibcloudError( + "only volume in AVAILABLE state could be " "destroyed.", driver=self + ) + resp = self.connection.request(self.path, params) + return resp.success() + + def destroy_volume_snapshot(self, snapshot): + params = {"Action": "DeleteSnapshot"} + + if snapshot and isinstance(snapshot, VolumeSnapshot): + params["SnapshotId"] = snapshot.id + else: + raise AttributeError("snapshot is required and must be a " "VolumeSnapshot") + resp = self.connection.request(self.path, params) + return resp.success() + + ## + # Image management methods + ## + + def list_images(self, location=None, ex_image_ids=None, ex_filters=None): + """ + List images on a provider. + + @inherits :class:`NodeDriver.list_images` + + :keyword ex_image_ids: a list of image ids to filter the images to + be returned. + :type ex_image_ids: ``list`` of ``str`` + + :keyword ex_filters: image attribute and value pairs to filter + images. Only the image which matches all + the pairs will be returned. + If the filter attribute need a json array value, + use ``list`` object, the driver will convert it. + :type ex_filters: ``dict`` + """ + + if location and isinstance(location, NodeLocation): + region = location.id + else: + region = self.region + params = {"Action": "DescribeImages", "RegionId": region} + if ex_image_ids: + if isinstance(ex_image_ids, list): + params["ImageId"] = ",".join(ex_image_ids) + else: + raise AttributeError("ex_image_ids should be a list of " "image ids") + if ex_filters and isinstance(ex_filters, dict): + for key in ex_filters.keys(): + params[key] = ex_filters[key] + + def _parse_response(resp_body): + image_elements = findall(resp_body, "Images/Image", namespace=self.namespace) + images = [self._to_image(each) for each in image_elements] + return images + + return self._request_multiple_pages(self.path, params, _parse_response) + + def create_image( + self, + node, + name, + description=None, + ex_snapshot_id=None, + ex_image_version=None, + ex_client_token=None, + ): + """ + Creates an image from a system disk snapshot. + + @inherits :class:`NodeDriver.create_image` + + :keyword ex_snapshot_id: the id of the snapshot to create the image. + (required) + :type ex_snapshot_id: ``str`` + + :keyword ex_image_version: the version number of the image + :type ex_image_version: ``str`` + + :keyword ex_client_token: a token generated by client to identify + each request. + :type ex_client_token: ``str`` + """ + params = {"Action": "CreateImage", "RegionId": self.region} + if name: + params["ImageName"] = name + if description: + params["Description"] = description + if ex_snapshot_id: + params["SnapshotId"] = ex_snapshot_id + else: + raise AttributeError("ex_snapshot_id is required") + if ex_image_version: + params["ImageVersion"] = ex_image_version + if ex_client_token: + params["ClientToken"] = ex_client_token + + resp = self.connection.request(self.path, params) + image_id = findtext(resp.object, "ImageId", namespace=self.namespace) + return self.get_image(image_id=image_id) + + def delete_image(self, node_image): + params = { + "Action": "DeleteImage", + "RegionId": self.region, + "ImageId": node_image.id, + } + resp = self.connection.request(self.path, params) + return resp.success() + + def get_image(self, image_id, ex_region_id=None): + if ex_region_id: + region = ex_region_id + else: + region = self.region + location = NodeLocation(id=region, name=None, country=None, driver=self) + images = self.list_images(location, ex_image_ids=[image_id]) + if len(images) != 1: + raise LibcloudError("could not find the image with id %s" % image_id, driver=self) + return images[0] + + def copy_image( + self, + source_region, + node_image, + name, + description=None, + ex_destination_region_id=None, + ex_client_token=None, + ): + """ + Copies an image from a source region to the destination region. + If not provide a destination region, default to the current region. + + @inherits :class:`NodeDriver.copy_image` + + :keyword ex_destination_region_id: id of the destination region + :type ex_destination_region_id: ``str`` + + :keyword ex_client_token: a token generated by client to identify + each request. + :type ex_client_token: ``str`` + """ + params = { + "Action": "CopyImage", + "RegionId": source_region, + "ImageId": node_image.id, + } + if ex_destination_region_id is not None: + params["DestinationRegionId"] = ex_destination_region_id + else: + params["DestinationRegionId"] = self.region + if name: + params["DestinationImageName"] = name + if description: + params["DestinationDescription"] = description + if ex_client_token: + params["ClientToken"] = ex_client_token + resp = self.connection.request(self.path, params) + image_id = findtext(resp.object, "ImageId", namespace=self.namespace) + return self.get_image(image_id=image_id) + + def create_public_ip(self, instance_id): + """ + Create public ip. + + :keyword instance_id: instance id for allocating public ip. + :type instance_id: ``str`` + + :return public ip + :rtype ``str`` + """ + params = {"Action": "AllocatePublicIpAddress", "InstanceId": instance_id} + + resp = self.connection.request(self.path, params=params) + return findtext(resp.object, "IpAddress", namespace=self.namespace) + + def _to_nodes(self, object): + """ + Convert response to Node object list + + :param object: parsed response object + :return: a list of ``Node`` + :rtype: ``list`` + """ + node_elements = findall(object, "Instances/Instance", self.namespace) + return [self._to_node(el) for el in node_elements] + + def _to_node(self, instance): + """ + Convert an InstanceAttributesType object to ``Node`` object + + :param instance: a xml element represents an instance + :return: a ``Node`` object + :rtype: ``Node`` + """ + _id = findtext(element=instance, xpath="InstanceId", namespace=self.namespace) + name = findtext(element=instance, xpath="InstanceName", namespace=self.namespace) + instance_status = findtext(element=instance, xpath="Status", namespace=self.namespace) + state = self.NODE_STATE_MAPPING.get(instance_status, NodeState.UNKNOWN) + + def _get_ips(ip_address_els): + return [each.text for each in ip_address_els if each.text] + + public_ips = [] + for xpath in ("PublicIpAddress/IpAddress", "EipAddress/IpAddress"): + public_ip_els = findall( + element=instance, + xpath=xpath, + namespace=self.namespace, + ) + public_ips.extend(_get_ips(public_ip_els)) + + private_ips = [] + for xpath in ("InnerIpAddress/IpAddress", "VpcAttributes/PrivateIpAddress/IpAddress"): + private_ip_els = findall(element=instance, xpath=xpath, namespace=self.namespace) + private_ips.extend(_get_ips(private_ip_els)) + + # Extra properties + extra = self._get_extra_dict(instance, RESOURCE_EXTRA_ATTRIBUTES_MAP["node"]) + extra["vpc_attributes"] = self._get_vpc_attributes(instance) + extra["eip_address"] = self._get_eip_address(instance) + extra["operation_locks"] = self._get_operation_locks(instance) + + node = Node( + id=_id, + name=name, + state=state, + public_ips=public_ips, + private_ips=private_ips, + driver=self.connection.driver, + extra=extra, + ) + return node + + def _get_extra_dict(self, element, mapping): + """ + Extract attributes from the element based on rules provided in the + mapping dictionary. + + :param element: Element to parse the values from. + :type element: xml.etree.ElementTree.Element. + + :param mapping: Dictionary with the extra layout + :type node: :class:`Node` + + :rtype: ``dict`` + """ + extra = {} + for attribute, values in mapping.items(): + transform_func = values["transform_func"] + value = findattr(element=element, xpath=values["xpath"], namespace=self.namespace) + if value: + try: + extra[attribute] = transform_func(value) + except Exception: + extra[attribute] = None + else: + extra[attribute] = value + + return extra + + def _get_internet_related_params( + self, + ex_internet_charge_type, + ex_internet_max_bandwidth_in, + ex_internet_max_bandwidth_out, + ): + params = {} + if ex_internet_charge_type: + params["InternetChargeType"] = ex_internet_charge_type + if ex_internet_charge_type.lower() == "paybytraffic": + if ex_internet_max_bandwidth_out: + params["InternetMaxBandwidthOut"] = ex_internet_max_bandwidth_out + else: + raise AttributeError( + "ex_internet_max_bandwidth_out is " + "mandatory for PayByTraffic internet" + " charge type." + ) + elif ex_internet_max_bandwidth_out: + params["InternetMaxBandwidthOut"] = ex_internet_max_bandwidth_out + + if ex_internet_max_bandwidth_in: + params["InternetMaxBandwidthIn"] = ex_internet_max_bandwidth_in + return params + + def _get_system_disk(self, ex_system_disk): + if not isinstance(ex_system_disk, dict): + raise AttributeError("ex_system_disk is not a dict") + sys_disk_dict = ex_system_disk + key_base = "SystemDisk." + # TODO(samsong8610): Use a type instead of dict + mappings = { + "category": "Category", + "disk_name": "DiskName", + "description": "Description", + } + params = {} + for attr in mappings.keys(): + if attr in sys_disk_dict: + params[key_base + mappings[attr]] = sys_disk_dict[attr] + return params + + def _get_data_disks(self, ex_data_disks): + if isinstance(ex_data_disks, dict): + data_disks = [ex_data_disks] + elif isinstance(ex_data_disks, list): + data_disks = ex_data_disks + else: + raise AttributeError("ex_data_disks should be a list of dict") + # TODO(samsong8610): Use a type instead of dict + mappings = { + "size": "Size", + "category": "Category", + "snapshot_id": "SnapshotId", + "disk_name": "DiskName", + "description": "Description", + "device": "Device", + "delete_with_instance": "DeleteWithInstance", + } + params = {} + for idx, disk in enumerate(data_disks): + key_base = "DataDisk.{}.".format(idx + 1) + for attr in mappings.keys(): + if attr in disk: + if attr == "delete_with_instance": + # Convert bool value to str + value = str(disk[attr]).lower() + else: + value = disk[attr] + params[key_base + mappings[attr]] = value + return params + + def _get_vpc_attributes(self, instance): + vpcs = findall(instance, xpath="VpcAttributes", namespace=self.namespace) + if len(vpcs) <= 0: + return None + return self._get_extra_dict(vpcs[0], RESOURCE_EXTRA_ATTRIBUTES_MAP["vpc_attributes"]) + + def _get_eip_address(self, instance): + eips = findall(instance, xpath="EipAddress", namespace=self.namespace) + if len(eips) <= 0: + return None + return self._get_extra_dict(eips[0], RESOURCE_EXTRA_ATTRIBUTES_MAP["eip_address_associate"]) + + def _get_operation_locks(self, instance): + locks = findall(instance, xpath="OperationLocks", namespace=self.namespace) + if len(locks) <= 0: + return None + return self._get_extra_dict(locks[0], RESOURCE_EXTRA_ATTRIBUTES_MAP["operation_locks"]) + + def _wait_until_state(self, nodes, state, wait_period=3, timeout=600): + """ + Block until the provided nodes are in the desired state. + :param nodes: List of nodes to wait for + :type nodes: ``list`` of :class:`.Node` + :param state: desired state + :type state: ``NodeState`` + :param wait_period: How many seconds to wait between each loop + iteration. (default is 3) + :type wait_period: ``int`` + :param timeout: How many seconds to wait before giving up. + (default is 600) + :type timeout: ``int`` + :return: if the nodes are in the desired state. + :rtype: ``bool`` + """ + start = time.time() + end = start + timeout + node_ids = [node.id for node in nodes] + + while time.time() < end: + matched_nodes = self.list_nodes(ex_node_ids=node_ids) + if len(matched_nodes) > len(node_ids): + found_ids = [node.id for node in matched_nodes] + msg = ( + "found multiple nodes with same ids, " + "desired ids: %(ids)s, found ids: %(found_ids)s" + % {"ids": node_ids, "found_ids": found_ids} + ) + raise LibcloudError(value=msg, driver=self) + desired_nodes = [node for node in matched_nodes if node.state == state] + + if len(desired_nodes) == len(node_ids): + return True + else: + time.sleep(wait_period) + continue + + raise LibcloudError(value="Timed out after %s seconds" % (timeout), driver=self) + + def _to_volume(self, element): + _id = findtext(element, "DiskId", namespace=self.namespace) + name = findtext(element, "DiskName", namespace=self.namespace) + size = int(findtext(element, "Size", namespace=self.namespace)) + status_str = findtext(element, "Status", namespace=self.namespace) + status = self.VOLUME_STATE_MAPPING.get(status_str, StorageVolumeState.UNKNOWN) + + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["volume"]) + extra["operation_locks"] = self._get_operation_locks(element) + return StorageVolume(_id, name, size, self, state=status, extra=extra) + + def _list_to_json_array(self, value): + try: + return json.dumps(value) + except Exception: + raise AttributeError("could not convert list to json array") + + def _to_snapshot(self, element): + _id = findtext(element, "SnapshotId", namespace=self.namespace) + created = findtext(element, "CreationTime", namespace=self.namespace) + status_str = findtext(element, "Status", namespace=self.namespace) + state = self.SNAPSHOT_STATE_MAPPING.get(status_str, VolumeSnapshotState.UNKNOWN) + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["snapshot"]) + return VolumeSnapshot(id=_id, driver=self, extra=extra, created=created, state=state) + + def _to_size(self, element): + _id = findtext(element, "InstanceTypeId", namespace=self.namespace) + ram = float(findtext(element, "MemorySize", namespace=self.namespace)) + extra = {} + extra["cpu_core_count"] = int(findtext(element, "CpuCoreCount", namespace=self.namespace)) + extra["instance_type_family"] = findtext( + element, "InstanceTypeFamily", namespace=self.namespace + ) + return NodeSize( + id=_id, + name=_id, + ram=ram, + disk=None, + bandwidth=None, + price=None, + driver=self, + extra=extra, + ) + + def _to_location(self, element): + _id = findtext(element, "RegionId", namespace=self.namespace) + localname = findtext(element, "LocalName", namespace=self.namespace) + return NodeLocation(id=_id, name=localname, country=None, driver=self) + + def _to_image(self, element): + _id = findtext(element, "ImageId", namespace=self.namespace) + name = findtext(element, "ImageName", namespace=self.namespace) + extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP["image"]) + extra["disk_device_mappings"] = self._get_disk_device_mappings( + element.find("DiskDeviceMappings") + ) + return NodeImage(id=_id, name=name, driver=self, extra=extra) + + def _get_disk_device_mappings(self, element): + if element is None: + return None + mapping_element = element.find("DiskDeviceMapping") + if mapping_element is not None: + return self._get_extra_dict( + mapping_element, RESOURCE_EXTRA_ATTRIBUTES_MAP["disk_device_mapping"] + ) + return None + + def _to_security_group(self, element): + _id = findtext(element, "SecurityGroupId", namespace=self.namespace) + name = findtext(element, "SecurityGroupName", namespace=self.namespace) + description = findtext(element, "Description", namespace=self.namespace) + vpc_id = findtext(element, "VpcId", namespace=self.namespace) + creation_time = findtext(element, "CreationTime", namespace=self.namespace) + return ECSSecurityGroup( + _id, + name, + description=description, + driver=self, + vpc_id=vpc_id, + creation_time=creation_time, + ) + + def _to_security_group_attribute(self, element): + ip_protocol = findtext(element, "IpProtocol", namespace=self.namespace) + port_range = findtext(element, "PortRange", namespace=self.namespace) + source_group_id = findtext(element, "SourceGroupId", namespace=self.namespace) + policy = findtext(element, "Policy", namespace=self.namespace) + nic_type = findtext(element, "NicType", namespace=self.namespace) + return ECSSecurityGroupAttribute( + ip_protocol=ip_protocol, + port_range=port_range, + source_group_id=source_group_id, + policy=policy, + nic_type=nic_type, + ) + + def _to_zone(self, element): + _id = findtext(element, "ZoneId", namespace=self.namespace) + local_name = findtext(element, "LocalName", namespace=self.namespace) + resource_types = findall( + element, "AvailableResourceCreation/ResourceTypes", namespace=self.namespace + ) + instance_types = findall( + element, "AvailableInstanceTypes/InstanceTypes", namespace=self.namespace + ) + disk_categories = findall( + element, "AvailableDiskCategories/DiskCategories", namespace=self.namespace + ) + + def _text(element): + return element.text + + return ECSZone( + id=_id, + name=local_name, + driver=self, + available_resource_types=list(map(_text, resource_types)), + available_instance_types=list(map(_text, instance_types)), + available_disk_categories=list(map(_text, disk_categories)), + ) + + def _get_pagination(self, element): + page_number = int(findtext(element, "PageNumber")) + total_count = int(findtext(element, "TotalCount")) + page_size = int(findtext(element, "PageSize")) + return Pagination(total=total_count, size=page_size, current=page_number) + + def _request_multiple_pages(self, path, params, parse_func): + """ + Request all resources by multiple pages. + :param path: the resource path + :type path: ``str`` + :param params: the query parameters + :type params: ``dict`` + :param parse_func: the function object to parse the response body + :param type: ``function`` + :return: list of resource object, if not found any, return [] + :rtype: ``list`` + """ + results = [] + while True: + one_page = self.connection.request(path, params).object + resources = parse_func(one_page) + results += resources + pagination = self._get_pagination(one_page) + if pagination.next() is None: + break + params.update(pagination.to_dict()) + return results diff --git a/libcloud/compute/drivers/elastichosts.py b/libcloud/compute/drivers/elastichosts.py deleted file mode 100644 index 736ac7f0b7..0000000000 --- a/libcloud/compute/drivers/elastichosts.py +++ /dev/null @@ -1,236 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -ElasticHosts Driver -""" - -from libcloud.compute.types import Provider -from libcloud.compute.drivers.elasticstack import ElasticStackBaseNodeDriver - - -# API end-points -API_ENDPOINTS = { - 'lon-p': { - 'name': 'London Peer 1', - 'country': 'United Kingdom', - 'host': 'api-lon-p.elastichosts.com' - }, - 'lon-b': { - 'name': 'London BlueSquare', - 'country': 'United Kingdom', - 'host': 'api-lon-b.elastichosts.com' - }, - 'sat-p': { - 'name': 'San Antonio Peer 1', - 'country': 'United States', - 'host': 'api-sat-p.elastichosts.com' - }, - 'lax-p': { - 'name': 'Los Angeles Peer 1', - 'country': 'United States', - 'host': 'api-lax-p.elastichosts.com' - }, - 'sjc-c': { - 'name': 'San Jose (Silicon Valley)', - 'country': 'United States', - 'host': 'api-sjc-c.elastichosts.com' - }, - 'tor-p': { - 'name': 'Toronto Peer 1', - 'country': 'Canada', - 'host': 'api-tor-p.elastichosts.com' - }, - 'syd-y': { - 'name': 'Sydney', - 'country': 'Australia', - 'host': 'api-syd-v.elastichosts.com' - }, - 'cn-1': { - 'name': 'Hong Kong', - 'country': 'China', - 'host': 'api-hkg-e.elastichosts.com' - } -} - -# Default API end-point for the base connection class. -DEFAULT_REGION = 'sat-p' - -# Retrieved from http://www.elastichosts.com/cloud-hosting/api -STANDARD_DRIVES = { - '38df0986-4d85-4b76-b502-3878ffc80161': { - 'uuid': '38df0986-4d85-4b76-b502-3878ffc80161', - 'description': 'CentOS Linux 5.5', - 'size_gunzipped': '3GB', - 'supports_deployment': True, - }, - '980cf63c-f21e-4382-997b-6541d5809629': { - 'uuid': '980cf63c-f21e-4382-997b-6541d5809629', - 'description': 'Debian Linux 5.0', - 'size_gunzipped': '1GB', - 'supports_deployment': True, - }, - 'aee5589a-88c3-43ef-bb0a-9cab6e64192d': { - 'uuid': 'aee5589a-88c3-43ef-bb0a-9cab6e64192d', - 'description': 'Ubuntu Linux 10.04', - 'size_gunzipped': '1GB', - 'supports_deployment': True, - }, - '62f512cd-82c7-498e-88d8-a09ac2ef20e7': { - 'uuid': '62f512cd-82c7-498e-88d8-a09ac2ef20e7', - 'description': 'Ubuntu Linux 12.04', - 'size_gunzipped': '1GB', - 'supports_deployment': True, - }, - 'b9d0eb72-d273-43f1-98e3-0d4b87d372c0': { - 'uuid': 'b9d0eb72-d273-43f1-98e3-0d4b87d372c0', - 'description': 'Windows Web Server 2008', - 'size_gunzipped': '13GB', - 'supports_deployment': False, - }, - '30824e97-05a4-410c-946e-2ba5a92b07cb': { - 'uuid': '30824e97-05a4-410c-946e-2ba5a92b07cb', - 'description': 'Windows Web Server 2008 R2', - 'size_gunzipped': '13GB', - 'supports_deployment': False, - }, - '9ecf810e-6ad1-40ef-b360-d606f0444671': { - 'uuid': '9ecf810e-6ad1-40ef-b360-d606f0444671', - 'description': 'Windows Web Server 2008 R2 + SQL Server', - 'size_gunzipped': '13GB', - 'supports_deployment': False, - }, - '10a88d1c-6575-46e3-8d2c-7744065ea530': { - 'uuid': '10a88d1c-6575-46e3-8d2c-7744065ea530', - 'description': 'Windows Server 2008 Standard R2', - 'size_gunzipped': '13GB', - 'supports_deployment': False, - }, - '2567f25c-8fb8-45c7-95fc-bfe3c3d84c47': { - 'uuid': '2567f25c-8fb8-45c7-95fc-bfe3c3d84c47', - 'description': 'Windows Server 2008 Standard R2 + SQL Server', - 'size_gunzipped': '13GB', - 'supports_deployment': False, - }, -} - - -class ElasticHostsException(Exception): - def __str__(self): - return self.args[0] - - def __repr__(self): - return "" % (self.args[0]) - - -class ElasticHostsNodeDriver(ElasticStackBaseNodeDriver): - """ - Node Driver class for ElasticHosts - """ - type = Provider.ELASTICHOSTS - api_name = 'elastichosts' - name = 'ElasticHosts' - website = 'http://www.elastichosts.com/' - features = {"create_node": ["generates_password"]} - _standard_drives = STANDARD_DRIVES - - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region=DEFAULT_REGION, **kwargs): - - if hasattr(self, '_region'): - region = self._region - - if region not in API_ENDPOINTS: - raise ValueError('Invalid region: %s' % (region)) - - self._host_argument_set = host is not None - super(ElasticHostsNodeDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, - region=region, **kwargs) - - def _ex_connection_class_kwargs(self): - """ - Return the host value based on the user supplied region. - """ - kwargs = {} - if not self._host_argument_set: - kwargs['host'] = API_ENDPOINTS[self.region]['host'] - - return kwargs - - -class ElasticHostsUK1NodeDriver(ElasticHostsNodeDriver): - """ - ElasticHosts node driver for the London Peer 1 end-point - """ - name = 'ElasticHosts (lon-p)' - _region = 'lon-p' - - -class ElasticHostsUK2NodeDriver(ElasticHostsNodeDriver): - """ - ElasticHosts node driver for the London Bluesquare end-point - """ - name = 'ElasticHosts (lon-b)' - _region = 'lon-b' - - -class ElasticHostsUS1NodeDriver(ElasticHostsNodeDriver): - """ - ElasticHosts node driver for the San Antonio Peer 1 end-point - """ - name = 'ElasticHosts (sat-p)' - _region = 'sat-p' - - -class ElasticHostsUS2NodeDriver(ElasticHostsNodeDriver): - """ - ElasticHosts node driver for the Los Angeles Peer 1 end-point - """ - name = 'ElasticHosts (lax-p)' - _region = 'lax-p' - - -class ElasticHostsUS3NodeDriver(ElasticHostsNodeDriver): - """ - ElasticHosts node driver for the San Jose (Silicon Valley) end-point - """ - name = 'ElasticHosts (sjc-c)' - _region = 'sjc-c' - - -class ElasticHostsCA1NodeDriver(ElasticHostsNodeDriver): - """ - ElasticHosts node driver for the Toronto Peer 1 end-point - """ - name = 'ElasticHosts (tor-p)' - _region = 'tor-p' - - -class ElasticHostsAU1NodeDriver(ElasticHostsNodeDriver): - """ - ElasticHosts node driver for the Sydney end-point - """ - name = 'ElasticHosts (syd-y)' - _region = 'syd-y' - - -class ElasticHostsCN1NodeDriver(ElasticHostsNodeDriver): - """ - ElasticHosts node driver for the Hong Kong end-point - """ - name = 'ElasticHosts (cn-1)' - _region = 'cn-1' diff --git a/libcloud/compute/drivers/elasticstack.py b/libcloud/compute/drivers/elasticstack.py deleted file mode 100644 index 18b581bf61..0000000000 --- a/libcloud/compute/drivers/elasticstack.py +++ /dev/null @@ -1,495 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Base driver for the providers based on the ElasticStack platform - -http://www.elasticstack.com. -""" - -import re -import time -import base64 - -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import b - -try: - import simplejson as json -except ImportError: - import json - -from libcloud.common.base import ConnectionUserAndKey, JsonResponse -from libcloud.common.types import InvalidCredsError -from libcloud.compute.types import NodeState -from libcloud.compute.base import NodeDriver, NodeSize, Node -from libcloud.compute.base import NodeImage -from libcloud.compute.deployment import ScriptDeployment, SSHKeyDeployment -from libcloud.compute.deployment import MultiStepDeployment - - -NODE_STATE_MAP = { - 'active': NodeState.RUNNING, - 'dead': NodeState.TERMINATED, - 'dumped': NodeState.TERMINATED, -} - -# Default timeout (in seconds) for the drive imaging process -IMAGING_TIMEOUT = 10 * 60 - -# ElasticStack doesn't specify special instance types, so I just specified -# some plans based on the other provider offerings. -# -# Basically for CPU any value between 500Mhz and 20000Mhz should work, -# 256MB to 8192MB for ram and 1GB to 2TB for disk. -INSTANCE_TYPES = { - 'small': { - 'id': 'small', - 'name': 'Small instance', - 'cpu': 2000, - 'memory': 1700, - 'disk': 160, - 'bandwidth': None, - }, - 'medium': { - 'id': 'medium', - 'name': 'Medium instance', - 'cpu': 3000, - 'memory': 4096, - 'disk': 500, - 'bandwidth': None, - }, - 'large': { - 'id': 'large', - 'name': 'Large instance', - 'cpu': 4000, - 'memory': 7680, - 'disk': 850, - 'bandwidth': None, - }, - 'extra-large': { - 'id': 'extra-large', - 'name': 'Extra Large instance', - 'cpu': 8000, - 'memory': 8192, - 'disk': 1690, - 'bandwidth': None, - }, - 'high-cpu-medium': { - 'id': 'high-cpu-medium', - 'name': 'High-CPU Medium instance', - 'cpu': 5000, - 'memory': 1700, - 'disk': 350, - 'bandwidth': None, - }, - 'high-cpu-extra-large': { - 'id': 'high-cpu-extra-large', - 'name': 'High-CPU Extra Large instance', - 'cpu': 20000, - 'memory': 7168, - 'disk': 1690, - 'bandwidth': None, - }, -} - - -class ElasticStackException(Exception): - def __str__(self): - return self.args[0] - - def __repr__(self): - return "" % (self.args[0]) - - -class ElasticStackResponse(JsonResponse): - def success(self): - if self.status == 401: - raise InvalidCredsError() - - return self.status >= 200 and self.status <= 299 - - def parse_error(self): - error_header = self.headers.get('x-elastic-error', '') - return 'X-Elastic-Error: %s (%s)' % (error_header, self.body.strip()) - - -class ElasticStackNodeSize(NodeSize): - def __init__(self, id, name, cpu, ram, disk, bandwidth, price, driver): - self.id = id - self.name = name - self.cpu = cpu - self.ram = ram - self.disk = disk - self.bandwidth = bandwidth - self.price = price - self.driver = driver - - def __repr__(self): - return (('') - % (self.id, self.name, self.cpu, self.ram, - self.disk, self.bandwidth, self.price, self.driver.name)) - - -class ElasticStackBaseConnection(ConnectionUserAndKey): - """ - Base connection class for the ElasticStack driver - """ - - host = None - responseCls = ElasticStackResponse - - def add_default_headers(self, headers): - headers['Accept'] = 'application/json' - headers['Content-Type'] = 'application/json' - headers['Authorization'] = \ - ('Basic %s' % (base64.b64encode(b('%s:%s' % (self.user_id, - self.key)))) - .decode('utf-8')) - return headers - - -class ElasticStackBaseNodeDriver(NodeDriver): - website = 'http://www.elasticstack.com' - connectionCls = ElasticStackBaseConnection - features = {"create_node": ["generates_password"]} - - def reboot_node(self, node): - # Reboots the node - response = self.connection.request( - action='/servers/%s/reset' % (node.id), - method='POST' - ) - return response.status == 204 - - def destroy_node(self, node): - # Kills the server immediately - response = self.connection.request( - action='/servers/%s/destroy' % (node.id), - method='POST' - ) - return response.status == 204 - - def list_images(self, location=None): - # Returns a list of available pre-installed system drive images - images = [] - for key, value in self._standard_drives.items(): - image = NodeImage( - id=value['uuid'], - name=value['description'], - driver=self.connection.driver, - extra={ - 'size_gunzipped': value['size_gunzipped'] - } - ) - images.append(image) - - return images - - def list_sizes(self, location=None): - sizes = [] - for key, value in INSTANCE_TYPES.items(): - size = ElasticStackNodeSize( - id=value['id'], - name=value['name'], cpu=value['cpu'], ram=value['memory'], - disk=value['disk'], bandwidth=value['bandwidth'], - price=self._get_size_price(size_id=value['id']), - driver=self.connection.driver - ) - sizes.append(size) - - return sizes - - def list_nodes(self): - # Returns a list of active (running) nodes - response = self.connection.request(action='/servers/info').object - - nodes = [] - for data in response: - node = self._to_node(data) - nodes.append(node) - - return nodes - - def create_node(self, **kwargs): - """Creates an ElasticStack instance - - @inherits: :class:`NodeDriver.create_node` - - :keyword name: String with a name for this new node (required) - :type name: ``str`` - - :keyword smp: Number of virtual processors or None to calculate - based on the cpu speed - :type smp: ``int`` - - :keyword nic_model: e1000, rtl8139 or virtio - (if not specified, e1000 is used) - :type nic_model: ``str`` - - :keyword vnc_password: If set, the same password is also used for - SSH access with user toor, - otherwise VNC access is disabled and - no SSH login is possible. - :type vnc_password: ``str`` - """ - size = kwargs['size'] - image = kwargs['image'] - smp = kwargs.get('smp', 'auto') - nic_model = kwargs.get('nic_model', 'e1000') - vnc_password = ssh_password = kwargs.get('vnc_password', None) - - if nic_model not in ('e1000', 'rtl8139', 'virtio'): - raise ElasticStackException('Invalid NIC model specified') - - # check that drive size is not smaller than pre installed image size - - # First we create a drive with the specified size - drive_data = {} - drive_data.update({'name': kwargs['name'], - 'size': '%sG' % (kwargs['size'].disk)}) - - response = self.connection.request(action='/drives/create', - data=json.dumps(drive_data), - method='POST').object - - if not response: - raise ElasticStackException('Drive creation failed') - - drive_uuid = response['drive'] - - # Then we image the selected pre-installed system drive onto it - response = self.connection.request( - action='/drives/%s/image/%s/gunzip' % (drive_uuid, image.id), - method='POST' - ) - - if response.status not in (200, 204): - raise ElasticStackException('Drive imaging failed') - - # We wait until the drive is imaged and then boot up the node - # (in most cases, the imaging process shouldn't take longer - # than a few minutes) - response = self.connection.request( - action='/drives/%s/info' % (drive_uuid) - ).object - - imaging_start = time.time() - while 'imaging' in response: - response = self.connection.request( - action='/drives/%s/info' % (drive_uuid) - ).object - - elapsed_time = time.time() - imaging_start - if ('imaging' in response and elapsed_time >= IMAGING_TIMEOUT): - raise ElasticStackException('Drive imaging timed out') - - time.sleep(1) - - node_data = {} - node_data.update({'name': kwargs['name'], - 'cpu': size.cpu, - 'mem': size.ram, - 'ide:0:0': drive_uuid, - 'boot': 'ide:0:0', - 'smp': smp}) - node_data.update({'nic:0:model': nic_model, 'nic:0:dhcp': 'auto'}) - - if vnc_password: - node_data.update({'vnc': 'auto', 'vnc:password': vnc_password}) - - response = self.connection.request( - action='/servers/create', data=json.dumps(node_data), - method='POST' - ).object - - if isinstance(response, list): - nodes = [self._to_node(node, ssh_password) for node in response] - else: - nodes = self._to_node(response, ssh_password) - - return nodes - - # Extension methods - def ex_set_node_configuration(self, node, **kwargs): - """ - Changes the configuration of the running server - - :param node: Node which should be used - :type node: :class:`Node` - - :param kwargs: keyword arguments - :type kwargs: ``dict`` - - :rtype: ``bool`` - """ - valid_keys = ('^name$', '^parent$', '^cpu$', '^smp$', '^mem$', - '^boot$', '^nic:0:model$', '^nic:0:dhcp', - '^nic:1:model$', '^nic:1:vlan$', '^nic:1:mac$', - '^vnc:ip$', '^vnc:password$', '^vnc:tls', - '^ide:[0-1]:[0-1](:media)?$', - '^scsi:0:[0-7](:media)?$', '^block:[0-7](:media)?$') - - invalid_keys = [] - keys = list(kwargs.keys()) - for key in keys: - matches = False - for regex in valid_keys: - if re.match(regex, key): - matches = True - break - if not matches: - invalid_keys.append(key) - - if invalid_keys: - raise ElasticStackException( - 'Invalid configuration key specified: %s' - % (',' .join(invalid_keys)) - ) - - response = self.connection.request( - action='/servers/%s/set' % (node.id), data=json.dumps(kwargs), - method='POST' - ) - - return (response.status == httplib.OK and response.body != '') - - def deploy_node(self, **kwargs): - """ - Create a new node, and start deployment. - - @inherits: :class:`NodeDriver.deploy_node` - - :keyword enable_root: If true, root password will be set to - vnc_password (this will enable SSH access) - and default 'toor' account will be deleted. - :type enable_root: ``bool`` - """ - image = kwargs['image'] - vnc_password = kwargs.get('vnc_password', None) - enable_root = kwargs.get('enable_root', False) - - if not vnc_password: - raise ValueError('You need to provide vnc_password argument ' - 'if you want to use deployment') - - if (image in self._standard_drives and - not self._standard_drives[image]['supports_deployment']): - raise ValueError('Image %s does not support deployment' - % (image.id)) - - if enable_root: - script = ("unset HISTFILE;" - "echo root:%s | chpasswd;" - "sed -i '/^toor.*$/d' /etc/passwd /etc/shadow;" - "history -c") % vnc_password - root_enable_script = ScriptDeployment(script=script, - delete=True) - deploy = kwargs.get('deploy', None) - if deploy: - if (isinstance(deploy, ScriptDeployment) or - isinstance(deploy, SSHKeyDeployment)): - deployment = MultiStepDeployment([deploy, - root_enable_script]) - elif isinstance(deploy, MultiStepDeployment): - deployment = deploy - deployment.add(root_enable_script) - else: - deployment = root_enable_script - - kwargs['deploy'] = deployment - - if not kwargs.get('ssh_username', None): - kwargs['ssh_username'] = 'toor' - - return super(ElasticStackBaseNodeDriver, self).deploy_node(**kwargs) - - def ex_shutdown_node(self, node): - """ - Sends the ACPI power-down event - - :param node: Node which should be used - :type node: :class:`Node` - - :rtype: ``bool`` - """ - response = self.connection.request( - action='/servers/%s/shutdown' % (node.id), - method='POST' - ) - return response.status == 204 - - def ex_destroy_drive(self, drive_uuid): - """ - Deletes a drive - - :param drive_uuid: Drive uuid which should be used - :type drive_uuid: ``str`` - - :rtype: ``bool`` - """ - response = self.connection.request( - action='/drives/%s/destroy' % (drive_uuid), - method='POST' - ) - return response.status == 204 - - # Helper methods - def _to_node(self, data, ssh_password=None): - try: - state = NODE_STATE_MAP[data['status']] - except KeyError: - state = NodeState.UNKNOWN - - if 'nic:0:dhcp:ip' in data: - if isinstance(data['nic:0:dhcp:ip'], list): - public_ip = data['nic:0:dhcp:ip'] - else: - public_ip = [data['nic:0:dhcp:ip']] - else: - public_ip = [] - - extra = {'cpu': data['cpu'], - 'mem': data['mem']} - - if 'started' in data: - extra['started'] = data['started'] - - if 'smp' in data: - extra['smp'] = data['smp'] - - if 'vnc:ip' in data: - extra['vnc:ip'] = data['vnc:ip'] - - if 'vnc:password' in data: - extra['vnc:password'] = data['vnc:password'] - - boot_device = data['boot'] - - if isinstance(boot_device, list): - for device in boot_device: - extra[device] = data[device] - else: - extra[boot_device] = data[boot_device] - - if ssh_password: - extra.update({'password': ssh_password}) - - node = Node(id=data['server'], name=data['name'], state=state, - public_ips=public_ip, private_ips=None, - driver=self.connection.driver, - extra=extra) - - return node diff --git a/libcloud/compute/drivers/equinixmetal.py b/libcloud/compute/drivers/equinixmetal.py new file mode 100644 index 0000000000..11e497927b --- /dev/null +++ b/libcloud/compute/drivers/equinixmetal.py @@ -0,0 +1,829 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Equinix Metal Driver +""" + +try: # Try to use asyncio to perform requests in parallel across projects + import asyncio +except ImportError: # If not available will do things serially + asyncio = None + +import json + +from libcloud.utils.py3 import httplib +from libcloud.common.base import JsonResponse, ConnectionKey +from libcloud.compute.base import Node, KeyPair, NodeSize, NodeImage, NodeDriver, NodeLocation +from libcloud.compute.types import Provider, NodeState, InvalidCredsError + +EQUINIXMETAL_ENDPOINT = "api.equinix.com" + +# True to use async io if available (aka running under Python 3) +USE_ASYNC_IO_IF_AVAILABLE = True + + +def use_asyncio(): + return asyncio is not None and USE_ASYNC_IO_IF_AVAILABLE + + +class EquinixMetalResponse(JsonResponse): + valid_response_codes = [ + httplib.OK, + httplib.ACCEPTED, + httplib.CREATED, + httplib.NO_CONTENT, + ] + + def parse_error(self): + if self.status == httplib.UNAUTHORIZED: + body = self.parse_body() + raise InvalidCredsError(body.get("error")) + else: + body = self.parse_body() + + if "message" in body: + error = "{} (code: {})".format(body.get("message"), self.status) + elif "errors" in body: + error = body.get("errors") + else: + error = body + raise Exception(error) + + def success(self): + return self.status in self.valid_response_codes + + +class EquinixMetalConnection(ConnectionKey): + """ + Connection class for the Equinix Metal driver. + """ + + host = EQUINIXMETAL_ENDPOINT + responseCls = EquinixMetalResponse + + def add_default_headers(self, headers): + """ + Add headers that are necessary for every request + """ + headers["Content-Type"] = "application/json" + headers["X-Auth-Token"] = self.key + headers["X-Consumer-Token"] = ( + "kcrhMn7hwG8Ceo2hAhGFa2qpxLBvVHxEjS9ue8iqmsNkeeB2iQgMq4dNc1893pYu" + ) + + return headers + + +class EquinixMetalNodeDriver(NodeDriver): + """ + Equinix Metal NodeDriver + """ + + connectionCls = EquinixMetalConnection + type = Provider.EQUINIXMETAL + name = "EquinixMetal" + website = "https://metal.equinix.com/" + + NODE_STATE_MAP = { + "queued": NodeState.PENDING, + "provisioning": NodeState.PENDING, + "rebuilding": NodeState.PENDING, + "powering_on": NodeState.REBOOTING, + "powering_off": NodeState.REBOOTING, + "rebooting": NodeState.REBOOTING, + "inactive": NodeState.STOPPED, + "deleted": NodeState.TERMINATED, + "deprovisioning": NodeState.TERMINATED, + "failed": NodeState.ERROR, + "active": NodeState.RUNNING, + } + + def __init__(self, key, project=None): + """ + Initialize a NodeDriver for Equinix Metal using the API token + and optionally the project (name or id). + + If project name is specified we validate it lazily and populate + self.project_id during the first access of self.projects variable + """ + super().__init__(key=key) + + self.project_name = project + self.project_id = None + + # Lazily populated on first access to self.project + self._project = project + + # Variable which indicates if self._projects has been populated yet and + # has been called self._project validated + self._projects_populated = False + self._projects = None + + @property + def projects(self): + """ + Lazily retrieve projects and set self.project_id variable on initial + access to self.projects variable. + """ + + if not self._projects_populated: + # NOTE: Each EquinixMetal account needs at least one project, + # but to be on the safe side and avoid infinite loop + # in case there are no projects on the account, we don't use + # a more robust way to determine + # if project list has been populated yet + self._projects = self.ex_list_projects() + self._projects_populated = True + + # If project name is specified, verify it's valid and populate + # self.project_id + + if self._project: + for project_obj in self._projects: + if self._project in [project_obj.name, project_obj.id]: + self.project_id = project_obj.id + + break + + if not self.project_id: + # Invalid project name + self.project_name = None + + return self._projects + + def ex_list_projects(self): + projects = [] + data = self.connection.request("/metal/v1/projects").object + projects = data.get("projects") + + if projects: + projects = [Project(project) for project in projects] + + return projects + + def list_nodes(self, ex_project_id=None): + if ex_project_id: + return self.ex_list_nodes_for_project(ex_project_id=ex_project_id) + + # if project has been specified during driver initialization, then + # return nodes for this project only + + if self.project_id: + return self.ex_list_nodes_for_project(ex_project_id=self.project_id) + + # In case of Python2 perform requests serially + + if not use_asyncio(): + nodes = [] + + for project in self.projects: + nodes.extend(self.ex_list_nodes_for_project(ex_project_id=project.id)) + + return nodes + # In case of Python3 use asyncio to perform requests in parallel + + return self.list_resources_async("nodes") + + def list_resources_async(self, resource_type): + # The _list_nodes function is defined dynamically using exec in + # order to prevent a SyntaxError in Python2 due to "yield from". + # This cruft can be removed once Python2 support is no longer + # required. + assert resource_type in ["nodes"] + glob = globals() + loc = locals() + exec( + """ +import asyncio +@asyncio.coroutine +def _list_async(driver): + projects = [project.id for project in driver.projects] + loop = asyncio.get_event_loop() + futures = [ + loop.run_in_executor(None, driver.ex_list_%s_for_project, p) + for p in projects + ] + retval = [] + for future in futures: + result = yield from future + retval.extend(result) + + return retval""" % resource_type, + glob, + loc, + ) + try: + loop = asyncio.get_event_loop() + except RuntimeError: + asyncio.set_event_loop(asyncio.new_event_loop()) + loop = asyncio.get_event_loop() + + return loop.run_until_complete(loc["_list_async"](loc["self"])) + + def ex_list_nodes_for_project(self, ex_project_id, include="plan", page=1, per_page=1000): + params = {"include": include, "page": page, "per_page": per_page} + data = self.connection.request( + "/metal/v1/projects/%s/devices" % (ex_project_id), params=params + ).object["devices"] + + return list(map(self._to_node, data)) + + def list_locations(self): + data = self.connection.request("/metal/v1/locations/metros").object["metros"] + + return list(map(self._to_location, data)) + + def list_images( + self, + location=None, + ): + data = self.connection.request("/metal/v1/operating-systems").object["operating_systems"] + + return list(map(self._to_image, data)) + + def list_sizes( + self, + location=None, + ex_project_id=None, + ): + project_id = ( + ex_project_id or self.project_id or (len(self.projects) and self.projects[0].id) + ) + + if project_id: + data = self.connection.request("/metal/v1/projects/%s/plans" % project_id).object[ + "plans" + ] + else: # This only works with personal tokens + data = self.connection.request("/metal/v1/plans").object["plans"] + + return [self._to_size(size) for size in data if size.get("line") == "baremetal"] + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_project_id=None, + ip_addresses=None, + cloud_init=None, + **kwargs, + ): + """ + Create a node. + + :return: The newly created node. + :rtype: :class:`Node` + """ + # if project has been specified on initialization of driver, then + # create on this project + + if self.project_id: + ex_project_id = self.project_id + else: + if not ex_project_id: + raise Exception("ex_project_id needs to be specified") + + location_code = location.extra["code"] + + if not self._valid_location: + raise ValueError( + "Failed to create node: valid parameter metro [code] is required in the input" + ) + + params = { + "hostname": name, + "plan": size.id, + "operating_system": image.id, + "metro": location_code, + "include": "plan", + "billing_cycle": "hourly", + } + + if ip_addresses: + params["ip_addresses"] = ip_addresses + params.update(kwargs) + + if cloud_init: + params["userdata"] = cloud_init + data = self.connection.request( + "/metal/v1/projects/%s/devices" % (ex_project_id), + data=json.dumps(params), + method="POST", + ) + + status = data.object.get("status", "OK") + + if status == "ERROR": + message = data.object.get("message", None) + error_message = data.object.get("error_message", message) + raise ValueError("Failed to create node: %s" % (error_message)) + node = self._to_node(data=data.object) + + return node + + def reboot_node(self, node): + params = {"type": "reboot"} + res = self.connection.request( + "/metal/v1/devices/%s/actions" % (node.id), params=params, method="POST" + ) + + return res.status == httplib.OK + + def start_node(self, node): + params = {"type": "power_on"} + res = self.connection.request( + "/metal/v1/devices/%s/actions" % (node.id), params=params, method="POST" + ) + + return res.status == httplib.OK + + def stop_node(self, node): + params = {"type": "power_off"} + res = self.connection.request( + "/metal/v1/devices/%s/actions" % (node.id), params=params, method="POST" + ) + + return res.status == httplib.OK + + def destroy_node(self, node): + res = self.connection.request("/metal/v1/devices/%s" % (node.id), method="DELETE") + + return res.status == httplib.OK + + def ex_start_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + + return self.start_node(node=node) + + def ex_stop_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + + return self.stop_node(node=node) + + def ex_reinstall_node(self, node): + params = {"type": "reinstall"} + res = self.connection.request( + "/metal/v1/devices/%s/actions" % (node.id), params=params, method="POST" + ) + + return res.status == httplib.OK + + def ex_rescue_node(self, node): + params = {"type": "rescue"} + res = self.connection.request( + "/metal/v1/devices/%s/actions" % (node.id), params=params, method="POST" + ) + + return res.status == httplib.OK + + def ex_update_node(self, node, **kwargs): + path = "/metal/v1/devices/%s" % node.id + res = self.connection.request(path, params=kwargs, method="PUT") + + return res.status == httplib.OK + + def ex_get_node_bandwidth(self, node, from_time, until_time): + path = "/metal/v1/devices/%s/bandwidth" % node.id + params = {"from": from_time, "until": until_time} + + return self.connection.request(path, params=params).object + + def ex_list_ip_assignments_for_node(self, node, include=""): + path = "/metal/v1/devices/%s/ips" % node.id + params = {"include": include} + + return self.connection.request(path, params=params).object + + def list_key_pairs(self): + """ + List all the available SSH keys. + + :return: Available SSH keys. + :rtype: ``list`` of :class:`.KeyPair` objects + """ + data = self.connection.request("/metal/v1/ssh-keys").object["ssh_keys"] + + return list(map(self._to_key_pairs, data)) + + def create_key_pair( + self, + name, + public_key=None, + ): + """ + Create a new SSH key. + + :param name: Key name (required) + :type name: ``str`` + + :param public_key: Valid public key string (required) + :type public_key: ``str`` + """ + if not public_key: + raise ValueError("public_key is required.") + + params = {"label": name, "key": public_key} + data = self.connection.request("/metal/v1/ssh-keys", method="POST", params=params).object + + return self._to_key_pairs(data) + + def delete_key_pair( + self, + key_pair, + ): + """ + Delete an existing SSH key. + + :param key_pair: SSH key (required) + :type key_pair: :class:`KeyPair` + """ + key = key_pair + key_id = key.name + res = self.connection.request("/metal/v1/ssh-keys/%s" % (key_id), method="DELETE") + + return res.status == httplib.NO_CONTENT + + def _to_node(self, data): + extra = {} + extra_keys = [ + "created_at", + "updated_at", + "userdata", + "billing_cycle", + "locked", + "iqn", + "locked", + "project", + "description", + ] + + if "state" in data: + state = self.NODE_STATE_MAP.get(data["state"], NodeState.UNKNOWN) + else: + state = NodeState.UNKNOWN + + if "ip_addresses" in data and data["ip_addresses"] is not None: + ips = self._parse_ips(data["ip_addresses"]) + public_ips = ips["public"] + private_ips = ips["private"] + else: + public_ips = [] + private_ips = [] + + if "operating_system" in data and data["operating_system"] is not None: + image = self._to_image(data["operating_system"]) + extra["operating_system"] = data["operating_system"].get("name") + else: + image = None + + if "plan" in data and data["plan"] is not None: + size = self._to_size(data["plan"]) + extra["plan"] = data["plan"].get("slug") + else: + size = None + + if "facility" in data: + extra["facility"] = data["facility"] + + if "metro" in data and data["metro"] is not None: + extra["metro"] = data["metro"] + + for key in extra_keys: + if key in data: + extra[key] = data[key] + + node = Node( + id=data["id"], + name=data["hostname"], + state=state, + public_ips=public_ips, + private_ips=private_ips, + size=size, + image=image, + extra=extra, + driver=self, + ) + + return node + + def _to_image(self, data): + extra = { + "distro": data["distro"], + "version": data["version"], + "supported_sizes": data.get("provisionable_on", []), + } + + return NodeImage(id=data["slug"], name=data["name"], extra=extra, driver=self) + + def _to_location(self, data): + extra = data + + return NodeLocation( + id=data["id"], name=data["name"], country=None, driver=self, extra=extra + ) + + def _to_size(self, data): + try: + cpus = data["specs"]["cpus"][0].get("count") + except KeyError: + cpus = None + regions = [ + region.get("href").replace("/metal/v1/locations/metros", "") + for region in data.get("available_in_metros", []) + ] + extra = { + "description": data["description"], + "line": data["line"], + "cpus": cpus, + "regions": regions, + } + try: + factor = 1 + ram_txt = data["specs"]["memory"]["total"] + + if "GB" in ram_txt: + factor = 1024 + ram_txt = ram_txt.replace("GB", "") + elif "TB" in ram_txt: + factor = 1024 * 1024 + ram_txt = ram_txt.replace("TB", "") + ram = int(ram_txt) * factor + except Exception: + ram = None + disk = None + + if data["specs"].get("drives", ""): + disk = 0 + + for disks in data["specs"]["drives"]: + disk_size = disks["size"].replace("GB", "") + + if "TB" in disk_size: + disk_size = float(disks["size"].replace("TB", "")) * 1000 + disk += disks["count"] * int(disk_size) + name = "{} - {} RAM".format(data.get("name"), ram) + price = data["pricing"].get("hour") + + return NodeSize( + id=data["slug"], + name=name, + ram=ram, + disk=disk, + bandwidth=0, + price=price, + extra=extra, + driver=self, + ) + + def _to_key_pairs(self, data): + extra = { + "label": data["label"], + "created_at": data["created_at"], + "updated_at": data["updated_at"], + } + + return KeyPair( + name=data["id"], + fingerprint=data["fingerprint"], + public_key=data["key"], + private_key=None, + driver=self, + extra=extra, + ) + + def _parse_ips(self, data): + public_ips = [] + private_ips = [] + + for address in data: + if "address" in address and address["address"] is not None: + if "public" in address and address["public"] is True: + public_ips.append(address["address"]) + else: + private_ips.append(address["address"]) + + return {"public": public_ips, "private": private_ips} + + def ex_get_bgp_config_for_project(self, ex_project_id): + path = "/metal/v1/projects/%s/bgp-config" % ex_project_id + + return self.connection.request(path).object + + def ex_get_bgp_config(self, ex_project_id=None): + if ex_project_id: + projects = [ex_project_id] + elif self.project_id: + projects = [self.project_id] + else: + projects = [p.id for p in self.projects] + retval = [] + + for p in projects: + config = self.ex_get_bgp_config_for_project(p) + + if config: + retval.append(config) + + return retval + + def ex_get_bgp_session(self, session_uuid): + path = "/metal/v1/bgp/sessions/%s" % session_uuid + + return self.connection.request(path).object + + def ex_list_bgp_sessions_for_node(self, node): + path = "/metal/v1/devices/%s/bgp/sessions" % node.id + + return self.connection.request(path).object + + def ex_list_bgp_sessions_for_project(self, ex_project_id): + path = "/metal/v1/projects/%s/bgp/sessions" % ex_project_id + + return self.connection.request(path).object + + def ex_list_bgp_sessions(self, ex_project_id=None): + if ex_project_id: + projects = [ex_project_id] + elif self.project_id: + projects = [self.project_id] + else: + projects = [p.id for p in self.projects] + retval = [] + + for p in projects: + retval.extend(self.ex_list_bgp_sessions_for_project(p)["bgp_sessions"]) + + return retval + + def ex_create_bgp_session(self, node, address_family="ipv4"): + path = "/metal/v1/devices/%s/bgp/sessions" % node.id + params = {"address_family": address_family} + res = self.connection.request(path, params=params, method="POST") + + return res.object + + def ex_delete_bgp_session(self, session_uuid): + path = "/metal/v1/bgp/sessions/%s" % session_uuid + res = self.connection.request(path, method="DELETE") + + return res.status == httplib.OK # or res.status == httplib.NO_CONTENT + + def ex_list_events_for_node(self, node, include=None, page=1, per_page=10): + path = "/metal/v1/devices/%s/events" % node.id + params = {"include": include, "page": page, "per_page": per_page} + + return self.connection.request(path, params=params).object + + def ex_list_events_for_project(self, project, include=None, page=1, per_page=10): + path = "/metal/v1/projects/%s/events" % project.id + params = {"include": include, "page": page, "per_page": per_page} + + return self.connection.request(path, params=params).object + + def ex_describe_all_addresses(self, ex_project_id=None, only_associated=False): + if ex_project_id: + projects = [ex_project_id] + elif self.project_id: + projects = [self.project_id] + else: + projects = [p.id for p in self.projects] + retval = [] + + for project in projects: + retval.extend(self.ex_describe_all_addresses_for_project(project, only_associated)) + + return retval + + def ex_describe_all_addresses_for_project( + self, ex_project_id, include=None, only_associated=False + ): + """ + Returns all the reserved IP addresses for this project + optionally, returns only addresses associated with nodes. + + :param only_associated: If true, return only the addresses + that are associated with an instance. + :type only_associated: ``bool`` + + :return: List of IP addresses. + :rtype: ``list`` of :class:`dict` + """ + path = "/metal/v1/projects/%s/ips" % ex_project_id + params = { + "include": include, + } + ip_addresses = self.connection.request(path, params=params).object + result = [ + a + for a in ip_addresses.get("ip_addresses", []) + if not only_associated or len(a.get("assignments", [])) > 0 + ] + + return result + + def ex_describe_address(self, ex_address_id, include=None): + path = "/metal/v1/ips/%s" % ex_address_id + params = { + "include": include, + } + result = self.connection.request(path, params=params).object + + return result + + def ex_request_address_reservation( + self, + ex_project_id, + location_id=None, + address_family="global_ipv4", + quantity=1, + comments="", + customdata="", + ): + path = "/metal/v1/projects/%s/ips" % ex_project_id + params = { + "type": address_family, + "quantity": quantity, + } + + if location_id: + params["metro"] = location_id + + if comments: + params["comments"] = comments + + if customdata: + params["customdata"] = customdata + result = self.connection.request(path, params=params, method="POST").object + + return result + + def ex_associate_address_with_node(self, node, address, manageable=False, customdata=""): + path = "/metal/v1/devices/%s/ips" % node.id + params = { + "address": address, + "manageable": manageable, + "customdata": customdata, + } + result = self.connection.request(path, params=params, method="POST").object + + return result + + def ex_disassociate_address(self, address_uuid, include=None): + path = "/metal/v1/ips/%s" % address_uuid + params = {} + + if include: + params["include"] = include + result = self.connection.request(path, params=params, method="DELETE").object + + return result + + def _valid_location(self, metro_code): + if not metro_code: + return False + metros = self.connection.request("/metal/v1/locations/metros").object["metros"] + + for metro in metros: + if metro["code"] == metro_code: + return True + + return False + + +class Project: + def __init__(self, project): + self.id = project.get("id") + self.name = project.get("name") + self.extra = {} + self.extra["max_devices"] = project.get("max_devices") + self.extra["payment_method"] = project.get("payment_method") + self.extra["created_at"] = project.get("created_at") + self.extra["credit_amount"] = project.get("credit_amount") + self.extra["devices"] = project.get("devices") + self.extra["invitations"] = project.get("invitations") + self.extra["memberships"] = project.get("memberships") + self.extra["href"] = project.get("href") + self.extra["members"] = project.get("members") + self.extra["ssh_keys"] = project.get("ssh_keys") + + def __repr__(self): + return ("") % (self.id, self.name) diff --git a/libcloud/compute/drivers/exoscale.py b/libcloud/compute/drivers/exoscale.py index 9f883e0b5f..2dcf3d5bbd 100644 --- a/libcloud/compute/drivers/exoscale.py +++ b/libcloud/compute/drivers/exoscale.py @@ -16,16 +16,14 @@ from libcloud.compute.providers import Provider from libcloud.compute.drivers.cloudstack import CloudStackNodeDriver -__all__ = [ - 'ExoscaleNodeDriver' -] +__all__ = ["ExoscaleNodeDriver"] class ExoscaleNodeDriver(CloudStackNodeDriver): type = Provider.EXOSCALE - name = 'Exoscale' - website = 'https://www.exoscale.ch/' + name = "Exoscale" + website = "https://www.exoscale.com/" # API endpoint info - host = 'api.exoscale.ch' - path = '/compute' + host = "api.exoscale.com" + path = "/compute" diff --git a/libcloud/compute/drivers/gandi.py b/libcloud/compute/drivers/gandi.py index e5593b4684..b3543c85ed 100644 --- a/libcloud/compute/drivers/gandi.py +++ b/libcloud/compute/drivers/gandi.py @@ -15,62 +15,72 @@ """ Gandi driver for compute """ -import sys -from datetime import datetime -from libcloud.common.gandi import BaseGandiDriver, GandiException,\ - NetworkInterface, IPAddress, Disk -from libcloud.compute.base import StorageVolume -from libcloud.compute.types import NodeState, Provider -from libcloud.compute.base import Node, NodeDriver -from libcloud.compute.base import NodeSize, NodeImage, NodeLocation +from datetime import datetime +from libcloud.common.gandi import ( + Disk, + IPAddress, + GandiException, + BaseGandiDriver, + NetworkInterface, +) +from libcloud.compute.base import ( + Node, + KeyPair, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, +) +from libcloud.compute.types import Provider, NodeState NODE_STATE_MAP = { - 'running': NodeState.RUNNING, - 'halted': NodeState.TERMINATED, - 'paused': NodeState.TERMINATED, - 'locked': NodeState.TERMINATED, - 'being_created': NodeState.PENDING, - 'invalid': NodeState.UNKNOWN, - 'legally_locked': NodeState.PENDING, - 'deleted': NodeState.TERMINATED + "running": NodeState.RUNNING, + "halted": NodeState.TERMINATED, + "paused": NodeState.TERMINATED, + "locked": NodeState.TERMINATED, + "being_created": NodeState.PENDING, + "invalid": NodeState.UNKNOWN, + "legally_locked": NodeState.PENDING, + "deleted": NodeState.TERMINATED, } NODE_PRICE_HOURLY_USD = 0.02 INSTANCE_TYPES = { - 'small': { - 'id': 'small', - 'name': 'Small instance', - 'cpu': 1, - 'memory': 256, - 'disk': 3, - 'bandwidth': 10240, + "small": { + "id": "small", + "name": "Small instance", + "cpu": 1, + "memory": 256, + "disk": 3, + "bandwidth": 10240, }, - 'medium': { - 'id': 'medium', - 'name': 'Medium instance', - 'cpu': 1, - 'memory': 1024, - 'disk': 20, - 'bandwidth': 10240, + "medium": { + "id": "medium", + "name": "Medium instance", + "cpu": 1, + "memory": 1024, + "disk": 20, + "bandwidth": 10240, }, - 'large': { - 'id': 'large', - 'name': 'Large instance', - 'cpu': 2, - 'memory': 2048, - 'disk': 50, - 'bandwidth': 10240, + "large": { + "id": "large", + "name": "Large instance", + "cpu": 2, + "memory": 2048, + "disk": 50, + "bandwidth": 10240, }, - 'x-large': { - 'id': 'x-large', - 'name': 'Extra Large instance', - 'cpu': 4, - 'memory': 4096, - 'disk': 100, - 'bandwidth': 10240, + "x-large": { + "id": "x-large", + "name": "Extra Large instance", + "cpu": 4, + "memory": 4096, + "disk": 100, + "bandwidth": 10240, }, } @@ -80,10 +90,11 @@ class GandiNodeDriver(BaseGandiDriver, NodeDriver): Gandi node driver """ - api_name = 'gandi' - friendly_name = 'Gandi.net' - website = 'http://www.gandi.net/' - country = 'FR' + + api_name = "gandi" + friendly_name = "Gandi.net" + website = "http://www.gandi.net/" + country = "FR" type = Provider.GANDI # TODO : which features to enable ? features = {} @@ -92,102 +103,169 @@ def __init__(self, *args, **kwargs): """ @inherits: :class:`NodeDriver.__init__` """ - super(BaseGandiDriver, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) def _resource_info(self, type, id): try: - obj = self.connection.request('hosting.%s.info' % type, int(id)) + obj = self.connection.request("hosting.%s.info" % type, int(id)) return obj.object - except Exception: - e = sys.exc_info()[1] + except Exception as e: raise GandiException(1003, e) - return None def _node_info(self, id): - return self._resource_info('vm', id) + return self._resource_info("vm", id) def _volume_info(self, id): - return self._resource_info('disk', id) + return self._resource_info("disk", id) # Generic methods for driver def _to_node(self, vm): return Node( - id=vm['id'], - name=vm['hostname'], - state=NODE_STATE_MAP.get( - vm['state'], - NodeState.UNKNOWN - ), - public_ips=vm.get('ips', []), + id=vm["id"], + name=vm["hostname"], + state=NODE_STATE_MAP.get(vm["state"], NodeState.UNKNOWN), + public_ips=vm.get("ips", []), private_ips=[], driver=self, extra={ - 'ai_active': vm.get('ai_active'), - 'datacenter_id': vm.get('datacenter_id'), - 'description': vm.get('description') - } + "ai_active": vm.get("ai_active"), + "datacenter_id": vm.get("datacenter_id"), + "description": vm.get("description"), + }, ) def _to_nodes(self, vms): return [self._to_node(v) for v in vms] def _to_volume(self, disk): - extra = {'can_snapshot': disk['can_snapshot']} + extra = {"can_snapshot": disk["can_snapshot"]} return StorageVolume( - id=disk['id'], - name=disk['name'], - size=int(disk['size']), + id=disk["id"], + name=disk["name"], + size=int(disk["size"]), driver=self, - extra=extra) + extra=extra, + ) def _to_volumes(self, disks): return [self._to_volume(d) for d in disks] def list_nodes(self): - vms = self.connection.request('hosting.vm.list').object - ips = self.connection.request('hosting.ip.list').object + """ + Return a list of nodes in the current zone or all zones. + + :return: List of Node objects + :rtype: ``list`` of :class:`Node` + """ + vms = self.connection.request("hosting.vm.list").object + ips = self.connection.request("hosting.ip.list").object for vm in vms: - vm['ips'] = [] + vm["ips"] = [] for ip in ips: - if vm['ifaces_id'][0] == ip['iface_id']: - ip = ip.get('ip', None) + if vm["ifaces_id"][0] == ip["iface_id"]: + ip = ip.get("ip", None) if ip: - vm['ips'].append(ip) + vm["ips"].append(ip) nodes = self._to_nodes(vms) return nodes + def ex_get_node(self, node_id): + """ + Return a Node object based on a node id. + + :param name: The ID of the node + :type name: ``int`` + + :return: A Node object for the node + :rtype: :class:`Node` + """ + vm = self.connection.request("hosting.vm.info", int(node_id)).object + ips = self.connection.request("hosting.ip.list").object + vm["ips"] = [] + for ip in ips: + if vm["ifaces_id"][0] == ip["iface_id"]: + ip = ip.get("ip", None) + if ip: + vm["ips"].append(ip) + node = self._to_node(vm) + return node + def reboot_node(self, node): - op = self.connection.request('hosting.vm.reboot', int(node.id)) - self._wait_operation(op.object['id']) + """ + Reboot a node. + + :param node: Node to be rebooted + :type node: :class:`Node` + + :return: True if successful, False if not + :rtype: ``bool`` + """ + op = self.connection.request("hosting.vm.reboot", int(node.id)) + self._wait_operation(op.object["id"]) vm = self._node_info(int(node.id)) - if vm['state'] == 'running': + if vm["state"] == "running": return True return False def destroy_node(self, node): + """ + Destroy a node. + + :param node: Node object to destroy + :type node: :class:`Node` + + :return: True if successful + :rtype: ``bool`` + """ vm = self._node_info(node.id) - if vm['state'] == 'running': + if vm["state"] == "running": # Send vm_stop and wait for accomplish - op_stop = self.connection.request('hosting.vm.stop', int(node.id)) - if not self._wait_operation(op_stop.object['id']): - raise GandiException(1010, 'vm.stop failed') + op_stop = self.connection.request("hosting.vm.stop", int(node.id)) + if not self._wait_operation(op_stop.object["id"]): + raise GandiException(1010, "vm.stop failed") # Delete - op = self.connection.request('hosting.vm.delete', int(node.id)) - if self._wait_operation(op.object['id']): + op = self.connection.request("hosting.vm.delete", int(node.id)) + if self._wait_operation(op.object["id"]): return True return False - def deploy_node(self, **kwargs): + def deploy_node( + self, + deploy, + ssh_username="root", + ssh_alternate_usernames=None, + ssh_port=22, + ssh_timeout=10, + ssh_key=None, + ssh_key_password=None, + auth=None, + timeout=300, + max_tries=3, + ssh_interface="public_ips", + at_exit_func=None, + wait_period=5, + **create_node_kwargs, + ): """ deploy_node is not implemented for gandi driver :rtype: ``bool`` """ - raise NotImplementedError( - 'deploy_node not implemented for gandi driver') - - def create_node(self, **kwargs): + raise NotImplementedError("deploy_node not implemented for gandi driver") + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + login=None, + password=None, + inet_family=4, + keypairs=None, + ): """ Create a new Gandi node @@ -214,136 +292,151 @@ def create_node(self, **kwargs): :keyword inet_family: version of ip to use, default 4 (optional) :type inet_family: ``int`` + :keyword keypairs: IDs of keypairs or Keypairs object + :type keypairs: list of ``int`` or :class:`.KeyPair` + :rtype: :class:`Node` """ + keypairs = keypairs or [] - if kwargs.get('login') is None or kwargs.get('password') is None: + if not login and not keypairs: raise GandiException( - 1020, 'login and password must be defined for node creation') + 1020, + "Login and password or ssh keypair " "must be defined for node creation", + ) - location = kwargs.get('location') if location and isinstance(location, NodeLocation): dc_id = int(location.id) else: - raise GandiException( - 1021, 'location must be a subclass of NodeLocation') + raise GandiException(1021, "location must be a subclass of NodeLocation") - size = kwargs.get('size') if not size and not isinstance(size, NodeSize): - raise GandiException( - 1022, 'size must be a subclass of NodeSize') + raise GandiException(1022, "size must be a subclass of NodeSize") + + keypair_ids = [k if isinstance(k, int) else k.extra["id"] for k in keypairs] # If size name is in INSTANCE_TYPE we use new rating model instance = INSTANCE_TYPES.get(size.id) - cores = instance['cpu'] if instance else int(size.id) + cores = instance["cpu"] if instance else int(size.id) - src_disk_id = int(kwargs['image'].id) + src_disk_id = int(image.id) - disk_spec = { - 'datacenter_id': dc_id, - 'name': 'disk_%s' % kwargs['name'] - } + disk_spec = {"datacenter_id": dc_id, "name": "disk_%s" % name} vm_spec = { - 'datacenter_id': dc_id, - 'hostname': kwargs['name'], - 'login': kwargs['login'], - 'password': kwargs['password'], # TODO : use NodeAuthPassword - 'memory': int(size.ram), - 'cores': cores, - 'bandwidth': int(size.bandwidth), - 'ip_version': kwargs.get('inet_family', 4), + "datacenter_id": dc_id, + "hostname": name, + "memory": int(size.ram), + "cores": cores, + "bandwidth": int(size.bandwidth), + "ip_version": inet_family, } + if login and password: + vm_spec.update({"login": login, "password": password}) # TODO : use NodeAuthPassword + if keypair_ids: + vm_spec["keys"] = keypair_ids + # Call create_from helper api. Return 3 operations : disk_create, # iface_create,vm_create - (op_disk, op_iface, op_vm) = self.connection.request( - 'hosting.vm.create_from', - vm_spec, disk_spec, src_disk_id + op_disk, op_iface, op_vm = self.connection.request( + "hosting.vm.create_from", vm_spec, disk_spec, src_disk_id ).object # We wait for vm_create to finish - if self._wait_operation(op_vm['id']): + if self._wait_operation(op_vm["id"]): # after successful operation, get ip information # thru first interface - node = self._node_info(op_vm['vm_id']) - ifaces = node.get('ifaces') + node = self._node_info(op_vm["vm_id"]) + ifaces = node.get("ifaces") if len(ifaces) > 0: - ips = ifaces[0].get('ips') + ips = ifaces[0].get("ips") if len(ips) > 0: - node['ip'] = ips[0]['ip'] + node["ip"] = ips[0]["ip"] return self._to_node(node) return None def _to_image(self, img): - return NodeImage( - id=img['disk_id'], - name=img['label'], - driver=self.connection.driver - ) + return NodeImage(id=img["disk_id"], name=img["label"], driver=self.connection.driver) def list_images(self, location=None): + """ + Return a list of image objects. + + :keyword location: Which data center to filter a images in. + :type location: :class:`NodeLocation` + + :return: List of GCENodeImage objects + :rtype: ``list`` of :class:`GCENodeImage` + """ try: if location: - filtering = {'datacenter_id': int(location.id)} + filtering = {"datacenter_id": int(location.id)} else: filtering = {} - images = self.connection.request('hosting.image.list', filtering) + images = self.connection.request("hosting.image.list", filtering) return [self._to_image(i) for i in images.object] - except Exception: - e = sys.exc_info()[1] + except Exception as e: raise GandiException(1011, e) def _to_size(self, id, size): return NodeSize( id=id, - name='%s cores' % id, - ram=size['memory'], - disk=size['disk'], - bandwidth=size['bandwidth'], - price=(self._get_size_price(size_id='1') * id), + name="%s cores" % id, + ram=size["memory"], + disk=size["disk"], + bandwidth=size["bandwidth"], + price=(self._get_size_price(size_id="1") * id), driver=self.connection.driver, ) def _instance_type_to_size(self, instance): return NodeSize( - id=instance['id'], - name=instance['name'], - ram=instance['memory'], - disk=instance['disk'], - bandwidth=instance['bandwidth'], - price=self._get_size_price(size_id=instance['id']), + id=instance["id"], + name=instance["name"], + ram=instance["memory"], + disk=instance["disk"], + bandwidth=instance["bandwidth"], + price=self._get_size_price(size_id=instance["id"]), driver=self.connection.driver, ) def list_instance_type(self, location=None): - return [self._instance_type_to_size(instance) - for name, instance in INSTANCE_TYPES.items()] + return [self._instance_type_to_size(instance) for name, instance in INSTANCE_TYPES.items()] def list_sizes(self, location=None): - account = self.connection.request('hosting.account.info').object - if account.get('rating_enabled'): + """ + Return a list of sizes (machineTypes) in a zone. + + :keyword location: Which data center to filter a sizes in. + :type location: :class:`NodeLocation` or ``None`` + + :return: List of NodeSize objects + :rtype: ``list`` of :class:`NodeSize` + """ + account = self.connection.request("hosting.account.info").object + if account.get("rating_enabled"): # This account use new rating model return self.list_instance_type(location) # Look for available shares, and return a list of share_definition - available_res = account['resources']['available'] + available_res = account["resources"]["available"] - if available_res['shares'] == 0: + if available_res["shares"] == 0: return None else: - share_def = account['share_definition'] - available_cores = available_res['cores'] + share_def = account["share_definition"] + available_cores = available_res["cores"] # 0.75 core given when creating a server max_core = int(available_cores + 0.75) shares = [] - if available_res['servers'] < 1: + if available_res["servers"] < 1: # No server quota, no way return shares for i in range(1, max_core + 1): share = {id: i} share_is_available = True - for k in ['memory', 'disk', 'bandwidth']: + for k in ["memory", "disk", "bandwidth"]: if share_def[k] * i > available_res[k]: # We run out for at least one resource inside share_is_available = False @@ -355,49 +448,100 @@ def list_sizes(self, location=None): return shares def _to_loc(self, loc): - return NodeLocation( - id=loc['id'], - name=loc['name'], - country=loc['country'], - driver=self - ) + return NodeLocation(id=loc["id"], name=loc["dc_code"], country=loc["country"], driver=self) def list_locations(self): - res = self.connection.request('hosting.datacenter.list') - return [self._to_loc(l) for l in res.object] + """ + Return a list of locations (datacenters). + + :return: List of NodeLocation objects + :rtype: ``list`` of :class:`NodeLocation` + """ + res = self.connection.request("hosting.datacenter.list") + return [self._to_loc(loc) for loc in res.object] def list_volumes(self): """ + Return a list of volumes. + :return: A list of volume objects. :rtype: ``list`` of :class:`StorageVolume` """ - res = self.connection.request('hosting.disk.list', {}) + res = self.connection.request("hosting.disk.list", {}) return self._to_volumes(res.object) + def ex_get_volume(self, volume_id): + """ + Return a Volume object based on a volume ID. + + :param volume_id: The ID of the volume + :type volume_id: ``int`` + + :return: A StorageVolume object for the volume + :rtype: :class:`StorageVolume` + """ + res = self.connection.request("hosting.disk.info", volume_id) + return self._to_volume(res.object) + def create_volume(self, size, name, location=None, snapshot=None): + """ + Create a volume (disk). + + :param size: Size of volume to create (in GB). + :type size: ``int`` + + :param name: Name of volume to create + :type name: ``str`` + + :keyword location: Location (zone) to create the volume in + :type location: :class:`NodeLocation` or ``None`` + + :keyword snapshot: Snapshot to create image from + :type snapshot: :class:`Snapshot` + + :return: Storage Volume object + :rtype: :class:`StorageVolume` + """ disk_param = { - 'name': name, - 'size': int(size), - 'datacenter_id': int(location.id) + "name": name, + "size": int(size), + "datacenter_id": int(location.id), } if snapshot: - op = self.connection.request('hosting.disk.create_from', - disk_param, int(snapshot.id)) + op = self.connection.request("hosting.disk.create_from", disk_param, int(snapshot.id)) else: - op = self.connection.request('hosting.disk.create', disk_param) - if self._wait_operation(op.object['id']): - disk = self._volume_info(op.object['disk_id']) + op = self.connection.request("hosting.disk.create", disk_param) + if self._wait_operation(op.object["id"]): + disk = self._volume_info(op.object["disk_id"]) return self._to_volume(disk) return None def attach_volume(self, node, volume, device=None): - op = self.connection.request('hosting.vm.disk_attach', - int(node.id), int(volume.id)) - if self._wait_operation(op.object['id']): + """ + Attach a volume to a node. + + :param node: The node to attach the volume to + :type node: :class:`Node` + + :param volume: The volume to attach. + :type volume: :class:`StorageVolume` + + :keyword device: Not used in this cloud. + :type device: ``None`` + + :return: True if successful + :rtype: ``bool`` + """ + op = self.connection.request("hosting.vm.disk_attach", int(node.id), int(volume.id)) + if self._wait_operation(op.object["id"]): return True return False - def detach_volume(self, node, volume): + def detach_volume( + self, + volume, + node=None, + ): """ Detaches a volume from a node. @@ -409,44 +553,46 @@ def detach_volume(self, node, volume): :rtype: ``bool`` """ - op = self.connection.request('hosting.vm.disk_detach', - int(node.id), int(volume.id)) - if self._wait_operation(op.object['id']): + op = self.connection.request("hosting.vm.disk_detach", int(node.id), int(volume.id)) + if self._wait_operation(op.object["id"]): return True return False def destroy_volume(self, volume): - op = self.connection.request('hosting.disk.delete', int(volume.id)) - if self._wait_operation(op.object['id']): + """ + Destroy a volume. + + :param volume: Volume object to destroy + :type volume: :class:`StorageVolume` + + :return: True if successful + :rtype: ``bool`` + """ + op = self.connection.request("hosting.disk.delete", int(volume.id)) + if self._wait_operation(op.object["id"]): return True return False def _to_iface(self, iface): ips = [] - for ip in iface.get('ips', []): + for ip in iface.get("ips", []): new_ip = IPAddress( - ip['id'], - NODE_STATE_MAP.get( - ip['state'], - NodeState.UNKNOWN - ), - ip['ip'], + ip["id"], + NODE_STATE_MAP.get(ip["state"], NodeState.UNKNOWN), + ip["ip"], self.connection.driver, - version=ip.get('version'), - extra={'reverse': ip['reverse']} + version=ip.get("version"), + extra={"reverse": ip["reverse"]}, ) ips.append(new_ip) return NetworkInterface( - iface['id'], - NODE_STATE_MAP.get( - iface['state'], - NodeState.UNKNOWN - ), + iface["id"], + NODE_STATE_MAP.get(iface["state"], NodeState.UNKNOWN), mac_address=None, driver=self.connection.driver, ips=ips, - node_id=iface.get('vm_id'), - extra={'bandwidth': iface['bandwidth']}, + node_id=iface.get("vm_id"), + extra={"bandwidth": iface["bandwidth"]}, ) def _to_ifaces(self, ifaces): @@ -458,24 +604,20 @@ def ex_list_interfaces(self): :rtype: ``list`` of :class:`GandiNetworkInterface` """ - ifaces = self.connection.request('hosting.iface.list').object - ips = self.connection.request('hosting.ip.list').object + ifaces = self.connection.request("hosting.iface.list").object + ips = self.connection.request("hosting.ip.list").object for iface in ifaces: - iface['ips'] = list( - filter(lambda i: i['iface_id'] == iface['id'], ips)) + iface["ips"] = list(filter(lambda i: i["iface_id"] == iface["id"], ips)) return self._to_ifaces(ifaces) def _to_disk(self, element): disk = Disk( - id=element['id'], - state=NODE_STATE_MAP.get( - element['state'], - NodeState.UNKNOWN - ), - name=element['name'], + id=element["id"], + state=NODE_STATE_MAP.get(element["state"], NodeState.UNKNOWN), + name=element["name"], driver=self.connection.driver, - size=element['size'], - extra={'can_snapshot': element['can_snapshot']} + size=element["size"], + extra={"can_snapshot": element["can_snapshot"]}, ) return disk @@ -488,7 +630,7 @@ def ex_list_disks(self): :rtype: ``list`` of :class:`GandiDisk` """ - res = self.connection.request('hosting.disk.list', {}) + res = self.connection.request("hosting.disk.list", {}) return self._to_disks(res.object) def ex_node_attach_disk(self, node, disk): @@ -503,9 +645,8 @@ def ex_node_attach_disk(self, node, disk): :rtype: ``bool`` """ - op = self.connection.request('hosting.vm.disk_attach', - int(node.id), int(disk.id)) - if self._wait_operation(op.object['id']): + op = self.connection.request("hosting.vm.disk_attach", int(node.id), int(disk.id)) + if self._wait_operation(op.object["id"]): return True return False @@ -521,9 +662,8 @@ def ex_node_detach_disk(self, node, disk): :rtype: ``bool`` """ - op = self.connection.request('hosting.vm.disk_detach', - int(node.id), int(disk.id)) - if self._wait_operation(op.object['id']): + op = self.connection.request("hosting.vm.disk_detach", int(node.id), int(disk.id)) + if self._wait_operation(op.object["id"]): return True return False @@ -534,15 +674,13 @@ def ex_node_attach_interface(self, node, iface): :param node: Node which should be used :type node: :class:`Node` - :param iface: Network interface which should be used :type iface: :class:`GandiNetworkInterface` :rtype: ``bool`` """ - op = self.connection.request('hosting.vm.iface_attach', - int(node.id), int(iface.id)) - if self._wait_operation(op.object['id']): + op = self.connection.request("hosting.vm.iface_attach", int(node.id), int(iface.id)) + if self._wait_operation(op.object["id"]): return True return False @@ -553,15 +691,13 @@ def ex_node_detach_interface(self, node, iface): :param node: Node which should be used :type node: :class:`Node` - :param iface: Network interface which should be used :type iface: :class:`GandiNetworkInterface` :rtype: ``bool`` """ - op = self.connection.request('hosting.vm.iface_detach', - int(node.id), int(iface.id)) - if self._wait_operation(op.object['id']): + op = self.connection.request("hosting.vm.iface_detach", int(node.id), int(iface.id)) + if self._wait_operation(op.object["id"]): return True return False @@ -577,17 +713,17 @@ def ex_snapshot_disk(self, disk, name=None): :rtype: ``bool`` """ - if not disk.extra.get('can_snapshot'): - raise GandiException(1021, 'Disk %s can\'t snapshot' % disk.id) + if not disk.extra.get("can_snapshot"): + raise GandiException(1021, "Disk %s can't snapshot" % disk.id) if not name: - suffix = datetime.today().strftime('%Y%m%d') - name = 'snap_%s' % (suffix) + suffix = datetime.today().strftime("%Y%m%d") + name = "snap_%s" % (suffix) op = self.connection.request( - 'hosting.disk.create_from', - {'name': name, 'type': 'snapshot', }, + "hosting.disk.create_from", + {"name": name, "type": "snapshot"}, int(disk.id), ) - if self._wait_operation(op.object['id']): + if self._wait_operation(op.object["id"]): return True return False @@ -608,12 +744,78 @@ def ex_update_disk(self, disk, new_size=None, new_name=None): """ params = {} if new_size: - params.update({'size': new_size}) + params.update({"size": new_size}) if new_name: - params.update({'name': new_name}) - op = self.connection.request('hosting.disk.update', - int(disk.id), - params) - if self._wait_operation(op.object['id']): + params.update({"name": new_name}) + op = self.connection.request("hosting.disk.update", int(disk.id), params) + if self._wait_operation(op.object["id"]): return True return False + + def _to_key_pair(self, data): + key_pair = KeyPair( + name=data["name"], + fingerprint=data["fingerprint"], + public_key=data.get("value", None), + private_key=data.get("privatekey", None), + driver=self, + extra={"id": data["id"]}, + ) + return key_pair + + def _to_key_pairs(self, data): + return [self._to_key_pair(k) for k in data] + + def list_key_pairs(self): + """ + List registered key pairs. + + :return: A list of key par objects. + :rtype: ``list`` of :class:`libcloud.compute.base.KeyPair` + """ + kps = self.connection.request("hosting.ssh.list").object + return self._to_key_pairs(kps) + + def get_key_pair(self, name): + """ + Retrieve a single key pair. + + :param name: Name of the key pair to retrieve. + :type name: ``str`` + + :rtype: :class:`.KeyPair` + """ + filter_params = {"name": name} + kps = self.connection.request("hosting.ssh.list", filter_params).object + return self._to_key_pair(kps[0]) + + def import_key_pair_from_string(self, name, key_material): + """ + Create a new key pair object. + + :param name: Key pair name. + :type name: ``str`` + + :param key_material: Public key material. + :type key_material: ``str`` + + :return: Imported key pair object. + :rtype: :class:`.KeyPair` + """ + params = {"name": name, "value": key_material} + kp = self.connection.request("hosting.ssh.create", params).object + return self._to_key_pair(kp) + + def delete_key_pair(self, key_pair): + """ + Delete an existing key pair. + + :param key_pair: Key pair object or ID. + :type key_pair: :class.KeyPair` or ``int`` + + :return: True of False based on success of Keypair deletion + :rtype: ``bool`` + """ + key_id = key_pair if isinstance(key_pair, int) else key_pair.extra["id"] + success = self.connection.request("hosting.ssh.delete", key_id).object + return success diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py index 666f1c1a73..3c81b7c76a 100644 --- a/libcloud/compute/drivers/gce.py +++ b/libcloud/compute/drivers/gce.py @@ -12,30 +12,42 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + """ Module for Google Compute Engine Driver. """ -from __future__ import with_statement -import datetime -import time import sys - -from libcloud.common.google import GoogleResponse -from libcloud.common.google import GoogleBaseConnection -from libcloud.common.google import GoogleBaseError -from libcloud.common.google import ResourceNotFoundError -from libcloud.common.google import ResourceExistsError -from libcloud.common.types import ProviderError - -from libcloud.compute.base import Node, NodeDriver, NodeImage, NodeLocation -from libcloud.compute.base import NodeSize, StorageVolume, VolumeSnapshot -from libcloud.compute.base import UuidMixin -from libcloud.compute.providers import Provider +import time +import datetime +import itertools + +from libcloud.pricing import get_pricing +from libcloud.common.base import LazyObject +from libcloud.common.types import LibcloudError +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + UuidMixin, + NodeDriver, + NodeLocation, + StorageVolume, + VolumeSnapshot, +) +from libcloud.common.google import ( + GoogleResponse, + GoogleBaseError, + ResourceExistsError, + GoogleBaseConnection, + ResourceNotFoundError, + GoogleOAuth2Credential, +) from libcloud.compute.types import NodeState from libcloud.utils.iso8601 import parse_date +from libcloud.compute.providers import Provider -API_VERSION = 'v1' +API_VERSION = "v1" DEFAULT_TASK_COMPLETION_TIMEOUT = 180 @@ -52,10 +64,11 @@ def timestamp_to_datetime(timestamp): """ # We remove timezone offset and microseconds (Python 2.5 strptime doesn't # support %f) - ts = datetime.datetime.strptime(timestamp[:-10], '%Y-%m-%dT%H:%M:%S') + ts = datetime.datetime.strptime(timestamp[:-10], "%Y-%m-%dT%H:%M:%S") tz_hours = int(timestamp[-5:-3]) - tz_mins = int(timestamp[-2:]) * int(timestamp[-6:-5] + '1') + tz_mins = int(timestamp[-2:]) * int(timestamp[-6:-5] + "1") tz_delta = datetime.timedelta(hours=tz_hours, minutes=tz_mins) + return ts + tz_delta @@ -64,40 +77,377 @@ class GCEResponse(GoogleResponse): class GCEConnection(GoogleBaseConnection): - """Connection class for the GCE driver.""" - host = 'www.googleapis.com' + """ + Connection class for the GCE driver. + + GCEConnection extends :class:`google.GoogleBaseConnection` for 3 reasons: + 1. modify request_path for GCE URI. + 2. Implement gce_params functionality described below. + 3. Add request_aggregated_items method for making aggregated API calls. + + If the parameter gce_params is set to a dict prior to calling request(), + the URL parameters will be updated to include those key/values FOR A + SINGLE REQUEST. If the response contains a nextPageToken, + gce_params['pageToken'] will be set to its value. This can be used to + implement paging in list: + + >>> params, more_results = {'maxResults': 2}, True + >>> while more_results: + ... driver.connection.gce_params=params + ... driver.ex_list_urlmaps() + ... more_results = 'pageToken' in params + ... + [, ] + [] + """ + + host = "www.googleapis.com" responseCls = GCEResponse - def __init__(self, user_id, key, secure, auth_type=None, - credential_file=None, project=None, **kwargs): - super(GCEConnection, self).__init__(user_id, key, secure=secure, - auth_type=auth_type, - credential_file=credential_file, - **kwargs) - self.request_path = '/compute/%s/projects/%s' % (API_VERSION, - project) + def __init__( + self, + user_id, + key, + secure, + auth_type=None, + credential_file=None, + project=None, + **kwargs, + ): + super().__init__( + user_id, + key, + secure=secure, + auth_type=auth_type, + credential_file=credential_file, + **kwargs, + ) + self.request_path = "/compute/{}/projects/{}".format(API_VERSION, project) + self.gce_params = None + + def pre_connect_hook(self, params, headers): + """ + Update URL parameters with values from self.gce_params. + + @inherits: :class:`GoogleBaseConnection.pre_connect_hook` + """ + params, headers = super().pre_connect_hook(params, headers) + + if self.gce_params: + params.update(self.gce_params) + + return params, headers + + def paginated_request(self, *args, **kwargs): + """ + Generic function to create a paginated request to any API call + not only aggregated or zone ones as request_aggregated_items. + + @inherits: :class:`GoogleBaseConnection.request` + """ + more_results = True + items = [] + max_results = kwargs["max_results"] if "max_results" in kwargs else 500 + params = {"maxResults": max_results} + + while more_results: + self.gce_params = params + response = self.request(*args, **kwargs) + items.extend(response.object.get("items", [])) + more_results = "pageToken" in params + + return {"items": items} + + def request(self, *args, **kwargs): + """ + Perform request then do GCE-specific processing of URL params. + + @inherits: :class:`GoogleBaseConnection.request` + """ + response = super().request(*args, **kwargs) + + # If gce_params has been set, then update the pageToken with the + # nextPageToken so it can be used in the next request. + + if self.gce_params: + if "nextPageToken" in response.object: + self.gce_params["pageToken"] = response.object["nextPageToken"] + elif "pageToken" in self.gce_params: + del self.gce_params["pageToken"] + self.gce_params = None + + return response + + def request_aggregated_items(self, api_name, zone=None): + """ + Perform request(s) to obtain all results from 'api_name'. + + This method will make requests to the aggregated 'api_name' until + all results are received. It will then, through a helper function, + combine all results and return a single 'items' dictionary. + + :param api_name: Name of API to call. Consult API docs + for valid names. + :type api_name: ``str`` + + :param zone: Optional zone to use. + :type zone: :class:`GCEZone` + + :return: dict in the format of the API response. + format: { 'items': {'key': {api_name: []}} } + ex: { 'items': {'zones/us-central1-a': {disks: []}} } + :rtype: ``dict`` + """ + + if zone: + request_path = "/zones/{}/{}".format(zone.name, api_name) + else: + request_path = "/aggregated/%s" % (api_name) + + api_responses = [] + + params = {"maxResults": 500} + more_results = True + + while more_results: + self.gce_params = params + response = self.request(request_path, method="GET").object + + if "items" in response: + if zone: + # Special case when we are handling pagination for a + # specific zone + items = response["items"] + response["items"] = {"zones/%s" % (zone): {api_name: items}} + api_responses.append(response) + more_results = "pageToken" in params + + return self._merge_response_items(api_name, api_responses) + + def _merge_response_items(self, list_name, response_list): + """ + Take a list of API responses ("item"-portion only) and combine them. + + Helper function to combine multiple aggregated responses into a single + dictionary that resembles an API response. + + Note: keys that don't have a 'list_name" key (including warnings) + are omitted. + + :param list_name: Name of list in dict. Practically, this is + the name of the API called (e.g. 'disks'). + :type list_name: ``str`` + + :param response_list: list of API responses (e.g. resp['items']). + Each entry in the list is the result of a + single API call. Expected format is: + [ { items: { + key1: { api_name:[]}, + key2: { api_name:[]} + }}, ... ] + :type response_list: ``dict`` + + :return: dict in the format of: + { items: {key: {api_name:[]}, key2: {api_name:[]}} } + ex: { items: { + 'us-east1-a': {'disks': []}, + 'us-east1-b': {'disks': []} + }} + :rtype: ``dict`` + """ + merged_items = {} + + for resp in response_list: + # example k would be a zone or region name + # example v would be { "disks" : [], "otherkey" : "..." } + + for k, v in resp.get("items", {}).items(): + if list_name in v: + merged_items.setdefault(k, {}).setdefault(list_name, []) + # Combine the list with the existing list. + merged_items[k][list_name] += v[list_name] + + return {"items": merged_items} + + +class GCEList: + """ + An Iterator that wraps list functions to provide additional features. + + GCE enforces a limit on the number of objects returned by a list operation, + so users with more than 500 objects of a particular type will need to use + filter(), page() or both. + >>> l=GCEList(driver, driver.ex_list_urlmaps) + >>> for sublist in l.filter('name eq ...-map').page(1): + ... sublist + ... + [] + [] -class GCELicense(UuidMixin): + One can create a GCEList manually, but it's slightly easier to use the + ex_list() method of :class:`GCENodeDriver`. + """ + + def __init__(self, driver, list_fn, **kwargs): + """ + :param driver: An initialized :class:``GCENodeDriver`` + :type driver: :class:``GCENodeDriver`` + + :param list_fn: A bound list method from :class:`GCENodeDriver`. + :type list_fn: ``instancemethod`` + """ + self.driver = driver + self.list_fn = list_fn + self.kwargs = kwargs + self.params = {} + + def __iter__(self): + list_fn = self.list_fn + more_results = True + + while more_results: + self.driver.connection.gce_params = self.params + yield list_fn(**self.kwargs) + more_results = "pageToken" in self.params + + def __repr__(self): + return ''.format( + self.list_fn.__name__, + repr(self.params), + ) + + def filter(self, expression): + """ + Filter results of a list operation. + + GCE supports server-side filtering of resources returned by a list + operation. Syntax of the filter expression is fully described in the + GCE API reference doc, but in brief it is:: + + FIELD_NAME COMPARISON_STRING LITERAL_STRING + + where FIELD_NAME is the resource's property name, COMPARISON_STRING is + 'eq' or 'ne', and LITERAL_STRING is a regular expression in RE2 syntax. + + >>> for sublist in l.filter('name eq ...-map'): + ... sublist + ... + [, \ + ] + + API reference: https://cloud.google.com/compute/docs/reference/latest/ + RE2 syntax: https://github.com/google/re2/blob/master/doc/syntax.txt + + :param expression: Filter expression described above. + :type expression: ``str`` + + :return: This :class:`GCEList` instance + :rtype: :class:`GCEList` + """ + self.params["filter"] = expression + + return self + + def page(self, max_results=500): + """ + Limit the number of results by each iteration. + + This implements the paging functionality of the GCE list methods and + returns this GCEList instance so that results can be chained: + + >>> for sublist in GCEList(driver, driver.ex_list_urlmaps).page(2): + ... sublist + ... + [, \ + ] + [] + + :keyword max_results: Maximum number of results to return per + iteration. Defaults to the GCE default of 500. + :type max_results: ``int`` + + :return: This :class:`GCEList` instance + :rtype: :class:`GCEList` + """ + self.params["maxResults"] = max_results + + return self + + +class GCELicense(UuidMixin, LazyObject): """A GCE License used to track software usage in GCE nodes.""" - def __init__(self, id, name, driver, charges_use_fee, extra=None): - self.id = str(id) + + def __init__(self, name, project, driver): + UuidMixin.__init__(self) + self.id = name self.name = name + self.project = project self.driver = driver - self.charges_use_fee = charges_use_fee - self.extra = extra or {} - UuidMixin.__init__(self) + self.charges_use_fee = None # init in _request + self.extra = None # init in _request + + self._request() + + def _request(self): + # TODO(crunkleton@google.com): create new connection? or make + # connection thread-safe? Saving, modifying, and restoring + # driver.connection.request_path is really hacky and thread-unsafe. + saved_request_path = self.driver.connection.request_path + try: + new_request_path = saved_request_path.replace(self.driver.project, self.project) + self.driver.connection.request_path = new_request_path + + request = "/global/licenses/%s" % self.name + response = self.driver.connection.request(request, method="GET").object + except Exception: + raise + finally: + # Restore the connection request_path + self.driver.connection.request_path = saved_request_path + + self.extra = { + "selfLink": response.get("selfLink"), + "kind": response.get("kind"), + } + self.charges_use_fee = response["chargesUseFee"] def destroy(self): - raise ProviderError("Can not destroy a License resource.") + raise LibcloudError("Can not destroy a License resource.") def __repr__(self): - return '' % ( - self.id, self.name, self.charges_use_fee) + return ''.format( + self.id, + self.name, + self.charges_use_fee, + ) class GCEDiskType(UuidMixin): """A GCE DiskType resource.""" + + def __init__(self, id, name, zone, driver, extra=None): + self.id = str(id) + self.name = name + self.zone = zone + self.driver = driver + self.extra = extra + UuidMixin.__init__(self) + + def destroy(self): + raise LibcloudError("Can not destroy a DiskType resource.") + + def __repr__(self): + return ''.format( + self.id, + self.name, + self.zone, + ) + + +class GCEAcceleratorType(UuidMixin): + """A GCE AcceleratorType resource.""" + def __init__(self, id, name, zone, driver, extra=None): self.id = str(id) self.name = name @@ -107,15 +457,19 @@ def __init__(self, id, name, zone, driver, extra=None): UuidMixin.__init__(self) def destroy(self): - raise ProviderError("Can not destroy a DiskType resource.") + raise LibcloudError("Can not destroy an AcceleratorType resource.") def __repr__(self): - return '' % ( - self.id, self.name, self.zone) + return ''.format( + self.id, + self.name, + self.zone, + ) class GCEAddress(UuidMixin): """A GCE Static address.""" + def __init__(self, id, name, address, region, driver, extra=None): self.id = str(id) self.name = name @@ -132,19 +486,119 @@ def destroy(self): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_destroy_address(address=self) def __repr__(self): - return '' % ( - self.id, self.name, self.address, - (hasattr(self.region, "name") and self.region.name or self.region)) + return ''.format( + self.id, + self.name, + self.address, + (hasattr(self.region, "name") and self.region.name or self.region), + ) + + +class GCEBackend(UuidMixin): + """A GCE Backend. Only used for creating Backend Services.""" + + def __init__( + self, + instance_group, + balancing_mode="UTILIZATION", + max_utilization=None, + max_rate=None, + max_rate_per_instance=None, + capacity_scaler=1, + description=None, + ): + if isinstance(instance_group, GCEInstanceGroup): + self.instance_group = instance_group + elif isinstance(instance_group, GCEInstanceGroupManager): + self.instance_group = instance_group.instance_group + else: + raise ValueError( + "instance_group must be of type GCEInstanceGroup" + "or of type GCEInstanceGroupManager" + ) + + self.instance_group = instance_group + self.balancing_mode = balancing_mode + self.max_utilization = max_utilization + self.max_rate = max_rate + self.max_rate_per_instance = max_rate_per_instance + self.capacity_scaler = capacity_scaler + + # 'id' and 'name' aren't actually used or provided by the GCE API. + # We create them for convenience. + self.id = self._gen_id() + self.name = self.id + + self.description = description or self.name + UuidMixin.__init__(self) + + def _gen_id(self): + """ + Use the Instance Group information to fill in name and id fields. + + :return: id in the format of: + ZONE/instanceGroups/INSTANCEGROUPNAME + Ex: us-east1-c/instanceGroups/my-instance-group + :rtype: ``str`` + """ + zone_name = self.instance_group.zone.name + + return "{}/instanceGroups/{}".format(zone_name, self.instance_group.name) + + def to_backend_dict(self): + """ + Returns dict formatted for inclusion in Backend Service Request. + + :return: dict formatted as a list entry for Backend Service 'backend'. + :rtype: ``dict`` + """ + d = {} + d["group"] = self.instance_group.extra["selfLink"] + + if self.balancing_mode: + d["balancingMode"] = self.balancing_mode + + if self.max_utilization: + d["maxUtilization"] = self.max_utilization + + if self.max_rate: + d["maxRate"] = self.max_rate + + if self.max_rate_per_instance: + d["maxRatePerInstance"] = self.max_rate_per_instance + + if self.capacity_scaler: + d["capacityScaler"] = self.capacity_scaler + + return d + + def __repr__(self): + return ''.format( + self.id, + self.balancing_mode, + ) class GCEBackendService(UuidMixin): """A GCE Backend Service.""" - def __init__(self, id, name, backends, healthchecks, port, port_name, - protocol, timeout, driver, extra=None): + def __init__( + self, + id, + name, + backends, + healthchecks, + port, + port_name, + protocol, + timeout, + driver, + extra=None, + ): self.id = str(id) self.name = name self.backends = backends or [] @@ -158,8 +612,7 @@ def __init__(self, id, name, backends, healthchecks, port, port_name, UuidMixin.__init__(self) def __repr__(self): - return '' % ( - self.id, self.name) + return ''.format(self.id, self.name) def destroy(self): """ @@ -168,37 +621,71 @@ def destroy(self): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_destroy_backendservice(backendservice=self) -class GCEFailedDisk(object): +class GCEFailedDisk: """Dummy Node object for disks that are not created.""" + def __init__(self, name, error, code): self.name = name self.error = error self.code = code def __repr__(self): - return '' % ( - self.name, self.code) + return ''.format(self.name, self.code) -class GCEFailedNode(object): +class GCEFailedNode: """Dummy Node object for nodes that are not created.""" + def __init__(self, name, error, code): self.name = name self.error = error self.code = code def __repr__(self): - return '' % ( - self.name, self.code) + return ''.format(self.name, self.code) + + +class GCEMultipleNodesTimeoutError(LibcloudError): + """ + Node creation timed out with some results still pending. + + ``nodes`` contains the known results, including :class:`GCEFailedNode` + objects when errors were ignored. ``pending_node_names`` identifies nodes + whose final state is unknown. These include nodes whose creation has not + started and nodes with operations still in progress, which may finish + creating after the timeout. + No resources are automatically deleted. + """ + + def __init__(self, timeout, nodes, pending_node_names, driver): + self.nodes = nodes + self.pending_node_names = pending_node_names + super().__init__( + "Timeout (%s sec) while waiting for multiple instances" % timeout, + driver=driver, + ) class GCEHealthCheck(UuidMixin): """A GCE Http Health Check class.""" - def __init__(self, id, name, path, port, interval, timeout, - unhealthy_threshold, healthy_threshold, driver, extra=None): + + def __init__( + self, + id, + name, + path, + port, + interval, + timeout, + unhealthy_threshold, + healthy_threshold, + driver, + extra=None, + ): self.id = str(id) self.name = name self.path = path @@ -218,6 +705,7 @@ def destroy(self): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_destroy_healthcheck(healthcheck=self) def update(self): @@ -227,24 +715,52 @@ def update(self): :return: Updated Healthcheck object :rtype: :class:`GCEHealthcheck` """ + return self.driver.ex_update_healthcheck(healthcheck=self) def __repr__(self): - return '' % ( - self.id, self.name, self.path, self.port) + return ''.format( + self.id, + self.name, + self.path, + self.port, + ) class GCEFirewall(UuidMixin): """A GCE Firewall rule class.""" - def __init__(self, id, name, allowed, network, source_ranges, source_tags, - target_tags, driver, extra=None): + + def __init__( + self, + id, + name, + allowed, + denied, + direction, + network, + source_ranges, + source_tags, + priority, + source_service_accounts, + target_service_accounts, + target_tags, + target_ranges, + driver, + extra=None, + ): self.id = str(id) self.name = name self.network = network self.allowed = allowed + self.denied = denied + self.direction = direction + self.priority = priority self.source_ranges = source_ranges self.source_tags = source_tags + self.source_service_accounts = source_service_accounts self.target_tags = target_tags + self.target_service_accounts = target_service_accounts + self.target_ranges = target_ranges self.driver = driver self.extra = extra UuidMixin.__init__(self) @@ -256,6 +772,7 @@ def destroy(self): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_destroy_firewall(firewall=self) def update(self): @@ -265,16 +782,19 @@ def update(self): :return: Updated Firewall object :rtype: :class:`GCEFirewall` """ + return self.driver.ex_update_firewall(firewall=self) def __repr__(self): - return '' % ( - self.id, self.name, self.network.name) + return ''.format( + self.id, + self.name, + self.network.name, + ) class GCEForwardingRule(UuidMixin): - def __init__(self, id, name, region, address, protocol, targetpool, driver, - extra=None): + def __init__(self, id, name, region, address, protocol, targetpool, driver, extra=None): self.id = str(id) self.name = name self.region = region @@ -294,17 +814,22 @@ def destroy(self): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_destroy_forwarding_rule(forwarding_rule=self) def __repr__(self): - return '' % ( - self.id, self.name, self.address) + return ''.format( + self.id, + self.name, + self.address, + ) class GCENodeImage(NodeImage): """A GCE Node Image class.""" + def __init__(self, id, name, driver, extra=None): - super(GCENodeImage, self).__init__(id, name, driver, extra=extra) + super().__init__(id, name, driver, extra=extra) def delete(self): """ @@ -313,10 +838,10 @@ def delete(self): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_delete_image(image=self) - def deprecate(self, replacement, state, deprecated=None, obsolete=None, - deleted=None): + def deprecate(self, replacement, state, deprecated=None, obsolete=None, deleted=None): """ Deprecate this image @@ -324,7 +849,7 @@ def deprecate(self, replacement, state, deprecated=None, obsolete=None, :type replacement: ``str`` or :class: `GCENodeImage` :param state: Deprecation state of this image. Possible values include - \'DELETED\', \'DEPRECATED\' or \'OBSOLETE\'. + \'ACTIVE\', \'DELETED\', \'DEPRECATED\' or \'OBSOLETE\'. :type state: ``str`` :param deprecated: RFC3339 timestamp to mark DEPRECATED @@ -339,18 +864,121 @@ def deprecate(self, replacement, state, deprecated=None, obsolete=None, :return: True if successful :rtype: ``bool`` """ - return self.driver.ex_deprecate_image(self, replacement, state, - deprecated, obsolete, deleted) + + return self.driver.ex_deprecate_image( + self, replacement, state, deprecated, obsolete, deleted + ) + + +class GCESslCertificate(UuidMixin): + """GCESslCertificate represents the SslCertificate resource.""" + + def __init__(self, id, name, certificate, driver, extra, private_key=None, description=None): + """ + :param name: Name of the resource. Provided by the client when the + resource is created. The name must be 1-63 characters + long, and comply with RFC1035. Specifically, the name + must be 1-63 characters long and match the regular + expression [a-z]([-a-z0-9]*[a-z0-9])? which means the + first character must be a lowercase letter, and all + following characters must be a dash, lowercase letter, + or digit, except the last character, which cannot be a + dash. + :type name: ``str`` + + :param certificate: A local certificate file. The certificate must + be in PEM format. The certificate chain must be + no greater than 5 certs long. The chain must + include at least one intermediate cert. + :type certificate: ``str`` + + :param private_key: A write-only private key in PEM format. Only + insert RPCs will include this field. + :type private_key: ``str`` + + :keyword description: An optional description of this resource. + Provide this property when you create the + resource. + :type description: ``str`` + + :keyword driver: An initialized :class: `GCENodeDriver` + :type driver: :class:`:class: `GCENodeDriver`` + + :keyword extra: A dictionary of extra information. + :type extra: ``:class: ``dict```` + + """ + + self.name = name + self.certificate = certificate + self.private_key = private_key + self.description = description + self.driver = driver + self.extra = extra + UuidMixin.__init__(self) + + def __repr__(self): + return '' % (self.name) + + def destroy(self): + """ + Destroy this SslCertificate. + + :return: Return True if successful. + :rtype: ``bool`` + """ + + return self.driver.ex_destroy_sslcertificate(sslcertificate=self) + + +class GCESubnetwork(UuidMixin): + """A GCE Subnetwork object class.""" + + def __init__(self, id, name, cidr, network, region, driver, extra=None): + self.id = str(id) + self.name = name + self.cidr = cidr + self.network = network + self.region = region + self.driver = driver + self.extra = extra + UuidMixin.__init__(self) + + def destroy(self): + """ + Destroy this subnetwork + + :return: True if successful + :rtype: ``bool`` + """ + + return self.driver.ex_destroy_subnetwork(self) + + def __repr__(self): + return '' % ( + self.id, + self.name, + self.region.name, + self.network.name, + self.cidr, + ) class GCENetwork(UuidMixin): """A GCE Network object class.""" + def __init__(self, id, name, cidr, driver, extra=None): self.id = str(id) self.name = name self.cidr = cidr self.driver = driver self.extra = extra + self.mode = "legacy" + self.subnetworks = [] + + if "mode" in extra and extra["mode"] != "legacy": + self.mode = extra["mode"] + self.subnetworks = extra["subnetworks"] UuidMixin.__init__(self) def destroy(self): @@ -360,17 +988,32 @@ def destroy(self): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_destroy_network(network=self) def __repr__(self): - return '' % ( - self.id, self.name, self.cidr) + return ''.format( + self.id, + self.name, + self.cidr, + self.mode, + ) class GCERoute(UuidMixin): """A GCE Route object class.""" - def __init__(self, id, name, dest_range, priority, network="default", - tags=None, driver=None, extra=None): + + def __init__( + self, + id, + name, + dest_range, + priority, + network="default", + tags=None, + driver=None, + extra=None, + ): self.id = str(id) self.name = name self.dest_range = dest_range @@ -388,24 +1031,31 @@ def destroy(self): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_destroy_route(route=self) def __repr__(self): - return '' % ( - self.id, self.name, self.dest_range, self.network.name) + network_name = getattr(self.network, "name", self.network) + + return ''.format( + self.id, + self.name, + self.dest_range, + network_name, + ) class GCENodeSize(NodeSize): """A GCE Node Size (MachineType) class.""" - def __init__(self, id, name, ram, disk, bandwidth, price, driver, - extra=None): + + def __init__(self, id, name, ram, disk, bandwidth, price, driver, extra=None): self.extra = extra - super(GCENodeSize, self).__init__(id, name, ram, disk, bandwidth, - price, driver, extra=extra) + super().__init__(id, name, ram, disk, bandwidth, price, driver, extra=extra) class GCEProject(UuidMixin): """GCE Project information.""" + def __init__(self, id, name, metadata, quotas, driver, extra=None): self.id = str(id) self.name = name @@ -422,9 +1072,9 @@ def set_common_instance_metadata(self, metadata=None, force=False): 'startup-script' for all nodes (instances). Passing in ``None`` for the 'metadata' parameter will clear out all common instance metadata *except* for 'sshKeys'. If you also want to - update 'sshKeys', set the 'force' paramater to ``True``. + update 'sshKeys', set the 'force' parameter to ``True``. - :param metadata: Dictionay of metadata. Can be either a standard + :param metadata: Dictionary of metadata. Can be either a standard python dictionary, or the format expected by GCE (e.g. {'items': [{'key': k1, 'value': v1}, ...}] :type metadata: ``dict`` or ``None`` @@ -439,7 +1089,8 @@ def set_common_instance_metadata(self, metadata=None, force=False): :return: True if successful :rtype: ``bool`` """ - return self.driver.ex_set_common_instance_metadata(self, metadata) + + return self.driver.ex_set_common_instance_metadata(metadata=metadata, force=force) def set_usage_export_bucket(self, bucket, prefix=None): """ @@ -461,15 +1112,15 @@ def set_usage_export_bucket(self, bucket, prefix=None): :return: True if successful :rtype: ``bool`` """ - return self.driver.ex_set_usage_export_bucket(self, bucket, prefix) + + return self.driver.ex_set_usage_export_bucket(bucket=bucket, prefix=prefix) def __repr__(self): - return '' % (self.id, self.name) + return ''.format(self.id, self.name) class GCERegion(UuidMixin): - def __init__(self, id, name, status, zones, quotas, deprecated, driver, - extra=None): + def __init__(self, id, name, status, zones, quotas, deprecated, driver, extra=None): self.id = str(id) self.name = name self.status = status @@ -481,16 +1132,17 @@ def __init__(self, id, name, status, zones, quotas, deprecated, driver, UuidMixin.__init__(self) def __repr__(self): - return '' % ( - self.id, self.name, self.status) + return ''.format( + self.id, + self.name, + self.status, + ) class GCESnapshot(VolumeSnapshot): - def __init__(self, id, name, size, status, driver, extra=None, - created=None): - self.name = name + def __init__(self, id, name, size, status, driver, extra=None, created=None): self.status = status - super(GCESnapshot, self).__init__(id, driver, size, extra, created) + super().__init__(id, driver, size, extra, created, name=name) class GCETargetHttpProxy(UuidMixin): @@ -503,8 +1155,7 @@ def __init__(self, id, name, urlmap, driver, extra=None): UuidMixin.__init__(self) def __repr__(self): - return '' % ( - self.id, self.name) + return ''.format(self.id, self.name) def destroy(self): """ @@ -513,37 +1164,563 @@ def destroy(self): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_destroy_targethttpproxy(targethttpproxy=self) -class GCETargetInstance(UuidMixin): - def __init__(self, id, name, zone, node, driver, extra=None): - self.id = str(id) +class GCETargetHttpsProxy(UuidMixin): + """GCETargetHttpsProxy represents the TargetHttpsProxy resource.""" + + def __init__( + self, + id, + name, + description=None, + sslcertificates=None, + urlmap=None, + driver=None, + extra=None, + ): + """ + :param name: Name of the resource. Provided by the client when the + resource is created. The name must be 1-63 characters + long, and comply with RFC1035. Specifically, the name + must be 1-63 characters long and match the regular + expression [a-z]([-a-z0-9]*[a-z0-9])? which means the + first character must be a lowercase letter, and all + following characters must be a dash, lowercase letter, + or digit, except the last character, which cannot be a + dash. + :type name: ``str`` + + :param description: An optional description of this resource. + Provide this property when you create the + resource. + :type description: ``str`` + + :param sslcertificates: URLs to SslCertificate resources that are + used to authenticate connections between + users and the load balancer. Currently, + exactly one SSL certificate must be + specified. + :type sslcertificates: ``list`` of :class:`GCESslcertificates` + + :param urlmap: A fully-qualified or valid partial URL to the + UrlMap resource that defines the mapping from URL + to the BackendService. For example, the following + are all valid URLs for specifying a URL map: - ht + tps://www.googleapis.compute/v1/projects/project/gl + obal/urlMaps/url-map - + projects/project/global/urlMaps/url-map - + global/urlMaps/url-map + :type urlmap: :class:`GCEUrlMap` + + :keyword driver: An initialized :class: `GCENodeDriver` + :type driver: :class:`:class: `GCENodeDriver`` + + :keyword extra: A dictionary of extra information. + :type extra: ``:class: ``dict```` + + """ + self.name = name - self.zone = zone - self.node = node + self.description = description + self.sslcertificates = sslcertificates + self.urlmap = urlmap self.driver = driver self.extra = extra UuidMixin.__init__(self) - def destroy(self): - """ + def __repr__(self): + return '' % (self.name) + + def set_sslcertificates(self, sslcertificates): + """ + Set the SSL Certificates for this TargetHTTPSProxy + + :param sslcertificates: SSL Certificates to set. + :type sslcertificates: ``list`` of :class:`GCESslCertificate` + + :return: True if successful + :rtype: ``bool`` + """ + + return self.driver.ex_targethttpsproxy_set_sslcertificates( + targethttpsproxy=self, sslcertificates=sslcertificates + ) + + def set_urlmap(self, urlmap): + """ + Changes the URL map for TargetHttpsProxy. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param targethttpsproxy: Name of the TargetHttpsProxy resource + whose URL map is to be set. + :type targethttpsproxy: ``str`` + + :param urlmap: UrlMap to set. + :type urlmap: :class:`GCEUrlMap` + + :return: True + :rtype: ``bool`` + """ + + return self.driver.ex_targethttpsproxy_set_urlmap(targethttpsproxy=self, urlmap=urlmap) + + def destroy(self): + """ + Destroy this TargetHttpsProxy. + + :return: Return True if successful. + :rtype: ``bool`` + """ + + return self.driver.ex_destroy_targethttpsproxy(targethttpsproxy=self) + + +class GCETargetInstance(UuidMixin): + def __init__(self, id, name, zone, node, driver, extra=None): + self.id = str(id) + self.name = name + self.zone = zone + self.node = node + self.driver = driver + self.extra = extra + UuidMixin.__init__(self) + + def destroy(self): + """ Destroy this Target Instance :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_destroy_targetinstance(targetinstance=self) def __repr__(self): - return '' % ( - self.id, self.name, self.zone.name, - (hasattr(self.node, 'name') and self.node.name or self.node)) + return ''.format( + self.id, + self.name, + self.zone.name, + (hasattr(self.node, "name") and self.node.name or self.node), + ) + + +class GCEAutoscaler(UuidMixin): + """Represents a autoscaling policy object used to scale Instance Groups.""" + + def __init__(self, id, name, zone, target, policy, driver, extra=None): + self.id = str(id) + self.name = name + self.zone = zone + self.target = target + self.policy = policy + self.driver = driver + self.extra = extra + UuidMixin.__init__(self) + + def destroy(self): + """ + Destroy this Autoscaler. + + :return: True if successful + :rtype: ``bool`` + """ + + return self.driver.ex_destroy_autoscaler(autoscaler=self) + + def __repr__(self): + return ''.format( + self.id, + self.name, + self.zone.name, + self.target.name, + ) + + +class GCEInstanceTemplate(UuidMixin): + """Represents a machine configuration used in creating Instance Groups.""" + + def __init__(self, id, name, driver, extra=None): + self.id = str(id) + self.name = name + self.driver = driver + self.extra = extra + UuidMixin.__init__(self) + + def __repr__(self): + return ''.format( + self.id, + self.name, + self.extra["properties"].get("machineType", "UNKNOWN"), + ) + + def destroy(self): + """ + Destroy this InstanceTemplate. + + :return: Return True if successful. + :rtype: ``bool`` + """ + + return self.driver.ex_destroy_instancetemplate(instancetemplate=self) + + +class GCEInstanceGroup(UuidMixin): + """GCEInstanceGroup represents the InstanceGroup resource.""" + + def __init__( + self, + id, + name, + zone, + driver, + extra=None, + network=None, + subnetwork=None, + named_ports=None, + ): + """ + :param name: Required. The name of the instance group. The name + must be 1-63 characters long, and comply with RFC1035. + :type name: ``str`` + + :param zone: The URL of the zone where the instance group is + located. + :type zone: :class:`GCEZone` + + :param network: The URL of the network to which all instances in + the instance group belong. + :type network: :class:`GCENetwork` + + :param subnetwork: The URL of the subnetwork to which all instances + in the instance group belong. + :type subnetwork: :class:`GCESubnetwork` + + :param named_ports: Assigns a name to a port number. For example: + {name: "http", port: 80} This allows the + system to reference ports by the assigned name + instead of a port number. Named ports can also + contain multiple ports. For example: [{name: + "http", port: 80},{name: "http", port: 8080}] + Named ports apply to all instances in this + instance group. + :type named_ports: ``""`` + + """ + + self.name = name + self.zone = zone + self.network = network + self.subnetwork = subnetwork + self.named_ports = named_ports + self.driver = driver + self.extra = extra + UuidMixin.__init__(self) + + def __repr__(self): + return ''.format(self.name, self.zone.name) + + def destroy(self): + """ + Destroy this InstanceGroup. + + :return: Return True if successful. + :rtype: ``bool`` + """ + + return self.driver.ex_destroy_instancegroup(instancegroup=self) + + def add_instances(self, node_list): + """ + Adds a list of instances to the specified instance group. All of the + instances in the instance group must be in the same + network/subnetwork. Read Adding instances for more information. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param instancegroup: The Instance Group where you are + adding instances. + :type instancegroup: :class:``GCEInstanceGroup`` + + :param node_list: List of nodes to add. + :type node_list: ``list`` of :class:`Node` or ``list`` of + :class:`GCENode` + + :return: Return True if successful. + :rtype: ``bool`` + """ + + return self.driver.ex_instancegroup_add_instances(instancegroup=self, node_list=node_list) + + def list_instances(self): + """ + Lists the instances in the specified instance group. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + * https://www.googleapis.com/auth/compute.readonly + + :return: List of :class:`GCENode` objects. + :rtype: ``list`` of :class:`GCENode` objects. + """ + + return self.driver.ex_instancegroup_list_instances(instancegroup=self) + + def remove_instances(self, node_list): + """ + Removes one or more instances from the specified instance group, + but does not delete those instances. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param instancegroup: The Instance Group where you are + removng instances. + :type instancegroup: :class:``GCEInstanceGroup`` + + :param node_list: List of nodes to add. + :type node_list: ``list`` of :class:`Node` or ``list`` of + :class:`GCENode` + + :return: Return True if successful. + :rtype: ``bool`` + """ + + return self.driver.ex_instancegroup_remove_instances( + instancegroup=self, node_list=node_list + ) + + def set_named_ports(self, named_ports): + """ + Sets the named ports for the specified instance group. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param named_ports: Assigns a name to a port number. For example: + {name: "http", port: 80} This allows the + system to reference ports by the assigned name + instead of a port number. Named ports can also + contain multiple ports. For example: [{name: + "http", port: 80},{name: "http", port: 8080}] + Named ports apply to all instances in this + instance group. + :type named_ports: ``list`` of {'name': ``str``, 'port`: ``int``} + + :return: Return True if successful. + :rtype: ``bool`` + """ + + return self.driver.ex_instancegroup_set_named_ports( + instancegroup=self, named_ports=named_ports + ) + + +class GCEInstanceGroupManager(UuidMixin): + """ + GCE Instance Groups Manager class. + + Handles 'managed' Instance Groups. + For more information on Instance Groups, see: + https://cloud.google.com/compute/docs/instance-groups + """ + + def __init__(self, id, name, zone, size, template, instance_group, driver, extra=None): + """ + :param id: Internal identifier of Instance Group. Display only. + :type id: ``str`` + + :param name: The name of this Instance Group. + :type name: ``str`` + + :param zone: Zone in witch the Instance Group belongs + :type zone: :class: ``GCEZone`` + + :param size: Number of instances in this Instance Group. + :type size: ``int`` + + :param template: An initialized :class:``GCEInstanceTemplate`` + :type driver: :class:``GCEInstanceTemplate`` + + :param instance_group: An initialized :class:``GCEInstanceGroup`` + :type driver: :class:``GCEInstanceGroup`` + + :param driver: An initialized :class:``GCENodeDriver`` + :type driver: :class:``GCENodeDriver`` + + :param extra: A dictionary of extra information. + :type extra: ``dict`` + """ + self.id = str(id) + self.name = name + self.zone = zone + self.size = size or 0 + self.template = template + self.instance_group = instance_group + self.driver = driver + self.extra = extra + UuidMixin.__init__(self) + + def destroy(self): + """ + Destroy this Instance Group. Destroys all instances managed by the + Instance Group. + + :return: True if successful + :rtype: ``bool`` + """ + + return self.driver.ex_destroy_instancegroupmanager(manager=self) + + def list_managed_instances(self): + """ + Lists all of the instances in this managed instance group. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + * https://www.googleapis.com/auth/compute.readonly + + :return: ``list`` of ``dict`` containing instance URI and + currentAction. See + ex_instancegroupmanager_list_managed_instances for + more details. + :rtype: ``list`` + """ + + return self.driver.ex_instancegroupmanager_list_managed_instances(manager=self) + + def set_instancetemplate(self, instancetemplate): + """ + Set the Instance Template for this Instance Group. + + :param instancetemplate: Instance Template to set. + :type instancetemplate: :class:`GCEInstanceTemplate` + + :return: True if successful + :rtype: ``bool`` + """ + + return self.driver.ex_instancegroupmanager_set_instancetemplate( + manager=self, instancetemplate=instancetemplate + ) + + def recreate_instances(self): + """ + Recreate instances in a Managed Instance Group. + + :return: ``list`` of ``dict`` containing instance URI and + currentAction. See + ex_instancegroupmanager_list_managed_instances for + more details. + :rtype: ``list`` + """ + + return self.driver.ex_instancegroupmanager_recreate_instances(manager=self) + + def delete_instances(self, node_list): + """ + Removes one or more instances from the specified instance group, + and delete those instances. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param node_list: List of nodes to delete. + :type node_list: ``list`` of :class:`Node` or ``list`` of + :class:`GCENode` + + :return: Return True if successful. + :rtype: ``bool`` + """ + + return self.driver.ex_instancegroupmanager_delete_instances( + manager=self, node_list=node_list + ) + + def resize(self, size): + """ + Set the number of instances for this Instance Group. An increase in + num_instances will result in VMs being created. A decrease will result + in VMs being destroyed. + + :param size: Number to instances to resize to. + :type size: ``int`` + + :return: True if successful + :rtype: ``bool`` + """ + + return self.driver.ex_instancegroupmanager_resize(manager=self, size=size) + + def set_named_ports(self, named_ports): + """ + Sets the named ports for the instance group controlled by this manager. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param named_ports: Assigns a name to a port number. For example: + {name: "http", port: 80} This allows the + system to reference ports by the assigned name + instead of a port number. Named ports can also + contain multiple ports. For example: [{name: + "http", port: 80},{name: "http", port: 8080}] + Named ports apply to all instances in this + instance group. + :type named_ports: ``list`` of {'name': ``str``, 'port`: ``int``} + + :return: Return True if successful. + :rtype: ``bool`` + """ + + return self.driver.ex_instancegroup_set_named_ports( + instancegroup=self.instance_group, named_ports=named_ports + ) + + def set_autohealingpolicies(self, healthcheck, initialdelaysec): + """ + Sets the autohealing policies for the instance for the instance group + controlled by this manager. + + :param healthcheck: Healthcheck to add + :type healthcheck: :class:`GCEHealthCheck` + + :param initialdelaysec: The time to allow an instance to boot and + applications to fully start before the first + health check + :type initialdelaysec: ``int`` + + :return: Return True if successful. + :rtype: ``bool`` + """ + + return self.driver.ex_instancegroupmanager_set_autohealingpolicies( + manager=self, healthcheck=healthcheck, initialdelaysec=initialdelaysec + ) + + def __repr__(self): + return '' % ( + self.name, + self.zone.name, + self.size, + ) class GCETargetPool(UuidMixin): - def __init__(self, id, name, region, healthchecks, nodes, driver, - extra=None): + def __init__(self, id, name, region, healthchecks, nodes, driver, extra=None): self.id = str(id) self.name = name self.region = region @@ -563,6 +1740,7 @@ def add_node(self, node): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_targetpool_add_node(targetpool=self, node=node) def remove_node(self, node): @@ -575,8 +1753,8 @@ def remove_node(self, node): :return: True if successful :rtype: ``bool`` """ - return self.driver.ex_targetpool_remove_node(targetpool=self, - node=node) + + return self.driver.ex_targetpool_remove_node(targetpool=self, node=node) def add_healthcheck(self, healthcheck): """ @@ -588,8 +1766,8 @@ def add_healthcheck(self, healthcheck): :return: True if successful :rtype: ``bool`` """ - return self.driver.ex_targetpool_add_healthcheck( - targetpool=self, healthcheck=healthcheck) + + return self.driver.ex_targetpool_add_healthcheck(targetpool=self, healthcheck=healthcheck) def remove_healthcheck(self, healthcheck): """ @@ -601,8 +1779,10 @@ def remove_healthcheck(self, healthcheck): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_targetpool_remove_healthcheck( - targetpool=self, healthcheck=healthcheck) + targetpool=self, healthcheck=healthcheck + ) def set_backup_targetpool(self, backup_targetpool, failover_ratio=0.1): """ @@ -620,9 +1800,12 @@ def set_backup_targetpool(self, backup_targetpool, failover_ratio=0.1): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_targetpool_set_backup_targetpool( - targetpool=self, backup_targetpool=backup_targetpool, - failover_ratio=failover_ratio) + targetpool=self, + backup_targetpool=backup_targetpool, + failover_ratio=failover_ratio, + ) def get_health(self, node=None): """ @@ -635,6 +1818,7 @@ def get_health(self, node=None): :return: List of hashes of nodes and their respective health :rtype: ``list`` of ``dict`` """ + return self.driver.ex_targetpool_get_health(targetpool=self, node=node) def destroy(self): @@ -644,18 +1828,31 @@ def destroy(self): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_destroy_targetpool(targetpool=self) def __repr__(self): - return '' % ( - self.id, self.name, self.region.name) + return ''.format( + self.id, + self.name, + self.region.name, + ) class GCEUrlMap(UuidMixin): """A GCE URL Map.""" - def __init__(self, id, name, default_service, host_rules, path_matchers, - tests, driver, extra=None): + def __init__( + self, + id, + name, + default_service, + host_rules, + path_matchers, + tests, + driver, + extra=None, + ): self.id = str(id) self.name = name self.default_service = default_service @@ -667,8 +1864,7 @@ def __init__(self, id, name, default_service, host_rules, path_matchers, UuidMixin.__init__(self) def __repr__(self): - return '' % ( - self.id, self.name) + return ''.format(self.id, self.name) def destroy(self): """ @@ -677,20 +1873,20 @@ def destroy(self): :return: True if successful :rtype: ``bool`` """ + return self.driver.ex_destroy_urlmap(urlmap=self) class GCEZone(NodeLocation): """Subclass of NodeLocation to provide additional information.""" - def __init__(self, id, name, status, maintenance_windows, deprecated, - driver, extra=None): + + def __init__(self, id, name, status, maintenance_windows, deprecated, driver, extra=None): self.status = status self.maintenance_windows = maintenance_windows self.deprecated = deprecated self.extra = extra - country = name.split('-')[0] - super(GCEZone, self).__init__(id=str(id), name=name, country=country, - driver=driver) + country = name.split("-")[0] + super().__init__(id=str(id), name=name, country=country, driver=driver, extra=extra) @property def time_until_mw(self): @@ -698,6 +1894,7 @@ def time_until_mw(self): Returns the time until the next Maintenance Window as a datetime.timedelta object. """ + return self._get_time_until_mw() @property @@ -706,6 +1903,7 @@ def next_mw_duration(self): Returns the duration of the next Maintenance Window as a datetime.timedelta object. """ + return self._get_next_mw_duration() def _now(self): @@ -714,6 +1912,7 @@ def _now(self): Can be overridden in unittests. """ + return datetime.datetime.utcnow() def _get_next_maint(self): @@ -731,15 +1930,20 @@ def _get_next_maint(self): """ begin = None next_window = None + if not self.maintenance_windows: return None + if len(self.maintenance_windows) == 1: return self.maintenance_windows[0] + for mw in self.maintenance_windows: - begin_next = timestamp_to_datetime(mw['beginTime']) + begin_next = timestamp_to_datetime(mw["beginTime"]) + if (not begin) or (begin_next < begin): begin = begin_next next_window = mw + return next_window def _get_time_until_mw(self): @@ -751,10 +1955,12 @@ def _get_time_until_mw(self): :rtype: :class:`datetime.timedelta` or ``None`` """ next_window = self._get_next_maint() + if not next_window: return None now = self._now() - next_begin = timestamp_to_datetime(next_window['beginTime']) + next_begin = timestamp_to_datetime(next_window["beginTime"]) + return next_begin - now def _get_next_mw_duration(self): @@ -766,15 +1972,20 @@ def _get_next_mw_duration(self): :rtype: :class:`datetime.timedelta` or ``None`` """ next_window = self._get_next_maint() + if not next_window: return None - next_begin = timestamp_to_datetime(next_window['beginTime']) - next_end = timestamp_to_datetime(next_window['endTime']) + next_begin = timestamp_to_datetime(next_window["beginTime"]) + next_end = timestamp_to_datetime(next_window["endTime"]) + return next_end - next_begin def __repr__(self): - return '' % (self.id, self.name, - self.status) + return ''.format( + self.id, + self.name, + self.status, + ) class GCENodeDriver(NodeDriver): @@ -789,11 +2000,13 @@ class GCENodeDriver(NodeDriver): objects/strings). In most cases, passing strings instead of objects will result in additional GCE API calls. """ + connectionCls = GCEConnection - api_name = 'googleapis' + api_name = "google" name = "Google Compute Engine" type = Provider.GCE - website = 'https://cloud.google.com/' + website = "https://cloud.google.com/" + features = {"create_node": ["ssh_key"]} # Google Compute Engine node states are mapped to Libcloud node states # per the following dict. GCE does not have an actual 'stopped' state @@ -810,41 +2023,118 @@ class GCENodeDriver(NodeDriver): "STAGING": NodeState.PENDING, "RUNNING": NodeState.RUNNING, "STOPPING": NodeState.PENDING, + "SUSPENDED": NodeState.SUSPENDED, "TERMINATED": NodeState.STOPPED, - "UNKNOWN": NodeState.UNKNOWN + "UNKNOWN": NodeState.UNKNOWN, } AUTH_URL = "https://www.googleapis.com/auth/" SA_SCOPES_MAP = { # list derived from 'gcloud compute instances create --help' "bigquery": "bigquery", + "cloud-platform": "cloud-platform", "compute-ro": "compute.readonly", "compute-rw": "compute", "datastore": "datastore", + "logging-write": "logging.write", + "monitoring": "monitoring", + "monitoring-write": "monitoring.write", + "service-control": "servicecontrol", + "service-management": "service.management", "sql": "sqlservice", "sql-admin": "sqlservice.admin", "storage-full": "devstorage.full_control", "storage-ro": "devstorage.read_only", "storage-rw": "devstorage.read_write", "taskqueue": "taskqueue", - "userinfo-email": "userinfo.email" + "useraccounts-ro": "cloud.useraccounts.readonly", + "useraccounts-rw": "cloud.useraccounts", + "userinfo-email": "userinfo.email", } + # data taken from https://cloud.google.com/compute/docs/images IMAGE_PROJECTS = { - "centos-cloud": ["centos"], - "coreos-cloud": ["coreos"], - "debian-cloud": ["debian", "backports"], - "gce-nvme": ["nvme-backports"], - "google-containers": ["container-vm"], - "opensuse-cloud": ["opensuse"], - "rhel-cloud": ["rhel"], - "suse-cloud": ["sles", "suse"], - "ubuntu-os-cloud": ["ubuntu"], - "windows-cloud": ["windows"], + "centos-cloud": ["centos-6", "centos-7", "centos-8"], + "cos-cloud": ["cos-beta", "cos-dev", "cos-stable"], + "coreos-cloud": ["coreos-alpha", "coreos-beta", "coreos-stable"], + "debian-cloud": ["debian-8", "debian-9", "debian-10"], + "opensuse-cloud": ["opensuse-leap"], + "rhel-cloud": ["rhel-6", "rhel-7", "rhel-8"], + "suse-cloud": ["sles-11", "sles-12", "sles-15"], + "suse-byos-cloud": [ + "sles-11-byos", + "sles-12-byos", + "sles-12-sp2-sap-byos", + "sles-12-sp3-sap-byos", + "suse-manager-proxy-byos", + "suse-manager-server-byos", + ], + "suse-sap-cloud": [ + "sles-12-sp2-sap", + "sles-12-sp3-sap", + "sles-12-sp4-sap", + "sles-15-sap", + ], + "ubuntu-os-cloud": [ + "ubuntu-1404-lts", + "ubuntu-1604-lts", + "ubuntu-minimal-1604-lts", + "ubuntu-1710", + "ubuntu-1804-lts", + "ubuntu-minimal-1804-lts", + "ubuntu-1810", + "ubuntu-minimal-1810", + "ubuntu-1904", + "ubuntu-minimal-1904", + "ubuntu-1910", + "ubuntu-minimal-1910", + "ubuntu-2004-lts", + "ubuntu-minimal-2004-lts", + ], + "windows-cloud": [ + "windows-1709-core-for-containers", + "windows-1709-core", + "windows-2008-r2", + "windows-2012-r2-core", + "windows-2012-r2", + "windows-2016-core", + "windows-2016", + ], + "windows-sql-cloud": [ + "sql-ent-2012-win-2012-r2", + "sql-std-2012-win-2012-r2", + "sql-web-2012-win-2012-r2", + "sql-ent-2014-win-2012-r2", + "sql-ent-2014-win-2016", + "sql-std-2014-win-2012-r2", + "sql-web-2014-win-2012-r2", + "sql-ent-2016-win-2012-r2", + "sql-ent-2016-win-2016", + "sql-std-2016-win-2012-r2", + "sql-std-2016-win-2016", + "sql-web-2016-win-2012-r2", + "sql-web-2016-win-2016", + "sql-ent-2017-win-2016", + "sql-exp-2017-win-2012-r2", + "sql-exp-2017-win-2016", + "sql-std-2017-win-2016", + "sql-web-2017-win-2016", + ], } - def __init__(self, user_id, key=None, datacenter=None, project=None, - auth_type=None, scopes=None, credential_file=None, **kwargs): + BACKEND_SERVICE_PROTOCOLS = ["HTTP", "HTTPS", "HTTP2", "TCP", "SSL"] + + def __init__( + self, + user_id, + key=None, + datacenter=None, + project=None, + auth_type=None, + scopes=None, + credential_file=None, + **kwargs, + ): """ :param user_id: The email address (for service accounts) or Client ID (for installed apps) to be used for authentication. @@ -879,43 +2169,74 @@ def __init__(self, user_id, key=None, datacenter=None, project=None, information used by GCEConnection. :type credential_file: ``str`` """ + if not project: - raise ValueError('Project name must be specified using ' - '"project" keyword.') + raise ValueError("Project name must be specified using " '"project" keyword.') self.auth_type = auth_type self.project = project self.scopes = scopes - self.credential_file = credential_file or \ - '~/.gce_libcloud_auth' + '.' + self.project + self.credential_file = ( + credential_file or GoogleOAuth2Credential.default_credential_file + "." + self.project + ) - super(GCENodeDriver, self).__init__(user_id, key, **kwargs) + super().__init__(user_id, key, **kwargs) # Cache Zone and Region information to reduce API calls and # increase speed - self.base_path = '/compute/%s/projects/%s' % (API_VERSION, - self.project) - self.zone_list = self.ex_list_zones() - self.zone_dict = {} - for zone in self.zone_list: - self.zone_dict[zone.name] = zone + self.base_path = "/compute/{}/projects/{}".format(API_VERSION, self.project) + + self._zone_dict = None + self._zone_list = None + if datacenter: self.zone = self.ex_get_zone(datacenter) else: self.zone = None - self.region_list = self.ex_list_regions() - self.region_dict = {} - for region in self.region_list: - self.region_dict[region.name] = region + self._region_dict = None + self._region_list = None if self.zone: self.region = self._get_region_from_zone(self.zone) else: self.region = None - def ex_add_access_config(self, node, name, nic, nat_ip=None, - config_type=None): + # Volume details are looked up in this name-zone dict. + # It is populated if the volume name is not found or the dict is empty. + self._ex_volume_dict = {} + + @property + def zone_dict(self): + if self._zone_dict is None: + zones = self.ex_list_zones() + self._zone_dict = {zone.name: zone for zone in zones} + + return self._zone_dict + + @property + def zone_list(self): + if self._zone_list is None: + self._zone_list = list(self.zone_dict.values()) + + return self._zone_list + + @property + def region_dict(self): + if self._region_dict is None: + regions = self.ex_list_regions() + self._region_dict = {region.name: region for region in regions} + + return self._region_dict + + @property + def region_list(self): + if self._region_list is None: + self._region_list = list(self.region_dict.values()) + + return self._region_list + + def ex_add_access_config(self, node, name, nic, nat_ip=None, config_type=None): """ Add a network interface access configuration to a node. @@ -938,23 +2259,24 @@ def ex_add_access_config(self, node, name, nic, nat_ip=None, :return: True if successful :rtype: ``bool`` """ + if not isinstance(node, Node): raise ValueError("Must specify a valid libcloud node object.") node_name = node.name - zone_name = node.extra['zone'].name + zone_name = node.extra["zone"].name + + config = {"name": name} - config = {'name': name} if config_type is None: - config_type = 'ONE_TO_ONE_NAT' - config['type'] = config_type + config_type = "ONE_TO_ONE_NAT" + config["type"] = config_type if nat_ip is not None: - config['natIP'] = nat_ip - params = {'networkInterface': nic} - request = '/zones/%s/instances/%s/addAccessConfig' % (zone_name, - node_name) - self.connection.async_request(request, method='POST', - data=config, params=params) + config["natIP"] = nat_ip + params = {"networkInterface": nic} + request = "/zones/{}/instances/{}/addAccessConfig".format(zone_name, node_name) + self.connection.async_request(request, method="POST", data=config, params=params) + return True def ex_delete_access_config(self, node, name, nic): @@ -965,7 +2287,7 @@ def ex_delete_access_config(self, node, name, nic): :type node: ``Node`` :keyword name: Name of the access config. - :type node: ``str`` + :type name: ``str`` :keyword nic: Name of the network interface. :type nic: ``str`` @@ -973,15 +2295,16 @@ def ex_delete_access_config(self, node, name, nic): :return: True if successful :rtype: ``bool`` """ + if not isinstance(node, Node): raise ValueError("Must specify a valid libcloud node object.") node_name = node.name - zone_name = node.extra['zone'].name + zone_name = node.extra["zone"].name + + params = {"accessConfig": name, "networkInterface": nic} + request = "/zones/{}/instances/{}/deleteAccessConfig".format(zone_name, node_name) + self.connection.async_request(request, method="POST", params=params) - params = {'accessConfig': name, 'networkInterface': nic} - request = '/zones/%s/instances/%s/deleteAccessConfig' % (zone_name, - node_name) - self.connection.async_request(request, method='POST', params=params) return True def ex_set_node_metadata(self, node, metadata): @@ -998,19 +2321,94 @@ def ex_set_node_metadata(self, node, metadata): :return: True if successful :rtype: ``bool`` """ + if not isinstance(node, Node): raise ValueError("Must specify a valid libcloud node object.") node_name = node.name - zone_name = node.extra['zone'].name - if 'metadata' in node.extra and \ - 'fingerprint' in node.extra['metadata']: - current_fp = node.extra['metadata']['fingerprint'] + zone_name = node.extra["zone"].name + + if "metadata" in node.extra and "fingerprint" in node.extra["metadata"]: + current_fp = node.extra["metadata"]["fingerprint"] else: - current_fp = 'absent' + current_fp = "absent" body = self._format_metadata(current_fp, metadata) - request = '/zones/%s/instances/%s/setMetadata' % (zone_name, - node_name) - self.connection.async_request(request, method='POST', data=body) + request = "/zones/{}/instances/{}/setMetadata".format(zone_name, node_name) + self.connection.async_request(request, method="POST", data=body) + + return True + + def ex_set_node_labels(self, node, labels): + """ + Set labels for the specified node. + + :keyword node: The existing target Node (instance) for the request. + :type node: ``Node`` + + :keyword labels: Set (or clear with None) labels for this node. + :type labels: ``dict`` or ``None`` + + :return: True if successful + :rtype: ``bool`` + """ + + if not isinstance(node, Node): + raise ValueError("Must specify a valid libcloud node object.") + node_name = node.name + zone_name = node.extra["zone"].name + current_fp = node.extra["labelFingerprint"] + body = {"labels": labels, "labelFingerprint": current_fp} + request = "/zones/{}/instances/{}/setLabels".format(zone_name, node_name) + self.connection.async_request(request, method="POST", data=body) + + return True + + def ex_set_image_labels(self, image, labels): + """ + Set labels for the specified image. + + :keyword image: The existing target Image for the request. + :type image: ``NodeImage`` + + :keyword labels: Set (or clear with None) labels for this image. + :type labels: ``dict`` or ``None`` + + :return: True if successful + :rtype: ``bool`` + """ + + if not isinstance(image, NodeImage): + raise ValueError("Must specify a valid libcloud image object.") + current_fp = image.extra["labelFingerprint"] + body = {"labels": labels, "labelFingerprint": current_fp} + request = "/global/images/%s/setLabels" % (image.name) + self.connection.async_request(request, method="POST", data=body) + + return True + + def ex_set_volume_labels(self, volume, labels): + """ + Set labels for the specified volume (disk). + + :keyword volume: The existing target StorageVolume for the request. + :type volume: ``StorageVolume`` + + :keyword labels: Set (or clear with None) labels for this image. + :type labels: ``dict`` or ``None`` + + :return: True if successful + :rtype: ``bool`` + """ + + if not isinstance(volume, StorageVolume): + raise ValueError("Must specify a valid libcloud volume object.") + + volume_name = volume.name + zone_name = volume.extra["zone"].name + current_fp = volume.extra["labelFingerprint"] + body = {"labels": labels, "labelFingerprint": current_fp} + request = "/zones/{}/disks/{}/setLabels".format(zone_name, volume_name) + self.connection.async_request(request, method="POST", data=body) + return True def ex_get_serial_output(self, node): @@ -1023,14 +2421,35 @@ def ex_get_serial_output(self, node): :return: A string containing serial port output of the node. :rtype: ``str`` """ + if not isinstance(node, Node): raise ValueError("Must specify a valid libcloud node object.") node_name = node.name - zone_name = node.extra['zone'].name - request = '/zones/%s/instances/%s/serialPort' % (zone_name, - node_name) - response = self.connection.request(request, method='GET').object - return response['contents'] + zone_name = node.extra["zone"].name + request = "/zones/{}/instances/{}/serialPort".format(zone_name, node_name) + response = self.connection.request(request, method="GET").object + + return response["contents"] + + def ex_list(self, list_fn, **kwargs): + """ + Wrap a list method in a :class:`GCEList` iterator. + + >>> for sublist in driver.ex_list(driver.ex_list_urlmaps).page(1): + ... sublist + ... + [] + [] + [] + + :param list_fn: A bound list method from :class:`GCENodeDriver`. + :type list_fn: ``instancemethod`` + + :return: An iterator that returns sublists from list_fn. + :rtype: :class:`GCEList` + """ + + return GCEList(driver=self, list_fn=list_fn, **kwargs) def ex_list_disktypes(self, zone=None): """ @@ -1046,22 +2465,23 @@ def ex_list_disktypes(self, zone=None): """ list_disktypes = [] zone = self._set_zone(zone) + if zone is None: - request = '/aggregated/diskTypes' + request = "/aggregated/diskTypes" else: - request = '/zones/%s/diskTypes' % (zone.name) - response = self.connection.request(request, method='GET').object + request = "/zones/%s/diskTypes" % (zone.name) + response = self.connection.request(request, method="GET").object - if 'items' in response: + if "items" in response: # The aggregated result returns dictionaries for each region + if zone is None: - for v in response['items'].values(): - zone_disktypes = [self._to_disktype(a) for a in - v.get('diskTypes', [])] + for v in response["items"].values(): + zone_disktypes = [self._to_disktype(a) for a in v.get("diskTypes", [])] list_disktypes.extend(zone_disktypes) else: - list_disktypes = [self._to_disktype(a) for a in - response['items']] + list_disktypes = [self._to_disktype(a) for a in response["items"]] + return list_disktypes def ex_set_usage_export_bucket(self, bucket, prefix=None): @@ -1084,16 +2504,18 @@ def ex_set_usage_export_bucket(self, bucket, prefix=None): :return: True if successful :rtype: ``bool`` """ - if bucket.startswith('https://www.googleapis.com/') or \ - bucket.startswith('gs://'): - data = {'bucketName': bucket} + + if bucket.startswith("https://www.googleapis.com/") or bucket.startswith("gs://"): + data = {"bucketName": bucket} else: raise ValueError("Invalid bucket name: %s" % bucket) + if prefix: - data['reportNamePrefix'] = prefix + data["reportNamePrefix"] = prefix + + request = "/setUsageExportBucket" + self.connection.async_request(request, method="POST", data=data) - request = '/setUsageExportBucket' - self.connection.async_request(request, method='POST', data=data) return True def ex_set_common_instance_metadata(self, metadata=None, force=False): @@ -1103,9 +2525,9 @@ def ex_set_common_instance_metadata(self, metadata=None, force=False): 'startup-script' for all nodes (instances). Passing in ``None`` for the 'metadata' parameter will clear out all common instance metadata *except* for 'sshKeys'. If you also want to - update 'sshKeys', set the 'force' paramater to ``True``. + update 'sshKeys', set the 'force' parameter to ``True``. - :param metadata: Dictionay of metadata. Can be either a standard + :param metadata: Dictionary of metadata. Can be either a standard python dictionary, or the format expected by GCE (e.g. {'items': [{'key': k1, 'value': v1}, ...}] :type metadata: ``dict`` or ``None`` @@ -1120,25 +2542,32 @@ def ex_set_common_instance_metadata(self, metadata=None, force=False): :return: True if successful :rtype: ``bool`` """ + if metadata: - metadata = self._format_metadata('na', metadata) + metadata = self._format_metadata("na", metadata) - request = '/setCommonInstanceMetadata' + request = "/setCommonInstanceMetadata" project = self.ex_get_project() - current_metadata = project.extra['commonInstanceMetadata'] - fingerprint = current_metadata['fingerprint'] + current_metadata = project.extra["commonInstanceMetadata"] + fingerprint = current_metadata["fingerprint"] + md_items = [] + + if "items" in current_metadata: + md_items = current_metadata["items"] # grab copy of current 'sshKeys' in case we want to retain them current_keys = "" - for md in current_metadata['items']: - if md['key'] == 'sshKeys': - current_keys = md['value'] + + for md in md_items: + if md["key"] == "sshKeys": + current_keys = md["value"] new_md = self._set_project_metadata(metadata, force, current_keys) - md = {'fingerprint': fingerprint, 'items': new_md} - self.connection.async_request(request, method='POST', data=md) + md = {"fingerprint": fingerprint, "items": new_md} + self.connection.async_request(request, method="POST", data=md) + return True def ex_list_addresses(self, region=None): @@ -1156,26 +2585,28 @@ def ex_list_addresses(self, region=None): :rtype: ``list`` of :class:`GCEAddress` """ list_addresses = [] - if region != 'global': + + if region != "global": region = self._set_region(region) + if region is None: - request = '/aggregated/addresses' - elif region == 'global': - request = '/global/addresses' + request = "/aggregated/addresses" + elif region == "global": + request = "/global/addresses" else: - request = '/regions/%s/addresses' % (region.name) - response = self.connection.request(request, method='GET').object + request = "/regions/%s/addresses" % (region.name) + response = self.connection.request(request, method="GET").object - if 'items' in response: + if "items" in response: # The aggregated result returns dictionaries for each region + if region is None: - for v in response['items'].values(): - region_addresses = [self._to_address(a) for a in - v.get('addresses', [])] + for v in response["items"].values(): + region_addresses = [self._to_address(a) for a in v.get("addresses", [])] list_addresses.extend(region_addresses) else: - list_addresses = [self._to_address(a) for a in - response['items']] + list_addresses = [self._to_address(a) for a in response["items"]] + return list_addresses def ex_list_backendservices(self): @@ -1186,11 +2617,9 @@ def ex_list_backendservices(self): :rtype: ``list`` of :class:`GCEBackendService` """ list_backendservices = [] - response = self.connection.request('/global/backendServices', - method='GET').object + response = self.connection.request("/global/backendServices", method="GET").object - list_backendservices = [self._to_backendservice(d) for d in - response.get('items', [])] + list_backendservices = [self._to_backendservice(d) for d in response.get("items", [])] return list_backendservices @@ -1202,10 +2631,10 @@ def ex_list_healthchecks(self): :rtype: ``list`` of :class:`GCEHealthCheck` """ list_healthchecks = [] - request = '/global/httpHealthChecks' - response = self.connection.request(request, method='GET').object - list_healthchecks = [self._to_healthcheck(h) for h in - response.get('items', [])] + request = "/global/httpHealthChecks" + response = self.connection.request(request, method="GET").object + list_healthchecks = [self._to_healthcheck(h) for h in response.get("items", [])] + return list_healthchecks def ex_list_firewalls(self): @@ -1216,10 +2645,10 @@ def ex_list_firewalls(self): :rtype: ``list`` of :class:`GCEFirewall` """ list_firewalls = [] - request = '/global/firewalls' - response = self.connection.request(request, method='GET').object - list_firewalls = [self._to_firewall(f) for f in - response.get('items', [])] + request = "/global/firewalls" + response = self.connection.request(request, method="GET").object + list_firewalls = [self._to_firewall(f) for f in response.get("items", [])] + return list_firewalls def ex_list_forwarding_rules(self, region=None, global_rules=False): @@ -1243,31 +2672,39 @@ def ex_list_forwarding_rules(self, region=None, global_rules=False): :rtype: ``list`` of :class:`GCEForwardingRule` """ list_forwarding_rules = [] + if global_rules: region = None - request = '/global/forwardingRules' + request = "/global/forwardingRules" else: region = self._set_region(region) + if region is None: - request = '/aggregated/forwardingRules' + request = "/aggregated/forwardingRules" else: - request = '/regions/%s/forwardingRules' % (region.name) - response = self.connection.request(request, method='GET').object + request = "/regions/%s/forwardingRules" % (region.name) + response = self.connection.request(request, method="GET").object - if 'items' in response: + if "items" in response: # The aggregated result returns dictionaries for each region + if not global_rules and region is None: - for v in response['items'].values(): - region_forwarding_rules = [self._to_forwarding_rule(f) for - f in v.get('forwardingRules', - [])] + for v in response["items"].values(): + region_forwarding_rules = [ + self._to_forwarding_rule(f) for f in v.get("forwardingRules", []) + ] list_forwarding_rules.extend(region_forwarding_rules) else: - list_forwarding_rules = [self._to_forwarding_rule(f) for f in - response['items']] + list_forwarding_rules = [self._to_forwarding_rule(f) for f in response["items"]] + return list_forwarding_rules - def list_images(self, ex_project=None, ex_include_deprecated=False): + def list_images( + self, + location=None, + ex_project=None, + ex_include_deprecated=False, + ): """ Return a list of image objects. If no project is specified, a list of all non-deprecated global and vendor images images is returned. By @@ -1284,23 +2721,23 @@ def list_images(self, ex_project=None, ex_include_deprecated=False): :rtype: ``list`` of :class:`GCENodeImage` """ dep = ex_include_deprecated + if ex_project is not None: - return self.ex_list_project_images(ex_project=ex_project, - ex_include_deprecated=dep) - image_list = self.ex_list_project_images(ex_project=None, - ex_include_deprecated=dep) + return self.ex_list_project_images(ex_project=ex_project, ex_include_deprecated=dep) + image_list = self.ex_list_project_images(ex_project=None, ex_include_deprecated=dep) + for img_proj in list(self.IMAGE_PROJECTS.keys()): try: image_list.extend( - self.ex_list_project_images(ex_project=img_proj, - ex_include_deprecated=dep)) - except: + self.ex_list_project_images(ex_project=img_proj, ex_include_deprecated=dep) + ) + except Exception: # do not break if an OS type is invalid pass + return image_list - def ex_list_project_images(self, ex_project=None, - ex_include_deprecated=False): + def ex_list_project_images(self, ex_project=None, ex_include_deprecated=False): """ Return a list of image objects for a project. If no project is specified, only a list of 'global' images is returned. @@ -1316,11 +2753,13 @@ def ex_list_project_images(self, ex_project=None, :rtype: ``list`` of :class:`GCENodeImage` """ list_images = [] - request = '/global/images' + request = "/global/images" + if ex_project is None: - response = self.connection.request(request, method='GET').object - for img in response.get('items', []): - if 'deprecated' not in img: + response = self.connection.paginated_request(request, method="GET") + + for img in response.get("items", []): + if "deprecated" not in img: list_images.append(self._to_node_image(img)) else: if ex_include_deprecated: @@ -1329,27 +2768,29 @@ def ex_list_project_images(self, ex_project=None, list_images = [] # Save the connection request_path save_request_path = self.connection.request_path + if isinstance(ex_project, str): ex_project = [ex_project] + for proj in ex_project: # Override the connection request path - new_request_path = save_request_path.replace(self.project, - proj) + new_request_path = save_request_path.replace(self.project, proj) self.connection.request_path = new_request_path try: - response = self.connection.request(request, - method='GET').object - except: + response = self.connection.paginated_request(request, method="GET") + except Exception: raise finally: # Restore the connection request_path self.connection.request_path = save_request_path - for img in response.get('items', []): - if 'deprecated' not in img: + + for img in response.get("items", []): + if "deprecated" not in img: list_images.append(self._to_node_image(img)) else: if ex_include_deprecated: list_images.append(self._to_node_image(img)) + return list_images def list_locations(self): @@ -1363,9 +2804,10 @@ def list_locations(self): :rtype: ``list`` of :class:`NodeLocation` """ list_locations = [] - request = '/zones' - response = self.connection.request(request, method='GET').object - list_locations = [self._to_node_location(l) for l in response['items']] + request = "/zones" + response = self.connection.request(request, method="GET").object + list_locations = [self._to_node_location(loc) for loc in response["items"]] + return list_locations def ex_list_routes(self): @@ -1376,12 +2818,70 @@ def ex_list_routes(self): :rtype: ``list`` of :class:`GCERoute` """ list_routes = [] - request = '/global/routes' - response = self.connection.request(request, method='GET').object - list_routes = [self._to_route(n) for n in - response.get('items', [])] + request = "/global/routes" + response = self.connection.request(request, method="GET").object + list_routes = [self._to_route(n) for n in response.get("items", [])] + return list_routes + def ex_list_sslcertificates(self): + """ + Retrieves the list of SslCertificate resources available to the + specified project. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + * https://www.googleapis.com/auth/compute.readonly + + :return: A list of SSLCertificate objects. + :rtype: ``list`` of :class:`GCESslCertificate` + """ + list_data = [] + request = "/global/sslCertificates" + response = self.connection.request(request, method="GET").object + list_data = [self._to_sslcertificate(a) for a in response.get("items", [])] + + return list_data + + def ex_list_subnetworks(self, region=None): + """ + Return the list of subnetworks. + + :keyword region: Region for the subnetwork. Specify 'all' to return + the aggregated list of subnetworks. + :type region: ``str`` or :class:`GCERegion` + + :return: A list of subnetwork objects. + :rtype: ``list`` of :class:`GCESubnetwork` + """ + region = self._set_region(region) + + if region is None: + request = "/aggregated/subnetworks" + else: + request = "/regions/%s/subnetworks" % (region.name) + + list_subnetworks = [] + response = self.connection.request(request, method="GET").object + + if "items" in response: + if region is None: + for v in response["items"].values(): + for i in v.get("subnetworks", []): + try: + list_subnetworks.append(self._to_subnetwork(i)) + except ResourceNotFoundError: + pass + else: + for i in response["items"]: + try: + list_subnetworks.append(self._to_subnetwork(i)) + except ResourceNotFoundError: + pass + + return list_subnetworks + def ex_list_networks(self): """ Return the list of networks. @@ -1390,13 +2890,13 @@ def ex_list_networks(self): :rtype: ``list`` of :class:`GCENetwork` """ list_networks = [] - request = '/global/networks' - response = self.connection.request(request, method='GET').object - list_networks = [self._to_network(n) for n in - response.get('items', [])] + request = "/global/networks" + response = self.connection.request(request, method="GET").object + list_networks = [self._to_network(n) for n in response.get("items", [])] + return list_networks - def list_nodes(self, ex_zone=None): + def list_nodes(self, ex_zone=None, ex_use_disk_cache=True): """ Return a list of nodes in the current zone or all zones. @@ -1404,27 +2904,49 @@ def list_nodes(self, ex_zone=None): :type ex_zone: ``str`` or :class:`GCEZone` or :class:`NodeLocation` or ``None`` + :keyword ex_use_disk_cache: Disk information for each node will + retrieved from a dictionary rather + than making a distinct API call for it. + :type ex_use_disk_cache: ``bool`` + :return: List of Node objects :rtype: ``list`` of :class:`Node` """ - list_nodes = [] zone = self._set_zone(ex_zone) - if zone is None: - request = '/aggregated/instances' - else: - request = '/zones/%s/instances' % (zone.name) + response = self.connection.request_aggregated_items("instances", zone=zone) - response = self.connection.request(request, method='GET').object + if not response.get("items", []): + return [] + + list_nodes = [] + + # The aggregated response returns a dict for each zone + # Create volume cache now for fast lookups of disk info. + self._ex_populate_volume_dict() + + items = response["items"].values() + instances = [item.get("instances", []) for item in items] + instances = itertools.chain(*instances) + + for instance in instances: + try: + node = self._to_node(instance, use_disk_cache=ex_use_disk_cache) + except ResourceNotFoundError: + # If a GCE node has been deleted between + # - is was listed by `request('.../instances', 'GET') + # - it is converted by `self._to_node(i)` + # `_to_node()` will raise a ResourceNotFoundError. + # + # Just ignore that node and return the list of the + # other nodes. + + continue + + list_nodes.append(node) + + # Clear the volume cache as lookups are complete. + self._ex_volume_dict = {} - if 'items' in response: - # The aggregated response returns a dict for each zone - if zone is None: - for v in response['items'].values(): - zone_nodes = [self._to_node(i) for i in - v.get('instances', [])] - list_nodes.extend(zone_nodes) - else: - list_nodes = [self._to_node(i) for i in response['items']] return list_nodes def ex_list_regions(self): @@ -1435,9 +2957,10 @@ def ex_list_regions(self): :rtype: ``list`` of :class:`GCERegion` """ list_regions = [] - request = '/regions' - response = self.connection.request(request, method='GET').object - list_regions = [self._to_region(r) for r in response['items']] + request = "/regions" + response = self.connection.request(request, method="GET").object + list_regions = [self._to_region(r) for r in response["items"]] + return list_regions def list_sizes(self, location=None): @@ -1453,22 +2976,28 @@ def list_sizes(self, location=None): """ list_sizes = [] zone = self._set_zone(location) + if zone is None: - request = '/aggregated/machineTypes' + request = "/aggregated/machineTypes" else: - request = '/zones/%s/machineTypes' % (zone.name) + request = "/zones/%s/machineTypes" % (zone.name) - response = self.connection.request(request, method='GET').object + response = self.connection.request(request, method="GET").object + # getting pricing data here so it is done only once + instance_prices = get_pricing(driver_type="compute", driver_name="gce_instances") - if 'items' in response: + if "items" in response: # The aggregated response returns a dict for each zone + if zone is None: - for v in response['items'].values(): - zone_sizes = [self._to_node_size(s) for s in - v.get('machineTypes', [])] + for v in response["items"].values(): + zone_sizes = [ + self._to_node_size(s, instance_prices) for s in v.get("machineTypes", []) + ] list_sizes.extend(zone_sizes) else: - list_sizes = [self._to_node_size(s) for s in response['items']] + list_sizes = [self._to_node_size(s, instance_prices) for s in response["items"]] + return list_sizes def ex_list_snapshots(self): @@ -1479,10 +3008,10 @@ def ex_list_snapshots(self): :rtype: ``list`` of :class:`GCESnapshot` """ list_snapshots = [] - request = '/global/snapshots' - response = self.connection.request(request, method='GET').object - list_snapshots = [self._to_snapshot(s) for s in - response.get('items', [])] + request = "/global/snapshots" + response = self.connection.request(request, method="GET").object + list_snapshots = [self._to_snapshot(s) for s in response.get("items", [])] + return list_snapshots def ex_list_targethttpproxies(self): @@ -1492,10 +3021,22 @@ def ex_list_targethttpproxies(self): :return: A list of target http proxy objects :rtype: ``list`` of :class:`GCETargetHttpProxy` """ - request = '/global/targetHttpProxies' - response = self.connection.request(request, method='GET').object - return [self._to_targethttpproxy(u) for u in - response.get('items', [])] + request = "/global/targetHttpProxies" + response = self.connection.request(request, method="GET").object + + return [self._to_targethttpproxy(u) for u in response.get("items", [])] + + def ex_list_targethttpsproxies(self): + """ + Return the list of target HTTPs proxies. + + :return: A list of target https proxy objects + :rtype: ``list`` of :class:`GCETargetHttpsProxy` + """ + request = "/global/targetHttpsProxies" + response = self.connection.request(request, method="GET").object + + return [self._to_targethttpsproxy(x) for x in response.get("items", [])] def ex_list_targetinstances(self, zone=None): """ @@ -1506,22 +3047,25 @@ def ex_list_targetinstances(self, zone=None): """ list_targetinstances = [] zone = self._set_zone(zone) + if zone is None: - request = '/aggregated/targetInstances' + request = "/aggregated/targetInstances" else: - request = '/zones/%s/targetInstances' % (zone.name) - response = self.connection.request(request, method='GET').object + request = "/zones/%s/targetInstances" % (zone.name) + response = self.connection.request(request, method="GET").object - if 'items' in response: + if "items" in response: # The aggregated result returns dictionaries for each region + if zone is None: - for v in response['items'].values(): - zone_targetinstances = [self._to_targetinstance(t) for t in - v.get('targetInstances', [])] + for v in response["items"].values(): + zone_targetinstances = [ + self._to_targetinstance(t) for t in v.get("targetInstances", []) + ] list_targetinstances.extend(zone_targetinstances) else: - list_targetinstances = [self._to_targetinstance(t) for t in - response['items']] + list_targetinstances = [self._to_targetinstance(t) for t in response["items"]] + return list_targetinstances def ex_list_targetpools(self, region=None): @@ -1533,22 +3077,23 @@ def ex_list_targetpools(self, region=None): """ list_targetpools = [] region = self._set_region(region) + if region is None: - request = '/aggregated/targetPools' + request = "/aggregated/targetPools" else: - request = '/regions/%s/targetPools' % (region.name) - response = self.connection.request(request, method='GET').object + request = "/regions/%s/targetPools" % (region.name) + response = self.connection.request(request, method="GET").object - if 'items' in response: + if "items" in response: # The aggregated result returns dictionaries for each region + if region is None: - for v in response['items'].values(): - region_targetpools = [self._to_targetpool(t) for t in - v.get('targetPools', [])] + for v in response["items"].values(): + region_targetpools = [self._to_targetpool(t) for t in v.get("targetPools", [])] list_targetpools.extend(region_targetpools) else: - list_targetpools = [self._to_targetpool(t) for t in - response['items']] + list_targetpools = [self._to_targetpool(t) for t in response["items"]] + return list_targetpools def ex_list_urlmaps(self): @@ -1558,9 +3103,132 @@ def ex_list_urlmaps(self): :return: A list of url map objects :rtype: ``list`` of :class:`GCEUrlMap` """ - request = '/global/urlMaps' - response = self.connection.request(request, method='GET').object - return [self._to_urlmap(u) for u in response.get('items', [])] + request = "/global/urlMaps" + response = self.connection.request(request, method="GET").object + + return [self._to_urlmap(u) for u in response.get("items", [])] + + def ex_list_instancegroups(self, zone): + """ + Retrieves the list of instance groups that are located in the specified + project and zone. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + * https://www.googleapis.com/auth/compute.readonly + + :param zone: The name of the zone where the instance group is + located. + :type zone: ``str`` + + :return: A list of instance group mgr objects. + :rtype: ``list`` of :class:`GCEInstanceGroupManagers` + """ + + list_data = [] + zone = self._set_zone(zone) + + if zone is None: + request = "/aggregated/instanceGroups" + else: + request = "/zones/%s/instanceGroups" % (zone.name) + response = self.connection.request(request, method="GET").object + + if "items" in response: + # The aggregated result returns dictionaries for each region + + if zone is None: + for v in response["items"].values(): + zone_data = [self._to_instancegroup(a) for a in v.get("instanceGroups", [])] + list_data.extend(zone_data) + else: + list_data = [self._to_instancegroup(a) for a in response["items"]] + + return list_data + + def ex_list_instancegroupmanagers(self, zone=None): + """ + Return a list of Instance Group Managers. + + :keyword zone: The zone to return InstanceGroupManagers from. + For example: 'us-central1-a'. If None, will return + InstanceGroupManagers from self.zone. If 'all', will + return all InstanceGroupManagers. + :type zone: ``str`` or ``None`` + + :return: A list of instance group mgr objects. + :rtype: ``list`` of :class:`GCEInstanceGroupManagers` + """ + list_managers = [] + zone = self._set_zone(zone) + + if zone is None: + request = "/aggregated/instanceGroupManagers" + else: + request = "/zones/%s/instanceGroupManagers" % (zone.name) + response = self.connection.request(request, method="GET").object + + if "items" in response: + # The aggregated result returns dictionaries for each region + + if zone is None: + for v in response["items"].values(): + zone_managers = [ + self._to_instancegroupmanager(a) for a in v.get("instanceGroupManagers", []) + ] + list_managers.extend(zone_managers) + else: + list_managers = [self._to_instancegroupmanager(a) for a in response["items"]] + + return list_managers + + def ex_list_instancetemplates(self): + """ + Return the list of Instance Templates. + + :return: A list of Instance Template Objects + :rtype: ``list`` of :class:`GCEInstanceTemplate` + """ + request = "/global/instanceTemplates" + response = self.connection.request(request, method="GET").object + + return [self._to_instancetemplate(u) for u in response.get("items", [])] + + def ex_list_autoscalers(self, zone=None): + """ + Return the list of AutoScalers. + + :keyword zone: The zone to return InstanceGroupManagers from. + For example: 'us-central1-a'. If None, will return + InstanceGroupManagers from self.zone. If 'all', will + return all InstanceGroupManagers. + :type zone: ``str`` or ``None`` + + :return: A list of AutoScaler Objects + :rtype: ``list`` of :class:`GCEAutoScaler` + """ + list_autoscalers = [] + zone = self._set_zone(zone) + + if zone is None: + request = "/aggregated/autoscalers" + else: + request = "/zones/%s/autoscalers" % (zone.name) + + response = self.connection.request(request, method="GET").object + + if "items" in response: + # The aggregated result returns dictionaries for each zone. + + if zone is None: + for v in response["items"].values(): + zone_as = [self._to_autoscaler(a) for a in v.get("autoscalers", [])] + list_autoscalers.extend(zone_as) + else: + list_autoscalers = [self._to_autoscaler(a) for a in response["items"]] + + return list_autoscalers def list_volumes(self, ex_zone=None): """ @@ -1578,22 +3246,24 @@ def list_volumes(self, ex_zone=None): """ list_volumes = [] zone = self._set_zone(ex_zone) + if zone is None: - request = '/aggregated/disks' + request = "/aggregated/disks" else: - request = '/zones/%s/disks' % (zone.name) + request = "/zones/%s/disks" % (zone.name) + + response = self.connection.request(request, method="GET").object - response = self.connection.request(request, method='GET').object - if 'items' in response: + if "items" in response: # The aggregated response returns a dict for each zone + if zone is None: - for v in response['items'].values(): - zone_volumes = [self._to_storage_volume(d) for d in - v.get('disks', [])] + for v in response["items"].values(): + zone_volumes = [self._to_storage_volume(d) for d in v.get("disks", [])] list_volumes.extend(zone_volumes) else: - list_volumes = [self._to_storage_volume(d) for d in - response['items']] + list_volumes = [self._to_storage_volume(d) for d in response["items"]] + return list_volumes def ex_list_zones(self): @@ -1604,13 +3274,21 @@ def ex_list_zones(self): :rtype: ``list`` of :class:`GCEZone` """ list_zones = [] - request = '/zones' - response = self.connection.request(request, method='GET').object - list_zones = [self._to_zone(z) for z in response['items']] + request = "/zones" + response = self.connection.request(request, method="GET").object + list_zones = [self._to_zone(z) for z in response["items"]] + return list_zones - def ex_create_address(self, name, region=None, address=None, - description=None): + def ex_create_address( + self, + name, + region=None, + address=None, + description=None, + address_type="EXTERNAL", + subnetwork=None, + ): """ Create a static address in a region, or a global address. @@ -1628,60 +3306,298 @@ def ex_create_address(self, name, region=None, address=None, :keyword description: Optional descriptive comment. :type description: ``str`` or ``None`` + :keyword address_type: Optional The type of address to reserve, + either INTERNAL or EXTERNAL. If unspecified, + defaults to EXTERNAL. + :type description: ``str`` + + :keyword subnetwork: Optional The URL of the subnetwork in which to + reserve the address. If an IP address is + specified, it must be within the subnetwork's + IP range. This field can only be used with + INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER + purposes. + :type description: ``str`` + :return: Static Address object :rtype: :class:`GCEAddress` """ region = region or self.region - if region != 'global' and not hasattr(region, 'name'): + + if region is None: + raise ValueError("REGION_NOT_SPECIFIED", "Region must be provided for an address") + + if region != "global" and not hasattr(region, "name"): region = self.ex_get_region(region) - elif region is None: - raise ValueError('REGION_NOT_SPECIFIED', - 'Region must be provided for an address') - address_data = {'name': name} + address_data = {"name": name} + if address: - address_data['address'] = address + address_data["address"] = address + if description: - address_data['description'] = description - if region == 'global': - request = '/global/addresses' + address_data["description"] = description + + if address_type: + if address_type not in ["EXTERNAL", "INTERNAL"]: + raise ValueError( + "ADDRESS_TYPE_WRONG", + "Address type must be either EXTERNAL or \ + INTERNAL", + ) + else: + address_data["addressType"] = address_type + + if subnetwork and address_type != "INTERNAL": + raise ValueError( + "INVALID_ARGUMENT_COMBINATION", + "Address type must be internal if subnetwork \ + provided", + ) + + if subnetwork and not hasattr(subnetwork, "name"): + subnetwork = self.ex_get_subnetwork(subnetwork, region) + + if region == "global": + request = "/global/addresses" else: - request = '/regions/%s/addresses' % (region.name) - self.connection.async_request(request, method='POST', - data=address_data) + request = "/regions/%s/addresses" % (region.name) + self.connection.async_request(request, method="POST", data=address_data) + return self.ex_get_address(name, region=region) - def ex_create_backendservice(self, name, healthchecks): + def ex_create_autoscaler(self, name, zone, instance_group, policy, description=None): + """ + Create an Autoscaler for an Instance Group. + + :param name: The name of the Autoscaler + :type name: ``str`` + + :param zone: The zone to which the Instance Group belongs + :type zone: ``str`` or :class:`GCEZone` + + :param instance_group: An Instance Group Manager object. + :type: :class:`GCEInstanceGroupManager` + + :param policy: A dict containing policy configuration. See the + API documentation for Autoscalers for more details. + :type: ``dict`` + + :return: An Autoscaler object. + :rtype: :class:`GCEAutoscaler` + """ + zone = zone or self.zone + autoscaler_data = {} + autoscaler_data = {"name": name} + + if not hasattr(zone, "name"): + zone = self.ex_get_zone(zone) + autoscaler_data["zone"] = zone.extra["selfLink"] + + # TODO(supertom): we should validate the policy + autoscaler_data["autoscalingPolicy"] = policy + request = "/zones/%s/autoscalers" % zone.name + autoscaler_data["target"] = instance_group.extra["selfLink"] + self.connection.async_request(request, method="POST", data=autoscaler_data) + + return self.ex_get_autoscaler(name, zone) + + def ex_create_backend( + self, + instance_group, + balancing_mode="UTILIZATION", + max_utilization=None, + max_rate=None, + max_rate_per_instance=None, + capacity_scaler=1, + description=None, + ): + """ + Helper Object to create a backend. + + :param instance_group: The Instance Group for this Backend. + :type instance_group: :class: `GCEInstanceGroup` + + :param balancing_mode: Specifies the balancing mode for this backend. + For global HTTP(S) load balancing, the valid + values are UTILIZATION (default) and RATE. + For global SSL load balancing, the valid + values are UTILIZATION (default) and + CONNECTION. + :type balancing_mode: ``str`` + + :param max_utilization: Used when balancingMode is UTILIZATION. + This ratio defines the CPU utilization + target for the group. The default is 0.8. + Valid range is [0.0, 1.0]. + :type max_utilization: ``float`` + + :param max_rate: The max requests per second (RPS) of the group. + Can be used with either RATE or UTILIZATION balancing + modes, but required if RATE mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. + :type max_rate: ``int`` + + :param max_rate_per_instance: The max requests per second (RPS) that + a single backend instance can handle. + This is used to calculate the capacity + of the group. Can be used in either + balancing mode. For RATE mode, either + maxRate or maxRatePerInstance must be + set. + :type max_rate_per_instance: ``float`` + + :param capacity_scaler: A multiplier applied to the group's maximum + servicing capacity (based on UTILIZATION, + RATE, or CONNECTION). Default value is 1, + which means the group will serve up to 100% + of its configured capacity (depending on + balancingMode). A setting of 0 means the + group is completely drained, offering 0% + of its available capacity. Valid range is + [0.0,1.0]. + :type capacity_scaler: ``float`` + + :param description: An optional description of this resource. + Provide this property when you create the + resource. + :type description: ``str`` + + :return: A GCEBackend object. + :rtype: :class: `GCEBackend` """ - Create a global backend service. - :param name: Name of the backend service + return GCEBackend( + instance_group=instance_group, + balancing_mode=balancing_mode, + max_utilization=max_utilization, + max_rate=max_rate, + max_rate_per_instance=max_rate_per_instance, + capacity_scaler=capacity_scaler, + description=description, + ) + + def ex_create_backendservice( + self, + name, + healthchecks, + backends=[], + protocol=None, + description=None, + timeout_sec=None, + enable_cdn=False, + port=None, + port_name=None, + ): + """ + Create a global Backend Service. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param name: Name of the resource. Provided by the client when the + resource is created. The name must be 1-63 characters + long, and comply with RFC1035. Specifically, the name + must be 1-63 characters long and match the regular + expression [a-z]([-a-z0-9]*[a-z0-9])? which means the + first character must be a lowercase letter, and all + following characters must be a dash, lowercase letter, + or digit, except the last character, which cannot be a + dash. :type name: ``str`` - :keyword healthchecks: A list of HTTP Health Checks to use for this + :param healthchecks: A list of HTTP Health Checks to use for this service. There must be at least one. :type healthchecks: ``list`` of (``str`` or :class:`GCEHealthCheck`) - :return: A Backend Service object + :keyword backends: The list of backends that serve this + BackendService. + :type backends: ``list`` of :class `GCEBackend` or list of ``dict`` + + :keyword timeout_sec: How many seconds to wait for the backend + before considering it a failed request. + Default is 30 seconds. + :type timeout_sec: ``integer`` + + :keyword enable_cdn: If true, enable Cloud CDN for this + BackendService. When the load balancing + scheme is INTERNAL, this field is not used. + :type enable_cdn: ``bool`` + + :keyword port: Deprecated in favor of port_name. The TCP port to + connect on the backend. The default value is 80. + This cannot be used for internal load balancing. + :type port: ``integer`` + + :keyword port_name: Name of backend port. The same name should appear + in the instance groups referenced by this service. + :type port_name: ``str`` + + :keyword protocol: The protocol this Backend Service uses to + communicate with backends. + Possible values are HTTP, HTTPS, HTTP2, TCP + and SSL. + :type protocol: ``str`` + + :return: A Backend Service object. :rtype: :class:`GCEBackendService` """ - backendservice_data = {'name': name, 'healthChecks': []} + backendservice_data = { + "name": name, + "healthChecks": [], + "backends": [], + "enableCDN": enable_cdn, + } for hc in healthchecks: - if not hasattr(hc, 'extra'): + if not hasattr(hc, "extra"): hc = self.ex_get_healthcheck(name=hc) - backendservice_data['healthChecks'].append(hc.extra['selfLink']) + backendservice_data["healthChecks"].append(hc.extra["selfLink"]) - request = '/global/backendServices' - self.connection.async_request(request, method='POST', - data=backendservice_data) - return self.ex_get_backendservice(name) + for be in backends: + if isinstance(be, GCEBackend): + backendservice_data["backends"].append(be.to_backend_dict()) + else: + backendservice_data["backends"].append(be) + + if port: + backendservice_data["port"] = port + + if port_name: + backendservice_data["portName"] = port_name + + if timeout_sec: + backendservice_data["timeoutSec"] = timeout_sec + + if protocol: + if protocol in self.BACKEND_SERVICE_PROTOCOLS: + backendservice_data["protocol"] = protocol + else: + raise ValueError( + "Protocol must be one of %s" % ",".join(self.BACKEND_SERVICE_PROTOCOLS) + ) + + if description: + backendservice_data["description"] = description - def ex_create_healthcheck(self, name, host=None, path=None, port=None, - interval=None, timeout=None, - unhealthy_threshold=None, - healthy_threshold=None, - description=None): + request = "/global/backendServices" + self.connection.async_request(request, method="POST", data=backendservice_data) + + return self.ex_get_backendservice(name) + + def ex_create_healthcheck( + self, + name, + host=None, + path=None, + port=None, + interval=None, + timeout=None, + unhealthy_threshold=None, + healthy_threshold=None, + description=None, + ): """ Create an Http Health Check. @@ -1719,33 +3635,53 @@ def ex_create_healthcheck(self, name, host=None, path=None, port=None, :rtype: :class:`GCEHealthCheck` """ hc_data = {} - hc_data['name'] = name + hc_data["name"] = name + if host: - hc_data['host'] = host + hc_data["host"] = host + if description: - hc_data['description'] = description + hc_data["description"] = description # As of right now, the 'default' values aren't getting set when called # through the API, so set them explicitly - hc_data['requestPath'] = path or '/' - hc_data['port'] = port or 80 - hc_data['checkIntervalSec'] = interval or 5 - hc_data['timeoutSec'] = timeout or 5 - hc_data['unhealthyThreshold'] = unhealthy_threshold or 2 - hc_data['healthyThreshold'] = healthy_threshold or 2 + hc_data["requestPath"] = path or "/" + hc_data["port"] = port or 80 + hc_data["checkIntervalSec"] = interval or 5 + hc_data["timeoutSec"] = timeout or 5 + hc_data["unhealthyThreshold"] = unhealthy_threshold or 2 + hc_data["healthyThreshold"] = healthy_threshold or 2 - request = '/global/httpHealthChecks' + request = "/global/httpHealthChecks" - self.connection.async_request(request, method='POST', data=hc_data) - return self.ex_get_healthcheck(name) + self.connection.async_request(request, method="POST", data=hc_data) - def ex_create_firewall(self, name, allowed, network='default', - source_ranges=None, source_tags=None, - target_tags=None): - """ - Create a firewall on a network. + return self.ex_get_healthcheck(name) - Firewall rules should be supplied in the "allowed" field. This is a - list of dictionaries formated like so ("ports" is optional):: + def ex_create_firewall( + self, + name, + allowed=None, + denied=None, + network="default", + target_ranges=None, + direction="INGRESS", + priority=1000, + source_service_accounts=None, + target_service_accounts=None, + source_ranges=None, + source_tags=None, + target_tags=None, + description=None, + ): + """ + Create a firewall rule on a network. + Rules can be for Ingress or Egress, and they may Allow or + Deny traffic. They are also applied in order based on action + (Deny, Allow) and Priority. Rules can be applied using various Source + and Target filters. + + Firewall rules should be supplied in the "allowed" or "denied" field. + This is a list of dictionaries formatted like so ("ports" is optional): [{"IPProtocol": "", "ports": ""}] @@ -1757,15 +3693,32 @@ def ex_create_firewall(self, name, allowed, network='default', "ports": ["8080"]}, {"IPProtocol": "udp"}] + Note that valid inputs vary by direction (INGRESS vs EGRESS), action + (allow/deny), and source/target filters (tag vs range etc). + See `Firewall Reference `_ for more information. :param name: Name of the firewall to be created :type name: ``str`` - :param allowed: List of dictionaries with rules + :param description: Optional description of the rule. + :type description: ``str`` + + :param direction: Direction of the FW rule - "INGRESS" or "EGRESS" + Defaults to 'INGRESS'. + :type direction: ``str`` + + :param priority: Priority integer of the rule - + lower is applied first. Defaults to 1000 + :type priority: ``int`` + + :param allowed: List of dictionaries with rules for type INGRESS :type allowed: ``list`` of ``dict`` + :param denied: List of dictionaries with rules for type EGRESS + :type denied: ``list`` of ``dict`` + :keyword network: The network that the firewall applies to. :type network: ``str`` or :class:`GCENetwork` @@ -1774,6 +3727,10 @@ def ex_create_firewall(self, name, allowed, network='default', ['0.0.0.0/0'] :type source_ranges: ``list`` of ``str`` + :keyword source_service_accounts: A list of source service accounts + the rules apply to. + :type source_service_accounts: ``list`` of ``str`` + :keyword source_tags: A list of source instance tags the rules apply to. :type source_tags: ``list`` of ``str`` @@ -1782,36 +3739,76 @@ def ex_create_firewall(self, name, allowed, network='default', to. :type target_tags: ``list`` of ``str`` + :keyword target_service_accounts: A list of target service accounts + the rules apply to. + :type target_service_accounts: ``list`` of ``str`` + + :keyword target_ranges: A list of IP ranges in CIDR format that the + EGRESS type rule should apply to. Defaults + to ['0.0.0.0/0'] + :type target_ranges: ``list`` of ``str`` + :return: Firewall object :rtype: :class:`GCEFirewall` """ firewall_data = {} - if not hasattr(network, 'name'): + + if not hasattr(network, "name"): nw = self.ex_get_network(network) else: nw = network - firewall_data['name'] = name - firewall_data['allowed'] = allowed - firewall_data['network'] = nw.extra['selfLink'] - if source_ranges is None: - source_ranges = ['0.0.0.0/0'] - firewall_data['sourceRanges'] = source_ranges + firewall_data["name"] = name + firewall_data["direction"] = direction + firewall_data["priority"] = priority + firewall_data["description"] = description + + if direction == "INGRESS": + firewall_data["allowed"] = allowed + elif direction == "EGRESS": + firewall_data["denied"] = denied + firewall_data["network"] = nw.extra["selfLink"] + + if source_ranges is None and source_tags is None and source_service_accounts is None: + source_ranges = ["0.0.0.0/0"] + + if source_ranges is not None: + firewall_data["sourceRanges"] = source_ranges + if source_tags is not None: - firewall_data['sourceTags'] = source_tags + firewall_data["sourceTags"] = source_tags + + if source_service_accounts is not None: + firewall_data["sourceServiceAccounts"] = source_service_accounts + if target_tags is not None: - firewall_data['targetTags'] = target_tags + firewall_data["targetTags"] = target_tags + + if target_service_accounts is not None: + firewall_data["targetServiceAccounts"] = target_service_accounts + + if target_ranges is not None: + firewall_data["destinationRanges"] = target_ranges + + request = "/global/firewalls" - request = '/global/firewalls' + self.connection.async_request(request, method="POST", data=firewall_data) - self.connection.async_request(request, method='POST', - data=firewall_data) return self.ex_get_firewall(name) - def ex_create_forwarding_rule(self, name, target=None, region=None, - protocol='tcp', port_range=None, - address=None, description=None, - global_rule=False, targetpool=None): + def ex_create_forwarding_rule( + self, + name, + target=None, + region=None, + protocol="tcp", + port_range=None, + address=None, + description=None, + global_rule=False, + targetpool=None, + lb_scheme=None, + ): """ Create a forwarding rule. @@ -1853,48 +3850,69 @@ def ex_create_forwarding_rule(self, name, target=None, region=None, Use target instead. :type targetpool: ``str`` or :class:`GCETargetPool` + :keyword lb_scheme: Load balancing scheme, can be 'EXTERNAL' or + 'INTERNAL'. Defaults to 'EXTERNAL'. + :type lb_scheme: ``str`` or ``None`` + :return: Forwarding Rule object :rtype: :class:`GCEForwardingRule` """ - forwarding_rule_data = {'name': name} + forwarding_rule_data = {"name": name} + if global_rule: - if not hasattr(target, 'name'): + if not hasattr(target, "name"): target = self.ex_get_targethttpproxy(target) else: region = region or self.region - if not hasattr(region, 'name'): + + if not hasattr(region, "name"): region = self.ex_get_region(region) - forwarding_rule_data['region'] = region.extra['selfLink'] + forwarding_rule_data["region"] = region.extra["selfLink"] if not target: target = targetpool # Backwards compatibility - if not hasattr(target, 'name'): + + if not hasattr(target, "name"): target = self.ex_get_targetpool(target, region) - forwarding_rule_data['target'] = target.extra['selfLink'] - forwarding_rule_data['IPProtocol'] = protocol.upper() + forwarding_rule_data["target"] = target.extra["selfLink"] + forwarding_rule_data["IPProtocol"] = protocol.upper() + if address: - if not hasattr(address, 'name'): - address = self.ex_get_address( - address, 'global' if global_rule else region) - forwarding_rule_data['IPAddress'] = address.address + if not hasattr(address, "name"): + address = self.ex_get_address(address, "global" if global_rule else region) + forwarding_rule_data["IPAddress"] = address.address + if port_range: - forwarding_rule_data['portRange'] = port_range + forwarding_rule_data["portRange"] = port_range + if description: - forwarding_rule_data['description'] = description + forwarding_rule_data["description"] = description + + if lb_scheme: + forwarding_rule_data["loadBalancingScheme"] = lb_scheme if global_rule: - request = '/global/forwardingRules' + request = "/global/forwardingRules" else: - request = '/regions/%s/forwardingRules' % (region.name) + request = "/regions/%s/forwardingRules" % (region.name) - self.connection.async_request(request, method='POST', - data=forwarding_rule_data) + self.connection.async_request(request, method="POST", data=forwarding_rule_data) return self.ex_get_forwarding_rule(name, global_rule=global_rule) - def ex_create_image(self, name, volume, description=None, - use_existing=True, wait_for_completion=True): + def ex_create_image( + self, + name, + volume, + description=None, + family=None, + guest_os_features=None, + use_existing=True, + wait_for_completion=True, + ex_licenses=None, + ex_labels=None, + ): """ Create an image from the provided volume. @@ -1905,8 +3923,26 @@ def ex_create_image(self, name, volume, description=None, Google Cloud Storage URI :type volume: ``str`` or :class:`StorageVolume` - :keyword description: Description of the new Image - :type description: ``str`` + :keyword description: Description of the new Image + :type description: ``str`` + + :keyword family: The name of the image family to which this image + belongs. If you create resources by specifying an + image family instead of a specific image name, the + resource uses the latest non-deprecated image that + is set with that family name. + :type family: ``str`` + + :keyword guest_os_features: Features of the guest operating system, + valid for bootable images only. + :type guest_os_features: ``list`` of ``str`` or ``None`` + + :keyword ex_licenses: List of strings representing licenses + to be associated with the image. + :type ex_licenses: ``list`` of ``str`` + + :keyword ex_labels: Labels dictionary for image. + :type ex_labels: ``dict`` or ``None`` :keyword use_existing: If True and an image with the given name already exists, return an object for that @@ -1921,42 +3957,247 @@ def ex_create_image(self, name, volume, description=None, creation progress :type wait_for_completion: ``bool`` - :return: A GCENodeImage object for the new image - :rtype: :class:`GCENodeImage` + :return: A GCENodeImage object for the new image + :rtype: :class:`GCENodeImage` """ image_data = {} - image_data['name'] = name - image_data['description'] = description + image_data["name"] = name + image_data["description"] = description + image_data["family"] = family + if isinstance(volume, StorageVolume): - image_data['sourceDisk'] = volume.extra['selfLink'] - image_data['zone'] = volume.extra['zone'].name - elif isinstance(volume, str) and \ - volume.startswith('https://') and volume.endswith('tar.gz'): - image_data['rawDisk'] = {'source': volume, 'containerType': 'TAR'} + image_data["sourceDisk"] = volume.extra["selfLink"] + image_data["zone"] = volume.extra["zone"].name + elif ( + isinstance(volume, str) and volume.startswith("https://") and volume.endswith("tar.gz") + ): + image_data["rawDisk"] = {"source": volume, "containerType": "TAR"} else: - raise ValueError('Source must be instance of StorageVolume or URI') + raise ValueError("Source must be instance of StorageVolume or URI") + + if ex_licenses: + if isinstance(ex_licenses, str): + ex_licenses = [ex_licenses] + image_data["licenses"] = ex_licenses + + if ex_labels: + image_data["labels"] = ex_labels + + if guest_os_features: + image_data["guestOsFeatures"] = [] + + if isinstance(guest_os_features, str): + guest_os_features = [guest_os_features] - request = '/global/images' + for feature in guest_os_features: + image_data["guestOsFeatures"].append({"type": feature}) + request = "/global/images" try: if wait_for_completion: - self.connection.async_request(request, method='POST', - data=image_data) + self.connection.async_request(request, method="POST", data=image_data) else: - self.connection.request(request, method='POST', - data=image_data) + self.connection.request(request, method="POST", data=image_data) - except ResourceExistsError: - e = sys.exc_info()[1] + except ResourceExistsError as e: if not use_existing: raise e return self.ex_get_image(name) - def ex_create_route(self, name, dest_range, priority=500, - network="default", tags=None, next_hop=None, - description=None): + def ex_copy_image(self, name, url, description=None, family=None, guest_os_features=None): + """ + Copy an image to your image collection. + + :param name: The name of the image + :type name: ``str`` + + :param url: The URL to the image. The URL can start with `gs://` + :type url: ``str`` + + :param description: The description of the image + :type description: ``str`` + + :param family: The family of the image + :type family: ``str`` + + :param guest_os_features: The features of the guest operating system. + :type guest_os_features: ``list`` of ``str`` or ``None`` + + :return: NodeImage object based on provided information or None if an + image with that name is not found. + :rtype: :class:`NodeImage` or ``None`` + """ + + # The URL for an image can start with gs:// + + if url.startswith("gs://"): + url = url.replace("gs://", "https://storage.googleapis.com/", 1) + + image_data = { + "name": name, + "description": description, + "family": family, + "sourceType": "RAW", + "rawDisk": {"source": url}, + } + + if guest_os_features: + image_data["guestOsFeatures"] = [] + + if isinstance(guest_os_features, str): + guest_os_features = [guest_os_features] + + for feature in guest_os_features: + image_data["guestOsFeatures"].append({"type": feature}) + + request = "/global/images" + self.connection.async_request(request, method="POST", data=image_data) + + return self.ex_get_image(name) + + def ex_create_instancegroup( + self, + name, + zone, + description=None, + network=None, + subnetwork=None, + named_ports=None, + ): + """ + Creates an instance group in the specified project using the + parameters that are included in the request. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param name: Required. The name of the instance group. The name + must be 1-63 characters long, and comply with RFC1035. + :type name: ``str`` + + :param zone: The URL of the zone where the instance group is + located. + :type zone: :class:`GCEZone` + + :keyword description: An optional description of this resource. + Provide this property when you create the + resource. + :type description: ``str`` + + :keyword network: The URL of the network to which all instances in + the instance group belong. + :type network: :class:`GCENetwork` + + :keyword subnetwork: The URL of the subnetwork to which all + instances in the instance group belong. + :type subnetwork: :class:`GCESubnetwork` + + :keyword named_ports: Assigns a name to a port number. For example: + {name: "http", port: 80} This allows the + system to reference ports by the assigned + name instead of a port number. Named ports + can also contain multiple ports. For example: + [{name: "http", port: 80},{name: "http", + port: 8080}] Named ports apply to all + instances in this instance group. + :type named_ports: ``list`` of {'name': ``str``, 'port`: ``int``} + + :return: `GCEInstanceGroup` object. + :rtype: :class:`GCEInstanceGroup` + """ + zone = zone or self.zone + + if not hasattr(zone, "name"): + zone = self.ex_get_zone(zone) + request = "/zones/%s/instanceGroups" % (zone.name) + request_data = {} + request_data["name"] = name + request_data["zone"] = zone.extra["selfLink"] + + if description: + request_data["description"] = description + + if network: + request_data["network"] = network.extra["selfLink"] + + if subnetwork: + request_data["subnetwork"] = subnetwork.extra["selfLink"] + + if named_ports: + request_data["namedPorts"] = named_ports + + self.connection.async_request(request, method="POST", data=request_data) + + return self.ex_get_instancegroup(name, zone) + + def ex_create_instancegroupmanager( + self, name, zone, template, size, base_instance_name=None, description=None + ): + """ + Create a Managed Instance Group. + + :param name: Name of the Instance Group. + :type name: ``str`` + + :param zone: The zone to which the Instance Group belongs + :type zone: ``str`` or :class:`GCEZone` or ``None`` + + :param template: The Instance Template. Should be an instance + of GCEInstanceTemplate or a string. + :type template: ``str`` or :class:`GCEInstanceTemplate` + + :param base_instance_name: The prefix for each instance created. + If None, Instance Group name will be used. + :type base_instance_name: ``str`` + + :param description: User-supplied text about the Instance Group. + :type description: ``str`` + + :return: An Instance Group Manager object. + :rtype: :class:`GCEInstanceGroupManager` + """ + zone = zone or self.zone + + if not hasattr(zone, "name"): + zone = self.ex_get_zone(zone) + + request = "/zones/%s/instanceGroupManagers" % (zone.name) + + manager_data = {} + + # If the user gave us a name, we fetch the GCEInstanceTemplate for it. + + if not hasattr(template, "name"): + template = self.ex_get_instancetemplate(template) + manager_data["instanceTemplate"] = template.extra["selfLink"] + + # If base_instance_name is not set, we use name. + manager_data["baseInstanceName"] = name + + if base_instance_name is not None: + manager_data["baseInstanceName"] = base_instance_name + + manager_data["name"] = name + manager_data["targetSize"] = size + manager_data["description"] = description + + self.connection.async_request(request, method="POST", data=manager_data) + + return self.ex_get_instancegroupmanager(name, zone) + + def ex_create_route( + self, + name, + dest_range, + priority=500, + network="default", + tags=None, + next_hop=None, + description=None, + ): """ Create a route. @@ -1970,7 +4211,8 @@ def ex_create_route(self, name, dest_range, priority=500, :type priority: ``int`` :param network: The network the route belongs to. Can be either the - full URL of the network or a libcloud object. + full URL of the network, the name of the network or + a libcloud object. :type network: ``str`` or ``GCENetwork`` :param tags: List of instance-tags for routing, empty for all nodes @@ -1988,72 +4230,268 @@ def ex_create_route(self, name, dest_range, priority=500, :rtype: :class:`GCERoute` """ route_data = {} - route_data['name'] = name - route_data['destRange'] = dest_range - route_data['priority'] = priority - route_data['description'] = description - if isinstance(network, str) and network.startswith('https://'): + route_data["name"] = name + route_data["destRange"] = dest_range + route_data["priority"] = priority + route_data["description"] = description + + if isinstance(network, str) and network.startswith("https://"): network_uri = network elif isinstance(network, str): network = self.ex_get_network(network) - network_uri = network.extra['selfLink'] + network_uri = network.extra["selfLink"] else: - network_uri = network.extra['selfLink'] - route_data['network'] = network_uri - route_data['tags'] = tags + network_uri = network.extra["selfLink"] + route_data["network"] = network_uri + route_data["tags"] = tags + if next_hop is None: - url = 'https://www.googleapis.com/compute/%s/projects/%s/%s' % ( - API_VERSION, self.project, - "global/gateways/default-internet-gateway") - route_data['nextHopGateway'] = url + url = "https://www.googleapis.com/compute/{}/projects/{}/{}".format( + API_VERSION, + self.project, + "global/gateways/default-internet-gateway", + ) + route_data["nextHopGateway"] = url elif isinstance(next_hop, str): - route_data['nextHopIp'] = next_hop + route_data["nextHopIp"] = next_hop else: - node = self.ex_get_node(next_hop) - route_data['nextHopInstance'] = node.extra['selfLink'] + route_data["nextHopInstance"] = next_hop.extra["selfLink"] - request = '/global/routes' - self.connection.async_request(request, method='POST', - data=route_data) + request = "/global/routes" + self.connection.async_request(request, method="POST", data=route_data) return self.ex_get_route(name) - def ex_create_network(self, name, cidr, description=None): + def ex_create_sslcertificate(self, name, certificate=None, private_key=None, description=None): """ - Create a network. + Creates a SslCertificate resource in the specified project using the + data included in the request. - :param name: Name of network to be created + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param name: Name of the resource. Provided by the client when the + resource is created. The name must be 1-63 characters + long, and comply with RFC1035. Specifically, the name + must be 1-63 characters long and match the regular + expression [a-z]([-a-z0-9]*[a-z0-9])? which means the + first character must be a lowercase letter, and all + following characters must be a dash, lowercase letter, + or digit, except the last character, which cannot be a + dash. + :type name: ``str`` + + :param certificate: A string containing local certificate file in + PEM format. The certificate chain + must be no greater than 5 certs long. The + chain must include at least one intermediate + cert. + :type certificate: ``str`` + + :param private_key: A string containing a write-only private key + in PEM format. Only insert RPCs will include + this field. + :type private_key: ``str`` + + :keyword description: An optional description of this resource. + Provide this property when you create the + resource. + :type description: ``str`` + + :return: `GCESslCertificate` object. + :rtype: :class:`GCESslCertificate` + """ + + request = "/global/sslCertificates" + request_data = {} + request_data["name"] = name + request_data["certificate"] = certificate + request_data["privateKey"] = private_key + request_data["description"] = description + + self.connection.async_request(request, method="POST", data=request_data) + + return self.ex_get_sslcertificate(name) + + def ex_create_subnetwork( + self, + name, + cidr=None, + network=None, + region=None, + description=None, + privateipgoogleaccess=None, + secondaryipranges=None, + ): + """ + Create a subnetwork. + + :param name: Name of subnetwork to be created :type name: ``str`` :param cidr: Address range of network in CIDR format. :type cidr: ``str`` + :param network: The network name or object this subnet belongs to. + :type network: ``str`` or :class:`GCENetwork` + + :param region: The region the subnetwork belongs to. + :type region: ``str`` or :class:`GCERegion` + + :param description: Custom description for the network. + :type description: ``str`` or ``None`` + + :param privateipgoogleaccess: Allow access to Google services without + assigned external IP addresses. + :type privateipgoogleaccess: ``bool` or ``None`` + + :param secondaryipranges: List of dicts of secondary or "alias" IP + ranges for this subnetwork in + [{"rangeName": "second1", + "ipCidrRange": "192.168.168.0/24"}, + {k:v, k:v}] format. + :type secondaryipranges: ``list`` of ``dict`` or ``None`` + + :return: Subnetwork object + :rtype: :class:`GCESubnetwork` + """ + + if not cidr: + raise ValueError("Must provide an IP network in CIDR notation.") + + if not network: + raise ValueError("Must provide a network for the subnetwork.") + else: + if isinstance(network, GCENetwork): + network_url = network.extra["selfLink"] + else: + if network.startswith("https://"): + network_url = network + else: + network_obj = self.ex_get_network(network) + network_url = network_obj.extra["selfLink"] + + if not region: + raise ValueError("Must provide a region for the subnetwork.") + else: + if isinstance(region, GCERegion): + region_url = region.extra["selfLink"] + else: + if region.startswith("https://"): + region_url = region + else: + region_obj = self.ex_get_region(region) + region_url = region_obj.extra["selfLink"] + + subnet_data = {} + subnet_data["name"] = name + subnet_data["description"] = description + subnet_data["ipCidrRange"] = cidr + subnet_data["network"] = network_url + subnet_data["region"] = region_url + subnet_data["privateIpGoogleAccess"] = privateipgoogleaccess + subnet_data["secondaryIpRanges"] = secondaryipranges + region_name = region_url.split("/")[-1] + + request = "/regions/%s/subnetworks" % (region_name) + self.connection.async_request(request, method="POST", data=subnet_data) + + return self.ex_get_subnetwork(name, region_name) + + def ex_create_network(self, name, cidr, description=None, mode="legacy", routing_mode=None): + """ + Create a network. In November 2015, Google introduced Subnetworks and + suggests using networks with 'auto' generated subnetworks. See, the + `subnet docs `_ for + more details. Note that libcloud follows the usability pattern from + the Cloud SDK (e.g. 'gcloud compute' command-line utility) and uses + 'mode' to specify 'auto', 'custom', or 'legacy'. + + :param name: Name of network to be created + :type name: ``str`` + + :param cidr: Address range of network in CIDR format. + :type cidr: ``str`` or ``None`` + :param description: Custom description for the network. :type description: ``str`` or ``None`` + :param mode: Create a 'auto', 'custom', or 'legacy' network. + :type mode: ``str`` + + :param routing_mode: Create network with 'Global' or 'Regional' + routing mode for BGP advertisements. + Defaults to 'Regional' + :type routing_mode: ``str`` or ``None`` + :return: Network object :rtype: :class:`GCENetwork` """ network_data = {} - network_data['name'] = name - network_data['IPv4Range'] = cidr - network_data['description'] = description + network_data["name"] = name + network_data["description"] = description - request = '/global/networks' + if mode.lower() not in ["auto", "custom", "legacy"]: + raise ValueError( + "Invalid network mode: '%s'. Must be 'auto', " "'custom', or 'legacy'." % mode + ) - self.connection.async_request(request, method='POST', - data=network_data) + if cidr and mode in ["auto", "custom"]: + raise ValueError("Can only specify IPv4Range with 'legacy' mode.") + + if mode == "legacy": + if not cidr: + raise ValueError("Must specify IPv4Range with 'legacy' mode.") + network_data["IPv4Range"] = cidr + else: + network_data["autoCreateSubnetworks"] = mode.lower() == "auto" + + if routing_mode: + if routing_mode.lower() not in ["regional", "global"]: + raise ValueError( + "Invalid Routing Mode: '%s'. Must be " "'REGIONAL', or 'GLOBAL'." % routing_mode + ) + else: + network_data["routingConfig"] = {"routingMode": routing_mode.upper()} + + request = "/global/networks" + + self.connection.async_request(request, method="POST", data=network_data) return self.ex_get_network(name) - def create_node(self, name, size, image, location=None, - ex_network='default', ex_tags=None, ex_metadata=None, - ex_boot_disk=None, use_existing_disk=True, - external_ip='ephemeral', ex_disk_type='pd-standard', - ex_disk_auto_delete=True, ex_service_accounts=None, - description=None, ex_can_ip_forward=None, - ex_disks_gce_struct=None, ex_nic_gce_struct=None, - ex_on_host_maintenance=None, ex_automatic_restart=None): + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_network="default", + ex_subnetwork=None, + ex_tags=None, + ex_metadata=None, + ex_boot_disk=None, + use_existing_disk=True, + external_ip="ephemeral", + internal_ip=None, + ex_disk_type="pd-standard", + ex_disk_auto_delete=True, + ex_service_accounts=None, + description=None, + ex_can_ip_forward=None, + ex_disks_gce_struct=None, + ex_nic_gce_struct=None, + ex_on_host_maintenance=None, + ex_automatic_restart=None, + ex_preemptible=None, + ex_image_family=None, + ex_labels=None, + ex_accelerator_type=None, + ex_accelerator_count=None, + ex_disk_size=None, + ): """ Create a new node and return a node object for the node. @@ -2074,6 +4512,9 @@ def create_node(self, name, size, image, location=None, :keyword ex_network: The network to associate with the node. :type ex_network: ``str`` or :class:`GCENetwork` + :keyword ex_subnetwork: The subnetwork to associate with the node. + :type ex_subnetwork: ``str`` or :class:`GCESubnetwork` + :keyword ex_tags: A list of tags to associate with the node. :type ex_tags: ``list`` of ``str`` or ``None`` @@ -2081,7 +4522,7 @@ def create_node(self, name, size, image, location=None, :type ex_metadata: ``dict`` or ``None`` :keyword ex_boot_disk: The boot disk to attach to the instance. - :type ex_boot_disk: :class:`StorageVolume` or ``str`` + :type ex_boot_disk: :class:`StorageVolume` or ``str`` or ``None`` :keyword use_existing_disk: If True and if an existing disk with the same name/location is found, use that @@ -2093,7 +4534,10 @@ def create_node(self, name, size, image, location=None, used. If 'None', then no external address will be used. To use an existing static IP address, a GCEAddress object should be passed in. - :type external_ip: :class:`GCEAddress` or ``str`` or None + :type external_ip: :class:`GCEAddress` or ``str`` or ``None`` + + :keyword internal_ip: The private IP address to use. + :type internal_ip: :class:`GCEAddress` or ``str`` or ``None`` :keyword ex_disk_type: Specify a pd-standard (default) disk or pd-ssd for an SSD disk. @@ -2109,7 +4553,7 @@ def create_node(self, name, size, image, location=None, list of dictionaries containing email and list of scopes, e.g. [{'email':'default', - 'scopes':['compute', ...]}, ...] + 'scopes':['compute', ...]}, ...] Scopes can either be full URLs or short names. If not provided, use the 'default' service account email and a @@ -2144,7 +4588,7 @@ def create_node(self, name, size, image, location=None, 'ex_network'. See the GCE docs for details. :type ex_nic_gce_struct: ``list`` or ``None`` -n + :keyword ex_on_host_maintenance: Defines whether node should be terminated or migrated when host machine goes down. Acceptable values @@ -2161,123 +4605,1066 @@ def create_node(self, name, size, image, location=None, default value for the instance type.) :type ex_automatic_restart: ``bool`` or ``None`` + :keyword ex_preemptible: Defines whether the instance is preemptible. + (If not supplied, the instance will not be + preemptible) + :type ex_preemptible: ``bool`` or ``None`` + + :keyword ex_image_family: Determine image from an 'Image Family' + instead of by name. 'image' should be None + to use this keyword. + :type ex_image_family: ``str`` or ``None`` + + :keyword ex_labels: Labels dictionary for instance. + :type ex_labels: ``dict`` or ``None`` + + :keyword ex_accelerator_type: Defines the accelerator to use with this + node. Must set 'ex_on_host_maintenance' + to 'TERMINATE'. Must include a count of + accelerators to use in + 'ex_accelerator_count'. + :type ex_accelerator_type: ``str`` or ``None`` + + :keyword ex_accelerator_count: The number of 'ex_accelerator_type' + accelerators to attach to the node. + :type ex_accelerator_count: ``int`` or ``None`` + + :keyword ex_disk_size: Defines size of the boot disk. + Integer in gigabytes. + :type ex_disk_size: ``int`` or ``None`` + :return: A Node object for the new node. :rtype: :class:`Node` """ + if ex_boot_disk and ex_disks_gce_struct: - raise ValueError("Cannot specify both 'ex_boot_disk' and " - "'ex_disks_gce_struct'") + raise ValueError("Cannot specify both 'ex_boot_disk' and " "'ex_disks_gce_struct'") + + if image and ex_image_family: + raise ValueError("Cannot specify both 'image' and " "'ex_image_family'") - if not image and not ex_boot_disk and not ex_disks_gce_struct: - raise ValueError("Missing root device or image. Must specify an " - "'image', existing 'ex_boot_disk', or use the " - "'ex_disks_gce_struct'.") + if not (image or ex_image_family or ex_boot_disk or ex_disks_gce_struct): + raise ValueError( + "Missing root device or image. Must specify an " + "'image', 'ex_image_family', existing " + "'ex_boot_disk', or use the " + "'ex_disks_gce_struct'." + ) location = location or self.zone - if not hasattr(location, 'name'): + + if location and not hasattr(location, "name"): location = self.ex_get_zone(location) - if not hasattr(size, 'name'): + + if not hasattr(size, "name"): size = self.ex_get_size(size, location) - if not hasattr(ex_network, 'name'): + + if not hasattr(ex_network, "name"): ex_network = self.ex_get_network(ex_network) - if image and not hasattr(image, 'name'): + + if ex_subnetwork and not hasattr(ex_subnetwork, "name"): + ex_subnetwork = self.ex_get_subnetwork( + ex_subnetwork, region=self._get_region_from_zone(location) + ) + + if ex_image_family: + image = self.ex_get_image_from_family(ex_image_family) + + if image and not hasattr(image, "name"): image = self.ex_get_image(image) - if not hasattr(ex_disk_type, 'name'): + + if ex_disk_type and not hasattr(ex_disk_type, "name"): ex_disk_type = self.ex_get_disktype(ex_disk_type, zone=location) + if ex_boot_disk and not hasattr(ex_boot_disk, "name"): + ex_boot_disk = self.ex_get_volume(ex_boot_disk, zone=location) + + if ex_accelerator_type and not hasattr(ex_accelerator_type, "name"): + if ex_accelerator_count is None: + raise ValueError( + "Missing accelerator count. Must specify an " + "'ex_accelerator_count' when using " + "'ex_accelerator_type'." + ) + ex_accelerator_type = self.ex_get_accelerator_type(ex_accelerator_type, zone=location) + # Use disks[].initializeParams to auto-create the boot disk + if not ex_disks_gce_struct and not ex_boot_disk: - ex_disks_gce_struct = [{ - 'autoDelete': ex_disk_auto_delete, - 'boot': True, - 'type': 'PERSISTENT', - 'mode': 'READ_WRITE', - 'deviceName': name, - 'initializeParams': { - 'diskName': name, - 'diskType': ex_disk_type.extra['selfLink'], - 'sourceImage': image.extra['selfLink'] + ex_disks_gce_struct = [ + { + "autoDelete": ex_disk_auto_delete, + "boot": True, + "type": "PERSISTENT", + "mode": "READ_WRITE", + "deviceName": name, + "initializeParams": { + "diskName": name, + "diskSizeGb": ex_disk_size, + "diskType": ex_disk_type.extra["selfLink"], + "sourceImage": image.extra["selfLink"], + }, } - }] - - request, node_data = self._create_node_req(name, size, image, - location, ex_network, - ex_tags, ex_metadata, - ex_boot_disk, external_ip, - ex_disk_type, - ex_disk_auto_delete, - ex_service_accounts, - description, - ex_can_ip_forward, - ex_disks_gce_struct, - ex_nic_gce_struct, - ex_on_host_maintenance, - ex_automatic_restart) - self.connection.async_request(request, method='POST', data=node_data) - return self.ex_get_node(name, location.name) + ] - def ex_create_multiple_nodes(self, base_name, size, image, number, - location=None, ex_network='default', - ex_tags=None, ex_metadata=None, - ignore_errors=True, use_existing_disk=True, - poll_interval=2, external_ip='ephemeral', - ex_disk_type='pd-standard', - ex_disk_auto_delete=True, - ex_service_accounts=None, - timeout=DEFAULT_TASK_COMPLETION_TIMEOUT, - description=None, - ex_can_ip_forward=None, - ex_disks_gce_struct=None, - ex_nic_gce_struct=None, - ex_on_host_maintenance=None, - ex_automatic_restart=None): - """ - Create multiple nodes and return a list of Node objects. + if not location and size.extra.get("zone", None): + # If location is not provided (either via datacenter driver + # constructor argument or via location argument in this method) + # we simply default to size location. Not ideal, but it works + # for the default experience. + location = size.extra["zone"] - Nodes will be named with the base name and a number. For example, if - the base name is 'libcloud' and you create 3 nodes, they will be - named:: + # Verify that the location is provided if we can't infer one + self._verify_zone_is_set(zone=location) - libcloud-000 - libcloud-001 - libcloud-002 + request, node_data = self._create_node_req( + name, + size, + image, + location, + network=ex_network, + tags=ex_tags, + metadata=ex_metadata, + boot_disk=ex_boot_disk, + external_ip=external_ip, + internal_ip=internal_ip, + ex_disk_type=ex_disk_type, + ex_disk_auto_delete=ex_disk_auto_delete, + ex_service_accounts=ex_service_accounts, + description=description, + ex_can_ip_forward=ex_can_ip_forward, + ex_disks_gce_struct=ex_disks_gce_struct, + ex_nic_gce_struct=ex_nic_gce_struct, + ex_on_host_maintenance=ex_on_host_maintenance, + ex_automatic_restart=ex_automatic_restart, + ex_preemptible=ex_preemptible, + ex_subnetwork=ex_subnetwork, + ex_labels=ex_labels, + ex_accelerator_type=ex_accelerator_type, + ex_accelerator_count=ex_accelerator_count, + ) + self.connection.async_request(request, method="POST", data=node_data) - :param base_name: The base name of the nodes to create. - :type base_name: ``str`` + return self.ex_get_node(name, location.name) + + def ex_create_instancetemplate( + self, + name, + size, + source=None, + image=None, + disk_type="pd-standard", + disk_auto_delete=True, + network="default", + subnetwork=None, + can_ip_forward=None, + external_ip="ephemeral", + internal_ip=None, + service_accounts=None, + on_host_maintenance=None, + automatic_restart=None, + preemptible=None, + tags=None, + metadata=None, + description=None, + disks_gce_struct=None, + nic_gce_struct=None, + ): + """ + Creates an instance template in the specified project using the data + that is included in the request. If you are creating a new template to + update an existing instance group, your new instance template must + use the same network or, if applicable, the same subnetwork as the + original template. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param name: The name of the node to create. + :type name: ``str`` :param size: The machine type to use. :type size: ``str`` or :class:`GCENodeSize` - :param image: The image to use to create the nodes. - :type image: ``str`` or :class:`GCENodeImage` + :param image: The image to use to create the node (or, if attaching + a persistent disk, the image used to create the disk) + :type image: ``str`` or :class:`GCENodeImage` or ``None`` - :param number: The number of nodes to create. - :type number: ``int`` + :keyword network: The network to associate with the template. + :type network: ``str`` or :class:`GCENetwork` - :keyword location: The location (zone) to create the nodes in. - :type location: ``str`` or :class:`NodeLocation` or - :class:`GCEZone` or ``None`` + :keyword subnetwork: The subnetwork to associate with the node. + :type subnetwork: ``str`` or :class:`GCESubnetwork` - :keyword ex_network: The network to associate with the nodes. - :type ex_network: ``str`` or :class:`GCENetwork` + :keyword tags: A list of tags to associate with the node. + :type tags: ``list`` of ``str`` or ``None`` - :keyword ex_tags: A list of tags to assiciate with the nodes. - :type ex_tags: ``list`` of ``str`` or ``None`` + :keyword metadata: Metadata dictionary for instance. + :type metadata: ``dict`` or ``None`` - :keyword ex_metadata: Metadata dictionary for instances. - :type ex_metadata: ``dict`` or ``None`` + :keyword external_ip: The external IP address to use. If 'ephemeral' + (default), a new non-static address will be + used. If 'None', then no external address will + be used. To use an existing static IP address, + a GCEAddress object should be passed in. + :type external_ip: :class:`GCEAddress` or ``str`` or ``None`` - :keyword ignore_errors: If True, don't raise Exceptions if one or - more nodes fails. - :type ignore_errors: ``bool`` + :keyword internal_ip: The private IP address to use. + :type internal_ip: :class:`GCEAddress` or ``str`` or ``None`` - :keyword use_existing_disk: If True and if an existing disk with the - same name/location is found, use that - disk instead of creating a new one. - :type use_existing_disk: ``bool`` + :keyword disk_type: Specify a pd-standard (default) disk or pd-ssd + for an SSD disk. + :type disk_type: ``str`` or :class:`GCEDiskType` - :keyword poll_interval: Number of seconds between status checks. - :type poll_interval: ``int`` + :keyword disk_auto_delete: Indicate that the boot disk should be + deleted when the Node is deleted. Set to + True by default. + :type disk_auto_delete: ``bool`` + + :keyword service_accounts: Specify a list of serviceAccounts when + creating the instance. The format is a + list of dictionaries containing email + and list of scopes, e.g. + [{'email':'default', + 'scopes':['compute', ...]}, ...] + Scopes can either be full URLs or short + names. If not provided, use the + 'default' service account email and a + scope of 'devstorage.read_only'. Also + accepts the aliases defined in + 'gcloud compute'. + :type service_accounts: ``list`` + + :keyword description: The description of the node (instance). + :type description: ``str`` or ``None`` + + :keyword can_ip_forward: Set to ``True`` to allow this node to + send/receive non-matching src/dst packets. + :type can_ip_forward: ``bool`` or ``None`` + + :keyword disks_gce_struct: Support for passing in the GCE-specific + formatted disks[] structure. No attempt + is made to ensure proper formatting of + the disks[] structure. Using this + structure obviates the need of using + other disk params like 'ex_boot_disk', + etc. See the GCE docs for specific + details. + :type disks_gce_struct: ``list`` or ``None`` + + :keyword nic_gce_struct: Support passing in the GCE-specific + formatted networkInterfaces[] structure. + No attempt is made to ensure proper + formatting of the networkInterfaces[] + data. Using this structure obviates the + need of using 'external_ip' and + 'ex_network'. See the GCE docs for + details. + :type nic_gce_struct: ``list`` or ``None`` + + :keyword on_host_maintenance: Defines whether node should be + terminated or migrated when host + machine goes down. Acceptable values + are: 'MIGRATE' or 'TERMINATE' (If + not supplied, value will be reset to + GCE default value for the instance + type.) + :type ex_on_host_maintenance: ``str`` or ``None`` + + :keyword automatic_restart: Defines whether the instance should be + automatically restarted when it is + terminated by Compute Engine. (If not + supplied, value will be set to the GCE + default value for the instance type.) + :type automatic_restart: ``bool`` or ``None`` + + :keyword preemptible: Defines whether the instance is preemptible. + (If not supplied, the instance will not be + preemptible) + :type preemptible: ``bool`` or ``None`` + + :return: An Instance Template object. + :rtype: :class:`GCEInstanceTemplate` + """ + request = "/global/instanceTemplates" + + properties = self._create_instance_properties( + name, + node_size=size, + source=source, + image=image, + disk_type=disk_type, + disk_auto_delete=True, + external_ip=external_ip, + network=network, + subnetwork=subnetwork, + can_ip_forward=can_ip_forward, + service_accounts=service_accounts, + on_host_maintenance=on_host_maintenance, + internal_ip=internal_ip, + automatic_restart=automatic_restart, + preemptible=preemptible, + tags=tags, + metadata=metadata, + description=description, + disks_gce_struct=disks_gce_struct, + nic_gce_struct=nic_gce_struct, + use_selflinks=False, + ) + + request_data = { + "name": name, + "description": description, + "properties": properties, + } + + self.connection.async_request(request, method="POST", data=request_data) + + return self.ex_get_instancetemplate(name) + + def _create_instance_properties( + self, + name, + node_size, + source=None, + image=None, + disk_type="pd-standard", + disk_auto_delete=True, + network="default", + subnetwork=None, + external_ip="ephemeral", + internal_ip=None, + can_ip_forward=None, + service_accounts=None, + on_host_maintenance=None, + automatic_restart=None, + preemptible=None, + tags=None, + metadata=None, + description=None, + disks_gce_struct=None, + nic_gce_struct=None, + use_selflinks=True, + labels=None, + accelerator_type=None, + accelerator_count=None, + disk_size=None, + ): + """ + Create the GCE instance properties needed for instance templates. + + :param node_size: The machine type to use. + :type node_size: ``str`` or :class:`GCENodeSize` + + :keyword source: A source disk to attach to the instance. Cannot + specify both 'image' and 'source'. + :type source: :class:`StorageVolume` or ``str`` or ``None`` + + :param image: The image to use to create the node. Cannot specify + both 'image' and 'source'. + :type image: ``str`` or :class:`GCENodeImage` or ``None`` + + :keyword disk_type: Specify a pd-standard (default) disk or pd-ssd + for an SSD disk. + :type disk_type: ``str`` or :class:`GCEDiskType` + + :keyword disk_auto_delete: Indicate that the boot disk should be + deleted when the Node is deleted. Set to + True by default. + :type disk_auto_delete: ``bool`` + + :keyword network: The network to associate with the node. + :type network: ``str`` or :class:`GCENetwork` + + :keyword subnetwork: The Subnetwork resource for this instance. If + the network resource is in legacy mode, do not + provide this property. If the network is in auto + subnet mode, providing the subnetwork is + optional. If the network is in custom subnet + mode, then this field should be specified. + :type subnetwork: :class: `GCESubnetwork` or None + + :keyword external_ip: The external IP address to use. If 'ephemeral' + (default), a new non-static address will be + used. If 'None', then no external address will + be used. To use an existing static IP address, + a GCEAddress object should be passed in. + :type external_ip: :class:`GCEAddress` or ``str`` or ``None`` + + :keyword internal_ip: The private IP address to use. + :type internal_ip: :class:`GCEAddress` or ``str`` or ``None`` + + :keyword can_ip_forward: Set to ``True`` to allow this node to + send/receive non-matching src/dst packets. + :type can_ip_forward: ``bool`` or ``None`` + + :keyword service_accounts: Specify a list of serviceAccounts when + creating the instance. The format is a + list of dictionaries containing email + and list of scopes, e.g. + [{'email':'default', + 'scopes':['compute', ...]}, ...] + Scopes can either be full URLs or short + names. If not provided, use the + 'default' service account email and a + scope of 'devstorage.read_only'. Also + accepts the aliases defined in + 'gcloud compute'. + :type service_accounts: ``list`` + + :keyword on_host_maintenance: Defines whether node should be + terminated or migrated when host + machine goes down. Acceptable values + are: 'MIGRATE' or 'TERMINATE' (If + not supplied, value will be reset to + GCE default value for the instance + type.) + :type on_host_maintenance: ``str`` or ``None`` + + :keyword automatic_restart: Defines whether the instance should be + automatically restarted when it is + terminated by Compute Engine. (If not + supplied, value will be set to the GCE + default value for the instance type.) + :type automatic_restart: ``bool`` or ``None`` + + :keyword preemptible: Defines whether the instance is preemptible. + (If not supplied, the instance will not be + preemptible) + :type preemptible: ``bool`` or ``None`` + + :keyword tags: A list of tags to associate with the node. + :type tags: ``list`` of ``str`` or ``None`` + + :keyword metadata: Metadata dictionary for instance. + :type metadata: ``dict`` or ``None`` + + :keyword description: The description of the node (instance). + :type description: ``str`` or ``None`` + + :keyword disks_gce_struct: Support for passing in the GCE-specific + formatted disks[] structure. No attempt + is made to ensure proper formatting of + the disks[] structure. Using this + structure obviates the need of using + other disk params like 'boot_disk', + etc. See the GCE docs for specific + details. + :type disks_gce_struct: ``list`` or ``None`` + + :keyword nic_gce_struct: Support passing in the GCE-specific + formatted networkInterfaces[] structure. + No attempt is made to ensure proper + formatting of the networkInterfaces[] + data. Using this structure obviates the + need of using 'external_ip' and + 'network'. See the GCE docs for + details. + :type nic_gce_struct: ``list`` or ``None`` + + :type labels: Labels dict for instance + :type labels: ``dict`` or ``None`` + + :keyword accelerator_type: Support for passing in the GCE-specifc + accelerator type to request for the VM. + :type accelerator_type: :class:`GCEAcceleratorType` or ``None`` + + :keyword accelerator_count: Support for passing in the number of + requested 'accelerator_type' accelerators + attached to the VM. Will only pay attention + to this field if 'accelerator_type' is not + None. + :type accelerator_count: ``int`` or ``None`` + + :keyword disk_size: Specify size of the boot disk. + Integer in gigabytes. + :type disk_size: ``int`` or ``None`` + + :return: A dictionary formatted for use with the GCE API. + :rtype: ``dict`` + """ + instance_properties = {} + + # build disks + + if not image and not source and not disks_gce_struct: + raise ValueError( + "Missing root device or image. Must specify an " + "'image', source, or use the " + "'disks_gce_struct'." + ) + + if source and disks_gce_struct: + raise ValueError( + "Cannot specify both 'source' and " "'disks_gce_struct'. Use one or the other." + ) + + if disks_gce_struct: + instance_properties["disks"] = disks_gce_struct + else: + disk_name = None + device_name = None + + if source: + disk_name = source.name + # TODO(supertom): what about device name? + device_name = source.name + image = None + + instance_properties["disks"] = [ + self._build_disk_gce_struct( + device_name, + source=source, + disk_type=disk_type, + image=image, + disk_name=disk_name, + usage_type="PERSISTENT", + mount_mode="READ_WRITE", + auto_delete=disk_auto_delete, + is_boot=True, + use_selflinks=use_selflinks, + disk_size=disk_size, + ) + ] + + # build network interfaces + + if nic_gce_struct is not None: + if hasattr(external_ip, "address"): + raise ValueError( + "Cannot specify both a static IP address " + "and 'nic_gce_struct'. Use one or the " + "other." + ) + + if hasattr(network, "name"): + if network.name == "default": # pylint: disable=no-member + # assume this is just the default value from create_node() + # and since the user specified ex_nic_gce_struct, the + # struct should take precedence + network = None + else: + raise ValueError( + "Cannot specify both 'network' and " + "'nic_gce_struct'. Use one or the " + "other." + ) + instance_properties["networkInterfaces"] = nic_gce_struct + else: + instance_properties["networkInterfaces"] = [ + self._build_network_gce_struct( + network=network, + subnetwork=subnetwork, + external_ip=external_ip, + use_selflinks=True, + internal_ip=internal_ip, + ) + ] + + # build scheduling + scheduling = self._build_scheduling_gce_struct( + on_host_maintenance, automatic_restart, preemptible + ) + + if scheduling: + instance_properties["scheduling"] = scheduling + + # build service accounts/scopes + instance_properties["serviceAccounts"] = self._build_service_accounts_gce_list( + service_accounts + ) + + # build accelerators + + if accelerator_type is not None: + instance_properties["guestAccelerators"] = self._format_guest_accelerators( + accelerator_type, accelerator_count + ) + + # include general properties + + if description: + instance_properties["description"] = str(description) + + if tags: + instance_properties["tags"] = {"items": tags} + + if metadata: + instance_properties["metadata"] = self._format_metadata( + fingerprint="na", metadata=metadata + ) + + if labels: + instance_properties["labels"] = labels + + if can_ip_forward: + instance_properties["canIpForward"] = True + + instance_properties["machineType"] = self._get_selflink_or_name( + obj=node_size, get_selflinks=use_selflinks, objname="size" + ) + + return instance_properties + + def _build_disk_gce_struct( + self, + device_name, + source=None, + disk_type=None, + disk_size=None, + image=None, + disk_name=None, + is_boot=True, + mount_mode="READ_WRITE", + usage_type="PERSISTENT", + auto_delete=True, + use_selflinks=True, + ): + """ + Generates the GCP dict for a disk. + + :param device_name: Specifies a unique device name of your + choice that is reflected into the + /dev/disk/by-id/google-* tree + of a Linux operating system running within the + instance. This name can be used to reference the + device for mounting, resizing, and so on, from + within the instance. Defaults to disk_name. + :type device_name: ``str`` + + :keyword source: The disk to attach to the instance. + :type source: ``str`` of selfLink, :class:`StorageVolume` or None + + :keyword disk_type: Specify a URL or DiskType object. + :type disk_type: ``str`` or :class:`GCEDiskType` or ``None`` + + :keyword image: The image to use to create the disk. + :type image: :class:`GCENodeImage` or ``None`` + + :keyword disk_size: Integer in gigabytes. + :type disk_size: ``int`` + + :param disk_name: Specifies the disk name. If not specified, the + default is to use the device_name. + :type disk_name: ``str`` + + :keyword mount_mode: The mode in which to attach this disk, either + READ_WRITE or READ_ONLY. If not specified, + the default is to attach the disk in READ_WRITE + mode. + :type mount_mode: ``str`` + + :keyword usage_type: Specifies the type of the disk, either SCRATCH + or PERSISTENT. If not specified, the default + is PERSISTENT. + :type usage_type: ``str`` + + :keyword auto_delete: Indicate that the boot disk should be + deleted when the Node is deleted. Set to + True by default. + :type auto_delete: ``bool`` + + :return: Dictionary to be used in disk-portion of + instance API call. + :rtype: ``dict`` + """ + # validation + + if source is None and image is None: + raise ValueError("Either the 'source' or 'image' argument must be specified.") + + if not isinstance(auto_delete, bool): + raise ValueError("auto_delete field is not a bool.") + + if disk_size is not None and not (isinstance(disk_size, int) or disk_size.isdigit()): + raise ValueError("disk_size must be a digit, '%s' provided." % str(disk_size)) + + mount_modes = ["READ_WRITE", "READ_ONLY"] + + if mount_mode not in mount_modes: + raise ValueError("mount mode must be one of: %s." % (",".join(mount_modes))) + usage_types = ["PERSISTENT", "SCRATCH"] + + if usage_type not in usage_types: + raise ValueError("usage type must be one of: %s." % (",".join(usage_types))) + + disk = {} + + if not disk_name: + disk_name = device_name + + if source is not None: + disk["source"] = self._get_selflink_or_name( + obj=source, get_selflinks=use_selflinks, objname="volume" + ) + + else: + # create new disk + # we need the URL of the image, always. + image = self._get_selflink_or_name(obj=image, get_selflinks=True, objname="image") + disk_type = self._get_selflink_or_name( + obj=disk_type, get_selflinks=use_selflinks, objname="disktype" + ) + + disk["initializeParams"] = { + "diskName": disk_name, + "diskType": disk_type, + "sourceImage": image, + } + + if disk_size is not None: + disk["initializeParams"]["diskSizeGb"] = disk_size + + # add in basic attributes + disk.update( + { + "boot": is_boot, + "type": usage_type, + "mode": mount_mode, + "deviceName": device_name, + "autoDelete": auto_delete, + } + ) + + return disk + + def _get_selflink_or_name(self, obj, get_selflinks=True, objname=None): + """ + Return the selflink or name, given a name or object. + + Will try to fetch the appropriate object if necessary (assumes + we only need one parameter to fetch the object, no introspection + is performed). + + :param obj: object to test. + :type obj: ``str`` or ``object`` + + :param get_selflinks: Inform if we should return selfLinks or just + the name. Default is True. + :param get_selflinks: ``bool`` + + :param objname: string to use in constructing method call + :type objname: ``str`` or None + + :return: URL from extra['selfLink'] or name + :rtype: ``str`` + """ + + if get_selflinks: + if not hasattr(obj, "name"): + if objname: + getobj = getattr(self, "ex_get_%s" % (objname)) + obj = getobj(obj) + else: + raise ValueError("objname must be set if selflinks is True.") + + return obj.extra["selfLink"] + else: + if not hasattr(obj, "name"): + return obj + else: + return obj.name + + def _build_network_gce_struct( + self, + network, + subnetwork=None, + external_ip=None, + use_selflinks=True, + internal_ip=None, + ): + """ + Build network interface dict for use in the GCE API. + + Note: Must be wrapped in a list before passing to the GCE API. + + :param network: The network to associate with the node. + :type network: :class:`GCENetwork` + + :keyword subnetwork: The subnetwork to include. + :type subnetwork: :class:`GCESubNetwork` + + :keyword external_ip: The external IP address to use. If 'ephemeral' + (default), a new non-static address will be + used. If 'None', then no external address will + be used. To use an existing static IP address, + a GCEAddress object should be passed in. + :type external_ip: :class:`GCEAddress` + + :keyword internal_ip: The private IP address to use. + :type internal_ip: :class:`GCEAddress` or ``str`` + + :return: network interface dict + :rtype: ``dict`` + """ + ni = {} + ni = {"kind": "compute#instanceNetworkInterface"} + + if network is None: + network = "default" + + ni["network"] = self._get_selflink_or_name( + obj=network, get_selflinks=use_selflinks, objname="network" + ) + + if subnetwork: + ni["subnetwork"] = self._get_selflink_or_name( + obj=subnetwork, get_selflinks=use_selflinks, objname="subnetwork" + ) + + if external_ip: + access_configs = [{"name": "External NAT", "type": "ONE_TO_ONE_NAT"}] + + if hasattr(external_ip, "address"): + access_configs[0]["natIP"] = external_ip.address + ni["accessConfigs"] = access_configs + + if internal_ip: + ni["networkIP"] = internal_ip + + return ni + + def _build_service_account_gce_struct( + self, + service_account, + default_email="default", + default_scope="devstorage.read_only", + ): + """ + Helper to create Service Account dict. Use + _build_service_accounts_gce_list to create a list ready for the + GCE API. + + :param: service_account: dictionarie containing email + and list of scopes, e.g. + [{'email':'default', + 'scopes':['compute', ...]}, ...] + Scopes can either be full URLs or short + names. If not provided, use the + 'default' service account email and a + scope of 'devstorage.read_only'. Also + accepts the aliases defined in + 'gcloud compute'. + :type service_account: ``dict`` or None + + :return: dict usable in GCE API call. + :rtype: ``dict`` + """ + + if not isinstance(service_account, dict): + raise ValueError( + "service_account not in the correct format," + "'%s - %s'" % (str(type(service_account)), str(service_account)) + ) + sa = {} + + if "email" not in service_account: + sa["email"] = default_email + else: + sa["email"] = service_account["email"] + + if "scopes" not in service_account: + sa["scopes"] = [self.AUTH_URL + default_scope] + else: + ps = [] + + for scope in service_account["scopes"]: + if scope.startswith(self.AUTH_URL): + ps.append(scope) + elif scope in self.SA_SCOPES_MAP: + ps.append(self.AUTH_URL + self.SA_SCOPES_MAP[scope]) + else: + ps.append(self.AUTH_URL + scope) + sa["scopes"] = ps + + return sa + + def _build_service_accounts_gce_list( + self, + service_accounts=None, + default_email="default", + default_scope="devstorage.read_only", + ): + """ + Helper to create service account list for GCE API. + + :keyword service_accounts: Specify a list of serviceAccounts when + creating the instance. The format is a + list of dictionaries containing email + and list of scopes, e.g. + [{'email':'default', + 'scopes':['compute', ...]}, ...] + Scopes can either be full URLs or short + names. If not provided, use the + 'default' service account email and a + scope of 'devstorage.read_only'. Also + accepts the aliases defined in + 'gcloud compute'. + + :type service_accounts: ``list`` of ``dict``, ``None`` or an empty + list. ``None` means use a default service + account and an empty list indicates no + service account. + + :return: list of dictionaries usable in the GCE API. + :rtype: ``list`` of ``dict`` + """ + gce_service_accounts = [] + + if service_accounts is None: + gce_service_accounts = [ + {"email": default_email, "scopes": [self.AUTH_URL + default_scope]} + ] + elif not isinstance(service_accounts, list): + raise ValueError("service_accounts field is not a list.") + else: + for sa in service_accounts: + gce_service_accounts.append( + self._build_service_account_gce_struct(service_account=sa) + ) + + return gce_service_accounts + + def _build_scheduling_gce_struct( + self, on_host_maintenance=None, automatic_restart=None, preemptible=None + ): + """ + Build the scheduling dict suitable for use with the GCE API. + + :param on_host_maintenance: Defines whether node should be + terminated or migrated when host + machine goes down. Acceptable values + are: 'MIGRATE' or 'TERMINATE' (If + not supplied, value will be reset to + GCE default value for the instance + type.) + :type on_host_maintenance: ``str`` or ``None`` + + :param automatic_restart: Defines whether the instance should be + automatically restarted when it is + terminated by Compute Engine. (If not + supplied, value will be set to the GCE + default value for the instance type.) + :type automatic_restart: ``bool`` or ``None`` + + :param preemptible: Defines whether the instance is preemptible. + (If not supplied, the instance will + not be preemptible) + :type preemptible: ``bool`` or ``None`` + + :return: A dictionary of scheduling options for the GCE API. + :rtype: ``dict`` + """ + scheduling = {} + + if preemptible is not None: + if isinstance(preemptible, bool): + scheduling["preemptible"] = preemptible + else: + raise ValueError("boolean expected for preemptible") + + if on_host_maintenance is not None: + maint_opts = ["MIGRATE", "TERMINATE"] + + if isinstance(on_host_maintenance, str) and on_host_maintenance in maint_opts: + if preemptible is True and on_host_maintenance == "MIGRATE": + raise ValueError( + "host maintenance cannot be 'MIGRATE' " "if instance is preemptible." + ) + scheduling["onHostMaintenance"] = on_host_maintenance + else: + raise ValueError("host maintenance must be one of %s" % (",".join(maint_opts))) + + if automatic_restart is not None: + if isinstance(automatic_restart, bool): + if automatic_restart is True and preemptible is True: + raise ValueError("instance cannot be restarted if it is preemptible.") + scheduling["automaticRestart"] = automatic_restart + + else: + raise ValueError("boolean expected for automatic") + + return scheduling + + def ex_create_multiple_nodes( + self, + base_name, + size, + image, + number, + location=None, + ex_network="default", + ex_subnetwork=None, + ex_tags=None, + ex_metadata=None, + ignore_errors=True, + use_existing_disk=True, + poll_interval=2, + external_ip="ephemeral", + internal_ip=None, + ex_disk_type="pd-standard", + ex_disk_auto_delete=True, + ex_service_accounts=None, + timeout=DEFAULT_TASK_COMPLETION_TIMEOUT, + description=None, + ex_can_ip_forward=None, + ex_disks_gce_struct=None, + ex_nic_gce_struct=None, + ex_on_host_maintenance=None, + ex_automatic_restart=None, + ex_image_family=None, + ex_preemptible=None, + ex_labels=None, + ex_disk_size=None, + ): + """ + Create multiple nodes and return a list of Node objects. + + Nodes will be named with the base name and a number. For example, if + the base name is 'libcloud' and you create 3 nodes, they will be + named:: + + libcloud-000 + libcloud-001 + libcloud-002 + + :param base_name: The base name of the nodes to create. + :type base_name: ``str`` + + :param size: The machine type to use. + :type size: ``str`` or :class:`GCENodeSize` + + :param image: The image to use to create the nodes. + :type image: ``str`` or :class:`GCENodeImage` + + :param number: The number of nodes to create. + :type number: ``int`` + + :keyword location: The location (zone) to create the nodes in. + :type location: ``str`` or :class:`NodeLocation` or + :class:`GCEZone` or ``None`` + + :keyword ex_network: The network to associate with the nodes. + :type ex_network: ``str`` or :class:`GCENetwork` + + :keyword ex_tags: A list of tags to associate with the nodes. + :type ex_tags: ``list`` of ``str`` or ``None`` + + :keyword ex_metadata: Metadata dictionary for instances. + :type ex_metadata: ``dict`` or ``None`` + + :keyword ignore_errors: If True, don't raise Exceptions if one or + more nodes fails. + :type ignore_errors: ``bool`` + + :keyword use_existing_disk: If True and if an existing disk with the + same name/location is found, use that + disk instead of creating a new one. + :type use_existing_disk: ``bool`` + + :keyword poll_interval: Number of seconds between status checks. + :type poll_interval: ``int`` :keyword external_ip: The external IP address to use. If 'ephemeral' (default), a new non-static address will be @@ -2286,6 +5673,10 @@ def ex_create_multiple_nodes(self, base_name, size, image, number, multiple node creation.) :type external_ip: ``str`` or None + + :keyword internal_ip: The private IP address to use. + :type internal_ip: :class:`GCEAddress` or ``str`` or ``None`` + :keyword ex_disk_type: Specify a pd-standard (default) disk or pd-ssd for an SSD disk. :type ex_disk_type: ``str`` or :class:`GCEDiskType` @@ -2300,7 +5691,7 @@ def ex_create_multiple_nodes(self, base_name, size, image, number, list of dictionaries containing email and list of scopes, e.g. [{'email':'default', - 'scopes':['compute', ...]}, ...] + 'scopes':['compute', ...]}, ...] Scopes can either be full URLs or short names. If not provided, use the 'default' service account email and a @@ -2310,16 +5701,25 @@ def ex_create_multiple_nodes(self, base_name, size, image, number, :type ex_service_accounts: ``list`` :keyword timeout: The number of seconds to wait for all nodes to be - created before timing out. + created before timing out. On timeout, + :class:`GCEMultipleNodesTimeoutError` exposes known + results in ``nodes`` and unresolved names in + ``pending_node_names``. Resources are not deleted; + pending operations may still complete. :type timeout: ``int`` :keyword description: The description of the node (instance). :type description: ``str`` or ``None`` :keyword ex_can_ip_forward: Set to ``True`` to allow this node to - send/receive non-matching src/dst packets. + send/receive non-matching src/dst packets. :type ex_can_ip_forward: ``bool`` or ``None`` + :keyword ex_preemptible: Defines whether the instance is preemptible. + (If not supplied, the instance will + not be preemptible) + :type ex_preemptible: ``bool`` or ``None`` + :keyword ex_disks_gce_struct: Support for passing in the GCE-specific formatted disks[] structure. No attempt is made to ensure proper formatting of @@ -2339,7 +5739,7 @@ def ex_create_multiple_nodes(self, base_name, size, image, number, 'ex_network'. See the GCE docs for details. :type ex_nic_gce_struct: ``list`` or ``None`` -n + :keyword ex_on_host_maintenance: Defines whether node should be terminated or migrated when host machine goes down. Acceptable values @@ -2356,87 +5756,123 @@ def ex_create_multiple_nodes(self, base_name, size, image, number, default value for the instance type.) :type ex_automatic_restart: ``bool`` or ``None`` + :keyword ex_image_family: Determine image from an 'Image Family' + instead of by name. 'image' should be None + to use this keyword. + :type ex_image_family: ``str`` or ``None`` + + :param ex_labels: Label dict for node. + :type ex_labels: ``dict`` + + :keyword ex_disk_size: Defines size of the boot disk. + Integer in gigabytes. + :type ex_disk_size: ``int`` or ``None`` + :return: A list of Node objects for the new nodes. :rtype: ``list`` of :class:`Node` + """ + + if image and ex_disks_gce_struct: + raise ValueError("Cannot specify both 'image' and " "'ex_disks_gce_struct'.") + + if image and ex_image_family: + raise ValueError("Cannot specify both 'image' and " "'ex_image_family'") + location = location or self.zone - if not hasattr(location, 'name'): + + if not hasattr(location, "name"): location = self.ex_get_zone(location) - if not hasattr(size, 'name'): + + if not hasattr(size, "name"): size = self.ex_get_size(size, location) - if not hasattr(ex_network, 'name'): + + if not hasattr(ex_network, "name"): ex_network = self.ex_get_network(ex_network) - if image and not hasattr(image, 'name'): + + if ex_subnetwork and not hasattr(ex_subnetwork, "name"): + ex_subnetwork = self.ex_get_subnetwork( + ex_subnetwork, region=self._get_region_from_zone(location) + ) + + if ex_image_family: + image = self.ex_get_image_from_family(ex_image_family) + + if image and not hasattr(image, "name"): image = self.ex_get_image(image) - if not hasattr(ex_disk_type, 'name'): - ex_disk_type = self.ex_get_disktype(ex_disk_type, zone=location) - node_attrs = {'size': size, - 'image': image, - 'location': location, - 'network': ex_network, - 'tags': ex_tags, - 'metadata': ex_metadata, - 'ignore_errors': ignore_errors, - 'use_existing_disk': use_existing_disk, - 'external_ip': external_ip, - 'ex_disk_type': ex_disk_type, - 'ex_disk_auto_delete': ex_disk_auto_delete, - 'ex_service_accounts': ex_service_accounts, - 'description': description, - 'ex_can_ip_forward': ex_can_ip_forward, - 'ex_disks_gce_struct': ex_disks_gce_struct, - 'ex_nic_gce_struct': ex_nic_gce_struct, - 'ex_on_host_maintenance': ex_on_host_maintenance, - 'ex_automatic_restart': ex_automatic_restart} + if not hasattr(ex_disk_type, "name"): + ex_disk_type = self.ex_get_disktype(ex_disk_type, zone=location) + node_attrs = { + "size": size, + "image": image, + "location": location, + "network": ex_network, + "subnetwork": ex_subnetwork, + "tags": ex_tags, + "metadata": ex_metadata, + "ignore_errors": ignore_errors, + "use_existing_disk": use_existing_disk, + "external_ip": external_ip, + "internal_ip": internal_ip, + "ex_disk_type": ex_disk_type, + "ex_disk_auto_delete": ex_disk_auto_delete, + "ex_service_accounts": ex_service_accounts, + "description": description, + "ex_can_ip_forward": ex_can_ip_forward, + "ex_disks_gce_struct": ex_disks_gce_struct, + "ex_nic_gce_struct": ex_nic_gce_struct, + "ex_on_host_maintenance": ex_on_host_maintenance, + "ex_automatic_restart": ex_automatic_restart, + "ex_preemptible": ex_preemptible, + "ex_labels": ex_labels, + "ex_disk_size": ex_disk_size, + } # List for holding the status information for disk/node creation. status_list = [] for i in range(number): - name = '%s-%03d' % (base_name, i) - - status = {'name': name, - 'node_response': None, - 'node': None, - 'disk_response': None, - 'disk': None} - + name = "%s-%03d" % (base_name, i) + status = {"name": name, "node_response": None, "node": None} status_list.append(status) - # Create disks for nodes - for status in status_list: - self._multi_create_disk(status, node_attrs) - start_time = time.time() complete = False + while not complete: - if (time.time() - start_time >= timeout): - raise Exception("Timeout (%s sec) while waiting for multiple " - "instances") + if time.time() - start_time >= timeout: + raise GCEMultipleNodesTimeoutError( + timeout=timeout, + nodes=[status["node"] for status in status_list if status["node"] is not None], + pending_node_names=[ + status["name"] for status in status_list if status["node"] is None + ], + driver=self, + ) complete = True time.sleep(poll_interval) + for status in status_list: - # If disk does not yet exist, check on its status - if not status['disk']: - self._multi_check_disk(status, node_attrs) - - # If disk exists, but node does not, create the node or check - # on its status if already in progress. - if status['disk'] and not status['node']: - if not status['node_response']: + # Create the node or check status if already in progress. + + if not status["node"]: + if not status["node_response"]: self._multi_create_node(status, node_attrs) else: self._multi_check_node(status, node_attrs) # If any of the nodes have not been created (or failed) we are # not done yet. - if not status['node']: + + if not status["node"]: complete = False # Return list of nodes node_list = [] + for status in status_list: - node_list.append(status['node']) + node_list.append(status["node"]) + return node_list def ex_create_targethttpproxy(self, name, urlmap): @@ -2453,20 +5889,71 @@ def ex_create_targethttpproxy(self, name, urlmap): :return: Target Pool object :rtype: :class:`GCETargetPool` """ - targetproxy_data = {'name': name} + targetproxy_data = {"name": name} - if not hasattr(urlmap, 'name'): + if not hasattr(urlmap, "name"): urlmap = self.ex_get_urlmap(urlmap) - targetproxy_data['urlMap'] = urlmap.extra['selfLink'] + targetproxy_data["urlMap"] = urlmap.extra["selfLink"] - request = '/global/targetHttpProxies' - self.connection.async_request(request, method='POST', - data=targetproxy_data) + request = "/global/targetHttpProxies" + self.connection.async_request(request, method="POST", data=targetproxy_data) return self.ex_get_targethttpproxy(name) - def ex_create_targetinstance(self, name, zone=None, node=None, - description=None, nat_policy="NO_NAT"): + def ex_create_targethttpsproxy(self, name, urlmap, sslcertificates, description=None): + """ + Creates a TargetHttpsProxy resource in the specified project + using the data included in the request. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param name: Name of the resource. Provided by the client when the + resource is created. The name must be 1-63 characters + long, and comply with RFC1035. Specifically, the name + must be 1-63 characters long and match the regular + expression [a-z]([-a-z0-9]*[a-z0-9])? which means the + first character must be a lowercase letter, and all + following characters must be a dash, lowercase letter, + or digit, except the last character, which cannot be a + dash. + :type name: ``str`` + + :param sslcertificates: URLs to SslCertificate resources that + are used to authenticate connections + between users and the load balancer. + Currently, exactly one SSL certificate + must be specified. + :type sslcertificates: ``list`` of :class:`GCESslcertificates` + + :param urlmap: A fully-qualified or valid partial URL to the + UrlMap resource that defines the mapping from URL + to the BackendService. + :type urlmap: :class:`GCEUrlMap` + + :keyword description: An optional description of this resource. + Provide this property when you create the + resource. + :type description: ``str`` + + :return: `GCETargetHttpsProxy` object. + :rtype: :class:`GCETargetHttpsProxy` + """ + request = "/global/targetHttpsProxies" + request_data = {} + request_data["name"] = name + request_data["description"] = description + request_data["sslCertificates"] = [x.extra["selfLink"] for x in sslcertificates] + request_data["urlMap"] = urlmap.extra["selfLink"] + + self.connection.async_request(request, method="POST", data=request_data) + + return self.ex_get_targethttpsproxy(name) + + def ex_create_targetinstance( + self, name, zone=None, node=None, description=None, nat_policy="NO_NAT" + ): """ Create a target instance. @@ -2491,26 +5978,36 @@ def ex_create_targetinstance(self, name, zone=None, node=None, """ zone = zone or self.zone targetinstance_data = {} - targetinstance_data['name'] = name - if not hasattr(zone, 'name'): + targetinstance_data["name"] = name + + if not hasattr(zone, "name"): zone = self.ex_get_zone(zone) - targetinstance_data['zone'] = zone.extra['selfLink'] + targetinstance_data["zone"] = zone.extra["selfLink"] + if node is not None: - if not hasattr(node, 'name'): + if not hasattr(node, "name"): node = self.ex_get_node(node, zone) - targetinstance_data['instance'] = node.extra['selfLink'] - targetinstance_data['natPolicy'] = nat_policy + targetinstance_data["instance"] = node.extra["selfLink"] + targetinstance_data["natPolicy"] = nat_policy + if description: - targetinstance_data['description'] = description + targetinstance_data["description"] = description + + request = "/zones/%s/targetInstances" % (zone.name) + self.connection.async_request(request, method="POST", data=targetinstance_data) - request = '/zones/%s/targetInstances' % (zone.name) - self.connection.async_request(request, method='POST', - data=targetinstance_data) return self.ex_get_targetinstance(name, zone) - def ex_create_targetpool(self, name, region=None, healthchecks=None, - nodes=None, session_affinity=None, - backup_pool=None, failover_ratio=None): + def ex_create_targetpool( + self, + name, + region=None, + healthchecks=None, + nodes=None, + session_affinity=None, + backup_pool=None, + failover_ratio=None, + ): """ Create a target pool. @@ -2545,39 +6042,41 @@ def ex_create_targetpool(self, name, region=None, healthchecks=None, """ targetpool_data = {} region = region or self.region + if backup_pool and not failover_ratio: failover_ratio = 0.1 - targetpool_data['failoverRatio'] = failover_ratio - targetpool_data['backupPool'] = backup_pool.extra['selfLink'] + targetpool_data["failoverRatio"] = failover_ratio + targetpool_data["backupPool"] = backup_pool.extra["selfLink"] + if failover_ratio and not backup_pool: e = "Must supply a backup targetPool when setting failover_ratio" raise ValueError(e) - targetpool_data['name'] = name - if not hasattr(region, 'name'): + targetpool_data["name"] = name + + if not hasattr(region, "name"): region = self.ex_get_region(region) - targetpool_data['region'] = region.extra['selfLink'] + targetpool_data["region"] = region.extra["selfLink"] if healthchecks: - if not hasattr(healthchecks[0], 'name'): - hc_list = [self.ex_get_healthcheck(h).extra['selfLink'] for h - in healthchecks] + if not hasattr(healthchecks[0], "name"): + hc_list = [self.ex_get_healthcheck(h).extra["selfLink"] for h in healthchecks] else: - hc_list = [h.extra['selfLink'] for h in healthchecks] - targetpool_data['healthChecks'] = hc_list + hc_list = [h.extra["selfLink"] for h in healthchecks] + targetpool_data["healthChecks"] = hc_list + if nodes: - if not hasattr(nodes[0], 'name'): - node_list = [self.ex_get_node(n, 'all').extra['selfLink'] for n - in nodes] + if not hasattr(nodes[0], "name"): + node_list = [self.ex_get_node(n, "all").extra["selfLink"] for n in nodes] else: - node_list = [n.extra['selfLink'] for n in nodes] - targetpool_data['instances'] = node_list + node_list = [n.extra["selfLink"] for n in nodes] + targetpool_data["instances"] = node_list + if session_affinity: - targetpool_data['sessionAffinity'] = session_affinity + targetpool_data["sessionAffinity"] = session_affinity - request = '/regions/%s/targetPools' % (region.name) + request = "/regions/%s/targetPools" % (region.name) - self.connection.async_request(request, method='POST', - data=targetpool_data) + self.connection.async_request(request, method="POST", data=targetpool_data) return self.ex_get_targetpool(name, region) @@ -2594,22 +6093,30 @@ def ex_create_urlmap(self, name, default_service): :return: URL Map object :rtype: :class:`GCEUrlMap` """ - urlmap_data = {'name': name} + urlmap_data = {"name": name} # TODO: support hostRules, pathMatchers, tests - if not hasattr(default_service, 'name'): + + if not hasattr(default_service, "name"): default_service = self.ex_get_backendservice(default_service) - urlmap_data['defaultService'] = default_service.extra['selfLink'] + urlmap_data["defaultService"] = default_service.extra["selfLink"] - request = '/global/urlMaps' - self.connection.async_request(request, method='POST', - data=urlmap_data) + request = "/global/urlMaps" + self.connection.async_request(request, method="POST", data=urlmap_data) return self.ex_get_urlmap(name) - def create_volume(self, size, name, location=None, snapshot=None, - image=None, use_existing=True, - ex_disk_type='pd-standard'): + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + image=None, + use_existing=True, + ex_disk_type="pd-standard", + ex_image_family=None, + ): """ Create a volume (disk). @@ -2639,22 +6146,37 @@ def create_volume(self, size, name, location=None, snapshot=None, for an SSD disk. :type ex_disk_type: ``str`` or :class:`GCEDiskType` + :keyword ex_image_family: Determine image from an 'Image Family' + instead of by name. 'image' should be None + to use this keyword. + :type ex_image_family: ``str`` or ``None`` + :return: Storage Volume object :rtype: :class:`StorageVolume` """ + + if image and ex_image_family: + raise ValueError("Cannot specify both 'image' and " "'ex_image_family'") + + if ex_image_family: + image = self.ex_get_image_from_family(ex_image_family) + request, volume_data, params = self._create_vol_req( - size, name, location, snapshot, image, ex_disk_type) + size, name, location, snapshot, image, ex_disk_type + ) try: - self.connection.async_request(request, method='POST', - data=volume_data, params=params) - except ResourceExistsError: - e = sys.exc_info()[1] + self.connection.async_request(request, method="POST", data=volume_data, params=params) + except ResourceExistsError as e: if not use_existing: raise e return self.ex_get_volume(name, location) - def create_volume_snapshot(self, volume, name): + def create_volume_snapshot( + self, + volume, + name=None, + ): """ Create a snapshot of the provided Volume. @@ -2665,11 +6187,12 @@ def create_volume_snapshot(self, volume, name): :rtype: :class:`GCESnapshot` """ snapshot_data = {} - snapshot_data['name'] = name - request = '/zones/%s/disks/%s/createSnapshot' % ( - volume.extra['zone'].name, volume.name) - self.connection.async_request(request, method='POST', - data=snapshot_data) + snapshot_data["name"] = name + request = "/zones/{}/disks/{}/createSnapshot".format( + volume.extra["zone"].name, + volume.name, + ) + self.connection.async_request(request, method="POST", data=snapshot_data) return self.ex_get_snapshot(name) @@ -2688,13 +6211,38 @@ def list_volume_snapshots(self, volume): :rtype: ``list`` of :class:`GCESnapshot` """ volume_snapshots = [] - volume_link = volume.extra['selfLink'] + volume_link = volume.extra["selfLink"] all_snapshots = self.ex_list_snapshots() + for snapshot in all_snapshots: - if snapshot.extra['sourceDisk'] == volume_link: + if snapshot.extra["sourceDisk"] == volume_link: volume_snapshots.append(snapshot) + return volume_snapshots + def ex_update_autoscaler(self, autoscaler): + """ + Update an autoscaler with new values. + + To update, change the attributes of the autoscaler object and pass + the updated object to the method. + + :param autoscaler: An Autoscaler object with updated values. + :type autoscaler: :class:`GCEAutoscaler` + + :return: An Autoscaler object representing the new state. + :rtype: :class:`GCEAutoscaler`` + """ + request = "/zones/%s/autoscalers" % (autoscaler.zone.name) + as_data = {} + as_data["name"] = autoscaler.name + as_data["autoscalingPolicy"] = autoscaler.policy + as_data["target"] = autoscaler.target.extra["selfLink"] + + self.connection.async_request(request, method="PUT", data=as_data) + + return self.ex_get_autoscaler(autoscaler.name, autoscaler.zone) + def ex_update_healthcheck(self, healthcheck): """ Update a health check with new values. @@ -2709,22 +6257,23 @@ def ex_update_healthcheck(self, healthcheck): :rtype: :class:`GCEHealthCheck` """ hc_data = {} - hc_data['name'] = healthcheck.name - hc_data['requestPath'] = healthcheck.path - hc_data['port'] = healthcheck.port - hc_data['checkIntervalSec'] = healthcheck.interval - hc_data['timeoutSec'] = healthcheck.timeout - hc_data['unhealthyThreshold'] = healthcheck.unhealthy_threshold - hc_data['healthyThreshold'] = healthcheck.healthy_threshold - if healthcheck.extra['host']: - hc_data['host'] = healthcheck.extra['host'] - if healthcheck.extra['description']: - hc_data['description'] = healthcheck.extra['description'] - - request = '/global/httpHealthChecks/%s' % (healthcheck.name) - - self.connection.async_request(request, method='PUT', - data=hc_data) + hc_data["name"] = healthcheck.name + hc_data["requestPath"] = healthcheck.path + hc_data["port"] = healthcheck.port + hc_data["checkIntervalSec"] = healthcheck.interval + hc_data["timeoutSec"] = healthcheck.timeout + hc_data["unhealthyThreshold"] = healthcheck.unhealthy_threshold + hc_data["healthyThreshold"] = healthcheck.healthy_threshold + + if healthcheck.extra["host"]: + hc_data["host"] = healthcheck.extra["host"] + + if healthcheck.extra["description"]: + hc_data["description"] = healthcheck.extra["description"] + + request = "/global/httpHealthChecks/%s" % (healthcheck.name) + + self.connection.async_request(request, method="PUT", data=hc_data) return self.ex_get_healthcheck(healthcheck.name) @@ -2742,25 +6291,89 @@ def ex_update_firewall(self, firewall): :rtype: :class:`GCEFirewall` """ firewall_data = {} - firewall_data['name'] = firewall.name - firewall_data['allowed'] = firewall.allowed - firewall_data['network'] = firewall.network.extra['selfLink'] + firewall_data["name"] = firewall.name + firewall_data["allowed"] = firewall.allowed + firewall_data["denied"] = firewall.denied + # Priority updates not yet exposed via API + firewall_data["network"] = firewall.network.extra["selfLink"] + if firewall.source_ranges: - firewall_data['sourceRanges'] = firewall.source_ranges + firewall_data["sourceRanges"] = firewall.source_ranges + if firewall.source_tags: - firewall_data['sourceTags'] = firewall.source_tags + firewall_data["sourceTags"] = firewall.source_tags + + if firewall.source_service_accounts: + firewall_data["sourceServiceAccounts"] = firewall.source_service_accounts + if firewall.target_tags: - firewall_data['targetTags'] = firewall.target_tags - if firewall.extra['description']: - firewall_data['description'] = firewall.extra['description'] + firewall_data["targetTags"] = firewall.target_tags + + if firewall.target_service_accounts: + firewall_data["targetServiceAccounts"] = firewall.target_service_accounts + + if firewall.target_ranges: + firewall_data["destinationRanges"] = firewall.target_ranges - request = '/global/firewalls/%s' % (firewall.name) + if firewall.extra["description"]: + firewall_data["description"] = firewall.extra["description"] - self.connection.async_request(request, method='PUT', - data=firewall_data) + request = "/global/firewalls/%s" % (firewall.name) + + self.connection.async_request(request, method="PUT", data=firewall_data) return self.ex_get_firewall(firewall.name) + def ex_targethttpsproxy_set_sslcertificates(self, targethttpsproxy, sslcertificates): + """ + Replaces SslCertificates for TargetHttpsProxy. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param targethttpsproxy: Name of the TargetHttpsProxy resource to + set an SslCertificates resource for. + :type targethttpsproxy: ``str`` + + :param sslcertificates: sslcertificates to set. + :type sslcertificates: ``list`` of :class:`GCESslCertificates` + + :return: True + :rtype: ``bool`` + """ + + request = "/targetHttpsProxies/%s/setSslCertificates" % (targethttpsproxy.name) + request_data = {"sslCertificates": [x.extra["selfLink"] for x in sslcertificates]} + self.connection.async_request(request, method="POST", data=request_data) + + return True + + def ex_targethttpsproxy_set_urlmap(self, targethttpsproxy, urlmap): + """ + Changes the URL map for TargetHttpsProxy. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param targethttpsproxy: Name of the TargetHttpsProxy resource + whose URL map is to be set. + :type targethttpsproxy: ``str`` + + :param urlmap: urlmap to set. + :type urlmap: :class:`GCEUrlMap` + + :return: True + :rtype: ``bool`` + """ + + request = "/targetHttpsProxies/%s/setUrlMap" % (targethttpsproxy.name) + request_data = {"urlMap": urlmap.extra["selfLink"]} + self.connection.async_request(request, method="POST", data=request_data) + + return True + def ex_targetpool_get_health(self, targetpool, node=None): """ Return a hash of target pool instances and their health. @@ -2778,203 +6391,603 @@ def ex_targetpool_get_health(self, targetpool, node=None): """ health = [] region_name = targetpool.region.name - request = '/regions/%s/targetPools/%s/getHealth' % (region_name, - targetpool.name) + request = "/regions/{}/targetPools/{}/getHealth".format( + region_name, + targetpool.name, + ) if node is not None: - if hasattr(node, 'name'): + if hasattr(node, "name"): node_name = node.name else: node_name = node + else: + node_name = None + + nodes = targetpool.nodes + + for node_object in nodes: + if node: + if node_name == node_object.name: + body = {"instance": node_object.extra["selfLink"]} + resp = self.connection.request(request, method="POST", data=body).object + status = resp["healthStatus"][0]["healthState"] + health.append({"node": node_object, "health": status}) + else: + body = {"instance": node_object.extra["selfLink"]} + resp = self.connection.request(request, method="POST", data=body).object + status = resp["healthStatus"][0]["healthState"] + health.append({"node": node_object, "health": status}) + + return health + + def ex_targetpool_set_backup_targetpool( + self, targetpool, backup_targetpool, failover_ratio=0.1 + ): + """ + Set a backup targetpool. + + :param targetpool: The existing primary targetpool + :type targetpool: :class:`GCETargetPool` + + :param backup_targetpool: The existing targetpool to use for + failover traffic. + :type backup_targetpool: :class:`GCETargetPool` + + :param failover_ratio: The percentage of healthy VMs must fall at or + below this value before traffic will be sent + to the backup targetpool (default 0.10) + :type failover_ratio: ``float`` + + :return: True if successful + :rtype: ``bool`` + """ + region = targetpool.region.name + name = targetpool.name + req_data = {"target": backup_targetpool.extra["selfLink"]} + params = {"failoverRatio": failover_ratio} + + request = "/regions/{}/targetPools/{}/setBackup".format(region, name) + self.connection.async_request(request, method="POST", data=req_data, params=params) + + return True + + def ex_targetpool_add_node(self, targetpool, node): + """ + Add a node to a target pool. + + :param targetpool: The targetpool to add node to + :type targetpool: ``str`` or :class:`GCETargetPool` + + :param node: The node to add + :type node: ``str`` or :class:`Node` + + :return: True if successful + :rtype: ``bool`` + """ + + if not hasattr(targetpool, "name"): + targetpool = self.ex_get_targetpool(targetpool) + + if hasattr(node, "name"): + node_uri = node.extra["selfLink"] + else: + if node.startswith("https://"): + node_uri = node + else: + node = self.ex_get_node(node, "all") + node_uri = node.extra["selfLink"] + + targetpool_data = {"instances": [{"instance": node_uri}]} + + request = "/regions/{}/targetPools/{}/addInstance".format( + targetpool.region.name, + targetpool.name, + ) + self.connection.async_request(request, method="POST", data=targetpool_data) + + if all( + (node_uri != n) and (not hasattr(n, "extra") or n.extra["selfLink"] != node_uri) + for n in targetpool.nodes + ): + targetpool.nodes.append(node) + + return True + + def ex_targetpool_add_healthcheck(self, targetpool, healthcheck): + """ + Add a health check to a target pool. + + :param targetpool: The targetpool to add health check to + :type targetpool: ``str`` or :class:`GCETargetPool` + + :param healthcheck: The healthcheck to add + :type healthcheck: ``str`` or :class:`GCEHealthCheck` + + :return: True if successful + :rtype: ``bool`` + """ + + if not hasattr(targetpool, "name"): + targetpool = self.ex_get_targetpool(targetpool) + + if not hasattr(healthcheck, "name"): + healthcheck = self.ex_get_healthcheck(healthcheck) + + targetpool_data = {"healthChecks": [{"healthCheck": healthcheck.extra["selfLink"]}]} + + request = "/regions/{}/targetPools/{}/addHealthCheck".format( + targetpool.region.name, + targetpool.name, + ) + self.connection.async_request(request, method="POST", data=targetpool_data) + targetpool.healthchecks.append(healthcheck) + + return True + + def ex_targetpool_remove_node(self, targetpool, node): + """ + Remove a node from a target pool. + + :param targetpool: The targetpool to remove node from + :type targetpool: ``str`` or :class:`GCETargetPool` + + :param node: The node to remove + :type node: ``str`` or :class:`Node` + + :return: True if successful + :rtype: ``bool`` + """ + + if not hasattr(targetpool, "name"): + targetpool = self.ex_get_targetpool(targetpool) + + if hasattr(node, "name"): + node_uri = node.extra["selfLink"] + else: + if node.startswith("https://"): + node_uri = node + else: + node = self.ex_get_node(node, "all") + node_uri = node.extra["selfLink"] + + targetpool_data = {"instances": [{"instance": node_uri}]} + + request = "/regions/{}/targetPools/{}/removeInstance".format( + targetpool.region.name, + targetpool.name, + ) + self.connection.async_request(request, method="POST", data=targetpool_data) + # Remove node object from node list + index = None + + for i, nd in enumerate(targetpool.nodes): + if nd == node_uri or (hasattr(nd, "extra") and nd.extra["selfLink"] == node_uri): + index = i + + break + + if index is not None: + targetpool.nodes.pop(index) + + return True + + def ex_targetpool_remove_healthcheck(self, targetpool, healthcheck): + """ + Remove a health check from a target pool. + + :param targetpool: The targetpool to remove health check from + :type targetpool: ``str`` or :class:`GCETargetPool` + + :param healthcheck: The healthcheck to remove + :type healthcheck: ``str`` or :class:`GCEHealthCheck` + + :return: True if successful + :rtype: ``bool`` + """ + + if not hasattr(targetpool, "name"): + targetpool = self.ex_get_targetpool(targetpool) + + if not hasattr(healthcheck, "name"): + healthcheck = self.ex_get_healthcheck(healthcheck) + + targetpool_data = {"healthChecks": [{"healthCheck": healthcheck.extra["selfLink"]}]} + + request = "/regions/{}/targetPools/{}/removeHealthCheck".format( + targetpool.region.name, + targetpool.name, + ) + self.connection.async_request(request, method="POST", data=targetpool_data) + # Remove healthcheck object from healthchecks list + index = None + + for i, hc in enumerate(targetpool.healthchecks): + if hc.name == healthcheck.name: + index = i + + if index is not None: + targetpool.healthchecks.pop(index) + + return True + + def ex_instancegroup_add_instances(self, instancegroup, node_list): + """ + Adds a list of instances to the specified instance group. All of the + instances in the instance group must be in the same + network/subnetwork. Read Adding instances for more information. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param instancegroup: The Instance Group where you are + adding instances. + :type instancegroup: :class:``GCEInstanceGroup`` + + :param node_list: List of nodes to add. + :type node_list: ``list`` of :class:`Node` or ``list`` of + :class:`GCENode` + + :return: Return True if successful. + :rtype: ``bool`` + """ + request = "/zones/{}/instanceGroups/{}/addInstances".format( + instancegroup.zone.name, + instancegroup.name, + ) + request_data = {"instances": [{"instance": x.extra["selfLink"]} for x in node_list]} + self.connection.async_request(request, method="POST", data=request_data) + + return True + + def ex_instancegroup_remove_instances(self, instancegroup, node_list): + """ + Removes one or more instances from the specified instance group, + but does not delete those instances. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param instancegroup: The Instance Group where the + specified instances will be removed. + :type instancegroup: :class:``GCEInstanceGroup`` + + :param node_list: List of nodes to add. + :type node_list: ``list`` of :class:`Node` or ``list`` of + :class:`GCENode` + + :return: True if successful. + :rtype: ``bool`` + """ + request = "/zones/{}/instanceGroups/{}/removeInstances".format( + instancegroup.zone.name, + instancegroup.name, + ) + request_data = {"instances": [{"instance": x.extra["selfLink"]} for x in node_list]} + self.connection.async_request(request, method="POST", data=request_data) + + return True + + def ex_instancegroup_list_instances(self, instancegroup): + """ + Lists the instances in the specified instance group. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + * https://www.googleapis.com/auth/compute.readonly + + :param instancegroup: The Instance Group where from which you + want to generate a list of included + instances. + :type instancegroup: :class:`GCEInstanceGroup` + + :return: List of :class:`GCENode` objects. + :rtype: ``list`` of :class:`GCENode` objects. + """ + request = "/zones/{}/instanceGroups/{}/listInstances".format( + instancegroup.zone.name, + instancegroup.name, + ) + + # Note: This API requires a 'POST'. + response = self.connection.request(request, method="POST").object + + list_data = [] + + if "items" in response: + for v in response["items"]: + instance_info = self._get_components_from_path(v["instance"]) + list_data.append(self.ex_get_node(instance_info["name"], instance_info["zone"])) + + return list_data + + def ex_instancegroup_set_named_ports(self, instancegroup, named_ports=[]): + """ + Sets the named ports for the specified instance group. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param instancegroup: The Instance Group where where the + named ports are updated. + :type instancegroup: :class:`GCEInstanceGroup` + + :param named_ports: Assigns a name to a port number. For example: + {name: "http", port: 80} This allows the + system to reference ports by the assigned name + instead of a port number. Named ports can also + contain multiple ports. For example: [{name: + "http", port: 80},{name: "http", port: 8080}] + Named ports apply to all instances in this + instance group. + :type named_ports: ``list`` of {'name': ``str``, 'port`: ``int``} + + :return: Return True if successful. + :rtype: ``bool`` + """ + + if not isinstance(named_ports, list): + raise ValueError("'named_ports' must be a list of name/port" " dictionaries.") + + request = "/zones/{}/instanceGroups/{}/setNamedPorts".format( + instancegroup.zone.name, + instancegroup.name, + ) + request_data = { + "namedPorts": named_ports, + "fingerprint": instancegroup.extra["fingerprint"], + } + self.connection.async_request(request, method="POST", data=request_data) + + return True + + def ex_destroy_instancegroup(self, instancegroup): + """ + Deletes the specified instance group. The instances in the group + are not deleted. Note that instance group must not belong to a backend + service. Read Deleting an instance group for more information. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param instancegroup: The name of the instance group to delete. + :type instancegroup: :class:`GCEInstanceGroup` + + :return: Return True if successful. + :rtype: ``bool`` + """ + + request = "/zones/{}/instanceGroups/{}".format( + instancegroup.zone.name, + instancegroup.name, + ) + request_data = {} + self.connection.async_request(request, method="DELETE", data=request_data) - nodes = targetpool.nodes - for node_object in nodes: - if node: - if node_name == node_object.name: - body = {'instance': node_object.extra['selfLink']} - resp = self.connection.request(request, method='POST', - data=body).object - status = resp['healthStatus'][0]['healthState'] - health.append({'node': node_object, 'health': status}) - else: - body = {'instance': node_object.extra['selfLink']} - resp = self.connection.request(request, method='POST', - data=body).object - status = resp['healthStatus'][0]['healthState'] - health.append({'node': node_object, 'health': status}) - return health + return True - def ex_targetpool_set_backup_targetpool(self, targetpool, - backup_targetpool, - failover_ratio=0.1): + def ex_instancegroupmanager_list_managed_instances(self, manager): """ - Set a backup targetpool. + Lists all of the instances in the Managed Instance Group. - :param targetpool: The existing primary targetpool - :type targetpool: :class:`GCETargetPool` + Each instance in the list has a currentAction, which indicates + the action that the managed instance group is performing on the + instance. For example, if the group is still creating an instance, + the currentAction is 'CREATING'. Note that 'instanceStatus' might not + be available, for example, if currentAction is 'CREATING' or + 'RECREATING'. If a previous action failed, the list displays the errors + for that failed action. - :param backup_targetpool: The existing targetpool to use for - failover traffic. - :type backup_targetpool: :class:`GCETargetPool` + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + * https://www.googleapis.com/auth/compute.readonly - :param failover_ratio: The percentage of healthy VMs must fall at or - below this value before traffic will be sent - to the backup targetpool (default 0.10) - :type failover_ratio: ``float`` + 'currentAction' values are one of: + 'ABANDONING', 'CREATING', 'DELETING', 'NONE', + 'RECREATING', 'REFRESHING', 'RESTARTING' - :return: True if successful - :rtype: ``bool`` + :param manager: Instance Group Manager to operate on. + :type manager: :class:`GCEInstanceGroupManager` + + :return: ``list`` of ``dict`` containing 'name', 'zone', 'lastAttempt', + 'currentAction', 'instance' and 'instanceStatus'. + :rtype: ``list`` """ - region = targetpool.region.name - name = targetpool.name - req_data = {'target': backup_targetpool.extra['selfLink']} - params = {'failoverRatio': failover_ratio} + request = "/zones/{}/instanceGroupManagers/{}/listManagedInstances".format( + manager.zone.name, + manager.name, + ) - request = '/regions/%s/targetPools/%s/setBackup' % (region, name) - self.connection.async_request(request, method='POST', data=req_data, - params=params) - return True + # Note: This API requires a 'POST'. + response = self.connection.request(request, method="POST").object - def ex_targetpool_add_node(self, targetpool, node): + instance_data = [] + + if "managedInstances" in response: + for i in response["managedInstances"]: + i["name"] = self._get_components_from_path(i["instance"])["name"] + i["zone"] = manager.zone.name + instance_data.append(i) + + return instance_data + + def ex_instancegroupmanager_set_autohealingpolicies( + self, manager, healthcheck, initialdelaysec + ): """ - Add a node to a target pool. + Set the Autohealing Policies for this Instance Group. - :param targetpool: The targetpool to add node to - :type targetpool: ``str`` or :class:`GCETargetPool` + :param healthcheck: Healthcheck to add + :type healthcheck: :class:`GCEHealthCheck` - :param node: The node to add - :type node: ``str`` or :class:`Node` + :param initialdelaysec: The time to allow an instance to boot and + applications to fully start before the first + health check + :type initialdelaysec: ``int`` - :returns: True if successful + :return: True if successful :rtype: ``bool`` """ - if not hasattr(targetpool, 'name'): - targetpool = self.ex_get_targetpool(targetpool) - if hasattr(node, 'name'): - node_uri = node.extra['selfLink'] - else: - if node.startswith('https://'): - node_uri = node - else: - node = self.ex_get_node(node, 'all') - node_uri = node.extra['selfLink'] - - targetpool_data = {'instances': [{'instance': node_uri}]} - - request = '/regions/%s/targetPools/%s/addInstance' % ( - targetpool.region.name, targetpool.name) - self.connection.async_request(request, method='POST', - data=targetpool_data) - if all((node_uri != n) and - (not hasattr(n, 'extra') or n.extra['selfLink'] != node_uri) - for n in targetpool.nodes): - targetpool.nodes.append(node) + request_data = {} + request_data["autoHealingPolicies"] = [ + {"healthCheck": healthcheck.path, "initialDelaySec": initialdelaysec} + ] + + request = "/zones/{}/instanceGroupManagers/{}/".format( + manager.zone.name, + manager.name, + ) + self.connection.async_request(request, method="PATCH", data=request_data) + return True - def ex_targetpool_add_healthcheck(self, targetpool, healthcheck): + def ex_instancegroupmanager_set_instancetemplate(self, manager, instancetemplate): """ - Add a health check to a target pool. + Set the Instance Template for this Instance Group. Existing VMs are + not recreated by setting a new InstanceTemplate. - :param targetpool: The targetpool to add health check to - :type targetpool: ``str`` or :class:`GCETargetPool` + :param manager: Instance Group Manager to operate on. + :type manager: :class:`GCEInstanceGroupManager` - :param healthcheck: The healthcheck to add - :type healthcheck: ``str`` or :class:`GCEHealthCheck` + :param instancetemplate: Instance Template to set. + :type instancetemplate: :class:`GCEInstanceTemplate` - :returns: True if successful + :return: True if successful :rtype: ``bool`` """ - if not hasattr(targetpool, 'name'): - targetpool = self.ex_get_targetpool(targetpool) - if not hasattr(healthcheck, 'name'): - healthcheck = self.ex_get_healthcheck(healthcheck) + req_data = {"instanceTemplate": instancetemplate.extra["selfLink"]} - targetpool_data = { - 'healthChecks': [{'healthCheck': healthcheck.extra['selfLink']}] - } + request = "/zones/%s/instanceGroupManagers/" "%s/setInstanceTemplate" % ( + manager.zone.name, + manager.name, + ) + self.connection.async_request(request, method="POST", data=req_data) - request = '/regions/%s/targetPools/%s/addHealthCheck' % ( - targetpool.region.name, targetpool.name) - self.connection.async_request(request, method='POST', - data=targetpool_data) - targetpool.healthchecks.append(healthcheck) return True - def ex_targetpool_remove_node(self, targetpool, node): + def ex_instancegroupmanager_recreate_instances(self, manager, instances=None): + """ + Schedules a group action to recreate the specified instances in the + managed instance group. The instances are deleted and recreated using + the current instance template for the managed instance group. This + operation is marked as DONE when the action is scheduled even if the + instances have not yet been recreated. You must separately verify + the status of the recreating action with the listmanagedinstances + method or querying the managed instance group directly. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param manager: Required. The name of the managed instance group. The + name must be 1-63 characters long, and comply with + RFC1035. + :type manager: ``str`` or :class: `GCEInstanceGroupManager` + + :keyword instances: list of Node objects to be recreated. If equal + to None, all instances in the managed instance + group are recreated. + :type instances: ``list`` of :class: `Node`, ``list`` of instance + names (only), ``list`` of instance URIs, or None. + + :return: Dictionary containing instance URI and currentAction. + See ex_instancegroupmanager_list_managed_instances for + more details. + :rtype: ``dict`` + """ + instance_uris = [] + + if not isinstance(manager, GCEInstanceGroupManager) and not isinstance(manager, str): + raise ValueError( + "InstanceGroupManager must be of type str or " + "GCEInstanceGroupManager. Type '%s' provided" % (type(manager)) + ) + + if isinstance(manager, str): + manager = self.ex_get_instancegroupmanager(manager) + + if instances is None: + il = self.ex_instancegroupmanager_list_managed_instances(manager) + instance_uris = [x["instance"] for x in il] + elif isinstance(instances, list): + for i in instances: + if i.startswith("https://"): + instance_uris.append(i) + else: + instance_uris.append(self.ex_get_node(i, manager.zone).extra["selfLink"]) + else: + raise ValueError( + "instances must be 'None or " + "a list of instance URIs, instance names, or" + "Node objects" + ) + + request = "/zones/{}/instanceGroupManagers/{}/recreateInstances".format( + manager.zone.name, + manager.name, + ) + request_data = {"instances": instance_uris} + self.connection.request(request, method="POST", data=request_data).object + + return self.ex_instancegroupmanager_list_managed_instances(manager) + + def ex_instancegroupmanager_delete_instances(self, manager, node_list): """ - Remove a node from a target pool. + Remove instances from GCEInstanceGroupManager and destroy + the instance - :param targetpool: The targetpool to remove node from - :type targetpool: ``str`` or :class:`GCETargetPool` + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute - :param node: The node to remove - :type node: ``str`` or :class:`Node` + :param manager: Required. The name of the managed instance group. The + name must be 1-63 characters long, and comply with + RFC1035. + :type manager: ``str`` or :class: `GCEInstanceGroupManager` - :returns: True if successful - :rtype: ``bool`` - """ - if not hasattr(targetpool, 'name'): - targetpool = self.ex_get_targetpool(targetpool) + :param node_list: list of Node objects to delete. + :type node_list: ``list`` of :class:`Node` - if hasattr(node, 'name'): - node_uri = node.extra['selfLink'] - else: - if node.startswith('https://'): - node_uri = node - else: - node = self.ex_get_node(node, 'all') - node_uri = node.extra['selfLink'] + :return: True if successful + :rtype: ``bool`` + """ - targetpool_data = {'instances': [{'instance': node_uri}]} + request = "/zones/{}/instanceGroupManagers/{}/deleteInstances".format( + manager.zone.name, + manager.name, + ) + request_data = {"instances": [x.extra["selfLink"] for x in node_list]} + self.connection.request(request, method="POST", data=request_data).object - request = '/regions/%s/targetPools/%s/removeInstance' % ( - targetpool.region.name, targetpool.name) - self.connection.async_request(request, method='POST', - data=targetpool_data) - # Remove node object from node list - index = None - for i, nd in enumerate(targetpool.nodes): - if nd == node_uri or (hasattr(nd, 'extra') and - nd.extra['selfLink'] == node_uri): - index = i - break - if index is not None: - targetpool.nodes.pop(index) return True - def ex_targetpool_remove_healthcheck(self, targetpool, healthcheck): + def ex_instancegroupmanager_resize(self, manager, size): """ - Remove a health check from a target pool. + Set the Instance Template for this Instance Group. - :param targetpool: The targetpool to remove health check from - :type targetpool: ``str`` or :class:`GCETargetPool` + :param manager: Instance Group Manager to operate on. + :type manager: :class:`GCEInstanceGroupManager` - :param healthcheck: The healthcheck to remove - :type healthcheck: ``str`` or :class:`GCEHealthCheck` + :param size: New size of Managed Instance Group. + :type size: ``int`` - :returns: True if successful + :return: True if successful :rtype: ``bool`` """ - if not hasattr(targetpool, 'name'): - targetpool = self.ex_get_targetpool(targetpool) - if not hasattr(healthcheck, 'name'): - healthcheck = self.ex_get_healthcheck(healthcheck) + req_params = {"size": size} - targetpool_data = { - 'healthChecks': [{'healthCheck': healthcheck.extra['selfLink']}] - } + request = "/zones/{}/instanceGroupManagers/{}/resize".format( + manager.zone.name, + manager.name, + ) + self.connection.async_request(request, method="POST", params=req_params) - request = '/regions/%s/targetPools/%s/removeHealthCheck' % ( - targetpool.region.name, targetpool.name) - self.connection.async_request(request, method='POST', - data=targetpool_data) - # Remove healthcheck object from healthchecks list - index = None - for i, hc in enumerate(targetpool.healthchecks): - if hc.name == healthcheck.name: - index = i - if index is not None: - targetpool.healthchecks.pop(index) return True def reboot_node(self, node): @@ -2987,10 +7000,9 @@ def reboot_node(self, node): :return: True if successful, False if not :rtype: ``bool`` """ - request = '/zones/%s/instances/%s/reset' % (node.extra['zone'].name, - node.name) - self.connection.async_request(request, method='POST', - data='ignored') + request = "/zones/{}/instances/{}/reset".format(node.extra["zone"].name, node.name) + self.connection.async_request(request, method="POST", data="ignored") + return True def ex_set_node_tags(self, node, tags): @@ -3008,22 +7020,23 @@ def ex_set_node_tags(self, node, tags): :return: True if successful :rtype: ``bool`` """ - request = '/zones/%s/instances/%s/setTags' % (node.extra['zone'].name, - node.name) + request = "/zones/{}/instances/{}/setTags".format( + node.extra["zone"].name, + node.name, + ) tags_data = {} - tags_data['items'] = tags - tags_data['fingerprint'] = node.extra['tags_fingerprint'] - - self.connection.async_request(request, method='POST', - data=tags_data) - new_node = self.ex_get_node(node.name, node.extra['zone']) - node.extra['tags'] = new_node.extra['tags'] - node.extra['tags_fingerprint'] = new_node.extra['tags_fingerprint'] + tags_data["items"] = tags + tags_data["fingerprint"] = node.extra["tags_fingerprint"] + + self.connection.async_request(request, method="POST", data=tags_data) + new_node = self.ex_get_node(node.name, node.extra["zone"]) + node.extra["tags"] = new_node.extra["tags"] + node.extra["tags_fingerprint"] = new_node.extra["tags_fingerprint"] + return True - def ex_set_node_scheduling(self, node, on_host_maintenance=None, - automatic_restart=None): + def ex_set_node_scheduling(self, node, on_host_maintenance=None, automatic_restart=None): """Set the maintenance behavior for the node. See `Scheduling = timeout): - raise Exception("Timeout (%s sec) while waiting to delete " - "multiple instances") + if time.time() - start_time >= timeout: + raise Exception("Timeout (%s sec) while waiting to delete " "multiple instances") complete = True + for status in status_list: # If one of the operations is running, check the status - operation = status['node_response'] or status['disk_response'] + operation = status["node_response"] or status["disk_response"] delete_disk = False + if operation: no_errors = True try: - response = self.connection.request( - operation['selfLink']).object + response = self.connection.request(operation["selfLink"]).object except GoogleBaseError: self._catch_error(ignore_errors=ignore_errors) no_errors = False - response = {'status': 'DONE'} - if response['status'] == 'DONE': + response = {"status": "DONE"} + + if response["status"] == "DONE": # If a node was deleted, update status and indicate # that the disk is ready to be deleted. - if status['node_response']: - status['node_response'] = None - status['node_success'] = no_errors + + if status["node_response"]: + status["node_response"] = None + status["node_success"] = no_errors delete_disk = True else: - status['disk_response'] = None - status['disk_success'] = no_errors + status["disk_response"] = None + status["disk_success"] = no_errors # If we are destroying disks, and the node has been deleted, # destroy the disk. + if delete_disk and destroy_boot_disk: - boot_disk = status['node'].extra['boot_disk'] + boot_disk = status["node"].extra["boot_disk"] + if boot_disk: - request = '/zones/%s/disks/%s' % ( - boot_disk.extra['zone'].name, boot_disk.name) + request = "/zones/{}/disks/{}".format( + boot_disk.extra["zone"].name, + boot_disk.name, + ) try: - response = self.connection.request( - request, method='DELETE').object + response = self.connection.request(request, method="DELETE").object except GoogleBaseError: self._catch_error(ignore_errors=ignore_errors) no_errors = False response = None - status['disk_response'] = response + status["disk_response"] = response else: # If there is no boot disk, ignore - status['disk_success'] = True - operation = status['node_response'] or status['disk_response'] + status["disk_success"] = True + operation = status["node_response"] or status["disk_response"] + if operation: time.sleep(poll_interval) complete = False success = [] + for status in status_list: - s = status['node_success'] and status['disk_success'] + s = status["node_success"] and status["disk_success"] success.append(s) + return success def ex_destroy_targethttpproxy(self, targethttpproxy): @@ -3638,8 +7809,31 @@ def ex_destroy_targethttpproxy(self, targethttpproxy): :return: True if successful :rtype: ``bool`` """ - request = '/global/targetHttpProxies/%s' % targethttpproxy.name - self.connection.async_request(request, method='DELETE') + request = "/global/targetHttpProxies/%s" % targethttpproxy.name + self.connection.async_request(request, method="DELETE") + + return True + + def ex_destroy_targethttpsproxy(self, targethttpsproxy): + """ + Deletes the specified TargetHttpsProxy resource. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param targethttpsproxy: Name of the TargetHttpsProxy resource to + delete. + :type targethttpsproxy: ``str`` + + :return targetHttpsProxy: Return True if successful. + :rtype targetHttpsProxy: ````bool```` + """ + + request = "/global/targetHttpsProxies/%s" % (targethttpsproxy.name) + request_data = {} + self.connection.async_request(request, method="DELETE", data=request_data) + return True def ex_destroy_targetinstance(self, targetinstance): @@ -3652,9 +7846,12 @@ def ex_destroy_targetinstance(self, targetinstance): :return: True if successful :rtype: ``bool`` """ - request = '/zones/%s/targetInstances/%s' % (targetinstance.zone.name, - targetinstance.name) - self.connection.async_request(request, method='DELETE') + request = "/zones/{}/targetInstances/{}".format( + targetinstance.zone.name, + targetinstance.name, + ) + self.connection.async_request(request, method="DELETE") + return True def ex_destroy_targetpool(self, targetpool): @@ -3667,10 +7864,13 @@ def ex_destroy_targetpool(self, targetpool): :return: True if successful :rtype: ``bool`` """ - request = '/regions/%s/targetPools/%s' % (targetpool.region.name, - targetpool.name) + request = "/regions/{}/targetPools/{}".format( + targetpool.region.name, + targetpool.name, + ) + + self.connection.async_request(request, method="DELETE") - self.connection.async_request(request, method='DELETE') return True def ex_destroy_urlmap(self, urlmap): @@ -3683,9 +7883,10 @@ def ex_destroy_urlmap(self, urlmap): :return: True if successful :rtype: ``bool`` """ - request = '/global/urlMaps/%s' % urlmap.name + request = "/global/urlMaps/%s" % urlmap.name + + self.connection.async_request(request, method="DELETE") - self.connection.async_request(request, method='DELETE') return True def destroy_volume(self, volume): @@ -3698,9 +7899,9 @@ def destroy_volume(self, volume): :return: True if successful :rtype: ``bool`` """ - request = '/zones/%s/disks/%s' % (volume.extra['zone'].name, - volume.name) - self.connection.async_request(request, method='DELETE') + request = "/zones/{}/disks/{}".format(volume.extra["zone"].name, volume.name) + self.connection.async_request(request, method="DELETE") + return True def destroy_volume_snapshot(self, snapshot): @@ -3713,32 +7914,26 @@ def destroy_volume_snapshot(self, snapshot): :return: True if successful :rtype: ``bool`` """ - request = '/global/snapshots/%s' % (snapshot.name) - self.connection.async_request(request, method='DELETE') + request = "/global/snapshots/%s" % (snapshot.name) + self.connection.async_request(request, method="DELETE") + return True def ex_get_license(self, project, name): """ Return a License object for specified project and name. - :param name: The project to reference when looking up the license. - :type name: ``str`` + :param project: The project to reference when looking up the license. + :type project: ``str`` :param name: The name of the License :type name: ``str`` - :return: A DiskType object for the name - :rtype: :class:`GCEDiskType` + :return: A License object for the name + :rtype: :class:`GCELicense` """ - saved_request_path = self.connection.request_path - new_request_path = saved_request_path.replace(self.project, project) - self.connection.request_path = new_request_path - - request = '/global/licenses/%s' % (name) - response = self.connection.request(request, method='GET').object - self.connection.request_path = saved_request_path - return self._to_license(response) + return GCELicense.lazy(name, project, self) def ex_get_disktype(self, name, zone=None): """ @@ -3755,9 +7950,50 @@ def ex_get_disktype(self, name, zone=None): :rtype: :class:`GCEDiskType` """ zone = self._set_zone(zone) - request = '/zones/%s/diskTypes/%s' % (zone.name, name) - response = self.connection.request(request, method='GET').object - return self._to_disktype(response) + + if zone: + request_path = "/zones/{}/diskTypes/{}".format(zone.name, name) + else: + request_path = "/aggregated/diskTypes" + + response = self.connection.request(request_path, method="GET") + + if "items" in response.object: + # Aggregated response, zone not provided + data = None + + for zone_item in response.object["items"].values(): + for item in zone_item["diskTypes"]: + if item["name"] == name: + data = item + + break + else: + data = response.object + + if not data: + raise ValueError('Disk type with name "%s" not found' % (name)) + + return self._to_disktype(data) + + def ex_get_accelerator_type(self, name, zone=None): + """ + Return an AcceleratorType object based on a name and zone. + + :param name: The name of the AcceleratorType + :type name: ``str`` + + :param zone: The zone to search for the AcceleratorType in. + :type zone: :class:`GCEZone` + + :return: An AcceleratorType object for the name + :rtype: :class:`GCEAcceleratorType` + """ + zone = self._set_zone(zone) + request = "/zones/{}/acceleratorTypes/{}".format(zone.name, name) + response = self.connection.request(request, method="GET").object + + return self._to_accelerator_type(response) def ex_get_address(self, name, region=None): """ @@ -3773,13 +8009,16 @@ def ex_get_address(self, name, region=None): :return: An Address object for the address :rtype: :class:`GCEAddress` """ - if region == 'global': - request = '/global/addresses/%s' % (name) + + if region == "global": + request = "/global/addresses/%s" % (name) else: region = self._set_region(region) or self._find_zone_or_region( - name, 'addresses', region=True, res_name='Address') - request = '/regions/%s/addresses/%s' % (region.name, name) - response = self.connection.request(request, method='GET').object + name, "addresses", region=True, res_name="Address" + ) + request = "/regions/{}/addresses/{}".format(region.name, name) + response = self.connection.request(request, method="GET").object + return self._to_address(response) def ex_get_backendservice(self, name): @@ -3792,8 +8031,9 @@ def ex_get_backendservice(self, name): :return: A BackendService object for the backend service :rtype: :class:`GCEBackendService` """ - request = '/global/backendServices/%s' % name - response = self.connection.request(request, method='GET').object + request = "/global/backendServices/%s" % name + response = self.connection.request(request, method="GET").object + return self._to_backendservice(response) def ex_get_healthcheck(self, name): @@ -3806,8 +8046,9 @@ def ex_get_healthcheck(self, name): :return: A GCEHealthCheck object :rtype: :class:`GCEHealthCheck` """ - request = '/global/httpHealthChecks/%s' % (name) - response = self.connection.request(request, method='GET').object + request = "/global/httpHealthChecks/%s" % (name) + response = self.connection.request(request, method="GET").object + return self._to_healthcheck(response) def ex_get_firewall(self, name): @@ -3820,8 +8061,9 @@ def ex_get_firewall(self, name): :return: A GCEFirewall object :rtype: :class:`GCEFirewall` """ - request = '/global/firewalls/%s' % (name) - response = self.connection.request(request, method='GET').object + request = "/global/firewalls/%s" % (name) + response = self.connection.request(request, method="GET").object + return self._to_firewall(response) def ex_get_forwarding_rule(self, name, region=None, global_rule=False): @@ -3842,18 +8084,20 @@ def ex_get_forwarding_rule(self, name, region=None, global_rule=False): :return: A GCEForwardingRule object :rtype: :class:`GCEForwardingRule` """ + if global_rule: - request = '/global/forwardingRules/%s' % name + request = "/global/forwardingRules/%s" % name else: region = self._set_region(region) or self._find_zone_or_region( - name, 'forwardingRules', region=True, - res_name='ForwardingRule') - request = '/regions/%s/forwardingRules/%s' % (region.name, name) + name, "forwardingRules", region=True, res_name="ForwardingRule" + ) + request = "/regions/{}/forwardingRules/{}".format(region.name, name) + + response = self.connection.request(request, method="GET").object - response = self.connection.request(request, method='GET').object return self._to_forwarding_rule(response) - def ex_get_image(self, partial_name, ex_project_list=None): + def ex_get_image(self, partial_name, ex_project_list=None, ex_standard_projects=True): """ Return an GCENodeImage object based on the name or link provided. @@ -3861,23 +8105,106 @@ def ex_get_image(self, partial_name, ex_project_list=None): image. :type partial_name: ``str`` + :param ex_project_list: The name of the project to list for images. + Examples include: 'debian-cloud'. + :type ex_project_list: ``str`` or ``list`` of ``str`` or ``None`` + + :param ex_standard_projects: If true, check in standard projects if + the image is not found. + :type ex_standard_projects: ``bool`` + :return: GCENodeImage object based on provided information or None if an image with that name is not found. :rtype: :class:`GCENodeImage` or raise ``ResourceNotFoundError`` """ - if partial_name.startswith('https://'): - response = self.connection.request(partial_name, method='GET') + + if partial_name.startswith("https://"): + response = self.connection.request(partial_name, method="GET") + return self._to_node_image(response.object) image = self._match_images(ex_project_list, partial_name) - if not image: + + if not image and ex_standard_projects: for img_proj, short_list in self.IMAGE_PROJECTS.items(): for short_name in short_list: if partial_name.startswith(short_name): image = self._match_images(img_proj, partial_name) if not image: - raise ResourceNotFoundError('Could not find image \'%s\'' % ( - partial_name), None, None) + raise ResourceNotFoundError("Could not find image '%s'" % (partial_name), None, None) + + return image + + def ex_get_image_from_family( + self, image_family, ex_project_list=None, ex_standard_projects=True + ): + """ + Return an GCENodeImage object based on an image family name. + + :param image_family: The name of the 'Image Family' to return the + latest image from. + :type image_family: ``str`` + + :param ex_project_list: The name of the project to list for images. + Examples include: 'debian-cloud'. + :type ex_project_list: ``list`` of ``str``, or ``None`` + + :param ex_standard_projects: If true, check in standard projects if + the image is not found. + :type ex_standard_projects: ``bool`` + + :return: GCENodeImage object based on provided information or + ResourceNotFoundError if the image family is not found. + :rtype: :class:`GCENodeImage` or raise ``ResourceNotFoundError`` + """ + + def _try_image_family(image_family, project=None): + request = "/global/images/family/%s" % (image_family) + save_request_path = self.connection.request_path + + if project: + new_request_path = save_request_path.replace(self.project, project) + self.connection.request_path = new_request_path + try: + response = self.connection.request(request, method="GET") + image = self._to_node_image(response.object) + except ResourceNotFoundError: + image = None + finally: + self.connection.request_path = save_request_path + + return image + + image = None + + if image_family.startswith("https://"): + response = self.connection.request(image_family, method="GET") + + return self._to_node_image(response.object) + + if not ex_project_list: + image = _try_image_family(image_family) + else: + for img_proj in ex_project_list: + image = _try_image_family(image_family, project=img_proj) + + if image: + break + + if not image and ex_standard_projects: + for img_proj, short_list in self.IMAGE_PROJECTS.items(): + for short_name in short_list: + if image_family.startswith(short_name): + image = _try_image_family(image_family, project=img_proj) + + if image: + break + + if not image: + raise ResourceNotFoundError( + "Could not find image for family " "'%s'" % (image_family), None, None + ) + return image def ex_get_route(self, name): @@ -3890,22 +8217,143 @@ def ex_get_route(self, name): :return: A Route object for the named route :rtype: :class:`GCERoute` """ - request = '/global/routes/%s' % (name) - response = self.connection.request(request, method='GET').object + request = "/global/routes/%s" % (name) + response = self.connection.request(request, method="GET").object + return self._to_route(response) + def ex_destroy_sslcertificate(self, sslcertificate): + """ + Deletes the specified SslCertificate resource. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + + :param sslcertificate: Name of the SslCertificate resource to + delete. + :type sslcertificate: ``str`` + + :return sslCertificate: Return True if successful. + :rtype sslCertificate: ````bool```` + """ + + request = "/global/sslCertificates/%s" % (sslcertificate.name) + request_data = {} + self.connection.async_request(request, method="DELETE", data=request_data) + + return True + + def ex_destroy_subnetwork(self, name, region=None): + """ + Delete a Subnetwork object based on name and region. + + :param name: The name, URL or object of the subnetwork + :type name: ``str`` or :class:`GCESubnetwork` + + :keyword region: The region object, name, or URL of the subnetwork + :type region: ``str`` or :class:`GCERegion` or ``None`` + + :return: True if successful + :rtype: ``bool`` + """ + region_name = None + subnet_name = None + + if region: + if isinstance(region, GCERegion): + region_name = region.name + else: + if region.startswith("https://"): + region_name = region.split("/")[-1] + else: + region_name = region + + if isinstance(name, GCESubnetwork): + subnet_name = name.name + + if not region_name: + region_name = name.region.name + else: + if name.startswith("https://"): + url_parts = self._get_components_from_path(name) + subnet_name = url_parts["name"] + + if not region_name: + region_name = url_parts["region"] + else: + subnet_name = name + + if not region_name: + region = self._set_region(region) + + if not region: + raise ValueError("Could not determine region for subnetwork.") + else: + region_name = region.name + + request = "/regions/{}/subnetworks/{}".format(region_name, subnet_name) + self.connection.async_request(request, method="DELETE").object + + return True + + def ex_get_subnetwork(self, name, region=None): + """ + Return a Subnetwork object based on name and region. + + :param name: The name or URL of the subnetwork + :type name: ``str`` + + :keyword region: The region of the subnetwork + :type region: ``str`` or :class:`GCERegion` or ``None`` + + :return: A Subnetwork object + :rtype: :class:`GCESubnetwork` + """ + region_name = None + + if name.startswith("https://"): + request = name + else: + if isinstance(region, GCERegion): + region_name = region.name + elif isinstance(region, str): + if region.startswith("https://"): + region_name = region.split("/")[-1] + else: + region_name = region + + if not region_name: + region = self._set_region(region) + + if not region: + raise ValueError("Could not determine region for subnetwork.") + else: + region_name = region.name + + request = "/regions/{}/subnetworks/{}".format(region_name, name) + + response = self.connection.request(request, method="GET").object + + return self._to_subnetwork(response) + def ex_get_network(self, name): """ Return a Network object based on a network name. - :param name: The name of the network + :param name: The name or URL of the network :type name: ``str`` :return: A Network object for the network :rtype: :class:`GCENetwork` """ - request = '/global/networks/%s' % (name) - response = self.connection.request(request, method='GET').object + + if name.startswith("https://"): + request = name + else: + request = "/global/networks/%s" % (name) + response = self.connection.request(request, method="GET").object + return self._to_network(response) def ex_get_node(self, name, zone=None): @@ -3923,10 +8371,10 @@ def ex_get_node(self, name, zone=None): :return: A Node object for the node :rtype: :class:`Node` """ - zone = self._set_zone(zone) or self._find_zone_or_region( - name, 'instances', res_name='Node') - request = '/zones/%s/instances/%s' % (zone.name, name) - response = self.connection.request(request, method='GET').object + zone = self._set_zone(zone) or self._find_zone_or_region(name, "instances", res_name="Node") + request = "/zones/{}/instances/{}".format(zone.name, name) + response = self.connection.request(request, method="GET").object + return self._to_node(response) def ex_get_project(self): @@ -3936,7 +8384,8 @@ def ex_get_project(self): :return: A GCEProject object :rtype: :class:`GCEProject` """ - response = self.connection.request('', method='GET').object + response = self.connection.request("", method="GET").object + return self._to_project(response) def ex_get_size(self, name, zone=None): @@ -3954,11 +8403,14 @@ def ex_get_size(self, name, zone=None): :rtype: :class:`GCENodeSize` """ zone = zone or self.zone - if not hasattr(zone, 'name'): + + if not hasattr(zone, "name"): zone = self.ex_get_zone(zone) - request = '/zones/%s/machineTypes/%s' % (zone.name, name) - response = self.connection.request(request, method='GET').object - return self._to_node_size(response) + request = "/zones/{}/machineTypes/{}".format(zone.name, name) + response = self.connection.request(request, method="GET").object + instance_prices = get_pricing(driver_type="compute", driver_name="gce_instances") + + return self._to_node_size(response, instance_prices) def ex_get_snapshot(self, name): """ @@ -3970,30 +8422,48 @@ def ex_get_snapshot(self, name): :return: A GCESnapshot object for the snapshot :rtype: :class:`GCESnapshot` """ - request = '/global/snapshots/%s' % (name) - response = self.connection.request(request, method='GET').object + request = "/global/snapshots/%s" % (name) + response = self.connection.request(request, method="GET").object + return self._to_snapshot(response) - def ex_get_volume(self, name, zone=None): + def ex_get_volume(self, name, zone=None, use_cache=False): """ Return a Volume object based on a volume name and optional zone. - :param name: The name of the volume - :type name: ``str`` + To improve performance, we request all disks and allow the user + to consult the cache dictionary rather than making an API call. + + :param name: The name of the volume + :type name: ``str`` :keyword zone: The zone to search for the volume in (set to 'all' to search all zones) :type zone: ``str`` or :class:`GCEZone` or :class:`NodeLocation` or ``None`` + :keyword use_cache: Search for the volume in the existing cache of + volumes. If True, we omit the API call and search + self.volumes_dict. If False, a call to + disks/aggregatedList is made prior to searching + self._ex_volume_dict. + :type use_cache: ``bool`` + :return: A StorageVolume object for the volume :rtype: :class:`StorageVolume` """ - zone = self._set_zone(zone) or self._find_zone_or_region( - name, 'disks', res_name='Volume') - request = '/zones/%s/disks/%s' % (zone.name, name) - response = self.connection.request(request, method='GET').object - return self._to_storage_volume(response) + + if not self._ex_volume_dict or use_cache is False: + # Make the API call and build volume dictionary + self._ex_populate_volume_dict() + + try: + # if zone is of class GCEZone or NodeLocation, get name instead + zone = zone.name + except AttributeError: + pass + + return self._ex_lookup_volume(name, zone) def ex_get_region(self, name): """ @@ -4005,19 +8475,45 @@ def ex_get_region(self, name): :return: A GCERegion object for the region :rtype: :class:`GCERegion` """ - if name.startswith('https://'): - short_name = self._get_components_from_path(name)['name'] + + if name.startswith("https://"): + short_name = self._get_components_from_path(name)["name"] request = name else: short_name = name - request = '/regions/%s' % (name) + request = "/regions/%s" % (name) # Check region cache first + if short_name in self.region_dict: return self.region_dict[short_name] # Otherwise, look up region information - response = self.connection.request(request, method='GET').object + response = self.connection.request(request, method="GET").object + return self._to_region(response) + def ex_get_sslcertificate(self, name): + """ + Returns the specified SslCertificate resource. Get a list of available + SSL certificates by making a list() request. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + * https://www.googleapis.com/auth/compute.readonly + + :param name: Name of the SslCertificate resource to + return. + :type name: ``str`` + + :return: `GCESslCertificate` object. + :rtype: :class:`GCESslCertificate` + """ + + request = "/global/sslCertificates/%s" % (name) + response = self.connection.request(request, method="GET").object + + return self._to_sslcertificate(response) + def ex_get_targethttpproxy(self, name): """ Return a Target HTTP Proxy object based on its name. @@ -4028,10 +8524,34 @@ def ex_get_targethttpproxy(self, name): :return: A Target HTTP Proxy object for the pool :rtype: :class:`GCETargetHttpProxy` """ - request = '/global/targetHttpProxies/%s' % name - response = self.connection.request(request, method='GET').object + request = "/global/targetHttpProxies/%s" % name + response = self.connection.request(request, method="GET").object + return self._to_targethttpproxy(response) + def ex_get_targethttpsproxy(self, name): + """ + Returns the specified TargetHttpsProxy resource. Get a list of + available target HTTPS proxies by making a list() request. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + * https://www.googleapis.com/auth/compute.readonly + + :param name: Name of the TargetHttpsProxy resource to + return. + :type name: ``str`` + + :return: `GCETargetHttpsProxy` object. + :rtype: :class:`GCETargetHttpsProxy` + """ + + request = "/global/targetHttpsProxies/%s" % (name) + response = self.connection.request(request, method="GET").object + + return self._to_targethttpsproxy(response) + def ex_get_targetinstance(self, name, zone=None): """ Return a TargetInstance object based on a name and optional zone. @@ -4047,9 +8567,11 @@ def ex_get_targetinstance(self, name, zone=None): :rtype: :class:`GCETargetInstance` """ zone = self._set_zone(zone) or self._find_zone_or_region( - name, 'targetInstances', res_name='TargetInstance') - request = '/zones/%s/targetInstances/%s' % (zone.name, name) - response = self.connection.request(request, method='GET').object + name, "targetInstances", res_name="TargetInstance" + ) + request = "/zones/{}/targetInstances/{}".format(zone.name, name) + response = self.connection.request(request, method="GET").object + return self._to_targetinstance(response) def ex_get_targetpool(self, name, region=None): @@ -4067,9 +8589,11 @@ def ex_get_targetpool(self, name, region=None): :rtype: :class:`GCETargetPool` """ region = self._set_region(region) or self._find_zone_or_region( - name, 'targetPools', region=True, res_name='TargetPool') - request = '/regions/%s/targetPools/%s' % (region.name, name) - response = self.connection.request(request, method='GET').object + name, "targetPools", region=True, res_name="TargetPool" + ) + request = "/regions/{}/targetPools/{}".format(region.name, name) + response = self.connection.request(request, method="GET").object + return self._to_targetpool(response) def ex_get_urlmap(self, name): @@ -4082,10 +8606,98 @@ def ex_get_urlmap(self, name): :return: A URL Map object for the backend service :rtype: :class:`GCEUrlMap` """ - request = '/global/urlMaps/%s' % name - response = self.connection.request(request, method='GET').object + request = "/global/urlMaps/%s" % name + response = self.connection.request(request, method="GET").object + return self._to_urlmap(response) + def ex_get_instancegroup(self, name, zone=None): + """ + Returns the specified Instance Group. Get a list of available instance + groups by making a list() request. + + Scopes needed - one of the following: + * https://www.googleapis.com/auth/cloud-platform + * https://www.googleapis.com/auth/compute + * https://www.googleapis.com/auth/compute.readonly + + :param name: The name of the instance group. + :type name: ``str`` + + :param zone: The name of the zone where the instance group is + located. + :type zone: ``str`` + + :return: `GCEInstanceGroup` object. + :rtype: :class:`GCEInstanceGroup` + """ + zone = self._set_zone(zone) or self._find_zone_or_region( + name, "instanceGroups", region=False, res_name="Instancegroup" + ) + request = "/zones/{}/instanceGroups/{}".format(zone.name, name) + response = self.connection.request(request, method="GET").object + + return self._to_instancegroup(response) + + def ex_get_instancegroupmanager(self, name, zone=None): + """ + Return a InstanceGroupManager object based on a name and optional zone. + + :param name: The name of the Instance Group Manager. + :type name: ``str`` + + :keyword zone: The zone to search for the Instance Group Manager. + Set to 'all' to search all zones. + :type zone: ``str`` or :class:`GCEZone` or ``None`` + + :return: An Instance Group Manager object. + :rtype: :class:`GCEInstanceGroupManager` + """ + zone = self._set_zone(zone) or self._find_zone_or_region( + name, "instanceGroupManagers", region=False, res_name="Instancegroupmanager" + ) + request = "/zones/{}/instanceGroupManagers/{}".format(zone.name, name) + response = self.connection.request(request, method="GET").object + + return self._to_instancegroupmanager(response) + + def ex_get_instancetemplate(self, name): + """ + Return an InstanceTemplate object based on a name and optional zone. + + :param name: The name of the Instance Template. + :type name: ``str`` + + :return: An Instance Template object. + :rtype: :class:`GCEInstanceTemplate` + """ + request = "/global/instanceTemplates/%s" % (name) + response = self.connection.request(request, method="GET").object + + return self._to_instancetemplate(response) + + def ex_get_autoscaler(self, name, zone=None): + """ + Return an Autoscaler object based on a name and optional zone. + + :param name: The name of the Autoscaler. + :type name: ``str`` + + :keyword zone: The zone to search for the Autoscaler. Set to + 'all' to search all zones. + :type zone: ``str`` or :class:`GCEZone` or ``None`` + + :return: An Autoscaler object. + :rtype: :class:`GCEAutoscaler` + """ + zone = self._set_zone(zone) or self._find_zone_or_region( + name, "Autoscalers", region=False, res_name="Autoscalers" + ) + request = "/zones/{}/autoscalers/{}".format(zone.name, name) + response = self.connection.request(request, method="GET").object + + return self._to_autoscaler(response) + def ex_get_zone(self, name): """ Return a Zone object based on the zone name. @@ -4096,63 +8708,119 @@ def ex_get_zone(self, name): :return: A GCEZone object for the zone or None if not found :rtype: :class:`GCEZone` or ``None`` """ - if name.startswith('https://'): - short_name = self._get_components_from_path(name)['name'] + + if name.startswith("https://"): + short_name = self._get_components_from_path(name)["name"] request = name else: short_name = name - request = '/zones/%s' % (name) + request = "/zones/%s" % (name) # Check zone cache first + if short_name in self.zone_dict: return self.zone_dict[short_name] # Otherwise, look up zone information try: - response = self.connection.request(request, method='GET').object + response = self.connection.request(request, method="GET").object except ResourceNotFoundError: return None + return self._to_zone(response) - def ex_copy_image(self, name, url, description=None): + def _ex_connection_class_kwargs(self): + return { + "auth_type": self.auth_type, + "project": self.project, + "scopes": self.scopes, + "credential_file": self.credential_file, + } + + def _build_volume_dict(self, zone_dict): + """ + Build a dictionary in [name][zone]=disk format. + + :param zone_dict: dict in the format of: + { items: {key: {api_name:[], key2: api_name:[]}} } + :type zone_dict: ``dict`` + + :return: dict of volumes, organized by name, then zone Format: + { 'disk_name': + {'zone_name1': disk_info, 'zone_name2': disk_info} } + :rtype: ``dict`` + """ + name_zone_dict = {} + + for k, v in zone_dict.items(): + zone_name = k.replace("zones/", "") + disks = v.get("disks", []) + + for disk in disks: + n = disk["name"] + name_zone_dict.setdefault(n, {}) + name_zone_dict[n].update({zone_name: disk}) + + return name_zone_dict + + def _ex_lookup_volume(self, volume_name, zone=None): + """ + Look up volume by name and zone in volume dict. + + If zone isn't specified or equals 'all', we return the volume + for the first zone, as determined alphabetically. + + :param volume_name: The name of the volume. + :type volume_name: ``str`` + + :keyword zone: The zone to search for the volume in (set to 'all' to + search all zones) + :type zone: ``str`` or ``None`` + + :return: A StorageVolume object for the volume. + :rtype: :class:`StorageVolume` or raise ``ResourceNotFoundError``. """ - Copy an image to your image collection. - :param name: The name of the image - :type name: ``str`` + if volume_name not in self._ex_volume_dict: + # Possibly added through another thread/process, so re-populate + # _volume_dict and try again. If still not found, raise exception. + self._ex_populate_volume_dict() - :param url: The URL to the image. The URL can start with `gs://` - :param url: ``str`` + if volume_name not in self._ex_volume_dict: + raise ResourceNotFoundError( + "Volume name: '{}' not found. Zone: {}".format(volume_name, zone), + None, + None, + ) + # Disk names are not unique across zones, so if zone is None or + # 'all', we return the first one we find for that disk name. For + # consistency, we sort by keys and set the zone to the first key. - :param description: The description of the image - :type description: ``str`` + if zone is None or zone == "all": + zone = sorted(self._ex_volume_dict[volume_name])[0] - :return: NodeImage object based on provided information or None if an - image with that name is not found. - :rtype: :class:`NodeImage` or ``None`` - """ + volume = self._ex_volume_dict[volume_name].get(zone, None) - # the URL for an image can start with gs:// - if url.startswith('gs://'): - url = url.replace('gs://', 'https://storage.googleapis.com/', 1) + if not volume: + raise ResourceNotFoundError( + "Volume '{}' not found for zone {}.".format(volume_name, zone), None, None + ) - image_data = { - 'name': name, - 'description': description, - 'sourceType': 'RAW', - 'rawDisk': { - 'source': url, - }, - } + return self._to_storage_volume(volume) - request = '/global/images' - self.connection.async_request(request, method='POST', - data=image_data) - return self.ex_get_image(name) + def _ex_populate_volume_dict(self): + """ + Fetch the volume information using disks/aggregatedList + and store it in _ex_volume_dict. - def _ex_connection_class_kwargs(self): - return {'auth_type': self.auth_type, - 'project': self.project, - 'scopes': self.scopes, - 'credential_file': self.credential_file} + return: ``None`` + """ + # fill the volume dict by making an aggegatedList call to disks. + aggregated_items = self.connection.request_aggregated_items("disks") + + # _ex_volume_dict is in the format of: + # { 'disk_name' : { 'zone1': disk, 'zone2': disk, ... }} + self._ex_volume_dict = self._build_volume_dict(aggregated_items["items"]) + + return None def _catch_error(self, ignore_errors=False): """ @@ -4166,6 +8834,7 @@ def _catch_error(self, ignore_errors=False): :rtype: :class:`Exception` """ e = sys.exc_info()[1] + if ignore_errors: return e else: @@ -4185,16 +8854,17 @@ def _get_components_from_path(self, path): region = None zone = None glob = False - components = path.split('/') + components = path.split("/") name = components[-1] - if components[-4] == 'regions': + + if components[-4] == "regions": region = components[-3] - elif components[-4] == 'zones': + elif components[-4] == "zones": zone = components[-3] - elif components[-3] == 'global': + elif components[-3] == "global": glob = True - return {'name': name, 'region': region, 'zone': zone, 'global': glob} + return {"name": name, "region": region, "zone": zone, "global": glob} def _get_object_by_kind(self, url): """ @@ -4208,13 +8878,15 @@ def _get_object_by_kind(self, url): :return: Object representation of the requested resource. "rtype: :class:`object` or ``None`` """ + if not url: return None # Relies on GoogleBaseConnection.morph_action_hook to rewrite # the URL to a request - response = self.connection.request(url, method='GET').object - return GCENodeDriver.KIND_METHOD_MAP[response['kind']](self, response) + response = self.connection.request(url, method="GET").object + + return GCENodeDriver.KIND_METHOD_MAP[response["kind"]](self, response) def _get_region_from_zone(self, zone): """ @@ -4226,13 +8898,14 @@ def _get_region_from_zone(self, zone): :return: Region object that contains the zone :rtype: :class:`GCERegion` """ + for region in self.region_list: zones = [z.name for z in region.zones] + if zone.name in zones: return region - def _find_zone_or_region(self, name, res_type, region=False, - res_name=None): + def _find_zone_or_region(self, name, res_type, region=False, res_name=None): """ Find the zone or region for a named resource. @@ -4253,25 +8926,29 @@ def _find_zone_or_region(self, name, res_type, region=False, :return: Zone/Region object for the zone/region for the resource. :rtype: :class:`GCEZone` or :class:`GCERegion` """ + if region: - rz = 'region' + rz = "region" else: - rz = 'zone' + rz = "zone" rz_name = None res_name = res_name or res_type - request = '/aggregated/%s' % (res_type) - res_list = self.connection.request(request).object - for k, v in res_list['items'].items(): + res_list = self.connection.request_aggregated_items(res_type) + + for k, v in res_list["items"].items(): for res in v.get(res_type, []): - if res['name'] == name: - rz_name = k.replace('%ss/' % (rz), '') + if res["name"] == name: + rz_name = k.replace("%ss/" % (rz), "") + break + if not rz_name: raise ResourceNotFoundError( - '%s \'%s\' not found in any %s.' % (res_name, name, rz), - None, None) + "{} '{}' not found in any {}.".format(res_name, name, rz), None, None + ) else: - getrz = getattr(self, 'ex_get_%s' % (rz)) + getrz = getattr(self, "ex_get_%s" % (rz)) + return getrz(rz_name) def _match_images(self, project, partial_name): @@ -4283,9 +8960,9 @@ def _match_images(self, project, partial_name): supplied project. If no project is given, it will search your own project. - :param project: The name of the project to search for images. - Examples include: 'debian-cloud' and 'centos-cloud'. - :type project: ``str`` or ``None`` + :param project: The name of the project to search for images. + Examples include: 'debian-cloud' and 'centos-cloud'. + :type project: ``str``, ``list`` of ``str``, or ``None`` :param partial_name: The full name or beginning of a name for an image. @@ -4295,16 +8972,21 @@ def _match_images(self, project, partial_name): if no matching image is found. :rtype: :class:`GCENodeImage` or ``None`` """ - project_images = self.list_images(ex_project=project, - ex_include_deprecated=True) + project_images_list = self.ex_list( + self.list_images, ex_project=project, ex_include_deprecated=True + ) partial_match = [] - for image in project_images: - if image.name == partial_name: - return image - if image.name.startswith(partial_name): - ts = timestamp_to_datetime(image.extra['creationTimestamp']) - if not partial_match or partial_match[0] < ts: - partial_match = [ts, image] + + for page in project_images_list.page(): + for image in page: + if image.name == partial_name: + return image + + if image.name.startswith(partial_name): + ts = timestamp_to_datetime(image.extra["creationTimestamp"]) + + if not partial_match or partial_match[0] < ts: + partial_match = [ts, image] if partial_match: return partial_match[1] @@ -4321,11 +9003,12 @@ def _set_region(self, region): """ region = region or self.region - if region == 'all' or region is None: + if region == "all" or region is None: return None - if not hasattr(region, 'name'): + if not hasattr(region, "name"): region = self.ex_get_region(region) + return region def _set_zone(self, zone): @@ -4333,31 +9016,53 @@ def _set_zone(self, zone): Return the zone to use for listing resources. :param zone: A name, zone object, None, or 'all' - :type region: ``str`` or :class:`GCEZone` or ``None`` + :type zone: ``str`` or :class:`GCEZone` or ``None`` :return: A zone object or None if all zones should be considered :rtype: :class:`GCEZone` or ``None`` """ zone = zone or self.zone - if zone == 'all' or zone is None: + if zone == "all" or zone is None: return None - if not hasattr(zone, 'name'): + if not hasattr(zone, "name"): zone = self.ex_get_zone(zone) + return zone - def _create_node_req(self, name, size, image, location, network=None, - tags=None, metadata=None, boot_disk=None, - external_ip='ephemeral', ex_disk_type='pd-standard', - ex_disk_auto_delete=True, ex_service_accounts=None, - description=None, ex_can_ip_forward=None, - ex_disks_gce_struct=None, ex_nic_gce_struct=None, - ex_on_host_maintenance=None, - ex_automatic_restart=None): - """ - Returns a request and body to create a new node. This is a helper - method to support both :class:`create_node` and + def _create_node_req( + self, + name, + size, + image, + location, + network=None, + tags=None, + metadata=None, + boot_disk=None, + external_ip="ephemeral", + internal_ip=None, + ex_disk_type="pd-standard", + ex_disk_auto_delete=True, + ex_service_accounts=None, + description=None, + ex_can_ip_forward=None, + ex_disks_gce_struct=None, + ex_nic_gce_struct=None, + ex_on_host_maintenance=None, + ex_automatic_restart=None, + ex_preemptible=None, + ex_subnetwork=None, + ex_labels=None, + ex_accelerator_type=None, + ex_accelerator_count=None, + ex_disk_size=None, + ): + """ + Returns a request and body to create a new node. + + This is a helper method to support both :class:`create_node` and :class:`ex_create_multiple_nodes`. :param name: The name of the node to create. @@ -4389,9 +9094,14 @@ def _create_node_req(self, name, size, image, location, network=None, (default), a new non-static address will be used. If 'None', then no external address will be used. To use an existing static IP address, - a GCEAddress object should be passed in. + a GCEAddress object should be passed in. This + param will be ignored if also using the + ex_nic_gce_struct param. :type external_ip: :class:`GCEAddress` or ``str`` or None + :keyword internal_ip: The private IP address to use. + :type internal_ip: :class:`GCEAddress` or ``str`` or ``None`` + :keyword ex_disk_type: Specify a pd-standard (default) disk or pd-ssd for an SSD disk. :type ex_disk_type: ``str`` or :class:`GCEDiskType` or ``None`` @@ -4406,7 +9116,7 @@ def _create_node_req(self, name, size, image, location, network=None, list of dictionaries containing email and list of scopes, e.g. [{'email':'default', - 'scopes':['compute', ...]}, ...] + 'scopes':['compute', ...]}, ...] Scopes can either be full URLs or short names. If not provided, use the 'default' service account email and a @@ -4427,7 +9137,7 @@ def _create_node_req(self, name, size, image, location, network=None, is made to ensure proper formatting of the disks[] structure. Using this structure obviates the need of using - other disk params like 'ex_boot_disk', + other disk params like 'boot_disk', etc. See the GCE docs for specific details. :type ex_disks_gce_struct: ``list`` or ``None`` @@ -4441,7 +9151,7 @@ def _create_node_req(self, name, size, image, location, network=None, 'ex_network'. See the GCE docs for details. :type ex_nic_gce_struct: ``list`` or ``None`` -n + :keyword ex_on_host_maintenance: Defines whether node should be terminated or migrated when host machine goes down. Acceptable values @@ -4458,108 +9168,89 @@ def _create_node_req(self, name, size, image, location, network=None, default value for the instance type.) :type ex_automatic_restart: ``bool`` or ``None`` + :keyword ex_preemptible: Defines whether the instance is preemptible. + (If not supplied, the instance will + not be preemptible) + :type ex_preemptible: ``bool`` or ``None`` + + :param ex_subnetwork: The network to associate with the node. + :type ex_subnetwork: :class:`GCESubnetwork` + + :keyword ex_disk_size: Specify the size of boot disk. + Integer in gigabytes. + :type ex_disk_size: ``int`` or ``None`` + + :param ex_labels: Label dict for node. + :type ex_labels: ``dict`` or ``None`` + + :param ex_accelerator_type: The accelerator to associate with the + node. + :type ex_accelerator_type: :class:`GCEAcceleratorType` or ``None`` + + :param ex_accelerator_count: The number of accelerators to associate + with the node. + :type ex_accelerator_count: ``int`` or ``None`` + + :keyword ex_disk_size: Specify size of the boot disk. + Integer in gigabytes. + :type ex_disk_size: ``int`` or ``None`` + :return: A tuple containing a request string and a node_data dict. :rtype: ``tuple`` of ``str`` and ``dict`` """ - node_data = {} - node_data['machineType'] = size.extra['selfLink'] - node_data['name'] = name - if tags: - node_data['tags'] = {'items': tags} - if metadata: - node_data['metadata'] = self._format_metadata(fingerprint='na', - metadata=metadata) - - # by default, new instances will match the same serviceAccount and - # scope set in the Developers Console and Cloud SDK - if not ex_service_accounts: - set_scopes = [{ - 'email': 'default', - 'scopes': [self.AUTH_URL + 'devstorage.read_only'] - }] - elif not isinstance(ex_service_accounts, list): - raise ValueError("ex_service_accounts field is not a list.") - else: - set_scopes = [] - for sa in ex_service_accounts: - if not isinstance(sa, dict): - raise ValueError("ex_service_accounts needs to be a list " - "of dicts, got: '%s - %s'" % ( - str(type(sa)), str(sa))) - if 'email' not in sa: - sa['email'] = 'default' - if 'scopes' not in sa: - sa['scopes'] = [self.AUTH_URL + 'devstorage.read_only'] - ps = [] - for scope in sa['scopes']: - if scope.startswith(self.AUTH_URL): - ps.append(scope) - elif scope in self.SA_SCOPES_MAP: - ps.append(self.AUTH_URL + self.SA_SCOPES_MAP[scope]) - else: - ps.append(self.AUTH_URL + scope) - sa['scopes'] = ps - set_scopes.append(sa) - node_data['serviceAccounts'] = set_scopes - if boot_disk and ex_disks_gce_struct: - raise ValueError("Cannot specify both 'boot_disk' and " - "'ex_disks_gce_struct'. Use one or the other.") + # build disks if not image and not boot_disk and not ex_disks_gce_struct: - raise ValueError("Missing root device or image. Must specify an " - "'image', existing 'boot_disk', or use the " - "'ex_disks_gce_struct'.") + raise ValueError( + "Missing root device or image. Must specify an " + "'image', existing 'boot_disk', or use the " + "'ex_disks_gce_struct'." + ) - if boot_disk: - if not isinstance(ex_disk_auto_delete, bool): - raise ValueError("ex_disk_auto_delete field is not a bool.") - disks = [{'boot': True, - 'type': 'PERSISTENT', - 'mode': 'READ_WRITE', - 'deviceName': boot_disk.name, - 'autoDelete': ex_disk_auto_delete, - 'zone': boot_disk.extra['zone'].extra['selfLink'], - 'source': boot_disk.extra['selfLink']}] - node_data['disks'] = disks - - if ex_disks_gce_struct: - node_data['disks'] = ex_disks_gce_struct - - if network and ex_nic_gce_struct: - raise ValueError("Cannot specify both 'network' and " - "'ex_nic_gce_struct'. Use one or the other.") + if boot_disk and ex_disks_gce_struct: + raise ValueError( + "Cannot specify both 'boot_disk' and " + "'ex_disks_gce_struct'. Use one or the other." + ) - if network: - ni = [{'kind': 'compute#instanceNetworkInterface', - 'network': network.extra['selfLink']}] - if external_ip: - access_configs = [{'name': 'External NAT', - 'type': 'ONE_TO_ONE_NAT'}] - if hasattr(external_ip, 'address'): - access_configs[0]['natIP'] = external_ip.address - ni[0]['accessConfigs'] = access_configs - else: - ni = ex_nic_gce_struct - node_data['networkInterfaces'] = ni + use_selflinks = True + source = None - if description: - node_data['description'] = str(description) - if ex_can_ip_forward: - node_data['canIpForward'] = True - scheduling = {} - if ex_on_host_maintenance: - if isinstance(ex_on_host_maintenance, str) and \ - ex_on_host_maintenance in ['MIGRATE', 'TERMINATE']: - scheduling['onHostMaintenance'] = ex_on_host_maintenance - else: - scheduling['onHostMaintenance'] = 'MIGRATE' - if ex_automatic_restart is not None: - scheduling['automaticRestart'] = ex_automatic_restart - if scheduling: - node_data['scheduling'] = scheduling + if boot_disk: + source = boot_disk + + node_data = self._create_instance_properties( + name, + node_size=size, + image=image, + source=source, + disk_type=ex_disk_type, + disk_auto_delete=ex_disk_auto_delete, + external_ip=external_ip, + network=network, + subnetwork=ex_subnetwork, + can_ip_forward=ex_can_ip_forward, + internal_ip=internal_ip, + service_accounts=ex_service_accounts, + on_host_maintenance=ex_on_host_maintenance, + automatic_restart=ex_automatic_restart, + preemptible=ex_preemptible, + tags=tags, + metadata=metadata, + labels=ex_labels, + description=description, + disks_gce_struct=ex_disks_gce_struct, + nic_gce_struct=ex_nic_gce_struct, + accelerator_type=ex_accelerator_type, + accelerator_count=ex_accelerator_count, + use_selflinks=use_selflinks, + disk_size=ex_disk_size, + ) + node_data["name"] = name + + request = "/zones/%s/instances" % (location.name) - request = '/zones/%s/instances' % (location.name) return request, node_data def _multi_create_disk(self, status, node_attrs): @@ -4575,35 +9266,36 @@ def _multi_create_disk(self, status, node_attrs): """ disk = None # Check for existing disk - if node_attrs['use_existing_disk']: + + if node_attrs["use_existing_disk"]: try: - disk = self.ex_get_volume(status['name'], - node_attrs['location']) + disk = self.ex_get_volume(status["name"], node_attrs["location"]) except ResourceNotFoundError: pass if disk: - status['disk'] = disk + status["disk"] = disk else: # Create disk and return response object back in the status dict. # Or, if there is an error, mark as failed. disk_req, disk_data, disk_params = self._create_vol_req( - None, status['name'], location=node_attrs['location'], - image=node_attrs['image'], - ex_disk_type=node_attrs['ex_disk_type']) + None, + status["name"], + location=node_attrs["location"], + image=node_attrs["image"], + ex_disk_type=node_attrs["ex_disk_type"], + ) try: disk_res = self.connection.request( - disk_req, method='POST', data=disk_data, - params=disk_params).object + disk_req, method="POST", data=disk_data, params=disk_params + ).object except GoogleBaseError: - e = self._catch_error( - ignore_errors=node_attrs['ignore_errors']) + e = self._catch_error(ignore_errors=node_attrs["ignore_errors"]) error = e.value code = e.code disk_res = None - status['disk'] = GCEFailedDisk(status['name'], - error, code) - status['disk_response'] = disk_res + status["disk"] = GCEFailedDisk(status["name"], error, code) + status["disk_response"] = disk_res def _multi_check_disk(self, status, node_attrs): """Check disk status for ex_create_multiple_nodes. @@ -4617,26 +9309,27 @@ def _multi_check_disk(self, status, node_attrs): :type node_attrs: ``dict`` """ error = None + code = None try: - response = self.connection.request( - status['disk_response']['selfLink']).object + response = self.connection.request(status["disk_response"]["selfLink"]).object except GoogleBaseError: - e = self._catch_error(ignore_errors=node_attrs['ignore_errors']) + e = self._catch_error(ignore_errors=node_attrs["ignore_errors"]) error = e.value code = e.code - response = {'status': 'DONE'} - if response['status'] == 'DONE': - status['disk_response'] = None + response = {"status": "DONE"} + + if response["status"] == "DONE": + status["disk_response"] = None + if error: - status['disk'] = GCEFailedDisk(status['name'], error, code) + status["disk"] = GCEFailedDisk(status["name"], error, code) else: - status['disk'] = self.ex_get_volume(status['name'], - node_attrs['location']) + status["disk"] = self.ex_get_volume(status["name"], node_attrs["location"]) def _multi_create_node(self, status, node_attrs): """Create node for ex_create_multiple_nodes. - :param status: Dictionary for holding node/disk creation status. + :param status: Dictionary for holding node creation status. (This dictionary is modified by this method) :type status: ``dict`` @@ -4644,37 +9337,42 @@ def _multi_create_node(self, status, node_attrs): (size, image, location, etc.) :type node_attrs: ``dict`` """ - # If disk has an error, set the node as failed and return - if hasattr(status['disk'], 'error'): - status['node'] = status['disk'] - return # Create node and return response object in status dictionary. # Or, if there is an error, mark as failed. request, node_data = self._create_node_req( - status['name'], node_attrs['size'], node_attrs['image'], - node_attrs['location'], node_attrs['network'], node_attrs['tags'], - node_attrs['metadata'], boot_disk=status['disk'], - external_ip=node_attrs['external_ip'], - ex_service_accounts=node_attrs['ex_service_accounts'], - description=node_attrs['description'], - ex_can_ip_forward=node_attrs['ex_can_ip_forward'], - ex_disks_gce_struct=node_attrs['ex_disks_gce_struct'], - ex_nic_gce_struct=node_attrs['ex_nic_gce_struct'], - ex_on_host_maintenance=node_attrs['ex_on_host_maintenance'], - ex_automatic_restart=node_attrs['ex_automatic_restart']) + status["name"], + node_attrs["size"], + node_attrs["image"], + node_attrs["location"], + node_attrs["network"], + node_attrs["tags"], + node_attrs["metadata"], + external_ip=node_attrs["external_ip"], + internal_ip=node_attrs["internal_ip"], + ex_service_accounts=node_attrs["ex_service_accounts"], + description=node_attrs["description"], + ex_can_ip_forward=node_attrs["ex_can_ip_forward"], + ex_disk_auto_delete=node_attrs["ex_disk_auto_delete"], + ex_disks_gce_struct=node_attrs["ex_disks_gce_struct"], + ex_nic_gce_struct=node_attrs["ex_nic_gce_struct"], + ex_on_host_maintenance=node_attrs["ex_on_host_maintenance"], + ex_automatic_restart=node_attrs["ex_automatic_restart"], + ex_subnetwork=node_attrs["subnetwork"], + ex_preemptible=node_attrs["ex_preemptible"], + ex_labels=node_attrs["ex_labels"], + ex_disk_size=node_attrs["ex_disk_size"], + ) try: - node_res = self.connection.request( - request, method='POST', data=node_data).object + node_res = self.connection.request(request, method="POST", data=node_data).object except GoogleBaseError: - e = self._catch_error(ignore_errors=node_attrs['ignore_errors']) + e = self._catch_error(ignore_errors=node_attrs["ignore_errors"]) error = e.value code = e.code node_res = None - status['node'] = GCEFailedNode(status['name'], - error, code) - status['node_response'] = node_res + status["node"] = GCEFailedNode(status["name"], error, code) + status["node_response"] = node_res def _multi_check_node(self, status, node_attrs): """Check node status for ex_create_multiple_nodes. @@ -4688,25 +9386,32 @@ def _multi_check_node(self, status, node_attrs): :type node_attrs: ``dict`` """ error = None + code = None try: - response = self.connection.request( - status['node_response']['selfLink']).object + response = self.connection.request(status["node_response"]["selfLink"]).object except GoogleBaseError: - e = self._catch_error(ignore_errors=node_attrs['ignore_errors']) + e = self._catch_error(ignore_errors=node_attrs["ignore_errors"]) error = e.value code = e.code - response = {'status': 'DONE'} - if response['status'] == 'DONE': - status['node_response'] = None - if error: - status['node'] = GCEFailedNode(status['name'], - error, code) - else: - status['node'] = self.ex_get_node(status['name'], - node_attrs['location']) + response = {"status": "DONE"} - def _create_vol_req(self, size, name, location=None, snapshot=None, - image=None, ex_disk_type='pd-standard'): + if response["status"] == "DONE": + status["node_response"] = None + + if error: + status["node"] = GCEFailedNode(status["name"], error, code) + else: + status["node"] = self.ex_get_node(status["name"], node_attrs["location"]) + + def _create_vol_req( + self, + size, + name, + location=None, + snapshot=None, + image=None, + ex_disk_type="pd-standard", + ): """ Assemble the request/data for creating a volume. @@ -4738,36 +9443,46 @@ def _create_vol_req(self, size, name, location=None, snapshot=None, """ volume_data = {} params = None - volume_data['name'] = name + volume_data["name"] = name + if size: - volume_data['sizeGb'] = str(size) + volume_data["sizeGb"] = str(size) + if image: - if not hasattr(image, 'name'): + if not hasattr(image, "name"): image = self.ex_get_image(image) - params = {'sourceImage': image.extra['selfLink']} - volume_data['description'] = 'Image: %s' % ( - image.extra['selfLink']) + params = {"sourceImage": image.extra["selfLink"]} + volume_data["description"] = "Image: %s" % (image.extra["selfLink"]) + if snapshot: - if not hasattr(snapshot, 'name'): + if not hasattr(snapshot, "name"): # Check for full URI to not break backward-compatibility - if snapshot.startswith('https'): - snapshot = self._get_components_from_path(snapshot)['name'] + + if snapshot.startswith("https"): + snapshot = self._get_components_from_path(snapshot)["name"] snapshot = self.ex_get_snapshot(snapshot) - snapshot_link = snapshot.extra['selfLink'] - volume_data['sourceSnapshot'] = snapshot_link - volume_data['description'] = 'Snapshot: %s' % (snapshot_link) + snapshot_link = snapshot.extra["selfLink"] + volume_data["sourceSnapshot"] = snapshot_link + volume_data["description"] = "Snapshot: %s" % (snapshot_link) location = location or self.zone - if not hasattr(location, 'name'): + + if not hasattr(location, "name"): location = self.ex_get_zone(location) - if hasattr(ex_disk_type, 'name'): - volume_data['type'] = ex_disk_type.extra['selfLink'] - elif ex_disk_type.startswith('https'): - volume_data['type'] = ex_disk_type + + if hasattr(ex_disk_type, "name"): + # pylint: disable=no-member + volume_data["type"] = ex_disk_type.extra["selfLink"] + elif ex_disk_type.startswith("https"): + volume_data["type"] = ex_disk_type else: - volume_data['type'] = 'https://www.googleapis.com/compute/' - volume_data['type'] += '%s/projects/%s/zones/%s/diskTypes/%s' % ( - API_VERSION, self.project, location.name, ex_disk_type) - request = '/zones/%s/disks' % (location.name) + volume_data["type"] = "https://www.googleapis.com/compute/" + volume_data["type"] += "{}/projects/{}/zones/{}/diskTypes/{}".format( + API_VERSION, + self.project, + location.name, + ex_disk_type, + ) + request = "/zones/%s/disks" % (location.name) return request, volume_data, params @@ -4783,17 +9498,46 @@ def _to_disktype(self, disktype): """ extra = {} - zone = self.ex_get_zone(disktype['zone']) + zone = self.ex_get_zone(disktype["zone"]) + + extra["selfLink"] = disktype.get("selfLink") + extra["creationTimestamp"] = disktype.get("creationTimestamp") + extra["description"] = disktype.get("description") + extra["valid_disk_size"] = disktype.get("validDiskSize") + extra["default_disk_size_gb"] = disktype.get("defaultDiskSizeGb") + type_id = "{}:{}".format(zone.name, disktype["name"]) - extra['selfLink'] = disktype.get('selfLink') - extra['creationTimestamp'] = disktype.get('creationTimestamp') - extra['description'] = disktype.get('description') - extra['valid_disk_size'] = disktype.get('validDiskSize') - extra['default_disk_size_gb'] = disktype.get('defaultDiskSizeGb') - type_id = "%s:%s" % (zone.name, disktype['name']) + return GCEDiskType(id=type_id, name=disktype["name"], zone=zone, driver=self, extra=extra) - return GCEDiskType(id=type_id, name=disktype['name'], - zone=zone, driver=self, extra=extra) + def _to_accelerator_type(self, accelerator_type): + """ + Return an AcceleratorType object from the JSON-response dictionary. + + :param accelerator_type: The dictionary describing the + accelerator_type. + :type accelerator_type: ``dict`` + + :return: AcceleratorType object + :rtype: :class:`GCEAcceleratorType` + """ + extra = {} + + zone = self.ex_get_zone(accelerator_type["zone"]) + + extra["selfLink"] = accelerator_type.get("selfLink") + extra["creationTimestamp"] = accelerator_type.get("creationTimestamp") + extra["description"] = accelerator_type.get("description") + extra["maximumCardsPerInstance"] = accelerator_type.get("maximumCardsPerInstance") + extra["default_disk_size_gb"] = accelerator_type.get("defaultDiskSizeGb") + type_id = "{}:{}".format(zone.name, accelerator_type["name"]) + + return GCEAcceleratorType( + id=type_id, + name=accelerator_type["name"], + zone=zone, + driver=self, + extra=extra, + ) def _to_address(self, address): """ @@ -4807,21 +9551,27 @@ def _to_address(self, address): """ extra = {} - if 'region' in address: - region = self.ex_get_region(address['region']) + if "region" in address: + region = self.ex_get_region(address["region"]) else: - region = 'global' - - extra['selfLink'] = address.get('selfLink') - extra['status'] = address.get('status') - extra['description'] = address.get('description', None) - if address.get('users', None) is not None: - extra['users'] = address.get('users') - extra['creationTimestamp'] = address.get('creationTimestamp') - - return GCEAddress(id=address['id'], name=address['name'], - address=address['address'], - region=region, driver=self, extra=extra) + region = "global" + + extra["selfLink"] = address.get("selfLink") + extra["status"] = address.get("status") + extra["description"] = address.get("description", None) + + if address.get("users", None) is not None: + extra["users"] = address.get("users") + extra["creationTimestamp"] = address.get("creationTimestamp") + + return GCEAddress( + id=address["id"], + name=address["name"], + address=address["address"], + region=region, + driver=self, + extra=extra, + ) def _to_backendservice(self, backendservice): """ @@ -4835,23 +9585,29 @@ def _to_backendservice(self, backendservice): """ extra = {} - for extra_key in ('selfLink', 'creationTimestamp', 'fingerprint', - 'description'): + for extra_key in ( + "selfLink", + "creationTimestamp", + "fingerprint", + "description", + ): extra[extra_key] = backendservice.get(extra_key) - backends = backendservice.get('backends', []) - healthchecks = [self._get_object_by_kind(h) for h in - backendservice.get('healthChecks', [])] - - return GCEBackendService(id=backendservice['id'], - name=backendservice['name'], - backends=backends, - healthchecks=healthchecks, - port=backendservice['port'], - port_name=backendservice['portName'], - protocol=backendservice['protocol'], - timeout=backendservice['timeoutSec'], - driver=self, extra=extra) + backends = backendservice.get("backends", []) + healthchecks = [self._get_object_by_kind(h) for h in backendservice.get("healthChecks", [])] + + return GCEBackendService( + id=backendservice["id"], + name=backendservice["name"], + backends=backends, + healthchecks=healthchecks, + port=backendservice["port"], + port_name=backendservice["portName"], + protocol=backendservice["protocol"], + timeout=backendservice["timeoutSec"], + driver=self, + extra=extra, + ) def _to_healthcheck(self, healthcheck): """ @@ -4864,19 +9620,23 @@ def _to_healthcheck(self, healthcheck): :rtype: :class:`GCEHealthCheck` """ extra = {} - extra['selfLink'] = healthcheck.get('selfLink') - extra['creationTimestamp'] = healthcheck.get('creationTimestamp') - extra['description'] = healthcheck.get('description') - extra['host'] = healthcheck.get('host') + extra["selfLink"] = healthcheck.get("selfLink") + extra["creationTimestamp"] = healthcheck.get("creationTimestamp") + extra["description"] = healthcheck.get("description") + extra["host"] = healthcheck.get("host") return GCEHealthCheck( - id=healthcheck['id'], name=healthcheck['name'], - path=healthcheck.get('requestPath'), port=healthcheck.get('port'), - interval=healthcheck.get('checkIntervalSec'), - timeout=healthcheck.get('timeoutSec'), - unhealthy_threshold=healthcheck.get('unhealthyThreshold'), - healthy_threshold=healthcheck.get('healthyThreshold'), - driver=self, extra=extra) + id=healthcheck["id"], + name=healthcheck["name"], + path=healthcheck.get("requestPath"), + port=healthcheck.get("port"), + interval=healthcheck.get("checkIntervalSec"), + timeout=healthcheck.get("timeoutSec"), + unhealthy_threshold=healthcheck.get("unhealthyThreshold"), + healthy_threshold=healthcheck.get("healthyThreshold"), + driver=self, + extra=extra, + ) def _to_firewall(self, firewall): """ @@ -4889,23 +9649,41 @@ def _to_firewall(self, firewall): :rtype: :class:`GCEFirewall` """ extra = {} - extra['selfLink'] = firewall.get('selfLink') - extra['creationTimestamp'] = firewall.get('creationTimestamp') - extra['description'] = firewall.get('description') - extra['network_name'] = self._get_components_from_path( - firewall['network'])['name'] - - network = self.ex_get_network(extra['network_name']) - source_ranges = firewall.get('sourceRanges') - source_tags = firewall.get('sourceTags') - target_tags = firewall.get('targetTags') - - return GCEFirewall(id=firewall['id'], name=firewall['name'], - allowed=firewall.get('allowed'), network=network, - source_ranges=source_ranges, - source_tags=source_tags, - target_tags=target_tags, - driver=self, extra=extra) + extra["selfLink"] = firewall.get("selfLink") + extra["creationTimestamp"] = firewall.get("creationTimestamp") + extra["description"] = firewall.get("description") + extra["network_name"] = self._get_components_from_path(firewall["network"])["name"] + + network = self.ex_get_network(extra["network_name"]) + + allowed = firewall.get("allowed") + denied = firewall.get("denied") + priority = firewall.get("priority") + direction = firewall.get("direction") + source_ranges = firewall.get("sourceRanges") + source_tags = firewall.get("sourceTags") + source_service_accounts = firewall.get("sourceServiceAccounts") + target_tags = firewall.get("targetTags") + target_service_accounts = firewall.get("targetServiceAccounts") + target_ranges = firewall.get("targetRanges") + + return GCEFirewall( + id=firewall["id"], + name=firewall["name"], + allowed=allowed, + denied=denied, + network=network, + target_ranges=target_ranges, + source_ranges=source_ranges, + priority=priority, + source_tags=source_tags, + target_tags=target_tags, + source_service_accounts=source_service_accounts, + target_service_accounts=target_service_accounts, + direction=direction, + driver=self, + extra=extra, + ) def _to_forwarding_rule(self, forwarding_rule): """ @@ -4918,21 +9696,85 @@ def _to_forwarding_rule(self, forwarding_rule): :rtype: :class:`GCEForwardingRule` """ extra = {} - extra['selfLink'] = forwarding_rule.get('selfLink') - extra['portRange'] = forwarding_rule.get('portRange') - extra['creationTimestamp'] = forwarding_rule.get('creationTimestamp') - extra['description'] = forwarding_rule.get('description') + extra["selfLink"] = forwarding_rule.get("selfLink") + extra["portRange"] = forwarding_rule.get("portRange") + extra["creationTimestamp"] = forwarding_rule.get("creationTimestamp") + extra["description"] = forwarding_rule.get("description") + + region = forwarding_rule.get("region") - region = forwarding_rule.get('region') if region: region = self.ex_get_region(region) - target = self._get_object_by_kind(forwarding_rule['target']) + target = self._get_object_by_kind(forwarding_rule["target"]) + + return GCEForwardingRule( + id=forwarding_rule["id"], + name=forwarding_rule["name"], + region=region, + address=forwarding_rule.get("IPAddress"), + protocol=forwarding_rule.get("IPProtocol"), + targetpool=target, + driver=self, + extra=extra, + ) - return GCEForwardingRule(id=forwarding_rule['id'], - name=forwarding_rule['name'], region=region, - address=forwarding_rule.get('IPAddress'), - protocol=forwarding_rule.get('IPProtocol'), - targetpool=target, driver=self, extra=extra) + def _to_sslcertificate(self, sslcertificate): + """ + Return the SslCertificate object from the JSON-response. + + :param sslcertificate: Dictionary describing SslCertificate + :type sslcertificate: ``dict`` + + :return: Return SslCertificate object. + :rtype: :class:`GCESslCertificate` + """ + extra = {} + + if "description" in sslcertificate: + extra["description"] = sslcertificate["description"] + extra["selfLink"] = sslcertificate["selfLink"] + + return GCESslCertificate( + id=sslcertificate["id"], + name=sslcertificate["name"], + certificate=sslcertificate["certificate"], + driver=self, + extra=extra, + ) + + def _to_subnetwork(self, subnetwork): + """ + Return a Subnetwork object from the JSON-response dictionary. + + :param subnetwork: The dictionary describing the subnetwork. + :type subnetwork: ``dict`` + + :return: Subnetwork object + :rtype: :class:`GCESubnetwork` + """ + extra = {} + + extra["creationTimestamp"] = subnetwork.get("creationTimestamp") + extra["description"] = subnetwork.get("description") + extra["gatewayAddress"] = subnetwork.get("gatewayAddress") + extra["ipCidrRange"] = subnetwork.get("ipCidrRange") + extra["network"] = subnetwork.get("network") + extra["region"] = subnetwork.get("region") + extra["selfLink"] = subnetwork.get("selfLink") + extra["privateIpGoogleAccess"] = subnetwork.get("privateIpGoogleAccess") + extra["secondaryIpRanges"] = subnetwork.get("secondaryIpRanges") + network = self._get_object_by_kind(subnetwork.get("network")) + region = self._get_object_by_kind(subnetwork.get("region")) + + return GCESubnetwork( + id=subnetwork["id"], + name=subnetwork["name"], + cidr=subnetwork.get("ipCidrRange"), + network=network, + region=region, + driver=self, + extra=extra, + ) def _to_network(self, network): """ @@ -4946,14 +9788,34 @@ def _to_network(self, network): """ extra = {} - extra['selfLink'] = network.get('selfLink') - extra['gatewayIPv4'] = network.get('gatewayIPv4') - extra['description'] = network.get('description') - extra['creationTimestamp'] = network.get('creationTimestamp') - - return GCENetwork(id=network['id'], name=network['name'], - cidr=network.get('IPv4Range'), - driver=self, extra=extra) + extra["selfLink"] = network.get("selfLink") + extra["description"] = network.get("description") + extra["creationTimestamp"] = network.get("creationTimestamp") + # 'legacy' + extra["gatewayIPv4"] = network.get("gatewayIPv4") + extra["IPv4Range"] = network.get("IPv4Range") + # 'auto' or 'custom' + extra["autoCreateSubnetworks"] = network.get("autoCreateSubnetworks") + extra["subnetworks"] = network.get("subnetworks") + extra["routingConfig"] = network.get("routingConfig") + + # match Cloud SDK 'gcloud' + + if "autoCreateSubnetworks" in network: + if network["autoCreateSubnetworks"]: + extra["mode"] = "auto" + else: + extra["mode"] = "custom" + else: + extra["mode"] = "legacy" + + return GCENetwork( + id=network["id"], + name=network["name"], + cidr=network.get("IPv4Range"), + driver=self, + extra=extra, + ) def _to_route(self, route): """ @@ -4967,27 +9829,37 @@ def _to_route(self, route): """ extra = {} - extra['selfLink'] = route.get('selfLink') - extra['description'] = route.get('description') - extra['creationTimestamp'] = route.get('creationTimestamp') - network = route.get('network') - priority = route.get('priority') - - if 'nextHopInstance' in route: - extra['nextHopInstance'] = route['nextHopInstance'] - if 'nextHopIp' in route: - extra['nextHopIp'] = route['nextHopIp'] - if 'nextHopNetwork' in route: - extra['nextHopNetwork'] = route['nextHopNetwork'] - if 'nextHopGateway' in route: - extra['nextHopGateway'] = route['nextHopGateway'] - if 'warnings' in route: - extra['warnings'] = route['warnings'] - - return GCERoute(id=route['id'], name=route['name'], - dest_range=route.get('destRange'), priority=priority, - network=network, tags=route.get('tags'), - driver=self, extra=extra) + extra["selfLink"] = route.get("selfLink") + extra["description"] = route.get("description") + extra["creationTimestamp"] = route.get("creationTimestamp") + network = route.get("network") + priority = route.get("priority") + + if "nextHopInstance" in route: + extra["nextHopInstance"] = route["nextHopInstance"] + + if "nextHopIp" in route: + extra["nextHopIp"] = route["nextHopIp"] + + if "nextHopNetwork" in route: + extra["nextHopNetwork"] = route["nextHopNetwork"] + + if "nextHopGateway" in route: + extra["nextHopGateway"] = route["nextHopGateway"] + + if "warnings" in route: + extra["warnings"] = route["warnings"] + + return GCERoute( + id=route["id"], + name=route["name"], + dest_range=route.get("destRange"), + priority=priority, + network=network, + tags=route.get("tags"), + driver=self, + extra=extra, + ) def _to_node_image(self, image): """ @@ -5000,28 +9872,38 @@ def _to_node_image(self, image): :rtype: :class:`GCENodeImage` """ extra = {} - if 'preferredKernel' in image: - extra['preferredKernel'] = image.get('preferredKernel', None) - extra['description'] = image.get('description', None) - extra['creationTimestamp'] = image.get('creationTimestamp') - extra['selfLink'] = image.get('selfLink') - if 'deprecated' in image: - extra['deprecated'] = image.get('deprecated', None) - extra['sourceType'] = image.get('sourceType', None) - extra['rawDisk'] = image.get('rawDisk', None) - extra['status'] = image.get('status', None) - extra['archiveSizeBytes'] = image.get('archiveSizeBytes', None) - extra['diskSizeGb'] = image.get('diskSizeGb', None) - if 'sourceDisk' in image: - extra['sourceDisk'] = image.get('sourceDisk', None) - if 'sourceDiskId' in image: - extra['sourceDiskId'] = image.get('sourceDiskId', None) - if 'licenses' in image: - lic_objs = self._licenses_from_urls(licenses=image['licenses']) - extra['licenses'] = lic_objs - - return GCENodeImage(id=image['id'], name=image['name'], driver=self, - extra=extra) + + if "preferredKernel" in image: + extra["preferredKernel"] = image.get("preferredKernel", None) + extra["description"] = image.get("description", None) + extra["family"] = image.get("family", None) + extra["creationTimestamp"] = image.get("creationTimestamp") + extra["selfLink"] = image.get("selfLink") + + if "deprecated" in image: + extra["deprecated"] = image.get("deprecated", None) + extra["sourceType"] = image.get("sourceType", None) + extra["rawDisk"] = image.get("rawDisk", None) + extra["status"] = image.get("status", None) + extra["archiveSizeBytes"] = image.get("archiveSizeBytes", None) + extra["diskSizeGb"] = image.get("diskSizeGb", None) + + if "guestOsFeatures" in image: + extra["guestOsFeatures"] = image.get("guestOsFeatures", []) + + if "sourceDisk" in image: + extra["sourceDisk"] = image.get("sourceDisk", None) + + if "sourceDiskId" in image: + extra["sourceDiskId"] = image.get("sourceDiskId", None) + + if "licenses" in image: + lic_objs = self._licenses_from_urls(licenses=image["licenses"]) + extra["licenses"] = lic_objs + extra["labels"] = image.get("labels", None) + extra["labelFingerprint"] = image.get("labelFingerprint", None) + + return GCENodeImage(id=image["id"], name=image["name"], driver=self, extra=extra) def _to_node_location(self, location): """ @@ -5033,75 +9915,109 @@ def _to_node_location(self, location): :return: Location object :rtype: :class:`NodeLocation` """ - return NodeLocation(id=location['id'], name=location['name'], - country=location['name'].split('-')[0], - driver=self) - def _to_node(self, node): + return NodeLocation( + id=location["id"], + name=location["name"], + country=location["name"].split("-")[0], + driver=self, + ) + + def _to_node(self, node, use_disk_cache=False): """ Return a Node object from the JSON-response dictionary. - :param node: The dictionary describing the node. - :type node: ``dict`` + :param node: The dictionary describing the node. + :type node: ``dict`` - :return: Node object - :rtype: :class:`Node` + :keyword use_disk_cache: If true, ex_get_volume call will use cache. + :type use_disk_cache: ``bool`` + + :return: Node object + :rtype: :class:`Node` """ public_ips = [] private_ips = [] extra = {} - extra['status'] = node.get('status', "UNKNOWN") - extra['statusMessage'] = node.get('statusMessage') - extra['description'] = node.get('description') - extra['zone'] = self.ex_get_zone(node['zone']) - extra['image'] = node.get('image') - extra['machineType'] = node.get('machineType') - extra['disks'] = node.get('disks', []) - extra['networkInterfaces'] = node.get('networkInterfaces') - extra['id'] = node['id'] - extra['selfLink'] = node.get('selfLink') - extra['kind'] = node.get('kind') - extra['creationTimestamp'] = node.get('creationTimestamp') - extra['name'] = node['name'] - extra['metadata'] = node.get('metadata', {}) - extra['tags_fingerprint'] = node['tags']['fingerprint'] - extra['scheduling'] = node.get('scheduling', {}) - extra['deprecated'] = True if node.get('deprecated', None) else False - extra['canIpForward'] = node.get('canIpForward') - extra['serviceAccounts'] = node.get('serviceAccounts', []) - extra['scheduling'] = node.get('scheduling', {}) - - for disk in extra['disks']: - if disk.get('boot') and disk.get('type') == 'PERSISTENT': - bd = self._get_components_from_path(disk['source']) - extra['boot_disk'] = self.ex_get_volume(bd['name'], bd['zone']) - - if 'items' in node['tags']: - tags = node['tags']['items'] + extra["status"] = node.get("status", "UNKNOWN") + extra["statusMessage"] = node.get("statusMessage") + extra["description"] = node.get("description") + extra["zone"] = self.ex_get_zone(node["zone"]) + extra["image"] = node.get("image") + extra["machineType"] = node.get("machineType") + extra["cpuPlatform"] = node.get("cpuPlatform") + extra["minCpuPlatform"] = node.get("minCpuPlatform") + extra["disks"] = node.get("disks", []) + extra["networkInterfaces"] = node.get("networkInterfaces") + extra["id"] = node["id"] + extra["selfLink"] = node.get("selfLink") + extra["kind"] = node.get("kind") + extra["creationTimestamp"] = node.get("creationTimestamp") + extra["name"] = node["name"] + extra["metadata"] = node.get("metadata", {}) + extra["tags_fingerprint"] = node["tags"]["fingerprint"] + extra["scheduling"] = node.get("scheduling", {}) + extra["deprecated"] = True if node.get("deprecated", None) else False + extra["canIpForward"] = node.get("canIpForward") + extra["serviceAccounts"] = node.get("serviceAccounts", []) + extra["scheduling"] = node.get("scheduling", {}) + extra["boot_disk"] = None + extra["labels"] = node.get("labels") + extra["labelFingerprint"] = node.get("labelFingerprint") + + for disk in extra["disks"]: + if disk.get("boot") and disk.get("type") == "PERSISTENT": + bd = self._get_components_from_path(disk["source"]) + extra["boot_disk"] = self.ex_get_volume( + bd["name"], bd["zone"], use_cache=use_disk_cache + ) + + if "items" in node["tags"]: + tags = node["tags"]["items"] else: tags = [] - extra['tags'] = tags + extra["tags"] = tags - for network_interface in node.get('networkInterfaces', []): - private_ips.append(network_interface.get('networkIP')) - for access_config in network_interface.get('accessConfigs', []): - public_ips.append(access_config.get('natIP')) + for network_interface in node.get("networkInterfaces", []): + private_ips.append(network_interface.get("networkIP")) + + for access_config in network_interface.get("accessConfigs", []): + public_ips.append(access_config.get("natIP")) # For the node attributes, use just machine and image names, not full # paths. Full paths are available in the "extra" dict. - if extra['image']: - image = self._get_components_from_path(extra['image'])['name'] - else: - image = None - size = self._get_components_from_path(node['machineType'])['name'] + image = None - return Node(id=node['id'], name=node['name'], - state=self.NODE_STATE_MAP[node['status']], - public_ips=public_ips, private_ips=private_ips, - driver=self, size=size, image=image, extra=extra) + if extra["image"]: + image = self._get_components_from_path(extra["image"])["name"] + else: + if ( + extra["boot_disk"] + and hasattr(extra["boot_disk"], "extra") + and "sourceImage" in extra["boot_disk"].extra + and extra["boot_disk"].extra["sourceImage"] is not None + ): + src_image = extra["boot_disk"].extra["sourceImage"] + image = self._get_components_from_path(src_image)["name"] + extra["image"] = image + size = self._get_components_from_path(node["machineType"])["name"] + + state = self.NODE_STATE_MAP.get(node["status"], NodeState.UNKNOWN) + + return Node( + id=node["id"], + name=node["name"], + state=state, + public_ips=public_ips, + private_ips=private_ips, + driver=self, + size=size, + image=image, + extra=extra, + ) - def _to_node_size(self, machine_type): + def _to_node_size(self, machine_type, instance_prices): """ Return a Size object from the JSON-response dictionary. @@ -5112,20 +10028,36 @@ def _to_node_size(self, machine_type): :rtype: :class:`GCENodeSize` """ extra = {} - extra['selfLink'] = machine_type.get('selfLink') - extra['zone'] = self.ex_get_zone(machine_type['zone']) - extra['description'] = machine_type.get('description') - extra['guestCpus'] = machine_type.get('guestCpus') - extra['creationTimestamp'] = machine_type.get('creationTimestamp') + extra["selfLink"] = machine_type.get("selfLink") + extra["zone"] = self.ex_get_zone(machine_type["zone"]) + extra["description"] = machine_type.get("description") + extra["guestCpus"] = machine_type.get("guestCpus") + extra["creationTimestamp"] = machine_type.get("creationTimestamp") + extra["accelerators"] = machine_type.get("accelerators", []) try: - price = self._get_size_price(size_id=machine_type['name']) + size_name = machine_type["name"][:2] + location = extra["zone"].name + location = "-".join(location.split("-")[:2]) + machine_ram = float(machine_type.get("memoryMb", 0)) / 1024 + machine_cpus = float(extra["guestCpus"]) + cpu_price = instance_prices[size_name]["cpu"]["on_demand"][location]["price"] + ram_price = instance_prices[size_name]["ram"]["on_demand"][location]["price"] + price = machine_cpus * cpu_price + machine_ram * ram_price except KeyError: price = None + except AttributeError: # no zone + price = None - return GCENodeSize(id=machine_type['id'], name=machine_type['name'], - ram=machine_type.get('memoryMb'), - disk=machine_type.get('imageSpaceGb'), - bandwidth=0, price=price, driver=self, extra=extra) + return GCENodeSize( + id=machine_type["id"], + name=machine_type["name"], + ram=machine_type.get("memoryMb"), + disk=machine_type.get("imageSpaceGb"), + bandwidth=0, + price=price, + driver=self, + extra=extra, + ) def _to_project(self, project): """ @@ -5138,19 +10070,26 @@ def _to_project(self, project): :rtype: :class:`GCEProject` """ extra = {} - extra['selfLink'] = project.get('selfLink') - extra['creationTimestamp'] = project.get('creationTimestamp') - extra['description'] = project.get('description') - metadata = project['commonInstanceMetadata'].get('items') - if 'commonInstanceMetadata' in project: - # add this struct to get 'fingerprint' too - extra['commonInstanceMetadata'] = project['commonInstanceMetadata'] - if 'usageExportLocation' in project: - extra['usageExportLocation'] = project['usageExportLocation'] + extra["selfLink"] = project.get("selfLink") + extra["creationTimestamp"] = project.get("creationTimestamp") + extra["description"] = project.get("description") + metadata = project["commonInstanceMetadata"].get("items") - return GCEProject(id=project['id'], name=project['name'], - metadata=metadata, quotas=project.get('quotas'), - driver=self, extra=extra) + if "commonInstanceMetadata" in project: + # add this struct to get 'fingerprint' too + extra["commonInstanceMetadata"] = project["commonInstanceMetadata"] + + if "usageExportLocation" in project: + extra["usageExportLocation"] = project["usageExportLocation"] + + return GCEProject( + id=project["id"], + name=project["name"], + metadata=metadata, + quotas=project.get("quotas"), + driver=self, + extra=extra, + ) def _to_region(self, region): """ @@ -5163,21 +10102,27 @@ def _to_region(self, region): :rtype: :class:`GCERegion` """ extra = {} - extra['selfLink'] = region.get('selfLink') - extra['creationTimestamp'] = region.get('creationTimestamp') - extra['description'] = region.get('description') + extra["selfLink"] = region.get("selfLink") + extra["creationTimestamp"] = region.get("creationTimestamp") + extra["description"] = region.get("description") - quotas = region.get('quotas') - zones = [self.ex_get_zone(z) for z in region.get('zones', [])] + quotas = region.get("quotas") + zones = [self.ex_get_zone(z) for z in region.get("zones", [])] # Work around a bug that will occasionally list missing zones in the # region output zones = [z for z in zones if z is not None] - deprecated = region.get('deprecated') - - return GCERegion(id=region['id'], name=region['name'], - status=region.get('status'), zones=zones, - quotas=quotas, deprecated=deprecated, - driver=self, extra=extra) + deprecated = region.get("deprecated") + + return GCERegion( + id=region["id"], + name=region["name"], + status=region.get("status"), + zones=zones, + quotas=quotas, + deprecated=deprecated, + driver=self, + extra=extra, + ) def _to_snapshot(self, snapshot): """ @@ -5190,30 +10135,40 @@ def _to_snapshot(self, snapshot): :rtype: :class:`VolumeSnapshot` """ extra = {} - extra['selfLink'] = snapshot.get('selfLink') - extra['creationTimestamp'] = snapshot.get('creationTimestamp') - extra['sourceDisk'] = snapshot.get('sourceDisk') - if 'description' in snapshot: - extra['description'] = snapshot['description'] - if 'sourceDiskId' in snapshot: - extra['sourceDiskId'] = snapshot['sourceDiskId'] - if 'storageBytes' in snapshot: - extra['storageBytes'] = snapshot['storageBytes'] - if 'storageBytesStatus' in snapshot: - extra['storageBytesStatus'] = snapshot['storageBytesStatus'] - if 'licenses' in snapshot: - lic_objs = self._licenses_from_urls(licenses=snapshot['licenses']) - extra['licenses'] = lic_objs + extra["selfLink"] = snapshot.get("selfLink") + extra["creationTimestamp"] = snapshot.get("creationTimestamp") + extra["sourceDisk"] = snapshot.get("sourceDisk") + + if "description" in snapshot: + extra["description"] = snapshot["description"] + + if "sourceDiskId" in snapshot: + extra["sourceDiskId"] = snapshot["sourceDiskId"] + + if "storageBytes" in snapshot: + extra["storageBytes"] = snapshot["storageBytes"] + + if "storageBytesStatus" in snapshot: + extra["storageBytesStatus"] = snapshot["storageBytesStatus"] + + if "licenses" in snapshot: + lic_objs = self._licenses_from_urls(licenses=snapshot["licenses"]) + extra["licenses"] = lic_objs try: - created = parse_date(snapshot.get('creationTimestamp')) + created = parse_date(snapshot.get("creationTimestamp")) except ValueError: created = None - return GCESnapshot(id=snapshot['id'], name=snapshot['name'], - size=snapshot['diskSizeGb'], - status=snapshot.get('status'), driver=self, - extra=extra, created=created) + return GCESnapshot( + id=snapshot["id"], + name=snapshot["name"], + size=snapshot["diskSizeGb"], + status=snapshot.get("status"), + driver=self, + extra=extra, + created=created, + ) def _to_storage_volume(self, volume): """ @@ -5226,15 +10181,33 @@ def _to_storage_volume(self, volume): :rtype: :class:`StorageVolume` """ extra = {} - extra['selfLink'] = volume.get('selfLink') - extra['zone'] = self.ex_get_zone(volume['zone']) - extra['status'] = volume.get('status') - extra['creationTimestamp'] = volume.get('creationTimestamp') - extra['description'] = volume.get('description') - extra['type'] = volume.get('type', 'pd-standard').split('/')[-1] - - return StorageVolume(id=volume['id'], name=volume['name'], - size=volume['sizeGb'], driver=self, extra=extra) + extra["selfLink"] = volume.get("selfLink") + extra["zone"] = self.ex_get_zone(volume["zone"]) + extra["status"] = volume.get("status") + extra["creationTimestamp"] = volume.get("creationTimestamp") + extra["description"] = volume.get("description") + extra["sourceImage"] = volume.get("sourceImage") + extra["sourceImageId"] = volume.get("sourceImageId") + extra["sourceSnapshot"] = volume.get("sourceSnapshot") + extra["sourceSnapshotId"] = volume.get("sourceSnapshotId") + extra["options"] = volume.get("options") + extra["labels"] = volume.get("labels", {}) + extra["labelFingerprint"] = volume.get("labelFingerprint") + extra["users"] = volume.get("users", []) + + if "licenses" in volume: + lic_objs = self._licenses_from_urls(licenses=volume["licenses"]) + extra["licenses"] = lic_objs + + extra["type"] = volume.get("type", "pd-standard").split("/")[-1] + + return StorageVolume( + id=volume["id"], + name=volume["name"], + size=volume["sizeGb"], + driver=self, + extra=extra, + ) def _to_targethttpproxy(self, targethttpproxy): """ @@ -5246,14 +10219,50 @@ def _to_targethttpproxy(self, targethttpproxy): :return: Target HTTP Proxy object :rtype: :class:`GCETargetHttpProxy` """ - extra = dict([(k, targethttpproxy.get(k)) for k in ( - 'creationTimestamp', 'description', 'selfLink')]) + extra = { + k: targethttpproxy.get(k) for k in ("creationTimestamp", "description", "selfLink") + } + + urlmap = self._get_object_by_kind(targethttpproxy.get("urlMap")) + + return GCETargetHttpProxy( + id=targethttpproxy["id"], + name=targethttpproxy["name"], + urlmap=urlmap, + driver=self, + extra=extra, + ) + + def _to_targethttpsproxy(self, targethttpsproxy): + """ + Return the TargetHttpsProxy object from the JSON-response. + + :param targethttpsproxy: Dictionary describing TargetHttpsProxy + :type targethttpsproxy: ``dict`` - urlmap = self._get_object_by_kind(targethttpproxy.get('urlMap')) + :return: Return TargetHttpsProxy object. + :rtype: :class:`GCETargetHttpsProxy` + """ + extra = {} - return GCETargetHttpProxy(id=targethttpproxy['id'], - name=targethttpproxy['name'], - urlmap=urlmap, driver=self, extra=extra) + if "description" in targethttpsproxy: + extra["description"] = targethttpsproxy["description"] + extra["selfLink"] = targethttpsproxy["selfLink"] + + sslcertificates = [ + self._get_object_by_kind(x) for x in targethttpsproxy.get("sslCertificates", []) + ] + obj_name = self._get_components_from_path(targethttpsproxy["urlMap"])["name"] + urlmap = self.ex_get_urlmap(obj_name) + + return GCETargetHttpsProxy( + id=targethttpsproxy["id"], + name=targethttpsproxy["name"], + sslcertificates=sslcertificates, + urlmap=urlmap, + driver=self, + extra=extra, + ) def _to_targetinstance(self, targetinstance): """ @@ -5267,20 +10276,26 @@ def _to_targetinstance(self, targetinstance): """ node = None extra = {} - extra['selfLink'] = targetinstance.get('selfLink') - extra['description'] = targetinstance.get('description') - extra['natPolicy'] = targetinstance.get('natPolicy') - zone = self.ex_get_zone(targetinstance['zone']) - if 'instance' in targetinstance: - node_name = targetinstance['instance'].split('/')[-1] + extra["selfLink"] = targetinstance.get("selfLink") + extra["description"] = targetinstance.get("description") + extra["natPolicy"] = targetinstance.get("natPolicy") + zone = self.ex_get_zone(targetinstance["zone"]) + + if "instance" in targetinstance: + node_name = targetinstance["instance"].split("/")[-1] try: node = self.ex_get_node(node_name, zone) except ResourceNotFoundError: - node = targetinstance['instance'] - - return GCETargetInstance(id=targetinstance['id'], - name=targetinstance['name'], zone=zone, - node=node, driver=self, extra=extra) + node = targetinstance["instance"] + + return GCETargetInstance( + id=targetinstance["id"], + name=targetinstance["name"], + zone=zone, + node=node, + driver=self, + extra=extra, + ) def _to_targetpool(self, targetpool): """ @@ -5293,34 +10308,195 @@ def _to_targetpool(self, targetpool): :rtype: :class:`GCETargetPool` """ extra = {} - extra['selfLink'] = targetpool.get('selfLink') - extra['description'] = targetpool.get('description') - extra['sessionAffinity'] = targetpool.get('sessionAffinity') - region = self.ex_get_region(targetpool['region']) - healthcheck_list = [self.ex_get_healthcheck(h.split('/')[-1]) for h - in targetpool.get('healthChecks', [])] + extra["selfLink"] = targetpool.get("selfLink") + extra["description"] = targetpool.get("description") + extra["sessionAffinity"] = targetpool.get("sessionAffinity") + region = self.ex_get_region(targetpool["region"]) + healthcheck_list = [ + self.ex_get_healthcheck(h.split("/")[-1]) for h in targetpool.get("healthChecks", []) + ] node_list = [] - for n in targetpool.get('instances', []): + + for n in targetpool.get("instances", []): # Nodes that do not exist can be part of a target pool. If the # node does not exist, use the URL of the node instead of the node # object. comp = self._get_components_from_path(n) try: - node = self.ex_get_node(comp['name'], comp['zone']) + node = self.ex_get_node(comp["name"], comp["zone"]) except ResourceNotFoundError: node = n node_list.append(node) - if 'failoverRatio' in targetpool: - extra['failoverRatio'] = targetpool['failoverRatio'] - if 'backupPool' in targetpool: - tp_split = targetpool['backupPool'].split('/') - extra['backupPool'] = self.ex_get_targetpool(tp_split[10], - tp_split[8]) + if "failoverRatio" in targetpool: + extra["failoverRatio"] = targetpool["failoverRatio"] + + if "backupPool" in targetpool: + tp_split = targetpool["backupPool"].split("/") + extra["backupPool"] = self.ex_get_targetpool(tp_split[10], tp_split[8]) + + return GCETargetPool( + id=targetpool["id"], + name=targetpool["name"], + region=region, + healthchecks=healthcheck_list, + nodes=node_list, + driver=self, + extra=extra, + ) + + def _to_instancegroup(self, instancegroup): + """ + Return the InstanceGroup object from the JSON-response. + + :param instancegroup: Dictionary describing InstanceGroup + :type instancegroup: ``dict`` + + :return: InstanceGroup object. + :rtype: :class:`GCEInstanceGroup` + """ + extra = {} + extra["description"] = instancegroup.get("description", None) + extra["selfLink"] = instancegroup["selfLink"] + extra["namedPorts"] = instancegroup.get("namedPorts", []) + extra["fingerprint"] = instancegroup.get("fingerprint", None) + + zone = instancegroup.get("zone", None) + + if zone: + # Apparently zone attribute is not always present, see + # https://github.com/apache/libcloud/issues/1346 for details + zone = self.ex_get_zone(zone) + + # Note: network/subnetwork will not be available if the Instance Group + # does not contain instances. + network = instancegroup.get("network", None) + + if network: + network = self.ex_get_network(network) + + subnetwork = instancegroup.get("subnetwork", None) + + if subnetwork: + subnetwork = self.ex_get_subnetwork(subnetwork) + + return GCEInstanceGroup( + id=instancegroup["id"], + name=instancegroup["name"], + zone=zone, + network=network, + subnetwork=subnetwork, + named_ports=instancegroup.get("namedPorts", []), + driver=self, + extra=extra, + ) + + def _to_instancegroupmanager(self, manager): + """ + Return a Instance Group Manager object from the JSON-response. + + :param instancegroupmanager: dictionary describing the Instance + Group Manager. + :type instancegroupmanager: ``dict`` + + :return: Instance Group Manager object. + :rtype: :class:`GCEInstanceGroupManager` + """ + zone = self.ex_get_zone(manager["zone"]) + + extra = {} + extra["selfLink"] = manager.get("selfLink") + extra["description"] = manager.get("description") + extra["currentActions"] = manager.get("currentActions") + extra["baseInstanceName"] = manager.get("baseInstanceName") + extra["namedPorts"] = manager.get("namedPorts", []) + extra["autoHealingPolicies"] = manager.get("autoHealingPolicies", []) + template_name = self._get_components_from_path(manager["instanceTemplate"])["name"] + template = self.ex_get_instancetemplate(template_name) + ig_name = self._get_components_from_path(manager["instanceGroup"])["name"] + instance_group = self.ex_get_instancegroup(ig_name, zone) + + return GCEInstanceGroupManager( + id=manager["id"], + name=manager["name"], + zone=zone, + size=manager["targetSize"], + instance_group=instance_group, + template=template, + driver=self, + extra=extra, + ) + + def _to_instancetemplate(self, instancetemplate): + """ + Return a Instance Template object from the JSON-response. + + :param instancetemplate: dictionary describing the Instance + Template. + :type instancetemplate: ``dict`` + + :return: Instance Template object. + :rtype: :class:`GCEInstanceTemplate` + """ + extra = {} + extra["selfLink"] = instancetemplate.get("selfLink") + extra["description"] = instancetemplate.get("description") + extra["properties"] = instancetemplate.get("properties") + + return GCEInstanceTemplate( + id=instancetemplate["id"], + name=instancetemplate["name"], + driver=self, + extra=extra, + ) + + def _to_autoscaler(self, autoscaler): + """ + Return an Autoscaler object from the JSON-response. + + :param autoscaler: dictionary describing the Autoscaler. + :type autoscaler: ``dict`` + + :return: Autoscaler object. + :rtype: :class:`GCEAutoscaler` + """ + extra = {} + extra["selfLink"] = autoscaler.get("selfLink") + extra["description"] = autoscaler.get("description") + zone = self.ex_get_zone(autoscaler.get("zone")) + ig_name = self._get_components_from_path(autoscaler.get("target"))["name"] + target = self.ex_get_instancegroupmanager(ig_name, zone) + + return GCEAutoscaler( + id=autoscaler["id"], + name=autoscaler["name"], + zone=zone, + target=target, + policy=autoscaler["autoscalingPolicy"], + driver=self, + extra=extra, + ) + + def _format_guest_accelerators(self, accelerator_type, accelerator_count): + """ + Formats a GCE-friendly guestAccelerators request. Accepts an + accelerator_type and accelerator_count that is wrapped up into a list + of dictionaries for GCE to consume for a node creation request. + + :param accelerator_type: Accelerator type to request. + :type accelerator_type: :class:`GCEAcceleratorType` + + :param accelerator_count: Number of accelerators to request. + :type accelerator_count: ``int`` + + :return: GCE-friendly guestAccelerators list of dictionaries. + :rtype: ``list`` + """ + accelerator_type = self._get_selflink_or_name( + obj=accelerator_type, get_selflinks=True, objname="accelerator_type" + ) - return GCETargetPool(id=targetpool['id'], name=targetpool['name'], - region=region, healthchecks=healthcheck_list, - nodes=node_list, driver=self, extra=extra) + return [{"acceleratorType": accelerator_type, "acceleratorCount": accelerator_count}] def _format_metadata(self, fingerprint, metadata=None): """ @@ -5352,58 +10528,69 @@ def _format_metadata(self, fingerprint, metadata=None): :return: GCE-friendly metadata dict :rtype: ``dict`` """ + if not metadata: - return {'fingerprint': fingerprint, 'items': []} - md = {'fingerprint': fingerprint} + return {"fingerprint": fingerprint, "items": []} + md = {"fingerprint": fingerprint} # Check `list` format. Can support / convert the following: # (a) [{'key': 'k1', 'value': 'v1'}, ...] # (b) [{'k1': 'v1'}, ...] + if isinstance(metadata, list): item_list = [] + for i in metadata: if isinstance(i, dict): # check (a) - if 'key' in i and 'value' in i and len(i) == 2: + + if "key" in i and "value" in i and len(i) == 2: item_list.append(i) # check (b) elif len(i) == 1: - item_list.append({'key': list(i.keys())[0], - 'value': list(i.values())[0]}) + item_list.append({"key": list(i.keys())[0], "value": list(i.values())[0]}) else: raise ValueError("Unsupported metadata format.") else: raise ValueError("Unsupported metadata format.") - md['items'] = item_list + md["items"] = item_list # Check `dict` format. Can support / convert the following: # (c) {'key': 'k1', 'value': 'v1'} # (d) {'k1': 'v1', 'k2': 'v2', ...} # (e) {'items': [...]} + if isinstance(metadata, dict): # Check (c) - if 'key' in metadata and 'value' in metadata and \ - len(metadata) == 2: - md['items'] = [metadata] + + if "key" in metadata and "value" in metadata and len(metadata) == 2: + md["items"] = [metadata] # check (d) elif len(metadata) == 1: - if 'items' in metadata: + if "items" in metadata: # check (e) - if isinstance(metadata['items'], list): - md['items'] = metadata['items'] + + if isinstance(metadata["items"], list): + md["items"] = metadata["items"] else: raise ValueError("Unsupported metadata format.") else: - md['items'] = [{'key': list(metadata.keys())[0], - 'value': list(metadata.values())[0]}] + md["items"] = [ + { + "key": list(metadata.keys())[0], + "value": list(metadata.values())[0], + } + ] else: # check (d) - md['items'] = [] + md["items"] = [] + for k, v in metadata.items(): - md['items'].append({'key': k, 'value': v}) + md["items"].append({"key": k, "value": v}) - if 'items' not in md: + if "items" not in md: raise ValueError("Unsupported metadata format.") + return md def _to_urlmap(self, urlmap): @@ -5413,23 +10600,30 @@ def _to_urlmap(self, urlmap): :param zone: The dictionary describing the url-map. :type zone: ``dict`` - :return: Zone object + :return: UrlMap object :rtype: :class:`GCEUrlMap` """ - extra = dict([(k, urlmap.get(k)) for k in ( - 'creationTimestamp', 'description', 'fingerprint', 'selfLink')]) - - default_service = self._get_object_by_kind( - urlmap.get('defaultService')) - - host_rules = urlmap.get('hostRules', []) - path_matchers = urlmap.get('pathMatchers', []) - tests = urlmap.get('tests', []) + extra = { + k: urlmap.get(k) + for k in ("creationTimestamp", "description", "fingerprint", "selfLink") + } - return GCEUrlMap(id=urlmap['id'], name=urlmap['name'], - default_service=default_service, - host_rules=host_rules, path_matchers=path_matchers, - tests=tests, driver=self, extra=extra) + default_service = self._get_object_by_kind(urlmap.get("defaultService")) + + host_rules = urlmap.get("hostRules", []) + path_matchers = urlmap.get("pathMatchers", []) + tests = urlmap.get("tests", []) + + return GCEUrlMap( + id=urlmap["id"], + name=urlmap["name"], + default_service=default_service, + host_rules=host_rules, + path_matchers=path_matchers, + tests=tests, + driver=self, + extra=extra, + ) def _to_zone(self, zone): """ @@ -5442,37 +10636,24 @@ def _to_zone(self, zone): :rtype: :class:`GCEZone` """ extra = {} - extra['selfLink'] = zone.get('selfLink') - extra['creationTimestamp'] = zone.get('creationTimestamp') - extra['description'] = zone.get('description') - extra['region'] = zone.get('region') - - deprecated = zone.get('deprecated') - - return GCEZone(id=zone['id'], name=zone['name'], status=zone['status'], - maintenance_windows=zone.get('maintenanceWindows'), - deprecated=deprecated, driver=self, extra=extra) - - def _to_license(self, license): - """ - Return a License object from the JSON-response dictionary. - - :param license: The dictionary describing the license. - :type license: ``dict`` - - :return: License object - :rtype: :class:`GCELicense` - """ - extra = {} - extra['selfLink'] = license.get('selfLink') - extra['kind'] = license.get('kind') - - return GCELicense(id=license['name'], name=license['name'], - charges_use_fee=license['chargesUseFee'], - driver=self, extra=extra) + extra["selfLink"] = zone.get("selfLink") + extra["creationTimestamp"] = zone.get("creationTimestamp") + extra["description"] = zone.get("description") + extra["region"] = zone.get("region") + + deprecated = zone.get("deprecated") + + return GCEZone( + id=zone["id"], + name=zone["name"], + status=zone["status"], + maintenance_windows=zone.get("maintenanceWindows"), + deprecated=deprecated, + driver=self, + extra=extra, + ) - def _set_project_metadata(self, metadata=None, force=False, - current_keys=""): + def _set_project_metadata(self, metadata=None, force=False, current_keys=""): """ Return the GCE-friendly dictionary of metadata with/without an entry for 'sshKeys' based on params for 'force' and 'current_keys'. @@ -5491,29 +10672,33 @@ def _set_project_metadata(self, metadata=None, force=False, :return: GCE-friendly metadata dict :rtype: ``dict`` """ + if metadata is None: - # User wants to delete metdata, but if 'force' is False + # User wants to delete metadata, but if 'force' is False # and we already have sshKeys, we should retain them. # Otherwise, delete ALL THE THINGS! + if not force and current_keys: - new_md = [{'key': 'sshKeys', 'value': current_keys}] + new_md = [{"key": "sshKeys", "value": current_keys}] else: new_md = [] else: # User is providing new metadata. If 'force' is False, they # want to preserve existing sshKeys, otherwise 'force' is True # and the user wants to add/replace sshKeys. - new_md = metadata['items'] + new_md = metadata["items"] + if not force and current_keys: # not sure how duplicate keys would be resolved, so ensure # existing 'sshKeys' entry is removed. updated_md = [] + for d in new_md: - if d['key'] != 'sshKeys': - updated_md.append({'key': d['key'], - 'value': d['value']}) + if d["key"] != "sshKeys": + updated_md.append({"key": d["key"], "value": d["value"]}) new_md = updated_md - new_md.append({'key': 'sshKeys', 'value': current_keys}) + new_md.append({"key": "sshKeys", "value": current_keys}) + return new_md def _licenses_from_urls(self, licenses): @@ -5528,31 +10713,59 @@ def _licenses_from_urls(self, licenses): :rtype: ``list`` """ return_list = [] + for license in licenses: - selfLink_parts = license.split('/') + selfLink_parts = license.split("/") lic_proj = selfLink_parts[6] lic_name = selfLink_parts[-1] - return_list.append(self.ex_get_license(project=lic_proj, - name=lic_name)) + return_list.append(self.ex_get_license(project=lic_proj, name=lic_name)) + return return_list KIND_METHOD_MAP = { - 'compute#address': _to_address, - 'compute#backendService': _to_backendservice, - 'compute#disk': _to_storage_volume, - 'compute#firewall': _to_firewall, - 'compute#forwardingRule': _to_forwarding_rule, - 'compute#httpHealthCheck': _to_healthcheck, - 'compute#image': _to_node_image, - 'compute#instance': _to_node, - 'compute#machineType': _to_node_size, - 'compute#network': _to_network, - 'compute#project': _to_project, - 'compute#region': _to_region, - 'compute#snapshot': _to_snapshot, - 'compute#targetHttpProxy': _to_targethttpproxy, - 'compute#targetInstance': _to_targetinstance, - 'compute#targetPool': _to_targetpool, - 'compute#urlMap': _to_urlmap, - 'compute#zone': _to_zone, + "compute#address": _to_address, + "compute#backendService": _to_backendservice, + "compute#disk": _to_storage_volume, + "compute#firewall": _to_firewall, + "compute#forwardingRule": _to_forwarding_rule, + "compute#httpHealthCheck": _to_healthcheck, + "compute#image": _to_node_image, + "compute#instance": _to_node, + "compute#machineType": _to_node_size, + "compute#network": _to_network, + "compute#project": _to_project, + "compute#region": _to_region, + "compute#snapshot": _to_snapshot, + "compute#sslCertificate": _to_sslcertificate, + "compute#targetHttpProxy": _to_targethttpproxy, + "compute#targetHttpsProxy": _to_targethttpsproxy, + "compute#targetInstance": _to_targetinstance, + "compute#targetPool": _to_targetpool, + "compute#urlMap": _to_urlmap, + "compute#zone": _to_zone, } + + def _verify_zone_is_set(self, zone=None): + """ + Verify that the zone / location is set for a particular operation - + either via "datacenter" driver constructor argument or via + "location" / "zone" keyword argument passed to the specific method + call. + + This check is mandatory for methods which rely on the location being + set - e.g. create_node. + """ + + if self.zone: + return True + + if not zone: + msg = ( + "Zone not provided. Zone needs to be specified for this" + 'operation. This can be done by passing "datacenter" ' + "argument to the driver constructor or by passing location " + "/ zone argument to this method." + ) + raise ValueError(msg) + + return True diff --git a/libcloud/compute/drivers/gig_g8.py b/libcloud/compute/drivers/gig_g8.py new file mode 100644 index 0000000000..3c0e80975c --- /dev/null +++ b/libcloud/compute/drivers/gig_g8.py @@ -0,0 +1,663 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +GiG G8 Driver + +""" + +import json + +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + UuidMixin, + NodeDriver, + StorageVolume, + NodeAuthSSHKey, +) +from libcloud.common.gig_g8 import G8Connection +from libcloud.compute.types import Provider, NodeState +from libcloud.common.exceptions import BaseHTTPError + + +class G8ProvisionError(Exception): + pass + + +class G8PortForward(UuidMixin): + def __init__(self, network, node_id, publicport, privateport, protocol, driver): + self.node_id = node_id + self.network = network + self.publicport = int(publicport) + self.privateport = int(privateport) + self.protocol = protocol + self.driver = driver + UuidMixin.__init__(self) + + def destroy(self): + self.driver.ex_delete_portforward(self) + + +class G8Network(UuidMixin): + """ + G8 Network object class. + + This class maps to a cloudspace + + """ + + def __init__(self, id, name, cidr, publicipaddress, driver, extra=None): + self.id = id + self.name = name + self._cidr = cidr + self.driver = driver + self.publicipaddress = publicipaddress + self.extra = extra + UuidMixin.__init__(self) + + @property + def cidr(self): + """ + Cidr is not part of the list result + we will lazily fetch it with a get request + """ + if self._cidr is None: + networkdata = self.driver._api_request("/cloudspaces/get", {"cloudspaceId": self.id}) + self._cidr = networkdata["privatenetwork"] + return self._cidr + + def list_nodes(self): + return self.driver.list_nodes(self) + + def destroy(self): + return self.driver.ex_destroy_network(self) + + def list_portforwards(self): + return self.driver.ex_list_portforwards(self) + + def create_portforward(self, node, publicport, privateport, protocol="tcp"): + return self.driver.ex_create_portforward(self, node, publicport, privateport, protocol) + + +class G8NodeDriver(NodeDriver): + """ + GiG G8 node driver + + """ + + NODE_STATE_MAP = { + "VIRTUAL": NodeState.PENDING, + "HALTED": NodeState.STOPPED, + "RUNNING": NodeState.RUNNING, + "DESTROYED": NodeState.TERMINATED, + "DELETED": NodeState.TERMINATED, + "PAUSED": NodeState.PAUSED, + "ERROR": NodeState.ERROR, + # transition states + "DEPLOYING": NodeState.PENDING, + "STOPPING": NodeState.STOPPING, + "MOVING": NodeState.MIGRATING, + "RESTORING": NodeState.PENDING, + "STARTING": NodeState.STARTING, + "PAUSING": NodeState.PENDING, + "RESUMING": NodeState.PENDING, + "RESETTING": NodeState.REBOOTING, + "DELETING": NodeState.TERMINATED, + "DESTROYING": NodeState.TERMINATED, + "ADDING_DISK": NodeState.RECONFIGURING, + "ATTACHING_DISK": NodeState.RECONFIGURING, + "DETACHING_DISK": NodeState.RECONFIGURING, + "ATTACHING_NIC": NodeState.RECONFIGURING, + "DETTACHING_NIC": NodeState.RECONFIGURING, + "DELETING_DISK": NodeState.RECONFIGURING, + "CHANGING_DISK_LIMITS": NodeState.RECONFIGURING, + "CLONING": NodeState.PENDING, + "RESIZING": NodeState.RECONFIGURING, + "CREATING_TEMPLATE": NodeState.PENDING, + } + + name = "GiG G8 Node Provider" + website = "https://gig.tech" + type = Provider.GIG_G8 + connectionCls = G8Connection + + def __init__(self, user_id, key, api_url): + # type (int, str, str) -> None + """ + :param key: Token to use for api (jwt) + :type key: ``str`` + :param user_id: Id of the account to connect to (accountId) + :type user_id: ``int`` + :param api_url: G8 api url + :type api_url: ``str`` + + :rtype: ``None`` + """ + self._apiurl = api_url.rstrip("/") + super().__init__(key=key) + self._account_id = user_id + self._location_data = None + + def _ex_connection_class_kwargs(self): + return {"url": self._apiurl} + + def _api_request(self, endpoint, params=None): + return self.connection.request( + endpoint.lstrip("/"), data=json.dumps(params), method="POST" + ).object + + @property + def _location(self): + if self._location_data is None: + self._location_data = self._api_request("/locations/list")[0] + return self._location_data + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_network=None, + ex_description=None, + ex_create_attr=None, + ex_expose_ssh=False, + ): + # type (str, Image, G8Network, str, Size, + # Optional[NodeAuthSSHKey], Optional[Dict], bool) -> Node + """ + Create a node. + + The `ex_create_attr` parameter can include the following dictionary + key and value pairs: + + * `memory`: ``int`` Memory in MiB + (only used if size is None and vcpus is passed + * `vcpus`: ``int`` Amount of vcpus + (only used if size is None and memory is passed) + * `disk_size`: ``int`` Size of bootdisk + defaults to minimumsize of the image + * `user_data`: ``str`` for cloud-config data + * `private_ip`: ``str`` Private Ip inside network + * `data_disks`: ``list(int)`` Extra data disks to assign + to vm list of disk sizes in GiB + + :param name: the name to assign the vm + :type name: ``str`` + + :param size: the plan size to create + mutual exclusive with `memory` `vcpus` + :type size: :class:`NodeSize` + + :param image: which distribution to deploy on the vm + :type image: :class:`NodeImage` + + :param network: G8 Network to place vm in + :type size: :class:`G8Network` + + :param ex_description: Description of vm + :type size: : ``str`` + + :param auth: an SSH key + :type auth: :class:`NodeAuthSSHKey` + + :param ex_create_attr: A dictionary of optional attributes for + vm creation + :type ex_create_attr: ``dict`` + + :param ex_expose_ssh: Create portforward for ssh port + :type ex_expose_ssh: int + + :return: The newly created node. + :rtype: :class:`Node` + """ + params = { + "name": name, + "imageId": int(image.id), + "cloudspaceId": int(ex_network.id), + "description": ex_description, + } + + ex_create_attr = ex_create_attr or {} + if size: + params["sizeId"] = int(size.id) + else: + params["memory"] = ex_create_attr["memory"] + params["vcpus"] = ex_create_attr["vcpus"] + if "user_data" in ex_create_attr: + params["userdata"] = ex_create_attr["user_data"] + if "data_disks" in ex_create_attr: + params["datadisks"] = ex_create_attr["data_disks"] + if "private_ip" in ex_create_attr: + params["privateIp"] = ex_create_attr["private_ip"] + if "disk_size" in ex_create_attr: + params["disksize"] = ex_create_attr["disk_size"] + else: + params["disksize"] = image.extra["min_disk_size"] + if auth and isinstance(auth, NodeAuthSSHKey): + userdata = params.setdefault("userdata", {}) + users = userdata.setdefault("users", []) + root = None + for user in users: + if user["name"] == "root": + root = user + break + else: + root = {"name": "root", "shell": "/bin/bash"} + users.append(root) + keys = root.setdefault("ssh-authorized-keys", []) + keys.append(auth.pubkey) + elif auth: + error = "Auth type {} is not implemented".format(type(auth)) + raise NotImplementedError(error) + + machineId = self._api_request("/machines/create", params) + machine = self._api_request("/machines/get", params={"machineId": machineId}) + node = self._to_node(machine, ex_network) + if ex_expose_ssh: + port = self.ex_expose_ssh_node(node) + node.extra["ssh_port"] = port + node.extra["ssh_ip"] = ex_network.publicipaddress + return node + + def _find_ssh_ports(self, ex_network, node): + forwards = ex_network.list_portforwards() + usedports = [] + result = {"node": None, "network": usedports} + for forward in forwards: + usedports.append(forward.publicport) + if forward.node_id == node.id and forward.privateport == 22: + result["node"] = forward.privateport + return result + + def ex_expose_ssh_node(self, node): + """ + Create portforward for ssh purposed + + :param node: Node to expose ssh for + :type node: ``Node`` + + :rtype: ``int`` + """ + + network = node.extra["network"] + ports = self._find_ssh_ports(network, node) + if ports["node"]: + return ports["node"] + usedports = ports["network"] + sshport = 2200 + endport = 3000 + while sshport < endport: + while sshport in usedports: + sshport += 1 + try: + network.create_portforward(node, sshport, 22) + node.extra["ssh_port"] = sshport + node.extra["ssh_ip"] = network.publicipaddress + break + except BaseHTTPError as e: + if e.code == 409: + # port already used maybe raise let's try next + usedports.append(sshport) + raise + else: + raise G8ProvisionError("Failed to create portforward") + return sshport + + def ex_create_network(self, name, private_network="192.168.103.0/24", type="vgw"): + # type (str, str, str) -> G8Network + """ + Create network also known as cloudspace + + :param name: the name to assign to the network + :type name: ``str`` + + :param private_network: subnet used as private network + :type private_network: ``str`` + + :param type: type of the gateway vgw or routeros + :type type: ``str`` + """ + userinfo = self._api_request("../system/usermanager/whoami") + params = { + "accountId": self._account_id, + "privatenetwork": private_network, + "access": userinfo["name"], + "name": name, + "location": self._location["locationCode"], + "type": type, + } + networkid = self._api_request("/cloudspaces/create", params) + network = self._api_request("/cloudspaces/get", {"cloudspaceId": networkid}) + return self._to_network(network) + + def ex_destroy_network(self, network): + # type (G8Network) -> bool + self._api_request("/cloudspaces/delete", {"cloudspaceId": int(network.id)}) + return True + + def stop_node(self, node): + # type (Node) -> bool + """ + Stop virtual machine + """ + node.state = NodeState.STOPPING + self._api_request("/machines/stop", {"machineId": int(node.id)}) + node.state = NodeState.STOPPED + return True + + def ex_list_portforwards(self, network): + # type (G8Network) -> List[G8PortForward] + data = self._api_request("/portforwarding/list", {"cloudspaceId": int(network.id)}) + forwards = [] + for forward in data: + forwards.append(self._to_port_forward(forward, network)) + return forwards + + def ex_create_portforward(self, network, node, publicport, privateport, protocol="tcp"): + # type (G8Network, Node, int, int, str) -> G8PortForward + params = { + "cloudspaceId": int(network.id), + "machineId": int(node.id), + "localPort": privateport, + "publicPort": publicport, + "publicIp": network.publicipaddress, + "protocol": protocol, + } + self._api_request("/portforwarding/create", params) + return self._to_port_forward(params, network) + + def ex_delete_portforward(self, portforward): + # type (G8PortForward) -> bool + params = { + "cloudspaceId": int(portforward.network.id), + "publicIp": portforward.network.publicipaddress, + "publicPort": portforward.publicport, + "proto": portforward.protocol, + } + self._api_request("/portforwarding/deleteByPort", params) + return True + + def start_node(self, node): + # type (Node) -> bool + """ + Start virtual machine + """ + node.state = NodeState.STARTING + self._api_request("/machines/start", {"machineId": int(node.id)}) + node.state = NodeState.RUNNING + return True + + def ex_list_networks(self): + # type () -> List[G8Network] + """ + Return the list of networks. + + :return: A list of network objects. + :rtype: ``list`` of :class:`G8Network` + """ + networks = [] + for network in self._api_request("/cloudspaces/list"): + if network["accountId"] == self._account_id: + networks.append(self._to_network(network)) + return networks + + def list_sizes( + self, + location=None, + ): + # type () -> List[Size] + """ + Returns a list of node sizes as a cloud provider might have + + """ + location = self._location["locationCode"] + + sizes = [] + for size in self._api_request("/sizes/list", {"location": location}): + sizes.extend(self._to_size(size)) + return sizes + + def list_nodes(self, ex_network=None): + # type (Optional[G8Network]) -> List[Node] + """ + List the nodes known to a particular driver; + There are two default nodes created at the beginning + """ + + def _get_ssh_port(forwards, node): + for forward in forwards: + if forward.node_id == node.id and forward.privateport == 22: + return forward + + if ex_network: + networks = [ex_network] + else: + networks = self.ex_list_networks() + nodes = [] + for network in networks: + nodes_list = self._api_request("/machines/list", params={"cloudspaceId": network.id}) + forwards = network.list_portforwards() + for nodedata in nodes_list: + node = self._to_node(nodedata, network) + sshforward = _get_ssh_port(forwards, node) + if sshforward: + node.extra["ssh_port"] = sshforward.publicport + node.extra["ssh_ip"] = network.publicipaddress + nodes.append(node) + return nodes + + def reboot_node(self, node): + # type (Node) -> bool + """ + Reboot node + returns True as if the reboot had been successful. + """ + node.state = NodeState.REBOOTING + self._api_request("/machines/reboot", {"machineId": int(node.id)}) + node.state = NodeState.RUNNING + return True + + def destroy_node(self, node): + # type (Node) -> bool + """ + Destroy node + """ + self._api_request("/machines/delete", {"machineId": int(node.id)}) + return True + + def list_images( + self, + location=None, + ): + # type () -> List[Image] + """ + Returns a list of images as a cloud provider might have + + @inherits: :class:`NodeDriver.list_images` + """ + images = [] + for image in self._api_request("/images/list", {"accountId": self._account_id}): + images.append(self._to_image(image)) + return images + + def list_volumes(self): + # type () -> List[StorageVolume] + volumes = [] + for disk in self._api_request("/disks/list", {"accountId": self._account_id}): + if disk["status"] not in ["ASSIGNED", "CREATED"]: + continue + volumes.append(self._to_volume(disk)) + return volumes + + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + ex_description=None, + ex_disk_type="D", + ): + # type (int, str, str, Optional[str]) -> StorageVolume + """ + Create volume + + :param size: Size of the volume to create in GiB + :type size: ``int`` + + :param name: Name of the volume + :type name: ``str`` + + :param ex_description: Description of the volume + :type ex_description: ``str`` + + :param ex_disk_type: Type of the disk depending on the G8. + ``D`` for a data disk is always available. + :type ex_disk_type: ``str`` + + :rtype: class:`StorageVolume` + """ + params = { + "size": size, + "name": name, + "type": ex_disk_type, + "description": ex_description, + "gid": self._location["gid"], + "accountId": self._account_id, + } + diskId = self._api_request("/disks/create", params) + disk = self._api_request("/disks/get", {"diskId": diskId}) + return self._to_volume(disk) + + def destroy_volume(self, volume): + # type (StorageVolume) -> bool + self._api_request("/disks/delete", {"diskId": int(volume.id)}) + return True + + def attach_volume( + self, + node, + volume, + device=None, + ): + # type (Node, StorageVolume) -> bool + params = {"machineId": int(node.id), "diskId": int(volume.id)} + self._api_request("/machines/attachDisk", params) + return True + + def detach_volume( + self, + volume, + node=None, + ): + # type (Node, StorageVolume) -> bool + params = {"machineId": int(node.id), "diskId": int(volume.id)} + self._api_request("/machines/detachDisk", params) + return True + + def _to_volume(self, data): + # type (dict) -> StorageVolume + extra = {"type": data["type"], "node_id": data.get("machineId")} + return StorageVolume( + id=str(data["id"]), + size=data["sizeMax"], + name=data["name"], + driver=self, + extra=extra, + ) + + def _to_node(self, nodedata, ex_network): + # type (dict) -> Node + state = self.NODE_STATE_MAP.get(nodedata["status"], NodeState.UNKNOWN) + public_ips = [] + private_ips = [] + nics = nodedata.get("nics", []) + if not nics: + nics = nodedata.get("interfaces", []) + for nic in nics: + if nic["type"] == "PUBLIC": + public_ips.append(nic["ipAddress"].split("/")[0]) + else: + private_ips.append(nic["ipAddress"]) + extra = {"network": ex_network} + for account in nodedata.get("accounts", []): + extra["password"] = account["password"] + extra["username"] = account["login"] + + return Node( + id=str(nodedata["id"]), + name=nodedata["name"], + driver=self, + public_ips=public_ips, + private_ips=private_ips, + state=state, + extra=extra, + ) + + def _to_network(self, network): + # type (dict) -> G8Network + return G8Network( + str(network["id"]), + network["name"], + None, + network["externalnetworkip"], + self, + ) + + def _to_image(self, image): + # type (dict) -> Image + extra = { + "min_disk_size": image["bootDiskSize"], + "min_memory": image["memory"], + } + return NodeImage(id=str(image["id"]), name=image["name"], driver=self, extra=extra) + + def _to_size(self, size): + # type (dict) -> Size + sizes = [] + for disk in size["disks"]: + sizes.append( + NodeSize( + id=str(size["id"]), + name=size["name"], + ram=size["memory"], + disk=disk, + driver=self, + extra={"vcpus": size["vcpus"]}, + bandwidth=0, + price=0, + ) + ) + return sizes + + def _to_port_forward(self, data, ex_network): + # type (dict, G8Network) -> G8PortForward + return G8PortForward( + ex_network, + str(data["machineId"]), + data["publicPort"], + data["localPort"], + data["protocol"], + self, + ) + + +if __name__ == "__main__": + import doctest + + doctest.testmod() diff --git a/libcloud/compute/drivers/gogrid.py b/libcloud/compute/drivers/gogrid.py deleted file mode 100644 index 6c73e46eb9..0000000000 --- a/libcloud/compute/drivers/gogrid.py +++ /dev/null @@ -1,464 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -GoGrid driver -""" -import time -import hashlib -import copy - -from libcloud.utils.py3 import b - -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.common.gogrid import GoGridConnection, BaseGoGridDriver -from libcloud.compute.providers import Provider -from libcloud.compute.types import NodeState -from libcloud.compute.base import Node, NodeDriver -from libcloud.compute.base import NodeSize, NodeImage, NodeLocation - -STATE = { - "Starting": NodeState.PENDING, - "On": NodeState.RUNNING, - "On/Saving": NodeState.RUNNING, - "Off": NodeState.PENDING, - "Restarting": NodeState.REBOOTING, - "Saving": NodeState.PENDING, - "Restoring": NodeState.PENDING, -} - -GOGRID_INSTANCE_TYPES = { - '512MB': {'id': '512MB', - 'name': '512MB', - 'ram': 512, - 'disk': 30, - 'bandwidth': None}, - '1GB': {'id': '1GB', - 'name': '1GB', - 'ram': 1024, - 'disk': 60, - 'bandwidth': None}, - '2GB': {'id': '2GB', - 'name': '2GB', - 'ram': 2048, - 'disk': 120, - 'bandwidth': None}, - '4GB': {'id': '4GB', - 'name': '4GB', - 'ram': 4096, - 'disk': 240, - 'bandwidth': None}, - '8GB': {'id': '8GB', - 'name': '8GB', - 'ram': 8192, - 'disk': 480, - 'bandwidth': None}, - '16GB': {'id': '16GB', - 'name': '16GB', - 'ram': 16384, - 'disk': 960, - 'bandwidth': None}, - '24GB': {'id': '24GB', - 'name': '24GB', - 'ram': 24576, - 'disk': 960, - 'bandwidth': None}, -} - - -class GoGridNode(Node): - # Generating uuid based on public ip to get around missing id on - # create_node in gogrid api - # - # Used public ip since it is not mutable and specified at create time, - # so uuid of node should not change after add is completed - def get_uuid(self): - return hashlib.sha1( - b("%s:%s" % (self.public_ips, self.driver.type)) - ).hexdigest() - - -class GoGridNodeDriver(BaseGoGridDriver, NodeDriver): - """ - GoGrid node driver - """ - - connectionCls = GoGridConnection - type = Provider.GOGRID - api_name = 'gogrid' - name = 'GoGrid' - website = 'http://www.gogrid.com/' - features = {"create_node": ["generates_password"]} - - _instance_types = GOGRID_INSTANCE_TYPES - - def __init__(self, *args, **kwargs): - """ - @inherits: :class:`NodeDriver.__init__` - """ - super(GoGridNodeDriver, self).__init__(*args, **kwargs) - - def _get_state(self, element): - try: - return STATE[element['state']['name']] - except: - pass - return NodeState.UNKNOWN - - def _get_ip(self, element): - return element.get('ip').get('ip') - - def _get_id(self, element): - return element.get('id') - - def _to_node(self, element, password=None): - state = self._get_state(element) - ip = self._get_ip(element) - id = self._get_id(element) - n = GoGridNode(id=id, - name=element['name'], - state=state, - public_ips=[ip], - private_ips=[], - extra={'ram': element.get('ram').get('name'), - 'description': element.get('description', '')}, - driver=self.connection.driver) - if password: - n.extra['password'] = password - - return n - - def _to_image(self, element): - n = NodeImage(id=element['id'], - name=element['friendlyName'], - driver=self.connection.driver) - return n - - def _to_images(self, object): - return [self._to_image(el) - for el in object['list']] - - def _to_location(self, element): - location = NodeLocation(id=element['id'], - name=element['name'], - country="US", - driver=self.connection.driver) - return location - - def _to_locations(self, object): - return [self._to_location(el) - for el in object['list']] - - def list_images(self, location=None): - params = {} - if location is not None: - params["datacenter"] = location.id - images = self._to_images( - self.connection.request('/api/grid/image/list', params).object) - return images - - def list_nodes(self): - """ - @inherits: :class:`NodeDriver.list_nodes` - :rtype: ``list`` of :class:`GoGridNode` - """ - passwords_map = {} - - res = self._server_list() - try: - for password in self._password_list()['list']: - try: - passwords_map[password['server']['id']] = \ - password['password'] - except KeyError: - pass - except InvalidCredsError: - # some gogrid API keys don't have permission to access the - # password list. - pass - - return [self._to_node(el, passwords_map.get(el.get('id'))) - for el in res['list']] - - def reboot_node(self, node): - """ - @inherits: :class:`NodeDriver.reboot_node` - :type node: :class:`GoGridNode` - """ - id = node.id - power = 'restart' - res = self._server_power(id, power) - if not res.success(): - raise Exception(res.parse_error()) - return True - - def destroy_node(self, node): - """ - @inherits: :class:`NodeDriver.reboot_node` - :type node: :class:`GoGridNode` - """ - id = node.id - res = self._server_delete(id) - if not res.success(): - raise Exception(res.parse_error()) - return True - - def _server_list(self): - return self.connection.request('/api/grid/server/list').object - - def _password_list(self): - return self.connection.request('/api/support/password/list').object - - def _server_power(self, id, power): - # power in ['start', 'stop', 'restart'] - params = {'id': id, 'power': power} - return self.connection.request("/api/grid/server/power", params, - method='POST') - - def _server_delete(self, id): - params = {'id': id} - return self.connection.request("/api/grid/server/delete", params, - method='POST') - - def _get_first_ip(self, location=None): - ips = self.ex_list_ips(public=True, assigned=False, location=location) - try: - return ips[0].ip - except IndexError: - raise LibcloudError('No public unassigned IPs left', - GoGridNodeDriver) - - def list_sizes(self, location=None): - sizes = [] - for key, values in self._instance_types.items(): - attributes = copy.deepcopy(values) - attributes.update({'price': self._get_size_price(size_id=key)}) - sizes.append(NodeSize(driver=self.connection.driver, **attributes)) - - return sizes - - def list_locations(self): - locations = self._to_locations( - self.connection.request('/api/common/lookup/list', - params={'lookup': 'ip.datacenter'}).object) - return locations - - def ex_create_node_nowait(self, **kwargs): - """Don't block until GoGrid allocates id for a node - but return right away with id == None. - - The existence of this method is explained by the fact - that GoGrid assigns id to a node only few minutes after - creation. - - - :keyword name: String with a name for this new node (required) - :type name: ``str`` - - :keyword size: The size of resources allocated to this node . - (required) - :type size: :class:`NodeSize` - - :keyword image: OS Image to boot on node. (required) - :type image: :class:`NodeImage` - - :keyword ex_description: Description of a Node - :type ex_description: ``str`` - - :keyword ex_ip: Public IP address to use for a Node. If not - specified, first available IP address will be picked - :type ex_ip: ``str`` - - :rtype: :class:`GoGridNode` - """ - name = kwargs['name'] - image = kwargs['image'] - size = kwargs['size'] - try: - ip = kwargs['ex_ip'] - except KeyError: - ip = self._get_first_ip(kwargs.get('location')) - - params = {'name': name, - 'image': image.id, - 'description': kwargs.get('ex_description', ''), - 'server.ram': size.id, - 'ip': ip} - - object = self.connection.request('/api/grid/server/add', - params=params, method='POST').object - node = self._to_node(object['list'][0]) - - return node - - def create_node(self, **kwargs): - """Create a new GoGird node - - @inherits: :class:`NodeDriver.create_node` - - :keyword ex_description: Description of a Node - :type ex_description: ``str`` - - :keyword ex_ip: Public IP address to use for a Node. If not - specified, first available IP address will be picked - :type ex_ip: ``str`` - - :rtype: :class:`GoGridNode` - """ - node = self.ex_create_node_nowait(**kwargs) - - timeout = 60 * 20 - waittime = 0 - interval = 2 * 60 - - while node.id is None and waittime < timeout: - nodes = self.list_nodes() - - for i in nodes: - if i.public_ips[0] == node.public_ips[0] and i.id is not None: - return i - - waittime += interval - time.sleep(interval) - - if id is None: - raise Exception( - "Wasn't able to wait for id allocation for the node %s" - % str(node)) - - return node - - def ex_save_image(self, node, name): - """Create an image for node. - - Please refer to GoGrid documentation to get info - how prepare a node for image creation: - - http://wiki.gogrid.com/wiki/index.php/MyGSI - - :keyword node: node to use as a base for image - :type node: :class:`GoGridNode` - - :keyword name: name for new image - :type name: ``str`` - - :rtype: :class:`NodeImage` - """ - params = {'server': node.id, - 'friendlyName': name} - object = self.connection.request('/api/grid/image/save', params=params, - method='POST').object - - return self._to_images(object)[0] - - def ex_edit_node(self, **kwargs): - """Change attributes of a node. - - :keyword node: node to be edited (required) - :type node: :class:`GoGridNode` - - :keyword size: new size of a node (required) - :type size: :class:`NodeSize` - - :keyword ex_description: new description of a node - :type ex_description: ``str`` - - :rtype: :class:`Node` - """ - node = kwargs['node'] - size = kwargs['size'] - - params = {'id': node.id, - 'server.ram': size.id} - - if 'ex_description' in kwargs: - params['description'] = kwargs['ex_description'] - - object = self.connection.request('/api/grid/server/edit', - params=params).object - - return self._to_node(object['list'][0]) - - def ex_edit_image(self, **kwargs): - """Edit metadata of a server image. - - :keyword image: image to be edited (required) - :type image: :class:`NodeImage` - - :keyword public: should be the image public (required) - :type public: ``bool`` - - :keyword ex_description: description of the image (optional) - :type ex_description: ``str`` - - :keyword name: name of the image - :type name: ``str`` - - :rtype: :class:`NodeImage` - """ - - image = kwargs['image'] - public = kwargs['public'] - - params = {'id': image.id, - 'isPublic': str(public).lower()} - - if 'ex_description' in kwargs: - params['description'] = kwargs['ex_description'] - - if 'name' in kwargs: - params['friendlyName'] = kwargs['name'] - - object = self.connection.request('/api/grid/image/edit', - params=params).object - - return self._to_image(object['list'][0]) - - def ex_list_ips(self, **kwargs): - """Return list of IP addresses assigned to - the account. - - :keyword public: set to True to list only - public IPs or False to list only - private IPs. Set to None or not specify - at all not to filter by type - :type public: ``bool`` - - :keyword assigned: set to True to list only addresses - assigned to servers, False to list unassigned - addresses and set to None or don't set at all - not no filter by state - :type assigned: ``bool`` - - :keyword location: filter IP addresses by location - :type location: :class:`NodeLocation` - - :rtype: ``list`` of :class:`GoGridIpAddress` - """ - - params = {} - - if "public" in kwargs and kwargs["public"] is not None: - params["ip.type"] = {True: "Public", - False: "Private"}[kwargs["public"]] - if "assigned" in kwargs and kwargs["assigned"] is not None: - params["ip.state"] = {True: "Assigned", - False: "Unassigned"}[kwargs["assigned"]] - if "location" in kwargs and kwargs['location'] is not None: - params['datacenter'] = kwargs['location'].id - - ips = self._to_ips( - self.connection.request('/api/grid/ip/list', - params=params).object) - return ips diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py new file mode 100644 index 0000000000..263a83be82 --- /dev/null +++ b/libcloud/compute/drivers/gridscale.py @@ -0,0 +1,1135 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import time + +from libcloud.compute.base import ( + Node, + KeyPair, + NodeImage, + NodeState, + NodeDriver, + NodeLocation, + StorageVolume, + VolumeSnapshot, + StorageVolumeState, +) +from libcloud.utils.iso8601 import parse_date +from libcloud.common.gridscale import GridscaleBaseDriver, GridscaleConnection +from libcloud.compute.providers import Provider + + +class GridscaleIp: + """ + Ip Object + + :param id: uuid + :type id: ``str`` + :param family: family of ip (v4 or v6) + :type family: ``str`` + :param prefix: prefix of ip + :type prefix: ``str`` + :param ip_address: Ip address + :type ip_address: ``str`` + :param create_time: Time ip was created + :type create_time: ``str`` + """ + + def __init__(self, id, family, prefix, create_time, address, extra=None): + self.id = id + self.family = family + self.prefix = prefix + self.create_time = create_time + self.ip_address = address + self.extra = extra or {} + + def __repr__(self): + return "Ip: id={}, family={}, prefix={}, create_time={}, " "ip_address={}".format( + self.id, self.family, self.prefix, self.create_time, self.ip_address + ) + + +class GridscaleNetwork: + """ + Network Object + + :param id: uuid + :type id: ``str`` + :param name: Name of Network + :type name: ``str`` + :param status: Network status + :type status: ``str`` + :param relations: object related to network + :type relations: ``object`` + :param create_time: Time Network was created + :type create_time: ``str`` + """ + + def __init__(self, id, name, status, create_time, relations): + self.id = id + self.name = name + self.status = status + self.create_time = create_time + self.relations = relations + + def __repr__(self): + return "Network: id={}, name={}, status={}, create_time={}, " "relations={}".format( + self.id, self.name, self.status, self.create_time, self.relations + ) + + +class GridscaleNodeDriver(GridscaleBaseDriver, NodeDriver): + """ + create and entry in libcloud/compute/providers for gridscale + """ + + connectionCls = GridscaleConnection + type = Provider.GRIDSCALE + name = "Gridscale" + api_name = "gridscale" + website = "https://gridscale.io" + features = {"create_node": ["ssh_key"]} + + def __init__(self, user_id, key, **kwargs): + super().__init__(user_id, key, **kwargs) + + def list_nodes(self): + """ + List all nodes. + + :return: List of node objects + :rtype: ``list`` of :class:`.Node` + """ + result = self._sync_request(data=None, endpoint="objects/servers/") + nodes = [] + for key, value in self._get_response_dict(result).items(): + node = self._to_node(value) + nodes.append(node) + + return sorted(nodes, key=lambda sort: sort.created_at) + + def list_locations(self): + """ + List all available data centers. + + :return: List of node location objects + :rtype: ``list`` of :class:`.NodeLocation` + """ + locations = [] + result = self._sync_request(endpoint="objects/locations/") + for key, value in self._get_response_dict(result).items(): + location = self._to_location(value) + locations.append(location) + + return sorted(locations, key=lambda nod: nod.id) + + def list_volumes(self): + """ + List all volumes. + + :return: List of StorageVolume object + :rtype: ``list`` of :class:`.StorageVolume` + """ + volumes = [] + result = self._sync_request(endpoint="objects/storages/") + for key, value in self._get_response_dict(result).items(): + volume = self._to_volume(value) + volumes.append(volume) + return sorted(volumes, key=lambda sort: sort.extra["create_time"]) + + def ex_list_networks(self): + """ + List all networks. + + :return: List of objects. + :rtype: ``list`` of :class:`.GridscaleNetwork` + """ + networks = [] + result = self._sync_request(endpoint="objects/networks/") + for key, value in self._get_response_dict(result).items(): + network = self._to_network(value) + networks.append(network) + return sorted(networks, key=lambda sort: sort.create_time) + + def list_volume_snapshots(self, volume): + """ + Lists all snapshots for storage volume. + + :param volume: storage the snapshot is attached to + :type volume: :class:`.StorageVolume` + + :return: Snapshots + :rtype: ``list`` of :class:`.VolumeSnapshot` + """ + snapshots = [] + result = self._sync_request(endpoint="objects/storages/" "{}/snapshots".format(volume.id)) + for key, value in self._get_response_dict(result).items(): + snapshot = self._to_volume_snapshot(value) + snapshots.append(snapshot) + return sorted(snapshots, key=lambda snapshot: snapshot.created) + + def ex_list_ips(self): + """ + Lists all IPs available. + + :return: List of IP objects. + :rtype: ``list`` of :class:`.GridscaleIp` + """ + ips = [] + result = self._sync_request(endpoint="objects/ips/") + for key, value in self._get_response_dict(result).items(): + ip = self._to_ip(value) + ips.append(ip) + return ips + + def list_images( + self, + location=None, + ): + """ + List images. + + :return: List of node image objects + :rtype: ``list`` of :class:`.NodeImage` + """ + templates = [] + result = self._sync_request(endpoint="objects/templates") + for key, value in self._get_response_dict(result).items(): + template = self._to_node_image(value) + templates.append(template) + return sorted(templates, key=lambda sort: sort.name) + + def create_node( + self, name, size, image, location=None, auth=None, ex_ssh_key_ids=None, **kwargs + ): + """ + Create a simple node with a name, cores, memory at the designated + location. + + :param name: Name of the server. + :type name: ``str`` + + :param size: Nodesize object. + :type size: :class:`.NodeSize` + + :param image: OS image to attach to the storage. + :type image: :class:`.GridscaleTemplate` + + :param location: The data center to create a node in. + :type location: :class:`.NodeLocation` + + :keyword ex_ssh_key_ids: List of SSH key IDs to add to the server. + :type ex_ssh_key_ids: ``list`` of ``str`` + + :return: The newly created Node. + :rtype: :class:`.Node` + + """ + + if size.ram % 1024 != 0: + raise Exception("Value not accepted. Use a multiple of 1024 e.g." "1024, 2048, 3072...") + data = { + "name": name, + "cores": size.extra["cores"], + "memory": int(size.ram / 1024), + "location_uuid": location.id, + } + self.connection.async_request("objects/servers/", data=data, method="POST") + + node = self._to_node( + self._get_resource( + "servers", self.connection.poll_response_initial.object["object_uuid"] + ) + ) + + volume = self._create_volume_from_template( + name=image.extra["ostype"], + size=size.disk, + location=location, + template={"template_uuid": image.id, "sshkeys": ex_ssh_key_ids}, + ) + + ip = self.ex_create_ip(4, location, name + "_ip") + + self.attach_volume(node, volume) + self.ex_link_ip_to_node(node, ip) + self.ex_link_network_to_node(node, self.ex_list_networks()[0]) + self.ex_start_node(node) + + return self._to_node(self._get_resource("servers", node.id)) + + def ex_create_ip(self, family, location, name): + """ + Create either an ip_v4 ip or a ip_v6. + + :param family: Defines if the ip is v4 or v6 with int 4 or int 6. + :type family: ``int`` + + :param location: Defines which datacenter the created ip + responds with. + :type location: :class:`.NodeLocation` + + :param name: Name of your Ip. + :type name: ``str`` + + :return: Ip + :rtype: :class:`.GridscaleIp` + """ + self.connection.async_request( + "objects/ips/", + data={"name": name, "family": family, "location_uuid": location.id}, + method="POST", + ) + + return self._to_ip( + self._get_resource("ips", self.connection.poll_response_initial.object["object_uuid"]) + ) + + def ex_create_networks(self, name, location): + """ + Create a network at the data center location. + + :param name: Name of the network. + :type name: ``str`` + + :param location: Location. + :type location: :class:`.NodeLocation` + + :return: Network. + :rtype: :class:`.GridscaleNetwork` + """ + self.connection.async_request( + "objects/networks", + data={"name": name, "location_uuid": location.id}, + method="POST", + ) + + return self._to_network( + self._get_resource( + "network", self.connection.poll_response_initial.object["object_uuid"] + ) + ) + + def create_volume(self, size, name, location=None, snapshot=None): + """ + Create a new volume. + + :param size: Integer in GB. + :type size: ``int`` + + :param name: Name of the volume. + :type name: ``str`` + + :param location: The server location. + :type location: :class:`.NodeLocation` + + :param snapshot: Snapshot from which to create the new + volume. (optional) + :type snapshot: :class:`.VolumeSnapshot` + + :return: Newly created StorageVolume. + :rtype: :class:`.StorageVolume` + """ + + return self._create_volume_from_template(size, name, location) + + def _create_volume_from_template(self, size, name, location=None, template=None): + """ + create Storage + + :param name: name of your Storage unit + :type name: ``str`` + + :param size: Integer in GB. + :type size: ``int`` + + :param location: your server location + :type location: :class:`.NodeLocation` + + :param template: template to shape the storage capacity to + :type template: ``dict`` + + :return: newly created StorageVolume + :rtype: :class:`.GridscaleVolumeStorage` + """ + template = template + self.connection.async_request( + "objects/storages/", + data={ + "name": name, + "capacity": size, + "location_uuid": location.id, + "template": template, + }, + method="POST", + ) + + return self._to_volume( + self._get_resource( + "storages", self.connection.poll_response_initial.object["object_uuid"] + ) + ) + + def create_volume_snapshot( + self, + volume, + name=None, + ): + """ + Creates a snapshot of the current state of your volume, + you can rollback to. + + :param volume: Volume you want to create a snapshot of. + :type volume: :class:`.StorageVolume` + + :param name: Name of the snapshot. + :type name: ``str`` + + :return: VolumeSnapshot. + :rtype: :class:`.VolumeSnapshot` + """ + self.connection.async_request( + "objects/storages/{}/snapshots".format(volume.id), + data={"name": name}, + method="POST", + ) + + return self._to_volume_snapshot( + self._get_resource( + "storages/{}/snapshots".format(volume.id), + self.connection.poll_response_initial.object["object_uuid"], + ) + ) + + def create_image( + self, + node, + name, + description=None, + ): + """ + Creates an image from a node object. + + :param node: Node to run the task on. + :type node: :class:`.Node` + + :param name: Name for new image. + :type name: ``str`` + + :return: NodeImage. + :rtype: :class:`.NodeImage` + """ + storage_dict = node.extra["relations"]["storages"][0] + snapshot_uuid = "" + if storage_dict["bootdevice"] is True: + self.connection.async_request( + "objects/storages/{}/snapshots/".format(storage_dict["object_uuid"]), + data={"name": name + "_snapshot"}, + method="POST", + ) + + snapshot_uuid = self.connection.poll_response_initial.object["object_uuid"] + + self.connection.async_request( + "objects/templates/", + data={"name": name, "snapshot_uuid": snapshot_uuid}, + method="POST", + ) + + snapshot_dict = self._get_response_dict( + self._sync_request( + endpoint="objects/storages/{}/snapshots/{}".format( + storage_dict["object_uuid"], snapshot_uuid + ) + ) + ) + + self.destroy_volume_snapshot(self._to_volume_snapshot(snapshot_dict)) + + return self._to_node_image( + self._get_resource( + "templates", self.connection.poll_response_initial.object["object_uuid"] + ) + ) + + def destroy_node(self, node, ex_destroy_associated_resources=False): + """ + Destroy node. + + :param node: Node object. + :type node: :class:`.Node` + + :param ex_destroy_associated_resources: True to destroy associated + resources such as storage volumes and IPs. + :type ex_destroy_associated_resources: ``bool`` + + :return: True if the destroy was successful, otherwise False. + :rtype: ``bool`` + """ + if ex_destroy_associated_resources: + associated_volumes = self.ex_list_volumes_for_node(node=node) + associated_ips = self.ex_list_ips_for_node(node=node) + + # 1. Delete the server itself + result = self._sync_request(endpoint="objects/servers/{}".format(node.id), method="DELETE") + + # 2. Destroy associated resources (if requested) + if ex_destroy_associated_resources: + for volume in associated_volumes: + self.destroy_volume(volume=volume) + + for ip in associated_ips: + self.ex_destroy_ip(ip=ip) + + return result.status == 204 + + def destroy_volume(self, volume): + """ + Delete volume. + + :param volume: Volume to be destroyed. + :type volume: :class:`.StorageVolume` + + :return: True if the destroy was successful, otherwise False. + :rtype: ``bool`` + """ + result = self._sync_request( + endpoint="objects/storages/{}".format(volume.id), method="DELETE" + ) + return result.status == 204 + + def ex_destroy_ip(self, ip): + """ + Delete an ip. + + :param ip: IP object. + :type ip: :class:`.GridscaleIp` + + :return: ``True`` if delete_image was successful, ``False`` otherwise. + :rtype: ``bool`` + """ + result = self._sync_request(endpoint="objects/ips/{}".format(ip.id), method="DELETE") + return result.status == 204 + + def destroy_volume_snapshot(self, snapshot): + """ + Destroy a snapshot. + + :param snapshot: The snapshot to delete. + :type snapshot: :class:'.VolumeSnapshot` + + :return: True if the destroy was successful, otherwise False. + :rtype: ``bool`` + """ + result = self._sync_request( + endpoint="objects/storages/" + "{}/snapshots/{}/".format(snapshot.extra["parent_uuid"], snapshot.id), + method="DELETE", + ) + return result.status == 204 + + def ex_destroy_network(self, network): + """ + Delete network. + + :param network: Network object. + :type network: :class:`.GridscaleNetwork` + + :return: ``True`` if destroyed successfully, otherwise ``False`` + :rtype: ``bool`` + """ + result = self._sync_request( + endpoint="objects/networks/{}".format(network.id), method="DELETE" + ) + return result.status == 204 + + def delete_image(self, node_image): + """ + Destroy an image. + + :param node_image: Node image object. + :type node_image: :class:`.NodeImage` + + :return: True if the destroy was successful, otherwise False + :rtype: ``bool`` + + """ + result = self._sync_request( + endpoint="objects/templates/{}".format(node_image.id), method="DELETE" + ) + return result.status == 204 + + def ex_rename_node(self, node, name): + """ + Modify node name. + + :param name: New node name. + :type name: ``str`` + + :param node: Node + :type node: :class:`.Node` + + :return: ``True`` or ``False`` + :rtype: ``bool`` + """ + result = self._sync_request( + data={"name": name}, + endpoint="objects/servers/{}".format(node.id), + method="PATCH", + ) + return result.status == 204 + + def ex_rename_volume(self, volume, name): + """ + Modify storage volume name + + :param volume: Storage. + :type volume: :class:.`StorageVolume` + + :param name: New storage name. + :type name: ``str`` + + :return: ``True`` or ``False`` + :rtype: ``bool`` + """ + result = self._sync_request( + data={"name": name}, + endpoint="objects/storages/{}".format(volume.id), + method="PATCH", + ) + return result.status == 204 + + def ex_rename_network(self, network, name): + """ + Modify networks name. + + :param network: Network. + :type network: :class:`.GridscaleNetwork` + + :param name: New network name. + :type name: ``str`` + + :return: ``True`` or ``False`` + :rtype: ``bool`` + """ + result = self._sync_request( + data={"name": name}, + endpoint="objects/networks/{}".format(network.id), + method="PATCH", + ) + return result.status == 204 + + def reboot_node(self, node, ex_sleep_interval=3): + """ + Reboot a node. + + :param node: Node object. + :type node: :class:`.Node` + + :return: True if the reboot was successful, otherwise False. + :rtype: ``bool`` + + :keyword ex_sleep_interval: time to let the shutdown process finish + :type ex_sleep_interval: ``int`` + + """ + + if node.extra["power"] is True: + data = dict({"power": False}) + self._sync_request( + data=data, + endpoint="objects/servers/{}/power".format(node.id), + method="PATCH", + ) + time.sleep(ex_sleep_interval) + + data = dict({"power": True}) + self._sync_request( + data=data, + endpoint="objects/servers/{}/power".format(node.id), + method="PATCH", + ) + return True + + else: + return False + + def import_key_pair_from_string(self, name, key_material): + data = {"name": name, "sshkey": key_material} + result = self._sync_request(endpoint="objects/sshkeys/", method="POST", data=data) + key = self._to_key(result.object, name=name, sshkey=key_material) + return key + + def list_key_pairs(self): + """ + List all the available key pair objects. + + :rtype: ``list``of :class:`.KeyPair` objects + """ + keys = [] + result = self._sync_request(endpoint="objects/sshkeys/") + for key, value in self._get_response_dict(result).items(): + key = self._to_key(value) + keys.append(key) + return keys + + def get_image(self, image_id): + """ + Get an image based on an image_id. + + :param image_id: Image identifier. + :type image_id: ``str`` + + :return: A NodeImage object. + :rtype: :class:`.NodeImage` + """ + + response_dict = self._get_response_dict( + self._sync_request(endpoint="/objects/templates/{}".format(image_id)) + ) + + return self._to_node_image(response_dict) + + def start_node(self, node): + result = self._sync_request( + data={"power": True}, + endpoint="objects/servers/{}/power".format(node.id), + method="PATCH", + ) + + return result.status == 204 + + def ex_start_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.start_node(node=node) + + def ex_link_isoimage_to_node(self, node, isoimage): + """ + link and isoimage to a node + + :param node: Node you want to link the iso image to + :type node: ``object`` + + :param isoimage: isomiage you want to link + :type isoimage: ``object`` + + :return: None -> success + :rtype: ``None`` + """ + result = self._sync_request( + data={"object_uuid": isoimage.id}, + endpoint="objects/servers/{}/isoimages/".format(node.id), + method="POST", + ) + return result + + def attach_volume( + self, + node, + volume, + device=None, + ): + """ + Attaches volume to node. + + :param node: Node to attach volume to. + :type node: :class:`.Node` + + :param volume: Volume to attach. + :type volume: :class:`.StorageVolume` + + :rytpe: ``bool`` + """ + result = self._sync_request( + data={"object_uuid": volume.id}, + endpoint="objects/servers/{}/storages/".format(node.id), + method="POST", + ) + return result.status == 204 + + def ex_link_network_to_node(self, node, network): + """ + Link a network to a node. + + :param node: Node object to link networks to. + :type node: :class:`.Node` + + :param network: Network you want to link. + :type network: :class:`.GridscaleNetwork` + + :return: ``True`` if linked successfully, otherwise ``False`` + :rtype: ``bool`` + """ + result = self._sync_request( + data={"object_uuid": network.id}, + endpoint="objects/servers/{}/networks/".format(node.id), + method="POST", + ) + return result.status == 204 + + def ex_link_ip_to_node(self, node, ip): + """ + links a existing ip with a node + + :param node: node object + :type node: ``object`` + + :param ip: ip object + :type ip: ``object`` + + :return: Request ID + :rtype: ``str`` + """ + result = self._sync_request( + data={"object_uuid": ip.id}, + endpoint="objects/servers/{}/ips/".format(node.id), + method="POST", + ) + return result + + def ex_unlink_isoimage_from_node(self, node, isoimage): + """ + unlink isoimages from server + + :param node: node you want to unlink the image from + :type node: ``object`` + + :param isoimage: isoimage you want to unlink + :type isoimage: ``object`` + + :return: None -> success + :rtype: ``None`` + """ + result = self._sync_request( + endpoint="objects/servers/{}/isoimages/{}".format(node.id, isoimage.id), + method="DELETE", + ) + return result + + def ex_unlink_ip_from_node(self, node, ip): + """ + unlink ips from server + + :param node: node you want to unlink the ip from + :type node: ``object`` + + :param ip: the ip you want to unlink + :type ip: ``object`` + + :return: None -> success + :rtype: ``None`` + """ + result = self._sync_request( + endpoint="objects/servers/{}/ips/{}".format(node.id, ip.id), method="DELETE" + ) + return result + + def ex_unlink_network_from_node(self, node, network): + """ + Unlink network from node. + + :param node: Node you want to unlink from network. + :type node: :class:`.Node` + + :param network: Network you want to unlink. + :type network: :class:`.GridscaleNetwork + + :return: ``True`` if unlink was successful, otherwise ``False`` + :rtype: ``bool`` + """ + result = self._sync_request( + endpoint="objects/servers/{}/networks/{}".format(node.id, network.id), + method="DELETE", + ) + return result.status == 204 + + def detach_volume(self, volume): + """ + Detaches a volume from a node. + + :param volume: Volume to be detached + :type volume: :class:`.StorageVolume` + + :rtype: ``bool`` + """ + node = volume.extra["relations"]["servers"][0] + result = self._sync_request( + endpoint="objects/servers/{}/storages/{}".format(node["object_uuid"], volume.id), + method="DELETE", + ) + return result.status == 204 + + def ex_storage_rollback(self, volume, snapshot, rollback): + """ + initiate a rollback on your storage + + :param volume: storage uuid + :type volume: ``string`` + + :param snapshot: snapshot uuid + :type snapshot: ``string`` + + :param rollback: variable + :type rollback: ``bool`` + + :return: RequestID + :rtype: ``str`` + """ + result = self._sync_request( + data={"rollback": rollback}, + endpoint="objects/storages/{}/snapshots/" "{}/rollback".format(volume.id, snapshot.id), + method="PATCH", + ) + return result + + def ex_list_volumes_for_node(self, node): + """ + Return a list of associated volumes for the provided node. + + :rtype: ``list`` of :class:`StorageVolume` + """ + volumes = self.list_volumes() + + result = [] + for volume in volumes: + related_servers = volume.extra.get("relations", {}).get("servers", []) + for server in related_servers: + if server["object_uuid"] == node.id: + result.append(volume) + + return result + + def ex_list_ips_for_node(self, node): + """ + Return a list of associated IPs for the provided node. + + :rype: ``list`` of :class:`GridscaleIp` + """ + ips = self.ex_list_ips() + + result = [] + for ip in ips: + related_servers = ip.extra.get("relations", {}).get("servers", []) + for server in related_servers: + # TODO: This is not consistent with volumes where key is + # called "object_uuid" + if server["server_uuid"] == node.id: + result.append(ip) + + return result + + def _to_node(self, data): + extra_keys = ["cores", "power", "memory", "current_price", "relations"] + + extra = self._extract_values_to_dict(data=data, keys=extra_keys) + ips = [] + + for diction in data["relations"]["public_ips"]: + ips.append(diction["ip"]) + + state = "" + + if data["power"] is True: + state = NodeState.RUNNING + else: + state = NodeState.STOPPED + + node = Node( + id=data["object_uuid"], + name=data["name"], + state=state, + public_ips=ips, + created_at=parse_date(data["create_time"]), + private_ips=None, + driver=self.connection.driver, + extra=extra, + ) + + return node + + def _to_volume(self, data): + extra_keys = ["create_time", "current_price", "storage_type", "relations"] + + extra = self._extract_values_to_dict(data=data, keys=extra_keys) + + storage = StorageVolume( + id=data["object_uuid"], + name=data["name"], + size=data["capacity"], + driver=self.connection.driver, + extra=extra, + ) + + return storage + + def _to_volume_snapshot(self, data): + extra_keys = [ + "labels", + "status", + "usage_in_minutes", + "location_country", + "current_price", + "parent_uuid", + ] + + extra = self._extract_values_to_dict(data=data, keys=extra_keys) + + volume_snapshot = VolumeSnapshot( + id=data["object_uuid"], + driver=self.connection.driver, + size=data["capacity"], + extra=extra, + created=parse_date(data["create_time"]), + state=StorageVolumeState.AVAILABLE, + name=data["name"], + ) + + return volume_snapshot + + def _to_location(self, data): + location = NodeLocation( + id=data["object_uuid"], + name=data["name"], + country=data["country"], + driver=self.connection.driver, + ) + return location + + def _to_ip(self, data): + extra_keys = [ + "create_time", + "current_price", + "name", + "relations", + "reverse_dns", + "status", + ] + extra = self._extract_values_to_dict(data=data, keys=extra_keys) + + ip = GridscaleIp( + id=data["object_uuid"], + family=data["family"], + prefix=data["prefix"], + create_time=data["create_time"], + address=data["ip"], + extra=extra, + ) + + return ip + + def _to_network(self, data): + network = GridscaleNetwork( + id=data["object_uuid"], + name=data["name"], + create_time=data["create_time"], + status=data["status"], + relations=data["relations"], + ) + return network + + def _to_node_image(self, data): + extra_keys = [ + "capacity", + "create_time", + "labels", + "ostype", + "location_name", + "private", + "status", + "usage_in_minutes", + "version", + ] + + extra = self._extract_values_to_dict(data=data, keys=extra_keys) + + template = NodeImage( + id=data["object_uuid"], + name=data["name"], + driver=self.connection.driver, + extra=extra, + ) + + return template + + def _to_key(self, data, name=None, sshkey=None): + extra = {"uuid": data["object_uuid"], "labels": data.get("labels", [])} + + name = data.get("name", name) + sshkey = data.get("sshkey", sshkey) + + key = KeyPair( + name=name, + fingerprint=data["object_uuid"], + public_key=sshkey, + private_key=None, + extra=extra, + driver=self.connection.driver, + ) + + return key + + def _extract_values_to_dict(self, data, keys): + """ + Extract extra values to dict. + + :param data: dict to extract values from. + :type data: ``dict`` + :param keys: keys to extract + :type keys: ``List`` + :return: dictionary containing extra values + :rtype: ``dict`` + """ + + result = {} + + for key in keys: + if key == "memory": + result[key] = data[key] * 1024 + else: + result[key] = data[key] + + return result + + def _get_response_dict(self, raw_response): + """ + + Get the actual response dictionary. + + :param raw_response: Nested dictionary. + :type raw_response: ``dict`` + + :return: Not-nested dictionary. + :rtype: ``dict`` + """ + return list(raw_response.object.values())[0] + + def _get_resource(self, endpoint_suffix, object_uuid): + """ + Get specific uuid specific resource. + + :param endpoint_suffix: Endpoint resource e.g. servers/. + :type endpoint_suffix: ``str`` + :param object_uuid: Uuid of resource to be pulled. + :type object_uuid: ``str`` + :return: Response dictionary. + :rtype: nested ``dict`` + """ + data = self._sync_request(endpoint="objects/{}/{}".format(endpoint_suffix, object_uuid)) + + data = self._get_response_dict(data) + + return data diff --git a/libcloud/compute/drivers/gridspot.py b/libcloud/compute/drivers/gridspot.py deleted file mode 100644 index 856b0688f2..0000000000 --- a/libcloud/compute/drivers/gridspot.py +++ /dev/null @@ -1,127 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from libcloud.compute.base import NodeDriver, Node -from libcloud.compute.base import NodeState -from libcloud.common.base import ConnectionKey, JsonResponse -from libcloud.compute.types import Provider -from libcloud.common.types import InvalidCredsError - - -class GridspotAPIException(Exception): - def __str__(self): - return self.args[0] - - def __repr__(self): - return "" % (self.args[0]) - - -class GridspotResponse(JsonResponse): - """ - Response class for Gridspot - """ - def parse_body(self): - body = super(GridspotResponse, self).parse_body() - - if 'exception_name' in body and body['exception_name']: - raise GridspotAPIException(body['exception_name']) - - return body - - def parse_error(self): - # Gridspot 404s on invalid api key or instance_id - raise InvalidCredsError("Invalid api key/instance_id") - - -class GridspotConnection(ConnectionKey): - """ - Connection class to connect to Gridspot's API servers - """ - - host = 'gridspot.com' - responseCls = GridspotResponse - - def add_default_params(self, params): - params['api_key'] = self.key - return params - - -class GridspotNodeDriver(NodeDriver): - """ - Gridspot (http://www.gridspot.com/) node driver. - """ - - type = Provider.GRIDSPOT - name = 'Gridspot' - website = 'http://www.gridspot.com/' - connectionCls = GridspotConnection - NODE_STATE_MAP = { - 'Running': NodeState.RUNNING, - 'Starting': NodeState.PENDING - } - - def list_nodes(self): - data = self.connection.request( - '/compute_api/v1/list_instances').object - return [self._to_node(n) for n in data['instances']] - - def destroy_node(self, node): - data = {'instance_id': node.id} - self.connection.request('/compute_api/v1/stop_instance', data).object - return True - - def _get_node_state(self, state): - result = self.NODE_STATE_MAP.get(state, NodeState.UNKNOWN) - return result - - def _add_int_param(self, params, data, field): - if data[field]: - try: - params[field] = int(data[field]) - except: - pass - - def _to_node(self, data): - port = None - ip = None - - state = self._get_node_state(data['current_state']) - - if data['vm_ssh_wan_ip_endpoint'] != 'null': - parts = data['vm_ssh_wan_ip_endpoint'].split(':') - ip = parts[0] - port = int(parts[1]) - - extra_params = { - 'winning_bid_id': data['winning_bid_id'], - 'port': port - } - - # Spec is vague and doesn't indicate if these will always be present - self._add_int_param(extra_params, data, 'vm_num_logical_cores') - self._add_int_param(extra_params, data, 'vm_num_physical_cores') - self._add_int_param(extra_params, data, 'vm_ram') - self._add_int_param(extra_params, data, 'start_state_time') - self._add_int_param(extra_params, data, 'ended_state_time') - self._add_int_param(extra_params, data, 'running_state_time') - - return Node( - id=data['instance_id'], - name=data['instance_id'], - state=state, - public_ips=[ip], - private_ips=[], - driver=self.connection.driver, - extra=extra_params) diff --git a/libcloud/compute/drivers/hostvirtual.py b/libcloud/compute/drivers/hostvirtual.py deleted file mode 100644 index 116a2116c7..0000000000 --- a/libcloud/compute/drivers/hostvirtual.py +++ /dev/null @@ -1,446 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -libcloud driver for the Host Virtual Inc. (VR) API -Home page https://www.hostvirtual.com/ -""" - -import time -import re - -try: - import simplejson as json -except ImportError: - import json - -from libcloud.common.hostvirtual import HostVirtualResponse -from libcloud.common.hostvirtual import HostVirtualConnection -from libcloud.common.hostvirtual import HostVirtualException -from libcloud.compute.providers import Provider -from libcloud.compute.types import NodeState -from libcloud.compute.base import Node, NodeDriver -from libcloud.compute.base import NodeImage, NodeSize, NodeLocation -from libcloud.compute.base import NodeAuthSSHKey, NodeAuthPassword - -API_ROOT = '' - -NODE_STATE_MAP = { - 'BUILDING': NodeState.PENDING, - 'PENDING': NodeState.PENDING, - 'RUNNING': NodeState.RUNNING, # server is powered up - 'STOPPING': NodeState.REBOOTING, - 'REBOOTING': NodeState.REBOOTING, - 'STARTING': NodeState.REBOOTING, - 'TERMINATED': NodeState.TERMINATED, # server is powered down - 'STOPPED': NodeState.STOPPED -} - -DEFAULT_NODE_LOCATION_ID = 21 - - -class HostVirtualComputeResponse(HostVirtualResponse): - pass - - -class HostVirtualComputeConnection(HostVirtualConnection): - responseCls = HostVirtualComputeResponse - - -class HostVirtualNodeDriver(NodeDriver): - type = Provider.HOSTVIRTUAL - name = 'HostVirtual' - website = 'http://www.hostvirtual.com' - connectionCls = HostVirtualComputeConnection - features = {'create_node': ['ssh_key', 'password']} - - def __init__(self, key, secure=True, host=None, port=None): - self.location = None - super(HostVirtualNodeDriver, self).__init__(key=key, secure=secure, - host=host, port=port) - - def list_nodes(self): - try: - result = self.connection.request( - API_ROOT + '/cloud/servers/').object - except HostVirtualException: - return [] - nodes = [] - for value in result: - node = self._to_node(value) - nodes.append(node) - return nodes - - def list_locations(self): - result = self.connection.request(API_ROOT + '/cloud/locations/').object - locations = [] - for dc in result: - locations.append(NodeLocation( - dc["id"], - dc["name"], - dc["name"].split(',')[1].replace(" ", ""), # country - self)) - return locations - - def list_sizes(self, location=None): - params = {} - if location is not None: - params = {'location': location.id} - result = self.connection.request( - API_ROOT + '/cloud/sizes/', - params=params).object - sizes = [] - for size in result: - n = NodeSize(id=size['plan_id'], - name=size['plan'], - ram=size['ram'], - disk=size['disk'], - bandwidth=size['transfer'], - price=size['price'], - driver=self.connection.driver) - sizes.append(n) - return sizes - - def list_images(self): - result = self.connection.request(API_ROOT + '/cloud/images/').object - images = [] - for image in result: - i = NodeImage(id=image["id"], - name=image["os"], - driver=self.connection.driver, - extra=image) - del i.extra['id'] - del i.extra['os'] - images.append(i) - return images - - def create_node(self, name, image, size, **kwargs): - """Creates a node - Example of node creation with ssh key deployed - >>> from libcloud.compute.base import NodeAuthSSHKey - >>> key = open('/home/user/.ssh/id_rsa.pub').read() - >>> auth = NodeAuthSSHKey(pubkey=key) - >>> from libcloud.compute.providers import get_driver; - >>> driver = get_driver('hostvirtual') - >>> conn = driver('API_KEY') - >>> image = conn.list_images()[1] - >>> size = conn.list_sizes()[0] - >>> location = conn.list_locations()[1] - >>> name = 'markos-dev' - >>> node = conn.create_node(name, image, size, auth=auth, - location=location) - """ - - dc = None - - auth = self._get_and_check_auth(kwargs.get('auth')) - - if not self._is_valid_fqdn(name): - raise HostVirtualException( - 500, "Name should be a valid FQDN (e.g, hostname.example.com)") - - # simply order a package first - pkg = self.ex_order_package(size) - - if 'location' in kwargs: - dc = kwargs['location'].id - else: - dc = DEFAULT_NODE_LOCATION_ID - - # create a stub node - stub_node = self._to_node({ - 'mbpkgid': pkg['id'], - 'status': 'PENDING', - 'fqdn': name, - 'plan_id': size.id, - 'os_id': image.id, - 'location_id': dc - }) - - # provisioning a server using the stub node - self.ex_provision_node(node=stub_node, auth=auth) - node = self._wait_for_node(stub_node.id) - if getattr(auth, 'generated', False): - node.extra['password'] = auth.password - - return node - - def reboot_node(self, node): - params = {'force': 0, 'mbpkgid': node.id} - result = self.connection.request( - API_ROOT + '/cloud/server/reboot', - data=json.dumps(params), - method='POST').object - - return bool(result) - - def destroy_node(self, node): - params = { - 'mbpkgid': node.id, - # 'reason': 'Submitted through Libcloud API' - } - - result = self.connection.request( - API_ROOT + '/cloud/cancel', data=json.dumps(params), - method='POST').object - - return bool(result) - - def ex_list_packages(self): - """ - List the server packages. - - """ - - try: - result = self.connection.request( - API_ROOT + '/cloud/packages/').object - except HostVirtualException: - return [] - pkgs = [] - for value in result: - pkgs.append(value) - return pkgs - - def ex_order_package(self, size): - """ - Order a server package. - - :param size: - :type node: :class:`NodeSize` - - :rtype: ``str`` - """ - - params = {'plan': size.name} - pkg = self.connection.request(API_ROOT + '/cloud/buy/', - data=json.dumps(params), - method='POST').object - - return pkg - - def ex_cancel_package(self, node): - """ - Cancel a server package. - - :param node: Node which should be used - :type node: :class:`Node` - - :rtype: ``str`` - """ - - params = {'mbpkgid': node.id} - result = self.connection.request(API_ROOT + '/cloud/cancel/', - data=json.dumps(params), - method='POST').object - - return result - - def ex_unlink_package(self, node): - """ - Unlink a server package from location. - - :param node: Node which should be used - :type node: :class:`Node` - - :rtype: ``str`` - """ - - params = {'mbpkgid': node.id} - result = self.connection.request(API_ROOT + '/cloud/unlink/', - data=json.dumps(params), - method='POST').object - - return result - - def ex_get_node(self, node_id): - """ - Get a single node. - - :param node_id: id of the node that we need the node object for - :type node_id: ``str`` - - :rtype: :class:`Node` - """ - - params = {'mbpkgid': node_id} - result = self.connection.request( - API_ROOT + '/cloud/server', params=params).object - node = self._to_node(result) - return node - - def ex_stop_node(self, node): - """ - Stop a node. - - :param node: Node which should be used - :type node: :class:`Node` - - :rtype: ``bool`` - """ - params = {'force': 0, 'mbpkgid': node.id} - result = self.connection.request( - API_ROOT + '/cloud/server/shutdown', - data=json.dumps(params), - method='POST').object - - return bool(result) - - def ex_start_node(self, node): - """ - Start a node. - - :param node: Node which should be used - :type node: :class:`Node` - - :rtype: ``bool`` - """ - params = {'mbpkgid': node.id} - result = self.connection.request( - API_ROOT + '/cloud/server/start', - data=json.dumps(params), - method='POST').object - - return bool(result) - - def ex_provision_node(self, **kwargs): - """ - Provision a server on a VR package and get it booted - - :keyword node: node which should be used - :type node: :class:`Node` - - :keyword image: The distribution to deploy on your server (mandatory) - :type image: :class:`NodeImage` - - :keyword auth: an SSH key or root password (mandatory) - :type auth: :class:`NodeAuthSSHKey` or :class:`NodeAuthPassword` - - :keyword location: which datacenter to create the server in - :type location: :class:`NodeLocation` - - :return: Node representing the newly built server - :rtype: :class:`Node` - """ - - node = kwargs['node'] - - if 'image' in kwargs: - image = kwargs['image'] - else: - image = node.extra['image'] - - params = { - 'mbpkgid': node.id, - 'image': image, - 'fqdn': node.name, - 'location': node.extra['location'], - } - - auth = kwargs['auth'] - - ssh_key = None - password = None - if isinstance(auth, NodeAuthSSHKey): - ssh_key = auth.pubkey - params['ssh_key'] = ssh_key - elif isinstance(auth, NodeAuthPassword): - password = auth.password - params['password'] = password - - if not ssh_key and not password: - raise HostVirtualException( - 500, "SSH key or Root password is required") - - try: - result = self.connection.request(API_ROOT + '/cloud/server/build', - data=json.dumps(params), - method='POST').object - return bool(result) - except HostVirtualException: - self.ex_cancel_package(node) - - def ex_delete_node(self, node): - """ - Delete a node. - - :param node: Node which should be used - :type node: :class:`Node` - - :rtype: ``bool`` - """ - - params = {'mbpkgid': node.id} - result = self.connection.request( - API_ROOT + '/cloud/server/delete', data=json.dumps(params), - method='POST').object - - return bool(result) - - def _to_node(self, data): - state = NODE_STATE_MAP[data['status']] - public_ips = [] - private_ips = [] - extra = {} - - if 'plan_id' in data: - extra['size'] = data['plan_id'] - if 'os_id' in data: - extra['image'] = data['os_id'] - if 'fqdn' in data: - extra['fqdn'] = data['fqdn'] - if 'location_id' in data: - extra['location'] = data['location_id'] - if 'ip' in data: - public_ips.append(data['ip']) - - node = Node(id=data['mbpkgid'], name=data['fqdn'], state=state, - public_ips=public_ips, private_ips=private_ips, - driver=self.connection.driver, extra=extra) - return node - - def _wait_for_node(self, node_id, timeout=30, interval=5.0): - """ - :param node_id: ID of the node to wait for. - :type node_id: ``int`` - - :param timeout: Timeout (in seconds). - :type timeout: ``int`` - - :param interval: How long to wait (in seconds) between each attempt. - :type interval: ``float`` - - :return: Node representing the newly built server - :rtype: :class:`Node` - """ - # poll until we get a node - for i in range(0, timeout, int(interval)): - try: - node = self.ex_get_node(node_id) - return node - except HostVirtualException: - time.sleep(interval) - - raise HostVirtualException(412, 'Timeout on getting node details') - - def _is_valid_fqdn(self, fqdn): - if len(fqdn) > 255: - return False - if fqdn[-1] == ".": - fqdn = fqdn[:-1] - valid = re.compile("(?!-)[A-Z\d-]{1,63}(? 1: - return all(valid.match(x) for x in fqdn.split(".")) - else: - return False diff --git a/libcloud/compute/drivers/hpcloud.py b/libcloud/compute/drivers/hpcloud.py deleted file mode 100644 index 5a50d1f9e3..0000000000 --- a/libcloud/compute/drivers/hpcloud.py +++ /dev/null @@ -1,99 +0,0 @@ -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -HP Public cloud driver which is essentially just a small wrapper around -OpenStack driver. -""" - -from libcloud.compute.types import Provider, LibcloudError -from libcloud.compute.drivers.openstack import OpenStack_1_1_Connection -from libcloud.compute.drivers.openstack import OpenStack_1_1_NodeDriver - - -__all__ = [ - 'HPCloudNodeDriver' -] - -ENDPOINT_ARGS_MAP = { - 'region-a.geo-1': { - 'service_type': 'compute', - 'name': 'Compute', - 'region': 'region-a.geo-1' - }, - 'region-b.geo-1': { - 'service_type': 'compute', - 'name': 'Compute', - 'region': 'region-b.geo-1' - }, -} - -AUTH_URL_TEMPLATE = 'https://%s.identity.hpcloudsvc.com:35357/v2.0/tokens' - - -class HPCloudConnection(OpenStack_1_1_Connection): - _auth_version = '2.0_password' - - def __init__(self, *args, **kwargs): - self.region = kwargs.pop('region', None) - self.get_endpoint_args = kwargs.pop('get_endpoint_args', None) - super(HPCloudConnection, self).__init__(*args, **kwargs) - - def get_endpoint(self): - if not self.get_endpoint_args: - raise LibcloudError( - 'HPCloudConnection must have get_endpoint_args set') - - if '2.0_password' in self._auth_version: - ep = self.service_catalog.get_endpoint(**self.get_endpoint_args) - else: - raise LibcloudError( - 'Auth version "%s" not supported' % (self._auth_version)) - - public_url = ep.url - - if not public_url: - raise LibcloudError('Could not find specified endpoint') - - return public_url - - -class HPCloudNodeDriver(OpenStack_1_1_NodeDriver): - name = 'HP Public Cloud (Helion)' - website = 'http://www.hpcloud.com/' - connectionCls = HPCloudConnection - type = Provider.HPCLOUD - - def __init__(self, key, secret, tenant_name, secure=True, - host=None, port=None, region='region-b.geo-1', **kwargs): - """ - Note: tenant_name argument is required for HP cloud. - """ - self.tenant_name = tenant_name - super(HPCloudNodeDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, - region=region, - **kwargs) - - def _ex_connection_class_kwargs(self): - endpoint_args = ENDPOINT_ARGS_MAP[self.region] - - kwargs = self.openstack_connection_kwargs() - kwargs['region'] = self.region - kwargs['get_endpoint_args'] = endpoint_args - kwargs['ex_force_auth_url'] = AUTH_URL_TEMPLATE % (self.region) - kwargs['ex_tenant_name'] = self.tenant_name - - return kwargs diff --git a/libcloud/compute/drivers/ibm_sce.py b/libcloud/compute/drivers/ibm_sce.py deleted file mode 100644 index 66cbec66d5..0000000000 --- a/libcloud/compute/drivers/ibm_sce.py +++ /dev/null @@ -1,753 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Driver for IBM SmartCloud Enterprise - -Formerly known as: -- IBM Developer Cloud -- IBM Smart Business Development and Test on the IBM Cloud -- IBM SmartBusiness Cloud -""" - -import base64 -import time - -from libcloud.utils.py3 import urlencode -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import b - -from libcloud.common.base import XmlResponse, ConnectionUserAndKey -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.compute.types import NodeState, Provider -from libcloud.compute.base import NodeDriver, Node, NodeImage, \ - NodeSize, NodeLocation, NodeAuthSSHKey, StorageVolume - -HOST = 'www-147.ibm.com' -REST_BASE = '/computecloud/enterprise/api/rest/20100331' - - -class IBMResponse(XmlResponse): - def success(self): - return int(self.status) == 200 - - def parse_error(self): - if int(self.status) == 401: - if not self.body: - raise InvalidCredsError(str(self.status) + ': ' + self.error) - else: - raise InvalidCredsError(self.body) - return self.body - - -class IBMConnection(ConnectionUserAndKey): - """ - Connection class for the IBM SmartCloud Enterprise driver - """ - - host = HOST - responseCls = IBMResponse - - def add_default_headers(self, headers): - headers['Accept'] = 'text/xml' - headers['Authorization'] = ('Basic %s' % (base64.b64encode( - b('%s:%s' % (self.user_id, self.key))).decode('utf-8'))) - if 'Content-Type' not in headers: - headers['Content-Type'] = 'text/xml' - return headers - - def encode_data(self, data): - return urlencode(data) - - -class IBMNodeLocation(NodeLocation): - """ - Extends the base LibCloud NodeLocation to contain additional attributes - """ - def __init__(self, id, name, country, driver, extra=None): - self.id = str(id) - self.name = name - self.country = country - self.driver = driver - self.extra = extra or {} - - def __repr__(self): - return ('' % - (self.id, self.name, self.country, self.driver.name, - self.extra)) - - -class VolumeState(object): - """ - The SCE specific states for a storage volume - """ - NEW = '0' - CREATING = '1' - DELETING = '2' - DELETED = '3' - DETACHED = '4' - ATTACHED = '5' - FAILED = '6' - DELETE_PENDING = '7' - BEING_CLONED = '8' - CLONING = '9' - ATTACHING = '10' - DETACHING = '11' - ATTACHIED = '12' - IMPORTING = '13' - TRANSFER_RETRYING = '14' - - -class VolumeOffering(object): - """ - An SCE specific storage volume offering class. - The volume offering ID is needed to create a volume. - Volume offering IDs are different for each data center. - """ - def __init__(self, id, name, location, extra=None): - self.id = id - self.location = location - self.name = name - self.extra = extra or {} - - def __repr__(self): - return ('' % - (self.id, self.location, self.name, self.extra)) - - -class Address(object): - """ - A reserved IP address that can be attached to an instance. - Properties: id, ip, state, options(location, type, created_time, state, - hostname, instance_ids, vlan, owner, - mode, offering_id) - """ - def __init__(self, id, ip, state, options): - self.id = id - self.ip = ip - self.state = state - self.options = options - - def __repr__(self): - return ('' % - (self.id, self.ip, self.state, self.options)) - - -class IBMNodeDriver(NodeDriver): - """ - Node driver for IBM SmartCloud Enterprise - """ - connectionCls = IBMConnection - type = Provider.IBM - name = "IBM SmartCloud Enterprise" - website = 'http://ibm.com/services/us/en/cloud-enterprise/' - - NODE_STATE_MAP = { - 0: NodeState.PENDING, # New - 1: NodeState.PENDING, # Provisioning - 2: NodeState.TERMINATED, # Failed - 3: NodeState.TERMINATED, # Removed - 4: NodeState.TERMINATED, # Rejected - 5: NodeState.RUNNING, # Active - 6: NodeState.UNKNOWN, # Unknown - 7: NodeState.PENDING, # Deprovisioning - 8: NodeState.REBOOTING, # Restarting - 9: NodeState.PENDING, # Starting - 10: NodeState.PENDING, # Stopping - 11: NodeState.TERMINATED, # Stopped - 12: NodeState.PENDING, # Deprovision Pending - 13: NodeState.PENDING, # Restart Pending - 14: NodeState.PENDING, # Attaching - 15: NodeState.PENDING, # Detaching - } - - def create_node(self, **kwargs): - """ - Creates a node in the IBM SmartCloud Enterprise. - - See :class:`NodeDriver.create_node` for more keyword args. - - @inherits: :class:`NodeDriver.create_node` - - :keyword auth: Name of the pubkey to use. When constructing - :class:`NodeAuthSSHKey` instance, 'pubkey' argument must be the - name of the public key to use. You chose this name when creating - a new public key on the IBM server. - :type auth: :class:`NodeAuthSSHKey` - - :keyword ex_configurationData: Image-specific configuration - parameters. Configuration parameters are defined in the parameters - .xml file. The URL to this file is defined in the NodeImage at - extra[parametersURL]. - Note: This argument must be specified when launching a Windows - instance. It must contain 'UserName' and 'Password' keys. - :type ex_configurationData: ``dict`` - """ - - # Compose headers for message body - data = {} - data.update({'name': kwargs['name']}) - data.update({'imageID': kwargs['image'].id}) - data.update({'instanceType': kwargs['size'].id}) - if 'location' in kwargs: - data.update({'location': kwargs['location'].id}) - else: - data.update({'location': '1'}) - if 'auth' in kwargs and isinstance(kwargs['auth'], NodeAuthSSHKey): - data.update({'publicKey': kwargs['auth'].pubkey}) - if 'ex_configurationData' in kwargs: - configurationData = kwargs['ex_configurationData'] - if configurationData: - for key in configurationData.keys(): - data.update({key: configurationData.get(key)}) - - # Send request! - resp = self.connection.request( - action=REST_BASE + '/instances', - headers={'Content-Type': 'application/x-www-form-urlencoded'}, - method='POST', - data=data).object - return self._to_nodes(resp)[0] - - def create_volume(self, size, name, location, **kwargs): - """ - Create a new block storage volume (virtual disk) - - :param size: Size of volume in gigabytes (required). - Find out the possible sizes from the - offerings/storage REST interface - :type size: ``int`` - - :keyword name: Name of the volume to be created (required) - :type name: ``str`` - - :keyword location: Which data center to create a volume in. If - empty, it will fail for IBM SmartCloud Enterprise - (required) - :type location: :class:`NodeLocation` - - :keyword snapshot: Not supported for IBM SmartCloud Enterprise - :type snapshot: ``str`` - - :keyword kwargs.format: Either RAW or EXT3 for IBM SmartCloud - Enterprise (optional) - :type kwargs.format: ``str`` - - :keyword kwargs.offering_id: The storage offering ID for IBM - SmartCloud Enterprise - Find this from the REST interface - storage/offerings. (optional) - :type kwargs.offering_id: ``str`` - - :keyword kwargs.source_disk_id: If cloning a volume, the storage - disk to make a copy from (optional) - :type kwargs.source_disk_id: ``str`` - - :keyword kwargs.storage_area_id: The id of the storage availability - area to create the volume in - (optional) - :type kwargs.storage_area_id: ``str`` - - :keyword kwargs.target_location_id: If cloning a volume, the - storage disk to make a copy - from (optional) - :type kwargs.target_location_id: ``str`` - - :return: The newly created :class:`StorageVolume`. - :rtype: :class:`StorageVolume` - """ - data = {} - data.update({'name': name}) - data.update({'size': size}) - data.update({'location': location}) - if (('format' in kwargs) and (kwargs['format'] is not None)): - data.update({'format': kwargs['format']}) - if (('offering_id' in kwargs) and (kwargs['offering_id'] is not None)): - data.update({'offeringID': kwargs['offering_id']}) - if (('storage_area_id' in kwargs) and - (kwargs['storage_area_id'] is not None)): - data.update({'storageAreaID': kwargs['storage_area_id']}) - if 'source_disk_id' in kwargs: - data.update({'sourceDiskID': kwargs['source_disk_id']}) - data.update({'type': 'clone'}) - if 'target_location_id' in kwargs: - data.update({'targetLocationID': kwargs['target_location_id']}) - resp = self.connection.request( - action=REST_BASE + '/storage', - headers={'Content-Type': 'application/x-www-form-urlencoded'}, - method='POST', - data=data).object - return self._to_volumes(resp)[0] - - def create_image(self, name, description=None, **kwargs): - """ - Create a new node image from an existing volume or image. - - :param name: Name of the image to be created (required) - :type name: ``str`` - - :param description: Description of the image to be created - :type description: ``str`` - - :keyword image_id: The ID of the source image if cloning the image - :type image_id: ``str`` - - :keyword volume_id: The ID of the storage volume if - importing the image - :type volume_id: ``str`` - - :return: The newly created :class:`NodeImage`. - :rtype: :class:`NodeImage` - """ - data = {} - data.update({'name': name}) - if description is not None: - data.update({'description': description}) - if (('image_id' in kwargs) and (kwargs['image_id'] is not None)): - data.update({'imageId': kwargs['image_id']}) - if (('volume_id' in kwargs) and (kwargs['volume_id'] is not None)): - data.update({'volumeId': kwargs['volume_id']}) - resp = self.connection.request( - action=REST_BASE + '/offerings/image', - headers={'Content-Type': 'application/x-www-form-urlencoded'}, - method='POST', - data=data).object - return self._to_images(resp)[0] - - def destroy_node(self, node): - url = REST_BASE + '/instances/%s' % (node.id) - status = int(self.connection.request(action=url, - method='DELETE').status) - return status == httplib.OK - - def destroy_volume(self, volume): - """ - Destroys a storage volume. - - :param volume: Volume to be destroyed - :type volume: :class:`StorageVolume` - - :rtype: ``bool`` - """ - url = REST_BASE + '/storage/%s' % (volume.id) - status = int(self.connection.request(action=url, - method='DELETE').status) - return status == httplib.OK - - def ex_destroy_image(self, image): - """ - Destroys an image. - - :param image: Image to be destroyed - :type image: :class:`NodeImage` - - :return: ``bool`` - """ - - url = REST_BASE + '/offerings/image/%s' % (image.id) - status = int(self.connection.request(action=url, - method='DELETE').status) - return status == 200 - - def attach_volume(self, node, volume): - """ - Attaches volume to node. - - :param node: Node to attach volume to - :type node: :class:`Node` - - :param volume: Volume to attach - :type volume: :class:`StorageVolume` - - :rtype: ``bool`` - """ - url = REST_BASE + '/instances/%s' % (node.id) - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - data = {'storageID': volume.id, 'type': 'attach'} - resp = self.connection.request(action=url, - method='PUT', - headers=headers, - data=data) - return int(resp.status) == 200 - - def detach_volume(self, node, volume): - """ - Detaches a volume from a node. - - :param node: Node which should be used - :type node: :class:`Node` - - :param volume: Volume to be detached - :type volume: :class:`StorageVolume` - - :rtype: ``bool`` - """ - url = REST_BASE + '/instances/%s' % (node.id) - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - data = {'storageID': volume.id, 'type': 'detach'} - resp = self.connection.request(action=url, - method='PUT', - headers=headers, - data=data) - return int(resp.status) == 200 - - def reboot_node(self, node): - url = REST_BASE + '/instances/%s' % (node.id) - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - data = {'state': 'restart'} - - resp = self.connection.request(action=url, - method='PUT', - headers=headers, - data=data) - return int(resp.status) == 200 - - def list_nodes(self): - return self._to_nodes( - self.connection.request(REST_BASE + '/instances').object) - - def list_images(self, location=None): - return self._to_images( - self.connection.request(REST_BASE + '/offerings/image').object) - - def list_volumes(self): - """ - List storage volumes. - - :rtype: ``list`` of :class:`StorageVolume` - """ - return self._to_volumes( - self.connection.request(REST_BASE + '/storage').object) - - def list_sizes(self, location=None): - """ - Returns a generic list of sizes. See list_images() for a list of - supported sizes for specific images. In particular, you need to have - a size that matches the architecture (32-bit vs 64-bit) of the virtual - machine image operating system. - - @inherits: :class:`NodeDriver.list_sizes` - """ - return [ - NodeSize('BRZ32.1/2048/60*175', 'Bronze 32 bit', None, None, None, - None, self.connection.driver), - NodeSize('BRZ64.2/4096/60*500*350', 'Bronze 64 bit', None, None, - None, None, self.connection.driver), - NodeSize('COP32.1/2048/60', 'Copper 32 bit', None, None, None, - None, self.connection.driver), - NodeSize('COP64.2/4096/60', 'Copper 64 bit', None, None, None, - None, self.connection.driver), - NodeSize('SLV32.2/4096/60*350', 'Silver 32 bit', None, None, None, - None, self.connection.driver), - NodeSize('SLV64.4/8192/60*500*500', 'Silver 64 bit', None, None, - None, None, self.connection.driver), - NodeSize('GLD32.4/4096/60*350', 'Gold 32 bit', None, None, None, - None, self.connection.driver), - NodeSize('GLD64.8/16384/60*500*500', 'Gold 64 bit', None, None, - None, None, self.connection.driver), - NodeSize('PLT64.16/16384/60*500*500*500*500', 'Platinum 64 bit', - None, None, None, None, self.connection.driver)] - - def list_locations(self): - return self._to_locations( - self.connection.request(REST_BASE + '/locations').object) - - def ex_list_storage_offerings(self): - """ - List the storage center offerings - - :rtype: ``list`` of :class:`VolumeOffering` - """ - return self._to_volume_offerings( - self.connection.request(REST_BASE + '/offerings/storage').object) - - def ex_allocate_address(self, location_id, offering_id, vlan_id=None): - """ - Allocate a new reserved IP address - - :param location_id: Target data center - :type location_id: ``str`` - - :param offering_id: Offering ID for address to create - :type offering_id: ``str`` - - :param vlan_id: ID of target VLAN - :type vlan_id: ``str`` - - :return: :class:`Address` object - :rtype: :class:`Address` - """ - url = REST_BASE + '/addresses' - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - data = {'location': location_id, 'offeringID': offering_id} - if vlan_id is not None: - data.update({'vlanID': vlan_id}) - resp = self.connection.request(action=url, - method='POST', - headers=headers, - data=data).object - return self._to_addresses(resp)[0] - - def ex_list_addresses(self, resource_id=None): - """ - List the reserved IP addresses - - :param resource_id: If this is supplied only a single address will - be returned (optional) - :type resource_id: ``str`` - - :rtype: ``list`` of :class:`Address` - """ - url = REST_BASE + '/addresses' - if resource_id: - url += '/' + resource_id - return self._to_addresses(self.connection.request(url).object) - - def ex_copy_to(self, image, volume): - """ - Copies a node image to a storage volume - - :param image: source image to copy - :type image: :class:`NodeImage` - - :param volume: Target storage volume to copy to - :type volume: :class:`StorageVolume` - - :return: ``bool`` The success of the operation - :rtype: ``bool`` - """ - url = REST_BASE + '/storage/%s' % (volume.id) - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - data = {'imageId': image.id} - resp = self.connection.request(action=url, - method='PUT', - headers=headers, - data=data) - return int(resp.status) == 200 - - def ex_delete_address(self, resource_id): - """ - Delete a reserved IP address - - :param resource_id: The address to delete (required) - :type resource_id: ``str`` - - :rtype: ``bool`` - """ - url = REST_BASE + '/addresses/' + resource_id - status = int(self.connection.request(action=url, - method='DELETE').status) - return status == 200 - - def ex_wait_storage_state(self, volume, state=VolumeState.DETACHED, - wait_period=60, timeout=1200): - """ - Block until storage volume state changes to the given value - - :param volume: Storage volume. - :type volume: :class:`StorageVolume` - - :param state: The target state to wait for - :type state: ``int`` - - :param wait_period: How many seconds to between each loop - iteration (default is 3) - :type wait_period: ``int`` - - :param timeout: How many seconds to wait before timing out - (default is 1200) - :type timeout: ``int`` - - :rtype: :class:`StorageVolume` - """ - start = time.time() - end = start + timeout - - while time.time() < end: - volumes = self.list_volumes() - volumes = list([v for v in volumes if v.uuid == volume.uuid]) - - if (len(volumes) == 1 and volumes[0].extra['state'] == state): - return volumes[0] - else: - time.sleep(wait_period) - continue - - raise LibcloudError(value='Timed out after %d seconds' % (timeout), - driver=self) - - def _to_nodes(self, object): - return [self._to_node(instance) for instance in - object.findall('Instance')] - - def _to_node(self, instance): - public_ips = [] - - ip = instance.findtext('IP') - if ip: - public_ips.append(ip) - - return Node( - id=instance.findtext('ID'), - name=instance.findtext('Name'), - state=self.NODE_STATE_MAP[int(instance.findtext('Status'))], - public_ips=public_ips, - private_ips=[], - driver=self.connection.driver - ) - - def _to_images(self, object): - # Converts data retrieved from SCE /offerings/image REST call to - # a NodeImage - return [self._to_image(image) for image in object.findall('Image')] - - def _to_image(self, image): - # Converts an SCE Image object to a NodeImage - imageID = image.findtext('ID') - imageName = image.findtext('Name') - parametersURL = image.findtext('Manifest') - location = image.findtext('Location') - state = image.findtext('State') - owner = image.findtext('Owner') - visibility = image.findtext('Visibility') - platform = image.findtext('Platform') - description = image.findtext('Description') - documentation = image.findtext('Documentation') - instanceTypes = image.findall('SupportedInstanceTypes') - nodeSizes = self._to_node_sizes(image.find('SupportedInstanceTypes')) - return NodeImage(id=imageID, - name=imageName, - driver=self.connection.driver, - extra={ - 'parametersURL': parametersURL, - 'location': location, - 'state': state, - 'owner': owner, - 'visibility': visibility, - 'platform': platform, - 'description': description, - 'documentation': documentation, - 'instanceTypes': instanceTypes, - 'node_sizes': nodeSizes - } - ) - - def _to_locations(self, object): - return [self._to_location(location) for location in - object.findall('Location')] - - def _to_location(self, location): - # Converts an SCE Location object to a Libcloud NodeLocation object - name_text = location.findtext('Name') - description = location.findtext('Description') - state = location.findtext('State') - (nameVal, separator, countryVal) = name_text.partition(',') - capabiltyElements = location.findall('Capabilities/Capability') - capabilities = {} - for elem in capabiltyElements: - capabilityID = elem.attrib['id'] - entryElements = elem.findall('Entry') - entries = [] - for entryElem in entryElements: - key = entryElem.attrib['key'] - valueElements = elem.findall('Value') - values = [] - for valueElem in valueElements: - values.append(valueElem.text) - entry = {'key': key, 'values': values} - entries.append(entry) - capabilities[capabilityID] = entries - extra = {'description': description, 'state': state, - 'capabilities': capabilities} - return IBMNodeLocation(id=location.findtext('ID'), - name=nameVal, - country=countryVal.strip(), - driver=self.connection.driver, - extra=extra) - - def _to_node_sizes(self, object): - # Converts SCE SupportedInstanceTypes object to - # a list of Libcloud NodeSize objects - return [self._to_node_size(iType) for iType in - object.findall('InstanceType')] - - def _to_node_size(self, object): - # Converts to an SCE InstanceType to a Libcloud NodeSize - return NodeSize(object.findtext('ID'), - object.findtext('Label'), - None, - None, - None, - object.findtext('Price/Rate'), - self.connection.driver) - - def _to_volumes(self, object): - return [self._to_volume(iType) for iType in - object.findall('Volume')] - - def _to_volume(self, object): - # Converts an SCE Volume to a Libcloud StorageVolume - extra = {'state': object.findtext('State'), - 'location': object.findtext('Location'), - 'instanceID': object.findtext('instanceID'), - 'owner': object.findtext('Owner'), - 'format': object.findtext('Format'), - 'createdTime': object.findtext('CreatedTime'), - 'storageAreaID': object.findtext('StorageArea/ID')} - return StorageVolume(object.findtext('ID'), - object.findtext('Name'), - object.findtext('Size'), - self.connection.driver, - extra=extra) - - def _to_volume_offerings(self, object): - return [self._to_volume_offering(iType) for iType in - object.findall('Offerings')] - - def _to_volume_offering(self, object): - # Converts an SCE DescribeVolumeOfferingsResponse/Offerings XML object - # to an SCE VolumeOffering - extra = {'label': object.findtext('Label'), - 'supported_sizes': object.findtext('SupportedSizes'), - 'formats': object.findall('SupportedFormats/Format/ID'), - 'price': object.findall('Price')} - return VolumeOffering(object.findtext('ID'), - object.findtext('Name'), - object.findtext('Location'), - extra) - - def _to_addresses(self, object): - # Converts an SCE DescribeAddressesResponse XML object to a list of - # Address objects - return [self._to_address(iType) for iType in - object.findall('Address')] - - def _to_address(self, object): - # Converts an SCE DescribeAddressesResponse/Address XML object to - # an Address object - extra = {'location': object.findtext('Location'), - 'type': object.findtext('Label'), - 'created_time': object.findtext('SupportedSizes'), - 'hostname': object.findtext('Hostname'), - 'instance_ids': object.findtext('InstanceID'), - 'vlan': object.findtext('VLAN'), - 'owner': object.findtext('owner'), - 'mode': object.findtext('Mode'), - 'offering_id': object.findtext('OfferingID')} - return Address(object.findtext('ID'), - object.findtext('IP'), - object.findtext('State'), - extra) diff --git a/libcloud/compute/drivers/ikoula.py b/libcloud/compute/drivers/ikoula.py index 554c647b95..e697f725fa 100644 --- a/libcloud/compute/drivers/ikoula.py +++ b/libcloud/compute/drivers/ikoula.py @@ -16,16 +16,14 @@ from libcloud.compute.providers import Provider from libcloud.compute.drivers.cloudstack import CloudStackNodeDriver -__all__ = [ - 'IkoulaNodeDriver' -] +__all__ = ["IkoulaNodeDriver"] class IkoulaNodeDriver(CloudStackNodeDriver): type = Provider.IKOULA - name = 'Ikoula' - website = 'http://express.ikoula.co.uk/cloudstack' + name = "Ikoula" + website = "http://express.ikoula.co.uk/cloudstack" # API endpoint info - host = 'cloudstack.ikoula.com' - path = '/client/api' + host = "cloudstack.ikoula.com" + path = "/client/api" diff --git a/libcloud/compute/drivers/internetsolutions.py b/libcloud/compute/drivers/internetsolutions.py new file mode 100644 index 0000000000..32cc424394 --- /dev/null +++ b/libcloud/compute/drivers/internetsolutions.py @@ -0,0 +1,64 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Internet Solutions Driver +""" + +from libcloud.compute.providers import Provider +from libcloud.common.dimensiondata import API_ENDPOINTS, DimensionDataConnection +from libcloud.compute.drivers.dimensiondata import DimensionDataNodeDriver + +DEFAULT_REGION = "is-af" + + +class InternetSolutionsNodeDriver(DimensionDataNodeDriver): + """ + InternetSolutions node driver, based on Dimension Data driver + """ + + selected_region = None + connectionCls = DimensionDataConnection + name = "InternetSolutions" + website = "http://www.is.co.za/" + type = Provider.INTERNETSOLUTIONS + features = {"create_node": ["password"]} + api_version = 1.0 + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=DEFAULT_REGION, + **kwargs, + ): + if region not in API_ENDPOINTS: + raise ValueError("Invalid region: %s" % (region)) + + self.selected_region = API_ENDPOINTS[region] + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + api_version=api_version, + region=region, + **kwargs, + ) diff --git a/libcloud/compute/drivers/joyent.py b/libcloud/compute/drivers/joyent.py deleted file mode 100644 index d1fa9c10db..0000000000 --- a/libcloud/compute/drivers/joyent.py +++ /dev/null @@ -1,240 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Joyent Cloud (http://www.joyentcloud.com) driver. -""" - -import base64 - -try: - import simplejson as json -except: - import json - -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import b - -from libcloud.common.types import LibcloudError -from libcloud.compute.providers import Provider -from libcloud.common.base import JsonResponse, ConnectionUserAndKey -from libcloud.compute.types import NodeState, InvalidCredsError -from libcloud.compute.base import Node, NodeDriver, NodeImage, NodeSize -from libcloud.utils.networking import is_private_subnet - -API_HOST_SUFFIX = '.api.joyentcloud.com' -API_VERSION = '~6.5' - - -NODE_STATE_MAP = { - 'provisioning': NodeState.PENDING, - 'running': NodeState.RUNNING, - 'stopping': NodeState.TERMINATED, - 'stopped': NodeState.TERMINATED, - 'deleted': NodeState.TERMINATED -} - -VALID_REGIONS = [ - 'us-east-1', 'us-east-2', 'us-east-3', - 'us-west-1', - 'us-sw-1', - 'eu-ams-1' -] -DEFAULT_REGION = 'us-east-1' - - -class JoyentResponse(JsonResponse): - """ - Joyent response class. - """ - - valid_response_codes = [httplib.OK, httplib.ACCEPTED, httplib.CREATED, - httplib.NO_CONTENT] - - def parse_error(self): - if self.status == httplib.UNAUTHORIZED: - data = self.parse_body() - raise InvalidCredsError(data['code'] + ': ' + data['message']) - return self.body - - def success(self): - return self.status in self.valid_response_codes - - -class JoyentConnection(ConnectionUserAndKey): - """ - Joyent connection class. - """ - - responseCls = JoyentResponse - - allow_insecure = False - - def add_default_headers(self, headers): - headers['Accept'] = 'application/json' - headers['Content-Type'] = 'application/json; charset=UTF-8' - headers['X-Api-Version'] = API_VERSION - - user_b64 = base64.b64encode(b('%s:%s' % (self.user_id, self.key))) - headers['Authorization'] = 'Basic %s' % (user_b64.decode('utf-8')) - return headers - - -class JoyentNodeDriver(NodeDriver): - """ - Joyent node driver class. - """ - - type = Provider.JOYENT - name = 'Joyent' - website = 'http://www.joyentcloud.com' - connectionCls = JoyentConnection - features = {'create_node': ['generates_password']} - - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region=DEFAULT_REGION, **kwargs): - # Location is here for backward compatibility reasons - if 'location' in kwargs: - region = kwargs['location'] - - if region not in VALID_REGIONS: - msg = 'Invalid region: "%s". Valid region: %s' - raise LibcloudError(msg % (region, - ', '.join(VALID_REGIONS)), driver=self) - - super(JoyentNodeDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, region=region, - **kwargs) - self.connection.host = region + API_HOST_SUFFIX - - def list_images(self): - result = self.connection.request('/my/datasets').object - - images = [] - for value in result: - extra = {'type': value['type'], 'urn': value['urn'], - 'os': value['os'], 'default': value['default']} - image = NodeImage(id=value['id'], name=value['name'], - driver=self.connection.driver, extra=extra) - images.append(image) - - return images - - def list_sizes(self): - result = self.connection.request('/my/packages').object - - sizes = [] - for value in result: - size = NodeSize(id=value['name'], name=value['name'], - ram=value['memory'], disk=value['disk'], - bandwidth=None, price=0.0, - driver=self.connection.driver) - sizes.append(size) - - return sizes - - def list_nodes(self): - result = self.connection.request('/my/machines').object - - nodes = [] - for value in result: - node = self._to_node(value) - nodes.append(node) - - return nodes - - def reboot_node(self, node): - data = json.dumps({'action': 'reboot'}) - result = self.connection.request('/my/machines/%s' % (node.id), - data=data, method='POST') - return result.status == httplib.ACCEPTED - - def destroy_node(self, node): - result = self.connection.request('/my/machines/%s' % (node.id), - method='DELETE') - return result.status == httplib.NO_CONTENT - - def create_node(self, **kwargs): - name = kwargs['name'] - size = kwargs['size'] - image = kwargs['image'] - - data = json.dumps({'name': name, 'package': size.id, - 'dataset': image.id}) - result = self.connection.request('/my/machines', data=data, - method='POST') - return self._to_node(result.object) - - def ex_stop_node(self, node): - """ - Stop node - - :param node: The node to be stopped - :type node: :class:`Node` - - :rtype: ``bool`` - """ - data = json.dumps({'action': 'stop'}) - result = self.connection.request('/my/machines/%s' % (node.id), - data=data, method='POST') - return result.status == httplib.ACCEPTED - - def ex_start_node(self, node): - """ - Start node - - :param node: The node to be stopped - :type node: :class:`Node` - - :rtype: ``bool`` - """ - data = json.dumps({'action': 'start'}) - result = self.connection.request('/my/machines/%s' % (node.id), - data=data, method='POST') - return result.status == httplib.ACCEPTED - - def ex_get_node(self, node_id): - """ - Return a Node object based on a node ID. - - :param node_id: ID of the node - :type node_id: ``str`` - - :return: A Node object for the node - :rtype: :class:`Node` - """ - result = self.connection.request('/my/machines/%s' % (node_id)) - return self._to_node(result.object) - - def _to_node(self, data): - state = NODE_STATE_MAP[data['state']] - public_ips = [] - private_ips = [] - extra = {} - - for ip in data['ips']: - if is_private_subnet(ip): - private_ips.append(ip) - else: - public_ips.append(ip) - - if 'credentials' in data['metadata']: - extra['password'] = data['metadata']['credentials']['root'] - - node = Node(id=data['id'], name=data['name'], state=state, - public_ips=public_ips, private_ips=private_ips, - driver=self.connection.driver, extra=extra) - return node diff --git a/libcloud/compute/drivers/kamatera.py b/libcloud/compute/drivers/kamatera.py new file mode 100644 index 0000000000..645b7ce171 --- /dev/null +++ b/libcloud/compute/drivers/kamatera.py @@ -0,0 +1,689 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Kamatera node driver +""" + +import json +import time +import datetime + +from libcloud.utils.py3 import basestring +from libcloud.common.base import JsonResponse, ConnectionUserAndKey +from libcloud.compute.base import Node, NodeSize, NodeImage, NodeState, NodeDriver, NodeLocation +from libcloud.compute.types import Provider + + +class KamateraResponse(JsonResponse): + """ + Response class for KamateraDriver + """ + + def parse_error(self): + data = self.parse_body() + if "message" in data: + return data["message"] + else: + return json.dumps(data) + + +class KamateraConnection(ConnectionUserAndKey): + """ + Connection class for KamateraDriver + """ + + host = "cloudcli.cloudwm.com" + responseCls = KamateraResponse + + def add_default_headers(self, headers): + """Adds headers that are needed for all requests""" + headers["AuthClientId"] = self.user_id + headers["AuthSecret"] = self.key + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + return headers + + +class KamateraNodeDriver(NodeDriver): + """ + Kamatera node driver + + :keyword key: API Client ID, required for authentication + :type key: ``str`` + + :keyword secret: API Secret, required for authentcaiont + :type secret: ``str`` + """ + + type = Provider.KAMATERA + name = "Kamatera" + website = "https://www.kamatera.com/" + connectionCls = KamateraConnection + features = {"create_node": ["password", "generates_password", "ssh_key"]} + + EX_BILLINGCYCLE_HOURLY = "hourly" + EX_BILLINGCYCLE_MONTHLY = "monthly" + + def list_locations(self): + """ + List available locations for deployment + + :rtype: ``list`` of :class:`NodeLocation` + """ + response = self.connection.request("service/server?datacenter=1") + return [ + self.ex_get_location(datacenter["id"], datacenter["subCategory"], datacenter["name"]) + for datacenter in response.object + ] + + def list_sizes( + self, + location=None, + ): + """ + List predefined sizes for the given location. + + :param location: Location of the deployment. + :type location: :class:`.NodeLocation` + + @inherits: :class:`NodeDriver.list_sizes` + """ + response = self.connection.request("service/server?sizes=1&datacenter=%s" % location.id) + return [ + self.ex_get_size( + size["ramMB"], + size["diskSizeGB"], + size["cpuType"], + size["cpuCores"], + extraDiskSizesGB=[], + monthlyTrafficPackage=size["monthlyTrafficPackage"], + id=size["id"], + ) + for size in response.object + ] + + def list_images( + self, + location=None, + ): + """ + List available disk images. + + :param location: Location of the deployment. + Available disk images depend on location. + :type location: :class:`.NodeLocation` + + :rtype: ``list`` of :class:`NodeImage` + """ + response = self.connection.request("service/server?images=1&datacenter=%s" % location.id) + images = [] + for image in response.object: + extra = self._copy_dict(("datacenter", "os", "code", "osDiskSizeGB", "ramMBMin"), image) + images.append(self.ex_get_image(image["name"], image["id"], extra)) + return images + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_networks=None, + ex_dailybackup=False, + ex_managed=False, + ex_billingcycle=EX_BILLINGCYCLE_HOURLY, + ex_poweronaftercreate=True, + ex_wait=True, + ): + """ + Creates a Kamatera node. + + If auth is not given then password will be generated. + + :param name: String with a name for this new node (required) + :type name: ``str`` + + :param size: The size of resources allocated to this node (required) + :type size: :class:`.NodeSize` + + :param image: OS Image to boot on node. (required) + :type image: :class:`.NodeImage` + + :param location: Which data center to create a node in. (required) + :type location: :class:`.NodeLocation` + + :param auth: Authentication information for the node (optional) + :type auth: :class:`.NodeAuthSSHKey` or :class:`.NodeAuthPassword` + + :param ex_networks: Network configurations (optional) + :type ex_networks: ``list`` of ``dict`` + + :param ex_dailybackup: Whether to create daily backups (optional) + :type ex_dailybackup: ``bool`` + + :param ex_managed: Whether to provide managed support (optional) + :type ex_managed: ``bool`` + + :param ex_billingcycle: billing cycle (hourly / monthly) (optional) + :type ex_billingcycle: ``str`` + + :param ex_poweronaftercreate: power on after creation (optional) + :type ex_poweronaftercreate: ``bool`` + + :param ex_wait: wait for server to be running (optional) + :type ex_wait: ``bool`` + + :return: The newly created node. + :rtype: :class:`.Node` + """ + password = None + pubkey = None + generate_password = False + if isinstance(auth, basestring): + password = auth + else: + auth_obj = self._get_and_check_auth(auth) + if getattr(auth_obj, "generated", False): + password = "__generate__" + generate_password = True + elif hasattr(auth_obj, "password"): + password = auth_obj.password + generate_password = False + elif hasattr(auth_obj, "pubkey"): + pubkey = auth_obj.pubkey + if not ex_networks: + ex_networks = [{"name": "wan", "ip": "auto"}] + request_data = { + "name": name, + "password": password or "", + "passwordValidate": password or "", + "ssh-key": pubkey or "", + "datacenter": location.id, + "image": image.id, + "cpu": "{}{}".format(size.extra["cpuCores"], size.extra["cpuType"]), + "ram": size.ram, + "disk": " ".join( + ["size=%d" % disksize for disksize in [size.disk] + size.extra["extraDiskSizesGB"]] + ), + "dailybackup": "yes" if ex_dailybackup else "no", + "managed": "yes" if ex_managed else "no", + "network": " ".join( + [ + ",".join(["{}={}".format(k, v) for k, v in network.items()]) + for network in ex_networks + ] + ), + "quantity": 1, + "billingcycle": ex_billingcycle, + "monthlypackage": size.extra["monthlyTrafficPackage"] or "", + "poweronaftercreate": "yes" if ex_poweronaftercreate else "no", + } + response = self.connection.request( + "service/server", method="POST", data=json.dumps(request_data) + ) + if generate_password: + command_ids = response.object["commandIds"] + generated_password = response.object["password"] + else: + command_ids = response.object + generated_password = None + if len(command_ids) != 1: + raise RuntimeError("invalid response") + node = self.ex_get_node( + name=name, + size=size, + image=image, + location=location, + dailybackup=ex_dailybackup, + managed=ex_managed, + billingcycle=ex_billingcycle, + generated_password=generated_password, + create_command_id=command_ids[0], + poweronaftercreate=ex_poweronaftercreate, + ) + if ex_wait: + if "create_command_id" not in node.extra or node.state != NodeState.UNKNOWN: + raise ValueError("invalid node for updating create status") + command = self.ex_wait_command(node.extra["create_command_id"]) + node.extra["create_log"] = command.get("log") + if node.extra.get("poweronaftercreate"): + node.state = NodeState.RUNNING + else: + node.state = NodeState.STOPPED + if command.get("completed"): + node.created_at = datetime.datetime.strptime( + command["completed"], "%Y-%m-%d %H:%M:%S" + ) + name_lines = [ + line for line in node.extra["create_log"].split("\n") if line.startswith("Name: ") + ] + if len(name_lines) != 1: + raise RuntimeError("Invalid node create log response") + node.name = name_lines[0].replace("Name: ", "") + response = self.connection.request( + "/service/server/info", + method="POST", + data=json.dumps({"name": node.name}), + ) + self._update_node_from_server_info(node, response.object[0]) + return node + + def list_nodes(self, ex_name_regex=None, ex_full_details=False, ex_id=None): + """ + List nodes + + :param ex_name_regex: Regular expression to match node names + if set returns full node details (optional) + :type ex_name_regex: ``str`` + + :param ex_full_details: Whether to return full node details + takes longer to complete (optional) + :type ex_full_details: ``bool`` + + :return: List of node objects + :rtype: ``list`` of :class:`Node` + """ + if ex_name_regex or ex_full_details or ex_id: + request_data = {} + if ex_id: + request_data["id"] = ex_id + else: + if not ex_name_regex: + ex_name_regex = ".*" + request_data["name"] = ex_name_regex + response = self.connection.request( + "/service/server/info", method="POST", data=json.dumps(request_data) + ) + return [ + self._update_node_from_server_info(self.ex_get_node(), server) + for server in response.object + ] + else: + response = self.connection.request("/service/servers") + return [ + self.ex_get_node( + id=server["id"], + name=server["name"], + state=(NodeState.RUNNING if server["power"] == "on" else NodeState.STOPPED), + location=self.ex_get_location(server["datacenter"]), + ) + for server in response.object + ] + + def reboot_node(self, node, ex_wait=True): + """ + Reboot the given node + + :param node: the node to reboot + :type node: :class:`Node` + + :param ex_wait: wait for reboot to complete (optional) + :type ex_wait: ``bool`` + + :rtype: ``bool`` + """ + return self.ex_node_operation(node, "reboot", ex_wait) + + def destroy_node(self, node, ex_wait=True): + """ + Destroy the given node + + :param node: the node to destroy + :type node: :class:`Node` + + :param ex_wait: wait for destroy to complete (optional) + :type ex_wait: ``bool`` + + :rtype: ``bool`` + """ + return self.ex_node_operation(node, "terminate", ex_wait) + + def stop_node(self, node, ex_wait=True): + """ + Stop the given node + + :param node: the node to stop + :type node: :class:`Node` + + :param ex_wait: wait for stop to complete (optional) + :type ex_wait: ``bool`` + + :rtype: ``bool`` + """ + return self.ex_node_operation(node, "poweroff", ex_wait) + + def start_node(self, node, ex_wait=True): + """ + Start the given node + + :param node: the node to start + :type node: :class:`Node` + + :param ex_wait: wait for start to complete (optional) + :type ex_wait: ``bool`` + + :rtype: ``bool`` + """ + return self.ex_node_operation(node, "poweron", ex_wait) + + def ex_node_operation(self, node, operation, wait=True): + """ + Run custom operations on the node + + :param node: the node to run operation on + :type node: :class:`Node` + + :param operation: the operation to run + :type operation: ``str`` + + :param ex_wait: wait for destroy to complete (optional) + :type ex_wait: ``bool`` + + :rtype: ``bool`` + """ + if node.id: + request_data = {"id": node.id} + elif node.name: + request_data = {"name": node.name} + else: + raise ValueError("Invalid node for %s node operation: " "missing id / name" % operation) + if operation == "terminate": + request_data["force"] = True + command_id = self.connection.request( + "/service/server/%s" % operation, + method="POST", + data=json.dumps(request_data), + ).object[0] + if wait: + self.ex_wait_command(command_id) + else: + node.extra["%s_command_id" % operation] = command_id + return True + + def ex_get_location(self, id, name=None, country=None): + """ + Get a NodeLocation object to use for other methods + + :param id: Location ID - uppercase letters code (required) + :type id: ``str`` + + :param name: Location Name (optional) + :type name: ``str`` + + :param name: Location country (optional) + :type name: ``str`` + + :rtype: :class:`.NodeLocation` + """ + return NodeLocation(id=id, name=name, country=country, driver=self) + + def ex_get_size( + self, + ramMB, + diskSizeGB, + cpuType, + cpuCores, + extraDiskSizesGB=None, + monthlyTrafficPackage=None, + id=None, + name=None, + ): + """ + Get a NodeSize object to use for other methods + + :param ramMB: Amount of RAM to allocate in MB (required) + :type ramMB: ``int`` + + :param diskSizeGB: disk size GB for primary hard disk (required) + :type diskSizeGB: ``int`` + + :param cpuType: CPU type ID (single uppercase letter), + see ex_list_capabilities (required) + :type cpuType: ``str`` + + :param cpuCores: Number of CPU cores to allocate (required) + :type cpuCores: ``int`` + + :param extraDiskSizesGB: additional disk sizes in GB (optional) + :type extraDiskSizesGB: ``list`` of :int: + + :param monthlyTrafficPackage: ID of monthly traffic package + see ex_list_capabilities (optional) + :type monthlyTrafficPackage: ``str`` + + :param id: Size ID (optional) + :type id: ``str`` + + :param name: Size Name (optional) + :type name: ``str`` + + :rtype: :class:`.NodeLocation` + """ + if not id: + id = str(cpuCores) + cpuType + id += "-" + str(ramMB) + "MB-" + str(diskSizeGB) + "GB" + if monthlyTrafficPackage: + id += "-" + monthlyTrafficPackage + if not name: + name = id + return NodeSize( + id=id, + name=name, + ram=ramMB, + disk=diskSizeGB, + bandwidth=0, + price=0, + driver=self.connection.driver, + extra={ + "cpuType": cpuType, + "cpuCores": cpuCores, + "monthlyTrafficPackage": monthlyTrafficPackage, + "extraDiskSizesGB": extraDiskSizesGB or [], + }, + ) + + def ex_get_image(self, name=None, id=None, extra=None): + if not id and not name: + raise ValueError("either id or name are required for NodeImage") + return NodeImage(id=id or name, name=name or "", driver=self, extra=extra or {}) + + def ex_list_capabilities(self, location): + """ + List capabilities for given location. + + :param location: Location of the deployment. + :type location: :class:`.NodeLocation` + + :return: ``dict`` + """ + return self.connection.request( + "service/server?capabilities=1&" "datacenter=%s" % location.id + ).object + + def ex_wait_command(self, command_id, timeout_seconds=600, poll_interval_seconds=2): + """ + Wait for command to complete and return the command status details + + :param command_id: Command ID to wait for. (required) + :type command_id: ``int`` + + :param timeout_seconds: Max seconds to wait for command. (optional) + :type timeout_seconds: ``int`` + + :param poll_interval_seconds: Poll interval in seconds (optional) + :type poll_interval_seconds: ``int`` + + :return: ``dict`` + """ + start_time = datetime.datetime.now() + time.sleep(poll_interval_seconds) + while True: + max_time = start_time + datetime.timedelta(seconds=timeout_seconds) + if max_time < datetime.datetime.now(): + raise TimeoutError( + "Timeout waiting for command " + "(timeout_seconds=%s, command_id=%s)" % (str(timeout_seconds), str(command_id)) + ) + time.sleep(poll_interval_seconds) + command = self.ex_get_command_status(command_id) + status = command.get("status") + if status == "complete": + return command + elif status == "error": + raise RuntimeError("Command failed: " + command.get("log")) + + def ex_get_command_status(self, command_id): + """ + Get Kamatera command status details + + :param command_id: Command ID to get details for. (required) + :type command_id: ``int`` + + :return: ``dict`` + """ + response = self.connection.request("/service/queue?id=" + str(command_id)) + if len(response.object) != 1: + raise RuntimeError("invalid response") + return response.object[0] + + def ex_get_node( + self, + id=None, + name=None, + state=NodeState.UNKNOWN, + public_ips=None, + private_ips=None, + size=None, + image=None, + created_at=None, + location=None, + dailybackup=None, + managed=None, + billingcycle=None, + generated_password=None, + create_command_id=None, + poweronaftercreate=None, + ): + """ + Get a Kamatera node object. + + :param id: Node ID (optional) + :type id: ``str`` + + :param name: Node name (optional) + :type name: ``str`` + + :param state: Node state (optional) + :type state: :class:`libcloud.compute.types.NodeState` + + :param public_ips: Node public IPS. (optional) + :type public_ips: ``list`` of :str: + + :param private_ips: Node private IPS. (optional) + :type private_ips: ``list`` of :str: + + :param size: node size. (optional) + :type size: :class:`.NodeSize` + + :param image: Node OS Image. (optional) + :type image: :class:`.NodeImage` + + :param created_at: Node creation time. (optional) + :type created_at: ``datetime.datetime`` + + :param location: Node datacenter. (optional) + :type location: :class:`.NodeLocation` + + :param dailybackup: create daily backups for the node (optional) + :type dailybackup: ``bool`` + + :param managed: provide managed support for the node (optional) + :type managed: ``bool`` + + :param billingcycle: billing cycle (hourly / monthly) (optional) + :type billingcycle: ``str`` + + :param generated_password: server generated password (optional) + :type generated_password: ``str`` + + :param create_command_id: creation task command ID (optional) + :type create_command_id: ``int`` + + :param poweronaftercreate: power on the node after create (optional) + :type poweronaftercreate: ``bool`` + + :return: The node. + :rtype: :class:`.Node` + """ + extra = {} + if location: + extra["location"] = location + if dailybackup is not None: + extra["dailybackup"] = dailybackup + if managed is not None: + extra["managed"] = managed + if billingcycle is not None: + extra["billingcycle"] = billingcycle + if generated_password is not None: + extra["generated_password"] = generated_password + if create_command_id is not None: + extra["create_command_id"] = create_command_id + if poweronaftercreate is not None: + extra["poweronaftercreate"] = poweronaftercreate + return Node( + id=id, + name=name, + state=state, + public_ips=public_ips, + private_ips=private_ips, + driver=self, + size=size, + image=image, + created_at=created_at, + extra=extra, + ) + + def _copy_dict(self, keys, d): + extra = {} + for key in keys: + extra[key] = d[key] + return extra + + def _update_node_from_server_info(self, node, server): + node.id = server["id"] + node.name = server["name"] + if server["power"] == "on": + node.state = NodeState.RUNNING + else: + node.state = NodeState.STOPPED + for network in server.get("networks", []): + if network.get("network").startswith("wan-"): + node.public_ips += network.get("ips", []) + else: + node.private_ips += network.get("ips", []) + billing = server.get("billing", node.extra.get("billingcycle")).lower() + if billing == self.EX_BILLINGCYCLE_HOURLY: + node.extra["billingcycle"] = self.EX_BILLINGCYCLE_HOURLY + node.extra["priceOn"] = server.get("priceHourlyOn") + node.extra["priceOff"] = server.get("priceHourlyOff") + else: + node.extra["billingcycle"] = self.EX_BILLINGCYCLE_MONTHLY + node.extra["priceOn"] = server.get("priceMonthlyOn") + node.extra["priceOff"] = server.get("priceMonthlyOn") + node.extra["location"] = self.ex_get_location(server["datacenter"]) + node.extra["dailybackup"] = server.get("backup") == "1" + node.extra["managed"] = server.get("managed") == "1" + return node diff --git a/libcloud/compute/drivers/kili.py b/libcloud/compute/drivers/kili.py deleted file mode 100644 index 11c1c7bc81..0000000000 --- a/libcloud/compute/drivers/kili.py +++ /dev/null @@ -1,87 +0,0 @@ -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -HP Public cloud driver which is essentially just a small wrapper around -OpenStack driver. -""" - -from libcloud.compute.types import Provider, LibcloudError -from libcloud.compute.drivers.openstack import OpenStack_1_1_Connection -from libcloud.compute.drivers.openstack import OpenStack_1_1_NodeDriver - -__all__ = [ - 'KiliCloudNodeDriver' -] - -ENDPOINT_ARGS = { - 'service_type': 'compute', - 'name': 'nova', - 'region': 'RegionOne' -} - -AUTH_URL = 'https://api.kili.io/keystone/v2.0/tokens' - - -class KiliCloudConnection(OpenStack_1_1_Connection): - _auth_version = '2.0_password' - - def __init__(self, *args, **kwargs): - self.region = kwargs.pop('region', None) - self.get_endpoint_args = kwargs.pop('get_endpoint_args', None) - super(KiliCloudConnection, self).__init__(*args, **kwargs) - - def get_endpoint(self): - if not self.get_endpoint_args: - raise LibcloudError( - 'KiliCloudConnection must have get_endpoint_args set') - - if '2.0_password' in self._auth_version: - ep = self.service_catalog.get_endpoint(**self.get_endpoint_args) - else: - raise LibcloudError( - 'Auth version "%s" not supported' % (self._auth_version)) - - public_url = ep.url - - if not public_url: - raise LibcloudError('Could not find specified endpoint') - - return public_url - - -class KiliCloudNodeDriver(OpenStack_1_1_NodeDriver): - name = 'Kili Public Cloud' - website = 'http://kili.io/' - connectionCls = KiliCloudConnection - type = Provider.HPCLOUD - - def __init__(self, key, secret, tenant_name, secure=True, - host=None, port=None, **kwargs): - """ - Note: tenant_name argument is required for Kili cloud. - """ - self.tenant_name = tenant_name - super(KiliCloudNodeDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, - **kwargs) - - def _ex_connection_class_kwargs(self): - kwargs = self.openstack_connection_kwargs() - kwargs['get_endpoint_args'] = ENDPOINT_ARGS - kwargs['ex_force_auth_url'] = AUTH_URL - kwargs['ex_tenant_name'] = self.tenant_name - - return kwargs diff --git a/libcloud/compute/drivers/ktucloud.py b/libcloud/compute/drivers/ktucloud.py index 1bc8544563..e6d4268100 100644 --- a/libcloud/compute/drivers/ktucloud.py +++ b/libcloud/compute/drivers/ktucloud.py @@ -13,91 +13,83 @@ # See the License for the specific language governing permissions and # limitations under the License. +from libcloud.compute.base import Node, NodeSize, NodeImage from libcloud.compute.providers import Provider -from libcloud.compute.base import Node, NodeImage, NodeSize from libcloud.compute.drivers.cloudstack import CloudStackNodeDriver class KTUCloudNodeDriver(CloudStackNodeDriver): - "Driver for KTUCloud Compute platform." + """Driver for KTUCloud Compute platform.""" - EMPTY_DISKOFFERINGID = '0' + EMPTY_DISKOFFERINGID = "0" type = Provider.KTUCLOUD - name = 'KTUCloud' - website = 'https://ucloudbiz.olleh.com/' + name = "KTUCloud" + website = "https://ucloudbiz.olleh.com/" def list_images(self, location=None): - args = { - 'templatefilter': 'executable' - } + args = {"templatefilter": "executable"} if location is not None: - args['zoneid'] = location.id + args["zoneid"] = location.id - imgs = self._sync_request(command='listAvailableProductTypes', - method='GET') + imgs = self._sync_request(command="listAvailableProductTypes", method="GET") images = [] - for img in imgs['producttypes']: + for img in imgs["producttypes"]: images.append( NodeImage( - img['serviceofferingid'], - img['serviceofferingdesc'], + img["serviceofferingid"], + img["serviceofferingdesc"], self, - {'hypervisor': '', - 'format': '', - 'os': img['templatedesc'], - 'templateid': img['templateid'], - 'zoneid': img['zoneid']} + { + "hypervisor": "", + "format": "", + "os": img["templatedesc"], + "templateid": img["templateid"], + "zoneid": img["zoneid"], + }, ) ) return images def list_sizes(self, location=None): - szs = self._sync_request('listAvailableProductTypes') + szs = self._sync_request("listAvailableProductTypes") sizes = [] - for sz in szs['producttypes']: - diskofferingid = sz.get('diskofferingid', - self.EMPTY_DISKOFFERINGID) - sizes.append(NodeSize( - diskofferingid, - sz['diskofferingdesc'], - 0, 0, 0, 0, self) - ) + for sz in szs["producttypes"]: + diskofferingid = sz.get("diskofferingid", self.EMPTY_DISKOFFERINGID) + sizes.append(NodeSize(diskofferingid, sz["diskofferingdesc"], 0, 0, 0, 0, self)) return sizes - def create_node(self, name, size, image, location=None, **kwargs): - params = {'displayname': name, - 'serviceofferingid': image.id, - 'templateid': str(image.extra['templateid']), - 'zoneid': str(image.extra['zoneid'])} + def create_node(self, name, size, image, location=None, auth=None, ex_usageplantype="hourly"): + params = { + "displayname": name, + "serviceofferingid": image.id, + "templateid": str(image.extra["templateid"]), + "zoneid": str(image.extra["zoneid"]), + } - usageplantype = kwargs.pop('usageplantype', None) - if usageplantype is None: - params['usageplantype'] = 'hourly' + if ex_usageplantype is None: + params["usageplantype"] = "hourly" else: - params['usageplantype'] = usageplantype + params["usageplantype"] = ex_usageplantype if size.id != self.EMPTY_DISKOFFERINGID: - params['diskofferingid'] = size.id + params["diskofferingid"] = size.id - result = self._async_request( - command='deployVirtualMachine', - params=params, - method='GET') + result = self._async_request(command="deployVirtualMachine", params=params, method="GET") - node = result['virtualmachine'] + node = result["virtualmachine"] return Node( - id=node['id'], - name=node['displayname'], - state=self.NODE_STATE_MAP[node['state']], + id=node["id"], + name=node["displayname"], + state=self.NODE_STATE_MAP[node["state"]], public_ips=[], private_ips=[], driver=self, extra={ - 'zoneid': image.extra['zoneid'], - 'ip_addresses': [], - 'forwarding_rules': [], - } + "zoneid": image.extra["zoneid"], + "ip_addresses": [], + "forwarding_rules": [], + }, ) diff --git a/libcloud/compute/drivers/kubevirt.py b/libcloud/compute/drivers/kubevirt.py new file mode 100644 index 0000000000..c04291f6f5 --- /dev/null +++ b/libcloud/compute/drivers/kubevirt.py @@ -0,0 +1,2188 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: Re-enable once we add mypy annotations for the base container API +# type: ignore +""" +kubevirt driver with support for nodes (vms) +""" + +import copy +import json +import time +import uuid +import hashlib +import warnings +from typing import Union, Optional +from datetime import datetime + +from libcloud.common.types import LibcloudError +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, + NodeAuthSSHKey, + NodeAuthPassword, +) +from libcloud.compute.types import Provider, NodeState +from libcloud.common.kubernetes import ( + VALID_RESPONSE_CODES, + KubernetesDriverMixin, + KubernetesBasicAuthConnection, +) + +__all__ = [ + "KubeVirtNodeDriver", + "DISK_TYPES", + "KubeVirtNodeSize", + "KubeVirtNodeImage", +] + +ROOT_URL = "/api/v1/" +KUBEVIRT_URL = "/apis/kubevirt.io/v1alpha3/" + +# all valid disk types supported by kubevirt +DISK_TYPES = { + "containerDisk", + "ephemeral", + "configMap", + "dataVolume", + "cloudInitNoCloud", + "persistentVolumeClaim", + "emptyDisk", + "cloudInitConfigDrive", + "hostDisk", +} + + +class KubeVirtNodeDriver(KubernetesDriverMixin, NodeDriver): + type = Provider.KUBEVIRT + name = "kubevirt" + website = "https://www.kubevirt.io" + connectionCls = KubernetesBasicAuthConnection + features = {"create_node": ["ssh_key", "password"]} + + NODE_STATE_MAP = { + "pending": NodeState.PENDING, + "running": NodeState.RUNNING, + "stopped": NodeState.STOPPED, + } + + def list_nodes(self, location=None): + namespaces = [] + + if location is not None: + if isinstance(location, NodeLocation): + namespaces.append(location.name) + elif isinstance(location, str): + namespaces.append(location) + else: + raise ValueError("location must be a NodeLocation or a string") + else: + for ns in self.list_locations(): + namespaces.append(ns.name) + + dormant = [] + live = [] + + for ns in namespaces: + req = KUBEVIRT_URL + "namespaces/" + ns + "/virtualmachines" + result = self.connection.request(req) + + if result.status != 200: + continue + result = result.object + + for item in result["items"]: + if not item["spec"]["running"]: + dormant.append(item) + else: + live.append(item) + vms = [] + + for vm in dormant: + vms.append(self._to_node(vm, is_stopped=True)) + + for vm in live: + vms.append(self._to_node(vm, is_stopped=False)) + + return vms + + def get_node(self, id=None, name=None): + """get a vm by name or id. + + :param id: id of the vm + :type id: ``str`` + + :param name: name of the vm + :type name: ``str`` + """ + + if not id and not name: + raise ValueError("This method needs id or name to be specified") + nodes = self.list_nodes() + + node_gen = None + + if id: + node_gen = filter(lambda x: x.id == id, nodes) + + if name: + node_gen = filter(lambda x: x.name == name, nodes) + + if not node_gen: + raise ValueError("node_gen is not defined") + + try: + return next(node_gen) + except StopIteration: + raise ValueError("Node does not exist") + + def start_node(self, node): + """Starting a VM. + + :param node: The node to be started. + :type node: :class:`Node` + + :return: True if the start was successful, False otherwise. + :rtype: ``bool`` + """ + # make sure it is stopped + + if node.state is NodeState.RUNNING: + return True + name = node.name + namespace = node.extra["namespace"] + req = KUBEVIRT_URL + "namespaces/" + namespace + "/virtualmachines/" + name + data = {"spec": {"running": True}} + headers = {"Content-Type": "application/merge-patch+json"} + try: + result = self.connection.request( + req, method="PATCH", data=json.dumps(data), headers=headers + ) + + return result.status in VALID_RESPONSE_CODES + + except Exception: + raise + + def stop_node(self, node): + """Stopping a VM. + + :param node: The node to be stopped. + :type node: :class:`Node` + + :return: True if the stop was successful, False otherwise. + :rtype: ``bool`` + """ + # check if running + + if node.state is NodeState.STOPPED: + return True + name = node.name + namespace = node.extra["namespace"] + req = KUBEVIRT_URL + "namespaces/" + namespace + "/virtualmachines/" + name + headers = {"Content-Type": "application/merge-patch+json"} + data = {"spec": {"running": False}} + try: + result = self.connection.request( + req, method="PATCH", data=json.dumps(data), headers=headers + ) + + return result.status in VALID_RESPONSE_CODES + + except Exception: + raise + + def reboot_node(self, node): + """ + Rebooting a node. + + :param node: The node to be rebooted. + :type node: :class:`Node` + + :return: True if the reboot was successful, False otherwise. + :rtype: ``bool`` + """ + namespace = node.extra["namespace"] + name = node.name + method = "DELETE" + try: + result = self.connection.request( + KUBEVIRT_URL + "namespaces/" + namespace + "/virtualmachineinstances/" + name, + method=method, + ) + + return result.status in VALID_RESPONSE_CODES + except Exception: + raise + + return + + def destroy_node(self, node): + """ + Terminating a VMI and deleting the VM resource backing it. + + :param node: The node to be destroyed. + :type node: :class:`Node` + + :return: True if the destruction was successful, False otherwise. + :rtype: ``bool`` + """ + namespace = node.extra["namespace"] + name = node.name + # find and delete services for this VM only + services = self.ex_list_services(namespace=namespace, node_name=name) + + for service in services: + service_name = service["metadata"]["name"] + self.ex_delete_service(namespace=namespace, service_name=service_name) + # stop the vmi + self.stop_node(node) + try: + result = self.connection.request( + KUBEVIRT_URL + "namespaces/" + namespace + "/virtualmachines/" + name, + method="DELETE", + ) + + return result.status in VALID_RESPONSE_CODES + except Exception: + raise + + def _create_node_with_template(self, name: str, template: dict, namespace="default"): + """ + Creating a VM defined by the template. + + The template must be a dictionary of kubernetes object that defines the + KubeVirt VM. Following are the keys: + + - ``apiVersion``: ``str`` + - ``kind``: ``str`` + - ``metadata``: ``dict`` + - ``spec``: ``dict`` + - ``domain``: ``dict`` + - ``volumes``: ``list`` + - ... + - ... + + See also: + + - https://kubernetes.io/docs/concepts/overview/working-with-objects/ + - https://kubevirt.io/api-reference/ + + :param name: A name to give the VM. The VM will be identified by this + name, and it must be the same as the name in the + ``template["metadata"]["name"]``. + Atm, it cannot be changed after it is set. + :type name: ``str`` + + :param template: A dictionary of kubernetes object that defines the VM. + :type template: ``dict`` with keys: + ``apiVersion: str``, ``kind: str``, ``metadata: dict``, + ``spec: dict`` etc. + + :param namespace: The namespace where the VM will live. + (default is 'default') + :return: + """ + # k8s object checks + + if template.get("apiVersion", "") != "kubevirt.io/v1alpha3": + raise ValueError("The template must have an apiVersion: kubevirt.io/v1alpha3") + + if template.get("kind", "") != "VirtualMachine": + raise ValueError("The template must contain kind: VirtualMachine") + + if name != template.get("metadata", {}).get("name"): + raise ValueError( + "The name of the VM must be the same as the name in the template. " + "(name={}, template.metadata.name={})".format( + name, template.get("metadata", {}).get("name") + ) + ) + + if template.get("spec", {}).get("running", False): + warnings.warn( + "The VM will be created in a stopped state, and then started. " + "Ignoring the `spec.running: True` in the template." + ) + # assert "spec" in template and "running" in template["spec"] + template["spec"]["running"] = False + + vm = template + + method = "POST" + data = json.dumps(vm) + req = KUBEVIRT_URL + "namespaces/" + namespace + "/virtualmachines/" + try: + self.connection.request(req, method=method, data=data) + except Exception: + raise + + # check if new node is present + # But why not just use the resp from the POST request? + # Or self.get_node()? + # I don't think a for loop over list_nodes is necessary. + nodes = self.list_nodes(location=namespace) + + for node in nodes: + if node.name == name: + self.start_node(node) + + return node + + raise ValueError( + "The node was not found after creation, " + "create_node may have failed. Please check the kubernetes logs." + ) + + @staticmethod + def _base_vm_template(name=None): # type: (Optional[str]) -> dict + """ + A skeleton VM template to be used for creating VMs. + + :param name: A name to give the VM. The VM will be identified by this + name. If not provided, a random uuid4 will be used. + The generated name can be gotten from the returned dict + with the key ``["metadata"]["name"]``. + :type name: ``str`` + + :return: dict: A skeleton VM template. + """ + + if not name: + name = uuid.uuid4() + + return { + "apiVersion": "kubevirt.io/v1alpha3", + "kind": "VirtualMachine", + "metadata": {"labels": {"kubevirt.io/vm": name}, "name": name}, + "spec": { + "running": False, + "template": { + "metadata": {"labels": {"kubevirt.io/vm": name}}, + "spec": { + "domain": { + "devices": { + "disks": [], + "interfaces": [], + "networkInterfaceMultiqueue": False, + }, + "machine": {"type": ""}, + "resources": {"requests": {}, "limits": {}}, + }, + "networks": [], + "terminationGracePeriodSeconds": 0, + "volumes": [], + }, + }, + }, + } + + @staticmethod + def _create_node_vm_from_ex_template( + name, ex_template, other_args + ): # type: (str, dict) -> dict + """ + A part of create_node that deals with the VM template. + Returns the VM template with the name set. + + :param name: A name to give the VM. The VM will be identified by + this name and atm it cannot be changed after it is set. + See also the name parameter in create_node. + :type name: ``str`` + + :param ex_template: A dictionary of kubernetes object that defines the + KubeVirt VM. See also the ex_template parameter in create_node. + :type ex_template: ``dict`` with keys: + ``apiVersion: str``, ``kind: str``, ``metadata: dict`` + and ``spec: dict`` + + :param other_args: Other parameters passed to the create_node method. + This is used to warn the user about ignored parameters. + See also the parameters of create_node. + :type other_args: ``dict`` + + :return: dict: The VM template with the name set. + """ + assert isinstance(ex_template, dict), "ex_template must be a dictionary" + + other_params = { + "size": other_args.get("size"), + "image": other_args.get("image"), + "auth": other_args.get("auth"), + "ex_disks": other_args.get("ex_disks"), + "ex_network": other_args.get("ex_network"), + "ex_termination_grace_period": other_args.get("ex_termination_grace_period"), + "ex_ports": other_args.get("ex_ports"), + } + ignored_non_none_param_keys = list( + filter(lambda x: other_params[x] is not None, other_params) + ) + + if ignored_non_none_param_keys: + warnings.warn( + "ex_template is provided, ignoring the following non-None " + "parameters: {}".format(ignored_non_none_param_keys) + ) + + vm = copy.deepcopy(ex_template) + + if vm.get("metadata") is None: + vm["metadata"] = {} + + if vm["metadata"].get("name") is None: + vm["metadata"]["name"] = name + elif vm["metadata"]["name"] != name: + warnings.warn( + "The name in the ex_template ({}) will be ignored. " + "The name provided in the arguments ({}) will be used.".format( + vm["metadata"]["name"], name + ) + ) + vm["metadata"]["name"] = name + + return vm + + @staticmethod + def _create_node_size( + vm, size=None, ex_cpu=None, ex_memory=None + ): # type: (dict, NodeSize, int, int) -> None + """ + A part of create_node that deals with the size of the VM. + It will fill the vm with size information. + + :param size: The size of the VM in terms of CPU and memory. + See also the size parameter in create_node. + :type size: ``NodeSize`` with + + :param ex_cpu: The number of CPU cores to allocate to the VM. + See also the ex_cpu parameter in create_node. + :type ex_cpu: ``int`` or ``str`` + + :param ex_memory: The amount of memory to allocate to the VM in MiB. + See also the ex_memory parameter in create_node. + :type ex_memory: ``int`` + + :return: None + """ + # size -> cpu and memory limits / requests + + ex_memory_limit = ex_memory_request = ex_cpu_limit = ex_cpu_request = None + + if size is not None: + assert isinstance(size, NodeSize), "size must be a NodeSize" + ex_cpu_limit = size.extra["cpu"] + ex_memory_limit = size.ram + # optional resc requests: default = limit + ex_cpu_request = size.extra.get("cpu_request", None) or ex_cpu_limit + ex_memory_request = size.extra.get("ram_request", None) or ex_memory_limit + + # memory + + if ex_memory is not None: # legacy + ex_memory_limit = ex_memory + ex_memory_request = ex_memory + + def _format_memory(memory_value): # type: (int) -> str + assert isinstance(memory_value, int), "memory must be an int in MiB" + + return str(memory_value) + "Mi" + + if ex_memory_limit is not None: + memory = _format_memory(ex_memory_limit) + vm["spec"]["template"]["spec"]["domain"]["resources"]["limits"]["memory"] = memory + + if ex_memory_request is not None: + memory = _format_memory(ex_memory_request) + vm["spec"]["template"]["spec"]["domain"]["resources"]["requests"]["memory"] = memory + + # cpu + + if ex_cpu is not None: # legacy + ex_cpu_limit = ex_cpu + ex_cpu_request = ex_cpu + + def _format_cpu(cpu_value): # type: (Union[int, str]) -> Union[str, float] + if isinstance(cpu_value, str) and cpu_value.endswith("m"): + return cpu_value + try: + return float(cpu_value) + except ValueError: + raise ValueError("cpu must be a number or a string ending with 'm'") + + if ex_cpu_limit is not None: + cpu = _format_cpu(ex_cpu_limit) + vm["spec"]["template"]["spec"]["domain"]["resources"]["limits"]["cpu"] = cpu + + if ex_cpu_request is not None: + cpu = _format_cpu(ex_cpu_request) + vm["spec"]["template"]["spec"]["domain"]["resources"]["requests"]["cpu"] = cpu + + @staticmethod + def _create_node_termination_grace_period( + vm, ex_termination_grace_period + ): # type: (dict, int) -> None + """ + A part of create_node that deals with the termination grace period of the VM. + It will fill the vm with the termination grace period information. + + :param vm: The VM template to be filled. + :type vm: ``dict`` + :param ex_termination_grace_period: The termination grace period of the VM in seconds. + See also the ex_termination_grace_period parameter in create_node. + :type ex_termination_grace_period: ``int`` + :return: None + """ + assert isinstance( + ex_termination_grace_period, int + ), "ex_termination_grace_period must be an int" + + vm["spec"]["template"]["spec"][ + "terminationGracePeriodSeconds" + ] = ex_termination_grace_period + + @staticmethod + def _create_node_network(vm, ex_network, ex_ports): # type: (dict, dict, dict) -> None + """ + A part of create_node that deals with the network of the VM. + It will fill the vm with network information. + + :param vm: The VM template to be filled. + :type vm: ``dict`` + :param ex_network: The network configuration of the VM. + See also the ex_network parameter in create_node. + :type ex_network: ``dict`` + :param ex_ports: The ports to expose in the VM. + See also the ex_ports parameter in create_node. + :type ex_ports: ``dict`` + :return: None + """ + # ex_network -> network and interface + + if ex_network is not None: + try: + if isinstance(ex_network, dict): + interface = ex_network["interface"] + network_name = ex_network["name"] + network_type = ex_network["network_type"] + elif isinstance(ex_network, (tuple, list)): # legacy 3-tuple + network_type = ex_network[0] + interface = ex_network[1] + network_name = ex_network[2] + else: + raise KeyError("ex_network must be a dictionary or a tuple/list") + except KeyError: + msg = ( + "ex_network: You must provide a dictionary with keys: " + "'interface', 'name', 'network_type'." + ) + raise KeyError(msg) + # add a default network + else: + interface = "masquerade" + network_name = "netw1" + network_type = "pod" + + network_dict = {network_type: {}, "name": network_name} + interface_dict = {interface: {}, "name": network_name} + + # ex_ports -> network.ports + ex_ports = ex_ports or {} + + if ex_ports.get("ports_tcp"): + ports_to_expose = [] + + for port in ex_ports["ports_tcp"]: + ports_to_expose.append({"port": port, "protocol": "TCP"}) + interface_dict[interface]["ports"] = ports_to_expose + + if ex_ports.get("ports_udp"): + ports_to_expose = interface_dict[interface].get("ports", []) + + for port in ex_ports.get("ports_udp"): + ports_to_expose.append({"port": port, "protocol": "UDP"}) + interface_dict[interface]["ports"] = ports_to_expose + + vm["spec"]["template"]["spec"]["networks"].append(network_dict) + vm["spec"]["template"]["spec"]["domain"]["devices"]["interfaces"].append(interface_dict) + + @staticmethod + def _create_node_auth(vm, auth): + """ + A part of create_node that deals with the authentication of the VM. + It will fill the vm with a cloud-init volume that injects the authentication. + + :param vm: The VM template to be filled. + :param auth: The authentication method for the VM. + See also the auth parameter in create_node. + :type auth: ``NodeAuthSSHKey`` or ``NodeAuthPassword`` + :return: None + """ + # auth requires cloud-init, + # and only one cloud-init volume is supported by kubevirt. + # So if both auth and cloud-init are provided, raise an error. + + for volume in vm["spec"]["template"]["spec"]["volumes"]: + if "cloudInitNoCloud" in volume or "cloudInitConfigDrive" in volume: + raise ValueError( + "Setting auth and cloudInit at the same time is not supported." + "Use deploy_node() instead." + ) + + # cloud-init volume + cloud_init_volume = "auth-cloudinit-" + str(uuid.uuid4()) + disk_dict = {"disk": {"bus": "virtio"}, "name": cloud_init_volume} + volume_dict = { + "name": cloud_init_volume, + "cloudInitNoCloud": {"userData": ""}, + } + + # cloud_init_config reference: https://kubevirt.io/user-guide/virtual_machines/startup_scripts/#injecting-ssh-keys-with-cloud-inits-cloud-config + + if isinstance(auth, NodeAuthSSHKey): + public_key = auth.pubkey.strip() + public_key = json.dumps(public_key) + cloud_init_config = ( + """#cloud-config\n""" """ssh_authorized_keys:\n""" """ - {}\n""" + ).format(public_key) + elif isinstance(auth, NodeAuthPassword): + password = auth.password.strip() + password = json.dumps(password) + cloud_init_config = ( + """#cloud-config\n""" + """password: {}\n""" + """chpasswd: {{ expire: False }}\n""" + """ssh_pwauth: True\n""" + ).format(password) + else: + raise ValueError("auth must be NodeAuthSSHKey or NodeAuthPassword") + volume_dict["cloudInitNoCloud"]["userData"] = cloud_init_config + + # add volume + vm["spec"]["template"]["spec"]["domain"]["devices"]["disks"].append(disk_dict) + vm["spec"]["template"]["spec"]["volumes"].append(volume_dict) + + def _create_node_disks(self, vm, ex_disks, image, namespace, location): + """ + A part of create_node that deals with the disks (and volumes) of the VM. + It will fill the vm with disk information. + OS image is added to the disks as well. + + :param vm: The VM template to be filled. + :type vm: ``dict`` + :param ex_disks: The disk configuration of the VM. + See also the ex_disks parameter in create_node. + :type ex_disks: ``list`` + :param image: The image to be used as the OS disk. + See also the image parameter in create_node. + :param namespace: The namespace where the VM will live. + See also the location parameter in create_node. + :type namespace: ``str`` + :param location: The location where the VM will live. + See also the location parameter in create_node. + :type location: ``str`` + + :return: None + """ + # ex_disks -> disks and volumes + + ex_disks = ex_disks or [] + + for i, disk in enumerate(ex_disks): + disk_type = disk.get("disk_type") + bus = disk.get("bus", "virtio") + disk_name = disk.get("name", "disk{}".format(i)) + device = disk.get("device", "disk") + + if disk_type not in DISK_TYPES: + raise ValueError("The possible values for this " "parameter are: ", DISK_TYPES) + + # depending on disk_type, in the future, + # when more will be supported, + # additional elif should be added + + if disk_type == "containerDisk": + try: + image = disk["volume_spec"]["image"] + except KeyError: + raise KeyError("A container disk needs a " "containerized image") + + volumes_dict = {"containerDisk": {"image": image}, "name": disk_name} + elif disk_type == "persistentVolumeClaim": + if "volume_spec" not in disk: + raise KeyError("You must provide a volume_spec dictionary") + + if "claim_name" not in disk["volume_spec"]: + msg = ( + "You must provide either a claim_name of an " + "existing claim or if you want one to be " + "created you must additionally provide size " + "and the storage_class_name of the " + "cluster, which allows dynamic provisioning, " + "so a Persistent Volume Claim can be created. " + "In the latter case please provide the desired " + "size as well." + ) + raise KeyError(msg) + + claim_name = disk["volume_spec"]["claim_name"] + + if claim_name not in self.ex_list_persistent_volume_claims(namespace=namespace): + if ( + "size" not in disk["volume_spec"] + or "storage_class_name" not in disk["volume_spec"] + ): + msg = ( + "disk['volume_spec']['size'] and " + "disk['volume_spec']['storage_class_name'] " + "are both required to create " + "a new claim." + ) + raise KeyError(msg) + size = disk["volume_spec"]["size"] + storage_class = disk["volume_spec"]["storage_class_name"] + volume_mode = disk["volume_spec"].get("volume_mode", "Filesystem") + access_mode = disk["volume_spec"].get("access_mode", "ReadWriteOnce") + self.create_volume( + size=size, + name=claim_name, + location=location, + ex_storage_class_name=storage_class, + ex_volume_mode=volume_mode, + ex_access_mode=access_mode, + ) + + volumes_dict = { + "persistentVolumeClaim": {"claimName": claim_name}, + "name": disk_name, + } + else: + warnings.warn( + "The disk type {} is not tested. Use at your own risk.".format(disk_type) + ) + volumes_dict = {disk_type: disk.get("volume_spec", {}), "name": disk_name} + + disk_dict = {device: {"bus": bus}, "name": disk_name} + vm["spec"]["template"]["spec"]["domain"]["devices"]["disks"].append(disk_dict) + vm["spec"]["template"]["spec"]["volumes"].append(volumes_dict) + # end of for disk in ex_disks + + # image -> containerDisk -> add as the first disk + self._create_node_image(vm, image) + + @staticmethod + def _create_node_image(vm, image): # type: (dict, NodeImage) -> None + """ + A part of create_node that deals with the image of the VM. + It will fill the vm with the OS image as the first disk. + + :param vm: The VM template to be filled. + :param image: The image to be used as the OS disk. + See also the image parameter in create_node. + :type image: ``NodeImage`` or ``str`` + :return: None + """ + # image -> containerDisk + # adding image in a container Disk + + if isinstance(image, NodeImage): + image = image.name + + boot_disk_name = "boot-disk-" + str(uuid.uuid4()) + volumes_dict = {"containerDisk": {"image": image}, "name": boot_disk_name} + disk_dict = {"disk": {"bus": "virtio"}, "name": boot_disk_name} + + # boot disk should be the first one, otherwise it will not boot + vm["spec"]["template"]["spec"]["domain"]["devices"]["disks"].insert(0, disk_dict) + vm["spec"]["template"]["spec"]["volumes"].insert(0, volumes_dict) + + def create_node( + self, + name, # type: str + size, # type: NodeSize + image, # type: Union[NodeImage, str] + location=None, # type: Optional[NodeLocation] + auth=None, # type: Optional[Union[NodeAuthSSHKey, NodeAuthPassword]] + ex_cpu=None, # type: Optional[Union[int, str]] + ex_memory=None, # type: Optional[Union[int]] + ex_disks=None, # type: Optional[list] + ex_network=None, # type: Optional[dict] + ex_termination_grace_period=0, # type: Optional[int] + ex_ports=None, # type: Optional[dict] + ex_template=None, # type: Optional[dict] + ): # type: (...) -> Node + """ + Creating a VM with a containerDisk. + + @inherits: :class:`NodeDriver.create_node` + + The ``size`` parameter should be a ``NodeSize`` object that defines + the CPU and memory limits of the VM. + The ``NodeSize`` object must have the following attributes: + + - ram: int (in MiB) + - extra["cpu"]: int (in cores) + + An example NodeSize for a VM with 1 CPU and 2GiB of memory + (attributes except for ``ram`` and ``extra["cpu"]`` are not supported atm, + but they are required by the ``NodeSize`` object):: + + >>> size = NodeSize( + >>> id='small', # str: Size ID + >>> name='small', # str: Size name. Not used atm + >>> ram=2048, # int: Amount of memory (in MB) + >>> disk=20, # int: Amount of disk storage (in GB). Not used atm + >>> bandwidth=0, # int: Amount of bandwidth. Not used atm + >>> price=0, # float: Price (in US dollars) of running this node for an hour. Not used atm + >>> driver=KubeVirtNodeDriver # NodeDriver: Driver this size belongs to + >>> extra={ + >>> 'cpu': 1, # int: Number of CPUs provided by this size. + >>> }, + >>> ) + + The ``KubeVirtNodeSize`` wrapper can be used to create the ``NodeSize`` + object more easily:: + + >>> size = KubeVirtNodeSize( + >>> cpu=1, # int: Number of CPUs provided by this size. + >>> ram=2048, # int: Amount of memory (in MB) + >>> ) + + For legacy support, the ``ex_cpu`` and ``ex_memory`` parameters + can be used instead of ``size``: + + - ``ex_cpu``: The number of CPU cores to allocate to the VM. + ex_cpu must be a number (cores) or a string + ending with 'm' (miliCPUs). + - ``ex_memory``: The amount of memory to allocate to the VM in MiB. + + The ``image`` parameter can be either a ``NodeImage`` object + with a ``name`` attribute that points to a containerDisk image, + or a string representing the image URI. + + In both cases, it must point to a Docker image with an embedded disk. + May be a URI like `kubevirt/cirros-registry-disk-demo`, + kubevirt will automatically pull it from https://hub.docker.com/u/URI. + + For more info visit: https://kubevirt.io/user-guide/docs/latest/creating-virtual-machines/disks-and-volumes.html#containerdisk + + An example ``NodeImage``:: + + >>> image = NodeImage( + >>> id="something_unique", + >>> name="quay.io/containerdisks/ubuntu:22.04" + >>> driver=KubeVirtNodeDriver, + >>> ) + + The ``KubeVirtNodeImage`` wrapper can be used to create the ``NodeImage`` + object more easily:: + + >>> image = KubeVirtNodeImage( + >>> name="quay.io/containerdisks/ubuntu:22.04" + >>> ) + + The ``location`` parameter is a NodeLocation object + with the name being the kubernetes namespace where the VM will live. + If not provided, the VM will be created in the default namespace. + It can be created as the following:: + + >>> location = NodeLocation( + >>> name='default', # str: namespace + >>> ... # Other attributes are ignored + >>> ) + + The ``auth`` parameter is the authentication method for the VM, + either a ``NodeAuthSSHKey`` or a ``NodeAuthPassword``: + + - ``NodeAuthSSHKey(pubkey='pubkey data here')`` + - ``NodeAuthPassword(password='mysecretpassword')`` + + If the ``auth`` parameter is provided, the VM will be created with + a cloud-init volume that will inject the provided authentication + into the VM. + For details, see: + https://kubevirt.io/user-guide/virtual_machines/startup_scripts/#injecting-ssh-keys-with-cloud-inits-cloud-config + + The ``ex_disks`` parameter is a list of disk dictionaries that define + the disks of the VM. + Each dictionary should have specific keys for disk configuration. + + The following are optional keys: + + - ``"bus"``: can be "virtio", "sata", or "scsi" + - ``"device"``: can be "lun" or "disk" + + The following are required keys: + + - ``"disk_type"``: + One of the supported ``DISK_TYPES``. + Atm only "persistentVolumeClaim" and + "containerDisk" are promised to work. + Other types may work but are not tested. + + - ``"name"``: + The name of the disk configuration + + - ``"voulme_spec"``: + the dictionary that defines the volume of the disk. + The content is depending on the disk_type: + + For `containerDisk` the dictionary should have a key `image` with + the value being the image URI. + + For `persistentVolumeClaim` the dictionary should have a key + `claim_name` with the value being the name of the claim. + If you wish, a new Persistent Volume Claim can be + created by providing the following: + + - required: + - size: the desired size (implied in GB) + - storage_class_name: the name of the storage class to # NOQA + be used for the creation of the + Persistent Volume Claim. + Make sure it allows for + dynamic provisioning. + - optional: + - access_mode: default is ReadWriteOnce + - volume_mode: default is `Filesystem`, it can also be `Block` + + For other disk types, it will be translated to + a KubeVirt volume object as is:: + + {disk_type: , "name": disk_name} + + This dict will be translated to KubeVirt API object:: + + volumes: + - name: + : + + + Please refer to the KubeVirt API documentation + for volume specifications: + + https://kubevirt.io/user-guide/virtual_machines/disks_and_volumes + + An example ``ex_disks`` list with a hostDisk that will create a new + img file in the host machine:: + + >>> ex_disks = [ + >>> { + >>> "bus": "virtio", + >>> "device": "disk", + >>> "disk_type": "hostDisk", + >>> "name": "disk114514", + >>> "volume_spec": { + >>> "capacity": "10Gi", + >>> "path": "/tmp/kubevirt/data/disk114514.img", + >>> "type": "DiskOrCreate", + >>> }, + >>> }, + >>> ] + + The ``ex_network`` parameter is a dictionary that defines the network + of the VM. + Only the ``pod`` type is supported, and in the configuration + ``masquerade`` or ``bridge`` are the accepted values. + The parameter must be a dict:: + + { + "network_type": "pod", + "interface": "masquerade | bridge", + "name": "network_name" + } + + For advanced configurations not covered by the other parameters, + the ``ex_template`` parameter can be used to provide a dictionary of + kubernetes object that defines the KubeVirt VM. + Notice, If provided, ``ex_template`` will override all other parameters + except for ``name`` and ``location``. + + The ``ex_template`` parameter is a dictionary of kubernetes object: + + - ``apiVersion``: ``str`` + - ``kind``: ``str`` + - ``metadata``: ``dict`` + - ``spec``: ``dict`` + - ``domain``: ``dict`` + - ``volumes``: ``list`` + - ... + + See also: + + - https://kubernetes.io/docs/concepts/overview/working-with-objects/ + - https://kubevirt.io/api-reference/ + + :param name: A name to give the VM. The VM will be identified by + this name and atm it cannot be changed after it is set. + :type name: ``str`` + + :param size: The size of the VM in terms of CPU and memory. + A NodeSize object with the attributes + ``ram`` (int in MiB) and ``extra["cpu"]`` (int in cores). + :type size: ``NodeSize`` with + + :param image: Either a libcloud NodeImage or a string. + In both cases, it must a URL to the containerDisk image. + :type image: ``str`` or ``NodeImage`` + + :param location: The namespace where the VM will live. + (default is ``'default'``) + :type location: `NodeLocation`` in which the name is the namespace + + :param auth: authentication to a node. + :type auth: ``NodeAuthSSHKey`` or ``NodeAuthPassword``. + + :param ex_cpu: The number of CPU cores to allocate to the VM. + (Legacy support, consider using ``size`` instead) + :type ex_cpu: ``int`` or ``str`` + + :param ex_memory: The amount of memory to allocate to the VM in MiB. + (Legacy support, consider using ``size`` instead) + :type ex_memory: ``int`` + + :param ex_disks: A list containing disk dictionaries. + Each dictionary should have the following keys: + ``bus``: can be ``"virtio"``, ``"sata"``, or ``"scsi"``; + ``device``: can be ``"lun"`` or ``"disk"``; + ``disk_type``: One of the supported DISK_TYPES; + ``name``: The name of the disk configuration; + ``voulme_spec``: the dictionary that defines the volume of the disk. + + :type ex_disks: ``list`` of ``dict`` with keys: + ``bus: str``, ``device: str``, ``disk_type: str``, ``name: str`` + and ``voulme_spec: dict`` + + :param ex_network: a dictionary that defines the network of the VM. + The following keys are required: + ``network_type``: ``"pod"``; + ``interface``: ``"masquerade"`` or ``"bridge"``; + ``name``: ``"network_name"``. + :type ex_network: ``dict`` with keys: + ``network_type: str``, ``interface: str`` and ``name: str`` + + :param ex_termination_grace_period: The grace period in seconds before + the VM is forcefully terminated. + (default is 0) + :type ex_termination_grace_period: `int` + + :param ex_ports: A dictionary with keys: ``"ports_tcp"`` and ``"ports_udp"`` + ``"ports_tcp"`` value is a list of ints that indicate + the ports to be exposed with TCP protocol, + and ``"ports_udp"`` is a list of ints that indicate + the ports to be exposed with UDP protocol. + :type ex_ports: `dict` with keys + ``ports_tcp``: ``list`` of ``int``; + ``ports_udp``: ``list`` of ``int``. + + :param ex_template: A dictionary of kubernetes object that defines the + KubeVirt VM. This is for advanced vm specifications + that are not covered by the other parameters. + If provided, it will override all other parameters + except for `name` and `location`. + :type ex_template: ``dict`` with keys: + ``apiVersion: str``, ``kind: str``, ``metadata: dict`` + and ``spec: dict`` + """ + + # location -> namespace + + if isinstance(location, NodeLocation): + if location.name not in map(lambda x: x.name, self.list_locations()): + raise ValueError("The location must be one of the available namespaces") + namespace = location.name + else: + namespace = "default" + + # ex_template exists, use it to create the vm, ignore other parameters + + if ex_template is not None: + vm = self._create_node_vm_from_ex_template( + name=name, ex_template=ex_template, other_args=locals() + ) + + return self._create_node_with_template(name=name, template=vm, namespace=namespace) + # else (ex_template is None): create a vm with other parameters + vm = self._base_vm_template(name=name) + + # size -> cpu and memory limits + self._create_node_size(vm=vm, size=size, ex_cpu=ex_cpu, ex_memory=ex_memory) + + # ex_disks -> disks and volumes, image -> containerDisk + self._create_node_disks(vm, ex_disks, image, namespace, location) + + # auth -> cloud-init + + if auth is not None: + self._create_node_auth(vm, auth) + + # now, all disks and volumes stuff are done + + # ex_network and ex_ports -> network and interface + self._create_node_network(vm, ex_network, ex_ports) + + # terminationGracePeriodSeconds + + if ex_termination_grace_period is not None: + self._create_node_termination_grace_period(vm, ex_termination_grace_period) + + return self._create_node_with_template(name=name, template=vm, namespace=namespace) + + def list_images(self, location=None): + """ + If location (namespace) is provided only the images + in that location will be provided. Otherwise all of them. + """ + nodes = self.list_nodes() + + if location: + namespace = location.name + nodes = list(filter(lambda x: x["extra"]["namespace"] == namespace, nodes)) + name_set = set() + images = [] + + for node in nodes: + if node.image.name in name_set: + continue + name_set.add(node.image.name) + images.append(node.image) + + return images + + def list_locations(self): + """ + By locations here it is meant namespaces. + """ + req = ROOT_URL + "namespaces" + + namespaces = [] + result = self.connection.request(req).object + + for item in result["items"]: + name = item["metadata"]["name"] + ID = item["metadata"]["uid"] + namespaces.append( + NodeLocation(id=ID, name=name, country="", driver=self.connection.driver) + ) + + return namespaces + + def list_sizes(self, location=None): + namespace = "" + + if location: + namespace = location.name + nodes = self.list_nodes() + sizes = [] + + for node in nodes: + if not namespace: + sizes.append(node.size) + elif namespace == node.extra["namespace"]: + sizes.append(node.size) + + return sizes + + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + ex_storage_class_name="", + ex_volume_mode="Filesystem", + ex_access_mode="ReadWriteOnce", + ex_dynamic=True, + ex_reclaim_policy="Recycle", + ex_volume_type=None, + ex_volume_params=None, + ): + """ + :param size: The size in Gigabytes + :type size: `int` + + :param ex_volume_type: This is the type of volume to be created that is + dependent on the underlying cloud where Kubernetes + is deployed. K8s is supporting the following types: + -gcePersistentDisk + -awsElasticBlockStore + -azureFile + -azureDisk + -csi + -fc (Fibre Channel) + -flexVolume + -flocker + -nfs + -iSCSI + -rbd (Ceph Block Device) + -cephFS + -cinder (OpenStack block storage) + -glusterfs + -vsphereVolume + -quobyte Volumes + -hostPath (Single node testing only – local storage is not supported in any way and WILL NOT WORK in a multi-node cluster) # NOQA + -portworx Volumes + -scaleIO Volumes + -storageOS + This parameter is a dict in the form {type: {key1:value1, key2:value2,...}}, + where type is one of the above and key1, key2... are type specific keys and + their corresponding values. eg: {nsf: {server: "172.0.0.0", path: "/tmp"}} + {awsElasticBlockStore: {fsType: 'ext4', volumeID: "1234"}} + :type ex_volume_type: `str` + + :param ex_volume_params: A dict with the key:value that the + ``ex_volume_type`` needs. + This parameter is a dict in the form + {key1:value1, key2:value2,...}, + where type is one of the above and key1, key2... + are type specific keys and + their corresponding values. + eg: for nfs ``ex_volume_type`` + {server: "172.0.0.0", path: "/tmp"} + for awsElasticBlockStore ``ex_volume_type`` + {fsType: 'ext4', volumeID: "1234"} + :type ex_volume_params: ``dict`` + """ + + if ex_dynamic: + if location is None: + msg = "Please provide a namespace for the PVC." + raise ValueError(msg) + vol = self._create_volume_dynamic( + size=size, + name=name, + storage_class_name=ex_storage_class_name, + namespace=location.name, + volume_mode=ex_volume_mode, + access_mode=ex_access_mode, + ) + + return vol + else: + if ex_volume_type is None or ex_volume_params is None: + msg = ( + "An ex_volume_type must be provided from the list " + "of supported clouds, as well as the ex_volume_params " + "necessary for your volume type choice." + ) + raise ValueError(msg) + + pv = { + "apiVersion": "v1", + "kind": "PersistentVolume", + "metadata": {"name": name}, + "spec": { + "capacity": {"storage": str(size) + "Gi"}, + "volumeMode": ex_volume_mode, + "accessModes": [ex_access_mode], + "persistentVolumeReclaimPolicy": ex_reclaim_policy, + "storageClassName": ex_storage_class_name, + "mountOptions": [], # beta, to add in the future + ex_volume_type: ex_volume_params, + }, + } + + req = ROOT_URL + "persistentvolumes/" + method = "POST" + data = json.dumps(pv) + try: + self.connection.request(req, method=method, data=data) + + except Exception: + raise + # make sure that the volume was created + volumes = self.list_volumes() + + for volume in volumes: + if volume.name == name: + return volume + + def _create_volume_dynamic( + self, + size, + name, + storage_class_name, + volume_mode="Filesystem", + namespace="default", + access_mode="ReadWriteOnce", + ): + """ + Method to create a Persistent Volume Claim for storage, + thus storage is required in the arguments. + This method assumes dynamic provisioning of the + Persistent Volume so the storage_class given should + allow for it (by default it usually is), or already + have unbounded Persistent Volumes created by an admin. + + :param name: The name of the pvc an arbitrary string of lower letters + :type name: `str` + + :param size: An int of the amount of gigabytes desired + :type size: `int` + + :param namespace: The namespace where the claim will live + :type namespace: `str` + + :param storage_class_name: If you want the pvc to be bound to + a particular class of PVs specified here. + :type storage_class_name: `str` + + :param access_mode: The desired access mode, ie "ReadOnlyMany" + :type access_mode: `str` + + :param matchLabels: A dictionary with the labels, ie: + {'release': 'stable,} + :type matchLabels: `dict` with keys `str` and values `str` + """ + pvc = { + "apiVersion": "v1", + "kind": "PersistentVolumeClaim", + "metadata": {"name": name}, + "spec": { + "accessModes": [], + "volumeMode": volume_mode, + "resources": {"requests": {"storage": ""}}, + }, + } + + pvc["spec"]["accessModes"].append(access_mode) + + if storage_class_name is not None: + pvc["spec"]["storageClassName"] = storage_class_name + else: + raise ValueError( + "The storage class name must be provided of a" + "storage class which allows for dynamic " + "provisioning" + ) + pvc["spec"]["resources"]["requests"]["storage"] = str(size) + "Gi" + + method = "POST" + req = ROOT_URL + "namespaces/" + namespace + "/persistentvolumeclaims" + data = json.dumps(pvc) + try: + result = self.connection.request(req, method=method, data=data) + except Exception: + raise + + if result.object["status"]["phase"] != "Bound": + for _ in range(3): + req = ROOT_URL + "namespaces/" + namespace + "/persistentvolumeclaims/" + name + try: + result = self.connection.request(req).object + except Exception: + raise + + if result["status"]["phase"] == "Bound": + break + time.sleep(3) + + # check that the pv was created and bound + volumes = self.list_volumes() + + for volume in volumes: + if volume.extra["pvc"]["name"] == name: + return volume + + def _bind_volume(self, volume, namespace="default"): + """ + This method is for unbound volumes that were statically made. + It will bind them to a pvc so they can be used by + a kubernetes resource. + """ + + if volume.extra["is_bound"]: + return # volume already bound + + storage_class = volume.extra["storage_class_name"] + size = volume.size + name = volume.name + "-pvc" + volume_mode = volume.extra["volume_mode"] + access_mode = volume.extra["access_modes"][0] + + vol = self._create_volume_dynamic( + size=size, + name=name, + storage_class_name=storage_class, + volume_mode=volume_mode, + namespace=namespace, + access_mode=access_mode, + ) + + return vol + + def destroy_volume(self, volume): + # first delete the pvc + method = "DELETE" + + if volume.extra["is_bound"]: + pvc = volume.extra["pvc"]["name"] + namespace = volume.extra["pvc"]["namespace"] + req = ROOT_URL + "namespaces/" + namespace + "/persistentvolumeclaims/" + pvc + try: + result = self.connection.request(req, method=method) + + except Exception: + raise + + pv = volume.name + req = ROOT_URL + "persistentvolumes/" + pv + + try: + result = self.connection.request(req, method=method) + + return result.status + except Exception: + raise + + def attach_volume(self, node, volume, device="disk", ex_bus="virtio", ex_name=None): + """ + params: bus, name , device (disk or lun) + """ + # volume must be bound to a claim + + if not volume.extra["is_bound"]: + volume = self._bind_volume(volume, node.extra["namespace"]) + + if volume is None: + raise LibcloudError( + "Selected Volume (PV) could not be bound " + "(to a PVC), please select another volume", + driver=self, + ) + + claimName = volume.extra["pvc"]["name"] + + if ex_name is None: + name = claimName + else: + name = ex_name + namespace = volume.extra["pvc"]["namespace"] + # check if vm is stopped + self.stop_node(node) + # check if it is the same namespace + + if node.extra["namespace"] != namespace: + msg = "The PVC and the VM must be in the same namespace" + raise ValueError(msg) + vm = node.name + req = KUBEVIRT_URL + "namespaces/" + namespace + "/virtualmachines/" + vm + disk_dict = {device: {"bus": ex_bus}, "name": name} + volumes_dict = {"persistentVolumeClaim": {"claimName": claimName}, "name": name} + # Get all the volumes of the vm + try: + result = self.connection.request(req).object + except Exception: + raise + disks = result["spec"]["template"]["spec"]["domain"]["devices"]["disks"] + volumes = result["spec"]["template"]["spec"]["volumes"] + disks.append(disk_dict) + volumes.append(volumes_dict) + # now patch the new volumes and disks lists into the resource + headers = {"Content-Type": "application/merge-patch+json"} + data = { + "spec": { + "template": { + "spec": { + "volumes": volumes, + "domain": {"devices": {"disks": disks}}, + } + } + } + } + try: + result = self.connection.request( + req, method="PATCH", data=json.dumps(data), headers=headers + ) + + if "pvcs" in node.extra: + node.extra["pvcs"].append(claimName) + else: + node.extra["pvcs"] = [claimName] + + return result in VALID_RESPONSE_CODES + except Exception: + raise + + def detach_volume( + self, + volume, + ex_node=None, + ): + """ + Detaches a volume from a node but the node must be given since a PVC + can have more than one VMI's pointing to it + """ + # vmi must be stopped + self.stop_node(ex_node) + + claimName = volume.extra["pvc"]["name"] + name = ex_node.name + namespace = ex_node.extra["namespace"] + req = KUBEVIRT_URL + "namespaces/" + namespace + "/virtualmachines/" + name + headers = {"Content-Type": "application/merge-patch+json"} + # Get all the volumes of the vm + + try: + result = self.connection.request(req).object + except Exception: + raise + disks = result["spec"]["template"]["spec"]["domain"]["devices"]["disks"] + volumes = result["spec"]["template"]["spec"]["volumes"] + to_delete = None + + for volume in volumes: + if "persistentVolumeClaim" in volume: + if volume["persistentVolumeClaim"]["claimName"] == claimName: + to_delete = volume["name"] + volumes.remove(volume) + + break + + if not to_delete: + msg = "The given volume is not attached to the given VM" + raise ValueError(msg) + + for disk in disks: + if disk["name"] == to_delete: + disks.remove(disk) + + break + # now patch the new volumes and disks lists into the resource + data = { + "spec": { + "template": { + "spec": { + "volumes": volumes, + "domain": {"devices": {"disks": disks}}, + } + } + } + } + try: + result = self.connection.request( + req, method="PATCH", data=json.dumps(data), headers=headers + ) + ex_node.extra["pvcs"].remove(claimName) + + return result in VALID_RESPONSE_CODES + except Exception: + raise + + def ex_list_persistent_volume_claims(self, namespace="default"): + pvc_req = ROOT_URL + "namespaces/" + namespace + "/persistentvolumeclaims" + try: + result = self.connection.request(pvc_req).object + except Exception: + raise + pvcs = [item["metadata"]["name"] for item in result["items"]] + + return pvcs + + def ex_list_storage_classes(self): + # sc = storage class + sc_req = "/apis/storage.k8s.io/v1/storageclasses" + try: + result = self.connection.request(sc_req).object + except Exception: + raise + scs = [item["metadata"]["name"] for item in result["items"]] + + return scs + + def list_volumes(self): + """ + Location is a namespace of the cluster. + """ + volumes = [] + + pv_rec = ROOT_URL + "/persistentvolumes/" + + try: + result = self.connection.request(pv_rec).object + except Exception: + raise + + for item in result["items"]: + if item["status"]["phase"] not in {"Available", "Bound"}: + continue + ID = item["metadata"]["uid"] + size = item["spec"]["capacity"]["storage"] + size = int(size.rstrip("Gi")) + extra = {"pvc": {}} + extra["storage_class_name"] = item["spec"]["storageClassName"] + extra["is_bound"] = item["status"]["phase"] == "Bound" + extra["access_modes"] = item["spec"]["accessModes"] + extra["volume_mode"] = item["spec"]["volumeMode"] + + if extra["is_bound"]: + extra["pvc"]["name"] = item["spec"]["claimRef"]["name"] + extra["pvc"]["namespace"] = item["spec"]["claimRef"]["namespace"] + extra["pvc"]["uid"] = item["spec"]["claimRef"]["uid"] + name = extra["pvc"]["name"] + else: + name = item["metadata"]["name"] + volume = StorageVolume( + id=ID, name=name, size=size, driver=self.connection.driver, extra=extra + ) + volumes.append(volume) + + return volumes + + def _ex_connection_class_kwargs(self): + kwargs = {} + + if hasattr(self, "key_file"): + kwargs["key_file"] = self.key_file + + if hasattr(self, "cert_file"): + kwargs["cert_file"] = self.cert_file + + return kwargs + + def _to_node(self, vm, is_stopped=False): # type: (dict, bool) -> Node + """ + converts a vm from the kubevirt API to a libcloud node + + :param vm: kubevirt vm object + :type vm: dict + + :param is_stopped: if the vm is stopped, it will not have a pod + :type is_stopped: bool + + :return: a libcloud node + :rtype: :class:`Node` + """ + ID = vm["metadata"]["uid"] + name = vm["metadata"]["name"] + driver = self.connection.driver + extra = {"namespace": vm["metadata"]["namespace"]} + extra["pvcs"] = [] + + memory = 0 + + if "limits" in vm["spec"]["template"]["spec"]["domain"]["resources"]: + if "memory" in vm["spec"]["template"]["spec"]["domain"]["resources"]["limits"]: + memory = vm["spec"]["template"]["spec"]["domain"]["resources"]["limits"]["memory"] + elif vm["spec"]["template"]["spec"]["domain"]["resources"].get("requests", None): + if vm["spec"]["template"]["spec"]["domain"]["resources"]["requests"].get( + "memory", None + ): + memory = vm["spec"]["template"]["spec"]["domain"]["resources"]["requests"]["memory"] + memory = _memory_in_MB(memory) + + memory_req = ( + vm["spec"]["template"]["spec"]["domain"]["resources"] + .get("requests", {}) + .get("memory", None) + ) + + if memory_req: + memory_req = _memory_in_MB(memory_req) + else: + memory_req = memory + + cpu = 1 + + if vm["spec"]["template"]["spec"]["domain"]["resources"].get("limits", None): + if vm["spec"]["template"]["spec"]["domain"]["resources"]["limits"].get("cpu", None): + cpu = vm["spec"]["template"]["spec"]["domain"]["resources"]["limits"]["cpu"] + elif vm["spec"]["template"]["spec"]["domain"]["resources"].get("requests", None) and vm[ + "spec" + ]["template"]["spec"]["domain"]["resources"]["requests"].get("cpu", None): + cpu = vm["spec"]["template"]["spec"]["domain"]["resources"]["requests"]["cpu"] + cpu_req = cpu + elif vm["spec"]["template"]["spec"]["domain"].get("cpu", None): + cpu = vm["spec"]["template"]["spec"]["domain"]["cpu"].get("cores", 1) + + if not isinstance(cpu, int): + cpu = int(cpu.rstrip("m")) + + cpu_req = ( + vm["spec"]["template"]["spec"]["domain"]["resources"] + .get("requests", {}) + .get("cpu", None) + ) + + if cpu_req is None: + cpu_req = cpu + + extra_size = {"cpu": cpu, "cpu_request": cpu_req, "ram": memory, "ram_request": memory_req} + size_name = "{} vCPUs, {}MB Ram".format(str(cpu), str(memory)) + size_id = hashlib.md5(size_name.encode("utf-8")).hexdigest() # nosec + size = NodeSize( + id=size_id, + name=size_name, + ram=memory, + disk=0, + bandwidth=0, + price=0, + driver=driver, + extra=extra_size, + ) + + extra["memory"] = memory + extra["cpu"] = cpu + + image_name = "undefined" + + for volume in vm["spec"]["template"]["spec"]["volumes"]: + for k, v in volume.items(): + if type(v) is dict: + if "image" in v: + image_name = v["image"] + image = NodeImage(image_name, image_name, driver) + + if "volumes" in vm["spec"]["template"]["spec"]: + for volume in vm["spec"]["template"]["spec"]["volumes"]: + if "persistentVolumeClaim" in volume: + extra["pvcs"].append(volume["persistentVolumeClaim"]["claimName"]) + + port_forwards = [] + services = self.ex_list_services(namespace=extra["namespace"], node_name=name) + + for service in services: + service_type = service["spec"].get("type") + + for port_pair in service["spec"]["ports"]: + protocol = port_pair.get("protocol") + public_port = port_pair.get("port") + local_port = port_pair.get("targetPort") + try: + int(local_port) + except ValueError: + local_port = public_port + port_forwards.append( + { + "local_port": local_port, + "public_port": public_port, + "protocol": protocol, + "service_type": service_type, + } + ) + extra["port_forwards"] = port_forwards + + if is_stopped: + state = NodeState.STOPPED + public_ips = None + private_ips = None + + return Node( + id=ID, + name=name, + state=state, + public_ips=public_ips, + private_ips=private_ips, + driver=driver, + size=size, + image=image, + extra=extra, + ) + + # getting image and image_ID from the container + req = ROOT_URL + "namespaces/" + extra["namespace"] + "/pods" + result = self.connection.request(req).object + pod = None + + for pd in result["items"]: + if "metadata" in pd and "ownerReferences" in pd["metadata"]: + if pd["metadata"]["ownerReferences"][0]["name"] == name: + pod = pd + + if pod is None or "containerStatuses" not in pod["status"]: + state = NodeState.PENDING + public_ips = None + private_ips = None + + return Node( + id=ID, + name=name, + state=state, + public_ips=public_ips, + private_ips=private_ips, + driver=driver, + size=size, + image=image, + extra=extra, + ) + extra["pod"] = {"name": pod["metadata"]["name"]} + + for cont_status in pod["status"]["containerStatuses"]: + # only 2 containers are present the launcher and the vmi + + if cont_status["name"] != "compute": + image = NodeImage(ID, cont_status["image"], driver) + state = ( + NodeState.RUNNING if "running" in cont_status["state"] else NodeState.PENDING + ) + public_ips = None + created_at = datetime.strptime(vm["metadata"]["creationTimestamp"], "%Y-%m-%dT%H:%M:%SZ") + + if "podIPs" in pod["status"]: + private_ips = [ip["ip"] for ip in pod["status"]["podIPs"]] + else: + private_ips = [] + + return Node( + id=ID, + name=name, + state=state, + public_ips=public_ips, + private_ips=private_ips, + driver=driver, + size=size, + image=image, + extra=extra, + created_at=created_at, + ) + + def ex_list_services(self, namespace="default", node_name=None, service_name=None): + """ + If node_name is given then the services returned will be those that + concern the node. + """ + params = None + + if service_name is not None: + params = {"fieldSelector": "metadata.name={}".format(service_name)} + req = ROOT_URL + "/namespaces/{}/services".format(namespace) + result = self.connection.request(req, params=params).object["items"] + + if node_name: + res = [] + + for service in result: + if node_name in service["metadata"].get("name", ""): + res.append(service) + + return res + + return result + + def ex_create_service( + self, + node, + ports, + service_type="NodePort", + cluster_ip=None, + load_balancer_ip=None, + override_existing_ports=False, + ): + """ + Each node has a single service of one type on which the exposed ports + are described. If a service exists then the port declared will be + exposed alongside the existing ones, set override_existing_ports=True + to delete existing exposed ports and expose just the ones in the port + variable. + + :param node: the libcloud node for which the ports will be exposed + :type node: libcloud `Node` class + + :param ports: a list of dictionaries with keys --> values: + 'port' --> port to be exposed on the service; + 'target_port' --> port on the pod/node, optional + if empty then it gets the same + value as 'port' value; + 'protocol' ---> either 'UDP' or 'TCP', defaults to TCP; + 'name' --> A name for the service; + If ports is an empty `list` and a service exists of this + type then the service will be deleted. + :type ports: `list` of `dict` where each `dict` has keys --> values: + 'port' --> `int`; + 'target_port' --> `int`; + 'protocol' --> `str`; + 'name' --> `str`; + + :param service_type: Valid types are ClusterIP, NodePort, LoadBalancer + :type service_type: `str` + + :param cluster_ip: This can be set with an IP string value if you want + manually set the service's internal IP. If the value + is not correct the method will fail, this value can't + be updated. + :type cluster_ip: `str` + + :param override_existing_ports: Set to True if you want to delete the + existing ports exposed by the service + and keep just the ones declared in the + present ports argument. + By default it is false and if the + service already exists the ports will be + added to the existing ones. + :type override_existing_ports: `boolean` + """ + # check if service exists first + namespace = node.extra.get("namespace", "default") + service_name = "service-{}-{}".format(service_type.lower(), node.name) + service_list = self.ex_list_services(namespace=namespace, service_name=service_name) + + ports_to_expose = [] + # if ports has a falsey value like None or 0 + + if not ports: + ports = [] + + for port_group in ports: + if not port_group.get("target_port", None): + port_group["target_port"] = port_group["port"] + + if not port_group.get("name", ""): + port_group["name"] = "port-{}".format(port_group["port"]) + ports_to_expose.append( + { + "protocol": port_group.get("protocol", "TCP"), + "port": int(port_group["port"]), + "targetPort": int(port_group["target_port"]), + "name": port_group["name"], + } + ) + headers = None + data = None + + if len(service_list) > 0: + if not ports: + result = True + + for service in service_list: + service_name = service["metadata"]["name"] + result = result and self.ex_delete_service( + namespace=namespace, service_name=service_name + ) + + return result + else: + method = "PATCH" + spec = {"ports": ports_to_expose} + + if not override_existing_ports: + existing_ports = service_list[0]["spec"]["ports"] + spec = {"ports": existing_ports.extend(ports_to_expose)} + data = json.dumps({"spec": spec}) + headers = {"Content-Type": "application/merge-patch+json"} + req = "{}/namespaces/{}/services/{}".format(ROOT_URL, namespace, service_name) + else: + if not ports: + raise ValueError( + "Argument ports is empty but there is no " + "service of {} type to be deleted".format(service_type) + ) + method = "POST" + service = { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": service_name, + "labels": {"service": "kubevirt.io"}, + }, + "spec": { + "type": "", + "selector": {"kubevirt.io/vm": node.name}, + "ports": [], + }, + } + service["spec"]["ports"] = ports_to_expose + service["spec"]["type"] = service_type + + if cluster_ip is not None: + service["spec"]["clusterIP"] = cluster_ip + + if service_type == "LoadBalancer" and load_balancer_ip is not None: + service["spec"]["loadBalancerIP"] = load_balancer_ip + data = json.dumps(service) + req = "{}/namespaces/{}/services".format(ROOT_URL, namespace) + try: + result = self.connection.request(req, method=method, data=data, headers=headers) + except Exception: + raise + + return result.status in VALID_RESPONSE_CODES + + def ex_delete_service(self, namespace, service_name): + req = "{}/namespaces/{}/services/{}".format(ROOT_URL, namespace, service_name) + headers = {"Content-Type": "application/yaml"} + try: + result = self.connection.request(req, method="DELETE", headers=headers) + except Exception: + raise + + return result.status in VALID_RESPONSE_CODES + + +def _deep_merge_dict(source: dict, destination: dict) -> dict: + """ + Deep merge two dictionaries: source into destination. + For conflicts, prefer source's non-zero values over destination's. + (By non-zero, we mean that bool(value) is True.) + + Extended from https://stackoverflow.com/a/20666342, added zero value handling. + + Example:: + + >>> a = {"domain": {"devices": 0}, "volumes": [1, 2, 3], "network": {}} + >>> b = {"domain": {"machine": "non-exist-in-a", "devices": 1024}, "volumes": [4, 5, 6]} + >>> _deep_merge_dict(a, b) + {'domain': {'machine': 'non-exist-in-a', 'devices': 1024}, 'volumes': [1, 2, 3], 'network': {}} + + In the above example: + + - network: exists in source (a) but not in destination (b): add source (a)'s + - volumes: exists in both, both are non-zero: prefer source (a)'s + - devices: exists in both: source (a) is zero, destination (b) is non-zero: keep destination (b)'s + - machine: exists in destination (b) but not in source (a): reserve destination (b)'s + + :param source: RO: A dict to be merged into another. + Do not use circular dict (e.g. d = {}; d['d'] = d) as source, + otherwise a RecursionError will be raised. + :param destination: RW: A dict to be merged into. (the value will be modified). + + :return: dict: Updated destination. + """ + + for key, value in source.items(): + if isinstance(value, dict): # recurse for dicts + node = destination.setdefault(key, {}) # get node or create one + _deep_merge_dict(value, node) + elif key not in destination: # not existing in destination: add it + destination[key] = value + elif value: # existing: update if source's value is non-zero + destination[key] = value + + return destination + + +def _memory_in_MB(memory): # type: (Union[str, int]) -> int + """ + parse k8s memory resource units to MiB or MB (depending on input) + + Note: + + - 1 MiB = 1024 KiB = 1024 * 1024 B = 1048576 B + - 1 MB = 1000 KB = 1000 * 1000 B = 1000000 B + + Reference: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory + + :param memory: Limits and requests for memory are measured in bytes. + You can express memory as a plain integer or as a fixed-point integer using one of these suffixes: + E, P, T, G, M, K, Ei, Pi, Ti, Gi, Mi, Ki + For example, the following represent roughly the same value: + 128974848, 129e6, 129M, 123Mi + :type memory: ``str`` or ``int`` + + :return: memory in MiB (if input is `int` bytes or `str` with suffix `?i`) + or in MB (if input is `str` with suffix `?`) + :rtype: ``int`` + """ + + try: + mem_bytes = int(memory) + + return mem_bytes // 1024 // 1024 + except ValueError: + pass + + if not isinstance(memory, str): + raise ValueError("memory must be int or str") + + if memory.endswith("Ei"): + return int(memory.rstrip("Ei")) * 1024 * 1024 * 1024 * 1024 + elif memory.endswith("Pi"): + return int(memory.rstrip("Pi")) * 1024 * 1024 * 1024 + elif memory.endswith("Ti"): + return int(memory.rstrip("Ti")) * 1024 * 1024 + elif memory.endswith("Gi"): + return int(memory.rstrip("Gi")) * 1024 + elif memory.endswith("Mi"): + return int(memory.rstrip("Mi")) + elif memory.endswith("Ki"): + return int(memory.rstrip("Ki")) // 1024 + elif memory.endswith("E"): + return int(memory.rstrip("E")) * 1000 * 1000 * 1000 * 1000 + elif memory.endswith("P"): + return int(memory.rstrip("P")) * 1000 * 1000 * 1000 + elif memory.endswith("T"): + return int(memory.rstrip("T")) * 1000 * 1000 + elif memory.endswith("G"): + return int(memory.rstrip("G")) * 1000 + elif memory.endswith("M"): + return int(memory.rstrip("M")) + elif memory.endswith("K"): + return int(memory.rstrip("K")) // 1000 + else: + raise ValueError("memory unit not supported {}".format(memory)) + + +def KubeVirtNodeSize( + cpu, ram, cpu_request=None, ram_request=None +): # type: (int, int, Optional[int], Optional[int]) -> NodeSize + """ + Create a NodeSize object for KubeVirt driver. + + This function is just a shorthand for ``NodeSize(ram=ram, extra={"cpu": cpu})``. + + :param cpu: number of virtual CPUs (max limit) + :type cpu: ``int`` + + :param ram: amount of RAM in MiB (max limit) + :type ram: ``int`` + + :param cpu_request: number of virtual CPUs (min request) + :type cpu_request: ``int`` + + :param ram_request: amount of RAM in MiB (min request) + :type ram_request: ``int`` + + :return: a NodeSize object with ram and extra.cpu set + :rtype: :class:`NodeSize` + """ + extra = {"cpu": cpu} + + extra["cpu_request"] = cpu_request or cpu + extra["ram_request"] = ram_request or ram + + name = "{} vCPUs, {}MB Ram".format(str(cpu), str(ram)) + size_id = hashlib.md5(name.encode("utf-8")).hexdigest() # nosec + + return NodeSize( + id=size_id, + name=name, + ram=ram, + disk=0, + bandwidth=0, + price=0, + driver=KubeVirtNodeDriver, + extra=extra, + ) + + +def KubeVirtNodeImage(name): # type: (str) -> NodeImage + """ + Create a NodeImage object for KubeVirt driver. + + This function is just a shorthand for ``NodeImage(name=name)``. + + :param name: image source + :type name: ``str`` + + :return: a NodeImage object with the name set to the source to a + containerDisk image (e.g. ``"quay.io/containerdisks/ubuntu:22.04"``) + :rtype: :class:`NodeImage` + """ + image_id = hashlib.md5(name.encode("utf-8")).hexdigest() # nosec + + return NodeImage(id=image_id, name=name, driver=KubeVirtNodeDriver) diff --git a/libcloud/compute/drivers/libvirt_driver.py b/libcloud/compute/drivers/libvirt_driver.py index 3618ac4368..91b56eee6e 100644 --- a/libcloud/compute/drivers/libvirt_driver.py +++ b/libcloud/compute/drivers/libvirt_driver.py @@ -12,30 +12,24 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement -import re import os +import re import time import platform -import subprocess import mimetypes - +import subprocess from os.path import join as pjoin from collections import defaultdict -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - -from libcloud.compute.base import NodeDriver, Node -from libcloud.compute.base import NodeState +from libcloud.utils.py3 import ET, ensure_string +from libcloud.compute.base import Node, NodeState, NodeDriver from libcloud.compute.types import Provider from libcloud.utils.networking import is_public_subnet try: import libvirt + have_libvirt = True except ImportError: have_libvirt = False @@ -49,8 +43,8 @@ class LibvirtNodeDriver(NodeDriver): """ type = Provider.LIBVIRT - name = 'Libvirt' - website = 'http://libvirt.org/' + name = "Libvirt" + website = "http://libvirt.org/" NODE_STATE_MAP = { 0: NodeState.TERMINATED, # no state @@ -63,18 +57,61 @@ class LibvirtNodeDriver(NodeDriver): 7: NodeState.UNKNOWN, # domain is suspended by guest power management } - def __init__(self, uri): + def __init__(self, uri, key=None, secret=None): """ :param uri: Hypervisor URI (e.g. vbox:///session, qemu:///system, etc.). :type uri: ``str`` + + :param key: the username for a remote libvirtd server + :type key: ``str`` + + :param secret: the password for a remote libvirtd server + :type key: ``str`` """ if not have_libvirt: - raise RuntimeError('Libvirt driver requires \'libvirt\' Python ' + - 'package') + raise RuntimeError("Libvirt driver requires 'libvirt' Python " + "package") self._uri = uri - self.connection = libvirt.open(uri) + self._key = key + self._secret = secret + if uri is not None and "+tcp" in self._uri: + if key is None and secret is None: + raise RuntimeError( + "The remote Libvirt instance requires " + + "authentication, please set 'key' and " + + "'secret' parameters" + ) + auth = [ + [libvirt.VIR_CRED_AUTHNAME, libvirt.VIR_CRED_PASSPHRASE], + self._cred_callback, + None, + ] + self.connection = libvirt.openAuth(uri, auth, 0) + else: + self.connection = libvirt.open(uri) + if uri is None: + self._uri = self.connection.getInfo() + + def _cred_callback(self, cred, user_data): + """ + Callback for the authentication scheme, which will provide username + and password for the login. Reference: ( http://bit.ly/1U5yyQg ) + + :param cred: The credentials requested and the return + :type cred: ``list`` + + :param user_data: Custom data provided to the authentication routine + :type user_data: ``list`` + + :rtype: ``int`` + """ + for credential in cred: + if credential[0] == libvirt.VIR_CRED_AUTHNAME: + credential[4] = self._key + elif credential[0] == libvirt.VIR_CRED_PASSPHRASE: + credential[4] = self._secret + return 0 def list_nodes(self): domains = self.connection.listAllDomains() @@ -89,7 +126,18 @@ def destroy_node(self, node): domain = self._get_domain_for_node(node=node) return domain.destroy() == 0 + def start_node(self, node): + domain = self._get_domain_for_node(node=node) + return domain.create() == 0 + + def stop_node(self, node): + domain = self._get_domain_for_node(node=node) + return domain.shutdown() == 0 + def ex_start_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 """ Start a stopped node. @@ -98,10 +146,12 @@ def ex_start_node(self, node): :rtype: ``bool`` """ - domain = self._get_domain_for_node(node=node) - return domain.create() == 0 + return self.start_node(node=node) def ex_shutdown_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 """ Shutdown a running node. @@ -112,8 +162,7 @@ def ex_shutdown_node(self, node): :rtype: ``bool`` """ - domain = self._get_domain_for_node(node=node) - return domain.shutdown() == 0 + return self.stop_node(node=node) def ex_suspend_node(self, node): """ @@ -139,6 +188,28 @@ def ex_resume_node(self, node): domain = self._get_domain_for_node(node=node) return domain.resume() == 0 + def ex_get_node_by_uuid(self, uuid): + """ + Retrieve Node object for a domain with a provided uuid. + + :param uuid: Uuid of the domain. + :type uuid: ``str`` + """ + domain = self._get_domain_for_uuid(uuid=uuid) + node = self._to_node(domain=domain) + return node + + def ex_get_node_by_name(self, name): + """ + Retrieve Node object for a domain with a provided name. + + :param name: Name of the domain. + :type name: ``str`` + """ + domain = self._get_domain_for_name(name=name) + node = self._to_node(domain=domain) + return node + def ex_take_node_screenshot(self, node, directory, screen=0): """ Take a screenshot of a monitoring of a running instance. @@ -156,7 +227,7 @@ def ex_take_node_screenshot(self, node, directory, screen=0): :rtype: ``str`` """ if not os.path.exists(directory) or not os.path.isdir(directory): - raise ValueError('Invalid value for directory argument') + raise ValueError("Invalid value for directory argument") domain = self._get_domain_for_node(node=node) stream = self.connection.newStream() @@ -166,12 +237,13 @@ def ex_take_node_screenshot(self, node, directory, screen=0): if extensions: extension = extensions[0] else: - extension = '.png' + extension = ".png" - name = 'screenshot-%s%s' % (int(time.time()), extension) + name = "screenshot-{}{}".format(int(time.time()), extension) file_path = pjoin(directory, name) - with open(file_path, 'wb') as fp: + with open(file_path, "wb") as fp: + def write(stream, buf, opaque): fp.write(buf) @@ -201,7 +273,7 @@ def ex_get_hypervisor_sysinfo(self): xml = self.connection.getSysinfo() etree = ET.XML(xml) - attributes = ['bios', 'system', 'processor', 'memory_device'] + attributes = ["bios", "system", "processor", "memory_device"] sysinfo = {} for attribute in attributes: @@ -229,14 +301,24 @@ def _to_node(self, domain): else: private_ips.append(ip_address) - extra = {'uuid': domain.UUIDString(), 'os_type': domain.OSType(), - 'types': self.connection.getType(), - 'used_memory': memory / 1024, 'vcpu_count': vcpu_count, - 'used_cpu_time': used_cpu_time} - - node = Node(id=domain.ID(), name=domain.name(), state=state, - public_ips=public_ips, private_ips=private_ips, - driver=self, extra=extra) + extra = { + "uuid": domain.UUIDString(), + "os_type": domain.OSType(), + "types": self.connection.getType(), + "used_memory": memory / 1024, + "vcpu_count": vcpu_count, + "used_cpu_time": used_cpu_time, + } + + node = Node( + id=domain.ID(), + name=domain.name(), + state=state, + public_ips=public_ips, + private_ips=private_ips, + driver=self, + extra=extra, + ) node._uuid = domain.UUIDString() # we want to use a custom UUID return node @@ -253,17 +335,28 @@ def _get_ip_addresses_for_domain(self, domain): """ result = [] - if platform.system() != 'Linux': + if platform.system() != "Linux": # Only Linux is supported atm return result + if "///" not in self._uri: + # Only local libvirtd is supported atm + return result + mac_addresses = self._get_mac_addresses_for_domain(domain=domain) - cmd = ['arp', '-an'] - child = subprocess.Popen(cmd, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - stdout, _ = child.communicate() - arp_table = self._parse_arp_table(arp_output=stdout) + arp_table = {} + try: + cmd = ["arp", "-an"] + child = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, _ = child.communicate() + arp_table = self._parse_ip_table_arp(arp_output=stdout) + except OSError as e: + if e.errno == 2: + cmd = ["ip", "neigh"] + child = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, _ = child.communicate() + arp_table = self._parse_ip_table_neigh(ip_output=stdout) for mac_address in mac_addresses: if mac_address in arp_table: @@ -282,7 +375,7 @@ def _get_mac_addresses_for_domain(self, domain): result = [] for elem in elems: - mac_address = elem.get('address') + mac_address = elem.get("address") result.append(mac_address) return result @@ -294,35 +387,71 @@ def _get_domain_for_node(self, node): domain = self.connection.lookupByUUIDString(node.uuid) return domain + def _get_domain_for_uuid(self, uuid): + """ + Return libvirt domain object for the provided uuid. + """ + domain = self.connection.lookupByUUIDString(uuid) + return domain + + def _get_domain_for_name(self, name): + """ + Return libvirt domain object for the provided name. + """ + domain = self.connection.lookupByName(name) + return domain + def _get_entries(self, element): """ Parse entries dictionary. :rtype: ``dict`` """ - elements = element.findall('entry') + elements = element.findall("entry") result = {} for element in elements: - name = element.get('name') + name = element.get("name") value = element.text result[name] = value return result - def _parse_arp_table(self, arp_output): + def _parse_ip_table_arp(self, arp_output): + """ + Sets up the regexp for parsing out IP addresses from the 'arp -an' + command and pass it along to the parser function. + + :return: Dictionary from the parsing function + :rtype: ``dict`` + """ + arp_regex = re.compile(r".*?\((.*?)\) at (.*?)\s+") + return self._parse_mac_addr_table(arp_output, arp_regex) + + def _parse_ip_table_neigh(self, ip_output): + """ + Sets up the regexp for parsing out IP addresses from the 'ip neighbor' + command and pass it along to the parser function. + + :return: Dictionary from the parsing function + :rtype: ``dict`` + """ + ip_regex = re.compile(r"(.*?)\s+.*lladdr\s+(.*?)\s+") + return self._parse_mac_addr_table(ip_output, ip_regex) + + def _parse_mac_addr_table(self, cmd_output, mac_regex): """ - Parse arp command output and return a dictionary which maps mac address + Parse the command output and return a dictionary which maps mac address to an IP address. :return: Dictionary which maps mac address to IP address. :rtype: ``dict`` """ - lines = arp_output.split('\n') + lines = ensure_string(cmd_output).split("\n") arp_table = defaultdict(list) for line in lines: - match = re.match('.*?\((.*?)\) at (.*?)\s+', line) + match = mac_regex.match(line) if not match: continue diff --git a/libcloud/compute/drivers/linode.py b/libcloud/compute/drivers/linode.py index c3a96427ed..255aa4cdc5 100644 --- a/libcloud/compute/drivers/linode.py +++ b/libcloud/compute/drivers/linode.py @@ -16,668 +16,1130 @@ """libcloud driver for the Linode(R) API This driver implements all libcloud functionality for the Linode API. -Since the API is a bit more fine-grained, create_node abstracts a significant -amount of work (and may take a while to run). Linode home page http://www.linode.com/ -Linode API documentation http://www.linode.com/api/ -Alternate bindings for reference http://github.com/tjfontaine/linode-python +Linode API documentation https://www.linode.com/docs/api/ Linode(R) is a registered trademark of Linode, LLC. """ -import os +import re +import binascii +from datetime import datetime + +from libcloud.utils.py3 import httplib +from libcloud.compute.base import ( + Node, + KeyPair, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, +) +from libcloud.common.linode import ( + DEFAULT_API_VERSION, + LINODE_DISK_FILESYSTEMS_V4, + LinodeDisk, + LinodeIPAddress, + LinodeExceptionV4, + LinodeConnectionV4, +) +from libcloud.compute.types import Provider, NodeState, StorageVolumeState +from libcloud.utils.networking import is_private_subnet try: import simplejson as json except ImportError: import json -import itertools -import binascii - -from copy import copy - -from libcloud.utils.py3 import PY3 - -from libcloud.common.linode import (API_ROOT, LinodeException, - LinodeConnection, LINODE_PLAN_IDS, - LINODE_DISK_FILESYSTEMS) -from libcloud.compute.types import Provider, NodeState -from libcloud.compute.base import NodeDriver, NodeSize, Node, NodeLocation -from libcloud.compute.base import NodeAuthPassword, NodeAuthSSHKey -from libcloud.compute.base import NodeImage, StorageVolume - class LinodeNodeDriver(NodeDriver): - """libcloud driver for the Linode API - - Rough mapping of which is which: - - list_nodes linode.list - reboot_node linode.reboot - destroy_node linode.delete - create_node linode.create, linode.update, - linode.disk.createfromdistribution, - linode.disk.create, linode.config.create, - linode.ip.addprivate, linode.boot - list_sizes avail.linodeplans - list_images avail.distributions - list_locations avail.datacenters - list_volumes linode.disk.list - destroy_volume linode.disk.delete - - For more information on the Linode API, be sure to read the reference: - - http://www.linode.com/api/ - """ - type = Provider.LINODE name = "Linode" - website = 'http://www.linode.com/' - connectionCls = LinodeConnection - _linode_plan_ids = LINODE_PLAN_IDS - _linode_disk_filesystems = LINODE_DISK_FILESYSTEMS - features = {'create_node': ['ssh_key', 'password']} + website = "http://www.linode.com/" + type = Provider.LINODE - def __init__(self, key): - """Instantiate the driver with the given API key + def __new__( + cls, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=DEFAULT_API_VERSION, + region=None, + **kwargs, + ): + if cls is LinodeNodeDriver: + if api_version == "4.0": + cls = LinodeNodeDriverV4 + else: + raise NotImplementedError( + "No Linode driver found for API version: %s" % (api_version) + ) + return super().__new__(cls) - :param key: the API key to use (required) - :type key: ``str`` - :rtype: ``None`` - """ - self.datacenter = None - NodeDriver.__init__(self, key) +class LinodeNodeDriverV4(LinodeNodeDriver): + connectionCls = LinodeConnectionV4 + _linode_disk_filesystems = LINODE_DISK_FILESYSTEMS_V4 - # Converts Linode's state from DB to a NodeState constant. LINODE_STATES = { - (-2): NodeState.UNKNOWN, # Boot Failed - (-1): NodeState.PENDING, # Being Created - 0: NodeState.PENDING, # Brand New - 1: NodeState.RUNNING, # Running - 2: NodeState.TERMINATED, # Powered Off - 3: NodeState.REBOOTING, # Shutting Down - 4: NodeState.UNKNOWN # Reserved + "running": NodeState.RUNNING, + "stopped": NodeState.STOPPED, + "provisioning": NodeState.STARTING, + "offline": NodeState.STOPPED, + "booting": NodeState.STARTING, + "rebooting": NodeState.REBOOTING, + "shutting_down": NodeState.STOPPING, + "deleting": NodeState.PENDING, + "migrating": NodeState.MIGRATING, + "rebuilding": NodeState.UPDATING, + "cloning": NodeState.MIGRATING, + "restoring": NodeState.PENDING, + "resizing": NodeState.RECONFIGURING, + } + + LINODE_DISK_STATES = { + "ready": StorageVolumeState.AVAILABLE, + "not ready": StorageVolumeState.CREATING, + "deleting": StorageVolumeState.DELETING, + } + + LINODE_VOLUME_STATES = { + "creating": StorageVolumeState.CREATING, + "active": StorageVolumeState.AVAILABLE, + "resizing": StorageVolumeState.UPDATING, + "contact_support": StorageVolumeState.UNKNOWN, } def list_nodes(self): """ - List all Linodes that the API key can access - - This call will return all Linodes that the API key in use has access - to. - If a node is in this list, rebooting will work; however, creation and - destruction are a separate grant. + Returns a list of Linodes the API key in use has access + to view. - :return: List of node objects that the API key can access + :return: List of node objects :rtype: ``list`` of :class:`Node` """ - params = {"api_action": "linode.list"} - data = self.connection.request(API_ROOT, params=params).objects[0] - return self._to_nodes(data) - def reboot_node(self, node): + data = self._paginated_request("/v4/linode/instances", "data") + return [self._to_node(obj) for obj in data] + + def list_sizes( + self, + location=None, + ): """ - Reboot the given Linode + Returns a list of Linode Types - Will issue a shutdown job followed by a boot job, using the last booted - configuration. In most cases, this will be the only configuration. + : rtype: ``list`` of :class: `NodeSize` + """ + data = self._paginated_request("/v4/linode/types", "data") + return [self._to_size(obj) for obj in data] - :param node: the Linode to reboot - :type node: :class:`Node` + def list_images( + self, + location=None, + ): + """ + Returns a list of images + + :rtype: ``list`` of :class:`NodeImage` + """ + data = self._paginated_request("/v4/images", "data") + return [self._to_image(obj) for obj in data] + + def create_key_pair(self, name, public_key=""): + """ + Creates an SSH keypair + + :param name: The name to be given to the keypair (required).\ + :type name: `str` + + :keyword public_key: Contents of the public key the the SSH key pair + :type public_key: `str` + + :rtype: :class: `KeyPair` + """ + attr = {"label": name, "ssh_key": public_key} + response = self.connection.request( + "/v4/profile/sshkeys", data=json.dumps(attr), method="POST" + ).object + return self._to_key_pair(response) + + def list_key_pairs(self): + """ + Provide a list of all the SSH keypairs in your account. + + :rtype: ``list`` of :class: `KeyPair` + """ + data = self._paginated_request("/v4/profile/sshkeys", "data") + return [self._to_key_pair(obj) for obj in data] + + def list_locations(self): + """ + Lists the Regions available for Linode services + + :rtype: ``list`` of :class:`NodeLocation` + """ + data = self._paginated_request("/v4/regions", "data") + return [self._to_location(obj) for obj in data] + + def start_node(self, node): + """Boots a node the API Key has permission to modify + + :param node: the node to start + :type node: :class:`Node` :rtype: ``bool`` """ - params = {"api_action": "linode.reboot", "LinodeID": node.id} - self.connection.request(API_ROOT, params=params) - return True + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") - def destroy_node(self, node): - """Destroy the given Linode + response = self.connection.request("/v4/linode/instances/%s/boot" % node.id, method="POST") + return response.status == httplib.OK - Will remove the Linode from the account and issue a prorated credit. A - grant for removing Linodes from the account is required, otherwise this - method will fail. + def ex_start_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.start_node(node=node) - In most cases, all disk images must be removed from a Linode before the - Linode can be removed; however, this call explicitly skips those - safeguards. There is no going back from this method. + def stop_node(self, node): + """Shuts down a a node the API Key has permission to modify. :param node: the Linode to destroy :type node: :class:`Node` :rtype: ``bool`` """ - params = {"api_action": "linode.delete", "LinodeID": node.id, - "skipChecks": True} - self.connection.request(API_ROOT, params=params) - return True + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") - def create_node(self, **kwargs): - """Create a new Linode, deploy a Linux distribution, and boot + response = self.connection.request( + "/v4/linode/instances/%s/shutdown" % node.id, method="POST" + ) + return response.status == httplib.OK - This call abstracts much of the functionality of provisioning a Linode - and getting it booted. A global grant to add Linodes to the account is - required, as this call will result in a billing charge. + def ex_stop_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.stop_node(node=node) - Note that there is a safety valve of 5 Linodes per hour, in order to - prevent a runaway script from ruining your day. + def destroy_node(self, node): + """Deletes a node the API Key has permission to `read_write` - :keyword name: the name to assign the Linode (mandatory) - :type name: ``str`` + :param node: the Linode to destroy + :type node: :class:`Node` - :keyword image: which distribution to deploy on the Linode (mandatory) - :type image: :class:`NodeImage` + :rtype: ``bool`` + """ + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") - :keyword size: the plan size to create (mandatory) - :type size: :class:`NodeSize` + response = self.connection.request("/v4/linode/instances/%s" % node.id, method="DELETE") + return response.status == httplib.OK - :keyword auth: an SSH key or root password (mandatory) - :type auth: :class:`NodeAuthSSHKey` or :class:`NodeAuthPassword` + def reboot_node(self, node): + """Reboots a node the API Key has permission to modify. + + :param node: the Linode to destroy + :type node: :class:`Node` - :keyword location: which datacenter to create the Linode in + :rtype: ``bool`` + """ + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") + + response = self.connection.request( + "/v4/linode/instances/%s/reboot" % node.id, method="POST" + ) + return response.status == httplib.OK + + def create_node( + self, + # Previously, the following 3 parameters did not match the rest of the libcloud + # codebase drivers. They should be in the same order as other compute drivers. + # Previously, it looked like this: + # size, + # image=None, + # name=None, + # + # Comments welcome on how backwards compatibility (if any) should work here. + # Since it was not compatible with other drivers, it is not clear to me if this + # would break anyone's codebase if they were not using any other libcloud drivers + # to other cloud providers in the first place. If they were not, that seems to + # kind of defeat the purpose of using libcloud. + name, # Can be None + size, # Can be None + image, # Can be None + location=None, + auth=None, + root_pass=None, + ex_authorized_keys=None, + ex_authorized_users=None, + ex_tags=None, + ex_backups_enabled=False, + ex_private_ip=False, + ex_userdata=None, + ): + """Creates a Linode Instance. + In order for this request to complete successfully, + the user must have the `add_linodes` grant as this call + will incur a charge. + + :param location: which region to create the node in :type location: :class:`NodeLocation` - :keyword ex_swap: size of the swap partition in MB (128) - :type ex_swap: ``int`` + :param size: the plan size to create + :type size: :class:`NodeSize` + + :keyword image: which distribution to deploy on the node + :type image: :class:`NodeImage` - :keyword ex_rsize: size of the root partition in MB (plan size - swap). - :type ex_rsize: ``int`` + :keyword name: the name to assign to node.\ + Must start with an alpha character.\ + May only consist of alphanumeric characters,\ + dashes (-), underscores (_) or periods (.).\ + Cannot have two dashes (--), underscores (__) or periods (..) in a row. + :type name: ``str`` - :keyword ex_kernel: a kernel ID from avail.kernels (Latest 2.6 Stable). - :type ex_kernel: ``str`` + :keyword root_pass: the root password (required if image is provided) + :type root_pass: ``str`` - :keyword ex_payment: one of 1, 12, or 24; subscription length (1) - :type ex_payment: ``int`` + :keyword ex_authorized_keys: a list of public SSH keys + :type ex_authorized_keys: ``list`` of ``str`` - :keyword ex_comment: a small comment for the configuration (libcloud) - :type ex_comment: ``str`` + :keyword ex_authorized_users: a list of usernames.\ + If the usernames have associated SSH keys,\ + the keys will be appended to the root users `authorized_keys` + :type ex_authorized_users: ``list`` of ``str`` - :keyword ex_private: whether or not to request a private IP (False) - :type ex_private: ``bool`` + :keyword ex_tags: list of tags for the node + :type ex_tags: ``list`` of ``str`` - :keyword lconfig: what to call the configuration (generated) - :type lconfig: ``str`` + :keyword ex_backups_enabled: whether to be enrolled \ + in the Linode Backup service (False) + :type ex_backups_enabled: ``bool`` - :keyword lroot: what to call the root image (generated) - :type lroot: ``str`` + :keyword ex_private_ip: whether or not to request a private IP + :type ex_private_ip: ``bool`` - :keyword lswap: what to call the swap space (generated) - :type lswap: ``str`` + :keyword ex_userdata: add cloud-config compatible userdata to be + processed by cloud-init inside the Linode instance. NOTE: the + contents of this string must be base64 encoded before passing + it to this function. + :type ex_userdata: ``str`` - :return: Node representing the newly-created Linode + :return: Node representing the newly-created node :rtype: :class:`Node` """ - name = kwargs["name"] - image = kwargs["image"] - size = kwargs["size"] - auth = self._get_and_check_auth(kwargs["auth"]) - # Pick a location (resolves LIBCLOUD-41 in JIRA) - if "location" in kwargs: - chosen = kwargs["location"].id - elif self.datacenter: - chosen = self.datacenter - else: - raise LinodeException(0xFB, "Need to select a datacenter first") - - # Step 0: Parameter validation before we purchase - # We're especially careful here so we don't fail after purchase, rather - # than getting halfway through the process and having the API fail. - - # Plan ID - plans = self.list_sizes() - if size.id not in [p.id for p in plans]: - raise LinodeException(0xFB, "Invalid plan ID -- avail.plans") - - # Payment schedule - payment = "1" if "ex_payment" not in kwargs else \ - str(kwargs["ex_payment"]) - if payment not in ["1", "12", "24"]: - raise LinodeException(0xFB, "Invalid subscription (1, 12, 24)") - - ssh = None - root = None - # SSH key and/or root password - if isinstance(auth, NodeAuthSSHKey): - ssh = auth.pubkey - elif isinstance(auth, NodeAuthPassword): - root = auth.password - - if not ssh and not root: - raise LinodeException(0xFB, "Need SSH key or root password") - if root is not None and len(root) < 6: - raise LinodeException(0xFB, "Root password is too short") - - # Swap size - try: - swap = 128 if "ex_swap" not in kwargs else int(kwargs["ex_swap"]) - except: - raise LinodeException(0xFB, "Need an integer swap size") - - # Root partition size - imagesize = (size.disk - swap) if "ex_rsize" not in kwargs else\ - int(kwargs["ex_rsize"]) - if (imagesize + swap) > size.disk: - raise LinodeException(0xFB, "Total disk images are too big") - - # Distribution ID - distros = self.list_images() - if image.id not in [d.id for d in distros]: - raise LinodeException(0xFB, - "Invalid distro -- avail.distributions") - - # Kernel - if "ex_kernel" in kwargs: - kernel = kwargs["ex_kernel"] - else: - if image.extra['64bit']: - # For a list of available kernel ids, see - # https://www.linode.com/kernels/ - kernel = 138 - else: - kernel = 137 - params = {"api_action": "avail.kernels"} - kernels = self.connection.request(API_ROOT, params=params).objects[0] - if kernel not in [z["KERNELID"] for z in kernels]: - raise LinodeException(0xFB, "Invalid kernel -- avail.kernels") - - # Comments - comments = "Created by Apache libcloud " if\ - "ex_comment" not in kwargs else kwargs["ex_comment"] - - # Step 1: linode.create - params = { - "api_action": "linode.create", - "DatacenterID": chosen, - "PlanID": size.id, - "PaymentTerm": payment - } - data = self.connection.request(API_ROOT, params=params).objects[0] - linode = {"id": data["LinodeID"]} - - # Step 1b. linode.update to rename the Linode - params = { - "api_action": "linode.update", - "LinodeID": linode["id"], - "Label": name + if not isinstance(location, NodeLocation): + raise LinodeExceptionV4("Invalid location instance") + + if not isinstance(size, NodeSize): + raise LinodeExceptionV4("Invalid size instance") + + attr = { + "region": location.id, + "type": size.id, + "private_ip": ex_private_ip, + "backups_enabled": ex_backups_enabled, } - self.connection.request(API_ROOT, params=params) - # Step 1c. linode.ip.addprivate if it was requested - if "ex_private" in kwargs and kwargs["ex_private"]: - params = { - "api_action": "linode.ip.addprivate", - "LinodeID": linode["id"] + if ex_userdata: + attr["metadata"] = { + "user_data": binascii.b2a_base64(bytes(ex_userdata.encode("utf-8"))) + .decode("ascii") + .strip() } - self.connection.request(API_ROOT, params=params) - - # Step 1d. Labels - # use the linode id as the name can be up to 63 chars and the labels - # are limited to 48 chars - label = { - "lconfig": "[%s] Configuration Profile" % linode["id"], - "lroot": "[%s] %s Disk Image" % (linode["id"], image.name), - "lswap": "[%s] Swap Space" % linode["id"] - } - for what in ["lconfig", "lroot", "lswap"]: - if what in kwargs: - label[what] = kwargs[what] - - # Step 2: linode.disk.createfromdistribution - if not root: - root = binascii.b2a_base64(os.urandom(8)).decode('ascii').strip() - - params = { - "api_action": "linode.disk.createfromdistribution", - "LinodeID": linode["id"], - "DistributionID": image.id, - "Label": label["lroot"], - "Size": imagesize, - "rootPass": root, - } - if ssh: - params["rootSSHKey"] = ssh - data = self.connection.request(API_ROOT, params=params).objects[0] - linode["rootimage"] = data["DiskID"] - - # Step 3: linode.disk.create for swap - params = { - "api_action": "linode.disk.create", - "LinodeID": linode["id"], - "Label": label["lswap"], - "Type": "swap", - "Size": swap - } - data = self.connection.request(API_ROOT, params=params).objects[0] - linode["swapimage"] = data["DiskID"] - - # Step 4: linode.config.create for main profile - disks = "%s,%s,,,,,,," % (linode["rootimage"], linode["swapimage"]) - params = { - "api_action": "linode.config.create", - "LinodeID": linode["id"], - "KernelID": kernel, - "Label": label["lconfig"], - "Comments": comments, - "DiskList": disks - } - data = self.connection.request(API_ROOT, params=params).objects[0] - linode["config"] = data["ConfigID"] - - # Step 5: linode.boot - params = { - "api_action": "linode.boot", - "LinodeID": linode["id"], - "ConfigID": linode["config"] - } - self.connection.request(API_ROOT, params=params) - # Make a node out of it and hand it back - params = {"api_action": "linode.list", "LinodeID": linode["id"]} - data = self.connection.request(API_ROOT, params=params).objects[0] - nodes = self._to_nodes(data) + if image is not None: + if root_pass is None: + raise LinodeExceptionV4("root password required " "when providing an image") + attr["image"] = image.id + attr["root_pass"] = root_pass + + if name is not None: + valid_name = r"^[a-zA-Z]((?!--|__|\.\.)[a-zA-Z0-9-_.])+$" + if not re.match(valid_name, name): + raise LinodeExceptionV4("Invalid name") + attr["label"] = name + if ex_authorized_keys is not None: + attr["authorized_keys"] = list(ex_authorized_keys) + if ex_authorized_users is not None: + attr["authorized_users"] = list(ex_authorized_users) + if ex_tags is not None: + attr["tags"] = list(ex_tags) + + response = self.connection.request( + "/v4/linode/instances", data=json.dumps(attr), method="POST" + ).object + return self._to_node(response) + + def ex_get_node(self, node_id): + """ + Return a Node object based on a node ID. - if len(nodes) == 1: - node = nodes[0] - if getattr(auth, "generated", False): - node.extra['password'] = auth.password - return node + :keyword node_id: Node's ID + :type node_id: ``str`` - return None + :return: Created node + :rtype : :class:`Node` + """ + response = self.connection.request("/v4/linode/instances/%s" % node_id).object + return self._to_node(response) - def list_sizes(self, location=None): + def ex_list_disks(self, node): """ - List available Linode plans + List disks associated with the node. - Gets the sizes that can be used for creating a Linode. Since available - Linode plans vary per-location, this method can also be passed a - location to filter the availability. + :param node: Node to list disks. (required) + :type node: :class:`Node` - :keyword location: the facility to retrieve plans in - :type location: :class:`NodeLocation` + :rtype: ``list`` of :class:`LinodeDisk` + """ + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") + + data = self._paginated_request("/v4/linode/instances/%s/disks" % node.id, "data") + + return [self._to_disk(obj) for obj in data] - :rtype: ``list`` of :class:`NodeSize` + def ex_get_primary_disk(self, node): """ - params = {"api_action": "avail.linodeplans"} - data = self.connection.request(API_ROOT, params=params).objects[0] - sizes = [] - for obj in data: - n = NodeSize(id=obj["PLANID"], name=obj["LABEL"], ram=obj["RAM"], - disk=(obj["DISK"] * 1024), bandwidth=obj["XFER"], - price=obj["PRICE"], driver=self.connection.driver) - sizes.append(n) - return sizes + Return the disk configured as the node's root device. - def list_images(self): + The first configuration profile is used, matching the configuration + selected by default by Linode when none is explicitly specified. + + :param node: Node whose primary disk should be returned. (required) + :type node: :class:`Node` + + :rtype: :class:`LinodeDisk` """ - List available Linux distributions + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") + + configs = self._paginated_request("/v4/linode/instances/%s/configs" % node.id, "data") + if not configs: + raise LinodeExceptionV4("Node has no configuration profiles") + + config = configs[0] + root_device = config.get("root_device") or "/dev/sda" + device_name = root_device.rsplit("/", 1)[-1] + device = config.get("devices", {}).get(device_name) or {} + disk_id = device.get("disk") + + if disk_id is None: + raise LinodeExceptionV4("Node root device is not backed by a disk") + + disks = self.ex_list_disks(node) + for disk in disks: + if str(disk.id) == str(disk_id): + return disk + + raise LinodeExceptionV4("Node root disk was not found") + + def ex_create_disk( + self, + size, + name, + node, + fs_type, + image=None, + ex_root_pass=None, + ex_authorized_keys=None, + ex_authorized_users=None, + ex_read_only=False, + ): + """ + Adds a new disk to node - Retrieve all Linux distributions that can be deployed to a Linode. + :param size: Size of disk in megabytes (required) + :type size: ``int`` - :rtype: ``list`` of :class:`NodeImage` + :param name: Name of the disk to be created (required) + :type name: ``str`` + + :param node: Node to attach disk to (required) + :type node: :class:`Node` + + :param fs_type: The formatted type of this disk. Valid types are: + ext3, ext4, swap, raw, initrd + :type fs_type: ``str`` + + :keyword image: Image to deploy the volume from + :type image: :class:`NodeImage` + + :keyword ex_root_pass: root password,required \ + if an image is provided + :type ex_root_pass: ``str`` + + :keyword ex_authorized_keys: a list of SSH keys + :type ex_authorized_keys: ``list`` of ``str`` + + :keyword ex_authorized_users: a list of usernames \ + that will have their SSH keys,\ + if any, automatically appended \ + to the root user's ~/.ssh/authorized_keys file. + :type ex_authorized_users: ``list`` of ``str`` + + :keyword ex_read_only: if true, this disk is read-only + :type ex_read_only: ``bool`` + + :return: LinodeDisk representing the newly-created disk + :rtype: :class:`LinodeDisk` """ - params = {"api_action": "avail.distributions"} - data = self.connection.request(API_ROOT, params=params).objects[0] - distros = [] - for obj in data: - i = NodeImage(id=obj["DISTRIBUTIONID"], - name=obj["LABEL"], - driver=self.connection.driver, - extra={'pvops': obj['REQUIRESPVOPSKERNEL'], - '64bit': obj['IS64BIT']}) - distros.append(i) - return distros - def list_locations(self): + attr = { + "label": str(name), + "size": int(size), + "filesystem": fs_type, + "read_only": ex_read_only, + } + + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") + + if fs_type not in self._linode_disk_filesystems: + raise LinodeExceptionV4("Not valid filesystem type") + + if image is not None: + if not isinstance(image, NodeImage): + raise LinodeExceptionV4("Invalid image instance") + # when an image is set, root pass must be set as well + if ex_root_pass is None: + raise LinodeExceptionV4("root_pass is required when " "deploying an image") + attr["image"] = image.id + attr["root_pass"] = ex_root_pass + + if ex_authorized_keys is not None: + attr["authorized_keys"] = list(ex_authorized_keys) + + if ex_authorized_users is not None: + attr["authorized_users"] = list(ex_authorized_users) + + response = self.connection.request( + "/v4/linode/instances/%s/disks" % node.id, + data=json.dumps(attr), + method="POST", + ).object + return self._to_disk(response) + + def ex_destroy_disk(self, node, disk): """ - List available facilities for deployment + Destroys disk for the given node. - Retrieve all facilities that a Linode can be deployed in. + :param node: The Node the disk is attached to. (required) + :type node: :class:`Node` - :rtype: ``list`` of :class:`NodeLocation` + :param disk: LinodeDisk to be destroyed (required) + :type disk: :class:`LinodeDisk` + + :rtype: ``bool`` """ - params = {"api_action": "avail.datacenters"} - data = self.connection.request(API_ROOT, params=params).objects[0] - nl = [] - for dc in data: - country = None - if "USA" in dc["LOCATION"]: - country = "US" - elif "UK" in dc["LOCATION"]: - country = "GB" - elif "JP" in dc["LOCATION"]: - country = "JP" + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") + + if not isinstance(disk, LinodeDisk): + raise LinodeExceptionV4("Invalid disk instance") + + if node.state != self.LINODE_STATES["stopped"]: + raise LinodeExceptionV4("Node needs to be stopped" " before disk is destroyed") + + response = self.connection.request( + "/v4/linode/instances/{}/disks/{}".format(node.id, disk.id), method="DELETE" + ) + return response.status == httplib.OK + + def list_volumes(self): + """Get all volumes of the account + :rtype: `list` of :class: `StorageVolume` + """ + data = self._paginated_request("/v4/volumes", "data") + + return [self._to_volume(obj) for obj in data] + + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + node=None, + tags=None, + ): + """Creates a volume and optionally attaches it to a node. + + :param name: The name to be given to volume (required).\ + Must start with an alpha character. \ + May only consist of alphanumeric characters,\ + dashes (-), underscores (_)\ + Cannot have two dashes (--), underscores (__) in a row. + + :type name: `str` + + :param size: Size in gigabytes (required) + :type size: `int` + + :keyword location: Location to create the node.\ + Required if node is not given. + :type location: :class:`NodeLocation` + + :keyword node: Node to attach the volume to + :type node: :class:`Node` + + :keyword tags: tags to apply to volume + :type tags: `list` of `str` + + :rtype: :class: `StorageVolume` + """ + + valid_name = "^[a-zA-Z]((?!--|__)[a-zA-Z0-9-_])+$" + if not re.match(valid_name, name): + raise LinodeExceptionV4("Invalid name") + + attr = { + "label": name, + "size": int(size), + } + + if node is not None: + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") + attr["linode_id"] = int(node.id) + else: + # location is only required if a node is not given + if location: + if not isinstance(location, NodeLocation): + raise LinodeExceptionV4("Invalid location instance") + attr["region"] = location.id else: - country = "??" - nl.append(NodeLocation(dc["DATACENTERID"], - dc["LOCATION"], - country, - self)) - return nl + raise LinodeExceptionV4("Region must be provided " "when node is not") + if tags is not None: + attr["tags"] = list(tags) + + response = self.connection.request( + "/v4/volumes", data=json.dumps(attr), method="POST" + ).object + return self._to_volume(response) + + def attach_volume( + self, + node, + volume, + device=None, + persist_across_boots=True, + ): + """Attaches a volume to a node. + Volume and node must be located in the same region + + :param node: Node to attach the volume to(required) + :type node: :class:`Node` + + :param volume: Volume to be attached (required) + :type volume: :class:`StorageVolume` - def linode_set_datacenter(self, dc): + :keyword persist_across_boots: Whether volume should be \ + attached to node across boots + :type persist_across_boots: `bool` + + :rtype: :class: `StorageVolume` """ - Set the default datacenter for Linode creation + if not isinstance(volume, StorageVolume): + raise LinodeExceptionV4("Invalid volume instance") + + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") + + if volume.extra["linode_id"] is not None: + raise LinodeExceptionV4("Volume is already attached to a node") - Since Linodes must be created in a facility, this function sets the - default that :class:`create_node` will use. If a location keyword is - not passed to :class:`create_node`, this method must have already been - used. + if node.extra["location"] != volume.extra["location"]: + raise LinodeExceptionV4("Volume and node " "must be on the same region") - :keyword dc: the datacenter to create Linodes in unless specified - :type dc: :class:`NodeLocation` + attr = {"linode_id": int(node.id), "persist_across_boots": persist_across_boots} + + response = self.connection.request( + "/v4/volumes/%s/attach" % volume.id, data=json.dumps(attr), method="POST" + ).object + return self._to_volume(response) + + def detach_volume(self, volume): + """Detaches a volume from a node. + + :param volume: Volume to be detached (required) + :type volume: :class:`StorageVolume` :rtype: ``bool`` """ - did = dc.id - params = {"api_action": "avail.datacenters"} - data = self.connection.request(API_ROOT, params=params).objects[0] - for datacenter in data: - if did == dc["DATACENTERID"]: - self.datacenter = did - return + if not isinstance(volume, StorageVolume): + raise LinodeExceptionV4("Invalid volume instance") + + if volume.extra["linode_id"] is None: + raise LinodeExceptionV4("Volume is already detached") - dcs = ", ".join([d["DATACENTERID"] for d in data]) - self.datacenter = None - raise LinodeException(0xFD, "Invalid datacenter (use one of %s)" % dcs) + response = self.connection.request("/v4/volumes/%s/detach" % volume.id, method="POST") + return response.status == httplib.OK def destroy_volume(self, volume): - """ - Destroys disk volume for the Linode. Linode id is to be provided as - extra["LinodeId"] whithin :class:`StorageVolume`. It can be retrieved - by :meth:`libcloud.compute.drivers.linode.LinodeNodeDriver\ - .ex_list_volumes`. + """Destroys the volume given. - :param volume: Volume to be destroyed + :param volume: Volume to be deleted (required) :type volume: :class:`StorageVolume` :rtype: ``bool`` """ if not isinstance(volume, StorageVolume): - raise LinodeException(0xFD, "Invalid volume instance") + raise LinodeExceptionV4("Invalid volume instance") - if volume.extra["LINODEID"] is None: - raise LinodeException(0xFD, "Missing LinodeID") + if volume.extra["linode_id"] is not None: + raise LinodeExceptionV4("Volume must be detached" " before it can be deleted.") + response = self.connection.request("/v4/volumes/%s" % volume.id, method="DELETE") + return response.status == httplib.OK - params = { - "api_action": "linode.disk.delete", - "LinodeID": volume.extra["LINODEID"], - "DiskID": volume.id, - } - self.connection.request(API_ROOT, params=params) + def ex_resize_volume(self, volume, size): + """Resizes the volume given. + + :param volume: Volume to be resized + :type volume: :class:`StorageVolume` - return True + :param size: new volume size in gigabytes, must be\ + greater than current size + :type size: `int` - def ex_create_volume(self, size, name, node, fs_type): + :rtype: ``bool`` """ - Create disk for the Linode. + if not isinstance(volume, StorageVolume): + raise LinodeExceptionV4("Invalid volume instance") - :keyword size: Size of volume in megabytes (required) - :type size: ``int`` + if volume.size >= size: + raise LinodeExceptionV4("Volumes can only be resized up") + attr = {"size": size} - :keyword name: Name of the volume to be created - :type name: ``str`` + response = self.connection.request( + "/v4/volumes/%s/resize" % volume.id, data=json.dumps(attr), method="POST" + ) + return response.status == httplib.OK - :keyword node: Node to attach volume to. - :type node: :class:`Node` + def ex_clone_volume(self, volume, name): + """Clones the volume given - :keyword fs_type: The formatted type of this disk. Valid types are: - ext3, ext4, swap, raw - :type fs_type: ``str`` + :param volume: Volume to be cloned + :type volume: :class:`StorageVolume` + :param name: new cloned volume name + :type name: `str` - :return: StorageVolume representing the newly-created volume :rtype: :class:`StorageVolume` """ - # check node + + if not isinstance(volume, StorageVolume): + raise LinodeExceptionV4("Invalid volume instance") + + attr = {"label": name} + response = self.connection.request( + "/v4/volumes/%s/clone" % volume.id, data=json.dumps(attr), method="POST" + ).object + + return self._to_volume(response) + + def ex_get_volume(self, volume_id): + """ + Return a Volume object based on a volume ID. + + :param volume_id: Volume's id + :type volume_id: ``str`` + + :return: A StorageVolume object for the volume + :rtype: :class:`StorageVolume` + """ + response = self.connection.request("/v4/volumes/%s" % volume_id).object + return self._to_volume(response) + + def get_image( + self, + image_id, + ): + """ + Lookup a Linode image + + :param image_id: The ID of the image to look up (required). + :type image_id: ``str`` + + :rtype: :class: `NodeImage` + """ + image = image_id + response = self.connection.request("/v4/images/%s" % image, method="GET") + return self._to_image(response.object) + + def create_image( + self, + node, + name, + description=None, + ): + """Creates a private image from a Node's primary disk. + + :param node: Node to create the image from (required) + :type node: :class:`Node` + + :keyword name: A name for the image.\ + Defaults to the name of the disk \ + it is being created from if not provided + :type name: `str` + + :keyword description: A description of the image + :type description: `str` + + :return: The newly created NodeImage + :rtype: :class:`NodeImage` + """ + if not isinstance(node, Node): - raise LinodeException(0xFD, "Invalid node instance") + raise LinodeExceptionV4("Invalid node instance") - # check space available - total_space = node.extra['TOTALHD'] - existing_volumes = self.ex_list_volumes(node) - used_space = 0 - for volume in existing_volumes: - used_space = used_space + volume.size + disk = self.ex_get_primary_disk(node) + attr = {"disk_id": int(disk.id), "label": name, "description": description} - available_space = total_space - used_space - if available_space < size: - raise LinodeException(0xFD, "Volume size too big. Available space\ - %d" % available_space) + response = self.connection.request( + "/v4/images", data=json.dumps(attr), method="POST" + ).object + return self._to_image(response) - # check filesystem type - if fs_type not in self._linode_disk_filesystems: - raise LinodeException(0xFD, "Not valid filesystem type") - - params = { - "api_action": "linode.disk.create", - "LinodeID": node.id, - "Label": name, - "Type": fs_type, - "Size": size - } - data = self.connection.request(API_ROOT, params=params).objects[0] - volume = data["DiskID"] - # Make a volume out of it and hand it back - params = { - "api_action": "linode.disk.list", - "LinodeID": node.id, - "DiskID": volume + def delete_image( + self, + node_image, + ): + """Deletes a private image + + :param node_image: NodeImage to delete (required) + :type node_image: :class:`NodeImage` + + :rtype: ``bool`` + """ + image = node_image + if not isinstance(image, NodeImage): + raise LinodeExceptionV4("Invalid image instance") + + response = self.connection.request("/v4/images/%s" % image.id, method="DELETE") + return response.status == httplib.OK + + def ex_list_addresses(self): + """List IP addresses + + :return: LinodeIPAddress list + :rtype: `list` of :class:`LinodeIPAddress` + """ + data = self._paginated_request("/v4/networking/ips", "data") + + return [self._to_address(obj) for obj in data] + + def ex_list_node_addresses(self, node): + """List all IPv4 addresses attached to node + + :param node: Node to list IP addresses + :type node: :class:`Node` + + :return: LinodeIPAddress list + :rtype: `list` of :class:`LinodeIPAddress` + """ + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") + + response = self.connection.request("/v4/linode/instances/%s/ips" % node.id).object + return self._to_addresses(response) + + def ex_allocate_private_address(self, node, address_type="ipv4"): + """Allocates a private IPv4 address to node.Only ipv4 is currently supported + + :param node: Node to attach the IP address + :type node: :class:`Node` + + :keyword address_type: Type of IP address + :type address_type: `str` + + :return: The newly created LinodeIPAddress + :rtype: :class:`LinodeIPAddress` + """ + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") + + # Only ipv4 is currently supported + if address_type != "ipv4": + raise LinodeExceptionV4("Address type not supported") + # Only one private IP address can be allocated + if len(node.private_ips) >= 1: + raise LinodeExceptionV4("Nodes can have up to one private IP") + + attr = {"public": False, "type": address_type} + + response = self.connection.request( + "/v4/linode/instances/%s/ips" % node.id, + data=json.dumps(attr), + method="POST", + ).object + return self._to_address(response) + + def ex_share_address(self, node, addresses): + """Shares an IP with another node.This can be used to allow one Linode + to begin serving requests should another become unresponsive. + + :param node: Node to share the IP addresses with + :type node: :class:`Node` + + :keyword addresses: List of IP addresses to share + :type address_type: `list` of :class: `LinodeIPAddress` + + :rtype: ``bool`` + """ + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") + + if not all(isinstance(address, LinodeIPAddress) for address in addresses): + raise LinodeExceptionV4("Invalid address instance") + + attr = { + "ips": [address.inet for address in addresses], + "linode_id": int(node.id), } - data = self.connection.request(API_ROOT, params=params).objects[0] - return self._to_volumes(data)[0] + response = self.connection.request( + "/v4/networking/ipv4/share", data=json.dumps(attr), method="POST" + ) + return response.status == httplib.OK - def ex_list_volumes(self, node, disk_id=None): + def ex_resize_node(self, node, size, allow_auto_disk_resize=False): """ - List existing disk volumes for for given Linode. + Resizes a node the API Key has read_write permission + to a different Type. + The following requirements must be met: + - The node must not have a pending migration + - The account cannot have an outstanding balance + - The node must not have more disk allocation than the new size allows - :keyword node: Node to list disk volumes for. (required) - :type node: :class:`Node` + :param node: the Linode to resize + :type node: :class:`Node` + + :param size: the size of the new node + :type size: :class:`NodeSize` + + :keyword allow_auto_disk_resize: Automatically resize disks \ + when resizing a node. + :type allow_auto_disk_resize: ``bool`` + + :rtype: ``bool`` + """ + if not isinstance(node, Node): + raise LinodeExceptionV4("Invalid node instance") + if not isinstance(size, NodeSize): + raise LinodeExceptionV4("Invalid node size") + + attr = {"type": size.id, "allow_auto_disk_resize": allow_auto_disk_resize} + + response = self.connection.request( + "/v4/linode/instances/%s/resize" % node.id, + data=json.dumps(attr), + method="POST", + ) + + return response.status == httplib.OK + + def ex_rename_node(self, node, name): + """Renames a node + + :param node: the Linode to resize + :type node: :class:`Node` - :keyword disk_id: Id for specific disk volume. (optional) - :type disk_id: ``int`` + :param name: the node's new name + :type name: ``str`` - :rtype: ``list`` of :class:`StorageVolume` + :return: Changed Node + :rtype: :class:`Node` """ if not isinstance(node, Node): - raise LinodeException(0xFD, "Invalid node instance") + raise LinodeExceptionV4("Invalid node instance") + + attr = {"label": name} + + response = self.connection.request( + "/v4/linode/instances/%s" % node.id, data=json.dumps(attr), method="PUT" + ).object + + return self._to_node(response) + + def _to_key_pair(self, data): + extra = {"id": data["id"]} + + return KeyPair( + name=data["label"], + fingerprint=None, + public_key=data["ssh_key"], + private_key=None, + driver=self, + extra=extra, + ) + + def _to_node(self, data): + extra = { + "tags": data["tags"], + "location": data["region"], + "ipv6": data["ipv6"], + "hypervisor": data["hypervisor"], + "specs": data["specs"], + "alerts": data["alerts"], + "backups": data["backups"], + "watchdog_enabled": data["watchdog_enabled"], + } - params = { - "api_action": "linode.disk.list", - "LinodeID": node.id + public_ips = [ip for ip in data["ipv4"] if not is_private_subnet(ip)] + private_ips = [ip for ip in data["ipv4"] if is_private_subnet(ip)] + return Node( + id=data["id"], + name=data["label"], + state=self.LINODE_STATES[data["status"]], + public_ips=public_ips, + private_ips=private_ips, + driver=self, + size=data["type"], + image=data["image"], + created_at=self._to_datetime(data["created"]), + extra=extra, + ) + + def _to_datetime(self, strtime): + return datetime.strptime(strtime, "%Y-%m-%dT%H:%M:%S") + + def _to_size(self, data): + extra = { + "class": data["class"], + "monthly_price": data["price"]["monthly"], + "addons": data["addons"], + "successor": data["successor"], + "transfer": data["transfer"], + "vcpus": data["vcpus"], + "gpus": data["gpus"], } - # Add param if disk_id was specified - if disk_id is not None: - params["DiskID"] = disk_id - - data = self.connection.request(API_ROOT, params=params).objects[0] - return self._to_volumes(data) - - def _to_volumes(self, objs): - """ - Covert returned JSON volumes into StorageVolume instances - - :keyword objs: ``list`` of JSON dictionaries representing the - StorageVolumes - :type objs: ``list`` - - :return: ``list`` of :class:`StorageVolume`s - """ - volumes = {} - for o in objs: - vid = o["DISKID"] - volumes[vid] = vol = StorageVolume(id=vid, name=o["LABEL"], - size=int(o["SIZE"]), - driver=self.connection.driver) - vol.extra = copy(o) - return list(volumes.values()) - - def _to_nodes(self, objs): - """Convert returned JSON Linodes into Node instances - - :keyword objs: ``list`` of JSON dictionaries representing the Linodes - :type objs: ``list`` - :return: ``list`` of :class:`Node`s""" - - # Get the IP addresses for the Linodes - nodes = {} - batch = [] - for o in objs: - lid = o["LINODEID"] - nodes[lid] = n = Node(id=lid, name=o["LABEL"], public_ips=[], - private_ips=[], - state=self.LINODE_STATES[o["STATUS"]], - driver=self.connection.driver) - n.extra = copy(o) - n.extra["PLANID"] = self._linode_plan_ids.get(o.get("TOTALRAM")) - batch.append({"api_action": "linode.ip.list", "LinodeID": lid}) - - # Avoid batch limitation - ip_answers = [] - args = [iter(batch)] * 25 - - if PY3: - izip_longest = itertools.zip_longest - else: - izip_longest = getattr(itertools, 'izip_longest', _izip_longest) - - for twenty_five in izip_longest(*args): - twenty_five = [q for q in twenty_five if q] - params = {"api_action": "batch", - "api_requestArray": json.dumps(twenty_five)} - req = self.connection.request(API_ROOT, params=params) - if not req.success() or len(req.objects) == 0: - return None - ip_answers.extend(req.objects) - - # Add the returned IPs to the nodes and return them - for ip_list in ip_answers: - for ip in ip_list: - lid = ip["LINODEID"] - which = nodes[lid].public_ips if ip["ISPUBLIC"] == 1 else\ - nodes[lid].private_ips - which.append(ip["IPADDRESS"]) - return list(nodes.values()) - - -def _izip_longest(*args, **kwds): - """Taken from Python docs - - http://docs.python.org/library/itertools.html#itertools.izip - """ - - fillvalue = kwds.get('fillvalue') - - def sentinel(counter=([fillvalue] * (len(args) - 1)).pop): - yield counter() # yields the fillvalue, or raises IndexError - - fillers = itertools.repeat(fillvalue) - iters = [itertools.chain(it, sentinel(), fillers) for it in args] - try: - for tup in itertools.izip(*iters): - yield tup - except IndexError: - pass + return NodeSize( + id=data["id"], + name=data["label"], + ram=data["memory"], + disk=data["disk"], + bandwidth=data["network_out"], + price=data["price"]["hourly"], + driver=self, + extra=extra, + ) + + def _to_image(self, data): + extra = { + "type": data["type"], + "description": data["description"], + "created": self._to_datetime(data["created"]), + "created_by": data["created_by"], + "is_public": data["is_public"], + "size": data["size"], + "eol": data["eol"], + "vendor": data["vendor"], + } + return NodeImage(id=data["id"], name=data["label"], driver=self, extra=extra) + + def _to_location(self, data): + extra = { + "status": data["status"], + "capabilities": data["capabilities"], + "resolvers": data["resolvers"], + } + return NodeLocation( + id=data["id"], + name=data["id"], + country=data["country"].upper(), + driver=self, + extra=extra, + ) + + def _to_volume(self, data): + extra = { + "created": self._to_datetime(data["created"]), + "tags": data["tags"], + "location": data["region"], + "linode_id": data["linode_id"], + "linode_label": data["linode_label"], + "state": self.LINODE_VOLUME_STATES[data["status"]], + "filesystem_path": data["filesystem_path"], + } + return StorageVolume( + id=str(data["id"]), + name=data["label"], + size=data["size"], + driver=self, + extra=extra, + ) + + def _to_disk(self, data): + return LinodeDisk( + id=data["id"], + state=self.LINODE_DISK_STATES[data["status"]], + name=data["label"], + filesystem=data["filesystem"], + size=data["size"], + driver=self, + ) + + def _to_address(self, data): + extra = { + "gateway": data["gateway"], + "subnet_mask": data["subnet_mask"], + "prefix": data["prefix"], + "rdns": data["rdns"], + "node_id": data["linode_id"], + "region": data["region"], + } + return LinodeIPAddress( + inet=data["address"], + public=data["public"], + version=data["type"], + driver=self, + extra=extra, + ) + + def _to_addresses(self, data): + addresses = data["ipv4"]["public"] + data["ipv4"]["private"] + return [self._to_address(address) for address in addresses] + + def _paginated_request(self, url, obj, params=None): + """ + Perform multiple calls in order to have a full list of elements when + the API responses are paginated. + + :param url: API endpoint + :type url: ``str`` + + :param obj: Result object key + :type obj: ``str`` + + :param params: Request parameters + :type params: ``dict`` + + :return: ``list`` of API response objects + :rtype: ``list`` + """ + objects = [] + params = params if params is not None else {} + + ret = self.connection.request(url, params=params).object + + data = list(ret.get(obj, [])) + current_page = int(ret.get("page", 1)) + num_of_pages = int(ret.get("pages", 1)) + objects.extend(data) + for page in range(current_page + 1, num_of_pages + 1): + # add param to request next page + params["page"] = page + ret = self.connection.request(url, params=params).object + data = list(ret.get(obj, [])) + objects.extend(data) + return objects diff --git a/libcloud/compute/drivers/maxihost.py b/libcloud/compute/drivers/maxihost.py new file mode 100644 index 0000000000..6504bad577 --- /dev/null +++ b/libcloud/compute/drivers/maxihost.py @@ -0,0 +1,274 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import re +import json + +from libcloud.utils.py3 import httplib +from libcloud.compute.base import Node, KeyPair, NodeSize, NodeImage, NodeDriver, NodeLocation +from libcloud.compute.types import Provider, NodeState +from libcloud.common.maxihost import MaxihostConnection +from libcloud.common.exceptions import BaseHTTPError + +__all__ = ["MaxihostNodeDriver"] + + +class MaxihostNodeDriver(NodeDriver): + """ + Base Maxihost node driver. + """ + + connectionCls = MaxihostConnection + type = Provider.MAXIHOST + name = "Maxihost" + website = "https://www.maxihost.com/" + + def create_node(self, name, size, image, location=None, auth=None, ex_ssh_key_ids=None): + """ + Create a node. + + :param location: Location where the node will be created. (required) + :type location: :class:`NodeLocation` + + :return: The newly created node. + :rtype: :class:`Node` + """ + if location is None: + raise ValueError("location is required.") + + attr = { + "hostname": name, + "plan": size.id, + "operating_system": image.id, + "facility": location.id.lower(), + "billing_cycle": "monthly", + } + + if ex_ssh_key_ids: + attr["ssh_keys"] = ex_ssh_key_ids + + try: + res = self.connection.request("/devices", params=attr, method="POST") + except BaseHTTPError as exc: + error_message = exc.message.get("error_messages", "") + raise ValueError("Failed to create node: %s" % (error_message)) + + return self._to_node(res.object["devices"][0]) + + def start_node(self, node): + """ + Start a node. + """ + params = {"type": "power_on"} + res = self.connection.request("/devices/%s/actions" % node.id, params=params, method="PUT") + + return res.status in [httplib.OK, httplib.CREATED, httplib.ACCEPTED] + + def stop_node(self, node): + """ + Stop a node. + """ + params = {"type": "power_off"} + res = self.connection.request("/devices/%s/actions" % node.id, params=params, method="PUT") + + return res.status in [httplib.OK, httplib.CREATED, httplib.ACCEPTED] + + def destroy_node(self, node): + """ + Destroy a node. + """ + res = self.connection.request("/devices/%s" % node.id, method="DELETE") + + return res.status in [httplib.OK, httplib.CREATED, httplib.ACCEPTED] + + def reboot_node(self, node): + """ + Reboot a node. + """ + params = {"type": "power_cycle"} + res = self.connection.request("/devices/%s/actions" % node.id, params=params, method="PUT") + + return res.status in [httplib.OK, httplib.CREATED, httplib.ACCEPTED] + + def list_nodes(self): + """ + List nodes + + :rtype: ``list`` of :class:`MaxihostNode` + """ + response = self.connection.request("/devices") + nodes = [self._to_node(host) for host in response.object["devices"]] + return nodes + + def _to_node(self, data): + extra = {} + private_ips = [] + public_ips = [] + for ip in data["ips"]: + if "Private" in ip["ip_description"]: + private_ips.append(ip["ip_address"]) + else: + public_ips.append(ip["ip_address"]) + + if data["power_status"]: + state = NodeState.RUNNING + else: + state = NodeState.STOPPED + + for key in data: + extra[key] = data[key] + + node = Node( + id=data["id"], + name=data["description"], + state=state, + private_ips=private_ips, + public_ips=public_ips, + driver=self, + extra=extra, + ) + return node + + def list_locations(self, ex_available=True): + """ + List locations + + If ex_available is True, show only locations which are available + """ + locations = [] + data = self.connection.request("/regions") + for location in data.object["regions"]: + if ex_available: + if location.get("available"): + locations.append(self._to_location(location)) + else: + locations.append(self._to_location(location)) + return locations + + def _to_location(self, data): + name = data.get("location").get("city", "") + country = data.get("location").get("country", "") + return NodeLocation(id=data["slug"], name=name, country=country, driver=self) + + def list_sizes( + self, + location=None, + ): + """ + List sizes + """ + sizes = [] + data = self.connection.request("/plans") + for size in data.object["servers"]: + sizes.append(self._to_size(size)) + return sizes + + def _to_size(self, data): + extra = { + "specs": data["specs"], + "regions": data["regions"], + "pricing": data["pricing"], + } + ram = data["specs"]["memory"]["total"] + ram = re.sub("[^0-9]", "", ram) + return NodeSize( + id=data["slug"], + name=data["name"], + ram=int(ram), + disk=None, + bandwidth=None, + price=data["pricing"]["usd_month"], + driver=self, + extra=extra, + ) + + def list_images( + self, + location=None, + ): + """ + List images + """ + images = [] + data = self.connection.request("/plans/operating-systems") + for image in data.object["operating-systems"]: + images.append(self._to_image(image)) + return images + + def _to_image(self, data): + extra = { + "operating_system": data["operating_system"], + "distro": data["distro"], + "version": data["version"], + "pricing": data["pricing"], + } + return NodeImage(id=data["slug"], name=data["name"], driver=self, extra=extra) + + def list_key_pairs(self): + """ + List all the available SSH keys. + + :return: Available SSH keys. + :rtype: ``list`` of :class:`KeyPair` + """ + data = self.connection.request("/account/keys") + return list(map(self._to_key_pair, data.object["ssh_keys"])) + + def create_key_pair( + self, + name, + public_key=None, + ): + """ + Create a new SSH key. + + :param name: Key name (required) + :type name: ``str`` + + :param public_key: base64 encoded public key string (required) + :type public_key: ``str`` + """ + if not public_key: + raise ValueError("public_key is required.") + + attr = {"name": name, "public_key": public_key} + res = self.connection.request("/account/keys", method="POST", data=json.dumps(attr)) + + data = res.object["ssh_key"] + + return self._to_key_pair(data=data) + + def _to_key_pair(self, data): + extra = {"id": data["id"]} + return KeyPair( + name=data["name"], + fingerprint=data["fingerprint"], + public_key=data["public_key"], + private_key=None, + driver=self, + extra=extra, + ) + + def ex_start_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.start_node(node=node) + + def ex_stop_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.stop_node(node=node) diff --git a/libcloud/compute/drivers/nephoscale.py b/libcloud/compute/drivers/nephoscale.py deleted file mode 100644 index 1888ac8f50..0000000000 --- a/libcloud/compute/drivers/nephoscale.py +++ /dev/null @@ -1,448 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -NephoScale Cloud driver (http://www.nephoscale.com) -API documentation: http://docs.nephoscale.com -Created by Markos Gogoulos (https://mist.io) -""" - -import base64 -import sys -import time -import os -import binascii - -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import b -from libcloud.utils.py3 import urlencode - -from libcloud.compute.providers import Provider -from libcloud.common.base import JsonResponse, ConnectionUserAndKey -from libcloud.compute.types import (NodeState, InvalidCredsError, - LibcloudError) -from libcloud.compute.base import (Node, NodeDriver, NodeImage, NodeSize, - NodeLocation) -from libcloud.utils.networking import is_private_subnet - -API_HOST = 'api.nephoscale.com' - -NODE_STATE_MAP = { - 'on': NodeState.RUNNING, - 'off': NodeState.UNKNOWN, - 'unknown': NodeState.UNKNOWN, -} - -VALID_RESPONSE_CODES = [httplib.OK, httplib.ACCEPTED, httplib.CREATED, - httplib.NO_CONTENT] - -# used in create_node and specifies how many times to get the list of nodes and -# check if the newly created node is there. This is because when a request is -# sent to create a node, NephoScale replies with the job id, and not the node -# itself thus we don't have the ip addresses, that are required in deploy_node -CONNECT_ATTEMPTS = 10 - - -class NodeKey(object): - def __init__(self, id, name, public_key=None, key_group=None, - password=None): - self.id = id - self.name = name - self.key_group = key_group - self.password = password - self.public_key = public_key - - def __repr__(self): - return (('') % - (self.id, self.name)) - - -class NephoscaleResponse(JsonResponse): - """ - Nephoscale API Response - """ - - def parse_error(self): - if self.status == httplib.UNAUTHORIZED: - raise InvalidCredsError('Authorization Failed') - if self.status == httplib.NOT_FOUND: - raise Exception("The resource you are looking for is not found.") - - return self.body - - def success(self): - return self.status in VALID_RESPONSE_CODES - - -class NephoscaleConnection(ConnectionUserAndKey): - """ - Nephoscale connection class. - Authenticates to the API through Basic Authentication - with username/password - """ - host = API_HOST - responseCls = NephoscaleResponse - - allow_insecure = False - - def add_default_headers(self, headers): - """ - Add parameters that are necessary for every request - """ - user_b64 = base64.b64encode(b('%s:%s' % (self.user_id, self.key))) - headers['Authorization'] = 'Basic %s' % (user_b64.decode('utf-8')) - return headers - - -class NephoscaleNodeDriver(NodeDriver): - """ - Nephoscale node driver class. - - >>> from libcloud.compute.providers import get_driver - >>> driver = get_driver('nephoscale') - >>> conn = driver('nepho_user','nepho_password') - >>> conn.list_nodes() - """ - - type = Provider.NEPHOSCALE - api_name = 'nephoscale' - name = 'NephoScale' - website = 'http://www.nephoscale.com' - connectionCls = NephoscaleConnection - features = {'create_node': ['ssh_key']} - - def list_locations(self): - """ - List available zones for deployment - - :rtype: ``list`` of :class:`NodeLocation` - """ - result = self.connection.request('/datacenter/zone/').object - locations = [] - for value in result.get('data', []): - location = NodeLocation(id=value.get('id'), - name=value.get('name'), - country='US', - driver=self) - locations.append(location) - return locations - - def list_images(self): - """ - List available images for deployment - - :rtype: ``list`` of :class:`NodeImage` - """ - result = self.connection.request('/image/server/').object - images = [] - for value in result.get('data', []): - extra = {'architecture': value.get('architecture'), - 'disks': value.get('disks'), - 'billable_type': value.get('billable_type'), - 'pcpus': value.get('pcpus'), - 'cores': value.get('cores'), - 'uri': value.get('uri'), - 'storage': value.get('storage'), - } - image = NodeImage(id=value.get('id'), - name=value.get('friendly_name'), - driver=self, - extra=extra) - images.append(image) - return images - - def list_sizes(self): - """ - List available sizes containing prices - - :rtype: ``list`` of :class:`NodeSize` - """ - result = self.connection.request('/server/type/cloud/').object - sizes = [] - for value in result.get('data', []): - value_id = value.get('id') - size = NodeSize(id=value_id, - name=value.get('friendly_name'), - ram=value.get('ram'), - disk=value.get('storage'), - bandwidth=None, - price=self._get_size_price(size_id=str(value_id)), - driver=self) - sizes.append(size) - - return sorted(sizes, key=lambda k: k.price) - - def list_nodes(self): - """ - List available nodes - - :rtype: ``list`` of :class:`Node` - """ - result = self.connection.request('/server/cloud/').object - nodes = [self._to_node(value) for value in result.get('data', [])] - return nodes - - def rename_node(self, node, name, hostname=None): - """rename a cloud server, optionally specify hostname too""" - data = {'name': name} - if hostname: - data['hostname'] = hostname - params = urlencode(data) - result = self.connection.request('/server/cloud/%s/' % node.id, - data=params, method='PUT').object - return result.get('response') in VALID_RESPONSE_CODES - - def reboot_node(self, node): - """reboot a running node""" - result = self.connection.request('/server/cloud/%s/initiator/restart/' - % node.id, method='POST').object - return result.get('response') in VALID_RESPONSE_CODES - - def ex_start_node(self, node): - """start a stopped node""" - result = self.connection.request('/server/cloud/%s/initiator/start/' - % node.id, method='POST').object - return result.get('response') in VALID_RESPONSE_CODES - - def ex_stop_node(self, node): - """stop a running node""" - result = self.connection.request('/server/cloud/%s/initiator/stop/' - % node.id, method='POST').object - return result.get('response') in VALID_RESPONSE_CODES - - def destroy_node(self, node): - """destroy a node""" - result = self.connection.request('/server/cloud/%s/' % node.id, - method='DELETE').object - return result.get('response') in VALID_RESPONSE_CODES - - def ex_list_keypairs(self, ssh=False, password=False, key_group=None): - """ - List available console and server keys - There are two types of keys for NephoScale, ssh and password keys. - If run without arguments, lists all keys. Otherwise list only - ssh keys, or only password keys. - Password keys with key_group 4 are console keys. When a server - is created, it has two keys, one password or ssh key, and - one password console key. - - :keyword ssh: if specified, show ssh keys only (optional) - :type ssh: ``bool`` - - :keyword password: if specified, show password keys only (optional) - :type password: ``bool`` - - :keyword key_group: if specified, show keys with this key_group only - eg key_group=4 for console password keys (optional) - :type key_group: ``int`` - - :rtype: ``list`` of :class:`NodeKey` - """ - if (ssh and password): - raise LibcloudError('You can only supply ssh or password. To \ -get all keys call with no arguments') - if ssh: - result = self.connection.request('/key/sshrsa/').object - elif password: - result = self.connection.request('/key/password/').object - else: - result = self.connection.request('/key/').object - keys = [self._to_key(value) for value in result.get('data', [])] - - if key_group: - keys = [key for key in keys if - key.key_group == key_group] - return keys - - def ex_create_keypair(self, name, public_key=None, password=None, - key_group=None): - """Creates a key, ssh or password, for server or console - The group for the key (key_group) is 1 for Server and 4 for Console - Returns the id of the created key - """ - if public_key: - if not key_group: - key_group = 1 - data = { - 'name': name, - 'public_key': public_key, - 'key_group': key_group - - } - params = urlencode(data) - result = self.connection.request('/key/sshrsa/', data=params, - method='POST').object - else: - if not key_group: - key_group = 4 - if not password: - password = self.random_password() - data = { - 'name': name, - 'password': password, - 'key_group': key_group - } - params = urlencode(data) - result = self.connection.request('/key/password/', data=params, - method='POST').object - return result.get('data', {}).get('id', '') - - def ex_delete_keypair(self, key_id, ssh=False): - """Delete an ssh key or password given it's id - """ - if ssh: - result = self.connection.request('/key/sshrsa/%s/' % key_id, - method='DELETE').object - else: - result = self.connection.request('/key/password/%s/' % key_id, - method='DELETE').object - return result.get('response') in VALID_RESPONSE_CODES - - def create_node(self, name, size, image, server_key=None, - console_key=None, zone=None, **kwargs): - """Creates the node, and sets the ssh key, console key - NephoScale will respond with a 200-200 response after sending a valid - request. If nowait=True is specified in the args, we then ask a few - times until the server is created and assigned a public IP address, - so that deploy_node can be run - - >>> from libcloud.compute.providers import get_driver - >>> driver = get_driver('nephoscale') - >>> conn = driver('nepho_user','nepho_password') - >>> conn.list_nodes() - >>> name = 'staging-server' - >>> size = conn.list_sizes()[0] - - >>> image = conn.list_images()[9] - - >>> server_keys = conn.ex_list_keypairs(key_group=1)[0] - - >>> server_key = conn.ex_list_keypairs(key_group=1)[0].id - 70867 - >>> console_keys = conn.ex_list_keypairs(key_group=4)[0] - - >>> console_key = conn.ex_list_keypairs(key_group=4)[0].id - 70907 - >>> node = conn.create_node(name=name, size=size, image=image, \ - console_key=console_key, server_key=server_key) - - We can also create an ssh key, plus a console key and - deploy node with them - >>> server_key = conn.ex_create_keypair(name, public_key='123') - 71211 - >>> console_key = conn.ex_create_keypair(name, key_group=4) - 71213 - - We can increase the number of connect attempts to wait until - the node is created, so that deploy_node has ip address to - deploy the script - We can also specify the location - >>> location = conn.list_locations()[0] - >>> node = conn.create_node(name=name, - ... size=size, - ... image=image, - ... console_key=console_key, - ... server_key=server_key, - ... connect_attempts=10, - ... nowait=True, - ... zone=location.id) - """ - hostname = kwargs.get('hostname', name) - service_type = size.id - image = image.id - connect_attempts = int(kwargs.get('connect_attempts', - CONNECT_ATTEMPTS)) - - data = {'name': name, - 'hostname': hostname, - 'service_type': service_type, - 'image': image, - 'server_key': server_key, - 'console_key': console_key, - 'zone': zone - } - - params = urlencode(data) - try: - node = self.connection.request('/server/cloud/', data=params, - method='POST') - except Exception: - e = sys.exc_info()[1] - raise Exception("Failed to create node %s" % e) - node = Node(id='', name=name, state=NodeState.UNKNOWN, public_ips=[], - private_ips=[], driver=self) - - nowait = kwargs.get('ex_wait', False) - if not nowait: - return node - else: - # try to get the created node public ips, for use in deploy_node - # At this point we don't have the id of the newly created Node, - # so search name in nodes - created_node = False - while connect_attempts > 0: - nodes = self.list_nodes() - created_node = [c_node for c_node in nodes if - c_node.name == name] - if created_node: - return created_node[0] - else: - time.sleep(60) - connect_attempts = connect_attempts - 1 - return node - - def _to_node(self, data): - """Convert node in Node instances - """ - - state = NODE_STATE_MAP.get(data.get('power_status'), '4') - public_ips = [] - private_ips = [] - ip_addresses = data.get('ipaddresses', '') - # E.g. "ipaddresses": "198.120.14.6, 10.132.60.1" - if ip_addresses: - for ip in ip_addresses.split(','): - ip = ip.replace(' ', '') - if is_private_subnet(ip): - private_ips.append(ip) - else: - public_ips.append(ip) - extra = { - 'zone_data': data.get('zone'), - 'zone': data.get('zone', {}).get('name'), - 'image': data.get('image', {}).get('friendly_name'), - 'create_time': data.get('create_time'), - 'network_ports': data.get('network_ports'), - 'is_console_enabled': data.get('is_console_enabled'), - 'service_type': data.get('service_type', {}).get('friendly_name'), - 'hostname': data.get('hostname') - } - - node = Node(id=data.get('id'), name=data.get('name'), state=state, - public_ips=public_ips, private_ips=private_ips, - driver=self, extra=extra) - return node - - def _to_key(self, data): - return NodeKey(id=data.get('id'), - name=data.get('name'), - password=data.get('password'), - key_group=data.get('key_group'), - public_key=data.get('public_key')) - - def random_password(self, size=8): - value = os.urandom(size) - password = binascii.hexlify(value).decode('ascii') - return password[:size] diff --git a/libcloud/compute/drivers/ninefold.py b/libcloud/compute/drivers/ninefold.py deleted file mode 100644 index 2689aad794..0000000000 --- a/libcloud/compute/drivers/ninefold.py +++ /dev/null @@ -1,29 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from libcloud.compute.providers import Provider - -from libcloud.compute.drivers.cloudstack import CloudStackNodeDriver - - -class NinefoldNodeDriver(CloudStackNodeDriver): - "Driver for Ninefold's Compute platform." - - host = 'api.ninefold.com' - path = '/compute/v1.0/' - - type = Provider.NINEFOLD - name = 'Ninefold' - website = 'http://ninefold.com/' diff --git a/libcloud/compute/drivers/ntta.py b/libcloud/compute/drivers/ntta.py new file mode 100644 index 0000000000..f47d2fc113 --- /dev/null +++ b/libcloud/compute/drivers/ntta.py @@ -0,0 +1,64 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +NTT America Driver +""" + +from libcloud.compute.providers import Provider +from libcloud.common.dimensiondata import API_ENDPOINTS, DimensionDataConnection +from libcloud.compute.drivers.dimensiondata import DimensionDataNodeDriver + +DEFAULT_REGION = "ntta-na" + + +class NTTAmericaNodeDriver(DimensionDataNodeDriver): + """ + NTT America node driver, based on Dimension Data driver + """ + + selected_region = None + connectionCls = DimensionDataConnection + name = "NTTAmerica" + website = "http://www.nttamerica.com/" + type = Provider.NTTA + features = {"create_node": ["password"]} + api_version = 1.0 + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=DEFAULT_REGION, + **kwargs, + ): + if region not in API_ENDPOINTS: + raise ValueError("Invalid region: %s" % (region)) + + self.selected_region = API_ENDPOINTS[region] + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + api_version=api_version, + region=region, + **kwargs, + ) diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py new file mode 100644 index 0000000000..552ada1f38 --- /dev/null +++ b/libcloud/compute/drivers/nttcis.py @@ -0,0 +1,5794 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +NTT CIS Driver +""" + +import re + +from libcloud.utils.py3 import ET, urlencode, basestring, ensure_string +from libcloud.utils.xml import findall, findtext, fixxpath +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + NodeAuthPassword, +) +from libcloud.common.nttcis import ( + TYPES_URN, + GENERAL_NS, + NETWORK_NS, + API_ENDPOINTS, + DEFAULT_REGION, + NttCisNic, + NttCisTag, + NttCisPort, + NttCisVlan, + LooseVersion, + NttCisStatus, + NttCisTagKey, + NttCisNatRule, + NttCisNetwork, + NttCisPortList, + NttCisIpAddress, + NttCisConnection, + NttCisServerDisk, + NttCisAPIException, + NttCisFirewallRule, + NttCisChildPortList, + NttCisIpAddressList, + NttCisNetworkDomain, + NttCisPublicIpBlock, + NttCisScsiController, + NttCisFirewallAddress, + NttCisAntiAffinityRule, + NttCisReservedIpAddress, + NttCisServerVMWareTools, + NetworkDomainServicePlan, + NttCisChildIpAddressList, + NttCisServerCpuSpecification, + get_params, + process_xml, + dd_object_to_id, +) +from libcloud.compute.types import Provider, NodeState +from libcloud.common.exceptions import BaseHTTPError + +# Node state map is a dictionary with the keys as tuples +# These tuples represent: +# (, , ) +NODE_STATE_MAP = { + ("NORMAL", "false", None): NodeState.STOPPED, + ("PENDING_CHANGE", "false", None): NodeState.PENDING, + ("PENDING_CHANGE", "false", "CHANGE_NETWORK_ADAPTER"): NodeState.PENDING, + ("PENDING_CHANGE", "true", "CHANGE_NETWORK_ADAPTER"): NodeState.PENDING, + ("PENDING_CHANGE", "false", "EXCHANGE_NIC_VLANS"): NodeState.PENDING, + ("PENDING_CHANGE", "true", "EXCHANGE_NIC_VLANS"): NodeState.PENDING, + ("NORMAL", "true", None): NodeState.RUNNING, + ("PENDING_CHANGE", "true", "START_SERVER"): NodeState.STARTING, + ("PENDING_ADD", "true", "DEPLOY_SERVER"): NodeState.STARTING, + ("PENDING_ADD", "true", "DEPLOY_SERVER_WITH_DISK_SPEED"): NodeState.STARTING, + ("PENDING_CHANGE", "true", "SHUTDOWN_SERVER"): NodeState.STOPPING, + ("PENDING_CHANGE", "true", "POWER_OFF_SERVER"): NodeState.STOPPING, + ("PENDING_CHANGE", "true", "REBOOT_SERVER"): NodeState.REBOOTING, + ("PENDING_CHANGE", "true", "RESET_SERVER"): NodeState.REBOOTING, + ("PENDING_CHANGE", "true", "RECONFIGURE_SERVER"): NodeState.RECONFIGURING, +} + +OBJECT_TO_TAGGING_ASSET_TYPE_MAP = { + "Node": "SERVER", + "NodeImage": "CUSTOMER_IMAGE", + "NttCisNetworkDomain": "NETWORK_DOMAIN", + "NttCisVlan": "VLAN", + "NttCisPublicIpBlock": "PUBLIC_IP_BLOCK", +} + + +class NttCisNodeDriver(NodeDriver): + """ + NttCis node driver. + Default api_version is used unless specified. + """ + + selected_region = None + connectionCls = NttCisConnection + name = "NTTC-CIS" + website = "https://www.us.ntt.com/en/services/cloud/enterprise-cloud.html" + type = Provider.NTTCIS + features = {"create_node": ["password"]} + api_version = 1.0 + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=DEFAULT_REGION, + **kwargs, + ): + if region not in API_ENDPOINTS and host is None: + raise ValueError("Invalid region: %s, no host specified" % (region)) + + if region is not None: + self.selected_region = API_ENDPOINTS[region] + + if api_version is not None: + self.api_version = api_version + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + api_version=api_version, + region=region, + **kwargs, + ) + + def _ex_connection_class_kwargs(self): + """ + Add the region to the kwargs before the connection is instantiated + """ + + kwargs = super()._ex_connection_class_kwargs() + kwargs["region"] = self.selected_region + kwargs["api_version"] = self.api_version + + return kwargs + + def _create_node_mcp1( + self, + name, + image, + auth, + ex_description, + ex_network=None, + ex_memory_gb=None, + ex_cpu_specification=None, + ex_is_started=True, + ex_primary_dns=None, + ex_secondary_dns=None, + **kwargs, + ): + """ + Create a new NTTCIS node + + :keyword name: String with a name for this new node (required) + :type name: ``str`` + + :keyword image: OS Image to boot on node. (required) + :type image: :class:`NodeImage` or ``str`` + + :keyword auth: Initial authentication information for the + node. (If this is a customer LINUX + image auth will be ignored) + :type auth: :class:`NodeAuthPassword` or ``str`` or + ``None`` + + :keyword ex_description: description for this node (required) + :type ex_description: ``str`` + + :keyword ex_network: Network to create the node within + (required unless using ex_network_domain + or ex_primary_ipv4) + + :type ex_network: :class:`NttCisNetwork` or ``str`` + + :keyword ex_memory_gb: The amount of memory in GB for the + server + :type ex_memory_gb: ``int`` + + :keyword ex_cpu_specification: The spec of CPU to deploy ( + optional) + :type ex_cpu_specification: + :class:`DimensionDataServerCpuSpecification` + + :keyword ex_is_started: Start server after creation? default + true (required) + :type ex_is_started: ``bool`` + + :keyword ex_primary_dns: The node's primary DNS + + :type ex_primary_dns: ``str`` + + :keyword ex_secondary_dns: The node's secondary DNS + + :type ex_secondary_dns: ``str`` + + :return: The newly created :class:`Node`. + :rtype: :class:`Node` + """ + + password = None + image_needs_auth = self._image_needs_auth(image) + + if image_needs_auth: + if isinstance(auth, basestring): + auth_obj = NodeAuthPassword(password=auth) + password = auth + else: + auth_obj = self._get_and_check_auth(auth) + password = auth_obj.password + + server_elm = ET.Element("deployServer", {"xmlns": TYPES_URN}) + ET.SubElement(server_elm, "name").text = name + ET.SubElement(server_elm, "description").text = ex_description + image_id = self._image_to_image_id(image) + ET.SubElement(server_elm, "imageId").text = image_id + ET.SubElement(server_elm, "start").text = str(ex_is_started).lower() + + if password is not None: + ET.SubElement(server_elm, "administratorPassword").text = password + + if ex_cpu_specification is not None: + cpu = ET.SubElement(server_elm, "cpu") + cpu.set("speed", ex_cpu_specification.performance) + cpu.set("count", str(ex_cpu_specification.cpu_count)) + cpu.set("coresPerSocket", str(ex_cpu_specification.cores_per_socket)) + + if ex_memory_gb is not None: + ET.SubElement(server_elm, "memoryGb").text = str(ex_memory_gb) + + if ex_network is not None: + network_elm = ET.SubElement(server_elm, "network") + network_id = self._network_to_network_id(ex_network) + ET.SubElement(network_elm, "networkId").text = network_id + + if ex_primary_dns: + dns_elm = ET.SubElement(server_elm, "primaryDns") + dns_elm.text = ex_primary_dns + + if ex_secondary_dns: + dns_elm = ET.SubElement(server_elm, "secondaryDns") + dns_elm.text = ex_secondary_dns + + response = self.connection.request_with_orgId_api_2( + "server/deployServer", method="POST", data=ET.tostring(server_elm) + ).object + + node_id = None + + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "serverId": + node_id = info.get("value") + + node = self.ex_get_node_by_id(node_id) + + if image_needs_auth: + if getattr(auth_obj, "generated", False): + node.extra["password"] = auth_obj.password + + return node + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_network_domain=None, + ex_primary_nic_private_ipv4=None, + ex_primary_nic_vlan=None, + ex_primary_nic_network_adapter=None, + ex_additional_nics=None, + ex_description=None, + ex_disks=None, + ex_cpu_specification=None, + ex_memory_gb=None, + ex_is_started=True, + ex_primary_dns=None, + ex_secondary_dns=None, + ex_ipv4_gateway=None, + ex_microsoft_time_zone=None, + **kwargs, + ): + """ + Create a new NTTCIS node in MCP2. However, it is still + backward compatible for MCP1 for a limited time. Please consider + using MCP2 datacenter as MCP1 will phase out soon. + + Legacy Create Node for MCP1 datacenter + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.base import NodeAuthPassword + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = False + >>> NTTCIS = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Password + >>> root_pw = NodeAuthPassword('password123') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU1') + >>> + >>> # Get network by location + >>> my_network = driver.list_networks(location=location)[0] + >>> pprint(my_network) + >>> + >>> # Get Image + >>> images = driver.list_images(location=location) + >>> image = images[0] + >>> + >>> node = driver.create_node(name='test_blah_2', image=image, + >>> auth=root_pw, + >>> ex_description='test3 node', + >>> ex_network=my_network, + >>> ex_is_started=False) + >>> pprint(node) + + + Create Node in MCP2 Data CenterF + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.base import NodeAuthPassword + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Password + >>> root_pw = NodeAuthPassword('password123') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + networkDomainName][0] + >>> + >>> vlan = driver.ex_list_vlans(location=location, + >>> network_domain=my_network_domain)[0] + >>> pprint(vlan) + >>> + >>> # Get Image + >>> images = driver.list_images(location=location) + >>> image = images[0] + >>> + >>> # Create node using vlan instead of private IPv4 + >>> node = driver.create_node(name='test_server_01', image=image, + >>> auth=root_pw, + >>> ex_description='test2 node', + >>> ex_network_domain=my_network_domain, + >>> ex_primary_nic_vlan=vlan, + >>> ex_is_started=False) + >>> + >>> # Option: Create node using private IPv4 instead of vlan + >>> # node = driver.create_node(name='test_server_02', image=image, + >>> # auth=root_pw, + >>> # ex_description='test2 node', + >>> # ex_network_domain=my_network_domain, + >>> # ex_primary_nic_private_ipv4='10.1.1.7', + >>> # ex_is_started=False) + >>> + >>> # Option: Create node using by specifying Network Adapter + >>> # node = driver.create_node(name='test_server_03', image=image, + >>> # auth=root_pw, + >>> # ex_description='test2 node', + >>> # ex_network_domain=my_network_domain, + >>> # ex_primary_nic_vlan=vlan, + >>> # ex_primary_nic_network_adapter='E1000', + >>> # ex_is_started=False) + >>> + + :keyword name: (required) String with a name for this new node + :type name: ``str`` + + :keyword image: (required) OS Image to boot on node. + :type image: :class:`NodeImage` or ``str`` + + :keyword auth: Initial authentication information for the + node. (If this is a customer LINUX + image auth will be ignored) + :type auth: :class:`NodeAuthPassword` or ``str`` or ``None`` + + :keyword ex_description: (optional) description for this node + :type ex_description: ``str`` + + + :keyword ex_network_domain: (required) Network Domain or Network + Domain ID to create the node + :type ex_network_domain: :class:`DimensionDataNetworkDomain` + or ``str`` + + :keyword ex_primary_nic_private_ipv4: Provide private IPv4. Ignore + if ex_primary_nic_vlan is + provided. Use one or the + other. Not both. + :type ex_primary_nic_private_ipv4: :``str`` + + :keyword ex_primary_nic_vlan: Provide VLAN for the node if + ex_primary_nic_private_ipv4 NOT + provided. One or the other. Not both. + :type ex_primary_nic_vlan: :class: DimensionDataVlan or ``str`` + + :keyword ex_primary_nic_network_adapter: (Optional) Default value + for the Operating System + will be used if leave + empty. Example: "E1000". + :type ex_primary_nic_network_adapter: :``str`` + + :keyword ex_additional_nics: (optional) List + :class:'NttCisNic' or None + :type ex_additional_nics: ``list`` of :class:'NttCisNic' + or ``str`` + + :keyword ex_memory_gb: (optional) The amount of memory in GB for + the server Can be used to override the + memory value inherited from the source + Server Image. + :type ex_memory_gb: ``int`` + + :keyword ex_cpu_specification: (optional) The spec of CPU to deploy + :type ex_cpu_specification: + :class:`DimensionDataServerCpuSpecification` + + :keyword ex_is_started: (required) Start server after creation. + Default is set to true. + :type ex_is_started: ``bool`` + + :keyword ex_primary_dns: (Optional) The node's primary DNS + :type ex_primary_dns: ``str`` + + :keyword ex_secondary_dns: (Optional) The node's secondary DNS + :type ex_secondary_dns: ``str`` + + :keyword ex_ipv4_gateway: (Optional) IPv4 address in dot-decimal + notation, which will be used as the + Primary NIC gateway instead of the default + gateway assigned by the system. If + ipv4Gateway is provided it does not have + to be on the VLAN of the Primary NIC + but MUST be reachable or the Guest OS + will not be configured correctly. + :type ex_ipv4_gateway: ``str`` + + :keyword ex_disks: (optional) NTTCIS disks. Optional disk + elements can be used to define the disk speed + that each disk on the Server; inherited from the + source Server Image will be deployed to. It is + not necessary to include a diskelement for every + disk; only those that you wish to set a disk + speed value for. Note that scsiId 7 cannot be + used.Up to 13 disks can be present in addition to + the required OS disk on SCSI ID 0. Refer to + https://docs.mcp-services.net/x/UwIu for disk + + :type ex_disks: List or tuple of :class:'DimensionDataServerDisk` + + :keyword ex_microsoft_time_zone: (optional) For use with + Microsoft Windows source Server Images only. For the exact + value to use please refer to the table of time zone + indexes in the following Microsoft Technet + documentation. If none is supplied, the default time + zone for the data center geographic region will be used. + :type ex_microsoft_time_zone: `str`` + + + :return: The newly created :class:`Node`. + :rtype: :class:`Node` + """ + + # Neither legacy MCP1 network nor MCP2 network domain provided + + if ex_network_domain is None and "ex_network" not in kwargs: + raise ValueError( + "You must provide either ex_network_domain " + "for MCP2 or ex_network for legacy MCP1" + ) + + # Ambiguous parameter provided. Can't determine if it is MCP 1 or 2. + + if ex_network_domain is not None and "ex_network" in kwargs: + raise ValueError( + "You can only supply either " + "ex_network_domain " + "for MCP2 or ex_network for legacy MCP1" + ) + + # Set ex_is_started to False by default if none bool data type provided + + if not isinstance(ex_is_started, bool): + ex_is_started = True + + # Handle MCP1 legacy + + if "ex_network" in kwargs: + new_node = self._create_node_mcp1( + name=name, + image=image, + auth=auth, + ex_network=kwargs.get("ex_network"), + ex_description=ex_description, + ex_memory_gb=ex_memory_gb, + ex_cpu_specification=ex_cpu_specification, + ex_is_started=ex_is_started, + ex_primary_ipv4=ex_primary_nic_private_ipv4, + ex_disks=ex_disks, + ex_additional_nics_vlan=kwargs.get("ex_additional_nics_vlan"), + ex_additional_nics_ipv4=kwargs.get("ex_additional_nics_ipv4"), + ex_primary_dns=ex_primary_dns, + ex_secondary_dns=ex_secondary_dns, + ) + else: + # Handle MCP2 legacy. CaaS api 2.2 or earlier + + if "ex_vlan" in kwargs: + ex_primary_nic_vlan = kwargs.get("ex_vlan") + + if "ex_primary_ipv4" in kwargs: + ex_primary_nic_private_ipv4 = kwargs.get("ex_primary_ipv4") + + additional_nics = [] + + if "ex_additional_nics_vlan" in kwargs: + vlans = kwargs.get("ex_additional_nics_vlan") + + if isinstance(vlans, (list, tuple)): + for v in vlans: + add_nic = NttCisNic(vlan=v) + additional_nics.append(add_nic) + else: + raise TypeError("ex_additional_nics_vlan must " "be None or a tuple/list") + + if "ex_additional_nics_ipv4" in kwargs: + ips = kwargs.get("ex_additional_nics_ipv4") + + if isinstance(ips, (list, tuple)): + for ip in ips: + add_nic = NttCisNic(private_ip_v4=ip) + additional_nics.append(add_nic) + else: + if ips is not None: + raise TypeError("ex_additional_nics_ipv4 must " "be None or a tuple/list") + + if "ex_additional_nics_vlan" in kwargs or "ex_additional_nics_ipv4" in kwargs: + ex_additional_nics = additional_nics + + # Handle MCP2 latest. CaaS API 2.3 onwards + + if ex_network_domain is None: + raise ValueError("ex_network_domain must be specified") + + password = None + image_needs_auth = self._image_needs_auth(image) + + if image_needs_auth: + if isinstance(auth, basestring): + auth_obj = NodeAuthPassword(password=auth) + password = auth + else: + auth_obj = self._get_and_check_auth(auth) + password = auth_obj.password + + server_elm = ET.Element("deployServer", {"xmlns": TYPES_URN}) + ET.SubElement(server_elm, "name").text = name + ET.SubElement(server_elm, "description").text = ex_description + image_id = self._image_to_image_id(image) + ET.SubElement(server_elm, "imageId").text = image_id + ET.SubElement(server_elm, "start").text = str(ex_is_started).lower() + + if password is not None: + ET.SubElement(server_elm, "administratorPassword").text = password + + if ex_cpu_specification is not None: + cpu = ET.SubElement(server_elm, "cpu") + cpu.set("speed", ex_cpu_specification.performance) + cpu.set("count", str(ex_cpu_specification.cpu_count)) + cpu.set("coresPerSocket", str(ex_cpu_specification.cores_per_socket)) + + if ex_memory_gb is not None: + ET.SubElement(server_elm, "memoryGb").text = str(ex_memory_gb) + + if ex_primary_nic_private_ipv4 is None and ex_primary_nic_vlan is None: + raise ValueError( + "Missing argument. Either " + "ex_primary_nic_private_ipv4 or " + "ex_primary_nic_vlan " + "must be specified." + ) + + if ex_primary_nic_private_ipv4 is not None and ex_primary_nic_vlan is not None: + raise ValueError( + "Either ex_primary_nic_private_ipv4 or " + "ex_primary_nic_vlan " + "be specified. Not both." + ) + + network_elm = ET.SubElement(server_elm, "networkInfo") + + net_domain_id = self._network_domain_to_network_domain_id(ex_network_domain) + + network_elm.set("networkDomainId", net_domain_id) + + pri_nic = ET.SubElement(network_elm, "primaryNic") + + if ex_primary_nic_private_ipv4 is not None: + ET.SubElement(pri_nic, "privateIpv4").text = ex_primary_nic_private_ipv4 + + if ex_primary_nic_vlan is not None: + vlan_id = self._vlan_to_vlan_id(ex_primary_nic_vlan) + ET.SubElement(pri_nic, "vlanId").text = vlan_id + + if ex_primary_nic_network_adapter is not None: + ET.SubElement(pri_nic, "networkAdapter").text = ex_primary_nic_network_adapter + + if isinstance(ex_additional_nics, (list, tuple)): + for nic in ex_additional_nics: + additional_nic = ET.SubElement(network_elm, "additionalNic") + + if nic.private_ip_v4 is None and nic.vlan is None: + raise ValueError( + "Either a vlan or private_ip_v4 " + "must be specified for each " + "additional nic." + ) + + if nic.private_ip_v4 is not None and nic.vlan is not None: + raise ValueError( + "Either a vlan or private_ip_v4 " + "must be specified for each " + "additional nic. Not both." + ) + + if nic.private_ip_v4 is not None: + ET.SubElement(additional_nic, "privateIpv4").text = nic.private_ip_v4 + + if nic.vlan is not None: + vlan_id = self._vlan_to_vlan_id(nic.vlan) + ET.SubElement(additional_nic, "vlanId").text = vlan_id + + if nic.network_adapter_name is not None: + ET.SubElement(additional_nic, "networkAdapter").text = ( + nic.network_adapter_name + ) + elif ex_additional_nics is not None: + raise TypeError("ex_additional_NICs must be None or tuple/list") + + if ex_primary_dns: + dns_elm = ET.SubElement(server_elm, "primaryDns") + dns_elm.text = ex_primary_dns + + if ex_secondary_dns: + dns_elm = ET.SubElement(server_elm, "secondaryDns") + dns_elm.text = ex_secondary_dns + + if ex_ipv4_gateway: + ET.SubElement(server_elm, "ipv4Gateway").text = ex_ipv4_gateway + + if isinstance(ex_disks, (list, tuple)): + for disk in ex_disks: + disk_elm = ET.SubElement(server_elm, "disk") + disk_elm.set("scsiId", disk.scsi_id) + disk_elm.set("speed", disk.speed) + elif ex_disks is not None: + raise TypeError("ex_disks must be None or tuple/list") + + if ex_microsoft_time_zone: + ET.SubElement(server_elm, "microsoftTimeZone").text = ex_microsoft_time_zone + + response = self.connection.request_with_orgId_api_2( + "server/deployServer", method="POST", data=ET.tostring(server_elm) + ).object + + node_id = None + + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "serverId": + node_id = info.get("value") + + new_node = self.ex_get_node_by_id(node_id) + + if image_needs_auth: + if getattr(auth_obj, "generated", False): + new_node.extra["password"] = auth_obj.password + + return new_node + + def destroy_node(self, node): + """ + Deletes a node, node must be stopped before deletion + + + :keyword node: The node to delete + :type node: :class:`Node` + + :rtype: ``bool`` + """ + + request_elm = ET.Element("deleteServer", {"xmlns": TYPES_URN, "id": node.id}) + body = self.connection.request_with_orgId_api_2( + "server/deleteServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def reboot_node(self, node): + """ + Reboots a node by requesting the OS restart via the hypervisor + + + :keyword node: The node to reboot + :type node: :class:`Node` + + :rtype: ``bool`` + """ + + request_elm = ET.Element("rebootServer", {"xmlns": TYPES_URN, "id": node.id}) + body = self.connection.request_with_orgId_api_2( + "server/rebootServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def list_nodes( + self, + ex_location=None, + ex_name=None, + ex_ipv6=None, + ex_ipv4=None, + ex_vlan=None, + ex_image=None, + ex_deployed=None, + ex_started=None, + ex_state=None, + ex_network_domain=None, + ex_snaphots=None, + ): + """ + List nodes deployed for your organization. + + :keyword ex_location: Filters the node list to nodes that are + located in this location + :type ex_location: :class:`NodeLocation` or ``str`` + + :keyword ex_name: Filters the node list to nodes that have this name + :type ex_name ``str`` + + :keyword ex_ipv6: Filters the node list to nodes that have this + ipv6 address + :type ex_ipv6: ``str`` + + :keyword ex_ipv4: Filters the node list to nodes that have this + ipv4 address + :type ex_ipv4: ``str`` + + :keyword ex_vlan: Filters the node list to nodes that are in this VLAN + :type ex_vlan: :class:`DimensionDataVlan` or ``str`` + + :keyword ex_image: Filters the node list to nodes that have this image + :type ex_image: :class:`NodeImage` or ``str`` + + :keyword ex_deployed: Filters the node list to nodes that are + deployed or not + :type ex_deployed: ``bool`` + + :keyword ex_started: Filters the node list to nodes that are + started or not + :type ex_started: ``bool`` + + :keyword ex_state: Filters the node list by nodes that are in + this state + :type ex_state: ``str`` + + :keyword ex_network_domain: Filters the node list to nodes in this + network domain + :type ex_network_domain: :class:`NttCisNetworkDomain` + or ``str`` + + :return: a list of `Node` objects + :rtype: ``list`` of :class:`Node` + """ + + node_list = [] + # This is a generator so we changed from the original + # and if nodes is not empty, ie, the stop iteration confdition + # Then set node_list to nodes and return. + + for nodes in self.ex_list_nodes_paginated( + location=ex_location, + name=ex_name, + ipv6=ex_ipv6, + ipv4=ex_ipv4, + vlan=ex_vlan, + image=ex_image, + deployed=ex_deployed, + started=ex_started, + state=ex_state, + network_domain=ex_network_domain, + ): + if nodes: + node_list = nodes + + return node_list + + def list_images(self, location=None): + """ + List images available + + Note: Currently only returns the default 'base OS images' + provided by NTTCIS. Customer images (snapshots) + use ex_list_customer_images + + :keyword ex_location: Filters the node list to nodes that are + located in this location + :type ex_location: :class:`NodeLocation` or ``str`` + + :return: List of images available + :rtype: ``list`` of :class:`NodeImage` + """ + + params = {} + + if location is not None: + params["datacenterId"] = self._location_to_location_id(location) + + return self._to_images( + self.connection.request_with_orgId_api_2("image/osImage", params=params).object + ) + + def list_sizes(self, location=None): + """ + return a list of available sizes + Currently, the size of the node is dictated by the chosen OS base + image, they cannot be set explicitly. + + @inherits: :class:`NodeDriver.list_sizes` + """ + + return [ + NodeSize( + id=1, + name="default", + ram=0, + disk=0, + bandwidth=0, + price=0, + driver=self.connection.driver, + ), + ] + + def list_datacenter_properties(self, location): + """ + return a list of available sizes + Currently, the size of the node is dictated by the chosen OS base + image, they cannot be set explicitly. + + @inherits: :class:`NodeDriver.list_sizes` + """ + + return [ + NodeSize( + id=1, + name="default", + ram=0, + disk=0, + bandwidth=0, + price=0, + driver=self.connection.driver, + ), + ] + + def list_locations(self, ex_id=None): + """ + List locations (datacenters) available for instantiating servers and + networks. + + :keyword ex_id: Filters the location list to this id + :type ex_id: ``str`` + + :return: List of locations + :rtype: ``list`` of :class:`NttCisDatacenter` + """ + + params = {} + + if ex_id is not None: + params["id"] = ex_id + + return self._to_locations( + self.connection.request_with_orgId_api_2( + "infrastructure/datacenter", params=params + ).object + ) + + def list_snapshot_windows(self, location, plan): + """ + List snapshot windows in a given location + :param location: a location object or location id such as "NA9" + :param plan: 'ESSENTIALS' or 'ADVANCED' + :return: dictionary with keys id, day_of_week, start_hour, availability + :rtype: dict + """ + + params = {} + params["datacenterId"] = self._location_to_location_id(location) + params["servicePlan"] = plan + + return self._to_windows( + self.connection.request_with_orgId_api_2( + "infrastructure/snapshotWindow", params=params + ).object + ) + + def list_networks(self, location=None): + """ + List networks deployed across all data center locations for your + organization. The response includes the location of each network. + + + :keyword location: The location + :type location: :class:`NodeLocation` or ``str`` + + :return: a list of NttCisNetwork objects + :rtype: ``list`` of :class:`NttCisNetwork` + """ + + url_ext = "" + + if location is not None: + url_ext = "/" + self._location_to_location_id(location) + + return self._to_networks( + self.connection.request_with_orgId_api_2("networkWithLocation%s" % url_ext).object + ) + + def import_image( + self, + ovf_package_name, + name, + cluster_id=None, + datacenter_id=None, + description=None, + is_guest_os_customization=None, + tagkey_name_value_dictionaries=None, + ): + """ + Import image + + :param ovf_package_name: Image OVF package name + :type ovf_package_name: ``str`` + + :param name: Image name + :type name: ``str`` + + :param cluster_id: Provide either cluster_id or datacenter_id + :type cluster_id: ``str`` + + :param datacenter_id: Provide either cluster_id or datacenter_id + :type datacenter_id: ``str`` + + :param description: Optional. Description of image + :type description: ``str`` + + :param is_guest_os_customization: Optional. true for NGOC image + :type is_guest_os_customization: ``bool`` + + :param tagkey_name_value_dictionaries: Optional tagkey name value dict + :type tagkey_name_value_dictionaries: dictionaries + + :return: Return true if successful + :rtype: ``bool`` + """ + + # Unsupported for version lower than 2.4 + + if LooseVersion(self.connection.active_api_version) < LooseVersion("2.4"): + raise Exception( + "import image is feature is NOT supported in " "api version earlier than 2.4" + ) + elif cluster_id is None and datacenter_id is None: + raise ValueError("Either cluster_id or datacenter_id must be " "provided") + elif cluster_id is not None and datacenter_id is not None: + raise ValueError( + "Cannot accept both cluster_id and " "datacenter_id. Please provide either one" + ) + else: + import_image_elem = ET.Element("urn:importImage", {"xmlns:urn": TYPES_URN}) + + ET.SubElement(import_image_elem, "urn:ovfPackage").text = ovf_package_name + + ET.SubElement(import_image_elem, "urn:name").text = name + + if description is not None: + ET.SubElement(import_image_elem, "urn:description").text = description + + if cluster_id is not None: + ET.SubElement(import_image_elem, "urn:clusterId").text = cluster_id + else: + ET.SubElement(import_image_elem, "urn:datacenterId").text = datacenter_id + + if is_guest_os_customization is not None: + ET.SubElement(import_image_elem, "urn:guestOsCustomization").text = ( + is_guest_os_customization + ) + + if ( + tagkey_name_value_dictionaries is not None + and len(tagkey_name_value_dictionaries) > 0 + ): + for k, v in tagkey_name_value_dictionaries.items(): + tag_elem = ET.SubElement(import_image_elem, "urn:tag") + ET.SubElement(tag_elem, "urn:tagKeyName").text = k + + if v is not None: + ET.SubElement(tag_elem, "urn:value").text = v + + response = self.connection.request_with_orgId_api_2( + "image/importImage", method="POST", data=ET.tostring(import_image_elem) + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def start_node(self, node): + """ + Powers on an existing deployed server + + :param node: Node which should be used + :type node: :class:`Node` + + :rtype: ``bool`` + """ + + request_elm = ET.Element("startServer", {"xmlns": TYPES_URN, "id": node.id}) + body = self.connection.request_with_orgId_api_2( + "server/startServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def stop_node(self, node): + """ + This function will attempt to "gracefully" stop a server by + initiating a shutdown sequence within the guest operating system. + A successful response on this function means the system has + successfully passed the request into the operating system. + + :param node: Node which should be used + :type node: :class:`Node` + + :rtype: ``bool`` + """ + request_elm = ET.Element("shutdownServer", {"xmlns": TYPES_URN, "id": node.id}) + body = self.connection.request_with_orgId_api_2( + "server/shutdownServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_nodes_paginated( + self, + name=None, + location=None, + ipv6=None, + ipv4=None, + vlan=None, + image=None, + deployed=None, + started=None, + state=None, + network=None, + network_domain=None, + ): + """ + Return a generator which yields node lists in pages + + :keyword location: Filters the node list to nodes that are + located in this location + :type location: :class:`NodeLocation` or ``str`` + + :keyword name: Filters the node list to nodes that have this name + :type name ``str`` + + :keyword ipv6: Filters the node list to nodes that have this + ipv6 address + :type ipv6: ``str`` + + :keyword ipv4: Filters the node list to nodes that have this + ipv4 address + :type ipv4: ``str`` + + :keyword vlan: Filters the node list to nodes that are in this VLAN + :type vlan: :class:`NttCisVlan` or ``str`` + + :keyword image: Filters the node list to nodes that have this image + :type image: :class:`NodeImage` or ``str`` + + :keyword deployed: Filters the node list to nodes that are + deployed or not + :type deployed: ``bool`` + + :keyword started: Filters the node list to nodes that are + started or not + :type started: ``bool`` + :keyword state: Filters the node list to nodes that are in + this state + :type state: ``str`` + :keyword network: Filters the node list to nodes in this network + :type network: :class:`NttCisNetwork` or ``str`` + + :keyword network_domain: Filters the node list to nodes in this + network domain + :type network_domain: :class:`NttCisNetworkDomain` + or ``str`` + :return: a list of `Node` objects + :rtype: ``generator`` of `list` of :class:`Node` + + """ + + params = {} + + if location is not None: + params["datacenterId"] = self._location_to_location_id(location) + + if ipv6 is not None: + params["ipv6"] = ipv6 + + if ipv4 is not None: + params["privateIpv4"] = ipv4 + + if state is not None: + params["state"] = state + + if started is not None: + params["started"] = started + + if deployed is not None: + params["deployed"] = deployed + + if name is not None: + params["name"] = name + + if network_domain is not None: + params["networkDomainId"] = self._network_domain_to_network_domain_id(network_domain) + + if network is not None: + params["networkId"] = self._network_to_network_id(network) + + if vlan is not None: + params["vlanId"] = self._vlan_to_vlan_id(vlan) + + if image is not None: + params["sourceImageId"] = self._image_to_image_id(image) + + nodes_obj = self._list_nodes_single_page(params) + yield self._to_nodes(nodes_obj) + + while nodes_obj.get("pageCount") >= nodes_obj.get("pageSize"): + params["pageNumber"] = int(nodes_obj.get("pageNumber")) + 1 + nodes_obj = self._list_nodes_single_page(params) + yield self._to_nodes(nodes_obj) + + def ex_edit_metadata(self, node, name=None, description=None, drs_eligible=None): + request_elem = ET.Element("editServerMetadata", {"xmlns": TYPES_URN, "id": node.id}) + + if name is not None: + ET.SubElement(request_elem, "name").text = name + + if description is not None: + ET.SubElement(request_elem, "description").text = description + + if drs_eligible is not None: + ET.SubElement(request_elem, "drsEligible").text = drs_eligible + body = self.connection.request_with_orgId_api_2( + "server/editServerMetadata", method="POST", data=ET.tostring(request_elem) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_start_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + + return self.start_node(node=node) + + def ex_shutdown_graceful(self, node): + return self.stop_node(node=node) + + def ex_power_off(self, node): + """ + This function will abruptly power-off a server. Unlike + ex_shutdown_graceful, success ensures the node will stop but some OS + and application configurations may be adversely affected by the + equivalent of pulling the power plug out of the machine. + + :param node: Node which should be used + :type node: :class:`Node` + + :rtype: ``bool`` + """ + + request_elm = ET.Element("powerOffServer", {"xmlns": TYPES_URN, "id": node.id}) + + try: + body = self.connection.request_with_orgId_api_2( + "server/powerOffServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + except (NttCisAPIException, NameError, BaseHTTPError): + r = self.ex_get_node_by_id(node.id) + response_code = r.state.upper() + + return response_code in ["IN_PROGRESS", "OK", "STOPPED", "STOPPING"] + + def ex_reset(self, node): + """ + This function will abruptly reset a server. Unlike + reboot_node, success ensures the node will restart but some OS + and application configurations may be adversely affected by the + equivalent of pulling the power plug out of the machine. + + :param node: Node which should be used + :type node: :class:`Node` + + :rtype: ``bool`` + """ + + request_elm = ET.Element("resetServer", {"xmlns": TYPES_URN, "id": node.id}) + body = self.connection.request_with_orgId_api_2( + "server/resetServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_update_vm_tools(self, node): + """ + This function triggers an update of the VMware Tools + software running on the guest OS of a Server. + + :param node: Node which should be used + :type node: :class:`Node` + + :rtype: ``bool`` + """ + + request_elm = ET.Element("updateVmwareTools", {"xmlns": TYPES_URN, "id": node.id}) + body = self.connection.request_with_orgId_api_2( + "server/updateVmwareTools", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_update_node(self, node, name=None, description=None, cpu_count=None, ram_mb=None): + """ + Update the node, the name, CPU or RAM + + :param node: Node which should be used + :type node: :class:`Node` + + :param name: The new name (optional) + :type name: ``str`` + + :param description: The new description (optional) + :type description: ``str`` + + :param cpu_count: The new CPU count (optional) + :type cpu_count: ``int`` + + :param ram_mb: The new Memory in MB (optional) + :type ram_mb: ``int`` + + :rtype: ``bool`` + """ + + data = {} + + if name is not None: + data["name"] = name + + if description is not None: + data["description"] = description + + if cpu_count is not None: + data["cpuCount"] = str(cpu_count) + + if ram_mb is not None: + data["memory"] = str(ram_mb) + body = self.connection.request_with_orgId_api_1( + "server/%s" % (node.id), method="POST", data=urlencode(data, True) + ).object + response_code = findtext(body, "result", GENERAL_NS) + + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_enable_snapshots(self, node, window, plan="ADVANCED", initiate="true"): + """ + Enable snapshot service on a server + + :param node: Node ID of the node on which to enable snapshots. + :type node: ``str`` + + :param window: The window id of the window in which the + snapshot is enabled. + :type name: ``str`` + + :param plan: Pland type 'ESSENTIALS' or 'ADVANCED + :type plan: ``str`` + + :param initiate: Run a snapshot upon configuration of the + snapshot. + :type ``str`` + + :rtype: ``bool`` + """ + + update_node = ET.Element("enableSnapshotService", {"xmlns": TYPES_URN}) + window_id = window + plan = plan + update_node.set("serverId", node) + ET.SubElement(update_node, "servicePlan").text = plan + ET.SubElement(update_node, "windowId").text = window_id + ET.SubElement(update_node, "initiateManualSnapshot").text = initiate + result = self.connection.request_with_orgId_api_2( + "snapshot/enableSnapshotService", + method="POST", + data=ET.tostring(update_node), + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def list_snapshots(self, node, page_size=None): + """ + List snapshots of a server. The list of snapshots can get large. + Therefore, page_size is optional to limit this if desired. + + :param node: Node nameof the node on which to enable snapshots. + :type node: ``str`` + :param page_size: (Optional) Limit the number of records returned + :return snapshots + :rtype: ``list`` of `dictionaries` + """ + + params = {} + params["serverId"] = self.list_nodes(ex_name=node)[0].id + + if page_size is not None: + params["pageSize"] = page_size + + return self._to_snapshots( + self.connection.request_with_orgId_api_2("snapshot/snapshot", params=params).object + ) + + def get_snapshot(self, snapshot_id): + """ + Get snapshot of a server by snapshot id. + + :param snapshot_id: ID of snapshot to retrieve. + :type snapshot_id: ``str`` + :return a snapshot + :rtype: ``dict`` + """ + + return self._to_snapshot( + self.connection.request_with_orgId_api_2("snapshot/snapshot/%s" % snapshot_id).object + ) + + def ex_disable_snapshots(self, node): + """ + Disable snapshots on a server. This also deletes current snapshots. + + :param node: Node ID of the node on which to enable snapshots. + :type node: ``str`` + :return True or False + :rtype: ``bool`` + """ + + update_node = ET.Element("disableSnapshotService", {"xmlns": TYPES_URN}) + + update_node.set("serverId", node) + result = self.connection.request_with_orgId_api_2( + "snapshot/disableSnapshotService", + method="POST", + data=ET.tostring(update_node), + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_initiate_manual_snapshot(self, name=None, server_id=None): + """ + Initiate a manual snapshot of server on the fly + + :param name: optional name of server + :type name: ``str`` + + :param server_id: optional parameter to use instead of name + :type `server_id`str`` + + :return: True of False + :rtype: ``bool`` + + """ + + if server_id is None: + node = self.list_nodes(ex_name=name) + + if len(node) > 1: + raise RuntimeError( + "Found more than one server Id, " + "please use one the following along" + " with name parameter: {}".format([n.id for n in node]) + ) + else: + node = [] + node.append(self.ex_get_node_by_id(server_id)) + update_node = ET.Element("initiateManualSnapshot", {"xmlns": TYPES_URN}) + update_node.set("serverId", node[0].id) + result = self.connection.request_with_orgId_api_2( + "snapshot/initiateManualSnapshot", + method="POST", + data=ET.tostring(update_node), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_create_snapshot_preview_server( + self, + snapshot_id, + server_name, + server_started, + nics_connected, + server_description=None, + target_cluster_id=None, + preserve_mac_addresses=None, + tag_key_name=None, + tag_key_id=None, + tag_value=None, + ): + """ + Create a snapshot preview of a server to clone to a new server + + :param snapshot_id: ID of the specific snahpshot to use in + creating preview server. + :type snapshot_id: ``str`` + + :param server_name: Name of the server created from the snapshot + :type ``str`` + + :param nics_connected: 'true' or 'false'. Should the nics be + automatically connected + :type ``str`` + + :param server_description: (Optional) A brief description of the + server. + :type ``str`` + + :param target_cluster_id: (Optional) The ID of a specific cluster as + opposed to the default. + :type ``str`` + + :param preserve_mac_address: (Optional) If set to 'true' will preserve + mac address from the original server. + :type ``str`` + + :param tag_key_name: (Optional) If tagging is desired and by name is + desired, set this to the tag name. + :type ``str`` + + :param tag_key_id: (Optional) If tagging is desired and by id is + desired, set this to the tag id. + :type ``str`` + + :param tag_value: (Optional) If using a tag_key_id or tag_key_name, + set the value fo tag_value. + + :rtype: ``str`` + """ + + create_preview = ET.Element( + "createSnapshotPreviewServer", + {"xmlns": TYPES_URN, "snapshotId": snapshot_id}, + ) + ET.SubElement(create_preview, "serverName").text = server_name + + if server_description is not None: + ET.SubElement(create_preview, "serverDescription").text = server_description + + if target_cluster_id is not None: + ET.SubElement(create_preview, "targetClusterId").text = target_cluster_id + ET.SubElement(create_preview, "serverStarted").text = server_started + ET.SubElement(create_preview, "nicsConnected").text = nics_connected + + if preserve_mac_addresses is not None: + ET.SubElement(create_preview, "preserveMacAddresses").text = preserve_mac_addresses + + if tag_key_name is not None: + tag_elem = ET.SubElement(create_preview, "tag") + ET.SubElement(tag_elem, "tagKeyName").text = tag_key_name + ET.SubElement(tag_elem, "value").text = tag_value + elif tag_key_id is not None: + tag_elem = ET.SubElement(create_preview, "tagById") + ET.SubElement(create_preview, "tagKeyId").text = tag_key_name + ET.SubElement(tag_elem, "value").text = tag_value + result = self.connection.request_with_orgId_api_2( + "snapshot/createSnapshotPreviewServer", + method="POST", + data=ET.tostring(create_preview), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_migrate_preview_server(self, preview_id): + migrate_preview = ET.Element( + "migrateSnapshotPreviewServer", {"xmlns": TYPES_URN, "serverId": preview_id} + ) + result = self.connection.request_with_orgId_api_2( + "snapshot/migrateSnapshotPreviewServer", + method="POST", + data=ET.tostring(migrate_preview), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_create_anti_affinity_rule(self, node_list): + """ + Edited to work with api 2.x. No longer supports 1.0 + Create an anti affinity rule given a list of nodes + Anti affinity rules ensure that servers will not reside + on the same VMware ESX host + + :param node_list: The list of nodes to create a rule for + :type node_list: ``list`` of :class:`Node` or + ``list`` of ``str`` + + :rtype: ``bool`` + """ + + if not isinstance(node_list, (list, tuple)): + raise TypeError("Node list must be a list or a tuple.") + anti_affinity_xml_request = ET.Element("createAntiAffinityRule", {"xmlns": TYPES_URN}) + + for node in node_list: + ET.SubElement(anti_affinity_xml_request, "serverId").text = self._node_to_node_id(node) + result = self.connection.request_with_orgId_api_2( + "server/createAntiAffinityRule", + method="POST", + data=ET.tostring(anti_affinity_xml_request), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_delete_anti_affinity_rule(self, anti_affinity_rule): + """ + Remove anti affinity rule + + :param anti_affinity_rule: The anti affinity rule to delete + :type anti_affinity_rule: :class:`NttCisAntiAffinityRule` or + ``str`` + + :rtype: ``bool`` + """ + + rule_id = anti_affinity_rule + + update_node = ET.Element("deleteAntiAffinityRule", {"xmlns": TYPES_URN}) + update_node.set("id", rule_id) + result = self.connection.request_with_orgId_api_2( + "server/deleteAntiAffinityRule", + method="POST", + data=ET.tostring(update_node), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_list_anti_affinity_rules( + self, + network=None, + network_domain=None, + node=None, + filter_id=None, + filter_state=None, + ): + """ + List anti affinity rules for a network, network domain, or node + + :param network: The network to list anti affinity rules for + One of network, network_domain, or node is required + :type network: :class:`NttCisNetwork` or ``str`` + + :param network_domain: The network domain to list anti affinity rules + One of network, network_domain, + or node is required + :type network_domain: :class:`NttCisNetworkDomain` or ``str`` + + :param node: The node to list anti affinity rules for + One of network, netwok_domain, or node is required + :type node: :class:`Node` or ``str`` + + :param filter_id: This will allow you to filter the rules + by this node id + :type filter_id: ``str`` + + :type filter_state: This will allow you to filter rules by + node state (i.e. NORMAL) + :type filter_state: ``str`` + + :rtype: ``list`` of :class:NttCisAntiAffinityRule` + """ + + not_none_arguments = [key for key in (network, network_domain, node) if key is not None] + + if len(not_none_arguments) != 1: + raise ValueError("One and ONLY one of network, " "network_domain, or node must be set") + + params = {} + + if network_domain is not None: + params["networkDomainId"] = self._network_domain_to_network_domain_id(network_domain) + + if network is not None: + params["networkId"] = self._network_to_network_id(network) + + if node is not None: + params["serverId"] = self._node_to_node_id(node) + + if filter_id is not None: + params["id"] = filter_id + + if filter_state is not None: + params["state"] = filter_state + + paged_result = self.connection.paginated_request_with_orgId_api_2( + "server/antiAffinityRule", method="GET", params=params + ) + + rules = [] + + for result in paged_result: + rules.extend(self._to_anti_affinity_rules(result)) + + return rules + + def ex_attach_node_to_vlan(self, node, vlan=None, private_ipv4=None): + """ + Attach a node to a VLAN by adding an additional NIC to + the node on the target VLAN. The IP will be automatically + assigned based on the VLAN IP network space. Alternatively, provide + a private IPv4 address instead of VLAN information, and this will + be assigned to the node on corresponding NIC. + + :param node: Node which should be used + :type node: :class:`Node` + + :param vlan: VLAN to attach the node to + (required unless private_ipv4) + :type vlan: :class:`NttCisVlan` + + :keyword private_ipv4: Private nic IPv4 Address + (required unless vlan) + :type private_ipv4: ``str`` + + :rtype: ``bool`` + """ + + request = ET.Element("addNic", {"xmlns": TYPES_URN}) + ET.SubElement(request, "serverId").text = node.id + nic = ET.SubElement(request, "nic") + + if vlan is not None: + ET.SubElement(nic, "vlanId").text = vlan.id + elif private_ipv4 is not None: + ET.SubElement(nic, "privateIpv4").text = private_ipv4 + else: + raise ValueError("One of vlan or primary_ipv4 " "must be specified") + + response = self.connection.request_with_orgId_api_2( + "server/addNic", method="POST", data=ET.tostring(request) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_destroy_nic(self, nic_id): + """ + Remove a NIC on a node, removing the node from a VLAN + + :param nic_id: The identifier of the NIC to remove + :type nic_id: ``str`` + + :rtype: ``bool`` + """ + + request = ET.Element("removeNic", {"xmlns": TYPES_URN, "id": nic_id}) + + response = self.connection.request_with_orgId_api_2( + "server/removeNic", method="POST", data=ET.tostring(request) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_networks(self, location=None): + """ + List networks deployed across all data center locations for your + organization. The response includes the location of each network. + + :param location: The target location + :type location: :class:`NodeLocation` or ``str`` + + :return: a list of NttCisNetwork objects + :rtype: ``list`` of :class:`NttCisNetwork` + """ + + return self.list_networks(location=location) + + def ex_create_network(self, location, name, description=None): + """ + Create a new network in an MCP 1.0 location + + :param location: The target location (MCP1) + :type location: :class:`NodeLocation` or ``str`` + + :param name: The name of the network + :type name: ``str`` + + :param description: Additional description of the network + :type description: ``str`` + + :return: A new instance of `NttCisNetwork` + :rtype: Instance of :class:`NttCisNetwork` + """ + + network_location = self._location_to_location_id(location) + + create_node = ET.Element("NewNetworkWithLocation", {"xmlns": NETWORK_NS}) + ET.SubElement(create_node, "name").text = name + + if description is not None: + ET.SubElement(create_node, "description").text = description + ET.SubElement(create_node, "location").text = network_location + + self.connection.request_with_orgId_api_1( + "networkWithLocation", method="POST", data=ET.tostring(create_node) + ) + + # MCP1 API does not return the ID, but name is unique for location + network = list(filter(lambda x: x.name == name, self.ex_list_networks(location)))[0] + + return network + + def ex_delete_network(self, network): + """ + Delete a network from an MCP 1 data center + + :param network: The network to delete + :type network: :class:`NttCisNetwork` + + :rtype: ``bool`` + """ + + response = self.connection.request_with_orgId_api_1( + "network/%s?delete" % network.id, method="GET" + ).object + response_code = findtext(response, "result", GENERAL_NS) + + return response_code == "SUCCESS" + + def ex_rename_network(self, network, new_name): + """ + Rename a network in MCP 1 data center + + :param network: The network to rename + :type network: :class:`NttCisNetwork` + + :param new_name: The new name of the network + :type new_name: ``str`` + + :rtype: ``bool`` + """ + + response = self.connection.request_with_orgId_api_1( + "network/%s" % network.id, method="POST", data="name=%s" % new_name + ).object + response_code = findtext(response, "result", GENERAL_NS) + + return response_code == "SUCCESS" + + def ex_get_network_domain(self, network_domain_id): + """ + Get an individual Network Domain, by identifier + + :param network_domain_id: The identifier of the network domain + :type network_domain_id: ``str`` + + :rtype: :class:`NttCisNetworkDomain` + """ + + locations = self.list_locations() + net = self.connection.request_with_orgId_api_2( + "network/networkDomain/%s" % network_domain_id + ).object + + return self._to_network_domain(net, locations) + + def ex_list_network_domains(self, location=None, name=None, service_plan=None, state=None): + """ + List networks domains deployed across all data center locations domain. + + for your organization. + The response includes the location of each network + :param location: Only network domains in the location (optional) + :type location: :class:`NodeLocation` or ``str`` + + :param name: Only network domains of this name (optional) + :type name: ``str`` + + :param service_plan: Only network domains of this type (optional) + :type service_plan: ``str`` + + :param state: Only network domains in this state (optional) + :type state: ``str`` + + :return: a list of `NttCisNetwork` objects + :rtype: ``list`` of :class:`NttCisNetwork` + """ + + params = {} + + if location is not None: + params["datacenterId"] = self._location_to_location_id(location) + + if name is not None: + params["name"] = name + + if service_plan is not None: + params["type"] = service_plan + + if state is not None: + params["state"] = state + + response = self.connection.request_with_orgId_api_2( + "network/networkDomain", params=params + ).object + + return self._to_network_domains(response) + + def ex_create_network_domain(self, location, name, service_plan, description=None): + """ + Deploy a new network domain to a data center + + :param location: The data center to list + :type location: :class:`NodeLocation` or ``str`` + + :param name: The name of the network domain to create + :type name: ``str`` + + :param service_plan: The service plan, either "ESSENTIALS" + or "ADVANCED" + :type service_plan: ``str`` + + :param description: An additional description of + the network domain + :type description: ``str`` + + :return: an instance of `NttCisNetworkDomain` + :rtype: :class:`NttCisNetworkDomain` + """ + + create_node = ET.Element("deployNetworkDomain", {"xmlns": TYPES_URN}) + ET.SubElement(create_node, "datacenterId").text = self._location_to_location_id(location) + + ET.SubElement(create_node, "name").text = name + + if description is not None: + ET.SubElement(create_node, "description").text = description + ET.SubElement(create_node, "type").text = service_plan + + response = self.connection.request_with_orgId_api_2( + "network/deployNetworkDomain", method="POST", data=ET.tostring(create_node) + ).object + + network_domain_id = None + + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "networkDomainId": + network_domain_id = info.get("value") + + return NttCisNetworkDomain( + id=network_domain_id, + name=name, + description=description, + location=location, + status=NodeState.RUNNING, + plan=service_plan, + ) + + def ex_update_network_domain(self, network_domain): + """ + Update the properties of a network domain + + :param network_domain: The network domain with updated properties + :type network_domain: :class:`NttCisNetworkDomain` + + :return: an instance of `NttCisNetworkDomain` + :rtype: :class:`NttCisNetworkDomain` + """ + + edit_node = ET.Element("editNetworkDomain", {"xmlns": TYPES_URN}) + edit_node.set("id", network_domain.id) + ET.SubElement(edit_node, "name").text = network_domain.name + + if network_domain.description is not None: + ET.SubElement(edit_node, "description").text = network_domain.description + ET.SubElement(edit_node, "type").text = network_domain.plan + + self.connection.request_with_orgId_api_2( + "network/editNetworkDomain", method="POST", data=ET.tostring(edit_node) + ).object + + return network_domain + + def ex_delete_network_domain(self, network_domain): + """ + Delete a network domain + + :param network_domain: The network domain to delete + :type network_domain: :class:`NttCisNetworkDomain` + + :rtype: ``bool`` + """ + + delete_node = ET.Element("deleteNetworkDomain", {"xmlns": TYPES_URN}) + delete_node.set("id", network_domain.id) + result = self.connection.request_with_orgId_api_2( + "network/deleteNetworkDomain", method="POST", data=ET.tostring(delete_node) + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_create_vlan( + self, + network_domain, + name, + private_ipv4_base_address, + description=None, + private_ipv4_prefix_size=24, + ): + """ + Deploy a new VLAN to a network domain + + :param network_domain: The network domain to add the VLAN to + :type network_domain: :class:`NttCisNetworkDomain` + + :param name: The name of the VLAN to create + :type name: ``str`` + + :param private_ipv4_base_address: The base IPv4 address + e.g. 192.168.1.0 + :type private_ipv4_base_address: ``str`` + + :param description: An additional description of the VLAN + :type description: ``str`` + + :param private_ipv4_prefix_size: The size of the IPv4 + address space, e.g 24 + :type private_ipv4_prefix_size: ``int`` + + :return: an instance of `NttCisVlan` + :rtype: :class:`NttCisVlan` + """ + + create_node = ET.Element("deployVlan", {"xmlns": TYPES_URN}) + ET.SubElement(create_node, "networkDomainId").text = network_domain.id + ET.SubElement(create_node, "name").text = name + + if description is not None: + ET.SubElement(create_node, "description").text = description + ET.SubElement(create_node, "privateIpv4BaseAddress").text = private_ipv4_base_address + ET.SubElement(create_node, "privateIpv4PrefixSize").text = str(private_ipv4_prefix_size) + + response = self.connection.request_with_orgId_api_2( + "network/deployVlan", method="POST", data=ET.tostring(create_node) + ).object + + vlan_id = None + + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "vlanId": + vlan_id = info.get("value") + + return self.ex_get_vlan(vlan_id) + + def ex_get_vlan(self, vlan_id): + """ + Get a single VLAN, by it's identifier + + :param vlan_id: The identifier of the VLAN + :type vlan_id: ``str`` + + :return: an instance of `NttCisVlan` + :rtype: :class:`NttCisVlan` + """ + + locations = self.list_locations() + vlan = self.connection.request_with_orgId_api_2("network/vlan/%s" % vlan_id).object + + return self._to_vlan(vlan, locations) + + def ex_update_vlan(self, vlan): + """ + Updates the properties of the given VLAN + Only name and description are updated + + :param vlan: The VLAN to update + :type vlan: :class:`NttCisetworkDomain` + + :return: an instance of `NttCisVlan` + :rtype: :class:`NttCisVlan` + """ + + edit_node = ET.Element("editVlan", {"xmlns": TYPES_URN}) + edit_node.set("id", vlan.id) + ET.SubElement(edit_node, "name").text = vlan.name + + if vlan.description is not None: + ET.SubElement(edit_node, "description").text = vlan.description + + self.connection.request_with_orgId_api_2( + "network/editVlan", method="POST", data=ET.tostring(edit_node) + ).object + + return vlan + + def ex_expand_vlan(self, vlan): + """ + Expands the VLAN to the prefix size in private_ipv4_range_size + The expansion will + not be permitted if the proposed IP space overlaps with an + already deployed VLANs IP space. + + :param vlan: The VLAN to update + :type vlan: :class:`NttCisNetworkDomain` + + :return: an instance of `NttCisVlan` + :rtype: :class:`NttCisVlan` + """ + + edit_node = ET.Element("expandVlan", {"xmlns": TYPES_URN}) + edit_node.set("id", vlan.id) + ET.SubElement(edit_node, "privateIpv4PrefixSize").text = vlan.private_ipv4_range_size + + self.connection.request_with_orgId_api_2( + "network/expandVlan", method="POST", data=ET.tostring(edit_node) + ).object + + return vlan + + def ex_delete_vlan(self, vlan): + """ + Deletes an existing VLAN + + :param vlan: The VLAN to delete + :type vlan: :class:`DNttCisNetworkDomain` + + :rtype: ``bool`` + """ + + delete_node = ET.Element("deleteVlan", {"xmlns": TYPES_URN}) + delete_node.set("id", vlan.id) + result = self.connection.request_with_orgId_api_2( + "network/deleteVlan", method="POST", data=ET.tostring(delete_node) + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_vlans( + self, + location=None, + network_domain=None, + name=None, + ipv4_address=None, + ipv6_address=None, + state=None, + ): + """ + List VLANs available, can filter by location and/or network domain + + :param location: Only VLANs in this location (optional) + :type location: :class:`NodeLocation` or ``str`` + + :param network_domain: Only VLANs in this domain (optional) + :type network_domain: :class:`NttCisNetworkDomain` + + :param name: Only VLANs with this name (optional) + :type name: ``str`` + + :param ipv4_address: Only VLANs with this ipv4 address (optional) + :type ipv4_address: ``str`` + + :param ipv6_address: Only VLANs with this ipv6 address (optional) + :type ipv6_address: ``str`` + + :param state: Only VLANs with this state (optional) + :type state: ``str`` + + :return: a list of NttCisVlan objects + :rtype: ``list`` of :class:`NttCisVlan` + """ + + params = {} + + if location is not None: + params["datacenterId"] = self._location_to_location_id(location) + + if network_domain is not None: + params["networkDomainId"] = self._network_domain_to_network_domain_id(network_domain) + + if name is not None: + params["name"] = name + + if ipv4_address is not None: + params["privateIpv4Address"] = ipv4_address + + if ipv6_address is not None: + params["ipv6Address"] = ipv6_address + + if state is not None: + params["state"] = state + response = self.connection.request_with_orgId_api_2("network/vlan", params=params).object + + return self._to_vlans(response) + + def ex_add_public_ip_block_to_network_domain(self, network_domain): + add_node = ET.Element("addPublicIpBlock", {"xmlns": TYPES_URN}) + ET.SubElement(add_node, "networkDomainId").text = network_domain.id + + response = self.connection.request_with_orgId_api_2( + "network/addPublicIpBlock", method="POST", data=ET.tostring(add_node) + ).object + + block_id = None + + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "ipBlockId": + block_id = info.get("value") + + return self.ex_get_public_ip_block(block_id) + + def ex_list_public_ip_blocks(self, network_domain): + params = {} + params["networkDomainId"] = network_domain.id + + response = self.connection.request_with_orgId_api_2( + "network/publicIpBlock", params=params + ).object + + return self._to_ip_blocks(response) + + def ex_get_public_ip_block(self, block_id): + locations = self.list_locations() + block = self.connection.request_with_orgId_api_2( + "network/publicIpBlock/%s" % block_id + ).object + + return self._to_ip_block(block, locations) + + def ex_delete_public_ip_block(self, block): + delete_node = ET.Element("removePublicIpBlock", {"xmlns": TYPES_URN}) + delete_node.set("id", block.id) + result = self.connection.request_with_orgId_api_2( + "network/removePublicIpBlock", method="POST", data=ET.tostring(delete_node) + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + # 09/10/18 Adding private IPv4 and IPv6 addressing capability + def ex_reserve_ip(self, vlan, ip, description): + vlan_id = self._vlan_to_vlan_id(vlan) + + if re.match(r"(\d+\.){3}", ip): + private_ip = ET.Element("reservePrivateIpv4Address", {"xmlns": TYPES_URN}) + resource = "network/reservePrivateIpv4Address" + elif re.search(r":", ip): + private_ip = ET.Element("reserveIpv6Address", {"xmlns": TYPES_URN}) + resource = "network/reserveIpv6Address" + else: + raise ValueError("Unable to retrieve private ip in the provided ip argument") + ET.SubElement(private_ip, "vlanId").text = vlan_id + ET.SubElement(private_ip, "ipAddress").text = ip + + if description is not None: + ET.SubElement(private_ip, "description").text = description + + result = self.connection.request_with_orgId_api_2( + resource, method="POST", data=ET.tostring(private_ip) + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_unreserve_ip_addresses(self, vlan, ip): + vlan_id = self._vlan_to_vlan_id(vlan) + + if re.match(r"(\d+\.){3}", ip): + private_ip = ET.Element("unreservePrivateIpv4Address", {"xmlns": TYPES_URN}) + resource = "network/reservePrivateIpv4Address" + elif re.search(r":", ip): + private_ip = ET.Element("unreserveIpv6Address", {"xmlns": TYPES_URN}) + resource = "network/unreserveIpv6Address" + else: + raise ValueError("Unable to parse private ip from ip argument") + ET.SubElement(private_ip, "vlanId").text = vlan_id + ET.SubElement(private_ip, "ipAddress").text = ip + result = self.connection.request_with_orgId_api_2( + resource, method="POST", data=ET.tostring(private_ip) + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_reserved_ipv4(self, vlan=None, datacenter_id=None): + if vlan is not None: + vlan_id = self._vlan_to_vlan_id(vlan) + params = {"vlanId": vlan_id} + response = self.connection.request_with_orgId_api_2( + "network/reservedPrivateIpv4Address", params=params + ).object + + elif datacenter_id is not None: + params = {"datacenterId": datacenter_id} + response = self.connection.request_with_orgId_api_2( + "network/reservedPrivateIpv4Address", params=params + ).object + else: + response = self.connection.request_with_orgId_api_2( + "network/reservedPrivateIpv4Address" + ).object + addresses = self._to_ipv4_addresses(response) + + return addresses + + def ex_list_reserved_ipv6(self, vlan=None, datacenter_id=None): + if vlan is not None: + vlan_id = self._vlan_to_vlan_id(vlan) + params = {"vlanId": vlan_id} + response = self.connection.request_with_orgId_api_2( + "network/reservedIpv6Address", params=params + ).object + + elif datacenter_id is not None: + params = {"datacenterId": datacenter_id} + response = self.connection.request_with_orgId_api_2( + "network/reservedIpv6Address", params=params + ).object + else: + response = self.connection.request_with_orgId_api_2( + "network/reservedIpv6Address" + ).object + addresses = self._to_ipv6_addresses(response) + + return addresses + + def ex_get_node_by_id(self, id): + node = self.connection.request_with_orgId_api_2("server/server/%s" % id).object + + return self._to_node(node) + + def ex_list_firewall_rules(self, network_domain, page_size=50, page_number=1): + params = {"pageSize": page_size, "pageNumber": page_number} + params["networkDomainId"] = self._network_domain_to_network_domain_id(network_domain) + + response = self.connection.request_with_orgId_api_2( + "network/firewallRule", params=params + ).object + + return self._to_firewall_rules(response, network_domain) + + def ex_create_firewall_rule( + self, + network_domain, + name, + action, + ip_version, + protocol, + source_addr, + dest_addr, + position, + enabled=1, + position_relative_to_rule=None, + ): + """ + Creates a firewall rule + + :param network_domain: The network domain in which to create + the firewall rule + :type network_domain: :class:`NttCisNetworkDomain` or ``str`` + + :param name: The rule's name + :type name: ``str`` + + :param action: 'ACCEPT_DECISIVELY' or 'DROP' + :type action: ``str`` + + :param ip_version: 'IPV4' or 'IPV6' + :type ip_version: ``str`` + + :param protocol: One of 'IP', 'ICMP', 'TCP', or 'UDP' + :type protocol: ``str`` + + :param source_addr: The source address, which must be an + NttCisFirewallAddress instance + :type source_addr: ``NttCisFirewallAddress`` + + :param dest_addr: The destination address, which must be an + NttCisFirewallAddress instance + :type dest_addr: `NttCisFirewallAddress`` + + :param position: The position in which to create the rule + There are two types of positions + with position_relative_to_rule arg and without it + With: 'BEFORE' or 'AFTER' + Without: 'FIRST' or 'LAST' + :type position: ``str`` + + :param enabled: Firewall rule is enabled upon creation. + Set to 1 for true or 0 for false. + :type enabled: ``int`` + + :param position_relative_to_rule: The rule or rule name in + which to decide positioning by + :type position_relative_to_rule: + ::class:`NttCisFirewallRule` or ``str`` + + :rtype: ``bool`` + """ + + positions_without_rule = ("FIRST", "LAST") + positions_with_rule = ("BEFORE", "AFTER") + + create_node = ET.Element("createFirewallRule", {"xmlns": TYPES_URN}) + ET.SubElement(create_node, "networkDomainId").text = ( + self._network_domain_to_network_domain_id(network_domain) + ) + ET.SubElement(create_node, "name").text = name + ET.SubElement(create_node, "action").text = action + ET.SubElement(create_node, "ipVersion").text = ip_version + ET.SubElement(create_node, "protocol").text = protocol + # Setup source port rule + source = ET.SubElement(create_node, "source") + + if source_addr.address_list_id is not None: + source_ip = ET.SubElement(source, "ipAddressListId") + source_ip.text = source_addr.address_list_id + else: + source_ip = ET.SubElement(source, "ip") + + if source_addr.any_ip: + source_ip.set("address", "ANY") + else: + source_ip.set("address", source_addr.ip_address) + + if source_addr.ip_prefix_size is not None: + source_ip.set("prefixSize", str(source_addr.ip_prefix_size)) + + if source_addr.port_list_id is not None: + source_port = ET.SubElement(source, "portListId") + source_port.text = source_addr.port_list_id + else: + if source_addr.port_begin is not None: + source_port = ET.SubElement(source, "port") + source_port.set("begin", source_addr.port_begin) + + if source_addr.port_end is not None: + source_port.set("end", source_addr.port_end) + # Setup destination port rule + dest = ET.SubElement(create_node, "destination") + + if dest_addr.address_list_id is not None: + dest_ip = ET.SubElement(dest, "ipAddressListId") + dest_ip.text = dest_addr.address_list_id + else: + dest_ip = ET.SubElement(dest, "ip") + + if dest_addr.any_ip: + dest_ip.set("address", "ANY") + else: + dest_ip.set("address", dest_addr.ip_address) + + if dest_addr.ip_prefix_size is not None: + dest_ip.set("prefixSize", dest_addr.ip_prefix_size) + + if dest_addr.port_list_id is not None: + dest_port = ET.SubElement(dest, "portListId") + dest_port.text = dest_addr.port_list_id + else: + if dest_addr.port_begin is not None: + dest_port = ET.SubElement(dest, "port") + dest_port.set("begin", dest_addr.port_begin) + + if dest_addr.port_end is not None: + dest_port.set("end", dest_addr.port_end) + # Set up positioning of rule + ET.SubElement(create_node, "enabled").text = str(enabled) + placement = ET.SubElement(create_node, "placement") + + if position_relative_to_rule is not None: + if position not in positions_with_rule: + raise ValueError( + "When position_relative_to_rule is specified" + " position must be %s" % ", ".join(positions_with_rule) + ) + + if isinstance(position_relative_to_rule, NttCisFirewallRule): + rule_name = position_relative_to_rule.name + else: + rule_name = position_relative_to_rule + placement.set("relativeToRule", rule_name) + else: + if position not in positions_without_rule: + raise ValueError( + "When position_relative_to_rule is not" + " specified position must be %s" % ", ".join(positions_without_rule) + ) + placement.set("position", position) + + response = self.connection.request_with_orgId_api_2( + "network/createFirewallRule", method="POST", data=ET.tostring(create_node) + ).object + + rule_id = None + + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "firewallRuleId": + rule_id = info.get("value") + rule = self.ex_get_firewall_rule(network_domain, rule_id) + + return rule + + def ex_edit_firewall_rule(self, rule, position=None, relative_rule_for_position=None): + """ + Edit a firewall rule + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + networkDomainName][0] + >>> + >>> + >>> # List firewall rules + >>> firewall_rules = driver.ex_list_firewall_rules(my_network_domain) + >>> + >>> # Get Firewall Rule by name + >>> pprint("List specific firewall rule by name") + >>> fire_rule_under_test = (list(filter(lambda x: x.name == + 'My_New_Firewall_Rule', firewall_rules))[0]) + >>> pprint(fire_rule_under_test.source) + >>> pprint(fire_rule_under_test.destination) + >>> + >>> # Edit Firewall + >>> fire_rule_under_test.destination.address_list_id = + '5e7c323f-c885-4e4b-9a27-94c44217dbd3' + >>> fire_rule_under_test.destination.port_list_id = + 'b6557c5a-45fa-4138-89bd-8fe68392691b' + >>> result = driver.ex_edit_firewall_rule(fire_rule_under_test, 'LAST') + >>> pprint(result) + + :param rule: (required) The rule in which to create + :type rule: :class:`DNttCisFirewallRule` + + :param position: (required) There are two types of positions + with position_relative_to_rule arg and without it + With: 'BEFORE' or 'AFTER' + Without: 'FIRST' or 'LAST' + :type position: ``str`` + + :param relative_rule_for_position: (optional) The rule or rule name in + which to decide the relative rule + for positioning. + :type relative_rule_for_position: + :class:`NttCisFirewallRule` or ``str`` + + :rtype: ``bool`` + """ + + positions_without_rule = ("FIRST", "LAST") + positions_with_rule = ("BEFORE", "AFTER") + + edit_node = ET.Element("editFirewallRule", {"xmlns": TYPES_URN, "id": rule.id}) + ET.SubElement(edit_node, "action").text = rule.action + ET.SubElement(edit_node, "protocol").text = rule.protocol + + # Source address + source = ET.SubElement(edit_node, "source") + + if rule.source.address_list_id is not None: + source_ip = ET.SubElement(source, "ipAddressListId") + source_ip.text = rule.source.address_list_id + else: + source_ip = ET.SubElement(source, "ip") + + if rule.source.any_ip: + source_ip.set("address", "ANY") + else: + source_ip.set("address", rule.source.ip_address) + + if rule.source.ip_prefix_size is not None: + source_ip.set("prefixSize", str(rule.source.ip_prefix_size)) + + # Setup source port rule + + if rule.source.port_list_id is not None: + source_port = ET.SubElement(source, "portListId") + source_port.text = rule.source.port_list_id + else: + if rule.source.port_begin is not None: + source_port = ET.SubElement(source, "port") + source_port.set("begin", rule.source.port_begin) + + if rule.source.port_end is not None: + source_port.set("end", rule.source.port_end) + # Setup destination port rule + dest = ET.SubElement(edit_node, "destination") + + if rule.destination.address_list_id is not None: + dest_ip = ET.SubElement(dest, "ipAddressListId") + dest_ip.text = rule.destination.address_list_id + else: + dest_ip = ET.SubElement(dest, "ip") + + if rule.destination.any_ip: + dest_ip.set("address", "ANY") + else: + dest_ip.set("address", rule.destination.ip_address) + + if rule.destination.ip_prefix_size is not None: + dest_ip.set("prefixSize", rule.destination.ip_prefix_size) + + if rule.destination.port_list_id is not None: + dest_port = ET.SubElement(dest, "portListId") + dest_port.text = rule.destination.port_list_id + else: + if rule.destination.port_begin is not None: + dest_port = ET.SubElement(dest, "port") + dest_port.set("begin", rule.destination.port_begin) + + if rule.destination.port_end is not None: + dest_port.set("end", rule.destination.port_end) + # Set up positioning of rule + ET.SubElement(edit_node, "enabled").text = str(rule.enabled).lower() + # changing placement to an option + + if position is not None: + placement = ET.SubElement(edit_node, "placement") + + if relative_rule_for_position is not None: + if position not in positions_with_rule: + raise ValueError( + "When position_relative_to_rule is specified" + " position must be %s" % ", ".join(positions_with_rule) + ) + + if isinstance(relative_rule_for_position, NttCisFirewallRule): + rule_name = relative_rule_for_position.name + else: + rule_name = relative_rule_for_position + placement.set("relativeToRule", rule_name) + else: + if position not in positions_without_rule: + raise ValueError( + "When position_relative_to_rule is not" + " specified position must be %s" % ", ".join(positions_without_rule) + ) + placement.set("position", position) + + response = self.connection.request_with_orgId_api_2( + "network/editFirewallRule", method="POST", data=ET.tostring(edit_node) + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_get_firewall_rule(self, network_domain, rule_id): + locations = self.list_locations() + rule = self.connection.request_with_orgId_api_2("network/firewallRule/%s" % rule_id).object + + return self._to_firewall_rule(rule, locations, network_domain) + + def ex_set_firewall_rule_state(self, rule, state): + """ + Change the state (enabled or disabled) of a rule + + :param rule: The rule to delete + :type rule: :class:`NttCisFirewallRule` + + :param state: The desired state enabled (True) or disabled (False) + :type state: ``bool`` + + :rtype: ``bool`` + """ + + update_node = ET.Element("editFirewallRule", {"xmlns": TYPES_URN}) + update_node.set("id", rule.id) + ET.SubElement(update_node, "enabled").text = str(state).lower() + result = self.connection.request_with_orgId_api_2( + "network/editFirewallRule", method="POST", data=ET.tostring(update_node) + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_delete_firewall_rule(self, rule): + """ + Delete a firewall rule + + :param rule: The rule to delete + :type rule: :class:`NttCisFirewallRule` + + :rtype: ``bool`` + """ + + update_node = ET.Element("deleteFirewallRule", {"xmlns": TYPES_URN}) + update_node.set("id", rule.id) + result = self.connection.request_with_orgId_api_2( + "network/deleteFirewallRule", method="POST", data=ET.tostring(update_node) + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_create_nat_rule(self, network_domain, internal_ip, external_ip): + """ + Create a NAT rule + + :param network_domain: The network domain the rule belongs to + :type network_domain: :class:`NttCisNetworkDomain` + + :param internal_ip: The IPv4 address internally + :type internal_ip: ``str`` + + :param external_ip: The IPv4 address externally + :type external_ip: ``str`` + + :rtype: :class:`NttCisNatRule` + """ + + create_node = ET.Element("createNatRule", {"xmlns": TYPES_URN}) + ET.SubElement(create_node, "networkDomainId").text = network_domain.id + ET.SubElement(create_node, "internalIp").text = internal_ip + ET.SubElement(create_node, "externalIp").text = external_ip + result = self.connection.request_with_orgId_api_2( + "network/createNatRule", method="POST", data=ET.tostring(create_node) + ).object + + rule_id = None + + for info in findall(result, "info", TYPES_URN): + if info.get("name") == "natRuleId": + rule_id = info.get("value") + + return NttCisNatRule( + id=rule_id, + network_domain=network_domain, + internal_ip=internal_ip, + external_ip=external_ip, + status=NodeState.RUNNING, + ) + + def ex_list_nat_rules(self, network_domain): + """ + Get NAT rules for the network domain + + :param network_domain: The network domain the rules belongs to + :type network_domain: :class:`NttCisNetworkDomain` + + :rtype: ``list`` of :class:`NttCisNatRule` + """ + + params = {} + params["networkDomainId"] = network_domain.id + + response = self.connection.request_with_orgId_api_2("network/natRule", params=params).object + + return self._to_nat_rules(response, network_domain) + + def ex_get_nat_rule(self, network_domain, rule_id): + """ + Get a NAT rule by ID + + :param network_domain: The network domain the rule belongs to + :type network_domain: :class:`NttCisNetworkDomain` + + :param rule_id: The ID of the NAT rule to fetch + :type rule_id: ``str`` + + :rtype: :class:`NttCisNatRule` + """ + + rule = self.connection.request_with_orgId_api_2("network/natRule/%s" % rule_id).object + + return self._to_nat_rule(rule, network_domain) + + def ex_delete_nat_rule(self, rule): + """ + Delete an existing NAT rule + + :param rule: The rule to delete + :type rule: :class:`NttCisNatRule` + + :rtype: ``bool`` + """ + + update_node = ET.Element("deleteNatRule", {"xmlns": TYPES_URN}) + update_node.set("id", rule.id) + result = self.connection.request_with_orgId_api_2( + "network/deleteNatRule", method="POST", data=ET.tostring(update_node) + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_get_location_by_id(self, id): + """ + Get location by ID. + + :param id: ID of the node location which should be used + :type id: ``str`` + + :rtype: :class:`NodeLocation` + """ + + location = None + + if id is not None: + location = self.list_locations(ex_id=id)[0] + + return location + + def ex_wait_for_state(self, state, func, poll_interval=2, timeout=60, *args, **kwargs): + """ + Wait for the function which returns a instance + with field status to match + + Keep polling func until one of the desired states is matched + + :param state: Either the desired state (`str`) or a `list` of states + :type state: ``str`` or ``list`` + + :param func: The function to call, e.g. ex_get_vlan + :type func: ``function`` + + :param poll_interval: The number of seconds to wait between checks + :type poll_interval: `int` + + :param timeout: The total number of seconds to wait to reach a state + :type timeout: `int` + + :param args: The arguments for func + :type args: Positional arguments + + :param kwargs: The arguments for func + :type kwargs: Keyword arguments + """ + + return self.connection.wait_for_state(state, func, poll_interval, timeout, *args, **kwargs) + + def ex_enable_monitoring(self, node, service_plan="ESSENTIALS"): + """ + Enables cloud monitoring on a node + + :param node: The node to monitor + :type node: :class:`Node` + + :param service_plan: The service plan, one of ESSENTIALS or + ADVANCED + :type service_plan: ``str`` + + :rtype: ``bool`` + """ + + update_node = ET.Element("enableServerMonitoring", {"xmlns": TYPES_URN}) + update_node.set("id", node.id) + ET.SubElement(update_node, "servicePlan").text = service_plan + result = self.connection.request_with_orgId_api_2( + "server/enableServerMonitoring", + method="POST", + data=ET.tostring(update_node), + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_update_monitoring_plan(self, node, service_plan="ESSENTIALS"): + """ + Updates the service plan on a node with monitoring + + :param node: The node to monitor + :type node: :class:`Node` + + :param service_plan: The service plan, one of ESSENTIALS or + ADVANCED + :type service_plan: ``str`` + + :rtype: ``bool`` + """ + + update_node = ET.Element("changeServerMonitoringPlan", {"xmlns": TYPES_URN}) + update_node.set("id", node.id) + ET.SubElement(update_node, "servicePlan").text = service_plan + result = self.connection.request_with_orgId_api_2( + "server/changeServerMonitoringPlan", + method="POST", + data=ET.tostring(update_node), + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_disable_monitoring(self, node): + """ + Disables cloud monitoring for a node + + :param node: The node to stop monitoring + :type node: :class:`Node` + + :rtype: ``bool`` + """ + + update_node = ET.Element("disableServerMonitoring", {"xmlns": TYPES_URN}) + update_node.set("id", node.id) + result = self.connection.request_with_orgId_api_2( + "server/disableServerMonitoring", + method="POST", + data=ET.tostring(update_node), + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_add_scsi_controller_to_node(self, server_id, adapter_type, bus_number=None): + """ + Added 8/27/18: Adds a SCSI Controller by node id + :param server_id: server id + :param adapter_type: the type of SCSI Adapter, i.e., LSI_LOGIC_PARALLEL + :param bus_number: optional number of server's bus + :return: whether addition is in progress or 'OK' otherwise false + """ + + update_node = ET.Element("addScsiController", {"xmlns": TYPES_URN}) + ET.SubElement(update_node, "serverId").text = server_id + ET.SubElement(update_node, "adapterType").text = adapter_type + + if bus_number is not None: + ET.SubElement(update_node, "busNumber").text = bus_number + + result = self.connection.request_with_orgId_api_2( + "server/addScsiController", method="POST", data=ET.tostring(update_node) + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_remove_scsi_controller(self, controller_id): + """ + Added 8/27/18: Adds a SCSI Controller by node id + :param controller_id: Scsi controller's id + :return: whether addition is in progress or 'OK' otherwise false + """ + + update_node = ET.Element("removeScsiController", {"xmlns": TYPES_URN}) + update_node.set("id", controller_id) + result = self.connection.request_with_orgId_api_2( + "server/removeScsiController", method="POST", data=ET.tostring(update_node) + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_add_storage_to_node( + self, amount, node=None, speed="STANDARD", controller_id=None, scsi_id=None + ): + """ + Updated 8/23/18 + Add storage to the node + One of node or controller_id must be selected + + :param node: The server to add storage to (required if + controller_id is not used + :type node: :class:`Node` + + :param amount: The amount of storage to add, in GB + :type amount: ``int`` + + :param speed: The disk speed type + :type speed: ``str`` + + :param conrollter_id: The disk may be added using the + cotnroller id (required if node + object is not used) + :type controller_id: ``str`` + + :param scsi_id: The target SCSI ID (optional) + :type scsi_id: ``int`` + + :rtype: ``bool`` + """ + + if (node is None and controller_id is None) or ( + node is not None and controller_id is not None + ): + raise RuntimeError("Either a node or a controller " "id must be specified") + + update_node = ET.Element("addDisk", {"xmlns": TYPES_URN}) + + if node is not None: + ET.SubElement(update_node, "serverId").text = node.id + elif controller_id is not None: + scsi_node = ET.Element("scsiController") + ET.SubElement(scsi_node, "controllerId").text = controller_id + update_node.insert(1, scsi_node) + ET.SubElement(update_node, "sizeGb").text = str(amount) + ET.SubElement(update_node, "speed").text = speed.upper() + + if scsi_id is not None: + ET.SubElement(update_node, "scsiId").text = str(scsi_id) + + result = self.connection.request_with_orgId_api_2( + "server/addDisk", method="POST", data=ET.tostring(update_node) + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_remove_storage_from_node(self, node, scsi_id): + """ + Remove storage from a node + + :param node: The server to add storage to + :type node: :class:`Node` + + :param scsi_id: The ID of the disk to remove + :type scsi_id: ``str`` + + :rtype: ``bool`` + """ + + disk = [disk for disk in node.extra["disks"] if disk.scsi_id == scsi_id][0] + + return self.ex_remove_storage(disk.id) + + def ex_remove_storage(self, disk_id): + """ + Remove storage from a node + + :param node: The server to add storage to + :type node: :class:`Node` + + :param disk_id: The ID of the disk to remove + :type disk_id: ``str`` + + :rtype: ``bool`` + """ + + remove_disk = ET.Element("removeDisk", {"xmlns": TYPES_URN}) + remove_disk.set("id", disk_id) + result = self.connection.request_with_orgId_api_2( + "server/removeDisk", method="POST", data=ET.tostring(remove_disk) + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_change_storage_speed(self, disk_id, speed, iops=None): + """ + Change the speed (disk tier) of a disk + + :param node: The server to change the disk speed of + :type node: :class:`Node` + + :param disk_id: The ID of the disk to change + :type disk_id: ``str`` + + :param speed: The disk speed type e.g. STANDARD + :type speed: ``str`` + + :rtype: ``bool`` + """ + + create_node = ET.Element("changeDiskSpeed", {"xmlns": TYPES_URN}) + create_node.set("id", disk_id) + ET.SubElement(create_node, "speed").text = speed + + if iops is not None: + ET.SubElement(create_node, "iops").text = str(iops) + result = self.connection.request_with_orgId_api_2( + "server/changeDiskSpeed", method="POST", data=ET.tostring(create_node) + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_change_storage_size(self, disk_id, size): + """ + Change the size of a disk + + :param node: The server to change the disk of + :type node: :class:`Node` + + :param disk_id: The ID of the disk to resize + :type disk_id: ``str`` + + :param size: The disk size in GB + :type size: ``int`` + + :rtype: ``bool`` + """ + + create_node = ET.Element("expandDisk", {"xmlns": TYPES_URN, "id": disk_id}) + ET.SubElement(create_node, "newSizeGb").text = str(size) + """ + This code is for version 1 of MCP, need version 2 + result = self.connection.request_with_orgId_api_1( + 'server/%s/disk/%s/changeSize' % + (node.id, disk_id), + method='POST', + data=ET.tostring(create_node)).object + """ + result = self.connection.request_with_orgId_api_2( + "server/expandDisk", method="POST", data=ET.tostring(create_node) + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_reconfigure_node( + self, + node, + memory_gb=None, + cpu_count=None, + cores_per_socket=None, + cpu_performance=None, + ): + """ + Reconfigure the virtual hardware specification of a node + + :param node: The server to change + :type node: :class:`Node` + + :param memory_gb: The amount of memory in GB (optional) + :type memory_gb: ``int`` + + :param cpu_count: The number of CPU (optional) + :type cpu_count: ``int`` + + :param cores_per_socket: Number of CPU cores per socket (optional) + :type cores_per_socket: ``int`` + + :param cpu_performance: CPU Performance type (optional) + :type cpu_performance: ``str`` + + :rtype: ``bool`` + """ + + update = ET.Element("reconfigureServer", {"xmlns": TYPES_URN}) + update.set("id", node.id) + + if memory_gb is not None: + ET.SubElement(update, "memoryGb").text = str(memory_gb) + + if cpu_count is not None: + ET.SubElement(update, "cpuCount").text = str(cpu_count) + + if cpu_performance is not None: + ET.SubElement(update, "cpuSpeed").text = cpu_performance + + if cores_per_socket is not None: + ET.SubElement(update, "coresPerSocket").text = str(cores_per_socket) + result = self.connection.request_with_orgId_api_2( + "server/reconfigureServer", method="POST", data=ET.tostring(update) + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_clone_node_to_image( + self, + node, + image_name, + image_description=None, + cluster_id=None, + is_guest_Os_Customization=None, + tag_key_id=None, + tag_value=None, + ): + """ + Clone a server into a customer image. + + :param node: The server to clone + :type node: :class:`Node` + + :param image_name: The name of the clone image + :type image_name: ``str`` + + :param description: The description of the image + :type description: ``str`` + + :rtype: ``bool`` + """ + + if image_description is None: + image_description = "" + + node_id = self._node_to_node_id(node) + """ + Removing anything below 2.4 + # Version 2.3 and lower + if LooseVersion(self.connection.active_api_version) < LooseVersion( + '2.4'): + response = self.connection.request_with_orgId_api_1( + 'server/%s?clone=%s&desc=%s' % + (node_id, image_name, image_description)).object + # Version 2.4 and higher + else: + """ + clone_server_elem = ET.Element("cloneServer", {"id": node_id, "xmlns": TYPES_URN}) + + ET.SubElement(clone_server_elem, "imageName").text = image_name + + if image_description is not None: + ET.SubElement(clone_server_elem, "description").text = image_description + + if cluster_id is not None: + ET.SubElement(clone_server_elem, "clusterId").text = cluster_id + + if is_guest_Os_Customization is not None: + ET.SubElement(clone_server_elem, "guestOsCustomization").text = ( + is_guest_Os_Customization + ) + + if tag_key_id is not None: + tag_elem = ET.SubElement(clone_server_elem, "tagById") + ET.SubElement(tag_elem, "tagKeyId").text = tag_key_id + + if tag_value is not None: + ET.SubElement(tag_elem, "value").text = tag_value + + response = self.connection.request_with_orgId_api_2( + "server/cloneServer", method="POST", data=ET.tostring(clone_server_elem) + ).object + """ + removing references to anything lower than 2.4 + # Version 2.3 and lower + if LooseVersion(self.connection.active_api_version) < LooseVersion( + '2.4'): + response_code = findtext(response, 'result', GENERAL_NS) + else: + """ + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "SUCCESS"] + + def ex_clean_failed_deployment(self, node): + """ + Removes a node that has failed to deploy + + :param node: The failed node to clean + :type node: :class:`Node` or ``str`` + """ + + node_id = self._node_to_node_id(node) + request_elm = ET.Element("cleanServer", {"xmlns": TYPES_URN, "id": node_id}) + body = self.connection.request_with_orgId_api_2( + "server/cleanServer", method="POST", data=ET.tostring(request_elm) + ).object + response_code = findtext(body, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_customer_images(self, location=None): + """ + Return a list of customer imported images + + :param location: The target location + :type location: :class:`NodeLocation` or ``str`` + + :rtype: ``list`` of :class:`NodeImage` + """ + + params = {} + + if location is not None: + params["datacenterId"] = self._location_to_location_id(location) + + return self._to_images( + self.connection.request_with_orgId_api_2("image/customerImage", params=params).object, + "customerImage", + ) + + def ex_get_base_image_by_id(self, id): + """ + Gets a Base image in the NTTC-CIS Cloud given the id + + :param id: The id of the image + :type id: ``str`` + + :rtype: :class:`NodeImage` + """ + + image = self.connection.request_with_orgId_api_2("image/osImage/%s" % id).object + + return self._to_image(image) + + def ex_get_customer_image_by_id(self, id): + """ + Gets a Customer image in the NTTC-CIS Cloud given the id + + :param id: The id of the image + :type id: ``str`` + + :rtype: :class:`NodeImage` + """ + + image = self.connection.request_with_orgId_api_2("image/customerImage/%s" % id).object + + return self._to_image(image) + + def ex_get_image_by_id(self, id): + """ + Gets a Base/Customer image in the NTTC-CIS Cloud given the id + + Note: This first checks the base image + If it is not a base image we check if it is a customer image + If it is not in either of these a NttCisAPIException + is thrown + + :param id: The id of the image + :type id: ``str`` + + :rtype: :class:`NodeImage` + """ + + try: + return self.ex_get_base_image_by_id(id) + except NttCisAPIException as e: + if e.code != "RESOURCE_NOT_FOUND": + raise e + + return self.ex_get_customer_image_by_id(id) + + def ex_create_tag_key( + self, name, description=None, value_required=True, display_on_report=True + ): + """ + Creates a tag key in the NTTC-CIS Cloud + + :param name: The name of the tag key (required) + :type name: ``str`` + + :param description: The description of the tag key + :type description: ``str`` + + :param value_required: If a value is required for the tag + Tags themselves can be just a tag, + or be a key/value pair + :type value_required: ``bool`` + + :param display_on_report: Should this key show up on the usage reports + :type display_on_report: ``bool`` + + :rtype: ``bool`` + """ + + create_tag_key = ET.Element("createTagKey", {"xmlns": TYPES_URN}) + ET.SubElement(create_tag_key, "name").text = name + + if description is not None: + ET.SubElement(create_tag_key, "description").text = description + ET.SubElement(create_tag_key, "valueRequired").text = str(value_required).lower() + ET.SubElement(create_tag_key, "displayOnReport").text = str(display_on_report).lower() + response = self.connection.request_with_orgId_api_2( + "tag/createTagKey", method="POST", data=ET.tostring(create_tag_key) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_tag_keys(self, id=None, name=None, value_required=None, display_on_report=None): + """ + List tag keys in the NTTC-CIS Cloud + + :param id: Filter the list to the id of the tag key + :type id: ``str`` + + :param name: Filter the list to the name of the tag key + :type name: ``str`` + + :param value_required: Filter the list to if a value is required + for a tag key + :type value_required: ``bool`` + + :param display_on_report: Filter the list to if the tag key should + show up on usage reports + :type display_on_report: ``bool`` + + :rtype: ``list`` of :class:`NttCisTagKey` + """ + + params = {} + + if id is not None: + params["id"] = id + + if name is not None: + params["name"] = name + + if value_required is not None: + params["valueRequired"] = str(value_required).lower() + + if display_on_report is not None: + params["displayOnReport"] = str(display_on_report).lower() + + paged_result = self.connection.paginated_request_with_orgId_api_2( + "tag/tagKey", method="GET", params=params + ) + + tag_keys = [] + + for result in paged_result: + tag_keys.extend(self._to_tag_keys(result)) + + return tag_keys + + def ex_get_tag_key_by_id(self, id): + """ + Get a specific tag key by ID + + :param id: ID of the tag key you want (required) + :type id: ``str`` + + :rtype: :class:`NttCisTagKey` + """ + + tag_key = self.connection.request_with_orgId_api_2("tag/tagKey/%s" % id).object + + return self._to_tag_key(tag_key) + + def ex_get_tag_key_by_name(self, name): + """ + NOTICE: Tag key is one of those instances where Libloud + handles the search of a list for the client code. + This behavior exists inconsistently across libcloud. + Get a specific tag key by Name + + :param name: Name of the tag key you want (required) + :type name: ``str`` + + :rtype: :class:`NttCisTagKey` + """ + + tag_keys = self.ex_list_tag_keys(name=name) + + if len(tag_keys) != 1: + raise ValueError("No tags found with name %s" % name) + + return tag_keys[0] + + def ex_modify_tag_key( + self, + tag_key, + name=None, + description=None, + value_required=None, + display_on_report=None, + ): + """ + Modify a specific tag key + + :param tag_key: The tag key you want to modify (required) + :type tag_key: :class:`NttCisTagKey` or ``str`` + + :param name: Set to modify the name of the tag key + :type name: ``str`` + + :param description: Set to modify the description of the tag key + :type description: ``str`` + + :param value_required: Set to modify if a value is required for + the tag key + :type value_required: ``bool`` + + :param display_on_report: Set to modify if this tag key should display + on the usage reports + :type display_on_report: ``bool`` + + :rtype: ``bool`` + """ + + tag_key_id = self._tag_key_to_tag_key_id(tag_key) + modify_tag_key = ET.Element("editTagKey", {"xmlns": TYPES_URN, "id": tag_key_id}) + + if name is not None: + ET.SubElement(modify_tag_key, "name").text = name + + if description is not None: + ET.SubElement(modify_tag_key, "description").text = description + + if value_required is not None: + ET.SubElement(modify_tag_key, "valueRequired").text = str(value_required).lower() + + if display_on_report is not None: + ET.SubElement(modify_tag_key, "displayOnReport").text = str(display_on_report).lower() + + response = self.connection.request_with_orgId_api_2( + "tag/editTagKey", method="POST", data=ET.tostring(modify_tag_key) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_remove_tag_key(self, tag_key): + """ + Modify a specific tag key + + :param tag_key: The tag key you want to remove (required) + :type tag_key: :class:`NttCisTagKey` or ``str`` + + :rtype: ``bool`` + """ + + tag_key_id = self._tag_key_to_tag_key_id(tag_key) + remove_tag_key = ET.Element("deleteTagKey", {"xmlns": TYPES_URN, "id": tag_key_id}) + response = self.connection.request_with_orgId_api_2( + "tag/deleteTagKey", method="POST", data=ET.tostring(remove_tag_key) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_apply_tag_to_asset(self, asset, tag_key, value=None): + """ + Apply a tag to a NTTC-CIS Asset + + :param asset: The asset to apply a tag to. (required) + :type asset: :class:`Node` or :class:`NodeImage` or + :class:`NttCisNewtorkDomain` or + :class:`NttCisVlan` or + :class:`NttCisPublicIpBlock` + + :param tag_key: The tag_key to apply to the asset. (required) + :type tag_key: :class:`NttCisTagKey` or ``str`` + + :param value: The value to be assigned to the tag key + This is only required if the :class:`NttCisTagKey` + requires it + :type value: ``str`` + + :rtype: ``bool`` + """ + + asset_type = self._get_tagging_asset_type(asset) + tag_key_name = self._tag_key_to_tag_key_name(tag_key) + + apply_tags = ET.Element("applyTags", {"xmlns": TYPES_URN}) + ET.SubElement(apply_tags, "assetType").text = asset_type + ET.SubElement(apply_tags, "assetId").text = asset.id + + tag_ele = ET.SubElement(apply_tags, "tag") + ET.SubElement(tag_ele, "tagKeyName").text = tag_key_name + + if value is not None: + ET.SubElement(tag_ele, "value").text = value + + response = self.connection.request_with_orgId_api_2( + "tag/applyTags", method="POST", data=ET.tostring(apply_tags) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_remove_tag_from_asset(self, asset, tag_key): + """ + Remove a tag from an asset + + :param asset: The asset to remove a tag from. (required) + :type asset: :class:`Node` or :class:`NodeImage` or + :class:`NttCisNewtorkDomain` or + :class:`NttCisVlan` or + :class:`NttCisPublicIpBlock` + + :param tag_key: The tag key you want to remove (required) + :type tag_key: :class:`NttCisTagKey` or ``str`` + + :rtype: ``bool`` + """ + + asset_type = self._get_tagging_asset_type(asset) + tag_key_name = self._tag_key_to_tag_key_name(tag_key) + + apply_tags = ET.Element("removeTags", {"xmlns": TYPES_URN}) + ET.SubElement(apply_tags, "assetType").text = asset_type + ET.SubElement(apply_tags, "assetId").text = asset.id + ET.SubElement(apply_tags, "tagKeyName").text = tag_key_name + response = self.connection.request_with_orgId_api_2( + "tag/removeTags", method="POST", data=ET.tostring(apply_tags) + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_tags( + self, + asset_id=None, + asset_type=None, + location=None, + tag_key_name=None, + tag_key_id=None, + value=None, + value_required=None, + display_on_report=None, + ): + """ + List tags in the NTTC-CIS Cloud + + :param asset_id: Filter the list by asset id + :type asset_id: ``str`` + + :param asset_type: Filter the list by asset type + :type asset_type: ``str`` + + :param location: Filter the list by the assets location + :type location: :class:``NodeLocation`` or ``str`` + + :param tag_key_name: Filter the list by a tag key name + :type tag_key_name: ``str`` + + :param tag_key_id: Filter the list by a tag key id + :type tag_key_id: ``str`` + + :param value: Filter the list by a tag value + :type value: ``str`` + + :param value_required: Filter the list to if a value is required + for a tag + :type value_required: ``bool`` + + :param display_on_report: Filter the list to if the tag should + show up on usage reports + :type display_on_report: ``bool`` + + :rtype: ``list`` of :class:`NttCisTag` + """ + + params = {} + + if asset_id is not None: + params["assetId"] = asset_id + + if asset_type is not None: + params["assetType"] = asset_type + + if location is not None: + params["datacenterId"] = self._location_to_location_id(location) + + if tag_key_name is not None: + params["tagKeyName"] = tag_key_name + + if tag_key_id is not None: + params["tagKeyId"] = tag_key_id + + if value is not None: + params["value"] = value + + if value_required is not None: + params["valueRequired"] = str(value_required).lower() + + if display_on_report is not None: + params["displayOnReport"] = str(display_on_report).lower() + + paged_result = self.connection.paginated_request_with_orgId_api_2( + "tag/tag", method="GET", params=params + ) + + tags = [] + + for result in paged_result: + tags.extend(self._to_tags(result)) + + return tags + + def ex_summary_usage_report(self, start_date, end_date): + """ + Get summary usage information + + :param start_date: Start date for the report + :type start_date: ``str`` in format YYYY-MM-DD + + :param end_date: End date for the report + :type end_date: ``str`` in format YYYY-MM-DD + + :rtype: ``list`` of ``list`` + """ + + result = self.connection.raw_request_with_orgId_api_1( + "report/usage?startDate={}&endDate={}".format(start_date, end_date) + ) + + return self._format_csv(result.response) + + def ex_detailed_usage_report(self, start_date, end_date): + """ + Get detailed usage information + + :param start_date: Start date for the report + :type start_date: ``str`` in format YYYY-MM-DD + + :param end_date: End date for the report + :type end_date: ``str`` in format YYYY-MM-DD + + :rtype: ``list`` of ``list`` + """ + + result = self.connection.raw_request_with_orgId_api_1( + "report/usageDetailed?startDate={}&endDate={}".format(start_date, end_date) + ) + + return self._format_csv(result.response) + + def ex_software_usage_report(self, start_date, end_date): + """ + Get detailed software usage reports + + :param start_date: Start date for the report + :type start_date: ``str`` in format YYYY-MM-DD + + :param end_date: End date for the report + :type end_date: ``str`` in format YYYY-MM-DD + + :rtype: ``list`` of ``list`` + """ + + result = self.connection.raw_request_with_orgId_api_1( + "report/usageSoftwareUnits?startDate={}&endDate={}".format(start_date, end_date) + ) + + return self._format_csv(result.response) + + def ex_audit_log_report(self, start_date, end_date): + """ + Get audit log report + + :param start_date: Start date for the report + :type start_date: ``str`` in format YYYY-MM-DD + + :param end_date: End date for the report + :type end_date: ``str`` in format YYYY-MM-DD + + :rtype: ``list`` of ``list`` + """ + + result = self.connection.raw_request_with_orgId_api_1( + "auditlog?startDate={}&endDate={}".format(start_date, end_date) + ) + + return self._format_csv(result.response) + + def ex_backup_usage_report(self, start_date, end_date, location): + """ + Get audit log report + + :param start_date: Start date for the report + :type start_date: ``str`` in format YYYY-MM-DD + + :param end_date: End date for the report + :type end_date: ``str`` in format YYYY-MM-DD + + :keyword location: Filters the node list to nodes that are + located in this location + :type location: :class:`NodeLocation` or ``str`` + + :rtype: ``list`` of ``list`` + """ + + datacenter_id = self._location_to_location_id(location) + result = self.connection.raw_request_with_orgId_api_1( + "backup/detailedUsageReport?datacenterId=%s&fromDate=%s&toDate=%s" + % (datacenter_id, start_date, end_date) + ) + + return self._format_csv(result.response) + + def ex_list_ip_address_list(self, ex_network_domain): + """ + List IP Address List by network domain ID specified + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + networkDomainName][0] + >>> + >>> # List IP Address List of network domain + >>> ipaddresslist_list = driver.ex_list_ip_address_list( + >>> ex_network_domain=my_network_domain) + >>> pprint(ipaddresslist_list) + + :param ex_network_domain: The network domain or network domain ID + :type ex_network_domain: :class:`NttCisNetworkDomain` or 'str' + + :return: a list of NttCisIpAddressList objects + :rtype: ``list`` of :class:`NttCisIpAddressList` + """ + + params = {"networkDomainId": self._network_domain_to_network_domain_id(ex_network_domain)} + response = self.connection.request_with_orgId_api_2( + "network/ipAddressList", params=params + ).object + + return self._to_ip_address_lists(response) + + def ex_get_ip_address_list(self, ex_network_domain, ex_ip_address_list_name): + """ + Get IP Address List by name in network domain specified + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + networkDomainName][0] + >>> + >>> # Get IP Address List by Name + >>> ipaddresslist_list_by_name = driver.ex_get_ip_address_list( + >>> ex_network_domain=my_network_domain, + >>> ex_ip_address_list_name='My_IP_AddressList_1') + >>> pprint(ipaddresslist_list_by_name) + + + :param ex_network_domain: (required) The network domain or network + domain ID in which ipaddresslist resides. + :type ex_network_domain: :class:`NttCisNetworkDomain` or 'str' + + :param ex_ip_address_list_name: (required) Get 'IP Address List' by + name + :type ex_ip_address_list_name: :``str`` + + :return: a list of NttCisIpAddressList objects + :rtype: ``list`` of :class:`NttCisIpAddressList` + """ + + ip_address_lists = self.ex_list_ip_address_list(ex_network_domain) + + return list(filter(lambda x: x.name == ex_ip_address_list_name, ip_address_lists)) + + def ex_create_ip_address_list( + self, + ex_network_domain, + name, + description, + ip_version, + ip_address_collection, + child_ip_address_list=None, + ): + """ + Create IP Address List. IP Address list. + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> from libcloud.common.nttcis import NttCisIpAddress + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + networkDomainName][0] + >>> + >>> # IP Address collection + >>> ipAddress_1 = NttCisIpAddress(begin='190.2.2.100') + >>> ipAddress_2 = NttCisIpAddress(begin='190.2.2.106', + end='190.2.2.108') + >>> ipAddress_3 = NttCisIpAddress(begin='190.2.2.0', + prefix_size='24') + >>> ip_address_collection = [ipAddress_1, ipAddress_2, ipAddress_3] + >>> + >>> # Create IPAddressList + >>> result = driver.ex_create_ip_address_list( + >>> ex_network_domain=my_network_domain, + >>> name='My_IP_AddressList_2', + >>> ip_version='IPV4', + >>> description='Test only', + >>> ip_address_collection=ip_address_collection, + >>> child_ip_address_list='08468e26-eeb3-4c3d-8ff2-5351fa6d8a04' + >>> ) + >>> + >>> pprint(result) + + + :param ex_network_domain: The network domain or network domain ID + :type ex_network_domain: :class:`NttCisNetworkDomain` or 'str' + + :param name: IP Address List Name (required) + :type name: :``str`` + + :param description: IP Address List Description (optional) + :type description: :``str`` + + :param ip_version: IP Version of ip address (required) + :type ip_version: :``str`` + + :param ip_address_collection: List of IP Address. At least one + ipAddress element or one + childIpAddressListId element must + be provided. + :type ip_address_collection: :``str`` + + :param child_ip_address_list: Child IP Address List or id to be + included in this IP Address List. + At least one ipAddress or + one childIpAddressListId + must be provided. + :type child_ip_address_list: + :class:'NttCisChildIpAddressList` or `str`` + + :return: a list of NttCisIpAddressList objects + :rtype: ``list`` of :class:`NttCisIpAddressList` + """ + + if ip_address_collection is None and child_ip_address_list is None: + raise ValueError( + "At least one ipAddress element or one " + "childIpAddressListId element must be " + "provided." + ) + + create_ip_address_list = ET.Element("createIpAddressList", {"xmlns": TYPES_URN}) + ET.SubElement(create_ip_address_list, "networkDomainId").text = ( + self._network_domain_to_network_domain_id(ex_network_domain) + ) + + ET.SubElement(create_ip_address_list, "name").text = name + + ET.SubElement(create_ip_address_list, "description").text = description + + ET.SubElement(create_ip_address_list, "ipVersion").text = ip_version + + for ip in ip_address_collection: + ip_address = ET.SubElement( + create_ip_address_list, + "ipAddress", + ) + ip_address.set("begin", ip.begin) + + if ip.end: + ip_address.set("end", ip.end) + + if ip.prefix_size: + ip_address.set("prefixSize", ip.prefix_size) + + if child_ip_address_list is not None: + ET.SubElement(create_ip_address_list, "childIpAddressListId").text = ( + self._child_ip_address_list_to_child_ip_address_list_id(child_ip_address_list) + ) + + response = self.connection.request_with_orgId_api_2( + "network/createIpAddressList", + method="POST", + data=ET.tostring(create_ip_address_list), + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_edit_ip_address_list( + self, + ex_ip_address_list, + description=None, + ip_address_collection=None, + child_ip_address_lists=None, + ): + """ + Edit IP Address List. IP Address list. + Bear in mind you cannot add ip addresses to + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> from libcloud.common.NTTCIS import NttCisIpAddress + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # IP Address collection + >>> ipAddress_1 = NttCisIpAddress(begin='190.2.2.100') + >>> ipAddress_2 = NttCisIpAddress(begin='190.2.2.106', + >>> end='190.2.2.108') + >>> ipAddress_3 = NttCisIpAddress( + >>> begin='190.2.2.0', prefix_size='24') + >>> ip_address_collection = [ipAddress_1, ipAddress_2, ipAddress_3] + >>> + >>> # Edit IP Address List + >>> ip_address_list_id = '5e7c323f-c885-4e4b-9a27-94c44217dbd3' + >>> result = driver.ex_edit_ip_address_list( + >>> ex_ip_address_list=ip_address_list_id, + >>> description="Edit Test", + >>> ip_address_collection=ip_address_collection, + >>> child_ip_address_lists=None + >>> ) + >>> pprint(result) + + :param ex_ip_address_list: (required) IpAddressList object or + IpAddressList ID + :type ex_ip_address_list: :class:'NttCisIpAddressList' + or ``str`` + + :param description: IP Address List Description + :type description: :``str`` + + :param ip_address_collection: List of IP Address + :type ip_address_collection: ''list'' of + :class:'NttCisIpAddressList' + + :param child_ip_address_lists: Child IP Address List or id to be + included in this IP Address List + :type child_ip_address_lists: ``list`` of + :class:'NttCisChildIpAddressList' + or ``str`` + + :return: a list of NttCisIpAddressList objects + :rtype: ``list`` of :class:`NttCisIpAddressList` + """ + + edit_ip_address_list = ET.Element( + "editIpAddressList", + { + "xmlns": TYPES_URN, + "id": self._ip_address_list_to_ip_address_list_id(ex_ip_address_list), + "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + }, + ) + + if description is not None: + if description != "nil": + ET.SubElement(edit_ip_address_list, "description").text = description + else: + ET.SubElement(edit_ip_address_list, "description", {"xsi:nil": "true"}) + + if ip_address_collection is not None: + for ip in ip_address_collection: + ip_address = ET.SubElement( + edit_ip_address_list, + "ipAddress", + ) + ip_address.set("begin", ip.begin) + + if ip.end: + ip_address.set("end", ip.end) + + if ip.prefix_size: + ip_address.set("prefixSize", ip.prefix_size) + + if child_ip_address_lists is not None: + ET.SubElement(edit_ip_address_list, "childIpAddressListId").text = ( + self._child_ip_address_list_to_child_ip_address_list_id(child_ip_address_lists) + ) + else: + ET.SubElement(edit_ip_address_list, "childIpAddressListId", {"xsi:nil": "true"}) + + response = self.connection.request_with_orgId_api_2( + "network/editIpAddressList", + method="POST", + data=ET.tostring(edit_ip_address_list), + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_delete_ip_address_list(self, ex_ip_address_list): + """ + Delete IP Address List by ID + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> ip_address_list_id = '5e7c323f-c885-4e4b-9a27-94c44217dbd3' + >>> result = driver.ex_delete_ip_address_list(ip_address_list_id) + >>> pprint(result) + + :param ex_ip_address_list: IP Address List object or IP Address + List ID (required) + :type ex_ip_address_list: :class:'NttCisIpAddressList' + or ``str`` + + :rtype: ``bool`` + """ + + delete_ip_address_list = ET.Element( + "deleteIpAddressList", + { + "xmlns": TYPES_URN, + "id": self._ip_address_list_to_ip_address_list_id(ex_ip_address_list), + }, + ) + + response = self.connection.request_with_orgId_api_2( + "network/deleteIpAddressList", + method="POST", + data=ET.tostring(delete_ip_address_list), + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_list_portlist(self, ex_network_domain): + """ + List Portlist by network domain ID specified + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + >>> networkDomainName][0] + >>> + >>> # List portlist + >>> portLists = driver.ex_list_portlist( + >>> ex_network_domain=my_network_domain) + >>> pprint(portLists) + >>> + + :param ex_network_domain: The network domain or network domain ID + :type ex_network_domain: :class:`NttCisNetworkDomain` or 'str' + + :return: a list of NttCisPortList objects + :rtype: ``list`` of :class:`NttCisPortList` + """ + + params = {"networkDomainId": self._network_domain_to_network_domain_id(ex_network_domain)} + response = self.connection.request_with_orgId_api_2( + "network/portList", params=params + ).object + + return self._to_port_lists(response) + + def ex_get_portlist(self, ex_portlist_id): + """ + Get Port List + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get specific portlist by ID + >>> portlist_id = '27dd8c66-80ff-496b-9f54-2a3da2fe679e' + >>> portlist = driver.ex_get_portlist(portlist_id) + >>> pprint(portlist) + + :param ex_portlist_id: The ex_port_list or ex_port_list ID + :type ex_portlist_id: :class:`NttCisNetworkDomain` or 'str' + + :return: NttCisPortList object + :rtype: :class:`NttCisPort` + """ + + url_path = "network/portList/%s" % ex_portlist_id + response = self.connection.request_with_orgId_api_2(url_path).object + + return self._to_port_list(response) + + def ex_create_portlist( + self, + ex_network_domain, + name, + description, + port_collection, + child_portlist_list=None, + ): + """ + Create Port List. + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> from libcloud.common.nttcis import NttCisPort + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Get location + >>> location = driver.ex_get_location_by_id(id='AU9') + >>> + >>> # Get network domain by location + >>> networkDomainName = "Baas QA" + >>> network_domains = driver.ex_list_network_domains(location=location) + >>> my_network_domain = [d for d in network_domains if d.name == + networkDomainName][0] + >>> + >>> # Port Collection + >>> port_1 = DimensionDataPort(begin='1000') + >>> port_2 = DimensionDataPort(begin='1001', end='1003') + >>> port_collection = [port_1, port_2] + >>> + >>> # Create Port List + >>> new_portlist = driver.ex_create_portlist( + >>> ex_network_domain=my_network_domain, + >>> name='MyPortListX', + >>> description="Test only", + >>> port_collection=port_collection, + >>> child_portlist_list={'a9cd4984-6ff5-4f93-89ff-8618ab642bb9'} + >>> ) + >>> pprint(new_portlist) + + :param ex_network_domain: (required) The network domain in + which to create PortList. Provide + networkdomain object or its id. + :type ex_network_domain: :``str`` + + :param name: Port List Name + :type name: :``str`` + + :param description: IP Address List Description + :type description: :``str`` + + :param port_collection: List of Port Address + :type port_collection: :``str`` + + :param child_portlist_list: List of Child Portlist to be + included in this Port List + :type child_portlist_list: :``str`` or ''list of + :class:'NttCisChildPortList' + + :return: result of operation + :rtype: ``bool`` + """ + + new_port_list = ET.Element("createPortList", {"xmlns": TYPES_URN}) + ET.SubElement(new_port_list, "networkDomainId").text = ( + self._network_domain_to_network_domain_id(ex_network_domain) + ) + + ET.SubElement(new_port_list, "name").text = name + + ET.SubElement(new_port_list, "description").text = description + + for port in port_collection: + p = ET.SubElement(new_port_list, "port") + p.set("begin", port.begin) + + if port.end: + p.set("end", port.end) + + if child_portlist_list is not None: + for child in child_portlist_list: + ET.SubElement(new_port_list, "childPortListId").text = ( + self._child_port_list_to_child_port_list_id(child) + ) + + response = self.connection.request_with_orgId_api_2( + "network/createPortList", method="POST", data=ET.tostring(new_port_list) + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_edit_portlist( + self, + ex_portlist, + description=None, + port_collection=None, + child_portlist_list=None, + ): + """ + Edit Port List. + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> from libcloud.common.NTTCIS import DimensionDataPort + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Port Collection + >>> port_1 = DimensionDataPort(begin='4200') + >>> port_2 = DimensionDataPort(begin='4201', end='4210') + >>> port_collection = [port_1, port_2] + >>> + >>> # Edit Port List + >>> editPortlist = driver.ex_get_portlist( + '27dd8c66-80ff-496b-9f54-2a3da2fe679e') + >>> + >>> result = driver.ex_edit_portlist( + >>> ex_portlist=editPortlist.id, + >>> description="Make Changes in portlist", + >>> port_collection=port_collection, + >>> child_portlist_list={'a9cd4984-6ff5-4f93-89ff-8618ab642bb9'} + >>> ) + >>> pprint(result) + + :param ex_portlist: Port List to be edited + (required) + :type ex_portlist: :``str`` or :class:'DNttCisPortList' + + :param description: Port List Description + :type description: :``str`` + + :param port_collection: List of Ports + :type port_collection: :``str`` + + :param child_portlist_list: Child PortList to be included in + this IP Address List + :type child_portlist_list: :``list`` of + :class'NttCisChildPortList' + or ''str'' + + :return: a list of NttCisPortList objects + :rtype: ``list`` of :class:`NttCisPortList` + """ + + existing_port_address_list = ET.Element( + "editPortList", + { + "id": self._port_list_to_port_list_id(ex_portlist), + "xmlns": TYPES_URN, + "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + }, + ) + + if description is not None: + if description != "nil": + ET.SubElement(existing_port_address_list, "description").text = description + else: + ET.SubElement(existing_port_address_list, "description", {"xsi:nil": "true"}) + + if port_collection is not None: + for port in port_collection: + p = ET.SubElement(existing_port_address_list, "port") + p.set("begin", port.begin) + + if port.end: + p.set("end", port.end) + + if child_portlist_list is not None: + for child in child_portlist_list: + ET.SubElement(existing_port_address_list, "childPortListId").text = ( + self._child_port_list_to_child_port_list_id(child) + ) + else: + ET.SubElement(existing_port_address_list, "childPortListId", {"xsi:nil": "true"}) + + response = self.connection.request_with_orgId_api_2( + "network/editPortList", + method="POST", + data=ET.tostring(existing_port_address_list), + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_delete_portlist(self, ex_portlist): + """ + Delete Port List + + >>> from pprint import pprint + >>> from libcloud.compute.types import Provider + >>> from libcloud.compute.providers import get_driver + >>> import libcloud.security + >>> + >>> # Get NTTC-CIS driver + >>> libcloud.security.VERIFY_SSL_CERT = True + >>> cls = get_driver(Provider.NTTCIS) + >>> driver = cls('myusername','mypassword', region='dd-au') + >>> + >>> # Delete Port List + >>> portlist_id = '157531ce-77d4-493c-866b-d3d3fc4a912a' + >>> response = driver.ex_delete_portlist(portlist_id) + >>> pprint(response) + + :param ex_portlist: Port List to be deleted + :type ex_portlist: :``str`` or :class:'NttCisPortList' + + :rtype: ``bool`` + """ + + delete_port_list = ET.Element( + "deletePortList", + {"xmlns": TYPES_URN, "id": self._port_list_to_port_list_id(ex_portlist)}, + ) + + response = self.connection.request_with_orgId_api_2( + "network/deletePortList", method="POST", data=ET.tostring(delete_port_list) + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_exchange_nic_vlans(self, nic_id_1, nic_id_2): + """ + Exchange NIC Vlans + + :param nic_id_1: Nic ID 1 + :type nic_id_1: :``str`` + + :param nic_id_2: Nic ID 2 + :type nic_id_2: :``str`` + + :rtype: ``bool`` + """ + + exchange_elem = ET.Element("urn:exchangeNicVlans", {"xmlns:urn": TYPES_URN}) + + ET.SubElement(exchange_elem, "urn:nicId1").text = nic_id_1 + ET.SubElement(exchange_elem, "urn:nicId2").text = nic_id_2 + + response = self.connection.request_with_orgId_api_2( + "server/exchangeNicVlans", method="POST", data=ET.tostring(exchange_elem) + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_change_nic_network_adapter(self, nic_id, network_adapter_name): + """ + Change network adapter of a NIC on a cloud server + + :param nic_id: Nic ID + :type nic_id: :``str`` + + :param network_adapter_name: Network adapter name + :type network_adapter_name: :``str`` + + :rtype: ``bool`` + """ + + change_elem = ET.Element("changeNetworkAdapter", {"nicId": nic_id, "xmlns": TYPES_URN}) + + ET.SubElement(change_elem, "networkAdapter").text = network_adapter_name + + response = self.connection.request_with_orgId_api_2( + "server/changeNetworkAdapter", method="POST", data=ET.tostring(change_elem) + ).object + + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_create_node_uncustomized( + self, + name, + image, + ex_network_domain, + ex_is_started=True, + ex_description=None, + ex_cluster_id=None, + ex_cpu_specification=None, + ex_memory_gb=None, + ex_primary_nic_private_ipv4=None, + ex_primary_nic_vlan=None, + ex_primary_nic_network_adapter=None, + ex_additional_nics=None, + ex_disks=None, + ex_tagid_value_pairs=None, + ex_tagname_value_pairs=None, + ): + """ + This MCP 2.0 only function deploys a new Cloud Server from a + CloudControl compatible Server Image, which does not utilize + VMware Guest OS Customization process. + + Create Node in MCP2 Data Center + + :keyword name: (required) String with a name for this new node + :type name: ``str`` + + :keyword image: (UUID of the Server Image being used as the target + for the new Server deployment. The source Server + Image (OS Image or Customer Image) must have + osCustomization set to true. See Get/List OS + Image(s) and Get/List Customer Image(s). + :type image: :class:`NodeImage` or ``str`` + + + :keyword ex_network_domain: (required) Network Domain or Network + Domain ID to create the node + :type ex_network_domain: :class:`NttCisNetworkDomain` + or ``str`` + + :keyword ex_description: (optional) description for this node + :type ex_description: ``str`` + + :keyword ex_cluster_id: (optional) For multiple cluster + environments, it is possible to set a destination cluster for the new + Customer Image. Note that performance of this function is optimal when + either the Server cluster and destination are the same or when shared + data storage is in place for the multiple clusters. + :type ex_cluster_id: ``str`` + + + :keyword ex_primary_nic_private_ipv4: Provide private IPv4. Ignore + if ex_primary_nic_vlan is + provided. Use one or the + other. Not both. + :type ex_primary_nic_private_ipv4: :``str`` + + :keyword ex_primary_nic_vlan: Provide VLAN for the node if + ex_primary_nic_private_ipv4 NOT + provided. One or the other. Not both. + :type ex_primary_nic_vlan: :class: NttCisVlan or ``str`` + + :keyword ex_primary_nic_network_adapter: (Optional) Default value + for the Operating System + will be used if leave + empty. Example: "E1000". + :type ex_primary_nic_network_adapter: :``str`` + + :keyword ex_additional_nics: (optional) List + :class:'NttCisNic' or None + :type ex_additional_nics: ``list`` of :class:'NttCisNic' + or ``str`` + + :keyword ex_memory_gb: (optional) The amount of memory in GB for + the server Can be used to override the + memory value inherited from the source + Server Image. + :type ex_memory_gb: ``int`` + + :keyword ex_cpu_specification: (optional) The spec of CPU to deploy + :type ex_cpu_specification: + :class:`NttCisServerCpuSpecification` + + :keyword ex_is_started: (required) Start server after creation. + Default is set to true. + :type ex_is_started: ``bool`` + + :keyword ex_disks: (optional) NttCis disks. Optional disk + elements can be used to define the disk speed + that each disk on the Server; inherited from the + source Server Image will be deployed to. It is + not necessary to include a diskelement for every + disk; only those that you wish to set a disk + speed value for. Note that scsiId 7 cannot be + used.Up to 13 disks can be present in addition to + the required OS disk on SCSI ID 0. Refer to + https://docs.mcp-services.net/x/UwIu for disk + + :type ex_disks: List or tuple of :class:'NttCisServerDisk` + + :keyword ex_tagid_value_pairs: + (Optional) up to 10 tag elements may be provided. + A combination of tagById and tag name cannot be + supplied in the same request. + Note: ex_tagid_value_pairs and + ex_tagname_value_pairs is + mutually exclusive. Use one or other. + + :type ex_tagname_value_pairs: ``dict``. Value can be None. + + :keyword ex_tagname_value_pairs: + (Optional) up to 10 tag elements may be provided. + A combination of tagById and tag name cannot be + supplied in the same request. + Note: ex_tagid_value_pairs and + ex_tagname_value_pairs is + mutually exclusive. Use one or other. + + :type ex_tagname_value_pairs: ``dict```. + + :return: The newly created :class:`Node`. + :rtype: :class:`Node` + """ + + # Unsupported for version lower than 2.4 + + if LooseVersion(self.connection.active_api_version) < LooseVersion("2.4"): + raise Exception("This feature is NOT supported in " "earlier api version of 2.4") + + # Default start to true if input is invalid + + if not isinstance(ex_is_started, bool): + ex_is_started = True + print("Warning: ex_is_started input value is invalid. Default" "to True") + + server_uncustomized_elm = ET.Element("deployUncustomizedServer", {"xmlns": TYPES_URN}) + ET.SubElement(server_uncustomized_elm, "name").text = name + ET.SubElement(server_uncustomized_elm, "description").text = ex_description + image_id = self._image_to_image_id(image) + ET.SubElement(server_uncustomized_elm, "imageId").text = image_id + + if ex_cluster_id: + dns_elm = ET.SubElement(server_uncustomized_elm, "primaryDns") + dns_elm.text = ex_cluster_id + + if ex_is_started is not None: + ET.SubElement(server_uncustomized_elm, "start").text = str(ex_is_started).lower() + + if ex_cpu_specification is not None: + cpu = ET.SubElement(server_uncustomized_elm, "cpu") + cpu.set("speed", ex_cpu_specification.performance) + cpu.set("count", str(ex_cpu_specification.cpu_count)) + cpu.set("coresPerSocket", str(ex_cpu_specification.cores_per_socket)) + + if ex_memory_gb is not None: + ET.SubElement(server_uncustomized_elm, "memoryGb").text = str(ex_memory_gb) + + if ex_primary_nic_private_ipv4 is None and ex_primary_nic_vlan is None: + raise ValueError( + "Missing argument. Either " + "ex_primary_nic_private_ipv4 or " + "ex_primary_nic_vlan " + "must be specified." + ) + + if ex_primary_nic_private_ipv4 is not None and ex_primary_nic_vlan is not None: + raise ValueError( + "Either ex_primary_nic_private_ipv4 or " + "ex_primary_nic_vlan " + "be specified. Not both." + ) + + network_elm = ET.SubElement(server_uncustomized_elm, "networkInfo") + + net_domain_id = self._network_domain_to_network_domain_id(ex_network_domain) + network_elm.set("networkDomainId", net_domain_id) + + pri_nic = ET.SubElement(network_elm, "primaryNic") + + if ex_primary_nic_private_ipv4 is not None: + ET.SubElement(pri_nic, "privateIpv4").text = ex_primary_nic_private_ipv4 + + if ex_primary_nic_vlan is not None: + vlan_id = self._vlan_to_vlan_id(ex_primary_nic_vlan) + ET.SubElement(pri_nic, "vlanId").text = vlan_id + + if ex_primary_nic_network_adapter is not None: + ET.SubElement(pri_nic, "networkAdapter").text = ex_primary_nic_network_adapter + + if isinstance(ex_additional_nics, (list, tuple)): + for nic in ex_additional_nics: + additional_nic = ET.SubElement(network_elm, "additionalNic") + + if nic.private_ip_v4 is None and nic.vlan is None: + raise ValueError( + "Either a vlan or private_ip_v4 " + "must be specified for each " + "additional nic." + ) + + if nic.private_ip_v4 is not None and nic.vlan is not None: + raise ValueError( + "Either a vlan or private_ip_v4 " + "must be specified for each " + "additional nic. Not both." + ) + + if nic.private_ip_v4 is not None: + ET.SubElement(additional_nic, "privateIpv4").text = nic.private_ip_v4 + + if nic.vlan is not None: + vlan_id = self._vlan_to_vlan_id(nic.vlan) + ET.SubElement(additional_nic, "vlanId").text = vlan_id + + if nic.network_adapter_name is not None: + ET.SubElement(additional_nic, "networkAdapter").text = nic.network_adapter_name + elif ex_additional_nics is not None: + raise TypeError("ex_additional_NICs must be None or tuple/list") + + if isinstance(ex_disks, (list, tuple)): + for disk in ex_disks: + disk_elm = ET.SubElement(server_uncustomized_elm, "disk") + disk_elm.set("scsiId", disk.scsi_id) + disk_elm.set("speed", disk.speed) + elif ex_disks is not None: + raise TypeError("ex_disks must be None or tuple/list") + + # tagid and tagname value pair should not co-exists + + if ex_tagid_value_pairs is not None and ex_tagname_value_pairs is not None: + raise ValueError( + "ex_tagid_value_pairs and ex_tagname_value_pairs" + "is mutually exclusive. Use one or the other." + ) + + # Tag by ID + + if ex_tagid_value_pairs is not None: + if not isinstance(ex_tagid_value_pairs, dict): + raise ValueError("ex_tagid_value_pairs must be a dictionary.") + + for k, v in ex_tagid_value_pairs.items(): + tag_elem = ET.SubElement(server_uncustomized_elm, "tagById") + ET.SubElement(tag_elem, "tagKeyId").text = k + + if v is not None: + ET.SubElement(tag_elem, "value").text = v + + if ex_tagname_value_pairs is not None: + if not isinstance(ex_tagname_value_pairs, dict): + raise ValueError("ex_tagname_value_pairs must be a dictionary") + + for k, v in ex_tagname_value_pairs.items(): + tag_name_elem = ET.SubElement(server_uncustomized_elm, "tag") + ET.SubElement(tag_name_elem, "tagKeyName").text = k + + if v is not None: + ET.SubElement(tag_name_elem, "value").text = v + + response = self.connection.request_with_orgId_api_2( + "server/deployUncustomizedServer", + method="POST", + data=ET.tostring(server_uncustomized_elm), + ).object + + node_id = None + + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "serverId": + node_id = info.get("value") + + new_node = self.ex_get_node_by_id(node_id) + + return new_node + + # DRS methods + def ex_create_consistency_group( + self, + name, + journal_size_gb, + source_server_id, + target_server_id, + description=None, + ): + """ + Create a consistency group + + :param name: Name of consistency group + :type name: ``str`` + + :param journal_size_gb: Journal size in GB + :type journal_size_gb: ``str`` + + :param source_server_id: Id of the server to copy + :type source_server_id: ``str`` + + :param target_server_id: Id of the server to receive the copy + :type: target_server_id: ``str`` + + :param description: (Optional) Description of consistency group + :type: description: ``str`` + + :rtype: :class:`NttCisConsistencyGroup` + """ + + consistency_group_elm = ET.Element("createConsistencyGroup", {"xmlns": TYPES_URN}) + ET.SubElement(consistency_group_elm, "name").text = name + + if description is not None: + ET.SubElement(consistency_group_elm, "description").text = description + ET.SubElement(consistency_group_elm, "journalSizeGb").text = journal_size_gb + server_pair = ET.SubElement(consistency_group_elm, "serverPair") + ET.SubElement(server_pair, "sourceServerId").text = source_server_id + ET.SubElement(server_pair, "targetServerId").text = target_server_id + response = self.connection.request_with_orgId_api_2( + "consistencyGroup/createConsistencyGroup", + method="POST", + data=ET.tostring(consistency_group_elm), + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + @get_params + def ex_list_consistency_groups(self, params={}): + """ + Functions takes a named parameter that must be one of the following + :param params: A dictionary composed of one of the following keys + and a value + * target_data_center_id= + * source_network_domain_id= + * target_network_domain_id= + * source_server_id= + * target_server_id= + * name= + * state= + * operation_status= + * drs_infrastructure_status= + :rtype: `list` of :class: `NttCisConsistencyGroup` + """ + + response = self.connection.request_with_orgId_api_2( + "consistencyGroup/consistencyGroup", params=params + ).object + cgs = self._to_consistency_groups(response) + + return cgs + + def ex_get_consistency_group(self, consistency_group_id): + """ + Retrieves a Consistency by it's id and is more efficient than listing + all consistency groups and filtering that result. + + :param consistency_group_id: An id of a consistency group + :type consistency_group_id: ``str`` + + :rtype: :class:`NttCisConsistencygroup` + """ + response = self.connection.request_with_orgId_api_2( + "consistencyGroup/consistencyGroup/%s" % consistency_group_id + ).object + cg = self._to_process(response) + + return cg + + def ex_list_consistency_group_snapshots( + self, consistency_group_id, create_time_min=None, create_time_max=None + ): + """ + Optional parameters identify the date of creation of Consistency Group + snapshots in *XML Schema (XSD) date time format. Best used as a + combination of createTime.MIN and createTime.MAX. If neither is + provided then all snapshots up to the possible maximum of 1014 + will be returned. If MIN is provided by itself, all snapshots + between the time specified by MIN and the point in time of + execution will be returned. If MAX is provided by itself, + then all snapshots up to that point in time (up to the + maximum number of 1014) will be returned. MIN and MAX are + inclusive for this API function + + :param consistency_group_id: The id of consistency group + :type consistency_group_id: ``str`` + + :param create_time_min: (Optional) in form YYYY-MM-DDT00:00.00.00Z or + substitute time offset for Z, i.e, + -05:00 + :type create_time_min: ``str`` + + :param create_time_max: (Optional) in form YYYY-MM-DDT00:00:00.000Z or + substitute time offset for Z, i.e, + -05:00 + :type create_time_max: ``str`` + + :rtype: `list` of :class:`NttCisSnapshots` + """ + params = {} + + if create_time_min is None and create_time_max is None: + params = {"consistencyGroupId": consistency_group_id} + elif create_time_min and create_time_max: + params = { + "consistencyGroupId": consistency_group_id, + "createTime.MIN": create_time_min, + "createTime.MAX": create_time_max, + } + elif create_time_min or create_time_max: + if create_time_max is not None: + params = { + "consistencyGroupId": consistency_group_id, + "createTime.MAX": create_time_max, + } + elif create_time_min is not None: + params = { + "consistencyGroupId": consistency_group_id, + "createTime.MIN": create_time_min, + } + paged_result = self.connection.request_with_orgId_api_2( + "consistencyGroup/snapshot", method="GET", params=params + ).object + snapshots = self._to_process(paged_result) + + return snapshots + + def ex_expand_journal(self, consistency_group_id, size_gb): + """ + Expand the consistency group's journhal size in 100Gb increments. + + :param consistency_group_id: The consistency group's UUID + :type consistency_group_id: ``str`` + + :param size_gb: Gb in 100 Gb increments + :type size_gb: ``str`` + + :return: True if response_code contains either 'IN_PROGRESS' or 'OK' + otherwise False + :rtype: ``bool`` + """ + + expand_elm = ET.Element("expandJournal", {"id": consistency_group_id, "xmlns": TYPES_URN}) + ET.SubElement(expand_elm, "sizeGb").text = size_gb + response = self.connection.request_with_orgId_api_2( + "consistencyGroup/expandJournal", + method="POST", + data=ET.tostring(expand_elm), + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_start_drs_failover_preview(self, consistency_group_id, snapshot_id): + """ + Brings a Consistency Group into PREVIEWING_SNAPSHOT mode. + + :param consistency_group_id: Id of the Consistency Group to put into + PRIEVEW_MODE + :type consistency_group_id: ``str`` + + :param snapshot_id: Id of the Snapshot to preview + :type snapshot_id: ``str`` + + :return: True if response_code contains either 'IN_PROGRESS' or 'OK' + otherwise False + :rtype: ``bool`` + """ + preview_elm = ET.Element( + "startPreviewSnapshot", + {"consistencyGroupId": consistency_group_id, "xmlns": TYPES_URN}, + ) + ET.SubElement(preview_elm, "snapshotId").text = snapshot_id + response = self.connection.request_with_orgId_api_2( + "consistencyGroup/startPreviewSnapshot", + method="POST", + data=ET.tostring(preview_elm), + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_stop_drs_failover_preview(self, consistency_group_id): + """ + Takes a Consistency Group out of PREVIEW_MODE and back to DRS_MODE + + :param consistency_group_id: Consistency Group's Id + :type ``str`` + + :return: True if response_code contains either 'IN_PROGRESS' or 'OK' + otherwise False + :rtype: ``bool`` + """ + preview_elm = ET.Element( + "stopPreviewSnapshot", + {"consistencyGroupId": consistency_group_id, "xmlns": TYPES_URN}, + ) + response = self.connection.request_with_orgId_api_2( + "consistencyGroup/stopPreviewSnapshot", + method="POST", + data=ET.tostring(preview_elm), + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_initiate_drs_failover(self, consistency_group_id): + """ + This method is irreversible. + It will failover the Consistency Group while removing it as well. + + :param consistency_group_id: Consistency Group's Id to failover + :type consistency_group_id: ``str`` + + :return: True if response_code contains either + IN_PROGRESS' or 'OK' otherwise False + :rtype: ``bool`` + """ + failover_elm = ET.Element( + "initiateFailover", + {"consistencyGroupId": consistency_group_id, "xmlns": TYPES_URN}, + ) + response = self.connection.request_with_orgId_api_2( + "consistencyGroup/initiateFailover", + method="POST", + data=ET.tostring(failover_elm), + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def ex_delete_consistency_group(self, consistency_group_id): + """ + Delete's a Consistency Group + + :param consistency_group_id: Id of Consistency Group to delete + :type ``str`` + :return: True if response_code contains either + IN_PROGRESS' or 'OK' otherwise False + :rtype: ``bool`` + """ + delete_elm = ET.Element( + "deleteConsistencyGroup", {"id": consistency_group_id, "xmlns": TYPES_URN} + ) + response = self.connection.request_with_orgId_api_2( + "consistencyGroup/deleteConsistencyGroup", + method="POST", + data=ET.tostring(delete_elm), + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + + return response_code in ["IN_PROGRESS", "OK"] + + def _to_consistency_groups(self, object): + cgs = findall(object, "consistencyGroup", TYPES_URN) + + return [self._to_process(el) for el in cgs] + + def _to_drs_snapshots(self, object): + snapshots = [] + + for element in object.findall(fixxpath("snapshot", TYPES_URN)): + snapshots.append(self._to_process(element)) + + return snapshots + + def _to_process(self, element): + return process_xml(ET.tostring(element)) + + def _format_csv(self, http_response): + text = http_response.read() + lines = str.splitlines(ensure_string(text)) + + return [line.split(",") for line in lines] + + @staticmethod + def _get_tagging_asset_type(asset): + objecttype = type(asset) + + if objecttype.__name__ in OBJECT_TO_TAGGING_ASSET_TYPE_MAP: + return OBJECT_TO_TAGGING_ASSET_TYPE_MAP[objecttype.__name__] + raise TypeError("Asset type %s cannot be tagged" % objecttype.__name__) + + def _list_nodes_single_page(self, params={}): + nodes = self.connection.request_with_orgId_api_2("server/server", params=params).object + + return nodes + + def _to_tags(self, object): + tags = [] + + for element in object.findall(fixxpath("tag", TYPES_URN)): + tags.append(self._to_tag(element)) + + return tags + + def _to_tag(self, element): + tag_key = self._to_tag_key(element, from_tag_api=True) + + return NttCisTag( + asset_type=findtext(element, "assetType", TYPES_URN), + asset_id=findtext(element, "assetId", TYPES_URN), + asset_name=findtext(element, "assetName", TYPES_URN), + datacenter=findtext(element, "datacenterId", TYPES_URN), + key=tag_key, + value=findtext(element, "value", TYPES_URN), + ) + + def _to_tag_keys(self, object): + keys = [] + + for element in object.findall(fixxpath("tagKey", TYPES_URN)): + keys.append(self._to_tag_key(element)) + + return keys + + def _to_tag_key(self, element, from_tag_api=False): + if from_tag_api: + id = findtext(element, "tagKeyId", TYPES_URN) + name = findtext(element, "tagKeyName", TYPES_URN) + else: + id = element.get("id") + name = findtext(element, "name", TYPES_URN) + + return NttCisTagKey( + id=id, + name=name, + description=findtext(element, "description", TYPES_URN), + value_required=self._str2bool(findtext(element, "valueRequired", TYPES_URN)), + display_on_report=self._str2bool(findtext(element, "displayOnReport", TYPES_URN)), + ) + + def _to_images(self, object, el_name="osImage"): + images = [] + locations = self.list_locations() + + # The CloudControl API will return all images + # in the current geographic region (even ones in + # datacenters the user's organisation does not have access to) + # + # We therefore need to filter out those images (since we can't + # get a NodeLocation for them) + location_ids = {location.id for location in locations} + + for element in object.findall(fixxpath(el_name, TYPES_URN)): + location_id = element.get("datacenterId") + + if location_id in location_ids: + images.append(self._to_image(element, locations)) + + return images + + def _to_image(self, element, locations=None): + location_id = element.get("datacenterId") + + if locations is None: + locations = self.list_locations(location_id) + + location = [loc for loc in locations if loc.id == location_id][0] + cpu_spec = self._to_cpu_spec(element.find(fixxpath("cpu", TYPES_URN))) + + if LooseVersion(self.connection.active_api_version) > LooseVersion("2.3"): + os_el = element.find(fixxpath("guest/operatingSystem", TYPES_URN)) + else: + os_el = element.find(fixxpath("operatingSystem", TYPES_URN)) + + if element.tag.endswith("customerImage"): + is_customer_image = True + else: + is_customer_image = False + extra = { + "description": findtext(element, "description", TYPES_URN), + "OS_type": os_el.get("family"), + "OS_displayName": os_el.get("displayName"), + "cpu": cpu_spec, + "memoryGb": findtext(element, "memoryGb", TYPES_URN), + "osImageKey": findtext(element, "osImageKey", TYPES_URN), + "created": findtext(element, "createTime", TYPES_URN), + "location": location, + "isCustomerImage": is_customer_image, + } + + return NodeImage( + id=element.get("id"), + name=str(findtext(element, "name", TYPES_URN)), + extra=extra, + driver=self.connection.driver, + ) + + def _to_nat_rules(self, object, network_domain): + rules = [] + + for element in findall(object, "natRule", TYPES_URN): + rules.append(self._to_nat_rule(element, network_domain)) + + return rules + + def _to_nat_rule(self, element, network_domain): + return NttCisNatRule( + id=element.get("id"), + network_domain=network_domain, + internal_ip=findtext(element, "internalIp", TYPES_URN), + external_ip=findtext(element, "externalIp", TYPES_URN), + status=findtext(element, "state", TYPES_URN), + ) + + def _to_anti_affinity_rules(self, object): + rules = [] + + for element in findall(object, "antiAffinityRule", TYPES_URN): + rules.append(self._to_anti_affinity_rule(element)) + + return rules + + def _to_anti_affinity_rule(self, element): + node_list = [] + + for node in findall(element, "serverSummary", TYPES_URN): + node_list.append(node.get("id")) + + return NttCisAntiAffinityRule(id=element.get("id"), node_list=node_list) + + def _to_firewall_rules(self, object, network_domain): + rules = [] + locations = self.list_locations() + + for element in findall(object, "firewallRule", TYPES_URN): + rules.append(self._to_firewall_rule(element, locations, network_domain)) + + return rules + + def _to_firewall_rule(self, element, locations, network_domain): + location_id = element.get("datacenterId") + location = list(filter(lambda x: x.id == location_id, locations))[0] + # For future dynamic rule creation + # return process_xml(ET.tostring(element)) + + return NttCisFirewallRule( + id=element.get("id"), + network_domain=network_domain, + name=findtext(element, "name", TYPES_URN), + action=findtext(element, "action", TYPES_URN), + ip_version=findtext(element, "ipVersion", TYPES_URN), + protocol=findtext(element, "protocol", TYPES_URN), + enabled=findtext(element, "enabled", TYPES_URN), + source=self._to_firewall_address(element.find(fixxpath("source", TYPES_URN))), + destination=self._to_firewall_address(element.find(fixxpath("destination", TYPES_URN))), + location=location, + status=findtext(element, "state", TYPES_URN), + ) + + def _to_firewall_address(self, element): + ip = element.find(fixxpath("ip", TYPES_URN)) + port = element.find(fixxpath("port", TYPES_URN)) + port_list = element.find(fixxpath("portList", TYPES_URN)) + address_list = element.find(fixxpath("ipAddressList", TYPES_URN)) + + if address_list is None: + return NttCisFirewallAddress( + any_ip=ip.get("address") == "ANY", + ip_address=ip.get("address"), + ip_prefix_size=ip.get("prefixSize"), + port_begin=port.get("begin") if port is not None else None, + port_end=port.get("end") if port is not None else None, + port_list_id=port_list.get("id", None) if port_list is not None else None, + address_list_id=address_list.get("id") if address_list is not None else None, + ) + else: + return NttCisFirewallAddress( + any_ip=False, + ip_address=None, + ip_prefix_size=None, + port_begin=None, + port_end=None, + port_list_id=port_list.get("id", None) if port_list is not None else None, + address_list_id=address_list.get("id") if address_list is not None else None, + ) + + def _to_ip_blocks(self, object): + blocks = [] + locations = self.list_locations() + + for element in findall(object, "publicIpBlock", TYPES_URN): + blocks.append(self._to_ip_block(element, locations)) + + return blocks + + def _to_ip_block(self, element, locations): + location_id = element.get("datacenterId") + location = list(filter(lambda x: x.id == location_id, locations))[0] + + return NttCisPublicIpBlock( + id=element.get("id"), + network_domain=self.ex_get_network_domain( + findtext(element, "networkDomainId", TYPES_URN) + ), + base_ip=findtext(element, "baseIp", TYPES_URN), + size=findtext(element, "size", TYPES_URN), + location=location, + status=findtext(element, "state", TYPES_URN), + ) + + def _to_networks(self, object): + networks = [] + locations = self.list_locations() + + for element in findall(object, "network", NETWORK_NS): + networks.append(self._to_network(element, locations)) + + return networks + + def _to_network(self, element, locations): + multicast = False + + if findtext(element, "multicast", NETWORK_NS) == "true": + multicast = True + + status = self._to_status(element.find(fixxpath("status", NETWORK_NS))) + + location_id = findtext(element, "location", NETWORK_NS) + location = list(filter(lambda x: x.id == location_id, locations))[0] + + return NttCisNetwork( + id=findtext(element, "id", NETWORK_NS), + name=findtext(element, "name", NETWORK_NS), + description=findtext(element, "description", NETWORK_NS), + location=location, + private_net=findtext(element, "privateNet", NETWORK_NS), + multicast=multicast, + status=status, + ) + + def _to_network_domains(self, object): + network_domains = [] + locations = self.list_locations() + + for element in findall(object, "networkDomain", TYPES_URN): + network_domains.append(self._to_network_domain(element, locations)) + + return network_domains + + def _to_network_domain(self, element, locations): + location_id = element.get("datacenterId") + location = list(filter(lambda x: x.id == location_id, locations))[0] + plan = findtext(element, "type", TYPES_URN) + + if plan == "ESSENTIALS": + plan_type = NetworkDomainServicePlan.ESSENTIALS + else: + plan_type = NetworkDomainServicePlan.ADVANCED + + return NttCisNetworkDomain( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + description=findtext(element, "description", TYPES_URN), + plan=plan_type, + location=location, + status=findtext(element, "state", TYPES_URN), + ) + + def _to_vlans(self, object): + vlans = [] + locations = self.list_locations() + + for element in findall(object, "vlan", TYPES_URN): + vlans.append(self._to_vlan(element, locations=locations)) + + return vlans + + def _to_vlan(self, element, locations): + location_id = element.get("datacenterId") + location = list(filter(lambda x: x.id == location_id, locations))[0] + ip_range = element.find(fixxpath("privateIpv4Range", TYPES_URN)) + ip6_range = element.find(fixxpath("ipv6Range", TYPES_URN)) + network_domain_el = element.find(fixxpath("networkDomain", TYPES_URN)) + network_domain = self.ex_get_network_domain(network_domain_el.get("id")) + + return NttCisVlan( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + description=findtext(element, "description", TYPES_URN), + network_domain=network_domain, + private_ipv4_range_address=ip_range.get("address"), + private_ipv4_range_size=int(ip_range.get("prefixSize")), + ipv6_range_address=ip6_range.get("address"), + ipv6_range_size=int(ip6_range.get("prefixSize")), + ipv4_gateway=findtext(element, "ipv4GatewayAddress", TYPES_URN), + ipv6_gateway=findtext(element, "ipv6GatewayAddress", TYPES_URN), + location=location, + status=findtext(element, "state", TYPES_URN), + ) + + def _to_locations(self, object): + locations = [] + + for element in object.findall(fixxpath("datacenter", TYPES_URN)): + locations.append(self._to_location(element)) + + return locations + + def _to_location(self, element): + loc = NodeLocation( + id=element.get("id"), + name=findtext(element, "displayName", TYPES_URN), + country=findtext(element, "country", TYPES_URN), + driver=self, + ) + + return loc + + def _to_cpu_spec(self, element): + return NttCisServerCpuSpecification( + cpu_count=int(element.get("count")), + cores_per_socket=int(element.get("coresPerSocket")), + performance=element.get("speed"), + ) + + def _to_vmware_tools(self, element): + status = None + + if hasattr(element, "runningStatus"): + status = element.get("runningStatus") + + version_status = None + + if hasattr(element, "version_status"): + version_status = element.get("version_status") + + api_version = None + + if hasattr(element, "apiVersion"): + api_version = element.get("apiVersion") + + return NttCisServerVMWareTools( + status=status, version_status=version_status, api_version=api_version + ) + + def _to_scsi_controllers(self, elements): + return NttCisScsiController( + id=elements.get("id"), + adapter_type=elements.get("adapterType"), + bus_number=elements.get("busNumber"), + state=elements.get("state"), + ) + + def _to_disks(self, object): + disk_elements = object.findall(fixxpath("disk", TYPES_URN)) + + return [self._to_disk(el) for el in disk_elements] + + def _to_disk(self, element): + return NttCisServerDisk( + id=element.get("id"), + scsi_id=int(element.get("scsiId")), + size_gb=int(element.get("sizeGb")), + speed=element.get("speed"), + state=element.get("state"), + ) + + def _to_snapshots(self, object): + """ + Takes an xml object and gathers indivicual elements + :param object: XML data + :return: list of dictionaries with keys + id + start_time + end_time + expiry_time + type of snapshot + state + """ + + snapshot_elements = object.findall(fixxpath("snapshot", TYPES_URN)) + + return [self._to_snapshot(el) for el in snapshot_elements] + + def _to_snapshot(self, element): + return { + "id": element.get("id"), + "start_time": findtext(element, "startTime", TYPES_URN), + "end_time": findtext(element, "endTime", TYPES_URN), + "expiry_time": findtext(element, "expiryTime", TYPES_URN), + "type": findtext(element, "type", TYPES_URN), + "state": findtext(element, "state", TYPES_URN), + } + + def _to_ipv4_addresses(self, object): + ipv4_address_elements = object.findall(fixxpath("ipv4", TYPES_URN)) + + return [self._to_ipv4_6_address(el) for el in ipv4_address_elements] + + def _to_ipv6_addresses(self, object): + ipv6_address_elements = object.findall(fixxpath("reservedIpv6Address", TYPES_URN)) + + return [self._to_ipv4_6_address(el) for el in ipv6_address_elements] + + def _to_ipv4_6_address(self, element): + return NttCisReservedIpAddress( + element.get("datacenterId"), + element.get("exclusive"), + findtext(element, "vlanId", TYPES_URN), + findtext(element, "ipAddress", TYPES_URN), + description=findtext(element, "description", TYPES_URN), + ) + + def _to_windows(self, object): + snapshot_window_elements = object.findall(fixxpath("snapshotWindow", TYPES_URN)) + + return [self._to_window(el) for el in snapshot_window_elements] + + def _to_window(self, element): + return { + "id": element.get("id"), + "day_of_week": element.get("dayOfWeek"), + "start_hour": element.get("startHour"), + "availability_status": element.get("availabilityStatus"), + } + + def _to_nodes(self, object): + node_elements = object.findall(fixxpath("server", TYPES_URN)) + + return [self._to_node(el) for el in node_elements] + + def _to_node(self, element): + # Get all information at once and process in common/nttcis + # Below, future to dynamically generate classes + # return process_xml(ET.tostring(element)) + started = findtext(element, "started", TYPES_URN) + status = self._to_status(element.find(fixxpath("progress", TYPES_URN))) + dd_state = findtext(element, "state", TYPES_URN) + + node_state = self._get_node_state(dd_state, started, status.action) + + has_network_info = element.find(fixxpath("networkInfo", TYPES_URN)) is not None + cpu_spec = self._to_cpu_spec(element.find(fixxpath("cpu", TYPES_URN))) + + has_snapshot = element.find(fixxpath("snapshotService", TYPES_URN)) is not None + has_scsi = element.find(fixxpath("scsiController", TYPES_URN)) is not None + has_sata = element.find(fixxpath("sataController", TYPES_URN)) is not None + has_ide = element.find(fixxpath("ideController")) is not None + scsi_controllers = [] + disks = [] + + if has_scsi: + scsi_controllers.append( + self._to_scsi_controllers(element.find(fixxpath("scsiController", TYPES_URN))) + ) + + for scsi in element.findall(fixxpath("scsiController", TYPES_URN)): + disks.extend(self._to_disks(scsi)) + + if has_sata: + for sata in element.findall(fixxpath("sataController", TYPES_URN)): + disks.extend(self._to_disks(sata)) + + if has_ide: + for ide in element.findall(fixxpath("ideController", TYPES_URN)): + disks.extend(self._to_snapshot(ide)) + + # Vmware Tools + + # Version 2.3 or earlier + + if LooseVersion(self.connection.active_api_version) < LooseVersion("2.4"): + vmware_tools = self._to_vmware_tools(element.find(fixxpath("vmwareTools", TYPES_URN))) + operation_system = element.find(fixxpath("operatingSystem", TYPES_URN)) + # Version 2.4 or later + else: + # vmtools_elm = fixxpath('guest/vmTools', TYPES_URN) + vmtools_elm = element.find(fixxpath("guest/vmTools", TYPES_URN)) + + if vmtools_elm is not None: + vmware_tools = self._to_vmware_tools(vmtools_elm) + else: + vmware_tools = NttCisServerVMWareTools( + status=None, version_status=None, api_version=None + ) + operation_system = element.find(fixxpath("guest/operatingSystem", TYPES_URN)) + + extra = { + "description": findtext(element, "description", TYPES_URN), + "sourceImageId": findtext(element, "sourceImageId", TYPES_URN), + "networkId": findtext(element, "networkId", TYPES_URN), + "networkDomainId": ( + element.find(fixxpath("networkInfo", TYPES_URN)).get("networkDomainId") + if has_network_info + else None + ), + "datacenterId": element.get("datacenterId"), + "deployedTime": findtext(element, "createTime", TYPES_URN), + "window": ( + ( + element.find(fixxpath("snapshotService/window", TYPES_URN)).get("dayOfWeek"), + element.find(fixxpath("snapshotService/window", TYPES_URN)).get("startHour"), + ) + if has_snapshot + else None + ), + "cpu": cpu_spec, + "memoryMb": int(findtext(element, "memoryGb", TYPES_URN)) * 1024, + "OS_id": operation_system.get("id"), + "OS_type": operation_system.get("family"), + "OS_displayName": operation_system.get("displayName"), + "status": status, + "scsi_controller": scsi_controllers, + "disks": disks, + "vmWareTools": vmware_tools, + } + + public_ip = findtext(element, "publicIpAddress", TYPES_URN) + + private_ip = ( + element.find(fixxpath("networkInfo/primaryNic", TYPES_URN)).get("privateIpv4") + if has_network_info + else element.find(fixxpath("nic", TYPES_URN)).get("privateIpv4") + ) + + extra["ipv6"] = ( + element.find(fixxpath("networkInfo/primaryNic", TYPES_URN)).get("ipv6") + if has_network_info + else element.find(fixxpath("nic", TYPES_URN)).get("ipv6") + ) + + n = Node( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + state=node_state, + public_ips=[public_ip] if public_ip is not None else [], + private_ips=[private_ip] if private_ip is not None else [], + size=self.list_sizes()[0], + image=NodeImage( + extra["sourceImageId"], extra["OS_displayName"], self.connection.driver + ), + driver=self.connection.driver, + extra=extra, + ) + + return n + + def _to_status(self, element): + if element is None: + return NttCisStatus() + s = NttCisStatus( + action=findtext(element, "action", TYPES_URN), + request_time=findtext(element, "requestTime", TYPES_URN), + user_name=findtext(element, "userName", TYPES_URN), + number_of_steps=findtext(element, "numberOfSteps", TYPES_URN), + step_name=findtext(element, "step/name", TYPES_URN), + step_number=findtext(element, "step_number", TYPES_URN), + step_percent_complete=findtext(element, "step/percentComplete", TYPES_URN), + failure_reason=findtext(element, "failureReason", TYPES_URN), + ) + + return s + + def _to_ip_address_lists(self, object): + ip_address_lists = [] + + for element in findall(object, "ipAddressList", TYPES_URN): + ip_address_lists.append(self._to_ip_address_list(element)) + + return ip_address_lists + + def _to_ip_address_list(self, element): + ipAddresses = [] + + for ip in findall(element, "ipAddress", TYPES_URN): + ipAddresses.append(self._to_ip_address(ip)) + + child_ip_address_lists = [] + + for child_ip_list in findall(element, "childIpAddressList", TYPES_URN): + child_ip_address_lists.append(self._to_child_ip_list(child_ip_list)) + + return NttCisIpAddressList( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + description=findtext(element, "description", TYPES_URN), + ip_version=findtext(element, "ipVersion", TYPES_URN), + ip_address_collection=ipAddresses, + state=findtext(element, "state", TYPES_URN), + create_time=findtext(element, "createTime", TYPES_URN), + child_ip_address_lists=child_ip_address_lists, + ) + + def _to_child_ip_list(self, element): + return NttCisChildIpAddressList(id=element.get("id"), name=element.get("name")) + + def _to_ip_address(self, element): + return NttCisIpAddress( + begin=element.get("begin"), + end=element.get("end"), + prefix_size=element.get("prefixSize"), + ) + + def _to_port_lists(self, object): + port_lists = [] + + for element in findall(object, "portList", TYPES_URN): + port_lists.append(self._to_port_list(element)) + + return port_lists + + def _to_port_list(self, element): + ports = [] + + for port in findall(element, "port", TYPES_URN): + ports.append(self._to_port(element=port)) + + child_portlist_list = [] + + for child in findall(element, "childPortList", TYPES_URN): + child_portlist_list.append(self._to_child_port_list(element=child)) + + return NttCisPortList( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + description=findtext(element, "description", TYPES_URN), + port_collection=ports, + child_portlist_list=child_portlist_list, + state=findtext(element, "state", TYPES_URN), + create_time=findtext(element, "createTime", TYPES_URN), + ) + + def _image_needs_auth(self, image): + if not isinstance(image, NodeImage): + image = self.ex_get_image_by_id(image) + + if image.extra["isCustomerImage"] and image.extra["OS_type"] == "UNIX": + return False + + return True + + @staticmethod + def _to_port(element): + return NttCisPort(begin=element.get("begin"), end=element.get("end")) + + @staticmethod + def _to_child_port_list(element): + return NttCisChildPortList(id=element.get("id"), name=element.get("name")) + + @staticmethod + def _get_node_state(state, started, action): + try: + return NODE_STATE_MAP[(state, started, action)] + except KeyError: + if started == "true": + return NodeState.RUNNING + else: + return NodeState.TERMINATED + + @staticmethod + def _node_to_node_id(node): + return dd_object_to_id(node, Node) + + @staticmethod + def _location_to_location_id(location): + return dd_object_to_id(location, NodeLocation) + + @staticmethod + def _vlan_to_vlan_id(vlan): + return dd_object_to_id(vlan, NttCisVlan) + + @staticmethod + def _image_to_image_id(image): + return dd_object_to_id(image, NodeImage) + + @staticmethod + def _network_to_network_id(network): + return dd_object_to_id(network, NttCisNetwork) + + @staticmethod + def _anti_affinity_rule_to_anti_affinity_rule_id(rule): + return dd_object_to_id(rule, NttCisAntiAffinityRule) + + @staticmethod + def _network_domain_to_network_domain_id(network_domain): + return dd_object_to_id(network_domain, NttCisNetworkDomain) + + @staticmethod + def _tag_key_to_tag_key_id(tag_key): + return dd_object_to_id(tag_key, NttCisTagKey) + + @staticmethod + def _tag_key_to_tag_key_name(tag_key): + return dd_object_to_id(tag_key, NttCisTagKey, id_value="name") + + @staticmethod + def _ip_address_list_to_ip_address_list_id(ip_addr_list): + return dd_object_to_id(ip_addr_list, NttCisIpAddressList, id_value="id") + + @staticmethod + def _child_ip_address_list_to_child_ip_address_list_id(child_ip_addr_list): + return dd_object_to_id(child_ip_addr_list, NttCisChildIpAddressList, id_value="id") + + @staticmethod + def _port_list_to_port_list_id(port_list): + return dd_object_to_id(port_list, NttCisPortList, id_value="id") + + @staticmethod + def _child_port_list_to_child_port_list_id(child_port_list): + return dd_object_to_id(child_port_list, NttCisChildPortList, id_value="id") + + @staticmethod + def _str2bool(string): + return string.lower() in ("true") diff --git a/libcloud/compute/drivers/onapp.py b/libcloud/compute/drivers/onapp.py new file mode 100644 index 0000000000..76ab8fd069 --- /dev/null +++ b/libcloud/compute/drivers/onapp.py @@ -0,0 +1,416 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json + +from libcloud.utils.py3 import httplib +from libcloud.common.onapp import OnAppConnection +from libcloud.compute.base import Node, KeyPair, NodeImage, NodeDriver +from libcloud.utils.networking import is_private_subnet +from libcloud.compute.providers import Provider + +__all__ = ["OnAppNodeDriver"] + +""" +Define the extra dictionary for specific resources +""" +RESOURCE_EXTRA_ATTRIBUTES_MAP = { + "node": { + "add_to_marketplace": { + "key_name": "add_to_marketplace", + "transform_func": bool, + }, + "admin_note": {"key_name": "admin_note", "transform_func": str}, + "allow_resize_without_reboot": { + "key_name": "allow_resize_without_reboot", + "transform_func": bool, + }, + "allowed_hot_migrate": { + "key_name": "allowed_hot_migrate", + "transform_func": bool, + }, + "allowed_swap": {"key_name": "allowed_swap", "transform_func": bool}, + "booted": {"key_name": "booted", "transform_func": bool}, + "built": {"key_name": "built", "transform_func": bool}, + "cpu_priority": {"key_name": "cpu_priority", "transform_func": int}, + "cpu_shares": {"key_name": "cpu_shares", "transform_func": int}, + "cpu_sockets": {"key_name": "cpu_sockets", "transform_func": int}, + "cpu_threads": {"key_name": "cpu_threads", "transform_func": int}, + "cpu_units": {"key_name": "cpu_units", "transform_func": int}, + "cpus": {"key_name": "cpus", "transform_func": int}, + "created_at": {"key_name": "created_at", "transform_func": str}, + "customer_network_id": { + "key_name": "customer_network_id", + "transform_func": str, + }, + "deleted_at": {"key_name": "deleted_at", "transform_func": str}, + "edge_server_type": {"key_name": "edge_server_type", "transform_func": str}, + "enable_autoscale": {"key_name": "enable_autoscale", "transform_func": bool}, + "enable_monitis": {"key_name": "enable_monitis", "transform_func": bool}, + "firewall_notrack": {"key_name": "firewall_notrack", "transform_func": bool}, + "hostname": {"key_name": "hostname", "transform_func": str}, + "hypervisor_id": {"key_name": "hypervisor_id", "transform_func": int}, + "id": {"key_name": "id", "transform_func": int}, + "initial_root_password": { + "key_name": "initial_root_password", + "transform_func": str, + }, + "initial_root_password_encrypted": { + "key_name": "initial_root_password_encrypted", + "transform_func": bool, + }, + "local_remote_access_ip_address": { + "key_name": "local_remote_access_ip_address", + "transform_func": str, + }, + "local_remote_access_port": { + "key_name": "local_remote_access_port", + "transform_func": int, + }, + "locked": {"key_name": "locked", "transform_func": bool}, + "memory": {"key_name": "memory", "transform_func": int}, + "min_disk_size": {"key_name": "min_disk_size", "transform_func": int}, + "monthly_bandwidth_used": { + "key_name": "monthly_bandwidth_used", + "transform_func": int, + }, + "note": {"key_name": "note", "transform_func": str}, + "operating_system": {"key_name": "operating_system", "transform_func": str}, + "operating_system_distro": { + "key_name": "operating_system_distro", + "transform_func": str, + }, + "preferred_hvs": {"key_name": "preferred_hvs", "transform_func": list}, + "price_per_hour": {"key_name": "price_per_hour", "transform_func": float}, + "price_per_hour_powered_off": { + "key_name": "price_per_hour_powered_off", + "transform_func": float, + }, + "recovery_mode": {"key_name": "recovery_mode", "transform_func": bool}, + "remote_access_password": { + "key_name": "remote_access_password", + "transform_func": str, + }, + "service_password": {"key_name": "service_password", "transform_func": str}, + "state": {"key_name": "state", "transform_func": str}, + "storage_server_type": { + "key_name": "storage_server_type", + "transform_func": str, + }, + "strict_virtual_machine_id": { + "key_name": "strict_virtual_machine_id", + "transform_func": str, + }, + "support_incremental_backups": { + "key_name": "support_incremental_backups", + "transform_func": bool, + }, + "suspended": {"key_name": "suspended", "transform_func": bool}, + "template_id": {"key_name": "template_id", "transform_func": int}, + "template_label": {"key_name": "template_label", "transform_func": str}, + "total_disk_size": {"key_name": "total_disk_size", "transform_func": int}, + "updated_at": {"key_name": "updated_at", "transform_func": str}, + "user_id": {"key_name": "user_id", "transform_func": int}, + "vip": {"key_name": "vip", "transform_func": bool}, + "xen_id": {"key_name": "xen_id", "transform_func": int}, + } +} + + +class OnAppNodeDriver(NodeDriver): + """ + Base OnApp node driver. + """ + + connectionCls = OnAppConnection + type = Provider.ONAPP + name = "OnApp" + website = "http://onapp.com/" + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_memory=None, + ex_cpus=None, + ex_cpu_shares=None, + ex_hostname=None, + ex_template_id=None, + ex_primary_disk_size=None, + ex_swap_disk_size=None, + ex_required_virtual_machine_build=1, + ex_required_ip_address_assignment=1, + **kwargs, + ): + """ + Add a VS + + :param kwargs: All keyword arguments to create a VS + :type kwargs: ``dict`` + + :rtype: :class:`OnAppNode` + """ + server_params = dict( + label=name, + memory=ex_memory, + cpus=ex_cpus, + cpu_shares=ex_cpu_shares, + hostname=ex_hostname, + template_id=ex_template_id, + primary_disk_size=ex_primary_disk_size, + swap_disk_size=ex_swap_disk_size, + required_virtual_machine_build=ex_required_virtual_machine_build, + required_ip_address_assignment=ex_required_ip_address_assignment, + rate_limit=kwargs.get("rate_limit"), + ) + + server_params.update(OnAppNodeDriver._create_args_to_params(**kwargs)) + data = json.dumps({"virtual_machine": server_params}) + + response = self.connection.request( + "/virtual_machines.json", + data=data, + headers={"Content-type": "application/json"}, + method="POST", + ) + + return self._to_node(response.object["virtual_machine"]) + + def destroy_node(self, node, ex_convert_last_backup=0, ex_destroy_all_backups=0): + """ + Delete a VS + + :param node: OnApp node + :type node: :class: `OnAppNode` + + :param convert_last_backup: set 1 to convert the last VS's backup to + template, otherwise set 0 + :type convert_last_backup: ``int`` + + :param destroy_all_backups: set 1 to destroy all existing backups of + this VS, otherwise set 0 + :type destroy_all_backups: ``int`` + """ + server_params = { + "convert_last_backup": ex_convert_last_backup, + "destroy_all_backups": ex_destroy_all_backups, + } + action = "/virtual_machines/{identifier}.json".format(identifier=node.id) + + self.connection.request(action, params=server_params, method="DELETE") + return True + + def list_nodes(self): + """ + List all VS + + :rtype: ``list`` of :class:`OnAppNode` + """ + response = self.connection.request("/virtual_machines.json") + nodes = [] + for vm in response.object: + nodes.append(self._to_node(vm["virtual_machine"])) + return nodes + + def list_images( + self, + location=None, + ): + """ + List all images + + :rtype: ``list`` of :class:`NodeImage` + """ + response = self.connection.request("/templates.json") + templates = [] + for template in response.object: + templates.append(self._to_image(template["image_template"])) + return templates + + def list_key_pairs(self): + """ + List all the available key pair objects. + + :rtype: ``list`` of :class:`.KeyPair` objects + """ + user_id = self.connection.request("/profile.json").object["user"]["id"] + response = self.connection.request("/users/%s/ssh_keys.json" % user_id) + ssh_keys = [] + for ssh_key in response.object: + ssh_keys.append(self._to_key_pair(ssh_key["ssh_key"])) + return ssh_keys + + def get_key_pair(self, name): + """ + Retrieve a single key pair. + + :param name: ID of the key pair to retrieve. + :type name: ``str`` + + :rtype: :class:`.KeyPair` object + """ + user_id = self.connection.request("/profile.json").object["user"]["id"] + response = self.connection.request("/users/{}/ssh_keys/{}.json".format(user_id, name)) + return self._to_key_pair(response.object["ssh_key"]) + + def import_key_pair_from_string(self, name, key_material): + """ + Import a new public key from string. + + :param name: Key pair name (unused). + :type name: ``str`` + + :param key_material: Public key material. + :type key_material: ``str`` + + :rtype: :class:`.KeyPair` object + """ + data = json.dumps({"key": key_material}) + user_id = self.connection.request("/profile.json").object["user"]["id"] + response = self.connection.request( + "/users/%s/ssh_keys.json" % user_id, + data=data, + headers={"Content-type": "application/json"}, + method="POST", + ) + return self._to_key_pair(response.object["ssh_key"]) + + def delete_key_pair( + self, + key_pair, + ): + """ + Delete an existing key pair. + + :param key_pair: Key pair object. + :type key_pair: :class:`.KeyPair` + + :return: True on success + :rtype: ``bool`` + """ + key = key_pair + key_id = key.name + response = self.connection.request("/settings/ssh_keys/%s.json" % key_id, method="DELETE") + return response.status == httplib.NO_CONTENT + + # + # Helper methods + # + + def _to_key_pair(self, data): + extra = {"created_at": data["created_at"], "updated_at": data["updated_at"]} + return KeyPair( + name=data["id"], + fingerprint=None, + public_key=data["key"], + private_key=None, + driver=self, + extra=extra, + ) + + def _to_image(self, template): + extra = { + "distribution": template["operating_system_distro"], + "operating_system": template["operating_system"], + "operating_system_arch": template["operating_system_arch"], + "allow_resize_without_reboot": template["allow_resize_without_reboot"], + "allowed_hot_migrate": template["allowed_hot_migrate"], + "allowed_swap": template["allowed_swap"], + "min_disk_size": template["min_disk_size"], + "min_memory_size": template["min_memory_size"], + "created_at": template["created_at"], + } + return NodeImage(id=template["id"], name=template["label"], driver=self, extra=extra) + + def _to_node(self, data): + identifier = data["identifier"] + name = data["label"] + private_ips = [] + public_ips = [] + for ip in data["ip_addresses"]: + address = ip["ip_address"]["address"] + if is_private_subnet(address): + private_ips.append(address) + else: + public_ips.append(address) + + extra = OnAppNodeDriver._get_extra_dict(data, RESOURCE_EXTRA_ATTRIBUTES_MAP["node"]) + return Node(identifier, name, extra["state"], public_ips, private_ips, self, extra=extra) + + @staticmethod + def _get_extra_dict(response, mapping): + """ + Extract attributes from the element based on rules provided in the + mapping dictionary. + + :param response: The JSON response to parse the values from. + :type response: ``dict`` + + :param mapping: Dictionary with the extra layout + :type mapping: ``dict`` + + :rtype: ``dict`` + """ + extra = {} + for attribute, values in mapping.items(): + transform_func = values["transform_func"] + value = response.get(values["key_name"]) + + extra[attribute] = transform_func(value) if value else None + return extra + + @staticmethod + def _create_args_to_params(**kwargs): + """ + Extract server params from keyword args to create a VS + + :param kwargs: keyword args + :return: ``dict`` + """ + params = [ + "ex_cpu_sockets", + "ex_cpu_threads", + "ex_enable_autoscale", + "ex_data_store_group_primary_id", + "ex_data_store_group_swap_id", + "ex_hypervisor_group_id", + "ex_hypervisor_id", + "ex_initial_root_password", + "ex_note", + "ex_primary_disk_min_iops", + "ex_primary_network_id", + "ex_primary_network_group_id", + "ex_recipe_ids", + "ex_required_automatic_backup", + "ex_required_virtual_machine_startup", + "ex_required_virtual_machine_startup", + "ex_selected_ip_address_id", + "ex_swap_disk_min_iops", + "ex_type_of_format", + "ex_custom_recipe_variables", + "ex_licensing_key", + "ex_licensing_server_id", + "ex_licensing_type", + ] + server_params = {} + + for p in params: + value = kwargs.get(p) + if value: + server_params[p[3:]] = value + return server_params diff --git a/libcloud/compute/drivers/opennebula.py b/libcloud/compute/drivers/opennebula.py index c295cd49f5..d4e2d16955 100644 --- a/libcloud/compute/drivers/opennebula.py +++ b/libcloud/compute/drivers/opennebula.py @@ -20,60 +20,60 @@ OpenNebula.org driver. """ -__docformat__ = 'epytext' +__docformat__ = "epytext" -from base64 import b64encode import hashlib +from base64 import b64encode -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import next -from libcloud.utils.py3 import b - -from libcloud.compute.base import NodeState, NodeDriver, Node, NodeLocation -from libcloud.common.base import ConnectionUserAndKey, XmlResponse -from libcloud.compute.base import NodeImage, NodeSize, StorageVolume +from libcloud.utils.py3 import ET, b, next, httplib +from libcloud.common.base import XmlResponse, ConnectionUserAndKey from libcloud.common.types import InvalidCredsError +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeState, + NodeDriver, + NodeLocation, + StorageVolume, +) from libcloud.compute.providers import Provider __all__ = [ - 'ACTION', - 'OpenNebulaResponse', - 'OpenNebulaConnection', - 'OpenNebulaNodeSize', - 'OpenNebulaNetwork', - 'OpenNebulaNodeDriver', - 'OpenNebula_1_4_NodeDriver', - 'OpenNebula_2_0_NodeDriver', - 'OpenNebula_3_0_NodeDriver', - 'OpenNebula_3_2_NodeDriver', - 'OpenNebula_3_8_NodeDriver'] - -API_HOST = '' + "ACTION", + "OpenNebulaResponse", + "OpenNebulaConnection", + "OpenNebulaNodeSize", + "OpenNebulaNetwork", + "OpenNebulaNodeDriver", + "OpenNebula_1_4_NodeDriver", + "OpenNebula_2_0_NodeDriver", + "OpenNebula_3_0_NodeDriver", + "OpenNebula_3_2_NodeDriver", + "OpenNebula_3_8_NodeDriver", +] + +API_HOST = "" API_PORT = (4567, 443) API_SECURE = True API_PLAIN_AUTH = False -DEFAULT_API_VERSION = '3.2' +DEFAULT_API_VERSION = "3.2" -class ACTION(object): +class ACTION: """ All actions, except RESUME, only apply when the VM is in the "Running" state. """ - STOP = 'STOPPED' + STOP = "STOPPED" """ The VM is stopped, and its memory state stored to a checkpoint file. VM state, and disk image, are transferred back to the front-end. Resuming the VM requires the VM instance to be re-scheduled. """ - SUSPEND = 'SUSPENDED' + SUSPEND = "SUSPENDED" """ The VM is stopped, and its memory state stored to a checkpoint file. The VM state, and disk image, are left on the host to be resumed later. Resuming @@ -81,21 +81,21 @@ class ACTION(object): suspending, the VM resources are reserved for later resuming. """ - RESUME = 'RESUME' + RESUME = "RESUME" """ The VM is resumed using the saved memory state from the checkpoint file, and the VM's disk image. The VM is either started immediately, or re-scheduled depending on how it was suspended. """ - CANCEL = 'CANCEL' + CANCEL = "CANCEL" """ The VM is forcibly shutdown, its memory state is deleted. If a persistent disk image was used, that disk image is transferred back to the front-end. Any non-persistent disk images are deleted. """ - SHUTDOWN = 'SHUTDOWN' + SHUTDOWN = "SHUTDOWN" """ The VM is gracefully shutdown by sending the ACPI signal. If the VM does not shutdown, then it is considered to still be running. If successfully, @@ -104,14 +104,14 @@ class ACTION(object): disk images are deleted. """ - REBOOT = 'REBOOT' + REBOOT = "REBOOT" """ Introduced in OpenNebula v3.2. The VM is gracefully restarted by sending the ACPI signal. """ - DONE = 'DONE' + DONE = "DONE" """ The VM is forcibly shutdown, its memory state is deleted. If a persistent disk image was used, that disk image is transferred back to the front-end. @@ -133,7 +133,8 @@ def success(self): :return: True is success, else False. """ i = int(self.status) - return i >= 200 and i <= 299 + + return 200 <= i <= 299 def parse_error(self): """ @@ -144,8 +145,10 @@ def parse_error(self): :rtype: :class:`ElementTree` :return: Contents of HTTP response body. """ + if int(self.status) == httplib.UNAUTHORIZED: raise InvalidCredsError(self.body) + return self.body @@ -162,9 +165,9 @@ class OpenNebulaConnection(ConnectionUserAndKey): responseCls = OpenNebulaResponse def __init__(self, *args, **kwargs): - if 'plain_auth' in kwargs: - self.plain_auth = kwargs.pop('plain_auth') - super(OpenNebulaConnection, self).__init__(*args, **kwargs) + if "plain_auth" in kwargs: + self.plain_auth = kwargs.pop("plain_auth") + super().__init__(*args, **kwargs) def add_default_headers(self, headers): """ @@ -179,13 +182,15 @@ def add_default_headers(self, headers): :rtype: ``dict`` :return: Dictionary containing updated headers. """ + if self.plain_auth: passwd = self.key else: - passwd = hashlib.sha1(b(self.key)).hexdigest() - headers['Authorization'] =\ - ('Basic %s' % b64encode(b('%s:%s' % (self.user_id, - passwd))).decode('utf-8')) + passwd = hashlib.sha1(b(self.key)).hexdigest() # nosec + headers["Authorization"] = "Basic %s" % b64encode( + b("{}:{}".format(self.user_id, passwd)) + ).decode("utf-8") + return headers @@ -194,23 +199,37 @@ class OpenNebulaNodeSize(NodeSize): NodeSize class for the OpenNebula.org driver. """ - def __init__(self, id, name, ram, disk, bandwidth, price, driver, - cpu=None, vcpu=None): - super(OpenNebulaNodeSize, self).__init__(id=id, name=name, ram=ram, - disk=disk, - bandwidth=bandwidth, - price=price, driver=driver) + def __init__(self, id, name, ram, disk, bandwidth, price, driver, cpu=None, vcpu=None): + super().__init__( + id=id, + name=name, + ram=ram, + disk=disk, + bandwidth=bandwidth, + price=price, + driver=driver, + ) self.cpu = cpu self.vcpu = vcpu def __repr__(self): - return (('') - % (self.id, self.name, self.ram, self.disk, self.bandwidth, - self.price, self.driver.name, self.cpu, self.vcpu)) - - -class OpenNebulaNetwork(object): + return ( + "" + ) % ( + self.id, + self.name, + self.ram, + self.disk, + self.bandwidth, + self.price, + self.driver.name, + self.cpu, + self.vcpu, + ) + + +class OpenNebulaNetwork: """ Provide a common interface for handling networks of all types. @@ -247,10 +266,10 @@ def get_uuid(self): The hash is a function of an SHA1 hash of the network's ID and its driver which means that it should be unique between all - networks. In some subclasses (e.g. GoGrid) there is no ID - available so the public IP address is used. This means that, - unlike a properly done system UUID, the same UUID may mean a - different system install at a different time + networks. In some subclasses there is no ID available so the + public IP address is used. This means that, unlike a properly + done system UUID, the same UUID may mean a different system + install at a different time >>> from libcloud.network.drivers.dummy import DummyNetworkDriver >>> driver = DummyNetworkDriver() @@ -264,14 +283,13 @@ def get_uuid(self): :rtype: ``str`` :return: Unique identifier for this instance. """ - return hashlib.sha1(b("%s:%s" % (self.id, - self.driver.type))).hexdigest() + + return hashlib.sha1(b("{}:{}".format(self.id, self.driver.type))).hexdigest() # nosec def __repr__(self): - return (('') - % (self.uuid, self.name, self.address, self.size, - self.driver.name)) + return ( + "" + ) % (self.uuid, self.name, self.address, self.size, self.driver.name) class OpenNebulaNodeDriver(NodeDriver): @@ -280,46 +298,48 @@ class OpenNebulaNodeDriver(NodeDriver): """ connectionCls = OpenNebulaConnection - name = 'OpenNebula' - website = 'http://opennebula.org/' + name = "OpenNebula" + website = "http://opennebula.org/" type = Provider.OPENNEBULA NODE_STATE_MAP = { - 'INIT': NodeState.PENDING, - 'PENDING': NodeState.PENDING, - 'HOLD': NodeState.PENDING, - 'ACTIVE': NodeState.RUNNING, - 'STOPPED': NodeState.TERMINATED, - 'SUSPENDED': NodeState.PENDING, - 'DONE': NodeState.TERMINATED, - 'FAILED': NodeState.TERMINATED} - - def __new__(cls, key, secret=None, api_version=DEFAULT_API_VERSION, - **kwargs): + "INIT": NodeState.PENDING, + "PENDING": NodeState.PENDING, + "HOLD": NodeState.PENDING, + "ACTIVE": NodeState.RUNNING, + "STOPPED": NodeState.TERMINATED, + "SUSPENDED": NodeState.PENDING, + "DONE": NodeState.TERMINATED, + "FAILED": NodeState.TERMINATED, + } + + def __new__(cls, key, secret=None, api_version=DEFAULT_API_VERSION, **kwargs): if cls is OpenNebulaNodeDriver: - if api_version in ['1.4']: + if api_version in ["1.4"]: cls = OpenNebula_1_4_NodeDriver - elif api_version in ['2.0', '2.2']: + elif api_version in ["2.0", "2.2"]: cls = OpenNebula_2_0_NodeDriver - elif api_version in ['3.0']: + elif api_version in ["3.0"]: cls = OpenNebula_3_0_NodeDriver - elif api_version in ['3.2']: + elif api_version in ["3.2"]: cls = OpenNebula_3_2_NodeDriver - elif api_version in ['3.6']: + elif api_version in ["3.6"]: cls = OpenNebula_3_6_NodeDriver - elif api_version in ['3.8']: + elif api_version in ["3.8"]: cls = OpenNebula_3_8_NodeDriver - if 'plain_auth' not in kwargs: - kwargs['plain_auth'] = cls.plain_auth + + if "plain_auth" not in kwargs: + kwargs["plain_auth"] = cls.plain_auth else: - cls.plain_auth = kwargs['plain_auth'] + cls.plain_auth = kwargs["plain_auth"] else: raise NotImplementedError( - "No OpenNebulaNodeDriver found for API version %s" % - (api_version)) - return super(OpenNebulaNodeDriver, cls).__new__(cls) + "No OpenNebulaNodeDriver found for API version %s" % (api_version) + ) + + return super().__new__(cls) - def create_node(self, **kwargs): + def create_node(self, name, size, image, location=None, auth=None, networks=None): """ Create a new OpenNebula node. @@ -330,50 +350,49 @@ def create_node(self, **kwargs): :type networks: :class:`OpenNebulaNetwork` or ``list`` of :class:`OpenNebulaNetwork` """ - compute = ET.Element('COMPUTE') + compute = ET.Element("COMPUTE") + + name = ET.SubElement(compute, "NAME") + name.text = name - name = ET.SubElement(compute, 'NAME') - name.text = kwargs['name'] + instance_type = ET.SubElement(compute, "INSTANCE_TYPE") + instance_type.text = size.name - instance_type = ET.SubElement(compute, 'INSTANCE_TYPE') - instance_type.text = kwargs['size'].name + storage = ET.SubElement(compute, "STORAGE") + ET.SubElement(storage, "DISK", {"image": "%s" % (str(image.id))}) - storage = ET.SubElement(compute, 'STORAGE') - ET.SubElement(storage, - 'DISK', - {'image': '%s' % (str(kwargs['image'].id))}) + if networks: + if not isinstance(networks, list): + networks = [networks] - if 'networks' in kwargs: - if not isinstance(kwargs['networks'], list): - kwargs['networks'] = [kwargs['networks']] + networkGroup = ET.SubElement(compute, "NETWORK") - networkGroup = ET.SubElement(compute, 'NETWORK') - for network in kwargs['networks']: + for network in networks: if network.address: - ET.SubElement(networkGroup, 'NIC', - {'network': '%s' % (str(network.id)), - 'ip': network.address}) + ET.SubElement( + networkGroup, + "NIC", + {"network": "%s" % (str(network.id)), "ip": network.address}, + ) else: - ET.SubElement(networkGroup, 'NIC', - {'network': '%s' % (str(network.id))}) + ET.SubElement(networkGroup, "NIC", {"network": "%s" % (str(network.id))}) xml = ET.tostring(compute) - node = self.connection.request('/compute', method='POST', - data=xml).object + node = self.connection.request("/compute", method="POST", data=xml).object return self._to_node(node) def destroy_node(self, node): - url = '/compute/%s' % (str(node.id)) - resp = self.connection.request(url, method='DELETE') + url = "/compute/%s" % (str(node.id)) + resp = self.connection.request(url, method="DELETE") return resp.status == httplib.OK def list_nodes(self): - return self._to_nodes(self.connection.request('/compute').object) + return self._to_nodes(self.connection.request("/compute").object) def list_images(self, location=None): - return self._to_images(self.connection.request('/storage').object) + return self._to_images(self.connection.request("/storage").object) def list_sizes(self, location=None): """ @@ -384,32 +403,39 @@ def list_sizes(self, location=None): :return: List of compute node sizes supported by the cloud provider. :rtype: ``list`` of :class:`OpenNebulaNodeSize` """ + return [ - NodeSize(id=1, - name='small', - ram=None, - disk=None, - bandwidth=None, - price=None, - driver=self), - NodeSize(id=2, - name='medium', - ram=None, - disk=None, - bandwidth=None, - price=None, - driver=self), - NodeSize(id=3, - name='large', - ram=None, - disk=None, - bandwidth=None, - price=None, - driver=self), + NodeSize( + id=1, + name="small", + ram=None, + disk=None, + bandwidth=None, + price=None, + driver=self, + ), + NodeSize( + id=2, + name="medium", + ram=None, + disk=None, + bandwidth=None, + price=None, + driver=self, + ), + NodeSize( + id=3, + name="large", + ram=None, + disk=None, + bandwidth=None, + price=None, + driver=self, + ), ] def list_locations(self): - return [NodeLocation(0, '', '', self)] + return [NodeLocation(0, "", "", self)] def ex_list_networks(self, location=None): """ @@ -423,7 +449,8 @@ def ex_list_networks(self, location=None): compute node. :rtype: ``list`` of :class:`OpenNebulaNetwork` """ - return self._to_networks(self.connection.request('/network').object) + + return self._to_networks(self.connection.request("/network").object) def ex_node_action(self, node, action): """ @@ -445,19 +472,18 @@ def ex_node_action(self, node, action): """ compute_node_id = str(node.id) - compute = ET.Element('COMPUTE') + compute = ET.Element("COMPUTE") - compute_id = ET.SubElement(compute, 'ID') + compute_id = ET.SubElement(compute, "ID") compute_id.text = compute_node_id - state = ET.SubElement(compute, 'STATE') + state = ET.SubElement(compute, "STATE") state.text = action xml = ET.tostring(compute) - url = '/compute/%s' % compute_node_id - resp = self.connection.request(url, method='PUT', - data=xml) + url = "/compute/%s" % compute_node_id + resp = self.connection.request(url, method="PUT", data=xml) if resp.status == httplib.BAD_REQUEST: return False @@ -477,10 +503,10 @@ def _to_images(self, object): :return: List of images. """ images = [] - for element in object.findall('DISK'): - image_id = element.attrib['href'].partition('/storage/')[2] - image = self.connection.request( - ('/storage/%s' % (image_id))).object + + for element in object.findall("DISK"): + image_id = element.attrib["href"].partition("/storage/")[2] + image = self.connection.request("/storage/%s" % (image_id)).object images.append(self._to_image(image)) return images @@ -496,11 +522,13 @@ def _to_image(self, image): :rtype: :class:`NodeImage` :return: The newly extracted :class:`NodeImage`. """ - return NodeImage(id=image.findtext('ID'), - name=image.findtext('NAME'), - driver=self.connection.driver, - extra={'size': image.findtext('SIZE'), - 'url': image.findtext('URL')}) + + return NodeImage( + id=image.findtext("ID"), + name=image.findtext("NAME"), + driver=self.connection.driver, + extra={"size": image.findtext("SIZE"), "url": image.findtext("URL")}, + ) def _to_networks(self, object): """ @@ -515,10 +543,10 @@ def _to_networks(self, object): :return: List of virtual networks. """ networks = [] - for element in object.findall('NETWORK'): - network_id = element.attrib['href'].partition('/network/')[2] - network_element = self.connection.request( - ('/network/%s' % (network_id))).object + + for element in object.findall("NETWORK"): + network_id = element.attrib["href"].partition("/network/")[2] + network_element = self.connection.request("/network/%s" % (network_id)).object networks.append(self._to_network(network_element)) return networks @@ -534,11 +562,14 @@ def _to_network(self, element): :rtype: :class:`OpenNebulaNetwork` :return: The newly extracted :class:`OpenNebulaNetwork`. """ - return OpenNebulaNetwork(id=element.findtext('ID'), - name=element.findtext('NAME'), - address=element.findtext('ADDRESS'), - size=element.findtext('SIZE'), - driver=self.connection.driver) + + return OpenNebulaNetwork( + id=element.findtext("ID"), + name=element.findtext("NAME"), + address=element.findtext("ADDRESS"), + size=element.findtext("SIZE"), + driver=self.connection.driver, + ) def _to_nodes(self, object): """ @@ -553,10 +584,10 @@ def _to_nodes(self, object): :return: A list of compute nodes. """ computes = [] - for element in object.findall('COMPUTE'): - compute_id = element.attrib['href'].partition('/compute/')[2] - compute = self.connection.request( - ('/compute/%s' % (compute_id))).object + + for element in object.findall("COMPUTE"): + compute_id = element.attrib["href"].partition("/compute/")[2] + compute = self.connection.request("/compute/%s" % (compute_id)).object computes.append(self._to_node(compute)) return computes @@ -576,17 +607,19 @@ def _to_node(self, compute): :return: The newly extracted :class:`Node`. """ try: - state = self.NODE_STATE_MAP[compute.findtext('STATE').upper()] + state = self.NODE_STATE_MAP[compute.findtext("STATE").upper()] except KeyError: state = NodeState.UNKNOWN - return Node(id=compute.findtext('ID'), - name=compute.findtext('NAME'), - state=state, - public_ips=self._extract_networks(compute), - private_ips=[], - driver=self.connection.driver, - image=self._extract_images(compute)) + return Node( + id=compute.findtext("ID"), + name=compute.findtext("NAME"), + state=state, + public_ips=self._extract_networks(compute), + private_ips=[], + driver=self.connection.driver, + image=self._extract_images(compute), + ) def _extract_networks(self, compute): """ @@ -603,14 +636,18 @@ def _extract_networks(self, compute): """ networks = list() - network_list = compute.find('NETWORK') - for element in network_list.findall('NIC'): + network_list = compute.find("NETWORK") + + for element in network_list.findall("NIC"): networks.append( - OpenNebulaNetwork(id=element.attrib.get('network', None), - name=None, - address=element.attrib.get('ip', None), - size=1, - driver=self.connection.driver)) + OpenNebulaNetwork( + id=element.attrib.get("network", None), + name=None, + address=element.attrib.get("ip", None), + size=1, + driver=self.connection.driver, + ) + ) return networks @@ -629,17 +666,22 @@ def _extract_images(self, compute): """ disks = list() - disk_list = compute.find('STORAGE') + disk_list = compute.find("STORAGE") + if disk_list is not None: - for element in disk_list.findall('DISK'): + for element in disk_list.findall("DISK"): disks.append( - NodeImage(id=element.attrib.get('image', None), - name=None, - driver=self.connection.driver, - extra={'dev': element.attrib.get('dev', None)})) + NodeImage( + id=element.attrib.get("image", None), + name=None, + driver=self.connection.driver, + extra={"dev": element.attrib.get("dev", None)}, + ) + ) # @TODO: Return all disks when the Node type accepts multiple # attached disks per node. + if len(disks) > 0: return disks[0] else: @@ -651,7 +693,7 @@ class OpenNebula_1_4_NodeDriver(OpenNebulaNodeDriver): OpenNebula.org node driver for OpenNebula.org v1.4. """ - name = 'OpenNebula (v1.4)' + name = "OpenNebula (v1.4)" class OpenNebula_2_0_NodeDriver(OpenNebulaNodeDriver): @@ -660,9 +702,9 @@ class OpenNebula_2_0_NodeDriver(OpenNebulaNodeDriver): v2.2. """ - name = 'OpenNebula (v2.0 - v2.2)' + name = "OpenNebula (v2.0 - v2.2)" - def create_node(self, **kwargs): + def create_node(self, name, size, image, location=None, auth=None, networks=None, context=None): """ Create a new OpenNebula node. @@ -680,47 +722,44 @@ def create_node(self, **kwargs): :return: Instance of a newly created node. :rtype: :class:`Node` """ - compute = ET.Element('COMPUTE') + compute = ET.Element("COMPUTE") + + name = ET.SubElement(compute, "NAME") + name.text = name - name = ET.SubElement(compute, 'NAME') - name.text = kwargs['name'] + instance_type = ET.SubElement(compute, "INSTANCE_TYPE") + instance_type.text = size.name - instance_type = ET.SubElement(compute, 'INSTANCE_TYPE') - instance_type.text = kwargs['size'].name + disk = ET.SubElement(compute, "DISK") + ET.SubElement(disk, "STORAGE", {"href": "/storage/%s" % (str(image.id))}) - disk = ET.SubElement(compute, 'DISK') - ET.SubElement(disk, - 'STORAGE', - {'href': '/storage/%s' % (str(kwargs['image'].id))}) + if networks: + if not isinstance(networks, list): + networks = [networks] - if 'networks' in kwargs: - if not isinstance(kwargs['networks'], list): - kwargs['networks'] = [kwargs['networks']] + for network in networks: + nic = ET.SubElement(compute, "NIC") + ET.SubElement(nic, "NETWORK", {"href": "/network/%s" % (str(network.id))}) - for network in kwargs['networks']: - nic = ET.SubElement(compute, 'NIC') - ET.SubElement(nic, 'NETWORK', - {'href': '/network/%s' % (str(network.id))}) if network.address: - ip_line = ET.SubElement(nic, 'IP') + ip_line = ET.SubElement(nic, "IP") ip_line.text = network.address - if 'context' in kwargs: - if isinstance(kwargs['context'], dict): - contextGroup = ET.SubElement(compute, 'CONTEXT') - for key, value in list(kwargs['context'].items()): - context = ET.SubElement(contextGroup, key.upper()) - context.text = value + if context and isinstance(context, dict): + contextGroup = ET.SubElement(compute, "CONTEXT") + + for key, value in list(context.items()): + context = ET.SubElement(contextGroup, key.upper()) + context.text = value xml = ET.tostring(compute) - node = self.connection.request('/compute', method='POST', - data=xml).object + node = self.connection.request("/compute", method="POST", data=xml).object return self._to_node(node) def destroy_node(self, node): - url = '/compute/%s' % (str(node.id)) - resp = self.connection.request(url, method='DELETE') + url = "/compute/%s" % (str(node.id)) + resp = self.connection.request(url, method="DELETE") return resp.status == httplib.NO_CONTENT @@ -733,39 +772,48 @@ def list_sizes(self, location=None): :return: List of compute node sizes supported by the cloud provider. :rtype: ``list`` of :class:`OpenNebulaNodeSize` """ + return [ - OpenNebulaNodeSize(id=1, - name='small', - ram=1024, - cpu=1, - disk=None, - bandwidth=None, - price=None, - driver=self), - OpenNebulaNodeSize(id=2, - name='medium', - ram=4096, - cpu=4, - disk=None, - bandwidth=None, - price=None, - driver=self), - OpenNebulaNodeSize(id=3, - name='large', - ram=8192, - cpu=8, - disk=None, - bandwidth=None, - price=None, - driver=self), - OpenNebulaNodeSize(id=4, - name='custom', - ram=0, - cpu=0, - disk=None, - bandwidth=None, - price=None, - driver=self), + OpenNebulaNodeSize( + id=1, + name="small", + ram=1024, + cpu=1, + disk=None, + bandwidth=None, + price=None, + driver=self, + ), + OpenNebulaNodeSize( + id=2, + name="medium", + ram=4096, + cpu=4, + disk=None, + bandwidth=None, + price=None, + driver=self, + ), + OpenNebulaNodeSize( + id=3, + name="large", + ram=8192, + cpu=8, + disk=None, + bandwidth=None, + price=None, + driver=self, + ), + OpenNebulaNodeSize( + id=4, + name="custom", + ram=0, + cpu=0, + disk=None, + bandwidth=None, + price=None, + driver=self, + ), ] def _to_images(self, object): @@ -781,10 +829,10 @@ def _to_images(self, object): :return: List of images. """ images = [] - for element in object.findall('STORAGE'): + + for element in object.findall("STORAGE"): image_id = element.attrib["href"].partition("/storage/")[2] - image = self.connection.request( - ("/storage/%s" % (image_id))).object + image = self.connection.request("/storage/%s" % (image_id)).object images.append(self._to_image(image)) return images @@ -800,13 +848,18 @@ def _to_image(self, image): :rtype: :class:`NodeImage` :return: The newly extracted :class:`NodeImage`. """ - return NodeImage(id=image.findtext('ID'), - name=image.findtext('NAME'), - driver=self.connection.driver, - extra={'description': image.findtext('DESCRIPTION'), - 'type': image.findtext('TYPE'), - 'size': image.findtext('SIZE'), - 'fstype': image.findtext('FSTYPE', None)}) + + return NodeImage( + id=image.findtext("ID"), + name=image.findtext("NAME"), + driver=self.connection.driver, + extra={ + "description": image.findtext("DESCRIPTION"), + "type": image.findtext("TYPE"), + "size": image.findtext("SIZE"), + "fstype": image.findtext("FSTYPE", None), + }, + ) def _to_node(self, compute): """ @@ -823,19 +876,21 @@ def _to_node(self, compute): :return: The newly extracted :class:`Node`. """ try: - state = self.NODE_STATE_MAP[compute.findtext('STATE').upper()] + state = self.NODE_STATE_MAP[compute.findtext("STATE").upper()] except KeyError: state = NodeState.UNKNOWN - return Node(id=compute.findtext('ID'), - name=compute.findtext('NAME'), - state=state, - public_ips=self._extract_networks(compute), - private_ips=[], - driver=self.connection.driver, - image=self._extract_images(compute), - size=self._extract_size(compute), - extra={'context': self._extract_context(compute)}) + return Node( + id=compute.findtext("ID"), + name=compute.findtext("NAME"), + state=state, + public_ips=self._extract_networks(compute), + private_ips=[], + driver=self.connection.driver, + image=self._extract_images(compute), + size=self._extract_size(compute), + extra={"context": self._extract_context(compute)}, + ) def _extract_networks(self, compute): """ @@ -852,17 +907,20 @@ def _extract_networks(self, compute): """ networks = [] - for element in compute.findall('NIC'): - network = element.find('NETWORK') - network_id = network.attrib['href'].partition('/network/')[2] + for element in compute.findall("NIC"): + network = element.find("NETWORK") + network_id = network.attrib["href"].partition("/network/")[2] networks.append( - OpenNebulaNetwork(id=network_id, - name=network.attrib.get('name', None), - address=element.findtext('IP'), - size=1, - driver=self.connection.driver, - extra={'mac': element.findtext('MAC')})) + OpenNebulaNetwork( + id=network_id, + name=network.attrib.get("name", None), + address=element.findtext("IP"), + size=1, + driver=self.connection.driver, + extra={"mac": element.findtext("MAC")}, + ) + ) return networks @@ -881,25 +939,31 @@ def _extract_images(self, compute): """ disks = list() - for element in compute.findall('DISK'): - disk = element.find('STORAGE') - image_id = disk.attrib['href'].partition('/storage/')[2] + for element in compute.findall("DISK"): + disk = element.find("STORAGE") + image_id = disk.attrib["href"].partition("/storage/")[2] - if 'id' in element.attrib: - disk_id = element.attrib['id'] + if "id" in element.attrib: + disk_id = element.attrib["id"] else: disk_id = None disks.append( - NodeImage(id=image_id, - name=disk.attrib.get('name', None), - driver=self.connection.driver, - extra={'type': element.findtext('TYPE'), - 'disk_id': disk_id, - 'target': element.findtext('TARGET')})) + NodeImage( + id=image_id, + name=disk.attrib.get("name", None), + driver=self.connection.driver, + extra={ + "type": element.findtext("TYPE"), + "disk_id": disk_id, + "target": element.findtext("TARGET"), + }, + ) + ) # Return all disks when the Node type accepts multiple attached disks # per node. + if len(disks) > 1: return disks elif len(disks) == 1: @@ -920,11 +984,12 @@ def _extract_size(self, compute): :rtype: :class:`OpenNebulaNodeSize` :return: Node type of compute node. """ - instance_type = compute.find('INSTANCE_TYPE') + instance_type = compute.find("INSTANCE_TYPE") try: - return next((node_size for node_size in self.list_sizes() - if node_size.name == instance_type.text)) + return next( + node_size for node_size in self.list_sizes() if node_size.name == instance_type.text + ) except StopIteration: return None @@ -943,7 +1008,7 @@ def _extract_context(self, compute): compute node context. """ contexts = dict() - context = compute.find('CONTEXT') + context = compute.find("CONTEXT") if context is not None: for context_element in list(context): @@ -957,7 +1022,7 @@ class OpenNebula_3_0_NodeDriver(OpenNebula_2_0_NodeDriver): OpenNebula.org node driver for OpenNebula.org v3.0. """ - name = 'OpenNebula (v3.0)' + name = "OpenNebula (v3.0)" def ex_node_set_save_name(self, node, name): """ @@ -980,24 +1045,25 @@ def ex_node_set_save_name(self, node, name): """ compute_node_id = str(node.id) - compute = ET.Element('COMPUTE') + compute = ET.Element("COMPUTE") - compute_id = ET.SubElement(compute, 'ID') + compute_id = ET.SubElement(compute, "ID") compute_id.text = compute_node_id - disk = ET.SubElement(compute, 'DISK', {'id': str(node.image.id)}) + disk = ET.SubElement(compute, "DISK", {"id": str(node.image.id)}) - ET.SubElement(disk, 'STORAGE', - {'href': '/storage/%s' % (str(node.image.id)), - 'name': node.image.name}) + ET.SubElement( + disk, + "STORAGE", + {"href": "/storage/%s" % (str(node.image.id)), "name": node.image.name}, + ) - ET.SubElement(disk, 'SAVE_AS', {'name': str(name)}) + ET.SubElement(disk, "SAVE_AS", {"name": str(name)}) xml = ET.tostring(compute) - url = '/compute/%s' % compute_node_id - resp = self.connection.request(url, method='PUT', - data=xml) + url = "/compute/%s" % compute_node_id + resp = self.connection.request(url, method="PUT", data=xml) if resp.status == httplib.BAD_REQUEST: return False @@ -1015,12 +1081,15 @@ def _to_network(self, element): :return: The newly extracted :class:`OpenNebulaNetwork`. :rtype: :class:`OpenNebulaNetwork` """ - return OpenNebulaNetwork(id=element.findtext('ID'), - name=element.findtext('NAME'), - address=element.findtext('ADDRESS'), - size=element.findtext('SIZE'), - driver=self.connection.driver, - extra={'public': element.findtext('PUBLIC')}) + + return OpenNebulaNetwork( + id=element.findtext("ID"), + name=element.findtext("NAME"), + address=element.findtext("ADDRESS"), + size=element.findtext("SIZE"), + driver=self.connection.driver, + extra={"public": element.findtext("PUBLIC")}, + ) class OpenNebula_3_2_NodeDriver(OpenNebula_3_0_NodeDriver): @@ -1028,7 +1097,7 @@ class OpenNebula_3_2_NodeDriver(OpenNebula_3_0_NodeDriver): OpenNebula.org node driver for OpenNebula.org v3.2. """ - name = 'OpenNebula (v3.2)' + name = "OpenNebula (v3.2)" def reboot_node(self, node): return self.ex_node_action(node, ACTION.REBOOT) @@ -1042,7 +1111,8 @@ def list_sizes(self, location=None): :return: List of compute node sizes supported by the cloud provider. :rtype: ``list`` of :class:`OpenNebulaNodeSize` """ - return self._to_sizes(self.connection.request('/instance_type').object) + + return self._to_sizes(self.connection.request("/instance_type").object) def _to_sizes(self, object): """ @@ -1059,15 +1129,19 @@ def _to_sizes(self, object): sizes = [] size_id = 1 - attributes = [('name', str, None), ('ram', int, 'MEMORY'), - ('cpu', float, None), ('vcpu', float, None), - ('disk', str, None), ('bandwidth', float, None), - ('price', float, None)] + attributes = [ + ("name", str, None), + ("ram", int, "MEMORY"), + ("cpu", float, None), + ("vcpu", float, None), + ("disk", str, None), + ("bandwidth", float, None), + ("price", float, None), + ] - for element in object.findall('INSTANCE_TYPE'): - size_kwargs = {'id': size_id, 'driver': self} - values = self._get_attributes_values(attributes=attributes, - element=element) + for element in object.findall("INSTANCE_TYPE"): + size_kwargs = {"id": size_id, "driver": self} + values = self._get_attributes_values(attributes=attributes, element=element) size_kwargs.update(values) size = OpenNebulaNodeSize(**size_kwargs) @@ -1080,13 +1154,13 @@ def _get_attributes_values(self, attributes, element): values = {} for attribute_name, attribute_type, alias in attributes: - key = alias if alias else attribute_name.upper() - value = element.findtext(key) + key = alias if alias else attribute_name.upper() + value = element.findtext(key) - if value is not None: - value = attribute_type(value) + if value is not None: + value = attribute_type(value) - values[attribute_name] = value + values[attribute_name] = value return values @@ -1096,118 +1170,126 @@ class OpenNebula_3_6_NodeDriver(OpenNebula_3_2_NodeDriver): OpenNebula.org node driver for OpenNebula.org v3.6. """ - name = 'OpenNebula (v3.6)' + name = "OpenNebula (v3.6)" def create_volume(self, size, name, location=None, snapshot=None): - storage = ET.Element('STORAGE') + storage = ET.Element("STORAGE") - vol_name = ET.SubElement(storage, 'NAME') + vol_name = ET.SubElement(storage, "NAME") vol_name.text = name - vol_type = ET.SubElement(storage, 'TYPE') - vol_type.text = 'DATABLOCK' + vol_type = ET.SubElement(storage, "TYPE") + vol_type.text = "DATABLOCK" - description = ET.SubElement(storage, 'DESCRIPTION') - description.text = 'Attached storage' + description = ET.SubElement(storage, "DESCRIPTION") + description.text = "Attached storage" - public = ET.SubElement(storage, 'PUBLIC') - public.text = 'NO' + public = ET.SubElement(storage, "PUBLIC") + public.text = "NO" - persistent = ET.SubElement(storage, 'PERSISTENT') - persistent.text = 'YES' + persistent = ET.SubElement(storage, "PERSISTENT") + persistent.text = "YES" - fstype = ET.SubElement(storage, 'FSTYPE') - fstype.text = 'ext3' + fstype = ET.SubElement(storage, "FSTYPE") + fstype.text = "ext3" - vol_size = ET.SubElement(storage, 'SIZE') + vol_size = ET.SubElement(storage, "SIZE") vol_size.text = str(size) xml = ET.tostring(storage) - volume = self.connection.request('/storage', - {'occixml': xml}, - method='POST').object + volume = self.connection.request("/storage", {"occixml": xml}, method="POST").object return self._to_volume(volume) def destroy_volume(self, volume): - url = '/storage/%s' % (str(volume.id)) - resp = self.connection.request(url, method='DELETE') + url = "/storage/%s" % (str(volume.id)) + resp = self.connection.request(url, method="DELETE") return resp.status == httplib.NO_CONTENT - def attach_volume(self, node, volume, device): - action = ET.Element('ACTION') + def attach_volume( + self, + node, + volume, + device=None, + ): + action = ET.Element("ACTION") - perform = ET.SubElement(action, 'PERFORM') - perform.text = 'ATTACHDISK' + perform = ET.SubElement(action, "PERFORM") + perform.text = "ATTACHDISK" - params = ET.SubElement(action, 'PARAMS') + params = ET.SubElement(action, "PARAMS") - ET.SubElement(params, - 'STORAGE', - {'href': '/storage/%s' % (str(volume.id))}) + ET.SubElement(params, "STORAGE", {"href": "/storage/%s" % (str(volume.id))}) - target = ET.SubElement(params, 'TARGET') + target = ET.SubElement(params, "TARGET") target.text = device xml = ET.tostring(action) - url = '/compute/%s/action' % node.id + url = "/compute/%s/action" % node.id + + resp = self.connection.request(url, method="POST", data=xml) - resp = self.connection.request(url, method='POST', data=xml) return resp.status == httplib.ACCEPTED def _do_detach_volume(self, node_id, disk_id): - action = ET.Element('ACTION') + action = ET.Element("ACTION") - perform = ET.SubElement(action, 'PERFORM') - perform.text = 'DETACHDISK' + perform = ET.SubElement(action, "PERFORM") + perform.text = "DETACHDISK" - params = ET.SubElement(action, 'PARAMS') + params = ET.SubElement(action, "PARAMS") - ET.SubElement(params, - 'DISK', - {'id': disk_id}) + ET.SubElement(params, "DISK", {"id": disk_id}) xml = ET.tostring(action) - url = '/compute/%s/action' % node_id + url = "/compute/%s/action" % node_id + + resp = self.connection.request(url, method="POST", data=xml) - resp = self.connection.request(url, method='POST', data=xml) return resp.status == httplib.ACCEPTED def detach_volume(self, volume): # We need to find the node using this volume + for node in self.list_nodes(): if type(node.image) is not list: # This node has only one associated image. It is not the one we # are after. + continue for disk in node.image: if disk.id == volume.id: # Node found. We can now detach the volume - disk_id = disk.extra['disk_id'] + disk_id = disk.extra["disk_id"] + return self._do_detach_volume(node.id, disk_id) return False def list_volumes(self): - return self._to_volumes(self.connection.request('/storage').object) + return self._to_volumes(self.connection.request("/storage").object) def _to_volume(self, storage): - return StorageVolume(id=storage.findtext('ID'), - name=storage.findtext('NAME'), - size=int(storage.findtext('SIZE')), - driver=self.connection.driver) + return StorageVolume( + id=storage.findtext("ID"), + name=storage.findtext("NAME"), + size=int(storage.findtext("SIZE")), + driver=self.connection.driver, + ) def _to_volumes(self, object): volumes = [] - for storage in object.findall('STORAGE'): - storage_id = storage.attrib['href'].partition('/storage/')[2] - volumes.append(self._to_volume( - self.connection.request('/storage/%s' % storage_id).object)) + for storage in object.findall("STORAGE"): + storage_id = storage.attrib["href"].partition("/storage/")[2] + + volumes.append( + self._to_volume(self.connection.request("/storage/%s" % storage_id).object) + ) return volumes @@ -1217,7 +1299,7 @@ class OpenNebula_3_8_NodeDriver(OpenNebula_3_6_NodeDriver): OpenNebula.org node driver for OpenNebula.org v3.8. """ - name = 'OpenNebula (v3.8)' + name = "OpenNebula (v3.8)" plain_auth = API_PLAIN_AUTH def _to_sizes(self, object): @@ -1235,23 +1317,29 @@ def _to_sizes(self, object): sizes = [] size_id = 1 - attributes = [('name', str, None), ('ram', int, 'MEMORY'), - ('cpu', float, None), ('vcpu', float, None), - ('disk', str, None), ('bandwidth', float, None), - ('price', float, None)] + attributes = [ + ("name", str, None), + ("ram", int, "MEMORY"), + ("cpu", float, None), + ("vcpu", float, None), + ("disk", str, None), + ("bandwidth", float, None), + ("price", float, None), + ] - for element in object.findall('INSTANCE_TYPE'): + for element in object.findall("INSTANCE_TYPE"): element = self.connection.request( - ('/instance_type/%s') % (element.attrib['name'])).object + ("/instance_type/%s") % (element.attrib["name"]) + ).object - size_kwargs = {'id': size_id, 'driver': self} - values = self._get_attributes_values(attributes=attributes, - element=element) + size_kwargs = {"id": size_id, "driver": self} + values = self._get_attributes_values(attributes=attributes, element=element) size_kwargs.update(values) size = OpenNebulaNodeSize(**size_kwargs) sizes.append(size) size_id += 1 + return sizes def _ex_connection_class_kwargs(self): @@ -1261,4 +1349,4 @@ def _ex_connection_class_kwargs(self): :return: ``dict`` of :class:`OpenNebulaConnection_3_8` input arguments """ - return {'plain_auth': self.plain_auth} + return {"plain_auth": self.plain_auth} diff --git a/libcloud/compute/drivers/openstack.py b/libcloud/compute/drivers/openstack.py index cc96afa66c..43cd567b90 100644 --- a/libcloud/compute/drivers/openstack.py +++ b/libcloud/compute/drivers/openstack.py @@ -15,130 +15,295 @@ """ OpenStack driver """ + +import base64 +import warnings + +from libcloud.pricing import get_size_price +from libcloud.utils.py3 import ET, b, next, httplib, parse_qs, urlparse +from libcloud.utils.xml import findall +from libcloud.compute.base import ( + Node, + KeyPair, + NodeSize, + NodeImage, + UuidMixin, + NodeDriver, + NodeLocation, + StorageVolume, + VolumeSnapshot, + NodeImageMember, +) +from libcloud.compute.types import ( + Type, + Provider, + NodeState, + LibcloudError, + StorageVolumeState, + VolumeSnapshotState, +) from libcloud.utils.iso8601 import parse_date +from libcloud.common.openstack import ( + OpenStackResponse, + OpenStackException, + OpenStackDriverMixin, + OpenStackBaseConnection, +) +from libcloud.utils.networking import is_public_subnet +from libcloud.common.exceptions import BaseHTTPError try: import simplejson as json except ImportError: import json -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - -import warnings -import base64 - -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import b -from libcloud.utils.py3 import next -from libcloud.utils.py3 import urlparse - - -from libcloud.common.openstack import OpenStackBaseConnection -from libcloud.common.openstack import OpenStackDriverMixin -from libcloud.common.openstack import OpenStackException -from libcloud.common.openstack import OpenStackResponse -from libcloud.utils.networking import is_public_subnet -from libcloud.compute.base import NodeSize, NodeImage -from libcloud.compute.base import (NodeDriver, Node, NodeLocation, - StorageVolume, VolumeSnapshot) -from libcloud.compute.base import KeyPair -from libcloud.compute.types import NodeState, StorageVolumeState, Provider -from libcloud.pricing import get_size_price -from libcloud.utils.xml import findall __all__ = [ - 'OpenStack_1_0_Response', - 'OpenStack_1_0_Connection', - 'OpenStack_1_0_NodeDriver', - 'OpenStack_1_0_SharedIpGroup', - 'OpenStack_1_0_NodeIpAddresses', - 'OpenStack_1_1_Response', - 'OpenStack_1_1_Connection', - 'OpenStack_1_1_NodeDriver', - 'OpenStack_1_1_FloatingIpPool', - 'OpenStack_1_1_FloatingIpAddress', - 'OpenStackNodeDriver' + "OpenStack_1_0_Response", + "OpenStack_1_0_Connection", + "OpenStack_1_0_NodeDriver", + "OpenStack_1_0_SharedIpGroup", + "OpenStack_1_0_NodeIpAddresses", + "OpenStack_1_1_Response", + "OpenStack_1_1_Connection", + "OpenStack_1_1_NodeDriver", + "OpenStack_1_1_FloatingIpPool", + "OpenStack_2_FloatingIpPool", + "OpenStack_1_1_FloatingIpAddress", + "OpenStack_2_FloatingIpAddress", + "OpenStack_2_PortInterfaceState", + "OpenStack_2_PortInterface", + "OpenStackNodeDriver", ] ATOM_NAMESPACE = "http://www.w3.org/2005/Atom" -DEFAULT_API_VERSION = '1.1' +DEFAULT_API_VERSION = "1.1" + +PAGINATION_LIMIT = 1000 class OpenStackComputeConnection(OpenStackBaseConnection): # default config for http://devstack.org/ - service_type = 'compute' - service_name = 'nova' - service_region = 'RegionOne' + service_type = "compute" + service_name = "nova" + service_region = "RegionOne" + + +class OpenStackImageConnection(OpenStackBaseConnection): + service_type = "image" + service_name = "glance" + service_region = "RegionOne" + + +class OpenStackNetworkConnection(OpenStackBaseConnection): + service_type = "network" + service_name = "neutron" + service_region = "RegionOne" + + +class OpenStackVolumeV2Connection(OpenStackBaseConnection): + service_type = "volumev2" + service_name = "cinderv2" + service_region = "RegionOne" + + +class OpenStackVolumeV3Connection(OpenStackBaseConnection): + service_type = "volumev3" + service_name = "cinderv3" + service_region = "RegionOne" + + +class OpenStackReservationConnection(OpenStackBaseConnection): + service_type = "reservation" + service_name = "blazar" + service_region = "RegionOne" class OpenStackNodeDriver(NodeDriver, OpenStackDriverMixin): """ Base OpenStack node driver. Should not be used directly. """ - api_name = 'openstack' - name = 'OpenStack' - website = 'http://openstack.org/' + + api_name = "openstack" + name = "OpenStack" + website = "http://openstack.org/" NODE_STATE_MAP = { - 'BUILD': NodeState.PENDING, - 'REBUILD': NodeState.PENDING, - 'ACTIVE': NodeState.RUNNING, - 'SUSPENDED': NodeState.STOPPED, - 'SHUTOFF': NodeState.STOPPED, - 'DELETED': NodeState.TERMINATED, - 'QUEUE_RESIZE': NodeState.PENDING, - 'PREP_RESIZE': NodeState.PENDING, - 'VERIFY_RESIZE': NodeState.RUNNING, - 'PASSWORD': NodeState.PENDING, - 'RESCUE': NodeState.PENDING, - 'REBOOT': NodeState.REBOOTING, - 'HARD_REBOOT': NodeState.REBOOTING, - 'SHARE_IP': NodeState.PENDING, - 'SHARE_IP_NO_CONFIG': NodeState.PENDING, - 'DELETE_IP': NodeState.PENDING, - 'ERROR': NodeState.ERROR, - 'UNKNOWN': NodeState.UNKNOWN + "BUILD": NodeState.PENDING, + "REBUILD": NodeState.PENDING, + "ACTIVE": NodeState.RUNNING, + "SUSPENDED": NodeState.SUSPENDED, + "SHUTOFF": NodeState.STOPPED, + "DELETED": NodeState.TERMINATED, + "QUEUE_RESIZE": NodeState.PENDING, + "PREP_RESIZE": NodeState.PENDING, + "VERIFY_RESIZE": NodeState.RUNNING, + "PASSWORD": NodeState.PENDING, + "RESCUE": NodeState.PENDING, + "REBOOT": NodeState.REBOOTING, + "RESIZE": NodeState.RECONFIGURING, + "HARD_REBOOT": NodeState.REBOOTING, + "SHARE_IP": NodeState.PENDING, + "SHARE_IP_NO_CONFIG": NodeState.PENDING, + "DELETE_IP": NodeState.PENDING, + "ERROR": NodeState.ERROR, + "UNKNOWN": NodeState.UNKNOWN, } # http://developer.openstack.org/api-ref-blockstorage-v2.html#volumes-v2 VOLUME_STATE_MAP = { - 'creating': StorageVolumeState.CREATING, - 'available': StorageVolumeState.AVAILABLE, - 'attaching': StorageVolumeState.ATTACHING, - 'in-use': StorageVolumeState.INUSE, - 'deleting': StorageVolumeState.DELETING, - 'error': StorageVolumeState.ERROR, - 'error_deleting': StorageVolumeState.ERROR, - 'backing-up': StorageVolumeState.BACKUP, - 'restoring-backup': StorageVolumeState.BACKUP, - 'error_restoring': StorageVolumeState.ERROR, - 'error_extending': StorageVolumeState.ERROR, + "creating": StorageVolumeState.CREATING, + "available": StorageVolumeState.AVAILABLE, + "attaching": StorageVolumeState.ATTACHING, + "in-use": StorageVolumeState.INUSE, + "deleting": StorageVolumeState.DELETING, + "error": StorageVolumeState.ERROR, + "error_deleting": StorageVolumeState.ERROR, + "backing-up": StorageVolumeState.BACKUP, + "restoring-backup": StorageVolumeState.BACKUP, + "error_restoring": StorageVolumeState.ERROR, + "error_extending": StorageVolumeState.ERROR, + } + + # http://developer.openstack.org/api-ref-blockstorage-v2.html#ext-backups-v2 + SNAPSHOT_STATE_MAP = { + "creating": VolumeSnapshotState.CREATING, + "available": VolumeSnapshotState.AVAILABLE, + "deleting": VolumeSnapshotState.DELETING, + "error": VolumeSnapshotState.ERROR, + "restoring": VolumeSnapshotState.RESTORING, + "error_restoring": VolumeSnapshotState.ERROR, } - def __new__(cls, key, secret=None, secure=True, host=None, port=None, - api_version=DEFAULT_API_VERSION, **kwargs): + def __new__( + cls, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=DEFAULT_API_VERSION, + **kwargs, + ): if cls is OpenStackNodeDriver: - if api_version == '1.0': + if api_version == "1.0": cls = OpenStack_1_0_NodeDriver - elif api_version == '1.1': + elif api_version == "1.1": cls = OpenStack_1_1_NodeDriver + elif api_version in ["2.0", "2.1", "2.2"]: + cls = OpenStack_2_NodeDriver else: raise NotImplementedError( - "No OpenStackNodeDriver found for API version %s" % - (api_version)) - return super(OpenStackNodeDriver, cls).__new__(cls) + "No OpenStackNodeDriver found for API version %s" % (api_version) + ) + return super().__new__(cls) def __init__(self, *args, **kwargs): OpenStackDriverMixin.__init__(self, **kwargs) - super(OpenStackNodeDriver, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) + + @staticmethod + def _paginated_request(url, obj, connection, params=None): + """ + Perform multiple calls in order to have a full list of elements when + the API responses are paginated. + + :param url: API endpoint + :type url: ``str`` + + :param obj: Result object key + :type obj: ``str`` + + :param connection: The API connection to use to perform the request + :type connection: ``obj`` + + :param params: Any request parameters + :type params: ``dict`` + + :return: ``list`` of API response objects + :rtype: ``list`` + """ + params = params or {} + objects = list() + loop_count = 0 + while True: + data = connection.request(url, params=params) + values = data.object.get(obj, list()) + objects.extend(values) + links = data.object.get("%s_links" % obj, list()) + next_links = [n for n in links if n["rel"] == "next"] + if next_links: + next_link = next_links[0] + query = urlparse.urlparse(next_link["href"]) + # The query[4] references the query parameters from the url + params.update(parse_qs(query[4])) + else: + break + + # Prevent the pagination from looping indefinitely in case + # the API returns a loop for some reason. + loop_count += 1 + if loop_count > PAGINATION_LIMIT: + raise OpenStackException( + "Pagination limit reached for %s, the limit is %d. " + "This might indicate that your API is returning a " + "looping next target for pagination!" % (url, PAGINATION_LIMIT), + None, + ) + return {obj: objects} + + def _paginated_request_next(self, path, request_method, response_key): + """ + Perform multiple calls and retrieve all the elements for a paginated + response. + + This method utilizes "next" attribute in the response object. + + It also includes an infinite loop protection (if the "next" value + matches the current path, it will abort). + + :param request_method: Method to call which will send the request and + return a response. This method will get passed + in "path" as a first argument. + + :param response_key: Key in the response object dictionary which + contains actual objects we are interested in. + """ + iteration_count = 0 + + result = [] + while path: + response = request_method(path) + items = response.object.get(response_key, []) or [] + result.extend(items) + + # Retrieve next path + next_path = response.object.get("next", None) + + if next_path == path: + # Likely an infinite loop since the next path matches the + # current one + break + + if iteration_count > PAGINATION_LIMIT: + # We have iterated over PAGINATION_LIMIT pages, likely an + # API returned an invalid response + raise OpenStackException( + "Pagination limit reached for %s, the limit is %d. " + "This might indicate that your API is returning a " + "looping next target for pagination!" % (path, PAGINATION_LIMIT), + None, + ) + + path = next_path + iteration_count += 1 + + return result def destroy_node(self, node): - uri = '/servers/%s' % (node.id) - resp = self.connection.request(uri, method='DELETE') + uri = "/servers/%s" % (node.id) + resp = self.connection.request(uri, method="DELETE") # The OpenStack and Rackspace documentation both say this API will # return a 204, but in-fact, everyone everywhere agrees it actually # returns a 202, so we are going to accept either, and someday, @@ -147,7 +312,16 @@ def destroy_node(self, node): return resp.status in (httplib.NO_CONTENT, httplib.ACCEPTED) def reboot_node(self, node): - return self._reboot_node(node, reboot_type='HARD') + # pylint: disable=no-member + return self._reboot_node(node, reboot_type="HARD") + + def start_node(self, node): + # pylint: disable=no-member + return self._post_simple_node_action(node, "os-start") + + def stop_node(self, node): + # pylint: disable=no-member + return self._post_simple_node_action(node, "os-stop") def list_nodes(self, ex_all_tenants=False): """ @@ -160,11 +334,12 @@ def list_nodes(self, ex_all_tenants=False): """ params = {} if ex_all_tenants: - params = {'all_tenants': 1} - return self._to_nodes( - self.connection.request('/servers/detail', params=params).object) + params = {"all_tenants": 1} - def create_volume(self, size, name, location=None, snapshot=None): + # pylint: disable=no-member + return self._to_nodes(self.connection.request("/servers/detail", params=params).object) + + def create_volume(self, size, name, location=None, snapshot=None, ex_volume_type=None): """ Create a new volume. @@ -183,71 +358,81 @@ def create_volume(self, size, name, location=None, snapshot=None): volume. (optional) :type snapshot: :class:`.VolumeSnapshot` + :param ex_volume_type: What kind of volume to create. + (optional) + :type ex_volume_type: ``str`` + :return: The newly created volume. :rtype: :class:`StorageVolume` """ volume = { - 'display_name': name, - 'display_description': name, - 'size': size, - 'volume_type': None, - 'metadata': { - 'contents': name, - }, - 'availability_zone': location + "display_name": name, + "display_description": name, + "size": size, + "metadata": {"contents": name}, } + if ex_volume_type: + volume["volume_type"] = ex_volume_type + + if location: + volume["availability_zone"] = location + if snapshot: - volume['snapshot_id'] = snapshot.id + volume["snapshot_id"] = snapshot.id + + resp = self.connection.request("/os-volumes", method="POST", data={"volume": volume}) - resp = self.connection.request('/os-volumes', - method='POST', - data={'volume': volume}) + # pylint: disable=no-member return self._to_volume(resp.object) def destroy_volume(self, volume): - return self.connection.request('/os-volumes/%s' % volume.id, - method='DELETE').success() + return self.connection.request("/os-volumes/%s" % volume.id, method="DELETE").success() def attach_volume(self, node, volume, device="auto"): # when "auto" or None is provided for device, openstack will let # the guest OS pick the next available device (fi. /dev/vdb) + if device == "auto": + device = None return self.connection.request( - '/servers/%s/os-volume_attachments' % node.id, - method='POST', - data={ - 'volumeAttachment': { - 'volumeId': volume.id, - 'device': device, - } - }).success() + "/servers/%s/os-volume_attachments" % node.id, + method="POST", + data={"volumeAttachment": {"volumeId": volume.id, "device": device}}, + ).success() def detach_volume(self, volume, ex_node=None): # when ex_node is not provided, volume is detached from all nodes failed_nodes = [] - for attachment in volume.extra['attachments']: - if not ex_node or ex_node.id == attachment['serverId']: + for attachment in volume.extra["attachments"]: + if not ex_node or ex_node.id in filter( + None, (attachment.get("serverId"), attachment.get("server_id")) + ): response = self.connection.request( - '/servers/%s/os-volume_attachments/%s' % - (attachment['serverId'], attachment['id']), - method='DELETE') + "/servers/%s/os-volume_attachments/%s" + % ( + attachment.get("serverId") or attachment["server_id"], + attachment["id"], + ), + method="DELETE", + ) if not response.success(): - failed_nodes.append(attachment['serverId']) + failed_nodes.append(attachment.get("serverId") or attachment["server_id"]) if failed_nodes: raise OpenStackException( - 'detach_volume failed for nodes with id: %s' % - ', '.join(failed_nodes), 500, self + "detach_volume failed for nodes with id: %s" % ", ".join(failed_nodes), + 500, + self, ) return True def list_volumes(self): - return self._to_volumes( - self.connection.request('/os-volumes').object) + # pylint: disable=no-member + return self._to_volumes(self.connection.request("/os-volumes").object) def ex_get_volume(self, volumeId): - return self._to_volume( - self.connection.request('/os-volumes/%s' % volumeId).object) + # pylint: disable=no-member + return self._to_volume(self.connection.request("/os-volumes/%s" % volumeId).object) def list_images(self, location=None, ex_only_active=True): """ @@ -255,12 +440,12 @@ def list_images(self, location=None, ex_only_active=True): @inherits: :class:`NodeDriver.list_images` - :param ex_only_active: True if list only active + :param ex_only_active: True if list only active (optional) :type ex_only_active: ``bool`` """ - return self._to_images( - self.connection.request('/images/detail').object, ex_only_active) + # pylint: disable=no-member + return self._to_images(self.connection.request("/images/detail").object, ex_only_active) def get_image(self, image_id): """ @@ -275,15 +460,17 @@ def get_image(self, image_id): :rtype: :class:`NodeImage` """ - return self._to_image(self.connection.request( - '/images/%s' % (image_id,)).object['image']) + # pylint: disable=no-member + return self._to_image( + self.connection.request("/images/{}".format(image_id)).object["image"] + ) def list_sizes(self, location=None): - return self._to_sizes( - self.connection.request('/flavors/detail').object) + # pylint: disable=no-member + return self._to_sizes(self.connection.request("/flavors/detail").object) def list_locations(self): - return [NodeLocation(0, '', '', self)] + return [NodeLocation(0, "", "", self)] def _ex_connection_class_kwargs(self): return self.openstack_connection_kwargs() @@ -301,11 +488,15 @@ def ex_get_node_details(self, node_id): if isinstance(node_id, Node): node_id = node_id.id - uri = '/servers/%s' % (node_id) - resp = self.connection.request(uri, method='GET') - if resp.status == httplib.NOT_FOUND: - return None + uri = "/servers/%s" % (node_id) + try: + resp = self.connection.request(uri, method="GET") + except BaseHTTPError as e: + if e.code == httplib.NOT_FOUND: + return None + raise + # pylint: disable=no-member return self._to_node_from_obj(resp.object) def ex_soft_reboot_node(self, node): @@ -317,7 +508,8 @@ def ex_soft_reboot_node(self, node): :rtype: ``bool`` """ - return self._reboot_node(node, reboot_type='SOFT') + # pylint: disable=no-member + return self._reboot_node(node, reboot_type="SOFT") def ex_hard_reboot_node(self, node): """ @@ -328,7 +520,8 @@ def ex_hard_reboot_node(self, node): :rtype: ``bool`` """ - return self._reboot_node(node, reboot_type='HARD') + # pylint: disable=no-member + return self._reboot_node(node, reboot_type="HARD") class OpenStackNodeSize(NodeSize): @@ -340,22 +533,48 @@ class OpenStackNodeSize(NodeSize): https://issues.apache.org/jira/browse/LIBCLOUD-119 """ - def __init__(self, id, name, ram, disk, bandwidth, price, driver, - vcpus=None, ephemeral_disk=None, swap=None, extra=None): - super(OpenStackNodeSize, self).__init__(id=id, name=name, ram=ram, - disk=disk, - bandwidth=bandwidth, - price=price, driver=driver) + def __init__( + self, + id, + name, + ram, + disk, + bandwidth, + price, + driver, + vcpus=None, + ephemeral_disk=None, + swap=None, + extra=None, + ): + super().__init__( + id=id, + name=name, + ram=ram, + disk=disk, + bandwidth=bandwidth, + price=price, + driver=driver, + ) self.vcpus = vcpus self.ephemeral_disk = ephemeral_disk self.swap = swap self.extra = extra def __repr__(self): - return (('') - % (self.id, self.name, self.ram, self.disk, self.bandwidth, - self.price, self.driver.name, self.vcpus)) + return ( + "" + ) % ( + self.id, + self.name, + self.ram, + self.disk, + self.bandwidth, + self.price, + self.driver.name, + self.vcpus, + ) class OpenStack_1_0_Response(OpenStackResponse): @@ -363,14 +582,14 @@ def __init__(self, *args, **kwargs): # done because of a circular reference from # NodeDriver -> Connection -> Response self.node_driver = OpenStack_1_0_NodeDriver - super(OpenStack_1_0_Response, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) class OpenStack_1_0_Connection(OpenStackComputeConnection): responseCls = OpenStack_1_0_Response - default_content_type = 'application/xml; charset=UTF-8' - accept_format = 'application/xml' - XML_NAMESPACE = 'http://docs.rackspacecloud.com/servers/api/v1.0' + default_content_type = "application/xml; charset=UTF-8" + accept_format = "application/xml" + XML_NAMESPACE = "http://docs.rackspacecloud.com/servers/api/v1.0" class OpenStack_1_0_NodeDriver(OpenStackNodeDriver): @@ -383,63 +602,74 @@ class OpenStack_1_0_NodeDriver(OpenStackNodeDriver): - imageId: id of image - flavorId: id of flavor """ + connectionCls = OpenStack_1_0_Connection type = Provider.OPENSTACK - features = {'create_node': ['generates_password']} + features = {"create_node": ["generates_password"]} def __init__(self, *args, **kwargs): - self._ex_force_api_version = str(kwargs.pop('ex_force_api_version', - None)) + self._ex_force_api_version = str(kwargs.pop("ex_force_api_version", None)) self.XML_NAMESPACE = self.connectionCls.XML_NAMESPACE - super(OpenStack_1_0_NodeDriver, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) def _to_images(self, object, ex_only_active): images = [] - for image in findall(object, 'image', self.XML_NAMESPACE): - if ex_only_active and image.get('status') != 'ACTIVE': + for image in findall(object, "image", self.XML_NAMESPACE): + if ex_only_active and image.get("status") != "ACTIVE": continue images.append(self._to_image(image)) return images def _to_image(self, element): - return NodeImage(id=element.get('id'), - name=element.get('name'), - driver=self.connection.driver, - extra={'updated': element.get('updated'), - 'created': element.get('created'), - 'status': element.get('status'), - 'serverId': element.get('serverId'), - 'progress': element.get('progress'), - 'minDisk': element.get('minDisk'), - 'minRam': element.get('minRam') - } - ) + return NodeImage( + id=element.get("id"), + name=element.get("name"), + driver=self.connection.driver, + extra={ + "updated": element.get("updated"), + "created": element.get("created"), + "status": element.get("status"), + "serverId": element.get("serverId"), + "progress": element.get("progress"), + "minDisk": element.get("minDisk"), + "minRam": element.get("minRam"), + }, + ) def _change_password_or_name(self, node, name=None, password=None): - uri = '/servers/%s' % (node.id) + uri = "/servers/%s" % (node.id) if not name: name = node.name - body = {'xmlns': self.XML_NAMESPACE, - 'name': name} + body = {"xmlns": self.XML_NAMESPACE, "name": name} if password is not None: - body['adminPass'] = password + body["adminPass"] = password - server_elm = ET.Element('server', body) + server_elm = ET.Element("server", body) - resp = self.connection.request( - uri, method='PUT', data=ET.tostring(server_elm)) + resp = self.connection.request(uri, method="PUT", data=ET.tostring(server_elm)) if resp.status == httplib.NO_CONTENT and password is not None: - node.extra['password'] = password + node.extra["password"] = password return resp.status == httplib.NO_CONTENT - def create_node(self, **kwargs): + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_metadata=None, + ex_files=None, + ex_shared_ip_group=None, + ex_shared_ip_group_id=None, + ): """ Create a new node @@ -456,39 +686,35 @@ def create_node(self, **kwargs): that shared IP group :type ex_shared_ip_group_id: ``str`` """ - name = kwargs['name'] - image = kwargs['image'] - size = kwargs['size'] - - attributes = {'xmlns': self.XML_NAMESPACE, - 'name': name, - 'imageId': str(image.id), - 'flavorId': str(size.id)} + attributes = { + "xmlns": self.XML_NAMESPACE, + "name": name, + "imageId": str(image.id), + "flavorId": str(size.id), + } - if 'ex_shared_ip_group' in kwargs: + if ex_shared_ip_group: # Deprecate this. Be explicit and call the variable # ex_shared_ip_group_id since user needs to pass in the id, not the # name. - warnings.warn('ex_shared_ip_group argument is deprecated.' - ' Please use ex_shared_ip_group_id') + warnings.warn( + "ex_shared_ip_group argument is deprecated." " Please use ex_shared_ip_group_id" + ) - if 'ex_shared_ip_group_id' in kwargs: - shared_ip_group_id = kwargs['ex_shared_ip_group_id'] - attributes['sharedIpGroupId'] = shared_ip_group_id + if ex_shared_ip_group_id: + attributes["sharedIpGroupId"] = ex_shared_ip_group_id - server_elm = ET.Element('server', attributes) + server_elm = ET.Element("server", attributes) - metadata_elm = self._metadata_to_xml(kwargs.get("ex_metadata", {})) + metadata_elm = self._metadata_to_xml(ex_metadata or {}) if metadata_elm: server_elm.append(metadata_elm) - files_elm = self._files_to_xml(kwargs.get("ex_files", {})) + files_elm = self._files_to_xml(ex_files or {}) if files_elm: server_elm.append(files_elm) - resp = self.connection.request("/servers", - method='POST', - data=ET.tostring(server_elm)) + resp = self.connection.request("/servers", method="POST", data=ET.tostring(server_elm)) return self._to_node(resp.object) def ex_set_password(self, node, password): @@ -526,7 +752,7 @@ def ex_set_server_name(self, node, name): """ return self._change_password_or_name(node, name=name) - def ex_resize(self, node, size): + def ex_resize_node(self, node, size): """ Change an existing server flavor / scale the server up or down. @@ -538,17 +764,21 @@ def ex_resize(self, node, size): :rtype: ``bool`` """ - elm = ET.Element( - 'resize', - {'xmlns': self.XML_NAMESPACE, - 'flavorId': str(size.id)} - ) + elm = ET.Element("resize", {"xmlns": self.XML_NAMESPACE, "flavorId": str(size.id)}) - resp = self.connection.request("/servers/%s/action" % (node.id), - method='POST', - data=ET.tostring(elm)) + resp = self.connection.request( + "/servers/%s/action" % (node.id), method="POST", data=ET.tostring(elm) + ) return resp.status == httplib.ACCEPTED + def ex_resize(self, node, size): + """ + NOTE: This method is here for backward compatibility reasons. + + You should use ``ex_resize_node`` instead. + """ + return self.ex_resize_node(node=node, size=size) + def ex_confirm_resize(self, node): """ Confirm a resize request which is currently in progress. If a resize @@ -563,13 +793,13 @@ def ex_confirm_resize(self, node): :rtype: ``bool`` """ elm = ET.Element( - 'confirmResize', - {'xmlns': self.XML_NAMESPACE}, + "confirmResize", + {"xmlns": self.XML_NAMESPACE}, ) - resp = self.connection.request("/servers/%s/action" % (node.id), - method='POST', - data=ET.tostring(elm)) + resp = self.connection.request( + "/servers/%s/action" % (node.id), method="POST", data=ET.tostring(elm) + ) return resp.status == httplib.NO_CONTENT def ex_revert_resize(self, node): @@ -585,14 +815,11 @@ def ex_revert_resize(self, node): :rtype: ``bool`` """ - elm = ET.Element( - 'revertResize', - {'xmlns': self.XML_NAMESPACE} - ) + elm = ET.Element("revertResize", {"xmlns": self.XML_NAMESPACE}) - resp = self.connection.request("/servers/%s/action" % (node.id), - method='POST', - data=ET.tostring(elm)) + resp = self.connection.request( + "/servers/%s/action" % (node.id), method="POST", data=ET.tostring(elm) + ) return resp.status == httplib.NO_CONTENT def ex_rebuild(self, node_id, image_id): @@ -614,15 +841,11 @@ def ex_rebuild(self, node_id, image_id): if isinstance(image_id, NodeImage): image_id = image_id.id - elm = ET.Element( - 'rebuild', - {'xmlns': self.XML_NAMESPACE, - 'imageId': image_id} - ) + elm = ET.Element("rebuild", {"xmlns": self.XML_NAMESPACE, "imageId": image_id}) - resp = self.connection.request("/servers/%s/action" % node_id, - method='POST', - data=ET.tostring(elm)) + resp = self.connection.request( + "/servers/%s/action" % node_id, method="POST", data=ET.tostring(elm) + ) return resp.status == httplib.ACCEPTED def ex_create_ip_group(self, group_name, node_id=None): @@ -641,22 +864,14 @@ def ex_create_ip_group(self, group_name, node_id=None): if isinstance(node_id, Node): node_id = node_id.id - group_elm = ET.Element( - 'sharedIpGroup', - {'xmlns': self.XML_NAMESPACE, - 'name': group_name} - ) + group_elm = ET.Element("sharedIpGroup", {"xmlns": self.XML_NAMESPACE, "name": group_name}) if node_id: - ET.SubElement( - group_elm, - 'server', - {'id': node_id} - ) + ET.SubElement(group_elm, "server", {"id": node_id}) - resp = self.connection.request('/shared_ip_groups', - method='POST', - data=ET.tostring(group_elm)) + resp = self.connection.request( + "/shared_ip_groups", method="POST", data=ET.tostring(group_elm) + ) return self._to_shared_ip_group(resp.object) def ex_list_ip_groups(self, details=False): @@ -669,11 +884,9 @@ def ex_list_ip_groups(self, details=False): :rtype: ``list`` of :class:`OpenStack_1_0_SharedIpGroup` """ - uri = '/shared_ip_groups/detail' if details else '/shared_ip_groups' - resp = self.connection.request(uri, - method='GET') - groups = findall(resp.object, 'sharedIpGroup', - self.XML_NAMESPACE) + uri = "/shared_ip_groups/detail" if details else "/shared_ip_groups" + resp = self.connection.request(uri, method="GET") + groups = findall(resp.object, "sharedIpGroup", self.XML_NAMESPACE) return [self._to_shared_ip_group(el) for el in groups] def ex_delete_ip_group(self, group_id): @@ -685,8 +898,8 @@ def ex_delete_ip_group(self, group_id): :rtype: ``bool`` """ - uri = '/shared_ip_groups/%s' % group_id - resp = self.connection.request(uri, method='DELETE') + uri = "/shared_ip_groups/%s" % group_id + resp = self.connection.request(uri, method="DELETE") return resp.status == httplib.NO_CONTENT def ex_share_ip(self, group_id, node_id, ip, configure_node=True): @@ -712,22 +925,22 @@ def ex_share_ip(self, group_id, node_id, ip, configure_node=True): node_id = node_id.id if configure_node: - str_configure = 'true' + str_configure = "true" else: - str_configure = 'false' + str_configure = "false" elm = ET.Element( - 'shareIp', - {'xmlns': self.XML_NAMESPACE, - 'sharedIpGroupId': group_id, - 'configureServer': str_configure}, + "shareIp", + { + "xmlns": self.XML_NAMESPACE, + "sharedIpGroupId": group_id, + "configureServer": str_configure, + }, ) - uri = '/servers/%s/ips/public/%s' % (node_id, ip) + uri = "/servers/{}/ips/public/{}".format(node_id, ip) - resp = self.connection.request(uri, - method='PUT', - data=ET.tostring(elm)) + resp = self.connection.request(uri, method="PUT", data=ET.tostring(elm)) return resp.status == httplib.ACCEPTED def ex_unshare_ip(self, node_id, ip): @@ -746,10 +959,9 @@ def ex_unshare_ip(self, node_id, ip): if isinstance(node_id, Node): node_id = node_id.id - uri = '/servers/%s/ips/public/%s' % (node_id, ip) + uri = "/servers/{}/ips/public/{}".format(node_id, ip) - resp = self.connection.request(uri, - method='DELETE') + resp = self.connection.request(uri, method="DELETE") return resp.status == httplib.ACCEPTED def ex_list_ip_addresses(self, node_id): @@ -765,106 +977,105 @@ def ex_list_ip_addresses(self, node_id): if isinstance(node_id, Node): node_id = node_id.id - uri = '/servers/%s/ips' % node_id - resp = self.connection.request(uri, - method='GET') + uri = "/servers/%s/ips" % node_id + resp = self.connection.request(uri, method="GET") return self._to_ip_addresses(resp.object) def _metadata_to_xml(self, metadata): - if len(metadata) == 0: + if not metadata: return None - metadata_elm = ET.Element('metadata') + metadata_elm = ET.Element("metadata") for k, v in list(metadata.items()): - meta_elm = ET.SubElement(metadata_elm, 'meta', {'key': str(k)}) + meta_elm = ET.SubElement(metadata_elm, "meta", {"key": str(k)}) meta_elm.text = str(v) return metadata_elm def _files_to_xml(self, files): - if len(files) == 0: + if not files: return None - personality_elm = ET.Element('personality') + personality_elm = ET.Element("personality") for k, v in list(files.items()): - file_elm = ET.SubElement(personality_elm, - 'file', - {'path': str(k)}) - file_elm.text = base64.b64encode(b(v)) + file_elm = ET.SubElement(personality_elm, "file", {"path": str(k)}) + file_elm.text = base64.b64encode(b(v)).decode("ascii") return personality_elm - def _reboot_node(self, node, reboot_type='SOFT'): - resp = self._node_action(node, ['reboot', ('type', reboot_type)]) + def _reboot_node(self, node, reboot_type="SOFT"): + resp = self._node_action(node, ["reboot", ("type", reboot_type)]) return resp.status == httplib.ACCEPTED def _node_action(self, node, body): if isinstance(body, list): - attr = ' '.join(['%s="%s"' % (item[0], item[1]) - for item in body[1:]]) - body = '<%s xmlns="%s" %s/>' % (body[0], self.XML_NAMESPACE, attr) - uri = '/servers/%s/action' % (node.id) - resp = self.connection.request(uri, method='POST', data=body) + attr = " ".join(['{}="{}"'.format(item[0], item[1]) for item in body[1:]]) + body = '<{} xmlns="{}" {}/>'.format(body[0], self.XML_NAMESPACE, attr) + uri = "/servers/%s/action" % (node.id) + resp = self.connection.request(uri, method="POST", data=body) return resp def _to_nodes(self, object): - node_elements = findall(object, 'server', self.XML_NAMESPACE) + node_elements = findall(object, "server", self.XML_NAMESPACE) return [self._to_node(el) for el in node_elements] def _to_node_from_obj(self, obj): - return self._to_node(findall(obj, 'server', self.XML_NAMESPACE)[0]) + return self._to_node(findall(obj, "server", self.XML_NAMESPACE)[0]) def _to_node(self, el): def get_ips(el): - return [ip.get('addr') for ip in el] + return [ip.get("addr") for ip in el] def get_meta_dict(el): d = {} for meta in el: - d[meta.get('key')] = meta.text + d[meta.get("key")] = meta.text return d - public_ip = get_ips(findall(el, 'addresses/public/ip', - self.XML_NAMESPACE)) - private_ip = get_ips(findall(el, 'addresses/private/ip', - self.XML_NAMESPACE)) - metadata = get_meta_dict(findall(el, 'metadata/meta', - self.XML_NAMESPACE)) - - n = Node(id=el.get('id'), - name=el.get('name'), - state=self.NODE_STATE_MAP.get( - el.get('status'), NodeState.UNKNOWN), - public_ips=public_ip, - private_ips=private_ip, - driver=self.connection.driver, - extra={ - 'password': el.get('adminPass'), - 'hostId': el.get('hostId'), - 'imageId': el.get('imageId'), - 'flavorId': el.get('flavorId'), - 'uri': "https://%s%s/servers/%s" % ( - self.connection.host, - self.connection.request_path, el.get('id')), - 'metadata': metadata}) + public_ip = get_ips(findall(el, "addresses/public/ip", self.XML_NAMESPACE)) + private_ip = get_ips(findall(el, "addresses/private/ip", self.XML_NAMESPACE)) + metadata = get_meta_dict(findall(el, "metadata/meta", self.XML_NAMESPACE)) + + n = Node( + id=el.get("id"), + name=el.get("name"), + state=self.NODE_STATE_MAP.get(el.get("status"), NodeState.UNKNOWN), + public_ips=public_ip, + private_ips=private_ip, + driver=self.connection.driver, + # pylint: disable=no-member + extra={ + "password": el.get("adminPass"), + "hostId": el.get("hostId"), + "imageId": el.get("imageId"), + "flavorId": el.get("flavorId"), + "uri": "https://%s%s/servers/%s" + % (self.connection.host, self.connection.request_path, el.get("id")), + "service_name": self.connection.get_service_name(), + "metadata": metadata, + }, + ) return n def _to_sizes(self, object): - elements = findall(object, 'flavor', self.XML_NAMESPACE) + elements = findall(object, "flavor", self.XML_NAMESPACE) return [self._to_size(el) for el in elements] def _to_size(self, el): - vcpus = int(el.get('vcpus')) if el.get('vcpus', None) else None - return OpenStackNodeSize(id=el.get('id'), - name=el.get('name'), - ram=int(el.get('ram')), - disk=int(el.get('disk')), - # XXX: needs hardcode - vcpus=vcpus, - bandwidth=None, - # Hardcoded - price=self._get_size_price(el.get('id')), - driver=self.connection.driver) + vcpus = int(el.get("vcpus")) if el.get("vcpus", None) else None + return OpenStackNodeSize( + id=el.get("id"), + name=el.get("name"), + ram=int(el.get("ram")), + disk=int(el.get("disk")), + # XXX: needs hardcode + vcpus=vcpus, + bandwidth=None, + extra=el.get("extra_specs"), + # Hardcoded + price=self._get_size_price(el.get("id")), + driver=self.connection.driver, + ) def ex_limits(self): """ @@ -885,19 +1096,17 @@ def _to_rate(el): return rate def _to_absolute(el): - return {el.get('name'): el.get('value')} + return {el.get("name"): el.get("value")} limits = self.connection.request("/limits").object - rate = [_to_rate(el) for el in findall(limits, 'rate/limit', - self.XML_NAMESPACE)] + rate = [_to_rate(el) for el in findall(limits, "rate/limit", self.XML_NAMESPACE)] absolute = {} - for item in findall(limits, 'absolute/limit', - self.XML_NAMESPACE): + for item in findall(limits, "absolute/limit", self.XML_NAMESPACE): absolute.update(_to_absolute(item)) return {"rate": rate, "absolute": absolute} - def create_image(self, node, name, description=None, reboot=True): + def create_image(self, node, name, description=None): """Create an image for node. @inherits: :class:`NodeDriver.create_image` @@ -912,62 +1121,63 @@ def create_image(self, node, name, description=None, reboot=True): """ image_elm = ET.Element( - 'image', - {'xmlns': self.XML_NAMESPACE, - 'name': name, - 'serverId': node.id} + "image", {"xmlns": self.XML_NAMESPACE, "name": name, "serverId": node.id} ) return self._to_image( - self.connection.request("/images", method="POST", - data=ET.tostring(image_elm)).object) + self.connection.request("/images", method="POST", data=ET.tostring(image_elm)).object + ) - def delete_image(self, image): + def delete_image( + self, + node_image, + ): """Delete an image for node. @inherits: :class:`NodeDriver.delete_image` - :param image: the image to be deleted - :type image: :class:`NodeImage` + :param node_image: the image to be deleted + :type node_image: :class:`NodeImage` :rtype: ``bool`` """ - uri = '/images/%s' % image.id - resp = self.connection.request(uri, method='DELETE') + image = node_image + uri = "/images/%s" % image.id + resp = self.connection.request(uri, method="DELETE") return resp.status == httplib.NO_CONTENT def _to_shared_ip_group(self, el): - servers_el = findall(el, 'servers', self.XML_NAMESPACE) + servers_el = findall(el, "servers", self.XML_NAMESPACE) if servers_el: - servers = [s.get('id') - for s in findall(servers_el[0], 'server', - self.XML_NAMESPACE)] + servers = [s.get("id") for s in findall(servers_el[0], "server", self.XML_NAMESPACE)] else: servers = None - return OpenStack_1_0_SharedIpGroup(id=el.get('id'), - name=el.get('name'), - servers=servers) + return OpenStack_1_0_SharedIpGroup(id=el.get("id"), name=el.get("name"), servers=servers) def _to_ip_addresses(self, el): - public_ips = [ip.get('addr') for ip in findall( - findall(el, 'public', self.XML_NAMESPACE)[0], - 'ip', self.XML_NAMESPACE)] - private_ips = [ip.get('addr') for ip in findall( - findall(el, 'private', self.XML_NAMESPACE)[0], - 'ip', self.XML_NAMESPACE)] + public_ips = [ + ip.get("addr") + for ip in findall( + findall(el, "public", self.XML_NAMESPACE)[0], "ip", self.XML_NAMESPACE + ) + ] + private_ips = [ + ip.get("addr") + for ip in findall( + findall(el, "private", self.XML_NAMESPACE)[0], "ip", self.XML_NAMESPACE + ) + ] return OpenStack_1_0_NodeIpAddresses(public_ips, private_ips) def _get_size_price(self, size_id): try: - return get_size_price(driver_type='compute', - driver_name=self.api_name, - size_id=size_id) + return get_size_price(driver_type="compute", driver_name=self.api_name, size_id=size_id) except KeyError: return 0.0 -class OpenStack_1_0_SharedIpGroup(object): +class OpenStack_1_0_SharedIpGroup: """ Shared IP group info. """ @@ -978,7 +1188,7 @@ def __init__(self, id, name, servers=None): self.servers = servers -class OpenStack_1_0_NodeIpAddresses(object): +class OpenStack_1_0_NodeIpAddresses: """ List of public and private IP addresses of a Node. """ @@ -993,10 +1203,10 @@ def __init__(self, *args, **kwargs): # done because of a circular reference from # NodeDriver -> Connection -> Response self.node_driver = OpenStack_1_1_NodeDriver - super(OpenStack_1_1_Response, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) -class OpenStackNetwork(object): +class OpenStackNetwork: """ A Virtual Network. """ @@ -1009,18 +1219,19 @@ def __init__(self, id, name, cidr, driver, extra=None): self.extra = extra or {} def __repr__(self): - return '' % (self.id, - self.name, - self.cidr,) + return ''.format( + self.id, + self.name, + self.cidr, + ) -class OpenStackSecurityGroup(object): +class OpenStackSecurityGroup: """ A Security Group. """ - def __init__(self, id, tenant_id, name, description, driver, rules=None, - extra=None): + def __init__(self, id, tenant_id, name, description, driver, rules=None, extra=None): """ Constructor. @@ -1054,19 +1265,29 @@ def __init__(self, id, tenant_id, name, description, driver, rules=None, self.extra = extra or {} def __repr__(self): - return ('' % (self.id, self.tenant_id, self.name, - self.description)) + return "".format(self.id, self.tenant_id, self.name, self.description) -class OpenStackSecurityGroupRule(object): +class OpenStackSecurityGroupRule: """ A Rule of a Security Group. """ - def __init__(self, id, parent_group_id, ip_protocol, from_port, to_port, - driver, ip_range=None, group=None, tenant_id=None, - extra=None): + def __init__( + self, + id, + parent_group_id, + ip_protocol, + from_port, + to_port, + driver, + ip_range=None, + group=None, + tenant_id=None, + direction=None, + extra=None, + ): """ Constructor. @@ -1094,6 +1315,9 @@ def __init__(self, id, parent_group_id, ip_protocol, from_port, to_port, :keyword tenant_id: Owner of the security group. :type tenant_id: ``str`` + :keyword direction: Security group Direction (ingress or egress). + :type direction: ``str`` + :keyword extra: Extra attributes associated with this rule. :type extra: ``dict`` """ @@ -1103,31 +1327,49 @@ def __init__(self, id, parent_group_id, ip_protocol, from_port, to_port, self.from_port = from_port self.to_port = to_port self.driver = driver - self.ip_range = '' + self.ip_range = "" self.group = {} + self.direction = "ingress" if group is None: self.ip_range = ip_range else: - self.group = {'name': group, 'tenant_id': tenant_id} + self.group = {"name": group, "tenant_id": tenant_id} + + # by default in old versions only ingress was used + if direction is not None: + if direction in ["ingress", "egress"]: + self.direction = direction + else: + raise OpenStackException( + "Security group direction incorrect " "value: ingress or egress.", + 500, + driver, + ) self.tenant_id = tenant_id self.extra = extra or {} def __repr__(self): - return ('' % (self.id, - self.parent_group_id, self.ip_protocol, self.from_port, - self.to_port)) + return ( + "" + % ( + self.id, + self.parent_group_id, + self.ip_protocol, + self.from_port, + self.to_port, + ) + ) -class OpenStackKeyPair(object): +class OpenStackKeyPair: """ A KeyPair. """ - def __init__(self, name, fingerprint, public_key, driver, private_key=None, - extra=None): + def __init__(self, name, fingerprint, public_key, driver, private_key=None, extra=None): """ Constructor. @@ -1154,14 +1396,17 @@ def __init__(self, name, fingerprint, public_key, driver, private_key=None, self.extra = extra or {} def __repr__(self): - return ('' - % (self.name, self.fingerprint, self.public_key)) + return "".format( + self.name, + self.fingerprint, + self.public_key, + ) class OpenStack_1_1_Connection(OpenStackComputeConnection): responseCls = OpenStack_1_1_Response - accept_format = 'application/json' - default_content_type = 'application/json; charset=UTF-8' + accept_format = "application/json" + default_content_type = "application/json; charset=UTF-8" def encode_data(self, data): return json.dumps(data) @@ -1171,18 +1416,37 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver): """ OpenStack node driver. """ + connectionCls = OpenStack_1_1_Connection type = Provider.OPENSTACK features = {"create_node": ["generates_password"]} - _networks_url_prefix = '/os-networks' + _networks_url_prefix = "/os-networks" def __init__(self, *args, **kwargs): - self._ex_force_api_version = str(kwargs.pop('ex_force_api_version', - None)) - super(OpenStack_1_1_NodeDriver, self).__init__(*args, **kwargs) - - def create_node(self, **kwargs): + self._ex_force_api_version = str(kwargs.pop("ex_force_api_version", None)) + super().__init__(*args, **kwargs) + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_keyname=None, + ex_userdata=None, + ex_config_drive=None, + ex_security_groups=None, + ex_metadata=None, + ex_files=None, + networks=None, + ex_disk_config=None, + ex_admin_pass=None, + ex_availability_zone=None, + ex_blockdevicemappings=None, + ex_os_scheduler_hints=None, + ): """Create a new node @inherits: :class:`NodeDriver.create_node` @@ -1195,6 +1459,11 @@ def create_node(self, **kwargs): https://help.ubuntu.com/community/CloudInit :type ex_userdata: ``str`` + :keyword ex_config_drive: Enable config drive + see + http://docs.openstack.org/grizzly/openstack-compute/admin/content/config-drive.html + :type ex_config_drive: ``bool`` + :keyword ex_security_groups: List of security groups to assign to the node :type ex_security_groups: ``list`` of @@ -1204,7 +1473,7 @@ def create_node(self, **kwargs): :type ex_metadata: ``dict`` :keyword ex_files: File Path => File contents to create on - the no de + the node :type ex_files: ``dict`` @@ -1224,125 +1493,183 @@ def create_node(self, **kwargs): :keyword ex_availability_zone: Nova availability zone for the node :type ex_availability_zone: ``str`` - """ - server_params = self._create_args_to_params(None, **kwargs) + :keyword ex_blockdevicemappings: Enables fine grained control of the + block device mapping for an instance. + :type ex_blockdevicemappings: ``dict`` + + :keyword ex_os_scheduler_hints: The dictionary of data to send to + the scheduler. + :type ex_os_scheduler_hints: ``dict`` + """ + ex_metadata = ex_metadata or {} + ex_files = ex_files or {} + networks = networks or [] + ex_security_groups = ex_security_groups or [] + + server_params = self._create_args_to_params( + node=None, + name=name, + size=size, + image=image, + ex_keyname=ex_keyname, + ex_userdata=ex_userdata, + ex_config_drive=ex_config_drive, + ex_security_groups=ex_security_groups, + ex_metadata=ex_metadata, + ex_files=ex_files, + networks=networks, + ex_disk_config=ex_disk_config, + ex_availability_zone=ex_availability_zone, + ex_blockdevicemappings=ex_blockdevicemappings, + ) + + data = {"server": server_params} + if ex_os_scheduler_hints: + data["os:scheduler_hints"] = ex_os_scheduler_hints - resp = self.connection.request("/servers", - method='POST', - data={'server': server_params}) + resp = self.connection.request("/servers", method="POST", data=data) - create_response = resp.object['server'] - server_resp = self.connection.request( - '/servers/%s' % create_response['id']) - server_object = server_resp.object['server'] + create_response = resp.object["server"] + server_resp = self.connection.request("/servers/%s" % create_response["id"]) + server_object = server_resp.object["server"] # adminPass is not always present # http://docs.openstack.org/essex/openstack-compute/admin/ # content/configuring-compute-API.html#d6e1833 - server_object['adminPass'] = create_response.get('adminPass', None) + server_object["adminPass"] = create_response.get("adminPass", None) return self._to_node(server_object) def _to_images(self, obj, ex_only_active): images = [] - for image in obj['images']: - if ex_only_active and image.get('status') != 'ACTIVE': + for image in obj["images"]: + if ex_only_active and image.get("status") != "ACTIVE": continue images.append(self._to_image(image)) return images def _to_image(self, api_image): - server = api_image.get('server', {}) + server = api_image.get("server", {}) + updated = api_image.get("updated_at") or api_image["updated"] + created = api_image.get("created_at") or api_image["created"] + min_ram = api_image.get("min_ram") + + if min_ram is None: + min_ram = api_image.get("minRam") + + min_disk = api_image.get("min_disk") + + if min_disk is None: + min_disk = api_image.get("minDisk") + return NodeImage( - id=api_image['id'], - name=api_image['name'], + id=api_image["id"], + name=api_image["name"], driver=self, extra=dict( - updated=api_image['updated'], - created=api_image['created'], - status=api_image['status'], - progress=api_image.get('progress'), - metadata=api_image.get('metadata'), - serverId=server.get('id'), - minDisk=api_image.get('minDisk'), - minRam=api_image.get('minRam'), - ) + visibility=api_image.get("visibility"), + updated=updated, + created=created, + status=api_image["status"], + progress=api_image.get("progress"), + metadata=api_image.get("metadata"), + os_type=api_image.get("os_type"), + os_distro=api_image.get("os_distro"), + os_version=api_image.get("os_version"), + serverId=server.get("id"), + minDisk=min_disk, + minRam=min_ram, + ), + ) + + def _to_image_member(self, api_image_member): + created = api_image_member["created_at"] + updated = api_image_member.get("updated_at") + return NodeImageMember( + id=api_image_member["member_id"], + image_id=api_image_member["image_id"], + state=api_image_member["status"], + created=created, + driver=self, + extra=dict( + schema=api_image_member.get("schema"), + updated=updated, + ), ) def _to_nodes(self, obj): - servers = obj['servers'] + servers = obj["servers"] return [self._to_node(server) for server in servers] def _to_volumes(self, obj): - volumes = obj['volumes'] + volumes = obj["volumes"] return [self._to_volume(volume) for volume in volumes] def _to_snapshots(self, obj): - snapshots = obj['snapshots'] + snapshots = obj["snapshots"] return [self._to_snapshot(snapshot) for snapshot in snapshots] def _to_sizes(self, obj): - flavors = obj['flavors'] + flavors = obj["flavors"] return [self._to_size(flavor) for flavor in flavors] def _create_args_to_params(self, node, **kwargs): server_params = { - 'name': kwargs.get('name'), - 'metadata': kwargs.get('ex_metadata', {}), - 'personality': self._files_to_personality(kwargs.get("ex_files", - {})) + "name": kwargs.get("name"), + "metadata": kwargs.get("ex_metadata", {}) or {}, } - if 'ex_availability_zone' in kwargs: - server_params['availability_zone'] = kwargs['ex_availability_zone'] + if kwargs.get("ex_files", None): + server_params["personality"] = self._files_to_personality(kwargs.get("ex_files")) - if 'ex_keyname' in kwargs: - server_params['key_name'] = kwargs['ex_keyname'] + if kwargs.get("ex_availability_zone", None): + server_params["availability_zone"] = kwargs["ex_availability_zone"] - if 'ex_userdata' in kwargs: - server_params['user_data'] = base64.b64encode( - b(kwargs['ex_userdata'])).decode('ascii') + if kwargs.get("ex_keyname", None): + server_params["key_name"] = kwargs["ex_keyname"] - if 'ex_disk_config' in kwargs: - server_params['OS-DCF:diskConfig'] = kwargs['ex_disk_config'] + if kwargs.get("ex_userdata", None): + server_params["user_data"] = base64.b64encode(b(kwargs["ex_userdata"])).decode("ascii") - if 'ex_config_drive' in kwargs: - server_params['config_drive'] = str(kwargs['ex_config_drive']) + if kwargs.get("ex_disk_config", None): + server_params["OS-DCF:diskConfig"] = kwargs["ex_disk_config"] - if 'ex_admin_pass' in kwargs: - server_params['adminPass'] = kwargs['ex_admin_pass'] + if kwargs.get("ex_config_drive", None): + server_params["config_drive"] = str(kwargs["ex_config_drive"]) - if 'networks' in kwargs: - networks = kwargs['networks'] - networks = [{'uuid': network.id} for network in networks] - server_params['networks'] = networks + if kwargs.get("ex_admin_pass", None): + server_params["adminPass"] = kwargs["ex_admin_pass"] - if 'ex_security_groups' in kwargs: - server_params['security_groups'] = [] - for security_group in kwargs['ex_security_groups']: + if kwargs.get("networks", None): + networks = kwargs["networks"] or [] + networks = [{"uuid": network.id} for network in networks] + server_params["networks"] = networks + + if kwargs.get("ex_security_groups", None): + server_params["security_groups"] = [] + for security_group in kwargs["ex_security_groups"] or []: name = security_group.name - server_params['security_groups'].append({'name': name}) + server_params["security_groups"].append({"name": name}) - if 'ex_blockdevicemappings' in kwargs: - server_params['block_device_mapping_v2'] = \ - kwargs['ex_blockdevicemappings'] + if kwargs.get("ex_blockdevicemappings", None): + server_params["block_device_mapping_v2"] = kwargs["ex_blockdevicemappings"] - if 'name' in kwargs: - server_params['name'] = kwargs.get('name') + if kwargs.get("name", None): + server_params["name"] = kwargs.get("name") else: - server_params['name'] = node.name + server_params["name"] = node.name - if 'image' in kwargs: - server_params['imageRef'] = kwargs.get('image').id + if kwargs.get("image", None): + server_params["imageRef"] = kwargs.get("image").id else: - server_params['imageRef'] = node.extra.get('imageId') + server_params["imageRef"] = node.extra.get("imageId", "") if node else "" - if 'size' in kwargs: - server_params['flavorRef'] = kwargs.get('size').id + if kwargs.get("size", None): + server_params["flavorRef"] = kwargs.get("size").id else: - server_params['flavorRef'] = node.extra.get('flavorId') + server_params["flavorRef"] = node.extra.get("flavorId") return server_params @@ -1350,12 +1677,12 @@ def _files_to_personality(self, files): rv = [] for k, v in list(files.items()): - rv.append({'path': k, 'contents': base64.b64encode(b(v))}) + rv.append({"path": k, "contents": base64.b64encode(b(v)).decode()}) return rv - def _reboot_node(self, node, reboot_type='SOFT'): - resp = self._node_action(node, 'reboot', type=reboot_type) + def _reboot_node(self, node, reboot_type="SOFT"): + resp = self._node_action(node, "reboot", type=reboot_type) return resp.status == httplib.ACCEPTED def ex_set_password(self, node, password): @@ -1370,8 +1697,8 @@ def ex_set_password(self, node, password): :rtype: ``bool`` """ - resp = self._node_action(node, 'changePassword', adminPass=password) - node.extra['password'] = password + resp = self._node_action(node, "changePassword", adminPass=password) + node.extra["password"] = password return resp.status == httplib.ACCEPTED def ex_rebuild(self, node, image, **kwargs): @@ -1388,7 +1715,7 @@ def ex_rebuild(self, node, image, **kwargs): :type ex_metadata: ``dict`` :keyword ex_files: File Path => File contents to create on - the no de + the node :type ex_files: ``dict`` :keyword ex_keyname: Name of existing public key to inject into @@ -1415,9 +1742,8 @@ def ex_rebuild(self, node, image, **kwargs): :rtype: ``bool`` """ - server_params = self._create_args_to_params(node, image=image, - **kwargs) - resp = self._node_action(node, 'rebuild', **server_params) + server_params = self._create_args_to_params(node, image=image, **kwargs) + resp = self._node_action(node, "rebuild", **server_params) return resp.status == httplib.ACCEPTED def ex_resize(self, node, size): @@ -1432,8 +1758,8 @@ def ex_resize(self, node, size): :rtype: ``bool`` """ - server_params = self._create_args_to_params(node, size=size) - resp = self._node_action(node, 'resize', **server_params) + server_params = {"flavorRef": size.id} + resp = self._node_action(node, "resize", **server_params) return resp.status == httplib.ACCEPTED def ex_confirm_resize(self, node): @@ -1445,7 +1771,7 @@ def ex_confirm_resize(self, node): :rtype: ``bool`` """ - resp = self._node_action(node, 'confirmResize') + resp = self._node_action(node, "confirmResize") return resp.status == httplib.NO_CONTENT def ex_revert_resize(self, node): @@ -1457,10 +1783,16 @@ def ex_revert_resize(self, node): :rtype: ``bool`` """ - resp = self._node_action(node, 'revertResize') + resp = self._node_action(node, "revertResize") return resp.status == httplib.ACCEPTED - def create_image(self, node, name, metadata=None): + def create_image( + self, + node, + name, + description=None, + metadata=None, + ): """ Creates a new image. @@ -1470,17 +1802,24 @@ def create_image(self, node, name, metadata=None): :param name: The name for the new image. :type name: ``str`` + :param description: A description for the new image. Stored in the + image metadata because the Compute API does not + provide a dedicated description field. + :type description: ``str`` + :param metadata: Key and value pairs for metadata. :type metadata: ``dict`` :rtype: :class:`NodeImage` """ optional_params = {} - if metadata: - optional_params['metadata'] = metadata - resp = self._node_action(node, 'createImage', name=name, - **optional_params) - image_id = self._extract_image_id_from_url(resp.headers['location']) + image_metadata = dict(metadata) if metadata else {} + if description is not None: + image_metadata["description"] = description + if image_metadata: + optional_params["metadata"] = image_metadata + resp = self._node_action(node, "createImage", name=name, **optional_params) + image_id = self._extract_image_id_from_url(resp.headers["location"]) return self.get_image(image_id=image_id) def ex_set_server_name(self, node, name): @@ -1508,8 +1847,9 @@ def ex_get_metadata(self, node): :rtype: ``dict`` """ return self.connection.request( - '/servers/%s/metadata' % (node.id,), - method='GET',).object['metadata'] + "/servers/{}/metadata".format(node.id), + method="GET", + ).object["metadata"] def ex_set_metadata(self, node, metadata): """ @@ -1524,9 +1864,10 @@ def ex_set_metadata(self, node, metadata): :rtype: ``dict`` """ return self.connection.request( - '/servers/%s/metadata' % (node.id,), method='PUT', - data={'metadata': metadata} - ).object['metadata'] + "/servers/{}/metadata".format(node.id), + method="PUT", + data={"metadata": metadata}, + ).object["metadata"] def ex_update_node(self, node, **node_updates): """ @@ -1544,18 +1885,17 @@ def ex_update_node(self, node, **node_updates): :rtype: :class:`Node` """ potential_data = self._create_args_to_params(node, **node_updates) - updates = {'name': potential_data['name']} + updates = {"name": potential_data["name"]} return self._update_node(node, **updates) def _to_networks(self, obj): - networks = obj['networks'] + networks = obj["networks"] return [self._to_network(network) for network in networks] def _to_network(self, obj): - return OpenStackNetwork(id=obj['id'], - name=obj['label'], - cidr=obj.get('cidr', None), - driver=self) + return OpenStackNetwork( + id=obj["id"], name=obj["label"], cidr=obj.get("cidr", None), driver=self + ) def ex_list_networks(self): """ @@ -1566,6 +1906,21 @@ def ex_list_networks(self): response = self.connection.request(self._networks_url_prefix).object return self._to_networks(response) + def ex_get_network(self, network_id): + """ + Retrieve the Network with the given ID + + :param networkId: ID of the network + :type networkId: ``str`` + + :rtype :class:`OpenStackNetwork` + """ + request_url = "{networks_url_prefix}/{network_id}".format( + networks_url_prefix=self._networks_url_prefix, network_id=network_id + ) + response = self.connection.request(request_url).object + return self._to_network(response["network"]) + def ex_create_network(self, name, cidr): """ Create a new Network @@ -1578,24 +1933,25 @@ def ex_create_network(self, name, cidr): :rtype: :class:`OpenStackNetwork` """ - data = {'network': {'cidr': cidr, 'label': name}} - response = self.connection.request(self._networks_url_prefix, - method='POST', data=data).object - return self._to_network(response['network']) + data = {"network": {"cidr": cidr, "label": name}} + response = self.connection.request( + self._networks_url_prefix, method="POST", data=data + ).object + return self._to_network(response["network"]) def ex_delete_network(self, network): """ - Get a list of NodeNetorks that are available. + Delete a Network :param network: Network which should be used :type network: :class:`OpenStackNetwork` :rtype: ``bool`` """ - resp = self.connection.request('%s/%s' % (self._networks_url_prefix, - network.id), - method='DELETE') - return resp.status == httplib.ACCEPTED + resp = self.connection.request( + "{}/{}".format(self._networks_url_prefix, network.id), method="DELETE" + ) + return resp.status in (httplib.NO_CONTENT, httplib.ACCEPTED) def ex_get_console_output(self, node, length=None): """ @@ -1612,26 +1968,27 @@ def ex_get_console_output(self, node, length=None): :rtype: ``dict`` """ - data = { - "os-getConsoleOutput": { - "length": length - } - } + data = {"os-getConsoleOutput": {"length": length}} - resp = self.connection.request('/servers/%s/action' % node.id, - method='POST', data=data).object + resp = self.connection.request( + "/servers/%s/action" % node.id, method="POST", data=data + ).object return resp def ex_list_snapshots(self): - return self._to_snapshots( - self.connection.request('/os-snapshots').object) + return self._to_snapshots(self.connection.request("/os-snapshots").object) + + def ex_get_snapshot(self, snapshotId): + return self._to_snapshot(self.connection.request("/os-snapshots/%s" % snapshotId).object) def list_volume_snapshots(self, volume): - return [snapshot for snapshot in self.ex_list_snapshots() - if snapshot.extra['volume_id'] == volume.id] + return [ + snapshot + for snapshot in self.ex_list_snapshots() + if snapshot.extra["volume_id"] == volume.id + ] - def create_volume_snapshot(self, volume, name=None, ex_description=None, - ex_force=True): + def create_volume_snapshot(self, volume, name=None, ex_description=None, ex_force=True): """ Create snapshot from volume @@ -1639,10 +1996,10 @@ def create_volume_snapshot(self, volume, name=None, ex_description=None, :type volume: `StorageVolume` :param name: Name of snapshot (optional) - :type name: `str` + :type name: `str` | `NoneType` :param ex_description: Description of the snapshot (optional) - :type ex_description: `str` + :type ex_description: `str` | `NoneType` :param ex_force: Specifies if we create a snapshot that is not in state `available`. For example `in-use`. Defaults @@ -1651,18 +2008,20 @@ def create_volume_snapshot(self, volume, name=None, ex_description=None, :rtype: :class:`VolumeSnapshot` """ - data = {'snapshot': {'display_name': name, - 'display_description': ex_description, - 'volume_id': volume.id, - 'force': ex_force}} + data = {"snapshot": {"volume_id": volume.id, "force": ex_force}} + + if name is not None: + data["snapshot"]["display_name"] = name - return self._to_snapshot(self.connection.request('/os-snapshots', - method='POST', - data=data).object) + if ex_description is not None: + data["snapshot"]["display_description"] = ex_description + + return self._to_snapshot( + self.connection.request("/os-snapshots", method="POST", data=data).object + ) def destroy_volume_snapshot(self, snapshot): - resp = self.connection.request('/os-snapshots/%s' % snapshot.id, - method='DELETE') + resp = self.connection.request("/os-snapshots/%s" % snapshot.id, method="DELETE") return resp.status == httplib.NO_CONTENT def ex_create_snapshot(self, volume, name, description=None, force=False): @@ -1683,11 +2042,10 @@ def ex_create_snapshot(self, volume, name, description=None, force=False): :rtype: :class:`VolumeSnapshot` """ - warnings.warn('This method has been deprecated in favor of the ' - 'create_volume_snapshot method') - return self.create_volume_snapshot(volume, name, - ex_description=description, - ex_force=force) + warnings.warn( + "This method has been deprecated in favor of the " "create_volume_snapshot method" + ) + return self.create_volume_snapshot(volume, name, ex_description=description, ex_force=force) def ex_delete_snapshot(self, snapshot): """ @@ -1698,41 +2056,48 @@ def ex_delete_snapshot(self, snapshot): :rtype: ``bool`` """ - warnings.warn('This method has been deprecated in favor of the ' - 'destroy_volume_snapshot method') + warnings.warn( + "This method has been deprecated in favor of the " "destroy_volume_snapshot method" + ) return self.destroy_volume_snapshot(snapshot) def _to_security_group_rules(self, obj): - return [self._to_security_group_rule(security_group_rule) for - security_group_rule in obj] + return [self._to_security_group_rule(security_group_rule) for security_group_rule in obj] def _to_security_group_rule(self, obj): ip_range = group = tenant_id = None - if obj['group'] == {}: - ip_range = obj['ip_range'].get('cidr', None) + if obj["group"] == {}: + ip_range = obj["ip_range"].get("cidr", None) else: - group = obj['group'].get('name', None) - tenant_id = obj['group'].get('tenant_id', None) + group = obj["group"].get("name", None) + tenant_id = obj["group"].get("tenant_id", None) return OpenStackSecurityGroupRule( - id=obj['id'], parent_group_id=obj['parent_group_id'], - ip_protocol=obj['ip_protocol'], from_port=obj['from_port'], - to_port=obj['to_port'], driver=self, ip_range=ip_range, - group=group, tenant_id=tenant_id) + id=obj["id"], + parent_group_id=obj["parent_group_id"], + ip_protocol=obj["ip_protocol"], + from_port=obj["from_port"], + to_port=obj["to_port"], + driver=self, + ip_range=ip_range, + group=group, + tenant_id=tenant_id, + ) def _to_security_groups(self, obj): - security_groups = obj['security_groups'] - return [self._to_security_group(security_group) for security_group in - security_groups] + security_groups = obj["security_groups"] + return [self._to_security_group(security_group) for security_group in security_groups] def _to_security_group(self, obj): - rules = self._to_security_group_rules(obj.get('rules', [])) - return OpenStackSecurityGroup(id=obj['id'], - tenant_id=obj['tenant_id'], - name=obj['name'], - description=obj.get('description', ''), - rules=rules, - driver=self) + rules = self._to_security_group_rules(obj.get("security_group_rules", obj.get("rules", []))) + return OpenStackSecurityGroup( + id=obj["id"], + tenant_id=obj["tenant_id"], + name=obj["name"], + description=obj.get("description", ""), + rules=rules, + driver=self, + ) def ex_list_security_groups(self): """ @@ -1740,8 +2105,7 @@ def ex_list_security_groups(self): :rtype: ``list`` of :class:`OpenStackSecurityGroup` """ - return self._to_security_groups( - self.connection.request('/os-security-groups').object) + return self._to_security_groups(self.connection.request("/os-security-groups").object) def ex_get_node_security_groups(self, node): """ @@ -1750,8 +2114,8 @@ def ex_get_node_security_groups(self, node): :rtype: ``list`` of :class:`OpenStackSecurityGroup` """ return self._to_security_groups( - self.connection.request('/servers/%s/os-security-groups' % - (node.id)).object) + self.connection.request("/servers/%s/os-security-groups" % (node.id)).object + ) def ex_create_security_group(self, name, description): """ @@ -1765,10 +2129,13 @@ def ex_create_security_group(self, name, description): :rtype: :class:`OpenStackSecurityGroup` """ - return self._to_security_group(self.connection.request( - '/os-security-groups', method='POST', - data={'security_group': {'name': name, 'description': description}} - ).object['security_group']) + return self._to_security_group( + self.connection.request( + "/os-security-groups", + method="POST", + data={"security_group": {"name": name, "description": description}}, + ).object["security_group"] + ) def ex_delete_security_group(self, security_group): """ @@ -1779,14 +2146,20 @@ def ex_delete_security_group(self, security_group): :rtype: ``bool`` """ - resp = self.connection.request('/os-security-groups/%s' % - (security_group.id), - method='DELETE') + resp = self.connection.request( + "/os-security-groups/%s" % (security_group.id), method="DELETE" + ) return resp.status in (httplib.NO_CONTENT, httplib.ACCEPTED) - def ex_create_security_group_rule(self, security_group, ip_protocol, - from_port, to_port, cidr=None, - source_security_group=None): + def ex_create_security_group_rule( + self, + security_group, + ip_protocol, + from_port, + to_port, + cidr=None, + source_security_group=None, + ): """ Create a new Rule in a Security Group @@ -1816,16 +2189,22 @@ def ex_create_security_group_rule(self, security_group, ip_protocol, if type(source_security_group) == OpenStackSecurityGroup: source_security_group_id = source_security_group.id - return self._to_security_group_rule(self.connection.request( - '/os-security-group-rules', method='POST', - data={'security_group_rule': { - 'ip_protocol': ip_protocol, - 'from_port': from_port, - 'to_port': to_port, - 'cidr': cidr, - 'group_id': source_security_group_id, - 'parent_group_id': security_group.id}} - ).object['security_group_rule']) + return self._to_security_group_rule( + self.connection.request( + "/os-security-group-rules", + method="POST", + data={ + "security_group_rule": { + "ip_protocol": ip_protocol, + "from_port": from_port, + "to_port": to_port, + "cidr": cidr, + "group_id": source_security_group_id, + "parent_group_id": security_group.id, + } + }, + ).object["security_group_rule"] + ) def ex_delete_security_group_rule(self, rule): """ @@ -1836,48 +2215,46 @@ def ex_delete_security_group_rule(self, rule): :rtype: ``bool`` """ - resp = self.connection.request('/os-security-group-rules/%s' % - (rule.id), method='DELETE') + resp = self.connection.request("/os-security-group-rules/%s" % (rule.id), method="DELETE") return resp.status == httplib.NO_CONTENT def _to_key_pairs(self, obj): - key_pairs = obj['keypairs'] - key_pairs = [self._to_key_pair(key_pair['keypair']) for key_pair in - key_pairs] + key_pairs = obj["keypairs"] + key_pairs = [self._to_key_pair(key_pair["keypair"]) for key_pair in key_pairs] return key_pairs def _to_key_pair(self, obj): - key_pair = KeyPair(name=obj['name'], - fingerprint=obj['fingerprint'], - public_key=obj['public_key'], - private_key=obj.get('private_key', None), - driver=self) + key_pair = KeyPair( + name=obj["name"], + fingerprint=obj["fingerprint"], + public_key=obj["public_key"], + private_key=obj.get("private_key", None), + driver=self, + ) return key_pair def list_key_pairs(self): - response = self.connection.request('/os-keypairs') + response = self.connection.request("/os-keypairs") key_pairs = self._to_key_pairs(response.object) return key_pairs def get_key_pair(self, name): - self.connection.set_context({'key_pair_name': name}) + self.connection.set_context({"key_pair_name": name}) - response = self.connection.request('/os-keypairs/%s' % (name)) - key_pair = self._to_key_pair(response.object['keypair']) + response = self.connection.request("/os-keypairs/%s" % (name)) + key_pair = self._to_key_pair(response.object["keypair"]) return key_pair def create_key_pair(self, name): - data = {'keypair': {'name': name}} - response = self.connection.request('/os-keypairs', method='POST', - data=data) - key_pair = self._to_key_pair(response.object['keypair']) + data = {"keypair": {"name": name}} + response = self.connection.request("/os-keypairs", method="POST", data=data) + key_pair = self._to_key_pair(response.object["keypair"]) return key_pair def import_key_pair_from_string(self, name, key_material): - data = {'keypair': {'name': name, 'public_key': key_material}} - response = self.connection.request('/os-keypairs', method='POST', - data=data) - key_pair = self._to_key_pair(response.object['keypair']) + data = {"keypair": {"name": name, "public_key": key_material}} + response = self.connection.request("/os-keypairs", method="POST", data=data) + key_pair = self._to_key_pair(response.object["keypair"]) return key_pair def delete_key_pair(self, key_pair): @@ -1889,8 +2266,7 @@ def delete_key_pair(self, key_pair): :rtype: ``bool`` """ - response = self.connection.request('/os-keypairs/%s' % (key_pair.name), - method='DELETE') + response = self.connection.request("/os-keypairs/%s" % (key_pair.name), method="DELETE") return response.status == httplib.ACCEPTED def ex_list_keypairs(self): @@ -1899,8 +2275,7 @@ def ex_list_keypairs(self): :rtype: ``list`` of :class:`OpenStackKeyPair` """ - warnings.warn('This method has been deprecated in favor of ' - 'list_key_pairs method') + warnings.warn("This method has been deprecated in favor of " "list_key_pairs method") return self.list_key_pairs() @@ -1913,8 +2288,7 @@ def ex_create_keypair(self, name): :rtype: :class:`OpenStackKeyPair` """ - warnings.warn('This method has been deprecated in favor of ' - 'create_key_pair method') + warnings.warn("This method has been deprecated in favor of " "create_key_pair method") return self.create_key_pair(name=name) @@ -1930,8 +2304,9 @@ def ex_import_keypair(self, name, keyfile): :rtype: :class:`OpenStackKeyPair` """ - warnings.warn('This method has been deprecated in favor of ' - 'import_key_pair_from_file method') + warnings.warn( + "This method has been deprecated in favor of " "import_key_pair_from_file method" + ) return self.import_key_pair_from_file(name=name, key_file_path=keyfile) @@ -1947,11 +2322,11 @@ def ex_import_keypair_from_string(self, name, key_material): :rtype: :class:`OpenStackKeyPair` """ - warnings.warn('This method has been deprecated in favor of ' - 'import_key_pair_from_string method') + warnings.warn( + "This method has been deprecated in favor of " "import_key_pair_from_string method" + ) - return self.import_key_pair_from_string(name=name, - key_material=key_material) + return self.import_key_pair_from_string(name=name, key_material=key_material) def ex_delete_keypair(self, keypair): """ @@ -1962,8 +2337,7 @@ def ex_delete_keypair(self, keypair): :rtype: ``bool`` """ - warnings.warn('This method has been deprecated in favor of ' - 'delete_key_pair method') + warnings.warn("This method has been deprecated in favor of " "delete_key_pair method") return self.delete_key_pair(key_pair=keypair) @@ -1976,8 +2350,22 @@ def ex_get_size(self, size_id): :rtype: :class:`NodeSize` """ - return self._to_size(self.connection.request( - '/flavors/%s' % (size_id,)) .object['flavor']) + return self._to_size( + self.connection.request("/flavors/{}".format(size_id)).object["flavor"] + ) + + def ex_get_size_extra_specs(self, size_id): + """ + Get the extra_specs field of a NodeSize + + :param size_id: ID of the size which should be used + :type size_id: ``str`` + + :rtype: `dict` + """ + return self.connection.request("/flavors/{}/os-extra_specs".format(size_id)).object[ + "extra_specs" + ] def get_image(self, image_id): """ @@ -1990,28 +2378,33 @@ def get_image(self, image_id): :rtype: :class:`NodeImage` """ - return self._to_image(self.connection.request( - '/images/%s' % (image_id,)).object['image']) + return self._to_image( + self.connection.request("/images/{}".format(image_id)).object["image"] + ) - def delete_image(self, image): + def delete_image( + self, + node_image, + ): """ Delete a NodeImage @inherits: :class:`NodeDriver.delete_image` - :param image: image witch should be used - :type image: :class:`NodeImage` + :param node_image: image which should be used + :type node_image: :class:`NodeImage` :rtype: ``bool`` """ - resp = self.connection.request('/images/%s' % (image.id,), - method='DELETE') + image = node_image + resp = self.connection.request("/images/{}".format(image.id), method="DELETE") return resp.status == httplib.NO_CONTENT def _node_action(self, node, action, **params): params = params or None - return self.connection.request('/servers/%s/action' % (node.id,), - method='POST', data={action: params}) + return self.connection.request( + "/servers/{}/action".format(node.id), method="POST", data={action: params} + ) def _update_node(self, node, **node_updates): """ @@ -2020,45 +2413,38 @@ def _update_node(self, node, **node_updates): """ return self._to_node( self.connection.request( - '/servers/%s' % (node.id,), method='PUT', - data={'server': node_updates} - ).object['server'] + "/servers/{}".format(node.id), method="PUT", data={"server": node_updates} + ).object["server"] ) def _to_node_from_obj(self, obj): - return self._to_node(obj['server']) + return self._to_node(obj["server"]) def _to_node(self, api_node): - public_networks_labels = ['public', 'internet'] + public_networks_labels = ["public", "internet"] public_ips, private_ips = [], [] - for label, values in api_node['addresses'].items(): + for label, values in api_node["addresses"].items(): for value in values: - ip = value['addr'] - + ip = value["addr"] is_public_ip = False try: - public_subnet = is_public_subnet(ip) - except: + is_public_ip = is_public_subnet(ip) + except Exception: # IPv6 - public_subnet = False - - # Openstack Icehouse sets 'OS-EXT-IPS:type' to 'floating' for - # public and 'fixed' for private - explicit_ip_type = value.get('OS-EXT-IPS:type', None) - - if explicit_ip_type == 'floating': - is_public_ip = True - elif explicit_ip_type == 'fixed': - is_public_ip = False - elif label in public_networks_labels: - # Try label next - is_public_ip = True - elif public_subnet: - # Check for public subnet - is_public_ip = True + + # Openstack Icehouse sets 'OS-EXT-IPS:type' to 'floating' + # for public and 'fixed' for private + explicit_ip_type = value.get("OS-EXT-IPS:type", None) + + if label in public_networks_labels: + is_public_ip = True + elif explicit_ip_type == "floating": + is_public_ip = True + elif explicit_ip_type == "fixed": + is_public_ip = False if is_public_ip: public_ips.append(ip) @@ -2067,115 +2453,133 @@ def _to_node(self, api_node): # Sometimes 'image' attribute is not present if the node is in an error # state - image = api_node.get('image', None) - image_id = image.get('id', None) if image else None + image = api_node.get("image", None) + image_id = image.get("id", None) if image else None config_drive = api_node.get("config_drive", False) - volumes_attached = api_node.get('os-extended-volumes:volumes_attached') + volumes_attached = api_node.get("os-extended-volumes:volumes_attached") + created = parse_date(api_node["created"]) return Node( - id=api_node['id'], - name=api_node['name'], - state=self.NODE_STATE_MAP.get(api_node['status'], - NodeState.UNKNOWN), + id=api_node["id"], + name=api_node["name"], + state=self.NODE_STATE_MAP.get(api_node["status"], NodeState.UNKNOWN), public_ips=public_ips, private_ips=private_ips, + created_at=created, driver=self, extra=dict( - hostId=api_node['hostId'], - access_ip=api_node.get('accessIPv4'), - access_ipv6=api_node.get('accessIPv6', None), + addresses=api_node["addresses"], + hostId=api_node["hostId"], + access_ip=api_node.get("accessIPv4"), + access_ipv6=api_node.get("accessIPv6", None), # Docs says "tenantId", but actual is "tenant_id". *sigh* # Best handle both. - tenantId=api_node.get('tenant_id') or api_node['tenantId'], - userId=api_node.get('user_id', None), + tenantId=api_node.get("tenant_id") or api_node["tenantId"], + userId=api_node.get("user_id", None), imageId=image_id, - flavorId=api_node['flavor']['id'], - uri=next(link['href'] for link in api_node['links'] if - link['rel'] == 'self'), - metadata=api_node['metadata'], - password=api_node.get('adminPass', None), - created=api_node['created'], - updated=api_node['updated'], - key_name=api_node.get('key_name', None), - disk_config=api_node.get('OS-DCF:diskConfig', None), + flavorId=api_node.get("flavor", {}).get("id", None), + flavor_details=api_node.get("flavor", None), + uri=next(link["href"] for link in api_node["links"] if link["rel"] == "self"), + # pylint: disable=no-member + service_name=self.connection.get_service_name(), + metadata=api_node["metadata"], + password=api_node.get("adminPass", None), + created=api_node["created"], + updated=api_node["updated"], + key_name=api_node.get("key_name", None), + disk_config=api_node.get("OS-DCF:diskConfig", None), config_drive=config_drive, - availability_zone=api_node.get('OS-EXT-AZ:availability_zone'), + availability_zone=api_node.get("OS-EXT-AZ:availability_zone"), volumes_attached=volumes_attached, task_state=api_node.get("OS-EXT-STS:task_state", None), vm_state=api_node.get("OS-EXT-STS:vm_state", None), power_state=api_node.get("OS-EXT-STS:power_state", None), progress=api_node.get("progress", None), + fault=api_node.get("fault"), + hypervisor_hostname=api_node.get("OS-EXT-SRV-ATTR:hypervisor_hostname"), ), ) def _to_volume(self, api_node): - if 'volume' in api_node: - api_node = api_node['volume'] + if "volume" in api_node: + api_node = api_node["volume"] - state = self.VOLUME_STATE_MAP.get(api_node['status'], - StorageVolumeState.UNKNOWN) + state = self.VOLUME_STATE_MAP.get(api_node["status"], StorageVolumeState.UNKNOWN) return StorageVolume( - id=api_node['id'], - name=api_node['displayName'], - size=api_node['size'], + id=api_node["id"], + name=api_node.get("displayName", api_node.get("name")), + size=api_node["size"], state=state, driver=self, extra={ - 'description': api_node['displayDescription'], - 'attachments': [att for att in api_node['attachments'] if att], + "description": api_node.get("displayDescription", api_node.get("description")), + "attachments": [att for att in api_node["attachments"] if att], # TODO: remove in 1.18.0 - 'state': api_node.get('status', None), - 'snapshot_id': api_node.get('snapshotId', None), - 'location': api_node.get('availabilityZone', None), - 'volume_type': api_node.get('volumeType', None), - 'metadata': api_node.get('metadata', None), - 'created_at': api_node.get('createdAt', None) - } + "state": api_node.get("status", None), + "snapshot_id": api_node.get("snapshot_id", api_node.get("snapshotId")), + "location": api_node.get("availability_zone", api_node.get("availabilityZone")), + "volume_type": api_node.get("volume_type", api_node.get("volumeType")), + "metadata": api_node.get("metadata", None), + "created_at": api_node.get("created_at", api_node.get("createdAt")), + }, ) def _to_snapshot(self, data): - if 'snapshot' in data: - data = data['snapshot'] - - volume_id = data.get('volume_id', data.get('volumeId', None)) - display_name = data.get('display_name', data.get('displayName', None)) - created_at = data.get('created_at', data.get('createdAt', None)) - description = data.get('display_description', - data.get('displayDescription', None)) - status = data.get('status', None) - - extra = {'volume_id': volume_id, - 'name': display_name, - 'created': created_at, - 'description': description, - 'status': status} + if "snapshot" in data: + data = data["snapshot"] + + volume_id = data.get("volume_id", data.get("volumeId", None)) + display_name = data.get("name", data.get("display_name", data.get("displayName", None))) + created_at = data.get("created_at", data.get("createdAt", None)) + description = data.get( + "description", + data.get("display_description", data.get("displayDescription", None)), + ) + status = data.get("status", None) + + extra = { + "volume_id": volume_id, + "name": display_name, + "created": created_at, + "description": description, + "status": status, + } + + state = self.SNAPSHOT_STATE_MAP.get(status, VolumeSnapshotState.UNKNOWN) try: created_dt = parse_date(created_at) except ValueError: created_dt = None - snapshot = VolumeSnapshot(id=data['id'], driver=self, - size=data['size'], extra=extra, - created=created_dt) + snapshot = VolumeSnapshot( + id=data["id"], + driver=self, + size=data["size"], + extra=extra, + created=created_dt, + state=state, + name=display_name, + ) return snapshot def _to_size(self, api_flavor, price=None, bandwidth=None): # if provider-specific subclasses can get better values for # price/bandwidth, then can pass them in when they super(). if not price: - price = self._get_size_price(str(api_flavor['id'])) + price = self._get_size_price(str(api_flavor["id"])) - extra = api_flavor.get('OS-FLV-WITH-EXT-SPECS:extra_specs', {}) + extra = api_flavor.get("OS-FLV-WITH-EXT-SPECS:extra_specs", {}) + extra["disabled"] = api_flavor.get("OS-FLV-DISABLED:disabled", None) return OpenStackNodeSize( - id=api_flavor['id'], - name=api_flavor['name'], - ram=api_flavor['ram'], - disk=api_flavor['disk'], - vcpus=api_flavor['vcpus'], - ephemeral_disk=api_flavor.get('OS-FLV-EXT-DATA:ephemeral', None), - swap=api_flavor['swap'], + id=api_flavor["id"], + name=api_flavor["name"], + ram=api_flavor["ram"], + disk=api_flavor["disk"], + vcpus=api_flavor["vcpus"], + ephemeral_disk=api_flavor.get("OS-FLV-EXT-DATA:ephemeral", None), + swap=api_flavor["swap"], extra=extra, bandwidth=bandwidth, price=price, @@ -2185,16 +2589,16 @@ def _to_size(self, api_flavor, price=None, bandwidth=None): def _get_size_price(self, size_id): try: return get_size_price( - driver_type='compute', + driver_type="compute", driver_name=self.api_name, size_id=size_id, ) except KeyError: - return(0.0) + return 0.0 def _extract_image_id_from_url(self, location_header): path = urlparse.urlparse(location_header).path - image_id = path.split('/')[-1] + image_id = path.split("/")[-1] return image_id def ex_rescue(self, node, password=None): @@ -2211,11 +2615,11 @@ def ex_rescue(self, node, password=None): :rtype: :class:`Node` """ if password: - resp = self._node_action(node, 'rescue', adminPass=password) + resp = self._node_action(node, "rescue", adminPass=password) else: - resp = self._node_action(node, 'rescue') - password = json.loads(resp.body)['adminPass'] - node.extra['password'] = password + resp = self._node_action(node, "rescue") + password = json.loads(resp.body)["adminPass"] + node.extra["password"] = password return node def ex_unrescue(self, node): @@ -2227,15 +2631,15 @@ def ex_unrescue(self, node): :rtype: ``bool`` """ - resp = self._node_action(node, 'unrescue') + resp = self._node_action(node, "unrescue") return resp.status == httplib.ACCEPTED def _to_floating_ip_pools(self, obj): - pool_elements = obj['floating_ip_pools'] + pool_elements = obj["floating_ip_pools"] return [self._to_floating_ip_pool(pool) for pool in pool_elements] def _to_floating_ip_pool(self, obj): - return OpenStack_1_1_FloatingIpPool(obj['name'], self.connection) + return OpenStack_1_1_FloatingIpPool(obj["name"], self.connection) def ex_list_floating_ip_pools(self): """ @@ -2243,19 +2647,20 @@ def ex_list_floating_ip_pools(self): :rtype: ``list`` of :class:`OpenStack_1_1_FloatingIpPool` """ - return self._to_floating_ip_pools( - self.connection.request('/os-floating-ip-pools').object) + return self._to_floating_ip_pools(self.connection.request("/os-floating-ip-pools").object) def _to_floating_ips(self, obj): - ip_elements = obj['floating_ips'] + ip_elements = obj["floating_ips"] return [self._to_floating_ip(ip) for ip in ip_elements] def _to_floating_ip(self, obj): - return OpenStack_1_1_FloatingIpAddress(id=obj['id'], - ip_address=obj['ip'], - pool=None, - node_id=obj['instance_id'], - driver=self) + return OpenStack_1_1_FloatingIpAddress( + id=obj["id"], + ip_address=obj["ip"], + pool=None, + node_id=obj["instance_id"], + driver=self, + ) def ex_list_floating_ips(self): """ @@ -2263,8 +2668,7 @@ def ex_list_floating_ips(self): :rtype: ``list`` of :class:`OpenStack_1_1_FloatingIpAddress` """ - return self._to_floating_ips( - self.connection.request('/os-floating-ips').object) + return self._to_floating_ips(self.connection.request("/os-floating-ips").object) def ex_get_floating_ip(self, ip): """ @@ -2275,27 +2679,30 @@ def ex_get_floating_ip(self, ip): :rtype: :class:`OpenStack_1_1_FloatingIpAddress` """ - floating_ips = self.ex_list_floating_ips() - ip_obj, = [x for x in floating_ips if x.ip_address == ip] - return ip_obj + for floating_ip in self.ex_list_floating_ips(): + if floating_ip.ip_address == ip: + return floating_ip + return None - def ex_create_floating_ip(self): + def ex_create_floating_ip(self, ip_pool=None): """ - Create new floating IP + Create new floating IP. The ip_pool attribute is optional only if your + infrastructure has only one IP pool available. + + :param ip_pool: name of the floating IP pool + :type ip_pool: ``str`` :rtype: :class:`OpenStack_1_1_FloatingIpAddress` """ - resp = self.connection.request('/os-floating-ips', - method='POST', - data={}) - data = resp.object['floating_ip'] - id = data['id'] - ip_address = data['ip'] - return OpenStack_1_1_FloatingIpAddress(id=id, - ip_address=ip_address, - pool=None, - node_id=None, - driver=self) + data = {"pool": ip_pool} if ip_pool is not None else {} + resp = self.connection.request("/os-floating-ips", method="POST", data=data) + + data = resp.object["floating_ip"] + id = data["id"] + ip_address = data["ip"] + return OpenStack_1_1_FloatingIpAddress( + id=id, ip_address=ip_address, pool=None, node_id=None, driver=self + ) def ex_delete_floating_ip(self, ip): """ @@ -2306,8 +2713,7 @@ def ex_delete_floating_ip(self, ip): :rtype: ``bool`` """ - resp = self.connection.request('/os-floating-ips/%s' % ip.id, - method='DELETE') + resp = self.connection.request("/os-floating-ips/%s" % ip.id, method="DELETE") return resp.status in (httplib.NO_CONTENT, httplib.ACCEPTED) def ex_attach_floating_ip_to_node(self, node, ip): @@ -2322,12 +2728,9 @@ def ex_attach_floating_ip_to_node(self, node, ip): :rtype: ``bool`` """ - address = ip.ip_address if hasattr(ip, 'ip_address') else ip - data = { - 'addFloatingIp': {'address': address} - } - resp = self.connection.request('/servers/%s/action' % node.id, - method='POST', data=data) + address = ip.ip_address if hasattr(ip, "ip_address") else ip + data = {"addFloatingIp": {"address": address}} + resp = self.connection.request("/servers/%s/action" % node.id, method="POST", data=data) return resp.status == httplib.ACCEPTED def ex_detach_floating_ip_from_node(self, node, ip): @@ -2342,12 +2745,9 @@ def ex_detach_floating_ip_from_node(self, node, ip): :rtype: ``bool`` """ - address = ip.ip_address if hasattr(ip, 'ip_address') else ip - data = { - 'removeFloatingIp': {'address': address} - } - resp = self.connection.request('/servers/%s/action' % node.id, - method='POST', data=data) + address = ip.ip_address if hasattr(ip, "ip_address") else ip + data = {"removeFloatingIp": {"address": address}} + resp = self.connection.request("/servers/%s/action" % node.id, method="POST", data=data) return resp.status == httplib.ACCEPTED def ex_get_metadata_for_node(self, node): @@ -2361,110 +2761,1840 @@ def ex_get_metadata_for_node(self, node): associating tag names with tag values. :type tags: ``dict`` """ - return node.extra['metadata'] + return node.extra["metadata"] def ex_pause_node(self, node): - uri = '/servers/%s/action' % (node.id) - data = {'pause': None} - resp = self.connection.request(uri, method='POST', data=data) - return resp.status == httplib.ACCEPTED + return self._post_simple_node_action(node, "pause") def ex_unpause_node(self, node): - uri = '/servers/%s/action' % (node.id) - data = {'unpause': None} - resp = self.connection.request(uri, method='POST', data=data) - return resp.status == httplib.ACCEPTED + return self._post_simple_node_action(node, "unpause") + + def ex_start_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.start_node(node=node) + + def ex_stop_node(self, node): + # NOTE: This method is here for backward compatibility reasons after + # this method was promoted to be part of the standard compute API in + # Libcloud v2.7.0 + return self.stop_node(node=node) def ex_suspend_node(self, node): - uri = '/servers/%s/action' % (node.id) - data = {'suspend': None} - resp = self.connection.request(uri, method='POST', data=data) - return resp.status == httplib.ACCEPTED + return self._post_simple_node_action(node, "suspend") def ex_resume_node(self, node): - uri = '/servers/%s/action' % (node.id) - data = {'resume': None} - resp = self.connection.request(uri, method='POST', data=data) + return self._post_simple_node_action(node, "resume") + + def _post_simple_node_action(self, node, action): + """Post a simple, data-less action to the OS node action endpoint + :param `Node` node: + :param str action: the action to call + :return `bool`: a boolean that indicates success + """ + uri = "/servers/{node_id}/action".format(node_id=node.id) + resp = self.connection.request(uri, method="POST", data={action: None}) return resp.status == httplib.ACCEPTED -class OpenStack_1_1_FloatingIpPool(object): - """ - Floating IP Pool info. - """ +class OpenStack_2_Connection(OpenStackComputeConnection): + responseCls = OpenStack_1_1_Response + accept_format = "application/json" + default_content_type = "application/json; charset=UTF-8" - def __init__(self, name, connection): - self.name = name - self.connection = connection + def encode_data(self, data): + return json.dumps(data) - def list_floating_ips(self): - """ - List floating IPs in the pool - :rtype: ``list`` of :class:`OpenStack_1_1_FloatingIpAddress` - """ - return self._to_floating_ips( - self.connection.request('/os-floating-ips').object) +class OpenStack_2_ImageConnection(OpenStackImageConnection): + responseCls = OpenStack_1_1_Response + accept_format = "application/json" + default_content_type = "application/json; charset=UTF-8" - def _to_floating_ips(self, obj): - ip_elements = obj['floating_ips'] - return [self._to_floating_ip(ip) for ip in ip_elements] + def encode_data(self, data): + return json.dumps(data) - def _to_floating_ip(self, obj): - return OpenStack_1_1_FloatingIpAddress(id=obj['id'], - ip_address=obj['ip'], - pool=self, - node_id=obj['instance_id'], - driver=self.connection.driver) - def get_floating_ip(self, ip): - """ - Get specified floating IP from the pool +class OpenStack_2_NetworkConnection(OpenStackNetworkConnection): + responseCls = OpenStack_1_1_Response + accept_format = "application/json" + default_content_type = "application/json; charset=UTF-8" - :param ip: floating IP to get - :type ip: ``str`` + def encode_data(self, data): + return json.dumps(data) - :rtype: :class:`OpenStack_1_1_FloatingIpAddress` - """ - ip_obj, = [x for x in self.list_floating_ips() if x.ip_address == ip] - return ip_obj - def create_floating_ip(self): - """ - Create new floating IP in the pool +class OpenStack_2_VolumeV2Connection(OpenStackVolumeV2Connection): + responseCls = OpenStack_1_1_Response + accept_format = "application/json" + default_content_type = "application/json; charset=UTF-8" - :rtype: :class:`OpenStack_1_1_FloatingIpAddress` + def encode_data(self, data): + return json.dumps(data) + + +class OpenStack_2_VolumeV3Connection(OpenStackVolumeV3Connection): + responseCls = OpenStack_1_1_Response + accept_format = "application/json" + default_content_type = "application/json; charset=UTF-8" + + def encode_data(self, data): + return json.dumps(data) + + +class OpenStack_2_ReservationConnection(OpenStackReservationConnection): + responseCls = OpenStack_1_1_Response + accept_format = "application/json" + default_content_type = "application/json; charset=UTF-8" + + def encode_data(self, data): + return json.dumps(data) + + +class OpenStack_2_PortInterfaceState(Type): + """ + Standard states of OpenStack_2_PortInterfaceState + """ + + BUILD = "build" + ACTIVE = "active" + DOWN = "down" + UNKNOWN = "unknown" + + +class OpenStack_2_NodeDriver(OpenStack_1_1_NodeDriver): + """ + OpenStack node driver. + """ + + connectionCls = OpenStack_2_Connection + + # Previously all image functionality was available through the + # compute API. This deprecated proxied API does not offer all + # functionality that the Glance Image service API offers. + # See https://developer.openstack.org/api-ref/compute/ + # + # > These APIs are proxy calls to the Image service. Nova has deprecated + # > all the proxy APIs and users should use the native APIs instead. These + # > will fail with a 404 starting from microversion 2.36. See: Relevant + # > Image APIs. + # + # For example, managing image visibility and sharing machine + # images across tenants can not be done using the proxied image API in the + # compute endpoint, but it can be done with the Glance Image API. + # See https://developer.openstack.org/api-ref/ + # image/v2/index.html#list-image-members + image_connectionCls = OpenStack_2_ImageConnection + image_connection = None + + # Similarly not all node-related operations are exposed through the + # compute API + # See https://developer.openstack.org/api-ref/compute/ + # For example, creating a new node in an OpenStack that is configured to + # create a new port for every new instance will make it so that if that + # port is detached it disappears. But if the port is manually created + # beforehand using the neutron network API and node is booted with that + # port pre-specified, then detaching that port later will result in that + # becoming a re-attachable resource much like a floating ip. So because + # even though this is the compute driver, we do connect to the networking + # API here because some operations relevant for compute can only be + # accessed from there. + network_connectionCls = OpenStack_2_NetworkConnection + network_connection = None + + # Similarly all image operations are not exposed through the block-storage + # API of the cinder service: + # https://developer.openstack.org/api-ref/block-storage/ + volumev2_connectionCls = OpenStack_2_VolumeV2Connection + volumev3_connectionCls = OpenStack_2_VolumeV3Connection + volumev2_connection = None + volumev3_connection = None + volume_connection = None + + # Connection to the Blazar reservation API + reservation_connectionCls = OpenStack_2_ReservationConnection + reservation_connection = None + + type = Provider.OPENSTACK + + features = {"create_node": ["generates_password"]} + _networks_url_prefix = "/v2.0/networks" + _subnets_url_prefix = "/v2.0/subnets" + + PORT_INTERFACE_MAP = { + "BUILD": OpenStack_2_PortInterfaceState.BUILD, + "ACTIVE": OpenStack_2_PortInterfaceState.ACTIVE, + "DOWN": OpenStack_2_PortInterfaceState.DOWN, + "UNKNOWN": OpenStack_2_PortInterfaceState.UNKNOWN, + } + + def __init__(self, *args, **kwargs): + original_connectionCls = self.connectionCls + self._ex_force_api_version = str(kwargs.pop("ex_force_api_version", None)) + if "ex_force_auth_version" not in kwargs: + kwargs["ex_force_auth_version"] = "3.x_password" + + original_ex_force_base_url = kwargs.get("ex_force_base_url") + + # We run the init once to get the Glance V2 API connection + # and put that on the object under self.image_connection. + if original_ex_force_base_url or kwargs.get("ex_force_image_url"): + kwargs["ex_force_base_url"] = str( + kwargs.pop("ex_force_image_url", original_ex_force_base_url) + ) + self.connectionCls = self.image_connectionCls + super().__init__(*args, **kwargs) + self.image_connection = self.connection + + # We run the init once to get the Cinder V2 API connection + # and put that on the object under self.volumev2_connection. + if original_ex_force_base_url or kwargs.get("ex_force_volume_url"): + kwargs["ex_force_base_url"] = str( + kwargs.pop("ex_force_volume_url", original_ex_force_base_url) + ) + # the V3 API + self.connectionCls = self.volumev3_connectionCls + super().__init__(*args, **kwargs) + self.volumev3_connection = self.connection + # the V2 API + self.connectionCls = self.volumev2_connectionCls + super().__init__(*args, **kwargs) + self.volumev2_connection = self.connection + + # We run the init once to get the Neutron V2 API connection + # and put that on the object under self.network_connection. + if original_ex_force_base_url or kwargs.get("ex_force_network_url"): + kwargs["ex_force_base_url"] = str( + kwargs.pop("ex_force_network_url", original_ex_force_base_url) + ) + self.connectionCls = self.network_connectionCls + super().__init__(*args, **kwargs) + self.network_connection = self.connection + + # We run the init once to get the Blazar API connection + # and put that on the object under self.reservation_connection. + if original_ex_force_base_url or kwargs.get("ex_force_reservation_url"): + kwargs["ex_force_base_url"] = str( + kwargs.pop("ex_force_reservation_url", original_ex_force_base_url) + ) + self.connectionCls = self.reservation_connectionCls + super().__init__(*args, **kwargs) + self.reservation_connection = self.connection + + # We run the init once again to get the compute API connection + # and that's put under self.connection as normal. + self._ex_force_base_url = original_ex_force_base_url + if original_ex_force_base_url: + kwargs["ex_force_base_url"] = self._ex_force_base_url + # if ex_force_base_url is not set in original params delete it + elif "ex_force_base_url" in kwargs: + del kwargs["ex_force_base_url"] + self.connectionCls = original_connectionCls + super().__init__(*args, **kwargs) + + def _to_port(self, element): + created = element.get("created_at") + updated = element.get("updated_at") + return OpenStack_2_PortInterface( + id=element["id"], + state=self.PORT_INTERFACE_MAP.get( + element.get("status"), OpenStack_2_PortInterfaceState.UNKNOWN + ), + created=created, + driver=self, + extra=dict( + admin_state_up=element.get("admin_state_up"), + allowed_address_pairs=element.get("allowed_address_pairs"), + binding_vnic_type=element.get("binding:vnic_type"), + binding_host_id=element.get("binding:host_id", None), + device_id=element.get("device_id"), + description=element.get("description", None), + device_owner=element.get("device_owner"), + fixed_ips=element.get("fixed_ips"), + mac_address=element.get("mac_address"), + name=element.get("name"), + network_id=element.get("network_id"), + project_id=element.get("project_id", None), + port_security_enabled=element.get("port_security_enabled", None), + revision_number=element.get("revision_number", None), + security_groups=element.get("security_groups"), + tags=element.get("tags", None), + tenant_id=element.get("tenant_id"), + updated=updated, + ), + ) + + def list_nodes(self, ex_all_tenants=False): + """ + List the nodes in a tenant + + :param ex_all_tenants: List nodes for all the tenants. Note: Your user + must have admin privileges for this + functionality to work. + :type ex_all_tenants: ``bool`` + """ + params = {} + if ex_all_tenants: + params = {"all_tenants": 1} + return self._to_nodes( + self._paginated_request("/servers/detail", "servers", self.connection, params=params) + ) + + def get_image(self, image_id): + """ + Get a NodeImage using the V2 Glance API + + @inherits: :class:`OpenStack_1_1_NodeDriver.get_image` + + :param image_id: ID of the image which should be used + :type image_id: ``str`` + + :rtype: :class:`NodeImage` + """ + return self._to_image( + self.image_connection.request("/v2/images/{}".format(image_id)).object + ) + + def list_images(self, location=None, ex_only_active=True): + """ + Lists all active images using the V2 Glance API + + @inherits: :class:`NodeDriver.list_images` + + :param location: Which data center to list the images in. If + empty, undefined behavior will be selected. + (optional) + :type location: :class:`.NodeLocation` + + :param ex_only_active: True if list only active (optional) + :type ex_only_active: ``bool`` + """ + if location is not None: + raise NotImplementedError( + "location in list_images is not implemented " "in the OpenStack_2_NodeDriver" + ) + if not ex_only_active: + raise NotImplementedError( + "ex_only_active in list_images is not implemented " "in the OpenStack_2_NodeDriver" + ) + + result = self._paginated_request_next( + path="/v2/images", + request_method=self.image_connection.request, + response_key="images", + ) + + images = [] + for item in result: + images.append(self._to_image(item)) + + return images + + def ex_update_image(self, image_id, data): + """ + Patch a NodeImage. Can be used to set visibility + + :param image_id: ID of the image which should be used + :type image_id: ``str`` + + :param data: The data to PATCH, either a dict or a list + for example: [ + {'op': 'replace', 'path': '/visibility', 'value': 'shared'} + ] + :type data: ``dict|list`` + + :rtype: :class:`NodeImage` + """ + response = self.image_connection.request( + "/v2/images/{}".format(image_id), + headers={"Content-type": "application/" "openstack-images-" "v2.1-json-patch"}, + method="PATCH", + data=data, + ) + return self._to_image(response.object) + + def ex_list_image_members(self, image_id): + """ + List all members of an image. See + https://developer.openstack.org/api-ref/image/v2/index.html#sharing + + :param image_id: ID of the image of which the members should + be listed + :type image_id: ``str`` + + :rtype: ``list`` of :class:`NodeImageMember` + """ + response = self.image_connection.request("/v2/images/{}/members".format(image_id)) + image_members = [] + for image_member in response.object["members"]: + image_members.append(self._to_image_member(image_member)) + return image_members + + def ex_create_image_member(self, image_id, member_id): + """ + Give a project access to an image. + + The image should have visibility status 'shared'. + + Note that this is not an idempotent operation. If this action is + attempted using a tenant that is already in the image members + group the API will throw a Conflict (409). + See the 'create-image-member' section on + https://developer.openstack.org/api-ref/image/v2/index.html + + :param str image_id: The ID of the image to share with the specified + tenant + :param str member_id: The ID of the project / tenant (the image member) + Note that this is the Keystone project ID and not the project name, + so something like e2151b1fe02d4a8a2d1f5fc331522c0a + :return None: + + :param image_id: ID of the image to share + :type image_id: ``str`` + + :param project: ID of the project to give access to the image + :type image_id: ``str`` + + :rtype: ``list`` of :class:`NodeImageMember` + """ + data = {"member": member_id} + response = self.image_connection.request( + "/v2/images/%s/members" % image_id, method="POST", data=data + ) + return self._to_image_member(response.object) + + def ex_get_image_member(self, image_id, member_id): + """ + Get a member of an image by id + + :param image_id: ID of the image of which the member should + be listed + :type image_id: ``str`` + + :param member_id: ID of the member to list + :type image_id: ``str`` + + :rtype: ``list`` of :class:`NodeImageMember` + """ + response = self.image_connection.request( + "/v2/images/{}/members/{}".format(image_id, member_id) + ) + return self._to_image_member(response.object) + + def ex_accept_image_member(self, image_id, member_id): + """ + Accept a pending image as a member. + + This call is idempotent unlike ex_create_image_member, + you can accept the same image many times. + + :param image_id: ID of the image to accept + :type image_id: ``str`` + + :param project: ID of the project to accept the image as + :type image_id: ``str`` + + :rtype: ``bool`` + """ + data = {"status": "accepted"} + response = self.image_connection.request( + "/v2/images/{}/members/{}".format(image_id, member_id), method="PUT", data=data + ) + return self._to_image_member(response.object) + + def _to_networks(self, obj): + networks = obj["networks"] + return [self._to_network(network) for network in networks] + + def _to_network(self, obj): + extra = {} + if obj.get("router:external", None): + extra["router:external"] = obj.get("router:external") + if obj.get("subnets", None): + extra["subnets"] = obj.get("subnets") + if obj.get("tags", None): + extra["tags"] = obj.get("tags") + if obj.get("is_default", None) is not None: + extra["is_default"] = obj.get("is_default") + if obj.get("description", None) is not None: + extra["description"] = obj.get("description") + return OpenStackNetwork(id=obj["id"], name=obj["name"], cidr=None, driver=self, extra=extra) + + def ex_list_networks(self): + """ + Get a list of Networks that are available. + + :rtype: ``list`` of :class:`OpenStackNetwork` + """ + response = self.network_connection.request(self._networks_url_prefix).object + return self._to_networks(response) + + def ex_get_network(self, network_id): + """ + Retrieve the Network with the given ID + + :param networkId: ID of the network + :type networkId: ``str`` + + :rtype :class:`OpenStackNetwork` + """ + request_url = "{networks_url_prefix}/{network_id}".format( + networks_url_prefix=self._networks_url_prefix, network_id=network_id + ) + response = self.network_connection.request(request_url).object + return self._to_network(response["network"]) + + def ex_create_network(self, name, **kwargs): + """ + Create a new Network + + :param name: Name of network which should be used + :type name: ``str`` + + :rtype: :class:`OpenStackNetwork` + """ + data = {"network": {"name": name}} + # Add optional values + for key, value in kwargs.items(): + data["network"][key] = value + response = self.network_connection.request( + self._networks_url_prefix, method="POST", data=data + ).object + return self._to_network(response["network"]) + + def ex_delete_network(self, network): + """ + Delete a Network + + :param network: Network which should be used + :type network: :class:`OpenStackNetwork` + + :rtype: ``bool`` + """ + resp = self.network_connection.request( + "{}/{}".format(self._networks_url_prefix, network.id), method="DELETE" + ) + return resp.status in (httplib.NO_CONTENT, httplib.ACCEPTED) + + def _to_subnets(self, obj): + subnets = obj["subnets"] + return [self._to_subnet(subnet) for subnet in subnets] + + def _to_subnet(self, obj): + extra = {} + if obj.get("router:external", None): + extra["router:external"] = obj.get("router:external") + if obj.get("subnets", None): + extra["subnets"] = obj.get("subnets") + return OpenStack_2_SubNet( + id=obj["id"], + name=obj["name"], + cidr=obj["cidr"], + network_id=obj["network_id"], + driver=self, + extra=extra, + ) + + def ex_list_subnets(self): + """ + Get a list of Subnet that are available. + + :rtype: ``list`` of :class:`OpenStack_2_SubNet` + """ + response = self.network_connection.request(self._subnets_url_prefix).object + return self._to_subnets(response) + + def ex_create_subnet( + self, + name, + network, + cidr, + ip_version=4, + description="", + dns_nameservers=None, + host_routes=None, + ): + """ + Create a new Subnet + + :param name: Name of subnet which should be used + :type name: ``str`` + + :param network: Parent network of the subnet + :type network: ``OpenStackNetwork`` + + :param cidr: cidr of network which should be used + :type cidr: ``str`` + + :param ip_version: ip_version of subnet which should be used + :type ip_version: ``int`` + + :param description: Description for the resource. + :type description: ``str`` + + :param dns_nameservers: List of dns name servers. + :type dns_nameservers: ``list`` of ``str`` + + :param host_routes: Additional routes for the subnet. + :type host_routes: ``list`` of ``str`` + + :rtype: :class:`OpenStack_2_SubNet` + """ + data = { + "subnet": { + "cidr": cidr, + "network_id": network.id, + "ip_version": ip_version, + "name": name or "", + "description": description or "", + "dns_nameservers": dns_nameservers or [], + "host_routes": host_routes or [], + } + } + response = self.network_connection.request( + self._subnets_url_prefix, method="POST", data=data + ).object + return self._to_subnet(response["subnet"]) + + def ex_delete_subnet(self, subnet): + """ + Delete a Subnet + + :param subnet: Subnet which should be deleted + :type subnet: :class:`OpenStack_2_SubNet` + + :rtype: ``bool`` + """ + resp = self.network_connection.request( + "{}/{}".format(self._subnets_url_prefix, subnet.id), method="DELETE" + ) + return resp.status in (httplib.NO_CONTENT, httplib.ACCEPTED) + + def ex_update_subnet( + self, + subnet, + name=None, + description=None, + dns_nameservers=None, + host_routes=None, + ): + """ + Update data of an existing SubNet + + :param subnet: Subnet which should be updated + :type subnet: :class:`OpenStack_2_SubNet` + + :param name: Name of subnet which should be used + :type name: ``str`` + + :param description: Description for the resource. + :type description: ``str`` + + :param dns_nameservers: List of dns name servers. + :type dns_nameservers: ``list`` of ``str`` + + :param host_routes: Additional routes for the subnet. + :type host_routes: ``list`` of ``str`` + + :rtype: :class:`OpenStack_2_SubNet` + """ + data = {"subnet": {}} + if name is not None: + data["subnet"]["name"] = name + if description is not None: + data["subnet"]["description"] = description + if dns_nameservers is not None: + data["subnet"]["dns_nameservers"] = dns_nameservers + if host_routes is not None: + data["subnet"]["host_routes"] = host_routes + response = self.network_connection.request( + "{}/{}".format(self._subnets_url_prefix, subnet.id), method="PUT", data=data + ).object + return self._to_subnet(response["subnet"]) + + def ex_list_ports(self): + """ + List all OpenStack_2_PortInterfaces + + https://developer.openstack.org/api-ref/network/v2/#list-ports + + :rtype: ``list`` of :class:`OpenStack_2_PortInterface` + """ + response = self._paginated_request("/v2.0/ports", "ports", self.network_connection) + return [self._to_port(port) for port in response["ports"]] + + def ex_delete_port(self, port): + """ + Delete an OpenStack_2_PortInterface + + https://developer.openstack.org/api-ref/network/v2/#delete-port + + :param port: port interface to remove + :type port: :class:`OpenStack_2_PortInterface` + + :rtype: ``bool`` + """ + response = self.network_connection.request("/v2.0/ports/%s" % port.id, method="DELETE") + return response.success() + + def ex_detach_port_interface(self, node, port): + """ + Detaches an OpenStack_2_PortInterface interface from a Node. + :param node: node + :type node: :class:`Node` + + :param port: port interface to detach + :type port: :class:`OpenStack_2_PortInterface` + + :rtype: ``bool`` + """ + return self.connection.request( + "/servers/{}/os-interface/{}".format(node.id, port.id), method="DELETE" + ).success() + + def ex_attach_port_interface(self, node, port): + """ + Attaches an OpenStack_2_PortInterface to a Node. + + :param node: node + :type node: :class:`Node` + + :param port: port interface to attach + :type port: :class:`OpenStack_2_PortInterface` + + :rtype: ``bool`` + """ + data = {"interfaceAttachment": {"port_id": port.id}} + return self.connection.request( + "/servers/{}/os-interface".format(node.id), method="POST", data=data + ).success() + + def ex_create_port(self, network, description=None, admin_state_up=True, name=None): + """ + Creates a new OpenStack_2_PortInterface + + :param network: ID of the network where the newly created + port should be attached to + :type network: :class:`OpenStackNetwork` + + :param description: Description of the port + :type description: str + + :param admin_state_up: The administrative state of the + resource, which is up or down + :type admin_state_up: bool + + :param name: Human-readable name of the resource + :type name: str + + :rtype: :class:`OpenStack_2_PortInterface` + """ + data = { + "port": { + "description": description or "", + "admin_state_up": admin_state_up, + "name": name or "", + "network_id": network.id, + } + } + response = self.network_connection.request("/v2.0/ports", method="POST", data=data) + return self._to_port(response.object["port"]) + + def ex_get_port(self, port_interface_id): + """ + Retrieve the OpenStack_2_PortInterface with the given ID + + :param port_interface_id: ID of the requested port + :type port_interface_id: str + + :return: :class:`OpenStack_2_PortInterface` + """ + response = self.network_connection.request( + "/v2.0/ports/{}".format(port_interface_id), method="GET" + ) + return self._to_port(response.object["port"]) + + def ex_update_port( + self, + port, + description=None, + admin_state_up=None, + name=None, + port_security_enabled=None, + qos_policy_id=None, + security_groups=None, + allowed_address_pairs=None, + ): + """ + Update a OpenStack_2_PortInterface + + :param port: port interface to update + :type port: :class:`OpenStack_2_PortInterface` + + :param description: Description of the port + :type description: ``str`` + + :param admin_state_up: The administrative state of the + resource, which is up or down + :type admin_state_up: ``bool`` + + :param name: Human-readable name of the resource + :type name: ``str`` + + :param port_security_enabled: The port security status + :type port_security_enabled: ``bool`` + + :param qos_policy_id: QoS policy associated with the port + :type qos_policy_id: ``str`` + + :param security_groups: The IDs of security groups applied + :type security_groups: ``list`` of ``str`` + + :param allowed_address_pairs: IP and MAC address that the port + can use when sending packets if port_security_enabled is + true + :type allowed_address_pairs: ``list`` of ``dict`` containing + ip_address and mac_address; mac_address is optional, taken + from the port if not specified + + :rtype: :class:`OpenStack_2_PortInterface` + """ + data = {"port": {}} + if description is not None: + data["port"]["description"] = description + if admin_state_up is not None: + data["port"]["admin_state_up"] = admin_state_up + if name is not None: + data["port"]["name"] = name + if port_security_enabled is not None: + data["port"]["port_security_enabled"] = port_security_enabled + if qos_policy_id is not None: + data["port"]["qos_policy_id"] = qos_policy_id + if security_groups is not None: + data["port"]["security_groups"] = security_groups + if allowed_address_pairs is not None: + data["port"]["allowed_address_pairs"] = allowed_address_pairs + response = self.network_connection.request( + "/v2.0/ports/{}".format(port.id), method="PUT", data=data + ) + return self._to_port(response.object["port"]) + + def ex_get_node_ports(self, node): + """ + Get the list of OpenStack_2_PortInterface interfaces from a Node. + :param node: node + :type node: :class:`Node` + + :rtype: ``list`` of :class:`OpenStack_2_PortInterface` + """ + response = self.connection.request("/servers/%s/os-interface" % node.id, method="GET") + ports = [] + for port in response.object["interfaceAttachments"]: + port["id"] = port.pop("port_id") + ports.append(self._to_port(port)) + return ports + + def _get_volume_connection(self): + """ + Get the correct Volume connection (v3 or v2) + """ + if not self.volume_connection: + try: + # Try to use v3 API first + # if the endpoint is not found + self.volumev3_connection.get_service_catalog() + self.volume_connection = self.volumev3_connection + except LibcloudError: + # then return the v2 conn + self.volume_connection = self.volumev2_connection + return self.volume_connection + + def list_volumes(self): + """ + Get a list of Volumes that are available. + + :rtype: ``list`` of :class:`StorageVolume` + """ + return self._to_volumes( + self._paginated_request("/volumes/detail", "volumes", self._get_volume_connection()) + ) + + def ex_get_volume(self, volumeId): + """ + Retrieve the StorageVolume with the given ID + + :param volumeId: ID of the volume + :type volumeId: ``string`` + + :return: :class:`StorageVolume` + """ + return self._to_volume( + self._get_volume_connection().request("/volumes/%s" % volumeId).object + ) + + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + ex_volume_type=None, + ex_image_ref=None, + ): + """ + Create a new volume. + + :param size: Size of volume in gigabytes (required) + :type size: ``int`` + + :param name: Name of the volume to be created + :type name: ``str`` + + :param location: Which data center to create a volume in. If + empty, undefined behavior will be selected. + (optional) + :type location: :class:`.NodeLocation` + + :param snapshot: Snapshot from which to create the new + volume. (optional) + :type snapshot: :class:`.VolumeSnapshot` + + :param ex_volume_type: What kind of volume to create. + (optional) + :type ex_volume_type: ``str`` + + :param ex_image_ref: The image to create the volume from + when creating a bootable volume (optional) + :type ex_image_ref: ``str`` + + :return: The newly created volume. + :rtype: :class:`StorageVolume` + """ + volume = { + "name": name, + "description": name, + "size": size, + "metadata": {"contents": name}, + } + + if ex_volume_type: + volume["volume_type"] = ex_volume_type + + if ex_image_ref: + volume["imageRef"] = ex_image_ref + + if location: + volume["availability_zone"] = location + + if snapshot: + volume["snapshot_id"] = snapshot.id + + resp = self._get_volume_connection().request( + "/volumes", method="POST", data={"volume": volume} + ) + return self._to_volume(resp.object) + + def destroy_volume(self, volume): + """ + Delete a Volume. + + :param volume: Volume to be deleted + :type volume: :class:`StorageVolume` + + :rtype: ``bool`` + """ + return ( + self._get_volume_connection() + .request("/volumes/%s" % volume.id, method="DELETE") + .success() + ) + + def ex_list_snapshots(self): + """ + Get a list of Snapshot that are available. + + :rtype: ``list`` of :class:`VolumeSnapshot` + """ + return self._to_snapshots( + self._paginated_request("/snapshots/detail", "snapshots", self._get_volume_connection()) + ) + + def create_volume_snapshot(self, volume, name=None, ex_description=None, ex_force=True): + """ + Create snapshot from volume + + :param volume: Instance of `StorageVolume` + :type volume: `StorageVolume` + + :param name: Name of snapshot (optional) + :type name: `str` | `NoneType` + + :param ex_description: Description of the snapshot (optional) + :type ex_description: `str` | `NoneType` + + :param ex_force: Specifies if we create a snapshot that is not in + state `available`. For example `in-use`. Defaults + to True. (optional) + :type ex_force: `bool` + + :rtype: :class:`VolumeSnapshot` + """ + data = {"snapshot": {"volume_id": volume.id, "force": ex_force}} + + if name is not None: + data["snapshot"]["name"] = name + + if ex_description is not None: + data["snapshot"]["description"] = ex_description + + return self._to_snapshot( + self._get_volume_connection().request("/snapshots", method="POST", data=data).object + ) + + def destroy_volume_snapshot(self, snapshot): + """ + Delete a Volume Snapshot. + + :param snapshot: Snapshot to be deleted + :type snapshot: :class:`VolumeSnapshot` + + :rtype: ``bool`` + """ + resp = self._get_volume_connection().request("/snapshots/%s" % snapshot.id, method="DELETE") + return resp.status in (httplib.NO_CONTENT, httplib.ACCEPTED) + + def ex_list_security_groups(self): + """ + Get a list of Security Groups that are available. + + :rtype: ``list`` of :class:`OpenStackSecurityGroup` + """ + return self._to_security_groups( + self.network_connection.request("/v2.0/security-groups").object + ) + + def ex_create_security_group(self, name, description): + """ + Create a new Security Group + + :param name: Name of the new Security Group + :type name: ``str`` + + :param description: Description of the new Security Group + :type description: ``str`` + + :rtype: :class:`OpenStackSecurityGroup` + """ + return self._to_security_group( + self.network_connection.request( + "/v2.0/security-groups", + method="POST", + data={"security_group": {"name": name, "description": description}}, + ).object["security_group"] + ) + + def ex_delete_security_group(self, security_group): + """ + Delete a Security Group. + + :param security_group: Security Group should be deleted + :type security_group: :class:`OpenStackSecurityGroup` + + :rtype: ``bool`` + """ + resp = self.network_connection.request( + "/v2.0/security-groups/%s" % (security_group.id), method="DELETE" + ) + return resp.status == httplib.NO_CONTENT + + def _to_security_group_rule(self, obj): + ip_range = group = tenant_id = parent_id = None + protocol = from_port = to_port = direction = None + + if "parent_group_id" in obj: + if obj["group"] == {}: + ip_range = obj["ip_range"].get("cidr", None) + else: + group = obj["group"].get("name", None) + tenant_id = obj["group"].get("tenant_id", None) + + parent_id = obj["parent_group_id"] + from_port = obj["from_port"] + to_port = obj["to_port"] + protocol = obj["ip_protocol"] + else: + ip_range = obj.get("remote_ip_prefix", None) + group = obj.get("remote_group_id", None) + tenant_id = obj.get("tenant_id", None) + + parent_id = obj["security_group_id"] + from_port = obj["port_range_min"] + to_port = obj["port_range_max"] + protocol = obj["protocol"] + + return OpenStackSecurityGroupRule( + id=obj["id"], + parent_group_id=parent_id, + ip_protocol=protocol, + from_port=from_port, + to_port=to_port, + driver=self, + ip_range=ip_range, + group=group, + tenant_id=tenant_id, + direction=direction, + ) + + def ex_create_security_group_rule( + self, + security_group, + ip_protocol, + from_port, + to_port, + cidr=None, + source_security_group=None, + ): + """ + Create a new Rule in a Security Group + + :param security_group: Security Group in which to add the rule + :type security_group: :class:`OpenStackSecurityGroup` + + :param ip_protocol: Protocol to which this rule applies + Examples: tcp, udp, ... + :type ip_protocol: ``str`` + + :param from_port: First port of the port range + :type from_port: ``int`` + + :param to_port: Last port of the port range + :type to_port: ``int`` + + :param cidr: CIDR notation of the source IP range for this rule + :type cidr: ``str`` + + :param source_security_group: Existing Security Group to use as the + source (instead of CIDR) + :type source_security_group: L{OpenStackSecurityGroup + + :rtype: :class:`OpenStackSecurityGroupRule` + """ + source_security_group_id = None + if type(source_security_group) == OpenStackSecurityGroup: + source_security_group_id = source_security_group.id + + return self._to_security_group_rule( + self.network_connection.request( + "/v2.0/security-group-rules", + method="POST", + data={ + "security_group_rule": { + "direction": "ingress", + "protocol": ip_protocol, + "port_range_min": from_port, + "port_range_max": to_port, + "remote_ip_prefix": cidr, + "remote_group_id": source_security_group_id, + "security_group_id": security_group.id, + } + }, + ).object["security_group_rule"] + ) + + def ex_delete_security_group_rule(self, rule): + """ + Delete a Rule from a Security Group. + + :param rule: Rule should be deleted + :type rule: :class:`OpenStackSecurityGroupRule` + + :rtype: ``bool`` + """ + resp = self.network_connection.request( + "/v2.0/security-group-rules/%s" % (rule.id), method="DELETE" + ) + return resp.status == httplib.NO_CONTENT + + def ex_remove_security_group_from_node(self, security_group, node): + """ + Remove a Security Group from a node. + + :param security_group: Security Group to remove from node. + :type security_group: :class:`OpenStackSecurityGroup` + + :param node: Node to remove the Security Group. + :type node: :class:`Node` + + :rtype: ``bool`` + """ + server_params = {"name": security_group.name} + resp = self._node_action(node, "removeSecurityGroup", **server_params) + return resp.status == httplib.ACCEPTED + + def _to_floating_ip_pool(self, obj): + return OpenStack_2_FloatingIpPool(obj["id"], obj["name"], self.network_connection) + + def _to_floating_ip_pools(self, obj): + pool_elements = obj["networks"] + return [self._to_floating_ip_pool(pool) for pool in pool_elements] + + def ex_list_floating_ip_pools(self): + """ + List available floating IP pools + + :rtype: ``list`` of :class:`OpenStack_2_FloatingIpPool` + """ + return self._to_floating_ip_pools( + self.network_connection.request( + "/v2.0/networks?router:external" "=True&fields=id&fields=" "name" + ).object + ) + + def _to_routers(self, obj): + routers = obj["routers"] + return [self._to_router(router) for router in routers] + + def _to_router(self, obj): + extra = {} + extra["external_gateway_info"] = obj["external_gateway_info"] + extra["routes"] = obj["routes"] + return OpenStack_2_Router( + id=obj["id"], + name=obj["name"], + status=obj["status"], + driver=self, + extra=extra, + ) + + def ex_list_routers(self): + """ + Get a list of Routers that are available. + + :rtype: ``list`` of :class:`OpenStack_2_Router` + """ + response = self.network_connection.request("/v2.0/routers").object + return self._to_routers(response) + + def ex_create_router( + self, name, description="", admin_state_up=True, external_gateway_info=None + ): + """ + Create a new Router + + :param name: Name of router which should be used + :type name: ``str`` + + :param description: Description of the port + :type description: ``str`` + + :param admin_state_up: The administrative state of the + resource, which is up or down + :type admin_state_up: ``bool`` + + :param external_gateway_info: The external gateway information + :type external_gateway_info: ``dict`` + + :rtype: :class:`OpenStack_2_Router` + """ + data = { + "router": { + "name": name or "", + "description": description or "", + "admin_state_up": admin_state_up, + } + } + if external_gateway_info: + data["router"]["external_gateway_info"] = external_gateway_info + response = self.network_connection.request("/v2.0/routers", method="POST", data=data).object + return self._to_router(response["router"]) + + def ex_delete_router(self, router): + """ + Delete a Router + + :param router: Router which should be deleted + :type router: :class:`OpenStack_2_Router` + + :rtype: ``bool`` + """ + resp = self.network_connection.request( + "{}/{}".format("/v2.0/routers", router.id), method="DELETE" + ) + return resp.status in (httplib.NO_CONTENT, httplib.ACCEPTED) + + def _manage_router_interface(self, router, op, subnet=None, port=None): + """ + Add/Remove interface to router + + :param router: Router to add/remove the interface + :type router: :class:`OpenStack_2_Router` + + :param op: Operation to perform: 'add' or 'remove' + :type op: ``str`` + + :param subnet: Subnet object to be added to the router + :type subnet: :class:`OpenStack_2_SubNet` + + :param port: Port object to be added to the router + :type port: :class:`OpenStack_2_PortInterface` + + :rtype: ``bool`` + """ + data = {} + if subnet: + data["subnet_id"] = subnet.id + elif port: + data["port_id"] = port.id + else: + raise OpenStackException( + "Error in router interface: " "port or subnet are None.", 500, self + ) + + resp = self.network_connection.request( + "{}/{}/{}_router_interface".format("/v2.0/routers", router.id, op), + method="PUT", + data=data, + ) + return resp.status == httplib.OK + + def ex_add_router_port(self, router, port): + """ + Add port to a router + + :param router: Router to add the port + :type router: :class:`OpenStack_2_Router` + + :param port: Port object to be added to the router + :type port: :class:`OpenStack_2_PortInterface` + + :rtype: ``bool`` + """ + return self._manage_router_interface(router, "add", port=port) + + def ex_del_router_port(self, router, port): + """ + Remove port from a router + + :param router: Router to remove the port + :type router: :class:`OpenStack_2_Router` + + :param port: Port object to be added to the router + :type port: :class:`OpenStack_2_PortInterface` + + :rtype: ``bool`` + """ + return self._manage_router_interface(router, "remove", port=port) + + def ex_add_router_subnet(self, router, subnet): + """ + Add subnet to a router + + :param router: Router to add the subnet + :type router: :class:`OpenStack_2_Router` + + :param subnet: Subnet object to be added to the router + :type subnet: :class:`OpenStack_2_SubNet` + + :rtype: ``bool`` + """ + return self._manage_router_interface(router, "add", subnet=subnet) + + def ex_del_router_subnet(self, router, subnet): + """ + Remove subnet to a router + + :param router: Router to remove the subnet + :type router: :class:`OpenStack_2_Router` + + :param subnet: Subnet object to be added to the router + :type subnet: :class:`OpenStack_2_SubNet` + + :rtype: ``bool`` + """ + return self._manage_router_interface(router, "remove", subnet=subnet) + + def _to_quota_set(self, obj): + res = OpenStack_2_QuotaSet( + id=obj["id"], + cores=obj["cores"], + instances=obj["instances"], + key_pairs=obj["key_pairs"], + metadata_items=obj["metadata_items"], + ram=obj["ram"], + server_groups=obj["server_groups"], + server_group_members=obj["server_group_members"], + fixed_ips=obj.get("fixed_ips", None), + floating_ips=obj.get("floating_ips", None), + networks=obj.get("networks", None), + security_group_rules=obj.get("security_group_rules", None), + security_groups=obj.get("security_groups", None), + injected_file_content_bytes=obj.get("injected_file_content_bytes", None), + injected_file_path_bytes=obj.get("injected_file_path_bytes", None), + injected_files=obj.get("injected_files", None), + driver=self.connection.driver, + ) + + return res + + def ex_get_quota_set(self, tenant_id, user_id=None): + """ + Get the quota for a project or a project and a user. + + :param tenant_id: The UUID of the tenant in a multi-tenancy cloud + :type tenant_id: ``str`` + + :param user_id: ID of user to list the quotas for. + :type user_id: ``str`` + + :rtype: :class:`OpenStack_2_QuotaSet` + """ + url = "/os-quota-sets/%s/detail" % tenant_id + if user_id: + url += "?user_id=%s" % user_id + return self._to_quota_set(self.connection.request(url).object["quota_set"]) + + def _to_network_quota(self, obj): + res = OpenStack_2_NetworkQuota( + floatingip=obj["floatingip"], + network=obj["network"], + port=obj["port"], + rbac_policy=obj["rbac_policy"], + router=obj.get("router", None), + security_group=obj.get("security_group", None), + security_group_rule=obj.get("security_group_rule", None), + subnet=obj.get("subnet", None), + subnetpool=obj.get("subnetpool", None), + driver=self.connection.driver, + ) + + return res + + def ex_get_network_quotas(self, project_id): + """ + Get the network quotas for a project + + :param project_id: The ID of the project. + :type project_id: ``str`` + + :rtype: :class:`OpenStack_2_NetworkQuota` + """ + url = "/v2.0/quotas/%s/details.json" % project_id + return self._to_network_quota(self.network_connection.request(url).object["quota"]) + + def _to_volume_quota(self, obj): + res = OpenStack_2_VolumeQuota( + backup_gigabytes=obj.get("backup_gigabytes", None), + gigabytes=obj.get("gigabytes", None), + per_volume_gigabytes=obj.get("per_volume_gigabytes", None), + backups=obj.get("backups", None), + snapshots=obj.get("snapshots", None), + volumes=obj.get("volumes", None), + driver=self.connection.driver, + ) + + return res + + def ex_get_volume_quotas(self, project_id): + """ + Get the volume quotas for a project + + :param project_id: The ID of the project. + :type project_id: ``str`` + + :rtype: :class:`OpenStack_2_VolumeQuota` + """ + url = "/os-quota-sets/%s?usage=True" % project_id + return self._to_volume_quota(self._get_volume_connection().request(url).object["quota_set"]) + + def ex_list_server_groups(self): + """ + List Server Groups + + :rtype: ``list`` of :class:`OpenStack_2_ServerGroup` + """ + return self._to_server_groups(self.connection.request("/os-server-groups").object) + + def _to_server_groups(self, obj): + sg_elements = obj["server_groups"] + return [self._to_server_group(sg) for sg in sg_elements] + + def _to_server_group(self, obj): + policy = None + if "policy" in obj: + policy = obj["policy"] + elif "policies" in obj and obj["policies"]: + policy = obj["policies"][0] + return OpenStack_2_ServerGroup( + id=obj["id"], + name=obj["name"], + policy=policy, + members=obj.get("members"), + rules=obj.get("rules"), + driver=self.connection.driver, + ) + + def ex_get_server_group(self, server_group_id): + """ + Get Server Group + + :rtype: :class:`OpenStack_2_ServerGroup` + """ + return self._to_server_group( + self.connection.request("/os-server-groups/%s" % server_group_id).object["server_group"] + ) + + def ex_add_server_group(self, name, policy, rules=[]): + """ + Add a Server Group + + :param name: Server Group Name. + :type name: ``str`` + :param policy: Server Group policy. + :type policy: ``str`` + :param rules: Server Group rules. + :type rules: ``list`` + + :rtype: ``bool`` + """ + data = {"name": name} + if rules: + data["rules"] = rules + try: + # New in version 2.64 + data["policy"] = policy + response = self.connection.request( + "/os-server-groups", method="POST", data={"server_group": data} + ).object + except BaseHTTPError: + # until version 2.63 + del data["policy"] + data["policies"] = [policy] + response = self.connection.request( + "/os-server-groups", method="POST", data={"server_group": data} + ).object + return self._to_server_group(response["server_group"]) + + def ex_del_server_group(self, server_group): + """ + Delete a Server Group + + :param server_group: Server Group which should be deleted + :type server_group: :class:`OpenStack_2_ServerGroup` + + :rtype: ``bool`` + """ + resp = self.connection.request("/os-server-groups/%s" % server_group.id, method="DELETE") + return resp.status in (httplib.NO_CONTENT, httplib.ACCEPTED) + + def _to_floating_ips(self, obj): + ip_elements = obj["floatingips"] + return [self._to_floating_ip(ip) for ip in ip_elements] + + def _to_floating_ip(self, obj): + extra = {} + + # In neutron version prior to 13.0.0 port_details does not exists + extra["port_details"] = obj.get("port_details") + extra["port_id"] = obj.get("port_id") + extra["floating_network_id"] = obj.get("floating_network_id") + + return OpenStack_2_FloatingIpAddress( + id=obj["id"], + ip_address=obj["floating_ip_address"], + pool=None, + node_id=None, + driver=self, + extra=extra, + ) + + def ex_list_floating_ips(self): + """ + List floating IPs + :rtype: ``list`` of :class:`OpenStack_2_FloatingIpAddress` + """ + return self._to_floating_ips(self.network_connection.request("/v2.0/floatingips").object) + + def ex_get_floating_ip(self, ip): + """ + Get specified floating IP from the pool + :param ip: floating IP to get + :type ip: ``str`` + :rtype: :class:`OpenStack_2_FloatingIpAddress` + """ + floating_ips = self._to_floating_ips( + self.network_connection.request( + "/v2.0/floatingips?floating_ip_address" "=%s" % ip + ).object + ) + return floating_ips[0] if floating_ips else None + + def ex_create_floating_ip(self, ip_pool): + """ + Create new floating IP. The ip_pool attribute is optional only if your + infrastructure has only one IP pool available. + :param ip_pool: name or id of the floating IP pool + :type ip_pool: ``str`` + :rtype: :class:`OpenStack_2_FloatingIpAddress` + """ + for pool in self.ex_list_floating_ip_pools(): + if not ip_pool or ip_pool == pool.name or ip_pool == pool.id: + return pool.create_floating_ip() + + def ex_delete_floating_ip(self, ip): + """ + Delete specified floating IP + :param ip: floating IP to remove + :type ip: :class:`OpenStack_2_FloatingIpAddress` + :rtype: ``bool`` + """ + resp = self.network_connection.request("/v2.0/floatingips/%s" % ip.id, method="DELETE") + return resp.status in (httplib.NO_CONTENT, httplib.ACCEPTED) + + def ex_attach_floating_ip_to_node(self, node, ip, port_id=None): + """ + Attach the floating IP to the node + + :param node: node + :type node: :class:`Node` + + :param ip: floating IP to attach + :type ip: ``str`` or :class:`OpenStack_1_1_FloatingIpAddress` + + :param port_id: Optional node port ID to attach the floating IP + :type port_id: ``str`` + + :rtype: ``bool`` + """ + ip_id = None + if hasattr(ip, "id"): + ip_id = ip.id + else: + for pool in self.ex_list_floating_ip_pools(): + fip = pool.get_floating_ip(ip) + if fip: + ip_id = fip.id + if not ip_id: + return False + if not port_id: + ports = self.ex_get_node_ports(node) + if ports: + port_id = ports[0].id + if port_id: + # Set to the first node port + resp = self.network_connection.request( + "/v2.0/floatingips/%s" % ip_id, + method="PUT", + data={"floatingip": {"port_id": port_id}}, + ) + return resp.status == httplib.OK + else: + # if there are no ports + return False + + def ex_detach_floating_ip_from_node(self, node, ip): + """ + Detach the floating IP from the node + + :param node: node + :type node: :class:`Node` + + :param ip: floating IP to remove + :type ip: ``str`` or :class:`OpenStack_1_1_FloatingIpAddress` + + :rtype: ``bool`` + """ + ip_id = None + if hasattr(ip, "id"): + ip_id = ip.id + else: + for pool in self.ex_list_floating_ip_pools(): + fip = pool.get_floating_ip(ip) + if fip: + ip_id = fip.id + if not ip_id: + return False + resp = self.network_connection.request( + "/v2.0/floatingips/%s" % ip_id, + method="PUT", + data={"floatingip": {"port_id": None}}, + ) + return resp.status == httplib.OK + + def ex_list_leases(self): + """ + List leases + + :rtype: ``list`` of :class:`OpenStack_2_Lease` + """ + return self._to_leases(self.reservation_connection.request("/leases").object) + + def _to_leases(self, obj): + lease_elements = obj["leases"] + return [self._to_lease(lease) for lease in lease_elements] + + def _to_lease(self, obj): + return OpenStack_2_Lease( + id=obj["id"], + name=obj["name"], + start=obj["start_date"], + end=obj["end_date"], + status=obj["status"], + reservations=obj["reservations"], + driver=self.reservation_connection.driver, + ) + + def ex_list_hosts(self): + """ + List leases + + :rtype: ``list`` of :class:`OpenStack_2_Host` + """ + return self._to_hosts(self.reservation_connection.request("/os-hosts").object) + + def _to_hosts(self, obj): + host_elements = obj["hosts"] + return [self._to_host(host) for host in host_elements] + + def _to_host(self, obj): + return OpenStack_2_Host( + id=obj["id"], + hypervisor_hostname=obj["hypervisor_hostname"], + vcpus=obj["vcpus"], + memory_mb=obj["memory_mb"], + local_gb=obj["local_gb"], + service_name=obj["service_name"], + ) + + +class OpenStack_2_Host: + """ + Host info. + """ + + def __init__(self, id, hypervisor_hostname, vcpus, memory_mb, local_gb, service_name): + self.id = id + self.hypervisor_hostname = hypervisor_hostname + self.vcpus = vcpus + self.memory_mb = memory_mb + self.local_gb = local_gb + self.service_name = service_name + + def __repr__(self): + return "".format( + self.id, + self.hypervisor_hostname, + ) + + +class OpenStack_2_Lease: + """ + Lease info. + """ + + PENDING = "PENDING" + ACTIVE = "ACTIVE" + TERMINATED = "TERMINATED" + DELETED = "DELETED" + CREATING = "CREATING" + UPDATING = "UPDATING" + DELETING = "DELETING" + ERROR = "ERROR" + + def __init__(self, id, name, start, end, status, reservations, driver): + self.id = id + self.name = name + self.start = start + self.end = end + self.status = status + self.reservations = reservations + self.driver = driver + + def __repr__(self): + return "".format( + self.id, self.name, self.status + ) + + +class OpenStack_1_1_FloatingIpPool: + """ + Floating IP Pool info. + """ + + def __init__(self, name, connection): + self.name = name + self.connection = connection + + def list_floating_ips(self): + """ + List floating IPs in the pool + + :rtype: ``list`` of :class:`OpenStack_1_1_FloatingIpAddress` + """ + return self._to_floating_ips(self.connection.request("/os-floating-ips").object) + + def _to_floating_ips(self, obj): + ip_elements = obj["floating_ips"] + return [self._to_floating_ip(ip) for ip in ip_elements] + + def _to_floating_ip(self, obj): + return OpenStack_1_1_FloatingIpAddress( + id=obj["id"], + ip_address=obj["ip"], + pool=self, + node_id=obj["instance_id"], + driver=self.connection.driver, + ) + + def get_floating_ip(self, ip): + """ + Get specified floating IP from the pool + + :param ip: floating IP to get + :type ip: ``str`` + + :rtype: :class:`OpenStack_1_1_FloatingIpAddress` + """ + for floating_ip in self.list_floating_ips(): + if floating_ip.ip_address == ip: + return floating_ip + return None + + def create_floating_ip(self): + """ + Create new floating IP in the pool + + :rtype: :class:`OpenStack_1_1_FloatingIpAddress` """ - resp = self.connection.request('/os-floating-ips', - method='POST', - data={'pool': self.name}) - data = resp.object['floating_ip'] - id = data['id'] - ip_address = data['ip'] - return OpenStack_1_1_FloatingIpAddress(id=id, - ip_address=ip_address, - pool=self, - node_id=None, - driver=self.connection.driver) + resp = self.connection.request("/os-floating-ips", method="POST", data={"pool": self.name}) + data = resp.object["floating_ip"] + id = data["id"] + ip_address = data["ip"] + return OpenStack_1_1_FloatingIpAddress( + id=id, + ip_address=ip_address, + pool=self, + node_id=None, + driver=self.connection.driver, + ) def delete_floating_ip(self, ip): """ Delete specified floating IP from the pool :param ip: floating IP to remove - :type ip::class:`OpenStack_1_1_FloatingIpAddress` + :type ip: :class:`OpenStack_1_1_FloatingIpAddress` :rtype: ``bool`` """ - resp = self.connection.request('/os-floating-ips/%s' % ip.id, - method='DELETE') + resp = self.connection.request("/os-floating-ips/%s" % ip.id, method="DELETE") return resp.status in (httplib.NO_CONTENT, httplib.ACCEPTED) def __repr__(self): - return ('' % self.name) + return "" % self.name -class OpenStack_1_1_FloatingIpAddress(object): +class OpenStack_1_1_FloatingIpAddress: """ Floating IP info. """ @@ -2488,6 +4618,563 @@ def delete(self): return self.driver.ex_delete_floating_ip(self) def __repr__(self): - return ('' - % (self.id, self.ip_address, self.pool, self.driver)) + return "" % ( + self.id, + self.ip_address, + self.pool, + self.driver, + ) + + +class OpenStack_2_FloatingIpAddress(OpenStack_1_1_FloatingIpAddress): + """ + Floating IP info 2.0. + """ + + def __init__(self, id, ip_address, pool, node_id=None, driver=None, extra=None): + self.id = str(id) + self.ip_address = ip_address + self.pool = pool + self.node_id = node_id + self.driver = driver + self.extra = extra if extra else {} + + def get_pool(self): + if not self.pool: + try: + # If pool is not set, get the info from the floating_network_id + net = self.driver.ex_get_network(self.extra["floating_network_id"]) + except Exception: + net = None + if net: + self.pool = OpenStack_2_FloatingIpPool( + net.id, net.name, self.driver.network_connection + ) + return self.pool + + def get_node_id(self): + if not self.node_id: + # if node id is not set, get it from port_details + + # In neutron version prior to 13.0.0 port_details does not exists + if "port_details" not in self.extra or not self.extra["port_details"]: + # if port_details is not available get if from port info using port_id + try: + port = self.driver.ex_get_port(self.extra["port_id"]) + except Exception: + port = None + if port: + self.extra["port_details"] = { + "device_id": port.extra["device_id"], + "device_owner": port.extra["device_owner"], + "mac_address": port.extra["mac_address"], + } + + if "port_details" in self.extra and self.extra["port_details"]: + dev_owner = self.extra["port_details"]["device_owner"] + if dev_owner and dev_owner.startswith("compute:"): + self.node_id = self.extra["port_details"]["device_id"] + + return self.node_id + + def __repr__(self): + return "" % ( + self.id, + self.ip_address, + self.pool, + self.driver, + ) + + +class OpenStack_2_FloatingIpPool: + """ + Floating IP Pool info. + """ + + def __init__(self, id, name, connection): + self.id = id + self.name = name + self.connection = connection + + def _to_floating_ips(self, obj): + ip_elements = obj["floatingips"] + return [self._to_floating_ip(ip) for ip in ip_elements] + + def _to_floating_ip(self, obj): + extra = {} + + # In neutron version prior to 13.0.0 port_details does not exists + extra["port_details"] = obj.get("port_details") + extra["port_id"] = obj.get("port_id") + + return OpenStack_2_FloatingIpAddress( + id=obj["id"], + ip_address=obj["floating_ip_address"], + pool=self, + node_id=None, + driver=self.connection.driver, + extra=extra, + ) + + def list_floating_ips(self): + """ + List floating IPs in the pool + + :rtype: ``list`` of :class:`OpenStack_2_FloatingIpAddress` + """ + url = "/v2.0/floatingips?floating_network_id=%s" % self.id + return self._to_floating_ips(self.connection.request(url).object) + + def get_floating_ip(self, ip): + """ + Get specified floating IP from the pool + + :param ip: floating IP to get + :type ip: ``str`` + + :rtype: :class:`OpenStack_2_FloatingIpAddress` + """ + url = "/v2.0/floatingips?floating_network_id=%s" % self.id + url += "&floating_ip_address=%s" % ip + floating_ips = self._to_floating_ips(self.connection.request(url).object) + return floating_ips[0] if floating_ips else None + + def create_floating_ip(self): + """ + Create new floating IP in the pool + + :rtype: :class:`OpenStack_2_FloatingIpAddress` + """ + resp = self.connection.request( + "/v2.0/floatingips", + method="POST", + data={"floatingip": {"floating_network_id": self.id}}, + ) + data = resp.object["floatingip"] + return OpenStack_2_FloatingIpAddress( + id=data["id"], + ip_address=data["floating_ip_address"], + pool=self, + node_id=None, + driver=self.connection.driver, + ) + + def delete_floating_ip(self, ip): + """ + Delete specified floating IP from the pool + + :param ip: floating IP to remove + :type ip: :class:`OpenStack_1_1_FloatingIpAddress` + + :rtype: ``bool`` + """ + resp = self.connection.request("/v2.0/floatingips/%s" % ip.id, method="DELETE") + return resp.status in (httplib.NO_CONTENT, httplib.ACCEPTED) + + def __repr__(self): + return "" % self.name + + +class OpenStack_2_SubNet: + """ + A Virtual SubNet. + """ + + def __init__(self, id, name, cidr, network_id, driver, extra=None): + self.id = str(id) + self.name = name + self.cidr = cidr + self.network_id = network_id + self.driver = driver + self.extra = extra or {} + + def __repr__(self): + return ''.format( + self.id, + self.name, + self.cidr, + ) + + +class OpenStack_2_Router: + """ + A Virtual Router. + """ + + def __init__(self, id, name, status, driver, extra=None): + self.id = str(id) + self.name = name + self.status = status + self.driver = driver + self.extra = extra or {} + + def __repr__(self): + return ''.format(self.id, self.name) + + +class OpenStack_2_PortInterface(UuidMixin): + """ + Port Interface info. Similar in functionality to a floating IP (can be + attached / detached from a compute instance) but implementation-wise a + bit different. + + > A port is a connection point for attaching a single device, such as the + > NIC of a server, to a network. The port also describes the associated + > network configuration, such as the MAC and IP addresses to be used on + > that port. + https://docs.openstack.org/python-openstackclient/pike/cli/command-objects/port.html + + Also see: + https://developer.openstack.org/api-ref/compute/#port-interfaces-servers-os-interface + """ + + def __init__(self, id, state, driver, created=None, extra=None): + """ + :param id: Port Interface ID. + :type id: ``str`` + :param state: State of the OpenStack_2_PortInterface. + :type state: :class:`.OpenStack_2_PortInterfaceState` + :param created: A datetime object that represents when the + port interface was created + :type created: ``datetime.datetime`` + :param extra: Optional provided specific attributes associated with + this image. + :type extra: ``dict`` + """ + self.id = str(id) + self.state = state + self.driver = driver + self.created = created + self.extra = extra or {} + UuidMixin.__init__(self) + + def delete(self): + """ + Delete this Port Interface + + :rtype: ``bool`` + """ + return self.driver.ex_delete_port(self) + + def __repr__(self): + return ("") % ( + self.id, + self.state, + self.driver.name, + ) + + +class OpenStack_2_QuotaSetItem: + """ + Qouta Set Item info. Each item has three attributes: in_use, + limit and reserved. + + See: + https://docs.openstack.org/api-ref/compute/?expanded=show-the-detail-of-quota-detail#show-a-quota + """ + + def __init__(self, in_use, limit, reserved): + """ + :param in_use: Number of currently used resources. + :type in_use: ``int`` + :param limit: Max number of available resources. + :type limit: ``int`` + :param reserved: Number of reserved resources. + :type reserved: ``int`` + """ + self.in_use = in_use + self.limit = limit + self.reserved = reserved + + def __repr__(self): + return '' % ( + self.in_use, + self.limit, + self.reserved, + ) + + +class OpenStack_2_QuotaSet: + """ + Quota Set info. To get the information about quotas and used resources. + + See: + https://docs.openstack.org/api-ref/compute/?expanded=show-the-detail-of-quota-detail#show-a-quota + + """ + + def __init__( + self, + id, + cores, + instances, + key_pairs, + metadata_items, + ram, + server_groups, + server_group_members, + fixed_ips=None, + floating_ips=None, + networks=None, + security_group_rules=None, + security_groups=None, + injected_file_content_bytes=None, + injected_file_path_bytes=None, + injected_files=None, + driver=None, + ): + """ + :param id: Quota Set ID. + :type id: ``str`` + :param cores: Quota Set of cores. + :type cores: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param instances: Quota Set of instances. + :type instances: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param key_pairs: Quota Set of key pairs. + :type key_pairs: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param metadata_items: Quota Set of metadata items. + :type metadata_items: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param ram: Quota Set of RAM. + :type ram: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param server_groups: Quota Set of server groups. + :type server_groups: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param fixed_ips: Quota Set of fixed ips. (optional) + :type fixed_ips: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param floating_ips: Quota Set of floating ips. (optional) + :type floating_ips: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param networks: Quota Set of networks. (optional) + :type networks: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param security_group_rules: Quota Set of security group rules. + (optional) + :type security_group_rules: :class:`.OpenStack_2_QuotaSetItem` + or ``dict`` + :param security_groups: Quota Set of security groups. (optional) + :type security_groups: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param injected_file_content_bytes: Quota Set of injected file content + bytes. (optional) + :type injected_file_content_bytes: :class:`.OpenStack_2_QuotaSetItem` + or ``dict`` + :param injected_file_path_bytes: Quota Set of injected file path bytes. + (optional) + :type injected_file_path_bytes: :class:`.OpenStack_2_QuotaSetItem` + or ``dict`` + :param injected_files: Quota Set of injected files. (optional) + :type injected_files: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + """ + self.id = str(id) + self.cores = self._to_quota_set_item(cores) + self.instances = self._to_quota_set_item(instances) + self.key_pairs = self._to_quota_set_item(key_pairs) + self.metadata_items = self._to_quota_set_item(metadata_items) + self.ram = self._to_quota_set_item(ram) + self.server_groups = self._to_quota_set_item(server_groups) + self.server_group_members = self._to_quota_set_item(server_group_members) + self.fixed_ips = self._to_quota_set_item(fixed_ips) + self.floating_ips = self._to_quota_set_item(floating_ips) + self.networks = self._to_quota_set_item(networks) + self.security_group_rules = self._to_quota_set_item(security_group_rules) + self.security_groups = self._to_quota_set_item(security_groups) + self.injected_file_content_bytes = self._to_quota_set_item(injected_file_content_bytes) + self.injected_file_path_bytes = self._to_quota_set_item(injected_file_path_bytes) + self.injected_files = self._to_quota_set_item(injected_files) + self.driver = driver + + def _to_quota_set_item(self, obj): + if obj: + if isinstance(obj, OpenStack_2_QuotaSetItem): + return obj + elif isinstance(obj, dict): + return OpenStack_2_QuotaSetItem(obj["in_use"], obj["limit"], obj["reserved"]) + else: + return None + + def __repr__(self): + return '' % ( + self.id, + self.cores, + self.ram, + self.instances, + ) + + +class OpenStack_2_NetworkQuota: + """ + Network Quota info. To get the information about quotas and used resources. + + See: + https://docs.openstack.org/api-ref/network/v2/?expanded=show-quota-details-for-a-tenant-detail,list-quotas-for-a-project-detail#show-quota-details-for-a-tenant + + """ + + def __init__( + self, + floatingip, + network, + port, + rbac_policy, + router, + security_group, + security_group_rule, + subnet, + subnetpool, + driver=None, + ): + """ + :param floatingip: Quota of floating ips. + :type floatingip: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param network: Quota of networks. + :type network: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param port: Quota of ports. + :type port: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param rbac_policy: Quota of rbac policies. + :type rbac_policy: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param router: Quota of routers. + :type router: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param security_group: Quota of security groups. + :type security_group: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param security_group_rule: Quota of security group rules. + :type security_group_rule: :class:`.OpenStack_2_QuotaSetItem` + or ``dict`` + :param subnet: Quota of subnets. + :type subnet: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + :param subnetpool: Quota of subnet pools. + :type subnetpool: :class:`.OpenStack_2_QuotaSetItem` or ``dict`` + """ + self.floatingip = self._to_quota_set_item(floatingip) + self.network = self._to_quota_set_item(network) + self.port = self._to_quota_set_item(port) + self.rbac_policy = self._to_quota_set_item(rbac_policy) + self.router = self._to_quota_set_item(router) + self.security_group = self._to_quota_set_item(security_group) + self.security_group_rule = self._to_quota_set_item(security_group_rule) + self.subnet = self._to_quota_set_item(subnet) + self.subnetpool = self._to_quota_set_item(subnetpool) + self.driver = driver + + def _to_quota_set_item(self, obj): + if obj: + if isinstance(obj, OpenStack_2_QuotaSetItem): + return obj + elif isinstance(obj, dict): + return OpenStack_2_QuotaSetItem(obj["used"], obj["limit"], obj["reserved"]) + else: + return None + + def __repr__(self): + return ( + '' + % ( + self.floatingip, + self.network, + self.security_group, + self.security_group_rule, + ) + ) + + +class OpenStack_2_VolumeQuota: + """ + Volume Quota info. To get the information about quotas and used resources. + + See: + https://docs.openstack.org/api-ref/block-storage/v2/index.html?expanded=show-quotas-detail + https://docs.openstack.org/api-ref/block-storage/v3/index.html?expanded=show-quota-usage-for-a-project-detail + """ + + def __init__( + self, + backup_gigabytes, + gigabytes, + per_volume_gigabytes, + backups, + snapshots, + volumes, + driver=None, + ): + """ + :param backup_gigabytes: Quota of backup size in gigabytes. + :type backup_gigabytes: :class:`.OpenStack_2_QuotaSetItem` or ``int`` + :param gigabytes: Quota of volume size in gigabytes. + :type gigabytes: :class:`.OpenStack_2_QuotaSetItem` or ``int`` + :param per_volume_gigabytes: Quota of per volume gigabytes. + :type per_volume_gigabytes: :class:`.OpenStack_2_QuotaSetItem` + or ``int`` + :param backups: Quota of backups. + :type backups: :class:`.OpenStack_2_QuotaSetItem` or ``int`` + :param snapshots: Quota of snapshots. + :type snapshots: :class:`.OpenStack_2_QuotaSetItem` or ``int`` + :param volumes: Quota of security volumes. + :type volumes: :class:`.OpenStack_2_QuotaSetItem` or ``int`` + """ + self.backup_gigabytes = self._to_quota_set_item(backup_gigabytes) + self.gigabytes = self._to_quota_set_item(gigabytes) + self.per_volume_gigabytes = self._to_quota_set_item(per_volume_gigabytes) + self.backups = self._to_quota_set_item(backups) + self.snapshots = self._to_quota_set_item(snapshots) + self.volumes = self._to_quota_set_item(volumes) + self.driver = driver + + def _to_quota_set_item(self, obj): + if obj: + if isinstance(obj, OpenStack_2_QuotaSetItem): + return obj + elif isinstance(obj, dict): + return OpenStack_2_QuotaSetItem(obj["in_use"], obj["limit"], obj["reserved"]) + elif isinstance(obj, int): + return OpenStack_2_QuotaSetItem(0, obj, 0) + else: + return None + else: + return None + + def __repr__(self): + return ( + '' + % (self.volumes, self.gigabytes, self.snapshots, self.backups) + ) + + +class OpenStack_2_ServerGroup: + """ + Server Group info. + + See: + https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail,list-server-groups-detail#server-groups-os-server-groups + """ + + def __init__( + self, + id, + name, + policy, + members=None, + rules=None, + driver=None, + ): + """ + :param id: Server Group ID. + :type id: ``str`` + :param name: Server Group Name. + :type name: ``str`` + :param policy: Server Group policy. + :type policy: ``str`` + :param members: Server Group members. + :type members: ``list`` + :param rules: Server Group rules. + :type rules: ``list`` + """ + self.id = id + self.name = name + self.policy = policy + self.members = members or [] + self.rules = rules or [] + self.driver = driver + + def __repr__(self): + return ( + '' + % (self.id, self.name, self.policy, self.members, self.rules) + ) diff --git a/libcloud/compute/drivers/opsource.py b/libcloud/compute/drivers/opsource.py deleted file mode 100644 index d40155c0e2..0000000000 --- a/libcloud/compute/drivers/opsource.py +++ /dev/null @@ -1,620 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Opsource Driver -""" - -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - -from base64 import b64encode - -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import b - -from libcloud.compute.base import NodeDriver, Node -from libcloud.compute.base import NodeSize, NodeImage, NodeLocation -from libcloud.common.types import LibcloudError, InvalidCredsError -from libcloud.common.base import ConnectionUserAndKey, XmlResponse -from libcloud.utils.xml import fixxpath, findtext, findall -from libcloud.compute.types import NodeState, Provider - -# Roadmap / TODO: -# -# 0.1 - Basic functionality: create, delete, start, stop, reboot - servers -# (base OS images only, no customer images supported yet) -# x implement list_nodes() -# x implement create_node() (only support Base OS images, -# no customer images yet) -# x implement reboot() -# x implement destroy_node() -# x implement list_sizes() -# x implement list_images() (only support Base OS images, -# no customer images yet) -# x implement list_locations() -# x implement ex_* extension functions for opsource-specific featurebody -# x ex_graceful_shutdown -# x ex_start_node -# x ex_power_off -# x ex_list_networks (needed for create_node()) -# x refactor: switch to using fixxpath() from the vcloud driver for -# dealing with xml namespace tags -# x refactor: move some functionality from OpsourceConnection.request() -# method into new .request_with_orgId() method -# x add OpsourceStatus object support to: -# x _to_node() -# x _to_network() -# x implement test cases -# -# 0.2 - Support customer images (snapshots) and server modification functions -# - support customer-created images: -# - list deployed customer images (in list_images() ?) -# - list pending customer images (in list_images() ?) -# - delete customer images -# - modify customer images -# - add "pending-servers" in list_nodes() -# - implement various ex_* extension functions for opsource-specific -# features -# - ex_modify_server() -# - ex_add_storage_to_server() -# - ex_snapshot_server() (create's customer image) -# -# 0.3 - support Network API -# 0.4 - Support VIP/Load-balancing API -# 0.5 - support Files Account API -# 0.6 - support Reports API -# 1.0 - Opsource 0.9 API feature complete, tested - -# setup a few variables to represent all of the opsource cloud namespaces -NAMESPACE_BASE = "http://oec.api.opsource.net/schemas" -ORGANIZATION_NS = NAMESPACE_BASE + "/organization" -SERVER_NS = NAMESPACE_BASE + "/server" -NETWORK_NS = NAMESPACE_BASE + "/network" -DIRECTORY_NS = NAMESPACE_BASE + "/directory" -RESET_NS = NAMESPACE_BASE + "/reset" -VIP_NS = NAMESPACE_BASE + "/vip" -IMAGEIMPORTEXPORT_NS = NAMESPACE_BASE + "/imageimportexport" -DATACENTER_NS = NAMESPACE_BASE + "/datacenter" -SUPPORT_NS = NAMESPACE_BASE + "/support" -GENERAL_NS = NAMESPACE_BASE + "/general" -IPPLAN_NS = NAMESPACE_BASE + "/ipplan" -WHITELABEL_NS = NAMESPACE_BASE + "/whitelabel" - - -class OpsourceResponse(XmlResponse): - - def parse_error(self): - if self.status == httplib.UNAUTHORIZED: - raise InvalidCredsError(self.body) - elif self.status == httplib.FORBIDDEN: - raise InvalidCredsError(self.body) - - body = self.parse_body() - - if self.status == httplib.BAD_REQUEST: - code = findtext(body, 'resultCode', SERVER_NS) - message = findtext(body, 'resultDetail', SERVER_NS) - raise OpsourceAPIException(code, - message, - driver=OpsourceNodeDriver) - - return self.body - - -class OpsourceAPIException(LibcloudError): - def __init__(self, code, msg, driver): - self.code = code - self.msg = msg - self.driver = driver - - def __str__(self): - return "%s: %s" % (self.code, self.msg) - - def __repr__(self): - return ("" % - (self.code, self.msg)) - - -class OpsourceConnection(ConnectionUserAndKey): - """ - Connection class for the Opsource driver - """ - - host = 'api.opsourcecloud.net' - api_path = '/oec' - api_version = '0.9' - _orgId = None - responseCls = OpsourceResponse - - allow_insecure = False - - def add_default_headers(self, headers): - headers['Authorization'] = \ - ('Basic %s' % b64encode(b('%s:%s' % (self.user_id, - self.key))).decode('utf-8')) - return headers - - def request(self, action, params=None, data='', - headers=None, method='GET'): - action = "%s/%s/%s" % (self.api_path, self.api_version, action) - - return super(OpsourceConnection, self).request( - action=action, - params=params, data=data, - method=method, headers=headers) - - def request_with_orgId(self, action, params=None, data='', - headers=None, method='GET'): - action = "%s/%s" % (self.get_resource_path(), action) - - return super(OpsourceConnection, self).request( - action=action, - params=params, data=data, - method=method, headers=headers) - - def get_resource_path(self): - """ - This method returns a resource path which is necessary for referencing - resources that require a full path instead of just an ID, such as - networks, and customer snapshots. - """ - return ("%s/%s/%s" % (self.api_path, self.api_version, - self._get_orgId())) - - def _get_orgId(self): - """ - Send the /myaccount API request to opsource cloud and parse the - 'orgId' from the XML response object. We need the orgId to use most - of the other API functions - """ - if self._orgId is None: - body = self.request('myaccount').object - self._orgId = findtext(body, 'orgId', DIRECTORY_NS) - return self._orgId - - -class OpsourceStatus(object): - """ - Opsource API pending operation status class - action, requestTime, username, numberOfSteps, updateTime, - step.name, step.number, step.percentComplete, failureReason, - """ - def __init__(self, action=None, requestTime=None, userName=None, - numberOfSteps=None, updateTime=None, step_name=None, - step_number=None, step_percentComplete=None, - failureReason=None): - self.action = action - self.requestTime = requestTime - self.userName = userName - self.numberOfSteps = numberOfSteps - self.updateTime = updateTime - self.step_name = step_name - self.step_number = step_number - self.step_percentComplete = step_percentComplete - self.failureReason = failureReason - - def __repr__(self): - return (('') - % (self.id, self.name, self.description, self.location, - self.privateNet, self.multicast)) - - -class OpsourceNodeDriver(NodeDriver): - """ - Opsource node driver. - """ - - connectionCls = OpsourceConnection - name = 'Opsource' - website = 'http://www.opsource.net/' - type = Provider.OPSOURCE - features = {'create_node': ['password']} - - def create_node(self, **kwargs): - """ - Create a new opsource node - - :keyword name: String with a name for this new node (required) - :type name: ``str`` - - :keyword image: OS Image to boot on node. (required) - :type image: :class:`NodeImage` - - :keyword auth: Initial authentication information for the - node (required) - :type auth: :class:`NodeAuthPassword` - - :keyword ex_description: description for this node (required) - :type ex_description: ``str`` - - :keyword ex_network: Network to create the node within (required) - :type ex_network: :class:`OpsourceNetwork` - - :keyword ex_isStarted: Start server after creation? default - true (required) - :type ex_isStarted: ``bool`` - - :return: The newly created :class:`Node`. NOTE: Opsource does not - provide a - way to determine the ID of the server that was just created, - so the returned :class:`Node` is not guaranteed to be the same - one that was created. This is only the case when multiple - nodes with the same name exist. - :rtype: :class:`Node` - """ - name = kwargs['name'] - image = kwargs['image'] - - # XXX: Node sizes can be adjusted after a node is created, but - # cannot be set at create time because size is part of the - # image definition. - password = None - auth = self._get_and_check_auth(kwargs.get('auth')) - password = auth.password - - ex_description = kwargs.get('ex_description', '') - ex_isStarted = kwargs.get('ex_isStarted', True) - - ex_network = kwargs.get('ex_network') - if not isinstance(ex_network, OpsourceNetwork): - raise ValueError('ex_network must be of OpsourceNetwork type') - vlanResourcePath = "%s/%s" % (self.connection.get_resource_path(), - ex_network.id) - - imageResourcePath = None - if 'resourcePath' in image.extra: - imageResourcePath = image.extra['resourcePath'] - else: - imageResourcePath = "%s/%s" % (self.connection.get_resource_path(), - image.id) - - server_elm = ET.Element('Server', {'xmlns': SERVER_NS}) - ET.SubElement(server_elm, "name").text = name - ET.SubElement(server_elm, "description").text = ex_description - ET.SubElement(server_elm, "vlanResourcePath").text = vlanResourcePath - ET.SubElement(server_elm, "imageResourcePath").text = imageResourcePath - ET.SubElement(server_elm, "administratorPassword").text = password - ET.SubElement(server_elm, "isStarted").text = str(ex_isStarted) - - self.connection.request_with_orgId('server', - method='POST', - data=ET.tostring(server_elm)).object - - # XXX: return the last node in the list that has a matching name. this - # is likely but not guaranteed to be the node we just created - # because opsource allows multiple nodes to have the same name - node = list(filter(lambda x: x.name == name, self.list_nodes()))[-1] - - if getattr(auth, "generated", False): - node.extra['password'] = auth.password - - return node - - def destroy_node(self, node): - body = self.connection.request_with_orgId( - 'server/%s?delete' % (node.id)).object - - result = findtext(body, 'result', GENERAL_NS) - return result == 'SUCCESS' - - def reboot_node(self, node): - body = self.connection.request_with_orgId( - 'server/%s?restart' % (node.id)).object - result = findtext(body, 'result', GENERAL_NS) - return result == 'SUCCESS' - - def list_nodes(self): - nodes = self._to_nodes( - self.connection.request_with_orgId('server/deployed').object) - nodes.extend(self._to_nodes( - self.connection.request_with_orgId('server/pendingDeploy').object)) - return nodes - - def list_images(self, location=None): - """ - return a list of available images - Currently only returns the default 'base OS images' provided by - opsource. Customer images (snapshots) are not yet supported. - - @inherits: :class:`NodeDriver.list_images` - """ - return self._to_base_images( - self.connection.request('base/image').object) - - def list_sizes(self, location=None): - return [ - NodeSize(id=1, - name="default", - ram=0, - disk=0, - bandwidth=0, - price=0, - driver=self.connection.driver), - ] - - def list_locations(self): - """ - list locations (datacenters) available for instantiating servers and - networks. - - @inherits: :class:`NodeDriver.list_locations` - """ - return self._to_locations( - self.connection.request_with_orgId('datacenter').object) - - def list_networks(self, location=None): - """ - List networks deployed across all data center locations for your - organization. The response includes the location of each network. - - - :keyword location: The location - :type location: :class:`NodeLocation` - - :return: a list of OpsourceNetwork objects - :rtype: ``list`` of :class:`OpsourceNetwork` - """ - return self._to_networks( - self.connection.request_with_orgId('networkWithLocation').object) - - def _to_base_images(self, object): - images = [] - for element in object.findall(fixxpath("ServerImage", SERVER_NS)): - images.append(self._to_base_image(element)) - - return images - - def _to_base_image(self, element): - # Eventually we will probably need multiple _to_image() functions - # that parse differently than . - # DeployedImages are customer snapshot images, and ServerImages are - # 'base' images provided by opsource - location_id = findtext(element, 'location', SERVER_NS) - location = self.ex_get_location_by_id(location_id) - - extra = { - 'description': findtext(element, 'description', SERVER_NS), - 'OS_type': findtext(element, 'operatingSystem/type', SERVER_NS), - 'OS_displayName': findtext(element, 'operatingSystem/displayName', - SERVER_NS), - 'cpuCount': findtext(element, 'cpuCount', SERVER_NS), - 'resourcePath': findtext(element, 'resourcePath', SERVER_NS), - 'memory': findtext(element, 'memory', SERVER_NS), - 'osStorage': findtext(element, 'osStorage', SERVER_NS), - 'additionalStorage': findtext(element, 'additionalStorage', - SERVER_NS), - 'created': findtext(element, 'created', SERVER_NS), - 'location': location, - } - - return NodeImage(id=str(findtext(element, 'id', SERVER_NS)), - name=str(findtext(element, 'name', SERVER_NS)), - extra=extra, - driver=self.connection.driver) - - def ex_start_node(self, node): - """ - Powers on an existing deployed server - - :param node: Node which should be used - :type node: :class:`Node` - - :rtype: ``bool`` - """ - body = self.connection.request_with_orgId( - 'server/%s?start' % node.id).object - result = findtext(body, 'result', GENERAL_NS) - return result == 'SUCCESS' - - def ex_shutdown_graceful(self, node): - """ - This function will attempt to "gracefully" stop a server by - initiating a shutdown sequence within the guest operating system. - A successful response on this function means the system has - successfully passed the request into the operating system. - - :param node: Node which should be used - :type node: :class:`Node` - - :rtype: ``bool`` - """ - body = self.connection.request_with_orgId( - 'server/%s?shutdown' % (node.id)).object - result = findtext(body, 'result', GENERAL_NS) - return result == 'SUCCESS' - - def ex_power_off(self, node): - """ - This function will abruptly power-off a server. Unlike - ex_shutdown_graceful, success ensures the node will stop but some OS - and application configurations may be adversely affected by the - equivalent of pulling the power plug out of the machine. - - :param node: Node which should be used - :type node: :class:`Node` - - :rtype: ``bool`` - """ - body = self.connection.request_with_orgId( - 'server/%s?poweroff' % node.id).object - result = findtext(body, 'result', GENERAL_NS) - return result == 'SUCCESS' - - def ex_list_networks(self): - """ - List networks deployed across all data center locations for your - organization. The response includes the location of each network. - - :return: a list of OpsourceNetwork objects - :rtype: ``list`` of :class:`OpsourceNetwork` - """ - response = self.connection.request_with_orgId('networkWithLocation') \ - .object - return self._to_networks(response) - - def ex_get_location_by_id(self, id): - """ - Get location by ID. - - :param id: ID of the node location which should be used - :type id: ``str`` - - :rtype: :class:`NodeLocation` - """ - location = None - if id is not None: - location = list( - filter(lambda x: x.id == id, self.list_locations()))[0] - return location - - def _to_networks(self, object): - networks = [] - for element in findall(object, 'network', NETWORK_NS): - networks.append(self._to_network(element)) - - return networks - - def _to_network(self, element): - multicast = False - if findtext(element, 'multicast', NETWORK_NS) == 'true': - multicast = True - - status = self._to_status(element.find(fixxpath('status', NETWORK_NS))) - - location_id = findtext(element, 'location', NETWORK_NS) - location = self.ex_get_location_by_id(location_id) - - return OpsourceNetwork(id=findtext(element, 'id', NETWORK_NS), - name=findtext(element, 'name', NETWORK_NS), - description=findtext(element, 'description', - NETWORK_NS), - location=location, - privateNet=findtext(element, 'privateNet', - NETWORK_NS), - multicast=multicast, - status=status) - - def _to_locations(self, object): - locations = [] - for element in object.findall(fixxpath('datacenter', DATACENTER_NS)): - locations.append(self._to_location(element)) - - return locations - - def _to_location(self, element): - l = NodeLocation(id=findtext(element, 'location', DATACENTER_NS), - name=findtext(element, 'displayName', DATACENTER_NS), - country=findtext(element, 'country', DATACENTER_NS), - driver=self) - return l - - def _to_nodes(self, object): - node_elements = object.findall(fixxpath('DeployedServer', SERVER_NS)) - node_elements.extend(object.findall( - fixxpath('PendingDeployServer', SERVER_NS))) - return [self._to_node(el) for el in node_elements] - - def _to_node(self, element): - if findtext(element, 'isStarted', SERVER_NS) == 'true': - state = NodeState.RUNNING - else: - state = NodeState.TERMINATED - - status = self._to_status(element.find(fixxpath('status', SERVER_NS))) - - extra = { - 'description': findtext(element, 'description', SERVER_NS), - 'sourceImageId': findtext(element, 'sourceImageId', SERVER_NS), - 'networkId': findtext(element, 'networkId', SERVER_NS), - 'machineName': findtext(element, 'machineName', SERVER_NS), - 'deployedTime': findtext(element, 'deployedTime', SERVER_NS), - 'cpuCount': findtext(element, 'machineSpecification/cpuCount', - SERVER_NS), - 'memoryMb': findtext(element, 'machineSpecification/memoryMb', - SERVER_NS), - 'osStorageGb': findtext(element, - 'machineSpecification/osStorageGb', - SERVER_NS), - 'additionalLocalStorageGb': findtext( - element, 'machineSpecification/additionalLocalStorageGb', - SERVER_NS), - 'OS_type': findtext(element, - 'machineSpecification/operatingSystem/type', - SERVER_NS), - 'OS_displayName': findtext( - element, 'machineSpecification/operatingSystem/displayName', - SERVER_NS), - 'status': status, - } - - public_ip = findtext(element, 'publicIpAddress', SERVER_NS) - - n = Node(id=findtext(element, 'id', SERVER_NS), - name=findtext(element, 'name', SERVER_NS), - state=state, - public_ips=[public_ip] if public_ip is not None else [], - private_ips=findtext(element, 'privateIpAddress', SERVER_NS), - driver=self.connection.driver, - extra=extra) - return n - - def _to_status(self, element): - if element is None: - return OpsourceStatus() - s = OpsourceStatus(action=findtext(element, 'action', SERVER_NS), - requestTime=findtext(element, 'requestTime', - SERVER_NS), - userName=findtext(element, 'userName', - SERVER_NS), - numberOfSteps=findtext(element, 'numberOfSteps', - SERVER_NS), - step_name=findtext(element, 'step/name', - SERVER_NS), - step_number=findtext(element, 'step_number', - SERVER_NS), - step_percentComplete=findtext( - element, 'step/percentComplete', SERVER_NS), - failureReason=findtext(element, 'failureReason', - SERVER_NS)) - return s diff --git a/libcloud/compute/drivers/outscale.py b/libcloud/compute/drivers/outscale.py new file mode 100644 index 0000000000..1ba121eaff --- /dev/null +++ b/libcloud/compute/drivers/outscale.py @@ -0,0 +1,7814 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Outscale SDK +""" + +import json +from typing import List +from datetime import datetime + +import requests + +from libcloud.common.osc import OSCRequestSignerAlgorithmV4 +from libcloud.common.base import ConnectionUserAndKey +from libcloud.compute.base import ( + Node, + KeyPair, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, + VolumeSnapshot, +) +from libcloud.compute.types import Provider, NodeState + + +class OutscaleNodeDriver(NodeDriver): + """ + Outscale SDK node driver + """ + + type = Provider.OUTSCALE + name = "Outscale API" + website = "http://www.outscale.com" + + def __init__( + self, + key: str = None, + secret: str = None, + region: str = "eu-west-2", + service: str = "api", + version: str = "latest", + base_uri: str = "outscale.com", + ): + self.key = key + self.secret = secret + self.region = region + self.connection = ConnectionUserAndKey(self.key, self.secret) + self.connection.region_name = region + self.connection.service_name = service + self.service_name = service + self.base_uri = base_uri + self.version = version + self.signer = OSCRequestSignerAlgorithmV4( + access_key=self.key, + access_secret=self.secret, + version=self.version, + connection=self.connection, + ) + self.NODE_STATE = { + "pending": NodeState.PENDING, + "running": NodeState.RUNNING, + "shutting-down": NodeState.UNKNOWN, + "terminated": NodeState.TERMINATED, + "stopped": NodeState.STOPPED, + } + + def list_locations(self, ex_dry_run: bool = False): + """ + Lists available locations details. + + :param ex_dry_run: If true, checks whether you have the required + permissions to perform the action. + :type ex_dry_run: ``bool`` + :return: locations details + :rtype: ``dict`` + """ + action = "ReadLocations" + data = json.dumps({"DryRun": ex_dry_run}) + response = self._call_api(action, data) + if response.status_code == 200: + return self._to_locations(response.json()["Locations"]) + return response.json() + + def ex_list_regions(self, ex_dry_run: bool = False): + """ + Lists available regions details. + + :param ex_dry_run: If true, checks whether you have the required + permissions to perform the action. + :type ex_dry_run: ``bool`` + :return: regions details + :rtype: ``dict`` + """ + action = "ReadRegions" + data = json.dumps({"DryRun": ex_dry_run}) + response = self._call_api(action, data) + if response.status_code == 200: + return response.json()["Regions"] + return response.json() + + def ex_list_subregions(self, ex_dry_run: bool = False): + """ + Lists available subregions details. + + :param ex_dry_run: If true, checks whether you have the required + permissions to perform the action. + :type ex_dry_run: ``bool`` + :return: subregions details + :rtype: ``dict`` + """ + action = "ReadSubregions" + data = json.dumps({"DryRun": ex_dry_run}) + response = self._call_api(action, data) + if response.status_code == 200: + return response.json()["Subregions"] + return response.json() + + def ex_create_public_ip(self, dry_run: bool = False): + """ + Create a new public ip. + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: the created public ip + :rtype: ``dict`` + """ + action = "CreatePublicIp" + data = json.dumps({"DryRun": dry_run}) + response = self._call_api(action, data) + if response.status_code == 200: + return response.json()["PublicIp"] + return response.json() + + def ex_delete_public_ip( + self, dry_run: bool = False, public_ip: str = None, public_ip_id: str = None + ): + """ + Delete public ip. + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :param public_ip: The EIP. In the public Cloud, this parameter is + required. + :type public_ip: ``str`` + + :param public_ip_id: The ID representing the association of the + EIP with the VM or the NIC. In a Net, + this parameter is required. + :type public_ip_id: ``str`` + + :return: request + :rtype: ``dict`` + """ + action = "DeletePublicIp" + data = {"DryRun": dry_run} + if public_ip is not None: + data.update({"PublicIp": public_ip}) + if public_ip_id is not None: + data.update({"PublicIpId": public_ip_id}) + data = json.dumps(data) + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def ex_list_public_ips(self, data: str = "{}"): + """ + List all public IPs. + + :param data: json stringify following the outscale api + documentation for filter + :type data: ``string`` + + :return: nodes + :rtype: ``dict`` + """ + action = "ReadPublicIps" + response = self._call_api(action, data) + if response.status_code == 200: + return response.json()["PublicIps"] + return response.json() + + def ex_list_public_ip_ranges(self, dry_run: bool = False): + """ + Lists available regions details. + + :param dry_run: If true, checks whether you have the + required permissions to perform the action. + :type dry_run: ``bool`` + + :return: regions details + :rtype: ``dict`` + """ + action = "ReadPublicIpRanges" + data = json.dumps({"DryRun": dry_run}) + response = self._call_api(action, data) + if response.status_code == 200: + return response.json()["PublicIps"] + return response.json() + + def ex_attach_public_ip( + self, + allow_relink: bool = None, + dry_run: bool = False, + nic_id: str = None, + vm_id: str = None, + public_ip: str = None, + public_ip_id: str = None, + ): + """ + Attach public ip to a node. + + :param allow_relink: If true, allows the EIP to be associated + with the VM or NIC that you specify even if + it is already associated with another VM or NIC. + :type allow_relink: ``bool`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :param nic_id:(Net only) The ID of the NIC. This parameter is + required if the VM has more than one NIC attached. Otherwise, + you need to specify the VmId parameter instead. + You cannot specify both parameters + at the same time. + :type nic_id: ``str`` + + :param vm_id: the ID of the VM + :type nic_id: ``str`` + + :param public_ip: The EIP. In the public Cloud, this parameter + is required. + :type public_ip: ``str`` + + :param public_ip_id: The allocation ID of the EIP. In a Net, + this parameter is required. + :type public_ip_id: ``str`` + + :return: the attached volume + :rtype: ``dict`` + """ + action = "LinkPublicIp" + data = {"DryRun": dry_run} + if public_ip is not None: + data.update({"PublicIp": public_ip}) + if public_ip_id is not None: + data.update({"PublicIpId": public_ip_id}) + if nic_id is not None: + data.update({"NicId": nic_id}) + if vm_id is not None: + data.update({"VmId": vm_id}) + if allow_relink is not None: + data.update({"AllowRelink": allow_relink}) + data = json.dumps(data) + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def ex_detach_public_ip( + self, + public_ip: str = None, + link_public_ip_id: str = None, + dry_run: bool = False, + ): + """ + Detach public ip from a node. + + :param public_ip: (Required in a Net) The ID representing the + association of the EIP with the VM or the NIC + :type public_ip: ``str`` + + :param link_public_ip_id: (Required in a Net) The ID + representing the association of the EIP with the + VM or the NIC. + :type link_public_ip_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: the attached volume + :rtype: ``dict`` + """ + action = "UnlinkPublicIp" + data = {"DryRun": dry_run} + if public_ip is not None: + data.update({"PublicIp": public_ip}) + if link_public_ip_id is not None: + data.update({"LinkPublicIpId": link_public_ip_id}) + data = json.dumps(data) + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def create_node( + self, + name: str, + size, + image: NodeImage, + location=None, + auth=None, + ex_dry_run: bool = False, + ex_block_device_mapping: dict = None, + ex_boot_on_creation: bool = True, + ex_bsu_optimized: bool = True, + ex_client_token: str = None, + ex_deletion_protection: bool = False, + ex_keypair_name: str = None, + ex_max_vms_count: int = None, + ex_min_vms_count: int = None, + ex_nics: List[dict] = None, + ex_performance: str = None, + ex_placement: dict = None, + ex_private_ips: List[str] = None, + ex_security_group_ids: List[str] = None, + ex_security_groups: List[str] = None, + ex_subnet_id: str = None, + ex_user_data: str = None, + ex_vm_initiated_shutdown_behavior: str = None, + ex_vm_type: str = None, + ): + """ + Create a new instance. + + :param image: The image used to create the VM. + :type image: ``NodeImage`` + + :param name: The name of the Node. + :type name: ``str`` + + :param ex_dry_run: If true, checks whether you have the required + permissions to perform the action. + :type ex_dry_run: ``bool`` + + :param ex_block_device_mapping: One or more block device mappings. + :type ex_block_device_mapping: ``dict`` + + :param ex_boot_on_creation: By default or if true, the VM is + started on creation. If false, the VM is + stopped on creation. + :type ex_boot_on_creation: ``bool`` + + :param ex_bsu_optimized: If true, the VM is created with optimized + BSU I/O. + :type ex_bsu_optimized: ``bool`` + + :param ex_client_token: A unique identifier which enables you to + manage the idempotency. + :type ex_client_token: ``bool`` + + :param ex_deletion_protection: If true, you cannot terminate the + VM using Cockpit, the CLI or the API. + If false, you can. + :type ex_deletion_protection: ``bool`` + + :param ex_keypair_name: The name of the keypair. + :type ex_keypair_name: ``str`` + + :param ex_max_vms_count: The maximum number of VMs you want to + create. If all the VMs cannot be created, the + largest possible number of VMs above MinVmsCount is created. + :type ex_max_vms_count: ``integer`` + + :param ex_min_vms_count: The minimum number of VMs you want to + create. If this number of VMs cannot be + created, no VMs are created. + :type ex_min_vms_count: ``integer`` + + :param ex_nics: One or more NICs. If you specify this parameter, + you must define one NIC as the primary + network interface of the VM with 0 as its device number. + :type ex_nics: ``list`` of ``dict`` + + :param ex_performance: The performance of the VM (standard | high + | highest). + :type ex_performance: ``str`` + + :param ex_placement: Information about the placement of the VM. + :type ex_placement: ``dict`` + + :param ex_private_ips: One or more private IP addresses of the VM. + :type ex_private_ips: ``list`` + + :param ex_security_group_ids: One or more IDs of security group + for the VMs. + :type ex_security_group_ids: ``list`` + + :param ex_security_groups: One or more names of security groups + for the VMs. + :type ex_security_groups: ``list`` + + :param ex_subnet_id: The ID of the Subnet in which you want to + create the VM. + :type ex_subnet_id: ``str`` + + :param ex_user_data: Data or script used to add a specific + configuration to the VM. It must be base64-encoded. + :type ex_user_data: ``str`` + + :param ex_vm_initiated_shutdown_behavior: The VM behavior when + you stop it. By default or if set to stop, the + VM stops. If set to restart, the VM stops then automatically restarts. + If set to terminate, the VM stops and is terminated. + create the VM. + :type ex_vm_initiated_shutdown_behavior: ``str`` + + :param ex_vm_type: The type of VM (t2.small by default). + :type ex_vm_type: ``str`` + + :return: the created instance + :rtype: ``dict`` + """ + data = { + "DryRun": ex_dry_run, + "BootOnCreation": ex_boot_on_creation, + "BsuOptimized": ex_bsu_optimized, + "ImageId": image.id, + } + if ex_block_device_mapping is not None: + data.update({"BlockDeviceMappings": ex_block_device_mapping}) + if ex_client_token is not None: + data.update({"ClientToken": ex_client_token}) + if ex_deletion_protection is not None: + data.update({"DeletionProtection": ex_deletion_protection}) + if ex_keypair_name is not None: + data.update({"KeypairName": ex_keypair_name}) + if ex_max_vms_count is not None: + data.update({"MaxVmsCount": ex_max_vms_count}) + if ex_min_vms_count is not None: + data.update({"MinVmsCount": ex_min_vms_count}) + if ex_nics is not None: + data.update({"Nics": ex_nics}) + if ex_performance is not None: + data.update({"Performance": ex_performance}) + if ex_placement is not None: + data.update({"Placement": ex_placement}) + if ex_private_ips is not None: + data.update({"PrivateIps": ex_private_ips}) + if ex_security_group_ids is not None: + data.update({"SecurityGroupIds": ex_security_group_ids}) + if ex_security_groups is not None: + data.update({"SecurityGroups": ex_security_groups}) + if ex_user_data is not None: + data.update({"UserData": ex_user_data}) + if ex_vm_initiated_shutdown_behavior is not None: + data.update({"VmInstantiatedShutdownBehavior": ex_vm_initiated_shutdown_behavior}) + if ex_vm_type is not None: + data.update({"VmType": ex_vm_type}) + if ex_subnet_id is not None: + data.update({"SubnetId": ex_subnet_id}) + action = "CreateVms" + data = json.dumps(data) + node = self._to_node(self._call_api(action, data).json()["Vms"][0]) + if name is not None: + action = "CreateTags" + data = { + "DryRun": ex_dry_run, + "ResourceIds": [node.id], + "Tags": {"Key": "Name", "Value": name}, + } + data = json.dumps(data) + response = self._call_api(action, data) + if response.status_code != 200: + return response.json() + action = "ReadVms" + data = {"DryRun": ex_dry_run, "Filters": {"VmIds": [node.id]}} + return self._to_node(self._call_api(action, json.dumps(data)).json()["Vms"][0]) + return node + + def reboot_node(self, node: Node): + """ + Reboot instance. + + :param node: VM(s) you want to reboot (required) + :type node: ``list`` + + :return: the rebooted instances + :rtype: ``dict`` + """ + action = "RebootVms" + data = json.dumps({"VmIds": [node.id]}) + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def start_node(self, node: Node): + """ + Start a Vm. + + :param node: the VM(s) + you want to start (required) + :type node: ``Node`` + + :return: the rebooted instances + :rtype: ``bool`` + """ + action = "StartVms" + data = json.dumps({"VmIds": [node.id]}) + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def stop_node(self, node: Node): + """ + Stop a Vm. + + :param node: the VM(s) + you want to stop (required) + :type node: ``Node`` + + :return: the rebooted instances + :rtype: ``bool`` + """ + action = "StopVms" + data = json.dumps({"VmIds": [node.id]}) + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def list_nodes(self, ex_data: str = "{}"): + """ + List all nodes. + + :return: nodes + :rtype: ``dict`` + """ + action = "ReadVms" + response = self._call_api(action, ex_data) + if response.status_code == 200: + return self._to_nodes(response.json()["Vms"]) + return response.json() + + def destroy_node(self, node: Node): + """ + Delete instance. + + :param node: one or more IDs of VMs (required) + :type node: ``Node`` + + :return: request + :rtype: ``bool`` + """ + action = "DeleteVms" + data = json.dumps({"VmIds": node.id}) + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def ex_read_admin_password_node(self, node: Node, dry_run: bool = False): + """ + Retrieves the administrator password for a Windows running virtual + machine (VM). + The administrator password is encrypted using the keypair you + specified when launching the VM. + + :param node: the ID of the VM (required) + :type node: ``Node`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The Admin Password of the specified Node. + :rtype: ``str`` + """ + action = "ReadAdminPassword" + data = json.dumps({"DryRun": dry_run, "VmId": node.id}) + response = self._call_api(action, data) + if response.status_code == 200: + return response.json()["AdminPassword"] + return response.json() + + def ex_read_console_output_node(self, node: Node, dry_run: bool = False): + """ + Gets the console output for a virtual machine (VM). This console + provides the most recent 64 KiB output. + + :param node: the ID of the VM (required) + :type node: ``Node`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The Console Output of the specified Node. + :rtype: ``str`` + """ + action = "ReadConsoleOutput" + data = json.dumps({"DryRun": dry_run, "VmId": node.id}) + response = self._call_api(action, data) + if response.status_code == 200: + return response.json()["ConsoleOutput"] + return response.json() + + def ex_list_node_types( + self, + bsu_optimized: bool = None, + memory_sizes: List[int] = None, + vcore_counts: List[int] = None, + vm_type_names: List[str] = None, + volume_counts: List[int] = None, + volume_sizes: List[int] = None, + dry_run: bool = False, + ): + """ + Lists one or more predefined VM types. + + :param bsu_optimized: Indicates whether the VM is optimized for + BSU I/O. + :type bsu_optimized: ``bool`` + + :param memory_sizes: The amounts of memory, in gibibytes (GiB). + :type memory_sizes: ``list`` of ``int`` + + :param vcore_counts: The numbers of vCores. + :type vcore_counts: ``list`` of ``int`` + + :param vm_type_names: The names of the VM types. For more + information, see Instance Types. + :type vm_type_names: ``list`` of ``str`` + + :param volume_counts: The maximum number of ephemeral storage + disks. + :type volume_counts: ``list`` of ``int`` + + + :param volume_sizes: The size of one ephemeral storage disk, + in gibibytes (GiB). + :type volume_sizes: ``list`` of ``int`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: list of vm types + :rtype: ``list`` of ``dict`` + """ + action = "ReadVmTypes" + data = {"Filters": {}, "DryRun": dry_run} + if bsu_optimized is not None: + data["Filters"].update({"BsuOptimized": bsu_optimized}) + if memory_sizes is not None: + data["Filters"].update({"MemorySizes": memory_sizes}) + if vcore_counts is not None: + data["Filters"].update({"VcoreCounts": vcore_counts}) + if vm_type_names is not None: + data["Filters"].update({"VmTypeNames": vm_type_names}) + if volume_counts is not None: + data["Filters"].update({"VolumeCounts": volume_counts}) + if volume_sizes is not None: + data["Filters"].update({"VolumeSizes": volume_sizes}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["VmTypes"] + return response.json() + + def ex_list_nodes_states( + self, + all_vms: bool = None, + subregion_names: List[str] = None, + vm_ids: List[str] = None, + vm_states: List[str] = None, + dry_run: bool = False, + ): + """ + Lists the status of one or more virtual machines (VMs). + + :param all_vms: If true, includes the status of all VMs. By + default or if set to false, only includes the status of running VMs. + :type all_vms: ``bool`` + + :param subregion_names: The names of the Subregions of the VMs. + :type subregion_names: ``list`` of ``str`` + + :param vm_ids: One or more IDs of VMs. + :type vm_ids: ``list`` of ``str`` + + :param vm_states: The states of the VMs + (pending | running | stopping | stopped | shutting-down | terminated + | quarantine) + :type vm_states: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: list the status of one or more vms + :rtype: ``list`` of ``dict`` + """ + action = "ReadVmsState" + data = {"Filters": {}, "DryRun": dry_run} + if all_vms is not None: + data.update({"AllVms": all_vms}) + if subregion_names is not None: + data["Filters"].update({"SubregionNames": subregion_names}) + if vm_ids is not None: + data["Filters"].update({"VmIds": vm_ids}) + if vm_states is not None: + data["Filters"].update({"VmStates": vm_states}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["VmStates"] + return response.json() + + def ex_update_node( + self, + block_device_mapping: List[dict], + bsu_optimized: bool = None, + deletion_protection: bool = False, + is_source_dest_checked: bool = None, + keypair_name: str = True, + performance: str = True, + security_group_ids: List[str] = None, + user_data: str = False, + vm_id: str = None, + vm_initiated_shutown_behavior: str = None, + vm_type: int = None, + dry_run: bool = False, + ): + """ + Modifies a specific attribute of a Node (VM). + You can modify only one attribute at a time. You can modify the + IsSourceDestChecked attribute only if the VM is in a Net. + You must stop the VM before modifying the following attributes: + + - VmType + - UserData + - BsuOptimized + + :param block_device_mapping: One or more block device mappings + of the VM. + :type block_device_mapping: ``dict`` + + :param bsu_optimized: If true, the VM is optimized for BSU I/O. + :type bsu_optimized: ``bool`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :param deletion_protection: If true, you cannot terminate the VM + using Cockpit, the CLI or the API. If false, you can. + :type deletion_protection: ``bool`` + + :param is_source_dest_checked: (Net only) If true, the + source/destination check is enabled. If false, it is disabled. This + value must be false for a NAT VM to perform network address + translation (NAT) in a Net. + :type is_source_dest_checked: ``bool`` + + :param keypair_name: The name of the keypair. + :type keypair_name: ``str`` + + :param performance: The performance of the VM + (standard | high | highest). + :type performance: ``str`` + + :param security_group_ids: One or more IDs of security groups for + the VM. + :type security_group_ids: ``bool`` + + :param user_data: The Base64-encoded MIME user data. + :type user_data: ``str`` + + :param vm_id: The ID of the VM. (required) + :type vm_id: ``str`` + + :param vm_initiated_shutown_behavior: The VM behavior when you + stop it. By default or if set to stop, the VM stops. If set to + restart, the VM stops then automatically restarts. If set to + terminate, the VM stops and is terminated. + :type vm_initiated_shutown_behavior: ``str`` + + :param vm_type: The type of VM. For more information, + see Instance Types: + https://wiki.outscale.net/display/EN/Instance+Types + :type vm_type: ``str`` + + :return: the updated Node + :rtype: ``dict`` + """ + action = "UpdateVm" + data = { + "DryRun": dry_run, + } + if block_device_mapping is not None: + data.update({"BlockDeviceMappings": block_device_mapping}) + if bsu_optimized is not None: + data.update({"BsuOptimized": bsu_optimized}) + if deletion_protection is not None: + data.update({"DeletionProtection": deletion_protection}) + if keypair_name is not None: + data.update({"KeypairName": keypair_name}) + if is_source_dest_checked is not None: + data.update({"IsSourceDestChecked": is_source_dest_checked}) + if performance is not None: + data.update({"Performance": performance}) + if security_group_ids is not None: + data.update({"SecurityGroupIds": security_group_ids}) + if user_data is not None: + data.update({"UserDate": user_data}) + if vm_id is not None: + data.update({"VmId": vm_id}) + if vm_initiated_shutown_behavior is not None: + data.update({"VmInitiatedShutdownBehavior": vm_initiated_shutown_behavior}) + if vm_type is not None: + data.update({"VmType": vm_type}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return self._to_node(response.json()["Vm"]) + return response.json() + + def create_image( + self, + node, + name, + description=None, + ex_architecture: str = None, + ex_block_device_mapping: dict = None, + ex_no_reboot: bool = False, + ex_root_device_name: str = None, + ex_dry_run: bool = False, + ex_source_region_name: str = None, + ex_file_location: str = None, + ): + """ + Create a new image. + + :param node: a valid Node object + :type node: ``str`` + + :param ex_architecture: The architecture of the OMI (by default, + i386). + :type ex_architecture: ``str`` + + :param description: a description for the new OMI + :type description: ``str`` + + :param name: A unique name for the new OMI. + :type name: ``str`` + + :param ex_block_device_mapping: One or more block device mappings. + :type ex_block_device_mapping: ``dict`` + + :param ex_no_reboot: If false, the VM shuts down before creating + the OMI and then reboots. + If true, the VM does not. + :type ex_no_reboot: ``bool`` + + :param ex_root_device_name: The name of the root device. + :type ex_root_device_name: ``str`` + + :param ex_source_region_name: The name of the source Region, + which must be the same + as the Region of your account. + :type ex_source_region_name: ``str`` + + :param ex_file_location: The pre-signed URL of the OMI manifest + file, or the full path to the OMI stored in + an OSU bucket. If you specify this parameter, a copy of the OMI is + created in your account. + :type ex_file_location: ``str`` + + :param ex_dry_run: If true, checks whether you have the required + permissions to perform the action. + :type ex_dry_run: ``bool`` + + :return: the created image + :rtype: ``dict`` + """ + data = { + "DryRun": ex_dry_run, + "NoReboot": ex_no_reboot, + } + if ex_block_device_mapping is not None: + data.update({"BlockDeviceMappings": ex_block_device_mapping}) + if name is not None: + data.update({"ImageName": name}) + if description is not None: + data.update({"Description": description}) + if node.id is not None: + data.update({"VmId": node.id}) + if ex_root_device_name is not None: + data.update({"RootDeviceName": ex_root_device_name}) + if ex_source_region_name is not None: + data.update({"SourceRegionName": ex_source_region_name}) + if ex_file_location is not None: + data.update({"FileLocation": ex_file_location}) + data = json.dumps(data) + action = "CreateImage" + response = self._call_api(action, data) + if response.status_code == 200: + return self._to_node_image(response.json()["Image"]) + return response.json() + + def ex_create_image_export_task( + self, + image: NodeImage = None, + osu_export_disk_image_format: str = None, + osu_export_api_key_id: str = None, + osu_export_api_secret_key: str = None, + osu_export_bucket: str = None, + osu_export_manifest_url: str = None, + osu_export_prefix: str = None, + dry_run: bool = False, + ): + """ + Exports an Outscale machine image (OMI) to an Object Storage Unit + (OSU) bucket. + This action enables you to copy an OMI between accounts in different + Regions. To copy an OMI in the same Region, + you can also use the CreateImage method. + The copy of the OMI belongs to you and is + independent from the source OMI. + + :param image: The ID of the OMI to export. (required) + :type image: ``NodeImage`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :param osu_export_disk_image_format: The format of the + export disk (qcow2 | vdi | vmdk). (required) + :type osu_export_disk_image_format: ``str`` + + :param osu_export_api_key_id: The API key of the OSU + account that enables you to access the bucket. + :type osu_export_api_key_id: ``str`` + + :param osu_export_api_secret_key: The secret key of the + OSU account that enables you to access the bucket. + :type osu_export_api_secret_key: ``str`` + + :param osu_export_bucket: The name of the OSU bucket + you want to export the object to. (required) + :type osu_export_bucket: ``str`` + + :param osu_export_manifest_url: The URL of the manifest file. + :type osu_export_manifest_url: ``str`` + + :param osu_export_prefix: The prefix for the key of + the OSU object. This key follows this format: + prefix + object_export_task_id + '.' + disk_image_format. + :type osu_export_prefix: ``str`` + + :return: the created image export task + :rtype: ``dict`` + """ + action = "CreateImageExportTask" + data = {"DryRun": dry_run, "OsuExport": {"OsuApiKey": {}}} + if image is not None: + data.update({"ImageId": image.id}) + if osu_export_disk_image_format is not None: + data["OsuExport"].update({"DiskImageFormat": osu_export_disk_image_format}) + if osu_export_bucket is not None: + data["OsuExport"].update({"OsuBucket": osu_export_bucket}) + if osu_export_manifest_url is not None: + data["OsuExport"].update({"OsuManifestUrl": osu_export_manifest_url}) + if osu_export_prefix is not None: + data["OsuExport"].update({"OsuPrefix": osu_export_prefix}) + if osu_export_api_key_id is not None: + data["OsuExport"]["OsuApiKey"].update({"ApiKeyId": osu_export_api_key_id}) + if osu_export_api_secret_key is not None: + data["OsuExport"]["OsuApiKey"].update({"SecretKey": osu_export_api_secret_key}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ImageExportTask"] + return response.json() + + def list_images( + self, + location=None, + account_aliases: List[str] = None, + account_ids: List[str] = None, + architectures: List[str] = None, + block_device_mapping_delete_on_vm_deletion: bool = False, + block_device_mapping_device_names: List[str] = None, + block_device_mapping_snapshot_ids: List[str] = None, + block_device_mapping_volume_sizes: List[int] = None, + block_device_mapping_volume_types: List[str] = None, + descriptions: List[str] = None, + file_locations: List[str] = None, + image_ids: List[str] = None, + image_names: List[str] = None, + permission_to_launch_account_ids: List[str] = None, + permission_to_lauch_global_permission: bool = False, + root_device_names: List[str] = None, + root_device_types: List[str] = None, + states: List[str] = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + tags: List[str] = None, + virtualization_types: List[str] = None, + dry_run: bool = False, + ): + """ + Lists one or more Outscale machine images (OMIs) you can use. + + :param account_aliases: The account aliases of the + owners of the OMIs. + :type account_aliases: ``list`` of ``str`` + + :param account_ids: The account IDs of the owners of the + OMIs. By default, all the OMIs for which you have launch + permissions are described. + :type account_ids: ``list`` of ``str`` + + :param architectures: The architectures of the + OMIs (i386 | x86_64). + :type architectures: ``list`` of ``str`` + + :param block_device_mapping_delete_on_vm_deletion: Indicates + whether the block device mapping is deleted when terminating the VM. + :type block_device_mapping_delete_on_vm_deletion: + ``bool`` + + :param block_device_mapping_device_names: The device names for + the volumes. + :type block_device_mapping_device_names: ``list`` of ``str`` + + :param block_device_mapping_snapshot_ids: The IDs of the + snapshots used to create the volumes. + :type block_device_mapping_snapshot_ids: ``list`` of ``str`` + + :param block_device_mapping_volume_sizes: The sizes of the + volumes, in gibibytes (GiB). + :type block_device_mapping_volume_sizes: ``list`` of ``int`` + + :param block_device_mapping_volume_types: The types of + volumes (standard | gp2 | io1). + :type block_device_mapping_volume_types: ``list`` of ``str`` + + :param descriptions: The descriptions of the OMIs, provided + when they were created. + :type descriptions: ``list`` of ``str`` + + :param file_locations: The locations where the OMI files are + stored on Object Storage Unit (OSU). + :type file_locations: ``list`` of ``str`` + + :param image_ids: The IDs of the OMIs. + :type image_ids: ``list`` of ``str`` + + :param image_names: The names of the OMIs, provided when + they were created. + :type image_names: ``list`` of ``str`` + + :param permission_to_launch_account_ids: The account IDs of the + users who have launch permissions for the OMIs. + :type permission_to_launch_account_ids: ``list`` of ``str`` + + :param permission_to_lauch_global_permission: If true, lists + all public OMIs. If false, lists all private OMIs. + :type permission_to_lauch_global_permission: ``list`` of ``str`` + + :param root_device_names: The device names of the root + devices (for example, /dev/sda1). + :type root_device_names: ``list`` of ``str`` + + :param root_device_types: The types of root device used by + the OMIs (always bsu). + :type root_device_types: ``list`` of ``str`` + + :param states: The states of the OMIs + (pending | available | failed). + :type states: ``list`` of ``str`` + + :param tag_keys: The keys of the tags associated with the OMIs. + :type tag_keys: ``list`` of ``str`` + + :param tag_values: The values of the tags associated + with the OMIs. + :type tag_values: ``list`` of ``str`` + + :param tags: The key/value combination of the tags associated + with the OMIs, in the following format:"Filters": + {"Tags":["TAGKEY=TAGVALUE"]}. + :type tags: ``list`` of ``str`` + + :param virtualization_types: The virtualization types + (always hvm). + :type virtualization_types: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a list of image + :rtype: ``list`` of ``dict`` + """ + action = "ReadImages" + data = {"DryRun": dry_run, "Filters": {}} + if account_aliases is not None: + data["Filters"].update({"AccountAliases": account_aliases}) + if account_ids is not None: + data["Filters"].update({"AccountIds": account_ids}) + if architectures is not None: + data["Filters"].update({"Architectures": architectures}) + if block_device_mapping_delete_on_vm_deletion is not None: + key = "BlockDeviceMappingDeleteOnVmDeletion" + data["Filters"].update({key: block_device_mapping_delete_on_vm_deletion}) + if block_device_mapping_device_names is not None: + key = "BlockDeviceMappingDeviceNames" + data["Filters"].update({key: block_device_mapping_device_names}) + if block_device_mapping_snapshot_ids is not None: + key = "BlockDeviceMappingSnapshotIds" + data["Filters"].update({key: block_device_mapping_snapshot_ids}) + if block_device_mapping_volume_sizes is not None: + key = "BlockDeviceMappingVolumeSizes" + data["Filters"].update({key: block_device_mapping_volume_sizes}) + if block_device_mapping_volume_types is not None: + key = "BlockDeviceMappingVolumeTypes" + data["Filters"].update({key: block_device_mapping_volume_types}) + if descriptions is not None: + data["Filters"].update({"Descriptions": descriptions}) + if file_locations is not None: + data["Filters"].update({"FileLocations": file_locations}) + if image_ids is not None: + data["Filters"].update({"ImageIds": image_ids}) + if image_names is not None: + data["Filters"].update({"ImageNames": image_names}) + if permission_to_launch_account_ids is not None: + key = "PermissionsToLaunchAccountIds" + data["Filters"].update({key: permission_to_launch_account_ids}) + if permission_to_lauch_global_permission is not None: + key = "PermissionsToLaunchGlobalPermission" + data["Filters"].update({key: permission_to_lauch_global_permission}) + if root_device_names is not None: + data["Filters"].update({"RootDeviceNames": root_device_names}) + if root_device_types is not None: + data["Filters"].update({"RootDeviceTypes": root_device_types}) + if states is not None: + data["Filters"].update({"States": states}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if image_names is not None: + data["Filters"].update({"TagValues": image_names}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + if virtualization_types is not None: + data["Filters"].update({"VirtualizationTypes": virtualization_types}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Images"] + return response.json() + + def ex_list_image_export_tasks( + self, + dry_run: bool = False, + task_ids: List[str] = None, + ): + """ + Lists one or more image export tasks. + + :param task_ids: The IDs of the export tasks. + :type task_ids: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: image export tasks + :rtype: ``list`` of ``dict`` + """ + action = "ReadImageExportTasks" + data = {"DryRun": dry_run, "Filters": {}} + if task_ids is not None: + data["Filters"].update({"TaskIds": task_ids}) + response = self._call_api(action, json.dumps(data)) + print(response.json()) + if response.status_code == 200: + return response.json()["ImageExportTasks"] + return response.json() + + def get_image(self, image_id: str): + """ + Get a specific image. + + :param image_id: the ID of the image you want to select (required) + :type image_id: ``str`` + + :return: the selected image + :rtype: ``dict`` + """ + action = "ReadImages" + data = '{"Filters": {"ImageIds": ["' + image_id + '"]}}' + response = self._call_api(action, data) + if response.status_code == 200: + return self._to_node_image(response.json()["Images"][0]) + return response.json() + + def delete_image(self, node_image: NodeImage): + """ + Delete an image. + + :param node_image: the ID of the OMI you want to delete (required) + :type node_image: ``str`` + + :return: request + :rtype: ``bool`` + """ + action = "DeleteImage" + data = '{"ImageId": "' + node_image.id + '"}' + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def ex_update_image( + self, + dry_run: bool = False, + image: NodeImage = None, + perm_to_launch_addition_account_ids: List[str] = None, + perm_to_launch_addition_global_permission: bool = None, + perm_to_launch_removals_account_ids: List[str] = None, + perm_to_launch_removals_global_permission: bool = None, + ): + """ + Modifies the specified attribute of an Outscale machine image (OMI). + You can specify only one attribute at a time. You can modify + the permissions to access the OMI by adding or removing account + IDs or groups. You can share an OMI with a user that is in the + same Region. The user can create a copy of the OMI you shared, + obtaining all the rights for the copy of the OMI. + For more information, see CreateImage. + + :param image: The ID of the OMI to export. (required) + :type image: ``NodeImage`` + + :param perm_to_launch_addition_account_ids: The account + ID of one or more users who have permissions for the resource. + :type perm_to_launch_addition_account_ids: + ``list`` of ``dict`` + + :param perm_to_launch_addition_global_permission: + If true, the resource is public. If false, the resource is private. + :type perm_to_launch_addition_global_permission: + ``boolean`` + + :param perm_to_launch_removals_account_ids: The account + ID of one or more users who have permissions for the resource. + :type perm_to_launch_removals_account_ids: ``list`` of ``dict`` + + :param perm_to_launch_removals_global_permission: If true, + the resource is public. If false, the resource is private. + :type perm_to_launch_removals_global_permission: ``boolean`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: the new image + :rtype: ``dict`` + """ + action = "UpdateImage" + data = { + "DryRun": dry_run, + "PermissionsToLaunch": {"Additions": {}, "Removals": {}}, + } + if image is not None: + data.update({"ImageId": image.id}) + if perm_to_launch_addition_account_ids is not None: + data["PermissionsToLaunch"]["Additions"].update( + {"AccountIds": perm_to_launch_addition_account_ids} + ) + if perm_to_launch_addition_global_permission is not None: + data["PermissionsToLaunch"]["Additions"].update( + {"GlobalPermission": perm_to_launch_addition_global_permission} + ) + if perm_to_launch_removals_account_ids is not None: + data["PermissionsToLaunch"]["Removals"].update( + {"AccountIds": perm_to_launch_removals_account_ids} + ) + if perm_to_launch_removals_global_permission is not None: + data["PermissionsToLaunch"]["Removals"].update( + {"GlobalPermission": perm_to_launch_removals_global_permission} + ) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Image"] + return response.json() + + def create_key_pair(self, name: str, ex_dry_run: bool = False, ex_public_key: str = None): + """ + Create a new key pair. + + :param name: A unique name for the keypair, with a maximum + length of 255 ASCII printable characters. + :type name: ``str`` + + :param ex_dry_run: If true, checks whether you have the required + permissions to perform the action. + :type ex_dry_run: ``bool`` + + :param ex_public_key: The public key. It must be base64-encoded. + :type ex_public_key: ``str`` + + :return: the created key pair + :rtype: ``dict`` + """ + data = { + "KeypairName": name, + "DryRun": ex_dry_run, + } + if ex_public_key is not None: + data.update({"PublicKey": ex_public_key}) + data = json.dumps(data) + action = "CreateKeypair" + response = self._call_api(action, data) + if response.status_code == 200: + return self._to_key_pair(response.json()["Keypair"]) + return response.json() + + def list_key_pairs(self, ex_data: str = "{}"): + """ + List all key pairs. + + :return: key pairs + :rtype: ``dict`` + """ + action = "ReadKeypairs" + response = self._call_api(action, ex_data) + if response.status_code == 200: + return self._to_key_pairs(response.json()["Keypairs"]) + return response.json() + + def get_key_pair(self, name: str): + """ + Get a specific key pair. + + :param name: the name of the key pair + you want to select (required) + :type name: ``str`` + + :return: the selected key pair + :rtype: ``dict`` + """ + action = "ReadKeypairs" + data = '{"Filters": {"KeypairNames" : ["' + name + '"]}}' + response = self._call_api(action, data) + if response.status_code == 200: + return self._to_key_pair(response.json()["Keypairs"][0]) + return response.json() + + def delete_key_pair(self, key_pair: KeyPair): + """ + Delete a key pair. + + :param key_pair: the name of the keypair + you want to delete (required) + :type key_pair: ``KeyPair`` + + :return: bool + :rtype: ``bool`` + """ + action = "DeleteKeypair" + data = '{"KeypairName": "' + key_pair.name + '"}' + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def create_volume_snapshot( + self, + volume, + name=None, + ex_description: str = None, + ex_dry_run: bool = False, + ex_file_location: str = None, + ex_snapshot_size: int = None, + ex_source_region_name: str = None, + ex_source_snapshot: VolumeSnapshot = None, + ): + """ + Create a new volume snapshot. + + :param ex_description: a description for the new OMI + :type ex_description: ``str`` + + :param ex_snapshot_size: The size of the snapshot created in your + account, in bytes. This size must be + exactly the same as the source snapshot one. + :type ex_snapshot_size: ``integer`` + + :param ex_source_snapshot: The ID of the snapshot you want to + copy. + :type ex_source_snapshot: ``str`` + + :param volume: The ID of the volume you want to create a + snapshot of. + :type volume: ``str`` + + :param ex_source_region_name: The name of the source Region, + which must be the same as the Region of your account. + :type ex_source_region_name: ``str`` + + :param ex_file_location: The pre-signed URL of the OMI manifest + file, or the full path to the OMI stored in + an OSU bucket. If you specify this parameter, a copy of the OMI is + created in your account. + :type ex_file_location: ``str`` + + :param ex_dry_run: If true, checks whether you have the required + permissions to perform the action. + :type ex_dry_run: ``bool`` + + :return: the created snapshot + :rtype: ``dict`` + """ + data = { + "DryRun": ex_dry_run, + } + if ex_description is not None: + data.update({"Description": ex_description}) + if ex_file_location is not None: + data.update({"FileLocation": ex_file_location}) + if ex_snapshot_size is not None: + data.update({"SnapshotSize": ex_snapshot_size}) + if ex_source_region_name is not None: + data.update({"SourceRegionName": ex_source_region_name}) + if ex_source_snapshot is not None: + data.update({"SourceSnapshotId": ex_source_snapshot.id}) + if volume is not None: + data.update({"VolumeId": volume.id}) + data = json.dumps(data) + action = "CreateSnapshot" + response = self._call_api(action, data) + if response.status_code == 200: + return self._to_snapshot(response.json()["Volume"]) + return response.json() + + def list_snapshots(self, ex_data: str = "{}"): + """ + List all volume snapshots. + + :return: snapshots + :rtype: ``dict`` + """ + action = "ReadSnapshots" + response = self._call_api(action, ex_data) + if response.status_code == 200: + return self._to_snapshots(response.json()["Snapshots"]) + return response.json() + + def list_volume_snapshots(self, volume): + """ + List all snapshot for a given volume. + + :param volume: the volume from which to look for snapshots + :type volume: StorageVolume + + :rtype: ``list`` of :class ``VolumeSnapshot`` + """ + action = "ReadSnapshots" + data = {"Filters": {"VolumeIds": [volume.id]}} + response = self._call_api(action, data) + if response.status_code == 200: + return self._to_snapshots(response.json()["Snapshots"]) + return response.json() + + def destroy_volume_snapshot(self, snapshot: VolumeSnapshot): + """ + Delete a volume snapshot. + + :param snapshot: the ID of the snapshot + you want to delete (required) + :type snapshot: ``VolumeSnapshot`` + + :return: request + :rtype: ``bool`` + """ + action = "DeleteSnapshot" + data = '{"SnapshotId": "' + snapshot.id + '"}' + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def ex_create_snapshot_export_task( + self, + osu_export_disk_image_format: str = None, + osu_export_api_key_id: str = None, + osu_export_api_secret_key: str = None, + osu_export_bucket: str = None, + osu_export_manifest_url: str = None, + osu_export_prefix: str = None, + snapshot: VolumeSnapshot = None, + dry_run: bool = False, + ): + """ + Exports a snapshot to an Object Storage Unit (OSU) bucket. + This action enables you to create a backup of your snapshot or to copy + it to another account. You, or other users you send a pre-signed URL + to, can then download this snapshot from the OSU bucket using + the CreateSnapshot method. + This procedure enables you to copy a snapshot between accounts within + the same Region or in different Regions. To copy a snapshot within + the same Region, you can also use the CreateSnapshot direct method. + The copy of the source snapshot is independent and belongs to you. + + :param osu_export_disk_image_format: The format of the export + disk (qcow2 | vdi | vmdk). (required) + :type osu_export_disk_image_format: ``str`` + + :param osu_export_api_key_id: The API key of the OSU account + that enables you to access the bucket. + :type osu_export_api_key_id : ``str`` + + :param osu_export_api_secret_key: The secret key of the OSU + account that enables you to access the bucket. + :type osu_export_api_secret_key : ``str`` + + :param osu_export_bucket: The name of the OSU bucket you want + to export the object to. (required) + :type osu_export_bucket : ``str`` + + :param osu_export_manifest_url: The URL of the manifest file. + :type osu_export_manifest_url : ``str`` + + :param osu_export_prefix: The prefix for the key of the OSU + object. This key follows this format: prefix + + object_export_task_id + '.' + disk_image_format. + :type osu_export_prefix : ``str`` + + :param snapshot: The ID of the snapshot to export. (required) + :type snapshot : ``VolumeSnapshot`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run : ``bool`` + + :return: the created snapshot export task + :rtype: ``dict`` + """ + action = "CreateSnapshotExportTask" + data = {"DryRun": dry_run, "OsuExport": {"OsuApiKey": {}}} + if snapshot is not None: + data.update({"SnapshotId": snapshot.id}) + if osu_export_disk_image_format is not None: + data["OsuExport"].update({"DiskImageFormat": osu_export_disk_image_format}) + if osu_export_bucket is not None: + data["OsuExport"].update({"OsuBucket": osu_export_bucket}) + if osu_export_manifest_url is not None: + data["OsuExport"].update({"OsuManifestUrl": osu_export_manifest_url}) + if osu_export_prefix is not None: + data["OsuExport"].update({"OsuPrefix": osu_export_prefix}) + if osu_export_api_key_id is not None: + data["OsuExport"]["OsuApiKey"].update({"ApiKeyId": osu_export_api_key_id}) + if osu_export_api_secret_key is not None: + data["OsuExport"]["OsuApiKey"].update({"SecretKey": osu_export_api_secret_key}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["SnapshotExportTask"] + return response.json() + + def ex_list_snapshot_export_tasks( + self, + dry_run: bool = False, + task_ids: List[str] = None, + ): + """ + Lists one or more image export tasks. + + :param task_ids: The IDs of the export tasks. + :type task_ids: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: snapshot export tasks + :rtype: ``list`` of ``dict`` + """ + action = "ReadSnapshotExportTasks" + data = {"DryRun": dry_run, "Filters": {}} + if task_ids is not None: + data["Filters"].update({"TaskIds": task_ids}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["SnapshotExportTasks"] + return response.json() + + def ex_update_snapshot( + self, + perm_to_create_volume_addition_account_id: List[str] = None, + perm_to_create_volume_addition_global_perm: bool = None, + perm_to_create_volume_removals_account_id: List[str] = None, + perm_to_create_volume_removals_global_perm: bool = None, + snapshot: VolumeSnapshot = None, + dry_run: bool = False, + ): + """ + Modifies the permissions for a specified snapshot. + You can add or remove permissions for specified account IDs or groups. + You can share a snapshot with a user that is in the same Region. + The user can create a copy of the snapshot you shared, obtaining all + the rights for the copy of the snapshot. + + :param perm_to_create_volume_addition_account_id: + The account ID of one or more users who have permissions + for the resource. + :type perm_to_create_volume_addition_account_id: + ``list`` of ``str`` + + :param perm_to_create_volume_addition_global_perm: If true, + the resource is public. If false, the resource is private. + :type perm_to_create_volume_addition_global_perm: ``bool`` + + :param perm_to_create_volume_removals_account_id: The account ID + of one or more users who have permissions for the resource. + :type perm_to_create_volume_removals_account_id: + ``list`` of ``str`` + + :param perm_to_create_volume_removals_global_perm: If true, + the resource is public. If false, the resource is private. + :type perm_to_create_volume_removals_global_perm: ``bool`` + + :param snapshot: The ID of the snapshot. (required) + :type snapshot: ``VolumeSnapshot`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: snapshot export tasks + :rtype: ``list`` of ``dict`` + """ + action = "UpdateSnapshot" + data = { + "DryRun: ": dry_run, + "PermissionsToCreateVolume": {"Additions": {}, "Removals": {}}, + } + if snapshot is not None: + data.update({"ImageId": snapshot.id}) + if perm_to_create_volume_addition_account_id is not None: + data["PermissionsToCreateVolume"]["Additions"].update( + {"AccountIds": perm_to_create_volume_addition_account_id} + ) + if perm_to_create_volume_addition_global_perm is not None: + data["PermissionsToCreateVolume"]["Additions"].update( + {"GlobalPermission": perm_to_create_volume_addition_global_perm} + ) + if perm_to_create_volume_removals_account_id is not None: + data["PermissionsToCreateVolume"]["Removals"].update( + {"AccountIds": perm_to_create_volume_removals_account_id} + ) + if perm_to_create_volume_removals_global_perm is not None: + data["PermissionsToCreateVolume"]["Removals"].update( + {"GlobalPermission": perm_to_create_volume_removals_global_perm} + ) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Snapshot"] + return response.json() + + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + ex_subregion_name: str = None, + ex_dry_run: bool = False, + ex_iops: int = None, + ex_volume_type: str = None, + ): + """ + Create a new volume. + + :param snapshot: the ID of the snapshot from which + you want to create the volume (required) + :type snapshot: ``str`` + + :param ex_dry_run: If true, checks whether you have the required + permissions to perform the action. + :type ex_dry_run: ``bool`` + + :param size: the size of the volume, in gibibytes (GiB), + the maximum allowed size for a volume is 14,901 GiB + :type size: ``int`` + + :param location: The location whose ID identifies the Subregion + in which to create the volume. Required when + ``ex_subregion_name`` is not provided. + :type location: :class:`NodeLocation` + + :param ex_subregion_name: The Subregion in which you want to + create the volume. Takes precedence over ``location``. + :type ex_subregion_name: ``str`` + + :param ex_volume_type: the type of volume you want to create (io1 + | gp2 | standard) + :type ex_volume_type: ``str`` + + :param ex_iops: The number of I/O operations per second (IOPS). + This parameter must be specified only if + you create an io1 volume. The maximum number of IOPS allowed for io1 + volumes is 13000. + :type ex_iops: ``integer`` + + :return: the created volume + :rtype: ``dict`` + """ + if ex_subregion_name is None: + if location is None: + raise ValueError("location or ex_subregion_name is required.") + + ex_subregion_name = location.id + + data = {"DryRun": ex_dry_run, "SubregionName": ex_subregion_name} + if ex_iops is not None: + data.update({"Iops": ex_iops}) + if size is not None: + data.update({"Size": size}) + if snapshot is not None: + data.update({"SnapshotId": snapshot.id}) + if ex_volume_type is not None: + data.update({"VolumeType": ex_volume_type}) + data = json.dumps(data) + action = "CreateVolume" + response = self._call_api(action, data) + if response.status_code == 200: + return self._to_volume(response.json()["Volume"]) + return response.json() + + def list_volumes(self, ex_data: str = "{}"): + """ + List all volumes. + :rtype: ``list`` of :class:`.StorageVolume` + """ + action = "ReadVolumes" + response = self._call_api(action, ex_data) + if response.status_code == 200: + return self._to_volumes(response.json()["Volumes"]) + return response.json() + + def destroy_volume(self, volume: StorageVolume): + """ + Delete a volume. + + :param volume: the ID of the volume + you want to delete (required) + :type volume: ``StorageVolume`` + + :return: request + :rtype: ``bool`` + """ + action = "DeleteVolume" + data = '{"VolumeId": "' + volume.id + '"}' + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def attach_volume(self, node: Node, volume: StorageVolume, device: str = None): + """ + Attach a volume to a node. + + :param node: the ID of the VM you want + to attach the volume to (required) + :type node: ``Node`` + + :param volume: the ID of the volume + you want to attach (required) + :type volume: ``StorageVolume`` + + :param device: the name of the device (required) + :type device: ``str`` + + :return: the attached volume + :rtype: ``dict`` + """ + action = "LinkVolume" + data = json.dumps({"VmId": node.id, "VolumeId": volume.id, "DeviceName": device}) + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def detach_volume( + self, + volume: StorageVolume, + ex_dry_run: bool = False, + ex_force_unlink: bool = False, + ): + """ + Detach a volume from a node. + + :param volume: the ID of the volume you want to detach + (required) + :type volume: ``str`` + + :param ex_force_unlink: Forces the detachment of the volume in + case of previous failure. + Important: This action may damage your data or file systems. + :type ex_force_unlink: ``bool`` + + :param ex_dry_run: If true, checks whether you have the required + permissions to perform the action. + :type ex_dry_run: ``bool`` + + :return: the attached volume + :rtype: ``dict`` + """ + action = "UnlinkVolume" + data = {"DryRun": ex_dry_run, "VolumeId": volume.id} + if ex_force_unlink is not None: + data.update({"ForceUnlink": ex_force_unlink}) + data = json.dumps(data) + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def ex_check_account( + self, + login: str, + password: str, + dry_run: bool = False, + ): + """ + Validates the authenticity of the account. + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :param login: the login of the account + :type login: ``str`` + + :param password: the password of the account + :type password: ``str`` + + :param dry_run: the password of the account + :type dry_run: ``bool`` + + :return: True if the action successful + :rtype: ``bool`` + """ + action = "CheckAuthentication" + data = {"DryRun": dry_run, "Login": login, "Password": password} + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_read_account(self, dry_run: bool = False): + """ + Gets information about the account that sent the request. + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: the account information + :rtype: ``dict`` + """ + action = "ReadAccounts" + data = json.dumps({"DryRun": dry_run}) + response = self._call_api(action, data) + if response.status_code == 200: + return response.json()["Accounts"][0] + return response.json() + + def ex_list_consumption_account( + self, from_date: str = None, to_date: str = None, dry_run: bool = False + ): + """ + Displays information about the consumption of your account for + each billable resource within the specified time period. + + + :param from_date: The beginning of the time period, in + ISO 8601 date-time format (for example, 2017-06-14 or + 2017-06-14T00:00:00Z). (required) + :type from_date: ``str`` + + :param to_date: The end of the time period, in + ISO 8601 date-time format (for example, 2017-06-30 or + 2017-06-30T00:00:00Z). (required) + :type to_date: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a list of Consumption Entries + :rtype: ``list`` of ``dict`` + """ + action = "ReadConsumptionAccount" + data = {"DryRun": dry_run} + if from_date is not None: + data.update({"FromDate": from_date}) + if to_date is not None: + data.update({"ToDate": to_date}) + response = self._call_api(action, json.dumps(data)) + print(response.status_code) + if response.status_code == 200: + return response.json()["ConsumptionEntries"] + return response.json() + + def ex_create_account( + self, + city: str = None, + company_name: str = None, + country: str = None, + customer_id: str = None, + email: str = None, + first_name: str = None, + last_name: str = None, + zip_code: str = None, + job_title: str = None, + mobile_number: str = None, + phone_number: str = None, + state_province: str = None, + vat_number: str = None, + dry_run: bool = False, + ): + """ + Creates a new 3DS OUTSCALE account. + + You need 3DS OUTSCALE credentials and the appropriate quotas to + create a new account via API. To get quotas, you can send an email + to sales@outscale.com. + If you want to pass a numeral value as a string instead of an + integer, you must wrap your string in additional quotes + (for example, '"92000"'). + + :param city: The city of the account owner. + :type city: ``str`` + + :param company_name: The name of the company for the account. + permissions to perform the action. + :type company_name: ``str`` + + :param country: The country of the account owner. + :type country: ``str`` + + :param customer_id: The ID of the customer. It must be 8 digits. + :type customer_id: ``str`` + + :param email: The email address for the account. + :type email: ``str`` + + :param first_name: The first name of the account owner. + :type first_name: ``str`` + + :param last_name: The last name of the account owner. + :type last_name: ``str`` + + :param zip_code: The ZIP code of the city. + :type zip_code: ``str`` + + :param job_title: The job title of the account owner. + :type job_title: ``str`` + + :param mobile_number: The mobile phone number of the account + owner. + :type mobile_number: ``str`` + + :param phone_number: The landline phone number of the account + owner. + :type phone_number: ``str`` + + :param state_province: The state/province of the account. + :type state_province: ``str`` + + :param vat_number: The value added tax (VAT) number for + the account. + :type vat_number: ``str`` + + :param dry_run: the password of the account + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "CreateAccount" + data = {"DryRun": dry_run} + if city is not None: + data.update({"City": city}) + if company_name is not None: + data.update({"CompanyName": company_name}) + if country is not None: + data.update({"Country": country}) + if customer_id is not None: + data.update({"CustomerId": customer_id}) + if email is not None: + data.update({"Email": email}) + if first_name is not None: + data.update({"FirstName": first_name}) + if last_name is not None: + data.update({"LastName": last_name}) + if zip_code is not None: + data.update({"ZipCode": zip_code}) + if job_title is not None: + data.update({"JobTitle": job_title}) + if mobile_number is not None: + data.update({"MobileNumber": mobile_number}) + if phone_number is not None: + data.update({"PhoneNumber": phone_number}) + if state_province is not None: + data.update({"StateProvince": state_province}) + if vat_number is not None: + data.update({"VatNumber": vat_number}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_update_account( + self, + city: str = None, + company_name: str = None, + country: str = None, + email: str = None, + first_name: str = None, + last_name: str = None, + zip_code: str = None, + job_title: str = None, + mobile_number: str = None, + phone_number: str = None, + state_province: str = None, + vat_number: str = None, + dry_run: bool = False, + ): + """ + Updates the account information for the account that sends the request. + + :param city: The city of the account owner. + :type city: ``str`` + + :param company_name: The name of the company for the account. + permissions to perform the action. + :type company_name: ``str`` + + :param country: The country of the account owner. + :type country: ``str`` + + :param email: The email address for the account. + :type email: ``str`` + + :param first_name: The first name of the account owner. + :type first_name: ``str`` + + :param last_name: The last name of the account owner. + :type last_name: ``str`` + + :param zip_code: The ZIP code of the city. + :type zip_code: ``str`` + + :param job_title: The job title of the account owner. + :type job_title: ``str`` + + :param mobile_number: The mobile phone number of the account + owner. + :type mobile_number: ``str`` + + :param phone_number: The landline phone number of the account + owner. + :type phone_number: ``str`` + + :param state_province: The state/province of the account. + :type state_province: ``str`` + + :param vat_number: The value added tax (VAT) number for + the account. + :type vat_number: ``str`` + + :param dry_run: the password of the account + :type dry_run: ``bool`` + + :return: The new account information + :rtype: ``dict`` + """ + action = "UpdateAccount" + data = {"DryRun": dry_run} + if city is not None: + data.update({"City": city}) + if company_name is not None: + data.update({"CompanyName": company_name}) + if country is not None: + data.update({"Country": country}) + if email is not None: + data.update({"Email": email}) + if first_name is not None: + data.update({"FirstName": first_name}) + if last_name is not None: + data.update({"LastName": last_name}) + if zip_code is not None: + data.update({"ZipCode": zip_code}) + if job_title is not None: + data.update({"JobTitle": job_title}) + if mobile_number is not None: + data.update({"MobileNumber": mobile_number}) + if phone_number is not None: + data.update({"PhoneNumber": phone_number}) + if state_province is not None: + data.update({"StateProvince": state_province}) + if vat_number is not None: + data.update({"VatNumber": vat_number}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Account"] + return response.json() + + def ex_reset_account_password( + self, + password: str = "", + token: str = "", + dry_run: bool = False, + ): + """ + Sends an email to the email address provided for the account with a + token to reset your password. + + :param password: The new password for the account. + :type password: ``str`` + + :param token: The token you received at the email address + provided for the account. + :type token: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "ResetAccountPassword" + data = json.dumps({"DryRun": dry_run, "Password": password, "Token": token}) + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def ex_send_reset_password_email( + self, + email: str, + dry_run: bool = False, + ): + """ + Replaces the account password with the new one you provide. + You must also provide the token you received by email when asking for + a password reset using the SendResetPasswordEmail method. + + :param email: The email address provided for the account. + :type email: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "SendResetPasswordEmail" + data = json.dumps({"DryRun": dry_run, "Email": email}) + response = self._call_api(action, data) + if response.status_code == 200: + return True + return response.json() + + def ex_create_tag( + self, + resource_ids: list, + tag_key: str = None, + tag_value: str = None, + dry_run: bool = False, + ): + """ + Adds one tag to the specified resources. + If a tag with the same key already exists for the resource, + the tag value is replaced. + You can tag the following resources using their IDs: + + :param resource_ids: One or more resource IDs. (required) + :type resource_ids: ``list`` + + :param tag_key: The key of the tag, with a minimum of 1 character. + (required) + :type tag_key: ``str`` + + :param tag_value: The value of the tag, between + 0 and 255 characters. (required) + :type tag_value: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. (required) + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "CreateTags" + data = {"DryRun": dry_run, "ResourceIds": resource_ids, "Tags": []} + if tag_key is not None and tag_value is not None: + data["Tags"].append({"Key": tag_key, "Value": tag_value}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_create_tags( + self, + resource_ids: list, + tags: list = None, + dry_run: bool = False, + ): + """ + Adds one or more tags to the specified resources. + If a tag with the same key already exists for the resource, + the tag value is replaced. + You can tag the following resources using their IDs: + + :param resource_ids: One or more resource IDs. (required) + :type resource_ids: ``list`` + + :param tags: The key of the tag, with a minimum of 1 character. + (required) + :type tags: ``list`` of ``dict`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "CreateTags" + data = {"DryRun": dry_run, "ResourceIds": resource_ids, "Tags": tags} + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_delete_tags( + self, + resource_ids: list, + tags: list = None, + dry_run: bool = False, + ): + """ + Deletes one or more tags from the specified resources. + + :param resource_ids: One or more resource IDs. (required) + :type resource_ids: ``list`` + + :param tags: The key of the tag, with a minimum of 1 character. + (required) + :type tags: ``list`` of ``dict`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteTags" + data = {"DryRun": dry_run, "ResourceIds": resource_ids, "Tags": tags} + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_tags( + self, + resource_ids: list = None, + resource_types: list = None, + keys: list = None, + values: list = None, + dry_run: bool = False, + ): + """ + Lists one or more tags for your resources. + + :param resource_ids: One or more resource IDs. + :type resource_ids: ``list`` + + :param resource_types: One or more resource IDs. + :type resource_types: ``list`` + + :param keys: One or more resource IDs. + :type keys: ``list`` + + :param values: One or more resource IDs. + :type values: ``list`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: list of tags + :rtype: ``list`` of ``dict`` + """ + action = "ReadTags" + data = {"Filters": {}, "DryRun": dry_run} + if resource_ids is not None: + data["Filters"].update({"ResourceIds": resource_ids}) + if resource_types is not None: + data["Filters"].update({"ResourceTypes": resource_types}) + if keys is not None: + data["Filters"].update({"Keys": keys}) + if values is not None: + data["Filters"].update({"Values": values}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Tags"] + return response.json() + + def ex_create_access_key( + self, + expiration_date: datetime = None, + dry_run: bool = False, + ): + """ + Creates a new secret access key and the corresponding access key ID + for a specified user. The created key is automatically set to ACTIVE. + + :param expiration_date: The date and time at which you want the + access key to expire, in ISO 8601 format (for example, + 2017-06-14 or 2017-06-14T00:00:00Z). If not specified, the access key + has no expiration date. + :type expiration_date: ``datetime`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: access key if action is successful + :rtype: ``dict`` + """ + action = "CreateAccessKey" + data = {"DryRun": dry_run} + if expiration_date is not None: + data.update({"ExpirationDate": expiration_date}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["AccessKey"] + return response.json() + + def ex_delete_access_key( + self, + access_key_id: str, + dry_run: bool = False, + ): + """ + Deletes the specified access key associated with the account + that sends the request. + + :param access_key_id: The ID of the access key you want to + delete. (required) + :type access_key_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteAccessKey" + data = {"DryRun": dry_run} + if access_key_id is not None: + data.update({"AccessKeyId": access_key_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_access_keys( + self, + access_key_ids: list = None, + states: list = None, + dry_run: bool = False, + ): + """ + Returns information about the access key IDs of a specified user. + If the user does not have any access key ID, this action returns + an empty list. + + :param access_key_ids: The IDs of the access keys. + :type access_key_ids: ``list`` of ``str`` + + :param states: The states of the access keys (ACTIVE | INACTIVE). + :type states: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: ``list`` of Access Keys + :rtype: ``list`` of ``dict`` + """ + action = "ReadAccessKeys" + data = {"DryRun": dry_run, "Filters": {}} + if access_key_ids is not None: + data["Filters"].update({"AccessKeyIds": access_key_ids}) + if states is not None: + data["Filters"].update({"States": states}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["AccessKeys"] + return response.json() + + def ex_list_secret_access_key( + self, + access_key_id: str = None, + dry_run: bool = False, + ): + """ + Gets information about the secret access key associated with + the account that sends the request. + + :param access_key_id: The ID of the access key. (required) + :type access_key_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: Access Key + :rtype: ``dict`` + """ + action = "ReadSecretAccessKey" + data = {"DryRun": dry_run} + if access_key_id is not None: + data.update({"AccessKeyId": access_key_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["AccessKey"] + return response.json() + + def ex_update_access_key( + self, + access_key_id: str = None, + state: str = None, + dry_run: bool = False, + ): + """ + Modifies the status of the specified access key associated with + the account that sends the request. + When set to ACTIVE, the access key is enabled and can be used to + send requests. When set to INACTIVE, the access key is disabled. + + :param access_key_id: The ID of the access key. (required) + :type access_key_id: ``str`` + + :param state: The new state of the access key + (ACTIVE | INACTIVE). (required) + :type state: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: Access Key + :rtype: ``dict`` + """ + action = "UpdateAccessKey" + data = {"DryRun": dry_run} + if access_key_id is not None: + data.update({"AccessKeyId": access_key_id}) + if state is not None: + data.update({"State": state}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["AccessKey"] + return response.json() + + def ex_create_client_gateway( + self, + bgp_asn: int = None, + connection_type: str = None, + public_ip: str = None, + dry_run: bool = False, + ): + """ + Provides information about your client gateway. + This action registers information to identify the client gateway that + you deployed in your network. + To open a tunnel to the client gateway, you must provide + the communication protocol type, the valid fixed public IP address + of the gateway, and an Autonomous System Number (ASN). + + :param bgp_asn: An Autonomous System Number (ASN) used by + the Border Gateway Protocol (BGP) to find the path to your + client gateway through the Internet. (required) + :type bgp_asn: ``int`` (required) + + :param connection_type: The communication protocol used to + establish tunnel with your client gateway (only ipsec.1 is supported). + (required) + :type connection_type: ``str`` + + :param public_ip: The public fixed IPv4 address of your + client gateway. (required) + :type public_ip: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: Client Gateway as ``dict`` + :rtype: ``dict`` + """ + action = "CreateClientGateway" + data = {"DryRun": dry_run} + if bgp_asn is not None: + data.update({"BgpAsn": bgp_asn}) + if connection_type is not None: + data.update({"ConnectionType": connection_type}) + if public_ip is not None: + data.update({"PublicIp": public_ip}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ClientGateway"] + return response.json() + + def ex_list_client_gateways( + self, + client_gateway_ids: list = None, + bgp_asns: list = None, + connection_types: list = None, + public_ips: list = None, + states: list = None, + tag_keys: list = None, + tag_values: list = None, + tags: list = None, + dry_run: bool = False, + ): + """ + Deletes a client gateway. + You must delete the VPN connection before deleting the client gateway. + + :param client_gateway_ids: The IDs of the client gateways. + you want to delete. (required) + :type client_gateway_ids: ``list`` of ``str` + + :param bgp_asns: The Border Gateway Protocol (BGP) Autonomous + System Numbers (ASNs) of the connections. + :type bgp_asns: ``list`` of ``int`` + + :param connection_types: The types of communication tunnels + used by the client gateways (only ipsec.1 is supported). + (required) + :type connection_types: ``list```of ``str`` + + :param public_ips: The public IPv4 addresses of the + client gateways. + :type public_ips: ``list`` of ``str`` + + :param states: The states of the client gateways + (pending | available | deleting | deleted). + :type states: ``list`` of ``str`` + + :param tag_keys: The keys of the tags associated with + the client gateways. + :type tag_keys: ``list`` of ``str`` + + :param tag_values: The values of the tags associated with the + client gateways. + :type tag_values: ``list`` of ``str`` + + :param tags: the key/value combination of the tags + associated with the client gateways, in the following + format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. + :type tags: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: Returns ``list`` of Client Gateway + :rtype: ``list`` of ``dict`` + """ + action = "ReadClientGateways" + data = {"DryRun": dry_run, "Filters": {}} + if client_gateway_ids is not None: + data["Filters"].update({"ClientGatewayIds": client_gateway_ids}) + if bgp_asns is not None: + data["Filters"].update({"BgpAsns": bgp_asns}) + if connection_types is not None: + data["Filters"].update({"ConnectionTypes": connection_types}) + if public_ips is not None: + data["Filters"].update({"PublicIps": public_ips}) + if client_gateway_ids is not None: + data["Filters"].update({"ClientGatewayIds": client_gateway_ids}) + if states is not None: + data["Filters"].update({"States": states}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if tag_values is not None: + data["Filters"].update({"TagValues": tag_values}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ClientGateways"] + return response.json() + + def ex_delete_client_gateway( + self, + client_gateway_id: str = None, + dry_run: bool = False, + ): + """ + Deletes a client gateway. + You must delete the VPN connection before deleting the client gateway. + + :param client_gateway_id: The ID of the client gateway + you want to delete. (required) + :type client_gateway_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: Returns True if action is successful + :rtype: ``bool`` + """ + action = "DeleteClientGateway" + data = {"DryRun": dry_run} + if client_gateway_id is not None: + data.update({"ClientGatewayId": client_gateway_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_create_dhcp_options( + self, + domaine_name: str = None, + domaine_name_servers: list = None, + ntp_servers: list = None, + dry_run: bool = False, + ): + """ + Creates a new set of DHCP options, that you can then associate + with a Net using the UpdateNet method. + + :param domaine_name: Specify a domain name + (for example, MyCompany.com). You can specify only one domain name. + :type domaine_name: ``str`` + + :param domaine_name_servers: The IP addresses of domain name + servers. If no IP addresses are specified, the OutscaleProvidedDNS + value is set by default. + :type domaine_name_servers: ``list`` of ``str`` + + :param ntp_servers: The IP addresses of the Network Time + Protocol (NTP) servers. + :type ntp_servers: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The created Dhcp Options + :rtype: ``dict`` + """ + action = "CreateDhcpOptions" + data = {"DryRun": dry_run} + if domaine_name is not None: + data.update({"DomaineName": domaine_name}) + if domaine_name_servers is not None: + data.update({"DomaineNameServers": domaine_name_servers}) + if ntp_servers is not None: + data.update({"NtpServers": ntp_servers}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["DhcpOptionsSet"] + return response.json() + + def ex_delete_dhcp_options( + self, + dhcp_options_set_id: str = None, + dry_run: bool = False, + ): + """ + Deletes a specified DHCP options set. + Before deleting a DHCP options set, you must disassociate it from the + Nets you associated it with. To do so, you need to associate with each + Net a new set of DHCP options, or the default one if you do not want + to associate any DHCP options with the Net. + + :param dhcp_options_set_id: The ID of the DHCP options set + you want to delete. (required) + :type dhcp_options_set_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteDhcpOptions" + data = {"DryRun": dry_run} + if dhcp_options_set_id is not None: + data.update({"DhcpOptionsSetId": dhcp_options_set_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_dhcp_options( + self, + default: bool = None, + dhcp_options_set_id: list = None, + domaine_names: list = None, + domaine_name_servers: list = None, + ntp_servers: list = None, + tag_keys: list = None, + tag_values: list = None, + tags: list = None, + dry_run: bool = False, + ): + """ + Retrieves information about the content of one or more + DHCP options sets. + + :param default: SIf true, lists all default DHCP options set. + If false, lists all non-default DHCP options set. + :type default: ``list`` of ``bool`` + + :param dhcp_options_set_id: The IDs of the DHCP options sets. + :type dhcp_options_set_id: ``list`` of ``str`` + + :param domaine_names: The domain names used for the DHCP + options sets. + :type domaine_names: ``list`` of ``str`` + + :param domaine_name_servers: The domain name servers used for + the DHCP options sets. + :type domaine_name_servers: ``list`` of ``str`` + + :param ntp_servers: The Network Time Protocol (NTP) servers used + for the DHCP options sets. + :type ntp_servers: ``list`` of ``str`` + + :param tag_keys: The keys of the tags associated with the DHCP + options sets. + :type ntp_servers: ``list`` of ``str`` + + :param tag_values: The values of the tags associated with the + DHCP options sets. + :type tag_values: ``list`` of ``str`` + + :param tags: The key/value combination of the tags associated + with the DHCP options sets, in the following format: + "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. + :type tags: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a ``list`` of Dhcp Options + :rtype: ``list`` of ``dict`` + """ + action = "ReadDhcpOptions" + data = {"DryRun": dry_run, "Filters": {}} + if default is not None: + data["Filters"].update({"Default": default}) + if dhcp_options_set_id is not None: + data["Filters"].update({"DhcpOptionsSetIds": dhcp_options_set_id}) + if domaine_names is not None: + data["Filters"].update({"DomaineNames": domaine_names}) + if domaine_name_servers is not None: + data["Filters"].update({"DomaineNameServers": domaine_name_servers}) + if ntp_servers is not None: + data["Filters"].update({"NtpServers": ntp_servers}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if tag_values is not None: + data["Filters"].update({"TagValues": tag_values}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["DhcpOptionsSets"] + return response.json() + + def ex_create_direct_link( + self, + bandwidth: str = None, + direct_link_name: str = None, + location: str = None, + dry_run: bool = False, + ): + """ + Creates a new DirectLink between a customer network and a + specified DirectLink location. + + :param bandwidth: The bandwidth of the DirectLink + (1Gbps | 10Gbps). (required) + :type bandwidth: ``str`` + + :param direct_link_name: The name of the DirectLink. (required) + :type direct_link_name: ``str`` + + :param location: The code of the requested location for + the DirectLink, returned by the list_locations method. + Protocol (NTP) servers. + :type location: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Direct Link + :rtype: ``dict`` + """ + action = "CreateDirectLink" + data = {"DryRun": dry_run} + if bandwidth is not None: + data.update({"Bandwidth": bandwidth}) + if direct_link_name is not None: + data.update({"DirectLinkName": direct_link_name}) + if location is not None: + data.update({"Location": location}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["DirectLink"] + return response.json() + + def ex_delete_direct_link( + self, + direct_link_id: str = None, + dry_run: bool = False, + ): + """ + Deletes a specified DirectLink. + Before deleting a DirectLink, ensure that all your DirectLink + interfaces related to this DirectLink are deleted. + + :param direct_link_id: The ID of the DirectLink you want to + delete. (required) + :type direct_link_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteDirectLink" + data = {"DryRun": dry_run} + if direct_link_id is not None: + data.update({"DirectLinkId": direct_link_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_direct_links( + self, + direct_link_ids: list = None, + dry_run: bool = False, + ): + """ + Lists all DirectLinks in the Region. + + :param direct_link_ids: The IDs of the DirectLinks. (required) + :type direct_link_ids: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: ``list`` of Direct Links + :rtype: ``list`` of ``dict`` + """ + action = "ReadDirectLinks" + data = {"DryRun": dry_run, "Filters": {}} + if direct_link_ids is not None: + data["Filters"].update({"DirectLinkIds": direct_link_ids}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["DirectLinks"] + return response.json() + + def ex_create_direct_link_interface( + self, + direct_link_id: str = None, + bgp_asn: int = None, + bgp_key: str = None, + client_private_ip: str = None, + direct_link_interface_name: str = None, + outscale_private_ip: str = None, + virtual_gateway_id: str = None, + vlan: int = None, + dry_run: bool = False, + ): + """ + Creates a DirectLink interface. + DirectLink interfaces enable you to reach one of your Nets through a + virtual gateway. + + :param direct_link_id: The ID of the existing DirectLink for which + you want to create the DirectLink interface. (required) + :type direct_link_id: ``str`` + + :param bgp_asn: The BGP (Border Gateway Protocol) ASN (Autonomous + System Number) on the customer's side of the DirectLink interface. + (required) + :type bgp_asn: ``int`` + + :param bgp_key: The BGP authentication key. + :type bgp_key: ``str`` + + :param client_private_ip: The IP address on the customer's side + of the DirectLink interface. (required) + :type client_private_ip: ``str`` + + :param direct_link_interface_name: The name of the DirectLink + interface. (required) + :type direct_link_interface_name: ``str`` + + :param outscale_private_ip: The IP address on 3DS OUTSCALE's side + of the DirectLink interface. + :type outscale_private_ip: ``str`` + + :param virtual_gateway_id:The ID of the target virtual gateway. + (required) + :type virtual_gateway_id: ``str`` + + :param vlan: The VLAN number associated with the DirectLink + interface. (required) + :type vlan: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Direct Link Interface + :rtype: ``dict`` + """ + action = "CreateDirectLinkInterface" + data = {"DryRun": dry_run, "DirectLinkInterface": {}} + if direct_link_id is not None: + data.update({"DirectLinkId": direct_link_id}) + if bgp_asn is not None: + data["DirectLinkInterface"].update({"BgpAsn": bgp_asn}) + if bgp_key is not None: + data["DirectLinkInterface"].update({"BgpKey": bgp_key}) + if client_private_ip is not None: + data["DirectLinkInterface"].update({"ClientPrivateIp": client_private_ip}) + if direct_link_interface_name is not None: + data["DirectLinkInterface"].update( + {"DirectLinkInterfaceName": direct_link_interface_name} + ) + if outscale_private_ip is not None: + data["DirectLinkInterface"].update({"OutscalePrivateIp": outscale_private_ip}) + if virtual_gateway_id is not None: + data["DirectLinkInterface"].update({"VirtualGatewayId": virtual_gateway_id}) + if vlan is not None: + data["DirectLinkInterface"].update({"Vlan": vlan}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["DirectLinkInterface"] + return response.json() + + def ex_delete_direct_link_interface( + self, + direct_link_interface_id: str = None, + dry_run: bool = False, + ): + """ + Deletes a specified DirectLink interface. + + :param direct_link_interface_id: the ID of the DirectLink + interface you want to delete. (required) + :type direct_link_interface_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteDirectLinkInterface" + data = {"DryRun": dry_run} + if direct_link_interface_id is not None: + data.update({"DirectLinkInterfaceId": direct_link_interface_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_direct_link_interfaces( + self, + direct_link_ids: list = None, + direct_link_interface_ids: list = None, + dry_run: bool = False, + ): + """ + Lists all DirectLinks in the Region. + + :param direct_link_interface_ids: The IDs of the DirectLink + interfaces. + :type direct_link_interface_ids: ``list`` of ``str`` + + :param direct_link_ids: The IDs of the DirectLinks. + :type direct_link_ids: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: ``list`` of Direct Link interfaces + :rtype: ``list`` of ``dict`` + """ + action = "DeleteDirectLink" + data = {"DryRun": dry_run, "Filters": {}} + if direct_link_ids is not None: + data["Filters"].update({"DirectLinkIds": direct_link_ids}) + if direct_link_interface_ids is not None: + data["Filters"].update({"DirectLinkInterfaceIds": direct_link_interface_ids}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["DirectLinkInterfaces"] + return response.json() + + def ex_create_flexible_gpu( + self, + delete_on_vm_deletion: bool = None, + generation: str = None, + model_name: str = None, + subregion_name: str = None, + dry_run: bool = False, + ): + """ + Allocates a flexible GPU (fGPU) to your account. + You can then attach this fGPU to a virtual machine (VM). + + :param delete_on_vm_deletion: If true, the fGPU is deleted when + the VM is terminated. + :type delete_on_vm_deletion: ``bool`` + + :param generation: The processor generation that the fGPU must be + compatible with. If not specified, the oldest possible processor + generation is selected (as provided by ReadFlexibleGpuCatalog for + the specified model of fGPU). + :type generation: ``str`` + + :param model_name: The model of fGPU you want to allocate. For + more information, see About Flexible GPUs: + https://wiki.outscale.net/display/EN/About+Flexible+GPUs (required) + :type model_name: ``str`` + + :param subregion_name: The Subregion in which you want to create + the fGPU. (required) + :type subregion_name: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Flexible GPU + :rtype: ``dict`` + """ + action = "CreateFlexibleGpu" + data = {"DryRun": dry_run} + if delete_on_vm_deletion is not None: + data.update({"DeleteOnVmDeletion": delete_on_vm_deletion}) + if generation is not None: + data.update({"Generation": generation}) + if model_name is not None: + data.update({"ModelName": model_name}) + if subregion_name is not None: + data.update({"SubregionName": subregion_name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["FlexibleGpu"] + return response.json() + + def ex_delete_flexible_gpu( + self, + flexible_gpu_id: str = None, + dry_run: bool = False, + ): + """ + Releases a flexible GPU (fGPU) from your account. + The fGPU becomes free to be used by someone else. + + :param flexible_gpu_id: The ID of the fGPU you want + to delete. (required) + :type flexible_gpu_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteFlexibleGpu" + data = {"DryRun": dry_run} + if flexible_gpu_id is not None: + data.update({"FlexibleGpuId": flexible_gpu_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_unlink_flexible_gpu( + self, + flexible_gpu_id: str = None, + dry_run: bool = False, + ): + """ + Detaches a flexible GPU (fGPU) from a virtual machine (VM). + The fGPU is in the detaching state until the VM is stopped, after + which it becomes available for allocation again. + + :param flexible_gpu_id: The ID of the fGPU you want to attach. + (required) + :type flexible_gpu_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "UnlinkFlexibleGpu" + data = {"DryRun": dry_run} + if flexible_gpu_id is not None: + data.update({"FlexibleGpuId": flexible_gpu_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_link_flexible_gpu( + self, + flexible_gpu_id: str = None, + vm_id: str = None, + dry_run: bool = False, + ): + """ + Attaches one of your allocated flexible GPUs (fGPUs) to one of your + virtual machines (Nodes). + The fGPU is in the attaching state until the VM is stopped, after + which it becomes attached. + + :param flexible_gpu_id: The ID of the fGPU you want to attach. + (required) + :type flexible_gpu_id: ``str`` + + :param vm_id: The ID of the VM you want to attach the fGPU to. + (required) + :type vm_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "LinkFlexibleGpu" + data = {"DryRun": dry_run} + if flexible_gpu_id is not None: + data.update({"FlexibleGpuId": flexible_gpu_id}) + if vm_id is not None: + data.update({"VmId": vm_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_flexible_gpu_catalog( + self, + dry_run: bool = False, + ): + """ + Lists all flexible GPUs available in the public catalog. + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: Returns the Flexible Gpu Catalog + :rtype: ``list`` of ``dict`` + """ + action = "ReadFlexibleGpuCatalog" + data = {"DryRun": dry_run} + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["FlexibleGpuCatalog"] + return response.json() + + def ex_list_flexible_gpus( + self, + delete_on_vm_deletion: bool = None, + flexible_gpu_ids: list = None, + generations: list = None, + model_names: list = None, + states: list = None, + subregion_names: list = None, + vm_ids: list = None, + dry_run: bool = False, + ): + """ + Lists one or more flexible GPUs (fGPUs) allocated to your account. + + :param delete_on_vm_deletion: Indicates whether the fGPU is + deleted when terminating the VM. + :type delete_on_vm_deletion: ``bool`` + + :param flexible_gpu_ids: One or more IDs of fGPUs. + :type flexible_gpu_ids: ``list`` of ``str`` + + :param generations: The processor generations that the fGPUs are + compatible with. + (required) + :type generations: ``list`` of ``str`` + + :param model_names: One or more models of fGPUs. For more + information, see About Flexible GPUs: + https://wiki.outscale.net/display/EN/About+Flexible+GPUs + :type model_names: ``list`` of ``str`` + + :param states: The states of the fGPUs + (allocated | attaching | attached | detaching). + :type states: ``list`` of ``str`` + + :param subregion_names: The Subregions where the fGPUs are + located. + :type subregion_names: ``list`` of ``str`` + + :param vm_ids: One or more IDs of VMs. + :type vm_ids: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: Returns the Flexible Gpu Catalog + :rtype: ``list`` of ``dict`` + """ + action = "ReadFlexibleGpus" + data = {"DryRun": dry_run, "Filters": {}} + if delete_on_vm_deletion is not None: + data["Filters"].update({"DeleteOnVmDeletion": delete_on_vm_deletion}) + if flexible_gpu_ids is not None: + data["Filters"].update({"FlexibleGpuIds": flexible_gpu_ids}) + if generations is not None: + data["Filters"].update({"Generations": generations}) + if model_names is not None: + data["Filters"].update({"ModelNames": model_names}) + if states is not None: + data["Filters"].update({"States": states}) + if subregion_names is not None: + data["Filters"].update({"SubregionNames": subregion_names}) + if vm_ids is not None: + data["Filters"].update({"VmIds": vm_ids}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["FlexibleGpus"] + return response.json() + + def ex_update_flexible_gpu( + self, + delete_on_vm_deletion: bool = None, + flexible_gpu_id: str = None, + dry_run: bool = False, + ): + """ + Modifies a flexible GPU (fGPU) behavior. + + :param delete_on_vm_deletion: If true, the fGPU is deleted when + the VM is terminated. + :type delete_on_vm_deletion: ``bool`` + + :param flexible_gpu_id: The ID of the fGPU you want to modify. + :type flexible_gpu_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: the updated Flexible GPU + :rtype: ``dict`` + """ + action = "UpdateFlexibleGpu" + data = {"DryRun": dry_run, "DirectLinkInterface": {}} + if delete_on_vm_deletion is not None: + data.update({"DeleteOnVmDeletion": delete_on_vm_deletion}) + if flexible_gpu_id is not None: + data.update({"FlexibleGpuId": flexible_gpu_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["FlexibleGpu"] + return response.json() + + def ex_create_internet_service( + self, + dry_run: bool = False, + ): + """ + Creates an Internet service you can use with a Net. + An Internet service enables your virtual machines (VMs) launched + in a Net to connect to the Internet. By default, a Net includes + an Internet service, and each Subnet is public. Every VM + launched within a default Subnet has a private and a public IP + addresses. + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Internet Service + :rtype: ``dict`` + """ + action = "CreateInternetService" + data = {"DryRun": dry_run, "DirectLinkInterface": {}} + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["InternetService"] + return response.json() + + def ex_delete_internet_service( + self, + internet_service_id: str = None, + dry_run: bool = False, + ): + """ + Deletes an Internet service. + Before deleting an Internet service, you must detach it from any Net + it is attached to. + + :param internet_service_id: The ID of the Internet service you + want to delete.(required) + :type internet_service_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteInternetService" + data = {"DryRun": dry_run} + if internet_service_id is not None: + data.update({"InternetServiceId": internet_service_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_link_internet_service( + self, + internet_service_id: str = None, + net_id: str = None, + dry_run: bool = False, + ): + """ + Attaches an Internet service to a Net. + To enable the connection between the Internet and a Net, you must + attach an Internet service to this Net. + + :param internet_service_id: The ID of the Internet service you + want to attach. (required) + :type internet_service_id: ``str`` + + :param net_id: The ID of the Net to which you want to attach the + Internet service. (required) + :type net_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "LinkInternetService" + data = {"DryRun": dry_run} + if internet_service_id is not None: + data.update({"InternetServiceId": internet_service_id}) + if net_id is not None: + data.update({"NetId": net_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_unlink_internet_service( + self, + internet_service_id: str = None, + net_id: str = None, + dry_run: bool = False, + ): + """ + Detaches an Internet service from a Net. + This action disables and detaches an Internet service from a Net. + The Net must not contain any running virtual machine (VM) using an + External IP address (EIP). + + :param internet_service_id: The ID of the Internet service you + want to detach. (required) + :type internet_service_id: ``str`` + + :param net_id: The ID of the Net from which you want to detach + the Internet service. (required) + :type net_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "UnlinkInternetService" + data = {"DryRun": dry_run} + if internet_service_id is not None: + data.update({"InternetServiceId": internet_service_id}) + if net_id is not None: + data.update({"NetId": net_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_internet_services( + self, + internet_service_ids: List[str] = None, + link_net_ids: List[str] = None, + link_states: List[str] = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + tags: List[str] = None, + dry_run: bool = False, + ): + """ + Lists one or more of your Internet services. + An Internet service enables your virtual machines (VMs) launched in a + Net to connect to the Internet. By default, a Net includes an + Internet service, and each Subnet is public. Every VM launched within + a default Subnet has a private and a public IP addresses. + + :param internet_service_ids: One or more filters. + :type internet_service_ids: ``list`` of ``str`` + + :param link_net_ids: The IDs of the Nets the Internet services + are attached to. + :type link_net_ids: ``list`` of ``str`` + + :param link_states: The current states of the attachments + between the Internet services and the Nets (only available, + if the Internet gateway is attached to a VPC). (required) + :type link_states: ``list`` of ``str`` + + :param tag_keys: The keys of the tags associated with the + Internet services. + :type tag_keys: ``list`` of ``str`` + + :param tag_values: The values of the tags associated with the + Internet services. + :type tag_values: ``list`` of ``str`` + + :param tags: The key/value combination of the tags associated + with the Internet services, in the following format: + "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. + :type tags: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: Returns the list of Internet Services + :rtype: ``list`` of ``dict`` + """ + action = "ReadInternetServices" + data = {"DryRun": dry_run, "Filters": {}} + if internet_service_ids is not None: + data["Filters"].update({"InternetServiceIds": internet_service_ids}) + if link_net_ids is not None: + data["Filters"].update({"LinkNetIds": link_net_ids}) + if link_states is not None: + data["Filters"].update({"LinkStates": link_states}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if tag_values is not None: + data["Filters"].update({"TagValues": tag_values}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["InternetServices"] + return response.json() + + def ex_create_listener_rule( + self, + vms: [Node] = None, + l_load_balancer_name: str = None, + l_load_balancer_port: str = None, + lr_action: str = None, + lr_host_name_pattern: str = None, + lr_id: str = None, + lr_name: str = None, + lr_path_pattern: str = None, + lr_priority: int = None, + dry_run: bool = False, + ): + """ + Creates a rule for traffic redirection for the specified listener. + Each rule must have either the HostNamePattern or PathPattern parameter + specified. Rules are treated in priority order, from the highest value + to the lowest value. + Once the rule is created, you need to register backend VMs with it. + For more information, see the RegisterVmsInLoadBalancer method. + https://docs.outscale.com/api#registervmsinloadbalancer + + :param vms: The IDs of the backend VMs. (required) + :type vms: ``list`` of ``Node`` + + :param l_load_balancer_name: The name of the load balancer to + which the listener is attached. (required) + :type l_load_balancer_name: ``str`` + + :param l_load_balancer_port: The port of load balancer on which + the load balancer is listening (between 1 and 65535 both included). + (required) + :type l_load_balancer_port: ``int`` + + :param lr_action: The type of action for the rule + (always forward). + :type lr_action: ``str`` + + :param lr_host_name_pattern: A host-name pattern for the rule, + with a maximum length of 128 characters. This host-name + pattern supports maximum three wildcards, and must not contain + any special characters except [-.?]. + :type lr_host_name_pattern: ``str`` + + :param lr_id: The ID of the listener. + :type lr_id: ``str`` + + :param lr_name: A human-readable name for the listener rule. + :type lr_name: ``str`` + + :param lr_path_pattern: A path pattern for the rule, with a + maximum length of 128 characters. This path pattern supports maximum + three wildcards, and must not contain any special characters except + [_-.$/~"'@:+?]. + :type lr_path_pattern: ``str`` + + :param lr_priority: The priority level of the listener rule, + between 1 and 19999 both included. Each rule must have a unique + priority level. Otherwise, an error is returned. (required) + :type lr_priority: ``int`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Listener Rule + :rtype: ``dict`` + """ + action = "CreateListenerRule" + data = {"DryRun": dry_run, "Listener": {}, "ListenerRule": {}} + + if vms is not None: + vm_ids = [vm.id for vm in vms] + data.update({"VmIds": vm_ids}) + if l_load_balancer_name is not None: + data["Listener"].update({"LoadBalancerName": l_load_balancer_name}) + if l_load_balancer_port is not None: + data["Listener"].update({"LoadBalancerPort": l_load_balancer_port}) + if lr_action is not None: + data["ListenerRule"].update({"Action": lr_action}) + if lr_host_name_pattern is not None: + data["ListenerRule"].update({"HostNamePattern": lr_host_name_pattern}) + if lr_id is not None: + data["ListenerRule"].update({"ListenerRuleId": lr_id}) + if lr_name is not None: + data["ListenerRule"].update({"ListenerRuleName": lr_name}) + if lr_path_pattern is not None: + data["ListenerRule"].update({"PathPattern": lr_path_pattern}) + if lr_priority is not None: + data["ListenerRule"].update({"Priority": lr_priority}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ListenerRule"] + return response.json() + + def ex_create_load_balancer_listeners( + self, + load_balancer_name: str = None, + l_backend_port: int = None, + l_backend_protocol: str = None, + l_load_balancer_port: int = None, + l_load_balancer_protocol: str = None, + l_server_certificate_id: str = None, + dry_run: bool = False, + ): + """ + Creates one or more listeners for a specified load balancer. + + :param load_balancer_name: The name of the load balancer for + which you want to create listeners. (required) + :type load_balancer_name: ``str`` + + :param l_backend_port: The port on which the back-end VM is + listening (between 1 and 65535, both included). (required) + :type l_backend_port: ``int`` + + :param l_backend_protocol: The protocol for routing traffic to + back-end VMs (HTTP | HTTPS | TCP | SSL | UDP). + :type l_backend_protocol: ``int`` + + :param l_load_balancer_port: The port on which the load balancer + is listening (between 1 and 65535, both included). (required) + :type l_load_balancer_port: ``int`` + + :param l_load_balancer_protocol: The routing protocol + (HTTP | HTTPS | TCP | SSL | UDP). (required) + :type l_load_balancer_protocol: ``str`` + + :param l_server_certificate_id: The ID of the server certificate. + (required) + :type l_server_certificate_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Load Balancer Listener + :rtype: ``dict`` + """ + action = "CreateLoadBalancerListeners" + data = {"DryRun": dry_run, "Listeners": {}} + + if load_balancer_name is not None: + data.update({"LoadBalancerName": load_balancer_name}) + if l_backend_port is not None: + data["Listeners"].update({"BackendPort": l_backend_port}) + if l_backend_protocol is not None: + data["Listeners"].update({"BackendProtocol": l_backend_protocol}) + if l_load_balancer_port is not None: + data["Listeners"].update({"LoadBalancerPort": l_load_balancer_port}) + if l_load_balancer_protocol is not None: + data["Listeners"].update({"LoadBalancerProtocol": l_load_balancer_protocol}) + if l_server_certificate_id is not None: + data["Listeners"].update({"ServerCertificateId": l_server_certificate_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["LoadBalancer"] + return response.json() + + def ex_delete_listener_rule( + self, + listener_rule_name: str = None, + dry_run: bool = False, + ): + """ + Deletes a listener rule. + The previously active rule is disabled after deletion. + + :param listener_rule_name: The name of the rule you want to + delete. (required) + :type listener_rule_name: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteListenerRule" + data = {"DryRun": dry_run} + if listener_rule_name is not None: + data.update({"ListenerRuleName": listener_rule_name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_delete_load_balancer_listeners( + self, + load_balancer_name: str = None, + load_balancer_ports: List[int] = None, + dry_run: bool = False, + ): + """ + Deletes listeners of a specified load balancer. + + :param load_balancer_name: The name of the load balancer for + which you want to delete listeners. (required) + :type load_balancer_name: ``str`` + + :param load_balancer_ports: One or more port numbers of the + listeners you want to delete.. (required) + :type load_balancer_ports: ``list`` of ``int`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteLoadBalancerListeners" + data = {"DryRun": dry_run} + if load_balancer_ports is not None: + data.update({"LoadBalancerPorts": load_balancer_ports}) + if load_balancer_name is not None: + data.update({"LoadBalancerName": load_balancer_name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_listener_rules(self, listener_rule_names: List[str] = None, dry_run: bool = False): + """ + Describes one or more listener rules. By default, this action returns + the full list of listener rules for the account. + + :param listener_rule_names: The names of the listener rules. + :type listener_rule_names: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: Returns the list of Listener Rules + :rtype: ``list`` of ``dict`` + """ + action = "ReadListenerRules" + data = {"DryRun": dry_run, "Filters": {}} + if listener_rule_names is not None: + data["Filters"].update({"ListenerRuleNames": listener_rule_names}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ListenerRules"] + return response.json() + + def ex_update_listener_rule( + self, + host_pattern: str = None, + listener_rule_name: str = None, + path_pattern: str = None, + dry_run: bool = False, + ): + """ + Updates the pattern of the listener rule. + This call updates the pattern matching algorithm for incoming traffic. + + :param host_pattern: TA host-name pattern for the rule, with a + maximum length of 128 characters. This host-name pattern supports + maximum three wildcards, and must not contain any special characters + except [-.?]. + :type host_pattern: ``str` + + :param listener_rule_name: The name of the listener rule. + (required) + :type listener_rule_name: ``str`` + + :param path_pattern: A path pattern for the rule, with a maximum + length of 128 characters. This path pattern supports maximum three + wildcards, and must not contain any special characters + except [_-.$/~"'@:+?]. + :type path_pattern: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: Update the specified Listener Rule + :rtype: ``dict`` + """ + action = "UpdateListenerRule" + data = {"DryRun": dry_run} + if host_pattern is not None: + data.update({"HostPattern": host_pattern}) + if listener_rule_name is not None: + data.update({"ListenerRuleName": listener_rule_name}) + if path_pattern is not None: + data.update({"PathPattern": path_pattern}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ListenerRule"] + return response.json() + + def ex_create_load_balancer( + self, + load_balancer_name: str = None, + load_balancer_type: str = None, + security_groups: List[str] = None, + subnets: List[str] = None, + subregion_names: str = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + l_backend_port: int = None, + l_backend_protocol: str = None, + l_load_balancer_port: int = None, + l_load_balancer_protocol: str = None, + l_server_certificate_id: str = None, + dry_run: bool = False, + ): + """ + Creates a load balancer. + The load balancer is created with a unique Domain Name Service (DNS) + name. It receives the incoming traffic and routes it to its registered + virtual machines (VMs). By default, this action creates an + Internet-facing load balancer, resolving to public IP addresses. + To create an internal load balancer in a Net, resolving to private IP + addresses, use the LoadBalancerType parameter. + + :param load_balancer_name: The name of the load balancer for + which you want to create listeners. (required) + :type load_balancer_name: ``str`` + + :param load_balancer_type: The type of load balancer: + internet-facing or internal. Use this parameter only for load + balancers in a Net. + :type load_balancer_type: ``str`` + + :param security_groups: One or more IDs of security groups you + want to assign to the load balancer. + :type security_groups: ``list`` of ``str`` + + :param subnets: One or more IDs of Subnets in your Net that you + want to attach to the load balancer. + :type subnets: ``list`` of ``str`` + + :param subregion_names: One or more names of Subregions + (currently, only one Subregion is supported). This parameter is not + required if you create a load balancer in a Net. To create an internal + load balancer, use the LoadBalancerType parameter. + :type subregion_names: ``list`` of ``str`` + + :param tag_keys: The key of the tag, with a minimum of 1 + character. (required) + :type tag_keys: ``list`` of ``str`` + + :param tag_values: The value of the tag, between 0 and 255 + characters. (required) + :type tag_values: ``list`` of ``str`` + + :param l_backend_port: The port on which the back-end VM is + listening (between 1 and 65535, both included). (required) + :type l_backend_port: ``int`` + + :param l_backend_protocol: The protocol for routing traffic to + back-end VMs (HTTP | HTTPS | TCP | SSL | UDP). + :type l_backend_protocol: ``int`` + + :param l_load_balancer_port: The port on which the load balancer + is listening (between 1 and 65535, both included). (required) + :type l_load_balancer_port: ``int`` + + :param l_load_balancer_protocol: The routing protocol + (HTTP | HTTPS | TCP | SSL | UDP). (required) + :type l_load_balancer_protocol: ``str`` + + :param l_server_certificate_id: The ID of the server certificate. + (required) + :type l_server_certificate_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Load Balancer + :rtype: ``dict`` + """ + action = "CreateLoadBalancer" + data = {"DryRun": dry_run, "Listeners": {}, "Tags": {}} + + if load_balancer_name is not None: + data.update({"LoadBalancerName": load_balancer_name}) + if load_balancer_type is not None: + data.update({"LoadBalencerType": load_balancer_type}) + if security_groups is not None: + data.update({"SecurityGroups": security_groups}) + if subnets is not None: + data.update({"Subnets": subnets}) + if subregion_names is not None: + data.update({"SubregionNames": subregion_names}) + if tag_keys and tag_values and len(tag_keys) == len(tag_values): + for key, value in zip(tag_keys, tag_values): + data["Tags"].update({"Key": key, "Value": value}) + if l_backend_port is not None: + data["Listeners"].update({"BackendPort": l_backend_port}) + if l_backend_protocol is not None: + data["Listeners"].update({"BackendProtocol": l_backend_protocol}) + if l_load_balancer_port is not None: + data["Listeners"].update({"LoadBalancerPort": l_load_balancer_port}) + if l_load_balancer_protocol is not None: + data["Listeners"].update({"LoadBalancerProtocol": l_load_balancer_protocol}) + if l_server_certificate_id is not None: + data["Listeners"].update({"ServerCertificateId": l_server_certificate_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["LoadBalancer"] + return response.json() + + def ex_create_load_balancer_tags( + self, + load_balancer_names: List[str] = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + dry_run: bool = False, + ): + """ + Adds one or more tags to the specified load balancers. + If a tag with the same key already exists for the load balancer, + the tag value is replaced. + + :param load_balancer_names: The name of the load balancer for + which you want to create listeners. (required) + :type load_balancer_names: ``str`` + + :param tag_keys: The key of the tag, with a minimum of 1 + character. (required) + :type tag_keys: ``list`` of ``str`` + + :param tag_values: The value of the tag, between 0 and 255 + characters. (required) + :type tag_values: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Load Balancer Tags + :rtype: ``dict`` + """ + action = "CreateLoadBalancerTags" + data = {"DryRun": dry_run, "Tags": {}} + if load_balancer_names is not None: + data.update({"LoadBalancerNames": load_balancer_names}) + if tag_keys and tag_values and len(tag_keys) == len(tag_values): + for key, value in zip(tag_keys, tag_values): + data["Tags"].update({"Key": key, "Value": value}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["LoadBalancer"] + return response.json() + + def ex_delete_load_balancer( + self, + load_balancer_name: str = None, + dry_run: bool = False, + ): + """ + Deletes a specified load balancer. + + :param load_balancer_name: The name of the load balancer you want + to delete. (required) + :type load_balancer_name: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteLoadBalancer" + data = {"DryRun": dry_run} + if load_balancer_name is not None: + data.update({"LoadBalancerName": load_balancer_name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_delete_load_balancer_tags( + self, + load_balancer_names: List[str] = None, + tag_keys: List[str] = None, + dry_run: bool = False, + ): + """ + Deletes a specified load balancer tags. + + :param load_balancer_names: The names of the load balancer for + which you want to delete tags. (required) + :type load_balancer_names: ``str`` + + :param tag_keys: The key of the tag, with a minimum of + 1 character. + :type tag_keys: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteLoadBalancerTags" + data = {"DryRun": dry_run, "Tags": {}} + if load_balancer_names is not None: + data.update({"LoadBalancerNames": load_balancer_names}) + if tag_keys is not None: + data["Tags"].update({"Keys": tag_keys}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_deregister_vms_in_load_balancer( + self, + backend_vm_ids: List[str] = None, + load_balancer_name: str = None, + dry_run: bool = False, + ): + """ + Deregisters a specified virtual machine (VM) from a load balancer. + + :param backend_vm_ids: One or more IDs of back-end VMs. + (required) + :type backend_vm_ids: ``str`` + + :param load_balancer_name: The name of the load balancer. + (required) + :type load_balancer_name: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeregisterVmsInLoadBalancer" + data = {"DryRun": dry_run} + if load_balancer_name is not None: + data.update({"LoadBalancerName": load_balancer_name}) + if backend_vm_ids is not None: + data.update({"BackendVmIds": backend_vm_ids}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_load_balancer_tags( + self, + load_balancer_names: List[str] = None, + dry_run: bool = False, + ): + """ + Describes the tags associated with one or more specified load + balancers. + + :param load_balancer_names: The names of the load balancer. + (required) + :type load_balancer_names: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a list of load balancer tags + :rtype: ``list`` of ``dict`` + """ + action = "ReadLoadBalancerTags" + data = {"DryRun": dry_run} + if load_balancer_names is not None: + data.update({"LoadBalancerNames": load_balancer_names}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Tags"] + return response.json() + + def ex_list_load_balancers( + self, + load_balancer_names: List[str] = None, + dry_run: bool = False, + ): + """ + Lists one or more load balancers and their attributes. + + :param load_balancer_names: The names of the load balancer. + (required) + :type load_balancer_names: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a list of load balancer + :rtype: ``list`` of ``dict`` + """ + action = "ReadLoadBalancers" + data = {"DryRun": dry_run, "Filters": {}} + if load_balancer_names is not None: + data["Filters"].update({"LoadBalancerNames": load_balancer_names}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["LoadBalancers"] + return response.json() + + def ex_list_vms_health( + self, + backend_vm_ids: List[str] = None, + load_balancer_name: str = None, + dry_run: bool = False, + ): + """ + Lists the state of one or more back-end virtual machines (VMs) + registered with a specified load balancer. + + :param load_balancer_name: The name of the load balancer. + (required) + :type load_balancer_name: ``str`` + + :param backend_vm_ids: One or more IDs of back-end VMs. + :type backend_vm_ids: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a list of back end vms health + :rtype: ``list`` of ``dict`` + """ + action = "ReadVmsHealth" + data = {"DryRun": dry_run} + if backend_vm_ids is not None: + data.update({"BackendVmIds": backend_vm_ids}) + if load_balancer_name is not None: + data.update({"LoadBalancerName": load_balancer_name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["BackendVmHealth"] + return response.json() + + def ex_register_vms_in_load_balancer( + self, + backend_vm_ids: List[str] = None, + load_balancer_name: str = None, + dry_run: bool = False, + ): + """ + Registers one or more virtual machines (VMs) with a specified load + balancer. + The VMs must be running in the same network as the load balancer + (in the public Cloud or in the same Net). It may take a little time + for a VM to be registered with the load balancer. Once the VM is + registered with a load balancer, it receives traffic and requests from + this load balancer and is called a back-end VM. + + :param load_balancer_name: The name of the load balancer. + (required) + :type load_balancer_name: ``str`` + + :param backend_vm_ids: One or more IDs of back-end VMs. + :type backend_vm_ids: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a list of back end vms health + :rtype: ``list`` of ``dict`` + """ + action = "RegisterVmsInLoadBalancer" + data = {"DryRun": dry_run, "Filters": {}} + if backend_vm_ids is not None: + data.update({"BackendVmIds": backend_vm_ids}) + if load_balancer_name is not None: + data.update({"LoadBalancerName": load_balancer_name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["BackendVmHealth"] + return response.json() + + def ex_update_load_balancer( + self, + access_log_is_enabled: bool = None, + access_log_osu_bucket_name: str = None, + access_log_osu_bucket_prefix: str = None, + access_log_publication_interval: int = None, + health_check_interval: int = None, + health_check_healthy_threshold: int = None, + health_check_path: str = None, + health_check_port: int = None, + health_check_protocol: str = None, + health_check_timeout: int = None, + health_check_unhealthy_threshold: int = None, + load_balancer_name: str = None, + load_balancer_port: int = None, + policy_names: List[str] = None, + server_certificate_id: str = None, + dry_run: bool = False, + ): + """ + Modifies the specified attributes of a load balancer. + + You can set a new SSL certificate to an SSL or HTTPS listener of a + load balancer. + This certificate replaces any certificate used on the same load + balancer and port. + + You can also replace the current set of policies for a load balancer + with another specified one. + If the PolicyNames parameter is empty, all current policies are + disabled. + + :param access_log_is_enabled: If true, access logs are enabled + for your load balancer. + If false, they are not. If you set this to true in your request, the + OsuBucketName parameter is required. + :type access_log_is_enabled: ``bool` + + :param access_log_osu_bucket_name: The name of the Object Storage + Unit (OSU) bucket for the access logs. + :type access_log_osu_bucket_name: ``str`` + + :param access_log_osu_bucket_prefix: The path to the folder of + the access logs in your Object Storage Unit (OSU) bucket (by default, + the root level of your bucket). + :type access_log_osu_bucket_prefix: ``str`` + + :param access_log_publication_interval: The time interval for the + publication of access logs in the Object Storage Unit (OSU) bucket, + in minutes. This value can be either 5 or 60 (by default, 60). + :type access_log_publication_interval: ``int`` + + :param health_check_interval: Information about the health check + configuration. (required) + :type health_check_interval: ``int`` + + :param health_check_path: The path for HTTP or HTTPS requests. + (required) + :type health_check_path: ``str`` + + :param health_check_port: The port number (between 1 and 65535, + both included). (required) + :type health_check_port: ``int`` + + :param health_check_protocol: The protocol for the URL of the VM + (HTTP | HTTPS | TCP | SSL | UDP). (required) + :type health_check_protocol: ``str`` + + :param health_check_timeout: The maximum waiting time for a + response before considering the VM as unhealthy, in seconds (between 2 + and 60 both included). (required) + :type health_check_timeout: ``int`` + + :param health_check_healthy_threshold: The number of consecutive + failed pings before considering the VM as unhealthy (between 2 and + 10 both included). (required) + :type health_check_healthy_threshold: ``int`` + + :param health_check_unhealthy_threshold: The number of + consecutive failed pings before considering the VM as unhealthy + (between 2 and 10 both included).(required) + :type health_check_unhealthy_threshold: ``int`` + + :param load_balancer_name: The name of the load balancer. + (required) + :type load_balancer_name: ``str`` + + :param load_balancer_port: The port on which the load balancer is + listening (between 1 and 65535, both included). + :type load_balancer_port: ``int`` + + :param policy_names: The list of policy names (must contain all + the policies to be enabled). + :type policy_names: ``list`` of ``str`` + + :param server_certificate_id: The list of policy names (must + contain all the policies to be enabled). + :type server_certificate_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: Update the specified Load Balancer + :rtype: ``dict`` + """ + action = "UpdateLoadBalancer" + data = {"DryRun": dry_run, "AccessLog": {}, "HealthCheck": {}} + if access_log_is_enabled is not None: + data["AccessLog"].update({"IsEnabled": access_log_is_enabled}) + if access_log_osu_bucket_name is not None: + data["AccessLog"].update({"OsuBucketName": access_log_osu_bucket_name}) + if access_log_osu_bucket_prefix is not None: + data["AccessLog"].update({"OsuBucketPrefix": access_log_osu_bucket_prefix}) + if access_log_publication_interval is not None: + data["AccessLog"].update({"PublicationInterval": access_log_publication_interval}) + if health_check_interval is not None: + data["HealthCheck"].update({"CheckInterval": health_check_interval}) + if health_check_healthy_threshold is not None: + data["HealthCheck"].update({"HealthyThreshold": health_check_healthy_threshold}) + if health_check_path is not None: + data["HealthCheck"].update({"Path": health_check_path}) + if health_check_port is not None: + data["HealthCheck"].update({"Port": health_check_port}) + if health_check_protocol is not None: + data["HealthCheck"].update({"Protocol": health_check_protocol}) + if health_check_timeout is not None: + data["HealthCheck"].update({"Timeout": health_check_timeout}) + if health_check_unhealthy_threshold is not None: + data["HealthCheck"].update({"UnhealthyThreshold": health_check_unhealthy_threshold}) + if load_balancer_name is not None: + data.update({"LoadBalancerName": load_balancer_name}) + if load_balancer_port is not None: + data.update({"LoadBalancerPort": load_balancer_port}) + if policy_names is not None: + data.update({"PolicyNames": policy_names}) + if server_certificate_id is not None: + data.update({"ServerCertificateId": server_certificate_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["LoadBalancer"] + return response.json() + + def ex_create_load_balancer_policy( + self, + cookie_name: str = None, + load_balancer_name: str = None, + policy_name: str = None, + policy_type: str = None, + dry_run: bool = False, + ): + """ + Creates a stickiness policy with sticky session lifetimes defined by + the browser lifetime. The created policy can be used with HTTP or + HTTPS listeners only. + If this policy is implemented by a load balancer, this load balancer + uses this cookie in all incoming requests to direct them to the + specified back-end server virtual machine (VM). If this cookie is not + present, the load balancer sends the request to any other server + according to its load-balancing algorithm. + + You can also create a stickiness policy with sticky session lifetimes + following the lifetime of an application-generated cookie. + Unlike the other type of stickiness policy, the lifetime of the + special Load Balancer Unit (LBU) cookie follows the lifetime of the + application-generated cookie specified in the policy configuration. + The load balancer inserts a new stickiness cookie only when the + application response includes a new application cookie. + The session stops being sticky if the application cookie is removed or + expires, until a new application cookie is issued. + + :param cookie_name: The name of the application cookie used for + stickiness. This parameter is required if you create a stickiness + policy based on an application-generated cookie. + :type cookie_name: ``str`` + + :param load_balancer_name: The name of the load balancer for + which you want to create a policy. (required) + :type load_balancer_name: ``str`` + + :param policy_name: The name of the policy. This name must be + unique and consist of alphanumeric characters and dashes (-). + (required) + :type policy_name: ``str`` + + :param policy_type: The type of stickiness policy you want to + create: app or load_balancer. (required) + :type policy_type: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Load Balancer Policy + :rtype: ``dict`` + """ + action = "CreateLoadBalancerPolicy" + data = {"DryRun": dry_run, "Tags": {}} + if cookie_name is not None: + data.update({"CookieName": cookie_name}) + if load_balancer_name is not None: + data.update({"LoadBalancerName": load_balancer_name}) + if policy_type is not None: + data.update({"PolicyType": policy_type}) + if policy_name is not None: + data.update({"PolicyName": policy_name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["LoadBalancer"] + return response.json() + + def ex_delete_load_balancer_policy( + self, + load_balancer_name: str = None, + policy_name: str = None, + dry_run: bool = False, + ): + """ + Deletes a specified policy from a load balancer. + In order to be deleted, the policy must not be enabled for any + listener. + + :param load_balancer_name: The name of the load balancer for + which you want to delete a policy. (required) + :type load_balancer_name: ``str`` + + :param policy_name: The name of the policy you want to delete. + (required) + :type policy_name: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteLoadBalancerPolicy" + data = {"DryRun": dry_run, "Tags": {}} + if load_balancer_name is not None: + data.update({"LoadBalancerName": load_balancer_name}) + if policy_name is not None: + data["Tags"].update({"PolicyName": policy_name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_create_nat_service( + self, + public_ip: str = None, + subnet_id: str = None, + dry_run: bool = False, + ): + """ + Creates a network address translation (NAT) service in the specified + public Subnet of a Net. + A NAT service enables virtual machines (VMs) placed in the private + Subnet of this Net to connect to the Internet, without being + accessible from the Internet. + When creating a NAT service, you specify the allocation ID of the + External IP (EIP) you want to use as public IP for the NAT service. + Once the NAT service is created, you need to create a route in the + route table of the private Subnet, with 0.0.0.0/0 as destination and + the ID of the NAT service as target. For more information, see + LinkPublicIP and CreateRoute. + This action also enables you to create multiple NAT services in the + same Net (one per public Subnet). + + :param public_ip: The allocation ID of the EIP to associate + with the NAT service. (required) + :type public_ip: ``str`` + + :param subnet_id: The ID of the Subnet in which you want to + create the NAT service. (required) + :type subnet_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Nat Service + :rtype: ``dict`` + """ + action = "CreateNatService" + data = {"DryRun": dry_run} + if public_ip is not None: + data.update({"PublicIpId": public_ip}) + if subnet_id is not None: + data.update({"SubnetId": subnet_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["NatService"] + return response.json() + + def ex_delete_nat_service( + self, + nat_service_id: str = None, + dry_run: bool = False, + ): + """ + Deletes a specified network address translation (NAT) service. + This action disassociates the External IP address (EIP) from the NAT + service, but does not release this EIP from your account. However, it + does not delete any NAT service routes in your route tables. + + :param nat_service_id: the ID of the NAT service you want to + delete. (required) + :type nat_service_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteNatService" + data = {"DryRun": dry_run} + if nat_service_id is not None: + data.update({"NatServiceId": nat_service_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_nat_services( + self, + nat_service_ids: List[str] = None, + net_ids: List[str] = None, + states: List[str] = None, + subnet_ids: List[str] = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + tags: List[str] = None, + dry_run: bool = False, + ): + """ + Lists one or more network address translation (NAT) services. + + :param nat_service_ids: The IDs of the NAT services. + :type nat_service_ids: ``list`` of ``str`` + + :param net_ids: The IDs of the Nets in which the NAT services are. + :type net_ids: ``list`` of ``str`` + + :param states: The states of the NAT services + (pending | available | deleting | deleted). + :type states: ``list`` of ``str`` + + :param subnet_ids: The IDs of the Subnets in which the NAT + services are. + :type subnet_ids: ``list`` of ``str`` + + :param tag_keys: The keys of the tags associated with the NAT + services. + :type tag_keys: ``list`` of ``str`` + + :param tag_values: The values of the tags associated with the NAT + services. + :type tag_values: ``list`` of ``str`` + + :param tags: The values of the tags associated with the NAT + services. + :type tags: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a list of back end vms health + :rtype: ``list`` of ``dict`` + """ + action = "ReadNatServices" + data = {"DryRun": dry_run, "Filters": {}} + if nat_service_ids is not None: + data["Filters"].update({"NatServiceIds": nat_service_ids}) + if states is not None: + data["Filters"].update({"States": states}) + if net_ids is not None: + data["Filters"].update({"NetIds": net_ids}) + if subnet_ids is not None: + data["Filters"].update({"SubnetIds": subnet_ids}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if tag_values is not None: + data["Filters"].update({"TagValues": tag_values}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["NatServices"] + return response.json() + + def ex_create_net( + self, + ip_range: str = None, + tenancy: str = None, + dry_run: bool = False, + ): + """ + Creates a Net with a specified IP range. + The IP range (network range) of your Net must be between a /28 netmask + (16 IP addresses) and a /16 netmask (65 536 IP addresses). + + :param ip_range: The IP range for the Net, in CIDR notation + (for example, 10.0.0.0/16). (required) + :type ip_range: ``str`` + + :param tenancy: The tenancy options for the VMs (default if a VM + created in a Net can be launched with any tenancy, dedicated if it can + be launched with dedicated tenancy VMs running on single-tenant + hardware). + :type tenancy: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Nat Service + :rtype: ``dict`` + """ + action = "CreateNet" + data = {"DryRun": dry_run} + if ip_range is not None: + data.update({"IpRange": ip_range}) + if tenancy is not None: + data.update({"Tenancy": tenancy}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Net"] + return response.json() + + def ex_delete_net( + self, + net_id: str = None, + dry_run: bool = False, + ): + """ + Deletes a specified Net. + Before deleting the Net, you need to delete or detach all the + resources associated with the Net: + + - Virtual machines (VMs) + - Net peering connections + - Custom route tables + - External IP addresses (EIPs) allocated to resources in the Net + - Network Interface Cards (NICs) created in the Subnets + - Virtual gateways, Internet services and NAT services + - Load balancers + - Security groups + - Subnets + + :param net_id: The ID of the Net you want to delete. (required) + :type net_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteNet" + data = {"DryRun": dry_run} + if net_id is not None: + data.update({"NetId": net_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_nets( + self, + dhcp_options_set_ids: List[str] = None, + ip_ranges: List[str] = None, + is_default: bool = None, + net_ids: List[str] = None, + states: List[str] = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + tags: List[str] = None, + dry_run: bool = False, + ): + """ + Lists one or more Nets. + + :param dhcp_options_set_ids: The IDs of the DHCP options sets. + :type dhcp_options_set_ids: ``list`` of ``str`` + + :param ip_ranges: The IP ranges for the Nets, in CIDR notation + (for example, 10.0.0.0/16). + :type ip_ranges: ``list`` of ``str`` + + :param is_default: If true, the Net used is the default one. + :type is_default: ``bool`` + + :param net_ids: The IDs of the Nets. + :type net_ids: ``list`` of ``str`` + + :param states: The states of the Nets (pending | available). + :type states: ``list`` of ``str`` + + :param tag_keys: The keys of the tags associated with the Nets. + :type tag_keys: ``list`` of ``str`` + + :param tag_values: The values of the tags associated with the + Nets. + :type tag_values: ``list`` of ``str`` + + :param tags: The key/value combination of the tags associated + with the Nets, in the following format: + "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. + :type tags: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: A list of Nets + :rtype: ``list`` of ``dict`` + """ + action = "ReadNets" + data = {"DryRun": dry_run, "Filters": {}} + if dhcp_options_set_ids is not None: + data["Filters"].update({"DhcpOptionsSetIds": dhcp_options_set_ids}) + if ip_ranges is not None: + data["Filters"].update({"IpRanges": ip_ranges}) + if is_default is not None: + data["Filters"].update({"IsDefault": is_default}) + if net_ids is not None: + data["Filters"].update({"NetIds": net_ids}) + if states is not None: + data["Filters"].update({"States": states}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if tag_values is not None: + data["Filters"].update({"TagValues": tag_values}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Nets"] + return response.json() + + def ex_update_net( + self, + net_id: str = None, + dhcp_options_set_id: str = None, + dry_run: bool = False, + ): + """ + Associates a DHCP options set with a specified Net. + + :param net_id: The ID of the Net. (required) + :type net_id: ``str`` + + :param dhcp_options_set_id: The ID of the DHCP options set + (or default if you want to associate the default one). (required) + :type dhcp_options_set_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The modified Nat Service + :rtype: ``dict`` + """ + action = "UpdateNet" + data = {"DryRun": dry_run} + if net_id is not None: + data.update({"NetId": net_id}) + if dhcp_options_set_id is not None: + data.update({"DhcpOptionsSetId": dhcp_options_set_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Net"] + return response.json() + + def ex_create_net_access_point( + self, + net_id: str = None, + route_table_ids: List[str] = None, + service_name: str = None, + dry_run: bool = False, + ): + """ + Creates a Net access point to access a 3DS OUTSCALE service from this + Net without using the Internet and External IP addresses. + You specify the service using its prefix list name. For more + information, see DescribePrefixLists: + https://docs.outscale.com/api#describeprefixlists + To control the routing of traffic between the Net and the specified + service, you can specify one or more route tables. Virtual machines + placed in Subnets associated with the specified route table thus use + the Net access point to access the service. When you specify a route + table, a route is automatically added to it with the destination set + to the prefix list ID of the service, and the target set to the ID of + the access point. + + :param net_id: The ID of the Net. (required) + :type net_id: ``str`` + + :param route_table_ids: One or more IDs of route tables to use + for the connection. + :type route_table_ids: ``list`` of ``str`` + + :param service_name: The prefix list name corresponding to the + service (for example, com.outscale.eu-west-2.osu for OSU). (required) + :type service_name: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Access Net Point + :rtype: ``dict`` + """ + action = "CreateNetAccessPoint" + data = {"DryRun": dry_run} + if net_id is not None: + data.update({"NetId": net_id}) + if route_table_ids is not None: + data.update({"RouteTableIds": route_table_ids}) + if service_name is not None: + data.update({"ServiceName": service_name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["NetAccessPoint"] + return response.json() + + def ex_delete_net_access_point( + self, + net_access_point_id: str = None, + dry_run: bool = False, + ): + """ + Deletes one or more Net access point. + This action also deletes the corresponding routes added to the route + tables you specified for the Net access point. + + :param net_access_point_id: The ID of the Net access point. + (required) + :type net_access_point_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteNetAccessPoint" + data = {"DryRun": dry_run} + if net_access_point_id is not None: + data.update({"NetAccessPointId": net_access_point_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_nets_access_point_services( + self, + service_ids: List[str] = None, + service_names: List[str] = None, + dry_run: bool = False, + ): + """ + Describes 3DS OUTSCALE services available to create Net access points. + For more information, see CreateNetAccessPoint: + https://docs.outscale.com/api#createnetaccesspoint + + :param service_ids: The IDs of the services. + :type service_ids: ``list`` of ``str`` + + :param service_names: The names of the prefix lists, which + identify the 3DS OUTSCALE services they are associated with. + :type service_names: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: A list of Services + :rtype: ``list`` of ``dict`` + """ + action = "ReadNetAccessPointServices" + data = {"DryRun": dry_run, "Filters": {}} + if service_names is not None: + data["Filters"].update({"ServiceNames": service_names}) + if service_ids is not None: + data["Filters"].update({"ServiceIds": service_ids}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Services"] + return response.json() + + def ex_list_nets_access_points( + self, + net_access_point_ids: List[str] = None, + net_ids: List[str] = None, + service_names: List[str] = None, + states: List[str] = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + tags: List[str] = None, + dry_run: bool = False, + ): + """ + Describes one or more Net access points. + + :param net_access_point_ids: The IDs of the Net access points. + :type net_access_point_ids: ``list`` of ``str`` + + :param net_ids: The IDs of the Nets. + :type net_ids: ``list`` of ``str`` + + :param service_names: The The names of the prefix lists + corresponding to the services. For more information, + see DescribePrefixLists: + https://docs.outscale.com/api#describeprefixlists + :type service_names: ``list`` of ``str`` + + :param states: The states of the Net access points + (pending | available | deleting | deleted). + :type states: ``list`` of ``str`` + + :param tag_keys: The keys of the tags associated with the Net + access points. + :type tag_keys: ``list`` of ``str`` + + :param tag_values: The values of the tags associated with the + Net access points. + :type tag_values: ``list`` of ``str`` + + :param tags: The key/value combination of the tags associated + with the Net access points, in the following format: + "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. + :type tags: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: A list of Net Access Points + :rtype: ``list`` of ``dict`` + """ + action = "ReadNetAccessPoints" + data = {"DryRun": dry_run, "Filters": {}} + if net_access_point_ids is not None: + data["Filters"].update({"NetAccessPointIds": net_access_point_ids}) + if net_ids is not None: + data["Filters"].update({"NetIds": net_ids}) + if service_names is not None: + data["Filters"].update({"ServiceNames": service_names}) + if states is not None: + data["Filters"].update({"States": states}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if tag_values is not None: + data["Filters"].update({"TagValues": tag_values}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["NetAccessPoints"] + return response.json() + + def ex_update_net_access_point( + self, + add_route_table_ids: List[str] = None, + net_access_point_id: str = None, + remove_route_table_ids: List[str] = None, + dry_run: bool = False, + ): + """ + Modifies the attributes of a Net access point. + This action enables you to add or remove route tables associated with + the specified Net access point. + + :param add_route_table_ids: One or more IDs of route tables to + associate with the specified Net access point. + :type add_route_table_ids: ``list`` of ``str`` + + :param net_access_point_id: The ID of the Net access point. + (required) + :type net_access_point_id: ``str`` + + :param remove_route_table_ids: One or more IDs of route tables to + disassociate from the specified Net access point. + :type remove_route_table_ids: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The modified Net Access Point + :rtype: ``dict`` + """ + action = "UpdateNetAccessPoint" + data = {"DryRun": dry_run} + if add_route_table_ids is not None: + data.update({"AddRouteTablesIds": add_route_table_ids}) + if net_access_point_id is not None: + data.update({"NetAccessPointId": net_access_point_id}) + if remove_route_table_ids is not None: + data.update({"RemoveRouteTableIds": remove_route_table_ids}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["NetAccessPoint"] + return response.json() + + def ex_create_net_peering( + self, + accepter_net_id: str = None, + source_net_id: str = None, + dry_run: bool = False, + ): + """ + Requests a Net peering connection between a Net you own and a peer Net + that belongs to you or another account. + This action creates a Net peering connection that remains in the + pending-acceptance state until it is accepted by the owner of the peer + Net. If the owner of the peer Net does not accept the request within + 7 days, the state of the Net peering connection becomes expired. + For more information, see AcceptNetPeering: + https://docs.outscale.com/api#acceptnetpeering + + :param accepter_net_id: The ID of the Net you want to connect + with. (required) + :type accepter_net_id: ``str`` + + :param source_net_id: The ID of the Net you send the peering + request from. (required) + :type source_net_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Net Peering + :rtype: ``dict`` + """ + action = "CreateNetPeering" + data = {"DryRun": dry_run} + if accepter_net_id is not None: + data.update({"AccepterNetId": accepter_net_id}) + if source_net_id is not None: + data.update({"SourceNetId": source_net_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["NetPeering"] + return response.json() + + def ex_accept_net_peering( + self, + net_peering_id: List[str] = None, + dry_run: bool = False, + ): + """ + Accepts a Net peering connection request. + To accept this request, you must be the owner of the peer Net. If + you do not accept the request within 7 days, the state of the Net + peering connection becomes expired. + + :param net_peering_id: The ID of the Net peering connection you + want to accept. (required) + :type net_peering_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The accepted Net Peering + :rtype: ``dict`` + """ + action = "AcceptNetPeering" + data = {"DryRun": dry_run} + if net_peering_id is not None: + data.update({"NetPeeringId": net_peering_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["NetPeering"] + return response.json() + + def ex_delete_net_peering( + self, + net_peering_id: List[str] = None, + dry_run: bool = False, + ): + """ + Deletes a Net peering connection. + If the Net peering connection is in the active state, it can be + deleted either by the owner of the requester Net or the owner of the + peer Net. + If it is in the pending-acceptance state, it can be deleted only by + the owner of the requester Net. + If it is in the rejected, failed, or expired states, it cannot be + deleted. + + :param net_peering_id: The ID of the Net peering connection you + want to delete. (required) + :type net_peering_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteNetPeering" + data = {"DryRun": dry_run} + if net_peering_id is not None: + data.update({"NetPeeringId": net_peering_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_net_peerings( + self, + accepter_net_account_ids: List[str] = None, + accepter_net_ip_ranges: List[str] = None, + accepter_net_net_ids: List[str] = None, + net_peering_ids: List[str] = None, + source_net_account_ids: List[str] = None, + source_net_ip_ranges: List[str] = None, + source_net_net_ids: List[str] = None, + state_messages: List[str] = None, + states_names: List[str] = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + tags: List[str] = None, + dry_run: bool = False, + ): + """ + Lists one or more peering connections between two Nets. + + :param accepter_net_account_ids: The account IDs of the owners of + the peer Nets. + :type accepter_net_account_ids: ``list`` of ``str`` + + :param accepter_net_ip_ranges: The IP ranges of the peer Nets, in + CIDR notation (for example, 10.0.0.0/24). + :type accepter_net_ip_ranges: ``list`` of ``str`` + + :param accepter_net_net_ids: The IDs of the peer Nets. + :type accepter_net_net_ids: ``list`` of ``str`` + + :param source_net_account_ids: The account IDs of the owners of + the peer Nets. + :type source_net_account_ids: ``list`` of ``str`` + + :param source_net_ip_ranges: The IP ranges of the peer Nets. + :type source_net_ip_ranges: ``list`` of ``str`` + + :param source_net_net_ids: The IDs of the peer Nets. + :type source_net_net_ids: ``list`` of ``str`` + + :param net_peering_ids: The IDs of the Net peering connections. + :type net_peering_ids: ``list`` of ``str`` + + :param state_messages: Additional information about the states of + the Net peering connections. + :type state_messages: ``list`` of ``str`` + + :param states_names: The states of the Net peering connections + (pending-acceptance | active | rejected | failed | expired | deleted). + :type states_names: ``list`` of ``str`` + + :param tag_keys: The keys of the tags associated with the Net + peering connections. + :type tag_keys: ``list`` of ``str`` + + :param tag_values: the values of the tags associated with the + Net peering connections. + :type tag_values: ``list`` of ``str`` + + :param tags: The key/value combination of the tags associated + with the Net peering connections, in the following format: + "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. + :type tags: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: A list of Net Access Points + :rtype: ``list`` of ``dict`` + """ + action = "ReadNetPeerings" + data = {"DryRun": dry_run, "Filters": {}} + if accepter_net_account_ids is not None: + data["Filters"].update({"AccepterNetAccountIds": accepter_net_account_ids}) + if accepter_net_ip_ranges is not None: + data["Filters"].update({"AccepterNetIpRanges": accepter_net_ip_ranges}) + if accepter_net_net_ids is not None: + data["Filters"].update({"AccepterNetNetIds": accepter_net_net_ids}) + if source_net_account_ids is not None: + data["Filters"].update({"SourceNetAccountIds": source_net_account_ids}) + if source_net_ip_ranges is not None: + data["Filters"].update({"SourceNetIpRanges": source_net_ip_ranges}) + if source_net_net_ids is not None: + data["Filters"].update({"SourceNetNetIds": source_net_net_ids}) + if net_peering_ids is not None: + data["Filters"].update({"NetPeeringIds": net_peering_ids}) + if state_messages is not None: + data["Filters"].update({"StateMessages": state_messages}) + if states_names is not None: + data["Filters"].update({"StateNames": states_names}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if tag_values is not None: + data["Filters"].update({"TagValues": tag_values}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["NetPeerings"] + return response.json() + + def ex_reject_net_peering( + self, + net_peering_id: List[str] = None, + dry_run: bool = False, + ): + """ + Rejects a Net peering connection request. + The Net peering connection must be in the pending-acceptance state to + be rejected. The rejected Net peering connection is then in the + rejected state. + + :param net_peering_id: The ID of the Net peering connection you + want to reject. (required) + :type net_peering_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The rejected Net Peering + :rtype: ``dict`` + """ + action = "RejectNetPeering" + data = {"DryRun": dry_run} + if net_peering_id is not None: + data.update({"NetPeeringId": net_peering_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_create_nic( + self, + description: str = None, + private_ips_is_primary: List[str] = None, + private_ips: List[str] = None, + security_group_ids: List[str] = None, + subnet_id: str = None, + dry_run: bool = False, + ): + """ + Creates a network interface card (NIC) in the specified Subnet. + + :param description: A description for the NIC. + :type description: ``str`` + + :param private_ips_is_primary: If true, the IP address is the + primary private IP address of the NIC. + :type private_ips_is_primary: ``list`` of ``str`` + + :param private_ips: The private IP addresses of the NIC. + :type private_ips: ``list`` of ``str`` + + :param security_group_ids: One or more IDs of security groups for + the NIC. + :type security_group_ids: ``list`` of ``str`` + + :param subnet_id: The ID of the Subnet in which you want to + create the NIC. (required) + :type subnet_id: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Nic + :rtype: ``dict`` + """ + action = "CreateNic" + data = {"DryRun": dry_run, "PrivatesIps": {}} + if description is not None: + data.update({"Description": description}) + if security_group_ids is not None: + data.update({"SecurityGroupIds": security_group_ids}) + if subnet_id is not None: + data.update({"SubnetId": subnet_id}) + if private_ips is not None and private_ips_is_primary is not None: + for primary, ip in zip(private_ips_is_primary, private_ips): + data["PrivateIps"].update({"IsPrimary": primary, "PrivateIp": ip}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Nic"] + return response.json() + + def ex_link_nic( + self, + device_number: int = None, + nic_id: str = None, + node: str = None, + dry_run: bool = False, + ): + """ + Attaches a network interface card (NIC) to a virtual machine (VM). + The interface and the VM must be in the same Subregion. The VM can be + either running or stopped. The NIC must be in the available state. + + :param nic_id: The ID of the NIC you want to delete. (required) + :type nic_id: ``str`` + + :param device_number: The ID of the NIC you want to delete. + (required) + :type device_number: ``str`` + + :param node: The index of the VM device for the NIC attachment + (between 1 and 7, both included). + :type node: ``Node`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a Link Id + :rtype: ``str`` + """ + action = "LinkNic" + data = {"DryRun": dry_run} + if nic_id is not None: + data.update({"NicId": nic_id}) + if device_number is not None: + data.update({"DeviceNumber": device_number}) + if node: + data.update({"VmId": node}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["LinkNicId"] + return response.json() + + def ex_unlink_nic( + self, + link_nic_id: str = None, + dry_run: bool = False, + ): + """ + Detaches a network interface card (NIC) from a virtual machine (VM). + The primary NIC cannot be detached. + + :param link_nic_id: The ID of the NIC you want to delete. + (required) + :type link_nic_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "UnlinkNic" + data = {"DryRun": dry_run} + if link_nic_id is not None: + data.update({"LinkNicId": link_nic_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_delete_nic( + self, + nic_id: str = None, + dry_run: bool = False, + ): + """ + Deletes the specified network interface card (NIC). + The network interface must not be attached to any virtual machine (VM). + + :param nic_id: The ID of the NIC you want to delete. (required) + :type nic_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteNic" + data = {"DryRun": dry_run} + if nic_id is not None: + data.update({"NicId": nic_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_link_private_ips( + self, + allow_relink: bool = None, + nic_id: str = None, + private_ips: List[str] = None, + secondary_private_ip_count: int = None, + dry_run: bool = False, + ): + """ + Assigns one or more secondary private IP addresses to a specified + network interface card (NIC). This action is only available in a Net. + The private IP addresses to be assigned can be added individually + using the PrivateIps parameter, or you can specify the number of + private IP addresses to be automatically chosen within the Subnet + range using the SecondaryPrivateIpCount parameter. You can specify + only one of these two parameters. If none of these parameters are + specified, a private IP address is chosen within the Subnet range. + + :param allow_relink: If true, allows an IP address that is + already assigned to another NIC in the same Subnet to be assigned + to the NIC you specified. + :type allow_relink: ``str`` + + :param nic_id: The ID of the NIC. (required) + :type nic_id: ``str`` + + :param private_ips: The secondary private IP address or addresses + you want to assign to the NIC within the IP address range of the + Subnet. + :type private_ips: ``list`` of ``str`` + + :param secondary_private_ip_count: The secondary private IP a + address or addresses you want to assign to the NIC within the IP + address range of the Subnet. + :type secondary_private_ip_count: ``int`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return:True if the action is successful + :rtype: ``bool`` + """ + action = "LinkPrivateIps" + data = {"DryRun": dry_run} + if nic_id is not None: + data.update({"NicId": nic_id}) + if allow_relink is not None: + data.update({"AllowRelink": allow_relink}) + if private_ips is not None: + data.update({"PrivateIps": private_ips}) + if secondary_private_ip_count is not None: + data.update({"SecondaryPrivateIpCount": secondary_private_ip_count}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_nics( + self, + link_nic_sort_numbers: List[int] = None, + link_nic_vm_ids: List[str] = None, + nic_ids: List[str] = None, + private_ips_private_ips: List[str] = None, + subnet_ids: List[str] = None, + dry_run: bool = False, + ): + """ + Lists one or more network interface cards (NICs). + A NIC is a virtual network interface that you can attach to a virtual + machine (VM) in a Net. + + :param link_nic_sort_numbers: The device numbers the NICs are + attached to. + :type link_nic_sort_numbers: ``list`` of ``int`` + + :param link_nic_vm_ids: The IDs of the VMs the NICs are attached + to. + :type link_nic_vm_ids: ``list`` of ``str`` + + :param nic_ids: The IDs of the NICs. + :type nic_ids: ``list`` of ``str`` + + :param private_ips_private_ips: The private IP addresses of the + NICs. + :type private_ips_private_ips: ``list`` of ``str`` + + :param subnet_ids: The IDs of the Subnets for the NICs. + :type subnet_ids: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: A list of the Nics + :rtype: ``list`` of ``dict`` + """ + action = "ReadNics" + data = {"DryRun": dry_run, "Filters": {}} + if link_nic_sort_numbers is not None: + data["Filters"].update({"LinkNicSortNumbers": link_nic_sort_numbers}) + if link_nic_vm_ids is not None: + data["Filters"].update({"LinkNicVmIds": link_nic_vm_ids}) + if nic_ids is not None: + data["Filters"].update({"NicIds": nic_ids}) + if private_ips_private_ips is not None: + data["Filters"].update({"PrivateIpsPrivateIps": private_ips_private_ips}) + if subnet_ids is not None: + data["Filters"].update({"SubnetIds": subnet_ids}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Nics"] + return response.json() + + def ex_unlink_private_ips( + self, + nic_id: str = None, + private_ips: List[str] = None, + dry_run: bool = False, + ): + """ + Unassigns one or more secondary private IPs from a network interface + card (NIC). + + :param nic_id: The ID of the NIC. (required) + :type nic_id: ``str`` + + :param private_ips: One or more secondary private IP addresses + you want to unassign from the NIC. (required) + :type private_ips: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "UnlinkPrivateIps" + data = {"DryRun": dry_run} + if nic_id is not None: + data.update({"NicId": nic_id}) + if private_ips is not None: + data.update({"PrivateIps": private_ips}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_update_nic( + self, + description: str = None, + link_nic_delete_on_vm_deletion: str = None, + link_nic_id: str = None, + security_group_ids: List[str] = None, + nic_id: str = None, + dry_run: bool = False, + ): + """ + Modifies the specified network interface card (NIC). You can specify + only one attribute at a time. + + :param description: A new description for the NIC. + :type description: ``str`` + + :param link_nic_delete_on_vm_deletion: If true, the NIC is + deleted when the VM is terminated. + :type link_nic_delete_on_vm_deletion: ``str`` + + :param link_nic_id: The ID of the NIC attachment. + :type link_nic_id: ``str`` + + :param security_group_ids: One or more IDs of security groups + for the NIC. + :type security_group_ids: ``list`` of ``str`` + + :param nic_id: The ID of the NIC you want to modify. (required) + :type nic_id: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Nic + :rtype: ``dict`` + """ + action = "UpdateNic" + data = {"DryRun": dry_run, "LinkNic": {}} + if description is not None: + data.update({"Description": description}) + if security_group_ids is not None: + data.update({"SecurityGroupIds": security_group_ids}) + if nic_id is not None: + data.update({"NicId": nic_id}) + if link_nic_delete_on_vm_deletion is not None: + data["LinkNic"].update({"DeleteOnVmDeletion": link_nic_delete_on_vm_deletion}) + if link_nic_id is not None: + data["LinkNic"].update({"LinkNicId": link_nic_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Nic"] + return response.json() + + def ex_list_product_types( + self, + product_type_ids: List[str] = None, + dry_run: bool = False, + ): + """ + Describes one or more product types. + + :param product_type_ids: The IDs of the product types. + :type product_type_ids: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: A ``list`` of Product Type + :rtype: ``list`` of ``dict`` + """ + action = "ReadProductTypes" + data = {"DryRun": dry_run, "Filters": {}} + if product_type_ids is not None: + data["Filters"].update({"ProductTypeIds": product_type_ids}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ProductTypes"] + return response.json() + + def ex_list_quotas( + self, + collections: List[str] = None, + quota_names: List[str] = None, + quota_types: List[str] = None, + short_descriptions: List[str] = None, + dry_run: bool = False, + ): + """ + Describes one or more of your quotas. + + :param collections: The group names of the quotas. + :type collections: ``list`` of ``str`` + + :param quota_names: The names of the quotas. + :type quota_names: ``list`` of ``str`` + + :param quota_types: The resource IDs if these are + resource-specific quotas, global if they are not. + :type quota_types: ``list`` of ``str`` + + :param short_descriptions: The description of the quotas. + :type short_descriptions: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: A ``list`` of Product Type + :rtype: ``list`` of ``dict`` + """ + action = "ReadQuotas" + data = {"DryRun": dry_run, "Filters": {}} + if collections is not None: + data["Filters"].update({"Collections": collections}) + if quota_names is not None: + data["Filters"].update({"QuotaNames": quota_names}) + if quota_types is not None: + data["Filters"].update({"QuotaTypes": quota_types}) + if short_descriptions is not None: + data["Filters"].update({"ShortDescriptions": short_descriptions}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["QuotaTypes"] + return response.json() + + def ex_create_route( + self, + destination_ip_range: str = None, + gateway_id: str = None, + nat_service_id: str = None, + net_peering_id: str = None, + nic_id: str = None, + route_table_id: str = None, + vm_id: str = None, + dry_run: bool = False, + ): + """ + Creates a route in a specified route table within a specified Net. + You must specify one of the following elements as the target: + + - Net peering connection + - NAT VM + - Internet service + - Virtual gateway + - NAT service + - Network interface card (NIC) + + The routing algorithm is based on the most specific match. + + :param destination_ip_range: The IP range used for the + destination match, in CIDR notation (for example, 10.0.0.0/24). + (required) + :type destination_ip_range: ``str`` + + :param gateway_id: The ID of an Internet service or virtual + gateway attached to your Net. + :type gateway_id: ``str`` + + :param nat_service_id: The ID of a NAT service. + :type nat_service_id: ``str`` + + :param net_peering_id: The ID of a Net peering connection. + :type net_peering_id: ``str`` + + :param nic_id: The ID of a NIC. + :type nic_id: ``str`` + + :param vm_id: The ID of a NAT VM in your Net (attached to exactly + one NIC). + :type vm_id: ``str`` + + :param route_table_id: The ID of the route table for which you + want to create a route. (required) + :type route_table_id: `str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Route + :rtype: ``dict`` + """ + action = "CreateRoute" + data = {"DryRun": dry_run} + if destination_ip_range is not None: + data.update({"DestinationIpRange": destination_ip_range}) + if gateway_id is not None: + data.update({"GatewayId": gateway_id}) + if nat_service_id is not None: + data.update({"NatServiceId": nat_service_id}) + if net_peering_id is not None: + data.update({"NetPeeringId": net_peering_id}) + if nic_id is not None: + data.update({"NicId": nic_id}) + if route_table_id is not None: + data.update({"RouteTableId": route_table_id}) + if vm_id is not None: + data.update({"VmId": vm_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["RouteTable"] + return response.json() + + def ex_delete_route( + self, + destination_ip_range: str = None, + route_table_id: str = None, + dry_run: bool = False, + ): + """ + Deletes a route from a specified route table. + + :param destination_ip_range: The exact IP range for the route. + (required) + :type destination_ip_range: ``str`` + + :param route_table_id: The ID of the route table from which you + want to delete a route. (required) + :type route_table_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteRoute" + data = {"DryRun": dry_run} + if destination_ip_range is not None: + data.update({"DestinationIpRange": destination_ip_range}) + if route_table_id is not None: + data.update({"RouteTableId": route_table_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_update_route( + self, + destination_ip_range: str = None, + gateway_id: str = None, + nat_service_id: str = None, + net_peering_id: str = None, + nic_id: str = None, + route_table_id: str = None, + vm_id: str = None, + dry_run: bool = False, + ): + """ + Replaces an existing route within a route table in a Net. + You must specify one of the following elements as the target: + + - Net peering connection + - NAT virtual machine (VM) + - Internet service + - Virtual gateway + - NAT service + - Network interface card (NIC) + + The routing algorithm is based on the most specific match. + + :param destination_ip_range: The IP range used for the + destination match, in CIDR notation (for example, 10.0.0.0/24). + (required) + :type destination_ip_range: ``str`` + + :param gateway_id: The ID of an Internet service or virtual + gateway attached to your Net. + :type gateway_id: ``str`` + + :param nat_service_id: The ID of a NAT service. + :type nat_service_id: ``str`` + + :param net_peering_id: The ID of a Net peering connection. + :type net_peering_id: ``str`` + + :param nic_id: The ID of a NIC. + :type nic_id: ``str`` + + :param vm_id: The ID of a NAT VM in your Net (attached to exactly + one NIC). + :type vm_id: ``str`` + + :param route_table_id: The ID of the route table for which you + want to create a route. (required) + :type route_table_id: `str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The updated Route + :rtype: ``dict`` + """ + action = "UpdateRoute" + data = {"DryRun": dry_run} + if destination_ip_range is not None: + data.update({"DestinationIpRange": destination_ip_range}) + if gateway_id is not None: + data.update({"GatewayId": gateway_id}) + if nat_service_id is not None: + data.update({"NatServiceId": nat_service_id}) + if net_peering_id is not None: + data.update({"NetPeeringId": net_peering_id}) + if nic_id is not None: + data.update({"NicId": nic_id}) + if route_table_id is not None: + data.update({"RouteTableId": route_table_id}) + if vm_id is not None: + data.update({"VmId": vm_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["RouteTable"] + return response.json() + + def ex_create_route_table( + self, + net_id: str = None, + dry_run: bool = False, + ): + """ + Creates a route table for a specified Net. + You can then add routes and associate this route table with a Subnet. + + :param net_id: The ID of the Net for which you want to create a + route table. + (required) + :type net_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Route Table + :rtype: ``dict`` + """ + action = "CreateRouteTable" + data = {"DryRun": dry_run} + if net_id is not None: + data.update({"NetId": net_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["RouteTable"] + return response.json() + + def ex_delete_route_table( + self, + route_table_id: str = None, + dry_run: bool = False, + ): + """ + Deletes a specified route table. + Before deleting a route table, you must disassociate it from any + Subnet. You cannot delete the main route table. + + :param route_table_id: The ID of the route table you want to + delete. (required) + :type route_table_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteRouteTable" + data = {"DryRun": dry_run} + if route_table_id is not None: + data.update({"RouteTableId": route_table_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_link_route_table( + self, + route_table_id: str = None, + subnet_id: str = None, + dry_run: bool = False, + ): + """ + Associates a Subnet with a route table. + The Subnet and the route table must be in the same Net. The traffic is + routed according to the route table defined within this Net. You can + associate a route table with several Subnets. + + :param route_table_id: The ID of the route table. (required) + :type route_table_id: ``str`` + + :param subnet_id: The ID of the Subnet. (required) + :type subnet_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: Link Route Table Id + :rtype: ``str`` + """ + action = "LinkRouteTable" + data = {"DryRun": dry_run} + if route_table_id is not None: + data.update({"RouteTableId": route_table_id}) + if subnet_id is not None: + data.update({"SubnetId": subnet_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["LinkRouteTableId"] + return response.json() + + def ex_list_route_tables( + self, + link_route_table_ids: List[str] = None, + link_route_table_link_route_table_ids: List[str] = None, + link_route_table_main: bool = None, + link_subnet_ids: List[str] = None, + net_ids: List[str] = None, + route_creation_methods: List[str] = None, + route_destination_ip_ranges: List[str] = None, + route_destination_service_ids: List[str] = None, + route_gateway_ids: List[str] = None, + route_nat_service_ids: List[str] = None, + route_net_peering_ids: List[str] = None, + route_states: List[str] = None, + route_table_ids: List[str] = None, + route_vm_ids: List[str] = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + tags: List[str] = None, + dry_run: bool = False, + ): + """ + Lists one or more of your route tables. + In your Net, each Subnet must be associated with a route table. If a + Subnet is not explicitly associated with a route table, it is + implicitly associated with the main route table of the Net. + + :param link_route_table_ids: The IDs of the route tables involved + in the associations. + :type link_route_table_ids: ``list`` of ``str`` + + :param link_route_table_link_route_table_ids: The IDs of the + associations between the route tables and the Subnets. + :type link_route_table_link_route_table_ids: ``list`` of ``str`` + + :param link_route_table_main: If true, the route tables are the + main ones for their Nets. + :type link_route_table_main: ``bool`` + + :param link_subnet_ids: The IDs of the Subnets involved in the + associations. + :type link_subnet_ids: ``list`` of ``str`` + + :param net_ids: The IDs of the route tables involved + in the associations. + :type net_ids: ``list`` of ``str`` + + :param route_creation_methods: The methods used to create a route. + :type route_creation_methods: ``list`` of ``str`` + + :param route_destination_ip_ranges: The IP ranges specified in + routes in the tables. + :type route_destination_ip_ranges: ``list`` of ``str`` + + :param route_destination_service_ids: The service IDs specified + in routes in the tables. + :type route_destination_service_ids: ``list`` of ``str`` + + :param route_gateway_ids: The IDs of the gateways specified in + routes in the tables. + :type route_gateway_ids: ``list`` of ``str`` + + :param route_nat_service_ids: The IDs of the NAT services + specified in routes in the tables. + :type route_nat_service_ids: ``list`` of ``str`` + + :param route_net_peering_ids: The IDs of the Net peering + connections specified in routes in the tables. + :type route_net_peering_ids: ``list`` of ``str`` + + :param route_states: The states of routes in the route tables + (active | blackhole). The blackhole state indicates that the target + of the route is not available. + :type route_states: ``list`` of ``str`` + + :param route_table_ids: The IDs of the route tables. + :type route_table_ids: ``list`` of ``str`` + + :param route_vm_ids: The IDs of the VMs specified in routes in + the tables. + :type route_vm_ids: ``list`` of ``str`` + + :param tag_keys: The keys of the tags associated with the route + tables. + :type tag_keys: ``list`` of ``str`` + + :param tag_values: The values of the tags associated with the + route tables. + :type tag_values: ``list`` of ``str`` + + :param tags: The key/value combination of the tags associated + with the route tables, in the following format: + "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. + :type tags: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: list of Route Tables + :rtype: ``list`` of ``dict`` + """ + action = "ReadRouteTables" + data = {"DryRun": dry_run, "Filters": {}} + if link_route_table_ids is not None: + data["Filters"].update({"LinkRouteTableIds": link_route_table_ids}) + if link_route_table_link_route_table_ids is not None: + data["Filters"].update( + {"LinkRouteTableLinkRouteTableIds": link_route_table_link_route_table_ids} + ) + if link_route_table_main is not None: + data["Filters"].update({"LinkRouteTableMain": link_route_table_main}) + if link_subnet_ids is not None: + data["Filters"].update({"LinkSubnetIds": link_subnet_ids}) + if net_ids is not None: + data["Filters"].update({"NetIds": net_ids}) + if route_creation_methods is not None: + data["Filters"].update({"RouteCreationMethods": route_creation_methods}) + if route_destination_ip_ranges is not None: + data["Filters"].update({"RouteDestinationIpRanges": route_destination_ip_ranges}) + if route_destination_service_ids is not None: + data["Filters"].update({"RouteDestinationServiceIds": route_destination_service_ids}) + if route_gateway_ids is not None: + data["Filters"].update({"RouteGatewayIds": route_gateway_ids}) + if route_nat_service_ids is not None: + data["Filters"].update({"RouteNatServiceIds": route_nat_service_ids}) + if route_net_peering_ids is not None: + data["Filters"].update({"RouteNetPeeringIds": route_net_peering_ids}) + if route_states is not None: + data["Filters"].update({"RouteStates": route_states}) + if route_table_ids is not None: + data["Filters"].update({"RouteTableIds": route_table_ids}) + if route_vm_ids is not None: + data["Filters"].update({"RouteVmIds": route_vm_ids}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if tag_values is not None: + data["Filters"].update({"TagValues": tag_values}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["RouteTables"] + return response.json() + + def ex_unlink_route_table( + self, + link_route_table_id: str = None, + dry_run: bool = False, + ): + """ + Disassociates a Subnet from a route table. + After disassociation, the Subnet can no longer use the routes in this + route table, but uses the routes in the main route table of the Net + instead. + + :param link_route_table_id: The ID of the route table. (required) + :type link_route_table_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "UnlinkRouteTable" + data = {"DryRun": dry_run} + if link_route_table_id is not None: + data.update({"LinkRouteTableId": link_route_table_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_create_server_certificate( + self, + body: str = None, + chain: str = None, + name: str = None, + path: str = None, + private_key: str = None, + dry_run: bool = False, + ): + """ + Creates a server certificate and its matching private key. + These elements can be used with other services (for example, + to configure SSL termination on load balancers). + You can also specify the chain of intermediate certification + authorities if your certificate is not directly signed by a root one. + You can specify multiple intermediate certification authorities in + the CertificateChain parameter. To do so, concatenate all certificates + in the correct order (the first certificate must be the authority of + your certificate, the second must the the authority of the + first one, and so on). + The private key must be a RSA key in PKCS1 form. To check this, open + the PEM file and ensure its header reads as follows: + BEGIN RSA PRIVATE KEY. + [IMPORTANT] + This private key must not be protected by a password or a passphrase. + + :param body: The PEM-encoded X509 certificate. (required) + :type body: ``str`` + + :param chain: The PEM-encoded intermediate certification + authorities. + :type chain: ``str`` + + :param name: A unique name for the certificate. Constraints: + 1-128 alphanumeric characters, pluses (+), equals (=), commas (,), + periods (.), at signs (@), minuses (-), or underscores (_). (required) + :type name: ``str`` + + :param path: The path to the server certificate, set to a slash + (/) if not specified. + :type path: ``str`` + + :param private_key: The PEM-encoded private key matching + the certificate. (required) + :type private_key: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new server certificate + :rtype: ``dict`` + """ + action = "CreateServerCertificate" + data = {"DryRun": dry_run} + if body is not None: + data.update({"Body": body}) + if chain is not None: + data.update({"Chain": chain}) + if name is not None: + data.update({"Name": name}) + if path is not None: + data.update({"Path": path}) + if private_key is not None: + data.update({"PrivateKey": private_key}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ServerCertificate"] + return response.json() + + def ex_delete_server_certificate(self, name: str = None, dry_run: bool = False): + """ + Deletes a specified server certificate. + + :param name: The name of the server certificate you + want to delete. (required) + :type name: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteServerCertificate" + data = {"DryRun": dry_run} + if name is not None: + data.update({"Name": name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ResponseContext"] + return response.json() + + def ex_list_server_certificates(self, paths: str = None, dry_run: bool = False): + """ + List your server certificates. + + :param paths: The path to the server certificate. + :type paths: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: server certificate + :rtype: ``list`` of ``dict`` + """ + action = "ReadServerCertificates" + data = {"DryRun": dry_run, "Filters": {}} + if paths is not None: + data["Filters"].update({"Paths": paths}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ServerCertificates"] + return response.json() + + def ex_update_server_certificate( + self, + name: str = None, + new_name: str = None, + new_path: str = None, + dry_run: bool = False, + ): + """ + Modifies the name and/or the path of a specified server certificate. + + :param name: The name of the server certificate + you want to modify. + :type name: ``str`` + + :param new_name: A new name for the server certificate. + :type new_name: ``str`` + + :param new_path:A new path for the server certificate. + :type new_path: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: the new server certificate + :rtype: ``dict`` + """ + action = "UpdateServerCertificate" + data = {"DryRun": dry_run} + if name is not None: + data.update({"Name": name}) + if new_name is not None: + data.update({"NewName": new_name}) + if new_path is not None: + data.update({"NewPath": new_path}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ServerCertificate"] + return response.json() + + def ex_create_security_group( + self, + description: str = None, + net_id: str = None, + security_group_name: str = None, + dry_run: bool = False, + ): + """ + Creates a security group. + This action creates a security group either in the public Cloud or in + a specified Net. By default, a default security group for use in the + public Cloud and a default security group for use in a Net are created. + When launching a virtual machine (VM), if no security group is + explicitly specified, the appropriate default security group is + assigned to the VM. Default security groups include a default rule + granting VMs network access to each other. + When creating a security group, you specify a name. Two security + groups for use in the public Cloud or for use in a Net cannot have + the same name. + You can have up to 500 security groups in the public Cloud. You can + create up to 500 security groups per Net. + To add or remove rules, use the ex_create_security_group_rule method. + + :param description: A description for the security group, with a + maximum length of 255 ASCII printable characters. (required) + :type description: ``str`` + + :param net_id: The ID of the Net for the security group. + :type net_id: ``str`` + + :param security_group_name: The name of the security group. + (required) + :type security_group_name: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Security Group + :rtype: ``dict`` + """ + action = "CreateSecurityGroup" + data = {"DryRun": dry_run} + if description is not None: + data.update({"Description": description}) + if net_id is not None: + data.update({"NetId": net_id}) + if security_group_name is not None: + data.update({"SecurityGroupName": security_group_name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["SecurityGroup"] + return response.json() + + def ex_delete_security_group( + self, + security_group_id: str = None, + security_group_name: str = None, + dry_run: bool = False, + ): + """ + Deletes a specified security group. + You can specify either the name of the security group or its ID. + This action fails if the specified group is associated with a virtual + machine (VM) or referenced by another security group. + + :param security_group_id: The ID of the security group you want + to delete. + :type security_group_id: ``str`` + + :param security_group_name: the name of the security group. + :type security_group_name: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteSecurityGroup" + data = {"DryRun": dry_run} + if security_group_id is not None: + data.update({"SecurityGroupId": security_group_id}) + if security_group_name is not None: + data.update({"SecurityGroupName": security_group_name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_security_groups( + self, + account_ids: List[str] = None, + net_ids: List[str] = None, + security_group_ids: List[str] = None, + security_group_names: List[str] = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + tags: List[str] = None, + dry_run: bool = False, + ): + """ + Lists one or more security groups. + You can specify either the name of the security groups or their IDs. + + :param account_ids: The account IDs of the owners of the security + groups. + :type account_ids: ``list`` of ``str`` + + :param net_ids: The IDs of the Nets specified when the security + groups were created. + :type net_ids: ``list`` of ``str`` + + :param security_group_ids: The IDs of the security groups. + :type security_group_ids: ``list`` of ``str`` + + :param security_group_names: The names of the security groups. + :type security_group_names: ``list`` of ``str`` + + :param tag_keys: the keys of the tags associated with the + security groups. + :type tag_keys: ``list`` of ``str`` + + :param tag_values: The values of the tags associated with the + security groups. + :type tag_values: ``list`` of ``str`` + + :param tags: the key/value combination of the tags associated + with the security groups, in the following format: + "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. + :type tags: ``list`` of ``str`` + + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a list of Security Groups + :rtype: ``list`` of ``dict`` + """ + action = "ReadSecurityGroups" + data = {"DryRun": dry_run, "Filters": {}} + if account_ids is not None: + data["Filters"].update({"AccountIds": account_ids}) + if net_ids is not None: + data["Filters"].update({"NetIds": net_ids}) + if security_group_ids is not None: + data["Filters"].update({"SecurityGroupIds": security_group_ids}) + if security_group_names is not None: + data["Filters"].update({"SecurityGroupNames": security_group_names}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if tag_values is not None: + data["Filters"].update({"TagValues": tag_values}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["SecurityGroups"] + return response.json() + + def ex_create_security_group_rule( + self, + flow: str = None, + from_port_range: int = None, + ip_range: str = None, + rules: List[dict] = None, + sg_account_id_to_link: str = None, + sg_id: str = None, + sg_name_to_link: str = None, + to_port_range: int = None, + dry_run: bool = False, + ): + """ + Configures the rules for a security group. + The modifications are effective at virtual machine (VM) level as + quickly as possible, but a small delay may occur. + + You can add one or more egress rules to a security group for use with + a Net. + It allows VMs to send traffic to either one or more destination IP + address ranges or destination security groups for the same Net. + We recommend using a set of IP permissions to authorize outbound + access to a destination security group. We also recommended this + method to create a rule with a specific IP protocol and a specific + port range. In a set of IP permissions, we recommend to specify the + the protocol. + + You can also add one or more ingress rules to a security group. + In the public Cloud, this action allows one or more IP address ranges + to access a security group for your account, or allows one or more + security groups (source groups) to access a security group for your + own 3DS OUTSCALE account or another one. + In a Net, this action allows one or more IP address ranges to access a + security group for your Net, or allows one or more other security + groups (source groups) to access a security group for your Net. All + the security groups must be for the same Net. + + :param flow: The direction of the flow: Inbound or Outbound. + You can specify Outbound for Nets only.type (required) + description: ``bool`` + + :param from_port_range: The beginning of the port range for + the TCP and UDP protocols, or an ICMP type number. + :type from_port_range: ``int`` + + :param ip_range: The name The IP range for the security group + rule, in CIDR notation (for example, 10.0.0.0/16). + :type ip_range: ``str`` + + :param rules: Information about the security group rule to create: + https://docs.outscale.com/api#createsecuritygrouprule + :type rules: ``list`` of ``dict`` + + :param sg_account_id_to_link: The account ID of the + owner of the security group for which you want to create a rule. + :type sg_account_id_to_link: ``str`` + + :param sg_id: The ID of the security group for which + you want to create a rule. (required) + :type sg_id: ``str`` + + :param sg_name_to_link: The ID of the source security + group. If you are in the Public Cloud, you can also specify the name + of the source security group. + :type sg_name_to_link: ``str`` + + :param to_port_range: the end of the port range for the TCP and + UDP protocols, or an ICMP type number. + :type to_port_range: ``int`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Security Group Rule + :rtype: ``dict`` + """ + action = "CreateSecurityGroupRule" + data = {"DryRun": dry_run} + if flow is not None: + data.update({"Flow": flow}) + if from_port_range is not None: + data.update({"FromPortRange": from_port_range}) + if ip_range is not None: + data.update({"IpRange": ip_range}) + if rules is not None: + data.update({"Rules": rules}) + if sg_name_to_link is not None: + data.update({"SecurityGroupNameToLink": sg_name_to_link}) + if sg_id is not None: + data.update({"SecurityGroupId": sg_id}) + if sg_account_id_to_link is not None: + data.update({"SecurityGroupAccountIdToLink": sg_account_id_to_link}) + if to_port_range is not None: + data.update({"ToPortRange": to_port_range}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["SecurityGroup"] + return response.json() + + def ex_delete_security_group_rule( + self, + flow: str = None, + from_port_range: int = None, + ip_protocol: str = None, + ip_range: str = None, + rules: List[dict] = None, + sg_account_id_to_unlink: str = None, + sg_id: str = None, + sg_name_to_unlink: str = None, + to_port_range: int = None, + dry_run: bool = False, + ): + """ + Deletes one or more inbound or outbound rules from a security group. + For the rule to be deleted, the values specified in the deletion + request must exactly match the value of the existing rule. + In case of TCP and UDP protocols, you have to indicate the destination + port or range of ports. In case of ICMP protocol, you have to specify + the ICMP type and code. + Rules (IP permissions) consist of the protocol, IP address range or + source security group. + To remove outbound access to a destination security group, we + recommend to use a set of IP permissions. We also recommend to specify + the protocol in a set of IP permissions. + + :param flow: The direction of the flow: Inbound or Outbound. + You can specify Outbound for Nets only.type (required) + description: ``bool`` + + :param from_port_range: The beginning of the port range for + the TCP and UDP protocols, or an ICMP type number. + :type from_port_range: ``int`` + + :param ip_range: The name The IP range for the security group + rule, in CIDR notation (for example, 10.0.0.0/16). + :type ip_range: ``str`` + + :param ip_protocol: The IP protocol name (tcp, udp, icmp) or + protocol number. By default, -1, which means all protocols. + :type ip_protocol: ``str`` + + :param rules: Information about the security group rule to create: + https://docs.outscale.com/api#createsecuritygrouprule + :type rules: ``list`` of ``dict`` + + :param sg_account_id_to_unlink: The account ID of the + owner of the security group for which you want to delete a rule. + :type sg_account_id_to_unlink: ``str`` + + :param sg_id: The ID of the security group for which + you want to delete a rule. (required) + :type sg_id: ``str`` + + :param sg_name_to_unlink: The ID of the source security + group. If you are in the Public Cloud, you can also specify the name + of the source security group. + :type sg_name_to_unlink: ``str`` + + :param to_port_range: the end of the port range for the TCP and + UDP protocols, or an ICMP type number. + :type to_port_range: ``int`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Security Group Rule + :rtype: ``dict`` + """ + action = "DeleteSecurityGroupRule" + data = {"DryRun": dry_run} + if flow is not None: + data.update({"Flow": flow}) + if ip_protocol is not None: + data.update({"IpProtocol": ip_protocol}) + if from_port_range is not None: + data.update({"FromPortRange": from_port_range}) + if ip_range is not None: + data.update({"IpRange": ip_range}) + if rules is not None: + data.update({"Rules": rules}) + if sg_name_to_unlink is not None: + data.update({"SecurityGroupNameToUnlink": sg_name_to_unlink}) + if sg_id is not None: + data.update({"SecurityGroupId": sg_id}) + if sg_account_id_to_unlink is not None: + data.update({"SecurityGroupAccountIdToUnlink": sg_account_id_to_unlink}) + if to_port_range is not None: + data.update({"ToPortRange": to_port_range}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["SecurityGroup"] + return response.json() + + def ex_create_virtual_gateway(self, connection_type: str = None, dry_run: bool = False): + """ + Creates a virtual gateway. + A virtual gateway is the access point on the Net + side of a VPN connection. + + :param connection_type: The type of VPN connection supported + by the virtual gateway (only ipsec.1 is supported). (required) + :type connection_type: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new virtual gateway + :rtype: ``dict`` + """ + action = "CreateVirtualGateway" + data = {"DryRun": dry_run} + if connection_type is not None: + data.update({"ConnectionType": connection_type}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["VirtualGateway"] + return response.json() + + def ex_delete_virtual_gateway(self, virtual_gateway_id: str = None, dry_run: bool = False): + """ + Deletes a specified virtual gateway. + Before deleting a virtual gateway, we + recommend to detach it from the Net and delete the VPN connection. + + :param virtual_gateway_id: The ID of the virtual gateway + you want to delete. (required) + :type virtual_gateway_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteVirtualGateway" + data = {"DryRun": dry_run} + if virtual_gateway_id is not None: + data.update({"VirtualGatewayId": virtual_gateway_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_link_virtual_gateway( + self, net_id: str = None, virtual_gateway_id: str = None, dry_run: bool = False + ): + """ + Attaches a virtual gateway to a Net. + + :param net_id: The ID of the Net to which you want to attach + the virtual gateway. (required) + :type net_id: ``str`` + + :param virtual_gateway_id: The ID of the virtual + gateway. (required) + :type virtual_gateway_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: + :rtype: ``dict`` + """ + action = "LinkVirtualGateway" + data = {"DryRun": dry_run} + if net_id is not None: + data.update({"NetId": net_id}) + if virtual_gateway_id is not None: + data.update({"VirtualGatewayId": virtual_gateway_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["NetToVirtualGatewayLink"] + return response.json() + + def ex_list_virtual_gateways( + self, + connection_types: List[str] = None, + link_net_ids: List[str] = None, + link_states: List[str] = None, + states: List[str] = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + tags: List[str] = None, + virtual_gateway_id: List[str] = None, + dry_run: bool = False, + ): + """ + Lists one or more virtual gateways. + + :param connection_types: The types of the virtual gateways + (only ipsec.1 is supported). + :type connection_types: ``list`` of ``dict`` + + :param link_net_ids: The IDs of the Nets the virtual gateways + are attached to. + :type link_net_ids: ``list`` of ``dict`` + + :param link_states: The current states of the attachments + between the virtual gateways and the Nets + (attaching | attached | detaching | detached). + :type link_states: ``list`` of ``dict`` + + :param states: The states of the virtual gateways + (pending | available | deleting | deleted). + :type states: ``list`` of ``dict`` + + :param tag_keys: The keys of the tags associated with the + virtual gateways. + :type tag_keys: ``list`` of ``dict`` + + :param tag_values: The values of the tags associated with + the virtual gateways. + :type tag_values: ``list`` of ``dict`` + + :param tags: The key/value combination of the tags associated + with the virtual gateways, in the following format: + "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. + :type tags: ``list`` of ``dict`` + + :param virtual_gateway_id: The IDs of the virtual gateways. + :type virtual_gateway_id: ``list`` of ``dict`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: list of virtual gateway + :rtype: ``list`` of ``dict`` + """ + action = "ReadVirtualGateways" + data = {"Filters": {}, "DryRun": dry_run} + if connection_types is not None: + data["Filters"].update({"ConnectionTypes": connection_types}) + if link_net_ids is not None: + data["Filters"].update({"LinkNetIds": link_net_ids}) + if link_states is not None: + data["Filters"].update({"LinkStates": link_states}) + if states is not None: + data["Filters"].update({"States": states}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if tag_values is not None: + data["Filters"].update({"TagValues": tag_values}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + if virtual_gateway_id is not None: + data["Filters"].update({"VirtualGatewayIds": virtual_gateway_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["VirtualGateways"] + return response.json() + + def ex_unlink_virtual_gateway( + self, net_id: str = None, virtual_gateway_id: str = None, dry_run: bool = False + ): + """ + Detaches a virtual gateway from a Net. + You must wait until the virtual gateway is in the detached state + before you can attach another Net to it or delete the Net it was + previously attached to. + + :param net_id: The ID of the Net from which you want to detach + the virtual gateway. (required) + :type net_id: ``str`` + + :param virtual_gateway_id: The ID of the Net from which you + want to detach the virtual gateway. (required) + :type virtual_gateway_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "UnlinkVirtualGateway" + data = {"DryRun": dry_run} + if net_id is not None: + data.update({"NetId": net_id}) + if virtual_gateway_id is not None: + data.update({"VirtualGatewayId": virtual_gateway_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_update_route_propagation( + self, + enable: bool = None, + route_table_id: str = None, + virtual_gateway_id: str = None, + dry_run: bool = False, + ): + """ + Configures the propagation of routes to a specified route table + of a Net by a virtual gateway. + + :param enable: If true, a virtual gateway can propagate routes + to a specified route table of a Net. If false, + the propagation is disabled. (required) + :type enable: ``boolean`` + + :param route_table_id: The ID of the route table. (required) + :type route_table_id: ``str`` + + :param virtual_gateway_id: The ID of the virtual + gateway. (required) + :type virtual_gateway_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: route propagation + :rtype: ``dict`` + """ + action = "UpdateRoutePropagation" + data = {"DryRun": dry_run} + if enable is not None: + data.update({"Enable": enable}) + if route_table_id is not None: + data.update({"RouteTableId": route_table_id}) + if virtual_gateway_id is not None: + data.update({"VirtualGatewayId": virtual_gateway_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["RouteTable"] + return response.json() + + def ex_delete_subnet( + self, + subnet_id: str = None, + dry_run: bool = False, + ): + """ + Deletes a specified Subnet. + You must terminate all the running virtual machines (VMs) in the + Subnet before deleting it. + + :param subnet_id: The ID of the Subnet you want to delete. + (required) + :type subnet_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteSubnet" + data = {"DryRun": dry_run} + if subnet_id is not None: + data.update({"SubnetId": subnet_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_update_subnet( + self, + subnet_id: str = None, + map_public_ip_on_launch: bool = None, + dry_run: bool = False, + ): + """ + Deletes a specified Subnet. + You must terminate all the running virtual machines (VMs) in the + Subnet before deleting it. + + :param subnet_id: The ID of the Subnet you want to delete. + (required) + :type subnet_id: ``str`` + + :param map_public_ip_on_launch: If true, a public IP address is + assigned to the network interface cards (NICs) created in the s + specified Subnet. (required) + :type map_public_ip_on_launch: ``bool`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The updated Subnet + :rtype: ``dict`` + """ + action = "UpdateSubnet" + data = {"DryRun": dry_run} + if subnet_id is not None: + data.update({"SubnetId": subnet_id}) + if map_public_ip_on_launch is not None: + data.update({"MapPublicIpOnLaunch": map_public_ip_on_launch}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Subnet"] + return response.json() + + def ex_list_subnets( + self, + available_ip_counts: List[str] = None, + ip_ranges: List[str] = None, + net_ids: List[str] = None, + states: List[str] = None, + subnet_ids: List[str] = None, + subregion_names: List[str] = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + tags: List[str] = None, + dry_run: bool = False, + ): + """ + Lists one or more of your Subnets. + If you do not specify any Subnet ID, this action describes all of + your Subnets. + + + :param available_ip_counts: The number of available IPs. + :type available_ip_counts: ``str`` + + :param ip_ranges: The IP ranges in the Subnets, in CIDR notation + (for example, 10.0.0.0/16). + :type ip_ranges: ``str`` + + :param net_ids: The IDs of the Nets in which the Subnets are. + :type net_ids: ``str`` + + :param states: The states of the Subnets (pending | available). + :type states: ``str`` + + :param subnet_ids: The IDs of the Subnets. + :type subnet_ids: ``str`` + + :param subregion_names: The names of the Subregions in which the + Subnets are located. + :type subregion_names: ``str`` + + :param tag_keys: the keys of the tags associated with the + subnets. + :type tag_keys: ``list`` of ``str`` + + :param tag_values: The values of the tags associated with the + subnets. + :type tag_values: ``list`` of ``str`` + + :param tags: the key/value combination of the tags associated + with the subnets, in the following format: + "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. + :type tags: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a list of Subnets + :rtype: ``list`` of ``dict`` + """ + action = "ReadSubnets" + data = {"DryRun": dry_run, "Filters": {}} + if available_ip_counts is not None: + data["Filters"].update({"AvailableIpsCounts": available_ip_counts}) + if ip_ranges is not None: + data["Filters"].update({"IpRanges": ip_ranges}) + if net_ids is not None: + data["Filters"].update({"NetIds": net_ids}) + if states is not None: + data["Filters"].update({"States": states}) + if subnet_ids is not None: + data["Filters"].update({"SubetIds": subnet_ids}) + if subregion_names is not None: + data["Filters"].update({"SubregionNames": subregion_names}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if tag_values is not None: + data["Filters"].update({"TagValues": tag_values}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Subnets"] + return response.json() + + def ex_create_subnet( + self, + ip_range: str = None, + net_id: str = None, + subregion_name: str = None, + dry_run: bool = False, + ): + """ + Creates a Subnet in an existing Net. + To create a Subnet in a Net, you have to provide the ID of the Net and + the IP range for the Subnet (its network range). Once the Subnet is + created, you cannot modify its IP range. + The IP range of the Subnet can be either the same as the Net one if + you create only a single Subnet in this Net, or a subset of the Net + one. In case of several Subnets in a Net, their IP ranges must not + overlap. The smallest Subnet you can create uses a /30 netmask + (four IP addresses). + + :param ip_range: The IP range in the Subnet, in CIDR notation + (for example, 10.0.0.0/16). (required) + :type ip_range: ``str`` + + :param net_id: The ID of the Net for which you want to create a + Subnet. (required) + :type net_id: ``str`` + + :param subregion_name: the name of the Subregion in which you + want to create the Subnet. + :type subregion_name: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Subnet + :rtype: ``dict`` + """ + action = "CreateSubnet" + data = {"DryRun": dry_run} + if ip_range is not None: + data.update({"IpRange": ip_range}) + if net_id is not None: + data.update({"NetId": net_id}) + if subregion_name is not None: + data.update({"SubregionName": subregion_name}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Subnet"] + return response.json() + + def ex_delete_export_task( + self, + export_task_id: str = None, + dry_run: bool = False, + ): + """ + Deletes an export task. + If the export task is not running, the command fails and an error is + returned. + + :param export_task_id: The ID of the export task to delete. + (required) + :type export_task_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteExportTask" + data = {"DryRun": dry_run} + if export_task_id is not None: + data.update({"ExportTaskId": export_task_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_create_vpn_connection( + self, + client_gateway_id: str = None, + connection_type: str = None, + static_routes_only: bool = None, + virtual_gateway_id: str = None, + dry_run: bool = False, + ): + """ + Creates a VPN connection between a specified virtual gateway and a + specified client gateway. + You can create only one VPN connection between a virtual gateway and + a client gateway. + + :param client_gateway_id: The ID of the client gateway. (required) + :type client_gateway_id: ``str`` + + :param connection_type: The type of VPN connection (only ipsec.1 + is supported). (required) + :type connection_type: ``str`` + + :param static_routes_only: If false, the VPN connection uses + dynamic routing with Border Gateway Protocol (BGP). If true, routing + is controlled using static routes. For more information about how to + create and delete static routes, see CreateVpnConnectionRoute: + https://docs.outscale.com/api#createvpnconnectionroute and + DeleteVpnConnectionRoute: + https://docs.outscale.com/api#deletevpnconnectionroute + :type static_routes_only: ``bool`` + + :param virtual_gateway_id: The ID of the virtual gateway. + (required) + :type virtual_gateway_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: The new Vpn Connection + :rtype: ``dict`` + """ + action = "CreateVpnConnection" + data = {"DryRun": dry_run} + if client_gateway_id is not None: + data.update({"ClientGatewayId": client_gateway_id}) + if connection_type is not None: + data.update({"ConnectionType": connection_type}) + if static_routes_only is not None: + data.update({"StaticRoutesOnly": static_routes_only}) + if virtual_gateway_id is not None: + data.update({"StaticRoutesOnly": virtual_gateway_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["VpnConnection"] + return response.json() + + def ex_create_vpn_connection_route( + self, + destination_ip_range: str = None, + vpn_connection_id: str = None, + dry_run: bool = False, + ): + """ + Creates a static route to a VPN connection. + This enables you to select the network flows sent by the virtual + gateway to the target VPN connection. + + :param destination_ip_range: The network prefix of the route, in + CIDR notation (for example, 10.12.0.0/16).(required) + :type destination_ip_range: ``str`` + + :param vpn_connection_id: The ID of the target VPN connection of + the static route. (required) + :type vpn_connection_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "CreateVpnConnectionRoute" + data = {"DryRun": dry_run} + if destination_ip_range is not None: + data.update({"DestinationIpRange": destination_ip_range}) + if vpn_connection_id is not None: + data.update({"VpnConnectionId": vpn_connection_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_delete_vpn_connection( + self, + vpn_connection_id: str = None, + dry_run: bool = False, + ): + """ + Deletes a specified VPN connection. + If you want to delete a Net and all its dependencies, we recommend to + detach the virtual gateway from the Net and delete the Net before + deleting the VPN connection. This enables you to delete the Net + without waiting for the VPN connection to be deleted. + + :param vpn_connection_id: the ID of the VPN connection you want + to delete. + (required) + :type vpn_connection_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteVpnConnection" + data = {"DryRun": dry_run} + if vpn_connection_id is not None: + data.update({"VpnConnectionId": vpn_connection_id}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_delete_vpn_connection_route( + self, + vpn_connection_id: str = None, + destination_ip_range: str = None, + dry_run: bool = False, + ): + """ + Deletes a specified VPN connection. + If you want to delete a Net and all its dependencies, we recommend to + detach the virtual gateway from the Net and delete the Net before + deleting the VPN connection. This enables you to delete the Net + without waiting for the VPN connection to be deleted. + + :param vpn_connection_id: the ID of the VPN connection you want + to delete. + (required) + :type vpn_connection_id: ``str`` + + :param destination_ip_range: The network prefix of the route to + delete, in CIDR notation (for example, 10.12.0.0/16). (required) + :type destination_ip_range: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: True if the action is successful + :rtype: ``bool`` + """ + action = "DeleteVpnConnectionRoute" + data = {"DryRun": dry_run} + if vpn_connection_id is not None: + data.update({"VpnConnectionId": vpn_connection_id}) + if destination_ip_range is not None: + data.update({"DestinationIpRange": destination_ip_range}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_list_vpn_connections( + self, + bgp_asns: List[int] = None, + client_gateway_ids: List[str] = None, + connection_types: List[str] = None, + route_destination_ip_ranges: List[str] = None, + states: List[str] = None, + static_routes_only: bool = None, + tag_keys: List[str] = None, + tag_values: List[str] = None, + tags: List[str] = None, + dry_run: bool = False, + ): + """ + Describes one or more VPN connections. + + :param bgp_asns: The Border Gateway Protocol (BGP) Autonomous + System Numbers (ASNs) of the connections. + :type bgp_asns: ``list`` of ``int`` + + :param client_gateway_ids: The IDs of the client gateways. + :type client_gateway_ids: ``list`` of ``str`` + + :param connection_types: The types of the VPN connections (only + ipsec.1 is supported). + :type connection_types: ``list`` of ``str`` + + :param states: The states of the vpn connections + (pending | available). + :type states: ``str`` + + :param route_destination_ip_ranges: The destination IP ranges. + :type route_destination_ip_ranges: ``str`` + + :param static_routes_only: If false, the VPN connection uses + dynamic routing with Border Gateway Protocol (BGP). If true, routing + is controlled using static routes. For more information about how to + create and delete static routes, see CreateVpnConnectionRoute: + https://docs.outscale.com/api#createvpnconnectionroute and + DeleteVpnConnectionRoute: + https://docs.outscale.com/api#deletevpnconnectionroute + :type static_routes_only: ``bool`` + + :param tag_keys: the keys of the tags associated with the + subnets. + :type tag_keys: ``list`` of ``str`` + + :param tag_values: The values of the tags associated with the + subnets. + :type tag_values: ``list`` of ``str`` + + :param tags: the key/value combination of the tags associated + with the subnets, in the following format: + "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. + :type tags: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a list of Subnets + :rtype: ``list`` of ``dict`` + """ + action = "ReadVpnConnections" + data = {"DryRun": dry_run, "Filters": {}} + if bgp_asns is not None: + data["Filters"].update({"BgpAsns": bgp_asns}) + if client_gateway_ids is not None: + data["Filters"].update({"ClientGatewayIds": client_gateway_ids}) + if connection_types is not None: + data["Filters"].update({"ConnectionTypes": connection_types}) + if states is not None: + data["Filters"].update({"States": states}) + if route_destination_ip_ranges is not None: + data["Filters"].update({"RouteDestinationIpRanges": route_destination_ip_ranges}) + if static_routes_only is not None: + data["Filters"].update({"StaticRoutesOnly": static_routes_only}) + if tag_keys is not None: + data["Filters"].update({"TagKeys": tag_keys}) + if tag_values is not None: + data["Filters"].update({"TagValues": tag_values}) + if tags is not None: + data["Filters"].update({"Tags": tags}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["VpnConnections"] + return response.json() + + def ex_create_certificate_authority( + self, ca_perm: str, description: str = None, dry_run: bool = False + ): + """ + Creates a Client Certificate Authority (CA). + + :param ca_perm: The CA in PEM format. (required) + :type ca_perm: ``str`` + + :param description: The description of the CA. + :type description: ``bool`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: the created Ca. + :rtype: ``dict`` + """ + action = "CreateCa" + data = {"DryRun": dry_run, "CaPerm": ca_perm} + if description is not None: + data.update({"Description": description}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Ca"] + return response.json() + + def ex_delete_certificate_authority(self, ca_id: str, dry_run: bool = False): + """ + Deletes a specified Client Certificate Authority (CA). + + :param ca_id: The ID of the CA you want to delete. (required) + :type ca_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + """ + action = "DeleteCa" + data = {"DryRun": dry_run, "CaId": ca_id} + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_read_certificate_authorities( + self, + ca_fingerprints: List[str] = None, + ca_ids: List[str] = None, + descriptions: List[str] = None, + dry_run: bool = False, + ): + """ + Returns information about one or more of your Client Certificate + Authorities (CAs). + + :param ca_fingerprints: The fingerprints of the CAs. + :type ca_fingerprints: ``list`` of ``str`` + + :param ca_ids: The IDs of the CAs. + :type ca_ids: ``list`` of ``str`` + + :param descriptions: The descriptions of the CAs. + :type descriptions: ``list`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a list of all Ca matching filled filters. + :rtype: ``list`` of ``dict`` + """ + action = "ReadCas" + data = {"DryRun": dry_run, "Filters": {}} + if ca_fingerprints is not None: + data["Filters"].update({"CaFingerprints": ca_fingerprints}) + if ca_ids is not None: + data["Filters"].update({"CaIds": ca_ids}) + if descriptions is not None: + data["Filters"].update({"Descriptions": descriptions}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Cas"] + return response.json() + + def ex_update_certificate_authority( + self, ca_id: str, description: str = None, dry_run: bool = False + ): + """ + Modifies the specified attribute of a Client Certificate Authority + (CA). + + :param ca_id: The ID of the CA. (required) + :type ca_id: ``str`` + + :param description: The description of the CA. + :type description: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a the created Ca or the request result. + :rtype: ``dict`` + """ + action = "UpdateCa" + data = {"DryRun": dry_run, "CaId": ca_id} + if description is not None: + data.update({"Description": description}) + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["Ca"] + return response.json() + + def ex_create_api_access_rule( + self, + description: str = None, + ip_ranges: List[str] = None, + ca_ids: List[str] = None, + cns: List[str] = None, + dry_run: bool = False, + ): + """ + Create an API access rule. + It is a rule to allow access to the API from your account. + You need to specify at least the CaIds or the IpRanges parameter. + + :param description: The description of the new rule. + :type description: ``str`` + + :param ip_ranges: One or more IP ranges, in CIDR notation + (for example, 192.0.2.0/16). + :type ip_ranges: ``List`` of ``str`` + + :param ca_ids: One or more IDs of Client Certificate Authorities + (CAs). + :type ca_ids: ``List`` of ``str`` + + :param cns: One or more Client Certificate Common Names (CNs). + If this parameter is specified, you must also specify the ca_ids + parameter. + :type cns: ``List`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a dict containing the API access rule created. + :rtype: ``dict`` + """ + + if not ca_ids and not ip_ranges: + raise ValueError("Either ca_ids or ip_ranges argument must be provided.") + + action = "CreateApiAccessRule" + data = {"DryRun": dry_run} + if description is not None: + data["Description"] = description + if ip_ranges is not None: + data["IpRanges"] = ip_ranges + if ca_ids is not None: + data["CaIds"] = ca_ids + if cns is not None: + data["Cns"] = cns + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ApiAccessRule"] + return response.json() + + def ex_delete_api_access_rule( + self, + api_access_rule_id: str, + dry_run: bool = False, + ): + """ + Delete an API access rule. + You cannot delete the last remaining API access rule. + + :param api_access_rule_id: The id of the targeted rule + (required). + :type api_access_rule_id: ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: true if successful. + :rtype: ``bool`` if successful or ``dict`` + """ + action = "DeleteApiAccessRule" + data = {"ApiAccessRuleId": api_access_rule_id, "DryRun": dry_run} + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return True + return response.json() + + def ex_read_api_access_rules( + self, + api_access_rules_ids: List[str] = None, + ca_ids: List[str] = None, + cns: List[str] = None, + descriptions: List[str] = None, + ip_ranges: List[str] = None, + dry_run: bool = False, + ): + """ + Read API access rules. + + :param api_access_rules_ids: The List containing rules ids to + filter the request. + :type api_access_rules_ids: ``List`` of ``str`` + + :param ca_ids: The List containing CA ids to filter the request. + :type ca_ids: ``List`` of ``str`` + + :param cns: The List containing cns to filter the request. + :type cns: ``List`` of ``str`` + + :param descriptions: The List containing descriptions to filter + the request. + :type descriptions: ``List`` of ``str`` + + :param ip_ranges: The List containing ip ranges in CIDR notation + (for example, 192.0.2.0/16) to filter the request. + :type ip_ranges: ``List`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a List of API access rules. + :rtype: ``List`` of ``dict`` if successful or ``dict`` + """ + + action = "ReadApiAccessRules" + filters = {} + if api_access_rules_ids is not None: + filters["ApiAccessRulesIds"] = api_access_rules_ids + if ca_ids is not None: + filters["CaIds"] = ca_ids + if cns is not None: + filters["Cns"] = cns + if descriptions is not None: + filters["Descriptions"] = descriptions + if ip_ranges is not None: + filters["IpRanges"] = ip_ranges + data = {"Filters": filters, "DryRun": dry_run} + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ApiAccessRules"] + return response.json() + + def ex_update_api_access_rule( + self, + api_access_rule_id: str, + ca_ids: List[str] = None, + cns: List[str] = None, + description: str = None, + ip_ranges: List[str] = None, + dry_run: bool = False, + ): + """ + Update an API access rules. + The new rule you specify fully replaces the old rule. Therefore, + for a parameter that is not specified, any previously set value + is deleted. + + :param api_access_rule_id: The id of the rule we want to update + (required). + :type api_access_rule_id: ``str`` + + :param ca_ids: One or more IDs of Client Certificate Authorities + (CAs). + :type ca_ids: ``List`` of ``str`` + + :param cns: One or more Client Certificate Common Names (CNs). + If this parameter is specified, you must also specify the ca_ids + parameter. + :type cns: ``List`` of ``str`` + + :param description: The description of the new rule. + :type description: ``str`` + + :param ip_ranges: One or more IP ranges, in CIDR notation + (for example, 192.0.2.0/16). + :type ip_ranges: ``List`` of ``str`` + + :param dry_run: If true, checks whether you have the required + permissions to perform the action. + :type dry_run: ``bool`` + + :return: a List of API access rules. + :rtype: ``List`` of ``dict`` if successful or ``dict`` + """ + + action = "UpdateApiAccessRule" + data = {"DryRun": dry_run, "ApiAccessRuleId": api_access_rule_id} + if description is not None: + data["Description"] = description + if ip_ranges is not None: + data["IpRanges"] = ip_ranges + if ca_ids is not None: + data["CaIds"] = ca_ids + if cns is not None: + data["Cns"] = cns + response = self._call_api(action, json.dumps(data)) + if response.status_code == 200: + return response.json()["ApiAccessRules"] + return response.json() + + def _get_outscale_endpoint(self, region: str, version: str, action: str): + return "https://api.{}.{}/api/{}/{}".format(region, self.base_uri, version, action) + + def _call_api(self, action: str, data: str): + headers = self._ex_generate_headers(action, data) + endpoint = self._get_outscale_endpoint(self.region, self.version, action) + return requests.post(endpoint, data=data, headers=headers) + + def _ex_generate_headers(self, action: str, data: str): + return self.signer.get_request_headers( + action=action, data=data, service_name=self.service_name, region=self.region + ) + + def _to_location(self, location): + country = location["Name"].split(", ")[1] + return NodeLocation( + id=location["Code"], + name=location["Name"], + country=country, + driver=self, + extra=location, + ) + + def _to_locations(self, locations: list): + return [self._to_location(location) for location in locations] + + def _to_snapshot(self, snapshot): + name = None + for tag in snapshot["Tags"]: + if tag["Key"] == "Name": + name = tag["Value"] + return VolumeSnapshot( + id=snapshot["SnapshotId"], + name=name, + size=snapshot["VolumeSize"], + driver=self, + state=snapshot["State"], + created=None, + extra=snapshot, + ) + + def _to_snapshots(self, snapshots): + return [self._to_snapshot(snapshot) for snapshot in snapshots] + + def _to_volume(self, volume): + name = "" + for tag in volume["Tags"]: + if tag["Key"] == "Name": + name = tag["Value"] + return StorageVolume( + id=volume["VolumeId"], + name=name, + size=volume["Size"], + driver=self, + state=volume["State"], + extra=volume, + ) + + def _to_volumes(self, volumes): + return [self._to_volume(volume) for volume in volumes] + + def _to_node(self, vm): + name = "" + private_ips = [] + if "PrivateIp" in vm: + private_ips = [vm["PrivateIp"]] + public_ips = [] + if "PublicIp" in vm: + public_ips = [vm["PublicIp"]] + for tag in vm["Tags"]: + if tag["Key"] == "Name": + name = tag["Value"] + + return Node( + id=vm["VmId"], + name=name, + state=self.NODE_STATE[vm["State"]], + public_ips=public_ips, + private_ips=private_ips, + driver=self, + extra=vm, + ) + + def _to_nodes(self, vms: list): + return [self._to_node(vm) for vm in vms] + + def _to_node_image(self, image): + name = "" + for tag in image["Tags"]: + if tag["Key"] == "Name": + name = tag["Value"] + return NodeImage(id=image["ImageId"], name=name, driver=self, extra=image) + + def _to_node_images(self, node_images: list): + return [self._to_node_image(node_image) for node_image in node_images] + + def _to_key_pairs(self, key_pairs): + return [self._to_key_pair(key_pair) for key_pair in key_pairs] + + def _to_key_pair(self, key_pair): + private_key = "" + if "PrivateKey" in key_pair: + private_key = key_pair["PrivateKey"] + return KeyPair( + name=key_pair["KeypairName"], + public_key="", + private_key=private_key, + fingerprint=key_pair["KeypairFingerprint"], + driver=self, + ) diff --git a/libcloud/compute/drivers/ovh.py b/libcloud/compute/drivers/ovh.py new file mode 100644 index 0000000000..cb86ed0ec2 --- /dev/null +++ b/libcloud/compute/drivers/ovh.py @@ -0,0 +1,679 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Ovh driver +""" + +from libcloud.utils.py3 import httplib +from libcloud.common.ovh import API_ROOT, OvhConnection +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, + VolumeSnapshot, +) +from libcloud.compute.types import Provider, StorageVolumeState, VolumeSnapshotState +from libcloud.utils.publickey import get_pubkey_comment, get_pubkey_ssh2_fingerprint +from libcloud.common.exceptions import BaseHTTPError +from libcloud.compute.drivers.openstack import OpenStackKeyPair, OpenStackNodeDriver + + +class OvhNodeDriver(NodeDriver): + """ + Libcloud driver for the Ovh API + + For more information on the Ovh API, read the official reference: + + https://api.ovh.com/console/ + """ + + type = Provider.OVH + name = "Ovh" + website = "https://www.ovh.com/" + connectionCls = OvhConnection + features = {"create_node": ["ssh_key"]} + api_name = "ovh" + + NODE_STATE_MAP = OpenStackNodeDriver.NODE_STATE_MAP + VOLUME_STATE_MAP = OpenStackNodeDriver.VOLUME_STATE_MAP + SNAPSHOT_STATE_MAP = OpenStackNodeDriver.SNAPSHOT_STATE_MAP + + def __init__(self, key, secret, ex_project_id, ex_consumer_key=None, region=None): + """ + Instantiate the driver with the given API credentials. + + :param key: Your application key (required) + :type key: ``str`` + + :param secret: Your application secret (required) + :type secret: ``str`` + + :param ex_project_id: Your project ID + :type ex_project_id: ``str`` + + :param ex_consumer_key: Your consumer key (required) + :type ex_consumer_key: ``str`` + + :param region: The datacenter to connect to (optional) + :type region: ``str`` + + :rtype: ``None`` + """ + self.region = region + self.project_id = ex_project_id + self.consumer_key = ex_consumer_key + NodeDriver.__init__(self, key, secret, ex_consumer_key=ex_consumer_key, region=region) + + def _get_project_action(self, suffix): + base_url = "{}/cloud/project/{}/".format(API_ROOT, self.project_id) + + return base_url + suffix + + @classmethod + def list_regions(cls): + return ["eu", "ca"] + + def list_nodes(self, location=None): + """ + List all nodes. + + :keyword location: Location (region) used as filter + :type location: :class:`NodeLocation` + + :return: List of node objects + :rtype: ``list`` of :class:`Node` + """ + action = self._get_project_action("instance") + data = {} + + if location: + data["region"] = location.id + response = self.connection.request(action, data=data) + + return self._to_nodes(response.object) + + def ex_get_node(self, node_id): + """ + Get a individual node. + + :keyword node_id: Node's ID + :type node_id: ``str`` + + :return: Created node + :rtype : :class:`Node` + """ + action = self._get_project_action("instance/%s" % node_id) + response = self.connection.request(action, method="GET") + + return self._to_node(response.object) + + def create_node(self, name, size, image, location=None, auth=None, ex_keyname=None): + """ + Create a new node + + @inherits: :class:`NodeDriver.create_node` + + :keyword auth: SSH key to use for the new node. If the key is not + already available in the location, it will be imported. + :type auth: :class:`NodeAuthSSHKey` + + :keyword ex_keyname: Name of SSH key used + :type ex_keyname: ``str`` + + :return: Created node + :rtype : :class:`Node` + """ + action = self._get_project_action("instance") + data = { + "name": name, + "imageId": image.id, + "flavorId": size.id, + "region": location.id, + } + if auth and ex_keyname: + raise AttributeError("Cannot specify auth and ex_keyname together") + + if auth: + auth = self._get_and_check_auth(auth) + # pylint: disable=no-member + key = self.ex_find_or_import_keypair_by_key_material(location, auth.pubkey) + data["sshKeyId"] = key["keyId"] + + elif ex_keyname: + key_id = self.get_key_pair(ex_keyname, location).extra["id"] + data["sshKeyId"] = key_id + response = self.connection.request(action, data=data, method="POST") + + return self._to_node(response.object) + + def ex_find_or_import_keypair_by_key_material(self, location, pubkey): + """ + Find an SSH key in a location by its public key material, or import it. + + :param location: Location (region) where the key should be searched for + or imported. + :type location: :class:`NodeLocation` + + :param pubkey: Public key material, such as an OpenSSH public key. + :type pubkey: ``str`` + + :return: Key name and ID for the matching or imported key pair. + :rtype: ``dict`` + + :raises BaseHTTPError: If the OVH API rejects the import request for a + reason other than an existing duplicate key. + """ + key_fingerprint = get_pubkey_ssh2_fingerprint(pubkey) + key_pairs = self.list_key_pairs(ex_location=location) + for key_pair in key_pairs: + if get_pubkey_ssh2_fingerprint(key_pair.public_key) == key_fingerprint: + return {"keyName": key_pair.name, "keyId": key_pair.extra["id"]} + + key_comment = get_pubkey_comment(pubkey, default="unnamed") + key_name = "{}-{}".format(key_comment, key_fingerprint.replace(":", "-")) + try: + key_pair = self.import_key_pair_from_string(key_name, pubkey, ex_location=location) + except BaseHTTPError as e: + if e.code != httplib.CONFLICT: + raise + + for key_pair in self.list_key_pairs(ex_location=location): + if get_pubkey_ssh2_fingerprint(key_pair.public_key) == key_fingerprint: + return {"keyName": key_pair.name, "keyId": key_pair.extra["id"]} + raise + + return {"keyName": key_pair.name, "keyId": key_pair.extra["id"]} + + def destroy_node(self, node): + action = self._get_project_action("instance/%s" % node.id) + self.connection.request(action, method="DELETE") + + return True + + def list_sizes(self, location=None): + action = self._get_project_action("flavor") + params = {} + + if location: + params["region"] = location.id + response = self.connection.request(action, params=params) + + return self._to_sizes(response.object) + + def ex_get_size(self, size_id): + """ + Get an individual size (flavor). + + :keyword size_id: Size's ID + :type size_id: ``str`` + + :return: Size + :rtype: :class:`NodeSize` + """ + action = self._get_project_action("flavor/%s" % size_id) + response = self.connection.request(action) + + return self._to_size(response.object) + + def list_images(self, location=None, ex_size=None): + """ + List available images + + :keyword location: Location (region) used as filter + :type location: :class:`NodeLocation` + + :keyword ex_size: Exclude images which are incompatible with given size + :type ex_size: :class:`NodeImage` + + :return: List of images + :rtype : ``list`` of :class:`NodeImage` + """ + action = self._get_project_action("image") + params = {} + + if location: + params["region"] = location.id + + if ex_size: + params["flavorId"] = ex_size.id + response = self.connection.request(action, params=params) + + return self._to_images(response.object) + + def get_image(self, image_id): + action = self._get_project_action("image/%s" % image_id) + response = self.connection.request(action) + + return self._to_image(response.object) + + def list_locations(self): + action = self._get_project_action("region") + data = self.connection.request(action) + + return self._to_locations(data.object) + + def list_key_pairs(self, ex_location=None): + """ + List available SSH public keys. + + :keyword ex_location: Location (region) used as filter + :type ex_location: :class:`NodeLocation` + + :return: Public keys + :rtype: ``list``of :class:`KeyPair` + """ + action = self._get_project_action("sshkey") + params = {} + + if ex_location: + params["region"] = ex_location.id + response = self.connection.request(action, params=params) + + return self._to_key_pairs(response.object) + + def get_key_pair(self, name, ex_location=None): + """ + Get an individual SSH public key by its name and location. + + :param name: Name of the key pair to retrieve. + :type name: ``str`` + + :keyword ex_location: Key's region + :type ex_location: :class:`NodeLocation` + + :return: Public key + :rtype: :class:`KeyPair` + """ + # Keys are indexed with ID + keys = [key for key in self.list_key_pairs(ex_location) if key.name == name] + + if not keys: + raise Exception("No key named '%s'" % name) + + return keys[0] + + def import_key_pair_from_string( + self, + name, + key_material, + ex_location=None, + ): + """ + Import a new public key from string. + + :param name: Key pair name. + :type name: ``str`` + + :param key_material: Public key material. + :type key_material: ``str`` + + :param ex_location: Location where to store the key + :type ex_location: :class:`NodeLocation` + + :return: Imported key pair object. + :rtype: :class:`KeyPair` + """ + action = self._get_project_action("sshkey") + data = {"name": name, "publicKey": key_material, "region": ex_location.id} + response = self.connection.request(action, data=data, method="POST") + + return self._to_key_pair(response.object) + + def delete_key_pair(self, key_pair): + action = self._get_project_action("sshkey/%s" % key_pair.extra["id"]) + params = {"keyId": key_pair.extra["id"]} + self.connection.request(action, params=params, method="DELETE") + + return True + + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + ex_volume_type="classic", + ex_description=None, + ): + """ + Create a volume. + + :param size: Size of volume to create (in GB). + :type size: ``int`` + + :param name: Name of volume to create + :type name: ``str`` + + :param location: Location to create the volume in + :type location: :class:`NodeLocation` or ``None`` + + :param snapshot: Snapshot from which to create the new + volume. (optional) + :type snapshot: :class:`.VolumeSnapshot` + + :keyword ex_volume_type: ``'classic'`` or ``'high-speed'`` + :type ex_volume_type: ``str`` + + :keyword ex_description: Optional description of volume + :type ex_description: str + + :return: Storage Volume object + :rtype: :class:`StorageVolume` + """ + action = self._get_project_action("volume") + data = { + "name": name, + "region": location.id, + "size": size, + "type": ex_volume_type, + } + + if ex_description: + data["description"] = ex_description + response = self.connection.request(action, data=data, method="POST") + + return self._to_volume(response.object) + + def destroy_volume(self, volume): + action = self._get_project_action("volume/%s" % volume.id) + self.connection.request(action, method="DELETE") + + return True + + def list_volumes(self, ex_location=None): + """ + Return a list of volumes. + + :keyword ex_location: Location used to filter + :type ex_location: :class:`NodeLocation` or ``None`` + + :return: A list of volume objects. + :rtype: ``list`` of :class:`StorageVolume` + """ + action = self._get_project_action("volume") + data = {} + + if ex_location: + data["region"] = ex_location.id + response = self.connection.request(action, data=data) + + return self._to_volumes(response.object) + + def ex_get_volume(self, volume_id): + """ + Return a Volume object based on a volume ID. + + :param volume_id: The ID of the volume + :type volume_id: ``int`` + + :return: A StorageVolume object for the volume + :rtype: :class:`StorageVolume` + """ + action = self._get_project_action("volume/%s" % volume_id) + response = self.connection.request(action) + + return self._to_volume(response.object) + + def attach_volume(self, node, volume, device=None): + """ + Attach a volume to a node. + + :param node: Node where to attach volume + :type node: :class:`Node` + + :param volume: The ID of the volume + :type volume: :class:`StorageVolume` + + :param device: Unused parameter + + :return: True or False representing operation successful + :rtype: ``bool`` + """ + action = self._get_project_action("volume/%s/attach" % volume.id) + data = {"instanceId": node.id, "volumeId": volume.id} + self.connection.request(action, data=data, method="POST") + + return True + + def detach_volume(self, volume, ex_node=None): + """ + Detach a volume to a node. + + :param volume: The ID of the volume + :type volume: :class:`StorageVolume` + + :param ex_node: Node to detach from (optional if volume is attached + to only one node) + :type ex_node: :class:`Node` + + :return: True or False representing operation successful + :rtype: ``bool`` + + :raises: Exception: If ``ex_node`` is not provided and more than one + node is attached to the volume + """ + action = self._get_project_action("volume/%s/detach" % volume.id) + + if ex_node is None: + if len(volume.extra["attachedTo"]) != 1: + err_msg = ( + "Volume '%s' has more or less than one attached" "nodes, you must specify one." + ) + raise Exception(err_msg) + ex_node = self.ex_get_node(volume.extra["attachedTo"][0]) + data = {"instanceId": ex_node.id} + self.connection.request(action, data=data, method="POST") + + return True + + def ex_list_snapshots(self, location=None): + """ + List all snapshots. + + :keyword location: Location used to filter + :type location: :class:`NodeLocation` or ``None`` + + :rtype: ``list`` of :class:`VolumeSnapshot` + """ + action = self._get_project_action("volume/snapshot") + params = {} + + if location: + params["region"] = location.id + response = self.connection.request(action, params=params) + + return self._to_snapshots(response.object) + + def ex_get_volume_snapshot(self, snapshot_id): + """ + Returns a single volume snapshot. + + :param snapshot_id: Node to run the task on. + :type snapshot_id: ``str`` + + :rtype :class:`.VolumeSnapshot`: + :return: Volume snapshot. + """ + action = self._get_project_action("volume/snapshot/%s" % snapshot_id) + response = self.connection.request(action) + + return self._to_snapshot(response.object) + + def list_volume_snapshots(self, volume): + action = self._get_project_action("volume/snapshot") + params = {"region": volume.extra["region"]} + response = self.connection.request(action, params=params) + snapshots = self._to_snapshots(response.object) + + return [snap for snap in snapshots if snap.extra["volume_id"] == volume.id] + + def create_volume_snapshot(self, volume, name=None, ex_description=None): + """ + Create snapshot from volume + + :param volume: Instance of `StorageVolume` + :type volume: `StorageVolume` + + :param name: Name of snapshot (optional) + :type name: `str` | `NoneType` + + :param ex_description: Description of the snapshot (optional) + :type ex_description: `str` | `NoneType` + + :rtype: :class:`VolumeSnapshot` + """ + action = self._get_project_action("volume/%s/snapshot/" % volume.id) + data = {} + + if name: + data["name"] = name + + if ex_description: + data["description"] = ex_description + response = self.connection.request(action, data=data, method="POST") + + return self._to_snapshot(response.object) + + def destroy_volume_snapshot(self, snapshot): + action = self._get_project_action("volume/snapshot/%s" % snapshot.id) + response = self.connection.request(action, method="DELETE") + + return response.status == httplib.OK + + def ex_get_pricing(self, size_id, subsidiary="US"): + action = "%s/cloud/subsidiaryPrice" % (API_ROOT) + params = {"flavorId": size_id, "ovhSubsidiary": subsidiary} + pricing = self.connection.request(action, params=params).object["instances"][0] + + return { + "hourly": pricing["price"]["value"], + "monthly": pricing["monthlyPrice"]["value"], + } + + def _to_volume(self, obj): + extra = obj.copy() + extra.pop("id") + extra.pop("name") + extra.pop("size") + state = self.VOLUME_STATE_MAP.get(obj.pop("status", None), StorageVolumeState.UNKNOWN) + + return StorageVolume( + id=obj["id"], + name=obj["name"], + size=obj["size"], + state=state, + extra=extra, + driver=self, + ) + + def _to_volumes(self, objs): + return [self._to_volume(obj) for obj in objs] + + def _to_location(self, obj): + return NodeLocation(id=obj, name=obj, country="", driver=self) + + def _to_locations(self, objs): + return [self._to_location(obj) for obj in objs] + + def _to_node(self, obj): + extra = obj.copy() + + if "ipAddresses" in extra: + public_ips = [ip["ip"] for ip in extra["ipAddresses"]] + else: + public_ips = [] + del extra["id"] + del extra["name"] + + return Node( + id=obj["id"], + name=obj["name"], + state=self.NODE_STATE_MAP[obj["status"]], + public_ips=public_ips, + private_ips=[], + driver=self, + extra=extra, + ) + + def _to_nodes(self, objs): + return [self._to_node(obj) for obj in objs] + + def _to_size(self, obj): + extra = {"vcpus": obj["vcpus"], "type": obj["type"], "region": obj["region"]} + + return NodeSize( + id=obj["id"], + name=obj["name"], + ram=obj["ram"], + disk=obj["disk"], + bandwidth=obj["outboundBandwidth"], + price=None, + driver=self, + extra=extra, + ) + + def _to_sizes(self, objs): + return [self._to_size(obj) for obj in objs] + + def _to_image(self, obj): + extra = {"region": obj["region"], "visibility": obj["visibility"]} + + return NodeImage(id=obj["id"], name=obj["name"], driver=self, extra=extra) + + def _to_images(self, objs): + return [self._to_image(obj) for obj in objs] + + def _to_key_pair(self, obj): + extra = {"regions": obj["regions"], "id": obj["id"]} + + return OpenStackKeyPair( + name=obj["name"], + public_key=obj["publicKey"], + driver=self, + fingerprint=None, + extra=extra, + ) + + def _to_key_pairs(self, objs): + return [self._to_key_pair(obj) for obj in objs] + + def _to_snapshot(self, obj): + extra = { + "volume_id": obj["volumeId"], + "region": obj["region"], + "description": obj["description"], + "status": obj["status"], + } + state = self.SNAPSHOT_STATE_MAP.get(obj["status"], VolumeSnapshotState.UNKNOWN) + snapshot = VolumeSnapshot( + id=obj["id"], + driver=self, + size=obj["size"], + extra=extra, + created=obj["creationDate"], + state=state, + name=obj["name"], + ) + + return snapshot + + def _to_snapshots(self, objs): + return [self._to_snapshot(obj) for obj in objs] + + def _ex_connection_class_kwargs(self): + return {"ex_consumer_key": self.consumer_key, "region": self.region} diff --git a/libcloud/compute/drivers/profitbricks.py b/libcloud/compute/drivers/profitbricks.py deleted file mode 100644 index fa33f0ce73..0000000000 --- a/libcloud/compute/drivers/profitbricks.py +++ /dev/null @@ -1,1485 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""ProfitBricks Compute driver -""" -import base64 - -import copy -import time - -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - -from libcloud.utils.networking import is_private_subnet -from libcloud.utils.py3 import b -from libcloud.compute.providers import Provider -from libcloud.common.base import ConnectionUserAndKey, XmlResponse -from libcloud.compute.base import Node, NodeDriver, NodeLocation, NodeSize -from libcloud.compute.base import NodeImage, StorageVolume -from libcloud.compute.base import UuidMixin -from libcloud.compute.types import NodeState -from libcloud.common.types import LibcloudError, MalformedResponseError - -__all__ = [ - 'API_VERSION', - 'API_HOST', - 'ProfitBricksNodeDriver', - 'Datacenter', - 'ProfitBricksNetworkInterface', - 'ProfitBricksAvailabilityZone' -] - -API_HOST = 'api.profitbricks.com' -API_VERSION = '/1.3/' - - -class ProfitBricksResponse(XmlResponse): - """ - ProfitBricks response parsing. - """ - def parse_error(self): - try: - body = ET.XML(self.body) - except: - raise MalformedResponseError('Failed to parse XML', - body=self.body, - driver=ProfitBricksNodeDriver) - - for e in body.findall('.//detail'): - if ET.iselement(e[0].find('httpCode')): - http_code = e[0].find('httpCode').text - else: - http_code = None - if ET.iselement(e[0].find('faultCode')): - fault_code = e[0].find('faultCode').text - else: - fault_code = None - if ET.iselement(e[0].find('message')): - message = e[0].find('message').text - else: - message = None - - return LibcloudError('HTTP Code: %s, Fault Code: %s, Message: %s' % - (http_code, fault_code, message), driver=self) - - -class ProfitBricksConnection(ConnectionUserAndKey): - """ - Represents a single connection to the ProfitBricks endpoint. - """ - host = API_HOST - api_prefix = API_VERSION - responseCls = ProfitBricksResponse - - def add_default_headers(self, headers): - headers['Content-Type'] = 'text/xml' - headers['Authorization'] = 'Basic %s' % (base64.b64encode( - b('%s:%s' % (self.user_id, self.key))).decode('utf-8')) - - return headers - - def encode_data(self, data): - soap_env = ET.Element('soapenv:Envelope', { - 'xmlns:soapenv': 'http://schemas.xmlsoap.org/soap/envelope/', - 'xmlns:ws': 'http://ws.api.profitbricks.com/' - }) - ET.SubElement(soap_env, 'soapenv:Header') - soap_body = ET.SubElement(soap_env, 'soapenv:Body') - soap_req_body = ET.SubElement(soap_body, 'ws:%s' % (data['action'])) - - if 'request' in data.keys(): - soap_req_body = ET.SubElement(soap_req_body, 'request') - for key, value in data.items(): - if key not in ['action', 'request']: - child = ET.SubElement(soap_req_body, key) - child.text = value - else: - for key, value in data.items(): - if key != 'action': - child = ET.SubElement(soap_req_body, key) - child.text = value - - soap_post = ET.tostring(soap_env) - - return soap_post - - def request(self, action, params=None, data=None, headers=None, - method='POST', raw=False): - action = self.api_prefix + action - - return super(ProfitBricksConnection, self).request(action=action, - params=params, - data=data, - headers=headers, - method=method, - raw=raw) - - -class Datacenter(UuidMixin): - """ - Class which stores information about ProfitBricks datacenter - instances. - - :param id: The datacenter ID. - :type id: ``str`` - - :param name: The datacenter name. - :type name: ``str`` - - :param version: Datacenter version. - :type version: ``str`` - - - Note: This class is ProfitBricks specific. - """ - def __init__(self, id, name, version, driver, extra=None): - self.id = str(id) - self.name = name - self.version = version - self.driver = driver - self.extra = extra or {} - UuidMixin.__init__(self) - - def __repr__(self): - return (( - ' ...>') - % (self.id, self.name, self.version, - self.driver.name)) - - -class ProfitBricksNetworkInterface(object): - """ - Class which stores information about ProfitBricks network - interfaces. - - :param id: The network interface ID. - :type id: ``str`` - - :param name: The network interface name. - :type name: ``str`` - - :param state: The network interface name. - :type state: ``int`` - - Note: This class is ProfitBricks specific. - """ - def __init__(self, id, name, state, extra=None): - self.id = id - self.name = name - self.state = state - self.extra = extra or {} - - def __repr__(self): - return (('') - % (self.id, self.name)) - - -class ProfitBricksAvailabilityZone(object): - """ - Extension class which stores information about a ProfitBricks - availability zone. - - Note: This class is ProfitBricks specific. - """ - - def __init__(self, name): - self.name = name - - def __repr__(self): - return (('') - % (self.name)) - - -class ProfitBricksNodeDriver(NodeDriver): - """ - Base ProfitBricks node driver. - """ - connectionCls = ProfitBricksConnection - name = 'ProfitBricks' - website = 'http://www.profitbricks.com' - type = Provider.PROFIT_BRICKS - - PROVISIONING_STATE = { - 'INACTIVE': NodeState.PENDING, - 'INPROCESS': NodeState.PENDING, - 'AVAILABLE': NodeState.RUNNING, - 'DELETED': NodeState.TERMINATED, - } - - NODE_STATE_MAP = { - 'NOSTATE': NodeState.UNKNOWN, - 'RUNNING': NodeState.RUNNING, - 'BLOCKED': NodeState.STOPPED, - 'PAUSE': NodeState.STOPPED, - 'SHUTDOWN': NodeState.PENDING, - 'SHUTOFF': NodeState.STOPPED, - 'CRASHED': NodeState.STOPPED, - } - - REGIONS = { - '1': {'region': 'us/las', 'country': 'USA'}, - '2': {'region': 'de/fra', 'country': 'DEU'}, - '3': {'region': 'de/fkb', 'country': 'DEU'}, - } - - AVAILABILITY_ZONE = { - '1': {'name': 'AUTO'}, - '2': {'name': 'ZONE_1'}, - '3': {'name': 'ZONE_2'}, - } - - """ - ProfitBricks is unique in that they allow the user to define all aspects - of the instance size, i.e. disk size, core size, and memory size. - - These are instance types that match up with what other providers support. - - You can configure disk size, core size, and memory size using the ex_ - parameters on the create_node method. - """ - - PROFIT_BRICKS_GENERIC_SIZES = { - '1': { - 'id': '1', - 'name': 'Micro', - 'ram': 1024, - 'disk': 50, - 'cores': 1 - }, - '2': { - 'id': '2', - 'name': 'Small Instance', - 'ram': 2048, - 'disk': 50, - 'cores': 1 - }, - '3': { - 'id': '3', - 'name': 'Medium Instance', - 'ram': 4096, - 'disk': 50, - 'cores': 2 - }, - '4': { - 'id': '4', - 'name': 'Large Instance', - 'ram': 7168, - 'disk': 50, - 'cores': 4 - }, - '5': { - 'id': '5', - 'name': 'ExtraLarge Instance', - 'ram': 14336, - 'disk': 50, - 'cores': 8 - }, - '6': { - 'id': '6', - 'name': 'Memory Intensive Instance Medium', - 'ram': 28672, - 'disk': 50, - 'cores': 4 - }, - '7': { - 'id': '7', - 'name': 'Memory Intensive Instance Large', - 'ram': 57344, - 'disk': 50, - 'cores': 8 - } - } - - """ - Core Functions - """ - - def list_sizes(self): - """ - Lists all sizes - - :rtype: ``list`` of :class:`NodeSize` - """ - sizes = [] - - for key, values in self.PROFIT_BRICKS_GENERIC_SIZES.items(): - node_size = self._to_node_size(values) - sizes.append(node_size) - - return sizes - - def list_images(self): - """ - List all images. - - :rtype: ``list`` of :class:`NodeImage` - """ - - action = 'getAllImages' - body = {'action': action} - - return self._to_images(self.connection.request(action=action, - data=body, method='POST').object) - - def list_locations(self): - """ - List all locations. - """ - locations = [] - - for key, values in self.REGIONS.items(): - location = self._to_location(values) - locations.append(location) - - return locations - - def list_nodes(self): - """ - List all nodes. - - :rtype: ``list`` of :class:`Node` - """ - action = 'getAllServers' - body = {'action': action} - - return self._to_nodes(self.connection.request(action=action, - data=body, method='POST').object) - - def reboot_node(self, node): - """ - Reboots the node. - - :rtype: ``bool`` - """ - action = 'resetServer' - body = {'action': action, - 'serverId': node.id - } - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - def create_node(self, name, image, size=None, volume=None, - ex_datacenter=None, ex_internet_access=True, - ex_availability_zone=None, ex_ram=None, - ex_cores=None, ex_disk=None, **kwargs): - """ - Creates a node. - - image is optional as long as you pass ram, cores, and disk - to the method. ProfitBricks allows you to adjust compute - resources at a much more granular level. - - :param volume: If the volume already exists then pass this in. - :type volume: :class:`StorageVolume` - - :param ex_datacenter: If you've already created the DC then pass - it in. - :type ex_datacenter: :class:`Datacenter` - - :param ex_internet_access: Configure public Internet access. - :type ex_internet_access: : ``bool`` - - :param ex_availability_zone: The availability zone. - :type ex_availability_zone: class: `ProfitBricksAvailabilityZone` - - :param ex_ram: The amount of ram required. - :type ex_ram: : ``int`` - - :param ex_cores: The number of cores required. - :type ex_cores: : ``int`` - - :param ex_disk: The amount of disk required. - :type ex_disk: : ``int`` - - :return: Instance of class ``Node`` - :rtype: :class:`Node` - """ - if not ex_datacenter: - ''' - We generate a name from the server name passed into the function. - ''' - - 'Creating a Datacenter for the node since one was not provided.' - new_datacenter = self._create_new_datacenter_for_node(name=name) - datacenter_id = new_datacenter.id - - 'Waiting for the Datacenter create operation to finish.' - self._wait_for_datacenter_state(datacenter=new_datacenter) - else: - datacenter_id = ex_datacenter.id - new_datacenter = None - - if not size: - if not ex_ram: - raise ValueError('You need to either pass a ' - 'NodeSize or specify ex_ram as ' - 'an extra parameter.') - if not ex_cores: - raise ValueError('You need to either pass a ' - 'NodeSize or specify ex_cores as ' - 'an extra parameter.') - - if not volume: - if not size: - if not ex_disk: - raise ValueError('You need to either pass a ' - 'StorageVolume, a NodeSize, or specify ' - 'ex_disk as an extra parameter.') - - ''' - You can override the suggested sizes by passing in unique - values for ram, cores, and disk allowing you to size it - for your specific use. - ''' - - if not ex_disk: - ex_disk = size.disk - - if not ex_ram: - ex_ram = size.ram - - if not ex_cores: - ex_cores = size.extra['cores'] - - ''' - A pasword is automatically generated if it is - not provided. This is then sent via email to - the admin contact on record. - ''' - - if 'auth' in kwargs: - auth = self._get_and_check_auth(kwargs["auth"]) - password = auth.password - else: - password = None - - ''' - Create a StorageVolume that can be attached to the - server when it is created. - ''' - if not volume: - volume = self._create_node_volume(ex_disk=ex_disk, - image=image, - password=password, - name=name, - ex_datacenter=ex_datacenter, - new_datacenter=new_datacenter) - - storage_id = volume.id - - 'Waiting on the storage volume to be created before provisioning ' - 'the instance.' - self._wait_for_storage_volume_state(volume) - else: - if ex_datacenter: - datacenter_id = ex_datacenter.id - else: - datacenter_id = volume.extra['datacenter_id'] - - storage_id = volume.id - - action = 'createServer' - body = {'action': action, - 'request': 'true', - 'serverName': name, - 'cores': str(ex_cores), - 'ram': str(ex_ram), - 'bootFromStorageId': storage_id, - 'internetAccess': str(ex_internet_access).lower(), - 'dataCenterId': datacenter_id - } - - if ex_availability_zone: - body['availabilityZone'] = ex_availability_zone.name - - data = self.connection.request(action=action, - data=body, - method='POST').object - nodes = self._to_nodes(data) - return nodes[0] - - def destroy_node(self, node, ex_remove_attached_disks=False): - """ - Destroys a node. - - :param node: The node you wish to destroy. - :type volume: :class:`Node` - - :param ex_remove_attached_disks: True to destroy all attached volumes. - :type ex_remove_attached_disks: : ``bool`` - - :rtype: : ``bool`` - """ - action = 'deleteServer' - body = {'action': action, - 'serverId': node.id - } - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - """ - Volume Functions - """ - - def list_volumes(self): - """ - Lists all voumes. - """ - action = 'getAllStorages' - body = {'action': action} - - return self._to_volumes(self.connection.request(action=action, - data=body, - method='POST').object) - - def attach_volume(self, node, volume, device=None, ex_bus_type=None): - """ - Attaches a volume. - - :param volume: The volume you're attaching. - :type volume: :class:`StorageVolume` - - :param node: The node to which you're attaching the volume. - :type node: :class:`Node` - - :param device: The device number order. - :type device: : ``int`` - - :param ex_bus_type: Bus type. Either IDE or VIRTIO (default). - :type ex_bus_type: ``str`` - - :return: Instance of class ``StorageVolume`` - :rtype: :class:`StorageVolume` - """ - action = 'connectStorageToServer' - body = {'action': action, - 'request': 'true', - 'storageId': volume.id, - 'serverId': node.id, - 'busType': ex_bus_type, - 'deviceNumber': str(device) - } - - self.connection.request(action=action, - data=body, method='POST').object - return volume - - def create_volume(self, size, name=None, - ex_datacenter=None, ex_image=None, ex_password=None): - """ - Creates a volume. - - :param ex_datacenter: The datacenter you're placing - the storage in. (req) - :type ex_datacenter: :class:`Datacenter` - - :param ex_image: The OS image for the volume. - :type ex_image: :class:`NodeImage` - - :param ex_password: Optional password for root. - :type ex_password: : ``str`` - - :return: Instance of class ``StorageVolume`` - :rtype: :class:`StorageVolume` - """ - action = 'createStorage' - body = {'action': action, - 'request': 'true', - 'size': str(size), - 'storageName': name, - 'mountImageId': ex_image.id - } - - if ex_datacenter: - body['dataCenterId'] = ex_datacenter.id - - if ex_password: - body['profitBricksImagePassword'] = ex_password - - data = self.connection.request(action=action, - data=body, - method='POST').object - volumes = self._to_volumes(data) - return volumes[0] - - def detach_volume(self, volume): - """ - Detaches a volume. - - :param volume: The volume you're detaching. - :type volume: :class:`StorageVolume` - - :rtype: :``bool`` - """ - node_id = volume.extra['server_id'] - - action = 'disconnectStorageFromServer' - body = {'action': action, - 'storageId': volume.id, - 'serverId': node_id - } - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - def destroy_volume(self, volume): - """ - Destroys a volume. - - :param volume: The volume you're attaching. - :type volume: :class:`StorageVolume` - - :rtype: : ``bool`` - """ - action = 'deleteStorage' - body = {'action': action, - 'storageId': volume.id} - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - def ex_update_volume(self, volume, storage_name=None, size=None): - """ - Updates a volume. - - :param volume: The volume you're attaching.. - :type volume: :class:`StorageVolume` - - :param storage_name: The name of the volume. - :type storage_name: : ``str`` - - :param size: The desired size. - :type size: ``int`` - - :rtype: : ``bool`` - """ - action = 'updateStorage' - body = {'action': action, - 'request': 'true', - 'storageId': volume.id - } - - if storage_name: - body['storageName'] = storage_name - if size: - body['size'] = str(size) - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - def ex_describe_volume(self, volume_id): - """ - Describes a volume. - - :param volume_id: The ID of the volume you're describing. - :type volume_id: :class:`StorageVolume` - - :return: Instance of class ``StorageVolume`` - :rtype: :class:`StorageVolume` - """ - action = 'getStorage' - body = {'action': action, - 'storageId': volume_id - } - - data = self.connection.request(action=action, - data=body, - method='POST').object - volumes = self._to_volumes(data) - return volumes[0] - - """ - Extension Functions - """ - - ''' Server Extension Functions - ''' - def ex_stop_node(self, node): - """ - Stops a node. - - This also dealloctes the public IP space. - - :param node: The node you wish to halt. - :type node: :class:`Node` - - :rtype: : ``bool`` - """ - action = 'stopServer' - body = {'action': action, - 'serverId': node.id - } - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - def ex_start_node(self, node): - """ - Starts a volume. - - :param node: The node you wish to start. - :type node: :class:`Node` - - :rtype: : ``bool`` - """ - action = 'startServer' - body = {'action': action, - 'serverId': node.id - } - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - def ex_list_availability_zones(self): - """ - Returns a list of availability zones. - """ - - availability_zones = [] - - for key, values in self.AVAILABILITY_ZONE.items(): - name = copy.deepcopy(values)["name"] - - availability_zone = ProfitBricksAvailabilityZone( - name=name - ) - availability_zones.append(availability_zone) - - return availability_zones - - def ex_describe_node(self, node): - """ - Describes a node. - - :param node: The node you wish to describe. - :type node: :class:`Node` - - :return: Instance of class ``Node`` - :rtype: :class:`Node` - """ - action = 'getServer' - body = {'action': action, - 'serverId': node.id - } - - data = self.connection.request(action=action, - data=body, - method='POST').object - nodes = self._to_nodes(data) - return nodes[0] - - def ex_update_node(self, node, name=None, cores=None, - ram=None, availability_zone=None): - """ - Updates a node. - - :param cores: The number of CPUs the node should have. - :type device: : ``int`` - - :param ram: The amount of ram the machine should have. - :type ram: : ``int`` - - :param ex_availability_zone: Update the availability zone. - :type ex_availability_zone: :class:`ProfitBricksAvailabilityZone` - - :rtype: : ``bool`` - """ - action = 'updateServer' - - body = {'action': action, - 'request': 'true', - 'serverId': node.id - } - - if name: - body['serverName'] = name - - if cores: - body['cores'] = str(cores) - - if ram: - body['ram'] = str(ram) - - if availability_zone: - body['availabilityZone'] = availability_zone.name - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - ''' - Datacenter Extension Functions - ''' - - def ex_create_datacenter(self, name, location): - """ - Creates a datacenter. - - ProfitBricks has a concept of datacenters. - These represent buckets into which you - can place various compute resources. - - :param name: The DC name. - :type name: : ``str`` - - :param location: The DC region. - :type location: : ``str`` - - :return: Instance of class ``Datacenter`` - :rtype: :class:`Datacenter` - """ - action = 'createDataCenter' - - body = {'action': action, - 'request': 'true', - 'dataCenterName': name, - 'location': location.lower() - } - data = self.connection.request(action=action, - data=body, - method='POST').object - datacenters = self._to_datacenters(data) - return datacenters[0] - - def ex_destroy_datacenter(self, datacenter): - """ - Destroys a datacenter. - - :param datacenter: The DC you're destroying. - :type datacenter: :class:`Datacenter` - - :rtype: : ``bool`` - """ - action = 'deleteDataCenter' - body = {'action': action, - 'dataCenterId': datacenter.id - } - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - def ex_describe_datacenter(self, datacenter_id): - """ - Describes a datacenter. - - :param datacenter_id: The DC you are describing. - :type datacenter_id: ``str`` - - :return: Instance of class ``Datacenter`` - :rtype: :class:`Datacenter` - """ - - action = 'getDataCenter' - body = {'action': action, - 'dataCenterId': datacenter_id - } - - data = self.connection.request(action=action, - data=body, - method='POST').object - datacenters = self._to_datacenters(data) - return datacenters[0] - - def ex_list_datacenters(self): - """ - Lists all datacenters. - - :return: ``list`` of class ``Datacenter`` - :rtype: :class:`Datacenter` - """ - action = 'getAllDataCenters' - body = {'action': action} - - return self._to_datacenters(self.connection.request( - action=action, - data=body, - method='POST').object) - - def ex_rename_datacenter(self, datacenter, name): - """ - Update a datacenter. - - :param datacenter: The DC you are renaming. - :type datacenter: :class:`Datacenter` - - :param name: The DC name. - :type name: : ``str`` - - :rtype: : ``bool`` - """ - action = 'updateDataCenter' - body = {'action': action, - 'request': 'true', - 'dataCenterId': datacenter.id, - 'dataCenterName': name - } - - self.connection.request(action=action, - data=body, - method='POST').object - - return True - - def ex_clear_datacenter(self, datacenter): - """ - Clear a datacenter. - - This removes all objects in a DC. - - :param datacenter: The DC you're clearing. - :type datacenter: :class:`Datacenter` - - :rtype: : ``bool`` - """ - action = 'clearDataCenter' - body = {'action': action, - 'dataCenterId': datacenter.id - } - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - ''' - Network Interface Extension Functions - ''' - - def ex_list_network_interfaces(self): - """ - Lists all network interfaces. - - :return: ``list`` of class ``ProfitBricksNetworkInterface`` - :rtype: :class:`ProfitBricksNetworkInterface` - """ - action = 'getAllNic' - body = {'action': action} - - return self._to_interfaces( - self.connection.request(action=action, - data=body, - method='POST').object) - - def ex_describe_network_interface(self, network_interface): - """ - Describes a network interface. - - :param network_interface: The NIC you wish to describe. - :type network_interface: :class:`ProfitBricksNetworkInterface` - - :return: Instance of class ``ProfitBricksNetworkInterface`` - :rtype: :class:`ProfitBricksNetworkInterface` - """ - action = 'getNic' - body = {'action': action, - 'nicId': network_interface.id - } - - return self._to_interface( - self.connection.request( - action=action, - data=body, - method='POST').object.findall('.//return')[0]) - - def ex_create_network_interface(self, node, - lan_id=None, ip=None, nic_name=None, - dhcp_active=True): - """ - Creates a network interface. - - :param lan_id: The ID for the LAN. - :type lan_id: : ``int`` - - :param ip: The IP address for the NIC. - :type ip: ``str`` - - :param nic_name: The name of the NIC, e.g. PUBLIC. - :type nic_name: ``str`` - - :param dhcp_active: Set to false to disable. - :type dhcp_active: ``bool`` - - :return: Instance of class ``ProfitBricksNetworkInterface`` - :rtype: :class:`ProfitBricksNetworkInterface` - """ - action = 'createNic' - body = {'action': action, - 'request': 'true', - 'serverId': node.id, - 'dhcpActive': str(dhcp_active) - } - - if lan_id: - body['lanId'] = str(lan_id) - else: - body['lanId'] = str(1) - - if ip: - body['ip'] = ip - - if nic_name: - body['nicName'] = nic_name - - data = self.connection.request(action=action, - data=body, - method='POST').object - interfaces = self._to_interfaces(data) - return interfaces[0] - - def ex_update_network_interface(self, network_interface, name=None, - lan_id=None, ip=None, - dhcp_active=None): - """ - Updates a network interface. - - :param lan_id: The ID for the LAN. - :type lan_id: : ``int`` - - :param ip: The IP address for the NIC. - :type ip: ``str`` - - :param name: The name of the NIC, e.g. PUBLIC. - :type name: ``str`` - - :param dhcp_active: Set to false to disable. - :type dhcp_active: ``bool`` - - :rtype: : ``bool`` - """ - action = 'updateNic' - body = {'action': action, - 'request': 'true', - 'nicId': network_interface.id - } - - if name: - body['nicName'] = name - - if lan_id: - body['lanId'] = str(lan_id) - - if ip: - body['ip'] = ip - - if dhcp_active is not None: - body['dhcpActive'] = str(dhcp_active).lower() - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - def ex_destroy_network_interface(self, network_interface): - """ - Destroy a network interface. - - :param network_interface: The NIC you wish to describe. - :type network_interface: :class:`ProfitBricksNetworkInterface` - - :rtype: : ``bool`` - """ - - action = 'deleteNic' - body = {'action': action, - 'nicId': network_interface.id} - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - def ex_set_inet_access(self, datacenter, - network_interface, internet_access=True): - - action = 'setInternetAccess' - - body = {'action': action, - 'dataCenterId': datacenter.id, - 'lanId': network_interface.extra['lan_id'], - 'internetAccess': str(internet_access).lower() - } - - self.connection.request(action=action, - data=body, method='POST').object - - return True - - """ - Private Functions - """ - - def _to_datacenters(self, object): - return [self._to_datacenter( - datacenter) for datacenter in object.findall('.//return')] - - def _to_datacenter(self, datacenter): - datacenter_id = datacenter.find('dataCenterId').text - if ET.iselement(datacenter.find('dataCenterName')): - datacenter_name = datacenter.find('dataCenterName').text - else: - datacenter_name = None - version = datacenter.find('dataCenterVersion').text - if ET.iselement(datacenter.find('provisioningState')): - provisioning_state = datacenter.find('provisioningState').text - else: - provisioning_state = None - if ET.iselement(datacenter.find('location')): - location = datacenter.find('location').text - else: - location = None - - provisioning_state = self.PROVISIONING_STATE.get(provisioning_state, - NodeState.UNKNOWN) - - return Datacenter(id=datacenter_id, - name=datacenter_name, - version=version, - driver=self.connection.driver, - extra={'provisioning_state': provisioning_state, - 'location': location}) - - def _to_images(self, object): - return [self._to_image(image) for image in object.findall('.//return')] - - def _to_image(self, image): - image_id = image.find('imageId').text - image_name = image.find('imageName').text - image_size = image.find('imageSize').text - image_type = image.find('imageType').text - os_type = image.find('osType').text - public = image.find('public').text - writeable = image.find('writeable').text - - if ET.iselement(image.find('cpuHotpluggable')): - cpu_hotpluggable = image.find('cpuHotpluggable').text - else: - cpu_hotpluggable = None - - if ET.iselement(image.find('memoryHotpluggable')): - memory_hotpluggable = image.find('memoryHotpluggable').text - else: - memory_hotpluggable = None - - if ET.iselement(image.find('location')): - if image.find('region'): - image_region = image.find('region').text - else: - image_region = None - else: - image_region = None - - return NodeImage(id=image_id, - name=image_name, - driver=self.connection.driver, - extra={'image_size': image_size, - 'image_type': image_type, - 'cpu_hotpluggable': cpu_hotpluggable, - 'memory_hotpluggable': memory_hotpluggable, - 'os_type': os_type, - 'public': public, - 'location': image_region, - 'writeable': writeable}) - - def _to_nodes(self, object): - return [self._to_node(n) for n in object.findall('.//return')] - - def _to_node(self, node): - """ - Convert the request into a node Node - """ - ATTRIBUTE_NAME_MAP = { - 'dataCenterId': 'datacenter_id', - 'dataCenterVersion': 'datacenter_version', - 'serverId': 'node_id', - 'serverName': 'node_name', - 'cores': 'cores', - 'ram': 'ram', - 'internetAccess': 'internet_access', - 'provisioningState': 'provisioning_state', - 'virtualMachineState': 'virtual_machine_state', - 'creationTime': 'creation_time', - 'lastModificationTime': 'last_modification_time', - 'osType': 'os_type', - 'availabilityZone': 'availability_zone', - 'cpuHotPlug': 'cpu_hotpluggable', - 'ramHotPlug': 'memory_hotpluggable', - 'nicHotPlug': 'nic_hotpluggable', - 'discVirtioHotPlug': 'disc_virtio_hotplug', - 'discVirtioHotUnPlug': 'disc_virtio_hotunplug' - } - - extra = {} - for attribute_name, extra_name in ATTRIBUTE_NAME_MAP.items(): - elem = node.find(attribute_name) - - if ET.iselement(elem): - value = elem.text - else: - value = None - - extra[extra_name] = value - - public_ips = [] - private_ips = [] - - if ET.iselement(node.find('nics')): - for nic in node.findall('.//nics'): - n_elements = list(nic.findall('.//ips')) - if len(n_elements) > 0: - ip = n_elements[0].text - if is_private_subnet(ip): - private_ips.append(ip) - else: - public_ips.append(ip) - - extra['provisioning_state'] = self.PROVISIONING_STATE.get( - extra['provisioning_state'], NodeState.UNKNOWN) - - node_id = extra['node_id'] - node_name = extra['node_name'] - state = self.NODE_STATE_MAP.get(extra['virtual_machine_state'], - NodeState.UNKNOWN) - - return Node( - id=node_id, - name=node_name, - state=state, - public_ips=public_ips, - private_ips=private_ips, - driver=self.connection.driver, - extra=extra) - - def _to_volumes(self, object): - return [self._to_volume( - volume) for volume in object.findall('.//return')] - - def _to_volume(self, volume, node=None): - ATTRIBUTE_NAME_MAP = { - 'dataCenterId': 'datacenter_id', - 'storageId': 'storage_id', - 'storageName': 'storage_name', - 'serverIds': 'server_id', - 'creationTime': 'creation_time', - 'lastModificationTime': 'last_modification_time', - 'provisioningState': 'provisioning_state', - 'size': 'size', - } - - extra = {} - for attribute_name, extra_name in ATTRIBUTE_NAME_MAP.items(): - elem = volume.find(attribute_name) - - if ET.iselement(elem): - value = elem.text - else: - value = None - - extra[extra_name] = value - - if ET.iselement(volume.find('mountImage')): - image_id = volume.find('mountImage')[0].text - image_name = volume.find('mountImage')[1].text - else: - image_id = None - image_name = None - - extra['image_id'] = image_id - extra['image_name'] = image_name - extra['size'] = int(extra['size']) if extra['size'] else 0 - extra['provisioning_state'] = \ - self.PROVISIONING_STATE.get(extra['provisioning_state'], - NodeState.UNKNOWN) - - storage_id = extra['storage_id'] - storage_name = extra['storage_name'] - size = extra['size'] - - return StorageVolume( - id=storage_id, - name=storage_name, - size=size, - driver=self.connection.driver, - extra=extra) - - def _to_interfaces(self, object): - return [self._to_interface( - interface) for interface in object.findall('.//return')] - - def _to_interface(self, interface): - ATTRIBUTE_NAME_MAP = { - 'nicId': 'nic_id', - 'nicName': 'nic_name', - 'serverId': 'server_id', - 'lanId': 'lan_id', - 'internetAccess': 'internet_access', - 'macAddress': 'mac_address', - 'dhcpActive': 'dhcp_active', - 'gatewayIp': 'gateway_ip', - 'provisioningState': 'provisioning_state', - 'dataCenterId': 'datacenter_id', - 'dataCenterVersion': 'datacenter_version' - } - - extra = {} - for attribute_name, extra_name in ATTRIBUTE_NAME_MAP.items(): - elem = interface.find(attribute_name) - - if ET.iselement(elem): - value = elem.text - else: - value = None - - extra[extra_name] = value - - ips = [] - - if ET.iselement(interface.find('ips')): - for ip in interface.findall('.//ips'): - ips.append(ip.text) - - extra['ips'] = ips - - nic_id = extra['nic_id'] - nic_name = extra['nic_name'] - state = self.PROVISIONING_STATE.get(extra['provisioning_state'], - NodeState.UNKNOWN) - - return ProfitBricksNetworkInterface( - id=nic_id, - name=nic_name, - state=state, - extra=extra) - - def _to_location(self, data): - - return NodeLocation(id=data["region"], - name=data["region"], - country=data["country"], - driver=self.connection.driver) - - def _to_node_size(self, data): - """ - Convert the PROFIT_BRICKS_GENERIC_SIZES into NodeSize - """ - return NodeSize(id=data["id"], - name=data["name"], - ram=data["ram"], - disk=data["disk"], - bandwidth=None, - price=None, - driver=self.connection.driver, - extra={ - 'cores': data["cores"]}) - - def _wait_for_datacenter_state(self, datacenter, state=NodeState.RUNNING, - timeout=300, interval=5): - """ - Private function that waits the datacenter to transition into the - specified state. - - :return: Datacenter object on success. - :rtype: :class:`.Datacenter` - """ - wait_time = 0 - datacenter = self.ex_describe_datacenter(datacenter_id=datacenter.id) - - while (datacenter.extra['provisioning_state'] != state): - datacenter = \ - self.ex_describe_datacenter(datacenter_id=datacenter.id) - if datacenter.extra['provisioning_state'] == state: - break - - if wait_time >= timeout: - raise Exception('Datacenter didn\'t transition to %s state ' - 'in %s seconds' % (state, timeout)) - - wait_time += interval - time.sleep(interval) - - return datacenter - - def _create_new_datacenter_for_node(self, name): - """ - Creates a Datacenter for a node. - """ - dc_name = name + '-DC' - - return self.ex_create_datacenter(name=dc_name, location='us/las') - - def _wait_for_storage_volume_state(self, volume, state=NodeState.RUNNING, - timeout=300, interval=5): - """ - Wait for volume to transition into the specified state. - - :return: Volume object on success. - :rtype: :class:`Volume` - """ - wait_time = 0 - volume = self.ex_describe_volume(volume_id=volume.id) - - while (volume.extra['provisioning_state'] != state): - volume = self.ex_describe_volume(volume_id=volume.id) - if volume.extra['provisioning_state'] == state: - break - - if wait_time >= timeout: - raise Exception('Volume didn\'t transition to %s state ' - 'in %s seconds' % (state, timeout)) - - wait_time += interval - time.sleep(interval) - - return volume - - def _create_node_volume(self, ex_disk, image, password, - name, ex_datacenter=None, new_datacenter=None): - - volume_name = name + '-volume' - - if ex_datacenter: - volume = self.create_volume(size=ex_disk, - ex_datacenter=ex_datacenter, - ex_image=image, - ex_password=password, - name=volume_name) - else: - volume = self.create_volume(size=ex_disk, - ex_datacenter=new_datacenter, - ex_image=image, - ex_password=password, - name=volume_name) - - return volume diff --git a/libcloud/compute/drivers/rackspace.py b/libcloud/compute/drivers/rackspace.py index 80852205af..1223dd959a 100644 --- a/libcloud/compute/drivers/rackspace.py +++ b/libcloud/compute/drivers/rackspace.py @@ -1,3 +1,4 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 @@ -14,37 +15,29 @@ """ Rackspace driver """ -from libcloud.compute.types import Provider, LibcloudError -from libcloud.compute.base import NodeLocation, VolumeSnapshot -from libcloud.compute.drivers.openstack import OpenStack_1_0_Connection,\ - OpenStack_1_0_NodeDriver, OpenStack_1_0_Response -from libcloud.compute.drivers.openstack import OpenStack_1_1_Connection,\ - OpenStack_1_1_NodeDriver -from libcloud.common.rackspace import AUTH_URL +from libcloud.compute.base import NodeLocation, VolumeSnapshot +from libcloud.compute.types import Provider, LibcloudError, VolumeSnapshotState from libcloud.utils.iso8601 import parse_date - - +from libcloud.common.rackspace import AUTH_URL +from libcloud.compute.drivers.openstack import ( + OpenStack_1_0_Response, + OpenStack_1_0_Connection, + OpenStack_1_0_NodeDriver, + OpenStack_1_1_Connection, + OpenStack_1_1_NodeDriver, +) + +SERVICE_TYPE = "compute" +SERVICE_NAME_GEN1 = "cloudServers" +SERVICE_NAME_GEN2 = "cloudServersOpenStack" ENDPOINT_ARGS_MAP = { - 'dfw': {'service_type': 'compute', - 'name': 'cloudServersOpenStack', - 'region': 'DFW'}, - 'ord': {'service_type': 'compute', - 'name': 'cloudServersOpenStack', - 'region': 'ORD'}, - 'iad': {'service_type': 'compute', - 'name': 'cloudServersOpenStack', - 'region': 'IAD'}, - 'lon': {'service_type': 'compute', - 'name': 'cloudServersOpenStack', - 'region': 'LON'}, - 'syd': {'service_type': 'compute', - 'name': 'cloudServersOpenStack', - 'region': 'SYD'}, - 'hkg': {'service_type': 'compute', - 'name': 'cloudServersOpenStack', - 'region': 'HKG'}, - + "dfw": {"service_type": SERVICE_TYPE, "name": SERVICE_NAME_GEN2, "region": "DFW"}, + "ord": {"service_type": SERVICE_TYPE, "name": SERVICE_NAME_GEN2, "region": "ORD"}, + "iad": {"service_type": SERVICE_TYPE, "name": SERVICE_NAME_GEN2, "region": "IAD"}, + "lon": {"service_type": SERVICE_TYPE, "name": SERVICE_NAME_GEN2, "region": "LON"}, + "syd": {"service_type": SERVICE_TYPE, "name": SERVICE_NAME_GEN2, "region": "SYD"}, + "hkg": {"service_type": SERVICE_TYPE, "name": SERVICE_NAME_GEN2, "region": "HKG"}, } @@ -52,71 +45,76 @@ class RackspaceFirstGenConnection(OpenStack_1_0_Connection): """ Connection class for the Rackspace first-gen driver. """ + responseCls = OpenStack_1_0_Response - XML_NAMESPACE = 'http://docs.rackspacecloud.com/servers/api/v1.0' + XML_NAMESPACE = "http://docs.rackspacecloud.com/servers/api/v1.0" auth_url = AUTH_URL - _auth_version = '2.0' + _auth_version = "2.0" cache_busting = True def __init__(self, *args, **kwargs): - self.region = kwargs.pop('region', None) - super(RackspaceFirstGenConnection, self).__init__(*args, **kwargs) + self.region = kwargs.pop("region", None) + super().__init__(*args, **kwargs) def get_endpoint(self): - if '2.0' in self._auth_version: - ep = self.service_catalog.get_endpoint(service_type='compute', - name='cloudServers') + if "2.0" in self._auth_version: + ep = self.service_catalog.get_endpoint( + service_type=SERVICE_TYPE, name=SERVICE_NAME_GEN1 + ) else: - raise LibcloudError( - 'Auth version "%s" not supported' % (self._auth_version)) + raise LibcloudError('Auth version "%s" not supported' % (self._auth_version)) public_url = ep.url if not public_url: - raise LibcloudError('Could not find specified endpoint') + raise LibcloudError("Could not find specified endpoint") # This is a nasty hack, but it's required because of how the # auth system works. # Old US accounts can access UK API endpoint, but they don't # have this endpoint in the service catalog. Same goes for the # old UK accounts and US endpoint. - if self.region == 'us': + + if self.region == "us": # Old UK account, which only have uk endpoint in the catalog - public_url = public_url.replace('https://lon.servers.api', - 'https://servers.api') - elif self.region == 'uk': + public_url = public_url.replace("https://lon.servers.api", "https://servers.api") + elif self.region == "uk": # Old US account, which only has us endpoints in the catalog - public_url = public_url.replace('https://servers.api', - 'https://lon.servers.api') + public_url = public_url.replace("https://servers.api", "https://lon.servers.api") return public_url + def get_service_name(self): + return SERVICE_NAME_GEN1 + class RackspaceFirstGenNodeDriver(OpenStack_1_0_NodeDriver): - name = 'Rackspace Cloud (First Gen)' - website = 'http://www.rackspace.com' + name = "Rackspace Cloud (First Gen)" + website = "http://www.rackspace.com" connectionCls = RackspaceFirstGenConnection type = Provider.RACKSPACE_FIRST_GEN - api_name = 'rackspace' + api_name = "rackspace" - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region='us', **kwargs): + def __init__(self, key, secret=None, secure=True, host=None, port=None, region="us", **kwargs): """ @inherits: :class:`NodeDriver.__init__` :param region: Region ID which should be used :type region: ``str`` """ - if region not in ['us', 'uk']: - raise ValueError('Invalid region: %s' % (region)) - super(RackspaceFirstGenNodeDriver, self).__init__(key=key, - secret=secret, - secure=secure, - host=host, - port=port, - region=region, - **kwargs) + if region not in ["us", "uk"]: + raise ValueError("Invalid region: %s" % (region)) + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + region=region, + **kwargs, + ) def list_locations(self): """ @@ -127,16 +125,20 @@ def list_locations(self): @inherits: :class:`OpenStack_1_0_NodeDriver.list_locations` """ - if self.region == 'us': - locations = [NodeLocation(0, "Rackspace DFW1/ORD1", 'US', self)] - elif self.region == 'uk': - locations = [NodeLocation(0, 'Rackspace UK London', 'UK', self)] + + if self.region == "us": + locations = [NodeLocation(0, "Rackspace DFW1/ORD1", "US", self)] + elif self.region == "uk": + locations = [NodeLocation(0, "Rackspace UK London", "UK", self)] + else: + locations = [] return locations def _ex_connection_class_kwargs(self): kwargs = self.openstack_connection_kwargs() - kwargs['region'] = self.region + kwargs["region"] = self.region + return kwargs @@ -146,42 +148,56 @@ class RackspaceConnection(OpenStack_1_1_Connection): """ auth_url = AUTH_URL - _auth_version = '2.0' + _auth_version = "2.0" def __init__(self, *args, **kwargs): - self.region = kwargs.pop('region', None) - self.get_endpoint_args = kwargs.pop('get_endpoint_args', None) - super(RackspaceConnection, self).__init__(*args, **kwargs) + self.region = kwargs.pop("region", None) + self.get_endpoint_args = kwargs.pop("get_endpoint_args", None) + super().__init__(*args, **kwargs) + + def get_service_name(self): + if not self.get_endpoint_args: + # if they used ex_force_base_url, assume the Rackspace default + + return SERVICE_NAME_GEN2 + + return self.get_endpoint_args.get("name", SERVICE_NAME_GEN2) def get_endpoint(self): if not self.get_endpoint_args: - raise LibcloudError( - 'RackspaceConnection must have get_endpoint_args set') + raise LibcloudError("RackspaceConnection must have get_endpoint_args set") - if '2.0' in self._auth_version: + if "2.0" in self._auth_version: ep = self.service_catalog.get_endpoint(**self.get_endpoint_args) else: - raise LibcloudError( - 'Auth version "%s" not supported' % (self._auth_version)) + raise LibcloudError('Auth version "%s" not supported' % (self._auth_version)) public_url = ep.url if not public_url: - raise LibcloudError('Could not find specified endpoint') + raise LibcloudError("Could not find specified endpoint") return public_url class RackspaceNodeDriver(OpenStack_1_1_NodeDriver): - name = 'Rackspace Cloud (Next Gen)' - website = 'http://www.rackspace.com' + name = "Rackspace Cloud (Next Gen)" + website = "http://www.rackspace.com" connectionCls = RackspaceConnection type = Provider.RACKSPACE - _networks_url_prefix = '/os-networksv2' - - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region='dfw', **kwargs): + _networks_url_prefix = "/os-networksv2" + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + region="dfw", + **kwargs, + ): """ @inherits: :class:`NodeDriver.__init__` @@ -191,44 +207,60 @@ def __init__(self, key, secret=None, secure=True, host=None, port=None, valid_regions = ENDPOINT_ARGS_MAP.keys() if region not in valid_regions: - raise ValueError('Invalid region: %s' % (region)) + raise ValueError("Invalid region: %s" % (region)) - if region == 'lon': - self.api_name = 'rackspacenovalon' - elif region == 'syd': - self.api_name = 'rackspacenovasyd' + if region == "lon": + self.api_name = "rackspacenovalon" + elif region == "syd": + self.api_name = "rackspacenovasyd" else: - self.api_name = 'rackspacenovaus' - - super(RackspaceNodeDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, - region=region, - **kwargs) + self.api_name = "rackspacenovaus" + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + region=region, + **kwargs, + ) def _to_snapshot(self, api_node): - if 'snapshot' in api_node: - api_node = api_node['snapshot'] + if "snapshot" in api_node: + api_node = api_node["snapshot"] + + extra = { + "volume_id": api_node["volumeId"], + "name": api_node["displayName"], + "created": api_node["createdAt"], + "description": api_node["displayDescription"], + "status": api_node["status"], + } - extra = {'volume_id': api_node['volumeId'], - 'name': api_node['displayName'], - 'created': api_node['createdAt'], - 'description': api_node['displayDescription'], - 'status': api_node['status']} + state = self.SNAPSHOT_STATE_MAP.get(api_node["status"], VolumeSnapshotState.UNKNOWN) try: - created_td = parse_date(api_node['createdAt']) + created_td = parse_date(api_node["createdAt"]) except ValueError: created_td = None - snapshot = VolumeSnapshot(id=api_node['id'], driver=self, - size=api_node['size'], - extra=extra, created=created_td) + snapshot = VolumeSnapshot( + id=api_node["id"], + driver=self, + size=api_node["size"], + extra=extra, + created=created_td, + state=state, + name=api_node["displayName"], + ) + return snapshot def _ex_connection_class_kwargs(self): endpoint_args = ENDPOINT_ARGS_MAP[self.region] kwargs = self.openstack_connection_kwargs() - kwargs['region'] = self.region - kwargs['get_endpoint_args'] = endpoint_args + kwargs["region"] = self.region + kwargs["get_endpoint_args"] = endpoint_args + return kwargs diff --git a/libcloud/compute/drivers/rimuhosting.py b/libcloud/compute/drivers/rimuhosting.py index f7cfdd7e12..7808d63cf2 100644 --- a/libcloud/compute/drivers/rimuhosting.py +++ b/libcloud/compute/drivers/rimuhosting.py @@ -15,19 +15,19 @@ """ RimuHosting Driver """ + try: import simplejson as json except ImportError: import json -from libcloud.common.base import ConnectionKey, JsonResponse +from libcloud.common.base import JsonResponse, ConnectionKey from libcloud.common.types import InvalidCredsError +from libcloud.compute.base import Node, NodeSize, NodeImage, NodeDriver, NodeLocation from libcloud.compute.types import Provider, NodeState -from libcloud.compute.base import NodeDriver, NodeSize, Node, NodeLocation -from libcloud.compute.base import NodeImage -API_CONTEXT = '/r' -API_HOST = 'rimuhosting.com' +API_CONTEXT = "/r" +API_HOST = "rimuhosting.com" class RimuHostingException(Exception): @@ -36,9 +36,11 @@ class RimuHostingException(Exception): """ def __str__(self): + # pylint: disable=unsubscriptable-object return self.args[0] def __repr__(self): + # pylint: disable=unsubscriptable-object return "" % (self.args[0]) @@ -46,6 +48,7 @@ class RimuHostingResponse(JsonResponse): """ Response Class for RimuHosting driver """ + def success(self): if self.status == 403: raise InvalidCredsError() @@ -53,16 +56,13 @@ def success(self): def parse_body(self): try: - js = super(RimuHostingResponse, self).parse_body() + js = super().parse_body() keys = list(js.keys()) - if js[keys[0]]['response_type'] == "ERROR": - raise RimuHostingException( - js[keys[0]]['human_readable_message'] - ) + if js[keys[0]]["response_type"] == "ERROR": + raise RimuHostingException(js[keys[0]]["human_readable_message"]) return js[keys[0]] except KeyError: - raise RimuHostingException('Could not parse body: %s' - % (self.body)) + raise RimuHostingException("Could not parse body: %s" % (self.body)) class RimuHostingConnection(ConnectionKey): @@ -75,29 +75,29 @@ class RimuHostingConnection(ConnectionKey): port = 443 responseCls = RimuHostingResponse - def __init__(self, key, secure=True): + def __init__(self, key, secure=True, retry_delay=None, backoff=None, timeout=None): # override __init__ so that we can set secure of False for testing - ConnectionKey.__init__(self, key, secure) + ConnectionKey.__init__( + self, key, secure, timeout=timeout, retry_delay=retry_delay, backoff=backoff + ) def add_default_headers(self, headers): # We want JSON back from the server. Could be application/xml # (but JSON is better). - headers['Accept'] = 'application/json' + headers["Accept"] = "application/json" # Must encode all data as json, or override this header. - headers['Content-Type'] = 'application/json' + headers["Content-Type"] = "application/json" - headers['Authorization'] = 'rimuhosting apikey=%s' % (self.key) + headers["Authorization"] = "rimuhosting apikey=%s" % (self.key) return headers - def request(self, action, params=None, data='', headers=None, - method='GET'): + def request(self, action, params=None, data="", headers=None, method="GET"): if not headers: headers = {} if not params: params = {} # Override this method to prepend the api_context - return ConnectionKey.request(self, self.api_context + action, - params, data, headers, method) + return ConnectionKey.request(self, self.api_context + action, params, data, headers, method) class RimuHostingNodeDriver(NodeDriver): @@ -106,13 +106,12 @@ class RimuHostingNodeDriver(NodeDriver): """ type = Provider.RIMUHOSTING - name = 'RimuHosting' - website = 'http://rimuhosting.com/' + name = "RimuHosting" + website = "http://rimuhosting.com/" connectionCls = RimuHostingConnection - features = {'create_node': ['password']} + features = {"create_node": ["password"]} - def __init__(self, key, host=API_HOST, port=443, - api_context=API_CONTEXT, secure=True): + def __init__(self, key, host=API_HOST, port=443, api_context=API_CONTEXT, secure=True): """ :param key: API key (required) :type key: ``str`` @@ -126,7 +125,7 @@ def __init__(self, key, host=API_HOST, port=443, :param api_context: Optional API context. :type api_context: ``str`` - :param secure: Weither to use HTTPS or HTTP. + :param secure: Whether to use HTTPS or HTTP. :type secure: ``bool`` :rtype: ``None`` @@ -142,85 +141,104 @@ def __init__(self, key, host=API_HOST, port=443, self.connection.connect() def _order_uri(self, node, resource): - # Returns the order uri with its resourse appended. - return "/orders/%s/%s" % (node.id, resource) + # Returns the order uri with its resource appended. + return "/orders/{}/{}".format(node.id, resource) # TODO: Get the node state. def _to_node(self, order): - n = Node(id=order['slug'], - name=order['domain_name'], - state=NodeState.RUNNING, - public_ips=( - [order['allocated_ips']['primary_ip']] + - order['allocated_ips']['secondary_ips']), - private_ips=[], - driver=self.connection.driver, - extra={ - 'order_oid': order['order_oid'], - 'monthly_recurring_fee': order.get( - 'billing_info').get('monthly_recurring_fee')}) + n = Node( + id=order["slug"], + name=order["domain_name"], + state=NodeState.RUNNING, + public_ips=( + [order["allocated_ips"]["primary_ip"]] + order["allocated_ips"]["secondary_ips"] + ), + private_ips=[], + driver=self.connection.driver, + extra={ + "order_oid": order["order_oid"], + "monthly_recurring_fee": order.get("billing_info").get("monthly_recurring_fee"), + }, + ) return n def _to_size(self, plan): return NodeSize( - id=plan['pricing_plan_code'], - name=plan['pricing_plan_description'], - ram=plan['minimum_memory_mb'], - disk=plan['minimum_disk_gb'], - bandwidth=plan['minimum_data_transfer_allowance_gb'], - price=plan['monthly_recurring_amt']['amt_usd'], - driver=self.connection.driver + id=plan["pricing_plan_code"], + name=plan["pricing_plan_description"], + ram=plan["minimum_memory_mb"], + disk=plan["minimum_disk_gb"], + bandwidth=plan["minimum_data_transfer_allowance_gb"], + price=plan["monthly_recurring_amt"]["amt_usd"], + driver=self.connection.driver, ) def _to_image(self, image): - return NodeImage(id=image['distro_code'], - name=image['distro_description'], - driver=self.connection.driver) + return NodeImage( + id=image["distro_code"], + name=image["distro_description"], + driver=self.connection.driver, + ) def list_sizes(self, location=None): # Returns a list of sizes (aka plans) # Get plans. Note this is really just for libcloud. # We are happy with any size. if location is None: - location = '' + location = "" else: location = ";dc_location=%s" % (location.id) - res = self.connection.request( - '/pricing-plans;server-type=VPS%s' % (location)).object - return list(map(lambda x: self._to_size(x), res['pricing_plan_infos'])) + res = self.connection.request("/pricing-plans;server-type=VPS%s" % (location)).object + return list(map(lambda x: self._to_size(x), res["pricing_plan_infos"])) def list_nodes(self): # Returns a list of Nodes # Will only include active ones. - res = self.connection.request('/orders;include_inactive=N').object - return list(map(lambda x: self._to_node(x), res['about_orders'])) + res = self.connection.request("/orders;include_inactive=N").object + return list(map(lambda x: self._to_node(x), res["about_orders"])) def list_images(self, location=None): # Get all base images. # TODO: add other image sources. (Such as a backup of a VPS) # All Images are available for use at all locations - res = self.connection.request('/distributions').object - return list(map(lambda x: self._to_image(x), res['distro_infos'])) + res = self.connection.request("/distributions").object + return list(map(lambda x: self._to_image(x), res["distro_infos"])) def reboot_node(self, node): # Reboot # PUT the state of RESTARTING to restart a VPS. # All data is encoded as JSON - data = {'reboot_request': {'running_state': 'RESTARTING'}} - uri = self._order_uri(node, 'vps/running-state') - self.connection.request(uri, data=json.dumps(data), method='PUT') + data = {"reboot_request": {"running_state": "RESTARTING"}} + uri = self._order_uri(node, "vps/running-state") + self.connection.request(uri, data=json.dumps(data), method="PUT") # XXX check that the response was actually successful return True def destroy_node(self, node): # Shutdown a VPS. - uri = self._order_uri(node, 'vps') - self.connection.request(uri, method='DELETE') + uri = self._order_uri(node, "vps") + self.connection.request(uri, method="DELETE") # XXX check that the response was actually successful return True - def create_node(self, **kwargs): + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_billing_oid=None, + ex_host_server_oid=None, + ex_vps_order_oid_to_clone=None, + ex_num_ips=1, + ex_extra_ip_reason=None, + ex_memory_mb=None, + ex_disk_space_mb=None, + ex_disk_space_2_mb=None, + ex_control_panel=None, + ): """Creates a RimuHosting instance @inherits: :class:`NodeDriver.create_node` @@ -261,77 +279,61 @@ def create_node(self, **kwargs): """ # Note we don't do much error checking in this because we # expect the API to error out if there is a problem. - name = kwargs['name'] - image = kwargs['image'] - size = kwargs['size'] - data = { - 'instantiation_options': { - 'domain_name': name, - 'distro': image.id - }, - 'pricing_plan_code': size.id, - 'vps_parameters': {} + "instantiation_options": {"domain_name": name, "distro": image.id}, + "pricing_plan_code": size.id, + "vps_parameters": {}, } - if 'ex_control_panel' in kwargs: - data['instantiation_options']['control_panel'] = \ - kwargs['ex_control_panel'] + if ex_control_panel: + data["instantiation_options"]["control_panel"] = ex_control_panel - auth = self._get_and_check_auth(kwargs.get('auth')) - data['instantiation_options']['password'] = auth.password + auth = self._get_and_check_auth(auth) + data["instantiation_options"]["password"] = auth.password - if 'ex_billing_oid' in kwargs: + if ex_billing_oid: # TODO check for valid oid. - data['billing_oid'] = kwargs['ex_billing_oid'] + data["billing_oid"] = ex_billing_oid - if 'ex_host_server_oid' in kwargs: - data['host_server_oid'] = kwargs['ex_host_server_oid'] + if ex_host_server_oid: + data["host_server_oid"] = ex_host_server_oid - if 'ex_vps_order_oid_to_clone' in kwargs: - data['vps_order_oid_to_clone'] = \ - kwargs['ex_vps_order_oid_to_clone'] + if ex_vps_order_oid_to_clone: + data["vps_order_oid_to_clone"] = ex_vps_order_oid_to_clone - if 'ex_num_ips' in kwargs and int(kwargs['ex_num_ips']) > 1: - if 'ex_extra_ip_reason' not in kwargs: - raise RimuHostingException( - 'Need an reason for having an extra IP') + if ex_num_ips and int(ex_num_ips) > 1: + if not ex_extra_ip_reason: + raise RimuHostingException("Need an reason for having an extra IP") else: - if 'ip_request' not in data: - data['ip_request'] = {} - data['ip_request']['num_ips'] = int(kwargs['ex_num_ips']) - data['ip_request']['extra_ip_reason'] = \ - kwargs['ex_extra_ip_reason'] + if "ip_request" not in data: + data["ip_request"] = {} + data["ip_request"]["num_ips"] = int("ex_num_ips") + data["ip_request"]["extra_ip_reason"] = ex_extra_ip_reason - if 'ex_memory_mb' in kwargs: - data['vps_parameters']['memory_mb'] = kwargs['ex_memory_mb'] + if ex_memory_mb: + data["vps_parameters"]["memory_mb"] = ex_memory_mb - if 'ex_disk_space_mb' in kwargs: - data['vps_parameters']['disk_space_mb'] = \ - kwargs['ex_disk_space_mb'] + if ex_disk_space_mb: + data["vps_parameters"]["disk_space_mb"] = ex_disk_space_mb - if 'ex_disk_space_2_mb' in kwargs: - data['vps_parameters']['disk_space_2_mb'] =\ - kwargs['ex_disk_space_2_mb'] + if ex_disk_space_2_mb: + data["vps_parameters"]["disk_space_2_mb"] = ex_disk_space_2_mb # Don't send empty 'vps_parameters' attribute - if not data['vps_parameters']: - del data['vps_parameters'] + if not data["vps_parameters"]: + del data["vps_parameters"] res = self.connection.request( - '/orders/new-vps', - method='POST', - data=json.dumps({"new-vps": data}) + "/orders/new-vps", method="POST", data=json.dumps({"new-vps": data}) ).object - node = self._to_node(res['about_order']) - node.extra['password'] = \ - res['new_order_request']['instantiation_options']['password'] + node = self._to_node(res["about_order"]) + node.extra["password"] = res["new_order_request"]["instantiation_options"]["password"] return node def list_locations(self): return [ - NodeLocation('DCAUCKLAND', "RimuHosting Auckland", 'NZ', self), - NodeLocation('DCDALLAS', "RimuHosting Dallas", 'US', self), - NodeLocation('DCLONDON', "RimuHosting London", 'GB', self), - NodeLocation('DCSYDNEY', "RimuHosting Sydney", 'AU', self), + NodeLocation("DCAUCKLAND", "RimuHosting Auckland", "NZ", self), + NodeLocation("DCDALLAS", "RimuHosting Dallas", "US", self), + NodeLocation("DCLONDON", "RimuHosting London", "GB", self), + NodeLocation("DCSYDNEY", "RimuHosting Sydney", "AU", self), ] diff --git a/libcloud/compute/drivers/scaleway.py b/libcloud/compute/drivers/scaleway.py new file mode 100644 index 0000000000..7a9154ac4e --- /dev/null +++ b/libcloud/compute/drivers/scaleway.py @@ -0,0 +1,741 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Scaleway Driver +""" + +import copy + +from libcloud.utils.py3 import httplib +from libcloud.common.base import JsonResponse, ConnectionUserAndKey +from libcloud.common.types import ProviderError +from libcloud.compute.base import ( + Node, + KeyPair, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, + VolumeSnapshot, +) +from libcloud.compute.types import NodeState, VolumeSnapshotState +from libcloud.utils.iso8601 import parse_date +from libcloud.compute.providers import Provider + +try: + import simplejson as json +except ImportError: + import json + + +__all__ = ["ScalewayResponse", "ScalewayConnection", "ScalewayNodeDriver"] + +SCALEWAY_API_HOSTS = { + "default": "cp-par1.scaleway.com", + "account": "account.scaleway.com", + "par1": "cp-par1.scaleway.com", + "ams1": "cp-ams1.scaleway.com", +} + +# The API doesn't give location info, so we provide it ourselves, instead. +SCALEWAY_LOCATION_DATA = [ + {"id": "par1", "name": "Paris 1", "country": "FR"}, + {"id": "ams1", "name": "Amsterdam 1", "country": "NL"}, +] + + +class ScalewayResponse(JsonResponse): + valid_response_codes = [ + httplib.OK, + httplib.ACCEPTED, + httplib.CREATED, + httplib.NO_CONTENT, + ] + + def parse_error(self): + return super().parse_error()["message"] + + def success(self): + return self.status in self.valid_response_codes + + +class ScalewayConnection(ConnectionUserAndKey): + """ + Connection class for the Scaleway driver. + """ + + host = SCALEWAY_API_HOSTS["default"] + allow_insecure = False + responseCls = ScalewayResponse + + def request( + self, + action, + params=None, + data=None, + headers=None, + method="GET", + raw=False, + stream=False, + region=None, + ): + if region: + old_host = self.host + self.host = SCALEWAY_API_HOSTS[ + region.id if isinstance(region, NodeLocation) else region + ] + if not self.host == old_host: + self.connect() + + return super().request(action, params, data, headers, method, raw, stream) + + def _request_paged( + self, + action, + params=None, + data=None, + headers=None, + method="GET", + raw=False, + stream=False, + region=None, + ): + if params is None: + params = {} + + if isinstance(params, dict): + params["per_page"] = 100 + elif isinstance(params, list): + params.append(("per_page", 100)) # pylint: disable=no-member + + results = self.request(action, params, data, headers, method, raw, stream, region).object + + links = self.connection.getresponse().links + while links and "next" in links: + next = self.request( + links["next"]["url"], + data=data, + headers=headers, + method=method, + raw=raw, + stream=stream, + ).object + links = self.connection.getresponse().links + merged = {root: child + next[root] for root, child in list(results.items())} + results = merged + + return results + + def add_default_headers(self, headers): + """ + Add headers that are necessary for every request + """ + headers["X-Auth-Token"] = self.key + headers["Content-Type"] = "application/json" + return headers + + +def _to_lib_size(size): + return int(size / 1000 / 1000 / 1000) + + +def _to_api_size(size): + return int(size * 1000 * 1000 * 1000) + + +class ScalewayNodeDriver(NodeDriver): + """ + Scaleway Node Driver Class + + This is the primary driver for interacting with Scaleway. It contains all + of the standard libcloud methods that Scaleway's API supports. + """ + + type = Provider.SCALEWAY + connectionCls = ScalewayConnection + name = "Scaleway" + website = "https://www.scaleway.com/" + + SNAPSHOT_STATE_MAP = { + "snapshotting": VolumeSnapshotState.CREATING, + "available": VolumeSnapshotState.AVAILABLE, + "error": VolumeSnapshotState.ERROR, + } + + def list_locations(self): + """ + List data centers available. + + :return: list of node location objects + :rtype: ``list`` of :class:`.NodeLocation` + """ + return [ + NodeLocation(driver=self, **copy.deepcopy(location)) + for location in SCALEWAY_LOCATION_DATA + ] + + def list_sizes( + self, + location=None, + region=None, + ): + """ + List available VM sizes. + + :param region: The region in which to list sizes + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + + :return: list of node size objects + :rtype: ``list`` of :class:`.NodeSize` + """ + response = self.connection._request_paged("/products/servers", region=region) + sizes = response["servers"] + + response = self.connection._request_paged("/products/servers/availability", region=region) + availability = response["servers"] + + return sorted( + (self._to_size(name, sizes[name], availability[name]) for name in sizes), + key=lambda x: x.name, + ) + + def _to_size(self, name, size, availability): + min_disk = ( + _to_lib_size(size["volumes_constraint"]["min_size"] or 0) + if size["volumes_constraint"] + else 25 + ) + max_disk = ( + _to_lib_size(size["volumes_constraint"]["max_size"] or 0) + if size["volumes_constraint"] + else min_disk + ) + + extra = { + "cores": size["ncpus"], + "monthly": size["monthly_price"], + "arch": size["arch"], + "baremetal": size["baremetal"], + "availability": availability["availability"], + "max_disk": max_disk, + "internal_bandwidth": int( + (size["network"]["sum_internal_bandwidth"] or 0) / (1024 * 1024) + ), + "ipv6": size["network"]["ipv6_support"], + "alt_names": size["alt_names"], + } + + return NodeSize( + id=name, + name=name, + ram=int((size["ram"] or 0) / (1024 * 1024)), + disk=min_disk, + bandwidth=int((size["network"]["sum_internet_bandwidth"] or 0) / (1024 * 1024)), + price=size["hourly_price"], + driver=self, + extra=extra, + ) + + def list_images( + self, + location=None, + region=None, + ): + """ + List available VM images. + + :param region: The region in which to list images + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + + :return: list of image objects + :rtype: ``list`` of :class:`.NodeImage` + """ + response = self.connection._request_paged("/images", region=region) + images = response["images"] + return [self._to_image(image) for image in images] + + def create_image( + self, + node, + name, + description=None, + region=None, + ): + """ + Create a VM image from an existing node's root volume. + + :param node: The node from which to create the image + :type node: :class:`.Node` + + :param name: The name to give the image + :type name: ``str`` + + :param region: The region in which to create the image + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + + :return: the newly created image object + :rtype: :class:`.NodeImage` + """ + data = { + "organization": self.key, + "name": name, + "arch": node.extra["arch"], + "root_volume": node.extra["volumes"]["0"]["id"], + } + response = self.connection.request( + "/images", data=json.dumps(data), region=region, method="POST" + ) + image = response.object["image"] + return self._to_image(image) + + def delete_image(self, node_image, region=None): + """ + Delete a VM image. + + :param node_image: The image to delete + :type node_image: :class:`.NodeImage` + + :param region: The region in which to find/delete the image + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + + :return: True if the image was deleted, otherwise False + :rtype: ``bool`` + """ + return self.connection.request( + "/images/%s" % node_image.id, region=region, method="DELETE" + ).success() + + def get_image(self, image_id, region=None): + """ + Retrieve a specific VM image. + + :param image_id: The id of the image to retrieve + :type image_id: ``int`` + + :param region: The region in which to create the image + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + + :return: the requested image object + :rtype: :class:`.NodeImage` + """ + response = self.connection.request("/images/%s" % image_id, region=region) + image = response.object["image"] + return self._to_image(image) + + def _to_image(self, image): + extra = { + "arch": image["arch"], + "size": _to_lib_size(image.get("root_volume", {}).get("size", 0)) or 50, + "creation_date": parse_date(image["creation_date"]), + "modification_date": parse_date(image["modification_date"]), + "organization": image["organization"], + } + return NodeImage(id=image["id"], name=image["name"], driver=self, extra=extra) + + def list_nodes(self, region=None): + """ + List all nodes. + + :param region: The region in which to look for nodes + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + + :return: list of node objects + :rtype: ``list`` of :class:`.Node` + """ + response = self.connection._request_paged("/servers", region=region) + servers = response["servers"] + return [self._to_node(server) for server in servers] + + def _to_node(self, server): + public_ip = server["public_ip"] + private_ip = server["private_ip"] + location = server["location"] or {} + return Node( + id=server["id"], + name=server["name"], + state=NodeState.fromstring(server["state"]), + public_ips=[public_ip["address"]] if public_ip else [], + private_ips=[private_ip] if private_ip else [], + driver=self, + extra={ + "volumes": server["volumes"], + "tags": server["tags"], + "arch": server["arch"], + "organization": server["organization"], + "region": location.get("zone_id", "par1"), + }, + created_at=parse_date(server["creation_date"]), + ) + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_volumes=None, + ex_tags=None, + region=None, + ): + """ + Create a new node. + + :param name: The name to give the node + :type name: ``str`` + + :param size: The size of node to create + :type size: :class:`.NodeSize` + + :param image: The image to create the node with + :type image: :class:`.NodeImage` + + :param ex_volumes: Additional volumes to create the node with + :type ex_volumes: ``dict`` of :class:`.StorageVolume`s + + :param ex_tags: Tags to assign to the node + :type ex_tags: ``list`` of ``str`` + + :param region: The region in which to create the node + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + + :return: the newly created node object + :rtype: :class:`.Node` + """ + data = { + "name": name, + "organization": self.key, + "image": image.id, + "volumes": ex_volumes or {}, + "commercial_type": size.id, + "tags": ex_tags or [], + } + + allocate_space = image.extra.get("size", 50) + for volume in data["volumes"]: + allocate_space += _to_lib_size(volume["size"]) + + while allocate_space < size.disk: + if size.disk - allocate_space > 150: + bump = 150 + else: + bump = size.disk - allocate_space + + vol_num = len(data["volumes"]) + 1 + data["volumes"][str(vol_num)] = { + "name": "%s-%d" % (name, vol_num), + "organization": self.key, + "size": _to_api_size(bump), + "volume_type": "l_ssd", + } + allocate_space += bump + + if allocate_space > size.extra.get("max_disk", size.disk): + range = ( + "of %dGB" % size.disk + if size.extra.get("max_disk", size.disk) == size.disk + else "between %dGB and %dGB" % (size.extra.get("max_disk", size.disk), size.disk) + ) + raise ProviderError( + value=( + "%s only supports a total volume size %s; tried %dGB" + % (size.id, range, allocate_space) + ), + http_code=400, + driver=self, + ) + + response = self.connection.request( + "/servers", data=json.dumps(data), region=region, method="POST" + ) + server = response.object["server"] + node = self._to_node(server) + node.extra["region"] = (region.id if isinstance(region, NodeLocation) else region) or "par1" + + # Scaleway doesn't start servers by default, let's do it + self._action(node.id, "poweron") + + return node + + def _action(self, server_id, action, region=None): + return self.connection.request( + "/servers/%s/action" % server_id, + region=region, + data=json.dumps({"action": action}), + method="POST", + ).success() + + def reboot_node(self, node): + """ + Reboot a node. + + :param node: The node to be rebooted + :type node: :class:`Node` + + :return: True if the reboot was successful, otherwise False + :rtype: ``bool`` + """ + return self._action(node.id, "reboot") + + def destroy_node(self, node): + """ + Destroy a node. + + :param node: The node to be destroyed + :type node: :class:`Node` + + :return: True if the destroy was successful, otherwise False + :rtype: ``bool`` + """ + return self._action(node.id, "terminate") + + def list_volumes(self, region=None): + """ + Return a list of volumes. + + :param region: The region in which to look for volumes + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + + :return: A list of volume objects. + :rtype: ``list`` of :class:`StorageVolume` + """ + response = self.connection._request_paged("/volumes", region=region) + volumes = response["volumes"] + return [self._to_volume(volume) for volume in volumes] + + def _to_volume(self, volume): + extra = { + "organization": volume["organization"], + "volume_type": volume["volume_type"], + "creation_date": parse_date(volume["creation_date"]), + "modification_date": parse_date(volume["modification_date"]), + } + return StorageVolume( + id=volume["id"], + name=volume["name"], + size=_to_lib_size(volume["size"]), + driver=self, + extra=extra, + ) + + def list_volume_snapshots(self, volume, region=None): + """ + List snapshots for a storage volume. + + @inherits :class:`NodeDriver.list_volume_snapshots` + + :param region: The region in which to look for snapshots + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + """ + response = self.connection._request_paged("/snapshots", region=region) + snapshots = filter(lambda s: s["base_volume"]["id"] == volume.id, response["snapshots"]) + return [self._to_snapshot(snapshot) for snapshot in snapshots] + + def _to_snapshot(self, snapshot): + state = self.SNAPSHOT_STATE_MAP.get(snapshot["state"], VolumeSnapshotState.UNKNOWN) + extra = { + "organization": snapshot["organization"], + "volume_type": snapshot["volume_type"], + } + return VolumeSnapshot( + id=snapshot["id"], + driver=self, + size=_to_lib_size(snapshot["size"]), + created=parse_date(snapshot["creation_date"]), + state=state, + extra=extra, + ) + + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + region=None, + ): + """ + Create a new volume. + + :param size: Size of volume in gigabytes. + :type size: ``int`` + + :param name: Name of the volume to be created. + :type name: ``str`` + + :param region: The region in which to create the volume + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + + :return: The newly created volume. + :rtype: :class:`StorageVolume` + """ + data = { + "name": name, + "organization": self.key, + "volume_type": "l_ssd", + "size": _to_api_size(size), + } + response = self.connection.request( + "/volumes", region=region, data=json.dumps(data), method="POST" + ) + volume = response.object["volume"] + return self._to_volume(volume) + + def create_volume_snapshot( + self, + volume, + name=None, + region=None, + ): + """ + Create snapshot from volume. + + :param volume: The volume to create a snapshot from + :type volume: :class`StorageVolume` + + :param name: The name to give the snapshot + :type name: ``str`` + + :param region: The region in which to create the snapshot + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + + :return: The newly created snapshot. + :rtype: :class:`VolumeSnapshot` + """ + data = {"name": name, "organization": self.key, "volume_id": volume.id} + response = self.connection.request( + "/snapshots", region=region, data=json.dumps(data), method="POST" + ) + snapshot = response.object["snapshot"] + return self._to_snapshot(snapshot) + + def destroy_volume(self, volume, region=None): + """ + Destroys a storage volume. + + :param volume: Volume to be destroyed + :type volume: :class:`StorageVolume` + + :param region: The region in which to look for the volume + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + + :return: True if the destroy was successful, otherwise False + :rtype: ``bool`` + """ + return self.connection.request( + "/volumes/%s" % volume.id, region=region, method="DELETE" + ).success() + + def destroy_volume_snapshot(self, snapshot, region=None): + """ + Dostroy a volume snapshot + + :param snapshot: volume snapshot to destroy + :type snapshot: class:`VolumeSnapshot` + + :param region: The region in which to look for the snapshot + (if None, use default region specified in __init__) + :type region: :class:`.NodeLocation` + + :return: True if the destroy was successful, otherwise False + :rtype: ``bool`` + """ + return self.connection.request( + "/snapshots/%s" % snapshot.id, region=region, method="DELETE" + ).success() + + def list_key_pairs(self): + """ + List all the available SSH keys. + + :return: Available SSH keys. + :rtype: ``list`` of :class:`KeyPair` + """ + response = self.connection.request("/users/%s" % (self._get_user_id()), region="account") + keys = response.object["user"]["ssh_public_keys"] + return [ + KeyPair( + name=" ".join(key["key"].split(" ")[2:]), + public_key=" ".join(key["key"].split(" ")[:2]), + fingerprint=key["fingerprint"], + driver=self, + ) + for key in keys + ] + + def import_key_pair_from_string(self, name, key_material): + """ + Import a new public key from string. + + :param name: Key pair name. + :type name: ``str`` + + :param key_material: Public key material. + :type key_material: ``str`` + + :return: Imported key pair object. + :rtype: :class:`KeyPair` + """ + new_key = KeyPair( + name=name, + public_key=" ".join(key_material.split(" ")[:2]), + fingerprint=None, + driver=self, + ) + keys = [key for key in self.list_key_pairs() if not key.name == name] + keys.append(new_key) + return self._save_keys(keys) + + def delete_key_pair(self, key_pair): + """ + Delete an existing key pair. + + :param key_pair: Key pair object. + :type key_pair: :class:`KeyPair` + + :return: True of False based on success of Keypair deletion + :rtype: ``bool`` + """ + keys = [key for key in self.list_key_pairs() if not key.name == key_pair.name] + return self._save_keys(keys) + + def _get_user_id(self): + response = self.connection.request("/tokens/%s" % self.secret, region="account") + return response.object["token"]["user_id"] + + def _save_keys(self, keys): + data = { + "ssh_public_keys": [{"key": "{} {}".format(key.public_key, key.name)} for key in keys] + } + response = self.connection.request( + "/users/%s" % (self._get_user_id()), + region="account", + method="PATCH", + data=json.dumps(data), + ) + return response.success() diff --git a/libcloud/compute/drivers/serverlove.py b/libcloud/compute/drivers/serverlove.py deleted file mode 100644 index 2ba92a9560..0000000000 --- a/libcloud/compute/drivers/serverlove.py +++ /dev/null @@ -1,83 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -ServerLove Driver -""" - -from libcloud.compute.types import Provider -from libcloud.compute.drivers.elasticstack import ElasticStackBaseNodeDriver -from libcloud.compute.drivers.elasticstack import ElasticStackBaseConnection - - -# API end-points -API_ENDPOINTS = { - 'uk-1': { - 'name': 'United Kingdom, Manchester', - 'country': 'United Kingdom', - 'host': 'api.z1-man.serverlove.com' - } -} - -# Default API end-point for the base connection class. -DEFAULT_ENDPOINT = 'uk-1' - -# Retrieved from http://www.serverlove.com/cloud-server-faqs/api-questions/ -STANDARD_DRIVES = { - '679f5f44-0be7-4745-a658-cccd4334c1aa': { - 'uuid': '679f5f44-0be7-4745-a658-cccd4334c1aa', - 'description': 'CentOS 5.5', - 'size_gunzipped': '1GB', - 'supports_deployment': True, - }, - '5f2e0e29-2937-42b9-b362-d2d07eddbdeb': { - 'uuid': '5f2e0e29-2937-42b9-b362-d2d07eddbdeb', - 'description': 'Ubuntu Linux 10.04', - 'size_gunzipped': '1GB', - 'supports_deployment': True, - }, - '5795b68f-ed26-4639-b41d-c93235062b6b': { - 'uuid': '5795b68f-ed26-4639-b41d-c93235062b6b', - 'description': 'Debian Linux 5', - 'size_gunzipped': '1GB', - 'supports_deployment': True, - }, - '41993a02-0b22-4e49-bb47-0aa8975217e4': { - 'uuid': '41993a02-0b22-4e49-bb47-0aa8975217e4', - 'description': 'Windows Server 2008 R2 Standard', - 'size_gunzipped': '15GB', - 'supports_deployment': False, - }, - '85623ca1-9c2a-4398-a771-9a43c347e86b': { - 'uuid': '85623ca1-9c2a-4398-a771-9a43c347e86b', - 'description': 'Windows Web Server 2008 R2', - 'size_gunzipped': '15GB', - 'supports_deployment': False, - } -} - - -class ServerLoveConnection(ElasticStackBaseConnection): - host = API_ENDPOINTS[DEFAULT_ENDPOINT]['host'] - - -class ServerLoveNodeDriver(ElasticStackBaseNodeDriver): - type = Provider.SERVERLOVE - api_name = 'serverlove' - website = 'http://www.serverlove.com/' - name = 'ServerLove' - connectionCls = ServerLoveConnection - features = {'create_node': ['generates_password']} - _standard_drives = STANDARD_DRIVES diff --git a/libcloud/compute/drivers/skalicloud.py b/libcloud/compute/drivers/skalicloud.py deleted file mode 100644 index c0b0d79404..0000000000 --- a/libcloud/compute/drivers/skalicloud.py +++ /dev/null @@ -1,83 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -skalicloud Driver -""" - -from libcloud.compute.types import Provider -from libcloud.compute.drivers.elasticstack import ElasticStackBaseNodeDriver -from libcloud.compute.drivers.elasticstack import ElasticStackBaseConnection - - -# API end-points -API_ENDPOINTS = { - 'my-1': { - 'name': 'Malaysia, Kuala Lumpur', - 'country': 'Malaysia', - 'host': 'api.sdg-my.skalicloud.com' - } -} - -# Default API end-point for the base connection class. -DEFAULT_ENDPOINT = 'my-1' - -# Retrieved from http://www.skalicloud.com/cloud-api/ -STANDARD_DRIVES = { - '90aa51f2-15c0-4cff-81ee-e93aa20b9468': { - 'uuid': '90aa51f2-15c0-4cff-81ee-e93aa20b9468', - 'description': 'CentOS 5.5 -64bit', - 'size_gunzipped': '1GB', - 'supports_deployment': True, - }, - 'c144d7a7-e24b-48ab-954b-6b6ec514ed6f': { - 'uuid': 'c144d7a7-e24b-48ab-954b-6b6ec514ed6f', - 'description': 'Debian 5 -64bit', - 'size_gunzipped': '1GB', - 'supports_deployment': True, - }, - '3051699a-a536-4220-aeb5-67f2ec101a09': { - 'uuid': '3051699a-a536-4220-aeb5-67f2ec101a09', - 'description': 'Ubuntu Server 10.10 -64bit', - 'size_gunzipped': '1GB', - 'supports_deployment': True, - }, - '11c4c922-5ff8-4094-b06c-eb8ffaec1ea9': { - 'uuid': '11c4c922-5ff8-4094-b06c-eb8ffaec1ea9', - 'description': 'Windows 2008R2 Web Edition', - 'size_gunzipped': '13GB', - 'supports_deployment': False, - }, - '93bf390e-4f46-4252-a8bc-9d6d80e3f955': { - 'uuid': '93bf390e-4f46-4252-a8bc-9d6d80e3f955', - 'description': 'Windows Server 2008R2 Standard', - 'size_gunzipped': '13GB', - 'supports_deployment': False, - } -} - - -class SkaliCloudConnection(ElasticStackBaseConnection): - host = API_ENDPOINTS[DEFAULT_ENDPOINT]['host'] - - -class SkaliCloudNodeDriver(ElasticStackBaseNodeDriver): - type = Provider.SKALICLOUD - api_name = 'skalicloud' - name = 'skalicloud' - website = 'http://www.skalicloud.com/' - connectionCls = SkaliCloudConnection - features = {"create_node": ["generates_password"]} - _standard_drives = STANDARD_DRIVES diff --git a/libcloud/compute/drivers/softlayer.py b/libcloud/compute/drivers/softlayer.py deleted file mode 100644 index d14b479d4d..0000000000 --- a/libcloud/compute/drivers/softlayer.py +++ /dev/null @@ -1,504 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Softlayer driver -""" - -import time -try: - from Crypto.PublicKey import RSA - crypto = True -except ImportError: - crypto = False - -from libcloud.common.softlayer import SoftLayerConnection, SoftLayerException -from libcloud.compute.types import Provider, NodeState -from libcloud.compute.base import NodeDriver, Node, NodeLocation, NodeSize, \ - NodeImage, KeyPair -from libcloud.compute.types import KeyPairDoesNotExistError - -DEFAULT_DOMAIN = 'example.com' -DEFAULT_CPU_SIZE = 1 -DEFAULT_RAM_SIZE = 2048 -DEFAULT_DISK_SIZE = 100 - -DATACENTERS = { - 'hou02': {'country': 'US'}, - 'sea01': {'country': 'US', 'name': 'Seattle - West Coast U.S.'}, - 'wdc01': {'country': 'US', 'name': 'Washington, DC - East Coast U.S.'}, - 'dal01': {'country': 'US'}, - 'dal02': {'country': 'US'}, - 'dal04': {'country': 'US'}, - 'dal05': {'country': 'US', 'name': 'Dallas - Central U.S.'}, - 'dal06': {'country': 'US'}, - 'dal07': {'country': 'US'}, - 'sjc01': {'country': 'US', 'name': 'San Jose - West Coast U.S.'}, - 'sng01': {'country': 'SG', 'name': 'Singapore - Southeast Asia'}, - 'ams01': {'country': 'NL', 'name': 'Amsterdam - Western Europe'}, - 'tok02': {'country': 'JP', 'name': 'Tokyo - Japan'}, -} - -NODE_STATE_MAP = { - 'RUNNING': NodeState.RUNNING, - 'HALTED': NodeState.UNKNOWN, - 'PAUSED': NodeState.UNKNOWN, - 'INITIATING': NodeState.PENDING -} - -SL_BASE_TEMPLATES = [ - { - 'name': '1 CPU, 1GB ram, 25GB', - 'ram': 1024, - 'disk': 25, - 'cpus': 1, - }, { - 'name': '1 CPU, 1GB ram, 100GB', - 'ram': 1024, - 'disk': 100, - 'cpus': 1, - }, { - 'name': '1 CPU, 2GB ram, 100GB', - 'ram': 2 * 1024, - 'disk': 100, - 'cpus': 1, - }, { - 'name': '1 CPU, 4GB ram, 100GB', - 'ram': 4 * 1024, - 'disk': 100, - 'cpus': 1, - }, { - 'name': '2 CPU, 2GB ram, 100GB', - 'ram': 2 * 1024, - 'disk': 100, - 'cpus': 2, - }, { - 'name': '2 CPU, 4GB ram, 100GB', - 'ram': 4 * 1024, - 'disk': 100, - 'cpus': 2, - }, { - 'name': '2 CPU, 8GB ram, 100GB', - 'ram': 8 * 1024, - 'disk': 100, - 'cpus': 2, - }, { - 'name': '4 CPU, 4GB ram, 100GB', - 'ram': 4 * 1024, - 'disk': 100, - 'cpus': 4, - }, { - 'name': '4 CPU, 8GB ram, 100GB', - 'ram': 8 * 1024, - 'disk': 100, - 'cpus': 4, - }, { - 'name': '6 CPU, 4GB ram, 100GB', - 'ram': 4 * 1024, - 'disk': 100, - 'cpus': 6, - }, { - 'name': '6 CPU, 8GB ram, 100GB', - 'ram': 8 * 1024, - 'disk': 100, - 'cpus': 6, - }, { - 'name': '8 CPU, 8GB ram, 100GB', - 'ram': 8 * 1024, - 'disk': 100, - 'cpus': 8, - }, { - 'name': '8 CPU, 16GB ram, 100GB', - 'ram': 16 * 1024, - 'disk': 100, - 'cpus': 8, - }] - -SL_TEMPLATES = {} -for i, template in enumerate(SL_BASE_TEMPLATES): - # Add local disk templates - local = template.copy() - local['local_disk'] = True - SL_TEMPLATES[i] = local - - -class SoftLayerNodeDriver(NodeDriver): - """ - SoftLayer node driver - - Extra node attributes: - - password: root password - - hourlyRecurringFee: hourly price (if applicable) - - recurringFee : flat rate (if applicable) - - recurringMonths : The number of months in which the recurringFee - will be incurred. - """ - connectionCls = SoftLayerConnection - name = 'SoftLayer' - website = 'http://www.softlayer.com/' - type = Provider.SOFTLAYER - - features = {'create_node': ['generates_password', 'ssh_key']} - - def _to_node(self, host): - try: - password = \ - host['operatingSystem']['passwords'][0]['password'] - except (IndexError, KeyError): - password = None - - hourlyRecurringFee = host.get('billingItem', {}).get( - 'hourlyRecurringFee', 0) - recurringFee = host.get('billingItem', {}).get('recurringFee', 0) - recurringMonths = host.get('billingItem', {}).get('recurringMonths', 0) - createDate = host.get('createDate', None) - - # When machine is launching it gets state halted - # we change this to pending - state = NODE_STATE_MAP.get(host['powerState']['keyName'], - NodeState.UNKNOWN) - - if not password and state == NodeState.UNKNOWN: - state = NODE_STATE_MAP['INITIATING'] - - public_ips = [] - private_ips = [] - - if 'primaryIpAddress' in host: - public_ips.append(host['primaryIpAddress']) - - if 'primaryBackendIpAddress' in host: - private_ips.append(host['primaryBackendIpAddress']) - - image = host.get('operatingSystem', {}).get('softwareLicense', {}) \ - .get('softwareDescription', {}) \ - .get('longDescription', None) - - return Node( - id=host['id'], - name=host['fullyQualifiedDomainName'], - state=state, - public_ips=public_ips, - private_ips=private_ips, - driver=self, - extra={ - 'hostname': host['hostname'], - 'fullyQualifiedDomainName': host['fullyQualifiedDomainName'], - 'password': password, - 'maxCpu': host.get('maxCpu', None), - 'datacenter': host.get('datacenter', {}).get('longName', None), - 'maxMemory': host.get('maxMemory', None), - 'image': image, - 'hourlyRecurringFee': hourlyRecurringFee, - 'recurringFee': recurringFee, - 'recurringMonths': recurringMonths, - 'created': createDate, - } - ) - - def destroy_node(self, node): - self.connection.request( - 'SoftLayer_Virtual_Guest', 'deleteObject', id=node.id - ) - return True - - def reboot_node(self, node): - self.connection.request( - 'SoftLayer_Virtual_Guest', 'rebootSoft', id=node.id - ) - return True - - def ex_stop_node(self, node): - self.connection.request( - 'SoftLayer_Virtual_Guest', 'powerOff', id=node.id - ) - return True - - def ex_start_node(self, node): - self.connection.request( - 'SoftLayer_Virtual_Guest', 'powerOn', id=node.id - ) - return True - - def _get_order_information(self, node_id, timeout=1200, check_interval=5): - mask = { - 'billingItem': '', - 'powerState': '', - 'operatingSystem': {'passwords': ''}, - 'provisionDate': '', - } - - for i in range(0, timeout, check_interval): - res = self.connection.request( - 'SoftLayer_Virtual_Guest', - 'getObject', - id=node_id, - object_mask=mask - ).object - - if res.get('provisionDate', None): - return res - - time.sleep(check_interval) - - raise SoftLayerException('Timeout on getting node details') - - def create_node(self, **kwargs): - """Create a new SoftLayer node - - @inherits: :class:`NodeDriver.create_node` - - :keyword ex_domain: e.g. libcloud.org - :type ex_domain: ``str`` - :keyword ex_cpus: e.g. 2 - :type ex_cpus: ``int`` - :keyword ex_disk: e.g. 100 - :type ex_disk: ``int`` - :keyword ex_ram: e.g. 2048 - :type ex_ram: ``int`` - :keyword ex_bandwidth: e.g. 100 - :type ex_bandwidth: ``int`` - :keyword ex_local_disk: e.g. True - :type ex_local_disk: ``bool`` - :keyword ex_datacenter: e.g. Dal05 - :type ex_datacenter: ``str`` - :keyword ex_os: e.g. UBUNTU_LATEST - :type ex_os: ``str`` - :keyword ex_keyname: The name of the key pair - :type ex_keyname: ``str`` - """ - name = kwargs['name'] - os = 'DEBIAN_LATEST' - if 'ex_os' in kwargs: - os = kwargs['ex_os'] - elif 'image' in kwargs: - os = kwargs['image'].id - - size = kwargs.get('size', NodeSize(id=123, name='Custom', ram=None, - disk=None, bandwidth=None, - price=None, - driver=self.connection.driver)) - ex_size_data = SL_TEMPLATES.get(int(size.id)) or {} - # plan keys are ints - cpu_count = kwargs.get('ex_cpus') or ex_size_data.get('cpus') or \ - DEFAULT_CPU_SIZE - ram = kwargs.get('ex_ram') or ex_size_data.get('ram') or \ - DEFAULT_RAM_SIZE - bandwidth = kwargs.get('ex_bandwidth') or size.bandwidth or 10 - hourly = 'true' if kwargs.get('ex_hourly', True) else 'false' - - local_disk = 'true' - if ex_size_data.get('local_disk') is False: - local_disk = 'false' - - if kwargs.get('ex_local_disk') is False: - local_disk = 'false' - - disk_size = DEFAULT_DISK_SIZE - if size.disk: - disk_size = size.disk - if kwargs.get('ex_disk'): - disk_size = kwargs.get('ex_disk') - - datacenter = '' - if 'ex_datacenter' in kwargs: - datacenter = kwargs['ex_datacenter'] - elif 'location' in kwargs: - datacenter = kwargs['location'].id - - domain = kwargs.get('ex_domain') - if domain is None: - if name.find('.') != -1: - domain = name[name.find('.') + 1:] - if domain is None: - # TODO: domain is a required argument for the Sofylayer API, but it - # it shouldn't be. - domain = DEFAULT_DOMAIN - - newCCI = { - 'hostname': name, - 'domain': domain, - 'startCpus': cpu_count, - 'maxMemory': ram, - 'networkComponents': [{'maxSpeed': bandwidth}], - 'hourlyBillingFlag': hourly, - 'operatingSystemReferenceCode': os, - 'localDiskFlag': local_disk, - 'blockDevices': [ - { - 'device': '0', - 'diskImage': { - 'capacity': disk_size, - } - } - ] - - } - - if datacenter: - newCCI['datacenter'] = {'name': datacenter} - - if 'ex_keyname' in kwargs: - newCCI['sshKeys'] = [ - { - 'id': self._key_name_to_id(kwargs['ex_keyname']) - } - ] - - res = self.connection.request( - 'SoftLayer_Virtual_Guest', 'createObject', newCCI - ).object - - node_id = res['id'] - raw_node = self._get_order_information(node_id) - - return self._to_node(raw_node) - - def list_key_pairs(self): - result = self.connection.request( - 'SoftLayer_Account', 'getSshKeys' - ).object - elems = [x for x in result] - key_pairs = self._to_key_pairs(elems=elems) - return key_pairs - - def get_key_pair(self, name): - key_id = self._key_name_to_id(name=name) - result = self.connection.request( - 'SoftLayer_Security_Ssh_Key', 'getObject', id=key_id - ).object - return self._to_key_pair(result) - - # TODO: Check this with the libcloud guys, - # can we create new dependencies? - def create_key_pair(self, name, ex_size=4096): - if crypto is False: - raise NotImplementedError('create_key_pair needs' - 'the pycrypto library') - key = RSA.generate(ex_size) - new_key = { - 'key': key.publickey().exportKey('OpenSSH'), - 'label': name, - 'notes': '', - } - result = self.connection.request( - 'SoftLayer_Security_Ssh_Key', 'createObject', new_key - ).object - result['private'] = key.exportKey('PEM') - return self._to_key_pair(result) - - def import_key_pair_from_string(self, name, key_material): - new_key = { - 'key': key_material, - 'label': name, - 'notes': '', - } - result = self.connection.request( - 'SoftLayer_Security_Ssh_Key', 'createObject', new_key - ).object - - key_pair = self._to_key_pair(result) - return key_pair - - def delete_key_pair(self, key_pair): - key = self._key_name_to_id(key_pair) - result = self.connection.request( - 'SoftLayer_Security_Ssh_Key', 'deleteObject', id=key - ).object - return result - - def _to_image(self, img): - return NodeImage( - id=img['template']['operatingSystemReferenceCode'], - name=img['itemPrice']['item']['description'], - driver=self.connection.driver - ) - - def list_images(self, location=None): - result = self.connection.request( - 'SoftLayer_Virtual_Guest', 'getCreateObjectOptions' - ).object - return [self._to_image(i) for i in result['operatingSystems']] - - def _to_size(self, id, size): - return NodeSize( - id=id, - name=size['name'], - ram=size['ram'], - disk=size['disk'], - bandwidth=size.get('bandwidth'), - price=None, - driver=self.connection.driver, - ) - - def list_sizes(self, location=None): - return [self._to_size(id, s) for id, s in SL_TEMPLATES.items()] - - def _to_loc(self, loc): - country = 'UNKNOWN' - loc_id = loc['template']['datacenter']['name'] - name = loc_id - - if loc_id in DATACENTERS: - country = DATACENTERS[loc_id]['country'] - name = DATACENTERS[loc_id].get('name', loc_id) - return NodeLocation(id=loc_id, name=name, - country=country, driver=self) - - def list_locations(self): - res = self.connection.request( - 'SoftLayer_Virtual_Guest', 'getCreateObjectOptions' - ).object - return [self._to_loc(l) for l in res['datacenters']] - - def list_nodes(self): - mask = { - 'virtualGuests': { - 'powerState': '', - 'hostname': '', - 'maxMemory': '', - 'datacenter': '', - 'operatingSystem': {'passwords': ''}, - 'billingItem': '', - }, - } - res = self.connection.request( - 'SoftLayer_Account', - 'getVirtualGuests', - object_mask=mask - ).object - return [self._to_node(h) for h in res] - - def _to_key_pairs(self, elems): - key_pairs = [self._to_key_pair(elem=elem) for elem in elems] - return key_pairs - - def _to_key_pair(self, elem): - key_pair = KeyPair(name=elem['label'], - public_key=elem['key'], - fingerprint=elem['fingerprint'], - private_key=elem.get('private', None), - driver=self, - extra={'id': elem['id']}) - return key_pair - - def _key_name_to_id(self, name): - result = self.connection.request( - 'SoftLayer_Account', 'getSshKeys' - ).object - key_id = [x for x in result if x['label'] == name] - if len(key_id) == 0: - raise KeyPairDoesNotExistError(name, self) - else: - return int(key_id[0]['id']) diff --git a/libcloud/compute/drivers/upcloud.py b/libcloud/compute/drivers/upcloud.py new file mode 100644 index 0000000000..4419d9cea0 --- /dev/null +++ b/libcloud/compute/drivers/upcloud.py @@ -0,0 +1,703 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Upcloud node driver +""" + +import json +import base64 + +from libcloud.utils.py3 import b, httplib +from libcloud.common.base import JsonResponse, ConnectionUserAndKey +from libcloud.common.types import InvalidCredsError +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeState, + NodeDriver, + NodeLocation, + StorageVolume, +) +from libcloud.compute.types import Provider, StorageVolumeState +from libcloud.common.upcloud import ( + PlanPrice, + UpcloudNodeDestroyer, + UpcloudNodeOperations, + UpcloudCreateNodeRequestBody, +) + + +class UpcloudResponse(JsonResponse): + """ + Response class for UpcloudDriver + """ + + def success(self): + if self.status == httplib.NO_CONTENT: + return True + return super().success() + + def parse_error(self): + data = self.parse_body() + error = data.get("error", data) + if self.status == httplib.UNAUTHORIZED: + raise InvalidCredsError(value=error["error_message"]) + + if isinstance(error, dict): + message = error.get("error_message") + code = error.get("error_code") + if message and code: + return "{}: {}".format(code, message) + if message: + return message + + return json.dumps(data) + + +class UpcloudConnection(ConnectionUserAndKey): + """ + Connection class for UpcloudDriver + """ + + host = "api.upcloud.com" + responseCls = UpcloudResponse + + def __init__(self, user_id, key, *args, **kwargs): + self.token = kwargs.pop("token", None) + super().__init__(user_id, key, *args, **kwargs) + + def add_default_headers(self, headers): + """Adds headers that are needed for all requests""" + if self.token: + headers["Authorization"] = "Bearer {}".format(self.token) + else: + headers["Authorization"] = self._basic_auth() + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + return headers + + def _basic_auth(self): + """Constructs basic auth header content string""" + credentials = b("{}:{}".format(self.user_id, self.key)) + credentials = base64.b64encode(credentials) + return "Basic {}".format(credentials.decode("ascii")) + + +class UpcloudDriver(NodeDriver): + """ + Upcloud node driver + + :keyword username: Username required for basic authentication + :type username: ``str`` + + :keyword password: Password required for basic authentication + :type password: ``str`` + + :keyword token: Bearer API token used instead of username/password + :type token: ``str`` + """ + + type = Provider.UPCLOUD + name = "Upcloud" + website = "https://www.upcloud.com" + connectionCls = UpcloudConnection + features = {"create_node": ["ssh_key", "generates_password"]} + + NODE_STATE_MAP = { + "started": NodeState.RUNNING, + "stopped": NodeState.STOPPED, + "maintenance": NodeState.RECONFIGURING, + "error": NodeState.ERROR, + } + + STORAGE_VOLUME_STATE_MAP = { + "online": StorageVolumeState.AVAILABLE, + "maintenance": StorageVolumeState.UPDATING, + "cloning": StorageVolumeState.UPDATING, + "backuping": StorageVolumeState.BACKUP, + "syncing": StorageVolumeState.MIGRATING, + "error": StorageVolumeState.ERROR, + } + + def __init__(self, username=None, password=None, token=None, **kwargs): + if token is None and (username is None or password is None): + raise ValueError("Must provide either username/password or token.") + + self.token = token + super().__init__(key=username or "", secret=password or "", **kwargs) + + def _ex_connection_class_kwargs(self): + kwargs = super()._ex_connection_class_kwargs() + if self.token: + kwargs["token"] = self.token + return kwargs + + def list_locations(self): + """ + List available locations for deployment + + :rtype: ``list`` of :class:`NodeLocation` + """ + response = self.connection.request("1.3/zone") + return self._to_node_locations(response.object["zones"]["zone"]) + + def list_sizes(self, location=None): + """ + List available plans + + :param location: Location of the deployment. Price depends on + location. lf location is not given or price not found for + location, price will be None (optional) + :type location: :class:`.NodeLocation` + + :rtype: ``list`` of :class:`NodeSize` + """ + prices_response = self.connection.request("1.3/price") + response = self.connection.request("1.3/plan") + return self._to_node_sizes( + response.object["plans"]["plan"], + prices_response.object["prices"]["zone"], + location, + ) + + def list_images( + self, + location=None, + ): + """ + List available distributions. + + :rtype: ``list`` of :class:`NodeImage` + """ + response = self.connection.request("1.3/storage/template") + obj = response.object + response = self.connection.request("1.3/storage/cdrom") + storage = response.object["storages"]["storage"] + obj["storages"]["storage"].extend(storage) + return self._to_node_images(obj["storages"]["storage"]) + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_hostname="localhost", + ex_username="root", + ex_storage_devices=None, + ex_metadata=None, + ): + """ + Creates instance to upcloud. + + If auth is not given then password will be generated. + + :param name: String with a name for this new node (required) + :type name: ``str`` + + :param size: The size of resources allocated to this node. + (required) + :type size: :class:`.NodeSize` + + :param image: OS Image to boot on node. (required) + :type image: :class:`.NodeImage` + + :param location: Which data center to create a node in. If empty, + undefined behavior will be selected. (optional) + :type location: :class:`.NodeLocation` + + :param auth: Initial authentication information for the node + (optional) + :type auth: :class:`.NodeAuthSSHKey` + + :param ex_hostname: Hostname. Default is 'localhost'. (optional) + :type ex_hostname: ``str`` + + :param ex_username: User's username, which is created. + Default is 'root'. (optional) + :type ex_username: ``str`` + + :param ex_storage_devices: Additional UpCloud storage_device + dictionaries to include in the server + creation request. For example, an + ``attach`` action can attach an existing + storage and a ``create`` action can create + an extra data disk. (optional) + :type ex_storage_devices: ``list`` of ``dict`` + + :param ex_metadata: Enable or disable the UpCloud metadata service, + ``"yes"`` or ``"no"``. Cloud-init templates + require this to be enabled. (optional) + :type ex_metadata: ``str`` + + :return: The newly created node. + :rtype: :class:`.Node` + """ + body = UpcloudCreateNodeRequestBody( + name=name, + size=size, + image=image, + location=location, + auth=auth, + ex_hostname=ex_hostname, + ex_username=ex_username, + ex_storage_devices=ex_storage_devices, + ex_metadata=ex_metadata, + ) + response = self.connection.request("1.3/server", method="POST", data=body.to_json()) + server = response.object["server"] + # Upcloud server's are in maintenance state when going + # from state to other, it is safe to assume STARTING state + return self._to_node(server, state=NodeState.STARTING) + + def list_volumes(self): + """ + List normal storage volumes. + + :rtype: ``list`` of :class:`StorageVolume` + """ + response = self.connection.request("1.3/storage/normal") + return self._to_volumes(response.object["storages"]["storage"]) + + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + ex_tier="maxiops", + ex_backup_rule=None, + ): + """ + Create a new storage volume. + + :param size: Size of volume in gigabytes. (required) + :type size: ``int`` + + :param name: Name of the volume to be created. (required) + :type name: ``str`` + + :param location: Which data center to create a volume in. (required) + :type location: :class:`.NodeLocation` + + :param ex_tier: UpCloud storage tier: ``maxiops`` or ``hdd``. + Default is ``maxiops``. (optional) + :type ex_tier: ``str`` + + :param ex_backup_rule: Backup rule block for automatic backups. + (optional) + :type ex_backup_rule: ``dict`` + + :rtype: :class:`StorageVolume` + """ + if location is None: + raise ValueError("Must provide `location` value.") + + if snapshot is not None: + raise NotImplementedError("Creating a volume from snapshot is not supported.") + + storage = { + "size": size, + "title": name, + "zone": location.id, + "tier": ex_tier, + } + if ex_backup_rule is not None: + storage["backup_rule"] = ex_backup_rule + + response = self.connection.request( + "1.3/storage", + method="POST", + data=json.dumps({"storage": storage}), + ) + return self._to_volume(response.object["storage"]) + + def attach_volume( + self, + node, + volume, + device=None, + ex_type="disk", + ex_boot_disk=False, + ): + """ + Attach a storage volume to a node. + + :param node: Node to attach volume to. + :type node: :class:`Node` + + :param volume: Volume to attach. + :type volume: :class:`StorageVolume` + + :param device: UpCloud device address or bus, for example + ``virtio``, ``scsi`` or ``scsi:0:0``. (optional) + :type device: ``str`` + + :param ex_type: Attached device type, ``disk`` or ``cdrom``. + Default is ``disk``. (optional) + :type ex_type: ``str`` + + :param ex_boot_disk: Whether the storage should be a boot disk. + Default is False. (optional) + :type ex_boot_disk: ``bool`` + + :rtype: ``bool`` + """ + storage_device = { + "type": ex_type, + "storage": volume.id, + "boot_disk": "1" if ex_boot_disk else "0", + } + if device is not None: + storage_device["address"] = device + + self.connection.request( + "1.3/server/{}/storage/attach".format(node.id), + method="POST", + data=json.dumps({"storage_device": storage_device}), + ) + return True + + def detach_volume(self, volume, ex_node=None, ex_address=None): + """ + Detach a storage volume from its server. + + :param volume: Volume to detach. + :type volume: :class:`StorageVolume` + + :param ex_node: Node where the volume is attached. Required by the + UpCloud 1.3 detach endpoint. + :type ex_node: :class:`Node` + + :param ex_address: Device address to detach, for example + ``scsi:0:0``. Required by the UpCloud 1.3 detach + endpoint. + :type ex_address: ``str`` + + :rtype: ``bool`` + """ + if ex_node is None or ex_address is None: + raise ValueError( + "UpCloud API 1.3 requires `ex_node` and `ex_address` " "when detaching a volume." + ) + + self.connection.request( + "1.3/server/{}/storage/detach".format(ex_node.id), + method="POST", + data=json.dumps({"storage_device": {"address": ex_address}}), + ) + return True + + def destroy_volume(self, volume): + """ + Destroy a storage volume. + + :param volume: Volume to destroy. + :type volume: :class:`StorageVolume` + + :rtype: ``bool`` + """ + self.connection.request("1.3/storage/{}".format(volume.id), method="DELETE") + return True + + def ex_list_firewall_rules(self, node): + """ + List firewall rules for a node. + + :param node: Node whose firewall rules are listed. + :type node: :class:`Node` + + :rtype: ``list`` of ``dict`` + """ + response = self.connection.request("1.3/server/{}/firewall_rule".format(node.id)) + rules = response.object["firewall_rules"].get("firewall_rule", []) + if isinstance(rules, dict): + return [rules] + return rules + + def ex_get_firewall_rule(self, node, position): + """ + Get firewall rule details by rule position. + + :param node: Node whose firewall rule is fetched. + :type node: :class:`Node` + + :param position: Firewall rule position. + :type position: ``str`` or ``int`` + + :rtype: ``dict`` + """ + response = self.connection.request( + "1.3/server/{}/firewall_rule/{}".format(node.id, position) + ) + return response.object["firewall_rule"] + + def ex_create_firewall_rule(self, node, rule): + """ + Create a firewall rule for a node. + + :param node: Node where the firewall rule is created. + :type node: :class:`Node` + + :param rule: UpCloud firewall rule dictionary. + :type rule: ``dict`` + + :rtype: ``dict`` + """ + response = self.connection.request( + "1.3/server/{}/firewall_rule".format(node.id), + method="POST", + data=json.dumps({"firewall_rule": rule}), + ) + return response.object["firewall_rule"] + + def ex_create_firewall_rules(self, node, rules): + """ + Replace firewall rules for a node. + + :param node: Node whose firewall rules are replaced. + :type node: :class:`Node` + + :param rules: UpCloud firewall rule dictionaries. + :type rules: ``list`` of ``dict`` + + :rtype: ``bool`` + """ + self.connection.request( + "1.3/server/{}/firewall_rule".format(node.id), + method="PUT", + data=json.dumps({"firewall_rules": {"firewall_rule": rules}}), + ) + return True + + def ex_delete_firewall_rule(self, node, position): + """ + Delete a firewall rule by rule position. + + :param node: Node whose firewall rule is deleted. + :type node: :class:`Node` + + :param position: Firewall rule position. + :type position: ``str`` or ``int`` + + :rtype: ``bool`` + """ + self.connection.request( + "1.3/server/{}/firewall_rule/{}".format(node.id, position), + method="DELETE", + ) + return True + + def list_nodes(self): + """ + List nodes + + :return: List of node objects + :rtype: ``list`` of :class:`Node` + """ + servers = [] + for nid in self._node_ids(): + response = self.connection.request("1.3/server/{}".format(nid)) + servers.append(response.object["server"]) + return self._to_nodes(servers) + + def reboot_node(self, node): + """ + Reboot the given node + + :param node: the node to reboot + :type node: :class:`Node` + + :rtype: ``bool`` + """ + body = {"restart_server": {"stop_type": "hard"}} + self.connection.request( + "1.3/server/{}/restart".format(node.id), + method="POST", + data=json.dumps(body), + ) + return True + + def start_node(self, node): + """ + Start the given node. + + :param node: the node to start + :type node: :class:`Node` + + :rtype: ``bool`` + """ + self.connection.request("1.3/server/{}/start".format(node.id), method="POST") + return True + + def stop_node(self, node, ex_stop_type="hard", ex_timeout=None): + """ + Stop the given node. + + :param node: the node to stop + :type node: :class:`Node` + + :param ex_stop_type: Stop type, ``hard`` or ``soft``. Default is + ``hard`` to match the destroy helper behavior. + (optional) + :type ex_stop_type: ``str`` + + :param ex_timeout: Stop timeout in seconds when using a soft stop. + (optional) + :type ex_timeout: ``int`` + + :rtype: ``bool`` + """ + stop_server = {"stop_type": ex_stop_type} + if ex_timeout is not None: + stop_server["timeout"] = ex_timeout + + self.connection.request( + "1.3/server/{}/stop".format(node.id), + method="POST", + data=json.dumps({"stop_server": stop_server}), + ) + return True + + def destroy_node(self, node): + """ + Destroy the given node + + The disk resources, attached to node, will not be removed. + + :param node: the node to destroy + :type node: :class:`Node` + + :rtype: ``bool`` + """ + + operations = UpcloudNodeOperations(self.connection) + destroyer = UpcloudNodeDestroyer(operations) + return destroyer.destroy_node(node.id) + + def _node_ids(self): + """ + Returns list of server uids currently on upcloud + """ + response = self.connection.request("1.3/server") + servers = response.object["servers"]["server"] + return [server["uuid"] for server in servers] + + def _to_nodes(self, servers): + return [self._to_node(server) for server in servers] + + def _to_node(self, server, state=None): + ip_addresses = server["ip_addresses"]["ip_address"] + public_ips = [ip["address"] for ip in ip_addresses if ip["access"] == "public"] + private_ips = [ip["address"] for ip in ip_addresses if ip["access"] == "private"] + + extra = self._copy_dict_if_present(("password", "vnc_password"), server) + return Node( + id=server["uuid"], + name=server["title"], + state=state or self.NODE_STATE_MAP[server["state"]], + public_ips=public_ips, + private_ips=private_ips, + driver=self, + extra=extra, + ) + + def _to_node_locations(self, zones): + return [self._construct_node_location(zone) for zone in zones] + + def _construct_node_location(self, zone): + return NodeLocation( + id=zone["id"], + name=zone["description"], + country=self._parse_country(zone["id"]), + driver=self, + ) + + def _parse_country(self, zone_id): + """Parses the country information out of zone_id. + Zone_id format [country]_[city][number], like fi_hel1""" + return zone_id.split("-")[0].upper() + + def _to_node_sizes(self, plans, prices, location): + plan_price = PlanPrice(prices) + return [self._to_node_size(plan, plan_price, location) for plan in plans] + + def _to_node_size(self, plan, plan_price, location): + extra = self._copy_dict(("core_number", "storage_tier"), plan) + return NodeSize( + id=plan["name"], + name=plan["name"], + ram=plan["memory_amount"], + disk=plan["storage_size"], + bandwidth=plan["public_traffic_out"], + price=plan_price.get_price(plan["name"], location), + driver=self, + extra=extra, + ) + + def _to_node_images(self, images): + return [self._construct_node_image(image) for image in images] + + def _construct_node_image(self, image): + extra = self._copy_dict(("access", "license", "size", "state", "type"), image) + return NodeImage(id=image["uuid"], name=image["title"], driver=self, extra=extra) + + def _to_volumes(self, volumes): + return [self._to_volume(volume) for volume in volumes] + + def _to_volume(self, volume): + extra_keys = ( + "access", + "backup_rule", + "backups", + "encrypted", + "labels", + "license", + "origin", + "part_of_plan", + "progress", + "servers", + "tier", + "type", + "zone", + ) + extra = {} + for key in extra_keys: + if key in volume: + extra[key] = volume[key] + + return StorageVolume( + id=volume["uuid"], + name=volume["title"], + size=int(volume["size"]), + driver=self, + state=self.STORAGE_VOLUME_STATE_MAP.get(volume["state"], StorageVolumeState.UNKNOWN), + extra=extra, + ) + + def _copy_dict(self, keys, d): + extra = {} + for key in keys: + extra[key] = d[key] + return extra + + def _copy_dict_if_present(self, keys, d): + extra = {} + for key in keys: + if key in d: + extra[key] = d[key] + return extra diff --git a/libcloud/compute/drivers/vcl.py b/libcloud/compute/drivers/vcl.py index a5ec4644d7..533733f75a 100644 --- a/libcloud/compute/drivers/vcl.py +++ b/libcloud/compute/drivers/vcl.py @@ -19,26 +19,25 @@ import time from libcloud.common.base import ConnectionUserAndKey +from libcloud.common.types import LibcloudError, InvalidCredsError +from libcloud.compute.base import Node, NodeSize, NodeImage, NodeDriver from libcloud.common.xmlrpc import XMLRPCResponse, XMLRPCConnection -from libcloud.common.types import InvalidCredsError, LibcloudError from libcloud.compute.types import Provider, NodeState -from libcloud.compute.base import NodeDriver, Node -from libcloud.compute.base import NodeSize, NodeImage class VCLResponse(XMLRPCResponse): exceptions = { - 'VCL_Account': InvalidCredsError, + "VCL_Account": InvalidCredsError, } class VCLConnection(XMLRPCConnection, ConnectionUserAndKey): - endpoint = '/index.php?mode=xmlrpccall' + endpoint = "/index.php?mode=xmlrpccall" def add_default_headers(self, headers): - headers['X-APIVERSION'] = '2' - headers['X-User'] = self.user_id - headers['X-Pass'] = self.key + headers["X-APIVERSION"] = "2" + headers["X-User"] = self.user_id + headers["X-Pass"] = self.key return headers @@ -51,25 +50,24 @@ class VCLNodeDriver(NodeDriver): """ NODE_STATE_MAP = { - 'ready': NodeState.RUNNING, - 'failed': NodeState.TERMINATED, - 'timedout': NodeState.TERMINATED, - 'loading': NodeState.PENDING, - 'time': NodeState.PENDING, - 'future': NodeState.PENDING, - 'error': NodeState.UNKNOWN, - 'notready': NodeState.PENDING, - 'notavailable': NodeState.TERMINATED, - 'success': NodeState.PENDING + "ready": NodeState.RUNNING, + "failed": NodeState.TERMINATED, + "timedout": NodeState.TERMINATED, + "loading": NodeState.PENDING, + "time": NodeState.PENDING, + "future": NodeState.PENDING, + "error": NodeState.UNKNOWN, + "notready": NodeState.PENDING, + "notavailable": NodeState.TERMINATED, + "success": NodeState.PENDING, } connectionCls = VCLConnection - name = 'VCL' - website = 'http://incubator.apache.org/vcl/' + name = "VCL" + website = "http://incubator.apache.org/vcl/" type = Provider.VCL - def __init__(self, key, secret, secure=True, host=None, port=None, *args, - **kwargs): + def __init__(self, key, secret, secure=True, host=None, port=None, *args, **kwargs): """ :param key: API key or username to used (required) :type key: ``str`` @@ -77,7 +75,7 @@ def __init__(self, key, secret, secure=True, host=None, port=None, *args, :param secret: Secret password to be used (required) :type secret: ``str`` - :param secure: Weither to use HTTPS or HTTP. + :param secure: Whether to use HTTPS or HTTP. :type secure: ``bool`` :param host: Override hostname used for connections. (required) @@ -89,23 +87,28 @@ def __init__(self, key, secret, secure=True, host=None, port=None, *args, :rtype: ``None`` """ if not host: - raise Exception('When instantiating VCL driver directly ' + - 'you also need to provide host') + raise Exception( + "When instantiating VCL driver directly " + "you also need to provide host" + ) - super(VCLNodeDriver, self).__init__(key, secret, secure=True, - host=None, port=None, *args, - **kwargs) + super().__init__(key, secret, secure=True, host=None, port=None, *args, **kwargs) def _vcl_request(self, method, *args): - res = self.connection.request( - method, - *args - ).object - if(res['status'] == 'error'): - raise LibcloudError(res['errormsg'], driver=self) + res = self.connection.request(method, *args).object + if res["status"] == "error": + raise LibcloudError(res["errormsg"], driver=self) return res - def create_node(self, **kwargs): + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + start=None, + length="60", + ): """Create a new VCL reservation size and name ignored, image is the id from list_image @@ -121,25 +124,21 @@ def create_node(self, **kwargs): :type length: ``str`` """ - image = kwargs["image"] - start = kwargs.get('start', int(time.time())) - length = kwargs.get('length', '60') + # Special case for xmlrpclib not handling 64 bit integers when writing + # XML - we always cast value to string. + start = start or str(time.time()) + length = length or "60" - res = self._vcl_request( - "XMLRPCaddRequest", - image.id, - start, - length - ) + res = self._vcl_request("XMLRPCaddRequest", image.id, start, length) return Node( - id=res['requestid'], + id=res["requestid"], name=image.name, - state=self.NODE_STATE_MAP[res['status']], + state=self.NODE_STATE_MAP[res["status"]], public_ips=[], private_ips=[], driver=self, - image=image.name + image=image.name, ) def destroy_node(self, node): @@ -153,20 +152,13 @@ def destroy_node(self, node): :rtype: ``bool`` """ try: - self._vcl_request( - 'XMLRPCendRequest', - node.id - ) + self._vcl_request("XMLRPCendRequest", node.id) except LibcloudError: return False return True def _to_image(self, img): - return NodeImage( - id=img['id'], - name=img['name'], - driver=self.connection.driver - ) + return NodeImage(id=img["id"], name=img["name"], driver=self.connection.driver) def list_images(self, location=None): """ @@ -174,9 +166,7 @@ def list_images(self, location=None): @inherits: :class:`NodeDriver.list_images` """ - res = self.connection.request( - "XMLRPCgetImages" - ).object + res = self.connection.request("XMLRPCgetImages").object return [self._to_image(i) for i in res] def list_sizes(self, location=None): @@ -186,53 +176,34 @@ def list_sizes(self, location=None): @inherits: :class:`NodeDriver.list_sizes` """ - return [NodeSize( - 't1.micro', - 'none', - '512', - 0, 0, 0, self) - ] + return [NodeSize("t1.micro", "none", "512", 0, 0, 0, self)] def _to_connect_data(self, request_id, ipaddr): - res = self._vcl_request( - "XMLRPCgetRequestConnectData", - request_id, - ipaddr - ) + res = self._vcl_request("XMLRPCgetRequestConnectData", request_id, ipaddr) return res def _to_status(self, requestid, imagename, ipaddr): - res = self._vcl_request( - "XMLRPCgetRequestStatus", - requestid - ) + res = self._vcl_request("XMLRPCgetRequestStatus", requestid) public_ips = [] extra = [] - if(res['status'] == 'ready'): + if res["status"] == "ready": cdata = self._to_connect_data(requestid, ipaddr) - public_ips = [cdata['serverIP']] - extra = { - 'user': cdata['user'], - 'pass': cdata['password'] - } + public_ips = [cdata["serverIP"]] + extra = {"user": cdata["user"], "pass": cdata["password"]} return Node( id=requestid, name=imagename, - state=self.NODE_STATE_MAP[res['status']], + state=self.NODE_STATE_MAP[res["status"]], public_ips=public_ips, private_ips=[], driver=self, image=imagename, - extra=extra + extra=extra, ) def _to_nodes(self, res, ipaddr): - return [self._to_status( - h['requestid'], - h['imagename'], - ipaddr - ) for h in res] + return [self._to_status(h["requestid"], h["imagename"], ipaddr) for h in res] def list_nodes(self, ipaddr): """ @@ -243,10 +214,8 @@ def list_nodes(self, ipaddr): :rtype: ``list`` of :class:`Node` """ - res = self._vcl_request( - "XMLRPCgetRequestIds" - ) - return self._to_nodes(res['requests'], ipaddr) + res = self._vcl_request("XMLRPCgetRequestIds") + return self._to_nodes(res["requests"], ipaddr) def ex_update_node_access(self, node, ipaddr): """ @@ -276,11 +245,7 @@ def ex_extend_request_time(self, node, minutes): :return: true on success, throws error on failure :rtype: ``bool`` """ - return self._vcl_request( - "XMLRPCextendRequest", - node.id, - minutes - ) + return self._vcl_request("XMLRPCextendRequest", node.id, minutes) def ex_get_request_end_time(self, node): """ @@ -292,11 +257,9 @@ def ex_get_request_end_time(self, node): :return: unix timestamp :rtype: ``int`` """ - res = self._vcl_request( - "XMLRPCgetRequestIds" - ) + res = self._vcl_request("XMLRPCgetRequestIds") time = 0 - for i in res['requests']: - if i['requestid'] == node.id: - time = i['end'] + for i in res["requests"]: + if i["requestid"] == node.id: + time = i["end"] return time diff --git a/libcloud/compute/drivers/vcloud.py b/libcloud/compute/drivers/vcloud.py index 0ce10b3fd8..658701535e 100644 --- a/libcloud/compute/drivers/vcloud.py +++ b/libcloud/compute/drivers/vcloud.py @@ -15,34 +15,25 @@ """ VMware vCloud driver. """ -import copy -import sys -import re -import base64 -import os -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlencode -from libcloud.utils.py3 import urlparse -from libcloud.utils.py3 import b -from libcloud.utils.py3 import next - -urlparse = urlparse.urlparse +import os +import re +import copy import time - -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - +import base64 +import datetime from xml.parsers.expat import ExpatError +from libcloud.utils.py3 import ET, b, next, httplib, urlparse, urlencode from libcloud.common.base import XmlResponse, ConnectionUserAndKey -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.compute.providers import Provider +from libcloud.common.types import LibcloudError, InvalidCredsError +from libcloud.compute.base import Node, NodeSize, NodeImage, NodeDriver, NodeLocation from libcloud.compute.types import NodeState -from libcloud.compute.base import Node, NodeDriver, NodeLocation -from libcloud.compute.base import NodeSize, NodeImage +from libcloud.utils.iso8601 import parse_date +from libcloud.compute.providers import Provider + +urlparse = urlparse.urlparse + """ From vcloud api "The VirtualQuantity element defines the number of MB @@ -53,21 +44,24 @@ # Default timeout (in seconds) for long running tasks DEFAULT_TASK_COMPLETION_TIMEOUT = 600 -DEFAULT_API_VERSION = '0.8' +DEFAULT_API_VERSION = "0.8" """ Valid vCloud API v1.5 input values. """ VIRTUAL_CPU_VALS_1_5 = [i for i in range(1, 9)] -FENCE_MODE_VALS_1_5 = ['bridged', 'isolated', 'natRouted'] -IP_MODE_VALS_1_5 = ['POOL', 'DHCP', 'MANUAL', 'NONE'] +FENCE_MODE_VALS_1_5 = ["bridged", "isolated", "natRouted"] +IP_MODE_VALS_1_5 = ["POOL", "DHCP", "MANUAL", "NONE"] + +# Regular expression for validating node / VM name +HOSTNAME_RE = re.compile(r"^(?!-)[A-Z\d-]{1,63}(?' - % (self.id, self.name, self.driver.name)) + return "".format( + self.id, + self.name, + self.driver.name, + ) -class Capacity(object): +class Capacity: """ Represents CPU, Memory or Storage capacity of vDC. """ + def __init__(self, limit, used, units): self.limit = limit self.used = used self.units = units def __repr__(self): - return ('' - % (self.limit, self.used, self.units)) + return "".format( + self.limit, + self.used, + self.units, + ) -class ControlAccess(object): +class ControlAccess: """ Represents control access settings of a node """ - class AccessLevel(object): - READ_ONLY = 'ReadOnly' - CHANGE = 'Change' - FULL_CONTROL = 'FullControl' + + class AccessLevel: + READ_ONLY = "ReadOnly" + CHANGE = "Change" + FULL_CONTROL = "FullControl" def __init__(self, node, everyone_access_level, subjects=None): self.node = node self.everyone_access_level = everyone_access_level + if not subjects: subjects = [] self.subjects = subjects def __repr__(self): - return ('' - % (self.node, self.everyone_access_level, self.subjects)) + return "" % ( + self.node, + self.everyone_access_level, + self.subjects, + ) -class Subject(object): +class Subject: """ User or group subject """ + def __init__(self, type, name, access_level, id=None): self.type = type self.name = name @@ -141,14 +156,149 @@ def __init__(self, type, name, access_level, id=None): self.id = id def __repr__(self): - return ('' - % (self.type, self.name, self.access_level)) + return "".format( + self.type, + self.name, + self.access_level, + ) + + +class Lease: + """ + Lease information for vApps. + + More info at: 'https://www.vmware.com/support/vcd/doc/ + rest-api-doc-1.5-html/types/LeaseSettingsSectionType.html' + """ + + def __init__( + self, + lease_id, + deployment_lease=None, + storage_lease=None, + deployment_lease_expiration=None, + storage_lease_expiration=None, + ): + """ + :param lease_id: ID (link) to the lease settings section of a vApp. + :type lease_id: ``str`` + + :param deployment_lease: Deployment lease time in seconds + :type deployment_lease: ``int`` or ``None`` + + :param storage_lease: Storage lease time in seconds + :type storage_lease: ``int`` or ``None`` + + :param deployment_lease_expiration: Deployment lease expiration time + :type deployment_lease_expiration: ``datetime.datetime`` or ``None`` + + :param storage_lease_expiration: Storage lease expiration time + :type storage_lease_expiration: ``datetime.datetime`` or ``None`` + """ + self.lease_id = lease_id + self.deployment_lease = deployment_lease + self.storage_lease = storage_lease + self.deployment_lease_expiration = deployment_lease_expiration + self.storage_lease_expiration = storage_lease_expiration + + @classmethod + def to_lease(cls, lease_element): + """ + Convert lease settings element to lease instance. + + :param lease_element: "LeaseSettingsSection" XML element + :type lease_element: ``ET.Element`` + + :return: Lease instance + :rtype: :class:`Lease` + """ + lease_id = lease_element.get("href") + deployment_lease = lease_element.find(fixxpath(lease_element, "DeploymentLeaseInSeconds")) + storage_lease = lease_element.find(fixxpath(lease_element, "StorageLeaseInSeconds")) + deployment_lease_expiration = lease_element.find( + fixxpath(lease_element, "DeploymentLeaseExpiration") + ) + storage_lease_expiration = lease_element.find( + fixxpath(lease_element, "StorageLeaseExpiration") + ) + + def apply_if_elem_not_none(elem, function): + return function(elem.text) if elem is not None else None + + return cls( + lease_id=lease_id, + deployment_lease=apply_if_elem_not_none(deployment_lease, int), + storage_lease=apply_if_elem_not_none(storage_lease, int), + deployment_lease_expiration=apply_if_elem_not_none( + deployment_lease_expiration, parse_date + ), + storage_lease_expiration=apply_if_elem_not_none(storage_lease_expiration, parse_date), + ) + + def get_deployment_time(self): + """ + Gets the date and time a vApp was deployed. Time is inferred from the + deployment lease and expiration or the storage lease and expiration. + + :return: Date and time the vApp was deployed or None if unable to + calculate + :rtype: ``datetime.datetime`` or ``None`` + """ + + if self.deployment_lease is not None and self.deployment_lease_expiration is not None: + return self.deployment_lease_expiration - datetime.timedelta( + seconds=self.deployment_lease + ) + + if self.storage_lease is not None and self.storage_lease_expiration is not None: + return self.storage_lease_expiration - datetime.timedelta(seconds=self.storage_lease) + + raise Exception( + "Cannot get time deployed. " "Missing complete lease and expiration information." + ) + + def __repr__(self): + return ( + "".format( + lease_id=self.lease_id, + deployment_lease=self.deployment_lease, + storage_lease=self.storage_lease, + deployment_lease_expiration=self.deployment_lease_expiration, + storage_lease_expiration=self.storage_lease_expiration, + ) + ) + def __eq__(self, other): + if not isinstance(other, Lease): + return False -class InstantiateVAppXML(object): + return ( + self.lease_id == other.lease_id + and self.deployment_lease == other.deployment_lease + and self.storage_lease == other.storage_lease + and (self.deployment_lease_expiration == other.deployment_lease_expiration) + and self.storage_lease_expiration == other.storage_lease_expiration + ) - def __init__(self, name, template, net_href, cpus, memory, - password=None, row=None, group=None): + def __ne__(self, other): + return not self == other + + +class InstantiateVAppXML: + def __init__( + self, + name, + template, + net_href, + cpus, + memory, + password=None, + row=None, + group=None, + ): self.name = name self.template = template self.net_href = net_href @@ -167,52 +317,49 @@ def _build_xmltree(self): self.root = self._make_instantiation_root() self._add_vapp_template(self.root) - instantiation_params = ET.SubElement(self.root, - "InstantiationParams") + instantiation_params = ET.SubElement(self.root, "InstantiationParams") # product and virtual hardware self._make_product_section(instantiation_params) self._make_virtual_hardware(instantiation_params) - network_config_section = ET.SubElement(instantiation_params, - "NetworkConfigSection") + network_config_section = ET.SubElement(instantiation_params, "NetworkConfigSection") - network_config = ET.SubElement(network_config_section, - "NetworkConfig") + network_config = ET.SubElement(network_config_section, "NetworkConfig") self._add_network_association(network_config) def _make_instantiation_root(self): return ET.Element( "InstantiateVAppTemplateParams", - {'name': self.name, - 'xml:lang': 'en', - 'xmlns': "http://www.vmware.com/vcloud/v0.8", - 'xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance"} + { + "name": self.name, + "xml:lang": "en", + "xmlns": "http://www.vmware.com/vcloud/v0.8", + "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + }, ) def _add_vapp_template(self, parent): - return ET.SubElement( - parent, - "VAppTemplate", - {'href': self.template} - ) + return ET.SubElement(parent, "VAppTemplate", {"href": self.template}) def _make_product_section(self, parent): prod_section = ET.SubElement( parent, "ProductSection", - {'xmlns:q1': "http://www.vmware.com/vcloud/v0.8", - 'xmlns:ovf': "http://schemas.dmtf.org/ovf/envelope/1"} + { + "xmlns:q1": "http://www.vmware.com/vcloud/v0.8", + "xmlns:ovf": "http://schemas.dmtf.org/ovf/envelope/1", + }, ) if self.password: - self._add_property(prod_section, 'password', self.password) + self._add_property(prod_section, "password", self.password) if self.row: - self._add_property(prod_section, 'row', self.row) + self._add_property(prod_section, "row", self.row) if self.group: - self._add_property(prod_section, 'group', self.group) + self._add_property(prod_section, "group", self.group) return prod_section @@ -220,16 +367,18 @@ def _add_property(self, parent, ovfkey, ovfvalue): return ET.SubElement( parent, "Property", - {'xmlns': 'http://schemas.dmtf.org/ovf/envelope/1', - 'ovf:key': ovfkey, - 'ovf:value': ovfvalue} + { + "xmlns": "http://schemas.dmtf.org/ovf/envelope/1", + "ovf:key": ovfkey, + "ovf:value": ovfvalue, + }, ) def _make_virtual_hardware(self, parent): vh = ET.SubElement( parent, "VirtualHardwareSection", - {'xmlns:q1': "http://www.vmware.com/vcloud/v0.8"} + {"xmlns:q1": "http://www.vmware.com/vcloud/v0.8"}, ) self._add_cpu(vh) @@ -239,24 +388,20 @@ def _make_virtual_hardware(self, parent): def _add_cpu(self, parent): cpu_item = ET.SubElement( - parent, - "Item", - {'xmlns': "http://schemas.dmtf.org/ovf/envelope/1"} + parent, "Item", {"xmlns": "http://schemas.dmtf.org/ovf/envelope/1"} ) - self._add_instance_id(cpu_item, '1') - self._add_resource_type(cpu_item, '3') + self._add_instance_id(cpu_item, "1") + self._add_resource_type(cpu_item, "3") self._add_virtual_quantity(cpu_item, self.cpus) return cpu_item def _add_memory(self, parent): mem_item = ET.SubElement( - parent, - 'Item', - {'xmlns': "http://schemas.dmtf.org/ovf/envelope/1"} + parent, "Item", {"xmlns": "http://schemas.dmtf.org/ovf/envelope/1"} ) - self._add_instance_id(mem_item, '2') - self._add_resource_type(mem_item, '4') + self._add_instance_id(mem_item, "2") + self._add_resource_type(mem_item, "4") self._add_virtual_quantity(mem_item, self.memory) return mem_item @@ -264,50 +409,57 @@ def _add_memory(self, parent): def _add_instance_id(self, parent, id): elm = ET.SubElement( parent, - 'InstanceID', - {'xmlns': 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/' - 'CIM_ResourceAllocationSettingData'} + "InstanceID", + { + "xmlns": "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/" + "CIM_ResourceAllocationSettingData" + }, ) elm.text = id + return elm def _add_resource_type(self, parent, type): elm = ET.SubElement( parent, - 'ResourceType', - {'xmlns': 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/' - 'CIM_ResourceAllocationSettingData'} + "ResourceType", + { + "xmlns": "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/" + "CIM_ResourceAllocationSettingData" + }, ) elm.text = type + return elm def _add_virtual_quantity(self, parent, amount): elm = ET.SubElement( parent, - 'VirtualQuantity', - {'xmlns': 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/' - 'CIM_ResourceAllocationSettingData'} + "VirtualQuantity", + { + "xmlns": "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/" + "CIM_ResourceAllocationSettingData" + }, ) elm.text = amount + return elm def _add_network_association(self, parent): - return ET.SubElement( - parent, - 'NetworkAssociation', - {'href': self.net_href} - ) + return ET.SubElement(parent, "NetworkAssociation", {"href": self.net_href}) class VCloudResponse(XmlResponse): - def success(self): - return self.status in (httplib.OK, httplib.CREATED, - httplib.NO_CONTENT, httplib.ACCEPTED) + return self.status in ( + httplib.OK, + httplib.CREATED, + httplib.NO_CONTENT, + httplib.ACCEPTED, + ) class VCloudConnection(ConnectionUserAndKey): - """ Connection class for the vCloud driver """ @@ -318,7 +470,8 @@ class VCloudConnection(ConnectionUserAndKey): def request(self, *args, **kwargs): self._get_auth_token() - return super(VCloudConnection, self).request(*args, **kwargs) + + return super().request(*args, **kwargs) def check_org(self): # the only way to get our org is by logging in. @@ -326,74 +479,85 @@ def check_org(self): def _get_auth_headers(self): """Some providers need different headers than others""" + return { - 'Authorization': "Basic %s" % base64.b64encode( - b('%s:%s' % (self.user_id, self.key))).decode('utf-8'), - 'Content-Length': '0', - 'Accept': 'application/*+xml' + "Authorization": "Basic %s" + % base64.b64encode(b("{}:{}".format(self.user_id, self.key))).decode("utf-8"), + "Content-Length": "0", + "Accept": "application/*+xml", } def _get_auth_token(self): if not self.token: - conn = self.conn_classes[self.secure](self.host, - self.port) - conn.request(method='POST', url='/api/v0.8/login', - headers=self._get_auth_headers()) + self.connection.request( + method="POST", url="/api/v0.8/login", headers=self._get_auth_headers() + ) - resp = conn.getresponse() - headers = dict(resp.getheaders()) - body = ET.XML(resp.read()) + resp = self.connection.getresponse() + headers = resp.headers + body = ET.XML(resp.text) try: - self.token = headers['set-cookie'] + self.token = headers["set-cookie"] except KeyError: raise InvalidCredsError() - self.driver.org = get_url_path( - body.find(fixxpath(body, 'Org')).get('href') - ) + self.driver.org = get_url_path(body.find(fixxpath(body, "Org")).get("href")) def add_default_headers(self, headers): - headers['Cookie'] = self.token - headers['Accept'] = 'application/*+xml' + headers["Cookie"] = self.token + headers["Accept"] = "application/*+xml" + return headers class VCloudNodeDriver(NodeDriver): - """ vCloud node driver """ type = Provider.VCLOUD - name = 'vCloud' - website = 'http://www.vmware.com/products/vcloud/' + name = "vCloud" + website = "http://www.vmware.com/products/vcloud/" connectionCls = VCloudConnection org = None _vdcs = None - NODE_STATE_MAP = {'0': NodeState.PENDING, - '1': NodeState.PENDING, - '2': NodeState.PENDING, - '3': NodeState.PENDING, - '4': NodeState.RUNNING} - - features = {'create_node': ['password']} - - def __new__(cls, key, secret=None, secure=True, host=None, port=None, - api_version=DEFAULT_API_VERSION, **kwargs): + NODE_STATE_MAP = { + "0": NodeState.PENDING, + "1": NodeState.PENDING, + "2": NodeState.PENDING, + "3": NodeState.PENDING, + "4": NodeState.RUNNING, + } + + features = {"create_node": ["password"]} + + def __new__( + cls, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=DEFAULT_API_VERSION, + **kwargs, + ): if cls is VCloudNodeDriver: - if api_version == '0.8': + if api_version == "0.8": cls = VCloudNodeDriver - elif api_version == '1.5': + elif api_version == "1.5": cls = VCloud_1_5_NodeDriver - elif api_version == '5.1': + elif api_version == "5.1": cls = VCloud_5_1_NodeDriver + elif api_version == "5.5": + cls = VCloud_5_5_NodeDriver else: raise NotImplementedError( - "No VCloudNodeDriver found for API version %s" % - (api_version)) - return super(VCloudNodeDriver, cls).__new__(cls) + "No VCloudNodeDriver found for API version %s" % (api_version) + ) + + return super().__new__(cls) @property def vdcs(self): @@ -403,156 +567,163 @@ def vdcs(self): :return: list of vDC objects :rtype: ``list`` of :class:`Vdc` """ + if not self._vdcs: self.connection.check_org() # make sure the org is set. res = self.connection.request(self.org) self._vdcs = [ - self._to_vdc( - self.connection.request(get_url_path(i.get('href'))).object - ) + self._to_vdc(self.connection.request(get_url_path(i.get("href"))).object) for i in res.object.findall(fixxpath(res.object, "Link")) - if i.get('type') == 'application/vnd.vmware.vcloud.vdc+xml' + if i.get("type") == "application/vnd.vmware.vcloud.vdc+xml" ] + return self._vdcs def _to_vdc(self, vdc_elm): - return Vdc(vdc_elm.get('href'), vdc_elm.get('name'), self) + return Vdc(vdc_elm.get("href"), vdc_elm.get("name"), self) def _get_vdc(self, vdc_name): vdc = None + if not vdc_name: # Return the first organisation VDC found vdc = self.vdcs[0] else: for v in self.vdcs: - if v.name == vdc_name: + if v.name == vdc_name or v.id == vdc_name: vdc = v + if vdc is None: - raise ValueError('%s virtual data centre could not be found', - vdc_name) + raise ValueError("%s virtual data centre could not be found" % (vdc_name)) + return vdc @property def networks(self): networks = [] + for vdc in self.vdcs: res = self.connection.request(get_url_path(vdc.id)).object networks.extend( - [network - for network in res.findall( - fixxpath(res, 'AvailableNetworks/Network') - - )] + [network for network in res.findall(fixxpath(res, "AvailableNetworks/Network"))] ) return networks def _to_image(self, image): - image = NodeImage(id=image.get('href'), - name=image.get('name'), - driver=self.connection.driver) + image = NodeImage( + id=image.get("href"), name=image.get("name"), driver=self.connection.driver + ) + return image def _to_node(self, elm): - state = self.NODE_STATE_MAP[elm.get('status')] - name = elm.get('name') + state = self.NODE_STATE_MAP[elm.get("status")] + name = elm.get("name") public_ips = [] private_ips = [] # Following code to find private IPs works for Terremark - connections = elm.findall('%s/%s' % ( - '{http://schemas.dmtf.org/ovf/envelope/1}NetworkConnectionSection', - fixxpath(elm, 'NetworkConnection')) + connections = elm.findall( + "%s/%s" + % ( + "{http://schemas.dmtf.org/ovf/envelope/1}NetworkConnectionSection", + fixxpath(elm, "NetworkConnection"), + ) ) + if not connections: connections = elm.findall( - fixxpath( - elm, - 'Children/Vm/NetworkConnectionSection/NetworkConnection')) + fixxpath(elm, "Children/Vm/NetworkConnectionSection/NetworkConnection") + ) for connection in connections: - ips = [ip.text - for ip - in connection.findall(fixxpath(elm, "IpAddress"))] - if connection.get('Network') == 'Internal': + ips = [ip.text for ip in connection.findall(fixxpath(elm, "IpAddress"))] + + if connection.get("Network") == "Internal": private_ips.extend(ips) else: public_ips.extend(ips) - node = Node(id=elm.get('href'), - name=name, - state=state, - public_ips=public_ips, - private_ips=private_ips, - driver=self.connection.driver) + node = Node( + id=elm.get("href"), + name=name, + state=state, + public_ips=public_ips, + private_ips=private_ips, + driver=self.connection.driver, + ) return node def _get_catalog_hrefs(self): res = self.connection.request(self.org) catalogs = [ - i.get('href') + i.get("href") for i in res.object.findall(fixxpath(res.object, "Link")) - if i.get('type') == 'application/vnd.vmware.vcloud.catalog+xml' + if i.get("type") == "application/vnd.vmware.vcloud.catalog+xml" ] return catalogs - def _wait_for_task_completion(self, task_href, - timeout=DEFAULT_TASK_COMPLETION_TIMEOUT): + def _wait_for_task_completion(self, task_href, timeout=DEFAULT_TASK_COMPLETION_TIMEOUT): start_time = time.time() res = self.connection.request(get_url_path(task_href)) - status = res.object.get('status') - while status != 'success': - if status == 'error': + status = res.object.get("status") + + while status != "success": + if status == "error": # Get error reason from the response body - error_elem = res.object.find(fixxpath(res.object, 'Error')) + error_elem = res.object.find(fixxpath(res.object, "Error")) error_msg = "Unknown error" + if error_elem is not None: - error_msg = error_elem.get('message') - raise Exception("Error status returned by task %s.: %s" - % (task_href, error_msg)) - if status == 'canceled': - raise Exception("Canceled status returned by task %s." - % task_href) - if (time.time() - start_time >= timeout): - raise Exception("Timeout (%s sec) while waiting for task %s." - % (timeout, task_href)) + error_msg = error_elem.get("message") + raise Exception( + "Error status returned by task {}.: {}".format(task_href, error_msg) + ) + + if status == "canceled": + raise Exception("Canceled status returned by task %s." % task_href) + + if time.time() - start_time >= timeout: + raise Exception( + "Timeout ({} sec) while waiting for task {}.".format(timeout, task_href) + ) time.sleep(5) res = self.connection.request(get_url_path(task_href)) - status = res.object.get('status') + status = res.object.get("status") def destroy_node(self, node): node_path = get_url_path(node.id) # blindly poweroff node, it will throw an exception if already off try: - res = self.connection.request('%s/power/action/poweroff' - % node_path, - method='POST') - self._wait_for_task_completion(res.object.get('href')) + res = self.connection.request("%s/power/action/poweroff" % node_path, method="POST") + self._wait_for_task_completion(res.object.get("href")) except Exception: pass try: - res = self.connection.request('%s/action/undeploy' % node_path, - method='POST') - self._wait_for_task_completion(res.object.get('href')) + res = self.connection.request("%s/action/undeploy" % node_path, method="POST") + self._wait_for_task_completion(res.object.get("href")) except ExpatError: # The undeploy response is malformed XML atm. - # We can remove this whent he providers fix the problem. + # We can remove this when the providers fix the problem. pass except Exception: # Some vendors don't implement undeploy at all yet, # so catch this and move on. pass - res = self.connection.request(node_path, method='DELETE') + res = self.connection.request(node_path, method="DELETE") + return res.status == httplib.ACCEPTED def reboot_node(self, node): - res = self.connection.request('%s/power/action/reset' - % get_url_path(node.id), - method='POST') + res = self.connection.request( + "%s/power/action/reset" % get_url_path(node.id), method="POST" + ) + return res.status in [httplib.ACCEPTED, httplib.NO_CONTENT] def list_nodes(self): @@ -569,38 +740,39 @@ def ex_list_nodes(self, vdcs=None): :rtype: ``list`` of :class:`Node` """ + if not vdcs: vdcs = self.vdcs + if not isinstance(vdcs, (list, tuple)): vdcs = [vdcs] nodes = [] + for vdc in vdcs: res = self.connection.request(get_url_path(vdc.id)) - elms = res.object.findall(fixxpath( - res.object, "ResourceEntities/ResourceEntity") - ) + elms = res.object.findall(fixxpath(res.object, "ResourceEntities/ResourceEntity")) vapps = [ - (i.get('name'), i.get('href')) - for i in elms if - i.get('type') == 'application/vnd.vmware.vcloud.vApp+xml' and - i.get('name') + (i.get("name"), i.get("href")) + for i in elms + if i.get("type") == "application/vnd.vmware.vcloud.vApp+xml" and i.get("name") ] for vapp_name, vapp_href in vapps: try: res = self.connection.request( get_url_path(vapp_href), - headers={'Content-Type': - 'application/vnd.vmware.vcloud.vApp+xml'} + headers={"Content-Type": "application/vnd.vmware.vcloud.vApp+xml"}, ) nodes.append(self._to_node(res.object)) - except Exception: + except Exception as e: # The vApp was probably removed since the previous vDC # query, ignore - e = sys.exc_info()[1] - if not (e.args[0].tag.endswith('Error') and - e.args[0].get('minorErrorCode') == - 'ACCESS_TO_RESOURCE_IS_FORBIDDEN'): + # pylint: disable=no-member + + if not ( + e.args[0].tag.endswith("Error") + and e.args[0].get("minorErrorCode") == "ACCESS_TO_RESOURCE_IS_FORBIDDEN" + ): raise return nodes @@ -613,28 +785,29 @@ def _to_size(self, ram): disk=None, bandwidth=None, price=None, - driver=self.connection.driver + driver=self.connection.driver, ) + return ns def list_sizes(self, location=None): sizes = [self._to_size(i) for i in VIRTUAL_MEMORY_VALS] + return sizes def _get_catalogitems_hrefs(self, catalog): """Given a catalog href returns contained catalog item hrefs""" res = self.connection.request( get_url_path(catalog), - headers={ - 'Content-Type': 'application/vnd.vmware.vcloud.catalog+xml' - } + headers={"Content-Type": "application/vnd.vmware.vcloud.catalog+xml"}, ).object cat_items = res.findall(fixxpath(res, "CatalogItems/CatalogItem")) - cat_item_hrefs = [i.get('href') - for i in cat_items - if i.get('type') == - 'application/vnd.vmware.vcloud.catalogItem+xml'] + cat_item_hrefs = [ + i.get("href") + for i in cat_items + if i.get("type") == "application/vnd.vmware.vcloud.catalogItem+xml" + ] return cat_item_hrefs @@ -642,36 +815,31 @@ def _get_catalogitem(self, catalog_item): """Given a catalog item href returns elementree""" res = self.connection.request( get_url_path(catalog_item), - headers={ - 'Content-Type': 'application/vnd.vmware.vcloud.catalogItem+xml' - } + headers={"Content-Type": "application/vnd.vmware.vcloud.catalogItem+xml"}, ).object return res def list_images(self, location=None): images = [] + for vdc in self.vdcs: res = self.connection.request(get_url_path(vdc.id)).object - res_ents = res.findall(fixxpath( - res, "ResourceEntities/ResourceEntity") - ) + res_ents = res.findall(fixxpath(res, "ResourceEntities/ResourceEntity")) images += [ self._to_image(i) for i in res_ents - if i.get('type') == - 'application/vnd.vmware.vcloud.vAppTemplate+xml' + if i.get("type") == "application/vnd.vmware.vcloud.vAppTemplate+xml" ] for catalog in self._get_catalog_hrefs(): for cat_item in self._get_catalogitems_hrefs(catalog): res = self._get_catalogitem(cat_item) - res_ents = res.findall(fixxpath(res, 'Entity')) + res_ents = res.findall(fixxpath(res, "Entity")) images += [ self._to_image(i) for i in res_ents - if i.get('type') == - 'application/vnd.vmware.vcloud.vAppTemplate+xml' + if i.get("type") == "application/vnd.vmware.vcloud.vAppTemplate+xml" ] def idfun(image): @@ -681,19 +849,36 @@ def idfun(image): def _uniquer(self, seq, idfun=None): if idfun is None: - def idfun(x): + + def idfun(x): # pylint: disable=function-redefined return x + seen = {} result = [] + for item in seq: marker = idfun(item) + if marker in seen: continue seen[marker] = 1 result.append(item) + return result - def create_node(self, **kwargs): + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_network=None, + ex_vdc=None, + ex_cpus=1, + ex_row=None, + ex_group=None, + ): """ Creates and returns node. @@ -712,65 +897,57 @@ def create_node(self, **kwargs): :type ex_group: ``str`` """ - name = kwargs['name'] - image = kwargs['image'] - size = kwargs['size'] - # Some providers don't require a network link try: - network = kwargs.get('ex_network', self.networks[0].get('href')) + network = ex_network or self.networks[0].get("href") except IndexError: - network = '' + network = "" password = None - auth = self._get_and_check_auth(kwargs.get('auth')) + auth = self._get_and_check_auth(auth) password = auth.password instantiate_xml = InstantiateVAppXML( name=name, template=image.id, net_href=network, - cpus=str(kwargs.get('ex_cpus', 1)), + cpus=str(ex_cpus), memory=str(size.ram), password=password, - row=kwargs.get('ex_row', None), - group=kwargs.get('ex_group', None) + row=ex_row, + group=ex_group, ) - vdc = self._get_vdc(kwargs.get('ex_vdc', None)) + vdc = self._get_vdc(ex_vdc) # Instantiate VM and get identifier. - content_type = \ - 'application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml' + content_type = "application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml" res = self.connection.request( - '%s/action/instantiateVAppTemplate' % get_url_path(vdc.id), + "%s/action/instantiateVAppTemplate" % get_url_path(vdc.id), data=instantiate_xml.tostring(), - method='POST', - headers={'Content-Type': content_type} + method="POST", + headers={"Content-Type": content_type}, ) - vapp_path = get_url_path(res.object.get('href')) + vapp_path = get_url_path(res.object.get("href")) # Deploy the VM from the identifier. - res = self.connection.request('%s/action/deploy' % vapp_path, - method='POST') + res = self.connection.request("%s/action/deploy" % vapp_path, method="POST") - self._wait_for_task_completion(res.object.get('href')) + self._wait_for_task_completion(res.object.get("href")) # Power on the VM. - res = self.connection.request('%s/power/action/powerOn' % vapp_path, - method='POST') + res = self.connection.request("%s/power/action/powerOn" % vapp_path, method="POST") res = self.connection.request(vapp_path) node = self._to_node(res.object) if getattr(auth, "generated", False): - node.extra['password'] = auth.password + node.extra["password"] = auth.password return node class HostingComConnection(VCloudConnection): - """ vCloud connection subclass for Hosting.com """ @@ -779,23 +956,22 @@ class HostingComConnection(VCloudConnection): def _get_auth_headers(self): """hosting.com doesn't follow the standard vCloud authentication API""" + return { - 'Authentication': base64.b64encode(b('%s:%s' % (self.user_id, - self.key))), - 'Content-Length': '0' + "Authentication": base64.b64encode(b("{}:{}".format(self.user_id, self.key))), + "Content-Length": "0", } class HostingComDriver(VCloudNodeDriver): - """ vCloud node driver for Hosting.com """ + connectionCls = HostingComConnection class TerremarkConnection(VCloudConnection): - """ vCloud connection subclass for Terremark """ @@ -804,7 +980,6 @@ class TerremarkConnection(VCloudConnection): class TerremarkDriver(VCloudNodeDriver): - """ vCloud node driver for Terremark """ @@ -812,69 +987,95 @@ class TerremarkDriver(VCloudNodeDriver): connectionCls = TerremarkConnection def list_locations(self): - return [NodeLocation(0, "Terremark Texas", 'US', self)] + return [NodeLocation(0, "Terremark Texas", "US", self)] class VCloud_1_5_Connection(VCloudConnection): - def _get_auth_headers(self): """Compatibility for using v1.5 API under vCloud Director 5.1""" + return { - 'Authorization': "Basic %s" % base64.b64encode( - b('%s:%s' % (self.user_id, self.key))).decode('utf-8'), - 'Content-Length': '0', - 'Accept': 'application/*+xml;version=1.5' + "Authorization": "Basic %s" + % base64.b64encode(b("{}:{}".format(self.user_id, self.key))).decode("utf-8"), + "Content-Length": "0", + "Accept": "application/*+xml;version=1.5", } def _get_auth_token(self): if not self.token: # Log In - conn = self.conn_classes[self.secure](self.host, - self.port) - conn.request(method='POST', url='/api/sessions', - headers=self._get_auth_headers()) + self.connection.request( + method="POST", url="/api/sessions", headers=self._get_auth_headers() + ) - resp = conn.getresponse() - headers = dict(resp.getheaders()) + resp = self.connection.getresponse() + headers = resp.headers # Set authorization token try: - self.token = headers['x-vcloud-authorization'] + self.token = headers["x-vcloud-authorization"] except KeyError: raise InvalidCredsError() # Get the URL of the Organization - body = ET.XML(resp.read()) - self.org_name = body.get('org') + body = ET.XML(resp.text) + self.org_name = body.get("org") + + # pylint: disable=no-member org_list_url = get_url_path( - next((link for link in body.findall(fixxpath(body, 'Link')) - if link.get('type') == - 'application/vnd.vmware.vcloud.orgList+xml')).get('href') + next( + link + for link in body.findall(fixxpath(body, "Link")) + if link.get("type") == "application/vnd.vmware.vcloud.orgList+xml" + ).get("href") ) - conn.request(method='GET', url=org_list_url, - headers=self.add_default_headers({})) - body = ET.XML(conn.getresponse().read()) + if self.proxy_url is not None: + self.connection.set_http_proxy(self.proxy_url) + self.connection.request( + method="GET", url=org_list_url, headers=self.add_default_headers({}) + ) + body = ET.XML(self.connection.getresponse().text) + + # pylint: disable=no-member self.driver.org = get_url_path( - next((org for org in body.findall(fixxpath(body, 'Org')) - if org.get('name') == self.org_name)).get('href') + next( + org + for org in body.findall(fixxpath(body, "Org")) + if org.get("name") == self.org_name + ).get("href") ) def add_default_headers(self, headers): - headers['Accept'] = 'application/*+xml;version=1.5' - headers['x-vcloud-authorization'] = self.token + headers["Accept"] = "application/*+xml;version=1.5" + headers["x-vcloud-authorization"] = self.token + return headers -class Instantiate_1_5_VAppXML(object): +class VCloud_5_5_Connection(VCloud_1_5_Connection): + def _get_auth_headers(self): + """Compatibility for using v5.5 of the API""" + auth_headers = super()._get_auth_headers() + auth_headers["Accept"] = "application/*+xml;version=5.5" + + return auth_headers + + def add_default_headers(self, headers): + headers["Accept"] = "application/*+xml;version=5.5" + headers["x-vcloud-authorization"] = self.token - def __init__(self, name, template, network, vm_network=None, - vm_fence=None): + return headers + + +class Instantiate_1_5_VAppXML: + def __init__(self, name, template, network, vm_network=None, vm_fence=None, description=None): self.name = name self.template = template self.network = network self.vm_network = vm_network self.vm_fence = vm_fence + self.description = description self._build_xmltree() def tostring(self): @@ -884,56 +1085,52 @@ def _build_xmltree(self): self.root = self._make_instantiation_root() if self.network is not None: - instantionation_params = ET.SubElement(self.root, - 'InstantiationParams') - network_config_section = ET.SubElement(instantionation_params, - 'NetworkConfigSection') + instantiation_params = ET.SubElement(self.root, "InstantiationParams") + network_config_section = ET.SubElement(instantiation_params, "NetworkConfigSection") ET.SubElement( network_config_section, - 'Info', - {'xmlns': 'http://schemas.dmtf.org/ovf/envelope/1'} + "Info", + {"xmlns": "http://schemas.dmtf.org/ovf/envelope/1"}, ) - network_config = ET.SubElement(network_config_section, - 'NetworkConfig') + network_config = ET.SubElement(network_config_section, "NetworkConfig") self._add_network_association(network_config) + if self.description is not None: + ET.SubElement(self.root, "Description").text = self.description + self._add_vapp_template(self.root) def _make_instantiation_root(self): return ET.Element( - 'InstantiateVAppTemplateParams', - {'name': self.name, - 'deploy': 'false', - 'powerOn': 'false', - 'xml:lang': 'en', - 'xmlns': 'http://www.vmware.com/vcloud/v1.5', - 'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance'} + "InstantiateVAppTemplateParams", + { + "name": self.name, + "deploy": "false", + "powerOn": "false", + "xml:lang": "en", + "xmlns": "http://www.vmware.com/vcloud/v1.5", + "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + }, ) def _add_vapp_template(self, parent): - return ET.SubElement( - parent, - 'Source', - {'href': self.template} - ) + return ET.SubElement(parent, "Source", {"href": self.template}) def _add_network_association(self, parent): if self.vm_network is None: # Don't set a custom vApp VM network name - parent.set('networkName', self.network.get('name')) + parent.set("networkName", self.network.get("name")) else: # Set a custom vApp VM network name - parent.set('networkName', self.vm_network) - configuration = ET.SubElement(parent, 'Configuration') - ET.SubElement(configuration, 'ParentNetwork', - {'href': self.network.get('href')}) + parent.set("networkName", self.vm_network) + configuration = ET.SubElement(parent, "Configuration") + ET.SubElement(configuration, "ParentNetwork", {"href": self.network.get("href")}) if self.vm_fence is None: - fencemode = self.network.find(fixxpath(self.network, - 'Configuration/FenceMode')).text + fencemode = self.network.find(fixxpath(self.network, "Configuration/FenceMode")).text else: fencemode = self.vm_fence - ET.SubElement(configuration, 'FenceMode').text = fencemode + ET.SubElement(configuration, "FenceMode").text = fencemode class VCloud_1_5_NodeDriver(VCloudNodeDriver): @@ -942,22 +1139,30 @@ class VCloud_1_5_NodeDriver(VCloudNodeDriver): # Based on # http://pubs.vmware.com/vcloud-api-1-5/api_prog/ # GUID-843BE3AD-5EF6-4442-B864-BCAE44A51867.html - NODE_STATE_MAP = {'-1': NodeState.UNKNOWN, - '0': NodeState.PENDING, - '1': NodeState.PENDING, - '2': NodeState.PENDING, - '3': NodeState.PENDING, - '4': NodeState.RUNNING, - '5': NodeState.RUNNING, - '6': NodeState.UNKNOWN, - '7': NodeState.UNKNOWN, - '8': NodeState.STOPPED, - '9': NodeState.UNKNOWN, - '10': NodeState.UNKNOWN} + NODE_STATE_MAP = { + "-1": NodeState.UNKNOWN, + "0": NodeState.PENDING, + "1": NodeState.PENDING, + "2": NodeState.PENDING, + "3": NodeState.PENDING, + "4": NodeState.RUNNING, + "5": NodeState.RUNNING, + "6": NodeState.UNKNOWN, + "7": NodeState.UNKNOWN, + "8": NodeState.STOPPED, + "9": NodeState.UNKNOWN, + "10": NodeState.UNKNOWN, + } def list_locations(self): - return [NodeLocation(id=self.connection.host, - name=self.connection.host, country="N/A", driver=self)] + return [ + NodeLocation( + id=self.connection.host, + name=self.connection.host, + country="N/A", + driver=self, + ) + ] def ex_find_node(self, node_name, vdcs=None): """ @@ -974,110 +1179,158 @@ def ex_find_node(self, node_name, vdcs=None): :return: node instance or None if not found :rtype: :class:`Node` or ``None`` """ + if not vdcs: vdcs = self.vdcs - if not getattr(vdcs, '__iter__', False): + + if not getattr(vdcs, "__iter__", False): vdcs = [vdcs] + for vdc in vdcs: res = self.connection.request(get_url_path(vdc.id)) xpath = fixxpath(res.object, "ResourceEntities/ResourceEntity") entity_elems = res.object.findall(xpath) + for entity_elem in entity_elems: - if entity_elem.get('type') == \ - 'application/vnd.vmware.vcloud.vApp+xml' and \ - entity_elem.get('name') == node_name: - path = get_url_path(entity_elem.get('href')) - headers = {'Content-Type': - 'application/vnd.vmware.vcloud.vApp+xml'} - res = self.connection.request(path, - headers=headers) - return self._to_node(res.object) + if ( + entity_elem.get("type") == "application/vnd.vmware.vcloud.vApp+xml" + and entity_elem.get("name") == node_name + ): + path = entity_elem.get("href") + + return self._ex_get_node(path) + return None - def destroy_node(self, node): + def ex_find_vm_nodes(self, vm_name, max_results=50): + """ + Finds nodes that contain a VM with the specified name. + + :param vm_name: The VM name to find nodes for + :type vm_name: ``str`` + + :param max_results: Maximum number of results up to 128 + :type max_results: ``int`` + + :return: List of node instances + :rtype: `list` of :class:`Node` + """ + vms = self.ex_query( + "vm", + filter="name=={vm_name}".format(vm_name=vm_name), + page=1, + page_size=max_results, + ) + + return [self._ex_get_node(vm["container"]) for vm in vms] + + def destroy_node(self, node, shutdown=True): try: - self.ex_undeploy_node(node) + self.ex_undeploy_node(node, shutdown=shutdown) except Exception: # Some vendors don't implement undeploy at all yet, # so catch this and move on. pass - res = self.connection.request(get_url_path(node.id), method='DELETE') + res = self.connection.request(get_url_path(node.id), method="DELETE") + return res.status == httplib.ACCEPTED def reboot_node(self, node): - res = self.connection.request('%s/power/action/reset' - % get_url_path(node.id), - method='POST') + res = self.connection.request( + "%s/power/action/reset" % get_url_path(node.id), method="POST" + ) + if res.status in [httplib.ACCEPTED, httplib.NO_CONTENT]: - self._wait_for_task_completion(res.object.get('href')) + self._wait_for_task_completion(res.object.get("href")) + return True else: return False - def ex_deploy_node(self, node): + def ex_deploy_node(self, node, ex_force_customization=False): """ Deploys existing node. Equal to vApp "start" operation. :param node: The node to be deployed :type node: :class:`Node` + :param ex_force_customization: Used to specify whether to force + customization on deployment, + if not set default value is False. + :type ex_force_customization: ``bool`` + :rtype: :class:`Node` """ - data = {'powerOn': 'true', - 'xmlns': 'http://www.vmware.com/vcloud/v1.5'} - deploy_xml = ET.Element('DeployVAppParams', data) - path = get_url_path(node.id) - headers = { - 'Content-Type': - 'application/vnd.vmware.vcloud.deployVAppParams+xml' - } - res = self.connection.request('%s/action/deploy' % path, - data=ET.tostring(deploy_xml), - method='POST', - headers=headers) - self._wait_for_task_completion(res.object.get('href')) + + if ex_force_customization: + vms = self._get_vm_elements(node.id) + + for vm in vms: + self._ex_deploy_node_or_vm(vm.get("href"), ex_force_customization=True) + else: + self._ex_deploy_node_or_vm(node.id) + res = self.connection.request(get_url_path(node.id)) + return self._to_node(res.object) - def ex_undeploy_node(self, node): + def _ex_deploy_node_or_vm(self, vapp_or_vm_path, ex_force_customization=False): + data = { + "powerOn": "true", + "forceCustomization": str(ex_force_customization).lower(), + "xmlns": "http://www.vmware.com/vcloud/v1.5", + } + deploy_xml = ET.Element("DeployVAppParams", data) + path = get_url_path(vapp_or_vm_path) + headers = {"Content-Type": "application/vnd.vmware.vcloud.deployVAppParams+xml"} + res = self.connection.request( + "%s/action/deploy" % path, + data=ET.tostring(deploy_xml), + method="POST", + headers=headers, + ) + self._wait_for_task_completion(res.object.get("href")) + + def ex_undeploy_node(self, node, shutdown=True): """ Undeploys existing node. Equal to vApp "stop" operation. :param node: The node to be deployed :type node: :class:`Node` + :param shutdown: Whether to shutdown or power off the guest when + undeploying + :type shutdown: ``bool`` + :rtype: :class:`Node` """ - data = {'xmlns': 'http://www.vmware.com/vcloud/v1.5'} - undeploy_xml = ET.Element('UndeployVAppParams', data) - undeploy_power_action_xml = ET.SubElement(undeploy_xml, - 'UndeployPowerAction') - undeploy_power_action_xml.text = 'shutdown' + data = {"xmlns": "http://www.vmware.com/vcloud/v1.5"} + undeploy_xml = ET.Element("UndeployVAppParams", data) + undeploy_power_action_xml = ET.SubElement(undeploy_xml, "UndeployPowerAction") - headers = { - 'Content-Type': - 'application/vnd.vmware.vcloud.undeployVAppParams+xml' - } + headers = {"Content-Type": "application/vnd.vmware.vcloud.undeployVAppParams+xml"} - try: - res = self.connection.request( - '%s/action/undeploy' % get_url_path(node.id), + def undeploy(action): + undeploy_power_action_xml.text = action + undeploy_res = self.connection.request( + "%s/action/undeploy" % get_url_path(node.id), data=ET.tostring(undeploy_xml), - method='POST', - headers=headers) + method="POST", + headers=headers, + ) + self._wait_for_task_completion(undeploy_res.object.get("href")) - self._wait_for_task_completion(res.object.get('href')) - except Exception: - undeploy_power_action_xml.text = 'powerOff' - res = self.connection.request( - '%s/action/undeploy' % get_url_path(node.id), - data=ET.tostring(undeploy_xml), - method='POST', - headers=headers) - self._wait_for_task_completion(res.object.get('href')) + if shutdown: + try: + undeploy("shutdown") + except Exception: + undeploy("powerOff") + else: + undeploy("powerOff") res = self.connection.request(get_url_path(node.id)) + return self._to_node(res.object) def ex_power_off_node(self, node): @@ -1090,7 +1343,8 @@ def ex_power_off_node(self, node): :rtype: :class:`Node` """ - return self._perform_power_operation(node, 'powerOff') + + return self._perform_power_operation(node, "powerOff") def ex_power_on_node(self, node): """ @@ -1102,7 +1356,8 @@ def ex_power_on_node(self, node): :rtype: :class:`Node` """ - return self._perform_power_operation(node, 'powerOn') + + return self._perform_power_operation(node, "powerOn") def ex_shutdown_node(self, node): """ @@ -1114,7 +1369,8 @@ def ex_shutdown_node(self, node): :rtype: :class:`Node` """ - return self._perform_power_operation(node, 'shutdown') + + return self._perform_power_operation(node, "shutdown") def ex_suspend_node(self, node): """ @@ -1126,14 +1382,16 @@ def ex_suspend_node(self, node): :rtype: :class:`Node` """ - return self._perform_power_operation(node, 'suspend') + + return self._perform_power_operation(node, "suspend") def _perform_power_operation(self, node, operation): res = self.connection.request( - '%s/power/action/%s' % (get_url_path(node.id), operation), - method='POST') - self._wait_for_task_completion(res.object.get('href')) + "{}/power/action/{}".format(get_url_path(node.id), operation), method="POST" + ) + self._wait_for_task_completion(res.object.get("href")) res = self.connection.request(get_url_path(node.id)) + return self._to_node(res.object) def ex_get_control_access(self, node): @@ -1145,34 +1403,37 @@ def ex_get_control_access(self, node): :rtype: :class:`ControlAccess` """ - res = self.connection.request( - '%s/controlAccess' % get_url_path(node.id)) + res = self.connection.request("%s/controlAccess" % get_url_path(node.id)) everyone_access_level = None - is_shared_elem = res.object.find( - fixxpath(res.object, "IsSharedToEveryone")) - if is_shared_elem is not None and is_shared_elem.text == 'true': + is_shared_elem = res.object.find(fixxpath(res.object, "IsSharedToEveryone")) + + if is_shared_elem is not None and is_shared_elem.text == "true": everyone_access_level = res.object.find( - fixxpath(res.object, "EveryoneAccessLevel")).text + fixxpath(res.object, "EveryoneAccessLevel") + ).text # Parse all subjects subjects = [] xpath = fixxpath(res.object, "AccessSettings/AccessSetting") + for elem in res.object.findall(xpath): access_level = elem.find(fixxpath(res.object, "AccessLevel")).text subject_elem = elem.find(fixxpath(res.object, "Subject")) - if subject_elem.get('type') == \ - 'application/vnd.vmware.admin.group+xml': - subj_type = 'group' + + if subject_elem.get("type") == "application/vnd.vmware.admin.group+xml": + subj_type = "group" else: - subj_type = 'user' + subj_type = "user" - path = get_url_path(subject_elem.get('href')) + path = get_url_path(subject_elem.get("href")) res = self.connection.request(path) - name = res.object.get('name') - subject = Subject(type=subj_type, - name=name, - access_level=access_level, - id=subject_elem.get('href')) + name = res.object.get("name") + subject = Subject( + type=subj_type, + name=name, + access_level=access_level, + id=subject_elem.get("href"), + ) subjects.append(subject) return ControlAccess(node, everyone_access_level, subjects) @@ -1189,41 +1450,46 @@ def ex_set_control_access(self, node, control_access): :rtype: ``None`` """ - xml = ET.Element('ControlAccessParams', - {'xmlns': 'http://www.vmware.com/vcloud/v1.5'}) - shared_to_everyone = ET.SubElement(xml, 'IsSharedToEveryone') + xml = ET.Element("ControlAccessParams", {"xmlns": "http://www.vmware.com/vcloud/v1.5"}) + shared_to_everyone = ET.SubElement(xml, "IsSharedToEveryone") + if control_access.everyone_access_level: - shared_to_everyone.text = 'true' - everyone_access_level = ET.SubElement(xml, 'EveryoneAccessLevel') + shared_to_everyone.text = "true" + everyone_access_level = ET.SubElement(xml, "EveryoneAccessLevel") everyone_access_level.text = control_access.everyone_access_level else: - shared_to_everyone.text = 'false' + shared_to_everyone.text = "false" # Set subjects - if control_access.subjects: - access_settings_elem = ET.SubElement(xml, 'AccessSettings') - for subject in control_access.subjects: - setting = ET.SubElement(access_settings_elem, 'AccessSetting') - if subject.id: - href = subject.id - else: - res = self.ex_query(type=subject.type, filter='name==' + - subject.name) - if not res: - raise LibcloudError('Specified subject "%s %s" not found ' - % (subject.type, subject.name)) - href = res[0]['href'] - ET.SubElement(setting, 'Subject', {'href': href}) - ET.SubElement(setting, 'AccessLevel').text = subject.access_level - headers = { - 'Content-Type': 'application/vnd.vmware.vcloud.controlAccess+xml' - } + if control_access.subjects: + access_settings_elem = ET.SubElement(xml, "AccessSettings") + + for subject in control_access.subjects: + setting = ET.SubElement(access_settings_elem, "AccessSetting") + + if subject.id: + href = subject.id + else: + res = self.ex_query(type=subject.type, filter="name==" + subject.name) + + if not res: + raise LibcloudError( + 'Specified subject "{} {}" not found '.format( + subject.type, subject.name + ) + ) + href = res[0]["href"] + ET.SubElement(setting, "Subject", {"href": href}) + ET.SubElement(setting, "AccessLevel").text = subject.access_level + + headers = {"Content-Type": "application/vnd.vmware.vcloud.controlAccess+xml"} self.connection.request( - '%s/action/controlAccess' % get_url_path(node.id), + "%s/action/controlAccess" % get_url_path(node.id), data=ET.tostring(xml), headers=headers, - method='POST') + method="POST", + ) def ex_get_metadata(self, node): """ @@ -1233,14 +1499,14 @@ def ex_get_metadata(self, node): :return: dictionary mapping metadata keys to metadata values :rtype: dictionary mapping ``str`` to ``str`` """ - res = self.connection.request('%s/metadata' % (get_url_path(node.id))) - xpath = fixxpath(res.object, 'MetadataEntry') + res = self.connection.request("%s/metadata" % (get_url_path(node.id))) + xpath = fixxpath(res.object, "MetadataEntry") metadata_entries = res.object.findall(xpath) res_dict = {} for entry in metadata_entries: - key = entry.findtext(fixxpath(res.object, 'Key')) - value = entry.findtext(fixxpath(res.object, 'Value')) + key = entry.findtext(fixxpath(res.object, "Key")) + value = entry.findtext(fixxpath(res.object, "Value")) res_dict[key] = value return res_dict @@ -1259,28 +1525,28 @@ def ex_set_metadata_entry(self, node, key, value): :rtype: ``None`` """ metadata_elem = ET.Element( - 'Metadata', - {'xmlns': "http://www.vmware.com/vcloud/v1.5", - 'xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance"} + "Metadata", + { + "xmlns": "http://www.vmware.com/vcloud/v1.5", + "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + }, ) - entry = ET.SubElement(metadata_elem, 'MetadataEntry') - key_elem = ET.SubElement(entry, 'Key') + entry = ET.SubElement(metadata_elem, "MetadataEntry") + key_elem = ET.SubElement(entry, "Key") key_elem.text = key - value_elem = ET.SubElement(entry, 'Value') + value_elem = ET.SubElement(entry, "Value") value_elem.text = value # send it back to the server res = self.connection.request( - '%s/metadata' % get_url_path(node.id), + "%s/metadata" % get_url_path(node.id), data=ET.tostring(metadata_elem), - headers={ - 'Content-Type': 'application/vnd.vmware.vcloud.metadata+xml' - }, - method='POST') - self._wait_for_task_completion(res.object.get('href')) + headers={"Content-Type": "application/vnd.vmware.vcloud.metadata+xml"}, + method="POST", + ) + self._wait_for_task_completion(res.object.get("href")) - def ex_query(self, type, filter=None, page=1, page_size=100, sort_asc=None, - sort_desc=None): + def ex_query(self, type, filter=None, page=1, page_size=100, sort_asc=None, sort_desc=None): """ Queries vCloud for specified type. See http://www.vmware.com/pdf/vcd_15_api_guide.pdf for details. Each @@ -1311,31 +1577,36 @@ def ex_query(self, type, filter=None, page=1, page_size=100, sort_asc=None, # the urllib encodes (name==Developers%20Only) into # %28name%3D%3DDevelopers%20Only%29) which is not accepted by vCloud params = { - 'type': type, - 'pageSize': page_size, - 'page': page, + "type": type, + "pageSize": page_size, + "page": page, } + if sort_asc: - params['sortAsc'] = sort_asc + params["sortAsc"] = sort_asc + if sort_desc: - params['sortDesc'] = sort_desc + params["sortDesc"] = sort_desc + + url = "/api/query?" + urlencode(params) - url = '/api/query?' + urlencode(params) if filter: - if not filter.startswith('('): - filter = '(' + filter + ')' - url += '&filter=' + filter.replace(' ', '+') + if not filter.startswith("("): + filter = "(" + filter + ")" + url += "&filter=" + filter.replace(" ", "+") results = [] res = self.connection.request(url) + for elem in res.object: - if not elem.tag.endswith('Link'): + if not elem.tag.endswith("Link"): result = elem.attrib - result['type'] = elem.tag.split('}')[1] + result["type"] = elem.tag.split("}")[1] results.append(result) + return results - def create_node(self, **kwargs): + def create_node(self, name, size, image, location=None, auth=None, **kwargs): """ Creates and returns node. If the source image is: - vApp template - a new vApp is instantiated from template @@ -1377,6 +1648,11 @@ def create_node(self, **kwargs): public SSH keys etc. :type ex_vm_script: ``str`` + :keyword ex_vm_script_text: content of guest customisation script + for each vApp VM. Overrides ex_vm_script + parameter. + :type ex_vm_script_text: ``str`` + :keyword ex_vm_network: Override default vApp VM network name. Useful for when you've imported an OVF originating from outside of the vCloud. @@ -1395,6 +1671,11 @@ def create_node(self, **kwargs): (started) after creation :type ex_deploy: ``bool`` + :keyword ex_force_customization: Used to specify whether to force + customization on deployment, + if not set default value is False. + :type ex_force_customization: ``bool`` + :keyword ex_clone_timeout: timeout in seconds for clone/instantiate VM operation. Cloning might be a time consuming @@ -1404,21 +1685,28 @@ def create_node(self, **kwargs): Overrides the default task completion value. :type ex_clone_timeout: ``int`` + + :keyword ex_admin_password: set the node admin password explicitly. + :type ex_admin_password: ``str`` + + :keyword ex_description: Set a description for the vApp. + :type ex_description: ``str`` """ - name = kwargs['name'] - image = kwargs['image'] - ex_vm_names = kwargs.get('ex_vm_names') - ex_vm_cpu = kwargs.get('ex_vm_cpu') - ex_vm_memory = kwargs.get('ex_vm_memory') - ex_vm_script = kwargs.get('ex_vm_script') - ex_vm_fence = kwargs.get('ex_vm_fence', None) - ex_network = kwargs.get('ex_network', None) - ex_vm_network = kwargs.get('ex_vm_network', None) - ex_vm_ipmode = kwargs.get('ex_vm_ipmode', None) - ex_deploy = kwargs.get('ex_deploy', True) - ex_vdc = kwargs.get('ex_vdc', None) - ex_clone_timeout = kwargs.get('ex_clone_timeout', - DEFAULT_TASK_COMPLETION_TIMEOUT) + ex_vm_names = kwargs.get("ex_vm_names") + ex_vm_cpu = kwargs.get("ex_vm_cpu") + ex_vm_memory = kwargs.get("ex_vm_memory") + ex_vm_script = kwargs.get("ex_vm_script") + ex_vm_script_text = kwargs.get("ex_vm_script_text", None) + ex_vm_fence = kwargs.get("ex_vm_fence", None) + ex_network = kwargs.get("ex_network", None) + ex_vm_network = kwargs.get("ex_vm_network", None) + ex_vm_ipmode = kwargs.get("ex_vm_ipmode", None) + ex_deploy = kwargs.get("ex_deploy", True) + ex_force_customization = kwargs.get("ex_force_customization", False) + ex_vdc = kwargs.get("ex_vdc", None) + ex_clone_timeout = kwargs.get("ex_clone_timeout", DEFAULT_TASK_COMPLETION_TIMEOUT) + ex_admin_password = kwargs.get("ex_admin_password", None) + ex_description = kwargs.get("ex_description", None) self._validate_vm_names(ex_vm_names) self._validate_vm_cpu(ex_vm_cpu) @@ -1428,44 +1716,51 @@ def create_node(self, **kwargs): ex_vm_script = self._validate_vm_script(ex_vm_script) # Some providers don't require a network link + if ex_network: network_href = self._get_network_href(ex_network) - network_elem = self.connection.request( - get_url_path(network_href)).object + network_elem = self.connection.request(get_url_path(network_href)).object else: network_elem = None vdc = self._get_vdc(ex_vdc) if self._is_node(image): - vapp_name, vapp_href = self._clone_node(name, - image, - vdc, - ex_clone_timeout) + vapp_name, vapp_href = self._clone_node(name, image, vdc, ex_clone_timeout) else: - vapp_name, vapp_href = self._instantiate_node(name, image, - network_elem, - vdc, ex_vm_network, - ex_vm_fence, - ex_clone_timeout) + vapp_name, vapp_href = self._instantiate_node( + name, + image, + network_elem, + vdc, + ex_vm_network, + ex_vm_fence, + ex_clone_timeout, + description=ex_description, + ) self._change_vm_names(vapp_href, ex_vm_names) self._change_vm_cpu(vapp_href, ex_vm_cpu) self._change_vm_memory(vapp_href, ex_vm_memory) - self._change_vm_script(vapp_href, ex_vm_script) + self._change_vm_script(vapp_href, ex_vm_script, ex_vm_script_text) self._change_vm_ipmode(vapp_href, ex_vm_ipmode) + if ex_admin_password is not None: + self.ex_change_vm_admin_password(vapp_href, ex_admin_password) + # Power on the VM. + if ex_deploy: + res = self.connection.request(get_url_path(vapp_href)) + node = self._to_node(res.object) # Retry 3 times: when instantiating large number of VMs at the same # time some may fail on resource allocation retry = 3 + while True: try: - res = self.connection.request( - '%s/power/action/powerOn' % get_url_path(vapp_href), - method='POST') - self._wait_for_task_completion(res.object.get('href')) + self.ex_deploy_node(node, ex_force_customization) + break except Exception: if retry <= 0: @@ -1475,62 +1770,72 @@ def create_node(self, **kwargs): res = self.connection.request(get_url_path(vapp_href)) node = self._to_node(res.object) + return node - def _instantiate_node(self, name, image, network_elem, vdc, vm_network, - vm_fence, instantiate_timeout): + def _instantiate_node( + self, + name, + image, + network_elem, + vdc, + vm_network, + vm_fence, + instantiate_timeout, + description=None, + ): instantiate_xml = Instantiate_1_5_VAppXML( name=name, template=image.id, network=network_elem, vm_network=vm_network, - vm_fence=vm_fence + vm_fence=vm_fence, + description=description, ) # Instantiate VM and get identifier. headers = { - 'Content-Type': - 'application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml' + "Content-Type": "application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml" } res = self.connection.request( - '%s/action/instantiateVAppTemplate' % get_url_path(vdc.id), + "%s/action/instantiateVAppTemplate" % get_url_path(vdc.id), data=instantiate_xml.tostring(), - method='POST', - headers=headers + method="POST", + headers=headers, ) - vapp_name = res.object.get('name') - vapp_href = res.object.get('href') + vapp_name = res.object.get("name") + vapp_href = res.object.get("href") - task_href = res.object.find(fixxpath(res.object, "Tasks/Task")).get( - 'href') + task_href = res.object.find(fixxpath(res.object, "Tasks/Task")).get("href") self._wait_for_task_completion(task_href, instantiate_timeout) + return vapp_name, vapp_href def _clone_node(self, name, sourceNode, vdc, clone_timeout): clone_xml = ET.Element( "CloneVAppParams", - {'name': name, 'deploy': 'false', 'powerOn': 'false', - 'xmlns': "http://www.vmware.com/vcloud/v1.5", - 'xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance"} + { + "name": name, + "deploy": "false", + "powerOn": "false", + "xmlns": "http://www.vmware.com/vcloud/v1.5", + "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + }, ) - ET.SubElement(clone_xml, - 'Description').text = 'Clone of ' + sourceNode.name - ET.SubElement(clone_xml, 'Source', {'href': sourceNode.id}) + ET.SubElement(clone_xml, "Description").text = "Clone of " + sourceNode.name + ET.SubElement(clone_xml, "Source", {"href": sourceNode.id}) - headers = { - 'Content-Type': 'application/vnd.vmware.vcloud.cloneVAppParams+xml' - } + headers = {"Content-Type": "application/vnd.vmware.vcloud.cloneVAppParams+xml"} res = self.connection.request( - '%s/action/cloneVApp' % get_url_path(vdc.id), + "%s/action/cloneVApp" % get_url_path(vdc.id), data=ET.tostring(clone_xml), - method='POST', - headers=headers + method="POST", + headers=headers, ) - vapp_name = res.object.get('name') - vapp_href = res.object.get('href') + vapp_name = res.object.get("name") + vapp_href = res.object.get("href") - task_href = res.object.find( - fixxpath(res.object, "Tasks/Task")).get('href') + task_href = res.object.find(fixxpath(res.object, "Tasks/Task")).get("href") self._wait_for_task_completion(task_href, clone_timeout) res = self.connection.request(get_url_path(vapp_href)) @@ -1538,48 +1843,45 @@ def _clone_node(self, name, sourceNode, vdc, clone_timeout): vms = res.object.findall(fixxpath(res.object, "Children/Vm")) # Fix the networking for VMs + for i, vm in enumerate(vms): # Remove network - network_xml = ET.Element("NetworkConnectionSection", { - 'ovf:required': 'false', - 'xmlns': "http://www.vmware.com/vcloud/v1.5", - 'xmlns:ovf': 'http://schemas.dmtf.org/ovf/envelope/1'}) - ET.SubElement(network_xml, "ovf:Info").text = \ - 'Specifies the available VM network connections' + network_xml = ET.Element( + "NetworkConnectionSection", + { + "ovf:required": "false", + "xmlns": "http://www.vmware.com/vcloud/v1.5", + "xmlns:ovf": "http://schemas.dmtf.org/ovf/envelope/1", + }, + ) + ET.SubElement(network_xml, "ovf:Info").text = ( + "Specifies the available VM network connections" + ) - headers = { - 'Content-Type': - 'application/vnd.vmware.vcloud.networkConnectionSection+xml' - } + headers = {"Content-Type": "application/vnd.vmware.vcloud.networkConnectionSection+xml"} res = self.connection.request( - '%s/networkConnectionSection' % get_url_path(vm.get('href')), + "%s/networkConnectionSection" % get_url_path(vm.get("href")), data=ET.tostring(network_xml), - method='PUT', - headers=headers + method="PUT", + headers=headers, ) - self._wait_for_task_completion(res.object.get('href')) + self._wait_for_task_completion(res.object.get("href")) # Re-add network - network_xml = vm.find(fixxpath(vm, 'NetworkConnectionSection')) - network_conn_xml = network_xml.find( - fixxpath(network_xml, 'NetworkConnection')) - network_conn_xml.set('needsCustomization', 'true') - network_conn_xml.remove( - network_conn_xml.find(fixxpath(network_xml, 'IpAddress'))) - network_conn_xml.remove( - network_conn_xml.find(fixxpath(network_xml, 'MACAddress'))) + network_xml = vm.find(fixxpath(vm, "NetworkConnectionSection")) + network_conn_xml = network_xml.find(fixxpath(network_xml, "NetworkConnection")) + network_conn_xml.set("needsCustomization", "true") + network_conn_xml.remove(network_conn_xml.find(fixxpath(network_xml, "IpAddress"))) + network_conn_xml.remove(network_conn_xml.find(fixxpath(network_xml, "MACAddress"))) - headers = { - 'Content-Type': - 'application/vnd.vmware.vcloud.networkConnectionSection+xml' - } + headers = {"Content-Type": "application/vnd.vmware.vcloud.networkConnectionSection+xml"} res = self.connection.request( - '%s/networkConnectionSection' % get_url_path(vm.get('href')), + "%s/networkConnectionSection" % get_url_path(vm.get("href")), data=ET.tostring(network_xml), - method='PUT', - headers=headers + method="PUT", + headers=headers, ) - self._wait_for_task_completion(res.object.get('href')) + self._wait_for_task_completion(res.object.get("href")) return vapp_name, vapp_href @@ -1655,56 +1957,61 @@ def ex_add_vm_disk(self, vapp_or_vm_id, vm_disk_size): def _validate_vm_names(names): if names is None: return - hname_re = re.compile( - '^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9]*)[\-])*([A-Za-z]|[A-Za-z][A-Za-z0-9]*[A-Za-z0-9])$') # NOQA + for name in names: if len(name) > 15: raise ValueError( 'The VM name "' + name + '" is too long for the computer ' - 'name (max 15 chars allowed).') - if not hname_re.match(name): - raise ValueError('The VM name "' + name + '" can not be ' - 'used. "' + name + '" is not a valid ' - 'computer name for the VM.') + "name (max 15 chars allowed)." + ) + + if not HOSTNAME_RE.match(name): + raise ValueError( + 'The VM name "' + name + '" can not be ' + 'used. "' + name + '" is not a valid ' + "computer name for the VM." + ) + + return True @staticmethod def _validate_vm_memory(vm_memory): if vm_memory is None: return elif vm_memory not in VIRTUAL_MEMORY_VALS: - raise ValueError( - '%s is not a valid vApp VM memory value' % vm_memory) + raise ValueError("%s is not a valid vApp VM memory value" % vm_memory) @staticmethod def _validate_vm_cpu(vm_cpu): if vm_cpu is None: return elif vm_cpu not in VIRTUAL_CPU_VALS_1_5: - raise ValueError('%s is not a valid vApp VM CPU value' % vm_cpu) + raise ValueError("%s is not a valid vApp VM CPU value" % vm_cpu) @staticmethod def _validate_vm_disk_size(vm_disk): if vm_disk is None: return elif int(vm_disk) < 0: - raise ValueError('%s is not a valid vApp VM disk space value', - vm_disk) + raise ValueError("%s is not a valid vApp VM disk space value", vm_disk) @staticmethod def _validate_vm_script(vm_script): if vm_script is None: return # Try to locate the script file + if not os.path.isabs(vm_script): vm_script = os.path.expanduser(vm_script) vm_script = os.path.abspath(vm_script) + if not os.path.isfile(vm_script): - raise LibcloudError( - "%s the VM script file does not exist" % vm_script) + raise LibcloudError("%s the VM script file does not exist" % vm_script) try: open(vm_script).read() - except: + except Exception: raise + return vm_script @staticmethod @@ -1712,223 +2019,229 @@ def _validate_vm_fence(vm_fence): if vm_fence is None: return elif vm_fence not in FENCE_MODE_VALS_1_5: - raise ValueError('%s is not a valid fencing mode value' % vm_fence) + raise ValueError("%s is not a valid fencing mode value" % vm_fence) @staticmethod def _validate_vm_ipmode(vm_ipmode): if vm_ipmode is None: return - elif vm_ipmode == 'MANUAL': + elif vm_ipmode == "MANUAL": raise NotImplementedError( - 'MANUAL IP mode: The interface for supplying ' - 'IPAddress does not exist yet') + "MANUAL IP mode: The interface for supplying " "IPAddress does not exist yet" + ) elif vm_ipmode not in IP_MODE_VALS_1_5: - raise ValueError( - '%s is not a valid IP address allocation mode value' - % vm_ipmode) + raise ValueError("%s is not a valid IP address allocation mode value" % vm_ipmode) def _change_vm_names(self, vapp_or_vm_id, vm_names): if vm_names is None: return vms = self._get_vm_elements(vapp_or_vm_id) + for i, vm in enumerate(vms): if len(vm_names) <= i: return # Get GuestCustomizationSection res = self.connection.request( - '%s/guestCustomizationSection' % get_url_path(vm.get('href'))) + "%s/guestCustomizationSection" % get_url_path(vm.get("href")) + ) # Update GuestCustomizationSection - res.object.find( - fixxpath(res.object, 'ComputerName')).text = vm_names[i] - # Remove AdminPassword from customization section - admin_pass = res.object.find(fixxpath(res.object, 'AdminPassword')) - if admin_pass is not None: - res.object.remove(admin_pass) + res.object.find(fixxpath(res.object, "ComputerName")).text = vm_names[i] + # Remove AdminPassword from customization section if it would be + # invalid to include it + self._remove_admin_password(res.object) headers = { - 'Content-Type': - 'application/vnd.vmware.vcloud.guestCustomizationSection+xml' + "Content-Type": "application/vnd.vmware.vcloud.guestCustomizationSection+xml" } res = self.connection.request( - '%s/guestCustomizationSection' % get_url_path(vm.get('href')), + "%s/guestCustomizationSection" % get_url_path(vm.get("href")), data=ET.tostring(res.object), - method='PUT', - headers=headers + method="PUT", + headers=headers, ) - self._wait_for_task_completion(res.object.get('href')) + self._wait_for_task_completion(res.object.get("href")) # Update Vm name - req_xml = ET.Element("Vm", { - 'name': vm_names[i], - 'xmlns': "http://www.vmware.com/vcloud/v1.5"}) + req_xml = ET.Element( + "Vm", + {"name": vm_names[i], "xmlns": "http://www.vmware.com/vcloud/v1.5"}, + ) res = self.connection.request( - get_url_path(vm.get('href')), + get_url_path(vm.get("href")), data=ET.tostring(req_xml), - method='PUT', - headers={ - 'Content-Type': 'application/vnd.vmware.vcloud.vm+xml'} + method="PUT", + headers={"Content-Type": "application/vnd.vmware.vcloud.vm+xml"}, ) - self._wait_for_task_completion(res.object.get('href')) + self._wait_for_task_completion(res.object.get("href")) def _change_vm_cpu(self, vapp_or_vm_id, vm_cpu): if vm_cpu is None: return vms = self._get_vm_elements(vapp_or_vm_id) + for vm in vms: # Get virtualHardwareSection/cpu section res = self.connection.request( - '%s/virtualHardwareSection/cpu' % get_url_path(vm.get('href'))) + "%s/virtualHardwareSection/cpu" % get_url_path(vm.get("href")) + ) # Update VirtualQuantity field - xpath = ('{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/' - 'CIM_ResourceAllocationSettingData}VirtualQuantity') + xpath = ( + "{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/" + "CIM_ResourceAllocationSettingData}VirtualQuantity" + ) res.object.find(xpath).text = str(vm_cpu) - headers = { - 'Content-Type': 'application/vnd.vmware.vcloud.rasdItem+xml' - } + headers = {"Content-Type": "application/vnd.vmware.vcloud.rasdItem+xml"} res = self.connection.request( - '%s/virtualHardwareSection/cpu' % get_url_path(vm.get('href')), + "%s/virtualHardwareSection/cpu" % get_url_path(vm.get("href")), data=ET.tostring(res.object), - method='PUT', - headers=headers + method="PUT", + headers=headers, ) - self._wait_for_task_completion(res.object.get('href')) + self._wait_for_task_completion(res.object.get("href")) def _change_vm_memory(self, vapp_or_vm_id, vm_memory): if vm_memory is None: return vms = self._get_vm_elements(vapp_or_vm_id) + for vm in vms: # Get virtualHardwareSection/memory section res = self.connection.request( - '%s/virtualHardwareSection/memory' % - get_url_path(vm.get('href'))) + "%s/virtualHardwareSection/memory" % get_url_path(vm.get("href")) + ) # Update VirtualQuantity field - xpath = ('{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/' - 'CIM_ResourceAllocationSettingData}VirtualQuantity') + xpath = ( + "{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/" + "CIM_ResourceAllocationSettingData}VirtualQuantity" + ) res.object.find(xpath).text = str(vm_memory) - headers = { - 'Content-Type': 'application/vnd.vmware.vcloud.rasdItem+xml' - } + headers = {"Content-Type": "application/vnd.vmware.vcloud.rasdItem+xml"} res = self.connection.request( - '%s/virtualHardwareSection/memory' % get_url_path( - vm.get('href')), + "%s/virtualHardwareSection/memory" % get_url_path(vm.get("href")), data=ET.tostring(res.object), - method='PUT', - headers=headers + method="PUT", + headers=headers, ) - self._wait_for_task_completion(res.object.get('href')) + self._wait_for_task_completion(res.object.get("href")) def _add_vm_disk(self, vapp_or_vm_id, vm_disk): if vm_disk is None: return - rasd_ns = ('{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/' - 'CIM_ResourceAllocationSettingData}') + rasd_ns = ( + "{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/" + "CIM_ResourceAllocationSettingData}" + ) vms = self._get_vm_elements(vapp_or_vm_id) + for vm in vms: # Get virtualHardwareSection/disks section res = self.connection.request( - '%s/virtualHardwareSection/disks' % - get_url_path(vm.get('href'))) + "%s/virtualHardwareSection/disks" % get_url_path(vm.get("href")) + ) existing_ids = [] new_disk = None - for item in res.object.findall(fixxpath(res.object, 'Item')): + + for item in res.object.findall(fixxpath(res.object, "Item")): # Clean Items from unnecessary stuff + for elem in item: - if elem.tag == '%sInstanceID' % rasd_ns: + if elem.tag == "%sInstanceID" % rasd_ns: existing_ids.append(int(elem.text)) - if elem.tag in ['%sAddressOnParent' % rasd_ns, - '%sParent' % rasd_ns]: + + if elem.tag in [ + "%sAddressOnParent" % rasd_ns, + "%sParent" % rasd_ns, + ]: item.remove(elem) - if item.find('%sHostResource' % rasd_ns) is not None: + + if item.find("%sHostResource" % rasd_ns) is not None: new_disk = item new_disk = copy.deepcopy(new_disk) disk_id = max(existing_ids) + 1 - new_disk.find('%sInstanceID' % rasd_ns).text = str(disk_id) - new_disk.find('%sElementName' % - rasd_ns).text = 'Hard Disk ' + str(disk_id) - new_disk.find('%sHostResource' % rasd_ns).set( - fixxpath(new_disk, 'capacity'), str(int(vm_disk) * 1024)) + new_disk.find("%sInstanceID" % rasd_ns).text = str(disk_id) + new_disk.find("%sElementName" % rasd_ns).text = "Hard Disk " + str(disk_id) + new_disk.find("%sHostResource" % rasd_ns).set( + fixxpath(new_disk, "capacity"), str(int(vm_disk) * 1024) + ) res.object.append(new_disk) - headers = { - 'Content-Type': - 'application/vnd.vmware.vcloud.rasditemslist+xml' - } + headers = {"Content-Type": "application/vnd.vmware.vcloud.rasditemslist+xml"} res = self.connection.request( - '%s/virtualHardwareSection/disks' % get_url_path( - vm.get('href')), + "%s/virtualHardwareSection/disks" % get_url_path(vm.get("href")), data=ET.tostring(res.object), - method='PUT', - headers=headers + method="PUT", + headers=headers, ) - self._wait_for_task_completion(res.object.get('href')) + self._wait_for_task_completion(res.object.get("href")) - def _change_vm_script(self, vapp_or_vm_id, vm_script): - if vm_script is None: + def _change_vm_script(self, vapp_or_vm_id, vm_script, vm_script_text=None): + if vm_script is None and vm_script_text is None: return + if vm_script_text is not None: + script = vm_script_text + else: + try: + with open(vm_script) as fp: + script = fp.read() + except Exception: + return + vms = self._get_vm_elements(vapp_or_vm_id) - try: - script = open(vm_script).read() - except: - return # ElementTree escapes script characters automatically. Escape # requirements: # http://www.vmware.com/support/vcd/doc/rest-api-doc-1.5-html/types/ # GuestCustomizationSectionType.html + for vm in vms: # Get GuestCustomizationSection res = self.connection.request( - '%s/guestCustomizationSection' % get_url_path(vm.get('href'))) + "%s/guestCustomizationSection" % get_url_path(vm.get("href")) + ) # Attempt to update any existing CustomizationScript element try: - res.object.find( - fixxpath(res.object, 'CustomizationScript')).text = script - except: + res.object.find(fixxpath(res.object, "CustomizationScript")).text = script + except Exception: # CustomizationScript section does not exist, insert it just # before ComputerName + for i, e in enumerate(res.object): - if e.tag == \ - '{http://www.vmware.com/vcloud/v1.5}ComputerName': + if e.tag == "{http://www.vmware.com/vcloud/v1.5}ComputerName": break - e = ET.Element( - '{http://www.vmware.com/vcloud/v1.5}CustomizationScript') + e = ET.Element("{http://www.vmware.com/vcloud/v1.5}CustomizationScript") e.text = script res.object.insert(i, e) - # Remove AdminPassword from customization section due to an API - # quirk - admin_pass = res.object.find(fixxpath(res.object, 'AdminPassword')) - if admin_pass is not None: - res.object.remove(admin_pass) + # Remove AdminPassword from customization section if it would be + # invalid to include it + self._remove_admin_password(res.object) # Update VM's GuestCustomizationSection headers = { - 'Content-Type': - 'application/vnd.vmware.vcloud.guestCustomizationSection+xml' + "Content-Type": "application/vnd.vmware.vcloud.guestCustomizationSection+xml" } res = self.connection.request( - '%s/guestCustomizationSection' % get_url_path(vm.get('href')), + "%s/guestCustomizationSection" % get_url_path(vm.get("href")), data=ET.tostring(res.object), - method='PUT', - headers=headers + method="PUT", + headers=headers, ) - self._wait_for_task_completion(res.object.get('href')) + self._wait_for_task_completion(res.object.get("href")) def _change_vm_ipmode(self, vapp_or_vm_id, vm_ipmode): if vm_ipmode is None: @@ -1938,147 +2251,316 @@ def _change_vm_ipmode(self, vapp_or_vm_id, vm_ipmode): for vm in vms: res = self.connection.request( - '%s/networkConnectionSection' % get_url_path(vm.get('href'))) - net_conns = res.object.findall( - fixxpath(res.object, 'NetworkConnection')) + "%s/networkConnectionSection" % get_url_path(vm.get("href")) + ) + net_conns = res.object.findall(fixxpath(res.object, "NetworkConnection")) + for c in net_conns: - c.find(fixxpath(c, 'IpAddressAllocationMode')).text = vm_ipmode + c.find(fixxpath(c, "IpAddressAllocationMode")).text = vm_ipmode + + headers = {"Content-Type": "application/vnd.vmware.vcloud.networkConnectionSection+xml"} + + res = self.connection.request( + "%s/networkConnectionSection" % get_url_path(vm.get("href")), + data=ET.tostring(res.object), + method="PUT", + headers=headers, + ) + self._wait_for_task_completion(res.object.get("href")) + + @staticmethod + def _remove_admin_password(guest_customization_section): + """ + Remove AdminPassword element from GuestCustomizationSection if it + would be invalid to include it. + + This was originally done unconditionally due to an "API quirk" of + unknown origin or effect. When AdminPasswordEnabled is set to true + and AdminPasswordAuto is false, the admin password must be set or + an error will ensue, and vice versa. + :param guest_customization_section: GuestCustomizationSection element + to remove password from (if valid + to do so) + :type guest_customization_section: ``ET.Element`` + """ + admin_pass_enabled = guest_customization_section.find( + fixxpath(guest_customization_section, "AdminPasswordEnabled") + ) + admin_pass_auto = guest_customization_section.find( + fixxpath(guest_customization_section, "AdminPasswordAuto") + ) + admin_pass = guest_customization_section.find( + fixxpath(guest_customization_section, "AdminPassword") + ) + + if admin_pass is not None and ( + admin_pass_enabled is None + or admin_pass_enabled.text != "true" + or admin_pass_auto is None + or admin_pass_auto.text != "false" + ): + guest_customization_section.remove(admin_pass) + + def _update_or_insert_section(self, res, section, prev_section, text): + try: + res.object.find(fixxpath(res.object, section)).text = text + except Exception: + # "section" section does not exist, insert it just + # before "prev_section" + + for i, e in enumerate(res.object): + tag = "{http://www.vmware.com/vcloud/v1.5}%s" % prev_section + + if e.tag == tag: + break + e = ET.Element("{http://www.vmware.com/vcloud/v1.5}%s" % section) + e.text = text + res.object.insert(i, e) + + return res + + def ex_change_vm_admin_password(self, vapp_or_vm_id, ex_admin_password): + """ + Changes the admin (or root) password of VM or VMs under the vApp. If + the vapp_or_vm_id param represents a link to an vApp all VMs that + are attached to this vApp will be modified. + + :keyword vapp_or_vm_id: vApp or VM ID that will be modified. If a + vApp ID is used here all attached VMs + will be modified + :type vapp_or_vm_id: ``str`` + + :keyword ex_admin_password: admin password to be used. + :type ex_admin_password: ``str`` + + :rtype: ``None`` + """ + + if ex_admin_password is None: + return + + vms = self._get_vm_elements(vapp_or_vm_id) + + for vm in vms: + # Get GuestCustomizationSection + res = self.connection.request( + "%s/guestCustomizationSection" % get_url_path(vm.get("href")) + ) headers = { - 'Content-Type': - 'application/vnd.vmware.vcloud.networkConnectionSection+xml' + "Content-Type": "application/vnd.vmware.vcloud.guestCustomizationSection+xml" } + # Fix API quirk. + # If AdminAutoLogonEnabled==False the guestCustomizationSection + # must have AdminAutoLogonCount==0, even though + # it might have AdminAutoLogonCount==1 when requesting it for + # the first time. + auto_logon = res.object.find(fixxpath(res.object, "AdminAutoLogonEnabled")) + + if auto_logon is not None and auto_logon.text == "false": + self._update_or_insert_section( + res, "AdminAutoLogonCount", "ResetPasswordRequired", "0" + ) + + # If we are establishing a password we do not want it + # to be automatically chosen. + self._update_or_insert_section(res, "AdminPasswordAuto", "AdminPassword", "false") + + # API does not allow to set AdminPassword if + # AdminPasswordEnabled is not enabled. + self._update_or_insert_section(res, "AdminPasswordEnabled", "AdminPasswordAuto", "true") + + self._update_or_insert_section( + res, "AdminPassword", "AdminAutoLogonEnabled", ex_admin_password + ) + res = self.connection.request( - '%s/networkConnectionSection' % get_url_path(vm.get('href')), + "%s/guestCustomizationSection" % get_url_path(vm.get("href")), data=ET.tostring(res.object), - method='PUT', - headers=headers + method="PUT", + headers=headers, ) - self._wait_for_task_completion(res.object.get('href')) + self._wait_for_task_completion(res.object.get("href")) def _get_network_href(self, network_name): network_href = None # Find the organisation's network href res = self.connection.request(self.org) - links = res.object.findall(fixxpath(res.object, 'Link')) - for l in links: - if l.attrib['type'] == \ - 'application/vnd.vmware.vcloud.orgNetwork+xml' \ - and l.attrib['name'] == network_name: - network_href = l.attrib['href'] + links = res.object.findall(fixxpath(res.object, "Link")) + + for link in links: + if ( + link.attrib["type"] == "application/vnd.vmware.vcloud.orgNetwork+xml" + and link.attrib["name"] == network_name + ): + network_href = link.attrib["href"] if network_href is None: - raise ValueError( - '%s is not a valid organisation network name' % network_name) + raise ValueError("%s is not a valid organisation network name" % network_name) else: return network_href + def _ex_get_node(self, node_id): + """ + Get a node instance from a node ID. + + :param node_id: ID of the node + :type node_id: ``str`` + + :return: node instance or None if not found + :rtype: :class:`Node` or ``None`` + """ + res = self.connection.request( + get_url_path(node_id), + headers={"Content-Type": "application/vnd.vmware.vcloud.vApp+xml"}, + ) + + return self._to_node(res.object) + def _get_vm_elements(self, vapp_or_vm_id): res = self.connection.request(get_url_path(vapp_or_vm_id)) - if res.object.tag.endswith('VApp'): - vms = res.object.findall(fixxpath(res.object, 'Children/Vm')) - elif res.object.tag.endswith('Vm'): + + if res.object.tag.endswith("VApp"): + vms = res.object.findall(fixxpath(res.object, "Children/Vm")) + elif res.object.tag.endswith("Vm"): vms = [res.object] else: - raise ValueError( - 'Specified ID value is not a valid VApp or Vm identifier.') + raise ValueError("Specified ID value is not a valid VApp or Vm identifier.") + return vms def _is_node(self, node_or_image): return isinstance(node_or_image, Node) def _to_node(self, node_elm): - # Parse VMs as extra field + # Parse snapshots and VMs as extra + + if node_elm.find(fixxpath(node_elm, "SnapshotSection")) is None: + snapshots = None + else: + snapshots = [] + + for snapshot_elem in node_elm.findall(fixxpath(node_elm, "SnapshotSection/Snapshot")): + snapshots.append( + { + "created": snapshot_elem.get("created"), + "poweredOn": snapshot_elem.get("poweredOn"), + "size": snapshot_elem.get("size"), + } + ) + vms = [] - for vm_elem in node_elm.findall(fixxpath(node_elm, 'Children/Vm')): + + for vm_elem in node_elm.findall(fixxpath(node_elm, "Children/Vm")): public_ips = [] private_ips = [] - xpath = fixxpath(vm_elem, - 'NetworkConnectionSection/NetworkConnection') + xpath = fixxpath(vm_elem, "NetworkConnectionSection/NetworkConnection") + for connection in vm_elem.findall(xpath): ip = connection.find(fixxpath(connection, "IpAddress")) + if ip is not None: private_ips.append(ip.text) - external_ip = connection.find( - fixxpath(connection, "ExternalIpAddress")) + external_ip = connection.find(fixxpath(connection, "ExternalIpAddress")) + if external_ip is not None: public_ips.append(external_ip.text) elif ip is not None: public_ips.append(ip.text) - xpath = ('{http://schemas.dmtf.org/ovf/envelope/1}' - 'OperatingSystemSection') + xpath = "{http://schemas.dmtf.org/ovf/envelope/1}" "OperatingSystemSection" os_type_elem = vm_elem.find(xpath) + if os_type_elem is not None: - os_type = os_type_elem.get( - '{http://www.vmware.com/schema/ovf}osType') + os_type = os_type_elem.get("{http://www.vmware.com/schema/ovf}osType") else: os_type = None vm = { - 'id': vm_elem.get('href'), - 'name': vm_elem.get('name'), - 'state': self.NODE_STATE_MAP[vm_elem.get('status')], - 'public_ips': public_ips, - 'private_ips': private_ips, - 'os_type': os_type + "id": vm_elem.get("href"), + "name": vm_elem.get("name"), + "state": self.NODE_STATE_MAP[vm_elem.get("status")], + "public_ips": public_ips, + "private_ips": private_ips, + "os_type": os_type, } vms.append(vm) # Take the node IP addresses from all VMs public_ips = [] private_ips = [] + for vm in vms: - public_ips.extend(vm['public_ips']) - private_ips.extend(vm['private_ips']) + public_ips.extend(vm["public_ips"]) + private_ips.extend(vm["private_ips"]) # Find vDC - vdc_id = next(link.get('href') for link - in node_elm.findall(fixxpath(node_elm, 'Link')) - if link.get('type') == - 'application/vnd.vmware.vcloud.vdc+xml') + vdc_id = next( + link.get("href") + for link in node_elm.findall(fixxpath(node_elm, "Link")) + if link.get("type") == "application/vnd.vmware.vcloud.vdc+xml" + ) # pylint: disable=no-member vdc = next(vdc for vdc in self.vdcs if vdc.id == vdc_id) - node = Node(id=node_elm.get('href'), - name=node_elm.get('name'), - state=self.NODE_STATE_MAP[node_elm.get('status')], - public_ips=public_ips, - private_ips=private_ips, - driver=self.connection.driver, - extra={'vdc': vdc.name, 'vms': vms}) + extra = {"vdc": vdc.name, "vms": vms} + + description = node_elm.find(fixxpath(node_elm, "Description")) + + if description is not None: + extra["description"] = description.text + else: + extra["description"] = "" + + lease_settings = node_elm.find(fixxpath(node_elm, "LeaseSettingsSection")) + + if lease_settings is not None: + extra["lease_settings"] = Lease.to_lease(lease_settings) + else: + extra["lease_settings"] = None + + if snapshots is not None: + extra["snapshots"] = snapshots + + node = Node( + id=node_elm.get("href"), + name=node_elm.get("name"), + state=self.NODE_STATE_MAP[node_elm.get("status")], + public_ips=public_ips, + private_ips=private_ips, + driver=self.connection.driver, + extra=extra, + ) + return node def _to_vdc(self, vdc_elm): - def get_capacity_values(capacity_elm): if capacity_elm is None: return None - limit = int(capacity_elm.findtext(fixxpath(capacity_elm, 'Limit'))) - used = int(capacity_elm.findtext(fixxpath(capacity_elm, 'Used'))) - units = capacity_elm.findtext(fixxpath(capacity_elm, 'Units')) - return Capacity(limit, used, units) + limit = int(capacity_elm.findtext(fixxpath(capacity_elm, "Limit"))) + used = int(capacity_elm.findtext(fixxpath(capacity_elm, "Used"))) + units = capacity_elm.findtext(fixxpath(capacity_elm, "Units")) - cpu = get_capacity_values( - vdc_elm.find(fixxpath(vdc_elm, 'ComputeCapacity/Cpu'))) - memory = get_capacity_values( - vdc_elm.find(fixxpath(vdc_elm, 'ComputeCapacity/Memory'))) - storage = get_capacity_values( - vdc_elm.find(fixxpath(vdc_elm, 'StorageCapacity'))) + return Capacity(limit, used, units) - return Vdc(id=vdc_elm.get('href'), - name=vdc_elm.get('name'), - driver=self, - allocation_model=vdc_elm.findtext( - fixxpath(vdc_elm, 'AllocationModel')), - cpu=cpu, - memory=memory, - storage=storage) + cpu = get_capacity_values(vdc_elm.find(fixxpath(vdc_elm, "ComputeCapacity/Cpu"))) + memory = get_capacity_values(vdc_elm.find(fixxpath(vdc_elm, "ComputeCapacity/Memory"))) + storage = get_capacity_values(vdc_elm.find(fixxpath(vdc_elm, "StorageCapacity"))) + + return Vdc( + id=vdc_elm.get("href"), + name=vdc_elm.get("name"), + driver=self, + allocation_model=vdc_elm.findtext(fixxpath(vdc_elm, "AllocationModel")), + cpu=cpu, + memory=memory, + storage=storage, + ) class VCloud_5_1_NodeDriver(VCloud_1_5_NodeDriver): - @staticmethod def _validate_vm_memory(vm_memory): if vm_memory is None: @@ -2086,5 +2568,116 @@ def _validate_vm_memory(vm_memory): elif (vm_memory % 4) != 0: # The vcd 5.1 virtual machine memory size must be a multiple of 4 # MB - raise ValueError( - '%s is not a valid vApp VM memory value' % (vm_memory)) + raise ValueError("%s is not a valid vApp VM memory value" % (vm_memory)) + + +class VCloud_5_5_NodeDriver(VCloud_5_1_NodeDriver): + """Use 5.5 Connection class to explicitly set 5.5 for the version in + Accept headers + """ + + connectionCls = VCloud_5_5_Connection + + def ex_create_snapshot(self, node): + """ + Creates new snapshot of a virtual machine or of all + the virtual machines in a vApp. Prior to creation of the new + snapshots, any existing user created snapshots associated + with the virtual machines are removed. + + :param node: node + :type node: :class:`Node` + + :rtype: :class:`Node` + """ + snapshot_xml = ET.Element( + "CreateSnapshotParams", + { + "memory": "true", + "name": "name", + "quiesce": "true", + "xmlns": "http://www.vmware.com/vcloud/v1.5", + "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + }, + ) + ET.SubElement(snapshot_xml, "Description").text = "Description" + content_type = "application/vnd.vmware.vcloud.createSnapshotParams+xml" + headers = {"Content-Type": content_type} + + return self._perform_snapshot_operation(node, "createSnapshot", snapshot_xml, headers) + + def ex_remove_snapshots(self, node): + """ + Removes all user created snapshots for a vApp or virtual machine. + + :param node: node + :type node: :class:`Node` + + :rtype: :class:`Node` + """ + + return self._perform_snapshot_operation(node, "removeAllSnapshots", None, None) + + def ex_revert_to_snapshot(self, node): + """ + Reverts a vApp or virtual machine to the current snapshot, if any. + + :param node: node + :type node: :class:`Node` + + :rtype: :class:`Node` + """ + + return self._perform_snapshot_operation(node, "revertToCurrentSnapshot", None, None) + + def _perform_snapshot_operation(self, node, operation, xml_data, headers): + res = self.connection.request( + "{}/action/{}".format(get_url_path(node.id), operation), + data=ET.tostring(xml_data) if xml_data is not None else None, + method="POST", + headers=headers, + ) + self._wait_for_task_completion(res.object.get("href")) + res = self.connection.request(get_url_path(node.id)) + + return self._to_node(res.object) + + def ex_acquire_mks_ticket(self, vapp_or_vm_id, vm_num=0): + """ + Retrieve a mks ticket that you can use to gain access to the console + of a running VM. If successful, returns a dict with the following + keys: + + - host: host (or proxy) through which the console connection + is made + - vmx: a reference to the VMX file of the VM for which this + ticket was issued + - ticket: screen ticket to use to authenticate the client + - port: host port to be used for console access + + :param vapp_or_vm_id: vApp or VM ID you want to connect to. + :type vapp_or_vm_id: ``str`` + + :param vm_num: If a vApp ID is provided, vm_num is position in the + vApp VM list of the VM you want to get a screen ticket. + Default is 0. + :type vm_num: ``int`` + + :rtype: ``dict`` + """ + vm = self._get_vm_elements(vapp_or_vm_id)[vm_num] + try: + res = self.connection.request( + "%s/screen/action/acquireMksTicket" % (get_url_path(vm.get("href"))), + method="POST", + ) + output = { + "host": res.object.find(fixxpath(res.object, "Host")).text, + "vmx": res.object.find(fixxpath(res.object, "Vmx")).text, + "ticket": res.object.find(fixxpath(res.object, "Ticket")).text, + "port": res.object.find(fixxpath(res.object, "Port")).text, + } + + return output + except Exception: + return None diff --git a/libcloud/compute/drivers/voxel.py b/libcloud/compute/drivers/voxel.py deleted file mode 100644 index 98650272d1..0000000000 --- a/libcloud/compute/drivers/voxel.py +++ /dev/null @@ -1,307 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Voxel VoxCloud driver -""" -import datetime -import hashlib - -from libcloud.utils.py3 import b - -from libcloud.common.base import XmlResponse, ConnectionUserAndKey -from libcloud.common.types import InvalidCredsError -from libcloud.compute.providers import Provider -from libcloud.compute.types import NodeState -from libcloud.compute.base import Node, NodeDriver -from libcloud.compute.base import NodeSize, NodeImage, NodeLocation - -VOXEL_API_HOST = "api.voxel.net" - - -class VoxelResponse(XmlResponse): - def __init__(self, response, connection): - self.parsed = None - super(VoxelResponse, self).__init__(response=response, - connection=connection) - - def parse_body(self): - if not self.body: - return None - if not self.parsed: - self.parsed = super(VoxelResponse, self).parse_body() - return self.parsed - - def parse_error(self): - err_list = [] - if not self.body: - return None - if not self.parsed: - self.parsed = super(VoxelResponse, self).parse_body() - for err in self.parsed.findall('err'): - code = err.get('code') - err_list.append("(%s) %s" % (code, err.get('msg'))) - # From voxel docs: - # 1: Invalid login or password - # 9: Permission denied: user lacks access rights for this method - if code == "1" or code == "9": - # sucks, but only way to detect - # bad authentication tokens so far - raise InvalidCredsError(err_list[-1]) - return "\n".join(err_list) - - def success(self): - if not self.parsed: - self.parsed = super(VoxelResponse, self).parse_body() - stat = self.parsed.get('stat') - if stat != "ok": - return False - return True - - -class VoxelConnection(ConnectionUserAndKey): - """ - Connection class for the Voxel driver - """ - - host = VOXEL_API_HOST - responseCls = VoxelResponse - - def add_default_params(self, params): - params = dict([(k, v) for k, v in list(params.items()) - if v is not None]) - params["key"] = self.user_id - params["timestamp"] = datetime.datetime.utcnow().isoformat() + "+0000" - - keys = list(params.keys()) - keys.sort() - - md5 = hashlib.md5() - md5.update(b(self.key)) - for key in keys: - if params[key]: - if not params[key] is None: - md5.update(b("%s%s" % (key, params[key]))) - else: - md5.update(b(key)) - params['api_sig'] = md5.hexdigest() - return params - -VOXEL_INSTANCE_TYPES = {} -RAM_PER_CPU = 2048 - -NODE_STATE_MAP = { - 'IN_PROGRESS': NodeState.PENDING, - 'QUEUED': NodeState.PENDING, - 'SUCCEEDED': NodeState.RUNNING, - 'shutting-down': NodeState.TERMINATED, - 'terminated': NodeState.TERMINATED, - 'unknown': NodeState.UNKNOWN, -} - - -class VoxelNodeDriver(NodeDriver): - """ - Voxel VoxCLOUD node driver - """ - - connectionCls = VoxelConnection - type = Provider.VOXEL - name = 'Voxel VoxCLOUD' - website = 'http://www.voxel.net/' - - def _initialize_instance_types(): - for cpus in range(1, 14): - if cpus == 1: - name = "Single CPU" - else: - name = "%d CPUs" % cpus - id = "%dcpu" % cpus - ram = cpus * RAM_PER_CPU - - VOXEL_INSTANCE_TYPES[id] = { - 'id': id, - 'name': name, - 'ram': ram, - 'disk': None, - 'bandwidth': None, - 'price': None} - - features = {"create_node": [], - "list_sizes": ["variable_disk"]} - - _initialize_instance_types() - - def list_nodes(self): - params = {"method": "voxel.devices.list"} - result = self.connection.request('/', params=params).object - return self._to_nodes(result) - - def list_sizes(self, location=None): - return [NodeSize(driver=self.connection.driver, **i) - for i in list(VOXEL_INSTANCE_TYPES.values())] - - def list_images(self, location=None): - params = {"method": "voxel.images.list"} - result = self.connection.request('/', params=params).object - return self._to_images(result) - - def create_node(self, **kwargs): - """Create Voxel Node - - :keyword name: the name to assign the node (mandatory) - :type name: ``str`` - - :keyword image: distribution to deploy - :type image: :class:`NodeImage` - - :keyword size: the plan size to create (mandatory) - Requires size.disk (GB) to be set manually - :type size: :class:`NodeSize` - - :keyword location: which datacenter to create the node in - :type location: :class:`NodeLocation` - - :keyword ex_privateip: Backend IP address to assign to node; - must be chosen from the customer's - private VLAN assignment. - :type ex_privateip: ``str`` - - :keyword ex_publicip: Public-facing IP address to assign to node; - must be chosen from the customer's - public VLAN assignment. - :type ex_publicip: ``str`` - - :keyword ex_rootpass: Password for root access; generated if unset. - :type ex_rootpass: ``str`` - - :keyword ex_consolepass: Password for remote console; - generated if unset. - :type ex_consolepass: ``str`` - - :keyword ex_sshuser: Username for SSH access - :type ex_sshuser: ``str`` - - :keyword ex_sshpass: Password for SSH access; generated if unset. - :type ex_sshpass: ``str`` - - :keyword ex_voxel_access: Allow access Voxel administrative access. - Defaults to False. - :type ex_voxel_access: ``bool`` - - :rtype: :class:`Node` or ``None`` - """ - - # assert that disk > 0 - if not kwargs["size"].disk: - raise ValueError("size.disk must be non-zero") - - # convert voxel_access to string boolean if needed - voxel_access = kwargs.get("ex_voxel_access", None) - if voxel_access is not None: - voxel_access = "true" if voxel_access else "false" - - params = { - 'method': 'voxel.voxcloud.create', - 'hostname': kwargs["name"], - 'disk_size': int(kwargs["size"].disk), - 'facility': kwargs["location"].id, - 'image_id': kwargs["image"].id, - 'processing_cores': kwargs["size"].ram / RAM_PER_CPU, - 'backend_ip': kwargs.get("ex_privateip", None), - 'frontend_ip': kwargs.get("ex_publicip", None), - 'admin_password': kwargs.get("ex_rootpass", None), - 'console_password': kwargs.get("ex_consolepass", None), - 'ssh_username': kwargs.get("ex_sshuser", None), - 'ssh_password': kwargs.get("ex_sshpass", None), - 'voxel_access': voxel_access, - } - - object = self.connection.request('/', params=params).object - - if self._getstatus(object): - return Node( - id=object.findtext("device/id"), - name=kwargs["name"], - state=NODE_STATE_MAP[object.findtext("device/status")], - public_ips=kwargs.get("publicip", None), - private_ips=kwargs.get("privateip", None), - driver=self.connection.driver - ) - else: - return None - - def reboot_node(self, node): - params = {'method': 'voxel.devices.power', - 'device_id': node.id, - 'power_action': 'reboot'} - return self._getstatus( - self.connection.request('/', params=params).object) - - def destroy_node(self, node): - params = {'method': 'voxel.voxcloud.delete', - 'device_id': node.id} - return self._getstatus( - self.connection.request('/', params=params).object) - - def list_locations(self): - params = {"method": "voxel.voxcloud.facilities.list"} - result = self.connection.request('/', params=params).object - nodes = self._to_locations(result) - return nodes - - def _getstatus(self, element): - status = element.attrib["stat"] - return status == "ok" - - def _to_locations(self, object): - return [NodeLocation(element.attrib["label"], - element.findtext("description"), - element.findtext("description"), - self) - for element in object.findall('facilities/facility')] - - def _to_nodes(self, object): - nodes = [] - for element in object.findall('devices/device'): - if element.findtext("type") == "Virtual Server": - try: - state = self.NODE_STATE_MAP[element.attrib['status']] - except KeyError: - state = NodeState.UNKNOWN - - public_ip = private_ip = None - ipassignments = element.findall("ipassignments/ipassignment") - for ip in ipassignments: - if ip.attrib["type"] == "frontend": - public_ip = ip.text - elif ip.attrib["type"] == "backend": - private_ip = ip.text - - nodes.append(Node(id=element.attrib['id'], - name=element.attrib['label'], - state=state, - public_ips=public_ip, - private_ips=private_ip, - driver=self.connection.driver)) - return nodes - - def _to_images(self, object): - images = [] - for element in object.findall("images/image"): - images.append(NodeImage(id=element.attrib["id"], - name=element.attrib["summary"], - driver=self.connection.driver)) - return images diff --git a/libcloud/compute/drivers/vpsnet.py b/libcloud/compute/drivers/vpsnet.py index 8d026a8c4a..1531ecae1a 100644 --- a/libcloud/compute/drivers/vpsnet.py +++ b/libcloud/compute/drivers/vpsnet.py @@ -15,24 +15,24 @@ """ VPS.net driver """ + import base64 +from libcloud.utils.py3 import b +from libcloud.common.base import JsonResponse, ConnectionUserAndKey +from libcloud.common.types import InvalidCredsError, MalformedResponseError +from libcloud.compute.base import Node, NodeSize, NodeImage, NodeDriver, NodeLocation +from libcloud.compute.types import NodeState +from libcloud.compute.providers import Provider + try: import simplejson as json except ImportError: import json -from libcloud.utils.py3 import b - -from libcloud.common.base import ConnectionUserAndKey, JsonResponse -from libcloud.common.types import InvalidCredsError, MalformedResponseError -from libcloud.compute.providers import Provider -from libcloud.compute.types import NodeState -from libcloud.compute.base import Node, NodeDriver -from libcloud.compute.base import NodeSize, NodeImage, NodeLocation -API_HOST = 'api.vps.net' -API_VERSION = 'api10json' +API_HOST = "api.vps.net" +API_VERSION = "api10json" RAM_PER_NODE = 256 DISK_PER_NODE = 10 @@ -42,7 +42,7 @@ class VPSNetResponse(JsonResponse): def parse_body(self): try: - return super(VPSNetResponse, self).parse_body() + return super().parse_body() except MalformedResponseError: return self.body @@ -54,7 +54,7 @@ def success(self): def parse_error(self): try: - errors = super(VPSNetResponse, self).parse_body()['errors'][0] + errors = super().parse_body()["errors"][0] except MalformedResponseError: return self.body else: @@ -72,8 +72,8 @@ class VPSNetConnection(ConnectionUserAndKey): allow_insecure = False def add_default_headers(self, headers): - user_b64 = base64.b64encode(b('%s:%s' % (self.user_id, self.key))) - headers['Authorization'] = 'Basic %s' % (user_b64.decode('utf-8')) + user_b64 = base64.b64encode(b("{}:{}".format(self.user_id, self.key))) + headers["Authorization"] = "Basic %s" % (user_b64.decode("utf-8")) return headers @@ -83,49 +83,64 @@ class VPSNetNodeDriver(NodeDriver): """ type = Provider.VPSNET - api_name = 'vps_net' + api_name = "vps_net" name = "vps.net" - website = 'http://vps.net/' + website = "http://vps.net/" connectionCls = VPSNetConnection def _to_node(self, vm): - if vm['running']: + if vm["running"]: state = NodeState.RUNNING else: state = NodeState.PENDING - n = Node(id=vm['id'], - name=vm['label'], - state=state, - public_ips=[vm.get('primary_ip_address', None)], - private_ips=[], - extra={'slices_count': vm['slices_count']}, - # Number of nodes consumed by VM - driver=self.connection.driver) + n = Node( + id=vm["id"], + name=vm["label"], + state=state, + public_ips=[vm.get("primary_ip_address", None)], + private_ips=[], + extra={"slices_count": vm["slices_count"]}, + # Number of nodes consumed by VM + driver=self.connection.driver, + ) return n def _to_image(self, image, cloud): - image = NodeImage(id=image['id'], - name="%s: %s" % (cloud, image['label']), - driver=self.connection.driver) + image = NodeImage( + id=image["id"], + name="{}: {}".format(cloud, image["label"]), + driver=self.connection.driver, + ) return image def _to_size(self, num): - size = NodeSize(id=num, - name="%d Node" % (num,), - ram=RAM_PER_NODE * num, - disk=DISK_PER_NODE, - bandwidth=BANDWIDTH_PER_NODE * num, - price=self._get_price_per_node(num) * num, - driver=self.connection.driver) + size = NodeSize( + id=num, + name="%d Node" % (num,), + ram=RAM_PER_NODE * num, + disk=DISK_PER_NODE, + bandwidth=BANDWIDTH_PER_NODE * num, + price=self._get_price_per_node(num) * num, + driver=self.connection.driver, + ) return size def _get_price_per_node(self, num): - single_node_price = self._get_size_price(size_id='1') + single_node_price = self._get_size_price(size_id="1") return num * single_node_price - def create_node(self, name, image, size, **kwargs): + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_backups_enabled=False, + ex_fqdn=None, + ): """Create a new VPS.net node @inherits: :class:`NodeDriver.create_node` @@ -136,58 +151,61 @@ def create_node(self, name, image, size, **kwargs): :keyword ex_fqdn: Fully Qualified domain of the node :type ex_fqdn: ``str`` """ - headers = {'Content-Type': 'application/json'} - request = {'virtual_machine': - {'label': name, - 'fqdn': kwargs.get('ex_fqdn', ''), - 'system_template_id': image.id, - 'backups_enabled': kwargs.get('ex_backups_enabled', 0), - 'slices_required': size.id}} - - res = self.connection.request('/virtual_machines.%s' % (API_VERSION,), - data=json.dumps(request), - headers=headers, - method='POST') - node = self._to_node(res.object['virtual_machine']) + ex_backups_enabled = 1 if ex_backups_enabled else 0 + headers = {"Content-Type": "application/json"} + request = { + "virtual_machine": { + "label": name, + "fqdn": ex_fqdn or "", + "system_template_id": image.id, + "backups_enabled": ex_backups_enabled, + "slices_required": size.id, + } + } + + res = self.connection.request( + "/virtual_machines.{}".format(API_VERSION), + data=json.dumps(request), + headers=headers, + method="POST", + ) + node = self._to_node(res.object["virtual_machine"]) return node def reboot_node(self, node): res = self.connection.request( - '/virtual_machines/%s/%s.%s' % (node.id, - 'reboot', - API_VERSION), - method="POST") - node = self._to_node(res.object['virtual_machine']) + "/virtual_machines/{}/{}.{}".format(node.id, "reboot", API_VERSION), + method="POST", + ) + node = self._to_node(res.object["virtual_machine"]) return True def list_sizes(self, location=None): - res = self.connection.request('/nodes.%s' % (API_VERSION,)) - available_nodes = len([size for size in res.object - if size['slice']['virtual_machine_id']]) + res = self.connection.request("/nodes.{}".format(API_VERSION)) + available_nodes = len([size for size in res.object if size["slice"]["virtual_machine_id"]]) sizes = [self._to_size(i) for i in range(1, available_nodes + 1)] return sizes def destroy_node(self, node): - res = self.connection.request('/virtual_machines/%s.%s' - % (node.id, API_VERSION), - method='DELETE') + res = self.connection.request( + "/virtual_machines/{}.{}".format(node.id, API_VERSION), method="DELETE" + ) return res.status == 200 def list_nodes(self): - res = self.connection.request('/virtual_machines.%s' % (API_VERSION,)) - return [self._to_node(i['virtual_machine']) for i in res.object] + res = self.connection.request("/virtual_machines.{}".format(API_VERSION)) + return [self._to_node(i["virtual_machine"]) for i in res.object] def list_images(self, location=None): - res = self.connection.request('/available_clouds.%s' % (API_VERSION,)) + res = self.connection.request("/available_clouds.{}".format(API_VERSION)) images = [] for cloud in res.object: - label = cloud['cloud']['label'] - templates = cloud['cloud']['system_templates'] - images.extend([self._to_image(image, label) - for image in templates]) + label = cloud["cloud"]["label"] + templates = cloud["cloud"]["system_templates"] + images.extend([self._to_image(image, label) for image in templates]) return images def list_locations(self): - return [NodeLocation(0, "VPS.net Western US", 'US', self)] + return [NodeLocation(0, "VPS.net Western US", "US", self)] diff --git a/libcloud/compute/drivers/vsphere.py b/libcloud/compute/drivers/vsphere.py index 4206d43bf4..728c336655 100644 --- a/libcloud/compute/drivers/vsphere.py +++ b/libcloud/compute/drivers/vsphere.py @@ -14,539 +14,2321 @@ # limitations under the License. """ -VMware vSphere driver supporting vSphere v5.5. +VMware vSphere driver. Uses pyvmomi - https://github.com/vmware/pyvmomi +Code inspired by https://github.com/vmware/pyvmomi-community-samples -Note: This driver requires pysphere package -(https://pypi.python.org/pypi/pysphere) which can be installed using pip. For -more information, please refer to the official documentation. +Authors: Dimitris Moraitis, Alex Tsiliris, Markos Gogoulos """ -import os -import sys +import ssl +import json +import time import atexit - -try: - import pysphere - pysphere -except ImportError: - raise ImportError('Missing "pysphere" dependency. You can install it ' - 'using pip - pip install pysphere') - -from pysphere import VIServer -from pysphere.vi_task import VITask -from pysphere.vi_mor import VIMor, MORTypes -from pysphere.resources import VimService_services as VI -from pysphere.vi_virtual_machine import VIVirtualMachine - -from libcloud.utils.decorators import wrap_non_libcloud_exceptions -from libcloud.common.base import ConnectionUserAndKey -from libcloud.common.types import LibcloudError -from libcloud.common.types import InvalidCredsError -from libcloud.compute.base import NodeDriver -from libcloud.compute.base import NodeLocation -from libcloud.compute.base import NodeImage -from libcloud.compute.base import Node -from libcloud.compute.types import NodeState, Provider +import base64 +import asyncio +import hashlib +import logging +import warnings +import functools +import itertools + +from libcloud.utils.py3 import httplib +from libcloud.common.base import JsonResponse, ConnectionKey +from libcloud.common.types import LibcloudError, ProviderError, InvalidCredsError +from libcloud.compute.base import Node, NodeSize, NodeImage, NodeDriver, NodeLocation +from libcloud.compute.types import Provider, NodeState from libcloud.utils.networking import is_public_subnet +from libcloud.common.exceptions import BaseHTTPError -__all__ = [ - 'VSphereNodeDriver', - 'VSphere_5_5_NodeDriver' -] - -DEFAULT_API_VERSION = '5.5' -DEFAULT_CONNECTION_TIMEOUT = 5 # default connection timeout in seconds +try: + from pyVim import connect + from pyVmomi import VmomiSupport, vim, vmodl + from pyVim.task import WaitForTask + pyvmomi = True +except ImportError: + pyvmomi = None -class VSphereConnection(ConnectionUserAndKey): - def __init__(self, user_id, key, secure=True, - host=None, port=None, url=None, timeout=None): - if host and url: - raise ValueError('host and url arguments are mutually exclusive') - if host: - host_or_url = host - elif url: - host_or_url = url - else: - raise ValueError('Either "host" or "url" argument must be ' - 'provided') +logger = logging.getLogger("libcloud.compute.drivers.vsphere") - self.host_or_url = host_or_url - self.client = None - super(VSphereConnection, self).__init__(user_id=user_id, - key=key, secure=secure, - host=host, port=port, - url=url, timeout=timeout) - def connect(self): - self.client = VIServer() +def recurse_snapshots(snapshot_list): + ret = [] - trace_file = os.environ.get('LIBCLOUD_DEBUG', None) + for s in snapshot_list: + ret.append(s) + ret += recurse_snapshots(getattr(s, "childSnapshotList", [])) - try: - self.client.connect(host=self.host_or_url, user=self.user_id, - password=self.key, - sock_timeout=DEFAULT_CONNECTION_TIMEOUT, - trace_file=trace_file) - except Exception: - e = sys.exc_info()[1] - message = e.message - fault = getattr(e, 'fault', None) + return ret - if fault == 'InvalidLoginFault': - raise InvalidCredsError(message) - raise LibcloudError(value=message, driver=self.driver) +def format_snapshots(snapshot_list): + ret = [] - atexit.register(self.disconnect) + for s in snapshot_list: + ret.append( + { + "id": s.id, + "name": s.name, + "description": s.description, + "created": s.createTime.strftime("%Y-%m-%d %H:%M"), + "state": s.state, + } + ) - def disconnect(self): - if not self.client: - return - - try: - self.client.disconnect() - except Exception: - # Ignore all the disconnect errors - pass - - def run_client_method(self, method_name, **method_kwargs): - method = getattr(self.client, method_name, None) - return method(**method_kwargs) + return ret +# 6.5 and older, probably won't work on anything earlier than 4.x class VSphereNodeDriver(NodeDriver): - name = 'VMware vSphere' - website = 'http://www.vmware.com/products/vsphere/' + name = "VMware vSphere" + website = "http://www.vmware.com/products/vsphere/" type = Provider.VSPHERE - connectionCls = VSphereConnection NODE_STATE_MAP = { - 'POWERED ON': NodeState.RUNNING, - 'POWERED OFF': NodeState.STOPPED, - 'SUSPENDED': NodeState.SUSPENDED, - 'POWERING ON': NodeState.PENDING, - 'POWERING OFF': NodeState.PENDING, - 'SUSPENDING': NodeState.PENDING, - 'RESETTING': NodeState.PENDING, - 'BLOCKED ON MSG': NodeState.ERROR, - 'REVERTING TO SNAPSHOT': NodeState.PENDING + "poweredOn": NodeState.RUNNING, + "poweredOff": NodeState.STOPPED, + "suspended": NodeState.SUSPENDED, } - def __new__(cls, username, password, secure=True, host=None, port=None, - url=None, api_version=DEFAULT_API_VERSION, **kwargs): - if cls is VSphereNodeDriver: - if api_version == '5.5': - cls = VSphere_5_5_NodeDriver - else: - raise NotImplementedError('Unsupported API version: %s' % - (api_version)) - return super(VSphereNodeDriver, cls).__new__(cls) + def __init__(self, host, username, password, port=443, ca_cert=None, verify_ssl=True): + """Initialize a connection by providing a hostname, + username and password + """ - def __init__(self, username, password, secure=True, - host=None, port=None, url=None, timeout=None): - self.url = url - super(VSphereNodeDriver, self).__init__(key=username, secret=password, - secure=secure, host=host, - port=port, url=url) + if pyvmomi is None: + raise ImportError( + 'Missing "pyvmomi" dependency. ' + "You can install it " + "using pip - pip install pyvmomi" + ) + self.host = host + try: + if ca_cert is None: + self.connection = connect.SmartConnect( + host=host, + port=port, + user=username, + pwd=password, + ) + else: + context = ssl.create_default_context(cafile=ca_cert) + self.connection = connect.SmartConnect( + host=host, + port=port, + user=username, + pwd=password, + sslContext=context, + ) + atexit.register(connect.Disconnect, self.connection) + except Exception as exc: + error_message = str(exc).lower() + + if "incorrect user name" in error_message: + raise InvalidCredsError("Check your username and " "password are valid") + + if "connection refused" in error_message or "is not a vim server" in error_message: + raise LibcloudError( + "Check that the host provided is a " "vSphere installation", + driver=self, + ) + + if "name or service not known" in error_message: + raise LibcloudError("Check that the vSphere host is accessible", driver=self) + + if "certificate verify failed" in error_message and not verify_ssl: + # bypass self signed certificates + try: + context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) + context.verify_mode = ssl.CERT_NONE + except ImportError: + raise ImportError( + "To use self signed certificates, " + "please upgrade to python 2.7.11 and " + "pyvmomi 6.0.0+" + ) + + self.connection = connect.SmartConnect( + host=host, + port=port, + user=username, + pwd=password, + sslContext=context, + ) + atexit.register(connect.Disconnect, self.connection) + else: + raise LibcloudError("Cannot connect to vSphere", driver=self) - @wrap_non_libcloud_exceptions - def list_locations(self): + def list_locations(self, ex_show_hosts_in_drs=True): """ - List available locations. - - In vSphere case, a location represents a datacenter. + Lists locations """ - datacenters = self.connection.client.get_datacenters() - + content = self.connection.RetrieveContent() + + potential_locations = [ + dc + for dc in content.viewManager.CreateContainerView( + content.rootFolder, + [vim.ClusterComputeResource, vim.HostSystem], + recursive=True, + ).view + ] + + # Add hosts and clusters with DRS enabled locations = [] - for id, name in datacenters.items(): - location = NodeLocation(id=id, name=name, country=None, - driver=self) - locations.append(location) + hosts_all = [] + clusters = [] + + for location in potential_locations: + if isinstance(location, vim.HostSystem): + hosts_all.append(location) + elif isinstance(location, vim.ClusterComputeResource): + if location.configuration.drsConfig.enabled: + clusters.append(location) + + if ex_show_hosts_in_drs: + hosts = hosts_all + else: + hosts_filter = [host for cluster in clusters for host in cluster.host] + hosts = [host for host in hosts_all if host not in hosts_filter] + + for cluster in clusters: + locations.append(self._to_location(cluster)) + + for host in hosts: + locations.append(self._to_location(host)) return locations - @wrap_non_libcloud_exceptions - def list_images(self): + def _to_location(self, data): + extra = {} + try: + if isinstance(data, vim.HostSystem): + extra = { + "type": "host", + "state": data.runtime.connectionState, + "hypervisor": data.config.product.fullName, + "vendor": data.hardware.systemInfo.vendor, + "model": data.hardware.systemInfo.model, + "ram": data.hardware.memorySize, + "cpu": { + "packages": data.hardware.cpuInfo.numCpuPackages, + "cores": data.hardware.cpuInfo.numCpuCores, + "threads": data.hardware.cpuInfo.numCpuThreads, + }, + "uptime": data.summary.quickStats.uptime, + "parent": str(data.parent), + } + elif isinstance(data, vim.ClusterComputeResource): + extra = { + "type": "cluster", + "overallStatus": data.overallStatus, + "drs": data.configuration.drsConfig.enabled, + "hosts": [host.name for host in data.host], + "parent": str(data.parent), + } + except AttributeError as exc: + logger.error("Cannot convert location {}: {!r}".format(data.name, exc)) + extra = {} + + return NodeLocation(id=data.name, name=data.name, country=None, extra=extra, driver=self) + + def ex_list_networks(self): """ - List available images (templates). + List networks """ - server = self.connection.client + content = self.connection.RetrieveContent() + networks = content.viewManager.CreateContainerView( + content.rootFolder, [vim.Network], recursive=True + ).view - names = ['name', 'config.uuid', 'config.template'] - properties = server._retrieve_properties_traversal( - property_names=names, - from_node=None, - obj_type=MORTypes.VirtualMachine) + return [self._to_network(network) for network in networks] - images = [] - for prop in properties: - id = None - name = None - is_template = False - - for item in prop.PropSet: - if item.Name == 'config.uuid': - id = item.Val - if item.Name == 'name': - name = item.Val - elif item.Name == 'config.template': - is_template = item.Val - - if is_template: - image = NodeImage(id=id, name=name, driver=self) - images.append(image) - - return images - - @wrap_non_libcloud_exceptions - def list_nodes(self): - vm_paths = self.connection.client.get_registered_vms() - nodes = self._to_nodes(vm_paths=vm_paths) + def _to_network(self, data): + summary = data.summary + extra = { + "hosts": [h.name for h in data.host], + "ip_pool_name": summary.ipPoolName, + "ip_pool_id": summary.ipPoolId, + "accessible": summary.accessible, + } - return nodes + return VSphereNetwork(id=data.name, name=data.name, extra=extra) - @wrap_non_libcloud_exceptions - @wrap_non_libcloud_exceptions - def ex_clone_node(self, node, name, power_on=True, template=False): + def list_sizes( + self, + location=None, + ): + """ + Returns sizes """ - Clone the provided node. - :param node: Node to clone. - :type node: :class:`libcloud.compute.base.Node` + return [] - :param name: Name of the new node. - :type name: ``str`` + def list_images(self, location=None, folder_ids=None): + """ + Lists VM templates as images. + If folder is given then it will list images contained + in that folder only. + """ - :param power_on: Power the new node on after being created. - :type power_on: ``bool`` + images = [] - :param template: Specifies whether or not the new virtual machine - should be marked as a template. - :type template: ``bool`` + if folder_ids: + vms = [] - :return: New node. - :rtype: :class:`libcloud.compute.base.Node` - """ - vm = self._get_vm_for_node(node=node) - new_vm = vm.clone(name=name, power_on=power_on, template=template) - new_node = self._to_node(vm=new_vm) + for folder_id in folder_ids: + folder_object = self._get_item_by_moid("Folder", folder_id) + vms.extend(folder_object.childEntity) + else: + content = self.connection.RetrieveContent() + vms = content.viewManager.CreateContainerView( + content.rootFolder, [vim.VirtualMachine], recursive=True + ).view + + for vm in vms: + if vm.config and vm.config.template: + images.append(self._to_image(vm)) + + return images + + def _to_image(self, data): + summary = data.summary + name = summary.config.name + uuid = summary.config.instanceUuid + memory = summary.config.memorySizeMB + cpus = summary.config.numCpu + operating_system = summary.config.guestFullName + os_type = "unix" + + if "Microsoft" in str(operating_system): + os_type = "windows" + annotation = summary.config.annotation + extra = { + "path": summary.config.vmPathName, + "operating_system": operating_system, + "os_type": os_type, + "memory_MB": memory, + "cpus": cpus, + "overallStatus": str(summary.overallStatus), + "metadata": {}, + "type": "template_6_5", + "disk_size": int(summary.storage.committed) // (1024**3), + "datastore": data.datastore[0].info.name, + } + + boot_time = summary.runtime.bootTime + + if boot_time: + extra["boot_time"] = boot_time.isoformat() - return new_node + if annotation: + extra["annotation"] = annotation - @wrap_non_libcloud_exceptions - def ex_migrate_node(self, node, resource_pool=None, host=None, - priority='default'): + for custom_field in data.customValue: + key_id = custom_field.key + key = self.find_custom_field_key(key_id) + extra["metadata"][key] = custom_field.value + + return NodeImage(id=uuid, name=name, driver=self, extra=extra) + + def _collect_properties(self, content, view_ref, obj_type, path_set=None, include_mors=False): + """ + Collect properties for managed objects from a view ref + Check the vSphere API documentation for example on retrieving + object properties: + - http://goo.gl/erbFDz + Args: + content (ServiceInstance): ServiceInstance content + view_ref (pyVmomi.vim.view.*): Starting point of inventory + navigation + obj_type (pyVmomi.vim.*): Type of managed object + path_set (list): List of properties to retrieve + include_mors (bool): If True include the managed objects + refs in the result + Returns: + A list of properties for the managed objects """ - Migrate provided node to a new host or resource pool. + collector = content.propertyCollector - :param node: Node to clone. - :type node: :class:`libcloud.compute.base.Node` + # Create object specification to define the starting point of + # inventory navigation + obj_spec = vmodl.query.PropertyCollector.ObjectSpec() + obj_spec.obj = view_ref + obj_spec.skip = True - :param resource_pool: ID of the target resource pool to migrate the - node into. - :type resource_pool: ``str`` + # Create a traversal specification to identify the path for collection + traversal_spec = vmodl.query.PropertyCollector.TraversalSpec() + traversal_spec.name = "traverseEntities" + traversal_spec.path = "view" + traversal_spec.skip = False + traversal_spec.type = view_ref.__class__ + obj_spec.selectSet = [traversal_spec] - :param host: Target host to migrate the host to. - :type host: ``str`` + # Identify the properties to the retrieved + property_spec = vmodl.query.PropertyCollector.PropertySpec() + property_spec.type = obj_type - :param priority: Migration task priority. Possible values: default, - high, low. - :type priority: ``str`` + if not path_set: + property_spec.all = True - :return: True on success. - :rtype: ``bool`` - """ - vm = self._get_vm_for_node(node=node) - vm.migrate(priority=priority, resource_pool=resource_pool, host=host) + property_spec.pathSet = path_set - return True + # Add the object and property specification to the + # property filter specification + filter_spec = vmodl.query.PropertyCollector.FilterSpec() + filter_spec.objectSet = [obj_spec] + filter_spec.propSet = [property_spec] - @wrap_non_libcloud_exceptions - def reboot_node(self, node): - vm = self._get_vm_for_node(node=node) - vm.reset() + # Retrieve properties + props = collector.RetrieveContents([filter_spec]) - return True + data = [] - @wrap_non_libcloud_exceptions - def destroy_node(self, node, ex_remove_files=True): + for obj in props: + properties = {} + + for prop in obj.propSet: + properties[prop.name] = prop.val + + if include_mors: + properties["obj"] = obj.obj + + data.append(properties) + + return data + + def list_nodes(self, enhance=True, max_properties=20): """ - :param ex_remove_files: Remove all the files from the datastore. - :type ex_remove_files: ``bool`` + List nodes, excluding templates """ - ex_remove_files = False - vm = self._get_vm_for_node(node=node) - server = self.connection.client + vm_properties = [ + "config.template", + "summary.config.name", + "summary.config.vmPathName", + "summary.config.memorySizeMB", + "summary.config.numCpu", + "summary.storage.committed", + "summary.config.guestFullName", + "summary.runtime.host", + "summary.config.instanceUuid", + "summary.config.annotation", + "summary.runtime.powerState", + "summary.runtime.bootTime", + "summary.guest.ipAddress", + "summary.overallStatus", + "customValue", + "snapshot", + ] + content = self.connection.RetrieveContent() + view = content.viewManager.CreateContainerView( + content.rootFolder, [vim.VirtualMachine], True + ) + i = 0 + vm_dict = {} + + while i < len(vm_properties): + vm_list = self._collect_properties( + content, + view, + vim.VirtualMachine, + path_set=vm_properties[i : i + max_properties], + include_mors=True, + ) + i += max_properties + + for vm in vm_list: + if not vm_dict.get(vm["obj"]): + vm_dict[vm["obj"]] = vm + else: + vm_dict[vm["obj"]].update(vm) + + vm_list = [vm_dict[k] for k in vm_dict] + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + nodes = loop.run_until_complete(self._to_nodes(vm_list)) - # Based on code from - # https://pypi.python.org/pypi/pyxenter - if ex_remove_files: - request = VI.Destroy_TaskRequestMsg() + if enhance: + nodes = self._enhance_metadata(nodes, content) - _this = request.new__this(vm._mor) - _this.set_attribute_type(vm._mor.get_attribute_type()) - request.set_element__this(_this) - ret = server._proxy.Destroy_Task(request)._returnval - task = VITask(ret, server) + return nodes - # Wait for the task to finish - status = task.wait_for_state([task.STATE_SUCCESS, - task.STATE_ERROR]) + def list_nodes_recursive(self, enhance=True): + """ + Lists nodes, excluding templates + """ + nodes = [] + content = self.connection.RetrieveContent() + children = content.rootFolder.childEntity + # this will be needed for custom VM metadata - if status == task.STATE_ERROR: - raise LibcloudError('Error destroying node: %s' % - (task.get_error_message())) + if content.customFieldsManager: + self.custom_fields = content.customFieldsManager.field else: - request = VI.UnregisterVMRequestMsg() + self.custom_fields = [] - _this = request.new__this(vm._mor) - _this.set_attribute_type(vm._mor.get_attribute_type()) - request.set_element__this(_this) - ret = server._proxy.UnregisterVM(request) - task = VITask(ret, server) + for child in children: + if hasattr(child, "vmFolder"): + datacenter = child + vm_folder = datacenter.vmFolder + vm_list = vm_folder.childEntity + nodes.extend(self._to_nodes_recursive(vm_list)) - return True + if enhance: + nodes = self._enhance_metadata(nodes, content) - @wrap_non_libcloud_exceptions - def ex_stop_node(self, node): - vm = self._get_vm_for_node(node=node) - vm.power_off() + return nodes - return True + def _enhance_metadata(self, nodes, content): + nodemap = {} - @wrap_non_libcloud_exceptions - def ex_start_node(self, node): - vm = self._get_vm_for_node(node=node) - vm.power_on() + for node in nodes: + node.extra["vSphere version"] = content.about.version + nodemap[node.id] = node - return True + # Get VM deployment events to extract creation dates & images + filter_spec = vim.event.EventFilterSpec(eventTypeId=["VmBeingDeployedEvent"]) + deploy_events = content.eventManager.QueryEvent(filter_spec) - @wrap_non_libcloud_exceptions - def ex_suspend_node(self, node): - vm = self._get_vm_for_node(node=node) - vm.suspend() + for event in deploy_events: + try: + uuid = event.vm.vm.config.instanceUuid + except Exception: + continue + + if uuid in nodemap: + node = nodemap[uuid] + try: # Get source template as image + source_template_vm = event.srcTemplate.vm + image_id = source_template_vm.config.instanceUuid + node.extra["image_id"] = image_id + except Exception: + logger.error("Cannot get instanceUuid " "from source template") + try: # Get creation date + node.created_at = event.createdTime + except AttributeError: + logger.error("Cannot get creation date from VM " "deploy event") - return True + return nodes - @wrap_non_libcloud_exceptions - def ex_get_resource_pools(self): - """ - Return all the available resource pools. + async def _to_nodes(self, vm_list): + vms = [] - :rtype: ``dict`` - """ - result = self.connection.client.get_resource_pools() - return result + for vm in vm_list: + if vm.get("config.template"): + continue # Do not include templates in node list + vms.append(vm) + loop = asyncio.get_event_loop() + vms = [loop.run_in_executor(None, self._to_node, vms[i]) for i in range(len(vms))] - @wrap_non_libcloud_exceptions - def ex_get_resource_pool_name(self, node): - """ - Retrieve resource pool name for the provided node. + return await asyncio.gather(*vms) + + def _to_nodes_recursive(self, vm_list): + nodes = [] + + for virtual_machine in vm_list: + if hasattr(virtual_machine, "childEntity"): + # If this is a group it will have children. + # If it does, recurse into them and then return + nodes.extend(self._to_nodes_recursive(virtual_machine.childEntity)) + elif isinstance(virtual_machine, vim.VirtualApp): + # If this is a vApp, it likely contains child VMs + # (vApps can nest vApps, but it is hardly + # a common usecase, so ignore that) + nodes.extend(self._to_nodes_recursive(virtual_machine.vm)) + else: + if not hasattr(virtual_machine, "config") or ( + virtual_machine.config and virtual_machine.config.template + ): + continue # Do not include templates in node list + nodes.append(self._to_node_recursive(virtual_machine)) + + return nodes + + def _to_node(self, vm): + name = vm.get("summary.config.name") + path = vm.get("summary.config.vmPathName") + memory = vm.get("summary.config.memorySizeMB") + cpus = vm.get("summary.config.numCpu") + disk = vm.get("summary.storage.committed", 0) // (1024**3) + id_to_hash = str(memory) + str(cpus) + str(disk) + size_id = hashlib.md5(id_to_hash.encode("utf-8")).hexdigest() # nosec + size_name = name + "-size" + size_extra = {"cpus": cpus} + driver = self + size = NodeSize( + id=size_id, + name=size_name, + ram=memory, + disk=disk, + bandwidth=0, + price=0, + driver=driver, + extra=size_extra, + ) + operating_system = vm.get("summary.config.guestFullName") + host = vm.get("summary.runtime.host") + + os_type = "unix" + + if "Microsoft" in str(operating_system): + os_type = "windows" + uuid = vm.get("summary.config.instanceUuid") or ( + vm.get("obj").config and vm.get("obj").config.instanceUuid + ) + + if not uuid: + logger.error("No uuid for vm: {}".format(vm)) + annotation = vm.get("summary.config.annotation") + state = vm.get("summary.runtime.powerState") + status = self.NODE_STATE_MAP.get(state, NodeState.UNKNOWN) + boot_time = vm.get("summary.runtime.bootTime") + + ip_addresses = [] + + if vm.get("summary.guest.ipAddress"): + ip_addresses.append(vm.get("summary.guest.ipAddress")) + + overall_status = str(vm.get("summary.overallStatus")) + public_ips = [] + private_ips = [] + + extra = { + "path": path, + "operating_system": operating_system, + "os_type": os_type, + "memory_MB": memory, + "cpus": cpus, + "overall_status": overall_status, + "metadata": {}, + "snapshots": [], + } + + if disk: + extra["disk"] = disk + + if host: + extra["host"] = host.name + parent = host.parent + + while parent: + if isinstance(parent, vim.ClusterComputeResource): + extra["cluster"] = parent.name + + break + parent = parent.parent + + if boot_time: + extra["boot_time"] = boot_time.isoformat() + + if annotation: + extra["annotation"] = annotation + + for ip_address in ip_addresses: + try: + if is_public_subnet(ip_address): + public_ips.append(ip_address) + else: + private_ips.append(ip_address) + except Exception: + # IPV6 not supported + pass - :rtype: ``str`` + if vm.get("snapshot"): + extra["snapshots"] = format_snapshots( + recurse_snapshots(vm.get("snapshot").rootSnapshotList) + ) + + for custom_field in vm.get("customValue", []): + key_id = custom_field.key + key = self.find_custom_field_key(key_id) + extra["metadata"][key] = custom_field.value + + node = Node( + id=uuid, + name=name, + state=status, + size=size, + public_ips=public_ips, + private_ips=private_ips, + driver=self, + extra=extra, + ) + node._uuid = uuid + + return node + + def _to_node_recursive(self, virtual_machine): + summary = virtual_machine.summary + name = summary.config.name + path = summary.config.vmPathName + memory = summary.config.memorySizeMB + cpus = summary.config.numCpu + disk = "" + + if summary.storage.committed: + disk = summary.storage.committed / (1024**3) + id_to_hash = str(memory) + str(cpus) + str(disk) + size_id = hashlib.md5(id_to_hash.encode("utf-8")).hexdigest() # nosec + size_name = name + "-size" + size_extra = {"cpus": cpus} + driver = self + size = NodeSize( + id=size_id, + name=size_name, + ram=memory, + disk=disk, + bandwidth=0, + price=0, + driver=driver, + extra=size_extra, + ) + operating_system = summary.config.guestFullName + host = summary.runtime.host + + # mist.io needs this metadata + os_type = "unix" + + if "Microsoft" in str(operating_system): + os_type = "windows" + uuid = summary.config.instanceUuid + annotation = summary.config.annotation + state = summary.runtime.powerState + status = self.NODE_STATE_MAP.get(state, NodeState.UNKNOWN) + boot_time = summary.runtime.bootTime + ip_addresses = [] + + if summary.guest is not None: + ip_addresses.append(summary.guest.ipAddress) + + overall_status = str(summary.overallStatus) + public_ips = [] + private_ips = [] + + extra = { + "path": path, + "operating_system": operating_system, + "os_type": os_type, + "memory_MB": memory, + "cpus": cpus, + "overallStatus": overall_status, + "metadata": {}, + "snapshots": [], + } + + if disk: + extra["disk"] = disk + + if host: + extra["host"] = host.name + parent = host.parent + + while parent: + if isinstance(parent, vim.ClusterComputeResource): + extra["cluster"] = parent.name + + break + parent = parent.parent + + if boot_time: + extra["boot_time"] = boot_time.isoformat() + + if annotation: + extra["annotation"] = annotation + + for ip_address in ip_addresses: + try: + if is_public_subnet(ip_address): + public_ips.append(ip_address) + else: + private_ips.append(ip_address) + except Exception: + # IPV6 not supported + pass + + if virtual_machine.snapshot: + snapshots = [ + { + "id": s.id, + "name": s.name, + "description": s.description, + "created": s.createTime.strftime("%Y-%m-%d %H:%M"), + "state": s.state, + } + for s in virtual_machine.snapshot.rootSnapshotList + ] + extra["snapshots"] = snapshots + + for custom_field in virtual_machine.customValue: + key_id = custom_field.key + key = self.find_custom_field_key(key_id) + extra["metadata"][key] = custom_field.value + + node = Node( + id=uuid, + name=name, + state=status, + size=size, + public_ips=public_ips, + private_ips=private_ips, + driver=self, + extra=extra, + ) + node._uuid = uuid + + return node + + def reboot_node(self, node): + """ """ + vm = self.find_by_uuid(node.id) + + return self.wait_for_task(vm.RebootGuest()) + + def destroy_node(self, node): + """ """ + vm = self.find_by_uuid(node.id) + + if node.state != NodeState.STOPPED: + self.stop_node(node) + + return self.wait_for_task(vm.Destroy()) + + def stop_node(self, node): + """ """ + vm = self.find_by_uuid(node.id) + + return self.wait_for_task(vm.PowerOff()) + + def start_node(self, node): + """ """ + vm = self.find_by_uuid(node.id) + + return self.wait_for_task(vm.PowerOn()) + + def ex_list_snapshots(self, node): """ - vm = self._get_vm_for_node(node=node) - return vm.get_resource_pool_name() + List node snapshots + """ + vm = self.find_by_uuid(node.id) + + if not vm.snapshot: + return [] + + return format_snapshots(recurse_snapshots(vm.snapshot.rootSnapshotList)) - @wrap_non_libcloud_exceptions - def ex_get_hosts(self): + def ex_create_snapshot( + self, node, snapshot_name, description="", dump_memory=False, quiesce=False + ): """ - Retrurn all the available hosts. + Create node snapshot + """ + vm = self.find_by_uuid(node.id) + + return WaitForTask(vm.CreateSnapshot(snapshot_name, description, dump_memory, quiesce)) - :rtype: ``dict`` + def ex_remove_snapshot(self, node, snapshot_name=None, remove_children=True): """ - result = self.connection.client.get_hosts() - return result + Remove a snapshot from node. + If snapshot_name is not defined remove the last one. + """ + vm = self.find_by_uuid(node.id) + + if not vm.snapshot: + raise LibcloudError( + "Remove snapshot failed. No snapshots for node %s" % node.name, + driver=self, + ) + snapshots = recurse_snapshots(vm.snapshot.rootSnapshotList) - @wrap_non_libcloud_exceptions - def ex_get_datastores(self): + if not snapshot_name: + snapshot = snapshots[-1].snapshot + else: + for s in snapshots: + if snapshot_name == s.name: + snapshot = s.snapshot + + break + else: + raise LibcloudError("Snapshot `%s` not found" % snapshot_name, driver=self) + + return self.wait_for_task(snapshot.RemoveSnapshot_Task(removeChildren=remove_children)) + + def ex_revert_to_snapshot(self, node, snapshot_name=None): + """ + Revert node to a specific snapshot. + If snapshot_name is not defined revert to the last one. """ - Return all the available datastores. + vm = self.find_by_uuid(node.id) + + if not vm.snapshot: + raise LibcloudError( + "Revert failed. No snapshots " "for node %s" % node.name, driver=self + ) + snapshots = recurse_snapshots(vm.snapshot.rootSnapshotList) + + if not snapshot_name: + snapshot = snapshots[-1].snapshot + else: + for s in snapshots: + if snapshot_name == s.name: + snapshot = s.snapshot - :rtype: ``dict`` + break + else: + raise LibcloudError("Snapshot `%s` not found" % snapshot_name, driver=self) + + return self.wait_for_task(snapshot.RevertToSnapshot_Task()) + + def _find_template_by_uuid(self, template_uuid): + # on version 5.5 and earlier search index won't return a VM + try: + template = self.find_by_uuid(template_uuid) + except LibcloudError: + content = self.connection.RetrieveContent() + vms = content.viewManager.CreateContainerView( + content.rootFolder, [vim.VirtualMachine], recursive=True + ).view + + for vm in vms: + if vm.config.instanceUuid == template_uuid: + template = vm + except Exception as exc: + raise LibcloudError("Error while searching for template: %s" % exc, driver=self) + + if not template: + raise LibcloudError("Unable to locate VirtualMachine.", driver=self) + + return template + + def find_by_uuid(self, node_uuid): + """Searches VMs for a given uuid + returns pyVmomi.VmomiSupport.vim.VirtualMachine """ - result = self.connection.client.get_datastores() - return result + vm = self.connection.content.searchIndex.FindByUuid(None, node_uuid, True, True) + + if not vm: + # perhaps it is a moid + vm = self._get_item_by_moid("VirtualMachine", node_uuid) - @wrap_non_libcloud_exceptions - def ex_get_node_by_path(self, path): + if not vm: + raise LibcloudError("Unable to locate VirtualMachine.", driver=self) + + return vm + + def find_custom_field_key(self, key_id): + """Return custom field key name, provided it's id""" + + if not hasattr(self, "custom_fields"): + content = self.connection.RetrieveContent() + + if content.customFieldsManager: + self.custom_fields = content.customFieldsManager.field + else: + self.custom_fields = [] + + for k in self.custom_fields: + if k.key == key_id: + return k.name + + return None + + def get_obj(self, vimtype, name): """ - Retrieve Node object for a VM with a provided path. + Return an object by name, if name is None the + first found object is returned + """ + obj = None + content = self.connection.RetrieveContent() + container = content.viewManager.CreateContainerView(content.rootFolder, vimtype, True) + + for c in container.view: + if name: + if c.name == name: + obj = c - :type path: ``str`` - :rtype: :class:`libcloud.compute.base.Node` + break + else: + obj = c + + break + + return obj + + def wait_for_task(self, task, timeout=1800, interval=10): + """wait for a vCenter task to finish""" + start_time = time.time() + task_done = False + + while not task_done: + if time.time() - start_time >= timeout: + raise LibcloudError( + "Timeout while waiting " "for import task Id %s" % task.info.id, + driver=self, + ) + + if task.info.state == "success": + if task.info.result and str(task.info.result) != "success": + return task.info.result + + return True + + if task.info.state == "error": + raise LibcloudError(task.info.error.msg, driver=self) + time.sleep(interval) + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_cluster=None, + ex_network=None, + ex_datacenter=None, + ex_folder=None, + ex_resource_pool=None, + ex_datastore_cluster=None, + ex_datastore=None, + ): """ - vm = self.connection.client.get_vm_by_path(path) - node = self._to_node(vm=vm) - return node + Creates and returns node. + + :keyword ex_network: Name of a "Network" to connect the VM to ", + :type ex_network: ``str`` - def ex_get_node_by_uuid(self, uuid): """ - Retrieve Node object for a VM with a provided uuid. + template = self._find_template_by_uuid(image.id) + + if ex_cluster: + cluster_name = ex_cluster + else: + cluster_name = location.name + cluster = self.get_obj([vim.ClusterComputeResource], cluster_name) + + if not cluster: # It is a host go with it + cluster = self.get_obj([vim.HostSystem], cluster_name) + + datacenter = None + + if not ex_datacenter: # Get datacenter from cluster + parent = cluster.parent + + while parent: + if isinstance(parent, vim.Datacenter): + datacenter = parent + + break + parent = parent.parent + + if ex_datacenter or datacenter is None: + datacenter = self.get_obj([vim.Datacenter], ex_datacenter) + + if ex_folder: + folder = self.get_obj([vim.Folder], ex_folder) + + if folder is None: + folder = self._get_item_by_moid("Folder", ex_folder) + else: + folder = datacenter.vmFolder + + if ex_resource_pool: + resource_pool = self.get_obj([vim.ResourcePool], ex_resource_pool) + else: + try: + resource_pool = cluster.resourcePool + except AttributeError: + resource_pool = cluster.parent.resourcePool + devices = [] + vmconf = vim.vm.ConfigSpec( + numCPUs=int(size.extra.get("cpu", 1)), + memoryMB=int(size.ram), + deviceChange=devices, + ) + datastore = None + pod = None + podsel = vim.storageDrs.PodSelectionSpec() + + if ex_datastore_cluster: + pod = self.get_obj([vim.StoragePod], ex_datastore_cluster) + else: + content = self.connection.RetrieveContent() + pods = content.viewManager.CreateContainerView( + content.rootFolder, [vim.StoragePod], True + ).view + + for pod in pods: + if cluster.name.lower() in pod.name: + break + podsel.storagePod = pod + storagespec = vim.storageDrs.StoragePlacementSpec() + storagespec.podSelectionSpec = podsel + storagespec.type = "create" + storagespec.folder = folder + storagespec.resourcePool = resource_pool + storagespec.configSpec = vmconf + + try: + content = self.connection.RetrieveContent() + rec = content.storageResourceManager.RecommendDatastores(storageSpec=storagespec) + rec_action = rec.recommendations[0].action[0] + real_datastore_name = rec_action.destination.name + except Exception: + real_datastore_name = template.datastore[0].info.name + + datastore = self.get_obj([vim.Datastore], real_datastore_name) + + if ex_datastore: + datastore = self.get_obj([vim.Datastore], ex_datastore) + + if datastore is None: + datastore = self._get_item_by_moid("Datastore", ex_datastore) + elif not datastore: + datastore = self.get_obj([vim.Datastore], template.datastore[0].info.name) + add_network = True + + if ex_network and len(template.network) > 0: + for nets in template.network: + if template in nets.vm: + add_network = False + + if ex_network and add_network: + nicspec = vim.vm.device.VirtualDeviceSpec() + nicspec.operation = vim.vm.device.VirtualDeviceSpec.Operation.add + nicspec.device = vim.vm.device.VirtualVmxnet3() + nicspec.device.wakeOnLanEnabled = True + nicspec.device.deviceInfo = vim.Description() + + portgroup = self.get_obj([vim.dvs.DistributedVirtualPortgroup], ex_network) + + if portgroup: + dvs_port_connection = vim.dvs.PortConnection() + dvs_port_connection.portgroupKey = portgroup.key + dvs_port_connection.switchUuid = portgroup.config.distributedVirtualSwitch.uuid + nicspec.device.backing = ( + vim.vm.device.VirtualEthernetCard.DistributedVirtualPortBackingInfo() + ) + nicspec.device.backing.port = dvs_port_connection + else: + nicspec.device.backing = vim.vm.device.VirtualEthernetCard.NetworkBackingInfo() + nicspec.device.backing.network = self.get_obj([vim.Network], ex_network) + nicspec.device.backing.deviceName = ex_network + nicspec.device.connectable = vim.vm.device.VirtualDevice.ConnectInfo() + nicspec.device.connectable.startConnected = True + nicspec.device.connectable.connected = True + nicspec.device.connectable.allowGuestControl = True + devices.append(nicspec) + + # new_disk_kb = int(size.disk) * 1024 * 1024 + # disk_spec = vim.vm.device.VirtualDeviceSpec() + # disk_spec.fileOperation = "create" + # disk_spec.operation = vim.vm.device.VirtualDeviceSpec.Operation.add + # disk_spec.device = vim.vm.device.VirtualDisk() + # disk_spec.device.backing = \ + # vim.vm.device.VirtualDisk.FlatVer2BackingInfo() + # if size.extra.get('disk_type') == 'thin': + # disk_spec.device.backing.thinProvisioned = True + # disk_spec.device.backing.diskMode = 'persistent' + # disk_spec.device.capacityInKB = new_disk_kb + # disk_spec.device.controllerKey = controller.key + # devices.append(disk_spec) + + clonespec = vim.vm.CloneSpec(config=vmconf) + relospec = vim.vm.RelocateSpec() + relospec.datastore = datastore + relospec.pool = resource_pool + + if location: + host = self.get_obj([vim.HostSystem], location.name) + + if host: + relospec.host = host + clonespec.location = relospec + clonespec.powerOn = True + task = template.Clone(folder=folder, name=name, spec=clonespec) + + return self._to_node_recursive(self.wait_for_task(task)) + + def ex_connect_network(self, vm, network_name): + spec = vim.vm.ConfigSpec() - :type uuid: ``str`` + # add Switch here + dev_changes = [] + network_spec = vim.vm.device.VirtualDeviceSpec() + # network_spec.fileOperation = "create" + network_spec.operation = vim.vm.device.VirtualDeviceSpec.Operation.add + network_spec.device = vim.vm.device.VirtualVmxnet3() + + network_spec.device.backing = vim.vm.device.VirtualEthernetCard.NetworkBackingInfo() + + network_spec.device.backing.useAutoDetect = False + network_spec.device.backing.network = self.get_obj([vim.Network], network_name) + + network_spec.device.connectable = vim.vm.device.VirtualDevice.ConnectInfo() + network_spec.device.connectable.startConnected = True + network_spec.device.connectable.connected = True + network_spec.device.connectable.allowGuestControl = True + + dev_changes.append(network_spec) + + spec.deviceChange = dev_changes + output = vm.ReconfigVM_Task(spec=spec) + print(output.info) + + def _get_item_by_moid(self, type_, moid): + vm_obj = VmomiSupport.templateOf(type_)(moid, self.connection._stub) + + return vm_obj + + def ex_list_folders(self): + content = self.connection.RetrieveContent() + folders_raw = content.viewManager.CreateContainerView( + content.rootFolder, [vim.Folder], True + ).view + folders = [] + + for folder in folders_raw: + to_add = {"type": list(folder.childType)} + to_add["name"] = folder.name + to_add["id"] = folder._moId + folders.append(to_add) + + return folders + + def ex_list_datastores(self): + content = self.connection.RetrieveContent() + datastores_raw = content.viewManager.CreateContainerView( + content.rootFolder, [vim.Datastore], True + ).view + datastores = [] + + for dstore in datastores_raw: + to_add = {"type": dstore.summary.type} + to_add["name"] = dstore.name + to_add["id"] = dstore._moId + to_add["free_space"] = int(dstore.summary.freeSpace) + to_add["capacity"] = int(dstore.summary.capacity) + datastores.append(to_add) + + return datastores + + def ex_open_console(self, vm_uuid): + vm = self.find_by_uuid(vm_uuid) + ticket = vm.AcquireTicket(ticketType="webmks") + + return "wss://{}:{}/ticket/{}".format(ticket.host, ticket.port, ticket.ticket) + + def _get_version(self): + content = self.connection.RetrieveContent() + + return content.about.version + + +class VSphereNetwork: + """ + Represents information about a VPC (Virtual Private Cloud) network + + Note: This class is VSphere specific. + """ + + def __init__(self, id, name, extra=None): + self.id = id + self.name = name + self.extra = extra or {} + + def __repr__(self): + return (" 1: + extra["host"] = vm_id_host[1].get("name", "") + + return Node( + id=vm_id, + name=name, + state=state, + public_ips=public_ips, + private_ips=private_ips, + driver=driver, + size=size, + image=image, + extra=extra, + ) + + def ex_list_hosts( + self, + ex_filter_folders=None, + ex_filter_standalone=None, + ex_filter_hosts=None, + ex_filter_clusters=None, + ex_filter_names=None, + ex_filter_datacenters=None, + ex_filter_connection_states=None, + ): + kwargs = { + "filter.folders": ex_filter_folders, + "filter.names": ex_filter_names, + "filter.hosts": ex_filter_hosts, + "filter.clusters": ex_filter_clusters, + "filter.standalone": ex_filter_standalone, + "filter.datacenters": ex_filter_datacenters, + "filter.connection_states": ex_filter_connection_states, + } + + params = {} + + for param, value in kwargs.items(): + if value: + params[param] = value + req = "/rest/vcenter/host" + result = self._request(req, params=params).object["value"] + + return result + + def ex_list_clusters( + self, + ex_filter_folders=None, + ex_filter_names=None, + ex_filter_datacenters=None, + ex_filter_clusters=None, + ): + kwargs = { + "filter.folders": ex_filter_folders, + "filter.names": ex_filter_names, + "filter.datacenters": ex_filter_datacenters, + "filter.clusters": ex_filter_clusters, + } + params = {} + + for param, value in kwargs.items(): + if value: + params[param] = value + req = "/rest/vcenter/cluster" + result = self._request(req, params=params).object["value"] + + return result + + def ex_list_datacenters( + self, ex_filter_folders=None, ex_filter_names=None, ex_filter_datacenters=None + ): + req = "/rest/vcenter/datacenter" + kwargs = { + "filter.folders": ex_filter_folders, + "filter.names": ex_filter_names, + "filter.datacenters": ex_filter_datacenters, + } + params = {} + + for param, value in kwargs.items(): + if value: + params[param] = value + result = self._request(req, params=params) + to_return = [ + {"name": item["name"], "id": item["datacenter"]} for item in result.object["value"] + ] + + return to_return + + def ex_list_content_libraries(self): + req = "/rest/com/vmware/content/library" + try: + result = self._request(req).object + + return result["value"] + except BaseHTTPError: + return [] + + def ex_list_content_library_items(self, library_id): + req = "/rest/com/vmware/content/library/item" + params = {"library_id": library_id} + try: + result = self._request(req, params=params).object + + return result["value"] + except BaseHTTPError: + logger.error( + "Library was cannot be accessed, " + " most probably the VCenter service " + "is stopped" + ) + + return [] + + def ex_list_folders(self): + req = "/rest/vcenter/folder" + response = self._request(req).object + folders = response["value"] + + for folder in folders: + folder["id"] = folder["folder"] + + return folders + + def ex_list_datastores( + self, + ex_filter_folders=None, + ex_filter_names=None, + ex_filter_datacenters=None, + ex_filter_types=None, + ex_filter_datastores=None, + ): + req = "/rest/vcenter/datastore" + kwargs = { + "filter.folders": ex_filter_folders, + "filter.names": ex_filter_names, + "filter.datacenters": ex_filter_datacenters, + "filter.types": ex_filter_types, + "filter.datastores": ex_filter_datastores, + } + params = {} + + for param, value in kwargs.items(): + if value: + params[param] = value + result = self._request(req, params=params).object["value"] + + for datastore in result: + datastore["id"] = datastore["datastore"] + + return result - def _get_vm_for_uuid(self, uuid, datacenter=None): + def ex_update_memory(self, node, ram): """ - Retrieve VM for the provided UUID. + :param ram: The amount of ram in MB. + :type ram: `str` or `int` + """ + + if isinstance(node, str): + node_id = node + else: + node_id = node.id + request = "/rest/vcenter/vm/{}/hardware/memory".format(node_id) + ram = int(ram) - :type uuid: ``str`` + body = {"spec": {"size_MiB": ram}} + response = self._request(request, method="PATCH", data=json.dumps(body)) + + return response.status in self.VALID_RESPONSE_CODES + + def ex_update_cpu(self, node, cores): + """ + Assuming 1 Core per socket + :param cores: Integer or string indicating number of cores + :type cores: `int` or `str` """ - server = self.connection.client - dc_list = [] - if datacenter and VIMor.is_mor(datacenter): - dc_list.append(datacenter) + if isinstance(node, str): + node_id = node else: - dc = server.get_datacenters() - if datacenter: - dc_list = [k for k, v in dc.iteritems() if v == datacenter] - else: - dc_list = list(dc.iterkeys()) + node_id = node.id + request = "/rest/vcenter/vm/{}/hardware/cpu".format(node_id) + cores = int(cores) + body = {"spec": {"count": cores}} + response = self._request(request, method="PATCH", data=json.dumps(body)) - for mor_dc in dc_list: - request = VI.FindByUuidRequestMsg() - search_index = server._do_service_content.SearchIndex - mor_search_index = request.new__this(search_index) - mor_search_index.set_attribute_type(MORTypes.SearchIndex) - request.set_element__this(mor_search_index) + return response.status in self.VALID_RESPONSE_CODES - mor_datacenter = request.new_datacenter(mor_dc) - mor_datacenter.set_attribute_type(MORTypes.Datacenter) - request.set_element_datacenter(mor_datacenter) + def ex_update_capacity(self, node, capacity): + # Should be added when REST API supports it + pass - request.set_element_vmSearch(True) - request.set_element_uuid(uuid) + def ex_add_nic(self, node, network): + """ + Creates a network adapter that will connect to the specified network + for the given node. Returns a boolean indicating success or not. + """ - try: - vm = server._proxy.FindByUuid(request)._returnval - except VI.ZSI.FaultException: - pass - else: - if vm: - return VIVirtualMachine(server, vm) + if isinstance(node, str): + node_id = node + else: + node_id = node.id + spec = {} + spec["mac_type"] = "GENERATED" + spec["backing"] = {} + spec["backing"]["type"] = "STANDARD_PORTGROUP" + spec["backing"]["network"] = network + spec["start_connected"] = True - return None + data = json.dumps({"spec": spec}) + req = "/rest/vcenter/vm/{}/hardware/ethernet".format(node_id) + method = "POST" + resp = self._request(req, method=method, data=data) - def _to_nodes(self, vm_paths): - nodes = [] - for vm_path in vm_paths: - vm = self.connection.client.get_vm_by_path(vm_path) - node = self._to_node(vm=vm) - nodes.append(node) + return resp.status - return nodes + def _get_library_item(self, item_id): + req = "/rest/com/vmware/content/library/item/id:{}".format(item_id) + result = self._request(req).object - def _to_node(self, vm): - assert(isinstance(vm, VIVirtualMachine)) + return result["value"] - properties = vm.get_properties() - status = vm.get_status() + def _get_resource_pool(self, host_id=None, cluster_id=None, name=None): + pms = None - uuid = vm.properties.config.uuid - instance_uuid = vm.properties.config.instanceUuid + if host_id: + pms = {"filter.hosts": host_id} - id = uuid - name = properties['name'] - public_ips = [] - private_ips = [] + if cluster_id: + pms = {"filter.clusters": cluster_id} - state = self.NODE_STATE_MAP.get(status, NodeState.UNKNOWN) - ip_address = properties.get('ip_address', None) - net = properties.get('net', []) - resource_pool_id = str(vm.properties.resourcePool._obj) + if name: + pms = {"filter.names": name} + if not pms: + raise ValueError("Either host_id, cluster_id or name must be provided") + + rp_request = "/rest/vcenter/resource-pool" + resource_pool = self._request(rp_request, params=pms).object + + return resource_pool["value"][0]["resource_pool"] + + def _request(self, req, method="GET", params=None, data=None): try: - operating_system = vm.properties.summary.guest.guestFullName, + result = self.connection.request(req, method=method, params=params, data=data) + except BaseHTTPError as exc: + if exc.code == 401: + self.connection.session_token = None + self._get_session_token() + result = self.connection.request(req, method=method, params=params, data=data) + else: + raise except Exception: - operating_system = 'unknown' + raise - extra = { - 'uuid': uuid, - 'instance_uuid': instance_uuid, - 'path': properties['path'], - 'resource_pool_id': resource_pool_id, - 'hostname': properties.get('hostname', None), - 'guest_id': properties['guest_id'], - 'devices': properties.get('devices', {}), - 'disks': properties.get('disks', []), - 'net': net, - - 'overall_status': vm.properties.overallStatus, - 'operating_system': operating_system, - - 'cpus': vm.properties.config.hardware.numCPU, - 'memory_mb': vm.properties.config.hardware.memoryMB - } + return result - # Add primary IP - if ip_address: - if is_public_subnet(ip_address): - public_ips.append(ip_address) - else: - private_ips.append(ip_address) + def list_images( + self, + location=None, + ): + libraries = self.ex_list_content_libraries() + item_ids = [] + + if libraries: + for library in libraries: + item_ids.extend(self.ex_list_content_library_items(library)) + items = [] + + if item_ids: + for item_id in item_ids: + items.append(self._get_library_item(item_id)) + images = [] + names = set() + + if items: + driver = self.connection.driver + + for item in items: + names.add(item["name"]) + extra = {"type": item["type"]} + + if item["type"] == "vm-template": + capacity = item["size"] // (1024**3) + extra["disk_size"] = capacity + images.append( + NodeImage(id=item["id"], name=item["name"], driver=driver, extra=extra) + ) + + if self.driver_soap is None: + self._get_soap_driver() + templates_in_hosts = self.driver_soap.list_images() + + for template in templates_in_hosts: + if template.name not in names: + images += [template] + + return images + + def ex_list_networks(self): + request = "/rest/vcenter/network" + response = self._request(request).object["value"] + networks = [] + + for network in response: + networks.append( + VSphereNetwork( + id=network["network"], + name=network["name"], + extra={"type": network["type"]}, + ) + ) + + return networks + + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_datastore=None, + ex_disks=None, + ex_folder=None, + ex_network=None, + ex_turned_on=True, + ): + """ + Image can be either a vm template , a ovf template or just + the guest OS. - # Add other IP addresses - for nic in net: - ip_addresses = nic['ip_addresses'] - for ip_address in ip_addresses: - try: - is_public = is_public_subnet(ip_address) - except Exception: - # TODO: Better support for IPv6 - is_public = False + ex_folder is necessary if the image is a vm-template, this method + will attempt to put the VM in a random folder and a warning about it + will be issued in case the value remains `None`. + """ + create_request = None + data = {} + + # image is in the host then need the 6.5 driver + + if image.extra["type"] == "template_6_5": + kwargs = {} + kwargs["name"] = name + kwargs["image"] = image + kwargs["size"] = size + kwargs["ex_network"] = ex_network + kwargs["location"] = location + + for dstore in self.ex_list_datastores(): + if dstore["id"] == ex_datastore: + kwargs["ex_datastore"] = dstore["name"] + + break + kwargs["folder"] = ex_folder + + if self.driver_soap is None: + self._get_soap_driver() + result = self.driver_soap.create_node(**kwargs) + + return result + + # post creation checks + create_nic = False + update_memory = False + update_cpu = False + create_disk = False + update_capacity = False + + if image.extra["type"] == "guest_OS": + spec = {} + spec["guest_OS"] = image.name + spec["name"] = name + spec["placement"] = {} + + if ex_folder is None: + warn = ( + "The API(6.7) requires the folder to be given, I will" + " place it into a random folder, after creation you " + "might find it convenient to move it into a better " + "folder." + ) + warnings.warn(warn) + folders = self.ex_list_folders() + + for folder in folders: + if folder["type"] == "VIRTUAL_MACHINE": + ex_folder = folder["folder"] + + if ex_folder is None: + msg = "No suitable folder for VMs found, please create one" + raise ProviderError(msg, 404) + spec["placement"]["folder"] = ex_folder + + if location.extra["type"] == "host": + spec["placement"]["host"] = location.id + elif location.extra["type"] == "cluster": + spec["placement"]["cluster"] = location.id + elif location.extra["type"] == "resource_pool": + spec["placement"]["resource_pool"] = location.id + spec["placement"]["datastore"] = ex_datastore + cpu = size.extra.get("cpu", 1) + spec["cpu"] = {"count": cpu} + spec["memory"] = {"size_MiB": size.ram} + + if size.disk: + disk = {} + disk["new_vmdk"] = {} + disk["new_vmdk"]["capacity"] = size.disk * (1024**3) + spec["disks"] = [disk] + + if ex_network: + nic = {} + nic["mac_type"] = "GENERATED" + nic["backing"] = {} + nic["backing"]["type"] = "STANDARD_PORTGROUP" + nic["backing"]["network"] = ex_network + nic["start_connected"] = True + spec["nics"] = [nic] + create_request = "/rest/vcenter/vm" + data = json.dumps({"spec": spec}) + + elif image.extra["type"] == "ovf": + ovf_request = ( + "/rest/com/vmware/vcenter/ovf/library-item" "/id:{}?~action=filter".format(image.id) + ) + spec = {} + spec["target"] = {} + + if location.extra.get("type") == "resource-pool": + spec["target"]["resource_pool_id"] = location.id + elif location.extra.get("type") == "host": + resource_pool = self._get_resource_pool(host_id=location.id) + + if not resource_pool: + msg = ( + "Could not find resource-pool for given location " + "(host). Please make sure the location is valid." + ) + raise VSphereException(code="504", message=msg) + spec["target"]["resource_pool_id"] = resource_pool + spec["target"]["host_id"] = location.id + elif location.extra.get("type") == "cluster": + resource_pool = self._get_resource_pool(cluster_id=location.id) + + if not resource_pool: + msg = ( + "Could not find resource-pool for given location " + "(cluster). Please make sure the location " + "is valid." + ) + raise VSphereException(code="504", message=msg) + spec["target"]["resource_pool_id"] = resource_pool + ovf = self._request(ovf_request, method="POST", data=json.dumps(spec)).object["value"] + spec["deployment_spec"] = {} + spec["deployment_spec"]["name"] = name + # assuming that since you want to make a vm you don't need reminder + spec["deployment_spec"]["accept_all_EULA"] = True + # network + + if ex_network and ovf["networks"]: + spec["deployment_spec"]["network_mappings"] = [ + {"key": ovf["networks"][0], "value": ex_network} + ] + elif not ovf["networks"] and ex_network: + create_nic = True + # storage + + if ex_datastore: + spec["deployment_spec"]["storage_mappings"] = [] + store_map = {"type": "DATASTORE", "datastore_id": ex_datastore} + spec["deployment_spec"]["storage_mappings"].append(store_map) + + if size and size.ram: + update_memory = True + + if size and size.extra and size.extra.get("cpu"): + update_cpu = True + + if size and size.disk: + # TODO Should update capacity but it is not possible with 6.7 + pass - if is_public: - public_ips.append(ip_address) + if ex_disks: + create_disk = True + + create_request = ( + "/rest/com/vmware/vcenter/ovf/library-item" "/id:{}?~action=deploy".format(image.id) + ) + data = json.dumps( + {"target": spec["target"], "deployment_spec": spec["deployment_spec"]} + ) + + elif image.extra["type"] == "vm-template": + tp_request = "/rest/vcenter/vm-template/library-items/" + image.id + template = self._request(tp_request).object["value"] + spec = {} + spec["name"] = name + + # storage + + if ex_datastore: + spec["disk_storage"] = {} + spec["disk_storage"]["datastore"] = ex_datastore + + # location :: folder,resource group, datacenter, host + spec["placement"] = {} + + if not ex_folder: + warn = ( + "The API(6.7) requires the folder to be given, I will" + " place it into a random folder, after creation you " + "might find it convenient to move it into a better " + "folder." + ) + warnings.warn(warn) + folders = self.ex_list_folders() + + for folder in folders: + if folder["type"] == "VIRTUAL_MACHINE": + ex_folder = folder["folder"] + + if ex_folder is None: + msg = "No suitable folder for VMs found, please create one" + raise ProviderError(msg, 404) + spec["placement"]["folder"] = ex_folder + + if location.extra["type"] == "host": + spec["placement"]["host"] = location.id + elif location.extra["type"] == "cluster": + spec["placement"]["cluster"] = location.id + # network changes the network to existing nics if + # there are no adapters + # in the template then we will make on in the vm + # after the creation finishes + # only one network atm?? + spec["hardware_customization"] = {} + + if ex_network: + nics = template["nics"] + + if len(nics) > 0: + nic = nics[0] + spec["hardware_customization"]["nics"] = [ + {"key": nic["key"], "value": {"network": ex_network}} + ] else: - private_ips.append(ip_address) + create_nic = True + spec["powered_on"] = False + # hardware + + if size: + if size.ram: + spec["hardware_customization"]["memory_update"] = {"memory": int(size.ram)} + + if size.extra.get("cpu"): + spec["hardware_customization"]["cpu_update"] = {"num_cpus": size.extra["cpu"]} + + if size.disk: + if not len(template["disks"]) > 0: + create_disk = True + else: + capacity = size.disk * 1024 * 1024 * 1024 + dsk = template["disks"][0]["key"] + + if template["disks"][0]["value"]["capacity"] < capacity: + update = {"capacity": capacity} + spec["hardware_customization"]["disks_to_update"] = [ + {"key": dsk, "value": update} + ] + + create_request = "/rest/vcenter/vm-template/library-items/" "{}/?action=deploy".format( + image.id + ) + data = json.dumps({"spec": spec}) + + if not create_request: + raise ValueError("Missing create_request") + + # deploy the node + result = self._request(create_request, method="POST", data=data) + # wait until the node is up and then add extra config + node_id = result.object["value"] + + if image.extra["type"] == "ovf": + node_id = node_id["resource_id"]["id"] + + node = self.list_nodes(ex_filter_vms=node_id)[0] + + if create_nic: + self.ex_add_nic(node, ex_network) + + if update_memory: + self.ex_update_memory(node, size.ram) + + if update_cpu: + self.ex_update_cpu(node, size.extra["cpu"]) - # Remove duplicate IPs - public_ips = list(set(public_ips)) - private_ips = list(set(private_ips)) + if create_disk: + pass # until volumes are added + + if update_capacity: + pass # until API method is added + + if ex_turned_on: + self.start_node(node) - node = Node(id=id, name=name, state=state, public_ips=public_ips, - private_ips=private_ips, driver=self, extra=extra) return node - def _get_vm_for_node(self, node): - uuid = node.id - vm = self._get_vm_for_uuid(uuid=uuid) - return vm + # TODO As soon as snapshot support gets added to the REST api + # these methods should be rewritten with REST api calls + def ex_list_snapshots(self, node): + """ + List node snapshots + """ - def _ex_connection_class_kwargs(self): - kwargs = { - 'url': self.url - } + if self.driver_soap is None: + self._get_soap_driver() + + return self.driver_soap.ex_list_snapshots(node) + + def ex_create_snapshot( + self, node, snapshot_name, description="", dump_memory=False, quiesce=False + ): + """ + Create node snapshot + """ + + if self.driver_soap is None: + self._get_soap_driver() + + return self.driver_soap.ex_create_snapshot( + node, + snapshot_name, + description=description, + dump_memory=dump_memory, + quiesce=False, + ) + + def ex_remove_snapshot(self, node, snapshot_name=None, remove_children=True): + """ + Remove a snapshot from node. + If snapshot_name is not defined remove the last one. + """ + + if self.driver_soap is None: + self._get_soap_driver() + + return self.driver_soap.ex_remove_snapshot( + node, snapshot_name=snapshot_name, remove_children=remove_children + ) + + def ex_revert_to_snapshot(self, node, snapshot_name=None): + """ + Revert node to a specific snapshot. + If snapshot_name is not defined revert to the last one. + """ + + if self.driver_soap is None: + self._get_soap_driver() - return kwargs + return self.driver_soap.ex_revert_to_snapshot(node, snapshot_name=snapshot_name) + def ex_open_console(self, vm_id): + if self.driver_soap is None: + self._get_soap_driver() -class VSphere_5_5_NodeDriver(VSphereNodeDriver): - name = 'VMware vSphere v5.5' + return self.driver_soap.ex_open_console(vm_id) diff --git a/libcloud/compute/drivers/vultr.py b/libcloud/compute/drivers/vultr.py index ab47aa056c..e429391cb8 100644 --- a/libcloud/compute/drivers/vultr.py +++ b/libcloud/compute/drivers/vultr.py @@ -16,16 +16,627 @@ Vultr Driver """ +import json import time +import base64 +from typing import Any, Dict, List, Union, Optional +from functools import update_wrapper -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlencode +from libcloud.utils.py3 import httplib, urlencode +from libcloud.common.base import JsonResponse, ConnectionKey +from libcloud.common.types import LibcloudError, InvalidCredsError, ServiceUnavailableError +from libcloud.common.vultr import ( + DEFAULT_API_VERSION, + VultrNetwork, + VultrConnectionV2, + VultrNodeSnapshot, +) +from libcloud.compute.base import ( + Node, + KeyPair, + NodeSize, + NodeImage, + NodeDriver, + NodeLocation, + StorageVolume, +) +from libcloud.compute.types import Provider, NodeState, StorageVolumeState, VolumeSnapshotState +from libcloud.utils.iso8601 import parse_date +from libcloud.utils.publickey import get_pubkey_openssh_fingerprint -from libcloud.common.base import ConnectionKey, JsonResponse -from libcloud.compute.types import Provider, NodeState -from libcloud.common.types import LibcloudError, InvalidCredsError -from libcloud.compute.base import NodeDriver -from libcloud.compute.base import Node, NodeImage, NodeSize, NodeLocation +# For matching region by id +VULTR_COMPUTE_INSTANCE_LOCATIONS = { + "1": { + "DCID": "1", + "name": "New Jersey", + "country": "US", + "continent": "North America", + "state": "NJ", + "regioncode": "EWR", + }, + "2": { + "DCID": "2", + "name": "Chicago", + "country": "US", + "continent": "North America", + "state": "IL", + "regioncode": "ORD", + }, + "3": { + "DCID": "3", + "name": "Dallas", + "country": "US", + "continent": "North America", + "state": "TX", + "regioncode": "DFW", + }, + "4": { + "DCID": "4", + "name": "Seattle", + "country": "US", + "continent": "North America", + "state": "WA", + "regioncode": "SEA", + }, + "5": { + "DCID": "5", + "name": "Los Angeles", + "country": "US", + "continent": "North America", + "state": "CA", + "regioncode": "LAX", + }, + "6": { + "DCID": "6", + "name": "Atlanta", + "country": "US", + "continent": "North America", + "state": "GA", + "regioncode": "ATL", + }, + "7": { + "DCID": "7", + "name": "Amsterdam", + "country": "NL", + "continent": "Europe", + "state": "", + "regioncode": "AMS", + }, + "8": { + "DCID": "8", + "name": "London", + "country": "GB", + "continent": "Europe", + "state": "", + "regioncode": "LHR", + }, + "9": { + "DCID": "9", + "name": "Frankfurt", + "country": "DE", + "continent": "Europe", + "state": "", + "regioncode": "FRA", + }, + "12": { + "DCID": "12", + "name": "Silicon Valley", + "country": "US", + "continent": "North America", + "state": "CA", + "regioncode": "SJC", + }, + "19": { + "DCID": "19", + "name": "Sydney", + "country": "AU", + "continent": "Australia", + "state": "", + "regioncode": "SYD", + }, + "22": { + "DCID": "22", + "name": "Toronto", + "country": "CA", + "continent": "North America", + "state": "", + "regioncode": "YTO", + }, + "24": { + "DCID": "24", + "name": "Paris", + "country": "FR", + "continent": "Europe", + "state": "", + "regioncode": "CDG", + }, + "25": { + "DCID": "25", + "name": "Tokyo", + "country": "JP", + "continent": "Asia", + "state": "", + "regioncode": "NRT", + }, + "34": { + "DCID": "34", + "name": "Seoul", + "country": "KR", + "continent": "Asia", + "state": "", + "regioncode": "ICN", + }, + "39": { + "DCID": "39", + "name": "Miami", + "country": "US", + "continent": "North America", + "state": "FL", + "regioncode": "MIA", + }, + "40": { + "DCID": "40", + "name": "Singapore", + "country": "SG", + "continent": "Asia", + "state": "", + "regioncode": "SGP", + }, +} +# For matching image by id +VULTR_COMPUTE_INSTANCE_IMAGES = { + "127": { + "OSID": 127, + "name": "CentOS 6 x64", + "arch": "x64", + "family": "centos", + "windows": False, + }, + "147": { + "OSID": 147, + "name": "CentOS 6 i386", + "arch": "i386", + "family": "centos", + "windows": False, + }, + "167": { + "OSID": 167, + "name": "CentOS 7 x64", + "arch": "x64", + "family": "centos", + "windows": False, + }, + "381": { + "OSID": 381, + "name": "CentOS 7 SELinux x64", + "arch": "x64", + "family": "centos", + "windows": False, + }, + "362": { + "OSID": 362, + "name": "CentOS 8 x64", + "arch": "x64", + "family": "centos", + "windows": False, + }, + "401": { + "OSID": 401, + "name": "CentOS 8 Stream x64", + "arch": "x64", + "family": "centos", + "windows": False, + }, + "215": { + "OSID": 215, + "name": "Ubuntu 16.04 x64", + "arch": "x64", + "family": "ubuntu", + "windows": False, + }, + "216": { + "OSID": 216, + "name": "Ubuntu 16.04 i386", + "arch": "i386", + "family": "ubuntu", + "windows": False, + }, + "270": { + "OSID": 270, + "name": "Ubuntu 18.04 x64", + "arch": "x64", + "family": "ubuntu", + "windows": False, + }, + "387": { + "OSID": 387, + "name": "Ubuntu 20.04 x64", + "arch": "x64", + "family": "ubuntu", + "windows": False, + }, + "194": { + "OSID": 194, + "name": "Debian 8 i386 (jessie)", + "arch": "i386", + "family": "debian", + "windows": False, + }, + "244": { + "OSID": 244, + "name": "Debian 9 x64 (stretch)", + "arch": "x64", + "family": "debian", + "windows": False, + }, + "352": { + "OSID": 352, + "name": "Debian 10 x64 (buster)", + "arch": "x64", + "family": "debian", + "windows": False, + }, + "230": { + "OSID": 230, + "name": "FreeBSD 11 x64", + "arch": "x64", + "family": "freebsd", + "windows": False, + }, + "327": { + "OSID": 327, + "name": "FreeBSD 12 x64", + "arch": "x64", + "family": "freebsd", + "windows": False, + }, + "366": { + "OSID": 366, + "name": "OpenBSD 6.6 x64", + "arch": "x64", + "family": "openbsd", + "windows": False, + }, + "394": { + "OSID": 394, + "name": "OpenBSD 6.7 x64", + "arch": "x64", + "family": "openbsd", + "windows": False, + }, + "391": { + "OSID": 391, + "name": "Fedora CoreOS", + "arch": "x64", + "family": "fedora-coreos", + "windows": False, + }, + "367": { + "OSID": 367, + "name": "Fedora 31 x64", + "arch": "x64", + "family": "fedora", + "windows": False, + }, + "389": { + "OSID": 389, + "name": "Fedora 32 x64", + "arch": "x64", + "family": "fedora", + "windows": False, + }, + "124": { + "OSID": 124, + "name": "Windows 2012 R2 x64", + "arch": "x64", + "family": "windows", + "windows": False, + }, + "240": { + "OSID": 240, + "name": "Windows 2016 x64", + "arch": "x64", + "family": "windows", + "windows": False, + }, + "159": { + "OSID": 159, + "name": "Custom", + "arch": "x64", + "family": "iso", + "windows": False, + }, + "164": { + "OSID": 164, + "name": "Snapshot", + "arch": "x64", + "family": "snapshot", + "windows": False, + }, + "180": { + "OSID": 180, + "name": "Backup", + "arch": "x64", + "family": "backup", + "windows": False, + }, + "186": { + "OSID": 186, + "name": "Application", + "arch": "x64", + "family": "application", + "windows": False, + }, +} +VULTR_COMPUTE_INSTANCE_SIZES = { + "201": { + "VPSPLANID": "201", + "name": "1024 MB RAM,25 GB SSD,1.00 TB BW", + "vcpu_count": "1", + "ram": "1024", + "disk": "25", + "bandwidth": "1.00", + "bandwidth_gb": "1024", + "price_per_month": "5.00", + "plan_type": "SSD", + "windows": False, + }, + "202": { + "VPSPLANID": "202", + "name": "2048 MB RAM,55 GB SSD,2.00 TB BW", + "vcpu_count": "1", + "ram": "2048", + "disk": "55", + "bandwidth": "2.00", + "bandwidth_gb": "2048", + "price_per_month": "10.00", + "plan_type": "SSD", + "windows": False, + }, + "203": { + "VPSPLANID": "203", + "name": "4096 MB RAM,80 GB SSD,3.00 TB BW", + "vcpu_count": "2", + "ram": "4096", + "disk": "80", + "bandwidth": "3.00", + "bandwidth_gb": "3072", + "price_per_month": "20.00", + "plan_type": "SSD", + "windows": False, + }, + "204": { + "VPSPLANID": "204", + "name": "8192 MB RAM,160 GB SSD,4.00 TB BW", + "vcpu_count": "4", + "ram": "8192", + "disk": "160", + "bandwidth": "4.00", + "bandwidth_gb": "4096", + "price_per_month": "40.00", + "plan_type": "SSD", + "windows": False, + }, + "205": { + "VPSPLANID": "205", + "name": "16384 MB RAM,320 GB SSD,5.00 TB BW", + "vcpu_count": "6", + "ram": "16384", + "disk": "320", + "bandwidth": "5.00", + "bandwidth_gb": "5120", + "price_per_month": "80.00", + "plan_type": "SSD", + "windows": False, + }, + "206": { + "VPSPLANID": "206", + "name": "32768 MB RAM,640 GB SSD,6.00 TB BW", + "vcpu_count": "8", + "ram": "32768", + "disk": "640", + "bandwidth": "6.00", + "bandwidth_gb": "6144", + "price_per_month": "160.00", + "plan_type": "SSD", + "windows": False, + }, + "207": { + "VPSPLANID": "207", + "name": "65536 MB RAM,1280 GB SSD,10.00 TB BW", + "vcpu_count": "16", + "ram": "65536", + "disk": "1280", + "bandwidth": "10.00", + "bandwidth_gb": "10240", + "price_per_month": "320.00", + "plan_type": "SSD", + "windows": False, + }, + "208": { + "VPSPLANID": "208", + "name": "98304 MB RAM,1600 GB SSD,15.00 TB BW", + "vcpu_count": "24", + "ram": "98304", + "disk": "1600", + "bandwidth": "15.00", + "bandwidth_gb": "15360", + "price_per_month": "640.00", + "plan_type": "SSD", + "windows": False, + }, + "115": { + "VPSPLANID": "115", + "name": "8192 MB RAM,110 GB SSD,10.00 TB BW", + "vcpu_count": "2", + "ram": "8192", + "disk": "110", + "bandwidth": "10.00", + "bandwidth_gb": "10240", + "price_per_month": "60.00", + "plan_type": "DEDICATED", + "windows": False, + }, + "116": { + "VPSPLANID": "116", + "name": "16384 MB RAM,2x110 GB SSD,20.00 TB BW", + "vcpu_count": "4", + "ram": "16384", + "disk": "110", + "bandwidth": "20.00", + "bandwidth_gb": "20480", + "price_per_month": "120.00", + "plan_type": "DEDICATED", + "windows": False, + }, + "117": { + "VPSPLANID": "117", + "name": "24576 MB RAM,3x110 GB SSD,30.00 TB BW", + "vcpu_count": "6", + "ram": "24576", + "disk": "110", + "bandwidth": "30.00", + "bandwidth_gb": "30720", + "price_per_month": "180.00", + "plan_type": "DEDICATED", + "windows": False, + }, + "118": { + "VPSPLANID": "118", + "name": "32768 MB RAM,4x110 GB SSD,40.00 TB BW", + "vcpu_count": "8", + "ram": "32768", + "disk": "110", + "bandwidth": "40.00", + "bandwidth_gb": "40960", + "price_per_month": "240.00", + "plan_type": "DEDICATED", + "windows": False, + }, + "400": { + "VPSPLANID": "400", + "name": "1024 MB RAM,32 GB SSD,1.00 TB BW", + "vcpu_count": "1", + "ram": "1024", + "disk": "32", + "bandwidth": "1.00", + "bandwidth_gb": "1024", + "price_per_month": "6.00", + "plan_type": "HIGHFREQUENCY", + "windows": False, + }, + "401": { + "VPSPLANID": "401", + "name": "2048 MB RAM,64 GB SSD,2.00 TB BW", + "vcpu_count": "1", + "ram": "2048", + "disk": "64", + "bandwidth": "2.00", + "bandwidth_gb": "2048", + "price_per_month": "12.00", + "plan_type": "HIGHFREQUENCY", + "windows": False, + }, + "402": { + "VPSPLANID": "402", + "name": "4096 MB RAM,128 GB SSD,3.00 TB BW", + "vcpu_count": "2", + "ram": "4096", + "disk": "128", + "bandwidth": "3.00", + "bandwidth_gb": "3072", + "price_per_month": "24.00", + "plan_type": "HIGHFREQUENCY", + "windows": False, + }, + "403": { + "VPSPLANID": "403", + "name": "8192 MB RAM,256 GB SSD,4.00 TB BW", + "vcpu_count": "3", + "ram": "8192", + "disk": "256", + "bandwidth": "4.00", + "bandwidth_gb": "4096", + "price_per_month": "48.00", + "plan_type": "HIGHFREQUENCY", + "windows": False, + }, + "404": { + "VPSPLANID": "404", + "name": "16384 MB RAM,384 GB SSD,5.00 TB BW", + "vcpu_count": "4", + "ram": "16384", + "disk": "384", + "bandwidth": "5.00", + "bandwidth_gb": "5120", + "price_per_month": "96.00", + "plan_type": "HIGHFREQUENCY", + "windows": False, + }, + "405": { + "VPSPLANID": "405", + "name": "32768 MB RAM,512 GB SSD,6.00 TB BW", + "vcpu_count": "8", + "ram": "32768", + "disk": "512", + "bandwidth": "6.00", + "bandwidth_gb": "6144", + "price_per_month": "192.00", + "plan_type": "HIGHFREQUENCY", + "windows": False, + }, + "406": { + "VPSPLANID": "406", + "name": "49152 MB RAM,768 GB SSD,8.00 TB BW", + "vcpu_count": "12", + "ram": "49152", + "disk": "768", + "bandwidth": "8.00", + "bandwidth_gb": "8192", + "price_per_month": "256.00", + "plan_type": "HIGHFREQUENCY", + "windows": False, + }, +} + + +class rate_limited: + """ + Decorator for retrying Vultr calls that are rate-limited. + + :param int sleep: Seconds to sleep after being rate-limited. + :param int retries: Number of retries. + """ + + def __init__(self, sleep=0.5, retries=1): + self.sleep = sleep + self.retries = retries + + def __call__(self, call): + """ + Run ``call`` method until it's not rate-limited. + + The method is invoked while it returns 503 Service Unavailable or the + allowed number of retries is reached. + + :param callable call: Method to be decorated. + """ + + def wrapper(*args, **kwargs): + last_exception = None + + for _ in range(self.retries + 1): + try: + return call(*args, **kwargs) + except ServiceUnavailableError as e: + last_exception = e + time.sleep(self.sleep) # hit by rate limit, let's sleep + + if last_exception: + raise last_exception # pylint: disable=raising-bad-type + + update_wrapper(wrapper, call) + return wrapper class VultrResponse(JsonResponse): @@ -35,99 +646,327 @@ def parse_error(self): return body elif self.status == httplib.FORBIDDEN: raise InvalidCredsError(self.body) + elif self.status == httplib.SERVICE_UNAVAILABLE: + raise ServiceUnavailableError(self.body) else: raise LibcloudError(self.body) +class SSHKey: + def __init__(self, id, name, pub_key): + self.id = id + self.name = name + self.pub_key = pub_key + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.pub_key, + ) + + class VultrConnection(ConnectionKey): """ Connection class for the Vultr driver. """ - host = 'api.vultr.com' + host = "api.vultr.com" responseCls = VultrResponse + unauthenticated_endpoints = { # {action: methods} + "/v1/app/list": ["GET"], + "/v1/os/list": ["GET"], + "/v1/plans/list": ["GET"], + "/v1/plans/list_vc2": ["GET"], + "/v1/plans/list_vdc2": ["GET"], + "/v1/regions/availability": ["GET"], + "/v1/regions/list": ["GET"], + } - def add_default_params(self, params): + def add_default_headers(self, headers): """ - Add parameters that are necessary for every request + Adds ``API-Key`` default header. - This method add ``api_key`` to - the request. + :return: Updated headers. + :rtype: dict """ - params['api_key'] = self.key - return params + + if self.require_api_key(): + headers.update({"API-Key": self.key}) + return headers def encode_data(self, data): return urlencode(data) + @rate_limited() def get(self, url): return self.request(url) + @rate_limited() def post(self, url, data): - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - return self.request(url, data=data, headers=headers, method='POST') + headers = {"Content-Type": "application/x-www-form-urlencoded"} + return self.request(url, data=data, headers=headers, method="POST") + + def require_api_key(self): + """ + Check whether this call (method + action) must be authenticated. + + :return: True if ``API-Key`` header required, False otherwise. + :rtype: bool + """ + + try: + return self.method not in self.unauthenticated_endpoints[self.action] + except KeyError: + return True + + +class VultrNodeDriverHelper: + """ + VultrNode helper class. + """ + + def handle_extra(self, extra_keys, data): + extra = {} + for key in extra_keys: + if key in data: + extra[key] = data[key] + return extra class VultrNodeDriver(NodeDriver): + type = Provider.VULTR + name = "Vultr" + website = "https://www.vultr.com" + + def __new__( + cls, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=DEFAULT_API_VERSION, + region=None, + **kwargs, + ): + if cls is VultrNodeDriver: + if api_version == "1": + cls = VultrNodeDriverV1 + elif api_version == "2": + cls = VultrNodeDriverV2 + else: + raise NotImplementedError( + "No Vultr driver found for API version: %s" % (api_version) + ) + return super().__new__(cls) + + +class VultrNodeDriverV1(VultrNodeDriver): """ VultrNode node driver. """ connectionCls = VultrConnection - type = Provider.VULTR - name = 'Vultr' - website = 'https://www.vultr.com' + NODE_STATE_MAP = {"pending": NodeState.PENDING, "active": NodeState.RUNNING} - NODE_STATE_MAP = {'pending': NodeState.PENDING, - 'active': NodeState.RUNNING} + EX_CREATE_YES_NO_ATTRIBUTES = [ + "enable_ipv6", + "enable_private_network", + "auto_backups", + "notify_activate", + "ddos_protection", + ] + + EX_CREATE_ID_ATTRIBUTES = { + "iso_id": "ISOID", + "script_id": "SCRIPTID", + "snapshot_id": "SNAPSHOTID", + "app_id": "APPID", + } + + EX_CREATE_ATTRIBUTES = [ + "ipxe_chain_url", + "label", + "userdata", + "reserved_ip_v4", + "hostname", + "tag", + ] + EX_CREATE_ATTRIBUTES.extend(EX_CREATE_YES_NO_ATTRIBUTES) + EX_CREATE_ATTRIBUTES.extend(EX_CREATE_ID_ATTRIBUTES.keys()) + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self._helper = VultrNodeDriverHelper() def list_nodes(self): - return self._list_resources('/v1/server/list', self._to_node) + return self._list_resources("/v1/server/list", self._to_node) + + def list_key_pairs(self): + """ + List all the available SSH keys. + :return: Available SSH keys. + :rtype: ``list`` of :class:`SSHKey` + """ + return self._list_resources("/v1/sshkey/list", self._to_ssh_key) + + def create_key_pair(self, name, public_key=""): + """ + Create a new SSH key. + :param name: Name of the new SSH key + :type name: ``str`` + + :key public_key: Public part of the new SSH key + :type name: ``str`` + + :return: True on success + :rtype: ``bool`` + """ + params = {"name": name, "ssh_key": public_key} + res = self.connection.post("/v1/sshkey/create", params) + return res.status == httplib.OK + + def delete_key_pair(self, key_pair): + """ + Delete an SSH key. + :param key_pair: The SSH key to delete + :type key_pair: :class:`SSHKey` + + :return: True on success + :rtype: ``bool`` + """ + params = {"SSHKEYID": key_pair.id} + res = self.connection.post("/v1/sshkey/destroy", params) + return res.status == httplib.OK def list_locations(self): - return self._list_resources('/v1/regions/list', self._to_location) + return self._list_resources("/v1/regions/list", self._to_location) + + def list_sizes( + self, + location=None, + ): + return self._list_resources("/v1/plans/list", self._to_size) + + def list_images( + self, + location=None, + ): + return self._list_resources("/v1/os/list", self._to_image) + + # pylint: disable=too-many-locals + def create_node( + self, + name, + size, + image, + location=None, + auth=None, + ex_ssh_key_ids=None, + ex_create_attr=None, + ): + """ + Create a node + + :param name: Name for the new node + :type name: ``str`` + + :param size: Size of the new node + :type size: :class:`NodeSize` + + :param image: Image for the new node + :type image: :class:`NodeImage` + + :param location: Location of the new node + :type location: :class:`NodeLocation` + + :param ex_ssh_key_ids: IDs of the SSH keys to initialize + :type ex_sshkeyid: ``list`` of ``str`` + + :param ex_create_attr: Extra attributes for node creation + :type ex_create_attr: ``dict`` - def list_sizes(self): - return self._list_resources('/v1/plans/list', self._to_size) + The `ex_create_attr` parameter can include the following dictionary + key and value pairs: - def list_images(self): - return self._list_resources('/v1/os/list', self._to_image) + * `ipxe_chain_url`: ``str`` for specifying URL to boot via IPXE + * `iso_id`: ``str`` the ID of a specific ISO to mount, + only meaningful with the `Custom` `NodeImage` + * `script_id`: ``int`` ID of a startup script to execute on boot, + only meaningful when the `NodeImage` is not `Custom` + * 'snapshot_id`: ``str`` Snapshot ID to restore for the initial + installation, only meaningful with the `Snapshot` `NodeImage` + * `enable_ipv6`: ``bool`` Whether an IPv6 subnet should be assigned + * `enable_private_network`: ``bool`` Whether private networking + support should be added + * `label`: ``str`` Text label to be shown in the control panel + * `auto_backups`: ``bool`` Whether automatic backups should be enabled + * `app_id`: ``int`` App ID to launch if launching an application, + only meaningful when the `NodeImage` is `Application` + * `userdata`: ``str`` Base64 encoded cloud-init user-data + * `notify_activate`: ``bool`` Whether an activation email should be + sent when the server is ready + * `ddos_protection`: ``bool`` Whether DDOS protection should be enabled + * `reserved_ip_v4`: ``str`` IP address of the floating IP to use as + the main IP of this server + * `hostname`: ``str`` The hostname to assign to this server + * `tag`: ``str`` The tag to assign to this server - def create_node(self, name, size, image, location): - params = {'DCID': location.id, 'VPSPLANID': size.id, - 'OSID': image.id, 'label': name} + :return: The newly created node. + :rtype: :class:`Node` - result = self.connection.post('/v1/server/create', params) + """ + params = { + "DCID": location.id, + "VPSPLANID": size.id, + "OSID": image.id, + "label": name, + } + + if ex_ssh_key_ids is not None: + params["SSHKEYID"] = ",".join(ex_ssh_key_ids) + + ex_create_attr = ex_create_attr or {} + for key, value in ex_create_attr.items(): + if key in self.EX_CREATE_ATTRIBUTES: + if key in self.EX_CREATE_YES_NO_ATTRIBUTES: + params[key] = "yes" if value else "no" + else: + if key in self.EX_CREATE_ID_ATTRIBUTES: + key = self.EX_CREATE_ID_ATTRIBUTES[key] + params[key] = value + + result = self.connection.post("/v1/server/create", params) if result.status != httplib.OK: return False - subid = result.object['SUBID'] + subid = result.object["SUBID"] retry_count = 3 created_node = None - for i in range(retry_count): + for _ in range(retry_count): try: nodes = self.list_nodes() created_node = [n for n in nodes if n.id == subid][0] except IndexError: time.sleep(1) - pass else: break return created_node def reboot_node(self, node): - params = {'SUBID': node.id} - res = self.connection.post('/v1/server/reboot', params) + params = {"SUBID": node.id} + res = self.connection.post("/v1/server/reboot", params) return res.status == httplib.OK def destroy_node(self, node): - params = {'SUBID': node.id} - res = self.connection.post('/v1/server/destroy', params) + params = {"SUBID": node.id} + res = self.connection.post("/v1/server/destroy", params) return res.status == httplib.OK @@ -137,48 +976,1108 @@ def _list_resources(self, url, tranform_func): return [tranform_func(data[key]) for key in sorted_key] def _to_node(self, data): - if 'status' in data: - state = self.NODE_STATE_MAP.get(data['status'], NodeState.UNKNOWN) - if state == NodeState.RUNNING and \ - data['power_status'] != 'running': + if "status" in data: + state = self.NODE_STATE_MAP.get(data["status"], NodeState.UNKNOWN) + if state == NodeState.RUNNING and data["power_status"] != "running": state = NodeState.STOPPED else: state = NodeState.UNKNOWN - if 'main_ip' in data and data['main_ip'] is not None: - public_ips = [data['main_ip']] + if "main_ip" in data and data["main_ip"] is not None: + public_ips = [data["main_ip"]] else: public_ips = [] + # simple check that we have ip address in value + if len(data["internal_ip"]) > 0: + private_ips = [data["internal_ip"]] + else: + private_ips = [] + created_at = parse_date(data["date_created"]) - extra_keys = [] - extra = {} - for key in extra_keys: - if key in data: - extra[key] = data[key] + # response ordering + extra_keys = [ + "location", # Location name + "default_password", + "pending_charges", + "cost_per_month", + "current_bandwidth_gb", + "allowed_bandwidth_gb", + "netmask_v4", + "gateway_v4", + "power_status", + "server_state", + "v6_networks", + # TODO: Does we really need kvm_url? + "kvm_url", + "auto_backups", + "tag", + # "OSID", # Operating system to use. See v1/os/list. + "APPID", + "FIREWALLGROUPID", + ] + extra = self._helper.handle_extra(extra_keys, data) - node = Node(id=data['SUBID'], name=data['label'], state=state, - public_ips=public_ips, private_ips=None, extra=extra, - driver=self) + resolve_data = VULTR_COMPUTE_INSTANCE_IMAGES.get(data["OSID"]) + if resolve_data: + image = self._to_image(resolve_data) + else: + image = None + + resolve_data = VULTR_COMPUTE_INSTANCE_SIZES.get(data["VPSPLANID"]) + if resolve_data: + size = self._to_size(resolve_data) + else: + size = None + + # resolve_data = VULTR_COMPUTE_INSTANCE_LOCATIONS.get(data['DCID']) + # if resolve_data: + # location = self._to_location(resolve_data) + # extra['location'] = location + + node = Node( + id=data["SUBID"], + name=data["label"], + state=state, + public_ips=public_ips, + private_ips=private_ips, + image=image, + size=size, + extra=extra, + created_at=created_at, + driver=self, + ) return node def _to_location(self, data): - return NodeLocation(id=data['DCID'], name=data['name'], - country=data['country'], driver=self) + extra_keys = [ + "continent", + "state", + "ddos_protection", + "block_storage", + "regioncode", + ] + extra = self._helper.handle_extra(extra_keys, data) + + return NodeLocation( + id=data["DCID"], + name=data["name"], + country=data["country"], + extra=extra, + driver=self, + ) def _to_size(self, data): - extra = {'vcpu_count': int(data['vcpu_count'])} - ram = int(data['ram']) - disk = int(data['disk']) - bandwidth = float(data['bandwidth']) - price = float(data['price_per_month']) + extra_keys = [ + "vcpu_count", + "plan_type", + "available_locations", + ] + extra = self._helper.handle_extra(extra_keys, data) + + # backward compatibility + if extra.get("vcpu_count").isdigit(): + extra["vcpu_count"] = int(extra["vcpu_count"]) - return NodeSize(id=data['VPSPLANID'], name=data['name'], - ram=ram, disk=disk, - bandwidth=bandwidth, price=price, - extra=extra, driver=self) + ram = int(data["ram"]) + disk = int(data["disk"]) + # NodeSize accepted int instead float + bandwidth = int(float(data["bandwidth"])) + price = float(data["price_per_month"]) + return NodeSize( + id=data["VPSPLANID"], + name=data["name"], + ram=ram, + disk=disk, + bandwidth=bandwidth, + price=price, + extra=extra, + driver=self, + ) def _to_image(self, data): - extra = {'arch': data['arch'], 'family': data['family']} - return NodeImage(id=data['OSID'], name=data['name'], extra=extra, - driver=self) + extra_keys = ["arch", "family"] + extra = self._helper.handle_extra(extra_keys, data) + return NodeImage(id=data["OSID"], name=data["name"], extra=extra, driver=self) + + def _to_ssh_key(self, data): + return SSHKey(id=data["SSHKEYID"], name=data["name"], pub_key=data["ssh_key"]) + + +class VultrNodeDriverV2(VultrNodeDriver): + """ + Vultr API v2 NodeDriver. + """ + + connectionCls = VultrConnectionV2 + NODE_STATE_MAP = { + "active": NodeState.RUNNING, + "halted": NodeState.STOPPED, + "rebooting": NodeState.REBOOTING, + "resizing": NodeState.RECONFIGURING, + "pending": NodeState.PENDING, + } + + VOLUME_STATE_MAP = { + "active": StorageVolumeState.AVAILABLE, + "pending": StorageVolumeState.CREATING, + } + + SNAPSHOT_STATE_MAP = { + "complete": VolumeSnapshotState.AVAILABLE, + "pending": VolumeSnapshotState.CREATING, + } + + def list_nodes(self, ex_list_bare_metals: bool = True) -> List[Node]: + """List all nodes. + + :keyword ex_list_bare_metals: Whether to fetch bare metal nodes. + :type ex_list_bare_metals: ``bool`` + + :return: list of node objects + :rtype: ``list`` of :class: `Node` + """ + data = self._paginated_request("/v2/instances", "instances") + nodes = [self._to_node(item) for item in data] + + if ex_list_bare_metals: + nodes += self.ex_list_bare_metal_nodes() + return nodes + + def create_node( + self, + name: str, + size: NodeSize, + image: NodeImage, + location: Optional[NodeLocation] = None, + auth=None, + ex_ssh_key_ids: Optional[List[str]] = None, + ex_private_network_ids: Optional[List[str]] = None, + ex_snapshot: Union[VultrNodeSnapshot, str, None] = None, + ex_enable_ipv6: bool = False, + ex_backups: bool = False, + ex_userdata: Optional[str] = None, + ex_ddos_protection: bool = False, + ex_enable_private_network: bool = False, + ex_ipxe_chain_url: Optional[str] = None, + ex_iso_id: Optional[str] = None, + ex_script_id: Optional[str] = None, + ex_image_id: Optional[str] = None, + ex_activation_email: bool = False, + ex_hostname: Optional[str] = None, + ex_tag: Optional[str] = None, + ex_firewall_group_id: Optional[str] = None, + ex_reserved_ipv4: Optional[str] = None, + ex_persistent_pxe: bool = False, + ) -> Node: + """Create a new node. + + :param name: The new node's name. + :type name: ``str`` + + :param size: The size to use to create the node. + :type size: :class: `NodeSize` + + :param location: The location to provision the node. + :type location: :class: `NodeLocation` + + :keyword image: The image to use to provision the node. + :type image: :class: `NodeImage` + + :keyword ex_ssh_key_ids: List of SSH keys to install on this node. + :type ex_ssh_key_ids: ``list`` of ``str`` + + :keyword ex_private_network_ids: The network ids to attach to node. + This parameter takes precedence over + ex_enable_private_network (VPS only) + :type ex_private_network_ids: ``list`` of ``str`` + + :keyword ex_snapshot: The snapshot to use when deploying the node. + Mutually exclusive with image, + :type ex_snapshot: :class: `VultrNodeSnapshot` or ``str`` + + :keyword ex_enable_ipv6: Whether to enable IPv6. + :type ex_enable_ipv6: ``bool`` + + :keyword ex_backups: Enable automatic backups for the node. (VPS only) + :type ex_backups: ``bool`` + + :keyword ex_userdata: String containing user data + :type ex_userdata: ``str`` + + :keyword ex_ddos_protection: Enable DDoS protection (VPS only) + :type ex_ddos_protection: ``bool`` + + :keyword ex_enable_private_network: Enable private networking. + Mutually exclusive with + ex_private_network_ids. + (VPS only) + :type ex_enable_private_network: ``bool`` + + :keyword ex_ipxe_chain_url: The URL location of the iPXE chainloader + (VPS only) + :type ex_ipxe_chain_url: ``str`` + + :keyword ex_iso_id: The ISO id to use when deploying this node. + (VPS only) + :type ex_iso_id: ``str`` + + :keyword ex_script_id: The startup script id to use when deploying + this node. + :type ex_script_id: ``str`` + + :keyword ex_image_id: The Application image_id to use when deploying + this node. + :type ex_image_id: ``str`` + + :keyword ex_activation_email: Notify by email after deployment. + :type ex_activation_email: ``bool`` + + :keyword ex_hostname: The hostname to use when deploying this node. + :type ex_hostname: ``str`` + + :keyword ex_tag: The user-supplied tag. + :type ex_tag: ``str`` + + :keyword ex_firewall_group_id: The Firewall Group id to attach to + this node. (VPS only) + :type ex_firewall_group_id: ``str`` + + :keyword ex_reserved_ipv4: Id of the floating IP to use as the + main IP of this node. + :type ex_reserved_ipv4: ``str`` + + :keyword ex_persistent_pxe: Enable persistent PXE (Bare Metal only) + :type ex_persistent_pxe: ``bool`` + """ + data = { + "label": name, + "region": location.id, + "plan": size.id, + "enable_ipv6": ex_enable_ipv6, + "activation_email": ex_activation_email, + } + + if image: + data["os_id"] = image.id + + if ex_ssh_key_ids: + data["sshkey_id"] = ex_ssh_key_ids + + if ex_snapshot: + try: + data["snapshot_id"] = ex_snapshot.id + except AttributeError: + data["snapshot_id"] = ex_snapshot + + if ex_userdata: + data["user_data"] = base64.b64encode(bytes(ex_userdata, "utf-8")).decode("utf-8") + + if ex_script_id: + data["script_id"] = ex_script_id + + if ex_image_id: + data["image_id"] = ex_image_id + + if ex_hostname: + data["hostname"] = ex_hostname + + if ex_reserved_ipv4: + data["reserved_ipv4"] = ex_reserved_ipv4 + + if ex_tag: + data["tag"] = ex_tag + + if self._is_bare_metal(size): + if ex_persistent_pxe: + data["persistent_pxe"] = ex_persistent_pxe + resp = self.connection.request("/v2/bare-metals", data=json.dumps(data), method="POST") + return self._to_node(resp.object["bare_metal"]) + else: + if ex_private_network_ids: + data["attach_private_network"] = ex_private_network_ids + + if ex_enable_private_network: + data["enable_private_network"] = ex_enable_private_network + + if ex_ipxe_chain_url: + data["ipxe_chain_url"] = ex_ipxe_chain_url + + if ex_iso_id: + data["iso_id"] = ex_iso_id + + if ex_ddos_protection: + data["ddos_protection"] = ex_ddos_protection + + if ex_firewall_group_id: + data["firewall_group_id"] = ex_firewall_group_id + + if ex_backups: + data["backups"] = "enabled" if ex_backups is True else "disabled" + + resp = self.connection.request("/v2/instances", data=json.dumps(data), method="POST") + return self._to_node(resp.object["instance"]) + + def reboot_node(self, node: Node) -> bool: + """Reboot the given node. + + :param node: The node to be rebooted. + :type node: :class: `Node` + + :rtype: ``bool`` + """ + if self._is_bare_metal(node.size): + return self.ex_reboot_bare_metal_node(node) + + resp = self.connection.request("/v2/instances/%s/reboot" % node.id, method="POST") + + return resp.success() + + def start_node(self, node: Node) -> bool: + """Start the given node. + + :param node: The node to be started. + :type node: :class: `Node` + + :rtype: ``bool`` + """ + if self._is_bare_metal(node.size): + return self.ex_start_bare_metal_node(node) + + resp = self.connection.request("/v2/instances/%s/start" % node.id, method="POST") + + return resp.success() + + def stop_node(self, node: Node) -> bool: + """Stop the given node. + + :param node: The node to be stopped. + :type node: :class: `Node` + + :rtype: ``bool`` + """ + if self._is_bare_metal(node.size): + return self.ex_stop_bare_metal_node(node) + + return self.ex_stop_nodes([node]) + + def destroy_node(self, node: Node) -> bool: + """Destroy the given node. + + :param node: The node to be destroyed. + :type node: :class: `Node` + + :rtype: ``bool`` + """ + if self._is_bare_metal(node.size): + return self.ex_destroy_bare_metal_node(node) + + resp = self.connection.request("/v2/instances/%s" % node.id, method="DELETE") + + return resp.success() + + def list_sizes( + self, + location=None, + ex_list_bare_metals: bool = True, + ): + """List available node sizes. + + :keyword ex_list_bare_metals: Whether to fetch bare metal sizes. + :type ex_list_bare_metals: ``bool`` + + :rtype: ``list`` of :class: `NodeSize` + """ + data = self._paginated_request("/v2/plans", "plans") + sizes = [self._to_size(item) for item in data] + + if ex_list_bare_metals: + sizes += self.ex_list_bare_metal_sizes() + return sizes + + def list_images( + self, + location=None, + ): + """List available node images. + + :rtype: ``list`` of :class: `NodeImage` + """ + data = self._paginated_request("/v2/os", "os") + return [self._to_image(item) for item in data] + + def list_locations(self) -> List[NodeLocation]: + """List available node locations. + + :rtype: ``list`` of :class: `NodeLocation` + """ + data = self._paginated_request("/v2/regions", "regions") + return [self._to_location(item) for item in data] + + def list_volumes(self) -> List[StorageVolume]: + """List storage volumes. + + :rtype: ``list`` of :class:`StorageVolume` + """ + data = self._paginated_request("/v2/blocks", "blocks") + return [self._to_volume(item) for item in data] + + def create_volume( + self, + size, + name, + location=None, + snapshot=None, + ): + """Create a new volume. + + :param size: Size of the volume in gigabytes.\ + Size may range between 10 and 10000. + :type size: ``int`` + + :param name: Name of the volume to be created. + :type name: ``str`` + + :param location: Which data center to create the volume in. + :type location: :class:`NodeLocation` or ``str`` + + :return: The newly created volume. + :rtype: :class:`StorageVolume` + """ + + data = { + "label": name, + "size_gb": size, + } + try: + data["region"] = location.id + except AttributeError: + data["region"] = location + + resp = self.connection.request("/v2/blocks", data=json.dumps(data), method="POST") + return self._to_volume(resp.object["block"]) + + def attach_volume( + self, + node, + volume, + device=None, + ex_live: bool = True, + ): + """Attaches volume to node. + + :param node: Node to attach volume to. + :type node: :class:`Node` + + :param volume: Volume to attach. + :type volume: :class:`StorageVolume` + + :param ex_live: Attach the volume without restarting the node. + :type ex_live: ``bool`` + + :rytpe: ``bool`` + """ + + data = { + "instance_id": node.id, + "live": ex_live, + } + resp = self.connection.request( + "/v2/blocks/%s/attach" % volume.id, data=json.dumps(data), method="POST" + ) + + return resp.success() + + def detach_volume( + self, + volume: StorageVolume, + ex_live: bool = True, + ) -> bool: + """Detaches a volume from a node. + + :param volume: Volume to be detached + :type volume: :class:`StorageVolume` + + :param ex_live: Detach the volume without restarting the node. + :type ex_live: ``bool`` + + :rtype: ``bool`` + """ + data = {"live": ex_live} + + resp = self.connection.request( + "/v2/blocks/%s/detach" % volume.id, data=json.dumps(data), method="POST" + ) + + return resp.success() + + def destroy_volume(self, volume: StorageVolume) -> bool: + """Destroys a storage volume. + + :param volume: Volume to be destroyed + :type volume: :class:`StorageVolume` + + :rtype: ``bool`` + """ + + resp = self.connection.request("/v2/blocks/%s" % volume.id, method="DELETE") + + return resp.success() + + def list_key_pairs(self) -> List[KeyPair]: + """List all the available SSH key pair objects. + + :rtype: ``list`` of :class:`KeyPair` + """ + data = self._paginated_request("/v2/ssh-keys", "ssh_keys") + return [self._to_key_pair(item) for item in data] + + def get_key_pair( + self, + name, + ): + """Retrieve a single key pair. + + :param name: ID of the key pair to retrieve. + :type name: ``str`` + + :rtype: :class: `KeyPair` + """ + key_id = name + resp = self.connection.request("/v2/ssh-keys/%s" % key_id) + return self._to_key_pair(resp.object["ssh_key"]) + + def import_key_pair_from_string(self, name: str, key_material: str) -> KeyPair: + """Import a new public key from string. + + :param name: Key pair name. + :type name: ``str`` + + :param key_material: Public key material. + :type key_material: ``str`` + + :rtype: :class: `KeyPair` + """ + data = { + "name": name, + "ssh_key": key_material, + } + resp = self.connection.request("/v2/ssh-keys", data=json.dumps(data), method="POST") + return self._to_key_pair(resp.object["ssh_key"]) + + def delete_key_pair(self, key_pair: KeyPair) -> bool: + """Delete existing key pair. + + :param key_pair: The key pair object to delete. + :type key_pair: :class:`.KeyPair` + + :rtype: ``bool`` + """ + + resp = self.connection.request("/v2/ssh-keys/%s" % key_pair.extra["id"], method="DELETE") + + return resp.success() + + def ex_list_bare_metal_nodes(self) -> List[Node]: + """List all bare metal nodes. + + :return: list of node objects + :rtype: ``list`` of :class: `Node` + """ + data = self._paginated_request("/v2/bare-metals", "bare_metals") + return [self._to_node(item) for item in data] + + def ex_reboot_bare_metal_node(self, node: Node) -> bool: + """Reboot the given bare metal node. + + :param node: The bare metal node to be rebooted. + :type node: :class: `Node` + + :rtype: ``bool`` + """ + resp = self.connection.request("/v2/bare-metals/%s/reboot" % node.id, method="POST") + + return resp.success() + + def ex_resize_node(self, node: Node, size: NodeSize) -> bool: + """Change size for the given node, only applicable for VPS nodes. + + :param node: The node to be resized. + :type node: :class: `Node` + + :param size: The new size. + :type size: :class: `NodeSize` + """ + data = {"plan": size.id} + resp = self.connection.request( + "/v2/instances/%s" % node.id, data=json.dumps(data), method="PATCH" + ) + return self._to_node(resp.object["instance"]) + + def ex_start_bare_metal_node(self, node: Node) -> bool: + """Start the given bare metal node. + + :param node: The bare metal node to be started. + :type node: :class: `Node` + + :rtype: ``bool`` + """ + resp = self.connection.request("/v2/bare-metals/%s/start" % node.id, method="POST") + + return resp.success() + + def ex_stop_bare_metal_node(self, node: Node) -> bool: + """Stop the given bare metal node. + + :param node: The bare metal node to be stopped. + :type node: :class: `Node` + + :rtype: ``bool`` + """ + resp = self.connection.request("/v2/bare-metals/%s/halt" % node.id, method="POST") + + return resp.success() + + def ex_destroy_bare_metal_node(self, node: Node) -> bool: + """Destroy the given bare metal node. + + :param node: The bare metal node to be destroyed. + :type node: :class: `Node` + + :rtype: ``bool`` + """ + resp = self.connection.request("/v2/bare-metals/%s" % node.id, method="DELETE") + + return resp.success() + + def ex_get_node(self, node_id: str) -> Node: + """Retrieve a node object. + + :param node_id: ID of the node to retrieve. + :type snapshot_id: ``str`` + + :rtype: :class: `Node` + """ + resp = self.connection.request("/v2/instances/%s" % node_id) + return self._to_node(resp.object["instance"]) + + def ex_stop_nodes(self, nodes: List[Node]) -> bool: + """Stops all the nodes given. + + : param nodes: A list of the nodes to stop. + : type node: ``list`` of: class `Node` + + : rtype: ``bool`` + """ + + data = {"instance_ids": [node.id for node in nodes]} + resp = self.connection.request("/v2/instances/halt", data=json.dumps(data), method="POST") + + return resp.success() + + def ex_list_bare_metal_sizes(self) -> List[NodeSize]: + """List bare metal sizes. + + :rtype: ``list`` of :class: `NodeSize` + """ + data = self._paginated_request("/v2/plans-metal", "plans_metal") + return [self._to_size(item) for item in data] + + def ex_list_snapshots(self) -> List[VultrNodeSnapshot]: + """List node snapshots. + + :rtype: ``list`` of :class: `VultrNodeSnapshot` + """ + data = self._paginated_request("/v2/snapshots", "snapshots") + return [self._to_snapshot(item) for item in data] + + def ex_get_snapshot(self, snapshot_id: str) -> VultrNodeSnapshot: + """Retrieve a snapshot. + + :param snapshot_id: ID of the snapshot to retrieve. + :type snapshot_id: ``str`` + + :rtype: :class: `VultrNodeSnapshot` + """ + resp = self.connection.request("/v2/snapshots/%s" % snapshot_id) + return self._to_snapshot(resp.object["snapshot"]) + + def ex_create_snapshot( + self, node: Node, description: Optional[str] = None + ) -> VultrNodeSnapshot: + """Create snapshot from a node. + + :param node: Node to create the snapshot from. + :type node: :class: `Node` + + :keyword description: A description of the snapshot. + :type description: ``str`` + + :rtype: :class: `VultrNodeSnapshot` + """ + data = { + "instance_id": node.id, + } + if description: + data["description"] = description + + resp = self.connection.request("/v2/snapshots", data=json.dumps(data), method="POST") + + return self._to_snapshot(resp.object["snapshot"]) + + def ex_delete_snapshot(self, snapshot: VultrNodeSnapshot) -> bool: + """Delete the given snapshot. + + :param snapshot: The snapshot to delete. + :type node: :class:`VultrNodeSnapshot` + + :rtype: ``bool`` + """ + + resp = self.connection.request("/v2/snapshots/%s" % snapshot.id, method="DELETE") + + return resp.success() + + def ex_list_networks(self) -> List[VultrNetwork]: + """List all private networks. + + :rtype: ``list`` of :class: `VultrNetwork` + """ + + data = self._paginated_request("/v2/private-networks", "networks") + return [self._to_network(item) for item in data] + + def ex_create_network( + self, + cidr_block: str, + location: Union[NodeLocation, str], + description: Optional[str] = None, + ) -> VultrNetwork: + """Create a private network. + + :param cidr_block: The CIDR block assigned to the network. + :type cidr_block: ``str`` + + :param location: The location to create the network. + :type location: :class: `NodeLocation` or ``str`` + + :keyword description: A description of the private network. + :type description: ``str`` + + :rtype: :class: `VultrNetwork` + """ + subnet, subnet_mask = cidr_block.split("/") + data = { + "v4_subnet": subnet, + "v4_subnet_mask": int(subnet_mask), + } + + try: + data["region"] = location.id + except AttributeError: + data["region"] = location + + if description: + data["description"] = description + + resp = self.connection.request("/v2/private-networks", data=json.dumps(data), method="POST") + + return self._to_network(resp.object["network"]) + + def ex_get_network(self, network_id: str) -> VultrNetwork: + """Retrieve a private network. + + :param network_id: ID of the network to retrieve. + :type network_id: ``str`` + + :rtype: :class: `VultrNetwork` + """ + + resp = self.connection.request("/v2/private-networks/%s" % network_id) + return self._to_network(resp.object["network"]) + + def ex_destroy_network(self, network: VultrNetwork) -> bool: + """Delete a private network. + + :param network: The network to destroy. + :type network: :class: `VultrNetwork` + + :rtype: ``bool`` + """ + resp = self.connection.request("/v2/private-networks/%s" % network.id, method="DELETE") + + return resp.success() + + def ex_list_available_sizes_for_location( + self, + location: NodeLocation, + ) -> List[str]: + """Get a list of available sizes for the given location. + + :param location: The location to get available sizes for. + :type location: :class: `NodeLocation` + + :return: A list of available size IDs for the given location. + :rtype: ``list`` of ``str`` + """ + resp = self.connection.request("/v2/regions/%s/availability" % location.id) + return resp.object["available_plans"] + + def ex_get_volume(self, volume_id: str) -> StorageVolume: + """Retrieve a single volume. + + :param volume_id: The ID of the volume to fetch. + :type volume_id: ``str`` + + :rtype :class: `StorageVolume` + :return: StorageVolume instance on success. + """ + resp = self.connection.request("/v2/blocks/%s" % volume_id) + + return self._to_volume(resp.object["block"]) + + def ex_resize_volume(self, volume: StorageVolume, size: int) -> bool: + """Resize a volume. + + :param volume: The volume to resize. + :type volume: :class:`StorageVolume` + + :param size: The new volume size in GBs.\ + Size may range between 10 and 10000. + :type size: ``int`` + + :rtype: ``bool`` + """ + data = { + "label": volume.name, + "size_gb": size, + } + + resp = self.connection.request( + "/v2/blocks/%s" % volume.id, data=json.dumps(data), method="PATCH" + ) + return resp.success() + + def _is_bare_metal(self, size: Union[NodeSize, str]) -> bool: + try: + size_id = size.id + except AttributeError: + size_id = size + + return size_id.startswith("vbm") + + def _to_node(self, data: Dict[str, Any]) -> Node: + id_ = data["id"] + name = data["label"] + public_ips = data["main_ip"].split() + data["v6_main_ip"].split() + size = data["plan"] + image = str(data["os_id"]) + created_at = data["date_created"] + is_bare_metal = self._is_bare_metal(size) + extra = { + "location": data["region"], + "ram": data["ram"], + "disk": data["disk"], + "netmask_v4": data["netmask_v4"], + "gateway_v4": data["gateway_v4"], + "v6_network": data["v6_network"], + "v6_network_size": data["v6_network_size"], + "app_id": data["app_id"], + "image_id": data["image_id"], + "features": data["features"], + "tag": data["tag"], + "os": data["os"], + "is_bare_metal": is_bare_metal, + } + if is_bare_metal: + state = self._get_node_state(data["status"]) + extra["cpu_count"] = data["cpu_count"] + extra["mac_address"] = data["mac_address"] + private_ips = None + else: + state = self._get_node_state(data["status"], power_state=data["power_status"]) + extra["vcpu_count"] = data["vcpu_count"] + extra["allowed_bandwidth"] = data["allowed_bandwidth"] + extra["power_status"] = data["power_status"] + extra["server_status"] = data["server_status"] + extra["firewall_group_id"] = data["firewall_group_id"] + private_ips = data["internal_ip"].split() + + return Node( + id=id_, + name=name, + state=state, + public_ips=public_ips, + private_ips=private_ips, + driver=self, + size=size, + image=image, + extra=extra, + created_at=created_at, + ) + + def _to_volume(self, data: Dict[str, Any]) -> StorageVolume: + id_ = data["id"] + name = data["label"] + size = data["size_gb"] + try: + state = self.VOLUME_STATE_MAP[data["status"]] + except KeyError: + state = StorageVolumeState.UNKNOWN + extra = { + "date_created": data["date_created"], + "cost": data["cost"], + "location": data["region"], + "attached_to_instance": data["attached_to_instance"], + "mount_id": data["mount_id"], + } + return StorageVolume(id=id_, name=name, size=size, driver=self, state=state, extra=extra) + + def _get_node_state( + self, + state: str, + power_state: Optional[str] = None, + ) -> NodeState: + try: + state = self.NODE_STATE_MAP[state] + except KeyError: + state = NodeState.UNKNOWN + + if power_state is None: + return state + + if state == NodeState.RUNNING and power_state != "running": + state = NodeState.STOPPED + return state + + def _to_key_pair(self, data: Dict[str, Any]) -> KeyPair: + name = data["name"] + public_key = data["ssh_key"] + # requires cryptography module + try: + fingerprint = get_pubkey_openssh_fingerprint(public_key) + except RuntimeError: + fingerprint = None + extra = { + "id": data["id"], + "date_created": data["date_created"], + } + return KeyPair( + name=name, + public_key=public_key, + fingerprint=fingerprint, + driver=self, + extra=extra, + ) + + def _to_location(self, data: Dict[str, Any]) -> NodeLocation: + id_ = data["id"] + name = data["city"] + country = data["country"] + extra = { + "continent": data["continent"], + "option": data["options"], + } + return NodeLocation(id=id_, name=name, country=country, driver=self, extra=extra) + + def _to_image(self, data: Dict[str, Any]) -> NodeImage: + id_ = data["id"] + name = data["name"] + extra = { + "arch": data["arch"], + "family": data["family"], + } + return NodeImage(id=id_, name=name, driver=self, extra=extra) + + def _to_size(self, data: Dict[str, Any]) -> NodeSize: + id_ = data["id"] + ram = data["ram"] + disk = data["disk"] + bandwidth = data["bandwidth"] + price = data["monthly_cost"] + is_bare_metal = self._is_bare_metal(id_) + extra = { + "locations": data["locations"], + "type": data["type"], + "disk_count": data["disk_count"], + "is_bare_metal": is_bare_metal, + } + + # VPS and bare metal sizes have different fields + if is_bare_metal is False: + extra["vcpu_count"] = data["vcpu_count"] + else: + extra["cpu_count"] = data["cpu_count"] + extra["cpu_model"] = data["cpu_model"] + extra["cpu_threads"] = data["cpu_threads"] + + return NodeSize( + id=id_, + name=id_, + ram=ram, + disk=disk, + bandwidth=bandwidth, + price=price, + driver=self, + extra=extra, + ) + + def _to_network(self, data: Dict[str, Any]) -> VultrNetwork: + id_ = data["id"] + cidr_block = "{}/{}".format(data["v4_subnet"], data["v4_subnet_mask"]) + location = data["region"] + extra = { + "description": data["description"], + "date_created": data["date_created"], + } + return VultrNetwork(id=id_, cidr_block=cidr_block, location=location, extra=extra) + + def _to_snapshot(self, data: Dict[str, Any]) -> VultrNodeSnapshot: + id_ = data["id"] + created = data["date_created"] + # Size is returned in bytes, convert to GBs + size = data["size"] / 1024 / 1024 / 1024 + try: + state = self.SNAPSHOT_STATE_MAP[data["status"]] + except KeyError: + state = VolumeSnapshotState.UNKNOWN + extra = { + "description": data["description"], + "os_id": data["os_id"], + "app_id": data["app_id"], + } + return VultrNodeSnapshot( + id=id_, size=size, created=created, state=state, extra=extra, driver=self + ) + + def _paginated_request( + self, url: str, key: str, params: Optional[Dict[str, Any]] = None + ) -> List[Any]: + """Perform multiple calls to get the full list of items when + the API responses are paginated. + + :param url: API endpoint + :type url: ``str`` + + :param key: Result object key + :type key: ``str`` + + :param params: Request parameters + :type params: ``dict`` + + :return: ``list`` of API response objects + :rtype: ``list`` + """ + params = params if params is not None else {} + resp = self.connection.request(url, params=params).object + data = list(resp.get(key, [])) + objects = data + while True: + next_page = resp["meta"]["links"]["next"] + if next_page: + params["cursor"] = next_page + resp = self.connection.request(url, params=params).object + data = list(resp.get(key, [])) + objects.extend(data) + else: + return objects diff --git a/libcloud/compute/providers.py b/libcloud/compute/providers.py index 8ce4162d2b..82605099da 100644 --- a/libcloud/compute/providers.py +++ b/libcloud/compute/providers.py @@ -16,170 +16,117 @@ Provider related utilities """ -from libcloud.utils.misc import get_driver as _get_provider_driver -from libcloud.utils.misc import set_driver as _set_provider_driver -from libcloud.compute.types import Provider, DEPRECATED_RACKSPACE_PROVIDERS -from libcloud.compute.types import OLD_CONSTANT_TO_NEW_MAPPING +from types import ModuleType +from typing import TYPE_CHECKING, Type, Union -__all__ = [ - "Provider", - "DRIVERS", - "get_driver"] +from libcloud.compute.types import OLD_CONSTANT_TO_NEW_MAPPING, Provider +from libcloud.common.providers import get_driver as _get_provider_driver +from libcloud.common.providers import set_driver as _set_provider_driver +from libcloud.compute.deprecated import DEPRECATED_DRIVERS -DRIVERS = { - Provider.AZURE: - ('libcloud.compute.drivers.azure', 'AzureNodeDriver'), - Provider.DUMMY: - ('libcloud.compute.drivers.dummy', 'DummyNodeDriver'), - Provider.EC2_US_EAST: - ('libcloud.compute.drivers.ec2', 'EC2NodeDriver'), - Provider.EC2_EU_WEST: - ('libcloud.compute.drivers.ec2', 'EC2EUNodeDriver'), - Provider.EC2_US_WEST: - ('libcloud.compute.drivers.ec2', 'EC2USWestNodeDriver'), - Provider.EC2_US_WEST_OREGON: - ('libcloud.compute.drivers.ec2', 'EC2USWestOregonNodeDriver'), - Provider.EC2_AP_SOUTHEAST: - ('libcloud.compute.drivers.ec2', 'EC2APSENodeDriver'), - Provider.EC2_AP_NORTHEAST: - ('libcloud.compute.drivers.ec2', 'EC2APNENodeDriver'), - Provider.EC2_SA_EAST: - ('libcloud.compute.drivers.ec2', 'EC2SAEastNodeDriver'), - Provider.EC2_AP_SOUTHEAST2: - ('libcloud.compute.drivers.ec2', 'EC2APSESydneyNodeDriver'), - Provider.ECP: - ('libcloud.compute.drivers.ecp', 'ECPNodeDriver'), - Provider.ELASTICHOSTS: - ('libcloud.compute.drivers.elastichosts', 'ElasticHostsNodeDriver'), - Provider.ELASTICHOSTS_UK1: - ('libcloud.compute.drivers.elastichosts', 'ElasticHostsUK1NodeDriver'), - Provider.ELASTICHOSTS_UK2: - ('libcloud.compute.drivers.elastichosts', 'ElasticHostsUK2NodeDriver'), - Provider.ELASTICHOSTS_US1: - ('libcloud.compute.drivers.elastichosts', 'ElasticHostsUS1NodeDriver'), - Provider.ELASTICHOSTS_US2: - ('libcloud.compute.drivers.elastichosts', 'ElasticHostsUS2NodeDriver'), - Provider.ELASTICHOSTS_US3: - ('libcloud.compute.drivers.elastichosts', 'ElasticHostsUS3NodeDriver'), - Provider.ELASTICHOSTS_CA1: - ('libcloud.compute.drivers.elastichosts', 'ElasticHostsCA1NodeDriver'), - Provider.ELASTICHOSTS_AU1: - ('libcloud.compute.drivers.elastichosts', 'ElasticHostsAU1NodeDriver'), - Provider.ELASTICHOSTS_CN1: - ('libcloud.compute.drivers.elastichosts', 'ElasticHostsCN1NodeDriver'), - Provider.SKALICLOUD: - ('libcloud.compute.drivers.skalicloud', 'SkaliCloudNodeDriver'), - Provider.SERVERLOVE: - ('libcloud.compute.drivers.serverlove', 'ServerLoveNodeDriver'), - Provider.CLOUDSIGMA: - ('libcloud.compute.drivers.cloudsigma', 'CloudSigmaNodeDriver'), - Provider.GCE: - ('libcloud.compute.drivers.gce', 'GCENodeDriver'), - Provider.GOGRID: - ('libcloud.compute.drivers.gogrid', 'GoGridNodeDriver'), - Provider.RACKSPACE: - ('libcloud.compute.drivers.rackspace', 'RackspaceNodeDriver'), - Provider.RACKSPACE_FIRST_GEN: - ('libcloud.compute.drivers.rackspace', 'RackspaceFirstGenNodeDriver'), - Provider.HPCLOUD: - ('libcloud.compute.drivers.hpcloud', 'HPCloudNodeDriver'), - Provider.KILI: - ('libcloud.compute.drivers.kili', 'KiliCloudNodeDriver'), - Provider.VPSNET: - ('libcloud.compute.drivers.vpsnet', 'VPSNetNodeDriver'), - Provider.LINODE: - ('libcloud.compute.drivers.linode', 'LinodeNodeDriver'), - Provider.RIMUHOSTING: - ('libcloud.compute.drivers.rimuhosting', 'RimuHostingNodeDriver'), - Provider.VOXEL: - ('libcloud.compute.drivers.voxel', 'VoxelNodeDriver'), - Provider.SOFTLAYER: - ('libcloud.compute.drivers.softlayer', 'SoftLayerNodeDriver'), - Provider.EUCALYPTUS: - ('libcloud.compute.drivers.ec2', 'EucNodeDriver'), - Provider.IBM: - ('libcloud.compute.drivers.ibm_sce', 'IBMNodeDriver'), - Provider.OPENNEBULA: - ('libcloud.compute.drivers.opennebula', 'OpenNebulaNodeDriver'), - Provider.DREAMHOST: - ('libcloud.compute.drivers.dreamhost', 'DreamhostNodeDriver'), - Provider.BRIGHTBOX: - ('libcloud.compute.drivers.brightbox', 'BrightboxNodeDriver'), - Provider.NIMBUS: - ('libcloud.compute.drivers.ec2', 'NimbusNodeDriver'), - Provider.BLUEBOX: - ('libcloud.compute.drivers.bluebox', 'BlueboxNodeDriver'), - Provider.GANDI: - ('libcloud.compute.drivers.gandi', 'GandiNodeDriver'), - Provider.OPSOURCE: - ('libcloud.compute.drivers.opsource', 'OpsourceNodeDriver'), - Provider.OPENSTACK: - ('libcloud.compute.drivers.openstack', 'OpenStackNodeDriver'), - Provider.NINEFOLD: - ('libcloud.compute.drivers.ninefold', 'NinefoldNodeDriver'), - Provider.VCLOUD: - ('libcloud.compute.drivers.vcloud', 'VCloudNodeDriver'), - Provider.TERREMARK: - ('libcloud.compute.drivers.vcloud', 'TerremarkDriver'), - Provider.CLOUDSTACK: - ('libcloud.compute.drivers.cloudstack', 'CloudStackNodeDriver'), - Provider.LIBVIRT: - ('libcloud.compute.drivers.libvirt_driver', 'LibvirtNodeDriver'), - Provider.JOYENT: - ('libcloud.compute.drivers.joyent', 'JoyentNodeDriver'), - Provider.VCL: - ('libcloud.compute.drivers.vcl', 'VCLNodeDriver'), - Provider.KTUCLOUD: - ('libcloud.compute.drivers.ktucloud', 'KTUCloudNodeDriver'), - Provider.HOSTVIRTUAL: - ('libcloud.compute.drivers.hostvirtual', 'HostVirtualNodeDriver'), - Provider.ABIQUO: - ('libcloud.compute.drivers.abiquo', 'AbiquoNodeDriver'), - Provider.DIGITAL_OCEAN: - ('libcloud.compute.drivers.digitalocean', 'DigitalOceanNodeDriver'), - Provider.NEPHOSCALE: - ('libcloud.compute.drivers.nephoscale', 'NephoscaleNodeDriver'), - Provider.CLOUDFRAMES: - ('libcloud.compute.drivers.cloudframes', 'CloudFramesNodeDriver'), - Provider.EXOSCALE: - ('libcloud.compute.drivers.exoscale', 'ExoscaleNodeDriver'), - Provider.IKOULA: - ('libcloud.compute.drivers.ikoula', 'IkoulaNodeDriver'), - Provider.OUTSCALE_SAS: - ('libcloud.compute.drivers.ec2', 'OutscaleSASNodeDriver'), - Provider.OUTSCALE_INC: - ('libcloud.compute.drivers.ec2', 'OutscaleINCNodeDriver'), - Provider.VSPHERE: - ('libcloud.compute.drivers.vsphere', 'VSphereNodeDriver'), - Provider.PROFIT_BRICKS: - ('libcloud.compute.drivers.profitbricks', 'ProfitBricksNodeDriver'), - Provider.VULTR: - ('libcloud.compute.drivers.vultr', 'VultrNodeDriver'), - Provider.AURORACOMPUTE: - ('libcloud.compute.drivers.auroracompute', 'AuroraComputeNodeDriver'), +if TYPE_CHECKING: + # NOTE: This is needed to avoid having setup.py depend on requests + from libcloud.compute.base import NodeDriver + +__all__ = ["Provider", "DRIVERS", "get_driver"] - # Deprecated - Provider.CLOUDSIGMA_US: - ('libcloud.compute.drivers.cloudsigma', 'CloudSigmaLvsNodeDriver'), +DRIVERS = { + Provider.AZURE: ("libcloud.compute.drivers.azure", "AzureNodeDriver"), + Provider.AZURE_ARM: ("libcloud.compute.drivers.azure_arm", "AzureNodeDriver"), + Provider.DUMMY: ("libcloud.compute.drivers.dummy", "DummyNodeDriver"), + Provider.EC2: ("libcloud.compute.drivers.ec2", "EC2NodeDriver"), + Provider.CLOUDSIGMA: ( + "libcloud.compute.drivers.cloudsigma", + "CloudSigmaNodeDriver", + ), + Provider.GCE: ("libcloud.compute.drivers.gce", "GCENodeDriver"), + Provider.RACKSPACE: ("libcloud.compute.drivers.rackspace", "RackspaceNodeDriver"), + Provider.RACKSPACE_FIRST_GEN: ( + "libcloud.compute.drivers.rackspace", + "RackspaceFirstGenNodeDriver", + ), + Provider.VPSNET: ("libcloud.compute.drivers.vpsnet", "VPSNetNodeDriver"), + Provider.LINODE: ("libcloud.compute.drivers.linode", "LinodeNodeDriver"), + Provider.RIMUHOSTING: ( + "libcloud.compute.drivers.rimuhosting", + "RimuHostingNodeDriver", + ), + Provider.EUCALYPTUS: ("libcloud.compute.drivers.ec2", "EucNodeDriver"), + Provider.OPENNEBULA: ( + "libcloud.compute.drivers.opennebula", + "OpenNebulaNodeDriver", + ), + Provider.BRIGHTBOX: ("libcloud.compute.drivers.brightbox", "BrightboxNodeDriver"), + Provider.NIMBUS: ("libcloud.compute.drivers.ec2", "NimbusNodeDriver"), + Provider.GANDI: ("libcloud.compute.drivers.gandi", "GandiNodeDriver"), + Provider.DIMENSIONDATA: ( + "libcloud.compute.drivers.dimensiondata", + "DimensionDataNodeDriver", + ), + Provider.OPENSTACK: ("libcloud.compute.drivers.openstack", "OpenStackNodeDriver"), + Provider.VCLOUD: ("libcloud.compute.drivers.vcloud", "VCloudNodeDriver"), + Provider.TERREMARK: ("libcloud.compute.drivers.vcloud", "TerremarkDriver"), + Provider.CLOUDSTACK: ( + "libcloud.compute.drivers.cloudstack", + "CloudStackNodeDriver", + ), + Provider.LIBVIRT: ("libcloud.compute.drivers.libvirt_driver", "LibvirtNodeDriver"), + Provider.VCL: ("libcloud.compute.drivers.vcl", "VCLNodeDriver"), + Provider.KTUCLOUD: ("libcloud.compute.drivers.ktucloud", "KTUCloudNodeDriver"), + Provider.ABIQUO: ("libcloud.compute.drivers.abiquo", "AbiquoNodeDriver"), + Provider.DIGITAL_OCEAN: ( + "libcloud.compute.drivers.digitalocean", + "DigitalOceanNodeDriver", + ), + Provider.EXOSCALE: ("libcloud.compute.drivers.exoscale", "ExoscaleNodeDriver"), + Provider.IKOULA: ("libcloud.compute.drivers.ikoula", "IkoulaNodeDriver"), + Provider.OUTSCALE_SAS: ("libcloud.compute.drivers.ec2", "OutscaleSASNodeDriver"), + Provider.OUTSCALE_INC: ("libcloud.compute.drivers.ec2", "OutscaleINCNodeDriver"), + Provider.OUTSCALE: ("libcloud.compute.drivers.outscale", "OutscaleNodeDriver"), + Provider.VSPHERE: ("libcloud.compute.drivers.vsphere", "VSphereNodeDriver"), + Provider.VULTR: ("libcloud.compute.drivers.vultr", "VultrNodeDriver"), + Provider.AURORACOMPUTE: ( + "libcloud.compute.drivers.auroracompute", + "AuroraComputeNodeDriver", + ), + Provider.EQUINIXMETAL: ( + "libcloud.compute.drivers.equinixmetal", + "EquinixMetalNodeDriver", + ), + Provider.ONAPP: ("libcloud.compute.drivers.onapp", "OnAppNodeDriver"), + Provider.OVH: ("libcloud.compute.drivers.ovh", "OvhNodeDriver"), + Provider.INTERNETSOLUTIONS: ( + "libcloud.compute.drivers.internetsolutions", + "InternetSolutionsNodeDriver", + ), + Provider.NTTA: ("libcloud.compute.drivers.ntta", "NTTAmericaNodeDriver"), + Provider.ALIYUN_ECS: ("libcloud.compute.drivers.ecs", "ECSDriver"), + Provider.CLOUDSCALE: ( + "libcloud.compute.drivers.cloudscale", + "CloudscaleNodeDriver", + ), + Provider.UPCLOUD: ("libcloud.compute.drivers.upcloud", "UpcloudDriver"), + Provider.NTTCIS: ("libcloud.compute.drivers.nttcis", "NttCisNodeDriver"), + Provider.SCALEWAY: ("libcloud.compute.drivers.scaleway", "ScalewayNodeDriver"), + Provider.MAXIHOST: ("libcloud.compute.drivers.maxihost", "MaxihostNodeDriver"), + Provider.GRIDSCALE: ("libcloud.compute.drivers.gridscale", "GridscaleNodeDriver"), + Provider.KAMATERA: ("libcloud.compute.drivers.kamatera", "KamateraNodeDriver"), + Provider.KUBEVIRT: ("libcloud.compute.drivers.kubevirt", "KubeVirtNodeDriver"), + Provider.GIG_G8: ("libcloud.compute.drivers.gig_g8", "G8NodeDriver"), } def get_driver(provider): - if provider in DEPRECATED_RACKSPACE_PROVIDERS: - id_to_name_map = dict([(v, k) for k, v in Provider.__dict__.items()]) - old_name = id_to_name_map[provider] - new_name = id_to_name_map[OLD_CONSTANT_TO_NEW_MAPPING[provider]] - - url = 'http://s.apache.org/lc0140un' - msg = ('Provider constant %s has been removed. New constant ' - 'is now called %s.\n' - 'For more information on this change and how to modify your ' - 'code to work with it, please visit: %s' % - (old_name, new_name, url)) - raise Exception(msg) - - return _get_provider_driver(DRIVERS, provider) + # type: (Union[Provider, str]) -> Type[NodeDriver] + deprecated_constants = OLD_CONSTANT_TO_NEW_MAPPING + return _get_provider_driver( + drivers=DRIVERS, + provider=provider, + deprecated_providers=DEPRECATED_DRIVERS, + deprecated_constants=deprecated_constants, + ) def set_driver(provider, module, klass): - return _set_provider_driver(DRIVERS, provider, module, klass) + # type: (Union[Provider, str], ModuleType, type) -> Type[NodeDriver] + return _set_provider_driver(drivers=DRIVERS, provider=provider, module=module, klass=klass) diff --git a/libcloud/compute/ssh.py b/libcloud/compute/ssh.py index 427e1339eb..aab2886bf1 100644 --- a/libcloud/compute/ssh.py +++ b/libcloud/compute/ssh.py @@ -17,65 +17,108 @@ Wraps multiple ways to communicate over SSH. """ +import os +import re +import time +import logging +import warnings +import subprocess +from typing import List, Type, Tuple, Union, Optional, cast +from os.path import join as pjoin +from os.path import split as psplit + +from libcloud.utils.py3 import StringIO, b +from libcloud.utils.logging import ExtraLogFormatter + have_paramiko = False try: import paramiko + have_paramiko = True + + PARAMIKO_VERSION_TUPLE = tuple(int(x) for x in paramiko.__version__.split(".")) except ImportError: - pass + PARAMIKO_VERSION_TUPLE = () # Depending on your version of Paramiko, it may cause a deprecation # warning on Python 2.6. # Ref: https://bugs.launchpad.net/paramiko/+bug/392973 -import os -import time -import subprocess -import logging -import warnings - -from os.path import split as psplit -from os.path import join as pjoin - -from libcloud.utils.logging import ExtraLogFormatter -from libcloud.utils.py3 import StringIO -from libcloud.utils.py3 import b __all__ = [ - 'BaseSSHClient', - 'ParamikoSSHClient', - 'ShellOutSSHClient', + "BaseSSHClient", + "ParamikoSSHClient", + "ShellOutSSHClient", + "SSHCommandTimeoutError", +] - 'SSHCommandTimeoutError' +SUPPORTED_KEY_TYPES_URL = "https://libcloud.readthedocs.io/en/latest/compute/deployment.html#supported-private-ssh-key-types" # NOQA + +# Set it to False to disable backward compatibility mode when running +# paramiko >= 2.9.0. In backward compatibility mode we try to disable newer +# SHA-2 based public key algorithms in case server returns auth error. This +# way it works correctly with older OpenSSH servers which don't support those +# algorithms aka the behavior is the same as with paramiko < 2.9.0. +# In case users only talk to newer OpenSSH servers which support those +# algorithms, they may want to disable this workaround. +LIBCLOUD_PARAMIKO_SHA2_BACKWARD_COMPATIBILITY = os.environ.get( + "LIBCLOUD_PARAMIKO_SHA2_BACKWARD_COMPATIBILITY", "true" +).lower() in [ + "true", + "1", ] +SHA2_PUBKEY_NOT_SUPPORTED_AUTH_ERROR_MSG = """ +Received authentication error from the server. Disabling SHA-2 variants of RSA +key verification algorithm for backward compatibility reasons and trying +connecting again. + +You can disable this behavior by setting +LIBCLOUD_PARAMIKO_SHA2_BACKWARD_COMPATIBILITY environment variable to "false". +""".strip() + class SSHCommandTimeoutError(Exception): """ Exception which is raised when an SSH command times out. """ - def __init__(self, cmd, timeout): + + def __init__(self, cmd, timeout, stdout=None, stderr=None): + # type: (str, float, Optional[str], Optional[str]) -> None self.cmd = cmd self.timeout = timeout - message = 'Command didn\'t finish in %s seconds' % (timeout) - super(SSHCommandTimeoutError, self).__init__(message) + self.stdout = stdout + self.stderr = stderr + + self.message = "Command didn't finish in %s seconds" % (timeout) + super().__init__(self.message) def __repr__(self): - return ('' % - (self.cmd, self.timeout)) + return ''.format( + self.cmd, + self.timeout, + ) def __str__(self): - return self.message + return self.__repr__() -class BaseSSHClient(object): +class BaseSSHClient: """ Base class representing a connection over SSH/SCP to a remote node. """ - def __init__(self, hostname, port=22, username='root', password=None, - key=None, key_files=None, timeout=None): + def __init__( + self, + hostname, # type: str + port=22, # type: int + username="root", # type: str + password=None, # type: Optional[str] + key=None, # type: Optional[str] + key_files=None, # type: Optional[Union[str, List[str]]] + timeout=None, # type: Optional[float] + ): """ :type hostname: ``str`` :keyword hostname: Hostname or IP address to connect to. @@ -97,8 +140,10 @@ def __init__(self, hostname, port=22, username='root', password=None, :keyword key_files: A list of paths to the private key files to use. """ if key is not None: - message = ('You are using deprecated "key" argument which has ' - 'been replaced with "key_files" argument') + message = ( + 'You are using deprecated "key" argument which has ' + 'been replaced with "key_files" argument' + ) warnings.warn(message, DeprecationWarning) # key_files has precedent @@ -112,6 +157,7 @@ def __init__(self, hostname, port=22, username='root', password=None, self.timeout = timeout def connect(self): + # type: () -> bool """ Connect to the remote node over SSH. @@ -119,10 +165,10 @@ def connect(self): False otherwise. :rtype: ``bool`` """ - raise NotImplementedError( - 'connect not implemented for this ssh client') + raise NotImplementedError("connect not implemented for this ssh client") - def put(self, path, contents=None, chmod=None, mode='w'): + def put(self, path, contents=None, chmod=None, mode="w"): + # type: (str, Optional[Union[str, bytes]], Optional[int], str) -> str """ Upload a file to the remote node. @@ -141,10 +187,28 @@ def put(self, path, contents=None, chmod=None, mode='w'): :return: Full path to the location where a file has been saved. :rtype: ``str`` """ - raise NotImplementedError( - 'put not implemented for this ssh client') + raise NotImplementedError("put not implemented for this ssh client") + + def putfo(self, path, fo=None, chmod=None): + """ + Upload file like object to the remote server. + + :param path: Path to upload the file to. + :type path: ``str`` + + :param fo: File like object to read the content from. + :type fo: File handle or file like object. + + :type chmod: ``int`` + :keyword chmod: chmod file to this after creation. + + :return: Full path to the location where a file has been saved. + :rtype: ``str`` + """ + raise NotImplementedError("putfo not implemented for this ssh client") def delete(self, path): + # type: (str) -> bool """ Delete/Unlink a file on the remote node. @@ -155,10 +219,10 @@ def delete(self, path): otherwise. :rtype: ``bool`` """ - raise NotImplementedError( - 'delete not implemented for this ssh client') + raise NotImplementedError("delete not implemented for this ssh client") - def run(self, cmd): + def run(self, cmd, timeout=None): + # type: (str, Optional[float]) -> Tuple[str, str, int] """ Run a command on a remote node. @@ -167,10 +231,10 @@ def run(self, cmd): :return ``list`` of [stdout, stderr, exit_status] """ - raise NotImplementedError( - 'run not implemented for this ssh client') + raise NotImplementedError("run not implemented for this ssh client") def close(self): + # type: () -> bool """ Shutdown connection to the remote node. @@ -178,12 +242,12 @@ def close(self): otherwise. :rtype: ``bool`` """ - raise NotImplementedError( - 'close not implemented for this ssh client') + raise NotImplementedError("close not implemented for this ssh client") def _get_and_setup_logger(self): - logger = logging.getLogger('libcloud.compute.ssh') - path = os.getenv('LIBCLOUD_DEBUG') + # type: () -> logging.Logger + logger = logging.getLogger("libcloud.compute.ssh") + path = os.getenv("LIBCLOUD_DEBUG") if path: handler = logging.FileHandler(path) @@ -200,12 +264,25 @@ class ParamikoSSHClient(BaseSSHClient): """ # Maximum number of bytes to read at once from a socket - CHUNK_SIZE = 1024 - # How long to sleep while waiting for command to finish - SLEEP_DELAY = 1.5 - - def __init__(self, hostname, port=22, username='root', password=None, - key=None, key_files=None, key_material=None, timeout=None): + CHUNK_SIZE = 4096 + + # How long to sleep while waiting for command to finish (to prevent busy + # waiting) + SLEEP_DELAY = 0.2 + + def __init__( + self, + hostname, # type: str + port=22, # type: int + username="root", # type: str + password=None, # type: Optional[str] + key=None, # type: Optional[str] + key_files=None, # type: Optional[Union[str, List[str]]] + key_material=None, # type: Optional[str] + timeout=None, # type: Optional[float] + keep_alive=None, # type: Optional[int] + use_compression=False, # type: bool + ): """ Authentication is always attempted in the following order: @@ -216,59 +293,135 @@ def __init__(self, hostname, port=22, username='root', password=None, password and key is provided) - Plain username/password auth, if a password was given (if password is provided) + + :param keep_alive: Optional keep alive internal (in seconds) to use. + :type keep_alive: ``int`` + + :param use_compression: True to use compression. + :type use_compression: ``bool`` """ if key_files and key_material: - raise ValueError(('key_files and key_material arguments are ' - 'mutually exclusive')) - - super(ParamikoSSHClient, self).__init__(hostname=hostname, port=port, - username=username, - password=password, - key=key, - key_files=key_files, - timeout=timeout) + raise ValueError("key_files and key_material arguments are " "mutually exclusive") + + super().__init__( + hostname=hostname, + port=port, + username=username, + password=password, + key=key, + key_files=key_files, + timeout=timeout, + ) self.key_material = key_material + self.keep_alive = keep_alive + self.use_compression = use_compression self.client = paramiko.SSHClient() - self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + # Long term we should switch to a more secure default, but this would break + # a lot of non-interactive deployment scripts + self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # nosec self.logger = self._get_and_setup_logger() + # This object is lazily created on first SFTP operation (e.g. put() + # method call) + self.sftp_client = None + def connect(self): - conninfo = {'hostname': self.hostname, - 'port': self.port, - 'username': self.username, - 'allow_agent': False, - 'look_for_keys': False} + conninfo = { + "hostname": self.hostname, + "port": self.port, + "username": self.username, + "allow_agent": False, + "look_for_keys": False, + } if self.password: - conninfo['password'] = self.password + conninfo["password"] = self.password if self.key_files: - conninfo['key_filename'] = self.key_files + conninfo["key_filename"] = self.key_files if self.key_material: - conninfo['pkey'] = self._get_pkey_object(key=self.key_material) + conninfo["pkey"] = self._get_pkey_object(key=self.key_material, password=self.password) if not self.password and not (self.key_files or self.key_material): - conninfo['allow_agent'] = True - conninfo['look_for_keys'] = True + conninfo["allow_agent"] = True + conninfo["look_for_keys"] = True if self.timeout: - conninfo['timeout'] = self.timeout + conninfo["timeout"] = self.timeout + + # This is a workaround for paramiko only supporting key files in + # format staring with "BEGIN RSA PRIVATE KEY". + # If key_files are provided and a key looks like a PEM formatted key + # we try to convert it into a format supported by paramiko + if ( + self.key_files + and not isinstance(self.key_files, (list, tuple)) + and os.path.isfile(self.key_files) + ): + with open(self.key_files) as fp: + key_material = fp.read() - extra = {'_hostname': self.hostname, '_port': self.port, - '_username': self.username, '_timeout': self.timeout} - self.logger.debug('Connecting to server', extra=extra) + try: + pkey = self._get_pkey_object(key=key_material, password=self.password) + except paramiko.ssh_exception.PasswordRequiredException as e: + raise e + except Exception: + pass + else: + # It appears key is valid, but it was passed in in an invalid + # format. Try to use the converted key directly + del conninfo["key_filename"] + conninfo["pkey"] = pkey + + extra = { + "_hostname": self.hostname, + "_port": self.port, + "_username": self.username, + "_timeout": self.timeout, + } + + if self.password: + extra["_auth_method"] = "password" + else: + extra["_auth_method"] = "key_file" + + if self.key_files: + extra["_key_file"] = self.key_files + + self.logger.debug("Connecting to server", extra=extra) + + try: + self.client.connect(**conninfo) + except paramiko.ssh_exception.AuthenticationException as e: + # Special case to handle paramiko >= 2.9.0 which supports SHA-2 + # variants of the RSA key verification algorithm which don't work + # with older OpenSSH server versions (e.g. default setup on Ubuntu + # 14.04). + # Sadly there is no way for us to catch and retry on more specific + # / granular exception. + # See https://www.paramiko.org/changelog.html for details. + if ( + PARAMIKO_VERSION_TUPLE >= (2, 9, 0) + and LIBCLOUD_PARAMIKO_SHA2_BACKWARD_COMPATIBILITY + ): + self.logger.warn(SHA2_PUBKEY_NOT_SUPPORTED_AUTH_ERROR_MSG) + + conninfo["disabled_algorithms"] = {"pubkeys": ["rsa-sha2-256", "rsa-sha2-512"]} + self.client.connect(**conninfo) + else: + raise e - self.client.connect(**conninfo) return True - def put(self, path, contents=None, chmod=None, mode='w'): - extra = {'_path': path, '_mode': mode, '_chmod': chmod} - self.logger.debug('Uploading file', extra=extra) + def put(self, path, contents=None, chmod=None, mode="w"): + extra = {"_path": path, "_mode": mode, "_chmod": chmod} + self.logger.debug("Uploading file", extra=extra) + + sftp = self._get_sftp_client() - sftp = self.client.open_sftp() # less than ideal, but we need to mkdir stuff otherwise file() fails head, tail = psplit(path) @@ -276,37 +429,77 @@ def put(self, path, contents=None, chmod=None, mode='w'): sftp.chdir("/") else: # Relative path - start from a home directory (~) - sftp.chdir('.') + sftp.chdir(".") for part in head.split("/"): if part != "": try: sftp.mkdir(part) - except IOError: + except OSError: # so, there doesn't seem to be a way to # catch EEXIST consistently *sigh* pass sftp.chdir(part) cwd = sftp.getcwd() + cwd = self._sanitize_cwd(cwd=cwd) ak = sftp.file(tail, mode=mode) ak.write(contents) if chmod is not None: ak.chmod(chmod) ak.close() - sftp.close() - if path[0] == '/': - file_path = path + file_path = self._sanitize_file_path(cwd=cwd, file_path=path) + return file_path + + def putfo(self, path, fo=None, chmod=None): + """ + Upload file like object to the remote server. + + Unlike put(), this method operates on file objects and not directly on + file content which makes it much more efficient for large files since + it utilizes pipelining. + """ + extra = {"_path": path, "_chmod": chmod} + self.logger.debug("Uploading file", extra=extra) + + sftp = self._get_sftp_client() + + # less than ideal, but we need to mkdir stuff otherwise file() fails + head, tail = psplit(path) + + if path[0] == "/": + sftp.chdir("/") else: - file_path = pjoin(cwd, path) + # Relative path - start from a home directory (~) + sftp.chdir(".") + + for part in head.split("/"): + if part != "": + try: + sftp.mkdir(part) + except OSError: + # so, there doesn't seem to be a way to + # catch EEXIST consistently *sigh* + pass + sftp.chdir(part) + + cwd = sftp.getcwd() + cwd = self._sanitize_cwd(cwd=cwd) + sftp.putfo(fo, path) + if chmod is not None: + ak = sftp.file(tail) + ak.chmod(chmod) + ak.close() + + file_path = self._sanitize_file_path(cwd=cwd, file_path=path) return file_path def delete(self, path): - extra = {'_path': path} - self.logger.debug('Deleting file', extra=extra) + extra = {"_path": path} + self.logger.debug("Deleting file", extra=extra) sftp = self.client.open_sftp() sftp.unlink(path) @@ -314,6 +507,7 @@ def delete(self, path): return True def run(self, cmd, timeout=None): + # type: (str, Optional[float]) -> Tuple[str, str, int] """ Note: This function is based on paramiko's exec_command() method. @@ -322,13 +516,14 @@ def run(self, cmd, timeout=None): finish (optional). :type timeout: ``float`` """ - extra = {'_cmd': cmd} - self.logger.debug('Executing command', extra=extra) + extra1 = {"_cmd": cmd} + self.logger.debug("Executing command", extra=extra1) # Use the system default buffer size bufsize = -1 - transport = self.client.get_transport() + transport = self._get_transport() + chan = transport.open_session() start_time = time.time() @@ -339,7 +534,7 @@ def run(self, cmd, timeout=None): # Create a stdin file and immediately close it to prevent any # interactive script from hanging the process. - stdin = chan.makefile('wb', bufsize) + stdin = chan.makefile("wb", bufsize) stdin.close() # Receive all the output @@ -352,42 +547,31 @@ def run(self, cmd, timeout=None): # which is not ready will block for indefinitely. exit_status_ready = chan.exit_status_ready() + if exit_status_ready: + # It's possible that some data is already available when exit + # status is ready + stdout.write(self._consume_stdout(chan).getvalue()) + stderr.write(self._consume_stderr(chan).getvalue()) + while not exit_status_ready: current_time = time.time() - elapsed_time = (current_time - start_time) + elapsed_time = current_time - start_time if timeout and (elapsed_time > timeout): # TODO: Is this the right way to clean up? chan.close() - raise SSHCommandTimeoutError(cmd=cmd, timeout=timeout) - - if chan.recv_ready(): - data = chan.recv(self.CHUNK_SIZE) - - while data: - stdout.write(b(data).decode('utf-8')) - ready = chan.recv_ready() + stdout_str = stdout.getvalue() # type: str + stderr_str = stderr.getvalue() # type: str + raise SSHCommandTimeoutError( + cmd=cmd, timeout=timeout, stdout=stdout_str, stderr=stderr_str + ) - if not ready: - break - - data = chan.recv(self.CHUNK_SIZE) - - if chan.recv_stderr_ready(): - data = chan.recv_stderr(self.CHUNK_SIZE) - - while data: - stderr.write(b(data).decode('utf-8')) - ready = chan.recv_stderr_ready() - - if not ready: - break - - data = chan.recv_stderr(self.CHUNK_SIZE) + stdout.write(self._consume_stdout(chan).getvalue()) + stderr.write(self._consume_stderr(chan).getvalue()) # We need to check the exist status here, because the command could - # print some output and exit during this sleep bellow. + # print some output and exit during this sleep below. exit_status_ready = chan.exit_status_ready() if exit_status_ready: @@ -397,39 +581,220 @@ def run(self, cmd, timeout=None): time.sleep(self.SLEEP_DELAY) # Receive the exit status code of the command we ran. - status = chan.recv_exit_status() + status = chan.recv_exit_status() # type: int - stdout = stdout.getvalue() - stderr = stderr.getvalue() + stdout_str = stdout.getvalue() + stderr_str = stderr.getvalue() - extra = {'_status': status, '_stdout': stdout, '_stderr': stderr} - self.logger.debug('Command finished', extra=extra) + extra2 = {"_status": status, "_stdout": stdout_str, "_stderr": stderr_str} + self.logger.debug("Command finished", extra=extra2) - return [stdout, stderr, status] + result = (stdout_str, stderr_str, status) # type: Tuple[str, str, int] + return result def close(self): - self.logger.debug('Closing server connection') + self.logger.debug("Closing server connection") + + if self.client: + self.client.close() + + if self.sftp_client: + self.sftp_client.close() - self.client.close() return True - def _get_pkey_object(self, key): + def _consume_stdout(self, chan): + """ + Try to consume stdout data from chan if it's receive ready. + """ + stdout = self._consume_data_from_channel( + chan=chan, recv_method=chan.recv, recv_ready_method=chan.recv_ready + ) + return stdout + + def _consume_stderr(self, chan): + """ + Try to consume stderr data from chan if it's receive ready. + """ + stderr = self._consume_data_from_channel( + chan=chan, + recv_method=chan.recv_stderr, + recv_ready_method=chan.recv_stderr_ready, + ) + return stderr + + def _consume_data_from_channel(self, chan, recv_method, recv_ready_method): + """ + Try to consume data from the provided channel. + + Keep in mind that data is only consumed if the channel is receive + ready. + """ + result = StringIO() + result_bytes = bytearray() + + if recv_ready_method(): + data = recv_method(self.CHUNK_SIZE) + result_bytes += b(data) + + while data: + ready = recv_ready_method() + + if not ready: + break + + data = recv_method(self.CHUNK_SIZE) + result_bytes += b(data) + + # We only decode data at the end because a single chunk could contain + # a part of multi byte UTF-8 character (whole multi bytes character + # could be split over two chunks) + result.write(result_bytes.decode("utf-8", errors="ignore")) + return result + + def _get_pkey_object(self, key, password=None): """ Try to detect private key type and return paramiko.PKey object. + + # NOTE: Paramiko only supports key in PKCS#1 PEM format. """ + key_types = [ + (paramiko.RSAKey, "RSA"), + (paramiko.ECDSAKey, "EC"), + ] + + paramiko_version = getattr(paramiko, "__version__", "0.0.0") + paramiko_version = tuple(int(c) for c in paramiko_version.split(".")) + + if paramiko_version < (4, 0, 0): + # DSSKey removed in paramiko 4.0.0 + dss_key_cls = getattr(paramiko, "DSSKey", None) + if dss_key_cls: + key_types.insert(1, (dss_key_cls, "DSA")) + if paramiko_version >= (2, 2, 0): + # Ed25519 is only supported in paramiko >= 2.2.0 + key_types.append((paramiko.ed25519key.Ed25519Key, "Ed25519")) + + for cls, key_type in key_types: + # Work around for paramiko not recognizing keys which start with + # "----BEGIN PRIVATE KEY-----" + # Since key is already in PEM format, we just try changing the + # header and footer + key_split = key.strip().splitlines() + if ( + key_split[0] == "-----BEGIN PRIVATE KEY-----" + and key_split[-1] == "-----END PRIVATE KEY-----" + ): + key_split[0] = "-----BEGIN %s PRIVATE KEY-----" % (key_type) + key_split[-1] = "-----END %s PRIVATE KEY-----" % (key_type) + + key_value = "\n".join(key_split) + else: + # Already a valid key, us it as is + key_value = key - for cls in [paramiko.RSAKey, paramiko.DSSKey, paramiko.ECDSAKey]: try: - key = cls.from_private_key(StringIO(key)) - except paramiko.ssh_exception.SSHException: + key = cls.from_private_key(StringIO(key_value), password) + except paramiko.ssh_exception.PasswordRequiredException as e: + raise e + except (paramiko.ssh_exception.SSHException, AssertionError) as e: + if "private key file checkints do not match" in str(e).lower(): + msg = "Invalid password provided for encrypted key. " "Original error: %s" % ( + str(e) + ) + # Indicates invalid password for password protected keys + raise paramiko.ssh_exception.SSHException(msg) + # Invalid key, try other key type pass else: return key - msg = 'Invalid or unsupported key type' + msg = ( + "Invalid or unsupported key type (only RSA, DSS, ECDSA and" + " Ed25519 keys" + " in PEM format are supported). For more information on " + " supported key file types, see %s" % (SUPPORTED_KEY_TYPES_URL) + ) raise paramiko.ssh_exception.SSHException(msg) + def _sanitize_cwd(self, cwd): + # type: (str) -> str + # getcwd() returns an invalid path when executing commands on Windows + # so we need a special case for that scenario + # For example, we convert /C:/Users/Foo -> C:/Users/Foo + if re.match(r"^\/\w\:.*$", str(cwd)): + cwd = str(cwd[1:]) + + return cwd + + def _sanitize_file_path(self, cwd, file_path): + # type: (str, str) -> str + """ + Sanitize the provided file path and ensure we always return an + absolute path, even if relative path is passed to to this function. + """ + + if file_path[0] in ["/", "\\"] or re.match(r"^\w\:.*$", file_path): + # If it's an absolute path we return path as is + # NOTE: We assume it's a Windows absolute path if it's starts with + # a drive letter - e.g. C:\\..., D:\\, etc. or with \ + pass + else: + if re.match(r"^\w\:.*$", cwd): + # Windows path + file_path = cwd + "\\" + file_path + else: + file_path = pjoin(cwd, file_path) + + return file_path + + def _get_transport(self): + """ + Return transport object taking into account keep alive and compression + options passed to the constructor. + """ + transport = self.client.get_transport() + + if self.keep_alive: + transport.set_keepalive(self.keep_alive) + + if self.use_compression: + transport.use_compression(compress=True) + + return transport + + def _get_sftp_client(self): + """ + Create SFTP client from the underlying SSH client. + + This method tries to reuse the existing self.sftp_client (if it + exists) and it also tries to verify the connection is opened and if + it's not, it will try to re-establish it. + """ + if not self.sftp_client: + self.sftp_client = self.client.open_sftp() + + sftp_client = self.sftp_client + + # Verify the connection is still open, if it's not, try to + # re-establish it. + # We do that, by calling listdir(). If it returns "Socket is closed" + # error we assume the connection is closed and we try to re-establish + # it. + try: + sftp_client.listdir(".") + except OSError as e: + if "socket is closed" in str(e).lower(): + self.sftp_client = self.client.open_sftp() + elif "no such file" in str(e).lower(): + # Not a fatal exception, means connection is still open + pass + else: + raise e + + return self.sftp_client + class ShellOutSSHClient(BaseSSHClient): """ @@ -439,23 +804,33 @@ class ShellOutSSHClient(BaseSSHClient): Note: This client should not be used in production. """ - def __init__(self, hostname, port=22, username='root', password=None, - key=None, key_files=None, timeout=None): - super(ShellOutSSHClient, self).__init__(hostname=hostname, - port=port, username=username, - password=password, - key=key, - key_files=key_files, - timeout=timeout) + def __init__( + self, + hostname, # type: str + port=22, # type: int + username="root", # type: str + password=None, # type: Optional[str] + key=None, # type: Optional[str] + key_files=None, # type: Optional[str] + timeout=None, # type: Optional[float] + ): + super().__init__( + hostname=hostname, + port=port, + username=username, + password=password, + key=key, + key_files=key_files, + timeout=timeout, + ) if self.password: - raise ValueError('ShellOutSSHClient only supports key auth') + raise ValueError("ShellOutSSHClient only supports key auth") - child = subprocess.Popen(['ssh'], stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + child = subprocess.Popen(["ssh"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) child.communicate() if child.returncode == 127: - raise ValueError('ssh client is not available') + raise ValueError("ssh client is not available") self.logger = self._get_and_setup_logger() @@ -466,23 +841,27 @@ def connect(self): """ return True - def run(self, cmd): + def run(self, cmd, timeout=None): return self._run_remote_shell_command([cmd]) - def put(self, path, contents=None, chmod=None, mode='w'): - if mode == 'w': - redirect = '>' - elif mode == 'a': - redirect = '>>' + def put(self, path, contents=None, chmod=None, mode="w"): + if mode == "w": + redirect = ">" + elif mode == "a": + redirect = ">>" else: - raise ValueError('Invalid mode: ' + mode) + raise ValueError("Invalid mode: " + mode) - cmd = ['echo "%s" %s %s' % (contents, redirect, path)] + cmd = ['echo "{}" {} {}'.format(contents, redirect, path)] self._run_remote_shell_command(cmd) return path + def putfo(self, path, fo=None, chmod=None): + content = fo.read() + return self.put(path=path, contents=content, chmod=chmod) + def delete(self, path): - cmd = ['rm', '-rf', path] + cmd = ["rm", "-rf", path] self._run_remote_shell_command(cmd) return True @@ -490,19 +869,22 @@ def close(self): return True def _get_base_ssh_command(self): - cmd = ['ssh'] + # type: () -> List[str] + cmd = ["ssh"] if self.key_files: - cmd += ['-i', self.key_files] + self.key_files = cast(str, self.key_files) + cmd += ["-i", self.key_files] if self.timeout: - cmd += ['-oConnectTimeout=%s' % (self.timeout)] + cmd += ["-oConnectTimeout=%s" % (self.timeout)] - cmd += ['%s@%s' % (self.username, self.hostname)] + cmd += ["{}@{}".format(self.username, self.hostname)] return cmd def _run_remote_shell_command(self, cmd): + # type: (List[str]) -> Tuple[str, str, int] """ Run a command on a remote server. @@ -513,20 +895,23 @@ def _run_remote_shell_command(self, cmd): :rtype: ``tuple`` """ base_cmd = self._get_base_ssh_command() - full_cmd = base_cmd + [' '.join(cmd)] + full_cmd = base_cmd + [" ".join(cmd)] - self.logger.debug('Executing command: "%s"' % (' '.join(full_cmd))) + self.logger.debug('Executing command: "%s"' % (" ".join(full_cmd))) - child = subprocess.Popen(full_cmd, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + child = subprocess.Popen(full_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = child.communicate() - return (stdout, stderr, child.returncode) + + stdout_str = cast(str, stdout) + stderr_str = cast(str, stdout) + + return (stdout_str, stderr_str, child.returncode) class MockSSHClient(BaseSSHClient): pass -SSHClient = ParamikoSSHClient +SSHClient = ParamikoSSHClient # type: Type[BaseSSHClient] if not have_paramiko: - SSHClient = MockSSHClient + SSHClient = MockSSHClient # type: ignore diff --git a/libcloud/compute/types.py b/libcloud/compute/types.py index 216d46ea1b..1ff5983c28 100644 --- a/libcloud/compute/types.py +++ b/libcloud/compute/types.py @@ -16,237 +16,281 @@ Base types used by other parts of libcloud """ -from libcloud.common.types import LibcloudError, MalformedResponseError -from libcloud.common.types import InvalidCredsError, InvalidCredsException +from libcloud.common.types import ( + Type, + LibcloudError, + InvalidCredsError, + InvalidCredsException, + MalformedResponseError, +) __all__ = [ "Provider", "NodeState", "DeploymentError", "DeploymentException", - # @@TR: should the unused imports below be exported? "LibcloudError", "MalformedResponseError", "InvalidCredsError", "InvalidCredsException", - "DEPRECATED_RACKSPACE_PROVIDERS", - "OLD_CONSTANT_TO_NEW_MAPPING" + "OLD_CONSTANT_TO_NEW_MAPPING", ] -class Provider(object): +class Provider(Type): """ Defines for each of the supported providers + Non-Dummy drivers are sorted in alphabetical order. Please preserve this + ordering when adding new drivers. + :cvar DUMMY: Example provider - :cvar EC2_US_EAST: Amazon AWS US N. Virgina - :cvar EC2_US_WEST: Amazon AWS US N. California - :cvar EC2_EU_WEST: Amazon AWS EU Ireland - :cvar RACKSPACE: Rackspace next-gen OpenStack based Cloud Servers - :cvar RACKSPACE_FIRST_GEN: Rackspace First Gen Cloud Servers + :cvar ABIQUO: Abiquo driver + :cvar ALIYUN_ECS: Aliyun ECS driver. + :cvar AURORACOMPUTE: Aurora Compute driver. + :cvar AZURE: Azure (classic) driver. + :cvar AZURE_ARM: Azure Resource Manager (modern) driver. + :cvar CLOUDSIGMA: CloudSigma + :cvar CLOUDSCALE: cloudscale.ch + :cvar CLOUDSTACK: CloudStack + :cvar DIMENSIONDATA: Dimension Data Cloud + :cvar EC2: Amazon AWS. + :cvar EXOSCALE: Exoscale driver. :cvar GCE: Google Compute Engine - :cvar GOGRID: GoGrid - :cvar VPSNET: VPS.net - :cvar LINODE: Linode.com - :cvar VCLOUD: vmware vCloud - :cvar RIMUHOSTING: RimuHosting.com - :cvar ECP: Enomaly + :cvar GRIDSCALE: gridscale :cvar IBM: IBM Developer Cloud - :cvar OPENNEBULA: OpenNebula.org - :cvar DREAMHOST: DreamHost Private Server - :cvar ELASTICHOSTS: ElasticHosts.com - :cvar CLOUDSIGMA: CloudSigma + :cvar IKOULA: Ikoula driver. + :cvar KAMATERA: Kamatera driver + :cvar KTUCLOUD: kt ucloud driver + :cvar KUBEVIRT: kubevirt driver + :cvar LIBVIRT: Libvirt driver + :cvar LINODE: Linode.com :cvar NIMBUS: Nimbus - :cvar BLUEBOX: Bluebox - :cvar OPSOURCE: Opsource Cloud :cvar NINEFOLD: Ninefold + :cvar NTTC-CIS: NTT Communications CIS + :cvar OPENNEBULA: OpenNebula.org + :cvar OPSOURCE: Opsource Cloud + :cvar OUTSCALE_INC: Outscale INC driver. + :cvar OUTSCALE_SAS: Outscale SAS driver. + :cvar OUTSCALE_SDK: Outscale SDK driver. + :cvar RACKSPACE: Rackspace next-gen OpenStack based Cloud Servers + :cvar RACKSPACE_FIRST_GEN: Rackspace First Gen Cloud Servers + :cvar RIMUHOSTING: RimuHosting.com :cvar TERREMARK: Terremark - :cvar EC2_US_WEST_OREGON: Amazon AWS US West 2 (Oregon) - :cvar CLOUDSTACK: CloudStack - :cvar CLOUDSIGMA_US: CloudSigma US Las Vegas - :cvar LIBVIRT: Libvirt driver - :cvar JOYENT: Joyent driver + :cvar UPCLOUD: UpCloud :cvar VCL: VCL driver - :cvar KTUCLOUD: kt ucloud driver - :cvar GRIDSPOT: Gridspot driver - :cvar ABIQUO: Abiquo driver - :cvar NEPHOSCALE: NephoScale driver - :cvar EXOSCALE: Exoscale driver. - :cvar IKOULA: Ikoula driver. - :cvar OUTSCALE_SAS: Outscale SAS driver. - :cvar OUTSCALE_INC: Outscale INC driver. - :cvar PROFIT_BRICKS: ProfitBricks driver. + :cvar VCLOUD: vmware vCloud + :cvar VPSNET: VPS.net + :cvar VSphere: VSphere driver. :cvar VULTR: vultr driver. - :cvar AZURE: Azure driver. - :cvar AURORACOMPUTE: Aurora Compute driver. """ - AZURE = 'azure' - DUMMY = 'dummy' - EC2 = 'ec2_us_east' - RACKSPACE = 'rackspace' - GCE = 'gce' - GOGRID = 'gogrid' - VPSNET = 'vpsnet' - LINODE = 'linode' - VCLOUD = 'vcloud' - RIMUHOSTING = 'rimuhosting' - VOXEL = 'voxel' - SOFTLAYER = 'softlayer' - EUCALYPTUS = 'eucalyptus' - ECP = 'ecp' - IBM = 'ibm' - OPENNEBULA = 'opennebula' - DREAMHOST = 'dreamhost' - ELASTICHOSTS = 'elastichosts' - BRIGHTBOX = 'brightbox' - CLOUDSIGMA = 'cloudsigma' - NIMBUS = 'nimbus' - BLUEBOX = 'bluebox' - GANDI = 'gandi' - OPSOURCE = 'opsource' - OPENSTACK = 'openstack' - SKALICLOUD = 'skalicloud' - SERVERLOVE = 'serverlove' - NINEFOLD = 'ninefold' - TERREMARK = 'terremark' - CLOUDSTACK = 'cloudstack' - LIBVIRT = 'libvirt' - JOYENT = 'joyent' - VCL = 'vcl' - KTUCLOUD = 'ktucloud' - GRIDSPOT = 'gridspot' - RACKSPACE_FIRST_GEN = 'rackspace_first_gen' - HOSTVIRTUAL = 'hostvirtual' - ABIQUO = 'abiquo' - DIGITAL_OCEAN = 'digitalocean' - NEPHOSCALE = 'nephoscale' - CLOUDFRAMES = 'cloudframes' - EXOSCALE = 'exoscale' - IKOULA = 'ikoula' - OUTSCALE_SAS = 'outscale_sas' - OUTSCALE_INC = 'outscale_inc' - VSPHERE = 'vsphere' - PROFIT_BRICKS = 'profitbricks' - VULTR = 'vultr' - AURORACOMPUTE = 'aurora_compute' + + AZURE = "azure" + AZURE_ARM = "azure_arm" + DUMMY = "dummy" + ABIQUO = "abiquo" + ALIYUN_ECS = "aliyun_ecs" + AURORACOMPUTE = "aurora_compute" + BRIGHTBOX = "brightbox" + CISCOCCS = "ciscoccs" + CLOUDFRAMES = "cloudframes" + CLOUDSIGMA = "cloudsigma" + CLOUDSCALE = "cloudscale" + CLOUDSTACK = "cloudstack" + DIGITAL_OCEAN = "digitalocean" + DIMENSIONDATA = "dimensiondata" + EC2 = "ec2" + EQUINIXMETAL = "equinixmetal" + EUCALYPTUS = "eucalyptus" + EXOSCALE = "exoscale" + GANDI = "gandi" + GCE = "gce" + GIG_G8 = "gig_g8" + GRIDSCALE = "gridscale" + IBM = "ibm" + IKOULA = "ikoula" + INTERNETSOLUTIONS = "internetsolutions" + KAMATERA = "kamatera" + KTUCLOUD = "ktucloud" + KUBEVIRT = "kubevirt" + LIBVIRT = "libvirt" + LINODE = "linode" + MAXIHOST = "maxihost" + NIMBUS = "nimbus" + NINEFOLD = "ninefold" + NTTA = "ntta" + NTTCIS = "nttcis" + OPENNEBULA = "opennebula" + OPENSTACK = "openstack" + OPSOURCE = "opsource" + OUTSCALE_INC = "outscale_inc" + OUTSCALE_SAS = "outscale_sas" + OUTSCALE = "outscale" + OVH = "ovh" + RACKSPACE = "rackspace" + RACKSPACE_FIRST_GEN = "rackspace_first_gen" + RIMUHOSTING = "rimuhosting" + RUNABOVE = "runabove" + SCALEWAY = "scaleway" + TERREMARK = "terremark" + UPCLOUD = "upcloud" + VCL = "vcl" + VCLOUD = "vcloud" + VPSNET = "vpsnet" + VSPHERE = "vsphere" + VULTR = "vultr" # OpenStack based providers - HPCLOUD = 'hpcloud' - KILI = 'kili' - - # Deprecated constants which are still supported - EC2_US_EAST = 'ec2_us_east' - EC2_EU = 'ec2_eu_west' # deprecated name - EC2_EU_WEST = 'ec2_eu_west' - EC2_US_WEST = 'ec2_us_west' - EC2_AP_SOUTHEAST = 'ec2_ap_southeast' - EC2_AP_NORTHEAST = 'ec2_ap_northeast' - EC2_US_WEST_OREGON = 'ec2_us_west_oregon' - EC2_SA_EAST = 'ec2_sa_east' - EC2_AP_SOUTHEAST2 = 'ec2_ap_southeast_2' - - ELASTICHOSTS_UK1 = 'elastichosts_uk1' - ELASTICHOSTS_UK2 = 'elastichosts_uk2' - ELASTICHOSTS_US1 = 'elastichosts_us1' - ELASTICHOSTS_US2 = 'elastichosts_us2' - ELASTICHOSTS_US3 = 'elastichosts_us3' - ELASTICHOSTS_CA1 = 'elastichosts_ca1' - ELASTICHOSTS_AU1 = 'elastichosts_au1' - ELASTICHOSTS_CN1 = 'elastichosts_cn1' - - CLOUDSIGMA_US = 'cloudsigma_us' + HPCLOUD = "hpcloud" + ONAPP = "onapp" # Deprecated constants which aren't supported anymore - RACKSPACE_UK = 'rackspace_uk' - RACKSPACE_NOVA_BETA = 'rackspace_nova_beta' - RACKSPACE_NOVA_DFW = 'rackspace_nova_dfw' - RACKSPACE_NOVA_LON = 'rackspace_nova_lon' - RACKSPACE_NOVA_ORD = 'rackspace_nova_ord' + RACKSPACE_UK = "rackspace_uk" + RACKSPACE_NOVA_BETA = "rackspace_nova_beta" + RACKSPACE_NOVA_DFW = "rackspace_nova_dfw" + RACKSPACE_NOVA_LON = "rackspace_nova_lon" + RACKSPACE_NOVA_ORD = "rackspace_nova_ord" + + EC2_US_EAST = "ec2_us_east" + EC2_US_EAST_OHIO = "ec2_us_east_ohio" + EC2_EU = "ec2_eu_west" # deprecated name + EC2_EU_WEST = "ec2_eu_west" + EC2_EU_WEST2 = "ec2_eu_west_london" + EC2_US_WEST = "ec2_us_west" + EC2_AP_SOUTHEAST = "ec2_ap_southeast" + EC2_AP_NORTHEAST = "ec2_ap_northeast" + EC2_AP_NORTHEAST1 = "ec2_ap_northeast_1" + EC2_AP_NORTHEAST2 = "ec2_ap_northeast_2" + EC2_US_WEST_OREGON = "ec2_us_west_oregon" + EC2_SA_EAST = "ec2_sa_east" + EC2_AP_SOUTHEAST2 = "ec2_ap_southeast_2" + EC2_CA_CENTRAL1 = "ec2_ca_central_1" + + CLOUDSIGMA_US = "cloudsigma_us" # Removed # SLICEHOST = 'slicehost' -DEPRECATED_RACKSPACE_PROVIDERS = [Provider.RACKSPACE_UK, - Provider.RACKSPACE_NOVA_BETA, - Provider.RACKSPACE_NOVA_DFW, - Provider.RACKSPACE_NOVA_LON, - Provider.RACKSPACE_NOVA_ORD] +DEPRECATED_RACKSPACE_PROVIDERS = [ + Provider.RACKSPACE_UK, + Provider.RACKSPACE_NOVA_BETA, + Provider.RACKSPACE_NOVA_DFW, + Provider.RACKSPACE_NOVA_LON, + Provider.RACKSPACE_NOVA_ORD, +] OLD_CONSTANT_TO_NEW_MAPPING = { - Provider.RACKSPACE: Provider.RACKSPACE_FIRST_GEN, + # Rackspace Provider.RACKSPACE_UK: Provider.RACKSPACE_FIRST_GEN, - Provider.RACKSPACE_NOVA_BETA: Provider.RACKSPACE, Provider.RACKSPACE_NOVA_DFW: Provider.RACKSPACE, Provider.RACKSPACE_NOVA_LON: Provider.RACKSPACE, - Provider.RACKSPACE_NOVA_ORD: Provider.RACKSPACE + Provider.RACKSPACE_NOVA_ORD: Provider.RACKSPACE, + # AWS + Provider.EC2_US_EAST: Provider.EC2, + Provider.EC2_US_EAST_OHIO: Provider.EC2, + Provider.EC2_EU: Provider.EC2, + Provider.EC2_EU_WEST: Provider.EC2, + Provider.EC2_EU_WEST2: Provider.EC2, + Provider.EC2_US_WEST: Provider.EC2, + Provider.EC2_AP_SOUTHEAST: Provider.EC2, + Provider.EC2_AP_SOUTHEAST2: Provider.EC2, + Provider.EC2_AP_NORTHEAST: Provider.EC2, + Provider.EC2_AP_NORTHEAST1: Provider.EC2, + Provider.EC2_AP_NORTHEAST2: Provider.EC2, + Provider.EC2_US_WEST_OREGON: Provider.EC2, + Provider.EC2_SA_EAST: Provider.EC2, + Provider.EC2_CA_CENTRAL1: Provider.EC2, } -class NodeState(object): +class NodeState(Type): """ Standard states for a node :cvar RUNNING: Node is running. + :cvar STARTING: Node is starting up. :cvar REBOOTING: Node is rebooting. :cvar TERMINATED: Node is terminated. This node can't be started later on. + :cvar STOPPING: Node is currently trying to stop. :cvar STOPPED: Node is stopped. This node can be started later on. :cvar PENDING: Node is pending. - :cvar STOPPED: Node is stopped. :cvar SUSPENDED: Node is suspended. :cvar ERROR: Node is an error state. Usually no operations can be performed on the node once it ends up in the error state. :cvar PAUSED: Node is paused. + :cvar RECONFIGURING: Node is being reconfigured. :cvar UNKNOWN: Node state is unknown. """ - RUNNING = 0 - REBOOTING = 1 - TERMINATED = 2 - PENDING = 3 - UNKNOWN = 4 - STOPPED = 5 - SUSPENDED = 6 - ERROR = 7 - PAUSED = 8 - - @classmethod - def tostring(cls, value): - values = cls.__dict__ - values = dict([(key, string) for key, string in values.items() if - not key.startswith('__')]) - - for item_key, item_value in values.items(): - if value == item_value: - return item_key - - @classmethod - def fromstring(cls, value): - return getattr(cls, value.upper(), None) - - -class StorageVolumeState(object): + + RUNNING = "running" + STARTING = "starting" + REBOOTING = "rebooting" + TERMINATED = "terminated" + PENDING = "pending" + UNKNOWN = "unknown" + STOPPING = "stopping" + STOPPED = "stopped" + SUSPENDED = "suspended" + ERROR = "error" + PAUSED = "paused" + RECONFIGURING = "reconfiguring" + MIGRATING = "migrating" + NORMAL = "normal" + UPDATING = "updating" + + +class StorageVolumeState(Type): """ Standard states of a StorageVolume """ - AVAILABLE = 0 - ERROR = 1 - INUSE = 2 - CREATING = 3 - DELETING = 4 - DELETED = 5 - BACKUP = 6 - ATTACHING = 7 - UNKNOWN = 8 - - -class Architecture(object): + + AVAILABLE = "available" + ERROR = "error" + INUSE = "inuse" + CREATING = "creating" + DELETING = "deleting" + DELETED = "deleted" + BACKUP = "backup" + ATTACHING = "attaching" + UNKNOWN = "unknown" + MIGRATING = "migrating" + UPDATING = "updating" + + +class VolumeSnapshotState(Type): + """ + Standard states of VolumeSnapshots + """ + + AVAILABLE = "available" + ERROR = "error" + CREATING = "creating" + DELETING = "deleting" + RESTORING = "restoring" + UNKNOWN = "unknown" + UPDATING = "updating" + + +class NodeImageMemberState(Type): + """ + Standard states of VolumeSnapshots + """ + + ACCEPTED = "accepted" + PENDING = "pending" + REJECTED = "rejected" + + +class Architecture: """ Image and size architectures. :cvar I386: i386 (32 bt) :cvar X86_64: x86_64 (64 bit) """ + I386 = 0 X86_X64 = 1 @@ -258,37 +302,46 @@ class DeploymentError(LibcloudError): :ivar node: :class:`Node` on which this exception happened, you might want to call :func:`Node.destroy` """ + def __init__(self, node, original_exception=None, driver=None): self.node = node self.value = original_exception + self.original_error = original_exception self.driver = driver def __str__(self): return self.__repr__() def __repr__(self): - return (('' - % (self.node.id, str(self.value), str(self.driver)))) + return "".format( + self.node.id, + str(self.value), + str(self.driver), + ) class KeyPairError(LibcloudError): - error_type = 'KeyPairError' + error_type = "KeyPairError" def __init__(self, name, driver): self.name = name - self.value = 'Key pair with name %s does not exist' % (name) - super(KeyPairError, self).__init__(value=self.value, driver=driver) + self.value = "Key pair with name %s does not exist" % (name) + super().__init__(value=self.value, driver=driver) def __str__(self): return self.__repr__() def __repr__(self): - return ('<%s name=%s, value=%s, driver=%s>' % - (self.error_type, self.name, self.value, self.driver.name)) + return "<{} name={}, value={}, driver={}>".format( + self.error_type, + self.name, + self.value, + self.driver.name, + ) class KeyPairDoesNotExistError(KeyPairError): - error_type = 'KeyPairDoesNotExistError' + error_type = "KeyPairDoesNotExistError" """Deprecated alias of :class:`DeploymentException`""" diff --git a/libcloud/container/__init__.py b/libcloud/container/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/container/base.py b/libcloud/container/base.py new file mode 100644 index 0000000000..b684a6d4ee --- /dev/null +++ b/libcloud/container/base.py @@ -0,0 +1,472 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from typing import List, Optional + +from libcloud.common.base import BaseDriver, ConnectionUserAndKey +from libcloud.container.types import ContainerState + +__all__ = [ + "Container", + "ContainerImage", + "ContainerCluster", + "ClusterLocation", + "ContainerDriver", +] + + +class Container: + """ + Container. + """ + + def __init__( + self, + id, # type: str + name, # type: str + image, # type: ContainerImage + state, # type: ContainerState + ip_addresses, # type: List[str] + driver, # type: ContainerDriver + extra=None, # type: Optional[dict] + created_at=None, # type: Optional[str] + ): + """ + :param id: Container id. + :type id: ``str`` + + :param name: The name of the container. + :type name: ``str`` + + :param image: The image this container was deployed using. + :type image: :class:`.ContainerImage` + + :param state: The state of the container, e.g. running + :type state: :class:`libcloud.container.types.ContainerState` + + :param ip_addresses: A list of IP addresses for this container + :type ip_addresses: ``list`` of ``str`` + + :param driver: ContainerDriver instance. + :type driver: :class:`.ContainerDriver` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + """ + self.id = str(id) if id else None + self.name = name + self.image = image + self.state = state + self.ip_addresses = ip_addresses + self.driver = driver + self.extra = extra or {} + self.created_at = created_at + + def start(self): + # type: () -> Container + return self.driver.start_container(container=self) + + def stop(self): + # type: () -> Container + return self.driver.stop_container(container=self) + + def restart(self): + # type: () -> Container + return self.driver.restart_container(container=self) + + def destroy(self): + # type: () -> bool + return self.driver.destroy_container(container=self) + + def __repr__(self): + return "" % ( + self.id, + self.name, + self.state, + self.driver.name, + ) + + +class ContainerImage: + """ + Container Image. + """ + + def __init__( + self, + id, # type: str + name, # type: str + path, # type: str + version, # type: str + driver, # type: ContainerDriver + extra=None, # type: Optional[dict] + ): + """ + :param id: Container Image id. + :type id: ``str`` + + :param name: The name of the image. + :type name: ``str`` + + :param path: The path to the image + :type path: ``str`` + + :param version: The version of the image + :type version: ``str`` + + :param driver: ContainerDriver instance. + :type driver: :class:`.ContainerDriver` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + """ + self.id = str(id) if id else None + self.name = name + self.path = path + self.version = version + self.driver = driver + self.extra = extra or {} + + def deploy(self, name, parameters, cluster=None, start=True): + # type: (str, str, Optional[ContainerCluster], bool) -> Container + return self.driver.deploy_container( + name=name, image=self, parameters=parameters, cluster=cluster, start=start + ) + + def __repr__(self): + return "".format( + self.id, + self.name, + self.path, + ) + + +class ContainerCluster: + """ + A cluster group for containers + """ + + def __init__( + self, + id, # type: str + name, # type: str + driver, # type: ContainerDriver + extra=None, # type: Optional[dict] + ): + """ + :param id: Container Image id. + :type id: ``str`` + + :param name: The name of the image. + :type name: ``str`` + + :param driver: ContainerDriver instance. + :type driver: :class:`.ContainerDriver` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + """ + self.id = str(id) if id else None + self.name = name + self.driver = driver + self.extra = extra or {} + + def list_containers(self): + # type: () -> List[Container] + return self.driver.list_containers(cluster=self) + + def destroy(self): + # type: () -> bool + return self.driver.destroy_cluster(cluster=self) + + def __repr__(self): + return "".format( + self.id, + self.name, + self.driver.name, + ) + + +class ClusterLocation: + """ + A physical location where clusters can be. + + >>> from libcloud.container.drivers.dummy import DummyContainerDriver + >>> driver = DummyContainerDriver(0) + >>> location = driver.list_locations()[0] + >>> location.country + 'US' + """ + + def __init__( + self, + id, # type: str + name, # type: str + country, # type: str + driver, # type: ContainerDriver + ): + """ + :param id: Location ID. + :type id: ``str`` + + :param name: Location name. + :type name: ``str`` + + :param country: Location country. + :type country: ``str`` + + :param driver: Driver this location belongs to. + :type driver: :class:`.ContainerDriver` + """ + self.id = str(id) + self.name = name + self.country = country + self.driver = driver + + def __repr__(self): + return ("") % ( + self.id, + self.name, + self.country, + self.driver.name, + ) + + +class ContainerDriver(BaseDriver): + """ + A base ContainerDriver class to derive from + + This class is always subclassed by a specific driver. + """ + + connectionCls = ConnectionUserAndKey + name = None + website = None + supports_clusters = False + """ + Whether the driver supports containers being deployed into clusters + """ + + def __init__(self, key, secret=None, secure=True, host=None, port=None, **kwargs): + """ + :param key: API key or username to used (required) + :type key: ``str`` + + :param secret: Secret password to be used (required) + :type secret: ``str`` + + :param secure: Whether to use HTTPS or HTTP. Note: Some providers + only support HTTPS, and it is on by default. + :type secure: ``bool`` + + :param host: Override hostname used for connections. + :type host: ``str`` + + :param port: Override port used for connections. + :type port: ``int`` + + :return: ``None`` + """ + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port, **kwargs) + + def install_image(self, path): + # type: (str) -> ContainerImage + """ + Install a container image from a remote path. + + :param path: Path to the container image + :type path: ``str`` + + :rtype: :class:`.ContainerImage` + """ + raise NotImplementedError("install_image not implemented for this driver") + + def list_images(self): + # type: () -> List[ContainerImage] + """ + List the installed container images + + :rtype: ``list`` of :class:`.ContainerImage` + """ + raise NotImplementedError("list_images not implemented for this driver") + + def list_containers( + self, + image=None, # type: Optional[ContainerImage] + cluster=None, # type: Optional[ContainerCluster] + ): + # type: (...) -> List[Container] + """ + List the deployed container images + + :param image: Filter to containers with a certain image + :type image: :class:`.ContainerImage` + + :param cluster: Filter to containers in a cluster + :type cluster: :class:`.ContainerCluster` + + :rtype: ``list`` of :class:`.Container` + """ + raise NotImplementedError("list_containers not implemented for this driver") + + def deploy_container( + self, + name, # type: str + image, # type: ContainerImage + cluster=None, # type: Optional[ContainerCluster] + parameters=None, # type: Optional[str] + start=True, # type: bool + ): + # type: (...) -> Container + """ + Deploy an installed container image + + :param name: The name of the new container + :type name: ``str`` + + :param image: The container image to deploy + :type image: :class:`.ContainerImage` + + :param cluster: The cluster to deploy to, None is default + :type cluster: :class:`.ContainerCluster` + + :param parameters: Container Image parameters + :type parameters: ``str`` + + :param start: Start the container on deployment + :type start: ``bool`` + + :rtype: :class:`.Container` + """ + raise NotImplementedError("deploy_container not implemented for this driver") + + def get_container(self, id): + # type: (str) -> Container + """ + Get a container by ID + + :param id: The ID of the container to get + :type id: ``str`` + + :rtype: :class:`.Container` + """ + raise NotImplementedError("get_container not implemented for this driver") + + def start_container(self, container): + # type: (Container) -> Container + """ + Start a deployed container + + :param container: The container to start + :type container: :class:`.Container` + + :rtype: :class:`.Container` + """ + raise NotImplementedError("start_container not implemented for this driver") + + def stop_container(self, container): + # type: (Container) -> Container + """ + Stop a deployed container + + :param container: The container to stop + :type container: :class:`.Container` + + :rtype: :class:`.Container` + """ + raise NotImplementedError("stop_container not implemented for this driver") + + def restart_container(self, container): + # type: (Container) -> Container + """ + Restart a deployed container + + :param container: The container to restart + :type container: :class:`.Container` + + :rtype: :class:`.Container` + """ + raise NotImplementedError("restart_container not implemented for this driver") + + def destroy_container(self, container): + # type: (Container) -> bool + """ + Destroy a deployed container + + :param container: The container to destroy + :type container: :class:`.Container` + + :rtype: ``bool`` + """ + raise NotImplementedError("destroy_container not implemented for this driver") + + def list_locations(self): + # type: () -> List[ClusterLocation] + """ + Get a list of potential locations to deploy clusters into + + :rtype: ``list`` of :class:`.ClusterLocation` + """ + raise NotImplementedError("list_locations not implemented for this driver") + + def create_cluster(self, name, location=None): + # type: (str, Optional[ClusterLocation]) -> ContainerCluster + """ + Create a container cluster + + :param name: The name of the cluster + :type name: ``str`` + + :param location: The location to create the cluster in + :type location: :class:`.ClusterLocation` + + :rtype: :class:`.ContainerCluster` + """ + raise NotImplementedError("create_cluster not implemented for this driver") + + def destroy_cluster(self, cluster): + # type: (ContainerCluster) -> bool + """ + Delete a cluster + + :return: ``True`` if the destroy was successful, otherwise ``False``. + :rtype: ``bool`` + """ + raise NotImplementedError("destroy_cluster not implemented for this driver") + + def list_clusters(self, location=None): + # type: (Optional[ClusterLocation]) -> List[ContainerCluster] + """ + Get a list of potential locations to deploy clusters into + + :param location: The location to search in + :type location: :class:`.ClusterLocation` + + :rtype: ``list`` of :class:`.ContainerCluster` + """ + raise NotImplementedError("list_clusters not implemented for this driver") + + def get_cluster(self, id): + # type: (str) -> ContainerCluster + """ + Get a cluster by ID + + :param id: The ID of the cluster to get + :type id: ``str`` + + :rtype: :class:`.ContainerCluster` + """ + raise NotImplementedError("list_clusters not implemented for this driver") diff --git a/libcloud/container/drivers/__init__.py b/libcloud/container/drivers/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/container/drivers/docker.py b/libcloud/container/drivers/docker.py new file mode 100644 index 0000000000..d292f24b85 --- /dev/null +++ b/libcloud/container/drivers/docker.py @@ -0,0 +1,809 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import re +import shlex +import base64 +import datetime + +from libcloud.utils.py3 import b, httplib +from libcloud.common.base import JsonResponse, ConnectionUserAndKey, KeyCertificateConnection +from libcloud.common.types import InvalidCredsError +from libcloud.container.base import Container, ContainerImage, ContainerDriver +from libcloud.container.types import ContainerState +from libcloud.container.providers import Provider + +try: + import simplejson as json +except Exception: + import json + + +VALID_RESPONSE_CODES = [ + httplib.OK, + httplib.ACCEPTED, + httplib.CREATED, + httplib.NO_CONTENT, +] + + +class DockerResponse(JsonResponse): + valid_response_codes = [ + httplib.OK, + httplib.ACCEPTED, + httplib.CREATED, + httplib.NO_CONTENT, + ] + + def parse_body(self): + if len(self.body) == 0 and not self.parse_zero_length_body: + return self.body + + try: + # error responses are tricky in Docker. Eg response could be + # an error, but response status could still be 200 + content_type = self.headers.get("content-type", "application/json") + if content_type == "application/json" or content_type == "": + if ( + self.headers.get("transfer-encoding") == "chunked" + and "fromImage" in self.request.url + ): + body = [ + json.loads(chunk) + for chunk in self.body.strip().replace("\r", "").split("\n") + ] + else: + body = json.loads(self.body) + else: + body = self.body + except ValueError: + m = re.search('Error: (.+?)"', self.body) + if m: + error_msg = m.group(1) + raise Exception(error_msg) + else: + raise Exception("ConnectionError: Failed to parse JSON response") + return body + + def parse_error(self): + if self.status == 401: + raise InvalidCredsError("Invalid credentials") + return self.body + + def success(self): + return self.status in self.valid_response_codes + + +class DockerException(Exception): + def __init__(self, code, message): + self.code = code + self.message = message + self.args = (code, message) + + def __str__(self): + return "{} {}".format(self.code, self.message) + + def __repr__(self): + return "DockerException {} {}".format(self.code, self.message) + + +class DockerConnection(ConnectionUserAndKey): + responseCls = DockerResponse + timeout = 60 + + def add_default_headers(self, headers): + """ + Add parameters that are necessary for every request + If user and password are specified, include a base http auth + header + """ + headers["Content-Type"] = "application/json" + if self.user_id and self.key: + user_b64 = base64.b64encode(b("{}:{}".format(self.user_id, self.key))) + headers["Authorization"] = "Basic %s" % (user_b64.decode("utf-8")) + return headers + + +class DockertlsConnection(KeyCertificateConnection): + responseCls = DockerResponse + + def __init__( + self, + key, + secret, + secure=True, + host="localhost", + port=4243, + key_file="", + cert_file="", + **kwargs, + ): + super().__init__( + key_file=key_file, + cert_file=cert_file, + secure=secure, + host=host, + port=port, + url=None, + proxy_url=None, + timeout=None, + backoff=None, + retry_delay=None, + ) + if key_file: + keypath = os.path.expanduser(key_file) + is_file_path = os.path.exists(keypath) and os.path.isfile(keypath) + if not is_file_path: + raise InvalidCredsError( + "You need an key PEM file to authenticate with " + "Docker tls. This can be found in the server." + ) + self.key_file = key_file + + certpath = os.path.expanduser(cert_file) + is_file_path = os.path.exists(certpath) and os.path.isfile(certpath) + if not is_file_path: + raise InvalidCredsError( + "You need an certificate PEM file to authenticate with " + "Docker tls. This can be found in the server." + ) + self.cert_file = cert_file + + def add_default_headers(self, headers): + headers["Content-Type"] = "application/json" + return headers + + +class DockerContainerDriver(ContainerDriver): + """ + Docker container driver class. + + >>> from libcloud.container.providers import get_driver + >>> driver = get_driver('docker') + >>> conn = driver(host='198.61.239.128', port=4243) + >>> conn.list_containers() + or connecting to http basic auth protected https host: + >>> conn = driver('user', 'pass', host='https://198.61.239.128', port=443) + + connect with tls authentication, by providing a hostname, port, a private + key file (.pem) and certificate (.pem) file + >>> conn = driver(host='https://198.61.239.128', + >>> port=4243, key_file='key.pem', cert_file='cert.pem') + """ + + type = Provider.DOCKER + name = "Docker" + website = "http://docker.io" + connectionCls = DockerConnection + supports_clusters = False + version = "1.24" + + def __init__( + self, + key="", + secret="", + secure=False, + host="localhost", + port=4243, + key_file=None, + cert_file=None, + ): + """ + :param key: API key or username to used (required) + :type key: ``str`` + + :param secret: Secret password to be used (required) + :type secret: ``str`` + + :param secure: Whether to use HTTPS or HTTP. Note: Some providers + only support HTTPS, and it is on by default. + :type secure: ``bool`` + + :param host: Override hostname used for connections. + :type host: ``str`` + + :param port: Override port used for connections. + :type port: ``int`` + + :param key_file: Path to private key for TLS connection (optional) + :type key_file: ``str`` + + :param cert_file: Path to public key for TLS connection (optional) + :type cert_file: ``str`` + + :return: ``None`` + """ + if key_file: + self.connectionCls = DockertlsConnection + self.key_file = key_file + self.cert_file = cert_file + secure = True + + if host.startswith("https://"): + secure = True + + # strip the prefix + prefixes = ["http://", "https://"] + for prefix in prefixes: + if host.startswith(prefix): + host = host.strip(prefix) + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + key_file=key_file, + cert_file=cert_file, + ) + + if key_file or cert_file: + # docker tls authentication- + # https://docs.docker.com/articles/https/ + # We pass two files, a key_file with the + # private key and cert_file with the certificate + # libcloud will handle them through LibcloudHTTPSConnection + if not (key_file and cert_file): + raise Exception( + "Needs both private key file and " "certificate file for tls authentication" + ) + + self.connection.secure = secure + self.connection.host = host + self.connection.port = port + # set API version + self.version = self._get_api_version() + + def _ex_connection_class_kwargs(self): + kwargs = {} + if hasattr(self, "key_file"): + kwargs["key_file"] = self.key_file + if hasattr(self, "cert_file"): + kwargs["cert_file"] = self.cert_file + return kwargs + + def install_image(self, path): + """ + Install a container image from a remote path. + + :param path: Path to the container image + :type path: ``str`` + + :rtype: :class:`libcloud.container.base.ContainerImage` + """ + payload = {} + data = json.dumps(payload) + + result = self.connection.request( + "/v{}/images/create?fromImage={}".format(self.version, path), + data=data, + method="POST", + ) + if "errorDetail" in result.body: + raise DockerException(None, result.body) + image_id = None + + # the response is slightly different if the image is already present + # and it's not downloaded. both messages below indicate that the image + # is available for use to the daemon + if re.search(r"Downloaded newer image", result.body) or re.search( + r'"Status: Image is up to date', result.body + ): + if re.search(r"sha256:(?P[a-z0-9]{64})", result.body): + image_id = re.findall(r"sha256:(?P[a-z0-9]{64})", result.body)[-1] + + # if there is a failure message or if there is not an image id in the + # response then throw an exception. + if image_id is None: + raise DockerException(None, "failed to install image") + + image = ContainerImage( + id=image_id, + name=path, + path=path, + version=None, + driver=self.connection.driver, + extra={}, + ) + return image + + def list_images(self): + """ + List the installed container images + + :rtype: ``list`` of :class:`libcloud.container.base.ContainerImage` + """ + result = self.connection.request("/v%s/images/json" % (self.version)).object + images = [] + for image in result: + try: + name = image.get("RepoTags")[0] + except Exception: + name = image.get("Id") + images.append( + ContainerImage( + id=image.get("Id"), + name=name, + path=name, + version=None, + driver=self.connection.driver, + extra={ + "created": image.get("Created"), + "size": image.get("Size"), + "virtual_size": image.get("VirtualSize"), + }, + ) + ) + + return images + + def list_containers(self, image=None, all=True): + """ + List the deployed container images + + :param image: Filter to containers with a certain image + :type image: :class:`libcloud.container.base.ContainerImage` + + :param all: Show all container (including stopped ones) + :type all: ``bool`` + + :rtype: ``list`` of :class:`libcloud.container.base.Container` + """ + if all: + ex = "?all=1" + else: + ex = "" + try: + result = self.connection.request( + "/v{}/containers/json{}".format(self.version, ex) + ).object + except Exception as exc: + errno = getattr(exc, "errno", None) + if errno == 111: + raise DockerException( + errno, + "Make sure docker host is accessible" "and the API port is correct", + ) + raise + + containers = [self._to_container(value) for value in result] + return containers + + def deploy_container( + self, + name, + image, + parameters=None, + start=True, + command=None, + hostname=None, + user="", + stdin_open=True, + tty=True, + mem_limit=0, + ports=None, + environment=None, + dns=None, + volumes=None, + volumes_from=None, + network_disabled=False, + entrypoint=None, + cpu_shares=None, + working_dir="", + domainname=None, + memswap_limit=0, + port_bindings=None, + network_mode="bridge", + labels=None, + ): + """ + Deploy an installed container image + + For details on the additional parameters see : http://bit.ly/1PjMVKV + + :param name: The name of the new container + :type name: ``str`` + + :param image: The container image to deploy + :type image: :class:`libcloud.container.base.ContainerImage` + + :param parameters: Container Image parameters + :type parameters: ``str`` + + :param start: Start the container on deployment + :type start: ``bool`` + + :param command: Override the image command; None uses the image default. + :type command: ``str`` or ``None`` + + :rtype: :class:`Container` + """ + if port_bindings is None: + port_bindings = {} + params = {"name": name} + + payload = { + "Hostname": hostname, + "Domainname": domainname, + "ExposedPorts": ports, + "User": user, + "Tty": tty, + "OpenStdin": stdin_open, + "StdinOnce": False, + "Memory": mem_limit, + "AttachStdin": True, + "AttachStdout": True, + "AttachStderr": True, + "Env": environment, + "Dns": dns, + "Image": image.name, + "Volumes": volumes, + "VolumesFrom": volumes_from, + "NetworkDisabled": network_disabled, + "Entrypoint": entrypoint, + "CpuShares": cpu_shares, + "WorkingDir": working_dir, + "MemorySwap": memswap_limit, + "PublishAllPorts": True, + "PortBindings": port_bindings, + "NetworkMode": network_mode, + "Labels": labels, + } + + if command is not None: + payload["Cmd"] = shlex.split(str(command)) + + data = json.dumps(payload) + try: + result = self.connection.request( + "/v%s/containers/create" % (self.version), + data=data, + params=params, + method="POST", + ) + except Exception as e: + message = e.message or str(e) # pylint: disable=no-member + if message.startswith("No such image:"): + raise DockerException(None, "No such image: %s" % image.name) + else: + raise DockerException(None, e) + + id_ = result.object["Id"] + + payload = { + "Binds": [], + "PublishAllPorts": True, + "PortBindings": port_bindings, + } + + data = json.dumps(payload) + if start: + if float(self._get_api_version()) > 1.22: + result = self.connection.request( + "/v{}/containers/{}/start".format(self.version, id_), method="POST" + ) + else: + result = self.connection.request( + "/v{}/containers/{}/start".format(self.version, id_), + data=data, + method="POST", + ) + + return self.get_container(id_) + + def get_container(self, id): + """ + Get a container by ID + + :param id: The ID of the container to get + :type id: ``str`` + + :rtype: :class:`libcloud.container.base.Container` + """ + result = self.connection.request("/v{}/containers/{}/json".format(self.version, id)).object + + return self._to_container(result) + + def start_container(self, container): + """ + Start a container + + :param container: The container to be started + :type container: :class:`libcloud.container.base.Container` + + :return: The container refreshed with current data + :rtype: :class:`libcloud.container.base.Container` + """ + if float(self._get_api_version()) > 1.22: + result = self.connection.request( + "/v{}/containers/{}/start".format(self.version, container.id), method="POST" + ) + else: + payload = { + "Binds": [], + "PublishAllPorts": True, + } + data = json.dumps(payload) + result = self.connection.request( + "/v{}/containers/{}/start".format(self.version, container.id), + method="POST", + data=data, + ) + + if result.status in VALID_RESPONSE_CODES: + return self.get_container(container.id) + else: + raise DockerException(result.status, "failed to start container") + + def stop_container(self, container): + """ + Stop a container + + :param container: The container to be stopped + :type container: :class:`libcloud.container.base.Container` + + :return: The container refreshed with current data + :rtype: :class:`libcloud.container.base.Container` + """ + result = self.connection.request( + "/v{}/containers/{}/stop".format(self.version, container.id), method="POST" + ) + if result.status in VALID_RESPONSE_CODES: + return self.get_container(container.id) + else: + raise DockerException(result.status, "failed to stop container") + + def restart_container(self, container): + """ + Restart a container + + :param container: The container to be stopped + :type container: :class:`libcloud.container.base.Container` + + :return: The container refreshed with current data + :rtype: :class:`libcloud.container.base.Container` + """ + data = json.dumps({"t": 10}) + # number of seconds to wait before killing the container + result = self.connection.request( + "/v{}/containers/{}/restart".format(self.version, container.id), + data=data, + method="POST", + ) + if result.status in VALID_RESPONSE_CODES: + return self.get_container(container.id) + else: + raise DockerException(result.status, "failed to restart container") + + def destroy_container(self, container): + """ + Remove a container + + :param container: The container to be destroyed + :type container: :class:`libcloud.container.base.Container` + + :return: True if the destroy was successful, False otherwise. + :rtype: ``bool`` + """ + result = self.connection.request( + "/v{}/containers/{}".format(self.version, container.id), method="DELETE" + ) + return result.status in VALID_RESPONSE_CODES + + def ex_list_processes(self, container): + """ + List processes running inside a container + + :param container: The container to list processes for. + :type container: :class:`libcloud.container.base.Container` + + :rtype: ``str`` + """ + result = self.connection.request( + "/v{}/containers/{}/top".format(self.version, container.id) + ).object + + return result + + def ex_rename_container(self, container, name): + """ + Rename a container + + :param container: The container to be renamed + :type container: :class:`libcloud.container.base.Container` + + :param name: The new name + :type name: ``str`` + + :rtype: :class:`libcloud.container.base.Container` + """ + result = self.connection.request( + "/v{}/containers/{}/rename?name={}".format(self.version, container.id, name), + method="POST", + ) + if result.status in VALID_RESPONSE_CODES: + return self.get_container(container.id) + + def ex_get_logs(self, container, stream=False): + """ + Get container logs + + If stream == True, logs will be yielded as a stream + From Api Version 1.11 and above we need a GET request to get the logs + Logs are in different format of those of Version 1.10 and below + + :param container: The container to list logs for + :type container: :class:`libcloud.container.base.Container` + + :param stream: Stream the output + :type stream: ``bool`` + + :rtype: ``bool`` + """ + payload = {} + data = json.dumps(payload) + + if float(self._get_api_version()) > 1.10: + result = self.connection.request( + "/v%s/containers/%s/logs?follow=%s&stdout=1&stderr=1" + % (self.version, container.id, str(stream)) + ).object + logs = result + else: + result = self.connection.request( + "/v%s/containers/%s/attach?logs=1&stream=%s&stdout=1&stderr=1" + % (self.version, container.id, str(stream)), + method="POST", + data=data, + ) + logs = result.body + + return logs + + def ex_search_images(self, term): + """Search for an image on Docker.io. + Returns a list of ContainerImage objects + + >>> images = conn.ex_search_images(term='mistio') + >>> images + [, + ] + + :param term: The search term + :type term: ``str`` + + :rtype: ``list`` of :class:`libcloud.container.base.ContainerImage` + """ + + term = term.replace(" ", "+") + result = self.connection.request( + "/v{}/images/search?term={}".format(self.version, term) + ).object + images = [] + for image in result: + name = image.get("name") + images.append( + ContainerImage( + id=name, + path=name, + version=None, + name=name, + driver=self.connection.driver, + extra={ + "description": image.get("description"), + "is_official": image.get("is_official"), + "is_trusted": image.get("is_trusted"), + "star_count": image.get("star_count"), + }, + ) + ) + + return images + + def ex_delete_image(self, image): + """ + Remove image from the filesystem + + :param image: The image to remove + :type image: :class:`libcloud.container.base.ContainerImage` + + :rtype: ``bool`` + """ + result = self.connection.request( + "/v{}/images/{}".format(self.version, image.name), method="DELETE" + ) + return result.status in VALID_RESPONSE_CODES + + def _to_container(self, data): + """ + Convert container in Container instances + """ + try: + name = data.get("Name").strip("/") + except Exception: + try: + name = data.get("Names")[0].strip("/") + except Exception: + name = data.get("Id") + state = data.get("State") + if isinstance(state, dict): + status = data.get("Status", state.get("Status") if state is not None else None) + else: + status = data.get("Status") + if "Exited" in status: + state = ContainerState.STOPPED + elif status.startswith("Up "): + state = ContainerState.RUNNING + elif "running" in status: + state = ContainerState.RUNNING + else: + state = ContainerState.STOPPED + image = data.get("Image") + ports = data.get("Ports", []) + created = data.get("Created") + if isinstance(created, float): + created = ts_to_str(created) + extra = { + "id": data.get("Id"), + "status": data.get("Status"), + "created": created, + "image": image, + "ports": ports, + "command": data.get("Command"), + "sizerw": data.get("SizeRw"), + "sizerootfs": data.get("SizeRootFs"), + } + ips = [] + if ports is not None: + for port in ports: + if port.get("IP") is not None: + ips.append(port.get("IP")) + return Container( + id=data["Id"], + name=name, + image=ContainerImage( + id=data.get("ImageID", None), + path=image, + name=image, + version=None, + driver=self.connection.driver, + ), + ip_addresses=ips, + state=state, + driver=self.connection.driver, + extra=extra, + ) + + def _get_api_version(self): + """ + Get the docker API version information + """ + result = self.connection.request("/version").object + result = result or {} + api_version = result.get("ApiVersion") + + return api_version + + +def ts_to_str(timestamp): + """ + Return a timestamp as a nicely formatted datetime string. + """ + date = datetime.datetime.fromtimestamp(timestamp) + date_string = date.strftime("%d/%m/%Y %H:%M %Z") + return date_string diff --git a/libcloud/container/drivers/dummy.py b/libcloud/container/drivers/dummy.py new file mode 100644 index 0000000000..bf89972cec --- /dev/null +++ b/libcloud/container/drivers/dummy.py @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.container.base import ContainerDriver + + +class DummyContainerDriver(ContainerDriver): + """ + Dummy Container driver. + + >>> from libcloud.container.drivers.dummy import DummyContainerDriver + >>> driver = DummyContainerDriver('key', 'secret') + >>> driver.name + 'Dummy Container Provider' + """ + + name = "Dummy Container Provider" + website = "http://example.com" + supports_clusters = False + + def __init__(self, api_key, api_secret): + """ + :param api_key: API key or username to used (required) + :type api_key: ``str`` + + :param api_secret: Secret password to be used (required) + :type api_secret: ``str`` + + :rtype: ``None`` + """ + + +if __name__ == "__main__": + import doctest + + doctest.testmod() diff --git a/libcloud/container/drivers/ecs.py b/libcloud/container/drivers/ecs.py new file mode 100644 index 0000000000..70894bd904 --- /dev/null +++ b/libcloud/container/drivers/ecs.py @@ -0,0 +1,603 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import simplejson as json +except ImportError: + import json + +from libcloud.common.aws import AWSJsonResponse, SignedAWSConnection +from libcloud.container.base import Container, ContainerImage, ContainerDriver, ContainerCluster +from libcloud.container.types import ContainerState +from libcloud.container.utils.docker import RegistryClient + +__all__ = ["ElasticContainerDriver"] + + +ECS_VERSION = "2014-11-13" +ECR_VERSION = "2015-09-21" +ECS_HOST = "ecs.%s.amazonaws.com" +ECR_HOST = "ecr.%s.amazonaws.com" +ROOT = "/" +ECS_TARGET_BASE = "AmazonEC2ContainerServiceV%s" % (ECS_VERSION.replace("-", "")) +ECR_TARGET_BASE = "AmazonEC2ContainerRegistry_V%s" % (ECR_VERSION.replace("-", "")) + + +class ECSJsonConnection(SignedAWSConnection): + version = ECS_VERSION + host = ECS_HOST + responseCls = AWSJsonResponse + service_name = "ecs" + + +class ECRJsonConnection(SignedAWSConnection): + version = ECR_VERSION + host = ECR_HOST + responseCls = AWSJsonResponse + service_name = "ecr" + + +class ElasticContainerDriver(ContainerDriver): + name = "Amazon Elastic Container Service" + website = "https://aws.amazon.com/ecs/details/" + ecr_repository_host = "%s.dkr.ecr.%s.amazonaws.com" + connectionCls = ECSJsonConnection + ecrConnectionClass = ECRJsonConnection + supports_clusters = False + status_map = {"RUNNING": ContainerState.RUNNING} + + def __init__(self, access_id, secret, region): + super().__init__(access_id, secret) + self.region = region + self.region_name = region + self.connection.host = ECS_HOST % (region) + + # Setup another connection class for ECR + conn_kwargs = self._ex_connection_class_kwargs() + self.ecr_connection = self.ecrConnectionClass(access_id, secret, **conn_kwargs) + self.ecr_connection.host = ECR_HOST % (region) + self.ecr_connection.driver = self + self.ecr_connection.connect() + + def _ex_connection_class_kwargs(self): + return {"signature_version": "4"} + + def list_images(self, ex_repository_name): + """ + List the images in an ECR repository + + :param ex_repository_name: The name of the repository to check + defaults to the default repository. + :type ex_repository_name: ``str`` + + :return: a list of images + :rtype: ``list`` of :class:`libcloud.container.base.ContainerImage` + """ + request = {} + request["repositoryName"] = ex_repository_name + list_response = self.ecr_connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_ecr_headers("ListImages"), + ).object + repository_id = self.ex_get_repository_id(ex_repository_name) + host = self._get_ecr_host(repository_id) + return self._to_images(list_response["imageIds"], host, ex_repository_name) + + def list_clusters(self): + """ + Get a list of potential locations to deploy clusters into + + :param location: The location to search in + :type location: :class:`libcloud.container.base.ClusterLocation` + + :rtype: ``list`` of :class:`libcloud.container.base.ContainerCluster` + """ + listdata = self.connection.request( + ROOT, + method="POST", + data=json.dumps({}), + headers=self._get_headers("ListClusters"), + ).object + request = {"clusters": listdata["clusterArns"]} + data = self.connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_headers("DescribeClusters"), + ).object + return self._to_clusters(data) + + def create_cluster(self, name, location=None): + """ + Create a container cluster + + :param name: The name of the cluster + :type name: ``str`` + + :param location: The location to create the cluster in + :type location: :class:`libcloud.container.base.ClusterLocation` + + :rtype: :class:`libcloud.container.base.ContainerCluster` + """ + request = {"clusterName": name} + response = self.connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_headers("CreateCluster"), + ).object + return self._to_cluster(response["cluster"]) + + def destroy_cluster(self, cluster): + """ + Delete a cluster + + :return: ``True`` if the destroy was successful, otherwise ``False``. + :rtype: ``bool`` + """ + request = {"cluster": cluster.id} + data = self.connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_headers("DeleteCluster"), + ).object + return data["cluster"]["status"] == "INACTIVE" + + def list_containers(self, image=None, cluster=None): + """ + List the deployed container images + + :param image: Filter to containers with a certain image + :type image: :class:`libcloud.container.base.ContainerImage` + + :param cluster: Filter to containers in a cluster + :type cluster: :class:`libcloud.container.base.ContainerCluster` + + :rtype: ``list`` of :class:`libcloud.container.base.Container` + """ + request = {"cluster": "default"} + if cluster is not None: + request["cluster"] = cluster.id + if image is not None: + request["family"] = image.name + list_response = self.connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_headers("ListTasks"), + ).object + if len(list_response["taskArns"]) == 0: + return [] + containers = self.ex_list_containers_for_task(list_response["taskArns"]) + return containers + + def deploy_container( + self, + name, + image, + cluster=None, + parameters=None, + start=True, + ex_cpu=10, + ex_memory=500, + ex_container_port=None, + ex_host_port=None, + ): + """ + Creates a task definition from a container image that can be run + in a cluster. + + :param name: The name of the new container + :type name: ``str`` + + :param image: The container image to deploy + :type image: :class:`libcloud.container.base.ContainerImage` + + :param cluster: The cluster to deploy to, None is default + :type cluster: :class:`libcloud.container.base.ContainerCluster` + + :param parameters: Container Image parameters + :type parameters: ``str`` + + :param start: Start the container on deployment + :type start: ``bool`` + + :rtype: :class:`libcloud.container.base.Container` + """ + data = {} + if ex_container_port is None and ex_host_port is None: + port_maps = [] + else: + port_maps = [{"containerPort": ex_container_port, "hostPort": ex_host_port}] + data["containerDefinitions"] = [ + { + "mountPoints": [], + "name": name, + "image": image.name, + "cpu": ex_cpu, + "environment": [], + "memory": ex_memory, + "portMappings": port_maps, + "essential": True, + "volumesFrom": [], + } + ] + data["family"] = name + response = self.connection.request( + ROOT, + method="POST", + data=json.dumps(data), + headers=self._get_headers("RegisterTaskDefinition"), + ).object + if start: + return self.ex_start_task(response["taskDefinition"]["taskDefinitionArn"])[0] + else: + return Container( + id=None, + name=name, + image=image, + state=ContainerState.RUNNING, + ip_addresses=[], + extra={"taskDefinitionArn": response["taskDefinition"]["taskDefinitionArn"]}, + driver=self.connection.driver, + ) + + def get_container(self, id): + """ + Get a container by ID + + :param id: The ID of the container to get + :type id: ``str`` + + :rtype: :class:`libcloud.container.base.Container` + """ + containers = self.ex_list_containers_for_task([id]) + return containers[0] + + def start_container(self, container, count=1): + """ + Start a deployed task + + :param container: The container to start + :type container: :class:`libcloud.container.base.Container` + + :param count: Number of containers to start + :type count: ``int`` + + :rtype: :class:`libcloud.container.base.Container` + """ + return self.ex_start_task(container.extra["taskDefinitionArn"], count) + + def stop_container(self, container): + """ + Stop a deployed container + + :param container: The container to stop + :type container: :class:`libcloud.container.base.Container` + + :rtype: :class:`libcloud.container.base.Container` + """ + request = {"task": container.extra["taskArn"]} + response = self.connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_headers("StopTask"), + ).object + containers = [] + containers.extend( + self._to_containers(response["task"], container.extra["taskDefinitionArn"]) + ) + return containers + + def restart_container(self, container): + """ + Restart a deployed container + + :param container: The container to restart + :type container: :class:`libcloud.container.base.Container` + + :rtype: :class:`libcloud.container.base.Container` + """ + self.stop_container(container) + return self.start_container(container) + + def destroy_container(self, container): + """ + Destroy a deployed container + + :param container: The container to destroy + :type container: :class:`libcloud.container.base.Container` + + :rtype: :class:`libcloud.container.base.Container` + """ + return self.stop_container(container) + + def ex_start_task(self, task_arn, count=1): + """ + Run a task definition and get the containers + + :param task_arn: The task ARN to Run + :type task_arn: ``str`` + + :param count: The number of containers to start + :type count: ``int`` + + :rtype: ``list`` of :class:`libcloud.container.base.Container` + """ + request = None + request = {"count": count, "taskDefinition": task_arn} + response = self.connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_headers("RunTask"), + ).object + containers = [] + for task in response["tasks"]: + containers.extend(self._to_containers(task, task_arn)) + return containers + + def ex_list_containers_for_task(self, task_arns): + """ + Get a list of containers by ID collection (ARN) + + :param task_arns: The list of ARNs + :type task_arns: ``list`` of ``str`` + + :rtype: ``list`` of :class:`libcloud.container.base.Container` + """ + describe_request = {"tasks": task_arns} + descripe_response = self.connection.request( + ROOT, + method="POST", + data=json.dumps(describe_request), + headers=self._get_headers("DescribeTasks"), + ).object + containers = [] + for task in descripe_response["tasks"]: + containers.extend(self._to_containers(task, task["taskDefinitionArn"])) + return containers + + def ex_create_service(self, name, cluster, task_definition, desired_count=1): + """ + Runs and maintains a desired number of tasks from a specified + task definition. If the number of tasks running in a service + drops below desired_count, Amazon ECS spawns another + instantiation of the task in the specified cluster. + + :param name: the name of the service + :type name: ``str`` + + :param cluster: The cluster to run the service on + :type cluster: :class:`libcloud.container.base.ContainerCluster` + + :param task_definition: The task definition name or ARN for the + service + :type task_definition: ``str`` + + :param desired_count: The desired number of tasks to be running + at any one time + :type desired_count: ``int`` + + :rtype: ``object`` The service object + """ + request = { + "serviceName": name, + "taskDefinition": task_definition, + "desiredCount": desired_count, + "cluster": cluster.id, + } + response = self.connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_headers("CreateService"), + ).object + return response["service"] + + def ex_list_service_arns(self, cluster=None): + """ + List the services + + :param cluster: The cluster hosting the services + :type cluster: :class:`libcloud.container.base.ContainerCluster` + + :rtype: ``list`` of ``str`` + """ + request = {} + if cluster is not None: + request["cluster"] = cluster.id + response = self.connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_headers("ListServices"), + ).object + return response["serviceArns"] + + def ex_describe_service(self, service_arn): + """ + Get the details of a service + + :param cluster: The hosting cluster + :type cluster: :class:`libcloud.container.base.ContainerCluster` + + :param service_arn: The service ARN to describe + :type service_arn: ``str`` + + :return: The service object + :rtype: ``object`` + """ + request = {"services": [service_arn]} + response = self.connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_headers("DescribeServices"), + ).object + return response["services"][0] + + def ex_destroy_service(self, service_arn): + """ + Deletes a service + + :param cluster: The target cluster + :type cluster: :class:`libcloud.container.base.ContainerCluster` + + :param service_arn: The service ARN to destroy + :type service_arn: ``str`` + """ + request = {"service": service_arn} + response = self.connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_headers("DeleteService"), + ).object + return response["service"] + + def ex_get_registry_client(self, repository_name): + """ + Get a client for an ECR repository + + :param repository_name: The unique name of the repository + :type repository_name: ``str`` + + :return: a docker registry API client + :rtype: :class:`libcloud.container.utils.docker.RegistryClient` + """ + repository_id = self.ex_get_repository_id(repository_name) + token = self.ex_get_repository_token(repository_id) + host = self._get_ecr_host(repository_id) + return RegistryClient(host=host, username="AWS", password=token) + + def ex_get_repository_token(self, repository_id): + """ + Get the authorization token (12 hour expiry) for a repository + + :param repository_id: The ID of the repository + :type repository_id: ``str`` + + :return: A token for login + :rtype: ``str`` + """ + request = {"RegistryIds": [repository_id]} + response = self.ecr_connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_ecr_headers("GetAuthorizationToken"), + ).object + return response["authorizationData"][0]["authorizationToken"] + + def ex_get_repository_id(self, repository_name): + """ + Get the ID of a repository + + :param repository_name: The unique name of the repository + :type repository_name: ``str`` + + :return: The repository ID + :rtype: ``str`` + """ + request = {"repositoryNames": [repository_name]} + list_response = self.ecr_connection.request( + ROOT, + method="POST", + data=json.dumps(request), + headers=self._get_ecr_headers("DescribeRepositories"), + ).object + repository_id = list_response["repositories"][0]["registryId"] + return repository_id + + def _get_ecr_host(self, repository_id): + return self.ecr_repository_host % (repository_id, self.region) + + def _get_headers(self, action): + """ + Get the default headers for a request to the ECS API + """ + return { + "x-amz-target": "{}.{}".format(ECS_TARGET_BASE, action), + "Content-Type": "application/x-amz-json-1.1", + } + + def _get_ecr_headers(self, action): + """ + Get the default headers for a request to the ECR API + """ + return { + "x-amz-target": "{}.{}".format(ECR_TARGET_BASE, action), + "Content-Type": "application/x-amz-json-1.1", + } + + def _to_clusters(self, data): + clusters = [] + for cluster in data["clusters"]: + clusters.append(self._to_cluster(cluster)) + return clusters + + def _to_cluster(self, data): + return ContainerCluster( + id=data["clusterArn"], + name=data["clusterName"], + driver=self.connection.driver, + ) + + def _to_containers(self, data, task_definition_arn): + clusters = [] + for cluster in data["containers"]: + clusters.append(self._to_container(cluster, task_definition_arn)) + return clusters + + def _to_container(self, data, task_definition_arn): + return Container( + id=data["containerArn"], + name=data["name"], + image=ContainerImage( + id=None, + name=data["name"], + path=None, + version=None, + driver=self.connection.driver, + ), + ip_addresses=None, + state=self.status_map.get(data["lastStatus"], None), + extra={ + "taskArn": data["taskArn"], + "taskDefinitionArn": task_definition_arn, + }, + driver=self.connection.driver, + ) + + def _to_images(self, data, host, repository_name): + images = [] + for image in data: + images.append(self._to_image(image, host, repository_name)) + return images + + def _to_image(self, data, host, repository_name): + path = "{}/{}:{}".format(host, repository_name, data["imageTag"]) + return ContainerImage( + id=None, + name=path, + path=path, + version=data["imageTag"], + driver=self.connection.driver, + ) diff --git a/libcloud/container/drivers/gke.py b/libcloud/container/drivers/gke.py new file mode 100644 index 0000000000..06a905216a --- /dev/null +++ b/libcloud/container/drivers/gke.py @@ -0,0 +1,217 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.common.google import GoogleResponse, GoogleBaseConnection, GoogleOAuth2Credential +from libcloud.container.providers import Provider +from libcloud.container.drivers.kubernetes import KubernetesContainerDriver + +API_VERSION = "v1" + + +class GKEResponse(GoogleResponse): + pass + + +class GKEConnection(GoogleBaseConnection): + """ + Connection class for the GKE driver. + + GKEConnection extends :class:`google.GoogleBaseConnection` for 3 reasons: + 1. modify request_path for GKE URI. + 2. Implement gce_params functionality described below. + 3. Add request_aggregated_items method for making aggregated API calls. + + """ + + host = "container.googleapis.com" + responseCls = GKEResponse + + def __init__( + self, + user_id, + key, + secure, + auth_type=None, + credential_file=None, + project=None, + **kwargs, + ): + super().__init__( + user_id, + key, + secure=secure, + auth_type=auth_type, + credential_file=credential_file, + **kwargs, + ) + self.request_path = "/{}/projects/{}".format(API_VERSION, project) + self.gke_params = {} + + def pre_connect_hook(self, params, headers): + """ + Update URL parameters with values from self.gke_params. + + @inherits: :class:`GoogleBaseConnection.pre_connect_hook` + """ + params, headers = super().pre_connect_hook(params, headers) + if self.gke_params: + params.update(self.gke_params) + return params, headers + + def request(self, *args, **kwargs): + """ + Perform request then do GKE-specific processing of URL params. + + @inherits: :class:`GoogleBaseConnection.request` + """ + response = super().request(*args, **kwargs) + + # If gce_params has been set, then update the pageToken with the + # nextPageToken so it can be used in the next request. + if self.gke_params: + if "nextPageToken" in response.object: + self.gke_params["pageToken"] = response.object["nextPageToken"] + elif "pageToken" in self.gke_params: + del self.gke_params["pageToken"] + self.gke_params = {} + + return response + + +class GKEContainerDriver(KubernetesContainerDriver): + """ + GKE Container Driver class. + + This is the primary driver for interacting with Google Container + Engine. It contains all of the standard libcloud methods, + plus additional ex_* methods for more features. + + Note that many methods allow either objects or strings (or lists of + objects/strings). In most cases, passing strings instead of objects + will result in additional GKE API calls. + """ + + connectionCls = GKEConnection + api_name = "google" + name = "Google Container Engine" + type = Provider.GKE + website = "https://container.googleapis.com" + supports_clusters = True + + AUTH_URL = "https://container.googleapis.com/auth/" + + def __init__( + self, + user_id, + key=None, + datacenter=None, + project=None, + auth_type=None, + scopes=None, + credential_file=None, + host=None, + port=443, + **kwargs, + ): + """ + :param user_id: The email address (for service accounts) or Client ID + (for installed apps) to be used for authentication. + :type user_id: ``str`` + + :param key: The RSA Key (for service accounts) or file path containing + key or Client Secret (for installed apps) to be used for + authentication. + :type key: ``str`` + + :keyword datacenter: The name of the datacenter (zone) used for + operations. + :type datacenter: ``str`` + + :keyword project: Your GKE project name. (required) + :type project: ``str`` + + :keyword auth_type: Accepted values are "SA" or "IA" or "GKE" + ("Service Account" or "Installed Application" or + "GKE" if libcloud is being used on a GKE instance + with service account enabled). + If not supplied, auth_type will be guessed based + on value of user_id or if the code is being + executed in a GKE instance. + :type auth_type: ``str`` + + :keyword scopes: List of authorization URLs. Default is empty and + grants read/write to Compute, Storage, DNS. + :type scopes: ``list`` + + :keyword credential_file: Path to file for caching authentication + information used by GKEConnection. + :type credential_file: ``str`` + """ + if not project: + raise ValueError("Project name must be specified using " '"project" keyword.') + if host is None: + host = GKEContainerDriver.website + self.auth_type = auth_type + self.project = project + self.scopes = scopes + self.zone = None + if datacenter is not None: + self.zone = datacenter + self.credential_file = ( + credential_file or GoogleOAuth2Credential.default_credential_file + "." + self.project + ) + + super().__init__(user_id, key, secure=True, host=None, port=None, **kwargs) + + self.base_path = "/{}/projects/{}".format(API_VERSION, self.project) + self.website = GKEContainerDriver.website + + def _ex_connection_class_kwargs(self): + return { + "auth_type": self.auth_type, + "project": self.project, + "scopes": self.scopes, + "credential_file": self.credential_file, + } + + def list_clusters(self, ex_zone=None): + """ + Return a list of cluster information in the current zone or all zones. + + :keyword ex_zone: Optional zone name or None + :type ex_zone: ``str`` or :class:`GCEZone` or + :class:`NodeLocation` or ``None`` + """ + request = "/zones/%s/clusters" % (ex_zone) + if ex_zone is None: + request = "/zones/clusters" + + response = self.connection.request(request, method="GET").object + return response + + def get_server_config(self, ex_zone=None): + """ + Return configuration info about the Container Engine service. + + :keyword ex_zone: Optional zone name or None + :type ex_zone: ``str`` or :class:`GCEZone` or + :class:`NodeLocation` or ``None`` + """ + if ex_zone is None: + ex_zone = self.zone + request = "/zones/%s/serverconfig" % (ex_zone) + + response = self.connection.request(request, method="GET").object + return response diff --git a/libcloud/container/drivers/kubernetes.py b/libcloud/container/drivers/kubernetes.py new file mode 100644 index 0000000000..78c89757f0 --- /dev/null +++ b/libcloud/container/drivers/kubernetes.py @@ -0,0 +1,706 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +import hashlib +import datetime +from typing import Any, Dict, List, Union, Optional +from collections import OrderedDict + +from libcloud.compute.base import Node, NodeSize, NodeImage +from libcloud.compute.types import NodeState +from libcloud.container.base import Container, ContainerImage, ContainerDriver, ContainerCluster +from libcloud.container.types import ContainerState +from libcloud.common.exceptions import BaseHTTPError +from libcloud.common.kubernetes import ( + KubernetesException, + KubernetesDriverMixin, + KubernetesBasicAuthConnection, +) +from libcloud.container.providers import Provider + +__all__ = [ + "KubernetesContainerDriver", + "to_n_bytes", + "to_memory_str", + "to_cpu_str", + "to_n_cpus", +] + + +ROOT_URL = "/api/" + + +K8S_UNIT_MAP = OrderedDict( + { + "K": 1000, + "Ki": 1024, + "M": 1000 * 1000, + "Mi": 1024 * 1024, + "G": 1000 * 1000 * 1000, + "Gi": 1024 * 1024 * 1024, + } +) + + +def to_n_bytes(memory_str: str) -> int: + """Convert memory string to number of bytes + (e.g. '1234Mi'-> 1293942784) + """ + + if memory_str.startswith("0"): + return 0 + + if memory_str.isnumeric(): + return int(memory_str) + + for unit, multiplier in K8S_UNIT_MAP.items(): + if memory_str.endswith(unit): + return int(memory_str.strip(unit)) * multiplier + + +def to_memory_str(n_bytes: int, unit: Optional[str] = None) -> str: + """Convert number of bytes to k8s memory string + (e.g. 1293942784 -> '1234Mi') + """ + + if n_bytes == 0: + return "0K" + n_bytes = int(n_bytes) + memory_str = None + + if unit is None: + for unit, multiplier in reversed(K8S_UNIT_MAP.items()): + converted_n_bytes_float = n_bytes / multiplier + converted_n_bytes = n_bytes // multiplier + memory_str = f"{converted_n_bytes}{unit}" + + if converted_n_bytes_float % 1 == 0: + break + elif K8S_UNIT_MAP.get(unit): + memory_str = f"{n_bytes // K8S_UNIT_MAP[unit]}{unit}" + + return memory_str + + +def to_cpu_str(n_cpus: Union[int, float]) -> str: + """Convert number of cpus to cpu string + (e.g. 0.5 -> '500m') + """ + + if n_cpus == 0: + return "0" + millicores = n_cpus * 1000 + + if millicores % 1 == 0: + return f"{int(millicores)}m" + microcores = n_cpus * 1000000 + + if microcores % 1 == 0: + return f"{int(microcores)}u" + nanocores = n_cpus * 1000000000 + + return f"{int(nanocores)}n" + + +def to_n_cpus(cpu_str: str) -> Union[int, float]: + """Convert cpu string to number of cpus + (e.g. '500m' -> 0.5, '2000000000n' -> 2) + """ + + if cpu_str.endswith("n"): + return int(cpu_str.strip("n")) / 1000000000 + elif cpu_str.endswith("u"): + return int(cpu_str.strip("u")) / 1000000 + elif cpu_str.endswith("m"): + return int(cpu_str.strip("m")) / 1000 + elif cpu_str.isnumeric(): + return int(cpu_str) + else: + return 0 + + +def sum_resources(*resource_dicts): + total_cpu = 0 + total_memory = 0 + + for rd in resource_dicts: + total_cpu += to_n_cpus(rd.get("cpu", "0m")) + total_memory += to_n_bytes(rd.get("memory", "0K")) + + return {"cpu": to_cpu_str(total_cpu), "memory": to_memory_str(total_memory)} + + +class KubernetesDeployment: + def __init__( + self, + id: str, + name: str, + namespace: str, + created_at: str, + replicas: int, + selector: Dict[str, Any], + extra: Optional[Dict[str, Any]] = None, + ): + self.id = id + self.name = name + self.namespace = namespace + self.created_at = created_at + self.replicas = replicas + self.selector = selector + self.extra = extra or {} + + def __repr__(self): + return "".format( + self.name, + self.namespace, + self.replicas, + ) + + +class KubernetesPod: + def __init__( + self, + id: str, + name: str, + containers: List[Container], + namespace: str, + state: str, + ip_addresses: List[str], + created_at: datetime.datetime, + node_name: str, + extra: Dict[str, Any], + ): + """ + A Kubernetes pod + """ + self.id = id + self.name = name + self.containers = containers + self.namespace = namespace + self.state = state + self.ip_addresses = ip_addresses + self.created_at = created_at + self.node_name = node_name + self.extra = extra + + def __repr__(self): + return "".format( + self.name, + self.namespace, + self.state, + ) + + +class KubernetesNamespace(ContainerCluster): + """ + A Kubernetes namespace + """ + + def __repr__(self): + return "".format(self.name) + + +class KubernetesContainerDriver(KubernetesDriverMixin, ContainerDriver): + type = Provider.KUBERNETES + name = "Kubernetes" + website = "http://kubernetes.io" + connectionCls = KubernetesBasicAuthConnection + supports_clusters = True + + def list_containers(self, image=None, all=True) -> List[Container]: + """ + List the deployed container images + + :param image: Filter to containers with a certain image(unused) + :type image: :class:`libcloud.container.base.ContainerImage` + + :param all: Show all container (unused) + :type all: ``bool`` + + :rtype: ``list`` of :class:`libcloud.container.base.Container` + """ + try: + result = self.connection.request(ROOT_URL + "v1/pods").object + except Exception as exc: + errno = getattr(exc, "errno", None) + + if errno == 111: + raise KubernetesException( + errno, + "Make sure kube host is accessible" "and the API port is correct", + ) + raise + + pods = [self._to_pod(value) for value in result["items"]] + containers = [] + + for pod in pods: + containers.extend(pod.containers) + + return containers + + def get_container(self, id: str) -> Container: + """ + Get a container by ID + + :param id: The ID of the container to get + :type id: ``str`` + + :rtype: :class:`libcloud.container.base.Container` + """ + containers = self.list_containers() + match = [container for container in containers if container.id == id] + + return match[0] + + def list_namespaces(self) -> List[KubernetesNamespace]: + """ + Get a list of namespaces that pods can be deployed into + + :rtype: ``list`` of :class:`.KubernetesNamespace` + """ + try: + result = self.connection.request(ROOT_URL + "v1/namespaces/").object + except Exception as exc: + errno = getattr(exc, "errno", None) + + if errno == 111: + raise KubernetesException( + errno, + "Make sure kube host is accessible" "and the API port is correct", + ) + raise + + namespaces = [self._to_namespace(value) for value in result["items"]] + + return namespaces + + def get_namespace(self, id: str) -> KubernetesNamespace: + """ + Get a namespace by ID + + :param id: The ID of the namespace to get + :type id: ``str`` + + :rtype: :class:`.KubernetesNamespace` + """ + result = self.connection.request(ROOT_URL + "v1/namespaces/%s" % id).object + + return self._to_namespace(result) + + def delete_namespace(self, namespace: KubernetesNamespace) -> bool: + """ + Delete a namespace + + :return: ``True`` if the destroy was successful, otherwise ``False``. + :rtype: ``bool`` + """ + self.connection.request( + ROOT_URL + "v1/namespaces/%s" % namespace.id, method="DELETE" + ).object + + return True + + def create_namespace(self, name: str) -> KubernetesNamespace: + """ + Create a namespace + + :param name: The name of the namespace + :type name: ``str`` + + :rtype: :class:`.KubernetesNamespace` + """ + request = {"metadata": {"name": name}} + result = self.connection.request( + ROOT_URL + "v1/namespaces", method="POST", data=json.dumps(request) + ).object + + return self._to_namespace(result) + + def deploy_container( + self, + name: str, + image: ContainerImage, + namespace: KubernetesNamespace = None, + parameters: Optional[str] = None, + start: Optional[bool] = True, + ): + """ + Deploy an installed container image. + In kubernetes this deploys a single container Pod. + https://cloud.google.com/container-engine/docs/pods/single-container + + :param name: The name of the new container + :type name: ``str`` + + :param image: The container image to deploy + :type image: :class:`.ContainerImage` + + :param namespace: The namespace to deploy to, None is default + :type namespace: :class:`.KubernetesNamespace` + + :param parameters: Container Image parameters(unused) + :type parameters: ``str`` + + :param start: Start the container on deployment(unused) + :type start: ``bool`` + + :rtype: :class:`.Container` + """ + + if namespace is None: + namespace = "default" + else: + namespace = namespace.id + request = { + "metadata": {"name": name}, + "spec": {"containers": [{"name": name, "image": image.name}]}, + } + result = self.connection.request( + ROOT_URL + "v1/namespaces/%s/pods" % namespace, + method="POST", + data=json.dumps(request), + ).object + + return self._to_namespace(result) + + def destroy_container(self, container: Container) -> bool: + """ + Destroy a deployed container. Because the containers are single + container pods, this will delete the pod. + + :param container: The container to destroy + :type container: :class:`.Container` + + :rtype: ``bool`` + """ + + return self.ex_destroy_pod(container.extra["namespace"], container.extra["pod"]) + + def ex_list_pods(self, fetch_metrics: bool = False) -> List[KubernetesPod]: + """ + List available Pods + + :param fetch_metrics: Fetch metrics for pods + :type fetch_metrics: ``bool`` + + :rtype: ``list`` of :class:`.KubernetesPod` + """ + result = self.connection.request(ROOT_URL + "v1/pods").object + metrics = None + + if fetch_metrics: + try: + metrics = { + ( + metric["metadata"]["name"], + metric["metadata"]["namespace"], + ): metric["containers"] + for metric in self.ex_list_pods_metrics() + } + except BaseHTTPError: + # Metrics Server may not be installed + pass + + return [self._to_pod(value, metrics=metrics) for value in result["items"]] + + def ex_destroy_pod(self, namespace: str, pod_name: str) -> bool: + """ + Delete a pod and the containers within it. + + :param namespace: The pod's namespace + :type namespace: ``str`` + + :param pod_name: Name of the pod to destroy + :type pod_name: ``str`` + + :rtype: ``bool`` + """ + self.connection.request( + ROOT_URL + "v1/namespaces/{}/pods/{}".format(namespace, pod_name), + method="DELETE", + ).object + + return True + + def ex_list_nodes(self) -> List[Node]: + """ + List available Nodes + + :rtype: ``list`` of :class:`.Node` + """ + result = self.connection.request(ROOT_URL + "v1/nodes").object + + return [self._to_node(node) for node in result["items"]] + + def ex_destroy_node(self, node_name: str) -> bool: + """ + Destroy a node. + + :param node_name: Name of the node to destroy + :type node_name: ``str`` + + :rtype: ``bool`` + """ + self.connection.request(ROOT_URL + f"v1/nodes/{node_name}", method="DELETE").object + + return True + + def ex_get_version(self) -> str: + """Get Kubernetes version + + :rtype: ``str`` + """ + + return self.connection.request("/version").object["gitVersion"] + + def ex_list_nodes_metrics(self) -> List[Dict[str, Any]]: + """Get nodes metrics from Kubernetes Metrics Server + + :rtype: ``list`` of ``dict`` + """ + + return self.connection.request("/apis/metrics.k8s.io/v1beta1/nodes").object["items"] + + def ex_list_pods_metrics(self) -> List[Dict[str, Any]]: + """Get pods metrics from Kubernetes Metrics Server + + :rtype: ``list`` of ``dict`` + """ + + return self.connection.request("/apis/metrics.k8s.io/v1beta1/pods").object["items"] + + def ex_list_services(self) -> List[Dict[str, Any]]: + """Get cluster services + + :rtype: ``list`` of ``dict`` + """ + + return self.connection.request(ROOT_URL + "v1/services").object["items"] + + def ex_list_deployments(self) -> List[KubernetesDeployment]: + """Get cluster deployments + + :rtype: ``list`` of :class:`.KubernetesDeployment` + """ + items = self.connection.request("/apis/apps/v1/deployments").object["items"] + + return [self._to_deployment(item) for item in items] + + def _to_deployment(self, data): + id_ = data["metadata"]["uid"] + name = data["metadata"]["name"] + namespace = data["metadata"]["namespace"] + created_at = data["metadata"]["creationTimestamp"] + replicas = data["spec"]["replicas"] + selector = data["spec"]["selector"] + + extra = { + "labels": data["metadata"]["labels"], + "strategy": data["spec"]["strategy"]["type"], + "total_replicas": data["status"]["replicas"], + "updated_replicas": data["status"]["updatedReplicas"], + "ready_replicas": data["status"]["readyReplicas"], + "available_replicas": data["status"]["availableReplicas"], + "conditions": data["status"]["conditions"], + } + + return KubernetesDeployment( + id=id_, + name=name, + namespace=namespace, + created_at=created_at, + replicas=replicas, + selector=selector, + extra=extra, + ) + + def _to_node(self, data): + """ + Convert an API node data object to a `Node` object + """ + ID = data["metadata"]["uid"] + name = data["metadata"]["name"] + driver = self.connection.driver + memory = data["status"].get("capacity", {}).get("memory", "0K") + cpu = data["status"].get("capacity", {}).get("cpu", "1") + + if isinstance(cpu, str) and not cpu.isnumeric(): + cpu = to_n_cpus(cpu) + image_name = data["status"]["nodeInfo"].get("osImage") + image = NodeImage(image_name, image_name, driver) + size_name = f"{cpu} vCPUs, {memory} Ram" + size_id = hashlib.md5(size_name.encode("utf-8")).hexdigest() # nosec + extra_size = {"cpus": cpu} + size = NodeSize( + id=size_id, + name=size_name, + ram=memory, + disk=0, + bandwidth=0, + price=0, + driver=driver, + extra=extra_size, + ) + extra = {"memory": memory, "cpu": cpu} + extra["os"] = data["status"]["nodeInfo"].get("operatingSystem") + extra["kubeletVersion"] = data["status"]["nodeInfo"]["kubeletVersion"] + extra["provider_id"] = data.get("spec", {}).get("providerID") + + for condition in data["status"]["conditions"]: + if condition["type"] == "Ready" and condition["status"] == "True": + state = NodeState.RUNNING + + break + else: + state = NodeState.UNKNOWN + public_ips, private_ips = [], [] + + for address in data["status"]["addresses"]: + if address["type"] == "InternalIP": + private_ips.append(address["address"]) + elif address["type"] == "ExternalIP": + public_ips.append(address["address"]) + created_at = datetime.datetime.strptime( + data["metadata"]["creationTimestamp"], "%Y-%m-%dT%H:%M:%SZ" + ) + + return Node( + id=ID, + name=name, + state=state, + public_ips=public_ips, + private_ips=private_ips, + driver=driver, + image=image, + size=size, + extra=extra, + created_at=created_at, + ) + + def _to_pod(self, data, metrics=None): + """ + Convert an API response to a Pod object + """ + id_ = data["metadata"]["uid"] + name = data["metadata"]["name"] + namespace = data["metadata"]["namespace"] + state = data["status"]["phase"].lower() + node_name = data["spec"].get("nodeName") + container_statuses = data["status"].get("containerStatuses", {}) + containers = [] + extra = {"resources": {}} + + if metrics: + try: + extra["metrics"] = metrics[name, namespace] + except KeyError: + pass + + # response contains the status of the containers in a separate field + + for container in data["spec"]["containers"]: + if container_statuses: + spec = list(filter(lambda i: i["name"] == container["name"], container_statuses))[0] + else: + spec = container_statuses + container_obj = self._to_container(container, spec, data) + # Calculate new resources + resources = extra["resources"] + container_resources = container_obj.extra.get("resources", {}) + resources["limits"] = sum_resources( + resources.get("limits", {}), container_resources.get("limits", {}) + ) + extra["resources"]["requests"] = sum_resources( + resources.get("requests", {}), container_resources.get("requests", {}) + ) + containers.append(container_obj) + ip_addresses = [ip_dict["ip"] for ip_dict in data["status"].get("podIPs", [])] + created_at = datetime.datetime.strptime( + data["metadata"]["creationTimestamp"], "%Y-%m-%dT%H:%M:%SZ" + ) + + return KubernetesPod( + id=id_, + name=name, + namespace=namespace, + state=state, + ip_addresses=ip_addresses, + containers=containers, + created_at=created_at, + node_name=node_name, + extra=extra, + ) + + def _to_container(self, data, container_status, pod_data): + """ + Convert container in Container instances + """ + state = container_status.get("state") + created_at = None + + if state: + started_at = list(state.values())[0].get("startedAt") + + if started_at: + created_at = datetime.datetime.strptime(started_at, "%Y-%m-%dT%H:%M:%SZ") + extra = { + "pod": pod_data["metadata"]["name"], + "namespace": pod_data["metadata"]["namespace"], + } + resources = data.get("resources") + + if resources: + extra["resources"] = resources + + return Container( + id=container_status.get("containerID") or data["name"], + name=data["name"], + image=ContainerImage( + id=container_status.get("imageID") or data["image"], + name=data["image"], + path=None, + version=None, + driver=self.connection.driver, + ), + ip_addresses=None, + state=(ContainerState.RUNNING if container_status else ContainerState.UNKNOWN), + driver=self.connection.driver, + created_at=created_at, + extra=extra, + ) + + def _to_namespace(self, data): + """ + Convert an API node data object to a `KubernetesNamespace` object + """ + + return KubernetesNamespace( + id=data["metadata"]["name"], + name=data["metadata"]["name"], + driver=self.connection.driver, + extra={"phase": data["status"]["phase"]}, + ) + + +def ts_to_str(timestamp): + """ + Return a timestamp as a nicely formatted datetime string. + """ + date = datetime.datetime.fromtimestamp(timestamp) + date_string = date.strftime("%d/%m/%Y %H:%M %Z") + + return date_string diff --git a/libcloud/container/drivers/lxd.py b/libcloud/container/drivers/lxd.py new file mode 100644 index 0000000000..d6d92245b2 --- /dev/null +++ b/libcloud/container/drivers/lxd.py @@ -0,0 +1,1953 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import re +import base64 +import collections + +from libcloud.utils.py3 import b, httplib +from libcloud.common.base import JsonResponse, ConnectionUserAndKey, KeyCertificateConnection +from libcloud.common.types import InvalidCredsError +from libcloud.compute.base import StorageVolume +from libcloud.container.base import Container, ContainerImage, ContainerDriver +from libcloud.container.types import ContainerState +from libcloud.common.exceptions import BaseHTTPError +from libcloud.container.providers import Provider + +try: + import simplejson as json +except Exception: + import json + + +# Acceptable success strings comping from LXD API +LXD_API_SUCCESS_STATUS = ["Success"] +LXD_API_STATE_ACTIONS = ["stop", "start", "restart", "freeze", "unfreeze"] +LXD_API_IMAGE_SOURCE_TYPE = ["image", "migration", "copy", "none"] + +# the wording used by LXD to indicate that an error +# occurred for a request +LXD_ERROR_STATUS_RESP = "error" + + +# helpers +def strip_http_prefix(host): + # strip the prefix + prefixes = ["http://", "https://"] + for prefix in prefixes: + if host.startswith(prefix): + host = host.strip(prefix) + return host + + +def check_certificates(key_file, cert_file, **kwargs): + """ + Basic checks for the provided certificates in LXDtlsConnection + """ + + # there is no point attempting to connect if either is missing + if key_file is None or cert_file is None: + raise InvalidCredsError( + "TLS Connection requires specification " "of a key file and a certificate file" + ) + + # if they are not none they may be empty strings + # or certificates that are not appropriate + if key_file == "" or cert_file == "": + raise InvalidCredsError( + "TLS Connection requires specification " "of a key file and a certificate file" + ) + + # if none of the above check the types + if "key_files_allowed" in kwargs.keys(): + key_file_suffix = key_file.split(".") + + if key_file_suffix[-1] not in kwargs["key_files_allowed"]: + raise InvalidCredsError( + "Valid key files are: " + + str(kwargs["key_files_allowed"]) + + "you provided: " + + key_file_suffix[-1] + ) + + # if none of the above check the types + if "cert_files_allowed" in kwargs.keys(): + cert_file_suffix = cert_file.split(".") + + if cert_file_suffix[-1] not in kwargs["cert_files_allowed"]: + raise InvalidCredsError( + "Valid certification files are: " + + str(kwargs["cert_files_allowed"]) + + "you provided: " + + cert_file_suffix[-1] + ) + + # if all these are good check the paths + keypath = os.path.expanduser(key_file) + is_file_path = os.path.exists(keypath) and os.path.isfile(keypath) + if not is_file_path: + raise InvalidCredsError( + "You need a key file to authenticate with " "LXD tls. This can be found in the server." + ) + + certpath = os.path.expanduser(cert_file) + is_file_path = os.path.exists(certpath) and os.path.isfile(certpath) + if not is_file_path: + raise InvalidCredsError( + "You need a certificate file to " + "authenticate with LXD tls. " + "This can be found in the server." + ) + + +def assert_response(response_dict, status_code): + """ + Basic checks that the response is of the type + the client is expecting + """ + + # if the type of the response is an error + if response_dict["type"] == LXD_ERROR_STATUS_RESP: + # an error returned + raise LXDAPIException(message="response type is error", response_dict=response_dict) + + # anything else apart from the status_code given should be treated as error + if response_dict["status_code"] != status_code: + # we have an unknown error + msg = "Status code should be {}\ + but is {}".format(status_code, response_dict["status_code"]) + raise LXDAPIException(message=msg, response_dict=response_dict) + + +class LXDAPIException(Exception): + """ + Basic exception to be thrown when LXD API + returns with some kind of error + """ + + def __init__(self, message="Unknown Error Occurred", response_dict=None, error_type=""): + self.message = message + self.response_dict = response_dict + self.type = error_type + + super().__init__(message) + + def __str__(self): + return self.message + + +class LXDStoragePool: + """ + Utility class representing an LXD storage pool + https://lxd.readthedocs.io/en/latest/storage/ + """ + + def __init__(self, name, driver, used_by, config, managed): + # the name of the storage pool + self.name = name + + # the driver (or type of storage pool). e.g. ‘zfs’ or ‘btrfs’, etc. + self.driver = driver + + # which containers (by API endpoint /1.0/containers/) + # are using this storage-pool. + self.used_by = used_by + + # a dictionary with some information about the storage-pool. + # e.g. size, source (path), volume.size, etc. + self.config = config + + # Boolean that indicates whether LXD manages the pool or not. + self.managed = managed + + +class LXDNetwork: + """ + Utility class representing an LXD network + """ + + @classmethod + def build_from_response(cls, metadata): + lxd_network = LXDNetwork() + lxd_network.name = metadata.get("name", None) + lxd_network.id = metadata.get("name", None) + lxd_network.description = metadata.get("description", None) + lxd_network.type = metadata.get("type", None) + lxd_network.config = metadata.get("config", None) + lxd_network.status = metadata.get("status", None) + lxd_network.locations = metadata.get("locations", None) + lxd_network.managed = metadata.get("managed", None) + lxd_network.used_by = metadata.get("used_by", None) + return lxd_network + + def __init__(self): + self.name = None + self.id = None + self.description = None + self.type = None + self.config = None + self.status = None + self.locations = None + self.managed = None + self.used_by = None + self.extra = {} + + +class LXDServerInfo: + """ + Wraps the response form /1.0 + """ + + @classmethod + def build_from_response(cls, metadata): + server_info = LXDServerInfo() + server_info.api_extensions = metadata.get("api_extensions", None) + server_info.api_status = metadata.get("api_status", None) + server_info.api_version = metadata.get("api_version", None) + server_info.auth = metadata.get("auth", None) + server_info.config = metadata.get("config", None) + server_info.environment = metadata.get("environment", None) + server_info.public = metadata.get("public", None) + return server_info + + def __init__(self): + # List of API extensions added after + # the API was marked stable + self.api_extensions = None + + # API implementation status + # (one of, development, stable or deprecated) + self.api_status = None + + # The API version as a string + self.api_version = None + + # Authentication state, + # one of "guest", "untrusted" or "trusted" + self.auth = None + + self.config = None + + # Various information about the host (OS, kernel, ...) + self.environment = None + + self.public = None + + def __str__(self): + return ( + str(self.api_extensions) + + str(self.api_status) + + str(self.api_version) + + str(self.auth) + + str(self.config) + + str(self.environment) + + str(self.public) + ) + + +LXDContainerExecuteResult = collections.namedtuple( + "LXDContainerExecuteResult", + ["uuid", "secret_0", "secret_1", "secret_2", "control", "output", "result"], +) + + +class LXDResponse(JsonResponse): + valid_response_codes = [ + httplib.OK, + httplib.ACCEPTED, + httplib.CREATED, + httplib.NO_CONTENT, + ] + + def parse_body(self): + if len(self.body) == 0 and not self.parse_zero_length_body: + return self.body + + try: + content_type = self.headers.get("content-type", "application/json") + if content_type == "application/json" or content_type == "": + if ( + self.headers.get("transfer-encoding") == "chunked" + and "fromImage" in self.request.url + ): + body = [ + json.loads(chunk) + for chunk in self.body.strip().replace("\r", "").split("\n") + ] + else: + body = json.loads(self.body) + else: + body = self.body + except ValueError: + m = re.search('Error: (.+?)"', self.body) + if m: + error_msg = m.group(1) + raise Exception(error_msg) + else: + msg = "ConnectionError: Failed to parse JSON response " "(body=%s)" % (self.body) + raise Exception(msg) + return body + + def parse_error(self): + if self.status == 401: + raise InvalidCredsError("Invalid credentials") + return self.body + + def success(self): + return self.status in self.valid_response_codes + + +class LXDConnection(ConnectionUserAndKey): + responseCls = LXDResponse + timeout = 60 + + def add_default_headers(self, headers): + """ + Add parameters that are necessary for every request + If user and password are specified, include a base http auth + header + """ + headers["Content-Type"] = "application/json" + if self.user_id and self.key: + user_b64 = base64.b64encode(b("{}:{}".format(self.user_id, self.key))) + headers["Authorization"] = "Basic %s" % (user_b64.decode("utf-8")) + return headers + + +class LXDtlsConnection(KeyCertificateConnection): + responseCls = LXDResponse + + def __init__( + self, + key, + secret, + secure=True, + host="localhost", + port=8443, + ca_cert="", + key_file=None, + cert_file=None, + certificate_validator=None, + **kwargs, + ): + if certificate_validator is not None: + certificate_validator(key_file=key_file, cert_file=cert_file) + else: + check_certificates(key_file=key_file, cert_file=cert_file, **kwargs) + + super().__init__( + key_file=key_file, + cert_file=cert_file, + secure=secure, + host=host, + port=port, + url=None, + proxy_url=None, + timeout=None, + backoff=None, + retry_delay=None, + ) + + self.key_file = key_file + self.cert_file = cert_file + + def add_default_headers(self, headers): + headers["Content-Type"] = "application/json" + return headers + + +class LXDContainerDriver(ContainerDriver): + """ + Driver for LXD REST API of LXC containers + https://lxd.readthedocs.io/en/stable-2.0/rest-api/ + https://github.com/lxc/lxd/blob/master/doc/rest-api.md + """ + + type = Provider.LXD + name = "LXD" + website = "https://linuxcontainers.org/" + connectionCls = LXDConnection + + # LXD supports clustering but still the functionality + # is not implemented yet on our side + supports_clusters = False + version = "1.0" + default_time_out = 30 + + # default configuration when creating a container + # if the architecture is not specified + # by the client code then the underlying + # host architecture should be picked up by + # LXC. + default_architecture = "" + default_profiles = "default" + + # An ephemeral container means that it + # will be restroyed once it is stopped + default_ephemeral = False + + def __init__( + self, + key="", + secret="", + secure=False, + host="localhost", + port=8443, + key_file=None, + cert_file=None, + ca_cert=None, + certificate_validator=check_certificates, + ): + if key_file: + if not cert_file: + # LXD tls authentication- + # We pass two files, a key_file with the + # private key and cert_file with the certificate + # libcloud will handle them through LibcloudHTTPSConnection + + raise LXDAPIException( + message="Need both private key and" + " certificate files for " + "tls authentication" + ) + + self.connectionCls = LXDtlsConnection + self.key_file = key_file + self.cert_file = cert_file + self.certificate_validator = certificate_validator + secure = True + + if host.startswith("https://"): + secure = True + + host = strip_http_prefix(host=host) + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + key_file=key_file, + cert_file=cert_file, + ) + + if ca_cert: + self.connection.connection.ca_cert = ca_cert + else: + # do not verify SSL certificate + self.connection.connection.ca_cert = False + + self.connection.secure = secure + self.connection.host = host + self.connection.port = port + self.version = self._get_api_version() + + def build_operation_websocket_url(self, uuid, w_secret): + uri = "wss://%s:%s/%s/operations/%s/" "websocket?secret=%s" % ( + self.connection.host, + self.connection.port, + self.version, + uuid, + w_secret, + ) + return uri + + def ex_get_api_endpoints(self): + """ + Description: List of supported APIs + Authentication: guest + Operation: sync + Return: list of supported API endpoint URLs + + """ + response = self.connection.request("/") + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + return response_dict["metadata"] + + def ex_get_server_configuration(self): + """ + + Description: Server configuration and environment information + Authentication: guest, untrusted or trusted + Operation: sync + Return: Dict representing server state + + The returned configuration depends on whether the connection + is trusted or not + :rtype: :class: .LXDServerInfo + + """ + response = self.connection.request("/%s" % (self.version)) + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + meta = response_dict["metadata"] + return LXDServerInfo.build_from_response(metadata=meta) + + def deploy_container( + self, + name, + image, + cluster=None, + parameters=None, + start=True, + ex_architecture=default_architecture, + ex_profiles=None, + ex_ephemeral=default_ephemeral, + ex_config=None, + ex_devices=None, + ex_instance_type=None, + ex_timeout=default_time_out, + ): + """ + Create a new container + Authentication: trusted + Operation: async + + :param name: The name of the new container. + 64 chars max, ASCII, no slash, no colon and no comma + :type name: ``str`` + + :param image: The container image to deploy. Currently not used + :type image: :class:`.ContainerImage` + + :param cluster: The cluster to deploy to, None is default + :type cluster: :class:`.ContainerCluster` + + :param parameters: Container Image parameters. + This parameter should represent the + the ``source`` dictionary expected by the LXD API call. For more + information how this parameter should be structured see + https://github.com/lxc/lxd/blob/master/doc/rest-api.md + :type parameters: ``str`` + + :param start: Start the container on deployment. True is the default + :type start: ``bool`` + + :param ex_architecture: string e.g. x86_64 + :type ex_architecture: ``str`` + + :param ex_profiles: List of profiles + :type ex_profiles: ``list`` + + :param ex_ephemeral: Whether to destroy the container on shutdown + :type ex_ephemeral: ``bool`` + + :param ex_config: Config override e.g. {"limits.cpu": "2"} + :type ex_config: ``dict`` + + :param ex_devices: optional list of devices the container should have + :type ex_devices: ``dict`` + + :param ex_instance_type: An optional instance type + to use as basis for limits e.g. "c2.micro" + :type ex_instance_type: ``str`` + + :param ex_timeout: Timeout + :type ex_timeout: ``int`` + + :rtype: :class:`libcloud.container.base.Container` + """ + + if parameters: + parameters = json.loads(parameters) + + if parameters["source"].get("mode", None) == "pull": + try: + # this means the image must be downloaded + image = self.install_image(path=None, ex_timeout=ex_timeout, **parameters) + except Exception as e: + raise LXDAPIException( + message="Deploying " + "container failed: " + "Image could not " + "be installed. %r" % e + ) + + # if the image was installed then we need to change + # how parameters are structured + parameters = { + "source": { + "type": "image", + "fingerprint": image.extra["fingerprint"], + } + } + + cont_params = LXDContainerDriver._fix_cont_params( + architecture=ex_architecture, + profiles=ex_profiles, + ephemeral=ex_ephemeral, + config=ex_config, + devices=ex_devices, + instance_type=ex_instance_type, + ) + + container = self._deploy_container_from_image( + name=name, + image=image, + parameters=parameters, + cont_params=cont_params, + timeout=ex_timeout, + ) + + if start: + container.start() + + return container + + def get_container(self, id, ex_get_ip_addr=True): + """ + Get a container by ID + + :param id: The ID of the container to get + :type id: ``str`` + + :param ex_get_ip_addr: Indicates whether ip addresses + should also be included. This requires an extra GET request + :type ex_get_ip_addr: ``boolean``` + + :rtype: :class:`libcloud.container.base.Container` + """ + req = "/{}/containers/{}".format(self.version, id) + response = self.connection.request(req) + result_dict = response.parse_body() + assert_response(response_dict=result_dict, status_code=200) + + metadata = result_dict["metadata"] + + ips = [] + if ex_get_ip_addr: + req = "/{}/containers/{}/state".format(self.version, id) + ip_response = self.connection.request(req) + + ip_result_dict = ip_response.parse_body() + assert_response(response_dict=ip_result_dict, status_code=200) + + if ip_result_dict["metadata"]["network"] is not None: + networks = ip_result_dict["metadata"]["network"]["eth0"] + + # the list of addresses + addresses = networks["addresses"] + + for item in addresses: + ips.append(item["address"]) + + metadata.update({"ips": ips}) + return self._to_container(metadata=metadata) + + def start_container( + self, container, ex_timeout=default_time_out, ex_force=True, ex_stateful=True + ): + """ + Start a container + + :param container: The container to start + :type container: :class:`libcloud.container.base.Container` + + :param ex_timeout: Time to wait for the operation to complete + :type ex_timeout: ``int`` + + :param ex_force: + :type ex_force: ``boolean`` + + :param ex_stateful: + :type ex_stateful: ``boolean`` + + :rtype: :class:`libcloud.container.base.Container` + """ + return self._do_container_action( + container=container, + action="start", + timeout=ex_timeout, + force=ex_force, + stateful=ex_stateful, + ) + + def stop_container( + self, container, ex_timeout=default_time_out, ex_force=True, ex_stateful=True + ): + """ + Stop the given container + + :param container: The container to be stopped + :type container: :class:`libcloud.container.base.Container` + + :param ex_timeout: Time to wait for the operation to complete + :type ex_timeout: ``int`` + + :param ex_force: + :type ex_force: ``boolean`` + + :param ex_stateful: + :type ex_stateful: ``boolean`` + + :rtype: :class:`libcloud.container.base.Container + """ + return self._do_container_action( + container=container, + action="stop", + timeout=ex_timeout, + force=ex_force, + stateful=ex_stateful, + ) + + def restart_container( + self, container, ex_timeout=default_time_out, ex_force=True, ex_stateful=True + ): + """ + Restart a deployed container + + :param container: The container to restart + :type container: :class:`.Container` + + :param ex_timeout: Time to wait for the operation to complete + :type ex_timeout: ``int`` + + :param ex_force: + :type ex_force: ``boolean`` + + :param ex_stateful: + :type ex_stateful: ``boolean`` + + :rtype: :class:`libcloud.container.base.Container + """ + return self._do_container_action( + container=container, + action="restart", + timeout=ex_timeout, + force=ex_force, + stateful=ex_stateful, + ) + + def ex_freeze_container(self, container, ex_timeout=default_time_out): + """ + Set the given container into a freeze state + + :param container: The container to restart + :type container: :class:`.Container` + + :param ex_timeout: Time to wait for the operation to complete + :type ex_timeout: ``int`` + + :rtype :class: `libcloud.container.base.Container + """ + + return self._do_container_action( + container=container, + action="freeze", + timeout=ex_timeout, + force=True, + stateful=True, + ) + + def ex_unfreeze_container(self, container, ex_timeout=default_time_out): + """ + Set the given container into unfreeze state + + :param container: The container to restart + :type container: :class:`.Container` + + :param ex_timeout: Time to wait for the operation to complete + :type ex_timeout: ``int`` + + :rtype :class: `libcloud.container.base.Container + """ + + return self._do_container_action( + container=container, + action="unfreeze", + timeout=ex_timeout, + force=True, + stateful=True, + ) + + def destroy_container(self, container, ex_timeout=default_time_out): + """ + Destroy a deployed container. Raises and exception + + if the container is running + + :param container: The container to destroy + :type container: :class:`.Container` + + :param ex_timeout: Time to wait for the operation to complete + :type ex_timeout ``int`` + + :rtype: :class:`libcloud.container.base.Container + """ + + # Return: background operation or standard error + req = "/{}/containers/{}".format(self.version, container.name) + + try: + response = self.connection.request(req, method="DELETE") + + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=100) + except BaseHTTPError as err: + # handle the case where the container is running + raise self._get_lxd_api_exception_for_error(err) + + try: + # wait until the timeout...but util getting here the operation + # may have finished already + id = response_dict["metadata"]["id"] + req = "/{}/operations/{}/wait?timeout={}".format(self.version, id, ex_timeout) + response = self.connection.request(req) + except BaseHTTPError as err: + lxd_exception = self._get_lxd_api_exception_for_error(err) + # if not found assume the operation completed + if lxd_exception.message != "not found": + raise lxd_exception + + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + # return a dummy container + container = Container( + driver=self, + name=container.name, + id=container.name, + state=ContainerState.TERMINATED, + image=None, + ip_addresses=[], + extra=None, + ) + return container + + def ex_execute_cmd_on_container(self, cont_id, command, **config): + """ + Description: run a remote command + Operation: async + + Return: Depends on the the configuration + + if wait-for-websocket=true and interactive=false + returns a LXDContainerExecuteResult with: + uuid=uuid, + secret_0=fds["0"], + secret_1=fds["1"], + secret_2=fds["2"], + control=fds["control"], + output={}, result=None + + if wait-for-websocket=true and interactive=true + returns a LXDContainerExecuteResult with: + uuid=uuid, + secret_0=fds["0"], + secret_1=None, + secret_2=None, + control=fds["control"], + output={}, result=None + + if interactive=false and record-output=true + returns a LXDContainerExecuteResult with: + uuid=uuid, + secret_0=None, + secret_1=None, + secret_2=None, + control=None, + output=output, result=result + + if none of the above it assumes that the command has + been executed and returns LXDContainerExecuteResult with: + uuid=uuid, + secret_0=None, + secret_1=None, + secret_2=None, + control=None, + output=None, result=result + + + in all the above uuid is the operation id + + :param cont_id: The container name to run the commands + ":type cont_id: ``str`` + + :param command: a list of strings indicating the commands + and their arguments e.g: ["/bin/bash ls -l"] + :type command ``list`` + + :param config: Dict with extra arguments. + + For example: + + width: Initial width of the terminal default 80 + height: Initial height of the terminal default 25 + user: User to run the command as default 1000 + group: Group to run the command as default 1000 + cwd: Current working directory default /tmp + + wait-for-websocket: Whether to wait for a connection + before starting the process. Default False + + record-output: Whether to store stdout and stderr + (only valid with wait-for-websocket=false) + (requires API extension container_exec_recording). Default False + + interactive: Whether to allocate a pts device + instead of PIPEs. Default true + + :type config ``dict`` + + :rtype LXDContainerExecuteResult + """ + + input = {"command": command} + input = LXDContainerDriver._create_exec_configuration(input, **config) + data = json.dumps(input) + req = "/{}/containers/{}/exec".format(self.version, cont_id) + + # Return: background operation + + # optional websocket information or standard error + response = self.connection.request(req, method="POST", data=data) + + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=100) + + fds = response_dict["metadata"]["metadata"]["fds"] + uuid = response_dict["metadata"]["id"] + + if input["wait-for-websocket"] is True and input["interactive"] is False: + return LXDContainerExecuteResult( + uuid=uuid, + secret_0=fds["0"], + secret_1=fds["1"], + secret_2=fds["2"], + control=fds["control"], + output={}, + result=None, + ) + + elif input["wait-for-websocket"] is True and input["interactive"] is True: + return LXDContainerExecuteResult( + uuid=uuid, + secret_0=fds["0"], + secret_1=None, + secret_2=None, + control=fds["control"], + output={}, + result=None, + ) + + elif input["interactive"] is False and input["record-output"] is True: + output = response_dict["metadata"]["metadata"]["output"] + result = response_dict["metadata"]["metadata"]["result"] + return LXDContainerExecuteResult( + uuid=uuid, + secret_0=None, + secret_1=None, + secret_2=None, + control=None, + output=output, + result=result, + ) + + else: + result = response_dict["metadata"]["metadata"]["result"] + return LXDContainerExecuteResult( + uuid=uuid, + secret_0=None, + secret_1=None, + secret_2=None, + control=None, + output={}, + result=result, + ) + + def list_containers(self, image=None, cluster=None, ex_detailed=True): + """ + List the deployed container images + + :param image: Filter to containers with a certain image + :type image: :class:`.ContainerImage` + + :param cluster: Filter to containers in a cluster + :type cluster: :class:`.ContainerCluster` + + :param ex_detailed: Flag indicating whether detail info + of the containers is required. This will cause a + GET request for every container present in the + host. Default is True + :type ex_detailed: ``bool`` + + :rtype: ``list`` of :class:`libcloud.container.base.Container + """ + + result = self.connection.request("/%s/containers" % self.version) + result = result.parse_body() + + # how to treat the errors???? + assert_response(response_dict=result, status_code=200) + + meta = result["metadata"] + containers = [] + for item in meta: + container_id = item.split("/")[-1] + if not ex_detailed: + container = Container( + driver=self, + name=container_id, + state=ContainerState.UNKNOWN, + id=container_id, + image=image, + ip_addresses=[], + extra={}, + ) + else: + container = self.get_container(id=container_id) + containers.append(container) + + return containers + + def ex_get_image(self, fingerprint): + """ + Returns a container image from the given image fingerprint + + :param fingerprint: image fingerprint + :type fingerprint: ``str`` + + :rtype: :class:`.ContainerImage` + """ + req = "/{}/images/{}".format(self.version, fingerprint) + response = self.connection.request(req) + + # parse the LXDResponse into a dictionary + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + return self._to_image(metadata=response_dict["metadata"]) + + def install_image(self, path, ex_timeout=default_time_out, **ex_img_data): + """ + Install a container image from a remote path. Not that the + path currently is not used. Image data should be provided + under the key 'ex_img_data'. Creating an image in LXD is an + asynchronous operation + + :param path: Path to the container image + :type path: ``str`` + + :param ex_timeout: Time to wait before signaling timeout + :type ex_timeout: ``int`` + + :param ex_img_data: Dictionary describing the image data + :type ex_img_data: ``dict`` + + :rtype: :class:`.ContainerImage` + """ + + if not ex_img_data: + msg = "Install an image for LXD requires " "specification of image_data" + raise LXDAPIException(message=msg) + + # Return: background operation or standard error + data = ex_img_data["source"] + + config = { + "public": data.get("public", True), + "auto_update": data.get("auto_update", False), + "aliases": [data.get("aliases", {})], + "source": {"type": "url", "mode": "pull", "url": data["url"]}, + } + + config = json.dumps(config) + + # background operation or standard error + response = self.connection.request( + "/%s/images" % (self.version), method="POST", data=config + ) + + response_dict = response.parse_body() + + # a background operation is expected + # to be returned status_code = 100 --> Operation created + assert_response(response_dict=response_dict, status_code=100) + + try: + # wait until the timeout...but until getting here the operation + # may have finished already + id = response_dict["metadata"]["id"] + req = "/{}/operations/{}/wait?timeout={}".format(self.version, id, ex_timeout) + response = self.connection.request(req) + except BaseHTTPError as err: + lxd_exception = self._get_lxd_api_exception_for_error(err) + # if not found assume the operation completed + if lxd_exception.message != "not found": + raise lxd_exception + + config = json.loads(config) + + # let's see if the image exists + if len(config["aliases"]) != 0 and "name" in config["aliases"][0]: + image_alias = config["aliases"][0]["name"] + else: + image_alias = config["source"]["url"].split("/")[-1] + + has, fingerprint = self.ex_has_image(alias=image_alias) + if not has: + raise LXDAPIException(message="Image %s was " "not installed " % image_alias) + + return self.ex_get_image(fingerprint=fingerprint) + + def list_images(self): + """ + List of URLs for images the server is publishing + + :rtype: ``list`` of :class:`.ContainerImage` + """ + response = self.connection.request("/%s/images" % (self.version)) + + # parse the LXDResponse into a dictionary + response_dict = response.parse_body() + + assert_response(response_dict=response_dict, status_code=200) + + metadata = response_dict["metadata"] + images = [] + + for image in metadata: + fingerprint = image.split("/")[-1] + images.append(self.ex_get_image(fingerprint=fingerprint)) + return images + + def ex_has_image(self, alias): + """ + Helper function. Returns true and the image fingerprint + if the image with the given alias exists on the host. + + :param alias: the image alias + :type alias: ``str`` + + :rtype: ``tuple`` :: (``boolean``, ``str``) + """ + + # get all the images existing on the host + try: + response = self.connection.request("/{}/images/aliases/{}".format(self.version, alias)) + metadata = response.object["metadata"] + return True, metadata.get("target") + except BaseHTTPError as err: + lxd_exception = self._get_lxd_api_exception_for_error(err) + if lxd_exception.message == "not found": + return False, -1 + else: + raise lxd_exception + except Exception as err: + raise self._get_lxd_api_exception_for_error(err) + + def ex_list_storage_pools(self, detailed=True): + """ + Returns a list of storage pools defined currently defined on the host + + Description: list of storage pools + Authentication: trusted + Operation: sync + + ":rtype: list of StoragePool items + """ + + # Return: list of storage pools that are currently defined on the host + response = self.connection.request("/%s/storage-pools" % self.version) + + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + pools = [] + for pool_item in response_dict["metadata"]: + pool_name = pool_item.split("/")[-1] + + if not detailed: + # attempt to create a minimal StoragePool + pools.append( + self._to_storage_pool( + { + "name": pool_name, + "driver": None, + "used_by": None, + "config": None, + "managed": None, + } + ) + ) + else: + pools.append(self.ex_get_storage_pool(id=pool_name)) + + return pools + + def ex_get_storage_pool(self, id): + """ + Returns information about a storage pool + :param id: the name of the storage pool + :rtype: :class: StoragePool + """ + + # Return: dict representing a storage pool + req = "/{}/storage-pools/{}".format(self.version, id) + response = self.connection.request(req) + + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + if not response_dict["metadata"]: + msg = "Storage pool with name {} has no data".format(id) + raise LXDAPIException(message=msg) + + return self._to_storage_pool(data=response_dict["metadata"]) + + def ex_create_storage_pool(self, definition): + """ + Create a storage_pool from definition. + + Implements POST /1.0/storage-pools + + The `definition` parameter defines + what the storage pool will be. An + example config for the zfs driver is: + + { + "config": { + "size": "10GB" + }, + "driver": "zfs", + "name": "pool1" + } + + Note that **all** fields in the `definition` parameter are strings. + Note that size has to be at least 64MB in order to create the pool + + For further details on the storage pool types see: + https://lxd.readthedocs.io/en/latest/storage/ + + The function returns the a `StoragePool` instance, if it is + successfully created, otherwise an LXDAPIException is raised. + + :param definition: the fields to pass to the LXD API endpoint + :type definition: dict + + :returns: a storage pool if successful, + raises NotFound if not found + :rtype: :class:`StoragePool` + + :raises: :class:`LXDAPIExtensionNotAvailable` + if the 'storage' api extension is missing. + :raises: :class:`LXDAPIException` + if the storage pool couldn't be created. + """ + + if not definition: + raise LXDAPIException("Cannot create a storage pool " " without a definition") + + data = json.dumps(definition) + + # Return: standard return value or standard error + response = self.connection.request( + "/%s/storage-pools" % self.version, method="POST", data=data + ) + + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + return self.ex_get_storage_pool(id=definition["name"]) + + def ex_delete_storage_pool(self, id): + """Delete the storage pool. + + Implements DELETE /1.0/storage-pools/ + + Deleting a storage pool may fail if it is being used. See the LXD + documentation for further details. + + :raises: :class:`LXDAPIException` if the storage pool can't be deleted. + """ + + # Return: standard return value or standard error + req = "/{}/storage-pools/{}".format(self.version, id) + response = self.connection.request(req, method="DELETE") + + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + def ex_list_storage_pool_volumes(self, pool_id, detailed=True): + """ + Description: list of storage volumes + associated with the given storage pool + + :param pool_id: the id of the storage pool to query + :param detailed: boolean flag. + If True extra API calls are made to fill in the missing details + of the storage volumes + + Authentication: trusted + Operation: sync + Return: list of storage volumes that + currently exist on a given storage pool + + :rtype: A list of :class: StorageVolume + """ + + req = "/{}/storage-pools/{}/volumes".format(self.version, pool_id) + response = self.connection.request(req) + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + volumes = [] + + for volume in response_dict["metadata"]: + volume = volume.split("/") + name = volume[-1] + type = volume[-2] + + if not detailed: + metadata = { + "config": {"size": None}, + "name": name, + "type": type, + "used_by": None, + } + volumes.append(self._to_storage_volume(pool_id=pool_id, metadata=metadata)) + else: + volume = self.ex_get_storage_pool_volume(pool_id=pool_id, type=type, name=name) + volumes.append(volume) + + return volumes + + def ex_get_storage_pool_volume(self, pool_id, type, name): + """ + Description: information about a storage volume + of a given type on a storage pool + Introduced: with API extension storage + Authentication: trusted + Operation: sync + Return: A StorageVolume representing a storage volume + """ + req = "/{}/storage-pools/{}/volumes/{}/{}".format(self.version, pool_id, type, name) + response = self.connection.request(req) + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + return self._to_storage_volume(pool_id=pool_id, metadata=response_dict["metadata"]) + + def ex_get_volume_by_name(self, name, vol_type="custom"): + """ + Returns a storage volume that has the given name. + The function will loop over all storage-polls available + and will pick the first volume from the first storage poll + that matches the given name. Thus this function can be + quite expensive + + :param name: The name of the volume to look for + :type name: str + + :param vol_type: The type of the volume default is custom + :type vol_type: str + + :return: A StorageVolume representing a storage volume + """ + + req = "/%s/storage-pools" % self.version + response = self.connection.request(req) + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + pools = response_dict["metadata"] + + for pool in pools: + pool_id = pool.split("/")[-1] + + volumes = self.ex_list_storage_pool_volumes(pool_id=pool_id) + + for vol in volumes: + if vol.name == name: + return vol + + return None + + def create_volume(self, pool_id, definition, **kwargs): + """ + Create a new storage volume on a given storage pool + Operation: sync or async (when copying an existing volume) + :return: A StorageVolume representing a storage volume + """ + + if not definition: + raise LXDAPIException("Cannot create a storage volume " "without a definition") + + size_type = definition.pop("size_type") + definition["config"]["size"] = str( + LXDContainerDriver._to_bytes(definition["config"]["size"], size_type=size_type) + ) + + data = json.dumps(definition) + + # Return: standard return value or standard error + req = "/{}/storage-pools/{}/volumes".format(self.version, pool_id) + response = self.connection.request(req, method="POST", data=data) + + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + return self.ex_get_storage_pool_volume( + pool_id=pool_id, type=definition["type"], name=definition["name"] + ) + + def attach_volume( + self, container_id, volume_id, pool_id, name, path, ex_timeout=default_time_out + ): + """ + Attach the volume with id volume_id + to the container with id container_id + """ + container = self.get_container(id=container_id) + config = container.extra + + # expand the devices for the container + config["devices"] = { + name: {"path": path, "type": "disk", "source": volume_id, "pool": pool_id} + } + + data = json.dumps(config) + + req = "/{}/containers/{}".format(self.version, container_id) + response = self.connection.request(req, method="PUT", data=data) + + response_dict = response.parse_body() + + # a background operation is expected + # to be returned status_code = 100 --> Operation created + assert_response(response_dict=response_dict, status_code=100) + + try: + # wait until the timeout...but util getting here the operation + # may have finished already + oid = response_dict["metadata"]["id"] + req = "/{}/operations/{}/wait?timeout={}".format(self.version, oid, ex_timeout) + response = self.connection.request(req) + except BaseHTTPError as err: + lxd_exception = self._get_lxd_api_exception_for_error(err) + # if not found assume the operation completed + if lxd_exception.message != "not found": + raise lxd_exception + + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + return self.get_container(id=container_id, ex_get_ip_addr=True) + + def ex_replace_storage_volume_config(self, pool_id, type, name, definition): + """ + Replace the storage volume information + :param pool_id: + :param type: + :param name: + :param definition + """ + + if not definition: + raise LXDAPIException("Cannot create a storage " "volume without a definition") + + data = json.dumps(definition) + response = self.connection.request( + "/{}/storage-pools/{}/volumes/{}/{}".format(self.version, pool_id, type, name), + method="PUT", + data=data, + ) + + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + return self.ex_get_storage_pool_volume(pool_id=pool_id, type=type, name=name) + + def ex_delete_storage_pool_volume(self, pool_id, type, name): + """ + Delete a storage volume of a given type on a given storage pool + + :param pool_id: + :type ``str`` + + :param type: + :type ``str`` + + :param name: + :type ``str`` + + :return: + """ + + try: + req = "/{}/storage-pools/{}/volumes/{}/{}".format( + self.version, + pool_id, + type, + name, + ) + response = self.connection.request(req, method="DELETE") + + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + except BaseHTTPError as err: + raise self._get_lxd_api_exception_for_error(err) + + return True + + def ex_list_networks(self): + """ + Returns a list of networks. + Implements GET /1.0/networks + Authentication: trusted + Operation: sync + + :rtype: list of LXDNetwork objects + """ + + req = "/%s/networks" % (self.version) + response = self.connection.request(req) + + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + nets = response_dict["metadata"] + networks = [] + for net in nets: + name = net.split("/")[-1] + networks.append(self.ex_get_network(name=name)) + return networks + + def ex_get_network(self, name): + """ + Returns the LXD network with the given name. + Implements GET /1.0/networks/ + + Authentication: trusted + Operation: sync + + :param name: The name of the network to return + :type name: str + + :rtype: LXDNetwork + """ + req = "/{}/networks/{}".format(self.version, name) + response = self.connection.request(req) + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + return LXDNetwork.build_from_response(response_dict["metadata"]) + + def ex_create_network(self, name, **kwargs): + """ + Create a new network with the given name and + and the specified configuration + + Authentication: trusted + Operation: sync + + :param name: The name of the new network + :type name: str + """ + + kwargs["name"] = name + data = json.dumps(kwargs) + req = "/%s/networks" % self.version + # Return: standard return value or standard error + response = self.connection.request(req, method="POST", data=data) + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + return self.ex_get_network(name=name) + + def ex_delete_network(self, name): + """ + Delete the network with the given name + Authentication: trusted + Operation: sync + + :param name: The network name to delete + :type name: str + + :return: True is successfully deleted the network + """ + + req = "/{}/networks/{}".format(self.version, name) + response = self.connection.request(req, method="DELETE") + response_dict = response.parse_body() + assert_response(response_dict=response_dict, status_code=200) + + return True + + def _to_container(self, metadata): + """ + Returns Container instance built from the given metadata + + :param metadata: dictionary with the container metadata + :type metadata: ``dict`` + + :rtype :class:`libcloud.container.base.Container + """ + + name = metadata["name"] + state = metadata["status"] + + if state == "Running": + state = ContainerState.RUNNING + elif state == "Frozen": + state = ContainerState.PAUSED + else: + state = ContainerState.STOPPED + + extra = metadata + img_id = metadata["config"].get("volatile.base_image", None) + img_version = metadata["config"].get("image.version", None) + ips = metadata["ips"] + + image = ContainerImage( + id=img_id, + name=img_id, + path=None, + version=img_version, + driver=self, + extra=None, + ) + + container = Container( + driver=self, + name=name, + id=name, + state=state, + image=image, + ip_addresses=ips, + extra=extra, + ) + + return container + + def _do_container_action(self, container, action, timeout, force, stateful): + """ + change the container state by performing the given action + action may be either stop, start, restart, freeze or unfreeze + """ + + if action not in LXD_API_STATE_ACTIONS: + raise ValueError("Invalid action specified") + + # cache the state of the container + state = container.state + + data = {"action": action, "timeout": timeout} + data = json.dumps(data) + + # checkout this for stateful: + # https://discuss.linuxcontainers.org/t/error-in-live-migration/1928 + # looks like we are getting "err":"Unable to perform + # container live migration. CRIU isn't installed" + # in the response when stateful is True so remove it for now + req = "/{}/containers/{}/state".format(self.version, container.name) + response = self.connection.request(req, method="PUT", data=data) + + response_dict = response.parse_body() + + # a background operation is expected to + # be returned status_code = 100 --> Operation created + assert_response(response_dict=response_dict, status_code=100) + + if not timeout: + timeout = LXDContainerDriver.default_time_out + + try: + id = response_dict["metadata"]["id"] + req = "/{}/operations/{}/wait?timeout={}".format(self.version, id, timeout) + response = self.connection.request(req) + + except BaseHTTPError as err: + lxd_exception = self._get_lxd_api_exception_for_error(err) + # if not found assume the operation completed + if lxd_exception.message != "not found": + raise lxd_exception + + # if the container is ephemeral and the action is to stop + # then the container is removed so return sth dummy + if state == ContainerState.RUNNING and container.extra["ephemeral"] and action == "stop": + # return a dummy container otherwise we get 404 error + container = Container( + driver=self, + name=container.name, + id=container.name, + state=ContainerState.TERMINATED, + image=None, + ip_addresses=[], + extra=None, + ) + return container + + return self.get_container(id=container.name) + + def _to_image(self, metadata): + """ + Returns a container image from the given metadata + + :param metadata: + :type metadata: ``dict`` + + :rtype: :class:`.ContainerImage` + """ + fingerprint = metadata.get("fingerprint") + aliases = metadata.get("aliases", []) + + if aliases: + name = metadata.get("aliases")[0].get("name") + else: + name = metadata.get("properties", {}).get("description") or fingerprint + + version = metadata.get("update_source", {}).get("alias") + extra = metadata + + return ContainerImage( + id=fingerprint, + name=name, + path=None, + version=version, + driver=self, + extra=extra, + ) + + def _to_storage_pool(self, data): + """ + Given a dictionary with the storage pool configuration + it returns a StoragePool object + :param data: the storage pool configuration + :return: :class: .StoragePool + """ + + return LXDStoragePool( + name=data["name"], + driver=data["driver"], + used_by=data["used_by"], + config=["config"], + managed=False, + ) + + def _deploy_container_from_image( + self, name, image, parameters, cont_params, timeout=default_time_out + ): + """ + Deploy a new container from the given image + + :param name: the name of the container + :param image: .ContainerImage + + :param parameters: dictionary describing the source attribute + :type parameters ``dict`` + + :param cont_params: dictionary describing the container configuration + :type cont_params: dict + + :param timeout: Time to wait for the operation before timeout + :type timeout: int + + :rtype: :class: .Container + """ + + if cont_params is None: + raise LXDAPIException(message="cont_params " "must be a valid dict") + + # container without a pre-populated rootfs + # see https://github.com/lxc/lxd/blob/master/doc/rest-api.md + # can be "image", "migration", "copy" or "none" + data = {"name": name, "source": {"type": "none"}} + + if parameters: + data["source"].update(parameters["source"]) + + if data["source"]["type"] not in LXD_API_IMAGE_SOURCE_TYPE: + msg = "source type must in " + str(LXD_API_IMAGE_SOURCE_TYPE) + raise LXDAPIException(message=msg) + + # add also the other container parameters + data.update(cont_params) + + data = json.dumps(data) + + # Return: background operation or standard error + response = self.connection.request( + "/%s/containers" % self.version, method="POST", data=data + ) + response_dict = response.parse_body() + + # a background operation is expected to + # be returned status_code = 100 --> Operation created + assert_response(response_dict=response_dict, status_code=100) + + # make sure we don't wait indefinitely + # until the operation is done + if not timeout: + timeout = LXDContainerDriver.default_time_out + + try: + # wait untitl the timeout...but util getting here the operation + # may have finished already + id = response_dict["metadata"]["id"] + req_str = "/{}/operations/{}/wait?timeout={}".format(self.version, id, timeout) + response = self.connection.request(req_str) + except BaseHTTPError as err: + lxd_exception = self._get_lxd_api_exception_for_error(err) + # if not found assume the operation completed + if lxd_exception.message != "not found": + raise lxd_exception + return self.get_container(id=name) + + def _to_storage_volume(self, pool_id, metadata): + """ + Returns StorageVolume object from metadata + :param metadata: dict representing the volume + :rtype: StorageVolume + """ + + size = 0 + if "size" in metadata["config"].keys(): + size = LXDContainerDriver._to_gb(metadata["config"].pop("size")) + + extra = { + "pool_id": pool_id, + "type": metadata["type"], + "used_by": metadata["used_by"], + "config": metadata["config"], + } + + return StorageVolume( + id=metadata["name"], + name=metadata["name"], + driver=self, + size=size, + extra=extra, + ) + + def _get_api_version(self): + """ + Get the LXD API version + """ + return LXDContainerDriver.version + + def _ex_connection_class_kwargs(self): + """ + Return extra connection keyword arguments which are passed to the + Connection class constructor. + """ + + if hasattr(self, "key_file") and hasattr(self, "cert_file"): + return { + "key_file": self.key_file, + "cert_file": self.cert_file, + "certificate_validator": self.certificate_validator, + } + return super()._ex_connection_class_kwargs() + + @staticmethod + def _create_exec_configuration(input, **config): + """ + Prepares the input parameters for executyion API call + """ + if "environment" in config.keys(): + input["environment"] = config["environment"] + + if "width" in config.keys(): + input["width"] = int(config["width"]) + else: + input["width"] = 80 + + if "height" in config.keys(): + input["height"] = int(config["height"]) + else: + input["height"] = 25 + + if "user" in config.keys(): + input["user"] = config["user"] + + if "group" in config.keys(): + input["group"] = config["group"] + + if "cwd" in config.keys(): + input["cwd"] = config["cwd"] + + if "wait-for-websocket" in config.keys(): + input["wait-for-websocket"] = config["wait-for-websocket"] + else: + input["wait-for-websocket"] = False + + if "record-output" in config.keys(): + input["record-output"] = config["record-output"] + + if "interactive" in config.keys(): + input["interactive"] = config["interactive"] + + return input + + @staticmethod + def _fix_cont_params(architecture, profiles, ephemeral, config, devices, instance_type): + """ + Returns a dict with the container parameters + """ + + cont_params = {} + + # add also the other container parameters + if architecture is not None: + cont_params["architecture"] = architecture + + if profiles is not None: + cont_params["profiles"] = profiles + else: + cont_params["profiles"] = [LXDContainerDriver.default_profiles] + + if ephemeral is not None: + cont_params["ephemeral"] = ephemeral + else: + cont_params["ephemeral"] = LXDContainerDriver.default_ephemeral + + if config is not None: + cont_params["config"] = config + + if devices is not None: + cont_params["devices"] = devices + + if instance_type is not None: + cont_params["instance_type"] = instance_type + + return cont_params + + def _get_lxd_api_exception_for_error(self, error): + error_dict = json.loads(error.message) + message = error_dict.get("error") + return LXDAPIException(message=message, error_type=error_dict.get("type", "")) + + @staticmethod + def _to_gb(size): + """ + Convert the given size in bytes to gigabyte + :param size: in bytes + :return: int representing the gigabytes + """ + size = int(size) + return size // 10**9 + + @staticmethod + def _to_bytes(size, size_type="GB"): + """ + convert the given size in GB to bytes + :param size: in GBs + :return: int representing bytes + """ + size = int(size) + if size_type == "GB": + return size * 10**9 + elif size_type == "MB": + return size * 10**6 diff --git a/libcloud/container/drivers/rancher.py b/libcloud/container/drivers/rancher.py new file mode 100644 index 0000000000..1e68d5f4ee --- /dev/null +++ b/libcloud/container/drivers/rancher.py @@ -0,0 +1,765 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import base64 + +from libcloud.utils.py3 import b, httplib, urlparse +from libcloud.common.base import JsonResponse, ConnectionUserAndKey +from libcloud.container.base import Container, ContainerImage, ContainerDriver +from libcloud.container.types import ContainerState +from libcloud.container.providers import Provider + +try: + import simplejson as json +except Exception: + import json + + +VALID_RESPONSE_CODES = [ + httplib.OK, + httplib.ACCEPTED, + httplib.CREATED, + httplib.NO_CONTENT, +] + + +class RancherResponse(JsonResponse): + def parse_error(self): + parsed = super().parse_error() + if "fieldName" in parsed: + return "Field {} is {}: {} - {}".format( + parsed["fieldName"], + parsed["code"], + parsed["message"], + parsed["detail"], + ) + else: + return "{} - {}".format(parsed["message"], parsed["detail"]) + + def success(self): + return self.status in VALID_RESPONSE_CODES + + +class RancherException(Exception): + def __init__(self, code, message): + self.code = code + self.message = message + self.args = (code, message) + + def __str__(self): + return "{} {}".format(self.code, self.message) + + def __repr__(self): + return "RancherException {} {}".format(self.code, self.message) + + +class RancherConnection(ConnectionUserAndKey): + responseCls = RancherResponse + timeout = 30 + + def add_default_headers(self, headers): + """ + Add parameters that are necessary for every request + If user and password are specified, include a base http auth + header + """ + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + if self.key and self.user_id: + user_b64 = base64.b64encode(b("{}:{}".format(self.user_id, self.key))) + headers["Authorization"] = "Basic %s" % (user_b64.decode("utf-8")) + return headers + + +class RancherContainerDriver(ContainerDriver): + """ + Driver for Rancher by Rancher Labs. + + This driver is capable of interacting with the Version 1 API of Rancher. + It currently does NOT support the Version 2 API. + + Example: + + >>> from libcloud.container.providers import get_driver + >>> from libcloud.container.types import Provider + + >>> driver = get_driver(Provider.RANCHER) + >>> connection = driver(key="ACCESS_KEY_HERE", + secret="SECRET_KEY_HERE", host="172.30.0.100", port=8080) + + >>> image = ContainerImage("hastebin", "hastebin", "rlister/hastebin", + "latest", driver=None) + >>> newcontainer = connection.deploy_container("myawesomepastebin", + image, environment={"STORAGE_TYPE": "file"}) + + :ivar baseuri: The URL base path to the API. + :type baseuri: ``str`` + """ + + type = Provider.RANCHER + name = "Rancher" + website = "http://rancher.com" + connectionCls = RancherConnection + # Holding off on cluster support for now. + # Only Environment API interaction enabled. + supports_clusters = False + # As in the /v1/ + version = "1" + + def __init__(self, key, secret, secure=True, host="localhost", port=443): + """ + Creates a new Rancher Container driver. + + :param key: API key or username to used (required) + :type key: ``str`` + + :param secret: Secret password to be used (required) + :type secret: ``str`` + + :param secure: Whether to use HTTPS or HTTP. + :type secure: ``bool`` + + :param host: Override hostname used for connections. This can also + be a full URL string, including scheme, port, and base path. + :type host: ``str`` + + :param port: Override port used for connections. + :type port: ``int`` + + :return: A newly initialized driver instance. + """ + + # Parse the Given Host + if "://" not in host and not host.startswith("//"): + host = "//" + host + parsed = urlparse.urlparse(host) + + super().__init__( + key=key, + secret=secret, + secure=False if parsed.scheme == "http" else secure, + host=parsed.hostname, + port=parsed.port if parsed.port else port, + ) + + self.baseuri = parsed.path if parsed.path else "/v%s" % self.version + + def ex_list_stacks(self): + """ + List all Rancher Stacks + + http://docs.rancher.com/rancher/v1.2/en/api/api-resources/environment/ + + :rtype: ``list`` of ``dict`` + """ + + result = self.connection.request("%s/environments" % self.baseuri).object + return result["data"] + + def ex_deploy_stack( + self, + name, + description=None, + docker_compose=None, + environment=None, + external_id=None, + rancher_compose=None, + start=True, + ): + """ + Deploy a new stack. + + http://docs.rancher.com/rancher/v1.2/en/api/api-resources/environment/#create + + :param name: The desired name of the stack. (required) + :type name: ``str`` + + :param description: A desired description for the stack. + :type description: ``str`` + + :param docker_compose: The Docker Compose configuration to use. + :type docker_compose: ``str`` + + :param environment: Environment K/V specific to this stack. + :type environment: ``dict`` + + :param external_id: The externalId of the stack. + :type external_id: ``str`` + + :param rancher_compose: The Rancher Compose configuration for this env. + :type rancher_compose: ``str`` + + :param start: Whether to start this stack on creation. + :type start: ``bool`` + + :return: The newly created stack. + :rtype: ``dict`` + """ + + payload = { + "description": description, + "dockerCompose": docker_compose, + "environment": environment, + "externalId": external_id, + "name": name, + "rancherCompose": rancher_compose, + "startOnCreate": start, + } + data = json.dumps({k: v for (k, v) in payload.items() if v is not None}) + result = self.connection.request( + "%s/environments" % self.baseuri, data=data, method="POST" + ).object + + return result + + def ex_get_stack(self, env_id): + """ + Get a stack by ID + + :param env_id: The stack to be obtained. + :type env_id: ``str`` + + :rtype: ``dict`` + """ + result = self.connection.request("{}/environments/{}".format(self.baseuri, env_id)).object + + return result + + def ex_search_stacks(self, search_params): + """ + Search for stacks matching certain filters + + i.e. ``{ "name": "awesomestack"}`` + + :param search_params: A collection of search parameters to use. + :type search_params: ``dict`` + + :rtype: ``list`` + """ + search_list = [] + for f, v in search_params.items(): + search_list.append(f + "=" + v) + search_items = "&".join(search_list) + result = self.connection.request( + "{}/environments?{}".format(self.baseuri, search_items) + ).object + + return result["data"] + + def ex_destroy_stack(self, env_id): + """ + Destroy a stack by ID + + http://docs.rancher.com/rancher/v1.2/en/api/api-resources/environment/#delete + + :param env_id: The stack to be destroyed. + :type env_id: ``str`` + + :return: True if destroy was successful, False otherwise. + :rtype: ``bool`` + """ + result = self.connection.request( + "{}/environments/{}".format(self.baseuri, env_id), method="DELETE" + ) + return result.status in VALID_RESPONSE_CODES + + def ex_activate_stack(self, env_id): + """ + Activate Services for a stack. + + http://docs.rancher.com/rancher/v1.2/en/api/api-resources/environment/#activateservices + + :param env_id: The stack to activate services for. + :type env_id: ``str`` + + :return: True if activate was successful, False otherwise. + :rtype: ``bool`` + """ + result = self.connection.request( + "{}/environments/{}?action=activateservices".format(self.baseuri, env_id), + method="POST", + ) + return result.status in VALID_RESPONSE_CODES + + def ex_deactivate_stack(self, env_id): + """ + Deactivate Services for a stack. + + http://docs.rancher.com/rancher/v1.2/en/api/api-resources/environment/#deactivateservices + + :param env_id: The stack to deactivate services for. + :type env_id: ``str`` + + :return: True if deactivate was successful, False otherwise. + :rtype: ``bool`` + """ + + result = self.connection.request( + "{}/environments/{}?action=deactivateservices".format(self.baseuri, env_id), + method="POST", + ) + return result.status in VALID_RESPONSE_CODES + + def ex_list_services(self): + """ + List all Rancher Services + + http://docs.rancher.com/rancher/v1.2/en/api/api-resources/service/ + + :rtype: ``list`` of ``dict`` + """ + + result = self.connection.request("%s/services" % self.baseuri).object + return result["data"] + + def ex_deploy_service( + self, + name, + image, + environment_id, + start=True, + assign_service_ip_address=None, + service_description=None, + external_id=None, + metadata=None, + retain_ip=None, + scale=None, + scale_policy=None, + secondary_launch_configs=None, + selector_container=None, + selector_link=None, + vip=None, + **launch_conf, + ): + """ + Deploy a Rancher Service under a stack. + + http://docs.rancher.com/rancher/v1.2/en/api/api-resources/service/#create + + *Any further configuration passed applies to the ``launchConfig``* + + :param name: The desired name of the service. (required) + :type name: ``str`` + + :param image: The Image object to deploy. (required) + :type image: :class:`libcloud.container.base.ContainerImage` + + :param environment_id: The stack ID this service is tied to. (required) + :type environment_id: ``str`` + + :param start: Whether to start the service on creation. + :type start: ``bool`` + + :param assign_service_ip_address: The IP address to assign the service. + :type assign_service_ip_address: ``bool`` + + :param service_description: The service description. + :type service_description: ``str`` + + :param external_id: The externalId for this service. + :type external_id: ``str`` + + :param metadata: K/V Metadata for this service. + :type metadata: ``dict`` + + :param retain_ip: Whether this service should retain its IP. + :type retain_ip: ``bool`` + + :param scale: The scale of containers in this service. + :type scale: ``int`` + + :param scale_policy: The scaling policy for this service. + :type scale_policy: ``dict`` + + :param secondary_launch_configs: Secondary container launch configs. + :type secondary_launch_configs: ``list`` + + :param selector_container: The selectorContainer for this service. + :type selector_container: ``str`` + + :param selector_link: The selectorLink for this service. + :type selector_link: ``type`` + + :param vip: The VIP to assign to this service. + :type vip: ``str`` + + :return: The newly created service. + :rtype: ``dict`` + """ + + launch_conf["imageUuid"] = (self._degen_image(image),) + + service_payload = { + "assignServiceIpAddress": assign_service_ip_address, + "description": service_description, + "environmentId": environment_id, + "externalId": external_id, + "launchConfig": launch_conf, + "metadata": metadata, + "name": name, + "retainIp": retain_ip, + "scale": scale, + "scalePolicy": scale_policy, + "secondary_launch_configs": secondary_launch_configs, + "selectorContainer": selector_container, + "selectorLink": selector_link, + "startOnCreate": start, + "vip": vip, + } + + data = json.dumps({k: v for (k, v) in service_payload.items() if v is not None}) + result = self.connection.request( + "%s/services" % self.baseuri, data=data, method="POST" + ).object + + return result + + def ex_get_service(self, service_id): + """ + Get a service by ID + + :param service_id: The service_id to be obtained. + :type service_id: ``str`` + + :rtype: ``dict`` + """ + result = self.connection.request("{}/services/{}".format(self.baseuri, service_id)).object + + return result + + def ex_search_services(self, search_params): + """ + Search for services matching certain filters + + i.e. ``{ "name": "awesomesause", "environmentId": "1e2"}`` + + :param search_params: A collection of search parameters to use. + :type search_params: ``dict`` + + :rtype: ``list`` + """ + search_list = [] + for f, v in search_params.items(): + search_list.append(f + "=" + v) + search_items = "&".join(search_list) + result = self.connection.request("{}/services?{}".format(self.baseuri, search_items)).object + + return result["data"] + + def ex_destroy_service(self, service_id): + """ + Destroy a service by ID + + http://docs.rancher.com/rancher/v1.2/en/api/api-resources/service/#delete + + :param service_id: The service to be destroyed. + :type service_id: ``str`` + + :return: True if destroy was successful, False otherwise. + :rtype: ``bool`` + """ + result = self.connection.request( + "{}/services/{}".format(self.baseuri, service_id), method="DELETE" + ) + return result.status in VALID_RESPONSE_CODES + + def ex_activate_service(self, service_id): + """ + Activate a service. + + http://docs.rancher.com/rancher/v1.2/en/api/api-resources/service/#activate + + :param service_id: The service to activate services for. + :type service_id: ``str`` + + :return: True if activate was successful, False otherwise. + :rtype: ``bool`` + """ + result = self.connection.request( + "{}/services/{}?action=activate".format(self.baseuri, service_id), method="POST" + ) + return result.status in VALID_RESPONSE_CODES + + def ex_deactivate_service(self, service_id): + """ + Deactivate a service. + + http://docs.rancher.com/rancher/v1.2/en/api/api-resources/service/#deactivate + + :param service_id: The service to deactivate services for. + :type service_id: ``str`` + + :return: True if deactivate was successful, False otherwise. + :rtype: ``bool`` + """ + result = self.connection.request( + "{}/services/{}?action=deactivate".format(self.baseuri, service_id), + method="POST", + ) + return result.status in VALID_RESPONSE_CODES + + def list_containers(self): + """ + List the deployed containers. + + http://docs.rancher.com/rancher/v1.2/en/api/api-resources/container/ + + :rtype: ``list`` of :class:`libcloud.container.base.Container` + """ + + result = self.connection.request("%s/containers" % self.baseuri).object + containers = [self._to_container(value) for value in result["data"]] + return containers + + def deploy_container(self, name, image, parameters=None, start=True, **config): + """ + Deploy a new container. + + http://docs.rancher.com/rancher/v1.2/en/api/api-resources/container/#create + + **The following is the Image format used for ``ContainerImage``** + + *For a ``imageuuid``*: + + - ``docker:://:`` + + *The following applies*: + + - ``id`` = ```` + - ``name`` = ```` + - ``path`` = ``://`` + - ``version`` = ```` + + *Any extra configuration can also be passed i.e. "environment"* + + :param name: The desired name of the container. (required) + :type name: ``str`` + + :param image: The Image object to deploy. (required) + :type image: :class:`libcloud.container.base.ContainerImage` + + :param parameters: Container Image parameters (unused) + :type parameters: ``str`` + + :param start: Whether to start the container on creation(startOnCreate) + :type start: ``bool`` + + :rtype: :class:`Container` + """ + + payload = { + "name": name, + "imageUuid": self._degen_image(image), + "startOnCreate": start, + } + config.update(payload) + + data = json.dumps(config) + + result = self.connection.request( + "%s/containers" % self.baseuri, data=data, method="POST" + ).object + + return self._to_container(result) + + def get_container(self, con_id): + """ + Get a container by ID + + :param con_id: The ID of the container to get + :type con_id: ``str`` + + :rtype: :class:`libcloud.container.base.Container` + """ + result = self.connection.request("{}/containers/{}".format(self.baseuri, con_id)).object + + return self._to_container(result) + + def start_container(self, container): + """ + Start a container + + :param container: The container to be started + :type container: :class:`libcloud.container.base.Container` + + :return: The container refreshed with current data + :rtype: :class:`libcloud.container.base.Container` + """ + result = self.connection.request( + "{}/containers/{}?action=start".format(self.baseuri, container.id), + method="POST", + ).object + + return self._to_container(result) + + def stop_container(self, container): + """ + Stop a container + + :param container: The container to be stopped + :type container: :class:`libcloud.container.base.Container` + + :return: The container refreshed with current data + :rtype: :class:`libcloud.container.base.Container` + """ + result = self.connection.request( + "{}/containers/{}?action=stop".format(self.baseuri, container.id), method="POST" + ).object + + return self._to_container(result) + + def ex_search_containers(self, search_params): + """ + Search for containers matching certain filters + + i.e. ``{ "imageUuid": "docker:mysql", "state": "running"}`` + + :param search_params: A collection of search parameters to use. + :type search_params: ``dict`` + + :rtype: ``list`` + """ + search_list = [] + for f, v in search_params.items(): + search_list.append(f + "=" + v) + search_items = "&".join(search_list) + result = self.connection.request( + "{}/containers?{}".format(self.baseuri, search_items) + ).object + + return result["data"] + + def destroy_container(self, container): + """ + Remove a container + + :param container: The container to be destroyed + :type container: :class:`libcloud.container.base.Container` + + :return: True if the destroy was successful, False otherwise. + :rtype: ``bool`` + """ + result = self.connection.request( + "{}/containers/{}".format(self.baseuri, container.id), method="DELETE" + ).object + + return self._to_container(result) + + def _gen_image(self, imageuuid): + """ + This function converts a valid Rancher ``imageUuid`` string to a valid + image object. Only supports docker based images hence `docker:` must + prefix!! + + Please see the deploy_container() for details on the format. + + :param imageuuid: A valid Rancher image string + i.e. ``docker:rlister/hastebin:8.0`` + :type imageuuid: ``str`` + + :return: Converted ContainerImage object. + :rtype: :class:`libcloud.container.base.ContainerImage` + """ + # Obtain just the name(:version) for parsing + if "/" not in imageuuid: + # String looks like `docker:mysql:8.0` + image_name_version = imageuuid.partition(":")[2] + else: + # String looks like `docker:oracle/mysql:8.0` + image_name_version = imageuuid.rpartition("/")[2] + # Parse based on ':' + if ":" in image_name_version: + version = image_name_version.partition(":")[2] + id = image_name_version.partition(":")[0] + name = id + else: + version = "latest" + id = image_name_version + name = id + # Get our path based on if there was a version + if version != "latest": + path = imageuuid.partition(":")[2].rpartition(":")[0] + else: + path = imageuuid.partition(":")[2] + + return ContainerImage( + id=id, + name=name, + path=path, + version=version, + driver=self.connection.driver, + extra={"imageUuid": imageuuid}, + ) + + def _degen_image(self, image): + """ + Take in an image object to break down into an ``imageUuid`` + + :param image: + :return: + """ + + # Only supporting docker atm + image_type = "docker" + + if image.version is not None: + return image_type + ":" + image.path + ":" + image.version + else: + return image_type + ":" + image.path + + def _to_container(self, data): + """ + Convert container in proper Container instance object + ** Updating is NOT supported!! + + :param data: API data about container i.e. result.object + :return: Proper Container object: + see http://libcloud.readthedocs.io/en/latest/container/api.html + + """ + rancher_state = data["state"] + + # A Removed container is purged after x amt of time. + # Both of these render the container dead (can't be started later) + terminate_condition = ["removed", "purged"] + + if "running" in rancher_state: + state = ContainerState.RUNNING + elif "stopped" in rancher_state: + state = ContainerState.STOPPED + elif "restarting" in rancher_state: + state = ContainerState.REBOOTING + elif "error" in rancher_state: + state = ContainerState.ERROR + elif any(x in rancher_state for x in terminate_condition): + state = ContainerState.TERMINATED + elif data["transitioning"] == "yes": + # Best we can do for current actions + state = ContainerState.PENDING + else: + state = ContainerState.UNKNOWN + + # Everything contained in the json response is dumped in extra + extra = data + + return Container( + id=data["id"], + name=data["name"], + image=self._gen_image(data["imageUuid"]), + ip_addresses=[data["primaryIpAddress"]], + state=state, + driver=self.connection.driver, + extra=extra, + ) diff --git a/libcloud/container/providers.py b/libcloud/container/providers.py new file mode 100644 index 0000000000..0a994fef18 --- /dev/null +++ b/libcloud/container/providers.py @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from types import ModuleType +from typing import TYPE_CHECKING, Type, Union + +from libcloud.container.types import Provider +from libcloud.common.providers import get_driver as _get_provider_driver +from libcloud.common.providers import set_driver as _set_provider_driver + +if TYPE_CHECKING: + # NOTE: This is needed to avoid having setup.py depend on requests + from libcloud.container.base import ContainerDriver + +DRIVERS = { + Provider.DUMMY: ("libcloud.container.drivers.dummy", "DummyContainerDriver"), + Provider.DOCKER: ("libcloud.container.drivers.docker", "DockerContainerDriver"), + Provider.ECS: ("libcloud.container.drivers.ecs", "ElasticContainerDriver"), + Provider.KUBERNETES: ( + "libcloud.container.drivers.kubernetes", + "KubernetesContainerDriver", + ), + Provider.LXD: ("libcloud.container.drivers.lxd", "LXDContainerDriver"), + Provider.RANCHER: ("libcloud.container.drivers.rancher", "RancherContainerDriver"), + Provider.GKE: ("libcloud.container.drivers.gke", "GKEContainerDriver"), +} + + +def get_driver(provider): + # type: (Union[Provider, str]) -> Type[ContainerDriver] + return _get_provider_driver(drivers=DRIVERS, provider=provider) + + +def set_driver(provider, module, klass): + # type: (Union[Provider, str], ModuleType, type) -> Type[ContainerDriver] + return _set_provider_driver(drivers=DRIVERS, provider=provider, module=module, klass=klass) diff --git a/libcloud/container/types.py b/libcloud/container/types.py new file mode 100644 index 0000000000..69c949aa88 --- /dev/null +++ b/libcloud/container/types.py @@ -0,0 +1,83 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__all__ = ["Provider", "ContainerState"] + + +class Type: + @classmethod + def tostring(cls, value): + """Return the string representation of the state object attribute + :param str value: the state object to turn into string + :return: the uppercase string that represents the state object + :rtype: str + """ + return value.upper() + + @classmethod + def fromstring(cls, value): + """Return the state object attribute that matches the string + :param str value: the string to look up + :return: the state object attribute that matches the string + :rtype: str + """ + return getattr(cls, value.upper(), None) + + +class Provider: + """ + Defines for each of the supported providers + + Non-Dummy drivers are sorted in alphabetical order. Please preserve this + ordering when adding new drivers. + """ + + DUMMY = "dummy" + DOCKER = "docker" + ECS = "ecs" + GKE = "GKE" + KUBERNETES = "kubernetes" + LXD = "lxd" + RANCHER = "rancher" + + +class ContainerState(Type): + """ + Standard states for a container + + :cvar RUNNING: Container is running. + :cvar REBOOTING: Container is rebooting. + :cvar TERMINATED: Container is terminated. + This container can't be started later on. + :cvar STOPPED: Container is stopped. + This container can be started later on. + :cvar PENDING: Container is pending. + :cvar SUSPENDED: Container is suspended. + :cvar ERROR: Container is an error state. + Usually no operations can be performed + on the container once it ends up in the error state. + :cvar PAUSED: Container is paused. + :cvar UNKNOWN: Container state is unknown. + """ + + RUNNING = "running" + REBOOTING = "rebooting" + TERMINATED = "terminated" + PENDING = "pending" + UNKNOWN = "unknown" + STOPPED = "stopped" + SUSPENDED = "suspended" + ERROR = "error" + PAUSED = "paused" diff --git a/libcloud/container/utils/__init__.py b/libcloud/container/utils/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/container/utils/docker.py b/libcloud/container/utils/docker.py new file mode 100644 index 0000000000..97c65024d7 --- /dev/null +++ b/libcloud/container/utils/docker.py @@ -0,0 +1,181 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from base64 import b64encode + +from libcloud.common.base import Connection, JsonResponse +from libcloud.container.base import ContainerImage + +__all__ = ["RegistryClient", "HubClient"] + + +class DockerHubConnection(Connection): + responseCls = JsonResponse + + def __init__( + self, + host, + username=None, + password=None, + secure=True, + port=None, + url=None, + timeout=None, + proxy_url=None, + backoff=None, + retry_delay=None, + ): + super().__init__( + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + proxy_url=proxy_url, + backoff=backoff, + retry_delay=retry_delay, + ) + self.username = username + self.password = password + + def add_default_headers(self, headers): + headers["Content-Type"] = "application/json" + if self.username is not None: + authstr = "Basic " + str( + b64encode(("{}:{}".format(self.username, self.password)).encode("latin1")).strip() + ) + headers["Authorization"] = authstr + return headers + + +class RegistryClient: + """ + A client for the Docker v2 registry API + """ + + connectionCls = DockerHubConnection + + def __init__(self, host, username=None, password=None, **kwargs): + """ + Construct a Docker registry client + + :param host: Your registry endpoint, e.g. 'registry.hub.docker.com' + :type host: ``str`` + + :param username: (optional) Your registry account username + :type username: ``str`` + + :param password: (optional) Your registry account password + :type password: ``str`` + """ + self.connection = self.connectionCls(host, username, password, **kwargs) + + def list_images(self, repository_name, namespace="library", max_count=100): + """ + List the tags (versions) in a repository + + :param repository_name: The name of the repository e.g. 'ubuntu' + :type repository_name: ``str`` + + :param namespace: (optional) The docker namespace + :type namespace: ``str`` + + :param max_count: The maximum number of records to return + :type max_count: ``int`` + + :return: A list of images + :rtype: ``list`` of :class:`libcloud.container.base.ContainerImage` + """ + path = "/v2/repositories/{}/{}/tags/?page=1&page_size={}".format( + namespace, + repository_name, + max_count, + ) + response = self.connection.request(path) + images = [] + for image in response.object["results"]: + images.append(self._to_image(repository_name, image)) + return images + + def get_repository(self, repository_name, namespace="library"): + """ + Get the information about a specific repository + + :param repository_name: The name of the repository e.g. 'ubuntu' + :type repository_name: ``str`` + + :param namespace: (optional) The docker namespace + :type namespace: ``str`` + + :return: The details of the repository + :rtype: ``object`` + """ + path = "/v2/repositories/{}/{}/".format(namespace, repository_name) + response = self.connection.request(path) + return response.object + + def get_image(self, repository_name, tag="latest", namespace="library"): + """ + Get an image from a repository with a specific tag + + :param repository_name: The name of the repository, e.g. ubuntu + :type repository_name: ``str`` + + :param tag: (optional) The image tag (defaults to latest) + :type tag: ``str`` + + :param namespace: (optional) The docker namespace + :type namespace: ``str`` + + :return: A container image + :rtype: :class:`libcloud.container.base.ContainerImage` + """ + path = "/v2/repositories/{}/{}/tags/{}/".format(namespace, repository_name, tag) + response = self.connection.request(path) + return self._to_image(repository_name, response.object) + + def _to_image(self, repository_name, obj): + path = "{}/{}:{}".format(self.connection.host, repository_name, obj["name"]) + return ContainerImage( + id=obj["id"], + path=path, + name=path, + version=obj["name"], + extra={"full_size": obj["full_size"]}, + driver=None, + ) + + +class HubClient(RegistryClient): + """ + A client for the Docker Hub API + + The hub is based on the v2 registry API + """ + + host = "registry.hub.docker.com" + + def __init__(self, username=None, password=None, **kwargs): + """ + Construct a Docker hub client + + :param username: (optional) Your Hub account username + :type username: ``str`` + + :param password: (optional) Your hub account password + :type password: ``str`` + """ + super().__init__(self.host, username, password, **kwargs) diff --git a/libcloud/data/pricing.json b/libcloud/data/pricing.json index f86411ae93..e7cdea5ab2 100644 --- a/libcloud/data/pricing.json +++ b/libcloud/data/pricing.json @@ -1,5 +1,34108 @@ { "compute": { + "azure_linux": { + "basica0": { + "australiacentral": 0.024, + "australiacentral2": 0.024, + "australiaeast": 0.024, + "australiasoutheast": 0.024, + "brazilsouth": 0.022, + "brazilsoutheast": 0.0286, + "canadacentral": 0.02, + "canadaeast": 0.02, + "centralindia": 0.018, + "centralus": 0.018, + "eastasia": 0.018, + "eastus": 0.018, + "eastus2": 0.018, + "francecentral": 0.02, + "francesouth": 0.026, + "germanycentral": 0.021, + "germanynortheast": 0.021, + "japaneast": 0.022, + "japanwest": 0.0171, + "koreacentral": 0.018, + "koreasouth": 0.016, + "northcentralus": 0.018, + "northeurope": 0.018, + "southcentralus": 0.018, + "southeastasia": 0.018, + "southindia": 0.016, + "uksouth": 0.02, + "ukwest": 0.02, + "usgovarizona": 0.017, + "usgovtexas": 0.017, + "usgovvirginia": 0.017, + "westcentralus": 0.018, + "westeurope": 0.018, + "westindia": 0.018, + "westus": 0.018, + "westus2": 0.018 + }, + "basica1": { + "australiacentral": 0.032, + "australiacentral2": 0.032, + "australiaeast": 0.032, + "australiasoutheast": 0.032, + "brazilsouth": 0.041, + "brazilsoutheast": 0.0533, + "canadacentral": 0.026, + "canadaeast": 0.026, + "centralindia": 0.03, + "centralus": 0.025, + "eastasia": 0.038, + "eastus": 0.023, + "eastus2": 0.024, + "francecentral": 0.026, + "francesouth": 0.0338, + "germanycentral": 0.029, + "germanynortheast": 0.029, + "japaneast": 0.032, + "japanwest": 0.032, + "koreacentral": 0.032, + "koreasouth": 0.029, + "northcentralus": 0.023, + "northeurope": 0.025, + "southcentralus": 0.025, + "southeastasia": 0.03, + "southindia": 0.033, + "uksouth": 0.026, + "ukwest": 0.026, + "usgovarizona": 0.0218, + "usgovtexas": 0.0218, + "usgovvirginia": 0.0218, + "westcentralus": 0.025, + "westeurope": 0.027, + "westindia": 0.03, + "westus": 0.031, + "westus2": 0.023 + }, + "basica2": { + "australiacentral": 0.098, + "australiacentral2": 0.098, + "australiaeast": 0.098, + "australiasoutheast": 0.104, + "brazilsouth": 0.112, + "brazilsoutheast": 0.146, + "canadacentral": 0.087, + "canadaeast": 0.087, + "centralindia": 0.096, + "centralus": 0.085, + "eastasia": 0.104, + "eastus": 0.079, + "eastus2": 0.068, + "francecentral": 0.101, + "francesouth": 0.1313, + "germanycentral": 0.0863, + "germanynortheast": 0.0863, + "japaneast": 0.109, + "japanwest": 0.099, + "koreacentral": 0.108, + "koreasouth": 0.097, + "northcentralus": 0.085, + "northeurope": 0.075, + "southcentralus": 0.079, + "southeastasia": 0.095, + "southindia": 0.094, + "uksouth": 0.101, + "ukwest": 0.101, + "usgovarizona": 0.0618, + "usgovtexas": 0.0618, + "usgovvirginia": 0.0618, + "westcentralus": 0.079, + "westeurope": 0.078, + "westindia": 0.096, + "westus": 0.081, + "westus2": 0.068 + }, + "basica3": { + "australiacentral": 0.232, + "australiacentral2": 0.232, + "australiaeast": 0.232, + "australiasoutheast": 0.232, + "brazilsouth": 0.232, + "brazilsoutheast": 0.302, + "canadacentral": 0.194, + "canadaeast": 0.194, + "centralindia": 0.232, + "centralus": 0.188, + "eastasia": 0.232, + "eastus": 0.176, + "eastus2": 0.176, + "francecentral": 0.224, + "francesouth": 0.2912, + "germanycentral": 0.216, + "germanynortheast": 0.216, + "japaneast": 0.276, + "japanwest": 0.2196, + "koreacentral": 0.224, + "koreasouth": 0.202, + "northcentralus": 0.188, + "northeurope": 0.188, + "southcentralus": 0.176, + "southeastasia": 0.232, + "southindia": 0.209, + "uksouth": 0.224, + "ukwest": 0.224, + "usgovarizona": 0.16, + "usgovtexas": 0.16, + "usgovvirginia": 0.16, + "westcentralus": 0.176, + "westeurope": 0.204, + "westindia": 0.232, + "westus": 0.188, + "westus2": 0.176 + }, + "basica4": { + "australiacentral": 0.464, + "australiacentral2": 0.464, + "australiaeast": 0.464, + "australiasoutheast": 0.464, + "brazilsouth": 0.464, + "brazilsoutheast": 0.603, + "canadacentral": 0.387, + "canadaeast": 0.387, + "centralindia": 0.464, + "centralus": 0.376, + "eastasia": 0.464, + "eastus": 0.352, + "eastus2": 0.352, + "francecentral": 0.449, + "francesouth": 0.5837, + "germanycentral": 0.432, + "germanynortheast": 0.432, + "japaneast": 0.552, + "japanwest": 0.4392, + "koreacentral": 0.449, + "koreasouth": 0.404, + "northcentralus": 0.376, + "northeurope": 0.376, + "southcentralus": 0.352, + "southeastasia": 0.464, + "southindia": 0.418, + "uksouth": 0.449, + "ukwest": 0.449, + "usgovarizona": 0.32, + "usgovtexas": 0.32, + "usgovvirginia": 0.32, + "westcentralus": 0.352, + "westeurope": 0.408, + "westindia": 0.464, + "westus": 0.376, + "westus2": 0.352 + }, + "lowprioritya1": { + "australiacentral": 0.014, + "australiacentral2": 0.014, + "australiaeast": 0.014, + "australiasoutheast": 0.014, + "brazilsouth": 0.016, + "canadacentral": 0.011, + "canadaeast": 0.011, + "centralindia": 0.013, + "centralus": 0.012, + "eastasia": 0.012, + "eastus": 0.012, + "eastus2": 0.012, + "francecentral": 0.013, + "francesouth": 0.0169, + "japaneast": 0.016, + "japanwest": 0.015, + "koreacentral": 0.013, + "koreasouth": 0.012, + "northcentralus": 0.012, + "northeurope": 0.012, + "southcentralus": 0.012, + "southeastasia": 0.012, + "southindia": 0.012, + "uksouth": 0.013, + "ukwest": 0.013, + "usgovarizona": 0.011, + "usgovtexas": 0.011, + "usgovvirginia": 0.011, + "westcentralus": 0.01, + "westeurope": 0.012, + "westindia": 0.013, + "westus": 0.012, + "westus2": 0.01 + }, + "lowprioritya1v2": { + "australiacentral": 0.01, + "australiacentral2": 0.01, + "australiaeast": 0.01, + "australiasoutheast": 0.01, + "brazilsouth": 0.012, + "brazilsoutheast": 0.0159, + "canadacentral": 0.009, + "canadaeast": 0.009, + "centralindia": 0.009, + "centralus": 0.009, + "eastasia": 0.01, + "eastus": 0.009, + "eastus2": 0.009, + "francecentral": 0.01, + "francesouth": 0.013, + "germanycentral": 0.009, + "germanynorth": 0.0107, + "germanynortheast": 0.009, + "germanywestcentral": 0.0124, + "japaneast": 0.011, + "japanwest": 0.011, + "koreacentral": 0.01, + "koreasouth": 0.009, + "northcentralus": 0.009, + "northeurope": 0.008, + "norwayeast": 0.00902, + "norwaywest": 0.0117, + "southafricanorth": 0.00964, + "southafricawest": 0.0121, + "southcentralus": 0.009, + "southeastasia": 0.009, + "southindia": 0.009, + "switzerlandnorth": 0.00984, + "switzerlandwest": 0.0128, + "uaecentral": 0.0112, + "uaenorth": 0.00864, + "uksouth": 0.01, + "ukwest": 0.01, + "usgovarizona": 0.01, + "usgovtexas": 0.01, + "usgovvirginia": 0.01, + "westcentralus": 0.008, + "westeurope": 0.008, + "westindia": 0.009, + "westus": 0.009, + "westus2": 0.007 + }, + "lowprioritya2": { + "australiacentral": 0.028, + "australiacentral2": 0.028, + "australiaeast": 0.028, + "australiasoutheast": 0.028, + "brazilsouth": 0.032, + "canadacentral": 0.022, + "canadaeast": 0.022, + "centralindia": 0.026, + "centralus": 0.024, + "eastasia": 0.024, + "eastus": 0.024, + "eastus2": 0.024, + "francecentral": 0.026, + "francesouth": 0.0338, + "japaneast": 0.032, + "japanwest": 0.029, + "koreacentral": 0.027, + "koreasouth": 0.024, + "northcentralus": 0.024, + "northeurope": 0.024, + "southcentralus": 0.024, + "southeastasia": 0.024, + "southindia": 0.024, + "uksouth": 0.026, + "ukwest": 0.026, + "usgovarizona": 0.022, + "usgovtexas": 0.022, + "usgovvirginia": 0.022, + "westcentralus": 0.02, + "westeurope": 0.024, + "westindia": 0.026, + "westus": 0.024, + "westus2": 0.02 + }, + "lowprioritya2mv2": { + "australiacentral": 0.03, + "australiacentral2": 0.03, + "australiaeast": 0.03, + "australiasoutheast": 0.036, + "brazilsouth": 0.042, + "brazilsoutheast": 0.0541, + "canadacentral": 0.026, + "canadaeast": 0.026, + "centralindia": 0.032, + "centralus": 0.026, + "eastasia": 0.036, + "eastus": 0.024, + "eastus2": 0.024, + "francecentral": 0.036, + "francesouth": 0.0468, + "germanycentral": 0.032, + "germanynorth": 0.0322, + "germanynortheast": 0.032, + "germanywestcentral": 0.0376, + "japaneast": 0.031, + "japanwest": 0.036, + "koreacentral": 0.027, + "koreasouth": 0.024, + "northcentralus": 0.026, + "northeurope": 0.028, + "norwayeast": 0.0273, + "norwaywest": 0.0355, + "southafricanorth": 0.0266, + "southafricawest": 0.0332, + "southcentralus": 0.025, + "southeastasia": 0.027, + "southindia": 0.029, + "switzerlandnorth": 0.0298, + "switzerlandwest": 0.0387, + "uaecentral": 0.0309, + "uaenorth": 0.0238, + "uksouth": 0.036, + "ukwest": 0.032, + "usgovarizona": 0.035, + "usgovtexas": 0.035, + "usgovvirginia": 0.035, + "westcentralus": 0.024, + "westeurope": 0.025, + "westindia": 0.032, + "westus": 0.03, + "westus2": 0.02 + }, + "lowprioritya2v2": { + "australiacentral": 0.021, + "australiacentral2": 0.021, + "australiaeast": 0.021, + "australiasoutheast": 0.021, + "brazilsouth": 0.026, + "brazilsoutheast": 0.0335, + "canadacentral": 0.018, + "canadaeast": 0.018, + "centralindia": 0.02, + "centralus": 0.018, + "eastasia": 0.021, + "eastus": 0.018, + "eastus2": 0.018, + "francecentral": 0.021, + "francesouth": 0.0273, + "germanycentral": 0.02, + "germanynorth": 0.0213, + "germanynortheast": 0.02, + "germanywestcentral": 0.026, + "japaneast": 0.023, + "japanwest": 0.023, + "koreacentral": 0.02, + "koreasouth": 0.018, + "northcentralus": 0.018, + "northeurope": 0.017, + "norwayeast": 0.0191, + "norwaywest": 0.0249, + "southafricanorth": 0.0204, + "southafricawest": 0.0256, + "southcentralus": 0.018, + "southeastasia": 0.019, + "southindia": 0.02, + "switzerlandnorth": 0.0197, + "switzerlandwest": 0.0256, + "uaecentral": 0.0237, + "uaenorth": 0.0182, + "uksouth": 0.021, + "ukwest": 0.021, + "usgovarizona": 0.019, + "usgovtexas": 0.019, + "usgovvirginia": 0.019, + "westcentralus": 0.017, + "westeurope": 0.017, + "westindia": 0.02, + "westus": 0.018, + "westus2": 0.015 + }, + "lowprioritya3": { + "australiacentral": 0.057, + "australiacentral2": 0.057, + "australiaeast": 0.057, + "australiasoutheast": 0.057, + "brazilsouth": 0.064, + "canadacentral": 0.044, + "canadaeast": 0.044, + "centralindia": 0.052, + "centralus": 0.048, + "eastasia": 0.048, + "eastus": 0.048, + "eastus2": 0.048, + "francecentral": 0.053, + "francesouth": 0.0689, + "japaneast": 0.065, + "japanwest": 0.058, + "koreacentral": 0.053, + "koreasouth": 0.048, + "northcentralus": 0.048, + "northeurope": 0.048, + "southcentralus": 0.048, + "southeastasia": 0.048, + "southindia": 0.047, + "uksouth": 0.053, + "ukwest": 0.053, + "usgovarizona": 0.044, + "usgovtexas": 0.044, + "usgovvirginia": 0.044, + "westcentralus": 0.04, + "westeurope": 0.048, + "westindia": 0.052, + "westus": 0.048, + "westus2": 0.04 + }, + "lowprioritya4": { + "australiacentral": 0.114, + "australiacentral2": 0.114, + "australiaeast": 0.114, + "australiasoutheast": 0.114, + "brazilsouth": 0.128, + "canadacentral": 0.089, + "canadaeast": 0.089, + "centralindia": 0.105, + "centralus": 0.096, + "eastasia": 0.096, + "eastus": 0.096, + "eastus2": 0.096, + "francecentral": 0.106, + "francesouth": 0.1378, + "japaneast": 0.13, + "japanwest": 0.117, + "koreacentral": 0.106, + "koreasouth": 0.095, + "northcentralus": 0.096, + "northeurope": 0.096, + "southcentralus": 0.096, + "southeastasia": 0.096, + "southindia": 0.094, + "uksouth": 0.106, + "ukwest": 0.106, + "usgovarizona": 0.088, + "usgovtexas": 0.088, + "usgovvirginia": 0.088, + "westcentralus": 0.081, + "westeurope": 0.096, + "westindia": 0.105, + "westus": 0.096, + "westus2": 0.081 + }, + "lowprioritya4mv2": { + "australiacentral": 0.062, + "australiacentral2": 0.062, + "australiaeast": 0.062, + "australiasoutheast": 0.075, + "brazilsouth": 0.087, + "brazilsoutheast": 0.114, + "canadacentral": 0.054, + "canadaeast": 0.054, + "centralindia": 0.067, + "centralus": 0.054, + "eastasia": 0.075, + "eastus": 0.048, + "eastus2": 0.05, + "francecentral": 0.075, + "francesouth": 0.0975, + "germanycentral": 0.067, + "germanynorth": 0.0645, + "germanynortheast": 0.067, + "germanywestcentral": 0.0788, + "japaneast": 0.064, + "japanwest": 0.075, + "koreacentral": 0.056, + "koreasouth": 0.05, + "northcentralus": 0.054, + "northeurope": 0.058, + "norwayeast": 0.0572, + "norwaywest": 0.0744, + "southafricanorth": 0.0558, + "southafricawest": 0.0698, + "southcentralus": 0.05, + "southeastasia": 0.056, + "southindia": 0.06, + "switzerlandnorth": 0.0595, + "switzerlandwest": 0.0774, + "uaecentral": 0.0649, + "uaenorth": 0.0499, + "uksouth": 0.075, + "ukwest": 0.067, + "usgovarizona": 0.071, + "usgovtexas": 0.071, + "usgovvirginia": 0.071, + "westcentralus": 0.05, + "westeurope": 0.052, + "westindia": 0.067, + "westus": 0.059, + "westus2": 0.042 + }, + "lowprioritya4v2": { + "australiacentral": 0.044, + "australiacentral2": 0.044, + "australiaeast": 0.044, + "australiasoutheast": 0.044, + "brazilsouth": 0.054, + "brazilsoutheast": 0.0702, + "canadacentral": 0.038, + "canadaeast": 0.038, + "centralindia": 0.041, + "centralus": 0.038, + "eastasia": 0.044, + "eastus": 0.038, + "eastus2": 0.038, + "francecentral": 0.044, + "francesouth": 0.0572, + "germanycentral": 0.042, + "germanynorth": 0.0426, + "germanynortheast": 0.042, + "germanywestcentral": 0.0548, + "japaneast": 0.048, + "japanwest": 0.048, + "koreacentral": 0.043, + "koreasouth": 0.039, + "northcentralus": 0.038, + "northeurope": 0.037, + "norwayeast": 0.0403, + "norwaywest": 0.0523, + "southafricanorth": 0.0426, + "southafricawest": 0.0534, + "southcentralus": 0.038, + "southeastasia": 0.04, + "southindia": 0.041, + "switzerlandnorth": 0.0394, + "switzerlandwest": 0.0512, + "uaecentral": 0.0496, + "uaenorth": 0.0382, + "uksouth": 0.044, + "ukwest": 0.044, + "usgovarizona": 0.039, + "usgovtexas": 0.039, + "usgovvirginia": 0.039, + "westcentralus": 0.035, + "westeurope": 0.037, + "westindia": 0.041, + "westus": 0.038, + "westus2": 0.032 + }, + "lowprioritya5": { + "australiacentral": 0.056, + "australiacentral2": 0.056, + "australiaeast": 0.056, + "australiasoutheast": 0.056, + "brazilsouth": 0.058, + "canadacentral": 0.048, + "canadaeast": 0.048, + "centralindia": 0.052, + "centralus": 0.05, + "eastasia": 0.059, + "eastus": 0.05, + "eastus2": 0.044, + "francecentral": 0.059, + "francesouth": 0.0767, + "japaneast": 0.056, + "japanwest": 0.052, + "koreacentral": 0.034, + "koreasouth": 0.031, + "northcentralus": 0.05, + "northeurope": 0.05, + "southcentralus": 0.044, + "southeastasia": 0.054, + "southindia": 0.047, + "uksouth": 0.059, + "ukwest": 0.059, + "usgovarizona": 0.04, + "usgovtexas": 0.04, + "usgovvirginia": 0.04, + "westcentralus": 0.044, + "westeurope": 0.054, + "westindia": 0.052, + "westus": 0.05, + "westus2": 0.044 + }, + "lowprioritya6": { + "australiacentral": 0.111, + "australiacentral2": 0.111, + "australiaeast": 0.111, + "australiasoutheast": 0.111, + "brazilsouth": 0.116, + "canadacentral": 0.097, + "canadaeast": 0.097, + "centralindia": 0.104, + "centralus": 0.1, + "eastasia": 0.118, + "eastus": 0.1, + "eastus2": 0.088, + "francecentral": 0.119, + "francesouth": 0.1547, + "japaneast": 0.112, + "japanwest": 0.103, + "koreacentral": 0.069, + "koreasouth": 0.062, + "northcentralus": 0.1, + "northeurope": 0.099, + "southcentralus": 0.088, + "southeastasia": 0.108, + "southindia": 0.094, + "uksouth": 0.119, + "ukwest": 0.119, + "usgovarizona": 0.08, + "usgovtexas": 0.08, + "usgovvirginia": 0.08, + "westcentralus": 0.088, + "westeurope": 0.108, + "westindia": 0.104, + "westus": 0.1, + "westus2": 0.088 + }, + "lowprioritya7": { + "australiacentral": 0.222, + "australiacentral2": 0.222, + "australiaeast": 0.222, + "australiasoutheast": 0.222, + "brazilsouth": 0.233, + "canadacentral": 0.194, + "canadaeast": 0.194, + "centralindia": 0.208, + "centralus": 0.2, + "eastasia": 0.235, + "eastus": 0.2, + "eastus2": 0.176, + "francecentral": 0.238, + "francesouth": 0.3094, + "japaneast": 0.225, + "japanwest": 0.206, + "koreacentral": 0.137, + "koreasouth": 0.124, + "northcentralus": 0.2, + "northeurope": 0.198, + "southcentralus": 0.176, + "southeastasia": 0.216, + "southindia": 0.187, + "uksouth": 0.238, + "ukwest": 0.238, + "usgovarizona": 0.16, + "usgovtexas": 0.16, + "usgovvirginia": 0.16, + "westcentralus": 0.176, + "westeurope": 0.216, + "westindia": 0.208, + "westus": 0.2, + "westus2": 0.176 + }, + "lowprioritya8": { + "eastus": 0.195, + "japaneast": 0.242, + "northcentralus": 0.195, + "northeurope": 0.195, + "southcentralus": 0.175, + "westeurope": 0.224, + "westus": 0.195 + }, + "lowprioritya8mv2": { + "australiacentral": 0.131, + "australiacentral2": 0.131, + "australiaeast": 0.131, + "australiasoutheast": 0.157, + "brazilsouth": 0.183, + "brazilsoutheast": 0.238, + "canadacentral": 0.114, + "canadaeast": 0.114, + "centralindia": 0.14, + "centralus": 0.114, + "eastasia": 0.157, + "eastus": 0.095, + "eastus2": 0.105, + "francecentral": 0.157, + "francesouth": 0.2041, + "germanycentral": 0.141, + "germanynorth": 0.129, + "germanynortheast": 0.141, + "germanywestcentral": 0.165, + "japaneast": 0.135, + "japanwest": 0.157, + "koreacentral": 0.117, + "koreasouth": 0.105, + "northcentralus": 0.114, + "northeurope": 0.122, + "norwayeast": 0.12, + "norwaywest": 0.156, + "southafricanorth": 0.117, + "southafricawest": 0.147, + "southcentralus": 0.099, + "southeastasia": 0.118, + "southindia": 0.127, + "switzerlandnorth": 0.119, + "switzerlandwest": 0.155, + "uaecentral": 0.136, + "uaenorth": 0.105, + "uksouth": 0.157, + "ukwest": 0.14, + "usgovarizona": 0.141, + "usgovtexas": 0.141, + "usgovvirginia": 0.141, + "westcentralus": 0.105, + "westeurope": 0.109, + "westindia": 0.14, + "westus": 0.119, + "westus2": 0.087 + }, + "lowprioritya8v2": { + "australiacentral": 0.093, + "australiacentral2": 0.093, + "australiaeast": 0.093, + "australiasoutheast": 0.093, + "brazilsouth": 0.113, + "brazilsoutheast": 0.147, + "canadacentral": 0.08, + "canadaeast": 0.08, + "centralindia": 0.087, + "centralus": 0.08, + "eastasia": 0.093, + "eastus": 0.08, + "eastus2": 0.08, + "francecentral": 0.093, + "francesouth": 0.1209, + "germanycentral": 0.087, + "germanynorth": 0.0853, + "germanynortheast": 0.087, + "germanywestcentral": 0.115, + "japaneast": 0.1, + "japanwest": 0.1, + "koreacentral": 0.09, + "koreasouth": 0.081, + "northcentralus": 0.08, + "northeurope": 0.077, + "norwayeast": 0.0843, + "norwaywest": 0.11, + "southafricanorth": 0.0892, + "southafricawest": 0.112, + "southcentralus": 0.08, + "southeastasia": 0.083, + "southindia": 0.087, + "switzerlandnorth": 0.0787, + "switzerlandwest": 0.102, + "uaecentral": 0.104, + "uaenorth": 0.0799, + "uksouth": 0.093, + "ukwest": 0.093, + "usgovarizona": 0.077, + "usgovtexas": 0.077, + "usgovvirginia": 0.077, + "westcentralus": 0.073, + "westeurope": 0.077, + "westindia": 0.087, + "westus": 0.08, + "westus2": 0.067 + }, + "lowprioritya9": { + "eastus": 0.39, + "japaneast": 0.483, + "northcentralus": 0.39, + "northeurope": 0.39, + "southcentralus": 0.35, + "westeurope": 0.449, + "westus": 0.39 + }, + "lowprioritya10": { + "eastus": 0.156, + "japaneast": 0.193, + "northcentralus": 0.156, + "northeurope": 0.156, + "southcentralus": 0.14, + "westeurope": 0.179, + "westus": 0.156 + }, + "lowprioritya11": { + "eastus": 0.312, + "japaneast": 0.386, + "northcentralus": 0.312, + "northeurope": 0.312, + "southcentralus": 0.28, + "westeurope": 0.359, + "westus": 0.312 + }, + "lowpriorityd1": { + "australiaeast": 0.0186, + "australiasoutheast": 0.0186, + "brazilsouth": 0.019, + "brazilsoutheast": 0.0247, + "centralus": 0.015, + "eastasia": 0.0225, + "eastus": 0.015, + "eastus2": 0.013, + "japaneast": 0.022, + "japanwest": 0.019, + "northcentralus": 0.015, + "northeurope": 0.0146, + "southcentralus": 0.013, + "southeastasia": 0.0196, + "uaecentral": 0.0209, + "uaenorth": 0.0161, + "usgovvirginia": 0.014, + "westeurope": 0.0168, + "westus": 0.015 + }, + "lowpriorityd1v2": { + "australiacentral": 0.0168, + "australiacentral2": 0.0168, + "australiaeast": 0.0168, + "australiasoutheast": 0.0156, + "brazilsouth": 0.017, + "brazilsoutheast": 0.0223, + "canadacentral": 0.014, + "canadaeast": 0.014, + "centralindia": 0.0169, + "centralus": 0.0146, + "eastasia": 0.021, + "eastus": 0.0146, + "eastus2": 0.011, + "francecentral": 0.0175, + "francesouth": 0.0228, + "germanycentral": 0.015, + "germanynorth": 0.0205, + "germanynortheast": 0.015, + "germanywestcentral": 0.0158, + "japaneast": 0.02, + "japanwest": 0.018, + "koreacentral": 0.0165, + "koreasouth": 0.0149, + "northcentralus": 0.0146, + "northeurope": 0.013, + "norwayeast": 0.0149, + "norwaywest": 0.0194, + "southafricanorth": 0.0153, + "southafricawest": 0.0192, + "southcentralus": 0.0127, + "southeastasia": 0.0158, + "southindia": 0.0169, + "switzerlandnorth": 0.0163, + "switzerlandwest": 0.0212, + "uaecentral": 0.0179, + "uaenorth": 0.0137, + "uksouth": 0.0176, + "ukwest": 0.0175, + "usgovarizona": 0.014, + "usgovtexas": 0.014, + "usgovvirginia": 0.014, + "westcentralus": 0.0127, + "westeurope": 0.0136, + "westindia": 0.0169, + "westus": 0.014, + "westus2": 0.011 + }, + "lowpriorityd2": { + "australiaeast": 0.037, + "australiasoutheast": 0.037, + "brazilsouth": 0.038, + "brazilsoutheast": 0.0494, + "centralus": 0.0308, + "eastasia": 0.045, + "eastus": 0.0308, + "eastus2": 0.0268, + "japaneast": 0.044, + "japanwest": 0.038, + "northcentralus": 0.0308, + "northeurope": 0.029, + "southcentralus": 0.0268, + "southeastasia": 0.039, + "uaecentral": 0.0418, + "uaenorth": 0.0322, + "usgovvirginia": 0.0286, + "westeurope": 0.0336, + "westus": 0.0308 + }, + "lowpriorityd2asv4": { + "australiaeast": 0.024, + "brazilsouth": 0.0306, + "centralindia": 0.0202, + "centralus": 0.0217, + "eastasia": 0.0264, + "eastus": 0.0192, + "eastus2": 0.0192, + "francecentral": 0.0224, + "japaneast": 0.0248, + "koreacentral": 0.0236, + "northeurope": 0.0214, + "southcentralus": 0.023, + "southeastasia": 0.024, + "uksouth": 0.0222, + "westeurope": 0.023, + "westus": 0.0224, + "westus2": 0.0192 + }, + "lowpriorityd2av4": { + "australiaeast": 0.024, + "brazilsouth": 0.0306, + "centralindia": 0.0202, + "centralus": 0.0217, + "eastasia": 0.0264, + "eastus": 0.0192, + "eastus2": 0.0192, + "francecentral": 0.0224, + "japaneast": 0.0248, + "koreacentral": 0.0236, + "northeurope": 0.0214, + "southcentralus": 0.023, + "southeastasia": 0.024, + "uksouth": 0.0222, + "westeurope": 0.023, + "westus": 0.0224, + "westus2": 0.0192 + }, + "lowpriorityd2dsv4": { + "australiaeast": 0.0284, + "australiasoutheast": 0.0271, + "brazilsouth": 0.036, + "brazilsoutheast": 0.04, + "canadacentral": 0.0252, + "canadaeast": 0.0271, + "centralindia": 0.0244, + "centralus": 0.0255, + "eastasia": 0.035, + "eastus": 0.0226, + "eastus2": 0.0226, + "francecentral": 0.0264, + "francesouth": 0.0344, + "germanywestcentral": 0.0272, + "japaneast": 0.0292, + "japanwest": 0.0321, + "koreacentral": 0.0278, + "northcentralus": 0.0226, + "northeurope": 0.0252, + "southafricanorth": 0.0303, + "southcentralus": 0.0294, + "southeastasia": 0.0282, + "switzerlandnorth": 0.0339, + "uksouth": 0.0262, + "ukwest": 0.0273, + "usgovarizona": 0.0286, + "usgovtexas": 0.0282, + "usgovvirginia": 0.0286, + "westcentralus": 0.0271, + "westeurope": 0.0272, + "westus": 0.0266, + "westus2": 0.0226 + }, + "lowpriorityd2dv4": { + "australiaeast": 0.0284, + "australiasoutheast": 0.0271, + "brazilsouth": 0.036, + "brazilsoutheast": 0.04, + "canadacentral": 0.0252, + "canadaeast": 0.0271, + "centralindia": 0.0244, + "centralus": 0.0255, + "eastasia": 0.035, + "eastus": 0.0226, + "eastus2": 0.0226, + "francecentral": 0.0264, + "francesouth": 0.0344, + "germanywestcentral": 0.0272, + "japaneast": 0.0292, + "japanwest": 0.0321, + "koreacentral": 0.0278, + "northcentralus": 0.0226, + "northeurope": 0.0252, + "southafricanorth": 0.0303, + "southcentralus": 0.0294, + "southeastasia": 0.0282, + "switzerlandnorth": 0.0339, + "uksouth": 0.0262, + "ukwest": 0.0273, + "usgovarizona": 0.0286, + "usgovtexas": 0.0282, + "usgovvirginia": 0.0286, + "westcentralus": 0.0271, + "westeurope": 0.0272, + "westus": 0.0266, + "westus2": 0.0226 + }, + "lowpriorityd2sv3": { + "australiacentral": 0.025, + "australiacentral2": 0.025, + "australiaeast": 0.025, + "australiasoutheast": 0.025, + "brazilsouth": 0.0318, + "brazilsoutheast": 0.0413, + "canadacentral": 0.022, + "canadaeast": 0.022, + "centralindia": 0.021, + "centralus": 0.022, + "eastasia": 0.0264, + "eastus": 0.019, + "eastus2": 0.019, + "francecentral": 0.0224, + "francesouth": 0.0291, + "germanycentral": 0.026, + "germanynorth": 0.0299, + "germanynortheast": 0.026, + "germanywestcentral": 0.023, + "japaneast": 0.0258, + "japanwest": 0.0258, + "koreacentral": 0.0246, + "koreasouth": 0.022, + "northcentralus": 0.02, + "northeurope": 0.0214, + "norwayeast": 0.0264, + "norwaywest": 0.0343, + "southafricanorth": 0.0268, + "southafricawest": 0.0336, + "southcentralus": 0.022, + "southeastasia": 0.025, + "southindia": 0.027, + "switzerlandnorth": 0.0288, + "switzerlandwest": 0.0374, + "uaecentral": 0.0312, + "uaenorth": 0.024, + "uksouth": 0.023, + "ukwest": 0.023, + "usgovarizona": 0.025, + "usgovtexas": 0.025, + "usgovvirginia": 0.025, + "westcentralus": 0.022, + "westeurope": 0.024, + "westindia": 0.0246, + "westus": 0.023, + "westus2": 0.019 + }, + "lowpriorityd2sv4": { + "australiaeast": 0.024, + "australiasoutheast": 0.025, + "brazilsouth": 0.0306, + "brazilsoutheast": 0.0398, + "canadacentral": 0.0214, + "canadaeast": 0.0214, + "centralindia": 0.0202, + "centralus": 0.0217, + "eastasia": 0.0298, + "eastus": 0.0192, + "eastus2": 0.0192, + "francecentral": 0.0224, + "francesouth": 0.0292, + "germanywestcentral": 0.023, + "japaneast": 0.0248, + "japanwest": 0.0273, + "koreacentral": 0.0236, + "northcentralus": 0.0192, + "northeurope": 0.0214, + "southafricanorth": 0.0257, + "southcentralus": 0.023, + "southeastasia": 0.024, + "switzerlandnorth": 0.0288, + "uksouth": 0.0222, + "ukwest": 0.0232, + "usgovarizona": 0.0242, + "usgovtexas": 0.024, + "usgovvirginia": 0.0242, + "westcentralus": 0.023, + "westeurope": 0.023, + "westus": 0.0224, + "westus2": 0.0192 + }, + "lowpriorityd2v2": { + "australiacentral": 0.0336, + "australiacentral2": 0.0336, + "australiaeast": 0.0336, + "australiasoutheast": 0.031, + "brazilsouth": 0.034, + "brazilsoutheast": 0.0445, + "canadacentral": 0.028, + "canadaeast": 0.028, + "centralindia": 0.0337, + "centralus": 0.029, + "eastasia": 0.0428, + "eastus": 0.029, + "eastus2": 0.0229, + "francecentral": 0.035, + "francesouth": 0.0455, + "germanycentral": 0.031, + "germanynorth": 0.0411, + "germanynortheast": 0.031, + "germanywestcentral": 0.0316, + "japaneast": 0.0409, + "japanwest": 0.036, + "koreacentral": 0.033, + "koreasouth": 0.0297, + "northcentralus": 0.029, + "northeurope": 0.026, + "norwayeast": 0.0299, + "norwaywest": 0.0389, + "southafricanorth": 0.0306, + "southafricawest": 0.0384, + "southcentralus": 0.025, + "southeastasia": 0.0316, + "southindia": 0.0337, + "switzerlandnorth": 0.0326, + "switzerlandwest": 0.0424, + "uaecentral": 0.0357, + "uaenorth": 0.0275, + "uksouth": 0.035, + "ukwest": 0.035, + "usgovarizona": 0.0285, + "usgovtexas": 0.0285, + "usgovvirginia": 0.0285, + "westcentralus": 0.025, + "westeurope": 0.027, + "westindia": 0.0337, + "westus": 0.0279, + "westus2": 0.0229 + }, + "lowpriorityd2v3": { + "australiacentral": 0.025, + "australiacentral2": 0.025, + "australiaeast": 0.025, + "australiasoutheast": 0.025, + "brazilsouth": 0.0318, + "brazilsoutheast": 0.0413, + "canadacentral": 0.022, + "canadaeast": 0.022, + "centralindia": 0.021, + "centralus": 0.022, + "eastasia": 0.0264, + "eastus": 0.019, + "eastus2": 0.019, + "francecentral": 0.0224, + "francesouth": 0.0291, + "germanycentral": 0.026, + "germanynorth": 0.0299, + "germanynortheast": 0.026, + "germanywestcentral": 0.023, + "japaneast": 0.0258, + "japanwest": 0.0258, + "koreacentral": 0.0246, + "koreasouth": 0.022, + "northcentralus": 0.02, + "northeurope": 0.0214, + "norwayeast": 0.0264, + "norwaywest": 0.0343, + "southafricanorth": 0.0268, + "southafricawest": 0.0336, + "southcentralus": 0.022, + "southeastasia": 0.025, + "southindia": 0.027, + "switzerlandnorth": 0.0288, + "switzerlandwest": 0.0374, + "uaecentral": 0.0312, + "uaenorth": 0.024, + "uksouth": 0.023, + "ukwest": 0.023, + "usgovarizona": 0.025, + "usgovtexas": 0.025, + "usgovvirginia": 0.025, + "westcentralus": 0.022, + "westeurope": 0.024, + "westindia": 0.0246, + "westus": 0.023, + "westus2": 0.019 + }, + "lowpriorityd2v4": { + "australiaeast": 0.024, + "australiasoutheast": 0.025, + "brazilsouth": 0.0306, + "brazilsoutheast": 0.0398, + "canadacentral": 0.0214, + "canadaeast": 0.0214, + "centralindia": 0.0202, + "centralus": 0.0217, + "eastasia": 0.0298, + "eastus": 0.0192, + "eastus2": 0.0192, + "francecentral": 0.0224, + "francesouth": 0.0292, + "germanywestcentral": 0.023, + "japaneast": 0.0248, + "japanwest": 0.0273, + "koreacentral": 0.0236, + "northcentralus": 0.0192, + "northeurope": 0.0214, + "southafricanorth": 0.0257, + "southcentralus": 0.023, + "southeastasia": 0.024, + "switzerlandnorth": 0.0288, + "uksouth": 0.0222, + "ukwest": 0.0232, + "usgovarizona": 0.0242, + "usgovtexas": 0.024, + "usgovvirginia": 0.0242, + "westcentralus": 0.023, + "westeurope": 0.023, + "westus": 0.0224, + "westus2": 0.0192 + }, + "lowpriorityd3": { + "australiaeast": 0.074, + "australiasoutheast": 0.074, + "brazilsouth": 0.076, + "brazilsoutheast": 0.0988, + "centralus": 0.0616, + "eastasia": 0.09, + "eastus": 0.0616, + "eastus2": 0.0536, + "japaneast": 0.088, + "japanwest": 0.0768, + "northcentralus": 0.0616, + "northeurope": 0.058, + "southcentralus": 0.0536, + "southeastasia": 0.078, + "uaecentral": 0.0836, + "uaenorth": 0.0643, + "usgovvirginia": 0.057, + "westeurope": 0.067, + "westus": 0.0616 + }, + "lowpriorityd3v2": { + "australiacentral": 0.067, + "australiacentral2": 0.067, + "australiaeast": 0.067, + "australiasoutheast": 0.062, + "brazilsouth": 0.0685, + "brazilsoutheast": 0.089, + "canadacentral": 0.056, + "canadaeast": 0.056, + "centralindia": 0.067, + "centralus": 0.0585, + "eastasia": 0.0857, + "eastus": 0.0585, + "eastus2": 0.0458, + "francecentral": 0.07, + "francesouth": 0.091, + "germanycentral": 0.061, + "germanynorth": 0.0822, + "germanynortheast": 0.061, + "germanywestcentral": 0.063, + "japaneast": 0.0818, + "japanwest": 0.0729, + "koreacentral": 0.066, + "koreasouth": 0.0594, + "northcentralus": 0.0585, + "northeurope": 0.0527, + "norwayeast": 0.0598, + "norwaywest": 0.0778, + "southafricanorth": 0.0614, + "southafricawest": 0.077, + "southcentralus": 0.0509, + "southeastasia": 0.063, + "southindia": 0.067, + "switzerlandnorth": 0.0653, + "switzerlandwest": 0.0849, + "uaecentral": 0.0714, + "uaenorth": 0.055, + "uksouth": 0.07, + "ukwest": 0.07, + "usgovarizona": 0.057, + "usgovtexas": 0.057, + "usgovvirginia": 0.057, + "westcentralus": 0.0509, + "westeurope": 0.054, + "westindia": 0.067, + "westus": 0.0559, + "westus2": 0.0458 + }, + "lowpriorityd4": { + "australiaeast": 0.149, + "australiasoutheast": 0.149, + "brazilsouth": 0.152, + "brazilsoutheast": 0.198, + "centralus": 0.123, + "eastasia": 0.18, + "eastus": 0.123, + "eastus2": 0.107, + "japaneast": 0.177, + "japanwest": 0.154, + "northcentralus": 0.123, + "northeurope": 0.117, + "southcentralus": 0.107, + "southeastasia": 0.157, + "uaecentral": 0.167, + "uaenorth": 0.129, + "usgovvirginia": 0.114, + "westeurope": 0.134, + "westus": 0.123 + }, + "lowpriorityd4asv4": { + "australiaeast": 0.048, + "brazilsouth": 0.0612, + "centralindia": 0.0404, + "centralus": 0.0434, + "eastasia": 0.0528, + "eastus": 0.0384, + "eastus2": 0.0384, + "francecentral": 0.0448, + "japaneast": 0.0496, + "koreacentral": 0.0472, + "northeurope": 0.0428, + "southcentralus": 0.0461, + "southeastasia": 0.048, + "uksouth": 0.0444, + "westeurope": 0.046, + "westus": 0.0448, + "westus2": 0.0384 + }, + "lowpriorityd4av4": { + "australiaeast": 0.048, + "brazilsouth": 0.0612, + "centralindia": 0.0404, + "centralus": 0.0434, + "eastasia": 0.0528, + "eastus": 0.0384, + "eastus2": 0.0384, + "francecentral": 0.0448, + "japaneast": 0.0496, + "koreacentral": 0.0472, + "northeurope": 0.0428, + "southcentralus": 0.0461, + "southeastasia": 0.048, + "uksouth": 0.0444, + "westeurope": 0.046, + "westus": 0.0448, + "westus2": 0.0384 + }, + "lowpriorityd4dsv4": { + "australiaeast": 0.0568, + "australiasoutheast": 0.0542, + "brazilsouth": 0.072, + "brazilsoutheast": 0.0801, + "canadacentral": 0.0504, + "canadaeast": 0.0542, + "centralindia": 0.0488, + "centralus": 0.0511, + "eastasia": 0.0701, + "eastus": 0.0452, + "eastus2": 0.0452, + "francecentral": 0.0528, + "francesouth": 0.0687, + "germanywestcentral": 0.0544, + "japaneast": 0.0584, + "japanwest": 0.0642, + "koreacentral": 0.0556, + "northcentralus": 0.0452, + "northeurope": 0.0504, + "southafricanorth": 0.0606, + "southcentralus": 0.0588, + "southeastasia": 0.0564, + "switzerlandnorth": 0.0678, + "uksouth": 0.0524, + "ukwest": 0.0547, + "usgovarizona": 0.0572, + "usgovtexas": 0.0565, + "usgovvirginia": 0.0572, + "westcentralus": 0.0542, + "westeurope": 0.0544, + "westus": 0.0532, + "westus2": 0.0452 + }, + "lowpriorityd4dv4": { + "australiaeast": 0.0568, + "australiasoutheast": 0.0542, + "brazilsouth": 0.072, + "brazilsoutheast": 0.0801, + "canadacentral": 0.0504, + "canadaeast": 0.0542, + "centralindia": 0.0488, + "centralus": 0.0511, + "eastasia": 0.0701, + "eastus": 0.0452, + "eastus2": 0.0452, + "francecentral": 0.0528, + "francesouth": 0.0687, + "germanywestcentral": 0.0544, + "japaneast": 0.0584, + "japanwest": 0.0642, + "koreacentral": 0.0556, + "northcentralus": 0.0452, + "northeurope": 0.0504, + "southafricanorth": 0.0606, + "southcentralus": 0.0588, + "southeastasia": 0.0564, + "switzerlandnorth": 0.0678, + "uksouth": 0.0524, + "ukwest": 0.0547, + "usgovarizona": 0.0572, + "usgovtexas": 0.0565, + "usgovvirginia": 0.0572, + "westcentralus": 0.0542, + "westeurope": 0.0544, + "westus": 0.0532, + "westus2": 0.0452 + }, + "lowpriorityd4sv3": { + "australiacentral": 0.05, + "australiacentral2": 0.05, + "australiaeast": 0.05, + "australiasoutheast": 0.05, + "brazilsouth": 0.0636, + "brazilsoutheast": 0.0827, + "canadacentral": 0.044, + "canadaeast": 0.044, + "centralindia": 0.042, + "centralus": 0.044, + "eastasia": 0.0528, + "eastus": 0.038, + "eastus2": 0.038, + "francecentral": 0.0448, + "francesouth": 0.0582, + "germanycentral": 0.0518, + "germanynorth": 0.0598, + "germanynortheast": 0.0518, + "germanywestcentral": 0.046, + "japaneast": 0.0516, + "japanwest": 0.0516, + "koreacentral": 0.049, + "koreasouth": 0.044, + "northcentralus": 0.04, + "northeurope": 0.0428, + "norwayeast": 0.0528, + "norwaywest": 0.0686, + "southafricanorth": 0.0536, + "southafricawest": 0.0672, + "southcentralus": 0.044, + "southeastasia": 0.05, + "southindia": 0.054, + "switzerlandnorth": 0.0576, + "switzerlandwest": 0.0749, + "uaecentral": 0.0624, + "uaenorth": 0.048, + "uksouth": 0.046, + "ukwest": 0.046, + "usgovarizona": 0.05, + "usgovtexas": 0.05, + "usgovvirginia": 0.05, + "westcentralus": 0.044, + "westeurope": 0.048, + "westindia": 0.049, + "westus": 0.0468, + "westus2": 0.038 + }, + "lowpriorityd4sv4": { + "australiaeast": 0.048, + "australiasoutheast": 0.0499, + "brazilsouth": 0.0612, + "brazilsoutheast": 0.0796, + "canadacentral": 0.0428, + "canadaeast": 0.0428, + "centralindia": 0.0404, + "centralus": 0.0434, + "eastasia": 0.0595, + "eastus": 0.0384, + "eastus2": 0.0384, + "francecentral": 0.0448, + "francesouth": 0.0584, + "germanywestcentral": 0.046, + "japaneast": 0.0496, + "japanwest": 0.0546, + "koreacentral": 0.0472, + "northcentralus": 0.0384, + "northeurope": 0.0428, + "southafricanorth": 0.0515, + "southcentralus": 0.0461, + "southeastasia": 0.048, + "switzerlandnorth": 0.0576, + "uksouth": 0.0444, + "ukwest": 0.0465, + "usgovarizona": 0.0484, + "usgovtexas": 0.048, + "usgovvirginia": 0.0484, + "westcentralus": 0.0461, + "westeurope": 0.046, + "westus": 0.0448, + "westus2": 0.0384 + }, + "lowpriorityd4v2": { + "australiacentral": 0.135, + "australiacentral2": 0.135, + "australiaeast": 0.135, + "australiasoutheast": 0.125, + "brazilsouth": 0.137, + "brazilsoutheast": 0.178, + "canadacentral": 0.112, + "canadaeast": 0.112, + "centralindia": 0.135, + "centralus": 0.117, + "eastasia": 0.171, + "eastus": 0.117, + "eastus2": 0.0916, + "francecentral": 0.14, + "francesouth": 0.182, + "germanycentral": 0.122, + "germanynorth": 0.164, + "germanynortheast": 0.122, + "germanywestcentral": 0.126, + "japaneast": 0.164, + "japanwest": 0.146, + "koreacentral": 0.132, + "koreasouth": 0.119, + "northcentralus": 0.117, + "northeurope": 0.105, + "norwayeast": 0.12, + "norwaywest": 0.156, + "southafricanorth": 0.123, + "southafricawest": 0.154, + "southcentralus": 0.102, + "southeastasia": 0.126, + "southindia": 0.135, + "switzerlandnorth": 0.131, + "switzerlandwest": 0.17, + "uaecentral": 0.143, + "uaenorth": 0.11, + "uksouth": 0.14, + "ukwest": 0.14, + "usgovarizona": 0.114, + "usgovtexas": 0.114, + "usgovvirginia": 0.114, + "westcentralus": 0.102, + "westeurope": 0.109, + "westindia": 0.135, + "westus": 0.112, + "westus2": 0.0916 + }, + "lowpriorityd4v3": { + "australiacentral": 0.05, + "australiacentral2": 0.05, + "australiaeast": 0.05, + "australiasoutheast": 0.05, + "brazilsouth": 0.0636, + "brazilsoutheast": 0.0827, + "canadacentral": 0.044, + "canadaeast": 0.044, + "centralindia": 0.042, + "centralus": 0.044, + "eastasia": 0.0528, + "eastus": 0.038, + "eastus2": 0.038, + "francecentral": 0.0448, + "francesouth": 0.0582, + "germanycentral": 0.0518, + "germanynorth": 0.0598, + "germanynortheast": 0.0518, + "germanywestcentral": 0.046, + "japaneast": 0.0516, + "japanwest": 0.0516, + "koreacentral": 0.049, + "koreasouth": 0.044, + "northcentralus": 0.04, + "northeurope": 0.0428, + "norwayeast": 0.0528, + "norwaywest": 0.0686, + "southafricanorth": 0.0536, + "southafricawest": 0.0672, + "southcentralus": 0.044, + "southeastasia": 0.05, + "southindia": 0.054, + "switzerlandnorth": 0.0576, + "switzerlandwest": 0.0749, + "uaecentral": 0.0624, + "uaenorth": 0.048, + "uksouth": 0.046, + "ukwest": 0.046, + "usgovarizona": 0.05, + "usgovtexas": 0.05, + "usgovvirginia": 0.05, + "westcentralus": 0.044, + "westeurope": 0.048, + "westindia": 0.049, + "westus": 0.0468, + "westus2": 0.038 + }, + "lowpriorityd4v4": { + "australiaeast": 0.048, + "australiasoutheast": 0.0499, + "brazilsouth": 0.0612, + "brazilsoutheast": 0.0796, + "canadacentral": 0.0428, + "canadaeast": 0.0428, + "centralindia": 0.0404, + "centralus": 0.0434, + "eastasia": 0.0595, + "eastus": 0.0384, + "eastus2": 0.0384, + "francecentral": 0.0448, + "francesouth": 0.0584, + "germanywestcentral": 0.046, + "japaneast": 0.0496, + "japanwest": 0.0546, + "koreacentral": 0.0472, + "northcentralus": 0.0384, + "northeurope": 0.0428, + "southafricanorth": 0.0515, + "southcentralus": 0.0461, + "southeastasia": 0.048, + "switzerlandnorth": 0.0576, + "uksouth": 0.0444, + "ukwest": 0.0465, + "usgovarizona": 0.0484, + "usgovtexas": 0.048, + "usgovvirginia": 0.0484, + "westcentralus": 0.0461, + "westeurope": 0.046, + "westus": 0.0448, + "westus2": 0.0384 + }, + "lowpriorityd5v2": { + "australiacentral": 0.269, + "australiacentral2": 0.269, + "australiaeast": 0.269, + "australiasoutheast": 0.249, + "brazilsouth": 0.274, + "brazilsoutheast": 0.356, + "canadacentral": 0.224, + "canadaeast": 0.224, + "centralindia": 0.27, + "centralus": 0.234, + "eastasia": 0.343, + "eastus": 0.234, + "eastus2": 0.183, + "francecentral": 0.281, + "francesouth": 0.365, + "germanycentral": 0.245, + "germanynorth": 0.329, + "germanynortheast": 0.245, + "germanywestcentral": 0.253, + "japaneast": 0.327, + "japanwest": 0.292, + "koreacentral": 0.264, + "koreasouth": 0.238, + "northcentralus": 0.234, + "northeurope": 0.211, + "norwayeast": 0.239, + "norwaywest": 0.311, + "southafricanorth": 0.245, + "southafricawest": 0.308, + "southcentralus": 0.203, + "southeastasia": 0.253, + "southindia": 0.27, + "switzerlandnorth": 0.261, + "switzerlandwest": 0.339, + "uaecentral": 0.286, + "uaenorth": 0.22, + "uksouth": 0.281, + "ukwest": 0.281, + "usgovarizona": 0.228, + "usgovtexas": 0.228, + "usgovvirginia": 0.228, + "westcentralus": 0.203, + "westeurope": 0.217, + "westindia": 0.27, + "westus": 0.223, + "westus2": 0.183 + }, + "lowpriorityd8asv4": { + "australiaeast": 0.096, + "brazilsouth": 0.122, + "centralindia": 0.0808, + "centralus": 0.0868, + "eastasia": 0.106, + "eastus": 0.0768, + "eastus2": 0.0768, + "francecentral": 0.0896, + "japaneast": 0.0992, + "koreacentral": 0.0944, + "northeurope": 0.0856, + "southcentralus": 0.0922, + "southeastasia": 0.096, + "uksouth": 0.0888, + "westeurope": 0.092, + "westus": 0.0896, + "westus2": 0.0768 + }, + "lowpriorityd8av4": { + "australiaeast": 0.096, + "brazilsouth": 0.122, + "centralindia": 0.0808, + "centralus": 0.0868, + "eastasia": 0.106, + "eastus": 0.0768, + "eastus2": 0.0768, + "francecentral": 0.0896, + "japaneast": 0.0992, + "koreacentral": 0.0944, + "northeurope": 0.0856, + "southcentralus": 0.0922, + "southeastasia": 0.096, + "uksouth": 0.0888, + "westeurope": 0.092, + "westus": 0.0896, + "westus2": 0.0768 + }, + "lowpriorityd8dsv4": { + "australiaeast": 0.114, + "australiasoutheast": 0.108, + "brazilsouth": 0.144, + "brazilsoutheast": 0.16, + "canadacentral": 0.101, + "canadaeast": 0.108, + "centralindia": 0.0976, + "centralus": 0.102, + "eastasia": 0.14, + "eastus": 0.0904, + "eastus2": 0.0904, + "francecentral": 0.106, + "francesouth": 0.137, + "germanywestcentral": 0.109, + "japaneast": 0.117, + "japanwest": 0.128, + "koreacentral": 0.111, + "northcentralus": 0.0904, + "northeurope": 0.101, + "southafricanorth": 0.121, + "southcentralus": 0.118, + "southeastasia": 0.113, + "switzerlandnorth": 0.136, + "uksouth": 0.105, + "ukwest": 0.109, + "usgovarizona": 0.114, + "usgovtexas": 0.113, + "usgovvirginia": 0.114, + "westcentralus": 0.108, + "westeurope": 0.109, + "westus": 0.106, + "westus2": 0.0904 + }, + "lowpriorityd8dv4": { + "australiaeast": 0.114, + "australiasoutheast": 0.108, + "brazilsouth": 0.144, + "brazilsoutheast": 0.16, + "canadacentral": 0.101, + "canadaeast": 0.108, + "centralindia": 0.0976, + "centralus": 0.102, + "eastasia": 0.14, + "eastus": 0.0904, + "eastus2": 0.0904, + "francecentral": 0.106, + "francesouth": 0.137, + "germanywestcentral": 0.109, + "japaneast": 0.117, + "japanwest": 0.128, + "koreacentral": 0.111, + "northcentralus": 0.0904, + "northeurope": 0.101, + "southafricanorth": 0.121, + "southcentralus": 0.118, + "southeastasia": 0.113, + "switzerlandnorth": 0.136, + "uksouth": 0.105, + "ukwest": 0.109, + "usgovarizona": 0.114, + "usgovtexas": 0.113, + "usgovvirginia": 0.114, + "westcentralus": 0.108, + "westeurope": 0.109, + "westus": 0.106, + "westus2": 0.0904 + }, + "lowpriorityd8sv3": { + "australiacentral": 0.1, + "australiacentral2": 0.1, + "australiaeast": 0.1, + "australiasoutheast": 0.1, + "brazilsouth": 0.127, + "brazilsoutheast": 0.165, + "canadacentral": 0.0888, + "canadaeast": 0.0888, + "centralindia": 0.084, + "centralus": 0.088, + "eastasia": 0.106, + "eastus": 0.0768, + "eastus2": 0.0768, + "francecentral": 0.0896, + "francesouth": 0.116, + "germanycentral": 0.1036, + "germanynorth": 0.12, + "germanynortheast": 0.1036, + "germanywestcentral": 0.092, + "japaneast": 0.103, + "japanwest": 0.103, + "koreacentral": 0.098, + "koreasouth": 0.0886, + "northcentralus": 0.08, + "northeurope": 0.0856, + "norwayeast": 0.106, + "norwaywest": 0.137, + "southafricanorth": 0.107, + "southafricawest": 0.134, + "southcentralus": 0.088, + "southeastasia": 0.1, + "southindia": 0.108, + "switzerlandnorth": 0.115, + "switzerlandwest": 0.15, + "uaecentral": 0.125, + "uaenorth": 0.096, + "uksouth": 0.0928, + "ukwest": 0.0928, + "usgovarizona": 0.101, + "usgovtexas": 0.101, + "usgovvirginia": 0.101, + "westcentralus": 0.088, + "westeurope": 0.096, + "westindia": 0.098, + "westus": 0.0936, + "westus2": 0.0768 + }, + "lowpriorityd8sv4": { + "australiaeast": 0.096, + "australiasoutheast": 0.0998, + "brazilsouth": 0.122, + "brazilsoutheast": 0.159, + "canadacentral": 0.0856, + "canadaeast": 0.0856, + "centralindia": 0.0808, + "centralus": 0.0868, + "eastasia": 0.119, + "eastus": 0.0768, + "eastus2": 0.0768, + "francecentral": 0.0896, + "francesouth": 0.117, + "germanywestcentral": 0.092, + "japaneast": 0.0992, + "japanwest": 0.109, + "koreacentral": 0.0944, + "northcentralus": 0.0768, + "northeurope": 0.0856, + "southafricanorth": 0.103, + "southcentralus": 0.0922, + "southeastasia": 0.096, + "switzerlandnorth": 0.115, + "uksouth": 0.0888, + "ukwest": 0.0929, + "usgovarizona": 0.0968, + "usgovtexas": 0.096, + "usgovvirginia": 0.0968, + "westcentralus": 0.0922, + "westeurope": 0.092, + "westus": 0.0896, + "westus2": 0.0768 + }, + "lowpriorityd8v3": { + "australiacentral": 0.1, + "australiacentral2": 0.1, + "australiaeast": 0.1, + "australiasoutheast": 0.1, + "brazilsouth": 0.127, + "brazilsoutheast": 0.165, + "canadacentral": 0.0888, + "canadaeast": 0.0888, + "centralindia": 0.084, + "centralus": 0.088, + "eastasia": 0.106, + "eastus": 0.0768, + "eastus2": 0.0768, + "francecentral": 0.0896, + "francesouth": 0.116, + "germanycentral": 0.1036, + "germanynorth": 0.12, + "germanynortheast": 0.1036, + "germanywestcentral": 0.092, + "japaneast": 0.103, + "japanwest": 0.103, + "koreacentral": 0.098, + "koreasouth": 0.0886, + "northcentralus": 0.08, + "northeurope": 0.0856, + "norwayeast": 0.106, + "norwaywest": 0.137, + "southafricanorth": 0.107, + "southafricawest": 0.134, + "southcentralus": 0.088, + "southeastasia": 0.1, + "southindia": 0.108, + "switzerlandnorth": 0.115, + "switzerlandwest": 0.15, + "uaecentral": 0.125, + "uaenorth": 0.096, + "uksouth": 0.0928, + "ukwest": 0.0928, + "usgovarizona": 0.101, + "usgovtexas": 0.101, + "usgovvirginia": 0.101, + "westcentralus": 0.088, + "westeurope": 0.096, + "westindia": 0.098, + "westus": 0.0936, + "westus2": 0.0768 + }, + "lowpriorityd8v4": { + "australiaeast": 0.096, + "australiasoutheast": 0.0998, + "brazilsouth": 0.122, + "brazilsoutheast": 0.159, + "canadacentral": 0.0856, + "canadaeast": 0.0856, + "centralindia": 0.0808, + "centralus": 0.0868, + "eastasia": 0.119, + "eastus": 0.0768, + "eastus2": 0.0768, + "francecentral": 0.0896, + "francesouth": 0.117, + "germanywestcentral": 0.092, + "japaneast": 0.0992, + "japanwest": 0.109, + "koreacentral": 0.0944, + "northcentralus": 0.0768, + "northeurope": 0.0856, + "southafricanorth": 0.103, + "southcentralus": 0.0922, + "southeastasia": 0.096, + "switzerlandnorth": 0.115, + "uksouth": 0.0888, + "ukwest": 0.0929, + "usgovarizona": 0.0968, + "usgovtexas": 0.096, + "usgovvirginia": 0.0968, + "westcentralus": 0.0922, + "westeurope": 0.092, + "westus": 0.0896, + "westus2": 0.0768 + }, + "lowpriorityd11": { + "australiaeast": 0.042, + "australiasoutheast": 0.042, + "brazilsouth": 0.047, + "brazilsoutheast": 0.0611, + "centralus": 0.0386, + "eastasia": 0.048, + "eastus": 0.0386, + "eastus2": 0.0347, + "japaneast": 0.048, + "japanwest": 0.042, + "northcentralus": 0.0386, + "northeurope": 0.0386, + "southcentralus": 0.0347, + "southeastasia": 0.042, + "uaecentral": 0.0541, + "uaenorth": 0.0416, + "usgovvirginia": 0.037, + "westeurope": 0.0442, + "westus": 0.0386 + }, + "lowpriorityd11v2": { + "australiacentral": 0.0399, + "australiacentral2": 0.0399, + "australiaeast": 0.0399, + "australiasoutheast": 0.0399, + "brazilsouth": 0.047, + "brazilsoutheast": 0.0611, + "canadacentral": 0.0366, + "canadaeast": 0.0366, + "centralindia": 0.0379, + "centralus": 0.037, + "eastasia": 0.0459, + "eastus": 0.037, + "eastus2": 0.0299, + "francecentral": 0.0469, + "francesouth": 0.0608, + "germanycentral": 0.044, + "germanynorth": 0.052, + "germanynortheast": 0.044, + "germanywestcentral": 0.04, + "japaneast": 0.0459, + "japanwest": 0.0399, + "koreacentral": 0.0399, + "koreasouth": 0.0359, + "northcentralus": 0.037, + "northeurope": 0.037, + "norwayeast": 0.0418, + "norwaywest": 0.0543, + "southafricanorth": 0.04, + "southafricawest": 0.0502, + "southcentralus": 0.033, + "southeastasia": 0.038, + "southindia": 0.0379, + "switzerlandnorth": 0.0456, + "switzerlandwest": 0.0593, + "uaecentral": 0.0466, + "uaenorth": 0.0359, + "uksouth": 0.0469, + "ukwest": 0.0469, + "usgovarizona": 0.037, + "usgovtexas": 0.037, + "usgovvirginia": 0.037, + "westcentralus": 0.033, + "westeurope": 0.0379, + "westindia": 0.0379, + "westus": 0.037, + "westus2": 0.0299 + }, + "lowpriorityd12": { + "australiaeast": 0.084, + "australiasoutheast": 0.084, + "brazilsouth": 0.0939, + "brazilsoutheast": 0.122, + "centralus": 0.0771, + "eastasia": 0.0966, + "eastus": 0.077, + "eastus2": 0.069, + "japaneast": 0.0966, + "japanwest": 0.084, + "northcentralus": 0.0771, + "northeurope": 0.0771, + "southcentralus": 0.0694, + "southeastasia": 0.084, + "uaecentral": 0.108, + "uaenorth": 0.0832, + "usgovvirginia": 0.0746, + "westeurope": 0.0885, + "westus": 0.0771 + }, + "lowpriorityd12v2": { + "australiacentral": 0.0798, + "australiacentral2": 0.0798, + "australiaeast": 0.0798, + "australiasoutheast": 0.0798, + "brazilsouth": 0.094, + "brazilsoutheast": 0.122, + "canadacentral": 0.073, + "canadaeast": 0.073, + "centralindia": 0.0758, + "centralus": 0.074, + "eastasia": 0.0918, + "eastus": 0.074, + "eastus2": 0.0598, + "francecentral": 0.0937, + "francesouth": 0.122, + "germanycentral": 0.089, + "germanynorth": 0.104, + "germanynortheast": 0.089, + "germanywestcentral": 0.08, + "japaneast": 0.0918, + "japanwest": 0.0798, + "koreacentral": 0.0798, + "koreasouth": 0.0718, + "northcentralus": 0.074, + "northeurope": 0.074, + "norwayeast": 0.0834, + "norwaywest": 0.108, + "southafricanorth": 0.0802, + "southafricawest": 0.1, + "southcentralus": 0.0665, + "southeastasia": 0.076, + "southindia": 0.0758, + "switzerlandnorth": 0.0912, + "switzerlandwest": 0.119, + "uaecentral": 0.0933, + "uaenorth": 0.0718, + "uksouth": 0.0937, + "ukwest": 0.0937, + "usgovarizona": 0.0746, + "usgovtexas": 0.0746, + "usgovvirginia": 0.0746, + "westcentralus": 0.0665, + "westeurope": 0.0759, + "westindia": 0.0758, + "westus": 0.074, + "westus2": 0.0598 + }, + "lowpriorityd13": { + "australiaeast": 0.168, + "australiasoutheast": 0.168, + "brazilsouth": 0.188, + "brazilsoutheast": 0.244, + "centralus": 0.154, + "eastasia": 0.193, + "eastus": 0.154, + "eastus2": 0.139, + "japaneast": 0.193, + "japanwest": 0.168, + "northcentralus": 0.154, + "northeurope": 0.154, + "southcentralus": 0.139, + "southeastasia": 0.168, + "uaecentral": 0.216, + "uaenorth": 0.166, + "usgovvirginia": 0.149, + "westeurope": 0.177, + "westus": 0.154 + }, + "lowpriorityd13v2": { + "australiacentral": 0.16, + "australiacentral2": 0.16, + "australiaeast": 0.16, + "australiasoutheast": 0.16, + "brazilsouth": 0.188, + "brazilsoutheast": 0.244, + "canadacentral": 0.146, + "canadaeast": 0.146, + "centralindia": 0.152, + "centralus": 0.148, + "eastasia": 0.184, + "eastus": 0.148, + "eastus2": 0.12, + "francecentral": 0.187, + "francesouth": 0.243, + "germanycentral": 0.178, + "germanynorth": 0.208, + "germanynortheast": 0.178, + "germanywestcentral": 0.16, + "japaneast": 0.184, + "japanwest": 0.16, + "koreacentral": 0.16, + "koreasouth": 0.144, + "northcentralus": 0.148, + "northeurope": 0.148, + "norwayeast": 0.167, + "norwaywest": 0.217, + "southafricanorth": 0.16, + "southafricawest": 0.201, + "southcentralus": 0.133, + "southeastasia": 0.153, + "southindia": 0.152, + "switzerlandnorth": 0.182, + "switzerlandwest": 0.237, + "uaecentral": 0.187, + "uaenorth": 0.144, + "uksouth": 0.187, + "ukwest": 0.187, + "usgovarizona": 0.149, + "usgovtexas": 0.149, + "usgovvirginia": 0.149, + "westcentralus": 0.133, + "westeurope": 0.152, + "westindia": 0.152, + "westus": 0.148, + "westus2": 0.12 + }, + "lowpriorityd14": { + "australiaeast": 0.336, + "australiasoutheast": 0.336, + "brazilsouth": 0.376, + "brazilsoutheast": 0.489, + "centralus": 0.308, + "eastasia": 0.386, + "eastus": 0.308, + "eastus2": 0.277, + "japaneast": 0.386, + "japanwest": 0.336, + "northcentralus": 0.308, + "northeurope": 0.308, + "southcentralus": 0.277, + "southeastasia": 0.336, + "uaecentral": 0.433, + "uaenorth": 0.333, + "usgovvirginia": 0.298, + "westeurope": 0.354, + "westus": 0.308 + }, + "lowpriorityd14v2": { + "australiacentral": 0.319, + "australiacentral2": 0.319, + "australiaeast": 0.319, + "australiasoutheast": 0.319, + "brazilsouth": 0.376, + "brazilsoutheast": 0.489, + "canadacentral": 0.293, + "canadaeast": 0.293, + "centralindia": 0.303, + "centralus": 0.296, + "eastasia": 0.367, + "eastus": 0.296, + "eastus2": 0.239, + "francecentral": 0.375, + "francesouth": 0.487, + "germanycentral": 0.356, + "germanynorth": 0.416, + "germanynortheast": 0.356, + "germanywestcentral": 0.32, + "japaneast": 0.367, + "japanwest": 0.319, + "koreacentral": 0.319, + "koreasouth": 0.287, + "northcentralus": 0.296, + "northeurope": 0.296, + "norwayeast": 0.334, + "norwaywest": 0.434, + "southafricanorth": 0.321, + "southafricawest": 0.402, + "southcentralus": 0.266, + "southeastasia": 0.306, + "southindia": 0.303, + "switzerlandnorth": 0.365, + "switzerlandwest": 0.474, + "uaecentral": 0.373, + "uaenorth": 0.287, + "uksouth": 0.375, + "ukwest": 0.375, + "usgovarizona": 0.298, + "usgovtexas": 0.298, + "usgovvirginia": 0.298, + "westcentralus": 0.266, + "westeurope": 0.304, + "westindia": 0.303, + "westus": 0.296, + "westus2": 0.239 + }, + "lowpriorityd15v2": { + "australiacentral": 0.399, + "australiacentral2": 0.399, + "australiaeast": 0.399, + "australiasoutheast": 0.399, + "brazilsouth": 0.47, + "brazilsoutheast": 0.611, + "canadacentral": 0.366, + "canadaeast": 0.366, + "centralindia": 0.379, + "centralus": 0.371, + "eastasia": 0.459, + "eastus": 0.371, + "eastus2": 0.299, + "francecentral": 0.469, + "francesouth": 0.608, + "germanycentral": 0.445, + "germanynorth": 0.52, + "germanynortheast": 0.445, + "germanywestcentral": 0.4, + "japaneast": 0.459, + "japanwest": 0.399, + "koreacentral": 0.399, + "koreasouth": 0.359, + "northcentralus": 0.37, + "northeurope": 0.371, + "norwayeast": 0.417, + "norwaywest": 0.543, + "southafricanorth": 0.401, + "southafricawest": 0.502, + "southcentralus": 0.332, + "southeastasia": 0.382, + "southindia": 0.379, + "switzerlandnorth": 0.456, + "switzerlandwest": 0.593, + "uaecentral": 0.466, + "uaenorth": 0.359, + "uksouth": 0.469, + "ukwest": 0.469, + "usgovarizona": 0.373, + "usgovtexas": 0.373, + "usgovvirginia": 0.373, + "westcentralus": 0.332, + "westeurope": 0.379, + "westindia": 0.379, + "westus": 0.37, + "westus2": 0.299 + }, + "lowpriorityd16asv4": { + "australiaeast": 0.192, + "brazilsouth": 0.245, + "centralindia": 0.162, + "centralus": 0.174, + "eastasia": 0.211, + "eastus": 0.154, + "eastus2": 0.154, + "francecentral": 0.179, + "japaneast": 0.198, + "koreacentral": 0.189, + "northeurope": 0.171, + "southcentralus": 0.184, + "southeastasia": 0.192, + "uksouth": 0.178, + "westeurope": 0.184, + "westus": 0.179, + "westus2": 0.154 + }, + "lowpriorityd16av4": { + "australiaeast": 0.192, + "brazilsouth": 0.245, + "centralindia": 0.162, + "centralus": 0.174, + "eastasia": 0.211, + "eastus": 0.154, + "eastus2": 0.154, + "francecentral": 0.179, + "japaneast": 0.198, + "koreacentral": 0.189, + "northeurope": 0.171, + "southcentralus": 0.184, + "southeastasia": 0.192, + "uksouth": 0.178, + "westeurope": 0.184, + "westus": 0.179, + "westus2": 0.154 + }, + "lowpriorityd16dsv4": { + "australiaeast": 0.227, + "australiasoutheast": 0.217, + "brazilsouth": 0.288, + "brazilsoutheast": 0.32, + "canadacentral": 0.202, + "canadaeast": 0.217, + "centralindia": 0.195, + "centralus": 0.204, + "eastasia": 0.28, + "eastus": 0.181, + "eastus2": 0.181, + "francecentral": 0.211, + "francesouth": 0.275, + "germanywestcentral": 0.218, + "japaneast": 0.234, + "japanwest": 0.257, + "koreacentral": 0.222, + "northcentralus": 0.181, + "northeurope": 0.202, + "southafricanorth": 0.242, + "southcentralus": 0.235, + "southeastasia": 0.226, + "switzerlandnorth": 0.271, + "uksouth": 0.21, + "ukwest": 0.219, + "usgovarizona": 0.229, + "usgovtexas": 0.226, + "usgovvirginia": 0.229, + "westcentralus": 0.217, + "westeurope": 0.218, + "westus": 0.213, + "westus2": 0.181 + }, + "lowpriorityd16dv4": { + "australiaeast": 0.227, + "australiasoutheast": 0.217, + "brazilsouth": 0.288, + "brazilsoutheast": 0.32, + "canadacentral": 0.202, + "canadaeast": 0.217, + "centralindia": 0.195, + "centralus": 0.204, + "eastasia": 0.28, + "eastus": 0.181, + "eastus2": 0.181, + "francecentral": 0.211, + "francesouth": 0.275, + "germanywestcentral": 0.218, + "japaneast": 0.234, + "japanwest": 0.257, + "koreacentral": 0.222, + "northcentralus": 0.181, + "northeurope": 0.202, + "southafricanorth": 0.242, + "southcentralus": 0.235, + "southeastasia": 0.226, + "switzerlandnorth": 0.271, + "uksouth": 0.21, + "ukwest": 0.219, + "usgovarizona": 0.229, + "usgovtexas": 0.226, + "usgovvirginia": 0.229, + "westcentralus": 0.217, + "westeurope": 0.218, + "westus": 0.213, + "westus2": 0.181 + }, + "lowpriorityd16sv3": { + "australiacentral": 0.2, + "australiacentral2": 0.2, + "australiaeast": 0.2, + "australiasoutheast": 0.2, + "brazilsouth": 0.254, + "brazilsoutheast": 0.331, + "canadacentral": 0.178, + "canadaeast": 0.178, + "centralindia": 0.168, + "centralus": 0.176, + "eastasia": 0.211, + "eastus": 0.154, + "eastus2": 0.154, + "francecentral": 0.179, + "francesouth": 0.233, + "germanycentral": 0.207, + "germanynorth": 0.239, + "germanynortheast": 0.207, + "germanywestcentral": 0.184, + "japaneast": 0.206, + "japanwest": 0.206, + "koreacentral": 0.197, + "koreasouth": 0.177, + "northcentralus": 0.16, + "northeurope": 0.171, + "norwayeast": 0.211, + "norwaywest": 0.275, + "southafricanorth": 0.214, + "southafricawest": 0.269, + "southcentralus": 0.176, + "southeastasia": 0.2, + "southindia": 0.216, + "switzerlandnorth": 0.23, + "switzerlandwest": 0.3, + "uaecentral": 0.25, + "uaenorth": 0.192, + "uksouth": 0.186, + "ukwest": 0.186, + "usgovarizona": 0.202, + "usgovtexas": 0.202, + "usgovvirginia": 0.202, + "westcentralus": 0.176, + "westeurope": 0.192, + "westindia": 0.197, + "westus": 0.187, + "westus2": 0.154 + }, + "lowpriorityd16sv4": { + "australiaeast": 0.192, + "australiasoutheast": 0.2, + "brazilsouth": 0.245, + "brazilsoutheast": 0.318, + "canadacentral": 0.171, + "canadaeast": 0.171, + "centralindia": 0.162, + "centralus": 0.174, + "eastasia": 0.238, + "eastus": 0.154, + "eastus2": 0.154, + "francecentral": 0.179, + "francesouth": 0.233, + "germanywestcentral": 0.184, + "japaneast": 0.198, + "japanwest": 0.218, + "koreacentral": 0.189, + "northcentralus": 0.154, + "northeurope": 0.171, + "southafricanorth": 0.206, + "southcentralus": 0.184, + "southeastasia": 0.192, + "switzerlandnorth": 0.23, + "uksouth": 0.178, + "ukwest": 0.186, + "usgovarizona": 0.194, + "usgovtexas": 0.192, + "usgovvirginia": 0.194, + "westcentralus": 0.184, + "westeurope": 0.184, + "westus": 0.179, + "westus2": 0.154 + }, + "lowpriorityd16v3": { + "australiacentral": 0.2, + "australiacentral2": 0.2, + "australiaeast": 0.2, + "australiasoutheast": 0.2, + "brazilsouth": 0.254, + "brazilsoutheast": 0.331, + "canadacentral": 0.178, + "canadaeast": 0.178, + "centralindia": 0.168, + "centralus": 0.176, + "eastasia": 0.211, + "eastus": 0.154, + "eastus2": 0.154, + "francecentral": 0.179, + "francesouth": 0.233, + "germanycentral": 0.207, + "germanynorth": 0.239, + "germanynortheast": 0.207, + "germanywestcentral": 0.184, + "japaneast": 0.206, + "japanwest": 0.206, + "koreacentral": 0.197, + "koreasouth": 0.177, + "northcentralus": 0.16, + "northeurope": 0.171, + "norwayeast": 0.211, + "norwaywest": 0.275, + "southafricanorth": 0.214, + "southafricawest": 0.269, + "southcentralus": 0.176, + "southeastasia": 0.2, + "southindia": 0.216, + "switzerlandnorth": 0.23, + "switzerlandwest": 0.3, + "uaecentral": 0.25, + "uaenorth": 0.192, + "uksouth": 0.186, + "ukwest": 0.186, + "usgovarizona": 0.202, + "usgovtexas": 0.202, + "usgovvirginia": 0.202, + "westcentralus": 0.176, + "westeurope": 0.192, + "westindia": 0.197, + "westus": 0.187, + "westus2": 0.154 + }, + "lowpriorityd16v4": { + "australiaeast": 0.192, + "australiasoutheast": 0.2, + "brazilsouth": 0.245, + "brazilsoutheast": 0.318, + "canadacentral": 0.171, + "canadaeast": 0.171, + "centralindia": 0.162, + "centralus": 0.174, + "eastasia": 0.238, + "eastus": 0.154, + "eastus2": 0.154, + "francecentral": 0.179, + "francesouth": 0.233, + "germanywestcentral": 0.184, + "japaneast": 0.198, + "japanwest": 0.218, + "koreacentral": 0.189, + "northcentralus": 0.154, + "northeurope": 0.171, + "southafricanorth": 0.206, + "southcentralus": 0.184, + "southeastasia": 0.192, + "switzerlandnorth": 0.23, + "uksouth": 0.178, + "ukwest": 0.186, + "usgovarizona": 0.194, + "usgovtexas": 0.192, + "usgovvirginia": 0.194, + "westcentralus": 0.184, + "westeurope": 0.184, + "westus": 0.179, + "westus2": 0.154 + }, + "lowpriorityd32asv4": { + "australiaeast": 0.384, + "brazilsouth": 0.49, + "centralindia": 0.323, + "centralus": 0.347, + "eastasia": 0.422, + "eastus": 0.307, + "eastus2": 0.307, + "francecentral": 0.358, + "japaneast": 0.397, + "koreacentral": 0.378, + "northeurope": 0.342, + "southcentralus": 0.369, + "southeastasia": 0.384, + "uksouth": 0.355, + "westeurope": 0.368, + "westus": 0.358, + "westus2": 0.307 + }, + "lowpriorityd32av4": { + "australiaeast": 0.384, + "brazilsouth": 0.49, + "centralindia": 0.323, + "centralus": 0.347, + "eastasia": 0.422, + "eastus": 0.307, + "eastus2": 0.307, + "francecentral": 0.358, + "japaneast": 0.397, + "koreacentral": 0.378, + "northeurope": 0.342, + "southcentralus": 0.369, + "southeastasia": 0.384, + "uksouth": 0.355, + "westeurope": 0.368, + "westus": 0.358, + "westus2": 0.307 + }, + "lowpriorityd32dsv4": { + "australiaeast": 0.454, + "australiasoutheast": 0.434, + "brazilsouth": 0.576, + "brazilsoutheast": 0.641, + "canadacentral": 0.403, + "canadaeast": 0.434, + "centralindia": 0.39, + "centralus": 0.409, + "eastasia": 0.56, + "eastus": 0.362, + "eastus2": 0.362, + "francecentral": 0.422, + "francesouth": 0.55, + "germanywestcentral": 0.435, + "japaneast": 0.467, + "japanwest": 0.514, + "koreacentral": 0.445, + "northcentralus": 0.362, + "northeurope": 0.403, + "southafricanorth": 0.485, + "southcentralus": 0.47, + "southeastasia": 0.451, + "switzerlandnorth": 0.542, + "uksouth": 0.419, + "ukwest": 0.438, + "usgovarizona": 0.458, + "usgovtexas": 0.452, + "usgovvirginia": 0.458, + "westcentralus": 0.434, + "westeurope": 0.435, + "westus": 0.426, + "westus2": 0.362 + }, + "lowpriorityd32dv4": { + "australiaeast": 0.454, + "australiasoutheast": 0.434, + "brazilsouth": 0.576, + "brazilsoutheast": 0.641, + "canadacentral": 0.403, + "canadaeast": 0.434, + "centralindia": 0.39, + "centralus": 0.409, + "eastasia": 0.56, + "eastus": 0.362, + "eastus2": 0.362, + "francecentral": 0.422, + "francesouth": 0.55, + "germanywestcentral": 0.435, + "japaneast": 0.467, + "japanwest": 0.514, + "koreacentral": 0.445, + "northcentralus": 0.362, + "northeurope": 0.403, + "southafricanorth": 0.485, + "southcentralus": 0.47, + "southeastasia": 0.451, + "switzerlandnorth": 0.542, + "uksouth": 0.419, + "ukwest": 0.438, + "usgovarizona": 0.458, + "usgovtexas": 0.452, + "usgovvirginia": 0.458, + "westcentralus": 0.434, + "westeurope": 0.435, + "westus": 0.426, + "westus2": 0.362 + }, + "lowpriorityd32sv3": { + "australiacentral": 0.4, + "australiacentral2": 0.4, + "australiaeast": 0.4, + "australiasoutheast": 0.4, + "brazilsouth": 0.509, + "brazilsoutheast": 0.661, + "canadacentral": 0.355, + "canadaeast": 0.355, + "centralindia": 0.336, + "centralus": 0.352, + "eastasia": 0.422, + "eastus": 0.307, + "eastus2": 0.307, + "francecentral": 0.358, + "francesouth": 0.466, + "germanycentral": 0.443, + "germanynorth": 0.478, + "germanynortheast": 0.443, + "germanywestcentral": 0.368, + "japaneast": 0.413, + "japanwest": 0.413, + "koreacentral": 0.394, + "koreasouth": 0.354, + "northcentralus": 0.32, + "northeurope": 0.342, + "norwayeast": 0.422, + "norwaywest": 0.549, + "southafricanorth": 0.429, + "southafricawest": 0.538, + "southcentralus": 0.352, + "southeastasia": 0.4, + "southindia": 0.433, + "switzerlandnorth": 0.461, + "switzerlandwest": 0.599, + "uaecentral": 0.499, + "uaenorth": 0.384, + "uksouth": 0.371, + "ukwest": 0.371, + "usgovarizona": 0.403, + "usgovtexas": 0.403, + "usgovvirginia": 0.403, + "westcentralus": 0.352, + "westeurope": 0.384, + "westindia": 0.394, + "westus": 0.374, + "westus2": 0.307 + }, + "lowpriorityd32sv4": { + "australiaeast": 0.384, + "australiasoutheast": 0.399, + "brazilsouth": 0.49, + "brazilsoutheast": 0.636, + "canadacentral": 0.342, + "canadaeast": 0.342, + "centralindia": 0.323, + "centralus": 0.347, + "eastasia": 0.476, + "eastus": 0.307, + "eastus2": 0.307, + "francecentral": 0.358, + "francesouth": 0.467, + "germanywestcentral": 0.368, + "japaneast": 0.397, + "japanwest": 0.436, + "koreacentral": 0.378, + "northcentralus": 0.307, + "northeurope": 0.342, + "southafricanorth": 0.412, + "southcentralus": 0.369, + "southeastasia": 0.384, + "switzerlandnorth": 0.461, + "uksouth": 0.355, + "ukwest": 0.372, + "usgovarizona": 0.387, + "usgovtexas": 0.384, + "usgovvirginia": 0.387, + "westcentralus": 0.369, + "westeurope": 0.368, + "westus": 0.358, + "westus2": 0.307 + }, + "lowpriorityd32v3": { + "australiacentral": 0.4, + "australiacentral2": 0.4, + "australiaeast": 0.4, + "australiasoutheast": 0.4, + "brazilsouth": 0.509, + "brazilsoutheast": 0.661, + "canadacentral": 0.355, + "canadaeast": 0.355, + "centralindia": 0.336, + "centralus": 0.352, + "eastasia": 0.422, + "eastus": 0.307, + "eastus2": 0.307, + "francecentral": 0.358, + "francesouth": 0.466, + "germanycentral": 0.443, + "germanynorth": 0.478, + "germanynortheast": 0.443, + "germanywestcentral": 0.368, + "japaneast": 0.413, + "japanwest": 0.413, + "koreacentral": 0.394, + "koreasouth": 0.354, + "northcentralus": 0.32, + "northeurope": 0.342, + "norwayeast": 0.422, + "norwaywest": 0.549, + "southafricanorth": 0.429, + "southafricawest": 0.538, + "southcentralus": 0.352, + "southeastasia": 0.4, + "southindia": 0.433, + "switzerlandnorth": 0.461, + "switzerlandwest": 0.599, + "uaecentral": 0.499, + "uaenorth": 0.384, + "uksouth": 0.371, + "ukwest": 0.371, + "usgovarizona": 0.403, + "usgovtexas": 0.403, + "usgovvirginia": 0.403, + "westcentralus": 0.352, + "westeurope": 0.384, + "westindia": 0.394, + "westus": 0.374, + "westus2": 0.307 + }, + "lowpriorityd32v4": { + "australiaeast": 0.384, + "australiasoutheast": 0.399, + "brazilsouth": 0.49, + "brazilsoutheast": 0.636, + "canadacentral": 0.342, + "canadaeast": 0.342, + "centralindia": 0.323, + "centralus": 0.347, + "eastasia": 0.476, + "eastus": 0.307, + "eastus2": 0.307, + "francecentral": 0.358, + "francesouth": 0.467, + "germanywestcentral": 0.368, + "japaneast": 0.397, + "japanwest": 0.436, + "koreacentral": 0.378, + "northcentralus": 0.307, + "northeurope": 0.342, + "southafricanorth": 0.412, + "southcentralus": 0.369, + "southeastasia": 0.384, + "switzerlandnorth": 0.461, + "uksouth": 0.355, + "ukwest": 0.372, + "usgovarizona": 0.387, + "usgovtexas": 0.384, + "usgovvirginia": 0.387, + "westcentralus": 0.369, + "westeurope": 0.368, + "westus": 0.358, + "westus2": 0.307 + }, + "lowpriorityd48asv4": { + "australiaeast": 0.576, + "brazilsouth": 0.734, + "centralindia": 0.485, + "centralus": 0.521, + "eastasia": 0.634, + "eastus": 0.461, + "eastus2": 0.461, + "francecentral": 0.538, + "japaneast": 0.595, + "koreacentral": 0.566, + "northeurope": 0.514, + "southcentralus": 0.553, + "southeastasia": 0.576, + "uksouth": 0.533, + "westeurope": 0.552, + "westus": 0.538, + "westus2": 0.461 + }, + "lowpriorityd48av4": { + "australiaeast": 0.576, + "brazilsouth": 0.734, + "centralindia": 0.485, + "centralus": 0.521, + "eastasia": 0.634, + "eastus": 0.461, + "eastus2": 0.461, + "francecentral": 0.538, + "japaneast": 0.595, + "koreacentral": 0.566, + "northeurope": 0.514, + "southcentralus": 0.553, + "southeastasia": 0.576, + "uksouth": 0.533, + "westeurope": 0.552, + "westus": 0.538, + "westus2": 0.461 + }, + "lowpriorityd48dsv4": { + "australiaeast": 0.682, + "australiasoutheast": 0.651, + "brazilsouth": 0.864, + "brazilsoutheast": 0.961, + "canadacentral": 0.605, + "canadaeast": 0.651, + "centralindia": 0.586, + "centralus": 0.613, + "eastasia": 0.841, + "eastus": 0.542, + "eastus2": 0.542, + "francecentral": 0.634, + "francesouth": 0.824, + "germanywestcentral": 0.653, + "japaneast": 0.701, + "japanwest": 0.771, + "koreacentral": 0.667, + "northcentralus": 0.542, + "northeurope": 0.605, + "southafricanorth": 0.727, + "southcentralus": 0.705, + "southeastasia": 0.677, + "switzerlandnorth": 0.814, + "uksouth": 0.629, + "ukwest": 0.656, + "usgovarizona": 0.686, + "usgovtexas": 0.678, + "usgovvirginia": 0.686, + "westcentralus": 0.651, + "westeurope": 0.653, + "westus": 0.638, + "westus2": 0.542 + }, + "lowpriorityd48dv4": { + "australiaeast": 0.682, + "australiasoutheast": 0.651, + "brazilsouth": 0.864, + "brazilsoutheast": 0.961, + "canadacentral": 0.605, + "canadaeast": 0.651, + "centralindia": 0.586, + "centralus": 0.613, + "eastasia": 0.841, + "eastus": 0.542, + "eastus2": 0.542, + "francecentral": 0.634, + "francesouth": 0.824, + "germanywestcentral": 0.653, + "japaneast": 0.701, + "japanwest": 0.771, + "koreacentral": 0.667, + "northcentralus": 0.542, + "northeurope": 0.605, + "southafricanorth": 0.727, + "southcentralus": 0.705, + "southeastasia": 0.677, + "switzerlandnorth": 0.814, + "uksouth": 0.629, + "ukwest": 0.656, + "usgovarizona": 0.686, + "usgovtexas": 0.678, + "usgovvirginia": 0.686, + "westcentralus": 0.651, + "westeurope": 0.653, + "westus": 0.638, + "westus2": 0.542 + }, + "lowpriorityd48sv3": { + "australiacentral": 0.6, + "australiacentral2": 0.6, + "australiaeast": 0.6, + "australiasoutheast": 0.6, + "brazilsouth": 0.763, + "brazilsoutheast": 0.992, + "canadacentral": 0.533, + "canadaeast": 0.533, + "centralindia": 0.504, + "centralus": 0.528, + "eastasia": 0.634, + "eastus": 0.461, + "eastus2": 0.461, + "francecentral": 0.538, + "francesouth": 0.699, + "germanycentral": 0.622, + "germanynorth": 0.718, + "germanynortheast": 0.622, + "germanywestcentral": 0.552, + "japaneast": 0.619, + "japanwest": 0.619, + "koreacentral": 0.59, + "koreasouth": 0.532, + "northcentralus": 0.48, + "northeurope": 0.514, + "norwayeast": 0.634, + "norwaywest": 0.824, + "southafricanorth": 0.643, + "southafricawest": 0.806, + "southcentralus": 0.528, + "southeastasia": 0.6, + "southindia": 0.649, + "switzerlandnorth": 0.691, + "switzerlandwest": 0.899, + "uaecentral": 0.749, + "uaenorth": 0.576, + "uksouth": 0.557, + "ukwest": 0.557, + "usgovarizona": 0.605, + "usgovtexas": 0.605, + "usgovvirginia": 0.605, + "westcentralus": 0.528, + "westeurope": 0.576, + "westindia": 0.59, + "westus": 0.562, + "westus2": 0.461 + }, + "lowpriorityd48sv4": { + "australiaeast": 0.576, + "australiasoutheast": 0.599, + "brazilsouth": 0.734, + "brazilsoutheast": 0.955, + "canadacentral": 0.514, + "canadaeast": 0.514, + "centralindia": 0.485, + "centralus": 0.521, + "eastasia": 0.714, + "eastus": 0.461, + "eastus2": 0.461, + "francecentral": 0.538, + "francesouth": 0.7, + "germanywestcentral": 0.552, + "japaneast": 0.595, + "japanwest": 0.655, + "koreacentral": 0.566, + "northcentralus": 0.461, + "northeurope": 0.514, + "southafricanorth": 0.617, + "southcentralus": 0.553, + "southeastasia": 0.576, + "switzerlandnorth": 0.691, + "uksouth": 0.533, + "ukwest": 0.558, + "usgovarizona": 0.581, + "usgovtexas": 0.576, + "usgovvirginia": 0.581, + "westcentralus": 0.553, + "westeurope": 0.552, + "westus": 0.538, + "westus2": 0.461 + }, + "lowpriorityd48v3": { + "australiacentral": 0.6, + "australiacentral2": 0.6, + "australiaeast": 0.6, + "australiasoutheast": 0.6, + "brazilsouth": 0.763, + "brazilsoutheast": 0.992, + "canadacentral": 0.533, + "canadaeast": 0.533, + "centralindia": 0.504, + "centralus": 0.528, + "eastasia": 0.634, + "eastus": 0.461, + "eastus2": 0.461, + "francecentral": 0.538, + "francesouth": 0.699, + "germanycentral": 0.622, + "germanynorth": 0.718, + "germanynortheast": 0.622, + "germanywestcentral": 0.552, + "japaneast": 0.619, + "japanwest": 0.619, + "koreacentral": 0.59, + "koreasouth": 0.532, + "northcentralus": 0.48, + "northeurope": 0.514, + "norwayeast": 0.634, + "norwaywest": 0.824, + "southafricanorth": 0.643, + "southafricawest": 0.806, + "southcentralus": 0.528, + "southeastasia": 0.6, + "southindia": 0.649, + "switzerlandnorth": 0.691, + "switzerlandwest": 0.899, + "uaecentral": 0.749, + "uaenorth": 0.576, + "uksouth": 0.557, + "ukwest": 0.557, + "usgovarizona": 0.605, + "usgovtexas": 0.605, + "usgovvirginia": 0.605, + "westcentralus": 0.528, + "westeurope": 0.576, + "westindia": 0.59, + "westus": 0.562, + "westus2": 0.461 + }, + "lowpriorityd48v4": { + "australiaeast": 0.576, + "australiasoutheast": 0.599, + "brazilsouth": 0.734, + "brazilsoutheast": 0.955, + "canadacentral": 0.514, + "canadaeast": 0.514, + "centralindia": 0.485, + "centralus": 0.521, + "eastasia": 0.714, + "eastus": 0.461, + "eastus2": 0.461, + "francecentral": 0.538, + "francesouth": 0.7, + "germanywestcentral": 0.552, + "japaneast": 0.595, + "japanwest": 0.655, + "koreacentral": 0.566, + "northcentralus": 0.461, + "northeurope": 0.514, + "southafricanorth": 0.617, + "southcentralus": 0.553, + "southeastasia": 0.576, + "switzerlandnorth": 0.691, + "uksouth": 0.533, + "ukwest": 0.558, + "usgovarizona": 0.581, + "usgovtexas": 0.576, + "usgovvirginia": 0.581, + "westcentralus": 0.553, + "westeurope": 0.552, + "westus": 0.538, + "westus2": 0.461 + }, + "lowpriorityd64asv4": { + "australiaeast": 0.768, + "brazilsouth": 0.979, + "centralindia": 0.646, + "centralus": 0.694, + "eastasia": 0.845, + "eastus": 0.614, + "eastus2": 0.614, + "francecentral": 0.717, + "japaneast": 0.794, + "koreacentral": 0.755, + "northeurope": 0.685, + "southcentralus": 0.737, + "southeastasia": 0.768, + "uksouth": 0.71, + "westeurope": 0.736, + "westus": 0.717, + "westus2": 0.614 + }, + "lowpriorityd64av4": { + "australiaeast": 0.768, + "brazilsouth": 0.979, + "centralindia": 0.646, + "centralus": 0.694, + "eastasia": 0.845, + "eastus": 0.614, + "eastus2": 0.614, + "francecentral": 0.717, + "japaneast": 0.794, + "koreacentral": 0.755, + "northeurope": 0.685, + "southcentralus": 0.737, + "southeastasia": 0.768, + "uksouth": 0.71, + "westeurope": 0.736, + "westus": 0.717, + "westus2": 0.614 + }, + "lowpriorityd64dsv4": { + "australiaeast": 0.909, + "australiasoutheast": 0.868, + "brazilsouth": 1.152, + "brazilsoutheast": 1.281, + "canadacentral": 0.806, + "canadaeast": 0.868, + "centralindia": 0.781, + "centralus": 0.817, + "eastasia": 1.121, + "eastus": 0.723, + "eastus2": 0.723, + "francecentral": 0.845, + "francesouth": 1.099, + "germanywestcentral": 0.87, + "japaneast": 0.934, + "japanwest": 1.028, + "koreacentral": 0.89, + "northcentralus": 0.723, + "northeurope": 0.806, + "southafricanorth": 0.969, + "southcentralus": 0.94, + "southeastasia": 0.902, + "switzerlandnorth": 1.085, + "uksouth": 0.838, + "ukwest": 0.875, + "usgovarizona": 0.915, + "usgovtexas": 0.904, + "usgovvirginia": 0.915, + "westcentralus": 0.868, + "westeurope": 0.87, + "westus": 0.851, + "westus2": 0.723 + }, + "lowpriorityd64dv4": { + "australiaeast": 0.909, + "australiasoutheast": 0.868, + "brazilsouth": 1.152, + "brazilsoutheast": 1.281, + "canadacentral": 0.806, + "canadaeast": 0.868, + "centralindia": 0.781, + "centralus": 0.817, + "eastasia": 1.121, + "eastus": 0.723, + "eastus2": 0.723, + "francecentral": 0.845, + "francesouth": 1.099, + "germanywestcentral": 0.87, + "japaneast": 0.934, + "japanwest": 1.028, + "koreacentral": 0.89, + "northcentralus": 0.723, + "northeurope": 0.806, + "southafricanorth": 0.969, + "southcentralus": 0.94, + "southeastasia": 0.902, + "switzerlandnorth": 1.085, + "uksouth": 0.838, + "ukwest": 0.875, + "usgovarizona": 0.915, + "usgovtexas": 0.904, + "usgovvirginia": 0.915, + "westcentralus": 0.868, + "westeurope": 0.87, + "westus": 0.851, + "westus2": 0.723 + }, + "lowpriorityd64sv3": { + "australiacentral": 0.8, + "australiacentral2": 0.8, + "australiaeast": 0.8, + "australiasoutheast": 0.8, + "brazilsouth": 1.018, + "brazilsoutheast": 1.323, + "canadacentral": 0.71, + "canadaeast": 0.71, + "centralindia": 0.672, + "centralus": 0.704, + "eastasia": 0.845, + "eastus": 0.614, + "eastus2": 0.614, + "francecentral": 0.717, + "francesouth": 0.932, + "germanycentral": 0.886, + "germanynorth": 0.957, + "germanynortheast": 0.886, + "germanywestcentral": 0.736, + "japaneast": 0.826, + "japanwest": 0.826, + "koreacentral": 0.787, + "koreasouth": 0.709, + "northcentralus": 0.64, + "northeurope": 0.685, + "norwayeast": 0.845, + "norwaywest": 1.098, + "southafricanorth": 0.858, + "southafricawest": 1.075, + "southcentralus": 0.704, + "southeastasia": 0.8, + "southindia": 0.866, + "switzerlandnorth": 0.922, + "switzerlandwest": 1.198, + "uaecentral": 0.998, + "uaenorth": 0.768, + "uksouth": 0.742, + "ukwest": 0.742, + "usgovarizona": 0.806, + "usgovtexas": 0.806, + "usgovvirginia": 0.806, + "westcentralus": 0.704, + "westeurope": 0.768, + "westindia": 0.787, + "westus": 0.749, + "westus2": 0.614 + }, + "lowpriorityd64sv4": { + "australiaeast": 0.768, + "australiasoutheast": 0.799, + "brazilsouth": 0.979, + "brazilsoutheast": 1.273, + "canadacentral": 0.685, + "canadaeast": 0.685, + "centralindia": 0.646, + "centralus": 0.694, + "eastasia": 0.952, + "eastus": 0.614, + "eastus2": 0.614, + "francecentral": 0.717, + "francesouth": 0.934, + "germanywestcentral": 0.736, + "japaneast": 0.794, + "japanwest": 0.873, + "koreacentral": 0.755, + "northcentralus": 0.614, + "northeurope": 0.685, + "southafricanorth": 0.823, + "southcentralus": 0.737, + "southeastasia": 0.768, + "switzerlandnorth": 0.922, + "uksouth": 0.71, + "ukwest": 0.743, + "usgovarizona": 0.774, + "usgovtexas": 0.768, + "usgovvirginia": 0.774, + "westcentralus": 0.737, + "westeurope": 0.736, + "westus": 0.717, + "westus2": 0.614 + }, + "lowpriorityd64v3": { + "australiacentral": 0.8, + "australiacentral2": 0.8, + "australiaeast": 0.8, + "australiasoutheast": 0.8, + "brazilsouth": 1.018, + "brazilsoutheast": 1.323, + "canadacentral": 0.71, + "canadaeast": 0.71, + "centralindia": 0.672, + "centralus": 0.704, + "eastasia": 0.845, + "eastus": 0.614, + "eastus2": 0.614, + "francecentral": 0.717, + "francesouth": 0.932, + "germanycentral": 0.886, + "germanynorth": 0.957, + "germanynortheast": 0.886, + "germanywestcentral": 0.736, + "japaneast": 0.826, + "japanwest": 0.826, + "koreacentral": 0.787, + "koreasouth": 0.709, + "northcentralus": 0.64, + "northeurope": 0.685, + "norwayeast": 0.845, + "norwaywest": 1.098, + "southafricanorth": 0.858, + "southafricawest": 1.075, + "southcentralus": 0.704, + "southeastasia": 0.8, + "southindia": 0.866, + "switzerlandnorth": 0.922, + "switzerlandwest": 1.198, + "uaecentral": 0.998, + "uaenorth": 0.768, + "uksouth": 0.742, + "ukwest": 0.742, + "usgovarizona": 0.806, + "usgovtexas": 0.806, + "usgovvirginia": 0.806, + "westcentralus": 0.704, + "westeurope": 0.768, + "westindia": 0.787, + "westus": 0.749, + "westus2": 0.614 + }, + "lowpriorityd64v4": { + "australiaeast": 0.768, + "australiasoutheast": 0.799, + "brazilsouth": 0.979, + "brazilsoutheast": 1.273, + "canadacentral": 0.685, + "canadaeast": 0.685, + "centralindia": 0.646, + "centralus": 0.694, + "eastasia": 0.952, + "eastus": 0.614, + "eastus2": 0.614, + "francecentral": 0.717, + "francesouth": 0.934, + "germanywestcentral": 0.736, + "japaneast": 0.794, + "japanwest": 0.873, + "koreacentral": 0.755, + "northcentralus": 0.614, + "northeurope": 0.685, + "southafricanorth": 0.823, + "southcentralus": 0.737, + "southeastasia": 0.768, + "switzerlandnorth": 0.922, + "uksouth": 0.71, + "ukwest": 0.743, + "usgovarizona": 0.774, + "usgovtexas": 0.768, + "usgovvirginia": 0.774, + "westcentralus": 0.737, + "westeurope": 0.736, + "westus": 0.717, + "westus2": 0.614 + }, + "lowpriorityd96asv4": { + "australiaeast": 1.152, + "brazilsouth": 1.469, + "centralindia": 0.97, + "centralus": 1.041, + "eastasia": 1.267, + "eastus": 0.922, + "eastus2": 0.922, + "francecentral": 1.075, + "japaneast": 1.19, + "koreacentral": 1.133, + "northeurope": 1.027, + "southcentralus": 1.106, + "southeastasia": 1.152, + "uksouth": 1.066, + "westeurope": 1.104, + "westus": 1.075, + "westus2": 0.922 + }, + "lowpriorityd96av4": { + "australiaeast": 1.152, + "brazilsouth": 1.469, + "centralindia": 0.97, + "centralus": 1.041, + "eastasia": 1.267, + "eastus": 0.922, + "eastus2": 0.922, + "francecentral": 1.075, + "japaneast": 1.19, + "koreacentral": 1.133, + "northeurope": 1.027, + "southcentralus": 1.106, + "southeastasia": 1.152, + "uksouth": 1.066, + "westeurope": 1.104, + "westus": 1.075, + "westus2": 0.922 + }, + "lowprioritydc1sv2": { + "canadacentral": 0.0474, + "canadaeast": 0.0474, + "centralus": 0.0486, + "eastus": 0.0395, + "southeastasia": 0.0514, + "uksouth": 0.0494, + "westeurope": 0.0514, + "westus2": 0.0395 + }, + "lowprioritydc2s": { + "centralus": 0.0949, + "eastus": 0.0395, + "westeurope": 0.0514 + }, + "lowprioritydc2sv2": { + "canadacentral": 0.0949, + "canadaeast": 0.0949, + "eastus": 0.0791, + "southeastasia": 0.103, + "uksouth": 0.0988, + "westeurope": 0.103, + "westus2": 0.0791 + }, + "lowprioritydc4s": { + "centralus": 0.19, + "eastus": 0.0791, + "westeurope": 0.103 + }, + "lowprioritydc4sv2": { + "canadacentral": 0.19, + "canadaeast": 0.19, + "eastus": 0.158, + "southeastasia": 0.206, + "uksouth": 0.198, + "westeurope": 0.206, + "westus2": 0.158 + }, + "lowprioritydc8sv2": { + "canadacentral": 0.38, + "canadaeast": 0.38, + "centralus": 0.389, + "eastus": 0.316, + "southeastasia": 0.411, + "uksouth": 0.395, + "westeurope": 0.411, + "westus2": 0.316 + }, + "lowpriorityds1v2": { + "australiacentral": 0.0168, + "australiacentral2": 0.0168, + "australiaeast": 0.0168, + "australiasoutheast": 0.0156, + "brazilsouth": 0.017, + "brazilsoutheast": 0.0223, + "canadacentral": 0.014, + "canadaeast": 0.014, + "centralindia": 0.0169, + "centralus": 0.0146, + "eastasia": 0.021, + "eastus": 0.0146, + "eastus2": 0.011, + "francecentral": 0.0175, + "francesouth": 0.0228, + "germanycentral": 0.015, + "germanynorth": 0.0205, + "germanynortheast": 0.015, + "germanywestcentral": 0.0158, + "japaneast": 0.02, + "japanwest": 0.018, + "koreacentral": 0.0165, + "koreasouth": 0.0149, + "northcentralus": 0.0146, + "northeurope": 0.013, + "norwayeast": 0.0149, + "norwaywest": 0.0194, + "southafricanorth": 0.0153, + "southafricawest": 0.0192, + "southcentralus": 0.0127, + "southeastasia": 0.0158, + "southindia": 0.0169, + "switzerlandnorth": 0.0163, + "switzerlandwest": 0.0212, + "uaecentral": 0.0179, + "uaenorth": 0.0137, + "uksouth": 0.0176, + "ukwest": 0.0175, + "usgovarizona": 0.014, + "usgovtexas": 0.014, + "usgovvirginia": 0.014, + "westcentralus": 0.0127, + "westeurope": 0.0136, + "westindia": 0.0169, + "westus": 0.014, + "westus2": 0.011 + }, + "lowpriorityds2v2": { + "australiacentral": 0.0336, + "australiacentral2": 0.0336, + "australiaeast": 0.0336, + "australiasoutheast": 0.031, + "brazilsouth": 0.034, + "brazilsoutheast": 0.0445, + "canadacentral": 0.028, + "canadaeast": 0.028, + "centralindia": 0.0337, + "centralus": 0.029, + "eastasia": 0.0428, + "eastus": 0.029, + "eastus2": 0.0229, + "francecentral": 0.035, + "francesouth": 0.0455, + "germanycentral": 0.031, + "germanynorth": 0.0411, + "germanynortheast": 0.031, + "germanywestcentral": 0.0316, + "japaneast": 0.0409, + "japanwest": 0.036, + "koreacentral": 0.033, + "koreasouth": 0.0297, + "northcentralus": 0.029, + "northeurope": 0.026, + "norwayeast": 0.0299, + "norwaywest": 0.0389, + "southafricanorth": 0.0306, + "southafricawest": 0.0384, + "southcentralus": 0.025, + "southeastasia": 0.0316, + "southindia": 0.0337, + "switzerlandnorth": 0.0326, + "switzerlandwest": 0.0424, + "uaecentral": 0.0357, + "uaenorth": 0.0275, + "uksouth": 0.035, + "ukwest": 0.035, + "usgovarizona": 0.0285, + "usgovtexas": 0.0285, + "usgovvirginia": 0.0285, + "westcentralus": 0.025, + "westeurope": 0.027, + "westindia": 0.0337, + "westus": 0.0279, + "westus2": 0.0229 + }, + "lowpriorityds3v2": { + "australiacentral": 0.067, + "australiacentral2": 0.067, + "australiaeast": 0.067, + "australiasoutheast": 0.062, + "brazilsouth": 0.0685, + "brazilsoutheast": 0.089, + "canadacentral": 0.056, + "canadaeast": 0.056, + "centralindia": 0.067, + "centralus": 0.0585, + "eastasia": 0.0857, + "eastus": 0.0585, + "eastus2": 0.0458, + "francecentral": 0.07, + "francesouth": 0.091, + "germanycentral": 0.061, + "germanynorth": 0.0822, + "germanynortheast": 0.061, + "germanywestcentral": 0.063, + "japaneast": 0.0818, + "japanwest": 0.0729, + "koreacentral": 0.066, + "koreasouth": 0.0594, + "northcentralus": 0.0585, + "northeurope": 0.0527, + "norwayeast": 0.0598, + "norwaywest": 0.0778, + "southafricanorth": 0.0614, + "southafricawest": 0.077, + "southcentralus": 0.0509, + "southeastasia": 0.063, + "southindia": 0.067, + "switzerlandnorth": 0.0653, + "switzerlandwest": 0.0849, + "uaecentral": 0.0714, + "uaenorth": 0.055, + "uksouth": 0.07, + "ukwest": 0.07, + "usgovarizona": 0.057, + "usgovtexas": 0.057, + "usgovvirginia": 0.057, + "westcentralus": 0.0509, + "westeurope": 0.054, + "westindia": 0.067, + "westus": 0.0559, + "westus2": 0.0458 + }, + "lowpriorityds4v2": { + "australiacentral": 0.135, + "australiacentral2": 0.135, + "australiaeast": 0.135, + "australiasoutheast": 0.125, + "brazilsouth": 0.137, + "brazilsoutheast": 0.178, + "canadacentral": 0.112, + "canadaeast": 0.112, + "centralindia": 0.135, + "centralus": 0.117, + "eastasia": 0.171, + "eastus": 0.117, + "eastus2": 0.0916, + "francecentral": 0.14, + "francesouth": 0.182, + "germanycentral": 0.122, + "germanynorth": 0.164, + "germanynortheast": 0.122, + "germanywestcentral": 0.126, + "japaneast": 0.164, + "japanwest": 0.146, + "koreacentral": 0.132, + "koreasouth": 0.119, + "northcentralus": 0.117, + "northeurope": 0.105, + "norwayeast": 0.12, + "norwaywest": 0.156, + "southafricanorth": 0.123, + "southafricawest": 0.154, + "southcentralus": 0.102, + "southeastasia": 0.126, + "southindia": 0.135, + "switzerlandnorth": 0.131, + "switzerlandwest": 0.17, + "uaecentral": 0.143, + "uaenorth": 0.11, + "uksouth": 0.14, + "ukwest": 0.14, + "usgovarizona": 0.114, + "usgovtexas": 0.114, + "usgovvirginia": 0.114, + "westcentralus": 0.102, + "westeurope": 0.109, + "westindia": 0.135, + "westus": 0.112, + "westus2": 0.0916 + }, + "lowpriorityds5v2": { + "australiacentral": 0.269, + "australiacentral2": 0.269, + "australiaeast": 0.269, + "australiasoutheast": 0.249, + "brazilsouth": 0.274, + "brazilsoutheast": 0.356, + "canadacentral": 0.224, + "canadaeast": 0.224, + "centralindia": 0.27, + "centralus": 0.234, + "eastasia": 0.343, + "eastus": 0.234, + "eastus2": 0.183, + "francecentral": 0.281, + "francesouth": 0.365, + "germanycentral": 0.245, + "germanynorth": 0.329, + "germanynortheast": 0.245, + "germanywestcentral": 0.253, + "japaneast": 0.327, + "japanwest": 0.292, + "koreacentral": 0.264, + "koreasouth": 0.238, + "northcentralus": 0.234, + "northeurope": 0.211, + "norwayeast": 0.239, + "norwaywest": 0.311, + "southafricanorth": 0.245, + "southafricawest": 0.308, + "southcentralus": 0.203, + "southeastasia": 0.253, + "southindia": 0.27, + "switzerlandnorth": 0.261, + "switzerlandwest": 0.339, + "uaecentral": 0.286, + "uaenorth": 0.22, + "uksouth": 0.281, + "ukwest": 0.281, + "usgovarizona": 0.228, + "usgovtexas": 0.228, + "usgovvirginia": 0.228, + "westcentralus": 0.203, + "westeurope": 0.217, + "westindia": 0.27, + "westus": 0.223, + "westus2": 0.183 + }, + "lowpriorityds11v2": { + "australiacentral": 0.0399, + "australiacentral2": 0.0399, + "australiaeast": 0.0399, + "australiasoutheast": 0.0399, + "brazilsouth": 0.047, + "brazilsoutheast": 0.0611, + "canadacentral": 0.0366, + "canadaeast": 0.0366, + "centralindia": 0.0379, + "centralus": 0.037, + "eastasia": 0.0459, + "eastus": 0.037, + "eastus2": 0.0299, + "francecentral": 0.0469, + "francesouth": 0.0608, + "germanycentral": 0.044, + "germanynorth": 0.052, + "germanynortheast": 0.044, + "germanywestcentral": 0.04, + "japaneast": 0.0459, + "japanwest": 0.0399, + "koreacentral": 0.0399, + "koreasouth": 0.0359, + "northcentralus": 0.037, + "northeurope": 0.037, + "norwayeast": 0.0418, + "norwaywest": 0.0543, + "southafricanorth": 0.04, + "southafricawest": 0.0502, + "southcentralus": 0.033, + "southeastasia": 0.038, + "southindia": 0.0379, + "switzerlandnorth": 0.0456, + "switzerlandwest": 0.0593, + "uaecentral": 0.0466, + "uaenorth": 0.0359, + "uksouth": 0.0469, + "ukwest": 0.0469, + "usgovarizona": 0.037, + "usgovtexas": 0.037, + "usgovvirginia": 0.037, + "westcentralus": 0.033, + "westeurope": 0.0379, + "westindia": 0.0379, + "westus": 0.037, + "westus2": 0.0299 + }, + "lowpriorityds12v2": { + "australiacentral": 0.0798, + "australiacentral2": 0.0798, + "australiaeast": 0.0798, + "australiasoutheast": 0.0798, + "brazilsouth": 0.094, + "brazilsoutheast": 0.122, + "canadacentral": 0.073, + "canadaeast": 0.073, + "centralindia": 0.0758, + "centralus": 0.074, + "eastasia": 0.0918, + "eastus": 0.074, + "eastus2": 0.0598, + "francecentral": 0.0937, + "francesouth": 0.122, + "germanycentral": 0.089, + "germanynorth": 0.104, + "germanynortheast": 0.089, + "germanywestcentral": 0.08, + "japaneast": 0.0918, + "japanwest": 0.0798, + "koreacentral": 0.0798, + "koreasouth": 0.0718, + "northcentralus": 0.074, + "northeurope": 0.074, + "norwayeast": 0.0834, + "norwaywest": 0.108, + "southafricanorth": 0.0802, + "southafricawest": 0.1, + "southcentralus": 0.0665, + "southeastasia": 0.076, + "southindia": 0.0758, + "switzerlandnorth": 0.0912, + "switzerlandwest": 0.119, + "uaecentral": 0.0933, + "uaenorth": 0.0718, + "uksouth": 0.0937, + "ukwest": 0.0937, + "usgovarizona": 0.0746, + "usgovtexas": 0.0746, + "usgovvirginia": 0.0746, + "westcentralus": 0.0665, + "westeurope": 0.0759, + "westindia": 0.0758, + "westus": 0.074, + "westus2": 0.0598 + }, + "lowpriorityds13v2": { + "australiacentral": 0.16, + "australiacentral2": 0.16, + "australiaeast": 0.16, + "australiasoutheast": 0.16, + "brazilsouth": 0.188, + "brazilsoutheast": 0.244, + "canadacentral": 0.146, + "canadaeast": 0.146, + "centralindia": 0.152, + "centralus": 0.148, + "eastasia": 0.184, + "eastus": 0.148, + "eastus2": 0.12, + "francecentral": 0.187, + "francesouth": 0.243, + "germanycentral": 0.178, + "germanynorth": 0.208, + "germanynortheast": 0.178, + "germanywestcentral": 0.16, + "japaneast": 0.184, + "japanwest": 0.16, + "koreacentral": 0.16, + "koreasouth": 0.144, + "northcentralus": 0.148, + "northeurope": 0.148, + "norwayeast": 0.167, + "norwaywest": 0.217, + "southafricanorth": 0.16, + "southafricawest": 0.201, + "southcentralus": 0.133, + "southeastasia": 0.153, + "southindia": 0.152, + "switzerlandnorth": 0.182, + "switzerlandwest": 0.237, + "uaecentral": 0.187, + "uaenorth": 0.144, + "uksouth": 0.187, + "ukwest": 0.187, + "usgovarizona": 0.149, + "usgovtexas": 0.149, + "usgovvirginia": 0.149, + "westcentralus": 0.133, + "westeurope": 0.152, + "westindia": 0.152, + "westus": 0.148, + "westus2": 0.12 + }, + "lowpriorityds14v2": { + "australiacentral": 0.319, + "australiacentral2": 0.319, + "australiaeast": 0.319, + "australiasoutheast": 0.319, + "brazilsouth": 0.376, + "brazilsoutheast": 0.489, + "canadacentral": 0.293, + "canadaeast": 0.293, + "centralindia": 0.303, + "centralus": 0.296, + "eastasia": 0.367, + "eastus": 0.296, + "eastus2": 0.239, + "francecentral": 0.375, + "francesouth": 0.487, + "germanycentral": 0.356, + "germanynorth": 0.416, + "germanynortheast": 0.356, + "germanywestcentral": 0.32, + "japaneast": 0.367, + "japanwest": 0.319, + "koreacentral": 0.319, + "koreasouth": 0.287, + "northcentralus": 0.296, + "northeurope": 0.296, + "norwayeast": 0.334, + "norwaywest": 0.434, + "southafricanorth": 0.321, + "southafricawest": 0.402, + "southcentralus": 0.266, + "southeastasia": 0.306, + "southindia": 0.303, + "switzerlandnorth": 0.365, + "switzerlandwest": 0.474, + "uaecentral": 0.373, + "uaenorth": 0.287, + "uksouth": 0.375, + "ukwest": 0.375, + "usgovarizona": 0.298, + "usgovtexas": 0.298, + "usgovvirginia": 0.298, + "westcentralus": 0.266, + "westeurope": 0.304, + "westindia": 0.303, + "westus": 0.296, + "westus2": 0.239 + }, + "lowpriorityds15v2": { + "australiacentral": 0.399, + "australiacentral2": 0.399, + "australiaeast": 0.399, + "australiasoutheast": 0.399, + "brazilsouth": 0.47, + "brazilsoutheast": 0.611, + "canadacentral": 0.366, + "canadaeast": 0.366, + "centralindia": 0.379, + "centralus": 0.371, + "eastasia": 0.459, + "eastus": 0.371, + "eastus2": 0.299, + "francecentral": 0.469, + "francesouth": 0.608, + "germanycentral": 0.445, + "germanynorth": 0.52, + "germanynortheast": 0.445, + "germanywestcentral": 0.4, + "japaneast": 0.459, + "japanwest": 0.399, + "koreacentral": 0.399, + "koreasouth": 0.359, + "northcentralus": 0.37, + "northeurope": 0.371, + "norwayeast": 0.417, + "norwaywest": 0.543, + "southafricanorth": 0.401, + "southafricawest": 0.502, + "southcentralus": 0.332, + "southeastasia": 0.382, + "southindia": 0.379, + "switzerlandnorth": 0.456, + "switzerlandwest": 0.593, + "uaecentral": 0.466, + "uaenorth": 0.359, + "uksouth": 0.469, + "ukwest": 0.469, + "usgovarizona": 0.373, + "usgovtexas": 0.373, + "usgovvirginia": 0.373, + "westcentralus": 0.332, + "westeurope": 0.379, + "westindia": 0.379, + "westus": 0.37, + "westus2": 0.299 + }, + "lowprioritye2asv4": { + "australiaeast": 0.0302, + "brazilsouth": 0.0402, + "centralindia": 0.026, + "centralus": 0.0285, + "eastasia": 0.0334, + "eastus": 0.0252, + "eastus2": 0.0252, + "francecentral": 0.0296, + "japaneast": 0.0304, + "koreacentral": 0.0304, + "northeurope": 0.0282, + "southcentralus": 0.0302, + "southeastasia": 0.0304, + "uksouth": 0.0296, + "westeurope": 0.0304, + "westus": 0.028, + "westus2": 0.0252 + }, + "lowprioritye2av4": { + "australiaeast": 0.0302, + "brazilsouth": 0.0402, + "centralindia": 0.026, + "centralus": 0.0285, + "eastasia": 0.0334, + "eastus": 0.0252, + "eastus2": 0.0252, + "francecentral": 0.0296, + "japaneast": 0.0304, + "koreacentral": 0.0304, + "northeurope": 0.0282, + "southcentralus": 0.0302, + "southeastasia": 0.0304, + "uksouth": 0.0296, + "westeurope": 0.0304, + "westus": 0.028, + "westus2": 0.0252 + }, + "lowprioritye2dsv4": { + "australiaeast": 0.0348, + "australiasoutheast": 0.0346, + "brazilsouth": 0.0457, + "canadacentral": 0.0316, + "canadaeast": 0.0346, + "centralindia": 0.0302, + "centralus": 0.0325, + "eastasia": 0.0446, + "eastus": 0.0288, + "eastus2": 0.0288, + "francecentral": 0.0338, + "francesouth": 0.0438, + "germanywestcentral": 0.0346, + "japaneast": 0.0348, + "japanwest": 0.0382, + "koreacentral": 0.0346, + "northcentralus": 0.0288, + "northeurope": 0.032, + "southafricanorth": 0.0386, + "southcentralus": 0.0374, + "southeastasia": 0.0348, + "switzerlandnorth": 0.0432, + "uksouth": 0.0338, + "ukwest": 0.0348, + "usgovarizona": 0.0346, + "usgovtexas": 0.036, + "usgovvirginia": 0.0346, + "westcentralus": 0.0346, + "westeurope": 0.0346, + "westus": 0.0324, + "westus2": 0.0288 + }, + "lowprioritye2sv3": { + "australiacentral": 0.0302, + "australiacentral2": 0.0302, + "australiaeast": 0.0302, + "australiasoutheast": 0.0302, + "brazilsouth": 0.047, + "brazilsoutheast": 0.0611, + "canadacentral": 0.029, + "canadaeast": 0.029, + "centralindia": 0.027, + "centralus": 0.029, + "eastasia": 0.0334, + "eastus": 0.0252, + "eastus2": 0.0252, + "francecentral": 0.031, + "francesouth": 0.0403, + "germanycentral": 0.035, + "germanynorth": 0.0395, + "germanynortheast": 0.035, + "germanywestcentral": 0.0304, + "japaneast": 0.032, + "japanwest": 0.032, + "koreacentral": 0.032, + "koreasouth": 0.027, + "northcentralus": 0.0252, + "northeurope": 0.0282, + "norwayeast": 0.0352, + "norwaywest": 0.0458, + "southafricanorth": 0.0338, + "southafricawest": 0.0424, + "southcentralus": 0.029, + "southeastasia": 0.032, + "southindia": 0.033, + "switzerlandnorth": 0.0384, + "switzerlandwest": 0.0499, + "uaecentral": 0.0393, + "uaenorth": 0.0302, + "uksouth": 0.031, + "ukwest": 0.031, + "usgovarizona": 0.0302, + "usgovtexas": 0.0302, + "usgovvirginia": 0.0302, + "westcentralus": 0.029, + "westeurope": 0.032, + "westindia": 0.03, + "westus": 0.028, + "westus2": 0.0252 + }, + "lowprioritye2sv4": { + "australiaeast": 0.0302, + "australiasoutheast": 0.0328, + "brazilsouth": 0.0402, + "brazilsoutheast": 0.0523, + "canadacentral": 0.0276, + "canadaeast": 0.0276, + "centralindia": 0.026, + "centralus": 0.0285, + "eastasia": 0.0391, + "eastus": 0.0252, + "eastus2": 0.0252, + "francecentral": 0.0296, + "francesouth": 0.0383, + "germanywestcentral": 0.0304, + "japaneast": 0.0304, + "japanwest": 0.0334, + "koreacentral": 0.0304, + "northcentralus": 0.0252, + "northeurope": 0.0282, + "southafricanorth": 0.0338, + "southcentralus": 0.0302, + "southeastasia": 0.0304, + "switzerlandnorth": 0.0378, + "uksouth": 0.0296, + "ukwest": 0.0305, + "usgovarizona": 0.0302, + "usgovtexas": 0.0315, + "usgovvirginia": 0.0302, + "westcentralus": 0.0302, + "westeurope": 0.0304, + "westus": 0.028, + "westus2": 0.0252 + }, + "lowprioritye2v3": { + "australiacentral": 0.0302, + "australiacentral2": 0.0302, + "australiaeast": 0.0302, + "australiasoutheast": 0.0302, + "brazilsouth": 0.047, + "brazilsoutheast": 0.0611, + "canadacentral": 0.029, + "canadaeast": 0.029, + "centralindia": 0.027, + "centralus": 0.029, + "eastasia": 0.0334, + "eastus": 0.0252, + "eastus2": 0.0252, + "francecentral": 0.031, + "francesouth": 0.0403, + "germanycentral": 0.035, + "germanynorth": 0.0395, + "germanynortheast": 0.035, + "germanywestcentral": 0.0304, + "japaneast": 0.032, + "japanwest": 0.032, + "koreacentral": 0.032, + "koreasouth": 0.027, + "northcentralus": 0.0252, + "northeurope": 0.0282, + "norwayeast": 0.0352, + "norwaywest": 0.0458, + "southafricanorth": 0.0338, + "southafricawest": 0.0424, + "southcentralus": 0.029, + "southeastasia": 0.032, + "southindia": 0.033, + "switzerlandnorth": 0.0384, + "switzerlandwest": 0.0499, + "uaecentral": 0.0393, + "uaenorth": 0.0302, + "uksouth": 0.031, + "ukwest": 0.031, + "usgovarizona": 0.0302, + "usgovtexas": 0.0302, + "usgovvirginia": 0.0302, + "westcentralus": 0.029, + "westeurope": 0.032, + "westindia": 0.03, + "westus": 0.028, + "westus2": 0.0252 + }, + "lowprioritye2v4": { + "australiaeast": 0.0302, + "australiasoutheast": 0.0328, + "brazilsouth": 0.0402, + "brazilsoutheast": 0.0523, + "canadacentral": 0.0276, + "canadaeast": 0.0276, + "centralindia": 0.026, + "centralus": 0.0285, + "eastasia": 0.0391, + "eastus": 0.0252, + "eastus2": 0.0252, + "francecentral": 0.0296, + "francesouth": 0.0383, + "germanywestcentral": 0.0304, + "japaneast": 0.0304, + "japanwest": 0.0334, + "koreacentral": 0.0304, + "northcentralus": 0.0252, + "northeurope": 0.0282, + "southafricanorth": 0.0338, + "southcentralus": 0.0302, + "southeastasia": 0.0304, + "switzerlandnorth": 0.0378, + "uksouth": 0.0296, + "ukwest": 0.0305, + "usgovarizona": 0.0302, + "usgovtexas": 0.0315, + "usgovvirginia": 0.0302, + "westcentralus": 0.0302, + "westeurope": 0.0304, + "westus": 0.028, + "westus2": 0.0252 + }, + "lowprioritye4asv4": { + "australiaeast": 0.0604, + "brazilsouth": 0.0804, + "centralindia": 0.052, + "centralus": 0.057, + "eastasia": 0.0668, + "eastus": 0.0504, + "eastus2": 0.0504, + "francecentral": 0.0592, + "japaneast": 0.0608, + "koreacentral": 0.0608, + "northeurope": 0.0564, + "southcentralus": 0.0605, + "southeastasia": 0.0608, + "uksouth": 0.0592, + "westeurope": 0.0608, + "westus": 0.056, + "westus2": 0.0504 + }, + "lowprioritye4av4": { + "australiaeast": 0.0604, + "brazilsouth": 0.0804, + "centralindia": 0.052, + "centralus": 0.057, + "eastasia": 0.0668, + "eastus": 0.0504, + "eastus2": 0.0504, + "francecentral": 0.0592, + "japaneast": 0.0608, + "koreacentral": 0.0608, + "northeurope": 0.0564, + "southcentralus": 0.0605, + "southeastasia": 0.0608, + "uksouth": 0.0592, + "westeurope": 0.0608, + "westus": 0.056, + "westus2": 0.0504 + }, + "lowprioritye4dsv4": { + "australiaeast": 0.0696, + "australiasoutheast": 0.0691, + "brazilsouth": 0.0915, + "canadacentral": 0.0632, + "canadaeast": 0.0691, + "centralindia": 0.0604, + "centralus": 0.0651, + "eastasia": 0.0893, + "eastus": 0.0576, + "eastus2": 0.0576, + "francecentral": 0.0676, + "francesouth": 0.0876, + "germanywestcentral": 0.0692, + "japaneast": 0.0696, + "japanwest": 0.0764, + "koreacentral": 0.0692, + "northcentralus": 0.0576, + "northeurope": 0.064, + "southafricanorth": 0.0772, + "southcentralus": 0.0749, + "southeastasia": 0.0696, + "switzerlandnorth": 0.0864, + "uksouth": 0.0676, + "ukwest": 0.0697, + "usgovarizona": 0.0692, + "usgovtexas": 0.072, + "usgovvirginia": 0.0692, + "westcentralus": 0.0691, + "westeurope": 0.0692, + "westus": 0.0648, + "westus2": 0.0576 + }, + "lowprioritye4sv3": { + "australiacentral": 0.0604, + "australiacentral2": 0.0604, + "australiaeast": 0.0604, + "australiasoutheast": 0.0604, + "brazilsouth": 0.0939, + "brazilsoutheast": 0.122, + "canadacentral": 0.058, + "canadaeast": 0.058, + "centralindia": 0.0547, + "centralus": 0.0583, + "eastasia": 0.0668, + "eastus": 0.0504, + "eastus2": 0.053, + "francecentral": 0.062, + "francesouth": 0.0806, + "germanycentral": 0.069, + "germanynorth": 0.079, + "germanynortheast": 0.069, + "germanywestcentral": 0.0608, + "japaneast": 0.064, + "japanwest": 0.064, + "koreacentral": 0.064, + "koreasouth": 0.0539, + "northcentralus": 0.0504, + "northeurope": 0.0564, + "norwayeast": 0.0704, + "norwaywest": 0.0915, + "southafricanorth": 0.0676, + "southafricawest": 0.0846, + "southcentralus": 0.0583, + "southeastasia": 0.064, + "southindia": 0.0667, + "switzerlandnorth": 0.0768, + "switzerlandwest": 0.0998, + "uaecentral": 0.0786, + "uaenorth": 0.0605, + "uksouth": 0.062, + "ukwest": 0.062, + "usgovarizona": 0.0604, + "usgovtexas": 0.0604, + "usgovvirginia": 0.0604, + "westcentralus": 0.0583, + "westeurope": 0.064, + "westindia": 0.0607, + "westus": 0.059, + "westus2": 0.0504 + }, + "lowprioritye4sv4": { + "australiaeast": 0.0604, + "australiasoutheast": 0.0655, + "brazilsouth": 0.0804, + "brazilsoutheast": 0.105, + "canadacentral": 0.0552, + "canadaeast": 0.0552, + "centralindia": 0.052, + "centralus": 0.057, + "eastasia": 0.0781, + "eastus": 0.0504, + "eastus2": 0.0504, + "francecentral": 0.0592, + "francesouth": 0.0766, + "germanywestcentral": 0.0608, + "japaneast": 0.0608, + "japanwest": 0.0669, + "koreacentral": 0.0608, + "northcentralus": 0.0504, + "northeurope": 0.0564, + "southafricanorth": 0.0675, + "southcentralus": 0.0605, + "southeastasia": 0.0608, + "switzerlandnorth": 0.0756, + "uksouth": 0.0592, + "ukwest": 0.061, + "usgovarizona": 0.0604, + "usgovtexas": 0.063, + "usgovvirginia": 0.0604, + "westcentralus": 0.0605, + "westeurope": 0.0608, + "westus": 0.056, + "westus2": 0.0504 + }, + "lowprioritye4v3": { + "australiacentral": 0.0604, + "australiacentral2": 0.0604, + "australiaeast": 0.0604, + "australiasoutheast": 0.0604, + "brazilsouth": 0.0939, + "brazilsoutheast": 0.122, + "canadacentral": 0.058, + "canadaeast": 0.058, + "centralindia": 0.0547, + "centralus": 0.0583, + "eastasia": 0.0668, + "eastus": 0.0504, + "eastus2": 0.053, + "francecentral": 0.062, + "francesouth": 0.0806, + "germanycentral": 0.069, + "germanynorth": 0.079, + "germanynortheast": 0.069, + "germanywestcentral": 0.0608, + "japaneast": 0.064, + "japanwest": 0.064, + "koreacentral": 0.064, + "koreasouth": 0.0539, + "northcentralus": 0.0504, + "northeurope": 0.0564, + "norwayeast": 0.0704, + "norwaywest": 0.0915, + "southafricanorth": 0.0676, + "southafricawest": 0.0846, + "southcentralus": 0.0583, + "southeastasia": 0.064, + "southindia": 0.0667, + "switzerlandnorth": 0.0768, + "switzerlandwest": 0.0998, + "uaecentral": 0.0786, + "uaenorth": 0.0605, + "uksouth": 0.062, + "ukwest": 0.062, + "usgovarizona": 0.0604, + "usgovtexas": 0.0604, + "usgovvirginia": 0.0604, + "westcentralus": 0.0583, + "westeurope": 0.064, + "westindia": 0.0607, + "westus": 0.059, + "westus2": 0.0504 + }, + "lowprioritye4v4": { + "australiaeast": 0.0604, + "australiasoutheast": 0.0655, + "brazilsouth": 0.0804, + "brazilsoutheast": 0.105, + "canadacentral": 0.0552, + "canadaeast": 0.0552, + "centralindia": 0.052, + "centralus": 0.057, + "eastasia": 0.0781, + "eastus": 0.0504, + "eastus2": 0.0504, + "francecentral": 0.0592, + "francesouth": 0.0766, + "germanywestcentral": 0.0608, + "japaneast": 0.0608, + "japanwest": 0.0669, + "koreacentral": 0.0608, + "northcentralus": 0.0504, + "northeurope": 0.0564, + "southafricanorth": 0.0675, + "southcentralus": 0.0605, + "southeastasia": 0.0608, + "switzerlandnorth": 0.0756, + "uksouth": 0.0592, + "ukwest": 0.061, + "usgovarizona": 0.0604, + "usgovtexas": 0.063, + "usgovvirginia": 0.0604, + "westcentralus": 0.0605, + "westeurope": 0.0608, + "westus": 0.056, + "westus2": 0.0504 + }, + "lowprioritye8asv4": { + "australiaeast": 0.121, + "brazilsouth": 0.161, + "centralindia": 0.104, + "centralus": 0.114, + "eastasia": 0.134, + "eastus": 0.101, + "eastus2": 0.101, + "francecentral": 0.118, + "japaneast": 0.122, + "koreacentral": 0.122, + "northeurope": 0.113, + "southcentralus": 0.121, + "southeastasia": 0.122, + "uksouth": 0.118, + "westeurope": 0.122, + "westus": 0.112, + "westus2": 0.101 + }, + "lowprioritye8av4": { + "australiaeast": 0.121, + "brazilsouth": 0.161, + "centralindia": 0.104, + "centralus": 0.114, + "eastasia": 0.134, + "eastus": 0.101, + "eastus2": 0.101, + "francecentral": 0.118, + "japaneast": 0.122, + "koreacentral": 0.122, + "northeurope": 0.113, + "southcentralus": 0.121, + "southeastasia": 0.122, + "uksouth": 0.118, + "westeurope": 0.122, + "westus": 0.112, + "westus2": 0.101 + }, + "lowprioritye8dsv4": { + "australiaeast": 0.139, + "australiasoutheast": 0.138, + "brazilsouth": 0.183, + "canadacentral": 0.126, + "canadaeast": 0.138, + "centralindia": 0.121, + "centralus": 0.13, + "eastasia": 0.179, + "eastus": 0.115, + "eastus2": 0.115, + "francecentral": 0.135, + "francesouth": 0.175, + "germanywestcentral": 0.138, + "japaneast": 0.139, + "japanwest": 0.153, + "koreacentral": 0.138, + "northcentralus": 0.115, + "northeurope": 0.128, + "southafricanorth": 0.154, + "southcentralus": 0.15, + "southeastasia": 0.139, + "switzerlandnorth": 0.173, + "uksouth": 0.135, + "ukwest": 0.139, + "usgovarizona": 0.138, + "usgovtexas": 0.144, + "usgovvirginia": 0.138, + "westcentralus": 0.138, + "westeurope": 0.138, + "westus": 0.13, + "westus2": 0.115 + }, + "lowprioritye8sv3": { + "australiacentral": 0.128, + "australiacentral2": 0.128, + "australiaeast": 0.128, + "australiasoutheast": 0.128, + "brazilsouth": 0.188, + "brazilsoutheast": 0.244, + "canadacentral": 0.117, + "canadaeast": 0.117, + "centralindia": 0.11, + "centralus": 0.117, + "eastasia": 0.134, + "eastus": 0.101, + "eastus2": 0.106, + "francecentral": 0.125, + "francesouth": 0.162, + "germanycentral": 0.138, + "germanynorth": 0.158, + "germanynortheast": 0.138, + "germanywestcentral": 0.122, + "japaneast": 0.128, + "japanwest": 0.128, + "koreacentral": 0.128, + "koreasouth": 0.115, + "northcentralus": 0.101, + "northeurope": 0.113, + "norwayeast": 0.141, + "norwaywest": 0.183, + "southafricanorth": 0.135, + "southafricawest": 0.169, + "southcentralus": 0.117, + "southeastasia": 0.128, + "southindia": 0.134, + "switzerlandnorth": 0.154, + "switzerlandwest": 0.2, + "uaecentral": 0.157, + "uaenorth": 0.121, + "uksouth": 0.125, + "ukwest": 0.125, + "usgovarizona": 0.128, + "usgovtexas": 0.128, + "usgovvirginia": 0.128, + "westcentralus": 0.117, + "westeurope": 0.128, + "westindia": 0.122, + "westus": 0.112, + "westus2": 0.101 + }, + "lowprioritye8sv4": { + "australiaeast": 0.121, + "australiasoutheast": 0.131, + "brazilsouth": 0.161, + "brazilsoutheast": 0.209, + "canadacentral": 0.11, + "canadaeast": 0.11, + "centralindia": 0.104, + "centralus": 0.114, + "eastasia": 0.156, + "eastus": 0.101, + "eastus2": 0.101, + "francecentral": 0.118, + "francesouth": 0.153, + "germanywestcentral": 0.122, + "japaneast": 0.122, + "japanwest": 0.134, + "koreacentral": 0.122, + "northcentralus": 0.101, + "northeurope": 0.113, + "southafricanorth": 0.135, + "southcentralus": 0.121, + "southeastasia": 0.122, + "switzerlandnorth": 0.151, + "uksouth": 0.118, + "ukwest": 0.122, + "usgovarizona": 0.121, + "usgovtexas": 0.126, + "usgovvirginia": 0.121, + "westcentralus": 0.121, + "westeurope": 0.122, + "westus": 0.112, + "westus2": 0.101 + }, + "lowprioritye8v3": { + "australiacentral": 0.128, + "australiacentral2": 0.128, + "australiaeast": 0.128, + "australiasoutheast": 0.128, + "brazilsouth": 0.188, + "brazilsoutheast": 0.244, + "canadacentral": 0.117, + "canadaeast": 0.117, + "centralindia": 0.11, + "centralus": 0.117, + "eastasia": 0.134, + "eastus": 0.101, + "eastus2": 0.106, + "francecentral": 0.125, + "francesouth": 0.162, + "germanycentral": 0.138, + "germanynorth": 0.158, + "germanynortheast": 0.138, + "germanywestcentral": 0.122, + "japaneast": 0.128, + "japanwest": 0.128, + "koreacentral": 0.128, + "koreasouth": 0.115, + "northcentralus": 0.101, + "northeurope": 0.113, + "norwayeast": 0.141, + "norwaywest": 0.183, + "southafricanorth": 0.135, + "southafricawest": 0.169, + "southcentralus": 0.117, + "southeastasia": 0.128, + "southindia": 0.134, + "switzerlandnorth": 0.154, + "switzerlandwest": 0.2, + "uaecentral": 0.157, + "uaenorth": 0.121, + "uksouth": 0.125, + "ukwest": 0.125, + "usgovarizona": 0.128, + "usgovtexas": 0.128, + "usgovvirginia": 0.128, + "westcentralus": 0.117, + "westeurope": 0.128, + "westindia": 0.122, + "westus": 0.112, + "westus2": 0.101 + }, + "lowprioritye8v4": { + "australiaeast": 0.121, + "australiasoutheast": 0.131, + "brazilsouth": 0.161, + "brazilsoutheast": 0.209, + "canadacentral": 0.11, + "canadaeast": 0.11, + "centralindia": 0.104, + "centralus": 0.114, + "eastasia": 0.156, + "eastus": 0.101, + "eastus2": 0.101, + "francecentral": 0.118, + "francesouth": 0.153, + "germanywestcentral": 0.122, + "japaneast": 0.122, + "japanwest": 0.134, + "koreacentral": 0.122, + "northcentralus": 0.101, + "northeurope": 0.113, + "southafricanorth": 0.135, + "southcentralus": 0.121, + "southeastasia": 0.122, + "switzerlandnorth": 0.151, + "uksouth": 0.118, + "ukwest": 0.122, + "usgovarizona": 0.121, + "usgovtexas": 0.126, + "usgovvirginia": 0.121, + "westcentralus": 0.121, + "westeurope": 0.122, + "westus": 0.112, + "westus2": 0.101 + }, + "lowprioritye16asv4": { + "australiaeast": 0.242, + "brazilsouth": 0.322, + "centralindia": 0.208, + "centralus": 0.228, + "eastasia": 0.267, + "eastus": 0.202, + "eastus2": 0.202, + "francecentral": 0.237, + "japaneast": 0.243, + "koreacentral": 0.243, + "northeurope": 0.226, + "southcentralus": 0.242, + "southeastasia": 0.243, + "uksouth": 0.237, + "westeurope": 0.243, + "westus": 0.224, + "westus2": 0.202 + }, + "lowprioritye16av4": { + "australiaeast": 0.242, + "brazilsouth": 0.322, + "centralindia": 0.208, + "centralus": 0.228, + "eastasia": 0.267, + "eastus": 0.202, + "eastus2": 0.202, + "francecentral": 0.237, + "japaneast": 0.243, + "koreacentral": 0.243, + "northeurope": 0.226, + "southcentralus": 0.242, + "southeastasia": 0.243, + "uksouth": 0.237, + "westeurope": 0.243, + "westus": 0.224, + "westus2": 0.202 + }, + "lowprioritye16dsv4": { + "australiaeast": 0.278, + "australiasoutheast": 0.276, + "brazilsouth": 0.366, + "canadacentral": 0.253, + "canadaeast": 0.276, + "centralindia": 0.242, + "centralus": 0.26, + "eastasia": 0.357, + "eastus": 0.23, + "eastus2": 0.23, + "francecentral": 0.27, + "francesouth": 0.35, + "germanywestcentral": 0.277, + "japaneast": 0.278, + "japanwest": 0.306, + "koreacentral": 0.277, + "northcentralus": 0.23, + "northeurope": 0.256, + "southafricanorth": 0.309, + "southcentralus": 0.3, + "southeastasia": 0.278, + "switzerlandnorth": 0.346, + "uksouth": 0.27, + "ukwest": 0.279, + "usgovarizona": 0.277, + "usgovtexas": 0.288, + "usgovvirginia": 0.277, + "westcentralus": 0.276, + "westeurope": 0.277, + "westus": 0.259, + "westus2": 0.23 + }, + "lowprioritye16sv3": { + "australiacentral": 0.255, + "australiacentral2": 0.255, + "australiaeast": 0.255, + "australiasoutheast": 0.255, + "brazilsouth": 0.376, + "brazilsoutheast": 0.489, + "canadacentral": 0.234, + "canadaeast": 0.234, + "centralindia": 0.219, + "centralus": 0.234, + "eastasia": 0.267, + "eastus": 0.202, + "eastus2": 0.213, + "francecentral": 0.25, + "francesouth": 0.325, + "germanycentral": 0.276, + "germanynorth": 0.316, + "germanynortheast": 0.276, + "germanywestcentral": 0.243, + "japaneast": 0.256, + "japanwest": 0.256, + "koreacentral": 0.256, + "koreasouth": 0.23, + "northcentralus": 0.202, + "northeurope": 0.226, + "norwayeast": 0.282, + "norwaywest": 0.366, + "southafricanorth": 0.27, + "southafricawest": 0.339, + "southcentralus": 0.234, + "southeastasia": 0.256, + "southindia": 0.267, + "switzerlandnorth": 0.307, + "switzerlandwest": 0.399, + "uaecentral": 0.314, + "uaenorth": 0.242, + "uksouth": 0.25, + "ukwest": 0.25, + "usgovarizona": 0.255, + "usgovtexas": 0.255, + "usgovvirginia": 0.255, + "westcentralus": 0.234, + "westeurope": 0.256, + "westindia": 0.243, + "westus": 0.237, + "westus2": 0.202 + }, + "lowprioritye16sv4": { + "australiaeast": 0.242, + "australiasoutheast": 0.262, + "brazilsouth": 0.322, + "brazilsoutheast": 0.418, + "canadacentral": 0.221, + "canadaeast": 0.221, + "centralindia": 0.208, + "centralus": 0.228, + "eastasia": 0.312, + "eastus": 0.202, + "eastus2": 0.202, + "francecentral": 0.237, + "francesouth": 0.306, + "germanywestcentral": 0.243, + "japaneast": 0.243, + "japanwest": 0.268, + "koreacentral": 0.243, + "northcentralus": 0.202, + "northeurope": 0.226, + "southafricanorth": 0.27, + "southcentralus": 0.242, + "southeastasia": 0.243, + "switzerlandnorth": 0.302, + "uksouth": 0.237, + "ukwest": 0.244, + "usgovarizona": 0.242, + "usgovtexas": 0.252, + "usgovvirginia": 0.242, + "westcentralus": 0.242, + "westeurope": 0.243, + "westus": 0.224, + "westus2": 0.202 + }, + "lowprioritye16v3": { + "australiacentral": 0.255, + "australiacentral2": 0.255, + "australiaeast": 0.255, + "australiasoutheast": 0.255, + "brazilsouth": 0.376, + "brazilsoutheast": 0.489, + "canadacentral": 0.234, + "canadaeast": 0.234, + "centralindia": 0.219, + "centralus": 0.234, + "eastasia": 0.267, + "eastus": 0.202, + "eastus2": 0.213, + "francecentral": 0.25, + "francesouth": 0.325, + "germanycentral": 0.276, + "germanynorth": 0.316, + "germanynortheast": 0.276, + "germanywestcentral": 0.243, + "japaneast": 0.256, + "japanwest": 0.256, + "koreacentral": 0.256, + "koreasouth": 0.23, + "northcentralus": 0.202, + "northeurope": 0.226, + "norwayeast": 0.282, + "norwaywest": 0.366, + "southafricanorth": 0.27, + "southafricawest": 0.339, + "southcentralus": 0.234, + "southeastasia": 0.256, + "southindia": 0.267, + "switzerlandnorth": 0.307, + "switzerlandwest": 0.399, + "uaecentral": 0.314, + "uaenorth": 0.242, + "uksouth": 0.25, + "ukwest": 0.25, + "usgovarizona": 0.255, + "usgovtexas": 0.255, + "usgovvirginia": 0.255, + "westcentralus": 0.234, + "westeurope": 0.256, + "westindia": 0.243, + "westus": 0.237, + "westus2": 0.202 + }, + "lowprioritye16v4": { + "australiaeast": 0.242, + "australiasoutheast": 0.262, + "brazilsouth": 0.322, + "brazilsoutheast": 0.418, + "canadacentral": 0.221, + "canadaeast": 0.221, + "centralindia": 0.208, + "centralus": 0.228, + "eastasia": 0.312, + "eastus": 0.202, + "eastus2": 0.202, + "francecentral": 0.237, + "francesouth": 0.306, + "germanywestcentral": 0.243, + "japaneast": 0.243, + "japanwest": 0.268, + "koreacentral": 0.243, + "northcentralus": 0.202, + "northeurope": 0.226, + "southafricanorth": 0.27, + "southcentralus": 0.242, + "southeastasia": 0.243, + "switzerlandnorth": 0.302, + "uksouth": 0.237, + "ukwest": 0.244, + "usgovarizona": 0.242, + "usgovtexas": 0.252, + "usgovvirginia": 0.242, + "westcentralus": 0.242, + "westeurope": 0.243, + "westus": 0.224, + "westus2": 0.202 + }, + "lowprioritye20asv4": { + "australiaeast": 0.302, + "brazilsouth": 0.402, + "centralindia": 0.26, + "centralus": 0.285, + "eastasia": 0.334, + "eastus": 0.252, + "eastus2": 0.252, + "francecentral": 0.296, + "japaneast": 0.304, + "koreacentral": 0.304, + "northeurope": 0.282, + "southcentralus": 0.302, + "southeastasia": 0.304, + "uksouth": 0.296, + "westeurope": 0.304, + "westus": 0.28, + "westus2": 0.252 + }, + "lowprioritye20av4": { + "australiaeast": 0.302, + "brazilsouth": 0.402, + "centralindia": 0.26, + "centralus": 0.285, + "eastasia": 0.334, + "eastus": 0.252, + "eastus2": 0.252, + "francecentral": 0.296, + "japaneast": 0.304, + "koreacentral": 0.304, + "northeurope": 0.282, + "southcentralus": 0.302, + "southeastasia": 0.304, + "uksouth": 0.296, + "westeurope": 0.304, + "westus": 0.28, + "westus2": 0.252 + }, + "lowprioritye20dsv4": { + "australiaeast": 0.348, + "australiasoutheast": 0.346, + "brazilsouth": 0.457, + "canadacentral": 0.316, + "canadaeast": 0.346, + "centralindia": 0.302, + "centralus": 0.325, + "eastasia": 0.446, + "eastus": 0.288, + "eastus2": 0.288, + "francecentral": 0.338, + "francesouth": 0.438, + "germanywestcentral": 0.346, + "japaneast": 0.348, + "japanwest": 0.382, + "koreacentral": 0.346, + "northcentralus": 0.288, + "northeurope": 0.32, + "southafricanorth": 0.386, + "southcentralus": 0.374, + "southeastasia": 0.348, + "switzerlandnorth": 0.432, + "uksouth": 0.338, + "ukwest": 0.348, + "usgovarizona": 0.346, + "usgovtexas": 0.36, + "usgovvirginia": 0.346, + "westcentralus": 0.346, + "westeurope": 0.346, + "westus": 0.324, + "westus2": 0.288 + }, + "lowprioritye20sv3": { + "australiacentral": 0.302, + "australiacentral2": 0.302, + "australiaeast": 0.302, + "australiasoutheast": 0.302, + "brazilsouth": 0.47, + "brazilsoutheast": 0.728, + "canadacentral": 0.29, + "canadaeast": 0.29, + "centralindia": 0.27, + "centralus": 0.29, + "eastasia": 0.334, + "eastus": 0.252, + "eastus2": 0.252, + "francecentral": 0.31, + "francesouth": 0.403, + "germanycentral": 0.35, + "germanynorth": 0.395, + "germanynortheast": 0.35, + "germanywestcentral": 0.304, + "japaneast": 0.32, + "japanwest": 0.32, + "koreacentral": 0.32, + "koreasouth": 0.27, + "northcentralus": 0.252, + "northeurope": 0.282, + "norwayeast": 0.352, + "norwaywest": 0.458, + "southafricanorth": 0.338, + "southafricawest": 0.423, + "southcentralus": 0.29, + "southeastasia": 0.32, + "southindia": 0.33, + "switzerlandnorth": 0.384, + "switzerlandwest": 0.499, + "uaecentral": 0.416, + "uaenorth": 0.32, + "uksouth": 0.31, + "ukwest": 0.31, + "usgovarizona": 0.302, + "usgovtexas": 0.302, + "usgovvirginia": 0.302, + "westcentralus": 0.29, + "westeurope": 0.32, + "westindia": 0.3, + "westus": 0.28, + "westus2": 0.252 + }, + "lowprioritye20sv4": { + "australiaeast": 0.302, + "australiasoutheast": 0.328, + "brazilsouth": 0.402, + "brazilsoutheast": 0.523, + "canadacentral": 0.276, + "canadaeast": 0.276, + "centralindia": 0.26, + "centralus": 0.285, + "eastasia": 0.391, + "eastus": 0.252, + "eastus2": 0.252, + "francecentral": 0.296, + "francesouth": 0.383, + "germanywestcentral": 0.304, + "japaneast": 0.304, + "japanwest": 0.334, + "koreacentral": 0.304, + "northcentralus": 0.252, + "northeurope": 0.282, + "southafricanorth": 0.338, + "southcentralus": 0.302, + "southeastasia": 0.304, + "switzerlandnorth": 0.378, + "uksouth": 0.296, + "ukwest": 0.305, + "usgovarizona": 0.302, + "usgovtexas": 0.315, + "usgovvirginia": 0.302, + "westcentralus": 0.302, + "westeurope": 0.304, + "westus": 0.28, + "westus2": 0.252 + }, + "lowprioritye20v3": { + "australiacentral": 0.302, + "australiacentral2": 0.302, + "australiaeast": 0.302, + "australiasoutheast": 0.302, + "brazilsouth": 0.47, + "brazilsoutheast": 0.728, + "canadacentral": 0.29, + "canadaeast": 0.29, + "centralindia": 0.27, + "centralus": 0.29, + "eastasia": 0.334, + "eastus": 0.252, + "eastus2": 0.252, + "francecentral": 0.31, + "francesouth": 0.403, + "germanycentral": 0.35, + "germanynorth": 0.395, + "germanynortheast": 0.35, + "germanywestcentral": 0.304, + "japaneast": 0.32, + "japanwest": 0.32, + "koreacentral": 0.32, + "koreasouth": 0.27, + "northcentralus": 0.252, + "northeurope": 0.282, + "norwayeast": 0.352, + "norwaywest": 0.458, + "southafricanorth": 0.338, + "southafricawest": 0.423, + "southcentralus": 0.29, + "southeastasia": 0.32, + "southindia": 0.33, + "switzerlandnorth": 0.384, + "switzerlandwest": 0.499, + "uaecentral": 0.416, + "uaenorth": 0.32, + "uksouth": 0.31, + "ukwest": 0.31, + "usgovarizona": 0.302, + "usgovtexas": 0.302, + "usgovvirginia": 0.302, + "westcentralus": 0.29, + "westeurope": 0.32, + "westindia": 0.3, + "westus": 0.28, + "westus2": 0.252 + }, + "lowprioritye32asv4": { + "australiaeast": 0.483, + "brazilsouth": 0.643, + "centralindia": 0.416, + "centralus": 0.456, + "eastasia": 0.534, + "eastus": 0.403, + "eastus2": 0.403, + "francecentral": 0.474, + "japaneast": 0.486, + "koreacentral": 0.486, + "northeurope": 0.451, + "southcentralus": 0.484, + "southeastasia": 0.486, + "uksouth": 0.474, + "westeurope": 0.486, + "westus": 0.448, + "westus2": 0.403 + }, + "lowprioritye32av4": { + "australiaeast": 0.483, + "brazilsouth": 0.643, + "centralindia": 0.416, + "centralus": 0.456, + "eastasia": 0.534, + "eastus": 0.403, + "eastus2": 0.403, + "francecentral": 0.474, + "japaneast": 0.486, + "koreacentral": 0.486, + "northeurope": 0.451, + "southcentralus": 0.484, + "southeastasia": 0.486, + "uksouth": 0.474, + "westeurope": 0.486, + "westus": 0.448, + "westus2": 0.403 + }, + "lowprioritye32dsv4": { + "australiaeast": 0.557, + "australiasoutheast": 0.553, + "brazilsouth": 0.732, + "canadacentral": 0.506, + "canadaeast": 0.553, + "centralindia": 0.483, + "centralus": 0.521, + "eastasia": 0.714, + "eastus": 0.461, + "eastus2": 0.461, + "francecentral": 0.541, + "francesouth": 0.7, + "germanywestcentral": 0.554, + "japaneast": 0.557, + "japanwest": 0.611, + "koreacentral": 0.554, + "northcentralus": 0.461, + "northeurope": 0.512, + "southafricanorth": 0.617, + "southcentralus": 0.599, + "southeastasia": 0.557, + "switzerlandnorth": 0.691, + "uksouth": 0.541, + "ukwest": 0.558, + "usgovarizona": 0.554, + "usgovtexas": 0.576, + "usgovvirginia": 0.554, + "westcentralus": 0.553, + "westeurope": 0.554, + "westus": 0.518, + "westus2": 0.461 + }, + "lowprioritye32sv3": { + "australiacentral": 0.511, + "australiacentral2": 0.511, + "australiaeast": 0.511, + "australiasoutheast": 0.511, + "brazilsouth": 0.752, + "brazilsoutheast": 0.978, + "canadacentral": 0.467, + "canadaeast": 0.467, + "centralindia": 0.438, + "centralus": 0.467, + "eastasia": 0.534, + "eastus": 0.403, + "eastus2": 0.426, + "francecentral": 0.499, + "francesouth": 0.6487, + "germanycentral": 0.553, + "germanynorth": 0.632, + "germanynortheast": 0.553, + "germanywestcentral": 0.486, + "japaneast": 0.512, + "japanwest": 0.512, + "koreacentral": 0.512, + "koreasouth": 0.461, + "northcentralus": 0.403, + "northeurope": 0.451, + "norwayeast": 0.563, + "norwaywest": 0.732, + "southafricanorth": 0.54, + "southafricawest": 0.677, + "southcentralus": 0.467, + "southeastasia": 0.512, + "southindia": 0.535, + "switzerlandnorth": 0.614, + "switzerlandwest": 0.799, + "uaecentral": 0.629, + "uaenorth": 0.484, + "uksouth": 0.499, + "ukwest": 0.499, + "usgovarizona": 0.511, + "usgovtexas": 0.511, + "usgovvirginia": 0.511, + "westcentralus": 0.467, + "westeurope": 0.512, + "westindia": 0.486, + "westus": 0.474, + "westus2": 0.403 + }, + "lowprioritye32sv4": { + "australiaeast": 0.483, + "australiasoutheast": 0.524, + "brazilsouth": 0.643, + "brazilsoutheast": 0.836, + "canadacentral": 0.442, + "canadaeast": 0.442, + "centralindia": 0.416, + "centralus": 0.456, + "eastasia": 0.625, + "eastus": 0.403, + "eastus2": 0.403, + "francecentral": 0.474, + "francesouth": 0.613, + "germanywestcentral": 0.486, + "japaneast": 0.486, + "japanwest": 0.535, + "koreacentral": 0.486, + "northcentralus": 0.403, + "northeurope": 0.451, + "southafricanorth": 0.54, + "southcentralus": 0.484, + "southeastasia": 0.486, + "switzerlandnorth": 0.605, + "uksouth": 0.474, + "ukwest": 0.488, + "usgovarizona": 0.483, + "usgovtexas": 0.504, + "usgovvirginia": 0.483, + "westcentralus": 0.484, + "westeurope": 0.486, + "westus": 0.448, + "westus2": 0.403 + }, + "lowprioritye32v3": { + "australiacentral": 0.511, + "australiacentral2": 0.511, + "australiaeast": 0.511, + "australiasoutheast": 0.511, + "brazilsouth": 0.752, + "brazilsoutheast": 0.978, + "canadacentral": 0.467, + "canadaeast": 0.467, + "centralindia": 0.438, + "centralus": 0.467, + "eastasia": 0.534, + "eastus": 0.403, + "eastus2": 0.426, + "francecentral": 0.499, + "francesouth": 0.6487, + "germanycentral": 0.553, + "germanynorth": 0.632, + "germanynortheast": 0.553, + "germanywestcentral": 0.486, + "japaneast": 0.512, + "japanwest": 0.512, + "koreacentral": 0.512, + "koreasouth": 0.461, + "northcentralus": 0.403, + "northeurope": 0.451, + "norwayeast": 0.563, + "norwaywest": 0.732, + "southafricanorth": 0.54, + "southafricawest": 0.677, + "southcentralus": 0.467, + "southeastasia": 0.512, + "southindia": 0.535, + "switzerlandnorth": 0.614, + "switzerlandwest": 0.799, + "uaecentral": 0.629, + "uaenorth": 0.484, + "uksouth": 0.499, + "ukwest": 0.499, + "usgovarizona": 0.511, + "usgovtexas": 0.511, + "usgovvirginia": 0.511, + "westcentralus": 0.467, + "westeurope": 0.512, + "westindia": 0.486, + "westus": 0.474, + "westus2": 0.403 + }, + "lowprioritye32v4": { + "australiaeast": 0.483, + "australiasoutheast": 0.524, + "brazilsouth": 0.643, + "brazilsoutheast": 0.836, + "canadacentral": 0.442, + "canadaeast": 0.442, + "centralindia": 0.416, + "centralus": 0.456, + "eastasia": 0.625, + "eastus": 0.403, + "eastus2": 0.403, + "francecentral": 0.474, + "francesouth": 0.613, + "germanywestcentral": 0.486, + "japaneast": 0.486, + "japanwest": 0.535, + "koreacentral": 0.486, + "northcentralus": 0.403, + "northeurope": 0.451, + "southafricanorth": 0.54, + "southcentralus": 0.484, + "southeastasia": 0.486, + "switzerlandnorth": 0.605, + "uksouth": 0.474, + "ukwest": 0.488, + "usgovarizona": 0.483, + "usgovtexas": 0.504, + "usgovvirginia": 0.483, + "westcentralus": 0.484, + "westeurope": 0.486, + "westus": 0.448, + "westus2": 0.403 + }, + "lowprioritye48asv4": { + "australiaeast": 0.725, + "brazilsouth": 0.965, + "centralindia": 0.624, + "centralus": 0.683, + "eastasia": 0.802, + "eastus": 0.605, + "eastus2": 0.605, + "francecentral": 0.71, + "japaneast": 0.73, + "koreacentral": 0.73, + "northeurope": 0.677, + "southcentralus": 0.726, + "southeastasia": 0.73, + "uksouth": 0.71, + "westeurope": 0.73, + "westus": 0.672, + "westus2": 0.605 + }, + "lowprioritye48av4": { + "australiaeast": 0.725, + "brazilsouth": 0.965, + "centralindia": 0.624, + "centralus": 0.683, + "eastasia": 0.802, + "eastus": 0.605, + "eastus2": 0.605, + "francecentral": 0.71, + "japaneast": 0.73, + "koreacentral": 0.73, + "northeurope": 0.677, + "southcentralus": 0.726, + "southeastasia": 0.73, + "uksouth": 0.71, + "westeurope": 0.73, + "westus": 0.672, + "westus2": 0.605 + }, + "lowprioritye48dsv4": { + "australiaeast": 0.835, + "australiasoutheast": 0.829, + "brazilsouth": 1.098, + "canadacentral": 0.758, + "canadaeast": 0.829, + "centralindia": 0.725, + "centralus": 0.781, + "eastasia": 1.071, + "eastus": 0.691, + "eastus2": 0.691, + "francecentral": 0.811, + "francesouth": 1.051, + "germanywestcentral": 0.83, + "japaneast": 0.835, + "japanwest": 0.917, + "koreacentral": 0.83, + "northcentralus": 0.691, + "northeurope": 0.768, + "southafricanorth": 0.926, + "southcentralus": 0.899, + "southeastasia": 0.835, + "switzerlandnorth": 1.037, + "uksouth": 0.811, + "ukwest": 0.836, + "usgovarizona": 0.83, + "usgovtexas": 0.864, + "usgovvirginia": 0.83, + "westcentralus": 0.829, + "westeurope": 0.83, + "westus": 0.778, + "westus2": 0.691 + }, + "lowprioritye48sv3": { + "australiacentral": 0.725, + "australiacentral2": 0.725, + "australiaeast": 0.725, + "australiasoutheast": 0.725, + "brazilsouth": 1.127, + "brazilsoutheast": 1.466, + "canadacentral": 0.662, + "canadaeast": 0.662, + "centralindia": 0.656, + "centralus": 0.7, + "eastasia": 0.802, + "eastus": 0.605, + "eastus2": 0.605, + "francecentral": 0.748, + "francesouth": 0.973, + "germanycentral": 0.829, + "germanynorth": 0.949, + "germanynortheast": 0.829, + "germanywestcentral": 0.73, + "japaneast": 0.729, + "japanwest": 0.768, + "koreacentral": 0.729, + "koreasouth": 0.647, + "northcentralus": 0.605, + "northeurope": 0.677, + "norwayeast": 0.802, + "norwaywest": 1.043, + "southafricanorth": 0.81, + "southafricawest": 1.016, + "southcentralus": 0.7, + "southeastasia": 0.768, + "southindia": 0.8, + "switzerlandnorth": 0.922, + "switzerlandwest": 1.198, + "uaecentral": 0.943, + "uaenorth": 0.726, + "uksouth": 0.711, + "ukwest": 0.711, + "usgovarizona": 0.725, + "usgovtexas": 0.725, + "usgovvirginia": 0.725, + "westeurope": 0.729, + "westindia": 0.728, + "westus": 0.672, + "westus2": 0.605 + }, + "lowprioritye48sv4": { + "australiaeast": 0.725, + "australiasoutheast": 0.786, + "brazilsouth": 0.965, + "brazilsoutheast": 1.254, + "canadacentral": 0.662, + "canadaeast": 0.662, + "centralindia": 0.624, + "centralus": 0.683, + "eastasia": 0.937, + "eastus": 0.605, + "eastus2": 0.605, + "francecentral": 0.71, + "francesouth": 0.919, + "germanywestcentral": 0.73, + "japaneast": 0.73, + "japanwest": 0.803, + "koreacentral": 0.73, + "northcentralus": 0.605, + "northeurope": 0.677, + "southafricanorth": 0.81, + "southcentralus": 0.726, + "southeastasia": 0.73, + "switzerlandnorth": 0.907, + "uksouth": 0.71, + "ukwest": 0.732, + "usgovarizona": 0.725, + "usgovtexas": 0.756, + "usgovvirginia": 0.725, + "westcentralus": 0.726, + "westeurope": 0.73, + "westus": 0.672, + "westus2": 0.605 + }, + "lowprioritye48v3": { + "australiacentral": 0.725, + "australiacentral2": 0.725, + "australiaeast": 0.725, + "australiasoutheast": 0.725, + "brazilsouth": 1.127, + "brazilsoutheast": 1.466, + "canadacentral": 0.662, + "canadaeast": 0.662, + "centralindia": 0.656, + "centralus": 0.7, + "eastasia": 0.802, + "eastus": 0.605, + "eastus2": 0.605, + "francecentral": 0.748, + "francesouth": 0.973, + "germanycentral": 0.829, + "germanynorth": 0.949, + "germanynortheast": 0.829, + "germanywestcentral": 0.73, + "japaneast": 0.729, + "japanwest": 0.768, + "koreacentral": 0.729, + "koreasouth": 0.647, + "northcentralus": 0.605, + "northeurope": 0.677, + "norwayeast": 0.802, + "norwaywest": 1.043, + "southafricanorth": 0.81, + "southafricawest": 1.016, + "southcentralus": 0.7, + "southeastasia": 0.768, + "southindia": 0.8, + "switzerlandnorth": 0.922, + "switzerlandwest": 1.198, + "uaecentral": 0.943, + "uaenorth": 0.726, + "uksouth": 0.711, + "ukwest": 0.711, + "usgovarizona": 0.725, + "usgovtexas": 0.725, + "usgovvirginia": 0.725, + "westcentralus": 0.7, + "westeurope": 0.729, + "westindia": 0.728, + "westus": 0.672, + "westus2": 0.605 + }, + "lowprioritye48v4": { + "australiaeast": 0.725, + "australiasoutheast": 0.786, + "brazilsouth": 0.965, + "brazilsoutheast": 1.254, + "canadacentral": 0.662, + "canadaeast": 0.662, + "centralindia": 0.624, + "centralus": 0.683, + "eastasia": 0.937, + "eastus": 0.605, + "eastus2": 0.605, + "francecentral": 0.71, + "francesouth": 0.919, + "germanywestcentral": 0.73, + "japaneast": 0.73, + "japanwest": 0.803, + "koreacentral": 0.73, + "northcentralus": 0.605, + "northeurope": 0.677, + "southafricanorth": 0.81, + "southcentralus": 0.726, + "southeastasia": 0.73, + "switzerlandnorth": 0.907, + "uksouth": 0.71, + "ukwest": 0.732, + "usgovarizona": 0.725, + "usgovtexas": 0.756, + "usgovvirginia": 0.725, + "westcentralus": 0.726, + "westeurope": 0.73, + "westus": 0.672, + "westus2": 0.605 + }, + "lowprioritye64asv4": { + "australiaeast": 0.966, + "brazilsouth": 1.286, + "centralindia": 0.832, + "centralus": 0.911, + "eastasia": 1.069, + "eastus": 0.806, + "eastus2": 0.806, + "francecentral": 0.947, + "japaneast": 0.973, + "koreacentral": 0.973, + "northeurope": 0.902, + "southcentralus": 0.968, + "southeastasia": 0.973, + "uksouth": 0.947, + "westeurope": 0.973, + "westus": 0.896, + "westus2": 0.806 + }, + "lowprioritye64av4": { + "australiaeast": 0.966, + "brazilsouth": 1.286, + "centralindia": 0.832, + "centralus": 0.911, + "eastasia": 1.069, + "eastus": 0.806, + "eastus2": 0.806, + "francecentral": 0.947, + "japaneast": 0.973, + "koreacentral": 0.973, + "northeurope": 0.902, + "southcentralus": 0.968, + "southeastasia": 0.973, + "uksouth": 0.947, + "westeurope": 0.973, + "westus": 0.896, + "westus2": 0.806 + }, + "lowprioritye64dsv4": { + "australiaeast": 1.114, + "australiasoutheast": 1.106, + "brazilsouth": 1.464, + "canadacentral": 1.011, + "canadaeast": 1.106, + "centralindia": 0.966, + "centralus": 1.041, + "eastasia": 1.428, + "eastus": 0.922, + "eastus2": 0.922, + "francecentral": 1.082, + "francesouth": 1.401, + "germanywestcentral": 1.107, + "japaneast": 1.114, + "japanwest": 1.223, + "koreacentral": 1.107, + "northcentralus": 0.922, + "northeurope": 1.024, + "southafricanorth": 1.235, + "southcentralus": 1.198, + "southeastasia": 1.114, + "switzerlandnorth": 1.382, + "uksouth": 1.082, + "ukwest": 1.115, + "usgovarizona": 1.107, + "usgovtexas": 1.152, + "usgovvirginia": 1.107, + "westcentralus": 1.106, + "westeurope": 1.107, + "westus": 1.037, + "westus2": 0.922 + }, + "lowprioritye64isv3": { + "australiaeast": 0.869, + "australiasoutheast": 0.869, + "brazilsouth": 1.353, + "brazilsoutheast": 1.76, + "canadacentral": 0.795, + "canadaeast": 0.795, + "centralus": 0.84, + "eastasia": 0.962, + "eastus": 0.726, + "eastus2": 0.726, + "francecentral": 0.898, + "francesouth": 0.941, + "germanycentral": 1.042, + "germanynorth": 1.138, + "germanynortheast": 1.042, + "germanywestcentral": 0.876, + "japaneast": 0.875, + "japanwest": 0.922, + "koreacentral": 0.875, + "koreasouth": 0.756, + "northcentralus": 0.726, + "northeurope": 0.812, + "norwayeast": 0.963, + "norwaywest": 1.252, + "southafricanorth": 0.973, + "southafricawest": 1.219, + "southcentralus": 0.84, + "southeastasia": 0.922, + "southindia": 0.96, + "switzerlandnorth": 1.106, + "switzerlandwest": 1.438, + "uaecentral": 1.138, + "uaenorth": 0.875, + "uksouth": 0.853, + "ukwest": 0.853, + "usgovvirginia": 0.907, + "westcentralus": 0.84, + "westeurope": 0.875, + "westindia": 0.874, + "westus": 0.806, + "westus2": 0.726 + }, + "lowprioritye64iv3": { + "australiaeast": 0.869, + "australiasoutheast": 0.869, + "brazilsouth": 1.353, + "brazilsoutheast": 1.76, + "canadacentral": 0.795, + "canadaeast": 0.795, + "centralus": 0.84, + "eastasia": 0.962, + "eastus": 0.726, + "eastus2": 0.726, + "francecentral": 0.898, + "francesouth": 0.941, + "germanycentral": 1.042, + "germanynorth": 1.138, + "germanynortheast": 1.042, + "germanywestcentral": 0.876, + "japaneast": 0.875, + "japanwest": 0.922, + "koreacentral": 0.875, + "koreasouth": 0.756, + "northcentralus": 0.726, + "northeurope": 0.812, + "norwayeast": 0.963, + "norwaywest": 1.252, + "southafricanorth": 0.973, + "southafricawest": 1.219, + "southcentralus": 0.84, + "southeastasia": 0.922, + "southindia": 0.96, + "switzerlandnorth": 1.106, + "switzerlandwest": 1.438, + "uaecentral": 1.138, + "uaenorth": 0.875, + "uksouth": 0.853, + "ukwest": 0.853, + "usgovvirginia": 0.907, + "westcentralus": 0.84, + "westeurope": 0.875, + "westindia": 0.874, + "westus": 0.806, + "westus2": 0.726 + }, + "lowprioritye64sv3": { + "australiacentral": 0.869, + "australiacentral2": 0.869, + "australiaeast": 0.869, + "australiasoutheast": 0.869, + "brazilsouth": 1.353, + "brazilsoutheast": 1.76, + "canadacentral": 0.795, + "canadaeast": 0.795, + "centralindia": 0.787, + "centralus": 0.84, + "eastasia": 0.962, + "eastus": 0.726, + "eastus2": 0.726, + "francecentral": 0.898, + "francesouth": 1.167, + "germanycentral": 1.042, + "germanynorth": 1.138, + "germanynortheast": 1.042, + "germanywestcentral": 0.876, + "japaneast": 0.875, + "japanwest": 0.922, + "koreacentral": 0.875, + "koreasouth": 0.776, + "northcentralus": 0.726, + "northeurope": 0.812, + "norwayeast": 0.963, + "norwaywest": 1.252, + "southafricanorth": 0.973, + "southafricawest": 1.219, + "southcentralus": 0.84, + "southeastasia": 0.922, + "southindia": 0.96, + "switzerlandnorth": 1.106, + "switzerlandwest": 1.438, + "uaecentral": 1.132, + "uaenorth": 0.871, + "uksouth": 0.853, + "ukwest": 0.853, + "usgovarizona": 0.869, + "usgovtexas": 0.869, + "usgovvirginia": 0.963, + "westcentralus": 0.84, + "westeurope": 0.875, + "westindia": 0.874, + "westus": 0.806, + "westus2": 0.726 + }, + "lowprioritye64sv4": { + "australiaeast": 0.966, + "australiasoutheast": 1.048, + "brazilsouth": 1.286, + "brazilsoutheast": 1.672, + "canadacentral": 0.883, + "canadaeast": 0.883, + "centralindia": 0.832, + "centralus": 0.911, + "eastasia": 1.25, + "eastus": 0.806, + "eastus2": 0.806, + "francecentral": 0.947, + "francesouth": 1.226, + "germanywestcentral": 0.973, + "japaneast": 0.973, + "japanwest": 1.07, + "koreacentral": 0.973, + "northcentralus": 0.806, + "northeurope": 0.902, + "southafricanorth": 1.081, + "southcentralus": 0.968, + "southeastasia": 0.973, + "switzerlandnorth": 1.21, + "uksouth": 0.947, + "ukwest": 0.976, + "usgovarizona": 0.966, + "usgovtexas": 1.008, + "usgovvirginia": 0.966, + "westcentralus": 0.968, + "westeurope": 0.973, + "westus": 0.896, + "westus2": 0.806 + }, + "lowprioritye64v3": { + "australiacentral": 0.869, + "australiacentral2": 0.869, + "australiaeast": 0.869, + "australiasoutheast": 0.869, + "brazilsouth": 1.353, + "brazilsoutheast": 1.76, + "canadacentral": 0.795, + "canadaeast": 0.795, + "centralindia": 0.787, + "centralus": 0.84, + "eastasia": 0.962, + "eastus": 0.726, + "eastus2": 0.726, + "francecentral": 0.898, + "francesouth": 1.167, + "germanycentral": 1.042, + "germanynorth": 1.138, + "germanynortheast": 1.042, + "germanywestcentral": 0.876, + "japaneast": 0.875, + "japanwest": 0.922, + "koreacentral": 0.875, + "koreasouth": 0.776, + "northcentralus": 0.726, + "northeurope": 0.812, + "norwayeast": 0.963, + "norwaywest": 1.252, + "southafricanorth": 0.973, + "southafricawest": 1.219, + "southcentralus": 0.84, + "southeastasia": 0.922, + "southindia": 0.96, + "switzerlandnorth": 1.106, + "switzerlandwest": 1.438, + "uaecentral": 1.132, + "uaenorth": 0.871, + "uksouth": 0.853, + "ukwest": 0.853, + "usgovarizona": 0.869, + "usgovtexas": 0.869, + "usgovvirginia": 0.963, + "westcentralus": 0.84, + "westeurope": 0.875, + "westindia": 0.874, + "westus": 0.806, + "westus2": 0.726 + }, + "lowprioritye64v4": { + "australiaeast": 0.966, + "australiasoutheast": 1.048, + "brazilsouth": 1.286, + "brazilsoutheast": 1.672, + "canadacentral": 0.883, + "canadaeast": 0.883, + "centralindia": 0.832, + "centralus": 0.911, + "eastasia": 1.25, + "eastus": 0.806, + "eastus2": 0.806, + "francecentral": 0.947, + "francesouth": 1.226, + "germanywestcentral": 0.973, + "japaneast": 0.973, + "japanwest": 1.07, + "koreacentral": 0.973, + "northcentralus": 0.806, + "northeurope": 0.902, + "southafricanorth": 1.081, + "southcentralus": 0.968, + "southeastasia": 0.973, + "switzerlandnorth": 1.21, + "uksouth": 0.947, + "ukwest": 0.976, + "usgovarizona": 0.966, + "usgovtexas": 1.008, + "usgovvirginia": 0.966, + "westcentralus": 0.968, + "westeurope": 0.973, + "westus": 0.896, + "westus2": 0.806 + }, + "lowprioritye96asv4": { + "australiaeast": 1.45, + "brazilsouth": 1.93, + "centralindia": 1.248, + "centralus": 1.367, + "eastasia": 1.603, + "eastus": 1.21, + "eastus2": 1.21, + "francecentral": 1.421, + "japaneast": 1.459, + "koreacentral": 1.459, + "northeurope": 1.354, + "southcentralus": 1.452, + "southeastasia": 1.459, + "uksouth": 1.421, + "westeurope": 1.459, + "westus": 1.344, + "westus2": 1.21 + }, + "lowprioritye96av4": { + "australiaeast": 1.45, + "brazilsouth": 1.93, + "centralindia": 1.248, + "centralus": 1.367, + "eastasia": 1.603, + "eastus": 1.21, + "eastus2": 1.21, + "francecentral": 1.421, + "japaneast": 1.459, + "koreacentral": 1.459, + "northeurope": 1.354, + "southcentralus": 1.452, + "southeastasia": 1.459, + "uksouth": 1.421, + "westeurope": 1.459, + "westus": 1.344, + "westus2": 1.21 + }, + "lowpriorityf1": { + "australiacentral": 0.013, + "australiacentral2": 0.013, + "australiaeast": 0.013, + "australiasoutheast": 0.013, + "brazilsouth": 0.0144, + "brazilsoutheast": 0.0187, + "canadacentral": 0.01, + "canadaeast": 0.0109, + "centralindia": 0.00988, + "centralus": 0.0109, + "eastasia": 0.014, + "eastus": 0.0099, + "eastus2": 0.0099, + "francecentral": 0.0101, + "francesouth": 0.0131, + "germanycentral": 0.012, + "germanynorth": 0.0148, + "germanynortheast": 0.012, + "germanywestcentral": 0.0114, + "japaneast": 0.0126, + "japanwest": 0.0126, + "koreacentral": 0.01, + "koreasouth": 0.01, + "northcentralus": 0.00995, + "northeurope": 0.011, + "norwayeast": 0.0125, + "norwaywest": 0.0162, + "southafricanorth": 0.0133, + "southafricawest": 0.0167, + "southcentralus": 0.0109, + "southeastasia": 0.0115, + "southindia": 0.012, + "switzerlandnorth": 0.0136, + "switzerlandwest": 0.0177, + "uaecentral": 0.0155, + "uaenorth": 0.0119, + "uksouth": 0.0119, + "ukwest": 0.0119, + "usgovarizona": 0.012, + "usgovtexas": 0.012, + "usgovvirginia": 0.012, + "westcentralus": 0.0109, + "westeurope": 0.011, + "westindia": 0.011, + "westus": 0.012, + "westus2": 0.0099 + }, + "lowpriorityf1s": { + "australiacentral": 0.013, + "australiacentral2": 0.013, + "australiaeast": 0.013, + "australiasoutheast": 0.013, + "brazilsouth": 0.0144, + "brazilsoutheast": 0.0187, + "canadacentral": 0.01, + "canadaeast": 0.0109, + "centralindia": 0.00988, + "centralus": 0.0109, + "eastasia": 0.014, + "eastus": 0.0099, + "eastus2": 0.0099, + "francecentral": 0.0101, + "francesouth": 0.0131, + "germanycentral": 0.012, + "germanynorth": 0.0148, + "germanynortheast": 0.012, + "germanywestcentral": 0.0114, + "japaneast": 0.0126, + "japanwest": 0.0126, + "koreacentral": 0.01, + "koreasouth": 0.01, + "northcentralus": 0.00995, + "northeurope": 0.011, + "norwayeast": 0.0125, + "norwaywest": 0.0162, + "southafricanorth": 0.0133, + "southafricawest": 0.0167, + "southcentralus": 0.0109, + "southeastasia": 0.0115, + "southindia": 0.012, + "switzerlandnorth": 0.0136, + "switzerlandwest": 0.0177, + "uaecentral": 0.0155, + "uaenorth": 0.0119, + "uksouth": 0.0119, + "ukwest": 0.0119, + "usgovarizona": 0.012, + "usgovtexas": 0.012, + "usgovvirginia": 0.012, + "westcentralus": 0.0109, + "westeurope": 0.011, + "westindia": 0.011, + "westus": 0.012, + "westus2": 0.0099 + }, + "lowpriorityf2": { + "australiacentral": 0.026, + "australiacentral2": 0.026, + "australiaeast": 0.026, + "australiasoutheast": 0.026, + "brazilsouth": 0.0287, + "brazilsoutheast": 0.0373, + "canadacentral": 0.0207, + "canadaeast": 0.0218, + "centralindia": 0.0198, + "centralus": 0.0219, + "eastasia": 0.0289, + "eastus": 0.0199, + "eastus2": 0.0199, + "francecentral": 0.0202, + "francesouth": 0.0262, + "germanycentral": 0.0246, + "germanynorth": 0.0296, + "germanynortheast": 0.0246, + "germanywestcentral": 0.0228, + "japaneast": 0.025, + "japanwest": 0.025, + "koreacentral": 0.0204, + "koreasouth": 0.0204, + "northcentralus": 0.0199, + "northeurope": 0.0226, + "norwayeast": 0.0251, + "norwaywest": 0.0326, + "southafricanorth": 0.0266, + "southafricawest": 0.0334, + "southcentralus": 0.0219, + "southeastasia": 0.023, + "southindia": 0.024, + "switzerlandnorth": 0.0274, + "switzerlandwest": 0.0356, + "uaecentral": 0.031, + "uaenorth": 0.0239, + "uksouth": 0.0237, + "ukwest": 0.0237, + "usgovarizona": 0.0239, + "usgovtexas": 0.0239, + "usgovvirginia": 0.0239, + "westcentralus": 0.0219, + "westeurope": 0.0227, + "westindia": 0.0219, + "westus": 0.0249, + "westus2": 0.0199 + }, + "lowpriorityf2s": { + "australiacentral": 0.026, + "australiacentral2": 0.026, + "australiaeast": 0.026, + "australiasoutheast": 0.026, + "brazilsouth": 0.0287, + "brazilsoutheast": 0.0373, + "canadacentral": 0.0207, + "canadaeast": 0.0218, + "centralindia": 0.0198, + "centralus": 0.0219, + "eastasia": 0.0289, + "eastus": 0.0199, + "eastus2": 0.0199, + "francecentral": 0.0202, + "francesouth": 0.0262, + "germanycentral": 0.0246, + "germanynorth": 0.0296, + "germanynortheast": 0.0246, + "germanywestcentral": 0.0228, + "japaneast": 0.025, + "japanwest": 0.025, + "koreacentral": 0.0204, + "koreasouth": 0.0204, + "northcentralus": 0.0199, + "northeurope": 0.0226, + "norwayeast": 0.0251, + "norwaywest": 0.0326, + "southafricanorth": 0.0266, + "southafricawest": 0.0334, + "southcentralus": 0.0219, + "southeastasia": 0.023, + "southindia": 0.024, + "switzerlandnorth": 0.0274, + "switzerlandwest": 0.0356, + "uaecentral": 0.031, + "uaenorth": 0.0239, + "uksouth": 0.0237, + "ukwest": 0.0237, + "usgovarizona": 0.0239, + "usgovtexas": 0.0239, + "usgovvirginia": 0.0239, + "westcentralus": 0.0219, + "westeurope": 0.0227, + "westindia": 0.0219, + "westus": 0.0249, + "westus2": 0.0199 + }, + "lowpriorityf2sv2": { + "australiacentral": 0.017, + "australiacentral2": 0.017, + "australiaeast": 0.017, + "australiasoutheast": 0.017, + "brazilsouth": 0.017, + "canadacentral": 0.017, + "canadaeast": 0.017, + "centralindia": 0.017, + "centralus": 0.017, + "eastasia": 0.0196, + "eastus": 0.0169, + "eastus2": 0.0169, + "francecentral": 0.017, + "francesouth": 0.017, + "germanycentral": 0.017, + "germanynorth": 0.0252, + "germanywestcentral": 0.037, + "japaneast": 0.017, + "japanwest": 0.017, + "koreacentral": 0.017, + "koreasouth": 0.017, + "northcentralus": 0.017, + "northeurope": 0.0192, + "southcentralus": 0.017, + "southeastasia": 0.0196, + "southindia": 0.017, + "uaecentral": 0.0265, + "uaenorth": 0.0204, + "uksouth": 0.017, + "ukwest": 0.0202, + "usgovarizona": 0.021, + "usgovtexas": 0.0204, + "usgovvirginia": 0.0204, + "westcentralus": 0.017, + "westeurope": 0.0194, + "westindia": 0.017, + "westus": 0.017, + "westus2": 0.0169 + }, + "lowpriorityf4": { + "australiacentral": 0.052, + "australiacentral2": 0.052, + "australiaeast": 0.052, + "australiasoutheast": 0.052, + "brazilsouth": 0.0574, + "brazilsoutheast": 0.0747, + "canadacentral": 0.041, + "canadaeast": 0.0437, + "centralindia": 0.0395, + "centralus": 0.0438, + "eastasia": 0.0578, + "eastus": 0.0398, + "eastus2": 0.0398, + "francecentral": 0.0404, + "francesouth": 0.0525, + "germanycentral": 0.049, + "germanynorth": 0.0593, + "germanynortheast": 0.049, + "germanywestcentral": 0.0454, + "japaneast": 0.05, + "japanwest": 0.05, + "koreacentral": 0.0408, + "koreasouth": 0.0408, + "northcentralus": 0.0398, + "northeurope": 0.045, + "norwayeast": 0.0499, + "norwaywest": 0.0649, + "southafricanorth": 0.0534, + "southafricawest": 0.0668, + "southcentralus": 0.0438, + "southeastasia": 0.046, + "southindia": 0.048, + "switzerlandnorth": 0.0547, + "switzerlandwest": 0.0711, + "uaecentral": 0.0621, + "uaenorth": 0.0478, + "uksouth": 0.047, + "ukwest": 0.047, + "usgovarizona": 0.0479, + "usgovtexas": 0.0479, + "usgovvirginia": 0.0479, + "westcentralus": 0.0438, + "westeurope": 0.045, + "westindia": 0.0439, + "westus": 0.0498, + "westus2": 0.0398 + }, + "lowpriorityf4s": { + "australiacentral": 0.052, + "australiacentral2": 0.052, + "australiaeast": 0.052, + "australiasoutheast": 0.052, + "brazilsouth": 0.0574, + "brazilsoutheast": 0.0747, + "canadacentral": 0.041, + "canadaeast": 0.0437, + "centralindia": 0.0395, + "centralus": 0.0438, + "eastasia": 0.0578, + "eastus": 0.0398, + "eastus2": 0.0398, + "francecentral": 0.0404, + "francesouth": 0.0525, + "germanycentral": 0.049, + "germanynorth": 0.0593, + "germanynortheast": 0.049, + "germanywestcentral": 0.0454, + "japaneast": 0.05, + "japanwest": 0.05, + "koreacentral": 0.0408, + "koreasouth": 0.0408, + "northcentralus": 0.0398, + "northeurope": 0.045, + "norwayeast": 0.0499, + "norwaywest": 0.0649, + "southafricanorth": 0.0534, + "southafricawest": 0.0668, + "southcentralus": 0.0438, + "southeastasia": 0.046, + "southindia": 0.048, + "switzerlandnorth": 0.0547, + "switzerlandwest": 0.0711, + "uaecentral": 0.0621, + "uaenorth": 0.0478, + "uksouth": 0.047, + "ukwest": 0.047, + "usgovarizona": 0.0479, + "usgovtexas": 0.0479, + "usgovvirginia": 0.0479, + "westcentralus": 0.0438, + "westeurope": 0.045, + "westindia": 0.0439, + "westus": 0.0498, + "westus2": 0.0398 + }, + "lowpriorityf4sv2": { + "australiacentral": 0.034, + "australiacentral2": 0.034, + "australiaeast": 0.034, + "australiasoutheast": 0.034, + "brazilsouth": 0.034, + "canadacentral": 0.034, + "canadaeast": 0.034, + "centralindia": 0.034, + "centralus": 0.034, + "eastasia": 0.0392, + "eastus": 0.0338, + "eastus2": 0.0338, + "francecentral": 0.034, + "francesouth": 0.034, + "germanycentral": 0.034, + "germanynorth": 0.0504, + "germanywestcentral": 0.074, + "japaneast": 0.034, + "japanwest": 0.034, + "koreacentral": 0.034, + "koreasouth": 0.034, + "northcentralus": 0.034, + "northeurope": 0.0384, + "southcentralus": 0.034, + "southeastasia": 0.039, + "southindia": 0.034, + "uaecentral": 0.053, + "uaenorth": 0.0408, + "uksouth": 0.034, + "ukwest": 0.0405, + "usgovarizona": 0.0425, + "usgovtexas": 0.0408, + "usgovvirginia": 0.0408, + "westcentralus": 0.034, + "westeurope": 0.0388, + "westindia": 0.034, + "westus": 0.034, + "westus2": 0.0338 + }, + "lowpriorityf8": { + "australiacentral": 0.104, + "australiacentral2": 0.104, + "australiaeast": 0.104, + "australiasoutheast": 0.104, + "brazilsouth": 0.115, + "brazilsoutheast": 0.149, + "canadacentral": 0.083, + "canadaeast": 0.0874, + "centralindia": 0.079, + "centralus": 0.0875, + "eastasia": 0.116, + "eastus": 0.0796, + "eastus2": 0.0796, + "francecentral": 0.0808, + "francesouth": 0.105, + "germanycentral": 0.098, + "germanynorth": 0.119, + "germanynortheast": 0.098, + "germanywestcentral": 0.0908, + "japaneast": 0.101, + "japanwest": 0.101, + "koreacentral": 0.0816, + "koreasouth": 0.0816, + "northcentralus": 0.0796, + "northeurope": 0.0905, + "norwayeast": 0.0999, + "norwaywest": 0.13, + "southafricanorth": 0.107, + "southafricawest": 0.134, + "southcentralus": 0.0875, + "southeastasia": 0.092, + "southindia": 0.0966, + "switzerlandnorth": 0.109, + "switzerlandwest": 0.142, + "uaecentral": 0.124, + "uaenorth": 0.0955, + "uksouth": 0.095, + "ukwest": 0.095, + "usgovarizona": 0.0957, + "usgovtexas": 0.0957, + "usgovvirginia": 0.0957, + "westcentralus": 0.0875, + "westeurope": 0.0909, + "westindia": 0.0878, + "westus": 0.0996, + "westus2": 0.0796 + }, + "lowpriorityf8s": { + "australiacentral": 0.104, + "australiacentral2": 0.104, + "australiaeast": 0.104, + "australiasoutheast": 0.104, + "brazilsouth": 0.115, + "brazilsoutheast": 0.149, + "canadacentral": 0.083, + "canadaeast": 0.0874, + "centralindia": 0.079, + "centralus": 0.0875, + "eastasia": 0.116, + "eastus": 0.0796, + "eastus2": 0.0796, + "francecentral": 0.0808, + "francesouth": 0.105, + "germanycentral": 0.098, + "germanynorth": 0.119, + "germanynortheast": 0.098, + "germanywestcentral": 0.0908, + "japaneast": 0.101, + "japanwest": 0.101, + "koreacentral": 0.0816, + "koreasouth": 0.0816, + "northcentralus": 0.0796, + "northeurope": 0.0905, + "norwayeast": 0.0999, + "norwaywest": 0.13, + "southafricanorth": 0.107, + "southafricawest": 0.134, + "southcentralus": 0.0875, + "southeastasia": 0.092, + "southindia": 0.0966, + "switzerlandnorth": 0.109, + "switzerlandwest": 0.142, + "uaecentral": 0.124, + "uaenorth": 0.0955, + "uksouth": 0.095, + "ukwest": 0.095, + "usgovarizona": 0.0957, + "usgovtexas": 0.0957, + "usgovvirginia": 0.0957, + "westcentralus": 0.0875, + "westeurope": 0.0909, + "westindia": 0.0878, + "westus": 0.0996, + "westus2": 0.0796 + }, + "lowpriorityf8sv2": { + "australiacentral": 0.068, + "australiacentral2": 0.068, + "australiaeast": 0.068, + "australiasoutheast": 0.068, + "brazilsouth": 0.068, + "canadacentral": 0.068, + "canadaeast": 0.068, + "centralindia": 0.068, + "centralus": 0.068, + "eastasia": 0.0786, + "eastus": 0.0677, + "eastus2": 0.0677, + "francecentral": 0.068, + "francesouth": 0.068, + "germanycentral": 0.068, + "germanynorth": 0.101, + "germanywestcentral": 0.148, + "japaneast": 0.068, + "japanwest": 0.068, + "koreacentral": 0.068, + "koreasouth": 0.068, + "northcentralus": 0.068, + "northeurope": 0.0768, + "southcentralus": 0.068, + "southeastasia": 0.0784, + "southindia": 0.068, + "uaecentral": 0.106, + "uaenorth": 0.0816, + "uksouth": 0.068, + "ukwest": 0.0809, + "usgovarizona": 0.085, + "usgovtexas": 0.0816, + "usgovvirginia": 0.0816, + "westcentralus": 0.068, + "westeurope": 0.0776, + "westindia": 0.068, + "westus": 0.068, + "westus2": 0.0677 + }, + "lowpriorityf16": { + "australiacentral": 0.208, + "australiacentral2": 0.208, + "australiaeast": 0.208, + "australiasoutheast": 0.208, + "brazilsouth": 0.23, + "brazilsoutheast": 0.299, + "canadacentral": 0.166, + "canadaeast": 0.175, + "centralindia": 0.158, + "centralus": 0.175, + "eastasia": 0.231, + "eastus": 0.159, + "eastus2": 0.159, + "francecentral": 0.162, + "francesouth": 0.21, + "germanycentral": 0.196, + "germanynorth": 0.237, + "germanynortheast": 0.196, + "germanywestcentral": 0.182, + "japaneast": 0.202, + "japanwest": 0.202, + "koreacentral": 0.163, + "koreasouth": 0.163, + "northcentralus": 0.159, + "northeurope": 0.181, + "norwayeast": 0.2, + "norwaywest": 0.26, + "southafricanorth": 0.213, + "southafricawest": 0.267, + "southcentralus": 0.175, + "southeastasia": 0.185, + "southindia": 0.193, + "switzerlandnorth": 0.219, + "switzerlandwest": 0.285, + "uaecentral": 0.248, + "uaenorth": 0.191, + "uksouth": 0.19, + "ukwest": 0.19, + "usgovarizona": 0.191, + "usgovtexas": 0.191, + "usgovvirginia": 0.191, + "westcentralus": 0.175, + "westeurope": 0.182, + "westindia": 0.176, + "westus": 0.199, + "westus2": 0.159 + }, + "lowpriorityf16s": { + "australiacentral": 0.208, + "australiacentral2": 0.208, + "australiaeast": 0.208, + "australiasoutheast": 0.208, + "brazilsouth": 0.23, + "brazilsoutheast": 0.299, + "canadacentral": 0.166, + "canadaeast": 0.175, + "centralindia": 0.158, + "centralus": 0.175, + "eastasia": 0.231, + "eastus": 0.159, + "eastus2": 0.159, + "francecentral": 0.162, + "francesouth": 0.21, + "germanycentral": 0.196, + "germanynorth": 0.237, + "germanynortheast": 0.196, + "germanywestcentral": 0.182, + "japaneast": 0.202, + "japanwest": 0.202, + "koreacentral": 0.163, + "koreasouth": 0.163, + "northcentralus": 0.159, + "northeurope": 0.181, + "norwayeast": 0.2, + "norwaywest": 0.26, + "southafricanorth": 0.213, + "southafricawest": 0.267, + "southcentralus": 0.175, + "southeastasia": 0.185, + "southindia": 0.193, + "switzerlandnorth": 0.219, + "switzerlandwest": 0.285, + "uaecentral": 0.248, + "uaenorth": 0.191, + "uksouth": 0.19, + "ukwest": 0.19, + "usgovarizona": 0.191, + "usgovtexas": 0.191, + "usgovvirginia": 0.191, + "westcentralus": 0.175, + "westeurope": 0.182, + "westindia": 0.176, + "westus": 0.199, + "westus2": 0.159 + }, + "lowpriorityf16sv2": { + "australiacentral": 0.136, + "australiacentral2": 0.136, + "australiaeast": 0.136, + "australiasoutheast": 0.136, + "brazilsouth": 0.136, + "canadacentral": 0.136, + "canadaeast": 0.136, + "centralindia": 0.136, + "centralus": 0.136, + "eastasia": 0.157, + "eastus": 0.135, + "eastus2": 0.135, + "francecentral": 0.136, + "francesouth": 0.136, + "germanycentral": 0.136, + "germanynorth": 0.202, + "germanywestcentral": 0.296, + "japaneast": 0.136, + "japanwest": 0.136, + "koreacentral": 0.136, + "koreasouth": 0.136, + "northcentralus": 0.136, + "northeurope": 0.1536, + "southcentralus": 0.136, + "southeastasia": 0.157, + "southindia": 0.136, + "uaecentral": 0.212, + "uaenorth": 0.163, + "uksouth": 0.136, + "ukwest": 0.162, + "usgovarizona": 0.17, + "usgovtexas": 0.1632, + "usgovvirginia": 0.1632, + "westcentralus": 0.136, + "westeurope": 0.155, + "westindia": 0.136, + "westus": 0.136, + "westus2": 0.135 + }, + "lowpriorityf32sv2": { + "australiacentral": 0.272, + "australiacentral2": 0.272, + "australiaeast": 0.272, + "australiasoutheast": 0.272, + "brazilsouth": 0.272, + "canadacentral": 0.272, + "canadaeast": 0.272, + "centralindia": 0.272, + "centralus": 0.272, + "eastasia": 0.3142, + "eastus": 0.271, + "eastus2": 0.271, + "francecentral": 0.272, + "francesouth": 0.272, + "germanycentral": 0.272, + "germanynorth": 0.404, + "germanywestcentral": 0.592, + "japaneast": 0.272, + "japanwest": 0.272, + "koreacentral": 0.272, + "koreasouth": 0.272, + "northcentralus": 0.272, + "northeurope": 0.307, + "southcentralus": 0.272, + "southeastasia": 0.314, + "southindia": 0.272, + "uaecentral": 0.424, + "uaenorth": 0.326, + "uksouth": 0.272, + "ukwest": 0.324, + "usgovarizona": 0.34, + "usgovtexas": 0.3264, + "usgovvirginia": 0.3264, + "westcentralus": 0.272, + "westeurope": 0.31, + "westindia": 0.272, + "westus": 0.272, + "westus2": 0.271 + }, + "lowpriorityf48sv2": { + "australiacentral": 0.533, + "australiacentral2": 0.533, + "australiaeast": 0.533, + "australiasoutheast": 0.534, + "brazilsouth": 0.629, + "canadacentral": 0.445, + "canadaeast": 0.445, + "centralindia": 0.408, + "centralus": 0.49, + "eastasia": 0.518, + "eastus": 0.406, + "eastus2": 0.406, + "francecentral": 0.485, + "francesouth": 0.628, + "germanynorth": 0.605, + "germanywestcentral": 0.466, + "japaneast": 0.514, + "japanwest": 0.563, + "koreacentral": 0.461, + "koreasouth": 0.461, + "northcentralus": 0.408, + "northeurope": 0.461, + "southafricanorth": 0.547, + "southafricawest": 0.685, + "southcentralus": 0.49, + "southeastasia": 0.47, + "southindia": 0.449, + "switzerlandnorth": 0.559, + "switzerlandwest": 0.726, + "uaecentral": 0.637, + "uaenorth": 0.49, + "uksouth": 0.485, + "ukwest": 0.486, + "usgovarizona": 0.49, + "usgovvirginia": 0.49, + "westeurope": 0.466, + "westindia": 0.408, + "westus": 0.509, + "westus2": 0.406 + }, + "lowpriorityf64sv2": { + "australiacentral": 0.544, + "australiacentral2": 0.544, + "australiaeast": 0.544, + "australiasoutheast": 0.544, + "brazilsouth": 0.544, + "canadacentral": 0.544, + "canadaeast": 0.544, + "centralindia": 0.544, + "centralus": 0.544, + "eastasia": 0.6284, + "eastus": 0.541, + "eastus2": 0.541, + "francecentral": 0.544, + "francesouth": 0.544, + "germanycentral": 0.544, + "germanynorth": 0.807, + "germanywestcentral": 1.184, + "japaneast": 0.544, + "japanwest": 0.544, + "koreacentral": 0.544, + "koreasouth": 0.544, + "northcentralus": 0.544, + "northeurope": 0.614, + "southcentralus": 0.544, + "southeastasia": 0.627, + "southindia": 0.544, + "uaecentral": 0.849, + "uaenorth": 0.653, + "uksouth": 0.544, + "ukwest": 0.647, + "usgovarizona": 0.68, + "usgovtexas": 0.6528, + "usgovvirginia": 0.6528, + "westcentralus": 0.544, + "westeurope": 0.621, + "westindia": 0.544, + "westus": 0.544, + "westus2": 0.541 + }, + "lowpriorityf72sv2": { + "australiacentral": 0.612, + "australiacentral2": 0.612, + "australiaeast": 0.612, + "australiasoutheast": 0.612, + "brazilsouth": 0.612, + "canadacentral": 0.612, + "canadaeast": 0.612, + "centralindia": 0.612, + "centralus": 0.612, + "eastasia": 0.7068, + "eastus": 0.609, + "eastus2": 0.609, + "francecentral": 0.612, + "francesouth": 0.612, + "germanycentral": 0.612, + "germanynorth": 0.908, + "germanywestcentral": 1.332, + "japaneast": 0.612, + "japanwest": 0.612, + "koreacentral": 0.612, + "koreasouth": 0.612, + "northcentralus": 0.612, + "northeurope": 0.691, + "southcentralus": 0.612, + "southeastasia": 0.706, + "southindia": 0.612, + "uaecentral": 0.955, + "uaenorth": 0.734, + "uksouth": 0.612, + "ukwest": 0.728, + "usgovarizona": 0.765, + "usgovtexas": 0.7344, + "usgovvirginia": 0.7344, + "westcentralus": 0.612, + "westeurope": 0.698, + "westindia": 0.612, + "westus": 0.612, + "westus2": 0.609 + }, + "lowpriorityg1": { + "australiaeast": 0.128, + "canadacentral": 0.097, + "canadaeast": 0.097, + "eastasia": 0.152, + "eastus2": 0.11, + "germanycentral": 0.1232, + "japaneast": 0.115, + "northeurope": 0.122, + "southeastasia": 0.132, + "uksouth": 0.055, + "usgovarizona": 0.138, + "usgovtexas": 0.138, + "usgovvirginia": 0.11, + "westeurope": 0.14, + "westus": 0.122, + "westus2": 0.098 + }, + "lowpriorityg2": { + "australiaeast": 0.255, + "canadacentral": 0.194, + "canadaeast": 0.194, + "eastasia": 0.304, + "eastus2": 0.22, + "germanycentral": 0.2464, + "japaneast": 0.23, + "northeurope": 0.244, + "southeastasia": 0.264, + "uksouth": 0.11, + "usgovarizona": 0.275, + "usgovtexas": 0.61, + "usgovvirginia": 0.22, + "westeurope": 0.28, + "westus": 0.244, + "westus2": 0.196 + }, + "lowpriorityg3": { + "australiaeast": 0.51, + "canadacentral": 0.387, + "canadaeast": 0.387, + "eastasia": 0.608, + "eastus2": 0.44, + "germanycentral": 0.4928, + "japaneast": 0.46, + "northeurope": 0.488, + "southeastasia": 0.528, + "uksouth": 0.22, + "usgovarizona": 1.22, + "usgovtexas": 0.55, + "usgovvirginia": 0.44, + "westeurope": 0.56, + "westus": 0.488, + "westus2": 0.392 + }, + "lowpriorityg4": { + "australiaeast": 1.021, + "canadacentral": 0.774, + "canadaeast": 0.774, + "eastasia": 1.216, + "eastus2": 0.88, + "germanycentral": 0.9856, + "japaneast": 0.92, + "northeurope": 0.976, + "southeastasia": 1.056, + "uksouth": 0.439, + "usgovarizona": 1.1, + "usgovtexas": 2.44, + "usgovvirginia": 0.88, + "westeurope": 1.12, + "westus": 0.976, + "westus2": 0.784 + }, + "lowpriorityg5": { + "australiaeast": 2.042, + "canadacentral": 1.549, + "canadaeast": 1.549, + "eastasia": 2.16, + "eastus2": 1.564, + "germanycentral": 1.9712, + "japaneast": 1.841, + "northeurope": 1.738, + "southeastasia": 1.878, + "uksouth": 0.878, + "usgovarizona": 1.955, + "usgovtexas": 4.39, + "usgovvirginia": 1.76, + "westeurope": 1.998, + "westus": 1.738, + "westus2": 1.564 + }, + "lowpriorityh8": { + "australiaeast": 0.237, + "centralindia": 0.2, + "eastus": 0.181, + "japaneast": 0.229, + "northcentralus": 0.181, + "northeurope": 0.194, + "southcentralus": 0.175, + "southeastasia": 0.185, + "uksouth": 0.19, + "usgovarizona": 0.199, + "westeurope": 0.206, + "westus": 0.194, + "westus2": 0.159 + }, + "lowpriorityh8m": { + "australiaeast": 0.317, + "centralindia": 0.267, + "eastus": 0.242, + "japaneast": 0.307, + "northcentralus": 0.242, + "northeurope": 0.26, + "southcentralus": 0.234, + "southeastasia": 0.248, + "uksouth": 0.255, + "usgovarizona": 0.266, + "westeurope": 0.277, + "westus": 0.26, + "westus2": 0.213 + }, + "lowpriorityh16": { + "australiaeast": 0.474, + "centralindia": 0.399, + "eastus": 0.361, + "japaneast": 0.458, + "northcentralus": 0.362, + "northeurope": 0.388, + "southcentralus": 0.35, + "southeastasia": 0.37, + "uksouth": 0.38, + "usgovarizona": 0.398, + "westeurope": 0.413, + "westus": 0.388, + "westus2": 0.318 + }, + "lowpriorityh16m": { + "australiaeast": 0.635, + "centralindia": 0.535, + "eastus": 0.484, + "japaneast": 0.614, + "northcentralus": 0.485, + "northeurope": 0.52, + "southcentralus": 0.469, + "southeastasia": 0.495, + "uksouth": 0.51, + "usgovarizona": 0.533, + "westeurope": 0.553, + "westus": 0.52, + "westus2": 0.426 + }, + "lowpriorityh16mr": { + "australiaeast": 0.698, + "centralindia": 0.588, + "eastus": 0.533, + "japaneast": 0.675, + "northcentralus": 0.533, + "northeurope": 0.572, + "southcentralus": 0.515, + "southeastasia": 0.545, + "uksouth": 0.561, + "usgovarizona": 0.586, + "westeurope": 0.609, + "westus": 0.572, + "westus2": 0.469 + }, + "lowpriorityh16r": { + "australiaeast": 0.521, + "centralindia": 0.439, + "eastus": 0.398, + "japaneast": 0.504, + "northcentralus": 0.398, + "northeurope": 0.427, + "southcentralus": 0.385, + "southeastasia": 0.407, + "uksouth": 0.418, + "usgovarizona": 0.438, + "westeurope": 0.454, + "westus": 0.427, + "westus2": 0.35 + }, + "lowpriorityhb60rs": { + "eastus": 0.456, + "southcentralus": 0.502, + "westeurope": 0.592 + }, + "lowpriorityhb120rsv2": { + "centralus": 0.886, + "eastus": 0.72, + "japaneast": 1.044, + "northcentralus": 0.864, + "southcentralus": 0.792, + "uaenorth": 0.95, + "uksouth": 0.9, + "westeurope": 0.936, + "westus2": 0.72 + }, + "lowpriorityhc44rs": { + "eastus": 0.634, + "japaneast": 0.919, + "southcentralus": 0.697, + "southeastasia": 0.824, + "westeurope": 0.824, + "westus2": 0.634 + }, + "lowpriorityl8sv2": { + "australiaeast": 0.15, + "eastus": 0.125, + "eastus2": 0.125, + "northeurope": 0.138, + "southcentralus": 0.15, + "southeastasia": 0.15, + "usgovarizona": 0.15, + "usgovvirginia": 0.15, + "westeurope": 0.149, + "westus": 0.138, + "westus2": 0.125 + }, + "lowpriorityl16sv2": { + "australiaeast": 0.299, + "eastus": 0.25, + "eastus2": 0.25, + "northeurope": 0.275, + "southcentralus": 0.3, + "southeastasia": 0.299, + "usgovarizona": 0.301, + "usgovvirginia": 0.301, + "westeurope": 0.298, + "westus": 0.275, + "westus2": 0.25 + }, + "lowpriorityl32sv2": { + "australiaeast": 0.598, + "eastus": 0.499, + "eastus2": 0.499, + "northeurope": 0.55, + "southcentralus": 0.599, + "southeastasia": 0.598, + "usgovarizona": 0.602, + "usgovvirginia": 0.602, + "westeurope": 0.595, + "westus": 0.55, + "westus2": 0.499 + }, + "lowpriorityl48sv2": { + "australiaeast": 0.898, + "eastus": 0.749, + "eastus2": 0.749, + "northeurope": 0.826, + "southcentralus": 0.899, + "southeastasia": 0.898, + "usgovarizona": 0.902, + "usgovvirginia": 0.902, + "westeurope": 0.893, + "westus": 0.826, + "westus2": 0.749 + }, + "lowpriorityl64sv2": { + "australiaeast": 1.197, + "eastus": 0.998, + "eastus2": 0.998, + "northeurope": 1.101, + "southcentralus": 1.198, + "southeastasia": 1.197, + "usgovarizona": 1.203, + "usgovvirginia": 1.203, + "westeurope": 1.19, + "westus": 1.101, + "westus2": 0.998 + }, + "lowpriorityl80sv2": { + "australiaeast": 1.496, + "eastus": 1.248, + "eastus2": 1.248, + "northeurope": 1.376, + "southcentralus": 1.498, + "southeastasia": 1.496, + "usgovarizona": 1.504, + "usgovvirginia": 1.504, + "westeurope": 1.488, + "westus": 1.376, + "westus2": 1.248 + }, + "lowprioritym8ms": { + "australiacentral": 0.446, + "australiacentral2": 0.446, + "australiaeast": 0.4456, + "australiasoutheast": 0.4456, + "brazilsouth": 0.599, + "canadacentral": 0.338, + "canadaeast": 0.338, + "centralindia": 0.317, + "centralus": 0.347, + "eastasia": 0.557, + "eastus": 0.3073, + "eastus2": 0.3073, + "francecentral": 0.387, + "germanynorth": 0.559, + "germanywestcentral": 0.43, + "japaneast": 0.4456, + "japanwest": 0.4456, + "koreacentral": 0.446, + "koreasouth": 0.446, + "northeurope": 0.3688, + "norwayeast": 0.439, + "southafricanorth": 0.412, + "southafricawest": 0.516, + "southcentralus": 0.369, + "southeastasia": 0.4456, + "southindia": 0.4656, + "switzerlandnorth": 0.516, + "switzerlandwest": 0.671, + "uaecentral": 0.479, + "uaenorth": 0.406, + "uksouth": 0.3872, + "ukwest": 0.3872, + "usgovarizona": 0.3688, + "usgovvirginia": 0.3688, + "westeurope": 0.4302, + "westus": 0.399, + "westus2": 0.3073 + }, + "lowprioritym16ms": { + "australiacentral": 0.891, + "australiacentral2": 0.891, + "australiaeast": 0.8912, + "australiasoutheast": 0.8912, + "brazilsouth": 1.198, + "canadacentral": 0.676, + "canadaeast": 0.676, + "centralindia": 0.634, + "centralus": 0.694, + "eastasia": 1.114, + "eastus": 0.6146, + "eastus2": 0.6146, + "francecentral": 0.774, + "germanynorth": 1.119, + "germanywestcentral": 0.86, + "japaneast": 0.8912, + "japanwest": 0.8912, + "koreacentral": 0.891, + "koreasouth": 0.891, + "northeurope": 0.7375, + "norwayeast": 0.879, + "southafricanorth": 0.824, + "southafricawest": 1.033, + "southcentralus": 0.738, + "southeastasia": 0.8912, + "southindia": 0.9311, + "switzerlandnorth": 1.033, + "switzerlandwest": 1.342, + "uaecentral": 0.959, + "uaenorth": 0.811, + "uksouth": 0.7744, + "ukwest": 0.7744, + "usgovarizona": 0.7375, + "usgovvirginia": 0.7375, + "westeurope": 0.8604, + "westus": 0.799, + "westus2": 0.6146 + }, + "lowprioritym32ls": { + "australiacentral": 0.69, + "australiacentral2": 0.69, + "australiaeast": 0.68952, + "australiasoutheast": 0.68952, + "brazilsouth": 1.21, + "canadacentral": 0.632, + "canadaeast": 0.632, + "centralindia": 0.655, + "centralus": 0.649, + "eastasia": 0.862, + "eastus": 0.5746, + "eastus2": 0.5746, + "francecentral": 0.674, + "germanynorth": 0.896, + "germanywestcentral": 0.689, + "japaneast": 0.68952, + "japanwest": 0.68952, + "koreacentral": 0.69, + "koreasouth": 0.69, + "northeurope": 0.637806, + "norwayeast": 0.822, + "southafricanorth": 0.77, + "southafricawest": 0.965, + "southcentralus": 0.69, + "southeastasia": 0.68952, + "southindia": 0.723996, + "switzerlandnorth": 0.827, + "switzerlandwest": 1.076, + "uaecentral": 0.896, + "uaenorth": 0.707, + "uksouth": 0.672, + "ukwest": 0.672, + "usgovarizona": 0.68952, + "usgovvirginia": 0.68952, + "westeurope": 0.68952, + "westus": 0.64, + "westus2": 0.5746 + }, + "lowprioritym32ms": { + "australiacentral": 1.782, + "australiacentral2": 1.782, + "australiaeast": 1.7823, + "australiasoutheast": 1.7823, + "brazilsouth": 2.397, + "canadacentral": 1.352, + "canadaeast": 1.352, + "centralindia": 1.268, + "centralus": 1.389, + "eastasia": 2.228, + "eastus": 1.2292, + "eastus2": 1.2292, + "francecentral": 1.549, + "germanynorth": 2.237, + "germanywestcentral": 1.721, + "japaneast": 1.7823, + "japanwest": 1.7823, + "koreacentral": 1.782, + "koreasouth": 1.782, + "northeurope": 1.475, + "norwayeast": 1.758, + "southafricanorth": 1.647, + "southafricawest": 2.065, + "southcentralus": 1.475, + "southeastasia": 1.7823, + "southindia": 1.8622, + "switzerlandnorth": 2.065, + "switzerlandwest": 2.685, + "uaecentral": 1.918, + "uaenorth": 1.623, + "uksouth": 1.537, + "ukwest": 1.537, + "usgovarizona": 1.475, + "usgovvirginia": 1.475, + "westeurope": 1.7209, + "westus": 1.598, + "westus2": 1.2292 + }, + "lowprioritym32ts": { + "australiacentral": 0.65, + "australiacentral2": 0.65, + "australiaeast": 0.64968, + "australiasoutheast": 0.64968, + "brazilsouth": 1.14, + "canadacentral": 0.596, + "canadaeast": 0.596, + "centralindia": 0.617, + "centralus": 0.612, + "eastasia": 0.812, + "eastus": 0.541, + "eastus2": 0.541, + "francecentral": 0.635, + "germanynorth": 0.844, + "germanywestcentral": 0.65, + "japaneast": 0.64968, + "japanwest": 0.64968, + "koreacentral": 0.65, + "koreasouth": 0.65, + "northeurope": 0.600954, + "norwayeast": 0.774, + "southafricanorth": 0.725, + "southafricawest": 0.91, + "southcentralus": 0.65, + "southeastasia": 0.64968, + "southindia": 0.682, + "switzerlandnorth": 0.78, + "switzerlandwest": 1.013, + "uaecentral": 0.845, + "uaenorth": 0.6662, + "uksouth": 0.633, + "ukwest": 0.633, + "usgovarizona": 0.64968, + "usgovvirginia": 0.64968, + "westeurope": 0.64968, + "westus": 0.603, + "westus2": 0.541 + }, + "lowprioritym64": { + "australiacentral": 1.934, + "australiacentral2": 1.934, + "australiaeast": 1.934, + "australiasoutheast": 1.934, + "brazilsouth": 2.601, + "canadacentral": 1.467, + "canadaeast": 1.467, + "centralindia": 1.376, + "centralus": 1.507, + "eastasia": 2.418, + "eastus": 1.334, + "eastus2": 1.334, + "francecentral": 1.681, + "germanynorth": 2.428, + "germanywestcentral": 1.867, + "japaneast": 1.934, + "japanwest": 1.934, + "koreacentral": 1.934, + "koreasouth": 1.934, + "northeurope": 1.601, + "norwayeast": 1.907, + "southafricanorth": 1.787, + "southafricawest": 2.241, + "southcentralus": 1.601, + "southeastasia": 1.934, + "southindia": 2.021, + "switzerlandnorth": 2.241, + "switzerlandwest": 2.913, + "uaecentral": 2.081, + "uaenorth": 1.761, + "uksouth": 1.681, + "ukwest": 1.681, + "usgovarizona": 1.601, + "usgovvirginia": 1.601, + "westeurope": 1.867, + "westus": 1.734, + "westus2": 1.334 + }, + "lowprioritym64ls": { + "australiacentral": 1.3, + "australiacentral2": 1.3, + "australiaeast": 1.2996, + "australiasoutheast": 1.2996, + "brazilsouth": 2.28, + "canadacentral": 1.191, + "canadaeast": 1.191, + "centralindia": 1.23462, + "centralus": 1.299, + "eastasia": 1.625, + "eastus": 1.083, + "eastus2": 1.083, + "francecentral": 1.27, + "germanynorth": 1.689, + "germanywestcentral": 1.3, + "japaneast": 1.2996, + "japanwest": 1.2996, + "koreacentral": 1.3, + "koreasouth": 1.3, + "northeurope": 1.202, + "norwayeast": 1.643, + "southafricanorth": 1.451, + "southafricawest": 1.819, + "southcentralus": 1.3, + "southeastasia": 1.2996, + "southindia": 1.36458, + "switzerlandnorth": 1.56, + "switzerlandwest": 2.027, + "uaecentral": 1.793, + "uaenorth": 1.3328, + "uksouth": 1.267, + "ukwest": 1.267, + "usgovarizona": 1.2996, + "usgovvirginia": 1.2996, + "westeurope": 1.2996, + "westus": 1.281, + "westus2": 1.083 + }, + "lowprioritym64m": { + "australiacentral": 2.998, + "australiacentral2": 2.998, + "australiaeast": 2.998, + "australiasoutheast": 2.998, + "brazilsouth": 4.032, + "canadacentral": 2.274, + "canadaeast": 2.274, + "centralindia": 2.133, + "centralus": 3.016, + "eastasia": 3.748, + "eastus": 2.067, + "eastus2": 2.067, + "francecentral": 2.605, + "germanynorth": 3.763, + "germanywestcentral": 2.892, + "japaneast": 2.998, + "japanwest": 2.998, + "koreacentral": 2.998, + "koreasouth": 2.998, + "northeurope": 2.481, + "norwayeast": 3.816, + "southafricanorth": 2.77, + "southafricawest": 3.473, + "southcentralus": 2.481, + "southeastasia": 2.998, + "southindia": 3.133, + "switzerlandnorth": 3.473, + "switzerlandwest": 4.515, + "uaecentral": 4.163, + "uaenorth": 2.729, + "uksouth": 2.605, + "ukwest": 2.605, + "usgovarizona": 2.481, + "usgovvirginia": 2.481, + "westeurope": 2.894, + "westus": 3.469, + "westus2": 2.067 + }, + "lowprioritym64ms": { + "australiacentral": 2.998, + "australiacentral2": 2.998, + "australiaeast": 2.998, + "australiasoutheast": 2.998, + "brazilsouth": 4.032, + "canadacentral": 2.274, + "canadaeast": 2.274, + "centralindia": 2.133, + "centralus": 3.016, + "eastasia": 3.748, + "eastus": 2.067, + "eastus2": 2.067, + "francecentral": 2.605, + "germanynorth": 3.763, + "germanywestcentral": 2.892, + "japaneast": 2.998, + "japanwest": 2.998, + "koreacentral": 2.998, + "koreasouth": 2.998, + "northeurope": 2.481, + "norwayeast": 3.816, + "southafricanorth": 2.77, + "southafricawest": 3.473, + "southcentralus": 2.481, + "southeastasia": 2.998, + "southindia": 3.133, + "switzerlandnorth": 3.473, + "switzerlandwest": 4.515, + "uaecentral": 4.163, + "uaenorth": 2.729, + "uksouth": 2.605, + "ukwest": 2.605, + "usgovarizona": 2.481, + "usgovvirginia": 2.481, + "westeurope": 2.894, + "westus": 3.469, + "westus2": 2.067 + }, + "lowprioritym64s": { + "australiacentral": 1.934, + "australiacentral2": 1.934, + "australiaeast": 1.934, + "australiasoutheast": 1.934, + "brazilsouth": 2.601, + "canadacentral": 1.467, + "canadaeast": 1.467, + "centralindia": 1.376, + "centralus": 1.507, + "eastasia": 2.418, + "eastus": 1.334, + "eastus2": 1.334, + "francecentral": 1.681, + "germanynorth": 2.428, + "germanywestcentral": 1.867, + "japaneast": 1.934, + "japanwest": 1.934, + "koreacentral": 1.934, + "koreasouth": 1.934, + "northeurope": 1.601, + "norwayeast": 1.907, + "southafricanorth": 1.787, + "southafricawest": 2.241, + "southcentralus": 1.601, + "southeastasia": 1.934, + "southindia": 2.021, + "switzerlandnorth": 2.241, + "switzerlandwest": 2.913, + "uaecentral": 2.081, + "uaenorth": 1.761, + "uksouth": 1.681, + "ukwest": 1.681, + "usgovarizona": 1.601, + "usgovvirginia": 1.601, + "westeurope": 1.867, + "westus": 1.734, + "westus2": 1.334 + }, + "lowprioritym128": { + "australiacentral": 3.868, + "australiacentral2": 3.868, + "australiaeast": 3.868, + "australiasoutheast": 3.868, + "brazilsouth": 5.202, + "canadacentral": 2.934, + "canadaeast": 2.934, + "centralindia": 2.752, + "centralus": 3.014, + "eastasia": 4.836, + "eastus": 2.668, + "eastus2": 2.668, + "francecentral": 3.361, + "germanynorth": 4.855, + "germanywestcentral": 3.735, + "japaneast": 3.868, + "japanwest": 3.868, + "koreacentral": 3.868, + "koreasouth": 3.868, + "northeurope": 3.201, + "norwayeast": 3.815, + "southafricanorth": 3.575, + "southafricawest": 4.482, + "southcentralus": 3.201, + "southeastasia": 3.868, + "southindia": 4.041, + "switzerlandnorth": 4.482, + "switzerlandwest": 5.826, + "uaecentral": 4.161, + "uaenorth": 3.521, + "uksouth": 3.361, + "ukwest": 3.361, + "usgovarizona": 3.201, + "usgovvirginia": 3.201, + "westeurope": 3.735, + "westus": 3.468, + "westus2": 2.668 + }, + "lowprioritym128m": { + "australiacentral": 7.74, + "australiacentral2": 7.74, + "australiaeast": 7.7395, + "australiasoutheast": 7.74, + "brazilsouth": 10.408, + "canadacentral": 5.871, + "canadaeast": 5.871, + "centralindia": 5.507, + "centralus": 6.031, + "eastasia": 9.675, + "eastus": 5.338, + "eastus2": 5.3376, + "francecentral": 6.725, + "germanynorth": 9.709, + "germanywestcentral": 7.469, + "japaneast": 7.74, + "japanwest": 7.74, + "koreacentral": 7.74, + "koreasouth": 7.74, + "northeurope": 6.4051, + "norwayeast": 7.633, + "southafricanorth": 7.152, + "southafricawest": 8.967, + "southcentralus": 6.405, + "southeastasia": 7.74, + "southindia": 8.088, + "switzerlandnorth": 8.967, + "switzerlandwest": 11.657, + "uaecentral": 8.327, + "uaenorth": 7.046, + "uksouth": 6.72538, + "ukwest": 6.72538, + "usgovarizona": 6.405, + "usgovvirginia": 6.405, + "westeurope": 7.4726, + "westus": 6.939, + "westus2": 5.3376 + }, + "lowprioritym128ms": { + "australiacentral": 7.74, + "australiacentral2": 7.74, + "australiaeast": 7.7395, + "australiasoutheast": 7.74, + "brazilsouth": 10.408, + "canadacentral": 5.871, + "canadaeast": 5.871, + "centralindia": 5.507, + "centralus": 6.031, + "eastasia": 9.675, + "eastus": 5.338, + "eastus2": 5.3376, + "francecentral": 6.725, + "germanynorth": 9.709, + "germanywestcentral": 7.469, + "japaneast": 7.74, + "japanwest": 7.74, + "koreacentral": 7.74, + "koreasouth": 7.74, + "northeurope": 6.4051, + "norwayeast": 7.633, + "southafricanorth": 7.152, + "southafricawest": 8.967, + "southcentralus": 6.405, + "southeastasia": 7.74, + "southindia": 8.088, + "switzerlandnorth": 8.967, + "switzerlandwest": 11.657, + "uaecentral": 8.327, + "uaenorth": 7.046, + "uksouth": 6.72538, + "ukwest": 6.72538, + "usgovarizona": 6.405, + "usgovvirginia": 6.405, + "westeurope": 7.4726, + "westus": 6.939, + "westus2": 5.3376 + }, + "lowprioritym128s": { + "australiacentral": 3.868, + "australiacentral2": 3.868, + "australiaeast": 3.868, + "australiasoutheast": 3.868, + "brazilsouth": 5.202, + "canadacentral": 2.934, + "canadaeast": 2.934, + "centralindia": 2.752, + "centralus": 3.014, + "eastasia": 4.836, + "eastus": 2.668, + "eastus2": 2.668, + "francecentral": 3.361, + "germanynorth": 4.855, + "germanywestcentral": 3.735, + "japaneast": 3.868, + "japanwest": 3.868, + "koreacentral": 3.868, + "koreasouth": 3.868, + "northeurope": 3.201, + "norwayeast": 3.815, + "southafricanorth": 3.575, + "southafricawest": 4.482, + "southcentralus": 3.201, + "southeastasia": 3.868, + "southindia": 4.041, + "switzerlandnorth": 4.482, + "switzerlandwest": 5.826, + "uaecentral": 4.161, + "uaenorth": 3.521, + "uksouth": 3.361, + "ukwest": 3.361, + "usgovarizona": 3.201, + "usgovvirginia": 3.201, + "westeurope": 3.735, + "westus": 3.468, + "westus2": 2.668 + }, + "lowprioritync4ast4v3": { + "westus2": 0.105 + }, + "lowprioritync6": { + "australiaeast": 0.31, + "eastus": 0.18, + "eastus2": 0.18, + "japaneast": 0.31, + "northcentralus": 0.18, + "northeurope": 0.194, + "southcentralus": 0.216, + "southeastasia": 0.264, + "uksouth": 0.257, + "usgovarizona": 0.216, + "usgovvirginia": 0.216, + "westeurope": 0.233, + "westus": 0.216, + "westus2": 0.18 + }, + "lowprioritync6sv2": { + "eastus": 0.414, + "southcentralus": 0.4968, + "southeastasia": 0.6076, + "westeurope": 0.5364, + "westus2": 0.36 + }, + "lowprioritync6sv3": { + "australiaeast": 0.847, + "canadacentral": 0.673, + "centralindia": 0.847, + "eastus": 0.612, + "eastus2": 0.612, + "francecentral": 0.716, + "japaneast": 0.839, + "koreacentral": 0.847, + "southcentralus": 0.6732, + "southeastasia": 0.847, + "uksouth": 0.718, + "usgovarizona": 0.734, + "usgovvirginia": 0.734, + "westeurope": 0.765, + "westus2": 0.612 + }, + "lowprioritync8ast4v3": { + "westus2": 0.15 + }, + "lowprioritync12": { + "australiaeast": 0.62, + "eastus": 0.36, + "eastus2": 0.36, + "japaneast": 0.62, + "northcentralus": 0.36, + "northeurope": 0.389, + "southcentralus": 0.432, + "southeastasia": 0.528, + "uksouth": 0.513, + "usgovarizona": 0.432, + "usgovvirginia": 0.432, + "westeurope": 0.467, + "westus": 0.432, + "westus2": 0.36 + }, + "lowprioritync12sv2": { + "eastus": 0.828, + "southcentralus": 0.9936, + "southeastasia": 1.2154, + "westeurope": 1.0732, + "westus2": 0.72 + }, + "lowprioritync12sv3": { + "australiaeast": 1.694, + "canadacentral": 1.346, + "centralindia": 1.694, + "eastus": 1.224, + "eastus2": 1.224, + "francecentral": 1.432, + "japaneast": 1.678, + "koreacentral": 1.694, + "southcentralus": 1.3464, + "southeastasia": 1.694, + "uksouth": 1.436, + "usgovarizona": 1.469, + "usgovvirginia": 1.469, + "westeurope": 1.529, + "westus2": 1.224 + }, + "lowprioritync16ast4v3": { + "westus2": 0.241 + }, + "lowprioritync24": { + "australiaeast": 1.24, + "eastus": 0.72, + "eastus2": 0.72, + "japaneast": 1.24, + "northcentralus": 0.72, + "northeurope": 0.778, + "southcentralus": 0.864, + "southeastasia": 1.057, + "uksouth": 1.026, + "usgovarizona": 0.864, + "usgovvirginia": 0.864, + "westeurope": 0.933, + "westus": 0.864, + "westus2": 0.72 + }, + "lowprioritync24r": { + "australiaeast": 1.368, + "eastus": 0.792, + "eastus2": 0.792, + "japaneast": 1.4, + "northcentralus": 0.792, + "northeurope": 0.855, + "southcentralus": 0.95, + "southeastasia": 1.163, + "uksouth": 1.129, + "usgovarizona": 0.95, + "usgovvirginia": 0.95, + "westeurope": 1.026, + "westus": 0.95, + "westus2": 0.792 + }, + "lowprioritync24rsv2": { + "eastus": 1.8216, + "southcentralus": 2.186, + "southeastasia": 2.674, + "westeurope": 2.3608, + "westus2": 1.584 + }, + "lowprioritync24rsv3": { + "australiaeast": 3.726, + "canadacentral": 2.962, + "centralindia": 3.726, + "eastus": 2.6928, + "eastus2": 2.6928, + "francecentral": 3.151, + "japaneast": 3.691, + "koreacentral": 3.726, + "southcentralus": 2.96208, + "southeastasia": 3.726, + "uksouth": 3.158, + "usgovarizona": 3.231, + "usgovvirginia": 3.231, + "westeurope": 3.364, + "westus2": 2.693 + }, + "lowprioritync24sv2": { + "eastus": 1.656, + "southcentralus": 1.987, + "southeastasia": 2.4306, + "westeurope": 2.1464, + "westus2": 1.44 + }, + "lowprioritync24sv3": { + "australiaeast": 3.387, + "canadacentral": 2.693, + "centralindia": 3.387, + "eastus": 2.448, + "eastus2": 2.448, + "francecentral": 2.864, + "japaneast": 3.355, + "koreacentral": 3.387, + "southcentralus": 2.6928, + "southeastasia": 3.387, + "uksouth": 2.871, + "usgovarizona": 2.938, + "usgovvirginia": 2.938, + "westeurope": 3.058, + "westus2": 2.448 + }, + "lowprioritync64ast4v3": { + "westus2": 0.87 + }, + "lowprioritynd6s": { + "eastus": 0.414, + "eastus2": 0.414, + "southcentralus": 0.4968, + "southeastasia": 0.6076, + "westeurope": 0.5364, + "westus2": 0.36 + }, + "lowprioritynd12s": { + "eastus": 0.828, + "eastus2": 0.828, + "southcentralus": 0.9936, + "southeastasia": 1.2154, + "westeurope": 1.0732, + "westus2": 0.72 + }, + "lowprioritynd24rs": { + "eastus": 1.8216, + "eastus2": 1.822, + "southcentralus": 2.186, + "southeastasia": 2.674, + "westeurope": 2.3608, + "westus2": 1.584 + }, + "lowprioritynd24s": { + "eastus": 1.656, + "eastus2": 1.656, + "southcentralus": 1.9872, + "southeastasia": 2.4306, + "westeurope": 2.145, + "westus2": 1.44 + }, + "lowprioritynd40rsv2": { + "eastus": 4.406, + "southcentralus": 5.288, + "usgovarizona": 5.508, + "usgovvirginia": 5.508, + "westeurope": 5.505, + "westus2": 4.406 + }, + "lowprioritynv6": { + "australiaeast": 0.318, + "centralindia": 0.3436, + "eastus": 0.228, + "eastus2": 0.2404, + "japaneast": 0.316, + "northcentralus": 0.228, + "northeurope": 0.242, + "southcentralus": 0.23, + "southeastasia": 0.318, + "uksouth": 0.3, + "usgovarizona": 0.273, + "usgovtexas": 0.273, + "usgovvirginia": 0.273, + "westeurope": 0.273, + "westus": 0.248, + "westus2": 0.218 + }, + "lowprioritynv12": { + "australiaeast": 0.636, + "centralindia": 0.687, + "eastus": 0.456, + "eastus2": 0.4808, + "japaneast": 0.632, + "northcentralus": 0.456, + "northeurope": 0.484, + "southcentralus": 0.46, + "southeastasia": 0.636, + "uksouth": 0.601, + "usgovarizona": 0.546, + "usgovtexas": 0.546, + "usgovvirginia": 0.546, + "westeurope": 0.546, + "westus": 0.496, + "westus2": 0.437 + }, + "lowprioritynv12sv3": { + "australiaeast": 0.318, + "brazilsouth": 0.388, + "eastus": 0.228, + "eastus2": 0.228, + "francecentral": 0.285, + "japaneast": 0.316, + "northeurope": 0.242, + "norwaywest": 0.424, + "southafricanorth": 0.292, + "southcentralus": 0.274, + "southeastasia": 0.318, + "uaenorth": 0.278, + "uksouth": 0.285, + "usgovarizona": 0.285, + "usgovvirginia": 0.285, + "westeurope": 0.286, + "westus": 0.228, + "westus2": 0.228 + }, + "lowprioritynv24": { + "australiaeast": 1.272, + "centralindia": 1.374, + "eastus": 0.912, + "eastus2": 0.9614, + "japaneast": 1.264, + "northcentralus": 0.912, + "northeurope": 0.968, + "southcentralus": 0.92, + "southeastasia": 1.272, + "uksouth": 1.201, + "usgovarizona": 1.092, + "usgovtexas": 1.092, + "usgovvirginia": 1.092, + "westeurope": 1.092, + "westus": 0.992, + "westus2": 0.874 + }, + "lowprioritynv24sv3": { + "australiaeast": 0.636, + "brazilsouth": 0.775, + "eastus": 0.456, + "eastus2": 0.456, + "francecentral": 0.57, + "japaneast": 0.632, + "northeurope": 0.484, + "norwaywest": 0.848, + "southafricanorth": 0.584, + "southcentralus": 0.548, + "southeastasia": 0.636, + "uaenorth": 0.556, + "uksouth": 0.57, + "usgovarizona": 0.57, + "usgovvirginia": 0.57, + "westeurope": 0.57, + "westus": 0.456, + "westus2": 0.456 + }, + "lowprioritynv48sv3": { + "australiaeast": 1.272, + "brazilsouth": 1.55, + "eastus": 0.912, + "eastus2": 0.912, + "francecentral": 1.14, + "japaneast": 1.264, + "northeurope": 0.968, + "norwaywest": 1.696, + "southafricanorth": 1.168, + "southcentralus": 1.094, + "southeastasia": 1.272, + "uaenorth": 1.113, + "uksouth": 1.14, + "usgovarizona": 1.14, + "usgovvirginia": 1.14, + "westeurope": 1.14, + "westus": 0.912, + "westus2": 0.912 + }, + "standarda0": { + "australiacentral": 0.029, + "australiacentral2": 0.029, + "australiaeast": 0.029, + "australiasoutheast": 0.029, + "brazilsouth": 0.024, + "canadacentral": 0.022, + "canadaeast": 0.022, + "centralindia": 0.02, + "centralus": 0.02, + "eastasia": 0.02, + "eastus": 0.02, + "eastus2": 0.02, + "francecentral": 0.022, + "francesouth": 0.0286, + "germanycentral": 0.024, + "germanynortheast": 0.024, + "japaneast": 0.024, + "japanwest": 0.021, + "koreacentral": 0.02, + "koreasouth": 0.018, + "northcentralus": 0.02, + "northeurope": 0.02, + "southcentralus": 0.02, + "southeastasia": 0.02, + "southindia": 0.018, + "uksouth": 0.022, + "ukwest": 0.022, + "usgovarizona": 0.018, + "usgovtexas": 0.018, + "usgovvirginia": 0.018, + "westcentralus": 0.02, + "westeurope": 0.02, + "westindia": 0.02, + "westus": 0.02, + "westus2": 0.02 + }, + "standarda1": { + "australiacentral": 0.071, + "australiacentral2": 0.071, + "australiaeast": 0.071, + "australiasoutheast": 0.071, + "brazilsouth": 0.08, + "canadacentral": 0.056, + "canadaeast": 0.056, + "centralindia": 0.066, + "centralus": 0.06, + "eastasia": 0.06, + "eastus": 0.06, + "eastus2": 0.06, + "francecentral": 0.066, + "francesouth": 0.0858, + "germanycentral": 0.062, + "germanynortheast": 0.062, + "japaneast": 0.081, + "japanwest": 0.073, + "koreacentral": 0.066, + "koreasouth": 0.06, + "northcentralus": 0.06, + "northeurope": 0.06, + "southcentralus": 0.06, + "southeastasia": 0.06, + "southindia": 0.059, + "uksouth": 0.066, + "ukwest": 0.066, + "usgovarizona": 0.055, + "usgovtexas": 0.055, + "usgovvirginia": 0.055, + "westcentralus": 0.051, + "westeurope": 0.06, + "westindia": 0.066, + "westus": 0.06, + "westus2": 0.051 + }, + "standarda1v2": { + "australiacentral": 0.05, + "australiacentral2": 0.05, + "australiaeast": 0.05, + "australiasoutheast": 0.05, + "brazilsouth": 0.061, + "brazilsoutheast": 0.0793, + "canadacentral": 0.043, + "canadaeast": 0.043, + "centralindia": 0.047, + "centralus": 0.043, + "eastasia": 0.05, + "eastus": 0.043, + "eastus2": 0.043, + "francecentral": 0.05, + "francesouth": 0.065, + "germanycentral": 0.047, + "germanynorth": 0.0533, + "germanynortheast": 0.047, + "germanywestcentral": 0.041, + "japaneast": 0.054, + "japanwest": 0.054, + "koreacentral": 0.049, + "koreasouth": 0.044, + "northcentralus": 0.043, + "northeurope": 0.041, + "norwayeast": 0.0451, + "norwaywest": 0.0586, + "southafricanorth": 0.0482, + "southafricawest": 0.0605, + "southcentralus": 0.043, + "southeastasia": 0.045, + "southindia": 0.047, + "switzerlandnorth": 0.0492, + "switzerlandwest": 0.064, + "uaecentral": 0.0533, + "uaenorth": 0.0432, + "uksouth": 0.05, + "ukwest": 0.05, + "usgovarizona": 0.048, + "usgovtexas": 0.048, + "usgovvirginia": 0.048, + "westcentralus": 0.04, + "westeurope": 0.041, + "westindia": 0.047, + "westus": 0.043, + "westus2": 0.036 + }, + "standarda2": { + "australiacentral": 0.142, + "australiacentral2": 0.142, + "australiaeast": 0.142, + "australiasoutheast": 0.142, + "brazilsouth": 0.16, + "canadacentral": 0.111, + "canadaeast": 0.111, + "centralindia": 0.131, + "centralus": 0.12, + "eastasia": 0.12, + "eastus": 0.12, + "eastus2": 0.12, + "francecentral": 0.132, + "francesouth": 0.1716, + "germanycentral": 0.124, + "germanynortheast": 0.124, + "japaneast": 0.162, + "japanwest": 0.146, + "koreacentral": 0.133, + "koreasouth": 0.119, + "northcentralus": 0.12, + "northeurope": 0.12, + "southcentralus": 0.12, + "southeastasia": 0.12, + "southindia": 0.118, + "uksouth": 0.132, + "ukwest": 0.132, + "usgovarizona": 0.11, + "usgovtexas": 0.11, + "usgovvirginia": 0.11, + "westcentralus": 0.101, + "westeurope": 0.12, + "westindia": 0.131, + "westus": 0.12, + "westus2": 0.101 + }, + "standarda2mv2": { + "australiacentral": 0.149, + "australiacentral2": 0.149, + "australiaeast": 0.149, + "australiasoutheast": 0.178, + "brazilsouth": 0.208, + "brazilsoutheast": 0.27, + "canadacentral": 0.129, + "canadaeast": 0.129, + "centralindia": 0.158, + "centralus": 0.129, + "eastasia": 0.178, + "eastus": 0.119, + "eastus2": 0.119, + "francecentral": 0.178, + "francesouth": 0.2314, + "germanycentral": 0.16, + "germanynorth": 0.161, + "germanynortheast": 0.16, + "germanywestcentral": 0.124, + "japaneast": 0.153, + "japanwest": 0.178, + "koreacentral": 0.133, + "koreasouth": 0.119, + "northcentralus": 0.129, + "northeurope": 0.139, + "norwayeast": 0.136, + "norwaywest": 0.177, + "southafricanorth": 0.133, + "southafricawest": 0.166, + "southcentralus": 0.124, + "southeastasia": 0.134, + "southindia": 0.144, + "switzerlandnorth": 0.149, + "switzerlandwest": 0.193, + "uaecentral": 0.154, + "uaenorth": 0.119, + "uksouth": 0.178, + "ukwest": 0.158, + "usgovarizona": 0.176, + "usgovtexas": 0.176, + "usgovvirginia": 0.176, + "westcentralus": 0.119, + "westeurope": 0.124, + "westindia": 0.158, + "westus": 0.149, + "westus2": 0.099 + }, + "standarda2v2": { + "australiacentral": 0.106, + "australiacentral2": 0.106, + "australiaeast": 0.106, + "australiasoutheast": 0.106, + "brazilsouth": 0.129, + "brazilsoutheast": 0.168, + "canadacentral": 0.091, + "canadaeast": 0.091, + "centralindia": 0.098, + "centralus": 0.091, + "eastasia": 0.106, + "eastus": 0.091, + "eastus2": 0.091, + "francecentral": 0.106, + "francesouth": 0.1378, + "germanycentral": 0.1, + "germanynorth": 0.107, + "germanynortheast": 0.1, + "germanywestcentral": 0.087, + "japaneast": 0.113, + "japanwest": 0.113, + "koreacentral": 0.102, + "koreasouth": 0.092, + "northcentralus": 0.091, + "northeurope": 0.087, + "norwayeast": 0.0957, + "norwaywest": 0.124, + "southafricanorth": 0.102, + "southafricawest": 0.128, + "southcentralus": 0.091, + "southeastasia": 0.095, + "southindia": 0.098, + "switzerlandnorth": 0.0984, + "switzerlandwest": 0.128, + "uaecentral": 0.113, + "uaenorth": 0.0912, + "uksouth": 0.106, + "ukwest": 0.106, + "usgovarizona": 0.097, + "usgovtexas": 0.097, + "usgovvirginia": 0.097, + "westcentralus": 0.083, + "westeurope": 0.087, + "westindia": 0.098, + "westus": 0.091, + "westus2": 0.076 + }, + "standarda3": { + "australiacentral": 0.284, + "australiacentral2": 0.284, + "australiaeast": 0.284, + "australiasoutheast": 0.284, + "brazilsouth": 0.32, + "canadacentral": 0.222, + "canadaeast": 0.222, + "centralindia": 0.262, + "centralus": 0.24, + "eastasia": 0.24, + "eastus": 0.24, + "eastus2": 0.24, + "francecentral": 0.264, + "francesouth": 0.3432, + "germanycentral": 0.248, + "germanynortheast": 0.248, + "japaneast": 0.324, + "japanwest": 0.292, + "koreacentral": 0.264, + "koreasouth": 0.238, + "northcentralus": 0.24, + "northeurope": 0.24, + "southcentralus": 0.24, + "southeastasia": 0.24, + "southindia": 0.236, + "uksouth": 0.264, + "ukwest": 0.264, + "usgovarizona": 0.22, + "usgovtexas": 0.22, + "usgovvirginia": 0.22, + "westcentralus": 0.202, + "westeurope": 0.24, + "westindia": 0.262, + "westus": 0.24, + "westus2": 0.202 + }, + "standarda4": { + "australiacentral": 0.568, + "australiacentral2": 0.568, + "australiaeast": 0.568, + "australiasoutheast": 0.568, + "brazilsouth": 0.64, + "canadacentral": 0.446, + "canadaeast": 0.446, + "centralindia": 0.524, + "centralus": 0.48, + "eastasia": 0.48, + "eastus": 0.48, + "eastus2": 0.48, + "francecentral": 0.528, + "francesouth": 0.6864, + "germanycentral": 0.497, + "germanynortheast": 0.497, + "japaneast": 0.648, + "japanwest": 0.584, + "koreacentral": 0.528, + "koreasouth": 0.475, + "northcentralus": 0.48, + "northeurope": 0.48, + "southcentralus": 0.48, + "southeastasia": 0.48, + "southindia": 0.472, + "uksouth": 0.528, + "ukwest": 0.528, + "usgovarizona": 0.44, + "usgovtexas": 0.44, + "usgovvirginia": 0.44, + "westcentralus": 0.405, + "westeurope": 0.48, + "westindia": 0.524, + "westus": 0.48, + "westus2": 0.405 + }, + "standarda4mv2": { + "australiacentral": 0.312, + "australiacentral2": 0.312, + "australiaeast": 0.312, + "australiasoutheast": 0.374, + "brazilsouth": 0.437, + "brazilsoutheast": 0.568, + "canadacentral": 0.27, + "canadaeast": 0.27, + "centralindia": 0.333, + "centralus": 0.27, + "eastasia": 0.374, + "eastus": 0.238, + "eastus2": 0.249, + "francecentral": 0.374, + "francesouth": 0.4862, + "germanycentral": 0.335, + "germanynorth": 0.322, + "germanynortheast": 0.335, + "germanywestcentral": 0.26, + "japaneast": 0.322, + "japanwest": 0.374, + "koreacentral": 0.278, + "koreasouth": 0.251, + "northcentralus": 0.27, + "northeurope": 0.291, + "norwayeast": 0.286, + "norwaywest": 0.372, + "southafricanorth": 0.279, + "southafricawest": 0.349, + "southcentralus": 0.248, + "southeastasia": 0.281, + "southindia": 0.301, + "switzerlandnorth": 0.298, + "switzerlandwest": 0.387, + "uaecentral": 0.324, + "uaenorth": 0.25, + "uksouth": 0.374, + "ukwest": 0.333, + "usgovarizona": 0.353, + "usgovtexas": 0.353, + "usgovvirginia": 0.353, + "westcentralus": 0.249, + "westeurope": 0.26, + "westindia": 0.333, + "westus": 0.297, + "westus2": 0.208 + }, + "standarda4v2": { + "australiacentral": 0.222, + "australiacentral2": 0.222, + "australiaeast": 0.222, + "australiasoutheast": 0.222, + "brazilsouth": 0.27, + "brazilsoutheast": 0.351, + "canadacentral": 0.191, + "canadaeast": 0.191, + "centralindia": 0.206, + "centralus": 0.191, + "eastasia": 0.222, + "eastus": 0.191, + "eastus2": 0.191, + "francecentral": 0.222, + "francesouth": 0.2886, + "germanycentral": 0.21, + "germanynorth": 0.213, + "germanynortheast": 0.21, + "germanywestcentral": 0.183, + "japaneast": 0.238, + "japanwest": 0.238, + "koreacentral": 0.214, + "koreasouth": 0.193, + "northcentralus": 0.191, + "northeurope": 0.183, + "norwayeast": 0.201, + "norwaywest": 0.262, + "southafricanorth": 0.213, + "southafricawest": 0.267, + "southcentralus": 0.191, + "southeastasia": 0.198, + "southindia": 0.206, + "switzerlandnorth": 0.197, + "switzerlandwest": 0.256, + "uaecentral": 0.238, + "uaenorth": 0.191, + "uksouth": 0.222, + "ukwest": 0.222, + "usgovarizona": 0.194, + "usgovtexas": 0.194, + "usgovvirginia": 0.194, + "westcentralus": 0.175, + "westeurope": 0.183, + "westindia": 0.206, + "westus": 0.191, + "westus2": 0.159 + }, + "standarda5": { + "australiacentral": 0.278, + "australiacentral2": 0.278, + "australiaeast": 0.278, + "australiasoutheast": 0.278, + "brazilsouth": 0.291, + "canadacentral": 0.242, + "canadaeast": 0.242, + "centralindia": 0.26, + "centralus": 0.25, + "eastasia": 0.294, + "eastus": 0.25, + "eastus2": 0.22, + "francecentral": 0.297, + "francesouth": 0.3861, + "germanycentral": 0.285, + "germanynortheast": 0.285, + "japaneast": 0.281, + "japanwest": 0.258, + "koreacentral": 0.172, + "koreasouth": 0.155, + "northcentralus": 0.25, + "northeurope": 0.248, + "southcentralus": 0.22, + "southeastasia": 0.27, + "southindia": 0.234, + "uksouth": 0.297, + "ukwest": 0.297, + "usgovarizona": 0.2, + "usgovtexas": 0.2, + "usgovvirginia": 0.2, + "westcentralus": 0.22, + "westeurope": 0.27, + "westindia": 0.26, + "westus": 0.25, + "westus2": 0.22 + }, + "standarda6": { + "australiacentral": 0.556, + "australiacentral2": 0.556, + "australiaeast": 0.556, + "australiasoutheast": 0.556, + "brazilsouth": 0.582, + "canadacentral": 0.484, + "canadaeast": 0.484, + "centralindia": 0.52, + "centralus": 0.5, + "eastasia": 0.588, + "eastus": 0.5, + "eastus2": 0.44, + "francecentral": 0.594, + "francesouth": 0.7722, + "germanycentral": 0.57, + "germanynortheast": 0.57, + "japaneast": 0.562, + "japanwest": 0.516, + "koreacentral": 0.343, + "koreasouth": 0.309, + "northcentralus": 0.5, + "northeurope": 0.496, + "southcentralus": 0.44, + "southeastasia": 0.54, + "southindia": 0.468, + "uksouth": 0.594, + "ukwest": 0.594, + "usgovarizona": 0.401, + "usgovtexas": 0.401, + "usgovvirginia": 0.401, + "westcentralus": 0.44, + "westeurope": 0.54, + "westindia": 0.52, + "westus": 0.5, + "westus2": 0.44 + }, + "standarda7": { + "australiacentral": 1.112, + "australiacentral2": 1.112, + "australiaeast": 1.112, + "australiasoutheast": 1.112, + "brazilsouth": 1.164, + "canadacentral": 0.968, + "canadaeast": 0.968, + "centralindia": 1.04, + "centralus": 1.0, + "eastasia": 1.176, + "eastus": 1.0, + "eastus2": 0.88, + "francecentral": 1.188, + "francesouth": 1.5444, + "germanycentral": 1.141, + "germanynortheast": 1.141, + "japaneast": 1.124, + "japanwest": 1.032, + "koreacentral": 0.687, + "koreasouth": 0.618, + "northcentralus": 1.0, + "northeurope": 0.992, + "southcentralus": 0.88, + "southeastasia": 1.08, + "southindia": 0.936, + "uksouth": 1.188, + "ukwest": 1.188, + "usgovarizona": 0.8, + "usgovtexas": 0.8, + "usgovvirginia": 0.8, + "westcentralus": 0.88, + "westeurope": 1.08, + "westindia": 1.04, + "westus": 1.0, + "westus2": 0.88 + }, + "standarda8": { + "eastus": 0.975, + "japaneast": 1.208, + "northcentralus": 0.975, + "northeurope": 0.975, + "southcentralus": 0.875, + "westeurope": 1.121, + "westus": 0.975 + }, + "standarda8mv2": { + "australiacentral": 0.655, + "australiacentral2": 0.655, + "australiaeast": 0.655, + "australiasoutheast": 0.786, + "brazilsouth": 0.917, + "brazilsoutheast": 1.192, + "canadacentral": 0.568, + "canadaeast": 0.568, + "centralindia": 0.699, + "centralus": 0.568, + "eastasia": 0.786, + "eastus": 0.475, + "eastus2": 0.524, + "francecentral": 0.786, + "francesouth": 1.0218, + "germanycentral": 0.703, + "germanynorth": 0.645, + "germanynortheast": 0.703, + "germanywestcentral": 0.546, + "japaneast": 0.677, + "japanwest": 0.786, + "koreacentral": 0.585, + "koreasouth": 0.526, + "northcentralus": 0.568, + "northeurope": 0.611, + "norwayeast": 0.601, + "norwaywest": 0.781, + "southafricanorth": 0.586, + "southafricawest": 0.734, + "southcentralus": 0.495, + "southeastasia": 0.589, + "southindia": 0.633, + "switzerlandnorth": 0.595, + "switzerlandwest": 0.774, + "uaecentral": 0.682, + "uaenorth": 0.524, + "uksouth": 0.786, + "ukwest": 0.699, + "usgovarizona": 0.704, + "usgovtexas": 0.704, + "usgovvirginia": 0.704, + "westcentralus": 0.524, + "westeurope": 0.546, + "westindia": 0.699, + "westus": 0.594, + "westus2": 0.437 + }, + "standarda8v2": { + "australiacentral": 0.467, + "australiacentral2": 0.467, + "australiaeast": 0.467, + "australiasoutheast": 0.467, + "brazilsouth": 0.567, + "brazilsoutheast": 0.737, + "canadacentral": 0.4, + "canadaeast": 0.4, + "centralindia": 0.433, + "centralus": 0.4, + "eastasia": 0.467, + "eastus": 0.4, + "eastus2": 0.4, + "francecentral": 0.467, + "francesouth": 0.6071, + "germanycentral": 0.437, + "germanynorth": 0.426, + "germanynortheast": 0.437, + "germanywestcentral": 0.383, + "japaneast": 0.5, + "japanwest": 0.5, + "koreacentral": 0.45, + "koreasouth": 0.405, + "northcentralus": 0.4, + "northeurope": 0.383, + "norwayeast": 0.421, + "norwaywest": 0.548, + "southafricanorth": 0.446, + "southafricawest": 0.559, + "southcentralus": 0.4, + "southeastasia": 0.417, + "southindia": 0.433, + "switzerlandnorth": 0.394, + "switzerlandwest": 0.512, + "uaecentral": 0.498, + "uaenorth": 0.4, + "uksouth": 0.467, + "ukwest": 0.467, + "usgovarizona": 0.387, + "usgovtexas": 0.387, + "usgovvirginia": 0.387, + "westcentralus": 0.367, + "westeurope": 0.383, + "westindia": 0.433, + "westus": 0.4, + "westus2": 0.333 + }, + "standarda9": { + "eastus": 1.95, + "japaneast": 2.415, + "northcentralus": 1.95, + "northeurope": 1.95, + "southcentralus": 1.75, + "westeurope": 2.243, + "westus": 1.95 + }, + "standarda10": { + "eastus": 0.78, + "japaneast": 0.966, + "northcentralus": 0.78, + "northeurope": 0.78, + "southcentralus": 0.7, + "westeurope": 0.897, + "westus": 0.78 + }, + "standarda11": { + "eastus": 1.56, + "japaneast": 1.932, + "northcentralus": 1.56, + "northeurope": 1.56, + "southcentralus": 1.4, + "westeurope": 1.794, + "westus": 1.56 + }, + "standardb1ls": { + "australiacentral": 0.0066, + "australiacentral2": 0.0066, + "australiaeast": 0.0066, + "australiasoutheast": 0.0066, + "brazilsouth": 0.0084, + "brazilsoutheast": 0.0109, + "canadacentral": 0.0058, + "canadaeast": 0.00582, + "centralindia": 0.0056, + "centralus": 0.00624, + "eastasia": 0.0073, + "eastus": 0.0052, + "eastus2": 0.0052, + "francecentral": 0.0059, + "francesouth": 0.00845, + "germanycentral": 0.00375, + "germanynorth": 0.0078, + "germanynortheast": 0.00375, + "germanywestcentral": 0.006, + "japaneast": 0.0068, + "japanwest": 0.00749, + "koreacentral": 0.0065, + "koreasouth": 0.00702, + "northcentralus": 0.0052, + "northeurope": 0.0057, + "norwayeast": 0.0066, + "norwaywest": 0.00858, + "southafricanorth": 0.00697, + "southafricawest": 0.00874, + "southcentralus": 0.00624, + "southeastasia": 0.0066, + "southindia": 0.0078, + "switzerlandnorth": 0.0072, + "switzerlandwest": 0.00936, + "uaecentral": 0.0078, + "uaenorth": 0.00624, + "uksouth": 0.0059, + "ukwest": 0.00588, + "usgovarizona": 0.0061, + "usgovtexas": 0.0065, + "usgovvirginia": 0.0061, + "westcentralus": 0.00624, + "westeurope": 0.006, + "westindia": 0.0078, + "westus": 0.0062, + "westus2": 0.0052 + }, + "standardb1ms": { + "australiacentral": 0.0264, + "australiacentral2": 0.0264, + "australiaeast": 0.0264, + "australiasoutheast": 0.0264, + "brazilsouth": 0.0336, + "brazilsoutheast": 0.0437, + "canadacentral": 0.023, + "canadaeast": 0.0233, + "centralindia": 0.0224, + "centralus": 0.025, + "eastasia": 0.0292, + "eastus": 0.0207, + "eastus2": 0.0208, + "francecentral": 0.0236, + "francesouth": 0.0338, + "germanycentral": 0.015, + "germanynorth": 0.0312, + "germanynortheast": 0.015, + "germanywestcentral": 0.024, + "japaneast": 0.0272, + "japanwest": 0.03, + "koreacentral": 0.026, + "koreasouth": 0.026, + "northcentralus": 0.0208, + "northeurope": 0.0227, + "norwayeast": 0.0264, + "norwaywest": 0.0343, + "southafricanorth": 0.0279, + "southafricawest": 0.0349, + "southcentralus": 0.025, + "southeastasia": 0.0264, + "southindia": 0.0294, + "switzerlandnorth": 0.0288, + "switzerlandwest": 0.0374, + "uaecentral": 0.0312, + "uaenorth": 0.025, + "uksouth": 0.0236, + "ukwest": 0.0235, + "usgovarizona": 0.0244, + "usgovtexas": 0.026, + "usgovvirginia": 0.0244, + "westcentralus": 0.025, + "westeurope": 0.024, + "westindia": 0.03, + "westus": 0.0248, + "westus2": 0.0207 + }, + "standardb1s": { + "australiacentral": 0.0132, + "australiacentral2": 0.0132, + "australiaeast": 0.0132, + "australiasoutheast": 0.0132, + "brazilsouth": 0.0168, + "brazilsoutheast": 0.0218, + "canadacentral": 0.0116, + "canadaeast": 0.0116, + "centralindia": 0.0112, + "centralus": 0.0125, + "eastasia": 0.0146, + "eastus": 0.0104, + "eastus2": 0.0104, + "francecentral": 0.0118, + "francesouth": 0.0169, + "germanycentral": 0.0075, + "germanynorth": 0.0156, + "germanynortheast": 0.0075, + "germanywestcentral": 0.012, + "japaneast": 0.0136, + "japanwest": 0.015, + "koreacentral": 0.013, + "koreasouth": 0.013, + "northcentralus": 0.0104, + "northeurope": 0.0113, + "norwayeast": 0.0132, + "norwaywest": 0.0172, + "southafricanorth": 0.0139, + "southafricawest": 0.0175, + "southcentralus": 0.0125, + "southeastasia": 0.0132, + "southindia": 0.0145, + "switzerlandnorth": 0.0144, + "switzerlandwest": 0.0187, + "uaecentral": 0.0156, + "uaenorth": 0.0125, + "uksouth": 0.0118, + "ukwest": 0.0118, + "usgovarizona": 0.0122, + "usgovtexas": 0.015, + "usgovvirginia": 0.0122, + "westcentralus": 0.0125, + "westeurope": 0.012, + "westindia": 0.0147, + "westus": 0.0124, + "westus2": 0.0104 + }, + "standardb2ms": { + "australiacentral": 0.106, + "australiacentral2": 0.106, + "australiaeast": 0.106, + "australiasoutheast": 0.106, + "brazilsouth": 0.134, + "brazilsoutheast": 0.175, + "canadacentral": 0.0928, + "canadaeast": 0.0932, + "centralindia": 0.0896, + "centralus": 0.0998, + "eastasia": 0.117, + "eastus": 0.0832, + "eastus2": 0.0832, + "francecentral": 0.0944, + "francesouth": 0.135, + "germanycentral": 0.05875, + "germanynorth": 0.125, + "germanynortheast": 0.05875, + "germanywestcentral": 0.096, + "japaneast": 0.109, + "japanwest": 0.12, + "koreacentral": 0.104, + "koreasouth": 0.104, + "northcentralus": 0.0832, + "northeurope": 0.091, + "norwayeast": 0.106, + "norwaywest": 0.137, + "southafricanorth": 0.111, + "southafricawest": 0.14, + "southcentralus": 0.0998, + "southeastasia": 0.106, + "southindia": 0.118, + "switzerlandnorth": 0.115, + "switzerlandwest": 0.15, + "uaecentral": 0.125, + "uaenorth": 0.0998, + "uksouth": 0.0944, + "ukwest": 0.094, + "usgovarizona": 0.0976, + "usgovtexas": 0.1175, + "usgovvirginia": 0.0976, + "westcentralus": 0.0998, + "westeurope": 0.096, + "westindia": 0.119, + "westus": 0.0992, + "westus2": 0.0832 + }, + "standardb2s": { + "australiacentral": 0.0528, + "australiacentral2": 0.0528, + "australiaeast": 0.0528, + "australiasoutheast": 0.0528, + "brazilsouth": 0.0672, + "brazilsoutheast": 0.0874, + "canadacentral": 0.0464, + "canadaeast": 0.0466, + "centralindia": 0.0448, + "centralus": 0.0499, + "eastasia": 0.0584, + "eastus": 0.0416, + "eastus2": 0.0416, + "francecentral": 0.0472, + "francesouth": 0.0676, + "germanycentral": 0.03, + "germanynorth": 0.0624, + "germanynortheast": 0.03, + "germanywestcentral": 0.048, + "japaneast": 0.0544, + "japanwest": 0.0599, + "koreacentral": 0.052, + "koreasouth": 0.052, + "northcentralus": 0.0416, + "northeurope": 0.045, + "norwayeast": 0.0528, + "norwaywest": 0.0686, + "southafricanorth": 0.0557, + "southafricawest": 0.0699, + "southcentralus": 0.0499, + "southeastasia": 0.0528, + "southindia": 0.058, + "switzerlandnorth": 0.0576, + "switzerlandwest": 0.0749, + "uaecentral": 0.0624, + "uaenorth": 0.0499, + "uksouth": 0.0472, + "ukwest": 0.047, + "usgovarizona": 0.0488, + "usgovtexas": 0.06, + "usgovvirginia": 0.0488, + "westcentralus": 0.0499, + "westeurope": 0.048, + "westindia": 0.059, + "westus": 0.0496, + "westus2": 0.0416 + }, + "standardb4ms": { + "australiacentral": 0.211, + "australiacentral2": 0.211, + "australiaeast": 0.211, + "australiasoutheast": 0.211, + "brazilsouth": 0.269, + "brazilsoutheast": 0.349, + "canadacentral": 0.185, + "canadaeast": 0.186, + "centralindia": 0.179, + "centralus": 0.2, + "eastasia": 0.234, + "eastus": 0.166, + "eastus2": 0.166, + "francecentral": 0.189, + "francesouth": 0.27, + "germanycentral": 0.1175, + "germanynorth": 0.25, + "germanynortheast": 0.1175, + "germanywestcentral": 0.192, + "japaneast": 0.218, + "japanwest": 0.24, + "koreacentral": 0.208, + "koreasouth": 0.207, + "northcentralus": 0.166, + "northeurope": 0.182, + "norwayeast": 0.211, + "norwaywest": 0.275, + "southafricanorth": 0.223, + "southafricawest": 0.28, + "southcentralus": 0.2, + "southeastasia": 0.211, + "southindia": 0.236, + "switzerlandnorth": 0.23, + "switzerlandwest": 0.3, + "uaecentral": 0.25, + "uaenorth": 0.2, + "uksouth": 0.189, + "ukwest": 0.188, + "usgovarizona": 0.195, + "usgovtexas": 0.235, + "usgovvirginia": 0.195, + "westcentralus": 0.2, + "westeurope": 0.192, + "westindia": 0.238, + "westus": 0.198, + "westus2": 0.166 + }, + "standardb8ms": { + "australiacentral": 0.422, + "australiacentral2": 0.422, + "australiaeast": 0.422, + "australiasoutheast": 0.423, + "brazilsouth": 0.538, + "brazilsoutheast": 0.699, + "canadacentral": 0.371, + "canadaeast": 0.373, + "centralindia": 0.358, + "centralus": 0.399, + "eastasia": 0.467, + "eastus": 0.333, + "eastus2": 0.333, + "francecentral": 0.378, + "francesouth": 0.541, + "germanycentral": 0.235, + "germanynorth": 0.499, + "germanynortheast": 0.235, + "germanywestcentral": 0.384, + "japaneast": 0.435, + "japanwest": 0.479, + "koreacentral": 0.416, + "koreasouth": 0.415, + "northcentralus": 0.333, + "northeurope": 0.364, + "norwayeast": 0.422, + "norwaywest": 0.549, + "southafricanorth": 0.446, + "southafricawest": 0.559, + "southcentralus": 0.399, + "southeastasia": 0.422, + "southindia": 0.471, + "switzerlandnorth": 0.461, + "switzerlandwest": 0.599, + "uaecentral": 0.499, + "uaenorth": 0.399, + "uksouth": 0.378, + "ukwest": 0.376, + "usgovarizona": 0.39, + "usgovtexas": 0.47, + "usgovvirginia": 0.39, + "westcentralus": 0.399, + "westeurope": 0.384, + "westindia": 0.476, + "westus": 0.397, + "westus2": 0.333 + }, + "standardb12ms": { + "australiacentral": 0.634, + "australiacentral2": 0.634, + "australiaeast": 0.634, + "australiasoutheast": 0.634, + "brazilsouth": 0.806, + "brazilsoutheast": 1.048, + "canadacentral": 0.556, + "canadaeast": 0.559, + "centralindia": 0.538, + "centralus": 0.599, + "eastasia": 0.701, + "eastus": 0.499, + "eastus2": 0.499, + "francecentral": 0.566, + "francesouth": 0.811, + "germanycentral": 0.353, + "germanynorth": 0.749, + "germanynortheast": 0.353, + "germanywestcentral": 0.576, + "japaneast": 0.653, + "japanwest": 0.719, + "koreacentral": 0.624, + "koreasouth": 0.622, + "northcentralus": 0.499, + "northeurope": 0.546, + "norwayeast": 0.634, + "norwaywest": 0.824, + "southafricanorth": 0.669, + "southafricawest": 0.839, + "southcentralus": 0.599, + "southeastasia": 0.634, + "southindia": 0.706, + "switzerlandnorth": 0.692, + "switzerlandwest": 0.899, + "uaecentral": 0.749, + "uaenorth": 0.599, + "uksouth": 0.566, + "ukwest": 0.564, + "usgovarizona": 0.585, + "usgovtexas": 0.585, + "usgovvirginia": 0.585, + "westcentralus": 0.599, + "westeurope": 0.576, + "westindia": 0.714, + "westus": 0.595, + "westus2": 0.499 + }, + "standardb16ms": { + "australiacentral": 0.845, + "australiacentral2": 0.845, + "australiaeast": 0.845, + "australiasoutheast": 0.845, + "brazilsouth": 1.075, + "brazilsoutheast": 1.398, + "canadacentral": 0.742, + "canadaeast": 0.745, + "centralindia": 0.717, + "centralus": 0.799, + "eastasia": 0.934, + "eastus": 0.666, + "eastus2": 0.666, + "francecentral": 0.755, + "francesouth": 1.082, + "germanycentral": 0.47, + "germanynorth": 0.998, + "germanynortheast": 0.47, + "germanywestcentral": 0.768, + "japaneast": 0.87, + "japanwest": 0.958, + "koreacentral": 0.832, + "koreasouth": 0.83, + "northcentralus": 0.666, + "northeurope": 0.728, + "norwayeast": 0.845, + "norwaywest": 1.098, + "southafricanorth": 0.892, + "southafricawest": 1.118, + "southcentralus": 0.799, + "southeastasia": 0.845, + "southindia": 0.941, + "switzerlandnorth": 0.922, + "switzerlandwest": 1.198, + "uaecentral": 0.998, + "uaenorth": 0.799, + "uksouth": 0.755, + "ukwest": 0.752, + "usgovarizona": 0.78, + "usgovtexas": 0.78, + "usgovvirginia": 0.78, + "westcentralus": 0.799, + "westeurope": 0.768, + "westindia": 0.951, + "westus": 0.794, + "westus2": 0.666 + }, + "standardb20ms": { + "australiacentral": 1.056, + "australiacentral2": 1.056, + "australiaeast": 1.056, + "australiasoutheast": 1.057, + "brazilsouth": 1.344, + "brazilsoutheast": 1.747, + "canadacentral": 0.927, + "canadaeast": 0.932, + "centralindia": 0.896, + "centralus": 0.998, + "eastasia": 1.168, + "eastus": 0.832, + "eastus2": 0.832, + "francecentral": 0.944, + "francesouth": 1.352, + "germanycentral": 0.588, + "germanynorth": 1.248, + "germanynortheast": 0.588, + "germanywestcentral": 0.96, + "japaneast": 1.088, + "japanwest": 1.198, + "koreacentral": 1.04, + "koreasouth": 1.037, + "northcentralus": 0.832, + "northeurope": 0.909, + "norwayeast": 1.056, + "norwaywest": 1.373, + "southafricanorth": 1.115, + "southafricawest": 1.398, + "southcentralus": 0.998, + "southeastasia": 1.056, + "southindia": 1.177, + "switzerlandnorth": 1.153, + "switzerlandwest": 1.498, + "uaecentral": 1.248, + "uaenorth": 0.998, + "uksouth": 0.944, + "ukwest": 0.94, + "usgovarizona": 0.975, + "usgovtexas": 0.975, + "usgovvirginia": 0.975, + "westcentralus": 0.998, + "westeurope": 0.96, + "westindia": 1.189, + "westus": 0.992, + "westus2": 0.832 + }, + "standardd1": { + "australiaeast": 0.093, + "australiasoutheast": 0.093, + "brazilsouth": 0.095, + "brazilsoutheast": 0.124, + "centralus": 0.077, + "eastasia": 0.113, + "eastus": 0.077, + "eastus2": 0.067, + "japaneast": 0.11, + "japanwest": 0.096, + "northcentralus": 0.077, + "northeurope": 0.073, + "southafricanorth": 0.0898, + "southafricawest": 0.113, + "southcentralus": 0.067, + "southeastasia": 0.098, + "uaecentral": 0.105, + "uaenorth": 0.0804, + "usgovvirginia": 0.071, + "westeurope": 0.084, + "westus": 0.077 + }, + "standardd1s": { + "australiaeast": 0.093, + "australiasoutheast": 0.093, + "brazilsouth": 0.095, + "brazilsoutheast": 0.124, + "centralus": 0.077, + "eastasia": 0.113, + "eastus": 0.077, + "eastus2": 0.067, + "japaneast": 0.11, + "japanwest": 0.096, + "northcentralus": 0.077, + "northeurope": 0.073, + "southafricanorth": 0.0898, + "southafricawest": 0.113, + "southcentralus": 0.067, + "southeastasia": 0.098, + "uaecentral": 0.105, + "uaenorth": 0.0804, + "usgovvirginia": 0.071, + "westeurope": 0.084, + "westus": 0.077 + }, + "standardd1v2": { + "australiacentral": 0.084, + "australiacentral2": 0.084, + "australiaeast": 0.084, + "australiasoutheast": 0.0778, + "brazilsouth": 0.0856, + "brazilsoutheast": 0.111, + "canadacentral": 0.07, + "canadaeast": 0.07, + "centralindia": 0.084, + "centralus": 0.073, + "eastasia": 0.107, + "eastus": 0.073, + "eastus2": 0.057, + "francecentral": 0.0877, + "francesouth": 0.114, + "germanycentral": 0.076, + "germanynorth": 0.0871, + "germanynortheast": 0.076, + "germanywestcentral": 0.067, + "japaneast": 0.102, + "japanwest": 0.091, + "koreacentral": 0.0825, + "koreasouth": 0.074, + "northcentralus": 0.073, + "northeurope": 0.0658, + "norwayeast": 0.0747, + "norwaywest": 0.0971, + "southafricanorth": 0.0767, + "southafricawest": 0.0962, + "southcentralus": 0.0636, + "southeastasia": 0.0789, + "southindia": 0.084, + "switzerlandnorth": 0.0816, + "switzerlandwest": 0.106, + "uaecentral": 0.0893, + "uaenorth": 0.0687, + "uksouth": 0.0878, + "ukwest": 0.0877, + "usgovarizona": 0.071, + "usgovtexas": 0.071, + "usgovvirginia": 0.071, + "westcentralus": 0.0636, + "westeurope": 0.0679, + "westindia": 0.084, + "westus": 0.07, + "westus2": 0.057 + }, + "standardd2": { + "australiaeast": 0.186, + "australiasoutheast": 0.186, + "brazilsouth": 0.19, + "brazilsoutheast": 0.247, + "centralus": 0.154, + "eastasia": 0.225, + "eastus": 0.154, + "eastus2": 0.134, + "japaneast": 0.221, + "japanwest": 0.192, + "northcentralus": 0.154, + "northeurope": 0.146, + "southafricanorth": 0.18, + "southafricawest": 0.225, + "southcentralus": 0.134, + "southeastasia": 0.196, + "uaecentral": 0.209, + "uaenorth": 0.161, + "usgovvirginia": 0.143, + "westeurope": 0.168, + "westus": 0.154 + }, + "standardd2asv4": { + "australiaeast": 0.12, + "brazilsouth": 0.153, + "centralindia": 0.101, + "centralus": 0.108, + "eastasia": 0.132, + "eastus": 0.096, + "eastus2": 0.096, + "francecentral": 0.112, + "japaneast": 0.124, + "koreacentral": 0.118, + "northeurope": 0.107, + "southcentralus": 0.115, + "southeastasia": 0.12, + "uksouth": 0.111, + "westeurope": 0.115, + "westus": 0.112, + "westus2": 0.096 + }, + "standardd2av4": { + "australiaeast": 0.12, + "brazilsouth": 0.153, + "centralindia": 0.101, + "centralus": 0.108, + "eastasia": 0.132, + "eastus": 0.096, + "eastus2": 0.096, + "francecentral": 0.112, + "japaneast": 0.124, + "koreacentral": 0.118, + "northeurope": 0.107, + "southcentralus": 0.115, + "southeastasia": 0.12, + "uksouth": 0.111, + "westeurope": 0.115, + "westus": 0.112, + "westus2": 0.096 + }, + "standardd2dsv4": { + "australiaeast": 0.142, + "australiasoutheast": 0.136, + "brazilsouth": 0.18, + "brazilsoutheast": 0.2, + "canadacentral": 0.126, + "canadaeast": 0.136, + "centralindia": 0.122, + "centralus": 0.128, + "eastasia": 0.175, + "eastus": 0.113, + "eastus2": 0.113, + "francecentral": 0.132, + "francesouth": 0.172, + "germanywestcentral": 0.136, + "japaneast": 0.146, + "japanwest": 0.161, + "koreacentral": 0.139, + "northcentralus": 0.113, + "northeurope": 0.126, + "southafricanorth": 0.151, + "southcentralus": 0.147, + "southeastasia": 0.141, + "switzerlandnorth": 0.17, + "uksouth": 0.131, + "ukwest": 0.137, + "usgovarizona": 0.143, + "usgovtexas": 0.141, + "usgovvirginia": 0.143, + "westcentralus": 0.136, + "westeurope": 0.136, + "westus": 0.133, + "westus2": 0.113 + }, + "standardd2dv4": { + "australiaeast": 0.142, + "australiasoutheast": 0.136, + "brazilsouth": 0.18, + "brazilsoutheast": 0.2, + "canadacentral": 0.126, + "canadaeast": 0.136, + "centralindia": 0.122, + "centralus": 0.128, + "eastasia": 0.175, + "eastus": 0.113, + "eastus2": 0.113, + "francecentral": 0.132, + "francesouth": 0.172, + "germanywestcentral": 0.136, + "japaneast": 0.146, + "japanwest": 0.161, + "koreacentral": 0.139, + "northcentralus": 0.113, + "northeurope": 0.126, + "southafricanorth": 0.151, + "southcentralus": 0.147, + "southeastasia": 0.141, + "switzerlandnorth": 0.17, + "uksouth": 0.131, + "ukwest": 0.137, + "usgovarizona": 0.143, + "usgovtexas": 0.141, + "usgovvirginia": 0.143, + "westcentralus": 0.136, + "westeurope": 0.136, + "westus": 0.133, + "westus2": 0.113 + }, + "standardd2s": { + "australiaeast": 0.186, + "australiasoutheast": 0.186, + "brazilsouth": 0.19, + "brazilsoutheast": 0.247, + "centralus": 0.154, + "eastasia": 0.225, + "eastus": 0.154, + "eastus2": 0.134, + "japaneast": 0.221, + "japanwest": 0.192, + "northcentralus": 0.154, + "northeurope": 0.146, + "southafricanorth": 0.18, + "southafricawest": 0.225, + "southcentralus": 0.134, + "southeastasia": 0.196, + "uaecentral": 0.209, + "uaenorth": 0.161, + "usgovvirginia": 0.143, + "westeurope": 0.168, + "westus": 0.154 + }, + "standardd2sv3": { + "australiacentral": 0.125, + "australiacentral2": 0.125, + "australiaeast": 0.125, + "australiasoutheast": 0.125, + "brazilsouth": 0.159, + "brazilsoutheast": 0.207, + "canadacentral": 0.111, + "canadaeast": 0.111, + "centralindia": 0.105, + "centralus": 0.11, + "eastasia": 0.132, + "eastus": 0.096, + "eastus2": 0.096, + "francecentral": 0.112, + "francesouth": 0.1456, + "germanycentral": 0.13, + "germanynorth": 0.15, + "germanynortheast": 0.13, + "germanywestcentral": 0.115, + "japaneast": 0.129, + "japanwest": 0.129, + "koreacentral": 0.123, + "koreasouth": 0.111, + "northcentralus": 0.1, + "northeurope": 0.107, + "norwayeast": 0.132, + "norwaywest": 0.172, + "southafricanorth": 0.134, + "southafricawest": 0.168, + "southcentralus": 0.11, + "southeastasia": 0.125, + "southindia": 0.135, + "switzerlandnorth": 0.144, + "switzerlandwest": 0.187, + "uaecentral": 0.156, + "uaenorth": 0.12, + "uksouth": 0.116, + "ukwest": 0.116, + "usgovarizona": 0.126, + "usgovtexas": 0.126, + "usgovvirginia": 0.126, + "westcentralus": 0.11, + "westeurope": 0.12, + "westindia": 0.123, + "westus": 0.117, + "westus2": 0.096 + }, + "standardd2sv4": { + "australiaeast": 0.12, + "australiasoutheast": 0.125, + "brazilsouth": 0.153, + "brazilsoutheast": 0.199, + "canadacentral": 0.107, + "canadaeast": 0.107, + "centralindia": 0.101, + "centralus": 0.108, + "eastasia": 0.149, + "eastus": 0.096, + "eastus2": 0.096, + "francecentral": 0.112, + "francesouth": 0.146, + "germanywestcentral": 0.115, + "japaneast": 0.124, + "japanwest": 0.136, + "koreacentral": 0.118, + "northcentralus": 0.096, + "northeurope": 0.107, + "southafricanorth": 0.129, + "southcentralus": 0.115, + "southeastasia": 0.12, + "switzerlandnorth": 0.144, + "uksouth": 0.111, + "ukwest": 0.116, + "usgovarizona": 0.121, + "usgovtexas": 0.12, + "usgovvirginia": 0.121, + "westcentralus": 0.115, + "westeurope": 0.115, + "westus": 0.112, + "westus2": 0.096 + }, + "standardd2v2": { + "australiacentral": 0.168, + "australiacentral2": 0.168, + "australiaeast": 0.168, + "australiasoutheast": 0.15576, + "brazilsouth": 0.171, + "brazilsoutheast": 0.223, + "canadacentral": 0.14, + "canadaeast": 0.14, + "centralindia": 0.169, + "centralus": 0.146, + "eastasia": 0.214, + "eastus": 0.146, + "eastus2": 0.114, + "francecentral": 0.175, + "francesouth": 0.228, + "germanycentral": 0.153, + "germanynorth": 0.174, + "germanynortheast": 0.153, + "germanywestcentral": 0.133, + "japaneast": 0.205, + "japanwest": 0.182, + "koreacentral": 0.165, + "koreasouth": 0.149, + "northcentralus": 0.146, + "northeurope": 0.132, + "norwayeast": 0.15, + "norwaywest": 0.194, + "southafricanorth": 0.153, + "southafricawest": 0.192, + "southcentralus": 0.127, + "southeastasia": 0.158, + "southindia": 0.169, + "switzerlandnorth": 0.163, + "switzerlandwest": 0.212, + "uaecentral": 0.178, + "uaenorth": 0.137, + "uksouth": 0.176, + "ukwest": 0.175, + "usgovarizona": 0.143, + "usgovtexas": 0.143, + "usgovvirginia": 0.143, + "westcentralus": 0.127, + "westeurope": 0.136, + "westindia": 0.169, + "westus": 0.14, + "westus2": 0.114 + }, + "standardd2v3": { + "australiacentral": 0.125, + "australiacentral2": 0.125, + "australiaeast": 0.125, + "australiasoutheast": 0.125, + "brazilsouth": 0.159, + "brazilsoutheast": 0.207, + "canadacentral": 0.111, + "canadaeast": 0.111, + "centralindia": 0.105, + "centralus": 0.11, + "eastasia": 0.132, + "eastus": 0.096, + "eastus2": 0.096, + "francecentral": 0.112, + "francesouth": 0.1456, + "germanycentral": 0.13, + "germanynorth": 0.15, + "germanynortheast": 0.13, + "germanywestcentral": 0.115, + "japaneast": 0.129, + "japanwest": 0.129, + "koreacentral": 0.123, + "koreasouth": 0.111, + "northcentralus": 0.1, + "northeurope": 0.107, + "norwayeast": 0.132, + "norwaywest": 0.172, + "southafricanorth": 0.134, + "southafricawest": 0.168, + "southcentralus": 0.11, + "southeastasia": 0.125, + "southindia": 0.135, + "switzerlandnorth": 0.144, + "switzerlandwest": 0.187, + "uaecentral": 0.156, + "uaenorth": 0.12, + "uksouth": 0.116, + "ukwest": 0.116, + "usgovarizona": 0.126, + "usgovtexas": 0.126, + "usgovvirginia": 0.126, + "westcentralus": 0.11, + "westeurope": 0.12, + "westindia": 0.123, + "westus": 0.117, + "westus2": 0.096 + }, + "standardd2v4": { + "australiaeast": 0.12, + "australiasoutheast": 0.125, + "brazilsouth": 0.153, + "brazilsoutheast": 0.199, + "canadacentral": 0.107, + "canadaeast": 0.107, + "centralindia": 0.101, + "centralus": 0.108, + "eastasia": 0.149, + "eastus": 0.096, + "eastus2": 0.096, + "francecentral": 0.112, + "francesouth": 0.146, + "germanywestcentral": 0.115, + "japaneast": 0.124, + "japanwest": 0.136, + "koreacentral": 0.118, + "northcentralus": 0.096, + "northeurope": 0.107, + "southafricanorth": 0.129, + "southcentralus": 0.115, + "southeastasia": 0.12, + "switzerlandnorth": 0.144, + "uksouth": 0.111, + "ukwest": 0.116, + "usgovarizona": 0.121, + "usgovtexas": 0.12, + "usgovvirginia": 0.121, + "westcentralus": 0.115, + "westeurope": 0.115, + "westus": 0.112, + "westus2": 0.096 + }, + "standardd3": { + "australiaeast": 0.372, + "australiasoutheast": 0.372, + "brazilsouth": 0.38, + "brazilsoutheast": 0.494, + "centralus": 0.308, + "eastasia": 0.451, + "eastus": 0.308, + "eastus2": 0.268, + "japaneast": 0.442, + "japanwest": 0.384, + "northcentralus": 0.308, + "northeurope": 0.292, + "southafricanorth": 0.359, + "southafricawest": 0.45, + "southcentralus": 0.268, + "southeastasia": 0.392, + "uaecentral": 0.418, + "uaenorth": 0.322, + "usgovvirginia": 0.2856, + "westeurope": 0.336, + "westus": 0.308 + }, + "standardd3s": { + "australiaeast": 0.372, + "australiasoutheast": 0.372, + "brazilsouth": 0.38, + "brazilsoutheast": 0.494, + "centralus": 0.308, + "eastasia": 0.451, + "eastus": 0.308, + "eastus2": 0.268, + "japaneast": 0.442, + "japanwest": 0.384, + "northcentralus": 0.308, + "northeurope": 0.292, + "southafricanorth": 0.359, + "southafricawest": 0.45, + "southcentralus": 0.268, + "southeastasia": 0.392, + "uaecentral": 0.418, + "uaenorth": 0.322, + "usgovvirginia": 0.2856, + "westeurope": 0.336, + "westus": 0.308 + }, + "standardd3v2": { + "australiacentral": 0.336, + "australiacentral2": 0.336, + "australiaeast": 0.336, + "australiasoutheast": 0.311, + "brazilsouth": 0.343, + "brazilsoutheast": 0.445, + "canadacentral": 0.28, + "canadaeast": 0.28, + "centralindia": 0.337, + "centralus": 0.293, + "eastasia": 0.428, + "eastus": 0.293, + "eastus2": 0.229, + "francecentral": 0.351, + "francesouth": 0.456, + "germanycentral": 0.306, + "germanynorth": 0.348, + "germanynortheast": 0.306, + "germanywestcentral": 0.266, + "japaneast": 0.409, + "japanwest": 0.365, + "koreacentral": 0.33, + "koreasouth": 0.297, + "northcentralus": 0.293, + "northeurope": 0.263, + "norwayeast": 0.299, + "norwaywest": 0.389, + "southafricanorth": 0.307, + "southafricawest": 0.385, + "southcentralus": 0.254, + "southeastasia": 0.316, + "southindia": 0.337, + "switzerlandnorth": 0.326, + "switzerlandwest": 0.424, + "uaecentral": 0.357, + "uaenorth": 0.275, + "uksouth": 0.351, + "ukwest": 0.351, + "usgovarizona": 0.285, + "usgovtexas": 0.285, + "usgovvirginia": 0.285, + "westcentralus": 0.254, + "westeurope": 0.272, + "westindia": 0.337, + "westus": 0.279, + "westus2": 0.229 + }, + "standardd4": { + "australiaeast": 0.744, + "australiasoutheast": 0.744, + "brazilsouth": 0.76, + "brazilsoutheast": 0.988, + "centralus": 0.616, + "eastasia": 0.902, + "eastus": 0.616, + "eastus2": 0.536, + "japaneast": 0.883, + "japanwest": 0.768, + "northcentralus": 0.616, + "northeurope": 0.584, + "southafricanorth": 0.718, + "southafricawest": 0.9, + "southcentralus": 0.536, + "southeastasia": 0.784, + "uaecentral": 0.836, + "uaenorth": 0.643, + "usgovvirginia": 0.572, + "westeurope": 0.672, + "westus": 0.616 + }, + "standardd4asv4": { + "australiaeast": 0.24, + "brazilsouth": 0.306, + "centralindia": 0.202, + "centralus": 0.217, + "eastasia": 0.264, + "eastus": 0.192, + "eastus2": 0.192, + "francecentral": 0.224, + "japaneast": 0.248, + "koreacentral": 0.236, + "northeurope": 0.214, + "southcentralus": 0.23, + "southeastasia": 0.24, + "uksouth": 0.222, + "westeurope": 0.23, + "westus": 0.224, + "westus2": 0.192 + }, + "standardd4av4": { + "australiaeast": 0.24, + "brazilsouth": 0.306, + "centralindia": 0.202, + "centralus": 0.217, + "eastasia": 0.264, + "eastus": 0.192, + "eastus2": 0.192, + "francecentral": 0.224, + "japaneast": 0.248, + "koreacentral": 0.236, + "northeurope": 0.214, + "southcentralus": 0.23, + "southeastasia": 0.24, + "uksouth": 0.222, + "westeurope": 0.23, + "westus": 0.224, + "westus2": 0.192 + }, + "standardd4dsv4": { + "australiaeast": 0.284, + "australiasoutheast": 0.271, + "brazilsouth": 0.36, + "brazilsoutheast": 0.4, + "canadacentral": 0.252, + "canadaeast": 0.271, + "centralindia": 0.244, + "centralus": 0.255, + "eastasia": 0.35, + "eastus": 0.226, + "eastus2": 0.226, + "francecentral": 0.264, + "francesouth": 0.344, + "germanywestcentral": 0.272, + "japaneast": 0.292, + "japanwest": 0.321, + "koreacentral": 0.278, + "northcentralus": 0.226, + "northeurope": 0.252, + "southafricanorth": 0.303, + "southcentralus": 0.294, + "southeastasia": 0.282, + "switzerlandnorth": 0.339, + "uksouth": 0.262, + "ukwest": 0.273, + "usgovarizona": 0.286, + "usgovtexas": 0.282, + "usgovvirginia": 0.286, + "westcentralus": 0.271, + "westeurope": 0.272, + "westus": 0.266, + "westus2": 0.226 + }, + "standardd4dv4": { + "australiaeast": 0.284, + "australiasoutheast": 0.271, + "brazilsouth": 0.36, + "brazilsoutheast": 0.4, + "canadacentral": 0.252, + "canadaeast": 0.271, + "centralindia": 0.244, + "centralus": 0.255, + "eastasia": 0.35, + "eastus": 0.226, + "eastus2": 0.226, + "francecentral": 0.264, + "francesouth": 0.344, + "germanywestcentral": 0.272, + "japaneast": 0.292, + "japanwest": 0.321, + "koreacentral": 0.278, + "northcentralus": 0.226, + "northeurope": 0.252, + "southafricanorth": 0.303, + "southcentralus": 0.294, + "southeastasia": 0.282, + "switzerlandnorth": 0.339, + "uksouth": 0.262, + "ukwest": 0.273, + "usgovarizona": 0.286, + "usgovtexas": 0.282, + "usgovvirginia": 0.286, + "westcentralus": 0.271, + "westeurope": 0.272, + "westus": 0.266, + "westus2": 0.226 + }, + "standardd4s": { + "australiaeast": 0.744, + "australiasoutheast": 0.744, + "brazilsouth": 0.76, + "brazilsoutheast": 0.988, + "centralus": 0.616, + "eastasia": 0.902, + "eastus": 0.616, + "eastus2": 0.536, + "japaneast": 0.883, + "japanwest": 0.768, + "northcentralus": 0.616, + "northeurope": 0.584, + "southafricanorth": 0.718, + "southafricawest": 0.9, + "southcentralus": 0.536, + "southeastasia": 0.784, + "uaecentral": 0.836, + "uaenorth": 0.643, + "usgovvirginia": 0.572, + "westeurope": 0.672, + "westus": 0.616 + }, + "standardd4sv3": { + "australiacentral": 0.25, + "australiacentral2": 0.25, + "australiaeast": 0.25, + "australiasoutheast": 0.25, + "brazilsouth": 0.318, + "brazilsoutheast": 0.413, + "canadacentral": 0.222, + "canadaeast": 0.222, + "centralindia": 0.21, + "centralus": 0.22, + "eastasia": 0.264, + "eastus": 0.192, + "eastus2": 0.192, + "francecentral": 0.224, + "francesouth": 0.291, + "germanycentral": 0.259, + "germanynorth": 0.299, + "germanynortheast": 0.259, + "germanywestcentral": 0.23, + "japaneast": 0.258, + "japanwest": 0.258, + "koreacentral": 0.246, + "koreasouth": 0.221, + "northcentralus": 0.2, + "northeurope": 0.214, + "norwayeast": 0.264, + "norwaywest": 0.343, + "southafricanorth": 0.268, + "southafricawest": 0.336, + "southcentralus": 0.22, + "southeastasia": 0.25, + "southindia": 0.271, + "switzerlandnorth": 0.288, + "switzerlandwest": 0.374, + "uaecentral": 0.312, + "uaenorth": 0.24, + "uksouth": 0.232, + "ukwest": 0.232, + "usgovarizona": 0.252, + "usgovtexas": 0.252, + "usgovvirginia": 0.252, + "westcentralus": 0.22, + "westeurope": 0.24, + "westindia": 0.246, + "westus": 0.234, + "westus2": 0.192 + }, + "standardd4sv4": { + "australiaeast": 0.24, + "australiasoutheast": 0.25, + "brazilsouth": 0.306, + "brazilsoutheast": 0.398, + "canadacentral": 0.214, + "canadaeast": 0.214, + "centralindia": 0.202, + "centralus": 0.217, + "eastasia": 0.298, + "eastus": 0.192, + "eastus2": 0.192, + "francecentral": 0.224, + "francesouth": 0.292, + "germanywestcentral": 0.23, + "japaneast": 0.248, + "japanwest": 0.273, + "koreacentral": 0.236, + "northcentralus": 0.192, + "northeurope": 0.214, + "southafricanorth": 0.257, + "southcentralus": 0.23, + "southeastasia": 0.24, + "switzerlandnorth": 0.288, + "uksouth": 0.222, + "ukwest": 0.232, + "usgovarizona": 0.242, + "usgovtexas": 0.24, + "usgovvirginia": 0.242, + "westcentralus": 0.23, + "westeurope": 0.23, + "westus": 0.224, + "westus2": 0.192 + }, + "standardd4v2": { + "australiacentral": 0.673, + "australiacentral2": 0.673, + "australiaeast": 0.673, + "australiasoutheast": 0.623, + "brazilsouth": 0.685, + "brazilsoutheast": 0.89, + "canadacentral": 0.56, + "canadaeast": 0.56, + "centralindia": 0.675, + "centralus": 0.585, + "eastasia": 0.857, + "eastus": 0.585, + "eastus2": 0.458, + "francecentral": 0.702, + "francesouth": 0.912, + "germanycentral": 0.612, + "germanynorth": 0.697, + "germanynortheast": 0.612, + "germanywestcentral": 0.532, + "japaneast": 0.818, + "japanwest": 0.729, + "koreacentral": 0.66, + "koreasouth": 0.594, + "northcentralus": 0.585, + "northeurope": 0.527, + "norwayeast": 0.598, + "norwaywest": 0.778, + "southafricanorth": 0.614, + "southafricawest": 0.769, + "southcentralus": 0.509, + "southeastasia": 0.631, + "southindia": 0.675, + "switzerlandnorth": 0.653, + "switzerlandwest": 0.849, + "uaecentral": 0.714, + "uaenorth": 0.55, + "uksouth": 0.702, + "ukwest": 0.702, + "usgovarizona": 0.571, + "usgovtexas": 0.571, + "usgovvirginia": 0.571, + "westcentralus": 0.509, + "westeurope": 0.544, + "westindia": 0.675, + "westus": 0.559, + "westus2": 0.458 + }, + "standardd4v3": { + "australiacentral": 0.25, + "australiacentral2": 0.25, + "australiaeast": 0.25, + "australiasoutheast": 0.25, + "brazilsouth": 0.318, + "brazilsoutheast": 0.413, + "canadacentral": 0.222, + "canadaeast": 0.222, + "centralindia": 0.21, + "centralus": 0.22, + "eastasia": 0.264, + "eastus": 0.192, + "eastus2": 0.192, + "francecentral": 0.224, + "francesouth": 0.291, + "germanycentral": 0.259, + "germanynorth": 0.299, + "germanynortheast": 0.259, + "germanywestcentral": 0.23, + "japaneast": 0.258, + "japanwest": 0.258, + "koreacentral": 0.246, + "koreasouth": 0.221, + "northcentralus": 0.2, + "northeurope": 0.214, + "norwayeast": 0.264, + "norwaywest": 0.343, + "southafricanorth": 0.268, + "southafricawest": 0.336, + "southcentralus": 0.22, + "southeastasia": 0.25, + "southindia": 0.271, + "switzerlandnorth": 0.288, + "switzerlandwest": 0.374, + "uaecentral": 0.312, + "uaenorth": 0.24, + "uksouth": 0.232, + "ukwest": 0.232, + "usgovarizona": 0.252, + "usgovtexas": 0.252, + "usgovvirginia": 0.252, + "westcentralus": 0.22, + "westeurope": 0.24, + "westindia": 0.246, + "westus": 0.234, + "westus2": 0.192 + }, + "standardd4v4": { + "australiaeast": 0.24, + "australiasoutheast": 0.25, + "brazilsouth": 0.306, + "brazilsoutheast": 0.398, + "canadacentral": 0.214, + "canadaeast": 0.214, + "centralindia": 0.202, + "centralus": 0.217, + "eastasia": 0.298, + "eastus": 0.192, + "eastus2": 0.192, + "francecentral": 0.224, + "francesouth": 0.292, + "germanywestcentral": 0.23, + "japaneast": 0.248, + "japanwest": 0.273, + "koreacentral": 0.236, + "northcentralus": 0.192, + "northeurope": 0.214, + "southafricanorth": 0.257, + "southcentralus": 0.23, + "southeastasia": 0.24, + "switzerlandnorth": 0.288, + "uksouth": 0.222, + "ukwest": 0.232, + "usgovarizona": 0.242, + "usgovtexas": 0.24, + "usgovvirginia": 0.242, + "westcentralus": 0.23, + "westeurope": 0.23, + "westus": 0.224, + "westus2": 0.192 + }, + "standardd5v2": { + "australiacentral": 1.345, + "australiacentral2": 1.345, + "australiaeast": 1.345, + "australiasoutheast": 1.246, + "brazilsouth": 1.37, + "brazilsoutheast": 1.78, + "canadacentral": 1.12, + "canadaeast": 1.12, + "centralindia": 1.35, + "centralus": 1.17, + "eastasia": 1.714, + "eastus": 1.17, + "eastus2": 0.916, + "francecentral": 1.404, + "francesouth": 1.824, + "germanycentral": 1.224, + "germanynorth": 1.394, + "germanynortheast": 1.224, + "germanywestcentral": 1.064, + "japaneast": 1.636, + "japanwest": 1.459, + "koreacentral": 1.321, + "koreasouth": 1.189, + "northcentralus": 1.17, + "northeurope": 1.053, + "norwayeast": 1.196, + "norwaywest": 1.554, + "southafricanorth": 1.227, + "southafricawest": 1.539, + "southcentralus": 1.017, + "southeastasia": 1.263, + "southindia": 1.35, + "switzerlandnorth": 1.306, + "switzerlandwest": 1.697, + "uaecentral": 1.429, + "uaenorth": 1.099, + "uksouth": 1.405, + "ukwest": 1.404, + "usgovarizona": 1.142, + "usgovtexas": 1.142, + "usgovvirginia": 1.142, + "westcentralus": 1.017, + "westeurope": 1.087, + "westindia": 1.35, + "westus": 1.117, + "westus2": 0.916 + }, + "standardd8asv4": { + "australiaeast": 0.48, + "brazilsouth": 0.612, + "centralindia": 0.404, + "centralus": 0.434, + "eastasia": 0.528, + "eastus": 0.384, + "eastus2": 0.384, + "francecentral": 0.448, + "japaneast": 0.496, + "koreacentral": 0.472, + "northeurope": 0.428, + "southcentralus": 0.461, + "southeastasia": 0.48, + "uksouth": 0.444, + "westeurope": 0.46, + "westus": 0.448, + "westus2": 0.384 + }, + "standardd8av4": { + "australiaeast": 0.48, + "brazilsouth": 0.612, + "centralindia": 0.404, + "centralus": 0.434, + "eastasia": 0.528, + "eastus": 0.384, + "eastus2": 0.384, + "francecentral": 0.448, + "japaneast": 0.496, + "koreacentral": 0.472, + "northeurope": 0.428, + "southcentralus": 0.461, + "southeastasia": 0.48, + "uksouth": 0.444, + "westeurope": 0.46, + "westus": 0.448, + "westus2": 0.384 + }, + "standardd8dsv4": { + "australiaeast": 0.568, + "australiasoutheast": 0.542, + "brazilsouth": 0.72, + "brazilsoutheast": 0.801, + "canadacentral": 0.504, + "canadaeast": 0.542, + "centralindia": 0.488, + "centralus": 0.511, + "eastasia": 0.701, + "eastus": 0.452, + "eastus2": 0.452, + "francecentral": 0.528, + "francesouth": 0.687, + "germanywestcentral": 0.544, + "japaneast": 0.584, + "japanwest": 0.642, + "koreacentral": 0.556, + "northcentralus": 0.452, + "northeurope": 0.504, + "southafricanorth": 0.606, + "southcentralus": 0.588, + "southeastasia": 0.564, + "switzerlandnorth": 0.678, + "uksouth": 0.524, + "ukwest": 0.547, + "usgovarizona": 0.572, + "usgovtexas": 0.565, + "usgovvirginia": 0.572, + "westcentralus": 0.542, + "westeurope": 0.544, + "westus": 0.532, + "westus2": 0.452 + }, + "standardd8dv4": { + "australiaeast": 0.568, + "australiasoutheast": 0.542, + "brazilsouth": 0.72, + "brazilsoutheast": 0.801, + "canadacentral": 0.504, + "canadaeast": 0.542, + "centralindia": 0.488, + "centralus": 0.511, + "eastasia": 0.701, + "eastus": 0.452, + "eastus2": 0.452, + "francecentral": 0.528, + "francesouth": 0.687, + "germanywestcentral": 0.544, + "japaneast": 0.584, + "japanwest": 0.642, + "koreacentral": 0.556, + "northcentralus": 0.452, + "northeurope": 0.504, + "southafricanorth": 0.606, + "southcentralus": 0.588, + "southeastasia": 0.564, + "switzerlandnorth": 0.678, + "uksouth": 0.524, + "ukwest": 0.547, + "usgovarizona": 0.572, + "usgovtexas": 0.565, + "usgovvirginia": 0.572, + "westcentralus": 0.542, + "westeurope": 0.544, + "westus": 0.532, + "westus2": 0.452 + }, + "standardd8sv3": { + "australiacentral": 0.5, + "australiacentral2": 0.5, + "australiaeast": 0.5, + "australiasoutheast": 0.5, + "brazilsouth": 0.636, + "brazilsoutheast": 0.827, + "canadacentral": 0.444, + "canadaeast": 0.444, + "centralindia": 0.42, + "centralus": 0.44, + "eastasia": 0.528, + "eastus": 0.384, + "eastus2": 0.384, + "francecentral": 0.448, + "francesouth": 0.582, + "germanycentral": 0.518, + "germanynorth": 0.598, + "germanynortheast": 0.518, + "germanywestcentral": 0.46, + "japaneast": 0.516, + "japanwest": 0.516, + "koreacentral": 0.492, + "koreasouth": 0.443, + "northcentralus": 0.4, + "northeurope": 0.428, + "norwayeast": 0.528, + "norwaywest": 0.686, + "southafricanorth": 0.536, + "southafricawest": 0.672, + "southcentralus": 0.44, + "southeastasia": 0.5, + "southindia": 0.541, + "switzerlandnorth": 0.576, + "switzerlandwest": 0.749, + "uaecentral": 0.624, + "uaenorth": 0.48, + "uksouth": 0.464, + "ukwest": 0.464, + "usgovarizona": 0.504, + "usgovtexas": 0.504, + "usgovvirginia": 0.504, + "westcentralus": 0.44, + "westeurope": 0.48, + "westindia": 0.492, + "westus": 0.468, + "westus2": 0.384 + }, + "standardd8sv4": { + "australiaeast": 0.48, + "australiasoutheast": 0.499, + "brazilsouth": 0.612, + "brazilsoutheast": 0.796, + "canadacentral": 0.428, + "canadaeast": 0.428, + "centralindia": 0.404, + "centralus": 0.434, + "eastasia": 0.595, + "eastus": 0.384, + "eastus2": 0.384, + "francecentral": 0.448, + "francesouth": 0.584, + "germanywestcentral": 0.46, + "japaneast": 0.496, + "japanwest": 0.546, + "koreacentral": 0.472, + "northcentralus": 0.384, + "northeurope": 0.428, + "southafricanorth": 0.515, + "southcentralus": 0.461, + "southeastasia": 0.48, + "switzerlandnorth": 0.576, + "uksouth": 0.444, + "ukwest": 0.465, + "usgovarizona": 0.484, + "usgovtexas": 0.48, + "usgovvirginia": 0.484, + "westcentralus": 0.461, + "westeurope": 0.46, + "westus": 0.448, + "westus2": 0.384 + }, + "standardd8v3": { + "australiacentral": 0.5, + "australiacentral2": 0.5, + "australiaeast": 0.5, + "australiasoutheast": 0.5, + "brazilsouth": 0.636, + "brazilsoutheast": 0.827, + "canadacentral": 0.444, + "canadaeast": 0.444, + "centralindia": 0.42, + "centralus": 0.44, + "eastasia": 0.528, + "eastus": 0.384, + "eastus2": 0.384, + "francecentral": 0.448, + "francesouth": 0.582, + "germanycentral": 0.518, + "germanynorth": 0.598, + "germanynortheast": 0.518, + "germanywestcentral": 0.46, + "japaneast": 0.516, + "japanwest": 0.516, + "koreacentral": 0.492, + "koreasouth": 0.443, + "northcentralus": 0.4, + "northeurope": 0.428, + "norwayeast": 0.528, + "norwaywest": 0.686, + "southafricanorth": 0.536, + "southafricawest": 0.672, + "southcentralus": 0.44, + "southeastasia": 0.5, + "southindia": 0.541, + "switzerlandnorth": 0.576, + "switzerlandwest": 0.749, + "uaecentral": 0.624, + "uaenorth": 0.48, + "uksouth": 0.464, + "ukwest": 0.464, + "usgovarizona": 0.504, + "usgovtexas": 0.504, + "usgovvirginia": 0.504, + "westcentralus": 0.44, + "westeurope": 0.48, + "westindia": 0.492, + "westus": 0.468, + "westus2": 0.384 + }, + "standardd8v4": { + "australiaeast": 0.48, + "australiasoutheast": 0.499, + "brazilsouth": 0.612, + "brazilsoutheast": 0.796, + "canadacentral": 0.428, + "canadaeast": 0.428, + "centralindia": 0.404, + "centralus": 0.434, + "eastasia": 0.595, + "eastus": 0.384, + "eastus2": 0.384, + "francecentral": 0.448, + "francesouth": 0.584, + "germanywestcentral": 0.46, + "japaneast": 0.496, + "japanwest": 0.546, + "koreacentral": 0.472, + "northcentralus": 0.384, + "northeurope": 0.428, + "southafricanorth": 0.515, + "southcentralus": 0.461, + "southeastasia": 0.48, + "switzerlandnorth": 0.576, + "uksouth": 0.444, + "ukwest": 0.465, + "usgovarizona": 0.484, + "usgovtexas": 0.48, + "usgovvirginia": 0.484, + "westcentralus": 0.461, + "westeurope": 0.46, + "westus": 0.448, + "westus2": 0.384 + }, + "standardd11": { + "australiaeast": 0.21, + "australiasoutheast": 0.21, + "brazilsouth": 0.235, + "brazilsoutheast": 0.306, + "centralus": 0.193, + "eastasia": 0.242, + "eastus": 0.193, + "eastus2": 0.173, + "japaneast": 0.242, + "japanwest": 0.21, + "northcentralus": 0.193, + "northeurope": 0.193, + "southafricanorth": 0.232, + "southafricawest": 0.291, + "southcentralus": 0.173, + "southeastasia": 0.21, + "uaecentral": 0.271, + "uaenorth": 0.208, + "usgovvirginia": 0.186, + "westeurope": 0.221, + "westus": 0.193 + }, + "standardd11s": { + "australiaeast": 0.21, + "australiasoutheast": 0.21, + "brazilsouth": 0.235, + "brazilsoutheast": 0.306, + "centralus": 0.193, + "eastasia": 0.242, + "eastus": 0.193, + "eastus2": 0.173, + "japaneast": 0.242, + "japanwest": 0.21, + "northcentralus": 0.193, + "northeurope": 0.193, + "southafricanorth": 0.232, + "southafricawest": 0.291, + "southcentralus": 0.173, + "southeastasia": 0.21, + "uaecentral": 0.271, + "uaenorth": 0.208, + "usgovvirginia": 0.186, + "westeurope": 0.221, + "westus": 0.193 + }, + "standardd11v2": { + "australiacentral": 0.2, + "australiacentral2": 0.2, + "australiaeast": 0.2, + "australiasoutheast": 0.2, + "brazilsouth": 0.235, + "brazilsoutheast": 0.306, + "canadacentral": 0.183, + "canadaeast": 0.183, + "centralindia": 0.189, + "centralus": 0.185, + "eastasia": 0.229, + "eastus": 0.185, + "eastus2": 0.149, + "francecentral": 0.234, + "francesouth": 0.304, + "germanycentral": 0.222, + "germanynorth": 0.216, + "germanynortheast": 0.222, + "germanywestcentral": 0.166, + "japaneast": 0.229, + "japanwest": 0.2, + "koreacentral": 0.2, + "koreasouth": 0.179, + "northcentralus": 0.185, + "northeurope": 0.185, + "norwayeast": 0.209, + "norwaywest": 0.272, + "southafricanorth": 0.2, + "southafricawest": 0.251, + "southcentralus": 0.166, + "southeastasia": 0.191, + "southindia": 0.189, + "switzerlandnorth": 0.228, + "switzerlandwest": 0.296, + "uaecentral": 0.233, + "uaenorth": 0.179, + "uksouth": 0.234, + "ukwest": 0.234, + "usgovarizona": 0.186, + "usgovtexas": 0.186, + "usgovvirginia": 0.186, + "westcentralus": 0.166, + "westeurope": 0.19, + "westindia": 0.189, + "westus": 0.185, + "westus2": 0.149 + }, + "standardd12": { + "australiaeast": 0.42, + "australiasoutheast": 0.42, + "brazilsouth": 0.47, + "brazilsoutheast": 0.611, + "centralus": 0.386, + "eastasia": 0.483, + "eastus": 0.386, + "eastus2": 0.347, + "japaneast": 0.483, + "japanwest": 0.42, + "northcentralus": 0.386, + "northeurope": 0.386, + "southafricanorth": 0.465, + "southafricawest": 0.583, + "southcentralus": 0.347, + "southeastasia": 0.42, + "uaecentral": 0.541, + "uaenorth": 0.416, + "usgovvirginia": 0.373, + "westeurope": 0.442, + "westus": 0.386 + }, + "standardd12s": { + "australiaeast": 0.42, + "australiasoutheast": 0.42, + "brazilsouth": 0.47, + "brazilsoutheast": 0.611, + "centralus": 0.386, + "eastasia": 0.483, + "eastus": 0.386, + "eastus2": 0.347, + "japaneast": 0.483, + "japanwest": 0.42, + "northcentralus": 0.386, + "northeurope": 0.386, + "southafricanorth": 0.465, + "southafricawest": 0.583, + "southcentralus": 0.347, + "southeastasia": 0.42, + "uaecentral": 0.541, + "uaenorth": 0.416, + "usgovvirginia": 0.373, + "westeurope": 0.442, + "westus": 0.386 + }, + "standardd12v2": { + "australiacentral": 0.399, + "australiacentral2": 0.399, + "australiaeast": 0.399, + "australiasoutheast": 0.399, + "brazilsouth": 0.47, + "brazilsoutheast": 0.611, + "canadacentral": 0.366, + "canadaeast": 0.366, + "centralindia": 0.379, + "centralus": 0.371, + "eastasia": 0.459, + "eastus": 0.371, + "eastus2": 0.299, + "francecentral": 0.469, + "francesouth": 0.608, + "germanycentral": 0.445, + "germanynorth": 0.432, + "germanynortheast": 0.445, + "germanywestcentral": 0.332, + "japaneast": 0.459, + "japanwest": 0.399, + "koreacentral": 0.399, + "koreasouth": 0.359, + "northcentralus": 0.37, + "northeurope": 0.371, + "norwayeast": 0.417, + "norwaywest": 0.542, + "southafricanorth": 0.401, + "southafricawest": 0.502, + "southcentralus": 0.332, + "southeastasia": 0.382, + "southindia": 0.379, + "switzerlandnorth": 0.456, + "switzerlandwest": 0.593, + "uaecentral": 0.466, + "uaenorth": 0.359, + "uksouth": 0.469, + "ukwest": 0.469, + "usgovarizona": 0.373, + "usgovtexas": 0.373, + "usgovvirginia": 0.373, + "westcentralus": 0.332, + "westeurope": 0.379, + "westindia": 0.379, + "westus": 0.37, + "westus2": 0.299 + }, + "standardd13": { + "australiaeast": 0.84, + "australiasoutheast": 0.84, + "brazilsouth": 0.939, + "brazilsoutheast": 1.221, + "centralus": 0.771, + "eastasia": 0.966, + "eastus": 0.771, + "eastus2": 0.694, + "japaneast": 0.966, + "japanwest": 0.84, + "northcentralus": 0.771, + "northeurope": 0.771, + "southafricanorth": 0.93, + "southafricawest": 1.165, + "southcentralus": 0.694, + "southeastasia": 0.84, + "uaecentral": 1.082, + "uaenorth": 0.832, + "usgovvirginia": 0.746, + "westeurope": 0.885, + "westus": 0.771 + }, + "standardd13s": { + "australiaeast": 0.84, + "australiasoutheast": 0.84, + "brazilsouth": 0.939, + "brazilsoutheast": 1.221, + "centralus": 0.771, + "eastasia": 0.966, + "eastus": 0.771, + "eastus2": 0.694, + "japaneast": 0.966, + "japanwest": 0.84, + "northcentralus": 0.771, + "northeurope": 0.771, + "southafricanorth": 0.93, + "southafricawest": 1.165, + "southcentralus": 0.694, + "southeastasia": 0.84, + "uaecentral": 1.082, + "uaenorth": 0.832, + "usgovvirginia": 0.746, + "westeurope": 0.885, + "westus": 0.771 + }, + "standardd13v2": { + "australiacentral": 0.798, + "australiacentral2": 0.798, + "australiaeast": 0.798, + "australiasoutheast": 0.798, + "brazilsouth": 0.94, + "brazilsoutheast": 1.222, + "canadacentral": 0.732, + "canadaeast": 0.732, + "centralindia": 0.758, + "centralus": 0.741, + "eastasia": 0.918, + "eastus": 0.741, + "eastus2": 0.598, + "francecentral": 0.937, + "francesouth": 1.217, + "germanycentral": 0.889, + "germanynorth": 0.863, + "germanynortheast": 0.889, + "germanywestcentral": 0.664, + "japaneast": 0.918, + "japanwest": 0.798, + "koreacentral": 0.798, + "koreasouth": 0.718, + "northcentralus": 0.741, + "northeurope": 0.741, + "norwayeast": 0.835, + "norwaywest": 1.085, + "southafricanorth": 0.801, + "southafricawest": 1.005, + "southcentralus": 0.665, + "southeastasia": 0.765, + "southindia": 0.758, + "switzerlandnorth": 0.912, + "switzerlandwest": 1.186, + "uaecentral": 0.933, + "uaenorth": 0.718, + "uksouth": 0.937, + "ukwest": 0.937, + "usgovarizona": 0.746, + "usgovtexas": 0.746, + "usgovvirginia": 0.746, + "westcentralus": 0.665, + "westeurope": 0.759, + "westindia": 0.758, + "westus": 0.741, + "westus2": 0.598 + }, + "standardd14": { + "australiaeast": 1.68, + "australiasoutheast": 1.68, + "brazilsouth": 1.879, + "brazilsoutheast": 2.443, + "centralus": 1.542, + "eastasia": 1.932, + "eastus": 1.542, + "eastus2": 1.387, + "japaneast": 1.932, + "japanwest": 1.68, + "northcentralus": 1.542, + "northeurope": 1.542, + "southafricanorth": 1.859, + "southafricawest": 2.331, + "southcentralus": 1.387, + "southeastasia": 1.68, + "uaecentral": 2.164, + "uaenorth": 1.665, + "usgovvirginia": 1.492, + "westeurope": 1.769, + "westus": 1.542 + }, + "standardd14s": { + "australiaeast": 1.68, + "australiasoutheast": 1.68, + "brazilsouth": 1.879, + "brazilsoutheast": 2.443, + "centralus": 1.542, + "eastasia": 1.932, + "eastus": 1.542, + "eastus2": 1.387, + "japaneast": 1.932, + "japanwest": 1.68, + "northcentralus": 1.542, + "northeurope": 1.542, + "southafricanorth": 1.859, + "southafricawest": 2.331, + "southcentralus": 1.387, + "southeastasia": 1.68, + "uaecentral": 2.164, + "uaenorth": 1.665, + "usgovvirginia": 1.492, + "westeurope": 1.769, + "westus": 1.542 + }, + "standardd14v2": { + "australiacentral": 1.596, + "australiacentral2": 1.596, + "australiaeast": 1.596, + "australiasoutheast": 1.596, + "brazilsouth": 1.879, + "brazilsoutheast": 2.443, + "canadacentral": 1.463, + "canadaeast": 1.463, + "centralindia": 1.516, + "centralus": 1.482, + "eastasia": 1.835, + "eastus": 1.482, + "eastus2": 1.196, + "francecentral": 1.874, + "francesouth": 2.434, + "germanycentral": 1.778, + "germanynorth": 1.726, + "germanynortheast": 1.778, + "germanywestcentral": 1.328, + "japaneast": 1.835, + "japanwest": 1.596, + "koreacentral": 1.596, + "koreasouth": 1.435, + "northcentralus": 1.482, + "northeurope": 1.482, + "norwayeast": 1.67, + "norwaywest": 2.171, + "southafricanorth": 1.603, + "southafricawest": 2.009, + "southcentralus": 1.33, + "southeastasia": 1.53, + "southindia": 1.516, + "switzerlandnorth": 1.824, + "switzerlandwest": 2.371, + "uaecentral": 1.866, + "uaenorth": 1.435, + "uksouth": 1.874, + "ukwest": 1.874, + "usgovarizona": 1.491, + "usgovtexas": 1.491, + "usgovvirginia": 1.491, + "westcentralus": 1.33, + "westeurope": 1.518, + "westindia": 1.516, + "westus": 1.482, + "westus2": 1.196 + }, + "standardd15iv2": { + "australiacentral": 1.995, + "australiacentral2": 1.995, + "australiaeast": 1.995, + "australiasoutheast": 1.995, + "brazilsouth": 2.349, + "brazilsoutheast": 3.054, + "canadacentral": 1.829, + "canadaeast": 1.829, + "centralindia": 1.895, + "centralus": 1.853, + "eastasia": 2.294, + "eastus": 1.853, + "eastus2": 1.495, + "francecentral": 2.343, + "francesouth": 3.042, + "germanynorth": 2.158, + "germanywestcentral": 1.66, + "japaneast": 2.294, + "japanwest": 1.995, + "koreacentral": 1.995, + "koreasouth": 1.794, + "northcentralus": 1.852, + "northeurope": 1.853, + "norwayeast": 2.087, + "norwaywest": 2.713, + "southafricanorth": 2.003, + "southafricawest": 2.512, + "southcentralus": 1.662, + "southeastasia": 1.912, + "southindia": 1.895, + "switzerlandnorth": 2.28, + "switzerlandwest": 2.964, + "uaecentral": 2.332, + "uaenorth": 1.794, + "uksouth": 2.343, + "ukwest": 2.343, + "usgovarizona": 1.864, + "usgovtexas": 1.864, + "usgovvirginia": 1.864, + "westcentralus": 1.662, + "westeurope": 1.897, + "westindia": 1.895, + "westus": 1.852, + "westus2": 1.495 + }, + "standardd15v2": { + "australiacentral": 1.995, + "australiacentral2": 1.995, + "australiaeast": 1.995, + "australiasoutheast": 1.995, + "brazilsouth": 2.349, + "brazilsoutheast": 3.054, + "canadacentral": 1.829, + "canadaeast": 1.829, + "centralindia": 1.895, + "centralus": 1.853, + "eastasia": 2.294, + "eastus": 1.853, + "eastus2": 1.495, + "francecentral": 2.343, + "francesouth": 3.042, + "germanycentral": 2.223, + "germanynorth": 2.158, + "germanynortheast": 2.223, + "germanywestcentral": 1.66, + "japaneast": 2.294, + "japanwest": 1.995, + "koreacentral": 1.995, + "koreasouth": 1.794, + "northcentralus": 1.852, + "northeurope": 1.853, + "norwayeast": 2.087, + "norwaywest": 2.713, + "southafricanorth": 2.003, + "southafricawest": 2.512, + "southcentralus": 1.662, + "southeastasia": 1.912, + "southindia": 1.895, + "switzerlandnorth": 2.28, + "switzerlandwest": 2.964, + "uaecentral": 2.332, + "uaenorth": 1.794, + "uksouth": 2.343, + "ukwest": 2.343, + "usgovarizona": 1.864, + "usgovtexas": 1.864, + "usgovvirginia": 1.864, + "westcentralus": 1.662, + "westeurope": 1.897, + "westindia": 1.895, + "westus": 1.852, + "westus2": 1.495 + }, + "standardd16asv4": { + "australiaeast": 0.96, + "brazilsouth": 1.224, + "centralindia": 0.808, + "centralus": 0.868, + "eastasia": 1.056, + "eastus": 0.768, + "eastus2": 0.768, + "francecentral": 0.896, + "japaneast": 0.992, + "koreacentral": 0.944, + "northeurope": 0.856, + "southcentralus": 0.922, + "southeastasia": 0.96, + "uksouth": 0.888, + "westeurope": 0.92, + "westus": 0.896, + "westus2": 0.768 + }, + "standardd16av4": { + "australiaeast": 0.96, + "brazilsouth": 1.224, + "centralindia": 0.808, + "centralus": 0.868, + "eastasia": 1.056, + "eastus": 0.768, + "eastus2": 0.768, + "francecentral": 0.896, + "japaneast": 0.992, + "koreacentral": 0.944, + "northeurope": 0.856, + "southcentralus": 0.922, + "southeastasia": 0.96, + "uksouth": 0.888, + "westeurope": 0.92, + "westus": 0.896, + "westus2": 0.768 + }, + "standardd16dsv4": { + "australiaeast": 1.136, + "australiasoutheast": 1.085, + "brazilsouth": 1.44, + "brazilsoutheast": 1.602, + "canadacentral": 1.008, + "canadaeast": 1.085, + "centralindia": 0.976, + "centralus": 1.022, + "eastasia": 1.401, + "eastus": 0.904, + "eastus2": 0.904, + "francecentral": 1.056, + "francesouth": 1.374, + "germanywestcentral": 1.088, + "japaneast": 1.168, + "japanwest": 1.284, + "koreacentral": 1.112, + "northcentralus": 0.904, + "northeurope": 1.008, + "southafricanorth": 1.211, + "southcentralus": 1.175, + "southeastasia": 1.128, + "switzerlandnorth": 1.356, + "uksouth": 1.048, + "ukwest": 1.094, + "usgovarizona": 1.144, + "usgovtexas": 1.13, + "usgovvirginia": 1.144, + "westcentralus": 1.085, + "westeurope": 1.088, + "westus": 1.064, + "westus2": 0.904 + }, + "standardd16dv4": { + "australiaeast": 1.136, + "australiasoutheast": 1.085, + "brazilsouth": 1.44, + "brazilsoutheast": 1.602, + "canadacentral": 1.008, + "canadaeast": 1.085, + "centralindia": 0.976, + "centralus": 1.022, + "eastasia": 1.401, + "eastus": 0.904, + "eastus2": 0.904, + "francecentral": 1.056, + "francesouth": 1.374, + "germanywestcentral": 1.088, + "japaneast": 1.168, + "japanwest": 1.284, + "koreacentral": 1.112, + "northcentralus": 0.904, + "northeurope": 1.008, + "southafricanorth": 1.211, + "southcentralus": 1.175, + "southeastasia": 1.128, + "switzerlandnorth": 1.356, + "uksouth": 1.048, + "ukwest": 1.094, + "usgovarizona": 1.144, + "usgovtexas": 1.13, + "usgovvirginia": 1.144, + "westcentralus": 1.085, + "westeurope": 1.088, + "westus": 1.064, + "westus2": 0.904 + }, + "standardd16sv3": { + "australiacentral": 1.0, + "australiacentral2": 1.0, + "australiaeast": 1.0, + "australiasoutheast": 1.0, + "brazilsouth": 1.272, + "brazilsoutheast": 1.654, + "canadacentral": 0.888, + "canadaeast": 0.888, + "centralindia": 0.84, + "centralus": 0.88, + "eastasia": 1.056, + "eastus": 0.768, + "eastus2": 0.768, + "francecentral": 0.896, + "francesouth": 1.1648, + "germanycentral": 1.037, + "germanynorth": 1.196, + "germanynortheast": 1.037, + "germanywestcentral": 0.92, + "japaneast": 1.032, + "japanwest": 1.032, + "koreacentral": 0.984, + "koreasouth": 0.886, + "northcentralus": 0.8, + "northeurope": 0.856, + "norwayeast": 1.056, + "norwaywest": 1.373, + "southafricanorth": 1.072, + "southafricawest": 1.344, + "southcentralus": 0.88, + "southeastasia": 1.0, + "southindia": 1.082, + "switzerlandnorth": 1.152, + "switzerlandwest": 1.498, + "uaecentral": 1.248, + "uaenorth": 0.96, + "uksouth": 0.928, + "ukwest": 0.928, + "usgovarizona": 1.008, + "usgovtexas": 1.008, + "usgovvirginia": 1.008, + "westcentralus": 0.88, + "westeurope": 0.96, + "westindia": 0.984, + "westus": 0.936, + "westus2": 0.768 + }, + "standardd16sv4": { + "australiaeast": 0.96, + "australiasoutheast": 0.998, + "brazilsouth": 1.224, + "brazilsoutheast": 1.591, + "canadacentral": 0.856, + "canadaeast": 0.856, + "centralindia": 0.808, + "centralus": 0.868, + "eastasia": 1.19, + "eastus": 0.768, + "eastus2": 0.768, + "francecentral": 0.896, + "francesouth": 1.167, + "germanywestcentral": 0.92, + "japaneast": 0.992, + "japanwest": 1.091, + "koreacentral": 0.944, + "northcentralus": 0.768, + "northeurope": 0.856, + "southafricanorth": 1.029, + "southcentralus": 0.922, + "southeastasia": 0.96, + "switzerlandnorth": 1.152, + "uksouth": 0.888, + "ukwest": 0.929, + "usgovarizona": 0.968, + "usgovtexas": 0.96, + "usgovvirginia": 0.968, + "westcentralus": 0.922, + "westeurope": 0.92, + "westus": 0.896, + "westus2": 0.768 + }, + "standardd16v3": { + "australiacentral": 1.0, + "australiacentral2": 1.0, + "australiaeast": 1.0, + "australiasoutheast": 1.0, + "brazilsouth": 1.272, + "brazilsoutheast": 1.654, + "canadacentral": 0.888, + "canadaeast": 0.888, + "centralindia": 0.84, + "centralus": 0.88, + "eastasia": 1.056, + "eastus": 0.768, + "eastus2": 0.768, + "francecentral": 0.896, + "francesouth": 1.1648, + "germanycentral": 1.037, + "germanynorth": 1.196, + "germanynortheast": 1.037, + "germanywestcentral": 0.92, + "japaneast": 1.032, + "japanwest": 1.032, + "koreacentral": 0.984, + "koreasouth": 0.886, + "northcentralus": 0.8, + "northeurope": 0.856, + "norwayeast": 1.056, + "norwaywest": 1.373, + "southafricanorth": 1.072, + "southafricawest": 1.344, + "southcentralus": 0.88, + "southeastasia": 1.0, + "southindia": 1.082, + "switzerlandnorth": 1.152, + "switzerlandwest": 1.498, + "uaecentral": 1.248, + "uaenorth": 0.96, + "uksouth": 0.928, + "ukwest": 0.928, + "usgovarizona": 1.008, + "usgovtexas": 1.008, + "usgovvirginia": 1.008, + "westcentralus": 0.88, + "westeurope": 0.96, + "westindia": 0.984, + "westus": 0.936, + "westus2": 0.768 + }, + "standardd16v4": { + "australiaeast": 0.96, + "australiasoutheast": 0.998, + "brazilsouth": 1.224, + "brazilsoutheast": 1.591, + "canadacentral": 0.856, + "canadaeast": 0.856, + "centralindia": 0.808, + "centralus": 0.868, + "eastasia": 1.19, + "eastus": 0.768, + "eastus2": 0.768, + "francecentral": 0.896, + "francesouth": 1.167, + "germanywestcentral": 0.92, + "japaneast": 0.992, + "japanwest": 1.091, + "koreacentral": 0.944, + "northcentralus": 0.768, + "northeurope": 0.856, + "southafricanorth": 1.029, + "southcentralus": 0.922, + "southeastasia": 0.96, + "switzerlandnorth": 1.152, + "uksouth": 0.888, + "ukwest": 0.929, + "usgovarizona": 0.968, + "usgovtexas": 0.96, + "usgovvirginia": 0.968, + "westcentralus": 0.922, + "westeurope": 0.92, + "westus": 0.896, + "westus2": 0.768 + }, + "standardd32asv4": { + "australiaeast": 1.92, + "brazilsouth": 2.448, + "centralindia": 1.616, + "centralus": 1.736, + "eastasia": 2.112, + "eastus": 1.536, + "eastus2": 1.536, + "francecentral": 1.792, + "japaneast": 1.984, + "koreacentral": 1.888, + "northeurope": 1.712, + "southcentralus": 1.843, + "southeastasia": 1.92, + "uksouth": 1.776, + "westeurope": 1.84, + "westus": 1.792, + "westus2": 1.536 + }, + "standardd32av4": { + "australiaeast": 1.92, + "brazilsouth": 2.448, + "centralindia": 1.616, + "centralus": 1.736, + "eastasia": 2.112, + "eastus": 1.536, + "eastus2": 1.536, + "francecentral": 1.792, + "japaneast": 1.984, + "koreacentral": 1.888, + "northeurope": 1.712, + "southcentralus": 1.843, + "southeastasia": 1.92, + "uksouth": 1.776, + "westeurope": 1.84, + "westus": 1.792, + "westus2": 1.536 + }, + "standardd32dsv4": { + "australiaeast": 2.272, + "australiasoutheast": 2.17, + "brazilsouth": 2.88, + "brazilsoutheast": 3.203, + "canadacentral": 2.016, + "canadaeast": 2.17, + "centralindia": 1.952, + "centralus": 2.043, + "eastasia": 2.802, + "eastus": 1.808, + "eastus2": 1.808, + "francecentral": 2.112, + "francesouth": 2.748, + "germanywestcentral": 2.176, + "japaneast": 2.336, + "japanwest": 2.569, + "koreacentral": 2.224, + "northcentralus": 1.808, + "northeurope": 2.016, + "southafricanorth": 2.423, + "southcentralus": 2.35, + "southeastasia": 2.256, + "switzerlandnorth": 2.712, + "uksouth": 2.096, + "ukwest": 2.188, + "usgovarizona": 2.288, + "usgovtexas": 2.26, + "usgovvirginia": 2.288, + "westcentralus": 2.17, + "westeurope": 2.176, + "westus": 2.128, + "westus2": 1.808 + }, + "standardd32dv4": { + "australiaeast": 2.272, + "australiasoutheast": 2.17, + "brazilsouth": 2.88, + "brazilsoutheast": 3.203, + "canadacentral": 2.016, + "canadaeast": 2.17, + "centralindia": 1.952, + "centralus": 2.043, + "eastasia": 2.802, + "eastus": 1.808, + "eastus2": 1.808, + "francecentral": 2.112, + "francesouth": 2.748, + "germanywestcentral": 2.176, + "japaneast": 2.336, + "japanwest": 2.569, + "koreacentral": 2.224, + "northcentralus": 1.808, + "northeurope": 2.016, + "southafricanorth": 2.423, + "southcentralus": 2.35, + "southeastasia": 2.256, + "switzerlandnorth": 2.712, + "uksouth": 2.096, + "ukwest": 2.188, + "usgovarizona": 2.288, + "usgovtexas": 2.26, + "usgovvirginia": 2.288, + "westcentralus": 2.17, + "westeurope": 2.176, + "westus": 2.128, + "westus2": 1.808 + }, + "standardd32sv3": { + "australiacentral": 2.0, + "australiacentral2": 2.0, + "australiaeast": 2.0, + "australiasoutheast": 2.0, + "brazilsouth": 2.544, + "brazilsoutheast": 3.307, + "canadacentral": 1.776, + "canadaeast": 1.776, + "centralindia": 1.68, + "centralus": 1.76, + "eastasia": 2.112, + "eastus": 1.536, + "eastus2": 1.536, + "francecentral": 1.792, + "francesouth": 2.3296, + "germanycentral": 2.074, + "germanynorth": 2.392, + "germanynortheast": 2.074, + "germanywestcentral": 1.84, + "japaneast": 2.064, + "japanwest": 2.064, + "koreacentral": 1.968, + "koreasouth": 1.772, + "northcentralus": 1.6, + "northeurope": 1.712, + "norwayeast": 2.112, + "norwaywest": 2.746, + "southafricanorth": 2.144, + "southafricawest": 2.688, + "southcentralus": 1.76, + "southeastasia": 2.0, + "southindia": 2.164, + "switzerlandnorth": 2.304, + "switzerlandwest": 2.995, + "uaecentral": 2.496, + "uaenorth": 1.92, + "uksouth": 1.856, + "ukwest": 1.856, + "usgovarizona": 2.016, + "usgovtexas": 2.016, + "usgovvirginia": 2.016, + "westcentralus": 1.76, + "westeurope": 1.92, + "westindia": 1.968, + "westus": 1.872, + "westus2": 1.536 + }, + "standardd32sv4": { + "australiaeast": 1.92, + "australiasoutheast": 1.997, + "brazilsouth": 2.448, + "brazilsoutheast": 3.182, + "canadacentral": 1.712, + "canadaeast": 1.712, + "centralindia": 1.616, + "centralus": 1.736, + "eastasia": 2.381, + "eastus": 1.536, + "eastus2": 1.536, + "francecentral": 1.792, + "francesouth": 2.335, + "germanywestcentral": 1.84, + "japaneast": 1.984, + "japanwest": 2.182, + "koreacentral": 1.888, + "northcentralus": 1.536, + "northeurope": 1.712, + "southafricanorth": 2.058, + "southcentralus": 1.843, + "southeastasia": 1.92, + "switzerlandnorth": 2.304, + "uksouth": 1.776, + "ukwest": 1.859, + "usgovarizona": 1.936, + "usgovtexas": 1.92, + "usgovvirginia": 1.936, + "westcentralus": 1.843, + "westeurope": 1.84, + "westus": 1.792, + "westus2": 1.536 + }, + "standardd32v3": { + "australiacentral": 2.0, + "australiacentral2": 2.0, + "australiaeast": 2.0, + "australiasoutheast": 2.0, + "brazilsouth": 2.544, + "brazilsoutheast": 3.307, + "canadacentral": 1.776, + "canadaeast": 1.776, + "centralindia": 1.68, + "centralus": 1.76, + "eastasia": 2.112, + "eastus": 1.536, + "eastus2": 1.536, + "francecentral": 1.792, + "francesouth": 2.3296, + "germanycentral": 2.074, + "germanynorth": 2.392, + "germanynortheast": 2.074, + "germanywestcentral": 1.84, + "japaneast": 2.064, + "japanwest": 2.064, + "koreacentral": 1.968, + "koreasouth": 1.772, + "northcentralus": 1.6, + "northeurope": 1.712, + "norwayeast": 2.112, + "norwaywest": 2.746, + "southafricanorth": 2.144, + "southafricawest": 2.688, + "southcentralus": 1.76, + "southeastasia": 2.0, + "southindia": 2.164, + "switzerlandnorth": 2.304, + "switzerlandwest": 2.995, + "uaecentral": 2.496, + "uaenorth": 1.92, + "uksouth": 1.856, + "ukwest": 1.856, + "usgovarizona": 2.016, + "usgovtexas": 2.016, + "usgovvirginia": 2.016, + "westcentralus": 1.76, + "westeurope": 1.92, + "westindia": 1.968, + "westus": 1.872, + "westus2": 1.536 + }, + "standardd32v4": { + "australiaeast": 1.92, + "australiasoutheast": 1.997, + "brazilsouth": 2.448, + "brazilsoutheast": 3.182, + "canadacentral": 1.712, + "canadaeast": 1.712, + "centralindia": 1.616, + "centralus": 1.736, + "eastasia": 2.381, + "eastus": 1.536, + "eastus2": 1.536, + "francecentral": 1.792, + "francesouth": 2.335, + "germanywestcentral": 1.84, + "japaneast": 1.984, + "japanwest": 2.182, + "koreacentral": 1.888, + "northcentralus": 1.536, + "northeurope": 1.712, + "southafricanorth": 2.058, + "southcentralus": 1.843, + "southeastasia": 1.92, + "switzerlandnorth": 2.304, + "uksouth": 1.776, + "ukwest": 1.859, + "usgovarizona": 1.936, + "usgovtexas": 1.92, + "usgovvirginia": 1.936, + "westcentralus": 1.843, + "westeurope": 1.84, + "westus": 1.792, + "westus2": 1.536 + }, + "standardd48asv4": { + "australiaeast": 2.88, + "brazilsouth": 3.672, + "centralindia": 2.424, + "centralus": 2.604, + "eastasia": 3.168, + "eastus": 2.304, + "eastus2": 2.304, + "francecentral": 2.688, + "japaneast": 2.976, + "koreacentral": 2.832, + "northeurope": 2.568, + "southcentralus": 2.765, + "southeastasia": 2.88, + "uksouth": 2.664, + "westeurope": 2.76, + "westus": 2.688, + "westus2": 2.304 + }, + "standardd48av4": { + "australiaeast": 2.88, + "brazilsouth": 3.672, + "centralindia": 2.424, + "centralus": 2.604, + "eastasia": 3.168, + "eastus": 2.304, + "eastus2": 2.304, + "francecentral": 2.688, + "japaneast": 2.976, + "koreacentral": 2.832, + "northeurope": 2.568, + "southcentralus": 2.765, + "southeastasia": 2.88, + "uksouth": 2.664, + "westeurope": 2.76, + "westus": 2.688, + "westus2": 2.304 + }, + "standardd48dsv4": { + "australiaeast": 3.408, + "australiasoutheast": 3.254, + "brazilsouth": 4.32, + "brazilsoutheast": 4.805, + "canadacentral": 3.024, + "canadaeast": 3.254, + "centralindia": 2.928, + "centralus": 3.065, + "eastasia": 4.204, + "eastus": 2.712, + "eastus2": 2.712, + "francecentral": 3.168, + "francesouth": 4.122, + "germanywestcentral": 3.264, + "japaneast": 3.504, + "japanwest": 3.853, + "koreacentral": 3.336, + "northcentralus": 2.712, + "northeurope": 3.024, + "southafricanorth": 3.634, + "southcentralus": 3.526, + "southeastasia": 3.384, + "switzerlandnorth": 4.068, + "uksouth": 3.144, + "ukwest": 3.282, + "usgovarizona": 3.432, + "usgovtexas": 3.39, + "usgovvirginia": 3.432, + "westcentralus": 3.254, + "westeurope": 3.264, + "westus": 3.192, + "westus2": 2.712 + }, + "standardd48dv4": { + "australiaeast": 3.408, + "australiasoutheast": 3.254, + "brazilsouth": 4.32, + "brazilsoutheast": 4.805, + "canadacentral": 3.024, + "canadaeast": 3.254, + "centralindia": 2.928, + "centralus": 3.065, + "eastasia": 4.204, + "eastus": 2.712, + "eastus2": 2.712, + "francecentral": 3.168, + "francesouth": 4.122, + "germanywestcentral": 3.264, + "japaneast": 3.504, + "japanwest": 3.853, + "koreacentral": 3.336, + "northcentralus": 2.712, + "northeurope": 3.024, + "southafricanorth": 3.634, + "southcentralus": 3.526, + "southeastasia": 3.384, + "switzerlandnorth": 4.068, + "uksouth": 3.144, + "ukwest": 3.282, + "usgovarizona": 3.432, + "usgovtexas": 3.39, + "usgovvirginia": 3.432, + "westcentralus": 3.254, + "westeurope": 3.264, + "westus": 3.192, + "westus2": 2.712 + }, + "standardd48sv3": { + "australiacentral": 3.0, + "australiacentral2": 3.0, + "australiaeast": 3.0, + "australiasoutheast": 3.0, + "brazilsouth": 3.816, + "brazilsoutheast": 4.961, + "canadacentral": 2.664, + "canadaeast": 2.664, + "centralindia": 2.52, + "centralus": 2.64, + "eastasia": 3.168, + "eastus": 2.304, + "eastus2": 2.304, + "francecentral": 2.688, + "francesouth": 3.494, + "germanycentral": 3.111, + "germanynorth": 3.588, + "germanynortheast": 3.111, + "germanywestcentral": 2.76, + "japaneast": 3.096, + "japanwest": 3.096, + "koreacentral": 2.952, + "koreasouth": 2.658, + "northcentralus": 2.4, + "northeurope": 2.568, + "norwayeast": 3.168, + "norwaywest": 4.118, + "southafricanorth": 3.216, + "southafricawest": 4.032, + "southcentralus": 2.64, + "southeastasia": 3.0, + "southindia": 3.246, + "switzerlandnorth": 3.456, + "switzerlandwest": 4.493, + "uaecentral": 3.744, + "uaenorth": 2.88, + "uksouth": 2.784, + "ukwest": 2.784, + "usgovarizona": 3.024, + "usgovtexas": 3.024, + "usgovvirginia": 3.024, + "westcentralus": 2.64, + "westeurope": 2.88, + "westindia": 2.952, + "westus": 2.808, + "westus2": 2.304 + }, + "standardd48sv4": { + "australiaeast": 2.88, + "australiasoutheast": 2.995, + "brazilsouth": 3.672, + "brazilsoutheast": 4.773, + "canadacentral": 2.568, + "canadaeast": 2.568, + "centralindia": 2.424, + "centralus": 2.604, + "eastasia": 3.571, + "eastus": 2.304, + "eastus2": 2.304, + "francecentral": 2.688, + "francesouth": 3.502, + "germanywestcentral": 2.76, + "japaneast": 2.976, + "japanwest": 3.274, + "koreacentral": 2.832, + "northcentralus": 2.304, + "northeurope": 2.568, + "southafricanorth": 3.087, + "southcentralus": 2.765, + "southeastasia": 2.88, + "switzerlandnorth": 3.456, + "uksouth": 2.664, + "ukwest": 2.788, + "usgovarizona": 2.904, + "usgovtexas": 2.88, + "usgovvirginia": 2.904, + "westcentralus": 2.765, + "westeurope": 2.76, + "westus": 2.688, + "westus2": 2.304 + }, + "standardd48v3": { + "australiacentral": 3.0, + "australiacentral2": 3.0, + "australiaeast": 3.0, + "australiasoutheast": 3.0, + "brazilsouth": 3.816, + "brazilsoutheast": 4.961, + "canadacentral": 2.664, + "canadaeast": 2.664, + "centralindia": 2.52, + "centralus": 2.64, + "eastasia": 3.168, + "eastus": 2.304, + "eastus2": 2.304, + "francecentral": 2.688, + "francesouth": 3.494, + "germanycentral": 3.111, + "germanynorth": 3.588, + "germanynortheast": 3.111, + "germanywestcentral": 2.76, + "japaneast": 3.096, + "japanwest": 3.096, + "koreacentral": 2.952, + "koreasouth": 2.658, + "northcentralus": 2.4, + "northeurope": 2.568, + "norwayeast": 3.168, + "norwaywest": 4.118, + "southafricanorth": 3.216, + "southafricawest": 4.032, + "southcentralus": 2.64, + "southeastasia": 3.0, + "southindia": 3.246, + "switzerlandnorth": 3.456, + "switzerlandwest": 4.493, + "uaecentral": 3.744, + "uaenorth": 2.88, + "uksouth": 2.784, + "ukwest": 2.784, + "usgovarizona": 3.024, + "usgovtexas": 3.024, + "usgovvirginia": 3.024, + "westcentralus": 2.64, + "westeurope": 2.88, + "westindia": 2.952, + "westus": 2.808, + "westus2": 2.304 + }, + "standardd48v4": { + "australiaeast": 2.88, + "australiasoutheast": 2.995, + "brazilsouth": 3.672, + "brazilsoutheast": 4.773, + "canadacentral": 2.568, + "canadaeast": 2.568, + "centralindia": 2.424, + "centralus": 2.604, + "eastasia": 3.571, + "eastus": 2.304, + "eastus2": 2.304, + "francecentral": 2.688, + "francesouth": 3.502, + "germanywestcentral": 2.76, + "japaneast": 2.976, + "japanwest": 3.274, + "koreacentral": 2.832, + "northcentralus": 2.304, + "northeurope": 2.568, + "southafricanorth": 3.087, + "southcentralus": 2.765, + "southeastasia": 2.88, + "switzerlandnorth": 3.456, + "uksouth": 2.664, + "ukwest": 2.788, + "usgovarizona": 2.904, + "usgovtexas": 2.88, + "usgovvirginia": 2.904, + "westcentralus": 2.765, + "westeurope": 2.76, + "westus": 2.688, + "westus2": 2.304 + }, + "standardd64asv4": { + "australiaeast": 3.84, + "brazilsouth": 4.896, + "centralindia": 3.232, + "centralus": 3.471, + "eastasia": 4.224, + "eastus": 3.072, + "eastus2": 3.072, + "francecentral": 3.584, + "japaneast": 3.968, + "koreacentral": 3.776, + "northeurope": 3.424, + "southcentralus": 3.686, + "southeastasia": 3.84, + "uksouth": 3.552, + "westeurope": 3.68, + "westus": 3.584, + "westus2": 3.072 + }, + "standardd64av4": { + "australiaeast": 3.84, + "brazilsouth": 4.896, + "centralindia": 3.232, + "centralus": 3.471, + "eastasia": 4.224, + "eastus": 3.072, + "eastus2": 3.072, + "francecentral": 3.584, + "japaneast": 3.968, + "koreacentral": 3.776, + "northeurope": 3.424, + "southcentralus": 3.686, + "southeastasia": 3.84, + "uksouth": 3.552, + "westeurope": 3.68, + "westus": 3.584, + "westus2": 3.072 + }, + "standardd64dsv4": { + "australiaeast": 4.544, + "australiasoutheast": 4.339, + "brazilsouth": 5.76, + "brazilsoutheast": 6.407, + "canadacentral": 4.032, + "canadaeast": 4.339, + "centralindia": 3.904, + "centralus": 4.086, + "eastasia": 5.605, + "eastus": 3.616, + "eastus2": 3.616, + "francecentral": 4.224, + "francesouth": 5.496, + "germanywestcentral": 4.352, + "japaneast": 4.672, + "japanwest": 5.138, + "koreacentral": 4.448, + "northcentralus": 3.616, + "northeurope": 4.032, + "southafricanorth": 4.845, + "southcentralus": 4.701, + "southeastasia": 4.512, + "switzerlandnorth": 5.424, + "uksouth": 4.192, + "ukwest": 4.375, + "usgovarizona": 4.576, + "usgovtexas": 4.52, + "usgovvirginia": 4.576, + "westcentralus": 4.339, + "westeurope": 4.352, + "westus": 4.256, + "westus2": 3.616 + }, + "standardd64dv4": { + "australiaeast": 4.544, + "australiasoutheast": 4.339, + "brazilsouth": 5.76, + "brazilsoutheast": 6.407, + "canadacentral": 4.032, + "canadaeast": 4.339, + "centralindia": 3.904, + "centralus": 4.086, + "eastasia": 5.605, + "eastus": 3.616, + "eastus2": 3.616, + "francecentral": 4.224, + "francesouth": 5.496, + "germanywestcentral": 4.352, + "japaneast": 4.672, + "japanwest": 5.138, + "koreacentral": 4.448, + "northcentralus": 3.616, + "northeurope": 4.032, + "southafricanorth": 4.845, + "southcentralus": 4.701, + "southeastasia": 4.512, + "switzerlandnorth": 5.424, + "uksouth": 4.192, + "ukwest": 4.375, + "usgovarizona": 4.576, + "usgovtexas": 4.52, + "usgovvirginia": 4.576, + "westcentralus": 4.339, + "westeurope": 4.352, + "westus": 4.256, + "westus2": 3.616 + }, + "standardd64sv3": { + "australiacentral": 4.0, + "australiacentral2": 4.0, + "australiaeast": 4.0, + "australiasoutheast": 4.0, + "brazilsouth": 5.088, + "brazilsoutheast": 6.614, + "canadacentral": 3.552, + "canadaeast": 3.552, + "centralindia": 3.36, + "centralus": 3.52, + "eastasia": 4.224, + "eastus": 3.072, + "eastus2": 3.072, + "francecentral": 3.584, + "francesouth": 4.659, + "germanycentral": 4.148, + "germanynorth": 4.784, + "germanynortheast": 4.148, + "germanywestcentral": 3.68, + "japaneast": 4.128, + "japanwest": 4.128, + "koreacentral": 3.936, + "koreasouth": 3.544, + "northcentralus": 3.2, + "northeurope": 3.424, + "norwayeast": 4.224, + "norwaywest": 5.491, + "southafricanorth": 4.288, + "southafricawest": 5.376, + "southcentralus": 3.52, + "southeastasia": 4.0, + "southindia": 4.328, + "switzerlandnorth": 4.608, + "switzerlandwest": 5.99, + "uaecentral": 4.992, + "uaenorth": 3.84, + "uksouth": 3.712, + "ukwest": 3.712, + "usgovarizona": 4.032, + "usgovtexas": 4.032, + "usgovvirginia": 4.032, + "westcentralus": 3.52, + "westeurope": 3.84, + "westindia": 3.936, + "westus": 3.744, + "westus2": 3.072 + }, + "standardd64sv4": { + "australiaeast": 3.84, + "australiasoutheast": 3.994, + "brazilsouth": 4.896, + "brazilsoutheast": 6.364, + "canadacentral": 3.424, + "canadaeast": 3.424, + "centralindia": 3.232, + "centralus": 3.471, + "eastasia": 4.762, + "eastus": 3.072, + "eastus2": 3.072, + "francecentral": 3.584, + "francesouth": 4.669, + "germanywestcentral": 3.68, + "japaneast": 3.968, + "japanwest": 4.365, + "koreacentral": 3.776, + "northcentralus": 3.072, + "northeurope": 3.424, + "southafricanorth": 4.116, + "southcentralus": 3.686, + "southeastasia": 3.84, + "switzerlandnorth": 4.608, + "uksouth": 3.552, + "ukwest": 3.717, + "usgovarizona": 3.872, + "usgovtexas": 3.84, + "usgovvirginia": 3.872, + "westcentralus": 3.686, + "westeurope": 3.68, + "westus": 3.584, + "westus2": 3.072 + }, + "standardd64v3": { + "australiacentral": 4.0, + "australiacentral2": 4.0, + "australiaeast": 4.0, + "australiasoutheast": 4.0, + "brazilsouth": 5.088, + "brazilsoutheast": 6.614, + "canadacentral": 3.552, + "canadaeast": 3.552, + "centralindia": 3.36, + "centralus": 3.52, + "eastasia": 4.224, + "eastus": 3.072, + "eastus2": 3.072, + "francecentral": 3.584, + "francesouth": 4.659, + "germanycentral": 4.148, + "germanynorth": 4.784, + "germanynortheast": 4.148, + "germanywestcentral": 3.68, + "japaneast": 4.128, + "japanwest": 4.128, + "koreacentral": 3.936, + "koreasouth": 3.544, + "northcentralus": 3.2, + "northeurope": 3.424, + "norwayeast": 4.224, + "norwaywest": 5.491, + "southafricanorth": 4.288, + "southafricawest": 5.376, + "southcentralus": 3.52, + "southeastasia": 4.0, + "southindia": 4.328, + "switzerlandnorth": 4.608, + "switzerlandwest": 5.99, + "uaecentral": 4.992, + "uaenorth": 3.84, + "uksouth": 3.712, + "ukwest": 3.712, + "usgovarizona": 4.032, + "usgovtexas": 4.032, + "usgovvirginia": 4.032, + "westcentralus": 3.52, + "westeurope": 3.84, + "westindia": 3.936, + "westus": 3.744, + "westus2": 3.072 + }, + "standardd64v4": { + "australiaeast": 3.84, + "australiasoutheast": 3.994, + "brazilsouth": 4.896, + "brazilsoutheast": 6.364, + "canadacentral": 3.424, + "canadaeast": 3.424, + "centralindia": 3.232, + "centralus": 3.471, + "eastasia": 4.762, + "eastus": 3.072, + "eastus2": 3.072, + "francecentral": 3.584, + "francesouth": 4.669, + "germanywestcentral": 3.68, + "japaneast": 3.968, + "japanwest": 4.365, + "koreacentral": 3.776, + "northcentralus": 3.072, + "northeurope": 3.424, + "southafricanorth": 4.116, + "southcentralus": 3.686, + "southeastasia": 3.84, + "switzerlandnorth": 4.608, + "uksouth": 3.552, + "ukwest": 3.717, + "usgovarizona": 3.872, + "usgovtexas": 3.84, + "usgovvirginia": 3.872, + "westcentralus": 3.686, + "westeurope": 3.68, + "westus": 3.584, + "westus2": 3.072 + }, + "standardd96asv4": { + "australiaeast": 5.76, + "brazilsouth": 7.344, + "centralindia": 4.848, + "centralus": 5.207, + "eastasia": 6.336, + "eastus": 4.608, + "eastus2": 4.608, + "francecentral": 5.376, + "japaneast": 5.952, + "koreacentral": 5.664, + "northeurope": 5.136, + "southcentralus": 5.53, + "southeastasia": 5.76, + "uksouth": 5.328, + "westeurope": 5.52, + "westus": 5.376, + "westus2": 4.608 + }, + "standardd96av4": { + "australiaeast": 5.76, + "brazilsouth": 7.344, + "centralindia": 4.848, + "centralus": 5.207, + "eastasia": 6.336, + "eastus": 4.608, + "eastus2": 4.608, + "francecentral": 5.376, + "japaneast": 5.952, + "koreacentral": 5.664, + "northeurope": 5.136, + "southcentralus": 5.53, + "southeastasia": 5.76, + "uksouth": 5.328, + "westeurope": 5.52, + "westus": 5.376, + "westus2": 4.608 + }, + "standarddc1sv2": { + "canadacentral": 0.237, + "canadaeast": 0.237, + "centralus": 0.243, + "eastus": 0.198, + "southeastasia": 0.257, + "uksouth": 0.247, + "westeurope": 0.257, + "westus2": 0.198 + }, + "standarddc2s": { + "centralus": 0.474, + "eastus": 0.198, + "westeurope": 0.257 + }, + "standarddc2sv2": { + "canadacentral": 0.474, + "canadaeast": 0.474, + "eastus": 0.395, + "southeastasia": 0.514, + "uksouth": 0.494, + "westeurope": 0.514, + "westus2": 0.395 + }, + "standarddc4s": { + "centralus": 0.949, + "eastus": 0.395, + "westeurope": 0.514 + }, + "standarddc4sv2": { + "canadacentral": 0.949, + "canadaeast": 0.949, + "eastus": 0.791, + "southeastasia": 1.028, + "uksouth": 0.988, + "westeurope": 1.028, + "westus2": 0.791 + }, + "standarddc8sv2": { + "canadacentral": 1.898, + "canadaeast": 1.898, + "centralus": 1.945, + "eastus": 1.582, + "southeastasia": 2.056, + "uksouth": 1.977, + "westeurope": 2.056, + "westus2": 1.582 + }, + "standardds1v2": { + "australiacentral": 0.084, + "australiacentral2": 0.084, + "australiaeast": 0.084, + "australiasoutheast": 0.0778, + "brazilsouth": 0.0856, + "brazilsoutheast": 0.111, + "canadacentral": 0.07, + "canadaeast": 0.07, + "centralindia": 0.084, + "centralus": 0.073, + "eastasia": 0.107, + "eastus": 0.073, + "eastus2": 0.057, + "francecentral": 0.0877, + "francesouth": 0.114, + "germanycentral": 0.076, + "germanynorth": 0.0871, + "germanynortheast": 0.076, + "germanywestcentral": 0.067, + "japaneast": 0.102, + "japanwest": 0.091, + "koreacentral": 0.0825, + "koreasouth": 0.074, + "northcentralus": 0.073, + "northeurope": 0.0658, + "norwayeast": 0.0747, + "norwaywest": 0.0971, + "southafricanorth": 0.0767, + "southafricawest": 0.0962, + "southcentralus": 0.0636, + "southeastasia": 0.0789, + "southindia": 0.084, + "switzerlandnorth": 0.0816, + "switzerlandwest": 0.106, + "uaecentral": 0.0893, + "uaenorth": 0.0687, + "uksouth": 0.0878, + "ukwest": 0.0877, + "usgovarizona": 0.071, + "usgovtexas": 0.071, + "usgovvirginia": 0.071, + "westcentralus": 0.0636, + "westeurope": 0.0679, + "westindia": 0.084, + "westus": 0.07, + "westus2": 0.057 + }, + "standardds2v2": { + "australiacentral": 0.168, + "australiacentral2": 0.168, + "australiaeast": 0.168, + "australiasoutheast": 0.15576, + "brazilsouth": 0.171, + "brazilsoutheast": 0.223, + "canadacentral": 0.14, + "canadaeast": 0.14, + "centralindia": 0.169, + "centralus": 0.146, + "eastasia": 0.214, + "eastus": 0.146, + "eastus2": 0.114, + "francecentral": 0.175, + "francesouth": 0.228, + "germanycentral": 0.153, + "germanynorth": 0.174, + "germanynortheast": 0.153, + "germanywestcentral": 0.133, + "japaneast": 0.205, + "japanwest": 0.182, + "koreacentral": 0.165, + "koreasouth": 0.149, + "northcentralus": 0.146, + "northeurope": 0.132, + "norwayeast": 0.15, + "norwaywest": 0.194, + "southafricanorth": 0.153, + "southafricawest": 0.192, + "southcentralus": 0.127, + "southeastasia": 0.158, + "southindia": 0.169, + "switzerlandnorth": 0.163, + "switzerlandwest": 0.212, + "uaecentral": 0.178, + "uaenorth": 0.137, + "uksouth": 0.176, + "ukwest": 0.175, + "usgovarizona": 0.143, + "usgovtexas": 0.143, + "usgovvirginia": 0.143, + "westcentralus": 0.127, + "westeurope": 0.136, + "westindia": 0.169, + "westus": 0.14, + "westus2": 0.114 + }, + "standardds3v2": { + "australiacentral": 0.336, + "australiacentral2": 0.336, + "australiaeast": 0.336, + "australiasoutheast": 0.311, + "brazilsouth": 0.343, + "brazilsoutheast": 0.445, + "canadacentral": 0.28, + "canadaeast": 0.28, + "centralindia": 0.337, + "centralus": 0.293, + "eastasia": 0.428, + "eastus": 0.293, + "eastus2": 0.229, + "francecentral": 0.351, + "francesouth": 0.456, + "germanycentral": 0.306, + "germanynorth": 0.348, + "germanynortheast": 0.306, + "germanywestcentral": 0.266, + "japaneast": 0.409, + "japanwest": 0.365, + "koreacentral": 0.33, + "koreasouth": 0.297, + "northcentralus": 0.293, + "northeurope": 0.263, + "norwayeast": 0.299, + "norwaywest": 0.389, + "southafricanorth": 0.307, + "southafricawest": 0.385, + "southcentralus": 0.254, + "southeastasia": 0.316, + "southindia": 0.337, + "switzerlandnorth": 0.326, + "switzerlandwest": 0.424, + "uaecentral": 0.357, + "uaenorth": 0.275, + "uksouth": 0.351, + "ukwest": 0.351, + "usgovarizona": 0.285, + "usgovtexas": 0.285, + "usgovvirginia": 0.285, + "westcentralus": 0.254, + "westeurope": 0.272, + "westindia": 0.337, + "westus": 0.279, + "westus2": 0.229 + }, + "standardds4v2": { + "australiacentral": 0.673, + "australiacentral2": 0.673, + "australiaeast": 0.673, + "australiasoutheast": 0.623, + "brazilsouth": 0.685, + "brazilsoutheast": 0.89, + "canadacentral": 0.56, + "canadaeast": 0.56, + "centralindia": 0.675, + "centralus": 0.585, + "eastasia": 0.857, + "eastus": 0.585, + "eastus2": 0.458, + "francecentral": 0.702, + "francesouth": 0.912, + "germanycentral": 0.612, + "germanynorth": 0.697, + "germanynortheast": 0.612, + "germanywestcentral": 0.532, + "japaneast": 0.818, + "japanwest": 0.729, + "koreacentral": 0.66, + "koreasouth": 0.594, + "northcentralus": 0.585, + "northeurope": 0.527, + "norwayeast": 0.598, + "norwaywest": 0.778, + "southafricanorth": 0.614, + "southafricawest": 0.769, + "southcentralus": 0.509, + "southeastasia": 0.631, + "southindia": 0.675, + "switzerlandnorth": 0.653, + "switzerlandwest": 0.849, + "uaecentral": 0.714, + "uaenorth": 0.55, + "uksouth": 0.702, + "ukwest": 0.702, + "usgovarizona": 0.571, + "usgovtexas": 0.571, + "usgovvirginia": 0.571, + "westcentralus": 0.509, + "westeurope": 0.544, + "westindia": 0.675, + "westus": 0.559, + "westus2": 0.458 + }, + "standardds5v2": { + "australiacentral": 1.345, + "australiacentral2": 1.345, + "australiaeast": 1.345, + "australiasoutheast": 1.246, + "brazilsouth": 1.37, + "brazilsoutheast": 1.78, + "canadacentral": 1.12, + "canadaeast": 1.12, + "centralindia": 1.35, + "centralus": 1.17, + "eastasia": 1.714, + "eastus": 1.17, + "eastus2": 0.916, + "francecentral": 1.404, + "francesouth": 1.824, + "germanycentral": 1.224, + "germanynorth": 1.394, + "germanynortheast": 1.224, + "germanywestcentral": 1.064, + "japaneast": 1.636, + "japanwest": 1.459, + "koreacentral": 1.321, + "koreasouth": 1.189, + "northcentralus": 1.17, + "northeurope": 1.053, + "norwayeast": 1.196, + "norwaywest": 1.554, + "southafricanorth": 1.227, + "southafricawest": 1.539, + "southcentralus": 1.017, + "southeastasia": 1.263, + "southindia": 1.35, + "switzerlandnorth": 1.306, + "switzerlandwest": 1.697, + "uaecentral": 1.429, + "uaenorth": 1.099, + "uksouth": 1.405, + "ukwest": 1.404, + "usgovarizona": 1.142, + "usgovtexas": 1.142, + "usgovvirginia": 1.142, + "westcentralus": 1.017, + "westeurope": 1.087, + "westindia": 1.35, + "westus": 1.117, + "westus2": 0.916 + }, + "standardds11v2": { + "australiacentral": 0.2, + "australiacentral2": 0.2, + "australiaeast": 0.2, + "australiasoutheast": 0.2, + "brazilsouth": 0.235, + "brazilsoutheast": 0.306, + "canadacentral": 0.183, + "canadaeast": 0.183, + "centralindia": 0.189, + "centralus": 0.185, + "eastasia": 0.229, + "eastus": 0.185, + "eastus2": 0.149, + "francecentral": 0.234, + "francesouth": 0.304, + "germanycentral": 0.222, + "germanynorth": 0.216, + "germanynortheast": 0.222, + "germanywestcentral": 0.166, + "japaneast": 0.229, + "japanwest": 0.2, + "koreacentral": 0.2, + "koreasouth": 0.179, + "northcentralus": 0.185, + "northeurope": 0.185, + "norwayeast": 0.209, + "norwaywest": 0.272, + "southafricanorth": 0.2, + "southafricawest": 0.251, + "southcentralus": 0.166, + "southeastasia": 0.191, + "southindia": 0.189, + "switzerlandnorth": 0.228, + "switzerlandwest": 0.296, + "uaecentral": 0.233, + "uaenorth": 0.179, + "uksouth": 0.234, + "ukwest": 0.234, + "usgovarizona": 0.186, + "usgovtexas": 0.186, + "usgovvirginia": 0.186, + "westcentralus": 0.166, + "westeurope": 0.19, + "westindia": 0.189, + "westus": 0.185, + "westus2": 0.149 + }, + "standardds12v2": { + "australiacentral": 0.399, + "australiacentral2": 0.399, + "australiaeast": 0.399, + "australiasoutheast": 0.399, + "brazilsouth": 0.47, + "brazilsoutheast": 0.611, + "canadacentral": 0.366, + "canadaeast": 0.366, + "centralindia": 0.379, + "centralus": 0.371, + "eastasia": 0.459, + "eastus": 0.371, + "eastus2": 0.299, + "francecentral": 0.469, + "francesouth": 0.608, + "germanycentral": 0.445, + "germanynorth": 0.432, + "germanynortheast": 0.445, + "germanywestcentral": 0.332, + "japaneast": 0.459, + "japanwest": 0.399, + "koreacentral": 0.399, + "koreasouth": 0.359, + "northcentralus": 0.37, + "northeurope": 0.371, + "norwayeast": 0.417, + "norwaywest": 0.542, + "southafricanorth": 0.401, + "southafricawest": 0.502, + "southcentralus": 0.332, + "southeastasia": 0.382, + "southindia": 0.379, + "switzerlandnorth": 0.456, + "switzerlandwest": 0.593, + "uaecentral": 0.466, + "uaenorth": 0.359, + "uksouth": 0.469, + "ukwest": 0.469, + "usgovarizona": 0.373, + "usgovtexas": 0.373, + "usgovvirginia": 0.373, + "westcentralus": 0.332, + "westeurope": 0.379, + "westindia": 0.379, + "westus": 0.37, + "westus2": 0.299 + }, + "standardds13v2": { + "australiacentral": 0.798, + "australiacentral2": 0.798, + "australiaeast": 0.798, + "australiasoutheast": 0.798, + "brazilsouth": 0.94, + "brazilsoutheast": 1.222, + "canadacentral": 0.732, + "canadaeast": 0.732, + "centralindia": 0.758, + "centralus": 0.741, + "eastasia": 0.918, + "eastus": 0.741, + "eastus2": 0.598, + "francecentral": 0.937, + "francesouth": 1.217, + "germanycentral": 0.889, + "germanynorth": 0.863, + "germanynortheast": 0.889, + "germanywestcentral": 0.664, + "japaneast": 0.918, + "japanwest": 0.798, + "koreacentral": 0.798, + "koreasouth": 0.718, + "northcentralus": 0.741, + "northeurope": 0.741, + "norwayeast": 0.835, + "norwaywest": 1.085, + "southafricanorth": 0.801, + "southafricawest": 1.005, + "southcentralus": 0.665, + "southeastasia": 0.765, + "southindia": 0.758, + "switzerlandnorth": 0.912, + "switzerlandwest": 1.186, + "uaecentral": 0.933, + "uaenorth": 0.718, + "uksouth": 0.937, + "ukwest": 0.937, + "usgovarizona": 0.746, + "usgovtexas": 0.746, + "usgovvirginia": 0.746, + "westcentralus": 0.665, + "westeurope": 0.759, + "westindia": 0.758, + "westus": 0.741, + "westus2": 0.598 + }, + "standardds14v2": { + "australiacentral": 1.596, + "australiacentral2": 1.596, + "australiaeast": 1.596, + "australiasoutheast": 1.596, + "brazilsouth": 1.879, + "brazilsoutheast": 2.443, + "canadacentral": 1.463, + "canadaeast": 1.463, + "centralindia": 1.516, + "centralus": 1.482, + "eastasia": 1.835, + "eastus": 1.482, + "eastus2": 1.196, + "francecentral": 1.874, + "francesouth": 2.434, + "germanycentral": 1.778, + "germanynorth": 1.726, + "germanynortheast": 1.778, + "germanywestcentral": 1.328, + "japaneast": 1.835, + "japanwest": 1.596, + "koreacentral": 1.596, + "koreasouth": 1.435, + "northcentralus": 1.482, + "northeurope": 1.482, + "norwayeast": 1.67, + "norwaywest": 2.171, + "southafricanorth": 1.603, + "southafricawest": 2.009, + "southcentralus": 1.33, + "southeastasia": 1.53, + "southindia": 1.516, + "switzerlandnorth": 1.824, + "switzerlandwest": 2.371, + "uaecentral": 1.866, + "uaenorth": 1.435, + "uksouth": 1.874, + "ukwest": 1.874, + "usgovarizona": 1.491, + "usgovtexas": 1.491, + "usgovvirginia": 1.491, + "westcentralus": 1.33, + "westeurope": 1.518, + "westindia": 1.516, + "westus": 1.482, + "westus2": 1.196 + }, + "standardds15iv2": { + "australiacentral": 1.995, + "australiacentral2": 1.995, + "australiaeast": 1.995, + "australiasoutheast": 1.995, + "brazilsouth": 2.349, + "brazilsoutheast": 3.054, + "canadacentral": 1.829, + "canadaeast": 1.829, + "centralindia": 1.895, + "centralus": 1.853, + "eastasia": 2.294, + "eastus": 1.853, + "eastus2": 1.495, + "francecentral": 2.343, + "francesouth": 3.042, + "germanynorth": 2.158, + "germanywestcentral": 1.66, + "japaneast": 2.294, + "japanwest": 1.995, + "koreacentral": 1.995, + "koreasouth": 1.794, + "northcentralus": 1.852, + "northeurope": 1.853, + "norwayeast": 2.087, + "norwaywest": 2.713, + "southafricanorth": 2.003, + "southafricawest": 2.512, + "southcentralus": 1.662, + "southeastasia": 1.912, + "southindia": 1.895, + "switzerlandnorth": 2.28, + "switzerlandwest": 2.964, + "uaecentral": 2.332, + "uaenorth": 1.794, + "uksouth": 2.343, + "ukwest": 2.343, + "usgovarizona": 1.864, + "usgovtexas": 1.864, + "usgovvirginia": 1.864, + "westcentralus": 1.662, + "westeurope": 1.897, + "westindia": 1.895, + "westus": 1.852, + "westus2": 1.495 + }, + "standardds15v2": { + "australiacentral": 1.995, + "australiacentral2": 1.995, + "australiaeast": 1.995, + "australiasoutheast": 1.995, + "brazilsouth": 2.349, + "brazilsoutheast": 3.054, + "canadacentral": 1.829, + "canadaeast": 1.829, + "centralindia": 1.895, + "centralus": 1.853, + "eastasia": 2.294, + "eastus": 1.853, + "eastus2": 1.495, + "francecentral": 2.343, + "francesouth": 3.042, + "germanycentral": 2.223, + "germanynorth": 2.158, + "germanynortheast": 2.223, + "germanywestcentral": 1.66, + "japaneast": 2.294, + "japanwest": 1.995, + "koreacentral": 1.995, + "koreasouth": 1.794, + "northcentralus": 1.852, + "northeurope": 1.853, + "norwayeast": 2.087, + "norwaywest": 2.713, + "southafricanorth": 2.003, + "southafricawest": 2.512, + "southcentralus": 1.662, + "southeastasia": 1.912, + "southindia": 1.895, + "switzerlandnorth": 2.28, + "switzerlandwest": 2.964, + "uaecentral": 2.332, + "uaenorth": 1.794, + "uksouth": 2.343, + "ukwest": 2.343, + "usgovarizona": 1.864, + "usgovtexas": 1.864, + "usgovvirginia": 1.864, + "westcentralus": 1.662, + "westeurope": 1.897, + "westindia": 1.895, + "westus": 1.852, + "westus2": 1.495 + }, + "standarde2asv4": { + "australiaeast": 0.151, + "brazilsouth": 0.201, + "centralindia": 0.13, + "centralus": 0.142, + "eastasia": 0.167, + "eastus": 0.126, + "eastus2": 0.126, + "francecentral": 0.148, + "japaneast": 0.152, + "koreacentral": 0.152, + "northeurope": 0.141, + "southcentralus": 0.151, + "southeastasia": 0.152, + "uksouth": 0.148, + "westeurope": 0.152, + "westus": 0.14, + "westus2": 0.126 + }, + "standarde2av4": { + "australiaeast": 0.151, + "brazilsouth": 0.201, + "centralindia": 0.13, + "centralus": 0.142, + "eastasia": 0.167, + "eastus": 0.126, + "eastus2": 0.126, + "francecentral": 0.148, + "japaneast": 0.152, + "koreacentral": 0.152, + "northeurope": 0.141, + "southcentralus": 0.151, + "southeastasia": 0.152, + "uksouth": 0.148, + "westeurope": 0.152, + "westus": 0.14, + "westus2": 0.126 + }, + "standarde2dsv4": { + "australiaeast": 0.174, + "australiasoutheast": 0.173, + "brazilsouth": 0.229, + "canadacentral": 0.158, + "canadaeast": 0.173, + "centralindia": 0.151, + "centralus": 0.163, + "eastasia": 0.223, + "eastus": 0.144, + "eastus2": 0.144, + "francecentral": 0.169, + "francesouth": 0.219, + "germanywestcentral": 0.173, + "japaneast": 0.174, + "japanwest": 0.191, + "koreacentral": 0.173, + "northcentralus": 0.144, + "northeurope": 0.16, + "southafricanorth": 0.193, + "southcentralus": 0.187, + "southeastasia": 0.174, + "switzerlandnorth": 0.216, + "uksouth": 0.169, + "ukwest": 0.174, + "usgovarizona": 0.173, + "usgovtexas": 0.18, + "usgovvirginia": 0.173, + "westcentralus": 0.173, + "westeurope": 0.173, + "westus": 0.162, + "westus2": 0.144 + }, + "standarde2dv4": { + "australiaeast": 0.174, + "australiasoutheast": 0.173, + "brazilsouth": 0.229, + "canadacentral": 0.158, + "canadaeast": 0.173, + "centralindia": 0.151, + "centralus": 0.163, + "eastasia": 0.223, + "eastus": 0.144, + "eastus2": 0.144, + "francecentral": 0.169, + "francesouth": 0.219, + "germanywestcentral": 0.173, + "japaneast": 0.174, + "japanwest": 0.191, + "koreacentral": 0.173, + "northcentralus": 0.144, + "northeurope": 0.16, + "southafricanorth": 0.193, + "southcentralus": 0.187, + "southeastasia": 0.174, + "switzerlandnorth": 0.216, + "uksouth": 0.169, + "ukwest": 0.174, + "usgovarizona": 0.173, + "usgovtexas": 0.18, + "usgovvirginia": 0.173, + "westcentralus": 0.173, + "westeurope": 0.173, + "westus": 0.162, + "westus2": 0.144 + }, + "standarde2sv3": { + "australiacentral": 0.16, + "australiacentral2": 0.16, + "australiaeast": 0.16, + "australiasoutheast": 0.16, + "brazilsouth": 0.235, + "brazilsoutheast": 0.306, + "canadacentral": 0.146, + "canadaeast": 0.146, + "centralindia": 0.137, + "centralus": 0.146, + "eastasia": 0.167, + "eastus": 0.126, + "eastus2": 0.133, + "francecentral": 0.156, + "francesouth": 0.2028, + "germanycentral": 0.173, + "germanynorth": 0.198, + "germanynortheast": 0.173, + "germanywestcentral": 0.152, + "japaneast": 0.16, + "japanwest": 0.16, + "koreacentral": 0.16, + "koreasouth": 0.144, + "northcentralus": 0.126, + "northeurope": 0.141, + "norwayeast": 0.176, + "norwaywest": 0.229, + "southafricanorth": 0.169, + "southafricawest": 0.212, + "southcentralus": 0.146, + "southeastasia": 0.16, + "southindia": 0.167, + "switzerlandnorth": 0.192, + "switzerlandwest": 0.25, + "uaecentral": 0.196, + "uaenorth": 0.151, + "uksouth": 0.156, + "ukwest": 0.156, + "usgovarizona": 0.16, + "usgovtexas": 0.16, + "usgovvirginia": 0.16, + "westcentralus": 0.146, + "westeurope": 0.16, + "westindia": 0.152, + "westus": 0.148, + "westus2": 0.126 + }, + "standarde2sv4": { + "australiaeast": 0.151, + "australiasoutheast": 0.164, + "brazilsouth": 0.201, + "brazilsoutheast": 0.261, + "canadacentral": 0.138, + "canadaeast": 0.138, + "centralindia": 0.13, + "centralus": 0.142, + "eastasia": 0.195, + "eastus": 0.126, + "eastus2": 0.126, + "francecentral": 0.148, + "francesouth": 0.192, + "germanywestcentral": 0.152, + "japaneast": 0.152, + "japanwest": 0.167, + "koreacentral": 0.152, + "northcentralus": 0.126, + "northeurope": 0.141, + "southafricanorth": 0.169, + "southcentralus": 0.151, + "southeastasia": 0.152, + "switzerlandnorth": 0.189, + "uksouth": 0.148, + "ukwest": 0.152, + "usgovarizona": 0.151, + "usgovtexas": 0.158, + "usgovvirginia": 0.151, + "westcentralus": 0.151, + "westeurope": 0.152, + "westus": 0.14, + "westus2": 0.126 + }, + "standarde2v3": { + "australiacentral": 0.16, + "australiacentral2": 0.16, + "australiaeast": 0.16, + "australiasoutheast": 0.16, + "brazilsouth": 0.235, + "brazilsoutheast": 0.306, + "canadacentral": 0.146, + "canadaeast": 0.146, + "centralindia": 0.137, + "centralus": 0.146, + "eastasia": 0.167, + "eastus": 0.126, + "eastus2": 0.133, + "francecentral": 0.156, + "francesouth": 0.2028, + "germanycentral": 0.173, + "germanynorth": 0.198, + "germanynortheast": 0.173, + "germanywestcentral": 0.152, + "japaneast": 0.16, + "japanwest": 0.16, + "koreacentral": 0.16, + "koreasouth": 0.144, + "northcentralus": 0.126, + "northeurope": 0.141, + "norwayeast": 0.176, + "norwaywest": 0.229, + "southafricanorth": 0.169, + "southafricawest": 0.212, + "southcentralus": 0.146, + "southeastasia": 0.16, + "southindia": 0.167, + "switzerlandnorth": 0.192, + "switzerlandwest": 0.25, + "uaecentral": 0.196, + "uaenorth": 0.151, + "uksouth": 0.156, + "ukwest": 0.156, + "usgovarizona": 0.16, + "usgovtexas": 0.16, + "usgovvirginia": 0.16, + "westcentralus": 0.146, + "westeurope": 0.16, + "westindia": 0.152, + "westus": 0.148, + "westus2": 0.126 + }, + "standarde2v4": { + "australiaeast": 0.151, + "australiasoutheast": 0.164, + "brazilsouth": 0.201, + "brazilsoutheast": 0.261, + "canadacentral": 0.138, + "canadaeast": 0.138, + "centralindia": 0.13, + "centralus": 0.142, + "eastasia": 0.195, + "eastus": 0.126, + "eastus2": 0.126, + "francecentral": 0.148, + "francesouth": 0.192, + "germanywestcentral": 0.152, + "japaneast": 0.152, + "japanwest": 0.167, + "koreacentral": 0.152, + "northcentralus": 0.126, + "northeurope": 0.141, + "southafricanorth": 0.169, + "southcentralus": 0.151, + "southeastasia": 0.152, + "switzerlandnorth": 0.189, + "uksouth": 0.148, + "ukwest": 0.152, + "usgovarizona": 0.151, + "usgovtexas": 0.158, + "usgovvirginia": 0.151, + "westcentralus": 0.151, + "westeurope": 0.152, + "westus": 0.14, + "westus2": 0.126 + }, + "standarde4asv4": { + "australiaeast": 0.302, + "brazilsouth": 0.402, + "centralindia": 0.26, + "centralus": 0.285, + "eastasia": 0.334, + "eastus": 0.252, + "eastus2": 0.252, + "francecentral": 0.296, + "japaneast": 0.304, + "koreacentral": 0.304, + "northeurope": 0.282, + "southcentralus": 0.302, + "southeastasia": 0.304, + "uksouth": 0.296, + "westeurope": 0.304, + "westus": 0.28, + "westus2": 0.252 + }, + "standarde4av4": { + "australiaeast": 0.302, + "brazilsouth": 0.402, + "centralindia": 0.26, + "centralus": 0.285, + "eastasia": 0.334, + "eastus": 0.252, + "eastus2": 0.252, + "francecentral": 0.296, + "japaneast": 0.304, + "koreacentral": 0.304, + "northeurope": 0.282, + "southcentralus": 0.302, + "southeastasia": 0.304, + "uksouth": 0.296, + "westeurope": 0.304, + "westus": 0.28, + "westus2": 0.252 + }, + "standarde4dsv4": { + "australiaeast": 0.348, + "australiasoutheast": 0.346, + "brazilsouth": 0.457, + "canadacentral": 0.316, + "canadaeast": 0.346, + "centralindia": 0.302, + "centralus": 0.325, + "eastasia": 0.446, + "eastus": 0.288, + "eastus2": 0.288, + "francecentral": 0.338, + "francesouth": 0.438, + "germanywestcentral": 0.346, + "japaneast": 0.348, + "japanwest": 0.382, + "koreacentral": 0.346, + "northcentralus": 0.288, + "northeurope": 0.32, + "southafricanorth": 0.386, + "southcentralus": 0.374, + "southeastasia": 0.348, + "switzerlandnorth": 0.432, + "uksouth": 0.338, + "ukwest": 0.348, + "usgovarizona": 0.346, + "usgovtexas": 0.36, + "usgovvirginia": 0.346, + "westcentralus": 0.346, + "westeurope": 0.346, + "westus": 0.324, + "westus2": 0.288 + }, + "standarde4dv4": { + "australiaeast": 0.348, + "australiasoutheast": 0.346, + "brazilsouth": 0.457, + "canadacentral": 0.316, + "canadaeast": 0.346, + "centralindia": 0.302, + "centralus": 0.325, + "eastasia": 0.446, + "eastus": 0.288, + "eastus2": 0.288, + "francecentral": 0.338, + "francesouth": 0.438, + "germanywestcentral": 0.346, + "japaneast": 0.348, + "japanwest": 0.382, + "koreacentral": 0.346, + "northcentralus": 0.288, + "northeurope": 0.32, + "southafricanorth": 0.386, + "southcentralus": 0.374, + "southeastasia": 0.348, + "switzerlandnorth": 0.432, + "uksouth": 0.338, + "ukwest": 0.348, + "usgovarizona": 0.346, + "usgovtexas": 0.36, + "usgovvirginia": 0.346, + "westcentralus": 0.346, + "westeurope": 0.346, + "westus": 0.324, + "westus2": 0.288 + }, + "standarde4sv3": { + "australiacentral": 0.319, + "australiacentral2": 0.319, + "australiaeast": 0.319, + "australiasoutheast": 0.319, + "brazilsouth": 0.47, + "brazilsoutheast": 0.611, + "canadacentral": 0.292, + "canadaeast": 0.292, + "centralindia": 0.274, + "centralus": 0.292, + "eastasia": 0.334, + "eastus": 0.252, + "eastus2": 0.266, + "francecentral": 0.312, + "francesouth": 0.4056, + "germanycentral": 0.346, + "germanynorth": 0.395, + "germanynortheast": 0.346, + "germanywestcentral": 0.304, + "japaneast": 0.32, + "japanwest": 0.32, + "koreacentral": 0.32, + "koreasouth": 0.288, + "northcentralus": 0.252, + "northeurope": 0.282, + "norwayeast": 0.352, + "norwaywest": 0.458, + "southafricanorth": 0.338, + "southafricawest": 0.423, + "southcentralus": 0.292, + "southeastasia": 0.32, + "southindia": 0.334, + "switzerlandnorth": 0.384, + "switzerlandwest": 0.499, + "uaecentral": 0.393, + "uaenorth": 0.302, + "uksouth": 0.312, + "ukwest": 0.312, + "usgovarizona": 0.319, + "usgovtexas": 0.319, + "usgovvirginia": 0.319, + "westcentralus": 0.292, + "westeurope": 0.32, + "westindia": 0.304, + "westus": 0.296, + "westus2": 0.252 + }, + "standarde4sv4": { + "australiaeast": 0.302, + "australiasoutheast": 0.328, + "brazilsouth": 0.402, + "brazilsoutheast": 0.523, + "canadacentral": 0.276, + "canadaeast": 0.276, + "centralindia": 0.26, + "centralus": 0.285, + "eastasia": 0.391, + "eastus": 0.252, + "eastus2": 0.252, + "francecentral": 0.296, + "francesouth": 0.383, + "germanywestcentral": 0.304, + "japaneast": 0.304, + "japanwest": 0.334, + "koreacentral": 0.304, + "northcentralus": 0.252, + "northeurope": 0.282, + "southafricanorth": 0.338, + "southcentralus": 0.302, + "southeastasia": 0.304, + "switzerlandnorth": 0.378, + "uksouth": 0.296, + "ukwest": 0.305, + "usgovarizona": 0.302, + "usgovtexas": 0.315, + "usgovvirginia": 0.302, + "westcentralus": 0.302, + "westeurope": 0.304, + "westus": 0.28, + "westus2": 0.252 + }, + "standarde4v3": { + "australiacentral": 0.319, + "australiacentral2": 0.319, + "australiaeast": 0.319, + "australiasoutheast": 0.319, + "brazilsouth": 0.47, + "brazilsoutheast": 0.611, + "canadacentral": 0.292, + "canadaeast": 0.292, + "centralindia": 0.274, + "centralus": 0.292, + "eastasia": 0.334, + "eastus": 0.252, + "eastus2": 0.266, + "francecentral": 0.312, + "francesouth": 0.4056, + "germanycentral": 0.346, + "germanynorth": 0.395, + "germanynortheast": 0.346, + "germanywestcentral": 0.304, + "japaneast": 0.32, + "japanwest": 0.32, + "koreacentral": 0.32, + "koreasouth": 0.288, + "northcentralus": 0.252, + "northeurope": 0.282, + "norwayeast": 0.352, + "norwaywest": 0.458, + "southafricanorth": 0.338, + "southafricawest": 0.423, + "southcentralus": 0.292, + "southeastasia": 0.32, + "southindia": 0.334, + "switzerlandnorth": 0.384, + "switzerlandwest": 0.499, + "uaecentral": 0.393, + "uaenorth": 0.302, + "uksouth": 0.312, + "ukwest": 0.312, + "usgovarizona": 0.319, + "usgovtexas": 0.319, + "usgovvirginia": 0.319, + "westcentralus": 0.292, + "westeurope": 0.32, + "westindia": 0.304, + "westus": 0.296, + "westus2": 0.252 + }, + "standarde4v4": { + "australiaeast": 0.302, + "australiasoutheast": 0.328, + "brazilsouth": 0.402, + "brazilsoutheast": 0.523, + "canadacentral": 0.276, + "canadaeast": 0.276, + "centralindia": 0.26, + "centralus": 0.285, + "eastasia": 0.391, + "eastus": 0.252, + "eastus2": 0.252, + "francecentral": 0.296, + "francesouth": 0.383, + "germanywestcentral": 0.304, + "japaneast": 0.304, + "japanwest": 0.334, + "koreacentral": 0.304, + "northcentralus": 0.252, + "northeurope": 0.282, + "southafricanorth": 0.338, + "southcentralus": 0.302, + "southeastasia": 0.304, + "switzerlandnorth": 0.378, + "uksouth": 0.296, + "ukwest": 0.305, + "usgovarizona": 0.302, + "usgovtexas": 0.315, + "usgovvirginia": 0.302, + "westcentralus": 0.302, + "westeurope": 0.304, + "westus": 0.28, + "westus2": 0.252 + }, + "standarde8asv4": { + "australiaeast": 0.604, + "brazilsouth": 0.804, + "centralindia": 0.52, + "centralus": 0.57, + "eastasia": 0.668, + "eastus": 0.504, + "eastus2": 0.504, + "francecentral": 0.592, + "japaneast": 0.608, + "koreacentral": 0.608, + "northeurope": 0.564, + "southcentralus": 0.605, + "southeastasia": 0.608, + "uksouth": 0.592, + "westeurope": 0.608, + "westus": 0.56, + "westus2": 0.504 + }, + "standarde8av4": { + "australiaeast": 0.604, + "brazilsouth": 0.804, + "centralindia": 0.52, + "centralus": 0.57, + "eastasia": 0.668, + "eastus": 0.504, + "eastus2": 0.504, + "francecentral": 0.592, + "japaneast": 0.608, + "koreacentral": 0.608, + "northeurope": 0.564, + "southcentralus": 0.605, + "southeastasia": 0.608, + "uksouth": 0.592, + "westeurope": 0.608, + "westus": 0.56, + "westus2": 0.504 + }, + "standarde8dsv4": { + "australiaeast": 0.696, + "australiasoutheast": 0.691, + "brazilsouth": 0.915, + "canadacentral": 0.632, + "canadaeast": 0.691, + "centralindia": 0.604, + "centralus": 0.651, + "eastasia": 0.893, + "eastus": 0.576, + "eastus2": 0.576, + "francecentral": 0.676, + "francesouth": 0.876, + "germanywestcentral": 0.692, + "japaneast": 0.696, + "japanwest": 0.764, + "koreacentral": 0.692, + "northcentralus": 0.576, + "northeurope": 0.64, + "southafricanorth": 0.772, + "southcentralus": 0.749, + "southeastasia": 0.696, + "switzerlandnorth": 0.864, + "uksouth": 0.676, + "ukwest": 0.697, + "usgovarizona": 0.692, + "usgovtexas": 0.72, + "usgovvirginia": 0.692, + "westcentralus": 0.691, + "westeurope": 0.692, + "westus": 0.648, + "westus2": 0.576 + }, + "standarde8dv4": { + "australiaeast": 0.696, + "australiasoutheast": 0.691, + "brazilsouth": 0.915, + "canadacentral": 0.632, + "canadaeast": 0.691, + "centralindia": 0.604, + "centralus": 0.651, + "eastasia": 0.893, + "eastus": 0.576, + "eastus2": 0.576, + "francecentral": 0.676, + "francesouth": 0.876, + "germanywestcentral": 0.692, + "japaneast": 0.696, + "japanwest": 0.764, + "koreacentral": 0.692, + "northcentralus": 0.576, + "northeurope": 0.64, + "southafricanorth": 0.772, + "southcentralus": 0.749, + "southeastasia": 0.696, + "switzerlandnorth": 0.864, + "uksouth": 0.676, + "ukwest": 0.697, + "usgovarizona": 0.692, + "usgovtexas": 0.72, + "usgovvirginia": 0.692, + "westcentralus": 0.691, + "westeurope": 0.692, + "westus": 0.648, + "westus2": 0.576 + }, + "standarde8sv3": { + "australiacentral": 0.638, + "australiacentral2": 0.638, + "australiaeast": 0.638, + "australiasoutheast": 0.638, + "brazilsouth": 0.94, + "brazilsoutheast": 1.222, + "canadacentral": 0.584, + "canadaeast": 0.584, + "centralindia": 0.548, + "centralus": 0.583, + "eastasia": 0.668, + "eastus": 0.504, + "eastus2": 0.532, + "francecentral": 0.624, + "francesouth": 0.81, + "germanycentral": 0.691, + "germanynorth": 0.79, + "germanynortheast": 0.691, + "germanywestcentral": 0.608, + "japaneast": 0.64, + "japanwest": 0.64, + "koreacentral": 0.64, + "koreasouth": 0.576, + "northcentralus": 0.504, + "northeurope": 0.564, + "norwayeast": 0.704, + "norwaywest": 0.915, + "southafricanorth": 0.675, + "southafricawest": 0.847, + "southcentralus": 0.583, + "southeastasia": 0.64, + "southindia": 0.667, + "switzerlandnorth": 0.768, + "switzerlandwest": 0.998, + "uaecentral": 0.786, + "uaenorth": 0.605, + "uksouth": 0.624, + "ukwest": 0.624, + "usgovarizona": 0.638, + "usgovtexas": 0.638, + "usgovvirginia": 0.638, + "westcentralus": 0.583, + "westeurope": 0.64, + "westindia": 0.608, + "westus": 0.56, + "westus2": 0.504 + }, + "standarde8sv4": { + "australiaeast": 0.604, + "australiasoutheast": 0.655, + "brazilsouth": 0.804, + "brazilsoutheast": 1.045, + "canadacentral": 0.552, + "canadaeast": 0.552, + "centralindia": 0.52, + "centralus": 0.57, + "eastasia": 0.781, + "eastus": 0.504, + "eastus2": 0.504, + "francecentral": 0.592, + "francesouth": 0.766, + "germanywestcentral": 0.608, + "japaneast": 0.608, + "japanwest": 0.669, + "koreacentral": 0.608, + "northcentralus": 0.504, + "northeurope": 0.564, + "southafricanorth": 0.675, + "southcentralus": 0.605, + "southeastasia": 0.608, + "switzerlandnorth": 0.756, + "uksouth": 0.592, + "ukwest": 0.61, + "usgovarizona": 0.604, + "usgovtexas": 0.63, + "usgovvirginia": 0.604, + "westcentralus": 0.605, + "westeurope": 0.608, + "westus": 0.56, + "westus2": 0.504 + }, + "standarde8v3": { + "australiacentral": 0.638, + "australiacentral2": 0.638, + "australiaeast": 0.638, + "australiasoutheast": 0.638, + "brazilsouth": 0.94, + "brazilsoutheast": 1.222, + "canadacentral": 0.584, + "canadaeast": 0.584, + "centralindia": 0.548, + "centralus": 0.583, + "eastasia": 0.668, + "eastus": 0.504, + "eastus2": 0.532, + "francecentral": 0.624, + "francesouth": 0.81, + "germanycentral": 0.691, + "germanynorth": 0.79, + "germanynortheast": 0.691, + "germanywestcentral": 0.608, + "japaneast": 0.64, + "japanwest": 0.64, + "koreacentral": 0.64, + "koreasouth": 0.576, + "northcentralus": 0.504, + "northeurope": 0.564, + "norwayeast": 0.704, + "norwaywest": 0.915, + "southafricanorth": 0.675, + "southafricawest": 0.847, + "southcentralus": 0.583, + "southeastasia": 0.64, + "southindia": 0.667, + "switzerlandnorth": 0.768, + "switzerlandwest": 0.998, + "uaecentral": 0.786, + "uaenorth": 0.605, + "uksouth": 0.624, + "ukwest": 0.624, + "usgovarizona": 0.638, + "usgovtexas": 0.638, + "usgovvirginia": 0.638, + "westcentralus": 0.583, + "westeurope": 0.64, + "westindia": 0.608, + "westus": 0.56, + "westus2": 0.504 + }, + "standarde8v4": { + "australiaeast": 0.604, + "australiasoutheast": 0.655, + "brazilsouth": 0.804, + "brazilsoutheast": 1.045, + "canadacentral": 0.552, + "canadaeast": 0.552, + "centralindia": 0.52, + "centralus": 0.57, + "eastasia": 0.781, + "eastus": 0.504, + "eastus2": 0.504, + "francecentral": 0.592, + "francesouth": 0.766, + "germanywestcentral": 0.608, + "japaneast": 0.608, + "japanwest": 0.669, + "koreacentral": 0.608, + "northcentralus": 0.504, + "northeurope": 0.564, + "southafricanorth": 0.675, + "southcentralus": 0.605, + "southeastasia": 0.608, + "switzerlandnorth": 0.756, + "uksouth": 0.592, + "ukwest": 0.61, + "usgovarizona": 0.604, + "usgovtexas": 0.63, + "usgovvirginia": 0.604, + "westcentralus": 0.605, + "westeurope": 0.608, + "westus": 0.56, + "westus2": 0.504 + }, + "standarde16asv4": { + "australiaeast": 1.208, + "brazilsouth": 1.608, + "centralindia": 1.04, + "centralus": 1.139, + "eastasia": 1.336, + "eastus": 1.008, + "eastus2": 1.008, + "francecentral": 1.184, + "japaneast": 1.216, + "koreacentral": 1.216, + "northeurope": 1.128, + "southcentralus": 1.21, + "southeastasia": 1.216, + "uksouth": 1.184, + "westeurope": 1.216, + "westus": 1.12, + "westus2": 1.008 + }, + "standarde16av4": { + "australiaeast": 1.208, + "brazilsouth": 1.608, + "centralindia": 1.04, + "centralus": 1.139, + "eastasia": 1.336, + "eastus": 1.008, + "eastus2": 1.008, + "francecentral": 1.184, + "japaneast": 1.216, + "koreacentral": 1.216, + "northeurope": 1.128, + "southcentralus": 1.21, + "southeastasia": 1.216, + "uksouth": 1.184, + "westeurope": 1.216, + "westus": 1.12, + "westus2": 1.008 + }, + "standarde16dsv4": { + "australiaeast": 1.392, + "australiasoutheast": 1.382, + "brazilsouth": 1.83, + "canadacentral": 1.264, + "canadaeast": 1.382, + "centralindia": 1.208, + "centralus": 1.302, + "eastasia": 1.786, + "eastus": 1.152, + "eastus2": 1.152, + "francecentral": 1.352, + "francesouth": 1.751, + "germanywestcentral": 1.384, + "japaneast": 1.392, + "japanwest": 1.529, + "koreacentral": 1.384, + "northcentralus": 1.152, + "northeurope": 1.28, + "southafricanorth": 1.544, + "southcentralus": 1.498, + "southeastasia": 1.392, + "switzerlandnorth": 1.728, + "uksouth": 1.352, + "ukwest": 1.394, + "usgovarizona": 1.384, + "usgovtexas": 1.44, + "usgovvirginia": 1.384, + "westcentralus": 1.382, + "westeurope": 1.384, + "westus": 1.296, + "westus2": 1.152 + }, + "standarde16dv4": { + "australiaeast": 1.392, + "australiasoutheast": 1.382, + "brazilsouth": 1.83, + "canadacentral": 1.264, + "canadaeast": 1.382, + "centralindia": 1.208, + "centralus": 1.302, + "eastasia": 1.786, + "eastus": 1.152, + "eastus2": 1.152, + "francecentral": 1.352, + "francesouth": 1.751, + "germanywestcentral": 1.384, + "japaneast": 1.392, + "japanwest": 1.529, + "koreacentral": 1.384, + "northcentralus": 1.152, + "northeurope": 1.28, + "southafricanorth": 1.544, + "southcentralus": 1.498, + "southeastasia": 1.392, + "switzerlandnorth": 1.728, + "uksouth": 1.352, + "ukwest": 1.394, + "usgovarizona": 1.384, + "usgovtexas": 1.44, + "usgovvirginia": 1.384, + "westcentralus": 1.382, + "westeurope": 1.384, + "westus": 1.296, + "westus2": 1.152 + }, + "standarde16sv3": { + "australiacentral": 1.277, + "australiacentral2": 1.277, + "australiaeast": 1.277, + "australiasoutheast": 1.277, + "brazilsouth": 1.879, + "brazilsoutheast": 2.444, + "canadacentral": 1.168, + "canadaeast": 1.168, + "centralindia": 1.096, + "centralus": 1.167, + "eastasia": 1.336, + "eastus": 1.008, + "eastus2": 1.064, + "francecentral": 1.248, + "francesouth": 1.621, + "germanycentral": 1.382, + "germanynorth": 1.581, + "germanynortheast": 1.382, + "germanywestcentral": 1.216, + "japaneast": 1.28, + "japanwest": 1.28, + "koreacentral": 1.28, + "koreasouth": 1.152, + "northcentralus": 1.008, + "northeurope": 1.128, + "norwayeast": 1.408, + "norwaywest": 1.83, + "southafricanorth": 1.351, + "southafricawest": 1.693, + "southcentralus": 1.166, + "southeastasia": 1.28, + "southindia": 1.334, + "switzerlandnorth": 1.536, + "switzerlandwest": 1.997, + "uaecentral": 1.572, + "uaenorth": 1.21, + "uksouth": 1.248, + "ukwest": 1.248, + "usgovarizona": 1.277, + "usgovtexas": 1.277, + "usgovvirginia": 1.277, + "westcentralus": 1.166, + "westeurope": 1.28, + "westindia": 1.216, + "westus": 1.12, + "westus2": 1.008 + }, + "standarde16sv4": { + "australiaeast": 1.208, + "australiasoutheast": 1.31, + "brazilsouth": 1.608, + "brazilsoutheast": 2.09, + "canadacentral": 1.104, + "canadaeast": 1.104, + "centralindia": 1.04, + "centralus": 1.139, + "eastasia": 1.562, + "eastus": 1.008, + "eastus2": 1.008, + "francecentral": 1.184, + "francesouth": 1.532, + "germanywestcentral": 1.216, + "japaneast": 1.216, + "japanwest": 1.338, + "koreacentral": 1.216, + "northcentralus": 1.008, + "northeurope": 1.128, + "southafricanorth": 1.351, + "southcentralus": 1.21, + "southeastasia": 1.216, + "switzerlandnorth": 1.512, + "uksouth": 1.184, + "ukwest": 1.22, + "usgovarizona": 1.208, + "usgovtexas": 1.26, + "usgovvirginia": 1.208, + "westcentralus": 1.21, + "westeurope": 1.216, + "westus": 1.12, + "westus2": 1.008 + }, + "standarde16v3": { + "australiacentral": 1.277, + "australiacentral2": 1.277, + "australiaeast": 1.277, + "australiasoutheast": 1.277, + "brazilsouth": 1.879, + "brazilsoutheast": 2.444, + "canadacentral": 1.168, + "canadaeast": 1.168, + "centralindia": 1.096, + "centralus": 1.167, + "eastasia": 1.336, + "eastus": 1.008, + "eastus2": 1.064, + "francecentral": 1.248, + "francesouth": 1.621, + "germanycentral": 1.382, + "germanynorth": 1.581, + "germanynortheast": 1.382, + "germanywestcentral": 1.216, + "japaneast": 1.28, + "japanwest": 1.28, + "koreacentral": 1.28, + "koreasouth": 1.152, + "northcentralus": 1.008, + "northeurope": 1.128, + "norwayeast": 1.408, + "norwaywest": 1.83, + "southafricanorth": 1.351, + "southafricawest": 1.693, + "southcentralus": 1.166, + "southeastasia": 1.28, + "southindia": 1.334, + "switzerlandnorth": 1.536, + "switzerlandwest": 1.997, + "uaecentral": 1.572, + "uaenorth": 1.21, + "uksouth": 1.248, + "ukwest": 1.248, + "usgovarizona": 1.277, + "usgovtexas": 1.277, + "usgovvirginia": 1.277, + "westcentralus": 1.166, + "westeurope": 1.28, + "westindia": 1.216, + "westus": 1.12, + "westus2": 1.008 + }, + "standarde16v4": { + "australiaeast": 1.208, + "australiasoutheast": 1.31, + "brazilsouth": 1.608, + "brazilsoutheast": 2.09, + "canadacentral": 1.104, + "canadaeast": 1.104, + "centralindia": 1.04, + "centralus": 1.139, + "eastasia": 1.562, + "eastus": 1.008, + "eastus2": 1.008, + "francecentral": 1.184, + "francesouth": 1.532, + "germanywestcentral": 1.216, + "japaneast": 1.216, + "japanwest": 1.338, + "koreacentral": 1.216, + "northcentralus": 1.008, + "northeurope": 1.128, + "southafricanorth": 1.351, + "southcentralus": 1.21, + "southeastasia": 1.216, + "switzerlandnorth": 1.512, + "uksouth": 1.184, + "ukwest": 1.22, + "usgovarizona": 1.208, + "usgovtexas": 1.26, + "usgovvirginia": 1.208, + "westcentralus": 1.21, + "westeurope": 1.216, + "westus": 1.12, + "westus2": 1.008 + }, + "standarde20asv4": { + "australiaeast": 1.51, + "brazilsouth": 2.01, + "centralindia": 1.3, + "centralus": 1.424, + "eastasia": 1.67, + "eastus": 1.26, + "eastus2": 1.26, + "francecentral": 1.48, + "japaneast": 1.52, + "koreacentral": 1.52, + "northeurope": 1.41, + "southcentralus": 1.512, + "southeastasia": 1.52, + "uksouth": 1.48, + "westeurope": 1.52, + "westus": 1.4, + "westus2": 1.26 + }, + "standarde20av4": { + "australiaeast": 1.51, + "brazilsouth": 2.01, + "centralindia": 1.3, + "centralus": 1.424, + "eastasia": 1.67, + "eastus": 1.26, + "eastus2": 1.26, + "francecentral": 1.48, + "japaneast": 1.52, + "koreacentral": 1.52, + "northeurope": 1.41, + "southcentralus": 1.512, + "southeastasia": 1.52, + "uksouth": 1.48, + "westeurope": 1.52, + "westus": 1.4, + "westus2": 1.26 + }, + "standarde20dsv4": { + "australiaeast": 1.74, + "australiasoutheast": 1.728, + "brazilsouth": 2.287, + "canadacentral": 1.58, + "canadaeast": 1.728, + "centralindia": 1.51, + "centralus": 1.627, + "eastasia": 2.232, + "eastus": 1.44, + "eastus2": 1.44, + "francecentral": 1.69, + "francesouth": 2.189, + "germanywestcentral": 1.73, + "japaneast": 1.74, + "japanwest": 1.911, + "koreacentral": 1.73, + "northcentralus": 1.44, + "northeurope": 1.6, + "southafricanorth": 1.93, + "southcentralus": 1.872, + "southeastasia": 1.74, + "switzerlandnorth": 2.16, + "uksouth": 1.69, + "ukwest": 1.742, + "usgovarizona": 1.73, + "usgovtexas": 1.8, + "usgovvirginia": 1.73, + "westcentralus": 1.728, + "westeurope": 1.73, + "westus": 1.62, + "westus2": 1.44 + }, + "standarde20dv4": { + "australiaeast": 1.74, + "australiasoutheast": 1.728, + "brazilsouth": 2.287, + "canadacentral": 1.58, + "canadaeast": 1.728, + "centralindia": 1.51, + "centralus": 1.627, + "eastasia": 2.232, + "eastus": 1.44, + "eastus2": 1.44, + "francecentral": 1.69, + "francesouth": 2.189, + "germanywestcentral": 1.73, + "japaneast": 1.74, + "japanwest": 1.911, + "koreacentral": 1.73, + "northcentralus": 1.44, + "northeurope": 1.6, + "southafricanorth": 1.93, + "southcentralus": 1.872, + "southeastasia": 1.74, + "switzerlandnorth": 2.16, + "uksouth": 1.69, + "ukwest": 1.742, + "usgovarizona": 1.73, + "usgovtexas": 1.8, + "usgovvirginia": 1.73, + "westcentralus": 1.728, + "westeurope": 1.73, + "westus": 1.62, + "westus2": 1.44 + }, + "standarde20sv3": { + "australiacentral": 1.509, + "australiacentral2": 1.509, + "australiaeast": 1.509, + "australiasoutheast": 1.509, + "brazilsouth": 2.8, + "brazilsoutheast": 3.64, + "canadacentral": 1.46, + "canadaeast": 1.46, + "centralindia": 1.37, + "centralus": 1.46, + "eastasia": 1.67, + "eastus": 1.26, + "eastus2": 1.46, + "francecentral": 1.56, + "francesouth": 2.028, + "germanycentral": 1.73, + "germanynorth": 1.976, + "germanynortheast": 1.73, + "germanywestcentral": 1.52, + "japaneast": 1.6, + "japanwest": 1.6, + "koreacentral": 1.6, + "koreasouth": 1.44, + "northcentralus": 1.26, + "northeurope": 1.41, + "norwayeast": 1.76, + "norwaywest": 2.288, + "southafricanorth": 1.688, + "southafricawest": 2.117, + "southcentralus": 1.46, + "southeastasia": 1.6, + "southindia": 1.67, + "switzerlandnorth": 1.92, + "switzerlandwest": 2.496, + "uaecentral": 2.08, + "uaenorth": 1.6, + "uksouth": 1.56, + "ukwest": 1.56, + "usgovarizona": 1.509, + "usgovtexas": 1.509, + "usgovvirginia": 1.509, + "westcentralus": 1.46, + "westeurope": 1.6, + "westindia": 1.52, + "westus": 1.48, + "westus2": 1.26 + }, + "standarde20sv4": { + "australiaeast": 1.51, + "australiasoutheast": 1.638, + "brazilsouth": 2.01, + "brazilsoutheast": 2.613, + "canadacentral": 1.38, + "canadaeast": 1.38, + "centralindia": 1.3, + "centralus": 1.424, + "eastasia": 1.953, + "eastus": 1.26, + "eastus2": 1.26, + "francecentral": 1.48, + "francesouth": 1.915, + "germanywestcentral": 1.52, + "japaneast": 1.52, + "japanwest": 1.672, + "koreacentral": 1.52, + "northcentralus": 1.26, + "northeurope": 1.41, + "southafricanorth": 1.688, + "southcentralus": 1.512, + "southeastasia": 1.52, + "switzerlandnorth": 1.89, + "uksouth": 1.48, + "ukwest": 1.525, + "usgovarizona": 1.51, + "usgovtexas": 1.575, + "usgovvirginia": 1.51, + "westcentralus": 1.512, + "westeurope": 1.52, + "westus": 1.4, + "westus2": 1.26 + }, + "standarde20v3": { + "australiacentral": 1.509, + "australiacentral2": 1.509, + "australiaeast": 1.509, + "australiasoutheast": 1.509, + "brazilsouth": 2.8, + "brazilsoutheast": 3.64, + "canadacentral": 1.46, + "canadaeast": 1.46, + "centralindia": 1.37, + "centralus": 1.46, + "eastasia": 1.67, + "eastus": 1.26, + "eastus2": 1.46, + "francecentral": 1.56, + "francesouth": 2.028, + "germanycentral": 1.73, + "germanynorth": 1.976, + "germanynortheast": 1.73, + "germanywestcentral": 1.52, + "japaneast": 1.6, + "japanwest": 1.6, + "koreacentral": 1.6, + "koreasouth": 1.44, + "northcentralus": 1.26, + "northeurope": 1.41, + "norwayeast": 1.76, + "norwaywest": 2.288, + "southafricanorth": 1.688, + "southafricawest": 2.117, + "southcentralus": 1.46, + "southeastasia": 1.6, + "southindia": 1.67, + "switzerlandnorth": 1.92, + "switzerlandwest": 2.496, + "uaecentral": 2.08, + "uaenorth": 1.6, + "uksouth": 1.56, + "ukwest": 1.56, + "usgovarizona": 1.509, + "usgovtexas": 1.509, + "usgovvirginia": 1.509, + "westcentralus": 1.46, + "westeurope": 1.6, + "westindia": 1.52, + "westus": 1.48, + "westus2": 1.26 + }, + "standarde32asv4": { + "australiaeast": 2.416, + "brazilsouth": 3.216, + "centralindia": 2.08, + "centralus": 2.278, + "eastasia": 2.672, + "eastus": 2.016, + "eastus2": 2.016, + "francecentral": 2.368, + "japaneast": 2.432, + "koreacentral": 2.432, + "northeurope": 2.256, + "southcentralus": 2.419, + "southeastasia": 2.432, + "uksouth": 2.368, + "westeurope": 2.432, + "westus": 2.24, + "westus2": 2.016 + }, + "standarde32av4": { + "australiaeast": 2.416, + "brazilsouth": 3.216, + "centralindia": 2.08, + "centralus": 2.278, + "eastasia": 2.672, + "eastus": 2.016, + "eastus2": 2.016, + "francecentral": 2.368, + "japaneast": 2.432, + "koreacentral": 2.432, + "northeurope": 2.256, + "southcentralus": 2.419, + "southeastasia": 2.432, + "uksouth": 2.368, + "westeurope": 2.432, + "westus": 2.24, + "westus2": 2.016 + }, + "standarde32dsv4": { + "australiaeast": 2.784, + "australiasoutheast": 2.765, + "brazilsouth": 3.659, + "canadacentral": 2.528, + "canadaeast": 2.765, + "centralindia": 2.416, + "centralus": 2.604, + "eastasia": 3.571, + "eastus": 2.304, + "eastus2": 2.304, + "francecentral": 2.704, + "francesouth": 3.502, + "germanywestcentral": 2.768, + "japaneast": 2.784, + "japanwest": 3.057, + "koreacentral": 2.768, + "northcentralus": 2.304, + "northeurope": 2.56, + "southafricanorth": 3.087, + "southcentralus": 2.995, + "southeastasia": 2.784, + "switzerlandnorth": 3.456, + "uksouth": 2.704, + "ukwest": 2.788, + "usgovarizona": 2.768, + "usgovtexas": 2.88, + "usgovvirginia": 2.768, + "westcentralus": 2.765, + "westeurope": 2.768, + "westus": 2.592, + "westus2": 2.304 + }, + "standarde32dv4": { + "australiaeast": 2.784, + "australiasoutheast": 2.765, + "brazilsouth": 3.659, + "canadacentral": 2.528, + "canadaeast": 2.765, + "centralindia": 2.416, + "centralus": 2.604, + "eastasia": 3.571, + "eastus": 2.304, + "eastus2": 2.304, + "francecentral": 2.704, + "francesouth": 3.502, + "germanywestcentral": 2.768, + "japaneast": 2.784, + "japanwest": 3.057, + "koreacentral": 2.768, + "northcentralus": 2.304, + "northeurope": 2.56, + "southafricanorth": 3.087, + "southcentralus": 2.995, + "southeastasia": 2.784, + "switzerlandnorth": 3.456, + "uksouth": 2.704, + "ukwest": 2.788, + "usgovarizona": 2.768, + "usgovtexas": 2.88, + "usgovvirginia": 2.768, + "westcentralus": 2.765, + "westeurope": 2.768, + "westus": 2.592, + "westus2": 2.304 + }, + "standarde32sv3": { + "australiacentral": 2.554, + "australiacentral2": 2.554, + "australiaeast": 2.554, + "australiasoutheast": 2.554, + "brazilsouth": 3.758, + "brazilsoutheast": 4.888, + "canadacentral": 2.336, + "canadaeast": 2.336, + "centralindia": 2.192, + "centralus": 2.334, + "eastasia": 2.672, + "eastus": 2.016, + "eastus2": 2.128, + "francecentral": 2.496, + "francesouth": 3.2448, + "germanycentral": 2.765, + "germanynorth": 3.162, + "germanynortheast": 2.765, + "germanywestcentral": 2.432, + "japaneast": 2.56, + "japanwest": 2.56, + "koreacentral": 2.56, + "koreasouth": 2.304, + "northcentralus": 2.016, + "northeurope": 2.256, + "norwayeast": 2.816, + "norwaywest": 3.661, + "southafricanorth": 2.701, + "southafricawest": 3.387, + "southcentralus": 2.333, + "southeastasia": 2.56, + "southindia": 2.667, + "switzerlandnorth": 3.072, + "switzerlandwest": 3.994, + "uaecentral": 3.145, + "uaenorth": 2.419, + "uksouth": 2.496, + "ukwest": 2.496, + "usgovarizona": 2.554, + "usgovtexas": 2.554, + "usgovvirginia": 2.554, + "westcentralus": 2.333, + "westeurope": 2.56, + "westindia": 2.432, + "westus": 2.24, + "westus2": 2.016 + }, + "standarde32sv4": { + "australiaeast": 2.416, + "australiasoutheast": 2.621, + "brazilsouth": 3.216, + "brazilsoutheast": 4.181, + "canadacentral": 2.208, + "canadaeast": 2.208, + "centralindia": 2.08, + "centralus": 2.278, + "eastasia": 3.125, + "eastus": 2.016, + "eastus2": 2.016, + "francecentral": 2.368, + "francesouth": 3.064, + "germanywestcentral": 2.432, + "japaneast": 2.432, + "japanwest": 2.675, + "koreacentral": 2.432, + "northcentralus": 2.016, + "northeurope": 2.256, + "southafricanorth": 2.701, + "southcentralus": 2.419, + "southeastasia": 2.432, + "switzerlandnorth": 3.024, + "uksouth": 2.368, + "ukwest": 2.439, + "usgovarizona": 2.416, + "usgovtexas": 2.52, + "usgovvirginia": 2.416, + "westcentralus": 2.419, + "westeurope": 2.432, + "westus": 2.24, + "westus2": 2.016 + }, + "standarde32v3": { + "australiacentral": 2.554, + "australiacentral2": 2.554, + "australiaeast": 2.554, + "australiasoutheast": 2.554, + "brazilsouth": 3.758, + "brazilsoutheast": 4.888, + "canadacentral": 2.336, + "canadaeast": 2.336, + "centralindia": 2.192, + "centralus": 2.334, + "eastasia": 2.672, + "eastus": 2.016, + "eastus2": 2.128, + "francecentral": 2.496, + "francesouth": 3.2448, + "germanycentral": 2.765, + "germanynorth": 3.162, + "germanynortheast": 2.765, + "germanywestcentral": 2.432, + "japaneast": 2.56, + "japanwest": 2.56, + "koreacentral": 2.56, + "koreasouth": 2.304, + "northcentralus": 2.016, + "northeurope": 2.256, + "norwayeast": 2.816, + "norwaywest": 3.661, + "southafricanorth": 2.701, + "southafricawest": 3.387, + "southcentralus": 2.333, + "southeastasia": 2.56, + "southindia": 2.667, + "switzerlandnorth": 3.072, + "switzerlandwest": 3.994, + "uaecentral": 3.145, + "uaenorth": 2.419, + "uksouth": 2.496, + "ukwest": 2.496, + "usgovarizona": 2.554, + "usgovtexas": 2.554, + "usgovvirginia": 2.554, + "westcentralus": 2.333, + "westeurope": 2.56, + "westindia": 2.432, + "westus": 2.24, + "westus2": 2.016 + }, + "standarde32v4": { + "australiaeast": 2.416, + "australiasoutheast": 2.621, + "brazilsouth": 3.216, + "brazilsoutheast": 4.181, + "canadacentral": 2.208, + "canadaeast": 2.208, + "centralindia": 2.08, + "centralus": 2.278, + "eastasia": 3.125, + "eastus": 2.016, + "eastus2": 2.016, + "francecentral": 2.368, + "francesouth": 3.064, + "germanywestcentral": 2.432, + "japaneast": 2.432, + "japanwest": 2.675, + "koreacentral": 2.432, + "northcentralus": 2.016, + "northeurope": 2.256, + "southafricanorth": 2.701, + "southcentralus": 2.419, + "southeastasia": 2.432, + "switzerlandnorth": 3.024, + "uksouth": 2.368, + "ukwest": 2.439, + "usgovarizona": 2.416, + "usgovtexas": 2.52, + "usgovvirginia": 2.416, + "westcentralus": 2.419, + "westeurope": 2.432, + "westus": 2.24, + "westus2": 2.016 + }, + "standarde48asv4": { + "australiaeast": 3.624, + "brazilsouth": 4.824, + "centralindia": 3.12, + "centralus": 3.417, + "eastasia": 4.008, + "eastus": 3.024, + "eastus2": 3.024, + "francecentral": 3.552, + "japaneast": 3.648, + "koreacentral": 3.648, + "northeurope": 3.384, + "southcentralus": 3.629, + "southeastasia": 3.648, + "uksouth": 3.552, + "westeurope": 3.648, + "westus": 3.36, + "westus2": 3.024 + }, + "standarde48av4": { + "australiaeast": 3.624, + "brazilsouth": 4.824, + "centralindia": 3.12, + "centralus": 3.417, + "eastasia": 4.008, + "eastus": 3.024, + "eastus2": 3.024, + "francecentral": 3.552, + "japaneast": 3.648, + "koreacentral": 3.648, + "northeurope": 3.384, + "southcentralus": 3.629, + "southeastasia": 3.648, + "uksouth": 3.552, + "westeurope": 3.648, + "westus": 3.36, + "westus2": 3.024 + }, + "standarde48dsv4": { + "australiaeast": 4.176, + "australiasoutheast": 4.147, + "brazilsouth": 5.489, + "canadacentral": 3.792, + "canadaeast": 4.147, + "centralindia": 3.624, + "centralus": 3.905, + "eastasia": 5.357, + "eastus": 3.456, + "eastus2": 3.456, + "francecentral": 4.056, + "francesouth": 5.253, + "germanywestcentral": 4.152, + "japaneast": 4.176, + "japanwest": 4.586, + "koreacentral": 4.152, + "northcentralus": 3.456, + "northeurope": 3.84, + "southafricanorth": 4.631, + "southcentralus": 4.493, + "southeastasia": 4.176, + "switzerlandnorth": 5.184, + "uksouth": 4.056, + "ukwest": 4.182, + "usgovarizona": 4.152, + "usgovtexas": 4.32, + "usgovvirginia": 4.152, + "westcentralus": 4.147, + "westeurope": 4.152, + "westus": 3.888, + "westus2": 3.456 + }, + "standarde48dv4": { + "australiaeast": 4.176, + "australiasoutheast": 4.147, + "brazilsouth": 5.489, + "canadacentral": 3.792, + "canadaeast": 4.147, + "centralindia": 3.624, + "centralus": 3.905, + "eastasia": 5.357, + "eastus": 3.456, + "eastus2": 3.456, + "francecentral": 4.056, + "francesouth": 5.253, + "germanywestcentral": 4.152, + "japaneast": 4.176, + "japanwest": 4.586, + "koreacentral": 4.152, + "northcentralus": 3.456, + "northeurope": 3.84, + "southafricanorth": 4.631, + "southcentralus": 4.493, + "southeastasia": 4.176, + "switzerlandnorth": 5.184, + "uksouth": 4.056, + "ukwest": 4.182, + "usgovarizona": 4.152, + "usgovtexas": 4.32, + "usgovvirginia": 4.152, + "westcentralus": 4.147, + "westeurope": 4.152, + "westus": 3.888, + "westus2": 3.456 + }, + "standarde48sv3": { + "australiacentral": 3.623, + "australiacentral2": 3.623, + "australiaeast": 3.623, + "australiasoutheast": 3.623, + "brazilsouth": 5.637, + "brazilsoutheast": 7.332, + "canadacentral": 3.311, + "canadaeast": 3.311, + "centralindia": 3.281, + "centralus": 3.501, + "eastasia": 4.008, + "eastus": 3.024, + "eastus2": 3.024, + "francecentral": 3.74, + "francesouth": 4.863, + "germanycentral": 4.146, + "germanynorth": 4.743, + "germanynortheast": 4.146, + "germanywestcentral": 3.648, + "japaneast": 3.647, + "japanwest": 3.84, + "koreacentral": 3.647, + "koreasouth": 3.234, + "northcentralus": 3.024, + "northeurope": 3.384, + "norwayeast": 4.012, + "norwaywest": 5.215, + "southafricanorth": 4.052, + "southafricawest": 5.08, + "southcentralus": 3.499, + "southeastasia": 3.84, + "southindia": 4.001, + "switzerlandnorth": 4.608, + "switzerlandwest": 5.991, + "uaecentral": 4.717, + "uaenorth": 3.629, + "uksouth": 3.553, + "ukwest": 3.553, + "usgovarizona": 3.624, + "usgovtexas": 3.624, + "usgovvirginia": 3.624, + "westeurope": 3.647, + "westindia": 3.64, + "westus": 3.36, + "westus2": 3.024 + }, + "standarde48sv4": { + "australiaeast": 3.624, + "australiasoutheast": 3.931, + "brazilsouth": 4.824, + "brazilsoutheast": 6.271, + "canadacentral": 3.312, + "canadaeast": 3.312, + "centralindia": 3.12, + "centralus": 3.417, + "eastasia": 4.687, + "eastus": 3.024, + "eastus2": 3.024, + "francecentral": 3.552, + "francesouth": 4.596, + "germanywestcentral": 3.648, + "japaneast": 3.648, + "japanwest": 4.013, + "koreacentral": 3.648, + "northcentralus": 3.024, + "northeurope": 3.384, + "southafricanorth": 4.052, + "southcentralus": 3.629, + "southeastasia": 3.648, + "switzerlandnorth": 4.536, + "uksouth": 3.552, + "ukwest": 3.659, + "usgovarizona": 3.624, + "usgovtexas": 3.78, + "usgovvirginia": 3.624, + "westcentralus": 3.629, + "westeurope": 3.648, + "westus": 3.36, + "westus2": 3.024 + }, + "standarde48v3": { + "australiacentral": 3.623, + "australiacentral2": 3.623, + "australiaeast": 3.623, + "australiasoutheast": 3.623, + "brazilsouth": 5.637, + "brazilsoutheast": 7.332, + "canadacentral": 3.311, + "canadaeast": 3.311, + "centralindia": 3.281, + "centralus": 3.501, + "eastasia": 4.008, + "eastus": 3.024, + "eastus2": 3.024, + "francecentral": 3.74, + "francesouth": 4.863, + "germanycentral": 4.146, + "germanynorth": 4.743, + "germanynortheast": 4.146, + "germanywestcentral": 3.648, + "japaneast": 3.647, + "japanwest": 3.84, + "koreacentral": 3.647, + "koreasouth": 3.234, + "northcentralus": 3.024, + "northeurope": 3.384, + "norwayeast": 4.012, + "norwaywest": 5.215, + "southafricanorth": 4.052, + "southafricawest": 5.08, + "southcentralus": 3.499, + "southeastasia": 3.84, + "southindia": 4.001, + "switzerlandnorth": 4.608, + "switzerlandwest": 5.991, + "uaecentral": 4.717, + "uaenorth": 3.629, + "uksouth": 3.553, + "ukwest": 3.553, + "usgovarizona": 3.624, + "usgovtexas": 3.624, + "usgovvirginia": 3.624, + "westcentralus": 3.499, + "westeurope": 3.647, + "westindia": 3.64, + "westus": 3.36, + "westus2": 3.024 + }, + "standarde48v4": { + "australiaeast": 3.624, + "australiasoutheast": 3.931, + "brazilsouth": 4.824, + "brazilsoutheast": 6.271, + "canadacentral": 3.312, + "canadaeast": 3.312, + "centralindia": 3.12, + "centralus": 3.417, + "eastasia": 4.687, + "eastus": 3.024, + "eastus2": 3.024, + "francecentral": 3.552, + "francesouth": 4.596, + "germanywestcentral": 3.648, + "japaneast": 3.648, + "japanwest": 4.013, + "koreacentral": 3.648, + "northcentralus": 3.024, + "northeurope": 3.384, + "southafricanorth": 4.052, + "southcentralus": 3.629, + "southeastasia": 3.648, + "switzerlandnorth": 4.536, + "uksouth": 3.552, + "ukwest": 3.659, + "usgovarizona": 3.624, + "usgovtexas": 3.78, + "usgovvirginia": 3.624, + "westcentralus": 3.629, + "westeurope": 3.648, + "westus": 3.36, + "westus2": 3.024 + }, + "standarde64asv4": { + "australiaeast": 4.832, + "brazilsouth": 6.432, + "centralindia": 4.16, + "centralus": 4.556, + "eastasia": 5.344, + "eastus": 4.032, + "eastus2": 4.032, + "francecentral": 4.736, + "japaneast": 4.864, + "koreacentral": 4.864, + "northeurope": 4.512, + "southcentralus": 4.838, + "southeastasia": 4.864, + "uksouth": 4.736, + "westeurope": 4.864, + "westus": 4.48, + "westus2": 4.032 + }, + "standarde64av4": { + "australiaeast": 4.832, + "brazilsouth": 6.432, + "centralindia": 4.16, + "centralus": 4.556, + "eastasia": 5.344, + "eastus": 4.032, + "eastus2": 4.032, + "francecentral": 4.736, + "japaneast": 4.864, + "koreacentral": 4.864, + "northeurope": 4.512, + "southcentralus": 4.838, + "southeastasia": 4.864, + "uksouth": 4.736, + "westeurope": 4.864, + "westus": 4.48, + "westus2": 4.032 + }, + "standarde64dsv4": { + "australiaeast": 5.568, + "australiasoutheast": 5.53, + "brazilsouth": 7.319, + "canadacentral": 5.056, + "canadaeast": 5.53, + "centralindia": 4.832, + "centralus": 5.207, + "eastasia": 7.142, + "eastus": 4.608, + "eastus2": 4.608, + "francecentral": 5.408, + "francesouth": 7.004, + "germanywestcentral": 5.536, + "japaneast": 5.568, + "japanwest": 6.115, + "koreacentral": 5.536, + "northcentralus": 4.608, + "northeurope": 5.12, + "southafricanorth": 6.175, + "southcentralus": 5.99, + "southeastasia": 5.568, + "switzerlandnorth": 6.912, + "uksouth": 5.408, + "ukwest": 5.576, + "usgovarizona": 5.536, + "usgovtexas": 5.76, + "usgovvirginia": 5.536, + "westcentralus": 5.53, + "westeurope": 5.536, + "westus": 5.184, + "westus2": 4.608 + }, + "standarde64dv4": { + "australiaeast": 5.568, + "australiasoutheast": 5.53, + "brazilsouth": 7.319, + "canadacentral": 5.056, + "canadaeast": 5.53, + "centralindia": 4.832, + "centralus": 5.207, + "eastasia": 7.142, + "eastus": 4.608, + "eastus2": 4.608, + "francecentral": 5.408, + "francesouth": 7.004, + "germanywestcentral": 5.536, + "japaneast": 5.568, + "japanwest": 6.115, + "koreacentral": 5.536, + "northcentralus": 4.608, + "northeurope": 5.12, + "southafricanorth": 6.175, + "southcentralus": 5.99, + "southeastasia": 5.568, + "switzerlandnorth": 6.912, + "uksouth": 5.408, + "ukwest": 5.576, + "usgovarizona": 5.536, + "usgovtexas": 5.76, + "usgovvirginia": 5.536, + "westcentralus": 5.53, + "westeurope": 5.536, + "westus": 5.184, + "westus2": 4.608 + }, + "standarde64isv3": { + "australiaeast": 4.347, + "australiasoutheast": 4.347, + "brazilsouth": 6.764, + "brazilsoutheast": 8.798, + "canadacentral": 3.974, + "canadaeast": 3.974, + "centralus": 4.199, + "eastasia": 4.81, + "eastus": 3.629, + "eastus2": 3.629, + "francecentral": 4.488, + "francesouth": 5.835, + "germanycentral": 5.214, + "germanynorth": 5.691, + "germanynortheast": 5.214, + "germanywestcentral": 4.378, + "japaneast": 4.376, + "japanwest": 4.609, + "koreacentral": 4.376, + "koreasouth": 3.778, + "northcentralus": 3.629, + "northeurope": 4.061, + "norwayeast": 4.814, + "norwaywest": 6.258, + "southafricanorth": 4.863, + "southafricawest": 6.096, + "southcentralus": 4.199, + "southeastasia": 4.609, + "southindia": 4.801, + "switzerlandnorth": 5.53, + "switzerlandwest": 7.188, + "uaecentral": 5.689, + "uaenorth": 4.376, + "uksouth": 4.264, + "ukwest": 4.264, + "usgovarizona": 4.347, + "usgovvirginia": 4.536, + "westcentralus": 4.199, + "westeurope": 4.376, + "westindia": 4.368, + "westus": 4.032, + "westus2": 3.629 + }, + "standarde64iv3": { + "australiaeast": 4.347, + "australiasoutheast": 4.347, + "brazilsouth": 6.764, + "brazilsoutheast": 8.798, + "canadacentral": 3.974, + "canadaeast": 3.974, + "centralus": 4.199, + "eastasia": 4.81, + "eastus": 3.629, + "eastus2": 3.629, + "francecentral": 4.488, + "francesouth": 5.835, + "germanycentral": 5.214, + "germanynorth": 5.691, + "germanynortheast": 5.214, + "germanywestcentral": 4.378, + "japaneast": 4.376, + "japanwest": 4.609, + "koreacentral": 4.376, + "koreasouth": 3.778, + "northcentralus": 3.629, + "northeurope": 4.061, + "norwayeast": 4.814, + "norwaywest": 6.258, + "southafricanorth": 4.863, + "southafricawest": 6.096, + "southcentralus": 4.199, + "southeastasia": 4.609, + "southindia": 4.801, + "switzerlandnorth": 5.53, + "switzerlandwest": 7.188, + "uaecentral": 5.689, + "uaenorth": 4.376, + "uksouth": 4.264, + "ukwest": 4.264, + "usgovarizona": 4.347, + "usgovvirginia": 4.536, + "westcentralus": 4.199, + "westeurope": 4.376, + "westindia": 4.368, + "westus": 4.032, + "westus2": 3.629 + }, + "standarde64sv3": { + "australiacentral": 4.347, + "australiacentral2": 4.347, + "australiaeast": 4.347, + "australiasoutheast": 4.347, + "brazilsouth": 6.764, + "brazilsoutheast": 8.798, + "canadacentral": 3.974, + "canadaeast": 3.974, + "centralindia": 3.937, + "centralus": 4.2, + "eastasia": 4.81, + "eastus": 3.629, + "eastus2": 3.629, + "francecentral": 4.488, + "francesouth": 5.835, + "germanycentral": 5.214, + "germanynorth": 5.691, + "germanynortheast": 5.214, + "germanywestcentral": 4.378, + "japaneast": 4.376, + "japanwest": 4.609, + "koreacentral": 4.376, + "koreasouth": 3.881, + "northcentralus": 3.629, + "northeurope": 4.061, + "norwayeast": 4.814, + "norwaywest": 6.258, + "southafricanorth": 4.863, + "southafricawest": 6.096, + "southcentralus": 4.199, + "southeastasia": 4.609, + "southindia": 4.801, + "switzerlandnorth": 5.53, + "switzerlandwest": 7.188, + "uaecentral": 5.661, + "uaenorth": 4.355, + "uksouth": 4.264, + "ukwest": 4.264, + "usgovarizona": 4.347, + "usgovtexas": 4.347, + "usgovvirginia": 4.814, + "westcentralus": 4.199, + "westeurope": 4.376, + "westindia": 4.368, + "westus": 4.032, + "westus2": 3.629 + }, + "standarde64sv4": { + "australiaeast": 4.832, + "australiasoutheast": 5.242, + "brazilsouth": 6.432, + "brazilsoutheast": 8.362, + "canadacentral": 4.416, + "canadaeast": 4.416, + "centralindia": 4.16, + "centralus": 4.556, + "eastasia": 6.25, + "eastus": 4.032, + "eastus2": 4.032, + "francecentral": 4.736, + "francesouth": 6.129, + "germanywestcentral": 4.864, + "japaneast": 4.864, + "japanwest": 5.35, + "koreacentral": 4.864, + "northcentralus": 4.032, + "northeurope": 4.512, + "southafricanorth": 5.403, + "southcentralus": 4.838, + "southeastasia": 4.864, + "switzerlandnorth": 6.048, + "uksouth": 4.736, + "ukwest": 4.879, + "usgovarizona": 4.832, + "usgovtexas": 5.04, + "usgovvirginia": 4.832, + "westcentralus": 4.838, + "westeurope": 4.864, + "westus": 4.48, + "westus2": 4.032 + }, + "standarde64v3": { + "australiacentral": 4.347, + "australiacentral2": 4.347, + "australiaeast": 4.347, + "australiasoutheast": 4.347, + "brazilsouth": 6.764, + "brazilsoutheast": 8.798, + "canadacentral": 3.974, + "canadaeast": 3.974, + "centralindia": 3.937, + "centralus": 4.2, + "eastasia": 4.81, + "eastus": 3.629, + "eastus2": 3.629, + "francecentral": 4.488, + "francesouth": 5.835, + "germanycentral": 5.214, + "germanynorth": 5.691, + "germanynortheast": 5.214, + "germanywestcentral": 4.378, + "japaneast": 4.376, + "japanwest": 4.609, + "koreacentral": 4.376, + "koreasouth": 3.881, + "northcentralus": 3.629, + "northeurope": 4.061, + "norwayeast": 4.814, + "norwaywest": 6.258, + "southafricanorth": 4.863, + "southafricawest": 6.096, + "southcentralus": 4.199, + "southeastasia": 4.609, + "southindia": 4.801, + "switzerlandnorth": 5.53, + "switzerlandwest": 7.188, + "uaecentral": 5.661, + "uaenorth": 4.355, + "uksouth": 4.264, + "ukwest": 4.264, + "usgovarizona": 4.347, + "usgovtexas": 4.347, + "usgovvirginia": 4.814, + "westcentralus": 4.199, + "westeurope": 4.376, + "westindia": 4.368, + "westus": 4.032, + "westus2": 3.629 + }, + "standarde64v4": { + "australiaeast": 4.832, + "australiasoutheast": 5.242, + "brazilsouth": 6.432, + "brazilsoutheast": 8.362, + "canadacentral": 4.416, + "canadaeast": 4.416, + "centralindia": 4.16, + "centralus": 4.556, + "eastasia": 6.25, + "eastus": 4.032, + "eastus2": 4.032, + "francecentral": 4.736, + "francesouth": 6.129, + "germanywestcentral": 4.864, + "japaneast": 4.864, + "japanwest": 5.35, + "koreacentral": 4.864, + "northcentralus": 4.032, + "northeurope": 4.512, + "southafricanorth": 5.403, + "southcentralus": 4.838, + "southeastasia": 4.864, + "switzerlandnorth": 6.048, + "uksouth": 4.736, + "ukwest": 4.879, + "usgovarizona": 4.832, + "usgovtexas": 5.04, + "usgovvirginia": 4.832, + "westcentralus": 4.838, + "westeurope": 4.864, + "westus": 4.48, + "westus2": 4.032 + }, + "standarde96asv4": { + "australiaeast": 7.248, + "brazilsouth": 9.648, + "centralindia": 6.24, + "centralus": 6.834, + "eastasia": 8.016, + "eastus": 6.048, + "eastus2": 6.048, + "francecentral": 7.104, + "japaneast": 7.296, + "koreacentral": 7.296, + "northeurope": 6.768, + "southcentralus": 7.258, + "southeastasia": 7.296, + "uksouth": 7.104, + "westeurope": 7.296, + "westus": 6.72, + "westus2": 6.048 + }, + "standarde96av4": { + "australiaeast": 7.248, + "brazilsouth": 9.648, + "centralindia": 6.24, + "centralus": 6.834, + "eastasia": 8.016, + "eastus": 6.048, + "eastus2": 6.048, + "francecentral": 7.104, + "japaneast": 7.296, + "koreacentral": 7.296, + "northeurope": 6.768, + "southcentralus": 7.258, + "southeastasia": 7.296, + "uksouth": 7.104, + "westeurope": 7.296, + "westus": 6.72, + "westus2": 6.048 + }, + "standardf1": { + "australiacentral": 0.065, + "australiacentral2": 0.065, + "australiaeast": 0.065, + "australiasoutheast": 0.065, + "brazilsouth": 0.0718, + "brazilsoutheast": 0.0933, + "canadacentral": 0.0519, + "canadaeast": 0.0546, + "centralindia": 0.049, + "centralus": 0.0547, + "eastasia": 0.072, + "eastus": 0.0497, + "eastus2": 0.0497, + "francecentral": 0.05, + "francesouth": 0.0656, + "germanycentral": 0.061, + "germanynorth": 0.0741, + "germanynortheast": 0.061, + "germanywestcentral": 0.057, + "japaneast": 0.063, + "japanwest": 0.063, + "koreacentral": 0.051, + "koreasouth": 0.051, + "northcentralus": 0.0497, + "northeurope": 0.0566, + "norwayeast": 0.0625, + "norwaywest": 0.0812, + "southafricanorth": 0.0667, + "southafricawest": 0.0836, + "southcentralus": 0.0547, + "southeastasia": 0.0577, + "southindia": 0.06, + "switzerlandnorth": 0.0682, + "switzerlandwest": 0.0886, + "uaecentral": 0.0738, + "uaenorth": 0.0597, + "uksouth": 0.059, + "ukwest": 0.059, + "usgovarizona": 0.0598, + "usgovtexas": 0.0598, + "usgovvirginia": 0.0598, + "westcentralus": 0.0547, + "westeurope": 0.0568, + "westindia": 0.0549, + "westus": 0.062, + "westus2": 0.0497 + }, + "standardf1s": { + "australiacentral": 0.065, + "australiacentral2": 0.065, + "australiaeast": 0.065, + "australiasoutheast": 0.065, + "brazilsouth": 0.0718, + "brazilsoutheast": 0.0933, + "canadacentral": 0.0519, + "canadaeast": 0.0546, + "centralindia": 0.049, + "centralus": 0.0547, + "eastasia": 0.072, + "eastus": 0.0497, + "eastus2": 0.0497, + "francecentral": 0.05, + "francesouth": 0.0656, + "germanycentral": 0.061, + "germanynorth": 0.0741, + "germanynortheast": 0.061, + "germanywestcentral": 0.057, + "japaneast": 0.063, + "japanwest": 0.063, + "koreacentral": 0.051, + "koreasouth": 0.051, + "northcentralus": 0.0497, + "northeurope": 0.0566, + "norwayeast": 0.0625, + "norwaywest": 0.0812, + "southafricanorth": 0.0667, + "southafricawest": 0.0836, + "southcentralus": 0.0547, + "southeastasia": 0.0577, + "southindia": 0.06, + "switzerlandnorth": 0.0682, + "switzerlandwest": 0.0886, + "uaecentral": 0.0738, + "uaenorth": 0.0597, + "uksouth": 0.059, + "ukwest": 0.059, + "usgovarizona": 0.0598, + "usgovtexas": 0.0598, + "usgovvirginia": 0.0598, + "westcentralus": 0.0547, + "westeurope": 0.0568, + "westindia": 0.0549, + "westus": 0.062, + "westus2": 0.0497 + }, + "standardf2": { + "australiacentral": 0.13, + "australiacentral2": 0.13, + "australiaeast": 0.13, + "australiasoutheast": 0.13, + "brazilsouth": 0.144, + "brazilsoutheast": 0.187, + "canadacentral": 0.104, + "canadaeast": 0.109, + "centralindia": 0.0988, + "centralus": 0.109, + "eastasia": 0.144, + "eastus": 0.099, + "eastus2": 0.099, + "francecentral": 0.101, + "francesouth": 0.131, + "germanycentral": 0.122, + "germanynorth": 0.148, + "germanynortheast": 0.122, + "germanywestcentral": 0.114, + "japaneast": 0.126, + "japanwest": 0.126, + "koreacentral": 0.102, + "koreasouth": 0.102, + "northcentralus": 0.099, + "northeurope": 0.113, + "norwayeast": 0.125, + "norwaywest": 0.163, + "southafricanorth": 0.133, + "southafricawest": 0.167, + "southcentralus": 0.109, + "southeastasia": 0.115, + "southindia": 0.121, + "switzerlandnorth": 0.137, + "switzerlandwest": 0.178, + "uaecentral": 0.148, + "uaenorth": 0.119, + "uksouth": 0.119, + "ukwest": 0.119, + "usgovarizona": 0.12, + "usgovtexas": 0.12, + "usgovvirginia": 0.12, + "westcentralus": 0.109, + "westeurope": 0.114, + "westindia": 0.11, + "westus": 0.124, + "westus2": 0.099 + }, + "standardf2s": { + "australiacentral": 0.13, + "australiacentral2": 0.13, + "australiaeast": 0.13, + "australiasoutheast": 0.13, + "brazilsouth": 0.144, + "brazilsoutheast": 0.187, + "canadacentral": 0.104, + "canadaeast": 0.109, + "centralindia": 0.0988, + "centralus": 0.109, + "eastasia": 0.144, + "eastus": 0.099, + "eastus2": 0.099, + "francecentral": 0.101, + "francesouth": 0.131, + "germanycentral": 0.122, + "germanynorth": 0.148, + "germanynortheast": 0.122, + "germanywestcentral": 0.114, + "japaneast": 0.126, + "japanwest": 0.126, + "koreacentral": 0.102, + "koreasouth": 0.102, + "northcentralus": 0.099, + "northeurope": 0.113, + "norwayeast": 0.125, + "norwaywest": 0.163, + "southafricanorth": 0.133, + "southafricawest": 0.167, + "southcentralus": 0.109, + "southeastasia": 0.115, + "southindia": 0.121, + "switzerlandnorth": 0.137, + "switzerlandwest": 0.178, + "uaecentral": 0.148, + "uaenorth": 0.119, + "uksouth": 0.119, + "ukwest": 0.119, + "usgovarizona": 0.12, + "usgovtexas": 0.12, + "usgovvirginia": 0.12, + "westcentralus": 0.109, + "westeurope": 0.114, + "westindia": 0.11, + "westus": 0.124, + "westus2": 0.099 + }, + "standardf2sv2": { + "australiacentral": 0.111, + "australiacentral2": 0.111, + "australiaeast": 0.111, + "australiasoutheast": 0.111, + "brazilsouth": 0.131, + "canadacentral": 0.0927, + "canadaeast": 0.0927, + "centralindia": 0.085, + "centralus": 0.102, + "eastasia": 0.108, + "eastus": 0.0846, + "eastus2": 0.0846, + "francecentral": 0.101, + "francesouth": 0.131, + "germanycentral": 0.102, + "germanynorth": 0.126, + "germanywestcentral": 0.097, + "japaneast": 0.107, + "japanwest": 0.117, + "koreacentral": 0.096, + "koreasouth": 0.0961, + "northcentralus": 0.085, + "northeurope": 0.096, + "southafricanorth": 0.114, + "southafricawest": 0.143, + "southcentralus": 0.102, + "southeastasia": 0.098, + "southindia": 0.0935, + "switzerlandnorth": 0.116, + "uaecentral": 0.126, + "uaenorth": 0.102, + "uksouth": 0.101, + "ukwest": 0.101, + "usgovarizona": 0.106, + "usgovtexas": 0.102, + "usgovvirginia": 0.102, + "westcentralus": 0.102, + "westeurope": 0.097, + "westindia": 0.085, + "westus": 0.106, + "westus2": 0.0846 + }, + "standardf4": { + "australiacentral": 0.26, + "australiacentral2": 0.26, + "australiaeast": 0.26, + "australiasoutheast": 0.26, + "brazilsouth": 0.287, + "brazilsoutheast": 0.373, + "canadacentral": 0.207, + "canadaeast": 0.218, + "centralindia": 0.198, + "centralus": 0.219, + "eastasia": 0.289, + "eastus": 0.199, + "eastus2": 0.199, + "francecentral": 0.202, + "francesouth": 0.262, + "germanycentral": 0.245, + "germanynorth": 0.296, + "germanynortheast": 0.245, + "germanywestcentral": 0.227, + "japaneast": 0.252, + "japanwest": 0.252, + "koreacentral": 0.204, + "koreasouth": 0.204, + "northcentralus": 0.199, + "northeurope": 0.226, + "norwayeast": 0.25, + "norwaywest": 0.325, + "southafricanorth": 0.267, + "southafricawest": 0.334, + "southcentralus": 0.219, + "southeastasia": 0.231, + "southindia": 0.242, + "switzerlandnorth": 0.274, + "switzerlandwest": 0.356, + "uaecentral": 0.295, + "uaenorth": 0.239, + "uksouth": 0.237, + "ukwest": 0.237, + "usgovarizona": 0.239, + "usgovtexas": 0.239, + "usgovvirginia": 0.239, + "westcentralus": 0.219, + "westeurope": 0.227, + "westindia": 0.219, + "westus": 0.249, + "westus2": 0.199 + }, + "standardf4s": { + "australiacentral": 0.26, + "australiacentral2": 0.26, + "australiaeast": 0.26, + "australiasoutheast": 0.26, + "brazilsouth": 0.287, + "brazilsoutheast": 0.373, + "canadacentral": 0.207, + "canadaeast": 0.218, + "centralindia": 0.198, + "centralus": 0.219, + "eastasia": 0.289, + "eastus": 0.199, + "eastus2": 0.199, + "francecentral": 0.202, + "francesouth": 0.262, + "germanycentral": 0.245, + "germanynorth": 0.296, + "germanynortheast": 0.245, + "germanywestcentral": 0.227, + "japaneast": 0.252, + "japanwest": 0.252, + "koreacentral": 0.204, + "koreasouth": 0.204, + "northcentralus": 0.199, + "northeurope": 0.226, + "norwayeast": 0.25, + "norwaywest": 0.325, + "southafricanorth": 0.267, + "southafricawest": 0.334, + "southcentralus": 0.219, + "southeastasia": 0.231, + "southindia": 0.242, + "switzerlandnorth": 0.274, + "switzerlandwest": 0.356, + "uaecentral": 0.295, + "uaenorth": 0.239, + "uksouth": 0.237, + "ukwest": 0.237, + "usgovarizona": 0.239, + "usgovtexas": 0.239, + "usgovvirginia": 0.239, + "westcentralus": 0.219, + "westeurope": 0.227, + "westindia": 0.219, + "westus": 0.249, + "westus2": 0.199 + }, + "standardf4sv2": { + "australiacentral": 0.222, + "australiacentral2": 0.222, + "australiaeast": 0.222, + "australiasoutheast": 0.223, + "brazilsouth": 0.262, + "canadacentral": 0.185, + "canadaeast": 0.185, + "centralindia": 0.17, + "centralus": 0.204, + "eastasia": 0.216, + "eastus": 0.169, + "eastus2": 0.169, + "francecentral": 0.202, + "francesouth": 0.262, + "germanycentral": 0.204, + "germanynorth": 0.252, + "germanywestcentral": 0.194, + "japaneast": 0.214, + "japanwest": 0.235, + "koreacentral": 0.192, + "koreasouth": 0.192, + "northcentralus": 0.17, + "northeurope": 0.192, + "southafricanorth": 0.228, + "southafricawest": 0.286, + "southcentralus": 0.204, + "southeastasia": 0.196, + "southindia": 0.187, + "switzerlandnorth": 0.233, + "uaecentral": 0.252, + "uaenorth": 0.204, + "uksouth": 0.202, + "ukwest": 0.202, + "usgovarizona": 0.212, + "usgovtexas": 0.204, + "usgovvirginia": 0.204, + "westcentralus": 0.204, + "westeurope": 0.194, + "westindia": 0.17, + "westus": 0.212, + "westus2": 0.169 + }, + "standardf8": { + "australiacentral": 0.521, + "australiacentral2": 0.521, + "australiaeast": 0.521, + "australiasoutheast": 0.521, + "brazilsouth": 0.574, + "brazilsoutheast": 0.747, + "canadacentral": 0.415, + "canadaeast": 0.437, + "centralindia": 0.395, + "centralus": 0.438, + "eastasia": 0.578, + "eastus": 0.398, + "eastus2": 0.398, + "francecentral": 0.404, + "francesouth": 0.525, + "germanycentral": 0.49, + "germanynorth": 0.593, + "germanynortheast": 0.49, + "germanywestcentral": 0.454, + "japaneast": 0.504, + "japanwest": 0.504, + "koreacentral": 0.408, + "koreasouth": 0.408, + "northcentralus": 0.398, + "northeurope": 0.452, + "norwayeast": 0.499, + "norwaywest": 0.649, + "southafricanorth": 0.533, + "southafricawest": 0.669, + "southcentralus": 0.438, + "southeastasia": 0.462, + "southindia": 0.483, + "switzerlandnorth": 0.547, + "switzerlandwest": 0.711, + "uaecentral": 0.59, + "uaenorth": 0.478, + "uksouth": 0.475, + "ukwest": 0.475, + "usgovarizona": 0.479, + "usgovtexas": 0.479, + "usgovvirginia": 0.479, + "westcentralus": 0.438, + "westeurope": 0.454, + "westindia": 0.439, + "westus": 0.498, + "westus2": 0.398 + }, + "standardf8s": { + "australiacentral": 0.521, + "australiacentral2": 0.521, + "australiaeast": 0.521, + "australiasoutheast": 0.521, + "brazilsouth": 0.574, + "brazilsoutheast": 0.747, + "canadacentral": 0.415, + "canadaeast": 0.437, + "centralindia": 0.395, + "centralus": 0.438, + "eastasia": 0.578, + "eastus": 0.398, + "eastus2": 0.398, + "francecentral": 0.404, + "francesouth": 0.525, + "germanycentral": 0.49, + "germanynorth": 0.593, + "germanynortheast": 0.49, + "germanywestcentral": 0.454, + "japaneast": 0.504, + "japanwest": 0.504, + "koreacentral": 0.408, + "koreasouth": 0.408, + "northcentralus": 0.398, + "northeurope": 0.452, + "norwayeast": 0.499, + "norwaywest": 0.649, + "southafricanorth": 0.533, + "southafricawest": 0.669, + "southcentralus": 0.438, + "southeastasia": 0.462, + "southindia": 0.483, + "switzerlandnorth": 0.547, + "switzerlandwest": 0.711, + "uaecentral": 0.59, + "uaenorth": 0.478, + "uksouth": 0.475, + "ukwest": 0.475, + "usgovarizona": 0.479, + "usgovtexas": 0.479, + "usgovvirginia": 0.479, + "westcentralus": 0.438, + "westeurope": 0.454, + "westindia": 0.439, + "westus": 0.498, + "westus2": 0.398 + }, + "standardf8sv2": { + "australiacentral": 0.444, + "australiacentral2": 0.444, + "australiaeast": 0.444, + "australiasoutheast": 0.445, + "brazilsouth": 0.524, + "canadacentral": 0.371, + "canadaeast": 0.371, + "centralindia": 0.34, + "centralus": 0.408, + "eastasia": 0.432, + "eastus": 0.338, + "eastus2": 0.338, + "francecentral": 0.404, + "francesouth": 0.524, + "germanycentral": 0.408, + "germanynorth": 0.504, + "germanywestcentral": 0.388, + "japaneast": 0.428, + "japanwest": 0.469, + "koreacentral": 0.384, + "koreasouth": 0.384, + "northcentralus": 0.34, + "northeurope": 0.384, + "southafricanorth": 0.456, + "southafricawest": 0.571, + "southcentralus": 0.408, + "southeastasia": 0.392, + "southindia": 0.374, + "switzerlandnorth": 0.466, + "uaecentral": 0.504, + "uaenorth": 0.408, + "uksouth": 0.404, + "ukwest": 0.405, + "usgovarizona": 0.425, + "usgovtexas": 0.408, + "usgovvirginia": 0.408, + "westcentralus": 0.408, + "westeurope": 0.388, + "westindia": 0.34, + "westus": 0.424, + "westus2": 0.338 + }, + "standardf16": { + "australiacentral": 1.042, + "australiacentral2": 1.042, + "australiaeast": 1.042, + "australiasoutheast": 1.042, + "brazilsouth": 1.148, + "brazilsoutheast": 1.493, + "canadacentral": 0.83, + "canadaeast": 0.874, + "centralindia": 0.79, + "centralus": 0.875, + "eastasia": 1.155, + "eastus": 0.796, + "eastus2": 0.796, + "francecentral": 0.808, + "francesouth": 1.05, + "germanycentral": 0.98, + "germanynorth": 1.186, + "germanynortheast": 0.98, + "germanywestcentral": 0.909, + "japaneast": 1.008, + "japanwest": 1.008, + "koreacentral": 0.816, + "koreasouth": 0.816, + "northcentralus": 0.796, + "northeurope": 0.905, + "norwayeast": 1.0, + "norwaywest": 1.3, + "southafricanorth": 1.066, + "southafricawest": 1.337, + "southcentralus": 0.875, + "southeastasia": 0.924, + "southindia": 0.966, + "switzerlandnorth": 1.094, + "switzerlandwest": 1.423, + "uaecentral": 1.182, + "uaenorth": 0.955, + "uksouth": 0.95, + "ukwest": 0.95, + "usgovarizona": 0.957, + "usgovtexas": 0.957, + "usgovvirginia": 0.957, + "westcentralus": 0.875, + "westeurope": 0.909, + "westindia": 0.878, + "westus": 0.996, + "westus2": 0.796 + }, + "standardf16s": { + "australiacentral": 1.042, + "australiacentral2": 1.042, + "australiaeast": 1.042, + "australiasoutheast": 1.042, + "brazilsouth": 1.148, + "brazilsoutheast": 1.493, + "canadacentral": 0.83, + "canadaeast": 0.874, + "centralindia": 0.79, + "centralus": 0.875, + "eastasia": 1.155, + "eastus": 0.796, + "eastus2": 0.796, + "francecentral": 0.808, + "francesouth": 1.05, + "germanycentral": 0.98, + "germanynorth": 1.186, + "germanynortheast": 0.98, + "germanywestcentral": 0.909, + "japaneast": 1.008, + "japanwest": 1.008, + "koreacentral": 0.816, + "koreasouth": 0.816, + "northcentralus": 0.796, + "northeurope": 0.905, + "norwayeast": 1.0, + "norwaywest": 1.3, + "southafricanorth": 1.066, + "southafricawest": 1.337, + "southcentralus": 0.875, + "southeastasia": 0.924, + "southindia": 0.966, + "switzerlandnorth": 1.094, + "switzerlandwest": 1.423, + "uaecentral": 1.182, + "uaenorth": 0.955, + "uksouth": 0.95, + "ukwest": 0.95, + "usgovarizona": 0.957, + "usgovtexas": 0.957, + "usgovvirginia": 0.957, + "westcentralus": 0.875, + "westeurope": 0.909, + "westindia": 0.878, + "westus": 0.996, + "westus2": 0.796 + }, + "standardf16sv2": { + "australiacentral": 0.888, + "australiacentral2": 0.888, + "australiaeast": 0.888, + "australiasoutheast": 0.891, + "brazilsouth": 1.048, + "canadacentral": 0.741, + "canadaeast": 0.741, + "centralindia": 0.68, + "centralus": 0.816, + "eastasia": 0.864, + "eastus": 0.677, + "eastus2": 0.677, + "francecentral": 0.808, + "francesouth": 1.047, + "germanycentral": 0.816, + "germanynorth": 1.009, + "germanywestcentral": 0.776, + "japaneast": 0.856, + "japanwest": 0.938, + "koreacentral": 0.768, + "koreasouth": 0.768, + "northcentralus": 0.68, + "northeurope": 0.768, + "southafricanorth": 0.911, + "southafricawest": 1.142, + "southcentralus": 0.816, + "southeastasia": 0.784, + "southindia": 0.748, + "uaecentral": 1.009, + "uaenorth": 0.816, + "uksouth": 0.808, + "ukwest": 0.809, + "usgovarizona": 0.85, + "usgovtexas": 0.816, + "usgovvirginia": 0.816, + "westcentralus": 0.816, + "westeurope": 0.776, + "westindia": 0.68, + "westus": 0.848, + "westus2": 0.677 + }, + "standardf32sv2": { + "australiacentral": 1.776, + "australiacentral2": 1.776, + "australiaeast": 1.776, + "australiasoutheast": 1.782, + "brazilsouth": 2.096, + "canadacentral": 1.482, + "canadaeast": 1.482, + "centralindia": 1.36, + "centralus": 1.632, + "eastasia": 1.728, + "eastus": 1.353, + "eastus2": 1.353, + "francecentral": 1.616, + "francesouth": 2.094, + "germanycentral": 1.632, + "germanynorth": 2.018, + "germanywestcentral": 1.552, + "japaneast": 1.712, + "japanwest": 1.877, + "koreacentral": 1.536, + "koreasouth": 1.537, + "northcentralus": 1.36, + "northeurope": 1.536, + "southafricanorth": 1.822, + "southafricawest": 2.285, + "southcentralus": 1.632, + "southeastasia": 1.568, + "southindia": 1.496, + "uaecentral": 2.018, + "uaenorth": 1.632, + "uksouth": 1.616, + "ukwest": 1.618, + "usgovarizona": 1.7, + "usgovtexas": 1.632, + "usgovvirginia": 1.632, + "westcentralus": 1.632, + "westeurope": 1.552, + "westindia": 1.36, + "westus": 1.696, + "westus2": 1.353 + }, + "standardf48sv2": { + "australiacentral": 2.664, + "australiacentral2": 2.664, + "australiaeast": 2.664, + "australiasoutheast": 2.672, + "brazilsouth": 3.144, + "canadacentral": 2.224, + "canadaeast": 2.224, + "centralindia": 2.04, + "centralus": 2.448, + "eastasia": 2.592, + "eastus": 2.03, + "eastus2": 2.03, + "francecentral": 2.424, + "francesouth": 3.142, + "germanynorth": 3.027, + "germanywestcentral": 2.328, + "japaneast": 2.568, + "japanwest": 2.815, + "koreacentral": 2.304, + "koreasouth": 2.305, + "northcentralus": 2.04, + "northeurope": 2.304, + "southafricanorth": 2.734, + "southafricawest": 3.427, + "southcentralus": 2.448, + "southeastasia": 2.352, + "southindia": 2.244, + "switzerlandnorth": 2.793, + "switzerlandwest": 3.632, + "uaecentral": 3.026, + "uaenorth": 2.448, + "uksouth": 2.424, + "ukwest": 2.428, + "usgovarizona": 2.448, + "usgovvirginia": 2.448, + "westeurope": 2.328, + "westindia": 2.04, + "westus": 2.544, + "westus2": 2.03 + }, + "standardf64sv2": { + "australiacentral": 3.552, + "australiacentral2": 3.552, + "australiaeast": 3.552, + "australiasoutheast": 3.563, + "brazilsouth": 4.192, + "canadacentral": 2.965, + "canadaeast": 2.965, + "centralindia": 2.72, + "centralus": 3.264, + "eastasia": 3.456, + "eastus": 2.706, + "eastus2": 2.706, + "francecentral": 3.232, + "francesouth": 4.189, + "germanycentral": 3.264, + "germanynorth": 4.035, + "germanywestcentral": 3.104, + "japaneast": 3.424, + "japanwest": 3.754, + "koreacentral": 3.072, + "koreasouth": 3.074, + "northcentralus": 2.72, + "northeurope": 3.072, + "southafricanorth": 3.645, + "southafricawest": 4.57, + "southcentralus": 3.264, + "southeastasia": 3.136, + "southindia": 2.992, + "uaecentral": 4.035, + "uaenorth": 3.264, + "uksouth": 3.232, + "ukwest": 3.237, + "usgovarizona": 3.4, + "usgovtexas": 3.264, + "usgovvirginia": 3.264, + "westcentralus": 3.264, + "westeurope": 3.104, + "westindia": 2.72, + "westus": 3.392, + "westus2": 2.706 + }, + "standardf72sv2": { + "australiacentral": 3.996, + "australiacentral2": 3.996, + "australiaeast": 3.996, + "australiasoutheast": 4.009, + "brazilsouth": 4.716, + "canadacentral": 3.335, + "canadaeast": 3.335, + "centralindia": 3.06, + "centralus": 3.672, + "eastasia": 3.888, + "eastus": 3.045, + "eastus2": 3.045, + "francecentral": 3.636, + "francesouth": 4.712, + "germanycentral": 3.672, + "germanynorth": 4.54, + "germanywestcentral": 3.492, + "japaneast": 3.852, + "japanwest": 4.223, + "koreacentral": 3.456, + "koreasouth": 3.458, + "northcentralus": 3.06, + "northeurope": 3.456, + "southafricanorth": 4.1, + "southafricawest": 5.141, + "southcentralus": 3.672, + "southeastasia": 3.528, + "southindia": 3.366, + "switzerlandnorth": 4.19, + "uaecentral": 4.54, + "uaenorth": 3.672, + "uksouth": 3.636, + "ukwest": 3.641, + "usgovarizona": 3.825, + "usgovtexas": 3.672, + "usgovvirginia": 3.672, + "westcentralus": 3.672, + "westeurope": 3.492, + "westindia": 3.06, + "westus": 3.816, + "westus2": 3.045 + }, + "standardg1": { + "australiaeast": 0.638, + "canadacentral": 0.484, + "canadaeast": 0.484, + "eastus2": 0.55, + "germanycentral": 0.616, + "germanynortheast": 0.77, + "japaneast": 0.576, + "southeastasia": 0.66, + "uksouth": 0.439, + "usgovarizona": 0.6875, + "usgovtexas": 0.6875, + "usgovvirginia": 0.55, + "westeurope": 0.7, + "westus": 0.61, + "westus2": 0.49 + }, + "standardg2": { + "australiaeast": 1.276, + "canadacentral": 0.968, + "canadaeast": 0.968, + "eastus2": 1.1, + "germanycentral": 1.232, + "germanynortheast": 1.54, + "japaneast": 1.151, + "southeastasia": 1.32, + "uksouth": 0.878, + "usgovarizona": 1.375, + "usgovtexas": 1.375, + "usgovvirginia": 1.1, + "westeurope": 1.4, + "westus": 1.22, + "westus2": 0.981 + }, + "standardg3": { + "australiaeast": 2.552, + "canadacentral": 1.936, + "canadaeast": 1.936, + "eastus2": 2.2, + "germanycentral": 2.464, + "germanynortheast": 3.08, + "japaneast": 2.302, + "southeastasia": 2.64, + "uksouth": 1.757, + "usgovarizona": 2.75, + "usgovtexas": 2.75, + "usgovvirginia": 2.2, + "westeurope": 2.8, + "westus": 2.44, + "westus2": 1.961 + }, + "standardg4": { + "australiaeast": 5.104, + "canadacentral": 3.872, + "canadaeast": 3.872, + "eastus2": 4.4, + "germanycentral": 4.928, + "germanynortheast": 6.16, + "japaneast": 4.602, + "southeastasia": 5.28, + "uksouth": 3.514, + "usgovarizona": 5.5, + "usgovtexas": 5.5, + "usgovvirginia": 4.4, + "westeurope": 5.6, + "westus": 4.88, + "westus2": 3.922 + }, + "standardg5": { + "australiaeast": 10.208, + "canadacentral": 7.744, + "canadaeast": 7.744, + "eastus2": 7.82, + "germanycentral": 9.856, + "germanynortheast": 10.948, + "japaneast": 9.205, + "southeastasia": 9.39, + "uksouth": 7.027, + "usgovarizona": 9.775, + "usgovtexas": 9.775, + "usgovvirginia": 8.8, + "westeurope": 9.99, + "westus": 8.69, + "westus2": 7.82 + }, + "standardgs1": { + "australiaeast": 0.638, + "canadacentral": 0.484, + "canadaeast": 0.484, + "eastus2": 0.55, + "germanycentral": 0.616, + "germanynortheast": 0.77, + "japaneast": 0.576, + "southeastasia": 0.66, + "uksouth": 0.439, + "usgovarizona": 0.6875, + "usgovtexas": 0.6875, + "usgovvirginia": 0.55, + "westeurope": 0.7, + "westus": 0.61, + "westus2": 0.49 + }, + "standardgs2": { + "australiaeast": 1.276, + "canadacentral": 0.968, + "canadaeast": 0.968, + "eastus2": 1.1, + "germanycentral": 1.232, + "germanynortheast": 1.54, + "japaneast": 1.151, + "southeastasia": 1.32, + "uksouth": 0.878, + "usgovarizona": 1.375, + "usgovtexas": 1.375, + "usgovvirginia": 1.1, + "westeurope": 1.4, + "westus": 1.22, + "westus2": 0.981 + }, + "standardgs3": { + "australiaeast": 2.552, + "canadacentral": 1.936, + "canadaeast": 1.936, + "eastus2": 2.2, + "germanycentral": 2.464, + "germanynortheast": 3.08, + "japaneast": 2.302, + "southeastasia": 2.64, + "uksouth": 1.757, + "usgovarizona": 2.75, + "usgovtexas": 2.75, + "usgovvirginia": 2.2, + "westeurope": 2.8, + "westus": 2.44, + "westus2": 1.961 + }, + "standardgs4": { + "australiaeast": 5.104, + "canadacentral": 3.872, + "canadaeast": 3.872, + "eastus2": 4.4, + "germanycentral": 4.928, + "germanynortheast": 6.16, + "japaneast": 4.602, + "southeastasia": 5.28, + "uksouth": 3.514, + "usgovarizona": 5.5, + "usgovtexas": 5.5, + "usgovvirginia": 4.4, + "westeurope": 5.6, + "westus": 4.88, + "westus2": 3.922 + }, + "standardgs5": { + "australiaeast": 10.208, + "canadacentral": 7.744, + "canadaeast": 7.744, + "eastus2": 7.82, + "germanycentral": 9.856, + "germanynortheast": 10.948, + "japaneast": 9.205, + "southeastasia": 9.39, + "uksouth": 7.027, + "usgovarizona": 9.775, + "usgovtexas": 9.775, + "usgovvirginia": 8.8, + "westeurope": 9.99, + "westus": 8.69, + "westus2": 7.82 + }, + "standardh8": { + "australiaeast": 1.185, + "centralindia": 0.998, + "eastus": 0.904, + "japaneast": 1.145, + "northcentralus": 0.904, + "northeurope": 0.971, + "southcentralus": 0.875, + "southeastasia": 0.924, + "uksouth": 0.951, + "usgovarizona": 0.994, + "westeurope": 1.032, + "westus": 0.971, + "westus2": 0.796 + }, + "standardh8m": { + "australiaeast": 1.587, + "centralindia": 1.337, + "eastus": 1.211, + "japaneast": 1.535, + "northcentralus": 1.211, + "northeurope": 1.301, + "southcentralus": 1.172, + "southeastasia": 1.238, + "uksouth": 1.274, + "usgovarizona": 1.333, + "westeurope": 1.383, + "westus": 1.301, + "westus2": 1.066 + }, + "standardh8mpromo": { + "australiaeast": 0.953, + "centralindia": 0.802, + "eastus": 0.727, + "japaneast": 0.921, + "northcentralus": 0.727, + "northeurope": 0.78, + "southcentralus": 0.704, + "southeastasia": 0.743, + "uksouth": 0.768, + "usgovarizona": 0.8, + "westeurope": 0.831, + "westus": 0.78, + "westus2": 0.64 + }, + "standardh8promo": { + "australiaeast": 0.711, + "centralindia": 0.599, + "eastus": 0.543, + "japaneast": 0.687, + "northcentralus": 0.543, + "northeurope": 0.582, + "southcentralus": 0.525, + "southeastasia": 0.555, + "uksouth": 0.573, + "usgovarizona": 0.597, + "westeurope": 0.62, + "westus": 0.582, + "westus2": 0.477 + }, + "standardh16": { + "australiaeast": 2.369, + "centralindia": 1.995, + "eastus": 1.807, + "japaneast": 2.291, + "northcentralus": 1.808, + "northeurope": 1.941, + "southcentralus": 1.749, + "southeastasia": 1.848, + "uksouth": 1.902, + "usgovarizona": 1.989, + "westeurope": 2.065, + "westus": 1.941, + "westus2": 1.591 + }, + "standardh16m": { + "australiaeast": 3.175, + "centralindia": 2.674, + "eastus": 2.422, + "japaneast": 3.07, + "northcentralus": 2.423, + "northeurope": 2.601, + "southcentralus": 2.343, + "southeastasia": 2.476, + "uksouth": 2.549, + "usgovarizona": 2.665, + "westeurope": 2.767, + "westus": 2.601, + "westus2": 2.132 + }, + "standardh16mpromo": { + "australiaeast": 1.906, + "centralindia": 1.604, + "eastus": 1.454, + "japaneast": 1.842, + "northcentralus": 1.454, + "northeurope": 1.561, + "southcentralus": 1.407, + "southeastasia": 1.486, + "uksouth": 1.535, + "usgovarizona": 1.599, + "westeurope": 1.663, + "westus": 1.561, + "westus2": 1.279 + }, + "standardh16mr": { + "australiaeast": 3.492, + "centralindia": 2.941, + "eastus": 2.664, + "japaneast": 3.377, + "northcentralus": 2.665, + "northeurope": 2.861, + "southcentralus": 2.577, + "southeastasia": 2.724, + "uksouth": 2.803, + "usgovarizona": 2.931, + "westeurope": 3.043, + "westus": 2.861, + "westus2": 2.345 + }, + "standardh16mrpromo": { + "australiaeast": 2.096, + "centralindia": 1.764, + "eastus": 1.599, + "japaneast": 2.026, + "northcentralus": 1.599, + "northeurope": 1.717, + "southcentralus": 1.548, + "southeastasia": 1.634, + "uksouth": 1.688, + "usgovarizona": 1.759, + "westeurope": 1.688, + "westus": 1.717, + "westus2": 1.407 + }, + "standardh16promo": { + "australiaeast": 1.422, + "centralindia": 1.197, + "eastus": 1.085, + "japaneast": 1.375, + "northcentralus": 1.085, + "northeurope": 1.165, + "southcentralus": 1.05, + "southeastasia": 1.109, + "uksouth": 1.146, + "usgovarizona": 1.193, + "westeurope": 1.241, + "westus": 1.165, + "westus2": 0.955 + }, + "standardh16r": { + "australiaeast": 2.606, + "centralindia": 2.195, + "eastus": 1.988, + "japaneast": 2.52, + "northcentralus": 1.989, + "northeurope": 2.136, + "southcentralus": 1.924, + "southeastasia": 2.033, + "uksouth": 2.092, + "usgovarizona": 2.188, + "westeurope": 2.271, + "westus": 2.136, + "westus2": 1.75 + }, + "standardh16rpromo": { + "australiaeast": 1.565, + "centralindia": 1.317, + "eastus": 1.194, + "japaneast": 1.512, + "northcentralus": 1.194, + "northeurope": 1.281, + "southcentralus": 1.155, + "southeastasia": 1.22, + "uksouth": 1.26, + "usgovarizona": 1.313, + "westeurope": 1.365, + "westus": 1.281, + "westus2": 1.05 + }, + "standardhb60rs": { + "eastus": 2.28, + "southcentralus": 2.508, + "westeurope": 2.964 + }, + "standardhb120rsv2": { + "centralus": 4.428, + "eastus": 3.6, + "japaneast": 5.22, + "northcentralus": 4.32, + "southcentralus": 3.96, + "uaenorth": 4.752, + "uksouth": 4.5, + "westeurope": 4.68, + "westus2": 3.6 + }, + "standardhc44rs": { + "eastus": 3.168, + "japaneast": 4.594, + "southcentralus": 3.484, + "southeastasia": 4.118, + "westeurope": 4.118, + "westus2": 3.168 + }, + "standardl4s": { + "australiaeast": 0.374, + "canadacentral": 0.344, + "canadaeast": 0.344, + "eastus2": 0.343, + "germanycentral": 1.135, + "japaneast": 0.366, + "southeastasia": 0.374, + "uksouth": 0.362, + "usgovarizona": 0.376, + "usgovtexas": 0.376, + "usgovvirginia": 0.376, + "westeurope": 0.372, + "westus": 0.344, + "westus2": 0.312 + }, + "standardl8s": { + "australiaeast": 0.748, + "canadacentral": 0.688, + "canadaeast": 0.688, + "eastus2": 0.686, + "germanycentral": 2.269, + "japaneast": 0.732, + "southeastasia": 0.748, + "uksouth": 0.724, + "usgovarizona": 0.752, + "usgovtexas": 0.752, + "usgovvirginia": 0.752, + "westeurope": 0.744, + "westus": 0.688, + "westus2": 0.624 + }, + "standardl8sv2": { + "australiaeast": 0.748, + "eastus": 0.624, + "eastus2": 0.624, + "northeurope": 0.688, + "southcentralus": 0.749, + "southeastasia": 0.748, + "usgovarizona": 0.752, + "usgovvirginia": 0.752, + "westeurope": 0.744, + "westus": 0.688, + "westus2": 0.624 + }, + "standardl16s": { + "australiaeast": 1.496, + "canadacentral": 1.376, + "canadaeast": 1.376, + "eastus2": 1.373, + "germanycentral": 4.537, + "japaneast": 1.464, + "southeastasia": 1.496, + "uksouth": 1.448, + "usgovarizona": 1.504, + "usgovtexas": 1.504, + "usgovvirginia": 1.504, + "westeurope": 1.488, + "westus": 1.376, + "westus2": 1.248 + }, + "standardl16sv2": { + "australiaeast": 1.496, + "eastus": 1.248, + "eastus2": 1.248, + "northeurope": 1.376, + "southcentralus": 1.498, + "southeastasia": 1.496, + "usgovarizona": 1.504, + "usgovvirginia": 1.504, + "westeurope": 1.488, + "westus": 1.376, + "westus2": 1.248 + }, + "standardl32s": { + "australiaeast": 2.992, + "canadacentral": 2.752, + "canadaeast": 2.752, + "eastus2": 2.746, + "germanycentral": 9.074, + "japaneast": 2.928, + "southeastasia": 2.992, + "uksouth": 2.895, + "usgovarizona": 3.008, + "usgovtexas": 3.008, + "usgovvirginia": 3.008, + "westeurope": 2.976, + "westus": 2.752, + "westus2": 2.496 + }, + "standardl32sv2": { + "australiaeast": 2.992, + "eastus": 2.496, + "eastus2": 2.496, + "northeurope": 2.752, + "southcentralus": 2.995, + "southeastasia": 2.992, + "usgovarizona": 3.008, + "usgovvirginia": 3.008, + "westeurope": 2.976, + "westus": 2.752, + "westus2": 2.496 + }, + "standardl48sv2": { + "australiaeast": 4.488, + "eastus": 3.744, + "eastus2": 3.744, + "northeurope": 4.128, + "southcentralus": 4.493, + "southeastasia": 4.488, + "usgovarizona": 4.512, + "usgovvirginia": 4.512, + "westeurope": 4.464, + "westus": 4.128, + "westus2": 3.744 + }, + "standardl64sv2": { + "australiaeast": 5.984, + "eastus": 4.992, + "eastus2": 4.992, + "northeurope": 5.504, + "southcentralus": 5.99, + "southeastasia": 5.984, + "usgovarizona": 6.016, + "usgovvirginia": 6.016, + "westeurope": 5.952, + "westus": 5.504, + "westus2": 4.992 + }, + "standardl80sv2": { + "australiaeast": 7.48, + "eastus": 6.24, + "eastus2": 6.24, + "northeurope": 6.88, + "southcentralus": 7.488, + "southeastasia": 7.48, + "usgovarizona": 7.52, + "usgovvirginia": 7.52, + "westeurope": 7.44, + "westus": 6.88, + "westus2": 6.24 + }, + "standardm8ms": { + "australiacentral": 2.2279, + "australiacentral2": 2.2279, + "australiaeast": 2.2279, + "australiasoutheast": 2.2279, + "brazilsouth": 2.996, + "canadacentral": 1.69015, + "canadaeast": 1.69015, + "centralindia": 1.585, + "centralus": 1.736, + "eastasia": 2.784875, + "eastus": 1.5365, + "eastus2": 1.5365, + "francecentral": 1.936, + "germanynorth": 2.796, + "germanywestcentral": 2.151, + "japaneast": 2.2279, + "japanwest": 2.2279, + "koreacentral": 2.228, + "koreasouth": 2.228, + "northeurope": 1.8438, + "norwayeast": 2.197, + "southafricanorth": 2.059, + "southafricawest": 2.581, + "southcentralus": 1.844, + "southeastasia": 2.2279, + "southindia": 2.305, + "switzerlandnorth": 2.581, + "switzerlandwest": 3.355, + "uaecentral": 2.397, + "uaenorth": 2.028, + "uksouth": 1.936, + "ukwest": 1.936, + "usgovarizona": 1.8438, + "usgovvirginia": 1.8438, + "westeurope": 2.1511, + "westus": 1.997, + "westus2": 1.5365 + }, + "standardm16ms": { + "australiacentral": 4.4559, + "australiacentral2": 4.4559, + "australiaeast": 4.4559, + "australiasoutheast": 4.4559, + "brazilsouth": 5.992, + "canadacentral": 3.3803, + "canadaeast": 3.3803, + "centralindia": 3.171, + "centralus": 3.472, + "eastasia": 5.569875, + "eastus": 3.073, + "eastus2": 3.073, + "francecentral": 3.872, + "germanynorth": 5.593, + "germanywestcentral": 4.302, + "japaneast": 4.4559, + "japanwest": 4.4559, + "koreacentral": 4.456, + "koreasouth": 4.456, + "northeurope": 3.6876, + "norwayeast": 4.394, + "southafricanorth": 4.118, + "southafricawest": 5.163, + "southcentralus": 3.688, + "southeastasia": 4.4559, + "southindia": 4.61, + "switzerlandnorth": 5.163, + "switzerlandwest": 6.712, + "uaecentral": 4.794, + "uaenorth": 4.056, + "uksouth": 3.872, + "ukwest": 3.872, + "usgovarizona": 3.6876, + "usgovvirginia": 3.6876, + "westeurope": 4.3022, + "westus": 3.995, + "westus2": 3.073 + }, + "standardm32ls": { + "australiacentral": 3.4476, + "australiacentral2": 3.4476, + "australiaeast": 3.4476, + "australiasoutheast": 3.4476, + "brazilsouth": 6.049, + "canadacentral": 3.1603, + "canadaeast": 3.1603, + "centralindia": 3.275, + "centralus": 3.246, + "eastasia": 4.3095, + "eastus": 2.873, + "eastus2": 2.873, + "francecentral": 3.37, + "germanynorth": 4.482, + "germanywestcentral": 3.448, + "japaneast": 3.4476, + "japanwest": 3.4476, + "koreacentral": 3.448, + "koreasouth": 3.448, + "northeurope": 3.189, + "norwayeast": 4.108, + "southafricanorth": 3.85, + "southafricawest": 4.827, + "southcentralus": 3.448, + "southeastasia": 3.4476, + "southindia": 3.61998, + "switzerlandnorth": 4.137, + "switzerlandwest": 5.378, + "uaecentral": 4.482, + "uaenorth": 3.535, + "uksouth": 3.361, + "ukwest": 3.361, + "usgovarizona": 3.4476, + "usgovvirginia": 3.4476, + "westeurope": 3.4476, + "westus": 3.201, + "westus2": 2.873 + }, + "standardm32ms": { + "australiacentral": 8.9117, + "australiacentral2": 8.9117, + "australiaeast": 8.9117, + "australiasoutheast": 8.9117, + "brazilsouth": 11.985, + "canadacentral": 6.7606, + "canadaeast": 6.7606, + "centralindia": 6.341, + "centralus": 6.945, + "eastasia": 11.139625, + "eastus": 6.146, + "eastus2": 6.146, + "francecentral": 7.744, + "germanynorth": 11.186, + "germanywestcentral": 8.604, + "japaneast": 8.9117, + "japanwest": 8.9117, + "koreacentral": 8.912, + "koreasouth": 8.912, + "northeurope": 7.3752, + "norwayeast": 8.789, + "southafricanorth": 8.236, + "southafricawest": 10.325, + "southcentralus": 7.375, + "southeastasia": 8.9117, + "southindia": 9.3112, + "switzerlandnorth": 10.325, + "switzerlandwest": 13.423, + "uaecentral": 9.588, + "uaenorth": 8.113, + "uksouth": 7.744, + "ukwest": 7.744, + "usgovarizona": 7.375, + "usgovvirginia": 7.375, + "westeurope": 8.6044, + "westus": 7.99, + "westus2": 6.146 + }, + "standardm32ts": { + "australiacentral": 3.248, + "australiacentral2": 3.248, + "australiaeast": 3.248, + "australiasoutheast": 3.248, + "brazilsouth": 5.699, + "canadacentral": 2.9777, + "canadaeast": 2.9777, + "centralindia": 3.08598, + "centralus": 3.059, + "eastasia": 4.0605, + "eastus": 2.707, + "eastus2": 2.707, + "francecentral": 3.175, + "germanynorth": 4.222, + "germanywestcentral": 3.248, + "japaneast": 3.248, + "japanwest": 3.248, + "koreacentral": 3.248, + "koreasouth": 3.248, + "northeurope": 3.00477, + "norwayeast": 3.871, + "southafricanorth": 3.627, + "southafricawest": 4.548, + "southcentralus": 3.248, + "southeastasia": 3.248, + "southindia": 3.41082, + "switzerlandnorth": 3.898, + "switzerlandwest": 5.067, + "uaecentral": 4.223, + "uaenorth": 3.331, + "uksouth": 3.167, + "ukwest": 3.167, + "usgovarizona": 3.248, + "usgovvirginia": 3.248, + "westeurope": 3.248, + "westus": 3.016, + "westus2": 2.707 + }, + "standardm64": { + "australiacentral": 9.67, + "australiacentral2": 9.67, + "australiaeast": 9.67, + "australiasoutheast": 9.67, + "brazilsouth": 13.005, + "canadacentral": 7.3359, + "canadaeast": 7.3359, + "centralindia": 6.881, + "centralus": 7.536, + "eastasia": 12.08875, + "eastus": 6.669, + "eastus2": 6.669, + "francecentral": 8.403, + "germanynorth": 12.138, + "germanywestcentral": 9.337, + "japaneast": 9.67, + "japanwest": 9.67, + "koreacentral": 9.67, + "koreasouth": 9.67, + "northeurope": 8.003, + "norwayeast": 9.537, + "southafricanorth": 8.936, + "southafricawest": 11.204, + "southcentralus": 8.003, + "southeastasia": 9.67, + "southindia": 10.104, + "switzerlandnorth": 11.204, + "switzerlandwest": 14.565, + "uaecentral": 10.404, + "uaenorth": 8.803, + "uksouth": 8.403, + "ukwest": 8.403, + "usgovarizona": 8.003, + "usgovvirginia": 8.003, + "westeurope": 9.337, + "westus": 8.67, + "westus2": 6.669 + }, + "standardm64ls": { + "australiacentral": 6.498, + "australiacentral2": 6.498, + "australiaeast": 6.498, + "australiasoutheast": 6.498, + "brazilsouth": 11.4, + "canadacentral": 5.9565, + "canadaeast": 5.9565, + "centralindia": 6.173, + "centralus": 6.493, + "eastasia": 8.1225, + "eastus": 5.415, + "eastus2": 5.415, + "francecentral": 6.351, + "germanynorth": 8.447, + "germanywestcentral": 6.498, + "japaneast": 6.498, + "japanwest": 6.498, + "koreacentral": 6.498, + "koreasouth": 6.498, + "northeurope": 6.01065, + "norwayeast": 8.217, + "southafricanorth": 7.256, + "southafricawest": 9.097, + "southcentralus": 6.498, + "southeastasia": 6.498, + "southindia": 6.8229, + "switzerlandnorth": 7.798, + "switzerlandwest": 10.137, + "uaecentral": 8.964, + "uaenorth": 6.664, + "uksouth": 6.33555, + "ukwest": 6.33555, + "usgovarizona": 6.498, + "usgovvirginia": 6.498, + "westeurope": 6.498, + "westus": 6.403, + "westus2": 5.415 + }, + "standardm64m": { + "australiacentral": 14.989, + "australiacentral2": 14.989, + "australiaeast": 14.989, + "australiasoutheast": 14.989, + "brazilsouth": 20.158, + "canadacentral": 11.3707, + "canadaeast": 11.3707, + "centralindia": 10.666, + "centralus": 15.079, + "eastasia": 18.7375, + "eastus": 10.337, + "eastus2": 10.337, + "francecentral": 13.025, + "germanynorth": 18.813, + "germanywestcentral": 14.472, + "japaneast": 14.989, + "japanwest": 14.989, + "koreacentral": 14.989, + "koreasouth": 14.989, + "northeurope": 12.405, + "norwayeast": 19.082, + "southafricanorth": 13.852, + "southafricawest": 17.367, + "southcentralus": 12.405, + "southeastasia": 14.989, + "southindia": 15.664, + "switzerlandnorth": 17.366, + "switzerlandwest": 22.576, + "uaecentral": 20.817, + "uaenorth": 13.645, + "uksouth": 13.024, + "ukwest": 13.024, + "usgovarizona": 12.405, + "usgovvirginia": 12.405, + "westeurope": 14.472, + "westus": 17.347, + "westus2": 10.337 + }, + "standardm64ms": { + "australiacentral": 14.989, + "australiacentral2": 14.989, + "australiaeast": 14.989, + "australiasoutheast": 14.989, + "brazilsouth": 20.158, + "canadacentral": 11.3707, + "canadaeast": 11.3707, + "centralindia": 10.666, + "centralus": 15.079, + "eastasia": 18.7375, + "eastus": 10.337, + "eastus2": 10.337, + "francecentral": 13.025, + "germanynorth": 18.813, + "germanywestcentral": 14.472, + "japaneast": 14.989, + "japanwest": 14.989, + "koreacentral": 14.989, + "koreasouth": 14.989, + "northeurope": 12.405, + "norwayeast": 19.082, + "southafricanorth": 13.852, + "southafricawest": 17.367, + "southcentralus": 12.405, + "southeastasia": 14.989, + "southindia": 15.664, + "switzerlandnorth": 17.366, + "switzerlandwest": 22.576, + "uaecentral": 20.817, + "uaenorth": 13.645, + "uksouth": 13.024, + "ukwest": 13.024, + "usgovarizona": 12.405, + "usgovvirginia": 12.405, + "westeurope": 14.472, + "westus": 17.347, + "westus2": 10.337 + }, + "standardm64s": { + "australiacentral": 9.67, + "australiacentral2": 9.67, + "australiaeast": 9.67, + "australiasoutheast": 9.67, + "brazilsouth": 13.005, + "canadacentral": 7.3359, + "canadaeast": 7.3359, + "centralindia": 6.881, + "centralus": 7.536, + "eastasia": 12.08875, + "eastus": 6.669, + "eastus2": 6.669, + "francecentral": 8.403, + "germanynorth": 12.138, + "germanywestcentral": 9.337, + "japaneast": 9.67, + "japanwest": 9.67, + "koreacentral": 9.67, + "koreasouth": 9.67, + "northeurope": 8.003, + "norwayeast": 9.537, + "southafricanorth": 8.936, + "southafricawest": 11.204, + "southcentralus": 8.003, + "southeastasia": 9.67, + "southindia": 10.104, + "switzerlandnorth": 11.204, + "switzerlandwest": 14.565, + "uaecentral": 10.404, + "uaenorth": 8.803, + "uksouth": 8.403, + "ukwest": 8.403, + "usgovarizona": 8.003, + "usgovvirginia": 8.003, + "westeurope": 9.337, + "westus": 8.67, + "westus2": 6.669 + }, + "standardm128": { + "australiacentral": 19.34, + "australiacentral2": 19.34, + "australiaeast": 19.34, + "australiasoutheast": 19.34, + "brazilsouth": 26.009, + "canadacentral": 14.6718, + "canadaeast": 14.6718, + "centralindia": 13.762, + "centralus": 15.072, + "eastasia": 24.1775, + "eastus": 13.338, + "eastus2": 13.338, + "francecentral": 16.806, + "germanynorth": 24.276, + "germanywestcentral": 18.674, + "japaneast": 19.34, + "japanwest": 19.34, + "koreacentral": 19.34, + "koreasouth": 19.34, + "northeurope": 16.006, + "norwayeast": 19.073, + "southafricanorth": 17.873, + "southafricawest": 22.408, + "southcentralus": 16.006, + "southeastasia": 19.34, + "southindia": 20.207, + "switzerlandnorth": 22.408, + "switzerlandwest": 29.13, + "uaecentral": 20.807, + "uaenorth": 17.606, + "uksouth": 16.806, + "ukwest": 16.806, + "usgovarizona": 16.006, + "usgovvirginia": 16.006, + "westeurope": 18.673, + "westus": 17.339, + "westus2": 13.338 + }, + "standardm128m": { + "australiacentral": 38.6976, + "australiacentral2": 38.6976, + "australiaeast": 38.6976, + "australiasoutheast": 38.698, + "brazilsouth": 52.042, + "canadacentral": 29.3568, + "canadaeast": 29.3568, + "centralindia": 27.536, + "centralus": 30.157, + "eastasia": 48.37625, + "eastus": 26.688, + "eastus2": 26.688, + "francecentral": 33.627, + "germanynorth": 48.547, + "germanywestcentral": 37.344, + "japaneast": 38.698, + "japanwest": 38.698, + "koreacentral": 38.698, + "koreasouth": 38.698, + "northeurope": 32.0256, + "norwayeast": 38.164, + "southafricanorth": 35.762, + "southafricawest": 44.836, + "southcentralus": 32.026, + "southeastasia": 38.698, + "southindia": 40.44, + "switzerlandnorth": 44.836, + "switzerlandwest": 58.287, + "uaecentral": 41.633, + "uaenorth": 35.228, + "uksouth": 33.624, + "ukwest": 33.624, + "usgovarizona": 32.026, + "usgovvirginia": 32.026, + "westeurope": 37.3632, + "westus": 34.694, + "westus2": 26.688 + }, + "standardm128ms": { + "australiacentral": 38.6976, + "australiacentral2": 38.6976, + "australiaeast": 38.6976, + "australiasoutheast": 38.698, + "brazilsouth": 52.042, + "canadacentral": 29.3568, + "canadaeast": 29.3568, + "centralindia": 27.536, + "centralus": 30.157, + "eastasia": 48.37625, + "eastus": 26.688, + "eastus2": 26.688, + "francecentral": 33.627, + "germanynorth": 48.547, + "germanywestcentral": 37.344, + "japaneast": 38.698, + "japanwest": 38.698, + "koreacentral": 38.698, + "koreasouth": 38.698, + "northeurope": 32.0256, + "norwayeast": 38.164, + "southafricanorth": 35.762, + "southafricawest": 44.836, + "southcentralus": 32.026, + "southeastasia": 38.698, + "southindia": 40.44, + "switzerlandnorth": 44.836, + "switzerlandwest": 58.287, + "uaecentral": 41.633, + "uaenorth": 35.228, + "uksouth": 33.624, + "ukwest": 33.624, + "usgovarizona": 32.026, + "usgovvirginia": 32.026, + "westeurope": 37.3632, + "westus": 34.694, + "westus2": 26.688 + }, + "standardm128s": { + "australiacentral": 19.34, + "australiacentral2": 19.34, + "australiaeast": 19.34, + "australiasoutheast": 19.34, + "brazilsouth": 26.009, + "canadacentral": 14.6718, + "canadaeast": 14.6718, + "centralindia": 13.762, + "centralus": 15.072, + "eastasia": 24.1775, + "eastus": 13.338, + "eastus2": 13.338, + "francecentral": 16.806, + "germanynorth": 24.276, + "germanywestcentral": 18.674, + "japaneast": 19.34, + "japanwest": 19.34, + "koreacentral": 19.34, + "koreasouth": 19.34, + "northeurope": 16.006, + "norwayeast": 19.073, + "southafricanorth": 17.873, + "southafricawest": 22.408, + "southcentralus": 16.006, + "southeastasia": 19.34, + "southindia": 20.207, + "switzerlandnorth": 22.408, + "switzerlandwest": 29.13, + "uaecentral": 20.807, + "uaenorth": 17.606, + "uksouth": 16.806, + "ukwest": 16.806, + "usgovarizona": 16.006, + "usgovvirginia": 16.006, + "westeurope": 18.673, + "westus": 17.339, + "westus2": 13.338 + }, + "standardm208msv2": { + "australiaeast": 64.699, + "australiasoutheast": 64.699, + "brazilsouth": 87.009, + "centralus": 50.421, + "eastus": 44.62, + "eastus2": 44.62, + "germanywestcentral": 53.544, + "koreacentral": 60.237, + "northcentralus": 44.62, + "northeurope": 49.9744, + "southafricanorth": 59.791, + "southcentralus": 53.544, + "southeastasia": 58.006, + "uaecentral": 69.607, + "uksouth": 55.775, + "ukwest": 53.99, + "usgovarizona": 53.544, + "usgovvirginia": 53.544, + "westeurope": 53.544, + "westus": 58.006, + "westus2": 44.62 + }, + "standardm208sv2": { + "australiaeast": 32.35, + "australiasoutheast": 32.35, + "brazilsouth": 43.504, + "centralus": 25.21, + "eastus": 22.31, + "eastus2": 22.31, + "germanywestcentral": 26.772, + "koreacentral": 30.118, + "northcentralus": 22.31, + "northeurope": 24.9872, + "southafricanorth": 29.895, + "southcentralus": 26.772, + "southeastasia": 29.003, + "uaecentral": 34.804, + "uksouth": 27.888, + "ukwest": 26.995, + "usgovarizona": 26.772, + "usgovvirginia": 26.772, + "westeurope": 26.772, + "westus": 29.003, + "westus2": 22.31 + }, + "standardm416msv2": { + "australiaeast": 143.77, + "australiasoutheast": 143.77, + "brazilsouth": 193.34, + "centralus": 112.04, + "eastus": 99.15, + "eastus2": 99.15, + "germanywestcentral": 118.98, + "koreacentral": 133.85, + "northcentralus": 99.15, + "northeurope": 111.048, + "southafricanorth": 132.86, + "southcentralus": 118.98, + "southeastasia": 128.9, + "uaecentral": 154.67, + "uksouth": 123.94, + "ukwest": 119.97, + "usgovarizona": 118.98, + "usgovvirginia": 118.98, + "westeurope": 118.98, + "westus": 128.9, + "westus2": 99.15 + }, + "standardm416sv2": { + "australiaeast": 71.891, + "australiasoutheast": 71.891, + "brazilsouth": 96.681, + "centralus": 56.025, + "eastus": 49.58, + "eastus2": 49.58, + "germanywestcentral": 59.496, + "koreacentral": 66.933, + "northcentralus": 49.58, + "northeurope": 55.5296, + "southafricanorth": 66.437, + "southcentralus": 59.496, + "southeastasia": 64.454, + "uaecentral": 77.345, + "uksouth": 61.975, + "ukwest": 59.992, + "usgovarizona": 59.496, + "usgovvirginia": 59.496, + "westeurope": 59.496, + "westus": 64.454, + "westus2": 49.58 + }, + "standardnc4ast4v3": { + "westus2": 0.526 + }, + "standardnc6": { + "australiaeast": 1.55, + "eastus": 0.9, + "eastus2": 0.9, + "northcentralus": 0.9, + "northeurope": 0.972, + "southcentralus": 1.08, + "southeastasia": 1.321, + "uksouth": 1.283, + "usgovarizona": 1.08, + "usgovvirginia": 1.08, + "westeurope": 1.166, + "westus2": 0.9 + }, + "standardnc6promo": { + "australiaeast": 0.683, + "eastus": 0.396, + "eastus2": 0.396, + "japaneast": 0.683, + "northcentralus": 0.396, + "northeurope": 0.428, + "southcentralus": 0.475, + "southeastasia": 0.581, + "uksouth": 0.564, + "usgovarizona": 0.475, + "usgovvirginia": 0.475, + "westeurope": 0.515, + "westus": 0.475, + "westus2": 0.396 + }, + "standardnc6sv2": { + "eastus": 2.07, + "southcentralus": 2.484, + "southeastasia": 3.038, + "westeurope": 2.682, + "westus2": 2.07 + }, + "standardnc6sv3": { + "australiaeast": 4.234, + "canadacentral": 3.366, + "centralindia": 4.234, + "eastus": 3.06, + "eastus2": 3.06, + "francecentral": 3.58, + "japaneast": 4.194, + "koreacentral": 4.234, + "southcentralus": 3.366, + "southeastasia": 4.234, + "uksouth": 3.589, + "usgovarizona": 3.672, + "usgovvirginia": 3.672, + "westeurope": 3.823, + "westus2": 3.06 + }, + "standardnc8ast4v3": { + "westus2": 0.752 + }, + "standardnc12": { + "australiaeast": 3.1, + "eastus": 1.8, + "eastus2": 1.8, + "northcentralus": 1.8, + "northeurope": 1.944, + "southcentralus": 2.16, + "southeastasia": 2.642, + "uksouth": 2.566, + "usgovarizona": 2.16, + "usgovvirginia": 2.16, + "westeurope": 2.333, + "westus2": 1.8 + }, + "standardnc12promo": { + "australiaeast": 1.366, + "eastus": 0.792, + "eastus2": 0.792, + "japaneast": 1.366, + "northcentralus": 0.792, + "northeurope": 0.855, + "southcentralus": 0.95, + "southeastasia": 1.162, + "uksouth": 1.129, + "usgovarizona": 0.95, + "usgovvirginia": 0.95, + "westeurope": 1.03, + "westus": 0.95, + "westus2": 0.792 + }, + "standardnc12sv2": { + "eastus": 4.14, + "southcentralus": 4.968, + "southeastasia": 6.077, + "westeurope": 5.364, + "westus2": 4.14 + }, + "standardnc12sv3": { + "australiaeast": 8.468, + "canadacentral": 6.732, + "centralindia": 8.468, + "eastus": 6.12, + "eastus2": 6.12, + "francecentral": 7.16, + "japaneast": 8.388, + "koreacentral": 8.468, + "southcentralus": 6.732, + "southeastasia": 8.468, + "uksouth": 7.178, + "usgovarizona": 7.344, + "usgovvirginia": 7.344, + "westeurope": 7.646, + "westus2": 6.12 + }, + "standardnc16ast4v3": { + "westus2": 1.204 + }, + "standardnc24": { + "australiaeast": 6.199, + "eastus": 3.6, + "eastus2": 3.6, + "northcentralus": 3.6, + "northeurope": 3.888, + "southcentralus": 4.32, + "southeastasia": 5.283, + "uksouth": 5.132, + "usgovarizona": 4.32, + "usgovvirginia": 4.32, + "westeurope": 4.666, + "westus2": 3.6 + }, + "standardnc24promo": { + "australiaeast": 2.732, + "eastus": 1.584, + "eastus2": 1.584, + "japaneast": 2.732, + "northcentralus": 1.584, + "northeurope": 1.711, + "southcentralus": 1.901, + "southeastasia": 2.325, + "uksouth": 2.257, + "usgovarizona": 1.901, + "usgovvirginia": 1.901, + "westeurope": 2.059, + "westus": 1.901, + "westus2": 1.584 + }, + "standardnc24r": { + "australiaeast": 6.842, + "eastus": 3.96, + "eastus2": 3.96, + "northcentralus": 3.96, + "northeurope": 4.277, + "southcentralus": 4.752, + "southeastasia": 5.813, + "uksouth": 5.645, + "usgovarizona": 4.752, + "usgovvirginia": 4.752, + "westeurope": 5.132, + "westus2": 3.96 + }, + "standardnc24rpromo": { + "australiaeast": 3.006, + "eastus": 1.742, + "eastus2": 1.742, + "japaneast": 3.006, + "northcentralus": 1.742, + "northeurope": 1.882, + "southcentralus": 2.091, + "southeastasia": 2.558, + "uksouth": 2.484, + "usgovarizona": 2.091, + "usgovvirginia": 2.091, + "westeurope": 2.265, + "westus": 2.091, + "westus2": 1.742 + }, + "standardnc24rsv2": { + "eastus": 9.108, + "southcentralus": 10.93, + "southeastasia": 13.369, + "westeurope": 11.804, + "westus2": 9.108 + }, + "standardnc24rsv3": { + "australiaeast": 18.63, + "canadacentral": 14.81, + "centralindia": 18.63, + "eastus": 13.464, + "eastus2": 13.464, + "francecentral": 15.753, + "japaneast": 18.454, + "koreacentral": 18.63, + "southcentralus": 14.8104, + "southeastasia": 18.63, + "uksouth": 15.792, + "usgovarizona": 16.157, + "usgovvirginia": 16.157, + "westeurope": 16.821, + "westus2": 13.464 + }, + "standardnc24sv2": { + "eastus": 8.28, + "southcentralus": 9.936, + "southeastasia": 12.153, + "westeurope": 10.728, + "westus2": 8.28 + }, + "standardnc24sv3": { + "australiaeast": 16.936, + "canadacentral": 13.464, + "centralindia": 16.936, + "eastus": 12.24, + "eastus2": 12.24, + "francecentral": 14.321, + "japaneast": 16.776, + "koreacentral": 16.936, + "southcentralus": 13.464, + "southeastasia": 16.936, + "uksouth": 14.356, + "usgovarizona": 14.688, + "usgovvirginia": 14.688, + "westeurope": 15.292, + "westus2": 12.24 + }, + "standardnc64ast4v3": { + "westus2": 4.352 + }, + "standardnd6s": { + "eastus": 2.07, + "eastus2": 2.07, + "southcentralus": 2.484, + "southeastasia": 3.038, + "westeurope": 2.682, + "westus2": 2.07 + }, + "standardnd12s": { + "eastus": 4.14, + "eastus2": 4.14, + "southcentralus": 4.968, + "southeastasia": 6.077, + "westeurope": 5.363, + "westus2": 4.14 + }, + "standardnd24rs": { + "eastus": 9.108, + "eastus2": 9.108, + "southcentralus": 10.93, + "southeastasia": 13.369, + "westeurope": 11.804, + "westus2": 9.108 + }, + "standardnd24s": { + "eastus": 8.28, + "eastus2": 8.28, + "southcentralus": 9.936, + "southeastasia": 12.153, + "westeurope": 10.727, + "westus2": 8.28 + }, + "standardnd40rsv2": { + "eastus": 22.032, + "southcentralus": 26.438, + "usgovarizona": 27.54, + "usgovvirginia": 27.54, + "westeurope": 27.526, + "westus2": 22.032 + }, + "standardnv4asv4": { + "australiaeast": 0.338, + "centralindia": 0.326, + "eastus": 0.233, + "eastus2": 0.233, + "japaneast": 0.338, + "northeurope": 0.28, + "southcentralus": 0.28, + "southeastasia": 0.303, + "uksouth": 0.291, + "westeurope": 0.291, + "westus2": 0.233 + }, + "standardnv6": { + "australiaeast": 1.59, + "centralindia": 1.718, + "eastus": 1.14, + "eastus2": 1.202, + "japaneast": 1.58, + "northcentralus": 1.14, + "northeurope": 1.21, + "southcentralus": 1.15, + "southeastasia": 1.59, + "uksouth": 1.502, + "usgovarizona": 1.366, + "usgovtexas": 1.366, + "usgovvirginia": 1.366, + "westeurope": 1.365, + "westus2": 1.092 + }, + "standardnv6promo": { + "australiaeast": 0.954, + "centralindia": 1.031, + "eastus": 0.684, + "eastus2": 0.721, + "japaneast": 0.948, + "northcentralus": 0.684, + "northeurope": 0.726, + "southcentralus": 0.69, + "southeastasia": 0.954, + "uksouth": 0.901, + "usgovvirginia": 0.819, + "westeurope": 0.819, + "westus": 0.744, + "westus2": 0.656 + }, + "standardnv8asv4": { + "australiaeast": 0.676, + "centralindia": 0.652, + "eastus": 0.466, + "eastus2": 0.466, + "japaneast": 0.676, + "northeurope": 0.559, + "southcentralus": 0.559, + "southeastasia": 0.606, + "uksouth": 0.582, + "westeurope": 0.582, + "westus2": 0.466 + }, + "standardnv12": { + "australiaeast": 3.179, + "centralindia": 3.436, + "eastus": 2.28, + "eastus2": 2.403, + "japaneast": 3.16, + "northcentralus": 2.28, + "northeurope": 2.42, + "southcentralus": 2.3, + "southeastasia": 3.179, + "uksouth": 3.003, + "usgovarizona": 2.731, + "usgovtexas": 2.731, + "usgovvirginia": 2.731, + "westeurope": 2.73, + "westus2": 2.185 + }, + "standardnv12promo": { + "australiaeast": 1.908, + "centralindia": 2.062, + "eastus": 1.368, + "eastus2": 1.442, + "japaneast": 1.896, + "northcentralus": 1.368, + "northeurope": 1.452, + "southcentralus": 1.38, + "southeastasia": 1.908, + "uksouth": 1.803, + "usgovvirginia": 1.639, + "westeurope": 1.639, + "westus": 1.488, + "westus2": 1.311 + }, + "standardnv12sv3": { + "australiaeast": 1.59, + "brazilsouth": 1.938, + "eastus": 1.14, + "eastus2": 1.14, + "francecentral": 1.425, + "japaneast": 1.58, + "northeurope": 1.21, + "norwaywest": 2.12, + "southafricanorth": 1.46, + "southcentralus": 1.368, + "southeastasia": 1.59, + "uaenorth": 1.391, + "uksouth": 1.425, + "usgovarizona": 1.425, + "usgovvirginia": 1.425, + "westeurope": 1.426, + "westus": 1.14, + "westus2": 1.14 + }, + "standardnv16asv4": { + "australiaeast": 1.351, + "centralindia": 1.305, + "eastus": 0.932, + "eastus2": 0.932, + "japaneast": 1.351, + "northeurope": 1.118, + "southcentralus": 1.118, + "southeastasia": 1.212, + "uksouth": 1.165, + "westeurope": 0.583, + "westus2": 0.932 + }, + "standardnv24": { + "australiaeast": 6.358, + "centralindia": 6.872, + "eastus": 4.56, + "eastus2": 4.807, + "japaneast": 6.319, + "northcentralus": 4.56, + "northeurope": 4.84, + "southcentralus": 4.599, + "southeastasia": 6.358, + "uksouth": 6.006, + "usgovarizona": 5.462, + "usgovtexas": 5.462, + "usgovvirginia": 5.462, + "westeurope": 5.46, + "westus2": 4.37 + }, + "standardnv24promo": { + "australiaeast": 3.815, + "centralindia": 4.123, + "eastus": 2.736, + "eastus2": 2.884, + "japaneast": 3.791, + "northcentralus": 2.736, + "northeurope": 2.904, + "southcentralus": 2.76, + "southeastasia": 3.815, + "uksouth": 3.605, + "usgovvirginia": 3.278, + "westeurope": 3.278, + "westus": 2.976, + "westus2": 2.622 + }, + "standardnv24sv3": { + "australiaeast": 3.179, + "brazilsouth": 3.876, + "eastus": 2.28, + "eastus2": 2.28, + "francecentral": 2.85, + "japaneast": 3.16, + "northeurope": 2.42, + "norwaywest": 4.241, + "southafricanorth": 2.921, + "southcentralus": 2.736, + "southeastasia": 3.18, + "uaenorth": 2.782, + "uksouth": 2.85, + "usgovarizona": 2.85, + "usgovvirginia": 2.85, + "westeurope": 2.85, + "westus": 2.28, + "westus2": 2.28 + }, + "standardnv32asv4": { + "australiaeast": 2.703, + "centralindia": 2.61, + "eastus": 1.864, + "eastus2": 1.864, + "japaneast": 2.703, + "northeurope": 2.237, + "southcentralus": 2.237, + "southeastasia": 2.423, + "uksouth": 2.33, + "westeurope": 2.33, + "westus2": 1.864 + }, + "standardnv48sv3": { + "australiaeast": 6.358, + "brazilsouth": 7.752, + "eastus": 4.56, + "eastus2": 4.56, + "francecentral": 5.7, + "japaneast": 6.32, + "northeurope": 4.838, + "norwaywest": 8.482, + "southafricanorth": 5.841, + "southcentralus": 5.472, + "southeastasia": 6.36, + "uaenorth": 5.563, + "uksouth": 5.7, + "usgovarizona": 5.7, + "usgovvirginia": 5.7, + "westeurope": 5.7, + "westus": 4.56, + "westus2": 4.56 + }, + "standardpb6s": { + "brazilsoutheast": 0.83, + "eastus": 0.83, + "southcentralus": 0.913, + "southeastasia": 1.079, + "westeurope": 1.079, + "westus2": 0.83 + }, + "standardpb12s": { + "brazilsoutheast": 1.66, + "eastus": 1.66, + "southcentralus": 1.826, + "southeastasia": 2.158, + "westeurope": 2.158, + "westus2": 1.66 + }, + "standardpb24s": { + "brazilsoutheast": 3.32, + "eastus": 3.32, + "southcentralus": 3.652, + "southeastasia": 4.316, + "westeurope": 4.316, + "westus2": 3.32 + } + }, + "azure_windows": { + "basica0": { + "australiacentral": 0.024, + "australiacentral2": 0.024, + "australiaeast": 0.024, + "australiasoutheast": 0.024, + "brazilsouth": 0.022, + "brazilsoutheast": 0.0401, + "canadacentral": 0.02, + "canadaeast": 0.02, + "centralindia": 0.018, + "centralus": 0.018, + "eastasia": 0.018, + "eastus": 0.018, + "eastus2": 0.018, + "francecentral": 0.02, + "francesouth": 0.026, + "germanycentral": 0.021, + "germanynortheast": 0.021, + "japaneast": 0.022, + "japanwest": 0.0171, + "koreacentral": 0.018, + "koreasouth": 0.016, + "northcentralus": 0.018, + "northeurope": 0.018, + "southcentralus": 0.018, + "southeastasia": 0.018, + "southindia": 0.016, + "uksouth": 0.02, + "ukwest": 0.02, + "usgovarizona": 0.017, + "usgovtexas": 0.017, + "usgovvirginia": 0.017, + "westcentralus": 0.018, + "westeurope": 0.018, + "westindia": 0.018, + "westus": 0.018, + "westus2": 0.018 + }, + "basica1": { + "australiacentral": 0.041, + "australiacentral2": 0.041, + "australiaeast": 0.041, + "australiasoutheast": 0.041, + "brazilsouth": 0.05, + "brazilsoutheast": 0.0993, + "canadacentral": 0.035, + "canadaeast": 0.035, + "centralindia": 0.039, + "centralus": 0.035, + "eastasia": 0.049, + "eastus": 0.032, + "eastus2": 0.035, + "francecentral": 0.035, + "francesouth": 0.0455, + "germanycentral": 0.039, + "germanynortheast": 0.039, + "japaneast": 0.041, + "japanwest": 0.041, + "koreacentral": 0.041, + "koreasouth": 0.037, + "northcentralus": 0.032, + "northeurope": 0.034, + "southcentralus": 0.035, + "southeastasia": 0.039, + "southindia": 0.043, + "uksouth": 0.035, + "ukwest": 0.035, + "usgovarizona": 0.0326, + "usgovtexas": 0.0326, + "usgovvirginia": 0.0326, + "westcentralus": 0.035, + "westeurope": 0.036, + "westindia": 0.039, + "westus": 0.04, + "westus2": 0.032 + }, + "basica2": { + "australiacentral": 0.143, + "australiacentral2": 0.143, + "australiaeast": 0.143, + "australiasoutheast": 0.167, + "brazilsouth": 0.153, + "brazilsoutheast": 0.238, + "canadacentral": 0.147, + "canadaeast": 0.147, + "centralindia": 0.134, + "centralus": 0.139, + "eastasia": 0.157, + "eastus": 0.133, + "eastus2": 0.11, + "francecentral": 0.16, + "francesouth": 0.208, + "germanycentral": 0.13, + "germanynortheast": 0.13, + "japaneast": 0.145, + "japanwest": 0.143, + "koreacentral": 0.162, + "koreasouth": 0.146, + "northcentralus": 0.139, + "northeurope": 0.113, + "southcentralus": 0.133, + "southeastasia": 0.137, + "southindia": 0.141, + "uksouth": 0.16, + "ukwest": 0.16, + "usgovarizona": 0.0996, + "usgovtexas": 0.0996, + "usgovvirginia": 0.0996, + "westcentralus": 0.133, + "westeurope": 0.121, + "westindia": 0.134, + "westus": 0.121, + "westus2": 0.11 + }, + "basica3": { + "australiacentral": 0.372, + "australiacentral2": 0.372, + "australiaeast": 0.372, + "australiasoutheast": 0.372, + "brazilsouth": 0.356, + "brazilsoutheast": 0.486, + "canadacentral": 0.326, + "canadaeast": 0.326, + "centralindia": 0.348, + "centralus": 0.308, + "eastasia": 0.348, + "eastus": 0.296, + "eastus2": 0.296, + "francecentral": 0.356, + "francesouth": 0.4628, + "germanycentral": 0.345, + "germanynortheast": 0.345, + "japaneast": 0.38, + "japanwest": 0.3168, + "koreacentral": 0.374, + "koreasouth": 0.337, + "northcentralus": 0.308, + "northeurope": 0.3, + "southcentralus": 0.296, + "southeastasia": 0.348, + "southindia": 0.313, + "uksouth": 0.356, + "ukwest": 0.356, + "usgovarizona": 0.268, + "usgovtexas": 0.268, + "usgovvirginia": 0.268, + "westcentralus": 0.296, + "westeurope": 0.324, + "westindia": 0.348, + "westus": 0.308, + "westus2": 0.296 + }, + "basica4": { + "australiacentral": 0.744, + "australiacentral2": 0.744, + "australiaeast": 0.744, + "australiasoutheast": 0.744, + "brazilsouth": 0.712, + "brazilsoutheast": 0.971, + "canadacentral": 0.651, + "canadaeast": 0.651, + "centralindia": 0.696, + "centralus": 0.616, + "eastasia": 0.696, + "eastus": 0.592, + "eastus2": 0.592, + "francecentral": 0.713, + "francesouth": 0.9269, + "germanycentral": 0.69, + "germanynortheast": 0.69, + "japaneast": 0.76, + "japanwest": 0.6336, + "koreacentral": 0.748, + "koreasouth": 0.673, + "northcentralus": 0.616, + "northeurope": 0.6, + "southcentralus": 0.592, + "southeastasia": 0.696, + "southindia": 0.626, + "uksouth": 0.713, + "ukwest": 0.713, + "usgovarizona": 0.536, + "usgovtexas": 0.536, + "usgovvirginia": 0.536, + "westcentralus": 0.592, + "westeurope": 0.648, + "westindia": 0.696, + "westus": 0.616, + "westus2": 0.592 + }, + "lowprioritya1": { + "australiacentral": 0.045, + "australiacentral2": 0.045, + "australiaeast": 0.045, + "australiasoutheast": 0.045, + "brazilsouth": 0.044, + "canadacentral": 0.038, + "canadaeast": 0.038, + "centralindia": 0.039, + "centralus": 0.036, + "eastasia": 0.036, + "eastus": 0.036, + "eastus2": 0.036, + "francecentral": 0.04, + "francesouth": 0.052, + "germanycentral": 0.04, + "germanynortheast": 0.04, + "japaneast": 0.042, + "japanwest": 0.038, + "koreacentral": 0.044, + "koreasouth": 0.04, + "northcentralus": 0.036, + "northeurope": 0.036, + "southcentralus": 0.036, + "southeastasia": 0.036, + "southindia": 0.035, + "uksouth": 0.04, + "ukwest": 0.04, + "usgovarizona": 0.033, + "usgovtexas": 0.033, + "usgovvirginia": 0.033, + "westcentralus": 0.034, + "westeurope": 0.036, + "westindia": 0.039, + "westus": 0.036, + "westus2": 0.034 + }, + "lowprioritya1v2": { + "australiacentral": 0.03, + "australiacentral2": 0.03, + "australiaeast": 0.03, + "australiasoutheast": 0.03, + "brazilsouth": 0.037, + "brazilsoutheast": 0.0501, + "canadacentral": 0.026, + "canadaeast": 0.026, + "centralindia": 0.028, + "centralus": 0.026, + "eastasia": 0.03, + "eastus": 0.026, + "eastus2": 0.026, + "francecentral": 0.03, + "francesouth": 0.039, + "germanycentral": 0.028, + "germanynorth": 0.0397, + "germanynortheast": 0.028, + "germanywestcentral": 0.0248, + "japaneast": 0.032, + "japanwest": 0.032, + "koreacentral": 0.032, + "koreasouth": 0.029, + "northcentralus": 0.026, + "northeurope": 0.025, + "norwayeast": 0.0364, + "norwaywest": 0.0419, + "southafricanorth": 0.0377, + "southafricawest": 0.0424, + "southcentralus": 0.026, + "southeastasia": 0.027, + "southindia": 0.028, + "switzerlandnorth": 0.0381, + "switzerlandwest": 0.044, + "uaecentral": 0.0409, + "uaenorth": 0.0357, + "uksouth": 0.03, + "ukwest": 0.03, + "usgovarizona": 0.029, + "usgovtexas": 0.029, + "usgovvirginia": 0.029, + "westcentralus": 0.024, + "westeurope": 0.025, + "westindia": 0.028, + "westus": 0.026, + "westus2": 0.022 + }, + "lowprioritya2": { + "australiacentral": 0.09, + "australiacentral2": 0.09, + "australiaeast": 0.09, + "australiasoutheast": 0.09, + "brazilsouth": 0.088, + "canadacentral": 0.075, + "canadaeast": 0.075, + "centralindia": 0.079, + "centralus": 0.072, + "eastasia": 0.072, + "eastus": 0.072, + "eastus2": 0.072, + "francecentral": 0.079, + "francesouth": 0.1027, + "germanycentral": 0.08, + "germanynortheast": 0.08, + "japaneast": 0.085, + "japanwest": 0.076, + "koreacentral": 0.088, + "koreasouth": 0.079, + "northcentralus": 0.072, + "northeurope": 0.072, + "southcentralus": 0.072, + "southeastasia": 0.072, + "southindia": 0.071, + "uksouth": 0.079, + "ukwest": 0.079, + "usgovarizona": 0.066, + "usgovtexas": 0.066, + "usgovvirginia": 0.066, + "westcentralus": 0.068, + "westeurope": 0.072, + "westindia": 0.079, + "westus": 0.072, + "westus2": 0.068 + }, + "lowprioritya2mv2": { + "australiacentral": 0.09, + "australiacentral2": 0.09, + "australiaeast": 0.09, + "australiasoutheast": 0.108, + "brazilsouth": 0.126, + "brazilsoutheast": 0.145, + "canadacentral": 0.078, + "canadaeast": 0.078, + "centralindia": 0.096, + "centralus": 0.078, + "eastasia": 0.108, + "eastus": 0.072, + "eastus2": 0.072, + "francecentral": 0.108, + "francesouth": 0.1404, + "germanycentral": 0.097, + "germanynorth": 0.101, + "germanynortheast": 0.097, + "germanywestcentral": 0.0752, + "japaneast": 0.093, + "japanwest": 0.108, + "koreacentral": 0.088, + "koreasouth": 0.079, + "northcentralus": 0.078, + "northeurope": 0.084, + "norwayeast": 0.0914, + "norwaywest": 0.108, + "southafricanorth": 0.09, + "southafricawest": 0.103, + "southcentralus": 0.075, + "southeastasia": 0.081, + "southindia": 0.087, + "switzerlandnorth": 0.0963, + "switzerlandwest": 0.114, + "uaecentral": 0.0986, + "uaenorth": 0.0843, + "uksouth": 0.108, + "ukwest": 0.096, + "usgovarizona": 0.096, + "usgovtexas": 0.096, + "usgovvirginia": 0.096, + "westcentralus": 0.072, + "westeurope": 0.075, + "westindia": 0.096, + "westus": 0.09, + "westus2": 0.06 + }, + "lowprioritya2v2": { + "australiacentral": 0.064, + "australiacentral2": 0.064, + "australiaeast": 0.064, + "australiasoutheast": 0.064, + "brazilsouth": 0.077, + "brazilsoutheast": 0.104, + "canadacentral": 0.054, + "canadaeast": 0.054, + "centralindia": 0.059, + "centralus": 0.054, + "eastasia": 0.064, + "eastus": 0.054, + "eastus2": 0.054, + "francecentral": 0.064, + "francesouth": 0.0832, + "germanycentral": 0.06, + "germanynorth": 0.0794, + "germanynortheast": 0.06, + "germanywestcentral": 0.052, + "japaneast": 0.068, + "japanwest": 0.068, + "koreacentral": 0.068, + "koreasouth": 0.061, + "northcentralus": 0.054, + "northeurope": 0.052, + "norwayeast": 0.0751, + "norwaywest": 0.0866, + "southafricanorth": 0.0776, + "southafricawest": 0.088, + "southcentralus": 0.054, + "southeastasia": 0.057, + "southindia": 0.059, + "switzerlandnorth": 0.0762, + "switzerlandwest": 0.088, + "uaecentral": 0.0842, + "uaenorth": 0.0733, + "uksouth": 0.064, + "ukwest": 0.064, + "usgovarizona": 0.058, + "usgovtexas": 0.058, + "usgovvirginia": 0.058, + "westcentralus": 0.05, + "westeurope": 0.052, + "westindia": 0.059, + "westus": 0.054, + "westus2": 0.045 + }, + "lowprioritya3": { + "australiacentral": 0.181, + "australiacentral2": 0.181, + "australiaeast": 0.181, + "australiasoutheast": 0.181, + "brazilsouth": 0.176, + "canadacentral": 0.15, + "canadaeast": 0.15, + "centralindia": 0.157, + "centralus": 0.144, + "eastasia": 0.144, + "eastus": 0.144, + "eastus2": 0.144, + "francecentral": 0.158, + "francesouth": 0.2054, + "germanycentral": 0.159, + "germanynortheast": 0.159, + "japaneast": 0.17, + "japanwest": 0.152, + "koreacentral": 0.176, + "koreasouth": 0.158, + "northcentralus": 0.144, + "northeurope": 0.144, + "southcentralus": 0.144, + "southeastasia": 0.144, + "southindia": 0.142, + "uksouth": 0.158, + "ukwest": 0.158, + "usgovarizona": 0.133, + "usgovtexas": 0.133, + "usgovvirginia": 0.133, + "westcentralus": 0.136, + "westeurope": 0.144, + "westindia": 0.157, + "westus": 0.144, + "westus2": 0.136 + }, + "lowprioritya4": { + "australiacentral": 0.362, + "australiacentral2": 0.362, + "australiaeast": 0.362, + "australiasoutheast": 0.362, + "brazilsouth": 0.352, + "canadacentral": 0.3, + "canadaeast": 0.3, + "centralindia": 0.314, + "centralus": 0.288, + "eastasia": 0.288, + "eastus": 0.288, + "eastus2": 0.288, + "francecentral": 0.317, + "francesouth": 0.4121, + "germanycentral": 0.318, + "germanynortheast": 0.318, + "japaneast": 0.339, + "japanwest": 0.304, + "koreacentral": 0.352, + "koreasouth": 0.317, + "northcentralus": 0.288, + "northeurope": 0.288, + "southcentralus": 0.288, + "southeastasia": 0.288, + "southindia": 0.283, + "uksouth": 0.317, + "ukwest": 0.317, + "usgovarizona": 0.266, + "usgovtexas": 0.266, + "usgovvirginia": 0.266, + "westcentralus": 0.272, + "westeurope": 0.288, + "westindia": 0.314, + "westus": 0.288, + "westus2": 0.272 + }, + "lowprioritya4mv2": { + "australiacentral": 0.189, + "australiacentral2": 0.189, + "australiaeast": 0.189, + "australiasoutheast": 0.227, + "brazilsouth": 0.265, + "brazilsoutheast": 0.301, + "canadacentral": 0.164, + "canadaeast": 0.164, + "centralindia": 0.202, + "centralus": 0.164, + "eastasia": 0.227, + "eastus": 0.144, + "eastus2": 0.151, + "francecentral": 0.227, + "francesouth": 0.2951, + "germanycentral": 0.203, + "germanynorth": 0.203, + "germanynortheast": 0.203, + "germanywestcentral": 0.158, + "japaneast": 0.195, + "japanwest": 0.227, + "koreacentral": 0.185, + "koreasouth": 0.167, + "northcentralus": 0.164, + "northeurope": 0.176, + "norwayeast": 0.188, + "norwaywest": 0.222, + "southafricanorth": 0.185, + "southafricawest": 0.213, + "southcentralus": 0.15, + "southeastasia": 0.17, + "southindia": 0.183, + "switzerlandnorth": 0.193, + "switzerlandwest": 0.228, + "uaecentral": 0.203, + "uaenorth": 0.173, + "uksouth": 0.227, + "ukwest": 0.202, + "usgovarizona": 0.192, + "usgovtexas": 0.192, + "usgovvirginia": 0.192, + "westcentralus": 0.151, + "westeurope": 0.158, + "westindia": 0.202, + "westus": 0.18, + "westus2": 0.126 + }, + "lowprioritya4v2": { + "australiacentral": 0.133, + "australiacentral2": 0.133, + "australiaeast": 0.133, + "australiasoutheast": 0.133, + "brazilsouth": 0.162, + "brazilsoutheast": 0.214, + "canadacentral": 0.114, + "canadaeast": 0.114, + "centralindia": 0.124, + "centralus": 0.114, + "eastasia": 0.133, + "eastus": 0.114, + "eastus2": 0.114, + "francecentral": 0.133, + "francesouth": 0.1729, + "germanycentral": 0.126, + "germanynorth": 0.159, + "germanynortheast": 0.126, + "germanywestcentral": 0.11, + "japaneast": 0.143, + "japanwest": 0.143, + "koreacentral": 0.142, + "koreasouth": 0.128, + "northcentralus": 0.114, + "northeurope": 0.11, + "norwayeast": 0.154, + "norwaywest": 0.178, + "southafricanorth": 0.159, + "southafricawest": 0.18, + "southcentralus": 0.114, + "southeastasia": 0.119, + "southindia": 0.124, + "switzerlandnorth": 0.152, + "switzerlandwest": 0.176, + "uaecentral": 0.173, + "uaenorth": 0.15, + "uksouth": 0.133, + "ukwest": 0.133, + "usgovarizona": 0.117, + "usgovtexas": 0.117, + "usgovvirginia": 0.117, + "westcentralus": 0.105, + "westeurope": 0.11, + "westindia": 0.124, + "westus": 0.114, + "westus2": 0.095 + }, + "lowprioritya5": { + "australiacentral": 0.14, + "australiacentral2": 0.14, + "australiaeast": 0.14, + "australiasoutheast": 0.14, + "brazilsouth": 0.147, + "canadacentral": 0.132, + "canadaeast": 0.132, + "centralindia": 0.122, + "centralus": 0.132, + "eastasia": 0.144, + "eastus": 0.132, + "eastus2": 0.12, + "francecentral": 0.15, + "francesouth": 0.195, + "germanycentral": 0.138, + "germanynortheast": 0.138, + "japaneast": 0.14, + "japanwest": 0.124, + "koreacentral": 0.115, + "koreasouth": 0.103, + "northcentralus": 0.132, + "northeurope": 0.12, + "southcentralus": 0.12, + "southeastasia": 0.128, + "southindia": 0.11, + "uksouth": 0.15, + "ukwest": 0.15, + "usgovarizona": 0.109, + "usgovtexas": 0.109, + "usgovvirginia": 0.109, + "westcentralus": 0.12, + "westeurope": 0.136, + "westindia": 0.122, + "westus": 0.132, + "westus2": 0.12 + }, + "lowprioritya6": { + "australiacentral": 0.279, + "australiacentral2": 0.279, + "australiaeast": 0.279, + "australiasoutheast": 0.279, + "brazilsouth": 0.294, + "canadacentral": 0.264, + "canadaeast": 0.264, + "centralindia": 0.244, + "centralus": 0.264, + "eastasia": 0.288, + "eastus": 0.264, + "eastus2": 0.24, + "francecentral": 0.299, + "francesouth": 0.3887, + "germanycentral": 0.276, + "germanynortheast": 0.276, + "japaneast": 0.28, + "japanwest": 0.248, + "koreacentral": 0.229, + "koreasouth": 0.206, + "northcentralus": 0.264, + "northeurope": 0.24, + "southcentralus": 0.24, + "southeastasia": 0.256, + "southindia": 0.22, + "uksouth": 0.299, + "ukwest": 0.299, + "usgovarizona": 0.218, + "usgovtexas": 0.218, + "usgovvirginia": 0.218, + "westcentralus": 0.24, + "westeurope": 0.272, + "westindia": 0.244, + "westus": 0.264, + "westus2": 0.24 + }, + "lowprioritya7": { + "australiacentral": 0.558, + "australiacentral2": 0.558, + "australiaeast": 0.558, + "australiasoutheast": 0.558, + "brazilsouth": 0.589, + "canadacentral": 0.528, + "canadaeast": 0.528, + "centralindia": 0.488, + "centralus": 0.528, + "eastasia": 0.576, + "eastus": 0.528, + "eastus2": 0.48, + "francecentral": 0.598, + "francesouth": 0.7774, + "germanycentral": 0.552, + "germanynortheast": 0.552, + "japaneast": 0.56, + "japanwest": 0.496, + "koreacentral": 0.458, + "koreasouth": 0.412, + "northcentralus": 0.528, + "northeurope": 0.48, + "southcentralus": 0.48, + "southeastasia": 0.512, + "southindia": 0.439, + "uksouth": 0.598, + "ukwest": 0.598, + "usgovarizona": 0.436, + "usgovtexas": 0.436, + "usgovvirginia": 0.436, + "westcentralus": 0.48, + "westeurope": 0.544, + "westindia": 0.488, + "westus": 0.528, + "westus2": 0.48 + }, + "lowprioritya8": { + "eastus": 0.586, + "japaneast": 0.701, + "northcentralus": 0.586, + "northeurope": 0.54, + "southcentralus": 0.54, + "westeurope": 0.621, + "westus": 0.586 + }, + "lowprioritya8mv2": { + "australiacentral": 0.397, + "australiacentral2": 0.397, + "australiaeast": 0.397, + "australiasoutheast": 0.476, + "brazilsouth": 0.556, + "brazilsoutheast": 0.624, + "canadacentral": 0.344, + "canadaeast": 0.344, + "centralindia": 0.423, + "centralus": 0.344, + "eastasia": 0.476, + "eastus": 0.288, + "eastus2": 0.318, + "francecentral": 0.476, + "francesouth": 0.6188, + "germanycentral": 0.426, + "germanynorth": 0.405, + "germanynortheast": 0.426, + "germanywestcentral": 0.331, + "japaneast": 0.41, + "japanwest": 0.476, + "koreacentral": 0.389, + "koreasouth": 0.35, + "northcentralus": 0.344, + "northeurope": 0.37, + "norwayeast": 0.387, + "norwaywest": 0.46, + "southafricanorth": 0.382, + "southafricawest": 0.441, + "southcentralus": 0.3, + "southeastasia": 0.357, + "southindia": 0.384, + "switzerlandnorth": 0.385, + "switzerlandwest": 0.457, + "uaecentral": 0.42, + "uaenorth": 0.357, + "uksouth": 0.476, + "ukwest": 0.423, + "usgovarizona": 0.384, + "usgovtexas": 0.384, + "usgovvirginia": 0.384, + "westcentralus": 0.318, + "westeurope": 0.331, + "westindia": 0.423, + "westus": 0.36, + "westus2": 0.265 + }, + "lowprioritya8v2": { + "australiacentral": 0.28, + "australiacentral2": 0.28, + "australiaeast": 0.28, + "australiasoutheast": 0.28, + "brazilsouth": 0.34, + "brazilsoutheast": 0.442, + "canadacentral": 0.24, + "canadaeast": 0.24, + "centralindia": 0.26, + "centralus": 0.24, + "eastasia": 0.28, + "eastus": 0.24, + "eastus2": 0.24, + "francecentral": 0.28, + "francesouth": 0.364, + "germanycentral": 0.264, + "germanynorth": 0.318, + "germanynortheast": 0.264, + "germanywestcentral": 0.23, + "japaneast": 0.3, + "japanwest": 0.3, + "koreacentral": 0.299, + "koreasouth": 0.269, + "northcentralus": 0.24, + "northeurope": 0.23, + "norwayeast": 0.316, + "norwaywest": 0.366, + "southafricanorth": 0.326, + "southafricawest": 0.371, + "southcentralus": 0.24, + "southeastasia": 0.25, + "southindia": 0.26, + "switzerlandnorth": 0.305, + "switzerlandwest": 0.352, + "uaecentral": 0.355, + "uaenorth": 0.307, + "uksouth": 0.28, + "ukwest": 0.28, + "usgovarizona": 0.234, + "usgovtexas": 0.234, + "usgovvirginia": 0.234, + "westcentralus": 0.22, + "westeurope": 0.23, + "westindia": 0.26, + "westus": 0.24, + "westus2": 0.2 + }, + "lowprioritya9": { + "eastus": 1.173, + "japaneast": 1.402, + "northcentralus": 1.173, + "northeurope": 1.08, + "southcentralus": 1.08, + "westeurope": 1.242, + "westus": 1.173 + }, + "lowprioritya10": { + "eastus": 0.469, + "japaneast": 0.561, + "northcentralus": 0.469, + "northeurope": 0.432, + "southcentralus": 0.432, + "westeurope": 0.497, + "westus": 0.469 + }, + "lowprioritya11": { + "eastus": 0.938, + "japaneast": 1.122, + "northcentralus": 0.938, + "northeurope": 0.864, + "southcentralus": 0.864, + "westeurope": 0.994, + "westus": 0.938 + }, + "lowpriorityd1": { + "australiaeast": 0.062, + "australiasoutheast": 0.062, + "brazilsouth": 0.063, + "brazilsoutheast": 0.0678, + "centralus": 0.056, + "eastasia": 0.074, + "eastus": 0.056, + "eastus2": 0.052, + "japaneast": 0.067, + "japanwest": 0.058, + "northcentralus": 0.056, + "northeurope": 0.0516, + "southcentralus": 0.052, + "southeastasia": 0.064, + "uaecentral": 0.0602, + "uaenorth": 0.0506, + "usgovvirginia": 0.0614, + "westeurope": 0.059, + "westus": 0.056 + }, + "lowpriorityd1v2": { + "australiacentral": 0.0561, + "australiacentral2": 0.0561, + "australiaeast": 0.0561, + "australiasoutheast": 0.0561, + "brazilsouth": 0.0527, + "brazilsoutheast": 0.0629, + "canadacentral": 0.0515, + "canadaeast": 0.0515, + "centralindia": 0.052, + "centralus": 0.0504, + "eastasia": 0.0667, + "eastus": 0.0504, + "eastus2": 0.0468, + "francecentral": 0.0588, + "francesouth": 0.0764, + "germanycentral": 0.058, + "germanynorth": 0.0595, + "germanynortheast": 0.058, + "germanywestcentral": 0.0568, + "japaneast": 0.0546, + "japanwest": 0.0526, + "koreacentral": 0.0514, + "koreasouth": 0.046, + "northcentralus": 0.0504, + "northeurope": 0.0465, + "norwayeast": 0.0483, + "norwaywest": 0.0572, + "southafricanorth": 0.0492, + "southafricawest": 0.0568, + "southcentralus": 0.0468, + "southeastasia": 0.058, + "southindia": 0.052, + "switzerlandnorth": 0.051, + "switzerlandwest": 0.0608, + "uaecentral": 0.0541, + "uaenorth": 0.0459, + "uksouth": 0.0588, + "ukwest": 0.0588, + "usgovarizona": 0.0585, + "usgovtexas": 0.0585, + "usgovvirginia": 0.0585, + "westcentralus": 0.0468, + "westeurope": 0.0533, + "westindia": 0.052, + "westus": 0.0504, + "westus2": 0.0468 + }, + "lowpriorityd2": { + "australiaeast": 0.125, + "australiasoutheast": 0.125, + "brazilsouth": 0.126, + "brazilsoutheast": 0.136, + "centralus": 0.112, + "eastasia": 0.148, + "eastus": 0.112, + "eastus2": 0.104, + "japaneast": 0.134, + "japanwest": 0.117, + "northcentralus": 0.112, + "northeurope": 0.103, + "southcentralus": 0.104, + "southeastasia": 0.129, + "uaecentral": 0.12, + "uaenorth": 0.101, + "usgovvirginia": 0.123, + "westeurope": 0.119, + "westus": 0.112 + }, + "lowpriorityd2asv4": { + "australiaeast": 0.0848, + "brazilsouth": 0.098, + "centralindia": 0.0772, + "centralus": 0.0802, + "eastasia": 0.0896, + "eastus": 0.0752, + "eastus2": 0.0752, + "francecentral": 0.0816, + "japaneast": 0.0864, + "koreacentral": 0.084, + "northeurope": 0.0796, + "southcentralus": 0.0829, + "southeastasia": 0.0848, + "uksouth": 0.0812, + "westeurope": 0.0828, + "westus": 0.0816, + "westus2": 0.0752 + }, + "lowpriorityd2av4": { + "australiaeast": 0.0848, + "brazilsouth": 0.098, + "centralindia": 0.0772, + "centralus": 0.0802, + "eastasia": 0.0896, + "eastus": 0.0752, + "eastus2": 0.0752, + "francecentral": 0.0816, + "japaneast": 0.0864, + "koreacentral": 0.084, + "northeurope": 0.0796, + "southcentralus": 0.0829, + "southeastasia": 0.0848, + "uksouth": 0.0812, + "westeurope": 0.0828, + "westus": 0.0816, + "westus2": 0.0752 + }, + "lowpriorityd2dsv4": { + "australiaeast": 0.0936, + "australiasoutheast": 0.091, + "brazilsouth": 0.109, + "canadacentral": 0.0872, + "canadaeast": 0.091, + "centralindia": 0.0856, + "centralus": 0.0879, + "eastasia": 0.107, + "eastus": 0.082, + "eastus2": 0.082, + "francecentral": 0.0896, + "francesouth": 0.106, + "germanywestcentral": 0.0912, + "japaneast": 0.0952, + "japanwest": 0.101, + "koreacentral": 0.0924, + "northcentralus": 0.082, + "northeurope": 0.0872, + "southafricanorth": 0.0974, + "southcentralus": 0.0956, + "southeastasia": 0.0932, + "switzerlandnorth": 0.105, + "uksouth": 0.0892, + "ukwest": 0.0915, + "usgovarizona": 0.094, + "usgovtexas": 0.0933, + "usgovvirginia": 0.094, + "westcentralus": 0.091, + "westeurope": 0.0912, + "westus": 0.09, + "westus2": 0.082 + }, + "lowpriorityd2dv4": { + "australiaeast": 0.0936, + "australiasoutheast": 0.091, + "brazilsouth": 0.109, + "canadacentral": 0.0872, + "canadaeast": 0.091, + "centralindia": 0.0856, + "centralus": 0.0879, + "eastasia": 0.107, + "eastus": 0.082, + "eastus2": 0.082, + "francecentral": 0.0896, + "francesouth": 0.106, + "germanywestcentral": 0.0912, + "japaneast": 0.0952, + "japanwest": 0.101, + "koreacentral": 0.0924, + "northcentralus": 0.082, + "northeurope": 0.0872, + "southafricanorth": 0.0974, + "southcentralus": 0.0956, + "southeastasia": 0.0932, + "switzerlandnorth": 0.105, + "uksouth": 0.0892, + "ukwest": 0.0915, + "usgovarizona": 0.094, + "usgovtexas": 0.0933, + "usgovvirginia": 0.094, + "westcentralus": 0.091, + "westeurope": 0.0912, + "westus": 0.09, + "westus2": 0.082 + }, + "lowpriorityd2sv3": { + "australiacentral": 0.0868, + "australiacentral2": 0.0868, + "australiaeast": 0.0868, + "australiasoutheast": 0.0868, + "brazilsouth": 0.1, + "brazilsoutheast": 0.119, + "canadacentral": 0.081, + "canadaeast": 0.081, + "centralindia": 0.0788, + "centralus": 0.084, + "eastasia": 0.0896, + "eastus": 0.075, + "eastus2": 0.075, + "francecentral": 0.0816, + "francesouth": 0.106, + "germanycentral": 0.0916, + "germanynorth": 0.0966, + "germanynortheast": 0.0916, + "germanywestcentral": 0.0828, + "japaneast": 0.088, + "japanwest": 0.088, + "koreacentral": 0.086, + "koreasouth": 0.0774, + "northcentralus": 0.0768, + "northeurope": 0.0796, + "norwayeast": 0.0896, + "norwaywest": 0.105, + "southafricanorth": 0.0904, + "southafricawest": 0.104, + "southcentralus": 0.084, + "southeastasia": 0.0868, + "southindia": 0.0946, + "switzerlandnorth": 0.0944, + "switzerlandwest": 0.112, + "uaecentral": 0.0992, + "uaenorth": 0.0848, + "uksouth": 0.083, + "ukwest": 0.083, + "usgovarizona": 0.087, + "usgovtexas": 0.087, + "usgovvirginia": 0.087, + "westcentralus": 0.084, + "westeurope": 0.0848, + "westindia": 0.086, + "westus": 0.0836, + "westus2": 0.075 + }, + "lowpriorityd2sv4": { + "australiaeast": 0.0848, + "australiasoutheast": 0.0867, + "brazilsouth": 0.098, + "brazilsoutheast": 0.116, + "canadacentral": 0.0796, + "canadaeast": 0.0796, + "centralindia": 0.0772, + "centralus": 0.0802, + "eastasia": 0.0963, + "eastus": 0.0752, + "eastus2": 0.0752, + "francecentral": 0.0816, + "francesouth": 0.0952, + "germanywestcentral": 0.0828, + "japaneast": 0.0864, + "japanwest": 0.0914, + "koreacentral": 0.084, + "northcentralus": 0.0752, + "northeurope": 0.0796, + "southafricanorth": 0.0883, + "southcentralus": 0.0829, + "southeastasia": 0.0848, + "switzerlandnorth": 0.0944, + "uksouth": 0.0812, + "ukwest": 0.0833, + "usgovarizona": 0.0852, + "usgovtexas": 0.0848, + "usgovvirginia": 0.0852, + "westcentralus": 0.0829, + "westeurope": 0.0828, + "westus": 0.0816, + "westus2": 0.0752 + }, + "lowpriorityd2v2": { + "australiacentral": 0.112, + "australiacentral2": 0.112, + "australiaeast": 0.112, + "australiasoutheast": 0.112, + "brazilsouth": 0.105, + "brazilsoutheast": 0.126, + "canadacentral": 0.103, + "canadaeast": 0.103, + "centralindia": 0.104, + "centralus": 0.101, + "eastasia": 0.133, + "eastus": 0.101, + "eastus2": 0.0936, + "francecentral": 0.118, + "francesouth": 0.153, + "germanycentral": 0.115, + "germanynorth": 0.119, + "germanynortheast": 0.115, + "germanywestcentral": 0.114, + "japaneast": 0.109, + "japanwest": 0.105, + "koreacentral": 0.103, + "koreasouth": 0.092, + "northcentralus": 0.101, + "northeurope": 0.0929, + "norwayeast": 0.0966, + "norwaywest": 0.115, + "southafricanorth": 0.098, + "southafricawest": 0.114, + "southcentralus": 0.0936, + "southeastasia": 0.116, + "southindia": 0.104, + "switzerlandnorth": 0.102, + "switzerlandwest": 0.122, + "uaecentral": 0.108, + "uaenorth": 0.0918, + "uksouth": 0.118, + "ukwest": 0.118, + "usgovarizona": 0.117, + "usgovtexas": 0.117, + "usgovvirginia": 0.117, + "westcentralus": 0.0936, + "westeurope": 0.107, + "westindia": 0.104, + "westus": 0.101, + "westus2": 0.0936 + }, + "lowpriorityd2v3": { + "australiacentral": 0.0868, + "australiacentral2": 0.0868, + "australiaeast": 0.0868, + "australiasoutheast": 0.0868, + "brazilsouth": 0.1, + "brazilsoutheast": 0.119, + "canadacentral": 0.081, + "canadaeast": 0.081, + "centralindia": 0.0788, + "centralus": 0.084, + "eastasia": 0.0896, + "eastus": 0.075, + "eastus2": 0.075, + "francecentral": 0.0816, + "francesouth": 0.106, + "germanycentral": 0.0916, + "germanynorth": 0.0966, + "germanynortheast": 0.0916, + "germanywestcentral": 0.0828, + "japaneast": 0.088, + "japanwest": 0.088, + "koreacentral": 0.086, + "koreasouth": 0.0774, + "northcentralus": 0.0768, + "northeurope": 0.0796, + "norwayeast": 0.0896, + "norwaywest": 0.105, + "southafricanorth": 0.0904, + "southafricawest": 0.104, + "southcentralus": 0.084, + "southeastasia": 0.0868, + "southindia": 0.0946, + "switzerlandnorth": 0.0944, + "switzerlandwest": 0.112, + "uaecentral": 0.0992, + "uaenorth": 0.0848, + "uksouth": 0.083, + "ukwest": 0.083, + "usgovarizona": 0.087, + "usgovtexas": 0.087, + "usgovvirginia": 0.087, + "westcentralus": 0.084, + "westeurope": 0.0848, + "westindia": 0.086, + "westus": 0.0836, + "westus2": 0.075 + }, + "lowpriorityd2v4": { + "australiaeast": 0.0848, + "australiasoutheast": 0.0867, + "brazilsouth": 0.098, + "brazilsoutheast": 0.116, + "canadacentral": 0.0796, + "canadaeast": 0.0796, + "centralindia": 0.0772, + "centralus": 0.0802, + "eastasia": 0.0963, + "eastus": 0.0752, + "eastus2": 0.0752, + "francecentral": 0.0816, + "francesouth": 0.0952, + "germanywestcentral": 0.0828, + "japaneast": 0.0864, + "japanwest": 0.0914, + "koreacentral": 0.084, + "northcentralus": 0.0752, + "northeurope": 0.0796, + "southafricanorth": 0.0883, + "southcentralus": 0.0829, + "southeastasia": 0.0848, + "switzerlandnorth": 0.0944, + "uksouth": 0.0812, + "ukwest": 0.0833, + "usgovarizona": 0.0852, + "usgovtexas": 0.0848, + "usgovvirginia": 0.0852, + "westcentralus": 0.0829, + "westeurope": 0.0828, + "westus": 0.0816, + "westus2": 0.0752 + }, + "lowpriorityd3": { + "australiaeast": 0.25, + "australiasoutheast": 0.25, + "brazilsouth": 0.253, + "brazilsoutheast": 0.271, + "centralus": 0.224, + "eastasia": 0.296, + "eastus": 0.224, + "eastus2": 0.208, + "japaneast": 0.269, + "japanwest": 0.234, + "northcentralus": 0.224, + "northeurope": 0.206, + "southcentralus": 0.208, + "southeastasia": 0.258, + "uaecentral": 0.241, + "uaenorth": 0.202, + "usgovvirginia": 0.245, + "westeurope": 0.237, + "westus": 0.224 + }, + "lowpriorityd3v2": { + "australiacentral": 0.225, + "australiacentral2": 0.225, + "australiaeast": 0.225, + "australiasoutheast": 0.225, + "brazilsouth": 0.211, + "brazilsoutheast": 0.252, + "canadacentral": 0.206, + "canadaeast": 0.206, + "centralindia": 0.208, + "centralus": 0.202, + "eastasia": 0.267, + "eastus": 0.202, + "eastus2": 0.187, + "francecentral": 0.235, + "francesouth": 0.306, + "germanycentral": 0.23, + "germanynorth": 0.238, + "germanynortheast": 0.23, + "germanywestcentral": 0.227, + "japaneast": 0.218, + "japanwest": 0.21, + "koreacentral": 0.206, + "koreasouth": 0.185, + "northcentralus": 0.202, + "northeurope": 0.186, + "norwayeast": 0.193, + "norwaywest": 0.229, + "southafricanorth": 0.196, + "southafricawest": 0.228, + "southcentralus": 0.187, + "southeastasia": 0.232, + "southindia": 0.208, + "switzerlandnorth": 0.204, + "switzerlandwest": 0.243, + "uaecentral": 0.216, + "uaenorth": 0.184, + "uksouth": 0.235, + "ukwest": 0.235, + "usgovarizona": 0.234, + "usgovtexas": 0.234, + "usgovvirginia": 0.234, + "westcentralus": 0.187, + "westeurope": 0.213, + "westindia": 0.208, + "westus": 0.202, + "westus2": 0.187 + }, + "lowpriorityd4": { + "australiaeast": 0.499, + "australiasoutheast": 0.499, + "brazilsouth": 0.506, + "brazilsoutheast": 0.542, + "centralus": 0.448, + "eastasia": 0.592, + "eastus": 0.448, + "eastus2": 0.416, + "japaneast": 0.537, + "japanwest": 0.467, + "northcentralus": 0.448, + "northeurope": 0.413, + "southcentralus": 0.416, + "southeastasia": 0.515, + "uaecentral": 0.482, + "uaenorth": 0.404, + "usgovvirginia": 0.491, + "westeurope": 0.475, + "westus": 0.448 + }, + "lowpriorityd4asv4": { + "australiaeast": 0.17, + "brazilsouth": 0.196, + "centralindia": 0.154, + "centralus": 0.16, + "eastasia": 0.179, + "eastus": 0.15, + "eastus2": 0.15, + "francecentral": 0.163, + "japaneast": 0.173, + "koreacentral": 0.168, + "northeurope": 0.159, + "southcentralus": 0.166, + "southeastasia": 0.17, + "uksouth": 0.162, + "westeurope": 0.166, + "westus": 0.163, + "westus2": 0.15 + }, + "lowpriorityd4av4": { + "australiaeast": 0.17, + "brazilsouth": 0.196, + "centralindia": 0.154, + "centralus": 0.16, + "eastasia": 0.179, + "eastus": 0.15, + "eastus2": 0.15, + "francecentral": 0.163, + "japaneast": 0.173, + "koreacentral": 0.168, + "northeurope": 0.159, + "southcentralus": 0.166, + "southeastasia": 0.17, + "uksouth": 0.162, + "westeurope": 0.166, + "westus": 0.163, + "westus2": 0.15 + }, + "lowpriorityd4dsv4": { + "australiaeast": 0.187, + "australiasoutheast": 0.182, + "brazilsouth": 0.218, + "canadacentral": 0.174, + "canadaeast": 0.182, + "centralindia": 0.171, + "centralus": 0.176, + "eastasia": 0.214, + "eastus": 0.164, + "eastus2": 0.164, + "francecentral": 0.179, + "francesouth": 0.211, + "germanywestcentral": 0.182, + "japaneast": 0.19, + "japanwest": 0.202, + "koreacentral": 0.185, + "northcentralus": 0.164, + "northeurope": 0.174, + "southafricanorth": 0.195, + "southcentralus": 0.191, + "southeastasia": 0.186, + "switzerlandnorth": 0.209, + "uksouth": 0.178, + "ukwest": 0.183, + "usgovarizona": 0.188, + "usgovtexas": 0.187, + "usgovvirginia": 0.188, + "westcentralus": 0.182, + "westeurope": 0.182, + "westus": 0.18, + "westus2": 0.164 + }, + "lowpriorityd4dv4": { + "australiaeast": 0.187, + "australiasoutheast": 0.182, + "brazilsouth": 0.218, + "canadacentral": 0.174, + "canadaeast": 0.182, + "centralindia": 0.171, + "centralus": 0.176, + "eastasia": 0.214, + "eastus": 0.164, + "eastus2": 0.164, + "francecentral": 0.179, + "francesouth": 0.211, + "germanywestcentral": 0.182, + "japaneast": 0.19, + "japanwest": 0.202, + "koreacentral": 0.185, + "northcentralus": 0.164, + "northeurope": 0.174, + "southafricanorth": 0.195, + "southcentralus": 0.191, + "southeastasia": 0.186, + "switzerlandnorth": 0.209, + "uksouth": 0.178, + "ukwest": 0.183, + "usgovarizona": 0.188, + "usgovtexas": 0.187, + "usgovvirginia": 0.188, + "westcentralus": 0.182, + "westeurope": 0.182, + "westus": 0.18, + "westus2": 0.164 + }, + "lowpriorityd4sv3": { + "australiacentral": 0.174, + "australiacentral2": 0.174, + "australiaeast": 0.174, + "australiasoutheast": 0.174, + "brazilsouth": 0.201, + "brazilsoutheast": 0.239, + "canadacentral": 0.162, + "canadaeast": 0.162, + "centralindia": 0.1576, + "centralus": 0.169, + "eastasia": 0.179, + "eastus": 0.15, + "eastus2": 0.15, + "francecentral": 0.163, + "francesouth": 0.212, + "germanycentral": 0.183, + "germanynorth": 0.193, + "germanynortheast": 0.183, + "germanywestcentral": 0.166, + "japaneast": 0.177, + "japanwest": 0.177, + "koreacentral": 0.172, + "koreasouth": 0.155, + "northcentralus": 0.154, + "northeurope": 0.159, + "norwayeast": 0.179, + "norwaywest": 0.211, + "southafricanorth": 0.181, + "southafricawest": 0.208, + "southcentralus": 0.169, + "southeastasia": 0.174, + "southindia": 0.189, + "switzerlandnorth": 0.189, + "switzerlandwest": 0.223, + "uaecentral": 0.198, + "uaenorth": 0.17, + "uksouth": 0.166, + "ukwest": 0.166, + "usgovarizona": 0.174, + "usgovtexas": 0.174, + "usgovvirginia": 0.174, + "westcentralus": 0.169, + "westeurope": 0.17, + "westindia": 0.172, + "westus": 0.167, + "westus2": 0.15 + }, + "lowpriorityd4sv4": { + "australiaeast": 0.17, + "australiasoutheast": 0.173, + "brazilsouth": 0.196, + "brazilsoutheast": 0.233, + "canadacentral": 0.159, + "canadaeast": 0.159, + "centralindia": 0.154, + "centralus": 0.16, + "eastasia": 0.193, + "eastus": 0.15, + "eastus2": 0.15, + "francecentral": 0.163, + "francesouth": 0.19, + "germanywestcentral": 0.166, + "japaneast": 0.173, + "japanwest": 0.183, + "koreacentral": 0.168, + "northcentralus": 0.15, + "northeurope": 0.159, + "southafricanorth": 0.177, + "southcentralus": 0.166, + "southeastasia": 0.17, + "switzerlandnorth": 0.189, + "uksouth": 0.162, + "ukwest": 0.167, + "usgovarizona": 0.17, + "usgovtexas": 0.17, + "usgovvirginia": 0.17, + "westcentralus": 0.166, + "westeurope": 0.166, + "westus": 0.163, + "westus2": 0.15 + }, + "lowpriorityd4v2": { + "australiacentral": 0.449, + "australiacentral2": 0.449, + "australiaeast": 0.449, + "australiasoutheast": 0.449, + "brazilsouth": 0.421, + "brazilsoutheast": 0.503, + "canadacentral": 0.412, + "canadaeast": 0.412, + "centralindia": 0.417, + "centralus": 0.403, + "eastasia": 0.533, + "eastus": 0.403, + "eastus2": 0.374, + "francecentral": 0.47, + "francesouth": 0.611, + "germanycentral": 0.461, + "germanynorth": 0.476, + "germanynortheast": 0.461, + "germanywestcentral": 0.454, + "japaneast": 0.437, + "japanwest": 0.42, + "koreacentral": 0.411, + "koreasouth": 0.37, + "northcentralus": 0.403, + "northeurope": 0.372, + "norwayeast": 0.387, + "norwaywest": 0.458, + "southafricanorth": 0.393, + "southafricawest": 0.455, + "southcentralus": 0.374, + "southeastasia": 0.464, + "southindia": 0.417, + "switzerlandnorth": 0.408, + "switzerlandwest": 0.487, + "uaecentral": 0.433, + "uaenorth": 0.367, + "uksouth": 0.47, + "ukwest": 0.47, + "usgovarizona": 0.468, + "usgovtexas": 0.468, + "usgovvirginia": 0.468, + "westcentralus": 0.374, + "westeurope": 0.426, + "westindia": 0.417, + "westus": 0.403, + "westus2": 0.374 + }, + "lowpriorityd4v3": { + "australiacentral": 0.174, + "australiacentral2": 0.174, + "australiaeast": 0.174, + "australiasoutheast": 0.174, + "brazilsouth": 0.201, + "brazilsoutheast": 0.239, + "canadacentral": 0.162, + "canadaeast": 0.162, + "centralindia": 0.1576, + "centralus": 0.169, + "eastasia": 0.179, + "eastus": 0.15, + "eastus2": 0.15, + "francecentral": 0.163, + "francesouth": 0.212, + "germanycentral": 0.183, + "germanynorth": 0.193, + "germanynortheast": 0.183, + "germanywestcentral": 0.166, + "japaneast": 0.177, + "japanwest": 0.177, + "koreacentral": 0.172, + "koreasouth": 0.155, + "northcentralus": 0.154, + "northeurope": 0.159, + "norwayeast": 0.179, + "norwaywest": 0.211, + "southafricanorth": 0.181, + "southafricawest": 0.208, + "southcentralus": 0.169, + "southeastasia": 0.174, + "southindia": 0.189, + "switzerlandnorth": 0.189, + "switzerlandwest": 0.223, + "uaecentral": 0.198, + "uaenorth": 0.17, + "uksouth": 0.166, + "ukwest": 0.166, + "usgovarizona": 0.174, + "usgovtexas": 0.174, + "usgovvirginia": 0.174, + "westcentralus": 0.169, + "westeurope": 0.17, + "westindia": 0.172, + "westus": 0.167, + "westus2": 0.15 + }, + "lowpriorityd4v4": { + "australiaeast": 0.17, + "australiasoutheast": 0.173, + "brazilsouth": 0.196, + "brazilsoutheast": 0.233, + "canadacentral": 0.159, + "canadaeast": 0.159, + "centralindia": 0.154, + "centralus": 0.16, + "eastasia": 0.193, + "eastus": 0.15, + "eastus2": 0.15, + "francecentral": 0.163, + "francesouth": 0.19, + "germanywestcentral": 0.166, + "japaneast": 0.173, + "japanwest": 0.183, + "koreacentral": 0.168, + "northcentralus": 0.15, + "northeurope": 0.159, + "southafricanorth": 0.177, + "southcentralus": 0.166, + "southeastasia": 0.17, + "switzerlandnorth": 0.189, + "uksouth": 0.162, + "ukwest": 0.167, + "usgovarizona": 0.17, + "usgovtexas": 0.17, + "usgovvirginia": 0.17, + "westcentralus": 0.166, + "westeurope": 0.166, + "westus": 0.163, + "westus2": 0.15 + }, + "lowpriorityd5v2": { + "australiacentral": 0.898, + "australiacentral2": 0.898, + "australiaeast": 0.898, + "australiasoutheast": 0.898, + "brazilsouth": 0.842, + "brazilsoutheast": 1.007, + "canadacentral": 0.824, + "canadaeast": 0.824, + "centralindia": 0.834, + "centralus": 0.806, + "eastasia": 1.066, + "eastus": 0.806, + "eastus2": 0.749, + "francecentral": 0.94, + "francesouth": 1.222, + "germanycentral": 0.921, + "germanynorth": 0.952, + "germanynortheast": 0.921, + "germanywestcentral": 0.909, + "japaneast": 0.873, + "japanwest": 0.841, + "koreacentral": 0.823, + "koreasouth": 0.74, + "northcentralus": 0.806, + "northeurope": 0.743, + "norwayeast": 0.773, + "norwaywest": 0.916, + "southafricanorth": 0.785, + "southafricawest": 0.91, + "southcentralus": 0.749, + "southeastasia": 0.927, + "southindia": 0.834, + "switzerlandnorth": 0.817, + "switzerlandwest": 0.973, + "uaecentral": 0.866, + "uaenorth": 0.734, + "uksouth": 0.94, + "ukwest": 0.94, + "usgovarizona": 0.936, + "usgovtexas": 0.936, + "usgovvirginia": 0.936, + "westcentralus": 0.749, + "westeurope": 0.852, + "westindia": 0.834, + "westus": 0.806, + "westus2": 0.749 + }, + "lowpriorityd8asv4": { + "australiaeast": 0.339, + "brazilsouth": 0.392, + "centralindia": 0.309, + "centralus": 0.321, + "eastasia": 0.358, + "eastus": 0.301, + "eastus2": 0.301, + "francecentral": 0.326, + "japaneast": 0.346, + "koreacentral": 0.336, + "northeurope": 0.318, + "southcentralus": 0.332, + "southeastasia": 0.339, + "uksouth": 0.325, + "westeurope": 0.331, + "westus": 0.326, + "westus2": 0.301 + }, + "lowpriorityd8av4": { + "australiaeast": 0.339, + "brazilsouth": 0.392, + "centralindia": 0.309, + "centralus": 0.321, + "eastasia": 0.358, + "eastus": 0.301, + "eastus2": 0.301, + "francecentral": 0.326, + "japaneast": 0.346, + "koreacentral": 0.336, + "northeurope": 0.318, + "southcentralus": 0.332, + "southeastasia": 0.339, + "uksouth": 0.325, + "westeurope": 0.331, + "westus": 0.326, + "westus2": 0.301 + }, + "lowpriorityd8dsv4": { + "australiaeast": 0.374, + "australiasoutheast": 0.364, + "brazilsouth": 0.435, + "canadacentral": 0.349, + "canadaeast": 0.364, + "centralindia": 0.342, + "centralus": 0.352, + "eastasia": 0.427, + "eastus": 0.328, + "eastus2": 0.328, + "francecentral": 0.358, + "francesouth": 0.422, + "germanywestcentral": 0.365, + "japaneast": 0.381, + "japanwest": 0.404, + "koreacentral": 0.37, + "northcentralus": 0.328, + "northeurope": 0.349, + "southafricanorth": 0.389, + "southcentralus": 0.382, + "southeastasia": 0.373, + "switzerlandnorth": 0.418, + "uksouth": 0.357, + "ukwest": 0.366, + "usgovarizona": 0.376, + "usgovtexas": 0.373, + "usgovvirginia": 0.376, + "westcentralus": 0.364, + "westeurope": 0.365, + "westus": 0.36, + "westus2": 0.328 + }, + "lowpriorityd8dv4": { + "australiaeast": 0.374, + "australiasoutheast": 0.364, + "brazilsouth": 0.435, + "canadacentral": 0.349, + "canadaeast": 0.364, + "centralindia": 0.342, + "centralus": 0.352, + "eastasia": 0.427, + "eastus": 0.328, + "eastus2": 0.328, + "francecentral": 0.358, + "francesouth": 0.422, + "germanywestcentral": 0.365, + "japaneast": 0.381, + "japanwest": 0.404, + "koreacentral": 0.37, + "northcentralus": 0.328, + "northeurope": 0.349, + "southafricanorth": 0.389, + "southcentralus": 0.382, + "southeastasia": 0.373, + "switzerlandnorth": 0.418, + "uksouth": 0.357, + "ukwest": 0.366, + "usgovarizona": 0.376, + "usgovtexas": 0.373, + "usgovvirginia": 0.376, + "westcentralus": 0.364, + "westeurope": 0.365, + "westus": 0.36, + "westus2": 0.328 + }, + "lowpriorityd8sv3": { + "australiacentral": 0.347, + "australiacentral2": 0.347, + "australiaeast": 0.347, + "australiasoutheast": 0.347, + "brazilsouth": 0.402, + "brazilsoutheast": 0.478, + "canadacentral": 0.325, + "canadaeast": 0.325, + "centralindia": 0.315, + "centralus": 0.338, + "eastasia": 0.358, + "eastus": 0.301, + "eastus2": 0.301, + "francecentral": 0.326, + "francesouth": 0.424, + "germanycentral": 0.366, + "germanynorth": 0.386, + "germanynortheast": 0.366, + "germanywestcentral": 0.331, + "japaneast": 0.354, + "japanwest": 0.354, + "koreacentral": 0.344, + "koreasouth": 0.31, + "northcentralus": 0.307, + "northeurope": 0.318, + "norwayeast": 0.358, + "norwaywest": 0.422, + "southafricanorth": 0.362, + "southafricawest": 0.416, + "southcentralus": 0.338, + "southeastasia": 0.347, + "southindia": 0.378, + "switzerlandnorth": 0.378, + "switzerlandwest": 0.447, + "uaecentral": 0.397, + "uaenorth": 0.339, + "uksouth": 0.333, + "ukwest": 0.333, + "usgovarizona": 0.349, + "usgovtexas": 0.349, + "usgovvirginia": 0.349, + "westcentralus": 0.338, + "westeurope": 0.339, + "westindia": 0.344, + "westus": 0.334, + "westus2": 0.301 + }, + "lowpriorityd8sv4": { + "australiaeast": 0.339, + "australiasoutheast": 0.347, + "brazilsouth": 0.392, + "brazilsoutheast": 0.465, + "canadacentral": 0.318, + "canadaeast": 0.318, + "centralindia": 0.309, + "centralus": 0.321, + "eastasia": 0.385, + "eastus": 0.301, + "eastus2": 0.301, + "francecentral": 0.326, + "francesouth": 0.381, + "germanywestcentral": 0.331, + "japaneast": 0.346, + "japanwest": 0.365, + "koreacentral": 0.336, + "northcentralus": 0.301, + "northeurope": 0.318, + "southafricanorth": 0.353, + "southcentralus": 0.332, + "southeastasia": 0.339, + "switzerlandnorth": 0.378, + "uksouth": 0.325, + "ukwest": 0.333, + "usgovarizona": 0.341, + "usgovtexas": 0.339, + "usgovvirginia": 0.341, + "westcentralus": 0.332, + "westeurope": 0.331, + "westus": 0.326, + "westus2": 0.301 + }, + "lowpriorityd8v3": { + "australiacentral": 0.347, + "australiacentral2": 0.347, + "australiaeast": 0.347, + "australiasoutheast": 0.347, + "brazilsouth": 0.402, + "brazilsoutheast": 0.478, + "canadacentral": 0.325, + "canadaeast": 0.325, + "centralindia": 0.315, + "centralus": 0.338, + "eastasia": 0.358, + "eastus": 0.301, + "eastus2": 0.301, + "francecentral": 0.326, + "francesouth": 0.424, + "germanycentral": 0.366, + "germanynorth": 0.386, + "germanynortheast": 0.366, + "germanywestcentral": 0.331, + "japaneast": 0.354, + "japanwest": 0.354, + "koreacentral": 0.344, + "koreasouth": 0.31, + "northcentralus": 0.307, + "northeurope": 0.318, + "norwayeast": 0.358, + "norwaywest": 0.422, + "southafricanorth": 0.362, + "southafricawest": 0.416, + "southcentralus": 0.338, + "southeastasia": 0.347, + "southindia": 0.378, + "switzerlandnorth": 0.378, + "switzerlandwest": 0.447, + "uaecentral": 0.397, + "uaenorth": 0.339, + "uksouth": 0.333, + "ukwest": 0.333, + "usgovarizona": 0.349, + "usgovtexas": 0.349, + "usgovvirginia": 0.349, + "westcentralus": 0.338, + "westeurope": 0.339, + "westindia": 0.344, + "westus": 0.334, + "westus2": 0.301 + }, + "lowpriorityd8v4": { + "australiaeast": 0.339, + "australiasoutheast": 0.347, + "brazilsouth": 0.392, + "brazilsoutheast": 0.465, + "canadacentral": 0.318, + "canadaeast": 0.318, + "centralindia": 0.309, + "centralus": 0.321, + "eastasia": 0.385, + "eastus": 0.301, + "eastus2": 0.301, + "francecentral": 0.326, + "francesouth": 0.381, + "germanywestcentral": 0.331, + "japaneast": 0.346, + "japanwest": 0.365, + "koreacentral": 0.336, + "northcentralus": 0.301, + "northeurope": 0.318, + "southafricanorth": 0.353, + "southcentralus": 0.332, + "southeastasia": 0.339, + "switzerlandnorth": 0.378, + "uksouth": 0.325, + "ukwest": 0.333, + "usgovarizona": 0.341, + "usgovtexas": 0.339, + "usgovvirginia": 0.341, + "westcentralus": 0.332, + "westeurope": 0.331, + "westus": 0.326, + "westus2": 0.301 + }, + "lowpriorityd11": { + "australiaeast": 0.122, + "australiasoutheast": 0.122, + "brazilsouth": 0.161, + "brazilsoutheast": 0.159, + "centralus": 0.106, + "eastasia": 0.141, + "eastus": 0.106, + "eastus2": 0.097, + "japaneast": 0.131, + "japanwest": 0.114, + "northcentralus": 0.106, + "northeurope": 0.0972, + "southcentralus": 0.0972, + "southeastasia": 0.122, + "uaecentral": 0.145, + "uaenorth": 0.12, + "usgovvirginia": 0.122, + "westeurope": 0.112, + "westus": 0.106 + }, + "lowpriorityd11v2": { + "australiacentral": 0.118, + "australiacentral2": 0.118, + "australiaeast": 0.118, + "australiasoutheast": 0.118, + "brazilsouth": 0.161, + "brazilsoutheast": 0.159, + "canadacentral": 0.107, + "canadaeast": 0.107, + "centralindia": 0.113, + "centralus": 0.106, + "eastasia": 0.141, + "eastus": 0.106, + "eastus2": 0.097, + "francecentral": 0.123, + "francesouth": 0.16, + "germanycentral": 0.139, + "germanynorth": 0.141, + "germanynortheast": 0.139, + "germanywestcentral": 0.13, + "japaneast": 0.131, + "japanwest": 0.114, + "koreacentral": 0.117, + "koreasouth": 0.105, + "northcentralus": 0.106, + "northeurope": 0.0972, + "norwayeast": 0.12, + "norwaywest": 0.145, + "southafricanorth": 0.117, + "southafricawest": 0.137, + "southcentralus": 0.0972, + "southeastasia": 0.118, + "southindia": 0.113, + "switzerlandnorth": 0.128, + "switzerlandwest": 0.155, + "uaecentral": 0.13, + "uaenorth": 0.109, + "uksouth": 0.123, + "ukwest": 0.123, + "usgovarizona": 0.122, + "usgovtexas": 0.122, + "usgovvirginia": 0.122, + "westcentralus": 0.0972, + "westeurope": 0.111, + "westindia": 0.113, + "westus": 0.106, + "westus2": 0.097 + }, + "lowpriorityd12": { + "australiaeast": 0.245, + "australiasoutheast": 0.245, + "brazilsouth": 0.323, + "brazilsoutheast": 0.318, + "centralus": 0.211, + "eastasia": 0.281, + "eastus": 0.211, + "eastus2": 0.194, + "japaneast": 0.262, + "japanwest": 0.227, + "northcentralus": 0.211, + "northeurope": 0.194, + "southcentralus": 0.194, + "southeastasia": 0.245, + "uaecentral": 0.29, + "uaenorth": 0.24, + "usgovvirginia": 0.243, + "westeurope": 0.224, + "westus": 0.211 + }, + "lowpriorityd12v2": { + "australiacentral": 0.236, + "australiacentral2": 0.236, + "australiaeast": 0.236, + "australiasoutheast": 0.236, + "brazilsouth": 0.323, + "brazilsoutheast": 0.318, + "canadacentral": 0.214, + "canadaeast": 0.214, + "centralindia": 0.225, + "centralus": 0.211, + "eastasia": 0.281, + "eastus": 0.211, + "eastus2": 0.194, + "francecentral": 0.246, + "francesouth": 0.32, + "germanycentral": 0.278, + "germanynorth": 0.282, + "germanynortheast": 0.278, + "germanywestcentral": 0.26, + "japaneast": 0.262, + "japanwest": 0.228, + "koreacentral": 0.233, + "koreasouth": 0.21, + "northcentralus": 0.211, + "northeurope": 0.194, + "norwayeast": 0.24, + "norwaywest": 0.29, + "southafricanorth": 0.234, + "southafricawest": 0.274, + "southcentralus": 0.194, + "southeastasia": 0.236, + "southindia": 0.225, + "switzerlandnorth": 0.256, + "switzerlandwest": 0.311, + "uaecentral": 0.26, + "uaenorth": 0.217, + "uksouth": 0.246, + "ukwest": 0.246, + "usgovarizona": 0.243, + "usgovtexas": 0.243, + "usgovvirginia": 0.243, + "westcentralus": 0.194, + "westeurope": 0.223, + "westindia": 0.225, + "westus": 0.211, + "westus2": 0.194 + }, + "lowpriorityd13": { + "australiaeast": 0.489, + "australiasoutheast": 0.489, + "brazilsouth": 0.645, + "brazilsoutheast": 0.635, + "centralus": 0.422, + "eastasia": 0.563, + "eastus": 0.422, + "eastus2": 0.389, + "japaneast": 0.523, + "japanwest": 0.455, + "northcentralus": 0.422, + "northeurope": 0.389, + "southcentralus": 0.389, + "southeastasia": 0.489, + "uaecentral": 0.58, + "uaenorth": 0.48, + "usgovvirginia": 0.486, + "westeurope": 0.447, + "westus": 0.422 + }, + "lowpriorityd13v2": { + "australiacentral": 0.473, + "australiacentral2": 0.473, + "australiaeast": 0.473, + "australiasoutheast": 0.473, + "brazilsouth": 0.645, + "brazilsoutheast": 0.636, + "canadacentral": 0.428, + "canadaeast": 0.428, + "centralindia": 0.45, + "centralus": 0.422, + "eastasia": 0.563, + "eastus": 0.422, + "eastus2": 0.389, + "francecentral": 0.492, + "francesouth": 0.64, + "germanycentral": 0.518, + "germanynorth": 0.563, + "germanynortheast": 0.518, + "germanywestcentral": 0.472, + "japaneast": 0.523, + "japanwest": 0.455, + "koreacentral": 0.466, + "koreasouth": 0.42, + "northcentralus": 0.422, + "northeurope": 0.389, + "norwayeast": 0.481, + "norwaywest": 0.581, + "southafricanorth": 0.468, + "southafricawest": 0.549, + "southcentralus": 0.389, + "southeastasia": 0.473, + "southindia": 0.45, + "switzerlandnorth": 0.512, + "switzerlandwest": 0.621, + "uaecentral": 0.52, + "uaenorth": 0.434, + "uksouth": 0.492, + "ukwest": 0.492, + "usgovarizona": 0.486, + "usgovtexas": 0.486, + "usgovvirginia": 0.486, + "westcentralus": 0.389, + "westeurope": 0.446, + "westindia": 0.45, + "westus": 0.422, + "westus2": 0.389 + }, + "lowpriorityd14": { + "australiaeast": 0.979, + "australiasoutheast": 0.979, + "brazilsouth": 1.291, + "brazilsoutheast": 1.271, + "centralus": 0.844, + "eastasia": 1.126, + "eastus": 0.844, + "eastus2": 0.778, + "japaneast": 1.047, + "japanwest": 0.91, + "northcentralus": 0.844, + "northeurope": 0.778, + "southcentralus": 0.778, + "southeastasia": 0.979, + "uaecentral": 1.16, + "uaenorth": 0.96, + "usgovvirginia": 0.972, + "westeurope": 0.894, + "westus": 0.844 + }, + "lowpriorityd14v2": { + "australiacentral": 0.945, + "australiacentral2": 0.945, + "australiaeast": 0.945, + "australiasoutheast": 0.945, + "brazilsouth": 1.291, + "brazilsoutheast": 1.271, + "canadacentral": 0.855, + "canadaeast": 0.855, + "centralindia": 0.901, + "centralus": 0.844, + "eastasia": 1.126, + "eastus": 0.844, + "eastus2": 0.778, + "francecentral": 0.984, + "francesouth": 1.2792, + "germanycentral": 0.933, + "germanynorth": 1.126, + "germanynortheast": 0.933, + "germanywestcentral": 0.891, + "japaneast": 1.047, + "japanwest": 0.91, + "koreacentral": 0.933, + "koreasouth": 0.84, + "northcentralus": 0.844, + "northeurope": 0.778, + "norwayeast": 0.962, + "norwaywest": 1.163, + "southafricanorth": 0.936, + "southafricawest": 1.098, + "southcentralus": 0.778, + "southeastasia": 0.945, + "southindia": 0.901, + "switzerlandnorth": 1.024, + "switzerlandwest": 1.243, + "uaecentral": 1.041, + "uaenorth": 0.868, + "uksouth": 0.984, + "ukwest": 0.984, + "usgovarizona": 0.972, + "usgovtexas": 0.972, + "usgovvirginia": 0.972, + "westcentralus": 0.778, + "westeurope": 0.891, + "westindia": 0.901, + "westus": 0.844, + "westus2": 0.778 + }, + "lowpriorityd15v2": { + "australiacentral": 1.182, + "australiacentral2": 1.182, + "australiaeast": 1.182, + "australiasoutheast": 1.182, + "brazilsouth": 1.614, + "brazilsoutheast": 1.589, + "canadacentral": 1.069, + "canadaeast": 1.069, + "centralindia": 1.126, + "centralus": 1.056, + "eastasia": 1.407, + "eastus": 1.056, + "eastus2": 0.972, + "francecentral": 1.23, + "francesouth": 1.599, + "germanycentral": 1.166, + "germanynorth": 1.408, + "germanynortheast": 1.166, + "germanywestcentral": 1.3, + "japaneast": 1.308, + "japanwest": 1.138, + "koreacentral": 1.166, + "koreasouth": 1.049, + "northcentralus": 1.056, + "northeurope": 0.972, + "norwayeast": 1.203, + "norwaywest": 1.453, + "southafricanorth": 1.169, + "southafricawest": 1.373, + "southcentralus": 0.972, + "southeastasia": 1.182, + "southindia": 1.126, + "switzerlandnorth": 1.28, + "switzerlandwest": 1.554, + "uaecentral": 1.301, + "uaenorth": 1.086, + "uksouth": 1.23, + "ukwest": 1.23, + "usgovarizona": 1.215, + "usgovtexas": 1.215, + "usgovvirginia": 1.215, + "westcentralus": 0.972, + "westeurope": 1.114, + "westindia": 1.126, + "westus": 1.056, + "westus2": 0.972 + }, + "lowpriorityd16asv4": { + "australiaeast": 0.678, + "brazilsouth": 0.784, + "centralindia": 0.618, + "centralus": 0.642, + "eastasia": 0.717, + "eastus": 0.602, + "eastus2": 0.602, + "francecentral": 0.653, + "japaneast": 0.691, + "koreacentral": 0.672, + "northeurope": 0.637, + "southcentralus": 0.663, + "southeastasia": 0.678, + "uksouth": 0.65, + "westeurope": 0.662, + "westus": 0.653, + "westus2": 0.602 + }, + "lowpriorityd16av4": { + "australiaeast": 0.678, + "brazilsouth": 0.784, + "centralindia": 0.618, + "centralus": 0.642, + "eastasia": 0.717, + "eastus": 0.602, + "eastus2": 0.602, + "francecentral": 0.653, + "japaneast": 0.691, + "koreacentral": 0.672, + "northeurope": 0.637, + "southcentralus": 0.663, + "southeastasia": 0.678, + "uksouth": 0.65, + "westeurope": 0.662, + "westus": 0.653, + "westus2": 0.602 + }, + "lowpriorityd16dsv4": { + "australiaeast": 0.749, + "australiasoutheast": 0.728, + "brazilsouth": 0.87, + "canadacentral": 0.698, + "canadaeast": 0.728, + "centralindia": 0.685, + "centralus": 0.703, + "eastasia": 0.855, + "eastus": 0.656, + "eastus2": 0.656, + "francecentral": 0.717, + "francesouth": 0.844, + "germanywestcentral": 0.73, + "japaneast": 0.762, + "japanwest": 0.808, + "koreacentral": 0.739, + "northcentralus": 0.656, + "northeurope": 0.698, + "southafricanorth": 0.779, + "southcentralus": 0.764, + "southeastasia": 0.746, + "switzerlandnorth": 0.837, + "uksouth": 0.714, + "ukwest": 0.732, + "usgovarizona": 0.752, + "usgovtexas": 0.746, + "usgovvirginia": 0.752, + "westcentralus": 0.728, + "westeurope": 0.73, + "westus": 0.72, + "westus2": 0.656 + }, + "lowpriorityd16dv4": { + "australiaeast": 0.749, + "australiasoutheast": 0.728, + "brazilsouth": 0.87, + "canadacentral": 0.698, + "canadaeast": 0.728, + "centralindia": 0.685, + "centralus": 0.703, + "eastasia": 0.855, + "eastus": 0.656, + "eastus2": 0.656, + "francecentral": 0.717, + "francesouth": 0.844, + "germanywestcentral": 0.73, + "japaneast": 0.762, + "japanwest": 0.808, + "koreacentral": 0.739, + "northcentralus": 0.656, + "northeurope": 0.698, + "southafricanorth": 0.779, + "southcentralus": 0.764, + "southeastasia": 0.746, + "switzerlandnorth": 0.837, + "uksouth": 0.714, + "ukwest": 0.732, + "usgovarizona": 0.752, + "usgovtexas": 0.746, + "usgovvirginia": 0.752, + "westcentralus": 0.728, + "westeurope": 0.73, + "westus": 0.72, + "westus2": 0.656 + }, + "lowpriorityd16sv3": { + "australiacentral": 0.694, + "australiacentral2": 0.694, + "australiaeast": 0.694, + "australiasoutheast": 0.694, + "brazilsouth": 0.803, + "brazilsoutheast": 0.956, + "canadacentral": 0.65, + "canadaeast": 0.65, + "centralindia": 0.63, + "centralus": 0.676, + "eastasia": 0.717, + "eastus": 0.602, + "eastus2": 0.602, + "francecentral": 0.653, + "francesouth": 0.848, + "germanycentral": 0.7328, + "germanynorth": 0.773, + "germanynortheast": 0.7328, + "germanywestcentral": 0.662, + "japaneast": 0.707, + "japanwest": 0.707, + "koreacentral": 0.688, + "koreasouth": 0.619, + "northcentralus": 0.614, + "northeurope": 0.637, + "norwayeast": 0.717, + "norwaywest": 0.844, + "southafricanorth": 0.723, + "southafricawest": 0.832, + "southcentralus": 0.676, + "southeastasia": 0.694, + "southindia": 0.757, + "switzerlandnorth": 0.755, + "switzerlandwest": 0.893, + "uaecentral": 0.794, + "uaenorth": 0.678, + "uksouth": 0.666, + "ukwest": 0.666, + "usgovarizona": 0.698, + "usgovtexas": 0.698, + "usgovvirginia": 0.698, + "westcentralus": 0.676, + "westeurope": 0.678, + "westindia": 0.688, + "westus": 0.669, + "westus2": 0.602 + }, + "lowpriorityd16sv4": { + "australiaeast": 0.678, + "australiasoutheast": 0.694, + "brazilsouth": 0.784, + "brazilsoutheast": 0.931, + "canadacentral": 0.637, + "canadaeast": 0.637, + "centralindia": 0.618, + "centralus": 0.642, + "eastasia": 0.771, + "eastus": 0.602, + "eastus2": 0.602, + "francecentral": 0.653, + "francesouth": 0.761, + "germanywestcentral": 0.662, + "japaneast": 0.691, + "japanwest": 0.731, + "koreacentral": 0.672, + "northcentralus": 0.602, + "northeurope": 0.637, + "southafricanorth": 0.706, + "southcentralus": 0.663, + "southeastasia": 0.678, + "switzerlandnorth": 0.755, + "uksouth": 0.65, + "ukwest": 0.666, + "usgovarizona": 0.682, + "usgovtexas": 0.678, + "usgovvirginia": 0.682, + "westcentralus": 0.663, + "westeurope": 0.662, + "westus": 0.653, + "westus2": 0.602 + }, + "lowpriorityd16v3": { + "australiacentral": 0.694, + "australiacentral2": 0.694, + "australiaeast": 0.694, + "australiasoutheast": 0.694, + "brazilsouth": 0.803, + "brazilsoutheast": 0.956, + "canadacentral": 0.65, + "canadaeast": 0.65, + "centralindia": 0.63, + "centralus": 0.676, + "eastasia": 0.717, + "eastus": 0.602, + "eastus2": 0.602, + "francecentral": 0.653, + "francesouth": 0.848, + "germanycentral": 0.7328, + "germanynorth": 0.773, + "germanynortheast": 0.7328, + "germanywestcentral": 0.662, + "japaneast": 0.707, + "japanwest": 0.707, + "koreacentral": 0.688, + "koreasouth": 0.619, + "northcentralus": 0.614, + "northeurope": 0.637, + "norwayeast": 0.717, + "norwaywest": 0.844, + "southafricanorth": 0.723, + "southafricawest": 0.832, + "southcentralus": 0.676, + "southeastasia": 0.694, + "southindia": 0.757, + "switzerlandnorth": 0.755, + "switzerlandwest": 0.893, + "uaecentral": 0.794, + "uaenorth": 0.678, + "uksouth": 0.666, + "ukwest": 0.666, + "usgovarizona": 0.698, + "usgovtexas": 0.698, + "usgovvirginia": 0.698, + "westcentralus": 0.676, + "westeurope": 0.678, + "westindia": 0.688, + "westus": 0.669, + "westus2": 0.602 + }, + "lowpriorityd16v4": { + "australiaeast": 0.678, + "australiasoutheast": 0.694, + "brazilsouth": 0.784, + "brazilsoutheast": 0.931, + "canadacentral": 0.637, + "canadaeast": 0.637, + "centralindia": 0.618, + "centralus": 0.642, + "eastasia": 0.771, + "eastus": 0.602, + "eastus2": 0.602, + "francecentral": 0.653, + "francesouth": 0.761, + "germanywestcentral": 0.662, + "japaneast": 0.691, + "japanwest": 0.731, + "koreacentral": 0.672, + "northcentralus": 0.602, + "northeurope": 0.637, + "southafricanorth": 0.706, + "southcentralus": 0.663, + "southeastasia": 0.678, + "switzerlandnorth": 0.755, + "uksouth": 0.65, + "ukwest": 0.666, + "usgovarizona": 0.682, + "usgovtexas": 0.678, + "usgovvirginia": 0.682, + "westcentralus": 0.663, + "westeurope": 0.662, + "westus": 0.653, + "westus2": 0.602 + }, + "lowpriorityd32asv4": { + "australiaeast": 1.357, + "brazilsouth": 1.568, + "centralindia": 1.235, + "centralus": 1.283, + "eastasia": 1.434, + "eastus": 1.203, + "eastus2": 1.203, + "francecentral": 1.306, + "japaneast": 1.382, + "koreacentral": 1.344, + "northeurope": 1.274, + "southcentralus": 1.326, + "southeastasia": 1.357, + "uksouth": 1.299, + "westeurope": 1.325, + "westus": 1.306, + "westus2": 1.203 + }, + "lowpriorityd32av4": { + "australiaeast": 1.357, + "brazilsouth": 1.568, + "centralindia": 1.235, + "centralus": 1.283, + "eastasia": 1.434, + "eastus": 1.203, + "eastus2": 1.203, + "francecentral": 1.306, + "japaneast": 1.382, + "koreacentral": 1.344, + "northeurope": 1.274, + "southcentralus": 1.326, + "southeastasia": 1.357, + "uksouth": 1.299, + "westeurope": 1.325, + "westus": 1.306, + "westus2": 1.203 + }, + "lowpriorityd32dsv4": { + "australiaeast": 1.498, + "australiasoutheast": 1.457, + "brazilsouth": 1.741, + "canadacentral": 1.395, + "canadaeast": 1.457, + "centralindia": 1.37, + "centralus": 1.406, + "eastasia": 1.71, + "eastus": 1.312, + "eastus2": 1.312, + "francecentral": 1.434, + "francesouth": 1.688, + "germanywestcentral": 1.459, + "japaneast": 1.523, + "japanwest": 1.616, + "koreacentral": 1.478, + "northcentralus": 1.312, + "northeurope": 1.395, + "southafricanorth": 1.558, + "southcentralus": 1.529, + "southeastasia": 1.491, + "switzerlandnorth": 1.674, + "uksouth": 1.427, + "ukwest": 1.464, + "usgovarizona": 1.504, + "usgovtexas": 1.493, + "usgovvirginia": 1.504, + "westcentralus": 1.457, + "westeurope": 1.459, + "westus": 1.44, + "westus2": 1.312 + }, + "lowpriorityd32dv4": { + "australiaeast": 1.498, + "australiasoutheast": 1.457, + "brazilsouth": 1.741, + "canadacentral": 1.395, + "canadaeast": 1.457, + "centralindia": 1.37, + "centralus": 1.406, + "eastasia": 1.71, + "eastus": 1.312, + "eastus2": 1.312, + "francecentral": 1.434, + "francesouth": 1.688, + "germanywestcentral": 1.459, + "japaneast": 1.523, + "japanwest": 1.616, + "koreacentral": 1.478, + "northcentralus": 1.312, + "northeurope": 1.395, + "southafricanorth": 1.558, + "southcentralus": 1.529, + "southeastasia": 1.491, + "switzerlandnorth": 1.674, + "uksouth": 1.427, + "ukwest": 1.464, + "usgovarizona": 1.504, + "usgovtexas": 1.493, + "usgovvirginia": 1.504, + "westcentralus": 1.457, + "westeurope": 1.459, + "westus": 1.44, + "westus2": 1.312 + }, + "lowpriorityd32sv3": { + "australiacentral": 1.389, + "australiacentral2": 1.389, + "australiaeast": 1.389, + "australiasoutheast": 1.389, + "brazilsouth": 1.606, + "brazilsoutheast": 1.912, + "canadacentral": 1.299, + "canadaeast": 1.299, + "centralindia": 1.2608, + "centralus": 1.352, + "eastasia": 1.434, + "eastus": 1.203, + "eastus2": 1.203, + "francecentral": 1.306, + "francesouth": 1.803, + "germanycentral": 1.54, + "germanynorth": 1.546, + "germanynortheast": 1.54, + "germanywestcentral": 1.325, + "japaneast": 1.414, + "japanwest": 1.414, + "koreacentral": 1.376, + "koreasouth": 1.238, + "northcentralus": 1.229, + "northeurope": 1.274, + "norwayeast": 1.434, + "norwaywest": 1.687, + "southafricanorth": 1.446, + "southafricawest": 1.664, + "southcentralus": 1.352, + "southeastasia": 1.389, + "southindia": 1.514, + "switzerlandnorth": 1.51, + "switzerlandwest": 1.787, + "uaecentral": 1.587, + "uaenorth": 1.357, + "uksouth": 1.331, + "ukwest": 1.331, + "usgovarizona": 1.395, + "usgovtexas": 1.395, + "usgovvirginia": 1.395, + "westcentralus": 1.352, + "westeurope": 1.357, + "westindia": 1.376, + "westus": 1.338, + "westus2": 1.203 + }, + "lowpriorityd32sv4": { + "australiaeast": 1.357, + "australiasoutheast": 1.388, + "brazilsouth": 1.568, + "brazilsoutheast": 1.862, + "canadacentral": 1.274, + "canadaeast": 1.274, + "centralindia": 1.235, + "centralus": 1.283, + "eastasia": 1.541, + "eastus": 1.203, + "eastus2": 1.203, + "francecentral": 1.306, + "francesouth": 1.523, + "germanywestcentral": 1.325, + "japaneast": 1.382, + "japanwest": 1.462, + "koreacentral": 1.344, + "northcentralus": 1.203, + "northeurope": 1.274, + "southafricanorth": 1.412, + "southcentralus": 1.326, + "southeastasia": 1.357, + "switzerlandnorth": 1.51, + "uksouth": 1.299, + "ukwest": 1.332, + "usgovarizona": 1.363, + "usgovtexas": 1.357, + "usgovvirginia": 1.363, + "westcentralus": 1.326, + "westeurope": 1.325, + "westus": 1.306, + "westus2": 1.203 + }, + "lowpriorityd32v3": { + "australiacentral": 1.389, + "australiacentral2": 1.389, + "australiaeast": 1.389, + "australiasoutheast": 1.389, + "brazilsouth": 1.606, + "brazilsoutheast": 1.912, + "canadacentral": 1.299, + "canadaeast": 1.299, + "centralindia": 1.2608, + "centralus": 1.352, + "eastasia": 1.434, + "eastus": 1.203, + "eastus2": 1.203, + "francecentral": 1.306, + "francesouth": 1.803, + "germanycentral": 1.54, + "germanynorth": 1.546, + "germanynortheast": 1.54, + "germanywestcentral": 1.325, + "japaneast": 1.414, + "japanwest": 1.414, + "koreacentral": 1.376, + "koreasouth": 1.238, + "northcentralus": 1.229, + "northeurope": 1.274, + "norwayeast": 1.434, + "norwaywest": 1.687, + "southafricanorth": 1.446, + "southafricawest": 1.664, + "southcentralus": 1.352, + "southeastasia": 1.389, + "southindia": 1.514, + "switzerlandnorth": 1.51, + "switzerlandwest": 1.787, + "uaecentral": 1.587, + "uaenorth": 1.357, + "uksouth": 1.331, + "ukwest": 1.331, + "usgovarizona": 1.395, + "usgovtexas": 1.395, + "usgovvirginia": 1.395, + "westcentralus": 1.352, + "westeurope": 1.357, + "westindia": 1.376, + "westus": 1.338, + "westus2": 1.203 + }, + "lowpriorityd32v4": { + "australiaeast": 1.357, + "australiasoutheast": 1.388, + "brazilsouth": 1.568, + "brazilsoutheast": 1.862, + "canadacentral": 1.274, + "canadaeast": 1.274, + "centralindia": 1.235, + "centralus": 1.283, + "eastasia": 1.541, + "eastus": 1.203, + "eastus2": 1.203, + "francecentral": 1.306, + "francesouth": 1.523, + "germanywestcentral": 1.325, + "japaneast": 1.382, + "japanwest": 1.462, + "koreacentral": 1.344, + "northcentralus": 1.203, + "northeurope": 1.274, + "southafricanorth": 1.412, + "southcentralus": 1.326, + "southeastasia": 1.357, + "switzerlandnorth": 1.51, + "uksouth": 1.299, + "ukwest": 1.332, + "usgovarizona": 1.363, + "usgovtexas": 1.357, + "usgovvirginia": 1.363, + "westcentralus": 1.326, + "westeurope": 1.325, + "westus": 1.306, + "westus2": 1.203 + }, + "lowpriorityd48asv4": { + "australiaeast": 2.035, + "brazilsouth": 2.352, + "centralindia": 1.853, + "centralus": 1.925, + "eastasia": 2.15, + "eastus": 1.805, + "eastus2": 1.805, + "francecentral": 1.958, + "japaneast": 2.074, + "koreacentral": 2.016, + "northeurope": 1.91, + "southcentralus": 1.989, + "southeastasia": 2.035, + "uksouth": 1.949, + "westeurope": 1.987, + "westus": 1.958, + "westus2": 1.805 + }, + "lowpriorityd48av4": { + "australiaeast": 2.035, + "brazilsouth": 2.352, + "centralindia": 1.853, + "centralus": 1.925, + "eastasia": 2.15, + "eastus": 1.805, + "eastus2": 1.805, + "francecentral": 1.958, + "japaneast": 2.074, + "koreacentral": 2.016, + "northeurope": 1.91, + "southcentralus": 1.989, + "southeastasia": 2.035, + "uksouth": 1.949, + "westeurope": 1.987, + "westus": 1.958, + "westus2": 1.805 + }, + "lowpriorityd48dsv4": { + "australiaeast": 2.246, + "australiasoutheast": 2.185, + "brazilsouth": 2.611, + "canadacentral": 2.093, + "canadaeast": 2.185, + "centralindia": 2.054, + "centralus": 2.109, + "eastasia": 2.565, + "eastus": 1.968, + "eastus2": 1.968, + "francecentral": 2.15, + "francesouth": 2.532, + "germanywestcentral": 2.189, + "japaneast": 2.285, + "japanwest": 2.424, + "koreacentral": 2.218, + "northcentralus": 1.968, + "northeurope": 2.093, + "southafricanorth": 2.337, + "southcentralus": 2.293, + "southeastasia": 2.237, + "switzerlandnorth": 2.51, + "uksouth": 2.141, + "ukwest": 2.196, + "usgovarizona": 2.256, + "usgovtexas": 2.239, + "usgovvirginia": 2.256, + "westcentralus": 2.185, + "westeurope": 2.189, + "westus": 2.16, + "westus2": 1.968 + }, + "lowpriorityd48dv4": { + "australiaeast": 2.246, + "australiasoutheast": 2.185, + "brazilsouth": 2.611, + "canadacentral": 2.093, + "canadaeast": 2.185, + "centralindia": 2.054, + "centralus": 2.109, + "eastasia": 2.565, + "eastus": 1.968, + "eastus2": 1.968, + "francecentral": 2.15, + "francesouth": 2.532, + "germanywestcentral": 2.189, + "japaneast": 2.285, + "japanwest": 2.424, + "koreacentral": 2.218, + "northcentralus": 1.968, + "northeurope": 2.093, + "southafricanorth": 2.337, + "southcentralus": 2.293, + "southeastasia": 2.237, + "switzerlandnorth": 2.51, + "uksouth": 2.141, + "ukwest": 2.196, + "usgovarizona": 2.256, + "usgovtexas": 2.239, + "usgovvirginia": 2.256, + "westcentralus": 2.185, + "westeurope": 2.189, + "westus": 2.16, + "westus2": 1.968 + }, + "lowpriorityd48sv3": { + "australiacentral": 2.083, + "australiacentral2": 2.083, + "australiaeast": 2.083, + "australiasoutheast": 2.083, + "brazilsouth": 2.409, + "brazilsoutheast": 2.868, + "canadacentral": 1.949, + "canadaeast": 1.949, + "centralindia": 1.891, + "centralus": 2.028, + "eastasia": 2.15, + "eastus": 1.805, + "eastus2": 1.805, + "francecentral": 1.958, + "francesouth": 2.546, + "germanycentral": 2.128, + "germanynorth": 2.318, + "germanynortheast": 2.128, + "germanywestcentral": 1.987, + "japaneast": 2.122, + "japanwest": 2.122, + "koreacentral": 2.064, + "koreasouth": 1.858, + "northcentralus": 1.843, + "northeurope": 1.911, + "norwayeast": 2.15, + "norwaywest": 2.531, + "southafricanorth": 2.17, + "southafricawest": 2.496, + "southcentralus": 2.028, + "southeastasia": 2.083, + "southindia": 2.27, + "switzerlandnorth": 2.266, + "switzerlandwest": 2.68, + "uaecentral": 2.381, + "uaenorth": 2.035, + "uksouth": 1.997, + "ukwest": 1.997, + "usgovarizona": 2.093, + "usgovtexas": 2.093, + "usgovvirginia": 2.093, + "westcentralus": 2.028, + "westeurope": 2.035, + "westindia": 2.064, + "westus": 2.007, + "westus2": 1.805 + }, + "lowpriorityd48sv4": { + "australiaeast": 2.035, + "australiasoutheast": 2.081, + "brazilsouth": 2.352, + "brazilsoutheast": 2.792, + "canadacentral": 1.91, + "canadaeast": 1.91, + "centralindia": 1.853, + "centralus": 1.925, + "eastasia": 2.312, + "eastus": 1.805, + "eastus2": 1.805, + "francecentral": 1.958, + "francesouth": 2.284, + "germanywestcentral": 1.987, + "japaneast": 2.074, + "japanwest": 2.193, + "koreacentral": 2.016, + "northcentralus": 1.805, + "northeurope": 1.91, + "southafricanorth": 2.118, + "southcentralus": 1.989, + "southeastasia": 2.035, + "switzerlandnorth": 2.266, + "uksouth": 1.949, + "ukwest": 1.998, + "usgovarizona": 2.045, + "usgovtexas": 2.035, + "usgovvirginia": 2.045, + "westcentralus": 1.989, + "westeurope": 1.987, + "westus": 1.958, + "westus2": 1.805 + }, + "lowpriorityd48v3": { + "australiacentral": 2.083, + "australiacentral2": 2.083, + "australiaeast": 2.083, + "australiasoutheast": 2.083, + "brazilsouth": 2.409, + "brazilsoutheast": 2.868, + "canadacentral": 1.949, + "canadaeast": 1.949, + "centralindia": 1.891, + "centralus": 2.028, + "eastasia": 2.15, + "eastus": 1.805, + "eastus2": 1.805, + "francecentral": 1.958, + "francesouth": 2.546, + "germanycentral": 2.128, + "germanynorth": 2.318, + "germanynortheast": 2.128, + "germanywestcentral": 1.987, + "japaneast": 2.122, + "japanwest": 2.122, + "koreacentral": 2.064, + "koreasouth": 1.858, + "northcentralus": 1.843, + "northeurope": 1.911, + "norwayeast": 2.15, + "norwaywest": 2.531, + "southafricanorth": 2.17, + "southafricawest": 2.496, + "southcentralus": 2.028, + "southeastasia": 2.083, + "southindia": 2.27, + "switzerlandnorth": 2.266, + "switzerlandwest": 2.68, + "uaecentral": 2.381, + "uaenorth": 2.035, + "uksouth": 1.997, + "ukwest": 1.997, + "usgovarizona": 2.093, + "usgovtexas": 2.093, + "usgovvirginia": 2.093, + "westcentralus": 2.028, + "westeurope": 2.035, + "westindia": 2.064, + "westus": 2.007, + "westus2": 1.805 + }, + "lowpriorityd48v4": { + "australiaeast": 2.035, + "australiasoutheast": 2.081, + "brazilsouth": 2.352, + "brazilsoutheast": 2.792, + "canadacentral": 1.91, + "canadaeast": 1.91, + "centralindia": 1.853, + "centralus": 1.925, + "eastasia": 2.312, + "eastus": 1.805, + "eastus2": 1.805, + "francecentral": 1.958, + "francesouth": 2.284, + "germanywestcentral": 1.987, + "japaneast": 2.074, + "japanwest": 2.193, + "koreacentral": 2.016, + "northcentralus": 1.805, + "northeurope": 1.91, + "southafricanorth": 2.118, + "southcentralus": 1.989, + "southeastasia": 2.035, + "switzerlandnorth": 2.266, + "uksouth": 1.949, + "ukwest": 1.998, + "usgovarizona": 2.045, + "usgovtexas": 2.035, + "usgovvirginia": 2.045, + "westcentralus": 1.989, + "westeurope": 1.987, + "westus": 1.958, + "westus2": 1.805 + }, + "lowpriorityd64asv4": { + "australiaeast": 2.714, + "brazilsouth": 3.136, + "centralindia": 2.47, + "centralus": 2.566, + "eastasia": 2.867, + "eastus": 2.406, + "eastus2": 2.406, + "francecentral": 2.611, + "japaneast": 2.765, + "koreacentral": 2.688, + "northeurope": 2.547, + "southcentralus": 2.652, + "southeastasia": 2.714, + "uksouth": 2.598, + "westeurope": 2.65, + "westus": 2.611, + "westus2": 2.406 + }, + "lowpriorityd64av4": { + "australiaeast": 2.714, + "brazilsouth": 3.136, + "centralindia": 2.47, + "centralus": 2.566, + "eastasia": 2.867, + "eastus": 2.406, + "eastus2": 2.406, + "francecentral": 2.611, + "japaneast": 2.765, + "koreacentral": 2.688, + "northeurope": 2.547, + "southcentralus": 2.652, + "southeastasia": 2.714, + "uksouth": 2.598, + "westeurope": 2.65, + "westus": 2.611, + "westus2": 2.406 + }, + "lowpriorityd64dsv4": { + "australiaeast": 2.995, + "australiasoutheast": 2.913, + "brazilsouth": 3.482, + "canadacentral": 2.79, + "canadaeast": 2.913, + "centralindia": 2.739, + "centralus": 2.812, + "eastasia": 3.42, + "eastus": 2.624, + "eastus2": 2.624, + "francecentral": 2.867, + "francesouth": 3.376, + "germanywestcentral": 2.918, + "japaneast": 3.046, + "japanwest": 3.233, + "koreacentral": 2.957, + "northcentralus": 2.624, + "northeurope": 2.79, + "southafricanorth": 3.116, + "southcentralus": 3.058, + "southeastasia": 2.982, + "switzerlandnorth": 3.347, + "uksouth": 2.854, + "ukwest": 2.928, + "usgovarizona": 3.008, + "usgovtexas": 2.986, + "usgovvirginia": 3.008, + "westcentralus": 2.913, + "westeurope": 2.918, + "westus": 2.88, + "westus2": 2.624 + }, + "lowpriorityd64dv4": { + "australiaeast": 2.995, + "australiasoutheast": 2.913, + "brazilsouth": 3.482, + "canadacentral": 2.79, + "canadaeast": 2.913, + "centralindia": 2.739, + "centralus": 2.812, + "eastasia": 3.42, + "eastus": 2.624, + "eastus2": 2.624, + "francecentral": 2.867, + "francesouth": 3.376, + "germanywestcentral": 2.918, + "japaneast": 3.046, + "japanwest": 3.233, + "koreacentral": 2.957, + "northcentralus": 2.624, + "northeurope": 2.79, + "southafricanorth": 3.116, + "southcentralus": 3.058, + "southeastasia": 2.982, + "switzerlandnorth": 3.347, + "uksouth": 2.854, + "ukwest": 2.928, + "usgovarizona": 3.008, + "usgovtexas": 2.986, + "usgovvirginia": 3.008, + "westcentralus": 2.913, + "westeurope": 2.918, + "westus": 2.88, + "westus2": 2.624 + }, + "lowpriorityd64sv3": { + "australiacentral": 2.778, + "australiacentral2": 2.778, + "australiaeast": 2.778, + "australiasoutheast": 2.778, + "brazilsouth": 3.213, + "brazilsoutheast": 3.823, + "canadacentral": 2.598, + "canadaeast": 2.598, + "centralindia": 2.521, + "centralus": 2.704, + "eastasia": 2.867, + "eastus": 2.406, + "eastus2": 2.406, + "francecentral": 2.611, + "francesouth": 3.394, + "germanycentral": 3.079, + "germanynorth": 3.091, + "germanynortheast": 3.079, + "germanywestcentral": 2.65, + "japaneast": 2.829, + "japanwest": 2.829, + "koreacentral": 2.752, + "koreasouth": 2.477, + "northcentralus": 2.458, + "northeurope": 2.547, + "norwayeast": 2.867, + "norwaywest": 3.374, + "southafricanorth": 2.893, + "southafricawest": 3.328, + "southcentralus": 2.704, + "southeastasia": 2.778, + "southindia": 3.027, + "switzerlandnorth": 3.021, + "switzerlandwest": 3.574, + "uaecentral": 3.174, + "uaenorth": 2.714, + "uksouth": 2.662, + "ukwest": 2.662, + "usgovarizona": 2.79, + "usgovtexas": 2.79, + "usgovvirginia": 2.79, + "westcentralus": 2.704, + "westeurope": 2.714, + "westindia": 2.752, + "westus": 2.675, + "westus2": 2.406 + }, + "lowpriorityd64sv4": { + "australiaeast": 2.714, + "australiasoutheast": 2.775, + "brazilsouth": 3.136, + "brazilsoutheast": 3.723, + "canadacentral": 2.547, + "canadaeast": 2.547, + "centralindia": 2.47, + "centralus": 2.566, + "eastasia": 3.082, + "eastus": 2.406, + "eastus2": 2.406, + "francecentral": 2.611, + "francesouth": 3.045, + "germanywestcentral": 2.65, + "japaneast": 2.765, + "japanwest": 2.923, + "koreacentral": 2.688, + "northcentralus": 2.406, + "northeurope": 2.547, + "southafricanorth": 2.824, + "southcentralus": 2.652, + "southeastasia": 2.714, + "switzerlandnorth": 3.021, + "uksouth": 2.598, + "ukwest": 2.664, + "usgovarizona": 2.726, + "usgovtexas": 2.714, + "usgovvirginia": 2.726, + "westcentralus": 2.652, + "westeurope": 2.65, + "westus": 2.611, + "westus2": 2.406 + }, + "lowpriorityd64v3": { + "australiacentral": 2.778, + "australiacentral2": 2.778, + "australiaeast": 2.778, + "australiasoutheast": 2.778, + "brazilsouth": 3.213, + "brazilsoutheast": 3.823, + "canadacentral": 2.598, + "canadaeast": 2.598, + "centralindia": 2.521, + "centralus": 2.704, + "eastasia": 2.867, + "eastus": 2.406, + "eastus2": 2.406, + "francecentral": 2.611, + "francesouth": 3.394, + "germanycentral": 3.079, + "germanynorth": 3.091, + "germanynortheast": 3.079, + "germanywestcentral": 2.65, + "japaneast": 2.829, + "japanwest": 2.829, + "koreacentral": 2.752, + "koreasouth": 2.477, + "northcentralus": 2.458, + "northeurope": 2.547, + "norwayeast": 2.867, + "norwaywest": 3.374, + "southafricanorth": 2.893, + "southafricawest": 3.328, + "southcentralus": 2.704, + "southeastasia": 2.778, + "southindia": 3.027, + "switzerlandnorth": 3.021, + "switzerlandwest": 3.574, + "uaecentral": 3.174, + "uaenorth": 2.714, + "uksouth": 2.662, + "ukwest": 2.662, + "usgovarizona": 2.79, + "usgovtexas": 2.79, + "usgovvirginia": 2.79, + "westcentralus": 2.704, + "westeurope": 2.714, + "westindia": 2.752, + "westus": 2.675, + "westus2": 2.406 + }, + "lowpriorityd64v4": { + "australiaeast": 2.714, + "australiasoutheast": 2.775, + "brazilsouth": 3.136, + "brazilsoutheast": 3.723, + "canadacentral": 2.547, + "canadaeast": 2.547, + "centralindia": 2.47, + "centralus": 2.566, + "eastasia": 3.082, + "eastus": 2.406, + "eastus2": 2.406, + "francecentral": 2.611, + "francesouth": 3.045, + "germanywestcentral": 2.65, + "japaneast": 2.765, + "japanwest": 2.923, + "koreacentral": 2.688, + "northcentralus": 2.406, + "northeurope": 2.547, + "southafricanorth": 2.824, + "southcentralus": 2.652, + "southeastasia": 2.714, + "switzerlandnorth": 3.021, + "uksouth": 2.598, + "ukwest": 2.664, + "usgovarizona": 2.726, + "usgovtexas": 2.714, + "usgovvirginia": 2.726, + "westcentralus": 2.652, + "westeurope": 2.65, + "westus": 2.611, + "westus2": 2.406 + }, + "lowpriorityd96asv4": { + "australiaeast": 4.07, + "brazilsouth": 4.704, + "centralindia": 3.706, + "centralus": 3.849, + "eastasia": 4.301, + "eastus": 3.61, + "eastus2": 3.61, + "francecentral": 3.917, + "japaneast": 4.147, + "koreacentral": 4.032, + "northeurope": 3.821, + "southcentralus": 3.978, + "southeastasia": 4.07, + "uksouth": 3.898, + "westeurope": 3.974, + "westus": 3.917, + "westus2": 3.61 + }, + "lowpriorityd96av4": { + "australiaeast": 4.07, + "brazilsouth": 4.704, + "centralindia": 3.706, + "centralus": 3.849, + "eastasia": 4.301, + "eastus": 3.61, + "eastus2": 3.61, + "francecentral": 3.917, + "japaneast": 4.147, + "koreacentral": 4.032, + "northeurope": 3.821, + "southcentralus": 3.978, + "southeastasia": 4.07, + "uksouth": 3.898, + "westeurope": 3.974, + "westus": 3.917, + "westus2": 3.61 + }, + "lowprioritydc1sv2": { + "canadacentral": 0.113, + "canadaeast": 0.113, + "eastus": 0.0975, + "southeastasia": 0.121, + "uksouth": 0.117, + "westeurope": 0.121, + "westus2": 0.0975 + }, + "lowprioritydc2s": { + "eastus": 0.0975, + "westeurope": 0.121 + }, + "lowprioritydc2sv2": { + "canadacentral": 0.227, + "canadaeast": 0.227, + "eastus": 0.195, + "southeastasia": 0.242, + "uksouth": 0.234, + "westeurope": 0.242, + "westus2": 0.195 + }, + "lowprioritydc4s": { + "eastus": 0.195, + "westeurope": 0.242 + }, + "lowprioritydc4sv2": { + "canadacentral": 0.453, + "canadaeast": 0.453, + "eastus": 0.39, + "southeastasia": 0.485, + "uksouth": 0.469, + "westeurope": 0.485, + "westus2": 0.39 + }, + "lowprioritydc8sv2": { + "canadacentral": 0.906, + "canadaeast": 0.906, + "eastus": 0.78, + "southeastasia": 0.97, + "uksouth": 0.938, + "westeurope": 0.97, + "westus2": 0.78 + }, + "lowpriorityds1v2": { + "australiacentral": 0.0561, + "australiacentral2": 0.0561, + "australiaeast": 0.0561, + "australiasoutheast": 0.0561, + "brazilsouth": 0.0527, + "brazilsoutheast": 0.0629, + "canadacentral": 0.0515, + "canadaeast": 0.0515, + "centralindia": 0.052, + "centralus": 0.0504, + "eastasia": 0.0667, + "eastus": 0.0504, + "eastus2": 0.0468, + "francecentral": 0.0588, + "francesouth": 0.0764, + "germanycentral": 0.058, + "germanynorth": 0.0595, + "germanynortheast": 0.058, + "germanywestcentral": 0.0568, + "japaneast": 0.0546, + "japanwest": 0.0526, + "koreacentral": 0.0514, + "koreasouth": 0.046, + "northcentralus": 0.0504, + "northeurope": 0.0465, + "norwayeast": 0.0483, + "norwaywest": 0.0572, + "southafricanorth": 0.0492, + "southafricawest": 0.0568, + "southcentralus": 0.0468, + "southeastasia": 0.058, + "southindia": 0.052, + "switzerlandnorth": 0.051, + "switzerlandwest": 0.0608, + "uaecentral": 0.0541, + "uaenorth": 0.0459, + "uksouth": 0.0588, + "ukwest": 0.0588, + "usgovarizona": 0.0585, + "usgovtexas": 0.0585, + "usgovvirginia": 0.0585, + "westcentralus": 0.0468, + "westeurope": 0.0533, + "westindia": 0.052, + "westus": 0.0504, + "westus2": 0.0468 + }, + "lowpriorityds2v2": { + "australiacentral": 0.112, + "australiacentral2": 0.112, + "australiaeast": 0.112, + "australiasoutheast": 0.112, + "brazilsouth": 0.105, + "brazilsoutheast": 0.126, + "canadacentral": 0.103, + "canadaeast": 0.103, + "centralindia": 0.104, + "centralus": 0.101, + "eastasia": 0.133, + "eastus": 0.101, + "eastus2": 0.0936, + "francecentral": 0.118, + "francesouth": 0.153, + "germanycentral": 0.115, + "germanynorth": 0.119, + "germanynortheast": 0.115, + "germanywestcentral": 0.114, + "japaneast": 0.109, + "japanwest": 0.105, + "koreacentral": 0.103, + "koreasouth": 0.092, + "northcentralus": 0.101, + "northeurope": 0.0929, + "norwayeast": 0.0966, + "norwaywest": 0.115, + "southafricanorth": 0.098, + "southafricawest": 0.114, + "southcentralus": 0.0936, + "southeastasia": 0.116, + "southindia": 0.104, + "switzerlandnorth": 0.102, + "switzerlandwest": 0.122, + "uaecentral": 0.108, + "uaenorth": 0.0918, + "uksouth": 0.118, + "ukwest": 0.118, + "usgovarizona": 0.117, + "usgovtexas": 0.117, + "usgovvirginia": 0.117, + "westcentralus": 0.0936, + "westeurope": 0.107, + "westindia": 0.104, + "westus": 0.101, + "westus2": 0.0936 + }, + "lowpriorityds3v2": { + "australiacentral": 0.225, + "australiacentral2": 0.225, + "australiaeast": 0.225, + "australiasoutheast": 0.225, + "brazilsouth": 0.211, + "brazilsoutheast": 0.252, + "canadacentral": 0.206, + "canadaeast": 0.206, + "centralindia": 0.208, + "centralus": 0.202, + "eastasia": 0.267, + "eastus": 0.202, + "eastus2": 0.187, + "francecentral": 0.235, + "francesouth": 0.306, + "germanycentral": 0.23, + "germanynorth": 0.238, + "germanynortheast": 0.23, + "germanywestcentral": 0.227, + "japaneast": 0.218, + "japanwest": 0.21, + "koreacentral": 0.206, + "koreasouth": 0.185, + "northcentralus": 0.202, + "northeurope": 0.186, + "norwayeast": 0.193, + "norwaywest": 0.229, + "southafricanorth": 0.196, + "southafricawest": 0.228, + "southcentralus": 0.187, + "southeastasia": 0.232, + "southindia": 0.208, + "switzerlandnorth": 0.204, + "switzerlandwest": 0.243, + "uaecentral": 0.216, + "uaenorth": 0.184, + "uksouth": 0.235, + "ukwest": 0.235, + "usgovarizona": 0.234, + "usgovtexas": 0.234, + "usgovvirginia": 0.234, + "westcentralus": 0.187, + "westeurope": 0.213, + "westindia": 0.208, + "westus": 0.202, + "westus2": 0.187 + }, + "lowpriorityds4v2": { + "australiacentral": 0.449, + "australiacentral2": 0.449, + "australiaeast": 0.449, + "australiasoutheast": 0.449, + "brazilsouth": 0.421, + "brazilsoutheast": 0.503, + "canadacentral": 0.412, + "canadaeast": 0.412, + "centralindia": 0.417, + "centralus": 0.403, + "eastasia": 0.533, + "eastus": 0.403, + "eastus2": 0.374, + "francecentral": 0.47, + "francesouth": 0.611, + "germanycentral": 0.461, + "germanynorth": 0.476, + "germanynortheast": 0.461, + "germanywestcentral": 0.454, + "japaneast": 0.437, + "japanwest": 0.42, + "koreacentral": 0.411, + "koreasouth": 0.37, + "northcentralus": 0.403, + "northeurope": 0.372, + "norwayeast": 0.387, + "norwaywest": 0.458, + "southafricanorth": 0.393, + "southafricawest": 0.455, + "southcentralus": 0.374, + "southeastasia": 0.464, + "southindia": 0.417, + "switzerlandnorth": 0.408, + "switzerlandwest": 0.487, + "uaecentral": 0.433, + "uaenorth": 0.367, + "uksouth": 0.47, + "ukwest": 0.47, + "usgovarizona": 0.468, + "usgovtexas": 0.468, + "usgovvirginia": 0.468, + "westcentralus": 0.374, + "westeurope": 0.426, + "westindia": 0.417, + "westus": 0.403, + "westus2": 0.374 + }, + "lowpriorityds5v2": { + "australiacentral": 0.898, + "australiacentral2": 0.898, + "australiaeast": 0.898, + "australiasoutheast": 0.898, + "brazilsouth": 0.842, + "brazilsoutheast": 1.007, + "canadacentral": 0.824, + "canadaeast": 0.824, + "centralindia": 0.834, + "centralus": 0.806, + "eastasia": 1.066, + "eastus": 0.806, + "eastus2": 0.749, + "francecentral": 0.94, + "francesouth": 1.222, + "germanycentral": 0.921, + "germanynorth": 0.952, + "germanynortheast": 0.921, + "germanywestcentral": 0.909, + "japaneast": 0.873, + "japanwest": 0.841, + "koreacentral": 0.823, + "koreasouth": 0.74, + "northcentralus": 0.806, + "northeurope": 0.743, + "norwayeast": 0.773, + "norwaywest": 0.916, + "southafricanorth": 0.785, + "southafricawest": 0.91, + "southcentralus": 0.749, + "southeastasia": 0.927, + "southindia": 0.834, + "switzerlandnorth": 0.817, + "switzerlandwest": 0.973, + "uaecentral": 0.866, + "uaenorth": 0.734, + "uksouth": 0.94, + "ukwest": 0.94, + "usgovarizona": 0.936, + "usgovtexas": 0.936, + "usgovvirginia": 0.936, + "westcentralus": 0.749, + "westeurope": 0.852, + "westindia": 0.834, + "westus": 0.806, + "westus2": 0.749 + }, + "lowpriorityds11v2": { + "australiacentral": 0.118, + "australiacentral2": 0.118, + "australiaeast": 0.118, + "australiasoutheast": 0.118, + "brazilsouth": 0.161, + "brazilsoutheast": 0.159, + "canadacentral": 0.107, + "canadaeast": 0.107, + "centralindia": 0.113, + "centralus": 0.106, + "eastasia": 0.141, + "eastus": 0.106, + "eastus2": 0.097, + "francecentral": 0.123, + "francesouth": 0.16, + "germanycentral": 0.139, + "germanynorth": 0.141, + "germanynortheast": 0.139, + "germanywestcentral": 0.13, + "japaneast": 0.131, + "japanwest": 0.114, + "koreacentral": 0.117, + "koreasouth": 0.105, + "northcentralus": 0.106, + "northeurope": 0.0972, + "norwayeast": 0.12, + "norwaywest": 0.145, + "southafricanorth": 0.117, + "southafricawest": 0.137, + "southcentralus": 0.0972, + "southeastasia": 0.118, + "southindia": 0.113, + "switzerlandnorth": 0.128, + "switzerlandwest": 0.155, + "uaecentral": 0.13, + "uaenorth": 0.109, + "uksouth": 0.123, + "ukwest": 0.123, + "usgovarizona": 0.122, + "usgovtexas": 0.122, + "usgovvirginia": 0.122, + "westcentralus": 0.0972, + "westeurope": 0.111, + "westindia": 0.113, + "westus": 0.106, + "westus2": 0.097 + }, + "lowpriorityds12v2": { + "australiacentral": 0.236, + "australiacentral2": 0.236, + "australiaeast": 0.236, + "australiasoutheast": 0.236, + "brazilsouth": 0.323, + "brazilsoutheast": 0.318, + "canadacentral": 0.214, + "canadaeast": 0.214, + "centralindia": 0.225, + "centralus": 0.211, + "eastasia": 0.281, + "eastus": 0.211, + "eastus2": 0.194, + "francecentral": 0.246, + "francesouth": 0.32, + "germanycentral": 0.278, + "germanynorth": 0.282, + "germanynortheast": 0.278, + "germanywestcentral": 0.26, + "japaneast": 0.262, + "japanwest": 0.228, + "koreacentral": 0.233, + "koreasouth": 0.21, + "northcentralus": 0.211, + "northeurope": 0.194, + "norwayeast": 0.24, + "norwaywest": 0.29, + "southafricanorth": 0.234, + "southafricawest": 0.274, + "southcentralus": 0.194, + "southeastasia": 0.236, + "southindia": 0.225, + "switzerlandnorth": 0.256, + "switzerlandwest": 0.311, + "uaecentral": 0.26, + "uaenorth": 0.217, + "uksouth": 0.246, + "ukwest": 0.246, + "usgovarizona": 0.243, + "usgovtexas": 0.243, + "usgovvirginia": 0.243, + "westcentralus": 0.194, + "westeurope": 0.223, + "westindia": 0.225, + "westus": 0.211, + "westus2": 0.194 + }, + "lowpriorityds13v2": { + "australiacentral": 0.473, + "australiacentral2": 0.473, + "australiaeast": 0.473, + "australiasoutheast": 0.473, + "brazilsouth": 0.645, + "brazilsoutheast": 0.636, + "canadacentral": 0.428, + "canadaeast": 0.428, + "centralindia": 0.45, + "centralus": 0.422, + "eastasia": 0.563, + "eastus": 0.422, + "eastus2": 0.389, + "francecentral": 0.492, + "francesouth": 0.64, + "germanycentral": 0.518, + "germanynorth": 0.563, + "germanynortheast": 0.518, + "germanywestcentral": 0.472, + "japaneast": 0.523, + "japanwest": 0.455, + "koreacentral": 0.466, + "koreasouth": 0.42, + "northcentralus": 0.422, + "northeurope": 0.389, + "norwayeast": 0.481, + "norwaywest": 0.581, + "southafricanorth": 0.468, + "southafricawest": 0.549, + "southcentralus": 0.389, + "southeastasia": 0.473, + "southindia": 0.45, + "switzerlandnorth": 0.512, + "switzerlandwest": 0.621, + "uaecentral": 0.52, + "uaenorth": 0.434, + "uksouth": 0.492, + "ukwest": 0.492, + "usgovarizona": 0.486, + "usgovtexas": 0.486, + "usgovvirginia": 0.486, + "westcentralus": 0.389, + "westeurope": 0.446, + "westindia": 0.45, + "westus": 0.422, + "westus2": 0.389 + }, + "lowpriorityds14v2": { + "australiacentral": 0.945, + "australiacentral2": 0.945, + "australiaeast": 0.945, + "australiasoutheast": 0.945, + "brazilsouth": 1.291, + "brazilsoutheast": 1.271, + "canadacentral": 0.855, + "canadaeast": 0.855, + "centralindia": 0.901, + "centralus": 0.844, + "eastasia": 1.126, + "eastus": 0.844, + "eastus2": 0.778, + "francecentral": 0.984, + "francesouth": 1.2792, + "germanycentral": 0.933, + "germanynorth": 1.126, + "germanynortheast": 0.933, + "germanywestcentral": 0.891, + "japaneast": 1.047, + "japanwest": 0.91, + "koreacentral": 0.933, + "koreasouth": 0.84, + "northcentralus": 0.844, + "northeurope": 0.778, + "norwayeast": 0.962, + "norwaywest": 1.163, + "southafricanorth": 0.936, + "southafricawest": 1.098, + "southcentralus": 0.778, + "southeastasia": 0.945, + "southindia": 0.901, + "switzerlandnorth": 1.024, + "switzerlandwest": 1.243, + "uaecentral": 1.041, + "uaenorth": 0.868, + "uksouth": 0.984, + "ukwest": 0.984, + "usgovarizona": 0.972, + "usgovtexas": 0.972, + "usgovvirginia": 0.972, + "westcentralus": 0.778, + "westeurope": 0.891, + "westindia": 0.901, + "westus": 0.844, + "westus2": 0.778 + }, + "lowpriorityds15v2": { + "australiacentral": 1.182, + "australiacentral2": 1.182, + "australiaeast": 1.182, + "australiasoutheast": 1.182, + "brazilsouth": 1.614, + "brazilsoutheast": 1.589, + "canadacentral": 1.069, + "canadaeast": 1.069, + "centralindia": 1.126, + "centralus": 1.056, + "eastasia": 1.407, + "eastus": 1.056, + "eastus2": 0.972, + "francecentral": 1.23, + "francesouth": 1.599, + "germanycentral": 1.166, + "germanynorth": 1.408, + "germanynortheast": 1.166, + "germanywestcentral": 1.3, + "japaneast": 1.308, + "japanwest": 1.138, + "koreacentral": 1.166, + "koreasouth": 1.049, + "northcentralus": 1.056, + "northeurope": 0.972, + "norwayeast": 1.203, + "norwaywest": 1.453, + "southafricanorth": 1.169, + "southafricawest": 1.373, + "southcentralus": 0.972, + "southeastasia": 1.182, + "southindia": 1.126, + "switzerlandnorth": 1.28, + "switzerlandwest": 1.554, + "uaecentral": 1.301, + "uaenorth": 1.086, + "uksouth": 1.23, + "ukwest": 1.23, + "usgovarizona": 1.215, + "usgovtexas": 1.215, + "usgovvirginia": 1.215, + "westcentralus": 0.972, + "westeurope": 1.114, + "westindia": 1.126, + "westus": 1.056, + "westus2": 0.972 + }, + "lowprioritye2asv4": { + "australiaeast": 0.0972, + "brazilsouth": 0.117, + "centralindia": 0.0888, + "centralus": 0.0938, + "eastasia": 0.104, + "eastus": 0.0872, + "eastus2": 0.0872, + "francecentral": 0.096, + "japaneast": 0.0976, + "koreacentral": 0.0976, + "northeurope": 0.0932, + "southcentralus": 0.0973, + "southeastasia": 0.0976, + "uksouth": 0.096, + "westeurope": 0.0976, + "westus": 0.0928, + "westus2": 0.0872 + }, + "lowprioritye2av4": { + "australiaeast": 0.0972, + "brazilsouth": 0.117, + "centralindia": 0.0888, + "centralus": 0.0938, + "eastasia": 0.104, + "eastus": 0.0872, + "eastus2": 0.0872, + "francecentral": 0.096, + "japaneast": 0.0976, + "koreacentral": 0.0976, + "northeurope": 0.0932, + "southcentralus": 0.0973, + "southeastasia": 0.0976, + "uksouth": 0.096, + "westeurope": 0.0976, + "westus": 0.0928, + "westus2": 0.0872 + }, + "lowprioritye2dsv4": { + "australiaeast": 0.106, + "australiasoutheast": 0.106, + "brazilsouth": 0.128, + "canadacentral": 0.1, + "canadaeast": 0.106, + "centralindia": 0.0972, + "centralus": 0.102, + "eastasia": 0.126, + "eastus": 0.0944, + "eastus2": 0.0944, + "francecentral": 0.104, + "francesouth": 0.124, + "germanywestcentral": 0.106, + "japaneast": 0.106, + "japanwest": 0.113, + "koreacentral": 0.106, + "northcentralus": 0.0944, + "northeurope": 0.101, + "southafricanorth": 0.114, + "southcentralus": 0.112, + "southeastasia": 0.106, + "switzerlandnorth": 0.123, + "uksouth": 0.104, + "ukwest": 0.106, + "usgovarizona": 0.106, + "usgovtexas": 0.109, + "usgovvirginia": 0.106, + "westcentralus": 0.106, + "westeurope": 0.106, + "westus": 0.102, + "westus2": 0.0944 + }, + "lowprioritye2sv3": { + "australiacentral": 0.101, + "australiacentral2": 0.101, + "australiaeast": 0.101, + "australiasoutheast": 0.101, + "brazilsouth": 0.149, + "brazilsoutheast": 0.159, + "canadacentral": 0.095, + "canadaeast": 0.095, + "centralindia": 0.0915, + "centralus": 0.099, + "eastasia": 0.104, + "eastus": 0.0872, + "eastus2": 0.09, + "francecentral": 0.099, + "francesouth": 0.1287, + "germanycentral": 0.109, + "germanynorth": 0.116, + "germanynortheast": 0.109, + "germanywestcentral": 0.0976, + "japaneast": 0.101, + "japanwest": 0.101, + "koreacentral": 0.101, + "koreasouth": 0.0907, + "northcentralus": 0.0872, + "northeurope": 0.0932, + "norwayeast": 0.107, + "norwaywest": 0.128, + "southafricanorth": 0.104, + "southafricawest": 0.122, + "southcentralus": 0.0951, + "southeastasia": 0.101, + "southindia": 0.107, + "switzerlandnorth": 0.114, + "switzerlandwest": 0.137, + "uaecentral": 0.115, + "uaenorth": 0.0973, + "uksouth": 0.099, + "ukwest": 0.099, + "usgovarizona": 0.101, + "usgovtexas": 0.101, + "usgovvirginia": 0.101, + "westcentralus": 0.0951, + "westeurope": 0.101, + "westindia": 0.0975, + "westus": 0.096, + "westus2": 0.0872 + }, + "lowprioritye2sv4": { + "australiaeast": 0.0972, + "australiasoutheast": 0.102, + "brazilsouth": 0.117, + "brazilsoutheast": 0.141, + "canadacentral": 0.092, + "canadaeast": 0.092, + "centralindia": 0.0888, + "centralus": 0.0938, + "eastasia": 0.115, + "eastus": 0.0872, + "eastus2": 0.0872, + "francecentral": 0.096, + "francesouth": 0.113, + "germanywestcentral": 0.0976, + "japaneast": 0.0976, + "japanwest": 0.104, + "koreacentral": 0.0976, + "northcentralus": 0.0872, + "northeurope": 0.0932, + "southafricanorth": 0.104, + "southcentralus": 0.0973, + "southeastasia": 0.0976, + "switzerlandnorth": 0.112, + "uksouth": 0.096, + "ukwest": 0.0978, + "usgovarizona": 0.0972, + "usgovtexas": 0.0998, + "usgovvirginia": 0.0972, + "westcentralus": 0.0973, + "westeurope": 0.0976, + "westus": 0.0928, + "westus2": 0.0872 + }, + "lowprioritye2v3": { + "australiacentral": 0.101, + "australiacentral2": 0.101, + "australiaeast": 0.101, + "australiasoutheast": 0.101, + "brazilsouth": 0.149, + "brazilsoutheast": 0.159, + "canadacentral": 0.095, + "canadaeast": 0.095, + "centralindia": 0.0915, + "centralus": 0.099, + "eastasia": 0.104, + "eastus": 0.0872, + "eastus2": 0.09, + "francecentral": 0.099, + "francesouth": 0.1287, + "germanycentral": 0.109, + "germanynorth": 0.116, + "germanynortheast": 0.109, + "germanywestcentral": 0.0976, + "japaneast": 0.101, + "japanwest": 0.101, + "koreacentral": 0.101, + "koreasouth": 0.0907, + "northcentralus": 0.0872, + "northeurope": 0.0932, + "norwayeast": 0.107, + "norwaywest": 0.128, + "southafricanorth": 0.104, + "southafricawest": 0.122, + "southcentralus": 0.0951, + "southeastasia": 0.101, + "southindia": 0.107, + "switzerlandnorth": 0.114, + "switzerlandwest": 0.137, + "uaecentral": 0.115, + "uaenorth": 0.0973, + "uksouth": 0.099, + "ukwest": 0.099, + "usgovarizona": 0.101, + "usgovtexas": 0.101, + "usgovvirginia": 0.101, + "westcentralus": 0.0951, + "westeurope": 0.101, + "westindia": 0.0975, + "westus": 0.096, + "westus2": 0.0872 + }, + "lowprioritye2v4": { + "australiaeast": 0.0972, + "australiasoutheast": 0.102, + "brazilsouth": 0.117, + "brazilsoutheast": 0.141, + "canadacentral": 0.092, + "canadaeast": 0.092, + "centralindia": 0.0888, + "centralus": 0.0938, + "eastasia": 0.115, + "eastus": 0.0872, + "eastus2": 0.0872, + "francecentral": 0.096, + "francesouth": 0.113, + "germanywestcentral": 0.0976, + "japaneast": 0.0976, + "japanwest": 0.104, + "koreacentral": 0.0976, + "northcentralus": 0.0872, + "northeurope": 0.0932, + "southafricanorth": 0.104, + "southcentralus": 0.0973, + "southeastasia": 0.0976, + "switzerlandnorth": 0.112, + "uksouth": 0.096, + "ukwest": 0.0978, + "usgovarizona": 0.0972, + "usgovtexas": 0.0998, + "usgovvirginia": 0.0972, + "westcentralus": 0.0973, + "westeurope": 0.0976, + "westus": 0.0928, + "westus2": 0.0872 + }, + "lowprioritye4asv4": { + "australiaeast": 0.194, + "brazilsouth": 0.234, + "centralindia": 0.178, + "centralus": 0.188, + "eastasia": 0.207, + "eastus": 0.174, + "eastus2": 0.174, + "francecentral": 0.192, + "japaneast": 0.195, + "koreacentral": 0.195, + "northeurope": 0.186, + "southcentralus": 0.195, + "southeastasia": 0.195, + "uksouth": 0.192, + "westeurope": 0.195, + "westus": 0.186, + "westus2": 0.174 + }, + "lowprioritye4av4": { + "australiaeast": 0.194, + "brazilsouth": 0.234, + "centralindia": 0.178, + "centralus": 0.188, + "eastasia": 0.207, + "eastus": 0.174, + "eastus2": 0.174, + "francecentral": 0.192, + "japaneast": 0.195, + "koreacentral": 0.195, + "northeurope": 0.186, + "southcentralus": 0.195, + "southeastasia": 0.195, + "uksouth": 0.192, + "westeurope": 0.195, + "westus": 0.186, + "westus2": 0.174 + }, + "lowprioritye4dsv4": { + "australiaeast": 0.213, + "australiasoutheast": 0.212, + "brazilsouth": 0.257, + "canadacentral": 0.2, + "canadaeast": 0.212, + "centralindia": 0.194, + "centralus": 0.204, + "eastasia": 0.252, + "eastus": 0.189, + "eastus2": 0.189, + "francecentral": 0.209, + "francesouth": 0.249, + "germanywestcentral": 0.212, + "japaneast": 0.213, + "japanwest": 0.226, + "koreacentral": 0.212, + "northcentralus": 0.189, + "northeurope": 0.202, + "southafricanorth": 0.228, + "southcentralus": 0.223, + "southeastasia": 0.213, + "switzerlandnorth": 0.246, + "uksouth": 0.209, + "ukwest": 0.213, + "usgovarizona": 0.212, + "usgovtexas": 0.218, + "usgovvirginia": 0.212, + "westcentralus": 0.212, + "westeurope": 0.212, + "westus": 0.203, + "westus2": 0.189 + }, + "lowprioritye4sv3": { + "australiacentral": 0.201, + "australiacentral2": 0.201, + "australiaeast": 0.201, + "australiasoutheast": 0.201, + "brazilsouth": 0.298, + "brazilsoutheast": 0.318, + "canadacentral": 0.19, + "canadaeast": 0.19, + "centralindia": 0.183, + "centralus": 0.198, + "eastasia": 0.207, + "eastus": 0.174, + "eastus2": 0.18, + "francecentral": 0.198, + "francesouth": 0.2574, + "germanycentral": 0.218, + "germanynorth": 0.232, + "germanynortheast": 0.218, + "germanywestcentral": 0.195, + "japaneast": 0.202, + "japanwest": 0.202, + "koreacentral": 0.202, + "koreasouth": 0.181, + "northcentralus": 0.174, + "northeurope": 0.186, + "norwayeast": 0.214, + "norwaywest": 0.257, + "southafricanorth": 0.209, + "southafricawest": 0.243, + "southcentralus": 0.19, + "southeastasia": 0.202, + "southindia": 0.207, + "switzerlandnorth": 0.227, + "switzerlandwest": 0.273, + "uaecentral": 0.231, + "uaenorth": 0.195, + "uksouth": 0.198, + "ukwest": 0.198, + "usgovarizona": 0.201, + "usgovtexas": 0.201, + "usgovvirginia": 0.201, + "westcentralus": 0.19, + "westeurope": 0.202, + "westindia": 0.195, + "westus": 0.192, + "westus2": 0.174 + }, + "lowprioritye4sv4": { + "australiaeast": 0.194, + "australiasoutheast": 0.205, + "brazilsouth": 0.234, + "brazilsoutheast": 0.283, + "canadacentral": 0.184, + "canadaeast": 0.184, + "centralindia": 0.178, + "centralus": 0.188, + "eastasia": 0.23, + "eastus": 0.174, + "eastus2": 0.174, + "francecentral": 0.192, + "francesouth": 0.227, + "germanywestcentral": 0.195, + "japaneast": 0.195, + "japanwest": 0.207, + "koreacentral": 0.195, + "northcentralus": 0.174, + "northeurope": 0.186, + "southafricanorth": 0.209, + "southcentralus": 0.195, + "southeastasia": 0.195, + "switzerlandnorth": 0.225, + "uksouth": 0.192, + "ukwest": 0.196, + "usgovarizona": 0.194, + "usgovtexas": 0.2, + "usgovvirginia": 0.194, + "westcentralus": 0.195, + "westeurope": 0.195, + "westus": 0.186, + "westus2": 0.174 + }, + "lowprioritye4v3": { + "australiacentral": 0.201, + "australiacentral2": 0.201, + "australiaeast": 0.201, + "australiasoutheast": 0.201, + "brazilsouth": 0.298, + "brazilsoutheast": 0.318, + "canadacentral": 0.19, + "canadaeast": 0.19, + "centralindia": 0.183, + "centralus": 0.198, + "eastasia": 0.207, + "eastus": 0.174, + "eastus2": 0.18, + "francecentral": 0.198, + "francesouth": 0.2574, + "germanycentral": 0.218, + "germanynorth": 0.232, + "germanynortheast": 0.218, + "germanywestcentral": 0.195, + "japaneast": 0.202, + "japanwest": 0.202, + "koreacentral": 0.202, + "koreasouth": 0.181, + "northcentralus": 0.174, + "northeurope": 0.186, + "norwayeast": 0.214, + "norwaywest": 0.257, + "southafricanorth": 0.209, + "southafricawest": 0.243, + "southcentralus": 0.19, + "southeastasia": 0.202, + "southindia": 0.207, + "switzerlandnorth": 0.227, + "switzerlandwest": 0.273, + "uaecentral": 0.231, + "uaenorth": 0.195, + "uksouth": 0.198, + "ukwest": 0.198, + "usgovarizona": 0.201, + "usgovtexas": 0.201, + "usgovvirginia": 0.201, + "westcentralus": 0.19, + "westeurope": 0.202, + "westindia": 0.195, + "westus": 0.192, + "westus2": 0.174 + }, + "lowprioritye4v4": { + "australiaeast": 0.194, + "australiasoutheast": 0.205, + "brazilsouth": 0.234, + "brazilsoutheast": 0.283, + "canadacentral": 0.184, + "canadaeast": 0.184, + "centralindia": 0.178, + "centralus": 0.188, + "eastasia": 0.23, + "eastus": 0.174, + "eastus2": 0.174, + "francecentral": 0.192, + "francesouth": 0.227, + "germanywestcentral": 0.195, + "japaneast": 0.195, + "japanwest": 0.207, + "koreacentral": 0.195, + "northcentralus": 0.174, + "northeurope": 0.186, + "southafricanorth": 0.209, + "southcentralus": 0.195, + "southeastasia": 0.195, + "switzerlandnorth": 0.225, + "uksouth": 0.192, + "ukwest": 0.196, + "usgovarizona": 0.194, + "usgovtexas": 0.2, + "usgovvirginia": 0.194, + "westcentralus": 0.195, + "westeurope": 0.195, + "westus": 0.186, + "westus2": 0.174 + }, + "lowprioritye8asv4": { + "australiaeast": 0.389, + "brazilsouth": 0.469, + "centralindia": 0.355, + "centralus": 0.375, + "eastasia": 0.414, + "eastus": 0.349, + "eastus2": 0.349, + "francecentral": 0.384, + "japaneast": 0.39, + "koreacentral": 0.39, + "northeurope": 0.373, + "southcentralus": 0.389, + "southeastasia": 0.39, + "uksouth": 0.384, + "westeurope": 0.39, + "westus": 0.371, + "westus2": 0.349 + }, + "lowprioritye8av4": { + "australiaeast": 0.389, + "brazilsouth": 0.469, + "centralindia": 0.355, + "centralus": 0.375, + "eastasia": 0.414, + "eastus": 0.349, + "eastus2": 0.349, + "francecentral": 0.384, + "japaneast": 0.39, + "koreacentral": 0.39, + "northeurope": 0.373, + "southcentralus": 0.389, + "southeastasia": 0.39, + "uksouth": 0.384, + "westeurope": 0.39, + "westus": 0.371, + "westus2": 0.349 + }, + "lowprioritye8dsv4": { + "australiaeast": 0.426, + "australiasoutheast": 0.424, + "brazilsouth": 0.513, + "canadacentral": 0.4, + "canadaeast": 0.424, + "centralindia": 0.389, + "centralus": 0.408, + "eastasia": 0.504, + "eastus": 0.378, + "eastus2": 0.378, + "francecentral": 0.418, + "francesouth": 0.497, + "germanywestcentral": 0.424, + "japaneast": 0.426, + "japanwest": 0.453, + "koreacentral": 0.424, + "northcentralus": 0.378, + "northeurope": 0.403, + "southafricanorth": 0.456, + "southcentralus": 0.447, + "southeastasia": 0.426, + "switzerlandnorth": 0.493, + "uksouth": 0.418, + "ukwest": 0.426, + "usgovarizona": 0.424, + "usgovtexas": 0.435, + "usgovvirginia": 0.424, + "westcentralus": 0.424, + "westeurope": 0.424, + "westus": 0.406, + "westus2": 0.378 + }, + "lowprioritye8sv3": { + "australiacentral": 0.402, + "australiacentral2": 0.402, + "australiaeast": 0.402, + "australiasoutheast": 0.402, + "brazilsouth": 0.595, + "brazilsoutheast": 0.636, + "canadacentral": 0.381, + "canadaeast": 0.381, + "centralindia": 0.366, + "centralus": 0.396, + "eastasia": 0.414, + "eastus": 0.349, + "eastus2": 0.36, + "francecentral": 0.397, + "francesouth": 0.471, + "germanycentral": 0.436, + "germanynorth": 0.463, + "germanynortheast": 0.436, + "germanywestcentral": 0.39, + "japaneast": 0.403, + "japanwest": 0.403, + "koreacentral": 0.403, + "koreasouth": 0.363, + "northcentralus": 0.349, + "northeurope": 0.373, + "norwayeast": 0.429, + "norwaywest": 0.513, + "southafricanorth": 0.417, + "southafricawest": 0.486, + "southcentralus": 0.38, + "southeastasia": 0.403, + "southindia": 0.414, + "switzerlandnorth": 0.454, + "switzerlandwest": 0.547, + "uaecentral": 0.462, + "uaenorth": 0.389, + "uksouth": 0.397, + "ukwest": 0.397, + "usgovarizona": 0.402, + "usgovtexas": 0.402, + "usgovvirginia": 0.402, + "westcentralus": 0.38, + "westeurope": 0.403, + "westindia": 0.39, + "westus": 0.384, + "westus2": 0.349 + }, + "lowprioritye8sv4": { + "australiaeast": 0.389, + "australiasoutheast": 0.409, + "brazilsouth": 0.469, + "brazilsoutheast": 0.565, + "canadacentral": 0.368, + "canadaeast": 0.368, + "centralindia": 0.355, + "centralus": 0.375, + "eastasia": 0.46, + "eastus": 0.349, + "eastus2": 0.349, + "francecentral": 0.384, + "francesouth": 0.454, + "germanywestcentral": 0.39, + "japaneast": 0.39, + "japanwest": 0.415, + "koreacentral": 0.39, + "northcentralus": 0.349, + "northeurope": 0.373, + "southafricanorth": 0.417, + "southcentralus": 0.389, + "southeastasia": 0.39, + "switzerlandnorth": 0.45, + "uksouth": 0.384, + "ukwest": 0.391, + "usgovarizona": 0.389, + "usgovtexas": 0.399, + "usgovvirginia": 0.389, + "westcentralus": 0.389, + "westeurope": 0.39, + "westus": 0.371, + "westus2": 0.349 + }, + "lowprioritye8v3": { + "australiacentral": 0.402, + "australiacentral2": 0.402, + "australiaeast": 0.402, + "australiasoutheast": 0.402, + "brazilsouth": 0.595, + "brazilsoutheast": 0.636, + "canadacentral": 0.381, + "canadaeast": 0.381, + "centralindia": 0.366, + "centralus": 0.396, + "eastasia": 0.414, + "eastus": 0.349, + "eastus2": 0.36, + "francecentral": 0.397, + "francesouth": 0.471, + "germanycentral": 0.436, + "germanynorth": 0.463, + "germanynortheast": 0.436, + "germanywestcentral": 0.39, + "japaneast": 0.403, + "japanwest": 0.403, + "koreacentral": 0.403, + "koreasouth": 0.363, + "northcentralus": 0.349, + "northeurope": 0.373, + "norwayeast": 0.429, + "norwaywest": 0.513, + "southafricanorth": 0.417, + "southafricawest": 0.486, + "southcentralus": 0.38, + "southeastasia": 0.403, + "southindia": 0.414, + "switzerlandnorth": 0.454, + "switzerlandwest": 0.547, + "uaecentral": 0.462, + "uaenorth": 0.389, + "uksouth": 0.397, + "ukwest": 0.397, + "usgovarizona": 0.402, + "usgovtexas": 0.402, + "usgovvirginia": 0.402, + "westcentralus": 0.38, + "westeurope": 0.403, + "westindia": 0.39, + "westus": 0.384, + "westus2": 0.349 + }, + "lowprioritye8v4": { + "australiaeast": 0.389, + "australiasoutheast": 0.409, + "brazilsouth": 0.469, + "brazilsoutheast": 0.565, + "canadacentral": 0.368, + "canadaeast": 0.368, + "centralindia": 0.355, + "centralus": 0.375, + "eastasia": 0.46, + "eastus": 0.349, + "eastus2": 0.349, + "francecentral": 0.384, + "francesouth": 0.454, + "germanywestcentral": 0.39, + "japaneast": 0.39, + "japanwest": 0.415, + "koreacentral": 0.39, + "northcentralus": 0.349, + "northeurope": 0.373, + "southafricanorth": 0.417, + "southcentralus": 0.389, + "southeastasia": 0.39, + "switzerlandnorth": 0.45, + "uksouth": 0.384, + "ukwest": 0.391, + "usgovarizona": 0.389, + "usgovtexas": 0.399, + "usgovvirginia": 0.389, + "westcentralus": 0.389, + "westeurope": 0.39, + "westus": 0.371, + "westus2": 0.349 + }, + "lowprioritye16asv4": { + "australiaeast": 0.778, + "brazilsouth": 0.938, + "centralindia": 0.71, + "centralus": 0.75, + "eastasia": 0.829, + "eastus": 0.698, + "eastus2": 0.698, + "francecentral": 0.768, + "japaneast": 0.781, + "koreacentral": 0.781, + "northeurope": 0.746, + "southcentralus": 0.778, + "southeastasia": 0.781, + "uksouth": 0.768, + "westeurope": 0.781, + "westus": 0.742, + "westus2": 0.698 + }, + "lowprioritye16av4": { + "australiaeast": 0.778, + "brazilsouth": 0.938, + "centralindia": 0.71, + "centralus": 0.75, + "eastasia": 0.829, + "eastus": 0.698, + "eastus2": 0.698, + "francecentral": 0.768, + "japaneast": 0.781, + "koreacentral": 0.781, + "northeurope": 0.746, + "southcentralus": 0.778, + "southeastasia": 0.781, + "uksouth": 0.768, + "westeurope": 0.781, + "westus": 0.742, + "westus2": 0.698 + }, + "lowprioritye16dsv4": { + "australiaeast": 0.851, + "australiasoutheast": 0.847, + "brazilsouth": 1.026, + "canadacentral": 0.8, + "canadaeast": 0.847, + "centralindia": 0.778, + "centralus": 0.815, + "eastasia": 1.009, + "eastus": 0.755, + "eastus2": 0.755, + "francecentral": 0.835, + "francesouth": 0.995, + "germanywestcentral": 0.848, + "japaneast": 0.851, + "japanwest": 0.906, + "koreacentral": 0.848, + "northcentralus": 0.755, + "northeurope": 0.806, + "southafricanorth": 0.912, + "southcentralus": 0.893, + "southeastasia": 0.851, + "switzerlandnorth": 0.986, + "uksouth": 0.835, + "ukwest": 0.852, + "usgovarizona": 0.848, + "usgovtexas": 0.87, + "usgovvirginia": 0.848, + "westcentralus": 0.847, + "westeurope": 0.848, + "westus": 0.813, + "westus2": 0.755 + }, + "lowprioritye16sv3": { + "australiacentral": 0.805, + "australiacentral2": 0.805, + "australiaeast": 0.805, + "australiasoutheast": 0.805, + "brazilsouth": 1.19, + "brazilsoutheast": 1.272, + "canadacentral": 0.762, + "canadaeast": 0.762, + "centralindia": 0.733, + "centralus": 0.792, + "eastasia": 0.829, + "eastus": 0.698, + "eastus2": 0.72, + "francecentral": 0.794, + "francesouth": 0.943, + "germanycentral": 0.871, + "germanynorth": 0.927, + "germanynortheast": 0.871, + "germanywestcentral": 0.781, + "japaneast": 0.806, + "japanwest": 0.806, + "koreacentral": 0.806, + "koreasouth": 0.726, + "northcentralus": 0.698, + "northeurope": 0.746, + "norwayeast": 0.858, + "norwaywest": 1.027, + "southafricanorth": 0.835, + "southafricawest": 0.972, + "southcentralus": 0.778, + "southeastasia": 0.806, + "southindia": 0.828, + "switzerlandnorth": 0.909, + "switzerlandwest": 1.093, + "uaecentral": 0.923, + "uaenorth": 0.778, + "uksouth": 0.794, + "ukwest": 0.794, + "usgovarizona": 0.805, + "usgovtexas": 0.805, + "usgovvirginia": 0.805, + "westcentralus": 0.778, + "westeurope": 0.806, + "westindia": 0.781, + "westus": 0.742, + "westus2": 0.698 + }, + "lowprioritye16sv4": { + "australiaeast": 0.778, + "australiasoutheast": 0.819, + "brazilsouth": 0.938, + "brazilsoutheast": 1.131, + "canadacentral": 0.736, + "canadaeast": 0.736, + "centralindia": 0.71, + "centralus": 0.75, + "eastasia": 0.919, + "eastus": 0.698, + "eastus2": 0.698, + "francecentral": 0.768, + "francesouth": 0.907, + "germanywestcentral": 0.781, + "japaneast": 0.781, + "japanwest": 0.829, + "koreacentral": 0.781, + "northcentralus": 0.698, + "northeurope": 0.746, + "southafricanorth": 0.835, + "southcentralus": 0.778, + "southeastasia": 0.781, + "switzerlandnorth": 0.899, + "uksouth": 0.768, + "ukwest": 0.782, + "usgovarizona": 0.778, + "usgovtexas": 0.798, + "usgovvirginia": 0.778, + "westcentralus": 0.778, + "westeurope": 0.781, + "westus": 0.742, + "westus2": 0.698 + }, + "lowprioritye16v3": { + "australiacentral": 0.805, + "australiacentral2": 0.805, + "australiaeast": 0.805, + "australiasoutheast": 0.805, + "brazilsouth": 1.19, + "brazilsoutheast": 1.272, + "canadacentral": 0.762, + "canadaeast": 0.762, + "centralindia": 0.733, + "centralus": 0.792, + "eastasia": 0.829, + "eastus": 0.698, + "eastus2": 0.72, + "francecentral": 0.794, + "francesouth": 0.943, + "germanycentral": 0.871, + "germanynorth": 0.927, + "germanynortheast": 0.871, + "germanywestcentral": 0.781, + "japaneast": 0.806, + "japanwest": 0.806, + "koreacentral": 0.806, + "koreasouth": 0.726, + "northcentralus": 0.698, + "northeurope": 0.746, + "norwayeast": 0.858, + "norwaywest": 1.027, + "southafricanorth": 0.835, + "southafricawest": 0.972, + "southcentralus": 0.778, + "southeastasia": 0.806, + "southindia": 0.828, + "switzerlandnorth": 0.909, + "switzerlandwest": 1.093, + "uaecentral": 0.923, + "uaenorth": 0.778, + "uksouth": 0.794, + "ukwest": 0.794, + "usgovarizona": 0.805, + "usgovtexas": 0.805, + "usgovvirginia": 0.805, + "westcentralus": 0.778, + "westeurope": 0.806, + "westindia": 0.781, + "westus": 0.742, + "westus2": 0.698 + }, + "lowprioritye16v4": { + "australiaeast": 0.778, + "australiasoutheast": 0.819, + "brazilsouth": 0.938, + "brazilsoutheast": 1.131, + "canadacentral": 0.736, + "canadaeast": 0.736, + "centralindia": 0.71, + "centralus": 0.75, + "eastasia": 0.919, + "eastus": 0.698, + "eastus2": 0.698, + "francecentral": 0.768, + "francesouth": 0.907, + "germanywestcentral": 0.781, + "japaneast": 0.781, + "japanwest": 0.829, + "koreacentral": 0.781, + "northcentralus": 0.698, + "northeurope": 0.746, + "southafricanorth": 0.835, + "southcentralus": 0.778, + "southeastasia": 0.781, + "switzerlandnorth": 0.899, + "uksouth": 0.768, + "ukwest": 0.782, + "usgovarizona": 0.778, + "usgovtexas": 0.798, + "usgovvirginia": 0.778, + "westcentralus": 0.778, + "westeurope": 0.781, + "westus": 0.742, + "westus2": 0.698 + }, + "lowprioritye20asv4": { + "australiaeast": 0.972, + "brazilsouth": 1.172, + "centralindia": 0.888, + "centralus": 0.938, + "eastasia": 1.036, + "eastus": 0.872, + "eastus2": 0.872, + "francecentral": 0.96, + "japaneast": 0.976, + "koreacentral": 0.976, + "northeurope": 0.932, + "southcentralus": 0.973, + "southeastasia": 0.976, + "uksouth": 0.96, + "westeurope": 0.976, + "westus": 0.928, + "westus2": 0.872 + }, + "lowprioritye20av4": { + "australiaeast": 0.972, + "brazilsouth": 1.172, + "centralindia": 0.888, + "centralus": 0.938, + "eastasia": 1.036, + "eastus": 0.872, + "eastus2": 0.872, + "francecentral": 0.96, + "japaneast": 0.976, + "koreacentral": 0.976, + "northeurope": 0.932, + "southcentralus": 0.973, + "southeastasia": 0.976, + "uksouth": 0.96, + "westeurope": 0.976, + "westus": 0.928, + "westus2": 0.872 + }, + "lowprioritye20dsv4": { + "australiaeast": 1.064, + "australiasoutheast": 1.059, + "brazilsouth": 1.283, + "canadacentral": 1.0, + "canadaeast": 1.059, + "centralindia": 0.972, + "centralus": 1.019, + "eastasia": 1.261, + "eastus": 0.944, + "eastus2": 0.944, + "francecentral": 1.044, + "francesouth": 1.244, + "germanywestcentral": 1.06, + "japaneast": 1.064, + "japanwest": 1.132, + "koreacentral": 1.06, + "northcentralus": 0.944, + "northeurope": 1.008, + "southafricanorth": 1.14, + "southcentralus": 1.117, + "southeastasia": 1.064, + "switzerlandnorth": 1.232, + "uksouth": 1.044, + "ukwest": 1.065, + "usgovarizona": 1.06, + "usgovtexas": 1.088, + "usgovvirginia": 1.06, + "westcentralus": 1.059, + "westeurope": 1.06, + "westus": 1.016, + "westus2": 0.944 + }, + "lowprioritye20sv3": { + "australiacentral": 0.972, + "australiacentral2": 0.972, + "australiaeast": 0.972, + "australiasoutheast": 0.972, + "brazilsouth": 1.307, + "brazilsoutheast": 1.824, + "canadacentral": 0.95, + "canadaeast": 0.95, + "centralindia": 0.915, + "centralus": 0.99, + "eastasia": 1.036, + "eastus": 0.872, + "eastus2": 0.872, + "francecentral": 0.99, + "francesouth": 1.287, + "germanycentral": 1.09, + "germanynorth": 1.158, + "germanynortheast": 1.09, + "germanywestcentral": 0.976, + "japaneast": 0.976, + "japanwest": 1.008, + "koreacentral": 0.976, + "koreasouth": 0.907, + "northcentralus": 0.872, + "northeurope": 0.932, + "norwayeast": 1.072, + "norwaywest": 1.283, + "southafricanorth": 1.043, + "southafricawest": 1.215, + "southcentralus": 0.951, + "southeastasia": 1.008, + "southindia": 1.07, + "switzerlandnorth": 1.136, + "switzerlandwest": 1.366, + "uaecentral": 1.269, + "uaenorth": 0.976, + "uksouth": 0.99, + "ukwest": 0.99, + "usgovarizona": 0.972, + "usgovtexas": 0.972, + "usgovvirginia": 0.972, + "westcentralus": 0.951, + "westeurope": 0.976, + "westindia": 0.975, + "westus": 0.96, + "westus2": 0.872 + }, + "lowprioritye20sv4": { + "australiaeast": 0.972, + "australiasoutheast": 1.023, + "brazilsouth": 1.172, + "brazilsoutheast": 1.413, + "canadacentral": 0.92, + "canadaeast": 0.92, + "centralindia": 0.888, + "centralus": 0.938, + "eastasia": 1.149, + "eastus": 0.872, + "eastus2": 0.872, + "francecentral": 0.96, + "francesouth": 1.134, + "germanywestcentral": 0.976, + "japaneast": 0.976, + "japanwest": 1.037, + "koreacentral": 0.976, + "northcentralus": 0.872, + "northeurope": 0.932, + "southafricanorth": 1.043, + "southcentralus": 0.973, + "southeastasia": 0.976, + "switzerlandnorth": 1.124, + "uksouth": 0.96, + "ukwest": 0.978, + "usgovarizona": 0.972, + "usgovtexas": 0.998, + "usgovvirginia": 0.972, + "westcentralus": 0.973, + "westeurope": 0.976, + "westus": 0.928, + "westus2": 0.872 + }, + "lowprioritye20v3": { + "australiacentral": 0.972, + "australiacentral2": 0.972, + "australiaeast": 0.972, + "australiasoutheast": 0.972, + "brazilsouth": 1.307, + "brazilsoutheast": 1.824, + "canadacentral": 0.95, + "canadaeast": 0.95, + "centralindia": 0.915, + "centralus": 0.99, + "eastasia": 1.036, + "eastus": 0.872, + "eastus2": 0.872, + "francecentral": 0.99, + "francesouth": 1.287, + "germanycentral": 1.09, + "germanynorth": 1.158, + "germanynortheast": 1.09, + "germanywestcentral": 0.976, + "japaneast": 0.976, + "japanwest": 1.008, + "koreacentral": 0.976, + "koreasouth": 0.907, + "northcentralus": 0.872, + "northeurope": 0.932, + "norwayeast": 1.072, + "norwaywest": 1.283, + "southafricanorth": 1.043, + "southafricawest": 1.215, + "southcentralus": 0.951, + "southeastasia": 1.008, + "southindia": 1.07, + "switzerlandnorth": 1.136, + "switzerlandwest": 1.366, + "uaecentral": 1.269, + "uaenorth": 0.976, + "uksouth": 0.99, + "ukwest": 0.99, + "usgovarizona": 0.972, + "usgovtexas": 0.972, + "usgovvirginia": 0.972, + "westcentralus": 0.951, + "westeurope": 0.976, + "westindia": 0.975, + "westus": 0.96, + "westus2": 0.872 + }, + "lowprioritye32asv4": { + "australiaeast": 1.555, + "brazilsouth": 1.875, + "centralindia": 1.421, + "centralus": 1.5, + "eastasia": 1.658, + "eastus": 1.395, + "eastus2": 1.395, + "francecentral": 1.536, + "japaneast": 1.562, + "koreacentral": 1.562, + "northeurope": 1.491, + "southcentralus": 1.556, + "southeastasia": 1.562, + "uksouth": 1.536, + "westeurope": 1.562, + "westus": 1.485, + "westus2": 1.395 + }, + "lowprioritye32av4": { + "australiaeast": 1.555, + "brazilsouth": 1.875, + "centralindia": 1.421, + "centralus": 1.5, + "eastasia": 1.658, + "eastus": 1.395, + "eastus2": 1.395, + "francecentral": 1.536, + "japaneast": 1.562, + "koreacentral": 1.562, + "northeurope": 1.491, + "southcentralus": 1.556, + "southeastasia": 1.562, + "uksouth": 1.536, + "westeurope": 1.562, + "westus": 1.485, + "westus2": 1.395 + }, + "lowprioritye32dsv4": { + "australiaeast": 1.702, + "australiasoutheast": 1.695, + "brazilsouth": 2.053, + "canadacentral": 1.6, + "canadaeast": 1.695, + "centralindia": 1.555, + "centralus": 1.63, + "eastasia": 2.017, + "eastus": 1.51, + "eastus2": 1.51, + "francecentral": 1.67, + "francesouth": 1.99, + "germanywestcentral": 1.696, + "japaneast": 1.702, + "japanwest": 1.812, + "koreacentral": 1.696, + "northcentralus": 1.51, + "northeurope": 1.613, + "southafricanorth": 1.824, + "southcentralus": 1.787, + "southeastasia": 1.702, + "switzerlandnorth": 1.971, + "uksouth": 1.67, + "ukwest": 1.704, + "usgovarizona": 1.696, + "usgovtexas": 1.741, + "usgovvirginia": 1.696, + "westcentralus": 1.695, + "westeurope": 1.696, + "westus": 1.626, + "westus2": 1.51 + }, + "lowprioritye32sv3": { + "australiacentral": 1.61, + "australiacentral2": 1.61, + "australiaeast": 1.61, + "australiasoutheast": 1.61, + "brazilsouth": 2.381, + "brazilsoutheast": 2.544, + "canadacentral": 1.523, + "canadaeast": 1.523, + "centralindia": 1.466, + "centralus": 1.584, + "eastasia": 1.658, + "eastus": 1.395, + "eastus2": 1.44, + "francecentral": 1.587, + "francesouth": 2.0631, + "germanycentral": 1.742, + "germanynorth": 1.853, + "germanynortheast": 1.742, + "germanywestcentral": 1.562, + "japaneast": 1.613, + "japanwest": 1.613, + "koreacentral": 1.613, + "koreasouth": 1.452, + "northcentralus": 1.395, + "northeurope": 1.491, + "norwayeast": 1.715, + "norwaywest": 2.053, + "southafricanorth": 1.669, + "southafricawest": 1.944, + "southcentralus": 1.522, + "southeastasia": 1.613, + "southindia": 1.656, + "switzerlandnorth": 1.818, + "switzerlandwest": 2.186, + "uaecentral": 1.847, + "uaenorth": 1.556, + "uksouth": 1.587, + "ukwest": 1.587, + "usgovarizona": 1.61, + "usgovtexas": 1.61, + "usgovvirginia": 1.61, + "westcentralus": 1.522, + "westeurope": 1.613, + "westindia": 1.562, + "westus": 1.485, + "westus2": 1.395 + }, + "lowprioritye32sv4": { + "australiaeast": 1.555, + "australiasoutheast": 1.637, + "brazilsouth": 1.875, + "brazilsoutheast": 2.261, + "canadacentral": 1.472, + "canadaeast": 1.472, + "centralindia": 1.421, + "centralus": 1.5, + "eastasia": 1.839, + "eastus": 1.395, + "eastus2": 1.395, + "francecentral": 1.536, + "francesouth": 1.815, + "germanywestcentral": 1.562, + "japaneast": 1.562, + "japanwest": 1.659, + "koreacentral": 1.562, + "northcentralus": 1.395, + "northeurope": 1.491, + "southafricanorth": 1.669, + "southcentralus": 1.556, + "southeastasia": 1.562, + "switzerlandnorth": 1.798, + "uksouth": 1.536, + "ukwest": 1.565, + "usgovarizona": 1.555, + "usgovtexas": 1.597, + "usgovvirginia": 1.555, + "westcentralus": 1.556, + "westeurope": 1.562, + "westus": 1.485, + "westus2": 1.395 + }, + "lowprioritye32v3": { + "australiacentral": 1.61, + "australiacentral2": 1.61, + "australiaeast": 1.61, + "australiasoutheast": 1.61, + "brazilsouth": 2.381, + "brazilsoutheast": 2.544, + "canadacentral": 1.523, + "canadaeast": 1.523, + "centralindia": 1.466, + "centralus": 1.584, + "eastasia": 1.658, + "eastus": 1.395, + "eastus2": 1.44, + "francecentral": 1.587, + "francesouth": 2.0631, + "germanycentral": 1.742, + "germanynorth": 1.853, + "germanynortheast": 1.742, + "germanywestcentral": 1.562, + "japaneast": 1.613, + "japanwest": 1.613, + "koreacentral": 1.613, + "koreasouth": 1.452, + "northcentralus": 1.395, + "northeurope": 1.491, + "norwayeast": 1.715, + "norwaywest": 2.053, + "southafricanorth": 1.669, + "southafricawest": 1.944, + "southcentralus": 1.522, + "southeastasia": 1.613, + "southindia": 1.656, + "switzerlandnorth": 1.818, + "switzerlandwest": 2.186, + "uaecentral": 1.847, + "uaenorth": 1.556, + "uksouth": 1.587, + "ukwest": 1.587, + "usgovarizona": 1.61, + "usgovtexas": 1.61, + "usgovvirginia": 1.61, + "westcentralus": 1.522, + "westeurope": 1.613, + "westindia": 1.562, + "westus": 1.485, + "westus2": 1.395 + }, + "lowprioritye32v4": { + "australiaeast": 1.555, + "australiasoutheast": 1.637, + "brazilsouth": 1.875, + "brazilsoutheast": 2.261, + "canadacentral": 1.472, + "canadaeast": 1.472, + "centralindia": 1.421, + "centralus": 1.5, + "eastasia": 1.839, + "eastus": 1.395, + "eastus2": 1.395, + "francecentral": 1.536, + "francesouth": 1.815, + "germanywestcentral": 1.562, + "japaneast": 1.562, + "japanwest": 1.659, + "koreacentral": 1.562, + "northcentralus": 1.395, + "northeurope": 1.491, + "southafricanorth": 1.669, + "southcentralus": 1.556, + "southeastasia": 1.562, + "switzerlandnorth": 1.798, + "uksouth": 1.536, + "ukwest": 1.565, + "usgovarizona": 1.555, + "usgovtexas": 1.597, + "usgovvirginia": 1.555, + "westcentralus": 1.556, + "westeurope": 1.562, + "westus": 1.485, + "westus2": 1.395 + }, + "lowprioritye48asv4": { + "australiaeast": 2.333, + "brazilsouth": 2.813, + "centralindia": 2.131, + "centralus": 2.25, + "eastasia": 2.486, + "eastus": 2.093, + "eastus2": 2.093, + "francecentral": 2.304, + "japaneast": 2.342, + "koreacentral": 2.342, + "northeurope": 2.237, + "southcentralus": 2.335, + "southeastasia": 2.342, + "uksouth": 2.304, + "westeurope": 2.342, + "westus": 2.227, + "westus2": 2.093 + }, + "lowprioritye48av4": { + "australiaeast": 2.333, + "brazilsouth": 2.813, + "centralindia": 2.131, + "centralus": 2.25, + "eastasia": 2.486, + "eastus": 2.093, + "eastus2": 2.093, + "francecentral": 2.304, + "japaneast": 2.342, + "koreacentral": 2.342, + "northeurope": 2.237, + "southcentralus": 2.335, + "southeastasia": 2.342, + "uksouth": 2.304, + "westeurope": 2.342, + "westus": 2.227, + "westus2": 2.093 + }, + "lowprioritye48dsv4": { + "australiaeast": 2.554, + "australiasoutheast": 2.542, + "brazilsouth": 3.079, + "canadacentral": 2.4, + "canadaeast": 2.542, + "centralindia": 2.333, + "centralus": 2.445, + "eastasia": 3.026, + "eastus": 2.266, + "eastus2": 2.266, + "francecentral": 2.506, + "francesouth": 2.984, + "germanywestcentral": 2.544, + "japaneast": 2.554, + "japanwest": 2.718, + "koreacentral": 2.544, + "northcentralus": 2.266, + "northeurope": 2.419, + "southafricanorth": 2.736, + "southcentralus": 2.68, + "southeastasia": 2.554, + "switzerlandnorth": 2.957, + "uksouth": 2.506, + "ukwest": 2.556, + "usgovarizona": 2.544, + "usgovtexas": 2.611, + "usgovvirginia": 2.544, + "westcentralus": 2.542, + "westeurope": 2.544, + "westus": 2.438, + "westus2": 2.266 + }, + "lowprioritye48sv3": { + "australiacentral": 2.332, + "australiacentral2": 2.332, + "australiaeast": 2.332, + "australiasoutheast": 2.332, + "brazilsouth": 3.138, + "brazilsoutheast": 3.816, + "canadacentral": 2.208, + "canadaeast": 2.208, + "centralindia": 2.196, + "centralus": 2.284, + "eastasia": 2.486, + "eastus": 2.093, + "eastus2": 2.093, + "francecentral": 2.379, + "francesouth": 2.828, + "germanycentral": 2.542, + "germanynorth": 2.78, + "germanynortheast": 2.542, + "germanywestcentral": 2.342, + "japaneast": 2.342, + "japanwest": 2.419, + "koreacentral": 2.342, + "koreasouth": 2.177, + "northcentralus": 2.093, + "northeurope": 2.237, + "norwayeast": 2.488, + "norwaywest": 2.969, + "southafricanorth": 2.504, + "southafricawest": 2.915, + "southcentralus": 2.283, + "southeastasia": 2.419, + "southindia": 2.484, + "switzerlandnorth": 2.726, + "switzerlandwest": 3.28, + "uaecentral": 2.77, + "uaenorth": 2.335, + "uksouth": 2.304, + "ukwest": 2.304, + "usgovarizona": 2.333, + "usgovtexas": 2.333, + "usgovvirginia": 2.333, + "westeurope": 2.342, + "westindia": 2.339, + "westus": 2.227, + "westus2": 2.093 + }, + "lowprioritye48sv4": { + "australiaeast": 2.333, + "australiasoutheast": 2.456, + "brazilsouth": 2.813, + "brazilsoutheast": 3.392, + "canadacentral": 2.208, + "canadaeast": 2.208, + "centralindia": 2.131, + "centralus": 2.25, + "eastasia": 2.758, + "eastus": 2.093, + "eastus2": 2.093, + "francecentral": 2.304, + "francesouth": 2.722, + "germanywestcentral": 2.342, + "japaneast": 2.342, + "japanwest": 2.488, + "koreacentral": 2.342, + "northcentralus": 2.093, + "northeurope": 2.237, + "southafricanorth": 2.504, + "southcentralus": 2.335, + "southeastasia": 2.342, + "switzerlandnorth": 2.698, + "uksouth": 2.304, + "ukwest": 2.347, + "usgovarizona": 2.333, + "usgovtexas": 2.395, + "usgovvirginia": 2.333, + "westcentralus": 2.335, + "westeurope": 2.342, + "westus": 2.227, + "westus2": 2.093 + }, + "lowprioritye48v3": { + "australiacentral": 2.332, + "australiacentral2": 2.332, + "australiaeast": 2.332, + "australiasoutheast": 2.332, + "brazilsouth": 3.138, + "brazilsoutheast": 3.816, + "canadacentral": 2.208, + "canadaeast": 2.208, + "centralindia": 2.196, + "centralus": 2.284, + "eastasia": 2.486, + "eastus": 2.093, + "eastus2": 2.093, + "francecentral": 2.379, + "francesouth": 2.828, + "germanycentral": 2.542, + "germanynorth": 2.78, + "germanynortheast": 2.542, + "germanywestcentral": 2.342, + "japaneast": 2.342, + "japanwest": 2.419, + "koreacentral": 2.342, + "koreasouth": 2.177, + "northcentralus": 2.093, + "northeurope": 2.237, + "norwayeast": 2.488, + "norwaywest": 2.969, + "southafricanorth": 2.504, + "southafricawest": 2.915, + "southcentralus": 2.283, + "southeastasia": 2.419, + "southindia": 2.484, + "switzerlandnorth": 2.726, + "switzerlandwest": 3.28, + "uaecentral": 2.77, + "uaenorth": 2.335, + "uksouth": 2.304, + "ukwest": 2.304, + "usgovarizona": 2.333, + "usgovtexas": 2.333, + "usgovvirginia": 2.333, + "westcentralus": 2.333, + "westeurope": 2.342, + "westindia": 2.339, + "westus": 2.227, + "westus2": 2.093 + }, + "lowprioritye48v4": { + "australiaeast": 2.333, + "australiasoutheast": 2.456, + "brazilsouth": 2.813, + "brazilsoutheast": 3.392, + "canadacentral": 2.208, + "canadaeast": 2.208, + "centralindia": 2.131, + "centralus": 2.25, + "eastasia": 2.758, + "eastus": 2.093, + "eastus2": 2.093, + "francecentral": 2.304, + "francesouth": 2.722, + "germanywestcentral": 2.342, + "japaneast": 2.342, + "japanwest": 2.488, + "koreacentral": 2.342, + "northcentralus": 2.093, + "northeurope": 2.237, + "southafricanorth": 2.504, + "southcentralus": 2.335, + "southeastasia": 2.342, + "switzerlandnorth": 2.698, + "uksouth": 2.304, + "ukwest": 2.347, + "usgovarizona": 2.333, + "usgovtexas": 2.395, + "usgovvirginia": 2.333, + "westcentralus": 2.335, + "westeurope": 2.342, + "westus": 2.227, + "westus2": 2.093 + }, + "lowprioritye64asv4": { + "australiaeast": 3.11, + "brazilsouth": 3.75, + "centralindia": 2.842, + "centralus": 3.0, + "eastasia": 3.315, + "eastus": 2.79, + "eastus2": 2.79, + "francecentral": 3.072, + "japaneast": 3.123, + "koreacentral": 3.123, + "northeurope": 2.982, + "southcentralus": 3.113, + "southeastasia": 3.123, + "uksouth": 3.072, + "westeurope": 3.123, + "westus": 2.97, + "westus2": 2.79 + }, + "lowprioritye64av4": { + "australiaeast": 3.11, + "brazilsouth": 3.75, + "centralindia": 2.842, + "centralus": 3.0, + "eastasia": 3.315, + "eastus": 2.79, + "eastus2": 2.79, + "francecentral": 3.072, + "japaneast": 3.123, + "koreacentral": 3.123, + "northeurope": 2.982, + "southcentralus": 3.113, + "southeastasia": 3.123, + "uksouth": 3.072, + "westeurope": 3.123, + "westus": 2.97, + "westus2": 2.79 + }, + "lowprioritye64dsv4": { + "australiaeast": 3.405, + "australiasoutheast": 3.389, + "brazilsouth": 4.105, + "canadacentral": 3.2, + "canadaeast": 3.389, + "centralindia": 3.11, + "centralus": 3.26, + "eastasia": 4.035, + "eastus": 3.021, + "eastus2": 3.021, + "francecentral": 3.341, + "francesouth": 3.979, + "germanywestcentral": 3.392, + "japaneast": 3.405, + "japanwest": 3.624, + "koreacentral": 3.392, + "northcentralus": 3.021, + "northeurope": 3.226, + "southafricanorth": 3.647, + "southcentralus": 3.574, + "southeastasia": 3.405, + "switzerlandnorth": 3.942, + "uksouth": 3.341, + "ukwest": 3.408, + "usgovarizona": 3.392, + "usgovtexas": 3.482, + "usgovvirginia": 3.392, + "westcentralus": 3.389, + "westeurope": 3.392, + "westus": 3.251, + "westus2": 3.021 + }, + "lowprioritye64isv3": { + "australiaeast": 2.917, + "australiasoutheast": 2.917, + "brazilsouth": 3.883, + "brazilsoutheast": 4.697, + "canadacentral": 2.767, + "canadaeast": 2.767, + "centralus": 2.857, + "eastasia": 3.101, + "eastus": 2.629, + "eastus2": 2.629, + "francecentral": 2.973, + "francesouth": 3.512, + "germanycentral": 3.283, + "germanynorth": 3.454, + "germanynortheast": 3.283, + "germanywestcentral": 2.811, + "japaneast": 2.928, + "japanwest": 3.021, + "koreacentral": 2.928, + "koreasouth": 2.689, + "northcentralus": 2.629, + "northeurope": 2.802, + "norwayeast": 3.103, + "norwaywest": 3.681, + "southafricanorth": 3.123, + "southafricawest": 3.616, + "southcentralus": 2.857, + "southeastasia": 3.021, + "southindia": 3.098, + "switzerlandnorth": 3.389, + "switzerlandwest": 4.053, + "uaecentral": 3.806, + "uaenorth": 2.928, + "uksouth": 2.883, + "ukwest": 2.883, + "usgovarizona": 2.992, + "usgovvirginia": 2.992, + "westcentralus": 2.857, + "westeurope": 2.928, + "westindia": 2.925, + "westus": 2.79, + "westus2": 2.629 + }, + "lowprioritye64iv3": { + "australiaeast": 2.917, + "australiasoutheast": 2.917, + "brazilsouth": 3.883, + "brazilsoutheast": 4.697, + "canadacentral": 2.767, + "canadaeast": 2.767, + "centralus": 2.857, + "eastasia": 3.101, + "eastus": 2.629, + "eastus2": 2.629, + "francecentral": 2.973, + "francesouth": 3.512, + "germanycentral": 3.283, + "germanynorth": 3.454, + "germanynortheast": 3.283, + "germanywestcentral": 2.811, + "japaneast": 2.928, + "japanwest": 3.021, + "koreacentral": 2.928, + "koreasouth": 2.689, + "northcentralus": 2.629, + "northeurope": 2.802, + "norwayeast": 3.103, + "norwaywest": 3.681, + "southafricanorth": 3.123, + "southafricawest": 3.616, + "southcentralus": 2.857, + "southeastasia": 3.021, + "southindia": 3.098, + "switzerlandnorth": 3.389, + "switzerlandwest": 4.053, + "uaecentral": 3.806, + "uaenorth": 2.928, + "uksouth": 2.883, + "ukwest": 2.883, + "usgovarizona": 2.992, + "usgovvirginia": 2.992, + "westcentralus": 2.857, + "westeurope": 2.928, + "westindia": 2.925, + "westus": 2.79, + "westus2": 2.629 + }, + "lowprioritye64sv3": { + "australiacentral": 2.917, + "australiacentral2": 2.917, + "australiaeast": 2.917, + "australiasoutheast": 2.917, + "brazilsouth": 3.883, + "brazilsoutheast": 4.697, + "canadacentral": 2.767, + "canadaeast": 2.767, + "centralindia": 2.752, + "centralus": 2.858, + "eastasia": 3.101, + "eastus": 2.629, + "eastus2": 2.629, + "francecentral": 2.973, + "francesouth": 3.512, + "germanycentral": 3.283, + "germanynorth": 3.454, + "germanynortheast": 3.283, + "germanywestcentral": 2.811, + "japaneast": 2.928, + "japanwest": 3.021, + "koreacentral": 2.928, + "koreasouth": 2.73, + "northcentralus": 2.629, + "northeurope": 2.802, + "norwayeast": 3.103, + "norwaywest": 3.681, + "southafricanorth": 3.123, + "southafricawest": 3.616, + "southcentralus": 2.857, + "southeastasia": 3.021, + "southindia": 3.098, + "switzerlandnorth": 3.389, + "switzerlandwest": 4.053, + "uaecentral": 3.442, + "uaenorth": 2.919, + "uksouth": 2.883, + "ukwest": 2.883, + "usgovarizona": 2.917, + "usgovtexas": 2.917, + "usgovvirginia": 3.025, + "westcentralus": 2.857, + "westeurope": 2.928, + "westindia": 2.925, + "westus": 2.79, + "westus2": 2.629 + }, + "lowprioritye64sv4": { + "australiaeast": 3.11, + "australiasoutheast": 3.274, + "brazilsouth": 3.75, + "brazilsoutheast": 4.522, + "canadacentral": 2.944, + "canadaeast": 2.944, + "centralindia": 2.842, + "centralus": 3.0, + "eastasia": 3.677, + "eastus": 2.79, + "eastus2": 2.79, + "francecentral": 3.072, + "francesouth": 3.629, + "germanywestcentral": 3.123, + "japaneast": 3.123, + "japanwest": 3.318, + "koreacentral": 3.123, + "northcentralus": 2.79, + "northeurope": 2.982, + "southafricanorth": 3.339, + "southcentralus": 3.113, + "southeastasia": 3.123, + "switzerlandnorth": 3.597, + "uksouth": 3.072, + "ukwest": 3.129, + "usgovarizona": 3.11, + "usgovtexas": 3.194, + "usgovvirginia": 3.11, + "westcentralus": 3.113, + "westeurope": 3.123, + "westus": 2.969, + "westus2": 2.79 + }, + "lowprioritye64v3": { + "australiacentral": 2.917, + "australiacentral2": 2.917, + "australiaeast": 2.917, + "australiasoutheast": 2.917, + "brazilsouth": 3.883, + "brazilsoutheast": 4.697, + "canadacentral": 2.767, + "canadaeast": 2.767, + "centralindia": 2.752, + "centralus": 2.858, + "eastasia": 3.101, + "eastus": 2.629, + "eastus2": 2.629, + "francecentral": 2.973, + "francesouth": 3.512, + "germanycentral": 3.283, + "germanynorth": 3.454, + "germanynortheast": 3.283, + "germanywestcentral": 2.811, + "japaneast": 2.928, + "japanwest": 3.021, + "koreacentral": 2.928, + "koreasouth": 2.73, + "northcentralus": 2.629, + "northeurope": 2.802, + "norwayeast": 3.103, + "norwaywest": 3.681, + "southafricanorth": 3.123, + "southafricawest": 3.616, + "southcentralus": 2.857, + "southeastasia": 3.021, + "southindia": 3.098, + "switzerlandnorth": 3.389, + "switzerlandwest": 4.053, + "uaecentral": 3.442, + "uaenorth": 2.919, + "uksouth": 2.883, + "ukwest": 2.883, + "usgovarizona": 2.917, + "usgovtexas": 2.917, + "usgovvirginia": 3.025, + "westcentralus": 2.857, + "westeurope": 2.928, + "westindia": 2.925, + "westus": 2.79, + "westus2": 2.629 + }, + "lowprioritye64v4": { + "australiaeast": 3.11, + "australiasoutheast": 3.274, + "brazilsouth": 3.75, + "brazilsoutheast": 4.522, + "canadacentral": 2.944, + "canadaeast": 2.944, + "centralindia": 2.842, + "centralus": 3.0, + "eastasia": 3.677, + "eastus": 2.79, + "eastus2": 2.79, + "francecentral": 3.072, + "francesouth": 3.629, + "germanywestcentral": 3.123, + "japaneast": 3.123, + "japanwest": 3.318, + "koreacentral": 3.123, + "northcentralus": 2.79, + "northeurope": 2.982, + "southafricanorth": 3.339, + "southcentralus": 3.113, + "southeastasia": 3.123, + "switzerlandnorth": 3.597, + "uksouth": 3.072, + "ukwest": 3.129, + "usgovarizona": 3.11, + "usgovtexas": 3.194, + "usgovvirginia": 3.11, + "westcentralus": 3.113, + "westeurope": 3.123, + "westus": 2.969, + "westus2": 2.79 + }, + "lowprioritye96asv4": { + "australiaeast": 4.666, + "brazilsouth": 5.626, + "centralindia": 4.262, + "centralus": 4.5, + "eastasia": 4.973, + "eastus": 4.186, + "eastus2": 4.186, + "francecentral": 4.608, + "japaneast": 4.685, + "koreacentral": 4.685, + "northeurope": 4.474, + "southcentralus": 4.669, + "southeastasia": 4.685, + "uksouth": 4.608, + "westeurope": 4.685, + "westus": 4.454, + "westus2": 4.186 + }, + "lowprioritye96av4": { + "australiaeast": 4.666, + "brazilsouth": 5.626, + "centralindia": 4.262, + "centralus": 4.5, + "eastasia": 4.973, + "eastus": 4.186, + "eastus2": 4.186, + "francecentral": 4.608, + "japaneast": 4.685, + "koreacentral": 4.685, + "northeurope": 4.474, + "southcentralus": 4.669, + "southeastasia": 4.685, + "uksouth": 4.608, + "westeurope": 4.685, + "westus": 4.454, + "westus2": 4.186 + }, + "lowpriorityf1": { + "australiacentral": 0.044, + "australiacentral2": 0.044, + "australiaeast": 0.044, + "australiasoutheast": 0.044, + "brazilsouth": 0.0444, + "brazilsoutheast": 0.0557, + "canadacentral": 0.038, + "canadaeast": 0.04, + "centralindia": 0.038, + "centralus": 0.042, + "eastasia": 0.0518, + "eastus": 0.038, + "eastus2": 0.038, + "francecentral": 0.0386, + "francesouth": 0.0502, + "germanycentral": 0.044, + "germanynorth": 0.048, + "germanynortheast": 0.044, + "germanywestcentral": 0.0412, + "japaneast": 0.0436, + "japanwest": 0.0436, + "koreacentral": 0.037, + "koreasouth": 0.037, + "northcentralus": 0.038, + "northeurope": 0.0408, + "norwayeast": 0.0434, + "norwaywest": 0.0509, + "southafricanorth": 0.0452, + "southafricawest": 0.052, + "southcentralus": 0.041, + "southeastasia": 0.0415, + "southindia": 0.044, + "switzerlandnorth": 0.0457, + "switzerlandwest": 0.0538, + "uaecentral": 0.0494, + "uaenorth": 0.0423, + "uksouth": 0.042, + "ukwest": 0.042, + "usgovarizona": 0.042, + "usgovtexas": 0.042, + "usgovvirginia": 0.042, + "westcentralus": 0.041, + "westeurope": 0.041, + "westindia": 0.04, + "westus": 0.043, + "westus2": 0.038 + }, + "lowpriorityf1s": { + "australiacentral": 0.044, + "australiacentral2": 0.044, + "australiaeast": 0.044, + "australiasoutheast": 0.044, + "brazilsouth": 0.0444, + "brazilsoutheast": 0.0557, + "canadacentral": 0.038, + "canadaeast": 0.04, + "centralindia": 0.038, + "centralus": 0.042, + "eastasia": 0.0518, + "eastus": 0.038, + "eastus2": 0.038, + "francecentral": 0.0386, + "francesouth": 0.0502, + "germanycentral": 0.044, + "germanynorth": 0.048, + "germanynortheast": 0.044, + "germanywestcentral": 0.0412, + "japaneast": 0.0436, + "japanwest": 0.0436, + "koreacentral": 0.037, + "koreasouth": 0.037, + "northcentralus": 0.038, + "northeurope": 0.0408, + "norwayeast": 0.0434, + "norwaywest": 0.0509, + "southafricanorth": 0.0452, + "southafricawest": 0.052, + "southcentralus": 0.041, + "southeastasia": 0.0415, + "southindia": 0.044, + "switzerlandnorth": 0.0457, + "switzerlandwest": 0.0538, + "uaecentral": 0.0494, + "uaenorth": 0.0423, + "uksouth": 0.042, + "ukwest": 0.042, + "usgovarizona": 0.042, + "usgovtexas": 0.042, + "usgovvirginia": 0.042, + "westcentralus": 0.041, + "westeurope": 0.041, + "westindia": 0.04, + "westus": 0.043, + "westus2": 0.038 + }, + "lowpriorityf2": { + "australiacentral": 0.0888, + "australiacentral2": 0.0888, + "australiaeast": 0.0888, + "australiasoutheast": 0.0888, + "brazilsouth": 0.0887, + "brazilsoutheast": 0.111, + "canadacentral": 0.0765, + "canadaeast": 0.0804, + "centralindia": 0.0766, + "centralus": 0.084, + "eastasia": 0.104, + "eastus": 0.0766, + "eastus2": 0.0766, + "francecentral": 0.0772, + "francesouth": 0.1, + "germanycentral": 0.0888, + "germanynorth": 0.0961, + "germanynortheast": 0.0888, + "germanywestcentral": 0.0824, + "japaneast": 0.087, + "japanwest": 0.087, + "koreacentral": 0.074, + "koreasouth": 0.074, + "northcentralus": 0.0766, + "northeurope": 0.0816, + "norwayeast": 0.087, + "norwaywest": 0.102, + "southafricanorth": 0.09, + "southafricawest": 0.104, + "southcentralus": 0.082, + "southeastasia": 0.083, + "southindia": 0.0887, + "switzerlandnorth": 0.0915, + "switzerlandwest": 0.108, + "uaecentral": 0.0989, + "uaenorth": 0.0846, + "uksouth": 0.084, + "ukwest": 0.084, + "usgovarizona": 0.0847, + "usgovtexas": 0.0847, + "usgovvirginia": 0.0847, + "westcentralus": 0.082, + "westeurope": 0.082, + "westindia": 0.0807, + "westus": 0.086, + "westus2": 0.0766 + }, + "lowpriorityf2s": { + "australiacentral": 0.0888, + "australiacentral2": 0.0888, + "australiaeast": 0.0888, + "australiasoutheast": 0.0888, + "brazilsouth": 0.0887, + "brazilsoutheast": 0.111, + "canadacentral": 0.0765, + "canadaeast": 0.0804, + "centralindia": 0.0766, + "centralus": 0.084, + "eastasia": 0.104, + "eastus": 0.0766, + "eastus2": 0.0766, + "francecentral": 0.0772, + "francesouth": 0.1, + "germanycentral": 0.0888, + "germanynorth": 0.0961, + "germanynortheast": 0.0888, + "germanywestcentral": 0.0824, + "japaneast": 0.087, + "japanwest": 0.087, + "koreacentral": 0.074, + "koreasouth": 0.074, + "northcentralus": 0.0766, + "northeurope": 0.0816, + "norwayeast": 0.087, + "norwaywest": 0.102, + "southafricanorth": 0.09, + "southafricawest": 0.104, + "southcentralus": 0.082, + "southeastasia": 0.083, + "southindia": 0.0887, + "switzerlandnorth": 0.0915, + "switzerlandwest": 0.108, + "uaecentral": 0.0989, + "uaenorth": 0.0846, + "uksouth": 0.084, + "ukwest": 0.084, + "usgovarizona": 0.0847, + "usgovtexas": 0.0847, + "usgovvirginia": 0.0847, + "westcentralus": 0.082, + "westeurope": 0.082, + "westindia": 0.0807, + "westus": 0.086, + "westus2": 0.0766 + }, + "lowpriorityf2sv2": { + "australiacentral": 0.0708, + "australiacentral2": 0.0708, + "australiaeast": 0.0708, + "australiasoutheast": 0.0708, + "brazilsouth": 0.0708, + "canadacentral": 0.0708, + "canadaeast": 0.0708, + "centralindia": 0.0708, + "centralus": 0.0708, + "eastasia": 0.0704, + "eastus": 0.065, + "eastus2": 0.065, + "francecentral": 0.0708, + "francesouth": 0.0708, + "germanycentral": 0.0708, + "germanynorth": 0.0872, + "germanywestcentral": 0.0756, + "japaneast": 0.0708, + "japanwest": 0.0708, + "koreacentral": 0.0708, + "koreasouth": 0.0708, + "northcentralus": 0.0708, + "northeurope": 0.0752, + "southcentralus": 0.0708, + "southeastasia": 0.07, + "southindia": 0.0708, + "uaecentral": 0.0898, + "uaenorth": 0.0776, + "uksouth": 0.0708, + "ukwest": 0.0773, + "usgovarizona": 0.0793, + "usgovtexas": 0.0776, + "usgovvirginia": 0.0776, + "westcentralus": 0.0708, + "westeurope": 0.074, + "westindia": 0.0708, + "westus": 0.0708, + "westus2": 0.065 + }, + "lowpriorityf4": { + "australiacentral": 0.178, + "australiacentral2": 0.178, + "australiaeast": 0.178, + "australiasoutheast": 0.178, + "brazilsouth": 0.177, + "brazilsoutheast": 0.223, + "canadacentral": 0.153, + "canadaeast": 0.161, + "centralindia": 0.153, + "centralus": 0.168, + "eastasia": 0.207, + "eastus": 0.153, + "eastus2": 0.153, + "francecentral": 0.154, + "francesouth": 0.201, + "germanycentral": 0.1776, + "germanynorth": 0.192, + "germanynortheast": 0.1776, + "germanywestcentral": 0.164, + "japaneast": 0.174, + "japanwest": 0.174, + "koreacentral": 0.148, + "koreasouth": 0.148, + "northcentralus": 0.153, + "northeurope": 0.163, + "norwayeast": 0.173, + "norwaywest": 0.203, + "southafricanorth": 0.18, + "southafricawest": 0.207, + "southcentralus": 0.164, + "southeastasia": 0.166, + "southindia": 0.177, + "switzerlandnorth": 0.183, + "switzerlandwest": 0.216, + "uaecentral": 0.198, + "uaenorth": 0.169, + "uksouth": 0.168, + "ukwest": 0.168, + "usgovarizona": 0.169, + "usgovtexas": 0.169, + "usgovvirginia": 0.169, + "westcentralus": 0.164, + "westeurope": 0.164, + "westindia": 0.161, + "westus": 0.173, + "westus2": 0.153 + }, + "lowpriorityf4s": { + "australiacentral": 0.178, + "australiacentral2": 0.178, + "australiaeast": 0.178, + "australiasoutheast": 0.178, + "brazilsouth": 0.177, + "brazilsoutheast": 0.223, + "canadacentral": 0.153, + "canadaeast": 0.161, + "centralindia": 0.153, + "centralus": 0.168, + "eastasia": 0.207, + "eastus": 0.153, + "eastus2": 0.153, + "francecentral": 0.154, + "francesouth": 0.201, + "germanycentral": 0.1776, + "germanynorth": 0.192, + "germanynortheast": 0.1776, + "germanywestcentral": 0.164, + "japaneast": 0.174, + "japanwest": 0.174, + "koreacentral": 0.148, + "koreasouth": 0.148, + "northcentralus": 0.153, + "northeurope": 0.163, + "norwayeast": 0.173, + "norwaywest": 0.203, + "southafricanorth": 0.18, + "southafricawest": 0.207, + "southcentralus": 0.164, + "southeastasia": 0.166, + "southindia": 0.177, + "switzerlandnorth": 0.183, + "switzerlandwest": 0.216, + "uaecentral": 0.198, + "uaenorth": 0.169, + "uksouth": 0.168, + "ukwest": 0.168, + "usgovarizona": 0.169, + "usgovtexas": 0.169, + "usgovvirginia": 0.169, + "westcentralus": 0.164, + "westeurope": 0.164, + "westindia": 0.161, + "westus": 0.173, + "westus2": 0.153 + }, + "lowpriorityf4sv2": { + "australiacentral": 0.142, + "australiacentral2": 0.142, + "australiaeast": 0.1416, + "australiasoutheast": 0.1416, + "brazilsouth": 0.1416, + "canadacentral": 0.1416, + "canadaeast": 0.1416, + "centralindia": 0.1416, + "centralus": 0.1416, + "eastasia": 0.1412, + "eastus": 0.13, + "eastus2": 0.13, + "francecentral": 0.1416, + "francesouth": 0.1416, + "germanycentral": 0.1416, + "germanynorth": 0.174, + "germanywestcentral": 0.151, + "japaneast": 0.1416, + "japanwest": 0.1416, + "koreacentral": 0.1416, + "koreasouth": 0.1416, + "northcentralus": 0.1416, + "northeurope": 0.15, + "southcentralus": 0.1416, + "southeastasia": 0.141, + "southindia": 0.1416, + "uaecentral": 0.18, + "uaenorth": 0.155, + "uksouth": 0.1416, + "ukwest": 0.155, + "usgovarizona": 0.159, + "usgovtexas": 0.1552, + "usgovvirginia": 0.1552, + "westcentralus": 0.1416, + "westeurope": 0.148, + "westindia": 0.142, + "westus": 0.1416, + "westus2": 0.13 + }, + "lowpriorityf8": { + "australiacentral": 0.355, + "australiacentral2": 0.355, + "australiaeast": 0.355, + "australiasoutheast": 0.355, + "brazilsouth": 0.355, + "brazilsoutheast": 0.446, + "canadacentral": 0.306, + "canadaeast": 0.322, + "centralindia": 0.306, + "centralus": 0.337, + "eastasia": 0.414, + "eastus": 0.306, + "eastus2": 0.306, + "francecentral": 0.309, + "francesouth": 0.401, + "germanycentral": 0.355, + "germanynorth": 0.384, + "germanynortheast": 0.355, + "germanywestcentral": 0.329, + "japaneast": 0.349, + "japanwest": 0.349, + "koreacentral": 0.296, + "koreasouth": 0.296, + "northcentralus": 0.306, + "northeurope": 0.326, + "norwayeast": 0.347, + "norwaywest": 0.407, + "southafricanorth": 0.36, + "southafricawest": 0.415, + "southcentralus": 0.329, + "southeastasia": 0.332, + "southindia": 0.355, + "switzerlandnorth": 0.366, + "switzerlandwest": 0.432, + "uaecentral": 0.396, + "uaenorth": 0.338, + "uksouth": 0.337, + "ukwest": 0.337, + "usgovarizona": 0.339, + "usgovtexas": 0.339, + "usgovvirginia": 0.339, + "westcentralus": 0.329, + "westeurope": 0.329, + "westindia": 0.323, + "westus": 0.346, + "westus2": 0.306 + }, + "lowpriorityf8s": { + "australiacentral": 0.355, + "australiacentral2": 0.355, + "australiaeast": 0.355, + "australiasoutheast": 0.355, + "brazilsouth": 0.355, + "brazilsoutheast": 0.446, + "canadacentral": 0.306, + "canadaeast": 0.322, + "centralindia": 0.306, + "centralus": 0.337, + "eastasia": 0.414, + "eastus": 0.306, + "eastus2": 0.306, + "francecentral": 0.309, + "francesouth": 0.401, + "germanycentral": 0.355, + "germanynorth": 0.384, + "germanynortheast": 0.355, + "germanywestcentral": 0.329, + "japaneast": 0.349, + "japanwest": 0.349, + "koreacentral": 0.296, + "koreasouth": 0.296, + "northcentralus": 0.306, + "northeurope": 0.326, + "norwayeast": 0.347, + "norwaywest": 0.407, + "southafricanorth": 0.36, + "southafricawest": 0.415, + "southcentralus": 0.329, + "southeastasia": 0.332, + "southindia": 0.355, + "switzerlandnorth": 0.366, + "switzerlandwest": 0.432, + "uaecentral": 0.396, + "uaenorth": 0.338, + "uksouth": 0.337, + "ukwest": 0.337, + "usgovarizona": 0.339, + "usgovtexas": 0.339, + "usgovvirginia": 0.339, + "westcentralus": 0.329, + "westeurope": 0.329, + "westindia": 0.323, + "westus": 0.346, + "westus2": 0.306 + }, + "lowpriorityf8sv2": { + "australiacentral": 0.283, + "australiacentral2": 0.283, + "australiaeast": 0.2832, + "australiasoutheast": 0.2832, + "brazilsouth": 0.2832, + "canadacentral": 0.2832, + "canadaeast": 0.2832, + "centralindia": 0.283, + "centralus": 0.2832, + "eastasia": 0.2824, + "eastus": 0.26, + "eastus2": 0.26, + "francecentral": 0.2832, + "francesouth": 0.2832, + "germanycentral": 0.2832, + "germanynorth": 0.349, + "germanywestcentral": 0.302, + "japaneast": 0.2832, + "japanwest": 0.2832, + "koreacentral": 0.2832, + "koreasouth": 0.2832, + "northcentralus": 0.283, + "northeurope": 0.3008, + "southcentralus": 0.2832, + "southeastasia": 0.282, + "southindia": 0.2832, + "uaecentral": 0.359, + "uaenorth": 0.31, + "uksouth": 0.2832, + "ukwest": 0.309, + "usgovarizona": 0.345, + "usgovtexas": 0.3104, + "usgovvirginia": 0.3104, + "westcentralus": 0.2832, + "westeurope": 0.296, + "westindia": 0.283, + "westus": 0.2832, + "westus2": 0.26 + }, + "lowpriorityf16": { + "australiacentral": 0.711, + "australiacentral2": 0.711, + "australiaeast": 0.711, + "australiasoutheast": 0.711, + "brazilsouth": 0.71, + "brazilsoutheast": 0.892, + "canadacentral": 0.612, + "canadaeast": 0.643, + "centralindia": 0.613, + "centralus": 0.674, + "eastasia": 0.829, + "eastus": 0.613, + "eastus2": 0.613, + "francecentral": 0.618, + "francesouth": 0.803, + "germanycentral": 0.7108, + "germanynorth": 0.769, + "germanynortheast": 0.7108, + "germanywestcentral": 0.658, + "japaneast": 0.698, + "japanwest": 0.698, + "koreacentral": 0.592, + "koreasouth": 0.592, + "northcentralus": 0.613, + "northeurope": 0.653, + "norwayeast": 0.694, + "norwaywest": 0.814, + "southafricanorth": 0.721, + "southafricawest": 0.829, + "southcentralus": 0.658, + "southeastasia": 0.664, + "southindia": 0.71, + "switzerlandnorth": 0.732, + "switzerlandwest": 0.863, + "uaecentral": 0.791, + "uaenorth": 0.676, + "uksouth": 0.674, + "ukwest": 0.674, + "usgovarizona": 0.678, + "usgovtexas": 0.678, + "usgovvirginia": 0.678, + "westcentralus": 0.658, + "westeurope": 0.658, + "westindia": 0.646, + "westus": 0.693, + "westus2": 0.613 + }, + "lowpriorityf16s": { + "australiacentral": 0.711, + "australiacentral2": 0.711, + "australiaeast": 0.711, + "australiasoutheast": 0.711, + "brazilsouth": 0.71, + "brazilsoutheast": 0.892, + "canadacentral": 0.612, + "canadaeast": 0.643, + "centralindia": 0.613, + "centralus": 0.674, + "eastasia": 0.829, + "eastus": 0.613, + "eastus2": 0.613, + "francecentral": 0.618, + "francesouth": 0.803, + "germanycentral": 0.7108, + "germanynorth": 0.769, + "germanynortheast": 0.7108, + "germanywestcentral": 0.658, + "japaneast": 0.698, + "japanwest": 0.698, + "koreacentral": 0.592, + "koreasouth": 0.592, + "northcentralus": 0.613, + "northeurope": 0.653, + "norwayeast": 0.694, + "norwaywest": 0.814, + "southafricanorth": 0.721, + "southafricawest": 0.829, + "southcentralus": 0.658, + "southeastasia": 0.664, + "southindia": 0.71, + "switzerlandnorth": 0.732, + "switzerlandwest": 0.863, + "uaecentral": 0.791, + "uaenorth": 0.676, + "uksouth": 0.674, + "ukwest": 0.674, + "usgovarizona": 0.678, + "usgovtexas": 0.678, + "usgovvirginia": 0.678, + "westcentralus": 0.658, + "westeurope": 0.658, + "westindia": 0.646, + "westus": 0.693, + "westus2": 0.613 + }, + "lowpriorityf16sv2": { + "australiacentral": 0.566, + "australiacentral2": 0.566, + "australiaeast": 0.5664, + "australiasoutheast": 0.5664, + "brazilsouth": 0.5664, + "canadacentral": 0.5664, + "canadaeast": 0.5664, + "centralindia": 0.566, + "centralus": 0.5664, + "eastasia": 0.5644, + "eastus": 0.521, + "eastus2": 0.521, + "francecentral": 0.5664, + "francesouth": 0.5664, + "germanycentral": 0.5664, + "germanynorth": 0.698, + "germanywestcentral": 0.605, + "japaneast": 0.5664, + "japanwest": 0.5664, + "koreacentral": 0.5664, + "koreasouth": 0.5664, + "northcentralus": 0.566, + "northeurope": 0.6016, + "southcentralus": 0.5664, + "southeastasia": 0.564, + "southindia": 0.5664, + "uaecentral": 0.719, + "uaenorth": 0.621, + "uksouth": 0.5664, + "ukwest": 0.618, + "usgovarizona": 0.634, + "usgovtexas": 0.6208, + "usgovvirginia": 0.6208, + "westcentralus": 0.5664, + "westeurope": 0.592, + "westindia": 0.566, + "westus": 0.5664, + "westus2": 0.521 + }, + "lowpriorityf32sv2": { + "australiacentral": 1.133, + "australiacentral2": 1.133, + "australiaeast": 1.1328, + "australiasoutheast": 1.1328, + "brazilsouth": 1.1328, + "canadacentral": 1.1328, + "canadaeast": 1.1328, + "centralindia": 1.1328, + "centralus": 1.1328, + "eastasia": 1.1288, + "eastus": 1.042, + "eastus2": 1.042, + "francecentral": 1.1328, + "francesouth": 1.1328, + "germanycentral": 1.1328, + "germanynorth": 1.396, + "germanywestcentral": 1.21, + "japaneast": 1.1328, + "japanwest": 1.1328, + "koreacentral": 1.1328, + "koreasouth": 1.1328, + "northcentralus": 1.1328, + "northeurope": 1.203, + "southcentralus": 1.1328, + "southeastasia": 1.129, + "southindia": 1.1328, + "uaecentral": 1.437, + "uaenorth": 1.242, + "uksouth": 1.1328, + "ukwest": 1.236, + "usgovarizona": 1.269, + "usgovtexas": 1.2416, + "usgovvirginia": 1.2416, + "westcentralus": 1.1328, + "westeurope": 1.184, + "westindia": 1.133, + "westus": 1.1328, + "westus2": 1.042 + }, + "lowpriorityf48sv2": { + "australiacentral": 1.949, + "australiacentral2": 1.949, + "australiaeast": 1.949, + "australiasoutheast": 1.952, + "brazilsouth": 2.141, + "canadacentral": 1.772, + "canadaeast": 1.772, + "centralindia": 1.699, + "centralus": 1.862, + "eastasia": 1.92, + "eastus": 1.696, + "eastus2": 1.696, + "francecentral": 1.852, + "francesouth": 2.139, + "germanynorth": 2.094, + "germanywestcentral": 1.814, + "japaneast": 1.91, + "japanwest": 2.01, + "koreacentral": 1.805, + "koreasouth": 1.805, + "northcentralus": 1.699, + "northeurope": 1.805, + "southafricanorth": 1.977, + "southafricawest": 2.254, + "southcentralus": 1.862, + "southeastasia": 1.824, + "southindia": 1.781, + "switzerlandnorth": 2.0, + "switzerlandwest": 2.336, + "uaecentral": 2.156, + "uaenorth": 1.862, + "uksouth": 1.852, + "ukwest": 1.854, + "usgovarizona": 1.862, + "usgovvirginia": 1.862, + "westeurope": 1.815, + "westindia": 1.699, + "westus": 1.901, + "westus2": 1.696 + }, + "lowpriorityf64sv2": { + "australiacentral": 2.266, + "australiacentral2": 2.266, + "australiaeast": 2.2656, + "australiasoutheast": 2.2656, + "brazilsouth": 2.2656, + "canadacentral": 2.2656, + "canadaeast": 2.2656, + "centralindia": 2.2656, + "centralus": 2.2656, + "eastasia": 2.2576, + "eastus": 2.084, + "eastus2": 2.084, + "francecentral": 2.2656, + "francesouth": 2.2656, + "germanycentral": 2.2656, + "germanynorth": 2.792, + "germanywestcentral": 2.419, + "japaneast": 2.2656, + "japanwest": 2.2656, + "koreacentral": 2.2656, + "koreasouth": 2.2656, + "northcentralus": 2.2656, + "northeurope": 2.406, + "southcentralus": 2.2656, + "southeastasia": 2.258, + "southindia": 2.2656, + "uaecentral": 2.875, + "uaenorth": 2.483, + "uksouth": 2.2656, + "ukwest": 2.472, + "usgovarizona": 2.538, + "usgovtexas": 2.4832, + "usgovvirginia": 2.4832, + "westcentralus": 2.2656, + "westeurope": 2.369, + "westindia": 2.266, + "westus": 2.2656, + "westus2": 2.084 + }, + "lowpriorityf72sv2": { + "australiacentral": 2.549, + "australiacentral2": 2.549, + "australiaeast": 2.5488, + "australiasoutheast": 2.5488, + "brazilsouth": 2.5488, + "canadacentral": 2.5488, + "canadaeast": 2.5488, + "centralindia": 2.5488, + "centralus": 2.5488, + "eastasia": 2.54, + "eastus": 2.344, + "eastus2": 2.344, + "francecentral": 2.5488, + "francesouth": 2.5488, + "germanycentral": 2.5488, + "germanynorth": 3.141, + "germanywestcentral": 2.722, + "japaneast": 2.5488, + "japanwest": 2.5488, + "koreacentral": 2.5488, + "koreasouth": 2.5488, + "northcentralus": 2.5488, + "northeurope": 2.707, + "southcentralus": 2.5488, + "southeastasia": 2.54, + "southindia": 2.5488, + "uaecentral": 3.234, + "uaenorth": 2.794, + "uksouth": 2.5488, + "ukwest": 2.781, + "usgovarizona": 2.855, + "usgovtexas": 2.7936, + "usgovvirginia": 2.7936, + "westcentralus": 2.5488, + "westeurope": 2.665, + "westindia": 2.549, + "westus": 2.5488, + "westus2": 2.344 + }, + "lowpriorityg1": { + "australiaeast": 0.283, + "canadacentral": 0.215, + "canadaeast": 0.215, + "eastasia": 0.324, + "eastus2": 0.244, + "germanycentral": 0.2732, + "japaneast": 0.256, + "northeurope": 0.268, + "southeastasia": 0.292, + "uksouth": 0.136, + "usgovarizona": 0.138, + "usgovtexas": 0.138, + "usgovvirginia": 0.244, + "westeurope": 0.308, + "westus": 0.268, + "westus2": 0.224 + }, + "lowpriorityg2": { + "australiaeast": 0.566, + "canadacentral": 0.43, + "canadaeast": 0.43, + "eastasia": 0.648, + "eastus2": 0.488, + "germanycentral": 0.5464, + "japaneast": 0.512, + "northeurope": 0.537, + "southeastasia": 0.584, + "uksouth": 0.272, + "usgovarizona": 0.275, + "usgovtexas": 0.61, + "usgovvirginia": 0.488, + "westeurope": 0.616, + "westus": 0.536, + "westus2": 0.448 + }, + "lowpriorityg3": { + "australiaeast": 1.132, + "canadacentral": 0.859, + "canadaeast": 0.859, + "eastasia": 1.296, + "eastus2": 0.976, + "germanycentral": 1.0932, + "japaneast": 1.024, + "northeurope": 1.074, + "southeastasia": 1.168, + "uksouth": 0.544, + "usgovarizona": 1.22, + "usgovtexas": 0.55, + "usgovvirginia": 0.976, + "westeurope": 1.232, + "westus": 1.072, + "westus2": 0.895 + }, + "lowpriorityg4": { + "australiaeast": 2.264, + "canadacentral": 1.718, + "canadaeast": 1.718, + "eastasia": 2.592, + "eastus2": 1.952, + "germanycentral": 2.1864, + "japaneast": 2.048, + "northeurope": 2.144, + "southeastasia": 2.336, + "uksouth": 1.087, + "usgovarizona": 1.1, + "usgovtexas": 2.44, + "usgovvirginia": 1.952, + "westeurope": 2.464, + "westus": 2.144, + "westus2": 1.79 + }, + "lowpriorityg5": { + "australiaeast": 4.529, + "canadacentral": 3.436, + "canadaeast": 3.436, + "eastasia": 4.636, + "eastus2": 3.512, + "germanycentral": 4.3724, + "japaneast": 4.095, + "northeurope": 3.86, + "southeastasia": 4.216, + "uksouth": 2.226, + "usgovarizona": 1.955, + "usgovtexas": 4.39, + "usgovvirginia": 3.904, + "westeurope": 4.44, + "westus": 3.86, + "westus2": 3.512 + }, + "lowpriorityh8": { + "australiaeast": 0.85, + "centralindia": 0.775, + "eastus": 0.702, + "japaneast": 0.772, + "northcentralus": 0.644, + "northeurope": 0.605, + "southcentralus": 0.644, + "southeastasia": 0.701, + "uksouth": 0.712, + "usgovarizona": 0.565, + "westeurope": 0.682, + "westus": 0.644, + "westus2": 0.452 + }, + "lowpriorityh8m": { + "australiaeast": 1.139, + "centralindia": 1.039, + "eastus": 0.94, + "japaneast": 1.035, + "northcentralus": 0.862, + "northeurope": 0.811, + "southcentralus": 0.862, + "southeastasia": 0.868, + "uksouth": 0.882, + "usgovarizona": 0.7, + "westeurope": 0.914, + "westus": 0.862, + "westus2": 0.56 + }, + "lowpriorityh16": { + "australiaeast": 1.7, + "centralindia": 1.551, + "eastus": 1.403, + "japaneast": 1.545, + "northcentralus": 1.287, + "northeurope": 1.21, + "southcentralus": 1.287, + "southeastasia": 1.402, + "uksouth": 1.423, + "usgovarizona": 1.129, + "westeurope": 1.364, + "westus": 1.287, + "westus2": 0.903 + }, + "lowpriorityh16m": { + "australiaeast": 2.279, + "centralindia": 2.078, + "eastus": 1.88, + "japaneast": 2.07, + "northcentralus": 1.724, + "northeurope": 1.621, + "southcentralus": 1.724, + "southeastasia": 1.737, + "uksouth": 1.764, + "usgovarizona": 1.399, + "westeurope": 1.828, + "westus": 1.724, + "westus2": 1.119 + }, + "lowpriorityh16mr": { + "australiaeast": 2.506, + "centralindia": 2.286, + "eastus": 2.068, + "japaneast": 2.276, + "northcentralus": 1.897, + "northeurope": 1.783, + "southcentralus": 1.897, + "southeastasia": 1.87, + "uksouth": 1.898, + "usgovarizona": 1.506, + "westeurope": 2.011, + "westus": 1.897, + "westus2": 1.205 + }, + "lowpriorityh16r": { + "australiaeast": 1.871, + "centralindia": 1.706, + "eastus": 1.543, + "japaneast": 1.699, + "northcentralus": 1.416, + "northeurope": 1.331, + "southcentralus": 1.416, + "southeastasia": 1.5, + "uksouth": 1.524, + "usgovarizona": 1.208, + "westeurope": 1.501, + "westus": 1.416, + "westus2": 0.967 + }, + "lowpriorityhb60rs": { + "eastus": 2.016, + "southcentralus": 2.107, + "westeurope": 2.29 + }, + "lowpriorityhb120rsv2": { + "centralus": 3.979, + "eastus": 3.648, + "japaneast": 4.296, + "northcentralus": 3.936, + "southcentralus": 3.792, + "uaenorth": 4.109, + "uksouth": 4.008, + "westeurope": 4.08, + "westus2": 3.648 + }, + "lowpriorityhc44rs": { + "eastus": 2.077, + "japaneast": 2.648, + "southcentralus": 2.204, + "southeastasia": 2.457, + "westeurope": 2.457, + "westus2": 2.077 + }, + "lowpriorityl8sv2": { + "australiaeast": 0.446, + "eastus": 0.397, + "eastus2": 0.397, + "northeurope": 0.422, + "southcentralus": 0.447, + "southeastasia": 0.446, + "usgovarizona": 0.448, + "usgovvirginia": 0.448, + "westeurope": 0.445, + "westus": 0.422, + "westus2": 0.397 + }, + "lowpriorityl16sv2": { + "australiaeast": 0.893, + "eastus": 0.794, + "eastus2": 0.794, + "northeurope": 0.845, + "southcentralus": 0.893, + "southeastasia": 0.893, + "usgovarizona": 0.896, + "usgovvirginia": 0.896, + "westeurope": 0.89, + "westus": 0.845, + "westus2": 0.794 + }, + "lowpriorityl32sv2": { + "australiaeast": 1.786, + "eastus": 1.587, + "eastus2": 1.587, + "northeurope": 1.69, + "southcentralus": 1.787, + "southeastasia": 1.786, + "usgovarizona": 1.792, + "usgovvirginia": 1.792, + "westeurope": 1.779, + "westus": 1.69, + "westus2": 1.587 + }, + "lowpriorityl48sv2": { + "australiaeast": 2.678, + "eastus": 2.381, + "eastus2": 2.381, + "northeurope": 2.534, + "southcentralus": 2.68, + "southeastasia": 2.678, + "usgovarizona": 2.688, + "usgovvirginia": 2.688, + "westeurope": 2.669, + "westus": 2.534, + "westus2": 2.381 + }, + "lowpriorityl64sv2": { + "australiaeast": 3.571, + "eastus": 3.174, + "eastus2": 3.174, + "northeurope": 3.379, + "southcentralus": 3.574, + "southeastasia": 3.571, + "usgovarizona": 3.584, + "usgovvirginia": 3.584, + "westeurope": 3.558, + "westus": 3.379, + "westus2": 3.174 + }, + "lowpriorityl80sv2": { + "australiaeast": 4.464, + "eastus": 3.968, + "eastus2": 3.968, + "northeurope": 4.224, + "southcentralus": 4.467, + "southeastasia": 4.464, + "usgovarizona": 4.48, + "usgovvirginia": 4.48, + "westeurope": 4.448, + "westus": 4.224, + "westus2": 3.968 + }, + "lowprioritym8ms": { + "australiacentral": 1.119, + "australiacentral2": 1.119, + "australiaeast": 1.119, + "australiasoutheast": 1.119, + "brazilsouth": 1.346, + "canadacentral": 0.927, + "canadaeast": 0.927, + "centralindia": 0.781, + "centralus": 0.8416, + "eastasia": 1.127, + "eastus": 0.843, + "eastus2": 0.843, + "francecentral": 0.922, + "germanynorth": 1.266, + "germanywestcentral": 1.007, + "japaneast": 1.119, + "japanwest": 1.119, + "koreacentral": 1.038, + "koreasouth": 1.038, + "northeurope": 0.966, + "norwayeast": 1.026, + "southafricanorth": 0.971, + "southafricawest": 1.18, + "southcentralus": 0.885, + "southeastasia": 1.119, + "southindia": 1.159, + "switzerlandnorth": 1.18, + "switzerlandwest": 1.489, + "uaecentral": 1.106, + "uaenorth": 0.958, + "uksouth": 1.003, + "ukwest": 1.003, + "usgovarizona": 0.966, + "usgovvirginia": 0.966, + "westeurope": 1.089, + "westus": 0.946, + "westus2": 0.843 + }, + "lowprioritym16ms": { + "australiacentral": 2.239, + "australiacentral2": 2.239, + "australiaeast": 2.239, + "australiasoutheast": 2.239, + "brazilsouth": 2.691, + "canadacentral": 1.854, + "canadaeast": 1.854, + "centralindia": 1.563, + "centralus": 1.6832, + "eastasia": 2.254, + "eastus": 1.686, + "eastus2": 1.686, + "francecentral": 1.843, + "germanynorth": 2.532, + "germanywestcentral": 2.014, + "japaneast": 2.239, + "japanwest": 2.239, + "koreacentral": 2.077, + "koreasouth": 2.077, + "northeurope": 1.931, + "norwayeast": 2.052, + "southafricanorth": 1.942, + "southafricawest": 2.359, + "southcentralus": 1.769, + "southeastasia": 2.239, + "southindia": 2.318, + "switzerlandnorth": 2.359, + "switzerlandwest": 2.979, + "uaecentral": 2.212, + "uaenorth": 1.917, + "uksouth": 2.005, + "ukwest": 2.005, + "usgovarizona": 1.931, + "usgovvirginia": 1.931, + "westeurope": 2.177, + "westus": 1.8924, + "westus2": 1.686 + }, + "lowprioritym32ls": { + "australiacentral": 1.278, + "australiacentral2": 1.278, + "australiaeast": 1.27832, + "australiasoutheast": 1.27832, + "brazilsouth": 3.008, + "canadacentral": 1.912, + "canadaeast": 1.912, + "centralindia": 1.243844, + "centralus": 1.887, + "eastasia": 2.113, + "eastus": 1.1634, + "eastus2": 1.1634, + "francecentral": 1.937, + "germanynorth": 2.382, + "germanywestcentral": 1.968, + "japaneast": 1.27832, + "japanwest": 1.27832, + "koreacentral": 1.968, + "koreasouth": 1.968, + "northeurope": 1.226606, + "norwayeast": 2.232, + "southafricanorth": 2.129, + "southafricawest": 2.519, + "southcentralus": 1.968, + "southeastasia": 1.27832, + "southindia": 1.312796, + "switzerlandnorth": 2.244, + "switzerlandwest": 2.74, + "uaecentral": 2.382, + "uaenorth": 2.0028, + "uksouth": 1.261082, + "ukwest": 1.261082, + "usgovarizona": 1.37904, + "usgovvirginia": 1.37904, + "westeurope": 1.27832, + "westus": 1.8692, + "westus2": 1.1634 + }, + "lowprioritym32ms": { + "australiacentral": 4.477, + "australiacentral2": 4.477, + "australiaeast": 4.477, + "australiasoutheast": 4.477, + "brazilsouth": 5.383, + "canadacentral": 3.708, + "canadaeast": 3.708, + "centralindia": 3.125, + "centralus": 3.3668, + "eastasia": 4.509, + "eastus": 3.371, + "eastus2": 3.371, + "francecentral": 3.686, + "germanynorth": 5.063, + "germanywestcentral": 4.028, + "japaneast": 4.477, + "japanwest": 4.477, + "koreacentral": 4.154, + "koreasouth": 4.154, + "northeurope": 3.863, + "norwayeast": 4.104, + "southafricanorth": 3.883, + "southafricawest": 4.719, + "southcentralus": 3.539, + "southeastasia": 4.477, + "southindia": 4.637, + "switzerlandnorth": 4.719, + "switzerlandwest": 5.958, + "uaecentral": 4.424, + "uaenorth": 3.834, + "uksouth": 4.01, + "ukwest": 4.01, + "usgovarizona": 3.863, + "usgovvirginia": 3.863, + "westeurope": 4.354, + "westus": 3.7848, + "westus2": 3.371 + }, + "lowprioritym32ts": { + "australiacentral": 1.238, + "australiacentral2": 1.238, + "australiaeast": 1.23848, + "australiasoutheast": 1.23848, + "brazilsouth": 2.868, + "canadacentral": 1.839, + "canadaeast": 1.839, + "centralindia": 1.205996, + "centralus": 1.812, + "eastasia": 2.025, + "eastus": 1.1302, + "eastus2": 1.1302, + "francecentral": 1.859, + "germanynorth": 2.278, + "germanywestcentral": 1.888, + "japaneast": 1.23848, + "japanwest": 1.23848, + "koreacentral": 1.888, + "koreasouth": 1.888, + "northeurope": 1.189754, + "norwayeast": 2.137, + "southafricanorth": 2.04, + "southafricawest": 2.408, + "southcentralus": 1.888, + "southeastasia": 1.23848, + "southindia": 1.270964, + "switzerlandnorth": 2.148, + "switzerlandwest": 2.616, + "uaecentral": 2.278, + "uaenorth": 1.9212, + "uksouth": 1.222238, + "ukwest": 1.222238, + "usgovarizona": 1.29936, + "usgovvirginia": 1.29936, + "westeurope": 1.23848, + "westus": 1.7952, + "westus2": 1.1302 + }, + "lowprioritym64": { + "australiacentral": 5.046, + "australiacentral2": 5.046, + "australiaeast": 5.046, + "australiasoutheast": 5.046, + "brazilsouth": 6.379, + "canadacentral": 4.23, + "canadaeast": 4.23, + "centralindia": 3.93, + "centralus": 4.192, + "eastasia": 5.434, + "eastus": 3.845, + "eastus2": 3.845, + "francecentral": 4.539, + "germanynorth": 6.033, + "germanywestcentral": 4.912, + "japaneast": 5.046, + "japanwest": 5.046, + "koreacentral": 5.046, + "koreasouth": 5.046, + "northeurope": 4.379, + "norwayeast": 4.992, + "southafricanorth": 4.752, + "southafricawest": 5.659, + "southcentralus": 4.379, + "southeastasia": 5.046, + "southindia": 5.22, + "switzerlandnorth": 5.659, + "switzerlandwest": 7.004, + "uaecentral": 5.339, + "uaenorth": 4.699, + "uksouth": 4.539, + "ukwest": 4.539, + "usgovarizona": 4.379, + "usgovvirginia": 4.379, + "westeurope": 4.912, + "westus": 4.6456, + "westus2": 3.845 + }, + "lowprioritym64ls": { + "australiacentral": 2.477, + "australiacentral2": 2.477, + "australiaeast": 2.4772, + "australiasoutheast": 2.4772, + "brazilsouth": 5.738, + "canadacentral": 3.678, + "canadaeast": 3.678, + "centralindia": 2.41222, + "centralus": 3.775, + "eastasia": 4.05, + "eastus": 2.2606, + "eastus2": 2.2606, + "francecentral": 3.718, + "germanynorth": 4.556, + "germanywestcentral": 3.777, + "japaneast": 2.4772, + "japanwest": 2.4772, + "koreacentral": 3.777, + "koreasouth": 3.777, + "northeurope": 2.37973, + "norwayeast": 4.464, + "southafricanorth": 4.08, + "southafricawest": 4.816, + "southcentralus": 3.777, + "southeastasia": 2.4772, + "southindia": 2.54218, + "switzerlandnorth": 4.297, + "switzerlandwest": 5.232, + "uaecentral": 4.763, + "uaenorth": 3.8432, + "uksouth": 2.44471, + "ukwest": 2.44471, + "usgovarizona": 2.5992, + "usgovvirginia": 2.5992, + "westeurope": 2.4772, + "westus": 3.7388, + "westus2": 2.2606 + }, + "lowprioritym64m": { + "australiacentral": 7.82, + "australiacentral2": 7.82, + "australiaeast": 7.82, + "australiasoutheast": 7.821, + "brazilsouth": 9.241, + "canadacentral": 6.556, + "canadaeast": 6.556, + "centralindia": 5.444, + "centralus": 7.2092, + "eastasia": 7.774, + "eastus": 5.856, + "eastus2": 5.856, + "francecentral": 6.388, + "germanynorth": 8.703, + "germanywestcentral": 6.962, + "japaneast": 7.821, + "japanwest": 7.821, + "koreacentral": 7.173, + "koreasouth": 7.173, + "northeurope": 6.729, + "norwayeast": 8.81, + "southafricanorth": 6.718, + "southafricawest": 8.124, + "southcentralus": 6.14, + "southeastasia": 7.821, + "southindia": 8.091, + "switzerlandnorth": 8.124, + "switzerlandwest": 10.208, + "uaecentral": 9.504, + "uaenorth": 6.6356, + "uksouth": 6.991, + "ukwest": 6.991, + "usgovarizona": 6.729, + "usgovvirginia": 6.729, + "westeurope": 7.602, + "westus": 8.1164, + "westus2": 5.856 + }, + "lowprioritym64ms": { + "australiacentral": 7.82, + "australiacentral2": 7.82, + "australiaeast": 7.82, + "australiasoutheast": 7.821, + "brazilsouth": 9.241, + "canadacentral": 6.556, + "canadaeast": 6.556, + "centralindia": 5.444, + "centralus": 7.2092, + "eastasia": 7.774, + "eastus": 5.856, + "eastus2": 5.856, + "francecentral": 6.388, + "germanynorth": 8.703, + "germanywestcentral": 6.962, + "japaneast": 7.821, + "japanwest": 7.821, + "koreacentral": 7.173, + "koreasouth": 7.173, + "northeurope": 6.729, + "norwayeast": 8.81, + "southafricanorth": 6.718, + "southafricawest": 8.124, + "southcentralus": 6.14, + "southeastasia": 7.821, + "southindia": 8.091, + "switzerlandnorth": 8.124, + "switzerlandwest": 10.208, + "uaecentral": 9.504, + "uaenorth": 6.6356, + "uksouth": 6.991, + "ukwest": 6.991, + "usgovarizona": 6.729, + "usgovvirginia": 6.729, + "westeurope": 7.602, + "westus": 8.1164, + "westus2": 5.856 + }, + "lowprioritym64s": { + "australiacentral": 5.046, + "australiacentral2": 5.046, + "australiaeast": 5.046, + "australiasoutheast": 5.046, + "brazilsouth": 6.379, + "canadacentral": 4.23, + "canadaeast": 4.23, + "centralindia": 3.93, + "centralus": 4.192, + "eastasia": 5.434, + "eastus": 3.845, + "eastus2": 3.845, + "francecentral": 4.539, + "germanynorth": 6.033, + "germanywestcentral": 4.912, + "japaneast": 5.046, + "japanwest": 5.046, + "koreacentral": 5.046, + "koreasouth": 5.046, + "northeurope": 4.379, + "norwayeast": 4.992, + "southafricanorth": 4.752, + "southafricawest": 5.659, + "southcentralus": 4.379, + "southeastasia": 5.046, + "southindia": 5.22, + "switzerlandnorth": 5.659, + "switzerlandwest": 7.004, + "uaecentral": 5.339, + "uaenorth": 4.699, + "uksouth": 4.539, + "ukwest": 4.539, + "usgovarizona": 4.379, + "usgovvirginia": 4.379, + "westeurope": 4.912, + "westus": 4.6456, + "westus2": 3.845 + }, + "lowprioritym128": { + "australiacentral": 10.092, + "australiacentral2": 10.092, + "australiaeast": 10.092, + "australiasoutheast": 10.092, + "brazilsouth": 12.759, + "canadacentral": 8.459, + "canadaeast": 8.459, + "centralindia": 7.86, + "centralus": 8.384, + "eastasia": 10.867, + "eastus": 7.69, + "eastus2": 7.69, + "francecentral": 9.078, + "germanynorth": 12.066, + "germanywestcentral": 9.825, + "japaneast": 10.092, + "japanwest": 10.092, + "koreacentral": 10.091, + "koreasouth": 10.091, + "northeurope": 8.758, + "norwayeast": 9.985, + "southafricanorth": 9.504, + "southafricawest": 11.318, + "southcentralus": 8.757, + "southeastasia": 10.092, + "southindia": 10.44, + "switzerlandnorth": 11.318, + "switzerlandwest": 14.007, + "uaecentral": 10.678, + "uaenorth": 9.398, + "uksouth": 9.078, + "ukwest": 9.078, + "usgovarizona": 8.758, + "usgovvirginia": 8.758, + "westeurope": 9.825, + "westus": 9.291, + "westus2": 7.69 + }, + "lowprioritym128m": { + "australiacentral": 19.129, + "australiacentral2": 19.129, + "australiaeast": 19.1294, + "australiasoutheast": 19.13, + "brazilsouth": 23.172, + "canadacentral": 15.758, + "canadaeast": 15.758, + "centralindia": 13.37, + "centralus": 14.418, + "eastasia": 19.383, + "eastus": 14.326, + "eastus2": 14.3256, + "francecentral": 15.806, + "germanynorth": 21.774, + "germanywestcentral": 17.293, + "japaneast": 19.131, + "japanwest": 19.131, + "koreacentral": 17.834, + "koreasouth": 17.834, + "northeurope": 16.46, + "norwayeast": 17.621, + "southafricanorth": 16.66, + "southafricawest": 20.29, + "southcentralus": 15.165, + "southeastasia": 19.13, + "southindia": 19.791, + "switzerlandnorth": 20.29, + "switzerlandwest": 25.67, + "uaecentral": 19.008, + "uaenorth": 16.446, + "uksouth": 17.10116, + "ukwest": 17.10116, + "usgovarizona": 16.46, + "usgovvirginia": 16.46, + "westeurope": 18.59568, + "westus": 16.2328, + "westus2": 14.3256 + }, + "lowprioritym128ms": { + "australiacentral": 19.129, + "australiacentral2": 19.129, + "australiaeast": 19.1294, + "australiasoutheast": 19.13, + "brazilsouth": 23.172, + "canadacentral": 15.758, + "canadaeast": 15.758, + "centralindia": 13.37, + "centralus": 14.418, + "eastasia": 19.383, + "eastus": 14.326, + "eastus2": 14.3256, + "francecentral": 15.806, + "germanynorth": 21.774, + "germanywestcentral": 17.293, + "japaneast": 19.131, + "japanwest": 19.131, + "koreacentral": 17.834, + "koreasouth": 17.834, + "northeurope": 16.46, + "norwayeast": 17.621, + "southafricanorth": 16.66, + "southafricawest": 20.29, + "southcentralus": 15.165, + "southeastasia": 19.13, + "southindia": 19.791, + "switzerlandnorth": 20.29, + "switzerlandwest": 25.67, + "uaecentral": 19.008, + "uaenorth": 16.446, + "uksouth": 17.10116, + "ukwest": 17.10116, + "usgovarizona": 16.46, + "usgovvirginia": 16.46, + "westeurope": 18.59568, + "westus": 16.2328, + "westus2": 14.3256 + }, + "lowprioritym128s": { + "australiacentral": 10.092, + "australiacentral2": 10.092, + "australiaeast": 10.092, + "australiasoutheast": 10.092, + "brazilsouth": 12.759, + "canadacentral": 8.459, + "canadaeast": 8.459, + "centralindia": 7.86, + "centralus": 8.384, + "eastasia": 10.867, + "eastus": 7.69, + "eastus2": 7.69, + "francecentral": 9.078, + "germanynorth": 12.066, + "germanywestcentral": 9.825, + "japaneast": 10.092, + "japanwest": 10.092, + "koreacentral": 10.091, + "koreasouth": 10.091, + "northeurope": 8.758, + "norwayeast": 9.985, + "southafricanorth": 9.504, + "southafricawest": 11.318, + "southcentralus": 8.757, + "southeastasia": 10.092, + "southindia": 10.44, + "switzerlandnorth": 11.318, + "switzerlandwest": 14.007, + "uaecentral": 10.678, + "uaenorth": 9.398, + "uksouth": 9.078, + "ukwest": 9.078, + "usgovarizona": 8.758, + "usgovvirginia": 8.758, + "westeurope": 9.825, + "westus": 9.291, + "westus2": 7.69 + }, + "lowprioritync4ast4v3": { + "westus2": 0.284 + }, + "lowprioritync6": { + "australiaeast": 0.732, + "eastus": 0.434, + "eastus2": 0.434, + "japaneast": 0.699, + "northcentralus": 0.434, + "northeurope": 0.462, + "southcentralus": 0.52, + "southeastasia": 0.622, + "uksouth": 0.61, + "usgovarizona": 0.506, + "usgovvirginia": 0.506, + "westeurope": 0.555, + "westus": 0.52, + "westus2": 0.434 + }, + "lowprioritync6sv2": { + "eastus": 0.997, + "southcentralus": 1.1968, + "southeastasia": 1.4316, + "westeurope": 1.276, + "westus2": 0.867 + }, + "lowprioritync6sv3": { + "australiaeast": 1.804, + "canadacentral": 1.457, + "centralindia": 1.804, + "eastus": 1.3712, + "eastus2": 1.33632, + "francecentral": 1.5424, + "japaneast": 1.788, + "koreacentral": 1.804, + "southcentralus": 1.50832, + "southeastasia": 1.804, + "uksouth": 1.546, + "usgovarizona": 1.616, + "usgovvirginia": 1.616, + "westeurope": 1.64, + "westus2": 1.33632 + }, + "lowprioritync8ast4v3": { + "westus2": 0.448 + }, + "lowprioritync12": { + "australiaeast": 1.464, + "eastus": 0.867, + "eastus2": 0.867, + "japaneast": 1.398, + "northcentralus": 0.867, + "northeurope": 0.925, + "southcentralus": 1.041, + "southeastasia": 1.245, + "uksouth": 1.22, + "usgovarizona": 1.011, + "usgovvirginia": 1.011, + "westeurope": 1.11, + "westus": 1.041, + "westus2": 0.867 + }, + "lowprioritync12sv2": { + "eastus": 1.994, + "southcentralus": 2.393, + "southeastasia": 2.864, + "westeurope": 2.552, + "westus2": 1.734 + }, + "lowprioritync12sv3": { + "australiaeast": 3.608, + "canadacentral": 2.914, + "centralindia": 3.608, + "eastus": 2.7424, + "eastus2": 2.67264, + "francecentral": 3.0848, + "japaneast": 3.576, + "koreacentral": 3.608, + "southcentralus": 3.01664, + "southeastasia": 3.608, + "uksouth": 3.092, + "usgovarizona": 3.232, + "usgovvirginia": 3.232, + "westeurope": 3.279, + "westus2": 2.67264 + }, + "lowprioritync16ast4v3": { + "westus2": 0.776 + }, + "lowprioritync24": { + "australiaeast": 2.928, + "eastus": 1.734, + "eastus2": 1.734, + "japaneast": 2.796, + "northcentralus": 1.734, + "northeurope": 1.85, + "southcentralus": 2.081, + "southeastasia": 2.49, + "uksouth": 2.441, + "usgovarizona": 2.022, + "usgovvirginia": 2.022, + "westeurope": 2.22, + "westus": 2.081, + "westus2": 1.734 + }, + "lowprioritync24r": { + "australiaeast": 3.225, + "eastus": 1.908, + "eastus2": 1.908, + "japaneast": 3.152, + "northcentralus": 1.908, + "northeurope": 2.034, + "southcentralus": 2.29, + "southeastasia": 2.74, + "uksouth": 2.686, + "usgovarizona": 2.225, + "usgovvirginia": 2.225, + "westeurope": 2.442, + "westus": 2.29, + "westus2": 1.908 + }, + "lowprioritync24rsv2": { + "eastus": 4.388, + "southcentralus": 5.266, + "southeastasia": 6.301, + "westeurope": 5.615, + "westus2": 3.816 + }, + "lowprioritync24rsv3": { + "australiaeast": 7.938, + "canadacentral": 6.41, + "centralindia": 7.894, + "eastus": 6.0336, + "eastus2": 5.83488, + "francecentral": 6.7428, + "japaneast": 7.823, + "koreacentral": 7.894, + "southcentralus": 6.63696, + "southeastasia": 7.938, + "uksouth": 6.802, + "usgovarizona": 7.11, + "usgovvirginia": 7.11, + "westeurope": 7.214, + "westus2": 5.83488 + }, + "lowprioritync24sv2": { + "eastus": 3.989, + "southcentralus": 4.7868, + "southeastasia": 5.727, + "westeurope": 5.104, + "westus2": 3.469 + }, + "lowprioritync24sv3": { + "australiaeast": 7.216, + "canadacentral": 5.827, + "centralindia": 7.216, + "eastus": 5.4848, + "eastus2": 5.34528, + "francecentral": 6.17, + "japaneast": 7.152, + "koreacentral": 7.216, + "southcentralus": 6.03328, + "southeastasia": 7.216, + "uksouth": 6.184, + "usgovarizona": 6.464, + "usgovvirginia": 6.464, + "westeurope": 6.558, + "westus2": 5.34528 + }, + "lowprioritync64ast4v3": { + "westus2": 2.918 + }, + "lowprioritynd6s": { + "eastus": 0.997, + "southcentralus": 1.1968, + "southeastasia": 1.4316, + "westeurope": 1.276, + "westus2": 0.867 + }, + "lowprioritynd12s": { + "eastus": 1.994, + "southcentralus": 2.394, + "southeastasia": 2.864, + "westeurope": 2.552, + "westus2": 1.734 + }, + "lowprioritynd24rs": { + "eastus": 4.388, + "southcentralus": 5.266, + "southeastasia": 6.301, + "westeurope": 5.6156, + "westus2": 3.816 + }, + "lowprioritynd24s": { + "eastus": 3.989, + "southcentralus": 4.7868, + "southeastasia": 5.727, + "westeurope": 5.104, + "westus2": 3.469 + }, + "lowprioritynd40rsv2": { + "eastus": 9.549, + "southcentralus": 11.311, + "usgovarizona": 11.752, + "usgovvirginia": 11.752, + "westeurope": 11.746, + "westus2": 9.549 + }, + "lowprioritynv6": { + "australiaeast": 0.744, + "centralindia": 0.7608, + "eastus": 0.576, + "eastus2": 0.564, + "japaneast": 0.711, + "northcentralus": 0.576, + "northeurope": 0.583, + "southcentralus": 0.54, + "southeastasia": 0.746, + "uksouth": 0.702, + "usgovarizona": 0.5465, + "usgovtexas": 0.547, + "usgovvirginia": 0.547, + "westeurope": 0.638, + "westus": 0.576, + "westus2": 0.513 + }, + "lowprioritynv12": { + "australiaeast": 1.488, + "centralindia": 1.5216, + "eastus": 1.152, + "eastus2": 1.1288, + "japaneast": 1.422, + "northcentralus": 1.152, + "northeurope": 1.166, + "southcentralus": 1.08, + "southeastasia": 1.492, + "uksouth": 1.404, + "usgovarizona": 1.0925, + "usgovtexas": 1.093, + "usgovvirginia": 1.093, + "westeurope": 1.276, + "westus": 1.152, + "westus2": 1.026 + }, + "lowprioritynv12sv3": { + "australiaeast": 0.857, + "brazilsouth": 0.996, + "eastus": 0.678, + "eastus2": 0.677, + "francecentral": 0.791, + "japaneast": 0.853, + "northeurope": 0.706, + "norwaywest": 1.069, + "southafricanorth": 0.805, + "southcentralus": 0.768, + "southeastasia": 0.857, + "uaenorth": 0.777, + "uksouth": 0.791, + "usgovarizona": 0.791, + "usgovvirginia": 0.791, + "westeurope": 0.7908, + "westus": 0.678, + "westus2": 0.677 + }, + "lowprioritynv24": { + "australiaeast": 2.975, + "centralindia": 3.043, + "eastus": 2.304, + "eastus2": 2.257, + "japaneast": 2.844, + "northcentralus": 2.304, + "northeurope": 2.332, + "southcentralus": 2.16, + "southeastasia": 2.984, + "uksouth": 2.807, + "usgovarizona": 2.565, + "usgovtexas": 2.565, + "usgovvirginia": 2.565, + "westeurope": 2.552, + "westus": 2.304, + "westus2": 2.052 + }, + "lowprioritynv24sv3": { + "australiaeast": 1.713, + "brazilsouth": 1.992, + "eastus": 1.354, + "eastus2": 1.354, + "francecentral": 1.582, + "japaneast": 1.706, + "northeurope": 1.41, + "norwaywest": 2.138, + "southafricanorth": 1.61, + "southcentralus": 1.536, + "southeastasia": 1.714, + "uaenorth": 1.554, + "uksouth": 1.582, + "usgovarizona": 1.582, + "usgovvirginia": 1.582, + "westeurope": 1.5816, + "westus": 1.354, + "westus2": 1.354 + }, + "lowprioritynv48sv3": { + "australiaeast": 3.426, + "brazilsouth": 3.984, + "eastus": 2.708, + "eastus2": 2.707, + "francecentral": 3.163, + "japaneast": 3.411, + "northeurope": 2.82, + "norwaywest": 4.276, + "southafricanorth": 3.22, + "southcentralus": 3.072, + "southeastasia": 3.428, + "uaenorth": 3.108, + "uksouth": 3.163, + "usgovarizona": 3.163, + "usgovvirginia": 3.163, + "westeurope": 3.1632, + "westus": 2.708, + "westus2": 2.707 + }, + "standarda0": { + "australiacentral": 0.029, + "australiacentral2": 0.029, + "australiaeast": 0.029, + "australiasoutheast": 0.029, + "brazilsouth": 0.024, + "canadacentral": 0.022, + "centralindia": 0.02, + "centralus": 0.02, + "eastasia": 0.02, + "eastus": 0.02, + "eastus2": 0.02, + "francecentral": 0.022, + "francesouth": 0.0286, + "germanycentral": 0.024, + "germanynortheast": 0.024, + "japaneast": 0.024, + "japanwest": 0.021, + "koreacentral": 0.02, + "koreasouth": 0.018, + "northcentralus": 0.02, + "northeurope": 0.02, + "southcentralus": 0.02, + "southeastasia": 0.02, + "southindia": 0.018, + "uksouth": 0.022, + "ukwest": 0.022, + "usgovarizona": 0.018, + "usgovtexas": 0.018, + "usgovvirginia": 0.018, + "westcentralus": 0.02, + "westeurope": 0.02, + "westindia": 0.02, + "westus": 0.02, + "westus2": 0.02 + }, + "standarda1": { + "australiacentral": 0.113, + "australiacentral2": 0.113, + "australiaeast": 0.113, + "australiasoutheast": 0.113, + "brazilsouth": 0.11, + "canadacentral": 0.094, + "canadaeast": 0.094, + "centralindia": 0.098, + "centralus": 0.09, + "eastasia": 0.09, + "eastus": 0.09, + "eastus2": 0.09, + "francecentral": 0.099, + "francesouth": 0.1287, + "germanycentral": 0.099, + "germanynortheast": 0.099, + "japaneast": 0.106, + "japanwest": 0.095, + "koreacentral": 0.11, + "koreasouth": 0.099, + "northcentralus": 0.09, + "northeurope": 0.09, + "southcentralus": 0.09, + "southeastasia": 0.09, + "southindia": 0.088, + "uksouth": 0.099, + "ukwest": 0.099, + "usgovarizona": 0.083, + "usgovtexas": 0.083, + "usgovvirginia": 0.083, + "westcentralus": 0.085, + "westeurope": 0.09, + "westindia": 0.098, + "westus": 0.09, + "westus2": 0.085 + }, + "standarda1v2": { + "australiacentral": 0.076, + "australiacentral2": 0.076, + "australiaeast": 0.076, + "australiasoutheast": 0.076, + "brazilsouth": 0.092, + "brazilsoutheast": 0.125, + "canadacentral": 0.065, + "canadaeast": 0.065, + "centralindia": 0.07, + "centralus": 0.065, + "eastasia": 0.076, + "eastus": 0.065, + "eastus2": 0.065, + "francecentral": 0.076, + "francesouth": 0.0988, + "germanycentral": 0.071, + "germanynorth": 0.0993, + "germanynortheast": 0.071, + "germanywestcentral": 0.062, + "japaneast": 0.081, + "japanwest": 0.081, + "koreacentral": 0.081, + "koreasouth": 0.073, + "northcentralus": 0.065, + "northeurope": 0.062, + "norwayeast": 0.0911, + "norwaywest": 0.105, + "southafricanorth": 0.0942, + "southafricawest": 0.106, + "southcentralus": 0.065, + "southeastasia": 0.068, + "southindia": 0.07, + "switzerlandnorth": 0.0952, + "switzerlandwest": 0.11, + "uaecentral": 0.102, + "uaenorth": 0.0892, + "uksouth": 0.076, + "ukwest": 0.076, + "usgovarizona": 0.073, + "usgovtexas": 0.073, + "usgovvirginia": 0.073, + "westcentralus": 0.059, + "westeurope": 0.062, + "westindia": 0.07, + "westus": 0.065, + "westus2": 0.054 + }, + "standarda2": { + "australiacentral": 0.226, + "australiacentral2": 0.226, + "australiaeast": 0.226, + "australiasoutheast": 0.226, + "brazilsouth": 0.22, + "canadacentral": 0.187, + "canadaeast": 0.187, + "centralindia": 0.197, + "centralus": 0.18, + "eastasia": 0.18, + "eastus": 0.18, + "eastus2": 0.18, + "francecentral": 0.198, + "francesouth": 0.2574, + "germanycentral": 0.199, + "germanynortheast": 0.199, + "japaneast": 0.212, + "japanwest": 0.19, + "koreacentral": 0.22, + "koreasouth": 0.198, + "northcentralus": 0.18, + "northeurope": 0.18, + "southcentralus": 0.18, + "southeastasia": 0.18, + "southindia": 0.177, + "uksouth": 0.198, + "ukwest": 0.198, + "usgovarizona": 0.166, + "usgovtexas": 0.166, + "usgovvirginia": 0.166, + "westcentralus": 0.17, + "westeurope": 0.18, + "westindia": 0.197, + "westus": 0.18, + "westus2": 0.17 + }, + "standarda2mv2": { + "australiacentral": 0.225, + "australiacentral2": 0.225, + "australiaeast": 0.225, + "australiasoutheast": 0.27, + "brazilsouth": 0.315, + "brazilsoutheast": 0.362, + "canadacentral": 0.195, + "canadaeast": 0.195, + "centralindia": 0.24, + "centralus": 0.195, + "eastasia": 0.27, + "eastus": 0.18, + "eastus2": 0.18, + "francecentral": 0.27, + "francesouth": 0.351, + "germanycentral": 0.242, + "germanynorth": 0.253, + "germanynortheast": 0.242, + "germanywestcentral": 0.188, + "japaneast": 0.233, + "japanwest": 0.27, + "koreacentral": 0.22, + "koreasouth": 0.198, + "northcentralus": 0.195, + "northeurope": 0.21, + "norwayeast": 0.228, + "norwaywest": 0.269, + "southafricanorth": 0.225, + "southafricawest": 0.258, + "southcentralus": 0.188, + "southeastasia": 0.203, + "southindia": 0.218, + "switzerlandnorth": 0.241, + "switzerlandwest": 0.285, + "uaecentral": 0.246, + "uaenorth": 0.211, + "uksouth": 0.27, + "ukwest": 0.24, + "usgovarizona": 0.24, + "usgovtexas": 0.24, + "usgovvirginia": 0.24, + "westcentralus": 0.18, + "westeurope": 0.188, + "westindia": 0.24, + "westus": 0.225, + "westus2": 0.15 + }, + "standarda2v2": { + "australiacentral": 0.159, + "australiacentral2": 0.159, + "australiaeast": 0.159, + "australiasoutheast": 0.159, + "brazilsouth": 0.193, + "brazilsoutheast": 0.26, + "canadacentral": 0.136, + "canadaeast": 0.136, + "centralindia": 0.147, + "centralus": 0.136, + "eastasia": 0.159, + "eastus": 0.136, + "eastus2": 0.136, + "francecentral": 0.159, + "francesouth": 0.2067, + "germanycentral": 0.15, + "germanynorth": 0.199, + "germanynortheast": 0.15, + "germanywestcentral": 0.13, + "japaneast": 0.17, + "japanwest": 0.17, + "koreacentral": 0.17, + "koreasouth": 0.153, + "northcentralus": 0.136, + "northeurope": 0.13, + "norwayeast": 0.188, + "norwaywest": 0.216, + "southafricanorth": 0.194, + "southafricawest": 0.22, + "southcentralus": 0.136, + "southeastasia": 0.142, + "southindia": 0.147, + "switzerlandnorth": 0.19, + "switzerlandwest": 0.22, + "uaecentral": 0.211, + "uaenorth": 0.183, + "uksouth": 0.159, + "ukwest": 0.159, + "usgovarizona": 0.146, + "usgovtexas": 0.146, + "usgovvirginia": 0.146, + "westcentralus": 0.125, + "westeurope": 0.13, + "westindia": 0.147, + "westus": 0.136, + "westus2": 0.113 + }, + "standarda3": { + "australiacentral": 0.452, + "australiacentral2": 0.452, + "australiaeast": 0.452, + "australiasoutheast": 0.452, + "brazilsouth": 0.44, + "canadacentral": 0.374, + "canadaeast": 0.374, + "centralindia": 0.393, + "centralus": 0.36, + "eastasia": 0.36, + "eastus": 0.36, + "eastus2": 0.36, + "francecentral": 0.396, + "francesouth": 0.5148, + "germanycentral": 0.397, + "germanynortheast": 0.397, + "japaneast": 0.424, + "japanwest": 0.38, + "koreacentral": 0.44, + "koreasouth": 0.396, + "northcentralus": 0.36, + "northeurope": 0.36, + "southcentralus": 0.36, + "southeastasia": 0.36, + "southindia": 0.354, + "uksouth": 0.396, + "ukwest": 0.396, + "usgovarizona": 0.332, + "usgovtexas": 0.332, + "usgovvirginia": 0.332, + "westcentralus": 0.34, + "westeurope": 0.36, + "westindia": 0.393, + "westus": 0.36, + "westus2": 0.34 + }, + "standarda4": { + "australiacentral": 0.904, + "australiacentral2": 0.904, + "australiaeast": 0.904, + "australiasoutheast": 0.904, + "brazilsouth": 0.88, + "canadacentral": 0.749, + "canadaeast": 0.749, + "centralindia": 0.786, + "centralus": 0.72, + "eastasia": 0.72, + "eastus": 0.72, + "eastus2": 0.72, + "francecentral": 0.792, + "francesouth": 1.0296, + "germanycentral": 0.794, + "germanynortheast": 0.794, + "japaneast": 0.848, + "japanwest": 0.76, + "koreacentral": 0.88, + "koreasouth": 0.792, + "northcentralus": 0.72, + "northeurope": 0.72, + "southcentralus": 0.72, + "southeastasia": 0.72, + "southindia": 0.707, + "uksouth": 0.792, + "ukwest": 0.792, + "usgovarizona": 0.664, + "usgovtexas": 0.664, + "usgovvirginia": 0.664, + "westcentralus": 0.681, + "westeurope": 0.72, + "westindia": 0.786, + "westus": 0.72, + "westus2": 0.681 + }, + "standarda4mv2": { + "australiacentral": 0.473, + "australiacentral2": 0.473, + "australiaeast": 0.473, + "australiasoutheast": 0.567, + "brazilsouth": 0.662, + "brazilsoutheast": 0.752, + "canadacentral": 0.41, + "canadaeast": 0.41, + "centralindia": 0.504, + "centralus": 0.41, + "eastasia": 0.567, + "eastus": 0.36, + "eastus2": 0.378, + "francecentral": 0.567, + "francesouth": 0.7371, + "germanycentral": 0.507, + "germanynorth": 0.506, + "germanynortheast": 0.507, + "germanywestcentral": 0.394, + "japaneast": 0.488, + "japanwest": 0.567, + "koreacentral": 0.463, + "koreasouth": 0.417, + "northcentralus": 0.41, + "northeurope": 0.441, + "norwayeast": 0.47, + "norwaywest": 0.556, + "southafricanorth": 0.463, + "southafricawest": 0.533, + "southcentralus": 0.375, + "southeastasia": 0.425, + "southindia": 0.457, + "switzerlandnorth": 0.482, + "switzerlandwest": 0.571, + "uaecentral": 0.508, + "uaenorth": 0.434, + "uksouth": 0.567, + "ukwest": 0.504, + "usgovarizona": 0.48, + "usgovtexas": 0.48, + "usgovvirginia": 0.48, + "westcentralus": 0.378, + "westeurope": 0.394, + "westindia": 0.504, + "westus": 0.45, + "westus2": 0.315 + }, + "standarda4v2": { + "australiacentral": 0.333, + "australiacentral2": 0.333, + "australiaeast": 0.333, + "australiasoutheast": 0.333, + "brazilsouth": 0.405, + "brazilsoutheast": 0.535, + "canadacentral": 0.286, + "canadaeast": 0.286, + "centralindia": 0.31, + "centralus": 0.286, + "eastasia": 0.333, + "eastus": 0.286, + "eastus2": 0.286, + "francecentral": 0.333, + "francesouth": 0.4329, + "germanycentral": 0.315, + "germanynorth": 0.397, + "germanynortheast": 0.315, + "germanywestcentral": 0.274, + "japaneast": 0.357, + "japanwest": 0.357, + "koreacentral": 0.356, + "koreasouth": 0.321, + "northcentralus": 0.286, + "northeurope": 0.274, + "norwayeast": 0.385, + "norwaywest": 0.446, + "southafricanorth": 0.397, + "southafricawest": 0.451, + "southcentralus": 0.286, + "southeastasia": 0.298, + "southindia": 0.31, + "switzerlandnorth": 0.381, + "switzerlandwest": 0.44, + "uaecentral": 0.432, + "uaenorth": 0.375, + "uksouth": 0.333, + "ukwest": 0.333, + "usgovarizona": 0.292, + "usgovtexas": 0.292, + "usgovvirginia": 0.292, + "westcentralus": 0.262, + "westeurope": 0.274, + "westindia": 0.31, + "westus": 0.286, + "westus2": 0.238 + }, + "standarda5": { + "australiacentral": 0.349, + "australiacentral2": 0.349, + "australiaeast": 0.349, + "australiasoutheast": 0.349, + "brazilsouth": 0.368, + "canadacentral": 0.33, + "canadaeast": 0.33, + "centralindia": 0.305, + "centralus": 0.33, + "eastasia": 0.36, + "eastus": 0.33, + "eastus2": 0.3, + "francecentral": 0.374, + "francesouth": 0.4862, + "germanycentral": 0.345, + "germanynortheast": 0.345, + "japaneast": 0.35, + "japanwest": 0.31, + "koreacentral": 0.287, + "koreasouth": 0.258, + "northcentralus": 0.33, + "northeurope": 0.3, + "southcentralus": 0.3, + "southeastasia": 0.32, + "southindia": 0.275, + "uksouth": 0.374, + "ukwest": 0.374, + "usgovarizona": 0.273, + "usgovtexas": 0.273, + "usgovvirginia": 0.273, + "westcentralus": 0.3, + "westeurope": 0.34, + "westindia": 0.305, + "westus": 0.33, + "westus2": 0.3 + }, + "standarda6": { + "australiacentral": 0.698, + "australiacentral2": 0.698, + "australiaeast": 0.698, + "australiasoutheast": 0.698, + "brazilsouth": 0.736, + "canadacentral": 0.66, + "canadaeast": 0.66, + "centralindia": 0.61, + "centralus": 0.66, + "eastasia": 0.72, + "eastus": 0.66, + "eastus2": 0.6, + "francecentral": 0.748, + "francesouth": 0.9724, + "germanycentral": 0.69, + "germanynortheast": 0.69, + "japaneast": 0.7, + "japanwest": 0.62, + "koreacentral": 0.572, + "koreasouth": 0.515, + "northcentralus": 0.66, + "northeurope": 0.6, + "southcentralus": 0.6, + "southeastasia": 0.64, + "southindia": 0.549, + "uksouth": 0.748, + "ukwest": 0.748, + "usgovarizona": 0.545, + "usgovtexas": 0.545, + "usgovvirginia": 0.545, + "westcentralus": 0.6, + "westeurope": 0.68, + "westindia": 0.61, + "westus": 0.66, + "westus2": 0.6 + }, + "standarda7": { + "australiacentral": 1.396, + "australiacentral2": 1.396, + "australiaeast": 1.396, + "australiasoutheast": 1.396, + "brazilsouth": 1.472, + "canadacentral": 1.32, + "canadaeast": 1.32, + "centralindia": 1.22, + "centralus": 1.32, + "eastasia": 1.44, + "eastus": 1.32, + "eastus2": 1.2, + "francecentral": 1.496, + "francesouth": 1.9448, + "germanycentral": 1.38, + "germanynortheast": 1.38, + "japaneast": 1.4, + "japanwest": 1.24, + "koreacentral": 1.144, + "koreasouth": 1.03, + "northcentralus": 1.32, + "northeurope": 1.2, + "southcentralus": 1.2, + "southeastasia": 1.28, + "southindia": 1.098, + "uksouth": 1.496, + "ukwest": 1.496, + "usgovarizona": 1.091, + "usgovtexas": 1.091, + "usgovvirginia": 1.091, + "westcentralus": 1.2, + "westeurope": 1.36, + "westindia": 1.22, + "westus": 1.32, + "westus2": 1.2 + }, + "standarda8": { + "eastus": 1.466, + "japaneast": 1.752, + "northcentralus": 1.466, + "northeurope": 1.35, + "southcentralus": 1.35, + "westeurope": 1.553, + "westus": 1.466 + }, + "standarda8mv2": { + "australiacentral": 0.992, + "australiacentral2": 0.992, + "australiaeast": 0.992, + "australiasoutheast": 1.191, + "brazilsouth": 1.389, + "brazilsoutheast": 1.56, + "canadacentral": 0.86, + "canadaeast": 0.86, + "centralindia": 1.058, + "centralus": 0.86, + "eastasia": 1.191, + "eastus": 0.72, + "eastus2": 0.794, + "francecentral": 1.191, + "francesouth": 1.5483, + "germanycentral": 1.065, + "germanynorth": 1.013, + "germanynortheast": 1.065, + "germanywestcentral": 0.827, + "japaneast": 1.025, + "japanwest": 1.191, + "koreacentral": 0.972, + "koreasouth": 0.875, + "northcentralus": 0.86, + "northeurope": 0.926, + "norwayeast": 0.969, + "norwaywest": 1.149, + "southafricanorth": 0.954, + "southafricawest": 1.102, + "southcentralus": 0.75, + "southeastasia": 0.893, + "southindia": 0.959, + "switzerlandnorth": 0.963, + "switzerlandwest": 1.142, + "uaecentral": 1.05, + "uaenorth": 0.892, + "uksouth": 1.191, + "ukwest": 1.058, + "usgovarizona": 0.96, + "usgovtexas": 0.96, + "usgovvirginia": 0.96, + "westcentralus": 0.794, + "westeurope": 0.827, + "westindia": 1.058, + "westus": 0.9, + "westus2": 0.662 + }, + "standarda8v2": { + "australiacentral": 0.7, + "australiacentral2": 0.7, + "australiaeast": 0.7, + "australiasoutheast": 0.7, + "brazilsouth": 0.85, + "brazilsoutheast": 1.105, + "canadacentral": 0.6, + "canadaeast": 0.6, + "centralindia": 0.65, + "centralus": 0.6, + "eastasia": 0.7, + "eastus": 0.6, + "eastus2": 0.6, + "francecentral": 0.7, + "francesouth": 0.91, + "germanycentral": 0.661, + "germanynorth": 0.794, + "germanynortheast": 0.661, + "germanywestcentral": 0.575, + "japaneast": 0.75, + "japanwest": 0.75, + "koreacentral": 0.748, + "koreasouth": 0.673, + "northcentralus": 0.6, + "northeurope": 0.575, + "norwayeast": 0.789, + "norwaywest": 0.916, + "southafricanorth": 0.814, + "southafricawest": 0.927, + "southcentralus": 0.6, + "southeastasia": 0.625, + "southindia": 0.65, + "switzerlandnorth": 0.762, + "switzerlandwest": 0.88, + "uaecentral": 0.887, + "uaenorth": 0.768, + "uksouth": 0.7, + "ukwest": 0.7, + "usgovarizona": 0.584, + "usgovtexas": 0.584, + "usgovvirginia": 0.584, + "westcentralus": 0.55, + "westeurope": 0.575, + "westindia": 0.65, + "westus": 0.6, + "westus2": 0.5 + }, + "standarda9": { + "eastus": 2.933, + "japaneast": 3.505, + "northcentralus": 2.933, + "northeurope": 2.7, + "southcentralus": 2.7, + "westeurope": 3.105, + "westus": 2.933 + }, + "standarda10": { + "eastus": 1.173, + "japaneast": 1.402, + "northcentralus": 1.173, + "northeurope": 1.08, + "southcentralus": 1.08, + "westeurope": 1.242, + "westus": 1.173 + }, + "standarda11": { + "eastus": 2.346, + "japaneast": 2.804, + "northcentralus": 2.346, + "northeurope": 2.16, + "southcentralus": 2.16, + "westeurope": 2.484, + "westus": 2.346 + }, + "standardb1ms": { + "australiacentral": 0.0304, + "australiacentral2": 0.0304, + "australiaeast": 0.0304, + "australiasoutheast": 0.0304, + "brazilsouth": 0.0376, + "brazilsoutheast": 0.0477, + "canadacentral": 0.0267, + "canadaeast": 0.0273, + "centralindia": 0.0303, + "centralus": 0.029, + "eastasia": 0.0332, + "eastus": 0.0246, + "eastus2": 0.0246, + "francecentral": 0.03, + "francesouth": 0.0378, + "germanycentral": 0.02, + "germanynorth": 0.0352, + "germanynortheast": 0.02, + "germanywestcentral": 0.028, + "japaneast": 0.0312, + "japanwest": 0.034, + "koreacentral": 0.0321, + "koreasouth": 0.0291, + "northcentralus": 0.0248, + "northeurope": 0.0262, + "norwayeast": 0.0304, + "norwaywest": 0.0383, + "southafricanorth": 0.0299, + "southafricawest": 0.0369, + "southcentralus": 0.029, + "southeastasia": 0.0304, + "southindia": 0.0333, + "switzerlandnorth": 0.0328, + "switzerlandwest": 0.0414, + "uaecentral": 0.0344, + "uaenorth": 0.027, + "uksouth": 0.0276, + "ukwest": 0.0275, + "usgovarizona": 0.0285, + "usgovtexas": 0.0285, + "usgovvirginia": 0.0285, + "westcentralus": 0.029, + "westeurope": 0.0277, + "westindia": 0.0336, + "westus": 0.0288, + "westus2": 0.0248 + }, + "standardb1s": { + "australiacentral": 0.0172, + "australiacentral2": 0.0172, + "australiaeast": 0.0172, + "australiasoutheast": 0.0172, + "brazilsouth": 0.0208, + "brazilsoutheast": 0.0258, + "canadacentral": 0.0156, + "canadaeast": 0.0156, + "centralindia": 0.0174, + "centralus": 0.0165, + "eastasia": 0.0186, + "eastus": 0.014, + "eastus2": 0.014, + "francecentral": 0.017, + "francesouth": 0.0209, + "germanycentral": 0.01125, + "germanynorth": 0.0196, + "germanynortheast": 0.01125, + "germanywestcentral": 0.016, + "japaneast": 0.0176, + "japanwest": 0.019, + "koreacentral": 0.018, + "koreasouth": 0.0166, + "northcentralus": 0.0144, + "northeurope": 0.0153, + "norwayeast": 0.0172, + "norwaywest": 0.0212, + "southafricanorth": 0.0159, + "southafricawest": 0.0195, + "southcentralus": 0.0165, + "southeastasia": 0.0172, + "southindia": 0.0191, + "switzerlandnorth": 0.0184, + "switzerlandwest": 0.0227, + "uaecentral": 0.0182, + "uaenorth": 0.0145, + "uksouth": 0.0158, + "ukwest": 0.0158, + "usgovarizona": 0.0157, + "usgovtexas": 0.0157, + "usgovvirginia": 0.0157, + "westcentralus": 0.0165, + "westeurope": 0.016, + "westindia": 0.0193, + "westus": 0.0164, + "westus2": 0.0144 + }, + "standardb2ms": { + "australiacentral": 0.114, + "australiacentral2": 0.114, + "australiaeast": 0.114, + "australiasoutheast": 0.114, + "brazilsouth": 0.142, + "brazilsoutheast": 0.183, + "canadacentral": 0.101, + "canadaeast": 0.101, + "centralindia": 0.121, + "centralus": 0.108, + "eastasia": 0.125, + "eastus": 0.0912, + "eastus2": 0.0912, + "francecentral": 0.112, + "francesouth": 0.143, + "germanycentral": 0.07625, + "germanynorth": 0.133, + "germanynortheast": 0.07625, + "germanywestcentral": 0.104, + "japaneast": 0.117, + "japanwest": 0.128, + "koreacentral": 0.12, + "koreasouth": 0.116, + "northcentralus": 0.0912, + "northeurope": 0.0992, + "norwayeast": 0.114, + "norwaywest": 0.145, + "southafricanorth": 0.119, + "southafricawest": 0.148, + "southcentralus": 0.108, + "southeastasia": 0.114, + "southindia": 0.133, + "switzerlandnorth": 0.123, + "switzerlandwest": 0.158, + "uaecentral": 0.133, + "uaenorth": 0.108, + "uksouth": 0.102, + "ukwest": 0.102, + "usgovarizona": 0.114, + "usgovtexas": 0.114, + "usgovvirginia": 0.114, + "westcentralus": 0.108, + "westeurope": 0.104, + "westindia": 0.133, + "westus": 0.107, + "westus2": 0.0912 + }, + "standardb2s": { + "australiacentral": 0.0608, + "australiacentral2": 0.0608, + "australiaeast": 0.0608, + "australiasoutheast": 0.0608, + "brazilsouth": 0.0752, + "brazilsoutheast": 0.0954, + "canadacentral": 0.0544, + "canadaeast": 0.0546, + "centralindia": 0.0662, + "centralus": 0.0579, + "eastasia": 0.0664, + "eastus": 0.0496, + "eastus2": 0.0496, + "francecentral": 0.06, + "francesouth": 0.0756, + "germanycentral": 0.04125, + "germanynorth": 0.0704, + "germanynortheast": 0.04125, + "germanywestcentral": 0.056, + "japaneast": 0.0624, + "japanwest": 0.0679, + "koreacentral": 0.0642, + "koreasouth": 0.0642, + "northcentralus": 0.0496, + "northeurope": 0.0536, + "norwayeast": 0.0608, + "norwaywest": 0.0766, + "southafricanorth": 0.0637, + "southafricawest": 0.0779, + "southcentralus": 0.0579, + "southeastasia": 0.0608, + "southindia": 0.0704, + "switzerlandnorth": 0.0656, + "switzerlandwest": 0.0829, + "uaecentral": 0.0704, + "uaenorth": 0.0579, + "uksouth": 0.0552, + "ukwest": 0.055, + "usgovarizona": 0.0825, + "usgovtexas": 0.0825, + "usgovvirginia": 0.0825, + "westcentralus": 0.0579, + "westeurope": 0.056, + "westindia": 0.0704, + "westus": 0.0576, + "westus2": 0.0496 + }, + "standardb4ms": { + "australiacentral": 0.227, + "australiacentral2": 0.227, + "australiaeast": 0.227, + "australiasoutheast": 0.227, + "brazilsouth": 0.285, + "brazilsoutheast": 0.365, + "canadacentral": 0.202, + "canadaeast": 0.202, + "centralindia": 0.242, + "centralus": 0.216, + "eastasia": 0.25, + "eastus": 0.182, + "eastus2": 0.182, + "francecentral": 0.224, + "francesouth": 0.286, + "germanycentral": 0.14375, + "germanynorth": 0.266, + "germanynortheast": 0.14375, + "germanywestcentral": 0.208, + "japaneast": 0.234, + "japanwest": 0.256, + "koreacentral": 0.241, + "koreasouth": 0.233, + "northcentralus": 0.182, + "northeurope": 0.198, + "norwayeast": 0.227, + "norwaywest": 0.291, + "southafricanorth": 0.239, + "southafricawest": 0.296, + "southcentralus": 0.216, + "southeastasia": 0.227, + "southindia": 0.266, + "switzerlandnorth": 0.246, + "switzerlandwest": 0.316, + "uaecentral": 0.266, + "uaenorth": 0.216, + "uksouth": 0.205, + "ukwest": 0.204, + "usgovarizona": 0.228, + "usgovtexas": 0.228, + "usgovvirginia": 0.228, + "westcentralus": 0.216, + "westeurope": 0.208, + "westindia": 0.266, + "westus": 0.214, + "westus2": 0.182 + }, + "standardb8ms": { + "australiacentral": 0.454, + "australiacentral2": 0.454, + "australiaeast": 0.454, + "australiasoutheast": 0.455, + "brazilsouth": 0.57, + "brazilsoutheast": 0.731, + "canadacentral": 0.403, + "canadaeast": 0.405, + "centralindia": 0.484, + "centralus": 0.431, + "eastasia": 0.499, + "eastus": 0.365, + "eastus2": 0.365, + "francecentral": 0.448, + "francesouth": 0.573, + "germanycentral": 0.27375, + "germanynorth": 0.531, + "germanynortheast": 0.27375, + "germanywestcentral": 0.416, + "japaneast": 0.467, + "japanwest": 0.511, + "koreacentral": 0.481, + "koreasouth": 0.465, + "northcentralus": 0.365, + "northeurope": 0.397, + "norwayeast": 0.454, + "norwaywest": 0.581, + "southafricanorth": 0.478, + "southafricawest": 0.591, + "southcentralus": 0.431, + "southeastasia": 0.454, + "southindia": 0.531, + "switzerlandnorth": 0.493, + "switzerlandwest": 0.631, + "uaecentral": 0.531, + "uaenorth": 0.431, + "uksouth": 0.41, + "ukwest": 0.408, + "usgovarizona": 0.5475, + "usgovtexas": 0.5475, + "usgovvirginia": 0.5475, + "westcentralus": 0.431, + "westeurope": 0.416, + "westindia": 0.531, + "westus": 0.429, + "westus2": 0.365 + }, + "standardb12ms": { + "australiacentral": 0.682, + "australiacentral2": 0.682, + "australiaeast": 0.682, + "australiasoutheast": 0.682, + "brazilsouth": 0.854, + "brazilsoutheast": 1.096, + "canadacentral": 0.604, + "canadaeast": 0.607, + "centralindia": 0.586, + "centralus": 0.647, + "eastasia": 0.749, + "eastus": 0.547, + "eastus2": 0.547, + "francecentral": 0.614, + "francesouth": 0.859, + "germanycentral": 0.401, + "germanynorth": 0.797, + "germanynortheast": 0.401, + "germanywestcentral": 0.624, + "japaneast": 0.701, + "japanwest": 0.767, + "koreacentral": 0.672, + "koreasouth": 0.67, + "northcentralus": 0.547, + "northeurope": 0.594, + "norwayeast": 0.682, + "norwaywest": 0.872, + "southafricanorth": 0.717, + "southafricawest": 0.887, + "southcentralus": 0.647, + "southeastasia": 0.682, + "southindia": 0.754, + "switzerlandnorth": 0.74, + "switzerlandwest": 0.947, + "uaecentral": 0.797, + "uaenorth": 0.647, + "uksouth": 0.614, + "ukwest": 0.612, + "usgovarizona": 0.633, + "usgovtexas": 0.633, + "usgovvirginia": 0.633, + "westcentralus": 0.647, + "westeurope": 0.624, + "westindia": 0.762, + "westus": 0.643, + "westus2": 0.547 + }, + "standardb16ms": { + "australiacentral": 0.909, + "australiacentral2": 0.909, + "australiaeast": 0.909, + "australiasoutheast": 0.909, + "brazilsouth": 1.139, + "brazilsoutheast": 1.462, + "canadacentral": 0.806, + "canadaeast": 0.809, + "centralindia": 0.781, + "centralus": 0.863, + "eastasia": 0.998, + "eastus": 0.73, + "eastus2": 0.73, + "francecentral": 0.819, + "francesouth": 1.146, + "germanycentral": 0.534, + "germanynorth": 1.062, + "germanynortheast": 0.534, + "germanywestcentral": 0.832, + "japaneast": 0.934, + "japanwest": 1.022, + "koreacentral": 0.896, + "koreasouth": 0.894, + "northcentralus": 0.73, + "northeurope": 0.792, + "norwayeast": 0.909, + "norwaywest": 1.162, + "southafricanorth": 0.956, + "southafricawest": 1.182, + "southcentralus": 0.863, + "southeastasia": 0.909, + "southindia": 1.005, + "switzerlandnorth": 0.986, + "switzerlandwest": 1.262, + "uaecentral": 1.062, + "uaenorth": 0.863, + "uksouth": 0.819, + "ukwest": 0.816, + "usgovarizona": 0.844, + "usgovtexas": 0.844, + "usgovvirginia": 0.844, + "westcentralus": 0.863, + "westeurope": 0.832, + "westindia": 1.015, + "westus": 0.858, + "westus2": 0.73 + }, + "standardb20ms": { + "australiacentral": 1.136, + "australiacentral2": 1.136, + "australiaeast": 1.136, + "australiasoutheast": 1.137, + "brazilsouth": 1.424, + "brazilsoutheast": 1.827, + "canadacentral": 1.007, + "canadaeast": 1.012, + "centralindia": 0.976, + "centralus": 1.078, + "eastasia": 1.248, + "eastus": 0.912, + "eastus2": 0.912, + "francecentral": 1.024, + "francesouth": 1.432, + "germanycentral": 0.668, + "germanynorth": 1.328, + "germanynortheast": 0.668, + "germanywestcentral": 1.04, + "japaneast": 1.168, + "japanwest": 1.278, + "koreacentral": 1.12, + "koreasouth": 1.117, + "northcentralus": 0.912, + "northeurope": 0.989, + "norwayeast": 1.136, + "norwaywest": 1.453, + "southafricanorth": 1.195, + "southafricawest": 1.478, + "southcentralus": 1.078, + "southeastasia": 1.136, + "southindia": 1.257, + "switzerlandnorth": 1.233, + "switzerlandwest": 1.578, + "uaecentral": 1.328, + "uaenorth": 1.078, + "uksouth": 1.024, + "ukwest": 1.02, + "usgovarizona": 1.055, + "usgovtexas": 1.055, + "usgovvirginia": 1.055, + "westcentralus": 1.078, + "westeurope": 1.04, + "westindia": 1.269, + "westus": 1.072, + "westus2": 0.912 + }, + "standardd1": { + "australiaeast": 0.156, + "australiasoutheast": 0.156, + "brazilsouth": 0.158, + "brazilsoutheast": 0.17, + "centralus": 0.14, + "eastasia": 0.185, + "eastus": 0.14, + "eastus2": 0.13, + "japaneast": 0.168, + "japanwest": 0.146, + "northcentralus": 0.14, + "northeurope": 0.129, + "southafricanorth": 0.136, + "southafricawest": 0.159, + "southcentralus": 0.13, + "southeastasia": 0.161, + "uaecentral": 0.151, + "uaenorth": 0.126, + "usgovvirginia": 0.153, + "westeurope": 0.148, + "westus": 0.14 + }, + "standardd1s": { + "australiaeast": 0.156, + "australiasoutheast": 0.156, + "brazilsouth": 0.158, + "brazilsoutheast": 0.17, + "centralus": 0.14, + "eastasia": 0.185, + "eastus": 0.14, + "eastus2": 0.13, + "japaneast": 0.168, + "japanwest": 0.146, + "northcentralus": 0.14, + "northeurope": 0.129, + "southafricanorth": 0.136, + "southafricawest": 0.159, + "southcentralus": 0.13, + "southeastasia": 0.161, + "uaecentral": 0.151, + "uaenorth": 0.126, + "usgovvirginia": 0.153, + "westeurope": 0.148, + "westus": 0.14 + }, + "standardd1v2": { + "australiacentral": 0.14, + "australiacentral2": 0.14, + "australiaeast": 0.14, + "australiasoutheast": 0.14, + "brazilsouth": 0.132, + "brazilsoutheast": 0.157, + "canadacentral": 0.129, + "canadaeast": 0.129, + "centralindia": 0.13, + "centralus": 0.126, + "eastasia": 0.167, + "eastus": 0.126, + "eastus2": 0.117, + "francecentral": 0.147, + "francesouth": 0.191, + "germanycentral": 0.1439, + "germanynorth": 0.133, + "germanynortheast": 0.1439, + "germanywestcentral": 0.142, + "japaneast": 0.136, + "japanwest": 0.131, + "koreacentral": 0.129, + "koreasouth": 0.116, + "northcentralus": 0.126, + "northeurope": 0.116, + "norwayeast": 0.121, + "norwaywest": 0.143, + "southafricanorth": 0.123, + "southafricawest": 0.142, + "southcentralus": 0.117, + "southeastasia": 0.145, + "southindia": 0.13, + "switzerlandnorth": 0.128, + "switzerlandwest": 0.152, + "uaecentral": 0.135, + "uaenorth": 0.115, + "uksouth": 0.147, + "ukwest": 0.147, + "usgovarizona": 0.146, + "usgovtexas": 0.146, + "usgovvirginia": 0.146, + "westcentralus": 0.117, + "westeurope": 0.133, + "westindia": 0.13, + "westus": 0.126, + "westus2": 0.117 + }, + "standardd2": { + "australiaeast": 0.312, + "australiasoutheast": 0.312, + "brazilsouth": 0.316, + "brazilsoutheast": 0.339, + "centralus": 0.28, + "eastasia": 0.37, + "eastus": 0.28, + "eastus2": 0.26, + "japaneast": 0.336, + "japanwest": 0.292, + "northcentralus": 0.28, + "northeurope": 0.258, + "southafricanorth": 0.272, + "southafricawest": 0.317, + "southcentralus": 0.26, + "southeastasia": 0.322, + "uaecentral": 0.301, + "uaenorth": 0.253, + "usgovvirginia": 0.307, + "westeurope": 0.297, + "westus": 0.28 + }, + "standardd2asv4": { + "australiaeast": 0.212, + "brazilsouth": 0.245, + "centralindia": 0.193, + "centralus": 0.2, + "eastasia": 0.224, + "eastus": 0.188, + "eastus2": 0.188, + "francecentral": 0.204, + "japaneast": 0.216, + "koreacentral": 0.21, + "northeurope": 0.199, + "southcentralus": 0.207, + "southeastasia": 0.212, + "uksouth": 0.203, + "westeurope": 0.207, + "westus": 0.204, + "westus2": 0.188 + }, + "standardd2av4": { + "australiaeast": 0.212, + "brazilsouth": 0.245, + "centralindia": 0.193, + "centralus": 0.2, + "eastasia": 0.224, + "eastus": 0.188, + "eastus2": 0.188, + "francecentral": 0.204, + "japaneast": 0.216, + "koreacentral": 0.21, + "northeurope": 0.199, + "southcentralus": 0.207, + "southeastasia": 0.212, + "uksouth": 0.203, + "westeurope": 0.207, + "westus": 0.204, + "westus2": 0.188 + }, + "standardd2dsv4": { + "australiaeast": 0.234, + "australiasoutheast": 0.228, + "brazilsouth": 0.272, + "canadacentral": 0.218, + "canadaeast": 0.228, + "centralindia": 0.214, + "centralus": 0.22, + "eastasia": 0.267, + "eastus": 0.205, + "eastus2": 0.205, + "francecentral": 0.224, + "francesouth": 0.264, + "germanywestcentral": 0.228, + "japaneast": 0.238, + "japanwest": 0.253, + "koreacentral": 0.231, + "northcentralus": 0.205, + "northeurope": 0.218, + "southafricanorth": 0.243, + "southcentralus": 0.239, + "southeastasia": 0.233, + "switzerlandnorth": 0.262, + "uksouth": 0.223, + "ukwest": 0.229, + "usgovarizona": 0.235, + "usgovtexas": 0.233, + "usgovvirginia": 0.235, + "westcentralus": 0.228, + "westeurope": 0.228, + "westus": 0.225, + "westus2": 0.205 + }, + "standardd2dv4": { + "australiaeast": 0.234, + "australiasoutheast": 0.228, + "brazilsouth": 0.272, + "canadacentral": 0.218, + "canadaeast": 0.228, + "centralindia": 0.214, + "centralus": 0.22, + "eastasia": 0.267, + "eastus": 0.205, + "eastus2": 0.205, + "francecentral": 0.224, + "francesouth": 0.264, + "germanywestcentral": 0.228, + "japaneast": 0.238, + "japanwest": 0.253, + "koreacentral": 0.231, + "northcentralus": 0.205, + "northeurope": 0.218, + "southafricanorth": 0.243, + "southcentralus": 0.239, + "southeastasia": 0.233, + "switzerlandnorth": 0.262, + "uksouth": 0.223, + "ukwest": 0.229, + "usgovarizona": 0.235, + "usgovtexas": 0.233, + "usgovvirginia": 0.235, + "westcentralus": 0.228, + "westeurope": 0.228, + "westus": 0.225, + "westus2": 0.205 + }, + "standardd2s": { + "australiaeast": 0.312, + "australiasoutheast": 0.312, + "brazilsouth": 0.316, + "brazilsoutheast": 0.339, + "centralus": 0.28, + "eastasia": 0.37, + "eastus": 0.28, + "eastus2": 0.26, + "japaneast": 0.336, + "japanwest": 0.292, + "northcentralus": 0.28, + "northeurope": 0.258, + "southafricanorth": 0.272, + "southafricawest": 0.317, + "southcentralus": 0.26, + "southeastasia": 0.322, + "uaecentral": 0.301, + "uaenorth": 0.253, + "usgovvirginia": 0.307, + "westeurope": 0.297, + "westus": 0.28 + }, + "standardd2sv3": { + "australiacentral": 0.217, + "australiacentral2": 0.217, + "australiaeast": 0.217, + "australiasoutheast": 0.217, + "brazilsouth": 0.251, + "brazilsoutheast": 0.299, + "canadacentral": 0.203, + "canadaeast": 0.203, + "centralindia": 0.197, + "centralus": 0.211, + "eastasia": 0.224, + "eastus": 0.188, + "eastus2": 0.188, + "francecentral": 0.204, + "francesouth": 0.265, + "germanycentral": 0.229, + "germanynorth": 0.242, + "germanynortheast": 0.229, + "germanywestcentral": 0.207, + "japaneast": 0.221, + "japanwest": 0.221, + "koreacentral": 0.215, + "koreasouth": 0.193, + "northcentralus": 0.192, + "northeurope": 0.199, + "norwayeast": 0.224, + "norwaywest": 0.264, + "southafricanorth": 0.226, + "southafricawest": 0.26, + "southcentralus": 0.211, + "southeastasia": 0.217, + "southindia": 0.237, + "switzerlandnorth": 0.236, + "switzerlandwest": 0.279, + "uaecentral": 0.248, + "uaenorth": 0.212, + "uksouth": 0.208, + "ukwest": 0.208, + "usgovarizona": 0.218, + "usgovtexas": 0.218, + "usgovvirginia": 0.218, + "westcentralus": 0.211, + "westeurope": 0.212, + "westindia": 0.215, + "westus": 0.209, + "westus2": 0.188 + }, + "standardd2sv4": { + "australiaeast": 0.212, + "australiasoutheast": 0.217, + "brazilsouth": 0.245, + "brazilsoutheast": 0.291, + "canadacentral": 0.199, + "canadaeast": 0.199, + "centralindia": 0.193, + "centralus": 0.2, + "eastasia": 0.241, + "eastus": 0.188, + "eastus2": 0.188, + "francecentral": 0.204, + "francesouth": 0.238, + "germanywestcentral": 0.207, + "japaneast": 0.216, + "japanwest": 0.228, + "koreacentral": 0.21, + "northcentralus": 0.188, + "northeurope": 0.199, + "southafricanorth": 0.221, + "southcentralus": 0.207, + "southeastasia": 0.212, + "switzerlandnorth": 0.236, + "uksouth": 0.203, + "ukwest": 0.208, + "usgovarizona": 0.213, + "usgovtexas": 0.212, + "usgovvirginia": 0.213, + "westcentralus": 0.207, + "westeurope": 0.207, + "westus": 0.204, + "westus2": 0.188 + }, + "standardd2v2": { + "australiacentral": 0.281, + "australiacentral2": 0.281, + "australiaeast": 0.281, + "australiasoutheast": 0.281, + "brazilsouth": 0.263, + "brazilsoutheast": 0.315, + "canadacentral": 0.257, + "canadaeast": 0.257, + "centralindia": 0.261, + "centralus": 0.252, + "eastasia": 0.333, + "eastus": 0.252, + "eastus2": 0.234, + "francecentral": 0.294, + "francesouth": 0.382, + "germanycentral": 0.2878, + "germanynorth": 0.266, + "germanynortheast": 0.2878, + "germanywestcentral": 0.284, + "japaneast": 0.273, + "japanwest": 0.263, + "koreacentral": 0.257, + "koreasouth": 0.231, + "northcentralus": 0.252, + "northeurope": 0.232, + "norwayeast": 0.242, + "norwaywest": 0.286, + "southafricanorth": 0.245, + "southafricawest": 0.284, + "southcentralus": 0.234, + "southeastasia": 0.29, + "southindia": 0.261, + "switzerlandnorth": 0.255, + "switzerlandwest": 0.304, + "uaecentral": 0.271, + "uaenorth": 0.229, + "uksouth": 0.294, + "ukwest": 0.294, + "usgovarizona": 0.293, + "usgovtexas": 0.293, + "usgovvirginia": 0.293, + "westcentralus": 0.234, + "westeurope": 0.266, + "westindia": 0.261, + "westus": 0.252, + "westus2": 0.234 + }, + "standardd2v3": { + "australiacentral": 0.217, + "australiacentral2": 0.217, + "australiaeast": 0.217, + "australiasoutheast": 0.217, + "brazilsouth": 0.251, + "brazilsoutheast": 0.299, + "canadacentral": 0.203, + "canadaeast": 0.203, + "centralindia": 0.197, + "centralus": 0.211, + "eastasia": 0.224, + "eastus": 0.188, + "eastus2": 0.188, + "francecentral": 0.204, + "francesouth": 0.265, + "germanycentral": 0.229, + "germanynorth": 0.242, + "germanynortheast": 0.229, + "germanywestcentral": 0.207, + "japaneast": 0.221, + "japanwest": 0.221, + "koreacentral": 0.215, + "koreasouth": 0.193, + "northcentralus": 0.192, + "northeurope": 0.199, + "norwayeast": 0.224, + "norwaywest": 0.264, + "southafricanorth": 0.226, + "southafricawest": 0.26, + "southcentralus": 0.211, + "southeastasia": 0.217, + "southindia": 0.237, + "switzerlandnorth": 0.236, + "switzerlandwest": 0.279, + "uaecentral": 0.248, + "uaenorth": 0.212, + "uksouth": 0.208, + "ukwest": 0.208, + "usgovarizona": 0.218, + "usgovtexas": 0.218, + "usgovvirginia": 0.218, + "westcentralus": 0.211, + "westeurope": 0.212, + "westindia": 0.215, + "westus": 0.209, + "westus2": 0.188 + }, + "standardd2v4": { + "australiaeast": 0.212, + "australiasoutheast": 0.217, + "brazilsouth": 0.245, + "brazilsoutheast": 0.291, + "canadacentral": 0.199, + "canadaeast": 0.199, + "centralindia": 0.193, + "centralus": 0.2, + "eastasia": 0.241, + "eastus": 0.188, + "eastus2": 0.188, + "francecentral": 0.204, + "francesouth": 0.238, + "germanywestcentral": 0.207, + "japaneast": 0.216, + "japanwest": 0.228, + "koreacentral": 0.21, + "northcentralus": 0.188, + "northeurope": 0.199, + "southafricanorth": 0.221, + "southcentralus": 0.207, + "southeastasia": 0.212, + "switzerlandnorth": 0.236, + "uksouth": 0.203, + "ukwest": 0.208, + "usgovarizona": 0.213, + "usgovtexas": 0.212, + "usgovvirginia": 0.213, + "westcentralus": 0.207, + "westeurope": 0.207, + "westus": 0.204, + "westus2": 0.188 + }, + "standardd3": { + "australiaeast": 0.624, + "australiasoutheast": 0.624, + "brazilsouth": 0.632, + "brazilsoutheast": 0.678, + "centralus": 0.56, + "eastasia": 0.741, + "eastus": 0.56, + "eastus2": 0.52, + "japaneast": 0.672, + "japanwest": 0.584, + "northcentralus": 0.56, + "northeurope": 0.516, + "southafricanorth": 0.543, + "southafricawest": 0.634, + "southcentralus": 0.52, + "southeastasia": 0.644, + "uaecentral": 0.602, + "uaenorth": 0.506, + "usgovvirginia": 0.6138, + "westeurope": 0.593, + "westus": 0.56 + }, + "standardd3s": { + "australiaeast": 0.624, + "australiasoutheast": 0.624, + "brazilsouth": 0.632, + "brazilsoutheast": 0.678, + "centralus": 0.56, + "eastasia": 0.741, + "eastus": 0.56, + "eastus2": 0.52, + "japaneast": 0.672, + "japanwest": 0.584, + "northcentralus": 0.56, + "northeurope": 0.516, + "southafricanorth": 0.543, + "southafricawest": 0.634, + "southcentralus": 0.52, + "southeastasia": 0.644, + "uaecentral": 0.602, + "uaenorth": 0.506, + "usgovvirginia": 0.6138, + "westeurope": 0.593, + "westus": 0.56 + }, + "standardd3v2": { + "australiacentral": 0.562, + "australiacentral2": 0.562, + "australiaeast": 0.562, + "australiasoutheast": 0.562, + "brazilsouth": 0.527, + "brazilsoutheast": 0.629, + "canadacentral": 0.515, + "canadaeast": 0.515, + "centralindia": 0.521, + "centralus": 0.504, + "eastasia": 0.667, + "eastus": 0.504, + "eastus2": 0.468, + "francecentral": 0.588, + "francesouth": 0.764, + "germanycentral": 0.5757, + "germanynorth": 0.532, + "germanynortheast": 0.5757, + "germanywestcentral": 0.567, + "japaneast": 0.546, + "japanwest": 0.526, + "koreacentral": 0.514, + "koreasouth": 0.463, + "northcentralus": 0.504, + "northeurope": 0.465, + "norwayeast": 0.483, + "norwaywest": 0.573, + "southafricanorth": 0.491, + "southafricawest": 0.569, + "southcentralus": 0.468, + "southeastasia": 0.58, + "southindia": 0.521, + "switzerlandnorth": 0.51, + "switzerlandwest": 0.608, + "uaecentral": 0.541, + "uaenorth": 0.459, + "uksouth": 0.588, + "ukwest": 0.588, + "usgovarizona": 0.585, + "usgovtexas": 0.585, + "usgovvirginia": 0.585, + "westcentralus": 0.468, + "westeurope": 0.533, + "westindia": 0.521, + "westus": 0.504, + "westus2": 0.468 + }, + "standardd4": { + "australiaeast": 1.248, + "australiasoutheast": 1.248, + "brazilsouth": 1.264, + "brazilsoutheast": 1.356, + "centralus": 1.12, + "eastasia": 1.481, + "eastus": 1.12, + "eastus2": 1.04, + "japaneast": 1.343, + "japanwest": 1.168, + "northcentralus": 1.12, + "northeurope": 1.032, + "southafricanorth": 1.086, + "southafricawest": 1.268, + "southcentralus": 1.04, + "southeastasia": 1.288, + "uaecentral": 1.204, + "uaenorth": 1.011, + "usgovvirginia": 1.227, + "westeurope": 1.187, + "westus": 1.12 + }, + "standardd4asv4": { + "australiaeast": 0.424, + "brazilsouth": 0.49, + "centralindia": 0.386, + "centralus": 0.401, + "eastasia": 0.448, + "eastus": 0.376, + "eastus2": 0.376, + "francecentral": 0.408, + "japaneast": 0.432, + "koreacentral": 0.42, + "northeurope": 0.398, + "southcentralus": 0.414, + "southeastasia": 0.424, + "uksouth": 0.406, + "westeurope": 0.414, + "westus": 0.408, + "westus2": 0.376 + }, + "standardd4av4": { + "australiaeast": 0.424, + "brazilsouth": 0.49, + "centralindia": 0.386, + "centralus": 0.401, + "eastasia": 0.448, + "eastus": 0.376, + "eastus2": 0.376, + "francecentral": 0.408, + "japaneast": 0.432, + "koreacentral": 0.42, + "northeurope": 0.398, + "southcentralus": 0.414, + "southeastasia": 0.424, + "uksouth": 0.406, + "westeurope": 0.414, + "westus": 0.408, + "westus2": 0.376 + }, + "standardd4dsv4": { + "australiaeast": 0.468, + "australiasoutheast": 0.455, + "brazilsouth": 0.544, + "canadacentral": 0.436, + "canadaeast": 0.455, + "centralindia": 0.428, + "centralus": 0.439, + "eastasia": 0.534, + "eastus": 0.41, + "eastus2": 0.41, + "francecentral": 0.448, + "francesouth": 0.528, + "germanywestcentral": 0.456, + "japaneast": 0.476, + "japanwest": 0.505, + "koreacentral": 0.462, + "northcentralus": 0.41, + "northeurope": 0.436, + "southafricanorth": 0.487, + "southcentralus": 0.478, + "southeastasia": 0.466, + "switzerlandnorth": 0.523, + "uksouth": 0.446, + "ukwest": 0.457, + "usgovarizona": 0.47, + "usgovtexas": 0.466, + "usgovvirginia": 0.47, + "westcentralus": 0.455, + "westeurope": 0.456, + "westus": 0.45, + "westus2": 0.41 + }, + "standardd4dv4": { + "australiaeast": 0.468, + "australiasoutheast": 0.455, + "brazilsouth": 0.544, + "canadacentral": 0.436, + "canadaeast": 0.455, + "centralindia": 0.428, + "centralus": 0.439, + "eastasia": 0.534, + "eastus": 0.41, + "eastus2": 0.41, + "francecentral": 0.448, + "francesouth": 0.528, + "germanywestcentral": 0.456, + "japaneast": 0.476, + "japanwest": 0.505, + "koreacentral": 0.462, + "northcentralus": 0.41, + "northeurope": 0.436, + "southafricanorth": 0.487, + "southcentralus": 0.478, + "southeastasia": 0.466, + "switzerlandnorth": 0.523, + "uksouth": 0.446, + "ukwest": 0.457, + "usgovarizona": 0.47, + "usgovtexas": 0.466, + "usgovvirginia": 0.47, + "westcentralus": 0.455, + "westeurope": 0.456, + "westus": 0.45, + "westus2": 0.41 + }, + "standardd4s": { + "australiaeast": 1.248, + "australiasoutheast": 1.248, + "brazilsouth": 1.264, + "brazilsoutheast": 1.356, + "centralus": 1.12, + "eastasia": 1.481, + "eastus": 1.12, + "eastus2": 1.04, + "japaneast": 1.343, + "japanwest": 1.168, + "northcentralus": 1.12, + "northeurope": 1.032, + "southafricanorth": 1.086, + "southafricawest": 1.268, + "southcentralus": 1.04, + "southeastasia": 1.288, + "uaecentral": 1.204, + "uaenorth": 1.011, + "usgovvirginia": 1.227, + "westeurope": 1.187, + "westus": 1.12 + }, + "standardd4sv3": { + "australiacentral": 0.434, + "australiacentral2": 0.434, + "australiaeast": 0.434, + "australiasoutheast": 0.434, + "brazilsouth": 0.502, + "brazilsoutheast": 0.597, + "canadacentral": 0.406, + "canadaeast": 0.406, + "centralindia": 0.394, + "centralus": 0.422, + "eastasia": 0.448, + "eastus": 0.376, + "eastus2": 0.376, + "francecentral": 0.408, + "francesouth": 0.53, + "germanycentral": 0.458, + "germanynorth": 0.483, + "germanynortheast": 0.458, + "germanywestcentral": 0.414, + "japaneast": 0.442, + "japanwest": 0.442, + "koreacentral": 0.43, + "koreasouth": 0.387, + "northcentralus": 0.384, + "northeurope": 0.398, + "norwayeast": 0.448, + "norwaywest": 0.527, + "southafricanorth": 0.452, + "southafricawest": 0.52, + "southcentralus": 0.422, + "southeastasia": 0.434, + "southindia": 0.473, + "switzerlandnorth": 0.472, + "switzerlandwest": 0.558, + "uaecentral": 0.496, + "uaenorth": 0.424, + "uksouth": 0.416, + "ukwest": 0.416, + "usgovarizona": 0.436, + "usgovtexas": 0.436, + "usgovvirginia": 0.436, + "westcentralus": 0.422, + "westeurope": 0.424, + "westindia": 0.43, + "westus": 0.418, + "westus2": 0.376 + }, + "standardd4sv4": { + "australiaeast": 0.424, + "australiasoutheast": 0.434, + "brazilsouth": 0.49, + "brazilsoutheast": 0.582, + "canadacentral": 0.398, + "canadaeast": 0.398, + "centralindia": 0.386, + "centralus": 0.401, + "eastasia": 0.482, + "eastus": 0.376, + "eastus2": 0.376, + "francecentral": 0.408, + "francesouth": 0.476, + "germanywestcentral": 0.414, + "japaneast": 0.432, + "japanwest": 0.457, + "koreacentral": 0.42, + "northcentralus": 0.376, + "northeurope": 0.398, + "southafricanorth": 0.441, + "southcentralus": 0.414, + "southeastasia": 0.424, + "switzerlandnorth": 0.472, + "uksouth": 0.406, + "ukwest": 0.416, + "usgovarizona": 0.426, + "usgovtexas": 0.424, + "usgovvirginia": 0.426, + "westcentralus": 0.414, + "westeurope": 0.414, + "westus": 0.408, + "westus2": 0.376 + }, + "standardd4v2": { + "australiacentral": 1.123, + "australiacentral2": 1.123, + "australiaeast": 1.123, + "australiasoutheast": 1.123, + "brazilsouth": 1.053, + "brazilsoutheast": 1.258, + "canadacentral": 1.03, + "canadaeast": 1.03, + "centralindia": 1.043, + "centralus": 1.008, + "eastasia": 1.333, + "eastus": 1.008, + "eastus2": 0.936, + "francecentral": 1.176, + "francesouth": 1.528, + "germanycentral": 1.151, + "germanynorth": 1.065, + "germanynortheast": 1.151, + "germanywestcentral": 1.136, + "japaneast": 1.091, + "japanwest": 1.051, + "koreacentral": 1.028, + "koreasouth": 0.925, + "northcentralus": 1.008, + "northeurope": 0.929, + "norwayeast": 0.966, + "norwaywest": 1.146, + "southafricanorth": 0.982, + "southafricawest": 1.137, + "southcentralus": 0.936, + "southeastasia": 1.159, + "southindia": 1.043, + "switzerlandnorth": 1.021, + "switzerlandwest": 1.217, + "uaecentral": 1.082, + "uaenorth": 0.918, + "uksouth": 1.176, + "ukwest": 1.176, + "usgovarizona": 1.17, + "usgovtexas": 1.17, + "usgovvirginia": 1.17, + "westcentralus": 0.936, + "westeurope": 1.066, + "westindia": 1.043, + "westus": 1.008, + "westus2": 0.936 + }, + "standardd4v3": { + "australiacentral": 0.434, + "australiacentral2": 0.434, + "australiaeast": 0.434, + "australiasoutheast": 0.434, + "brazilsouth": 0.502, + "brazilsoutheast": 0.597, + "canadacentral": 0.406, + "canadaeast": 0.406, + "centralindia": 0.394, + "centralus": 0.422, + "eastasia": 0.448, + "eastus": 0.376, + "eastus2": 0.376, + "francecentral": 0.408, + "francesouth": 0.53, + "germanycentral": 0.458, + "germanynorth": 0.483, + "germanynortheast": 0.458, + "germanywestcentral": 0.414, + "japaneast": 0.442, + "japanwest": 0.442, + "koreacentral": 0.43, + "koreasouth": 0.387, + "northcentralus": 0.384, + "northeurope": 0.398, + "norwayeast": 0.448, + "norwaywest": 0.527, + "southafricanorth": 0.452, + "southafricawest": 0.52, + "southcentralus": 0.422, + "southeastasia": 0.434, + "southindia": 0.473, + "switzerlandnorth": 0.472, + "switzerlandwest": 0.558, + "uaecentral": 0.496, + "uaenorth": 0.424, + "uksouth": 0.416, + "ukwest": 0.416, + "usgovarizona": 0.436, + "usgovtexas": 0.436, + "usgovvirginia": 0.436, + "westcentralus": 0.422, + "westeurope": 0.424, + "westindia": 0.43, + "westus": 0.418, + "westus2": 0.376 + }, + "standardd4v4": { + "australiaeast": 0.424, + "australiasoutheast": 0.434, + "brazilsouth": 0.49, + "brazilsoutheast": 0.582, + "canadacentral": 0.398, + "canadaeast": 0.398, + "centralindia": 0.386, + "centralus": 0.401, + "eastasia": 0.482, + "eastus": 0.376, + "eastus2": 0.376, + "francecentral": 0.408, + "francesouth": 0.476, + "germanywestcentral": 0.414, + "japaneast": 0.432, + "japanwest": 0.457, + "koreacentral": 0.42, + "northcentralus": 0.376, + "northeurope": 0.398, + "southafricanorth": 0.441, + "southcentralus": 0.414, + "southeastasia": 0.424, + "switzerlandnorth": 0.472, + "uksouth": 0.406, + "ukwest": 0.416, + "usgovarizona": 0.426, + "usgovtexas": 0.424, + "usgovvirginia": 0.426, + "westcentralus": 0.414, + "westeurope": 0.414, + "westus": 0.408, + "westus2": 0.376 + }, + "standardd5v2": { + "australiacentral": 2.245, + "australiacentral2": 2.245, + "australiaeast": 2.245, + "australiasoutheast": 2.245, + "brazilsouth": 2.106, + "brazilsoutheast": 2.516, + "canadacentral": 2.059, + "canadaeast": 2.059, + "centralindia": 2.086, + "centralus": 2.016, + "eastasia": 2.666, + "eastus": 2.016, + "eastus2": 1.872, + "francecentral": 2.351, + "francesouth": 3.056, + "germanycentral": 2.3026, + "germanynorth": 2.13, + "germanynortheast": 2.3026, + "germanywestcentral": 2.272, + "japaneast": 2.183, + "japanwest": 2.102, + "koreacentral": 2.057, + "koreasouth": 1.851, + "northcentralus": 2.016, + "northeurope": 1.858, + "norwayeast": 1.932, + "norwaywest": 2.29, + "southafricanorth": 1.963, + "southafricawest": 2.275, + "southcentralus": 1.872, + "southeastasia": 2.318, + "southindia": 2.086, + "switzerlandnorth": 2.042, + "switzerlandwest": 2.433, + "uaecentral": 2.165, + "uaenorth": 1.835, + "uksouth": 2.351, + "ukwest": 2.351, + "usgovarizona": 2.34, + "usgovtexas": 2.34, + "usgovvirginia": 2.34, + "westcentralus": 1.872, + "westeurope": 2.131, + "westindia": 2.086, + "westus": 2.016, + "westus2": 1.872 + }, + "standardd8asv4": { + "australiaeast": 0.848, + "brazilsouth": 0.98, + "centralindia": 0.772, + "centralus": 0.802, + "eastasia": 0.896, + "eastus": 0.752, + "eastus2": 0.752, + "francecentral": 0.816, + "japaneast": 0.864, + "koreacentral": 0.84, + "northeurope": 0.796, + "southcentralus": 0.829, + "southeastasia": 0.848, + "uksouth": 0.812, + "westeurope": 0.828, + "westus": 0.816, + "westus2": 0.752 + }, + "standardd8av4": { + "australiaeast": 0.848, + "brazilsouth": 0.98, + "centralindia": 0.772, + "centralus": 0.802, + "eastasia": 0.896, + "eastus": 0.752, + "eastus2": 0.752, + "francecentral": 0.816, + "japaneast": 0.864, + "koreacentral": 0.84, + "northeurope": 0.796, + "southcentralus": 0.829, + "southeastasia": 0.848, + "uksouth": 0.812, + "westeurope": 0.828, + "westus": 0.816, + "westus2": 0.752 + }, + "standardd8dsv4": { + "australiaeast": 0.936, + "australiasoutheast": 0.91, + "brazilsouth": 1.088, + "canadacentral": 0.872, + "canadaeast": 0.91, + "centralindia": 0.856, + "centralus": 0.879, + "eastasia": 1.069, + "eastus": 0.82, + "eastus2": 0.82, + "francecentral": 0.896, + "francesouth": 1.055, + "germanywestcentral": 0.912, + "japaneast": 0.952, + "japanwest": 1.01, + "koreacentral": 0.924, + "northcentralus": 0.82, + "northeurope": 0.872, + "southafricanorth": 0.974, + "southcentralus": 0.956, + "southeastasia": 0.932, + "switzerlandnorth": 1.046, + "uksouth": 0.892, + "ukwest": 0.915, + "usgovarizona": 0.94, + "usgovtexas": 0.933, + "usgovvirginia": 0.94, + "westcentralus": 0.91, + "westeurope": 0.912, + "westus": 0.9, + "westus2": 0.82 + }, + "standardd8dv4": { + "australiaeast": 0.936, + "australiasoutheast": 0.91, + "brazilsouth": 1.088, + "canadacentral": 0.872, + "canadaeast": 0.91, + "centralindia": 0.856, + "centralus": 0.879, + "eastasia": 1.069, + "eastus": 0.82, + "eastus2": 0.82, + "francecentral": 0.896, + "francesouth": 1.055, + "germanywestcentral": 0.912, + "japaneast": 0.952, + "japanwest": 1.01, + "koreacentral": 0.924, + "northcentralus": 0.82, + "northeurope": 0.872, + "southafricanorth": 0.974, + "southcentralus": 0.956, + "southeastasia": 0.932, + "switzerlandnorth": 1.046, + "uksouth": 0.892, + "ukwest": 0.915, + "usgovarizona": 0.94, + "usgovtexas": 0.933, + "usgovvirginia": 0.94, + "westcentralus": 0.91, + "westeurope": 0.912, + "westus": 0.9, + "westus2": 0.82 + }, + "standardd8sv3": { + "australiacentral": 0.868, + "australiacentral2": 0.868, + "australiaeast": 0.868, + "australiasoutheast": 0.868, + "brazilsouth": 1.004, + "brazilsoutheast": 1.195, + "canadacentral": 0.812, + "canadaeast": 0.812, + "centralindia": 0.788, + "centralus": 0.845, + "eastasia": 0.896, + "eastus": 0.752, + "eastus2": 0.752, + "francecentral": 0.816, + "francesouth": 1.0608, + "germanycentral": 0.916, + "germanynorth": 0.966, + "germanynortheast": 0.916, + "germanywestcentral": 0.828, + "japaneast": 0.884, + "japanwest": 0.884, + "koreacentral": 0.86, + "koreasouth": 0.774, + "northcentralus": 0.768, + "northeurope": 0.796, + "norwayeast": 0.896, + "norwaywest": 1.054, + "southafricanorth": 0.904, + "southafricawest": 1.04, + "southcentralus": 0.845, + "southeastasia": 0.868, + "southindia": 0.946, + "switzerlandnorth": 0.944, + "switzerlandwest": 1.117, + "uaecentral": 0.992, + "uaenorth": 0.848, + "uksouth": 0.832, + "ukwest": 0.832, + "usgovarizona": 0.872, + "usgovtexas": 0.872, + "usgovvirginia": 0.872, + "westcentralus": 0.845, + "westeurope": 0.848, + "westindia": 0.86, + "westus": 0.836, + "westus2": 0.752 + }, + "standardd8sv4": { + "australiaeast": 0.848, + "australiasoutheast": 0.867, + "brazilsouth": 0.98, + "brazilsoutheast": 1.163, + "canadacentral": 0.796, + "canadaeast": 0.796, + "centralindia": 0.772, + "centralus": 0.802, + "eastasia": 0.963, + "eastus": 0.752, + "eastus2": 0.752, + "francecentral": 0.816, + "francesouth": 0.952, + "germanywestcentral": 0.828, + "japaneast": 0.864, + "japanwest": 0.914, + "koreacentral": 0.84, + "northcentralus": 0.752, + "northeurope": 0.796, + "southafricanorth": 0.883, + "southcentralus": 0.829, + "southeastasia": 0.848, + "switzerlandnorth": 0.944, + "uksouth": 0.812, + "ukwest": 0.833, + "usgovarizona": 0.852, + "usgovtexas": 0.848, + "usgovvirginia": 0.852, + "westcentralus": 0.829, + "westeurope": 0.828, + "westus": 0.816, + "westus2": 0.752 + }, + "standardd8v3": { + "australiacentral": 0.868, + "australiacentral2": 0.868, + "australiaeast": 0.868, + "australiasoutheast": 0.868, + "brazilsouth": 1.004, + "brazilsoutheast": 1.195, + "canadacentral": 0.812, + "canadaeast": 0.812, + "centralindia": 0.788, + "centralus": 0.845, + "eastasia": 0.896, + "eastus": 0.752, + "eastus2": 0.752, + "francecentral": 0.816, + "francesouth": 1.0608, + "germanycentral": 0.916, + "germanynorth": 0.966, + "germanynortheast": 0.916, + "germanywestcentral": 0.828, + "japaneast": 0.884, + "japanwest": 0.884, + "koreacentral": 0.86, + "koreasouth": 0.774, + "northcentralus": 0.768, + "northeurope": 0.796, + "norwayeast": 0.896, + "norwaywest": 1.054, + "southafricanorth": 0.904, + "southafricawest": 1.04, + "southcentralus": 0.845, + "southeastasia": 0.868, + "southindia": 0.946, + "switzerlandnorth": 0.944, + "switzerlandwest": 1.117, + "uaecentral": 0.992, + "uaenorth": 0.848, + "uksouth": 0.832, + "ukwest": 0.832, + "usgovarizona": 0.872, + "usgovtexas": 0.872, + "usgovvirginia": 0.872, + "westcentralus": 0.845, + "westeurope": 0.848, + "westindia": 0.86, + "westus": 0.836, + "westus2": 0.752 + }, + "standardd8v4": { + "australiaeast": 0.848, + "australiasoutheast": 0.867, + "brazilsouth": 0.98, + "brazilsoutheast": 1.163, + "canadacentral": 0.796, + "canadaeast": 0.796, + "centralindia": 0.772, + "centralus": 0.802, + "eastasia": 0.963, + "eastus": 0.752, + "eastus2": 0.752, + "francecentral": 0.816, + "francesouth": 0.952, + "germanywestcentral": 0.828, + "japaneast": 0.864, + "japanwest": 0.914, + "koreacentral": 0.84, + "northcentralus": 0.752, + "northeurope": 0.796, + "southafricanorth": 0.883, + "southcentralus": 0.829, + "southeastasia": 0.848, + "switzerlandnorth": 0.944, + "uksouth": 0.812, + "ukwest": 0.833, + "usgovarizona": 0.852, + "usgovtexas": 0.848, + "usgovvirginia": 0.852, + "westcentralus": 0.829, + "westeurope": 0.828, + "westus": 0.816, + "westus2": 0.752 + }, + "standardd11": { + "australiaeast": 0.306, + "australiasoutheast": 0.306, + "brazilsouth": 0.403, + "brazilsoutheast": 0.398, + "centralus": 0.264, + "eastasia": 0.352, + "eastus": 0.264, + "eastus2": 0.243, + "japaneast": 0.327, + "japanwest": 0.284, + "northcentralus": 0.264, + "northeurope": 0.243, + "southafricanorth": 0.324, + "southafricawest": 0.383, + "southcentralus": 0.243, + "southeastasia": 0.306, + "uaecentral": 0.363, + "uaenorth": 0.3, + "usgovvirginia": 0.304, + "westeurope": 0.279, + "westus": 0.264 + }, + "standardd11s": { + "australiaeast": 0.306, + "australiasoutheast": 0.306, + "brazilsouth": 0.403, + "brazilsoutheast": 0.398, + "centralus": 0.264, + "eastasia": 0.352, + "eastus": 0.264, + "eastus2": 0.243, + "japaneast": 0.327, + "japanwest": 0.284, + "northcentralus": 0.264, + "northeurope": 0.243, + "southafricanorth": 0.324, + "southafricawest": 0.383, + "southcentralus": 0.243, + "southeastasia": 0.306, + "uaecentral": 0.363, + "uaenorth": 0.3, + "usgovvirginia": 0.304, + "westeurope": 0.279, + "westus": 0.264 + }, + "standardd11v2": { + "australiacentral": 0.295, + "australiacentral2": 0.295, + "australiaeast": 0.295, + "australiasoutheast": 0.295, + "brazilsouth": 0.403, + "brazilsoutheast": 0.398, + "canadacentral": 0.267, + "canadaeast": 0.267, + "centralindia": 0.282, + "centralus": 0.264, + "eastasia": 0.352, + "eastus": 0.264, + "eastus2": 0.243, + "francecentral": 0.308, + "francesouth": 0.4, + "germanycentral": 0.292, + "germanynorth": 0.308, + "germanynortheast": 0.292, + "germanywestcentral": 0.325, + "japaneast": 0.327, + "japanwest": 0.285, + "koreacentral": 0.292, + "koreasouth": 0.262, + "northcentralus": 0.264, + "northeurope": 0.243, + "norwayeast": 0.301, + "norwaywest": 0.364, + "southafricanorth": 0.292, + "southafricawest": 0.343, + "southcentralus": 0.243, + "southeastasia": 0.295, + "southindia": 0.282, + "switzerlandnorth": 0.32, + "switzerlandwest": 0.388, + "uaecentral": 0.325, + "uaenorth": 0.271, + "uksouth": 0.308, + "ukwest": 0.308, + "usgovarizona": 0.304, + "usgovtexas": 0.304, + "usgovvirginia": 0.304, + "westcentralus": 0.243, + "westeurope": 0.279, + "westindia": 0.282, + "westus": 0.264, + "westus2": 0.243 + }, + "standardd12": { + "australiaeast": 0.612, + "australiasoutheast": 0.612, + "brazilsouth": 0.807, + "brazilsoutheast": 0.795, + "centralus": 0.528, + "eastasia": 0.703, + "eastus": 0.528, + "eastus2": 0.486, + "japaneast": 0.654, + "japanwest": 0.569, + "northcentralus": 0.528, + "northeurope": 0.486, + "southafricanorth": 0.649, + "southafricawest": 0.767, + "southcentralus": 0.486, + "southeastasia": 0.612, + "uaecentral": 0.725, + "uaenorth": 0.6, + "usgovvirginia": 0.608, + "westeurope": 0.559, + "westus": 0.528 + }, + "standardd12s": { + "australiaeast": 0.612, + "australiasoutheast": 0.612, + "brazilsouth": 0.807, + "brazilsoutheast": 0.795, + "centralus": 0.528, + "eastasia": 0.703, + "eastus": 0.528, + "eastus2": 0.486, + "japaneast": 0.654, + "japanwest": 0.569, + "northcentralus": 0.528, + "northeurope": 0.486, + "southafricanorth": 0.649, + "southafricawest": 0.767, + "southcentralus": 0.486, + "southeastasia": 0.612, + "uaecentral": 0.725, + "uaenorth": 0.6, + "usgovvirginia": 0.608, + "westeurope": 0.559, + "westus": 0.528 + }, + "standardd12v2": { + "australiacentral": 0.591, + "australiacentral2": 0.591, + "australiaeast": 0.591, + "australiasoutheast": 0.591, + "brazilsouth": 0.807, + "brazilsoutheast": 0.795, + "canadacentral": 0.535, + "canadaeast": 0.535, + "centralindia": 0.563, + "centralus": 0.528, + "eastasia": 0.704, + "eastus": 0.528, + "eastus2": 0.486, + "francecentral": 0.615, + "francesouth": 0.8, + "germanycentral": 0.583, + "germanynorth": 0.616, + "germanynortheast": 0.583, + "germanywestcentral": 0.65, + "japaneast": 0.654, + "japanwest": 0.569, + "koreacentral": 0.583, + "koreasouth": 0.525, + "northcentralus": 0.528, + "northeurope": 0.486, + "norwayeast": 0.601, + "norwaywest": 0.726, + "southafricanorth": 0.585, + "southafricawest": 0.686, + "southcentralus": 0.486, + "southeastasia": 0.591, + "southindia": 0.563, + "switzerlandnorth": 0.64, + "switzerlandwest": 0.777, + "uaecentral": 0.65, + "uaenorth": 0.543, + "uksouth": 0.615, + "ukwest": 0.615, + "usgovarizona": 0.608, + "usgovtexas": 0.608, + "usgovvirginia": 0.608, + "westcentralus": 0.486, + "westeurope": 0.557, + "westindia": 0.563, + "westus": 0.528, + "westus2": 0.486 + }, + "standardd13": { + "australiaeast": 1.224, + "australiasoutheast": 1.224, + "brazilsouth": 1.614, + "brazilsoutheast": 1.589, + "centralus": 1.056, + "eastasia": 1.407, + "eastus": 1.056, + "eastus2": 0.972, + "japaneast": 1.308, + "japanwest": 1.137, + "northcentralus": 1.056, + "northeurope": 0.972, + "southafricanorth": 1.298, + "southafricawest": 1.533, + "southcentralus": 0.972, + "southeastasia": 1.224, + "uaecentral": 1.45, + "uaenorth": 1.2, + "usgovvirginia": 1.215, + "westeurope": 1.118, + "westus": 1.056 + }, + "standardd13s": { + "australiaeast": 1.224, + "australiasoutheast": 1.224, + "brazilsouth": 1.614, + "brazilsoutheast": 1.589, + "centralus": 1.056, + "eastasia": 1.407, + "eastus": 1.056, + "eastus2": 0.972, + "japaneast": 1.308, + "japanwest": 1.137, + "northcentralus": 1.056, + "northeurope": 0.972, + "southafricanorth": 1.298, + "southafricawest": 1.533, + "southcentralus": 0.972, + "southeastasia": 1.224, + "uaecentral": 1.45, + "uaenorth": 1.2, + "usgovvirginia": 1.215, + "westeurope": 1.118, + "westus": 1.056 + }, + "standardd13v2": { + "australiacentral": 1.182, + "australiacentral2": 1.182, + "australiaeast": 1.182, + "australiasoutheast": 1.182, + "brazilsouth": 1.614, + "brazilsoutheast": 1.59, + "canadacentral": 1.069, + "canadaeast": 1.069, + "centralindia": 1.126, + "centralus": 1.056, + "eastasia": 1.407, + "eastus": 1.056, + "eastus2": 0.972, + "francecentral": 1.23, + "francesouth": 1.599, + "germanycentral": 1.167, + "germanynorth": 1.231, + "germanynortheast": 1.167, + "germanywestcentral": 1.18, + "japaneast": 1.309, + "japanwest": 1.138, + "koreacentral": 1.166, + "koreasouth": 1.049, + "northcentralus": 1.056, + "northeurope": 0.972, + "norwayeast": 1.203, + "norwaywest": 1.453, + "southafricanorth": 1.169, + "southafricawest": 1.373, + "southcentralus": 0.972, + "southeastasia": 1.182, + "southindia": 1.126, + "switzerlandnorth": 1.28, + "switzerlandwest": 1.554, + "uaecentral": 1.301, + "uaenorth": 1.086, + "uksouth": 1.23, + "ukwest": 1.23, + "usgovarizona": 1.215, + "usgovtexas": 1.215, + "usgovvirginia": 1.215, + "westcentralus": 0.972, + "westeurope": 1.114, + "westindia": 1.126, + "westus": 1.056, + "westus2": 0.972 + }, + "standardd14": { + "australiaeast": 2.447, + "australiasoutheast": 2.447, + "brazilsouth": 3.227, + "brazilsoutheast": 3.179, + "centralus": 2.111, + "eastasia": 2.814, + "eastus": 2.111, + "eastus2": 1.944, + "japaneast": 2.617, + "japanwest": 2.274, + "northcentralus": 2.111, + "northeurope": 1.944, + "southafricanorth": 2.595, + "southafricawest": 3.067, + "southcentralus": 1.944, + "southeastasia": 2.447, + "uaecentral": 2.9, + "uaenorth": 2.401, + "usgovvirginia": 2.43, + "westeurope": 2.236, + "westus": 2.111 + }, + "standardd14s": { + "australiaeast": 2.447, + "australiasoutheast": 2.447, + "brazilsouth": 3.227, + "brazilsoutheast": 3.179, + "centralus": 2.111, + "eastasia": 2.814, + "eastus": 2.111, + "eastus2": 1.944, + "japaneast": 2.617, + "japanwest": 2.274, + "northcentralus": 2.111, + "northeurope": 1.944, + "southafricanorth": 2.595, + "southafricawest": 3.067, + "southcentralus": 1.944, + "southeastasia": 2.447, + "uaecentral": 2.9, + "uaenorth": 2.401, + "usgovvirginia": 2.43, + "westeurope": 2.236, + "westus": 2.111 + }, + "standardd14v2": { + "australiacentral": 2.363, + "australiacentral2": 2.363, + "australiaeast": 2.363, + "australiasoutheast": 2.363, + "brazilsouth": 3.227, + "brazilsoutheast": 3.179, + "canadacentral": 2.138, + "canadaeast": 2.138, + "centralindia": 2.252, + "centralus": 2.111, + "eastasia": 2.814, + "eastus": 2.111, + "eastus2": 1.944, + "francecentral": 2.46, + "francesouth": 3.198, + "germanycentral": 2.333, + "germanynorth": 2.462, + "germanynortheast": 2.333, + "germanywestcentral": 2.228, + "japaneast": 2.617, + "japanwest": 2.276, + "koreacentral": 2.332, + "koreasouth": 2.099, + "northcentralus": 2.111, + "northeurope": 1.944, + "norwayeast": 2.406, + "norwaywest": 2.907, + "southafricanorth": 2.339, + "southafricawest": 2.745, + "southcentralus": 1.944, + "southeastasia": 2.363, + "southindia": 2.252, + "switzerlandnorth": 2.56, + "switzerlandwest": 3.107, + "uaecentral": 2.602, + "uaenorth": 2.171, + "uksouth": 2.46, + "ukwest": 2.46, + "usgovarizona": 2.43, + "usgovtexas": 2.43, + "usgovvirginia": 2.43, + "westcentralus": 1.944, + "westeurope": 2.228, + "westindia": 2.252, + "westus": 2.111, + "westus2": 1.944 + }, + "standardd15iv2": { + "australiacentral": 2.954, + "australiacentral2": 2.954, + "australiaeast": 2.954, + "australiasoutheast": 2.954, + "brazilsouth": 4.034, + "brazilsoutheast": 3.974, + "canadacentral": 2.673, + "canadaeast": 2.673, + "centralindia": 2.815, + "centralus": 2.639, + "eastasia": 3.518, + "eastus": 2.639, + "eastus2": 2.43, + "francecentral": 3.075, + "francesouth": 3.9975, + "germanynorth": 3.078, + "germanywestcentral": 2.58, + "japaneast": 3.271, + "japanwest": 2.845, + "koreacentral": 2.915, + "koreasouth": 2.624, + "northcentralus": 2.639, + "northeurope": 2.43, + "norwayeast": 3.007, + "norwaywest": 3.633, + "southafricanorth": 2.923, + "southafricawest": 3.432, + "southcentralus": 2.43, + "southeastasia": 2.954, + "southindia": 2.815, + "switzerlandnorth": 3.2, + "switzerlandwest": 3.884, + "uaecentral": 3.252, + "uaenorth": 2.714, + "uksouth": 3.075, + "ukwest": 3.075, + "usgovarizona": 2.784, + "usgovtexas": 2.784, + "usgovvirginia": 2.784, + "westcentralus": 2.43, + "westeurope": 2.785, + "westindia": 2.815, + "westus": 2.639, + "westus2": 2.43 + }, + "standardd15v2": { + "australiacentral": 2.954, + "australiacentral2": 2.954, + "australiaeast": 2.954, + "australiasoutheast": 2.954, + "brazilsouth": 4.034, + "brazilsoutheast": 3.974, + "canadacentral": 2.673, + "canadaeast": 2.673, + "centralindia": 2.815, + "centralus": 2.639, + "eastasia": 3.518, + "eastus": 2.639, + "eastus2": 2.43, + "francecentral": 3.075, + "francesouth": 3.997, + "germanycentral": 2.916, + "germanynorth": 3.078, + "germanynortheast": 2.916, + "germanywestcentral": 3.25, + "japaneast": 3.271, + "japanwest": 2.845, + "koreacentral": 2.915, + "koreasouth": 2.624, + "northcentralus": 2.639, + "northeurope": 2.43, + "norwayeast": 3.007, + "norwaywest": 3.633, + "southafricanorth": 2.923, + "southafricawest": 3.432, + "southcentralus": 2.43, + "southeastasia": 2.954, + "southindia": 2.815, + "switzerlandnorth": 3.2, + "switzerlandwest": 3.884, + "uaecentral": 3.252, + "uaenorth": 2.714, + "uksouth": 3.075, + "ukwest": 3.075, + "usgovarizona": 3.038, + "usgovtexas": 3.038, + "usgovvirginia": 3.038, + "westcentralus": 2.43, + "westeurope": 2.785, + "westindia": 2.815, + "westus": 2.639, + "westus2": 2.43 + }, + "standardd16asv4": { + "australiaeast": 1.696, + "brazilsouth": 1.96, + "centralindia": 1.544, + "centralus": 1.604, + "eastasia": 1.792, + "eastus": 1.504, + "eastus2": 1.504, + "francecentral": 1.632, + "japaneast": 1.728, + "koreacentral": 1.68, + "northeurope": 1.592, + "southcentralus": 1.658, + "southeastasia": 1.696, + "uksouth": 1.624, + "westeurope": 1.656, + "westus": 1.632, + "westus2": 1.504 + }, + "standardd16av4": { + "australiaeast": 1.696, + "brazilsouth": 1.96, + "centralindia": 1.544, + "centralus": 1.604, + "eastasia": 1.792, + "eastus": 1.504, + "eastus2": 1.504, + "francecentral": 1.632, + "japaneast": 1.728, + "koreacentral": 1.68, + "northeurope": 1.592, + "southcentralus": 1.658, + "southeastasia": 1.696, + "uksouth": 1.624, + "westeurope": 1.656, + "westus": 1.632, + "westus2": 1.504 + }, + "standardd16dsv4": { + "australiaeast": 1.872, + "australiasoutheast": 1.821, + "brazilsouth": 2.176, + "canadacentral": 1.744, + "canadaeast": 1.821, + "centralindia": 1.712, + "centralus": 1.758, + "eastasia": 2.137, + "eastus": 1.64, + "eastus2": 1.64, + "francecentral": 1.792, + "francesouth": 2.11, + "germanywestcentral": 1.824, + "japaneast": 1.904, + "japanwest": 2.02, + "koreacentral": 1.848, + "northcentralus": 1.64, + "northeurope": 1.744, + "southafricanorth": 1.947, + "southcentralus": 1.911, + "southeastasia": 1.864, + "switzerlandnorth": 2.092, + "uksouth": 1.784, + "ukwest": 1.83, + "usgovarizona": 1.88, + "usgovtexas": 1.866, + "usgovvirginia": 1.88, + "westcentralus": 1.821, + "westeurope": 1.824, + "westus": 1.8, + "westus2": 1.64 + }, + "standardd16dv4": { + "australiaeast": 1.872, + "australiasoutheast": 1.821, + "brazilsouth": 2.176, + "canadacentral": 1.744, + "canadaeast": 1.821, + "centralindia": 1.712, + "centralus": 1.758, + "eastasia": 2.137, + "eastus": 1.64, + "eastus2": 1.64, + "francecentral": 1.792, + "francesouth": 2.11, + "germanywestcentral": 1.824, + "japaneast": 1.904, + "japanwest": 2.02, + "koreacentral": 1.848, + "northcentralus": 1.64, + "northeurope": 1.744, + "southafricanorth": 1.947, + "southcentralus": 1.911, + "southeastasia": 1.864, + "switzerlandnorth": 2.092, + "uksouth": 1.784, + "ukwest": 1.83, + "usgovarizona": 1.88, + "usgovtexas": 1.866, + "usgovvirginia": 1.88, + "westcentralus": 1.821, + "westeurope": 1.824, + "westus": 1.8, + "westus2": 1.64 + }, + "standardd16sv3": { + "australiacentral": 1.736, + "australiacentral2": 1.736, + "australiaeast": 1.736, + "australiasoutheast": 1.736, + "brazilsouth": 2.008, + "brazilsoutheast": 2.39, + "canadacentral": 1.624, + "canadaeast": 1.624, + "centralindia": 1.576, + "centralus": 1.69, + "eastasia": 1.792, + "eastus": 1.504, + "eastus2": 1.504, + "francecentral": 1.632, + "francesouth": 2.121, + "germanycentral": 1.832, + "germanynorth": 1.932, + "germanynortheast": 1.832, + "germanywestcentral": 1.656, + "japaneast": 1.768, + "japanwest": 1.768, + "koreacentral": 1.72, + "koreasouth": 1.548, + "northcentralus": 1.536, + "northeurope": 1.592, + "norwayeast": 1.792, + "norwaywest": 2.109, + "southafricanorth": 1.808, + "southafricawest": 2.08, + "southcentralus": 1.69, + "southeastasia": 1.736, + "southindia": 1.892, + "switzerlandnorth": 1.888, + "switzerlandwest": 2.234, + "uaecentral": 1.984, + "uaenorth": 1.696, + "uksouth": 1.664, + "ukwest": 1.664, + "usgovarizona": 1.744, + "usgovtexas": 1.744, + "usgovvirginia": 1.744, + "westcentralus": 1.69, + "westeurope": 1.696, + "westindia": 1.72, + "westus": 1.672, + "westus2": 1.504 + }, + "standardd16sv4": { + "australiaeast": 1.696, + "australiasoutheast": 1.734, + "brazilsouth": 1.96, + "brazilsoutheast": 2.327, + "canadacentral": 1.592, + "canadaeast": 1.592, + "centralindia": 1.544, + "centralus": 1.604, + "eastasia": 1.926, + "eastus": 1.504, + "eastus2": 1.504, + "francecentral": 1.632, + "francesouth": 1.903, + "germanywestcentral": 1.656, + "japaneast": 1.728, + "japanwest": 1.827, + "koreacentral": 1.68, + "northcentralus": 1.504, + "northeurope": 1.592, + "southafricanorth": 1.765, + "southcentralus": 1.658, + "southeastasia": 1.696, + "switzerlandnorth": 1.888, + "uksouth": 1.624, + "ukwest": 1.665, + "usgovarizona": 1.704, + "usgovtexas": 1.696, + "usgovvirginia": 1.704, + "westcentralus": 1.658, + "westeurope": 1.656, + "westus": 1.632, + "westus2": 1.504 + }, + "standardd16v3": { + "australiacentral": 1.736, + "australiacentral2": 1.736, + "australiaeast": 1.736, + "australiasoutheast": 1.736, + "brazilsouth": 2.008, + "brazilsoutheast": 2.39, + "canadacentral": 1.624, + "canadaeast": 1.624, + "centralindia": 1.576, + "centralus": 1.69, + "eastasia": 1.792, + "eastus": 1.504, + "eastus2": 1.504, + "francecentral": 1.632, + "francesouth": 2.121, + "germanycentral": 1.832, + "germanynorth": 1.932, + "germanynortheast": 1.832, + "germanywestcentral": 1.656, + "japaneast": 1.768, + "japanwest": 1.768, + "koreacentral": 1.72, + "koreasouth": 1.548, + "northcentralus": 1.536, + "northeurope": 1.592, + "norwayeast": 1.792, + "norwaywest": 2.109, + "southafricanorth": 1.808, + "southafricawest": 2.08, + "southcentralus": 1.69, + "southeastasia": 1.736, + "southindia": 1.892, + "switzerlandnorth": 1.888, + "switzerlandwest": 2.234, + "uaecentral": 1.984, + "uaenorth": 1.696, + "uksouth": 1.664, + "ukwest": 1.664, + "usgovarizona": 1.744, + "usgovtexas": 1.744, + "usgovvirginia": 1.744, + "westcentralus": 1.69, + "westeurope": 1.696, + "westindia": 1.72, + "westus": 1.672, + "westus2": 1.504 + }, + "standardd16v4": { + "australiaeast": 1.696, + "australiasoutheast": 1.734, + "brazilsouth": 1.96, + "brazilsoutheast": 2.327, + "canadacentral": 1.592, + "canadaeast": 1.592, + "centralindia": 1.544, + "centralus": 1.604, + "eastasia": 1.926, + "eastus": 1.504, + "eastus2": 1.504, + "francecentral": 1.632, + "francesouth": 1.903, + "germanywestcentral": 1.656, + "japaneast": 1.728, + "japanwest": 1.827, + "koreacentral": 1.68, + "northcentralus": 1.504, + "northeurope": 1.592, + "southafricanorth": 1.765, + "southcentralus": 1.658, + "southeastasia": 1.696, + "switzerlandnorth": 1.888, + "uksouth": 1.624, + "ukwest": 1.665, + "usgovarizona": 1.704, + "usgovtexas": 1.696, + "usgovvirginia": 1.704, + "westcentralus": 1.658, + "westeurope": 1.656, + "westus": 1.632, + "westus2": 1.504 + }, + "standardd32asv4": { + "australiaeast": 3.392, + "brazilsouth": 3.92, + "centralindia": 3.088, + "centralus": 3.208, + "eastasia": 3.584, + "eastus": 3.008, + "eastus2": 3.008, + "francecentral": 3.264, + "japaneast": 3.456, + "koreacentral": 3.36, + "northeurope": 3.184, + "southcentralus": 3.315, + "southeastasia": 3.392, + "uksouth": 3.248, + "westeurope": 3.312, + "westus": 3.264, + "westus2": 3.008 + }, + "standardd32av4": { + "australiaeast": 3.392, + "brazilsouth": 3.92, + "centralindia": 3.088, + "centralus": 3.208, + "eastasia": 3.584, + "eastus": 3.008, + "eastus2": 3.008, + "francecentral": 3.264, + "japaneast": 3.456, + "koreacentral": 3.36, + "northeurope": 3.184, + "southcentralus": 3.315, + "southeastasia": 3.392, + "uksouth": 3.248, + "westeurope": 3.312, + "westus": 3.264, + "westus2": 3.008 + }, + "standardd32dsv4": { + "australiaeast": 3.744, + "australiasoutheast": 3.642, + "brazilsouth": 4.352, + "canadacentral": 3.488, + "canadaeast": 3.642, + "centralindia": 3.424, + "centralus": 3.515, + "eastasia": 4.274, + "eastus": 3.28, + "eastus2": 3.28, + "francecentral": 3.584, + "francesouth": 4.22, + "germanywestcentral": 3.648, + "japaneast": 3.808, + "japanwest": 4.041, + "koreacentral": 3.696, + "northcentralus": 3.28, + "northeurope": 3.488, + "southafricanorth": 3.895, + "southcentralus": 3.822, + "southeastasia": 3.728, + "switzerlandnorth": 4.184, + "uksouth": 3.568, + "ukwest": 3.66, + "usgovarizona": 3.76, + "usgovtexas": 3.732, + "usgovvirginia": 3.76, + "westcentralus": 3.642, + "westeurope": 3.648, + "westus": 3.6, + "westus2": 3.28 + }, + "standardd32dv4": { + "australiaeast": 3.744, + "australiasoutheast": 3.642, + "brazilsouth": 4.352, + "canadacentral": 3.488, + "canadaeast": 3.642, + "centralindia": 3.424, + "centralus": 3.515, + "eastasia": 4.274, + "eastus": 3.28, + "eastus2": 3.28, + "francecentral": 3.584, + "francesouth": 4.22, + "germanywestcentral": 3.648, + "japaneast": 3.808, + "japanwest": 4.041, + "koreacentral": 3.696, + "northcentralus": 3.28, + "northeurope": 3.488, + "southafricanorth": 3.895, + "southcentralus": 3.822, + "southeastasia": 3.728, + "switzerlandnorth": 4.184, + "uksouth": 3.568, + "ukwest": 3.66, + "usgovarizona": 3.76, + "usgovtexas": 3.732, + "usgovvirginia": 3.76, + "westcentralus": 3.642, + "westeurope": 3.648, + "westus": 3.6, + "westus2": 3.28 + }, + "standardd32sv3": { + "australiacentral": 3.472, + "australiacentral2": 3.472, + "australiaeast": 3.472, + "australiasoutheast": 3.472, + "brazilsouth": 4.016, + "brazilsoutheast": 4.779, + "canadacentral": 3.248, + "canadaeast": 3.248, + "centralindia": 3.152, + "centralus": 3.38, + "eastasia": 3.584, + "eastus": 3.008, + "eastus2": 3.008, + "francecentral": 3.264, + "francesouth": 4.242, + "germanycentral": 3.664, + "germanynorth": 3.864, + "germanynortheast": 3.664, + "germanywestcentral": 3.312, + "japaneast": 3.536, + "japanwest": 3.536, + "koreacentral": 3.44, + "koreasouth": 3.096, + "northcentralus": 3.072, + "northeurope": 3.184, + "norwayeast": 3.584, + "norwaywest": 4.218, + "southafricanorth": 3.616, + "southafricawest": 4.16, + "southcentralus": 3.38, + "southeastasia": 3.472, + "southindia": 3.784, + "switzerlandnorth": 3.776, + "switzerlandwest": 4.467, + "uaecentral": 3.968, + "uaenorth": 3.392, + "uksouth": 3.328, + "ukwest": 3.328, + "usgovarizona": 3.488, + "usgovtexas": 3.488, + "usgovvirginia": 3.488, + "westcentralus": 3.38, + "westeurope": 3.392, + "westindia": 3.44, + "westus": 3.344, + "westus2": 3.008 + }, + "standardd32sv4": { + "australiaeast": 3.392, + "australiasoutheast": 3.469, + "brazilsouth": 3.92, + "brazilsoutheast": 4.654, + "canadacentral": 3.184, + "canadaeast": 3.184, + "centralindia": 3.088, + "centralus": 3.208, + "eastasia": 3.853, + "eastus": 3.008, + "eastus2": 3.008, + "francecentral": 3.264, + "francesouth": 3.807, + "germanywestcentral": 3.312, + "japaneast": 3.456, + "japanwest": 3.654, + "koreacentral": 3.36, + "northcentralus": 3.008, + "northeurope": 3.184, + "southafricanorth": 3.53, + "southcentralus": 3.315, + "southeastasia": 3.392, + "switzerlandnorth": 3.776, + "uksouth": 3.248, + "ukwest": 3.331, + "usgovarizona": 3.408, + "usgovtexas": 3.392, + "usgovvirginia": 3.408, + "westcentralus": 3.315, + "westeurope": 3.312, + "westus": 3.264, + "westus2": 3.008 + }, + "standardd32v3": { + "australiacentral": 3.472, + "australiacentral2": 3.472, + "australiaeast": 3.472, + "australiasoutheast": 3.472, + "brazilsouth": 4.016, + "brazilsoutheast": 4.779, + "canadacentral": 3.248, + "canadaeast": 3.248, + "centralindia": 3.152, + "centralus": 3.38, + "eastasia": 3.584, + "eastus": 3.008, + "eastus2": 3.008, + "francecentral": 3.264, + "francesouth": 4.242, + "germanycentral": 3.664, + "germanynorth": 3.864, + "germanynortheast": 3.664, + "germanywestcentral": 3.312, + "japaneast": 3.536, + "japanwest": 3.536, + "koreacentral": 3.44, + "koreasouth": 3.096, + "northcentralus": 3.072, + "northeurope": 3.184, + "norwayeast": 3.584, + "norwaywest": 4.218, + "southafricanorth": 3.616, + "southafricawest": 4.16, + "southcentralus": 3.38, + "southeastasia": 3.472, + "southindia": 3.784, + "switzerlandnorth": 3.776, + "switzerlandwest": 4.467, + "uaecentral": 3.968, + "uaenorth": 3.392, + "uksouth": 3.328, + "ukwest": 3.328, + "usgovarizona": 3.488, + "usgovtexas": 3.488, + "usgovvirginia": 3.488, + "westcentralus": 3.38, + "westeurope": 3.392, + "westindia": 3.44, + "westus": 3.344, + "westus2": 3.008 + }, + "standardd32v4": { + "australiaeast": 3.392, + "australiasoutheast": 3.469, + "brazilsouth": 3.92, + "brazilsoutheast": 4.654, + "canadacentral": 3.184, + "canadaeast": 3.184, + "centralindia": 3.088, + "centralus": 3.208, + "eastasia": 3.853, + "eastus": 3.008, + "eastus2": 3.008, + "francecentral": 3.264, + "francesouth": 3.807, + "germanywestcentral": 3.312, + "japaneast": 3.456, + "japanwest": 3.654, + "koreacentral": 3.36, + "northcentralus": 3.008, + "northeurope": 3.184, + "southafricanorth": 3.53, + "southcentralus": 3.315, + "southeastasia": 3.392, + "switzerlandnorth": 3.776, + "uksouth": 3.248, + "ukwest": 3.331, + "usgovarizona": 3.408, + "usgovtexas": 3.392, + "usgovvirginia": 3.408, + "westcentralus": 3.315, + "westeurope": 3.312, + "westus": 3.264, + "westus2": 3.008 + }, + "standardd48asv4": { + "australiaeast": 5.088, + "brazilsouth": 5.88, + "centralindia": 4.632, + "centralus": 4.812, + "eastasia": 5.376, + "eastus": 4.512, + "eastus2": 4.512, + "francecentral": 4.896, + "japaneast": 5.184, + "koreacentral": 5.04, + "northeurope": 4.776, + "southcentralus": 4.973, + "southeastasia": 5.088, + "uksouth": 4.872, + "westeurope": 4.968, + "westus": 4.896, + "westus2": 4.512 + }, + "standardd48av4": { + "australiaeast": 5.088, + "brazilsouth": 5.88, + "centralindia": 4.632, + "centralus": 4.812, + "eastasia": 5.376, + "eastus": 4.512, + "eastus2": 4.512, + "francecentral": 4.896, + "japaneast": 5.184, + "koreacentral": 5.04, + "northeurope": 4.776, + "southcentralus": 4.973, + "southeastasia": 5.088, + "uksouth": 4.872, + "westeurope": 4.968, + "westus": 4.896, + "westus2": 4.512 + }, + "standardd48dsv4": { + "australiaeast": 5.616, + "australiasoutheast": 5.462, + "brazilsouth": 6.528, + "canadacentral": 5.232, + "canadaeast": 5.462, + "centralindia": 5.136, + "centralus": 5.273, + "eastasia": 6.412, + "eastus": 4.92, + "eastus2": 4.92, + "francecentral": 5.376, + "francesouth": 6.33, + "germanywestcentral": 5.472, + "japaneast": 5.712, + "japanwest": 6.061, + "koreacentral": 5.544, + "northcentralus": 4.92, + "northeurope": 5.232, + "southafricanorth": 5.842, + "southcentralus": 5.734, + "southeastasia": 5.592, + "switzerlandnorth": 6.276, + "uksouth": 5.352, + "ukwest": 5.49, + "usgovarizona": 5.64, + "usgovtexas": 5.598, + "usgovvirginia": 5.64, + "westcentralus": 5.462, + "westeurope": 5.472, + "westus": 5.4, + "westus2": 4.92 + }, + "standardd48dv4": { + "australiaeast": 5.616, + "australiasoutheast": 5.462, + "brazilsouth": 6.528, + "canadacentral": 5.232, + "canadaeast": 5.462, + "centralindia": 5.136, + "centralus": 5.273, + "eastasia": 6.412, + "eastus": 4.92, + "eastus2": 4.92, + "francecentral": 5.376, + "francesouth": 6.33, + "germanywestcentral": 5.472, + "japaneast": 5.712, + "japanwest": 6.061, + "koreacentral": 5.544, + "northcentralus": 4.92, + "northeurope": 5.232, + "southafricanorth": 5.842, + "southcentralus": 5.734, + "southeastasia": 5.592, + "switzerlandnorth": 6.276, + "uksouth": 5.352, + "ukwest": 5.49, + "usgovarizona": 5.64, + "usgovtexas": 5.598, + "usgovvirginia": 5.64, + "westcentralus": 5.462, + "westeurope": 5.472, + "westus": 5.4, + "westus2": 4.92 + }, + "standardd48sv3": { + "australiacentral": 5.208, + "australiacentral2": 5.208, + "australiaeast": 5.208, + "australiasoutheast": 5.208, + "brazilsouth": 6.024, + "brazilsoutheast": 7.169, + "canadacentral": 4.872, + "canadaeast": 4.872, + "centralindia": 4.728, + "centralus": 5.07, + "eastasia": 5.376, + "eastus": 4.512, + "eastus2": 4.512, + "francecentral": 4.896, + "francesouth": 6.365, + "germanycentral": 5.319, + "germanynorth": 5.796, + "germanynortheast": 5.319, + "germanywestcentral": 4.968, + "japaneast": 5.304, + "japanwest": 5.304, + "koreacentral": 5.16, + "koreasouth": 4.644, + "northcentralus": 4.608, + "northeurope": 4.776, + "norwayeast": 5.376, + "norwaywest": 6.326, + "southafricanorth": 5.424, + "southafricawest": 6.24, + "southcentralus": 5.07, + "southeastasia": 5.208, + "southindia": 5.676, + "switzerlandnorth": 5.664, + "switzerlandwest": 6.701, + "uaecentral": 5.952, + "uaenorth": 5.088, + "uksouth": 4.992, + "ukwest": 4.992, + "usgovarizona": 5.232, + "usgovtexas": 5.232, + "usgovvirginia": 5.232, + "westcentralus": 5.07, + "westeurope": 5.088, + "westindia": 5.16, + "westus": 5.016, + "westus2": 4.512 + }, + "standardd48sv4": { + "australiaeast": 5.088, + "australiasoutheast": 5.203, + "brazilsouth": 5.88, + "brazilsoutheast": 6.981, + "canadacentral": 4.776, + "canadaeast": 4.776, + "centralindia": 4.632, + "centralus": 4.812, + "eastasia": 5.779, + "eastus": 4.512, + "eastus2": 4.512, + "francecentral": 4.896, + "francesouth": 5.71, + "germanywestcentral": 4.968, + "japaneast": 5.184, + "japanwest": 5.482, + "koreacentral": 5.04, + "northcentralus": 4.512, + "northeurope": 4.776, + "southafricanorth": 5.295, + "southcentralus": 4.973, + "southeastasia": 5.088, + "switzerlandnorth": 5.664, + "uksouth": 4.872, + "ukwest": 4.996, + "usgovarizona": 5.112, + "usgovtexas": 5.088, + "usgovvirginia": 5.112, + "westcentralus": 4.973, + "westeurope": 4.968, + "westus": 4.896, + "westus2": 4.512 + }, + "standardd48v3": { + "australiacentral": 5.208, + "australiacentral2": 5.208, + "australiaeast": 5.208, + "australiasoutheast": 5.208, + "brazilsouth": 6.024, + "brazilsoutheast": 7.169, + "canadacentral": 4.872, + "canadaeast": 4.872, + "centralindia": 4.728, + "centralus": 5.07, + "eastasia": 5.376, + "eastus": 4.512, + "eastus2": 4.512, + "francecentral": 4.896, + "francesouth": 6.365, + "germanycentral": 5.319, + "germanynorth": 5.796, + "germanynortheast": 5.319, + "germanywestcentral": 4.968, + "japaneast": 5.304, + "japanwest": 5.304, + "koreacentral": 5.16, + "koreasouth": 4.644, + "northcentralus": 4.608, + "northeurope": 4.776, + "norwayeast": 5.376, + "norwaywest": 6.326, + "southafricanorth": 5.424, + "southafricawest": 6.24, + "southcentralus": 5.07, + "southeastasia": 5.208, + "southindia": 5.676, + "switzerlandnorth": 5.664, + "switzerlandwest": 6.701, + "uaecentral": 5.952, + "uaenorth": 5.088, + "uksouth": 4.992, + "ukwest": 4.992, + "usgovarizona": 5.232, + "usgovtexas": 5.232, + "usgovvirginia": 5.232, + "westcentralus": 5.07, + "westeurope": 5.088, + "westindia": 5.16, + "westus": 5.016, + "westus2": 4.512 + }, + "standardd48v4": { + "australiaeast": 5.088, + "australiasoutheast": 5.203, + "brazilsouth": 5.88, + "brazilsoutheast": 6.981, + "canadacentral": 4.776, + "canadaeast": 4.776, + "centralindia": 4.632, + "centralus": 4.812, + "eastasia": 5.779, + "eastus": 4.512, + "eastus2": 4.512, + "francecentral": 4.896, + "francesouth": 5.71, + "germanywestcentral": 4.968, + "japaneast": 5.184, + "japanwest": 5.482, + "koreacentral": 5.04, + "northcentralus": 4.512, + "northeurope": 4.776, + "southafricanorth": 5.295, + "southcentralus": 4.973, + "southeastasia": 5.088, + "switzerlandnorth": 5.664, + "uksouth": 4.872, + "ukwest": 4.996, + "usgovarizona": 5.112, + "usgovtexas": 5.088, + "usgovvirginia": 5.112, + "westcentralus": 4.973, + "westeurope": 4.968, + "westus": 4.896, + "westus2": 4.512 + }, + "standardd64asv4": { + "australiaeast": 6.784, + "brazilsouth": 7.84, + "centralindia": 6.176, + "centralus": 6.415, + "eastasia": 7.168, + "eastus": 6.016, + "eastus2": 6.016, + "francecentral": 6.528, + "japaneast": 6.912, + "koreacentral": 6.72, + "northeurope": 6.368, + "southcentralus": 6.63, + "southeastasia": 6.784, + "uksouth": 6.496, + "westeurope": 6.624, + "westus": 6.528, + "westus2": 6.016 + }, + "standardd64av4": { + "australiaeast": 6.784, + "brazilsouth": 7.84, + "centralindia": 6.176, + "centralus": 6.415, + "eastasia": 7.168, + "eastus": 6.016, + "eastus2": 6.016, + "francecentral": 6.528, + "japaneast": 6.912, + "koreacentral": 6.72, + "northeurope": 6.368, + "southcentralus": 6.63, + "southeastasia": 6.784, + "uksouth": 6.496, + "westeurope": 6.624, + "westus": 6.528, + "westus2": 6.016 + }, + "standardd64dsv4": { + "australiaeast": 7.488, + "australiasoutheast": 7.283, + "brazilsouth": 8.704, + "canadacentral": 6.976, + "canadaeast": 7.283, + "centralindia": 6.848, + "centralus": 7.03, + "eastasia": 8.549, + "eastus": 6.56, + "eastus2": 6.56, + "francecentral": 7.168, + "francesouth": 8.44, + "germanywestcentral": 7.296, + "japaneast": 7.616, + "japanwest": 8.082, + "koreacentral": 7.392, + "northcentralus": 6.56, + "northeurope": 6.976, + "southafricanorth": 7.789, + "southcentralus": 7.645, + "southeastasia": 7.456, + "switzerlandnorth": 8.368, + "uksouth": 7.136, + "ukwest": 7.319, + "usgovarizona": 7.52, + "usgovtexas": 7.464, + "usgovvirginia": 7.52, + "westcentralus": 7.283, + "westeurope": 7.296, + "westus": 7.2, + "westus2": 6.56 + }, + "standardd64dv4": { + "australiaeast": 7.488, + "australiasoutheast": 7.283, + "brazilsouth": 8.704, + "canadacentral": 6.976, + "canadaeast": 7.283, + "centralindia": 6.848, + "centralus": 7.03, + "eastasia": 8.549, + "eastus": 6.56, + "eastus2": 6.56, + "francecentral": 7.168, + "francesouth": 8.44, + "germanywestcentral": 7.296, + "japaneast": 7.616, + "japanwest": 8.082, + "koreacentral": 7.392, + "northcentralus": 6.56, + "northeurope": 6.976, + "southafricanorth": 7.789, + "southcentralus": 7.645, + "southeastasia": 7.456, + "switzerlandnorth": 8.368, + "uksouth": 7.136, + "ukwest": 7.319, + "usgovarizona": 7.52, + "usgovtexas": 7.464, + "usgovvirginia": 7.52, + "westcentralus": 7.283, + "westeurope": 7.296, + "westus": 7.2, + "westus2": 6.56 + }, + "standardd64sv3": { + "australiacentral": 6.944, + "australiacentral2": 6.944, + "australiaeast": 6.944, + "australiasoutheast": 6.944, + "brazilsouth": 8.032, + "brazilsoutheast": 9.558, + "canadacentral": 6.496, + "canadaeast": 6.496, + "centralindia": 6.304, + "centralus": 6.76, + "eastasia": 7.168, + "eastus": 6.016, + "eastus2": 6.016, + "francecentral": 6.528, + "francesouth": 8.485, + "germanycentral": 7.328, + "germanynorth": 7.728, + "germanynortheast": 7.328, + "germanywestcentral": 6.624, + "japaneast": 7.072, + "japanwest": 7.072, + "koreacentral": 6.88, + "koreasouth": 6.192, + "northcentralus": 6.144, + "northeurope": 6.368, + "norwayeast": 7.168, + "norwaywest": 8.435, + "southafricanorth": 7.232, + "southafricawest": 8.32, + "southcentralus": 6.76, + "southeastasia": 6.944, + "southindia": 7.568, + "switzerlandnorth": 7.552, + "switzerlandwest": 8.934, + "uaecentral": 7.936, + "uaenorth": 6.784, + "uksouth": 6.656, + "ukwest": 6.656, + "usgovarizona": 6.976, + "usgovtexas": 6.976, + "usgovvirginia": 6.976, + "westcentralus": 6.76, + "westeurope": 6.784, + "westindia": 6.88, + "westus": 6.688, + "westus2": 6.016 + }, + "standardd64sv4": { + "australiaeast": 6.784, + "australiasoutheast": 6.938, + "brazilsouth": 7.84, + "brazilsoutheast": 9.308, + "canadacentral": 6.368, + "canadaeast": 6.368, + "centralindia": 6.176, + "centralus": 6.415, + "eastasia": 7.706, + "eastus": 6.016, + "eastus2": 6.016, + "francecentral": 6.528, + "francesouth": 7.613, + "germanywestcentral": 6.624, + "japaneast": 6.912, + "japanwest": 7.309, + "koreacentral": 6.72, + "northcentralus": 6.016, + "northeurope": 6.368, + "southafricanorth": 7.06, + "southcentralus": 6.63, + "southeastasia": 6.784, + "switzerlandnorth": 7.552, + "uksouth": 6.496, + "ukwest": 6.661, + "usgovarizona": 6.816, + "usgovtexas": 6.784, + "usgovvirginia": 6.816, + "westcentralus": 6.63, + "westeurope": 6.624, + "westus": 6.528, + "westus2": 6.016 + }, + "standardd64v3": { + "australiacentral": 6.944, + "australiacentral2": 6.944, + "australiaeast": 6.944, + "australiasoutheast": 6.944, + "brazilsouth": 8.032, + "brazilsoutheast": 9.558, + "canadacentral": 6.496, + "canadaeast": 6.496, + "centralindia": 6.304, + "centralus": 6.76, + "eastasia": 7.168, + "eastus": 6.016, + "eastus2": 6.016, + "francecentral": 6.528, + "francesouth": 8.485, + "germanycentral": 7.328, + "germanynorth": 7.728, + "germanynortheast": 7.328, + "germanywestcentral": 6.624, + "japaneast": 7.072, + "japanwest": 7.072, + "koreacentral": 6.88, + "koreasouth": 6.192, + "northcentralus": 6.144, + "northeurope": 6.368, + "norwayeast": 7.168, + "norwaywest": 8.435, + "southafricanorth": 7.232, + "southafricawest": 8.32, + "southcentralus": 6.76, + "southeastasia": 6.944, + "southindia": 7.568, + "switzerlandnorth": 7.552, + "switzerlandwest": 8.934, + "uaecentral": 7.936, + "uaenorth": 6.784, + "uksouth": 6.656, + "ukwest": 6.656, + "usgovarizona": 6.976, + "usgovtexas": 6.976, + "usgovvirginia": 6.976, + "westcentralus": 6.76, + "westeurope": 6.784, + "westindia": 6.88, + "westus": 6.688, + "westus2": 6.016 + }, + "standardd64v4": { + "australiaeast": 6.784, + "australiasoutheast": 6.938, + "brazilsouth": 7.84, + "brazilsoutheast": 9.308, + "canadacentral": 6.368, + "canadaeast": 6.368, + "centralindia": 6.176, + "centralus": 6.415, + "eastasia": 7.706, + "eastus": 6.016, + "eastus2": 6.016, + "francecentral": 6.528, + "francesouth": 7.613, + "germanywestcentral": 6.624, + "japaneast": 6.912, + "japanwest": 7.309, + "koreacentral": 6.72, + "northcentralus": 6.016, + "northeurope": 6.368, + "southafricanorth": 7.06, + "southcentralus": 6.63, + "southeastasia": 6.784, + "switzerlandnorth": 7.552, + "uksouth": 6.496, + "ukwest": 6.661, + "usgovarizona": 6.816, + "usgovtexas": 6.784, + "usgovvirginia": 6.816, + "westcentralus": 6.63, + "westeurope": 6.624, + "westus": 6.528, + "westus2": 6.016 + }, + "standardd96asv4": { + "australiaeast": 10.176, + "brazilsouth": 11.76, + "centralindia": 9.264, + "centralus": 9.623, + "eastasia": 10.752, + "eastus": 9.024, + "eastus2": 9.024, + "francecentral": 9.792, + "japaneast": 10.368, + "koreacentral": 10.08, + "northeurope": 9.552, + "southcentralus": 9.946, + "southeastasia": 10.176, + "uksouth": 9.744, + "westeurope": 9.936, + "westus": 9.792, + "westus2": 9.024 + }, + "standardd96av4": { + "australiaeast": 10.176, + "brazilsouth": 11.76, + "centralindia": 9.264, + "centralus": 9.623, + "eastasia": 10.752, + "eastus": 9.024, + "eastus2": 9.024, + "francecentral": 9.792, + "japaneast": 10.368, + "koreacentral": 10.08, + "northeurope": 9.552, + "southcentralus": 9.946, + "southeastasia": 10.176, + "uksouth": 9.744, + "westeurope": 9.936, + "westus": 9.792, + "westus2": 9.024 + }, + "standarddc1sv2": { + "canadacentral": 0.283, + "canadaeast": 0.283, + "eastus": 0.244, + "southeastasia": 0.303, + "uksouth": 0.293, + "westeurope": 0.303, + "westus2": 0.244 + }, + "standarddc2s": { + "eastus": 0.244, + "westeurope": 0.303 + }, + "standarddc2sv2": { + "canadacentral": 0.566, + "canadaeast": 0.566, + "eastus": 0.487, + "southeastasia": 0.606, + "uksouth": 0.586, + "westeurope": 0.606, + "westus2": 0.487 + }, + "standarddc4s": { + "eastus": 0.487, + "westeurope": 0.606 + }, + "standarddc4sv2": { + "canadacentral": 1.133, + "canadaeast": 1.133, + "eastus": 0.975, + "southeastasia": 1.212, + "uksouth": 1.172, + "westeurope": 1.212, + "westus2": 0.975 + }, + "standarddc8sv2": { + "canadacentral": 2.266, + "canadaeast": 2.266, + "eastus": 1.95, + "southeastasia": 2.424, + "uksouth": 2.345, + "westeurope": 2.424, + "westus2": 1.95 + }, + "standardds1v2": { + "australiacentral": 0.14, + "australiacentral2": 0.14, + "australiaeast": 0.14, + "australiasoutheast": 0.14, + "brazilsouth": 0.132, + "brazilsoutheast": 0.157, + "canadacentral": 0.129, + "canadaeast": 0.129, + "centralindia": 0.13, + "centralus": 0.126, + "eastasia": 0.167, + "eastus": 0.126, + "eastus2": 0.117, + "francecentral": 0.147, + "francesouth": 0.191, + "germanycentral": 0.1439, + "germanynorth": 0.133, + "germanynortheast": 0.1439, + "germanywestcentral": 0.142, + "japaneast": 0.136, + "japanwest": 0.131, + "koreacentral": 0.129, + "koreasouth": 0.116, + "northcentralus": 0.126, + "northeurope": 0.116, + "norwayeast": 0.121, + "norwaywest": 0.143, + "southafricanorth": 0.123, + "southafricawest": 0.142, + "southcentralus": 0.117, + "southeastasia": 0.145, + "southindia": 0.13, + "switzerlandnorth": 0.128, + "switzerlandwest": 0.152, + "uaecentral": 0.135, + "uaenorth": 0.115, + "uksouth": 0.147, + "ukwest": 0.147, + "usgovarizona": 0.146, + "usgovtexas": 0.146, + "usgovvirginia": 0.146, + "westcentralus": 0.117, + "westeurope": 0.133, + "westindia": 0.13, + "westus": 0.126, + "westus2": 0.117 + }, + "standardds2v2": { + "australiacentral": 0.281, + "australiacentral2": 0.281, + "australiaeast": 0.281, + "australiasoutheast": 0.281, + "brazilsouth": 0.263, + "brazilsoutheast": 0.315, + "canadacentral": 0.257, + "canadaeast": 0.257, + "centralindia": 0.261, + "centralus": 0.252, + "eastasia": 0.333, + "eastus": 0.252, + "eastus2": 0.234, + "francecentral": 0.294, + "francesouth": 0.382, + "germanycentral": 0.2878, + "germanynorth": 0.266, + "germanynortheast": 0.2878, + "germanywestcentral": 0.284, + "japaneast": 0.273, + "japanwest": 0.263, + "koreacentral": 0.257, + "koreasouth": 0.231, + "northcentralus": 0.252, + "northeurope": 0.232, + "norwayeast": 0.242, + "norwaywest": 0.286, + "southafricanorth": 0.245, + "southafricawest": 0.284, + "southcentralus": 0.234, + "southeastasia": 0.29, + "southindia": 0.261, + "switzerlandnorth": 0.255, + "switzerlandwest": 0.304, + "uaecentral": 0.271, + "uaenorth": 0.229, + "uksouth": 0.294, + "ukwest": 0.294, + "usgovarizona": 0.293, + "usgovtexas": 0.293, + "usgovvirginia": 0.293, + "westcentralus": 0.234, + "westeurope": 0.266, + "westindia": 0.261, + "westus": 0.252, + "westus2": 0.234 + }, + "standardds3v2": { + "australiacentral": 0.562, + "australiacentral2": 0.562, + "australiaeast": 0.562, + "australiasoutheast": 0.562, + "brazilsouth": 0.527, + "brazilsoutheast": 0.629, + "canadacentral": 0.515, + "canadaeast": 0.515, + "centralindia": 0.521, + "centralus": 0.504, + "eastasia": 0.667, + "eastus": 0.504, + "eastus2": 0.468, + "francecentral": 0.588, + "francesouth": 0.764, + "germanycentral": 0.5757, + "germanynorth": 0.532, + "germanynortheast": 0.5757, + "germanywestcentral": 0.567, + "japaneast": 0.546, + "japanwest": 0.526, + "koreacentral": 0.514, + "koreasouth": 0.463, + "northcentralus": 0.504, + "northeurope": 0.465, + "norwayeast": 0.483, + "norwaywest": 0.573, + "southafricanorth": 0.491, + "southafricawest": 0.569, + "southcentralus": 0.468, + "southeastasia": 0.58, + "southindia": 0.521, + "switzerlandnorth": 0.51, + "switzerlandwest": 0.608, + "uaecentral": 0.541, + "uaenorth": 0.459, + "uksouth": 0.588, + "ukwest": 0.588, + "usgovarizona": 0.585, + "usgovtexas": 0.585, + "usgovvirginia": 0.585, + "westcentralus": 0.468, + "westeurope": 0.533, + "westindia": 0.521, + "westus": 0.504, + "westus2": 0.468 + }, + "standardds4v2": { + "australiacentral": 1.123, + "australiacentral2": 1.123, + "australiaeast": 1.123, + "australiasoutheast": 1.123, + "brazilsouth": 1.053, + "brazilsoutheast": 1.258, + "canadacentral": 1.03, + "canadaeast": 1.03, + "centralindia": 1.043, + "centralus": 1.008, + "eastasia": 1.333, + "eastus": 1.008, + "eastus2": 0.936, + "francecentral": 1.176, + "francesouth": 1.528, + "germanycentral": 1.151, + "germanynorth": 1.065, + "germanynortheast": 1.151, + "germanywestcentral": 1.136, + "japaneast": 1.091, + "japanwest": 1.051, + "koreacentral": 1.028, + "koreasouth": 0.925, + "northcentralus": 1.008, + "northeurope": 0.929, + "norwayeast": 0.966, + "norwaywest": 1.146, + "southafricanorth": 0.982, + "southafricawest": 1.137, + "southcentralus": 0.936, + "southeastasia": 1.159, + "southindia": 1.043, + "switzerlandnorth": 1.021, + "switzerlandwest": 1.217, + "uaecentral": 1.082, + "uaenorth": 0.918, + "uksouth": 1.176, + "ukwest": 1.176, + "usgovarizona": 1.17, + "usgovtexas": 1.17, + "usgovvirginia": 1.17, + "westcentralus": 0.936, + "westeurope": 1.066, + "westindia": 1.043, + "westus": 1.008, + "westus2": 0.936 + }, + "standardds5v2": { + "australiacentral": 2.245, + "australiacentral2": 2.245, + "australiaeast": 2.245, + "australiasoutheast": 2.245, + "brazilsouth": 2.106, + "brazilsoutheast": 2.516, + "canadacentral": 2.059, + "canadaeast": 2.059, + "centralindia": 2.086, + "centralus": 2.016, + "eastasia": 2.666, + "eastus": 2.016, + "eastus2": 1.872, + "francecentral": 2.351, + "francesouth": 3.056, + "germanycentral": 2.3026, + "germanynorth": 2.13, + "germanynortheast": 2.3026, + "germanywestcentral": 2.272, + "japaneast": 2.183, + "japanwest": 2.102, + "koreacentral": 2.057, + "koreasouth": 1.851, + "northcentralus": 2.016, + "northeurope": 1.858, + "norwayeast": 1.932, + "norwaywest": 2.29, + "southafricanorth": 1.963, + "southafricawest": 2.275, + "southcentralus": 1.872, + "southeastasia": 2.318, + "southindia": 2.086, + "switzerlandnorth": 2.042, + "switzerlandwest": 2.433, + "uaecentral": 2.165, + "uaenorth": 1.835, + "uksouth": 2.351, + "ukwest": 2.351, + "usgovarizona": 2.34, + "usgovtexas": 2.34, + "usgovvirginia": 2.34, + "westcentralus": 1.872, + "westeurope": 2.131, + "westindia": 2.086, + "westus": 2.016, + "westus2": 1.872 + }, + "standardds11v2": { + "australiacentral": 0.295, + "australiacentral2": 0.295, + "australiaeast": 0.295, + "australiasoutheast": 0.295, + "brazilsouth": 0.403, + "brazilsoutheast": 0.398, + "canadacentral": 0.267, + "canadaeast": 0.267, + "centralindia": 0.282, + "centralus": 0.264, + "eastasia": 0.352, + "eastus": 0.264, + "eastus2": 0.243, + "francecentral": 0.308, + "francesouth": 0.4, + "germanycentral": 0.292, + "germanynorth": 0.308, + "germanynortheast": 0.292, + "germanywestcentral": 0.325, + "japaneast": 0.327, + "japanwest": 0.285, + "koreacentral": 0.292, + "koreasouth": 0.262, + "northcentralus": 0.264, + "northeurope": 0.243, + "norwayeast": 0.301, + "norwaywest": 0.364, + "southafricanorth": 0.292, + "southafricawest": 0.343, + "southcentralus": 0.243, + "southeastasia": 0.295, + "southindia": 0.282, + "switzerlandnorth": 0.32, + "switzerlandwest": 0.388, + "uaecentral": 0.325, + "uaenorth": 0.271, + "uksouth": 0.308, + "ukwest": 0.308, + "usgovarizona": 0.304, + "usgovtexas": 0.304, + "usgovvirginia": 0.304, + "westcentralus": 0.243, + "westeurope": 0.279, + "westindia": 0.282, + "westus": 0.264, + "westus2": 0.243 + }, + "standardds12v2": { + "australiacentral": 0.591, + "australiacentral2": 0.591, + "australiaeast": 0.591, + "australiasoutheast": 0.591, + "brazilsouth": 0.807, + "brazilsoutheast": 0.795, + "canadacentral": 0.535, + "canadaeast": 0.535, + "centralindia": 0.563, + "centralus": 0.528, + "eastasia": 0.704, + "eastus": 0.528, + "eastus2": 0.486, + "francecentral": 0.615, + "francesouth": 0.8, + "germanycentral": 0.583, + "germanynorth": 0.616, + "germanynortheast": 0.583, + "germanywestcentral": 0.65, + "japaneast": 0.654, + "japanwest": 0.569, + "koreacentral": 0.583, + "koreasouth": 0.525, + "northcentralus": 0.528, + "northeurope": 0.486, + "norwayeast": 0.601, + "norwaywest": 0.726, + "southafricanorth": 0.585, + "southafricawest": 0.686, + "southcentralus": 0.486, + "southeastasia": 0.591, + "southindia": 0.563, + "switzerlandnorth": 0.64, + "switzerlandwest": 0.777, + "uaecentral": 0.65, + "uaenorth": 0.543, + "uksouth": 0.615, + "ukwest": 0.615, + "usgovarizona": 0.608, + "usgovtexas": 0.608, + "usgovvirginia": 0.608, + "westcentralus": 0.486, + "westeurope": 0.557, + "westindia": 0.563, + "westus": 0.528, + "westus2": 0.486 + }, + "standardds13v2": { + "australiacentral": 1.182, + "australiacentral2": 1.182, + "australiaeast": 1.182, + "australiasoutheast": 1.182, + "brazilsouth": 1.614, + "brazilsoutheast": 1.59, + "canadacentral": 1.069, + "canadaeast": 1.069, + "centralindia": 1.126, + "centralus": 1.056, + "eastasia": 1.407, + "eastus": 1.056, + "eastus2": 0.972, + "francecentral": 1.23, + "francesouth": 1.599, + "germanycentral": 1.167, + "germanynorth": 1.231, + "germanynortheast": 1.167, + "germanywestcentral": 1.18, + "japaneast": 1.309, + "japanwest": 1.138, + "koreacentral": 1.166, + "koreasouth": 1.049, + "northcentralus": 1.056, + "northeurope": 0.972, + "norwayeast": 1.203, + "norwaywest": 1.453, + "southafricanorth": 1.169, + "southafricawest": 1.373, + "southcentralus": 0.972, + "southeastasia": 1.182, + "southindia": 1.126, + "switzerlandnorth": 1.28, + "switzerlandwest": 1.554, + "uaecentral": 1.301, + "uaenorth": 1.086, + "uksouth": 1.23, + "ukwest": 1.23, + "usgovarizona": 1.215, + "usgovtexas": 1.215, + "usgovvirginia": 1.215, + "westcentralus": 0.972, + "westeurope": 1.114, + "westindia": 1.126, + "westus": 1.056, + "westus2": 0.972 + }, + "standardds14v2": { + "australiacentral": 2.363, + "australiacentral2": 2.363, + "australiaeast": 2.363, + "australiasoutheast": 2.363, + "brazilsouth": 3.227, + "brazilsoutheast": 3.179, + "canadacentral": 2.138, + "canadaeast": 2.138, + "centralindia": 2.252, + "centralus": 2.111, + "eastasia": 2.814, + "eastus": 2.111, + "eastus2": 1.944, + "francecentral": 2.46, + "francesouth": 3.198, + "germanycentral": 2.333, + "germanynorth": 2.462, + "germanynortheast": 2.333, + "germanywestcentral": 2.228, + "japaneast": 2.617, + "japanwest": 2.276, + "koreacentral": 2.332, + "koreasouth": 2.099, + "northcentralus": 2.111, + "northeurope": 1.944, + "norwayeast": 2.406, + "norwaywest": 2.907, + "southafricanorth": 2.339, + "southafricawest": 2.745, + "southcentralus": 1.944, + "southeastasia": 2.363, + "southindia": 2.252, + "switzerlandnorth": 2.56, + "switzerlandwest": 3.107, + "uaecentral": 2.602, + "uaenorth": 2.171, + "uksouth": 2.46, + "ukwest": 2.46, + "usgovarizona": 2.43, + "usgovtexas": 2.43, + "usgovvirginia": 2.43, + "westcentralus": 1.944, + "westeurope": 2.228, + "westindia": 2.252, + "westus": 2.111, + "westus2": 1.944 + }, + "standardds15iv2": { + "australiacentral": 2.954, + "australiacentral2": 2.954, + "australiaeast": 2.954, + "australiasoutheast": 2.954, + "brazilsouth": 4.034, + "brazilsoutheast": 3.974, + "canadacentral": 2.673, + "canadaeast": 2.673, + "centralindia": 2.815, + "centralus": 2.639, + "eastasia": 3.518, + "eastus": 2.639, + "eastus2": 2.43, + "francecentral": 3.075, + "francesouth": 3.9975, + "germanynorth": 3.078, + "germanywestcentral": 2.58, + "japaneast": 3.271, + "japanwest": 2.845, + "koreacentral": 2.915, + "koreasouth": 2.624, + "northcentralus": 2.639, + "northeurope": 2.43, + "norwayeast": 3.007, + "norwaywest": 3.633, + "southafricanorth": 2.923, + "southafricawest": 3.432, + "southcentralus": 2.43, + "southeastasia": 2.954, + "southindia": 2.815, + "switzerlandnorth": 3.2, + "switzerlandwest": 3.884, + "uaecentral": 3.252, + "uaenorth": 2.714, + "uksouth": 3.075, + "ukwest": 3.075, + "usgovarizona": 2.784, + "usgovtexas": 2.784, + "usgovvirginia": 2.784, + "westcentralus": 2.43, + "westeurope": 2.785, + "westindia": 2.815, + "westus": 2.639, + "westus2": 2.43 + }, + "standardds15v2": { + "australiacentral": 2.954, + "australiacentral2": 2.954, + "australiaeast": 2.954, + "australiasoutheast": 2.954, + "brazilsouth": 4.034, + "brazilsoutheast": 3.974, + "canadacentral": 2.673, + "canadaeast": 2.673, + "centralindia": 2.815, + "centralus": 2.639, + "eastasia": 3.518, + "eastus": 2.639, + "eastus2": 2.43, + "francecentral": 3.075, + "francesouth": 3.997, + "germanycentral": 2.916, + "germanynorth": 3.078, + "germanynortheast": 2.916, + "germanywestcentral": 3.25, + "japaneast": 3.271, + "japanwest": 2.845, + "koreacentral": 2.915, + "koreasouth": 2.624, + "northcentralus": 2.639, + "northeurope": 2.43, + "norwayeast": 3.007, + "norwaywest": 3.633, + "southafricanorth": 2.923, + "southafricawest": 3.432, + "southcentralus": 2.43, + "southeastasia": 2.954, + "southindia": 2.815, + "switzerlandnorth": 3.2, + "switzerlandwest": 3.884, + "uaecentral": 3.252, + "uaenorth": 2.714, + "uksouth": 3.075, + "ukwest": 3.075, + "usgovarizona": 3.038, + "usgovtexas": 3.038, + "usgovvirginia": 3.038, + "westcentralus": 2.43, + "westeurope": 2.785, + "westindia": 2.815, + "westus": 2.639, + "westus2": 2.43 + }, + "standarde2asv4": { + "australiaeast": 0.243, + "brazilsouth": 0.293, + "centralindia": 0.222, + "centralus": 0.234, + "eastasia": 0.259, + "eastus": 0.218, + "eastus2": 0.218, + "francecentral": 0.24, + "japaneast": 0.244, + "koreacentral": 0.244, + "northeurope": 0.233, + "southcentralus": 0.243, + "southeastasia": 0.244, + "uksouth": 0.24, + "westeurope": 0.244, + "westus": 0.232, + "westus2": 0.218 + }, + "standarde2av4": { + "australiaeast": 0.243, + "brazilsouth": 0.293, + "centralindia": 0.222, + "centralus": 0.234, + "eastasia": 0.259, + "eastus": 0.218, + "eastus2": 0.218, + "francecentral": 0.24, + "japaneast": 0.244, + "koreacentral": 0.244, + "northeurope": 0.233, + "southcentralus": 0.243, + "southeastasia": 0.244, + "uksouth": 0.24, + "westeurope": 0.244, + "westus": 0.232, + "westus2": 0.218 + }, + "standarde2dsv4": { + "australiaeast": 0.266, + "australiasoutheast": 0.265, + "brazilsouth": 0.321, + "canadacentral": 0.25, + "canadaeast": 0.265, + "centralindia": 0.243, + "centralus": 0.255, + "eastasia": 0.315, + "eastus": 0.236, + "eastus2": 0.236, + "francecentral": 0.261, + "francesouth": 0.311, + "germanywestcentral": 0.265, + "japaneast": 0.266, + "japanwest": 0.283, + "koreacentral": 0.265, + "northcentralus": 0.236, + "northeurope": 0.252, + "southafricanorth": 0.285, + "southcentralus": 0.279, + "southeastasia": 0.266, + "switzerlandnorth": 0.308, + "uksouth": 0.261, + "ukwest": 0.266, + "usgovarizona": 0.265, + "usgovtexas": 0.272, + "usgovvirginia": 0.265, + "westcentralus": 0.265, + "westeurope": 0.265, + "westus": 0.254, + "westus2": 0.236 + }, + "standarde2dv4": { + "australiaeast": 4.256, + "australiasoutheast": 4.237, + "brazilsouth": 5.131, + "canadacentral": 4.0, + "canadaeast": 4.237, + "centralindia": 3.888, + "centralus": 4.076, + "eastasia": 5.043, + "eastus": 3.776, + "eastus2": 3.776, + "francecentral": 4.176, + "francesouth": 4.974, + "germanywestcentral": 4.24, + "japaneast": 4.256, + "japanwest": 4.529, + "koreacentral": 4.24, + "northcentralus": 3.776, + "northeurope": 4.032, + "southafricanorth": 4.559, + "southcentralus": 4.467, + "southeastasia": 4.256, + "switzerlandnorth": 4.928, + "uksouth": 4.176, + "ukwest": 4.26, + "usgovarizona": 4.24, + "usgovtexas": 4.352, + "usgovvirginia": 4.24, + "westcentralus": 4.237, + "westeurope": 4.24, + "westus": 4.064, + "westus2": 3.776 + }, + "standarde2sv3": { + "australiacentral": 0.252, + "australiacentral2": 0.252, + "australiaeast": 0.252, + "australiasoutheast": 0.252, + "brazilsouth": 0.372, + "brazilsoutheast": 0.398, + "canadacentral": 0.238, + "canadaeast": 0.238, + "centralindia": 0.229, + "centralus": 0.248, + "eastasia": 0.259, + "eastus": 0.218, + "eastus2": 0.225, + "francecentral": 0.248, + "francesouth": 0.295, + "germanycentral": 0.272, + "germanynorth": 0.29, + "germanynortheast": 0.272, + "germanywestcentral": 0.244, + "japaneast": 0.252, + "japanwest": 0.252, + "koreacentral": 0.252, + "koreasouth": 0.227, + "northcentralus": 0.218, + "northeurope": 0.233, + "norwayeast": 0.268, + "norwaywest": 0.321, + "southafricanorth": 0.261, + "southafricawest": 0.304, + "southcentralus": 0.243, + "southeastasia": 0.252, + "southindia": 0.268, + "switzerlandnorth": 0.284, + "switzerlandwest": 0.342, + "uaecentral": 0.289, + "uaenorth": 0.243, + "uksouth": 0.248, + "ukwest": 0.248, + "usgovarizona": 0.252, + "usgovtexas": 0.252, + "usgovvirginia": 0.252, + "westcentralus": 0.243, + "westeurope": 0.252, + "westindia": 0.244, + "westus": 0.24, + "westus2": 0.218 + }, + "standarde2sv4": { + "australiaeast": 0.243, + "australiasoutheast": 0.256, + "brazilsouth": 0.293, + "brazilsoutheast": 0.353, + "canadacentral": 0.23, + "canadaeast": 0.23, + "centralindia": 0.222, + "centralus": 0.234, + "eastasia": 0.287, + "eastus": 0.218, + "eastus2": 0.218, + "francecentral": 0.24, + "francesouth": 0.284, + "germanywestcentral": 0.244, + "japaneast": 0.244, + "japanwest": 0.259, + "koreacentral": 0.244, + "northcentralus": 0.218, + "northeurope": 0.233, + "southafricanorth": 0.261, + "southcentralus": 0.243, + "southeastasia": 0.244, + "switzerlandnorth": 0.281, + "uksouth": 0.24, + "ukwest": 0.244, + "usgovarizona": 0.243, + "usgovtexas": 0.25, + "usgovvirginia": 0.243, + "westcentralus": 0.243, + "westeurope": 0.244, + "westus": 0.232, + "westus2": 0.218 + }, + "standarde2v3": { + "australiacentral": 0.252, + "australiacentral2": 0.252, + "australiaeast": 0.252, + "australiasoutheast": 0.252, + "brazilsouth": 0.372, + "brazilsoutheast": 0.398, + "canadacentral": 0.238, + "canadaeast": 0.238, + "centralindia": 0.229, + "centralus": 0.248, + "eastasia": 0.259, + "eastus": 0.218, + "eastus2": 0.225, + "francecentral": 0.248, + "francesouth": 0.295, + "germanycentral": 0.272, + "germanynorth": 0.29, + "germanynortheast": 0.272, + "germanywestcentral": 0.244, + "japaneast": 0.252, + "japanwest": 0.252, + "koreacentral": 0.252, + "koreasouth": 0.227, + "northcentralus": 0.218, + "northeurope": 0.233, + "norwayeast": 0.268, + "norwaywest": 0.321, + "southafricanorth": 0.261, + "southafricawest": 0.304, + "southcentralus": 0.243, + "southeastasia": 0.252, + "southindia": 0.268, + "switzerlandnorth": 0.284, + "switzerlandwest": 0.342, + "uaecentral": 0.289, + "uaenorth": 0.243, + "uksouth": 0.248, + "ukwest": 0.248, + "usgovarizona": 0.252, + "usgovtexas": 0.252, + "usgovvirginia": 0.252, + "westcentralus": 0.243, + "westeurope": 0.252, + "westindia": 0.244, + "westus": 0.24, + "westus2": 0.218 + }, + "standarde2v4": { + "australiaeast": 0.243, + "australiasoutheast": 0.256, + "brazilsouth": 0.293, + "brazilsoutheast": 0.353, + "canadacentral": 0.23, + "canadaeast": 0.23, + "centralindia": 0.222, + "centralus": 0.234, + "eastasia": 0.287, + "eastus": 0.218, + "eastus2": 0.218, + "francecentral": 0.24, + "francesouth": 0.284, + "germanywestcentral": 0.244, + "japaneast": 0.244, + "japanwest": 0.259, + "koreacentral": 0.244, + "northcentralus": 0.218, + "northeurope": 0.233, + "southafricanorth": 0.261, + "southcentralus": 0.243, + "southeastasia": 0.244, + "switzerlandnorth": 0.281, + "uksouth": 0.24, + "ukwest": 0.244, + "usgovarizona": 0.243, + "usgovtexas": 0.25, + "usgovvirginia": 0.243, + "westcentralus": 0.243, + "westeurope": 0.244, + "westus": 0.232, + "westus2": 0.218 + }, + "standarde4asv4": { + "australiaeast": 0.486, + "brazilsouth": 0.586, + "centralindia": 0.444, + "centralus": 0.469, + "eastasia": 0.518, + "eastus": 0.436, + "eastus2": 0.436, + "francecentral": 0.48, + "japaneast": 0.488, + "koreacentral": 0.488, + "northeurope": 0.466, + "southcentralus": 0.486, + "southeastasia": 0.488, + "uksouth": 0.48, + "westeurope": 0.488, + "westus": 0.464, + "westus2": 0.436 + }, + "standarde4av4": { + "australiaeast": 0.486, + "brazilsouth": 0.586, + "centralindia": 0.444, + "centralus": 0.469, + "eastasia": 0.518, + "eastus": 0.436, + "eastus2": 0.436, + "francecentral": 0.48, + "japaneast": 0.488, + "koreacentral": 0.488, + "northeurope": 0.466, + "southcentralus": 0.486, + "southeastasia": 0.488, + "uksouth": 0.48, + "westeurope": 0.488, + "westus": 0.464, + "westus2": 0.436 + }, + "standarde4dsv4": { + "australiaeast": 0.532, + "australiasoutheast": 0.53, + "brazilsouth": 0.641, + "canadacentral": 0.5, + "canadaeast": 0.53, + "centralindia": 0.486, + "centralus": 0.509, + "eastasia": 0.63, + "eastus": 0.472, + "eastus2": 0.472, + "francecentral": 0.522, + "francesouth": 0.622, + "germanywestcentral": 0.53, + "japaneast": 0.532, + "japanwest": 0.566, + "koreacentral": 0.53, + "northcentralus": 0.472, + "northeurope": 0.504, + "southafricanorth": 0.57, + "southcentralus": 0.558, + "southeastasia": 0.532, + "switzerlandnorth": 0.616, + "uksouth": 0.522, + "ukwest": 0.532, + "usgovarizona": 0.53, + "usgovtexas": 0.544, + "usgovvirginia": 0.53, + "westcentralus": 0.53, + "westeurope": 0.53, + "westus": 0.508, + "westus2": 0.472 + }, + "standarde4dv4": { + "australiaeast": 0.532, + "australiasoutheast": 0.53, + "brazilsouth": 0.641, + "canadacentral": 0.5, + "canadaeast": 0.53, + "centralindia": 0.486, + "centralus": 0.509, + "eastasia": 0.63, + "eastus": 0.472, + "eastus2": 0.472, + "francecentral": 0.522, + "francesouth": 0.622, + "germanywestcentral": 0.53, + "japaneast": 0.532, + "japanwest": 0.566, + "koreacentral": 0.53, + "northcentralus": 0.472, + "northeurope": 0.504, + "southafricanorth": 0.57, + "southcentralus": 0.558, + "southeastasia": 0.532, + "switzerlandnorth": 0.616, + "uksouth": 0.522, + "ukwest": 0.532, + "usgovarizona": 0.53, + "usgovtexas": 0.544, + "usgovvirginia": 0.53, + "westcentralus": 0.53, + "westeurope": 0.53, + "westus": 0.508, + "westus2": 0.472 + }, + "standarde4sv3": { + "australiacentral": 0.503, + "australiacentral2": 0.503, + "australiaeast": 0.503, + "australiasoutheast": 0.503, + "brazilsouth": 0.744, + "brazilsoutheast": 0.795, + "canadacentral": 0.476, + "canadaeast": 0.476, + "centralindia": 0.458, + "centralus": 0.495, + "eastasia": 0.518, + "eastus": 0.436, + "eastus2": 0.45, + "francecentral": 0.496, + "francesouth": 0.6448, + "germanycentral": 0.544, + "germanynorth": 0.579, + "germanynortheast": 0.544, + "germanywestcentral": 0.488, + "japaneast": 0.504, + "japanwest": 0.504, + "koreacentral": 0.504, + "koreasouth": 0.454, + "northcentralus": 0.436, + "northeurope": 0.466, + "norwayeast": 0.536, + "norwaywest": 0.642, + "southafricanorth": 0.522, + "southafricawest": 0.607, + "southcentralus": 0.486, + "southeastasia": 0.504, + "southindia": 0.517, + "switzerlandnorth": 0.568, + "switzerlandwest": 0.683, + "uaecentral": 0.577, + "uaenorth": 0.486, + "uksouth": 0.496, + "ukwest": 0.496, + "usgovarizona": 0.503, + "usgovtexas": 0.503, + "usgovvirginia": 0.503, + "westcentralus": 0.486, + "westeurope": 0.504, + "westindia": 0.488, + "westus": 0.48, + "westus2": 0.436 + }, + "standarde4sv4": { + "australiaeast": 0.486, + "australiasoutheast": 0.512, + "brazilsouth": 0.586, + "brazilsoutheast": 0.707, + "canadacentral": 0.46, + "canadaeast": 0.46, + "centralindia": 0.444, + "centralus": 0.469, + "eastasia": 0.575, + "eastus": 0.436, + "eastus2": 0.436, + "francecentral": 0.48, + "francesouth": 0.567, + "germanywestcentral": 0.488, + "japaneast": 0.488, + "japanwest": 0.518, + "koreacentral": 0.488, + "northcentralus": 0.436, + "northeurope": 0.466, + "southafricanorth": 0.522, + "southcentralus": 0.486, + "southeastasia": 0.488, + "switzerlandnorth": 0.562, + "uksouth": 0.48, + "ukwest": 0.489, + "usgovarizona": 0.486, + "usgovtexas": 0.499, + "usgovvirginia": 0.486, + "westcentralus": 0.486, + "westeurope": 0.488, + "westus": 0.464, + "westus2": 0.436 + }, + "standarde4v3": { + "australiacentral": 0.503, + "australiacentral2": 0.503, + "australiaeast": 0.503, + "australiasoutheast": 0.503, + "brazilsouth": 0.744, + "brazilsoutheast": 0.795, + "canadacentral": 0.476, + "canadaeast": 0.476, + "centralindia": 0.458, + "centralus": 0.495, + "eastasia": 0.518, + "eastus": 0.436, + "eastus2": 0.45, + "francecentral": 0.496, + "francesouth": 0.6448, + "germanycentral": 0.544, + "germanynorth": 0.579, + "germanynortheast": 0.544, + "germanywestcentral": 0.488, + "japaneast": 0.504, + "japanwest": 0.504, + "koreacentral": 0.504, + "koreasouth": 0.454, + "northcentralus": 0.436, + "northeurope": 0.466, + "norwayeast": 0.536, + "norwaywest": 0.642, + "southafricanorth": 0.522, + "southafricawest": 0.607, + "southcentralus": 0.486, + "southeastasia": 0.504, + "southindia": 0.517, + "switzerlandnorth": 0.568, + "switzerlandwest": 0.683, + "uaecentral": 0.577, + "uaenorth": 0.486, + "uksouth": 0.496, + "ukwest": 0.496, + "usgovarizona": 0.503, + "usgovtexas": 0.503, + "usgovvirginia": 0.503, + "westcentralus": 0.486, + "westeurope": 0.504, + "westindia": 0.488, + "westus": 0.48, + "westus2": 0.436 + }, + "standarde4v4": { + "australiaeast": 0.486, + "australiasoutheast": 0.512, + "brazilsouth": 0.586, + "brazilsoutheast": 0.707, + "canadacentral": 0.46, + "canadaeast": 0.46, + "centralindia": 0.444, + "centralus": 0.469, + "eastasia": 0.575, + "eastus": 0.436, + "eastus2": 0.436, + "francecentral": 0.48, + "francesouth": 0.567, + "germanywestcentral": 0.488, + "japaneast": 0.488, + "japanwest": 0.518, + "koreacentral": 0.488, + "northcentralus": 0.436, + "northeurope": 0.466, + "southafricanorth": 0.522, + "southcentralus": 0.486, + "southeastasia": 0.488, + "switzerlandnorth": 0.562, + "uksouth": 0.48, + "ukwest": 0.489, + "usgovarizona": 0.486, + "usgovtexas": 0.499, + "usgovvirginia": 0.486, + "westcentralus": 0.486, + "westeurope": 0.488, + "westus": 0.464, + "westus2": 0.436 + }, + "standarde8asv4": { + "australiaeast": 0.972, + "brazilsouth": 1.172, + "centralindia": 0.888, + "centralus": 0.938, + "eastasia": 1.036, + "eastus": 0.872, + "eastus2": 0.872, + "francecentral": 0.96, + "japaneast": 0.976, + "koreacentral": 0.976, + "northeurope": 0.932, + "southcentralus": 0.973, + "southeastasia": 0.976, + "uksouth": 0.96, + "westeurope": 0.976, + "westus": 0.928, + "westus2": 0.872 + }, + "standarde8av4": { + "australiaeast": 0.972, + "brazilsouth": 1.172, + "centralindia": 0.888, + "centralus": 0.938, + "eastasia": 1.036, + "eastus": 0.872, + "eastus2": 0.872, + "francecentral": 0.96, + "japaneast": 0.976, + "koreacentral": 0.976, + "northeurope": 0.932, + "southcentralus": 0.973, + "southeastasia": 0.976, + "uksouth": 0.96, + "westeurope": 0.976, + "westus": 0.928, + "westus2": 0.872 + }, + "standarde8dsv4": { + "australiaeast": 1.064, + "australiasoutheast": 1.059, + "brazilsouth": 1.283, + "canadacentral": 1.0, + "canadaeast": 1.059, + "centralindia": 0.972, + "centralus": 1.019, + "eastasia": 1.261, + "eastus": 0.944, + "eastus2": 0.944, + "francecentral": 1.044, + "francesouth": 1.244, + "germanywestcentral": 1.06, + "japaneast": 1.064, + "japanwest": 1.132, + "koreacentral": 1.06, + "northcentralus": 0.944, + "northeurope": 1.008, + "southafricanorth": 1.14, + "southcentralus": 1.117, + "southeastasia": 1.064, + "switzerlandnorth": 1.232, + "uksouth": 1.044, + "ukwest": 1.065, + "usgovarizona": 1.06, + "usgovtexas": 1.088, + "usgovvirginia": 1.06, + "westcentralus": 1.059, + "westeurope": 1.06, + "westus": 1.016, + "westus2": 0.944 + }, + "standarde8dv4": { + "australiaeast": 1.064, + "australiasoutheast": 1.059, + "brazilsouth": 1.283, + "canadacentral": 1.0, + "canadaeast": 1.059, + "centralindia": 0.972, + "centralus": 1.019, + "eastasia": 1.261, + "eastus": 0.944, + "eastus2": 0.944, + "francecentral": 1.044, + "francesouth": 1.244, + "germanywestcentral": 1.06, + "japaneast": 1.064, + "japanwest": 1.132, + "koreacentral": 1.06, + "northcentralus": 0.944, + "northeurope": 1.008, + "southafricanorth": 1.14, + "southcentralus": 1.117, + "southeastasia": 1.064, + "switzerlandnorth": 1.232, + "uksouth": 1.044, + "ukwest": 1.065, + "usgovarizona": 1.06, + "usgovtexas": 1.088, + "usgovvirginia": 1.06, + "westcentralus": 1.059, + "westeurope": 1.06, + "westus": 1.016, + "westus2": 0.944 + }, + "standarde8sv3": { + "australiacentral": 1.006, + "australiacentral2": 1.006, + "australiaeast": 1.006, + "australiasoutheast": 1.006, + "brazilsouth": 1.488, + "brazilsoutheast": 1.59, + "canadacentral": 0.952, + "canadaeast": 0.952, + "centralindia": 0.916, + "centralus": 0.99, + "eastasia": 1.036, + "eastus": 0.872, + "eastus2": 0.9, + "francecentral": 0.992, + "francesouth": 1.2896, + "germanycentral": 1.089, + "germanynorth": 1.158, + "germanynortheast": 1.089, + "germanywestcentral": 0.976, + "japaneast": 1.008, + "japanwest": 1.008, + "koreacentral": 1.008, + "koreasouth": 0.907, + "northcentralus": 0.872, + "northeurope": 0.932, + "norwayeast": 1.072, + "norwaywest": 1.283, + "southafricanorth": 1.043, + "southafricawest": 1.215, + "southcentralus": 0.972, + "southeastasia": 1.008, + "southindia": 1.035, + "switzerlandnorth": 1.136, + "switzerlandwest": 1.366, + "uaecentral": 1.154, + "uaenorth": 0.973, + "uksouth": 0.992, + "ukwest": 0.992, + "usgovarizona": 1.006, + "usgovtexas": 1.006, + "usgovvirginia": 1.006, + "westcentralus": 0.972, + "westeurope": 1.008, + "westindia": 0.976, + "westus": 0.928, + "westus2": 0.872 + }, + "standarde8sv4": { + "australiaeast": 0.972, + "australiasoutheast": 1.023, + "brazilsouth": 1.172, + "brazilsoutheast": 1.413, + "canadacentral": 0.92, + "canadaeast": 0.92, + "centralindia": 0.888, + "centralus": 0.938, + "eastasia": 1.149, + "eastus": 0.872, + "eastus2": 0.872, + "francecentral": 0.96, + "francesouth": 1.134, + "germanywestcentral": 0.976, + "japaneast": 0.976, + "japanwest": 1.037, + "koreacentral": 0.976, + "northcentralus": 0.872, + "northeurope": 0.932, + "southafricanorth": 1.043, + "southcentralus": 0.973, + "southeastasia": 0.976, + "switzerlandnorth": 1.124, + "uksouth": 0.96, + "ukwest": 0.978, + "usgovarizona": 0.972, + "usgovtexas": 0.998, + "usgovvirginia": 0.972, + "westcentralus": 0.973, + "westeurope": 0.976, + "westus": 0.928, + "westus2": 0.872 + }, + "standarde8v3": { + "australiacentral": 1.006, + "australiacentral2": 1.006, + "australiaeast": 1.006, + "australiasoutheast": 1.006, + "brazilsouth": 1.488, + "brazilsoutheast": 1.59, + "canadacentral": 0.952, + "canadaeast": 0.952, + "centralindia": 0.916, + "centralus": 0.99, + "eastasia": 1.036, + "eastus": 0.872, + "eastus2": 0.9, + "francecentral": 0.992, + "francesouth": 1.2896, + "germanycentral": 1.089, + "germanynorth": 1.158, + "germanynortheast": 1.089, + "germanywestcentral": 0.976, + "japaneast": 1.008, + "japanwest": 1.008, + "koreacentral": 1.008, + "koreasouth": 0.907, + "northcentralus": 0.872, + "northeurope": 0.932, + "norwayeast": 1.072, + "norwaywest": 1.283, + "southafricanorth": 1.043, + "southafricawest": 1.215, + "southcentralus": 0.972, + "southeastasia": 1.008, + "southindia": 1.035, + "switzerlandnorth": 1.136, + "switzerlandwest": 1.366, + "uaecentral": 1.154, + "uaenorth": 0.973, + "uksouth": 0.992, + "ukwest": 0.992, + "usgovarizona": 1.006, + "usgovtexas": 1.006, + "usgovvirginia": 1.006, + "westcentralus": 0.972, + "westeurope": 1.008, + "westindia": 0.976, + "westus": 0.928, + "westus2": 0.872 + }, + "standarde8v4": { + "australiaeast": 0.972, + "australiasoutheast": 1.023, + "brazilsouth": 1.172, + "brazilsoutheast": 1.413, + "canadacentral": 0.92, + "canadaeast": 0.92, + "centralindia": 0.888, + "centralus": 0.938, + "eastasia": 1.149, + "eastus": 0.872, + "eastus2": 0.872, + "francecentral": 0.96, + "francesouth": 1.134, + "germanywestcentral": 0.976, + "japaneast": 0.976, + "japanwest": 1.037, + "koreacentral": 0.976, + "northcentralus": 0.872, + "northeurope": 0.932, + "southafricanorth": 1.043, + "southcentralus": 0.973, + "southeastasia": 0.976, + "switzerlandnorth": 1.124, + "uksouth": 0.96, + "ukwest": 0.978, + "usgovarizona": 0.972, + "usgovtexas": 0.998, + "usgovvirginia": 0.972, + "westcentralus": 0.973, + "westeurope": 0.976, + "westus": 0.928, + "westus2": 0.872 + }, + "standarde16asv4": { + "australiaeast": 1.944, + "brazilsouth": 2.344, + "centralindia": 1.776, + "centralus": 1.875, + "eastasia": 2.072, + "eastus": 1.744, + "eastus2": 1.744, + "francecentral": 1.92, + "japaneast": 1.952, + "koreacentral": 1.952, + "northeurope": 1.864, + "southcentralus": 1.946, + "southeastasia": 1.952, + "uksouth": 1.92, + "westeurope": 1.952, + "westus": 1.856, + "westus2": 1.744 + }, + "standarde16av4": { + "australiaeast": 1.944, + "brazilsouth": 2.344, + "centralindia": 1.776, + "centralus": 1.875, + "eastasia": 2.072, + "eastus": 1.744, + "eastus2": 1.744, + "francecentral": 1.92, + "japaneast": 1.952, + "koreacentral": 1.952, + "northeurope": 1.864, + "southcentralus": 1.946, + "southeastasia": 1.952, + "uksouth": 1.92, + "westeurope": 1.952, + "westus": 1.856, + "westus2": 1.744 + }, + "standarde16dsv4": { + "australiaeast": 2.128, + "australiasoutheast": 2.118, + "brazilsouth": 2.566, + "canadacentral": 2.0, + "canadaeast": 2.118, + "centralindia": 1.944, + "centralus": 2.038, + "eastasia": 2.522, + "eastus": 1.888, + "eastus2": 1.888, + "francecentral": 2.088, + "francesouth": 2.487, + "germanywestcentral": 2.12, + "japaneast": 2.128, + "japanwest": 2.265, + "koreacentral": 2.12, + "northcentralus": 1.888, + "northeurope": 2.016, + "southafricanorth": 2.28, + "southcentralus": 2.234, + "southeastasia": 2.128, + "switzerlandnorth": 2.464, + "uksouth": 2.088, + "ukwest": 2.13, + "usgovarizona": 2.12, + "usgovtexas": 2.176, + "usgovvirginia": 2.12, + "westcentralus": 2.118, + "westeurope": 2.12, + "westus": 2.032, + "westus2": 1.888 + }, + "standarde16dv4": { + "australiaeast": 2.128, + "australiasoutheast": 2.118, + "brazilsouth": 2.566, + "canadacentral": 2.0, + "canadaeast": 2.118, + "centralindia": 1.944, + "centralus": 2.038, + "eastasia": 2.522, + "eastus": 1.888, + "eastus2": 1.888, + "francecentral": 2.088, + "francesouth": 2.487, + "germanywestcentral": 2.12, + "japaneast": 2.128, + "japanwest": 2.265, + "koreacentral": 2.12, + "northcentralus": 1.888, + "northeurope": 2.016, + "southafricanorth": 2.28, + "southcentralus": 2.234, + "southeastasia": 2.128, + "switzerlandnorth": 2.464, + "uksouth": 2.088, + "ukwest": 2.13, + "usgovarizona": 2.12, + "usgovtexas": 2.176, + "usgovvirginia": 2.12, + "westcentralus": 2.118, + "westeurope": 2.12, + "westus": 2.032, + "westus2": 1.888 + }, + "standarde16sv3": { + "australiacentral": 1.944, + "australiacentral2": 1.944, + "australiaeast": 1.944, + "australiasoutheast": 1.944, + "brazilsouth": 2.976, + "brazilsoutheast": 3.18, + "canadacentral": 1.904, + "canadaeast": 1.904, + "centralindia": 1.832, + "centralus": 1.98, + "eastasia": 2.072, + "eastus": 1.744, + "eastus2": 1.8, + "francecentral": 1.984, + "francesouth": 2.357, + "germanycentral": 2.177, + "germanynorth": 2.317, + "germanynortheast": 2.177, + "germanywestcentral": 1.952, + "japaneast": 2.016, + "japanwest": 2.016, + "koreacentral": 2.016, + "koreasouth": 1.814, + "northcentralus": 1.744, + "northeurope": 1.864, + "norwayeast": 2.144, + "norwaywest": 2.566, + "southafricanorth": 2.087, + "southafricawest": 2.429, + "southcentralus": 1.944, + "southeastasia": 2.016, + "southindia": 2.07, + "switzerlandnorth": 2.272, + "switzerlandwest": 2.733, + "uaecentral": 2.308, + "uaenorth": 1.946, + "uksouth": 1.984, + "ukwest": 1.984, + "usgovarizona": 1.944, + "usgovtexas": 1.944, + "usgovvirginia": 1.944, + "westcentralus": 1.944, + "westeurope": 2.016, + "westindia": 1.952, + "westus": 1.856, + "westus2": 1.744 + }, + "standarde16sv4": { + "australiaeast": 1.944, + "australiasoutheast": 2.046, + "brazilsouth": 2.344, + "brazilsoutheast": 2.826, + "canadacentral": 1.84, + "canadaeast": 1.84, + "centralindia": 1.776, + "centralus": 1.875, + "eastasia": 2.298, + "eastus": 1.744, + "eastus2": 1.744, + "francecentral": 1.92, + "francesouth": 2.268, + "germanywestcentral": 1.952, + "japaneast": 1.952, + "japanwest": 2.074, + "koreacentral": 1.952, + "northcentralus": 1.744, + "northeurope": 1.864, + "southafricanorth": 2.087, + "southcentralus": 1.946, + "southeastasia": 1.952, + "switzerlandnorth": 2.248, + "uksouth": 1.92, + "ukwest": 1.956, + "usgovarizona": 1.944, + "usgovtexas": 1.996, + "usgovvirginia": 1.944, + "westcentralus": 1.946, + "westeurope": 1.952, + "westus": 1.856, + "westus2": 1.744 + }, + "standarde16v3": { + "australiacentral": 1.944, + "australiacentral2": 1.944, + "australiaeast": 1.944, + "australiasoutheast": 1.944, + "brazilsouth": 2.976, + "brazilsoutheast": 3.18, + "canadacentral": 1.904, + "canadaeast": 1.904, + "centralindia": 1.832, + "centralus": 1.98, + "eastasia": 2.072, + "eastus": 1.744, + "eastus2": 1.8, + "francecentral": 1.984, + "francesouth": 2.357, + "germanycentral": 2.177, + "germanynorth": 2.317, + "germanynortheast": 2.177, + "germanywestcentral": 1.952, + "japaneast": 2.016, + "japanwest": 2.016, + "koreacentral": 2.016, + "koreasouth": 1.814, + "northcentralus": 1.744, + "northeurope": 1.864, + "norwayeast": 2.144, + "norwaywest": 2.566, + "southafricanorth": 2.087, + "southafricawest": 2.429, + "southcentralus": 1.944, + "southeastasia": 2.016, + "southindia": 2.07, + "switzerlandnorth": 2.272, + "switzerlandwest": 2.733, + "uaecentral": 2.308, + "uaenorth": 1.946, + "uksouth": 1.984, + "ukwest": 1.984, + "usgovarizona": 1.944, + "usgovtexas": 1.944, + "usgovvirginia": 1.944, + "westcentralus": 1.944, + "westeurope": 2.016, + "westindia": 1.952, + "westus": 1.856, + "westus2": 1.744 + }, + "standarde16v4": { + "australiaeast": 1.944, + "australiasoutheast": 2.046, + "brazilsouth": 2.344, + "brazilsoutheast": 2.826, + "canadacentral": 1.84, + "canadaeast": 1.84, + "centralindia": 1.776, + "centralus": 1.875, + "eastasia": 2.298, + "eastus": 1.744, + "eastus2": 1.744, + "francecentral": 1.92, + "francesouth": 2.268, + "germanywestcentral": 1.952, + "japaneast": 1.952, + "japanwest": 2.074, + "koreacentral": 1.952, + "northcentralus": 1.744, + "northeurope": 1.864, + "southafricanorth": 2.087, + "southcentralus": 1.946, + "southeastasia": 1.952, + "switzerlandnorth": 2.248, + "uksouth": 1.92, + "ukwest": 1.956, + "usgovarizona": 1.944, + "usgovtexas": 1.996, + "usgovvirginia": 1.944, + "westcentralus": 1.946, + "westeurope": 1.952, + "westus": 1.856, + "westus2": 1.744 + }, + "standarde20asv4": { + "australiaeast": 2.43, + "brazilsouth": 2.93, + "centralindia": 2.22, + "centralus": 2.344, + "eastasia": 2.59, + "eastus": 2.18, + "eastus2": 2.18, + "francecentral": 2.4, + "japaneast": 2.44, + "koreacentral": 2.44, + "northeurope": 2.33, + "southcentralus": 2.432, + "southeastasia": 2.44, + "uksouth": 2.4, + "westeurope": 2.44, + "westus": 2.32, + "westus2": 2.18 + }, + "standarde20av4": { + "australiaeast": 2.43, + "brazilsouth": 2.93, + "centralindia": 2.22, + "centralus": 2.344, + "eastasia": 2.59, + "eastus": 2.18, + "eastus2": 2.18, + "francecentral": 2.4, + "japaneast": 2.44, + "koreacentral": 2.44, + "northeurope": 2.33, + "southcentralus": 2.432, + "southeastasia": 2.44, + "uksouth": 2.4, + "westeurope": 2.44, + "westus": 2.32, + "westus2": 2.18 + }, + "standarde20dsv4": { + "australiaeast": 2.66, + "australiasoutheast": 2.648, + "brazilsouth": 3.207, + "canadacentral": 2.5, + "canadaeast": 2.648, + "centralindia": 2.43, + "centralus": 2.547, + "eastasia": 3.152, + "eastus": 2.36, + "eastus2": 2.36, + "francecentral": 2.61, + "francesouth": 3.109, + "germanywestcentral": 2.65, + "japaneast": 2.66, + "japanwest": 2.831, + "koreacentral": 2.65, + "northcentralus": 2.36, + "northeurope": 2.52, + "southafricanorth": 2.85, + "southcentralus": 2.792, + "southeastasia": 2.66, + "switzerlandnorth": 3.08, + "uksouth": 2.61, + "ukwest": 2.662, + "usgovarizona": 2.65, + "usgovtexas": 2.72, + "usgovvirginia": 2.65, + "westcentralus": 2.648, + "westeurope": 2.65, + "westus": 2.54, + "westus2": 2.36 + }, + "standarde20dv4": { + "australiaeast": 2.66, + "australiasoutheast": 2.648, + "brazilsouth": 3.207, + "canadacentral": 2.5, + "canadaeast": 2.648, + "centralindia": 2.43, + "centralus": 2.547, + "eastasia": 3.152, + "eastus": 2.36, + "eastus2": 2.36, + "francecentral": 2.61, + "francesouth": 3.109, + "germanywestcentral": 2.65, + "japaneast": 2.66, + "japanwest": 2.831, + "koreacentral": 2.65, + "northcentralus": 2.36, + "northeurope": 2.52, + "southafricanorth": 2.85, + "southcentralus": 2.792, + "southeastasia": 2.66, + "switzerlandnorth": 3.08, + "uksouth": 2.61, + "ukwest": 2.662, + "usgovarizona": 2.65, + "usgovtexas": 2.72, + "usgovvirginia": 2.65, + "westcentralus": 2.648, + "westeurope": 2.65, + "westus": 2.54, + "westus2": 2.36 + }, + "standarde20sv3": { + "australiacentral": 2.429, + "australiacentral2": 2.429, + "australiaeast": 2.429, + "australiasoutheast": 2.429, + "brazilsouth": 3.72, + "brazilsoutheast": 4.56, + "canadacentral": 2.38, + "canadaeast": 2.38, + "centralindia": 2.29, + "centralus": 2.378, + "eastasia": 2.59, + "eastus": 2.18, + "eastus2": 2.48, + "francecentral": 2.48, + "francesouth": 3.224, + "germanycentral": 2.72, + "germanynorth": 2.896, + "germanynortheast": 2.72, + "germanywestcentral": 2.44, + "japaneast": 2.52, + "japanwest": 2.52, + "koreacentral": 2.52, + "koreasouth": 2.268, + "northcentralus": 2.18, + "northeurope": 2.33, + "norwayeast": 2.68, + "norwaywest": 3.208, + "southafricanorth": 2.608, + "southafricawest": 3.037, + "southcentralus": 2.48, + "southeastasia": 2.52, + "southindia": 2.68, + "switzerlandnorth": 2.84, + "switzerlandwest": 3.416, + "uaecentral": 3.276, + "uaenorth": 2.52, + "uksouth": 2.48, + "ukwest": 2.48, + "usgovarizona": 2.429, + "usgovtexas": 2.429, + "usgovvirginia": 2.429, + "westcentralus": 2.48, + "westeurope": 2.52, + "westindia": 2.44, + "westus": 2.4, + "westus2": 2.18 + }, + "standarde20sv4": { + "australiaeast": 2.43, + "australiasoutheast": 2.558, + "brazilsouth": 2.93, + "brazilsoutheast": 3.533, + "canadacentral": 2.3, + "canadaeast": 2.3, + "centralindia": 2.22, + "centralus": 2.344, + "eastasia": 2.873, + "eastus": 2.18, + "eastus2": 2.18, + "francecentral": 2.4, + "francesouth": 2.835, + "germanywestcentral": 2.44, + "japaneast": 2.44, + "japanwest": 2.592, + "koreacentral": 2.44, + "northcentralus": 2.18, + "northeurope": 2.33, + "southafricanorth": 2.608, + "southcentralus": 2.432, + "southeastasia": 2.44, + "switzerlandnorth": 2.81, + "uksouth": 2.4, + "ukwest": 2.445, + "usgovarizona": 2.43, + "usgovtexas": 2.495, + "usgovvirginia": 2.43, + "westcentralus": 2.432, + "westeurope": 2.44, + "westus": 2.32, + "westus2": 2.18 + }, + "standarde20v3": { + "australiacentral": 2.429, + "australiacentral2": 2.429, + "australiaeast": 2.429, + "australiasoutheast": 2.429, + "brazilsouth": 3.72, + "brazilsoutheast": 4.56, + "canadacentral": 2.38, + "canadaeast": 2.38, + "centralindia": 2.29, + "centralus": 2.378, + "eastasia": 2.59, + "eastus": 2.18, + "eastus2": 2.48, + "francecentral": 2.48, + "francesouth": 3.224, + "germanycentral": 2.72, + "germanynorth": 2.896, + "germanynortheast": 2.72, + "germanywestcentral": 2.44, + "japaneast": 2.52, + "japanwest": 2.52, + "koreacentral": 2.52, + "koreasouth": 2.268, + "northcentralus": 2.18, + "northeurope": 2.33, + "norwayeast": 2.68, + "norwaywest": 3.208, + "southafricanorth": 2.608, + "southafricawest": 3.037, + "southcentralus": 2.48, + "southeastasia": 2.52, + "southindia": 2.68, + "switzerlandnorth": 2.84, + "switzerlandwest": 3.416, + "uaecentral": 3.276, + "uaenorth": 2.52, + "uksouth": 2.48, + "ukwest": 2.48, + "usgovarizona": 2.429, + "usgovtexas": 2.429, + "usgovvirginia": 2.429, + "westcentralus": 2.48, + "westeurope": 2.52, + "westindia": 2.44, + "westus": 2.4, + "westus2": 2.18 + }, + "standarde32asv4": { + "australiaeast": 3.888, + "brazilsouth": 4.688, + "centralindia": 3.552, + "centralus": 3.75, + "eastasia": 4.144, + "eastus": 3.488, + "eastus2": 3.488, + "francecentral": 3.84, + "japaneast": 3.904, + "koreacentral": 3.904, + "northeurope": 3.728, + "southcentralus": 3.891, + "southeastasia": 3.904, + "uksouth": 3.84, + "westeurope": 3.904, + "westus": 3.712, + "westus2": 3.488 + }, + "standarde32av4": { + "australiaeast": 3.888, + "brazilsouth": 4.688, + "centralindia": 3.552, + "centralus": 3.75, + "eastasia": 4.144, + "eastus": 3.488, + "eastus2": 3.488, + "francecentral": 3.84, + "japaneast": 3.904, + "koreacentral": 3.904, + "northeurope": 3.728, + "southcentralus": 3.891, + "southeastasia": 3.904, + "uksouth": 3.84, + "westeurope": 3.904, + "westus": 3.712, + "westus2": 3.488 + }, + "standarde32dsv4": { + "australiaeast": 4.256, + "australiasoutheast": 4.237, + "brazilsouth": 5.131, + "canadacentral": 4.0, + "canadaeast": 4.237, + "centralindia": 3.888, + "centralus": 4.076, + "eastasia": 5.043, + "eastus": 3.776, + "eastus2": 3.776, + "francecentral": 4.176, + "francesouth": 4.974, + "germanywestcentral": 4.24, + "japaneast": 4.256, + "japanwest": 4.529, + "koreacentral": 4.24, + "northcentralus": 3.776, + "northeurope": 4.032, + "southafricanorth": 4.559, + "southcentralus": 4.467, + "southeastasia": 4.256, + "switzerlandnorth": 4.928, + "uksouth": 4.176, + "ukwest": 4.26, + "usgovarizona": 4.24, + "usgovtexas": 4.352, + "usgovvirginia": 4.24, + "westcentralus": 4.237, + "westeurope": 4.24, + "westus": 4.064, + "westus2": 3.776 + }, + "standarde32dv4": { + "australiaeast": 2.784, + "australiasoutheast": 2.765, + "brazilsouth": 3.659, + "canadacentral": 2.528, + "canadaeast": 2.765, + "centralindia": 2.416, + "centralus": 2.604, + "eastasia": 3.571, + "eastus": 2.304, + "eastus2": 2.304, + "francecentral": 2.704, + "francesouth": 3.502, + "germanywestcentral": 2.768, + "japaneast": 2.784, + "japanwest": 3.057, + "koreacentral": 2.768, + "northcentralus": 2.304, + "northeurope": 2.56, + "southafricanorth": 3.087, + "southcentralus": 2.995, + "southeastasia": 2.784, + "switzerlandnorth": 3.456, + "uksouth": 2.704, + "ukwest": 2.788, + "usgovarizona": 2.768, + "usgovtexas": 2.88, + "usgovvirginia": 2.768, + "westcentralus": 2.765, + "westeurope": 2.768, + "westus": 2.592, + "westus2": 2.304 + }, + "standarde32sv3": { + "australiacentral": 3.887, + "australiacentral2": 3.887, + "australiaeast": 3.887, + "australiasoutheast": 3.887, + "brazilsouth": 5.952, + "brazilsoutheast": 6.36, + "canadacentral": 3.808, + "canadaeast": 3.808, + "centralindia": 3.664, + "centralus": 3.96, + "eastasia": 4.144, + "eastus": 3.488, + "eastus2": 3.6, + "francecentral": 3.968, + "francesouth": 5.1584, + "germanycentral": 4.355, + "germanynorth": 4.634, + "germanynortheast": 4.355, + "germanywestcentral": 3.904, + "japaneast": 4.032, + "japanwest": 4.032, + "koreacentral": 4.032, + "koreasouth": 3.629, + "northcentralus": 3.488, + "northeurope": 3.728, + "norwayeast": 4.288, + "norwaywest": 5.133, + "southafricanorth": 4.173, + "southafricawest": 4.859, + "southcentralus": 3.888, + "southeastasia": 4.032, + "southindia": 4.139, + "switzerlandnorth": 4.544, + "switzerlandwest": 5.466, + "uaecentral": 4.617, + "uaenorth": 3.891, + "uksouth": 3.968, + "ukwest": 3.968, + "usgovarizona": 3.887, + "usgovtexas": 3.887, + "usgovvirginia": 3.887, + "westcentralus": 3.888, + "westeurope": 4.032, + "westindia": 3.904, + "westus": 3.712, + "westus2": 3.488 + }, + "standarde32sv4": { + "australiaeast": 3.888, + "australiasoutheast": 4.093, + "brazilsouth": 4.688, + "brazilsoutheast": 5.653, + "canadacentral": 3.68, + "canadaeast": 3.68, + "centralindia": 3.552, + "centralus": 3.75, + "eastasia": 4.597, + "eastus": 3.488, + "eastus2": 3.488, + "francecentral": 3.84, + "francesouth": 4.536, + "germanywestcentral": 3.904, + "japaneast": 3.904, + "japanwest": 4.147, + "koreacentral": 3.904, + "northcentralus": 3.488, + "northeurope": 3.728, + "southafricanorth": 4.173, + "southcentralus": 3.891, + "southeastasia": 3.904, + "switzerlandnorth": 4.496, + "uksouth": 3.84, + "ukwest": 3.911, + "usgovarizona": 3.888, + "usgovtexas": 3.992, + "usgovvirginia": 3.888, + "westcentralus": 3.891, + "westeurope": 3.904, + "westus": 3.712, + "westus2": 3.488 + }, + "standarde32v3": { + "australiacentral": 3.887, + "australiacentral2": 3.887, + "australiaeast": 3.887, + "australiasoutheast": 3.887, + "brazilsouth": 5.952, + "brazilsoutheast": 6.36, + "canadacentral": 3.808, + "canadaeast": 3.808, + "centralindia": 3.664, + "centralus": 3.96, + "eastasia": 4.144, + "eastus": 3.488, + "eastus2": 3.6, + "francecentral": 3.968, + "francesouth": 5.1584, + "germanycentral": 4.355, + "germanynorth": 4.634, + "germanynortheast": 4.355, + "germanywestcentral": 3.904, + "japaneast": 4.032, + "japanwest": 4.032, + "koreacentral": 4.032, + "koreasouth": 3.629, + "northcentralus": 3.488, + "northeurope": 3.728, + "norwayeast": 4.288, + "norwaywest": 5.133, + "southafricanorth": 4.173, + "southafricawest": 4.859, + "southcentralus": 3.888, + "southeastasia": 4.032, + "southindia": 4.139, + "switzerlandnorth": 4.544, + "switzerlandwest": 5.466, + "uaecentral": 4.617, + "uaenorth": 3.891, + "uksouth": 3.968, + "ukwest": 3.968, + "usgovarizona": 3.887, + "usgovtexas": 3.887, + "usgovvirginia": 3.887, + "westcentralus": 3.888, + "westeurope": 4.032, + "westindia": 3.904, + "westus": 3.712, + "westus2": 3.488 + }, + "standarde32v4": { + "australiaeast": 3.888, + "australiasoutheast": 4.093, + "brazilsouth": 4.688, + "brazilsoutheast": 5.653, + "canadacentral": 3.68, + "canadaeast": 3.68, + "centralindia": 3.552, + "centralus": 3.75, + "eastasia": 4.597, + "eastus": 3.488, + "eastus2": 3.488, + "francecentral": 3.84, + "francesouth": 4.536, + "germanywestcentral": 3.904, + "japaneast": 3.904, + "japanwest": 4.147, + "koreacentral": 3.904, + "northcentralus": 3.488, + "northeurope": 3.728, + "southafricanorth": 4.173, + "southcentralus": 3.891, + "southeastasia": 3.904, + "switzerlandnorth": 4.496, + "uksouth": 3.84, + "ukwest": 3.911, + "usgovarizona": 3.888, + "usgovtexas": 3.992, + "usgovvirginia": 3.888, + "westcentralus": 3.891, + "westeurope": 3.904, + "westus": 3.712, + "westus2": 3.488 + }, + "standarde48asv4": { + "australiaeast": 5.832, + "brazilsouth": 7.032, + "centralindia": 5.328, + "centralus": 5.625, + "eastasia": 6.216, + "eastus": 5.232, + "eastus2": 5.232, + "francecentral": 5.76, + "japaneast": 5.856, + "koreacentral": 5.856, + "northeurope": 5.592, + "southcentralus": 5.837, + "southeastasia": 5.856, + "uksouth": 5.76, + "westeurope": 5.856, + "westus": 5.568, + "westus2": 5.232 + }, + "standarde48av4": { + "australiaeast": 5.832, + "brazilsouth": 7.032, + "centralindia": 5.328, + "centralus": 5.625, + "eastasia": 6.216, + "eastus": 5.232, + "eastus2": 5.232, + "francecentral": 5.76, + "japaneast": 5.856, + "koreacentral": 5.856, + "northeurope": 5.592, + "southcentralus": 5.837, + "southeastasia": 5.856, + "uksouth": 5.76, + "westeurope": 5.856, + "westus": 5.568, + "westus2": 5.232 + }, + "standarde48dsv4": { + "australiaeast": 6.384, + "australiasoutheast": 6.355, + "brazilsouth": 7.697, + "canadacentral": 6.0, + "canadaeast": 6.355, + "centralindia": 5.832, + "centralus": 6.113, + "eastasia": 7.565, + "eastus": 5.664, + "eastus2": 5.664, + "francecentral": 6.264, + "francesouth": 7.461, + "germanywestcentral": 6.36, + "japaneast": 6.384, + "japanwest": 6.794, + "koreacentral": 6.36, + "northcentralus": 5.664, + "northeurope": 6.048, + "southafricanorth": 6.839, + "southcentralus": 6.701, + "southeastasia": 6.384, + "switzerlandnorth": 7.392, + "uksouth": 6.264, + "ukwest": 6.39, + "usgovarizona": 6.36, + "usgovtexas": 6.528, + "usgovvirginia": 6.36, + "westcentralus": 6.355, + "westeurope": 6.36, + "westus": 6.096, + "westus2": 5.664 + }, + "standarde48dv4": { + "australiaeast": 6.384, + "australiasoutheast": 6.355, + "brazilsouth": 7.697, + "canadacentral": 6.0, + "canadaeast": 6.355, + "centralindia": 5.832, + "centralus": 6.113, + "eastasia": 7.565, + "eastus": 5.664, + "eastus2": 5.664, + "francecentral": 6.264, + "francesouth": 7.461, + "germanywestcentral": 6.36, + "japaneast": 6.384, + "japanwest": 6.794, + "koreacentral": 6.36, + "northcentralus": 5.664, + "northeurope": 6.048, + "southafricanorth": 6.839, + "southcentralus": 6.701, + "southeastasia": 6.384, + "switzerlandnorth": 7.392, + "uksouth": 6.264, + "ukwest": 6.39, + "usgovarizona": 6.36, + "usgovtexas": 6.528, + "usgovvirginia": 6.36, + "westcentralus": 6.355, + "westeurope": 6.36, + "westus": 6.096, + "westus2": 5.664 + }, + "standarde48sv3": { + "australiacentral": 5.831, + "australiacentral2": 5.831, + "australiaeast": 5.831, + "australiasoutheast": 5.831, + "brazilsouth": 7.845, + "brazilsoutheast": 9.54, + "canadacentral": 5.52, + "canadaeast": 5.52, + "centralindia": 5.489, + "centralus": 5.709, + "eastasia": 6.216, + "eastus": 5.232, + "eastus2": 5.232, + "francecentral": 5.948, + "francesouth": 7.071, + "germanycentral": 6.354, + "germanynorth": 6.951, + "germanynortheast": 6.354, + "germanywestcentral": 5.856, + "japaneast": 5.855, + "japanwest": 6.048, + "koreacentral": 5.855, + "koreasouth": 5.441, + "northcentralus": 5.232, + "northeurope": 5.592, + "norwayeast": 6.22, + "norwaywest": 7.423, + "southafricanorth": 6.26, + "southafricawest": 7.288, + "southcentralus": 5.707, + "southeastasia": 6.048, + "southindia": 6.209, + "switzerlandnorth": 6.816, + "switzerlandwest": 8.199, + "uaecentral": 6.925, + "uaenorth": 5.837, + "uksouth": 5.761, + "ukwest": 5.761, + "usgovarizona": 5.832, + "usgovtexas": 5.832, + "usgovvirginia": 5.832, + "westeurope": 5.855, + "westindia": 5.848, + "westus": 5.568, + "westus2": 5.232 + }, + "standarde48sv4": { + "australiaeast": 5.832, + "australiasoutheast": 6.139, + "brazilsouth": 7.032, + "brazilsoutheast": 8.479, + "canadacentral": 5.52, + "canadaeast": 5.52, + "centralindia": 5.328, + "centralus": 5.625, + "eastasia": 6.895, + "eastus": 5.232, + "eastus2": 5.232, + "francecentral": 5.76, + "francesouth": 6.804, + "germanywestcentral": 5.856, + "japaneast": 5.856, + "japanwest": 6.221, + "koreacentral": 5.856, + "northcentralus": 5.232, + "northeurope": 5.592, + "southafricanorth": 6.26, + "southcentralus": 5.837, + "southeastasia": 5.856, + "switzerlandnorth": 6.744, + "uksouth": 5.76, + "ukwest": 5.867, + "usgovarizona": 5.832, + "usgovtexas": 5.988, + "usgovvirginia": 5.832, + "westcentralus": 5.837, + "westeurope": 5.856, + "westus": 5.568, + "westus2": 5.232 + }, + "standarde48v3": { + "australiacentral": 5.831, + "australiacentral2": 5.831, + "australiaeast": 5.831, + "australiasoutheast": 5.831, + "brazilsouth": 7.845, + "brazilsoutheast": 9.54, + "canadacentral": 5.52, + "canadaeast": 5.52, + "centralindia": 5.489, + "centralus": 5.709, + "eastasia": 6.216, + "eastus": 5.232, + "eastus2": 5.232, + "francecentral": 5.948, + "francesouth": 7.071, + "germanycentral": 6.354, + "germanynorth": 6.951, + "germanynortheast": 6.354, + "germanywestcentral": 5.856, + "japaneast": 5.855, + "japanwest": 6.048, + "koreacentral": 5.855, + "koreasouth": 5.441, + "northcentralus": 5.232, + "northeurope": 5.592, + "norwayeast": 6.22, + "norwaywest": 7.423, + "southafricanorth": 6.26, + "southafricawest": 7.288, + "southcentralus": 5.707, + "southeastasia": 6.048, + "southindia": 6.209, + "switzerlandnorth": 6.816, + "switzerlandwest": 8.199, + "uaecentral": 6.925, + "uaenorth": 5.837, + "uksouth": 5.761, + "ukwest": 5.761, + "usgovarizona": 5.832, + "usgovtexas": 5.832, + "usgovvirginia": 5.832, + "westcentralus": 5.832, + "westeurope": 5.855, + "westindia": 5.848, + "westus": 5.568, + "westus2": 5.232 + }, + "standarde48v4": { + "australiaeast": 5.832, + "australiasoutheast": 6.139, + "brazilsouth": 7.032, + "brazilsoutheast": 8.479, + "canadacentral": 5.52, + "canadaeast": 5.52, + "centralindia": 5.328, + "centralus": 5.625, + "eastasia": 6.895, + "eastus": 5.232, + "eastus2": 5.232, + "francecentral": 5.76, + "francesouth": 6.804, + "germanywestcentral": 5.856, + "japaneast": 5.856, + "japanwest": 6.221, + "koreacentral": 5.856, + "northcentralus": 5.232, + "northeurope": 5.592, + "southafricanorth": 6.26, + "southcentralus": 5.837, + "southeastasia": 5.856, + "switzerlandnorth": 6.744, + "uksouth": 5.76, + "ukwest": 5.867, + "usgovarizona": 5.832, + "usgovtexas": 5.988, + "usgovvirginia": 5.832, + "westcentralus": 5.837, + "westeurope": 5.856, + "westus": 5.568, + "westus2": 5.232 + }, + "standarde64asv4": { + "australiaeast": 7.776, + "brazilsouth": 9.376, + "centralindia": 7.104, + "centralus": 7.5, + "eastasia": 8.288, + "eastus": 6.976, + "eastus2": 6.976, + "francecentral": 7.68, + "japaneast": 7.808, + "koreacentral": 7.808, + "northeurope": 7.456, + "southcentralus": 7.782, + "southeastasia": 7.808, + "uksouth": 7.68, + "westeurope": 7.808, + "westus": 7.424, + "westus2": 6.976 + }, + "standarde64av4": { + "australiaeast": 7.776, + "brazilsouth": 9.376, + "centralindia": 7.104, + "centralus": 7.5, + "eastasia": 8.288, + "eastus": 6.976, + "eastus2": 6.976, + "francecentral": 7.68, + "japaneast": 7.808, + "koreacentral": 7.808, + "northeurope": 7.456, + "southcentralus": 7.782, + "southeastasia": 7.808, + "uksouth": 7.68, + "westeurope": 7.808, + "westus": 7.424, + "westus2": 6.976 + }, + "standarde64dsv4": { + "australiaeast": 8.512, + "australiasoutheast": 8.474, + "brazilsouth": 10.263, + "canadacentral": 8.0, + "canadaeast": 8.474, + "centralindia": 7.776, + "centralus": 8.151, + "eastasia": 10.086, + "eastus": 7.552, + "eastus2": 7.552, + "francecentral": 8.352, + "francesouth": 9.948, + "germanywestcentral": 8.48, + "japaneast": 8.512, + "japanwest": 9.059, + "koreacentral": 8.48, + "northcentralus": 7.552, + "northeurope": 8.064, + "southafricanorth": 9.119, + "southcentralus": 8.934, + "southeastasia": 8.512, + "switzerlandnorth": 9.856, + "uksouth": 8.352, + "ukwest": 8.52, + "usgovarizona": 8.48, + "usgovtexas": 8.704, + "usgovvirginia": 8.48, + "westcentralus": 8.474, + "westeurope": 8.48, + "westus": 8.128, + "westus2": 7.552 + }, + "standarde64dv4": { + "australiaeast": 8.512, + "australiasoutheast": 8.474, + "brazilsouth": 10.263, + "canadacentral": 8.0, + "canadaeast": 8.474, + "centralindia": 7.776, + "centralus": 8.151, + "eastasia": 10.086, + "eastus": 7.552, + "eastus2": 7.552, + "francecentral": 8.352, + "francesouth": 9.948, + "germanywestcentral": 8.48, + "japaneast": 8.512, + "japanwest": 9.059, + "koreacentral": 8.48, + "northcentralus": 7.552, + "northeurope": 8.064, + "southafricanorth": 9.119, + "southcentralus": 8.934, + "southeastasia": 8.512, + "switzerlandnorth": 9.856, + "uksouth": 8.352, + "ukwest": 8.52, + "usgovarizona": 8.48, + "usgovtexas": 8.704, + "usgovvirginia": 8.48, + "westcentralus": 8.474, + "westeurope": 8.48, + "westus": 8.128, + "westus2": 7.552 + }, + "standarde64isv3": { + "australiaeast": 7.291, + "australiasoutheast": 7.291, + "brazilsouth": 9.708, + "brazilsoutheast": 11.742, + "canadacentral": 6.918, + "canadaeast": 6.918, + "centralus": 7.143, + "eastasia": 7.754, + "eastus": 6.573, + "eastus2": 6.573, + "francecentral": 7.432, + "francesouth": 8.779, + "germanycentral": 8.21, + "germanynorth": 8.635, + "germanynortheast": 8.208, + "germanywestcentral": 7.027, + "japaneast": 7.32, + "japanwest": 7.553, + "koreacentral": 7.32, + "koreasouth": 6.722, + "northcentralus": 6.573, + "northeurope": 7.005, + "norwayeast": 7.758, + "norwaywest": 9.202, + "southafricanorth": 7.807, + "southafricawest": 9.04, + "southcentralus": 7.143, + "southeastasia": 7.553, + "southindia": 7.745, + "switzerlandnorth": 8.474, + "switzerlandwest": 10.132, + "uaecentral": 9.516, + "uaenorth": 7.32, + "uksouth": 7.208, + "ukwest": 7.208, + "usgovarizona": 7.291, + "usgovvirginia": 7.48, + "westcentralus": 7.143, + "westeurope": 7.32, + "westindia": 7.312, + "westus": 6.976, + "westus2": 6.573 + }, + "standarde64iv3": { + "australiaeast": 7.291, + "australiasoutheast": 7.291, + "brazilsouth": 9.708, + "brazilsoutheast": 11.742, + "canadacentral": 6.918, + "canadaeast": 6.918, + "centralus": 7.143, + "eastasia": 7.754, + "eastus": 6.573, + "eastus2": 6.573, + "francecentral": 7.432, + "francesouth": 8.779, + "germanycentral": 8.21, + "germanynorth": 8.635, + "germanynortheast": 8.208, + "germanywestcentral": 7.027, + "japaneast": 7.32, + "japanwest": 7.553, + "koreacentral": 7.32, + "koreasouth": 6.722, + "northcentralus": 6.573, + "northeurope": 7.005, + "norwayeast": 7.758, + "norwaywest": 9.202, + "southafricanorth": 7.807, + "southafricawest": 9.04, + "southcentralus": 7.143, + "southeastasia": 7.553, + "southindia": 7.745, + "switzerlandnorth": 8.474, + "switzerlandwest": 10.132, + "uaecentral": 9.516, + "uaenorth": 7.32, + "uksouth": 7.208, + "ukwest": 7.208, + "usgovarizona": 7.291, + "usgovvirginia": 7.48, + "westcentralus": 7.143, + "westeurope": 7.32, + "westindia": 7.312, + "westus": 6.976, + "westus2": 6.573 + }, + "standarde64sv3": { + "australiacentral": 7.291, + "australiacentral2": 7.291, + "australiaeast": 7.291, + "australiasoutheast": 7.291, + "brazilsouth": 9.708, + "brazilsoutheast": 11.742, + "canadacentral": 6.918, + "canadaeast": 6.918, + "centralindia": 6.881, + "centralus": 7.144, + "eastasia": 7.754, + "eastus": 6.573, + "eastus2": 6.573, + "francecentral": 7.432, + "francesouth": 8.779, + "germanycentral": 8.21, + "germanynorth": 8.635, + "germanynortheast": 8.21, + "germanywestcentral": 7.027, + "japaneast": 7.32, + "japanwest": 7.553, + "koreacentral": 7.32, + "koreasouth": 6.825, + "northcentralus": 6.573, + "northeurope": 7.005, + "norwayeast": 7.758, + "norwaywest": 9.202, + "southafricanorth": 7.807, + "southafricawest": 9.04, + "southcentralus": 7.143, + "southeastasia": 7.553, + "southindia": 7.745, + "switzerlandnorth": 8.474, + "switzerlandwest": 10.132, + "uaecentral": 8.605, + "uaenorth": 7.299, + "uksouth": 7.208, + "ukwest": 7.208, + "usgovarizona": 7.291, + "usgovtexas": 7.291, + "usgovvirginia": 7.562, + "westcentralus": 7.143, + "westeurope": 7.32, + "westindia": 7.312, + "westus": 6.976, + "westus2": 6.573 + }, + "standarde64sv4": { + "australiaeast": 7.776, + "australiasoutheast": 8.186, + "brazilsouth": 9.376, + "brazilsoutheast": 11.305, + "canadacentral": 7.36, + "canadaeast": 7.36, + "centralindia": 7.104, + "centralus": 7.5, + "eastasia": 9.194, + "eastus": 6.976, + "eastus2": 6.976, + "francecentral": 7.68, + "francesouth": 9.073, + "germanywestcentral": 7.808, + "japaneast": 7.808, + "japanwest": 8.294, + "koreacentral": 7.808, + "northcentralus": 6.976, + "northeurope": 7.456, + "southafricanorth": 8.347, + "southcentralus": 7.782, + "southeastasia": 7.808, + "switzerlandnorth": 8.992, + "uksouth": 7.68, + "ukwest": 7.823, + "usgovarizona": 7.776, + "usgovtexas": 7.984, + "usgovvirginia": 7.776, + "westcentralus": 7.782, + "westeurope": 7.808, + "westus": 7.424, + "westus2": 6.976 + }, + "standarde64v3": { + "australiacentral": 7.291, + "australiacentral2": 7.291, + "australiaeast": 7.291, + "australiasoutheast": 7.291, + "brazilsouth": 9.708, + "brazilsoutheast": 11.742, + "canadacentral": 6.918, + "canadaeast": 6.918, + "centralindia": 6.881, + "centralus": 7.144, + "eastasia": 7.754, + "eastus": 6.573, + "eastus2": 6.573, + "francecentral": 7.432, + "francesouth": 8.779, + "germanycentral": 8.21, + "germanynorth": 8.635, + "germanynortheast": 8.21, + "germanywestcentral": 7.027, + "japaneast": 7.32, + "japanwest": 7.553, + "koreacentral": 7.32, + "koreasouth": 6.825, + "northcentralus": 6.573, + "northeurope": 7.005, + "norwayeast": 7.758, + "norwaywest": 9.202, + "southafricanorth": 7.807, + "southafricawest": 9.04, + "southcentralus": 7.143, + "southeastasia": 7.553, + "southindia": 7.745, + "switzerlandnorth": 8.474, + "switzerlandwest": 10.132, + "uaecentral": 8.605, + "uaenorth": 7.299, + "uksouth": 7.208, + "ukwest": 7.208, + "usgovarizona": 7.291, + "usgovtexas": 7.291, + "usgovvirginia": 7.562, + "westcentralus": 7.143, + "westeurope": 7.32, + "westindia": 7.312, + "westus": 6.976, + "westus2": 6.573 + }, + "standarde64v4": { + "australiaeast": 7.776, + "australiasoutheast": 8.186, + "brazilsouth": 9.376, + "brazilsoutheast": 11.305, + "canadacentral": 7.36, + "canadaeast": 7.36, + "centralindia": 7.104, + "centralus": 7.5, + "eastasia": 9.194, + "eastus": 6.976, + "eastus2": 6.976, + "francecentral": 7.68, + "francesouth": 9.073, + "germanywestcentral": 7.808, + "japaneast": 7.808, + "japanwest": 8.294, + "koreacentral": 7.808, + "northcentralus": 6.976, + "northeurope": 7.456, + "southafricanorth": 8.347, + "southcentralus": 7.782, + "southeastasia": 7.808, + "switzerlandnorth": 8.992, + "uksouth": 7.68, + "ukwest": 7.823, + "usgovarizona": 7.776, + "usgovtexas": 7.984, + "usgovvirginia": 7.776, + "westcentralus": 7.782, + "westeurope": 7.808, + "westus": 7.424, + "westus2": 6.976 + }, + "standarde96asv4": { + "australiaeast": 11.664, + "brazilsouth": 14.064, + "centralindia": 10.656, + "centralus": 11.25, + "eastasia": 12.432, + "eastus": 10.464, + "eastus2": 10.464, + "francecentral": 11.52, + "japaneast": 11.712, + "koreacentral": 11.712, + "northeurope": 11.184, + "southcentralus": 11.674, + "southeastasia": 11.712, + "uksouth": 11.52, + "westeurope": 11.712, + "westus": 11.136, + "westus2": 10.464 + }, + "standarde96av4": { + "australiaeast": 11.664, + "brazilsouth": 14.064, + "centralindia": 10.656, + "centralus": 11.25, + "eastasia": 12.432, + "eastus": 10.464, + "eastus2": 10.464, + "francecentral": 11.52, + "japaneast": 11.712, + "koreacentral": 11.712, + "northeurope": 11.184, + "southcentralus": 11.674, + "southeastasia": 11.712, + "uksouth": 11.52, + "westeurope": 11.712, + "westus": 11.136, + "westus2": 10.464 + }, + "standardf1": { + "australiacentral": 0.111, + "australiacentral2": 0.111, + "australiaeast": 0.111, + "australiasoutheast": 0.111, + "brazilsouth": 0.111, + "brazilsoutheast": 0.139, + "canadacentral": 0.0956, + "canadaeast": 0.101, + "centralindia": 0.0957, + "centralus": 0.105, + "eastasia": 0.129, + "eastus": 0.0957, + "eastus2": 0.0957, + "francecentral": 0.0965, + "francesouth": 0.125, + "germanycentral": 0.111, + "germanynorth": 0.12, + "germanynortheast": 0.111, + "germanywestcentral": 0.103, + "japaneast": 0.109, + "japanwest": 0.109, + "koreacentral": 0.092, + "koreasouth": 0.092, + "northcentralus": 0.0957, + "northeurope": 0.102, + "norwayeast": 0.108, + "norwaywest": 0.127, + "southafricanorth": 0.113, + "southafricawest": 0.13, + "southcentralus": 0.103, + "southeastasia": 0.104, + "southindia": 0.111, + "switzerlandnorth": 0.114, + "switzerlandwest": 0.135, + "uaecentral": 0.12, + "uaenorth": 0.106, + "uksouth": 0.105, + "ukwest": 0.105, + "usgovarizona": 0.106, + "usgovtexas": 0.106, + "usgovvirginia": 0.106, + "westcentralus": 0.103, + "westeurope": 0.103, + "westindia": 0.101, + "westus": 0.108, + "westus2": 0.0957 + }, + "standardf1s": { + "australiacentral": 0.111, + "australiacentral2": 0.111, + "australiaeast": 0.111, + "australiasoutheast": 0.111, + "brazilsouth": 0.111, + "brazilsoutheast": 0.139, + "canadacentral": 0.0956, + "canadaeast": 0.101, + "centralindia": 0.0957, + "centralus": 0.105, + "eastasia": 0.129, + "eastus": 0.0957, + "eastus2": 0.0957, + "francecentral": 0.0965, + "francesouth": 0.125, + "germanycentral": 0.111, + "germanynorth": 0.12, + "germanynortheast": 0.111, + "germanywestcentral": 0.103, + "japaneast": 0.109, + "japanwest": 0.109, + "koreacentral": 0.092, + "koreasouth": 0.092, + "northcentralus": 0.0957, + "northeurope": 0.102, + "norwayeast": 0.108, + "norwaywest": 0.127, + "southafricanorth": 0.113, + "southafricawest": 0.13, + "southcentralus": 0.103, + "southeastasia": 0.104, + "southindia": 0.111, + "switzerlandnorth": 0.114, + "switzerlandwest": 0.135, + "uaecentral": 0.12, + "uaenorth": 0.106, + "uksouth": 0.105, + "ukwest": 0.105, + "usgovarizona": 0.106, + "usgovtexas": 0.106, + "usgovvirginia": 0.106, + "westcentralus": 0.103, + "westeurope": 0.103, + "westindia": 0.101, + "westus": 0.108, + "westus2": 0.0957 + }, + "standardf2": { + "australiacentral": 0.222, + "australiacentral2": 0.222, + "australiaeast": 0.222, + "australiasoutheast": 0.222, + "brazilsouth": 0.222, + "brazilsoutheast": 0.279, + "canadacentral": 0.191, + "canadaeast": 0.201, + "centralindia": 0.192, + "centralus": 0.211, + "eastasia": 0.259, + "eastus": 0.192, + "eastus2": 0.192, + "francecentral": 0.193, + "francesouth": 0.2509, + "germanycentral": 0.222, + "germanynorth": 0.24, + "germanynortheast": 0.222, + "germanywestcentral": 0.206, + "japaneast": 0.218, + "japanwest": 0.218, + "koreacentral": 0.185, + "koreasouth": 0.185, + "northcentralus": 0.192, + "northeurope": 0.204, + "norwayeast": 0.217, + "norwaywest": 0.255, + "southafricanorth": 0.225, + "southafricawest": 0.259, + "southcentralus": 0.205, + "southeastasia": 0.207, + "southindia": 0.222, + "switzerlandnorth": 0.229, + "switzerlandwest": 0.27, + "uaecentral": 0.24, + "uaenorth": 0.211, + "uksouth": 0.211, + "ukwest": 0.211, + "usgovarizona": 0.212, + "usgovtexas": 0.212, + "usgovvirginia": 0.212, + "westcentralus": 0.205, + "westeurope": 0.206, + "westindia": 0.202, + "westus": 0.216, + "westus2": 0.192 + }, + "standardf2s": { + "australiacentral": 0.222, + "australiacentral2": 0.222, + "australiaeast": 0.222, + "australiasoutheast": 0.222, + "brazilsouth": 0.222, + "brazilsoutheast": 0.279, + "canadacentral": 0.191, + "canadaeast": 0.201, + "centralindia": 0.192, + "centralus": 0.211, + "eastasia": 0.259, + "eastus": 0.192, + "eastus2": 0.192, + "francecentral": 0.193, + "francesouth": 0.2509, + "germanycentral": 0.222, + "germanynorth": 0.24, + "germanynortheast": 0.222, + "germanywestcentral": 0.206, + "japaneast": 0.218, + "japanwest": 0.218, + "koreacentral": 0.185, + "koreasouth": 0.185, + "northcentralus": 0.192, + "northeurope": 0.204, + "norwayeast": 0.217, + "norwaywest": 0.255, + "southafricanorth": 0.225, + "southafricawest": 0.259, + "southcentralus": 0.205, + "southeastasia": 0.207, + "southindia": 0.222, + "switzerlandnorth": 0.229, + "switzerlandwest": 0.27, + "uaecentral": 0.24, + "uaenorth": 0.211, + "uksouth": 0.211, + "ukwest": 0.211, + "usgovarizona": 0.212, + "usgovtexas": 0.212, + "usgovvirginia": 0.212, + "westcentralus": 0.205, + "westeurope": 0.206, + "westindia": 0.202, + "westus": 0.216, + "westus2": 0.192 + }, + "standardf2sv2": { + "australiacentral": 0.203, + "australiacentral2": 0.203, + "australiaeast": 0.203, + "australiasoutheast": 0.203, + "brazilsouth": 0.223, + "canadacentral": 0.185, + "canadaeast": 0.185, + "centralindia": 0.177, + "centralus": 0.194, + "eastasia": 0.2, + "eastus": 0.163, + "eastus2": 0.163, + "francecentral": 0.193, + "francesouth": 0.223, + "germanycentral": 0.2124, + "germanynorth": 0.218, + "germanywestcentral": 0.189, + "japaneast": 0.199, + "japanwest": 0.209, + "koreacentral": 0.188, + "koreasouth": 0.188, + "northcentralus": 0.177, + "northeurope": 0.188, + "southafricanorth": 0.206, + "southafricawest": 0.235, + "southcentralus": 0.194, + "southeastasia": 0.176, + "southindia": 0.186, + "uaecentral": 0.218, + "uaenorth": 0.194, + "uksouth": 0.193, + "ukwest": 0.193, + "usgovarizona": 0.198, + "usgovtexas": 0.194, + "usgovvirginia": 0.194, + "westcentralus": 0.194, + "westeurope": 0.185, + "westindia": 0.177, + "westus": 0.198, + "westus2": 0.163 + }, + "standardf4": { + "australiacentral": 0.444, + "australiacentral2": 0.444, + "australiaeast": 0.444, + "australiasoutheast": 0.444, + "brazilsouth": 0.444, + "brazilsoutheast": 0.557, + "canadacentral": 0.382, + "canadaeast": 0.402, + "centralindia": 0.383, + "centralus": 0.421, + "eastasia": 0.518, + "eastus": 0.383, + "eastus2": 0.383, + "francecentral": 0.386, + "francesouth": 0.5018, + "germanycentral": 0.444, + "germanynorth": 0.48, + "germanynortheast": 0.444, + "germanywestcentral": 0.411, + "japaneast": 0.436, + "japanwest": 0.436, + "koreacentral": 0.37, + "koreasouth": 0.37, + "northcentralus": 0.383, + "northeurope": 0.408, + "norwayeast": 0.434, + "norwaywest": 0.509, + "southafricanorth": 0.451, + "southafricawest": 0.518, + "southcentralus": 0.411, + "southeastasia": 0.415, + "southindia": 0.444, + "switzerlandnorth": 0.458, + "switzerlandwest": 0.54, + "uaecentral": 0.479, + "uaenorth": 0.423, + "uksouth": 0.421, + "ukwest": 0.421, + "usgovarizona": 0.423, + "usgovtexas": 0.423, + "usgovvirginia": 0.423, + "westcentralus": 0.411, + "westeurope": 0.411, + "westindia": 0.404, + "westus": 0.433, + "westus2": 0.383 + }, + "standardf4s": { + "australiacentral": 0.444, + "australiacentral2": 0.444, + "australiaeast": 0.444, + "australiasoutheast": 0.444, + "brazilsouth": 0.444, + "brazilsoutheast": 0.557, + "canadacentral": 0.382, + "canadaeast": 0.402, + "centralindia": 0.383, + "centralus": 0.421, + "eastasia": 0.518, + "eastus": 0.383, + "eastus2": 0.383, + "francecentral": 0.386, + "francesouth": 0.5018, + "germanycentral": 0.444, + "germanynorth": 0.48, + "germanynortheast": 0.444, + "germanywestcentral": 0.411, + "japaneast": 0.436, + "japanwest": 0.436, + "koreacentral": 0.37, + "koreasouth": 0.37, + "northcentralus": 0.383, + "northeurope": 0.408, + "norwayeast": 0.434, + "norwaywest": 0.509, + "southafricanorth": 0.451, + "southafricawest": 0.518, + "southcentralus": 0.411, + "southeastasia": 0.415, + "southindia": 0.444, + "switzerlandnorth": 0.458, + "switzerlandwest": 0.54, + "uaecentral": 0.479, + "uaenorth": 0.423, + "uksouth": 0.421, + "ukwest": 0.421, + "usgovarizona": 0.423, + "usgovtexas": 0.423, + "usgovvirginia": 0.423, + "westcentralus": 0.411, + "westeurope": 0.411, + "westindia": 0.404, + "westus": 0.433, + "westus2": 0.383 + }, + "standardf4sv2": { + "australiacentral": 0.406, + "australiacentral2": 0.406, + "australiaeast": 0.406, + "australiasoutheast": 0.407, + "brazilsouth": 0.446, + "canadacentral": 0.369, + "canadaeast": 0.369, + "centralindia": 0.354, + "centralus": 0.388, + "eastasia": 0.4, + "eastus": 0.326, + "eastus2": 0.326, + "francecentral": 0.386, + "francesouth": 0.446, + "germanycentral": 0.4248, + "germanynorth": 0.436, + "germanywestcentral": 0.378, + "japaneast": 0.398, + "japanwest": 0.419, + "koreacentral": 0.376, + "koreasouth": 0.376, + "northcentralus": 0.354, + "northeurope": 0.376, + "southafricanorth": 0.412, + "southafricawest": 0.47, + "southcentralus": 0.388, + "southeastasia": 0.353, + "southindia": 0.371, + "uaecentral": 0.436, + "uaenorth": 0.388, + "uksouth": 0.386, + "ukwest": 0.386, + "usgovarizona": 0.431, + "usgovtexas": 0.388, + "usgovvirginia": 0.388, + "westcentralus": 0.388, + "westeurope": 0.37, + "westindia": 0.354, + "westus": 0.396, + "westus2": 0.326 + }, + "standardf8": { + "australiacentral": 0.889, + "australiacentral2": 0.889, + "australiaeast": 0.889, + "australiasoutheast": 0.889, + "brazilsouth": 0.887, + "brazilsoutheast": 1.115, + "canadacentral": 0.765, + "canadaeast": 0.804, + "centralindia": 0.766, + "centralus": 0.842, + "eastasia": 1.036, + "eastus": 0.766, + "eastus2": 0.766, + "francecentral": 0.772, + "francesouth": 1.003, + "germanycentral": 0.888, + "germanynorth": 0.961, + "germanynortheast": 0.888, + "germanywestcentral": 0.822, + "japaneast": 0.872, + "japanwest": 0.872, + "koreacentral": 0.74, + "koreasouth": 0.74, + "northcentralus": 0.766, + "northeurope": 0.816, + "norwayeast": 0.867, + "norwaywest": 1.017, + "southafricanorth": 0.901, + "southafricawest": 1.037, + "southcentralus": 0.822, + "southeastasia": 0.83, + "southindia": 0.887, + "switzerlandnorth": 0.915, + "switzerlandwest": 1.079, + "uaecentral": 0.958, + "uaenorth": 0.846, + "uksouth": 0.842, + "ukwest": 0.842, + "usgovarizona": 0.847, + "usgovtexas": 0.847, + "usgovvirginia": 0.847, + "westcentralus": 0.822, + "westeurope": 0.822, + "westindia": 0.807, + "westus": 0.866, + "westus2": 0.766 + }, + "standardf8s": { + "australiacentral": 0.889, + "australiacentral2": 0.889, + "australiaeast": 0.889, + "australiasoutheast": 0.889, + "brazilsouth": 0.887, + "brazilsoutheast": 1.115, + "canadacentral": 0.765, + "canadaeast": 0.804, + "centralindia": 0.766, + "centralus": 0.842, + "eastasia": 1.036, + "eastus": 0.766, + "eastus2": 0.766, + "francecentral": 0.772, + "francesouth": 1.003, + "germanycentral": 0.888, + "germanynorth": 0.961, + "germanynortheast": 0.888, + "germanywestcentral": 0.822, + "japaneast": 0.872, + "japanwest": 0.872, + "koreacentral": 0.74, + "koreasouth": 0.74, + "northcentralus": 0.766, + "northeurope": 0.816, + "norwayeast": 0.867, + "norwaywest": 1.017, + "southafricanorth": 0.901, + "southafricawest": 1.037, + "southcentralus": 0.822, + "southeastasia": 0.83, + "southindia": 0.887, + "switzerlandnorth": 0.915, + "switzerlandwest": 1.079, + "uaecentral": 0.958, + "uaenorth": 0.846, + "uksouth": 0.842, + "ukwest": 0.842, + "usgovarizona": 0.847, + "usgovtexas": 0.847, + "usgovvirginia": 0.847, + "westcentralus": 0.822, + "westeurope": 0.822, + "westindia": 0.807, + "westus": 0.866, + "westus2": 0.766 + }, + "standardf8sv2": { + "australiacentral": 0.812, + "australiacentral2": 0.812, + "australiaeast": 0.812, + "australiasoutheast": 0.813, + "brazilsouth": 0.892, + "canadacentral": 0.739, + "canadaeast": 0.739, + "centralindia": 0.708, + "centralus": 0.776, + "eastasia": 0.8, + "eastus": 0.651, + "eastus2": 0.651, + "francecentral": 0.772, + "francesouth": 0.892, + "germanycentral": 0.8496, + "germanynorth": 0.872, + "germanywestcentral": 0.756, + "japaneast": 0.796, + "japanwest": 0.837, + "koreacentral": 0.752, + "koreasouth": 0.752, + "northcentralus": 0.708, + "northeurope": 0.752, + "southafricanorth": 0.824, + "southafricawest": 0.939, + "southcentralus": 0.776, + "southeastasia": 0.706, + "southindia": 0.742, + "uaecentral": 0.872, + "uaenorth": 0.776, + "uksouth": 0.772, + "ukwest": 0.773, + "usgovarizona": 0.861, + "usgovtexas": 0.776, + "usgovvirginia": 0.776, + "westcentralus": 0.776, + "westeurope": 0.74, + "westindia": 0.708, + "westus": 0.792, + "westus2": 0.651 + }, + "standardf16": { + "australiacentral": 1.777, + "australiacentral2": 1.777, + "australiaeast": 1.777, + "australiasoutheast": 1.777, + "brazilsouth": 1.774, + "brazilsoutheast": 2.229, + "canadacentral": 1.53, + "canadaeast": 1.609, + "centralindia": 1.532, + "centralus": 1.685, + "eastasia": 2.072, + "eastus": 1.532, + "eastus2": 1.532, + "francecentral": 1.544, + "francesouth": 2.007, + "germanycentral": 1.775, + "germanynorth": 1.922, + "germanynortheast": 1.775, + "germanywestcentral": 1.645, + "japaneast": 1.744, + "japanwest": 1.744, + "koreacentral": 1.479, + "koreasouth": 1.479, + "northcentralus": 1.532, + "northeurope": 1.632, + "norwayeast": 1.736, + "norwaywest": 2.036, + "southafricanorth": 1.802, + "southafricawest": 2.073, + "southcentralus": 1.644, + "southeastasia": 1.66, + "southindia": 1.774, + "switzerlandnorth": 1.83, + "switzerlandwest": 2.159, + "uaecentral": 1.918, + "uaenorth": 1.691, + "uksouth": 1.685, + "ukwest": 1.685, + "usgovarizona": 1.694, + "usgovtexas": 1.694, + "usgovvirginia": 1.694, + "westcentralus": 1.644, + "westeurope": 1.645, + "westindia": 1.614, + "westus": 1.732, + "westus2": 1.532 + }, + "standardf16s": { + "australiacentral": 1.777, + "australiacentral2": 1.777, + "australiaeast": 1.777, + "australiasoutheast": 1.777, + "brazilsouth": 1.774, + "brazilsoutheast": 2.229, + "canadacentral": 1.53, + "canadaeast": 1.609, + "centralindia": 1.532, + "centralus": 1.685, + "eastasia": 2.072, + "eastus": 1.532, + "eastus2": 1.532, + "francecentral": 1.544, + "francesouth": 2.007, + "germanycentral": 1.775, + "germanynorth": 1.922, + "germanynortheast": 1.775, + "germanywestcentral": 1.645, + "japaneast": 1.744, + "japanwest": 1.744, + "koreacentral": 1.479, + "koreasouth": 1.479, + "northcentralus": 1.532, + "northeurope": 1.632, + "norwayeast": 1.736, + "norwaywest": 2.036, + "southafricanorth": 1.802, + "southafricawest": 2.073, + "southcentralus": 1.644, + "southeastasia": 1.66, + "southindia": 1.774, + "switzerlandnorth": 1.83, + "switzerlandwest": 2.159, + "uaecentral": 1.918, + "uaenorth": 1.691, + "uksouth": 1.685, + "ukwest": 1.685, + "usgovarizona": 1.694, + "usgovtexas": 1.694, + "usgovvirginia": 1.694, + "westcentralus": 1.644, + "westeurope": 1.645, + "westindia": 1.614, + "westus": 1.732, + "westus2": 1.532 + }, + "standardf16sv2": { + "australiacentral": 1.624, + "australiacentral2": 1.624, + "australiaeast": 1.624, + "australiasoutheast": 1.627, + "brazilsouth": 1.784, + "canadacentral": 1.477, + "canadaeast": 1.477, + "centralindia": 1.416, + "centralus": 1.552, + "eastasia": 1.6, + "eastus": 1.302, + "eastus2": 1.302, + "francecentral": 1.544, + "francesouth": 1.783, + "germanycentral": 1.6992, + "germanynorth": 1.745, + "germanywestcentral": 1.512, + "japaneast": 1.592, + "japanwest": 1.674, + "koreacentral": 1.504, + "koreasouth": 1.504, + "northcentralus": 1.416, + "northeurope": 1.504, + "southafricanorth": 1.647, + "southafricawest": 1.878, + "southcentralus": 1.552, + "southeastasia": 1.411, + "southindia": 1.484, + "uaecentral": 1.745, + "uaenorth": 1.552, + "uksouth": 1.544, + "ukwest": 1.545, + "usgovarizona": 1.586, + "usgovtexas": 1.552, + "usgovvirginia": 1.552, + "westcentralus": 1.552, + "westeurope": 1.481, + "westindia": 1.416, + "westus": 1.584, + "westus2": 1.302 + }, + "standardf32sv2": { + "australiacentral": 3.248, + "australiacentral2": 3.248, + "australiaeast": 3.248, + "australiasoutheast": 3.254, + "brazilsouth": 3.568, + "canadacentral": 2.954, + "canadaeast": 2.954, + "centralindia": 2.832, + "centralus": 3.104, + "eastasia": 3.2, + "eastus": 2.604, + "eastus2": 2.604, + "francecentral": 3.088, + "francesouth": 3.566, + "germanycentral": 3.3984, + "germanynorth": 3.49, + "germanywestcentral": 3.024, + "japaneast": 3.184, + "japanwest": 3.349, + "koreacentral": 3.008, + "koreasouth": 3.009, + "northcentralus": 2.832, + "northeurope": 3.008, + "southafricanorth": 3.294, + "southafricawest": 3.757, + "southcentralus": 3.104, + "southeastasia": 2.822, + "southindia": 2.968, + "uaecentral": 3.49, + "uaenorth": 3.104, + "uksouth": 3.088, + "ukwest": 3.09, + "usgovarizona": 3.172, + "usgovtexas": 3.104, + "usgovvirginia": 3.104, + "westcentralus": 3.104, + "westeurope": 2.961, + "westindia": 2.832, + "westus": 3.168, + "westus2": 2.604 + }, + "standardf48sv2": { + "australiacentral": 4.872, + "australiacentral2": 4.872, + "australiaeast": 4.872, + "australiasoutheast": 4.881, + "brazilsouth": 5.352, + "canadacentral": 4.431, + "canadaeast": 4.431, + "centralindia": 4.248, + "centralus": 4.656, + "eastasia": 4.8, + "eastus": 4.24, + "eastus2": 4.24, + "francecentral": 4.63, + "francesouth": 5.348, + "germanynorth": 5.235, + "germanywestcentral": 4.536, + "japaneast": 4.775, + "japanwest": 5.025, + "koreacentral": 4.512, + "koreasouth": 4.512, + "northcentralus": 4.248, + "northeurope": 4.512, + "southafricanorth": 4.942, + "southafricawest": 5.635, + "southcentralus": 4.656, + "southeastasia": 4.56, + "southindia": 4.452, + "switzerlandnorth": 5.001, + "switzerlandwest": 5.84, + "uaecentral": 5.234, + "uaenorth": 4.656, + "uksouth": 4.63, + "ukwest": 4.635, + "usgovarizona": 4.656, + "usgovvirginia": 4.656, + "westeurope": 4.537, + "westindia": 4.248, + "westus": 4.754, + "westus2": 4.24 + }, + "standardf64sv2": { + "australiacentral": 6.496, + "australiacentral2": 6.496, + "australiaeast": 6.496, + "australiasoutheast": 6.507, + "brazilsouth": 7.136, + "canadacentral": 5.909, + "canadaeast": 5.909, + "centralindia": 5.664, + "centralus": 6.208, + "eastasia": 6.4, + "eastus": 5.209, + "eastus2": 5.209, + "francecentral": 6.176, + "francesouth": 7.133, + "germanycentral": 6.7968, + "germanynorth": 6.979, + "germanywestcentral": 6.048, + "japaneast": 6.368, + "japanwest": 6.698, + "koreacentral": 6.016, + "koreasouth": 6.017, + "northcentralus": 5.664, + "northeurope": 6.016, + "southafricanorth": 6.589, + "southafricawest": 7.514, + "southcentralus": 6.208, + "southeastasia": 5.644, + "southindia": 5.936, + "uaecentral": 6.979, + "uaenorth": 6.208, + "uksouth": 6.176, + "ukwest": 6.181, + "usgovarizona": 6.344, + "usgovtexas": 6.208, + "usgovvirginia": 6.208, + "westcentralus": 6.208, + "westeurope": 5.922, + "westindia": 5.664, + "westus": 6.336, + "westus2": 5.209 + }, + "standardf72sv2": { + "australiacentral": 7.308, + "australiacentral2": 7.308, + "australiaeast": 7.308, + "australiasoutheast": 7.321, + "brazilsouth": 8.028, + "canadacentral": 6.647, + "canadaeast": 6.647, + "centralindia": 6.372, + "centralus": 6.984, + "eastasia": 7.2, + "eastus": 5.86, + "eastus2": 5.86, + "francecentral": 6.948, + "francesouth": 8.024, + "germanycentral": 7.6464, + "germanynorth": 7.852, + "germanywestcentral": 6.804, + "japaneast": 7.164, + "japanwest": 7.535, + "koreacentral": 6.768, + "koreasouth": 6.77, + "northcentralus": 6.372, + "northeurope": 6.768, + "southafricanorth": 7.412, + "southafricawest": 8.453, + "southcentralus": 6.984, + "southeastasia": 6.35, + "southindia": 6.678, + "uaecentral": 7.852, + "uaenorth": 6.984, + "uksouth": 6.948, + "ukwest": 6.953, + "usgovarizona": 7.137, + "usgovtexas": 6.984, + "usgovvirginia": 6.984, + "westcentralus": 6.984, + "westeurope": 6.662, + "westindia": 6.372, + "westus": 7.128, + "westus2": 5.86 + }, + "standardg1": { + "australiaeast": 0.708, + "canadacentral": 0.537, + "canadaeast": 0.537, + "eastus2": 0.61, + "germanycentral": 0.683, + "germanynortheast": 0.854, + "japaneast": 0.641, + "southeastasia": 0.73, + "uksouth": 0.544, + "usgovarizona": 0.7625, + "usgovtexas": 0.7625, + "usgovvirginia": 0.61, + "westeurope": 0.77, + "westus": 0.67, + "westus2": 0.559 + }, + "standardg2": { + "australiaeast": 1.415, + "canadacentral": 1.074, + "canadaeast": 1.074, + "eastus2": 1.22, + "germanycentral": 1.366, + "germanynortheast": 1.708, + "japaneast": 1.28, + "southeastasia": 1.46, + "uksouth": 1.087, + "usgovarizona": 1.525, + "usgovtexas": 1.525, + "usgovvirginia": 1.22, + "westeurope": 1.54, + "westus": 1.34, + "westus2": 1.119 + }, + "standardg3": { + "australiaeast": 2.83, + "canadacentral": 2.147, + "canadaeast": 2.147, + "eastus2": 2.44, + "germanycentral": 2.733, + "germanynortheast": 3.416, + "japaneast": 2.56, + "southeastasia": 2.92, + "uksouth": 2.174, + "usgovarizona": 3.05, + "usgovtexas": 3.05, + "usgovvirginia": 2.44, + "westeurope": 3.08, + "westus": 2.68, + "westus2": 2.238 + }, + "standardg4": { + "australiaeast": 5.661, + "canadacentral": 4.294, + "canadaeast": 4.294, + "eastus2": 4.88, + "germanycentral": 5.466, + "germanynortheast": 6.832, + "japaneast": 5.119, + "southeastasia": 5.84, + "uksouth": 4.349, + "usgovarizona": 6.1, + "usgovtexas": 6.1, + "usgovvirginia": 4.88, + "westeurope": 6.16, + "westus": 5.36, + "westus2": 4.475 + }, + "standardg5": { + "australiaeast": 11.322, + "canadacentral": 8.589, + "canadaeast": 8.589, + "eastus2": 8.78, + "germanycentral": 10.931, + "germanynortheast": 12.292, + "japaneast": 10.238, + "southeastasia": 10.54, + "uksouth": 8.698, + "usgovarizona": 10.975, + "usgovtexas": 10.975, + "usgovvirginia": 9.76, + "westeurope": 11.1, + "westus": 9.65, + "westus2": 8.78 + }, + "standardgs1": { + "australiaeast": 0.708, + "canadacentral": 0.537, + "canadaeast": 0.537, + "eastus2": 0.61, + "germanycentral": 0.683, + "germanynortheast": 0.854, + "japaneast": 0.641, + "southeastasia": 0.73, + "uksouth": 0.544, + "usgovarizona": 0.7625, + "usgovtexas": 0.7625, + "usgovvirginia": 0.61, + "westeurope": 0.77, + "westus": 0.67, + "westus2": 0.559 + }, + "standardgs2": { + "australiaeast": 1.415, + "canadacentral": 1.074, + "canadaeast": 1.074, + "eastus2": 1.22, + "germanycentral": 1.366, + "germanynortheast": 1.708, + "japaneast": 1.28, + "southeastasia": 1.46, + "uksouth": 1.087, + "usgovarizona": 1.525, + "usgovtexas": 1.525, + "usgovvirginia": 1.22, + "westeurope": 1.54, + "westus": 1.34, + "westus2": 1.119 + }, + "standardgs3": { + "australiaeast": 2.83, + "canadacentral": 2.147, + "canadaeast": 2.147, + "eastus2": 2.44, + "germanycentral": 2.733, + "germanynortheast": 3.416, + "japaneast": 2.56, + "southeastasia": 2.92, + "uksouth": 2.174, + "usgovarizona": 3.05, + "usgovtexas": 3.05, + "usgovvirginia": 2.44, + "westeurope": 3.08, + "westus": 2.68, + "westus2": 2.238 + }, + "standardgs4": { + "australiaeast": 5.661, + "canadacentral": 4.294, + "canadaeast": 4.294, + "eastus2": 4.88, + "germanycentral": 5.466, + "germanynortheast": 6.832, + "japaneast": 5.119, + "southeastasia": 5.84, + "uksouth": 4.349, + "usgovarizona": 6.1, + "usgovtexas": 6.1, + "usgovvirginia": 4.88, + "westeurope": 6.16, + "westus": 5.36, + "westus2": 4.475 + }, + "standardgs5": { + "australiaeast": 11.322, + "canadacentral": 8.589, + "canadaeast": 8.589, + "eastus2": 8.78, + "germanycentral": 10.931, + "germanynortheast": 12.292, + "japaneast": 10.238, + "southeastasia": 10.54, + "uksouth": 8.698, + "usgovarizona": 10.975, + "usgovtexas": 10.975, + "usgovvirginia": 9.76, + "westeurope": 11.1, + "westus": 9.65, + "westus2": 8.78 + }, + "standardh8": { + "australiaeast": 2.126, + "centralindia": 1.939, + "eastus": 1.754, + "japaneast": 1.931, + "northcentralus": 1.61, + "northeurope": 1.513, + "southcentralus": 1.61, + "southeastasia": 1.752, + "uksouth": 1.779, + "usgovarizona": 1.411, + "westeurope": 1.706, + "westus": 1.61, + "westus2": 1.129 + }, + "standardh8m": { + "australiaeast": 2.848, + "centralindia": 2.598, + "eastus": 2.35, + "japaneast": 2.587, + "northcentralus": 2.156, + "northeurope": 2.027, + "southcentralus": 2.156, + "southeastasia": 2.171, + "uksouth": 2.204, + "usgovarizona": 1.749, + "westeurope": 2.285, + "westus": 2.156, + "westus2": 1.399 + }, + "standardh8mpromo": { + "australiaeast": 1.321, + "centralindia": 1.17, + "eastus": 1.095, + "japaneast": 1.289, + "northcentralus": 1.095, + "northeurope": 1.148, + "southcentralus": 1.072, + "southeastasia": 1.111, + "uksouth": 1.136, + "usgovarizona": 1.168, + "westeurope": 1.199, + "westus": 1.148, + "westus2": 1.008 + }, + "standardh8promo": { + "australiaeast": 1.079, + "centralindia": 0.967, + "eastus": 0.911, + "japaneast": 1.055, + "northcentralus": 0.911, + "northeurope": 0.95, + "southcentralus": 0.893, + "southeastasia": 0.923, + "uksouth": 0.941, + "usgovarizona": 0.965, + "westeurope": 0.988, + "westus": 0.95, + "westus2": 0.845 + }, + "standardh16": { + "australiaeast": 4.251, + "centralindia": 3.877, + "eastus": 3.508, + "japaneast": 3.862, + "northcentralus": 3.218, + "northeurope": 3.025, + "southcentralus": 3.218, + "southeastasia": 3.504, + "uksouth": 3.558, + "usgovarizona": 2.823, + "westeurope": 3.411, + "westus": 3.218, + "westus2": 2.258 + }, + "standardh16m": { + "australiaeast": 5.697, + "centralindia": 5.196, + "eastus": 4.699, + "japaneast": 5.174, + "northcentralus": 4.311, + "northeurope": 4.053, + "southcentralus": 4.311, + "southeastasia": 4.343, + "uksouth": 4.409, + "usgovarizona": 3.498, + "westeurope": 4.57, + "westus": 4.311, + "westus2": 2.798 + }, + "standardh16mpromo": { + "australiaeast": 2.642, + "centralindia": 2.34, + "eastus": 2.19, + "japaneast": 2.578, + "northcentralus": 2.19, + "northeurope": 2.297, + "southcentralus": 2.143, + "southeastasia": 2.222, + "uksouth": 2.271, + "usgovarizona": 2.335, + "westeurope": 2.399, + "westus": 2.297, + "westus2": 2.015 + }, + "standardh16mr": { + "australiaeast": 6.265, + "centralindia": 5.715, + "eastus": 5.169, + "japaneast": 5.691, + "northcentralus": 4.742, + "northeurope": 4.458, + "southcentralus": 4.742, + "southeastasia": 4.674, + "uksouth": 4.746, + "usgovarizona": 3.765, + "westeurope": 5.027, + "westus": 4.742, + "westus2": 3.012 + }, + "standardh16mrpromo": { + "australiaeast": 2.832, + "centralindia": 2.5, + "eastus": 2.335, + "japaneast": 2.762, + "northcentralus": 2.335, + "northeurope": 2.453, + "southcentralus": 2.284, + "southeastasia": 2.37, + "uksouth": 2.424, + "usgovarizona": 2.495, + "westeurope": 2.424, + "westus": 2.453, + "westus2": 2.143 + }, + "standardh16promo": { + "australiaeast": 2.158, + "centralindia": 1.933, + "eastus": 1.821, + "japaneast": 2.111, + "northcentralus": 1.821, + "northeurope": 1.901, + "southcentralus": 1.786, + "southeastasia": 1.845, + "uksouth": 1.882, + "usgovarizona": 1.929, + "westeurope": 1.977, + "westus": 1.901, + "westus2": 1.691 + }, + "standardh16r": { + "australiaeast": 4.676, + "centralindia": 4.265, + "eastus": 3.858, + "japaneast": 4.248, + "northcentralus": 3.54, + "northeurope": 3.328, + "southcentralus": 3.54, + "southeastasia": 3.751, + "uksouth": 3.809, + "usgovarizona": 3.021, + "westeurope": 3.752, + "westus": 3.54, + "westus2": 2.417 + }, + "standardh16rpromo": { + "australiaeast": 2.301, + "centralindia": 2.053, + "eastus": 1.93, + "japaneast": 2.248, + "northcentralus": 1.93, + "northeurope": 2.017, + "southcentralus": 1.891, + "southeastasia": 1.956, + "uksouth": 1.996, + "usgovarizona": 2.049, + "westeurope": 2.101, + "westus": 2.017, + "westus2": 1.786 + }, + "standardhb60rs": { + "eastus": 5.04, + "southcentralus": 5.268, + "westeurope": 5.724 + }, + "standardhb120rsv2": { + "centralus": 9.948, + "eastus": 9.12, + "japaneast": 10.74, + "northcentralus": 9.84, + "southcentralus": 9.48, + "uaenorth": 10.272, + "uksouth": 10.02, + "westeurope": 10.2, + "westus2": 9.12 + }, + "standardhc44rs": { + "eastus": 5.192, + "japaneast": 6.618, + "southcentralus": 5.508, + "southeastasia": 6.142, + "westeurope": 6.142, + "westus2": 5.192 + }, + "standardl4s": { + "australiaeast": 0.558, + "canadacentral": 0.528, + "canadaeast": 0.528, + "eastus2": 0.546, + "germanycentral": 1.269, + "japaneast": 0.55, + "southeastasia": 0.558, + "uksouth": 0.546, + "usgovarizona": 0.56, + "usgovtexas": 0.56, + "usgovvirginia": 0.56, + "westeurope": 0.556, + "westus": 0.528, + "westus2": 0.496 + }, + "standardl8s": { + "australiaeast": 1.116, + "canadacentral": 1.056, + "canadaeast": 1.056, + "eastus2": 1.091, + "germanycentral": 2.539, + "japaneast": 1.1, + "southeastasia": 1.116, + "uksouth": 1.091, + "usgovarizona": 1.12, + "usgovtexas": 1.12, + "usgovvirginia": 1.12, + "westeurope": 1.112, + "westus": 1.056, + "westus2": 0.992 + }, + "standardl8sv2": { + "australiaeast": 1.116, + "eastus": 0.992, + "eastus2": 0.992, + "northeurope": 1.056, + "southcentralus": 1.117, + "southeastasia": 1.116, + "usgovarizona": 1.12, + "usgovvirginia": 1.12, + "westeurope": 1.112, + "westus": 1.056, + "westus2": 0.992 + }, + "standardl16s": { + "australiaeast": 2.232, + "canadacentral": 2.112, + "canadaeast": 2.112, + "eastus2": 2.182, + "germanycentral": 5.076, + "japaneast": 2.2, + "southeastasia": 2.232, + "uksouth": 2.182, + "usgovarizona": 2.24, + "usgovtexas": 2.24, + "usgovvirginia": 2.24, + "westeurope": 2.224, + "westus": 2.112, + "westus2": 1.984 + }, + "standardl16sv2": { + "australiaeast": 2.232, + "eastus": 1.984, + "eastus2": 1.984, + "northeurope": 2.112, + "southcentralus": 2.234, + "southeastasia": 2.232, + "usgovarizona": 2.24, + "usgovvirginia": 2.24, + "westeurope": 2.224, + "westus": 2.112, + "westus2": 1.984 + }, + "standardl32s": { + "australiaeast": 4.464, + "canadacentral": 4.224, + "canadaeast": 4.224, + "eastus2": 4.365, + "germanycentral": 10.152, + "japaneast": 4.4, + "southeastasia": 4.464, + "uksouth": 4.365, + "usgovarizona": 4.48, + "usgovtexas": 4.48, + "usgovvirginia": 4.48, + "westeurope": 4.448, + "westus": 4.224, + "westus2": 3.968 + }, + "standardl32sv2": { + "australiaeast": 4.464, + "eastus": 3.968, + "eastus2": 3.968, + "northeurope": 4.224, + "southcentralus": 4.467, + "southeastasia": 4.464, + "usgovarizona": 4.48, + "usgovvirginia": 4.48, + "westeurope": 4.448, + "westus": 4.224, + "westus2": 3.968 + }, + "standardl48sv2": { + "australiaeast": 6.696, + "eastus": 5.952, + "eastus2": 5.952, + "northeurope": 6.336, + "southcentralus": 6.701, + "southeastasia": 6.696, + "usgovarizona": 6.72, + "usgovvirginia": 6.72, + "westeurope": 6.672, + "westus": 6.336, + "westus2": 5.952 + }, + "standardl64sv2": { + "australiaeast": 8.928, + "eastus": 7.936, + "eastus2": 7.936, + "northeurope": 8.448, + "southcentralus": 8.934, + "southeastasia": 8.928, + "usgovarizona": 8.96, + "usgovvirginia": 8.96, + "westeurope": 8.896, + "westus": 8.448, + "westus2": 7.936 + }, + "standardl80sv2": { + "australiaeast": 11.16, + "eastus": 9.92, + "eastus2": 9.92, + "northeurope": 10.56, + "southcentralus": 11.168, + "southeastasia": 11.16, + "usgovarizona": 11.2, + "usgovvirginia": 11.2, + "westeurope": 11.12, + "westus": 10.56, + "westus2": 9.92 + }, + "standardm8ms": { + "australiacentral": 2.798, + "australiacentral2": 2.798, + "australiaeast": 2.798, + "australiasoutheast": 2.798, + "brazilsouth": 3.364, + "canadacentral": 2.31759, + "canadaeast": 2.31759, + "centralindia": 1.953, + "centralus": 2.104, + "eastasia": 2.818, + "eastus": 2.1069, + "eastus2": 2.1069, + "francecentral": 2.304, + "germanynorth": 3.164, + "germanywestcentral": 2.518, + "japaneast": 2.798, + "japanwest": 2.7983, + "koreacentral": 2.596, + "koreasouth": 2.596, + "northeurope": 2.414, + "norwayeast": 2.565, + "southafricanorth": 2.427, + "southafricawest": 2.949, + "southcentralus": 2.212, + "southeastasia": 2.798, + "southindia": 2.898, + "switzerlandnorth": 2.949, + "switzerlandwest": 3.724, + "uaecentral": 2.765, + "uaenorth": 2.396, + "uksouth": 2.506, + "ukwest": 2.506, + "usgovarizona": 2.414, + "usgovvirginia": 2.414, + "westeurope": 2.721, + "westus": 2.365, + "westus2": 2.1069 + }, + "standardm16ms": { + "australiacentral": 5.5967, + "australiacentral2": 5.5967, + "australiaeast": 5.5967, + "australiasoutheast": 5.5967, + "brazilsouth": 6.728, + "canadacentral": 4.63518, + "canadaeast": 4.63518, + "centralindia": 3.907, + "centralus": 4.208, + "eastasia": 5.636, + "eastus": 4.2138, + "eastus2": 4.2138, + "francecentral": 4.608, + "germanynorth": 6.329, + "germanywestcentral": 5.035, + "japaneast": 5.596, + "japanwest": 5.596, + "koreacentral": 5.192, + "koreasouth": 5.192, + "northeurope": 4.828, + "norwayeast": 5.13, + "southafricanorth": 4.854, + "southafricawest": 5.899, + "southcentralus": 4.424, + "southeastasia": 5.5967, + "southindia": 5.796, + "switzerlandnorth": 5.899, + "switzerlandwest": 7.447, + "uaecentral": 5.53, + "uaenorth": 4.792, + "uksouth": 5.0128, + "ukwest": 5.0128, + "usgovarizona": 4.828, + "usgovvirginia": 4.828, + "westeurope": 5.443, + "westus": 4.731, + "westus2": 4.2138 + }, + "standardm32ls": { + "australiacentral": 4.909, + "australiacentral2": 4.909, + "australiaeast": 4.909, + "australiasoutheast": 4.909, + "brazilsouth": 7.521, + "canadacentral": 4.7795, + "canadaeast": 4.7795, + "centralindia": 4.74722, + "centralus": 4.718, + "eastasia": 5.282, + "eastus": 4.345, + "eastus2": 4.345, + "francecentral": 4.842, + "germanynorth": 5.954, + "germanywestcentral": 4.909, + "japaneast": 4.909, + "japanwest": 4.909, + "koreacentral": 4.92, + "koreasouth": 4.92, + "northeurope": 4.655, + "norwayeast": 5.58, + "southafricanorth": 5.322, + "southafricawest": 6.299, + "southcentralus": 4.92, + "southeastasia": 4.909, + "southindia": 5.077, + "switzerlandnorth": 5.609, + "switzerlandwest": 6.85, + "uaecentral": 5.954, + "uaenorth": 5.007, + "uksouth": 4.823, + "ukwest": 4.823, + "usgovarizona": 5.214, + "usgovvirginia": 5.214, + "westeurope": 4.909, + "westus": 4.673, + "westus2": 4.345 + }, + "standardm32ms": { + "australiacentral": 11.193, + "australiacentral2": 11.193, + "australiaeast": 11.1933, + "australiasoutheast": 11.1933, + "brazilsouth": 13.457, + "canadacentral": 9.27036, + "canadaeast": 9.27036, + "centralindia": 7.813, + "centralus": 8.417, + "eastasia": 11.272, + "eastus": 8.4276, + "eastus2": 8.4276, + "francecentral": 9.216, + "germanynorth": 12.658, + "germanywestcentral": 10.07, + "japaneast": 11.193, + "japanwest": 11.193, + "koreacentral": 10.384, + "koreasouth": 10.384, + "northeurope": 9.656, + "norwayeast": 10.261, + "southafricanorth": 9.708, + "southafricawest": 11.797, + "southcentralus": 8.847, + "southeastasia": 11.1933, + "southindia": 11.592, + "switzerlandnorth": 11.797, + "switzerlandwest": 14.895, + "uaecentral": 11.06, + "uaenorth": 9.585, + "uksouth": 10.025, + "ukwest": 10.025, + "usgovarizona": 9.656, + "usgovvirginia": 9.656, + "westeurope": 10.886, + "westus": 9.462, + "westus2": 8.4276 + }, + "standardm32ts": { + "australiacentral": 4.72, + "australiacentral2": 4.72, + "australiaeast": 4.72, + "australiasoutheast": 4.72, + "brazilsouth": 7.171, + "canadacentral": 4.5969, + "canadaeast": 4.5969, + "centralindia": 4.55798, + "centralus": 4.531, + "eastasia": 5.062, + "eastus": 4.179, + "eastus2": 4.179, + "francecentral": 4.647, + "germanynorth": 5.694, + "germanywestcentral": 4.72, + "japaneast": 4.72, + "japanwest": 4.72, + "koreacentral": 4.72, + "koreasouth": 4.72, + "northeurope": 4.47677, + "norwayeast": 5.343, + "southafricanorth": 5.099, + "southafricawest": 6.02, + "southcentralus": 4.72, + "southeastasia": 4.72, + "southindia": 4.88282, + "switzerlandnorth": 5.37, + "switzerlandwest": 6.54, + "uaecentral": 5.695, + "uaenorth": 4.803, + "uksouth": 4.639, + "ukwest": 4.639, + "usgovarizona": 5.0148, + "usgovvirginia": 5.0148, + "westeurope": 4.72, + "westus": 4.488, + "westus2": 4.179 + }, + "standardm64": { + "australiacentral": 12.615, + "australiacentral2": 12.615, + "australiaeast": 12.615, + "australiasoutheast": 12.615, + "brazilsouth": 15.949, + "canadacentral": 10.5743, + "canadaeast": 10.5743, + "centralindia": 9.825, + "centralus": 10.48, + "eastasia": 13.584, + "eastus": 9.613, + "eastus2": 9.613, + "francecentral": 11.347, + "germanynorth": 15.082, + "germanywestcentral": 12.281, + "japaneast": 12.615, + "japanwest": 12.615, + "koreacentral": 12.614, + "koreasouth": 12.614, + "northeurope": 10.947, + "norwayeast": 12.481, + "southafricanorth": 11.88, + "southafricawest": 14.148, + "southcentralus": 10.947, + "southeastasia": 12.615, + "southindia": 13.05, + "switzerlandnorth": 14.148, + "switzerlandwest": 17.509, + "uaecentral": 13.348, + "uaenorth": 11.747, + "uksouth": 11.347, + "ukwest": 11.347, + "usgovarizona": 10.947, + "usgovvirginia": 10.947, + "westeurope": 12.281, + "westus": 11.614, + "westus2": 9.613 + }, + "standardm64ls": { + "australiacentral": 9.442, + "australiacentral2": 9.442, + "australiaeast": 9.442, + "australiasoutheast": 9.442, + "brazilsouth": 14.344, + "canadacentral": 9.1949, + "canadaeast": 9.1949, + "centralindia": 9.1171, + "centralus": 9.437, + "eastasia": 10.124, + "eastus": 8.359, + "eastus2": 8.359, + "francecentral": 9.295, + "germanynorth": 11.391, + "germanywestcentral": 9.442, + "japaneast": 9.442, + "japanwest": 9.442, + "koreacentral": 9.442, + "koreasouth": 9.442, + "northeurope": 8.95465, + "norwayeast": 11.161, + "southafricanorth": 10.2, + "southafricawest": 12.041, + "southcentralus": 9.442, + "southeastasia": 9.442, + "southindia": 9.7669, + "switzerlandnorth": 10.742, + "switzerlandwest": 13.081, + "uaecentral": 11.908, + "uaenorth": 9.608, + "uksouth": 9.278, + "ukwest": 9.278, + "usgovarizona": 10.0308, + "usgovvirginia": 10.0308, + "westeurope": 9.442, + "westus": 9.347, + "westus2": 8.359 + }, + "standardm64m": { + "australiacentral": 19.55, + "australiacentral2": 19.55, + "australiaeast": 19.55, + "australiasoutheast": 19.552, + "brazilsouth": 23.102, + "canadacentral": 16.39, + "canadaeast": 16.39, + "centralindia": 13.61, + "centralus": 18.023, + "eastasia": 19.434, + "eastus": 14.641, + "eastus2": 14.641, + "francecentral": 15.969, + "germanynorth": 21.757, + "germanywestcentral": 17.406, + "japaneast": 19.552, + "japanwest": 19.552, + "koreacentral": 17.933, + "koreasouth": 17.933, + "northeurope": 16.823, + "norwayeast": 22.026, + "southafricanorth": 16.796, + "southafricawest": 20.311, + "southcentralus": 15.349, + "southeastasia": 19.552, + "southindia": 20.227, + "switzerlandnorth": 20.311, + "switzerlandwest": 25.521, + "uaecentral": 23.761, + "uaenorth": 16.589, + "uksouth": 17.478, + "ukwest": 17.478, + "usgovarizona": 16.823, + "usgovvirginia": 16.823, + "westeurope": 19.036, + "westus": 20.291, + "westus2": 14.641 + }, + "standardm64ms": { + "australiacentral": 19.55, + "australiacentral2": 19.55, + "australiaeast": 19.55, + "australiasoutheast": 19.552, + "brazilsouth": 23.102, + "canadacentral": 16.39, + "canadaeast": 16.39, + "centralindia": 13.61, + "centralus": 18.023, + "eastasia": 19.434, + "eastus": 14.641, + "eastus2": 14.641, + "francecentral": 15.969, + "germanynorth": 21.757, + "germanywestcentral": 17.406, + "japaneast": 19.552, + "japanwest": 19.552, + "koreacentral": 17.933, + "koreasouth": 17.933, + "northeurope": 16.823, + "norwayeast": 22.026, + "southafricanorth": 16.796, + "southafricawest": 20.311, + "southcentralus": 15.349, + "southeastasia": 19.552, + "southindia": 20.227, + "switzerlandnorth": 20.311, + "switzerlandwest": 25.521, + "uaecentral": 23.761, + "uaenorth": 16.589, + "uksouth": 17.478, + "ukwest": 17.478, + "usgovarizona": 16.823, + "usgovvirginia": 16.823, + "westeurope": 19.036, + "westus": 20.291, + "westus2": 14.641 + }, + "standardm64s": { + "australiacentral": 12.615, + "australiacentral2": 12.615, + "australiaeast": 12.615, + "australiasoutheast": 12.615, + "brazilsouth": 15.949, + "canadacentral": 10.5743, + "canadaeast": 10.5743, + "centralindia": 9.825, + "centralus": 10.48, + "eastasia": 13.584, + "eastus": 9.613, + "eastus2": 9.613, + "francecentral": 11.347, + "germanynorth": 15.082, + "germanywestcentral": 12.281, + "japaneast": 12.615, + "japanwest": 12.615, + "koreacentral": 12.614, + "koreasouth": 12.614, + "northeurope": 10.947, + "norwayeast": 12.481, + "southafricanorth": 11.88, + "southafricawest": 14.148, + "southcentralus": 10.947, + "southeastasia": 12.615, + "southindia": 13.05, + "switzerlandnorth": 14.148, + "switzerlandwest": 17.509, + "uaecentral": 13.348, + "uaenorth": 11.747, + "uksouth": 11.347, + "ukwest": 11.347, + "usgovarizona": 10.947, + "usgovvirginia": 10.947, + "westeurope": 12.281, + "westus": 11.614, + "westus2": 9.613 + }, + "standardm128": { + "australiacentral": 25.229, + "australiacentral2": 25.229, + "australiaeast": 25.229, + "australiasoutheast": 25.229, + "brazilsouth": 31.897, + "canadacentral": 21.1486, + "canadaeast": 21.1486, + "centralindia": 19.65, + "centralus": 20.96, + "eastasia": 27.168, + "eastus": 19.226, + "eastus2": 19.226, + "francecentral": 22.694, + "germanynorth": 30.164, + "germanywestcentral": 24.562, + "japaneast": 25.23, + "japanwest": 25.23, + "koreacentral": 25.228, + "koreasouth": 25.228, + "northeurope": 21.894, + "norwayeast": 24.961, + "southafricanorth": 23.761, + "southafricawest": 28.296, + "southcentralus": 21.894, + "southeastasia": 25.23, + "southindia": 26.099, + "switzerlandnorth": 28.296, + "switzerlandwest": 35.018, + "uaecentral": 26.695, + "uaenorth": 23.494, + "uksouth": 22.694, + "ukwest": 22.694, + "usgovarizona": 21.894, + "usgovvirginia": 21.894, + "westeurope": 24.562, + "westus": 23.227, + "westus2": 19.226 + }, + "standardm128m": { + "australiacentral": 47.822, + "australiacentral2": 47.822, + "australiaeast": 47.822, + "australiasoutheast": 47.826, + "brazilsouth": 57.93, + "canadacentral": 39.3954, + "canadaeast": 39.3954, + "centralindia": 33.424, + "centralus": 36.045, + "eastasia": 48.458, + "eastus": 35.814, + "eastus2": 35.814, + "francecentral": 39.515, + "germanynorth": 54.435, + "germanywestcentral": 43.232, + "japaneast": 47.827, + "japanwest": 47.827, + "koreacentral": 44.586, + "koreasouth": 44.586, + "northeurope": 41.15, + "norwayeast": 44.052, + "southafricanorth": 41.65, + "southafricawest": 50.724, + "southcentralus": 37.914, + "southeastasia": 47.826, + "southindia": 49.477, + "switzerlandnorth": 50.724, + "switzerlandwest": 64.175, + "uaecentral": 47.521, + "uaenorth": 41.116, + "uksouth": 42.7529, + "ukwest": 42.7529, + "usgovarizona": 41.15, + "usgovvirginia": 41.15, + "westeurope": 46.4892, + "westus": 40.582, + "westus2": 35.814 + }, + "standardm128ms": { + "australiacentral": 47.822, + "australiacentral2": 47.822, + "australiaeast": 47.822, + "australiasoutheast": 47.826, + "brazilsouth": 57.93, + "canadacentral": 39.3954, + "canadaeast": 39.3954, + "centralindia": 33.424, + "centralus": 36.045, + "eastasia": 48.458, + "eastus": 35.814, + "eastus2": 35.814, + "francecentral": 39.515, + "germanynorth": 54.435, + "germanywestcentral": 43.232, + "japaneast": 47.827, + "japanwest": 47.827, + "koreacentral": 44.586, + "koreasouth": 44.586, + "northeurope": 41.15, + "norwayeast": 44.052, + "southafricanorth": 41.65, + "southafricawest": 50.724, + "southcentralus": 37.914, + "southeastasia": 47.826, + "southindia": 49.477, + "switzerlandnorth": 50.724, + "switzerlandwest": 64.175, + "uaecentral": 47.521, + "uaenorth": 41.116, + "uksouth": 42.7529, + "ukwest": 42.7529, + "usgovarizona": 41.15, + "usgovvirginia": 41.15, + "westeurope": 46.4892, + "westus": 40.582, + "westus2": 35.814 + }, + "standardm128s": { + "australiacentral": 25.229, + "australiacentral2": 25.229, + "australiaeast": 25.229, + "australiasoutheast": 25.229, + "brazilsouth": 31.897, + "canadacentral": 21.1486, + "canadaeast": 21.1486, + "centralindia": 19.65, + "centralus": 20.96, + "eastasia": 27.168, + "eastus": 19.226, + "eastus2": 19.226, + "francecentral": 22.694, + "germanynorth": 30.164, + "germanywestcentral": 24.562, + "japaneast": 25.23, + "japanwest": 25.23, + "koreacentral": 25.228, + "koreasouth": 25.228, + "northeurope": 21.894, + "norwayeast": 24.961, + "southafricanorth": 23.761, + "southafricawest": 28.296, + "southcentralus": 21.894, + "southeastasia": 25.23, + "southindia": 26.099, + "switzerlandnorth": 28.296, + "switzerlandwest": 35.018, + "uaecentral": 26.695, + "uaenorth": 23.494, + "uksouth": 22.694, + "ukwest": 22.694, + "usgovarizona": 21.894, + "usgovvirginia": 21.894, + "westeurope": 24.562, + "westus": 23.227, + "westus2": 19.226 + }, + "standardm208msv2": { + "australiaeast": 74.267, + "australiasoutheast": 74.267, + "brazilsouth": 96.577, + "centralus": 59.989, + "eastus": 54.188, + "eastus2": 54.188, + "germanywestcentral": 63.112, + "koreacentral": 69.805, + "northcentralus": 54.188, + "northeurope": 59.5424, + "southafricanorth": 69.359, + "southcentralus": 63.112, + "southeastasia": 67.574, + "uaecentral": 79.175, + "uksouth": 65.343, + "ukwest": 63.558, + "usgovarizona": 63.112, + "usgovvirginia": 63.112, + "westeurope": 63.112, + "westus": 67.574, + "westus2": 54.188 + }, + "standardm208sv2": { + "australiaeast": 41.918, + "australiasoutheast": 41.918, + "brazilsouth": 53.072, + "centralus": 34.778, + "eastus": 31.878, + "eastus2": 31.878, + "germanywestcentral": 36.34, + "koreacentral": 39.686, + "northcentralus": 31.878, + "northeurope": 34.5552, + "southafricanorth": 39.463, + "southcentralus": 36.34, + "southeastasia": 38.571, + "uaecentral": 44.372, + "uksouth": 37.456, + "ukwest": 36.563, + "usgovarizona": 36.34, + "usgovvirginia": 36.34, + "westeurope": 36.34, + "westus": 38.571, + "westus2": 31.878 + }, + "standardm416msv2": { + "australiaeast": 162.9, + "australiasoutheast": 162.9, + "brazilsouth": 212.48, + "centralus": 131.18, + "eastus": 118.29, + "eastus2": 118.29, + "germanywestcentral": 138.116, + "koreacentral": 152.99, + "northcentralus": 118.29, + "northeurope": 130.184, + "southafricanorth": 152.0, + "southcentralus": 138.12, + "southeastasia": 148.03, + "uaecentral": 173.81, + "uksouth": 143.07, + "ukwest": 139.11, + "usgovarizona": 138.12, + "usgovvirginia": 138.12, + "westeurope": 138.116, + "westus": 148.03, + "westus2": 118.29 + }, + "standardm416sv2": { + "australiaeast": 91.027, + "australiasoutheast": 91.027, + "brazilsouth": 115.82, + "centralus": 75.162, + "eastus": 68.716, + "eastus2": 68.716, + "germanywestcentral": 78.632, + "koreacentral": 86.069, + "northcentralus": 68.716, + "northeurope": 74.6656, + "southafricanorth": 85.572, + "southcentralus": 78.632, + "southeastasia": 83.59, + "uaecentral": 96.481, + "uksouth": 81.111, + "ukwest": 79.128, + "usgovarizona": 78.632, + "usgovvirginia": 78.632, + "westeurope": 78.632, + "westus": 83.59, + "westus2": 68.716 + }, + "standardnc4ast4v3": { + "westus2": 0.71 + }, + "standardnc6": { + "australiaeast": 1.83, + "eastus": 1.084, + "eastus2": 1.084, + "northcentralus": 1.084, + "northeurope": 1.156, + "southcentralus": 1.301, + "southeastasia": 1.556, + "uksouth": 1.526, + "usgovarizona": 1.264, + "usgovvirginia": 1.264, + "westeurope": 1.387, + "westus2": 1.084 + }, + "standardnc6promo": { + "australiaeast": 0.959, + "eastus": 0.672, + "eastus2": 0.672, + "japaneast": 0.959, + "northcentralus": 0.672, + "northeurope": 0.704, + "southcentralus": 0.751, + "southeastasia": 0.857, + "uksouth": 0.84, + "usgovarizona": 0.751, + "usgovvirginia": 0.751, + "westeurope": 0.791, + "westus": 0.751, + "westus2": 0.672 + }, + "standardnc6sv2": { + "eastus": 2.493, + "southcentralus": 2.992, + "southeastasia": 3.579, + "westeurope": 3.19, + "westus2": 2.493 + }, + "standardnc6sv3": { + "australiaeast": 4.51, + "canadacentral": 3.642, + "centralindia": 4.51, + "eastus": 3.428, + "eastus2": 3.3408, + "francecentral": 3.856, + "japaneast": 4.47, + "koreacentral": 4.51, + "southcentralus": 3.7708, + "southeastasia": 4.51, + "uksouth": 3.865, + "usgovarizona": 4.04, + "usgovvirginia": 4.04, + "westeurope": 4.099, + "westus2": 3.3408 + }, + "standardnc8ast4v3": { + "westus2": 1.12 + }, + "standardnc12": { + "australiaeast": 3.66, + "eastus": 2.168, + "eastus2": 2.168, + "northcentralus": 2.168, + "northeurope": 2.312, + "southcentralus": 2.602, + "southeastasia": 3.113, + "uksouth": 3.051, + "usgovarizona": 2.528, + "usgovvirginia": 2.528, + "westeurope": 2.774, + "westus2": 2.168 + }, + "standardnc12promo": { + "australiaeast": 1.918, + "eastus": 1.344, + "eastus2": 1.344, + "japaneast": 1.918, + "northcentralus": 1.344, + "northeurope": 1.407, + "southcentralus": 1.502, + "southeastasia": 1.714, + "uksouth": 1.681, + "usgovarizona": 1.502, + "usgovvirginia": 1.502, + "westeurope": 1.582, + "westus": 1.502, + "westus2": 1.344 + }, + "standardnc12sv2": { + "eastus": 4.986, + "southcentralus": 5.983, + "southeastasia": 7.159, + "westeurope": 6.38, + "westus2": 4.986 + }, + "standardnc12sv3": { + "australiaeast": 9.02, + "canadacentral": 7.284, + "centralindia": 9.02, + "eastus": 6.856, + "eastus2": 6.6816, + "francecentral": 7.712, + "japaneast": 8.94, + "koreacentral": 9.02, + "southcentralus": 7.5416, + "southeastasia": 9.02, + "uksouth": 7.73, + "usgovarizona": 8.08, + "usgovvirginia": 8.08, + "westeurope": 8.198, + "westus2": 6.6816 + }, + "standardnc16ast4v3": { + "westus2": 1.94 + }, + "standardnc24": { + "australiaeast": 7.319, + "eastus": 4.336, + "eastus2": 4.336, + "northcentralus": 4.336, + "northeurope": 4.624, + "southcentralus": 5.203, + "southeastasia": 6.226, + "uksouth": 6.102, + "usgovarizona": 5.056, + "usgovvirginia": 5.056, + "westeurope": 5.549, + "westus2": 4.336 + }, + "standardnc24promo": { + "australiaeast": 3.836, + "eastus": 2.688, + "eastus2": 2.688, + "japaneast": 3.836, + "northcentralus": 2.688, + "northeurope": 2.815, + "southcentralus": 3.005, + "southeastasia": 3.429, + "uksouth": 3.361, + "usgovarizona": 3.005, + "usgovvirginia": 3.005, + "westeurope": 3.163, + "westus": 3.005, + "westus2": 2.688 + }, + "standardnc24r": { + "australiaeast": 8.063, + "eastus": 4.77, + "eastus2": 4.77, + "northcentralus": 4.77, + "northeurope": 5.086, + "southcentralus": 5.724, + "southeastasia": 6.849, + "uksouth": 6.714, + "usgovarizona": 5.562, + "usgovvirginia": 5.562, + "westeurope": 6.104, + "westus2": 4.77 + }, + "standardnc24rpromo": { + "australiaeast": 4.11, + "eastus": 2.846, + "eastus2": 2.846, + "japaneast": 4.11, + "northcentralus": 2.846, + "northeurope": 2.986, + "southcentralus": 3.195, + "southeastasia": 3.662, + "uksouth": 3.588, + "usgovarizona": 3.195, + "usgovvirginia": 3.195, + "westeurope": 3.369, + "westus": 3.195, + "westus2": 2.846 + }, + "standardnc24rsv2": { + "eastus": 10.971, + "southcentralus": 13.165, + "southeastasia": 15.753, + "westeurope": 14.038, + "westus2": 10.971 + }, + "standardnc24rsv3": { + "australiaeast": 19.844, + "canadacentral": 16.025, + "centralindia": 19.734, + "eastus": 15.083, + "eastus2": 14.5872, + "francecentral": 16.857, + "japaneast": 19.558, + "koreacentral": 19.734, + "southcentralus": 16.5924, + "southeastasia": 19.844, + "uksouth": 17.006, + "usgovarizona": 17.776, + "usgovvirginia": 17.776, + "westeurope": 18.036, + "westus2": 14.5872 + }, + "standardnc24sv2": { + "eastus": 9.972, + "southcentralus": 11.966, + "southeastasia": 14.318, + "westeurope": 12.759, + "westus2": 9.972 + }, + "standardnc24sv3": { + "australiaeast": 18.04, + "canadacentral": 14.568, + "centralindia": 18.04, + "eastus": 13.712, + "eastus2": 13.3632, + "francecentral": 15.425, + "japaneast": 17.88, + "koreacentral": 18.04, + "southcentralus": 15.0832, + "southeastasia": 18.04, + "uksouth": 15.46, + "usgovarizona": 16.16, + "usgovvirginia": 16.16, + "westeurope": 16.396, + "westus2": 13.3632 + }, + "standardnc64ast4v3": { + "westus2": 7.296 + }, + "standardnd6s": { + "eastus": 2.493, + "southcentralus": 2.992, + "southeastasia": 3.579, + "westeurope": 3.19, + "westus2": 2.493 + }, + "standardnd12s": { + "eastus": 4.986, + "southcentralus": 5.983, + "southeastasia": 7.159, + "westeurope": 6.38, + "westus2": 4.986 + }, + "standardnd24rs": { + "eastus": 10.971, + "southcentralus": 13.165, + "southeastasia": 15.753, + "westeurope": 14.039, + "westus2": 10.971 + }, + "standardnd24s": { + "eastus": 9.972, + "southcentralus": 11.966, + "southeastasia": 14.318, + "westeurope": 12.759, + "westus2": 9.972 + }, + "standardnd40rsv2": { + "eastus": 23.872, + "southcentralus": 28.278, + "usgovarizona": 29.379, + "usgovvirginia": 29.379, + "westeurope": 29.366, + "westus2": 23.872 + }, + "standardnv4asv4": { + "australiaeast": 0.522, + "centralindia": 0.51, + "eastus": 0.417, + "eastus2": 0.417, + "japaneast": 0.522, + "northeurope": 0.464, + "southcentralus": 0.464, + "southeastasia": 0.487, + "uksouth": 0.475, + "westeurope": 0.475, + "westus2": 0.417 + }, + "standardnv6": { + "australiaeast": 1.86, + "centralindia": 1.902, + "eastus": 1.44, + "eastus2": 1.411, + "japaneast": 1.778, + "northcentralus": 1.44, + "northeurope": 1.458, + "southcentralus": 1.35, + "southeastasia": 1.865, + "uksouth": 1.755, + "usgovarizona": 1.603, + "usgovtexas": 1.603, + "usgovvirginia": 1.603, + "westeurope": 1.595, + "westus2": 1.283 + }, + "standardnv6promo": { + "australiaeast": 1.23, + "centralindia": 1.307, + "eastus": 0.96, + "eastus2": 0.997, + "japaneast": 1.224, + "northcentralus": 0.96, + "northeurope": 1.002, + "southcentralus": 0.966, + "southeastasia": 1.23, + "uksouth": 1.177, + "usgovvirginia": 1.095, + "westeurope": 1.095, + "westus": 1.02, + "westus2": 0.932 + }, + "standardnv8asv4": { + "australiaeast": 1.044, + "centralindia": 1.02, + "eastus": 0.834, + "eastus2": 0.834, + "japaneast": 1.044, + "northeurope": 0.927, + "southcentralus": 0.927, + "southeastasia": 0.974, + "uksouth": 0.951, + "westeurope": 0.95, + "westus2": 0.834 + }, + "standardnv12": { + "australiaeast": 3.719, + "centralindia": 3.804, + "eastus": 2.88, + "eastus2": 2.822, + "japaneast": 3.555, + "northcentralus": 2.88, + "northeurope": 2.915, + "southcentralus": 2.7, + "southeastasia": 3.73, + "uksouth": 3.509, + "usgovarizona": 3.206, + "usgovtexas": 3.206, + "usgovvirginia": 3.206, + "westeurope": 3.19, + "westus2": 2.565 + }, + "standardnv12promo": { + "australiaeast": 2.46, + "centralindia": 2.614, + "eastus": 1.92, + "eastus2": 1.994, + "japaneast": 2.448, + "northcentralus": 1.92, + "northeurope": 2.004, + "southcentralus": 1.932, + "southeastasia": 2.46, + "uksouth": 2.355, + "usgovvirginia": 2.191, + "westeurope": 2.191, + "westus": 2.04, + "westus2": 1.863 + }, + "standardnv12sv3": { + "australiaeast": 2.142, + "brazilsouth": 2.49, + "eastus": 1.692, + "eastus2": 1.692, + "francecentral": 1.977, + "japaneast": 2.132, + "northeurope": 1.762, + "norwaywest": 2.672, + "southafricanorth": 2.012, + "southcentralus": 1.92, + "southeastasia": 2.142, + "uaenorth": 1.943, + "uksouth": 1.977, + "usgovarizona": 1.977, + "usgovvirginia": 1.977, + "westeurope": 1.978, + "westus": 1.692, + "westus2": 1.692 + }, + "standardnv16asv4": { + "australiaeast": 2.087, + "centralindia": 2.041, + "eastus": 1.668, + "eastus2": 1.668, + "japaneast": 2.087, + "northeurope": 1.854, + "southcentralus": 1.854, + "southeastasia": 1.948, + "uksouth": 1.901, + "westeurope": 0.951, + "westus2": 1.668 + }, + "standardnv24": { + "australiaeast": 7.439, + "centralindia": 7.608, + "eastus": 5.761, + "eastus2": 5.643, + "japaneast": 7.11, + "northcentralus": 5.761, + "northeurope": 5.83, + "southcentralus": 5.4, + "southeastasia": 7.46, + "uksouth": 7.018, + "usgovarizona": 6.412, + "usgovtexas": 6.412, + "usgovvirginia": 6.412, + "westeurope": 6.38, + "westus2": 5.13 + }, + "standardnv24promo": { + "australiaeast": 4.919, + "centralindia": 5.227, + "eastus": 3.84, + "eastus2": 3.988, + "japaneast": 4.895, + "northcentralus": 3.84, + "northeurope": 4.008, + "southcentralus": 3.864, + "southeastasia": 4.919, + "uksouth": 4.709, + "usgovvirginia": 4.382, + "westeurope": 4.382, + "westus": 4.08, + "westus2": 3.726 + }, + "standardnv24sv3": { + "australiaeast": 4.283, + "brazilsouth": 4.98, + "eastus": 3.384, + "eastus2": 3.384, + "francecentral": 3.954, + "japaneast": 4.264, + "northeurope": 3.524, + "norwaywest": 5.345, + "southafricanorth": 4.025, + "southcentralus": 3.84, + "southeastasia": 4.284, + "uaenorth": 3.886, + "uksouth": 3.954, + "usgovarizona": 3.954, + "usgovvirginia": 3.954, + "westeurope": 3.954, + "westus": 3.384, + "westus2": 3.384 + }, + "standardnv32asv4": { + "australiaeast": 4.175, + "centralindia": 4.082, + "eastus": 3.336, + "eastus2": 3.336, + "japaneast": 4.175, + "northeurope": 3.709, + "southcentralus": 3.708, + "southeastasia": 3.895, + "uksouth": 3.802, + "westeurope": 3.802, + "westus2": 3.336 + }, + "standardnv48sv3": { + "australiaeast": 8.566, + "brazilsouth": 9.96, + "eastus": 6.768, + "eastus2": 6.768, + "francecentral": 7.908, + "japaneast": 8.528, + "northeurope": 7.046, + "norwaywest": 10.689, + "southafricanorth": 8.049, + "southcentralus": 7.68, + "southeastasia": 8.568, + "uaenorth": 7.771, + "uksouth": 7.908, + "usgovarizona": 7.908, + "usgovvirginia": 7.908, + "westeurope": 7.908, + "westus": 6.768, + "westus2": 6.768 + }, + "standardpb6s": { + "brazilsoutheast": 1.106, + "eastus": 1.106, + "southcentralus": 1.217, + "southeastasia": 1.438, + "westeurope": 1.438, + "westus2": 1.106 + }, + "standardpb12s": { + "brazilsoutheast": 2.212, + "eastus": 2.212, + "southcentralus": 2.433, + "southeastasia": 2.876, + "westeurope": 2.876, + "westus2": 2.212 + }, + "standardpb24s": { + "brazilsoutheast": 4.424, + "eastus": 4.424, + "southcentralus": 4.866, + "southeastasia": 5.751, + "westeurope": 5.751, + "westus2": 4.424 + } + }, "bluebox": { "1gb": 0.15, "2gb": 0.25, @@ -28,471 +34131,87454 @@ "standard-large": 0.381, "standard-small": 0.0796 }, - "dreamhost": { - "default": 115, - "high": 150, - "low": 50, - "maximum": 200, - "minimum": 15 - }, "ec2_ap_northeast": { - "c1.medium": "0.158", - "c1.xlarge": "0.632", - "c3.2xlarge": "0.511", - "c3.4xlarge": "1.021", - "c3.8xlarge": "2.043", - "c3.large": "0.128", - "c3.xlarge": "0.255", - "c4.2xlarge": "0.588", - "c4.4xlarge": "1.176", - "c4.8xlarge": "2.352", - "c4.large": "0.147", - "c4.xlarge": "0.294", - "cc2.8xlarge": "2.349", - "cr1.8xlarge": "4.105", - "d2.2xlarge": "1.688", - "d2.4xlarge": "3.376", - "d2.8xlarge": "6.752", - "d2.xlarge": "0.844", - "g2.2xlarge": "0.898", - "hi1.4xlarge": "3.276", - "hs1.8xlarge": "5.400", - "i2.2xlarge": "2.001", - "i2.4xlarge": "4.002", - "i2.8xlarge": "8.004", - "i2.xlarge": "1.001", - "m1.large": "0.243", - "m1.medium": "0.122", - "m1.small": "0.061", - "m1.xlarge": "0.486", - "m2.2xlarge": "0.575", - "m2.4xlarge": "1.150", - "m2.xlarge": "0.287", - "m3.2xlarge": "0.810", - "m3.large": "0.203", - "m3.medium": "0.101", - "m3.xlarge": "0.405", - "r3.2xlarge": "0.840", - "r3.4xlarge": "1.680", - "r3.8xlarge": "3.360", - "r3.large": "0.210", - "r3.xlarge": "0.420", - "t1.micro": "0.026", - "t2.medium": "0.080", - "t2.micro": "0.020", - "t2.small": "0.040" + "c1.medium": 0.158, + "c1.xlarge": 0.632, + "c3.large": 0.128, + "c3.xlarge": 0.255, + "c3.2xlarge": 0.511, + "c3.4xlarge": 1.021, + "c3.8xlarge": 2.043, + "c4.large": 0.114, + "c4.xlarge": 0.227, + "c4.2xlarge": 0.454, + "c4.4xlarge": 0.907, + "c4.8xlarge": 1.815, + "c5.large": 0.096, + "c5.xlarge": 0.192, + "c5.2xlarge": 0.384, + "c5.4xlarge": 0.768, + "c5.9xlarge": 1.728, + "c5.18xlarge": 3.456, + "cc2.8xlarge": 2.349, + "cr1.8xlarge": 4.105, + "d2.xlarge": 0.844, + "d2.2xlarge": 1.688, + "d2.4xlarge": 3.376, + "d2.8xlarge": 6.752, + "g2.2xlarge": 0.898, + "g2.8xlarge": 3.592, + "g3.4xlarge": 1.58, + "g3.8xlarge": 3.16, + "g3.16xlarge": 6.32, + "hs1.8xlarge": 5.4, + "i2.xlarge": 1.001, + "i2.2xlarge": 2.001, + "i2.4xlarge": 4.002, + "i2.8xlarge": 8.004, + "i3.large": 0.183, + "i3.xlarge": 0.366, + "i3.metal": 5.856, + "i3.2xlarge": 0.732, + "i3.4xlarge": 1.464, + "i3.8xlarge": 2.928, + "i3.16xlarge": 5.856, + "m1.small": 0.061, + "m1.medium": 0.122, + "m1.large": 0.243, + "m1.xlarge": 0.486, + "m2.xlarge": 0.287, + "m2.2xlarge": 0.575, + "m2.4xlarge": 1.15, + "m3.medium": 0.096, + "m3.large": 0.193, + "m3.xlarge": 0.385, + "m3.2xlarge": 0.77, + "m4.large": 0.123, + "m4.xlarge": 0.246, + "m4.2xlarge": 0.492, + "m4.4xlarge": 0.984, + "m4.10xlarge": 2.46, + "m4.16xlarge": 3.936, + "m5.large": 0.118, + "m5.xlarge": 0.236, + "m5.2xlarge": 0.472, + "m5.4xlarge": 0.944, + "m5.12xlarge": 2.832, + "m5.24xlarge": 5.664, + "p2.xlarge": 1.465, + "p2.8xlarge": 11.72, + "p2.16xlarge": 23.44, + "p3.2xlarge": 4.981, + "p3.8xlarge": 19.924, + "p3.16xlarge": 39.848, + "r3.large": 0.2, + "r3.xlarge": 0.399, + "r3.2xlarge": 0.798, + "r3.4xlarge": 1.596, + "r3.8xlarge": 3.192, + "r4.large": 0.16, + "r4.xlarge": 0.32, + "r4.2xlarge": 0.64, + "r4.4xlarge": 1.28, + "r4.8xlarge": 2.56, + "r4.16xlarge": 5.12, + "t1.micro": 0.026, + "t2.micro": 0.0144, + "t2.small": 0.0288, + "t2.medium": 0.0576, + "t2.large": 0.1152, + "t2.xlarge": 0.2304, + "t2.nano": 0.0072, + "t2.2xlarge": 0.4608, + "x1.16xlarge": 9.671, + "x1.32xlarge": 19.341, + "x1e.xlarge": 1.209, + "x1e.2xlarge": 2.418, + "x1e.4xlarge": 4.836, + "x1e.8xlarge": 9.672, + "x1e.16xlarge": 19.344, + "x1e.32xlarge": 38.688 + }, + "ec2_ap_south_1": { + "c4.large": 0.1, + "c4.xlarge": 0.2, + "c4.2xlarge": 0.4, + "c4.4xlarge": 0.8, + "c4.8xlarge": 1.6, + "c5.large": 0.085, + "c5.xlarge": 0.17, + "c5.2xlarge": 0.34, + "c5.4xlarge": 0.68, + "c5.9xlarge": 1.53, + "c5.18xlarge": 3.06, + "d2.xlarge": 0.827, + "d2.2xlarge": 1.653, + "d2.4xlarge": 3.306, + "d2.8xlarge": 6.612, + "i2.xlarge": 0.967, + "i2.2xlarge": 1.933, + "i2.4xlarge": 3.867, + "i2.8xlarge": 7.733, + "i3.large": 0.177, + "i3.xlarge": 0.354, + "i3.2xlarge": 0.708, + "i3.4xlarge": 1.416, + "i3.8xlarge": 2.832, + "i3.16xlarge": 5.664, + "m4.large": 0.105, + "m4.xlarge": 0.21, + "m4.2xlarge": 0.42, + "m4.4xlarge": 0.84, + "m4.10xlarge": 2.1, + "m4.16xlarge": 3.36, + "m5.large": 0.101, + "m5.xlarge": 0.202, + "m5.2xlarge": 0.404, + "m5.4xlarge": 0.808, + "m5.12xlarge": 2.424, + "m5.24xlarge": 4.848, + "p2.xlarge": 1.718, + "p2.8xlarge": 13.744, + "p2.16xlarge": 27.488, + "r3.large": 0.19, + "r3.xlarge": 0.379, + "r3.2xlarge": 0.758, + "r3.4xlarge": 1.516, + "r3.8xlarge": 3.032, + "r4.large": 0.137, + "r4.xlarge": 0.274, + "r4.2xlarge": 0.548, + "r4.4xlarge": 1.096, + "r4.8xlarge": 2.192, + "r4.16xlarge": 4.384, + "t2.micro": 0.0124, + "t2.small": 0.0248, + "t2.medium": 0.0496, + "t2.large": 0.0992, + "t2.xlarge": 0.1984, + "t2.nano": 0.0062, + "t2.2xlarge": 0.3968, + "x1.16xlarge": 9.187, + "x1.32xlarge": 18.374 }, "ec2_ap_southeast": { - "c1.medium": "0.164", - "c1.xlarge": "0.655", - "c3.2xlarge": "0.529", - "c3.4xlarge": "1.058", - "c3.8xlarge": "2.117", - "c3.large": "0.132", - "c3.xlarge": "0.265", - "c4.2xlarge": "0.608", - "c4.4xlarge": "1.216", - "c4.8xlarge": "2.432", - "c4.large": "0.152", - "c4.xlarge": "0.304", - "d2.2xlarge": "1.740", - "d2.4xlarge": "3.480", - "d2.8xlarge": "6.960", - "d2.xlarge": "0.870", - "g2.2xlarge": "1.000", - "hi1.4xlarge": "N/A", - "hs1.8xlarge": "5.570", - "i2.2xlarge": "2.035", - "i2.4xlarge": "4.070", - "i2.8xlarge": "8.140", - "i2.xlarge": "1.018", - "m1.large": "0.233", - "m1.medium": "0.117", - "m1.small": "0.058", - "m1.xlarge": "0.467", - "m2.2xlarge": "0.592", - "m2.4xlarge": "1.183", - "m2.xlarge": "0.296", - "m3.2xlarge": "0.784", - "m3.large": "0.196", - "m3.medium": "0.098", - "m3.xlarge": "0.392", - "r3.2xlarge": "0.840", - "r3.4xlarge": "1.680", - "r3.8xlarge": "3.360", - "r3.large": "0.210", - "r3.xlarge": "0.420", - "t1.micro": "0.020", - "t2.medium": "0.080", - "t2.micro": "0.020", - "t2.small": "0.040" + "c1.medium": 0.164, + "c1.xlarge": 0.655, + "c3.large": 0.132, + "c3.xlarge": 0.265, + "c3.2xlarge": 0.529, + "c3.4xlarge": 1.058, + "c3.8xlarge": 2.117, + "c4.large": 0.115, + "c4.xlarge": 0.231, + "c4.2xlarge": 0.462, + "c4.4xlarge": 0.924, + "c4.8xlarge": 1.848, + "c5.large": 0.098, + "c5.xlarge": 0.196, + "c5.2xlarge": 0.392, + "c5.4xlarge": 0.784, + "c5.9xlarge": 1.764, + "c5.18xlarge": 3.528, + "d2.xlarge": 0.87, + "d2.2xlarge": 1.74, + "d2.4xlarge": 3.48, + "d2.8xlarge": 6.96, + "g2.2xlarge": 1.0, + "g2.8xlarge": 4.0, + "g3.4xlarge": 1.67, + "g3.8xlarge": 3.34, + "g3.16xlarge": 6.68, + "hs1.8xlarge": 5.57, + "i2.xlarge": 1.018, + "i2.2xlarge": 2.035, + "i2.4xlarge": 4.07, + "i2.8xlarge": 8.14, + "i3.large": 0.187, + "i3.xlarge": 0.374, + "i3.2xlarge": 0.748, + "i3.4xlarge": 1.496, + "i3.8xlarge": 2.992, + "i3.16xlarge": 5.984, + "m1.small": 0.058, + "m1.medium": 0.117, + "m1.large": 0.233, + "m1.xlarge": 0.467, + "m2.xlarge": 0.296, + "m2.2xlarge": 0.592, + "m2.4xlarge": 1.183, + "m3.medium": 0.098, + "m3.large": 0.196, + "m3.xlarge": 0.392, + "m3.2xlarge": 0.784, + "m4.large": 0.125, + "m4.xlarge": 0.25, + "m4.2xlarge": 0.5, + "m4.4xlarge": 1.0, + "m4.10xlarge": 2.5, + "m4.16xlarge": 4.0, + "m5.large": 0.12, + "m5.xlarge": 0.24, + "m5.2xlarge": 0.48, + "m5.4xlarge": 0.96, + "m5.12xlarge": 2.88, + "m5.24xlarge": 5.76, + "p2.xlarge": 1.718, + "p2.8xlarge": 13.744, + "p2.16xlarge": 27.488, + "r3.large": 0.2, + "r3.xlarge": 0.399, + "r3.2xlarge": 0.798, + "r3.4xlarge": 1.596, + "r3.8xlarge": 3.192, + "r4.large": 0.16, + "r4.xlarge": 0.32, + "r4.2xlarge": 0.64, + "r4.4xlarge": 1.28, + "r4.8xlarge": 2.56, + "r4.16xlarge": 5.12, + "t1.micro": 0.02, + "t2.micro": 0.0146, + "t2.small": 0.0292, + "t2.medium": 0.0584, + "t2.large": 0.1168, + "t2.xlarge": 0.2336, + "t2.nano": 0.0073, + "t2.2xlarge": 0.4672, + "x1.16xlarge": 9.671, + "x1.32xlarge": 19.341 }, "ec2_ap_southeast_2": { - "c1.medium": "0.164", - "c1.xlarge": "0.655", - "c3.2xlarge": "0.529", - "c3.4xlarge": "1.058", - "c3.8xlarge": "2.117", - "c3.large": "0.132", - "c3.xlarge": "0.265", - "c4.2xlarge": "0.608", - "c4.4xlarge": "1.216", - "c4.8xlarge": "2.432", - "c4.large": "0.152", - "c4.xlarge": "0.304", - "d2.2xlarge": "1.740", - "d2.4xlarge": "3.480", - "d2.8xlarge": "6.960", - "d2.xlarge": "0.870", - "g2.2xlarge": "0.898", - "hi1.4xlarge": "N/A", - "hs1.8xlarge": "5.570", - "i2.2xlarge": "2.035", - "i2.4xlarge": "4.070", - "i2.8xlarge": "8.140", - "i2.xlarge": "1.018", - "m1.large": "0.233", - "m1.medium": "0.117", - "m1.small": "0.058", - "m1.xlarge": "0.467", - "m2.2xlarge": "0.592", - "m2.4xlarge": "1.183", - "m2.xlarge": "0.296", - "m3.2xlarge": "0.784", - "m3.large": "0.196", - "m3.medium": "0.098", - "m3.xlarge": "0.392", - "r3.2xlarge": "0.840", - "r3.4xlarge": "1.680", - "r3.8xlarge": "3.360", - "r3.large": "0.210", - "r3.xlarge": "0.420", - "t1.micro": "0.020", - "t2.medium": "0.080", - "t2.micro": "0.020", - "t2.small": "0.040" + "c1.medium": 0.164, + "c1.xlarge": 0.655, + "c3.large": 0.132, + "c3.xlarge": 0.265, + "c3.2xlarge": 0.529, + "c3.4xlarge": 1.058, + "c3.8xlarge": 2.117, + "c4.large": 0.13, + "c4.xlarge": 0.261, + "c4.2xlarge": 0.522, + "c4.4xlarge": 1.042, + "c4.8xlarge": 2.085, + "c5.large": 0.111, + "c5.xlarge": 0.222, + "c5.2xlarge": 0.444, + "c5.4xlarge": 0.888, + "c5.9xlarge": 1.998, + "c5.18xlarge": 3.996, + "d2.xlarge": 0.87, + "d2.2xlarge": 1.74, + "d2.4xlarge": 3.48, + "d2.8xlarge": 6.96, + "g2.2xlarge": 0.898, + "g2.8xlarge": 3.592, + "g3.4xlarge": 1.754, + "g3.8xlarge": 3.508, + "g3.16xlarge": 7.016, + "hs1.8xlarge": 5.57, + "i2.xlarge": 1.018, + "i2.2xlarge": 2.035, + "i2.4xlarge": 4.07, + "i2.8xlarge": 8.14, + "i3.large": 0.187, + "i3.xlarge": 0.374, + "i3.metal": 5.984, + "i3.2xlarge": 0.748, + "i3.4xlarge": 1.496, + "i3.8xlarge": 2.992, + "i3.16xlarge": 5.984, + "m1.small": 0.058, + "m1.medium": 0.117, + "m1.large": 0.233, + "m1.xlarge": 0.467, + "m2.xlarge": 0.296, + "m2.2xlarge": 0.592, + "m2.4xlarge": 1.183, + "m3.medium": 0.093, + "m3.large": 0.186, + "m3.xlarge": 0.372, + "m3.2xlarge": 0.745, + "m4.large": 0.125, + "m4.xlarge": 0.25, + "m4.2xlarge": 0.5, + "m4.4xlarge": 1.0, + "m4.10xlarge": 2.5, + "m4.16xlarge": 4.0, + "m5.large": 0.12, + "m5.xlarge": 0.24, + "m5.2xlarge": 0.48, + "m5.4xlarge": 0.96, + "m5.12xlarge": 2.88, + "m5.24xlarge": 5.76, + "p2.xlarge": 1.542, + "p2.8xlarge": 12.336, + "p2.16xlarge": 24.672, + "r3.large": 0.2, + "r3.xlarge": 0.399, + "r3.2xlarge": 0.798, + "r3.4xlarge": 1.596, + "r3.8xlarge": 3.192, + "r4.large": 0.16, + "r4.xlarge": 0.319, + "r4.2xlarge": 0.638, + "r4.4xlarge": 1.277, + "r4.8xlarge": 2.554, + "r4.16xlarge": 5.107, + "t1.micro": 0.02, + "t2.micro": 0.0146, + "t2.small": 0.0292, + "t2.medium": 0.0584, + "t2.large": 0.1168, + "t2.xlarge": 0.2336, + "t2.nano": 0.0073, + "t2.2xlarge": 0.4672, + "x1.16xlarge": 9.671, + "x1.32xlarge": 19.341, + "x1e.xlarge": 1.209, + "x1e.2xlarge": 2.418, + "x1e.4xlarge": 4.836, + "x1e.8xlarge": 9.672, + "x1e.16xlarge": 19.344, + "x1e.32xlarge": 38.688 + }, + "ec2_ca_central": { + "c4.large": 0.11, + "c4.xlarge": 0.218, + "c4.2xlarge": 0.438, + "c4.4xlarge": 0.876, + "c4.8xlarge": 1.75, + "d2.xlarge": 0.759, + "d2.2xlarge": 1.518, + "d2.4xlarge": 3.036, + "d2.8xlarge": 6.072, + "i3.large": 0.172, + "i3.xlarge": 0.344, + "i3.2xlarge": 0.688, + "i3.4xlarge": 1.376, + "i3.8xlarge": 2.752, + "i3.16xlarge": 5.504, + "m4.large": 0.111, + "m4.xlarge": 0.222, + "m4.2xlarge": 0.444, + "m4.4xlarge": 0.888, + "m4.10xlarge": 2.22, + "m4.16xlarge": 3.552, + "r4.large": 0.146, + "r4.xlarge": 0.292, + "r4.2xlarge": 0.584, + "r4.4xlarge": 1.168, + "r4.8xlarge": 2.336, + "r4.16xlarge": 4.672, + "t2.micro": 0.013, + "t2.small": 0.026, + "t2.medium": 0.052, + "t2.large": 0.103, + "t2.xlarge": 0.206, + "t2.nano": 0.0065, + "t2.2xlarge": 0.412, + "x1.16xlarge": 7.336, + "x1.32xlarge": 14.672 + }, + "ec2_ca_central_1": { + "c4.large": 0.11, + "c4.xlarge": 0.218, + "c4.2xlarge": 0.438, + "c4.4xlarge": 0.876, + "c4.8xlarge": 1.75, + "c5.large": 0.093, + "c5.xlarge": 0.186, + "c5.2xlarge": 0.372, + "c5.4xlarge": 0.744, + "c5.9xlarge": 1.674, + "c5.18xlarge": 3.348, + "c5d.large": 0.106, + "c5d.xlarge": 0.212, + "c5d.2xlarge": 0.424, + "c5d.4xlarge": 0.848, + "c5d.9xlarge": 1.908, + "c5d.18xlarge": 3.816, + "d2.xlarge": 0.759, + "d2.2xlarge": 1.518, + "d2.4xlarge": 3.036, + "d2.8xlarge": 6.072, + "i3.large": 0.172, + "i3.xlarge": 0.344, + "i3.2xlarge": 0.688, + "i3.4xlarge": 1.376, + "i3.8xlarge": 2.752, + "i3.16xlarge": 5.504, + "m4.large": 0.111, + "m4.xlarge": 0.222, + "m4.2xlarge": 0.444, + "m4.4xlarge": 0.888, + "m4.10xlarge": 2.22, + "m4.16xlarge": 3.552, + "m5.large": 0.107, + "m5.xlarge": 0.214, + "m5.2xlarge": 0.428, + "m5.4xlarge": 0.856, + "m5.12xlarge": 2.568, + "m5.24xlarge": 5.136, + "m5d.large": 0.126, + "m5d.xlarge": 0.252, + "m5d.2xlarge": 0.504, + "m5d.4xlarge": 1.008, + "m5d.12xlarge": 3.024, + "m5d.24xlarge": 6.048, + "r4.large": 0.146, + "r4.xlarge": 0.292, + "r4.2xlarge": 0.584, + "r4.4xlarge": 1.168, + "r4.8xlarge": 2.336, + "r4.16xlarge": 4.672, + "t2.micro": 0.0128, + "t2.small": 0.0256, + "t2.medium": 0.0512, + "t2.large": 0.1024, + "t2.xlarge": 0.2048, + "t2.nano": 0.0064, + "t2.2xlarge": 0.4096, + "x1.16xlarge": 7.336, + "x1.32xlarge": 14.672 }, "ec2_eu_central": { - "c3.2xlarge": "0.516", - "c3.4xlarge": "1.032", - "c3.8xlarge": "2.064", - "c3.large": "0.129", - "c3.xlarge": "0.258", - "c4.2xlarge": "0.592", - "c4.4xlarge": "1.184", - "c4.8xlarge": "2.368", - "c4.large": "0.148", - "c4.xlarge": "0.296", - "d2.2xlarge": "1.588", - "d2.4xlarge": "3.176", - "d2.8xlarge": "6.352", - "d2.xlarge": "0.794", - "g2.2xlarge": null, - "i2.2xlarge": "2.026", - "i2.4xlarge": "4.051", - "i2.8xlarge": "8.102", - "i2.xlarge": "1.013", - "m3.2xlarge": "0.665", - "m3.large": "0.166", - "m3.medium": "0.083", - "m3.xlarge": "0.332", - "r3.2xlarge": "0.842", - "r3.4xlarge": "1.684", - "r3.8xlarge": "3.369", - "r3.large": "0.210", - "r3.xlarge": "0.421", - "t2.medium": "0.060", - "t2.micro": "0.015", - "t2.small": "0.030" + "c3.large": 0.129, + "c3.xlarge": 0.258, + "c3.2xlarge": 0.516, + "c3.4xlarge": 1.032, + "c3.8xlarge": 2.064, + "c4.large": 0.114, + "c4.xlarge": 0.227, + "c4.2xlarge": 0.454, + "c4.4xlarge": 0.909, + "c4.8xlarge": 1.817, + "c5.large": 0.097, + "c5.xlarge": 0.194, + "c5.2xlarge": 0.388, + "c5.4xlarge": 0.776, + "c5.9xlarge": 1.746, + "c5.18xlarge": 3.492, + "d2.xlarge": 0.794, + "d2.2xlarge": 1.588, + "d2.4xlarge": 3.176, + "d2.8xlarge": 6.352, + "g2.2xlarge": 0.772, + "g2.8xlarge": 3.088, + "g3.4xlarge": 1.425, + "g3.8xlarge": 2.85, + "g3.16xlarge": 5.7, + "i2.xlarge": 1.013, + "i2.2xlarge": 2.026, + "i2.4xlarge": 4.051, + "i2.8xlarge": 8.102, + "i3.large": 0.186, + "i3.xlarge": 0.372, + "i3.metal": 5.952, + "i3.2xlarge": 0.744, + "i3.4xlarge": 1.488, + "i3.8xlarge": 2.976, + "i3.16xlarge": 5.952, + "m3.medium": 0.079, + "m3.large": 0.158, + "m3.xlarge": 0.315, + "m3.2xlarge": 0.632, + "m4.large": 0.12, + "m4.xlarge": 0.24, + "m4.2xlarge": 0.48, + "m4.4xlarge": 0.96, + "m4.10xlarge": 2.4, + "m4.16xlarge": 3.84, + "m5.large": 0.115, + "m5.xlarge": 0.23, + "m5.2xlarge": 0.46, + "m5.4xlarge": 0.92, + "m5.12xlarge": 2.76, + "m5.24xlarge": 5.52, + "p2.xlarge": 1.326, + "p2.8xlarge": 10.608, + "p2.16xlarge": 21.216, + "r3.large": 0.2, + "r3.xlarge": 0.4, + "r3.2xlarge": 0.8, + "r3.4xlarge": 1.6, + "r3.8xlarge": 3.201, + "r4.large": 0.16, + "r4.xlarge": 0.32, + "r4.2xlarge": 0.64, + "r4.4xlarge": 1.28, + "r4.8xlarge": 2.561, + "r4.16xlarge": 5.122, + "t2.micro": 0.0134, + "t2.small": 0.0268, + "t2.medium": 0.0536, + "t2.large": 0.1072, + "t2.xlarge": 0.2144, + "t2.nano": 0.0067, + "t2.2xlarge": 0.4288, + "x1.16xlarge": 9.337, + "x1.32xlarge": 18.674, + "x1e.xlarge": 1.167, + "x1e.2xlarge": 2.334, + "x1e.4xlarge": 4.668, + "x1e.8xlarge": 9.336, + "x1e.16xlarge": 18.672, + "x1e.32xlarge": 37.344 }, "ec2_eu_west": { - "c1.medium": "0.148", - "c1.xlarge": "0.592", - "c3.2xlarge": "0.478", - "c3.4xlarge": "0.956", - "c3.8xlarge": "1.912", - "c3.large": "0.120", - "c3.xlarge": "0.239", - "c4.2xlarge": "0.528", - "c4.4xlarge": "1.056", - "c4.8xlarge": "2.112", - "c4.large": "0.132", - "c4.xlarge": "0.264", - "cc2.8xlarge": "2.250", - "cg1.4xlarge": "2.360", - "cr1.8xlarge": "3.750", - "d2.2xlarge": "1.470", - "d2.4xlarge": "2.940", - "d2.8xlarge": "5.880", - "d2.xlarge": "0.735", - "g2.2xlarge": "0.702", - "hi1.4xlarge": "3.100", - "hs1.8xlarge": "4.900", - "i2.2xlarge": "1.876", - "i2.4xlarge": "3.751", - "i2.8xlarge": "7.502", - "i2.xlarge": "0.938", - "m1.large": "0.190", - "m1.medium": "0.095", - "m1.small": "0.047", - "m1.xlarge": "0.379", - "m2.2xlarge": "0.550", - "m2.4xlarge": "1.100", - "m2.xlarge": "0.275", - "m3.2xlarge": "0.616", - "m3.large": "0.154", - "m3.medium": "0.077", - "m3.xlarge": "0.308", - "r3.2xlarge": "0.780", - "r3.4xlarge": "1.560", - "r3.8xlarge": "3.120", - "r3.large": "0.195", - "r3.xlarge": "0.390", - "t1.micro": "0.020", - "t2.medium": "0.056", - "t2.micro": "0.014", - "t2.small": "0.028" + "c1.medium": 0.148, + "c1.xlarge": 0.592, + "c3.large": 0.12, + "c3.xlarge": 0.239, + "c3.2xlarge": 0.478, + "c3.4xlarge": 0.956, + "c3.8xlarge": 1.912, + "c4.large": 0.113, + "c4.xlarge": 0.226, + "c4.2xlarge": 0.453, + "c4.4xlarge": 0.905, + "c4.8xlarge": 1.811, + "c5.large": 0.096, + "c5.xlarge": 0.192, + "c5.2xlarge": 0.384, + "c5.4xlarge": 0.768, + "c5.9xlarge": 1.728, + "c5.18xlarge": 3.456, + "c5d.large": 0.109, + "c5d.xlarge": 0.218, + "c5d.2xlarge": 0.436, + "c5d.4xlarge": 0.872, + "c5d.9xlarge": 1.962, + "c5d.18xlarge": 3.924, + "cc2.8xlarge": 2.25, + "cr1.8xlarge": 3.75, + "d2.xlarge": 0.735, + "d2.2xlarge": 1.47, + "d2.4xlarge": 2.94, + "d2.8xlarge": 5.88, + "f1.2xlarge": 1.815, + "f1.16xlarge": 14.52, + "g2.2xlarge": 0.702, + "g2.8xlarge": 2.808, + "g3.4xlarge": 1.21, + "g3.8xlarge": 2.42, + "g3.16xlarge": 4.84, + "h1.2xlarge": 0.519, + "h1.4xlarge": 1.038, + "h1.8xlarge": 2.076, + "h1.16xlarge": 4.152, + "hs1.8xlarge": 4.9, + "i2.xlarge": 0.938, + "i2.2xlarge": 1.876, + "i2.4xlarge": 3.751, + "i2.8xlarge": 7.502, + "i3.large": 0.172, + "i3.xlarge": 0.344, + "i3.metal": 5.504, + "i3.2xlarge": 0.688, + "i3.4xlarge": 1.376, + "i3.8xlarge": 2.752, + "i3.16xlarge": 5.504, + "m1.small": 0.047, + "m1.medium": 0.095, + "m1.large": 0.19, + "m1.xlarge": 0.379, + "m2.xlarge": 0.275, + "m2.2xlarge": 0.55, + "m2.4xlarge": 1.1, + "m3.medium": 0.073, + "m3.large": 0.146, + "m3.xlarge": 0.293, + "m3.2xlarge": 0.585, + "m4.large": 0.111, + "m4.xlarge": 0.222, + "m4.2xlarge": 0.444, + "m4.4xlarge": 0.888, + "m4.10xlarge": 2.22, + "m4.16xlarge": 3.552, + "m5.large": 0.107, + "m5.xlarge": 0.214, + "m5.2xlarge": 0.428, + "m5.4xlarge": 0.856, + "m5.12xlarge": 2.568, + "m5.24xlarge": 5.136, + "m5d.large": 0.126, + "m5d.xlarge": 0.252, + "m5d.2xlarge": 0.504, + "m5d.4xlarge": 1.008, + "m5d.12xlarge": 3.024, + "m5d.24xlarge": 6.048, + "p2.xlarge": 0.972, + "p2.8xlarge": 7.776, + "p2.16xlarge": 15.552, + "p3.2xlarge": 3.305, + "p3.8xlarge": 13.22, + "p3.16xlarge": 26.44, + "r3.large": 0.185, + "r3.xlarge": 0.371, + "r3.2xlarge": 0.741, + "r3.4xlarge": 1.482, + "r3.8xlarge": 2.964, + "r4.large": 0.148, + "r4.xlarge": 0.296, + "r4.2xlarge": 0.593, + "r4.4xlarge": 1.186, + "r4.8xlarge": 2.371, + "r4.16xlarge": 4.742, + "t1.micro": 0.02, + "t2.micro": 0.0126, + "t2.small": 0.025, + "t2.medium": 0.05, + "t2.large": 0.1008, + "t2.xlarge": 0.2016, + "t2.nano": 0.0063, + "t2.2xlarge": 0.4032, + "x1.16xlarge": 8.003, + "x1.32xlarge": 16.006, + "x1e.xlarge": 1.0, + "x1e.2xlarge": 2.0, + "x1e.4xlarge": 4.0, + "x1e.8xlarge": 8.0, + "x1e.16xlarge": 16.0, + "x1e.32xlarge": 32.0 + }, + "ec2_eu_west_2": { + "c4.large": 0.119, + "c4.xlarge": 0.237, + "c4.2xlarge": 0.476, + "c4.4xlarge": 0.95, + "c4.8xlarge": 1.902, + "d2.xlarge": 0.772, + "d2.2xlarge": 1.544, + "d2.4xlarge": 3.087, + "d2.8xlarge": 6.174, + "i3.large": 0.181, + "i3.xlarge": 0.362, + "i3.2xlarge": 0.724, + "i3.4xlarge": 1.448, + "i3.8xlarge": 2.896, + "i3.16xlarge": 5.792, + "m4.large": 0.125, + "m4.xlarge": 0.25, + "m4.2xlarge": 0.499, + "m4.4xlarge": 0.998, + "m4.10xlarge": 2.496, + "m4.16xlarge": 3.993, + "r4.large": 0.156, + "r4.xlarge": 0.312, + "r4.2xlarge": 0.624, + "r4.4xlarge": 1.248, + "r4.8xlarge": 2.496, + "r4.16xlarge": 4.992, + "t2.micro": 0.014, + "t2.small": 0.026, + "t2.medium": 0.052, + "t2.large": 0.106, + "t2.xlarge": 0.212, + "t2.nano": 0.0066, + "t2.2xlarge": 0.424, + "x1.16xlarge": 8.403, + "x1.32xlarge": 16.806 + }, + "ec2_eu_west_3": { + "c5.large": 0.101, + "c5.xlarge": 0.202, + "c5.2xlarge": 0.404, + "c5.4xlarge": 0.808, + "c5.9xlarge": 1.818, + "c5.18xlarge": 3.636, + "d2.xlarge": 0.772, + "d2.2xlarge": 1.544, + "d2.4xlarge": 3.088, + "d2.8xlarge": 6.176, + "i3.large": 0.181, + "i3.xlarge": 0.362, + "i3.2xlarge": 0.724, + "i3.4xlarge": 1.448, + "i3.8xlarge": 2.896, + "i3.16xlarge": 5.792, + "m5.large": 0.112, + "m5.xlarge": 0.224, + "m5.2xlarge": 0.448, + "m5.4xlarge": 0.896, + "m5.12xlarge": 2.688, + "m5.24xlarge": 5.376, + "r4.large": 0.156, + "r4.xlarge": 0.312, + "r4.2xlarge": 0.624, + "r4.4xlarge": 1.248, + "r4.8xlarge": 2.496, + "r4.16xlarge": 4.992, + "t2.micro": 0.0132, + "t2.small": 0.0264, + "t2.medium": 0.0528, + "t2.large": 0.1056, + "t2.xlarge": 0.2112, + "t2.nano": 0.0066, + "t2.2xlarge": 0.4224, + "x1.16xlarge": 8.403, + "x1.32xlarge": 16.806 + }, + "ec2_eu_west_london": { + "c4.large": 0.119, + "c4.xlarge": 0.237, + "c4.2xlarge": 0.476, + "c4.4xlarge": 0.95, + "c4.8xlarge": 1.902, + "c5.large": 0.101, + "c5.xlarge": 0.202, + "c5.2xlarge": 0.404, + "c5.4xlarge": 0.808, + "c5.9xlarge": 1.818, + "c5.18xlarge": 3.636, + "d2.xlarge": 0.772, + "d2.2xlarge": 1.544, + "d2.4xlarge": 3.087, + "d2.8xlarge": 6.174, + "i3.large": 0.181, + "i3.xlarge": 0.362, + "i3.metal": 5.792, + "i3.2xlarge": 0.724, + "i3.4xlarge": 1.448, + "i3.8xlarge": 2.896, + "i3.16xlarge": 5.792, + "m4.large": 0.116, + "m4.xlarge": 0.232, + "m4.2xlarge": 0.464, + "m4.4xlarge": 0.928, + "m4.10xlarge": 2.32, + "m4.16xlarge": 3.712, + "m5.large": 0.111, + "m5.xlarge": 0.222, + "m5.2xlarge": 0.444, + "m5.4xlarge": 0.888, + "m5.12xlarge": 2.664, + "m5.24xlarge": 5.328, + "r4.large": 0.156, + "r4.xlarge": 0.312, + "r4.2xlarge": 0.624, + "r4.4xlarge": 1.248, + "r4.8xlarge": 2.496, + "r4.16xlarge": 4.992, + "t2.micro": 0.0132, + "t2.small": 0.026, + "t2.medium": 0.052, + "t2.large": 0.1056, + "t2.xlarge": 0.2112, + "t2.nano": 0.0066, + "t2.2xlarge": 0.4224, + "x1.16xlarge": 8.403, + "x1.32xlarge": 16.806 + }, + "ec2_linux": { + "a1.medium": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.0255, + "ap-southeast-1": 0.0294, + "ap-southeast-2": 0.0333, + "eu-central-1": 0.0291, + "eu-west-1": 0.0307, + "us-east-1": 0.027, + "us-east-2": 0.0255, + "us-west-2": 0.0 + }, + "a1.large": { + "ap-northeast-1": 0.0686, + "ap-south-1": 0.0542, + "ap-southeast-1": 0.0588, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0582, + "eu-west-1": 0.0614, + "us-east-1": 0.051, + "us-east-2": 0.051, + "us-west-2": 0.051 + }, + "a1.xlarge": { + "ap-northeast-1": 0.1284, + "ap-south-1": 0.102, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1332, + "eu-central-1": 0.0, + "eu-west-1": 0.1227, + "us-east-1": 0.102, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "a1.metal": { + "ap-northeast-1": 0.514, + "ap-south-1": 0.408, + "ap-southeast-1": 0.47, + "ap-southeast-2": 0.0, + "eu-central-1": 0.466, + "eu-west-1": 0.0, + "us-east-1": 0.408, + "us-east-2": 0.0, + "us-west-2": 0.408 + }, + "a1.2xlarge": { + "ap-northeast-1": 0.2568, + "ap-south-1": 0.217, + "ap-southeast-1": 0.2501, + "ap-southeast-2": 0.2664, + "eu-central-1": 0.0, + "eu-west-1": 0.2304, + "us-east-1": 0.204, + "us-east-2": 0.0, + "us-west-2": 0.2162 + }, + "a1.4xlarge": { + "ap-northeast-1": 0.5136, + "ap-south-1": 0.408, + "ap-southeast-1": 0.4704, + "ap-southeast-2": 0.5328, + "eu-central-1": 0.0, + "eu-west-1": 0.4608, + "us-east-1": 0.408, + "us-east-2": 0.408, + "us-west-2": 0.408 + }, + "c1.medium": { + "ap-northeast-1": 0.158, + "ap-southeast-1": 0.164, + "ap-southeast-2": 0.164, + "eu-west-1": 0.148, + "sa-east-1": 0.179, + "us-east-1": 0.13, + "us-gov-west-1": 0.157, + "us-west-1": 0.148, + "us-west-2": 0.13 + }, + "c1.xlarge": { + "ap-northeast-1": 0.632, + "ap-southeast-1": 0.655, + "ap-southeast-2": 0.655, + "eu-west-1": 0.592, + "sa-east-1": 0.718, + "us-east-1": 0.52, + "us-gov-west-1": 0.628, + "us-west-1": 0.592, + "us-west-2": 0.52 + }, + "c3": { + "ap-northeast-1": 2.247, + "sa-east-1": 2.86 + }, + "c3.large": { + "ap-northeast-1": 0.128, + "ap-northeast-2": 0.115, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.145, + "eu-central-1": 0.0, + "eu-west-1": 0.132, + "sa-east-1": 0.163, + "us-east-1": 0.105, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.105 + }, + "c3.xlarge": { + "ap-northeast-1": 0.255, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.265, + "eu-central-1": 0.258, + "eu-west-1": 0.263, + "sa-east-1": 0.358, + "us-east-1": 0.21, + "us-gov-west-1": 0.252, + "us-west-1": 0.239, + "us-west-2": 0.21 + }, + "c3.2xlarge": { + "ap-northeast-1": 0.511, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.529, + "ap-southeast-2": 0.582, + "eu-central-1": 0.516, + "eu-west-1": 0.526, + "sa-east-1": 0.65, + "us-east-1": 0.42, + "us-gov-west-1": 0.504, + "us-west-1": 0.478, + "us-west-2": 0.42 + }, + "c3.4xlarge": { + "ap-northeast-1": 1.021, + "ap-northeast-2": 0.919, + "ap-southeast-1": 1.058, + "ap-southeast-2": 1.058, + "eu-central-1": 1.032, + "eu-west-1": 0.956, + "sa-east-1": 1.3, + "us-east-1": 0.84, + "us-gov-west-1": 1.008, + "us-west-1": 0.956, + "us-west-2": 0.0 + }, + "c3.8xlarge": { + "ap-northeast-1": 2.043, + "ap-northeast-2": 0.0, + "ap-southeast-1": 2.117, + "ap-southeast-2": 2.117, + "eu-central-1": 0.0, + "eu-west-1": 1.912, + "sa-east-1": 2.6, + "us-east-1": 1.68, + "us-gov-west-1": 2.016, + "us-west-1": 0.0, + "us-west-2": 1.68 + }, + "c4": { + "ap-northeast-3": 2.218, + "ap-south-1": 1.76, + "ap-southeast-1": 2.033, + "eu-central-1": 1.999, + "eu-west-2": 2.092, + "us-east-1": 1.75 + }, + "c4.large": { + "ap-northeast-1": 0.126, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.11, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.13, + "ca-central-1": 0.121, + "eu-central-1": 0.0, + "eu-west-1": 0.113, + "eu-west-2": 0.119, + "sa-east-1": 0.0, + "us-east-1": 0.1, + "us-east-2": 0.11, + "us-gov-west-1": 0.12, + "us-west-1": 0.124, + "us-west-2": 0.1 + }, + "c4.xlarge": { + "ap-northeast-1": 0.252, + "ap-northeast-2": 0.227, + "ap-northeast-3": 0.252, + "ap-south-1": 0.0, + "ap-southeast-1": 0.231, + "ap-southeast-2": 0.261, + "ca-central-1": 0.218, + "eu-central-1": 0.0, + "eu-west-1": 0.249, + "eu-west-2": 0.237, + "sa-east-1": 0.0, + "us-east-1": 0.199, + "us-east-2": 0.199, + "us-gov-west-1": 0.263, + "us-west-1": 0.249, + "us-west-2": 0.0 + }, + "c4.2xlarge": { + "ap-northeast-1": 0.504, + "ap-northeast-2": 0.454, + "ap-northeast-3": 0.504, + "ap-south-1": 0.44, + "ap-southeast-1": 0.508, + "ap-southeast-2": 0.522, + "ca-central-1": 0.438, + "eu-central-1": 0.454, + "eu-west-1": 0.453, + "eu-west-2": 0.476, + "sa-east-1": 0.618, + "us-east-1": 0.398, + "us-east-2": 0.398, + "us-gov-west-1": 0.479, + "us-west-1": 0.498, + "us-west-2": 0.0 + }, + "c4.4xlarge": { + "ap-northeast-1": 1.008, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.109, + "ap-south-1": 0.0, + "ap-southeast-1": 0.924, + "ap-southeast-2": 1.146, + "ca-central-1": 0.0, + "eu-central-1": 0.909, + "eu-west-1": 0.996, + "eu-west-2": 0.95, + "sa-east-1": 0.0, + "us-east-1": 0.796, + "us-east-2": 0.796, + "us-gov-west-1": 0.958, + "us-west-1": 0.997, + "us-west-2": 0.796 + }, + "c4.8xlarge": { + "ap-northeast-1": 2.016, + "ap-northeast-2": 0.0, + "ap-northeast-3": 2.016, + "ap-south-1": 1.6, + "ap-southeast-1": 1.848, + "ap-southeast-2": 2.085, + "ca-central-1": 1.75, + "eu-central-1": 1.817, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "sa-east-1": 2.47, + "us-east-1": 0.0, + "us-east-2": 1.591, + "us-gov-west-1": 1.915, + "us-west-1": 1.993, + "us-west-2": 1.591 + }, + "c5": { + "ap-northeast-3": 4.237 + }, + "c5.large": { + "af-south-1": 0.121, + "ap-east-1": 0.108, + "ap-northeast-1": 0.107, + "ap-northeast-2": 0.096, + "ap-northeast-3": 0.113, + "ap-south-1": 0.085, + "ap-south-2": 0.085, + "ap-southeast-1": 0.098, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.098, + "ap-southeast-4": 0.111, + "ca-central-1": 0.093, + "ca-west-1": 0.093, + "eu-central-1": 0.097, + "eu-central-2": 0.113, + "eu-north-1": 0.091, + "eu-south-1": 0.0, + "eu-south-2": 0.096, + "eu-west-1": 0.096, + "eu-west-2": 0.101, + "eu-west-3": 0.0, + "il-central-1": 0.101, + "me-central-1": 0.106, + "me-south-1": 0.106, + "sa-east-1": 0.14, + "us-east-1": 0.085, + "us-east-2": 0.0, + "us-gov-east-1": 0.102, + "us-gov-west-1": 0.102, + "us-west-1": 0.106, + "us-west-2": 0.085, + "us-west-2-lax-1": 0.108 + }, + "c5.xlarge": { + "af-south-1": 0.228, + "ap-east-1": 0.216, + "ap-northeast-1": 0.214, + "ap-northeast-2": 0.192, + "ap-northeast-3": 0.214, + "ap-south-1": 0.181, + "ap-south-2": 0.17, + "ap-southeast-1": 0.196, + "ap-southeast-2": 0.222, + "ap-southeast-3": 0.196, + "ap-southeast-4": 0.235, + "ca-central-1": 0.198, + "ca-west-1": 0.197, + "eu-central-1": 0.194, + "eu-central-2": 0.226, + "eu-north-1": 0.182, + "eu-south-1": 0.214, + "eu-south-2": 0.192, + "eu-west-1": 0.192, + "eu-west-2": 0.202, + "eu-west-3": 0.202, + "il-central-1": 0.202, + "me-central-1": 0.211, + "me-south-1": 0.211, + "sa-east-1": 0.0, + "us-east-1": 0.17, + "us-east-2": 0.17, + "us-gov-east-1": 0.204, + "us-gov-west-1": 0.216, + "us-west-1": 0.212, + "us-west-2": 0.18, + "us-west-2-lax-1": 0.0 + }, + "c5.metal": { + "af-south-1": 5.472, + "ap-east-1": 5.184, + "ap-northeast-1": 5.136, + "ap-northeast-2": 4.608, + "ap-northeast-3": 5.136, + "ap-south-1": 4.08, + "ap-south-2": 4.08, + "ap-southeast-1": 4.704, + "ap-southeast-2": 5.328, + "ap-southeast-3": 4.704, + "ap-southeast-4": 5.328, + "ca-central-1": 0.0, + "ca-west-1": 4.464, + "eu-central-1": 4.656, + "eu-central-2": 5.122, + "eu-north-1": 4.368, + "eu-south-1": 4.848, + "eu-south-2": 4.608, + "eu-west-1": 4.608, + "eu-west-2": 4.848, + "eu-west-3": 4.848, + "il-central-1": 4.838, + "me-central-1": 5.069, + "me-south-1": 5.069, + "sa-east-1": 6.288, + "us-east-1": 4.08, + "us-east-2": 4.08, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.896, + "us-west-1": 0.0, + "us-west-2": 4.08, + "us-west-2-lax-1": 4.896 + }, + "c5.2xlarge": { + "af-south-1": 0.483, + "ap-east-1": 0.0, + "ap-northeast-1": 0.428, + "ap-northeast-2": 0.409, + "ap-northeast-3": 0.0, + "ap-south-1": 0.34, + "ap-south-2": 0.34, + "ap-southeast-1": 0.392, + "ap-southeast-2": 0.444, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.444, + "ca-central-1": 0.372, + "ca-west-1": 0.372, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.364, + "eu-south-1": 0.0, + "eu-south-2": 0.384, + "eu-west-1": 0.409, + "eu-west-2": 0.404, + "eu-west-3": 0.404, + "il-central-1": 0.403, + "me-central-1": 0.422, + "me-south-1": 0.422, + "sa-east-1": 0.56, + "us-east-1": 0.34, + "us-east-2": 0.361, + "us-gov-east-1": 0.408, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.34, + "us-west-2-lax-1": 0.408 + }, + "c5.4xlarge": { + "af-south-1": 0.967, + "ap-east-1": 0.864, + "ap-northeast-1": 0.915, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.907, + "ap-south-1": 0.68, + "ap-south-2": 0.68, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.888, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.888, + "ca-central-1": 0.744, + "ca-west-1": 0.0, + "eu-central-1": 0.776, + "eu-central-2": 0.854, + "eu-north-1": 0.0, + "eu-south-1": 0.808, + "eu-south-2": 0.0, + "eu-west-1": 0.818, + "eu-west-2": 0.808, + "eu-west-3": 0.0, + "il-central-1": 0.806, + "me-central-1": 0.845, + "me-south-1": 0.0, + "sa-east-1": 1.048, + "us-east-1": 0.721, + "us-east-2": 0.721, + "us-gov-east-1": 0.865, + "us-gov-west-1": 0.816, + "us-west-1": 0.848, + "us-west-2": 0.68, + "us-west-2-lax-1": 0.816 + }, + "c5.9xlarge": { + "af-south-1": 2.052, + "ap-east-1": 1.944, + "ap-northeast-1": 1.926, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.926, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 1.764, + "ap-southeast-2": 1.998, + "ap-southeast-3": 1.764, + "ap-southeast-4": 0.0, + "ca-central-1": 1.781, + "ca-west-1": 1.774, + "eu-central-1": 1.746, + "eu-central-2": 1.921, + "eu-north-1": 0.0, + "eu-south-1": 1.818, + "eu-south-2": 1.728, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 1.818, + "il-central-1": 1.923, + "me-central-1": 1.901, + "me-south-1": 0.0, + "sa-east-1": 2.358, + "us-east-1": 0.0, + "us-east-2": 1.53, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.836, + "us-west-1": 1.908, + "us-west-2": 0.0, + "us-west-2-lax-1": 1.836 + }, + "c5.12xlarge": { + "af-south-1": 2.736, + "ap-east-1": 2.592, + "ap-northeast-1": 2.568, + "ap-northeast-2": 2.304, + "ap-northeast-3": 0.0, + "ap-south-1": 2.04, + "ap-south-2": 2.162, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.826, + "ap-southeast-3": 2.352, + "ap-southeast-4": 0.0, + "ca-central-1": 2.232, + "ca-west-1": 2.232, + "eu-central-1": 2.328, + "eu-central-2": 2.561, + "eu-north-1": 2.184, + "eu-south-1": 2.424, + "eu-south-2": 2.304, + "eu-west-1": 0.0, + "eu-west-2": 2.424, + "eu-west-3": 2.424, + "il-central-1": 0.0, + "me-central-1": 2.534, + "me-south-1": 0.0, + "sa-east-1": 3.144, + "us-east-1": 2.04, + "us-east-2": 2.04, + "us-gov-east-1": 2.448, + "us-gov-west-1": 2.448, + "us-west-1": 2.544, + "us-west-2": 2.04, + "us-west-2-lax-1": 2.596 + }, + "c5.18xlarge": { + "af-south-1": 4.104, + "ap-east-1": 3.888, + "ap-northeast-1": 3.852, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.852, + "ap-south-1": 3.06, + "ap-south-2": 3.06, + "ap-southeast-1": 3.528, + "ap-southeast-2": 3.996, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 3.348, + "ca-west-1": 0.0, + "eu-central-1": 3.492, + "eu-central-2": 3.841, + "eu-north-1": 0.0, + "eu-south-1": 3.636, + "eu-south-2": 3.456, + "eu-west-1": 0.0, + "eu-west-2": 3.636, + "eu-west-3": 3.636, + "il-central-1": 3.629, + "me-central-1": 3.802, + "me-south-1": 0.0, + "sa-east-1": 4.716, + "us-east-1": 3.06, + "us-east-2": 3.06, + "us-gov-east-1": 3.672, + "us-gov-west-1": 3.672, + "us-west-1": 0.0, + "us-west-2": 3.06, + "us-west-2-lax-1": 3.672 + }, + "c5.24xlarge": { + "af-south-1": 5.8, + "ap-east-1": 5.184, + "ap-northeast-1": 5.136, + "ap-northeast-2": 4.906, + "ap-northeast-3": 5.136, + "ap-south-1": 4.08, + "ap-south-2": 4.08, + "ap-southeast-1": 4.704, + "ap-southeast-2": 5.328, + "ap-southeast-3": 4.704, + "ap-southeast-4": 5.328, + "ca-central-1": 4.464, + "ca-west-1": 4.464, + "eu-central-1": 4.656, + "eu-central-2": 5.122, + "eu-north-1": 0.0, + "eu-south-1": 4.848, + "eu-south-2": 4.608, + "eu-west-1": 4.91, + "eu-west-2": 5.166, + "eu-west-3": 4.848, + "il-central-1": 4.838, + "me-central-1": 5.069, + "me-south-1": 5.069, + "sa-east-1": 6.288, + "us-east-1": 4.08, + "us-east-2": 4.325, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.896, + "us-west-1": 5.088, + "us-west-2": 4.325, + "us-west-2-lax-1": 5.192 + }, + "c5a.large": { + "af-south-1": 0.103, + "ap-east-1": 0.097, + "ap-northeast-1": 0.096, + "ap-northeast-2": 0.086, + "ap-south-1": 0.047, + "ap-southeast-1": 0.088, + "ap-southeast-2": 0.1, + "ca-central-1": 0.084, + "eu-central-1": 0.087, + "eu-north-1": 0.082, + "eu-south-1": 0.091, + "eu-west-1": 0.086, + "eu-west-2": 0.091, + "eu-west-3": 0.091, + "me-south-1": 0.095, + "sa-east-1": 0.118, + "us-east-1": 0.077, + "us-east-2": 0.077, + "us-gov-east-1": 0.092, + "us-gov-west-1": 0.092, + "us-west-1": 0.095, + "us-west-2": 0.077 + }, + "c5a.xlarge": { + "af-south-1": 0.206, + "ap-east-1": 0.194, + "ap-northeast-1": 0.192, + "ap-northeast-2": 0.172, + "ap-south-1": 0.094, + "ap-southeast-1": 0.176, + "ap-southeast-2": 0.2, + "ca-central-1": 0.168, + "eu-central-1": 0.174, + "eu-north-1": 0.164, + "eu-south-1": 0.182, + "eu-west-1": 0.172, + "eu-west-2": 0.182, + "eu-west-3": 0.182, + "me-south-1": 0.19, + "sa-east-1": 0.236, + "us-east-1": 0.154, + "us-east-2": 0.154, + "us-gov-east-1": 0.184, + "us-gov-west-1": 0.184, + "us-west-1": 0.19, + "us-west-2": 0.154 + }, + "c5a.2xlarge": { + "af-south-1": 0.412, + "ap-east-1": 0.388, + "ap-northeast-1": 0.384, + "ap-northeast-2": 0.344, + "ap-south-1": 0.188, + "ap-southeast-1": 0.352, + "ap-southeast-2": 0.4, + "ca-central-1": 0.336, + "eu-central-1": 0.348, + "eu-north-1": 0.328, + "eu-south-1": 0.364, + "eu-west-1": 0.344, + "eu-west-2": 0.364, + "eu-west-3": 0.364, + "me-south-1": 0.38, + "sa-east-1": 0.472, + "us-east-1": 0.308, + "us-east-2": 0.308, + "us-gov-east-1": 0.368, + "us-gov-west-1": 0.368, + "us-west-1": 0.38, + "us-west-2": 0.308 + }, + "c5a.4xlarge": { + "af-south-1": 0.824, + "ap-east-1": 0.776, + "ap-northeast-1": 0.768, + "ap-northeast-2": 0.688, + "ap-south-1": 0.376, + "ap-southeast-1": 0.704, + "ap-southeast-2": 0.8, + "ca-central-1": 0.672, + "eu-central-1": 0.696, + "eu-north-1": 0.656, + "eu-south-1": 0.728, + "eu-west-1": 0.688, + "eu-west-2": 0.728, + "eu-west-3": 0.728, + "me-south-1": 0.76, + "sa-east-1": 0.944, + "us-east-1": 0.616, + "us-east-2": 0.616, + "us-gov-east-1": 0.736, + "us-gov-west-1": 0.736, + "us-west-1": 0.76, + "us-west-2": 0.616 + }, + "c5a.8xlarge": { + "af-south-1": 1.648, + "ap-east-1": 1.552, + "ap-northeast-1": 1.536, + "ap-northeast-2": 1.376, + "ap-south-1": 0.752, + "ap-southeast-1": 1.408, + "ap-southeast-2": 1.6, + "ca-central-1": 1.344, + "eu-central-1": 1.392, + "eu-north-1": 1.312, + "eu-south-1": 1.456, + "eu-west-1": 1.376, + "eu-west-2": 1.456, + "eu-west-3": 1.456, + "me-south-1": 1.52, + "sa-east-1": 1.888, + "us-east-1": 1.232, + "us-east-2": 1.232, + "us-gov-east-1": 1.472, + "us-gov-west-1": 1.472, + "us-west-1": 1.52, + "us-west-2": 1.232 + }, + "c5a.12xlarge": { + "af-south-1": 2.472, + "ap-east-1": 2.328, + "ap-northeast-1": 2.304, + "ap-northeast-2": 2.064, + "ap-south-1": 1.128, + "ap-southeast-1": 2.112, + "ap-southeast-2": 2.4, + "ca-central-1": 2.016, + "eu-central-1": 2.088, + "eu-north-1": 1.968, + "eu-south-1": 2.184, + "eu-west-1": 2.064, + "eu-west-2": 2.184, + "eu-west-3": 2.184, + "me-south-1": 2.28, + "sa-east-1": 2.832, + "us-east-1": 1.848, + "us-east-2": 1.848, + "us-gov-east-1": 2.208, + "us-gov-west-1": 2.208, + "us-west-1": 2.28, + "us-west-2": 1.848 + }, + "c5a.16xlarge": { + "af-south-1": 3.296, + "ap-east-1": 3.104, + "ap-northeast-1": 3.072, + "ap-northeast-2": 2.752, + "ap-south-1": 1.504, + "ap-southeast-1": 2.816, + "ap-southeast-2": 3.2, + "ca-central-1": 2.688, + "eu-central-1": 2.784, + "eu-north-1": 2.624, + "eu-south-1": 2.912, + "eu-west-1": 2.752, + "eu-west-2": 2.912, + "eu-west-3": 2.912, + "me-south-1": 3.04, + "sa-east-1": 3.776, + "us-east-1": 2.464, + "us-east-2": 2.464, + "us-gov-east-1": 2.944, + "us-gov-west-1": 2.944, + "us-west-1": 3.04, + "us-west-2": 2.464 + }, + "c5a.24xlarge": { + "af-south-1": 4.944, + "ap-east-1": 4.656, + "ap-northeast-1": 4.608, + "ap-northeast-2": 4.128, + "ap-south-1": 2.256, + "ap-southeast-1": 4.224, + "ap-southeast-2": 4.8, + "ca-central-1": 4.032, + "eu-central-1": 4.176, + "eu-north-1": 3.936, + "eu-south-1": 4.368, + "eu-west-1": 4.128, + "eu-west-2": 4.368, + "eu-west-3": 4.368, + "me-south-1": 4.56, + "sa-east-1": 5.664, + "us-east-1": 3.696, + "us-east-2": 3.696, + "us-gov-east-1": 4.416, + "us-gov-west-1": 4.416, + "us-west-1": 4.56, + "us-west-2": 3.696 + }, + "c5ad.large": { + "af-south-1": 0.117, + "ap-southeast-1": 0.101, + "ap-southeast-2": 0.113, + "eu-central-1": 0.1, + "eu-south-1": 0.103, + "eu-west-1": 0.098, + "me-south-1": 0.108, + "sa-east-1": 0.134, + "us-east-1": 0.086, + "us-east-2": 0.086, + "us-west-2": 0.086 + }, + "c5ad.xlarge": { + "af-south-1": 0.234, + "ap-southeast-1": 0.202, + "ap-southeast-2": 0.226, + "eu-central-1": 0.2, + "eu-south-1": 0.206, + "eu-west-1": 0.196, + "me-south-1": 0.216, + "sa-east-1": 0.268, + "us-east-1": 0.172, + "us-east-2": 0.172, + "us-west-2": 0.172 + }, + "c5ad.2xlarge": { + "af-south-1": 0.468, + "ap-southeast-1": 0.404, + "ap-southeast-2": 0.452, + "eu-central-1": 0.4, + "eu-south-1": 0.412, + "eu-west-1": 0.392, + "me-south-1": 0.432, + "sa-east-1": 0.536, + "us-east-1": 0.344, + "us-east-2": 0.344, + "us-west-2": 0.344 + }, + "c5ad.4xlarge": { + "af-south-1": 0.936, + "ap-southeast-1": 0.808, + "ap-southeast-2": 0.904, + "eu-central-1": 0.8, + "eu-south-1": 0.824, + "eu-west-1": 0.784, + "me-south-1": 0.864, + "sa-east-1": 1.072, + "us-east-1": 0.688, + "us-east-2": 0.688, + "us-west-2": 0.688 + }, + "c5ad.8xlarge": { + "af-south-1": 1.872, + "ap-southeast-1": 1.616, + "ap-southeast-2": 1.808, + "eu-central-1": 1.6, + "eu-south-1": 1.648, + "eu-west-1": 1.568, + "me-south-1": 1.728, + "sa-east-1": 2.144, + "us-east-1": 1.376, + "us-east-2": 1.376, + "us-west-2": 1.376 + }, + "c5ad.12xlarge": { + "af-south-1": 2.808, + "ap-southeast-1": 2.424, + "ap-southeast-2": 2.712, + "eu-central-1": 2.4, + "eu-south-1": 2.472, + "eu-west-1": 2.352, + "me-south-1": 2.592, + "sa-east-1": 3.216, + "us-east-1": 2.064, + "us-east-2": 2.064, + "us-west-2": 2.064 + }, + "c5ad.16xlarge": { + "af-south-1": 3.744, + "ap-southeast-1": 3.232, + "ap-southeast-2": 3.616, + "eu-central-1": 3.2, + "eu-south-1": 3.296, + "eu-west-1": 3.136, + "me-south-1": 3.456, + "sa-east-1": 4.288, + "us-east-1": 2.752, + "us-east-2": 2.752, + "us-west-2": 2.752 + }, + "c5ad.24xlarge": { + "af-south-1": 5.616, + "ap-southeast-1": 4.848, + "ap-southeast-2": 5.424, + "eu-central-1": 4.8, + "eu-south-1": 4.944, + "eu-west-1": 4.704, + "me-south-1": 5.184, + "sa-east-1": 6.432, + "us-east-1": 4.128, + "us-east-2": 4.128, + "us-west-2": 4.128 + }, + "c5d": { + "ap-northeast-1": 4.831, + "us-gov-east-1": 4.594 + }, + "c5d.large": { + "af-south-1": 0.13, + "ap-east-1": 0.0, + "ap-northeast-1": 0.13, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.122, + "ap-south-1": 0.099, + "ap-south-2": 0.099, + "ap-southeast-1": 0.119, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.119, + "ap-southeast-4": 0.126, + "ca-central-1": 0.106, + "eu-central-1": 0.0, + "eu-central-2": 0.122, + "eu-north-1": 0.104, + "eu-south-1": 0.114, + "eu-south-2": 0.109, + "eu-west-1": 0.0, + "eu-west-2": 0.115, + "eu-west-3": 0.115, + "il-central-1": 0.114, + "me-central-1": 0.12, + "me-south-1": 0.128, + "sa-east-1": 0.159, + "us-east-1": 0.096, + "us-east-2": 0.0, + "us-gov-east-1": 0.123, + "us-gov-west-1": 0.0, + "us-west-1": 0.128, + "us-west-2": 0.096 + }, + "c5d.xlarge": { + "af-south-1": 0.26, + "ap-east-1": 0.246, + "ap-northeast-1": 0.244, + "ap-northeast-2": 0.22, + "ap-northeast-3": 0.244, + "ap-south-1": 0.211, + "ap-south-2": 0.198, + "ap-southeast-1": 0.224, + "ap-southeast-2": 0.267, + "ap-southeast-3": 0.224, + "ap-southeast-4": 0.252, + "ca-central-1": 0.212, + "eu-central-1": 0.0, + "eu-central-2": 0.244, + "eu-north-1": 0.208, + "eu-south-1": 0.228, + "eu-south-2": 0.0, + "eu-west-1": 0.218, + "eu-west-2": 0.0, + "eu-west-3": 0.23, + "il-central-1": 0.229, + "me-central-1": 0.0, + "me-south-1": 0.256, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.192, + "us-gov-east-1": 0.232, + "us-gov-west-1": 0.232, + "us-west-1": 0.24, + "us-west-2": 0.192 + }, + "c5d.metal": { + "af-south-1": 6.24, + "ap-northeast-1": 5.856, + "ap-northeast-2": 5.28, + "ap-northeast-3": 5.856, + "ap-south-1": 4.752, + "ap-south-2": 4.752, + "ap-southeast-1": 5.376, + "ap-southeast-2": 6.048, + "ap-southeast-3": 5.376, + "ap-southeast-4": 6.048, + "ca-central-1": 0.0, + "eu-central-1": 5.328, + "eu-central-2": 5.861, + "eu-north-1": 4.992, + "eu-south-1": 0.0, + "eu-south-2": 5.232, + "eu-west-1": 5.232, + "eu-west-2": 5.52, + "il-central-1": 5.494, + "me-central-1": 5.755, + "sa-east-1": 7.152, + "us-east-1": 4.608, + "us-east-2": 4.608, + "us-gov-west-1": 5.568, + "us-west-1": 5.76, + "us-west-2": 4.608 + }, + "c5d.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.523, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.44, + "ap-northeast-3": 0.517, + "ap-south-1": 0.396, + "ap-south-2": 0.396, + "ap-southeast-1": 0.448, + "ap-southeast-2": 0.504, + "ap-southeast-3": 0.448, + "ap-southeast-4": 0.504, + "ca-central-1": 0.424, + "eu-central-1": 0.444, + "eu-central-2": 0.488, + "eu-north-1": 0.443, + "eu-south-1": 0.456, + "eu-south-2": 0.436, + "eu-west-1": 0.436, + "eu-west-2": 0.46, + "eu-west-3": 0.46, + "il-central-1": 0.0, + "me-central-1": 0.48, + "me-south-1": 0.48, + "sa-east-1": 0.596, + "us-east-1": 0.0, + "us-east-2": 0.407, + "us-gov-east-1": 0.464, + "us-gov-west-1": 0.464, + "us-west-1": 0.48, + "us-west-2": 0.0 + }, + "c5d.4xlarge": { + "af-south-1": 1.04, + "ap-east-1": 1.047, + "ap-northeast-1": 1.042, + "ap-northeast-2": 0.936, + "ap-northeast-3": 0.0, + "ap-south-1": 0.792, + "ap-south-2": 0.84, + "ap-southeast-1": 0.896, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.896, + "ap-southeast-4": 1.008, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.977, + "eu-north-1": 0.832, + "eu-south-1": 0.912, + "eu-south-2": 0.924, + "eu-west-1": 0.872, + "eu-west-2": 0.92, + "eu-west-3": 0.92, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 0.959, + "sa-east-1": 1.273, + "us-east-1": 0.0, + "us-east-2": 0.768, + "us-gov-east-1": 0.928, + "us-gov-west-1": 0.928, + "us-west-1": 0.0, + "us-west-2": 0.768 + }, + "c5d.9xlarge": { + "af-south-1": 2.34, + "ap-east-1": 2.214, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.98, + "ap-northeast-3": 2.196, + "ap-south-1": 1.896, + "ap-south-2": 1.782, + "ap-southeast-1": 2.145, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 1.998, + "eu-central-2": 2.198, + "eu-north-1": 0.0, + "eu-south-1": 2.175, + "eu-south-2": 1.962, + "eu-west-1": 1.962, + "eu-west-2": 0.0, + "eu-west-3": 2.205, + "il-central-1": 2.06, + "me-central-1": 2.158, + "me-south-1": 0.0, + "sa-east-1": 2.682, + "us-east-1": 1.832, + "us-east-2": 1.728, + "us-gov-east-1": 2.088, + "us-gov-west-1": 2.088, + "us-west-1": 0.0, + "us-west-2": 1.728 + }, + "c5d.12xlarge": { + "af-south-1": 3.307, + "ap-northeast-1": 2.928, + "ap-northeast-2": 2.64, + "ap-northeast-3": 2.928, + "ap-south-1": 2.376, + "ap-south-2": 2.376, + "ap-southeast-1": 2.688, + "ap-southeast-2": 3.024, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 2.706, + "eu-central-1": 2.664, + "eu-central-2": 0.0, + "eu-north-1": 2.496, + "eu-south-1": 2.9, + "eu-south-2": 2.616, + "eu-west-1": 2.616, + "eu-west-2": 2.76, + "il-central-1": 2.747, + "me-central-1": 2.878, + "sa-east-1": 3.576, + "us-east-1": 2.304, + "us-east-2": 2.304, + "us-gov-west-1": 2.952, + "us-west-1": 2.88, + "us-west-2": 2.304 + }, + "c5d.18xlarge": { + "af-south-1": 4.68, + "ap-east-1": 4.428, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 4.392, + "ap-south-1": 3.564, + "ap-south-2": 3.564, + "ap-southeast-1": 4.032, + "ap-southeast-2": 4.536, + "ap-southeast-3": 4.032, + "ap-southeast-4": 4.536, + "ca-central-1": 3.816, + "eu-central-1": 3.996, + "eu-central-2": 4.396, + "eu-north-1": 3.744, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 3.924, + "eu-west-2": 0.0, + "eu-west-3": 4.14, + "il-central-1": 4.12, + "me-central-1": 4.316, + "me-south-1": 4.316, + "sa-east-1": 5.364, + "us-east-1": 3.456, + "us-east-2": 3.456, + "us-gov-east-1": 4.176, + "us-gov-west-1": 4.176, + "us-west-1": 4.32, + "us-west-2": 3.456 + }, + "c5d.24xlarge": { + "af-south-1": 6.24, + "ap-northeast-1": 5.856, + "ap-northeast-2": 5.28, + "ap-northeast-3": 5.856, + "ap-south-1": 4.752, + "ap-south-2": 4.752, + "ap-southeast-1": 5.376, + "ap-southeast-2": 0.0, + "ap-southeast-3": 5.699, + "ap-southeast-4": 6.048, + "ca-central-1": 0.0, + "eu-central-1": 5.328, + "eu-central-2": 5.861, + "eu-north-1": 4.992, + "eu-south-1": 5.472, + "eu-south-2": 5.232, + "eu-west-1": 5.232, + "eu-west-2": 5.52, + "il-central-1": 0.0, + "me-central-1": 6.101, + "sa-east-1": 7.152, + "us-east-1": 4.608, + "us-east-2": 4.608, + "us-gov-west-1": 5.568, + "us-west-1": 5.76, + "us-west-2": 4.608 + }, + "c5n.large": { + "af-south-1": 0.145, + "ap-east-1": 0.143, + "ap-northeast-1": 0.136, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.136, + "ap-south-1": 0.0, + "ap-southeast-1": 0.132, + "ap-southeast-2": 0.15, + "ap-southeast-3": 0.124, + "ca-central-1": 0.118, + "eu-central-1": 0.123, + "eu-north-1": 0.116, + "eu-south-1": 0.129, + "eu-west-1": 0.122, + "eu-west-2": 0.128, + "eu-west-3": 0.128, + "me-south-1": 0.134, + "sa-east-1": 0.166, + "us-east-1": 0.108, + "us-east-2": 0.108, + "us-gov-east-1": 0.13, + "us-gov-west-1": 0.0, + "us-west-1": 0.144, + "us-west-2": 0.0 + }, + "c5n.xlarge": { + "af-south-1": 0.29, + "ap-east-1": 0.286, + "ap-northeast-1": 0.272, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.248, + "ap-southeast-2": 0.282, + "ap-southeast-3": 0.248, + "ca-central-1": 0.236, + "eu-central-1": 0.246, + "eu-north-1": 0.232, + "eu-south-1": 0.258, + "eu-west-1": 0.244, + "eu-west-2": 0.256, + "eu-west-3": 0.256, + "me-south-1": 0.268, + "sa-east-1": 0.352, + "us-east-1": 0.216, + "us-east-2": 0.216, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.276, + "us-west-1": 0.27, + "us-west-2": 0.216 + }, + "c5n.metal": { + "af-south-1": 5.227, + "ap-east-1": 5.148, + "ap-northeast-1": 4.896, + "ap-northeast-2": 4.392, + "ap-northeast-3": 0.0, + "ap-south-1": 3.888, + "ap-southeast-1": 4.464, + "ap-southeast-2": 5.076, + "ap-southeast-3": 4.464, + "ca-central-1": 4.248, + "eu-central-1": 4.428, + "eu-north-1": 4.176, + "eu-south-1": 4.644, + "eu-west-1": 4.392, + "eu-west-2": 4.608, + "eu-west-3": 4.608, + "me-south-1": 4.824, + "sa-east-1": 5.976, + "us-east-1": 3.888, + "us-east-2": 3.888, + "us-gov-east-1": 4.68, + "us-gov-west-1": 0.0, + "us-west-1": 4.86, + "us-west-2": 3.888 + }, + "c5n.2xlarge": { + "af-south-1": 0.616, + "ap-east-1": 0.0, + "ap-northeast-1": 0.581, + "ap-northeast-2": 0.488, + "ap-northeast-3": 0.577, + "ap-south-1": 0.432, + "ap-southeast-1": 0.496, + "ap-southeast-2": 0.564, + "ap-southeast-3": 0.496, + "ca-central-1": 0.502, + "eu-central-1": 0.492, + "eu-north-1": 0.492, + "eu-south-1": 0.516, + "eu-west-1": 0.52, + "eu-west-2": 0.512, + "eu-west-3": 0.512, + "me-south-1": 0.536, + "sa-east-1": 0.704, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.551, + "us-west-1": 0.54, + "us-west-2": 0.432 + }, + "c5n.4xlarge": { + "af-south-1": 1.231, + "ap-east-1": 1.144, + "ap-northeast-1": 1.088, + "ap-northeast-2": 0.976, + "ap-northeast-3": 0.0, + "ap-south-1": 0.864, + "ap-southeast-1": 0.992, + "ap-southeast-2": 1.196, + "ap-southeast-3": 0.992, + "ca-central-1": 0.944, + "eu-central-1": 0.984, + "eu-north-1": 0.928, + "eu-south-1": 1.032, + "eu-west-1": 0.0, + "eu-west-2": 1.024, + "eu-west-3": 1.024, + "me-south-1": 1.072, + "sa-east-1": 1.328, + "us-east-1": 0.864, + "us-east-2": 0.916, + "us-gov-east-1": 1.04, + "us-gov-west-1": 1.04, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c5n.9xlarge": { + "af-south-1": 2.614, + "ap-east-1": 2.574, + "ap-northeast-1": 2.448, + "ap-northeast-2": 2.196, + "ap-northeast-3": 2.448, + "ap-south-1": 2.069, + "ap-southeast-1": 2.232, + "ap-southeast-2": 2.692, + "ap-southeast-3": 0.0, + "ca-central-1": 2.124, + "eu-central-1": 2.214, + "eu-north-1": 0.0, + "eu-south-1": 2.322, + "eu-west-1": 2.196, + "eu-west-2": 2.304, + "eu-west-3": 2.304, + "me-south-1": 2.412, + "sa-east-1": 2.988, + "us-east-1": 1.944, + "us-east-2": 2.061, + "us-gov-east-1": 2.481, + "us-gov-west-1": 2.34, + "us-west-1": 2.43, + "us-west-2": 0.0 + }, + "c5n.18xlarge": { + "af-south-1": 5.227, + "ap-east-1": 5.148, + "ap-northeast-1": 4.896, + "ap-northeast-2": 4.392, + "ap-northeast-3": 4.896, + "ap-south-1": 3.888, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.076, + "ap-southeast-3": 0.0, + "ca-central-1": 4.248, + "eu-central-1": 4.428, + "eu-north-1": 4.176, + "eu-south-1": 4.644, + "eu-west-1": 4.392, + "eu-west-2": 4.608, + "eu-west-3": 4.608, + "me-south-1": 4.824, + "sa-east-1": 5.976, + "us-east-1": 3.888, + "us-east-2": 3.888, + "us-gov-east-1": 4.68, + "us-gov-west-1": 4.68, + "us-west-1": 4.86, + "us-west-2": 3.888 + }, + "c6a": { + "ap-south-1": 4.937, + "sa-east-1": 12.45 + }, + "c6a.large": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.0963, + "ap-south-1": 0.04675, + "ap-south-2": 0.05143, + "ap-southeast-1": 0.0882, + "ap-southeast-2": 0.0999, + "ca-central-1": 0.09207, + "eu-central-1": 0.09603, + "eu-west-1": 0.08208, + "eu-west-2": 0.0909, + "sa-east-1": 0.1179, + "us-east-1": 0.0765, + "us-east-2": 0.08415, + "us-west-1": 0.0, + "us-west-2": 0.0765 + }, + "c6a.xlarge": { + "ap-east-1": 0.1944, + "ap-northeast-1": 0.1926, + "ap-south-1": 0.0935, + "ap-south-2": 0.0935, + "ap-southeast-1": 0.1764, + "ap-southeast-2": 0.1998, + "ca-central-1": 0.1674, + "eu-central-1": 0.0, + "eu-west-1": 0.16416, + "eu-west-2": 0.1818, + "sa-east-1": 0.2358, + "us-east-1": 0.153, + "us-east-2": 0.153, + "us-west-1": 0.1908, + "us-west-2": 0.153 + }, + "c6a.metal": { + "ap-east-1": 9.3312, + "ap-northeast-1": 9.2448, + "ap-south-1": 4.488, + "ap-south-2": 4.488, + "ap-southeast-1": 8.4672, + "ap-southeast-2": 0.0, + "ca-central-1": 8.0352, + "eu-central-1": 8.3808, + "eu-west-1": 7.87968, + "eu-west-2": 8.7264, + "sa-east-1": 11.3184, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6a.2xlarge": { + "ap-east-1": 0.3888, + "ap-northeast-1": 0.0, + "ap-south-1": 0.2057, + "ap-south-2": 0.2057, + "ap-southeast-1": 0.38808, + "ap-southeast-2": 0.0, + "ca-central-1": 0.3348, + "eu-central-1": 0.3492, + "eu-west-1": 0.32832, + "eu-west-2": 0.39996, + "sa-east-1": 0.0, + "us-east-1": 0.306, + "us-east-2": 0.306, + "us-west-1": 0.0, + "us-west-2": 0.306 + }, + "c6a.4xlarge": { + "ap-east-1": 0.7776, + "ap-northeast-1": 0.7704, + "ap-south-1": 0.374, + "ap-south-2": 0.374, + "ap-southeast-1": 0.7056, + "ap-southeast-2": 0.0, + "ca-central-1": 0.6696, + "eu-central-1": 0.76824, + "eu-west-1": 0.65664, + "eu-west-2": 0.7272, + "sa-east-1": 0.9432, + "us-east-1": 0.612, + "us-east-2": 0.0, + "us-west-1": 0.7632, + "us-west-2": 0.6732 + }, + "c6a.8xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-south-1": 0.748, + "ap-south-2": 0.748, + "ap-southeast-1": 1.4112, + "ap-southeast-2": 1.5984, + "ca-central-1": 1.47312, + "eu-central-1": 1.3968, + "eu-west-1": 1.31328, + "eu-west-2": 0.0, + "sa-east-1": 1.8864, + "us-east-1": 1.224, + "us-east-2": 1.224, + "us-west-1": 1.5264, + "us-west-2": 0.0 + }, + "c6a.12xlarge": { + "ap-east-1": 2.3328, + "ap-northeast-1": 2.54232, + "ap-south-1": 1.2342, + "ap-south-2": 0.0, + "ap-southeast-1": 2.32848, + "ap-southeast-2": 2.63736, + "ca-central-1": 2.0088, + "eu-central-1": 2.0952, + "eu-west-1": 1.96992, + "eu-west-2": 2.1816, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 1.836, + "us-west-1": 2.2896, + "us-west-2": 1.836 + }, + "c6a.16xlarge": { + "ap-east-1": 3.1104, + "ap-northeast-1": 0.0, + "ap-south-1": 1.496, + "ap-south-2": 1.496, + "ap-southeast-1": 3.10464, + "ap-southeast-2": 3.1968, + "ca-central-1": 2.94624, + "eu-central-1": 3.07296, + "eu-west-1": 2.62656, + "eu-west-2": 2.9088, + "sa-east-1": 3.7728, + "us-east-1": 2.6928, + "us-east-2": 2.448, + "us-west-1": 3.35808, + "us-west-2": 2.448 + }, + "c6a.24xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 4.6224, + "ap-south-1": 2.244, + "ap-south-2": 0.0, + "ap-southeast-1": 4.2336, + "ap-southeast-2": 4.7952, + "ca-central-1": 4.41936, + "eu-central-1": 4.1904, + "eu-west-1": 0.0, + "eu-west-2": 4.3632, + "sa-east-1": 6.22512, + "us-east-1": 3.672, + "us-east-2": 3.672, + "us-west-1": 4.5792, + "us-west-2": 3.672 + }, + "c6a.32xlarge": { + "ap-east-1": 6.2208, + "ap-northeast-1": 0.0, + "ap-south-1": 2.992, + "ap-south-2": 2.992, + "ap-southeast-1": 5.6448, + "ap-southeast-2": 7.03296, + "ca-central-1": 0.0, + "eu-central-1": 5.5872, + "eu-west-1": 0.0, + "eu-west-2": 6.39936, + "sa-east-1": 7.5456, + "us-east-1": 0.0, + "us-east-2": 4.896, + "us-west-1": 6.1056, + "us-west-2": 4.896 + }, + "c6a.48xlarge": { + "ap-east-1": 9.3312, + "ap-northeast-1": 0.0, + "ap-south-1": 4.488, + "ap-south-2": 4.488, + "ap-southeast-1": 8.4672, + "ap-southeast-2": 9.5904, + "ca-central-1": 8.0352, + "eu-central-1": 8.3808, + "eu-west-1": 0.0, + "eu-west-2": 8.7264, + "sa-east-1": 11.3184, + "us-east-1": 7.344, + "us-east-2": 7.344, + "us-west-1": 9.1584, + "us-west-2": 0.0 + }, + "c6g": { + "us-east-1": 2.394, + "us-gov-west-1": 2.872 + }, + "c6g.medium": { + "af-south-1": 0.0456, + "ap-east-1": 0.043, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0385, + "ap-northeast-3": 0.043, + "ap-south-1": 0.0, + "ap-south-2": 0.0226, + "ap-southeast-1": 0.0392, + "ap-southeast-2": 0.0471, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0444, + "ap-southeast-5": 0.0333, + "ap-southeast-7": 0.0333, + "ca-central-1": 0.0372, + "ca-west-1": 0.0394, + "eu-central-1": 0.0411, + "eu-central-2": 0.0427, + "eu-north-1": 0.0365, + "eu-south-1": 0.0428, + "eu-south-2": 0.0365, + "eu-west-1": 0.0365, + "eu-west-2": 0.0404, + "eu-west-3": 0.0, + "il-central-1": 0.0383, + "me-central-1": 0.0401, + "me-south-1": 0.0451, + "mx-central-1": 0.0357, + "sa-east-1": 0.0524, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0408, + "us-gov-west-1": 0.0408, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6g.large": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0856, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.086, + "ap-south-1": 0.0452, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0784, + "ap-southeast-2": 0.0888, + "ap-southeast-3": 0.0784, + "ap-southeast-4": 0.0888, + "ap-southeast-5": 0.0666, + "ap-southeast-7": 0.0666, + "ca-central-1": 0.0744, + "ca-west-1": 0.0744, + "eu-central-1": 0.0776, + "eu-central-2": 0.0854, + "eu-north-1": 0.073, + "eu-south-1": 0.0, + "eu-south-2": 0.0776, + "eu-west-1": 0.073, + "eu-west-2": 0.0856, + "eu-west-3": 0.0858, + "il-central-1": 0.0766, + "me-central-1": 0.0803, + "me-south-1": 0.085, + "mx-central-1": 0.0714, + "sa-east-1": 0.0, + "us-east-1": 0.068, + "us-east-2": 0.0, + "us-gov-east-1": 0.0816, + "us-gov-west-1": 0.0, + "us-west-1": 0.0848, + "us-west-2": 0.068 + }, + "c6g.xlarge": { + "af-south-1": 0.1824, + "ap-east-1": 0.1824, + "ap-northeast-1": 0.1712, + "ap-northeast-2": 0.154, + "ap-northeast-3": 0.172, + "ap-south-1": 0.0852, + "ap-south-2": 0.0852, + "ap-southeast-1": 0.1662, + "ap-southeast-2": 0.1776, + "ap-southeast-3": 0.1568, + "ap-southeast-4": 0.1776, + "ap-southeast-5": 0.1333, + "ap-southeast-7": 0.0, + "ca-central-1": 0.1577, + "ca-west-1": 0.1577, + "eu-central-1": 0.1552, + "eu-central-2": 0.1707, + "eu-north-1": 0.146, + "eu-south-1": 0.1616, + "eu-south-2": 0.1459, + "eu-west-1": 0.1551, + "eu-west-2": 0.0, + "eu-west-3": 0.1716, + "il-central-1": 0.1532, + "me-central-1": 0.1706, + "me-south-1": 0.17, + "mx-central-1": 0.1428, + "sa-east-1": 0.2096, + "us-east-1": 0.1442, + "us-east-2": 0.1442, + "us-gov-east-1": 0.1632, + "us-gov-west-1": 0.1632, + "us-west-1": 0.0, + "us-west-2": 0.136 + }, + "c6g.metal": { + "af-south-1": 2.9184, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.6112, + "ap-northeast-3": 2.752, + "ap-south-1": 1.3632, + "ap-south-2": 1.3632, + "ap-southeast-1": 2.5088, + "ap-southeast-2": 2.8416, + "ap-southeast-3": 0.0, + "ap-southeast-4": 2.8416, + "ap-southeast-5": 2.1325, + "ap-southeast-7": 2.1325, + "ca-central-1": 2.5236, + "ca-west-1": 2.3808, + "eu-central-1": 0.0, + "eu-central-2": 2.7315, + "eu-north-1": 2.336, + "eu-south-1": 2.5856, + "eu-south-2": 2.3347, + "eu-west-1": 2.4819, + "eu-west-2": 2.5856, + "eu-west-3": 2.592, + "il-central-1": 0.0, + "me-central-1": 2.5683, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 3.5548, + "us-east-1": 0.0, + "us-east-2": 2.176, + "us-gov-east-1": 2.6112, + "us-gov-west-1": 2.7679, + "us-west-1": 2.7136, + "us-west-2": 2.176 + }, + "c6g.2xlarge": { + "af-south-1": 0.3648, + "ap-east-1": 0.0, + "ap-northeast-1": 0.3629, + "ap-northeast-2": 0.308, + "ap-northeast-3": 0.344, + "ap-south-1": 0.1704, + "ap-south-2": 0.1704, + "ap-southeast-1": 0.3136, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.3136, + "ap-southeast-4": 0.3552, + "ap-southeast-5": 0.2666, + "ap-southeast-7": 0.2666, + "ca-central-1": 0.2976, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.3414, + "eu-north-1": 0.0, + "eu-south-1": 0.3232, + "eu-south-2": 0.3102, + "eu-west-1": 0.2918, + "eu-west-2": 0.3232, + "eu-west-3": 0.3432, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 0.34, + "mx-central-1": 0.0, + "sa-east-1": 0.4192, + "us-east-1": 0.0, + "us-east-2": 0.272, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.3264, + "us-west-1": 0.0, + "us-west-2": 0.272 + }, + "c6g.4xlarge": { + "af-south-1": 0.7296, + "ap-east-1": 0.7296, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.688, + "ap-south-1": 0.0, + "ap-south-2": 0.3408, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.7104, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.753, + "ap-southeast-5": 0.5331, + "ap-southeast-7": 0.5331, + "ca-central-1": 0.5952, + "ca-west-1": 0.5952, + "eu-central-1": 0.6208, + "eu-central-2": 0.6829, + "eu-north-1": 0.584, + "eu-south-1": 0.6464, + "eu-south-2": 0.6205, + "eu-west-1": 0.0, + "eu-west-2": 0.6464, + "eu-west-3": 0.0, + "il-central-1": 0.6128, + "me-central-1": 0.6421, + "me-south-1": 0.68, + "mx-central-1": 0.5712, + "sa-east-1": 0.8384, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.692, + "us-gov-west-1": 0.692, + "us-west-1": 0.6784, + "us-west-2": 0.544 + }, + "c6g.8xlarge": { + "af-south-1": 1.4592, + "ap-east-1": 1.376, + "ap-northeast-1": 1.4518, + "ap-northeast-2": 1.3056, + "ap-northeast-3": 1.376, + "ap-south-1": 0.7225, + "ap-south-2": 0.6816, + "ap-southeast-1": 1.2544, + "ap-southeast-2": 1.4208, + "ap-southeast-3": 1.3297, + "ap-southeast-4": 1.4208, + "ap-southeast-5": 1.1302, + "ap-southeast-7": 1.1302, + "ca-central-1": 1.1904, + "ca-west-1": 1.1904, + "eu-central-1": 1.3161, + "eu-central-2": 1.3658, + "eu-north-1": 1.168, + "eu-south-1": 1.2928, + "eu-south-2": 1.1674, + "eu-west-1": 1.1674, + "eu-west-2": 1.2928, + "eu-west-3": 0.0, + "il-central-1": 1.2256, + "me-central-1": 0.0, + "me-south-1": 1.36, + "mx-central-1": 1.1424, + "sa-east-1": 0.0, + "us-east-1": 1.1533, + "us-east-2": 1.088, + "us-gov-east-1": 1.3056, + "us-gov-west-1": 1.3056, + "us-west-1": 1.4382, + "us-west-2": 1.088 + }, + "c6g.12xlarge": { + "af-south-1": 2.3201, + "ap-east-1": 2.064, + "ap-northeast-1": 2.0544, + "ap-northeast-2": 1.9584, + "ap-northeast-3": 2.064, + "ap-south-1": 1.0224, + "ap-south-2": 1.0837, + "ap-southeast-1": 1.8816, + "ap-southeast-2": 2.1312, + "ap-southeast-3": 0.0, + "ap-southeast-4": 2.2591, + "ap-southeast-5": 1.5994, + "ap-southeast-7": 0.0, + "ca-central-1": 1.8927, + "ca-west-1": 1.8927, + "eu-central-1": 1.9741, + "eu-central-2": 2.0486, + "eu-north-1": 1.752, + "eu-south-1": 0.0, + "eu-south-2": 1.751, + "eu-west-1": 0.0, + "eu-west-2": 1.9392, + "eu-west-3": 0.0, + "il-central-1": 1.9543, + "me-central-1": 1.9262, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 2.6661, + "us-east-1": 0.0, + "us-east-2": 1.632, + "us-gov-east-1": 2.0759, + "us-gov-west-1": 1.9584, + "us-west-1": 2.1573, + "us-west-2": 1.7299 + }, + "c6g.16xlarge": { + "af-south-1": 2.9184, + "ap-east-1": 2.752, + "ap-northeast-1": 2.7392, + "ap-northeast-2": 2.6112, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 1.3632, + "ap-southeast-1": 2.5088, + "ap-southeast-2": 2.8416, + "ap-southeast-3": 2.5088, + "ap-southeast-4": 3.0121, + "ap-southeast-5": 2.1325, + "ap-southeast-7": 2.1325, + "ca-central-1": 2.3808, + "ca-west-1": 2.3808, + "eu-central-1": 0.0, + "eu-central-2": 2.7315, + "eu-north-1": 0.0, + "eu-south-1": 2.5856, + "eu-south-2": 2.3347, + "eu-west-1": 0.0, + "eu-west-2": 2.5856, + "eu-west-3": 0.0, + "il-central-1": 2.4512, + "me-central-1": 2.5683, + "me-south-1": 2.72, + "mx-central-1": 2.2848, + "sa-east-1": 3.5548, + "us-east-1": 2.176, + "us-east-2": 2.176, + "us-gov-east-1": 2.6112, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 2.176 + }, + "c6gd": { + "eu-central-2": 3.446, + "sa-east-1": 4.189, + "us-east-1": 2.703 + }, + "c6gd.medium": { + "ap-northeast-1": 0.0519, + "ap-northeast-2": 0.044, + "ap-northeast-3": 0.049, + "ap-south-1": 0.0245, + "ap-southeast-1": 0.0477, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.045, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.0519, + "eu-north-1": 0.0, + "eu-south-2": 0.0436, + "eu-west-1": 0.0, + "eu-west-2": 0.0488, + "eu-west-3": 0.046, + "sa-east-1": 0.0595, + "us-east-1": 0.0384, + "us-east-2": 0.0, + "us-gov-east-1": 0.0464, + "us-gov-west-1": 0.0, + "us-west-1": 0.048, + "us-west-2": 0.0384 + }, + "c6gd.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.098, + "ap-south-1": 0.049, + "ap-southeast-1": 0.09, + "ap-southeast-2": 0.101, + "ap-southeast-3": 0.09, + "ca-central-1": 0.0899, + "eu-central-1": 0.089, + "eu-central-2": 0.1037, + "eu-north-1": 0.0832, + "eu-south-2": 0.0872, + "eu-west-1": 0.0872, + "eu-west-2": 0.092, + "eu-west-3": 0.092, + "sa-east-1": 0.119, + "us-east-1": 0.0768, + "us-east-2": 0.0768, + "us-gov-east-1": 0.0928, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0768 + }, + "c6gd.xlarge": { + "ap-northeast-1": 0.196, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.196, + "ap-south-1": 0.098, + "ap-southeast-1": 0.18, + "ap-southeast-2": 0.202, + "ap-southeast-3": 0.18, + "ca-central-1": 0.1798, + "eu-central-1": 0.178, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.1744, + "eu-west-1": 0.1849, + "eu-west-2": 0.184, + "eu-west-3": 0.195, + "sa-east-1": 0.238, + "us-east-1": 0.1536, + "us-east-2": 0.1536, + "us-gov-east-1": 0.1967, + "us-gov-west-1": 0.1967, + "us-west-1": 0.192, + "us-west-2": 0.1536 + }, + "c6gd.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.136, + "ap-south-1": 1.6621, + "ap-southeast-1": 2.88, + "ap-southeast-2": 3.424, + "ap-southeast-3": 2.88, + "ca-central-1": 2.7136, + "eu-central-1": 2.848, + "eu-central-2": 0.0, + "eu-north-1": 2.6624, + "eu-south-2": 2.7904, + "eu-west-1": 0.0, + "eu-west-2": 2.944, + "eu-west-3": 2.944, + "sa-east-1": 3.808, + "us-east-1": 2.4576, + "us-east-2": 2.4576, + "us-gov-east-1": 2.9696, + "us-gov-west-1": 2.9696, + "us-west-1": 3.2576, + "us-west-2": 2.4576 + }, + "c6gd.2xlarge": { + "ap-northeast-1": 0.392, + "ap-northeast-2": 0.352, + "ap-northeast-3": 0.4156, + "ap-south-1": 0.196, + "ap-southeast-1": 0.36, + "ap-southeast-2": 0.404, + "ap-southeast-3": 0.36, + "ca-central-1": 0.3392, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.3328, + "eu-south-2": 0.3488, + "eu-west-1": 0.3697, + "eu-west-2": 0.368, + "eu-west-3": 0.368, + "sa-east-1": 0.5048, + "us-east-1": 0.3072, + "us-east-2": 0.3072, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.3935, + "us-west-1": 0.384, + "us-west-2": 0.3072 + }, + "c6gd.4xlarge": { + "ap-northeast-1": 0.784, + "ap-northeast-2": 0.704, + "ap-northeast-3": 0.784, + "ap-south-1": 0.0, + "ap-southeast-1": 0.72, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.7632, + "ca-central-1": 0.7191, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.6656, + "eu-south-2": 0.0, + "eu-west-1": 0.6976, + "eu-west-2": 0.736, + "eu-west-3": 0.736, + "sa-east-1": 0.0, + "us-east-1": 0.6513, + "us-east-2": 0.6144, + "us-gov-east-1": 0.7869, + "us-gov-west-1": 0.7424, + "us-west-1": 0.0, + "us-west-2": 0.6144 + }, + "c6gd.8xlarge": { + "ap-northeast-1": 1.568, + "ap-northeast-2": 1.408, + "ap-northeast-3": 1.568, + "ap-south-1": 0.784, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.616, + "ap-southeast-3": 1.44, + "ca-central-1": 1.4382, + "eu-central-1": 1.5088, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 1.3952, + "eu-west-1": 0.0, + "eu-west-2": 1.472, + "eu-west-3": 1.472, + "sa-east-1": 1.904, + "us-east-1": 1.2288, + "us-east-2": 1.2288, + "us-gov-east-1": 1.4848, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 1.2288 + }, + "c6gd.12xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 2.352, + "ap-south-1": 1.176, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.424, + "ap-southeast-3": 0.0, + "ca-central-1": 2.0352, + "eu-central-1": 0.0, + "eu-central-2": 2.3496, + "eu-north-1": 2.1166, + "eu-south-2": 2.2184, + "eu-west-1": 2.2184, + "eu-west-2": 2.208, + "eu-west-3": 0.0, + "sa-east-1": 2.856, + "us-east-1": 0.0, + "us-east-2": 1.8432, + "us-gov-east-1": 2.2272, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 1.8432 + }, + "c6gd.16xlarge": { + "ap-northeast-1": 3.136, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.136, + "ap-south-1": 1.6621, + "ap-southeast-1": 3.0528, + "ap-southeast-2": 3.232, + "ap-southeast-3": 2.88, + "ca-central-1": 2.8764, + "eu-central-1": 2.848, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 2.7904, + "eu-west-1": 0.0, + "eu-west-2": 2.944, + "eu-west-3": 0.0, + "sa-east-1": 3.808, + "us-east-1": 2.4576, + "us-east-2": 2.6051, + "us-gov-east-1": 2.9696, + "us-gov-west-1": 2.9696, + "us-west-1": 3.072, + "us-west-2": 0.0 + }, + "c6gn": { + "eu-west-2": 3.608, + "us-gov-west-1": 3.661 + }, + "c6gn.medium": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.05995, + "ap-northeast-2": 0.05363, + "ap-northeast-3": 0.06007, + "ap-south-1": 0.04325, + "ap-southeast-1": 0.0495, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0496, + "ap-southeast-5": 0.04208, + "ap-southeast-7": 0.04208, + "ca-central-1": 0.0473, + "ca-west-1": 0.0, + "eu-central-1": 0.0493, + "eu-north-1": 0.0, + "eu-south-1": 0.0516, + "eu-west-1": 0.0488, + "eu-west-2": 0.05125, + "eu-west-3": 0.05638, + "il-central-1": 0.05636, + "me-south-1": 0.05896, + "mx-central-1": 0.04536, + "sa-east-1": 0.0665, + "us-east-1": 0.0432, + "us-east-2": 0.0432, + "us-gov-east-1": 0.052, + "us-gov-west-1": 0.052, + "us-west-1": 0.054, + "us-west-2": 0.0 + }, + "c6gn.large": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.109, + "ap-northeast-2": 0.10725, + "ap-northeast-3": 0.12014, + "ap-south-1": 0.0865, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.113, + "ap-southeast-3": 0.0992, + "ap-southeast-5": 0.09258, + "ap-southeast-7": 0.08416, + "ca-central-1": 0.10406, + "ca-west-1": 0.10406, + "eu-central-1": 0.10846, + "eu-north-1": 0.093, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.1025, + "eu-west-3": 0.11275, + "il-central-1": 0.10248, + "me-south-1": 0.11792, + "mx-central-1": 0.09979, + "sa-east-1": 0.0, + "us-east-1": 0.0864, + "us-east-2": 0.0864, + "us-gov-east-1": 0.104, + "us-gov-west-1": 0.104, + "us-west-1": 0.108, + "us-west-2": 0.0864 + }, + "c6gn.xlarge": { + "ap-east-1": 0.2519, + "ap-northeast-1": 0.218, + "ap-northeast-2": 0.195, + "ap-northeast-3": 0.24028, + "ap-south-1": 0.173, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.226, + "ap-southeast-3": 0.1984, + "ap-southeast-5": 0.16832, + "ap-southeast-7": 0.18515, + "ca-central-1": 0.1892, + "ca-west-1": 0.0, + "eu-central-1": 0.1972, + "eu-north-1": 0.186, + "eu-south-1": 0.22704, + "eu-west-1": 0.1952, + "eu-west-2": 0.205, + "eu-west-3": 0.205, + "il-central-1": 0.20496, + "me-south-1": 0.2144, + "mx-central-1": 0.18144, + "sa-east-1": 0.266, + "us-east-1": 0.1728, + "us-east-2": 0.19008, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.2288, + "us-west-1": 0.216, + "us-west-2": 0.1728 + }, + "c6gn.metal": { + "ca-central-1": 0.0, + "eu-west-3": 3.28 + }, + "c6gn.2xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.39, + "ap-northeast-3": 0.43688, + "ap-south-1": 0.346, + "ap-southeast-1": 0.396, + "ap-southeast-2": 0.4972, + "ap-southeast-3": 0.3968, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.3784, + "eu-central-1": 0.3944, + "eu-north-1": 0.372, + "eu-south-1": 0.45408, + "eu-west-1": 0.0, + "eu-west-2": 0.41, + "eu-west-3": 0.41, + "il-central-1": 0.40992, + "me-south-1": 0.47168, + "mx-central-1": 0.36288, + "sa-east-1": 0.532, + "us-east-1": 0.3456, + "us-east-2": 0.3456, + "us-gov-east-1": 0.416, + "us-gov-west-1": 0.416, + "us-west-1": 0.432, + "us-west-2": 0.38016 + }, + "c6gn.4xlarge": { + "ap-east-1": 0.916, + "ap-northeast-1": 0.872, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.96114, + "ap-south-1": 0.692, + "ap-southeast-1": 0.792, + "ap-southeast-2": 0.904, + "ap-southeast-3": 0.7936, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.67328, + "ca-central-1": 0.7568, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.744, + "eu-south-1": 0.90816, + "eu-west-1": 0.7808, + "eu-west-2": 0.0, + "eu-west-3": 0.82, + "il-central-1": 0.0, + "me-south-1": 0.94336, + "mx-central-1": 0.79834, + "sa-east-1": 1.064, + "us-east-1": 0.6912, + "us-east-2": 0.76032, + "us-gov-east-1": 0.832, + "us-gov-west-1": 0.9152, + "us-west-1": 0.864, + "us-west-2": 0.6912 + }, + "c6gn.8xlarge": { + "ap-east-1": 1.832, + "ap-northeast-1": 1.744, + "ap-northeast-2": 1.56, + "ap-northeast-3": 1.74752, + "ap-south-1": 1.5224, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.808, + "ap-southeast-3": 0.0, + "ap-southeast-5": 1.48122, + "ap-southeast-7": 0.0, + "ca-central-1": 1.5136, + "ca-west-1": 1.66496, + "eu-central-1": 1.73536, + "eu-north-1": 0.0, + "eu-south-1": 1.81632, + "eu-west-1": 0.0, + "eu-west-2": 1.64, + "eu-west-3": 1.64, + "il-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 1.45152, + "sa-east-1": 2.128, + "us-east-1": 1.52064, + "us-east-2": 0.0, + "us-gov-east-1": 1.664, + "us-gov-west-1": 1.664, + "us-west-1": 1.728, + "us-west-2": 1.3824 + }, + "c6gn.12xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 2.616, + "ap-northeast-2": 0.0, + "ap-northeast-3": 2.62128, + "ap-south-1": 2.076, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.712, + "ap-southeast-3": 0.0, + "ap-southeast-5": 2.01984, + "ap-southeast-7": 2.01984, + "ca-central-1": 2.2704, + "ca-west-1": 2.2704, + "eu-central-1": 2.60304, + "eu-north-1": 2.232, + "eu-south-1": 2.4768, + "eu-west-1": 0.0, + "eu-west-2": 2.46, + "eu-west-3": 2.46, + "il-central-1": 2.45952, + "me-south-1": 2.5728, + "mx-central-1": 2.39501, + "sa-east-1": 0.0, + "us-east-1": 2.28096, + "us-east-2": 2.0736, + "us-gov-east-1": 2.496, + "us-gov-west-1": 2.7456, + "us-west-1": 2.592, + "us-west-2": 2.0736 + }, + "c6gn.16xlarge": { + "ap-east-1": 3.664, + "ap-northeast-1": 3.488, + "ap-northeast-2": 3.12, + "ap-northeast-3": 3.49504, + "ap-south-1": 3.0448, + "ap-southeast-1": 3.4848, + "ap-southeast-2": 3.616, + "ap-southeast-3": 3.1744, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.69312, + "ca-central-1": 3.0272, + "ca-west-1": 3.0272, + "eu-central-1": 0.0, + "eu-north-1": 3.2736, + "eu-south-1": 3.3024, + "eu-west-1": 3.1232, + "eu-west-2": 3.28, + "eu-west-3": 3.608, + "il-central-1": 3.27936, + "me-south-1": 3.4304, + "mx-central-1": 2.90304, + "sa-east-1": 0.0, + "us-east-1": 2.7648, + "us-east-2": 2.7648, + "us-gov-east-1": 3.328, + "us-gov-west-1": 3.6608, + "us-west-1": 3.8016, + "us-west-2": 2.7648 + }, + "c6i.large": { + "af-south-1": 0.114, + "ap-east-1": 0.108, + "ap-northeast-1": 0.107, + "ap-northeast-2": 0.1056, + "ap-northeast-3": 0.0, + "ap-south-1": 0.085, + "ap-south-2": 0.0935, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1221, + "ap-southeast-5": 0.0833, + "ap-southeast-7": 0.0833, + "ca-central-1": 0.1023, + "ca-west-1": 0.093, + "eu-central-1": 0.1067, + "eu-north-1": 0.091, + "eu-south-1": 0.1111, + "eu-west-1": 0.0, + "eu-west-2": 0.1111, + "eu-west-3": 0.1111, + "il-central-1": 0.0, + "me-south-1": 0.1056, + "mx-central-1": 0.08925, + "sa-east-1": 0.131, + "us-east-1": 0.085, + "us-east-2": 0.085, + "us-gov-east-1": 0.1122, + "us-gov-west-1": 0.102, + "us-west-1": 0.106, + "us-west-2": 0.0 + }, + "c6i.xlarge": { + "af-south-1": 0.228, + "ap-east-1": 0.2376, + "ap-northeast-1": 0.214, + "ap-northeast-2": 0.2112, + "ap-northeast-3": 0.2354, + "ap-south-1": 0.17, + "ap-south-2": 0.17, + "ap-southeast-1": 0.2156, + "ap-southeast-2": 0.222, + "ap-southeast-5": 0.1666, + "ap-southeast-7": 0.0, + "ca-central-1": 0.186, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.2002, + "eu-south-1": 0.202, + "eu-west-1": 0.1824, + "eu-west-2": 0.202, + "eu-west-3": 0.2222, + "il-central-1": 0.0, + "me-south-1": 0.2112, + "mx-central-1": 0.1785, + "sa-east-1": 0.262, + "us-east-1": 0.17, + "us-east-2": 0.17, + "us-gov-east-1": 0.204, + "us-gov-west-1": 0.0, + "us-west-1": 0.2332, + "us-west-2": 0.187 + }, + "c6i.metal": { + "af-south-1": 7.296, + "ap-east-1": 6.912, + "ap-northeast-1": 6.848, + "ap-northeast-2": 6.144, + "ap-northeast-3": 0.0, + "ap-south-1": 5.44, + "ap-south-2": 5.44, + "ap-southeast-1": 6.272, + "ap-southeast-2": 7.104, + "ap-southeast-5": 5.3312, + "ap-southeast-7": 5.3312, + "ca-central-1": 5.952, + "ca-west-1": 5.952, + "eu-central-1": 0.0, + "eu-north-1": 5.824, + "eu-south-1": 6.464, + "eu-west-1": 5.8368, + "eu-west-2": 6.464, + "eu-west-3": 6.464, + "il-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 8.384, + "us-east-1": 5.44, + "us-east-2": 5.44, + "us-gov-east-1": 6.528, + "us-gov-west-1": 6.528, + "us-west-1": 6.784, + "us-west-2": 5.44 + }, + "c6i.2xlarge": { + "af-south-1": 0.5016, + "ap-east-1": 0.0, + "ap-northeast-1": 0.4708, + "ap-northeast-2": 0.4224, + "ap-northeast-3": 0.4708, + "ap-south-1": 0.34, + "ap-south-2": 0.374, + "ap-southeast-1": 0.4312, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.3332, + "ap-southeast-7": 0.3332, + "ca-central-1": 0.372, + "ca-west-1": 0.372, + "eu-central-1": 0.4268, + "eu-north-1": 0.4004, + "eu-south-1": 0.404, + "eu-west-1": 0.3648, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 0.38304, + "me-south-1": 0.4224, + "mx-central-1": 0.3927, + "sa-east-1": 0.524, + "us-east-1": 0.34, + "us-east-2": 0.34, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.408, + "us-west-1": 0.424, + "us-west-2": 0.0 + }, + "c6i.4xlarge": { + "af-south-1": 0.912, + "ap-east-1": 0.864, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.8448, + "ap-northeast-3": 0.0, + "ap-south-1": 0.748, + "ap-south-2": 0.0, + "ap-southeast-1": 0.8624, + "ap-southeast-2": 0.888, + "ap-southeast-5": 0.6664, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.744, + "eu-central-1": 0.776, + "eu-north-1": 0.8008, + "eu-south-1": 0.808, + "eu-west-1": 0.7296, + "eu-west-2": 0.0, + "eu-west-3": 0.8888, + "il-central-1": 0.76608, + "me-south-1": 0.92928, + "mx-central-1": 0.714, + "sa-east-1": 1.048, + "us-east-1": 0.748, + "us-east-2": 0.68, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.8976, + "us-west-1": 0.848, + "us-west-2": 0.68 + }, + "c6i.8xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 1.712, + "ap-northeast-2": 1.6896, + "ap-northeast-3": 1.8832, + "ap-south-1": 0.0, + "ap-south-2": 1.36, + "ap-southeast-1": 1.568, + "ap-southeast-2": 1.776, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 1.488, + "ca-west-1": 1.6368, + "eu-central-1": 1.552, + "eu-north-1": 1.456, + "eu-south-1": 1.616, + "eu-west-1": 1.4592, + "eu-west-2": 1.616, + "eu-west-3": 0.0, + "il-central-1": 1.53216, + "me-south-1": 1.6896, + "mx-central-1": 1.428, + "sa-east-1": 2.096, + "us-east-1": 1.496, + "us-east-2": 1.36, + "us-gov-east-1": 1.7952, + "us-gov-west-1": 1.632, + "us-west-1": 0.0, + "us-west-2": 1.36 + }, + "c6i.12xlarge": { + "af-south-1": 2.736, + "ap-east-1": 2.8512, + "ap-northeast-1": 2.568, + "ap-northeast-2": 2.5344, + "ap-northeast-3": 2.8248, + "ap-south-1": 2.04, + "ap-south-2": 2.04, + "ap-southeast-1": 2.352, + "ap-southeast-2": 2.664, + "ap-southeast-5": 2.19912, + "ap-southeast-7": 1.9992, + "ca-central-1": 0.0, + "ca-west-1": 2.232, + "eu-central-1": 2.328, + "eu-north-1": 2.184, + "eu-south-1": 2.424, + "eu-west-1": 2.1888, + "eu-west-2": 2.424, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-south-1": 2.78784, + "mx-central-1": 2.142, + "sa-east-1": 3.4584, + "us-east-1": 0.0, + "us-east-2": 2.04, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.448, + "us-west-1": 2.544, + "us-west-2": 2.04 + }, + "c6i.16xlarge": { + "af-south-1": 3.648, + "ap-east-1": 0.0, + "ap-northeast-1": 3.7664, + "ap-northeast-2": 3.072, + "ap-northeast-3": 3.424, + "ap-south-1": 2.72, + "ap-south-2": 2.72, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.552, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.6656, + "ca-central-1": 2.976, + "ca-west-1": 2.976, + "eu-central-1": 0.0, + "eu-north-1": 2.912, + "eu-south-1": 3.5552, + "eu-west-1": 2.9184, + "eu-west-2": 3.232, + "eu-west-3": 3.5552, + "il-central-1": 0.0, + "me-south-1": 3.71712, + "mx-central-1": 0.0, + "sa-east-1": 4.192, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.264, + "us-west-1": 3.392, + "us-west-2": 2.72 + }, + "c6i.24xlarge": { + "af-south-1": 0.0, + "ap-east-1": 5.184, + "ap-northeast-1": 5.6496, + "ap-northeast-2": 4.608, + "ap-northeast-3": 0.0, + "ap-south-1": 4.08, + "ap-south-2": 4.08, + "ap-southeast-1": 4.704, + "ap-southeast-2": 5.8608, + "ap-southeast-5": 3.9984, + "ap-southeast-7": 4.39824, + "ca-central-1": 0.0, + "ca-west-1": 4.464, + "eu-central-1": 0.0, + "eu-north-1": 4.368, + "eu-south-1": 4.848, + "eu-west-1": 4.3776, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-south-1": 5.0688, + "mx-central-1": 4.7124, + "sa-east-1": 6.288, + "us-east-1": 4.08, + "us-east-2": 4.08, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.896, + "us-west-1": 5.088, + "us-west-2": 4.08 + }, + "c6i.32xlarge": { + "af-south-1": 7.296, + "ap-east-1": 6.912, + "ap-northeast-1": 6.848, + "ap-northeast-2": 6.144, + "ap-northeast-3": 6.848, + "ap-south-1": 5.44, + "ap-south-2": 5.44, + "ap-southeast-1": 6.272, + "ap-southeast-2": 7.104, + "ap-southeast-5": 5.3312, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 5.824, + "eu-south-1": 0.0, + "eu-west-1": 5.8368, + "eu-west-2": 6.464, + "eu-west-3": 6.464, + "il-central-1": 6.12864, + "me-south-1": 6.7584, + "mx-central-1": 5.712, + "sa-east-1": 8.384, + "us-east-1": 5.44, + "us-east-2": 5.44, + "us-gov-east-1": 6.528, + "us-gov-west-1": 6.528, + "us-west-1": 6.784, + "us-west-2": 5.44 + }, + "c6id": { + "us-east-1": 7.096 + }, + "c6id.large": { + "ap-northeast-1": 0.1281, + "ap-northeast-2": 0.12705, + "ap-southeast-1": 0.1176, + "ap-southeast-2": 0.14553, + "ap-southeast-5": 0.10996, + "ap-southeast-7": 0.09996, + "ca-central-1": 0.1113, + "ca-west-1": 0.1113, + "eu-central-1": 0.11655, + "eu-west-1": 0.11445, + "eu-west-2": 0.12075, + "il-central-1": 0.12017, + "mx-central-1": 0.0, + "sa-east-1": 0.15645, + "us-east-1": 0.1008, + "us-east-2": 0.0, + "us-gov-west-1": 0.1218, + "us-west-2": 0.1008 + }, + "c6id.xlarge": { + "ap-northeast-1": 0.28182, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.25872, + "ap-southeast-2": 0.2646, + "ap-southeast-5": 0.19992, + "ap-southeast-7": 0.19992, + "ca-central-1": 0.24486, + "ca-west-1": 0.2226, + "eu-central-1": 0.2331, + "eu-west-1": 0.2289, + "eu-west-2": 0.26565, + "il-central-1": 0.26437, + "mx-central-1": 0.21168, + "sa-east-1": 0.3129, + "us-east-1": 0.22176, + "us-east-2": 0.2016, + "us-gov-west-1": 0.0, + "us-west-2": 0.2016 + }, + "c6id.metal": { + "ap-northeast-1": 8.1984, + "ap-northeast-2": 0.0, + "ap-southeast-1": 7.5264, + "ap-southeast-2": 8.4672, + "ap-southeast-5": 6.39744, + "ap-southeast-7": 6.39744, + "ca-central-1": 7.1232, + "ca-west-1": 7.1232, + "eu-central-1": 7.4592, + "eu-west-1": 7.3248, + "eu-west-2": 7.728, + "il-central-1": 7.69088, + "mx-central-1": 0.0, + "sa-east-1": 10.0128, + "us-east-1": 6.4512, + "us-east-2": 6.4512, + "us-gov-west-1": 0.0, + "us-west-2": 6.4512 + }, + "c6id.2xlarge": { + "ap-northeast-1": 0.5124, + "ap-northeast-2": 0.462, + "ap-southeast-1": 0.4704, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.39984, + "ap-southeast-7": 0.0, + "ca-central-1": 0.4452, + "ca-west-1": 0.4452, + "eu-central-1": 0.51282, + "eu-west-1": 0.4578, + "eu-west-2": 0.5313, + "il-central-1": 0.48068, + "mx-central-1": 0.42336, + "sa-east-1": 0.68838, + "us-east-1": 0.4032, + "us-east-2": 0.4032, + "us-gov-west-1": 0.4872, + "us-west-2": 0.4032 + }, + "c6id.4xlarge": { + "ap-northeast-1": 1.0248, + "ap-northeast-2": 1.0164, + "ap-southeast-1": 0.9408, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.79968, + "ap-southeast-7": 0.87965, + "ca-central-1": 0.8904, + "ca-west-1": 0.8904, + "eu-central-1": 0.0, + "eu-west-1": 0.9156, + "eu-west-2": 0.966, + "il-central-1": 0.96136, + "mx-central-1": 0.84672, + "sa-east-1": 1.2516, + "us-east-1": 0.8064, + "us-east-2": 0.0, + "us-gov-west-1": 0.9744, + "us-west-2": 0.0 + }, + "c6id.8xlarge": { + "ap-northeast-1": 2.25456, + "ap-northeast-2": 0.0, + "ap-southeast-1": 1.8816, + "ap-southeast-2": 2.1168, + "ap-southeast-5": 1.59936, + "ap-southeast-7": 1.59936, + "ca-central-1": 1.7808, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 2.01432, + "eu-west-2": 1.932, + "il-central-1": 1.92272, + "mx-central-1": 1.69344, + "sa-east-1": 2.75352, + "us-east-1": 1.6128, + "us-east-2": 1.6128, + "us-gov-west-1": 2.14368, + "us-west-2": 1.6128 + }, + "c6id.12xlarge": { + "ap-northeast-1": 3.0744, + "ap-northeast-2": 3.0492, + "ap-southeast-1": 3.10464, + "ap-southeast-2": 3.1752, + "ap-southeast-5": 2.39904, + "ap-southeast-7": 2.39904, + "ca-central-1": 0.0, + "ca-west-1": 2.93832, + "eu-central-1": 0.0, + "eu-west-1": 2.7468, + "eu-west-2": 2.898, + "il-central-1": 2.88408, + "mx-central-1": 0.0, + "sa-east-1": 4.13028, + "us-east-1": 2.4192, + "us-east-2": 2.4192, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6id.16xlarge": { + "ap-northeast-1": 4.0992, + "ap-northeast-2": 0.0, + "ap-southeast-1": 3.7632, + "ap-southeast-2": 4.2336, + "ap-southeast-5": 3.19872, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 3.91776, + "eu-central-1": 4.10256, + "eu-west-1": 3.6624, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 5.0064, + "us-east-1": 3.2256, + "us-east-2": 3.2256, + "us-gov-west-1": 3.8976, + "us-west-2": 3.2256 + }, + "c6id.24xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.544, + "ap-southeast-1": 6.20928, + "ap-southeast-2": 6.3504, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 5.3424, + "ca-west-1": 5.3424, + "eu-central-1": 5.5944, + "eu-west-1": 5.4936, + "eu-west-2": 5.796, + "il-central-1": 6.34498, + "mx-central-1": 0.0, + "sa-east-1": 7.5096, + "us-east-1": 4.8384, + "us-east-2": 4.8384, + "us-gov-west-1": 6.43104, + "us-west-2": 4.8384 + }, + "c6id.32xlarge": { + "ap-northeast-1": 8.1984, + "ap-northeast-2": 7.392, + "ap-southeast-1": 7.5264, + "ap-southeast-2": 8.4672, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 7.1232, + "ca-west-1": 7.1232, + "eu-central-1": 7.4592, + "eu-west-1": 0.0, + "eu-west-2": 7.728, + "il-central-1": 7.69088, + "mx-central-1": 6.77376, + "sa-east-1": 10.0128, + "us-east-1": 6.4512, + "us-east-2": 6.4512, + "us-gov-west-1": 7.7952, + "us-west-2": 0.0 + }, + "c6in.large": { + "af-south-1": 0.16771, + "ap-east-1": 0.15015, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1281, + "ap-south-1": 0.1134, + "ap-south-2": 0.1133, + "ap-southeast-1": 0.1302, + "ap-southeast-2": 0.16286, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.148, + "ap-southeast-5": 0.11067, + "ca-central-1": 0.1239, + "eu-central-1": 0.14207, + "eu-central-2": 0.1423, + "eu-north-1": 0.1218, + "eu-south-1": 0.13545, + "eu-south-2": 0.128, + "eu-west-1": 0.1281, + "eu-west-2": 0.1344, + "eu-west-3": 0.1344, + "il-central-1": 0.0, + "me-central-1": 0.1408, + "me-south-1": 0.1407, + "sa-east-1": 0.1743, + "us-east-1": 0.0, + "us-east-2": 0.12474, + "us-gov-east-1": 0.1365, + "us-gov-west-1": 0.1365, + "us-west-1": 0.14175, + "us-west-2": 0.1134 + }, + "c6in.xlarge": { + "af-south-1": 0.30492, + "ap-east-1": 0.3003, + "ap-northeast-1": 0.2856, + "ap-northeast-2": 0.28182, + "ap-south-1": 0.2268, + "ap-south-2": 0.2266, + "ap-southeast-1": 0.2604, + "ap-southeast-2": 0.2961, + "ap-southeast-3": 0.2604, + "ap-southeast-4": 0.296, + "ap-southeast-5": 0.22134, + "ca-central-1": 0.27258, + "eu-central-1": 0.2583, + "eu-central-2": 0.2846, + "eu-north-1": 0.2436, + "eu-south-1": 0.29799, + "eu-south-2": 0.256, + "eu-west-1": 0.2562, + "eu-west-2": 0.0, + "eu-west-3": 0.2688, + "il-central-1": 0.26902, + "me-central-1": 0.2816, + "me-south-1": 0.2814, + "sa-east-1": 0.38346, + "us-east-1": 0.2268, + "us-east-2": 0.2268, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.273, + "us-west-1": 0.2835, + "us-west-2": 0.2268 + }, + "c6in.metal": { + "af-south-1": 0.0, + "ap-east-1": 9.6096, + "ap-northeast-1": 0.0, + "ap-northeast-2": 8.1984, + "ap-south-1": 7.2576, + "ap-south-2": 0.0, + "ap-southeast-1": 8.3328, + "ap-southeast-2": 9.4752, + "ap-southeast-3": 0.0, + "ap-southeast-4": 9.472, + "ap-southeast-5": 7.08288, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 9.1072, + "eu-north-1": 7.7952, + "eu-south-1": 8.6688, + "eu-south-2": 8.192, + "eu-west-1": 8.1984, + "eu-west-2": 8.6016, + "eu-west-3": 0.0, + "il-central-1": 8.60864, + "me-central-1": 0.0, + "me-south-1": 9.0048, + "sa-east-1": 11.1552, + "us-east-1": 7.2576, + "us-east-2": 7.2576, + "us-gov-east-1": 8.736, + "us-gov-west-1": 8.736, + "us-west-1": 9.072, + "us-west-2": 7.2576 + }, + "c6in.2xlarge": { + "af-south-1": 0.60984, + "ap-east-1": 0.0, + "ap-northeast-1": 0.5712, + "ap-northeast-2": 0.0, + "ap-south-1": 0.4536, + "ap-south-2": 0.4532, + "ap-southeast-1": 0.5208, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.592, + "ap-southeast-5": 0.0, + "ca-central-1": 0.4956, + "eu-central-1": 0.5166, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.5418, + "eu-south-2": 0.512, + "eu-west-1": 0.0, + "eu-west-2": 0.59136, + "eu-west-3": 0.5376, + "il-central-1": 0.53804, + "me-central-1": 0.5632, + "me-south-1": 0.61908, + "sa-east-1": 0.76692, + "us-east-1": 0.4536, + "us-east-2": 0.4536, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.546, + "us-west-1": 0.567, + "us-west-2": 0.4536 + }, + "c6in.4xlarge": { + "af-south-1": 1.21968, + "ap-east-1": 1.2012, + "ap-northeast-1": 1.25664, + "ap-northeast-2": 1.0248, + "ap-south-1": 0.0, + "ap-south-2": 0.9064, + "ap-southeast-1": 1.0416, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.0416, + "ap-southeast-4": 1.184, + "ap-southeast-5": 0.88536, + "ca-central-1": 0.9912, + "eu-central-1": 0.0, + "eu-central-2": 1.1384, + "eu-north-1": 1.07184, + "eu-south-1": 1.0836, + "eu-south-2": 1.1264, + "eu-west-1": 1.0248, + "eu-west-2": 0.0, + "eu-west-3": 1.0752, + "il-central-1": 1.18369, + "me-central-1": 1.23904, + "me-south-1": 1.23816, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.2012, + "us-west-1": 1.2474, + "us-west-2": 0.9072 + }, + "c6in.8xlarge": { + "af-south-1": 2.43936, + "ap-east-1": 2.4024, + "ap-northeast-1": 2.2848, + "ap-northeast-2": 0.0, + "ap-south-1": 1.8144, + "ap-south-2": 1.8128, + "ap-southeast-1": 2.29152, + "ap-southeast-2": 2.3688, + "ap-southeast-3": 2.29152, + "ap-southeast-4": 0.0, + "ap-southeast-5": 1.77072, + "ca-central-1": 1.9824, + "eu-central-1": 2.0664, + "eu-central-2": 2.2768, + "eu-north-1": 0.0, + "eu-south-1": 2.1672, + "eu-south-2": 2.048, + "eu-west-1": 0.0, + "eu-west-2": 2.1504, + "eu-west-3": 2.1504, + "il-central-1": 0.0, + "me-central-1": 2.2528, + "me-south-1": 2.2512, + "sa-east-1": 2.7888, + "us-east-1": 1.8144, + "us-east-2": 1.8144, + "us-gov-east-1": 2.4024, + "us-gov-west-1": 2.184, + "us-west-1": 2.4948, + "us-west-2": 1.8144 + }, + "c6in.12xlarge": { + "af-south-1": 3.65904, + "ap-east-1": 3.96396, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.0744, + "ap-south-1": 0.0, + "ap-south-2": 2.7192, + "ap-southeast-1": 3.1248, + "ap-southeast-2": 3.5532, + "ap-southeast-3": 3.1248, + "ap-southeast-4": 0.0, + "ap-southeast-5": 2.65608, + "ca-central-1": 2.9736, + "eu-central-1": 3.0996, + "eu-central-2": 3.4152, + "eu-north-1": 0.0, + "eu-south-1": 3.2508, + "eu-south-2": 3.3792, + "eu-west-1": 0.0, + "eu-west-2": 3.2256, + "eu-west-3": 3.2256, + "il-central-1": 3.22824, + "me-central-1": 3.71712, + "me-south-1": 0.0, + "sa-east-1": 4.1832, + "us-east-1": 2.99376, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 3.402, + "us-west-2": 2.7216 + }, + "c6in.16xlarge": { + "af-south-1": 4.87872, + "ap-east-1": 4.8048, + "ap-northeast-1": 4.5696, + "ap-northeast-2": 0.0, + "ap-south-1": 3.99168, + "ap-south-2": 3.98816, + "ap-southeast-1": 4.58304, + "ap-southeast-2": 5.21136, + "ap-southeast-3": 0.0, + "ap-southeast-4": 5.2096, + "ap-southeast-5": 3.54144, + "ca-central-1": 0.0, + "eu-central-1": 4.1328, + "eu-central-2": 5.00896, + "eu-north-1": 0.0, + "eu-south-1": 4.3344, + "eu-south-2": 4.096, + "eu-west-1": 4.0992, + "eu-west-2": 0.0, + "eu-west-3": 4.3008, + "il-central-1": 4.30432, + "me-central-1": 0.0, + "me-south-1": 4.5024, + "sa-east-1": 6.13536, + "us-east-1": 3.6288, + "us-east-2": 3.6288, + "us-gov-east-1": 4.8048, + "us-gov-west-1": 0.0, + "us-west-1": 4.9896, + "us-west-2": 3.99168 + }, + "c6in.24xlarge": { + "af-south-1": 0.0, + "ap-east-1": 7.2072, + "ap-northeast-1": 6.8544, + "ap-northeast-2": 6.1488, + "ap-south-1": 5.4432, + "ap-south-2": 5.98224, + "ap-southeast-1": 6.2496, + "ap-southeast-2": 7.1064, + "ap-southeast-3": 0.0, + "ap-southeast-4": 7.104, + "ap-southeast-5": 5.31216, + "ca-central-1": 5.9472, + "eu-central-1": 6.1992, + "eu-central-2": 6.8304, + "eu-north-1": 5.8464, + "eu-south-1": 6.5016, + "eu-south-2": 6.144, + "eu-west-1": 6.1488, + "eu-west-2": 6.4512, + "eu-west-3": 6.4512, + "il-central-1": 0.0, + "me-central-1": 6.7584, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 5.4432, + "us-gov-east-1": 6.552, + "us-gov-west-1": 6.552, + "us-west-1": 6.804, + "us-west-2": 5.4432 + }, + "c6in.32xlarge": { + "af-south-1": 9.75744, + "ap-east-1": 9.6096, + "ap-northeast-1": 9.1392, + "ap-northeast-2": 8.1984, + "ap-south-1": 7.2576, + "ap-south-2": 7.2512, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 8.3328, + "ap-southeast-4": 9.472, + "ap-southeast-5": 7.08288, + "ca-central-1": 7.9296, + "eu-central-1": 8.2656, + "eu-central-2": 9.1072, + "eu-north-1": 7.7952, + "eu-south-1": 8.6688, + "eu-south-2": 8.192, + "eu-west-1": 8.1984, + "eu-west-2": 0.0, + "eu-west-3": 8.6016, + "il-central-1": 8.60864, + "me-central-1": 9.0112, + "me-south-1": 9.0048, + "sa-east-1": 11.1552, + "us-east-1": 7.2576, + "us-east-2": 7.2576, + "us-gov-east-1": 8.736, + "us-gov-west-1": 8.736, + "us-west-1": 0.0, + "us-west-2": 7.2576 + }, + "c7a": { + "ap-northeast-1": 13.644, + "eu-south-2": 12.241, + "us-east-1": 10.839, + "us-east-2": 10.839, + "us-west-2": 10.839 + }, + "c7a.medium": { + "ap-northeast-1": 0.0646, + "eu-central-1": 0.05857, + "eu-north-1": 0.05494, + "eu-south-2": 0.05796, + "eu-west-1": 0.05506, + "us-east-1": 0.0, + "us-east-2": 0.05645, + "us-west-2": 0.05645 + }, + "c7a.large": { + "ap-northeast-1": 0.14212, + "eu-central-1": 0.11713, + "eu-north-1": 0.10988, + "eu-south-2": 0.11592, + "eu-west-1": 0.12113, + "us-east-1": 0.0, + "us-east-2": 0.10264, + "us-west-2": 0.10264 + }, + "c7a.xlarge": { + "ap-northeast-1": 0.2584, + "eu-central-1": 0.23426, + "eu-north-1": 0.21976, + "eu-south-2": 0.23184, + "eu-west-1": 0.22024, + "us-east-1": 0.22581, + "us-east-2": 0.20528, + "us-west-2": 0.20528 + }, + "c7a.metal-48xl": { + "ap-northeast-1": 12.4032, + "eu-central-1": 11.24448, + "eu-north-1": 10.54848, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "us-east-1": 9.85344, + "us-east-2": 9.85344, + "us-west-2": 9.85344 + }, + "c7a.2xlarge": { + "ap-northeast-1": 0.5168, + "eu-central-1": 0.46852, + "eu-north-1": 0.48347, + "eu-south-2": 0.46368, + "eu-west-1": 0.48453, + "us-east-1": 0.41056, + "us-east-2": 0.45162, + "us-west-2": 0.41056 + }, + "c7a.4xlarge": { + "ap-northeast-1": 1.0336, + "eu-central-1": 0.93704, + "eu-north-1": 0.87904, + "eu-south-2": 0.92736, + "eu-west-1": 0.96906, + "us-east-1": 0.82112, + "us-east-2": 0.82112, + "us-west-2": 0.82112 + }, + "c7a.8xlarge": { + "ap-northeast-1": 2.0672, + "eu-central-1": 1.87408, + "eu-north-1": 0.0, + "eu-south-2": 1.85472, + "eu-west-1": 1.76192, + "us-east-1": 0.0, + "us-east-2": 1.64224, + "us-west-2": 0.0 + }, + "c7a.12xlarge": { + "ap-northeast-1": 3.1008, + "eu-central-1": 2.81112, + "eu-north-1": 0.0, + "eu-south-2": 2.78208, + "eu-west-1": 2.64288, + "us-east-1": 2.46336, + "us-east-2": 2.46336, + "us-west-2": 0.0 + }, + "c7a.16xlarge": { + "ap-northeast-1": 4.54784, + "eu-central-1": 3.74816, + "eu-north-1": 3.86778, + "eu-south-2": 0.0, + "eu-west-1": 3.52384, + "us-east-1": 3.28448, + "us-east-2": 3.28448, + "us-west-2": 3.28448 + }, + "c7a.24xlarge": { + "ap-northeast-1": 6.82176, + "eu-central-1": 0.0, + "eu-north-1": 5.27424, + "eu-south-2": 6.12058, + "eu-west-1": 0.0, + "us-east-1": 5.41939, + "us-east-2": 4.92672, + "us-west-2": 5.41939 + }, + "c7a.32xlarge": { + "ap-northeast-1": 8.2688, + "eu-central-1": 7.49632, + "eu-north-1": 7.73555, + "eu-south-2": 7.41888, + "eu-west-1": 7.75245, + "us-east-1": 7.22586, + "us-east-2": 6.56896, + "us-west-2": 6.56896 + }, + "c7a.48xlarge": { + "ap-northeast-1": 12.4032, + "eu-central-1": 0.0, + "eu-north-1": 10.54848, + "eu-south-2": 0.0, + "eu-west-1": 10.57152, + "us-east-1": 9.85344, + "us-east-2": 9.85344, + "us-west-2": 9.85344 + }, + "c7g": { + "eu-north-1": 8.169, + "us-gov-west-1": 9.156 + }, + "c7g.medium": { + "ap-east-1": 0.0455, + "ap-northeast-1": 0.0483, + "ap-northeast-2": 0.0408, + "ap-northeast-3": 0.0455, + "ap-south-1": 0.0245, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0417, + "ap-southeast-2": 0.0472, + "ap-southeast-5": 0.0376, + "ap-southeast-7": 0.0354, + "ca-central-1": 0.0395, + "eu-central-1": 0.0412, + "eu-central-2": 0.0454, + "eu-north-1": 0.0, + "eu-south-1": 0.0428, + "eu-south-2": 0.0388, + "eu-west-1": 0.0412, + "eu-west-2": 0.0456, + "eu-west-3": 0.0429, + "mx-central-1": 0.0381, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0434, + "us-gov-west-1": 0.0461, + "us-west-1": 0.0, + "us-west-2": 0.0363 + }, + "c7g.large": { + "ap-east-1": 0.091, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0867, + "ap-northeast-3": 0.091, + "ap-south-1": 0.0491, + "ap-south-2": 0.0491, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1003, + "ap-southeast-5": 0.0753, + "ap-southeast-7": 0.0708, + "ca-central-1": 0.0791, + "eu-central-1": 0.0825, + "eu-central-2": 0.0907, + "eu-north-1": 0.0774, + "eu-south-1": 0.0856, + "eu-south-2": 0.0, + "eu-west-1": 0.0775, + "eu-west-2": 0.0, + "eu-west-3": 0.0913, + "mx-central-1": 0.0, + "sa-east-1": 0.1111, + "us-east-1": 0.077, + "us-east-2": 0.0, + "us-gov-east-1": 0.0867, + "us-gov-west-1": 0.0867, + "us-west-1": 0.0901, + "us-west-2": 0.077 + }, + "c7g.xlarge": { + "ap-east-1": 0.182, + "ap-northeast-1": 0.1819, + "ap-northeast-2": 0.1735, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0982, + "ap-south-2": 0.0982, + "ap-southeast-1": 0.1666, + "ap-southeast-2": 0.1887, + "ap-southeast-5": 0.1416, + "ap-southeast-7": 0.1416, + "ca-central-1": 0.0, + "eu-central-1": 0.1753, + "eu-central-2": 0.1814, + "eu-north-1": 0.1547, + "eu-south-1": 0.0, + "eu-south-2": 0.155, + "eu-west-1": 0.155, + "eu-west-2": 0.1825, + "eu-west-3": 0.1717, + "mx-central-1": 0.1522, + "sa-east-1": 0.2222, + "us-east-1": 0.1541, + "us-east-2": 0.1536, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.1734, + "us-west-1": 0.1802, + "us-west-2": 0.1541 + }, + "c7g.metal": { + "ap-east-1": 2.912, + "ap-northeast-1": 2.9107, + "ap-northeast-2": 2.6112, + "ap-northeast-3": 2.9104, + "ap-south-1": 1.5706, + "ap-south-2": 0.0, + "ap-southeast-1": 2.6656, + "ap-southeast-2": 3.0195, + "ap-southeast-5": 2.2656, + "ap-southeast-7": 0.0, + "ca-central-1": 2.5299, + "eu-central-1": 2.6384, + "eu-central-2": 2.9024, + "eu-north-1": 0.0, + "eu-south-1": 2.7407, + "eu-south-2": 0.0, + "eu-west-1": 2.4806, + "eu-west-2": 0.0, + "eu-west-3": 2.7475, + "mx-central-1": 2.4358, + "sa-east-1": 3.5546, + "us-east-1": 2.32, + "us-east-2": 2.3123, + "us-gov-east-1": 2.7744, + "us-gov-west-1": 2.7744, + "us-west-1": 2.8832, + "us-west-2": 2.32 + }, + "c7g.2xlarge": { + "ap-east-1": 0.364, + "ap-northeast-1": 0.3638, + "ap-northeast-2": 0.3264, + "ap-northeast-3": 0.3638, + "ap-south-1": 0.1963, + "ap-south-2": 0.1963, + "ap-southeast-1": 0.3332, + "ap-southeast-2": 0.3774, + "ap-southeast-5": 0.2832, + "ap-southeast-7": 0.0, + "ca-central-1": 0.3362, + "eu-central-1": 0.3298, + "eu-central-2": 0.3628, + "eu-north-1": 0.3094, + "eu-south-1": 0.3426, + "eu-south-2": 0.0, + "eu-west-1": 0.3296, + "eu-west-2": 0.3434, + "eu-west-3": 0.3434, + "mx-central-1": 0.3045, + "sa-east-1": 0.4443, + "us-east-1": 0.29, + "us-east-2": 0.3072, + "us-gov-east-1": 0.3686, + "us-gov-west-1": 0.3468, + "us-west-1": 0.0, + "us-west-2": 0.3082 + }, + "c7g.4xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.7277, + "ap-northeast-2": 0.6528, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.3926, + "ap-southeast-1": 0.6664, + "ap-southeast-2": 0.7549, + "ap-southeast-5": 0.5664, + "ap-southeast-7": 0.5664, + "ca-central-1": 0.6325, + "eu-central-1": 0.0, + "eu-central-2": 0.7256, + "eu-north-1": 0.0, + "eu-south-1": 0.6852, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.6869, + "mx-central-1": 0.609, + "sa-east-1": 0.8886, + "us-east-1": 0.58, + "us-east-2": 0.0, + "us-gov-east-1": 0.6936, + "us-gov-west-1": 0.6936, + "us-west-1": 0.7208, + "us-west-2": 0.58 + }, + "c7g.8xlarge": { + "ap-east-1": 1.456, + "ap-northeast-1": 1.4554, + "ap-northeast-2": 1.3056, + "ap-northeast-3": 1.4552, + "ap-south-1": 0.7853, + "ap-south-2": 0.7853, + "ap-southeast-1": 1.3328, + "ap-southeast-2": 1.5098, + "ap-southeast-5": 1.1328, + "ap-southeast-7": 1.2044, + "ca-central-1": 1.265, + "eu-central-1": 0.0, + "eu-central-2": 1.4512, + "eu-north-1": 1.2378, + "eu-south-1": 1.3704, + "eu-south-2": 1.24, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 1.4601, + "mx-central-1": 1.2179, + "sa-east-1": 0.0, + "us-east-1": 1.16, + "us-east-2": 1.1562, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.4746, + "us-west-1": 1.4416, + "us-west-2": 1.2328 + }, + "c7g.12xlarge": { + "ap-east-1": 2.184, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.9584, + "ap-northeast-3": 0.0, + "ap-south-1": 1.1779, + "ap-south-2": 0.0, + "ap-southeast-1": 1.9992, + "ap-southeast-2": 2.2646, + "ap-southeast-5": 1.6992, + "ap-southeast-7": 0.0, + "ca-central-1": 1.8974, + "eu-central-1": 1.9788, + "eu-central-2": 0.0, + "eu-north-1": 1.9736, + "eu-south-1": 2.0556, + "eu-south-2": 1.86, + "eu-west-1": 0.0, + "eu-west-2": 2.0606, + "eu-west-3": 2.0606, + "mx-central-1": 1.8269, + "sa-east-1": 2.6659, + "us-east-1": 1.74, + "us-east-2": 1.7342, + "us-gov-east-1": 2.2119, + "us-gov-west-1": 0.0, + "us-west-1": 2.2984, + "us-west-2": 1.74 + }, + "c7g.16xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.6112, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 1.5706, + "ap-southeast-1": 2.6656, + "ap-southeast-2": 3.0195, + "ap-southeast-5": 2.2656, + "ap-southeast-7": 2.2656, + "ca-central-1": 2.5299, + "eu-central-1": 0.0, + "eu-central-2": 2.9024, + "eu-north-1": 2.4755, + "eu-south-1": 2.7407, + "eu-south-2": 2.48, + "eu-west-1": 2.4806, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "mx-central-1": 2.4358, + "sa-east-1": 3.5546, + "us-east-1": 2.32, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.7744, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c7gd.medium": { + "ap-northeast-1": 0.0577, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0529, + "ap-southeast-2": 0.0595, + "ap-southeast-5": 0.0, + "eu-central-1": 0.0525, + "eu-north-1": 0.0491, + "eu-south-2": 0.0546, + "eu-west-1": 0.0546, + "us-east-1": 0.0454, + "us-east-2": 0.0481, + "us-gov-east-1": 0.0548, + "us-west-1": 0.0, + "us-west-2": 0.0481 + }, + "c7gd.large": { + "ap-northeast-1": 0.1153, + "ap-south-1": 0.0576, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.09, + "eu-central-1": 0.1049, + "eu-north-1": 0.0983, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0907, + "us-east-2": 0.0962, + "us-gov-east-1": 0.1096, + "us-west-1": 0.1134, + "us-west-2": 0.0907 + }, + "c7gd.xlarge": { + "ap-northeast-1": 0.2306, + "ap-south-1": 0.0, + "ap-southeast-1": 0.2117, + "ap-southeast-2": 0.2382, + "ap-southeast-5": 0.1907, + "eu-central-1": 0.2098, + "eu-north-1": 0.1966, + "eu-south-2": 0.206, + "eu-west-1": 0.206, + "us-east-1": 0.1923, + "us-east-2": 0.1923, + "us-gov-east-1": 0.2192, + "us-west-1": 0.2404, + "us-west-2": 0.1814 + }, + "c7gd.metal": { + "ap-northeast-1": 3.6896, + "ap-south-1": 1.8432, + "ap-southeast-1": 3.3869, + "ap-southeast-2": 3.8106, + "ap-southeast-5": 0.0, + "eu-central-1": 3.3568, + "eu-north-1": 3.145, + "eu-south-2": 3.2962, + "eu-west-1": 3.296, + "us-east-1": 2.903, + "us-east-2": 2.903, + "us-gov-east-1": 0.0, + "us-west-1": 3.6288, + "us-west-2": 2.903 + }, + "c7gd.2xlarge": { + "ap-northeast-1": 0.4612, + "ap-south-1": 0.2304, + "ap-southeast-1": 0.4234, + "ap-southeast-2": 0.5049, + "ap-southeast-5": 0.3814, + "eu-central-1": 0.4448, + "eu-north-1": 0.3931, + "eu-south-2": 0.412, + "eu-west-1": 0.4367, + "us-east-1": 0.3629, + "us-east-2": 0.0, + "us-gov-east-1": 0.4385, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c7gd.4xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.4608, + "ap-southeast-1": 0.8467, + "ap-southeast-2": 0.9526, + "ap-southeast-5": 0.7629, + "eu-central-1": 0.8392, + "eu-north-1": 0.7862, + "eu-south-2": 0.824, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.7258, + "us-gov-east-1": 0.877, + "us-west-1": 0.0, + "us-west-2": 0.7693 + }, + "c7gd.8xlarge": { + "ap-northeast-1": 1.8448, + "ap-south-1": 0.9216, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.0196, + "ap-southeast-5": 1.4394, + "eu-central-1": 1.6784, + "eu-north-1": 1.5725, + "eu-south-2": 1.747, + "eu-west-1": 1.648, + "us-east-1": 1.4515, + "us-east-2": 1.4515, + "us-gov-east-1": 1.7539, + "us-west-1": 1.9233, + "us-west-2": 1.5386 + }, + "c7gd.12xlarge": { + "ap-northeast-1": 2.7672, + "ap-south-1": 0.0, + "ap-southeast-1": 2.5402, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 2.5002, + "eu-south-2": 0.0, + "eu-west-1": 2.472, + "us-east-1": 0.0, + "us-east-2": 2.1773, + "us-gov-east-1": 2.6309, + "us-west-1": 2.7216, + "us-west-2": 2.1773 + }, + "c7gd.16xlarge": { + "ap-northeast-1": 3.6896, + "ap-south-1": 1.8432, + "ap-southeast-1": 3.3869, + "ap-southeast-2": 3.8106, + "ap-southeast-5": 2.8787, + "eu-central-1": 3.3568, + "eu-north-1": 3.145, + "eu-south-2": 0.0, + "eu-west-1": 3.296, + "us-east-1": 2.903, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-west-1": 3.6288, + "us-west-2": 2.903 + }, + "c7gn.medium": { + "ap-northeast-1": 0.0787, + "eu-west-1": 0.0705, + "us-east-1": 0.0624, + "us-east-2": 0.0624, + "us-west-2": 0.0624 + }, + "c7gn.large": { + "ap-northeast-1": 0.1574, + "eu-west-1": 0.141, + "us-east-1": 0.0, + "us-east-2": 0.1323, + "us-west-2": 0.0 + }, + "c7gn.xlarge": { + "ap-northeast-1": 0.3148, + "eu-west-1": 0.282, + "us-east-1": 0.0, + "us-east-2": 0.2496, + "us-west-2": 0.2496 + }, + "c7gn.metal": { + "ap-northeast-1": 5.0368, + "eu-west-1": 4.512, + "us-east-1": 3.9936, + "us-east-2": 3.9936, + "us-west-2": 3.9936 + }, + "c7gn.2xlarge": { + "ap-northeast-1": 0.6296, + "eu-west-1": 0.5977, + "us-east-1": 0.4992, + "us-east-2": 0.5292, + "us-west-2": 0.4992 + }, + "c7gn.4xlarge": { + "ap-northeast-1": 1.3341, + "eu-west-1": 1.128, + "us-east-1": 0.0, + "us-east-2": 0.9984, + "us-west-2": 0.9984 + }, + "c7gn.8xlarge": { + "ap-northeast-1": 2.5184, + "eu-west-1": 2.256, + "us-east-1": 1.9968, + "us-east-2": 2.1166, + "us-west-2": 1.9968 + }, + "c7gn.12xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 3.5864, + "us-east-1": 3.1749, + "us-east-2": 2.9952, + "us-west-2": 2.9952 + }, + "c7gn.16xlarge": { + "ap-northeast-1": 5.0368, + "eu-west-1": 4.512, + "us-east-1": 3.9936, + "us-east-2": 3.9936, + "us-west-2": 3.9936 + }, + "c7i": { + "ap-south-1": 9.425 + }, + "c7i.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.11088, + "ap-south-1": 0.08925, + "ap-southeast-1": 0.11319, + "ap-southeast-2": 0.11655, + "ap-southeast-5": 0.08747, + "ap-southeast-7": 0.08747, + "ca-central-1": 0.10742, + "eu-central-1": 0.11204, + "eu-north-1": 0.0, + "eu-south-2": 0.1008, + "eu-west-1": 0.10534, + "eu-west-2": 0.10605, + "eu-west-3": 0.10605, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.08925, + "us-east-2": 0.08925, + "us-gov-east-1": 0.1071, + "us-gov-west-1": 0.1071, + "us-west-1": 0.12243, + "us-west-2": 0.08925 + }, + "c7i.xlarge": { + "ap-northeast-1": 0.24717, + "ap-northeast-2": 0.0, + "ap-south-1": 0.1785, + "ap-southeast-1": 0.2058, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.17494, + "ca-central-1": 0.0, + "eu-central-1": 0.22407, + "eu-north-1": 0.21021, + "eu-south-2": 0.2016, + "eu-west-1": 0.21067, + "eu-west-2": 0.2121, + "eu-west-3": 0.2121, + "mx-central-1": 0.18742, + "sa-east-1": 0.2751, + "us-east-1": 0.1785, + "us-east-2": 0.1785, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.2226, + "us-west-2": 0.1785 + }, + "c7i.metal-24xl": { + "ap-northeast-1": 5.93208, + "ap-northeast-2": 4.8384, + "ap-south-1": 0.0, + "ap-southeast-1": 4.9392, + "ap-southeast-2": 6.15384, + "ap-southeast-5": 4.61842, + "ap-southeast-7": 4.19856, + "ca-central-1": 4.6872, + "eu-central-1": 4.8888, + "eu-north-1": 4.5864, + "eu-south-2": 5.32224, + "eu-west-1": 4.59648, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "mx-central-1": 4.49808, + "sa-east-1": 6.6024, + "us-east-1": 0.0, + "us-east-2": 4.284, + "us-gov-east-1": 5.1408, + "us-gov-west-1": 5.1408, + "us-west-1": 5.3424, + "us-west-2": 4.284 + }, + "c7i.metal-48xl": { + "ap-northeast-1": 10.7856, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 11.1888, + "ap-southeast-5": 8.39712, + "ap-southeast-7": 8.39712, + "ca-central-1": 9.3744, + "eu-central-1": 9.7776, + "eu-north-1": 9.1728, + "eu-south-2": 9.6768, + "eu-west-1": 9.19296, + "eu-west-2": 0.0, + "eu-west-3": 10.1808, + "mx-central-1": 8.99616, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 8.568, + "us-gov-east-1": 0.0, + "us-gov-west-1": 10.2816, + "us-west-1": 10.6848, + "us-west-2": 8.568 + }, + "c7i.2xlarge": { + "ap-northeast-1": 0.49434, + "ap-northeast-2": 0.4032, + "ap-south-1": 0.357, + "ap-southeast-1": 0.4116, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.34988, + "ap-southeast-7": 0.34988, + "ca-central-1": 0.3906, + "eu-central-1": 0.4074, + "eu-north-1": 0.3822, + "eu-south-2": 0.0, + "eu-west-1": 0.38304, + "eu-west-2": 0.4242, + "eu-west-3": 0.4242, + "mx-central-1": 0.0, + "sa-east-1": 0.60522, + "us-east-1": 0.357, + "us-east-2": 0.3927, + "us-gov-east-1": 0.4284, + "us-gov-west-1": 0.4284, + "us-west-1": 0.0, + "us-west-2": 0.3927 + }, + "c7i.4xlarge": { + "ap-northeast-1": 0.8988, + "ap-northeast-2": 0.8064, + "ap-south-1": 0.714, + "ap-southeast-1": 0.8232, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.69976, + "ap-southeast-7": 0.0, + "ca-central-1": 0.7812, + "eu-central-1": 0.89628, + "eu-north-1": 0.7644, + "eu-south-2": 0.8064, + "eu-west-1": 0.76608, + "eu-west-2": 0.8484, + "eu-west-3": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 1.1004, + "us-east-1": 0.714, + "us-east-2": 0.714, + "us-gov-east-1": 0.8568, + "us-gov-west-1": 0.8568, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c7i.8xlarge": { + "ap-northeast-1": 1.97736, + "ap-northeast-2": 1.6128, + "ap-south-1": 1.428, + "ap-southeast-1": 1.6464, + "ap-southeast-2": 1.8648, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.39952, + "ca-central-1": 1.5624, + "eu-central-1": 1.6296, + "eu-north-1": 1.5288, + "eu-south-2": 1.6128, + "eu-west-1": 0.0, + "eu-west-2": 1.86648, + "eu-west-3": 1.6968, + "mx-central-1": 1.49936, + "sa-east-1": 2.2008, + "us-east-1": 1.428, + "us-east-2": 1.5708, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.7136, + "us-west-1": 1.95888, + "us-west-2": 1.5708 + }, + "c7i.12xlarge": { + "ap-northeast-1": 2.6964, + "ap-northeast-2": 2.4192, + "ap-south-1": 2.142, + "ap-southeast-1": 2.4696, + "ap-southeast-2": 2.7972, + "ap-southeast-5": 2.09928, + "ap-southeast-7": 2.09928, + "ca-central-1": 2.3436, + "eu-central-1": 2.4444, + "eu-north-1": 2.2932, + "eu-south-2": 0.0, + "eu-west-1": 2.52806, + "eu-west-2": 2.5452, + "eu-west-3": 2.79972, + "mx-central-1": 2.24904, + "sa-east-1": 3.3012, + "us-east-1": 2.142, + "us-east-2": 2.3562, + "us-gov-east-1": 2.5704, + "us-gov-west-1": 2.5704, + "us-west-1": 2.6712, + "us-west-2": 2.142 + }, + "c7i.16xlarge": { + "ap-northeast-1": 3.5952, + "ap-northeast-2": 3.54816, + "ap-south-1": 0.0, + "ap-southeast-1": 3.62208, + "ap-southeast-2": 3.7296, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.79904, + "ca-central-1": 3.1248, + "eu-central-1": 3.2592, + "eu-north-1": 3.0576, + "eu-south-2": 3.2256, + "eu-west-1": 3.06432, + "eu-west-2": 3.3936, + "eu-west-3": 3.73296, + "mx-central-1": 3.29859, + "sa-east-1": 4.4016, + "us-east-1": 0.0, + "us-east-2": 3.1416, + "us-gov-east-1": 3.4272, + "us-gov-west-1": 3.76992, + "us-west-1": 3.91776, + "us-west-2": 0.0 + }, + "c7i.24xlarge": { + "ap-northeast-1": 5.3928, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 5.43312, + "ap-southeast-2": 5.5944, + "ap-southeast-5": 4.19856, + "ap-southeast-7": 4.19856, + "ca-central-1": 0.0, + "eu-central-1": 4.8888, + "eu-north-1": 4.5864, + "eu-south-2": 4.8384, + "eu-west-1": 0.0, + "eu-west-2": 5.0904, + "eu-west-3": 5.0904, + "mx-central-1": 4.49808, + "sa-east-1": 6.6024, + "us-east-1": 4.284, + "us-east-2": 4.7124, + "us-gov-east-1": 5.1408, + "us-gov-west-1": 5.1408, + "us-west-1": 5.3424, + "us-west-2": 4.284 + }, + "c7i.48xlarge": { + "ap-northeast-1": 10.7856, + "ap-northeast-2": 9.6768, + "ap-south-1": 8.568, + "ap-southeast-1": 9.8784, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 8.39712, + "ca-central-1": 9.3744, + "eu-central-1": 9.7776, + "eu-north-1": 9.1728, + "eu-south-2": 9.6768, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 10.1808, + "mx-central-1": 8.99616, + "sa-east-1": 0.0, + "us-east-1": 8.568, + "us-east-2": 0.0, + "us-gov-east-1": 10.2816, + "us-gov-west-1": 10.2816, + "us-west-1": 10.6848, + "us-west-2": 8.568 + }, + "c7i-flex.large": { + "ap-northeast-1": 0.10673, + "ap-northeast-2": 0.09576, + "ap-south-1": 0.08479, + "ap-southeast-1": 0.09778, + "ap-southeast-2": 0.11072, + "ap-southeast-5": 0.0831, + "ca-central-1": 0.09277, + "eu-central-1": 0.09676, + "eu-north-1": 0.09077, + "eu-south-2": 0.09576, + "eu-west-1": 0.09097, + "eu-west-2": 0.10075, + "eu-west-3": 0.10075, + "sa-east-1": 0.13067, + "us-east-1": 0.08479, + "us-east-2": 0.08479, + "us-gov-west-1": 0.10175, + "us-west-1": 0.10574, + "us-west-2": 0.08479 + }, + "c7i-flex.xlarge": { + "ap-northeast-1": 0.21347, + "ap-northeast-2": 0.19152, + "ap-south-1": 0.16958, + "ap-southeast-1": 0.19555, + "ap-southeast-2": 0.22145, + "ap-southeast-5": 0.16619, + "ca-central-1": 0.18554, + "eu-central-1": 0.19352, + "eu-north-1": 0.18155, + "eu-south-2": 0.19152, + "eu-west-1": 0.18194, + "eu-west-2": 0.2015, + "eu-west-3": 0.2015, + "sa-east-1": 0.26135, + "us-east-1": 0.16958, + "us-east-2": 0.16958, + "us-gov-west-1": 0.2035, + "us-west-1": 0.21147, + "us-west-2": 0.16958 + }, + "c7i-flex.2xlarge": { + "ap-northeast-1": 0.42693, + "ap-northeast-2": 0.38304, + "ap-south-1": 0.33915, + "ap-southeast-1": 0.3911, + "ap-southeast-2": 0.44289, + "ap-southeast-5": 0.33239, + "ca-central-1": 0.37107, + "eu-central-1": 0.38703, + "eu-north-1": 0.36309, + "eu-south-2": 0.38304, + "eu-west-1": 0.36389, + "eu-west-2": 0.40299, + "eu-west-3": 0.40299, + "sa-east-1": 0.52269, + "us-east-1": 0.33915, + "us-east-2": 0.33915, + "us-gov-west-1": 0.407, + "us-west-1": 0.42294, + "us-west-2": 0.33915 + }, + "c7i-flex.4xlarge": { + "ap-northeast-1": 0.85386, + "ap-northeast-2": 0.76608, + "ap-south-1": 0.6783, + "ap-southeast-1": 0.7822, + "ap-southeast-2": 0.88578, + "ap-southeast-5": 0.66477, + "ca-central-1": 0.74214, + "eu-central-1": 0.77406, + "eu-north-1": 0.72618, + "eu-south-2": 0.76608, + "eu-west-1": 0.72778, + "eu-west-2": 0.80598, + "eu-west-3": 0.80598, + "sa-east-1": 1.04538, + "us-east-1": 0.6783, + "us-east-2": 0.6783, + "us-gov-west-1": 0.814, + "us-west-1": 0.84588, + "us-west-2": 0.6783 + }, + "c7i-flex.8xlarge": { + "ap-northeast-1": 1.70772, + "ap-northeast-2": 1.53216, + "ap-south-1": 1.3566, + "ap-southeast-1": 1.56441, + "ap-southeast-2": 1.77156, + "ap-southeast-5": 1.32954, + "ca-central-1": 1.48428, + "eu-central-1": 1.54812, + "eu-north-1": 1.45236, + "eu-south-2": 1.53216, + "eu-west-1": 1.45555, + "eu-west-2": 1.61196, + "eu-west-3": 1.61196, + "sa-east-1": 2.09076, + "us-east-1": 1.3566, + "us-east-2": 1.3566, + "us-gov-west-1": 1.628, + "us-west-1": 1.69176, + "us-west-2": 1.3566 + }, + "c7i-flex.12xlarge": { + "ap-northeast-1": 2.56158, + "ap-south-1": 2.0349, + "ap-southeast-1": 2.34661, + "ap-southeast-2": 2.65734, + "ap-southeast-5": 1.99432, + "ca-central-1": 2.22642, + "eu-central-1": 2.32218, + "eu-north-1": 2.17854, + "eu-south-2": 2.29824, + "eu-west-1": 2.18333, + "eu-west-2": 2.41794, + "eu-west-3": 2.41794, + "sa-east-1": 3.13614, + "us-east-1": 2.0349, + "us-east-2": 2.0349, + "us-gov-west-1": 2.442, + "us-west-1": 2.53764, + "us-west-2": 2.0349 + }, + "c7i-flex.16xlarge": { + "ap-northeast-1": 3.41544, + "ap-south-1": 2.7132, + "ap-southeast-1": 3.12882, + "ap-southeast-2": 3.54312, + "ap-southeast-5": 2.65909, + "ca-central-1": 2.96856, + "eu-central-1": 3.09624, + "eu-north-1": 2.90472, + "eu-south-2": 3.06432, + "eu-west-1": 2.9111, + "eu-west-2": 3.22392, + "eu-west-3": 3.22392, + "sa-east-1": 4.18152, + "us-east-1": 2.7132, + "us-east-2": 2.7132, + "us-gov-west-1": 3.256, + "us-west-1": 3.38352, + "us-west-2": 2.7132 + }, + "c8g": { + "eu-south-2": 9.003, + "us-east-1": 8.423, + "us-west-2": 8.423 + }, + "c8g.medium": { + "eu-central-1": 0.04535, + "eu-north-1": 0.04255, + "eu-south-2": 0.04263, + "eu-west-1": 0.04264, + "us-east-1": 0.03988, + "us-east-2": 0.04371, + "us-west-2": 0.04387 + }, + "c8g.large": { + "eu-central-1": 0.0907, + "eu-north-1": 0.09361, + "eu-south-2": 0.08526, + "eu-west-1": 0.08528, + "us-east-1": 0.07976, + "us-east-2": 0.0, + "us-west-2": 0.07976 + }, + "c8g.xlarge": { + "eu-central-1": 0.19954, + "eu-north-1": 0.1702, + "eu-south-2": 0.0, + "eu-west-1": 0.18762, + "us-east-1": 0.17547, + "us-east-2": 0.15896, + "us-west-2": 0.15952 + }, + "c8g.metal-24xl": { + "eu-central-1": 4.78896, + "eu-north-1": 4.0848, + "eu-south-2": 4.09248, + "eu-west-1": 4.09344, + "us-east-1": 3.82848, + "us-east-2": 3.81504, + "us-west-2": 4.21133 + }, + "c8g.metal-48xl": { + "eu-central-1": 0.0, + "eu-north-1": 8.1696, + "eu-south-2": 8.18496, + "eu-west-1": 8.18688, + "us-east-1": 7.65696, + "us-east-2": 7.63008, + "us-west-2": 7.65696 + }, + "c8g.2xlarge": { + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.37514, + "eu-west-1": 0.34112, + "us-east-1": 0.31904, + "us-east-2": 0.31792, + "us-west-2": 0.31904 + }, + "c8g.4xlarge": { + "eu-central-1": 0.0, + "eu-north-1": 0.6808, + "eu-south-2": 0.68208, + "eu-west-1": 0.68224, + "us-east-1": 0.63808, + "us-east-2": 0.63584, + "us-west-2": 0.70189 + }, + "c8g.8xlarge": { + "eu-central-1": 1.59632, + "eu-north-1": 1.3616, + "eu-south-2": 1.36416, + "eu-west-1": 1.36448, + "us-east-1": 1.27616, + "us-east-2": 1.27168, + "us-west-2": 0.0 + }, + "c8g.12xlarge": { + "eu-central-1": 2.1768, + "eu-north-1": 0.0, + "eu-south-2": 2.25086, + "eu-west-1": 2.04672, + "us-east-1": 1.91424, + "us-east-2": 1.90752, + "us-west-2": 1.91424 + }, + "c8g.16xlarge": { + "eu-central-1": 0.0, + "eu-north-1": 2.7232, + "eu-south-2": 0.0, + "eu-west-1": 3.00186, + "us-east-1": 2.55232, + "us-east-2": 2.54336, + "us-west-2": 2.55232 + }, + "c8g.24xlarge": { + "eu-central-1": 4.3536, + "eu-north-1": 4.0848, + "eu-south-2": 4.09248, + "eu-west-1": 4.09344, + "us-east-1": 3.82848, + "us-east-2": 4.19654, + "us-west-2": 3.82848 + }, + "c8g.48xlarge": { + "eu-central-1": 8.7072, + "eu-north-1": 8.1696, + "eu-south-2": 8.18496, + "eu-west-1": 8.18688, + "us-east-1": 7.65696, + "us-east-2": 7.63008, + "us-west-2": 7.65696 + }, + "cc2.8xlarge": { + "ap-northeast-1": 2.349, + "eu-west-1": 2.25, + "us-east-1": 2.0, + "us-gov-west-1": 2.25, + "us-west-2": 2.0 + }, + "cr1.8xlarge": { + "ap-northeast-1": 4.105, + "eu-west-1": 3.75, + "us-east-1": 3.5, + "us-west-2": 3.5 + }, + "d2.xlarge": { + "af-south-1": 0.875, + "ap-east-1": 0.957, + "ap-northeast-1": 0.928, + "ap-northeast-2": 0.844, + "ap-northeast-3": 0.844, + "ap-south-1": 0.827, + "ap-southeast-1": 0.87, + "ap-southeast-2": 0.87, + "ca-central-1": 0.759, + "eu-central-1": 0.794, + "eu-north-1": 0.698, + "eu-south-1": 0.772, + "eu-west-1": 0.735, + "eu-west-2": 0.772, + "eu-west-3": 0.772, + "me-south-1": 0.809, + "sa-east-1": 0.0, + "us-east-1": 0.69, + "us-east-2": 0.69, + "us-gov-east-1": 0.828, + "us-gov-west-1": 0.0, + "us-west-1": 0.781, + "us-west-2": 0.0 + }, + "d2.2xlarge": { + "af-south-1": 1.925, + "ap-east-1": 2.105, + "ap-northeast-1": 1.857, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.857, + "ap-south-1": 1.653, + "ap-southeast-1": 1.74, + "ap-southeast-2": 1.914, + "ca-central-1": 1.518, + "eu-central-1": 1.588, + "eu-north-1": 1.396, + "eu-south-1": 1.698, + "eu-west-1": 1.617, + "eu-west-2": 1.544, + "eu-west-3": 0.0, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 1.38, + "us-east-2": 1.38, + "us-gov-east-1": 1.656, + "us-gov-west-1": 0.0, + "us-west-1": 1.563, + "us-west-2": 1.518 + }, + "d2.4xlarge": { + "af-south-1": 3.5, + "ap-east-1": 3.828, + "ap-northeast-1": 3.376, + "ap-northeast-2": 3.376, + "ap-northeast-3": 0.0, + "ap-south-1": 3.306, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 3.036, + "eu-central-1": 0.0, + "eu-north-1": 3.071, + "eu-south-1": 0.0, + "eu-west-1": 2.94, + "eu-west-2": 3.396, + "eu-west-3": 3.088, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 2.76, + "us-east-2": 3.036, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.643, + "us-west-1": 3.438, + "us-west-2": 2.76 + }, + "d2.8xlarge": { + "af-south-1": 0.0, + "ap-east-1": 7.656, + "ap-northeast-1": 6.752, + "ap-northeast-2": 6.752, + "ap-northeast-3": 6.752, + "ap-south-1": 6.612, + "ap-southeast-1": 6.96, + "ap-southeast-2": 6.96, + "ca-central-1": 6.072, + "eu-central-1": 6.352, + "eu-north-1": 0.0, + "eu-south-1": 6.176, + "eu-west-1": 5.88, + "eu-west-2": 6.174, + "eu-west-3": 0.0, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 5.52, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 6.624, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "d3.xlarge": { + "ap-northeast-1": 0.724, + "ap-south-1": 0.524, + "ap-southeast-1": 0.626, + "ap-southeast-2": 0.626, + "ca-central-1": 0.55, + "eu-central-1": 0.658, + "eu-central-2": 0.724, + "eu-west-1": 0.609, + "eu-west-2": 0.64, + "eu-west-3": 0.64, + "il-central-1": 0.64, + "us-east-1": 0.499, + "us-east-2": 0.499, + "us-gov-west-1": 0.598, + "us-west-2": 0.499 + }, + "d3.2xlarge": { + "ap-northeast-1": 1.448, + "ap-south-1": 1.047, + "ap-southeast-1": 1.252, + "ap-southeast-2": 1.252, + "ca-central-1": 1.1, + "eu-central-1": 1.316, + "eu-central-2": 1.448, + "eu-west-1": 1.219, + "eu-west-2": 1.28, + "eu-west-3": 1.28, + "il-central-1": 1.28, + "us-east-1": 0.999, + "us-east-2": 0.999, + "us-gov-west-1": 1.197, + "us-west-2": 0.999 + }, + "d3.4xlarge": { + "ap-northeast-1": 2.897, + "ap-south-1": 2.095, + "ap-southeast-1": 2.504, + "ap-southeast-2": 2.504, + "ca-central-1": 2.201, + "eu-central-1": 2.632, + "eu-central-2": 2.895, + "eu-west-1": 2.437, + "eu-west-2": 2.559, + "eu-west-3": 2.559, + "il-central-1": 2.559, + "us-east-1": 1.998, + "us-east-2": 1.998, + "us-gov-west-1": 2.394, + "us-west-2": 1.998 + }, + "d3.8xlarge": { + "ap-northeast-1": 5.79344, + "ap-south-1": 4.18904, + "ap-southeast-1": 5.00808, + "ap-southeast-2": 5.00808, + "ca-central-1": 4.40112, + "eu-central-1": 5.26448, + "eu-central-2": 5.79096, + "eu-west-1": 4.87448, + "eu-west-2": 5.11824, + "eu-west-3": 5.11824, + "il-central-1": 5.11824, + "us-east-1": 3.99552, + "us-east-2": 3.99552, + "us-gov-west-1": 4.78776, + "us-west-2": 3.99552 + }, + "d3en.xlarge": { + "ap-northeast-1": 0.762, + "ap-southeast-1": 0.659, + "ap-southeast-2": 0.659, + "ap-southeast-3": 0.659, + "eu-central-1": 0.693, + "eu-west-1": 0.641, + "us-east-1": 0.526, + "us-west-2": 0.526 + }, + "d3en.2xlarge": { + "ap-northeast-1": 1.525, + "ap-southeast-1": 1.318, + "ap-southeast-2": 1.318, + "ap-southeast-3": 1.318, + "eu-central-1": 1.385, + "eu-west-1": 1.283, + "us-east-1": 1.051, + "us-west-2": 1.051 + }, + "d3en.4xlarge": { + "ap-northeast-1": 3.049, + "ap-southeast-1": 2.636, + "ap-southeast-2": 2.636, + "ap-southeast-3": 2.636, + "eu-central-1": 2.771, + "eu-west-1": 2.566, + "us-east-1": 2.103, + "us-west-2": 2.103 + }, + "d3en.6xlarge": { + "ap-northeast-1": 4.574, + "ap-southeast-1": 3.954, + "ap-southeast-2": 3.954, + "ap-southeast-3": 3.954, + "eu-central-1": 4.156, + "eu-west-1": 3.848, + "us-east-1": 3.154, + "us-west-2": 3.154 + }, + "d3en.8xlarge": { + "ap-northeast-1": 6.0984, + "ap-southeast-1": 5.27168, + "ap-southeast-2": 5.27168, + "ap-southeast-3": 5.27168, + "eu-central-1": 5.54152, + "eu-west-1": 5.13104, + "us-east-1": 4.20576, + "us-west-2": 4.20576 + }, + "d3en.12xlarge": { + "ap-northeast-1": 9.1476, + "ap-southeast-1": 7.90752, + "ap-southeast-2": 7.90752, + "ap-southeast-3": 7.90752, + "eu-central-1": 8.31228, + "eu-west-1": 7.69656, + "us-east-1": 6.30864, + "us-west-2": 6.30864 + }, + "dl1": { + "us-east-1": 14.42, + "us-west-2": 14.42 + }, + "dl1.24xlarge": { + "us-east-1": 13.10904, + "us-west-2": 13.10904 + }, + "dl2q": { + "us-west-2": 9.811 + }, + "dl2q.24xlarge": { + "eu-central-1": 11.5952, + "us-west-2": 0.0 + }, + "f1": { + "eu-central-1": 15.259, + "eu-west-1": 15.972, + "us-east-1": 13.2 + }, + "f1.2xlarge": { + "ap-southeast-2": 1.981, + "eu-central-1": 1.734, + "eu-west-1": 1.815, + "eu-west-2": 1.906, + "us-east-1": 1.65, + "us-gov-west-1": 2.178, + "us-west-2": 1.815 + }, + "f1.4xlarge": { + "ap-southeast-2": 3.962, + "eu-central-1": 3.468, + "eu-west-1": 3.63, + "eu-west-2": 3.812, + "us-east-1": 3.3, + "us-gov-west-1": 0.0, + "us-west-2": 3.3 + }, + "f1.16xlarge": { + "ap-southeast-2": 15.848, + "eu-west-1": 14.52, + "us-east-1": 13.2, + "us-gov-west-1": 15.84, + "us-west-2": 13.2 + }, + "f2": { + "ap-southeast-2": 20.909, + "eu-west-2": 22.651, + "us-east-1": 17.424, + "us-west-2": 17.424 + }, + "f2.6xlarge": { + "ap-southeast-2": 0.0, + "eu-west-2": 2.574, + "us-east-1": 1.98, + "us-west-2": 2.178 + }, + "f2.12xlarge": { + "ap-southeast-2": 5.2272, + "eu-west-2": 5.148, + "us-east-1": 3.96, + "us-west-2": 0.0 + }, + "f2.48xlarge": { + "ap-southeast-2": 0.0, + "eu-west-2": 0.0, + "us-east-1": 15.84, + "us-west-2": 0.0 + }, + "g2": { + "ap-northeast-1": 3.951, + "ap-southeast-1": 4.4, + "ap-southeast-2": 3.951, + "eu-central-1": 3.397, + "eu-west-1": 3.089, + "us-east-1": 2.86, + "us-west-1": 3.089, + "us-west-2": 2.86 + }, + "g2.2xlarge": { + "ap-northeast-1": 0.898, + "ap-northeast-2": 0.898, + "ap-southeast-1": 1.0, + "ap-southeast-2": 0.988, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.65, + "us-west-1": 0.702, + "us-west-2": 0.65 + }, + "g2.8xlarge": { + "ap-northeast-1": 3.592, + "ap-northeast-2": 3.592, + "ap-southeast-1": 4.0, + "ap-southeast-2": 3.592, + "eu-central-1": 3.088, + "eu-west-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 2.6, + "us-west-1": 2.808, + "us-west-2": 2.6 + }, + "g3": { + "ap-northeast-1": 6.952, + "ap-northeast-2": 6.248, + "ap-southeast-1": 7.348, + "ap-southeast-2": 7.718, + "ca-central-1": 6.23, + "eu-central-1": 6.27, + "eu-west-1": 5.324, + "eu-west-2": 6.288, + "us-east-1": 5.016, + "us-east-2": 5.016, + "us-gov-west-1": 5.808, + "us-west-1": 6.75, + "us-west-2": 5.016 + }, + "g3.4xlarge": { + "ap-northeast-1": 1.58, + "ap-northeast-2": 1.42, + "ap-southeast-1": 1.67, + "ap-southeast-2": 0.0, + "ca-central-1": 1.416, + "eu-central-1": 0.0, + "eu-west-1": 1.21, + "eu-west-2": 1.429, + "us-east-1": 1.14, + "us-east-2": 1.14, + "us-gov-west-1": 0.0, + "us-west-1": 1.534, + "us-west-2": 1.14 + }, + "g3.8xlarge": { + "ap-northeast-1": 3.476, + "ap-northeast-2": 2.84, + "ap-southeast-1": 3.34, + "ap-southeast-2": 3.508, + "ca-central-1": 2.832, + "eu-central-1": 0.0, + "eu-west-1": 2.42, + "eu-west-2": 2.858, + "us-east-1": 2.28, + "us-east-2": 2.28, + "us-gov-west-1": 2.64, + "us-west-1": 3.068, + "us-west-2": 2.28 + }, + "g3.16xlarge": { + "ap-northeast-1": 6.32, + "ap-northeast-2": 0.0, + "ap-southeast-1": 6.68, + "ap-southeast-2": 7.016, + "ca-central-1": 5.664, + "eu-central-1": 0.0, + "eu-west-1": 4.84, + "eu-west-2": 0.0, + "us-east-1": 4.56, + "us-east-2": 4.56, + "us-gov-west-1": 5.28, + "us-west-1": 0.0, + "us-west-2": 4.56 + }, + "g3s.xlarge": { + "ap-northeast-1": 1.04, + "ap-northeast-2": 0.934, + "ap-southeast-2": 1.154, + "eu-central-1": 0.938, + "eu-west-1": 0.796, + "eu-west-2": 0.94, + "us-east-1": 0.75, + "us-east-2": 0.75, + "us-gov-west-1": 0.868, + "us-west-2": 0.75 + }, + "g4ad": { + "us-east-1": 11.444 + }, + "g4ad.xlarge": { + "ap-northeast-1": 0.51082, + "ca-central-1": 0.42263, + "eu-central-1": 0.47327, + "eu-west-1": 0.42263, + "eu-west-2": 0.44271, + "us-east-1": 0.37853, + "us-east-2": 0.37853, + "us-west-2": 0.41638 + }, + "g4ad.2xlarge": { + "ap-northeast-1": 0.7303, + "ca-central-1": 0.66463, + "eu-central-1": 0.67662, + "eu-west-1": 0.60421, + "eu-west-2": 0.63292, + "us-east-1": 0.54117, + "us-east-2": 0.0, + "us-west-2": 0.54117 + }, + "g4ad.4xlarge": { + "ap-northeast-1": 1.17, + "ca-central-1": 0.0, + "eu-central-1": 1.084, + "eu-west-1": 0.968, + "eu-west-2": 0.0, + "us-east-1": 0.867, + "us-east-2": 0.9537, + "us-west-2": 0.9537 + }, + "g4ad.8xlarge": { + "ap-northeast-1": 0.0, + "ca-central-1": 1.936, + "eu-central-1": 2.3848, + "eu-west-1": 1.936, + "eu-west-2": 0.0, + "us-east-1": 1.734, + "us-east-2": 1.734, + "us-west-2": 0.0 + }, + "g4ad.16xlarge": { + "ap-northeast-1": 4.68, + "ca-central-1": 3.872, + "eu-central-1": 4.336, + "eu-west-1": 4.2592, + "eu-west-2": 0.0, + "us-east-1": 3.8148, + "us-east-2": 3.468, + "us-west-2": 3.468 + }, + "g4dn.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.81, + "ap-northeast-1": 0.71, + "ap-northeast-2": 0.647, + "ap-northeast-3": 0.71, + "ap-south-1": 0.579, + "ap-southeast-1": 0.736, + "ap-southeast-2": 0.684, + "ca-central-1": 0.619, + "eu-central-1": 0.7, + "eu-north-1": 0.558, + "eu-south-1": 0.656, + "eu-west-1": 0.587, + "eu-west-2": 0.615, + "eu-west-3": 0.615, + "me-south-1": 0.0, + "sa-east-1": 0.894, + "us-east-1": 0.526, + "us-east-2": 0.0, + "us-gov-east-1": 0.703, + "us-gov-west-1": 0.663, + "us-west-1": 0.631, + "us-west-2": 0.526, + "us-west-2-lax-1": 0.631 + }, + "g4dn.metal": { + "af-south-1": 10.381, + "ap-east-1": 12.048, + "ap-northeast-1": 0.0, + "ap-northeast-2": 9.624, + "ap-northeast-3": 0.0, + "ap-south-1": 8.612, + "ap-southeast-1": 10.948, + "ap-southeast-2": 10.174, + "ca-central-1": 8.687, + "eu-central-1": 0.0, + "eu-north-1": 8.3, + "eu-south-1": 9.16, + "eu-west-1": 8.724, + "eu-west-2": 0.0, + "eu-west-3": 9.148, + "me-south-1": 9.596, + "sa-east-1": 13.298, + "us-east-1": 7.824, + "us-east-2": 7.824, + "us-gov-west-1": 0.0, + "us-west-1": 9.389, + "us-west-2": 7.824, + "us-west-2-lax-1": 9.389 + }, + "g4dn.2xlarge": { + "af-south-1": 0.998, + "ap-east-1": 1.228, + "ap-northeast-1": 1.015, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.081, + "ap-south-1": 0.0, + "ap-southeast-1": 1.052, + "ap-southeast-2": 0.978, + "ca-central-1": 0.835, + "eu-central-1": 0.0, + "eu-north-1": 0.798, + "eu-south-1": 0.88, + "eu-west-1": 0.0, + "eu-west-2": 0.88, + "eu-west-3": 0.932, + "me-south-1": 0.0, + "sa-east-1": 1.361, + "us-east-1": 0.752, + "us-east-2": 0.752, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.902, + "us-west-2": 0.752, + "us-west-2-lax-1": 0.902 + }, + "g4dn.4xlarge": { + "af-south-1": 1.597, + "ap-east-1": 1.965, + "ap-northeast-1": 1.625, + "ap-northeast-2": 1.481, + "ap-northeast-3": 1.731, + "ap-south-1": 0.0, + "ap-southeast-1": 1.786, + "ap-southeast-2": 1.566, + "ca-central-1": 1.417, + "eu-central-1": 1.505, + "eu-north-1": 0.0, + "eu-south-1": 1.41, + "eu-west-1": 1.342, + "eu-west-2": 1.409, + "eu-west-3": 0.0, + "me-south-1": 1.573, + "sa-east-1": 2.179, + "us-east-1": 1.276, + "us-east-2": 1.204, + "us-gov-east-1": 1.518, + "us-gov-west-1": 1.609, + "us-west-1": 1.445, + "us-west-2": 1.276, + "us-west-2-lax-1": 1.445 + }, + "g4dn.8xlarge": { + "af-south-1": 2.887, + "ap-east-1": 3.351, + "ap-northeast-1": 2.938, + "ap-northeast-2": 2.677, + "ap-northeast-3": 3.129, + "ap-south-1": 0.0, + "ap-southeast-1": 3.045, + "ap-southeast-2": 2.83, + "ca-central-1": 0.0, + "eu-central-1": 2.897, + "eu-north-1": 2.308, + "eu-south-1": 2.713, + "eu-west-1": 2.426, + "eu-west-2": 0.0, + "eu-west-3": 2.544, + "me-south-1": 2.669, + "sa-east-1": 3.698, + "us-east-1": 2.307, + "us-east-2": 2.307, + "us-gov-east-1": 2.743, + "us-gov-west-1": 2.907, + "us-west-1": 2.611, + "us-west-2": 0.0, + "us-west-2-lax-1": 2.611 + }, + "g4dn.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 6.386, + "ap-northeast-1": 5.624, + "ap-northeast-2": 4.812, + "ap-northeast-3": 0.0, + "ap-south-1": 4.306, + "ap-southeast-1": 5.802, + "ap-southeast-2": 5.087, + "ca-central-1": 0.0, + "eu-central-1": 5.208, + "eu-north-1": 4.15, + "eu-south-1": 0.0, + "eu-west-1": 4.362, + "eu-west-2": 4.577, + "eu-west-3": 4.574, + "me-south-1": 4.798, + "sa-east-1": 6.649, + "us-east-1": 3.912, + "us-east-2": 3.912, + "us-gov-east-1": 5.227, + "us-gov-west-1": 4.931, + "us-west-1": 0.0, + "us-west-2": 3.912, + "us-west-2-lax-1": 4.694 + }, + "g4dn.16xlarge": { + "af-south-1": 6.15, + "ap-east-1": 0.0, + "ap-northeast-1": 6.257, + "ap-northeast-2": 5.353, + "ap-northeast-3": 5.875, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.659, + "ca-central-1": 4.832, + "eu-central-1": 5.44, + "eu-north-1": 4.617, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 5.423, + "eu-west-3": 5.088, + "me-south-1": 5.338, + "sa-east-1": 7.397, + "us-east-1": 4.352, + "us-east-2": 4.352, + "us-gov-east-1": 5.815, + "us-gov-west-1": 5.815, + "us-west-1": 5.222, + "us-west-2": 4.352, + "us-west-2-lax-1": 5.222 + }, + "g5": { + "eu-west-2": 22.743 + }, + "g5.xlarge": { + "ap-northeast-1": 1.459, + "ap-northeast-2": 1.237, + "ap-south-1": 1.208, + "ap-southeast-2": 1.308, + "ap-southeast-3": 1.408, + "ca-central-1": 1.117, + "eu-central-1": 0.0, + "eu-north-1": 1.067, + "eu-west-1": 0.0, + "eu-west-2": 1.277, + "il-central-1": 1.17915, + "me-central-1": 1.234, + "sa-east-1": 1.71, + "us-east-1": 1.006, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "g5.2xlarge": { + "ap-northeast-1": 1.93354, + "ap-northeast-2": 0.0, + "ap-south-1": 1.45536, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.69632, + "ca-central-1": 1.34573, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "me-central-1": 1.63536, + "sa-east-1": 2.06016, + "us-east-1": 1.212, + "us-east-2": 1.3332, + "us-west-2": 1.212 + }, + "g5.4xlarge": { + "ap-northeast-1": 2.35528, + "ap-northeast-2": 1.99691, + "ap-south-1": 0.0, + "ap-southeast-2": 2.11152, + "ap-southeast-3": 2.50025, + "ca-central-1": 1.80319, + "eu-central-1": 2.03081, + "eu-north-1": 0.0, + "eu-west-1": 1.81287, + "eu-west-2": 2.06148, + "il-central-1": 2.09387, + "me-central-1": 1.99206, + "sa-east-1": 3.03652, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 1.624, + "us-west-2-lax-1": 2.23098 + }, + "g5.8xlarge": { + "ap-northeast-1": 3.55033, + "ap-northeast-2": 3.31113, + "ap-south-1": 2.93955, + "ap-southeast-2": 3.50118, + "ap-southeast-3": 0.0, + "ca-central-1": 2.98992, + "eu-central-1": 3.06122, + "eu-north-1": 2.85608, + "eu-west-1": 2.73271, + "eu-west-2": 3.10745, + "il-central-1": 2.86934, + "me-central-1": 3.00282, + "sa-east-1": 4.57722, + "us-east-1": 2.6928, + "us-east-2": 2.448, + "us-west-2": 2.448, + "us-west-2-lax-1": 3.36296 + }, + "g5.12xlarge": { + "ap-northeast-1": 8.22609, + "ap-northeast-2": 6.97442, + "ap-south-1": 6.81091, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ca-central-1": 6.29784, + "eu-central-1": 7.09282, + "eu-north-1": 6.01593, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "il-central-1": 7.31307, + "me-central-1": 7.65325, + "sa-east-1": 10.6054, + "us-east-1": 0.0, + "us-east-2": 6.2392, + "us-west-2": 6.2392 + }, + "g5.16xlarge": { + "ap-northeast-1": 5.94042, + "ap-northeast-2": 5.03653, + "ap-south-1": 4.91846, + "ap-southeast-2": 5.32561, + "ap-southeast-3": 5.73277, + "ca-central-1": 4.54794, + "eu-central-1": 5.12204, + "eu-north-1": 4.34437, + "eu-west-1": 0.0, + "eu-west-2": 5.1994, + "il-central-1": 4.80099, + "me-central-1": 0.0, + "sa-east-1": 6.96239, + "us-east-1": 4.096, + "us-east-2": 4.096, + "us-west-2": 4.096 + }, + "g5.24xlarge": { + "ap-northeast-1": 11.81123, + "ap-northeast-2": 11.01545, + "ap-south-1": 0.0, + "ap-southeast-2": 10.58882, + "ap-southeast-3": 12.5382, + "ca-central-1": 9.94685, + "eu-central-1": 11.20245, + "eu-north-1": 8.63782, + "eu-west-1": 9.09117, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "me-central-1": 9.98976, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 8.144 + }, + "g5.48xlarge": { + "ap-northeast-1": 23.62246, + "ap-northeast-2": 20.02809, + "ap-south-1": 19.55855, + "ap-southeast-2": 21.17764, + "ap-southeast-3": 22.79672, + "ca-central-1": 18.08518, + "eu-central-1": 0.0, + "eu-north-1": 17.27564, + "eu-west-1": 18.18233, + "eu-west-2": 20.67572, + "il-central-1": 0.0, + "me-central-1": 19.97951, + "sa-east-1": 27.68636, + "us-east-1": 17.9168, + "us-east-2": 16.288, + "us-west-2": 17.9168 + }, + "g5g": { + "ap-northeast-1": 4.074 + }, + "g5g.xlarge": { + "ap-northeast-1": 0.5669, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "eu-central-1": 0.5254, + "eu-south-2": 0.4992, + "us-east-1": 0.42, + "us-west-2": 0.42 + }, + "g5g.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-southeast-1": 3.8395, + "eu-central-1": 3.4326, + "eu-south-2": 3.0622, + "us-east-1": 2.744, + "us-west-2": 2.744 + }, + "g5g.2xlarge": { + "ap-northeast-1": 0.7505, + "ap-northeast-2": 0.6839, + "ap-southeast-1": 0.8246, + "eu-central-1": 0.6955, + "eu-south-2": 0.6205, + "us-east-1": 0.5894, + "us-west-2": 0.556 + }, + "g5g.4xlarge": { + "ap-northeast-1": 1.1176, + "ap-northeast-2": 1.0185, + "ap-southeast-1": 1.1586, + "eu-central-1": 1.0358, + "eu-south-2": 0.9841, + "us-east-1": 0.828, + "us-west-2": 0.8777 + }, + "g5g.8xlarge": { + "ap-northeast-1": 1.8519, + "ap-northeast-2": 0.0, + "ap-southeast-1": 2.0349, + "eu-central-1": 1.7163, + "eu-south-2": 1.5311, + "us-east-1": 1.372, + "us-west-2": 1.372 + }, + "g5g.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-southeast-1": 3.8395, + "eu-central-1": 0.0, + "eu-south-2": 3.0622, + "us-east-1": 2.744, + "us-west-2": 2.744 + }, + "g6.xlarge": { + "ap-northeast-1": 1.1672, + "ap-northeast-2": 0.9896, + "ap-south-1": 0.9664, + "ap-southeast-2": 1.15104, + "ap-southeast-5": 1.0138, + "ca-central-1": 0.8936, + "eu-central-1": 1.0064, + "eu-central-2": 1.085, + "eu-north-1": 0.8536, + "eu-south-2": 0.0, + "eu-west-2": 1.0216, + "eu-west-3": 1.0216, + "sa-east-1": 1.368, + "us-east-1": 0.8048, + "us-east-2": 0.8048, + "us-gov-west-1": 1.0144, + "us-west-2": 0.8048 + }, + "g6.2xlarge": { + "ap-northeast-1": 1.55959, + "ap-northeast-2": 1.20208, + "ap-south-1": 0.0, + "ap-southeast-2": 1.39818, + "ap-southeast-5": 1.35462, + "ca-central-1": 1.08547, + "eu-central-1": 1.22249, + "eu-central-2": 1.31796, + "eu-north-1": 1.03688, + "eu-south-2": 1.13308, + "eu-west-2": 1.36504, + "eu-west-3": 1.24095, + "sa-east-1": 1.66173, + "us-east-1": 0.9776, + "us-east-2": 0.9776, + "us-gov-west-1": 1.2322, + "us-west-2": 0.9776 + }, + "g6.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.62704, + "ap-south-1": 1.58889, + "ap-southeast-2": 1.72042, + "ap-southeast-5": 1.83351, + "ca-central-1": 1.4692, + "eu-central-1": 1.65466, + "eu-central-2": 1.78389, + "eu-north-1": 1.40343, + "eu-south-2": 1.39423, + "eu-west-2": 0.0, + "eu-west-3": 1.84761, + "sa-east-1": 2.24918, + "us-east-1": 1.3232, + "us-east-2": 0.0, + "us-gov-west-1": 1.66781, + "us-west-2": 0.0 + }, + "g6.8xlarge": { + "ap-northeast-1": 3.21363, + "ap-northeast-2": 2.47695, + "ap-south-1": 0.0, + "ap-southeast-2": 2.88103, + "ap-southeast-5": 2.53752, + "ca-central-1": 2.23666, + "eu-central-1": 2.519, + "eu-central-2": 2.71574, + "eu-north-1": 2.13655, + "eu-south-2": 2.12253, + "eu-west-2": 2.55705, + "eu-west-3": 2.55705, + "sa-east-1": 3.42408, + "us-east-1": 2.0144, + "us-east-2": 2.0144, + "us-gov-west-1": 2.53903, + "us-west-2": 2.0144 + }, + "g6.12xlarge": { + "ap-northeast-1": 7.34106, + "ap-northeast-2": 5.65823, + "ap-south-1": 6.07814, + "ap-southeast-2": 5.98299, + "ap-southeast-5": 0.0, + "ca-central-1": 5.10933, + "eu-central-1": 5.75429, + "eu-central-2": 6.2037, + "eu-north-1": 5.36869, + "eu-south-2": 4.8486, + "eu-west-2": 6.42532, + "eu-west-3": 5.8412, + "sa-east-1": 8.60399, + "us-east-1": 5.06176, + "us-east-2": 4.6016, + "us-gov-west-1": 6.38003, + "us-west-2": 4.6016 + }, + "g6.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.17678, + "ap-south-1": 4.07886, + "ap-southeast-2": 4.41652, + "ap-southeast-5": 4.27892, + "ca-central-1": 0.0, + "eu-central-1": 4.24769, + "eu-central-2": 5.03738, + "eu-north-1": 3.60277, + "eu-south-2": 3.57913, + "eu-west-2": 4.31184, + "eu-west-3": 4.31184, + "sa-east-1": 0.0, + "us-east-1": 3.3968, + "us-east-2": 3.73648, + "us-gov-west-1": 4.28145, + "us-west-2": 3.3968 + }, + "g6.24xlarge": { + "ap-northeast-1": 9.68103, + "ap-northeast-2": 9.02877, + "ap-south-1": 0.0, + "ap-southeast-2": 8.67909, + "ap-southeast-5": 9.24956, + "ca-central-1": 7.41173, + "eu-central-1": 8.34732, + "eu-central-2": 0.0, + "eu-north-1": 7.07996, + "eu-south-2": 7.73686, + "eu-west-2": 8.47339, + "eu-west-3": 9.32073, + "sa-east-1": 0.0, + "us-east-1": 7.34272, + "us-east-2": 6.6752, + "us-gov-west-1": 8.41367, + "us-west-2": 7.34272 + }, + "g6.48xlarge": { + "ap-northeast-1": 19.36206, + "ap-northeast-2": 16.41595, + "ap-south-1": 16.0311, + "ap-southeast-2": 17.35817, + "ap-southeast-5": 16.81739, + "ca-central-1": 14.82346, + "eu-central-1": 0.0, + "eu-central-2": 17.99849, + "eu-north-1": 0.0, + "eu-south-2": 14.06702, + "eu-west-2": 16.94678, + "eu-west-3": 16.94678, + "sa-east-1": 22.69303, + "us-east-1": 13.3504, + "us-east-2": 13.3504, + "us-gov-west-1": 16.82734, + "us-west-2": 13.3504 + }, + "g6e": { + "us-east-2": 33.144 + }, + "g6e.xlarge": { + "ap-northeast-1": 2.699, + "eu-central-1": 2.327, + "eu-north-1": 0.0, + "eu-south-2": 1.961, + "us-east-1": 1.861, + "us-east-2": 1.861, + "us-west-2": 1.861 + }, + "g6e.2xlarge": { + "ap-northeast-1": 3.25168, + "eu-central-1": 2.8035, + "eu-north-1": 2.61604, + "eu-south-2": 0.0, + "us-east-1": 2.24208, + "us-east-2": 2.24208, + "us-west-2": 2.24208 + }, + "g6e.4xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 3.75651, + "eu-north-1": 3.18666, + "eu-south-2": 3.48224, + "us-east-1": 3.00424, + "us-east-2": 3.30466, + "us-west-2": 0.0 + }, + "g6e.8xlarge": { + "ap-northeast-1": 6.56775, + "eu-central-1": 6.22877, + "eu-north-1": 4.80353, + "eu-south-2": 4.7719, + "us-east-1": 4.52856, + "us-east-2": 0.0, + "us-west-2": 4.52856 + }, + "g6e.12xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 13.12002, + "eu-north-1": 11.12975, + "eu-south-2": 11.05645, + "us-east-1": 11.5419, + "us-east-2": 0.0, + "us-west-2": 10.49264 + }, + "g6e.16xlarge": { + "ap-northeast-1": 10.98917, + "eu-central-1": 10.422, + "eu-north-1": 8.84101, + "eu-south-2": 7.98435, + "us-east-1": 7.57719, + "us-east-2": 0.0, + "us-west-2": 7.57719 + }, + "g6e.24xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 18.83806, + "eu-north-1": 15.98037, + "eu-south-2": 15.87513, + "us-east-1": 0.0, + "us-east-2": 15.06559, + "us-west-2": 0.0 + }, + "g6e.48xlarge": { + "ap-northeast-1": 43.69912, + "eu-central-1": 37.67612, + "eu-north-1": 31.96075, + "eu-south-2": 31.75027, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "gr6.4xlarge": { + "ap-northeast-1": 2.2323, + "ap-northeast-2": 1.8926, + "ap-south-1": 1.8483, + "ap-southeast-2": 2.0012, + "ap-southeast-5": 1.9388, + "ca-central-1": 1.709, + "eu-central-1": 1.9248, + "eu-central-2": 2.1649, + "eu-north-1": 1.6326, + "eu-south-2": 1.6218, + "eu-west-2": 1.9539, + "eu-west-3": 1.9538, + "sa-east-1": 2.6164, + "us-east-1": 1.5392, + "us-east-2": 1.5392, + "us-gov-west-1": 1.9401, + "us-west-2": 1.5392 + }, + "gr6.8xlarge": { + "ap-northeast-1": 3.54801, + "ap-northeast-2": 3.00809, + "ap-south-1": 2.93768, + "ap-southeast-2": 3.1807, + "ap-southeast-5": 3.08152, + "ca-central-1": 2.71628, + "eu-central-1": 3.05927, + "eu-central-2": 3.44089, + "eu-north-1": 2.59485, + "eu-south-2": 2.57768, + "eu-west-2": 3.10552, + "eu-west-3": 3.10536, + "sa-east-1": 4.1585, + "us-east-1": 2.4464, + "us-east-2": 2.4464, + "us-gov-west-1": 3.08359, + "us-west-2": 2.4464 + }, + "h1": { + "us-east-1": 4.118 + }, + "h1.2xlarge": { + "eu-west-1": 0.653, + "us-east-1": 0.0, + "us-east-2": 0.586, + "us-west-2": 0.468 + }, + "h1.4xlarge": { + "eu-west-1": 1.306, + "us-east-1": 0.936, + "us-east-2": 0.0, + "us-west-2": 0.997 + }, + "h1.8xlarge": { + "eu-west-1": 2.076, + "us-east-1": 2.342, + "us-east-2": 1.872, + "us-west-2": 0.0 + }, + "h1.16xlarge": { + "eu-west-1": 4.152, + "us-east-1": 3.744, + "us-east-2": 0.0, + "us-west-2": 3.744 + }, + "hpc6a.48xlarge": { + "ap-southeast-1": 3.3205, + "ap-southeast-2": 3.7609, + "eu-north-1": 3.093, + "us-east-2": 2.88, + "us-gov-east-1": 3.467, + "us-gov-west-1": 3.467 + }, + "hpc6id.32xlarge": { + "eu-north-1": 6.0352, + "eu-west-3": 6.77294, + "us-east-2": 5.7, + "us-gov-west-1": 6.8544 + }, + "hpc7a.12xlarge": { + "eu-north-1": 7.7252, + "eu-west-1": 7.7252, + "eu-west-3": 8.5553, + "us-east-2": 7.2, + "us-gov-west-1": 8.6674 + }, + "hpc7a.24xlarge": { + "eu-north-1": 7.7252, + "eu-west-1": 7.7252, + "eu-west-3": 8.5553, + "us-east-2": 7.2, + "us-gov-west-1": 8.6674 + }, + "hpc7a.48xlarge": { + "eu-north-1": 7.7252, + "eu-west-1": 7.7252, + "eu-west-3": 8.5553, + "us-east-2": 7.2, + "us-gov-west-1": 8.6674 + }, + "hpc7a.96xlarge": { + "eu-north-1": 7.7252, + "eu-west-1": 7.7252, + "eu-west-3": 8.5553, + "us-east-2": 7.2, + "us-gov-west-1": 8.6674 + }, + "hpc7g.4xlarge": { + "ap-northeast-1": 2.1117, + "eu-west-1": 1.8059, + "us-east-1": 1.6832, + "us-gov-west-1": 2.0262 + }, + "hpc7g.8xlarge": { + "ap-northeast-1": 2.1117, + "eu-west-1": 1.8059, + "us-east-1": 1.6832, + "us-gov-west-1": 2.0262 + }, + "hpc7g.16xlarge": { + "ap-northeast-1": 2.1117, + "eu-west-1": 1.8059, + "us-east-1": 1.6832, + "us-gov-west-1": 2.0262 + }, + "hs1.8xlarge": { + "ap-northeast-1": 5.4, + "ap-southeast-1": 5.57, + "ap-southeast-2": 5.57, + "eu-west-1": 4.9, + "us-east-1": 4.6, + "us-gov-west-1": 5.52, + "us-west-2": 4.6 + }, + "i2": { + "ap-southeast-1": 8.954, + "eu-west-1": 8.252 + }, + "i2.large": { + "ap-northeast-1": 0.55, + "ap-northeast-2": 0.468, + "ap-south-1": 0.468, + "ap-southeast-1": 0.559, + "ap-southeast-2": 0.559, + "eu-central-1": 0.468, + "eu-west-1": 0.515, + "eu-west-2": 0.468, + "us-east-1": 0.468, + "us-east-2": 0.468, + "us-west-1": 0.515, + "us-west-2": 0.468 + }, + "i2.xlarge": { + "ap-northeast-1": 1.101, + "ap-northeast-2": 1.001, + "ap-south-1": 0.0, + "ap-southeast-1": 1.12, + "ap-southeast-2": 1.018, + "eu-central-1": 1.013, + "eu-west-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.853, + "us-east-2": 0.853, + "us-gov-west-1": 1.023, + "us-west-1": 0.938, + "us-west-2": 0.853 + }, + "i2.2xlarge": { + "ap-northeast-1": 2.001, + "ap-northeast-2": 2.001, + "ap-south-1": 2.126, + "ap-southeast-1": 2.035, + "ap-southeast-2": 0.0, + "eu-central-1": 2.228, + "eu-west-1": 1.876, + "sa-east-1": 0.0, + "us-east-1": 1.705, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 1.705 + }, + "i2.4xlarge": { + "ap-northeast-1": 4.002, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 4.07, + "ap-southeast-2": 4.07, + "eu-central-1": 4.051, + "eu-west-1": 4.126, + "sa-east-1": 0.0, + "us-east-1": 3.41, + "us-east-2": 3.41, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 3.41 + }, + "i2.8xlarge": { + "ap-northeast-1": 8.004, + "ap-northeast-2": 8.004, + "ap-south-1": 7.733, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 8.102, + "eu-west-1": 7.502, + "sa-east-1": 0.0, + "us-east-1": 6.82, + "us-east-2": 6.82, + "us-gov-west-1": 8.184, + "us-west-1": 0.0, + "us-west-2": 6.82 + }, + "i3.large": { + "af-south-1": 0.226, + "ap-east-1": 0.206, + "ap-northeast-1": 0.183, + "ap-northeast-2": 0.183, + "ap-northeast-3": 0.183, + "ap-south-1": 0.177, + "ap-south-2": 0.177, + "ap-southeast-1": 0.187, + "ap-southeast-2": 0.206, + "ap-southeast-3": 0.187, + "ap-southeast-4": 0.187, + "ca-central-1": 0.172, + "eu-central-1": 0.186, + "eu-central-2": 0.0, + "eu-north-1": 0.163, + "eu-south-1": 0.181, + "eu-south-2": 0.172, + "eu-west-1": 0.172, + "eu-west-2": 0.199, + "eu-west-3": 0.181, + "il-central-1": 0.181, + "me-central-1": 0.189, + "me-south-1": 0.189, + "sa-east-1": 0.249, + "us-east-1": 0.156, + "us-east-2": 0.0, + "us-gov-east-1": 0.188, + "us-gov-west-1": 0.188, + "us-west-1": 0.172, + "us-west-2": 0.156 + }, + "i3.xlarge": { + "af-south-1": 0.41, + "ap-east-1": 0.412, + "ap-northeast-1": 0.403, + "ap-northeast-2": 0.366, + "ap-northeast-3": 0.366, + "ap-south-1": 0.389, + "ap-south-2": 0.354, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.374, + "ap-southeast-4": 0.374, + "ca-central-1": 0.378, + "eu-central-1": 0.409, + "eu-central-2": 0.409, + "eu-north-1": 0.326, + "eu-south-1": 0.362, + "eu-south-2": 0.344, + "eu-west-1": 0.378, + "eu-west-2": 0.362, + "eu-west-3": 0.398, + "il-central-1": 0.361, + "me-central-1": 0.416, + "me-south-1": 0.378, + "sa-east-1": 0.498, + "us-east-1": 0.343, + "us-east-2": 0.312, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "i3.metal": { + "af-south-1": 6.56, + "ap-east-1": 6.592, + "ap-northeast-1": 5.856, + "ap-northeast-2": 5.856, + "ap-northeast-3": 5.856, + "ap-south-1": 5.664, + "ap-southeast-1": 5.984, + "ap-southeast-2": 5.984, + "ca-central-1": 5.504, + "eu-central-1": 0.0, + "eu-north-1": 5.216, + "eu-south-1": 5.792, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 5.792, + "me-south-1": 6.054, + "sa-east-1": 7.968, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 6.016, + "us-gov-west-1": 6.016, + "us-west-1": 5.504, + "us-west-2": 0.0 + }, + "i3.2xlarge": { + "af-south-1": 0.82, + "ap-east-1": 0.824, + "ap-northeast-1": 0.805, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.732, + "ap-south-1": 0.708, + "ap-south-2": 0.708, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.748, + "ap-southeast-3": 0.823, + "ap-southeast-4": 0.0, + "ca-central-1": 0.688, + "eu-central-1": 0.744, + "eu-central-2": 0.818, + "eu-north-1": 0.0, + "eu-south-1": 0.724, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.796, + "eu-west-3": 0.724, + "il-central-1": 0.795, + "me-central-1": 0.757, + "me-south-1": 0.0, + "sa-east-1": 0.996, + "us-east-1": 0.686, + "us-east-2": 0.0, + "us-gov-east-1": 0.752, + "us-gov-west-1": 0.0, + "us-west-1": 0.688, + "us-west-2": 0.624 + }, + "i3.4xlarge": { + "af-south-1": 1.64, + "ap-east-1": 1.813, + "ap-northeast-1": 1.464, + "ap-northeast-2": 1.464, + "ap-northeast-3": 1.464, + "ap-south-1": 1.416, + "ap-south-2": 1.558, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.496, + "ap-southeast-3": 1.646, + "ap-southeast-4": 1.496, + "ca-central-1": 1.376, + "eu-central-1": 1.637, + "eu-central-2": 1.637, + "eu-north-1": 1.304, + "eu-south-1": 1.593, + "eu-south-2": 1.376, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 1.448, + "il-central-1": 1.589, + "me-central-1": 1.514, + "me-south-1": 1.514, + "sa-east-1": 1.992, + "us-east-1": 1.248, + "us-east-2": 1.248, + "us-gov-east-1": 1.504, + "us-gov-west-1": 1.654, + "us-west-1": 1.376, + "us-west-2": 1.248 + }, + "i3.8xlarge": { + "af-south-1": 3.28, + "ap-east-1": 3.626, + "ap-northeast-1": 2.928, + "ap-northeast-2": 2.928, + "ap-northeast-3": 3.221, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 3.291, + "ap-southeast-2": 2.992, + "ap-southeast-3": 2.992, + "ap-southeast-4": 2.992, + "ca-central-1": 2.752, + "eu-central-1": 0.0, + "eu-central-2": 3.274, + "eu-north-1": 2.608, + "eu-south-1": 2.896, + "eu-south-2": 2.752, + "eu-west-1": 0.0, + "eu-west-2": 2.896, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 3.33, + "me-south-1": 3.33, + "sa-east-1": 3.984, + "us-east-1": 2.496, + "us-east-2": 2.496, + "us-gov-east-1": 3.008, + "us-gov-west-1": 3.008, + "us-west-1": 2.752, + "us-west-2": 2.496 + }, + "i3.16xlarge": { + "af-south-1": 6.56, + "ap-east-1": 6.592, + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.856, + "ap-northeast-3": 0.0, + "ap-south-1": 5.664, + "ap-south-2": 5.664, + "ap-southeast-1": 5.984, + "ap-southeast-2": 5.984, + "ap-southeast-3": 5.984, + "ap-southeast-4": 5.984, + "ca-central-1": 5.504, + "eu-central-1": 5.952, + "eu-central-2": 6.547, + "eu-north-1": 5.216, + "eu-south-1": 0.0, + "eu-south-2": 5.504, + "eu-west-1": 5.504, + "eu-west-2": 5.792, + "eu-west-3": 0.0, + "il-central-1": 5.779, + "me-central-1": 6.054, + "me-south-1": 6.054, + "sa-east-1": 7.968, + "us-east-1": 4.992, + "us-east-2": 4.992, + "us-gov-east-1": 6.016, + "us-gov-west-1": 6.016, + "us-west-1": 5.504, + "us-west-2": 4.992 + }, + "i3en.large": { + "af-south-1": 0.297, + "ap-east-1": 0.318, + "ap-northeast-1": 0.266, + "ap-northeast-2": 0.283, + "ap-northeast-3": 0.266, + "ap-south-1": 0.0, + "ap-south-2": 0.274, + "ap-southeast-1": 0.271, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.289, + "ap-southeast-4": 0.271, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.244, + "ca-central-1": 0.0, + "ca-west-1": 0.25, + "eu-central-1": 0.0, + "eu-central-2": 0.297, + "eu-north-1": 0.237, + "eu-south-1": 0.262, + "eu-south-2": 0.25, + "eu-west-1": 0.25, + "eu-west-2": 0.0, + "eu-west-3": 0.263, + "il-central-1": 0.263, + "me-central-1": 0.275, + "me-south-1": 0.292, + "mx-central-1": 0.237, + "sa-east-1": 0.0, + "us-east-1": 0.241, + "us-east-2": 0.241, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.241, + "us-west-2-lax-1": 0.271 + }, + "i3en.xlarge": { + "af-south-1": 0.633, + "ap-east-1": 0.597, + "ap-northeast-1": 0.532, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.532, + "ap-south-1": 0.0, + "ap-south-2": 0.547, + "ap-southeast-1": 0.542, + "ap-southeast-2": 0.577, + "ap-southeast-3": 0.542, + "ap-southeast-4": 0.577, + "ap-southeast-5": 0.488, + "ap-southeast-7": 0.488, + "ca-central-1": 0.5, + "ca-west-1": 0.533, + "eu-central-1": 0.54, + "eu-central-2": 0.633, + "eu-north-1": 0.474, + "eu-south-1": 0.524, + "eu-south-2": 0.0, + "eu-west-1": 0.5, + "eu-west-2": 0.526, + "eu-west-3": 0.526, + "il-central-1": 0.559, + "me-central-1": 0.55, + "me-south-1": 0.548, + "mx-central-1": 0.475, + "sa-east-1": 0.767, + "us-east-1": 0.0, + "us-east-2": 0.452, + "us-gov-east-1": 0.546, + "us-gov-west-1": 0.546, + "us-west-1": 0.533, + "us-west-2": 0.481, + "us-west-2-lax-1": 0.542 + }, + "i3en.metal": { + "af-south-1": 0.0, + "ap-east-1": 14.319, + "ap-northeast-1": 12.768, + "ap-northeast-2": 12.768, + "ap-northeast-3": 12.768, + "ap-south-1": 12.336, + "ap-south-2": 12.336, + "ap-southeast-1": 13.008, + "ap-southeast-2": 13.008, + "ap-southeast-3": 13.008, + "ap-southeast-4": 13.008, + "ap-southeast-5": 0.0, + "ap-southeast-7": 11.707, + "ca-central-1": 12.0, + "ca-west-1": 12.0, + "eu-central-1": 12.96, + "eu-central-2": 14.256, + "eu-north-1": 0.0, + "eu-south-1": 12.586, + "eu-south-2": 0.0, + "eu-west-1": 12.0, + "eu-west-2": 12.624, + "eu-west-3": 12.624, + "il-central-1": 12.6, + "me-central-1": 13.2, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 17.28, + "us-east-1": 10.848, + "us-east-2": 10.848, + "us-gov-east-1": 0.0, + "us-gov-west-1": 13.104, + "us-west-1": 12.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 13.018 + }, + "i3en.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.193, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 1.028, + "ap-south-2": 1.028, + "ap-southeast-1": 1.084, + "ap-southeast-2": 1.084, + "ap-southeast-3": 1.084, + "ap-southeast-4": 1.084, + "ap-southeast-5": 0.976, + "ap-southeast-7": 0.976, + "ca-central-1": 1.0, + "ca-west-1": 1.065, + "eu-central-1": 1.08, + "eu-central-2": 1.188, + "eu-north-1": 0.948, + "eu-south-1": 1.049, + "eu-south-2": 1.0, + "eu-west-1": 1.0, + "eu-west-2": 1.12, + "eu-west-3": 1.052, + "il-central-1": 1.118, + "me-central-1": 1.1, + "me-south-1": 1.095, + "mx-central-1": 0.949, + "sa-east-1": 0.0, + "us-east-1": 0.904, + "us-east-2": 0.904, + "us-gov-east-1": 1.092, + "us-gov-west-1": 0.0, + "us-west-1": 1.0, + "us-west-2": 0.904, + "us-west-2-lax-1": 0.0 + }, + "i3en.3xlarge": { + "af-south-1": 1.782, + "ap-east-1": 1.906, + "ap-northeast-1": 1.596, + "ap-northeast-2": 1.596, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 1.626, + "ap-southeast-2": 1.626, + "ap-southeast-3": 1.732, + "ap-southeast-4": 1.626, + "ap-southeast-5": 1.463, + "ap-southeast-7": 1.463, + "ca-central-1": 1.5, + "ca-west-1": 1.5, + "eu-central-1": 1.62, + "eu-central-2": 1.898, + "eu-north-1": 1.422, + "eu-south-1": 1.573, + "eu-south-2": 1.5, + "eu-west-1": 1.598, + "eu-west-2": 1.578, + "eu-west-3": 1.578, + "il-central-1": 1.575, + "me-central-1": 0.0, + "me-south-1": 1.643, + "mx-central-1": 1.424, + "sa-east-1": 2.16, + "us-east-1": 1.356, + "us-east-2": 1.356, + "us-gov-east-1": 1.638, + "us-gov-west-1": 1.638, + "us-west-1": 0.0, + "us-west-2": 1.356, + "us-west-2-lax-1": 1.627 + }, + "i3en.6xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 3.192, + "ap-northeast-2": 3.192, + "ap-northeast-3": 3.192, + "ap-south-1": 3.084, + "ap-south-2": 3.284, + "ap-southeast-1": 3.252, + "ap-southeast-2": 3.464, + "ap-southeast-3": 0.0, + "ap-southeast-4": 3.252, + "ap-southeast-5": 0.0, + "ap-southeast-7": 3.117, + "ca-central-1": 3.0, + "ca-west-1": 3.0, + "eu-central-1": 3.24, + "eu-central-2": 3.564, + "eu-north-1": 2.844, + "eu-south-1": 3.146, + "eu-south-2": 3.0, + "eu-west-1": 3.0, + "eu-west-2": 0.0, + "eu-west-3": 3.156, + "il-central-1": 3.15, + "me-central-1": 3.3, + "me-south-1": 3.5, + "mx-central-1": 2.848, + "sa-east-1": 4.32, + "us-east-1": 2.888, + "us-east-2": 2.712, + "us-gov-east-1": 3.276, + "us-gov-west-1": 3.276, + "us-west-1": 0.0, + "us-west-2": 2.888, + "us-west-2-lax-1": 3.254 + }, + "i3en.12xlarge": { + "af-south-1": 7.593, + "ap-east-1": 7.16, + "ap-northeast-1": 6.799, + "ap-northeast-2": 6.384, + "ap-northeast-3": 6.384, + "ap-south-1": 6.168, + "ap-south-2": 0.0, + "ap-southeast-1": 6.504, + "ap-southeast-2": 6.504, + "ap-southeast-3": 6.928, + "ap-southeast-4": 6.928, + "ap-southeast-5": 5.854, + "ap-southeast-7": 0.0, + "ca-central-1": 6.0, + "ca-west-1": 6.0, + "eu-central-1": 6.48, + "eu-central-2": 7.128, + "eu-north-1": 5.688, + "eu-south-1": 6.704, + "eu-south-2": 6.39, + "eu-west-1": 6.0, + "eu-west-2": 6.723, + "eu-west-3": 6.312, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 7.0, + "mx-central-1": 5.695, + "sa-east-1": 8.64, + "us-east-1": 5.424, + "us-east-2": 0.0, + "us-gov-east-1": 6.977, + "us-gov-west-1": 0.0, + "us-west-1": 6.0, + "us-west-2": 5.776, + "us-west-2-lax-1": 6.509 + }, + "i3en.24xlarge": { + "af-south-1": 14.256, + "ap-east-1": 14.319, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 12.768, + "ap-south-1": 12.336, + "ap-south-2": 12.336, + "ap-southeast-1": 0.0, + "ap-southeast-2": 13.008, + "ap-southeast-3": 13.008, + "ap-southeast-4": 13.008, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 12.0, + "ca-west-1": 12.0, + "eu-central-1": 0.0, + "eu-central-2": 14.256, + "eu-north-1": 0.0, + "eu-south-1": 12.586, + "eu-south-2": 12.0, + "eu-west-1": 12.0, + "eu-west-2": 12.624, + "eu-west-3": 12.624, + "il-central-1": 12.6, + "me-central-1": 13.2, + "me-south-1": 0.0, + "mx-central-1": 11.39, + "sa-east-1": 17.28, + "us-east-1": 10.848, + "us-east-2": 10.848, + "us-gov-east-1": 13.104, + "us-gov-west-1": 13.104, + "us-west-1": 0.0, + "us-west-2": 10.848, + "us-west-2-lax-1": 0.0 + }, + "i3p.16xlarge": { + "us-gov-west-1": 6.016 + }, + "i4g": { + "ap-southeast-1": 6.517, + "ca-central-1": 5.991, + "us-east-1": 5.436, + "us-east-2": 5.436 + }, + "i4g.large": { + "ap-southeast-1": 0.18513, + "ca-central-1": 0.0, + "eu-west-1": 0.1702, + "us-east-1": 0.0, + "us-east-2": 0.15444, + "us-west-2": 0.15444 + }, + "i4g.xlarge": { + "ap-southeast-1": 0.37026, + "ca-central-1": 0.3404, + "eu-west-1": 0.0, + "us-east-1": 0.33977, + "us-east-2": 0.30888, + "us-west-2": 0.30888 + }, + "i4g.2xlarge": { + "ap-southeast-1": 0.81457, + "ca-central-1": 0.74888, + "eu-west-1": 0.6808, + "us-east-1": 0.61776, + "us-east-2": 0.61776, + "us-west-2": 0.61776 + }, + "i4g.4xlarge": { + "ap-southeast-1": 1.48104, + "ca-central-1": 1.36159, + "eu-west-1": 1.36159, + "us-east-1": 1.35907, + "us-east-2": 1.23552, + "us-west-2": 1.35907 + }, + "i4g.8xlarge": { + "ap-southeast-1": 3.25829, + "ca-central-1": 2.99551, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.47104, + "us-west-2": 2.47104 + }, + "i4g.16xlarge": { + "ap-southeast-1": 5.92416, + "ca-central-1": 0.0, + "eu-west-1": 5.44637, + "us-east-1": 4.94208, + "us-east-2": 4.94208, + "us-west-2": 4.94208 + }, + "i4i": { + "ap-southeast-4": 14.481 + }, + "i4i.large": { + "af-south-1": 0.226, + "ap-east-1": 0.249, + "ap-northeast-1": 0.221, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.195, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.206, + "ap-southeast-3": 0.206, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.185, + "ap-southeast-7": 0.0, + "ca-central-1": 0.189, + "ca-west-1": 0.208, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.189, + "eu-west-2": 0.199, + "eu-west-3": 0.219, + "il-central-1": 0.199, + "me-central-1": 0.208, + "me-south-1": 0.208, + "mx-central-1": 0.18, + "sa-east-1": 0.274, + "us-east-1": 0.172, + "us-east-2": 0.189, + "us-gov-east-1": 0.227, + "us-gov-west-1": 0.207, + "us-west-1": 0.189, + "us-west-2": 0.0 + }, + "i4i.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.499, + "ap-northeast-1": 0.403, + "ap-northeast-2": 0.403, + "ap-northeast-3": 0.403, + "ap-south-1": 0.0, + "ap-south-2": 0.389, + "ap-southeast-1": 0.453, + "ap-southeast-2": 0.453, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.453, + "ap-southeast-5": 0.37, + "ap-southeast-7": 0.37, + "ca-central-1": 0.378, + "ca-west-1": 0.0, + "eu-central-1": 0.409, + "eu-central-2": 0.45, + "eu-north-1": 0.359, + "eu-south-1": 0.438, + "eu-west-1": 0.0, + "eu-west-2": 0.438, + "eu-west-3": 0.438, + "il-central-1": 0.397, + "me-central-1": 0.457, + "me-south-1": 0.457, + "mx-central-1": 0.36, + "sa-east-1": 0.548, + "us-east-1": 0.343, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.378, + "us-west-2": 0.343 + }, + "i4i.metal": { + "af-south-1": 14.432, + "ap-east-1": 14.502, + "ap-northeast-1": 12.883, + "ap-northeast-2": 0.0, + "ap-northeast-3": 12.883, + "ap-south-1": 12.461, + "ap-south-2": 0.0, + "ap-southeast-1": 13.165, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 13.165, + "ap-southeast-5": 11.848, + "ap-southeast-7": 11.848, + "ca-central-1": 12.109, + "ca-west-1": 12.109, + "eu-central-1": 13.094, + "eu-central-2": 14.404, + "eu-north-1": 11.475, + "eu-south-1": 0.0, + "eu-west-1": 12.109, + "eu-west-2": 12.742, + "eu-west-3": 12.742, + "il-central-1": 0.0, + "me-central-1": 13.306, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 10.982, + "us-east-2": 10.982, + "us-gov-east-1": 13.235, + "us-gov-west-1": 0.0, + "us-west-1": 12.109, + "us-west-2": 10.982 + }, + "i4i.2xlarge": { + "af-south-1": 0.902, + "ap-east-1": 0.997, + "ap-northeast-1": 0.805, + "ap-northeast-2": 0.805, + "ap-northeast-3": 0.0, + "ap-south-1": 0.779, + "ap-south-2": 0.857, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.823, + "ap-southeast-3": 0.823, + "ap-southeast-4": 0.823, + "ap-southeast-5": 0.741, + "ap-southeast-7": 0.815, + "ca-central-1": 0.757, + "ca-west-1": 0.757, + "eu-central-1": 0.818, + "eu-central-2": 0.9, + "eu-north-1": 0.717, + "eu-south-1": 0.0, + "eu-west-1": 0.757, + "eu-west-2": 0.796, + "eu-west-3": 0.876, + "il-central-1": 0.795, + "me-central-1": 0.832, + "me-south-1": 0.832, + "mx-central-1": 0.721, + "sa-east-1": 1.096, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.827, + "us-gov-west-1": 0.827, + "us-west-1": 0.757, + "us-west-2": 0.686 + }, + "i4i.4xlarge": { + "af-south-1": 1.804, + "ap-east-1": 1.813, + "ap-northeast-1": 1.61, + "ap-northeast-2": 1.61, + "ap-northeast-3": 1.61, + "ap-south-1": 1.558, + "ap-south-2": 0.0, + "ap-southeast-1": 1.646, + "ap-southeast-2": 1.646, + "ap-southeast-3": 1.646, + "ap-southeast-4": 1.81, + "ap-southeast-5": 1.481, + "ap-southeast-7": 1.629, + "ca-central-1": 1.514, + "ca-west-1": 1.514, + "eu-central-1": 1.8, + "eu-central-2": 1.981, + "eu-north-1": 1.578, + "eu-south-1": 1.593, + "eu-west-1": 1.665, + "eu-west-2": 1.752, + "eu-west-3": 0.0, + "il-central-1": 1.589, + "me-central-1": 1.83, + "me-south-1": 0.0, + "mx-central-1": 1.441, + "sa-east-1": 2.191, + "us-east-1": 1.373, + "us-east-2": 1.373, + "us-gov-east-1": 1.82, + "us-gov-west-1": 0.0, + "us-west-1": 1.514, + "us-west-2": 0.0 + }, + "i4i.8xlarge": { + "af-south-1": 3.608, + "ap-east-1": 3.988, + "ap-northeast-1": 3.221, + "ap-northeast-2": 3.221, + "ap-northeast-3": 3.543, + "ap-south-1": 3.115, + "ap-south-2": 3.115, + "ap-southeast-1": 3.291, + "ap-southeast-2": 0.0, + "ap-southeast-3": 3.62, + "ap-southeast-4": 3.291, + "ap-southeast-5": 2.962, + "ap-southeast-7": 0.0, + "ca-central-1": 3.33, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 3.601, + "eu-north-1": 2.869, + "eu-south-1": 0.0, + "eu-west-1": 3.027, + "eu-west-2": 3.504, + "eu-west-3": 3.504, + "il-central-1": 3.179, + "me-central-1": 3.326, + "me-south-1": 3.659, + "mx-central-1": 2.883, + "sa-east-1": 4.382, + "us-east-1": 0.0, + "us-east-2": 2.746, + "us-gov-east-1": 3.309, + "us-gov-west-1": 3.309, + "us-west-1": 0.0, + "us-west-2": 3.02 + }, + "i4i.12xlarge": { + "af-south-1": 5.412, + "ap-east-1": 5.438, + "ap-northeast-1": 4.831, + "ap-northeast-2": 5.314, + "ap-northeast-3": 4.831, + "ap-south-1": 4.673, + "ap-south-2": 4.673, + "ap-southeast-1": 4.937, + "ap-southeast-2": 0.0, + "ap-southeast-3": 5.43, + "ap-southeast-4": 5.43, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 4.541, + "ca-west-1": 0.0, + "eu-central-1": 4.91, + "eu-central-2": 0.0, + "eu-north-1": 4.303, + "eu-south-1": 4.778, + "eu-west-1": 4.995, + "eu-west-2": 4.778, + "eu-west-3": 4.778, + "me-central-1": 5.489, + "me-south-1": 5.489, + "mx-central-1": 4.757, + "sa-east-1": 6.574, + "us-east-1": 4.53, + "us-east-2": 4.118, + "us-gov-east-1": 4.963, + "us-gov-west-1": 5.46, + "us-west-1": 4.541, + "us-west-2": 4.53 + }, + "i4i.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 7.976, + "ap-northeast-1": 0.0, + "ap-northeast-2": 6.442, + "ap-northeast-3": 7.086, + "ap-south-1": 6.23, + "ap-south-2": 6.23, + "ap-southeast-1": 0.0, + "ap-southeast-2": 7.241, + "ap-southeast-3": 0.0, + "ap-southeast-4": 6.582, + "ap-southeast-5": 5.924, + "ap-southeast-7": 6.517, + "ca-central-1": 6.054, + "ca-west-1": 6.054, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 6.371, + "eu-west-1": 6.66, + "eu-west-2": 6.371, + "eu-west-3": 7.008, + "il-central-1": 6.357, + "me-central-1": 7.318, + "me-south-1": 6.653, + "mx-central-1": 5.766, + "sa-east-1": 8.765, + "us-east-1": 5.491, + "us-east-2": 5.491, + "us-gov-east-1": 7.279, + "us-gov-west-1": 6.618, + "us-west-1": 6.054, + "us-west-2": 6.04 + }, + "i4i.24xlarge": { + "af-south-1": 10.824, + "ap-east-1": 10.8768, + "ap-northeast-1": 9.6624, + "ap-northeast-2": 9.6624, + "ap-northeast-3": 9.6624, + "ap-south-1": 9.3456, + "ap-south-2": 9.3456, + "ap-southeast-1": 10.86096, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 9.77486, + "ap-southeast-7": 0.0, + "ca-central-1": 9.0816, + "ca-west-1": 9.98976, + "eu-central-1": 9.8208, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 9.5568, + "eu-west-1": 9.0816, + "eu-west-2": 9.5568, + "eu-west-3": 0.0, + "me-central-1": 9.9792, + "me-south-1": 9.9792, + "mx-central-1": 8.64864, + "sa-east-1": 13.1472, + "us-east-1": 8.2368, + "us-east-2": 0.0, + "us-gov-east-1": 10.91904, + "us-gov-west-1": 0.0, + "us-west-1": 9.0816, + "us-west-2": 0.0 + }, + "i4i.32xlarge": { + "af-south-1": 0.0, + "ap-east-1": 14.5024, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 12.8832, + "ap-south-1": 12.4608, + "ap-south-2": 12.4608, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 13.1648, + "ap-southeast-4": 13.1648, + "ap-southeast-5": 11.84832, + "ap-southeast-7": 11.84832, + "ca-central-1": 12.1088, + "ca-west-1": 0.0, + "eu-central-1": 13.0944, + "eu-central-2": 14.40384, + "eu-north-1": 11.4752, + "eu-south-1": 12.7424, + "eu-west-1": 12.1088, + "eu-west-2": 0.0, + "eu-west-3": 12.7424, + "il-central-1": 12.71424, + "me-central-1": 13.3056, + "me-south-1": 13.3056, + "mx-central-1": 11.53152, + "sa-east-1": 17.5296, + "us-east-1": 10.9824, + "us-east-2": 10.9824, + "us-gov-east-1": 13.2352, + "us-gov-west-1": 0.0, + "us-west-1": 12.1088, + "us-west-2": 10.9824 + }, + "i7ie": { + "ap-northeast-1": 32.303, + "eu-central-1": 32.789, + "eu-west-2": 31.939, + "us-east-1": 27.445, + "us-east-2": 27.445, + "us-west-2": 27.445 + }, + "i7ie.large": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.3105, + "eu-west-2": 0.3025, + "us-east-1": 0.2768, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "i7ie.xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-2": 0.6049, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.5535 + }, + "i7ie.2xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 1.242, + "eu-west-2": 1.2098, + "us-east-1": 0.0, + "us-east-2": 1.0396, + "us-west-2": 1.0396 + }, + "i7ie.3xlarge": { + "ap-northeast-1": 1.8354, + "eu-central-1": 1.9841, + "eu-west-2": 0.0, + "us-east-1": 1.5594, + "us-east-2": 1.5594, + "us-west-2": 0.0 + }, + "i7ie.6xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 3.726, + "eu-west-2": 3.6294, + "us-east-1": 0.0, + "us-east-2": 3.1188, + "us-west-2": 3.1188 + }, + "i7ie.12xlarge": { + "ap-northeast-1": 7.3416, + "eu-central-1": 7.9366, + "eu-west-2": 7.2588, + "us-east-1": 6.2376, + "us-east-2": 6.6422, + "us-west-2": 6.2376 + }, + "i7ie.18xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 11.178, + "eu-west-2": 10.8882, + "us-east-1": 9.3564, + "us-east-2": 9.9633, + "us-west-2": 9.9633 + }, + "i7ie.24xlarge": { + "ap-northeast-1": 14.6832, + "eu-central-1": 14.904, + "eu-west-2": 15.4628, + "us-east-1": 0.0, + "us-east-2": 13.2844, + "us-west-2": 12.4752 + }, + "i7ie.48xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 29.808, + "eu-west-2": 0.0, + "us-east-1": 24.9504, + "us-east-2": 0.0, + "us-west-2": 24.9504 + }, + "i8g": { + "eu-central-1": 21.606, + "us-east-1": 18.121, + "us-west-2": 18.121 + }, + "i8g.large": { + "eu-central-1": 0.0, + "us-east-1": 0.1716, + "us-west-2": 0.1716 + }, + "i8g.xlarge": { + "eu-central-1": 0.4092, + "us-east-1": 0.0, + "us-west-2": 0.3432 + }, + "i8g.metal-24xl": { + "eu-central-1": 9.8208, + "us-east-1": 9.06048, + "us-west-2": 0.0 + }, + "i8g.2xlarge": { + "eu-central-1": 0.0, + "us-east-1": 0.755, + "us-west-2": 0.6864 + }, + "i8g.4xlarge": { + "eu-central-1": 1.6368, + "us-east-1": 1.5101, + "us-west-2": 1.3728 + }, + "i8g.8xlarge": { + "eu-central-1": 3.601, + "us-east-1": 3.0202, + "us-west-2": 2.7456 + }, + "i8g.12xlarge": { + "eu-central-1": 4.9104, + "us-east-1": 4.53024, + "us-west-2": 4.1184 + }, + "i8g.16xlarge": { + "eu-central-1": 6.5472, + "us-east-1": 5.4912, + "us-west-2": 5.4912 + }, + "i8g.24xlarge": { + "eu-central-1": 9.8208, + "us-east-1": 0.0, + "us-west-2": 8.2368 + }, + "im4gn.large": { + "ap-northeast-1": 0.21338, + "ap-southeast-1": 0.21804, + "ap-southeast-2": 0.21804, + "ca-central-1": 0.0, + "eu-central-1": 0.21688, + "eu-south-2": 0.22061, + "eu-west-1": 0.20055, + "eu-west-2": 0.0, + "eu-west-3": 0.21105, + "us-east-1": 0.0, + "us-east-2": 0.1819, + "us-west-2": 0.1819 + }, + "im4gn.xlarge": { + "ap-northeast-1": 0.42676, + "ap-southeast-1": 0.43608, + "ap-southeast-2": 0.43608, + "ca-central-1": 0.4011, + "eu-central-1": 0.43375, + "eu-south-2": 0.4011, + "eu-west-1": 0.4011, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "us-east-1": 0.36379, + "us-east-2": 0.36379, + "us-west-2": 0.40017 + }, + "im4gn.2xlarge": { + "ap-northeast-1": 0.85351, + "ap-southeast-1": 0.87217, + "ap-southeast-2": 0.87217, + "ca-central-1": 0.88243, + "eu-central-1": 0.95425, + "eu-south-2": 0.0, + "eu-west-1": 0.80221, + "eu-west-2": 0.84418, + "eu-west-3": 0.9286, + "us-east-1": 0.72758, + "us-east-2": 0.72758, + "us-west-2": 0.72758 + }, + "im4gn.4xlarge": { + "ap-northeast-1": 1.70702, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.74434, + "ca-central-1": 1.60442, + "eu-central-1": 1.73501, + "eu-south-2": 0.0, + "eu-west-1": 1.60442, + "eu-west-2": 1.68837, + "eu-west-3": 1.68837, + "us-east-1": 1.45517, + "us-east-2": 1.60068, + "us-west-2": 1.60068 + }, + "im4gn.8xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 3.48867, + "ap-southeast-2": 3.48867, + "ca-central-1": 0.0, + "eu-central-1": 3.81702, + "eu-south-2": 3.2088, + "eu-west-1": 0.0, + "eu-west-2": 3.37674, + "eu-west-3": 3.71441, + "us-east-1": 2.91034, + "us-east-2": 2.91034, + "us-west-2": 2.91034 + }, + "im4gn.16xlarge": { + "ap-northeast-1": 6.8281, + "ap-southeast-1": 6.97734, + "ap-southeast-2": 6.97734, + "ca-central-1": 0.0, + "eu-central-1": 6.94003, + "eu-south-2": 6.4176, + "eu-west-1": 6.41766, + "eu-west-2": 0.0, + "eu-west-3": 6.75347, + "us-east-1": 5.82067, + "us-east-2": 5.82067, + "us-west-2": 5.82067 + }, + "inf1.xlarge": { + "af-south-1": 0.302, + "ap-east-1": 0.352, + "ap-northeast-1": 0.308, + "ap-northeast-2": 0.281, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.285, + "ca-central-1": 0.254, + "eu-central-1": 0.302, + "eu-north-1": 0.0, + "eu-south-1": 0.267, + "eu-west-1": 0.0, + "eu-west-2": 0.267, + "eu-west-3": 0.0, + "me-south-1": 0.28, + "sa-east-1": 0.4, + "us-east-1": 0.242, + "us-east-2": 0.228, + "us-gov-east-1": 0.288, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "inf1.2xlarge": { + "ap-east-1": 0.591, + "ap-northeast-1": 0.489, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.381, + "ap-southeast-1": 0.518, + "ap-southeast-2": 0.453, + "ca-central-1": 0.403, + "eu-central-1": 0.48, + "eu-north-1": 0.385, + "eu-south-1": 0.424, + "eu-west-1": 0.403, + "eu-west-2": 0.449, + "eu-west-3": 0.423, + "me-south-1": 0.444, + "sa-east-1": 0.598, + "us-east-1": 0.362, + "us-east-2": 0.0, + "us-gov-east-1": 0.484, + "us-gov-west-1": 0.456, + "us-west-1": 0.435, + "us-west-2": 0.362 + }, + "inf1.6xlarge": { + "ap-east-1": 1.819, + "ap-northeast-1": 1.69, + "ap-northeast-2": 1.453, + "ap-northeast-3": 0.0, + "ap-south-1": 1.316, + "ap-southeast-1": 1.594, + "ap-southeast-2": 1.475, + "ca-central-1": 1.315, + "eu-central-1": 1.475, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 1.382, + "eu-west-3": 1.379, + "me-south-1": 0.0, + "sa-east-1": 1.95, + "us-east-1": 1.18, + "us-east-2": 0.0, + "us-gov-east-1": 1.488, + "us-gov-west-1": 1.488, + "us-west-1": 1.503, + "us-west-2": 0.0 + }, + "inf1.24xlarge": { + "af-south-1": 6.249, + "ap-east-1": 0.0, + "ap-northeast-1": 6.376, + "ap-northeast-2": 5.812, + "ap-northeast-3": 0.0, + "ap-south-1": 4.965, + "ap-southeast-1": 6.376, + "ap-southeast-2": 5.902, + "ca-central-1": 5.26, + "eu-central-1": 0.0, + "eu-north-1": 5.016, + "eu-south-1": 5.889, + "eu-west-1": 0.0, + "eu-west-2": 5.53, + "eu-west-3": 0.0, + "me-south-1": 5.786, + "sa-east-1": 0.0, + "us-east-1": 5.005, + "us-east-2": 4.721, + "us-gov-east-1": 5.953, + "us-gov-west-1": 5.953, + "us-west-1": 0.0, + "us-west-2": 4.721 + }, + "inf2.xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 1.08423, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.98566, + "eu-central-1": 1.1373, + "eu-north-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 1.1373, + "eu-west-3": 1.06148, + "sa-east-1": 1.28894, + "us-east-1": 0.7582, + "us-east-2": 0.83402, + "us-west-2": 0.7582 + }, + "inf2.8xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 2.55822, + "ap-southeast-1": 3.0305, + "ap-southeast-2": 2.55822, + "eu-central-1": 2.95179, + "eu-north-1": 2.16465, + "eu-west-1": 2.70581, + "eu-west-2": 2.95179, + "eu-west-3": 0.0, + "sa-east-1": 3.34536, + "us-east-1": 1.96786, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "inf2.24xlarge": { + "ap-northeast-1": 9.73595, + "ap-south-1": 8.43782, + "ap-southeast-1": 9.08689, + "ap-southeast-2": 8.43782, + "eu-central-1": 9.73595, + "eu-north-1": 7.1397, + "eu-west-1": 8.92462, + "eu-west-2": 0.0, + "eu-west-3": 9.08689, + "sa-east-1": 11.03408, + "us-east-1": 6.49063, + "us-east-2": 6.49063, + "us-west-2": 7.1397 + }, + "inf2.48xlarge": { + "ap-northeast-1": 19.4719, + "ap-south-1": 16.87565, + "ap-southeast-1": 18.17377, + "ap-southeast-2": 16.87565, + "eu-central-1": 19.4719, + "eu-north-1": 14.27939, + "eu-west-1": 17.84924, + "eu-west-2": 21.41909, + "eu-west-3": 18.17377, + "sa-east-1": 22.06815, + "us-east-1": 14.27939, + "us-east-2": 12.98127, + "us-west-2": 0.0 + }, + "is4gen.medium": { + "ap-northeast-1": 0.16958, + "ap-south-1": 0.16375, + "ap-southeast-1": 0.17276, + "ap-southeast-2": 0.17276, + "ca-central-1": 0.15938, + "eu-central-1": 0.17213, + "eu-west-1": 0.15938, + "eu-west-2": 0.16766, + "eu-west-3": 0.16766, + "us-east-1": 0.14408, + "us-east-2": 0.14408, + "us-west-2": 0.14408 + }, + "is4gen.large": { + "ap-northeast-1": 0.33915, + "ap-south-1": 0.3275, + "ap-southeast-1": 0.34553, + "ap-southeast-2": 0.34553, + "ca-central-1": 0.31875, + "eu-central-1": 0.34425, + "eu-west-1": 0.31875, + "eu-west-2": 0.33533, + "eu-west-3": 0.33533, + "us-east-1": 0.28815, + "us-east-2": 0.28815, + "us-west-2": 0.28815 + }, + "is4gen.xlarge": { + "ap-northeast-1": 0.6783, + "ap-south-1": 0.655, + "ap-southeast-1": 0.69105, + "ap-southeast-2": 0.69105, + "ca-central-1": 0.6375, + "eu-central-1": 0.6885, + "eu-west-1": 0.6375, + "eu-west-2": 0.67065, + "eu-west-3": 0.67065, + "us-east-1": 0.5763, + "us-east-2": 0.5763, + "us-west-2": 0.5763 + }, + "is4gen.2xlarge": { + "ap-northeast-1": 1.3566, + "ap-south-1": 1.31, + "ap-southeast-1": 1.3821, + "ap-southeast-2": 1.3821, + "ca-central-1": 1.275, + "eu-central-1": 1.377, + "eu-west-1": 1.275, + "eu-west-2": 1.3413, + "eu-west-3": 1.3413, + "us-east-1": 1.1526, + "us-east-2": 1.1526, + "us-west-2": 1.1526 + }, + "is4gen.4xlarge": { + "ap-northeast-1": 2.7132, + "ap-south-1": 2.62, + "ap-southeast-1": 2.76421, + "ap-southeast-2": 2.76421, + "ca-central-1": 2.55, + "eu-central-1": 2.754, + "eu-west-1": 2.55, + "eu-west-2": 2.68261, + "eu-west-3": 2.68261, + "us-east-1": 2.3052, + "us-east-2": 2.3052, + "us-west-2": 2.3052 + }, + "is4gen.8xlarge": { + "ap-northeast-1": 5.4264, + "ap-south-1": 5.24, + "ap-southeast-1": 5.52842, + "ap-southeast-2": 5.52842, + "ca-central-1": 5.1, + "eu-central-1": 5.508, + "eu-west-1": 5.1, + "eu-west-2": 5.36522, + "eu-west-3": 5.36522, + "us-east-1": 4.6104, + "us-east-2": 4.6104, + "us-west-2": 4.6104 + }, + "m1.small": { + "ap-northeast-1": 0.061, + "ap-southeast-1": 0.058, + "ap-southeast-2": 0.058, + "eu-west-1": 0.047, + "sa-east-1": 0.058, + "us-east-1": 0.044, + "us-gov-west-1": 0.053, + "us-west-1": 0.047, + "us-west-2": 0.044 + }, + "m1.medium": { + "ap-northeast-1": 0.122, + "ap-southeast-1": 0.117, + "ap-southeast-2": 0.117, + "eu-west-1": 0.095, + "sa-east-1": 0.117, + "us-east-1": 0.087, + "us-gov-west-1": 0.106, + "us-west-1": 0.095, + "us-west-2": 0.087 + }, + "m1.large": { + "ap-northeast-1": 0.243, + "ap-southeast-1": 0.233, + "ap-southeast-2": 0.233, + "eu-west-1": 0.19, + "sa-east-1": 0.233, + "us-east-1": 0.175, + "us-gov-west-1": 0.211, + "us-west-1": 0.19, + "us-west-2": 0.175 + }, + "m1.xlarge": { + "ap-northeast-1": 0.486, + "ap-southeast-1": 0.467, + "ap-southeast-2": 0.467, + "eu-west-1": 0.379, + "sa-east-1": 0.467, + "us-east-1": 0.35, + "us-gov-west-1": 0.423, + "us-west-1": 0.379, + "us-west-2": 0.35 + }, + "m2.xlarge": { + "ap-northeast-1": 0.287, + "ap-southeast-1": 0.296, + "ap-southeast-2": 0.296, + "eu-west-1": 0.275, + "sa-east-1": 0.323, + "us-east-1": 0.245, + "us-gov-west-1": 0.293, + "us-west-1": 0.275, + "us-west-2": 0.245 + }, + "m2.2xlarge": { + "ap-northeast-1": 0.575, + "ap-southeast-1": 0.592, + "ap-southeast-2": 0.592, + "eu-west-1": 0.55, + "sa-east-1": 0.645, + "us-east-1": 0.49, + "us-gov-west-1": 0.586, + "us-west-1": 0.55, + "us-west-2": 0.49 + }, + "m2.4xlarge": { + "ap-northeast-1": 1.15, + "ap-southeast-1": 1.183, + "ap-southeast-2": 1.183, + "eu-west-1": 1.1, + "sa-east-1": 1.291, + "us-east-1": 0.98, + "us-gov-west-1": 1.171, + "us-west-1": 1.1, + "us-west-2": 0.98 + }, + "m3.medium": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.098, + "ap-southeast-2": 0.093, + "eu-central-1": 0.0, + "eu-west-1": 0.073, + "sa-east-1": 0.105, + "us-east-1": 0.074, + "us-gov-west-1": 0.084, + "us-west-1": 0.085, + "us-west-2": 0.0 + }, + "m3.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.201685, + "ap-southeast-1": 0.196, + "ap-southeast-2": 0.186, + "eu-central-1": 0.0, + "eu-west-1": 0.146, + "sa-east-1": 0.19, + "us-east-1": 0.133, + "us-gov-west-1": 0.168, + "us-west-1": 0.169, + "us-west-2": 0.133 + }, + "m3.xlarge": { + "ap-northeast-1": 0.385, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.431, + "ap-southeast-2": 0.0, + "eu-central-1": 0.315, + "eu-west-1": 0.0, + "sa-east-1": 0.419, + "us-east-1": 0.266, + "us-gov-west-1": 0.336, + "us-west-1": 0.308, + "us-west-2": 0.293 + }, + "m3.2xlarge": { + "ap-northeast-1": 0.847, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.862, + "ap-southeast-2": 0.82, + "eu-central-1": 0.632, + "eu-west-1": 0.585, + "sa-east-1": 0.837, + "us-east-1": 0.0, + "us-gov-west-1": 0.672, + "us-west-1": 0.678, + "us-west-2": 0.585 + }, + "m4.large": { + "ap-northeast-1": 0.129, + "ap-northeast-2": 0.1353, + "ap-northeast-3": 0.0, + "ap-south-1": 0.105, + "ap-southeast-1": 0.125, + "ap-southeast-2": 0.125, + "ca-central-1": 0.111, + "eu-central-1": 0.12, + "eu-west-1": 0.111, + "eu-west-2": 0.116, + "sa-east-1": 0.159, + "us-east-1": 0.1, + "us-east-2": 0.1, + "us-gov-west-1": 0.126, + "us-west-1": 0.117, + "us-west-2": 0.1 + }, + "m4.xlarge": { + "ap-northeast-1": 0.258, + "ap-northeast-2": 0.246, + "ap-northeast-3": 0.0, + "ap-south-1": 0.21, + "ap-southeast-1": 0.275, + "ap-southeast-2": 0.25, + "ca-central-1": 0.222, + "eu-central-1": 0.24, + "eu-west-1": 0.0, + "eu-west-2": 0.232, + "sa-east-1": 0.0, + "us-east-1": 0.2, + "us-east-2": 0.2, + "us-gov-west-1": 0.0, + "us-west-1": 0.234, + "us-west-2": 0.2 + }, + "m4.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.5412, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.5, + "ap-southeast-2": 0.55, + "ca-central-1": 0.444, + "eu-central-1": 0.528, + "eu-west-1": 0.444, + "eu-west-2": 0.464, + "sa-east-1": 0.636, + "us-east-1": 0.4, + "us-east-2": 0.4, + "us-gov-west-1": 0.0, + "us-west-1": 0.5148, + "us-west-2": 0.44 + }, + "m4.4xlarge": { + "ap-northeast-1": 1.1352, + "ap-northeast-2": 1.0824, + "ap-northeast-3": 1.032, + "ap-south-1": 0.0, + "ap-southeast-1": 1.0, + "ap-southeast-2": 0.0, + "ca-central-1": 0.888, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "sa-east-1": 1.272, + "us-east-1": 0.8, + "us-east-2": 0.8, + "us-gov-west-1": 1.008, + "us-west-1": 0.936, + "us-west-2": 0.8 + }, + "m4.10xlarge": { + "ap-northeast-1": 2.58, + "ap-northeast-2": 2.46, + "ap-south-1": 2.1, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.5, + "ca-central-1": 2.22, + "eu-central-1": 2.4, + "eu-west-1": 0.0, + "eu-west-2": 2.32, + "sa-east-1": 3.18, + "us-east-1": 2.0, + "us-east-2": 0.0, + "us-gov-west-1": 2.52, + "us-west-1": 2.34, + "us-west-2": 2.0 + }, + "m4.16xlarge": { + "ap-northeast-1": 4.128, + "ap-northeast-2": 3.936, + "ap-northeast-3": 0.0, + "ap-south-1": 3.36, + "ap-southeast-1": 4.0, + "ap-southeast-2": 0.0, + "ca-central-1": 3.552, + "eu-central-1": 3.84, + "eu-west-1": 3.552, + "eu-west-2": 3.712, + "sa-east-1": 5.088, + "us-east-1": 3.2, + "us-east-2": 3.2, + "us-gov-west-1": 4.032, + "us-west-1": 3.744, + "us-west-2": 3.2 + }, + "m5.large": { + "af-south-1": 0.135, + "ap-east-1": 0.14, + "ap-northeast-1": 0.124, + "ap-northeast-2": 0.118, + "ap-northeast-3": 0.124, + "ap-south-1": 0.0, + "ap-south-2": 0.101, + "ap-southeast-1": 0.12, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 0.107, + "ca-west-1": 0.107, + "eu-central-1": 0.115, + "eu-central-2": 0.0, + "eu-north-1": 0.102, + "eu-south-1": 0.112, + "eu-south-2": 0.107, + "eu-west-1": 0.114, + "eu-west-2": 0.111, + "eu-west-3": 0.112, + "il-central-1": 0.124, + "me-central-1": 0.118, + "me-south-1": 0.126, + "sa-east-1": 0.153, + "us-east-1": 0.096, + "us-east-2": 0.096, + "us-gov-east-1": 0.121, + "us-gov-west-1": 0.129, + "us-west-1": 0.112, + "us-west-2": 0.102, + "us-west-2-lax-1": 0.0 + }, + "m5.xlarge": { + "af-south-1": 0.254, + "ap-east-1": 0.264, + "ap-northeast-1": 0.248, + "ap-northeast-2": 0.236, + "ap-northeast-3": 0.248, + "ap-south-1": 0.202, + "ap-south-2": 0.202, + "ap-southeast-1": 0.255, + "ap-southeast-2": 0.24, + "ap-southeast-3": 0.24, + "ap-southeast-4": 0.24, + "ca-central-1": 0.214, + "ca-west-1": 0.235, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.204, + "eu-south-1": 0.224, + "eu-south-2": 0.214, + "eu-west-1": 0.0, + "eu-west-2": 0.222, + "eu-west-3": 0.224, + "il-central-1": 0.225, + "me-central-1": 0.25, + "me-south-1": 0.235, + "sa-east-1": 0.323, + "us-east-1": 0.0, + "us-east-2": 0.204, + "us-gov-east-1": 0.258, + "us-gov-west-1": 0.258, + "us-west-1": 0.224, + "us-west-2": 0.192, + "us-west-2-lax-1": 0.0 + }, + "m5.metal": { + "af-south-1": 6.096, + "ap-east-1": 6.336, + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.664, + "ap-northeast-3": 5.952, + "ap-south-1": 4.848, + "ap-south-2": 4.848, + "ap-southeast-1": 5.76, + "ap-southeast-2": 5.76, + "ap-southeast-3": 5.76, + "ap-southeast-4": 5.76, + "ca-central-1": 5.136, + "ca-west-1": 5.136, + "eu-central-1": 5.52, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 5.376, + "eu-south-2": 5.136, + "eu-west-1": 0.0, + "eu-west-2": 5.328, + "eu-west-3": 5.376, + "il-central-1": 5.393, + "me-central-1": 5.65, + "me-south-1": 5.65, + "sa-east-1": 0.0, + "us-east-1": 4.608, + "us-east-2": 4.608, + "us-gov-east-1": 5.808, + "us-gov-west-1": 5.808, + "us-west-1": 5.376, + "us-west-2": 4.608, + "us-west-2-lax-1": 0.0 + }, + "m5.2xlarge": { + "af-south-1": 0.538, + "ap-east-1": 0.528, + "ap-northeast-1": 0.496, + "ap-northeast-2": 0.472, + "ap-northeast-3": 0.526, + "ap-south-1": 0.0, + "ap-south-2": 0.428, + "ap-southeast-1": 0.48, + "ap-southeast-2": 0.48, + "ap-southeast-3": 0.48, + "ap-southeast-4": 0.48, + "ca-central-1": 0.454, + "ca-west-1": 0.428, + "eu-central-1": 0.46, + "eu-central-2": 0.506, + "eu-north-1": 0.435, + "eu-south-1": 0.448, + "eu-south-2": 0.428, + "eu-west-1": 0.428, + "eu-west-2": 0.444, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 0.471, + "me-south-1": 0.502, + "sa-east-1": 0.0, + "us-east-1": 0.384, + "us-east-2": 0.384, + "us-gov-east-1": 0.516, + "us-gov-west-1": 0.0, + "us-west-1": 0.448, + "us-west-2": 0.407, + "us-west-2-lax-1": 0.461 + }, + "m5.4xlarge": { + "af-south-1": 1.077, + "ap-east-1": 1.056, + "ap-northeast-1": 1.058, + "ap-northeast-2": 0.944, + "ap-northeast-3": 0.992, + "ap-south-1": 0.0, + "ap-south-2": 0.808, + "ap-southeast-1": 0.96, + "ap-southeast-2": 1.023, + "ap-southeast-3": 0.96, + "ap-southeast-4": 0.96, + "ca-central-1": 0.856, + "ca-west-1": 0.856, + "eu-central-1": 0.92, + "eu-central-2": 1.012, + "eu-north-1": 0.871, + "eu-south-1": 0.95, + "eu-south-2": 0.907, + "eu-west-1": 0.913, + "eu-west-2": 0.947, + "eu-west-3": 0.896, + "il-central-1": 0.989, + "me-central-1": 0.0, + "me-south-1": 1.005, + "sa-east-1": 1.224, + "us-east-1": 0.768, + "us-east-2": 0.768, + "us-gov-east-1": 0.968, + "us-gov-west-1": 1.031, + "us-west-1": 0.96, + "us-west-2": 0.768, + "us-west-2-lax-1": 0.922 + }, + "m5.8xlarge": { + "af-south-1": 2.032, + "ap-east-1": 0.0, + "ap-northeast-1": 1.984, + "ap-northeast-2": 2.0, + "ap-northeast-3": 1.984, + "ap-south-1": 1.715, + "ap-south-2": 1.713, + "ap-southeast-1": 1.92, + "ap-southeast-2": 1.92, + "ap-southeast-3": 1.92, + "ap-southeast-4": 1.92, + "ca-central-1": 1.815, + "ca-west-1": 0.0, + "eu-central-1": 1.965, + "eu-central-2": 2.024, + "eu-north-1": 1.632, + "eu-south-1": 1.9, + "eu-south-2": 1.712, + "eu-west-1": 1.712, + "eu-west-2": 1.776, + "eu-west-3": 1.912, + "il-central-1": 1.798, + "me-central-1": 1.883, + "me-south-1": 1.883, + "sa-east-1": 2.448, + "us-east-1": 1.536, + "us-east-2": 0.0, + "us-gov-east-1": 1.936, + "us-gov-west-1": 1.936, + "us-west-1": 1.792, + "us-west-2": 1.536, + "us-west-2-lax-1": 1.955 + }, + "m5.12xlarge": { + "af-south-1": 3.048, + "ap-east-1": 3.168, + "ap-northeast-1": 2.976, + "ap-northeast-2": 3.0, + "ap-northeast-3": 0.0, + "ap-south-1": 2.424, + "ap-south-2": 0.0, + "ap-southeast-1": 2.88, + "ap-southeast-2": 2.88, + "ap-southeast-3": 2.88, + "ap-southeast-4": 0.0, + "ca-central-1": 2.568, + "ca-west-1": 2.568, + "eu-central-1": 2.947, + "eu-central-2": 3.218, + "eu-north-1": 2.448, + "eu-south-1": 2.688, + "eu-south-2": 0.0, + "eu-west-1": 2.568, + "eu-west-2": 2.664, + "eu-west-3": 2.688, + "il-central-1": 2.696, + "me-central-1": 2.994, + "me-south-1": 2.825, + "sa-east-1": 0.0, + "us-east-1": 2.304, + "us-east-2": 2.304, + "us-gov-east-1": 2.904, + "us-gov-west-1": 2.904, + "us-west-1": 2.688, + "us-west-2": 2.304, + "us-west-2-lax-1": 2.932 + }, + "m5.16xlarge": { + "af-south-1": 4.064, + "ap-east-1": 4.484, + "ap-northeast-1": 3.968, + "ap-northeast-2": 4.0, + "ap-northeast-3": 3.968, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 3.84, + "ap-southeast-2": 3.84, + "ap-southeast-3": 3.84, + "ap-southeast-4": 0.0, + "ca-central-1": 3.424, + "ca-west-1": 3.424, + "eu-central-1": 3.68, + "eu-central-2": 4.048, + "eu-north-1": 3.264, + "eu-south-1": 3.584, + "eu-south-2": 3.424, + "eu-west-1": 3.424, + "eu-west-2": 3.552, + "eu-west-3": 3.824, + "il-central-1": 3.595, + "me-central-1": 3.766, + "me-south-1": 3.766, + "sa-east-1": 5.171, + "us-east-1": 3.259, + "us-east-2": 3.072, + "us-gov-east-1": 3.872, + "us-gov-west-1": 3.872, + "us-west-1": 3.84, + "us-west-2": 3.259, + "us-west-2-lax-1": 3.91 + }, + "m5.24xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 5.952, + "ap-northeast-2": 5.664, + "ap-northeast-3": 5.952, + "ap-south-1": 4.848, + "ap-south-2": 4.848, + "ap-southeast-1": 5.76, + "ap-southeast-2": 5.76, + "ap-southeast-3": 0.0, + "ap-southeast-4": 5.76, + "ca-central-1": 5.136, + "ca-west-1": 5.136, + "eu-central-1": 5.52, + "eu-central-2": 6.072, + "eu-north-1": 4.896, + "eu-south-1": 5.376, + "eu-south-2": 5.136, + "eu-west-1": 5.136, + "eu-west-2": 5.328, + "eu-west-3": 5.376, + "il-central-1": 5.393, + "me-central-1": 5.65, + "me-south-1": 5.65, + "sa-east-1": 7.344, + "us-east-1": 4.608, + "us-east-2": 4.608, + "us-gov-east-1": 0.0, + "us-gov-west-1": 5.808, + "us-west-1": 0.0, + "us-west-2": 4.608, + "us-west-2-lax-1": 5.53 + }, + "m5a.large": { + "ap-northeast-1": 0.112, + "ap-northeast-2": 0.106, + "ap-south-1": 0.056, + "ap-southeast-1": 0.108, + "ap-southeast-2": 0.108, + "ca-central-1": 0.096, + "eu-central-1": 0.104, + "eu-south-1": 0.101, + "eu-west-1": 0.096, + "eu-west-2": 0.1, + "eu-west-3": 0.101, + "sa-east-1": 0.138, + "us-east-1": 0.086, + "us-east-2": 0.086, + "us-gov-east-1": 0.109, + "us-gov-west-1": 0.109, + "us-west-1": 0.101, + "us-west-2": 0.086 + }, + "m5a.xlarge": { + "ap-northeast-1": 0.224, + "ap-northeast-2": 0.212, + "ap-south-1": 0.111, + "ap-southeast-1": 0.216, + "ap-southeast-2": 0.216, + "ca-central-1": 0.192, + "eu-central-1": 0.208, + "eu-south-1": 0.202, + "eu-west-1": 0.192, + "eu-west-2": 0.2, + "eu-west-3": 0.202, + "sa-east-1": 0.276, + "us-east-1": 0.172, + "us-east-2": 0.172, + "us-gov-east-1": 0.218, + "us-gov-west-1": 0.218, + "us-west-1": 0.202, + "us-west-2": 0.172 + }, + "m5a.2xlarge": { + "ap-northeast-1": 0.448, + "ap-northeast-2": 0.424, + "ap-south-1": 0.222, + "ap-southeast-1": 0.432, + "ap-southeast-2": 0.432, + "ca-central-1": 0.384, + "eu-central-1": 0.416, + "eu-south-1": 0.404, + "eu-west-1": 0.384, + "eu-west-2": 0.4, + "eu-west-3": 0.404, + "sa-east-1": 0.552, + "us-east-1": 0.344, + "us-east-2": 0.344, + "us-gov-east-1": 0.436, + "us-gov-west-1": 0.436, + "us-west-1": 0.404, + "us-west-2": 0.344 + }, + "m5a.4xlarge": { + "ap-northeast-1": 0.896, + "ap-northeast-2": 0.848, + "ap-south-1": 0.444, + "ap-southeast-1": 0.864, + "ap-southeast-2": 0.864, + "ca-central-1": 0.768, + "eu-central-1": 0.832, + "eu-south-1": 0.808, + "eu-west-1": 0.768, + "eu-west-2": 0.8, + "eu-west-3": 0.808, + "sa-east-1": 1.104, + "us-east-1": 0.688, + "us-east-2": 0.688, + "us-gov-east-1": 0.872, + "us-gov-west-1": 0.872, + "us-west-1": 0.808, + "us-west-2": 0.688 + }, + "m5a.8xlarge": { + "ap-northeast-1": 1.792, + "ap-northeast-2": 1.696, + "ap-south-1": 0.889, + "ap-southeast-1": 1.728, + "ap-southeast-2": 1.728, + "ca-central-1": 1.536, + "eu-central-1": 1.664, + "eu-south-1": 1.616, + "eu-west-1": 1.536, + "eu-west-2": 1.6, + "eu-west-3": 1.616, + "sa-east-1": 2.208, + "us-east-1": 1.376, + "us-east-2": 1.376, + "us-gov-east-1": 1.744, + "us-gov-west-1": 1.744, + "us-west-1": 1.616, + "us-west-2": 1.376 + }, + "m5a.12xlarge": { + "ap-northeast-1": 2.688, + "ap-northeast-2": 2.544, + "ap-south-1": 1.333, + "ap-southeast-1": 2.592, + "ap-southeast-2": 2.592, + "ca-central-1": 2.304, + "eu-central-1": 2.496, + "eu-south-1": 2.424, + "eu-west-1": 2.304, + "eu-west-2": 2.4, + "eu-west-3": 2.424, + "sa-east-1": 3.312, + "us-east-1": 2.064, + "us-east-2": 2.064, + "us-gov-east-1": 2.616, + "us-gov-west-1": 2.616, + "us-west-1": 2.424, + "us-west-2": 2.064 + }, + "m5a.16xlarge": { + "ap-northeast-1": 3.584, + "ap-northeast-2": 3.392, + "ap-south-1": 1.778, + "ap-southeast-1": 3.456, + "ap-southeast-2": 3.456, + "ca-central-1": 3.072, + "eu-central-1": 3.328, + "eu-south-1": 3.232, + "eu-west-1": 3.072, + "eu-west-2": 3.2, + "eu-west-3": 3.232, + "sa-east-1": 4.416, + "us-east-1": 2.752, + "us-east-2": 2.752, + "us-gov-east-1": 3.488, + "us-gov-west-1": 3.488, + "us-west-1": 3.232, + "us-west-2": 2.752 + }, + "m5a.24xlarge": { + "ap-northeast-1": 5.376, + "ap-northeast-2": 5.088, + "ap-south-1": 2.666, + "ap-southeast-1": 5.184, + "ap-southeast-2": 5.184, + "ca-central-1": 4.608, + "eu-central-1": 4.992, + "eu-south-1": 4.848, + "eu-west-1": 4.608, + "eu-west-2": 4.8, + "eu-west-3": 4.848, + "sa-east-1": 6.624, + "us-east-1": 4.128, + "us-east-2": 4.128, + "us-gov-east-1": 5.232, + "us-gov-west-1": 5.232, + "us-west-1": 4.848, + "us-west-2": 4.128 + }, + "m5ad.large": { + "ap-northeast-1": 0.134, + "ap-northeast-2": 0.127, + "ap-south-1": 0.067, + "ap-southeast-1": 0.129, + "ap-southeast-2": 0.13, + "ca-central-1": 0.115, + "eu-central-1": 0.125, + "eu-west-1": 0.115, + "eu-west-2": 0.12, + "eu-west-3": 0.121, + "sa-east-1": 0.165, + "us-east-1": 0.103, + "us-east-2": 0.103, + "us-gov-west-1": 0.131, + "us-west-1": 0.122, + "us-west-2": 0.103 + }, + "m5ad.xlarge": { + "ap-northeast-1": 0.268, + "ap-northeast-2": 0.254, + "ap-south-1": 0.134, + "ap-southeast-1": 0.258, + "ap-southeast-2": 0.26, + "ca-central-1": 0.23, + "eu-central-1": 0.25, + "eu-west-1": 0.23, + "eu-west-2": 0.24, + "eu-west-3": 0.242, + "sa-east-1": 0.33, + "us-east-1": 0.206, + "us-east-2": 0.206, + "us-gov-west-1": 0.262, + "us-west-1": 0.244, + "us-west-2": 0.206 + }, + "m5ad.2xlarge": { + "ap-northeast-1": 0.536, + "ap-northeast-2": 0.508, + "ap-south-1": 0.268, + "ap-southeast-1": 0.516, + "ap-southeast-2": 0.52, + "ca-central-1": 0.46, + "eu-central-1": 0.5, + "eu-west-1": 0.46, + "eu-west-2": 0.48, + "eu-west-3": 0.484, + "sa-east-1": 0.66, + "us-east-1": 0.412, + "us-east-2": 0.412, + "us-gov-west-1": 0.524, + "us-west-1": 0.488, + "us-west-2": 0.412 + }, + "m5ad.4xlarge": { + "ap-northeast-1": 1.072, + "ap-northeast-2": 1.016, + "ap-south-1": 0.537, + "ap-southeast-1": 1.032, + "ap-southeast-2": 1.04, + "ca-central-1": 0.92, + "eu-central-1": 1.0, + "eu-west-1": 0.92, + "eu-west-2": 0.96, + "eu-west-3": 0.968, + "sa-east-1": 1.32, + "us-east-1": 0.824, + "us-east-2": 0.824, + "us-gov-west-1": 1.048, + "us-west-1": 0.976, + "us-west-2": 0.824 + }, + "m5ad.8xlarge": { + "ap-northeast-1": 2.144, + "ap-northeast-2": 2.032, + "ap-south-1": 1.074, + "ap-southeast-1": 2.064, + "ap-southeast-2": 2.08, + "ca-central-1": 1.84, + "eu-central-1": 2.0, + "eu-west-1": 1.84, + "eu-west-2": 1.92, + "eu-west-3": 1.936, + "sa-east-1": 2.64, + "us-east-1": 1.648, + "us-east-2": 1.648, + "us-gov-west-1": 2.096, + "us-west-1": 1.952, + "us-west-2": 1.648 + }, + "m5ad.12xlarge": { + "ap-northeast-1": 3.216, + "ap-northeast-2": 3.048, + "ap-south-1": 1.61, + "ap-southeast-1": 3.096, + "ap-southeast-2": 3.12, + "ca-central-1": 2.76, + "eu-central-1": 3.0, + "eu-west-1": 2.76, + "eu-west-2": 2.88, + "eu-west-3": 2.904, + "sa-east-1": 3.96, + "us-east-1": 2.472, + "us-east-2": 2.472, + "us-gov-west-1": 3.144, + "us-west-1": 2.928, + "us-west-2": 2.472 + }, + "m5ad.16xlarge": { + "ap-northeast-1": 4.288, + "ap-northeast-2": 4.064, + "ap-south-1": 2.147, + "ap-southeast-1": 4.128, + "ap-southeast-2": 4.16, + "ca-central-1": 3.68, + "eu-central-1": 4.0, + "eu-west-1": 3.68, + "eu-west-2": 3.84, + "eu-west-3": 3.872, + "sa-east-1": 5.28, + "us-east-1": 3.296, + "us-east-2": 3.296, + "us-gov-west-1": 4.192, + "us-west-1": 3.904, + "us-west-2": 3.296 + }, + "m5ad.24xlarge": { + "ap-northeast-1": 6.432, + "ap-northeast-2": 6.096, + "ap-south-1": 3.221, + "ap-southeast-1": 6.192, + "ap-southeast-2": 6.24, + "ca-central-1": 5.52, + "eu-central-1": 6.0, + "eu-west-1": 5.52, + "eu-west-2": 5.76, + "eu-west-3": 5.808, + "sa-east-1": 7.92, + "us-east-1": 4.944, + "us-east-2": 4.944, + "us-gov-west-1": 6.288, + "us-west-1": 5.856, + "us-west-2": 4.944 + }, + "m5d": { + "ap-south-2": 6.442, + "ap-southeast-3": 7.445, + "eu-north-1": 6.336, + "sa-east-1": 9.504 + }, + "m5d.large": { + "af-south-1": 0.15, + "ap-east-1": 0.155, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.139, + "ap-northeast-3": 0.155, + "ap-south-1": 0.0, + "ap-south-2": 0.122, + "ap-southeast-1": 0.15, + "ap-southeast-2": 0.142, + "ap-southeast-3": 0.141, + "ap-southeast-4": 0.142, + "ca-central-1": 0.126, + "ca-west-1": 0.0, + "eu-central-1": 0.136, + "eu-central-2": 0.15, + "eu-north-1": 0.12, + "eu-south-1": 0.0, + "eu-south-2": 0.126, + "eu-west-1": 0.126, + "eu-west-2": 0.14, + "eu-west-3": 0.0, + "il-central-1": 0.14, + "me-central-1": 0.139, + "me-south-1": 0.139, + "sa-east-1": 0.18, + "us-east-1": 0.113, + "us-east-2": 0.113, + "us-gov-east-1": 0.143, + "us-gov-west-1": 0.143, + "us-west-1": 0.133, + "us-west-2": 0.12 + }, + "m5d.xlarge": { + "af-south-1": 0.3, + "ap-east-1": 0.31, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.278, + "ap-northeast-3": 0.292, + "ap-south-1": 0.244, + "ap-south-2": 0.244, + "ap-southeast-1": 0.282, + "ap-southeast-2": 0.284, + "ap-southeast-3": 0.282, + "ap-southeast-4": 0.301, + "ca-central-1": 0.267, + "ca-west-1": 0.0, + "eu-central-1": 0.272, + "eu-central-2": 0.299, + "eu-north-1": 0.24, + "eu-south-1": 0.264, + "eu-south-2": 0.267, + "eu-west-1": 0.252, + "eu-west-2": 0.279, + "eu-west-3": 0.264, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 0.277, + "sa-east-1": 0.36, + "us-east-1": 0.226, + "us-east-2": 0.0, + "us-gov-east-1": 0.286, + "us-gov-west-1": 0.0, + "us-west-1": 0.285, + "us-west-2": 0.226 + }, + "m5d.metal": { + "af-south-1": 0.0, + "ap-east-1": 7.44, + "ap-northeast-1": 7.008, + "ap-northeast-2": 6.672, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 5.856, + "ap-southeast-1": 6.768, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 6.816, + "ca-central-1": 6.048, + "ca-west-1": 6.048, + "eu-central-1": 6.528, + "eu-central-2": 7.181, + "eu-north-1": 5.76, + "eu-south-1": 0.0, + "eu-south-2": 6.048, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 6.336, + "il-central-1": 6.35, + "me-central-1": 6.653, + "me-south-1": 6.653, + "sa-east-1": 8.64, + "us-east-1": 5.424, + "us-east-2": 5.424, + "us-gov-east-1": 6.864, + "us-gov-west-1": 6.864, + "us-west-1": 6.384, + "us-west-2": 0.0 + }, + "m5d.2xlarge": { + "af-south-1": 0.6, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.589, + "ap-northeast-3": 0.584, + "ap-south-1": 0.488, + "ap-south-2": 0.488, + "ap-southeast-1": 0.564, + "ap-southeast-2": 0.568, + "ap-southeast-3": 0.598, + "ap-southeast-4": 0.568, + "ca-central-1": 0.504, + "ca-west-1": 0.504, + "eu-central-1": 0.581, + "eu-central-2": 0.598, + "eu-north-1": 0.0, + "eu-south-1": 0.528, + "eu-south-2": 0.534, + "eu-west-1": 0.504, + "eu-west-2": 0.0, + "eu-west-3": 0.528, + "il-central-1": 0.0, + "me-central-1": 0.554, + "me-south-1": 0.554, + "sa-east-1": 0.72, + "us-east-1": 0.452, + "us-east-2": 0.452, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.572, + "us-west-1": 0.57, + "us-west-2": 0.452 + }, + "m5d.4xlarge": { + "af-south-1": 1.2, + "ap-east-1": 1.24, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.112, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 1.128, + "ap-southeast-2": 1.21, + "ap-southeast-3": 1.128, + "ap-southeast-4": 0.0, + "ca-central-1": 1.008, + "ca-west-1": 1.008, + "eu-central-1": 1.088, + "eu-central-2": 1.269, + "eu-north-1": 0.96, + "eu-south-1": 1.056, + "eu-south-2": 0.0, + "eu-west-1": 1.008, + "eu-west-2": 1.048, + "eu-west-3": 1.127, + "il-central-1": 1.122, + "me-central-1": 1.109, + "me-south-1": 1.109, + "sa-east-1": 1.44, + "us-east-1": 0.959, + "us-east-2": 0.0, + "us-gov-east-1": 1.144, + "us-gov-west-1": 1.144, + "us-west-1": 1.064, + "us-west-2": 0.904 + }, + "m5d.8xlarge": { + "af-south-1": 2.4, + "ap-east-1": 2.48, + "ap-northeast-1": 2.336, + "ap-northeast-2": 2.224, + "ap-northeast-3": 2.476, + "ap-south-1": 1.952, + "ap-south-2": 2.069, + "ap-southeast-1": 2.256, + "ap-southeast-2": 2.421, + "ap-southeast-3": 0.0, + "ap-southeast-4": 2.408, + "ca-central-1": 2.139, + "ca-west-1": 0.0, + "eu-central-1": 2.176, + "eu-central-2": 2.537, + "eu-north-1": 1.92, + "eu-south-1": 2.112, + "eu-south-2": 2.016, + "eu-west-1": 2.151, + "eu-west-2": 2.096, + "eu-west-3": 2.112, + "il-central-1": 0.0, + "me-central-1": 2.218, + "me-south-1": 0.0, + "sa-east-1": 2.88, + "us-east-1": 1.808, + "us-east-2": 1.808, + "us-gov-east-1": 2.288, + "us-gov-west-1": 2.288, + "us-west-1": 2.128, + "us-west-2": 1.808 + }, + "m5d.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 3.72, + "ap-northeast-1": 3.504, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.504, + "ap-south-1": 2.928, + "ap-south-2": 2.928, + "ap-southeast-1": 3.592, + "ap-southeast-2": 3.408, + "ap-southeast-3": 3.384, + "ap-southeast-4": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 3.205, + "eu-central-1": 3.264, + "eu-central-2": 3.59, + "eu-north-1": 0.0, + "eu-south-1": 3.168, + "eu-south-2": 3.024, + "eu-west-1": 3.024, + "eu-west-2": 0.0, + "eu-west-3": 3.168, + "il-central-1": 3.175, + "me-central-1": 3.326, + "me-south-1": 3.326, + "sa-east-1": 4.32, + "us-east-1": 2.876, + "us-east-2": 2.712, + "us-gov-east-1": 3.432, + "us-gov-west-1": 3.432, + "us-west-1": 3.192, + "us-west-2": 2.876 + }, + "m5d.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.96, + "ap-northeast-1": 4.672, + "ap-northeast-2": 4.448, + "ap-northeast-3": 4.672, + "ap-south-1": 3.904, + "ap-south-2": 3.904, + "ap-southeast-1": 4.512, + "ap-southeast-2": 0.0, + "ap-southeast-3": 4.512, + "ap-southeast-4": 4.544, + "ca-central-1": 4.032, + "ca-west-1": 4.274, + "eu-central-1": 4.352, + "eu-central-2": 0.0, + "eu-north-1": 3.84, + "eu-south-1": 4.477, + "eu-south-2": 4.032, + "eu-west-1": 4.032, + "eu-west-2": 4.192, + "eu-west-3": 4.224, + "il-central-1": 4.234, + "me-central-1": 4.701, + "me-south-1": 4.435, + "sa-east-1": 5.76, + "us-east-1": 3.616, + "us-east-2": 3.616, + "us-gov-east-1": 4.576, + "us-gov-west-1": 4.576, + "us-west-1": 4.256, + "us-west-2": 3.616 + }, + "m5d.24xlarge": { + "af-south-1": 7.2, + "ap-east-1": 7.44, + "ap-northeast-1": 7.008, + "ap-northeast-2": 6.672, + "ap-northeast-3": 7.008, + "ap-south-1": 5.856, + "ap-south-2": 5.856, + "ap-southeast-1": 6.768, + "ap-southeast-2": 0.0, + "ap-southeast-3": 6.768, + "ap-southeast-4": 6.816, + "ca-central-1": 6.048, + "ca-west-1": 6.048, + "eu-central-1": 6.528, + "eu-central-2": 7.181, + "eu-north-1": 0.0, + "eu-south-1": 6.336, + "eu-south-2": 6.048, + "eu-west-1": 6.048, + "eu-west-2": 6.288, + "eu-west-3": 0.0, + "il-central-1": 6.35, + "me-central-1": 6.653, + "me-south-1": 6.653, + "sa-east-1": 0.0, + "us-east-1": 5.424, + "us-east-2": 5.424, + "us-gov-east-1": 6.864, + "us-gov-west-1": 6.864, + "us-west-1": 6.384, + "us-west-2": 5.424 + }, + "m5dn.large": { + "ap-northeast-1": 0.187, + "ap-southeast-1": 0.0, + "eu-central-1": 0.162, + "eu-west-1": 0.152, + "us-east-1": 0.0, + "us-east-2": 0.144, + "us-gov-east-1": 0.171, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "m5dn.xlarge": { + "ap-northeast-1": 0.35, + "ap-southeast-1": 0.334, + "eu-central-1": 0.324, + "eu-west-1": 0.324, + "us-east-1": 0.288, + "us-east-2": 0.272, + "us-gov-east-1": 0.363, + "us-gov-west-1": 0.363, + "us-west-2": 0.272 + }, + "m5dn.metal": { + "ap-northeast-1": 8.4, + "ap-southeast-1": 8.016, + "eu-central-1": 7.776, + "eu-west-1": 7.296, + "us-east-1": 0.0, + "us-east-2": 6.528, + "us-gov-east-1": 8.208, + "us-gov-west-1": 8.208, + "us-west-2": 6.528 + }, + "m5dn.2xlarge": { + "ap-northeast-1": 0.7, + "ap-southeast-1": 0.668, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.684, + "us-west-2": 0.0 + }, + "m5dn.4xlarge": { + "ap-northeast-1": 1.4, + "ap-southeast-1": 0.0, + "eu-central-1": 1.383, + "eu-west-1": 0.0, + "us-east-1": 1.088, + "us-east-2": 1.088, + "us-gov-east-1": 1.368, + "us-gov-west-1": 1.368, + "us-west-2": 1.088 + }, + "m5dn.8xlarge": { + "ap-northeast-1": 2.8, + "ap-southeast-1": 2.672, + "eu-central-1": 0.0, + "eu-west-1": 2.432, + "us-east-1": 2.176, + "us-east-2": 2.176, + "us-gov-east-1": 2.736, + "us-gov-west-1": 2.736, + "us-west-2": 2.308 + }, + "m5dn.12xlarge": { + "ap-northeast-1": 4.2, + "ap-southeast-1": 4.257, + "eu-central-1": 3.888, + "eu-west-1": 3.89, + "us-east-1": 0.0, + "us-east-2": 3.264, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.104, + "us-west-2": 3.264 + }, + "m5dn.16xlarge": { + "ap-northeast-1": 5.6, + "ap-southeast-1": 5.676, + "eu-central-1": 5.184, + "eu-west-1": 4.864, + "us-east-1": 0.0, + "us-east-2": 4.352, + "us-gov-east-1": 5.472, + "us-gov-west-1": 5.472, + "us-west-2": 4.616 + }, + "m5dn.24xlarge": { + "ap-northeast-1": 8.4, + "ap-southeast-1": 8.016, + "eu-central-1": 7.776, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 8.208, + "us-west-2": 6.528 + }, + "m5n": { + "ap-southeast-1": 7.709 + }, + "m5n.large": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.146, + "eu-central-1": 0.15, + "eu-west-1": 0.133, + "us-east-1": 0.119, + "us-east-2": 0.119, + "us-gov-east-1": 0.149, + "us-gov-west-1": 0.149, + "us-west-2": 0.119 + }, + "m5n.xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.31, + "eu-central-1": 0.282, + "eu-west-1": 0.266, + "us-east-1": 0.238, + "us-east-2": 0.252, + "us-gov-east-1": 0.298, + "us-gov-west-1": 0.298, + "us-west-2": 0.238 + }, + "m5n.metal": { + "ap-northeast-1": 7.344, + "ap-southeast-1": 0.0, + "eu-central-1": 6.768, + "eu-west-1": 0.0, + "us-east-1": 5.712, + "us-east-2": 5.712, + "us-gov-east-1": 0.0, + "us-gov-west-1": 7.152, + "us-west-2": 5.712 + }, + "m5n.2xlarge": { + "ap-northeast-1": 0.612, + "ap-southeast-1": 0.0, + "eu-central-1": 0.564, + "eu-west-1": 0.0, + "us-east-1": 0.476, + "us-east-2": 0.476, + "us-gov-east-1": 0.632, + "us-gov-west-1": 0.596, + "us-west-2": 0.505 + }, + "m5n.4xlarge": { + "ap-northeast-1": 1.224, + "ap-southeast-1": 1.168, + "eu-central-1": 1.128, + "eu-west-1": 0.0, + "us-east-1": 0.952, + "us-east-2": 0.0, + "us-gov-east-1": 1.264, + "us-gov-west-1": 1.192, + "us-west-2": 0.0 + }, + "m5n.8xlarge": { + "ap-northeast-1": 2.448, + "ap-southeast-1": 2.336, + "eu-central-1": 2.256, + "eu-west-1": 0.0, + "us-east-1": 1.904, + "us-east-2": 2.019, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.384, + "us-west-2": 1.904 + }, + "m5n.12xlarge": { + "ap-northeast-1": 3.672, + "ap-southeast-1": 3.504, + "eu-central-1": 3.612, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.856, + "us-gov-east-1": 3.576, + "us-gov-west-1": 3.576, + "us-west-2": 2.856 + }, + "m5n.16xlarge": { + "ap-northeast-1": 4.896, + "ap-southeast-1": 4.672, + "eu-central-1": 4.512, + "eu-west-1": 4.541, + "us-east-1": 3.808, + "us-east-2": 3.808, + "us-gov-east-1": 4.768, + "us-gov-west-1": 4.768, + "us-west-2": 3.808 + }, + "m5n.24xlarge": { + "ap-northeast-1": 7.344, + "ap-southeast-1": 7.008, + "eu-central-1": 6.768, + "eu-west-1": 0.0, + "us-east-1": 5.712, + "us-east-2": 5.712, + "us-gov-east-1": 7.152, + "us-gov-west-1": 0.0, + "us-west-2": 5.712 + }, + "m5zn.large": { + "ap-northeast-1": 0.2134, + "ap-northeast-2": 0.2233, + "ap-southeast-1": 0.2065, + "ap-southeast-2": 0.2065, + "eu-central-1": 0.0, + "eu-west-1": 0.1841, + "sa-east-1": 0.2632, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 0.1927, + "us-west-2": 0.1817 + }, + "m5zn.xlarge": { + "ap-northeast-1": 0.4694, + "ap-northeast-2": 0.4466, + "ap-southeast-1": 0.413, + "ap-southeast-2": 0.0, + "eu-central-1": 0.3957, + "eu-west-1": 0.3682, + "sa-east-1": 0.5265, + "us-east-1": 0.3303, + "us-east-2": 0.0, + "us-west-1": 0.3854, + "us-west-2": 0.3303 + }, + "m5zn.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.872, + "ap-southeast-1": 4.956, + "ap-southeast-2": 0.0, + "eu-central-1": 4.7486, + "eu-west-1": 4.4184, + "sa-east-1": 0.0, + "us-east-1": 3.9641, + "us-east-2": 3.9641, + "us-west-1": 4.6248, + "us-west-2": 0.0 + }, + "m5zn.2xlarge": { + "ap-northeast-1": 0.8534, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.826, + "ap-southeast-2": 0.826, + "eu-central-1": 0.7914, + "eu-west-1": 0.7364, + "sa-east-1": 0.0, + "us-east-1": 0.6607, + "us-east-2": 0.7267, + "us-west-1": 0.8479, + "us-west-2": 0.6607 + }, + "m5zn.3xlarge": { + "ap-northeast-1": 1.2801, + "ap-northeast-2": 1.218, + "ap-southeast-1": 1.3629, + "ap-southeast-2": 1.239, + "eu-central-1": 0.0, + "eu-west-1": 1.2151, + "sa-east-1": 1.7374, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 1.1562, + "us-west-2": 1.0901 + }, + "m5zn.6xlarge": { + "ap-northeast-1": 2.5602, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.478, + "eu-central-1": 2.3743, + "eu-west-1": 2.4301, + "sa-east-1": 3.1589, + "us-east-1": 1.982, + "us-east-2": 0.0, + "us-west-1": 0.0, + "us-west-2": 1.982 + }, + "m5zn.12xlarge": { + "ap-northeast-1": 5.1204, + "ap-northeast-2": 4.872, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.4516, + "eu-central-1": 4.7486, + "eu-west-1": 0.0, + "sa-east-1": 6.3178, + "us-east-1": 3.9641, + "us-east-2": 4.3605, + "us-west-1": 4.6248, + "us-west-2": 3.9641 + }, + "m6a": { + "ap-northeast-1": 11.785, + "ap-south-1": 5.866, + "ap-southeast-2": 11.405, + "eu-west-1": 10.169 + }, + "m6a.large": { + "ap-northeast-1": 0.1116, + "ap-south-1": 0.05555, + "ap-south-2": 0.0, + "ap-southeast-1": 0.108, + "ap-southeast-2": 0.108, + "ca-central-1": 0.0963, + "eu-central-1": 0.1035, + "eu-south-1": 0.11088, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.09504, + "us-west-1": 0.0, + "us-west-2": 0.0864 + }, + "m6a.xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.12221, + "ap-south-2": 0.1111, + "ap-southeast-1": 0.2376, + "ap-southeast-2": 0.216, + "ca-central-1": 0.1926, + "eu-central-1": 0.207, + "eu-south-1": 0.22176, + "eu-west-1": 0.1926, + "eu-west-2": 0.0, + "eu-west-3": 0.2016, + "sa-east-1": 0.2754, + "us-east-1": 0.1728, + "us-east-2": 0.0, + "us-west-1": 0.22176, + "us-west-2": 0.1728 + }, + "m6a.metal": { + "ap-northeast-1": 10.7136, + "ap-south-1": 5.3328, + "ap-south-2": 0.0, + "ap-southeast-1": 10.368, + "ap-southeast-2": 10.368, + "ca-central-1": 9.2448, + "eu-central-1": 9.936, + "eu-south-1": 9.6768, + "eu-west-1": 9.2448, + "eu-west-2": 9.5904, + "eu-west-3": 9.6768, + "sa-east-1": 13.2192, + "us-east-1": 8.2944, + "us-east-2": 8.2944, + "us-west-1": 9.6768, + "us-west-2": 8.2944 + }, + "m6a.2xlarge": { + "ap-northeast-1": 0.4464, + "ap-south-1": 0.2222, + "ap-south-2": 0.2222, + "ap-southeast-1": 0.4752, + "ap-southeast-2": 0.0, + "ca-central-1": 0.3852, + "eu-central-1": 0.414, + "eu-south-1": 0.4032, + "eu-west-1": 0.42372, + "eu-west-2": 0.3996, + "eu-west-3": 0.4032, + "sa-east-1": 0.5508, + "us-east-1": 0.3456, + "us-east-2": 0.3456, + "us-west-1": 0.0, + "us-west-2": 0.3456 + }, + "m6a.4xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.4444, + "ap-south-2": 0.4444, + "ap-southeast-1": 0.864, + "ap-southeast-2": 0.864, + "ca-central-1": 0.0, + "eu-central-1": 0.828, + "eu-south-1": 0.8064, + "eu-west-1": 0.7704, + "eu-west-2": 0.7992, + "eu-west-3": 0.88704, + "sa-east-1": 1.1016, + "us-east-1": 0.0, + "us-east-2": 0.76032, + "us-west-1": 0.0, + "us-west-2": 0.6912 + }, + "m6a.8xlarge": { + "ap-northeast-1": 1.7856, + "ap-south-1": 0.97768, + "ap-south-2": 0.97768, + "ap-southeast-1": 1.728, + "ap-southeast-2": 1.9008, + "ca-central-1": 1.69488, + "eu-central-1": 1.8216, + "eu-south-1": 1.6128, + "eu-west-1": 1.5408, + "eu-west-2": 0.0, + "eu-west-3": 1.6128, + "sa-east-1": 2.42352, + "us-east-1": 1.52064, + "us-east-2": 1.3824, + "us-west-1": 1.77408, + "us-west-2": 1.3824 + }, + "m6a.12xlarge": { + "ap-northeast-1": 2.6784, + "ap-south-1": 0.0, + "ap-south-2": 1.3332, + "ap-southeast-1": 2.592, + "ap-southeast-2": 2.592, + "ca-central-1": 2.3112, + "eu-central-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 2.63736, + "eu-west-3": 0.0, + "sa-east-1": 3.3048, + "us-east-1": 2.0736, + "us-east-2": 2.0736, + "us-west-1": 2.4192, + "us-west-2": 2.28096 + }, + "m6a.16xlarge": { + "ap-northeast-1": 3.92832, + "ap-south-1": 1.7776, + "ap-south-2": 1.95536, + "ap-southeast-1": 3.456, + "ap-southeast-2": 3.456, + "ca-central-1": 0.0, + "eu-central-1": 3.312, + "eu-south-1": 3.2256, + "eu-west-1": 3.38976, + "eu-west-2": 3.1968, + "eu-west-3": 3.54816, + "sa-east-1": 0.0, + "us-east-1": 2.7648, + "us-east-2": 2.7648, + "us-west-1": 3.2256, + "us-west-2": 2.7648 + }, + "m6a.24xlarge": { + "ap-northeast-1": 5.89248, + "ap-south-1": 2.6664, + "ap-south-2": 2.6664, + "ap-southeast-1": 5.184, + "ap-southeast-2": 5.184, + "ca-central-1": 5.08464, + "eu-central-1": 4.968, + "eu-south-1": 5.32224, + "eu-west-1": 4.6224, + "eu-west-2": 4.7952, + "eu-west-3": 4.8384, + "sa-east-1": 6.6096, + "us-east-1": 4.1472, + "us-east-2": 4.1472, + "us-west-1": 4.8384, + "us-west-2": 4.1472 + }, + "m6a.32xlarge": { + "ap-northeast-1": 7.1424, + "ap-south-1": 3.91072, + "ap-south-2": 3.5552, + "ap-southeast-1": 0.0, + "ap-southeast-2": 7.6032, + "ca-central-1": 6.1632, + "eu-central-1": 7.2864, + "eu-south-1": 6.4512, + "eu-west-1": 6.1632, + "eu-west-2": 6.3936, + "eu-west-3": 0.0, + "sa-east-1": 8.8128, + "us-east-1": 5.5296, + "us-east-2": 5.5296, + "us-west-1": 6.4512, + "us-west-2": 5.5296 + }, + "m6a.48xlarge": { + "ap-northeast-1": 10.7136, + "ap-south-1": 0.0, + "ap-south-2": 5.3328, + "ap-southeast-1": 10.368, + "ap-southeast-2": 10.368, + "ca-central-1": 9.2448, + "eu-central-1": 9.936, + "eu-south-1": 9.6768, + "eu-west-1": 0.0, + "eu-west-2": 9.5904, + "eu-west-3": 0.0, + "sa-east-1": 13.2192, + "us-east-1": 8.2944, + "us-east-2": 8.2944, + "us-west-1": 9.6768, + "us-west-2": 8.2944 + }, + "m6g": { + "eu-west-3": 3.168, + "me-south-1": 3.309 + }, + "m6g.medium": { + "af-south-1": 0.0508, + "ap-east-1": 0.0561, + "ap-northeast-1": 0.0495, + "ap-northeast-2": 0.0499, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0253, + "ap-south-2": 0.0253, + "ap-southeast-1": 0.048, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.048, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0432, + "ap-southeast-7": 0.0408, + "ca-central-1": 0.0428, + "ca-west-1": 0.0428, + "eu-central-1": 0.0, + "eu-central-2": 0.0506, + "eu-north-1": 0.0, + "eu-south-1": 0.0448, + "eu-south-2": 0.0, + "eu-west-1": 0.043, + "eu-west-2": 0.0444, + "eu-west-3": 0.045, + "il-central-1": 0.0452, + "me-central-1": 0.0473, + "me-south-1": 0.0, + "mx-central-1": 0.0404, + "sa-east-1": 0.0649, + "us-east-1": 0.0, + "us-east-2": 0.0385, + "us-gov-east-1": 0.0484, + "us-gov-west-1": 0.0484, + "us-west-1": 0.0448, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0462 + }, + "m6g.large": { + "af-south-1": 0.1077, + "ap-east-1": 0.106, + "ap-northeast-1": 0.105, + "ap-northeast-2": 0.094, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0506, + "ap-south-2": 0.0506, + "ap-southeast-1": 0.096, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1018, + "ap-southeast-4": 0.096, + "ap-southeast-5": 0.0865, + "ap-southeast-7": 0.0865, + "ca-central-1": 0.0856, + "ca-west-1": 0.0, + "eu-central-1": 0.0975, + "eu-central-2": 0.1012, + "eu-north-1": 0.0869, + "eu-south-1": 0.0, + "eu-south-2": 0.0911, + "eu-west-1": 0.086, + "eu-west-2": 0.0, + "eu-west-3": 0.09, + "il-central-1": 0.0903, + "me-central-1": 0.0946, + "me-south-1": 0.094, + "mx-central-1": 0.0809, + "sa-east-1": 0.1224, + "us-east-1": 0.077, + "us-east-2": 0.077, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0968, + "us-west-1": 0.0896, + "us-west-2": 0.0816, + "us-west-2-lax-1": 0.0 + }, + "m6g.xlarge": { + "af-south-1": 0.2032, + "ap-east-1": 0.212, + "ap-northeast-1": 0.198, + "ap-northeast-2": 0.188, + "ap-northeast-3": 0.0, + "ap-south-1": 0.1073, + "ap-south-2": 0.1012, + "ap-southeast-1": 0.192, + "ap-southeast-2": 0.192, + "ap-southeast-3": 0.2035, + "ap-southeast-4": 0.192, + "ap-southeast-5": 0.1632, + "ap-southeast-7": 0.173, + "ca-central-1": 0.0, + "ca-west-1": 0.1815, + "eu-central-1": 0.184, + "eu-central-2": 0.0, + "eu-north-1": 0.1738, + "eu-south-1": 0.1792, + "eu-south-2": 0.172, + "eu-west-1": 0.1822, + "eu-west-2": 0.1776, + "eu-west-3": 0.18, + "il-central-1": 0.1806, + "me-central-1": 0.1892, + "me-south-1": 0.188, + "mx-central-1": 0.0, + "sa-east-1": 0.2595, + "us-east-1": 0.0, + "us-east-2": 0.1632, + "us-gov-east-1": 0.1936, + "us-gov-west-1": 0.1936, + "us-west-1": 0.0, + "us-west-2": 0.154, + "us-west-2-lax-1": 0.0 + }, + "m6g.metal": { + "af-south-1": 0.0, + "ap-east-1": 3.392, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.1904, + "ap-northeast-3": 3.3649, + "ap-south-1": 1.6192, + "ap-south-2": 1.7164, + "ap-southeast-1": 3.072, + "ap-southeast-2": 3.072, + "ap-southeast-3": 0.0, + "ap-southeast-4": 3.072, + "ap-southeast-5": 2.6112, + "ap-southeast-7": 2.6112, + "ca-central-1": 0.0, + "ca-west-1": 2.7392, + "eu-central-1": 0.0, + "eu-central-2": 3.2384, + "eu-north-1": 2.624, + "eu-south-1": 2.8672, + "eu-south-2": 2.752, + "eu-west-1": 0.0, + "eu-west-2": 2.8416, + "eu-west-3": 3.0528, + "il-central-1": 2.8896, + "me-central-1": 3.0272, + "me-south-1": 3.008, + "mx-central-1": 2.7421, + "sa-east-1": 3.9168, + "us-east-1": 2.464, + "us-east-2": 2.464, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.0976, + "us-west-1": 0.0, + "us-west-2": 2.464, + "us-west-2-lax-1": 3.1334 + }, + "m6g.2xlarge": { + "af-south-1": 0.4064, + "ap-east-1": 0.4492, + "ap-northeast-1": 0.396, + "ap-northeast-2": 0.3988, + "ap-northeast-3": 0.3968, + "ap-south-1": 0.2145, + "ap-south-2": 0.2145, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.407, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.407, + "ap-southeast-5": 0.346, + "ap-southeast-7": 0.346, + "ca-central-1": 0.3424, + "ca-west-1": 0.0, + "eu-central-1": 0.368, + "eu-central-2": 0.4048, + "eu-north-1": 0.3476, + "eu-south-1": 0.3798, + "eu-south-2": 0.344, + "eu-west-1": 0.344, + "eu-west-2": 0.3552, + "eu-west-3": 0.36, + "il-central-1": 0.0, + "me-central-1": 0.3784, + "me-south-1": 0.376, + "mx-central-1": 0.0, + "sa-east-1": 0.4896, + "us-east-1": 0.3264, + "us-east-2": 0.308, + "us-gov-east-1": 0.4104, + "us-gov-west-1": 0.3872, + "us-west-1": 0.3584, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.3696 + }, + "m6g.4xlarge": { + "af-south-1": 0.8128, + "ap-east-1": 0.848, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.7936, + "ap-south-1": 0.0, + "ap-south-2": 0.4291, + "ap-southeast-1": 0.768, + "ap-southeast-2": 0.768, + "ap-southeast-3": 0.768, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.6528, + "ap-southeast-7": 0.6528, + "ca-central-1": 0.6848, + "ca-west-1": 0.0, + "eu-central-1": 0.736, + "eu-central-2": 0.8096, + "eu-north-1": 0.656, + "eu-south-1": 0.7168, + "eu-south-2": 0.688, + "eu-west-1": 0.7288, + "eu-west-2": 0.7104, + "eu-west-3": 0.72, + "il-central-1": 0.7224, + "me-central-1": 0.8017, + "me-south-1": 0.752, + "mx-central-1": 0.0, + "sa-east-1": 0.9792, + "us-east-1": 0.6528, + "us-east-2": 0.616, + "us-gov-east-1": 0.7744, + "us-gov-west-1": 0.8209, + "us-west-1": 0.7168, + "us-west-2": 0.616, + "us-west-2-lax-1": 0.7392 + }, + "m6g.8xlarge": { + "af-south-1": 1.7231, + "ap-east-1": 1.696, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.5952, + "ap-northeast-3": 1.5872, + "ap-south-1": 0.8582, + "ap-south-2": 0.8096, + "ap-southeast-1": 1.536, + "ap-southeast-2": 1.536, + "ap-southeast-3": 1.536, + "ap-southeast-4": 1.536, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.3839, + "ca-central-1": 1.3696, + "ca-west-1": 1.3696, + "eu-central-1": 1.56, + "eu-central-2": 1.6192, + "eu-north-1": 0.0, + "eu-south-1": 1.4336, + "eu-south-2": 1.376, + "eu-west-1": 1.376, + "eu-west-2": 1.4208, + "eu-west-3": 1.44, + "il-central-1": 1.4448, + "me-central-1": 1.5136, + "me-south-1": 0.0, + "mx-central-1": 1.371, + "sa-east-1": 2.0759, + "us-east-1": 1.232, + "us-east-2": 1.3056, + "us-gov-east-1": 1.6417, + "us-gov-west-1": 0.0, + "us-west-1": 1.4336, + "us-west-2": 1.232, + "us-west-2-lax-1": 1.5667 + }, + "m6g.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 2.544, + "ap-northeast-1": 2.376, + "ap-northeast-2": 2.256, + "ap-northeast-3": 2.3808, + "ap-south-1": 1.2144, + "ap-south-2": 1.2873, + "ap-southeast-1": 2.304, + "ap-southeast-2": 2.304, + "ap-southeast-3": 2.304, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.9584, + "ca-central-1": 2.0544, + "ca-west-1": 2.1777, + "eu-central-1": 2.34, + "eu-central-2": 2.4288, + "eu-north-1": 1.968, + "eu-south-1": 0.0, + "eu-south-2": 2.1864, + "eu-west-1": 2.064, + "eu-west-2": 2.1312, + "eu-west-3": 0.0, + "il-central-1": 2.2957, + "me-central-1": 2.405, + "me-south-1": 2.256, + "mx-central-1": 2.0566, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 1.9584, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.3232, + "us-west-1": 2.1504, + "us-west-2": 1.848, + "us-west-2-lax-1": 0.0 + }, + "m6g.16xlarge": { + "af-south-1": 3.2512, + "ap-east-1": 3.392, + "ap-northeast-1": 3.168, + "ap-northeast-2": 3.008, + "ap-northeast-3": 3.1744, + "ap-south-1": 1.6192, + "ap-south-2": 1.6192, + "ap-southeast-1": 3.2563, + "ap-southeast-2": 3.072, + "ap-southeast-3": 3.072, + "ap-southeast-4": 0.0, + "ap-southeast-5": 2.6112, + "ap-southeast-7": 2.6112, + "ca-central-1": 0.0, + "ca-west-1": 2.9036, + "eu-central-1": 2.944, + "eu-central-2": 3.2384, + "eu-north-1": 2.624, + "eu-south-1": 2.8672, + "eu-south-2": 2.9152, + "eu-west-1": 2.752, + "eu-west-2": 2.8416, + "eu-west-3": 2.88, + "il-central-1": 0.0, + "me-central-1": 3.0272, + "me-south-1": 3.008, + "mx-central-1": 2.5875, + "sa-east-1": 0.0, + "us-east-1": 2.464, + "us-east-2": 0.0, + "us-gov-east-1": 3.0976, + "us-gov-west-1": 3.0976, + "us-west-1": 2.8672, + "us-west-2": 2.6112, + "us-west-2-lax-1": 3.1334 + }, + "m6gd": { + "ap-southeast-5": 3.381, + "eu-south-2": 3.548, + "eu-west-3": 3.717, + "us-west-1": 3.731 + }, + "m6gd.medium": { + "af-south-1": 0.06, + "ap-east-1": 0.062, + "ap-northeast-1": 0.062, + "ap-northeast-2": 0.0556, + "ap-northeast-3": 0.0584, + "ap-south-1": 0.0302, + "ap-south-2": 0.0302, + "ap-southeast-1": 0.0565, + "ap-southeast-2": 0.057, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0509, + "ca-central-1": 0.0534, + "ca-west-1": 0.0504, + "eu-central-1": 0.0577, + "eu-central-2": 0.0, + "eu-north-1": 0.048, + "eu-south-1": 0.056, + "eu-south-2": 0.0504, + "eu-west-1": 0.0504, + "eu-west-2": 0.0524, + "eu-west-3": 0.0528, + "il-central-1": 0.0529, + "me-central-1": 0.0554, + "me-south-1": 0.0554, + "mx-central-1": 0.0475, + "sa-east-1": 0.072, + "us-east-1": 0.0, + "us-east-2": 0.0452, + "us-gov-east-1": 0.0572, + "us-gov-west-1": 0.0572, + "us-west-1": 0.0562, + "us-west-2": 0.0452 + }, + "m6gd.large": { + "af-south-1": 0.12, + "ap-east-1": 0.124, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1178, + "ap-northeast-3": 0.1168, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.113, + "ap-southeast-2": 0.114, + "ap-southeast-3": 0.1198, + "ap-southeast-4": 0.1208, + "ap-southeast-5": 0.096, + "ap-southeast-7": 0.096, + "ca-central-1": 0.1008, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.127, + "eu-north-1": 0.096, + "eu-south-1": 0.1056, + "eu-south-2": 0.1008, + "eu-west-1": 0.1008, + "eu-west-2": 0.1048, + "eu-west-3": 0.0, + "il-central-1": 0.1058, + "me-central-1": 0.1108, + "me-south-1": 0.1175, + "mx-central-1": 0.0949, + "sa-east-1": 0.144, + "us-east-1": 0.0958, + "us-east-2": 0.0904, + "us-gov-east-1": 0.1213, + "us-gov-west-1": 0.1144, + "us-west-1": 0.0, + "us-west-2": 0.0958 + }, + "m6gd.xlarge": { + "af-south-1": 0.24, + "ap-east-1": 0.248, + "ap-northeast-1": 0.248, + "ap-northeast-2": 0.2224, + "ap-northeast-3": 0.2336, + "ap-south-1": 0.1208, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.2396, + "ap-southeast-4": 0.2416, + "ap-southeast-5": 0.2036, + "ap-southeast-7": 0.1921, + "ca-central-1": 0.2016, + "ca-west-1": 0.2016, + "eu-central-1": 0.0, + "eu-central-2": 0.2541, + "eu-north-1": 0.2036, + "eu-south-1": 0.2239, + "eu-south-2": 0.0, + "eu-west-1": 0.2016, + "eu-west-2": 0.2096, + "eu-west-3": 0.2112, + "il-central-1": 0.2117, + "me-central-1": 0.0, + "me-south-1": 0.2351, + "mx-central-1": 0.0, + "sa-east-1": 0.3046, + "us-east-1": 0.0, + "us-east-2": 0.1808, + "us-gov-east-1": 0.2288, + "us-gov-west-1": 0.0, + "us-west-1": 0.2248, + "us-west-2": 0.1808 + }, + "m6gd.metal": { + "af-south-1": 3.84, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.7376, + "ap-south-1": 1.9328, + "ap-south-2": 1.9328, + "ap-southeast-1": 3.616, + "ap-southeast-2": 3.648, + "ap-southeast-3": 0.0, + "ap-southeast-4": 3.648, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 3.2256, + "ca-west-1": 3.2256, + "eu-central-1": 3.488, + "eu-central-2": 3.8368, + "eu-north-1": 3.072, + "eu-south-1": 3.582, + "eu-south-2": 3.2256, + "eu-west-1": 3.2256, + "eu-west-2": 3.3536, + "eu-west-3": 3.3792, + "il-central-1": 3.3869, + "me-central-1": 3.5456, + "me-south-1": 0.0, + "mx-central-1": 3.0374, + "sa-east-1": 4.608, + "us-east-1": 2.8928, + "us-east-2": 2.8928, + "us-gov-east-1": 3.8804, + "us-gov-west-1": 3.6608, + "us-west-1": 0.0, + "us-west-2": 3.0664 + }, + "m6gd.2xlarge": { + "af-south-1": 0.5088, + "ap-east-1": 0.5258, + "ap-northeast-1": 0.496, + "ap-northeast-2": 0.4448, + "ap-northeast-3": 0.4672, + "ap-south-1": 0.2561, + "ap-south-2": 0.2416, + "ap-southeast-1": 0.452, + "ap-southeast-2": 0.4832, + "ap-southeast-3": 0.452, + "ap-southeast-4": 0.456, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.3842, + "ca-central-1": 0.4032, + "ca-west-1": 0.4274, + "eu-central-1": 0.436, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.4032, + "eu-west-2": 0.4192, + "eu-west-3": 0.0, + "il-central-1": 0.4234, + "me-central-1": 0.4432, + "me-south-1": 0.4435, + "mx-central-1": 0.4025, + "sa-east-1": 0.576, + "us-east-1": 0.3616, + "us-east-2": 0.3616, + "us-gov-east-1": 0.4576, + "us-gov-west-1": 0.4851, + "us-west-1": 0.0, + "us-west-2": 0.3616 + }, + "m6gd.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.0515, + "ap-northeast-1": 0.936, + "ap-northeast-2": 0.9424, + "ap-northeast-3": 0.9344, + "ap-south-1": 0.4832, + "ap-south-2": 0.4832, + "ap-southeast-1": 0.904, + "ap-southeast-2": 0.912, + "ap-southeast-3": 0.904, + "ap-southeast-4": 0.912, + "ap-southeast-5": 0.7683, + "ap-southeast-7": 0.7683, + "ca-central-1": 0.8064, + "ca-west-1": 0.8064, + "eu-central-1": 0.872, + "eu-central-2": 0.9592, + "eu-north-1": 0.768, + "eu-south-1": 0.8448, + "eu-south-2": 0.8064, + "eu-west-1": 0.8064, + "eu-west-2": 0.8384, + "eu-west-3": 0.8448, + "il-central-1": 0.8975, + "me-central-1": 0.8864, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.7232, + "us-gov-east-1": 0.9152, + "us-gov-west-1": 0.0, + "us-west-1": 0.8992, + "us-west-2": 0.0 + }, + "m6gd.8xlarge": { + "af-south-1": 2.0352, + "ap-east-1": 0.0, + "ap-northeast-1": 1.872, + "ap-northeast-2": 1.7792, + "ap-northeast-3": 1.9809, + "ap-south-1": 0.9664, + "ap-south-2": 1.0244, + "ap-southeast-1": 1.9168, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.808, + "ap-southeast-4": 0.0, + "ap-southeast-5": 1.6291, + "ap-southeast-7": 1.5366, + "ca-central-1": 1.6128, + "ca-west-1": 1.6128, + "eu-central-1": 1.744, + "eu-central-2": 1.9184, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 1.7096, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 1.6934, + "me-central-1": 1.7728, + "me-south-1": 1.7741, + "mx-central-1": 1.5187, + "sa-east-1": 2.304, + "us-east-1": 0.0, + "us-east-2": 1.5332, + "us-gov-east-1": 1.8304, + "us-gov-west-1": 1.8304, + "us-west-1": 1.696, + "us-west-2": 1.5332 + }, + "m6gd.12xlarge": { + "af-south-1": 2.88, + "ap-east-1": 2.976, + "ap-northeast-1": 2.808, + "ap-northeast-2": 2.6688, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 1.5366, + "ap-southeast-1": 2.712, + "ap-southeast-2": 2.736, + "ap-southeast-3": 0.0, + "ap-southeast-4": 2.8992, + "ap-southeast-5": 2.4437, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 2.4192, + "eu-central-1": 0.0, + "eu-central-2": 2.8776, + "eu-north-1": 2.4432, + "eu-south-1": 0.0, + "eu-south-2": 2.4192, + "eu-west-1": 0.0, + "eu-west-2": 2.5152, + "eu-west-3": 2.5344, + "il-central-1": 2.5402, + "me-central-1": 0.0, + "me-south-1": 2.6611, + "mx-central-1": 2.4148, + "sa-east-1": 0.0, + "us-east-1": 2.1696, + "us-east-2": 2.1696, + "us-gov-east-1": 2.7456, + "us-gov-west-1": 2.7456, + "us-west-1": 2.544, + "us-west-2": 0.0 + }, + "m6gd.16xlarge": { + "af-south-1": 3.84, + "ap-east-1": 3.968, + "ap-northeast-1": 3.968, + "ap-northeast-2": 3.5584, + "ap-northeast-3": 3.7376, + "ap-south-1": 1.9328, + "ap-south-2": 1.9328, + "ap-southeast-1": 3.616, + "ap-southeast-2": 3.648, + "ap-southeast-3": 3.616, + "ap-southeast-4": 3.648, + "ap-southeast-5": 3.0733, + "ap-southeast-7": 0.0, + "ca-central-1": 3.2256, + "ca-west-1": 3.2256, + "eu-central-1": 3.488, + "eu-central-2": 3.8368, + "eu-north-1": 3.072, + "eu-south-1": 3.3792, + "eu-south-2": 3.2256, + "eu-west-1": 0.0, + "eu-west-2": 3.3536, + "eu-west-3": 0.0, + "il-central-1": 3.3869, + "me-central-1": 0.0, + "me-south-1": 3.761, + "mx-central-1": 3.0374, + "sa-east-1": 4.608, + "us-east-1": 2.8928, + "us-east-2": 2.8928, + "us-gov-east-1": 3.6608, + "us-gov-west-1": 3.6608, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6i": { + "il-central-1": 7.909 + }, + "m6i.large": { + "af-south-1": 0.127, + "ap-east-1": 0.132, + "ap-northeast-1": 0.1364, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.101, + "ap-south-2": 0.101, + "ap-southeast-1": 0.12, + "ap-southeast-2": 0.12, + "ap-southeast-3": 0.12, + "ap-southeast-5": 0.1122, + "ap-southeast-7": 0.0, + "ca-central-1": 0.107, + "ca-west-1": 0.107, + "eu-central-1": 0.115, + "eu-central-2": 0.13915, + "eu-north-1": 0.102, + "eu-south-1": 0.0, + "eu-west-1": 0.1177, + "eu-west-2": 0.111, + "eu-west-3": 0.112, + "il-central-1": 0.12359, + "me-central-1": 0.1177, + "me-south-1": 0.132, + "mx-central-1": 0.1008, + "sa-east-1": 0.1683, + "us-east-1": 0.096, + "us-east-2": 0.096, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.121, + "us-west-1": 0.0, + "us-west-2": 0.096 + }, + "m6i.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.264, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.236, + "ap-northeast-3": 0.248, + "ap-south-1": 0.202, + "ap-south-2": 0.2222, + "ap-southeast-1": 0.24, + "ap-southeast-2": 0.264, + "ap-southeast-3": 0.24, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.204, + "ca-central-1": 0.214, + "ca-west-1": 0.2354, + "eu-central-1": 0.23, + "eu-central-2": 0.2783, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.214, + "eu-west-2": 0.222, + "eu-west-3": 0.224, + "il-central-1": 0.2247, + "me-central-1": 0.25894, + "me-south-1": 0.264, + "mx-central-1": 0.0, + "sa-east-1": 0.3366, + "us-east-1": 0.2112, + "us-east-2": 0.192, + "us-gov-east-1": 0.242, + "us-gov-west-1": 0.0, + "us-west-1": 0.224, + "us-west-2": 0.192 + }, + "m6i.metal": { + "af-south-1": 0.0, + "ap-east-1": 8.448, + "ap-northeast-1": 0.0, + "ap-northeast-2": 7.552, + "ap-northeast-3": 7.936, + "ap-south-1": 6.464, + "ap-south-2": 6.464, + "ap-southeast-1": 7.68, + "ap-southeast-2": 7.68, + "ap-southeast-3": 7.68, + "ap-southeast-5": 6.528, + "ap-southeast-7": 6.528, + "ca-central-1": 6.848, + "ca-west-1": 0.0, + "eu-central-1": 7.36, + "eu-central-2": 0.0, + "eu-north-1": 6.528, + "eu-south-1": 7.168, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 7.168, + "il-central-1": 7.1904, + "me-central-1": 7.5328, + "me-south-1": 8.448, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 6.144, + "us-east-2": 0.0, + "us-gov-east-1": 7.744, + "us-gov-west-1": 7.744, + "us-west-1": 7.168, + "us-west-2": 6.144 + }, + "m6i.2xlarge": { + "af-south-1": 0.508, + "ap-east-1": 0.528, + "ap-northeast-1": 0.5456, + "ap-northeast-2": 0.472, + "ap-northeast-3": 0.0, + "ap-south-1": 0.4444, + "ap-south-2": 0.404, + "ap-southeast-1": 0.48, + "ap-southeast-2": 0.48, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.408, + "ap-southeast-7": 0.408, + "ca-central-1": 0.4708, + "ca-west-1": 0.428, + "eu-central-1": 0.506, + "eu-central-2": 0.506, + "eu-north-1": 0.408, + "eu-south-1": 0.448, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.448, + "il-central-1": 0.49434, + "me-central-1": 0.4708, + "me-south-1": 0.528, + "mx-central-1": 0.4032, + "sa-east-1": 0.612, + "us-east-1": 0.384, + "us-east-2": 0.384, + "us-gov-east-1": 0.484, + "us-gov-west-1": 0.484, + "us-west-1": 0.448, + "us-west-2": 0.384 + }, + "m6i.4xlarge": { + "af-south-1": 1.016, + "ap-east-1": 1.056, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.944, + "ap-northeast-3": 0.992, + "ap-south-1": 0.808, + "ap-south-2": 0.8888, + "ap-southeast-1": 0.96, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.96, + "ap-southeast-5": 0.816, + "ap-southeast-7": 0.8976, + "ca-central-1": 0.9416, + "ca-west-1": 0.856, + "eu-central-1": 0.92, + "eu-central-2": 1.012, + "eu-north-1": 0.0, + "eu-south-1": 0.896, + "eu-west-1": 0.0, + "eu-west-2": 0.888, + "eu-west-3": 0.896, + "il-central-1": 0.8988, + "me-central-1": 1.03576, + "me-south-1": 1.056, + "mx-central-1": 0.0, + "sa-east-1": 1.3464, + "us-east-1": 0.8448, + "us-east-2": 0.768, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.896, + "us-west-2": 0.8448 + }, + "m6i.8xlarge": { + "af-south-1": 2.032, + "ap-east-1": 2.3232, + "ap-northeast-1": 1.984, + "ap-northeast-2": 1.888, + "ap-northeast-3": 1.984, + "ap-south-1": 1.616, + "ap-south-2": 1.616, + "ap-southeast-1": 1.92, + "ap-southeast-2": 1.92, + "ap-southeast-3": 1.92, + "ap-southeast-5": 1.632, + "ap-southeast-7": 1.632, + "ca-central-1": 1.712, + "ca-west-1": 1.712, + "eu-central-1": 1.84, + "eu-central-2": 2.024, + "eu-north-1": 1.632, + "eu-south-1": 0.0, + "eu-west-1": 1.8832, + "eu-west-2": 1.776, + "eu-west-3": 1.792, + "il-central-1": 1.97736, + "me-central-1": 1.8832, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 2.448, + "us-east-1": 1.536, + "us-east-2": 0.0, + "us-gov-east-1": 1.936, + "us-gov-west-1": 0.0, + "us-west-1": 1.792, + "us-west-2": 1.536 + }, + "m6i.12xlarge": { + "af-south-1": 3.3528, + "ap-east-1": 3.168, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.832, + "ap-northeast-3": 2.976, + "ap-south-1": 2.424, + "ap-south-2": 0.0, + "ap-southeast-1": 2.88, + "ap-southeast-2": 3.168, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.448, + "ca-central-1": 2.568, + "ca-west-1": 2.568, + "eu-central-1": 2.76, + "eu-central-2": 3.036, + "eu-north-1": 2.448, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 2.9304, + "eu-west-3": 2.688, + "il-central-1": 2.96604, + "me-central-1": 2.8248, + "me-south-1": 3.168, + "mx-central-1": 2.4192, + "sa-east-1": 3.672, + "us-east-1": 2.304, + "us-east-2": 2.304, + "us-gov-east-1": 2.904, + "us-gov-west-1": 2.904, + "us-west-1": 2.688, + "us-west-2": 2.304 + }, + "m6i.16xlarge": { + "af-south-1": 4.064, + "ap-east-1": 4.6464, + "ap-northeast-1": 4.3648, + "ap-northeast-2": 3.776, + "ap-northeast-3": 0.0, + "ap-south-1": 3.232, + "ap-south-2": 3.5552, + "ap-southeast-1": 3.84, + "ap-southeast-2": 3.84, + "ap-southeast-3": 0.0, + "ap-southeast-5": 3.264, + "ap-southeast-7": 0.0, + "ca-central-1": 3.424, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 4.048, + "eu-north-1": 3.264, + "eu-south-1": 3.584, + "eu-west-1": 3.424, + "eu-west-2": 3.552, + "eu-west-3": 3.9424, + "il-central-1": 0.0, + "me-central-1": 3.7664, + "me-south-1": 4.224, + "mx-central-1": 3.2256, + "sa-east-1": 0.0, + "us-east-1": 3.072, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.872, + "us-west-1": 3.584, + "us-west-2": 3.3792 + }, + "m6i.24xlarge": { + "af-south-1": 0.0, + "ap-east-1": 6.336, + "ap-northeast-1": 5.952, + "ap-northeast-2": 5.664, + "ap-northeast-3": 5.952, + "ap-south-1": 5.3328, + "ap-south-2": 4.848, + "ap-southeast-1": 5.76, + "ap-southeast-2": 5.76, + "ap-southeast-3": 5.76, + "ap-southeast-5": 4.896, + "ap-southeast-7": 4.896, + "ca-central-1": 0.0, + "ca-west-1": 5.6496, + "eu-central-1": 6.072, + "eu-central-2": 0.0, + "eu-north-1": 5.3856, + "eu-south-1": 5.376, + "eu-west-1": 5.6496, + "eu-west-2": 0.0, + "eu-west-3": 5.376, + "il-central-1": 5.93208, + "me-central-1": 5.6496, + "me-south-1": 6.9696, + "mx-central-1": 4.8384, + "sa-east-1": 8.0784, + "us-east-1": 4.608, + "us-east-2": 5.0688, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 4.608 + }, + "m6i.32xlarge": { + "af-south-1": 8.128, + "ap-east-1": 8.448, + "ap-northeast-1": 8.7296, + "ap-northeast-2": 8.3072, + "ap-northeast-3": 7.936, + "ap-south-1": 0.0, + "ap-south-2": 6.464, + "ap-southeast-1": 7.68, + "ap-southeast-2": 8.448, + "ap-southeast-3": 7.68, + "ap-southeast-5": 6.528, + "ap-southeast-7": 6.528, + "ca-central-1": 6.848, + "ca-west-1": 6.848, + "eu-central-1": 8.096, + "eu-central-2": 8.096, + "eu-north-1": 6.528, + "eu-south-1": 7.168, + "eu-west-1": 6.848, + "eu-west-2": 7.104, + "eu-west-3": 7.168, + "il-central-1": 7.1904, + "me-central-1": 7.5328, + "me-south-1": 8.448, + "mx-central-1": 6.4512, + "sa-east-1": 9.792, + "us-east-1": 6.7584, + "us-east-2": 6.144, + "us-gov-east-1": 7.744, + "us-gov-west-1": 7.744, + "us-west-1": 0.0, + "us-west-2": 6.144 + }, + "m6id": { + "ap-south-1": 9.018, + "ap-southeast-1": 10.423 + }, + "m6id.large": { + "ap-northeast-1": 0.1533, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.16286, + "ap-southeast-2": 0.16401, + "ap-southeast-5": 0.12584, + "ap-southeast-7": 0.12584, + "ca-central-1": 0.14553, + "ca-west-1": 0.14553, + "eu-central-1": 0.1428, + "eu-central-2": 0.15708, + "eu-west-1": 0.1323, + "eu-west-2": 0.13755, + "il-central-1": 0.13892, + "mx-central-1": 0.12458, + "sa-east-1": 0.189, + "us-east-1": 0.11865, + "us-east-2": 0.13052, + "us-gov-west-1": 0.1502, + "us-west-2": 0.11865 + }, + "m6id.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.2919, + "ap-south-1": 0.2562, + "ap-southeast-1": 0.2961, + "ap-southeast-2": 0.2982, + "ap-southeast-5": 0.25168, + "ap-southeast-7": 0.25168, + "ca-central-1": 0.2646, + "ca-west-1": 0.2646, + "eu-central-1": 0.2856, + "eu-central-2": 0.31416, + "eu-west-1": 0.29106, + "eu-west-2": 0.0, + "il-central-1": 0.30562, + "mx-central-1": 0.0, + "sa-east-1": 0.4158, + "us-east-1": 0.2373, + "us-east-2": 0.0, + "us-gov-west-1": 0.3004, + "us-west-2": 0.2373 + }, + "m6id.metal": { + "ap-northeast-1": 9.8112, + "ap-northeast-2": 9.3408, + "ap-south-1": 0.0, + "ap-southeast-1": 9.4752, + "ap-southeast-2": 9.5424, + "ap-southeast-5": 8.05376, + "ap-southeast-7": 8.05376, + "ca-central-1": 8.4672, + "ca-west-1": 8.4672, + "eu-central-1": 9.1392, + "eu-central-2": 10.05312, + "eu-west-1": 8.4672, + "eu-west-2": 8.8032, + "il-central-1": 0.0, + "mx-central-1": 7.97312, + "sa-east-1": 12.096, + "us-east-1": 0.0, + "us-east-2": 7.5936, + "us-gov-west-1": 9.6128, + "us-west-2": 7.5936 + }, + "m6id.2xlarge": { + "ap-northeast-1": 0.67452, + "ap-northeast-2": 0.5838, + "ap-south-1": 0.56364, + "ap-southeast-1": 0.65142, + "ap-southeast-2": 0.5964, + "ap-southeast-5": 0.50336, + "ap-southeast-7": 0.50336, + "ca-central-1": 0.0, + "ca-west-1": 0.58212, + "eu-central-1": 0.5712, + "eu-central-2": 0.69115, + "eu-west-1": 0.58212, + "eu-west-2": 0.60522, + "il-central-1": 0.55568, + "mx-central-1": 0.0, + "sa-east-1": 0.756, + "us-east-1": 0.4746, + "us-east-2": 0.4746, + "us-gov-west-1": 0.66088, + "us-west-2": 0.4746 + }, + "m6id.4xlarge": { + "ap-northeast-1": 1.2264, + "ap-northeast-2": 1.1676, + "ap-south-1": 1.0248, + "ap-southeast-1": 1.1844, + "ap-southeast-2": 1.1928, + "ap-southeast-5": 1.00672, + "ap-southeast-7": 1.00672, + "ca-central-1": 1.0584, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-west-1": 1.0584, + "eu-west-2": 1.1004, + "il-central-1": 1.11136, + "mx-central-1": 0.99664, + "sa-east-1": 1.512, + "us-east-1": 1.04412, + "us-east-2": 1.04412, + "us-gov-west-1": 1.2016, + "us-west-2": 0.9492 + }, + "m6id.8xlarge": { + "ap-northeast-1": 2.4528, + "ap-northeast-2": 2.3352, + "ap-south-1": 0.0, + "ap-southeast-1": 2.3688, + "ap-southeast-2": 2.3856, + "ap-southeast-5": 2.01344, + "ap-southeast-7": 2.21478, + "ca-central-1": 2.1168, + "ca-west-1": 2.1168, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-west-1": 2.1168, + "eu-west-2": 2.42088, + "il-central-1": 2.22272, + "mx-central-1": 1.99328, + "sa-east-1": 3.024, + "us-east-1": 0.0, + "us-east-2": 1.8984, + "us-gov-west-1": 2.4032, + "us-west-2": 1.8984 + }, + "m6id.12xlarge": { + "ap-northeast-1": 3.6792, + "ap-northeast-2": 3.5028, + "ap-south-1": 3.0744, + "ap-southeast-1": 3.5532, + "ap-southeast-2": 3.5784, + "ap-southeast-5": 3.02016, + "ap-southeast-7": 3.02016, + "ca-central-1": 3.49272, + "ca-west-1": 3.1752, + "eu-central-1": 0.0, + "eu-central-2": 3.76992, + "eu-west-1": 0.0, + "eu-west-2": 3.3012, + "il-central-1": 3.33408, + "mx-central-1": 2.98992, + "sa-east-1": 0.0, + "us-east-1": 2.8476, + "us-east-2": 0.0, + "us-gov-west-1": 3.6048, + "us-west-2": 2.8476 + }, + "m6id.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 4.50912, + "ap-southeast-1": 4.7376, + "ap-southeast-2": 4.7712, + "ap-southeast-5": 4.42957, + "ap-southeast-7": 4.02688, + "ca-central-1": 4.2336, + "ca-west-1": 4.2336, + "eu-central-1": 5.02656, + "eu-central-2": 5.02656, + "eu-west-1": 4.65696, + "eu-west-2": 4.4016, + "il-central-1": 4.44544, + "mx-central-1": 4.38522, + "sa-east-1": 6.048, + "us-east-1": 0.0, + "us-east-2": 3.7968, + "us-gov-west-1": 0.0, + "us-west-2": 4.17648 + }, + "m6id.24xlarge": { + "ap-northeast-1": 7.3584, + "ap-northeast-2": 7.70616, + "ap-south-1": 6.76368, + "ap-southeast-1": 0.0, + "ap-southeast-2": 7.1568, + "ap-southeast-5": 0.0, + "ap-southeast-7": 6.04032, + "ca-central-1": 6.98544, + "ca-west-1": 6.98544, + "eu-central-1": 6.8544, + "eu-central-2": 7.53984, + "eu-west-1": 6.98544, + "eu-west-2": 6.6024, + "il-central-1": 6.66816, + "mx-central-1": 5.97984, + "sa-east-1": 9.072, + "us-east-1": 5.6952, + "us-east-2": 0.0, + "us-gov-west-1": 7.2096, + "us-west-2": 5.6952 + }, + "m6id.32xlarge": { + "ap-northeast-1": 9.8112, + "ap-northeast-2": 9.3408, + "ap-south-1": 8.1984, + "ap-southeast-1": 9.4752, + "ap-southeast-2": 9.5424, + "ap-southeast-5": 8.05376, + "ap-southeast-7": 0.0, + "ca-central-1": 8.4672, + "ca-west-1": 8.4672, + "eu-central-1": 0.0, + "eu-central-2": 10.05312, + "eu-west-1": 8.4672, + "eu-west-2": 8.8032, + "il-central-1": 0.0, + "mx-central-1": 7.97312, + "sa-east-1": 12.096, + "us-east-1": 7.5936, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6idn": { + "us-west-1": 12.914 + }, + "m6idn.large": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.20124, + "ca-central-1": 0.17418, + "eu-central-1": 0.18954, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.17784, + "us-east-1": 0.0, + "us-east-2": 0.15912, + "us-gov-west-1": 0.20007, + "us-west-1": 0.18344, + "us-west-2": 0.15912 + }, + "m6idn.xlarge": { + "ap-northeast-1": 0.4095, + "ap-south-1": 0.0, + "ap-southeast-1": 0.39078, + "ap-southeast-2": 0.44273, + "ca-central-1": 0.34836, + "eu-central-1": 0.37908, + "eu-central-2": 0.0, + "eu-north-1": 0.332, + "eu-south-2": 0.3832, + "eu-west-1": 0.35568, + "us-east-1": 0.31824, + "us-east-2": 0.0, + "us-gov-west-1": 0.40014, + "us-west-1": 0.36688, + "us-west-2": 0.0 + }, + "m6idn.metal": { + "ap-northeast-1": 13.104, + "ap-south-1": 10.8576, + "ap-southeast-1": 12.50496, + "ap-southeast-2": 0.0, + "ca-central-1": 11.14752, + "eu-central-1": 12.13056, + "eu-central-2": 13.21984, + "eu-north-1": 10.624, + "eu-south-2": 11.14752, + "eu-west-1": 0.0, + "us-east-1": 10.18368, + "us-east-2": 10.18368, + "us-gov-west-1": 12.80448, + "us-west-1": 11.74016, + "us-west-2": 10.18368 + }, + "m6idn.2xlarge": { + "ap-northeast-1": 0.819, + "ap-south-1": 0.6786, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 0.69672, + "eu-central-1": 0.75816, + "eu-central-2": 0.90886, + "eu-north-1": 0.7304, + "eu-south-2": 0.69672, + "eu-west-1": 0.71136, + "us-east-1": 0.63648, + "us-east-2": 0.63648, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6idn.4xlarge": { + "ap-northeast-1": 1.638, + "ap-south-1": 1.3572, + "ap-southeast-1": 1.56312, + "ap-southeast-2": 1.77091, + "ca-central-1": 1.53278, + "eu-central-1": 1.51632, + "eu-central-2": 1.81773, + "eu-north-1": 1.328, + "eu-south-2": 0.0, + "eu-west-1": 1.42272, + "us-east-1": 1.40026, + "us-east-2": 1.27296, + "us-gov-west-1": 1.76062, + "us-west-1": 1.61427, + "us-west-2": 0.0 + }, + "m6idn.8xlarge": { + "ap-northeast-1": 3.6036, + "ap-south-1": 0.0, + "ap-southeast-1": 3.43886, + "ap-southeast-2": 3.21984, + "ca-central-1": 2.78688, + "eu-central-1": 3.03264, + "eu-central-2": 3.30496, + "eu-north-1": 2.9216, + "eu-south-2": 0.0, + "eu-west-1": 2.84544, + "us-east-1": 2.54592, + "us-east-2": 2.54592, + "us-gov-west-1": 3.20112, + "us-west-1": 2.93504, + "us-west-2": 2.80051 + }, + "m6idn.12xlarge": { + "ap-northeast-1": 4.914, + "ap-south-1": 4.47876, + "ap-southeast-1": 4.68936, + "ap-southeast-2": 4.82976, + "ca-central-1": 4.18032, + "eu-central-1": 4.54896, + "eu-central-2": 4.95744, + "eu-north-1": 3.984, + "eu-south-2": 4.18032, + "eu-west-1": 0.0, + "us-east-1": 3.81888, + "us-east-2": 3.81888, + "us-gov-west-1": 4.80168, + "us-west-1": 4.40256, + "us-west-2": 3.81888 + }, + "m6idn.16xlarge": { + "ap-northeast-1": 6.552, + "ap-south-1": 5.4288, + "ap-southeast-1": 6.25248, + "ap-southeast-2": 6.43968, + "ca-central-1": 6.13114, + "eu-central-1": 6.06528, + "eu-central-2": 0.0, + "eu-north-1": 5.312, + "eu-south-2": 0.0, + "eu-west-1": 5.69088, + "us-east-1": 5.09184, + "us-east-2": 0.0, + "us-gov-west-1": 6.40224, + "us-west-1": 5.87008, + "us-west-2": 0.0 + }, + "m6idn.24xlarge": { + "ap-northeast-1": 9.828, + "ap-south-1": 8.95752, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 8.36064, + "eu-central-1": 0.0, + "eu-central-2": 9.91488, + "eu-north-1": 7.968, + "eu-south-2": 8.36064, + "eu-west-1": 8.53632, + "us-east-1": 8.40154, + "us-east-2": 8.40154, + "us-gov-west-1": 9.60336, + "us-west-1": 0.0, + "us-west-2": 7.63776 + }, + "m6idn.32xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 12.50496, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 13.21984, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 11.38176, + "us-east-1": 10.18368, + "us-east-2": 10.18368, + "us-gov-west-1": 12.80448, + "us-west-1": 11.74016, + "us-west-2": 10.18368 + }, + "m6in": { + "ap-northeast-1": 12.602, + "ap-southeast-1": 12.026, + "eu-central-2": 12.916, + "us-west-2": 9.802 + }, + "m6in.large": { + "ap-northeast-1": 0.17901, + "ap-south-1": 0.14508, + "ap-southeast-1": 0.17082, + "ap-southeast-2": 0.19305, + "ca-central-1": 0.1707, + "eu-central-1": 0.16497, + "eu-central-2": 0.18346, + "eu-north-1": 0.0, + "eu-south-2": 0.15518, + "eu-west-1": 0.17117, + "us-east-1": 0.15315, + "us-east-2": 0.13923, + "us-gov-west-1": 0.17433, + "us-west-1": 0.17868, + "us-west-2": 0.15315 + }, + "m6in.xlarge": { + "ap-northeast-1": 0.35802, + "ap-south-1": 0.29016, + "ap-southeast-1": 0.3758, + "ap-southeast-2": 0.351, + "ca-central-1": 0.3414, + "eu-central-1": 0.36293, + "eu-central-2": 0.36692, + "eu-north-1": 0.296, + "eu-south-2": 0.31036, + "eu-west-1": 0.31122, + "us-east-1": 0.27846, + "us-east-2": 0.27846, + "us-gov-west-1": 0.34866, + "us-west-1": 0.32488, + "us-west-2": 0.27846 + }, + "m6in.metal": { + "ap-northeast-1": 11.45664, + "ap-south-1": 9.28512, + "ap-southeast-1": 10.93248, + "ap-southeast-2": 0.0, + "ca-central-1": 9.93152, + "eu-central-1": 10.55808, + "eu-central-2": 0.0, + "eu-north-1": 9.472, + "eu-south-2": 9.93152, + "eu-west-1": 9.95904, + "us-east-1": 8.91072, + "us-east-2": 0.0, + "us-gov-west-1": 11.15712, + "us-west-1": 10.39616, + "us-west-2": 8.91072 + }, + "m6in.2xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.58032, + "ap-southeast-1": 0.68328, + "ap-southeast-2": 0.702, + "ca-central-1": 0.68279, + "eu-central-1": 0.65988, + "eu-central-2": 0.80722, + "eu-north-1": 0.6512, + "eu-south-2": 0.62072, + "eu-west-1": 0.68468, + "us-east-1": 0.55692, + "us-east-2": 0.55692, + "us-gov-west-1": 0.76705, + "us-west-1": 0.71474, + "us-west-2": 0.55692 + }, + "m6in.4xlarge": { + "ap-northeast-1": 1.43208, + "ap-south-1": 1.16064, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.404, + "ca-central-1": 0.0, + "eu-central-1": 1.31976, + "eu-central-2": 1.46768, + "eu-north-1": 1.184, + "eu-south-2": 1.36558, + "eu-west-1": 1.24488, + "us-east-1": 1.11384, + "us-east-2": 1.11384, + "us-gov-west-1": 1.39464, + "us-west-1": 1.29952, + "us-west-2": 1.11384 + }, + "m6in.8xlarge": { + "ap-northeast-1": 2.86416, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.808, + "ca-central-1": 2.48288, + "eu-central-1": 2.90347, + "eu-central-2": 2.93536, + "eu-north-1": 0.0, + "eu-south-2": 2.48288, + "eu-west-1": 2.48976, + "us-east-1": 2.22768, + "us-east-2": 2.45045, + "us-gov-west-1": 2.78928, + "us-west-1": 2.59904, + "us-west-2": 2.22768 + }, + "m6in.12xlarge": { + "ap-northeast-1": 4.72586, + "ap-south-1": 3.48192, + "ap-southeast-1": 4.09968, + "ap-southeast-2": 4.212, + "ca-central-1": 0.0, + "eu-central-1": 4.35521, + "eu-central-2": 4.84334, + "eu-north-1": 3.552, + "eu-south-2": 3.72432, + "eu-west-1": 3.73464, + "us-east-1": 0.0, + "us-east-2": 3.34152, + "us-gov-west-1": 4.60231, + "us-west-1": 0.0, + "us-west-2": 3.34152 + }, + "m6in.16xlarge": { + "ap-northeast-1": 5.72832, + "ap-south-1": 5.10682, + "ap-southeast-1": 5.46624, + "ap-southeast-2": 6.1776, + "ca-central-1": 4.96576, + "eu-central-1": 5.27904, + "eu-central-2": 5.87072, + "eu-north-1": 0.0, + "eu-south-2": 5.46234, + "eu-west-1": 4.97952, + "us-east-1": 4.9009, + "us-east-2": 4.9009, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 4.45536 + }, + "m6in.24xlarge": { + "ap-northeast-1": 9.45173, + "ap-south-1": 6.96384, + "ap-southeast-1": 8.19936, + "ap-southeast-2": 8.424, + "ca-central-1": 7.44864, + "eu-central-1": 7.91856, + "eu-central-2": 8.80608, + "eu-north-1": 7.104, + "eu-south-2": 7.44864, + "eu-west-1": 0.0, + "us-east-1": 7.35134, + "us-east-2": 7.35134, + "us-gov-west-1": 8.36784, + "us-west-1": 0.0, + "us-west-2": 6.68304 + }, + "m6in.32xlarge": { + "ap-northeast-1": 11.45664, + "ap-south-1": 0.0, + "ap-southeast-1": 10.93248, + "ap-southeast-2": 11.232, + "ca-central-1": 9.93152, + "eu-central-1": 10.55808, + "eu-central-2": 11.74144, + "eu-north-1": 9.472, + "eu-south-2": 9.93152, + "eu-west-1": 9.95904, + "us-east-1": 8.91072, + "us-east-2": 0.0, + "us-gov-west-1": 11.15712, + "us-west-1": 10.39616, + "us-west-2": 8.91072 + }, + "m7a": { + "eu-north-1": 13.006, + "us-east-1": 12.241 + }, + "m7a.medium": { + "ap-northeast-1": 0.07487, + "eu-central-1": 0.0, + "eu-north-1": 0.06774, + "eu-south-2": 0.0, + "eu-west-1": 0.0646, + "us-east-1": 0.05796, + "us-east-2": 0.05796, + "us-west-2": 0.05796 + }, + "m7a.large": { + "ap-northeast-1": 0.14973, + "eu-central-1": 0.15275, + "eu-north-1": 0.12316, + "eu-south-2": 0.1292, + "eu-west-1": 0.1292, + "us-east-1": 0.12751, + "us-east-2": 0.11592, + "us-west-2": 0.11592 + }, + "m7a.xlarge": { + "ap-northeast-1": 0.29946, + "eu-central-1": 0.27772, + "eu-north-1": 0.24632, + "eu-south-2": 0.2584, + "eu-west-1": 0.2584, + "us-east-1": 0.25502, + "us-east-2": 0.23184, + "us-west-2": 0.25502 + }, + "m7a.metal-48xl": { + "ap-northeast-1": 14.37408, + "eu-central-1": 0.0, + "eu-north-1": 11.82336, + "eu-south-2": 12.4032, + "eu-west-1": 12.4032, + "us-east-1": 11.12832, + "us-east-2": 11.12832, + "us-west-2": 11.12832 + }, + "m7a.2xlarge": { + "ap-northeast-1": 0.59892, + "eu-central-1": 0.55544, + "eu-north-1": 0.49264, + "eu-south-2": 0.0, + "eu-west-1": 0.5168, + "us-east-1": 0.46368, + "us-east-2": 0.46368, + "us-west-2": 0.46368 + }, + "m7a.4xlarge": { + "ap-northeast-1": 1.19784, + "eu-central-1": 1.11088, + "eu-north-1": 1.08381, + "eu-south-2": 1.0336, + "eu-west-1": 1.0336, + "us-east-1": 0.0, + "us-east-2": 0.92736, + "us-west-2": 0.92736 + }, + "m7a.8xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 2.22176, + "eu-north-1": 1.97056, + "eu-south-2": 2.0672, + "eu-west-1": 2.27392, + "us-east-1": 2.04019, + "us-east-2": 1.85472, + "us-west-2": 0.0 + }, + "m7a.12xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 2.95584, + "eu-south-2": 3.1008, + "eu-west-1": 3.1008, + "us-east-1": 2.78208, + "us-east-2": 2.78208, + "us-west-2": 0.0 + }, + "m7a.16xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 4.1344, + "eu-west-1": 4.54784, + "us-east-1": 3.70944, + "us-east-2": 3.70944, + "us-west-2": 4.08038 + }, + "m7a.24xlarge": { + "ap-northeast-1": 7.18704, + "eu-central-1": 7.33181, + "eu-north-1": 5.91168, + "eu-south-2": 0.0, + "eu-west-1": 6.2016, + "us-east-1": 5.56416, + "us-east-2": 5.56416, + "us-west-2": 0.0 + }, + "m7a.32xlarge": { + "ap-northeast-1": 10.54099, + "eu-central-1": 8.88704, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 8.2688, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "m7a.48xlarge": { + "ap-northeast-1": 14.37408, + "eu-central-1": 13.33056, + "eu-north-1": 0.0, + "eu-south-2": 12.4032, + "eu-west-1": 12.4032, + "us-east-1": 0.0, + "us-east-2": 11.12832, + "us-west-2": 0.0 + }, + "m7g": { + "me-central-1": 10.565 + }, + "m7g.medium": { + "ap-northeast-1": 0.0527, + "ap-northeast-2": 0.0502, + "ap-northeast-3": 0.0527, + "ap-south-1": 0.0292, + "ap-south-2": 0.031, + "ap-southeast-1": 0.051, + "ap-southeast-2": 0.051, + "ap-southeast-3": 0.051, + "ap-southeast-4": 0.051, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0434, + "ca-central-1": 0.0, + "eu-central-1": 0.0489, + "eu-north-1": 0.0434, + "eu-south-2": 0.0455, + "eu-west-1": 0.0455, + "eu-west-2": 0.0501, + "eu-west-3": 0.0, + "me-central-1": 0.05, + "me-south-1": 0.0, + "mx-central-1": 0.0428, + "sa-east-1": 0.065, + "us-east-1": 0.0408, + "us-east-2": 0.0408, + "us-gov-east-1": 0.0514, + "us-west-1": 0.0476, + "us-west-2": 0.0408 + }, + "m7g.large": { + "ap-northeast-1": 0.1054, + "ap-northeast-2": 0.1003, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0583, + "ap-south-2": 0.0, + "ap-southeast-1": 0.102, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1084, + "ap-southeast-4": 0.102, + "ap-southeast-5": 0.0922, + "ap-southeast-7": 0.0922, + "ca-central-1": 0.0, + "eu-central-1": 0.0978, + "eu-north-1": 0.0922, + "eu-south-2": 0.0966, + "eu-west-1": 0.091, + "eu-west-2": 0.0944, + "eu-west-3": 0.0952, + "me-central-1": 0.1, + "me-south-1": 0.1122, + "mx-central-1": 0.0857, + "sa-east-1": 0.1301, + "us-east-1": 0.0816, + "us-east-2": 0.0816, + "us-gov-east-1": 0.1093, + "us-west-1": 0.0952, + "us-west-2": 0.0816 + }, + "m7g.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.2006, + "ap-northeast-3": 0.2108, + "ap-south-1": 0.1166, + "ap-south-2": 0.1166, + "ap-southeast-1": 0.2169, + "ap-southeast-2": 0.204, + "ap-southeast-3": 0.204, + "ap-southeast-4": 0.204, + "ap-southeast-5": 0.1734, + "ap-southeast-7": 0.1843, + "ca-central-1": 0.1819, + "eu-central-1": 0.1955, + "eu-north-1": 0.1734, + "eu-south-2": 0.1818, + "eu-west-1": 0.1819, + "eu-west-2": 0.1887, + "eu-west-3": 0.0, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 0.1714, + "sa-east-1": 0.2755, + "us-east-1": 0.1632, + "us-east-2": 0.1735, + "us-gov-east-1": 0.2056, + "us-west-1": 0.0, + "us-west-2": 0.1735 + }, + "m7g.metal": { + "ap-northeast-1": 3.3728, + "ap-northeast-2": 3.2096, + "ap-northeast-3": 3.3728, + "ap-south-1": 1.8662, + "ap-south-2": 1.8662, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 3.264, + "ap-southeast-4": 0.0, + "ap-southeast-5": 2.7744, + "ap-southeast-7": 2.7744, + "ca-central-1": 2.9107, + "eu-central-1": 3.1283, + "eu-north-1": 2.7744, + "eu-south-2": 2.9088, + "eu-west-1": 0.0, + "eu-west-2": 3.0195, + "eu-west-3": 3.0464, + "me-central-1": 3.2014, + "me-south-1": 3.5904, + "mx-central-1": 2.7418, + "sa-east-1": 4.1616, + "us-east-1": 2.6112, + "us-east-2": 2.6112, + "us-gov-east-1": 3.2896, + "us-west-1": 0.0, + "us-west-2": 2.6112 + }, + "m7g.2xlarge": { + "ap-northeast-1": 0.4482, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.4216, + "ap-south-1": 0.248, + "ap-south-2": 0.2333, + "ap-southeast-1": 0.408, + "ap-southeast-2": 0.408, + "ap-southeast-3": 0.4337, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.3686, + "ap-southeast-7": 0.3468, + "ca-central-1": 0.3638, + "eu-central-1": 0.0, + "eu-north-1": 0.3686, + "eu-south-2": 0.3636, + "eu-west-1": 0.3867, + "eu-west-2": 0.3774, + "eu-west-3": 0.3808, + "me-central-1": 0.4002, + "me-south-1": 0.0, + "mx-central-1": 0.3427, + "sa-east-1": 0.5202, + "us-east-1": 0.3264, + "us-east-2": 0.347, + "us-gov-east-1": 0.4371, + "us-west-1": 0.0, + "us-west-2": 0.3264 + }, + "m7g.4xlarge": { + "ap-northeast-1": 0.8964, + "ap-northeast-2": 0.8024, + "ap-northeast-3": 0.8432, + "ap-south-1": 0.0, + "ap-south-2": 0.4666, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.816, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.8674, + "ap-southeast-5": 0.6936, + "ap-southeast-7": 0.6936, + "ca-central-1": 0.7277, + "eu-central-1": 0.7821, + "eu-north-1": 0.6936, + "eu-south-2": 0.7272, + "eu-west-1": 0.7276, + "eu-west-2": 0.7549, + "eu-west-3": 0.8094, + "me-central-1": 0.0, + "me-south-1": 0.9541, + "mx-central-1": 0.6854, + "sa-east-1": 1.1018, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.8224, + "us-west-1": 0.7616, + "us-west-2": 0.6528 + }, + "m7g.8xlarge": { + "ap-northeast-1": 1.7928, + "ap-northeast-2": 1.7048, + "ap-northeast-3": 0.0, + "ap-south-1": 0.9331, + "ap-south-2": 0.9919, + "ap-southeast-1": 1.632, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.632, + "ap-southeast-4": 0.0, + "ap-southeast-5": 1.3872, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 1.5642, + "eu-north-1": 1.3872, + "eu-south-2": 1.4544, + "eu-west-1": 1.4552, + "eu-west-2": 1.5098, + "eu-west-3": 1.6189, + "me-central-1": 1.6007, + "me-south-1": 1.9083, + "mx-central-1": 1.4572, + "sa-east-1": 2.0808, + "us-east-1": 1.3056, + "us-east-2": 1.3879, + "us-gov-east-1": 1.7484, + "us-west-1": 1.6189, + "us-west-2": 1.3056 + }, + "m7g.12xlarge": { + "ap-northeast-1": 2.6892, + "ap-northeast-2": 2.4072, + "ap-northeast-3": 2.5296, + "ap-south-1": 0.0, + "ap-south-2": 1.4879, + "ap-southeast-1": 2.6022, + "ap-southeast-2": 2.6022, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 2.0808, + "ap-southeast-7": 2.2119, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 2.1816, + "eu-west-1": 2.1828, + "eu-west-2": 2.4071, + "eu-west-3": 2.2848, + "me-central-1": 2.4011, + "me-south-1": 2.6928, + "mx-central-1": 2.0563, + "sa-east-1": 0.0, + "us-east-1": 1.9584, + "us-east-2": 1.9584, + "us-gov-east-1": 2.4672, + "us-west-1": 2.2848, + "us-west-2": 1.9584 + }, + "m7g.16xlarge": { + "ap-northeast-1": 3.3728, + "ap-northeast-2": 3.2096, + "ap-northeast-3": 0.0, + "ap-south-1": 1.8662, + "ap-south-2": 1.8662, + "ap-southeast-1": 3.264, + "ap-southeast-2": 3.264, + "ap-southeast-3": 3.264, + "ap-southeast-4": 3.264, + "ap-southeast-5": 2.7744, + "ap-southeast-7": 2.7744, + "ca-central-1": 2.9107, + "eu-central-1": 3.1283, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 3.0195, + "eu-west-3": 3.0464, + "me-central-1": 3.2014, + "me-south-1": 3.5904, + "mx-central-1": 2.7418, + "sa-east-1": 4.1616, + "us-east-1": 2.6112, + "us-east-2": 2.6112, + "us-gov-east-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m7gd": { + "sa-east-1": 17.963 + }, + "m7gd.medium": { + "ap-northeast-1": 0.0731, + "ap-south-1": 0.0376, + "ap-southeast-1": 0.0706, + "ap-southeast-2": 0.0711, + "ap-southeast-5": 0.0566, + "ap-southeast-7": 0.06, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.0595, + "eu-west-1": 0.0595, + "eu-west-3": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0534, + "us-east-2": 0.0566, + "us-west-1": 0.0, + "us-west-2": 0.0566 + }, + "m7gd.large": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.071, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "eu-central-1": 0.1285, + "eu-north-1": 0.0, + "eu-south-2": 0.1262, + "eu-west-1": 0.1191, + "eu-west-3": 0.1322, + "mx-central-1": 0.1121, + "sa-east-1": 0.1701, + "us-east-1": 0.1132, + "us-east-2": 0.1068, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m7gd.xlarge": { + "ap-northeast-1": 0.2925, + "ap-south-1": 0.142, + "ap-southeast-1": 0.2665, + "ap-southeast-2": 0.2684, + "ap-southeast-5": 0.2265, + "ap-southeast-7": 0.2265, + "eu-central-1": 0.257, + "eu-north-1": 0.2404, + "eu-south-2": 0.2381, + "eu-west-1": 0.2381, + "eu-west-3": 0.2495, + "mx-central-1": 0.0, + "sa-east-1": 0.3402, + "us-east-1": 0.2136, + "us-east-2": 0.0, + "us-west-1": 0.2665, + "us-west-2": 0.2136 + }, + "m7gd.metal": { + "ap-northeast-1": 4.415, + "ap-south-1": 2.272, + "ap-southeast-1": 4.2638, + "ap-southeast-2": 4.2941, + "ap-southeast-5": 0.0, + "ap-southeast-7": 3.6243, + "eu-central-1": 4.1126, + "eu-north-1": 3.6288, + "eu-south-2": 0.0, + "eu-west-1": 3.8102, + "eu-west-3": 3.9917, + "mx-central-1": 3.5878, + "sa-east-1": 0.0, + "us-east-1": 3.4171, + "us-east-2": 3.4171, + "us-west-1": 4.0219, + "us-west-2": 0.0 + }, + "m7gd.2xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.284, + "ap-southeast-1": 0.533, + "ap-southeast-2": 0.5368, + "ap-southeast-5": 0.453, + "ap-southeast-7": 0.4802, + "eu-central-1": 0.5141, + "eu-north-1": 0.4536, + "eu-south-2": 0.5049, + "eu-west-1": 0.4763, + "eu-west-3": 0.0, + "mx-central-1": 0.4754, + "sa-east-1": 0.6804, + "us-east-1": 0.4271, + "us-east-2": 0.4271, + "us-west-1": 0.5027, + "us-west-2": 0.4528 + }, + "m7gd.4xlarge": { + "ap-northeast-1": 1.1038, + "ap-south-1": 0.568, + "ap-southeast-1": 1.066, + "ap-southeast-2": 1.0735, + "ap-southeast-5": 0.9061, + "ap-southeast-7": 0.0, + "eu-central-1": 1.0282, + "eu-north-1": 0.9072, + "eu-south-2": 0.9526, + "eu-west-1": 0.9526, + "eu-west-3": 0.9979, + "mx-central-1": 0.897, + "sa-east-1": 1.3608, + "us-east-1": 0.8543, + "us-east-2": 0.9055, + "us-west-1": 1.0055, + "us-west-2": 0.8543 + }, + "m7gd.8xlarge": { + "ap-northeast-1": 2.34, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.147, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.8122, + "eu-central-1": 0.0, + "eu-north-1": 1.8144, + "eu-south-2": 0.0, + "eu-west-1": 1.9051, + "eu-west-3": 1.9958, + "mx-central-1": 1.7939, + "sa-east-1": 2.8787, + "us-east-1": 1.7086, + "us-east-2": 1.8111, + "us-west-1": 2.011, + "us-west-2": 1.8111 + }, + "m7gd.12xlarge": { + "ap-northeast-1": 3.51, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.2206, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.8813, + "eu-central-1": 0.0, + "eu-north-1": 2.7216, + "eu-south-2": 2.8577, + "eu-west-1": 2.8577, + "eu-west-3": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 4.0824, + "us-east-1": 2.5628, + "us-east-2": 0.0, + "us-west-1": 0.0, + "us-west-2": 2.5628 + }, + "m7gd.16xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 2.272, + "ap-southeast-1": 4.2638, + "ap-southeast-2": 0.0, + "ap-southeast-5": 3.6243, + "ap-southeast-7": 3.6243, + "eu-central-1": 0.0, + "eu-north-1": 3.6288, + "eu-south-2": 0.0, + "eu-west-1": 3.8102, + "eu-west-3": 3.9917, + "mx-central-1": 3.5878, + "sa-east-1": 5.4432, + "us-east-1": 3.4171, + "us-east-2": 3.4171, + "us-west-1": 4.0219, + "us-west-2": 3.4171 + }, + "m7i": { + "eu-south-2": 11.864 + }, + "m7i.large": { + "ap-northeast-1": 0.1302, + "ap-northeast-2": 0.1239, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.126, + "ap-southeast-3": 0.126, + "ap-southeast-5": 0.1071, + "ap-southeast-7": 0.1071, + "ca-central-1": 0.11235, + "eu-central-1": 0.12075, + "eu-north-1": 0.1071, + "eu-south-2": 0.12359, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "mx-central-1": 0.10584, + "sa-east-1": 0.16065, + "us-east-1": 0.1008, + "us-east-2": 0.1008, + "us-gov-east-1": 0.12705, + "us-gov-west-1": 0.12705, + "us-west-1": 0.1176, + "us-west-2": 0.1008 + }, + "m7i.xlarge": { + "ap-northeast-1": 0.2604, + "ap-northeast-2": 0.2478, + "ap-south-1": 0.2121, + "ap-southeast-1": 0.252, + "ap-southeast-2": 0.252, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.2142, + "ap-southeast-7": 0.23562, + "ca-central-1": 0.2247, + "eu-central-1": 0.26565, + "eu-north-1": 0.2142, + "eu-south-2": 0.2247, + "eu-west-1": 0.2247, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "mx-central-1": 0.21168, + "sa-east-1": 0.3213, + "us-east-1": 0.22176, + "us-east-2": 0.22176, + "us-gov-east-1": 0.2541, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m7i.metal-24xl": { + "ap-northeast-1": 6.87456, + "ap-northeast-2": 0.0, + "ap-south-1": 5.0904, + "ap-southeast-1": 6.048, + "ap-southeast-2": 6.6528, + "ap-southeast-3": 6.048, + "ap-southeast-5": 5.65488, + "ap-southeast-7": 5.1408, + "ca-central-1": 5.93208, + "eu-central-1": 5.796, + "eu-north-1": 5.65488, + "eu-south-2": 5.3928, + "eu-west-1": 5.93208, + "eu-west-2": 6.15384, + "eu-west-3": 0.0, + "mx-central-1": 5.08032, + "sa-east-1": 7.7112, + "us-east-1": 4.8384, + "us-east-2": 5.32224, + "us-gov-east-1": 6.0984, + "us-gov-west-1": 6.0984, + "us-west-1": 5.6448, + "us-west-2": 4.8384 + }, + "m7i.metal-48xl": { + "ap-northeast-1": 12.4992, + "ap-northeast-2": 0.0, + "ap-south-1": 10.1808, + "ap-southeast-1": 12.096, + "ap-southeast-2": 12.096, + "ap-southeast-3": 12.096, + "ap-southeast-5": 10.2816, + "ap-southeast-7": 10.2816, + "ca-central-1": 10.7856, + "eu-central-1": 11.592, + "eu-north-1": 10.2816, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 11.2896, + "mx-central-1": 10.16064, + "sa-east-1": 15.4224, + "us-east-1": 9.6768, + "us-east-2": 9.6768, + "us-gov-east-1": 12.1968, + "us-gov-west-1": 0.0, + "us-west-1": 11.2896, + "us-west-2": 0.0 + }, + "m7i.2xlarge": { + "ap-northeast-1": 0.5208, + "ap-northeast-2": 0.4956, + "ap-south-1": 0.46662, + "ap-southeast-1": 0.5544, + "ap-southeast-2": 0.504, + "ap-southeast-3": 0.504, + "ap-southeast-5": 0.4284, + "ap-southeast-7": 0.47124, + "ca-central-1": 0.4494, + "eu-central-1": 0.483, + "eu-north-1": 0.4284, + "eu-south-2": 0.0, + "eu-west-1": 0.49434, + "eu-west-2": 0.51282, + "eu-west-3": 0.4704, + "mx-central-1": 0.4657, + "sa-east-1": 0.6426, + "us-east-1": 0.4032, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.5082, + "us-west-1": 0.4704, + "us-west-2": 0.0 + }, + "m7i.4xlarge": { + "ap-northeast-1": 1.14576, + "ap-northeast-2": 0.9912, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.1088, + "ap-southeast-3": 1.1088, + "ap-southeast-5": 0.8568, + "ap-southeast-7": 0.8568, + "ca-central-1": 0.8988, + "eu-central-1": 0.0, + "eu-north-1": 0.8568, + "eu-south-2": 0.98868, + "eu-west-1": 0.8988, + "eu-west-2": 0.9324, + "eu-west-3": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.88704, + "us-east-2": 0.8064, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.0164, + "us-west-1": 0.0, + "us-west-2": 0.8064 + }, + "m7i.8xlarge": { + "ap-northeast-1": 2.29152, + "ap-northeast-2": 2.18064, + "ap-south-1": 0.0, + "ap-southeast-1": 2.016, + "ap-southeast-2": 2.016, + "ap-southeast-3": 0.0, + "ap-southeast-5": 1.7136, + "ap-southeast-7": 1.7136, + "ca-central-1": 1.7976, + "eu-central-1": 0.0, + "eu-north-1": 1.7136, + "eu-south-2": 1.7976, + "eu-west-1": 1.7976, + "eu-west-2": 1.8648, + "eu-west-3": 0.0, + "mx-central-1": 1.69344, + "sa-east-1": 2.5704, + "us-east-1": 1.6128, + "us-east-2": 1.77408, + "us-gov-east-1": 2.0328, + "us-gov-west-1": 2.0328, + "us-west-1": 1.8816, + "us-west-2": 1.6128 + }, + "m7i.12xlarge": { + "ap-northeast-1": 3.1248, + "ap-northeast-2": 3.27096, + "ap-south-1": 2.5452, + "ap-southeast-1": 3.024, + "ap-southeast-2": 3.3264, + "ap-southeast-3": 3.024, + "ap-southeast-5": 2.5704, + "ap-southeast-7": 0.0, + "ca-central-1": 2.96604, + "eu-central-1": 3.1878, + "eu-north-1": 2.5704, + "eu-south-2": 2.6964, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 2.8224, + "mx-central-1": 2.54016, + "sa-east-1": 3.8556, + "us-east-1": 2.4192, + "us-east-2": 2.4192, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.35412, + "us-west-1": 2.8224, + "us-west-2": 2.66112 + }, + "m7i.16xlarge": { + "ap-northeast-1": 4.1664, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 4.4352, + "ap-southeast-2": 4.4352, + "ap-southeast-3": 4.032, + "ap-southeast-5": 3.4272, + "ap-southeast-7": 0.0, + "ca-central-1": 3.5952, + "eu-central-1": 3.864, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 3.5952, + "eu-west-2": 3.7296, + "eu-west-3": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 5.1408, + "us-east-1": 3.2256, + "us-east-2": 3.2256, + "us-gov-east-1": 4.0656, + "us-gov-west-1": 4.0656, + "us-west-1": 3.7632, + "us-west-2": 0.0 + }, + "m7i.24xlarge": { + "ap-northeast-1": 6.87456, + "ap-northeast-2": 6.54192, + "ap-south-1": 0.0, + "ap-southeast-1": 6.048, + "ap-southeast-2": 6.048, + "ap-southeast-3": 6.048, + "ap-southeast-5": 5.1408, + "ap-southeast-7": 5.1408, + "ca-central-1": 5.93208, + "eu-central-1": 5.796, + "eu-north-1": 0.0, + "eu-south-2": 5.93208, + "eu-west-1": 5.3928, + "eu-west-2": 6.15384, + "eu-west-3": 5.6448, + "mx-central-1": 5.08032, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 6.0984, + "us-west-1": 5.6448, + "us-west-2": 4.8384 + }, + "m7i.48xlarge": { + "ap-northeast-1": 12.4992, + "ap-northeast-2": 11.8944, + "ap-south-1": 0.0, + "ap-southeast-1": 12.096, + "ap-southeast-2": 12.096, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 10.7856, + "eu-west-1": 10.7856, + "eu-west-2": 11.1888, + "eu-west-3": 11.2896, + "mx-central-1": 10.16064, + "sa-east-1": 15.4224, + "us-east-1": 9.6768, + "us-east-2": 9.6768, + "us-gov-east-1": 12.1968, + "us-gov-west-1": 12.1968, + "us-west-1": 11.2896, + "us-west-2": 9.6768 + }, + "m7i-flex.large": { + "ap-northeast-1": 0.12369, + "ap-northeast-2": 0.11771, + "ap-south-1": 0.10075, + "ap-southeast-1": 0.1197, + "ap-southeast-2": 0.1197, + "ap-southeast-3": 0.1197, + "ap-southeast-5": 0.10175, + "ca-central-1": 0.10673, + "eu-central-1": 0.11471, + "eu-north-1": 0.10175, + "eu-south-2": 0.10673, + "eu-west-1": 0.10673, + "eu-west-2": 0.11072, + "eu-west-3": 0.11172, + "sa-east-1": 0.15262, + "us-east-1": 0.09576, + "us-east-2": 0.09576, + "us-gov-east-1": 0.1207, + "us-gov-west-1": 0.1207, + "us-west-1": 0.11172, + "us-west-2": 0.09576 + }, + "m7i-flex.xlarge": { + "ap-northeast-1": 0.24738, + "ap-northeast-2": 0.23542, + "ap-south-1": 0.2015, + "ap-southeast-1": 0.2394, + "ap-southeast-2": 0.2394, + "ap-southeast-3": 0.2394, + "ap-southeast-5": 0.20349, + "ca-central-1": 0.21346, + "eu-central-1": 0.22942, + "eu-north-1": 0.2035, + "eu-south-2": 0.21346, + "eu-west-1": 0.21346, + "eu-west-2": 0.22144, + "eu-west-3": 0.22344, + "sa-east-1": 0.30524, + "us-east-1": 0.19152, + "us-east-2": 0.19152, + "us-gov-east-1": 0.2414, + "us-gov-west-1": 0.2414, + "us-west-1": 0.22344, + "us-west-2": 0.19152 + }, + "m7i-flex.2xlarge": { + "ap-northeast-1": 0.49476, + "ap-northeast-2": 0.47084, + "ap-south-1": 0.403, + "ap-southeast-1": 0.4788, + "ap-southeast-2": 0.4788, + "ap-southeast-3": 0.4788, + "ap-southeast-5": 0.40698, + "ca-central-1": 0.42692, + "eu-central-1": 0.45884, + "eu-north-1": 0.407, + "eu-south-2": 0.42692, + "eu-west-1": 0.42692, + "eu-west-2": 0.44288, + "eu-west-3": 0.44688, + "sa-east-1": 0.61048, + "us-east-1": 0.38304, + "us-east-2": 0.38304, + "us-gov-east-1": 0.4828, + "us-gov-west-1": 0.4828, + "us-west-1": 0.44688, + "us-west-2": 0.38304 + }, + "m7i-flex.4xlarge": { + "ap-northeast-1": 0.98952, + "ap-northeast-2": 0.94168, + "ap-south-1": 0.806, + "ap-southeast-1": 0.9576, + "ap-southeast-2": 0.9576, + "ap-southeast-3": 0.9576, + "ap-southeast-5": 0.81396, + "ca-central-1": 0.85384, + "eu-central-1": 0.91768, + "eu-north-1": 0.814, + "eu-south-2": 0.85384, + "eu-west-1": 0.85384, + "eu-west-2": 0.88576, + "eu-west-3": 0.89376, + "sa-east-1": 1.22096, + "us-east-1": 0.76608, + "us-east-2": 0.76608, + "us-gov-east-1": 0.9656, + "us-gov-west-1": 0.9656, + "us-west-1": 0.89376, + "us-west-2": 0.76608 + }, + "m7i-flex.8xlarge": { + "ap-northeast-1": 1.97904, + "ap-northeast-2": 1.88336, + "ap-south-1": 1.612, + "ap-southeast-1": 1.9152, + "ap-southeast-2": 1.9152, + "ap-southeast-3": 1.9152, + "ap-southeast-5": 1.62792, + "ca-central-1": 1.70768, + "eu-central-1": 1.83536, + "eu-north-1": 1.628, + "eu-south-2": 1.70768, + "eu-west-1": 1.70768, + "eu-west-2": 1.77152, + "eu-west-3": 1.78752, + "sa-east-1": 2.44192, + "us-east-1": 1.53216, + "us-east-2": 1.53216, + "us-gov-east-1": 1.9312, + "us-gov-west-1": 1.9312, + "us-west-1": 1.78752, + "us-west-2": 1.53216 + }, + "m7i-flex.12xlarge": { + "ap-northeast-1": 2.96856, + "ap-south-1": 2.418, + "ap-southeast-1": 2.8728, + "ap-southeast-2": 2.8728, + "ap-southeast-5": 2.44188, + "ca-central-1": 2.56152, + "eu-central-1": 2.75304, + "eu-north-1": 2.442, + "eu-south-2": 2.56152, + "eu-west-1": 2.56152, + "eu-west-3": 2.68128, + "sa-east-1": 3.66288, + "us-east-1": 2.29824, + "us-east-2": 2.29824, + "us-gov-east-1": 2.8968, + "us-gov-west-1": 2.8968, + "us-west-1": 2.68128, + "us-west-2": 2.29824 + }, + "m7i-flex.16xlarge": { + "ap-northeast-1": 3.95808, + "ap-south-1": 3.224, + "ap-southeast-1": 3.8304, + "ap-southeast-2": 3.8304, + "ap-southeast-5": 3.25584, + "ca-central-1": 3.41536, + "eu-central-1": 3.67072, + "eu-north-1": 3.256, + "eu-south-2": 3.41536, + "eu-west-1": 3.41536, + "eu-west-3": 3.57504, + "sa-east-1": 4.88384, + "us-east-1": 3.06432, + "us-east-2": 3.06432, + "us-gov-east-1": 3.8624, + "us-gov-west-1": 3.8624, + "us-west-1": 3.57504, + "us-west-2": 3.06432 + }, + "m8g": { + "us-east-2": 9.479 + }, + "m8g.medium": { + "eu-central-1": 0.05377, + "eu-north-1": 0.05246, + "eu-south-2": 0.04999, + "eu-west-2": 0.0519, + "us-east-1": 0.04488, + "us-east-2": 0.0, + "us-west-2": 0.04937 + }, + "m8g.large": { + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.10998, + "eu-west-2": 0.1038, + "us-east-1": 0.0, + "us-east-2": 0.08976, + "us-west-2": 0.08976 + }, + "m8g.xlarge": { + "eu-central-1": 0.21508, + "eu-north-1": 0.19076, + "eu-south-2": 0.19996, + "eu-west-2": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.19747, + "us-west-2": 0.17952 + }, + "m8g.metal-24xl": { + "eu-central-1": 5.16192, + "eu-north-1": 4.57824, + "eu-south-2": 4.79904, + "eu-west-2": 4.9824, + "us-east-1": 4.73933, + "us-east-2": 4.30848, + "us-west-2": 4.30848 + }, + "m8g.metal-48xl": { + "eu-central-1": 10.32384, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-2": 9.9648, + "us-east-1": 8.61696, + "us-east-2": 0.0, + "us-west-2": 8.61696 + }, + "m8g.2xlarge": { + "eu-central-1": 0.0, + "eu-north-1": 0.41967, + "eu-south-2": 0.39992, + "eu-west-2": 0.45672, + "us-east-1": 0.39494, + "us-east-2": 0.35904, + "us-west-2": 0.39494 + }, + "m8g.4xlarge": { + "eu-central-1": 0.94635, + "eu-north-1": 0.76304, + "eu-south-2": 0.0, + "eu-west-2": 0.0, + "us-east-1": 0.71808, + "us-east-2": 0.71808, + "us-west-2": 0.71808 + }, + "m8g.8xlarge": { + "eu-central-1": 1.72064, + "eu-north-1": 0.0, + "eu-south-2": 1.59968, + "eu-west-2": 1.6608, + "us-east-1": 1.57978, + "us-east-2": 1.57978, + "us-west-2": 1.43616 + }, + "m8g.12xlarge": { + "eu-central-1": 2.58096, + "eu-north-1": 0.0, + "eu-south-2": 2.39952, + "eu-west-2": 2.4912, + "us-east-1": 2.36966, + "us-east-2": 0.0, + "us-west-2": 2.15424 + }, + "m8g.16xlarge": { + "eu-central-1": 3.44128, + "eu-north-1": 0.0, + "eu-south-2": 3.5193, + "eu-west-2": 0.0, + "us-east-1": 2.87232, + "us-east-2": 2.87232, + "us-west-2": 2.87232 + }, + "m8g.24xlarge": { + "eu-central-1": 0.0, + "eu-north-1": 4.57824, + "eu-south-2": 4.79904, + "eu-west-2": 4.9824, + "us-east-1": 4.73933, + "us-east-2": 4.30848, + "us-west-2": 0.0 + }, + "m8g.48xlarge": { + "eu-central-1": 10.32384, + "eu-north-1": 9.15648, + "eu-south-2": 9.59808, + "eu-west-2": 9.9648, + "us-east-1": 8.61696, + "us-east-2": 0.0, + "us-west-2": 8.61696 + }, + "mac1": { + "ap-northeast-1": 1.399, + "ap-northeast-2": 1.332, + "ap-south-1": 1.14, + "ap-southeast-1": 1.354, + "ap-southeast-2": 1.354, + "eu-central-1": 1.298, + "eu-north-1": 1.151, + "eu-west-1": 1.207, + "eu-west-2": 1.253, + "us-east-1": 1.083, + "us-east-2": 1.083, + "us-west-2": 1.083 + }, + "mac1.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "mac2": { + "ap-southeast-1": 0.779, + "eu-west-1": 0.716, + "us-east-1": 0.65, + "us-east-2": 0.65, + "us-west-2": 0.65 + }, + "mac2.metal": { + "ap-southeast-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "mac2-m1ultra": { + "us-east-1": 5.0, + "us-west-2": 5.0 + }, + "mac2-m1ultra.metal": { + "us-east-1": 0.0, + "us-west-2": 0.0 + }, + "mac2-m2": { + "ap-southeast-2": 1.097, + "ca-central-1": 0.979, + "eu-central-1": 1.052, + "us-east-1": 0.878, + "us-east-2": 0.878, + "us-west-2": 0.878 + }, + "mac2-m2.metal": { + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "mac2-m2pro": { + "ap-southeast-2": 1.95, + "us-east-1": 1.56, + "us-east-2": 1.56, + "us-west-2": 1.56 + }, + "mac2-m2pro.metal": { + "ap-southeast-2": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "p2": { + "ap-northeast-1": 27.139, + "ap-northeast-2": 25.784, + "ap-south-1": 30.237, + "ap-southeast-1": 30.237, + "ap-southeast-2": 27.139, + "eu-central-1": 23.338, + "eu-west-1": 17.107, + "us-east-1": 15.84, + "us-east-2": 15.84, + "us-gov-west-1": 19.008, + "us-west-2": 15.84 + }, + "p2.xlarge": { + "ap-northeast-1": 1.696, + "ap-northeast-2": 0.0, + "ap-south-1": 1.718, + "ap-southeast-1": 1.718, + "ap-southeast-2": 1.542, + "eu-central-1": 1.326, + "eu-west-1": 0.972, + "us-east-1": 0.0, + "us-east-2": 0.9, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "p2.8xlarge": { + "ap-northeast-1": 12.336, + "ap-northeast-2": 12.892, + "ap-south-1": 13.744, + "ap-southeast-1": 15.118, + "ap-southeast-2": 0.0, + "eu-central-1": 11.669, + "eu-west-1": 7.776, + "us-east-1": 7.2, + "us-east-2": 7.2, + "us-gov-west-1": 8.64, + "us-west-2": 7.2 + }, + "p2.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 23.44, + "ap-south-1": 0.0, + "ap-southeast-1": 27.488, + "ap-southeast-2": 24.672, + "eu-central-1": 0.0, + "eu-west-1": 15.552, + "us-east-1": 14.4, + "us-east-2": 14.4, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "p3": { + "ap-northeast-1": 36.907, + "eu-west-2": 31.583, + "us-east-1": 26.928, + "us-east-2": 26.928, + "us-west-2": 26.928 + }, + "p3.2xlarge": { + "ap-northeast-1": 4.194, + "ap-northeast-2": 0.0, + "ap-southeast-1": 4.234, + "ap-southeast-2": 4.234, + "ca-central-1": 3.366, + "eu-central-1": 4.071, + "eu-west-1": 0.0, + "eu-west-2": 3.589, + "us-east-1": 3.06, + "us-east-2": 3.06, + "us-gov-west-1": 3.672, + "us-west-2": 0.0 + }, + "p3.8xlarge": { + "ap-northeast-1": 16.776, + "ap-northeast-2": 16.936, + "ap-southeast-1": 16.936, + "ap-southeast-2": 16.936, + "ca-central-1": 13.464, + "eu-central-1": 15.292, + "eu-west-1": 13.22, + "eu-west-2": 0.0, + "us-east-1": 0.0, + "us-east-2": 12.24, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "p3.16xlarge": { + "ap-northeast-1": 33.552, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 33.872, + "ca-central-1": 26.928, + "eu-central-1": 0.0, + "eu-west-1": 26.44, + "eu-west-2": 28.712, + "us-east-1": 24.48, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 24.48 + }, + "p3dn.24xlarge": { + "ap-northeast-1": 42.783, + "eu-west-1": 33.711, + "us-east-1": 31.212, + "us-gov-east-1": 37.454, + "us-gov-west-1": 37.454, + "us-west-2": 0.0 + }, + "p4d": { + "eu-central-1": 45.039, + "sa-east-1": 58.377, + "us-gov-west-1": 43.263, + "us-west-2": 36.05 + }, + "p4d.24xlarge": { + "ap-northeast-1": 44.92215, + "ap-northeast-2": 45.38848, + "ap-south-1": 39.32, + "ap-southeast-1": 39.3271, + "ap-southeast-2": 42.60438, + "ca-central-1": 37.69, + "eu-central-1": 40.94475, + "eu-west-1": 35.39655, + "sa-east-1": 53.07, + "us-east-1": 36.04986, + "us-east-2": 0.0, + "us-gov-west-1": 39.33, + "us-west-2": 32.7726 + }, + "p4de": { + "ap-southeast-1": 54.075, + "eu-central-1": 56.328, + "il-central-1": 58.404, + "us-east-1": 45.062, + "us-west-2": 45.062 + }, + "p4de.24xlarge": { + "ap-southeast-1": 49.159, + "eu-central-1": 56.32803, + "il-central-1": 0.0, + "us-east-1": 45.062325, + "us-west-2": 40.96575 + }, + "p5.48xlarge": { + "ap-northeast-1": 123.19496, + "ap-south-1": 117.984, + "ap-southeast-2": 127.816, + "ca-central-1": 113.068, + "eu-north-1": 105.2024, + "eu-west-2": 127.816, + "sa-east-1": 165.1776, + "us-east-1": 98.32, + "us-east-2": 98.32, + "us-gov-west-1": 117.984, + "us-west-1": 122.9, + "us-west-2": 108.152 + }, + "p5e.48xlarge": { + "us-east-2": 0.0 + }, + "p5en.48xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 117.024, + "ap-south-1": 101.76, + "eu-south-2": 91.584, + "us-east-2": 84.8, + "us-west-2": 93.28 + }, + "r3": { + "ap-southeast-1": 3.511 + }, + "r3.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.22, + "ap-south-1": 0.19, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.2, + "eu-west-1": 0.204, + "sa-east-1": 0.35, + "us-east-1": 0.166, + "us-east-2": 0.183, + "us-gov-west-1": 0.2, + "us-west-1": 0.0, + "us-west-2": 0.166 + }, + "r3.xlarge": { + "ap-northeast-1": 0.399, + "ap-northeast-2": 0.439, + "ap-south-1": 0.379, + "ap-southeast-1": 0.399, + "ap-southeast-2": 0.0, + "eu-central-1": 0.44, + "eu-west-1": 0.371, + "sa-east-1": 0.7, + "us-east-1": 0.333, + "us-east-2": 0.366, + "us-gov-west-1": 0.0, + "us-west-1": 0.408, + "us-west-2": 0.333 + }, + "r3.2xlarge": { + "ap-northeast-1": 0.878, + "ap-northeast-2": 0.0, + "ap-south-1": 0.758, + "ap-southeast-1": 0.878, + "ap-southeast-2": 0.0, + "eu-central-1": 0.8, + "eu-west-1": 0.741, + "sa-east-1": 1.399, + "us-east-1": 0.0, + "us-east-2": 0.664, + "us-gov-west-1": 0.798, + "us-west-1": 0.815, + "us-west-2": 0.665 + }, + "r3.4xlarge": { + "ap-northeast-1": 1.596, + "ap-northeast-2": 1.596, + "ap-south-1": 1.516, + "ap-southeast-1": 1.596, + "ap-southeast-2": 1.596, + "eu-central-1": 1.6, + "eu-west-1": 1.482, + "sa-east-1": 3.079, + "us-east-1": 1.33, + "us-east-2": 0.0, + "us-gov-west-1": 1.756, + "us-west-1": 1.482, + "us-west-2": 1.33 + }, + "r3.8xlarge": { + "ap-northeast-1": 3.192, + "ap-northeast-2": 3.192, + "ap-south-1": 3.032, + "ap-southeast-1": 3.192, + "ap-southeast-2": 0.0, + "eu-central-1": 3.201, + "eu-west-1": 0.0, + "sa-east-1": 5.597, + "us-east-1": 2.66, + "us-east-2": 2.66, + "us-gov-west-1": 3.192, + "us-west-1": 2.964, + "us-west-2": 2.66 + }, + "r4": { + "us-east-2": 4.682 + }, + "r4.large": { + "ap-northeast-1": 0.16, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.16, + "ap-south-1": 0.1507, + "ap-southeast-1": 0.16, + "ap-southeast-2": 0.1596, + "ca-central-1": 0.161, + "eu-central-1": 0.16005, + "eu-west-1": 0.1482, + "eu-west-2": 0.156, + "eu-west-3": 0.1716, + "sa-east-1": 0.308, + "us-east-1": 0.146, + "us-east-2": 0.133, + "us-gov-west-1": 0.0, + "us-west-1": 0.163, + "us-west-2": 0.133 + }, + "r4.xlarge": { + "ap-northeast-1": 0.352, + "ap-northeast-2": 0.32, + "ap-northeast-3": 0.32, + "ap-south-1": 0.274, + "ap-southeast-1": 0.32, + "ap-southeast-2": 0.3192, + "ca-central-1": 0.321, + "eu-central-1": 0.352, + "eu-west-1": 0.326, + "eu-west-2": 0.312, + "eu-west-3": 0.312, + "sa-east-1": 0.616, + "us-east-1": 0.0, + "us-east-2": 0.293, + "us-gov-west-1": 0.351, + "us-west-1": 0.326, + "us-west-2": 0.266 + }, + "r4.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.64, + "ap-south-1": 0.0, + "ap-southeast-1": 0.64, + "ap-southeast-2": 0.0, + "ca-central-1": 0.642, + "eu-central-1": 0.6402, + "eu-west-1": 0.652, + "eu-west-2": 0.624, + "eu-west-3": 0.6864, + "sa-east-1": 1.12, + "us-east-1": 0.532, + "us-east-2": 0.532, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.532 + }, + "r4.4xlarge": { + "ap-northeast-1": 1.28, + "ap-northeast-2": 1.28, + "ap-northeast-3": 0.0, + "ap-south-1": 1.096, + "ap-southeast-1": 1.28, + "ap-southeast-2": 1.2768, + "ca-central-1": 1.285, + "eu-central-1": 1.2804, + "eu-west-1": 1.304, + "eu-west-2": 1.373, + "eu-west-3": 1.248, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 1.064, + "us-gov-west-1": 1.2768, + "us-west-1": 1.1856, + "us-west-2": 1.064 + }, + "r4.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.56, + "ap-northeast-3": 2.816, + "ap-south-1": 0.0, + "ap-southeast-1": 2.56, + "ap-southeast-2": 0.0, + "ca-central-1": 2.336, + "eu-central-1": 0.0, + "eu-west-1": 2.3712, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 2.341, + "us-east-2": 2.341, + "us-gov-west-1": 2.809, + "us-west-1": 2.608, + "us-west-2": 2.341 + }, + "r4.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.12, + "ap-northeast-3": 5.12, + "ap-south-1": 4.384, + "ap-southeast-1": 5.12, + "ap-southeast-2": 5.1072, + "ca-central-1": 4.672, + "eu-central-1": 5.1216, + "eu-west-1": 4.742, + "eu-west-2": 4.992, + "eu-west-3": 4.992, + "sa-east-1": 8.96, + "us-east-1": 4.256, + "us-east-2": 4.256, + "us-gov-west-1": 5.1072, + "us-west-1": 0.0, + "us-west-2": 4.256 + }, + "r5.large": { + "af-south-1": 0.168, + "ap-east-1": 0.167, + "ap-northeast-1": 0.152, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.161, + "ap-south-1": 0.13, + "ap-south-2": 0.0, + "ap-southeast-1": 0.152, + "ap-southeast-2": 0.151, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.16, + "ca-central-1": 0.138, + "ca-west-1": 0.146, + "eu-central-1": 0.152, + "eu-central-2": 0.167, + "eu-north-1": 0.0, + "eu-south-1": 0.157, + "eu-south-2": 0.141, + "eu-west-1": 0.141, + "eu-west-2": 0.148, + "eu-west-3": 0.157, + "il-central-1": 0.157, + "me-central-1": 0.155, + "me-south-1": 0.155, + "sa-east-1": 0.0, + "us-east-1": 0.134, + "us-east-2": 0.126, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.151, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.16 + }, + "r5.xlarge": { + "af-south-1": 0.356, + "ap-east-1": 0.334, + "ap-northeast-1": 0.304, + "ap-northeast-2": 0.304, + "ap-northeast-3": 0.0, + "ap-south-1": 0.276, + "ap-south-2": 0.0, + "ap-southeast-1": 0.322, + "ap-southeast-2": 0.302, + "ap-southeast-3": 0.322, + "ap-southeast-4": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.276, + "eu-central-1": 0.304, + "eu-central-2": 0.334, + "eu-north-1": 0.284, + "eu-south-1": 0.314, + "eu-south-2": 0.299, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.296, + "il-central-1": 0.0, + "me-central-1": 0.31, + "me-south-1": 0.31, + "sa-east-1": 0.402, + "us-east-1": 0.0, + "us-east-2": 0.252, + "us-gov-east-1": 0.302, + "us-gov-west-1": 0.302, + "us-west-1": 0.0, + "us-west-2": 0.267, + "us-west-2-lax-1": 0.302 + }, + "r5.metal": { + "af-south-1": 8.064, + "ap-east-1": 8.016, + "ap-northeast-1": 0.0, + "ap-northeast-2": 7.296, + "ap-northeast-3": 7.296, + "ap-south-1": 6.24, + "ap-south-2": 6.24, + "ap-southeast-1": 7.296, + "ap-southeast-2": 7.248, + "ap-southeast-3": 7.296, + "ap-southeast-4": 7.248, + "ca-central-1": 6.624, + "ca-west-1": 6.624, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 6.432, + "eu-south-1": 7.104, + "eu-south-2": 6.768, + "eu-west-1": 6.768, + "eu-west-2": 7.104, + "eu-west-3": 0.0, + "il-central-1": 7.106, + "me-central-1": 7.445, + "me-south-1": 7.445, + "sa-east-1": 0.0, + "us-east-1": 6.048, + "us-east-2": 6.048, + "us-gov-east-1": 7.248, + "us-gov-west-1": 7.248, + "us-west-1": 0.0, + "us-west-2": 6.048, + "us-west-2-lax-1": 7.258 + }, + "r5.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.668, + "ap-northeast-1": 0.608, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.644, + "ap-south-1": 0.52, + "ap-south-2": 0.0, + "ap-southeast-1": 0.644, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.64, + "ca-central-1": 0.552, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.669, + "eu-north-1": 0.536, + "eu-south-1": 0.592, + "eu-south-2": 0.564, + "eu-west-1": 0.564, + "eu-west-2": 0.628, + "eu-west-3": 0.0, + "il-central-1": 0.628, + "me-central-1": 0.0, + "me-south-1": 0.62, + "sa-east-1": 0.0, + "us-east-1": 0.504, + "us-east-2": 0.504, + "us-gov-east-1": 0.604, + "us-gov-west-1": 0.604, + "us-west-1": 0.56, + "us-west-2": 0.534, + "us-west-2-lax-1": 0.605 + }, + "r5.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 1.289, + "ap-northeast-2": 1.289, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 1.04, + "ap-southeast-1": 1.216, + "ap-southeast-2": 1.208, + "ap-southeast-3": 1.216, + "ap-southeast-4": 1.208, + "ca-central-1": 1.104, + "ca-west-1": 1.104, + "eu-central-1": 1.289, + "eu-central-2": 1.338, + "eu-north-1": 1.072, + "eu-south-1": 0.0, + "eu-south-2": 1.128, + "eu-west-1": 0.0, + "eu-west-2": 1.255, + "eu-west-3": 1.255, + "il-central-1": 1.184, + "me-central-1": 1.241, + "me-south-1": 1.315, + "sa-east-1": 1.608, + "us-east-1": 1.008, + "us-east-2": 1.008, + "us-gov-east-1": 1.208, + "us-gov-west-1": 0.0, + "us-west-1": 1.12, + "us-west-2": 1.008, + "us-west-2-lax-1": 0.0 + }, + "r5.8xlarge": { + "af-south-1": 2.688, + "ap-east-1": 2.672, + "ap-northeast-1": 2.432, + "ap-northeast-2": 0.0, + "ap-northeast-3": 2.432, + "ap-south-1": 0.0, + "ap-south-2": 2.08, + "ap-southeast-1": 2.432, + "ap-southeast-2": 2.561, + "ap-southeast-3": 0.0, + "ap-southeast-4": 2.561, + "ca-central-1": 0.0, + "ca-west-1": 2.208, + "eu-central-1": 0.0, + "eu-central-2": 2.675, + "eu-north-1": 2.144, + "eu-south-1": 2.368, + "eu-south-2": 2.256, + "eu-west-1": 2.391, + "eu-west-2": 2.368, + "eu-west-3": 0.0, + "il-central-1": 2.369, + "me-central-1": 2.63, + "me-south-1": 0.0, + "sa-east-1": 3.216, + "us-east-1": 0.0, + "us-east-2": 2.137, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.416, + "us-west-1": 0.0, + "us-west-2": 2.016, + "us-west-2-lax-1": 0.0 + }, + "r5.12xlarge": { + "af-south-1": 4.032, + "ap-east-1": 4.248, + "ap-northeast-1": 3.648, + "ap-northeast-2": 3.648, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 3.306, + "ap-southeast-1": 3.648, + "ap-southeast-2": 3.841, + "ap-southeast-3": 3.867, + "ap-southeast-4": 0.0, + "ca-central-1": 3.312, + "ca-west-1": 3.312, + "eu-central-1": 3.648, + "eu-central-2": 4.013, + "eu-north-1": 0.0, + "eu-south-1": 3.552, + "eu-south-2": 3.384, + "eu-west-1": 3.384, + "eu-west-2": 3.552, + "eu-west-3": 3.552, + "il-central-1": 3.553, + "me-central-1": 3.722, + "me-south-1": 0.0, + "sa-east-1": 4.824, + "us-east-1": 3.024, + "us-east-2": 3.205, + "us-gov-east-1": 3.624, + "us-gov-west-1": 3.624, + "us-west-1": 3.36, + "us-west-2": 0.0, + "us-west-2-lax-1": 3.629 + }, + "r5.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 5.665, + "ap-northeast-1": 5.156, + "ap-northeast-2": 4.864, + "ap-northeast-3": 5.156, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 4.864, + "ap-southeast-2": 4.832, + "ap-southeast-3": 4.864, + "ap-southeast-4": 4.832, + "ca-central-1": 4.416, + "ca-west-1": 4.416, + "eu-central-1": 0.0, + "eu-central-2": 5.671, + "eu-north-1": 4.288, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 4.512, + "eu-west-2": 4.736, + "eu-west-3": 4.736, + "il-central-1": 0.0, + "me-central-1": 4.963, + "me-south-1": 0.0, + "sa-east-1": 6.818, + "us-east-1": 0.0, + "us-east-2": 4.274, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.832, + "us-west-1": 4.48, + "us-west-2": 4.032, + "us-west-2-lax-1": 4.838 + }, + "r5.24xlarge": { + "af-south-1": 8.064, + "ap-east-1": 0.0, + "ap-northeast-1": 7.296, + "ap-northeast-2": 7.296, + "ap-northeast-3": 7.296, + "ap-south-1": 6.24, + "ap-south-2": 0.0, + "ap-southeast-1": 7.296, + "ap-southeast-2": 7.248, + "ap-southeast-3": 0.0, + "ap-southeast-4": 7.248, + "ca-central-1": 0.0, + "ca-west-1": 6.624, + "eu-central-1": 7.296, + "eu-central-2": 8.026, + "eu-north-1": 6.432, + "eu-south-1": 7.104, + "eu-south-2": 6.768, + "eu-west-1": 6.768, + "eu-west-2": 7.104, + "eu-west-3": 7.104, + "il-central-1": 0.0, + "me-central-1": 7.445, + "me-south-1": 7.445, + "sa-east-1": 9.648, + "us-east-1": 6.048, + "us-east-2": 6.048, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 6.72, + "us-west-2": 6.048, + "us-west-2-lax-1": 7.258 + }, + "r5a.large": { + "ap-northeast-1": 0.137, + "ap-northeast-2": 0.136, + "ap-south-1": 0.072, + "ap-southeast-1": 0.136, + "ap-southeast-2": 0.136, + "ca-central-1": 0.124, + "eu-central-1": 0.137, + "eu-south-1": 0.133, + "eu-west-1": 0.127, + "eu-west-2": 0.133, + "eu-west-3": 0.133, + "sa-east-1": 0.181, + "us-east-1": 0.113, + "us-east-2": 0.113, + "us-gov-east-1": 0.136, + "us-gov-west-1": 0.136, + "us-west-1": 0.126, + "us-west-2": 0.113 + }, + "r5a.xlarge": { + "ap-northeast-1": 0.274, + "ap-northeast-2": 0.272, + "ap-south-1": 0.143, + "ap-southeast-1": 0.272, + "ap-southeast-2": 0.272, + "ca-central-1": 0.248, + "eu-central-1": 0.274, + "eu-south-1": 0.266, + "eu-west-1": 0.254, + "eu-west-2": 0.266, + "eu-west-3": 0.266, + "sa-east-1": 0.362, + "us-east-1": 0.226, + "us-east-2": 0.226, + "us-gov-east-1": 0.272, + "us-gov-west-1": 0.272, + "us-west-1": 0.252, + "us-west-2": 0.226 + }, + "r5a.2xlarge": { + "ap-northeast-1": 0.548, + "ap-northeast-2": 0.544, + "ap-south-1": 0.286, + "ap-southeast-1": 0.544, + "ap-southeast-2": 0.544, + "ca-central-1": 0.496, + "eu-central-1": 0.548, + "eu-south-1": 0.532, + "eu-west-1": 0.508, + "eu-west-2": 0.532, + "eu-west-3": 0.532, + "sa-east-1": 0.724, + "us-east-1": 0.452, + "us-east-2": 0.452, + "us-gov-east-1": 0.544, + "us-gov-west-1": 0.544, + "us-west-1": 0.504, + "us-west-2": 0.452 + }, + "r5a.4xlarge": { + "ap-northeast-1": 1.096, + "ap-northeast-2": 1.088, + "ap-south-1": 0.572, + "ap-southeast-1": 1.088, + "ap-southeast-2": 1.088, + "ca-central-1": 0.992, + "eu-central-1": 1.096, + "eu-south-1": 1.064, + "eu-west-1": 1.016, + "eu-west-2": 1.064, + "eu-west-3": 1.064, + "sa-east-1": 1.448, + "us-east-1": 0.904, + "us-east-2": 0.904, + "us-gov-east-1": 1.088, + "us-gov-west-1": 1.088, + "us-west-1": 1.008, + "us-west-2": 0.904 + }, + "r5a.8xlarge": { + "ap-northeast-1": 2.192, + "ap-northeast-2": 2.176, + "ap-south-1": 1.144, + "ap-southeast-1": 2.176, + "ap-southeast-2": 2.176, + "ca-central-1": 1.984, + "eu-central-1": 2.192, + "eu-south-1": 2.128, + "eu-west-1": 2.032, + "eu-west-2": 2.128, + "eu-west-3": 2.128, + "sa-east-1": 2.896, + "us-east-1": 1.808, + "us-east-2": 1.808, + "us-gov-east-1": 2.176, + "us-gov-west-1": 2.176, + "us-west-1": 2.016, + "us-west-2": 1.808 + }, + "r5a.12xlarge": { + "ap-northeast-1": 3.288, + "ap-northeast-2": 3.264, + "ap-south-1": 1.716, + "ap-southeast-1": 3.264, + "ap-southeast-2": 3.264, + "ca-central-1": 2.976, + "eu-central-1": 3.288, + "eu-south-1": 3.192, + "eu-west-1": 3.048, + "eu-west-2": 3.192, + "eu-west-3": 3.192, + "sa-east-1": 4.344, + "us-east-1": 2.712, + "us-east-2": 2.712, + "us-gov-east-1": 3.264, + "us-gov-west-1": 3.264, + "us-west-1": 3.024, + "us-west-2": 2.712 + }, + "r5a.16xlarge": { + "ap-northeast-1": 4.384, + "ap-northeast-2": 4.352, + "ap-south-1": 2.288, + "ap-southeast-1": 4.352, + "ap-southeast-2": 4.352, + "ca-central-1": 3.968, + "eu-central-1": 4.384, + "eu-south-1": 4.256, + "eu-west-1": 4.064, + "eu-west-2": 4.256, + "eu-west-3": 4.256, + "sa-east-1": 5.792, + "us-east-1": 3.616, + "us-east-2": 3.616, + "us-gov-east-1": 4.352, + "us-gov-west-1": 4.352, + "us-west-1": 4.032, + "us-west-2": 3.616 + }, + "r5a.24xlarge": { + "ap-northeast-1": 6.576, + "ap-northeast-2": 6.528, + "ap-south-1": 3.432, + "ap-southeast-1": 6.528, + "ap-southeast-2": 6.528, + "ca-central-1": 5.952, + "eu-central-1": 6.576, + "eu-south-1": 6.384, + "eu-west-1": 6.096, + "eu-west-2": 6.384, + "eu-west-3": 6.384, + "sa-east-1": 8.688, + "us-east-1": 5.424, + "us-east-2": 5.424, + "us-gov-east-1": 6.528, + "us-gov-west-1": 6.528, + "us-west-1": 6.048, + "us-west-2": 5.424 + }, + "r5ad.large": { + "ap-northeast-1": 0.159, + "ap-northeast-2": 0.158, + "ap-south-1": 0.083, + "ap-southeast-1": 0.159, + "ap-southeast-2": 0.159, + "ca-central-1": 0.144, + "eu-central-1": 0.158, + "eu-west-1": 0.146, + "eu-west-2": 0.154, + "eu-west-3": 0.153, + "sa-east-1": 0.208, + "us-east-1": 0.131, + "us-east-2": 0.131, + "us-gov-west-1": 0.158, + "us-west-1": 0.148, + "us-west-2": 0.131 + }, + "r5ad.xlarge": { + "ap-northeast-1": 0.318, + "ap-northeast-2": 0.316, + "ap-south-1": 0.166, + "ap-southeast-1": 0.318, + "ap-southeast-2": 0.318, + "ca-central-1": 0.288, + "eu-central-1": 0.316, + "eu-west-1": 0.292, + "eu-west-2": 0.308, + "eu-west-3": 0.306, + "sa-east-1": 0.416, + "us-east-1": 0.262, + "us-east-2": 0.262, + "us-gov-west-1": 0.316, + "us-west-1": 0.296, + "us-west-2": 0.262 + }, + "r5ad.2xlarge": { + "ap-northeast-1": 0.636, + "ap-northeast-2": 0.632, + "ap-south-1": 0.332, + "ap-southeast-1": 0.636, + "ap-southeast-2": 0.636, + "ca-central-1": 0.576, + "eu-central-1": 0.632, + "eu-west-1": 0.584, + "eu-west-2": 0.616, + "eu-west-3": 0.612, + "sa-east-1": 0.832, + "us-east-1": 0.524, + "us-east-2": 0.524, + "us-gov-west-1": 0.632, + "us-west-1": 0.592, + "us-west-2": 0.524 + }, + "r5ad.4xlarge": { + "ap-northeast-1": 1.272, + "ap-northeast-2": 1.264, + "ap-south-1": 0.664, + "ap-southeast-1": 1.272, + "ap-southeast-2": 1.272, + "ca-central-1": 1.152, + "eu-central-1": 1.264, + "eu-west-1": 1.168, + "eu-west-2": 1.232, + "eu-west-3": 1.224, + "sa-east-1": 1.664, + "us-east-1": 1.048, + "us-east-2": 1.048, + "us-gov-west-1": 1.264, + "us-west-1": 1.184, + "us-west-2": 1.048 + }, + "r5ad.8xlarge": { + "ap-northeast-1": 2.544, + "ap-northeast-2": 2.528, + "ap-south-1": 1.329, + "ap-southeast-1": 2.544, + "ap-southeast-2": 2.544, + "ca-central-1": 2.304, + "eu-central-1": 2.528, + "eu-west-1": 2.336, + "eu-west-2": 2.464, + "eu-west-3": 2.448, + "sa-east-1": 3.328, + "us-east-1": 2.096, + "us-east-2": 2.096, + "us-gov-west-1": 2.528, + "us-west-1": 2.368, + "us-west-2": 2.096 + }, + "r5ad.12xlarge": { + "ap-northeast-1": 3.816, + "ap-northeast-2": 3.792, + "ap-south-1": 1.993, + "ap-southeast-1": 3.816, + "ap-southeast-2": 3.816, + "ca-central-1": 3.456, + "eu-central-1": 3.792, + "eu-west-1": 3.504, + "eu-west-2": 3.696, + "eu-west-3": 3.672, + "sa-east-1": 4.992, + "us-east-1": 3.144, + "us-east-2": 3.144, + "us-gov-west-1": 3.792, + "us-west-1": 3.552, + "us-west-2": 3.144 + }, + "r5ad.16xlarge": { + "ap-northeast-1": 5.088, + "ap-northeast-2": 5.056, + "ap-south-1": 2.658, + "ap-southeast-1": 5.088, + "ap-southeast-2": 5.088, + "ca-central-1": 4.608, + "eu-central-1": 5.056, + "eu-west-1": 4.672, + "eu-west-2": 4.928, + "eu-west-3": 4.896, + "sa-east-1": 6.656, + "us-east-1": 4.192, + "us-east-2": 4.192, + "us-gov-west-1": 5.056, + "us-west-1": 4.736, + "us-west-2": 4.192 + }, + "r5ad.24xlarge": { + "ap-northeast-1": 7.632, + "ap-northeast-2": 7.584, + "ap-south-1": 3.986, + "ap-southeast-1": 7.632, + "ap-southeast-2": 7.632, + "ca-central-1": 6.912, + "eu-central-1": 7.584, + "eu-west-1": 7.008, + "eu-west-2": 7.392, + "eu-west-3": 7.344, + "sa-east-1": 9.984, + "us-east-1": 6.288, + "us-east-2": 6.288, + "us-gov-west-1": 7.584, + "us-west-1": 7.104, + "us-west-2": 6.288 + }, + "r5b": { + "eu-west-2": 9.24 + }, + "r5b.large": { + "ap-northeast-1": 0.181, + "ap-northeast-2": 0.178, + "ap-southeast-1": 0.178, + "ap-southeast-2": 0.181, + "ca-central-1": 0.163, + "eu-central-1": 0.0, + "eu-north-1": 0.15794, + "eu-south-1": 0.0, + "eu-west-1": 0.1837, + "eu-west-2": 0.175, + "sa-east-1": 0.0, + "us-east-1": 0.149, + "us-east-2": 0.149, + "us-west-2": 0.149 + }, + "r5b.xlarge": { + "ap-northeast-1": 0.3982, + "ap-northeast-2": 0.3916, + "ap-southeast-1": 0.356, + "ap-southeast-2": 0.362, + "ca-central-1": 0.326, + "eu-central-1": 0.356, + "eu-north-1": 0.31588, + "eu-south-1": 0.35, + "eu-west-1": 0.334, + "eu-west-2": 0.385, + "sa-east-1": 0.474, + "us-east-1": 0.298, + "us-east-2": 0.298, + "us-west-2": 0.3278 + }, + "r5b.metal": { + "ap-northeast-1": 8.688, + "ap-northeast-2": 8.544, + "ap-southeast-1": 9.3984, + "ap-southeast-2": 9.5568, + "ca-central-1": 7.824, + "eu-central-1": 8.544, + "eu-north-1": 8.339232, + "eu-south-1": 8.4, + "eu-west-1": 8.016, + "eu-west-2": 0.0, + "sa-east-1": 11.376, + "us-east-1": 7.152, + "us-east-2": 7.152, + "us-west-2": 7.152 + }, + "r5b.2xlarge": { + "ap-northeast-1": 0.724, + "ap-northeast-2": 0.712, + "ap-southeast-1": 0.7832, + "ap-southeast-2": 0.724, + "ca-central-1": 0.652, + "eu-central-1": 0.712, + "eu-north-1": 0.63176, + "eu-south-1": 0.0, + "eu-west-1": 0.668, + "eu-west-2": 0.77, + "sa-east-1": 1.0428, + "us-east-1": 0.596, + "us-east-2": 0.596, + "us-west-2": 0.596 + }, + "r5b.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.424, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.5928, + "ca-central-1": 1.4344, + "eu-central-1": 1.424, + "eu-north-1": 1.26352, + "eu-south-1": 1.4, + "eu-west-1": 1.336, + "eu-west-2": 1.4, + "sa-east-1": 1.896, + "us-east-1": 1.192, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "r5b.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.848, + "ap-southeast-1": 2.848, + "ap-southeast-2": 2.896, + "ca-central-1": 2.608, + "eu-central-1": 2.848, + "eu-north-1": 2.52704, + "eu-south-1": 2.8, + "eu-west-1": 2.672, + "eu-west-2": 2.8, + "sa-east-1": 3.792, + "us-east-1": 2.6224, + "us-east-2": 2.6224, + "us-west-2": 2.384 + }, + "r5b.12xlarge": { + "ap-northeast-1": 4.344, + "ap-northeast-2": 0.0, + "ap-southeast-1": 4.272, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 4.272, + "eu-north-1": 4.169616, + "eu-south-1": 0.0, + "eu-west-1": 4.4088, + "eu-west-2": 0.0, + "sa-east-1": 5.688, + "us-east-1": 3.576, + "us-east-2": 3.576, + "us-west-2": 3.576 + }, + "r5b.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.696, + "ap-southeast-1": 6.2656, + "ap-southeast-2": 5.792, + "ca-central-1": 5.216, + "eu-central-1": 5.696, + "eu-north-1": 0.0, + "eu-south-1": 5.6, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "sa-east-1": 7.584, + "us-east-1": 4.768, + "us-east-2": 0.0, + "us-west-2": 4.768 + }, + "r5b.24xlarge": { + "ap-northeast-1": 9.5568, + "ap-northeast-2": 8.544, + "ap-southeast-1": 9.3984, + "ap-southeast-2": 0.0, + "ca-central-1": 8.6064, + "eu-central-1": 0.0, + "eu-north-1": 7.58112, + "eu-south-1": 9.24, + "eu-west-1": 8.016, + "eu-west-2": 8.4, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 7.152 + }, + "r5d.large": { + "af-south-1": 0.19, + "ap-east-1": 0.175, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.173, + "ap-northeast-3": 0.184, + "ap-south-1": 0.151, + "ap-south-2": 0.151, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.174, + "ap-southeast-3": 0.174, + "ap-southeast-4": 0.174, + "ca-central-1": 0.158, + "eu-central-1": 0.0, + "eu-central-2": 0.19, + "eu-north-1": 0.152, + "eu-south-1": 0.178, + "eu-south-2": 0.16, + "eu-west-1": 0.16, + "eu-west-2": 0.169, + "eu-west-3": 0.169, + "il-central-1": 0.178, + "me-central-1": 0.187, + "me-south-1": 0.176, + "sa-east-1": 0.228, + "us-east-1": 0.144, + "us-east-2": 0.0, + "us-gov-east-1": 0.173, + "us-gov-west-1": 0.0, + "us-west-1": 0.162, + "us-west-2": 0.144, + "us-west-2-lax-1": 0.173 + }, + "r5d.xlarge": { + "af-south-1": 0.38, + "ap-east-1": 0.35, + "ap-northeast-1": 0.348, + "ap-northeast-2": 0.346, + "ap-northeast-3": 0.369, + "ap-south-1": 0.302, + "ap-south-2": 0.302, + "ap-southeast-1": 0.369, + "ap-southeast-2": 0.348, + "ap-southeast-3": 0.348, + "ap-southeast-4": 0.348, + "ca-central-1": 0.316, + "eu-central-1": 0.346, + "eu-central-2": 0.403, + "eu-north-1": 0.304, + "eu-south-1": 0.356, + "eu-south-2": 0.32, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.338, + "il-central-1": 0.356, + "me-central-1": 0.352, + "me-south-1": 0.373, + "sa-east-1": 0.484, + "us-east-1": 0.288, + "us-east-2": 0.288, + "us-gov-east-1": 0.367, + "us-gov-west-1": 0.0, + "us-west-1": 0.324, + "us-west-2": 0.288, + "us-west-2-lax-1": 0.346 + }, + "r5d.metal": { + "af-south-1": 9.12, + "ap-east-1": 8.4, + "ap-northeast-1": 8.352, + "ap-northeast-2": 8.304, + "ap-northeast-3": 8.352, + "ap-south-1": 7.248, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 8.352, + "ap-southeast-3": 8.352, + "ap-southeast-4": 8.352, + "ca-central-1": 7.584, + "eu-central-1": 8.304, + "eu-central-2": 9.134, + "eu-north-1": 7.296, + "eu-south-1": 0.0, + "eu-south-2": 7.68, + "eu-west-1": 7.68, + "eu-west-2": 8.112, + "eu-west-3": 0.0, + "il-central-1": 8.064, + "me-central-1": 8.448, + "me-south-1": 8.448, + "sa-east-1": 10.944, + "us-east-1": 6.912, + "us-east-2": 6.912, + "us-gov-east-1": 8.304, + "us-gov-west-1": 0.0, + "us-west-1": 7.776, + "us-west-2": 6.912, + "us-west-2-lax-1": 8.294 + }, + "r5d.2xlarge": { + "af-south-1": 0.806, + "ap-east-1": 0.7, + "ap-northeast-1": 0.696, + "ap-northeast-2": 0.692, + "ap-northeast-3": 0.0, + "ap-south-1": 0.604, + "ap-south-2": 0.604, + "ap-southeast-1": 0.696, + "ap-southeast-2": 0.696, + "ap-southeast-3": 0.696, + "ap-southeast-4": 0.696, + "ca-central-1": 0.632, + "eu-central-1": 0.692, + "eu-central-2": 0.761, + "eu-north-1": 0.608, + "eu-south-1": 0.672, + "eu-south-2": 0.64, + "eu-west-1": 0.679, + "eu-west-2": 0.717, + "eu-west-3": 0.717, + "il-central-1": 0.672, + "me-central-1": 0.704, + "me-south-1": 0.747, + "sa-east-1": 0.912, + "us-east-1": 0.576, + "us-east-2": 0.576, + "us-gov-east-1": 0.692, + "us-gov-west-1": 0.692, + "us-west-1": 0.648, + "us-west-2": 0.576, + "us-west-2-lax-1": 0.0 + }, + "r5d.4xlarge": { + "af-south-1": 1.52, + "ap-east-1": 1.4, + "ap-northeast-1": 1.392, + "ap-northeast-2": 1.467, + "ap-northeast-3": 1.392, + "ap-south-1": 1.208, + "ap-south-2": 0.0, + "ap-southeast-1": 1.392, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.476, + "ap-southeast-4": 1.392, + "ca-central-1": 1.34, + "eu-central-1": 1.468, + "eu-central-2": 1.522, + "eu-north-1": 1.216, + "eu-south-1": 1.344, + "eu-south-2": 0.0, + "eu-west-1": 1.28, + "eu-west-2": 1.434, + "eu-west-3": 1.352, + "il-central-1": 0.0, + "me-central-1": 1.492, + "me-south-1": 1.493, + "sa-east-1": 0.0, + "us-east-1": 1.152, + "us-east-2": 0.0, + "us-gov-east-1": 1.384, + "us-gov-west-1": 1.384, + "us-west-1": 0.0, + "us-west-2": 1.152, + "us-west-2-lax-1": 1.382 + }, + "r5d.8xlarge": { + "af-south-1": 3.04, + "ap-east-1": 2.8, + "ap-northeast-1": 2.784, + "ap-northeast-2": 2.768, + "ap-northeast-3": 2.784, + "ap-south-1": 2.416, + "ap-south-2": 2.416, + "ap-southeast-1": 2.784, + "ap-southeast-2": 2.952, + "ap-southeast-3": 2.951, + "ap-southeast-4": 2.784, + "ca-central-1": 0.0, + "eu-central-1": 2.768, + "eu-central-2": 3.227, + "eu-north-1": 2.432, + "eu-south-1": 0.0, + "eu-south-2": 2.56, + "eu-west-1": 2.56, + "eu-west-2": 2.868, + "eu-west-3": 2.704, + "il-central-1": 2.688, + "me-central-1": 2.816, + "me-south-1": 2.816, + "sa-east-1": 3.648, + "us-east-1": 2.304, + "us-east-2": 2.304, + "us-gov-east-1": 2.768, + "us-gov-west-1": 0.0, + "us-west-1": 2.592, + "us-west-2": 2.304, + "us-west-2-lax-1": 0.0 + }, + "r5d.12xlarge": { + "af-south-1": 4.56, + "ap-east-1": 4.2, + "ap-northeast-1": 4.176, + "ap-northeast-2": 4.152, + "ap-northeast-3": 4.176, + "ap-south-1": 3.841, + "ap-south-2": 3.624, + "ap-southeast-1": 4.176, + "ap-southeast-2": 4.176, + "ap-southeast-3": 4.427, + "ap-southeast-4": 4.176, + "ca-central-1": 3.792, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 3.648, + "eu-south-1": 0.0, + "eu-south-2": 3.84, + "eu-west-1": 3.84, + "eu-west-2": 4.056, + "eu-west-3": 4.056, + "il-central-1": 4.032, + "me-central-1": 4.477, + "me-south-1": 4.224, + "sa-east-1": 5.803, + "us-east-1": 3.664, + "us-east-2": 3.456, + "us-gov-east-1": 4.152, + "us-gov-west-1": 4.152, + "us-west-1": 3.888, + "us-west-2": 3.456, + "us-west-2-lax-1": 4.147 + }, + "r5d.16xlarge": { + "af-south-1": 6.08, + "ap-east-1": 5.6, + "ap-northeast-1": 5.568, + "ap-northeast-2": 5.536, + "ap-northeast-3": 5.568, + "ap-south-1": 4.832, + "ap-south-2": 4.832, + "ap-southeast-1": 5.568, + "ap-southeast-2": 5.568, + "ap-southeast-3": 5.568, + "ap-southeast-4": 5.902, + "ca-central-1": 5.056, + "eu-central-1": 5.536, + "eu-central-2": 6.455, + "eu-north-1": 4.864, + "eu-south-1": 5.376, + "eu-south-2": 5.12, + "eu-west-1": 5.12, + "eu-west-2": 5.408, + "eu-west-3": 5.408, + "il-central-1": 5.699, + "me-central-1": 0.0, + "me-south-1": 5.632, + "sa-east-1": 7.296, + "us-east-1": 4.608, + "us-east-2": 4.608, + "us-gov-east-1": 5.536, + "us-gov-west-1": 5.536, + "us-west-1": 5.184, + "us-west-2": 4.608, + "us-west-2-lax-1": 5.53 + }, + "r5d.24xlarge": { + "af-south-1": 9.12, + "ap-east-1": 8.4, + "ap-northeast-1": 0.0, + "ap-northeast-2": 8.304, + "ap-northeast-3": 8.352, + "ap-south-1": 7.248, + "ap-south-2": 7.248, + "ap-southeast-1": 8.352, + "ap-southeast-2": 8.352, + "ap-southeast-3": 0.0, + "ap-southeast-4": 8.352, + "ca-central-1": 7.584, + "eu-central-1": 8.304, + "eu-central-2": 9.134, + "eu-north-1": 7.296, + "eu-south-1": 0.0, + "eu-south-2": 7.68, + "eu-west-1": 7.68, + "eu-west-2": 8.112, + "eu-west-3": 0.0, + "il-central-1": 8.064, + "me-central-1": 8.448, + "me-south-1": 8.448, + "sa-east-1": 10.944, + "us-east-1": 6.912, + "us-east-2": 6.912, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 7.776, + "us-west-2": 6.912, + "us-west-2-lax-1": 8.294 + }, + "r5dn.large": { + "af-south-1": 0.221, + "ap-northeast-1": 0.203, + "ap-northeast-2": 0.199, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.204, + "eu-central-1": 0.199, + "eu-north-1": 0.177, + "eu-south-1": 0.196, + "eu-west-1": 0.0, + "eu-west-3": 0.20776, + "us-east-1": 0.167, + "us-east-2": 0.167, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.201, + "us-west-2": 0.167 + }, + "r5dn.xlarge": { + "af-south-1": 0.442, + "ap-northeast-1": 0.406, + "ap-northeast-2": 0.42188, + "ap-southeast-1": 0.424, + "ap-southeast-2": 0.408, + "eu-central-1": 0.398, + "eu-north-1": 0.354, + "eu-south-1": 0.41552, + "eu-west-1": 0.395, + "eu-west-3": 0.392, + "us-east-1": 0.354, + "us-east-2": 0.0, + "us-gov-east-1": 0.42612, + "us-gov-west-1": 0.426, + "us-west-2": 0.334 + }, + "r5dn.metal": { + "af-south-1": 10.608, + "ap-northeast-1": 0.0, + "ap-northeast-2": 9.552, + "ap-southeast-1": 9.6, + "ap-southeast-2": 9.792, + "eu-central-1": 9.552, + "eu-north-1": 0.0, + "eu-south-1": 9.408, + "eu-west-1": 8.928, + "eu-west-3": 9.408, + "us-east-1": 8.016, + "us-east-2": 8.016, + "us-gov-east-1": 0.0, + "us-gov-west-1": 9.648, + "us-west-2": 8.016 + }, + "r5dn.2xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 0.812, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.849, + "ap-southeast-2": 0.816, + "eu-central-1": 0.0, + "eu-north-1": 0.75048, + "eu-south-1": 0.83104, + "eu-west-1": 0.79, + "eu-west-3": 0.784, + "us-east-1": 0.668, + "us-east-2": 0.668, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.804, + "us-west-2": 0.668 + }, + "r5dn.4xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 1.624, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.632, + "eu-central-1": 1.592, + "eu-north-1": 1.50096, + "eu-south-1": 1.568, + "eu-west-1": 1.488, + "eu-west-3": 1.568, + "us-east-1": 1.416, + "us-east-2": 1.416, + "us-gov-east-1": 1.70448, + "us-gov-west-1": 1.608, + "us-west-2": 0.0 + }, + "r5dn.8xlarge": { + "af-south-1": 3.536, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.184, + "ap-southeast-1": 3.2, + "ap-southeast-2": 3.264, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-3": 0.0, + "us-east-1": 2.672, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.409, + "us-west-2": 2.672 + }, + "r5dn.12xlarge": { + "af-south-1": 5.304, + "ap-northeast-1": 4.872, + "ap-northeast-2": 4.776, + "ap-southeast-1": 5.091, + "ap-southeast-2": 4.896, + "eu-central-1": 4.776, + "eu-north-1": 4.248, + "eu-south-1": 0.0, + "eu-west-1": 4.464, + "eu-west-3": 4.704, + "us-east-1": 4.008, + "us-east-2": 4.008, + "us-gov-east-1": 4.824, + "us-gov-west-1": 4.824, + "us-west-2": 4.249 + }, + "r5dn.16xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 6.496, + "ap-northeast-2": 6.75008, + "ap-southeast-1": 6.4, + "ap-southeast-2": 0.0, + "eu-central-1": 6.368, + "eu-north-1": 0.0, + "eu-south-1": 6.64832, + "eu-west-1": 0.0, + "eu-west-3": 6.272, + "us-east-1": 5.665, + "us-east-2": 5.344, + "us-gov-east-1": 6.81792, + "us-gov-west-1": 0.0, + "us-west-2": 5.344 + }, + "r5dn.24xlarge": { + "af-south-1": 10.608, + "ap-northeast-1": 9.744, + "ap-northeast-2": 9.552, + "ap-southeast-1": 0.0, + "ap-southeast-2": 9.792, + "eu-central-1": 9.552, + "eu-north-1": 8.496, + "eu-south-1": 9.408, + "eu-west-1": 0.0, + "eu-west-3": 9.408, + "us-east-1": 8.016, + "us-east-2": 8.016, + "us-gov-east-1": 9.648, + "us-gov-west-1": 9.648, + "us-west-2": 8.016 + }, + "r5n": { + "eu-south-1": 9.241, + "us-west-2": 7.867 + }, + "r5n.large": { + "af-south-1": 0.199, + "ap-east-1": 0.0, + "ap-northeast-1": 0.181, + "ap-northeast-2": 0.178, + "ap-south-1": 0.153, + "ap-southeast-1": 0.178, + "ap-southeast-2": 0.0, + "ca-central-1": 0.163, + "eu-central-1": 0.178, + "eu-north-1": 0.169, + "eu-south-1": 0.0, + "eu-west-1": 0.167, + "eu-west-2": 0.175, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.179, + "us-gov-west-1": 0.179, + "us-west-1": 0.179, + "us-west-2": 0.158 + }, + "r5n.xlarge": { + "af-south-1": 0.397, + "ap-east-1": 0.428, + "ap-northeast-1": 0.384, + "ap-northeast-2": 0.0, + "ap-south-1": 0.306, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.362, + "ca-central-1": 0.326, + "eu-central-1": 0.0, + "eu-north-1": 0.337, + "eu-south-1": 0.35, + "eu-west-1": 0.334, + "eu-west-2": 0.35, + "eu-west-3": 0.35, + "sa-east-1": 0.0, + "us-east-1": 0.298, + "us-east-2": 0.0, + "us-gov-east-1": 0.358, + "us-gov-west-1": 0.358, + "us-west-1": 0.338, + "us-west-2": 0.298 + }, + "r5n.metal": { + "af-south-1": 9.536, + "ap-east-1": 9.696, + "ap-northeast-1": 8.688, + "ap-northeast-2": 0.0, + "ap-south-1": 7.344, + "ap-southeast-1": 0.0, + "ap-southeast-2": 8.688, + "ca-central-1": 7.824, + "eu-central-1": 8.544, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 8.016, + "eu-west-2": 0.0, + "eu-west-3": 8.4, + "sa-east-1": 0.0, + "us-east-1": 7.152, + "us-east-2": 7.152, + "us-gov-east-1": 8.592, + "us-gov-west-1": 8.592, + "us-west-1": 8.112, + "us-west-2": 7.152 + }, + "r5n.2xlarge": { + "af-south-1": 0.795, + "ap-east-1": 0.808, + "ap-northeast-1": 0.724, + "ap-northeast-2": 0.0, + "ap-south-1": 0.649, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.712, + "eu-north-1": 0.636, + "eu-south-1": 0.7, + "eu-west-1": 0.668, + "eu-west-2": 0.7, + "eu-west-3": 0.7, + "sa-east-1": 0.944, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.716, + "us-gov-west-1": 0.716, + "us-west-1": 0.676, + "us-west-2": 0.596 + }, + "r5n.4xlarge": { + "af-south-1": 1.589, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.424, + "ap-south-1": 1.224, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 1.304, + "eu-central-1": 1.51, + "eu-north-1": 0.0, + "eu-south-1": 1.484, + "eu-west-1": 1.416, + "eu-west-2": 1.4, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 1.192, + "us-east-2": 1.192, + "us-gov-east-1": 1.432, + "us-gov-west-1": 0.0, + "us-west-1": 1.433, + "us-west-2": 1.192 + }, + "r5n.8xlarge": { + "af-south-1": 3.179, + "ap-east-1": 3.232, + "ap-northeast-1": 3.074, + "ap-northeast-2": 2.848, + "ap-south-1": 2.448, + "ap-southeast-1": 3.021, + "ap-southeast-2": 2.896, + "ca-central-1": 2.608, + "eu-central-1": 0.0, + "eu-north-1": 2.696, + "eu-south-1": 2.968, + "eu-west-1": 2.672, + "eu-west-2": 2.969, + "eu-west-3": 2.8, + "sa-east-1": 4.003, + "us-east-1": 2.527, + "us-east-2": 2.384, + "us-gov-east-1": 3.036, + "us-gov-west-1": 2.864, + "us-west-1": 2.867, + "us-west-2": 0.0 + }, + "r5n.12xlarge": { + "af-south-1": 5.054, + "ap-east-1": 5.138, + "ap-northeast-1": 4.61, + "ap-northeast-2": 4.272, + "ap-south-1": 3.892, + "ap-southeast-1": 4.272, + "ap-southeast-2": 4.344, + "ca-central-1": 3.912, + "eu-central-1": 4.531, + "eu-north-1": 0.0, + "eu-south-1": 4.453, + "eu-west-1": 4.008, + "eu-west-2": 4.453, + "eu-west-3": 4.2, + "sa-east-1": 5.664, + "us-east-1": 3.576, + "us-east-2": 3.576, + "us-gov-east-1": 4.296, + "us-gov-west-1": 4.554, + "us-west-1": 4.3, + "us-west-2": 3.576 + }, + "r5n.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 4.896, + "ap-southeast-1": 5.696, + "ap-southeast-2": 0.0, + "ca-central-1": 5.216, + "eu-central-1": 5.696, + "eu-north-1": 5.088, + "eu-south-1": 0.0, + "eu-west-1": 5.344, + "eu-west-2": 5.6, + "eu-west-3": 0.0, + "sa-east-1": 8.005, + "us-east-1": 4.768, + "us-east-2": 5.054, + "us-gov-east-1": 6.072, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 5.054 + }, + "r5n.24xlarge": { + "af-south-1": 9.536, + "ap-east-1": 0.0, + "ap-northeast-1": 8.688, + "ap-northeast-2": 8.544, + "ap-south-1": 7.344, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 7.824, + "eu-central-1": 8.544, + "eu-north-1": 7.632, + "eu-south-1": 8.401, + "eu-west-1": 0.0, + "eu-west-2": 8.4, + "eu-west-3": 8.4, + "sa-east-1": 11.328, + "us-east-1": 0.0, + "us-east-2": 7.152, + "us-gov-east-1": 8.592, + "us-gov-west-1": 8.592, + "us-west-1": 8.112, + "us-west-2": 7.152 + }, + "r6a": { + "ap-south-2": 7.55, + "ap-southeast-1": 14.446, + "us-east-1": 11.975, + "us-west-1": 13.306 + }, + "r6a.large": { + "ap-northeast-1": 0.15048, + "ap-south-1": 0.0715, + "ap-south-2": 0.07865, + "ap-southeast-1": 0.1368, + "ap-southeast-2": 0.14949, + "ca-central-1": 0.1242, + "eu-central-1": 0.15048, + "eu-west-1": 0.1269, + "us-east-1": 0.0, + "us-east-2": 0.1134, + "us-west-1": 0.126, + "us-west-2": 0.12474 + }, + "r6a.xlarge": { + "ap-northeast-1": 0.30096, + "ap-south-1": 0.0, + "ap-south-2": 0.143, + "ap-southeast-1": 0.2736, + "ap-southeast-2": 0.29898, + "ca-central-1": 0.0, + "eu-central-1": 0.2736, + "eu-west-1": 0.2538, + "us-east-1": 0.2268, + "us-east-2": 0.2268, + "us-west-1": 0.2772, + "us-west-2": 0.0 + }, + "r6a.metal": { + "ap-northeast-1": 0.0, + "ap-south-1": 6.864, + "ap-south-2": 6.864, + "ap-southeast-1": 13.1328, + "ap-southeast-2": 13.0464, + "ca-central-1": 11.9232, + "eu-central-1": 13.1328, + "eu-west-1": 12.1824, + "us-east-1": 10.8864, + "us-east-2": 10.8864, + "us-west-1": 12.096, + "us-west-2": 10.8864 + }, + "r6a.2xlarge": { + "ap-northeast-1": 0.5472, + "ap-south-1": 0.0, + "ap-south-2": 0.286, + "ap-southeast-1": 0.5472, + "ap-southeast-2": 0.0, + "ca-central-1": 0.54648, + "eu-central-1": 0.5472, + "eu-west-1": 0.5076, + "us-east-1": 0.4536, + "us-east-2": 0.0, + "us-west-1": 0.504, + "us-west-2": 0.4536 + }, + "r6a.4xlarge": { + "ap-northeast-1": 1.20384, + "ap-south-1": 0.572, + "ap-south-2": 0.0, + "ap-southeast-1": 1.0944, + "ap-southeast-2": 1.0872, + "ca-central-1": 0.9936, + "eu-central-1": 1.20384, + "eu-west-1": 1.0152, + "us-east-1": 0.9072, + "us-east-2": 0.99792, + "us-west-1": 1.1088, + "us-west-2": 0.9072 + }, + "r6a.8xlarge": { + "ap-northeast-1": 2.1888, + "ap-south-1": 1.144, + "ap-south-2": 1.2584, + "ap-southeast-1": 2.1888, + "ap-southeast-2": 2.39184, + "ca-central-1": 1.9872, + "eu-central-1": 2.1888, + "eu-west-1": 2.0304, + "us-east-1": 0.0, + "us-east-2": 1.99584, + "us-west-1": 2.2176, + "us-west-2": 1.8144 + }, + "r6a.12xlarge": { + "ap-northeast-1": 3.2832, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 3.2832, + "ap-southeast-2": 3.2616, + "ca-central-1": 0.0, + "eu-central-1": 3.2832, + "eu-west-1": 3.0456, + "us-east-1": 2.7216, + "us-east-2": 2.7216, + "us-west-1": 3.3264, + "us-west-2": 2.7216 + }, + "r6a.16xlarge": { + "ap-northeast-1": 4.3776, + "ap-south-1": 2.288, + "ap-south-2": 2.288, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.3488, + "ca-central-1": 3.9744, + "eu-central-1": 4.81536, + "eu-west-1": 4.0608, + "us-east-1": 3.6288, + "us-east-2": 3.6288, + "us-west-1": 4.4352, + "us-west-2": 3.6288 + }, + "r6a.24xlarge": { + "ap-northeast-1": 6.5664, + "ap-south-1": 3.432, + "ap-south-2": 3.432, + "ap-southeast-1": 6.5664, + "ap-southeast-2": 6.5232, + "ca-central-1": 5.9616, + "eu-central-1": 6.5664, + "eu-west-1": 6.0912, + "us-east-1": 5.4432, + "us-east-2": 5.4432, + "us-west-1": 6.6528, + "us-west-2": 0.0 + }, + "r6a.32xlarge": { + "ap-northeast-1": 8.7552, + "ap-south-1": 4.576, + "ap-south-2": 0.0, + "ap-southeast-1": 8.7552, + "ap-southeast-2": 8.6976, + "ca-central-1": 8.74368, + "eu-central-1": 0.0, + "eu-west-1": 8.93376, + "us-east-1": 0.0, + "us-east-2": 7.98336, + "us-west-1": 8.064, + "us-west-2": 7.2576 + }, + "r6a.48xlarge": { + "ap-northeast-1": 13.1328, + "ap-south-1": 6.864, + "ap-south-2": 6.864, + "ap-southeast-1": 13.1328, + "ap-southeast-2": 13.0464, + "ca-central-1": 11.9232, + "eu-central-1": 13.1328, + "eu-west-1": 12.1824, + "us-east-1": 10.8864, + "us-east-2": 0.0, + "us-west-1": 12.096, + "us-west-2": 10.8864 + }, + "r6g.medium": { + "af-south-1": 0.0672, + "ap-east-1": 0.067, + "ap-northeast-1": 0.0608, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0345, + "ap-southeast-1": 0.0608, + "ap-southeast-2": 0.0604, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0604, + "ap-southeast-5": 0.0548, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.0552, + "eu-central-1": 0.0644, + "eu-central-2": 0.0709, + "eu-north-1": 0.0535, + "eu-south-1": 0.0592, + "eu-south-2": 0.0, + "eu-west-1": 0.0564, + "eu-west-2": 0.0628, + "eu-west-3": 0.059, + "il-central-1": 0.0592, + "me-central-1": 0.062, + "me-south-1": 0.0658, + "mx-central-1": 0.0561, + "sa-east-1": 0.0, + "us-east-1": 0.0504, + "us-east-2": 0.0504, + "us-gov-east-1": 0.0604, + "us-gov-west-1": 0.0604, + "us-west-1": 0.0594, + "us-west-2": 0.0504 + }, + "r6g.large": { + "af-south-1": 0.1344, + "ap-east-1": 0.134, + "ap-northeast-1": 0.1216, + "ap-northeast-2": 0.122, + "ap-northeast-3": 0.1289, + "ap-south-1": 0.0, + "ap-south-2": 0.0689, + "ap-southeast-1": 0.1216, + "ap-southeast-2": 0.1208, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.1096, + "ap-southeast-7": 0.1034, + "ca-central-1": 0.1104, + "ca-west-1": 0.1104, + "eu-central-1": 0.1289, + "eu-central-2": 0.1338, + "eu-north-1": 0.107, + "eu-south-1": 0.1184, + "eu-south-2": 0.1128, + "eu-west-1": 0.1128, + "eu-west-2": 0.1184, + "eu-west-3": 0.1251, + "il-central-1": 0.1184, + "me-central-1": 0.1241, + "me-south-1": 0.0, + "mx-central-1": 0.1058, + "sa-east-1": 0.1608, + "us-east-1": 0.1068, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.128, + "us-west-1": 0.112, + "us-west-2": 0.1068 + }, + "r6g.xlarge": { + "af-south-1": 0.2688, + "ap-east-1": 0.268, + "ap-northeast-1": 0.2432, + "ap-northeast-2": 0.244, + "ap-northeast-3": 0.2432, + "ap-south-1": 0.13, + "ap-south-2": 0.1378, + "ap-southeast-1": 0.2432, + "ap-southeast-2": 0.2416, + "ap-southeast-3": 0.2578, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.2067, + "ap-southeast-7": 0.2191, + "ca-central-1": 0.2208, + "ca-west-1": 0.2208, + "eu-central-1": 0.2432, + "eu-central-2": 0.0, + "eu-north-1": 0.214, + "eu-south-1": 0.2368, + "eu-south-2": 0.2391, + "eu-west-1": 0.2256, + "eu-west-2": 0.251, + "eu-west-3": 0.236, + "il-central-1": 0.2369, + "me-central-1": 0.2482, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.3409, + "us-east-1": 0.2016, + "us-east-2": 0.2016, + "us-gov-east-1": 0.2416, + "us-gov-west-1": 0.2416, + "us-west-1": 0.224, + "us-west-2": 0.2016 + }, + "r6g.metal": { + "af-south-1": 4.3008, + "ap-east-1": 4.288, + "ap-northeast-1": 4.1247, + "ap-northeast-2": 3.904, + "ap-northeast-3": 0.0, + "ap-south-1": 2.08, + "ap-south-2": 2.08, + "ap-southeast-1": 3.8912, + "ap-southeast-2": 3.8656, + "ap-southeast-3": 3.8912, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 3.3075, + "ca-central-1": 3.7448, + "ca-west-1": 3.5328, + "eu-central-1": 0.0, + "eu-central-2": 4.2803, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 3.6096, + "eu-west-1": 3.6096, + "eu-west-2": 3.7888, + "eu-west-3": 3.776, + "il-central-1": 3.7901, + "me-central-1": 3.9706, + "me-south-1": 3.9706, + "mx-central-1": 0.0, + "sa-east-1": 5.1456, + "us-east-1": 3.2256, + "us-east-2": 3.2256, + "us-gov-east-1": 3.8656, + "us-gov-west-1": 3.8656, + "us-west-1": 3.584, + "us-west-2": 3.2256 + }, + "r6g.2xlarge": { + "af-south-1": 0.5376, + "ap-east-1": 0.536, + "ap-northeast-1": 0.5156, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.5156, + "ap-south-1": 0.26, + "ap-south-2": 0.26, + "ap-southeast-1": 0.5156, + "ap-southeast-2": 0.4832, + "ap-southeast-3": 0.5156, + "ap-southeast-4": 0.4832, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.4134, + "ca-central-1": 0.4681, + "ca-west-1": 0.4416, + "eu-central-1": 0.0, + "eu-central-2": 0.5671, + "eu-north-1": 0.428, + "eu-south-1": 0.502, + "eu-south-2": 0.4783, + "eu-west-1": 0.4512, + "eu-west-2": 0.4736, + "eu-west-3": 0.0, + "il-central-1": 0.4738, + "me-central-1": 0.4963, + "me-south-1": 0.4963, + "mx-central-1": 0.0, + "sa-east-1": 0.6432, + "us-east-1": 0.4032, + "us-east-2": 0.4032, + "us-gov-east-1": 0.5122, + "us-gov-west-1": 0.0, + "us-west-1": 0.448, + "us-west-2": 0.4274 + }, + "r6g.4xlarge": { + "af-south-1": 1.0752, + "ap-east-1": 1.072, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.0344, + "ap-northeast-3": 0.9728, + "ap-south-1": 0.0, + "ap-south-2": 0.52, + "ap-southeast-1": 1.0312, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.9728, + "ap-southeast-4": 0.9664, + "ap-southeast-5": 0.8269, + "ap-southeast-7": 0.8269, + "ca-central-1": 0.0, + "ca-west-1": 0.9362, + "eu-central-1": 0.0, + "eu-central-2": 1.0701, + "eu-north-1": 0.9072, + "eu-south-1": 0.9472, + "eu-south-2": 0.9024, + "eu-west-1": 0.9024, + "eu-west-2": 0.9472, + "eu-west-3": 0.0, + "il-central-1": 0.9475, + "me-central-1": 0.9926, + "me-south-1": 0.9926, + "mx-central-1": 0.0, + "sa-east-1": 1.2864, + "us-east-1": 0.8064, + "us-east-2": 0.8064, + "us-gov-east-1": 0.9664, + "us-gov-west-1": 0.9664, + "us-west-1": 0.896, + "us-west-2": 0.8064 + }, + "r6g.8xlarge": { + "af-south-1": 2.2794, + "ap-east-1": 2.144, + "ap-northeast-1": 1.9456, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.9456, + "ap-south-1": 1.1024, + "ap-south-2": 1.1024, + "ap-southeast-1": 1.9456, + "ap-southeast-2": 2.0488, + "ap-southeast-3": 1.9456, + "ap-southeast-4": 2.0488, + "ap-southeast-5": 1.6538, + "ap-southeast-7": 1.6538, + "ca-central-1": 1.7664, + "ca-west-1": 1.8724, + "eu-central-1": 1.9456, + "eu-central-2": 2.1402, + "eu-north-1": 1.712, + "eu-south-1": 1.8944, + "eu-south-2": 1.9131, + "eu-west-1": 1.8048, + "eu-west-2": 1.8944, + "eu-west-3": 2.0016, + "il-central-1": 1.895, + "me-central-1": 0.0, + "me-south-1": 1.9853, + "mx-central-1": 1.795, + "sa-east-1": 2.7272, + "us-east-1": 1.6128, + "us-east-2": 1.6128, + "us-gov-east-1": 2.0488, + "us-gov-west-1": 0.0, + "us-west-1": 1.792, + "us-west-2": 1.7096 + }, + "r6g.12xlarge": { + "af-south-1": 3.2256, + "ap-east-1": 3.216, + "ap-northeast-1": 2.9184, + "ap-northeast-2": 2.928, + "ap-northeast-3": 3.0935, + "ap-south-1": 1.56, + "ap-south-2": 1.56, + "ap-southeast-1": 2.9184, + "ap-southeast-2": 3.0732, + "ap-southeast-3": 2.9184, + "ap-southeast-4": 2.8992, + "ap-southeast-5": 2.6295, + "ap-southeast-7": 2.4806, + "ca-central-1": 0.0, + "ca-west-1": 2.6496, + "eu-central-1": 2.9184, + "eu-central-2": 3.4029, + "eu-north-1": 2.568, + "eu-south-1": 2.8416, + "eu-south-2": 2.7072, + "eu-west-1": 2.7072, + "eu-west-2": 2.8416, + "eu-west-3": 2.832, + "il-central-1": 2.8426, + "me-central-1": 2.9779, + "me-south-1": 2.9779, + "mx-central-1": 2.5402, + "sa-east-1": 3.8592, + "us-east-1": 0.0, + "us-east-2": 2.4192, + "us-gov-east-1": 3.0732, + "us-gov-west-1": 2.8992, + "us-west-1": 2.8493, + "us-west-2": 2.4192 + }, + "r6g.16xlarge": { + "af-south-1": 4.3008, + "ap-east-1": 4.544, + "ap-northeast-1": 4.1247, + "ap-northeast-2": 3.904, + "ap-northeast-3": 3.8912, + "ap-south-1": 2.2048, + "ap-south-2": 2.08, + "ap-southeast-1": 3.8912, + "ap-southeast-2": 3.8656, + "ap-southeast-3": 3.8912, + "ap-southeast-4": 3.8656, + "ap-southeast-5": 3.3075, + "ap-southeast-7": 3.3075, + "ca-central-1": 3.5328, + "ca-west-1": 3.5328, + "eu-central-1": 0.0, + "eu-central-2": 4.2803, + "eu-north-1": 0.0, + "eu-south-1": 3.7888, + "eu-south-2": 3.6096, + "eu-west-1": 3.6096, + "eu-west-2": 4.0161, + "eu-west-3": 3.776, + "il-central-1": 3.7901, + "me-central-1": 3.9706, + "me-south-1": 3.9706, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 3.2256, + "us-east-2": 0.0, + "us-gov-east-1": 3.8656, + "us-gov-west-1": 3.8656, + "us-west-1": 3.584, + "us-west-2": 3.2256 + }, + "r6gd.medium": { + "ap-northeast-1": 0.0695, + "ap-northeast-2": 0.0692, + "ap-northeast-3": 0.0696, + "ap-south-1": 0.0374, + "ap-southeast-1": 0.0695, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0608, + "eu-south-2": 0.0, + "eu-west-1": 0.064, + "eu-west-2": 0.0717, + "eu-west-3": 0.0676, + "sa-east-1": 0.0912, + "us-east-1": 0.0576, + "us-east-2": 0.0576, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0692, + "us-west-1": 0.065, + "us-west-2": 0.0576 + }, + "r6gd.large": { + "ap-northeast-1": 0.1474, + "ap-northeast-2": 0.1384, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0747, + "ap-southeast-1": 0.139, + "ap-southeast-2": 0.139, + "ap-southeast-3": 0.0, + "ca-central-1": 0.1264, + "eu-central-1": 0.138, + "eu-central-2": 0.1518, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.1352, + "sa-east-1": 0.0, + "us-east-1": 0.1152, + "us-east-2": 0.1152, + "us-gov-east-1": 0.1384, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.1152 + }, + "r6gd.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.2768, + "ap-northeast-3": 0.2784, + "ap-south-1": 0.1495, + "ap-southeast-1": 0.278, + "ap-southeast-2": 0.278, + "ap-southeast-3": 0.0, + "ca-central-1": 0.2528, + "eu-central-1": 0.276, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.256, + "eu-west-1": 0.2714, + "eu-west-2": 0.0, + "eu-west-3": 0.2704, + "sa-east-1": 0.3648, + "us-east-1": 0.2304, + "us-east-2": 0.2442, + "us-gov-east-1": 0.2768, + "us-gov-west-1": 0.0, + "us-west-1": 0.26, + "us-west-2": 0.2304 + }, + "r6gd.metal": { + "ap-northeast-1": 4.7168, + "ap-northeast-2": 4.4288, + "ap-northeast-3": 4.4544, + "ap-south-1": 2.3917, + "ap-southeast-1": 4.448, + "ap-southeast-2": 4.7168, + "ap-southeast-3": 4.448, + "ca-central-1": 4.0448, + "eu-central-1": 4.6816, + "eu-central-2": 4.8576, + "eu-north-1": 3.8912, + "eu-south-2": 4.096, + "eu-west-1": 4.096, + "eu-west-2": 4.3264, + "eu-west-3": 4.3264, + "sa-east-1": 5.8368, + "us-east-1": 0.0, + "us-east-2": 3.6864, + "us-gov-east-1": 4.4288, + "us-gov-west-1": 4.4288, + "us-west-1": 4.4096, + "us-west-2": 0.0 + }, + "r6gd.2xlarge": { + "ap-northeast-1": 0.556, + "ap-northeast-2": 0.5868, + "ap-northeast-3": 0.0, + "ap-south-1": 0.299, + "ap-southeast-1": 0.556, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.556, + "ca-central-1": 0.5359, + "eu-central-1": 0.5852, + "eu-central-2": 0.0, + "eu-north-1": 0.4864, + "eu-south-2": 0.0, + "eu-west-1": 0.512, + "eu-west-2": 0.5408, + "eu-west-3": 0.5408, + "sa-east-1": 0.7296, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.5536, + "us-gov-west-1": 0.5868, + "us-west-1": 0.52, + "us-west-2": 0.4884 + }, + "r6gd.4xlarge": { + "ap-northeast-1": 1.112, + "ap-northeast-2": 1.1072, + "ap-northeast-3": 1.1136, + "ap-south-1": 0.5979, + "ap-southeast-1": 1.1792, + "ap-southeast-2": 1.112, + "ap-southeast-3": 1.1792, + "ca-central-1": 1.0112, + "eu-central-1": 1.1704, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 1.0854, + "eu-west-2": 1.0816, + "eu-west-3": 1.0816, + "sa-east-1": 1.4592, + "us-east-1": 0.9216, + "us-east-2": 0.9216, + "us-gov-east-1": 1.1736, + "us-gov-west-1": 0.0, + "us-west-1": 1.04, + "us-west-2": 0.9216 + }, + "r6gd.8xlarge": { + "ap-northeast-1": 2.224, + "ap-northeast-2": 2.2144, + "ap-northeast-3": 2.2272, + "ap-south-1": 1.1958, + "ap-southeast-1": 2.3584, + "ap-southeast-2": 2.224, + "ap-southeast-3": 2.224, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 2.4288, + "eu-north-1": 1.9456, + "eu-south-2": 2.048, + "eu-west-1": 2.1709, + "eu-west-2": 2.1632, + "eu-west-3": 2.293, + "sa-east-1": 0.0, + "us-east-1": 1.9538, + "us-east-2": 1.9538, + "us-gov-east-1": 2.2144, + "us-gov-west-1": 2.2144, + "us-west-1": 0.0, + "us-west-2": 1.8432 + }, + "r6gd.12xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.3216, + "ap-northeast-3": 3.3408, + "ap-south-1": 1.7938, + "ap-southeast-1": 3.336, + "ap-southeast-2": 3.336, + "ap-southeast-3": 3.336, + "ca-central-1": 3.2156, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 3.072, + "eu-west-1": 3.072, + "eu-west-2": 3.2448, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 2.9307, + "us-east-2": 2.7648, + "us-gov-east-1": 3.3216, + "us-gov-west-1": 3.3216, + "us-west-1": 3.12, + "us-west-2": 2.7648 + }, + "r6gd.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 4.4544, + "ap-south-1": 0.0, + "ap-southeast-1": 4.448, + "ap-southeast-2": 4.448, + "ap-southeast-3": 4.448, + "ca-central-1": 4.0448, + "eu-central-1": 4.6816, + "eu-central-2": 4.8576, + "eu-north-1": 3.8912, + "eu-south-2": 0.0, + "eu-west-1": 4.096, + "eu-west-2": 4.3264, + "eu-west-3": 4.3264, + "sa-east-1": 5.8368, + "us-east-1": 3.6864, + "us-east-2": 3.6864, + "us-gov-east-1": 4.4288, + "us-gov-west-1": 0.0, + "us-west-1": 4.16, + "us-west-2": 3.6864 + }, + "r6i.large": { + "af-south-1": 0.168, + "ap-east-1": 0.167, + "ap-northeast-1": 0.152, + "ap-northeast-2": 0.152, + "ap-northeast-3": 0.152, + "ap-south-1": 0.143, + "ap-south-2": 0.143, + "ap-southeast-1": 0.152, + "ap-southeast-2": 0.151, + "ap-southeast-5": 0.1292, + "ap-southeast-7": 0.14212, + "ca-central-1": 0.138, + "ca-west-1": 0.138, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.1474, + "eu-south-1": 0.148, + "eu-west-1": 0.0, + "eu-west-2": 0.148, + "eu-west-3": 0.1628, + "il-central-1": 0.14805, + "me-central-1": 0.17061, + "me-south-1": 0.1551, + "mx-central-1": 0.1323, + "sa-east-1": 0.201, + "us-east-1": 0.1386, + "us-east-2": 0.126, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.14, + "us-west-2": 0.126 + }, + "r6i.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.334, + "ap-northeast-1": 0.304, + "ap-northeast-2": 0.304, + "ap-northeast-3": 0.304, + "ap-south-1": 0.286, + "ap-south-2": 0.0, + "ap-southeast-1": 0.3344, + "ap-southeast-2": 0.302, + "ap-southeast-5": 0.2584, + "ap-southeast-7": 0.2584, + "ca-central-1": 0.0, + "ca-west-1": 0.276, + "eu-central-1": 0.0, + "eu-central-2": 0.3344, + "eu-north-1": 0.268, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.296, + "eu-west-3": 0.0, + "il-central-1": 0.2961, + "me-central-1": 0.34122, + "me-south-1": 0.34122, + "mx-central-1": 0.2646, + "sa-east-1": 0.402, + "us-east-1": 0.252, + "us-east-2": 0.252, + "us-gov-east-1": 0.302, + "us-gov-west-1": 0.0, + "us-west-1": 0.28, + "us-west-2": 0.252 + }, + "r6i.metal": { + "af-south-1": 10.752, + "ap-east-1": 10.688, + "ap-northeast-1": 9.728, + "ap-northeast-2": 9.728, + "ap-northeast-3": 9.728, + "ap-south-1": 8.32, + "ap-south-2": 8.32, + "ap-southeast-1": 0.0, + "ap-southeast-2": 9.664, + "ap-southeast-5": 8.2688, + "ap-southeast-7": 8.2688, + "ca-central-1": 0.0, + "ca-west-1": 8.832, + "eu-central-1": 9.728, + "eu-central-2": 0.0, + "eu-north-1": 8.576, + "eu-south-1": 9.472, + "eu-west-1": 9.024, + "eu-west-2": 9.472, + "eu-west-3": 0.0, + "il-central-1": 9.4752, + "me-central-1": 9.9264, + "me-south-1": 0.0, + "mx-central-1": 8.4672, + "sa-east-1": 12.864, + "us-east-1": 8.064, + "us-east-2": 8.064, + "us-gov-east-1": 9.664, + "us-gov-west-1": 9.664, + "us-west-1": 8.96, + "us-west-2": 8.064 + }, + "r6i.2xlarge": { + "af-south-1": 0.672, + "ap-east-1": 0.668, + "ap-northeast-1": 0.6688, + "ap-northeast-2": 0.608, + "ap-northeast-3": 0.608, + "ap-south-1": 0.572, + "ap-south-2": 0.52, + "ap-southeast-1": 0.608, + "ap-southeast-2": 0.604, + "ap-southeast-5": 0.5168, + "ap-southeast-7": 0.5168, + "ca-central-1": 0.6072, + "ca-west-1": 0.0, + "eu-central-1": 0.6688, + "eu-central-2": 0.6688, + "eu-north-1": 0.536, + "eu-south-1": 0.6512, + "eu-west-1": 0.6204, + "eu-west-2": 0.0, + "eu-west-3": 0.592, + "il-central-1": 0.5922, + "me-central-1": 0.6204, + "me-south-1": 0.0, + "mx-central-1": 0.58212, + "sa-east-1": 0.804, + "us-east-1": 0.504, + "us-east-2": 0.504, + "us-gov-east-1": 0.604, + "us-gov-west-1": 0.6644, + "us-west-1": 0.616, + "us-west-2": 0.5544 + }, + "r6i.4xlarge": { + "af-south-1": 1.344, + "ap-east-1": 1.336, + "ap-northeast-1": 1.216, + "ap-northeast-2": 1.3376, + "ap-northeast-3": 1.216, + "ap-south-1": 0.0, + "ap-south-2": 1.04, + "ap-southeast-1": 1.216, + "ap-southeast-2": 1.208, + "ap-southeast-5": 1.13696, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 1.104, + "eu-central-1": 1.216, + "eu-central-2": 1.47136, + "eu-north-1": 0.0, + "eu-south-1": 1.184, + "eu-west-1": 0.0, + "eu-west-2": 1.3024, + "eu-west-3": 1.3024, + "il-central-1": 1.1844, + "me-central-1": 1.2408, + "me-south-1": 1.36488, + "mx-central-1": 1.0584, + "sa-east-1": 1.7688, + "us-east-1": 1.008, + "us-east-2": 1.1088, + "us-gov-east-1": 1.208, + "us-gov-west-1": 1.208, + "us-west-1": 1.12, + "us-west-2": 0.0 + }, + "r6i.8xlarge": { + "af-south-1": 2.9568, + "ap-east-1": 2.9392, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.432, + "ap-northeast-3": 2.432, + "ap-south-1": 2.08, + "ap-south-2": 2.08, + "ap-southeast-1": 2.6752, + "ap-southeast-2": 2.416, + "ap-southeast-5": 2.27392, + "ap-southeast-7": 2.0672, + "ca-central-1": 2.208, + "ca-west-1": 2.208, + "eu-central-1": 0.0, + "eu-central-2": 2.94272, + "eu-north-1": 0.0, + "eu-south-1": 2.368, + "eu-west-1": 2.4816, + "eu-west-2": 2.368, + "eu-west-3": 2.6048, + "il-central-1": 2.3688, + "me-central-1": 2.4816, + "me-south-1": 2.4816, + "mx-central-1": 2.32848, + "sa-east-1": 3.216, + "us-east-1": 0.0, + "us-east-2": 2.2176, + "us-gov-east-1": 2.416, + "us-gov-west-1": 2.416, + "us-west-1": 2.24, + "us-west-2": 2.016 + }, + "r6i.12xlarge": { + "af-south-1": 4.032, + "ap-east-1": 0.0, + "ap-northeast-1": 3.648, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.648, + "ap-south-1": 3.12, + "ap-south-2": 3.432, + "ap-southeast-1": 4.0128, + "ap-southeast-2": 3.9864, + "ap-southeast-5": 0.0, + "ap-southeast-7": 3.1008, + "ca-central-1": 3.312, + "ca-west-1": 3.312, + "eu-central-1": 4.0128, + "eu-central-2": 4.0128, + "eu-north-1": 3.216, + "eu-south-1": 3.9072, + "eu-west-1": 3.384, + "eu-west-2": 3.552, + "eu-west-3": 3.552, + "il-central-1": 3.5532, + "me-central-1": 3.7224, + "me-south-1": 0.0, + "mx-central-1": 3.49272, + "sa-east-1": 4.824, + "us-east-1": 0.0, + "us-east-2": 3.024, + "us-gov-east-1": 3.9864, + "us-gov-west-1": 0.0, + "us-west-1": 3.36, + "us-west-2": 3.024 + }, + "r6i.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 5.344, + "ap-northeast-1": 4.864, + "ap-northeast-2": 4.864, + "ap-northeast-3": 4.864, + "ap-south-1": 0.0, + "ap-south-2": 4.16, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.3152, + "ap-southeast-5": 4.1344, + "ap-southeast-7": 4.1344, + "ca-central-1": 4.416, + "ca-west-1": 4.416, + "eu-central-1": 4.864, + "eu-central-2": 5.3504, + "eu-north-1": 0.0, + "eu-south-1": 4.736, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 4.736, + "il-central-1": 4.7376, + "me-central-1": 0.0, + "me-south-1": 4.9632, + "mx-central-1": 0.0, + "sa-east-1": 6.432, + "us-east-1": 4.4352, + "us-east-2": 4.032, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.832, + "us-west-1": 4.48, + "us-west-2": 4.4352 + }, + "r6i.24xlarge": { + "af-south-1": 8.064, + "ap-east-1": 0.0, + "ap-northeast-1": 7.296, + "ap-northeast-2": 7.296, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 7.296, + "ap-southeast-2": 7.248, + "ap-southeast-5": 0.0, + "ap-southeast-7": 6.2016, + "ca-central-1": 7.2864, + "ca-west-1": 6.624, + "eu-central-1": 7.296, + "eu-central-2": 8.82816, + "eu-north-1": 6.432, + "eu-south-1": 7.8144, + "eu-west-1": 7.4448, + "eu-west-2": 0.0, + "eu-west-3": 7.104, + "il-central-1": 0.0, + "me-central-1": 7.4448, + "me-south-1": 7.4448, + "mx-central-1": 6.98544, + "sa-east-1": 9.648, + "us-east-1": 6.6528, + "us-east-2": 6.6528, + "us-gov-east-1": 7.248, + "us-gov-west-1": 7.248, + "us-west-1": 7.392, + "us-west-2": 6.048 + }, + "r6i.32xlarge": { + "af-south-1": 0.0, + "ap-east-1": 10.688, + "ap-northeast-1": 9.728, + "ap-northeast-2": 9.728, + "ap-northeast-3": 9.728, + "ap-south-1": 0.0, + "ap-south-2": 8.32, + "ap-southeast-1": 9.728, + "ap-southeast-2": 9.664, + "ap-southeast-5": 8.2688, + "ap-southeast-7": 8.2688, + "ca-central-1": 8.832, + "ca-west-1": 8.832, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 8.576, + "eu-south-1": 9.472, + "eu-west-1": 9.024, + "eu-west-2": 9.472, + "eu-west-3": 0.0, + "il-central-1": 9.4752, + "me-central-1": 9.9264, + "me-south-1": 9.9264, + "mx-central-1": 8.4672, + "sa-east-1": 12.864, + "us-east-1": 8.064, + "us-east-2": 8.064, + "us-gov-east-1": 9.664, + "us-gov-west-1": 9.664, + "us-west-1": 8.96, + "us-west-2": 8.064 + }, + "r6id": { + "ap-southeast-7": 10.932 + }, + "r6id.large": { + "ap-northeast-1": 0.1827, + "ap-northeast-2": 0.19987, + "ap-south-1": 0.1586, + "ap-southeast-1": 0.1827, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.15529, + "ap-southeast-7": 0.15529, + "ca-west-1": 0.1659, + "eu-central-1": 0.18165, + "eu-west-1": 0.168, + "eu-west-2": 0.17745, + "il-central-1": 0.0, + "mx-central-1": 0.15876, + "us-east-1": 0.1512, + "us-east-2": 0.1512, + "us-gov-west-1": 0.19987, + "us-west-2": 0.0 + }, + "r6id.xlarge": { + "ap-northeast-1": 0.3654, + "ap-northeast-2": 0.39974, + "ap-south-1": 0.0, + "ap-southeast-1": 0.40194, + "ap-southeast-2": 0.348, + "ap-southeast-5": 0.31058, + "ap-southeast-7": 0.0, + "ca-west-1": 0.3318, + "eu-central-1": 0.3633, + "eu-west-1": 0.0, + "eu-west-2": 0.39039, + "il-central-1": 0.3528, + "mx-central-1": 0.34927, + "us-east-1": 0.3024, + "us-east-2": 0.3024, + "us-gov-west-1": 0.3634, + "us-west-2": 0.33264 + }, + "r6id.metal": { + "ap-northeast-1": 11.6928, + "ap-northeast-2": 11.6288, + "ap-south-1": 10.1504, + "ap-southeast-1": 11.6928, + "ap-southeast-2": 11.136, + "ap-southeast-5": 9.93856, + "ap-southeast-7": 9.93856, + "ca-west-1": 10.6176, + "eu-central-1": 0.0, + "eu-west-1": 10.752, + "eu-west-2": 11.3568, + "il-central-1": 11.2896, + "mx-central-1": 10.16064, + "us-east-1": 9.6768, + "us-east-2": 9.6768, + "us-gov-west-1": 11.6288, + "us-west-2": 9.6768 + }, + "r6id.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.7268, + "ap-south-1": 0.6344, + "ap-southeast-1": 0.7308, + "ap-southeast-2": 0.696, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.68328, + "ca-west-1": 0.6636, + "eu-central-1": 0.7266, + "eu-west-1": 0.0, + "eu-west-2": 0.7098, + "il-central-1": 0.0, + "mx-central-1": 0.69854, + "us-east-1": 0.6048, + "us-east-2": 0.6048, + "us-gov-west-1": 0.7268, + "us-west-2": 0.66528 + }, + "r6id.4xlarge": { + "ap-northeast-1": 1.60776, + "ap-northeast-2": 1.59896, + "ap-south-1": 1.2688, + "ap-southeast-1": 1.4616, + "ap-southeast-2": 1.5312, + "ap-southeast-5": 1.36655, + "ap-southeast-7": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 1.4532, + "eu-west-1": 1.4784, + "eu-west-2": 0.0, + "il-central-1": 1.4112, + "mx-central-1": 1.27008, + "us-east-1": 0.0, + "us-east-2": 1.33056, + "us-gov-west-1": 1.4536, + "us-west-2": 1.33056 + }, + "r6id.8xlarge": { + "ap-northeast-1": 2.9232, + "ap-northeast-2": 2.9072, + "ap-south-1": 0.0, + "ap-southeast-1": 2.9232, + "ap-southeast-2": 0.0, + "ap-southeast-5": 2.7331, + "ap-southeast-7": 2.48464, + "ca-west-1": 2.6544, + "eu-central-1": 2.9064, + "eu-west-1": 2.688, + "eu-west-2": 2.8392, + "il-central-1": 2.8224, + "mx-central-1": 0.0, + "us-east-1": 2.66112, + "us-east-2": 2.4192, + "us-gov-west-1": 2.9072, + "us-west-2": 2.4192 + }, + "r6id.12xlarge": { + "ap-northeast-1": 4.82328, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 4.3848, + "ap-southeast-2": 4.176, + "ap-southeast-5": 0.0, + "ap-southeast-7": 3.72696, + "ca-west-1": 3.9816, + "eu-central-1": 4.3596, + "eu-west-1": 4.032, + "eu-west-2": 4.68468, + "il-central-1": 4.2336, + "mx-central-1": 4.19126, + "us-east-1": 3.99168, + "us-east-2": 3.6288, + "us-gov-west-1": 4.3608, + "us-west-2": 3.6288 + }, + "r6id.16xlarge": { + "ap-northeast-1": 5.8464, + "ap-northeast-2": 5.8144, + "ap-south-1": 0.0, + "ap-southeast-1": 5.8464, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 4.96928, + "ca-west-1": 5.83968, + "eu-central-1": 0.0, + "eu-west-1": 5.376, + "eu-west-2": 5.6784, + "il-central-1": 5.6448, + "mx-central-1": 5.08032, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 5.8144, + "us-west-2": 4.8384 + }, + "r6id.24xlarge": { + "ap-northeast-1": 9.64656, + "ap-northeast-2": 9.59376, + "ap-south-1": 7.6128, + "ap-southeast-1": 8.7696, + "ap-southeast-2": 8.352, + "ap-southeast-5": 0.0, + "ap-southeast-7": 7.45392, + "ca-west-1": 7.9632, + "eu-central-1": 9.59112, + "eu-west-1": 8.064, + "eu-west-2": 8.5176, + "il-central-1": 0.0, + "mx-central-1": 0.0, + "us-east-1": 7.98336, + "us-east-2": 7.2576, + "us-gov-west-1": 9.59376, + "us-west-2": 0.0 + }, + "r6id.32xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 11.6288, + "ap-south-1": 10.1504, + "ap-southeast-1": 11.6928, + "ap-southeast-2": 11.136, + "ap-southeast-5": 9.93856, + "ap-southeast-7": 9.93856, + "ca-west-1": 10.6176, + "eu-central-1": 11.6256, + "eu-west-1": 0.0, + "eu-west-2": 11.3568, + "il-central-1": 11.2896, + "mx-central-1": 10.16064, + "us-east-1": 9.6768, + "us-east-2": 9.6768, + "us-gov-west-1": 11.6288, + "us-west-2": 0.0 + }, + "r6idn": { + "eu-central-1": 16.391 + }, + "r6idn.large": { + "ap-northeast-1": 0.23751, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.23868, + "eu-central-1": 0.23283, + "eu-north-1": 0.2278, + "eu-west-1": 0.21762, + "us-east-1": 0.21493, + "us-east-2": 0.19539, + "us-gov-west-1": 0.23517, + "us-west-2": 0.0 + }, + "r6idn.xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.468, + "ap-southeast-2": 0.0, + "eu-central-1": 0.46566, + "eu-north-1": 0.4556, + "eu-west-1": 0.43524, + "us-east-1": 0.39078, + "us-east-2": 0.0, + "us-gov-west-1": 0.51737, + "us-west-2": 0.39078 + }, + "r6idn.metal": { + "ap-northeast-1": 15.20064, + "ap-southeast-1": 14.976, + "ap-southeast-2": 0.0, + "eu-central-1": 14.90112, + "eu-north-1": 13.25376, + "eu-west-1": 13.92768, + "us-east-1": 12.50496, + "us-east-2": 12.50496, + "us-gov-west-1": 15.05088, + "us-west-2": 12.50496 + }, + "r6idn.2xlarge": { + "ap-northeast-1": 0.95004, + "ap-southeast-1": 0.936, + "ap-southeast-2": 1.05019, + "eu-central-1": 0.0, + "eu-north-1": 0.9112, + "eu-west-1": 0.87048, + "us-east-1": 0.78156, + "us-east-2": 0.78156, + "us-gov-west-1": 0.94068, + "us-west-2": 0.78156 + }, + "r6idn.4xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 1.872, + "ap-southeast-2": 2.10038, + "eu-central-1": 1.86264, + "eu-north-1": 1.82239, + "eu-west-1": 1.91506, + "us-east-1": 1.56312, + "us-east-2": 1.56312, + "us-gov-west-1": 2.0695, + "us-west-2": 0.0 + }, + "r6idn.8xlarge": { + "ap-northeast-1": 4.18018, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.20077, + "eu-central-1": 3.72528, + "eu-north-1": 0.0, + "eu-west-1": 3.48192, + "us-east-1": 3.43886, + "us-east-2": 0.0, + "us-gov-west-1": 3.76272, + "us-west-2": 0.0 + }, + "r6idn.12xlarge": { + "ap-northeast-1": 5.70024, + "ap-southeast-1": 6.1776, + "ap-southeast-2": 6.30115, + "eu-central-1": 6.14671, + "eu-north-1": 0.0, + "eu-west-1": 5.22288, + "us-east-1": 4.68936, + "us-east-2": 4.68936, + "us-gov-west-1": 5.64408, + "us-west-2": 0.0 + }, + "r6idn.16xlarge": { + "ap-northeast-1": 7.60032, + "ap-southeast-1": 7.488, + "ap-southeast-2": 8.40154, + "eu-central-1": 7.45056, + "eu-north-1": 6.62688, + "eu-west-1": 6.96384, + "us-east-1": 6.25248, + "us-east-2": 6.25248, + "us-gov-west-1": 0.0, + "us-west-2": 6.87773 + }, + "r6idn.24xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 11.232, + "ap-southeast-2": 12.6023, + "eu-central-1": 11.17584, + "eu-north-1": 9.94032, + "eu-west-1": 10.44576, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 11.28816, + "us-west-2": 9.37872 + }, + "r6idn.32xlarge": { + "ap-northeast-1": 15.20064, + "ap-southeast-1": 14.976, + "ap-southeast-2": 15.27552, + "eu-central-1": 14.90112, + "eu-north-1": 13.25376, + "eu-west-1": 13.92768, + "us-east-1": 12.50496, + "us-east-2": 0.0, + "us-gov-west-1": 15.05088, + "us-west-2": 12.50496 + }, + "r6in": { + "ap-southeast-1": 14.662, + "eu-west-1": 13.755 + }, + "r6in.large": { + "ap-northeast-1": 0.21177, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.23295, + "eu-central-1": 0.20826, + "eu-north-1": 0.20463, + "eu-west-1": 0.19539, + "us-east-1": 0.17433, + "us-east-2": 0.17433, + "us-gov-west-1": 0.20943, + "us-west-2": 0.19176 + }, + "r6in.xlarge": { + "ap-northeast-1": 0.42354, + "ap-southeast-1": 0.41652, + "ap-southeast-2": 0.42354, + "eu-central-1": 0.41652, + "eu-north-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.34866, + "us-east-2": 0.0, + "us-gov-west-1": 0.46075, + "us-west-2": 0.34866 + }, + "r6in.metal": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 13.32864, + "ap-southeast-2": 0.0, + "eu-central-1": 13.32864, + "eu-north-1": 11.90592, + "eu-west-1": 12.50496, + "us-east-1": 11.15712, + "us-east-2": 11.15712, + "us-gov-west-1": 13.40352, + "us-west-2": 11.15712 + }, + "r6in.2xlarge": { + "ap-northeast-1": 0.93179, + "ap-southeast-1": 0.91634, + "ap-southeast-2": 0.93179, + "eu-central-1": 0.83304, + "eu-north-1": 0.74412, + "eu-west-1": 0.85972, + "us-east-1": 0.76705, + "us-east-2": 0.0, + "us-gov-west-1": 0.83772, + "us-west-2": 0.76705 + }, + "r6in.4xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 1.66608, + "ap-southeast-2": 1.69416, + "eu-central-1": 1.66608, + "eu-north-1": 1.48824, + "eu-west-1": 1.56312, + "us-east-1": 1.39464, + "us-east-2": 1.39464, + "us-gov-west-1": 1.67544, + "us-west-2": 1.39464 + }, + "r6in.8xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 3.33216, + "ap-southeast-2": 3.38832, + "eu-central-1": 3.33216, + "eu-north-1": 2.97648, + "eu-west-1": 3.12624, + "us-east-1": 3.06821, + "us-east-2": 2.78928, + "us-gov-west-1": 3.68597, + "us-west-2": 0.0 + }, + "r6in.12xlarge": { + "ap-northeast-1": 5.08248, + "ap-southeast-1": 5.49806, + "ap-southeast-2": 5.08248, + "eu-central-1": 4.99824, + "eu-north-1": 4.46472, + "eu-west-1": 0.0, + "us-east-1": 4.18392, + "us-east-2": 4.18392, + "us-gov-west-1": 5.02632, + "us-west-2": 0.0 + }, + "r6in.16xlarge": { + "ap-northeast-1": 6.77664, + "ap-southeast-1": 6.66432, + "ap-southeast-2": 6.77664, + "eu-central-1": 6.66432, + "eu-north-1": 5.95296, + "eu-west-1": 6.25248, + "us-east-1": 5.57856, + "us-east-2": 5.57856, + "us-gov-west-1": 6.70176, + "us-west-2": 6.13642 + }, + "r6in.24xlarge": { + "ap-northeast-1": 10.16496, + "ap-southeast-1": 0.0, + "ap-southeast-2": 10.16496, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 8.36784, + "us-east-2": 9.20462, + "us-gov-west-1": 10.05264, + "us-west-2": 8.36784 + }, + "r6in.32xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 13.32864, + "ap-southeast-2": 13.55328, + "eu-central-1": 13.32864, + "eu-north-1": 11.90592, + "eu-west-1": 12.50496, + "us-east-1": 11.15712, + "us-east-2": 11.15712, + "us-gov-west-1": 13.40352, + "us-west-2": 11.15712 + }, + "r7a.medium": { + "ap-northeast-1": 0.09177, + "eu-central-1": 0.10095, + "eu-north-1": 0.0809, + "eu-south-2": 0.08513, + "eu-west-1": 0.08513, + "us-east-1": 0.0, + "us-east-2": 0.07608, + "us-west-2": 0.0 + }, + "r7a.large": { + "ap-northeast-1": 0.18354, + "eu-central-1": 0.18354, + "eu-north-1": 0.1618, + "eu-south-2": 0.18729, + "eu-west-1": 0.17026, + "us-east-1": 0.15215, + "us-east-2": 0.15215, + "us-west-2": 0.16737 + }, + "r7a.xlarge": { + "ap-northeast-1": 0.36708, + "eu-central-1": 0.0, + "eu-north-1": 0.3236, + "eu-south-2": 0.0, + "eu-west-1": 0.34052, + "us-east-1": 0.33473, + "us-east-2": 0.3043, + "us-west-2": 0.3043 + }, + "r7a.metal-48xl": { + "ap-northeast-1": 0.0, + "eu-central-1": 17.61984, + "eu-north-1": 15.5328, + "eu-south-2": 16.34496, + "eu-west-1": 16.34496, + "us-east-1": 14.6064, + "us-east-2": 14.6064, + "us-west-2": 14.6064 + }, + "r7a.2xlarge": { + "ap-northeast-1": 0.73416, + "eu-central-1": 0.73416, + "eu-north-1": 0.71192, + "eu-south-2": 0.68104, + "eu-west-1": 0.68104, + "us-east-1": 0.66946, + "us-east-2": 0.6086, + "us-west-2": 0.66946 + }, + "r7a.4xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 1.46832, + "eu-north-1": 1.2944, + "eu-south-2": 1.36208, + "eu-west-1": 0.0, + "us-east-1": 1.2172, + "us-east-2": 1.2172, + "us-west-2": 1.33892 + }, + "r7a.8xlarge": { + "ap-northeast-1": 2.93664, + "eu-central-1": 0.0, + "eu-north-1": 2.5888, + "eu-south-2": 2.99658, + "eu-west-1": 2.72416, + "us-east-1": 2.4344, + "us-east-2": 2.67784, + "us-west-2": 0.0 + }, + "r7a.12xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 4.84546, + "eu-north-1": 3.8832, + "eu-south-2": 4.08624, + "eu-west-1": 4.08624, + "us-east-1": 4.01676, + "us-east-2": 3.6516, + "us-west-2": 3.6516 + }, + "r7a.16xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 5.87328, + "eu-north-1": 5.1776, + "eu-south-2": 5.44832, + "eu-west-1": 5.44832, + "us-east-1": 0.0, + "us-east-2": 4.8688, + "us-west-2": 4.8688 + }, + "r7a.24xlarge": { + "ap-northeast-1": 8.80992, + "eu-central-1": 8.80992, + "eu-north-1": 7.7664, + "eu-south-2": 8.17248, + "eu-west-1": 8.17248, + "us-east-1": 7.3032, + "us-east-2": 0.0, + "us-west-2": 8.03352 + }, + "r7a.32xlarge": { + "ap-northeast-1": 11.74656, + "eu-central-1": 12.92122, + "eu-north-1": 11.39072, + "eu-south-2": 11.9863, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 9.7376, + "us-west-2": 9.7376 + }, + "r7a.48xlarge": { + "ap-northeast-1": 17.61984, + "eu-central-1": 17.61984, + "eu-north-1": 15.5328, + "eu-south-2": 16.34496, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 14.6064, + "us-west-2": 14.6064 + }, + "r7g.medium": { + "ap-east-1": 0.071, + "ap-northeast-1": 0.0687, + "ap-northeast-2": 0.0646, + "ap-south-1": 0.0399, + "ap-south-2": 0.0399, + "ap-southeast-1": 0.0687, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0549, + "ap-southeast-7": 0.0549, + "ca-central-1": 0.0587, + "eu-central-1": 0.0646, + "eu-north-1": 0.0604, + "eu-south-1": 0.0628, + "eu-south-2": 0.0637, + "eu-west-1": 0.0637, + "eu-west-2": 0.0669, + "me-south-1": 0.0659, + "mx-central-1": 0.0, + "sa-east-1": 0.0852, + "us-east-1": 0.0, + "us-east-2": 0.0536, + "us-west-1": 0.0632, + "us-west-2": 0.0536 + }, + "r7g.large": { + "ap-east-1": 0.142, + "ap-northeast-1": 0.1292, + "ap-northeast-2": 0.1292, + "ap-south-1": 0.0751, + "ap-south-2": 0.0751, + "ap-southeast-1": 0.1373, + "ap-southeast-2": 0.1364, + "ap-southeast-5": 0.1098, + "ap-southeast-7": 0.1167, + "ca-central-1": 0.1173, + "eu-central-1": 0.1292, + "eu-north-1": 0.1139, + "eu-south-1": 0.1334, + "eu-south-2": 0.0, + "eu-west-1": 0.1199, + "eu-west-2": 0.1337, + "me-south-1": 0.1318, + "mx-central-1": 0.1125, + "sa-east-1": 0.1704, + "us-east-1": 0.1071, + "us-east-2": 0.1071, + "us-west-1": 0.0, + "us-west-2": 0.1071 + }, + "r7g.xlarge": { + "ap-east-1": 0.284, + "ap-northeast-1": 0.2584, + "ap-northeast-2": 0.2746, + "ap-south-1": 0.1502, + "ap-south-2": 0.1596, + "ap-southeast-1": 0.2584, + "ap-southeast-2": 0.2729, + "ap-southeast-5": 0.2196, + "ap-southeast-7": 0.2335, + "ca-central-1": 0.2346, + "eu-central-1": 0.2584, + "eu-north-1": 0.2278, + "eu-south-1": 0.251, + "eu-south-2": 0.0, + "eu-west-1": 0.2548, + "eu-west-2": 0.2516, + "me-south-1": 0.2637, + "mx-central-1": 0.2249, + "sa-east-1": 0.3409, + "us-east-1": 0.2142, + "us-east-2": 0.2277, + "us-west-1": 0.238, + "us-west-2": 0.2142 + }, + "r7g.metal": { + "ap-east-1": 4.544, + "ap-northeast-1": 4.1344, + "ap-northeast-2": 4.1344, + "ap-south-1": 2.4026, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.1075, + "ap-southeast-5": 3.5142, + "ap-southeast-7": 3.5142, + "ca-central-1": 3.7536, + "eu-central-1": 0.0, + "eu-north-1": 3.6448, + "eu-south-1": 4.0161, + "eu-south-2": 3.8336, + "eu-west-1": 3.8352, + "eu-west-2": 4.0256, + "me-south-1": 4.2187, + "mx-central-1": 0.0, + "sa-east-1": 5.4541, + "us-east-1": 0.0, + "us-east-2": 3.4272, + "us-west-1": 3.808, + "us-west-2": 3.4272 + }, + "r7g.2xlarge": { + "ap-east-1": 0.568, + "ap-northeast-1": 0.5168, + "ap-northeast-2": 0.5168, + "ap-south-1": 0.0, + "ap-south-2": 0.3003, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.4393, + "ap-southeast-7": 0.4393, + "ca-central-1": 0.4988, + "eu-central-1": 0.5494, + "eu-north-1": 0.4829, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.4794, + "eu-west-2": 0.535, + "me-south-1": 0.5273, + "mx-central-1": 0.0, + "sa-east-1": 0.6818, + "us-east-1": 0.4284, + "us-east-2": 0.4284, + "us-west-1": 0.476, + "us-west-2": 0.4284 + }, + "r7g.4xlarge": { + "ap-east-1": 1.136, + "ap-northeast-1": 1.0336, + "ap-northeast-2": 1.0336, + "ap-south-1": 0.0, + "ap-south-2": 0.6006, + "ap-southeast-1": 1.0336, + "ap-southeast-2": 1.0269, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 1.0336, + "eu-north-1": 0.9112, + "eu-south-1": 1.004, + "eu-south-2": 0.9584, + "eu-west-1": 0.9588, + "eu-west-2": 1.0064, + "me-south-1": 1.0547, + "mx-central-1": 0.9564, + "sa-east-1": 0.0, + "us-east-1": 0.8568, + "us-east-2": 0.0, + "us-west-1": 0.952, + "us-west-2": 0.8568 + }, + "r7g.8xlarge": { + "ap-east-1": 2.272, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.0672, + "ap-south-1": 1.2013, + "ap-south-2": 0.0, + "ap-southeast-1": 2.0672, + "ap-southeast-2": 2.0538, + "ap-southeast-5": 1.7571, + "ap-southeast-7": 1.7571, + "ca-central-1": 1.9953, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 2.0081, + "eu-south-2": 1.9168, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "me-south-1": 0.0, + "mx-central-1": 1.7994, + "sa-east-1": 0.0, + "us-east-1": 1.7136, + "us-east-2": 1.7136, + "us-west-1": 1.904, + "us-west-2": 0.0 + }, + "r7g.12xlarge": { + "ap-east-1": 3.408, + "ap-northeast-1": 3.2962, + "ap-northeast-2": 3.1008, + "ap-south-1": 1.8019, + "ap-south-2": 0.0, + "ap-southeast-1": 3.1008, + "ap-southeast-2": 3.0806, + "ap-southeast-5": 2.6357, + "ap-southeast-7": 2.8017, + "ca-central-1": 2.8152, + "eu-central-1": 3.1008, + "eu-north-1": 2.7336, + "eu-south-1": 3.0121, + "eu-south-2": 2.8752, + "eu-west-1": 3.0576, + "eu-west-2": 3.2098, + "me-south-1": 3.3633, + "mx-central-1": 2.8691, + "sa-east-1": 4.0906, + "us-east-1": 0.0, + "us-east-2": 2.5704, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "r7g.16xlarge": { + "ap-east-1": 4.544, + "ap-northeast-1": 4.1344, + "ap-northeast-2": 4.1344, + "ap-south-1": 2.4026, + "ap-south-2": 0.0, + "ap-southeast-1": 4.1344, + "ap-southeast-2": 4.1075, + "ap-southeast-5": 3.5142, + "ap-southeast-7": 3.5142, + "ca-central-1": 3.7536, + "eu-central-1": 4.1344, + "eu-north-1": 3.6448, + "eu-south-1": 0.0, + "eu-south-2": 3.8336, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "me-south-1": 4.2187, + "mx-central-1": 3.5987, + "sa-east-1": 5.4541, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 3.808, + "us-west-2": 3.4272 + }, + "r7gd": { + "ap-southeast-3": 17.363, + "ap-southeast-7": 14.759, + "eu-west-1": 15.967, + "us-gov-west-1": 17.27 + }, + "r7gd.medium": { + "ap-east-1": 0.0827, + "ap-northeast-1": 0.0, + "ap-south-1": 0.044, + "ap-southeast-1": 0.0822, + "ap-southeast-2": 0.0783, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.0741, + "ap-southeast-7": 0.0, + "eu-central-1": 0.0817, + "eu-north-1": 0.0761, + "eu-south-2": 0.0756, + "eu-west-1": 0.0756, + "me-central-1": 0.0832, + "mx-central-1": 0.0714, + "us-east-1": 0.068, + "us-east-2": 0.0721, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0765, + "us-west-2": 0.0 + }, + "r7gd.large": { + "ap-east-1": 0.1654, + "ap-northeast-1": 0.1743, + "ap-south-1": 0.0933, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1566, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.1398, + "ap-southeast-7": 0.1398, + "eu-central-1": 0.1635, + "eu-north-1": 0.0, + "eu-south-2": 0.1512, + "eu-west-1": 0.1603, + "me-central-1": 0.1663, + "mx-central-1": 0.1429, + "us-east-1": 0.1361, + "us-east-2": 0.1361, + "us-gov-east-1": 0.1733, + "us-gov-west-1": 0.1734, + "us-west-1": 0.1531, + "us-west-2": 0.1361 + }, + "r7gd.xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-south-1": 0.176, + "ap-southeast-1": 0.3289, + "ap-southeast-2": 0.3132, + "ap-southeast-3": 0.3288, + "ap-southeast-5": 0.2795, + "ap-southeast-7": 0.2795, + "eu-central-1": 0.3466, + "eu-north-1": 0.0, + "eu-south-2": 0.3024, + "eu-west-1": 0.3205, + "me-central-1": 0.3526, + "mx-central-1": 0.2858, + "us-east-1": 0.2722, + "us-east-2": 0.2722, + "us-gov-east-1": 0.327, + "us-gov-west-1": 0.3271, + "us-west-1": 0.3062, + "us-west-2": 0.0 + }, + "r7gd.metal": { + "ap-east-1": 5.2922, + "ap-northeast-1": 5.2618, + "ap-south-1": 2.816, + "ap-southeast-1": 5.2618, + "ap-southeast-2": 5.0112, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "eu-central-1": 5.2315, + "eu-north-1": 0.0, + "eu-south-2": 4.8384, + "eu-west-1": 0.0, + "me-central-1": 5.3222, + "mx-central-1": 4.5722, + "us-east-1": 0.0, + "us-east-2": 4.3546, + "us-gov-east-1": 5.2314, + "us-gov-west-1": 0.0, + "us-west-1": 4.8989, + "us-west-2": 4.3546 + }, + "r7gd.2xlarge": { + "ap-east-1": 0.7012, + "ap-northeast-1": 0.6577, + "ap-south-1": 0.3731, + "ap-southeast-1": 0.6577, + "ap-southeast-2": 0.664, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.559, + "ap-southeast-7": 0.559, + "eu-central-1": 0.6932, + "eu-north-1": 0.5746, + "eu-south-2": 0.6048, + "eu-west-1": 0.6048, + "me-central-1": 0.7052, + "mx-central-1": 0.0, + "us-east-1": 0.5443, + "us-east-2": 0.0, + "us-gov-east-1": 0.6539, + "us-gov-west-1": 0.6542, + "us-west-1": 0.6124, + "us-west-2": 0.0 + }, + "r7gd.4xlarge": { + "ap-east-1": 1.4024, + "ap-northeast-1": 1.3154, + "ap-south-1": 0.704, + "ap-southeast-1": 1.3154, + "ap-southeast-2": 1.2528, + "ap-southeast-3": 1.3154, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "eu-central-1": 1.3079, + "eu-north-1": 1.2181, + "eu-south-2": 1.2096, + "eu-west-1": 1.2096, + "me-central-1": 1.3306, + "mx-central-1": 1.143, + "us-east-1": 1.1538, + "us-east-2": 1.0886, + "us-gov-east-1": 1.3078, + "us-gov-west-1": 1.3083, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "r7gd.8xlarge": { + "ap-east-1": 2.6461, + "ap-northeast-1": 2.6309, + "ap-south-1": 1.408, + "ap-southeast-1": 2.6309, + "ap-southeast-2": 0.0, + "ap-southeast-3": 2.6307, + "ap-southeast-5": 2.2362, + "ap-southeast-7": 2.2362, + "eu-central-1": 2.6158, + "eu-north-1": 0.0, + "eu-south-2": 2.5644, + "eu-west-1": 2.5644, + "me-central-1": 2.6611, + "mx-central-1": 2.4229, + "us-east-1": 0.0, + "us-east-2": 2.1773, + "us-gov-east-1": 2.6157, + "us-gov-west-1": 2.6166, + "us-west-1": 2.4494, + "us-west-2": 2.1773 + }, + "r7gd.12xlarge": { + "ap-east-1": 3.9691, + "ap-northeast-1": 3.9463, + "ap-south-1": 2.112, + "ap-southeast-1": 3.9463, + "ap-southeast-2": 3.7584, + "ap-southeast-3": 3.9461, + "ap-southeast-5": 3.5555, + "ap-southeast-7": 3.3542, + "eu-central-1": 0.0, + "eu-north-1": 3.6542, + "eu-south-2": 3.6288, + "eu-west-1": 3.6288, + "me-central-1": 4.2312, + "mx-central-1": 3.6344, + "us-east-1": 3.2659, + "us-east-2": 3.2659, + "us-gov-east-1": 3.9235, + "us-gov-west-1": 0.0, + "us-west-1": 3.8946, + "us-west-2": 3.2659 + }, + "r7gd.16xlarge": { + "ap-east-1": 5.2922, + "ap-northeast-1": 5.2618, + "ap-south-1": 2.816, + "ap-southeast-1": 5.2618, + "ap-southeast-2": 5.0112, + "ap-southeast-3": 5.2614, + "ap-southeast-5": 4.4723, + "ap-southeast-7": 0.0, + "eu-central-1": 5.2315, + "eu-north-1": 4.5965, + "eu-south-2": 4.8384, + "eu-west-1": 4.8384, + "me-central-1": 5.3222, + "mx-central-1": 4.5722, + "us-east-1": 4.3546, + "us-east-2": 4.3546, + "us-gov-east-1": 5.2314, + "us-gov-west-1": 5.2333, + "us-west-1": 4.8989, + "us-west-2": 4.3546 + }, + "r7i.large": { + "ap-northeast-1": 0.1596, + "ap-northeast-2": 0.1596, + "ap-south-1": 0.1365, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.15855, + "ap-southeast-3": 0.1596, + "ap-southeast-5": 0.13566, + "ap-southeast-7": 0.13566, + "ca-central-1": 0.1449, + "eu-central-1": 0.0, + "eu-north-1": 0.1407, + "eu-south-1": 0.1554, + "eu-south-2": 0.16286, + "eu-west-1": 0.14805, + "eu-west-2": 0.1554, + "eu-west-3": 0.17094, + "mx-central-1": 0.13892, + "sa-east-1": 0.23216, + "us-east-1": 0.14553, + "us-east-2": 0.1323, + "us-gov-east-1": 0.17441, + "us-gov-west-1": 0.0, + "us-west-1": 0.1617, + "us-west-2": 0.1323 + }, + "r7i.xlarge": { + "ap-northeast-1": 0.3192, + "ap-northeast-2": 0.0, + "ap-south-1": 0.273, + "ap-southeast-1": 0.3192, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.3192, + "ap-southeast-5": 0.27132, + "ap-southeast-7": 0.27132, + "ca-central-1": 0.2898, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.3108, + "eu-south-2": 0.0, + "eu-west-1": 0.2961, + "eu-west-2": 0.3108, + "eu-west-3": 0.34188, + "mx-central-1": 0.27784, + "sa-east-1": 0.46431, + "us-east-1": 0.2646, + "us-east-2": 0.2646, + "us-gov-east-1": 0.3171, + "us-gov-west-1": 0.3171, + "us-west-1": 0.0, + "us-west-2": 0.29106 + }, + "r7i.metal-24xl": { + "ap-northeast-1": 7.6608, + "ap-northeast-2": 0.0, + "ap-south-1": 6.552, + "ap-southeast-1": 8.42688, + "ap-southeast-2": 7.6104, + "ap-southeast-3": 7.6608, + "ap-southeast-5": 6.51168, + "ap-southeast-7": 6.51168, + "ca-central-1": 6.9552, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 7.4592, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 8.20512, + "eu-west-3": 7.4592, + "mx-central-1": 7.33498, + "sa-east-1": 10.1304, + "us-east-1": 6.3504, + "us-east-2": 6.98544, + "us-gov-east-1": 7.6104, + "us-gov-west-1": 8.37144, + "us-west-1": 0.0, + "us-west-2": 6.3504 + }, + "r7i.metal-48xl": { + "ap-northeast-1": 15.3216, + "ap-northeast-2": 15.3216, + "ap-south-1": 13.104, + "ap-southeast-1": 15.3216, + "ap-southeast-2": 15.2208, + "ap-southeast-3": 15.3216, + "ap-southeast-5": 13.02336, + "ap-southeast-7": 13.02336, + "ca-central-1": 0.0, + "eu-central-1": 15.3216, + "eu-north-1": 13.5072, + "eu-south-1": 14.9184, + "eu-south-2": 0.0, + "eu-west-1": 14.2128, + "eu-west-2": 14.9184, + "eu-west-3": 14.9184, + "mx-central-1": 0.0, + "sa-east-1": 20.2608, + "us-east-1": 12.7008, + "us-east-2": 12.7008, + "us-gov-east-1": 15.2208, + "us-gov-west-1": 15.2208, + "us-west-1": 0.0, + "us-west-2": 12.7008 + }, + "r7i.2xlarge": { + "ap-northeast-1": 0.70224, + "ap-northeast-2": 0.70224, + "ap-south-1": 0.546, + "ap-southeast-1": 0.70224, + "ap-southeast-2": 0.6342, + "ap-southeast-3": 0.6384, + "ap-southeast-5": 0.5969, + "ap-southeast-7": 0.54264, + "ca-central-1": 0.5796, + "eu-central-1": 0.6384, + "eu-north-1": 0.61908, + "eu-south-1": 0.6216, + "eu-south-2": 0.5922, + "eu-west-1": 0.0, + "eu-west-2": 0.68376, + "eu-west-3": 0.6216, + "mx-central-1": 0.55568, + "sa-east-1": 0.8442, + "us-east-1": 0.5292, + "us-east-2": 0.58212, + "us-gov-east-1": 0.6342, + "us-gov-west-1": 0.6342, + "us-west-1": 0.588, + "us-west-2": 0.58212 + }, + "r7i.4xlarge": { + "ap-northeast-1": 1.2768, + "ap-northeast-2": 0.0, + "ap-south-1": 1.092, + "ap-southeast-1": 1.40448, + "ap-southeast-2": 1.2684, + "ap-southeast-3": 1.2768, + "ap-southeast-5": 1.08528, + "ap-southeast-7": 1.08528, + "ca-central-1": 0.0, + "eu-central-1": 1.2768, + "eu-north-1": 1.1256, + "eu-south-1": 1.2432, + "eu-south-2": 0.0, + "eu-west-1": 1.1844, + "eu-west-2": 1.2432, + "eu-west-3": 1.36752, + "mx-central-1": 1.11136, + "sa-east-1": 1.85724, + "us-east-1": 1.0584, + "us-east-2": 1.0584, + "us-gov-east-1": 1.2684, + "us-gov-west-1": 1.2684, + "us-west-1": 1.176, + "us-west-2": 1.0584 + }, + "r7i.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.5536, + "ap-south-1": 2.184, + "ap-southeast-1": 2.80896, + "ap-southeast-2": 2.79048, + "ap-southeast-3": 0.0, + "ap-southeast-5": 2.17056, + "ap-southeast-7": 0.0, + "ca-central-1": 2.3184, + "eu-central-1": 2.5536, + "eu-north-1": 2.2512, + "eu-south-1": 0.0, + "eu-south-2": 2.60568, + "eu-west-1": 2.60568, + "eu-west-2": 2.73504, + "eu-west-3": 2.4864, + "mx-central-1": 2.22272, + "sa-east-1": 0.0, + "us-east-1": 2.32848, + "us-east-2": 2.1168, + "us-gov-east-1": 2.79048, + "us-gov-west-1": 2.79048, + "us-west-1": 2.352, + "us-west-2": 0.0 + }, + "r7i.12xlarge": { + "ap-northeast-1": 3.8304, + "ap-northeast-2": 3.8304, + "ap-south-1": 0.0, + "ap-southeast-1": 3.8304, + "ap-southeast-2": 4.18572, + "ap-southeast-3": 3.8304, + "ap-southeast-5": 3.25584, + "ap-southeast-7": 3.25584, + "ca-central-1": 0.0, + "eu-central-1": 4.21344, + "eu-north-1": 3.3768, + "eu-south-1": 4.10256, + "eu-south-2": 3.5532, + "eu-west-1": 3.90852, + "eu-west-2": 3.7296, + "eu-west-3": 0.0, + "mx-central-1": 3.33408, + "sa-east-1": 5.0652, + "us-east-1": 3.1752, + "us-east-2": 0.0, + "us-gov-east-1": 3.8052, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 3.1752 + }, + "r7i.16xlarge": { + "ap-northeast-1": 5.1072, + "ap-northeast-2": 5.1072, + "ap-south-1": 4.368, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.58096, + "ap-southeast-3": 5.1072, + "ap-southeast-5": 4.34112, + "ap-southeast-7": 4.34112, + "ca-central-1": 4.6368, + "eu-central-1": 5.61792, + "eu-north-1": 0.0, + "eu-south-1": 5.47008, + "eu-south-2": 4.7376, + "eu-west-1": 5.21136, + "eu-west-2": 5.47008, + "eu-west-3": 5.47008, + "mx-central-1": 4.44544, + "sa-east-1": 6.7536, + "us-east-1": 4.65696, + "us-east-2": 4.2336, + "us-gov-east-1": 5.58096, + "us-gov-west-1": 5.0736, + "us-west-1": 5.1744, + "us-west-2": 4.2336 + }, + "r7i.24xlarge": { + "ap-northeast-1": 8.42688, + "ap-northeast-2": 8.42688, + "ap-south-1": 6.552, + "ap-southeast-1": 8.42688, + "ap-southeast-2": 8.37144, + "ap-southeast-3": 7.6608, + "ap-southeast-5": 7.16285, + "ap-southeast-7": 0.0, + "ca-central-1": 6.9552, + "eu-central-1": 7.6608, + "eu-north-1": 6.7536, + "eu-south-1": 7.4592, + "eu-south-2": 7.1064, + "eu-west-1": 7.81704, + "eu-west-2": 8.20512, + "eu-west-3": 7.4592, + "mx-central-1": 6.66816, + "sa-east-1": 10.1304, + "us-east-1": 6.98544, + "us-east-2": 6.98544, + "us-gov-east-1": 0.0, + "us-gov-west-1": 8.37144, + "us-west-1": 7.056, + "us-west-2": 6.98544 + }, + "r7i.48xlarge": { + "ap-northeast-1": 15.3216, + "ap-northeast-2": 15.3216, + "ap-south-1": 13.104, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 15.3216, + "ap-southeast-5": 13.02336, + "ap-southeast-7": 13.02336, + "ca-central-1": 13.9104, + "eu-central-1": 15.3216, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 14.2128, + "eu-west-1": 0.0, + "eu-west-2": 14.9184, + "eu-west-3": 14.9184, + "mx-central-1": 13.33632, + "sa-east-1": 20.2608, + "us-east-1": 0.0, + "us-east-2": 12.7008, + "us-gov-east-1": 15.2208, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 12.7008 + }, + "r7iz": { + "ap-northeast-1": 15.981, + "eu-central-1": 15.84, + "eu-west-1": 14.643, + "us-east-1": 13.094, + "us-east-2": 13.094 + }, + "r7iz.large": { + "ap-northeast-1": 0.227, + "eu-central-1": 0.225, + "eu-west-1": 0.208, + "us-east-1": 0.2046, + "us-east-2": 0.186, + "us-west-2": 0.186 + }, + "r7iz.xlarge": { + "ap-northeast-1": 0.4994, + "eu-central-1": 0.0, + "eu-west-1": 0.416, + "us-east-1": 0.372, + "us-east-2": 0.372, + "us-west-2": 0.372 + }, + "r7iz.metal-16xl": { + "ap-northeast-1": 0.0, + "eu-central-1": 7.92, + "eu-west-1": 0.0, + "us-east-1": 5.952, + "us-east-2": 5.952, + "us-west-2": 5.952 + }, + "r7iz.metal-32xl": { + "ap-northeast-1": 14.528, + "eu-central-1": 14.4, + "eu-west-1": 13.312, + "us-east-1": 0.0, + "us-east-2": 11.904, + "us-west-2": 11.904 + }, + "r7iz.2xlarge": { + "ap-northeast-1": 0.9988, + "eu-central-1": 0.9, + "eu-west-1": 0.832, + "us-east-1": 0.8184, + "us-east-2": 0.8184, + "us-west-2": 0.744 + }, + "r7iz.4xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 1.98, + "eu-west-1": 1.664, + "us-east-1": 1.488, + "us-east-2": 1.488, + "us-west-2": 1.488 + }, + "r7iz.8xlarge": { + "ap-northeast-1": 3.9952, + "eu-central-1": 3.6, + "eu-west-1": 3.328, + "us-east-1": 3.2736, + "us-east-2": 2.976, + "us-west-2": 3.2736 + }, + "r7iz.12xlarge": { + "ap-northeast-1": 5.448, + "eu-central-1": 5.4, + "eu-west-1": 0.0, + "us-east-1": 4.464, + "us-east-2": 4.464, + "us-west-2": 4.464 + }, + "r7iz.16xlarge": { + "ap-northeast-1": 7.9904, + "eu-central-1": 7.2, + "eu-west-1": 6.656, + "us-east-1": 5.952, + "us-east-2": 6.5472, + "us-west-2": 6.5472 + }, + "r7iz.32xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 14.4, + "eu-west-1": 14.6432, + "us-east-1": 13.0944, + "us-east-2": 13.0944, + "us-west-2": 11.904 + }, + "r8g.medium": { + "ap-northeast-1": 0.07106, + "ap-south-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.06265, + "eu-south-2": 0.07248, + "eu-west-1": 0.06592, + "us-east-1": 0.05891, + "us-east-2": 0.0, + "us-west-2": 0.05891 + }, + "r8g.large": { + "ap-northeast-1": 0.14212, + "ap-south-1": 0.08258, + "ap-southeast-2": 0.1412, + "eu-central-1": 0.14212, + "eu-north-1": 0.12529, + "eu-south-2": 0.13178, + "eu-west-1": 0.13184, + "us-east-1": 0.1296, + "us-east-2": 0.11782, + "us-west-2": 0.0 + }, + "r8g.xlarge": { + "ap-northeast-1": 0.31266, + "ap-south-1": 0.16516, + "ap-southeast-2": 0.0, + "eu-central-1": 0.28424, + "eu-north-1": 0.25058, + "eu-south-2": 0.26356, + "eu-west-1": 0.26368, + "us-east-1": 0.23564, + "us-east-2": 0.0, + "us-west-2": 0.23564 + }, + "r8g.metal-24xl": { + "ap-northeast-1": 6.82176, + "ap-south-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 6.82176, + "eu-north-1": 6.01392, + "eu-south-2": 6.32544, + "eu-west-1": 6.32832, + "us-east-1": 0.0, + "us-east-2": 5.65536, + "us-west-2": 5.65536 + }, + "r8g.metal-48xl": { + "ap-northeast-1": 13.64352, + "ap-south-1": 0.0, + "ap-southeast-2": 13.5552, + "eu-central-1": 13.64352, + "eu-north-1": 12.02784, + "eu-south-2": 12.65088, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 11.31072, + "us-west-2": 11.31072 + }, + "r8g.2xlarge": { + "ap-northeast-1": 0.56848, + "ap-south-1": 0.0, + "ap-southeast-2": 0.5648, + "eu-central-1": 0.56848, + "eu-north-1": 0.50116, + "eu-south-2": 0.52712, + "eu-west-1": 0.5801, + "us-east-1": 0.51841, + "us-east-2": 0.0, + "us-west-2": 0.51841 + }, + "r8g.4xlarge": { + "ap-northeast-1": 1.13696, + "ap-south-1": 0.66064, + "ap-southeast-2": 1.1296, + "eu-central-1": 0.0, + "eu-north-1": 1.00232, + "eu-south-2": 1.05424, + "eu-west-1": 1.05472, + "us-east-1": 0.94256, + "us-east-2": 0.94256, + "us-west-2": 0.94256 + }, + "r8g.8xlarge": { + "ap-northeast-1": 2.27392, + "ap-south-1": 1.32128, + "ap-southeast-2": 2.48512, + "eu-central-1": 0.0, + "eu-north-1": 2.00464, + "eu-south-2": 2.10848, + "eu-west-1": 2.32038, + "us-east-1": 1.88512, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "r8g.12xlarge": { + "ap-northeast-1": 3.41088, + "ap-south-1": 1.98192, + "ap-southeast-2": 3.3888, + "eu-central-1": 3.41088, + "eu-north-1": 3.00696, + "eu-south-2": 0.0, + "eu-west-1": 3.16416, + "us-east-1": 2.82768, + "us-east-2": 2.82768, + "us-west-2": 0.0 + }, + "r8g.16xlarge": { + "ap-northeast-1": 4.54784, + "ap-south-1": 2.90682, + "ap-southeast-2": 4.97024, + "eu-central-1": 0.0, + "eu-north-1": 4.00928, + "eu-south-2": 4.21696, + "eu-west-1": 0.0, + "us-east-1": 3.77024, + "us-east-2": 3.77024, + "us-west-2": 4.14726 + }, + "r8g.24xlarge": { + "ap-northeast-1": 7.50394, + "ap-south-1": 3.96384, + "ap-southeast-2": 7.45536, + "eu-central-1": 6.82176, + "eu-north-1": 6.01392, + "eu-south-2": 6.32544, + "eu-west-1": 6.32832, + "us-east-1": 6.2209, + "us-east-2": 0.0, + "us-west-2": 6.2209 + }, + "r8g.48xlarge": { + "ap-northeast-1": 13.64352, + "ap-south-1": 7.92768, + "ap-southeast-2": 0.0, + "eu-central-1": 13.64352, + "eu-north-1": 12.02784, + "eu-south-2": 12.65088, + "eu-west-1": 12.65664, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "t1.micro": { + "ap-northeast-1": 0.026, + "ap-southeast-1": 0.02, + "ap-southeast-2": 0.02, + "eu-west-1": 0.02, + "sa-east-1": 0.027, + "us-east-1": 0.02, + "us-gov-west-1": 0.024, + "us-west-1": 0.025, + "us-west-2": 0.02 + }, + "t2.micro": { + "ap-northeast-1": 0.0152, + "ap-northeast-2": 0.0144, + "ap-northeast-3": 0.0152, + "ap-south-1": 0.0124, + "ap-southeast-1": 0.0146, + "ap-southeast-2": 0.0146, + "ca-central-1": 0.0128, + "eu-central-1": 0.0134, + "eu-west-1": 0.0126, + "eu-west-2": 0.0132, + "eu-west-3": 0.0132, + "sa-east-1": 0.0186, + "us-east-1": 0.0116, + "us-east-2": 0.0116, + "us-gov-west-1": 0.0136, + "us-west-1": 0.0138, + "us-west-2": 0.0116 + }, + "t2.small": { + "ap-northeast-1": 0.0304, + "ap-northeast-2": 0.0288, + "ap-northeast-3": 0.0304, + "ap-south-1": 0.0248, + "ap-southeast-1": 0.0292, + "ap-southeast-2": 0.0292, + "ca-central-1": 0.0256, + "eu-central-1": 0.0268, + "eu-west-1": 0.025, + "eu-west-2": 0.026, + "eu-west-3": 0.0264, + "sa-east-1": 0.0372, + "us-east-1": 0.023, + "us-east-2": 0.023, + "us-gov-west-1": 0.0272, + "us-west-1": 0.0276, + "us-west-2": 0.023 + }, + "t2.medium": { + "ap-northeast-1": 0.0608, + "ap-northeast-2": 0.0576, + "ap-northeast-3": 0.0608, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0584, + "ap-southeast-2": 0.0584, + "ca-central-1": 0.0512, + "eu-central-1": 0.0536, + "eu-west-1": 0.05, + "eu-west-2": 0.052, + "eu-west-3": 0.0528, + "sa-east-1": 0.0744, + "us-east-1": 0.0464, + "us-east-2": 0.0464, + "us-gov-west-1": 0.0544, + "us-west-1": 0.0552, + "us-west-2": 0.0464 + }, + "t2.large": { + "ap-northeast-1": 0.1216, + "ap-northeast-2": 0.1152, + "ap-northeast-3": 0.1216, + "ap-south-1": 0.0992, + "ap-southeast-1": 0.1168, + "ap-southeast-2": 0.1168, + "ca-central-1": 0.1024, + "eu-central-1": 0.1072, + "eu-west-1": 0.1008, + "eu-west-2": 0.1056, + "eu-west-3": 0.0, + "sa-east-1": 0.1488, + "us-east-1": 0.0928, + "us-east-2": 0.0928, + "us-gov-west-1": 0.1088, + "us-west-1": 0.1104, + "us-west-2": 0.0928 + }, + "t2.xlarge": { + "ap-northeast-1": 0.2432, + "ap-northeast-2": 0.2304, + "ap-northeast-3": 0.2432, + "ap-south-1": 0.1984, + "ap-southeast-1": 0.2336, + "ap-southeast-2": 0.2336, + "ca-central-1": 0.2048, + "eu-central-1": 0.2144, + "eu-west-1": 0.2016, + "eu-west-2": 0.2112, + "eu-west-3": 0.2112, + "sa-east-1": 0.2976, + "us-east-1": 0.1856, + "us-east-2": 0.1856, + "us-gov-west-1": 0.2176, + "us-west-1": 0.2208, + "us-west-2": 0.1856 + }, + "t2.nano": { + "ap-northeast-1": 0.0076, + "ap-northeast-2": 0.0072, + "ap-northeast-3": 0.0076, + "ap-south-1": 0.0062, + "ap-southeast-1": 0.0073, + "ap-southeast-2": 0.0073, + "ca-central-1": 0.0064, + "eu-central-1": 0.0067, + "eu-west-1": 0.0063, + "eu-west-2": 0.0066, + "eu-west-3": 0.0066, + "sa-east-1": 0.0093, + "us-east-1": 0.0058, + "us-east-2": 0.0058, + "us-gov-west-1": 0.0068, + "us-west-1": 0.0069, + "us-west-2": 0.0058 + }, + "t2.2xlarge": { + "ap-northeast-1": 0.4864, + "ap-northeast-2": 0.4608, + "ap-northeast-3": 0.4864, + "ap-south-1": 0.3968, + "ap-southeast-1": 0.4672, + "ap-southeast-2": 0.4672, + "ca-central-1": 0.4096, + "eu-central-1": 0.4288, + "eu-west-1": 0.4032, + "eu-west-2": 0.4224, + "eu-west-3": 0.4224, + "sa-east-1": 0.5952, + "us-east-1": 0.3712, + "us-east-2": 0.3712, + "us-gov-west-1": 0.4352, + "us-west-1": 0.4416, + "us-west-2": 0.3712 + }, + "t3": { + "sa-east-1": 14.193 + }, + "t3.micro": { + "af-south-1": 0.0, + "ap-east-1": 0.0146, + "ap-northeast-1": 0.0145, + "ap-northeast-2": 0.013, + "ap-northeast-3": 0.0136, + "ap-south-1": 0.0119, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0132, + "ap-southeast-2": 0.0132, + "ap-southeast-3": 0.0132, + "ap-southeast-4": 0.014, + "ap-southeast-5": 0.0119, + "ap-southeast-7": 0.0119, + "ca-central-1": 0.0123, + "ca-west-1": 0.0116, + "eu-central-1": 0.0, + "eu-central-2": 0.0132, + "eu-north-1": 0.0108, + "eu-south-1": 0.012, + "eu-south-2": 0.0114, + "eu-west-1": 0.0114, + "eu-west-2": 0.0126, + "eu-west-3": 0.0118, + "il-central-1": 0.0127, + "me-central-1": 0.0125, + "me-south-1": 0.0125, + "mx-central-1": 0.0109, + "sa-east-1": 0.0168, + "us-east-1": 0.0104, + "us-east-2": 0.0104, + "us-gov-east-1": 0.0122, + "us-gov-west-1": 0.0129, + "us-west-1": 0.0124, + "us-west-2": 0.0104, + "us-west-2-lax-1": 0.0125 + }, + "t3.small": { + "af-south-1": 0.0, + "ap-east-1": 0.0292, + "ap-northeast-1": 0.029, + "ap-northeast-2": 0.026, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0237, + "ap-south-2": 0.0224, + "ap-southeast-1": 0.028, + "ap-southeast-2": 0.0264, + "ap-southeast-3": 0.0264, + "ap-southeast-4": 0.0264, + "ap-southeast-5": 0.0238, + "ap-southeast-7": 0.0238, + "ca-central-1": 0.0, + "ca-west-1": 0.0232, + "eu-central-1": 0.024, + "eu-central-2": 0.0264, + "eu-north-1": 0.0216, + "eu-south-1": 0.0254, + "eu-south-2": 0.0228, + "eu-west-1": 0.0228, + "eu-west-2": 0.0236, + "eu-west-3": 0.0236, + "il-central-1": 0.024, + "me-central-1": 0.0251, + "me-south-1": 0.0, + "mx-central-1": 0.0218, + "sa-east-1": 0.0336, + "us-east-1": 0.022, + "us-east-2": 0.0208, + "us-gov-east-1": 0.0244, + "us-gov-west-1": 0.0244, + "us-west-1": 0.0265, + "us-west-2": 0.0208, + "us-west-2-lax-1": 0.025 + }, + "t3.medium": { + "af-south-1": 0.0542, + "ap-east-1": 0.0584, + "ap-northeast-1": 0.0544, + "ap-northeast-2": 0.052, + "ap-northeast-3": 0.0544, + "ap-south-1": 0.0, + "ap-south-2": 0.0448, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0528, + "ap-southeast-3": 0.0528, + "ap-southeast-4": 0.056, + "ap-southeast-5": 0.0475, + "ap-southeast-7": 0.0475, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.048, + "eu-central-2": 0.0528, + "eu-north-1": 0.0, + "eu-south-1": 0.0479, + "eu-south-2": 0.0456, + "eu-west-1": 0.0487, + "eu-west-2": 0.0, + "eu-west-3": 0.0472, + "il-central-1": 0.0, + "me-central-1": 0.0502, + "me-south-1": 0.0502, + "mx-central-1": 0.0437, + "sa-east-1": 0.0709, + "us-east-1": 0.0, + "us-east-2": 0.0416, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0517, + "us-west-1": 0.0531, + "us-west-2": 0.0416, + "us-west-2-lax-1": 0.0499 + }, + "t3.large": { + "af-south-1": 0.115, + "ap-east-1": 0.0, + "ap-northeast-1": 0.1088, + "ap-northeast-2": 0.104, + "ap-northeast-3": 0.1088, + "ap-south-1": 0.0896, + "ap-south-2": 0.0896, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1056, + "ap-southeast-3": 0.1056, + "ap-southeast-4": 0.1119, + "ap-southeast-5": 0.095, + "ap-southeast-7": 0.095, + "ca-central-1": 0.0984, + "ca-west-1": 0.0, + "eu-central-1": 0.096, + "eu-central-2": 0.1056, + "eu-north-1": 0.0864, + "eu-south-1": 0.0958, + "eu-south-2": 0.0912, + "eu-west-1": 0.0, + "eu-west-2": 0.1008, + "eu-west-3": 0.0944, + "il-central-1": 0.0958, + "me-central-1": 0.1003, + "me-south-1": 0.0, + "mx-central-1": 0.0874, + "sa-east-1": 0.0, + "us-east-1": 0.0882, + "us-east-2": 0.0832, + "us-gov-east-1": 0.0976, + "us-gov-west-1": 0.0976, + "us-west-1": 0.1061, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0998 + }, + "t3.xlarge": { + "af-south-1": 0.217, + "ap-east-1": 0.2336, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.22, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.1792, + "ap-southeast-1": 0.2112, + "ap-southeast-2": 0.2249, + "ap-southeast-3": 0.2112, + "ap-southeast-4": 0.2112, + "ap-southeast-5": 0.1901, + "ap-southeast-7": 0.1901, + "ca-central-1": 0.1856, + "ca-west-1": 0.1856, + "eu-central-1": 0.192, + "eu-central-2": 0.2112, + "eu-north-1": 0.1728, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.1888, + "eu-west-3": 0.0, + "il-central-1": 0.1917, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 0.1747, + "sa-east-1": 0.0, + "us-east-1": 0.1763, + "us-east-2": 0.1664, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.1952, + "us-west-1": 0.1984, + "us-west-2": 0.1664, + "us-west-2-lax-1": 0.1997 + }, + "t3.nano": { + "af-south-1": 0.0068, + "ap-east-1": 0.0073, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0065, + "ap-northeast-3": 0.0068, + "ap-south-1": 0.0, + "ap-south-2": 0.0056, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0066, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0066, + "ap-southeast-5": 0.0059, + "ap-southeast-7": 0.0059, + "ca-central-1": 0.0058, + "ca-west-1": 0.0058, + "eu-central-1": 0.006, + "eu-central-2": 0.0, + "eu-north-1": 0.0054, + "eu-south-1": 0.006, + "eu-south-2": 0.0057, + "eu-west-1": 0.0057, + "eu-west-2": 0.0059, + "eu-west-3": 0.0059, + "il-central-1": 0.0, + "me-central-1": 0.0063, + "me-south-1": 0.0063, + "mx-central-1": 0.0055, + "sa-east-1": 0.0084, + "us-east-1": 0.0052, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0062, + "us-west-2": 0.0052, + "us-west-2-lax-1": 0.0062 + }, + "t3.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.4672, + "ap-northeast-1": 0.4352, + "ap-northeast-2": 0.4399, + "ap-northeast-3": 0.4352, + "ap-south-1": 0.3584, + "ap-south-2": 0.3584, + "ap-southeast-1": 0.4224, + "ap-southeast-2": 0.4224, + "ap-southeast-3": 0.4224, + "ap-southeast-4": 0.4224, + "ap-southeast-5": 0.3802, + "ap-southeast-7": 0.3802, + "ca-central-1": 0.3712, + "ca-west-1": 0.3712, + "eu-central-1": 0.384, + "eu-central-2": 0.4224, + "eu-north-1": 0.3456, + "eu-south-1": 0.3834, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.3776, + "eu-west-3": 0.0, + "il-central-1": 0.3834, + "me-central-1": 0.4013, + "me-south-1": 0.4013, + "mx-central-1": 0.3494, + "sa-east-1": 0.5376, + "us-east-1": 0.3328, + "us-east-2": 0.3527, + "us-gov-east-1": 0.3904, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.3994 + }, + "t3a.micro": { + "ap-northeast-1": 0.0122, + "ap-northeast-2": 0.0117, + "ap-south-1": 0.0062, + "ap-southeast-1": 0.0118, + "ap-southeast-2": 0.0119, + "ca-central-1": 0.0104, + "eu-central-1": 0.0108, + "eu-south-1": 0.0108, + "eu-west-1": 0.0102, + "eu-west-2": 0.0106, + "eu-west-3": 0.0106, + "il-central-1": 0.0107, + "sa-east-1": 0.0151, + "us-east-1": 0.0094, + "us-east-2": 0.0094, + "us-gov-east-1": 0.011, + "us-gov-west-1": 0.011, + "us-west-1": 0.0112, + "us-west-2": 0.0094 + }, + "t3a.small": { + "ap-northeast-1": 0.0245, + "ap-northeast-2": 0.0234, + "ap-south-1": 0.0123, + "ap-southeast-1": 0.0236, + "ap-southeast-2": 0.0238, + "ca-central-1": 0.0209, + "eu-central-1": 0.0216, + "eu-south-1": 0.0216, + "eu-west-1": 0.0204, + "eu-west-2": 0.0212, + "eu-west-3": 0.0212, + "il-central-1": 0.0214, + "sa-east-1": 0.0302, + "us-east-1": 0.0188, + "us-east-2": 0.0188, + "us-gov-east-1": 0.022, + "us-gov-west-1": 0.022, + "us-west-1": 0.0223, + "us-west-2": 0.0188 + }, + "t3a.medium": { + "ap-northeast-1": 0.049, + "ap-northeast-2": 0.0468, + "ap-south-1": 0.0246, + "ap-southeast-1": 0.0472, + "ap-southeast-2": 0.0475, + "ca-central-1": 0.0418, + "eu-central-1": 0.0432, + "eu-south-1": 0.0431, + "eu-west-1": 0.0408, + "eu-west-2": 0.0425, + "eu-west-3": 0.0425, + "il-central-1": 0.0429, + "sa-east-1": 0.0605, + "us-east-1": 0.0376, + "us-east-2": 0.0376, + "us-gov-east-1": 0.0439, + "us-gov-west-1": 0.0439, + "us-west-1": 0.0446, + "us-west-2": 0.0376 + }, + "t3a.large": { + "ap-northeast-1": 0.0979, + "ap-northeast-2": 0.0936, + "ap-south-1": 0.0493, + "ap-southeast-1": 0.0944, + "ap-southeast-2": 0.095, + "ca-central-1": 0.0835, + "eu-central-1": 0.0864, + "eu-south-1": 0.0862, + "eu-west-1": 0.0816, + "eu-west-2": 0.085, + "eu-west-3": 0.085, + "il-central-1": 0.0858, + "sa-east-1": 0.121, + "us-east-1": 0.0752, + "us-east-2": 0.0752, + "us-gov-east-1": 0.0878, + "us-gov-west-1": 0.0878, + "us-west-1": 0.0893, + "us-west-2": 0.0752 + }, + "t3a.xlarge": { + "ap-northeast-1": 0.1958, + "ap-northeast-2": 0.1872, + "ap-south-1": 0.0986, + "ap-southeast-1": 0.1888, + "ap-southeast-2": 0.1901, + "ca-central-1": 0.167, + "eu-central-1": 0.1728, + "eu-south-1": 0.1725, + "eu-west-1": 0.1632, + "eu-west-2": 0.1699, + "eu-west-3": 0.1699, + "il-central-1": 0.1715, + "sa-east-1": 0.2419, + "us-east-1": 0.1504, + "us-east-2": 0.1504, + "us-gov-east-1": 0.1757, + "us-gov-west-1": 0.1757, + "us-west-1": 0.1786, + "us-west-2": 0.1504 + }, + "t3a.nano": { + "ap-northeast-1": 0.0061, + "ap-northeast-2": 0.0059, + "ap-south-1": 0.0031, + "ap-southeast-1": 0.0059, + "ap-southeast-2": 0.0059, + "ca-central-1": 0.0052, + "eu-central-1": 0.0054, + "eu-south-1": 0.0054, + "eu-west-1": 0.0051, + "eu-west-2": 0.0053, + "eu-west-3": 0.0053, + "il-central-1": 0.0054, + "sa-east-1": 0.0076, + "us-east-1": 0.0047, + "us-east-2": 0.0047, + "us-gov-east-1": 0.0055, + "us-gov-west-1": 0.0055, + "us-west-1": 0.0056, + "us-west-2": 0.0047 + }, + "t3a.2xlarge": { + "ap-northeast-1": 0.3917, + "ap-northeast-2": 0.3744, + "ap-south-1": 0.1971, + "ap-southeast-1": 0.3776, + "ap-southeast-2": 0.3802, + "ca-central-1": 0.3341, + "eu-central-1": 0.3456, + "eu-south-1": 0.345, + "eu-west-1": 0.3264, + "eu-west-2": 0.3398, + "eu-west-3": 0.3398, + "il-central-1": 0.343, + "sa-east-1": 0.4838, + "us-east-1": 0.3008, + "us-east-2": 0.3008, + "us-gov-east-1": 0.3514, + "us-gov-west-1": 0.3514, + "us-west-1": 0.3571, + "us-west-2": 0.3008 + }, + "t4g.micro": { + "af-south-1": 0.0108, + "ap-east-1": 0.0116, + "ap-northeast-1": 0.0108, + "ap-northeast-2": 0.0104, + "ap-northeast-3": 0.0109, + "ap-south-1": 0.0056, + "ap-south-2": 0.0056, + "ap-southeast-1": 0.0106, + "ap-southeast-2": 0.0106, + "ap-southeast-3": 0.0106, + "ap-southeast-4": 0.0106, + "ap-southeast-5": 0.0095, + "ap-southeast-7": 0.0095, + "ca-central-1": 0.0092, + "ca-west-1": 0.0092, + "eu-central-1": 0.0096, + "eu-central-2": 0.0106, + "eu-north-1": 0.0086, + "eu-south-1": 0.0096, + "eu-south-2": 0.0092, + "eu-west-1": 0.0092, + "eu-west-2": 0.0094, + "eu-west-3": 0.0094, + "il-central-1": 0.0097, + "me-central-1": 0.0102, + "me-south-1": 0.01, + "mx-central-1": 0.0088, + "sa-east-1": 0.0134, + "us-east-1": 0.0084, + "us-east-2": 0.0084, + "us-gov-east-1": 0.0098, + "us-gov-west-1": 0.0098, + "us-west-1": 0.01, + "us-west-2": 0.0084 + }, + "t4g.small": { + "af-south-1": 0.0217, + "ap-east-1": 0.0232, + "ap-northeast-1": 0.0216, + "ap-northeast-2": 0.0208, + "ap-northeast-3": 0.0218, + "ap-south-1": 0.0112, + "ap-south-2": 0.0112, + "ap-southeast-1": 0.0212, + "ap-southeast-2": 0.0212, + "ap-southeast-3": 0.0212, + "ap-southeast-4": 0.0212, + "ap-southeast-5": 0.0191, + "ap-southeast-7": 0.0191, + "ca-central-1": 0.0184, + "ca-west-1": 0.0184, + "eu-central-1": 0.0192, + "eu-central-2": 0.0211, + "eu-north-1": 0.0172, + "eu-south-1": 0.0192, + "eu-south-2": 0.0184, + "eu-west-1": 0.0184, + "eu-west-2": 0.0188, + "eu-west-3": 0.0188, + "il-central-1": 0.0193, + "me-central-1": 0.0204, + "me-south-1": 0.0201, + "mx-central-1": 0.0176, + "sa-east-1": 0.0268, + "us-east-1": 0.0168, + "us-east-2": 0.0168, + "us-gov-east-1": 0.0196, + "us-gov-west-1": 0.0196, + "us-west-1": 0.02, + "us-west-2": 0.0168 + }, + "t4g.medium": { + "af-south-1": 0.0434, + "ap-east-1": 0.0464, + "ap-northeast-1": 0.0432, + "ap-northeast-2": 0.0416, + "ap-northeast-3": 0.0435, + "ap-south-1": 0.0224, + "ap-south-2": 0.0224, + "ap-southeast-1": 0.0424, + "ap-southeast-2": 0.0424, + "ap-southeast-3": 0.0424, + "ap-southeast-4": 0.0424, + "ap-southeast-5": 0.0382, + "ap-southeast-7": 0.0382, + "ca-central-1": 0.0368, + "ca-west-1": 0.0368, + "eu-central-1": 0.0384, + "eu-central-2": 0.0422, + "eu-north-1": 0.0344, + "eu-south-1": 0.0384, + "eu-south-2": 0.0368, + "eu-west-1": 0.0368, + "eu-west-2": 0.0376, + "eu-west-3": 0.0376, + "il-central-1": 0.0386, + "me-central-1": 0.0408, + "me-south-1": 0.0402, + "mx-central-1": 0.0353, + "sa-east-1": 0.0536, + "us-east-1": 0.0336, + "us-east-2": 0.0336, + "us-gov-east-1": 0.0392, + "us-gov-west-1": 0.0392, + "us-west-1": 0.04, + "us-west-2": 0.0336 + }, + "t4g.large": { + "af-south-1": 0.0867, + "ap-east-1": 0.0928, + "ap-northeast-1": 0.0864, + "ap-northeast-2": 0.0832, + "ap-northeast-3": 0.087, + "ap-south-1": 0.0448, + "ap-south-2": 0.0448, + "ap-southeast-1": 0.0848, + "ap-southeast-2": 0.0848, + "ap-southeast-3": 0.0848, + "ap-southeast-4": 0.0848, + "ap-southeast-5": 0.0763, + "ap-southeast-7": 0.0763, + "ca-central-1": 0.0736, + "ca-west-1": 0.0736, + "eu-central-1": 0.0768, + "eu-central-2": 0.0845, + "eu-north-1": 0.0688, + "eu-south-1": 0.0768, + "eu-south-2": 0.0736, + "eu-west-1": 0.0736, + "eu-west-2": 0.0752, + "eu-west-3": 0.0752, + "il-central-1": 0.0773, + "me-central-1": 0.0816, + "me-south-1": 0.0803, + "mx-central-1": 0.0706, + "sa-east-1": 0.1072, + "us-east-1": 0.0672, + "us-east-2": 0.0672, + "us-gov-east-1": 0.0784, + "us-gov-west-1": 0.0784, + "us-west-1": 0.08, + "us-west-2": 0.0672 + }, + "t4g.xlarge": { + "af-south-1": 0.1734, + "ap-east-1": 0.1856, + "ap-northeast-1": 0.1728, + "ap-northeast-2": 0.1664, + "ap-northeast-3": 0.1741, + "ap-south-1": 0.0896, + "ap-south-2": 0.0896, + "ap-southeast-1": 0.1696, + "ap-southeast-2": 0.1696, + "ap-southeast-3": 0.1696, + "ap-southeast-4": 0.1696, + "ap-southeast-5": 0.1526, + "ap-southeast-7": 0.1526, + "ca-central-1": 0.1472, + "ca-west-1": 0.1472, + "eu-central-1": 0.1536, + "eu-central-2": 0.169, + "eu-north-1": 0.1376, + "eu-south-1": 0.1536, + "eu-south-2": 0.1472, + "eu-west-1": 0.1472, + "eu-west-2": 0.1504, + "eu-west-3": 0.1504, + "il-central-1": 0.1546, + "me-central-1": 0.1632, + "me-south-1": 0.1606, + "mx-central-1": 0.1411, + "sa-east-1": 0.2144, + "us-east-1": 0.1344, + "us-east-2": 0.1344, + "us-gov-east-1": 0.1568, + "us-gov-west-1": 0.1568, + "us-west-1": 0.16, + "us-west-2": 0.1344 + }, + "t4g.nano": { + "af-south-1": 0.0054, + "ap-east-1": 0.0058, + "ap-northeast-1": 0.0054, + "ap-northeast-2": 0.0052, + "ap-northeast-3": 0.0054, + "ap-south-1": 0.0028, + "ap-south-2": 0.0028, + "ap-southeast-1": 0.0053, + "ap-southeast-2": 0.0053, + "ap-southeast-3": 0.0053, + "ap-southeast-4": 0.0053, + "ap-southeast-5": 0.0048, + "ap-southeast-7": 0.0048, + "ca-central-1": 0.0046, + "ca-west-1": 0.0046, + "eu-central-1": 0.0048, + "eu-central-2": 0.0053, + "eu-north-1": 0.0043, + "eu-south-1": 0.0048, + "eu-south-2": 0.0046, + "eu-west-1": 0.0046, + "eu-west-2": 0.0047, + "eu-west-3": 0.0047, + "il-central-1": 0.0048, + "me-central-1": 0.0051, + "me-south-1": 0.005, + "mx-central-1": 0.0044, + "sa-east-1": 0.0067, + "us-east-1": 0.0042, + "us-east-2": 0.0042, + "us-gov-east-1": 0.0049, + "us-gov-west-1": 0.0049, + "us-west-1": 0.005, + "us-west-2": 0.0042 + }, + "t4g.2xlarge": { + "af-south-1": 0.3469, + "ap-east-1": 0.3712, + "ap-northeast-1": 0.3456, + "ap-northeast-2": 0.3328, + "ap-northeast-3": 0.3482, + "ap-south-1": 0.1792, + "ap-south-2": 0.1792, + "ap-southeast-1": 0.3392, + "ap-southeast-2": 0.3392, + "ap-southeast-3": 0.3392, + "ap-southeast-4": 0.3392, + "ap-southeast-5": 0.3053, + "ap-southeast-7": 0.3053, + "ca-central-1": 0.2944, + "ca-west-1": 0.2944, + "eu-central-1": 0.3072, + "eu-central-2": 0.3379, + "eu-north-1": 0.2752, + "eu-south-1": 0.3072, + "eu-south-2": 0.2944, + "eu-west-1": 0.2944, + "eu-west-2": 0.3008, + "eu-west-3": 0.3008, + "il-central-1": 0.3091, + "me-central-1": 0.3264, + "me-south-1": 0.3213, + "mx-central-1": 0.2822, + "sa-east-1": 0.4288, + "us-east-1": 0.2688, + "us-east-2": 0.2688, + "us-gov-east-1": 0.3136, + "us-gov-west-1": 0.3136, + "us-west-1": 0.32, + "us-west-2": 0.2688 + }, + "trn1": { + "us-east-1": 23.65, + "us-east-2": 23.65, + "us-west-2": 23.65 + }, + "trn1.2xlarge": { + "us-east-1": 1.34375, + "us-east-2": 0.0, + "us-west-2": 1.34375 + }, + "trn1.32xlarge": { + "us-east-1": 21.5, + "us-east-2": 23.65, + "us-west-2": 21.5 + }, + "trn1n.32xlarge": { + "us-east-1": 24.78, + "us-east-2": 24.78, + "us-west-2": 24.78 + }, + "trn2.48xlarge": { + "us-east-2": 0.0 + }, + "u7i-6tb": { + "ap-northeast-2": 83.322, + "us-east-1": 69.069, + "us-west-2": 69.069 + }, + "u7i-6tb.112xlarge": { + "ap-northeast-2": 75.74705, + "us-east-1": 62.79, + "us-west-2": 0.0 + }, + "u7i-8tb": { + "ap-northeast-2": 111.096, + "us-east-1": 92.092 + }, + "u7i-8tb.112xlarge": { + "ap-northeast-2": 100.99606, + "us-east-1": 0.0 + }, + "u7i-12tb": { + "us-east-1": 168.168, + "us-west-2": 168.168 + }, + "u7i-12tb.224xlarge": { + "us-east-1": 152.88, + "us-west-2": 152.88 + }, + "u7in-16tb": { + "ap-northeast-2": 270.492, + "ap-southeast-2": 268.712, + "us-east-1": 224.224, + "us-west-2": 224.224 + }, + "u7in-16tb.224xlarge": { + "ap-northeast-2": 245.902, + "ap-southeast-2": 244.284, + "us-east-1": 203.84, + "us-west-2": 203.84 + }, + "u7in-24tb.224xlarge": { + "us-east-1": 305.76, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "u7in-32tb": { + "us-east-1": 448.448, + "us-west-2": 448.448 + }, + "u7in-32tb.224xlarge": { + "us-east-1": 407.68, + "us-west-2": 407.68 + }, + "u-3tb1.56xlarge": { + "ap-east-1": 36.22685, + "ap-northeast-1": 32.9333, + "ap-southeast-1": 32.93, + "ap-southeast-2": 32.715, + "ca-central-1": 29.9, + "eu-central-1": 32.9335, + "eu-central-2": 36.22685, + "eu-south-1": 32.0775, + "eu-west-1": 30.55, + "sa-east-1": 43.55, + "us-east-1": 27.3, + "us-east-2": 27.3, + "us-gov-west-1": 32.7165, + "us-west-2": 27.3 + }, + "u-6tb1.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "u-6tb1.56xlarge": { + "af-south-1": 61.79454, + "ap-northeast-1": 55.9796, + "ap-northeast-2": 55.9796, + "ap-northeast-3": 55.9796, + "ap-south-1": 47.87676, + "ap-southeast-1": 55.9796, + "ap-southeast-2": 55.61075, + "ap-southeast-3": 55.9796, + "ca-central-1": 50.82333, + "eu-central-1": 55.9796, + "eu-central-2": 61.57756, + "eu-north-1": 49.33177, + "eu-south-1": 54.52459, + "eu-south-2": 51.92818, + "eu-west-1": 51.92818, + "eu-west-2": 54.50589, + "eu-west-3": 54.50589, + "sa-east-1": 74.02528, + "us-east-1": 46.40391, + "us-east-2": 46.40391, + "us-gov-east-1": 55.61075, + "us-gov-west-1": 55.61075, + "us-west-2": 46.40391 + }, + "u-6tb1.112xlarge": { + "af-south-1": 72.709, + "ap-northeast-1": 65.867, + "ap-northeast-2": 65.867, + "ap-northeast-3": 65.867, + "ap-south-1": 56.333, + "ap-southeast-1": 65.867, + "ap-southeast-2": 65.433, + "ap-southeast-3": 65.867, + "ca-central-1": 0.0, + "eu-central-1": 65.867, + "eu-central-2": 72.4537, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 61.1, + "eu-west-1": 61.1, + "eu-west-2": 64.133, + "eu-west-3": 64.133, + "sa-east-1": 0.0, + "us-east-1": 54.6, + "us-east-2": 54.6, + "us-gov-east-1": 65.433, + "us-gov-west-1": 65.433, + "us-west-2": 0.0 + }, + "u-9tb1": { + "us-gov-east-1": 60.567 + }, + "u-9tb1.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "u-9tb1.112xlarge": { + "ap-northeast-1": 98.8, + "ap-northeast-2": 98.8, + "ap-south-1": 84.5, + "ap-south-2": 83.98043, + "ap-southeast-1": 98.8, + "eu-central-1": 0.0, + "eu-north-1": 91.65, + "eu-west-1": 0.0, + "eu-west-2": 96.2, + "eu-west-3": 96.2, + "sa-east-1": 130.65, + "us-east-1": 0.0, + "us-east-2": 81.9, + "us-gov-east-1": 98.15, + "us-gov-west-1": 98.15, + "us-west-2": 81.9 + }, + "u-12tb1.metal": { + "af-south-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "u-12tb1.112xlarge": { + "af-south-1": 145.418, + "ap-northeast-1": 131.733, + "ap-northeast-2": 131.733, + "ap-northeast-3": 0.0, + "ap-south-1": 112.667, + "ap-southeast-1": 0.0, + "ap-southeast-2": 130.867, + "eu-central-1": 131.733, + "eu-south-1": 128.31, + "eu-west-1": 122.2, + "sa-east-1": 174.2, + "us-east-1": 109.2, + "us-east-2": 0.0, + "us-gov-east-1": 130.867, + "us-gov-west-1": 130.867, + "us-west-2": 109.2 + }, + "u-18tb1": { + "eu-central-1": 197.6, + "us-west-2": 163.8 + }, + "u-18tb1.metal": { + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-west-2": 0.0 + }, + "u-18tb1.112xlarge": { + "eu-central-1": 197.6, + "eu-west-1": 183.3, + "sa-east-1": 261.3, + "us-east-1": 163.8, + "us-west-2": 163.8 + }, + "u-24tb1": { + "us-west-2": 70.176 + }, + "u-24tb1.metal": { + "ap-northeast-2": 0.0, + "us-east-1": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "u-24tb1.112xlarge": { + "ap-northeast-2": 263.47, + "us-east-1": 218.4, + "us-gov-east-1": 261.73, + "us-gov-west-1": 261.73, + "us-west-2": 218.4 + }, + "vt1": { + "ap-northeast-1": 7.2 + }, + "vt1.3xlarge": { + "ap-northeast-1": 0.81824, + "eu-west-1": 0.73412, + "us-east-1": 0.65, + "us-west-2": 0.65 + }, + "vt1.6xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 1.46824, + "us-east-1": 1.3, + "us-west-2": 1.43 + }, + "vt1.24xlarge": { + "ap-northeast-1": 6.54588, + "eu-west-1": 5.87294, + "us-east-1": 5.72, + "us-west-2": 0.0 + }, + "x1.16xlarge": { + "af-south-1": 9.524, + "ap-east-1": 10.638, + "ap-northeast-1": 9.671, + "ap-northeast-2": 0.0, + "ap-northeast-3": 9.671, + "ap-south-1": 6.881, + "ap-southeast-1": 10.638, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 9.337, + "eu-west-1": 8.003, + "eu-west-2": 8.403, + "eu-west-3": 8.403, + "sa-east-1": 13.005, + "us-east-1": 6.669, + "us-east-2": 6.669, + "us-gov-east-1": 8.003, + "us-gov-west-1": 8.803, + "us-west-2": 7.336 + }, + "x1.32xlarge": { + "af-south-1": 19.048, + "ap-east-1": 21.276, + "ap-northeast-1": 19.341, + "ap-northeast-2": 19.341, + "ap-northeast-3": 19.342, + "ap-south-1": 13.762, + "ap-southeast-1": 19.341, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 18.674, + "eu-west-1": 16.006, + "eu-west-2": 16.806, + "eu-west-3": 16.806, + "sa-east-1": 26.01, + "us-east-1": 13.338, + "us-east-2": 13.338, + "us-gov-east-1": 16.006, + "us-gov-west-1": 16.006, + "us-west-2": 0.0 + }, + "x1e": { + "ap-southeast-1": 42.557, + "ap-southeast-2": 42.557 + }, + "x1e.xlarge": { + "af-south-1": 1.19, + "ap-northeast-1": 1.33, + "ap-northeast-2": 1.33, + "ap-northeast-3": 1.33, + "ap-south-1": 0.86, + "ap-southeast-1": 1.209, + "ap-southeast-2": 1.209, + "ca-central-1": 1.008, + "eu-central-1": 1.167, + "eu-west-1": 1.0, + "sa-east-1": 1.626, + "us-east-1": 0.834, + "us-east-2": 0.917, + "us-gov-east-1": 1.0, + "us-gov-west-1": 1.0, + "us-west-2": 0.834 + }, + "x1e.2xlarge": { + "af-south-1": 2.38, + "ap-northeast-1": 2.418, + "ap-northeast-2": 2.418, + "ap-northeast-3": 0.0, + "ap-south-1": 1.72, + "ap-southeast-1": 2.418, + "ap-southeast-2": 2.418, + "ca-central-1": 2.017, + "eu-central-1": 0.0, + "eu-west-1": 2.0, + "sa-east-1": 3.251, + "us-east-1": 1.668, + "us-east-2": 1.668, + "us-gov-east-1": 2.0, + "us-gov-west-1": 2.0, + "us-west-2": 1.668 + }, + "x1e.4xlarge": { + "af-south-1": 5.236, + "ap-northeast-1": 4.836, + "ap-northeast-2": 4.836, + "ap-northeast-3": 5.32, + "ap-south-1": 3.44, + "ap-southeast-1": 4.836, + "ap-southeast-2": 0.0, + "ca-central-1": 3.667, + "eu-central-1": 4.668, + "eu-west-1": 0.0, + "sa-east-1": 6.502, + "us-east-1": 3.67, + "us-east-2": 3.336, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.0, + "us-west-2": 0.0 + }, + "x1e.8xlarge": { + "af-south-1": 10.472, + "ap-northeast-1": 0.0, + "ap-northeast-2": 9.672, + "ap-northeast-3": 0.0, + "ap-south-1": 6.88, + "ap-southeast-1": 9.672, + "ap-southeast-2": 9.672, + "ca-central-1": 7.334, + "eu-central-1": 9.336, + "eu-west-1": 8.0, + "sa-east-1": 13.005, + "us-east-1": 6.672, + "us-east-2": 6.672, + "us-gov-east-1": 8.0, + "us-gov-west-1": 8.8, + "us-west-2": 6.672 + }, + "x1e.16xlarge": { + "af-south-1": 19.04, + "ap-northeast-1": 19.344, + "ap-northeast-2": 0.0, + "ap-northeast-3": 19.344, + "ap-south-1": 13.76, + "ap-southeast-1": 21.278, + "ap-southeast-2": 19.344, + "ca-central-1": 14.669, + "eu-central-1": 20.539, + "eu-west-1": 16.0, + "sa-east-1": 26.01, + "us-east-1": 13.344, + "us-east-2": 13.344, + "us-gov-east-1": 17.6, + "us-gov-west-1": 0.0, + "us-west-2": 14.678 + }, + "x1e.32xlarge": { + "af-south-1": 38.08, + "ap-northeast-1": 38.688, + "ap-northeast-2": 38.688, + "ap-northeast-3": 38.688, + "ap-south-1": 27.52, + "ap-southeast-1": 38.688, + "ap-southeast-2": 38.688, + "ca-central-1": 29.338, + "eu-central-1": 37.344, + "eu-west-1": 0.0, + "sa-east-1": 52.019, + "us-east-1": 26.688, + "us-east-2": 26.688, + "us-gov-east-1": 32.0, + "us-gov-west-1": 32.0, + "us-west-2": 26.688 + }, + "x2gd": { + "eu-west-1": 7.04 + }, + "x2gd.medium": { + "eu-west-1": 0.1, + "us-east-1": 0.0835, + "us-east-2": 0.0919, + "us-west-2": 0.0 + }, + "x2gd.large": { + "eu-west-1": 0.2, + "us-east-1": 0.1837, + "us-east-2": 0.167, + "us-west-2": 0.1837 + }, + "x2gd.xlarge": { + "eu-west-1": 0.44, + "us-east-1": 0.3674, + "us-east-2": 0.334, + "us-west-2": 0.334 + }, + "x2gd.metal": { + "eu-west-1": 6.4, + "us-east-1": 5.8784, + "us-east-2": 0.0, + "us-west-2": 5.344 + }, + "x2gd.2xlarge": { + "eu-west-1": 0.8, + "us-east-1": 0.668, + "us-east-2": 0.668, + "us-west-2": 0.0 + }, + "x2gd.4xlarge": { + "eu-west-1": 0.0, + "us-east-1": 1.4696, + "us-east-2": 1.336, + "us-west-2": 1.336 + }, + "x2gd.8xlarge": { + "eu-west-1": 3.2, + "us-east-1": 2.672, + "us-east-2": 2.672, + "us-west-2": 2.672 + }, + "x2gd.12xlarge": { + "eu-west-1": 4.8, + "us-east-1": 0.0, + "us-east-2": 4.008, + "us-west-2": 4.008 + }, + "x2gd.16xlarge": { + "eu-west-1": 6.4, + "us-east-1": 5.344, + "us-east-2": 5.344, + "us-west-2": 5.8784 + }, + "x2idn.metal": { + "af-south-1": 19.048, + "ap-northeast-1": 0.0, + "ap-northeast-2": 19.341, + "ap-northeast-3": 19.342, + "ap-south-1": 13.762, + "ap-south-2": 13.762, + "ap-southeast-1": 19.341, + "ap-southeast-2": 0.0, + "ap-southeast-3": 19.341, + "ap-southeast-5": 17.4069, + "ap-southeast-7": 17.4069, + "ca-central-1": 0.0, + "eu-central-1": 18.674, + "eu-central-2": 20.5414, + "eu-north-1": 15.211, + "eu-south-1": 16.801, + "eu-south-2": 16.006, + "eu-west-1": 0.0, + "eu-west-2": 16.806, + "eu-west-3": 0.0, + "me-central-1": 0.0, + "me-south-1": 16.408, + "sa-east-1": 26.01, + "us-east-1": 0.0, + "us-east-2": 13.338, + "us-gov-east-1": 16.006, + "us-gov-west-1": 0.0, + "us-west-1": 17.34, + "us-west-2": 13.338 + }, + "x2idn.16xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 9.6705, + "ap-northeast-2": 9.6705, + "ap-northeast-3": 9.671, + "ap-south-1": 6.881, + "ap-south-2": 6.881, + "ap-southeast-1": 10.63755, + "ap-southeast-2": 10.63755, + "ap-southeast-3": 9.6705, + "ap-southeast-5": 9.5738, + "ap-southeast-7": 8.70345, + "ca-central-1": 7.336, + "eu-central-1": 9.337, + "eu-central-2": 11.29777, + "eu-north-1": 7.6055, + "eu-south-1": 9.24055, + "eu-south-2": 8.003, + "eu-west-1": 8.003, + "eu-west-2": 8.403, + "eu-west-3": 9.2433, + "me-central-1": 8.204, + "me-south-1": 8.204, + "sa-east-1": 14.3055, + "us-east-1": 6.669, + "us-east-2": 6.669, + "us-gov-east-1": 8.8033, + "us-gov-west-1": 8.003, + "us-west-1": 8.67, + "us-west-2": 6.669 + }, + "x2idn.24xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 14.50575, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 10.3215, + "ap-south-2": 0.0, + "ap-southeast-1": 15.95633, + "ap-southeast-2": 14.50575, + "ap-southeast-3": 0.0, + "ap-southeast-5": 14.36069, + "ap-southeast-7": 0.0, + "ca-central-1": 11.004, + "eu-central-1": 0.0, + "eu-central-2": 16.94666, + "eu-north-1": 12.54908, + "eu-south-1": 12.60075, + "eu-south-2": 12.0045, + "eu-west-1": 13.20495, + "eu-west-2": 13.86495, + "eu-west-3": 12.6045, + "me-central-1": 0.0, + "me-south-1": 12.306, + "sa-east-1": 19.5075, + "us-east-1": 10.0035, + "us-east-2": 0.0, + "us-gov-east-1": 12.0045, + "us-gov-west-1": 13.20495, + "us-west-1": 13.005, + "us-west-2": 10.0035 + }, + "x2idn.32xlarge": { + "af-south-1": 19.048, + "ap-northeast-1": 19.341, + "ap-northeast-2": 19.341, + "ap-northeast-3": 19.342, + "ap-south-1": 13.762, + "ap-south-2": 13.762, + "ap-southeast-1": 19.341, + "ap-southeast-2": 19.341, + "ap-southeast-3": 19.341, + "ap-southeast-5": 0.0, + "ap-southeast-7": 17.4069, + "ca-central-1": 0.0, + "eu-central-1": 18.674, + "eu-central-2": 20.5414, + "eu-north-1": 15.211, + "eu-south-1": 16.801, + "eu-south-2": 16.006, + "eu-west-1": 16.006, + "eu-west-2": 16.806, + "eu-west-3": 0.0, + "me-central-1": 16.408, + "me-south-1": 0.0, + "sa-east-1": 26.01, + "us-east-1": 13.338, + "us-east-2": 13.338, + "us-gov-east-1": 0.0, + "us-gov-west-1": 16.006, + "us-west-1": 17.34, + "us-west-2": 13.338 + }, + "x2iedn.xlarge": { + "af-south-1": 1.30955, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.20881, + "ap-northeast-3": 0.0, + "ap-south-1": 0.86013, + "ap-south-2": 0.86013, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.20881, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.0, + "ca-central-1": 0.917, + "eu-central-1": 1.16713, + "eu-north-1": 0.95072, + "eu-south-1": 1.05003, + "eu-south-2": 1.00038, + "eu-west-1": 1.00038, + "eu-west-2": 0.0, + "eu-west-3": 1.05038, + "sa-east-1": 1.62563, + "us-east-1": 0.83363, + "us-east-2": 0.0, + "us-gov-east-1": 1.00038, + "us-gov-west-1": 0.0, + "us-west-1": 1.08375, + "us-west-2": 0.83363 + }, + "x2iedn.metal": { + "af-south-1": 0.0, + "ap-northeast-1": 38.682, + "ap-northeast-2": 38.682, + "ap-northeast-3": 38.684, + "ap-south-1": 0.0, + "ap-south-2": 27.524, + "ap-southeast-1": 38.682, + "ap-southeast-2": 0.0, + "ap-southeast-3": 38.682, + "ap-southeast-5": 34.8138, + "ca-central-1": 29.344, + "eu-central-1": 37.348, + "eu-north-1": 30.423, + "eu-south-1": 33.601, + "eu-south-2": 32.012, + "eu-west-1": 0.0, + "eu-west-2": 33.612, + "eu-west-3": 33.612, + "sa-east-1": 0.0, + "us-east-1": 26.676, + "us-east-2": 26.676, + "us-gov-east-1": 0.0, + "us-gov-west-1": 32.012, + "us-west-1": 34.68, + "us-west-2": 26.676 + }, + "x2iedn.2xlarge": { + "af-south-1": 2.6191, + "ap-northeast-1": 2.41763, + "ap-northeast-2": 2.41763, + "ap-northeast-3": 0.0, + "ap-south-1": 1.72025, + "ap-south-2": 1.72025, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.41763, + "ap-southeast-3": 2.41763, + "ap-southeast-5": 2.17586, + "ca-central-1": 1.834, + "eu-central-1": 2.33425, + "eu-north-1": 2.09158, + "eu-south-1": 2.10006, + "eu-south-2": 2.00075, + "eu-west-1": 2.00075, + "eu-west-2": 2.10075, + "eu-west-3": 2.10075, + "sa-east-1": 3.57638, + "us-east-1": 1.66725, + "us-east-2": 1.66725, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.00075, + "us-west-1": 2.1675, + "us-west-2": 0.0 + }, + "x2iedn.4xlarge": { + "af-south-1": 4.762, + "ap-northeast-1": 4.83525, + "ap-northeast-2": 0.0, + "ap-northeast-3": 5.31905, + "ap-south-1": 3.4405, + "ap-south-2": 3.4405, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.83525, + "ap-southeast-3": 4.83525, + "ap-southeast-5": 4.35173, + "ca-central-1": 3.668, + "eu-central-1": 4.6685, + "eu-north-1": 3.80288, + "eu-south-1": 4.62014, + "eu-south-2": 4.0015, + "eu-west-1": 0.0, + "eu-west-2": 4.62165, + "eu-west-3": 0.0, + "sa-east-1": 6.5025, + "us-east-1": 3.3345, + "us-east-2": 3.3345, + "us-gov-east-1": 4.0015, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 3.3345 + }, + "x2iedn.8xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 9.6705, + "ap-northeast-2": 9.6705, + "ap-northeast-3": 9.671, + "ap-south-1": 7.5691, + "ap-south-2": 6.881, + "ap-southeast-1": 9.6705, + "ap-southeast-2": 9.6705, + "ap-southeast-3": 10.63755, + "ap-southeast-5": 8.70345, + "ca-central-1": 7.336, + "eu-central-1": 9.337, + "eu-north-1": 0.0, + "eu-south-1": 8.40025, + "eu-south-2": 8.003, + "eu-west-1": 8.003, + "eu-west-2": 8.403, + "eu-west-3": 8.403, + "sa-east-1": 13.005, + "us-east-1": 6.669, + "us-east-2": 6.669, + "us-gov-east-1": 8.003, + "us-gov-west-1": 8.003, + "us-west-1": 8.67, + "us-west-2": 6.669 + }, + "x2iedn.16xlarge": { + "af-south-1": 19.048, + "ap-northeast-1": 19.341, + "ap-northeast-2": 21.2751, + "ap-northeast-3": 0.0, + "ap-south-1": 13.762, + "ap-south-2": 0.0, + "ap-southeast-1": 19.341, + "ap-southeast-2": 21.2751, + "ap-southeast-3": 19.341, + "ap-southeast-5": 19.14759, + "ca-central-1": 14.672, + "eu-central-1": 20.5414, + "eu-north-1": 0.0, + "eu-south-1": 16.8005, + "eu-south-2": 16.006, + "eu-west-1": 17.6066, + "eu-west-2": 16.806, + "eu-west-3": 0.0, + "sa-east-1": 28.611, + "us-east-1": 14.6718, + "us-east-2": 13.338, + "us-gov-east-1": 17.6066, + "us-gov-west-1": 16.006, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "x2iedn.24xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 29.0115, + "ap-northeast-2": 29.0115, + "ap-northeast-3": 0.0, + "ap-south-1": 20.643, + "ap-south-2": 0.0, + "ap-southeast-1": 29.0115, + "ap-southeast-2": 29.0115, + "ap-southeast-3": 29.0115, + "ap-southeast-5": 26.11035, + "ca-central-1": 22.008, + "eu-central-1": 28.011, + "eu-north-1": 22.81725, + "eu-south-1": 25.20075, + "eu-south-2": 0.0, + "eu-west-1": 24.009, + "eu-west-2": 25.209, + "eu-west-3": 25.209, + "sa-east-1": 39.015, + "us-east-1": 20.007, + "us-east-2": 20.007, + "us-gov-east-1": 26.4099, + "us-gov-west-1": 24.009, + "us-west-1": 28.611, + "us-west-2": 20.007 + }, + "x2iedn.32xlarge": { + "af-south-1": 38.096, + "ap-northeast-1": 38.682, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 27.524, + "ap-south-2": 27.524, + "ap-southeast-1": 38.682, + "ap-southeast-2": 38.682, + "ap-southeast-3": 38.682, + "ap-southeast-5": 0.0, + "ca-central-1": 29.344, + "eu-central-1": 37.348, + "eu-north-1": 30.423, + "eu-south-1": 33.601, + "eu-south-2": 32.012, + "eu-west-1": 32.012, + "eu-west-2": 33.612, + "eu-west-3": 0.0, + "sa-east-1": 52.02, + "us-east-1": 26.676, + "us-east-2": 26.676, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 34.68, + "us-west-2": 0.0 + }, + "x2iezn": { + "eu-west-1": 13.2, + "me-central-1": 13.537, + "us-west-2": 11.009 + }, + "x2iezn.metal": { + "ap-northeast-1": 14.508, + "eu-west-1": 0.0, + "me-central-1": 12.306, + "us-east-1": 10.008, + "us-west-2": 10.008 + }, + "x2iezn.2xlarge": { + "ap-northeast-1": 2.418, + "eu-west-1": 0.0, + "me-central-1": 2.051, + "us-east-1": 1.668, + "us-west-2": 1.8348 + }, + "x2iezn.4xlarge": { + "ap-northeast-1": 4.836, + "eu-west-1": 4.0, + "me-central-1": 4.102, + "us-east-1": 3.6696, + "us-west-2": 3.336 + }, + "x2iezn.6xlarge": { + "ap-northeast-1": 7.9794, + "eu-west-1": 6.0, + "me-central-1": 6.153, + "us-east-1": 5.004, + "us-west-2": 5.004 + }, + "x2iezn.8xlarge": { + "ap-northeast-1": 9.672, + "eu-west-1": 8.0, + "me-central-1": 8.204, + "us-east-1": 0.0, + "us-west-2": 6.672 + }, + "x2iezn.12xlarge": { + "ap-northeast-1": 14.508, + "eu-west-1": 12.0, + "me-central-1": 12.306, + "us-east-1": 10.008, + "us-west-2": 10.008 + }, + "x8g": { + "eu-central-1": 28.839, + "us-east-1": 20.634, + "us-west-2": 20.634 + }, + "x8g.medium": { + "eu-central-1": 0.13655, + "us-east-1": 0.0977, + "us-west-2": 0.0 + }, + "x8g.large": { + "eu-central-1": 0.2731, + "us-east-1": 0.21494, + "us-west-2": 0.1954 + }, + "x8g.xlarge": { + "eu-central-1": 0.5462, + "us-east-1": 0.3908, + "us-west-2": 0.42988 + }, + "x8g.metal-24xl": { + "eu-central-1": 13.1088, + "us-east-1": 9.3792, + "us-west-2": 10.31712 + }, + "x8g.metal-48xl": { + "eu-central-1": 26.2176, + "us-east-1": 18.7584, + "us-west-2": 18.7584 + }, + "x8g.2xlarge": { + "eu-central-1": 1.0924, + "us-east-1": 0.0, + "us-west-2": 0.7816 + }, + "x8g.4xlarge": { + "eu-central-1": 2.1848, + "us-east-1": 1.5632, + "us-west-2": 1.5632 + }, + "x8g.8xlarge": { + "eu-central-1": 4.3696, + "us-east-1": 0.0, + "us-west-2": 3.1264 + }, + "x8g.12xlarge": { + "eu-central-1": 0.0, + "us-east-1": 0.0, + "us-west-2": 4.6896 + }, + "x8g.16xlarge": { + "eu-central-1": 8.7392, + "us-east-1": 6.2528, + "us-west-2": 6.2528 + }, + "x8g.24xlarge": { + "eu-central-1": 13.1088, + "us-east-1": 9.3792, + "us-west-2": 9.3792 + }, + "x8g.48xlarge": { + "eu-central-1": 0.0, + "us-east-1": 18.7584, + "us-west-2": 18.7584 + }, + "z1d.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.225, + "ap-south-1": 0.208, + "ap-southeast-1": 0.226, + "ap-southeast-2": 0.24, + "eu-central-1": 0.225, + "eu-west-1": 0.0, + "eu-west-2": 0.233, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "z1d.xlarge": { + "ap-northeast-1": 0.454, + "ap-northeast-2": 0.0, + "ap-south-1": 0.392, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.479, + "eu-central-1": 0.477, + "eu-west-1": 0.416, + "eu-west-2": 0.466, + "us-east-1": 0.372, + "us-east-2": 0.0, + "us-west-1": 0.448, + "us-west-2": 0.372 + }, + "z1d.metal": { + "ap-northeast-1": 5.448, + "ap-northeast-2": 5.4, + "ap-south-1": 4.704, + "ap-southeast-1": 5.424, + "ap-southeast-2": 5.424, + "eu-central-1": 5.4, + "eu-west-1": 4.992, + "eu-west-2": 5.273, + "us-east-1": 4.464, + "us-east-2": 4.464, + "us-west-1": 5.064, + "us-west-2": 4.464 + }, + "z1d.2xlarge": { + "ap-northeast-1": 0.963, + "ap-northeast-2": 0.954, + "ap-south-1": 0.831, + "ap-southeast-1": 0.904, + "ap-southeast-2": 0.904, + "eu-central-1": 0.9, + "eu-west-1": 0.832, + "eu-west-2": 0.879, + "us-east-1": 0.0, + "us-east-2": 0.744, + "us-west-1": 0.0, + "us-west-2": 0.744 + }, + "z1d.3xlarge": { + "ap-northeast-1": 1.362, + "ap-northeast-2": 0.0, + "ap-south-1": 1.176, + "ap-southeast-1": 1.438, + "ap-southeast-2": 1.438, + "eu-central-1": 1.35, + "eu-west-1": 1.248, + "eu-west-2": 1.318, + "us-east-1": 1.116, + "us-east-2": 0.0, + "us-west-1": 1.266, + "us-west-2": 1.116 + }, + "z1d.6xlarge": { + "ap-northeast-1": 2.724, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 2.712, + "ap-southeast-2": 2.712, + "eu-central-1": 0.0, + "eu-west-1": 2.496, + "eu-west-2": 2.636, + "us-east-1": 2.232, + "us-east-2": 2.232, + "us-west-1": 0.0, + "us-west-2": 2.232 + }, + "z1d.12xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.4, + "ap-south-1": 4.704, + "ap-southeast-1": 5.424, + "ap-southeast-2": 0.0, + "eu-central-1": 5.4, + "eu-west-1": 4.992, + "eu-west-2": 5.273, + "us-east-1": 4.464, + "us-east-2": 4.464, + "us-west-1": 5.064, + "us-west-2": 4.464 + } + }, + "ec2_rhel": { + "a1.medium": { + "ap-northeast-1": 0.0484, + "ap-south-1": 0.0399, + "ap-southeast-1": 0.0438, + "ap-southeast-2": 0.0477, + "eu-central-1": 0.0435, + "eu-west-1": 0.0432, + "us-east-1": 0.0399, + "us-east-2": 0.0414, + "us-west-2": 0.0399 + }, + "a1.large": { + "ap-northeast-1": 0.093, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0876, + "ap-southeast-2": 0.0954, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0798, + "us-east-2": 0.0798, + "us-west-2": 0.0798 + }, + "a1.xlarge": { + "ap-northeast-1": 0.186, + "ap-south-1": 0.1596, + "ap-southeast-1": 0.1752, + "ap-southeast-2": 0.1908, + "eu-central-1": 0.181, + "eu-west-1": 0.1728, + "us-east-1": 0.1657, + "us-east-2": 0.1596, + "us-west-2": 0.0 + }, + "a1.metal": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.581, + "ap-southeast-1": 0.643, + "ap-southeast-2": 0.0, + "eu-central-1": 0.638, + "eu-west-1": 0.634, + "us-east-1": 0.0, + "us-east-2": 0.581, + "us-west-2": 0.581 + }, + "a1.2xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.3192, + "ap-southeast-1": 0.3504, + "ap-southeast-2": 0.3816, + "eu-central-1": 0.348, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.3192, + "us-west-2": 0.0 + }, + "a1.4xlarge": { + "ap-northeast-1": 0.6864, + "ap-south-1": 0.0, + "ap-southeast-1": 0.6432, + "ap-southeast-2": 0.7056, + "eu-central-1": 0.6384, + "eu-west-1": 0.6336, + "us-east-1": 0.5808, + "us-east-2": 0.0, + "us-west-2": 0.5808 + }, + "c1.medium": { + "ap-northeast-1": 0.187, + "ap-southeast-1": 0.193, + "ap-southeast-2": 0.193, + "eu-west-1": 0.177, + "sa-east-1": 0.208, + "us-east-1": 0.16, + "us-gov-west-1": 0.186, + "us-west-1": 0.177, + "us-west-2": 0.16 + }, + "c1.xlarge": { + "ap-northeast-1": 0.747, + "ap-southeast-1": 0.77, + "ap-southeast-2": 0.77, + "eu-west-1": 0.707, + "sa-east-1": 0.833, + "us-east-1": 0.64, + "us-gov-west-1": 0.743, + "us-west-1": 0.707, + "us-west-2": 0.64 + }, + "c3.large": { + "ap-northeast-1": 0.157, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.174, + "ap-southeast-2": 0.161, + "eu-central-1": 0.158, + "eu-west-1": 0.149, + "sa-east-1": 0.192, + "us-east-1": 0.134, + "us-gov-west-1": 0.155, + "us-west-1": 0.149, + "us-west-2": 0.134 + }, + "c3.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.29, + "ap-southeast-1": 0.322, + "ap-southeast-2": 0.322, + "eu-central-1": 0.316, + "eu-west-1": 0.322, + "sa-east-1": 0.384, + "us-east-1": 0.0, + "us-gov-west-1": 0.31, + "us-west-1": 0.298, + "us-west-2": 0.268 + }, + "c3.2xlarge": { + "ap-northeast-1": 0.627, + "ap-northeast-2": 0.63589, + "ap-southeast-1": 0.643, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.595, + "sa-east-1": 0.767, + "us-east-1": 0.0, + "us-gov-west-1": 0.619, + "us-west-1": 0.595, + "us-west-2": 0.577 + }, + "c3.4xlarge": { + "ap-northeast-1": 1.197, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 1.205, + "eu-west-1": 1.229, + "sa-east-1": 1.477, + "us-east-1": 1.013, + "us-gov-west-1": 1.282, + "us-west-1": 0.0, + "us-west-2": 1.013 + }, + "c3.8xlarge": { + "ap-northeast-1": 2.394, + "ap-northeast-2": 0.0, + "ap-southeast-1": 2.458, + "ap-southeast-2": 2.458, + "eu-central-1": 0.0, + "eu-west-1": 2.266, + "sa-east-1": 2.954, + "us-east-1": 0.0, + "us-gov-west-1": 2.362, + "us-west-1": 2.266, + "us-west-2": 0.0 + }, + "c4.large": { + "ap-northeast-1": 0.155, + "ap-northeast-2": 0.154, + "ap-northeast-3": 0.155, + "ap-south-1": 0.129, + "ap-southeast-1": 0.144, + "ap-southeast-2": 0.0, + "ca-central-1": 0.15, + "eu-central-1": 0.154, + "eu-west-1": 0.142, + "eu-west-2": 0.16, + "sa-east-1": 0.184, + "us-east-1": 0.129, + "us-east-2": 0.139, + "us-gov-west-1": 0.0, + "us-west-1": 0.153, + "us-west-2": 0.129 + }, + "c4.xlarge": { + "ap-northeast-1": 0.31, + "ap-northeast-2": 0.308, + "ap-northeast-3": 0.31, + "ap-south-1": 0.258, + "ap-southeast-1": 0.311, + "ap-southeast-2": 0.318, + "ca-central-1": 0.278, + "eu-central-1": 0.286, + "eu-west-1": 0.284, + "eu-west-2": 0.296, + "sa-east-1": 0.368, + "us-east-1": 0.258, + "us-east-2": 0.258, + "us-gov-west-1": 0.322, + "us-west-1": 0.306, + "us-west-2": 0.278 + }, + "c4.2xlarge": { + "ap-northeast-1": 0.619, + "ap-northeast-2": 0.571, + "ap-northeast-3": 0.0, + "ap-south-1": 0.515, + "ap-southeast-1": 0.575, + "ap-southeast-2": 0.635, + "ca-central-1": 0.599, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.591, + "sa-east-1": 0.735, + "us-east-1": 0.515, + "us-east-2": 0.515, + "us-gov-west-1": 0.595, + "us-west-1": 0.661, + "us-west-2": 0.0 + }, + "c4.4xlarge": { + "ap-northeast-1": 1.181, + "ap-northeast-2": 1.085, + "ap-northeast-3": 1.282, + "ap-south-1": 0.973, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.317, + "ca-central-1": 1.141, + "eu-central-1": 1.085, + "eu-west-1": 1.077, + "eu-west-2": 1.125, + "sa-east-1": 1.413, + "us-east-1": 1.053, + "us-east-2": 0.973, + "us-gov-west-1": 1.133, + "us-west-1": 1.165, + "us-west-2": 0.973 + }, + "c4.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 2.405, + "ap-south-1": 1.989, + "ap-southeast-1": 2.229, + "ap-southeast-2": 2.469, + "ca-central-1": 2.149, + "eu-central-1": 2.213, + "eu-west-1": 2.197, + "eu-west-2": 2.293, + "sa-east-1": 2.869, + "us-east-1": 0.0, + "us-east-2": 1.989, + "us-gov-west-1": 2.309, + "us-west-1": 2.373, + "us-west-2": 1.989 + }, + "c5.large": { + "af-south-1": 0.15, + "ap-east-1": 0.143, + "ap-northeast-1": 0.136, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.142, + "ap-south-1": 0.119, + "ap-south-2": 0.114, + "ap-southeast-1": 0.127, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.127, + "ap-southeast-4": 0.14, + "ca-central-1": 0.122, + "ca-west-1": 0.122, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.13, + "eu-south-2": 0.125, + "eu-west-1": 0.125, + "eu-west-2": 0.136, + "eu-west-3": 0.13, + "il-central-1": 0.13, + "me-central-1": 0.134, + "me-south-1": 0.134, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.119, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.131, + "us-west-1": 0.0, + "us-west-2": 0.114, + "us-west-2-lax-1": 0.137 + }, + "c5.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.274, + "ap-northeast-1": 0.272, + "ap-northeast-2": 0.261, + "ap-northeast-3": 0.272, + "ap-south-1": 0.0, + "ap-south-2": 0.228, + "ap-southeast-1": 0.254, + "ap-southeast-2": 0.28, + "ap-southeast-3": 0.265, + "ap-southeast-4": 0.28, + "ca-central-1": 0.255, + "ca-west-1": 0.255, + "eu-central-1": 0.263, + "eu-central-2": 0.271, + "eu-north-1": 0.24, + "eu-south-1": 0.26, + "eu-south-2": 0.25, + "eu-west-1": 0.261, + "eu-west-2": 0.26, + "eu-west-3": 0.26, + "il-central-1": 0.0, + "me-central-1": 0.269, + "me-south-1": 0.269, + "sa-east-1": 0.335, + "us-east-1": 0.228, + "us-east-2": 0.0, + "us-gov-east-1": 0.262, + "us-gov-west-1": 0.0, + "us-west-1": 0.282, + "us-west-2": 0.238, + "us-west-2-lax-1": 0.262 + }, + "c5.metal": { + "af-south-1": 6.509, + "ap-east-1": 0.0, + "ap-northeast-1": 6.173, + "ap-northeast-2": 5.645, + "ap-northeast-3": 6.173, + "ap-south-1": 0.0, + "ap-south-2": 5.117, + "ap-southeast-1": 5.741, + "ap-southeast-2": 0.0, + "ap-southeast-3": 5.741, + "ap-southeast-4": 6.365, + "ca-central-1": 5.501, + "ca-west-1": 5.501, + "eu-central-1": 5.693, + "eu-central-2": 6.158, + "eu-north-1": 5.405, + "eu-south-1": 5.885, + "eu-south-2": 5.645, + "eu-west-1": 5.645, + "eu-west-2": 5.885, + "eu-west-3": 0.0, + "il-central-1": 5.875, + "me-central-1": 6.106, + "me-south-1": 6.106, + "sa-east-1": 7.325, + "us-east-1": 0.0, + "us-east-2": 5.117, + "us-gov-east-1": 5.933, + "us-gov-west-1": 0.0, + "us-west-1": 6.125, + "us-west-2": 5.117, + "us-west-2-lax-1": 0.0 + }, + "c5.2xlarge": { + "af-south-1": 0.571, + "ap-east-1": 0.0, + "ap-northeast-1": 0.543, + "ap-northeast-2": 0.522, + "ap-northeast-3": 0.543, + "ap-south-1": 0.455, + "ap-south-2": 0.0, + "ap-southeast-1": 0.507, + "ap-southeast-2": 0.559, + "ap-southeast-3": 0.507, + "ap-southeast-4": 0.559, + "ca-central-1": 0.487, + "ca-west-1": 0.51, + "eu-central-1": 0.503, + "eu-central-2": 0.542, + "eu-north-1": 0.479, + "eu-south-1": 0.519, + "eu-south-2": 0.522, + "eu-west-1": 0.499, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 0.543, + "me-central-1": 0.538, + "me-south-1": 0.538, + "sa-east-1": 0.639, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.523, + "us-west-1": 0.0, + "us-west-2": 0.455, + "us-west-2-lax-1": 0.0 + }, + "c5.4xlarge": { + "af-south-1": 1.085, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.941, + "ap-northeast-3": 1.08, + "ap-south-1": 0.853, + "ap-south-2": 0.853, + "ap-southeast-1": 0.957, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 0.917, + "ca-west-1": 0.917, + "eu-central-1": 0.0, + "eu-central-2": 1.026, + "eu-north-1": 0.944, + "eu-south-1": 1.029, + "eu-south-2": 0.987, + "eu-west-1": 0.941, + "eu-west-2": 1.029, + "eu-west-3": 0.981, + "il-central-1": 0.0, + "me-central-1": 1.018, + "me-south-1": 1.068, + "sa-east-1": 1.221, + "us-east-1": 0.853, + "us-east-2": 0.0, + "us-gov-east-1": 0.989, + "us-gov-west-1": 0.0, + "us-west-1": 1.021, + "us-west-2": 0.853, + "us-west-2-lax-1": 1.038 + }, + "c5.9xlarge": { + "af-south-1": 2.441, + "ap-east-1": 2.333, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.22, + "ap-northeast-3": 2.315, + "ap-south-1": 1.919, + "ap-south-2": 0.0, + "ap-southeast-1": 2.153, + "ap-southeast-2": 2.507, + "ap-southeast-3": 2.153, + "ap-southeast-4": 0.0, + "ca-central-1": 2.063, + "ca-west-1": 2.063, + "eu-central-1": 2.135, + "eu-central-2": 0.0, + "eu-north-1": 2.027, + "eu-south-1": 2.207, + "eu-south-2": 2.22, + "eu-west-1": 0.0, + "eu-west-2": 2.207, + "eu-west-3": 2.207, + "il-central-1": 2.203, + "me-central-1": 2.29, + "me-south-1": 2.29, + "sa-east-1": 2.888, + "us-east-1": 1.919, + "us-east-2": 1.919, + "us-gov-east-1": 2.225, + "us-gov-west-1": 2.225, + "us-west-1": 0.0, + "us-west-2": 2.011, + "us-west-2-lax-1": 0.0 + }, + "c5.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 3.266, + "ap-northeast-1": 3.086, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.24, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 2.87, + "ap-southeast-2": 3.182, + "ap-southeast-3": 0.0, + "ap-southeast-4": 3.182, + "ca-central-1": 2.75, + "ca-west-1": 2.75, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 2.702, + "eu-south-1": 2.942, + "eu-south-2": 2.822, + "eu-west-1": 2.961, + "eu-west-2": 3.088, + "eu-west-3": 2.942, + "il-central-1": 0.0, + "me-central-1": 3.053, + "me-south-1": 3.053, + "sa-east-1": 3.662, + "us-east-1": 2.558, + "us-east-2": 2.558, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.113, + "us-west-1": 0.0, + "us-west-2": 2.558, + "us-west-2-lax-1": 2.966 + }, + "c5.18xlarge": { + "af-south-1": 4.882, + "ap-east-1": 0.0, + "ap-northeast-1": 4.63, + "ap-northeast-2": 4.234, + "ap-northeast-3": 4.63, + "ap-south-1": 3.838, + "ap-south-2": 3.838, + "ap-southeast-1": 4.306, + "ap-southeast-2": 0.0, + "ap-southeast-3": 4.306, + "ap-southeast-4": 4.774, + "ca-central-1": 4.126, + "ca-west-1": 0.0, + "eu-central-1": 4.27, + "eu-central-2": 4.619, + "eu-north-1": 0.0, + "eu-south-1": 4.414, + "eu-south-2": 4.234, + "eu-west-1": 4.234, + "eu-west-2": 0.0, + "eu-west-3": 4.414, + "il-central-1": 4.406, + "me-central-1": 4.579, + "me-south-1": 4.579, + "sa-east-1": 5.494, + "us-east-1": 0.0, + "us-east-2": 3.838, + "us-gov-east-1": 4.45, + "us-gov-west-1": 4.45, + "us-west-1": 4.594, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0 + }, + "c5.24xlarge": { + "af-south-1": 6.509, + "ap-east-1": 6.221, + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.645, + "ap-northeast-3": 6.173, + "ap-south-1": 5.117, + "ap-south-2": 5.117, + "ap-southeast-1": 5.741, + "ap-southeast-2": 0.0, + "ap-southeast-3": 5.741, + "ap-southeast-4": 6.365, + "ca-central-1": 5.501, + "ca-west-1": 5.501, + "eu-central-1": 5.693, + "eu-central-2": 6.158, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 5.645, + "eu-west-1": 0.0, + "eu-west-2": 5.885, + "eu-west-3": 5.885, + "il-central-1": 5.875, + "me-central-1": 6.106, + "me-south-1": 6.106, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 5.933, + "us-gov-west-1": 5.933, + "us-west-1": 6.125, + "us-west-2": 5.117, + "us-west-2-lax-1": 5.933 + }, + "c5a.large": { + "af-south-1": 0.132, + "ap-east-1": 0.126, + "ap-northeast-1": 0.125, + "ap-northeast-2": 0.115, + "ap-south-1": 0.076, + "ap-southeast-1": 0.117, + "ap-southeast-2": 0.129, + "ca-central-1": 0.113, + "eu-central-1": 0.116, + "eu-north-1": 0.111, + "eu-south-1": 0.12, + "eu-west-1": 0.115, + "eu-west-2": 0.12, + "eu-west-3": 0.12, + "me-south-1": 0.124, + "sa-east-1": 0.147, + "us-east-1": 0.106, + "us-east-2": 0.106, + "us-gov-east-1": 0.121, + "us-gov-west-1": 0.121, + "us-west-1": 0.124, + "us-west-2": 0.106 + }, + "c5a.xlarge": { + "af-south-1": 0.264, + "ap-east-1": 0.252, + "ap-northeast-1": 0.25, + "ap-northeast-2": 0.23, + "ap-south-1": 0.152, + "ap-southeast-1": 0.234, + "ap-southeast-2": 0.258, + "ca-central-1": 0.226, + "eu-central-1": 0.232, + "eu-north-1": 0.222, + "eu-south-1": 0.24, + "eu-west-1": 0.23, + "eu-west-2": 0.24, + "eu-west-3": 0.24, + "me-south-1": 0.248, + "sa-east-1": 0.294, + "us-east-1": 0.212, + "us-east-2": 0.212, + "us-gov-east-1": 0.242, + "us-gov-west-1": 0.242, + "us-west-1": 0.248, + "us-west-2": 0.212 + }, + "c5a.2xlarge": { + "af-south-1": 0.527, + "ap-east-1": 0.503, + "ap-northeast-1": 0.499, + "ap-northeast-2": 0.459, + "ap-south-1": 0.303, + "ap-southeast-1": 0.467, + "ap-southeast-2": 0.515, + "ca-central-1": 0.451, + "eu-central-1": 0.463, + "eu-north-1": 0.443, + "eu-south-1": 0.479, + "eu-west-1": 0.459, + "eu-west-2": 0.479, + "eu-west-3": 0.479, + "me-south-1": 0.495, + "sa-east-1": 0.587, + "us-east-1": 0.423, + "us-east-2": 0.423, + "us-gov-east-1": 0.483, + "us-gov-west-1": 0.483, + "us-west-1": 0.495, + "us-west-2": 0.423 + }, + "c5a.4xlarge": { + "af-south-1": 0.997, + "ap-east-1": 0.949, + "ap-northeast-1": 0.941, + "ap-northeast-2": 0.861, + "ap-south-1": 0.549, + "ap-southeast-1": 0.877, + "ap-southeast-2": 0.973, + "ca-central-1": 0.845, + "eu-central-1": 0.869, + "eu-north-1": 0.829, + "eu-south-1": 0.901, + "eu-west-1": 0.861, + "eu-west-2": 0.901, + "eu-west-3": 0.901, + "me-south-1": 0.933, + "sa-east-1": 1.117, + "us-east-1": 0.789, + "us-east-2": 0.789, + "us-gov-east-1": 0.909, + "us-gov-west-1": 0.909, + "us-west-1": 0.933, + "us-west-2": 0.789 + }, + "c5a.8xlarge": { + "af-south-1": 1.994, + "ap-east-1": 1.898, + "ap-northeast-1": 1.882, + "ap-northeast-2": 1.722, + "ap-south-1": 1.098, + "ap-southeast-1": 1.754, + "ap-southeast-2": 1.946, + "ca-central-1": 1.69, + "eu-central-1": 1.738, + "eu-north-1": 1.658, + "eu-south-1": 1.802, + "eu-west-1": 1.722, + "eu-west-2": 1.802, + "eu-west-3": 1.802, + "me-south-1": 1.866, + "sa-east-1": 2.234, + "us-east-1": 1.578, + "us-east-2": 1.578, + "us-gov-east-1": 1.818, + "us-gov-west-1": 1.818, + "us-west-1": 1.866, + "us-west-2": 1.578 + }, + "c5a.12xlarge": { + "af-south-1": 2.99, + "ap-east-1": 2.846, + "ap-northeast-1": 2.822, + "ap-northeast-2": 2.582, + "ap-south-1": 1.646, + "ap-southeast-1": 2.63, + "ap-southeast-2": 2.918, + "ca-central-1": 2.534, + "eu-central-1": 2.606, + "eu-north-1": 2.486, + "eu-south-1": 2.702, + "eu-west-1": 2.582, + "eu-west-2": 2.702, + "eu-west-3": 2.702, + "me-south-1": 2.798, + "sa-east-1": 3.35, + "us-east-1": 2.366, + "us-east-2": 2.366, + "us-gov-east-1": 2.726, + "us-gov-west-1": 2.726, + "us-west-1": 2.798, + "us-west-2": 2.366 + }, + "c5a.16xlarge": { + "af-south-1": 3.987, + "ap-east-1": 3.795, + "ap-northeast-1": 3.763, + "ap-northeast-2": 3.443, + "ap-south-1": 2.195, + "ap-southeast-1": 3.507, + "ap-southeast-2": 3.891, + "ca-central-1": 3.379, + "eu-central-1": 3.475, + "eu-north-1": 3.315, + "eu-south-1": 3.603, + "eu-west-1": 3.443, + "eu-west-2": 3.603, + "eu-west-3": 3.603, + "me-south-1": 3.731, + "sa-east-1": 4.467, + "us-east-1": 3.155, + "us-east-2": 3.155, + "us-gov-east-1": 3.635, + "us-gov-west-1": 3.635, + "us-west-1": 3.731, + "us-west-2": 3.155 + }, + "c5a.24xlarge": { + "af-south-1": 5.981, + "ap-east-1": 5.693, + "ap-northeast-1": 5.645, + "ap-northeast-2": 5.165, + "ap-south-1": 3.293, + "ap-southeast-1": 5.261, + "ap-southeast-2": 5.837, + "ca-central-1": 5.069, + "eu-central-1": 5.213, + "eu-north-1": 4.973, + "eu-south-1": 5.405, + "eu-west-1": 5.165, + "eu-west-2": 5.405, + "eu-west-3": 5.405, + "me-south-1": 5.597, + "sa-east-1": 6.701, + "us-east-1": 4.733, + "us-east-2": 4.733, + "us-gov-east-1": 5.453, + "us-gov-west-1": 5.453, + "us-west-1": 5.597, + "us-west-2": 4.733 + }, + "c5ad.large": { + "af-south-1": 0.146, + "ap-southeast-1": 0.13, + "ap-southeast-2": 0.142, + "eu-central-1": 0.129, + "eu-south-1": 0.132, + "eu-west-1": 0.127, + "me-south-1": 0.137, + "sa-east-1": 0.163, + "us-east-1": 0.115, + "us-east-2": 0.115, + "us-west-2": 0.115 + }, + "c5ad.xlarge": { + "af-south-1": 0.292, + "ap-southeast-1": 0.26, + "ap-southeast-2": 0.284, + "eu-central-1": 0.258, + "eu-south-1": 0.264, + "eu-west-1": 0.254, + "me-south-1": 0.274, + "sa-east-1": 0.326, + "us-east-1": 0.23, + "us-east-2": 0.23, + "us-west-2": 0.23 + }, + "c5ad.2xlarge": { + "af-south-1": 0.583, + "ap-southeast-1": 0.519, + "ap-southeast-2": 0.567, + "eu-central-1": 0.515, + "eu-south-1": 0.527, + "eu-west-1": 0.507, + "me-south-1": 0.547, + "sa-east-1": 0.651, + "us-east-1": 0.459, + "us-east-2": 0.459, + "us-west-2": 0.459 + }, + "c5ad.4xlarge": { + "af-south-1": 1.109, + "ap-southeast-1": 0.981, + "ap-southeast-2": 1.077, + "eu-central-1": 0.973, + "eu-south-1": 0.997, + "eu-west-1": 0.957, + "me-south-1": 1.037, + "sa-east-1": 1.245, + "us-east-1": 0.861, + "us-east-2": 0.861, + "us-west-2": 0.861 + }, + "c5ad.8xlarge": { + "af-south-1": 2.218, + "ap-southeast-1": 1.962, + "ap-southeast-2": 2.154, + "eu-central-1": 1.946, + "eu-south-1": 1.994, + "eu-west-1": 1.914, + "me-south-1": 2.074, + "sa-east-1": 2.49, + "us-east-1": 1.722, + "us-east-2": 1.722, + "us-west-2": 1.722 + }, + "c5ad.12xlarge": { + "af-south-1": 3.326, + "ap-southeast-1": 2.942, + "ap-southeast-2": 3.23, + "eu-central-1": 2.918, + "eu-south-1": 2.99, + "eu-west-1": 2.87, + "me-south-1": 3.11, + "sa-east-1": 3.734, + "us-east-1": 2.582, + "us-east-2": 2.582, + "us-west-2": 2.582 + }, + "c5ad.16xlarge": { + "af-south-1": 4.435, + "ap-southeast-1": 3.923, + "ap-southeast-2": 4.307, + "eu-central-1": 3.891, + "eu-south-1": 3.987, + "eu-west-1": 3.827, + "me-south-1": 4.147, + "sa-east-1": 4.979, + "us-east-1": 3.443, + "us-east-2": 3.443, + "us-west-2": 3.443 + }, + "c5ad.24xlarge": { + "af-south-1": 6.653, + "ap-southeast-1": 5.885, + "ap-southeast-2": 6.461, + "eu-central-1": 5.837, + "eu-south-1": 5.981, + "eu-west-1": 5.741, + "me-south-1": 6.221, + "sa-east-1": 7.469, + "us-east-1": 5.165, + "us-east-2": 5.165, + "us-west-2": 5.165 + }, + "c5d.large": { + "af-south-1": 0.159, + "ap-east-1": 0.152, + "ap-northeast-1": 0.158, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.151, + "ap-south-1": 0.128, + "ap-south-2": 0.134, + "ap-southeast-1": 0.141, + "ap-southeast-2": 0.155, + "ap-southeast-3": 0.148, + "ap-southeast-4": 0.155, + "ca-central-1": 0.0, + "eu-central-1": 0.14, + "eu-central-2": 0.151, + "eu-north-1": 0.139, + "eu-south-1": 0.143, + "eu-south-2": 0.138, + "eu-west-1": 0.0, + "eu-west-2": 0.144, + "eu-west-3": 0.144, + "il-central-1": 0.15, + "me-central-1": 0.156, + "me-south-1": 0.156, + "sa-east-1": 0.178, + "us-east-1": 0.125, + "us-east-2": 0.125, + "us-gov-east-1": 0.152, + "us-gov-west-1": 0.145, + "us-west-1": 0.156, + "us-west-2": 0.125 + }, + "c5d.xlarge": { + "af-south-1": 0.318, + "ap-east-1": 0.304, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.278, + "ap-northeast-3": 0.302, + "ap-south-1": 0.256, + "ap-south-2": 0.0, + "ap-southeast-1": 0.295, + "ap-southeast-2": 0.325, + "ap-southeast-3": 0.295, + "ap-southeast-4": 0.325, + "ca-central-1": 0.27, + "eu-central-1": 0.293, + "eu-central-2": 0.0, + "eu-north-1": 0.266, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.301, + "il-central-1": 0.3, + "me-central-1": 0.312, + "me-south-1": 0.297, + "sa-east-1": 0.0, + "us-east-1": 0.25, + "us-east-2": 0.261, + "us-gov-east-1": 0.29, + "us-gov-west-1": 0.29, + "us-west-1": 0.0, + "us-west-2": 0.25 + }, + "c5d.metal": { + "af-south-1": 7.277, + "ap-northeast-1": 6.893, + "ap-northeast-2": 6.317, + "ap-northeast-3": 6.893, + "ap-south-1": 0.0, + "ap-south-2": 5.789, + "ap-southeast-1": 6.413, + "ap-southeast-2": 7.085, + "ap-southeast-3": 6.413, + "ap-southeast-4": 7.085, + "ca-central-1": 6.125, + "eu-central-1": 6.365, + "eu-central-2": 6.898, + "eu-north-1": 6.029, + "eu-south-1": 6.509, + "eu-south-2": 6.269, + "eu-west-1": 6.269, + "eu-west-2": 6.557, + "il-central-1": 6.53, + "me-central-1": 0.0, + "sa-east-1": 8.189, + "us-east-1": 5.645, + "us-east-2": 5.645, + "us-gov-west-1": 6.605, + "us-west-1": 6.797, + "us-west-2": 5.645 + }, + "c5d.2xlarge": { + "af-south-1": 0.635, + "ap-east-1": 0.0, + "ap-northeast-1": 0.603, + "ap-northeast-2": 0.555, + "ap-northeast-3": 0.603, + "ap-south-1": 0.511, + "ap-south-2": 0.0, + "ap-southeast-1": 0.59, + "ap-southeast-2": 0.619, + "ap-southeast-3": 0.59, + "ap-southeast-4": 0.619, + "ca-central-1": 0.565, + "eu-central-1": 0.559, + "eu-central-2": 0.604, + "eu-north-1": 0.531, + "eu-south-1": 0.0, + "eu-south-2": 0.551, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.575, + "il-central-1": 0.573, + "me-central-1": 0.595, + "me-south-1": 0.595, + "sa-east-1": 0.747, + "us-east-1": 0.499, + "us-east-2": 0.499, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.579, + "us-west-1": 0.624, + "us-west-2": 0.0 + }, + "c5d.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.157, + "ap-northeast-1": 1.207, + "ap-northeast-2": 1.106, + "ap-northeast-3": 0.0, + "ap-south-1": 0.965, + "ap-south-2": 0.0, + "ap-southeast-1": 1.069, + "ap-southeast-2": 1.181, + "ap-southeast-3": 0.0, + "ap-southeast-4": 1.181, + "ca-central-1": 1.021, + "eu-central-1": 1.061, + "eu-central-2": 1.15, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 1.045, + "eu-west-1": 1.045, + "eu-west-2": 1.093, + "eu-west-3": 1.093, + "il-central-1": 1.088, + "me-central-1": 1.132, + "me-south-1": 1.19, + "sa-east-1": 1.365, + "us-east-1": 0.941, + "us-east-2": 0.941, + "us-gov-east-1": 1.156, + "us-gov-west-1": 1.101, + "us-west-1": 1.133, + "us-west-2": 0.941 + }, + "c5d.9xlarge": { + "af-south-1": 2.729, + "ap-east-1": 2.736, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.369, + "ap-northeast-3": 2.585, + "ap-south-1": 2.171, + "ap-south-2": 2.171, + "ap-southeast-1": 2.526, + "ap-southeast-2": 2.657, + "ap-southeast-3": 2.405, + "ap-southeast-4": 2.657, + "ca-central-1": 0.0, + "eu-central-1": 2.507, + "eu-central-2": 0.0, + "eu-north-1": 2.261, + "eu-south-1": 2.441, + "eu-south-2": 2.351, + "eu-west-1": 0.0, + "eu-west-2": 2.583, + "eu-west-3": 2.459, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 2.547, + "sa-east-1": 3.232, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 2.602, + "us-gov-west-1": 0.0, + "us-west-1": 2.678, + "us-west-2": 2.117 + }, + "c5d.12xlarge": { + "af-south-1": 3.638, + "ap-northeast-1": 3.446, + "ap-northeast-2": 3.158, + "ap-northeast-3": 3.446, + "ap-south-1": 2.894, + "ap-south-2": 2.894, + "ap-southeast-1": 3.206, + "ap-southeast-2": 3.542, + "ap-southeast-3": 3.206, + "ap-southeast-4": 3.542, + "ca-central-1": 3.215, + "eu-central-1": 3.182, + "eu-central-2": 3.625, + "eu-north-1": 3.014, + "eu-south-1": 3.419, + "eu-south-2": 3.291, + "eu-west-1": 0.0, + "eu-west-2": 3.278, + "il-central-1": 3.265, + "me-central-1": 0.0, + "sa-east-1": 4.094, + "us-east-1": 2.822, + "us-east-2": 2.822, + "us-gov-west-1": 3.302, + "us-west-1": 3.398, + "us-west-2": 2.822 + }, + "c5d.18xlarge": { + "af-south-1": 5.458, + "ap-east-1": 5.206, + "ap-northeast-1": 5.17, + "ap-northeast-2": 4.738, + "ap-northeast-3": 5.17, + "ap-south-1": 4.342, + "ap-south-2": 4.342, + "ap-southeast-1": 4.81, + "ap-southeast-2": 5.314, + "ap-southeast-3": 4.81, + "ap-southeast-4": 5.314, + "ca-central-1": 4.594, + "eu-central-1": 4.774, + "eu-central-2": 5.173, + "eu-north-1": 4.522, + "eu-south-1": 0.0, + "eu-south-2": 4.702, + "eu-west-1": 0.0, + "eu-west-2": 4.918, + "eu-west-3": 4.918, + "il-central-1": 4.898, + "me-central-1": 5.094, + "me-south-1": 5.094, + "sa-east-1": 6.142, + "us-east-1": 4.234, + "us-east-2": 4.234, + "us-gov-east-1": 4.954, + "us-gov-west-1": 4.954, + "us-west-1": 5.098, + "us-west-2": 4.234 + }, + "c5d.24xlarge": { + "af-south-1": 7.277, + "ap-northeast-1": 6.893, + "ap-northeast-2": 6.317, + "ap-northeast-3": 0.0, + "ap-south-1": 5.789, + "ap-south-2": 5.789, + "ap-southeast-1": 6.413, + "ap-southeast-2": 7.085, + "ap-southeast-3": 6.413, + "ap-southeast-4": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 6.365, + "eu-central-2": 7.249, + "eu-north-1": 6.029, + "eu-south-1": 6.509, + "eu-south-2": 6.269, + "eu-west-1": 6.269, + "eu-west-2": 6.557, + "il-central-1": 6.53, + "me-central-1": 0.0, + "sa-east-1": 8.189, + "us-east-1": 5.645, + "us-east-2": 5.645, + "us-gov-west-1": 6.605, + "us-west-1": 6.797, + "us-west-2": 5.645 + }, + "c5n.large": { + "af-south-1": 0.174, + "ap-east-1": 0.172, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.151, + "ap-northeast-3": 0.165, + "ap-south-1": 0.137, + "ap-southeast-1": 0.153, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.153, + "ca-central-1": 0.154, + "eu-central-1": 0.152, + "eu-north-1": 0.145, + "eu-south-1": 0.158, + "eu-west-1": 0.151, + "eu-west-2": 0.157, + "eu-west-3": 0.157, + "me-south-1": 0.163, + "sa-east-1": 0.195, + "us-east-1": 0.137, + "us-east-2": 0.137, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.167, + "us-west-1": 0.164, + "us-west-2": 0.143 + }, + "c5n.xlarge": { + "af-south-1": 0.348, + "ap-east-1": 0.0, + "ap-northeast-1": 0.33, + "ap-northeast-2": 0.302, + "ap-northeast-3": 0.33, + "ap-south-1": 0.274, + "ap-southeast-1": 0.32, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.306, + "ca-central-1": 0.294, + "eu-central-1": 0.304, + "eu-north-1": 0.29, + "eu-south-1": 0.316, + "eu-west-1": 0.302, + "eu-west-2": 0.314, + "eu-west-3": 0.314, + "me-south-1": 0.326, + "sa-east-1": 0.39, + "us-east-1": 0.274, + "us-east-2": 0.0, + "us-gov-east-1": 0.318, + "us-gov-west-1": 0.318, + "us-west-1": 0.328, + "us-west-2": 0.274 + }, + "c5n.metal": { + "af-south-1": 6.005, + "ap-east-1": 5.926, + "ap-northeast-1": 5.674, + "ap-northeast-2": 5.17, + "ap-northeast-3": 5.674, + "ap-south-1": 4.666, + "ap-southeast-1": 5.242, + "ap-southeast-2": 5.854, + "ap-southeast-3": 0.0, + "ca-central-1": 5.026, + "eu-central-1": 5.206, + "eu-north-1": 4.954, + "eu-south-1": 5.422, + "eu-west-1": 5.17, + "eu-west-2": 5.386, + "eu-west-3": 5.386, + "me-south-1": 5.602, + "sa-east-1": 6.754, + "us-east-1": 4.666, + "us-east-2": 4.666, + "us-gov-east-1": 5.458, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 4.666 + }, + "c5n.2xlarge": { + "af-south-1": 0.696, + "ap-east-1": 0.687, + "ap-northeast-1": 0.659, + "ap-northeast-2": 0.603, + "ap-northeast-3": 0.659, + "ap-south-1": 0.547, + "ap-southeast-1": 0.611, + "ap-southeast-2": 0.679, + "ap-southeast-3": 0.611, + "ca-central-1": 0.587, + "eu-central-1": 0.637, + "eu-north-1": 0.0, + "eu-south-1": 0.631, + "eu-west-1": 0.603, + "eu-west-2": 0.627, + "eu-west-3": 0.627, + "me-south-1": 0.651, + "sa-east-1": 0.0, + "us-east-1": 0.573, + "us-east-2": 0.547, + "us-gov-east-1": 0.635, + "us-gov-west-1": 0.635, + "us-west-1": 0.655, + "us-west-2": 0.547 + }, + "c5n.4xlarge": { + "af-south-1": 1.334, + "ap-east-1": 0.0, + "ap-northeast-1": 1.326, + "ap-northeast-2": 1.149, + "ap-northeast-3": 1.261, + "ap-south-1": 1.037, + "ap-southeast-1": 1.224, + "ap-southeast-2": 1.368, + "ap-southeast-3": 1.224, + "ca-central-1": 1.117, + "eu-central-1": 1.216, + "eu-north-1": 1.156, + "eu-south-1": 1.205, + "eu-west-1": 1.149, + "eu-west-2": 1.197, + "eu-west-3": 1.197, + "me-south-1": 1.245, + "sa-east-1": 1.58, + "us-east-1": 1.089, + "us-east-2": 1.037, + "us-gov-east-1": 1.275, + "us-gov-west-1": 1.275, + "us-west-1": 1.253, + "us-west-2": 0.0 + }, + "c5n.9xlarge": { + "af-south-1": 3.159, + "ap-east-1": 2.963, + "ap-northeast-1": 2.984, + "ap-northeast-2": 2.585, + "ap-northeast-3": 2.837, + "ap-south-1": 2.333, + "ap-southeast-1": 2.621, + "ap-southeast-2": 2.927, + "ap-southeast-3": 2.621, + "ca-central-1": 2.64, + "eu-central-1": 2.603, + "eu-north-1": 2.477, + "eu-south-1": 2.711, + "eu-west-1": 2.717, + "eu-west-2": 2.693, + "eu-west-3": 2.693, + "me-south-1": 2.801, + "sa-east-1": 3.377, + "us-east-1": 2.333, + "us-east-2": 2.333, + "us-gov-east-1": 2.729, + "us-gov-west-1": 2.729, + "us-west-1": 2.965, + "us-west-2": 2.333 + }, + "c5n.18xlarge": { + "af-south-1": 0.0, + "ap-east-1": 5.926, + "ap-northeast-1": 5.674, + "ap-northeast-2": 0.0, + "ap-northeast-3": 5.674, + "ap-south-1": 4.666, + "ap-southeast-1": 5.242, + "ap-southeast-2": 5.854, + "ap-southeast-3": 5.242, + "ca-central-1": 5.026, + "eu-central-1": 5.206, + "eu-north-1": 4.954, + "eu-south-1": 5.422, + "eu-west-1": 5.17, + "eu-west-2": 5.386, + "eu-west-3": 5.386, + "me-south-1": 5.602, + "sa-east-1": 6.754, + "us-east-1": 0.0, + "us-east-2": 4.666, + "us-gov-east-1": 5.458, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 4.666 + }, + "c6a.large": { + "ap-east-1": 0.1572, + "ap-northeast-1": 0.0, + "ap-south-1": 0.07555, + "ap-south-2": 0.07555, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1287, + "ca-central-1": 0.1125, + "eu-central-1": 0.1161, + "eu-west-1": 0.11088, + "eu-west-2": 0.1197, + "sa-east-1": 0.15849, + "us-east-1": 0.11295, + "us-east-2": 0.0, + "us-west-1": 0.1242, + "us-west-2": 0.1053 + }, + "c6a.xlarge": { + "ap-east-1": 0.27384, + "ap-northeast-1": 0.2502, + "ap-south-1": 0.1511, + "ap-south-2": 0.1511, + "ap-southeast-1": 0.25164, + "ap-southeast-2": 0.2574, + "ca-central-1": 0.225, + "eu-central-1": 0.2322, + "eu-west-1": 0.23818, + "eu-west-2": 0.0, + "sa-east-1": 0.31698, + "us-east-1": 0.2259, + "us-east-2": 0.0, + "us-west-1": 0.2484, + "us-west-2": 0.2259 + }, + "c6a.metal": { + "ap-east-1": 9.4612, + "ap-northeast-1": 11.088, + "ap-south-1": 0.0, + "ap-south-2": 6.3312, + "ap-southeast-1": 10.3104, + "ap-southeast-2": 11.4336, + "ca-central-1": 9.8784, + "eu-central-1": 10.224, + "eu-west-1": 9.72288, + "eu-west-2": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 9.1872, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6a.2xlarge": { + "ap-east-1": 0.5188, + "ap-northeast-1": 0.53892, + "ap-south-1": 0.0, + "ap-south-2": 0.3022, + "ap-southeast-1": 0.468, + "ap-southeast-2": 0.5148, + "ca-central-1": 0.45, + "eu-central-1": 0.0, + "eu-west-1": 0.44352, + "eu-west-2": 0.4788, + "sa-east-1": 0.5868, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 0.4968, + "us-west-2": 0.4212 + }, + "c6a.4xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.9432, + "ap-south-1": 0.5842, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.05192, + "ca-central-1": 0.90936, + "eu-central-1": 0.94104, + "eu-west-1": 0.0, + "eu-west-2": 0.9, + "sa-east-1": 1.116, + "us-east-1": 0.7848, + "us-east-2": 0.7848, + "us-west-1": 0.936, + "us-west-2": 0.7848 + }, + "c6a.8xlarge": { + "ap-east-1": 1.6852, + "ap-northeast-1": 1.8864, + "ap-south-1": 0.0, + "ap-south-2": 1.0936, + "ap-southeast-1": 1.7568, + "ap-southeast-2": 1.944, + "ca-central-1": 1.81872, + "eu-central-1": 1.88208, + "eu-west-1": 1.65888, + "eu-west-2": 1.8, + "sa-east-1": 2.232, + "us-east-1": 1.5696, + "us-east-2": 1.5696, + "us-west-1": 1.872, + "us-west-2": 1.5696 + }, + "c6a.12xlarge": { + "ap-east-1": 2.4628, + "ap-northeast-1": 2.8296, + "ap-south-1": 1.6404, + "ap-south-2": 1.7526, + "ap-southeast-1": 2.6352, + "ap-southeast-2": 0.0, + "ca-central-1": 2.5272, + "eu-central-1": 2.6136, + "eu-west-1": 2.48832, + "eu-west-2": 0.0, + "sa-east-1": 0.0, + "us-east-1": 2.3544, + "us-east-2": 0.0, + "us-west-1": 3.03696, + "us-west-2": 2.3544 + }, + "c6a.16xlarge": { + "ap-east-1": 3.2404, + "ap-northeast-1": 3.7728, + "ap-south-1": 2.1872, + "ap-south-2": 2.3368, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 3.63744, + "eu-central-1": 3.4848, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "sa-east-1": 4.84128, + "us-east-1": 3.1392, + "us-east-2": 0.0, + "us-west-1": 3.744, + "us-west-2": 3.384 + }, + "c6a.24xlarge": { + "ap-east-1": 4.7956, + "ap-northeast-1": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 5.2704, + "ap-southeast-2": 5.832, + "ca-central-1": 5.0544, + "eu-central-1": 5.64624, + "eu-west-1": 5.37062, + "eu-west-2": 5.4, + "sa-east-1": 7.26192, + "us-east-1": 4.7088, + "us-east-2": 4.7088, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6a.32xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-south-1": 4.52, + "ap-south-2": 4.52, + "ap-southeast-1": 6.8736, + "ap-southeast-2": 7.6224, + "ca-central-1": 6.5856, + "eu-central-1": 6.816, + "eu-west-1": 6.48192, + "eu-west-2": 7.62816, + "sa-east-1": 8.7744, + "us-east-1": 6.1248, + "us-east-2": 6.1248, + "us-west-1": 7.94496, + "us-west-2": 6.1248 + }, + "c6a.48xlarge": { + "ap-east-1": 9.4612, + "ap-northeast-1": 11.088, + "ap-south-1": 6.3312, + "ap-south-2": 6.3312, + "ap-southeast-1": 10.3104, + "ap-southeast-2": 11.4336, + "ca-central-1": 9.8784, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 10.5696, + "sa-east-1": 13.1616, + "us-east-1": 9.1872, + "us-east-2": 9.1872, + "us-west-1": 11.0016, + "us-west-2": 9.1872 + }, + "c6g.medium": { + "af-south-1": 0.0, + "ap-east-1": 0.06, + "ap-northeast-1": 0.0572, + "ap-northeast-2": 0.0529, + "ap-northeast-3": 0.0574, + "ap-south-1": 0.0357, + "ap-south-2": 0.037, + "ap-southeast-1": 0.0536, + "ap-southeast-2": 0.0588, + "ap-southeast-3": 0.0536, + "ap-southeast-4": 0.0615, + "ap-southeast-5": 0.0497, + "ap-southeast-7": 0.0477, + "ca-central-1": 0.0516, + "ca-west-1": 0.0516, + "eu-central-1": 0.0555, + "eu-central-2": 0.0596, + "eu-north-1": 0.0531, + "eu-south-1": 0.0572, + "eu-south-2": 0.0509, + "eu-west-1": 0.0509, + "eu-west-2": 0.0548, + "eu-west-3": 0.0549, + "il-central-1": 0.0527, + "me-central-1": 0.0545, + "me-south-1": 0.0569, + "mx-central-1": 0.0501, + "sa-east-1": 0.0, + "us-east-1": 0.0484, + "us-east-2": 0.0484, + "us-gov-east-1": 0.0552, + "us-gov-west-1": 0.0552, + "us-west-1": 0.0568, + "us-west-2": 0.0504 + }, + "c6g.large": { + "af-south-1": 0.1255, + "ap-east-1": 0.12, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1058, + "ap-northeast-3": 0.1148, + "ap-south-1": 0.0, + "ap-south-2": 0.0714, + "ap-southeast-1": 0.1072, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1072, + "ap-southeast-4": 0.1176, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0994, + "ca-central-1": 0.1032, + "ca-west-1": 0.1077, + "eu-central-1": 0.1064, + "eu-central-2": 0.1142, + "eu-north-1": 0.1018, + "eu-south-1": 0.1144, + "eu-south-2": 0.1018, + "eu-west-1": 0.0, + "eu-west-2": 0.1096, + "eu-west-3": 0.1098, + "il-central-1": 0.1054, + "me-central-1": 0.1091, + "me-south-1": 0.1138, + "mx-central-1": 0.0, + "sa-east-1": 0.1399, + "us-east-1": 0.0968, + "us-east-2": 0.0968, + "us-gov-east-1": 0.1153, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0968 + }, + "c6g.xlarge": { + "af-south-1": 0.24, + "ap-east-1": 0.2296, + "ap-northeast-1": 0.2288, + "ap-northeast-2": 0.2208, + "ap-northeast-3": 0.2296, + "ap-south-1": 0.1428, + "ap-south-2": 0.0, + "ap-southeast-1": 0.2238, + "ap-southeast-2": 0.2352, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.2352, + "ap-southeast-5": 0.1909, + "ap-southeast-7": 0.1909, + "ca-central-1": 0.0, + "ca-west-1": 0.2153, + "eu-central-1": 0.2128, + "eu-central-2": 0.2386, + "eu-north-1": 0.2036, + "eu-south-1": 0.2192, + "eu-south-2": 0.0, + "eu-west-1": 0.2127, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 0.2108, + "me-central-1": 0.2181, + "me-south-1": 0.2276, + "mx-central-1": 0.2004, + "sa-east-1": 0.0, + "us-east-1": 0.2018, + "us-east-2": 0.0, + "us-gov-east-1": 0.2208, + "us-gov-west-1": 0.2208, + "us-west-1": 0.2272, + "us-west-2": 0.1936 + }, + "c6g.metal": { + "af-south-1": 3.6096, + "ap-east-1": 3.4432, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.1552, + "ap-northeast-3": 3.4432, + "ap-south-1": 0.0, + "ap-south-2": 2.0544, + "ap-southeast-1": 3.2, + "ap-southeast-2": 3.5328, + "ap-southeast-3": 3.2, + "ap-southeast-4": 0.0, + "ap-southeast-5": 2.8237, + "ap-southeast-7": 2.8237, + "ca-central-1": 3.072, + "ca-west-1": 3.072, + "eu-central-1": 3.1744, + "eu-central-2": 3.4227, + "eu-north-1": 3.0272, + "eu-south-1": 3.2768, + "eu-south-2": 0.0, + "eu-west-1": 3.0259, + "eu-west-2": 3.2768, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 3.2595, + "me-south-1": 3.4112, + "mx-central-1": 2.976, + "sa-east-1": 4.0448, + "us-east-1": 0.0, + "us-east-2": 2.8672, + "us-gov-east-1": 3.3024, + "us-gov-west-1": 0.0, + "us-west-1": 3.4048, + "us-west-2": 2.8672 + }, + "c6g.2xlarge": { + "af-south-1": 0.48, + "ap-east-1": 0.4592, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.4592, + "ap-south-1": 0.2856, + "ap-south-2": 0.2856, + "ap-southeast-1": 0.4288, + "ap-southeast-2": 0.4704, + "ap-southeast-3": 0.4288, + "ap-southeast-4": 0.4917, + "ap-southeast-5": 0.3818, + "ap-southeast-7": 0.3818, + "ca-central-1": 0.0, + "ca-west-1": 0.4307, + "eu-central-1": 0.4256, + "eu-central-2": 0.0, + "eu-north-1": 0.4072, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.407, + "eu-west-2": 0.4384, + "eu-west-3": 0.4584, + "il-central-1": 0.0, + "me-central-1": 0.4362, + "me-south-1": 0.0, + "mx-central-1": 0.4008, + "sa-east-1": 0.0, + "us-east-1": 0.4035, + "us-east-2": 0.3872, + "us-gov-east-1": 0.4416, + "us-gov-west-1": 0.0, + "us-west-1": 0.4748, + "us-west-2": 0.3872 + }, + "c6g.4xlarge": { + "af-south-1": 0.9462, + "ap-east-1": 0.8608, + "ap-northeast-1": 0.8576, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.5136, + "ap-south-2": 0.5136, + "ap-southeast-1": 0.8, + "ap-southeast-2": 0.8832, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.8832, + "ap-southeast-5": 0.7379, + "ap-southeast-7": 0.7059, + "ca-central-1": 0.768, + "ca-west-1": 0.8037, + "eu-central-1": 0.0, + "eu-central-2": 0.8557, + "eu-north-1": 0.7568, + "eu-south-1": 0.0, + "eu-south-2": 0.7565, + "eu-west-1": 0.7565, + "eu-west-2": 0.8192, + "eu-west-3": 0.0, + "il-central-1": 0.7856, + "me-central-1": 0.8149, + "me-south-1": 0.8936, + "mx-central-1": 0.744, + "sa-east-1": 1.0112, + "us-east-1": 0.7168, + "us-east-2": 0.7494, + "us-gov-east-1": 0.8256, + "us-gov-west-1": 0.8256, + "us-west-1": 0.8919, + "us-west-2": 0.7168 + }, + "c6g.8xlarge": { + "af-south-1": 1.8048, + "ap-east-1": 1.8048, + "ap-northeast-1": 1.7152, + "ap-northeast-2": 1.5776, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 1.0272, + "ap-southeast-1": 1.6, + "ap-southeast-2": 1.7664, + "ap-southeast-3": 1.6753, + "ap-southeast-4": 1.8516, + "ap-southeast-5": 1.4758, + "ap-southeast-7": 1.4118, + "ca-central-1": 1.536, + "ca-west-1": 1.536, + "eu-central-1": 1.5872, + "eu-central-2": 0.0, + "eu-north-1": 1.5136, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 1.513, + "eu-west-2": 1.6384, + "eu-west-3": 1.6416, + "il-central-1": 0.0, + "me-central-1": 1.6298, + "me-south-1": 1.7056, + "mx-central-1": 1.488, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 1.4336, + "us-gov-east-1": 1.6512, + "us-gov-west-1": 1.6512, + "us-west-1": 1.7838, + "us-west-2": 1.4989 + }, + "c6g.12xlarge": { + "af-south-1": 2.8385, + "ap-east-1": 2.5824, + "ap-northeast-1": 2.5728, + "ap-northeast-2": 2.3664, + "ap-northeast-3": 2.5824, + "ap-south-1": 1.5408, + "ap-south-2": 1.5408, + "ap-southeast-1": 2.4, + "ap-southeast-2": 2.6496, + "ap-southeast-3": 2.4, + "ap-southeast-4": 2.6496, + "ap-southeast-5": 2.2137, + "ap-southeast-7": 2.2137, + "ca-central-1": 2.4111, + "ca-west-1": 2.304, + "eu-central-1": 2.3808, + "eu-central-2": 2.567, + "eu-north-1": 2.2704, + "eu-south-1": 2.5738, + "eu-south-2": 2.2694, + "eu-west-1": 2.3798, + "eu-west-2": 0.0, + "eu-west-3": 2.5776, + "il-central-1": 2.3568, + "me-central-1": 2.5661, + "me-south-1": 2.5584, + "mx-central-1": 2.232, + "sa-east-1": 0.0, + "us-east-1": 2.2483, + "us-east-2": 2.1504, + "us-gov-east-1": 2.4768, + "us-gov-west-1": 0.0, + "us-west-1": 2.5536, + "us-west-2": 2.1504 + }, + "c6g.16xlarge": { + "af-south-1": 3.6096, + "ap-east-1": 3.4432, + "ap-northeast-1": 3.4304, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.4432, + "ap-south-1": 2.0544, + "ap-south-2": 2.0544, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.5328, + "ap-southeast-3": 3.2, + "ap-southeast-4": 3.5328, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.8237, + "ca-central-1": 3.072, + "ca-west-1": 3.072, + "eu-central-1": 3.1744, + "eu-central-2": 3.4227, + "eu-north-1": 3.0272, + "eu-south-1": 3.2768, + "eu-south-2": 3.0259, + "eu-west-1": 3.0259, + "eu-west-2": 3.2768, + "eu-west-3": 3.2832, + "il-central-1": 3.1424, + "me-central-1": 3.2595, + "me-south-1": 3.4112, + "mx-central-1": 2.976, + "sa-east-1": 4.0448, + "us-east-1": 2.8672, + "us-east-2": 0.0, + "us-gov-east-1": 3.3024, + "us-gov-west-1": 3.3024, + "us-west-1": 3.4048, + "us-west-2": 2.8672 + }, + "c6gd.medium": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0634, + "ap-south-1": 0.0389, + "ap-southeast-1": 0.0594, + "ap-southeast-2": 0.0649, + "ap-southeast-3": 0.0594, + "ca-central-1": 0.0568, + "eu-central-1": 0.0589, + "eu-central-2": 0.0, + "eu-north-1": 0.056, + "eu-south-2": 0.058, + "eu-west-1": 0.058, + "eu-west-2": 0.0632, + "eu-west-3": 0.0604, + "sa-east-1": 0.0739, + "us-east-1": 0.0528, + "us-east-2": 0.0528, + "us-gov-east-1": 0.0608, + "us-gov-west-1": 0.0608, + "us-west-1": 0.0624, + "us-west-2": 0.0528 + }, + "c6gd.large": { + "ap-northeast-1": 0.1268, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.1268, + "ap-south-1": 0.0807, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1298, + "ap-southeast-3": 0.1188, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.1267, + "eu-north-1": 0.112, + "eu-south-2": 0.116, + "eu-west-1": 0.1212, + "eu-west-2": 0.1208, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.1056, + "us-east-2": 0.1056, + "us-gov-east-1": 0.1216, + "us-gov-west-1": 0.1216, + "us-west-1": 0.1248, + "us-west-2": 0.1102 + }, + "c6gd.xlarge": { + "ap-northeast-1": 0.2536, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.1556, + "ap-southeast-1": 0.2376, + "ap-southeast-2": 0.2596, + "ap-southeast-3": 0.2484, + "ca-central-1": 0.2272, + "eu-central-1": 0.2356, + "eu-central-2": 0.2534, + "eu-north-1": 0.234, + "eu-south-2": 0.232, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.2416, + "sa-east-1": 0.2956, + "us-east-1": 0.2112, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.2432, + "us-west-1": 0.2612, + "us-west-2": 0.2204 + }, + "c6gd.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.5072, + "ap-northeast-3": 3.8272, + "ap-south-1": 0.0, + "ap-southeast-1": 3.5712, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ca-central-1": 3.4048, + "eu-central-1": 0.0, + "eu-central-2": 3.824, + "eu-north-1": 3.3536, + "eu-south-2": 0.0, + "eu-west-1": 3.4816, + "eu-west-2": 3.6352, + "eu-west-3": 3.6352, + "sa-east-1": 4.4992, + "us-east-1": 3.1488, + "us-east-2": 0.0, + "us-gov-east-1": 3.6608, + "us-gov-west-1": 3.6608, + "us-west-1": 3.7632, + "us-west-2": 0.0 + }, + "c6gd.2xlarge": { + "ap-northeast-1": 0.5308, + "ap-northeast-2": 0.4672, + "ap-northeast-3": 0.5072, + "ap-south-1": 0.3112, + "ap-southeast-1": 0.4752, + "ap-southeast-2": 0.5192, + "ap-southeast-3": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.4712, + "eu-central-2": 0.5068, + "eu-north-1": 0.0, + "eu-south-2": 0.464, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.4832, + "sa-east-1": 0.5912, + "us-east-1": 0.4224, + "us-east-2": 0.4224, + "us-gov-east-1": 0.4864, + "us-gov-west-1": 0.5087, + "us-west-1": 0.5224, + "us-west-2": 0.4224 + }, + "c6gd.4xlarge": { + "ap-northeast-1": 0.9568, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.9568, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ca-central-1": 0.8512, + "eu-central-1": 0.8848, + "eu-central-2": 0.956, + "eu-north-1": 0.8384, + "eu-south-2": 0.8704, + "eu-west-1": 0.9123, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.9152, + "us-gov-west-1": 0.9152, + "us-west-1": 0.9872, + "us-west-2": 0.0 + }, + "c6gd.8xlarge": { + "ap-northeast-1": 1.9136, + "ap-northeast-2": 1.7536, + "ap-northeast-3": 1.9136, + "ap-south-1": 1.1296, + "ap-southeast-1": 1.7856, + "ap-southeast-2": 2.0576, + "ap-southeast-3": 1.872, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 1.912, + "eu-north-1": 0.0, + "eu-south-2": 1.8245, + "eu-west-1": 1.8245, + "eu-west-2": 1.8176, + "eu-west-3": 1.8176, + "sa-east-1": 2.2496, + "us-east-1": 1.5744, + "us-east-2": 1.5744, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.8304, + "us-west-1": 0.0, + "us-west-2": 1.5744 + }, + "c6gd.12xlarge": { + "ap-northeast-1": 2.8704, + "ap-northeast-2": 0.0, + "ap-northeast-3": 2.8704, + "ap-south-1": 1.765, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.9424, + "ap-southeast-3": 2.6784, + "ca-central-1": 2.5536, + "eu-central-1": 2.6544, + "eu-central-2": 0.0, + "eu-north-1": 2.635, + "eu-south-2": 2.6112, + "eu-west-1": 0.0, + "eu-west-2": 2.7264, + "eu-west-3": 2.7264, + "sa-east-1": 3.3744, + "us-east-1": 0.0, + "us-east-2": 2.3616, + "us-gov-east-1": 2.7456, + "us-gov-west-1": 2.8792, + "us-west-1": 2.8224, + "us-west-2": 2.3616 + }, + "c6gd.16xlarge": { + "ap-northeast-1": 3.8272, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.8272, + "ap-south-1": 2.2592, + "ap-southeast-1": 3.5712, + "ap-southeast-2": 3.9232, + "ap-southeast-3": 3.5712, + "ca-central-1": 3.4048, + "eu-central-1": 3.5392, + "eu-central-2": 0.0, + "eu-north-1": 3.3536, + "eu-south-2": 0.0, + "eu-west-1": 3.4816, + "eu-west-2": 3.6352, + "eu-west-3": 3.6352, + "sa-east-1": 4.4992, + "us-east-1": 3.1488, + "us-east-2": 0.0, + "us-gov-east-1": 3.6608, + "us-gov-west-1": 3.6608, + "us-west-1": 0.0, + "us-west-2": 3.1488 + }, + "c6gn.medium": { + "ap-east-1": 0.07165, + "ap-northeast-1": 0.0689, + "ap-northeast-2": 0.06315, + "ap-northeast-3": 0.06901, + "ap-south-1": 0.06198, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0709, + "ap-southeast-3": 0.064, + "ap-southeast-5": 0.06069, + "ap-southeast-7": 0.05648, + "ca-central-1": 0.0617, + "ca-west-1": 0.0617, + "eu-central-1": 0.0, + "eu-north-1": 0.0609, + "eu-south-1": 0.0, + "eu-west-1": 0.0632, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 0.07076, + "me-south-1": 0.0, + "mx-central-1": 0.05976, + "sa-east-1": 0.0809, + "us-east-1": 0.0, + "us-east-2": 0.0576, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0664, + "us-west-1": 0.0684, + "us-west-2": 0.0576 + }, + "c6gn.large": { + "ap-east-1": 0.1433, + "ap-northeast-1": 0.1487, + "ap-northeast-2": 0.1263, + "ap-northeast-3": 0.0, + "ap-south-1": 0.1153, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.128, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.13286, + "ca-west-1": 0.1234, + "eu-central-1": 0.1274, + "eu-north-1": 0.1218, + "eu-south-1": 0.132, + "eu-west-1": 0.1264, + "eu-west-2": 0.1313, + "eu-west-3": 0.14155, + "il-central-1": 0.13128, + "me-south-1": 0.14672, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.1152, + "us-east-2": 0.12384, + "us-gov-east-1": 0.1328, + "us-gov-west-1": 0.1328, + "us-west-1": 0.1368, + "us-west-2": 0.1152 + }, + "c6gn.xlarge": { + "ap-east-1": 0.3095, + "ap-northeast-1": 0.2974, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.27604, + "ap-south-1": 0.0, + "ap-southeast-1": 0.2556, + "ap-southeast-2": 0.2836, + "ap-southeast-3": 0.27584, + "ap-southeast-5": 0.24275, + "ap-southeast-7": 0.22592, + "ca-central-1": 0.26572, + "ca-west-1": 0.26572, + "eu-central-1": 0.27452, + "eu-north-1": 0.2436, + "eu-south-1": 0.264, + "eu-west-1": 0.2528, + "eu-west-2": 0.2626, + "eu-west-3": 0.2831, + "il-central-1": 0.26256, + "me-south-1": 0.272, + "mx-central-1": 0.23904, + "sa-east-1": 0.3502, + "us-east-1": 0.2304, + "us-east-2": 0.24768, + "us-gov-east-1": 0.2864, + "us-gov-west-1": 0.2656, + "us-west-1": 0.2736, + "us-west-2": 0.2304 + }, + "c6gn.metal": { + "ca-central-1": 3.7184, + "eu-west-3": 4.2992 + }, + "c6gn.2xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.5512, + "ap-northeast-2": 0.5052, + "ap-northeast-3": 0.55208, + "ap-south-1": 0.4612, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.512, + "ap-southeast-5": 0.45184, + "ap-southeast-7": 0.4855, + "ca-central-1": 0.53144, + "ca-west-1": 0.4936, + "eu-central-1": 0.54904, + "eu-north-1": 0.4872, + "eu-south-1": 0.528, + "eu-west-1": 0.5056, + "eu-west-2": 0.5662, + "eu-west-3": 0.5662, + "il-central-1": 0.52512, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.7004, + "us-east-1": 0.49536, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.5312, + "us-west-1": 0.5472, + "us-west-2": 0.4608 + }, + "c6gn.4xlarge": { + "ap-east-1": 1.0888, + "ap-northeast-1": 1.132, + "ap-northeast-2": 1.0308, + "ap-northeast-3": 1.04656, + "ap-south-1": 0.934, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.1672, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.84608, + "ap-southeast-7": 0.84608, + "ca-central-1": 0.9296, + "ca-west-1": 0.0, + "eu-central-1": 1.04048, + "eu-north-1": 0.9912, + "eu-south-1": 0.9984, + "eu-west-1": 1.03168, + "eu-west-2": 1.0748, + "eu-west-3": 1.0748, + "il-central-1": 0.0, + "me-south-1": 1.11616, + "mx-central-1": 0.89856, + "sa-east-1": 1.2368, + "us-east-1": 0.864, + "us-east-2": 0.0, + "us-gov-east-1": 1.088, + "us-gov-west-1": 1.088, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6gn.8xlarge": { + "ap-east-1": 2.3608, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.0616, + "ap-northeast-3": 2.09312, + "ap-south-1": 1.7296, + "ap-southeast-1": 1.9296, + "ap-southeast-2": 2.3344, + "ap-southeast-3": 0.0, + "ap-southeast-5": 1.82682, + "ap-southeast-7": 1.69216, + "ca-central-1": 2.01056, + "ca-west-1": 1.8592, + "eu-central-1": 1.9232, + "eu-north-1": 1.8336, + "eu-south-1": 1.9968, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 1.9856, + "il-central-1": 1.98528, + "me-south-1": 2.23232, + "mx-central-1": 1.79712, + "sa-east-1": 2.4736, + "us-east-1": 1.728, + "us-east-2": 1.728, + "us-gov-east-1": 2.0096, + "us-gov-west-1": 0.0, + "us-west-1": 2.2464, + "us-west-2": 1.728 + }, + "c6gn.12xlarge": { + "ap-east-1": 3.5412, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.8584, + "ap-northeast-3": 3.40181, + "ap-south-1": 2.5944, + "ap-southeast-1": 2.8944, + "ap-southeast-2": 3.2304, + "ap-southeast-3": 2.8992, + "ap-southeast-5": 2.53824, + "ap-southeast-7": 2.53824, + "ca-central-1": 3.01584, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 2.7504, + "eu-south-1": 3.24288, + "eu-west-1": 2.8608, + "eu-west-2": 2.9784, + "eu-west-3": 3.2244, + "il-central-1": 2.97792, + "me-south-1": 3.0912, + "mx-central-1": 2.69568, + "sa-east-1": 3.7104, + "us-east-1": 2.79936, + "us-east-2": 2.592, + "us-gov-east-1": 3.264, + "us-gov-west-1": 0.0, + "us-west-1": 3.1104, + "us-west-2": 2.592 + }, + "c6gn.16xlarge": { + "ap-east-1": 4.3552, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.8112, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 3.8592, + "ap-southeast-2": 4.3072, + "ap-southeast-3": 4.18304, + "ap-southeast-5": 3.38432, + "ap-southeast-7": 3.65363, + "ca-central-1": 4.02112, + "ca-west-1": 4.02112, + "eu-central-1": 3.8464, + "eu-north-1": 3.6672, + "eu-south-1": 0.0, + "eu-west-1": 3.8144, + "eu-west-2": 0.0, + "eu-west-3": 3.9712, + "il-central-1": 3.97056, + "me-south-1": 4.1216, + "mx-central-1": 3.59424, + "sa-east-1": 5.3728, + "us-east-1": 3.456, + "us-east-2": 3.456, + "us-gov-east-1": 4.0192, + "us-gov-west-1": 4.0192, + "us-west-1": 0.0, + "us-west-2": 3.456 + }, + "c6i.large": { + "af-south-1": 0.0, + "ap-east-1": 0.1368, + "ap-northeast-1": 0.1465, + "ap-northeast-2": 0.1248, + "ap-northeast-3": 0.1358, + "ap-south-1": 0.0, + "ap-south-2": 0.1223, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.1121, + "ap-southeast-7": 0.1121, + "ca-central-1": 0.1218, + "ca-west-1": 0.1311, + "eu-central-1": 0.0, + "eu-north-1": 0.1198, + "eu-south-1": 0.0, + "eu-west-1": 0.12, + "eu-west-2": 0.1298, + "eu-west-3": 0.1298, + "il-central-1": 0.12456, + "me-south-1": 0.1344, + "mx-central-1": 0.11805, + "sa-east-1": 0.1598, + "us-east-1": 0.1138, + "us-east-2": 0.0, + "us-gov-east-1": 0.1308, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.1138 + }, + "c6i.xlarge": { + "af-south-1": 0.2856, + "ap-east-1": 0.0, + "ap-northeast-1": 0.2716, + "ap-northeast-2": 0.2496, + "ap-northeast-3": 0.2716, + "ap-south-1": 0.2276, + "ap-south-2": 0.0, + "ap-southeast-1": 0.2536, + "ap-southeast-2": 0.2796, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.2242, + "ca-central-1": 0.2436, + "ca-west-1": 0.2436, + "eu-central-1": 0.2516, + "eu-north-1": 0.2396, + "eu-south-1": 0.2596, + "eu-west-1": 0.24, + "eu-west-2": 0.0, + "eu-west-3": 0.2596, + "il-central-1": 0.24912, + "me-south-1": 0.2688, + "mx-central-1": 0.2361, + "sa-east-1": 0.3196, + "us-east-1": 0.0, + "us-east-2": 0.2276, + "us-gov-east-1": 0.2616, + "us-gov-west-1": 0.2616, + "us-west-1": 0.0, + "us-west-2": 0.2276 + }, + "c6i.metal": { + "af-south-1": 8.5248, + "ap-east-1": 8.1408, + "ap-northeast-1": 8.0768, + "ap-northeast-2": 7.3728, + "ap-northeast-3": 8.0768, + "ap-south-1": 6.6688, + "ap-south-2": 6.6688, + "ap-southeast-1": 7.5008, + "ap-southeast-2": 8.3328, + "ap-southeast-5": 0.0, + "ap-southeast-7": 6.56, + "ca-central-1": 7.1808, + "ca-west-1": 7.1808, + "eu-central-1": 0.0, + "eu-north-1": 7.0528, + "eu-south-1": 7.6928, + "eu-west-1": 7.0656, + "eu-west-2": 7.6928, + "eu-west-3": 7.6928, + "il-central-1": 7.35744, + "me-south-1": 7.9872, + "mx-central-1": 6.9408, + "sa-east-1": 9.6128, + "us-east-1": 6.6688, + "us-east-2": 6.6688, + "us-gov-east-1": 0.0, + "us-gov-west-1": 7.7568, + "us-west-1": 8.0128, + "us-west-2": 0.0 + }, + "c6i.2xlarge": { + "af-south-1": 0.5712, + "ap-east-1": 0.0, + "ap-northeast-1": 0.5432, + "ap-northeast-2": 0.4992, + "ap-northeast-3": 0.5432, + "ap-south-1": 0.4892, + "ap-south-2": 0.4552, + "ap-southeast-1": 0.5072, + "ap-southeast-2": 0.5592, + "ap-southeast-5": 0.4484, + "ap-southeast-7": 0.48172, + "ca-central-1": 0.4872, + "ca-west-1": 0.4872, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.5192, + "eu-west-3": 0.5192, + "il-central-1": 0.49824, + "me-south-1": 0.5376, + "mx-central-1": 0.4722, + "sa-east-1": 0.6916, + "us-east-1": 0.4552, + "us-east-2": 0.0, + "us-gov-east-1": 0.564, + "us-gov-west-1": 0.564, + "us-west-1": 0.5392, + "us-west-2": 0.4552 + }, + "c6i.4xlarge": { + "af-south-1": 1.0848, + "ap-east-1": 1.0368, + "ap-northeast-1": 1.0288, + "ap-northeast-2": 0.9408, + "ap-northeast-3": 1.0288, + "ap-south-1": 0.9208, + "ap-south-2": 0.8528, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.0608, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.90584, + "ca-central-1": 0.9168, + "ca-west-1": 0.9168, + "eu-central-1": 0.9488, + "eu-north-1": 0.9008, + "eu-south-1": 0.0, + "eu-west-1": 0.9024, + "eu-west-2": 0.9808, + "eu-west-3": 1.0616, + "il-central-1": 0.93888, + "me-south-1": 1.0176, + "mx-central-1": 0.9582, + "sa-east-1": 1.3256, + "us-east-1": 0.9208, + "us-east-2": 0.8528, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.0704, + "us-west-1": 1.0208, + "us-west-2": 0.8528 + }, + "c6i.8xlarge": { + "af-south-1": 2.1696, + "ap-east-1": 0.0, + "ap-northeast-1": 2.0576, + "ap-northeast-2": 1.8816, + "ap-northeast-3": 2.0576, + "ap-south-1": 1.7056, + "ap-south-2": 1.7056, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 1.6784, + "ap-southeast-7": 1.6784, + "ca-central-1": 1.8336, + "ca-west-1": 1.8336, + "eu-central-1": 0.0, + "eu-north-1": 1.8016, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 1.9616, + "eu-west-3": 1.9616, + "il-central-1": 1.87776, + "me-south-1": 2.20416, + "mx-central-1": 1.9164, + "sa-east-1": 2.6512, + "us-east-1": 1.7056, + "us-east-2": 0.0, + "us-gov-east-1": 1.9776, + "us-gov-west-1": 1.9776, + "us-west-1": 2.0416, + "us-west-2": 0.0 + }, + "c6i.12xlarge": { + "af-south-1": 3.2544, + "ap-east-1": 3.1104, + "ap-northeast-1": 3.0864, + "ap-northeast-2": 2.8224, + "ap-northeast-3": 0.0, + "ap-south-1": 2.5584, + "ap-south-2": 2.5584, + "ap-southeast-1": 3.1056, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 2.9736, + "ca-west-1": 0.0, + "eu-central-1": 2.8464, + "eu-north-1": 0.0, + "eu-south-1": 2.9424, + "eu-west-1": 2.7072, + "eu-west-2": 2.9424, + "eu-west-3": 0.0, + "il-central-1": 3.04646, + "me-south-1": 3.0528, + "mx-central-1": 2.8746, + "sa-east-1": 3.6624, + "us-east-1": 2.7624, + "us-east-2": 2.5584, + "us-gov-east-1": 2.9664, + "us-gov-west-1": 2.9664, + "us-west-1": 3.0624, + "us-west-2": 2.5584 + }, + "c6i.16xlarge": { + "af-south-1": 4.3392, + "ap-east-1": 0.0, + "ap-northeast-1": 4.1152, + "ap-northeast-2": 3.7632, + "ap-northeast-3": 4.4576, + "ap-south-1": 3.4112, + "ap-south-2": 0.0, + "ap-southeast-1": 4.1408, + "ap-southeast-2": 0.0, + "ap-southeast-5": 3.3568, + "ap-southeast-7": 3.3568, + "ca-central-1": 3.9648, + "ca-west-1": 3.6672, + "eu-central-1": 4.1056, + "eu-north-1": 0.0, + "eu-south-1": 3.9232, + "eu-west-1": 3.90144, + "eu-west-2": 3.9232, + "eu-west-3": 3.9232, + "il-central-1": 3.75552, + "me-south-1": 0.0, + "mx-central-1": 3.5472, + "sa-east-1": 4.8832, + "us-east-1": 0.0, + "us-east-2": 3.4112, + "us-gov-east-1": 4.2816, + "us-gov-west-1": 4.2816, + "us-west-1": 4.0832, + "us-west-2": 3.4112 + }, + "c6i.24xlarge": { + "af-south-1": 6.5088, + "ap-east-1": 6.2208, + "ap-northeast-1": 6.1728, + "ap-northeast-2": 5.6448, + "ap-northeast-3": 6.1728, + "ap-south-1": 5.1168, + "ap-south-2": 0.0, + "ap-southeast-1": 5.7408, + "ap-southeast-2": 6.3648, + "ap-southeast-5": 5.43504, + "ap-southeast-7": 5.0352, + "ca-central-1": 5.9472, + "ca-west-1": 5.9472, + "eu-central-1": 6.1584, + "eu-north-1": 5.4048, + "eu-south-1": 5.8848, + "eu-west-1": 0.0, + "eu-west-2": 5.8848, + "eu-west-3": 5.8848, + "il-central-1": 6.09293, + "me-south-1": 6.1056, + "mx-central-1": 5.3208, + "sa-east-1": 0.0, + "us-east-1": 5.1168, + "us-east-2": 5.5248, + "us-gov-east-1": 5.9328, + "us-gov-west-1": 5.9328, + "us-west-1": 6.6336, + "us-west-2": 5.1168 + }, + "c6i.32xlarge": { + "af-south-1": 0.0, + "ap-east-1": 8.1408, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 6.6688, + "ap-south-2": 6.6688, + "ap-southeast-1": 7.5008, + "ap-southeast-2": 0.0, + "ap-southeast-5": 6.56, + "ap-southeast-7": 6.56, + "ca-central-1": 7.1808, + "ca-west-1": 7.1808, + "eu-central-1": 7.4368, + "eu-north-1": 0.0, + "eu-south-1": 7.6928, + "eu-west-1": 7.0656, + "eu-west-2": 7.6928, + "eu-west-3": 7.6928, + "il-central-1": 0.0, + "me-south-1": 7.9872, + "mx-central-1": 0.0, + "sa-east-1": 9.6128, + "us-east-1": 6.6688, + "us-east-2": 6.6688, + "us-gov-east-1": 0.0, + "us-gov-west-1": 7.7568, + "us-west-1": 0.0, + "us-west-2": 6.6688 + }, + "c6id.large": { + "ap-northeast-1": 0.1569, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.13876, + "ap-southeast-7": 0.12876, + "ca-central-1": 0.1401, + "ca-west-1": 0.0, + "eu-central-1": 0.14535, + "eu-west-1": 0.1547, + "eu-west-2": 0.14955, + "il-central-1": 0.14897, + "mx-central-1": 0.13464, + "sa-east-1": 0.18525, + "us-east-1": 0.0, + "us-east-2": 0.13968, + "us-gov-west-1": 0.1506, + "us-west-2": 0.13968 + }, + "c6id.xlarge": { + "ap-northeast-1": 0.3138, + "ap-northeast-2": 0.2886, + "ap-southeast-1": 0.31632, + "ap-southeast-2": 0.34866, + "ap-southeast-5": 0.27751, + "ap-southeast-7": 0.27751, + "ca-central-1": 0.2802, + "ca-west-1": 0.2802, + "eu-central-1": 0.2907, + "eu-west-1": 0.2865, + "eu-west-2": 0.2991, + "il-central-1": 0.0, + "mx-central-1": 0.29045, + "sa-east-1": 0.3705, + "us-east-1": 0.0, + "us-east-2": 0.27936, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6id.metal": { + "ap-northeast-1": 9.4272, + "ap-northeast-2": 8.6208, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 7.62624, + "ap-southeast-7": 7.62624, + "ca-central-1": 8.352, + "ca-west-1": 8.352, + "eu-central-1": 8.688, + "eu-west-1": 8.5536, + "eu-west-2": 8.9568, + "il-central-1": 8.91968, + "mx-central-1": 0.0, + "sa-east-1": 11.2416, + "us-east-1": 7.68, + "us-east-2": 0.0, + "us-gov-west-1": 9.024, + "us-west-2": 7.68 + }, + "c6id.2xlarge": { + "ap-northeast-1": 0.6276, + "ap-northeast-2": 0.6234, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.6444, + "ap-southeast-5": 0.51504, + "ap-southeast-7": 0.51504, + "ca-central-1": 0.0, + "ca-west-1": 0.5604, + "eu-central-1": 0.5814, + "eu-west-1": 0.573, + "eu-west-2": 0.5982, + "il-central-1": 0.59588, + "mx-central-1": 0.53856, + "sa-east-1": 0.741, + "us-east-1": 0.55872, + "us-east-2": 0.5184, + "us-gov-west-1": 0.6024, + "us-west-2": 0.55872 + }, + "c6id.4xlarge": { + "ap-northeast-1": 1.1976, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.33704, + "ap-southeast-5": 0.97248, + "ap-southeast-7": 1.05245, + "ca-central-1": 1.0632, + "ca-west-1": 1.0632, + "eu-central-1": 0.0, + "eu-west-1": 1.0884, + "eu-west-2": 1.2354, + "il-central-1": 1.2303, + "mx-central-1": 0.0, + "sa-east-1": 1.4244, + "us-east-1": 0.9792, + "us-east-2": 1.05984, + "us-gov-west-1": 1.1472, + "us-west-2": 0.9792 + }, + "c6id.8xlarge": { + "ap-northeast-1": 2.3952, + "ap-northeast-2": 2.1936, + "ap-southeast-1": 2.2272, + "ap-southeast-2": 2.4624, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.94496, + "ca-central-1": 2.1264, + "ca-west-1": 2.30448, + "eu-central-1": 2.39688, + "eu-west-1": 0.0, + "eu-west-2": 2.4708, + "il-central-1": 2.26832, + "mx-central-1": 2.03904, + "sa-east-1": 2.8488, + "us-east-1": 0.0, + "us-east-2": 1.9584, + "us-gov-west-1": 2.2944, + "us-west-2": 0.0 + }, + "c6id.12xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.5676, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.6936, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.91744, + "ca-central-1": 3.45672, + "ca-west-1": 3.1896, + "eu-central-1": 3.3156, + "eu-west-1": 3.2652, + "eu-west-2": 3.4164, + "il-central-1": 3.40248, + "mx-central-1": 3.31258, + "sa-east-1": 4.2732, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 3.73392, + "us-west-2": 0.0 + }, + "c6id.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.3872, + "ap-southeast-1": 4.4544, + "ap-southeast-2": 4.9248, + "ap-southeast-5": 3.88992, + "ap-southeast-7": 0.0, + "ca-central-1": 4.60896, + "ca-west-1": 4.60896, + "eu-central-1": 4.79376, + "eu-west-1": 4.71984, + "eu-west-2": 0.0, + "il-central-1": 4.92118, + "mx-central-1": 4.07808, + "sa-east-1": 6.19824, + "us-east-1": 3.9168, + "us-east-2": 3.9168, + "us-gov-west-1": 4.5888, + "us-west-2": 0.0 + }, + "c6id.24xlarge": { + "ap-northeast-1": 7.1856, + "ap-northeast-2": 6.5808, + "ap-southeast-1": 6.6816, + "ap-southeast-2": 7.3872, + "ap-southeast-5": 5.83488, + "ap-southeast-7": 5.83488, + "ca-central-1": 6.91344, + "ca-west-1": 0.0, + "eu-central-1": 6.6312, + "eu-west-1": 6.5304, + "eu-west-2": 0.0, + "il-central-1": 6.80496, + "mx-central-1": 6.11712, + "sa-east-1": 8.5464, + "us-east-1": 5.8752, + "us-east-2": 5.8752, + "us-gov-west-1": 7.46784, + "us-west-2": 6.35904 + }, + "c6id.32xlarge": { + "ap-northeast-1": 9.4272, + "ap-northeast-2": 8.6208, + "ap-southeast-1": 8.7552, + "ap-southeast-2": 9.696, + "ap-southeast-5": 7.62624, + "ap-southeast-7": 7.62624, + "ca-central-1": 8.352, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 8.5536, + "eu-west-2": 0.0, + "il-central-1": 8.91968, + "mx-central-1": 8.00256, + "sa-east-1": 0.0, + "us-east-1": 7.68, + "us-east-2": 7.68, + "us-gov-west-1": 9.024, + "us-west-2": 7.68 + }, + "c6in.large": { + "af-south-1": 0.18126, + "ap-east-1": 0.17895, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.16971, + "ap-south-1": 0.0, + "ap-south-2": 0.1421, + "ap-southeast-1": 0.17202, + "ap-southeast-2": 0.17685, + "ap-southeast-3": 0.159, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.13947, + "ca-central-1": 0.1527, + "eu-central-1": 0.0, + "eu-central-2": 0.1711, + "eu-north-1": 0.0, + "eu-south-1": 0.16425, + "eu-south-2": 0.1568, + "eu-west-1": 0.0, + "eu-west-2": 0.1632, + "eu-west-3": 0.1632, + "il-central-1": 0.16331, + "me-central-1": 0.18368, + "me-south-1": 0.18357, + "sa-east-1": 0.0, + "us-east-1": 0.1422, + "us-east-2": 0.0, + "us-gov-east-1": 0.1653, + "us-gov-west-1": 0.1653, + "us-west-1": 0.0, + "us-west-2": 0.1422 + }, + "c6in.xlarge": { + "af-south-1": 0.39301, + "ap-east-1": 0.0, + "ap-northeast-1": 0.3432, + "ap-northeast-2": 0.33942, + "ap-south-1": 0.2844, + "ap-south-2": 0.2842, + "ap-southeast-1": 0.318, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.34404, + "ap-southeast-4": 0.3832, + "ap-southeast-5": 0.0, + "ca-central-1": 0.3054, + "eu-central-1": 0.34173, + "eu-central-2": 0.3422, + "eu-north-1": 0.3012, + "eu-south-1": 0.35559, + "eu-south-2": 0.3136, + "eu-west-1": 0.3138, + "eu-west-2": 0.0, + "eu-west-3": 0.3264, + "il-central-1": 0.35352, + "me-central-1": 0.0, + "me-south-1": 0.36714, + "sa-east-1": 0.4062, + "us-east-1": 0.2844, + "us-east-2": 0.2844, + "us-gov-east-1": 0.3306, + "us-gov-west-1": 0.0, + "us-west-1": 0.3411, + "us-west-2": 0.2844 + }, + "c6in.metal": { + "af-south-1": 10.98624, + "ap-east-1": 10.8384, + "ap-northeast-1": 10.368, + "ap-northeast-2": 9.4272, + "ap-south-1": 8.4864, + "ap-south-2": 8.48, + "ap-southeast-1": 9.5616, + "ap-southeast-2": 10.704, + "ap-southeast-3": 0.0, + "ap-southeast-4": 10.7008, + "ap-southeast-5": 8.31168, + "ca-central-1": 9.1584, + "eu-central-1": 0.0, + "eu-central-2": 10.336, + "eu-north-1": 9.024, + "eu-south-1": 9.8976, + "eu-south-2": 9.4208, + "eu-west-1": 9.4272, + "eu-west-2": 9.8304, + "eu-west-3": 9.8304, + "il-central-1": 9.83744, + "me-central-1": 10.24, + "me-south-1": 10.2336, + "sa-east-1": 12.384, + "us-east-1": 0.0, + "us-east-2": 8.4864, + "us-gov-east-1": 9.9648, + "us-gov-west-1": 0.0, + "us-west-1": 10.3008, + "us-west-2": 8.4864 + }, + "c6in.2xlarge": { + "af-south-1": 0.78602, + "ap-east-1": 0.77586, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 0.61416, + "ap-south-2": 0.5684, + "ap-southeast-1": 0.636, + "ap-southeast-2": 0.7074, + "ap-southeast-3": 0.636, + "ap-southeast-4": 0.7072, + "ap-southeast-5": 0.55788, + "ca-central-1": 0.66036, + "eu-central-1": 0.0, + "eu-central-2": 0.6844, + "eu-north-1": 0.65112, + "eu-south-1": 0.0, + "eu-south-2": 0.6272, + "eu-west-1": 0.0, + "eu-west-2": 0.6528, + "eu-west-3": 0.6528, + "il-central-1": 0.0, + "me-central-1": 0.6784, + "me-south-1": 0.0, + "sa-east-1": 0.8124, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.7158, + "us-west-1": 0.6822, + "us-west-2": 0.5688 + }, + "c6in.4xlarge": { + "af-south-1": 1.39248, + "ap-east-1": 1.374, + "ap-northeast-1": 1.3152, + "ap-northeast-2": 1.30008, + "ap-south-1": 1.17072, + "ap-south-2": 1.0792, + "ap-southeast-1": 1.2144, + "ap-southeast-2": 1.47564, + "ap-southeast-3": 1.2144, + "ap-southeast-4": 1.3568, + "ap-southeast-5": 1.05816, + "ca-central-1": 1.26312, + "eu-central-1": 1.206, + "eu-central-2": 0.0, + "eu-north-1": 1.1472, + "eu-south-1": 1.2564, + "eu-south-2": 1.1968, + "eu-west-1": 0.0, + "eu-west-2": 1.248, + "eu-west-3": 0.0, + "il-central-1": 1.24888, + "me-central-1": 1.2992, + "me-south-1": 1.41096, + "sa-east-1": 0.0, + "us-east-1": 1.17072, + "us-east-2": 1.08, + "us-gov-east-1": 1.374, + "us-gov-west-1": 1.2648, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6in.8xlarge": { + "af-south-1": 3.0289, + "ap-east-1": 2.748, + "ap-northeast-1": 2.6304, + "ap-northeast-2": 0.0, + "ap-south-1": 2.16, + "ap-south-2": 2.1584, + "ap-southeast-1": 2.4288, + "ap-southeast-2": 2.7144, + "ap-southeast-3": 2.63712, + "ap-southeast-4": 2.7136, + "ap-southeast-5": 2.11632, + "ca-central-1": 2.52624, + "eu-central-1": 2.412, + "eu-central-2": 2.6224, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 2.5984, + "eu-west-1": 2.3952, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 2.49776, + "me-central-1": 2.5984, + "me-south-1": 2.5968, + "sa-east-1": 3.41328, + "us-east-1": 2.16, + "us-east-2": 2.16, + "us-gov-east-1": 2.5296, + "us-gov-west-1": 0.0, + "us-west-1": 2.6136, + "us-west-2": 2.16 + }, + "c6in.12xlarge": { + "af-south-1": 4.17744, + "ap-east-1": 4.122, + "ap-northeast-1": 4.28832, + "ap-northeast-2": 3.5928, + "ap-south-1": 3.24, + "ap-south-2": 3.2376, + "ap-southeast-1": 3.6432, + "ap-southeast-2": 4.0716, + "ap-southeast-3": 3.6432, + "ap-southeast-4": 0.0, + "ap-southeast-5": 3.17448, + "ca-central-1": 3.492, + "eu-central-1": 0.0, + "eu-central-2": 4.27512, + "eu-north-1": 3.4416, + "eu-south-1": 4.09428, + "eu-south-2": 0.0, + "eu-west-1": 3.90024, + "eu-west-2": 3.744, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 3.8976, + "me-south-1": 3.8952, + "sa-east-1": 0.0, + "us-east-1": 3.51216, + "us-east-2": 3.51216, + "us-gov-east-1": 3.7944, + "us-gov-west-1": 0.0, + "us-west-1": 3.9204, + "us-west-2": 0.0 + }, + "c6in.16xlarge": { + "af-south-1": 5.56992, + "ap-east-1": 5.496, + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.7904, + "ap-south-1": 4.32, + "ap-south-2": 4.3168, + "ap-southeast-1": 5.27424, + "ap-southeast-2": 5.4288, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 4.23264, + "ca-central-1": 4.656, + "eu-central-1": 4.824, + "eu-central-2": 5.2448, + "eu-north-1": 4.5888, + "eu-south-1": 5.0256, + "eu-south-2": 4.7872, + "eu-west-1": 4.7904, + "eu-west-2": 5.42208, + "eu-west-3": 4.992, + "il-central-1": 4.99552, + "me-central-1": 5.64736, + "me-south-1": 5.1936, + "sa-east-1": 6.2688, + "us-east-1": 4.32, + "us-east-2": 4.32, + "us-gov-east-1": 5.0592, + "us-gov-west-1": 0.0, + "us-west-1": 5.2272, + "us-west-2": 4.32 + }, + "c6in.24xlarge": { + "af-south-1": 8.35488, + "ap-east-1": 8.96472, + "ap-northeast-1": 8.57664, + "ap-northeast-2": 7.1856, + "ap-south-1": 6.48, + "ap-south-2": 6.4752, + "ap-southeast-1": 7.2864, + "ap-southeast-2": 8.1432, + "ap-southeast-3": 0.0, + "ap-southeast-4": 8.1408, + "ap-southeast-5": 0.0, + "ca-central-1": 6.984, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 8.18856, + "eu-south-2": 7.1808, + "eu-west-1": 7.1856, + "eu-west-2": 0.0, + "eu-west-3": 7.488, + "il-central-1": 0.0, + "me-central-1": 7.7952, + "me-south-1": 7.7904, + "sa-east-1": 9.4032, + "us-east-1": 7.02432, + "us-east-2": 6.48, + "us-gov-east-1": 8.244, + "us-gov-west-1": 0.0, + "us-west-1": 7.8408, + "us-west-2": 6.48 + }, + "c6in.32xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 10.368, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 8.48, + "ap-southeast-1": 9.5616, + "ap-southeast-2": 10.704, + "ap-southeast-3": 9.5616, + "ap-southeast-4": 10.7008, + "ap-southeast-5": 0.0, + "ca-central-1": 9.1584, + "eu-central-1": 0.0, + "eu-central-2": 10.336, + "eu-north-1": 9.024, + "eu-south-1": 9.8976, + "eu-south-2": 9.4208, + "eu-west-1": 9.4272, + "eu-west-2": 0.0, + "eu-west-3": 9.8304, + "il-central-1": 9.83744, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 8.4864, + "us-east-2": 0.0, + "us-gov-east-1": 9.9648, + "us-gov-west-1": 0.0, + "us-west-1": 10.3008, + "us-west-2": 0.0 + }, + "c7a.medium": { + "ap-northeast-1": 0.08546, + "eu-central-1": 0.07297, + "eu-north-1": 0.06934, + "eu-south-2": 0.0, + "eu-west-1": 0.06946, + "us-east-1": 0.06572, + "us-east-2": 0.07085, + "us-west-2": 0.06572 + }, + "c7a.large": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.14593, + "eu-north-1": 0.14967, + "eu-south-2": 0.14472, + "eu-west-1": 0.0, + "us-east-1": 0.13144, + "us-east-2": 0.1417, + "us-west-2": 0.13144 + }, + "c7a.xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.31529, + "eu-north-1": 0.27736, + "eu-south-2": 0.28944, + "eu-west-1": 0.27784, + "us-east-1": 0.26288, + "us-east-2": 0.26288, + "us-west-2": 0.26288 + }, + "c7a.metal-48xl": { + "ap-northeast-1": 14.2464, + "eu-central-1": 13.08768, + "eu-north-1": 12.39168, + "eu-south-2": 12.97152, + "eu-west-1": 12.41472, + "us-east-1": 11.69664, + "us-east-2": 11.69664, + "us-west-2": 0.0 + }, + "c7a.2xlarge": { + "ap-northeast-1": 0.632, + "eu-central-1": 0.58372, + "eu-north-1": 0.55472, + "eu-south-2": 0.57888, + "eu-west-1": 0.55568, + "us-east-1": 0.52576, + "us-east-2": 0.52576, + "us-west-2": 0.52576 + }, + "c7a.4xlarge": { + "ap-northeast-1": 1.2064, + "eu-central-1": 0.0, + "eu-north-1": 1.05184, + "eu-south-2": 1.10016, + "eu-west-1": 1.14186, + "us-east-1": 0.99392, + "us-east-2": 0.99392, + "us-west-2": 0.99392 + }, + "c7a.8xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 2.21968, + "eu-north-1": 2.10368, + "eu-south-2": 2.20032, + "eu-west-1": 2.10752, + "us-east-1": 1.98784, + "us-east-2": 2.15206, + "us-west-2": 1.98784 + }, + "c7a.12xlarge": { + "ap-northeast-1": 3.6192, + "eu-central-1": 3.61063, + "eu-north-1": 0.0, + "eu-south-2": 3.30048, + "eu-west-1": 3.16128, + "us-east-1": 2.98176, + "us-east-2": 0.0, + "us-west-2": 3.2281 + }, + "c7a.16xlarge": { + "ap-northeast-1": 4.8256, + "eu-central-1": 4.81418, + "eu-north-1": 4.20736, + "eu-south-2": 4.40064, + "eu-west-1": 4.21504, + "us-east-1": 4.30413, + "us-east-2": 3.97568, + "us-west-2": 3.97568 + }, + "c7a.24xlarge": { + "ap-northeast-1": 7.85856, + "eu-central-1": 6.65904, + "eu-north-1": 6.83846, + "eu-south-2": 6.60096, + "eu-west-1": 6.32256, + "us-east-1": 6.45619, + "us-east-2": 5.96352, + "us-west-2": 5.96352 + }, + "c7a.32xlarge": { + "ap-northeast-1": 9.4976, + "eu-central-1": 0.0, + "eu-north-1": 8.26112, + "eu-south-2": 0.0, + "eu-west-1": 8.27648, + "us-east-1": 0.0, + "us-east-2": 8.45466, + "us-west-2": 7.79776 + }, + "c7a.48xlarge": { + "ap-northeast-1": 14.2464, + "eu-central-1": 0.0, + "eu-north-1": 12.39168, + "eu-south-2": 0.0, + "eu-west-1": 12.41472, + "us-east-1": 11.69664, + "us-east-2": 11.69664, + "us-west-2": 0.0 + }, + "c7g.medium": { + "ap-east-1": 0.0599, + "ap-northeast-1": 0.0627, + "ap-northeast-2": 0.0578, + "ap-northeast-3": 0.0599, + "ap-south-1": 0.0389, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0587, + "ap-southeast-2": 0.0616, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.0556, + "eu-central-2": 0.0626, + "eu-north-1": 0.0531, + "eu-south-1": 0.0572, + "eu-south-2": 0.0, + "eu-west-1": 0.0532, + "eu-west-2": 0.06, + "eu-west-3": 0.0573, + "mx-central-1": 0.0525, + "sa-east-1": 0.0699, + "us-east-1": 0.0507, + "us-east-2": 0.0528, + "us-gov-east-1": 0.0578, + "us-gov-west-1": 0.0605, + "us-west-1": 0.0623, + "us-west-2": 0.0507 + }, + "c7g.large": { + "ap-east-1": 0.1198, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1155, + "ap-northeast-3": 0.1198, + "ap-south-1": 0.0779, + "ap-south-2": 0.0779, + "ap-southeast-1": 0.1121, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0996, + "ap-southeast-7": 0.0996, + "ca-central-1": 0.1079, + "eu-central-1": 0.1113, + "eu-central-2": 0.1195, + "eu-north-1": 0.1062, + "eu-south-1": 0.1144, + "eu-south-2": 0.1063, + "eu-west-1": 0.1063, + "eu-west-2": 0.1147, + "eu-west-3": 0.0, + "mx-central-1": 0.1049, + "sa-east-1": 0.0, + "us-east-1": 0.1013, + "us-east-2": 0.1011, + "us-gov-east-1": 0.121, + "us-gov-west-1": 0.0, + "us-west-1": 0.1189, + "us-west-2": 0.1013 + }, + "c7g.xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.2509, + "ap-northeast-2": 0.2208, + "ap-northeast-3": 0.2395, + "ap-south-1": 0.1558, + "ap-south-2": 0.0, + "ap-southeast-1": 0.2242, + "ap-southeast-2": 0.2463, + "ap-southeast-5": 0.1992, + "ap-southeast-7": 0.1992, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.239, + "eu-north-1": 0.2221, + "eu-south-1": 0.2397, + "eu-south-2": 0.2126, + "eu-west-1": 0.2126, + "eu-west-2": 0.2293, + "eu-west-3": 0.2293, + "mx-central-1": 0.2098, + "sa-east-1": 0.2798, + "us-east-1": 0.2117, + "us-east-2": 0.2112, + "us-gov-east-1": 0.2419, + "us-gov-west-1": 0.231, + "us-west-1": 0.2378, + "us-west-2": 0.2026 + }, + "c7g.metal": { + "ap-east-1": 3.6032, + "ap-northeast-1": 3.6019, + "ap-northeast-2": 3.3024, + "ap-northeast-3": 3.6016, + "ap-south-1": 2.2618, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.7107, + "ap-southeast-5": 2.9568, + "ap-southeast-7": 2.9568, + "ca-central-1": 3.2211, + "eu-central-1": 3.3296, + "eu-central-2": 3.5936, + "eu-north-1": 3.1667, + "eu-south-1": 3.4319, + "eu-south-2": 3.1712, + "eu-west-1": 3.1718, + "eu-west-2": 3.4387, + "eu-west-3": 3.4387, + "mx-central-1": 3.127, + "sa-east-1": 4.2458, + "us-east-1": 3.0112, + "us-east-2": 3.0035, + "us-gov-east-1": 3.4656, + "us-gov-west-1": 3.4656, + "us-west-1": 0.0, + "us-west-2": 3.0112 + }, + "c7g.2xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.479, + "ap-northeast-2": 0.4416, + "ap-northeast-3": 0.0, + "ap-south-1": 0.3239, + "ap-south-2": 0.3115, + "ap-southeast-1": 0.4484, + "ap-southeast-2": 0.4926, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.4163, + "ca-central-1": 0.4314, + "eu-central-1": 0.4657, + "eu-central-2": 0.0, + "eu-north-1": 0.4246, + "eu-south-1": 0.4578, + "eu-south-2": 0.4252, + "eu-west-1": 0.4253, + "eu-west-2": 0.4802, + "eu-west-3": 0.0, + "mx-central-1": 0.4197, + "sa-east-1": 0.5595, + "us-east-1": 0.4052, + "us-east-2": 0.4224, + "us-gov-east-1": 0.462, + "us-gov-west-1": 0.462, + "us-west-1": 0.4756, + "us-west-2": 0.4234 + }, + "c7g.4xlarge": { + "ap-east-1": 0.9472, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.8667, + "ap-northeast-3": 0.9004, + "ap-south-1": 0.0, + "ap-south-2": 0.5902, + "ap-southeast-1": 0.8392, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.7392, + "ap-southeast-7": 0.0, + "ca-central-1": 0.8053, + "eu-central-1": 0.8324, + "eu-central-2": 0.8984, + "eu-north-1": 0.0, + "eu-south-1": 0.858, + "eu-south-2": 0.8318, + "eu-west-1": 0.793, + "eu-west-2": 0.0, + "eu-west-3": 0.8597, + "mx-central-1": 0.7818, + "sa-east-1": 1.1175, + "us-east-1": 0.7892, + "us-east-2": 0.7509, + "us-gov-east-1": 0.8664, + "us-gov-west-1": 0.8664, + "us-west-1": 0.9389, + "us-west-2": 0.7528 + }, + "c7g.8xlarge": { + "ap-east-1": 1.8016, + "ap-northeast-1": 1.801, + "ap-northeast-2": 1.6512, + "ap-northeast-3": 0.0, + "ap-south-1": 1.1309, + "ap-south-2": 0.0, + "ap-southeast-1": 1.6784, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.4784, + "ca-central-1": 1.6106, + "eu-central-1": 1.6648, + "eu-central-2": 1.7968, + "eu-north-1": 1.5834, + "eu-south-1": 1.716, + "eu-south-2": 1.5856, + "eu-west-1": 1.6641, + "eu-west-2": 1.8057, + "eu-west-3": 1.7194, + "mx-central-1": 1.5635, + "sa-east-1": 2.1229, + "us-east-1": 1.5056, + "us-east-2": 1.5018, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 1.7872, + "us-west-2": 1.5784 + }, + "c7g.12xlarge": { + "ap-east-1": 2.7024, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.4768, + "ap-northeast-3": 2.7012, + "ap-south-1": 1.6963, + "ap-south-2": 1.6963, + "ap-southeast-1": 2.6439, + "ap-southeast-2": 2.783, + "ap-southeast-5": 2.2176, + "ap-southeast-7": 0.0, + "ca-central-1": 2.4158, + "eu-central-1": 2.4972, + "eu-central-2": 2.8319, + "eu-north-1": 2.375, + "eu-south-1": 2.574, + "eu-south-2": 2.3784, + "eu-west-1": 2.3789, + "eu-west-2": 0.0, + "eu-west-3": 2.579, + "mx-central-1": 2.3453, + "sa-east-1": 3.1843, + "us-east-1": 2.3676, + "us-east-2": 2.2526, + "us-gov-east-1": 2.5992, + "us-gov-west-1": 2.5992, + "us-west-1": 2.6808, + "us-west-2": 0.0 + }, + "c7g.16xlarge": { + "ap-east-1": 3.6032, + "ap-northeast-1": 3.6019, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.6016, + "ap-south-1": 2.2618, + "ap-south-2": 2.2618, + "ap-southeast-1": 3.3568, + "ap-southeast-2": 3.7107, + "ap-southeast-5": 2.9568, + "ap-southeast-7": 0.0, + "ca-central-1": 3.2211, + "eu-central-1": 3.3296, + "eu-central-2": 3.5936, + "eu-north-1": 3.1667, + "eu-south-1": 0.0, + "eu-south-2": 3.1712, + "eu-west-1": 3.1718, + "eu-west-2": 0.0, + "eu-west-3": 3.4387, + "mx-central-1": 3.127, + "sa-east-1": 4.2458, + "us-east-1": 3.0112, + "us-east-2": 3.0035, + "us-gov-east-1": 3.4656, + "us-gov-west-1": 3.4656, + "us-west-1": 3.5744, + "us-west-2": 3.0112 + }, + "c7gd.medium": { + "ap-northeast-1": 0.0721, + "ap-south-1": 0.0432, + "ap-southeast-1": 0.0705, + "ap-southeast-2": 0.0739, + "ap-southeast-5": 0.0, + "eu-central-1": 0.0669, + "eu-north-1": 0.0665, + "eu-south-2": 0.0659, + "eu-west-1": 0.069, + "us-east-1": 0.0598, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-west-1": 0.0711, + "us-west-2": 0.0598 + }, + "c7gd.large": { + "ap-northeast-1": 0.1441, + "ap-south-1": 0.0864, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1479, + "ap-southeast-5": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.1271, + "eu-south-2": 0.1318, + "eu-west-1": 0.138, + "us-east-1": 0.1195, + "us-east-2": 0.125, + "us-gov-east-1": 0.1384, + "us-west-1": 0.0, + "us-west-2": 0.1195 + }, + "c7gd.xlarge": { + "ap-northeast-1": 0.2882, + "ap-south-1": 0.1797, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.31, + "ap-southeast-5": 0.2483, + "eu-central-1": 0.0, + "eu-north-1": 0.266, + "eu-south-2": 0.276, + "eu-west-1": 0.2636, + "us-east-1": 0.2499, + "us-east-2": 0.239, + "us-gov-east-1": 0.2768, + "us-west-1": 0.2844, + "us-west-2": 0.239 + }, + "c7gd.metal": { + "ap-northeast-1": 4.3808, + "ap-south-1": 2.5344, + "ap-southeast-1": 4.0781, + "ap-southeast-2": 4.5018, + "ap-southeast-5": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 3.8362, + "eu-south-2": 3.9874, + "eu-west-1": 3.9872, + "us-east-1": 0.0, + "us-east-2": 3.5942, + "us-gov-east-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 3.5942 + }, + "c7gd.2xlarge": { + "ap-northeast-1": 0.5764, + "ap-south-1": 0.3456, + "ap-southeast-1": 0.564, + "ap-southeast-2": 0.5915, + "ap-southeast-5": 0.0, + "eu-central-1": 0.5348, + "eu-north-1": 0.5083, + "eu-south-2": 0.5272, + "eu-west-1": 0.5519, + "us-east-1": 0.4781, + "us-east-2": 0.4781, + "us-gov-east-1": 0.5537, + "us-west-1": 0.596, + "us-west-2": 0.4781 + }, + "c7gd.4xlarge": { + "ap-northeast-1": 1.0952, + "ap-south-1": 0.6336, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.1254, + "ap-southeast-5": 0.9357, + "eu-central-1": 1.012, + "eu-north-1": 0.959, + "eu-south-2": 0.9968, + "eu-west-1": 1.0462, + "us-east-1": 0.9421, + "us-east-2": 0.9421, + "us-gov-east-1": 1.0498, + "us-west-1": 0.0, + "us-west-2": 0.8986 + }, + "c7gd.8xlarge": { + "ap-northeast-1": 2.1904, + "ap-south-1": 1.2672, + "ap-southeast-1": 2.039, + "ap-southeast-2": 2.2509, + "ap-southeast-5": 1.785, + "eu-central-1": 2.024, + "eu-north-1": 2.0124, + "eu-south-2": 1.9937, + "eu-west-1": 1.9936, + "us-east-1": 1.7971, + "us-east-2": 1.8842, + "us-gov-east-1": 2.0995, + "us-west-1": 2.16, + "us-west-2": 1.7971 + }, + "c7gd.12xlarge": { + "ap-northeast-1": 3.2856, + "ap-south-1": 1.9008, + "ap-southeast-1": 3.0586, + "ap-southeast-2": 3.3763, + "ap-southeast-5": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 3.1388, + "eu-west-1": 3.1387, + "us-east-1": 2.8264, + "us-east-2": 2.6957, + "us-gov-east-1": 0.0, + "us-west-1": 3.24, + "us-west-2": 2.6957 + }, + "c7gd.16xlarge": { + "ap-northeast-1": 4.3808, + "ap-south-1": 2.5344, + "ap-southeast-1": 4.0781, + "ap-southeast-2": 4.5018, + "ap-southeast-5": 3.5699, + "eu-central-1": 4.048, + "eu-north-1": 3.8362, + "eu-south-2": 3.9874, + "eu-west-1": 3.9872, + "us-east-1": 3.5942, + "us-east-2": 3.5942, + "us-gov-east-1": 0.0, + "us-west-1": 4.32, + "us-west-2": 3.5942 + }, + "c7gn.medium": { + "ap-northeast-1": 0.0, + "eu-west-1": 0.0891, + "us-east-1": 0.0768, + "us-east-2": 0.0768, + "us-west-2": 0.0768 + }, + "c7gn.large": { + "ap-northeast-1": 0.0, + "eu-west-1": 0.1782, + "us-east-1": 0.1536, + "us-east-2": 0.1536, + "us-west-2": 0.1536 + }, + "c7gn.xlarge": { + "ap-northeast-1": 0.3911, + "eu-west-1": 0.3396, + "us-east-1": 0.3072, + "us-east-2": 0.3072, + "us-west-2": 0.3072 + }, + "c7gn.metal": { + "ap-northeast-1": 5.728, + "eu-west-1": 5.2032, + "us-east-1": 4.6848, + "us-east-2": 4.6848, + "us-west-2": 4.6848 + }, + "c7gn.2xlarge": { + "ap-northeast-1": 0.7448, + "eu-west-1": 0.6792, + "us-east-1": 0.6144, + "us-east-2": 0.6144, + "us-west-2": 0.6144 + }, + "c7gn.4xlarge": { + "ap-northeast-1": 1.5069, + "eu-west-1": 1.3008, + "us-east-1": 1.1712, + "us-east-2": 1.1712, + "us-west-2": 1.1712 + }, + "c7gn.8xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.3424, + "us-west-2": 2.3424 + }, + "c7gn.12xlarge": { + "ap-northeast-1": 4.296, + "eu-west-1": 4.1048, + "us-east-1": 0.0, + "us-east-2": 3.5136, + "us-west-2": 3.6933 + }, + "c7gn.16xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 5.2032, + "us-east-1": 4.6848, + "us-east-2": 4.6848, + "us-west-2": 4.6848 + }, + "c7i.large": { + "ap-northeast-1": 0.14115, + "ap-northeast-2": 0.13968, + "ap-south-1": 0.11805, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.14535, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.13622, + "eu-central-1": 0.13065, + "eu-north-1": 0.12435, + "eu-south-2": 0.0, + "eu-west-1": 0.12456, + "eu-west-2": 0.14546, + "eu-west-3": 0.13485, + "mx-central-1": 0.0, + "sa-east-1": 0.16635, + "us-east-1": 0.0, + "us-east-2": 0.11805, + "us-gov-east-1": 0.1359, + "us-gov-west-1": 0.0, + "us-west-1": 0.1401, + "us-west-2": 0.12698 + }, + "c7i.xlarge": { + "ap-northeast-1": 0.2823, + "ap-northeast-2": 0.2592, + "ap-south-1": 0.25395, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.2907, + "ap-southeast-5": 0.23254, + "ap-southeast-7": 0.0, + "ca-central-1": 0.27243, + "eu-central-1": 0.28167, + "eu-north-1": 0.2487, + "eu-south-2": 0.2592, + "eu-west-1": 0.24912, + "eu-west-2": 0.0, + "eu-west-3": 0.2697, + "mx-central-1": 0.24502, + "sa-east-1": 0.36021, + "us-east-1": 0.2361, + "us-east-2": 0.0, + "us-gov-east-1": 0.2718, + "us-gov-west-1": 0.29322, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c7i.metal-24xl": { + "ap-northeast-1": 6.4296, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 7.19064, + "ap-southeast-5": 5.23536, + "ap-southeast-7": 5.23536, + "ca-central-1": 0.0, + "eu-central-1": 6.41448, + "eu-north-1": 6.08184, + "eu-south-2": 6.35904, + "eu-west-1": 6.09293, + "eu-west-2": 6.1272, + "eu-west-3": 0.0, + "mx-central-1": 5.98469, + "sa-east-1": 7.6392, + "us-east-1": 5.7492, + "us-east-2": 5.7492, + "us-gov-east-1": 6.1776, + "us-gov-west-1": 6.1776, + "us-west-1": 6.3792, + "us-west-2": 0.0 + }, + "c7i.metal-48xl": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 11.52, + "ap-south-1": 10.4112, + "ap-southeast-1": 11.7216, + "ap-southeast-2": 0.0, + "ap-southeast-5": 10.24032, + "ap-southeast-7": 10.24032, + "ca-central-1": 11.2176, + "eu-central-1": 11.6208, + "eu-north-1": 11.016, + "eu-south-2": 11.52, + "eu-west-1": 11.03616, + "eu-west-2": 12.024, + "eu-west-3": 0.0, + "mx-central-1": 10.83936, + "sa-east-1": 15.048, + "us-east-1": 0.0, + "us-east-2": 10.4112, + "us-gov-east-1": 12.1248, + "us-gov-west-1": 0.0, + "us-west-1": 12.528, + "us-west-2": 10.4112 + }, + "c7i.2xlarge": { + "ap-northeast-1": 0.60954, + "ap-northeast-2": 0.0, + "ap-south-1": 0.4722, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.5814, + "ap-southeast-5": 0.46508, + "ap-southeast-7": 0.50007, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.53562, + "eu-south-2": 0.5184, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.58182, + "mx-central-1": 0.49004, + "sa-east-1": 0.6654, + "us-east-1": 0.4722, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.5436, + "us-west-1": 0.60492, + "us-west-2": 0.5079 + }, + "c7i.4xlarge": { + "ap-northeast-1": 1.16148, + "ap-northeast-2": 0.9792, + "ap-south-1": 0.8868, + "ap-southeast-1": 1.07832, + "ap-southeast-2": 1.1052, + "ap-southeast-5": 0.94254, + "ap-southeast-7": 0.94254, + "ca-central-1": 0.0, + "eu-central-1": 0.9876, + "eu-north-1": 1.01364, + "eu-south-2": 0.9792, + "eu-west-1": 0.93888, + "eu-west-2": 0.0, + "eu-west-3": 1.0212, + "mx-central-1": 0.92248, + "sa-east-1": 1.2732, + "us-east-1": 0.8868, + "us-east-2": 0.8868, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.11528, + "us-west-1": 1.0632, + "us-west-2": 0.8868 + }, + "c7i.8xlarge": { + "ap-northeast-1": 2.32296, + "ap-northeast-2": 1.9584, + "ap-south-1": 1.7736, + "ap-southeast-1": 2.15664, + "ap-southeast-2": 0.0, + "ap-southeast-5": 1.88507, + "ap-southeast-7": 1.74512, + "ca-central-1": 1.908, + "eu-central-1": 1.9752, + "eu-north-1": 2.02728, + "eu-south-2": 1.9584, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 2.0424, + "mx-central-1": 0.0, + "sa-east-1": 2.5464, + "us-east-1": 1.9164, + "us-east-2": 1.7736, + "us-gov-east-1": 2.0592, + "us-gov-west-1": 2.0592, + "us-west-1": 2.30448, + "us-west-2": 1.7736 + }, + "c7i.12xlarge": { + "ap-northeast-1": 3.2148, + "ap-northeast-2": 2.9376, + "ap-south-1": 2.6604, + "ap-southeast-1": 2.988, + "ap-southeast-2": 0.0, + "ap-southeast-5": 2.61768, + "ap-southeast-7": 2.61768, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 2.8116, + "eu-south-2": 2.9376, + "eu-west-1": 2.81664, + "eu-west-2": 3.0636, + "eu-west-3": 3.0636, + "mx-central-1": 2.99234, + "sa-east-1": 3.8196, + "us-east-1": 2.8746, + "us-east-2": 2.6604, + "us-gov-east-1": 3.34584, + "us-gov-west-1": 3.34584, + "us-west-1": 3.1896, + "us-west-2": 2.6604 + }, + "c7i.16xlarge": { + "ap-northeast-1": 4.2864, + "ap-northeast-2": 4.23936, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 3.77014, + "ap-southeast-7": 3.77014, + "ca-central-1": 3.816, + "eu-central-1": 3.9504, + "eu-north-1": 4.05456, + "eu-south-2": 3.9168, + "eu-west-1": 3.75552, + "eu-west-2": 4.0848, + "eu-west-3": 4.0848, + "mx-central-1": 3.68992, + "sa-east-1": 5.0928, + "us-east-1": 0.0, + "us-east-2": 3.8328, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.1184, + "us-west-1": 4.2528, + "us-west-2": 0.0 + }, + "c7i.24xlarge": { + "ap-northeast-1": 6.96888, + "ap-northeast-2": 5.8752, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 7.19064, + "ap-southeast-5": 5.23536, + "ap-southeast-7": 5.23536, + "ca-central-1": 5.724, + "eu-central-1": 5.9256, + "eu-north-1": 0.0, + "eu-south-2": 5.8752, + "eu-west-1": 6.09293, + "eu-west-2": 0.0, + "eu-west-3": 6.63624, + "mx-central-1": 0.0, + "sa-east-1": 7.6392, + "us-east-1": 5.7492, + "us-east-2": 5.3208, + "us-gov-east-1": 0.0, + "us-gov-west-1": 6.69168, + "us-west-1": 6.3792, + "us-west-2": 5.3208 + }, + "c7i.48xlarge": { + "ap-northeast-1": 12.6288, + "ap-northeast-2": 11.52, + "ap-south-1": 10.4112, + "ap-southeast-1": 11.7216, + "ap-southeast-2": 13.032, + "ap-southeast-5": 10.24032, + "ap-southeast-7": 10.24032, + "ca-central-1": 11.2176, + "eu-central-1": 11.6208, + "eu-north-1": 11.016, + "eu-south-2": 11.52, + "eu-west-1": 11.03616, + "eu-west-2": 12.024, + "eu-west-3": 0.0, + "mx-central-1": 10.83936, + "sa-east-1": 15.048, + "us-east-1": 10.4112, + "us-east-2": 10.4112, + "us-gov-east-1": 12.1248, + "us-gov-west-1": 12.1248, + "us-west-1": 12.528, + "us-west-2": 0.0 + }, + "c7i-flex.large": { + "ap-northeast-1": 0.13553, + "ap-northeast-2": 0.12456, + "ap-south-1": 0.11359, + "ap-southeast-1": 0.12658, + "ap-southeast-2": 0.13952, + "ap-southeast-5": 0.1119, + "ca-central-1": 0.12157, + "eu-central-1": 0.12556, + "eu-north-1": 0.11957, + "eu-south-2": 0.12456, + "eu-west-1": 0.11977, + "eu-west-2": 0.12955, + "eu-west-3": 0.12955, + "sa-east-1": 0.15947, + "us-east-1": 0.11359, + "us-east-2": 0.11359, + "us-gov-west-1": 0.13055, + "us-west-1": 0.13454, + "us-west-2": 0.11359 + }, + "c7i-flex.xlarge": { + "ap-northeast-1": 0.27107, + "ap-northeast-2": 0.24912, + "ap-south-1": 0.22718, + "ap-southeast-1": 0.25315, + "ap-southeast-2": 0.27905, + "ap-southeast-5": 0.22379, + "ca-central-1": 0.24314, + "eu-central-1": 0.25112, + "eu-north-1": 0.23915, + "eu-south-2": 0.24912, + "eu-west-1": 0.23954, + "eu-west-2": 0.2591, + "eu-west-3": 0.2591, + "sa-east-1": 0.31895, + "us-east-1": 0.22718, + "us-east-2": 0.22718, + "us-gov-west-1": 0.2611, + "us-west-1": 0.26907, + "us-west-2": 0.22718 + }, + "c7i-flex.2xlarge": { + "ap-northeast-1": 0.54213, + "ap-northeast-2": 0.49824, + "ap-south-1": 0.45435, + "ap-southeast-1": 0.5063, + "ap-southeast-2": 0.55809, + "ap-southeast-5": 0.44759, + "ca-central-1": 0.48627, + "eu-central-1": 0.50223, + "eu-north-1": 0.47829, + "eu-south-2": 0.49824, + "eu-west-1": 0.47909, + "eu-west-2": 0.51819, + "eu-west-3": 0.51819, + "sa-east-1": 0.63789, + "us-east-1": 0.45435, + "us-east-2": 0.45435, + "us-gov-west-1": 0.5222, + "us-west-1": 0.53814, + "us-west-2": 0.45435 + }, + "c7i-flex.4xlarge": { + "ap-northeast-1": 1.02666, + "ap-northeast-2": 0.93888, + "ap-south-1": 0.8511, + "ap-southeast-1": 0.955, + "ap-southeast-2": 1.05858, + "ap-southeast-5": 0.83757, + "ca-central-1": 0.91494, + "eu-central-1": 0.94686, + "eu-north-1": 0.89898, + "eu-south-2": 0.93888, + "eu-west-1": 0.90058, + "eu-west-2": 0.97878, + "eu-west-3": 0.97878, + "sa-east-1": 1.21818, + "us-east-1": 0.8511, + "us-east-2": 0.8511, + "us-gov-west-1": 0.9868, + "us-west-1": 1.01868, + "us-west-2": 0.8511 + }, + "c7i-flex.8xlarge": { + "ap-northeast-1": 2.05332, + "ap-northeast-2": 1.87776, + "ap-south-1": 1.7022, + "ap-southeast-1": 1.91001, + "ap-southeast-2": 2.11716, + "ap-southeast-5": 1.67514, + "ca-central-1": 1.82988, + "eu-central-1": 1.89372, + "eu-north-1": 1.79796, + "eu-south-2": 1.87776, + "eu-west-1": 1.80115, + "eu-west-2": 1.95756, + "eu-west-3": 1.95756, + "sa-east-1": 2.43636, + "us-east-1": 1.7022, + "us-east-2": 1.7022, + "us-gov-west-1": 1.9736, + "us-west-1": 2.03736, + "us-west-2": 1.7022 + }, + "c7i-flex.12xlarge": { + "ap-northeast-1": 3.07998, + "ap-south-1": 2.5533, + "ap-southeast-1": 2.86501, + "ap-southeast-2": 3.17574, + "ap-southeast-5": 2.51272, + "ca-central-1": 2.74482, + "eu-central-1": 2.84058, + "eu-north-1": 2.69694, + "eu-south-2": 2.81664, + "eu-west-1": 2.70173, + "eu-west-2": 2.93634, + "eu-west-3": 2.93634, + "sa-east-1": 3.65454, + "us-east-1": 2.5533, + "us-east-2": 2.5533, + "us-gov-west-1": 2.9604, + "us-west-1": 3.05604, + "us-west-2": 2.5533 + }, + "c7i-flex.16xlarge": { + "ap-northeast-1": 4.10664, + "ap-south-1": 3.4044, + "ap-southeast-1": 3.82002, + "ap-southeast-2": 4.23432, + "ap-southeast-5": 3.35029, + "ca-central-1": 3.65976, + "eu-central-1": 3.78744, + "eu-north-1": 3.59592, + "eu-south-2": 3.75552, + "eu-west-1": 3.6023, + "eu-west-2": 3.91512, + "eu-west-3": 3.91512, + "sa-east-1": 4.87272, + "us-east-1": 3.4044, + "us-east-2": 3.4044, + "us-gov-west-1": 3.9472, + "us-west-1": 4.07472, + "us-west-2": 3.4044 + }, + "c8g.medium": { + "eu-central-1": 0.06429, + "eu-north-1": 0.05695, + "eu-south-2": 0.06129, + "eu-west-1": 0.0, + "us-east-1": 0.05428, + "us-east-2": 0.05414, + "us-west-2": 0.05428 + }, + "c8g.large": { + "eu-central-1": 0.12857, + "eu-north-1": 0.0, + "eu-south-2": 0.11406, + "eu-west-1": 0.11408, + "us-east-1": 0.0, + "us-east-2": 0.10828, + "us-west-2": 0.0 + }, + "c8g.xlarge": { + "eu-central-1": 0.239, + "eu-north-1": 0.2278, + "eu-south-2": 0.0, + "eu-west-1": 0.22816, + "us-east-1": 0.21712, + "us-east-2": 0.23246, + "us-west-2": 0.21712 + }, + "c8g.metal-24xl": { + "eu-central-1": 5.3904, + "eu-north-1": 5.1216, + "eu-south-2": 5.12928, + "eu-west-1": 5.13024, + "us-east-1": 4.86528, + "us-east-2": 4.85184, + "us-west-2": 4.86528 + }, + "c8g.metal-48xl": { + "eu-central-1": 10.5504, + "eu-north-1": 10.0128, + "eu-south-2": 10.02816, + "eu-west-1": 10.03008, + "us-east-1": 0.0, + "us-east-2": 9.47328, + "us-west-2": 9.50016 + }, + "c8g.2xlarge": { + "eu-central-1": 0.478, + "eu-north-1": 0.48964, + "eu-south-2": 0.45624, + "eu-west-1": 0.45632, + "us-east-1": 0.43424, + "us-east-2": 0.43312, + "us-west-2": 0.43424 + }, + "c8g.4xlarge": { + "eu-central-1": 0.8984, + "eu-north-1": 0.8536, + "eu-south-2": 0.92309, + "eu-west-1": 0.85504, + "us-east-1": 0.81088, + "us-east-2": 0.80864, + "us-west-2": 0.0 + }, + "c8g.8xlarge": { + "eu-central-1": 1.94192, + "eu-north-1": 1.7072, + "eu-south-2": 1.70976, + "eu-west-1": 1.71008, + "us-east-1": 1.62176, + "us-east-2": 1.61728, + "us-west-2": 1.62176 + }, + "c8g.12xlarge": { + "eu-central-1": 2.6952, + "eu-north-1": 2.5608, + "eu-south-2": 2.56464, + "eu-west-1": 0.0, + "us-east-1": 2.62406, + "us-east-2": 2.42592, + "us-west-2": 2.43264 + }, + "c8g.16xlarge": { + "eu-central-1": 3.5936, + "eu-north-1": 3.4144, + "eu-south-2": 3.69235, + "eu-west-1": 3.42016, + "us-east-1": 3.24352, + "us-east-2": 3.4889, + "us-west-2": 0.0 + }, + "c8g.24xlarge": { + "eu-central-1": 5.3904, + "eu-north-1": 5.1216, + "eu-south-2": 5.12928, + "eu-west-1": 5.13024, + "us-east-1": 0.0, + "us-east-2": 4.85184, + "us-west-2": 4.86528 + }, + "c8g.48xlarge": { + "eu-central-1": 10.5504, + "eu-north-1": 10.0128, + "eu-south-2": 10.02816, + "eu-west-1": 10.03008, + "us-east-1": 9.50016, + "us-east-2": 9.47328, + "us-west-2": 9.50016 + }, + "cc2.8xlarge": { + "ap-northeast-1": 2.695, + "eu-west-1": 2.6, + "us-east-1": 2.35, + "us-gov-west-1": 2.6, + "us-west-2": 2.35 + }, + "cr1.8xlarge": { + "ap-northeast-1": 4.451, + "eu-west-1": 4.1, + "us-east-1": 3.85, + "us-west-2": 3.85 + }, + "d2.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.015, + "ap-northeast-1": 0.902, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.986, + "ap-south-1": 0.967, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 0.893, + "eu-central-1": 0.852, + "eu-north-1": 0.0, + "eu-south-1": 0.907, + "eu-west-1": 0.0, + "eu-west-2": 0.83, + "eu-west-3": 0.83, + "me-south-1": 0.947, + "sa-east-1": 0.0, + "us-east-1": 0.748, + "us-east-2": 0.748, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.886, + "us-west-1": 0.839, + "us-west-2": 0.0 + }, + "d2.2xlarge": { + "af-south-1": 1.865, + "ap-east-1": 0.0, + "ap-northeast-1": 1.803, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 1.769, + "ap-southeast-1": 2.029, + "ap-southeast-2": 2.029, + "ca-central-1": 1.633, + "eu-central-1": 1.862, + "eu-north-1": 1.511, + "eu-south-1": 1.659, + "eu-west-1": 1.585, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "me-south-1": 1.732, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 1.495, + "us-gov-east-1": 1.771, + "us-gov-west-1": 1.771, + "us-west-1": 1.677, + "us-west-2": 1.633 + }, + "d2.4xlarge": { + "af-south-1": 3.673, + "ap-east-1": 0.0, + "ap-northeast-1": 3.549, + "ap-northeast-2": 3.886, + "ap-northeast-3": 3.549, + "ap-south-1": 3.481, + "ap-southeast-1": 3.653, + "ap-southeast-2": 3.653, + "ca-central-1": 3.209, + "eu-central-1": 3.349, + "eu-north-1": 3.244, + "eu-south-1": 3.57, + "eu-west-1": 3.113, + "eu-west-2": 3.261, + "eu-west-3": 3.57, + "me-south-1": 3.407, + "sa-east-1": 0.0, + "us-east-1": 2.933, + "us-east-2": 2.933, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.816, + "us-west-1": 3.609, + "us-west-2": 2.933 + }, + "d2.8xlarge": { + "af-south-1": 7.389, + "ap-east-1": 0.0, + "ap-northeast-1": 7.141, + "ap-northeast-2": 7.141, + "ap-northeast-3": 7.141, + "ap-south-1": 7.005, + "ap-southeast-1": 7.349, + "ap-southeast-2": 7.349, + "ca-central-1": 0.0, + "eu-central-1": 6.741, + "eu-north-1": 5.973, + "eu-south-1": 0.0, + "eu-west-1": 6.269, + "eu-west-2": 6.565, + "eu-west-3": 0.0, + "me-south-1": 6.857, + "sa-east-1": 0.0, + "us-east-1": 5.909, + "us-east-2": 5.909, + "us-gov-east-1": 7.013, + "us-gov-west-1": 7.013, + "us-west-1": 6.637, + "us-west-2": 0.0 + }, + "d3.xlarge": { + "ap-northeast-1": 0.782, + "ap-south-1": 0.581, + "ap-southeast-1": 0.684, + "ap-southeast-2": 0.684, + "ca-central-1": 0.608, + "eu-central-1": 0.716, + "eu-central-2": 0.781, + "eu-west-1": 0.667, + "eu-west-2": 0.697, + "eu-west-3": 0.7, + "il-central-1": 0.697, + "us-east-1": 0.557, + "us-east-2": 0.557, + "us-gov-west-1": 0.656, + "us-west-2": 0.557 + }, + "d3.2xlarge": { + "ap-northeast-1": 1.564, + "ap-south-1": 1.162, + "ap-southeast-1": 1.367, + "ap-southeast-2": 1.367, + "ca-central-1": 1.215, + "eu-central-1": 1.431, + "eu-central-2": 1.563, + "eu-west-1": 1.334, + "eu-west-2": 1.395, + "eu-west-3": 1.41, + "il-central-1": 1.395, + "us-east-1": 1.114, + "us-east-2": 1.114, + "us-gov-west-1": 1.312, + "us-west-2": 1.114 + }, + "d3.4xlarge": { + "ap-northeast-1": 3.07, + "ap-south-1": 2.267, + "ap-southeast-1": 2.677, + "ap-southeast-2": 2.677, + "ca-central-1": 2.373, + "eu-central-1": 2.805, + "eu-central-2": 3.068, + "eu-west-1": 2.61, + "eu-west-2": 2.732, + "eu-west-3": 2.689, + "il-central-1": 2.732, + "us-east-1": 2.171, + "us-east-2": 2.171, + "us-gov-west-1": 2.567, + "us-west-2": 2.171 + }, + "d3.8xlarge": { + "ap-northeast-1": 6.13904, + "ap-south-1": 4.53464, + "ap-southeast-1": 5.35368, + "ap-southeast-2": 5.35368, + "ca-central-1": 4.74672, + "eu-central-1": 5.61008, + "eu-central-2": 6.13656, + "eu-west-1": 5.22008, + "eu-west-2": 5.46384, + "eu-west-3": 5.24824, + "il-central-1": 5.46384, + "us-east-1": 4.34112, + "us-east-2": 4.34112, + "us-gov-west-1": 5.13336, + "us-west-2": 4.34112 + }, + "d3en.xlarge": { + "ap-northeast-1": 0.82, + "ap-southeast-1": 0.717, + "ap-southeast-2": 0.717, + "ap-southeast-3": 0.717, + "eu-central-1": 0.75, + "eu-west-1": 0.699, + "us-east-1": 0.583, + "us-west-2": 0.583 + }, + "d3en.2xlarge": { + "ap-northeast-1": 1.64, + "ap-southeast-1": 1.433, + "ap-southeast-2": 1.433, + "ap-southeast-3": 1.433, + "eu-central-1": 1.501, + "eu-west-1": 1.398, + "us-east-1": 1.167, + "us-west-2": 1.167 + }, + "d3en.4xlarge": { + "ap-northeast-1": 3.222, + "ap-southeast-1": 2.809, + "ap-southeast-2": 2.809, + "ap-southeast-3": 2.809, + "eu-central-1": 2.944, + "eu-west-1": 2.738, + "us-east-1": 2.276, + "us-west-2": 2.276 + }, + "d3en.6xlarge": { + "ap-northeast-1": 4.833, + "ap-southeast-1": 4.213, + "ap-southeast-2": 4.213, + "ap-southeast-3": 4.213, + "eu-central-1": 4.415, + "eu-west-1": 4.107, + "us-east-1": 3.414, + "us-west-2": 3.414 + }, + "d3en.8xlarge": { + "ap-northeast-1": 6.444, + "ap-southeast-1": 5.61728, + "ap-southeast-2": 5.61728, + "ap-southeast-3": 5.61728, + "eu-central-1": 5.88712, + "eu-west-1": 5.47664, + "us-east-1": 4.55136, + "us-west-2": 4.55136 + }, + "d3en.12xlarge": { + "ap-northeast-1": 9.666, + "ap-southeast-1": 8.42592, + "ap-southeast-2": 8.42592, + "ap-southeast-3": 8.42592, + "eu-central-1": 8.83068, + "eu-west-1": 8.21496, + "us-east-1": 6.82704, + "us-west-2": 6.82704 + }, + "dl1.24xlarge": { + "us-east-1": 14.14584, + "us-west-2": 15.45674 + }, + "dl2q.24xlarge": { + "eu-central-1": 12.632, + "us-west-2": 9.9562 + }, + "f1.2xlarge": { + "eu-central-1": 2.0226, + "eu-west-1": 1.9302, + "eu-west-2": 2.0212, + "us-east-1": 1.9302, + "us-gov-west-1": 0.0, + "us-west-2": 1.7652 + }, + "f1.4xlarge": { + "eu-central-1": 3.641, + "eu-west-1": 0.0, + "eu-west-2": 3.985, + "us-east-1": 3.803, + "us-gov-west-1": 4.133, + "us-west-2": 3.473 + }, + "f1.16xlarge": { + "eu-west-1": 0.0, + "us-east-1": 13.8912, + "us-gov-west-1": 16.5312, + "us-west-2": 13.8912 + }, + "f2.6xlarge": { + "ap-southeast-2": 0.0, + "eu-west-2": 0.0, + "us-east-1": 2.2392, + "us-west-2": 2.2392 + }, + "f2.12xlarge": { + "ap-southeast-2": 5.2704, + "eu-west-2": 5.6664, + "us-east-1": 4.4784, + "us-west-2": 4.4784 + }, + "f2.48xlarge": { + "ap-southeast-2": 22.752, + "eu-west-2": 22.4352, + "us-east-1": 17.6832, + "us-west-2": 17.6832 + }, + "g2.2xlarge": { + "ap-northeast-1": 1.013, + "ap-northeast-2": 1.103, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.013, + "eu-central-1": 0.887, + "eu-west-1": 0.817, + "sa-east-1": 0.0, + "us-east-1": 0.765, + "us-west-1": 0.887, + "us-west-2": 0.0 + }, + "g2.8xlarge": { + "ap-northeast-1": 3.938, + "ap-northeast-2": 0.0, + "ap-southeast-1": 4.346, + "ap-southeast-2": 3.938, + "eu-central-1": 3.434, + "eu-west-1": 3.154, + "sa-east-1": 0.0, + "us-east-1": 2.946, + "us-west-1": 3.154, + "us-west-2": 0.0 + }, + "g3.4xlarge": { + "ap-northeast-1": 1.7528, + "ap-northeast-2": 0.0, + "ap-southeast-1": 1.8428, + "ap-southeast-2": 1.9268, + "ca-central-1": 1.7304, + "eu-central-1": 1.5978, + "eu-west-1": 0.0, + "eu-west-2": 1.6018, + "us-east-1": 1.3128, + "us-east-2": 1.3128, + "us-gov-west-1": 1.4928, + "us-west-1": 0.0, + "us-west-2": 1.3128 + }, + "g3.8xlarge": { + "ap-northeast-1": 3.5056, + "ap-northeast-2": 3.1856, + "ap-southeast-1": 4.0196, + "ap-southeast-2": 3.8536, + "ca-central-1": 3.4608, + "eu-central-1": 3.1956, + "eu-west-1": 2.7656, + "eu-west-2": 3.2036, + "us-east-1": 2.6256, + "us-east-2": 2.6256, + "us-gov-west-1": 2.9856, + "us-west-1": 3.4136, + "us-west-2": 2.6256 + }, + "g3.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 6.3712, + "ap-southeast-1": 7.3712, + "ap-southeast-2": 0.0, + "ca-central-1": 6.3552, + "eu-central-1": 0.0, + "eu-west-1": 5.5312, + "eu-west-2": 6.4072, + "us-east-1": 5.2512, + "us-east-2": 5.2512, + "us-gov-west-1": 5.9712, + "us-west-1": 6.8272, + "us-west-2": 5.2512 + }, + "g3s.xlarge": { + "ap-northeast-1": 1.098, + "ap-northeast-2": 0.992, + "ap-southeast-2": 1.212, + "eu-central-1": 0.996, + "eu-west-1": 0.854, + "eu-west-2": 0.998, + "us-east-1": 0.808, + "us-east-2": 0.808, + "us-gov-west-1": 0.926, + "us-west-2": 0.808 + }, + "g4ad.xlarge": { + "ap-northeast-1": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.53087, + "eu-west-1": 0.48023, + "eu-west-2": 0.50031, + "us-east-1": 0.47398, + "us-east-2": 0.0, + "us-west-2": 0.47398 + }, + "g4ad.2xlarge": { + "ap-northeast-1": 0.91853, + "ca-central-1": 0.71941, + "eu-central-1": 0.79182, + "eu-west-1": 0.71941, + "eu-west-2": 0.0, + "us-east-1": 0.65637, + "us-east-2": 0.65637, + "us-west-2": 0.0 + }, + "g4ad.4xlarge": { + "ap-northeast-1": 1.3428, + "ca-central-1": 1.1408, + "eu-central-1": 1.2568, + "eu-west-1": 1.2376, + "eu-west-2": 1.2882, + "us-east-1": 0.0, + "us-east-2": 1.0398, + "us-west-2": 1.1265 + }, + "g4ad.8xlarge": { + "ap-northeast-1": 2.6856, + "ca-central-1": 2.2816, + "eu-central-1": 2.5136, + "eu-west-1": 2.2816, + "eu-west-2": 2.3736, + "us-east-1": 2.0796, + "us-east-2": 0.0, + "us-west-2": 2.0796 + }, + "g4ad.16xlarge": { + "ap-northeast-1": 5.8392, + "ca-central-1": 4.5632, + "eu-central-1": 0.0, + "eu-west-1": 4.5632, + "eu-west-2": 0.0, + "us-east-1": 0.0, + "us-east-2": 4.1592, + "us-west-2": 4.1592 + }, + "g4dn.xlarge": { + "af-south-1": 0.756, + "ap-east-1": 0.916, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.705, + "ap-northeast-3": 0.768, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.715, + "eu-north-1": 0.649, + "eu-south-1": 0.713, + "eu-west-1": 0.682, + "eu-west-2": 0.0, + "eu-west-3": 0.673, + "me-south-1": 0.703, + "sa-east-1": 1.01, + "us-east-1": 0.584, + "us-east-2": 0.584, + "us-gov-east-1": 0.721, + "us-gov-west-1": 0.721, + "us-west-1": 0.689, + "us-west-2": 0.615, + "us-west-2-lax-1": 0.731 + }, + "g4dn.metal": { + "af-south-1": 11.418, + "ap-east-1": 13.085, + "ap-northeast-1": 11.599, + "ap-northeast-2": 10.661, + "ap-northeast-3": 11.599, + "ap-south-1": 9.649, + "ap-southeast-1": 11.984, + "ap-southeast-2": 11.211, + "ca-central-1": 0.0, + "eu-central-1": 10.817, + "eu-north-1": 9.337, + "eu-south-1": 10.197, + "eu-west-1": 9.761, + "eu-west-2": 10.191, + "eu-west-3": 10.185, + "me-south-1": 10.633, + "sa-east-1": 14.335, + "us-east-1": 0.0, + "us-east-2": 8.861, + "us-gov-west-1": 10.899, + "us-west-1": 10.426, + "us-west-2": 8.861, + "us-west-2-lax-1": 10.426 + }, + "g4dn.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.273, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.04, + "ap-northeast-3": 0.0, + "ap-south-1": 0.943, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.093, + "ca-central-1": 0.0, + "eu-central-1": 1.055, + "eu-north-1": 0.913, + "eu-south-1": 1.053, + "eu-west-1": 1.008, + "eu-west-2": 0.995, + "eu-west-3": 0.994, + "me-south-1": 1.097, + "sa-east-1": 1.393, + "us-east-1": 0.867, + "us-east-2": 0.867, + "us-gov-east-1": 1.063, + "us-gov-west-1": 1.063, + "us-west-1": 1.078, + "us-west-2": 0.867, + "us-west-2-lax-1": 1.018 + }, + "g4dn.4xlarge": { + "af-south-1": 1.77, + "ap-east-1": 2.027, + "ap-northeast-1": 1.798, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.798, + "ap-south-1": 1.498, + "ap-southeast-1": 1.857, + "ap-southeast-2": 1.738, + "ca-central-1": 1.59, + "eu-central-1": 1.678, + "eu-north-1": 1.45, + "eu-south-1": 1.582, + "eu-west-1": 1.515, + "eu-west-2": 1.581, + "eu-west-3": 1.581, + "me-south-1": 1.65, + "sa-east-1": 2.352, + "us-east-1": 1.377, + "us-east-2": 1.377, + "us-gov-east-1": 1.781, + "us-gov-west-1": 0.0, + "us-west-1": 1.618, + "us-west-2": 1.377, + "us-west-2-lax-1": 1.618 + }, + "g4dn.8xlarge": { + "af-south-1": 0.0, + "ap-east-1": 3.696, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.022, + "ap-northeast-3": 3.283, + "ap-south-1": 2.741, + "ap-southeast-1": 3.39, + "ap-southeast-2": 3.175, + "ca-central-1": 2.762, + "eu-central-1": 3.066, + "eu-north-1": 2.654, + "eu-south-1": 3.059, + "eu-west-1": 0.0, + "eu-west-2": 2.891, + "eu-west-3": 0.0, + "me-south-1": 0.0, + "sa-east-1": 4.044, + "us-east-1": 2.652, + "us-east-2": 2.652, + "us-gov-east-1": 3.088, + "us-gov-west-1": 0.0, + "us-west-1": 3.132, + "us-west-2": 0.0, + "us-west-2-lax-1": 2.957 + }, + "g4dn.12xlarge": { + "af-south-1": 5.709, + "ap-east-1": 6.904, + "ap-northeast-1": 6.143, + "ap-northeast-2": 5.33, + "ap-northeast-3": 6.143, + "ap-south-1": 0.0, + "ap-southeast-1": 5.992, + "ap-southeast-2": 5.605, + "ca-central-1": 5.122, + "eu-central-1": 5.726, + "eu-north-1": 4.917, + "eu-south-1": 5.098, + "eu-west-1": 5.164, + "eu-west-2": 5.393, + "eu-west-3": 5.367, + "me-south-1": 5.628, + "sa-east-1": 0.0, + "us-east-1": 4.43, + "us-east-2": 4.43, + "us-gov-east-1": 5.745, + "us-gov-west-1": 5.745, + "us-west-1": 5.527, + "us-west-2": 4.665, + "us-west-2-lax-1": 5.527 + }, + "g4dn.16xlarge": { + "af-south-1": 6.465, + "ap-east-1": 0.0, + "ap-northeast-1": 6.566, + "ap-northeast-2": 6.044, + "ap-northeast-3": 6.566, + "ap-south-1": 0.0, + "ap-southeast-1": 7.146, + "ap-southeast-2": 6.69, + "ca-central-1": 5.523, + "eu-central-1": 6.131, + "eu-north-1": 5.308, + "eu-south-1": 5.786, + "eu-west-1": 0.0, + "eu-west-2": 6.114, + "eu-west-3": 6.085, + "me-south-1": 6.376, + "sa-east-1": 8.088, + "us-east-1": 5.304, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 6.177, + "us-west-1": 5.914, + "us-west-2": 5.043, + "us-west-2-lax-1": 0.0 + }, + "g5.xlarge": { + "ap-northeast-1": 1.5166, + "ap-northeast-2": 1.2946, + "ap-south-1": 1.2656, + "ap-southeast-2": 1.3656, + "ap-southeast-3": 1.4656, + "ca-central-1": 1.2863, + "eu-central-1": 1.3156, + "eu-north-1": 1.1246, + "eu-west-1": 1.2929, + "eu-west-2": 1.4623, + "il-central-1": 1.23675, + "me-central-1": 1.2916, + "sa-east-1": 1.7676, + "us-east-1": 1.0636, + "us-east-2": 1.0636, + "us-west-2": 1.1642 + }, + "g5.2xlarge": { + "ap-northeast-1": 1.87296, + "ap-northeast-2": 1.75453, + "ap-south-1": 0.0, + "ap-southeast-2": 1.84863, + "ap-southeast-3": 1.81152, + "ca-central-1": 1.5955, + "eu-central-1": 1.78236, + "eu-north-1": 1.40069, + "eu-west-1": 0.0, + "eu-west-2": 1.80754, + "il-central-1": 1.53581, + "me-central-1": 1.60189, + "sa-east-1": 0.0, + "us-east-1": 1.3272, + "us-east-2": 1.3272, + "us-west-2": 1.3272 + }, + "g5.4xlarge": { + "ap-northeast-1": 2.52808, + "ap-northeast-2": 2.16971, + "ap-south-1": 0.0, + "ap-southeast-2": 2.28432, + "ap-southeast-3": 2.44575, + "ca-central-1": 0.0, + "eu-central-1": 2.40669, + "eu-north-1": 2.06752, + "eu-west-1": 1.98567, + "eu-west-2": 2.23428, + "il-central-1": 0.0, + "me-central-1": 2.36407, + "sa-east-1": 3.20932, + "us-east-1": 1.7968, + "us-east-2": 1.9592, + "us-west-2": 0.0, + "us-west-2-lax-1": 2.40378 + }, + "g5.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.35572, + "ap-south-1": 3.28515, + "ap-southeast-2": 0.0, + "ap-southeast-3": 3.77183, + "ca-central-1": 3.33552, + "eu-central-1": 3.71294, + "eu-north-1": 2.94204, + "eu-west-1": 3.07831, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "me-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 3.0384, + "us-east-2": 2.7936, + "us-west-2": 2.7936, + "us-west-2-lax-1": 3.70856 + }, + "g5.12xlarge": { + "ap-northeast-1": 8.74449, + "ap-northeast-2": 0.0, + "ap-south-1": 7.32931, + "ap-southeast-2": 7.89313, + "ap-southeast-3": 8.45694, + "ca-central-1": 6.81624, + "eu-central-1": 8.3205, + "eu-north-1": 6.53433, + "eu-west-1": 7.48323, + "eu-west-2": 7.71834, + "il-central-1": 0.0, + "me-central-1": 0.0, + "sa-east-1": 10.15967, + "us-east-1": 6.7576, + "us-east-2": 6.1904, + "us-west-2": 6.1904 + }, + "g5.16xlarge": { + "ap-northeast-1": 7.22566, + "ap-northeast-2": 0.0, + "ap-south-1": 6.1015, + "ap-southeast-2": 6.01681, + "ap-southeast-3": 6.42397, + "ca-central-1": 5.23914, + "eu-central-1": 5.81324, + "eu-north-1": 5.47, + "eu-west-1": 0.0, + "eu-west-2": 6.41054, + "il-central-1": 5.49219, + "me-central-1": 5.71552, + "sa-east-1": 0.0, + "us-east-1": 5.1968, + "us-east-2": 5.1968, + "us-west-2": 5.1968 + }, + "g5.24xlarge": { + "ap-northeast-1": 14.02915, + "ap-northeast-2": 11.05084, + "ap-south-1": 10.81608, + "ap-southeast-2": 12.6845, + "ap-southeast-3": 12.43516, + "ca-central-1": 0.0, + "eu-central-1": 11.22085, + "eu-north-1": 9.67462, + "eu-west-1": 11.03708, + "eu-west-2": 12.40845, + "il-central-1": 11.5371, + "me-central-1": 11.02656, + "sa-east-1": 14.87998, + "us-east-1": 9.9952, + "us-east-2": 9.1808, + "us-west-2": 9.1808 + }, + "g5.48xlarge": { + "ap-northeast-1": 25.46566, + "ap-northeast-2": 21.87129, + "ap-south-1": 21.40175, + "ap-southeast-2": 23.02084, + "ap-southeast-3": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 19.11884, + "eu-west-1": 0.0, + "eu-west-2": 22.51892, + "il-central-1": 20.93465, + "me-central-1": 21.82271, + "sa-east-1": 29.52956, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 18.1312 + }, + "g5g.xlarge": { + "ap-northeast-1": 0.6245, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "eu-central-1": 0.583, + "eu-south-2": 0.5263, + "us-east-1": 0.4776, + "us-west-2": 0.0 + }, + "g5g.metal": { + "ap-northeast-1": 4.3951, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "eu-central-1": 4.1238, + "eu-south-2": 3.7534, + "us-east-1": 3.4352, + "us-west-2": 3.4352 + }, + "g5g.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.8401, + "ap-southeast-1": 0.8932, + "eu-central-1": 0.8107, + "eu-south-2": 0.0, + "us-east-1": 0.6712, + "us-west-2": 0.6712 + }, + "g5g.4xlarge": { + "ap-northeast-1": 1.3631, + "ap-northeast-2": 1.1913, + "ap-southeast-1": 1.3314, + "eu-central-1": 1.2086, + "eu-south-2": 0.0, + "us-east-1": 0.0, + "us-west-2": 1.0008 + }, + "g5g.8xlarge": { + "ap-northeast-1": 2.3179, + "ap-northeast-2": 2.1343, + "ap-southeast-1": 2.2654, + "eu-central-1": 2.1734, + "eu-south-2": 1.8767, + "us-east-1": 1.7176, + "us-west-2": 1.7176 + }, + "g5g.16xlarge": { + "ap-northeast-1": 4.3951, + "ap-northeast-2": 0.0, + "ap-southeast-1": 4.5307, + "eu-central-1": 4.1238, + "eu-south-2": 3.7534, + "us-east-1": 3.4352, + "us-west-2": 3.4352 + }, + "g6.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.0472, + "ap-south-1": 1.12064, + "ap-southeast-2": 1.104, + "ap-southeast-5": 1.0714, + "ca-central-1": 0.9512, + "eu-central-1": 1.064, + "eu-central-2": 1.1426, + "eu-north-1": 0.9112, + "eu-south-2": 0.9056, + "eu-west-2": 1.0792, + "eu-west-3": 1.0792, + "sa-east-1": 1.4256, + "us-east-1": 0.8624, + "us-east-2": 0.94288, + "us-gov-west-1": 0.0, + "us-west-2": 0.94288 + }, + "g6.2xlarge": { + "ap-northeast-1": 1.53301, + "ap-northeast-2": 0.0, + "ap-south-1": 1.2891, + "ap-southeast-2": 1.38627, + "ap-southeast-5": 1.34667, + "ca-central-1": 1.20067, + "eu-central-1": 1.33769, + "eu-central-2": 1.43316, + "eu-north-1": 1.25577, + "eu-south-2": 1.14528, + "eu-west-2": 1.35615, + "eu-west-3": 1.35615, + "sa-east-1": 1.77693, + "us-east-1": 1.0928, + "us-east-2": 1.0928, + "us-gov-west-1": 1.3474, + "us-west-2": 1.0928 + }, + "g6.4xlarge": { + "ap-northeast-1": 2.09183, + "ap-northeast-2": 1.96254, + "ap-south-1": 0.0, + "ap-southeast-2": 1.89322, + "ap-southeast-5": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 1.99292, + "eu-central-2": 2.13508, + "eu-north-1": 1.57623, + "eu-south-2": 0.0, + "eu-west-2": 1.85245, + "eu-west-3": 1.85245, + "sa-east-1": 2.42198, + "us-east-1": 1.62832, + "us-east-2": 1.62832, + "us-gov-west-1": 2.00739, + "us-west-2": 1.496 + }, + "g6.8xlarge": { + "ap-northeast-1": 3.26708, + "ap-northeast-2": 2.82255, + "ap-south-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 2.88312, + "ca-central-1": 2.58226, + "eu-central-1": 0.0, + "eu-central-2": 3.33291, + "eu-north-1": 0.0, + "eu-south-2": 2.46813, + "eu-west-2": 2.90265, + "eu-west-3": 2.90265, + "sa-east-1": 3.76968, + "us-east-1": 2.36, + "us-east-2": 2.36, + "us-gov-west-1": 2.88463, + "us-west-2": 0.0 + }, + "g6.12xlarge": { + "ap-northeast-1": 7.19209, + "ap-northeast-2": 6.74245, + "ap-south-1": 6.04398, + "ap-southeast-2": 0.0, + "ap-southeast-5": 6.315, + "ca-central-1": 5.62773, + "eu-central-1": 6.27269, + "eu-central-2": 7.34247, + "eu-north-1": 5.88709, + "eu-south-2": 0.0, + "eu-west-2": 6.3596, + "eu-west-3": 6.3596, + "sa-east-1": 8.34021, + "us-east-1": 5.12, + "us-east-2": 0.0, + "us-gov-west-1": 6.31843, + "us-west-2": 5.12 + }, + "g6.16xlarge": { + "ap-northeast-1": 5.61757, + "ap-northeast-2": 4.86798, + "ap-south-1": 4.77006, + "ap-southeast-2": 5.54937, + "ap-southeast-5": 4.97012, + "ca-central-1": 4.4628, + "eu-central-1": 0.0, + "eu-central-2": 5.27063, + "eu-north-1": 4.29397, + "eu-south-2": 0.0, + "eu-west-2": 5.00304, + "eu-west-3": 5.43423, + "sa-east-1": 7.04247, + "us-east-1": 0.0, + "us-east-2": 4.42768, + "us-gov-west-1": 4.97265, + "us-west-2": 4.42768 + }, + "g6.24xlarge": { + "ap-northeast-1": 10.71783, + "ap-northeast-2": 9.24477, + "ap-south-1": 9.05235, + "ap-southeast-2": 9.71589, + "ap-southeast-5": 9.4455, + "ca-central-1": 8.44853, + "eu-central-1": 10.21885, + "eu-central-2": 10.03604, + "eu-north-1": 0.0, + "eu-south-2": 8.07031, + "eu-west-2": 9.51019, + "eu-west-3": 9.51019, + "sa-east-1": 0.0, + "us-east-1": 7.712, + "us-east-2": 7.712, + "us-gov-west-1": 9.45047, + "us-west-2": 7.712 + }, + "g6.48xlarge": { + "ap-northeast-1": 21.20526, + "ap-northeast-2": 18.25915, + "ap-south-1": 17.8743, + "ap-southeast-2": 19.20137, + "ap-southeast-5": 0.0, + "ca-central-1": 16.66666, + "eu-central-1": 0.0, + "eu-central-2": 19.84169, + "eu-north-1": 16.00312, + "eu-south-2": 0.0, + "eu-west-2": 18.78998, + "eu-west-3": 18.78998, + "sa-east-1": 0.0, + "us-east-1": 15.1936, + "us-east-2": 15.1936, + "us-gov-west-1": 18.67054, + "us-west-2": 15.1936 + }, + "g6e.xlarge": { + "ap-northeast-1": 2.7566, + "eu-central-1": 2.3846, + "eu-north-1": 2.0316, + "eu-south-2": 2.0186, + "us-east-1": 1.9186, + "us-east-2": 1.9186, + "us-west-2": 1.9186 + }, + "g6e.2xlarge": { + "ap-northeast-1": 3.36688, + "eu-central-1": 3.19905, + "eu-north-1": 2.73124, + "eu-south-2": 2.47776, + "us-east-1": 0.0, + "us-east-2": 2.35728, + "us-west-2": 2.58149 + }, + "g6e.4xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 4.30496, + "eu-north-1": 0.0, + "eu-south-2": 3.65504, + "us-east-1": 0.0, + "us-east-2": 3.17704, + "us-west-2": 3.17704 + }, + "g6e.8xlarge": { + "ap-northeast-1": 6.91335, + "eu-central-1": 6.57437, + "eu-north-1": 5.62948, + "eu-south-2": 5.1175, + "us-east-1": 4.87416, + "us-east-2": 4.87416, + "us-west-2": 4.87416 + }, + "g6e.12xlarge": { + "ap-northeast-1": 17.25757, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 11.57485, + "us-east-1": 11.01104, + "us-east-2": 12.0603, + "us-west-2": 11.01104 + }, + "g6e.16xlarge": { + "ap-northeast-1": 11.68037, + "eu-central-1": 10.16574, + "eu-north-1": 8.72848, + "eu-south-2": 8.67555, + "us-east-1": 8.26839, + "us-east-2": 9.02611, + "us-west-2": 8.26839 + }, + "g6e.24xlarge": { + "ap-northeast-1": 25.07131, + "eu-central-1": 19.87486, + "eu-north-1": 0.0, + "eu-south-2": 16.91193, + "us-east-1": 16.10239, + "us-east-2": 16.10239, + "us-west-2": 16.10239 + }, + "g6e.48xlarge": { + "ap-northeast-1": 45.54232, + "eu-central-1": 39.51932, + "eu-north-1": 33.80395, + "eu-south-2": 33.59347, + "us-east-1": 31.97438, + "us-east-2": 31.97438, + "us-west-2": 31.97438 + }, + "gr6.4xlarge": { + "ap-northeast-1": 2.4051, + "ap-northeast-2": 2.0654, + "ap-south-1": 2.0211, + "ap-southeast-2": 2.174, + "ap-southeast-5": 2.1116, + "ca-central-1": 1.8818, + "eu-central-1": 2.0976, + "eu-central-2": 2.3377, + "eu-north-1": 1.8054, + "eu-south-2": 1.7946, + "eu-west-2": 2.1267, + "eu-west-3": 2.1266, + "sa-east-1": 2.7892, + "us-east-1": 1.712, + "us-east-2": 1.712, + "us-gov-west-1": 2.1129, + "us-west-2": 1.712 + }, + "gr6.8xlarge": { + "ap-northeast-1": 3.89361, + "ap-northeast-2": 3.35369, + "ap-south-1": 3.28328, + "ap-southeast-2": 3.5263, + "ap-southeast-5": 3.42712, + "ca-central-1": 3.06188, + "eu-central-1": 3.40487, + "eu-central-2": 3.78649, + "eu-north-1": 2.94045, + "eu-south-2": 2.92328, + "eu-west-2": 3.45112, + "eu-west-3": 3.45096, + "sa-east-1": 4.5041, + "us-east-1": 2.792, + "us-east-2": 2.792, + "us-gov-west-1": 3.42919, + "us-west-2": 2.792 + }, + "h1.2xlarge": { + "eu-west-1": 0.634, + "us-east-1": 0.583, + "us-east-2": 0.583, + "us-west-2": 0.583 + }, + "h1.4xlarge": { + "eu-west-1": 1.211, + "us-east-1": 1.109, + "us-east-2": 1.169, + "us-west-2": 1.109 + }, + "h1.8xlarge": { + "eu-west-1": 2.422, + "us-east-1": 0.0, + "us-east-2": 2.218, + "us-west-2": 2.218 + }, + "h1.16xlarge": { + "eu-west-1": 4.843, + "us-east-1": 4.435, + "us-east-2": 4.435, + "us-west-2": 4.435 + }, + "hpc6a.48xlarge": { + "ap-southeast-1": 4.3573, + "ap-southeast-2": 4.7977, + "eu-north-1": 4.1298, + "us-east-2": 3.9168, + "us-gov-east-1": 4.5038, + "us-gov-west-1": 4.5038 + }, + "hpc6id.32xlarge": { + "eu-north-1": 6.7264, + "eu-west-3": 7.46414, + "us-east-2": 6.3912, + "us-gov-west-1": 7.5456 + }, + "hpc7a.12xlarge": { + "eu-north-1": 7.9844, + "eu-west-1": 7.9844, + "eu-west-3": 8.8145, + "us-east-2": 7.4592, + "us-gov-west-1": 8.9266 + }, + "hpc7a.24xlarge": { + "eu-north-1": 8.2436, + "eu-west-1": 8.2436, + "eu-west-3": 9.0737, + "us-east-2": 7.7184, + "us-gov-west-1": 9.1858 + }, + "hpc7a.48xlarge": { + "eu-north-1": 8.762, + "eu-west-1": 8.762, + "eu-west-3": 9.5921, + "us-east-2": 8.2368, + "us-gov-west-1": 9.7042 + }, + "hpc7a.96xlarge": { + "eu-north-1": 9.5684, + "eu-west-1": 9.5684, + "eu-west-3": 10.3985, + "us-east-2": 9.0432, + "us-gov-west-1": 10.5106 + }, + "hpc7g.4xlarge": { + "ap-northeast-1": 2.2845, + "eu-west-1": 1.9787, + "us-east-1": 1.856, + "us-gov-west-1": 2.199 + }, + "hpc7g.8xlarge": { + "ap-northeast-1": 2.4573, + "eu-west-1": 2.1515, + "us-east-1": 2.0288, + "us-gov-west-1": 2.3718 + }, + "hpc7g.16xlarge": { + "ap-northeast-1": 2.8029, + "eu-west-1": 2.4971, + "us-east-1": 2.3744, + "us-gov-west-1": 2.7174 + }, + "hs1.8xlarge": { + "ap-northeast-1": 5.57, + "ap-southeast-1": 5.7, + "ap-southeast-2": 5.7, + "eu-west-1": 5.07, + "us-east-1": 4.77, + "us-gov-west-1": 5.69, + "us-west-2": 4.77 + }, + "i2.xlarge": { + "ap-northeast-1": 1.159, + "ap-northeast-2": 1.059, + "ap-south-1": 1.025, + "ap-southeast-1": 1.076, + "ap-southeast-2": 1.076, + "eu-central-1": 0.0, + "eu-west-1": 0.996, + "sa-east-1": 0.0, + "us-east-1": 0.911, + "us-east-2": 0.911, + "us-gov-west-1": 0.0, + "us-west-1": 1.089, + "us-west-2": 0.0 + }, + "i2.2xlarge": { + "ap-northeast-1": 2.117, + "ap-northeast-2": 0.0, + "ap-south-1": 2.049, + "ap-southeast-1": 2.151, + "ap-southeast-2": 0.0, + "eu-central-1": 2.344, + "eu-west-1": 1.991, + "sa-east-1": 0.0, + "us-east-1": 1.821, + "us-east-2": 1.821, + "us-gov-west-1": 0.0, + "us-west-1": 1.991, + "us-west-2": 0.0 + }, + "i2.4xlarge": { + "ap-northeast-1": 4.577, + "ap-northeast-2": 4.177, + "ap-south-1": 4.041, + "ap-southeast-1": 4.652, + "ap-southeast-2": 0.0, + "eu-central-1": 4.63, + "eu-west-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 3.585, + "us-east-2": 0.0, + "us-gov-west-1": 4.674, + "us-west-1": 3.925, + "us-west-2": 0.0 + }, + "i2.8xlarge": { + "ap-northeast-1": 8.354, + "ap-northeast-2": 8.354, + "ap-south-1": 8.082, + "ap-southeast-1": 0.0, + "ap-southeast-2": 8.49, + "eu-central-1": 8.45, + "eu-west-1": 7.85, + "sa-east-1": 0.0, + "us-east-1": 7.17, + "us-east-2": 7.17, + "us-gov-west-1": 8.53, + "us-west-1": 7.85, + "us-west-2": 7.17 + }, + "i3.large": { + "af-south-1": 0.234, + "ap-east-1": 0.235, + "ap-northeast-1": 0.212, + "ap-northeast-2": 0.212, + "ap-northeast-3": 0.212, + "ap-south-1": 0.206, + "ap-south-2": 0.206, + "ap-southeast-1": 0.216, + "ap-southeast-2": 0.216, + "ap-southeast-3": 0.216, + "ap-southeast-4": 0.0, + "ca-central-1": 0.218, + "eu-central-1": 0.233, + "eu-central-2": 0.233, + "eu-north-1": 0.192, + "eu-south-1": 0.21, + "eu-south-2": 0.218, + "eu-west-1": 0.201, + "eu-west-2": 0.21, + "eu-west-3": 0.21, + "il-central-1": 0.227, + "me-central-1": 0.218, + "me-south-1": 0.218, + "sa-east-1": 0.303, + "us-east-1": 0.185, + "us-east-2": 0.185, + "us-gov-east-1": 0.217, + "us-gov-west-1": 0.217, + "us-west-1": 0.201, + "us-west-2": 0.2 + }, + "i3.xlarge": { + "af-south-1": 0.468, + "ap-east-1": 0.47, + "ap-northeast-1": 0.424, + "ap-northeast-2": 0.46, + "ap-northeast-3": 0.424, + "ap-south-1": 0.412, + "ap-south-2": 0.412, + "ap-southeast-1": 0.469, + "ap-southeast-2": 0.432, + "ap-southeast-3": 0.432, + "ap-southeast-4": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.43, + "eu-central-2": 0.508, + "eu-north-1": 0.0, + "eu-south-1": 0.42, + "eu-south-2": 0.402, + "eu-west-1": 0.0, + "eu-west-2": 0.42, + "eu-west-3": 0.42, + "il-central-1": 0.419, + "me-central-1": 0.436, + "me-south-1": 0.436, + "sa-east-1": 0.556, + "us-east-1": 0.0, + "us-east-2": 0.37, + "us-gov-east-1": 0.434, + "us-gov-west-1": 0.471, + "us-west-1": 0.436, + "us-west-2": 0.401 + }, + "i3.metal": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 6.634, + "ap-northeast-2": 6.634, + "ap-northeast-3": 6.634, + "ap-south-1": 6.442, + "ap-southeast-1": 6.762, + "ap-southeast-2": 6.762, + "ca-central-1": 6.282, + "eu-central-1": 6.73, + "eu-north-1": 5.994, + "eu-south-1": 0.0, + "eu-west-1": 6.282, + "eu-west-2": 6.57, + "eu-west-3": 6.57, + "me-south-1": 6.832, + "sa-east-1": 8.746, + "us-east-1": 5.77, + "us-east-2": 5.77, + "us-gov-east-1": 0.0, + "us-gov-west-1": 6.794, + "us-west-1": 6.282, + "us-west-2": 5.77 + }, + "i3.2xlarge": { + "af-south-1": 1.017, + "ap-east-1": 1.022, + "ap-northeast-1": 0.92, + "ap-northeast-2": 0.847, + "ap-northeast-3": 0.847, + "ap-south-1": 0.894, + "ap-south-2": 0.823, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.863, + "ap-southeast-3": 0.938, + "ap-southeast-4": 0.863, + "ca-central-1": 0.803, + "eu-central-1": 0.859, + "eu-central-2": 0.934, + "eu-north-1": 0.767, + "eu-south-1": 0.839, + "eu-south-2": 0.803, + "eu-west-1": 0.803, + "eu-west-2": 0.0, + "eu-west-3": 0.839, + "il-central-1": 0.91, + "me-central-1": 0.948, + "me-south-1": 0.948, + "sa-east-1": 1.111, + "us-east-1": 0.739, + "us-east-2": 0.802, + "us-gov-east-1": 0.867, + "us-gov-west-1": 0.867, + "us-west-1": 0.803, + "us-west-2": 0.739 + }, + "i3.4xlarge": { + "af-south-1": 1.813, + "ap-east-1": 0.0, + "ap-northeast-1": 1.637, + "ap-northeast-2": 1.783, + "ap-northeast-3": 0.0, + "ap-south-1": 1.589, + "ap-south-2": 0.0, + "ap-southeast-1": 1.669, + "ap-southeast-2": 1.669, + "ap-southeast-3": 1.818, + "ap-southeast-4": 0.0, + "ca-central-1": 1.549, + "eu-central-1": 1.661, + "eu-central-2": 0.0, + "eu-north-1": 1.477, + "eu-south-1": 1.621, + "eu-south-2": 0.0, + "eu-west-1": 1.686, + "eu-west-2": 1.621, + "eu-west-3": 1.621, + "il-central-1": 1.618, + "me-central-1": 1.686, + "me-south-1": 1.686, + "sa-east-1": 2.364, + "us-east-1": 1.546, + "us-east-2": 0.0, + "us-gov-east-1": 1.827, + "us-gov-west-1": 0.0, + "us-west-1": 1.549, + "us-west-2": 1.421 + }, + "i3.8xlarge": { + "af-south-1": 3.626, + "ap-east-1": 3.642, + "ap-northeast-1": 3.274, + "ap-northeast-2": 3.274, + "ap-northeast-3": 0.0, + "ap-south-1": 3.178, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.338, + "ap-southeast-3": 3.338, + "ap-southeast-4": 3.637, + "ca-central-1": 0.0, + "eu-central-1": 3.322, + "eu-central-2": 0.0, + "eu-north-1": 2.954, + "eu-south-1": 0.0, + "eu-south-2": 3.098, + "eu-west-1": 3.098, + "eu-west-2": 0.0, + "eu-west-3": 3.242, + "il-central-1": 0.0, + "me-central-1": 3.373, + "me-south-1": 3.373, + "sa-east-1": 4.33, + "us-east-1": 2.842, + "us-east-2": 2.842, + "us-gov-east-1": 3.354, + "us-gov-west-1": 3.354, + "us-west-1": 3.098, + "us-west-2": 2.842 + }, + "i3.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 6.547, + "ap-northeast-3": 0.0, + "ap-south-1": 6.355, + "ap-south-2": 6.355, + "ap-southeast-1": 6.675, + "ap-southeast-2": 6.675, + "ap-southeast-3": 6.675, + "ap-southeast-4": 6.675, + "ca-central-1": 6.195, + "eu-central-1": 6.643, + "eu-central-2": 7.238, + "eu-north-1": 5.907, + "eu-south-1": 6.483, + "eu-south-2": 6.195, + "eu-west-1": 6.195, + "eu-west-2": 0.0, + "eu-west-3": 6.483, + "il-central-1": 6.47, + "me-central-1": 6.746, + "me-south-1": 6.746, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 6.707, + "us-gov-west-1": 6.707, + "us-west-1": 6.195, + "us-west-2": 5.683 + }, + "i3en.large": { + "af-south-1": 0.326, + "ap-east-1": 0.327, + "ap-northeast-1": 0.295, + "ap-northeast-2": 0.312, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.3, + "ap-southeast-3": 0.3, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.273, + "ap-southeast-7": 0.273, + "ca-central-1": 0.295, + "ca-west-1": 0.279, + "eu-central-1": 0.299, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.291, + "eu-south-2": 0.0, + "eu-west-1": 0.279, + "eu-west-2": 0.292, + "eu-west-3": 0.292, + "il-central-1": 0.291, + "me-central-1": 0.304, + "me-south-1": 0.303, + "mx-central-1": 0.281, + "sa-east-1": 0.412, + "us-east-1": 0.255, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.302, + "us-west-1": 0.0, + "us-west-2": 0.255, + "us-west-2-lax-1": 0.0 + }, + "i3en.xlarge": { + "af-south-1": 0.652, + "ap-east-1": 0.693, + "ap-northeast-1": 0.59, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.59, + "ap-south-1": 0.0, + "ap-south-2": 0.572, + "ap-southeast-1": 0.6, + "ap-southeast-2": 0.6, + "ap-southeast-3": 0.635, + "ap-southeast-4": 0.6, + "ap-southeast-5": 0.545, + "ap-southeast-7": 0.545, + "ca-central-1": 0.558, + "ca-west-1": 0.59, + "eu-central-1": 0.0, + "eu-central-2": 0.652, + "eu-north-1": 0.532, + "eu-south-1": 0.582, + "eu-south-2": 0.0, + "eu-west-1": 0.59, + "eu-west-2": 0.618, + "eu-west-3": 0.584, + "il-central-1": 0.583, + "me-central-1": 0.608, + "me-south-1": 0.605, + "mx-central-1": 0.532, + "sa-east-1": 0.0, + "us-east-1": 0.51, + "us-east-2": 0.51, + "us-gov-east-1": 0.604, + "us-gov-west-1": 0.0, + "us-west-1": 0.558, + "us-west-2": 0.51, + "us-west-2-lax-1": 0.6 + }, + "i3en.metal": { + "af-south-1": 15.293, + "ap-east-1": 15.356, + "ap-northeast-1": 13.805, + "ap-northeast-2": 13.805, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 13.373, + "ap-southeast-1": 14.045, + "ap-southeast-2": 14.045, + "ap-southeast-3": 0.0, + "ap-southeast-4": 14.045, + "ap-southeast-5": 0.0, + "ap-southeast-7": 12.744, + "ca-central-1": 0.0, + "ca-west-1": 13.037, + "eu-central-1": 13.997, + "eu-central-2": 15.293, + "eu-north-1": 12.413, + "eu-south-1": 13.622, + "eu-south-2": 13.037, + "eu-west-1": 13.037, + "eu-west-2": 13.661, + "eu-west-3": 13.661, + "il-central-1": 13.637, + "me-central-1": 14.237, + "me-south-1": 14.179, + "mx-central-1": 12.427, + "sa-east-1": 18.317, + "us-east-1": 11.885, + "us-east-2": 11.885, + "us-gov-east-1": 14.141, + "us-gov-west-1": 14.141, + "us-west-1": 13.037, + "us-west-2": 11.885, + "us-west-2-lax-1": 14.054 + }, + "i3en.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.308, + "ap-northeast-1": 1.179, + "ap-northeast-2": 1.248, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 1.143, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.199, + "ap-southeast-3": 1.199, + "ap-southeast-4": 1.199, + "ap-southeast-5": 1.091, + "ap-southeast-7": 1.154, + "ca-central-1": 1.115, + "ca-west-1": 1.115, + "eu-central-1": 0.0, + "eu-central-2": 1.303, + "eu-north-1": 1.063, + "eu-south-1": 1.164, + "eu-south-2": 1.115, + "eu-west-1": 0.0, + "eu-west-2": 1.167, + "eu-west-3": 1.167, + "il-central-1": 1.165, + "me-central-1": 0.0, + "me-south-1": 1.21, + "mx-central-1": 1.064, + "sa-east-1": 1.555, + "us-east-1": 1.019, + "us-east-2": 1.019, + "us-gov-east-1": 1.207, + "us-gov-west-1": 1.207, + "us-west-1": 1.115, + "us-west-2": 1.019, + "us-west-2-lax-1": 1.2 + }, + "i3en.3xlarge": { + "af-south-1": 2.028, + "ap-east-1": 1.92, + "ap-northeast-1": 1.726, + "ap-northeast-2": 1.726, + "ap-northeast-3": 0.0, + "ap-south-1": 1.772, + "ap-south-2": 0.0, + "ap-southeast-1": 1.756, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.756, + "ap-southeast-4": 1.756, + "ap-southeast-5": 1.688, + "ap-southeast-7": 1.593, + "ca-central-1": 1.63, + "ca-west-1": 0.0, + "eu-central-1": 1.75, + "eu-central-2": 0.0, + "eu-north-1": 1.552, + "eu-south-1": 1.703, + "eu-south-2": 1.63, + "eu-west-1": 1.63, + "eu-west-2": 1.708, + "eu-west-3": 1.708, + "il-central-1": 1.705, + "me-central-1": 1.887, + "me-south-1": 1.772, + "mx-central-1": 1.646, + "sa-east-1": 2.43, + "us-east-1": 1.574, + "us-east-2": 1.486, + "us-gov-east-1": 1.768, + "us-gov-west-1": 1.874, + "us-west-1": 1.63, + "us-west-2": 1.574, + "us-west-2-lax-1": 1.862 + }, + "i3en.6xlarge": { + "af-south-1": 3.823, + "ap-east-1": 3.839, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.659, + "ap-northeast-3": 3.657, + "ap-south-1": 0.0, + "ap-south-2": 3.343, + "ap-southeast-1": 3.511, + "ap-southeast-2": 0.0, + "ap-southeast-3": 3.511, + "ap-southeast-4": 0.0, + "ap-southeast-5": 3.186, + "ap-southeast-7": 3.186, + "ca-central-1": 0.0, + "ca-west-1": 3.259, + "eu-central-1": 0.0, + "eu-central-2": 3.823, + "eu-north-1": 3.103, + "eu-south-1": 3.406, + "eu-south-2": 3.259, + "eu-west-1": 3.259, + "eu-west-2": 3.415, + "eu-west-3": 3.415, + "il-central-1": 0.0, + "me-central-1": 3.559, + "me-south-1": 3.759, + "mx-central-1": 3.292, + "sa-east-1": 4.579, + "us-east-1": 2.971, + "us-east-2": 2.971, + "us-gov-east-1": 3.535, + "us-gov-west-1": 3.535, + "us-west-1": 3.454, + "us-west-2": 2.971, + "us-west-2-lax-1": 3.514 + }, + "i3en.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 7.678, + "ap-northeast-1": 6.902, + "ap-northeast-2": 0.0, + "ap-northeast-3": 7.314, + "ap-south-1": 0.0, + "ap-south-2": 6.686, + "ap-southeast-1": 7.022, + "ap-southeast-2": 7.022, + "ap-southeast-3": 0.0, + "ap-southeast-4": 7.022, + "ap-southeast-5": 0.0, + "ap-southeast-7": 6.753, + "ca-central-1": 6.909, + "ca-west-1": 6.518, + "eu-central-1": 6.998, + "eu-central-2": 0.0, + "eu-north-1": 6.577, + "eu-south-1": 6.811, + "eu-south-2": 6.909, + "eu-west-1": 0.0, + "eu-west-2": 6.83, + "eu-west-3": 6.83, + "il-central-1": 6.818, + "me-central-1": 7.118, + "me-south-1": 7.09, + "mx-central-1": 6.214, + "sa-east-1": 9.158, + "us-east-1": 5.942, + "us-east-2": 5.942, + "us-gov-east-1": 7.07, + "us-gov-west-1": 7.496, + "us-west-1": 6.518, + "us-west-2": 5.942, + "us-west-2-lax-1": 0.0 + }, + "i3en.24xlarge": { + "af-south-1": 15.293, + "ap-east-1": 0.0, + "ap-northeast-1": 13.805, + "ap-northeast-2": 13.805, + "ap-northeast-3": 13.805, + "ap-south-1": 13.373, + "ap-south-2": 13.373, + "ap-southeast-1": 14.045, + "ap-southeast-2": 14.045, + "ap-southeast-3": 14.045, + "ap-southeast-4": 14.045, + "ap-southeast-5": 12.744, + "ap-southeast-7": 12.744, + "ca-central-1": 13.037, + "ca-west-1": 13.037, + "eu-central-1": 13.997, + "eu-central-2": 15.293, + "eu-north-1": 12.413, + "eu-south-1": 13.622, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 13.661, + "eu-west-3": 13.661, + "il-central-1": 13.637, + "me-central-1": 0.0, + "me-south-1": 14.179, + "mx-central-1": 12.427, + "sa-east-1": 0.0, + "us-east-1": 11.885, + "us-east-2": 11.885, + "us-gov-east-1": 14.141, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 14.054 + }, + "i3p.16xlarge": { + "us-gov-west-1": 6.707 + }, + "i4g.large": { + "ap-southeast-1": 0.21393, + "ca-central-1": 0.21602, + "eu-west-1": 0.0, + "us-east-1": 0.18324, + "us-east-2": 0.18324, + "us-west-2": 0.0 + }, + "i4g.xlarge": { + "ap-southeast-1": 0.42786, + "ca-central-1": 0.398, + "eu-west-1": 0.43204, + "us-east-1": 0.36648, + "us-east-2": 0.36648, + "us-west-2": 0.0 + }, + "i4g.2xlarge": { + "ap-southeast-1": 0.85572, + "ca-central-1": 0.796, + "eu-west-1": 0.0, + "us-east-1": 0.79474, + "us-east-2": 0.73296, + "us-west-2": 0.0 + }, + "i4g.4xlarge": { + "ap-southeast-1": 0.0, + "ca-central-1": 1.67055, + "eu-west-1": 1.53439, + "us-east-1": 1.53187, + "us-east-2": 0.0, + "us-west-2": 1.40832 + }, + "i4g.8xlarge": { + "ap-southeast-1": 0.0, + "ca-central-1": 3.06879, + "eu-west-1": 0.0, + "us-east-1": 2.81664, + "us-east-2": 2.81664, + "us-west-2": 2.81664 + }, + "i4g.16xlarge": { + "ap-southeast-1": 0.0, + "ca-central-1": 6.13757, + "eu-west-1": 6.13757, + "us-east-1": 5.63328, + "us-east-2": 0.0, + "us-west-2": 5.63328 + }, + "i4i.large": { + "af-south-1": 0.254, + "ap-east-1": 0.278, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.23, + "ap-northeast-3": 0.23, + "ap-south-1": 0.224, + "ap-south-2": 0.224, + "ap-southeast-1": 0.255, + "ap-southeast-2": 0.235, + "ap-southeast-3": 0.235, + "ap-southeast-4": 0.235, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.232, + "ca-central-1": 0.237, + "ca-west-1": 0.218, + "eu-central-1": 0.233, + "eu-central-2": 0.254, + "eu-north-1": 0.0, + "eu-south-1": 0.228, + "eu-west-1": 0.218, + "eu-west-2": 0.228, + "eu-west-3": 0.0, + "il-central-1": 0.227, + "me-central-1": 0.237, + "me-south-1": 0.257, + "mx-central-1": 0.227, + "sa-east-1": 0.33, + "us-east-1": 0.2, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.236, + "us-west-1": 0.218, + "us-west-2": 0.2 + }, + "i4i.xlarge": { + "af-south-1": 0.509, + "ap-east-1": 0.511, + "ap-northeast-1": 0.5, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.46, + "ap-south-1": 0.486, + "ap-south-2": 0.486, + "ap-southeast-1": 0.51, + "ap-southeast-2": 0.469, + "ap-southeast-3": 0.469, + "ap-southeast-4": 0.51, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.436, + "eu-central-1": 0.508, + "eu-central-2": 0.508, + "eu-north-1": 0.0, + "eu-south-1": 0.456, + "eu-west-1": 0.436, + "eu-west-2": 0.456, + "eu-west-3": 0.0, + "il-central-1": 0.495, + "me-central-1": 0.473, + "me-south-1": 0.473, + "mx-central-1": 0.418, + "sa-east-1": 0.0, + "us-east-1": 0.401, + "us-east-2": 0.435, + "us-gov-east-1": 0.471, + "us-gov-west-1": 0.513, + "us-west-1": 0.436, + "us-west-2": 0.435 + }, + "i4i.metal": { + "af-south-1": 0.0, + "ap-east-1": 15.731, + "ap-northeast-1": 14.112, + "ap-northeast-2": 14.112, + "ap-northeast-3": 0.0, + "ap-south-1": 13.69, + "ap-south-2": 0.0, + "ap-southeast-1": 14.394, + "ap-southeast-2": 0.0, + "ap-southeast-3": 14.394, + "ap-southeast-4": 14.394, + "ap-southeast-5": 13.077, + "ap-southeast-7": 13.077, + "ca-central-1": 13.338, + "ca-west-1": 0.0, + "eu-central-1": 14.323, + "eu-central-2": 0.0, + "eu-north-1": 12.704, + "eu-south-1": 13.971, + "eu-west-1": 13.338, + "eu-west-2": 13.971, + "eu-west-3": 13.971, + "il-central-1": 13.943, + "me-central-1": 14.534, + "me-south-1": 0.0, + "mx-central-1": 12.76, + "sa-east-1": 18.758, + "us-east-1": 12.211, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 14.464, + "us-west-1": 13.338, + "us-west-2": 0.0 + }, + "i4i.2xlarge": { + "af-south-1": 1.017, + "ap-east-1": 1.112, + "ap-northeast-1": 1.001, + "ap-northeast-2": 1.001, + "ap-northeast-3": 0.92, + "ap-south-1": 0.0, + "ap-south-2": 0.972, + "ap-southeast-1": 1.02, + "ap-southeast-2": 0.938, + "ap-southeast-3": 0.938, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.856, + "ca-central-1": 0.948, + "ca-west-1": 0.872, + "eu-central-1": 0.934, + "eu-central-2": 1.015, + "eu-north-1": 0.832, + "eu-south-1": 0.912, + "eu-west-1": 0.872, + "eu-west-2": 0.912, + "eu-west-3": 0.912, + "il-central-1": 0.91, + "me-central-1": 1.03, + "me-south-1": 0.947, + "mx-central-1": 0.836, + "sa-east-1": 1.211, + "us-east-1": 0.802, + "us-east-2": 0.802, + "us-gov-east-1": 0.942, + "us-gov-west-1": 0.942, + "us-west-1": 0.872, + "us-west-2": 0.87 + }, + "i4i.4xlarge": { + "af-south-1": 1.977, + "ap-east-1": 1.986, + "ap-northeast-1": 1.783, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 1.73, + "ap-south-2": 1.73, + "ap-southeast-1": 1.818, + "ap-southeast-2": 1.818, + "ap-southeast-3": 1.983, + "ap-southeast-4": 1.983, + "ap-southeast-5": 1.654, + "ap-southeast-7": 1.654, + "ca-central-1": 1.686, + "ca-west-1": 1.686, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 1.607, + "eu-south-1": 1.766, + "eu-west-1": 1.838, + "eu-west-2": 1.925, + "eu-west-3": 1.766, + "il-central-1": 1.762, + "me-central-1": 1.836, + "me-south-1": 1.836, + "mx-central-1": 1.758, + "sa-east-1": 2.364, + "us-east-1": 1.546, + "us-east-2": 1.546, + "us-gov-east-1": 1.827, + "us-gov-west-1": 1.827, + "us-west-1": 1.686, + "us-west-2": 1.546 + }, + "i4i.8xlarge": { + "af-south-1": 3.954, + "ap-east-1": 4.334, + "ap-northeast-1": 3.566, + "ap-northeast-2": 3.566, + "ap-northeast-3": 3.888, + "ap-south-1": 3.461, + "ap-south-2": 3.772, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.637, + "ap-southeast-3": 3.637, + "ap-southeast-4": 0.0, + "ap-southeast-5": 3.308, + "ap-southeast-7": 3.308, + "ca-central-1": 3.373, + "ca-west-1": 3.373, + "eu-central-1": 3.619, + "eu-central-2": 3.947, + "eu-north-1": 3.501, + "eu-south-1": 3.531, + "eu-west-1": 3.373, + "eu-west-2": 3.531, + "eu-west-3": 3.531, + "il-central-1": 3.524, + "me-central-1": 3.672, + "me-south-1": 0.0, + "mx-central-1": 3.228, + "sa-east-1": 4.728, + "us-east-1": 3.091, + "us-east-2": 3.091, + "us-gov-east-1": 3.985, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 3.091 + }, + "i4i.12xlarge": { + "af-south-1": 5.93, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.35, + "ap-northeast-3": 5.35, + "ap-south-1": 5.658, + "ap-south-2": 5.191, + "ap-southeast-1": 5.949, + "ap-southeast-2": 5.949, + "ap-southeast-3": 0.0, + "ap-southeast-4": 5.455, + "ap-southeast-5": 4.962, + "ap-southeast-7": 4.962, + "ca-central-1": 5.059, + "ca-west-1": 5.059, + "eu-central-1": 5.92, + "eu-central-2": 5.92, + "eu-north-1": 4.822, + "eu-south-1": 0.0, + "eu-west-1": 5.059, + "eu-west-2": 0.0, + "eu-west-3": 5.775, + "me-central-1": 5.508, + "me-south-1": 0.0, + "mx-central-1": 4.843, + "sa-east-1": 7.092, + "us-east-1": 4.637, + "us-east-2": 5.049, + "us-gov-east-1": 5.482, + "us-gov-west-1": 5.978, + "us-west-1": 5.059, + "us-west-2": 4.637 + }, + "i4i.16xlarge": { + "af-south-1": 7.907, + "ap-east-1": 8.668, + "ap-northeast-1": 7.777, + "ap-northeast-2": 7.133, + "ap-northeast-3": 7.133, + "ap-south-1": 7.545, + "ap-south-2": 7.545, + "ap-southeast-1": 7.274, + "ap-southeast-2": 0.0, + "ap-southeast-3": 7.932, + "ap-southeast-4": 0.0, + "ap-southeast-5": 6.615, + "ap-southeast-7": 6.615, + "ca-central-1": 6.746, + "ca-west-1": 6.746, + "eu-central-1": 7.238, + "eu-central-2": 8.613, + "eu-north-1": 7.003, + "eu-south-1": 0.0, + "eu-west-1": 7.351, + "eu-west-2": 7.062, + "eu-west-3": 7.7, + "il-central-1": 7.048, + "me-central-1": 7.344, + "me-south-1": 7.344, + "mx-central-1": 0.0, + "sa-east-1": 9.456, + "us-east-1": 6.182, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 7.309, + "us-west-1": 6.746, + "us-west-2": 6.732 + }, + "i4i.24xlarge": { + "af-south-1": 11.8608, + "ap-east-1": 13.00128, + "ap-northeast-1": 10.6992, + "ap-northeast-2": 10.6992, + "ap-northeast-3": 10.6992, + "ap-south-1": 11.31696, + "ap-south-2": 10.3824, + "ap-southeast-1": 10.9104, + "ap-southeast-2": 11.89776, + "ap-southeast-3": 0.0, + "ap-southeast-4": 10.9104, + "ap-southeast-5": 9.92304, + "ap-southeast-7": 9.92304, + "ca-central-1": 10.1184, + "ca-west-1": 0.0, + "eu-central-1": 10.8576, + "eu-central-2": 12.91997, + "eu-north-1": 10.50384, + "eu-south-1": 10.5936, + "eu-west-1": 10.1184, + "eu-west-2": 10.5936, + "eu-west-3": 10.5936, + "me-central-1": 12.01392, + "me-south-1": 0.0, + "mx-central-1": 9.68544, + "sa-east-1": 14.184, + "us-east-1": 9.2736, + "us-east-2": 10.09728, + "us-gov-east-1": 10.9632, + "us-gov-west-1": 0.0, + "us-west-1": 10.1184, + "us-west-2": 9.2736 + }, + "i4i.32xlarge": { + "af-south-1": 15.6608, + "ap-east-1": 0.0, + "ap-northeast-1": 14.112, + "ap-northeast-2": 14.112, + "ap-northeast-3": 14.112, + "ap-south-1": 13.6896, + "ap-south-2": 13.6896, + "ap-southeast-1": 14.3936, + "ap-southeast-2": 14.3936, + "ap-southeast-3": 14.3936, + "ap-southeast-4": 0.0, + "ap-southeast-5": 13.07712, + "ap-southeast-7": 0.0, + "ca-central-1": 13.3376, + "ca-west-1": 13.3376, + "eu-central-1": 14.3232, + "eu-central-2": 15.63264, + "eu-north-1": 12.704, + "eu-south-1": 13.9712, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 13.9712, + "il-central-1": 13.94304, + "me-central-1": 14.5344, + "me-south-1": 14.5344, + "mx-central-1": 0.0, + "sa-east-1": 18.7584, + "us-east-1": 0.0, + "us-east-2": 12.2112, + "us-gov-east-1": 14.464, + "us-gov-west-1": 0.0, + "us-west-1": 13.3376, + "us-west-2": 12.2112 + }, + "i7ie.large": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.3595, + "eu-west-2": 0.3313, + "us-east-1": 0.0, + "us-east-2": 0.3056, + "us-west-2": 0.2887 + }, + "i7ie.xlarge": { + "ap-northeast-1": 0.7092, + "eu-central-1": 0.6786, + "eu-west-2": 0.7019, + "us-east-1": 0.5774, + "us-east-2": 0.0, + "us-west-2": 0.5774 + }, + "i7ie.2xlarge": { + "ap-northeast-1": 1.3388, + "eu-central-1": 0.0, + "eu-west-2": 1.325, + "us-east-1": 1.1548, + "us-east-2": 1.1548, + "us-west-2": 1.1548 + }, + "i7ie.3xlarge": { + "ap-northeast-1": 1.965, + "eu-central-1": 1.9926, + "eu-west-2": 1.9443, + "us-east-1": 1.689, + "us-east-2": 1.689, + "us-west-2": 1.689 + }, + "i7ie.6xlarge": { + "ap-northeast-1": 3.93, + "eu-central-1": 3.9852, + "eu-west-2": 3.8886, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 3.378 + }, + "i7ie.12xlarge": { + "ap-northeast-1": 7.86, + "eu-central-1": 7.9704, + "eu-west-2": 7.7772, + "us-east-1": 6.756, + "us-east-2": 6.756, + "us-west-2": 6.756 + }, + "i7ie.18xlarge": { + "ap-northeast-1": 11.79, + "eu-central-1": 0.0, + "eu-west-2": 12.3747, + "us-east-1": 10.134, + "us-east-2": 0.0, + "us-west-2": 10.134 + }, + "i7ie.24xlarge": { + "ap-northeast-1": 16.6746, + "eu-central-1": 15.9408, + "eu-west-2": 15.5544, + "us-east-1": 13.512, + "us-east-2": 14.3212, + "us-west-2": 13.512 + }, + "i7ie.48xlarge": { + "ap-northeast-1": 33.1188, + "eu-central-1": 31.6512, + "eu-west-2": 30.8784, + "us-east-1": 28.4119, + "us-east-2": 26.7936, + "us-west-2": 26.7936 + }, + "i8g.large": { + "eu-central-1": 0.2334, + "us-east-1": 0.2176, + "us-west-2": 0.0 + }, + "i8g.xlarge": { + "eu-central-1": 0.0, + "us-east-1": 0.4008, + "us-west-2": 0.0 + }, + "i8g.metal-24xl": { + "eu-central-1": 11.83968, + "us-east-1": 9.2736, + "us-west-2": 9.2736 + }, + "i8g.2xlarge": { + "eu-central-1": 0.9336, + "us-east-1": 0.0, + "us-west-2": 0.8016 + }, + "i8g.4xlarge": { + "eu-central-1": 1.8096, + "us-east-1": 1.6829, + "us-west-2": 0.0 + }, + "i8g.8xlarge": { + "eu-central-1": 0.0, + "us-east-1": 3.0912, + "us-west-2": 0.0 + }, + "i8g.12xlarge": { + "eu-central-1": 5.4288, + "us-east-1": 5.04864, + "us-west-2": 4.6368 + }, + "i8g.16xlarge": { + "eu-central-1": 7.89312, + "us-east-1": 0.0, + "us-west-2": 6.73152 + }, + "i8g.24xlarge": { + "eu-central-1": 10.8576, + "us-east-1": 10.09728, + "us-west-2": 9.2736 + }, + "im4gn.large": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.24568, + "eu-south-2": 0.24941, + "eu-west-1": 0.22935, + "eu-west-2": 0.23985, + "eu-west-3": 0.23985, + "us-east-1": 0.2107, + "us-east-2": 0.2107, + "us-west-2": 0.2107 + }, + "im4gn.xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.49368, + "ap-southeast-2": 0.53729, + "ca-central-1": 0.49881, + "eu-central-1": 0.49135, + "eu-south-2": 0.4587, + "eu-west-1": 0.4587, + "eu-west-2": 0.47969, + "eu-west-3": 0.47969, + "us-east-1": 0.42139, + "us-east-2": 0.42139, + "us-west-2": 0.0 + }, + "im4gn.2xlarge": { + "ap-northeast-1": 1.05406, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.98737, + "ca-central-1": 0.99763, + "eu-central-1": 0.9827, + "eu-south-2": 0.99762, + "eu-west-1": 0.91741, + "eu-west-2": 0.95938, + "eu-west-3": 0.95938, + "us-east-1": 0.0, + "us-east-2": 0.84278, + "us-west-2": 0.0 + }, + "im4gn.4xlarge": { + "ap-northeast-1": 1.87982, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.91714, + "ca-central-1": 1.77722, + "eu-central-1": 1.90781, + "eu-south-2": 1.7772, + "eu-west-1": 1.93766, + "eu-west-2": 1.86117, + "eu-west-3": 1.86117, + "us-east-1": 1.62797, + "us-east-2": 0.0, + "us-west-2": 1.62797 + }, + "im4gn.8xlarge": { + "ap-northeast-1": 3.75965, + "ap-southeast-1": 3.83427, + "ap-southeast-2": 3.83427, + "ca-central-1": 3.55443, + "eu-central-1": 4.16262, + "eu-south-2": 3.5544, + "eu-west-1": 3.55443, + "eu-west-2": 3.72234, + "eu-west-3": 3.72234, + "us-east-1": 3.25594, + "us-east-2": 3.54697, + "us-west-2": 3.25594 + }, + "im4gn.16xlarge": { + "ap-northeast-1": 7.5193, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 7.10886, + "eu-central-1": 7.63123, + "eu-south-2": 7.1088, + "eu-west-1": 7.10886, + "eu-west-2": 7.44467, + "eu-west-3": 7.44467, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 6.51187 + }, + "inf1.xlarge": { + "af-south-1": 0.36, + "ap-east-1": 0.409, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.355, + "ap-northeast-3": 0.0, + "ap-south-1": 0.298, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.343, + "ca-central-1": 0.312, + "eu-central-1": 0.36, + "eu-north-1": 0.0, + "eu-south-1": 0.325, + "eu-west-1": 0.312, + "eu-west-2": 0.341, + "eu-west-3": 0.324, + "me-south-1": 0.337, + "sa-east-1": 0.435, + "us-east-1": 0.286, + "us-east-2": 0.286, + "us-gov-east-1": 0.345, + "us-gov-west-1": 0.345, + "us-west-1": 0.332, + "us-west-2": 0.286 + }, + "inf1.2xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.604, + "ap-northeast-2": 0.561, + "ap-northeast-3": 0.0, + "ap-south-1": 0.496, + "ap-southeast-1": 0.633, + "ap-southeast-2": 0.595, + "ca-central-1": 0.519, + "eu-central-1": 0.568, + "eu-north-1": 0.5, + "eu-south-1": 0.0, + "eu-west-1": 0.519, + "eu-west-2": 0.539, + "eu-west-3": 0.564, + "me-south-1": 0.559, + "sa-east-1": 0.713, + "us-east-1": 0.477, + "us-east-2": 0.477, + "us-gov-east-1": 0.572, + "us-gov-west-1": 0.0, + "us-west-1": 0.576, + "us-west-2": 0.499 + }, + "inf1.6xlarge": { + "ap-east-1": 2.187, + "ap-northeast-1": 1.949, + "ap-northeast-2": 1.712, + "ap-northeast-3": 0.0, + "ap-south-1": 1.575, + "ap-southeast-1": 1.949, + "ap-southeast-2": 1.735, + "ca-central-1": 0.0, + "eu-central-1": 1.735, + "eu-north-1": 1.513, + "eu-south-1": 0.0, + "eu-west-1": 1.574, + "eu-west-2": 1.725, + "eu-west-3": 1.638, + "me-south-1": 1.706, + "sa-east-1": 0.0, + "us-east-1": 1.44, + "us-east-2": 1.51, + "us-gov-east-1": 1.747, + "us-gov-west-1": 1.747, + "us-west-1": 1.677, + "us-west-2": 1.44 + }, + "inf1.24xlarge": { + "af-south-1": 7.661, + "ap-east-1": 8.311, + "ap-northeast-1": 7.413, + "ap-northeast-2": 6.849, + "ap-northeast-3": 0.0, + "ap-south-1": 6.3, + "ap-southeast-1": 0.0, + "ap-southeast-2": 6.938, + "ca-central-1": 6.297, + "eu-central-1": 0.0, + "eu-north-1": 6.053, + "eu-south-1": 0.0, + "eu-west-1": 6.297, + "eu-west-2": 0.0, + "eu-west-3": 6.885, + "me-south-1": 6.823, + "sa-east-1": 8.837, + "us-east-1": 6.041, + "us-east-2": 0.0, + "us-gov-east-1": 6.99, + "us-gov-west-1": 0.0, + "us-west-1": 6.708, + "us-west-2": 5.758 + }, + "inf2.xlarge": { + "ap-northeast-1": 1.1949, + "ap-south-1": 1.04326, + "ap-southeast-1": 1.11908, + "ap-southeast-2": 0.0, + "eu-central-1": 1.1949, + "eu-north-1": 0.89162, + "eu-west-1": 1.00535, + "eu-west-2": 1.30863, + "eu-west-3": 0.0, + "sa-east-1": 1.34654, + "us-east-1": 0.8158, + "us-east-2": 0.0, + "us-west-2": 0.8158 + }, + "inf2.8xlarge": { + "ap-northeast-1": 3.29739, + "ap-south-1": 2.90382, + "ap-southeast-1": 3.1006, + "ap-southeast-2": 2.90382, + "eu-central-1": 3.29739, + "eu-north-1": 2.72671, + "eu-west-1": 3.05141, + "eu-west-2": 3.29739, + "eu-west-3": 3.1006, + "sa-east-1": 4.0255, + "us-east-1": 2.31346, + "us-east-2": 2.31346, + "us-west-2": 2.31346 + }, + "inf2.24xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 10.12369, + "ap-southeast-2": 9.47462, + "eu-central-1": 10.77275, + "eu-north-1": 8.1765, + "eu-west-1": 9.15009, + "eu-west-2": 10.77275, + "eu-west-3": 10.12369, + "sa-east-1": 12.07088, + "us-east-1": 7.52743, + "us-east-2": 7.52743, + "us-west-2": 7.52743 + }, + "inf2.48xlarge": { + "ap-northeast-1": 23.26229, + "ap-south-1": 18.71885, + "ap-southeast-1": 20.01697, + "ap-southeast-2": 18.71885, + "eu-central-1": 21.3151, + "eu-north-1": 16.12259, + "eu-west-1": 19.69244, + "eu-west-2": 0.0, + "eu-west-3": 20.01697, + "sa-east-1": 23.91135, + "us-east-1": 14.82447, + "us-east-2": 14.82447, + "us-west-2": 14.82447 + }, + "is4gen.medium": { + "ap-northeast-1": 0.18398, + "ap-south-1": 0.17815, + "ap-southeast-1": 0.18716, + "ap-southeast-2": 0.18716, + "ca-central-1": 0.17378, + "eu-central-1": 0.18653, + "eu-west-1": 0.17378, + "eu-west-2": 0.18206, + "eu-west-3": 0.18206, + "us-east-1": 0.15848, + "us-east-2": 0.15848, + "us-west-2": 0.15848 + }, + "is4gen.large": { + "ap-northeast-1": 0.36795, + "ap-south-1": 0.3563, + "ap-southeast-1": 0.37433, + "ap-southeast-2": 0.37433, + "ca-central-1": 0.34755, + "eu-central-1": 0.37305, + "eu-west-1": 0.34755, + "eu-west-2": 0.36413, + "eu-west-3": 0.36413, + "us-east-1": 0.31695, + "us-east-2": 0.31695, + "us-west-2": 0.31695 + }, + "is4gen.xlarge": { + "ap-northeast-1": 0.7359, + "ap-south-1": 0.7126, + "ap-southeast-1": 0.74865, + "ap-southeast-2": 0.74865, + "ca-central-1": 0.6951, + "eu-central-1": 0.7461, + "eu-west-1": 0.6951, + "eu-west-2": 0.72825, + "eu-west-3": 0.72825, + "us-east-1": 0.6339, + "us-east-2": 0.6339, + "us-west-2": 0.6339 + }, + "is4gen.2xlarge": { + "ap-northeast-1": 1.4718, + "ap-south-1": 1.4252, + "ap-southeast-1": 1.4973, + "ap-southeast-2": 1.4973, + "ca-central-1": 1.3902, + "eu-central-1": 1.4922, + "eu-west-1": 1.3902, + "eu-west-2": 1.4565, + "eu-west-3": 1.4565, + "us-east-1": 1.2678, + "us-east-2": 1.2678, + "us-west-2": 1.2678 + }, + "is4gen.4xlarge": { + "ap-northeast-1": 2.886, + "ap-south-1": 2.7928, + "ap-southeast-1": 2.93701, + "ap-southeast-2": 2.93701, + "ca-central-1": 2.7228, + "eu-central-1": 2.9268, + "eu-west-1": 2.7228, + "eu-west-2": 2.85541, + "eu-west-3": 2.85541, + "us-east-1": 2.478, + "us-east-2": 2.478, + "us-west-2": 2.478 + }, + "is4gen.8xlarge": { + "ap-northeast-1": 5.772, + "ap-south-1": 5.5856, + "ap-southeast-1": 5.87402, + "ap-southeast-2": 5.87402, + "ca-central-1": 5.4456, + "eu-central-1": 5.8536, + "eu-west-1": 5.4456, + "eu-west-2": 5.71082, + "eu-west-3": 5.71082, + "us-east-1": 4.956, + "us-east-2": 4.956, + "us-west-2": 4.956 + }, + "m1.small": { + "ap-northeast-1": 0.075, + "ap-southeast-1": 0.072, + "ap-southeast-2": 0.072, + "eu-west-1": 0.061, + "sa-east-1": 0.072, + "us-east-1": 0.058, + "us-gov-west-1": 0.067, + "us-west-1": 0.061, + "us-west-2": 0.058 + }, + "m1.medium": { + "ap-northeast-1": 0.136, + "ap-southeast-1": 0.131, + "ap-southeast-2": 0.131, + "eu-west-1": 0.109, + "sa-east-1": 0.131, + "us-east-1": 0.101, + "us-gov-west-1": 0.12, + "us-west-1": 0.109, + "us-west-2": 0.101 + }, + "m1.large": { + "ap-northeast-1": 0.272, + "ap-southeast-1": 0.262, + "ap-southeast-2": 0.262, + "eu-west-1": 0.22, + "sa-east-1": 0.262, + "us-east-1": 0.204, + "us-gov-west-1": 0.24, + "us-west-1": 0.22, + "us-west-2": 0.204 + }, + "m1.xlarge": { + "ap-northeast-1": 0.544, + "ap-southeast-1": 0.525, + "ap-southeast-2": 0.525, + "eu-west-1": 0.437, + "sa-east-1": 0.525, + "us-east-1": 0.41, + "us-gov-west-1": 0.481, + "us-west-1": 0.437, + "us-west-2": 0.41 + }, + "m2.xlarge": { + "ap-northeast-1": 0.316, + "ap-southeast-1": 0.325, + "ap-southeast-2": 0.325, + "eu-west-1": 0.304, + "sa-east-1": 0.352, + "us-east-1": 0.274, + "us-gov-west-1": 0.322, + "us-west-1": 0.304, + "us-west-2": 0.274 + }, + "m2.2xlarge": { + "ap-northeast-1": 0.633, + "ap-southeast-1": 0.65, + "ap-southeast-2": 0.65, + "eu-west-1": 0.61, + "sa-east-1": 0.703, + "us-east-1": 0.55, + "us-gov-west-1": 0.644, + "us-west-1": 0.61, + "us-west-2": 0.55 + }, + "m2.4xlarge": { + "ap-northeast-1": 1.27, + "ap-southeast-1": 1.298, + "ap-southeast-2": 1.298, + "eu-west-1": 1.22, + "sa-east-1": 1.406, + "us-east-1": 1.1, + "us-gov-west-1": 1.286, + "us-west-1": 1.22, + "us-west-2": 1.1 + }, + "m3.medium": { + "ap-northeast-1": 0.12, + "ap-northeast-2": 0.151, + "ap-southeast-1": 0.122, + "ap-southeast-2": 0.117, + "eu-central-1": 0.093, + "eu-west-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.081, + "us-gov-west-1": 0.0, + "us-west-1": 0.091, + "us-west-2": 0.088 + }, + "m3.large": { + "ap-northeast-1": 0.221, + "ap-northeast-2": 0.243, + "ap-southeast-1": 0.244, + "ap-southeast-2": 0.215, + "eu-central-1": 0.187, + "eu-west-1": 0.175, + "sa-east-1": 0.219, + "us-east-1": 0.0, + "us-gov-west-1": 0.214, + "us-west-1": 0.183, + "us-west-2": 0.163 + }, + "m3.xlarge": { + "ap-northeast-1": 0.442, + "ap-northeast-2": 0.462325, + "ap-southeast-1": 0.45, + "ap-southeast-2": 0.0, + "eu-central-1": 0.374, + "eu-west-1": 0.379, + "sa-east-1": 0.438, + "us-east-1": 0.0, + "us-gov-west-1": 0.394, + "us-west-1": 0.366, + "us-west-2": 0.352 + }, + "m3.2xlarge": { + "ap-northeast-1": 0.96, + "ap-northeast-2": 0.862, + "ap-southeast-1": 0.899, + "ap-southeast-2": 0.859, + "eu-central-1": 0.747, + "eu-west-1": 0.699, + "sa-east-1": 0.875, + "us-east-1": 0.651, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m4.large": { + "ap-northeast-1": 0.1578, + "ap-northeast-2": 0.1518, + "ap-northeast-3": 0.1578, + "ap-south-1": 0.1338, + "ap-southeast-1": 0.1663, + "ap-southeast-2": 0.1538, + "ca-central-1": 0.1509, + "eu-central-1": 0.1488, + "eu-west-1": 0.0, + "eu-west-2": 0.1448, + "sa-east-1": 0.1878, + "us-east-1": 0.1288, + "us-east-2": 0.1288, + "us-gov-west-1": 0.1548, + "us-west-1": 0.1575, + "us-west-2": 0.1288 + }, + "m4.xlarge": { + "ap-northeast-1": 0.3156, + "ap-northeast-2": 0.3036, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.3076, + "ap-southeast-2": 0.0, + "ca-central-1": 0.3018, + "eu-central-1": 0.2976, + "eu-west-1": 0.2796, + "eu-west-2": 0.2896, + "sa-east-1": 0.4074, + "us-east-1": 0.2576, + "us-east-2": 0.2576, + "us-gov-west-1": 0.3348, + "us-west-1": 0.2916, + "us-west-2": 0.2776 + }, + "m4.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.6072, + "ap-northeast-3": 0.6828, + "ap-south-1": 0.5772, + "ap-southeast-1": 0.6152, + "ap-southeast-2": 0.6652, + "ca-central-1": 0.5592, + "eu-central-1": 0.5952, + "eu-west-1": 0.5592, + "eu-west-2": 0.5792, + "sa-east-1": 0.7512, + "us-east-1": 0.5152, + "us-east-2": 0.5552, + "us-gov-west-1": 0.6192, + "us-west-1": 0.0, + "us-west-2": 0.5152 + }, + "m4.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.1568, + "ap-northeast-3": 1.2048, + "ap-south-1": 0.0, + "ap-southeast-1": 1.1728, + "ap-southeast-2": 1.1728, + "ca-central-1": 1.0608, + "eu-central-1": 1.1328, + "eu-west-1": 1.0608, + "eu-west-2": 1.1008, + "sa-east-1": 1.4448, + "us-east-1": 0.0, + "us-east-2": 0.9728, + "us-gov-west-1": 1.1808, + "us-west-1": 1.1088, + "us-west-2": 1.0528 + }, + "m4.10xlarge": { + "ap-northeast-1": 3.012, + "ap-northeast-2": 2.892, + "ap-south-1": 2.532, + "ap-southeast-1": 2.932, + "ap-southeast-2": 2.932, + "ca-central-1": 2.652, + "eu-central-1": 2.832, + "eu-west-1": 0.0, + "eu-west-2": 2.752, + "sa-east-1": 3.612, + "us-east-1": 0.0, + "us-east-2": 2.432, + "us-gov-west-1": 0.0, + "us-west-1": 2.772, + "us-west-2": 0.0 + }, + "m4.16xlarge": { + "ap-northeast-1": 4.8192, + "ap-northeast-2": 4.6272, + "ap-northeast-3": 4.8192, + "ap-south-1": 4.0512, + "ap-southeast-1": 4.6912, + "ap-southeast-2": 4.6912, + "ca-central-1": 4.2432, + "eu-central-1": 4.5312, + "eu-west-1": 4.2432, + "eu-west-2": 0.0, + "sa-east-1": 5.7792, + "us-east-1": 3.8912, + "us-east-2": 3.8912, + "us-gov-west-1": 4.7232, + "us-west-1": 4.4352, + "us-west-2": 3.8912 + }, + "m5.large": { + "af-south-1": 0.156, + "ap-east-1": 0.161, + "ap-northeast-1": 0.153, + "ap-northeast-2": 0.147, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.13, + "ap-southeast-1": 0.161, + "ap-southeast-2": 0.161, + "ap-southeast-3": 0.149, + "ap-southeast-4": 0.149, + "ca-central-1": 0.136, + "ca-west-1": 0.136, + "eu-central-1": 0.0, + "eu-central-2": 0.168, + "eu-north-1": 0.131, + "eu-south-1": 0.141, + "eu-south-2": 0.0, + "eu-west-1": 0.136, + "eu-west-2": 0.151, + "eu-west-3": 0.152, + "il-central-1": 0.141, + "me-central-1": 0.0, + "me-south-1": 0.158, + "sa-east-1": 0.197, + "us-east-1": 0.125, + "us-east-2": 0.125, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.15, + "us-west-1": 0.152, + "us-west-2": 0.125, + "us-west-2-lax-1": 0.144 + }, + "m5.xlarge": { + "af-south-1": 0.312, + "ap-east-1": 0.348, + "ap-northeast-1": 0.306, + "ap-northeast-2": 0.317, + "ap-northeast-3": 0.306, + "ap-south-1": 0.26, + "ap-south-2": 0.26, + "ap-southeast-1": 0.298, + "ap-southeast-2": 0.322, + "ap-southeast-3": 0.322, + "ap-southeast-4": 0.322, + "ca-central-1": 0.272, + "ca-west-1": 0.272, + "eu-central-1": 0.311, + "eu-central-2": 0.311, + "eu-north-1": 0.0, + "eu-south-1": 0.304, + "eu-south-2": 0.272, + "eu-west-1": 0.272, + "eu-west-2": 0.28, + "eu-west-3": 0.282, + "il-central-1": 0.305, + "me-central-1": 0.293, + "me-south-1": 0.0, + "sa-east-1": 0.394, + "us-east-1": 0.0, + "us-east-2": 0.269, + "us-gov-east-1": 0.3, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.25, + "us-west-2-lax-1": 0.288 + }, + "m5.metal": { + "af-south-1": 7.133, + "ap-east-1": 7.373, + "ap-northeast-1": 6.989, + "ap-northeast-2": 6.701, + "ap-northeast-3": 6.989, + "ap-south-1": 5.885, + "ap-south-2": 5.885, + "ap-southeast-1": 6.797, + "ap-southeast-2": 6.797, + "ap-southeast-3": 6.797, + "ap-southeast-4": 6.797, + "ca-central-1": 6.173, + "ca-west-1": 6.173, + "eu-central-1": 6.557, + "eu-central-2": 7.109, + "eu-north-1": 0.0, + "eu-south-1": 6.413, + "eu-south-2": 0.0, + "eu-west-1": 6.173, + "eu-west-2": 6.365, + "eu-west-3": 0.0, + "il-central-1": 6.43, + "me-central-1": 6.686, + "me-south-1": 0.0, + "sa-east-1": 8.381, + "us-east-1": 5.645, + "us-east-2": 5.645, + "us-gov-east-1": 6.845, + "us-gov-west-1": 6.845, + "us-west-1": 6.413, + "us-west-2": 5.645, + "us-west-2-lax-1": 6.566 + }, + "m5.2xlarge": { + "af-south-1": 0.623, + "ap-east-1": 0.643, + "ap-northeast-1": 0.661, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.661, + "ap-south-1": 0.56, + "ap-south-2": 0.0, + "ap-southeast-1": 0.643, + "ap-southeast-2": 0.595, + "ap-southeast-3": 0.643, + "ap-southeast-4": 0.643, + "ca-central-1": 0.543, + "ca-west-1": 0.543, + "eu-central-1": 0.621, + "eu-central-2": 0.672, + "eu-north-1": 0.523, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.604, + "eu-west-3": 0.563, + "il-central-1": 0.565, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 0.727, + "us-east-1": 0.499, + "us-east-2": 0.499, + "us-gov-east-1": 0.599, + "us-gov-west-1": 0.648, + "us-west-1": 0.563, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.576 + }, + "m5.4xlarge": { + "af-south-1": 1.189, + "ap-east-1": 1.229, + "ap-northeast-1": 1.264, + "ap-northeast-2": 1.211, + "ap-northeast-3": 1.165, + "ap-south-1": 0.981, + "ap-south-2": 0.981, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.133, + "ap-southeast-3": 1.229, + "ap-southeast-4": 1.133, + "ca-central-1": 1.029, + "ca-west-1": 1.029, + "eu-central-1": 1.185, + "eu-central-2": 1.185, + "eu-north-1": 0.0, + "eu-south-1": 1.069, + "eu-south-2": 1.029, + "eu-west-1": 1.029, + "eu-west-2": 1.061, + "eu-west-3": 0.0, + "il-central-1": 1.161, + "me-central-1": 1.114, + "me-south-1": 1.114, + "sa-east-1": 1.397, + "us-east-1": 0.941, + "us-east-2": 1.018, + "us-gov-east-1": 1.141, + "us-gov-west-1": 1.141, + "us-west-1": 1.069, + "us-west-2": 0.0, + "us-west-2-lax-1": 1.187 + }, + "m5.8xlarge": { + "af-south-1": 2.378, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.234, + "ap-northeast-3": 2.528, + "ap-south-1": 0.0, + "ap-south-2": 1.962, + "ap-southeast-1": 2.266, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 2.266, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 2.37, + "eu-north-1": 1.978, + "eu-south-1": 0.0, + "eu-south-2": 2.229, + "eu-west-1": 0.0, + "eu-west-2": 2.122, + "eu-west-3": 0.0, + "il-central-1": 2.143, + "me-central-1": 2.229, + "me-south-1": 2.229, + "sa-east-1": 3.038, + "us-east-1": 1.882, + "us-east-2": 1.882, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 1.882, + "us-west-2-lax-1": 0.0 + }, + "m5.12xlarge": { + "af-south-1": 3.871, + "ap-east-1": 3.686, + "ap-northeast-1": 3.494, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.494, + "ap-south-1": 0.0, + "ap-south-2": 2.942, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.686, + "ap-southeast-3": 3.398, + "ap-southeast-4": 3.398, + "ca-central-1": 3.086, + "ca-west-1": 3.086, + "eu-central-1": 3.554, + "eu-central-2": 3.554, + "eu-north-1": 3.211, + "eu-south-1": 3.475, + "eu-south-2": 3.086, + "eu-west-1": 3.086, + "eu-west-2": 3.182, + "eu-west-3": 3.475, + "il-central-1": 3.215, + "me-central-1": 3.343, + "me-south-1": 3.343, + "sa-east-1": 4.19, + "us-east-1": 2.822, + "us-east-2": 2.822, + "us-gov-east-1": 3.713, + "us-gov-west-1": 3.422, + "us-west-1": 3.206, + "us-west-2": 2.822, + "us-west-2-lax-1": 0.0 + }, + "m5.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 5.338, + "ap-northeast-1": 5.056, + "ap-northeast-2": 0.0, + "ap-northeast-3": 4.659, + "ap-south-1": 0.0, + "ap-south-2": 3.923, + "ap-southeast-1": 4.531, + "ap-southeast-2": 4.531, + "ap-southeast-3": 4.531, + "ap-southeast-4": 4.531, + "ca-central-1": 0.0, + "ca-west-1": 4.115, + "eu-central-1": 4.371, + "eu-central-2": 4.739, + "eu-north-1": 3.955, + "eu-south-1": 4.634, + "eu-south-2": 4.115, + "eu-west-1": 4.115, + "eu-west-2": 4.243, + "eu-west-3": 4.275, + "il-central-1": 4.286, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 5.587, + "us-east-1": 3.763, + "us-east-2": 4.07, + "us-gov-east-1": 4.563, + "us-gov-west-1": 0.0, + "us-west-1": 4.634, + "us-west-2": 3.763, + "us-west-2-lax-1": 4.378 + }, + "m5.24xlarge": { + "af-south-1": 7.133, + "ap-east-1": 0.0, + "ap-northeast-1": 6.989, + "ap-northeast-2": 6.701, + "ap-northeast-3": 6.989, + "ap-south-1": 5.885, + "ap-south-2": 5.885, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 6.797, + "ap-southeast-4": 6.797, + "ca-central-1": 6.173, + "ca-west-1": 6.173, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 5.933, + "eu-south-1": 6.413, + "eu-south-2": 6.173, + "eu-west-1": 6.173, + "eu-west-2": 6.365, + "eu-west-3": 6.413, + "il-central-1": 6.43, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 5.645, + "us-east-2": 5.645, + "us-gov-east-1": 6.845, + "us-gov-west-1": 6.845, + "us-west-1": 0.0, + "us-west-2": 5.645, + "us-west-2-lax-1": 6.566 + }, + "m5a.large": { + "ap-northeast-1": 0.141, + "ap-northeast-2": 0.135, + "ap-south-1": 0.084, + "ap-southeast-1": 0.137, + "ap-southeast-2": 0.137, + "ca-central-1": 0.125, + "eu-central-1": 0.133, + "eu-south-1": 0.13, + "eu-west-1": 0.125, + "eu-west-2": 0.129, + "eu-west-3": 0.13, + "sa-east-1": 0.167, + "us-east-1": 0.115, + "us-east-2": 0.115, + "us-gov-east-1": 0.138, + "us-gov-west-1": 0.138, + "us-west-1": 0.13, + "us-west-2": 0.115 + }, + "m5a.xlarge": { + "ap-northeast-1": 0.282, + "ap-northeast-2": 0.27, + "ap-south-1": 0.169, + "ap-southeast-1": 0.274, + "ap-southeast-2": 0.274, + "ca-central-1": 0.25, + "eu-central-1": 0.266, + "eu-south-1": 0.26, + "eu-west-1": 0.25, + "eu-west-2": 0.258, + "eu-west-3": 0.26, + "sa-east-1": 0.334, + "us-east-1": 0.23, + "us-east-2": 0.23, + "us-gov-east-1": 0.276, + "us-gov-west-1": 0.276, + "us-west-1": 0.26, + "us-west-2": 0.23 + }, + "m5a.2xlarge": { + "ap-northeast-1": 0.563, + "ap-northeast-2": 0.539, + "ap-south-1": 0.337, + "ap-southeast-1": 0.547, + "ap-southeast-2": 0.547, + "ca-central-1": 0.499, + "eu-central-1": 0.531, + "eu-south-1": 0.519, + "eu-west-1": 0.499, + "eu-west-2": 0.515, + "eu-west-3": 0.519, + "sa-east-1": 0.667, + "us-east-1": 0.459, + "us-east-2": 0.459, + "us-gov-east-1": 0.551, + "us-gov-west-1": 0.551, + "us-west-1": 0.519, + "us-west-2": 0.459 + }, + "m5a.4xlarge": { + "ap-northeast-1": 1.069, + "ap-northeast-2": 1.021, + "ap-south-1": 0.617, + "ap-southeast-1": 1.037, + "ap-southeast-2": 1.037, + "ca-central-1": 0.941, + "eu-central-1": 1.005, + "eu-south-1": 0.981, + "eu-west-1": 0.941, + "eu-west-2": 0.973, + "eu-west-3": 0.981, + "sa-east-1": 1.277, + "us-east-1": 0.861, + "us-east-2": 0.861, + "us-gov-east-1": 1.045, + "us-gov-west-1": 1.045, + "us-west-1": 0.981, + "us-west-2": 0.861 + }, + "m5a.8xlarge": { + "ap-northeast-1": 2.138, + "ap-northeast-2": 2.042, + "ap-south-1": 1.234, + "ap-southeast-1": 2.074, + "ap-southeast-2": 2.074, + "ca-central-1": 1.882, + "eu-central-1": 2.01, + "eu-south-1": 1.962, + "eu-west-1": 1.882, + "eu-west-2": 1.946, + "eu-west-3": 1.962, + "sa-east-1": 2.554, + "us-east-1": 1.722, + "us-east-2": 1.722, + "us-gov-east-1": 2.09, + "us-gov-west-1": 2.09, + "us-west-1": 1.962, + "us-west-2": 1.722 + }, + "m5a.12xlarge": { + "ap-northeast-1": 3.206, + "ap-northeast-2": 3.062, + "ap-south-1": 1.852, + "ap-southeast-1": 3.11, + "ap-southeast-2": 3.11, + "ca-central-1": 2.822, + "eu-central-1": 3.014, + "eu-south-1": 2.942, + "eu-west-1": 2.822, + "eu-west-2": 2.918, + "eu-west-3": 2.942, + "sa-east-1": 3.83, + "us-east-1": 2.582, + "us-east-2": 2.582, + "us-gov-east-1": 3.134, + "us-gov-west-1": 3.134, + "us-west-1": 2.942, + "us-west-2": 2.582 + }, + "m5a.16xlarge": { + "ap-northeast-1": 4.275, + "ap-northeast-2": 4.083, + "ap-south-1": 2.469, + "ap-southeast-1": 4.147, + "ap-southeast-2": 4.147, + "ca-central-1": 3.763, + "eu-central-1": 4.019, + "eu-south-1": 3.923, + "eu-west-1": 3.763, + "eu-west-2": 3.891, + "eu-west-3": 3.923, + "sa-east-1": 5.107, + "us-east-1": 3.443, + "us-east-2": 3.443, + "us-gov-east-1": 4.179, + "us-gov-west-1": 4.179, + "us-west-1": 3.923, + "us-west-2": 3.443 + }, + "m5a.24xlarge": { + "ap-northeast-1": 6.413, + "ap-northeast-2": 6.125, + "ap-south-1": 3.703, + "ap-southeast-1": 6.221, + "ap-southeast-2": 6.221, + "ca-central-1": 5.645, + "eu-central-1": 6.029, + "eu-south-1": 5.885, + "eu-west-1": 5.645, + "eu-west-2": 5.837, + "eu-west-3": 5.885, + "sa-east-1": 7.661, + "us-east-1": 5.165, + "us-east-2": 5.165, + "us-gov-east-1": 6.269, + "us-gov-west-1": 6.269, + "us-west-1": 5.885, + "us-west-2": 5.165 + }, + "m5ad.large": { + "ap-northeast-1": 0.163, + "ap-northeast-2": 0.156, + "ap-south-1": 0.096, + "ap-southeast-1": 0.158, + "ap-southeast-2": 0.159, + "ca-central-1": 0.144, + "eu-central-1": 0.154, + "eu-west-1": 0.144, + "eu-west-2": 0.149, + "eu-west-3": 0.15, + "sa-east-1": 0.194, + "us-east-1": 0.132, + "us-east-2": 0.132, + "us-gov-west-1": 0.16, + "us-west-1": 0.151, + "us-west-2": 0.132 + }, + "m5ad.xlarge": { + "ap-northeast-1": 0.326, + "ap-northeast-2": 0.312, + "ap-south-1": 0.192, + "ap-southeast-1": 0.316, + "ap-southeast-2": 0.318, + "ca-central-1": 0.288, + "eu-central-1": 0.308, + "eu-west-1": 0.288, + "eu-west-2": 0.298, + "eu-west-3": 0.3, + "sa-east-1": 0.388, + "us-east-1": 0.264, + "us-east-2": 0.264, + "us-gov-west-1": 0.32, + "us-west-1": 0.302, + "us-west-2": 0.264 + }, + "m5ad.2xlarge": { + "ap-northeast-1": 0.651, + "ap-northeast-2": 0.623, + "ap-south-1": 0.384, + "ap-southeast-1": 0.631, + "ap-southeast-2": 0.635, + "ca-central-1": 0.575, + "eu-central-1": 0.615, + "eu-west-1": 0.575, + "eu-west-2": 0.595, + "eu-west-3": 0.599, + "sa-east-1": 0.775, + "us-east-1": 0.527, + "us-east-2": 0.527, + "us-gov-west-1": 0.639, + "us-west-1": 0.603, + "us-west-2": 0.527 + }, + "m5ad.4xlarge": { + "ap-northeast-1": 1.245, + "ap-northeast-2": 1.189, + "ap-south-1": 0.71, + "ap-southeast-1": 1.205, + "ap-southeast-2": 1.213, + "ca-central-1": 1.093, + "eu-central-1": 1.173, + "eu-west-1": 1.093, + "eu-west-2": 1.133, + "eu-west-3": 1.141, + "sa-east-1": 1.493, + "us-east-1": 0.997, + "us-east-2": 0.997, + "us-gov-west-1": 1.221, + "us-west-1": 1.149, + "us-west-2": 0.997 + }, + "m5ad.8xlarge": { + "ap-northeast-1": 2.49, + "ap-northeast-2": 2.378, + "ap-south-1": 1.419, + "ap-southeast-1": 2.41, + "ap-southeast-2": 2.426, + "ca-central-1": 2.186, + "eu-central-1": 2.346, + "eu-west-1": 2.186, + "eu-west-2": 2.266, + "eu-west-3": 2.282, + "sa-east-1": 2.986, + "us-east-1": 1.994, + "us-east-2": 1.994, + "us-gov-west-1": 2.442, + "us-west-1": 2.298, + "us-west-2": 1.994 + }, + "m5ad.12xlarge": { + "ap-northeast-1": 3.734, + "ap-northeast-2": 3.566, + "ap-south-1": 2.129, + "ap-southeast-1": 3.614, + "ap-southeast-2": 3.638, + "ca-central-1": 3.278, + "eu-central-1": 3.518, + "eu-west-1": 3.278, + "eu-west-2": 3.398, + "eu-west-3": 3.422, + "sa-east-1": 4.478, + "us-east-1": 2.99, + "us-east-2": 2.99, + "us-gov-west-1": 3.662, + "us-west-1": 3.446, + "us-west-2": 2.99 + }, + "m5ad.16xlarge": { + "ap-northeast-1": 4.979, + "ap-northeast-2": 4.755, + "ap-south-1": 2.838, + "ap-southeast-1": 4.819, + "ap-southeast-2": 4.851, + "ca-central-1": 4.371, + "eu-central-1": 4.691, + "eu-west-1": 4.371, + "eu-west-2": 4.531, + "eu-west-3": 4.563, + "sa-east-1": 5.971, + "us-east-1": 3.987, + "us-east-2": 3.987, + "us-gov-west-1": 4.883, + "us-west-1": 4.595, + "us-west-2": 3.987 + }, + "m5ad.24xlarge": { + "ap-northeast-1": 7.469, + "ap-northeast-2": 7.133, + "ap-south-1": 4.258, + "ap-southeast-1": 7.229, + "ap-southeast-2": 7.277, + "ca-central-1": 6.557, + "eu-central-1": 7.037, + "eu-west-1": 6.557, + "eu-west-2": 6.797, + "eu-west-3": 6.845, + "sa-east-1": 8.957, + "us-east-1": 5.981, + "us-east-2": 5.981, + "us-gov-west-1": 7.325, + "us-west-1": 6.893, + "us-west-2": 5.981 + }, + "m5d.large": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.175, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.175, + "ap-south-1": 0.158, + "ap-south-2": 0.151, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.171, + "ap-southeast-3": 0.17, + "ap-southeast-4": 0.171, + "ca-central-1": 0.162, + "ca-west-1": 0.155, + "eu-central-1": 0.165, + "eu-central-2": 0.178, + "eu-north-1": 0.149, + "eu-south-1": 0.161, + "eu-south-2": 0.155, + "eu-west-1": 0.155, + "eu-west-2": 0.168, + "eu-west-3": 0.0, + "il-central-1": 0.169, + "me-central-1": 0.167, + "me-south-1": 0.0, + "sa-east-1": 0.219, + "us-east-1": 0.142, + "us-east-2": 0.149, + "us-gov-east-1": 0.172, + "us-gov-west-1": 0.172, + "us-west-1": 0.162, + "us-west-2": 0.0 + }, + "m5d.xlarge": { + "af-south-1": 0.376, + "ap-east-1": 0.368, + "ap-northeast-1": 0.367, + "ap-northeast-2": 0.352, + "ap-northeast-3": 0.35, + "ap-south-1": 0.302, + "ap-south-2": 0.302, + "ap-southeast-1": 0.34, + "ap-southeast-2": 0.359, + "ap-southeast-3": 0.34, + "ap-southeast-4": 0.359, + "ca-central-1": 0.325, + "ca-west-1": 0.31, + "eu-central-1": 0.0, + "eu-central-2": 0.357, + "eu-north-1": 0.0, + "eu-south-1": 0.322, + "eu-south-2": 0.325, + "eu-west-1": 0.31, + "eu-west-2": 0.32, + "eu-west-3": 0.322, + "il-central-1": 0.338, + "me-central-1": 0.335, + "me-south-1": 0.0, + "sa-east-1": 0.418, + "us-east-1": 0.284, + "us-east-2": 0.284, + "us-gov-east-1": 0.344, + "us-gov-west-1": 0.0, + "us-west-1": 0.34, + "us-west-2": 0.284 + }, + "m5d.metal": { + "af-south-1": 0.0, + "ap-east-1": 8.477, + "ap-northeast-1": 8.045, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 6.893, + "ap-south-2": 0.0, + "ap-southeast-1": 7.805, + "ap-southeast-2": 7.853, + "ap-southeast-3": 7.805, + "ap-southeast-4": 7.853, + "ca-central-1": 7.085, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 8.218, + "eu-north-1": 6.797, + "eu-south-1": 7.373, + "eu-south-2": 7.085, + "eu-west-1": 7.085, + "eu-west-2": 7.325, + "eu-west-3": 7.373, + "il-central-1": 7.387, + "me-central-1": 0.0, + "me-south-1": 7.69, + "sa-east-1": 9.677, + "us-east-1": 6.461, + "us-east-2": 6.461, + "us-gov-east-1": 7.901, + "us-gov-west-1": 0.0, + "us-west-1": 7.421, + "us-west-2": 0.0 + }, + "m5d.2xlarge": { + "af-south-1": 0.715, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.671, + "ap-northeast-3": 0.699, + "ap-south-1": 0.603, + "ap-south-2": 0.603, + "ap-southeast-1": 0.679, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 0.619, + "ca-west-1": 0.0, + "eu-central-1": 0.659, + "eu-central-2": 0.75, + "eu-north-1": 0.624, + "eu-south-1": 0.643, + "eu-south-2": 0.619, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.675, + "il-central-1": 0.644, + "me-central-1": 0.0, + "me-south-1": 0.67, + "sa-east-1": 0.835, + "us-east-1": 0.567, + "us-east-2": 0.594, + "us-gov-east-1": 0.722, + "us-gov-west-1": 0.722, + "us-west-1": 0.647, + "us-west-2": 0.594 + }, + "m5d.4xlarge": { + "af-south-1": 1.373, + "ap-east-1": 1.413, + "ap-northeast-1": 1.341, + "ap-northeast-2": 1.285, + "ap-northeast-3": 1.341, + "ap-south-1": 0.0, + "ap-south-2": 1.149, + "ap-southeast-1": 1.301, + "ap-southeast-2": 1.309, + "ap-southeast-3": 1.301, + "ap-southeast-4": 1.309, + "ca-central-1": 1.181, + "ca-west-1": 1.181, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 1.181, + "eu-west-1": 1.181, + "eu-west-2": 0.0, + "eu-west-3": 1.229, + "il-central-1": 1.295, + "me-central-1": 1.282, + "me-south-1": 1.282, + "sa-east-1": 1.613, + "us-east-1": 1.077, + "us-east-2": 0.0, + "us-gov-east-1": 1.317, + "us-gov-west-1": 0.0, + "us-west-1": 1.237, + "us-west-2": 0.0 + }, + "m5d.8xlarge": { + "af-south-1": 2.746, + "ap-east-1": 0.0, + "ap-northeast-1": 2.682, + "ap-northeast-2": 2.57, + "ap-northeast-3": 2.822, + "ap-south-1": 2.298, + "ap-south-2": 2.298, + "ap-southeast-1": 2.602, + "ap-southeast-2": 2.618, + "ap-southeast-3": 2.602, + "ap-southeast-4": 2.618, + "ca-central-1": 2.362, + "ca-west-1": 2.362, + "eu-central-1": 2.522, + "eu-central-2": 2.739, + "eu-north-1": 2.266, + "eu-south-1": 2.458, + "eu-south-2": 2.362, + "eu-west-1": 2.362, + "eu-west-2": 2.442, + "eu-west-3": 2.458, + "il-central-1": 2.462, + "me-central-1": 0.0, + "me-south-1": 2.563, + "sa-east-1": 3.226, + "us-east-1": 2.154, + "us-east-2": 2.154, + "us-gov-east-1": 2.634, + "us-gov-west-1": 2.634, + "us-west-1": 2.474, + "us-west-2": 2.154 + }, + "m5d.12xlarge": { + "af-south-1": 4.118, + "ap-east-1": 4.462, + "ap-northeast-1": 4.022, + "ap-northeast-2": 4.053, + "ap-northeast-3": 0.0, + "ap-south-1": 3.622, + "ap-south-2": 3.446, + "ap-southeast-1": 3.902, + "ap-southeast-2": 4.131, + "ap-southeast-3": 3.902, + "ap-southeast-4": 4.131, + "ca-central-1": 3.724, + "ca-west-1": 0.0, + "eu-central-1": 3.782, + "eu-central-2": 4.324, + "eu-north-1": 3.571, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 3.542, + "eu-west-2": 3.662, + "eu-west-3": 0.0, + "il-central-1": 3.694, + "me-central-1": 4.044, + "me-south-1": 3.845, + "sa-east-1": 5.088, + "us-east-1": 3.23, + "us-east-2": 3.393, + "us-gov-east-1": 3.95, + "us-gov-west-1": 3.95, + "us-west-1": 3.71, + "us-west-2": 3.23 + }, + "m5d.16xlarge": { + "af-south-1": 5.779, + "ap-east-1": 0.0, + "ap-northeast-1": 5.363, + "ap-northeast-2": 5.139, + "ap-northeast-3": 5.363, + "ap-south-1": 4.595, + "ap-south-2": 4.829, + "ap-southeast-1": 5.203, + "ap-southeast-2": 5.235, + "ap-southeast-3": 0.0, + "ap-southeast-4": 5.235, + "ca-central-1": 4.723, + "ca-west-1": 4.723, + "eu-central-1": 5.043, + "eu-central-2": 0.0, + "eu-north-1": 4.531, + "eu-south-1": 5.169, + "eu-south-2": 4.723, + "eu-west-1": 0.0, + "eu-west-2": 4.883, + "eu-west-3": 4.915, + "il-central-1": 4.925, + "me-central-1": 0.0, + "me-south-1": 5.393, + "sa-east-1": 0.0, + "us-east-1": 4.307, + "us-east-2": 4.307, + "us-gov-east-1": 5.267, + "us-gov-west-1": 0.0, + "us-west-1": 4.947, + "us-west-2": 4.307 + }, + "m5d.24xlarge": { + "af-south-1": 8.237, + "ap-east-1": 8.477, + "ap-northeast-1": 8.045, + "ap-northeast-2": 0.0, + "ap-northeast-3": 8.045, + "ap-south-1": 6.893, + "ap-south-2": 6.893, + "ap-southeast-1": 7.805, + "ap-southeast-2": 7.853, + "ap-southeast-3": 7.805, + "ap-southeast-4": 7.853, + "ca-central-1": 7.085, + "ca-west-1": 0.0, + "eu-central-1": 7.565, + "eu-central-2": 8.218, + "eu-north-1": 0.0, + "eu-south-1": 7.373, + "eu-south-2": 7.085, + "eu-west-1": 7.085, + "eu-west-2": 7.325, + "eu-west-3": 7.373, + "il-central-1": 7.387, + "me-central-1": 7.69, + "me-south-1": 7.69, + "sa-east-1": 9.677, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 7.901, + "us-gov-west-1": 7.901, + "us-west-1": 7.421, + "us-west-2": 6.461 + }, + "m5dn.large": { + "ap-northeast-1": 0.204, + "ap-southeast-1": 0.196, + "eu-central-1": 0.191, + "eu-west-1": 0.0, + "us-east-1": 0.165, + "us-east-2": 0.173, + "us-gov-east-1": 0.21, + "us-gov-west-1": 0.2, + "us-west-2": 0.165 + }, + "m5dn.xlarge": { + "ap-northeast-1": 0.429, + "ap-southeast-1": 0.392, + "eu-central-1": 0.0, + "eu-west-1": 0.38, + "us-east-1": 0.33, + "us-east-2": 0.33, + "us-gov-east-1": 0.4, + "us-gov-west-1": 0.4, + "us-west-2": 0.33 + }, + "m5dn.metal": { + "ap-northeast-1": 9.437, + "ap-southeast-1": 9.053, + "eu-central-1": 8.813, + "eu-west-1": 8.333, + "us-east-1": 7.565, + "us-east-2": 7.565, + "us-gov-east-1": 9.245, + "us-gov-west-1": 9.245, + "us-west-2": 7.565 + }, + "m5dn.2xlarge": { + "ap-northeast-1": 0.857, + "ap-southeast-1": 0.0, + "eu-central-1": 0.763, + "eu-west-1": 0.723, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.799, + "us-gov-west-1": 0.799, + "us-west-2": 0.0 + }, + "m5dn.4xlarge": { + "ap-northeast-1": 1.657, + "ap-southeast-1": 1.509, + "eu-central-1": 1.547, + "eu-west-1": 1.389, + "us-east-1": 1.326, + "us-east-2": 1.261, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.623, + "us-west-2": 1.261 + }, + "m5dn.8xlarge": { + "ap-northeast-1": 3.146, + "ap-southeast-1": 3.018, + "eu-central-1": 3.093, + "eu-west-1": 2.924, + "us-east-1": 2.652, + "us-east-2": 2.522, + "us-gov-east-1": 3.082, + "us-gov-west-1": 3.246, + "us-west-2": 2.522 + }, + "m5dn.12xlarge": { + "ap-northeast-1": 4.97, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 4.166, + "us-east-1": 0.0, + "us-east-2": 3.782, + "us-gov-east-1": 4.622, + "us-gov-west-1": 4.622, + "us-west-2": 0.0 + }, + "m5dn.16xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 6.035, + "eu-central-1": 5.875, + "eu-west-1": 0.0, + "us-east-1": 5.043, + "us-east-2": 5.043, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 5.043 + }, + "m5dn.24xlarge": { + "ap-northeast-1": 9.437, + "ap-southeast-1": 0.0, + "eu-central-1": 8.813, + "eu-west-1": 8.333, + "us-east-1": 7.565, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 9.245, + "us-west-2": 7.565 + }, + "m5n.large": { + "ap-northeast-1": 0.182, + "ap-southeast-1": 0.175, + "eu-central-1": 0.0, + "eu-west-1": 0.17, + "us-east-1": 0.0, + "us-east-2": 0.148, + "us-gov-east-1": 0.187, + "us-gov-west-1": 0.178, + "us-west-2": 0.0 + }, + "m5n.xlarge": { + "ap-northeast-1": 0.364, + "ap-southeast-1": 0.0, + "eu-central-1": 0.357, + "eu-west-1": 0.324, + "us-east-1": 0.296, + "us-east-2": 0.296, + "us-gov-east-1": 0.356, + "us-gov-west-1": 0.373, + "us-west-2": 0.296 + }, + "m5n.metal": { + "ap-northeast-1": 8.381, + "ap-southeast-1": 8.045, + "eu-central-1": 0.0, + "eu-west-1": 7.421, + "us-east-1": 6.749, + "us-east-2": 6.749, + "us-gov-east-1": 8.189, + "us-gov-west-1": 0.0, + "us-west-2": 6.749 + }, + "m5n.2xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.679, + "us-east-1": 0.0, + "us-east-2": 0.62, + "us-gov-east-1": 0.747, + "us-gov-west-1": 0.0, + "us-west-2": 0.591 + }, + "m5n.4xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "eu-central-1": 1.368, + "eu-west-1": 1.237, + "us-east-1": 1.125, + "us-east-2": 0.0, + "us-gov-east-1": 1.365, + "us-gov-west-1": 1.436, + "us-west-2": 1.125 + }, + "m5n.8xlarge": { + "ap-northeast-1": 2.794, + "ap-southeast-1": 0.0, + "eu-central-1": 2.602, + "eu-west-1": 0.0, + "us-east-1": 2.25, + "us-east-2": 2.25, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "m5n.12xlarge": { + "ap-northeast-1": 4.411, + "ap-southeast-1": 4.022, + "eu-central-1": 4.105, + "eu-west-1": 3.71, + "us-east-1": 3.546, + "us-east-2": 3.374, + "us-gov-east-1": 4.094, + "us-gov-west-1": 4.094, + "us-west-2": 3.374 + }, + "m5n.16xlarge": { + "ap-northeast-1": 5.881, + "ap-southeast-1": 5.644, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 4.499, + "us-east-2": 0.0, + "us-gov-east-1": 5.459, + "us-gov-west-1": 5.459, + "us-west-2": 4.499 + }, + "m5n.24xlarge": { + "ap-northeast-1": 8.381, + "ap-southeast-1": 8.045, + "eu-central-1": 7.805, + "eu-west-1": 7.421, + "us-east-1": 6.749, + "us-east-2": 6.749, + "us-gov-east-1": 8.189, + "us-gov-west-1": 8.189, + "us-west-2": 0.0 + }, + "m5zn.large": { + "ap-northeast-1": 0.2422, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.2353, + "ap-southeast-2": 0.2353, + "eu-central-1": 0.2267, + "eu-west-1": 0.2313, + "sa-east-1": 0.292, + "us-east-1": 0.0, + "us-east-2": 0.194, + "us-west-1": 0.2215, + "us-west-2": 0.194 + }, + "m5zn.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.5042, + "ap-southeast-1": 0.5119, + "ap-southeast-2": 0.4706, + "eu-central-1": 0.4533, + "eu-west-1": 0.4626, + "sa-east-1": 0.0, + "us-east-1": 0.3879, + "us-east-2": 0.0, + "us-west-1": 0.443, + "us-west-2": 0.0 + }, + "m5zn.metal": { + "ap-northeast-1": 5.6388, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.4744, + "eu-central-1": 5.7419, + "eu-west-1": 4.9368, + "sa-east-1": 6.8362, + "us-east-1": 4.4825, + "us-east-2": 0.0, + "us-west-1": 5.6057, + "us-west-2": 0.0 + }, + "m5zn.2xlarge": { + "ap-northeast-1": 0.9686, + "ap-northeast-2": 0.9272, + "ap-southeast-1": 0.9412, + "ap-southeast-2": 0.9412, + "eu-central-1": 0.9066, + "eu-west-1": 0.8516, + "sa-east-1": 1.2735, + "us-east-1": 0.8419, + "us-east-2": 0.0, + "us-west-1": 0.886, + "us-west-2": 0.7759 + }, + "m5zn.3xlarge": { + "ap-northeast-1": 1.4097, + "ap-northeast-2": 1.4694, + "ap-southeast-1": 1.3686, + "ap-southeast-2": 1.4925, + "eu-central-1": 1.3168, + "eu-west-1": 1.3447, + "sa-east-1": 1.709, + "us-east-1": 0.0, + "us-east-2": 1.1206, + "us-west-1": 1.2858, + "us-west-2": 1.1206 + }, + "m5zn.6xlarge": { + "ap-northeast-1": 2.8194, + "ap-northeast-2": 0.0, + "ap-southeast-1": 2.7372, + "ap-southeast-2": 2.985, + "eu-central-1": 2.6335, + "eu-west-1": 2.4684, + "sa-east-1": 0.0, + "us-east-1": 2.2412, + "us-east-2": 2.4394, + "us-west-1": 2.8028, + "us-west-2": 2.2412 + }, + "m5zn.12xlarge": { + "ap-northeast-1": 5.6388, + "ap-northeast-2": 5.8776, + "ap-southeast-1": 5.4744, + "ap-southeast-2": 5.97, + "eu-central-1": 0.0, + "eu-west-1": 4.9368, + "sa-east-1": 7.4679, + "us-east-1": 4.4825, + "us-east-2": 4.4825, + "us-west-1": 5.1432, + "us-west-2": 4.4825 + }, + "m6a.large": { + "ap-northeast-1": 0.1404, + "ap-south-1": 0.08435, + "ap-south-2": 0.0, + "ap-southeast-1": 0.1368, + "ap-southeast-2": 0.1476, + "ca-central-1": 0.1251, + "eu-central-1": 0.1323, + "eu-south-1": 0.13968, + "eu-west-1": 0.1251, + "eu-west-2": 0.1287, + "eu-west-3": 0.1296, + "sa-east-1": 0.1665, + "us-east-1": 0.0, + "us-east-2": 0.1152, + "us-west-1": 0.1296, + "us-west-2": 0.1152 + }, + "m6a.xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.1687, + "ap-south-2": 0.0, + "ap-southeast-1": 0.2952, + "ap-southeast-2": 0.0, + "ca-central-1": 0.26946, + "eu-central-1": 0.2646, + "eu-south-1": 0.2592, + "eu-west-1": 0.2502, + "eu-west-2": 0.2574, + "eu-west-3": 0.2592, + "sa-east-1": 0.333, + "us-east-1": 0.2304, + "us-east-2": 0.0, + "us-west-1": 0.27936, + "us-west-2": 0.2304 + }, + "m6a.metal": { + "ap-northeast-1": 12.5568, + "ap-south-1": 7.176, + "ap-south-2": 7.176, + "ap-southeast-1": 12.2112, + "ap-southeast-2": 12.2112, + "ca-central-1": 0.0, + "eu-central-1": 11.7792, + "eu-south-1": 11.52, + "eu-west-1": 11.088, + "eu-west-2": 11.4336, + "eu-west-3": 11.52, + "sa-east-1": 15.0624, + "us-east-1": 10.1376, + "us-east-2": 10.1376, + "us-west-1": 11.52, + "us-west-2": 0.0 + }, + "m6a.2xlarge": { + "ap-northeast-1": 0.60624, + "ap-south-1": 0.3374, + "ap-south-2": 0.35962, + "ap-southeast-1": 0.5472, + "ap-southeast-2": 0.0, + "ca-central-1": 0.53892, + "eu-central-1": 0.5292, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.5148, + "eu-west-3": 0.55872, + "sa-east-1": 0.666, + "us-east-1": 0.0, + "us-east-2": 0.4608, + "us-west-1": 0.5184, + "us-west-2": 0.4608 + }, + "m6a.4xlarge": { + "ap-northeast-1": 1.0656, + "ap-south-1": 0.6172, + "ap-south-2": 0.6172, + "ap-southeast-1": 1.0368, + "ap-southeast-2": 1.0368, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 1.02024, + "eu-west-2": 0.972, + "eu-west-3": 0.9792, + "sa-east-1": 1.38456, + "us-east-1": 0.0, + "us-east-2": 0.864, + "us-west-1": 0.9792, + "us-west-2": 0.864 + }, + "m6a.8xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 1.2344, + "ap-south-2": 1.32328, + "ap-southeast-1": 2.0736, + "ap-southeast-2": 2.0736, + "ca-central-1": 1.8864, + "eu-central-1": 0.0, + "eu-south-1": 1.9584, + "eu-west-1": 1.8864, + "eu-west-2": 1.944, + "eu-west-3": 1.9584, + "sa-east-1": 0.0, + "us-east-1": 1.728, + "us-east-2": 1.728, + "us-west-1": 1.9584, + "us-west-2": 1.728 + }, + "m6a.12xlarge": { + "ap-northeast-1": 3.1968, + "ap-south-1": 1.8516, + "ap-south-2": 1.98492, + "ap-southeast-1": 3.1104, + "ap-southeast-2": 3.1104, + "ca-central-1": 3.06072, + "eu-central-1": 3.0024, + "eu-south-1": 3.17952, + "eu-west-1": 0.0, + "eu-west-2": 2.916, + "eu-west-3": 3.17952, + "sa-east-1": 3.8232, + "us-east-1": 2.592, + "us-east-2": 2.592, + "us-west-1": 0.0, + "us-west-2": 2.79936 + }, + "m6a.16xlarge": { + "ap-northeast-1": 4.61952, + "ap-south-1": 2.4688, + "ap-south-2": 2.4688, + "ap-southeast-1": 4.1472, + "ap-southeast-2": 4.4928, + "ca-central-1": 3.7728, + "eu-central-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 3.888, + "eu-west-3": 3.9168, + "sa-east-1": 5.0976, + "us-east-1": 3.73248, + "us-east-2": 3.456, + "us-west-1": 3.9168, + "us-west-2": 3.456 + }, + "m6a.24xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 6.12144, + "eu-central-1": 0.0, + "eu-south-1": 5.8752, + "eu-west-1": 5.6592, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 7.6464, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 5.8752, + "us-west-2": 0.0 + }, + "m6a.32xlarge": { + "ap-northeast-1": 8.3712, + "ap-south-1": 4.784, + "ap-south-2": 4.784, + "ap-southeast-1": 8.832, + "ap-southeast-2": 8.1408, + "ca-central-1": 7.392, + "eu-central-1": 0.0, + "eu-south-1": 8.32512, + "eu-west-1": 7.392, + "eu-west-2": 7.6224, + "eu-west-3": 7.68, + "sa-east-1": 10.92288, + "us-east-1": 6.7584, + "us-east-2": 6.7584, + "us-west-1": 7.68, + "us-west-2": 6.7584 + }, + "m6a.48xlarge": { + "ap-northeast-1": 12.5568, + "ap-south-1": 7.176, + "ap-south-2": 0.0, + "ap-southeast-1": 12.2112, + "ap-southeast-2": 12.2112, + "ca-central-1": 11.088, + "eu-central-1": 11.7792, + "eu-south-1": 11.52, + "eu-west-1": 11.088, + "eu-west-2": 11.4336, + "eu-west-3": 11.52, + "sa-east-1": 15.0624, + "us-east-1": 10.1376, + "us-east-2": 10.1376, + "us-west-1": 11.52, + "us-west-2": 0.0 + }, + "m6g.medium": { + "af-south-1": 0.0652, + "ap-east-1": 0.0674, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0643, + "ap-northeast-3": 0.064, + "ap-south-1": 0.0397, + "ap-south-2": 0.0397, + "ap-southeast-1": 0.0624, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0653, + "ap-southeast-4": 0.0624, + "ap-southeast-5": 0.0552, + "ap-southeast-7": 0.0552, + "ca-central-1": 0.0572, + "ca-west-1": 0.0572, + "eu-central-1": 0.0604, + "eu-central-2": 0.065, + "eu-north-1": 0.0579, + "eu-south-1": 0.0, + "eu-south-2": 0.0574, + "eu-west-1": 0.0574, + "eu-west-2": 0.0588, + "eu-west-3": 0.0594, + "il-central-1": 0.0622, + "me-central-1": 0.0, + "me-south-1": 0.0614, + "mx-central-1": 0.0, + "sa-east-1": 0.0756, + "us-east-1": 0.0529, + "us-east-2": 0.0552, + "us-gov-east-1": 0.0628, + "us-gov-west-1": 0.0, + "us-west-1": 0.0592, + "us-west-2": 0.0529, + "us-west-2-lax-1": 0.0606 + }, + "m6g.large": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.1278, + "ap-northeast-2": 0.1228, + "ap-northeast-3": 0.128, + "ap-south-1": 0.0794, + "ap-south-2": 0.0, + "ap-southeast-1": 0.1248, + "ap-southeast-2": 0.1248, + "ap-southeast-3": 0.1248, + "ap-southeast-4": 0.1306, + "ap-southeast-5": 0.1104, + "ap-southeast-7": 0.1104, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.13, + "eu-north-1": 0.1108, + "eu-south-1": 0.1238, + "eu-south-2": 0.1148, + "eu-west-1": 0.1148, + "eu-west-2": 0.1176, + "eu-west-3": 0.0, + "il-central-1": 0.1191, + "me-central-1": 0.129, + "me-south-1": 0.1228, + "mx-central-1": 0.0, + "sa-east-1": 0.1512, + "us-east-1": 0.1058, + "us-east-2": 0.1058, + "us-gov-east-1": 0.1256, + "us-gov-west-1": 0.1314, + "us-west-1": 0.1238, + "us-west-2": 0.1058, + "us-west-2-lax-1": 0.1212 + }, + "m6g.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.2696, + "ap-northeast-1": 0.2556, + "ap-northeast-2": 0.257, + "ap-northeast-3": 0.256, + "ap-south-1": 0.1588, + "ap-south-2": 0.1649, + "ap-southeast-1": 0.2496, + "ap-southeast-2": 0.2496, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.2208, + "ap-southeast-7": 0.2306, + "ca-central-1": 0.2288, + "ca-west-1": 0.0, + "eu-central-1": 0.2526, + "eu-central-2": 0.26, + "eu-north-1": 0.2314, + "eu-south-1": 0.2368, + "eu-south-2": 0.2296, + "eu-west-1": 0.2296, + "eu-west-2": 0.2352, + "eu-west-3": 0.2376, + "il-central-1": 0.2382, + "me-central-1": 0.2468, + "me-south-1": 0.2456, + "mx-central-1": 0.0, + "sa-east-1": 0.3024, + "us-east-1": 0.2116, + "us-east-2": 0.0, + "us-gov-east-1": 0.2512, + "us-gov-west-1": 0.2512, + "us-west-1": 0.2476, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0 + }, + "m6g.metal": { + "af-south-1": 3.9424, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.6992, + "ap-northeast-3": 0.0, + "ap-south-1": 2.3104, + "ap-south-2": 2.3104, + "ap-southeast-1": 3.7632, + "ap-southeast-2": 0.0, + "ap-southeast-3": 3.7632, + "ap-southeast-4": 3.9475, + "ap-southeast-5": 3.4591, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 3.4304, + "eu-central-1": 3.6352, + "eu-central-2": 4.1239, + "eu-north-1": 3.472, + "eu-south-1": 3.5584, + "eu-south-2": 3.4432, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 3.744, + "il-central-1": 3.5808, + "me-central-1": 3.7184, + "me-south-1": 0.0, + "mx-central-1": 3.4333, + "sa-east-1": 4.608, + "us-east-1": 0.0, + "us-east-2": 3.1552, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.7888, + "us-west-1": 0.0, + "us-west-2": 3.1552, + "us-west-2-lax-1": 3.648 + }, + "m6g.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.5392, + "ap-northeast-1": 0.5352, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.512, + "ap-south-1": 0.3297, + "ap-south-2": 0.3297, + "ap-southeast-1": 0.4992, + "ap-southeast-2": 0.5222, + "ap-southeast-3": 0.4992, + "ap-southeast-4": 0.4992, + "ap-southeast-5": 0.4416, + "ap-southeast-7": 0.4416, + "ca-central-1": 0.0, + "ca-west-1": 0.4576, + "eu-central-1": 0.0, + "eu-central-2": 0.52, + "eu-north-1": 0.4432, + "eu-south-1": 0.495, + "eu-south-2": 0.4592, + "eu-west-1": 0.4592, + "eu-west-2": 0.0, + "eu-west-3": 0.4968, + "il-central-1": 0.4764, + "me-central-1": 0.4936, + "me-south-1": 0.0, + "mx-central-1": 0.4386, + "sa-east-1": 0.6048, + "us-east-1": 0.4232, + "us-east-2": 0.0, + "us-gov-east-1": 0.5024, + "us-gov-west-1": 0.5024, + "us-west-1": 0.0, + "us-west-2": 0.4232, + "us-west-2-lax-1": 0.4848 + }, + "m6g.4xlarge": { + "af-south-1": 0.9856, + "ap-east-1": 1.0208, + "ap-northeast-1": 0.9648, + "ap-northeast-2": 0.9248, + "ap-northeast-3": 0.9664, + "ap-south-1": 0.5776, + "ap-south-2": 0.6019, + "ap-southeast-1": 0.9408, + "ap-southeast-2": 0.9408, + "ap-southeast-3": 0.9408, + "ap-southeast-4": 0.9408, + "ap-southeast-5": 0.8256, + "ap-southeast-7": 0.8256, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.9088, + "eu-central-2": 0.9824, + "eu-north-1": 0.8288, + "eu-south-1": 0.8896, + "eu-south-2": 0.8608, + "eu-west-1": 0.0, + "eu-west-2": 0.8832, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 0.9248, + "mx-central-1": 0.8197, + "sa-east-1": 0.0, + "us-east-1": 0.8256, + "us-east-2": 0.7888, + "us-gov-east-1": 0.9472, + "us-gov-west-1": 0.9937, + "us-west-1": 0.8896, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0 + }, + "m6g.8xlarge": { + "af-south-1": 2.0687, + "ap-east-1": 2.0416, + "ap-northeast-1": 2.0256, + "ap-northeast-2": 1.9408, + "ap-northeast-3": 1.9328, + "ap-south-1": 1.1552, + "ap-south-2": 0.0, + "ap-southeast-1": 1.8816, + "ap-southeast-2": 1.8816, + "ap-southeast-3": 1.9738, + "ap-southeast-4": 1.8816, + "ap-southeast-5": 1.7295, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 1.7152, + "eu-central-1": 1.8176, + "eu-central-2": 1.9648, + "eu-north-1": 1.6576, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 1.7216, + "eu-west-2": 0.0, + "eu-west-3": 1.872, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 1.8496, + "mx-central-1": 0.0, + "sa-east-1": 2.304, + "us-east-1": 1.5776, + "us-east-2": 1.5776, + "us-gov-east-1": 1.8944, + "us-gov-west-1": 1.8944, + "us-west-1": 1.7792, + "us-west-2": 0.0, + "us-west-2-lax-1": 1.824 + }, + "m6g.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 3.0624, + "ap-northeast-1": 2.8944, + "ap-northeast-2": 2.7744, + "ap-northeast-3": 2.8992, + "ap-south-1": 1.8057, + "ap-south-2": 1.7328, + "ap-southeast-1": 2.8224, + "ap-southeast-2": 2.8224, + "ap-southeast-3": 0.0, + "ap-southeast-4": 2.8224, + "ap-southeast-5": 2.4768, + "ap-southeast-7": 2.5943, + "ca-central-1": 2.5728, + "ca-west-1": 2.5728, + "eu-central-1": 2.7264, + "eu-central-2": 0.0, + "eu-north-1": 2.4864, + "eu-south-1": 2.6688, + "eu-south-2": 0.0, + "eu-west-1": 2.5824, + "eu-west-2": 2.6496, + "eu-west-3": 2.6784, + "il-central-1": 0.0, + "me-central-1": 2.9234, + "me-south-1": 2.7744, + "mx-central-1": 2.575, + "sa-east-1": 3.456, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 2.8416, + "us-gov-west-1": 2.8416, + "us-west-1": 2.6688, + "us-west-2": 0.0, + "us-west-2-lax-1": 2.8685 + }, + "m6g.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.0832, + "ap-northeast-1": 4.0512, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 2.3104, + "ap-south-2": 2.3104, + "ap-southeast-1": 3.9475, + "ap-southeast-2": 3.7632, + "ap-southeast-3": 3.7632, + "ap-southeast-4": 3.9475, + "ap-southeast-5": 3.3024, + "ap-southeast-7": 3.3024, + "ca-central-1": 3.4304, + "ca-west-1": 3.4304, + "eu-central-1": 3.6352, + "eu-central-2": 3.9296, + "eu-north-1": 3.3152, + "eu-south-1": 3.7299, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 3.5328, + "eu-west-3": 3.744, + "il-central-1": 3.5808, + "me-central-1": 3.7184, + "me-south-1": 3.6992, + "mx-central-1": 3.2787, + "sa-east-1": 4.608, + "us-east-1": 3.1552, + "us-east-2": 3.1552, + "us-gov-east-1": 3.7888, + "us-gov-west-1": 3.7888, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 3.648 + }, + "m6gd.medium": { + "af-south-1": 0.078, + "ap-east-1": 0.0764, + "ap-northeast-1": 0.0764, + "ap-northeast-2": 0.07, + "ap-northeast-3": 0.0728, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0709, + "ap-southeast-2": 0.0748, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0748, + "ap-southeast-5": 0.0624, + "ap-southeast-7": 0.0624, + "ca-central-1": 0.0648, + "ca-west-1": 0.0648, + "eu-central-1": 0.0721, + "eu-central-2": 0.0744, + "eu-north-1": 0.0, + "eu-south-1": 0.0672, + "eu-south-2": 0.0648, + "eu-west-1": 0.0678, + "eu-west-2": 0.0668, + "eu-west-3": 0.0704, + "il-central-1": 0.0673, + "me-central-1": 0.0698, + "me-south-1": 0.0698, + "mx-central-1": 0.0619, + "sa-east-1": 0.0, + "us-east-1": 0.0596, + "us-east-2": 0.0, + "us-gov-east-1": 0.075, + "us-gov-west-1": 0.075, + "us-west-1": 0.0674, + "us-west-2": 0.0623 + }, + "m6gd.large": { + "af-south-1": 0.1488, + "ap-east-1": 0.1528, + "ap-northeast-1": 0.1458, + "ap-northeast-2": 0.14, + "ap-northeast-3": 0.1456, + "ap-south-1": 0.0892, + "ap-south-2": 0.0892, + "ap-southeast-1": 0.1486, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1418, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.1248, + "ap-southeast-7": 0.1306, + "ca-central-1": 0.1356, + "ca-west-1": 0.1296, + "eu-central-1": 0.1378, + "eu-central-2": 0.1558, + "eu-north-1": 0.1306, + "eu-south-1": 0.1407, + "eu-south-2": 0.1296, + "eu-west-1": 0.1296, + "eu-west-2": 0.1336, + "eu-west-3": 0.0, + "il-central-1": 0.1346, + "me-central-1": 0.1396, + "me-south-1": 0.0, + "mx-central-1": 0.1237, + "sa-east-1": 0.1728, + "us-east-1": 0.1192, + "us-east-2": 0.1192, + "us-gov-east-1": 0.1432, + "us-gov-west-1": 0.1432, + "us-west-1": 0.1412, + "us-west-2": 0.0 + }, + "m6gd.xlarge": { + "af-south-1": 0.2976, + "ap-east-1": 0.3056, + "ap-northeast-1": 0.2916, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.1784, + "ap-southeast-1": 0.2836, + "ap-southeast-2": 0.2856, + "ap-southeast-3": 0.2836, + "ap-southeast-4": 0.2856, + "ap-southeast-5": 0.2497, + "ap-southeast-7": 0.2612, + "ca-central-1": 0.0, + "ca-west-1": 0.2592, + "eu-central-1": 0.2886, + "eu-central-2": 0.2974, + "eu-north-1": 0.2496, + "eu-south-1": 0.2688, + "eu-south-2": 0.2592, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.2688, + "il-central-1": 0.282, + "me-central-1": 0.2792, + "me-south-1": 0.2794, + "mx-central-1": 0.2474, + "sa-east-1": 0.3622, + "us-east-1": 0.2384, + "us-east-2": 0.2384, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.2492 + }, + "m6gd.metal": { + "af-south-1": 4.5312, + "ap-east-1": 4.6592, + "ap-northeast-1": 4.4352, + "ap-northeast-2": 4.2496, + "ap-northeast-3": 4.4288, + "ap-south-1": 0.0, + "ap-south-2": 2.624, + "ap-southeast-1": 4.3072, + "ap-southeast-2": 4.3392, + "ap-southeast-3": 4.3072, + "ap-southeast-4": 4.3392, + "ap-southeast-5": 3.9494, + "ap-southeast-7": 3.7645, + "ca-central-1": 4.1103, + "ca-west-1": 3.9168, + "eu-central-1": 4.3872, + "eu-central-2": 4.528, + "eu-north-1": 3.9488, + "eu-south-1": 4.2732, + "eu-south-2": 3.9168, + "eu-west-1": 3.9168, + "eu-west-2": 0.0, + "eu-west-3": 4.0704, + "il-central-1": 4.0781, + "me-central-1": 4.2368, + "me-south-1": 4.2394, + "mx-central-1": 0.0, + "sa-east-1": 5.2992, + "us-east-1": 0.0, + "us-east-2": 3.584, + "us-gov-east-1": 4.352, + "us-gov-west-1": 0.0, + "us-west-1": 4.0832, + "us-west-2": 3.584 + }, + "m6gd.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.641, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.5824, + "ap-south-1": 0.0, + "ap-south-2": 0.3568, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.5944, + "ap-southeast-4": 0.5984, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.5225, + "ca-central-1": 0.5184, + "ca-west-1": 0.5184, + "eu-central-1": 0.5512, + "eu-central-2": 0.0, + "eu-north-1": 0.4992, + "eu-south-1": 0.5376, + "eu-south-2": 0.5184, + "eu-west-1": 0.0, + "eu-west-2": 0.5596, + "eu-west-3": 0.5629, + "il-central-1": 0.0, + "me-central-1": 0.585, + "me-south-1": 0.5853, + "mx-central-1": 0.4949, + "sa-east-1": 0.7244, + "us-east-1": 0.4768, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.5728, + "us-west-1": 0.5392, + "us-west-2": 0.0 + }, + "m6gd.4xlarge": { + "af-south-1": 1.1328, + "ap-east-1": 1.1648, + "ap-northeast-1": 1.1088, + "ap-northeast-2": 1.0624, + "ap-northeast-3": 1.1072, + "ap-south-1": 0.0, + "ap-south-2": 0.656, + "ap-southeast-1": 1.0768, + "ap-southeast-2": 1.0848, + "ap-southeast-3": 1.1312, + "ap-southeast-4": 1.1392, + "ap-southeast-5": 0.9411, + "ap-southeast-7": 0.0, + "ca-central-1": 0.9792, + "ca-west-1": 0.0, + "eu-central-1": 1.0448, + "eu-central-2": 1.1892, + "eu-north-1": 0.0, + "eu-south-1": 1.0683, + "eu-south-2": 0.0, + "eu-west-1": 0.9792, + "eu-west-2": 0.0, + "eu-west-3": 1.0176, + "il-central-1": 0.0, + "me-central-1": 1.0592, + "me-south-1": 1.0598, + "mx-central-1": 0.9322, + "sa-east-1": 1.3248, + "us-east-1": 0.896, + "us-east-2": 0.896, + "us-gov-east-1": 1.1429, + "us-gov-west-1": 1.088, + "us-west-1": 1.0208, + "us-west-2": 0.9394 + }, + "m6gd.8xlarge": { + "af-south-1": 2.2656, + "ap-east-1": 2.3296, + "ap-northeast-1": 2.2176, + "ap-northeast-2": 2.1248, + "ap-northeast-3": 2.2144, + "ap-south-1": 1.37, + "ap-south-2": 1.37, + "ap-southeast-1": 2.1536, + "ap-southeast-2": 2.1696, + "ap-southeast-3": 2.1536, + "ap-southeast-4": 2.1696, + "ap-southeast-5": 1.8822, + "ap-southeast-7": 0.0, + "ca-central-1": 1.9584, + "ca-west-1": 2.0552, + "eu-central-1": 2.0896, + "eu-central-2": 2.264, + "eu-north-1": 1.8816, + "eu-south-1": 2.0352, + "eu-south-2": 1.9584, + "eu-west-1": 2.0552, + "eu-west-2": 2.0224, + "eu-west-3": 2.1366, + "il-central-1": 0.0, + "me-central-1": 2.2248, + "me-south-1": 2.1197, + "mx-central-1": 1.8643, + "sa-east-1": 2.6496, + "us-east-1": 1.792, + "us-east-2": 1.792, + "us-gov-east-1": 2.176, + "us-gov-west-1": 2.176, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6gd.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 3.4944, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.1872, + "ap-northeast-3": 3.3216, + "ap-south-1": 1.968, + "ap-south-2": 1.968, + "ap-southeast-1": 3.3936, + "ap-southeast-2": 3.2544, + "ap-southeast-3": 3.2304, + "ap-southeast-4": 0.0, + "ap-southeast-5": 2.8234, + "ap-southeast-7": 2.8234, + "ca-central-1": 2.9376, + "ca-west-1": 2.9376, + "eu-central-1": 3.1344, + "eu-central-2": 3.396, + "eu-north-1": 0.0, + "eu-south-1": 3.0528, + "eu-south-2": 0.0, + "eu-west-1": 3.0828, + "eu-west-2": 3.0336, + "eu-west-3": 3.0528, + "il-central-1": 3.211, + "me-central-1": 3.3372, + "me-south-1": 3.3392, + "mx-central-1": 2.7965, + "sa-east-1": 3.9744, + "us-east-1": 2.688, + "us-east-2": 2.8182, + "us-gov-east-1": 3.4287, + "us-gov-west-1": 3.264, + "us-west-1": 3.0624, + "us-west-2": 2.688 + }, + "m6gd.16xlarge": { + "af-south-1": 4.7616, + "ap-east-1": 4.6592, + "ap-northeast-1": 4.4352, + "ap-northeast-2": 4.2496, + "ap-northeast-3": 4.4288, + "ap-south-1": 2.624, + "ap-south-2": 2.624, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 4.3392, + "ap-southeast-5": 3.9494, + "ap-southeast-7": 3.7645, + "ca-central-1": 4.1103, + "ca-west-1": 3.9168, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 3.9488, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 4.246, + "eu-west-3": 0.0, + "il-central-1": 4.2813, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 3.7286, + "sa-east-1": 5.5651, + "us-east-1": 3.7576, + "us-east-2": 3.584, + "us-gov-east-1": 4.5716, + "us-gov-west-1": 4.5716, + "us-west-1": 4.0832, + "us-west-2": 3.584 + }, + "m6i.large": { + "af-south-1": 0.1558, + "ap-east-1": 0.1608, + "ap-northeast-1": 0.1528, + "ap-northeast-2": 0.1468, + "ap-northeast-3": 0.1528, + "ap-south-1": 0.0, + "ap-south-2": 0.1298, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1488, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.141, + "ap-southeast-7": 0.0, + "ca-central-1": 0.1358, + "ca-west-1": 0.1358, + "eu-central-1": 0.1438, + "eu-central-2": 0.1553, + "eu-north-1": 0.1308, + "eu-south-1": 0.152, + "eu-west-1": 0.1358, + "eu-west-2": 0.1398, + "eu-west-3": 0.1408, + "il-central-1": 0.14115, + "me-central-1": 0.15827, + "me-south-1": 0.1608, + "mx-central-1": 0.13968, + "sa-east-1": 0.1818, + "us-east-1": 0.1248, + "us-east-2": 0.1248, + "us-gov-east-1": 0.1498, + "us-gov-west-1": 0.1498, + "us-west-1": 0.1408, + "us-west-2": 0.1344 + }, + "m6i.xlarge": { + "af-south-1": 0.3116, + "ap-east-1": 0.3216, + "ap-northeast-1": 0.3304, + "ap-northeast-2": 0.2936, + "ap-northeast-3": 0.0, + "ap-south-1": 0.2596, + "ap-south-2": 0.2596, + "ap-southeast-1": 0.2976, + "ap-southeast-2": 0.2976, + "ap-southeast-3": 0.2976, + "ap-southeast-5": 0.2616, + "ap-southeast-7": 0.2616, + "ca-central-1": 0.293, + "ca-west-1": 0.2716, + "eu-central-1": 0.2876, + "eu-central-2": 0.3359, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.293, + "eu-west-2": 0.2796, + "eu-west-3": 0.2816, + "il-central-1": 0.2823, + "me-central-1": 0.293, + "me-south-1": 0.3216, + "mx-central-1": 0.0, + "sa-east-1": 0.3636, + "us-east-1": 0.2496, + "us-east-2": 0.2496, + "us-gov-east-1": 0.2996, + "us-gov-west-1": 0.2996, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6i.metal": { + "af-south-1": 9.3568, + "ap-east-1": 9.6768, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 9.1648, + "ap-south-1": 7.6928, + "ap-south-2": 7.6928, + "ap-southeast-1": 8.9088, + "ap-southeast-2": 8.9088, + "ap-southeast-3": 8.9088, + "ap-southeast-5": 7.7568, + "ap-southeast-7": 7.7568, + "ca-central-1": 8.0768, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 9.3248, + "eu-north-1": 7.7568, + "eu-south-1": 8.3968, + "eu-west-1": 0.0, + "eu-west-2": 8.3328, + "eu-west-3": 0.0, + "il-central-1": 8.4192, + "me-central-1": 8.7616, + "me-south-1": 9.6768, + "mx-central-1": 7.68, + "sa-east-1": 0.0, + "us-east-1": 7.3728, + "us-east-2": 7.3728, + "us-gov-east-1": 8.9728, + "us-gov-west-1": 8.9728, + "us-west-1": 8.3968, + "us-west-2": 7.3728 + }, + "m6i.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.6432, + "ap-northeast-1": 0.6112, + "ap-northeast-2": 0.5872, + "ap-northeast-3": 0.6112, + "ap-south-1": 0.5596, + "ap-south-2": 0.5596, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.5952, + "ap-southeast-3": 0.5952, + "ap-southeast-5": 0.564, + "ap-southeast-7": 0.564, + "ca-central-1": 0.5432, + "ca-west-1": 0.5432, + "eu-central-1": 0.0, + "eu-central-2": 0.6718, + "eu-north-1": 0.5232, + "eu-south-1": 0.0, + "eu-west-1": 0.5432, + "eu-west-2": 0.5592, + "eu-west-3": 0.0, + "il-central-1": 0.5646, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 0.55872, + "sa-east-1": 0.7884, + "us-east-1": 0.5376, + "us-east-2": 0.4992, + "us-gov-east-1": 0.5992, + "us-gov-west-1": 0.0, + "us-west-1": 0.5632, + "us-west-2": 0.5376 + }, + "m6i.4xlarge": { + "af-south-1": 1.1888, + "ap-east-1": 1.2288, + "ap-northeast-1": 1.1648, + "ap-northeast-2": 1.2112, + "ap-northeast-3": 1.1648, + "ap-south-1": 0.9808, + "ap-south-2": 0.0, + "ap-southeast-1": 1.1328, + "ap-southeast-2": 1.1328, + "ap-southeast-3": 1.1328, + "ap-southeast-5": 1.0704, + "ap-southeast-7": 0.9888, + "ca-central-1": 1.0288, + "ca-west-1": 1.0288, + "eu-central-1": 1.1848, + "eu-central-2": 1.1848, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 1.0288, + "eu-west-2": 1.0608, + "eu-west-3": 0.0, + "il-central-1": 1.16148, + "me-central-1": 1.1144, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 1.3968, + "us-east-1": 0.9408, + "us-east-2": 0.9408, + "us-gov-east-1": 1.1408, + "us-gov-west-1": 0.0, + "us-west-1": 1.0688, + "us-west-2": 0.9408 + }, + "m6i.8xlarge": { + "af-south-1": 2.3776, + "ap-east-1": 2.4576, + "ap-northeast-1": 2.528, + "ap-northeast-2": 2.2336, + "ap-northeast-3": 2.3296, + "ap-south-1": 1.9616, + "ap-south-2": 2.1232, + "ap-southeast-1": 2.4576, + "ap-southeast-2": 2.4576, + "ap-southeast-3": 2.2656, + "ap-southeast-5": 2.1408, + "ap-southeast-7": 1.9776, + "ca-central-1": 2.0576, + "ca-west-1": 2.2288, + "eu-central-1": 0.0, + "eu-central-2": 2.3696, + "eu-north-1": 2.1408, + "eu-south-1": 2.1376, + "eu-west-1": 2.2288, + "eu-west-2": 2.1216, + "eu-west-3": 2.3168, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 2.4576, + "mx-central-1": 1.9584, + "sa-east-1": 2.7936, + "us-east-1": 1.8816, + "us-east-2": 1.8816, + "us-gov-east-1": 2.2816, + "us-gov-west-1": 2.2816, + "us-west-1": 2.1376, + "us-west-2": 1.8816 + }, + "m6i.12xlarge": { + "af-south-1": 3.5664, + "ap-east-1": 3.6864, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.3504, + "ap-northeast-3": 3.792, + "ap-south-1": 2.9424, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.3984, + "ap-southeast-3": 3.3984, + "ap-southeast-5": 3.2112, + "ap-southeast-7": 3.2112, + "ca-central-1": 3.0864, + "ca-west-1": 3.0864, + "eu-central-1": 0.0, + "eu-central-2": 3.858, + "eu-north-1": 3.2112, + "eu-south-1": 3.2064, + "eu-west-1": 3.3432, + "eu-west-2": 3.4488, + "eu-west-3": 3.4752, + "il-central-1": 3.2148, + "me-central-1": 3.62568, + "me-south-1": 3.6864, + "mx-central-1": 2.9376, + "sa-east-1": 4.1904, + "us-east-1": 2.8224, + "us-east-2": 2.8224, + "us-gov-east-1": 3.4224, + "us-gov-west-1": 3.4224, + "us-west-1": 3.2064, + "us-west-2": 2.8224 + }, + "m6i.16xlarge": { + "af-south-1": 4.7552, + "ap-east-1": 4.9152, + "ap-northeast-1": 4.6592, + "ap-northeast-2": 4.8448, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 4.2464, + "ap-southeast-1": 4.5312, + "ap-southeast-2": 4.5312, + "ap-southeast-3": 4.5312, + "ap-southeast-5": 3.9552, + "ap-southeast-7": 4.2816, + "ca-central-1": 4.1152, + "ca-west-1": 0.0, + "eu-central-1": 4.3712, + "eu-central-2": 4.7392, + "eu-north-1": 3.9552, + "eu-south-1": 4.2752, + "eu-west-1": 4.1152, + "eu-west-2": 4.2432, + "eu-west-3": 4.6336, + "il-central-1": 4.2864, + "me-central-1": 4.4576, + "me-south-1": 4.9152, + "mx-central-1": 4.23936, + "sa-east-1": 0.0, + "us-east-1": 4.0704, + "us-east-2": 3.7632, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.9504, + "us-west-1": 4.2752, + "us-west-2": 0.0 + }, + "m6i.24xlarge": { + "af-south-1": 0.0, + "ap-east-1": 7.3728, + "ap-northeast-1": 6.9888, + "ap-northeast-2": 0.0, + "ap-northeast-3": 6.9888, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 6.7968, + "ap-southeast-2": 0.0, + "ap-southeast-3": 6.7968, + "ap-southeast-5": 5.9328, + "ap-southeast-7": 5.9328, + "ca-central-1": 6.1728, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 7.1088, + "eu-north-1": 0.0, + "eu-south-1": 6.9504, + "eu-west-1": 0.0, + "eu-west-2": 6.3648, + "eu-west-3": 0.0, + "il-central-1": 6.4296, + "me-central-1": 6.6864, + "me-south-1": 7.3728, + "mx-central-1": 5.8752, + "sa-east-1": 8.3808, + "us-east-1": 5.6448, + "us-east-2": 5.6448, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 6.4128, + "us-west-2": 5.6448 + }, + "m6i.32xlarge": { + "af-south-1": 9.3568, + "ap-east-1": 0.0, + "ap-northeast-1": 9.1648, + "ap-northeast-2": 8.7808, + "ap-northeast-3": 9.1648, + "ap-south-1": 7.6928, + "ap-south-2": 7.6928, + "ap-southeast-1": 8.9088, + "ap-southeast-2": 8.9088, + "ap-southeast-3": 8.9088, + "ap-southeast-5": 7.7568, + "ap-southeast-7": 7.7568, + "ca-central-1": 8.0768, + "ca-west-1": 8.0768, + "eu-central-1": 8.5888, + "eu-central-2": 0.0, + "eu-north-1": 7.7568, + "eu-south-1": 8.3968, + "eu-west-1": 8.0768, + "eu-west-2": 0.0, + "eu-west-3": 8.3968, + "il-central-1": 8.4192, + "me-central-1": 8.7616, + "me-south-1": 9.6768, + "mx-central-1": 7.68, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 7.3728, + "us-gov-east-1": 0.0, + "us-gov-west-1": 8.9728, + "us-west-1": 8.3968, + "us-west-2": 7.3728 + }, + "m6id.large": { + "ap-northeast-1": 0.1821, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.17685, + "ap-southeast-2": 0.19281, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.17433, + "ca-west-1": 0.1611, + "eu-central-1": 0.1716, + "eu-central-2": 0.18588, + "eu-west-1": 0.1611, + "eu-west-2": 0.16635, + "il-central-1": 0.16772, + "mx-central-1": 0.15338, + "sa-east-1": 0.2178, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 0.179, + "us-west-2": 0.14745 + }, + "m6id.xlarge": { + "ap-northeast-1": 0.39486, + "ap-northeast-2": 0.3495, + "ap-south-1": 0.3138, + "ap-southeast-1": 0.3537, + "ap-southeast-2": 0.3558, + "ap-southeast-5": 0.30928, + "ap-southeast-7": 0.0, + "ca-central-1": 0.34866, + "ca-west-1": 0.3222, + "eu-central-1": 0.3432, + "eu-central-2": 0.40318, + "eu-west-1": 0.3222, + "eu-west-2": 0.36021, + "il-central-1": 0.33544, + "mx-central-1": 0.33168, + "sa-east-1": 0.4356, + "us-east-1": 0.2949, + "us-east-2": 0.2949, + "us-gov-west-1": 0.358, + "us-west-2": 0.31863 + }, + "m6id.metal": { + "ap-northeast-1": 11.04, + "ap-northeast-2": 10.5696, + "ap-south-1": 9.4272, + "ap-southeast-1": 10.704, + "ap-southeast-2": 10.7712, + "ap-southeast-5": 9.28256, + "ap-southeast-7": 9.28256, + "ca-central-1": 9.696, + "ca-west-1": 9.696, + "eu-central-1": 10.368, + "eu-central-2": 11.28192, + "eu-west-1": 9.696, + "eu-west-2": 10.032, + "il-central-1": 10.11968, + "mx-central-1": 9.20192, + "sa-east-1": 13.3248, + "us-east-1": 8.8224, + "us-east-2": 8.8224, + "us-gov-west-1": 10.8416, + "us-west-2": 8.8224 + }, + "m6id.2xlarge": { + "ap-northeast-1": 0.78972, + "ap-northeast-2": 0.75738, + "ap-south-1": 0.67884, + "ap-southeast-1": 0.7074, + "ap-southeast-2": 0.7116, + "ap-southeast-5": 0.61856, + "ap-southeast-7": 0.0, + "ca-central-1": 0.69732, + "ca-west-1": 0.6444, + "eu-central-1": 0.74352, + "eu-central-2": 0.74352, + "eu-west-1": 0.69732, + "eu-west-2": 0.72042, + "il-central-1": 0.67088, + "mx-central-1": 0.61352, + "sa-east-1": 0.8712, + "us-east-1": 0.5898, + "us-east-2": 0.5898, + "us-gov-west-1": 0.716, + "us-west-2": 0.5898 + }, + "m6id.4xlarge": { + "ap-northeast-1": 1.3992, + "ap-northeast-2": 1.3404, + "ap-south-1": 0.0, + "ap-southeast-1": 1.3572, + "ap-southeast-2": 1.3656, + "ap-southeast-5": 1.17952, + "ap-southeast-7": 1.17952, + "ca-central-1": 1.2312, + "ca-west-1": 1.2312, + "eu-central-1": 1.3152, + "eu-central-2": 1.42944, + "eu-west-1": 1.2312, + "eu-west-2": 1.38324, + "il-central-1": 1.28416, + "mx-central-1": 1.16944, + "sa-east-1": 1.6848, + "us-east-1": 1.122, + "us-east-2": 1.122, + "us-gov-west-1": 0.0, + "us-west-2": 1.21692 + }, + "m6id.8xlarge": { + "ap-northeast-1": 3.04368, + "ap-northeast-2": 2.6808, + "ap-south-1": 0.0, + "ap-southeast-1": 2.7144, + "ap-southeast-2": 2.7312, + "ap-southeast-5": 2.56038, + "ap-southeast-7": 2.35904, + "ca-central-1": 2.4624, + "ca-west-1": 0.0, + "eu-central-1": 2.6304, + "eu-central-2": 2.85888, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "il-central-1": 2.79059, + "mx-central-1": 2.33888, + "sa-east-1": 3.3696, + "us-east-1": 2.244, + "us-east-2": 0.0, + "us-gov-west-1": 2.98912, + "us-west-2": 2.43384 + }, + "m6id.12xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.37148, + "ap-south-1": 0.0, + "ap-southeast-1": 4.0716, + "ap-southeast-2": 0.0, + "ap-southeast-5": 3.84058, + "ap-southeast-7": 3.53856, + "ca-central-1": 3.6936, + "ca-west-1": 3.6936, + "eu-central-1": 3.9456, + "eu-central-2": 4.66531, + "eu-west-1": 3.6936, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "mx-central-1": 3.50832, + "sa-east-1": 0.0, + "us-east-1": 3.366, + "us-east-2": 3.65076, + "us-gov-west-1": 4.1232, + "us-west-2": 3.366 + }, + "m6id.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.82864, + "ap-south-1": 4.7904, + "ap-southeast-1": 5.4288, + "ap-southeast-2": 5.4624, + "ap-southeast-5": 4.71808, + "ap-southeast-7": 4.71808, + "ca-central-1": 4.9248, + "ca-west-1": 4.9248, + "eu-central-1": 5.2608, + "eu-central-2": 0.0, + "eu-west-1": 4.9248, + "eu-west-2": 5.0928, + "il-central-1": 5.58118, + "mx-central-1": 4.67776, + "sa-east-1": 6.7392, + "us-east-1": 4.488, + "us-east-2": 4.488, + "us-gov-west-1": 5.4976, + "us-west-2": 4.488 + }, + "m6id.24xlarge": { + "ap-northeast-1": 8.3952, + "ap-northeast-2": 8.0424, + "ap-south-1": 0.0, + "ap-southeast-1": 8.1432, + "ap-southeast-2": 8.1936, + "ap-southeast-5": 7.07712, + "ap-southeast-7": 7.07712, + "ca-central-1": 0.0, + "ca-west-1": 7.3872, + "eu-central-1": 8.57664, + "eu-central-2": 9.33062, + "eu-west-1": 7.3872, + "eu-west-2": 0.0, + "il-central-1": 7.70496, + "mx-central-1": 7.01664, + "sa-east-1": 0.0, + "us-east-1": 6.732, + "us-east-2": 6.732, + "us-gov-west-1": 8.96736, + "us-west-2": 6.732 + }, + "m6id.32xlarge": { + "ap-northeast-1": 11.04, + "ap-northeast-2": 0.0, + "ap-south-1": 9.4272, + "ap-southeast-1": 10.704, + "ap-southeast-2": 10.7712, + "ap-southeast-5": 9.28256, + "ap-southeast-7": 9.28256, + "ca-central-1": 9.696, + "ca-west-1": 9.696, + "eu-central-1": 10.368, + "eu-central-2": 11.28192, + "eu-west-1": 9.696, + "eu-west-2": 10.032, + "il-central-1": 10.11968, + "mx-central-1": 9.20192, + "sa-east-1": 0.0, + "us-east-1": 8.8224, + "us-east-2": 0.0, + "us-gov-west-1": 10.8416, + "us-west-2": 8.8224 + }, + "m6idn.large": { + "ap-northeast-1": 0.25403, + "ap-south-1": 0.21542, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.23004, + "ca-central-1": 0.20298, + "eu-central-1": 0.21834, + "eu-central-2": 0.23536, + "eu-north-1": 0.1948, + "eu-south-2": 0.20298, + "eu-west-1": 0.20664, + "us-east-1": 0.18792, + "us-east-2": 0.0, + "us-gov-west-1": 0.22887, + "us-west-1": 0.21224, + "us-west-2": 0.0 + }, + "m6idn.xlarge": { + "ap-northeast-1": 0.4671, + "ap-south-1": 0.3969, + "ap-southeast-1": 0.44838, + "ap-southeast-2": 0.46008, + "ca-central-1": 0.40596, + "eu-central-1": 0.0, + "eu-central-2": 0.51203, + "eu-north-1": 0.3896, + "eu-south-2": 0.4408, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.40766, + "us-gov-west-1": 0.45774, + "us-west-1": 0.42448, + "us-west-2": 0.0 + }, + "m6idn.metal": { + "ap-northeast-1": 14.3328, + "ap-south-1": 12.0864, + "ap-southeast-1": 13.73376, + "ap-southeast-2": 14.10816, + "ca-central-1": 12.37632, + "eu-central-1": 13.35936, + "eu-central-2": 14.44864, + "eu-north-1": 11.8528, + "eu-south-2": 12.37632, + "eu-west-1": 12.61056, + "us-east-1": 11.41248, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 12.96896, + "us-west-2": 0.0 + }, + "m6idn.2xlarge": { + "ap-northeast-1": 0.9342, + "ap-south-1": 0.0, + "ap-southeast-1": 0.89676, + "ap-southeast-2": 1.00066, + "ca-central-1": 0.81192, + "eu-central-1": 0.87336, + "eu-central-2": 0.94144, + "eu-north-1": 0.7792, + "eu-south-2": 0.88159, + "eu-west-1": 0.82656, + "us-east-1": 0.75168, + "us-east-2": 0.0, + "us-gov-west-1": 0.91548, + "us-west-1": 0.84896, + "us-west-2": 0.75168 + }, + "m6idn.4xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 1.53, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.78272, + "ca-central-1": 0.0, + "eu-central-1": 1.68912, + "eu-central-2": 1.82528, + "eu-north-1": 1.6336, + "eu-south-2": 1.70558, + "eu-west-1": 1.59552, + "us-east-1": 1.44576, + "us-east-2": 0.0, + "us-gov-west-1": 1.93342, + "us-west-1": 0.0, + "us-west-2": 1.44576 + }, + "m6idn.8xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 3.06, + "ap-southeast-1": 3.78446, + "ap-southeast-2": 3.88742, + "ca-central-1": 3.13248, + "eu-central-1": 3.37824, + "eu-central-2": 3.65056, + "eu-north-1": 3.0016, + "eu-south-2": 0.0, + "eu-west-1": 3.19104, + "us-east-1": 2.89152, + "us-east-2": 2.89152, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 3.14611 + }, + "m6idn.12xlarge": { + "ap-northeast-1": 5.4324, + "ap-south-1": 0.0, + "ap-southeast-1": 5.20776, + "ap-southeast-2": 5.83114, + "ca-central-1": 0.0, + "eu-central-1": 5.06736, + "eu-central-2": 5.47584, + "eu-north-1": 4.5024, + "eu-south-2": 4.69872, + "eu-west-1": 4.78656, + "us-east-1": 4.33728, + "us-east-2": 4.71917, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 4.71917 + }, + "m6idn.16xlarge": { + "ap-northeast-1": 7.2432, + "ap-south-1": 6.12, + "ap-southeast-1": 6.94368, + "ap-southeast-2": 7.13088, + "ca-central-1": 6.26496, + "eu-central-1": 6.75648, + "eu-central-2": 7.30112, + "eu-north-1": 0.0, + "eu-south-2": 6.26496, + "eu-west-1": 6.38208, + "us-east-1": 6.29222, + "us-east-2": 5.78304, + "us-gov-west-1": 0.0, + "us-west-1": 7.14829, + "us-west-2": 6.29222 + }, + "m6idn.24xlarge": { + "ap-northeast-1": 10.8648, + "ap-south-1": 0.0, + "ap-southeast-1": 10.41552, + "ap-southeast-2": 10.69632, + "ca-central-1": 9.39744, + "eu-central-1": 11.04451, + "eu-central-2": 0.0, + "eu-north-1": 9.0048, + "eu-south-2": 0.0, + "eu-west-1": 9.57312, + "us-east-1": 8.67456, + "us-east-2": 0.0, + "us-gov-west-1": 11.6005, + "us-west-1": 10.72243, + "us-west-2": 8.67456 + }, + "m6idn.32xlarge": { + "ap-northeast-1": 14.3328, + "ap-south-1": 12.0864, + "ap-southeast-1": 13.73376, + "ap-southeast-2": 14.10816, + "ca-central-1": 12.37632, + "eu-central-1": 13.35936, + "eu-central-2": 14.44864, + "eu-north-1": 11.8528, + "eu-south-2": 12.37632, + "eu-west-1": 0.0, + "us-east-1": 11.41248, + "us-east-2": 11.41248, + "us-gov-west-1": 14.03328, + "us-west-1": 0.0, + "us-west-2": 11.41248 + }, + "m6in.large": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.18839, + "ap-southeast-1": 0.19962, + "ap-southeast-2": 0.2043, + "ca-central-1": 0.1995, + "eu-central-1": 0.19377, + "eu-central-2": 0.21226, + "eu-north-1": 0.1768, + "eu-south-2": 0.0, + "eu-west-1": 0.18441, + "us-east-1": 0.18195, + "us-east-2": 0.0, + "us-gov-west-1": 0.20313, + "us-west-1": 0.19124, + "us-west-2": 0.18195 + }, + "m6in.xlarge": { + "ap-northeast-1": 0.45142, + "ap-south-1": 0.34776, + "ap-southeast-1": 0.4334, + "ap-southeast-2": 0.4086, + "ca-central-1": 0.36796, + "eu-central-1": 0.38754, + "eu-central-2": 0.46121, + "eu-north-1": 0.3832, + "eu-south-2": 0.36796, + "eu-west-1": 0.36882, + "us-east-1": 0.33606, + "us-east-2": 0.33606, + "us-gov-west-1": 0.0, + "us-west-1": 0.38248, + "us-west-2": 0.0 + }, + "m6in.metal": { + "ap-northeast-1": 12.68544, + "ap-south-1": 10.51392, + "ap-southeast-1": 12.16128, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 11.78688, + "eu-central-2": 12.97024, + "eu-north-1": 0.0, + "eu-south-2": 11.16032, + "eu-west-1": 11.18784, + "us-east-1": 0.0, + "us-east-2": 10.13952, + "us-gov-west-1": 12.38592, + "us-west-1": 11.62496, + "us-west-2": 10.13952 + }, + "m6in.2xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.75355, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.8172, + "ca-central-1": 0.73592, + "eu-central-1": 0.77508, + "eu-central-2": 0.0, + "eu-north-1": 0.7072, + "eu-south-2": 0.73592, + "eu-west-1": 0.73764, + "us-east-1": 0.67212, + "us-east-2": 0.67212, + "us-gov-west-1": 0.81252, + "us-west-1": 0.76496, + "us-west-2": 0.67212 + }, + "m6in.4xlarge": { + "ap-northeast-1": 1.60488, + "ap-south-1": 0.0, + "ap-southeast-1": 1.53936, + "ap-southeast-2": 1.5768, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 1.64048, + "eu-north-1": 1.3568, + "eu-south-2": 0.0, + "eu-west-1": 1.41768, + "us-east-1": 1.39802, + "us-east-2": 1.28664, + "us-gov-west-1": 1.56744, + "us-west-1": 1.47232, + "us-west-2": 0.0 + }, + "m6in.8xlarge": { + "ap-northeast-1": 3.20976, + "ap-south-1": 2.66688, + "ap-southeast-1": 3.07872, + "ap-southeast-2": 3.1536, + "ca-central-1": 2.82848, + "eu-central-1": 2.98512, + "eu-central-2": 3.28096, + "eu-north-1": 2.9504, + "eu-south-2": 3.07677, + "eu-west-1": 2.83536, + "us-east-1": 2.57328, + "us-east-2": 0.0, + "us-gov-west-1": 3.13488, + "us-west-1": 3.20454, + "us-west-2": 0.0 + }, + "m6in.12xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 4.00032, + "ap-southeast-1": 4.61808, + "ap-southeast-2": 4.7304, + "ca-central-1": 4.24272, + "eu-central-1": 4.47768, + "eu-central-2": 5.36174, + "eu-north-1": 4.0704, + "eu-south-2": 4.61515, + "eu-west-1": 4.25304, + "us-east-1": 3.85992, + "us-east-2": 3.85992, + "us-gov-west-1": 4.70232, + "us-west-1": 0.0, + "us-west-2": 4.19407 + }, + "m6in.16xlarge": { + "ap-northeast-1": 6.41952, + "ap-south-1": 5.33376, + "ap-southeast-1": 6.70406, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 7.14899, + "eu-north-1": 5.4272, + "eu-south-2": 0.0, + "eu-west-1": 6.16867, + "us-east-1": 5.14656, + "us-east-2": 5.14656, + "us-gov-west-1": 6.26976, + "us-west-1": 5.88928, + "us-west-2": 0.0 + }, + "m6in.24xlarge": { + "ap-northeast-1": 9.62928, + "ap-south-1": 0.0, + "ap-southeast-1": 9.23616, + "ap-southeast-2": 9.4608, + "ca-central-1": 0.0, + "eu-central-1": 8.95536, + "eu-central-2": 10.72349, + "eu-north-1": 8.1408, + "eu-south-2": 8.48544, + "eu-west-1": 9.25301, + "us-east-1": 8.38814, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 9.61363, + "us-west-2": 8.38814 + }, + "m6in.32xlarge": { + "ap-northeast-1": 12.68544, + "ap-south-1": 0.0, + "ap-southeast-1": 12.16128, + "ap-southeast-2": 12.4608, + "ca-central-1": 11.16032, + "eu-central-1": 11.78688, + "eu-central-2": 12.97024, + "eu-north-1": 10.7008, + "eu-south-2": 11.16032, + "eu-west-1": 11.18784, + "us-east-1": 10.13952, + "us-east-2": 10.13952, + "us-gov-west-1": 12.38592, + "us-west-1": 11.62496, + "us-west-2": 10.13952 + }, + "m7a.medium": { + "ap-northeast-1": 0.09675, + "eu-central-1": 0.0, + "eu-north-1": 0.08214, + "eu-south-2": 0.079, + "eu-west-1": 0.079, + "us-east-1": 0.07236, + "us-east-2": 0.07236, + "us-west-2": 0.07816 + }, + "m7a.large": { + "ap-northeast-1": 0.17853, + "eu-central-1": 0.16766, + "eu-north-1": 0.16428, + "eu-south-2": 0.0, + "eu-west-1": 0.17092, + "us-east-1": 0.14472, + "us-east-2": 0.0, + "us-west-2": 0.15631 + }, + "m7a.xlarge": { + "ap-northeast-1": 0.35706, + "eu-central-1": 0.33532, + "eu-north-1": 0.30392, + "eu-south-2": 0.34184, + "eu-west-1": 0.316, + "us-east-1": 0.0, + "us-east-2": 0.28944, + "us-west-2": 0.28944 + }, + "m7a.metal-48xl": { + "ap-northeast-1": 16.21728, + "eu-central-1": 15.17376, + "eu-north-1": 13.66656, + "eu-south-2": 14.2464, + "eu-west-1": 14.2464, + "us-east-1": 12.97152, + "us-east-2": 12.97152, + "us-west-2": 0.0 + }, + "m7a.2xlarge": { + "ap-northeast-1": 0.77401, + "eu-central-1": 0.72618, + "eu-north-1": 0.60784, + "eu-south-2": 0.632, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.57888 + }, + "m7a.4xlarge": { + "ap-northeast-1": 1.37064, + "eu-central-1": 1.28368, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 1.2064, + "us-east-1": 1.10016, + "us-east-2": 1.1929, + "us-west-2": 0.0 + }, + "m7a.8xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 2.56736, + "eu-north-1": 2.31616, + "eu-south-2": 2.4128, + "eu-west-1": 2.4128, + "us-east-1": 2.38579, + "us-east-2": 0.0, + "us-west-2": 2.38579 + }, + "m7a.12xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 3.47424, + "eu-south-2": 3.6192, + "eu-west-1": 3.6192, + "us-east-1": 3.30048, + "us-east-2": 0.0, + "us-west-2": 3.30048 + }, + "m7a.16xlarge": { + "ap-northeast-1": 5.48256, + "eu-central-1": 0.0, + "eu-north-1": 4.63232, + "eu-south-2": 4.8256, + "eu-west-1": 5.23904, + "us-east-1": 4.77158, + "us-east-2": 4.77158, + "us-west-2": 4.40064 + }, + "m7a.24xlarge": { + "ap-northeast-1": 8.94254, + "eu-central-1": 7.70208, + "eu-north-1": 6.94848, + "eu-south-2": 7.2384, + "eu-west-1": 7.2384, + "us-east-1": 6.60096, + "us-east-2": 6.60096, + "us-west-2": 7.15738 + }, + "m7a.32xlarge": { + "ap-northeast-1": 10.81152, + "eu-central-1": 0.0, + "eu-north-1": 9.11104, + "eu-south-2": 9.4976, + "eu-west-1": 10.32448, + "us-east-1": 9.38957, + "us-east-2": 8.64768, + "us-west-2": 9.38957 + }, + "m7a.48xlarge": { + "ap-northeast-1": 16.21728, + "eu-central-1": 15.17376, + "eu-north-1": 0.0, + "eu-south-2": 14.2464, + "eu-west-1": 14.2464, + "us-east-1": 12.97152, + "us-east-2": 12.97152, + "us-west-2": 12.97152 + }, + "m7g.medium": { + "ap-northeast-1": 0.0704, + "ap-northeast-2": 0.0646, + "ap-northeast-3": 0.0671, + "ap-south-1": 0.0, + "ap-south-2": 0.0436, + "ap-southeast-1": 0.0654, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0578, + "ap-southeast-7": 0.0578, + "ca-central-1": 0.0599, + "eu-central-1": 0.0633, + "eu-north-1": 0.0578, + "eu-south-2": 0.0599, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.062, + "me-central-1": 0.0644, + "me-south-1": 0.0705, + "mx-central-1": 0.0572, + "sa-east-1": 0.0833, + "us-east-1": 0.0, + "us-east-2": 0.0552, + "us-gov-east-1": 0.069, + "us-west-1": 0.065, + "us-west-2": 0.0552 + }, + "m7g.large": { + "ap-northeast-1": 0.1409, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1308, + "ap-southeast-3": 0.1308, + "ap-southeast-4": 0.1308, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.1155, + "ca-central-1": 0.1198, + "eu-central-1": 0.1266, + "eu-north-1": 0.1155, + "eu-south-2": 0.1254, + "eu-west-1": 0.1198, + "eu-west-2": 0.1291, + "eu-west-3": 0.124, + "me-central-1": 0.1288, + "me-south-1": 0.1481, + "mx-central-1": 0.1145, + "sa-east-1": 0.0, + "us-east-1": 0.1104, + "us-east-2": 0.1104, + "us-gov-east-1": 0.1316, + "us-west-1": 0.124, + "us-west-2": 0.1104 + }, + "m7g.xlarge": { + "ap-northeast-1": 0.2684, + "ap-northeast-2": 0.2707, + "ap-northeast-3": 0.2684, + "ap-south-1": 0.1742, + "ap-south-2": 0.1742, + "ap-southeast-1": 0.2616, + "ap-southeast-2": 0.2616, + "ap-southeast-3": 0.2616, + "ap-southeast-4": 0.2616, + "ap-southeast-5": 0.231, + "ap-southeast-7": 0.231, + "ca-central-1": 0.2509, + "eu-central-1": 0.2531, + "eu-north-1": 0.0, + "eu-south-2": 0.2508, + "eu-west-1": 0.2395, + "eu-west-2": 0.2463, + "eu-west-3": 0.248, + "me-central-1": 0.2577, + "me-south-1": 0.282, + "mx-central-1": 0.229, + "sa-east-1": 0.3177, + "us-east-1": 0.2208, + "us-east-2": 0.2208, + "us-gov-east-1": 0.0, + "us-west-1": 0.248, + "us-west-2": 0.0 + }, + "m7g.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.9008, + "ap-northeast-3": 4.064, + "ap-south-1": 2.5574, + "ap-south-2": 2.5574, + "ap-southeast-1": 3.9552, + "ap-southeast-2": 3.9552, + "ap-southeast-3": 3.9552, + "ap-southeast-4": 3.9552, + "ap-southeast-5": 3.4656, + "ap-southeast-7": 3.4656, + "ca-central-1": 3.6019, + "eu-central-1": 0.0, + "eu-north-1": 3.4656, + "eu-south-2": 0.0, + "eu-west-1": 3.6016, + "eu-west-2": 3.7107, + "eu-west-3": 3.7376, + "me-central-1": 3.8926, + "me-south-1": 4.2816, + "mx-central-1": 3.433, + "sa-east-1": 4.8528, + "us-east-1": 3.3024, + "us-east-2": 3.3024, + "us-gov-east-1": 3.9808, + "us-west-1": 3.7376, + "us-west-2": 3.3024 + }, + "m7g.2xlarge": { + "ap-northeast-1": 0.5368, + "ap-northeast-2": 0.5164, + "ap-northeast-3": 0.5368, + "ap-south-1": 0.3485, + "ap-south-2": 0.3632, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.5232, + "ap-southeast-4": 0.5489, + "ap-southeast-5": 0.462, + "ap-southeast-7": 0.462, + "ca-central-1": 0.479, + "eu-central-1": 0.5062, + "eu-north-1": 0.4838, + "eu-south-2": 0.5017, + "eu-west-1": 0.479, + "eu-west-2": 0.4926, + "eu-west-3": 0.5199, + "me-central-1": 0.5154, + "me-south-1": 0.0, + "mx-central-1": 0.4579, + "sa-east-1": 0.0, + "us-east-1": 0.4416, + "us-east-2": 0.4416, + "us-gov-east-1": 0.5264, + "us-west-1": 0.0, + "us-west-2": 0.4416 + }, + "m7g.4xlarge": { + "ap-northeast-1": 1.0692, + "ap-northeast-2": 1.0252, + "ap-northeast-3": 1.0666, + "ap-south-1": 0.6687, + "ap-south-2": 0.6394, + "ap-southeast-1": 0.9888, + "ap-southeast-2": 1.0402, + "ap-southeast-3": 0.9888, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.8664, + "ap-southeast-7": 0.9101, + "ca-central-1": 0.0, + "eu-central-1": 1.0042, + "eu-north-1": 0.8664, + "eu-south-2": 0.9, + "eu-west-1": 0.9004, + "eu-west-2": 0.0, + "eu-west-3": 0.9344, + "me-central-1": 0.9732, + "me-south-1": 1.0704, + "mx-central-1": 0.8582, + "sa-east-1": 1.2132, + "us-east-1": 0.8667, + "us-east-2": 0.8667, + "us-gov-east-1": 0.9952, + "us-west-1": 0.9344, + "us-west-2": 0.0 + }, + "m7g.8xlarge": { + "ap-northeast-1": 2.032, + "ap-northeast-2": 1.9504, + "ap-northeast-3": 2.032, + "ap-south-1": 1.3374, + "ap-south-2": 1.2787, + "ap-southeast-1": 2.0804, + "ap-southeast-2": 1.9776, + "ap-southeast-3": 0.0, + "ap-southeast-4": 2.0804, + "ap-southeast-5": 1.7328, + "ap-southeast-7": 0.0, + "ca-central-1": 1.801, + "eu-central-1": 1.9098, + "eu-north-1": 1.8202, + "eu-south-2": 1.8915, + "eu-west-1": 1.8008, + "eu-west-2": 0.0, + "eu-west-3": 1.8688, + "me-central-1": 2.0472, + "me-south-1": 2.1408, + "mx-central-1": 1.8028, + "sa-east-1": 2.5492, + "us-east-1": 1.6512, + "us-east-2": 1.6512, + "us-gov-east-1": 1.9904, + "us-west-1": 0.0, + "us-west-2": 1.6512 + }, + "m7g.12xlarge": { + "ap-northeast-1": 3.048, + "ap-northeast-2": 2.9256, + "ap-northeast-3": 3.048, + "ap-south-1": 1.9181, + "ap-south-2": 2.0063, + "ap-southeast-1": 2.9664, + "ap-southeast-2": 2.9664, + "ap-southeast-3": 3.1206, + "ap-southeast-4": 2.9664, + "ap-southeast-5": 2.7303, + "ap-southeast-7": 2.5992, + "ca-central-1": 2.8385, + "eu-central-1": 3.0125, + "eu-north-1": 2.5992, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 2.783, + "eu-west-3": 2.9467, + "me-central-1": 2.9195, + "me-south-1": 3.2112, + "mx-central-1": 2.5747, + "sa-east-1": 3.6396, + "us-east-1": 0.0, + "us-east-2": 2.4768, + "us-gov-east-1": 2.9856, + "us-west-1": 2.8032, + "us-west-2": 2.4768 + }, + "m7g.16xlarge": { + "ap-northeast-1": 4.064, + "ap-northeast-2": 3.9008, + "ap-northeast-3": 0.0, + "ap-south-1": 2.5574, + "ap-south-2": 2.5574, + "ap-southeast-1": 3.9552, + "ap-southeast-2": 3.9552, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 3.4656, + "ap-southeast-7": 0.0, + "ca-central-1": 3.6019, + "eu-central-1": 3.8195, + "eu-north-1": 3.4656, + "eu-south-2": 3.6, + "eu-west-1": 3.6016, + "eu-west-2": 3.7107, + "eu-west-3": 3.7376, + "me-central-1": 3.8926, + "me-south-1": 0.0, + "mx-central-1": 3.433, + "sa-east-1": 4.8528, + "us-east-1": 3.3024, + "us-east-2": 3.3024, + "us-gov-east-1": 3.9808, + "us-west-1": 3.7376, + "us-west-2": 3.3024 + }, + "m7gd.medium": { + "ap-northeast-1": 0.0834, + "ap-south-1": 0.052, + "ap-southeast-1": 0.081, + "ap-southeast-2": 0.0815, + "ap-southeast-5": 0.071, + "ap-southeast-7": 0.071, + "eu-central-1": 0.0787, + "eu-north-1": 0.0745, + "eu-south-2": 0.0739, + "eu-west-1": 0.0, + "eu-west-3": 0.0768, + "mx-central-1": 0.0705, + "sa-east-1": 0.0995, + "us-east-1": 0.0678, + "us-east-2": 0.071, + "us-west-1": 0.0, + "us-west-2": 0.0678 + }, + "m7gd.large": { + "ap-northeast-1": 0.175, + "ap-south-1": 0.0, + "ap-southeast-1": 0.162, + "ap-southeast-2": 0.163, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.1489, + "eu-central-1": 0.165, + "eu-north-1": 0.1422, + "eu-south-2": 0.1479, + "eu-west-1": 0.1479, + "eu-west-3": 0.0, + "mx-central-1": 0.1476, + "sa-east-1": 0.1989, + "us-east-1": 0.142, + "us-east-2": 0.142, + "us-west-1": 0.162, + "us-west-2": 0.1356 + }, + "m7gd.xlarge": { + "ap-northeast-1": 0.3335, + "ap-south-1": 0.1996, + "ap-southeast-1": 0.3241, + "ap-southeast-2": 0.326, + "ap-southeast-5": 0.2841, + "ap-southeast-7": 0.2841, + "eu-central-1": 0.3146, + "eu-north-1": 0.2844, + "eu-south-2": 0.2957, + "eu-west-1": 0.31, + "eu-west-3": 0.3071, + "mx-central-1": 0.0, + "sa-east-1": 0.3978, + "us-east-1": 0.2712, + "us-east-2": 0.0, + "us-west-1": 0.3241, + "us-west-2": 0.284 + }, + "m7gd.metal": { + "ap-northeast-1": 0.0, + "ap-south-1": 2.9632, + "ap-southeast-1": 4.955, + "ap-southeast-2": 4.9853, + "ap-southeast-5": 4.3155, + "ap-southeast-7": 4.3155, + "eu-central-1": 0.0, + "eu-north-1": 4.32, + "eu-south-2": 4.5014, + "eu-west-1": 4.5014, + "eu-west-3": 4.6829, + "mx-central-1": 4.279, + "sa-east-1": 0.0, + "us-east-1": 4.1083, + "us-east-2": 4.1083, + "us-west-1": 4.7131, + "us-west-2": 4.1083 + }, + "m7gd.2xlarge": { + "ap-northeast-1": 0.6671, + "ap-south-1": 0.4162, + "ap-southeast-1": 0.6482, + "ap-southeast-2": 0.652, + "ap-southeast-5": 0.5954, + "ap-southeast-7": 0.5954, + "eu-central-1": 0.0, + "eu-north-1": 0.5688, + "eu-south-2": 0.5915, + "eu-west-1": 0.5915, + "eu-west-3": 0.6142, + "mx-central-1": 0.5906, + "sa-east-1": 0.7956, + "us-east-1": 0.5423, + "us-east-2": 0.5423, + "us-west-1": 0.6179, + "us-west-2": 0.5423 + }, + "m7gd.4xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.7408, + "ap-southeast-1": 1.3027, + "ap-southeast-2": 1.2463, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.0789, + "eu-central-1": 1.201, + "eu-north-1": 0.0, + "eu-south-2": 1.1254, + "eu-west-1": 1.1254, + "eu-west-3": 1.1707, + "mx-central-1": 0.0, + "sa-east-1": 1.5336, + "us-east-1": 1.0271, + "us-east-2": 1.0271, + "us-west-1": 1.2386, + "us-west-2": 1.0271 + }, + "m7gd.8xlarge": { + "ap-northeast-1": 2.6856, + "ap-south-1": 1.4816, + "ap-southeast-1": 2.4775, + "ap-southeast-2": 2.4926, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.1578, + "eu-central-1": 2.4019, + "eu-north-1": 2.16, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-3": 2.3414, + "mx-central-1": 2.1395, + "sa-east-1": 3.0672, + "us-east-1": 2.0542, + "us-east-2": 0.0, + "us-west-1": 0.0, + "us-west-2": 2.0542 + }, + "m7gd.12xlarge": { + "ap-northeast-1": 3.8297, + "ap-south-1": 2.2224, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.739, + "ap-southeast-5": 3.2366, + "ap-southeast-7": 3.2366, + "eu-central-1": 3.6029, + "eu-north-1": 3.24, + "eu-south-2": 3.3761, + "eu-west-1": 3.3761, + "eu-west-3": 3.5122, + "mx-central-1": 3.2093, + "sa-east-1": 4.6008, + "us-east-1": 3.0812, + "us-east-2": 3.235, + "us-west-1": 3.7158, + "us-west-2": 3.0812 + }, + "m7gd.16xlarge": { + "ap-northeast-1": 5.1062, + "ap-south-1": 2.9632, + "ap-southeast-1": 4.955, + "ap-southeast-2": 4.9853, + "ap-southeast-5": 4.3155, + "ap-southeast-7": 0.0, + "eu-central-1": 4.8038, + "eu-north-1": 4.32, + "eu-south-2": 4.5014, + "eu-west-1": 4.5014, + "eu-west-3": 4.6829, + "mx-central-1": 0.0, + "sa-east-1": 6.1344, + "us-east-1": 4.1083, + "us-east-2": 0.0, + "us-west-1": 4.7131, + "us-west-2": 4.1083 + }, + "m7i.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 0.14546, + "ap-southeast-1": 0.1548, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1548, + "ap-southeast-5": 0.1359, + "ap-southeast-7": 0.0, + "ca-central-1": 0.15239, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.14115, + "eu-west-1": 0.14115, + "eu-west-2": 0.14535, + "eu-west-3": 0.0, + "mx-central-1": 0.14522, + "sa-east-1": 0.0, + "us-east-1": 0.1296, + "us-east-2": 0.13968, + "us-gov-east-1": 0.15585, + "us-gov-west-1": 0.15585, + "us-west-1": 0.1464, + "us-west-2": 0.1296 + }, + "m7i.xlarge": { + "ap-northeast-1": 0.318, + "ap-northeast-2": 0.3054, + "ap-south-1": 0.29091, + "ap-southeast-1": 0.3348, + "ap-southeast-2": 0.3096, + "ap-southeast-3": 0.3096, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.29322, + "ca-central-1": 0.2823, + "eu-central-1": 0.0, + "eu-north-1": 0.2718, + "eu-south-2": 0.30477, + "eu-west-1": 0.2823, + "eu-west-2": 0.31401, + "eu-west-3": 0.2928, + "mx-central-1": 0.26928, + "sa-east-1": 0.3789, + "us-east-1": 0.2592, + "us-east-2": 0.0, + "us-gov-east-1": 0.3117, + "us-gov-west-1": 0.3117, + "us-west-1": 0.2928, + "us-west-2": 0.0 + }, + "m7i.metal-24xl": { + "ap-northeast-1": 7.91136, + "ap-northeast-2": 0.0, + "ap-south-1": 6.1272, + "ap-southeast-1": 7.6896, + "ap-southeast-2": 0.0, + "ap-southeast-3": 7.0848, + "ap-southeast-5": 6.1776, + "ap-southeast-7": 0.0, + "ca-central-1": 6.4296, + "eu-central-1": 0.0, + "eu-north-1": 6.1776, + "eu-south-2": 6.96888, + "eu-west-1": 6.4296, + "eu-west-2": 6.6312, + "eu-west-3": 7.24608, + "mx-central-1": 6.62515, + "sa-east-1": 9.51912, + "us-east-1": 5.8752, + "us-east-2": 5.8752, + "us-gov-east-1": 7.1352, + "us-gov-west-1": 0.0, + "us-west-1": 6.6816, + "us-west-2": 5.8752 + }, + "m7i.metal-48xl": { + "ap-northeast-1": 14.3424, + "ap-northeast-2": 13.7376, + "ap-south-1": 12.024, + "ap-southeast-1": 13.9392, + "ap-southeast-2": 13.9392, + "ap-southeast-3": 13.9392, + "ap-southeast-5": 12.1248, + "ap-southeast-7": 12.1248, + "ca-central-1": 0.0, + "eu-central-1": 13.4352, + "eu-north-1": 12.1248, + "eu-south-2": 0.0, + "eu-west-1": 12.6288, + "eu-west-2": 13.032, + "eu-west-3": 13.1328, + "mx-central-1": 12.00384, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 14.04, + "us-gov-west-1": 0.0, + "us-west-1": 13.1328, + "us-west-2": 11.52 + }, + "m7i.2xlarge": { + "ap-northeast-1": 0.68808, + "ap-northeast-2": 0.6108, + "ap-south-1": 0.5394, + "ap-southeast-1": 0.6696, + "ap-southeast-2": 0.6192, + "ap-southeast-3": 0.6192, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.5436, + "ca-central-1": 0.5646, + "eu-central-1": 0.5982, + "eu-north-1": 0.5436, + "eu-south-2": 0.60954, + "eu-west-1": 0.5646, + "eu-west-2": 0.5814, + "eu-west-3": 0.5856, + "mx-central-1": 0.53856, + "sa-east-1": 0.7578, + "us-east-1": 0.5184, + "us-east-2": 0.5184, + "us-gov-east-1": 0.6234, + "us-gov-west-1": 0.6234, + "us-west-1": 0.5856, + "us-west-2": 0.5184 + }, + "m7i.4xlarge": { + "ap-northeast-1": 1.31856, + "ap-northeast-2": 1.164, + "ap-south-1": 1.10604, + "ap-southeast-1": 1.1808, + "ap-southeast-2": 1.1808, + "ap-southeast-3": 1.1808, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.0296, + "ca-central-1": 1.0716, + "eu-central-1": 1.1388, + "eu-north-1": 1.0296, + "eu-south-2": 1.0716, + "eu-west-1": 1.0716, + "eu-west-2": 1.1052, + "eu-west-3": 1.20768, + "mx-central-1": 1.01952, + "sa-east-1": 1.58652, + "us-east-1": 0.9792, + "us-east-2": 1.05984, + "us-gov-east-1": 1.29084, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.9792 + }, + "m7i.8xlarge": { + "ap-northeast-1": 2.4288, + "ap-northeast-2": 2.328, + "ap-south-1": 2.21208, + "ap-southeast-1": 2.5632, + "ap-southeast-2": 2.5632, + "ap-southeast-3": 2.5632, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.0592, + "ca-central-1": 2.1432, + "eu-central-1": 2.2776, + "eu-north-1": 2.23056, + "eu-south-2": 2.1432, + "eu-west-1": 0.0, + "eu-west-2": 2.39688, + "eu-west-3": 2.2272, + "mx-central-1": 2.03904, + "sa-east-1": 3.17304, + "us-east-1": 1.9584, + "us-east-2": 0.0, + "us-gov-east-1": 2.3784, + "us-gov-west-1": 2.3784, + "us-west-1": 2.2272, + "us-west-2": 1.9584 + }, + "m7i.12xlarge": { + "ap-northeast-1": 3.6432, + "ap-northeast-2": 3.492, + "ap-south-1": 3.0636, + "ap-southeast-1": 3.5424, + "ap-southeast-2": 3.8448, + "ap-southeast-3": 0.0, + "ap-southeast-5": 3.0888, + "ap-southeast-7": 3.0888, + "ca-central-1": 3.2148, + "eu-central-1": 3.4164, + "eu-north-1": 3.34584, + "eu-south-2": 3.2148, + "eu-west-1": 3.48444, + "eu-west-2": 3.3156, + "eu-west-3": 3.3408, + "mx-central-1": 3.05856, + "sa-east-1": 0.0, + "us-east-1": 2.9376, + "us-east-2": 2.9376, + "us-gov-east-1": 3.87252, + "us-gov-west-1": 0.0, + "us-west-1": 3.3408, + "us-west-2": 2.9376 + }, + "m7i.16xlarge": { + "ap-northeast-1": 5.27424, + "ap-northeast-2": 4.656, + "ap-south-1": 4.42416, + "ap-southeast-1": 4.7232, + "ap-southeast-2": 4.7232, + "ap-southeast-3": 0.0, + "ap-southeast-5": 4.46112, + "ap-southeast-7": 4.1184, + "ca-central-1": 0.0, + "eu-central-1": 4.9416, + "eu-north-1": 4.1184, + "eu-south-2": 4.64592, + "eu-west-1": 4.2864, + "eu-west-2": 4.79376, + "eu-west-3": 0.0, + "mx-central-1": 4.07808, + "sa-east-1": 5.832, + "us-east-1": 3.9168, + "us-east-2": 0.0, + "us-gov-east-1": 4.7568, + "us-gov-west-1": 4.7568, + "us-west-1": 4.4544, + "us-west-2": 3.9168 + }, + "m7i.24xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 6.984, + "ap-south-1": 6.1272, + "ap-southeast-1": 7.0848, + "ap-southeast-2": 7.0848, + "ap-southeast-3": 7.6896, + "ap-southeast-5": 6.1776, + "ap-southeast-7": 6.1776, + "ca-central-1": 6.4296, + "eu-central-1": 0.0, + "eu-north-1": 6.1776, + "eu-south-2": 0.0, + "eu-west-1": 6.4296, + "eu-west-2": 6.6312, + "eu-west-3": 6.6816, + "mx-central-1": 6.11712, + "sa-east-1": 8.748, + "us-east-1": 6.35904, + "us-east-2": 5.8752, + "us-gov-east-1": 7.1352, + "us-gov-west-1": 7.1352, + "us-west-1": 6.6816, + "us-west-2": 6.35904 + }, + "m7i.48xlarge": { + "ap-northeast-1": 14.3424, + "ap-northeast-2": 13.7376, + "ap-south-1": 12.024, + "ap-southeast-1": 13.9392, + "ap-southeast-2": 13.9392, + "ap-southeast-3": 0.0, + "ap-southeast-5": 12.1248, + "ap-southeast-7": 12.1248, + "ca-central-1": 12.6288, + "eu-central-1": 13.4352, + "eu-north-1": 0.0, + "eu-south-2": 12.6288, + "eu-west-1": 0.0, + "eu-west-2": 13.032, + "eu-west-3": 13.1328, + "mx-central-1": 12.00384, + "sa-east-1": 17.2656, + "us-east-1": 11.52, + "us-east-2": 11.52, + "us-gov-east-1": 14.04, + "us-gov-west-1": 14.04, + "us-west-1": 13.1328, + "us-west-2": 0.0 + }, + "m7i-flex.large": { + "ap-northeast-1": 0.15249, + "ap-northeast-2": 0.14651, + "ap-south-1": 0.12955, + "ap-southeast-1": 0.1485, + "ap-southeast-2": 0.1485, + "ap-southeast-3": 0.1485, + "ap-southeast-5": 0.13055, + "ca-central-1": 0.13553, + "eu-central-1": 0.14351, + "eu-north-1": 0.13055, + "eu-south-2": 0.13553, + "eu-west-1": 0.13553, + "eu-west-2": 0.13952, + "eu-west-3": 0.14052, + "sa-east-1": 0.18142, + "us-east-1": 0.12456, + "us-east-2": 0.12456, + "us-gov-east-1": 0.1495, + "us-gov-west-1": 0.1495, + "us-west-1": 0.14052, + "us-west-2": 0.12456 + }, + "m7i-flex.xlarge": { + "ap-northeast-1": 0.30498, + "ap-northeast-2": 0.29302, + "ap-south-1": 0.2591, + "ap-southeast-1": 0.297, + "ap-southeast-2": 0.297, + "ap-southeast-3": 0.297, + "ap-southeast-5": 0.26109, + "ca-central-1": 0.27106, + "eu-central-1": 0.28702, + "eu-north-1": 0.2611, + "eu-south-2": 0.27106, + "eu-west-1": 0.27106, + "eu-west-2": 0.27904, + "eu-west-3": 0.28104, + "sa-east-1": 0.36284, + "us-east-1": 0.24912, + "us-east-2": 0.24912, + "us-gov-east-1": 0.299, + "us-gov-west-1": 0.299, + "us-west-1": 0.28104, + "us-west-2": 0.24912 + }, + "m7i-flex.2xlarge": { + "ap-northeast-1": 0.60996, + "ap-northeast-2": 0.58604, + "ap-south-1": 0.5182, + "ap-southeast-1": 0.594, + "ap-southeast-2": 0.594, + "ap-southeast-3": 0.594, + "ap-southeast-5": 0.52218, + "ca-central-1": 0.54212, + "eu-central-1": 0.57404, + "eu-north-1": 0.5222, + "eu-south-2": 0.54212, + "eu-west-1": 0.54212, + "eu-west-2": 0.55808, + "eu-west-3": 0.56208, + "sa-east-1": 0.72568, + "us-east-1": 0.49824, + "us-east-2": 0.49824, + "us-gov-east-1": 0.598, + "us-gov-west-1": 0.598, + "us-west-1": 0.56208, + "us-west-2": 0.49824 + }, + "m7i-flex.4xlarge": { + "ap-northeast-1": 1.16232, + "ap-northeast-2": 1.11448, + "ap-south-1": 0.9788, + "ap-southeast-1": 1.1304, + "ap-southeast-2": 1.1304, + "ap-southeast-3": 1.1304, + "ap-southeast-5": 0.98676, + "ca-central-1": 1.02664, + "eu-central-1": 1.09048, + "eu-north-1": 0.9868, + "eu-south-2": 1.02664, + "eu-west-1": 1.02664, + "eu-west-2": 1.05856, + "eu-west-3": 1.06656, + "sa-east-1": 1.39376, + "us-east-1": 0.93888, + "us-east-2": 0.93888, + "us-gov-east-1": 1.1384, + "us-gov-west-1": 1.1384, + "us-west-1": 1.06656, + "us-west-2": 0.93888 + }, + "m7i-flex.8xlarge": { + "ap-northeast-1": 2.32464, + "ap-northeast-2": 2.22896, + "ap-south-1": 1.9576, + "ap-southeast-1": 2.2608, + "ap-southeast-2": 2.2608, + "ap-southeast-3": 2.2608, + "ap-southeast-5": 1.97352, + "ca-central-1": 2.05328, + "eu-central-1": 2.18096, + "eu-north-1": 1.9736, + "eu-south-2": 2.05328, + "eu-west-1": 2.05328, + "eu-west-2": 2.11712, + "eu-west-3": 2.13312, + "sa-east-1": 2.78752, + "us-east-1": 1.87776, + "us-east-2": 1.87776, + "us-gov-east-1": 2.2768, + "us-gov-west-1": 2.2768, + "us-west-1": 2.13312, + "us-west-2": 1.87776 + }, + "m7i-flex.12xlarge": { + "ap-northeast-1": 3.48696, + "ap-south-1": 2.9364, + "ap-southeast-1": 3.3912, + "ap-southeast-2": 3.3912, + "ap-southeast-5": 2.96028, + "ca-central-1": 3.07992, + "eu-central-1": 3.27144, + "eu-north-1": 2.9604, + "eu-south-2": 3.07992, + "eu-west-1": 3.07992, + "eu-west-3": 3.19968, + "sa-east-1": 4.18128, + "us-east-1": 2.81664, + "us-east-2": 2.81664, + "us-gov-east-1": 3.4152, + "us-gov-west-1": 3.4152, + "us-west-1": 3.19968, + "us-west-2": 2.81664 + }, + "m7i-flex.16xlarge": { + "ap-northeast-1": 4.64928, + "ap-south-1": 3.9152, + "ap-southeast-1": 4.5216, + "ap-southeast-2": 4.5216, + "ap-southeast-5": 3.94704, + "ca-central-1": 4.10656, + "eu-central-1": 4.36192, + "eu-north-1": 3.9472, + "eu-south-2": 4.10656, + "eu-west-1": 4.10656, + "eu-west-3": 4.26624, + "sa-east-1": 5.57504, + "us-east-1": 3.75552, + "us-east-2": 3.75552, + "us-gov-east-1": 4.5536, + "us-gov-west-1": 4.5536, + "us-west-1": 4.26624, + "us-west-2": 3.75552 + }, + "m8g.medium": { + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-2": 0.0663, + "us-east-1": 0.0, + "us-east-2": 0.05928, + "us-west-2": 0.06377 + }, + "m8g.large": { + "eu-central-1": 0.0, + "eu-north-1": 0.12418, + "eu-south-2": 0.0, + "eu-west-2": 0.1326, + "us-east-1": 0.11856, + "us-east-2": 0.11856, + "us-west-2": 0.0 + }, + "m8g.xlarge": { + "eu-central-1": 0.27268, + "eu-north-1": 0.0, + "eu-south-2": 0.27756, + "eu-west-2": 0.2652, + "us-east-1": 0.25507, + "us-east-2": 0.23712, + "us-west-2": 0.23712 + }, + "m8g.metal-24xl": { + "eu-central-1": 6.19872, + "eu-north-1": 6.07286, + "eu-south-2": 0.0, + "eu-west-2": 6.0192, + "us-east-1": 0.0, + "us-east-2": 5.77613, + "us-west-2": 5.34528 + }, + "m8g.metal-48xl": { + "eu-central-1": 12.16704, + "eu-north-1": 10.99968, + "eu-south-2": 0.0, + "eu-west-2": 11.808, + "us-east-1": 10.46016, + "us-east-2": 0.0, + "us-west-2": 10.46016 + }, + "m8g.2xlarge": { + "eu-central-1": 0.54536, + "eu-north-1": 0.49672, + "eu-south-2": 0.51512, + "eu-west-2": 0.57192, + "us-east-1": 0.47424, + "us-east-2": 0.47424, + "us-west-2": 0.0 + }, + "m8g.4xlarge": { + "eu-central-1": 1.11915, + "eu-north-1": 0.93584, + "eu-south-2": 1.05262, + "eu-west-2": 1.0032, + "us-east-1": 0.96269, + "us-east-2": 0.96269, + "us-west-2": 0.96269 + }, + "m8g.8xlarge": { + "eu-central-1": 2.06624, + "eu-north-1": 0.0, + "eu-south-2": 1.94528, + "eu-west-2": 2.17248, + "us-east-1": 1.78176, + "us-east-2": 1.78176, + "us-west-2": 1.78176 + }, + "m8g.12xlarge": { + "eu-central-1": 3.09936, + "eu-north-1": 3.03643, + "eu-south-2": 2.91792, + "eu-west-2": 3.0096, + "us-east-1": 0.0, + "us-east-2": 2.67264, + "us-west-2": 2.67264 + }, + "m8g.16xlarge": { + "eu-central-1": 4.13248, + "eu-north-1": 3.74336, + "eu-south-2": 3.89056, + "eu-west-2": 4.0128, + "us-east-1": 3.85075, + "us-east-2": 0.0, + "us-west-2": 3.56352 + }, + "m8g.24xlarge": { + "eu-central-1": 6.71491, + "eu-north-1": 6.07286, + "eu-south-2": 5.83584, + "eu-west-2": 6.0192, + "us-east-1": 0.0, + "us-east-2": 5.34528, + "us-west-2": 5.34528 + }, + "m8g.48xlarge": { + "eu-central-1": 12.16704, + "eu-north-1": 10.99968, + "eu-south-2": 11.44128, + "eu-west-2": 11.808, + "us-east-1": 0.0, + "us-east-2": 10.46016, + "us-west-2": 10.46016 + }, + "p2.xlarge": { + "ap-northeast-1": 1.6, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 1.947, + "ap-southeast-2": 1.6, + "eu-central-1": 1.384, + "eu-west-1": 1.03, + "us-east-1": 0.958, + "us-east-2": 0.0, + "us-gov-west-1": 1.138, + "us-west-2": 0.0 + }, + "p2.8xlarge": { + "ap-northeast-1": 12.682, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 15.464, + "ap-southeast-2": 12.682, + "eu-central-1": 10.954, + "eu-west-1": 0.0, + "us-east-1": 8.266, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 7.546 + }, + "p2.16xlarge": { + "ap-northeast-1": 25.363, + "ap-northeast-2": 24.131, + "ap-south-1": 28.179, + "ap-southeast-1": 28.179, + "ap-southeast-2": 25.363, + "eu-central-1": 0.0, + "eu-west-1": 16.243, + "us-east-1": 15.091, + "us-east-2": 15.091, + "us-gov-west-1": 17.971, + "us-west-2": 15.091 + }, + "p3.2xlarge": { + "ap-northeast-1": 4.309, + "ap-northeast-2": 4.349, + "ap-southeast-1": 4.349, + "ap-southeast-2": 0.0, + "ca-central-1": 3.481, + "eu-central-1": 0.0, + "eu-west-1": 3.42, + "eu-west-2": 3.704, + "us-east-1": 3.374, + "us-east-2": 3.175, + "us-gov-west-1": 3.787, + "us-west-2": 3.175 + }, + "p3.8xlarge": { + "ap-northeast-1": 17.122, + "ap-northeast-2": 17.282, + "ap-southeast-1": 0.0, + "ap-southeast-2": 17.282, + "ca-central-1": 0.0, + "eu-central-1": 15.638, + "eu-west-1": 13.566, + "eu-west-2": 0.0, + "us-east-1": 12.586, + "us-east-2": 12.586, + "us-gov-west-1": 15.034, + "us-west-2": 0.0 + }, + "p3.16xlarge": { + "ap-northeast-1": 34.243, + "ap-northeast-2": 0.0, + "ap-southeast-1": 34.563, + "ap-southeast-2": 34.563, + "ca-central-1": 0.0, + "eu-central-1": 31.275, + "eu-west-1": 27.131, + "eu-west-2": 29.403, + "us-east-1": 25.171, + "us-east-2": 25.171, + "us-gov-west-1": 0.0, + "us-west-2": 25.171 + }, + "p3dn.24xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 32.249, + "us-gov-east-1": 38.491, + "us-gov-west-1": 38.491, + "us-west-2": 0.0 + }, + "p4d.24xlarge": { + "ap-northeast-1": 45.95895, + "ap-northeast-2": 0.0, + "ap-south-1": 40.3568, + "ap-southeast-1": 0.0, + "ap-southeast-2": 43.64118, + "ca-central-1": 0.0, + "eu-central-1": 41.98155, + "eu-west-1": 0.0, + "sa-east-1": 59.4138, + "us-east-1": 1.0368, + "us-east-2": 0.0, + "us-gov-west-1": 40.3668, + "us-west-2": 33.8094 + }, + "p4de.24xlarge": { + "ap-southeast-1": 0.0, + "eu-central-1": 57.36483, + "il-central-1": 59.440992, + "us-east-1": 42.00255, + "us-west-2": 46.099125 + }, + "p5.48xlarge": { + "ap-northeast-1": 125.03816, + "ap-south-1": 119.8272, + "ap-southeast-2": 129.6592, + "ca-central-1": 114.9112, + "eu-north-1": 107.0456, + "eu-west-2": 129.6592, + "sa-east-1": 167.0208, + "us-east-1": 1.8432, + "us-east-2": 100.1632, + "us-gov-west-1": 119.8272, + "us-west-1": 124.7432, + "us-west-2": 1.8432 + }, + "p5e.48xlarge": { + "us-east-2": 1.8432 + }, + "p5en.48xlarge": { + "ap-northeast-1": 107.8432, + "ap-northeast-2": 118.8672, + "ap-south-1": 1.8432, + "eu-south-2": 93.4272, + "us-east-2": 86.6432, + "us-west-2": 86.6432 + }, + "r3.large": { + "ap-northeast-1": 0.229, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.229, + "eu-central-1": 0.249, + "eu-west-1": 0.214, + "sa-east-1": 0.414, + "us-east-1": 0.195, + "us-east-2": 0.195, + "us-gov-west-1": 0.229, + "us-west-1": 0.232, + "us-west-2": 0.195 + }, + "r3.xlarge": { + "ap-northeast-1": 0.458, + "ap-northeast-2": 0.458, + "ap-south-1": 0.438, + "ap-southeast-1": 0.458, + "ap-southeast-2": 0.458, + "eu-central-1": 0.498, + "eu-west-1": 0.465, + "sa-east-1": 0.828, + "us-east-1": 0.423, + "us-east-2": 0.423, + "us-gov-west-1": 0.458, + "us-west-1": 0.428, + "us-west-2": 0.39 + }, + "r3.2xlarge": { + "ap-northeast-1": 0.915, + "ap-northeast-2": 0.915, + "ap-south-1": 0.875, + "ap-southeast-1": 0.915, + "ap-southeast-2": 0.995, + "eu-central-1": 0.995, + "eu-west-1": 0.929, + "sa-east-1": 1.515, + "us-east-1": 0.779, + "us-east-2": 0.0, + "us-gov-west-1": 0.915, + "us-west-1": 0.929, + "us-west-2": 0.846 + }, + "r3.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.773, + "ap-south-1": 0.0, + "ap-southeast-1": 1.773, + "ap-southeast-2": 0.0, + "eu-central-1": 1.773, + "eu-west-1": 0.0, + "sa-east-1": 2.973, + "us-east-1": 1.501, + "us-east-2": 1.634, + "us-gov-west-1": 1.773, + "us-west-1": 1.801, + "us-west-2": 1.501 + }, + "r3.8xlarge": { + "ap-northeast-1": 3.546, + "ap-northeast-2": 3.546, + "ap-south-1": 3.386, + "ap-southeast-1": 3.546, + "ap-southeast-2": 3.546, + "eu-central-1": 0.0, + "eu-west-1": 3.306, + "sa-east-1": 5.946, + "us-east-1": 3.002, + "us-east-2": 3.002, + "us-gov-west-1": 3.546, + "us-west-1": 3.306, + "us-west-2": 3.002 + }, + "r4.large": { + "ap-northeast-1": 0.1888, + "ap-northeast-2": 0.1888, + "ap-northeast-3": 0.2048, + "ap-south-1": 0.1658, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1888, + "ca-central-1": 0.1748, + "eu-central-1": 0.1888, + "eu-west-1": 0.1916, + "eu-west-2": 0.1848, + "eu-west-3": 0.1848, + "sa-east-1": 0.0, + "us-east-1": 0.1618, + "us-east-2": 0.1618, + "us-gov-west-1": 0.2048, + "us-west-1": 0.1768, + "us-west-2": 0.0 + }, + "r4.xlarge": { + "ap-northeast-1": 0.3776, + "ap-northeast-2": 0.3776, + "ap-northeast-3": 0.4096, + "ap-south-1": 0.3316, + "ap-southeast-1": 0.3776, + "ap-southeast-2": 0.3776, + "ca-central-1": 0.0, + "eu-central-1": 0.3776, + "eu-west-1": 0.3536, + "eu-west-2": 0.3696, + "eu-west-3": 0.0, + "sa-east-1": 0.6176, + "us-east-1": 0.3236, + "us-east-2": 0.0, + "us-gov-west-1": 0.3776, + "us-west-1": 0.3536, + "us-west-2": 0.0 + }, + "r4.2xlarge": { + "ap-northeast-1": 0.8192, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.8192, + "ap-south-1": 0.6632, + "ap-southeast-1": 0.7552, + "ap-southeast-2": 0.7552, + "ca-central-1": 0.7576, + "eu-central-1": 0.7552, + "eu-west-1": 0.7072, + "eu-west-2": 0.7392, + "eu-west-3": 0.8016, + "sa-east-1": 1.3472, + "us-east-1": 0.0, + "us-east-2": 0.6472, + "us-gov-west-1": 0.8192, + "us-west-1": 0.0, + "us-west-2": 0.6472 + }, + "r4.4xlarge": { + "ap-northeast-1": 1.5808, + "ap-northeast-2": 1.4528, + "ap-northeast-3": 1.5808, + "ap-south-1": 1.2688, + "ap-southeast-1": 1.4528, + "ap-southeast-2": 1.5808, + "ca-central-1": 1.4576, + "eu-central-1": 1.4528, + "eu-west-1": 1.3568, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 1.2368, + "us-gov-west-1": 1.4528, + "us-west-1": 0.0, + "us-west-2": 1.2368 + }, + "r4.8xlarge": { + "ap-northeast-1": 3.1616, + "ap-northeast-2": 3.1616, + "ap-northeast-3": 2.9056, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 2.6816, + "eu-central-1": 2.9056, + "eu-west-1": 2.9504, + "eu-west-2": 3.0912, + "eu-west-3": 3.0912, + "sa-east-1": 0.0, + "us-east-1": 2.6864, + "us-east-2": 2.4736, + "us-gov-west-1": 3.1616, + "us-west-1": 0.0, + "us-west-2": 2.6864 + }, + "r4.16xlarge": { + "ap-northeast-1": 5.8112, + "ap-northeast-2": 5.8112, + "ap-northeast-3": 5.8112, + "ap-south-1": 5.0752, + "ap-southeast-1": 5.8112, + "ap-southeast-2": 0.0, + "ca-central-1": 5.3632, + "eu-central-1": 5.8112, + "eu-west-1": 5.4272, + "eu-west-2": 5.6832, + "eu-west-3": 0.0, + "sa-east-1": 9.6512, + "us-east-1": 4.9472, + "us-east-2": 4.9472, + "us-gov-west-1": 5.8112, + "us-west-1": 5.4272, + "us-west-2": 4.9472 + }, + "r5.large": { + "af-south-1": 0.207, + "ap-east-1": 0.196, + "ap-northeast-1": 0.181, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.19, + "ap-south-1": 0.159, + "ap-south-2": 0.0, + "ap-southeast-1": 0.181, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.19, + "ap-southeast-4": 0.18, + "ca-central-1": 0.175, + "ca-west-1": 0.175, + "eu-central-1": 0.181, + "eu-central-2": 0.206, + "eu-north-1": 0.163, + "eu-south-1": 0.0, + "eu-south-2": 0.17, + "eu-west-1": 0.17, + "eu-west-2": 0.177, + "eu-west-3": 0.177, + "il-central-1": 0.177, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.162, + "us-gov-east-1": 0.189, + "us-gov-west-1": 0.18, + "us-west-1": 0.169, + "us-west-2": 0.155, + "us-west-2-lax-1": 0.18 + }, + "r5.xlarge": { + "af-south-1": 0.394, + "ap-east-1": 0.412, + "ap-northeast-1": 0.38, + "ap-northeast-2": 0.362, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.38, + "ap-southeast-2": 0.36, + "ap-southeast-3": 0.362, + "ap-southeast-4": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.334, + "eu-central-1": 0.38, + "eu-central-2": 0.412, + "eu-north-1": 0.342, + "eu-south-1": 0.354, + "eu-south-2": 0.34, + "eu-west-1": 0.34, + "eu-west-2": 0.371, + "eu-west-3": 0.354, + "il-central-1": 0.354, + "me-central-1": 0.368, + "me-south-1": 0.368, + "sa-east-1": 0.46, + "us-east-1": 0.325, + "us-east-2": 0.31, + "us-gov-east-1": 0.36, + "us-gov-west-1": 0.36, + "us-west-1": 0.338, + "us-west-2": 0.31, + "us-west-2-lax-1": 0.0 + }, + "r5.metal": { + "af-south-1": 0.0, + "ap-east-1": 9.053, + "ap-northeast-1": 8.333, + "ap-northeast-2": 0.0, + "ap-northeast-3": 8.333, + "ap-south-1": 7.277, + "ap-south-2": 7.277, + "ap-southeast-1": 8.333, + "ap-southeast-2": 0.0, + "ap-southeast-3": 8.333, + "ap-southeast-4": 8.285, + "ca-central-1": 7.661, + "ca-west-1": 7.661, + "eu-central-1": 8.333, + "eu-central-2": 9.062, + "eu-north-1": 7.469, + "eu-south-1": 8.141, + "eu-south-2": 7.805, + "eu-west-1": 7.805, + "eu-west-2": 8.141, + "eu-west-3": 0.0, + "il-central-1": 8.143, + "me-central-1": 0.0, + "me-south-1": 8.482, + "sa-east-1": 10.685, + "us-east-1": 7.085, + "us-east-2": 0.0, + "us-gov-east-1": 8.285, + "us-gov-west-1": 8.285, + "us-west-1": 7.757, + "us-west-2": 7.085, + "us-west-2-lax-1": 0.0 + }, + "r5.2xlarge": { + "af-south-1": 0.787, + "ap-east-1": 0.823, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.723, + "ap-northeast-3": 0.0, + "ap-south-1": 0.635, + "ap-south-2": 0.0, + "ap-southeast-1": 0.723, + "ap-southeast-2": 0.719, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.719, + "ca-central-1": 0.0, + "ca-west-1": 0.667, + "eu-central-1": 0.723, + "eu-central-2": 0.784, + "eu-north-1": 0.683, + "eu-south-1": 0.707, + "eu-south-2": 0.679, + "eu-west-1": 0.713, + "eu-west-2": 0.707, + "eu-west-3": 0.707, + "il-central-1": 0.707, + "me-central-1": 0.736, + "me-south-1": 0.736, + "sa-east-1": 0.919, + "us-east-1": 0.619, + "us-east-2": 0.0, + "us-gov-east-1": 0.755, + "us-gov-west-1": 0.0, + "us-west-1": 0.675, + "us-west-2": 0.649, + "us-west-2-lax-1": 0.72 + }, + "r5.4xlarge": { + "af-south-1": 1.517, + "ap-east-1": 1.589, + "ap-northeast-1": 1.389, + "ap-northeast-2": 1.389, + "ap-northeast-3": 1.389, + "ap-south-1": 1.213, + "ap-south-2": 1.213, + "ap-southeast-1": 1.462, + "ap-southeast-2": 1.453, + "ap-southeast-3": 1.389, + "ap-southeast-4": 1.381, + "ca-central-1": 1.277, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 1.51, + "eu-north-1": 0.0, + "eu-south-1": 1.357, + "eu-south-2": 1.368, + "eu-west-1": 1.368, + "eu-west-2": 0.0, + "eu-west-3": 1.357, + "il-central-1": 1.357, + "me-central-1": 1.414, + "me-south-1": 1.414, + "sa-east-1": 1.781, + "us-east-1": 1.181, + "us-east-2": 1.241, + "us-gov-east-1": 1.381, + "us-gov-west-1": 1.381, + "us-west-1": 1.293, + "us-west-2": 0.0, + "us-west-2-lax-1": 1.382 + }, + "r5.8xlarge": { + "af-south-1": 3.034, + "ap-east-1": 3.018, + "ap-northeast-1": 2.778, + "ap-northeast-2": 2.778, + "ap-northeast-3": 2.778, + "ap-south-1": 0.0, + "ap-south-2": 2.426, + "ap-southeast-1": 2.778, + "ap-southeast-2": 2.762, + "ap-southeast-3": 2.924, + "ap-southeast-4": 2.762, + "ca-central-1": 2.554, + "ca-west-1": 2.554, + "eu-central-1": 0.0, + "eu-central-2": 3.021, + "eu-north-1": 2.49, + "eu-south-1": 0.0, + "eu-south-2": 2.737, + "eu-west-1": 2.602, + "eu-west-2": 2.714, + "eu-west-3": 2.714, + "il-central-1": 2.714, + "me-central-1": 2.827, + "me-south-1": 2.827, + "sa-east-1": 3.562, + "us-east-1": 2.483, + "us-east-2": 0.0, + "us-gov-east-1": 2.907, + "us-gov-west-1": 2.762, + "us-west-1": 2.586, + "us-west-2": 0.0, + "us-west-2-lax-1": 2.765 + }, + "r5.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.767, + "ap-northeast-1": 4.166, + "ap-northeast-2": 4.385, + "ap-northeast-3": 4.166, + "ap-south-1": 3.638, + "ap-south-2": 3.638, + "ap-southeast-1": 4.166, + "ap-southeast-2": 4.142, + "ap-southeast-3": 4.166, + "ap-southeast-4": 4.36, + "ca-central-1": 0.0, + "ca-west-1": 4.029, + "eu-central-1": 4.166, + "eu-central-2": 4.531, + "eu-north-1": 3.734, + "eu-south-1": 0.0, + "eu-south-2": 4.105, + "eu-west-1": 3.902, + "eu-west-2": 4.284, + "eu-west-3": 4.284, + "il-central-1": 4.072, + "me-central-1": 4.241, + "me-south-1": 4.241, + "sa-east-1": 5.342, + "us-east-1": 3.542, + "us-east-2": 3.542, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.142, + "us-west-1": 3.878, + "us-west-2": 3.542, + "us-west-2-lax-1": 4.147 + }, + "r5.16xlarge": { + "af-south-1": 6.067, + "ap-east-1": 6.356, + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.555, + "ap-northeast-3": 5.555, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 5.555, + "ap-southeast-2": 5.523, + "ap-southeast-3": 5.555, + "ap-southeast-4": 0.0, + "ca-central-1": 5.107, + "ca-west-1": 5.107, + "eu-central-1": 5.555, + "eu-central-2": 0.0, + "eu-north-1": 4.979, + "eu-south-1": 5.427, + "eu-south-2": 5.203, + "eu-west-1": 5.203, + "eu-west-2": 5.711, + "eu-west-3": 5.427, + "il-central-1": 5.429, + "me-central-1": 5.654, + "me-south-1": 5.952, + "sa-east-1": 7.123, + "us-east-1": 4.965, + "us-east-2": 4.965, + "us-gov-east-1": 5.813, + "us-gov-west-1": 0.0, + "us-west-1": 5.171, + "us-west-2": 4.723, + "us-west-2-lax-1": 0.0 + }, + "r5.24xlarge": { + "af-south-1": 9.101, + "ap-east-1": 9.053, + "ap-northeast-1": 8.333, + "ap-northeast-2": 8.333, + "ap-northeast-3": 0.0, + "ap-south-1": 7.277, + "ap-south-2": 7.277, + "ap-southeast-1": 8.333, + "ap-southeast-2": 8.285, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 7.661, + "ca-west-1": 7.661, + "eu-central-1": 8.333, + "eu-central-2": 9.062, + "eu-north-1": 7.469, + "eu-south-1": 8.141, + "eu-south-2": 7.805, + "eu-west-1": 7.805, + "eu-west-2": 0.0, + "eu-west-3": 8.141, + "il-central-1": 8.143, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 10.685, + "us-east-1": 7.085, + "us-east-2": 7.085, + "us-gov-east-1": 0.0, + "us-gov-west-1": 8.285, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 8.294 + }, + "r5a.large": { + "ap-northeast-1": 0.166, + "ap-northeast-2": 0.165, + "ap-south-1": 0.1, + "ap-southeast-1": 0.165, + "ap-southeast-2": 0.165, + "ca-central-1": 0.153, + "eu-central-1": 0.166, + "eu-south-1": 0.162, + "eu-west-1": 0.156, + "eu-west-2": 0.162, + "eu-west-3": 0.162, + "sa-east-1": 0.21, + "us-east-1": 0.142, + "us-east-2": 0.142, + "us-gov-east-1": 0.165, + "us-gov-west-1": 0.165, + "us-west-1": 0.155, + "us-west-2": 0.142 + }, + "r5a.xlarge": { + "ap-northeast-1": 0.332, + "ap-northeast-2": 0.33, + "ap-south-1": 0.201, + "ap-southeast-1": 0.33, + "ap-southeast-2": 0.33, + "ca-central-1": 0.306, + "eu-central-1": 0.332, + "eu-south-1": 0.324, + "eu-west-1": 0.312, + "eu-west-2": 0.324, + "eu-west-3": 0.324, + "sa-east-1": 0.42, + "us-east-1": 0.284, + "us-east-2": 0.284, + "us-gov-east-1": 0.33, + "us-gov-west-1": 0.33, + "us-west-1": 0.31, + "us-west-2": 0.284 + }, + "r5a.2xlarge": { + "ap-northeast-1": 0.663, + "ap-northeast-2": 0.659, + "ap-south-1": 0.401, + "ap-southeast-1": 0.659, + "ap-southeast-2": 0.659, + "ca-central-1": 0.611, + "eu-central-1": 0.663, + "eu-south-1": 0.647, + "eu-west-1": 0.623, + "eu-west-2": 0.647, + "eu-west-3": 0.647, + "sa-east-1": 0.839, + "us-east-1": 0.567, + "us-east-2": 0.567, + "us-gov-east-1": 0.659, + "us-gov-west-1": 0.659, + "us-west-1": 0.619, + "us-west-2": 0.567 + }, + "r5a.4xlarge": { + "ap-northeast-1": 1.269, + "ap-northeast-2": 1.261, + "ap-south-1": 0.745, + "ap-southeast-1": 1.261, + "ap-southeast-2": 1.261, + "ca-central-1": 1.165, + "eu-central-1": 1.269, + "eu-south-1": 1.237, + "eu-west-1": 1.189, + "eu-west-2": 1.237, + "eu-west-3": 1.237, + "sa-east-1": 1.621, + "us-east-1": 1.077, + "us-east-2": 1.077, + "us-gov-east-1": 1.261, + "us-gov-west-1": 1.261, + "us-west-1": 1.181, + "us-west-2": 1.077 + }, + "r5a.8xlarge": { + "ap-northeast-1": 2.538, + "ap-northeast-2": 2.522, + "ap-south-1": 1.49, + "ap-southeast-1": 2.522, + "ap-southeast-2": 2.522, + "ca-central-1": 2.33, + "eu-central-1": 2.538, + "eu-south-1": 2.474, + "eu-west-1": 2.378, + "eu-west-2": 2.474, + "eu-west-3": 2.474, + "sa-east-1": 3.242, + "us-east-1": 2.154, + "us-east-2": 2.154, + "us-gov-east-1": 2.522, + "us-gov-west-1": 2.522, + "us-west-1": 2.362, + "us-west-2": 2.154 + }, + "r5a.12xlarge": { + "ap-northeast-1": 3.806, + "ap-northeast-2": 3.782, + "ap-south-1": 2.234, + "ap-southeast-1": 3.782, + "ap-southeast-2": 3.782, + "ca-central-1": 3.494, + "eu-central-1": 3.806, + "eu-south-1": 3.71, + "eu-west-1": 3.566, + "eu-west-2": 3.71, + "eu-west-3": 3.71, + "sa-east-1": 4.862, + "us-east-1": 3.23, + "us-east-2": 3.23, + "us-gov-east-1": 3.782, + "us-gov-west-1": 3.782, + "us-west-1": 3.542, + "us-west-2": 3.23 + }, + "r5a.16xlarge": { + "ap-northeast-1": 5.075, + "ap-northeast-2": 5.043, + "ap-south-1": 2.979, + "ap-southeast-1": 5.043, + "ap-southeast-2": 5.043, + "ca-central-1": 4.659, + "eu-central-1": 5.075, + "eu-south-1": 4.947, + "eu-west-1": 4.755, + "eu-west-2": 4.947, + "eu-west-3": 4.947, + "sa-east-1": 6.483, + "us-east-1": 4.307, + "us-east-2": 4.307, + "us-gov-east-1": 5.043, + "us-gov-west-1": 5.043, + "us-west-1": 4.723, + "us-west-2": 4.307 + }, + "r5a.24xlarge": { + "ap-northeast-1": 7.613, + "ap-northeast-2": 7.565, + "ap-south-1": 4.469, + "ap-southeast-1": 7.565, + "ap-southeast-2": 7.565, + "ca-central-1": 6.989, + "eu-central-1": 7.613, + "eu-south-1": 7.421, + "eu-west-1": 7.133, + "eu-west-2": 7.421, + "eu-west-3": 7.421, + "sa-east-1": 9.725, + "us-east-1": 6.461, + "us-east-2": 6.461, + "us-gov-east-1": 7.565, + "us-gov-west-1": 7.565, + "us-west-1": 7.085, + "us-west-2": 6.461 + }, + "r5ad.large": { + "ap-northeast-1": 0.188, + "ap-northeast-2": 0.187, + "ap-south-1": 0.112, + "ap-southeast-1": 0.188, + "ap-southeast-2": 0.188, + "ca-central-1": 0.173, + "eu-central-1": 0.187, + "eu-west-1": 0.175, + "eu-west-2": 0.183, + "eu-west-3": 0.182, + "sa-east-1": 0.237, + "us-east-1": 0.16, + "us-east-2": 0.16, + "us-gov-west-1": 0.187, + "us-west-1": 0.177, + "us-west-2": 0.16 + }, + "r5ad.xlarge": { + "ap-northeast-1": 0.376, + "ap-northeast-2": 0.374, + "ap-south-1": 0.224, + "ap-southeast-1": 0.376, + "ap-southeast-2": 0.376, + "ca-central-1": 0.346, + "eu-central-1": 0.374, + "eu-west-1": 0.35, + "eu-west-2": 0.366, + "eu-west-3": 0.364, + "sa-east-1": 0.474, + "us-east-1": 0.32, + "us-east-2": 0.32, + "us-gov-west-1": 0.374, + "us-west-1": 0.354, + "us-west-2": 0.32 + }, + "r5ad.2xlarge": { + "ap-northeast-1": 0.751, + "ap-northeast-2": 0.747, + "ap-south-1": 0.447, + "ap-southeast-1": 0.751, + "ap-southeast-2": 0.751, + "ca-central-1": 0.691, + "eu-central-1": 0.747, + "eu-west-1": 0.699, + "eu-west-2": 0.731, + "eu-west-3": 0.727, + "sa-east-1": 0.947, + "us-east-1": 0.639, + "us-east-2": 0.639, + "us-gov-west-1": 0.747, + "us-west-1": 0.707, + "us-west-2": 0.639 + }, + "r5ad.4xlarge": { + "ap-northeast-1": 1.445, + "ap-northeast-2": 1.437, + "ap-south-1": 0.837, + "ap-southeast-1": 1.445, + "ap-southeast-2": 1.445, + "ca-central-1": 1.325, + "eu-central-1": 1.437, + "eu-west-1": 1.341, + "eu-west-2": 1.405, + "eu-west-3": 1.397, + "sa-east-1": 1.837, + "us-east-1": 1.221, + "us-east-2": 1.221, + "us-gov-west-1": 1.437, + "us-west-1": 1.357, + "us-west-2": 1.221 + }, + "r5ad.8xlarge": { + "ap-northeast-1": 2.89, + "ap-northeast-2": 2.874, + "ap-south-1": 1.674, + "ap-southeast-1": 2.89, + "ap-southeast-2": 2.89, + "ca-central-1": 2.65, + "eu-central-1": 2.874, + "eu-west-1": 2.682, + "eu-west-2": 2.81, + "eu-west-3": 2.794, + "sa-east-1": 3.674, + "us-east-1": 2.442, + "us-east-2": 2.442, + "us-gov-west-1": 2.874, + "us-west-1": 2.714, + "us-west-2": 2.442 + }, + "r5ad.12xlarge": { + "ap-northeast-1": 4.334, + "ap-northeast-2": 4.31, + "ap-south-1": 2.512, + "ap-southeast-1": 4.334, + "ap-southeast-2": 4.334, + "ca-central-1": 3.974, + "eu-central-1": 4.31, + "eu-west-1": 4.022, + "eu-west-2": 4.214, + "eu-west-3": 4.19, + "sa-east-1": 5.51, + "us-east-1": 3.662, + "us-east-2": 3.662, + "us-gov-west-1": 4.31, + "us-west-1": 4.07, + "us-west-2": 3.662 + }, + "r5ad.16xlarge": { + "ap-northeast-1": 5.779, + "ap-northeast-2": 5.747, + "ap-south-1": 3.349, + "ap-southeast-1": 5.779, + "ap-southeast-2": 5.779, + "ca-central-1": 5.299, + "eu-central-1": 5.747, + "eu-west-1": 5.363, + "eu-west-2": 5.619, + "eu-west-3": 5.587, + "sa-east-1": 7.347, + "us-east-1": 4.883, + "us-east-2": 4.883, + "us-gov-west-1": 5.747, + "us-west-1": 5.427, + "us-west-2": 4.883 + }, + "r5ad.24xlarge": { + "ap-northeast-1": 8.669, + "ap-northeast-2": 8.621, + "ap-south-1": 5.023, + "ap-southeast-1": 8.669, + "ap-southeast-2": 8.669, + "ca-central-1": 7.949, + "eu-central-1": 8.621, + "eu-west-1": 8.045, + "eu-west-2": 8.429, + "eu-west-3": 8.381, + "sa-east-1": 11.021, + "us-east-1": 7.325, + "us-east-2": 7.325, + "us-gov-west-1": 8.621, + "us-west-1": 8.141, + "us-west-2": 7.325 + }, + "r5b.large": { + "ap-northeast-1": 0.2098, + "ap-northeast-2": 0.2068, + "ap-southeast-1": 0.2068, + "ap-southeast-2": 0.2098, + "ca-central-1": 0.2081, + "eu-central-1": 0.2246, + "eu-north-1": 0.18674, + "eu-south-1": 0.2038, + "eu-west-1": 0.2125, + "eu-west-2": 0.2213, + "sa-east-1": 0.2658, + "us-east-1": 0.1927, + "us-east-2": 0.1778, + "us-west-2": 0.1778 + }, + "r5b.xlarge": { + "ap-northeast-1": 0.4196, + "ap-northeast-2": 0.4136, + "ap-southeast-1": 0.4136, + "ap-southeast-2": 0.4196, + "ca-central-1": 0.3836, + "eu-central-1": 0.0, + "eu-north-1": 0.37348, + "eu-south-1": 0.4076, + "eu-west-1": 0.425, + "eu-west-2": 0.4076, + "sa-east-1": 0.5316, + "us-east-1": 0.3556, + "us-east-2": 0.3556, + "us-west-2": 0.3556 + }, + "r5b.metal": { + "ap-northeast-1": 9.7248, + "ap-northeast-2": 0.0, + "ap-southeast-1": 10.4352, + "ap-southeast-2": 9.7248, + "ca-central-1": 8.8608, + "eu-central-1": 9.5808, + "eu-north-1": 8.61792, + "eu-south-1": 0.0, + "eu-west-1": 9.0528, + "eu-west-2": 0.0, + "sa-east-1": 13.5504, + "us-east-1": 8.1888, + "us-east-2": 0.0, + "us-west-2": 8.1888 + }, + "r5b.2xlarge": { + "ap-northeast-1": 0.9116, + "ap-northeast-2": 0.8272, + "ap-southeast-1": 0.8272, + "ap-southeast-2": 0.8392, + "ca-central-1": 0.7672, + "eu-central-1": 0.8272, + "eu-north-1": 0.74696, + "eu-south-1": 0.8152, + "eu-west-1": 0.7832, + "eu-west-2": 0.8152, + "sa-east-1": 1.0632, + "us-east-1": 0.0, + "us-east-2": 0.7112, + "us-west-2": 0.7112 + }, + "r5b.4xlarge": { + "ap-northeast-1": 1.6208, + "ap-northeast-2": 1.7392, + "ap-southeast-1": 1.5968, + "ap-southeast-2": 1.7656, + "ca-central-1": 1.4768, + "eu-central-1": 0.0, + "eu-north-1": 1.562672, + "eu-south-1": 1.5728, + "eu-west-1": 1.5088, + "eu-west-2": 0.0, + "sa-east-1": 0.0, + "us-east-1": 1.3648, + "us-east-2": 1.3648, + "us-west-2": 1.3648 + }, + "r5b.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.4784, + "ap-southeast-1": 3.1936, + "ap-southeast-2": 3.2416, + "ca-central-1": 2.9536, + "eu-central-1": 3.1936, + "eu-north-1": 0.0, + "eu-south-1": 3.1456, + "eu-west-1": 3.0176, + "eu-west-2": 3.1456, + "sa-east-1": 4.1376, + "us-east-1": 0.0, + "us-east-2": 2.7296, + "us-west-2": 2.7296 + }, + "r5b.12xlarge": { + "ap-northeast-1": 5.2968, + "ap-northeast-2": 5.2176, + "ap-southeast-1": 4.7904, + "ap-southeast-2": 5.2968, + "ca-central-1": 4.4304, + "eu-central-1": 5.2176, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 4.7184, + "sa-east-1": 6.7752, + "us-east-1": 4.0944, + "us-east-2": 4.0944, + "us-west-2": 0.0 + }, + "r5b.16xlarge": { + "ap-northeast-1": 6.4832, + "ap-northeast-2": 6.9568, + "ap-southeast-1": 6.9568, + "ap-southeast-2": 6.4832, + "ca-central-1": 5.9072, + "eu-central-1": 6.3872, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 6.0352, + "eu-west-2": 0.0, + "sa-east-1": 0.0, + "us-east-1": 5.4592, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "r5b.24xlarge": { + "ap-northeast-1": 9.7248, + "ap-northeast-2": 0.0, + "ap-southeast-1": 10.4352, + "ap-southeast-2": 9.7248, + "ca-central-1": 8.8608, + "eu-central-1": 9.5808, + "eu-north-1": 9.376032, + "eu-south-1": 9.4368, + "eu-west-1": 9.8544, + "eu-west-2": 9.4368, + "sa-east-1": 12.4128, + "us-east-1": 0.0, + "us-east-2": 8.1888, + "us-west-2": 8.904 + }, + "r5d.large": { + "af-south-1": 0.219, + "ap-east-1": 0.204, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.18, + "ap-south-2": 0.18, + "ap-southeast-1": 0.213, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.203, + "ca-central-1": 0.196, + "eu-central-1": 0.202, + "eu-central-2": 0.219, + "eu-north-1": 0.181, + "eu-south-1": 0.197, + "eu-south-2": 0.198, + "eu-west-1": 0.189, + "eu-west-2": 0.198, + "eu-west-3": 0.0, + "il-central-1": 0.197, + "me-central-1": 0.0, + "me-south-1": 0.205, + "sa-east-1": 0.257, + "us-east-1": 0.0, + "us-east-2": 0.173, + "us-gov-east-1": 0.212, + "us-gov-west-1": 0.0, + "us-west-1": 0.201, + "us-west-2": 0.181, + "us-west-2-lax-1": 0.202 + }, + "r5d.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.408, + "ap-northeast-1": 0.406, + "ap-northeast-2": 0.404, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.36, + "ap-southeast-1": 0.406, + "ap-southeast-2": 0.426, + "ap-southeast-3": 0.406, + "ap-southeast-4": 0.426, + "ca-central-1": 0.393, + "eu-central-1": 0.424, + "eu-central-2": 0.438, + "eu-north-1": 0.38, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.397, + "eu-west-2": 0.396, + "eu-west-3": 0.416, + "il-central-1": 0.414, + "me-central-1": 0.431, + "me-south-1": 0.431, + "sa-east-1": 0.0, + "us-east-1": 0.346, + "us-east-2": 0.346, + "us-gov-east-1": 0.424, + "us-gov-west-1": 0.424, + "us-west-1": 0.382, + "us-west-2": 0.346, + "us-west-2-lax-1": 0.403 + }, + "r5d.metal": { + "af-south-1": 10.157, + "ap-east-1": 9.437, + "ap-northeast-1": 9.389, + "ap-northeast-2": 9.341, + "ap-northeast-3": 9.389, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 9.389, + "ap-southeast-2": 9.389, + "ap-southeast-3": 0.0, + "ap-southeast-4": 9.389, + "ca-central-1": 8.621, + "eu-central-1": 9.341, + "eu-central-2": 10.171, + "eu-north-1": 8.333, + "eu-south-1": 9.101, + "eu-south-2": 8.717, + "eu-west-1": 0.0, + "eu-west-2": 9.149, + "eu-west-3": 9.149, + "il-central-1": 9.101, + "me-central-1": 9.485, + "me-south-1": 9.485, + "sa-east-1": 11.981, + "us-east-1": 7.949, + "us-east-2": 0.0, + "us-gov-east-1": 9.341, + "us-gov-west-1": 9.341, + "us-west-1": 8.813, + "us-west-2": 7.949, + "us-west-2-lax-1": 9.331 + }, + "r5d.2xlarge": { + "af-south-1": 0.921, + "ap-east-1": 0.857, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.807, + "ap-northeast-3": 0.811, + "ap-south-1": 0.719, + "ap-south-2": 0.719, + "ap-southeast-1": 0.811, + "ap-southeast-2": 0.811, + "ap-southeast-3": 0.853, + "ap-southeast-4": 0.0, + "ca-central-1": 0.785, + "eu-central-1": 0.807, + "eu-central-2": 0.876, + "eu-north-1": 0.723, + "eu-south-1": 0.787, + "eu-south-2": 0.0, + "eu-west-1": 0.755, + "eu-west-2": 0.832, + "eu-west-3": 0.791, + "il-central-1": 0.787, + "me-central-1": 0.819, + "me-south-1": 0.819, + "sa-east-1": 1.027, + "us-east-1": 0.691, + "us-east-2": 0.691, + "us-gov-east-1": 0.807, + "us-gov-west-1": 0.807, + "us-west-1": 0.763, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.848 + }, + "r5d.4xlarge": { + "af-south-1": 1.693, + "ap-east-1": 0.0, + "ap-northeast-1": 1.565, + "ap-northeast-2": 1.557, + "ap-northeast-3": 1.565, + "ap-south-1": 1.453, + "ap-south-2": 1.453, + "ap-southeast-1": 1.565, + "ap-southeast-2": 1.565, + "ap-southeast-3": 1.565, + "ap-southeast-4": 1.565, + "ca-central-1": 1.437, + "eu-central-1": 1.557, + "eu-central-2": 1.695, + "eu-north-1": 0.0, + "eu-south-1": 1.517, + "eu-south-2": 1.453, + "eu-west-1": 1.53, + "eu-west-2": 1.525, + "eu-west-3": 1.606, + "il-central-1": 1.517, + "me-central-1": 0.0, + "me-south-1": 1.581, + "sa-east-1": 1.997, + "us-east-1": 0.0, + "us-east-2": 1.325, + "us-gov-east-1": 1.557, + "us-gov-west-1": 1.557, + "us-west-1": 0.0, + "us-west-2": 1.394, + "us-west-2-lax-1": 0.0 + }, + "r5d.8xlarge": { + "af-south-1": 3.568, + "ap-east-1": 3.146, + "ap-northeast-1": 3.13, + "ap-northeast-2": 3.114, + "ap-northeast-3": 3.13, + "ap-south-1": 2.762, + "ap-south-2": 2.762, + "ap-southeast-1": 3.13, + "ap-southeast-2": 3.13, + "ap-southeast-3": 3.297, + "ap-southeast-4": 3.13, + "ca-central-1": 3.025, + "eu-central-1": 3.114, + "eu-central-2": 0.0, + "eu-north-1": 2.778, + "eu-south-1": 3.034, + "eu-south-2": 0.0, + "eu-west-1": 2.906, + "eu-west-2": 3.05, + "eu-west-3": 3.05, + "il-central-1": 3.034, + "me-central-1": 3.162, + "me-south-1": 3.162, + "sa-east-1": 4.212, + "us-east-1": 2.65, + "us-east-2": 2.65, + "us-gov-east-1": 3.114, + "us-gov-west-1": 3.114, + "us-west-1": 2.938, + "us-west-2": 2.65, + "us-west-2-lax-1": 3.276 + }, + "r5d.12xlarge": { + "af-south-1": 5.352, + "ap-east-1": 4.718, + "ap-northeast-1": 4.945, + "ap-northeast-2": 4.67, + "ap-northeast-3": 4.694, + "ap-south-1": 4.142, + "ap-south-2": 4.142, + "ap-southeast-1": 4.694, + "ap-southeast-2": 0.0, + "ap-southeast-3": 4.945, + "ap-southeast-4": 0.0, + "ca-central-1": 4.31, + "eu-central-1": 4.67, + "eu-central-2": 5.086, + "eu-north-1": 4.385, + "eu-south-1": 4.55, + "eu-south-2": 4.358, + "eu-west-1": 4.358, + "eu-west-2": 4.574, + "eu-west-3": 0.0, + "il-central-1": 4.55, + "me-central-1": 4.742, + "me-south-1": 0.0, + "sa-east-1": 5.99, + "us-east-1": 0.0, + "us-east-2": 3.974, + "us-gov-east-1": 4.67, + "us-gov-west-1": 0.0, + "us-west-1": 4.406, + "us-west-2": 3.974, + "us-west-2-lax-1": 0.0 + }, + "r5d.16xlarge": { + "af-south-1": 6.771, + "ap-east-1": 6.291, + "ap-northeast-1": 6.259, + "ap-northeast-2": 6.227, + "ap-northeast-3": 6.259, + "ap-south-1": 5.523, + "ap-south-2": 5.813, + "ap-southeast-1": 6.259, + "ap-southeast-2": 6.259, + "ap-southeast-3": 6.593, + "ap-southeast-4": 6.259, + "ca-central-1": 5.747, + "eu-central-1": 6.227, + "eu-central-2": 6.781, + "eu-north-1": 5.555, + "eu-south-1": 6.067, + "eu-south-2": 5.811, + "eu-west-1": 5.811, + "eu-west-2": 6.424, + "eu-west-3": 6.099, + "il-central-1": 6.067, + "me-central-1": 6.323, + "me-south-1": 6.661, + "sa-east-1": 7.987, + "us-east-1": 5.299, + "us-east-2": 5.299, + "us-gov-east-1": 6.227, + "us-gov-west-1": 0.0, + "us-west-1": 5.875, + "us-west-2": 5.299, + "us-west-2-lax-1": 6.221 + }, + "r5d.24xlarge": { + "af-south-1": 0.0, + "ap-east-1": 9.437, + "ap-northeast-1": 9.389, + "ap-northeast-2": 0.0, + "ap-northeast-3": 9.389, + "ap-south-1": 8.285, + "ap-south-2": 8.285, + "ap-southeast-1": 9.389, + "ap-southeast-2": 9.389, + "ap-southeast-3": 9.389, + "ap-southeast-4": 0.0, + "ca-central-1": 8.621, + "eu-central-1": 9.341, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 8.717, + "eu-west-1": 0.0, + "eu-west-2": 9.149, + "eu-west-3": 9.149, + "il-central-1": 0.0, + "me-central-1": 9.485, + "me-south-1": 9.485, + "sa-east-1": 0.0, + "us-east-1": 7.949, + "us-east-2": 7.949, + "us-gov-east-1": 9.341, + "us-gov-west-1": 0.0, + "us-west-1": 8.813, + "us-west-2": 0.0, + "us-west-2-lax-1": 9.331 + }, + "r5dn.large": { + "af-south-1": 0.26306, + "ap-northeast-1": 0.2318, + "ap-northeast-2": 0.2278, + "ap-southeast-1": 0.2408, + "ap-southeast-2": 0.24504, + "eu-central-1": 0.2278, + "eu-north-1": 0.2058, + "eu-south-1": 0.2248, + "eu-west-1": 0.2148, + "eu-west-3": 0.2248, + "us-east-1": 0.1958, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 0.1958 + }, + "r5dn.xlarge": { + "af-south-1": 0.52612, + "ap-northeast-1": 0.4636, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.4656, + "eu-central-1": 0.4556, + "eu-north-1": 0.4116, + "eu-south-1": 0.47312, + "eu-west-1": 0.0, + "eu-west-3": 0.47312, + "us-east-1": 0.3916, + "us-east-2": 0.41164, + "us-gov-east-1": 0.48372, + "us-gov-west-1": 0.4596, + "us-west-2": 0.41164 + }, + "r5dn.metal": { + "af-south-1": 11.6448, + "ap-northeast-1": 0.0, + "ap-northeast-2": 10.5888, + "ap-southeast-1": 10.6368, + "ap-southeast-2": 10.8288, + "eu-central-1": 10.5888, + "eu-north-1": 9.5328, + "eu-south-1": 10.4448, + "eu-west-1": 9.9648, + "eu-west-3": 10.4448, + "us-east-1": 9.0528, + "us-east-2": 9.0528, + "us-gov-east-1": 0.0, + "us-gov-west-1": 10.6848, + "us-west-2": 9.0528 + }, + "r5dn.2xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 0.97592, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.9632, + "ap-southeast-2": 0.9312, + "eu-central-1": 0.9112, + "eu-north-1": 0.8232, + "eu-south-1": 0.8992, + "eu-west-1": 0.8592, + "eu-west-3": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.9192, + "us-gov-west-1": 0.96744, + "us-west-2": 0.7832 + }, + "r5dn.4xlarge": { + "af-south-1": 1.9408, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-southeast-1": 1.8688, + "ap-southeast-2": 1.8048, + "eu-central-1": 1.7648, + "eu-north-1": 1.5888, + "eu-south-1": 1.7408, + "eu-west-1": 1.6608, + "eu-west-3": 1.83488, + "us-east-1": 1.5088, + "us-east-2": 0.0, + "us-gov-east-1": 1.87728, + "us-gov-west-1": 1.7808, + "us-west-2": 0.0 + }, + "r5dn.8xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 3.5936, + "ap-northeast-2": 3.72064, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 3.1776, + "eu-south-1": 3.4816, + "eu-west-1": 0.0, + "eu-west-3": 3.4816, + "us-east-1": 0.0, + "us-east-2": 3.0176, + "us-gov-east-1": 3.5616, + "us-gov-west-1": 0.0, + "us-west-2": 3.0176 + }, + "r5dn.12xlarge": { + "af-south-1": 6.14064, + "ap-northeast-1": 5.3904, + "ap-northeast-2": 5.2944, + "ap-southeast-1": 5.6064, + "ap-southeast-2": 5.4144, + "eu-central-1": 0.0, + "eu-north-1": 4.7664, + "eu-south-1": 5.2224, + "eu-west-1": 4.9824, + "eu-west-3": 0.0, + "us-east-1": 4.5264, + "us-east-2": 4.5264, + "us-gov-east-1": 5.63184, + "us-gov-west-1": 5.3424, + "us-west-2": 4.5264 + }, + "r5dn.16xlarge": { + "af-south-1": 7.7632, + "ap-northeast-1": 7.1872, + "ap-northeast-2": 7.0592, + "ap-southeast-1": 7.0912, + "ap-southeast-2": 7.61088, + "eu-central-1": 7.0592, + "eu-north-1": 0.0, + "eu-south-1": 6.9632, + "eu-west-1": 6.6432, + "eu-west-3": 6.9632, + "us-east-1": 6.0352, + "us-east-2": 0.0, + "us-gov-east-1": 7.50912, + "us-gov-west-1": 7.50912, + "us-west-2": 6.0352 + }, + "r5dn.24xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 10.7808, + "ap-northeast-2": 10.5888, + "ap-southeast-1": 10.6368, + "ap-southeast-2": 10.8288, + "eu-central-1": 10.5888, + "eu-north-1": 9.5328, + "eu-south-1": 10.4448, + "eu-west-1": 9.9648, + "eu-west-3": 10.4448, + "us-east-1": 0.0, + "us-east-2": 9.0528, + "us-gov-east-1": 10.6848, + "us-gov-west-1": 10.6848, + "us-west-2": 9.0528 + }, + "r5n.large": { + "af-south-1": 0.227, + "ap-east-1": 0.231, + "ap-northeast-1": 0.21, + "ap-northeast-2": 0.207, + "ap-south-1": 0.182, + "ap-southeast-1": 0.207, + "ap-southeast-2": 0.0, + "ca-central-1": 0.202, + "eu-central-1": 0.207, + "eu-north-1": 0.188, + "eu-south-1": 0.204, + "eu-west-1": 0.0, + "eu-west-2": 0.204, + "eu-west-3": 0.204, + "sa-east-1": 0.0, + "us-east-1": 0.178, + "us-east-2": 0.178, + "us-gov-east-1": 0.219, + "us-gov-west-1": 0.219, + "us-west-1": 0.0, + "us-west-2": 0.178 + }, + "r5n.xlarge": { + "af-south-1": 0.479, + "ap-east-1": 0.462, + "ap-northeast-1": 0.441, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.435, + "ap-southeast-2": 0.42, + "ca-central-1": 0.0, + "eu-central-1": 0.414, + "eu-north-1": 0.376, + "eu-south-1": 0.408, + "eu-west-1": 0.392, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 0.558, + "us-east-1": 0.356, + "us-east-2": 0.373, + "us-gov-east-1": 0.416, + "us-gov-west-1": 0.416, + "us-west-1": 0.396, + "us-west-2": 0.356 + }, + "r5n.metal": { + "af-south-1": 0.0, + "ap-east-1": 10.733, + "ap-northeast-1": 9.725, + "ap-northeast-2": 9.581, + "ap-south-1": 8.381, + "ap-southeast-1": 9.581, + "ap-southeast-2": 9.725, + "ca-central-1": 8.861, + "eu-central-1": 9.581, + "eu-north-1": 0.0, + "eu-south-1": 9.438, + "eu-west-1": 9.053, + "eu-west-2": 0.0, + "eu-west-3": 9.437, + "sa-east-1": 12.365, + "us-east-1": 8.189, + "us-east-2": 8.189, + "us-gov-east-1": 9.629, + "us-gov-west-1": 0.0, + "us-west-1": 9.149, + "us-west-2": 8.189 + }, + "r5n.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.923, + "ap-northeast-1": 0.839, + "ap-northeast-2": 0.87, + "ap-south-1": 0.727, + "ap-southeast-1": 0.87, + "ap-southeast-2": 0.0, + "ca-central-1": 0.767, + "eu-central-1": 0.0, + "eu-north-1": 0.751, + "eu-south-1": 0.815, + "eu-west-1": 0.783, + "eu-west-2": 0.815, + "eu-west-3": 0.0, + "sa-east-1": 1.059, + "us-east-1": 0.711, + "us-east-2": 0.711, + "us-gov-east-1": 0.831, + "us-gov-west-1": 0.831, + "us-west-1": 0.791, + "us-west-2": 0.711 + }, + "r5n.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.789, + "ap-northeast-1": 1.621, + "ap-northeast-2": 1.682, + "ap-south-1": 1.397, + "ap-southeast-1": 1.597, + "ap-southeast-2": 1.621, + "ca-central-1": 1.477, + "eu-central-1": 1.682, + "eu-north-1": 1.445, + "eu-south-1": 0.0, + "eu-west-1": 1.589, + "eu-west-2": 1.657, + "eu-west-3": 1.657, + "sa-east-1": 2.061, + "us-east-1": 1.365, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.691, + "us-west-1": 0.0, + "us-west-2": 1.365 + }, + "r5n.8xlarge": { + "af-south-1": 3.524, + "ap-east-1": 3.578, + "ap-northeast-1": 3.242, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 3.194, + "ap-southeast-2": 3.242, + "ca-central-1": 3.11, + "eu-central-1": 0.0, + "eu-north-1": 2.89, + "eu-south-1": 3.146, + "eu-west-1": 3.178, + "eu-west-2": 0.0, + "eu-west-3": 3.146, + "sa-east-1": 4.122, + "us-east-1": 2.73, + "us-east-2": 2.73, + "us-gov-east-1": 3.381, + "us-gov-west-1": 3.21, + "us-west-1": 3.05, + "us-west-2": 2.73 + }, + "r5n.12xlarge": { + "af-south-1": 5.286, + "ap-east-1": 0.0, + "ap-northeast-1": 4.862, + "ap-northeast-2": 4.79, + "ap-south-1": 4.411, + "ap-southeast-1": 4.79, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 4.79, + "eu-north-1": 4.334, + "eu-south-1": 0.0, + "eu-west-1": 4.767, + "eu-west-2": 0.0, + "eu-west-3": 4.972, + "sa-east-1": 6.182, + "us-east-1": 0.0, + "us-east-2": 4.094, + "us-gov-east-1": 4.814, + "us-gov-west-1": 0.0, + "us-west-1": 4.574, + "us-west-2": 4.094 + }, + "r5n.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 7.155, + "ap-northeast-1": 6.483, + "ap-northeast-2": 6.387, + "ap-south-1": 5.587, + "ap-southeast-1": 6.387, + "ap-southeast-2": 6.831, + "ca-central-1": 0.0, + "eu-central-1": 6.387, + "eu-north-1": 5.779, + "eu-south-1": 6.292, + "eu-west-1": 0.0, + "eu-west-2": 6.629, + "eu-west-3": 6.291, + "sa-east-1": 8.243, + "us-east-1": 5.459, + "us-east-2": 5.459, + "us-gov-east-1": 6.763, + "us-gov-west-1": 6.763, + "us-west-1": 6.099, + "us-west-2": 5.459 + }, + "r5n.24xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 9.725, + "ap-northeast-2": 9.581, + "ap-south-1": 0.0, + "ap-southeast-1": 9.581, + "ap-southeast-2": 9.725, + "ca-central-1": 0.0, + "eu-central-1": 9.581, + "eu-north-1": 8.669, + "eu-south-1": 9.438, + "eu-west-1": 9.053, + "eu-west-2": 9.437, + "eu-west-3": 9.437, + "sa-east-1": 12.365, + "us-east-1": 8.189, + "us-east-2": 8.189, + "us-gov-east-1": 0.0, + "us-gov-west-1": 9.629, + "us-west-1": 9.149, + "us-west-2": 8.189 + }, + "r6a.large": { + "ap-northeast-1": 0.17928, + "ap-south-1": 0.1003, + "ap-south-2": 0.1003, + "ap-southeast-1": 0.1656, + "ap-southeast-2": 0.0, + "ca-central-1": 0.153, + "eu-central-1": 0.17928, + "eu-west-1": 0.1557, + "us-east-1": 0.15354, + "us-east-2": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "r6a.xlarge": { + "ap-northeast-1": 0.3312, + "ap-south-1": 0.0, + "ap-south-2": 0.2006, + "ap-southeast-1": 0.3312, + "ap-southeast-2": 0.3294, + "ca-central-1": 0.33084, + "eu-central-1": 0.0, + "eu-west-1": 0.3114, + "us-east-1": 0.2844, + "us-east-2": 0.30708, + "us-west-1": 0.3348, + "us-west-2": 0.30708 + }, + "r6a.metal": { + "ap-northeast-1": 14.976, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 14.976, + "ap-southeast-2": 0.0, + "ca-central-1": 13.7664, + "eu-central-1": 14.976, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 12.7296, + "us-west-1": 13.9392, + "us-west-2": 12.7296 + }, + "r6a.2xlarge": { + "ap-northeast-1": 0.71712, + "ap-south-1": 0.4012, + "ap-south-2": 0.4012, + "ap-southeast-1": 0.71712, + "ap-southeast-2": 0.71316, + "ca-central-1": 0.0, + "eu-central-1": 0.6624, + "eu-west-1": 0.67356, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 0.6192, + "us-west-2": 0.5688 + }, + "r6a.4xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.7448, + "ap-south-2": 0.7448, + "ap-southeast-1": 1.2672, + "ap-southeast-2": 0.0, + "ca-central-1": 1.1664, + "eu-central-1": 1.2672, + "eu-west-1": 1.28952, + "us-east-1": 1.08, + "us-east-2": 1.08, + "us-west-1": 1.1808, + "us-west-2": 1.17072 + }, + "r6a.8xlarge": { + "ap-northeast-1": 2.5344, + "ap-south-1": 1.4896, + "ap-south-2": 1.604, + "ap-southeast-1": 2.5344, + "ap-southeast-2": 2.73744, + "ca-central-1": 0.0, + "eu-central-1": 2.5344, + "eu-west-1": 2.376, + "us-east-1": 2.16, + "us-east-2": 2.34144, + "us-west-1": 2.3616, + "us-west-2": 2.16 + }, + "r6a.12xlarge": { + "ap-northeast-1": 3.8016, + "ap-south-1": 0.0, + "ap-south-2": 2.2344, + "ap-southeast-1": 3.8016, + "ap-southeast-2": 4.10616, + "ca-central-1": 3.79728, + "eu-central-1": 3.8016, + "eu-west-1": 3.564, + "us-east-1": 3.51216, + "us-east-2": 3.24, + "us-west-1": 3.5424, + "us-west-2": 3.24 + }, + "r6a.16xlarge": { + "ap-northeast-1": 5.0688, + "ap-south-1": 0.0, + "ap-south-2": 2.9792, + "ap-southeast-1": 5.50656, + "ap-southeast-2": 5.47488, + "ca-central-1": 0.0, + "eu-central-1": 5.0688, + "eu-west-1": 4.752, + "us-east-1": 4.68288, + "us-east-2": 4.32, + "us-west-1": 4.7232, + "us-west-2": 4.32 + }, + "r6a.24xlarge": { + "ap-northeast-1": 7.6032, + "ap-south-1": 4.4688, + "ap-south-2": 4.4688, + "ap-southeast-1": 0.0, + "ap-southeast-2": 8.21232, + "ca-central-1": 7.59456, + "eu-central-1": 8.25984, + "eu-west-1": 7.73712, + "us-east-1": 6.48, + "us-east-2": 7.02432, + "us-west-1": 7.0848, + "us-west-2": 6.48 + }, + "r6a.32xlarge": { + "ap-northeast-1": 10.85952, + "ap-south-1": 5.8048, + "ap-south-2": 5.8048, + "ap-southeast-1": 9.984, + "ap-southeast-2": 9.9264, + "ca-central-1": 9.1776, + "eu-central-1": 0.0, + "eu-west-1": 10.16256, + "us-east-1": 0.0, + "us-east-2": 8.4864, + "us-west-1": 9.2928, + "us-west-2": 0.0 + }, + "r6a.48xlarge": { + "ap-northeast-1": 14.976, + "ap-south-1": 8.7072, + "ap-south-2": 8.7072, + "ap-southeast-1": 14.976, + "ap-southeast-2": 14.8896, + "ca-central-1": 13.7664, + "eu-central-1": 14.976, + "eu-west-1": 14.0256, + "us-east-1": 12.7296, + "us-east-2": 0.0, + "us-west-1": 0.0, + "us-west-2": 12.7296 + }, + "r6g.medium": { + "af-south-1": 0.0816, + "ap-east-1": 0.0814, + "ap-northeast-1": 0.0752, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0469, + "ap-south-2": 0.0489, + "ap-southeast-1": 0.0752, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0752, + "ap-southeast-4": 0.0784, + "ap-southeast-5": 0.0661, + "ap-southeast-7": 0.0692, + "ca-central-1": 0.0729, + "ca-west-1": 0.0696, + "eu-central-1": 0.0752, + "eu-central-2": 0.0853, + "eu-north-1": 0.0, + "eu-south-1": 0.0736, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0736, + "eu-west-3": 0.0734, + "il-central-1": 0.0736, + "me-central-1": 0.0764, + "me-south-1": 0.0802, + "mx-central-1": 0.0673, + "sa-east-1": 0.0996, + "us-east-1": 0.0, + "us-east-2": 0.0648, + "us-gov-east-1": 0.0784, + "us-gov-west-1": 0.0784, + "us-west-1": 0.0704, + "us-west-2": 0.0678 + }, + "r6g.large": { + "af-south-1": 0.1632, + "ap-east-1": 0.1628, + "ap-northeast-1": 0.1504, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0938, + "ap-south-2": 0.0938, + "ap-southeast-1": 0.1577, + "ap-southeast-2": 0.1496, + "ap-southeast-3": 0.1504, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.1322, + "ap-southeast-7": 0.0, + "ca-central-1": 0.1392, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.1626, + "eu-north-1": 0.1422, + "eu-south-1": 0.1543, + "eu-south-2": 0.1416, + "eu-west-1": 0.0, + "eu-west-2": 0.1543, + "eu-west-3": 0.1468, + "il-central-1": 0.1472, + "me-central-1": 0.1529, + "me-south-1": 0.1603, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.1296, + "us-east-2": 0.1296, + "us-gov-east-1": 0.1568, + "us-gov-west-1": 0.1496, + "us-west-1": 0.0, + "us-west-2": 0.1296 + }, + "r6g.xlarge": { + "af-south-1": 0.3425, + "ap-east-1": 0.3256, + "ap-northeast-1": 0.3008, + "ap-northeast-2": 0.3016, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.3008, + "ap-southeast-2": 0.2992, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.2992, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.2767, + "ca-central-1": 0.2784, + "ca-west-1": 0.2784, + "eu-central-1": 0.0, + "eu-central-2": 0.3251, + "eu-north-1": 0.2716, + "eu-south-1": 0.0, + "eu-south-2": 0.2832, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.2936, + "il-central-1": 0.0, + "me-central-1": 0.3058, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.3792, + "us-east-1": 0.2592, + "us-east-2": 0.2592, + "us-gov-east-1": 0.2992, + "us-gov-west-1": 0.0, + "us-west-1": 0.2816, + "us-west-2": 0.2592 + }, + "r6g.metal": { + "af-south-1": 4.992, + "ap-east-1": 0.0, + "ap-northeast-1": 4.5824, + "ap-northeast-2": 4.5952, + "ap-northeast-3": 4.5824, + "ap-south-1": 0.0, + "ap-south-2": 2.7712, + "ap-southeast-1": 4.5824, + "ap-southeast-2": 4.5568, + "ap-southeast-3": 0.0, + "ap-southeast-4": 4.5568, + "ap-southeast-5": 0.0, + "ap-southeast-7": 3.9987, + "ca-central-1": 4.224, + "ca-west-1": 4.224, + "eu-central-1": 4.5824, + "eu-central-2": 4.9715, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 4.3008, + "eu-west-2": 4.48, + "eu-west-3": 0.0, + "il-central-1": 4.4813, + "me-central-1": 4.6618, + "me-south-1": 4.6618, + "mx-central-1": 4.0781, + "sa-east-1": 5.8368, + "us-east-1": 3.9168, + "us-east-2": 0.0, + "us-gov-east-1": 4.5568, + "us-gov-west-1": 4.5568, + "us-west-1": 4.2752, + "us-west-2": 0.0 + }, + "r6g.2xlarge": { + "af-south-1": 0.6851, + "ap-east-1": 0.0, + "ap-northeast-1": 0.6016, + "ap-northeast-2": 0.6032, + "ap-northeast-3": 0.0, + "ap-south-1": 0.3908, + "ap-south-2": 0.3752, + "ap-southeast-1": 0.6016, + "ap-southeast-2": 0.5984, + "ap-southeast-3": 0.6016, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.5534, + "ap-southeast-7": 0.0, + "ca-central-1": 0.5568, + "ca-west-1": 0.5568, + "eu-central-1": 0.0, + "eu-central-2": 0.6502, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.5935, + "eu-west-1": 0.5935, + "eu-west-2": 0.5888, + "eu-west-3": 0.5872, + "il-central-1": 0.589, + "me-central-1": 0.0, + "me-south-1": 0.6413, + "mx-central-1": 0.564, + "sa-east-1": 0.7584, + "us-east-1": 0.5426, + "us-east-2": 0.5184, + "us-gov-east-1": 0.5984, + "us-gov-west-1": 0.0, + "us-west-1": 0.5632, + "us-west-2": 0.5184 + }, + "r6g.4xlarge": { + "af-south-1": 1.248, + "ap-east-1": 1.2448, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.1488, + "ap-northeast-3": 1.1456, + "ap-south-1": 0.724, + "ap-south-2": 0.6928, + "ap-southeast-1": 1.1456, + "ap-southeast-2": 1.1972, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.9997, + "ap-southeast-7": 0.0, + "ca-central-1": 1.056, + "ca-west-1": 1.056, + "eu-central-1": 1.1456, + "eu-central-2": 0.0, + "eu-north-1": 1.0288, + "eu-south-1": 0.0, + "eu-south-2": 1.1293, + "eu-west-1": 1.0752, + "eu-west-2": 0.0, + "eu-west-3": 1.1168, + "il-central-1": 1.1772, + "me-central-1": 1.1654, + "me-south-1": 1.1654, + "mx-central-1": 1.0195, + "sa-east-1": 1.5364, + "us-east-1": 0.9792, + "us-east-2": 0.9792, + "us-gov-east-1": 1.1392, + "us-gov-west-1": 0.0, + "us-west-1": 1.0688, + "us-west-2": 0.0 + }, + "r6g.8xlarge": { + "af-south-1": 2.496, + "ap-east-1": 2.4896, + "ap-northeast-1": 2.2912, + "ap-northeast-2": 2.4144, + "ap-northeast-3": 2.2912, + "ap-south-1": 0.0, + "ap-south-2": 1.3856, + "ap-southeast-1": 2.2912, + "ap-southeast-2": 2.2784, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.9994, + "ca-central-1": 2.218, + "ca-west-1": 0.0, + "eu-central-1": 2.2912, + "eu-central-2": 2.6142, + "eu-north-1": 2.0576, + "eu-south-1": 2.3538, + "eu-south-2": 0.0, + "eu-west-1": 2.1504, + "eu-west-2": 0.0, + "eu-west-3": 2.2336, + "il-central-1": 2.2406, + "me-central-1": 2.3309, + "me-south-1": 2.45, + "mx-central-1": 2.039, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 2.3944, + "us-gov-west-1": 0.0, + "us-west-1": 2.2451, + "us-west-2": 1.9584 + }, + "r6g.12xlarge": { + "af-south-1": 3.744, + "ap-east-1": 3.7344, + "ap-northeast-1": 3.4368, + "ap-northeast-2": 3.4464, + "ap-northeast-3": 3.4368, + "ap-south-1": 2.0784, + "ap-south-2": 2.0784, + "ap-southeast-1": 3.4368, + "ap-southeast-2": 3.4176, + "ap-southeast-3": 3.6119, + "ap-southeast-4": 3.4176, + "ap-southeast-5": 2.999, + "ap-southeast-7": 3.1479, + "ca-central-1": 3.327, + "ca-west-1": 3.168, + "eu-central-1": 3.4368, + "eu-central-2": 0.0, + "eu-north-1": 3.0864, + "eu-south-1": 0.0, + "eu-south-2": 3.2256, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 3.3504, + "il-central-1": 0.0, + "me-central-1": 3.675, + "me-south-1": 0.0, + "mx-central-1": 3.0586, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.9376, + "us-gov-east-1": 3.4176, + "us-gov-west-1": 3.4176, + "us-west-1": 3.2064, + "us-west-2": 0.0 + }, + "r6g.16xlarge": { + "af-south-1": 4.992, + "ap-east-1": 4.9792, + "ap-northeast-1": 4.5824, + "ap-northeast-2": 4.5952, + "ap-northeast-3": 0.0, + "ap-south-1": 2.7712, + "ap-south-2": 2.7712, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.5568, + "ap-southeast-3": 4.5824, + "ap-southeast-4": 4.5568, + "ap-southeast-5": 3.9987, + "ap-southeast-7": 3.9987, + "ca-central-1": 0.0, + "ca-west-1": 4.224, + "eu-central-1": 4.5824, + "eu-central-2": 4.9715, + "eu-north-1": 4.1152, + "eu-south-1": 4.48, + "eu-south-2": 4.3008, + "eu-west-1": 4.3008, + "eu-west-2": 4.48, + "eu-west-3": 4.4672, + "il-central-1": 4.4813, + "me-central-1": 4.6618, + "me-south-1": 4.6618, + "mx-central-1": 0.0, + "sa-east-1": 5.8368, + "us-east-1": 0.0, + "us-east-2": 3.9168, + "us-gov-east-1": 4.5568, + "us-gov-west-1": 0.0, + "us-west-1": 4.2752, + "us-west-2": 3.9168 + }, + "r6gd.medium": { + "ap-northeast-1": 0.0839, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.054, + "ap-southeast-1": 0.0839, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0839, + "ca-central-1": 0.0814, + "eu-central-1": 0.0834, + "eu-central-2": 0.0903, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.082, + "eu-west-3": 0.082, + "sa-east-1": 0.1056, + "us-east-1": 0.072, + "us-east-2": 0.072, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0836, + "us-west-1": 0.0794, + "us-west-2": 0.0 + }, + "r6gd.large": { + "ap-northeast-1": 0.1678, + "ap-northeast-2": 0.1672, + "ap-northeast-3": 0.168, + "ap-south-1": 0.108, + "ap-southeast-1": 0.1678, + "ap-southeast-2": 0.1762, + "ap-southeast-3": 0.0, + "ca-central-1": 0.1552, + "eu-central-1": 0.1668, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.164, + "sa-east-1": 0.2112, + "us-east-1": 0.144, + "us-east-2": 0.1509, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.1672, + "us-west-1": 0.1588, + "us-west-2": 0.144 + }, + "r6gd.xlarge": { + "ap-northeast-1": 0.3356, + "ap-northeast-2": 0.3344, + "ap-northeast-3": 0.336, + "ap-south-1": 0.216, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.3356, + "ap-southeast-3": 0.3524, + "ca-central-1": 0.3104, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.3008, + "eu-south-2": 0.329, + "eu-west-1": 0.329, + "eu-west-2": 0.328, + "eu-west-3": 0.328, + "sa-east-1": 0.4224, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.3344, + "us-gov-west-1": 0.3344, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "r6gd.metal": { + "ap-northeast-1": 5.1392, + "ap-northeast-2": 5.12, + "ap-northeast-3": 0.0, + "ap-south-1": 3.0829, + "ap-southeast-1": 5.1392, + "ap-southeast-2": 5.1392, + "ap-southeast-3": 5.1392, + "ca-central-1": 0.0, + "eu-central-1": 5.1072, + "eu-central-2": 5.5488, + "eu-north-1": 4.5824, + "eu-south-2": 4.7872, + "eu-west-1": 4.7872, + "eu-west-2": 5.0176, + "eu-west-3": 5.0176, + "sa-east-1": 6.528, + "us-east-1": 4.3776, + "us-east-2": 4.3776, + "us-gov-east-1": 5.12, + "us-gov-west-1": 5.12, + "us-west-1": 4.8512, + "us-west-2": 0.0 + }, + "r6gd.2xlarge": { + "ap-northeast-1": 0.6712, + "ap-northeast-2": 0.702, + "ap-northeast-3": 0.672, + "ap-south-1": 0.4142, + "ap-southeast-1": 0.6712, + "ap-southeast-2": 0.6712, + "ap-southeast-3": 0.6712, + "ca-central-1": 0.6208, + "eu-central-1": 0.6672, + "eu-central-2": 0.7224, + "eu-north-1": 0.6016, + "eu-south-2": 0.6579, + "eu-west-1": 0.6579, + "eu-west-2": 0.656, + "eu-west-3": 0.6884, + "sa-east-1": 0.8448, + "us-east-1": 0.576, + "us-east-2": 0.576, + "us-gov-east-1": 0.6688, + "us-gov-west-1": 0.702, + "us-west-1": 0.6352, + "us-west-2": 0.576 + }, + "r6gd.4xlarge": { + "ap-northeast-1": 1.352, + "ap-northeast-2": 1.3463, + "ap-northeast-3": 1.2864, + "ap-south-1": 0.7707, + "ap-southeast-1": 1.2848, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ca-central-1": 1.184, + "eu-central-1": 1.3432, + "eu-central-2": 1.4602, + "eu-north-1": 1.1456, + "eu-south-2": 1.1968, + "eu-west-1": 1.1968, + "eu-west-2": 1.3193, + "eu-west-3": 1.2544, + "sa-east-1": 1.632, + "us-east-1": 0.0, + "us-east-2": 1.0944, + "us-gov-east-1": 1.28, + "us-gov-west-1": 0.0, + "us-west-1": 1.2128, + "us-west-2": 1.0944 + }, + "r6gd.8xlarge": { + "ap-northeast-1": 2.704, + "ap-northeast-2": 2.6926, + "ap-northeast-3": 2.7064, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.5696, + "ap-southeast-3": 0.0, + "ca-central-1": 2.368, + "eu-central-1": 2.5536, + "eu-central-2": 0.0, + "eu-north-1": 2.2912, + "eu-south-2": 2.3936, + "eu-west-1": 0.0, + "eu-west-2": 2.5088, + "eu-west-3": 2.6386, + "sa-east-1": 3.264, + "us-east-1": 2.1888, + "us-east-2": 0.0, + "us-gov-east-1": 2.56, + "us-gov-west-1": 0.0, + "us-west-1": 2.4256, + "us-west-2": 2.2994 + }, + "r6gd.12xlarge": { + "ap-northeast-1": 3.8544, + "ap-northeast-2": 3.84, + "ap-northeast-3": 3.8592, + "ap-south-1": 2.3122, + "ap-southeast-1": 3.8544, + "ap-southeast-2": 3.8544, + "ap-southeast-3": 3.8544, + "ca-central-1": 3.552, + "eu-central-1": 3.8304, + "eu-central-2": 4.3807, + "eu-north-1": 3.6119, + "eu-south-2": 3.5904, + "eu-west-1": 3.5904, + "eu-west-2": 3.7632, + "eu-west-3": 3.7632, + "sa-east-1": 0.0, + "us-east-1": 3.2832, + "us-east-2": 3.2832, + "us-gov-east-1": 3.84, + "us-gov-west-1": 0.0, + "us-west-1": 3.6384, + "us-west-2": 3.2832 + }, + "r6gd.16xlarge": { + "ap-northeast-1": 5.1392, + "ap-northeast-2": 0.0, + "ap-northeast-3": 5.1456, + "ap-south-1": 3.0829, + "ap-southeast-1": 5.1392, + "ap-southeast-2": 5.1392, + "ap-southeast-3": 5.1392, + "ca-central-1": 4.736, + "eu-central-1": 0.0, + "eu-central-2": 5.5488, + "eu-north-1": 4.5824, + "eu-south-2": 4.7872, + "eu-west-1": 4.7872, + "eu-west-2": 5.0176, + "eu-west-3": 5.0176, + "sa-east-1": 0.0, + "us-east-1": 4.3776, + "us-east-2": 4.3776, + "us-gov-east-1": 5.12, + "us-gov-west-1": 5.12, + "us-west-1": 4.8512, + "us-west-2": 4.3776 + }, + "r6i.large": { + "af-south-1": 0.2136, + "ap-east-1": 0.1958, + "ap-northeast-1": 0.1808, + "ap-northeast-2": 0.196, + "ap-northeast-3": 0.196, + "ap-south-1": 0.1718, + "ap-south-2": 0.1588, + "ap-southeast-1": 0.196, + "ap-southeast-2": 0.1798, + "ap-southeast-5": 0.158, + "ap-southeast-7": 0.17092, + "ca-central-1": 0.1668, + "ca-west-1": 0.1668, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.1839, + "eu-west-2": 0.1768, + "eu-west-3": 0.1768, + "il-central-1": 0.17685, + "me-central-1": 0.1839, + "me-south-1": 0.1839, + "mx-central-1": 0.1611, + "sa-east-1": 0.0, + "us-east-1": 0.1548, + "us-east-2": 0.1548, + "us-gov-east-1": 0.1798, + "us-gov-west-1": 0.1949, + "us-west-1": 0.1688, + "us-west-2": 0.1674 + }, + "r6i.xlarge": { + "af-south-1": 0.4272, + "ap-east-1": 0.0, + "ap-northeast-1": 0.3616, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.3616, + "ap-south-1": 0.0, + "ap-south-2": 0.3176, + "ap-southeast-1": 0.3616, + "ap-southeast-2": 0.3596, + "ap-southeast-5": 0.316, + "ap-southeast-7": 0.0, + "ca-central-1": 0.3612, + "ca-west-1": 0.3336, + "eu-central-1": 0.3616, + "eu-central-2": 0.392, + "eu-north-1": 0.3256, + "eu-south-1": 0.0, + "eu-west-1": 0.3396, + "eu-west-2": 0.0, + "eu-west-3": 0.3536, + "il-central-1": 0.38331, + "me-central-1": 0.3678, + "me-south-1": 0.39882, + "mx-central-1": 0.3222, + "sa-east-1": 0.4596, + "us-east-1": 0.3096, + "us-east-2": 0.3096, + "us-gov-east-1": 0.3898, + "us-gov-west-1": 0.3898, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "r6i.metal": { + "af-south-1": 11.9808, + "ap-east-1": 0.0, + "ap-northeast-1": 10.9568, + "ap-northeast-2": 10.9568, + "ap-northeast-3": 10.9568, + "ap-south-1": 9.5488, + "ap-south-2": 0.0, + "ap-southeast-1": 10.9568, + "ap-southeast-2": 10.8928, + "ap-southeast-5": 9.4976, + "ap-southeast-7": 9.4976, + "ca-central-1": 10.0608, + "ca-west-1": 10.0608, + "eu-central-1": 10.9568, + "eu-central-2": 11.9296, + "eu-north-1": 0.0, + "eu-south-1": 10.7008, + "eu-west-1": 10.2528, + "eu-west-2": 10.7008, + "eu-west-3": 10.7008, + "il-central-1": 10.704, + "me-central-1": 11.1552, + "me-south-1": 11.1552, + "mx-central-1": 9.696, + "sa-east-1": 14.0928, + "us-east-1": 9.2928, + "us-east-2": 9.2928, + "us-gov-east-1": 10.8928, + "us-gov-west-1": 10.8928, + "us-west-1": 10.1888, + "us-west-2": 9.2928 + }, + "r6i.2xlarge": { + "af-south-1": 0.7872, + "ap-east-1": 0.7832, + "ap-northeast-1": 0.784, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.7232, + "ap-south-1": 0.6872, + "ap-south-2": 0.6352, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.7192, + "ap-southeast-5": 0.632, + "ap-southeast-7": 0.632, + "ca-central-1": 0.0, + "ca-west-1": 0.7224, + "eu-central-1": 0.7232, + "eu-central-2": 0.85088, + "eu-north-1": 0.6512, + "eu-south-1": 0.7664, + "eu-west-1": 0.6792, + "eu-west-2": 0.7072, + "eu-west-3": 0.0, + "il-central-1": 0.76662, + "me-central-1": 0.7356, + "me-south-1": 0.7356, + "mx-central-1": 0.0, + "sa-east-1": 0.9996, + "us-east-1": 0.6192, + "us-east-2": 0.6696, + "us-gov-east-1": 0.7192, + "us-gov-west-1": 0.7192, + "us-west-1": 0.7312, + "us-west-2": 0.0 + }, + "r6i.4xlarge": { + "af-south-1": 1.5168, + "ap-east-1": 1.6424, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.3888, + "ap-northeast-3": 1.3888, + "ap-south-1": 1.2128, + "ap-south-2": 0.0, + "ap-southeast-1": 1.3888, + "ap-southeast-2": 1.5016, + "ap-southeast-5": 1.30976, + "ap-southeast-7": 1.30976, + "ca-central-1": 1.3872, + "ca-west-1": 0.0, + "eu-central-1": 1.3888, + "eu-central-2": 1.5104, + "eu-north-1": 1.2448, + "eu-south-1": 0.0, + "eu-west-1": 1.3008, + "eu-west-2": 1.3568, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 1.4136, + "me-south-1": 1.53768, + "mx-central-1": 1.2312, + "sa-east-1": 1.7808, + "us-east-1": 0.0, + "us-east-2": 1.1808, + "us-gov-east-1": 1.3808, + "us-gov-west-1": 1.3808, + "us-west-1": 0.0, + "us-west-2": 1.2816 + }, + "r6i.8xlarge": { + "af-south-1": 3.0336, + "ap-east-1": 0.0, + "ap-northeast-1": 2.7776, + "ap-northeast-2": 2.7776, + "ap-northeast-3": 0.0, + "ap-south-1": 2.4256, + "ap-south-2": 2.6336, + "ap-southeast-1": 2.7776, + "ap-southeast-2": 3.0032, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.61952, + "ca-central-1": 2.5536, + "ca-west-1": 0.0, + "eu-central-1": 2.7776, + "eu-central-2": 3.0208, + "eu-north-1": 2.4896, + "eu-south-1": 2.7136, + "eu-west-1": 2.6016, + "eu-west-2": 2.7136, + "eu-west-3": 2.9504, + "il-central-1": 0.0, + "me-central-1": 2.8272, + "me-south-1": 3.07536, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.5632, + "us-gov-east-1": 3.0032, + "us-gov-west-1": 2.7616, + "us-west-1": 0.0, + "us-west-2": 2.3616 + }, + "r6i.12xlarge": { + "af-south-1": 4.5504, + "ap-east-1": 0.0, + "ap-northeast-1": 4.5312, + "ap-northeast-2": 4.1664, + "ap-northeast-3": 0.0, + "ap-south-1": 3.6384, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.1424, + "ap-southeast-5": 3.92928, + "ap-southeast-7": 3.6192, + "ca-central-1": 0.0, + "ca-west-1": 3.8304, + "eu-central-1": 4.1664, + "eu-central-2": 4.93248, + "eu-north-1": 0.0, + "eu-south-1": 4.0704, + "eu-west-1": 3.9024, + "eu-west-2": 4.4256, + "eu-west-3": 4.0704, + "il-central-1": 4.0716, + "me-central-1": 4.2408, + "me-south-1": 4.2408, + "mx-central-1": 4.01112, + "sa-east-1": 5.3424, + "us-east-1": 3.5424, + "us-east-2": 3.8448, + "us-gov-east-1": 4.1424, + "us-gov-west-1": 0.0, + "us-west-1": 3.8784, + "us-west-2": 3.5424 + }, + "r6i.16xlarge": { + "af-south-1": 6.0672, + "ap-east-1": 0.0, + "ap-northeast-1": 6.0416, + "ap-northeast-2": 0.0, + "ap-northeast-3": 5.5552, + "ap-south-1": 4.8512, + "ap-south-2": 4.8512, + "ap-southeast-1": 5.5552, + "ap-southeast-2": 5.5232, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 5.1072, + "ca-west-1": 5.1072, + "eu-central-1": 5.5552, + "eu-central-2": 6.57664, + "eu-north-1": 4.9792, + "eu-south-1": 5.4272, + "eu-west-1": 5.2032, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 5.90256, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 4.9248, + "sa-east-1": 0.0, + "us-east-1": 4.7232, + "us-east-2": 4.7232, + "us-gov-east-1": 5.5232, + "us-gov-west-1": 5.5232, + "us-west-1": 5.6192, + "us-west-2": 4.7232 + }, + "r6i.24xlarge": { + "af-south-1": 9.1008, + "ap-east-1": 9.0528, + "ap-northeast-1": 0.0, + "ap-northeast-2": 8.3328, + "ap-northeast-3": 9.0624, + "ap-south-1": 7.2768, + "ap-south-2": 7.2768, + "ap-southeast-1": 8.3328, + "ap-southeast-2": 8.2848, + "ap-southeast-5": 7.2384, + "ap-southeast-7": 7.2384, + "ca-central-1": 7.6608, + "ca-west-1": 7.6608, + "eu-central-1": 9.0624, + "eu-central-2": 9.0624, + "eu-north-1": 7.4688, + "eu-south-1": 8.1408, + "eu-west-1": 8.4816, + "eu-west-2": 8.1408, + "eu-west-3": 8.1408, + "il-central-1": 8.1432, + "me-central-1": 8.4816, + "me-south-1": 8.4816, + "mx-central-1": 7.3872, + "sa-east-1": 0.0, + "us-east-1": 7.0848, + "us-east-2": 7.6896, + "us-gov-east-1": 8.2848, + "us-gov-west-1": 9.0096, + "us-west-1": 7.7568, + "us-west-2": 7.6896 + }, + "r6i.32xlarge": { + "af-south-1": 11.9808, + "ap-east-1": 11.9168, + "ap-northeast-1": 10.9568, + "ap-northeast-2": 0.0, + "ap-northeast-3": 10.9568, + "ap-south-1": 9.5488, + "ap-south-2": 9.5488, + "ap-southeast-1": 10.9568, + "ap-southeast-2": 0.0, + "ap-southeast-5": 9.4976, + "ap-southeast-7": 9.4976, + "ca-central-1": 0.0, + "ca-west-1": 10.0608, + "eu-central-1": 10.9568, + "eu-central-2": 11.9296, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 10.2528, + "eu-west-2": 10.7008, + "eu-west-3": 10.7008, + "il-central-1": 0.0, + "me-central-1": 11.1552, + "me-south-1": 11.1552, + "mx-central-1": 9.696, + "sa-east-1": 14.0928, + "us-east-1": 9.2928, + "us-east-2": 9.2928, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 10.1888, + "us-west-2": 9.2928 + }, + "r6id.large": { + "ap-northeast-1": 0.22977, + "ap-northeast-2": 0.2105, + "ap-south-1": 0.1874, + "ap-southeast-1": 0.2115, + "ap-southeast-2": 0.2028, + "ap-southeast-5": 0.19962, + "ap-southeast-7": 0.18409, + "ca-west-1": 0.0, + "eu-central-1": 0.21045, + "eu-west-1": 0.0, + "eu-west-2": 0.224, + "il-central-1": 0.0, + "mx-central-1": 0.18756, + "us-east-1": 0.18, + "us-east-2": 0.18, + "us-gov-west-1": 0.22867, + "us-west-2": 0.0 + }, + "r6id.xlarge": { + "ap-northeast-1": 0.423, + "ap-northeast-2": 0.421, + "ap-south-1": 0.3748, + "ap-southeast-1": 0.45954, + "ap-southeast-2": 0.4056, + "ap-southeast-5": 0.36818, + "ap-southeast-7": 0.0, + "ca-west-1": 0.3894, + "eu-central-1": 0.45723, + "eu-west-1": 0.4272, + "eu-west-2": 0.4125, + "il-central-1": 0.44568, + "mx-central-1": 0.37512, + "us-east-1": 0.36, + "us-east-2": 0.36, + "us-gov-west-1": 0.421, + "us-west-2": 0.36 + }, + "r6id.metal": { + "ap-northeast-1": 12.9216, + "ap-northeast-2": 0.0, + "ap-south-1": 11.3792, + "ap-southeast-1": 12.9216, + "ap-southeast-2": 12.3648, + "ap-southeast-5": 11.16736, + "ap-southeast-7": 11.16736, + "ca-west-1": 11.8464, + "eu-central-1": 12.8544, + "eu-west-1": 11.9808, + "eu-west-2": 12.5856, + "il-central-1": 12.5184, + "mx-central-1": 11.38944, + "us-east-1": 10.9056, + "us-east-2": 10.9056, + "us-gov-west-1": 12.8576, + "us-west-2": 10.9056 + }, + "r6id.2xlarge": { + "ap-northeast-1": 0.846, + "ap-northeast-2": 0.0, + "ap-south-1": 0.81304, + "ap-southeast-1": 0.846, + "ap-southeast-2": 0.8808, + "ap-southeast-5": 0.79848, + "ap-southeast-7": 0.73636, + "ca-west-1": 0.7788, + "eu-central-1": 0.91446, + "eu-west-1": 0.0, + "eu-west-2": 0.825, + "il-central-1": 0.8208, + "mx-central-1": 0.75024, + "us-east-1": 0.72, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 0.72 + }, + "r6id.4xlarge": { + "ap-northeast-1": 1.6344, + "ap-northeast-2": 0.0, + "ap-south-1": 1.56848, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.5648, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.41512, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 1.5168, + "eu-west-2": 1.5924, + "il-central-1": 0.0, + "mx-central-1": 1.44288, + "us-east-1": 1.50336, + "us-east-2": 1.3824, + "us-gov-west-1": 1.6264, + "us-west-2": 1.50336 + }, + "r6id.8xlarge": { + "ap-northeast-1": 3.2688, + "ap-northeast-2": 3.2528, + "ap-south-1": 3.13696, + "ap-southeast-1": 3.2688, + "ap-southeast-2": 3.408, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.83024, + "ca-west-1": 3.0, + "eu-central-1": 3.252, + "eu-west-1": 3.0336, + "eu-west-2": 0.0, + "il-central-1": 3.168, + "mx-central-1": 2.88576, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 2.7648 + }, + "r6id.12xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.8792, + "ap-south-1": 4.3248, + "ap-southeast-1": 4.9032, + "ap-southeast-2": 4.6944, + "ap-southeast-5": 4.61806, + "ap-southeast-7": 0.0, + "ca-west-1": 4.5, + "eu-central-1": 4.878, + "eu-west-1": 4.5504, + "eu-west-2": 0.0, + "il-central-1": 4.752, + "mx-central-1": 4.32864, + "us-east-1": 4.51008, + "us-east-2": 4.1472, + "us-gov-west-1": 4.8792, + "us-west-2": 4.51008 + }, + "r6id.16xlarge": { + "ap-northeast-1": 6.5376, + "ap-northeast-2": 6.5056, + "ap-south-1": 0.0, + "ap-southeast-1": 7.12224, + "ap-southeast-2": 6.816, + "ap-southeast-5": 6.15741, + "ap-southeast-7": 5.66048, + "ca-west-1": 6.0, + "eu-central-1": 6.504, + "eu-west-1": 6.0672, + "eu-west-2": 0.0, + "il-central-1": 6.90048, + "mx-central-1": 5.77152, + "us-east-1": 6.01344, + "us-east-2": 5.5296, + "us-gov-west-1": 6.5056, + "us-west-2": 5.5296 + }, + "r6id.24xlarge": { + "ap-northeast-1": 9.8064, + "ap-northeast-2": 9.7584, + "ap-south-1": 9.41088, + "ap-southeast-1": 10.68336, + "ap-southeast-2": 9.3888, + "ap-southeast-5": 8.49072, + "ap-southeast-7": 8.49072, + "ca-west-1": 9.79632, + "eu-central-1": 0.0, + "eu-west-1": 9.1008, + "eu-west-2": 9.5544, + "il-central-1": 0.0, + "mx-central-1": 9.41933, + "us-east-1": 9.02016, + "us-east-2": 8.2944, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "r6id.32xlarge": { + "ap-northeast-1": 12.9216, + "ap-northeast-2": 0.0, + "ap-south-1": 11.3792, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 11.16736, + "ap-southeast-7": 11.16736, + "ca-west-1": 11.8464, + "eu-central-1": 12.8544, + "eu-west-1": 11.9808, + "eu-west-2": 12.5856, + "il-central-1": 12.5184, + "mx-central-1": 0.0, + "us-east-1": 10.9056, + "us-east-2": 10.9056, + "us-gov-west-1": 12.8576, + "us-west-2": 10.9056 + }, + "r6idn.large": { + "ap-northeast-1": 0.29006, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.29135, + "eu-central-1": 0.26163, + "eu-north-1": 0.23589, + "eu-west-1": 0.24642, + "us-east-1": 0.22419, + "us-east-2": 0.0, + "us-gov-west-1": 0.26397, + "us-west-2": 0.24373 + }, + "r6idn.xlarge": { + "ap-northeast-1": 0.58012, + "ap-southeast-1": 0.5256, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.47178, + "eu-west-1": 0.49284, + "us-east-1": 0.44838, + "us-east-2": 0.44838, + "us-gov-west-1": 0.52794, + "us-west-2": 0.0 + }, + "r6idn.metal": { + "ap-northeast-1": 16.42944, + "ap-southeast-1": 16.2048, + "ap-southeast-2": 16.50432, + "eu-central-1": 16.12992, + "eu-north-1": 14.48256, + "eu-west-1": 15.15648, + "us-east-1": 0.0, + "us-east-2": 13.73376, + "us-gov-west-1": 0.0, + "us-west-2": 13.73376 + }, + "r6idn.2xlarge": { + "ap-northeast-1": 1.06524, + "ap-southeast-1": 1.0512, + "ap-southeast-2": 1.06992, + "eu-central-1": 1.04652, + "eu-north-1": 0.0, + "eu-west-1": 0.98568, + "us-east-1": 0.89676, + "us-east-2": 0.97492, + "us-gov-west-1": 1.05588, + "us-west-2": 0.89676 + }, + "r6idn.4xlarge": { + "ap-northeast-1": 2.07288, + "ap-southeast-1": 2.0448, + "ap-southeast-2": 0.0, + "eu-central-1": 2.03544, + "eu-north-1": 1.82952, + "eu-west-1": 0.0, + "us-east-1": 1.73592, + "us-east-2": 1.73592, + "us-gov-west-1": 2.05416, + "us-west-2": 1.73592 + }, + "r6idn.8xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.16448, + "eu-central-1": 4.44341, + "eu-north-1": 3.65904, + "eu-west-1": 3.82752, + "us-east-1": 3.47184, + "us-east-2": 3.47184, + "us-gov-west-1": 4.10832, + "us-west-2": 3.78446 + }, + "r6idn.12xlarge": { + "ap-northeast-1": 6.78866, + "ap-southeast-1": 6.696, + "ap-southeast-2": 6.81955, + "eu-central-1": 6.10632, + "eu-north-1": 0.0, + "eu-west-1": 6.26357, + "us-east-1": 5.20776, + "us-east-2": 5.20776, + "us-gov-west-1": 6.16248, + "us-west-2": 5.20776 + }, + "r6idn.16xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 8.1792, + "ap-southeast-2": 8.32896, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-west-1": 7.65504, + "us-east-1": 7.56893, + "us-east-2": 6.94368, + "us-gov-west-1": 8.21664, + "us-west-2": 6.94368 + }, + "r6idn.24xlarge": { + "ap-northeast-1": 12.43728, + "ap-southeast-1": 12.2688, + "ap-southeast-2": 0.0, + "eu-central-1": 12.21264, + "eu-north-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 10.41552, + "us-east-2": 0.0, + "us-gov-west-1": 12.32496, + "us-west-2": 10.41552 + }, + "r6idn.32xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 16.50432, + "eu-central-1": 16.12992, + "eu-north-1": 14.48256, + "eu-west-1": 15.15648, + "us-east-1": 13.73376, + "us-east-2": 13.73376, + "us-gov-west-1": 16.27968, + "us-west-2": 13.73376 + }, + "r6in.large": { + "ap-northeast-1": 0.26175, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.24057, + "eu-central-1": 0.23706, + "eu-north-1": 0.0, + "eu-west-1": 0.22419, + "us-east-1": 0.22056, + "us-east-2": 0.20313, + "us-gov-west-1": 0.23823, + "us-west-2": 0.22056 + }, + "r6in.xlarge": { + "ap-northeast-1": 0.48114, + "ap-southeast-1": 0.47412, + "ap-southeast-2": 0.48114, + "eu-central-1": 0.47412, + "eu-north-1": 0.0, + "eu-west-1": 0.44838, + "us-east-1": 0.40626, + "us-east-2": 0.40626, + "us-gov-west-1": 0.0, + "us-west-2": 0.44113 + }, + "r6in.metal": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 14.55744, + "ap-southeast-2": 14.78208, + "eu-central-1": 0.0, + "eu-north-1": 13.13472, + "eu-west-1": 13.73376, + "us-east-1": 12.38592, + "us-east-2": 12.38592, + "us-gov-west-1": 14.63232, + "us-west-2": 0.0 + }, + "r6in.2xlarge": { + "ap-northeast-1": 1.04699, + "ap-southeast-1": 1.03154, + "ap-southeast-2": 0.96228, + "eu-central-1": 0.94824, + "eu-north-1": 0.85932, + "eu-west-1": 0.0, + "us-east-1": 0.81252, + "us-east-2": 0.0, + "us-gov-west-1": 0.95292, + "us-west-2": 0.81252 + }, + "r6in.4xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 2.00549, + "ap-southeast-2": 1.86696, + "eu-central-1": 1.83888, + "eu-north-1": 1.66104, + "eu-west-1": 0.0, + "us-east-1": 1.56744, + "us-east-2": 1.56744, + "us-gov-west-1": 1.84824, + "us-west-2": 1.56744 + }, + "r6in.8xlarge": { + "ap-northeast-1": 3.73392, + "ap-southeast-1": 3.67776, + "ap-southeast-2": 3.73392, + "eu-central-1": 3.67776, + "eu-north-1": 3.32208, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 3.13488, + "us-gov-west-1": 0.0, + "us-west-2": 3.41381 + }, + "r6in.12xlarge": { + "ap-northeast-1": 5.60088, + "ap-southeast-1": 0.0, + "ap-southeast-2": 6.10913, + "eu-central-1": 5.51664, + "eu-north-1": 4.98312, + "eu-west-1": 0.0, + "us-east-1": 5.12071, + "us-east-2": 4.70232, + "us-gov-west-1": 6.04735, + "us-west-2": 0.0 + }, + "r6in.16xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 7.35552, + "ap-southeast-2": 7.46784, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-west-1": 6.94368, + "us-east-1": 6.26976, + "us-east-2": 6.82762, + "us-gov-west-1": 7.39296, + "us-west-2": 6.26976 + }, + "r6in.24xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 11.20176, + "eu-central-1": 11.03328, + "eu-north-1": 0.0, + "eu-west-1": 10.41552, + "us-east-1": 9.40464, + "us-east-2": 9.40464, + "us-gov-west-1": 11.08944, + "us-west-2": 0.0 + }, + "r6in.32xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 14.55744, + "ap-southeast-2": 14.78208, + "eu-central-1": 14.55744, + "eu-north-1": 13.13472, + "eu-west-1": 13.73376, + "us-east-1": 12.38592, + "us-east-2": 12.38592, + "us-gov-west-1": 0.0, + "us-west-2": 12.38592 + }, + "r7a.medium": { + "ap-northeast-1": 0.10617, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.09953, + "eu-west-1": 0.09953, + "us-east-1": 0.09808, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "r7a.large": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.21234, + "eu-north-1": 0.20678, + "eu-south-2": 0.19906, + "eu-west-1": 0.19906, + "us-east-1": 0.0, + "us-east-2": 0.18095, + "us-west-2": 0.19617 + }, + "r7a.xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.46139, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.39812, + "us-east-1": 0.3619, + "us-east-2": 0.3619, + "us-west-2": 0.3619 + }, + "r7a.metal-48xl": { + "ap-northeast-1": 19.46304, + "eu-central-1": 19.46304, + "eu-north-1": 17.376, + "eu-south-2": 18.18816, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 16.4496, + "us-west-2": 0.0 + }, + "r7a.2xlarge": { + "ap-northeast-1": 0.92278, + "eu-central-1": 0.84936, + "eu-north-1": 0.7624, + "eu-south-2": 0.79624, + "eu-west-1": 0.86434, + "us-east-1": 0.7238, + "us-east-2": 0.7238, + "us-west-2": 0.78466 + }, + "r7a.4xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 1.78795, + "eu-north-1": 1.4672, + "eu-south-2": 1.53488, + "eu-west-1": 1.53488, + "us-east-1": 0.0, + "us-east-2": 1.39, + "us-west-2": 1.51172 + }, + "r7a.8xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 3.28224, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.78, + "us-west-2": 0.0 + }, + "r7a.12xlarge": { + "ap-northeast-1": 4.92336, + "eu-central-1": 4.92336, + "eu-north-1": 4.4016, + "eu-south-2": 0.0, + "eu-west-1": 4.60464, + "us-east-1": 4.17, + "us-east-2": 4.17, + "us-west-2": 4.17 + }, + "r7a.16xlarge": { + "ap-northeast-1": 7.15181, + "eu-central-1": 6.56448, + "eu-north-1": 6.38656, + "eu-south-2": 6.13952, + "eu-west-1": 6.13952, + "us-east-1": 5.56, + "us-east-2": 5.56, + "us-west-2": 5.56 + }, + "r7a.24xlarge": { + "ap-northeast-1": 9.84672, + "eu-central-1": 9.84672, + "eu-north-1": 8.8032, + "eu-south-2": 9.20928, + "eu-west-1": 9.20928, + "us-east-1": 0.0, + "us-east-2": 8.34, + "us-west-2": 8.34 + }, + "r7a.32xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 11.584, + "eu-south-2": 12.12544, + "eu-west-1": 13.2151, + "us-east-1": 10.9664, + "us-east-2": 10.9664, + "us-west-2": 10.9664 + }, + "r7a.48xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 19.46304, + "eu-north-1": 17.376, + "eu-south-2": 18.18816, + "eu-west-1": 18.18816, + "us-east-1": 16.4496, + "us-east-2": 16.4496, + "us-west-2": 16.4496 + }, + "r7g.medium": { + "ap-east-1": 0.0854, + "ap-northeast-1": 0.079, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0519, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0826, + "ap-southeast-5": 0.0693, + "ap-southeast-7": 0.0693, + "ca-central-1": 0.0731, + "eu-central-1": 0.079, + "eu-north-1": 0.0714, + "eu-south-1": 0.0811, + "eu-south-2": 0.0743, + "eu-west-1": 0.0743, + "eu-west-2": 0.0773, + "me-south-1": 0.0, + "mx-central-1": 0.0742, + "sa-east-1": 0.0, + "us-east-1": 0.068, + "us-east-2": 0.068, + "us-west-1": 0.0, + "us-west-2": 0.068 + }, + "r7g.large": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.158, + "ap-northeast-2": 0.0, + "ap-south-1": 0.1039, + "ap-south-2": 0.0, + "ap-southeast-1": 0.1661, + "ap-southeast-2": 0.1572, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.1386, + "ca-central-1": 0.1461, + "eu-central-1": 0.158, + "eu-north-1": 0.1427, + "eu-south-1": 0.1543, + "eu-south-2": 0.1561, + "eu-west-1": 0.0, + "eu-west-2": 0.1546, + "me-south-1": 0.1606, + "mx-central-1": 0.1413, + "sa-east-1": 0.0, + "us-east-1": 0.1426, + "us-east-2": 0.1359, + "us-west-1": 0.1478, + "us-west-2": 0.1359 + }, + "r7g.xlarge": { + "ap-east-1": 0.3416, + "ap-northeast-1": 0.316, + "ap-northeast-2": 0.316, + "ap-south-1": 0.2172, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.3143, + "ap-southeast-5": 0.2772, + "ap-southeast-7": 0.2772, + "ca-central-1": 0.2922, + "eu-central-1": 0.3323, + "eu-north-1": 0.0, + "eu-south-1": 0.3245, + "eu-south-2": 0.2972, + "eu-west-1": 0.2973, + "eu-west-2": 0.3092, + "me-south-1": 0.0, + "mx-central-1": 0.2825, + "sa-east-1": 0.3985, + "us-east-1": 0.2853, + "us-east-2": 0.0, + "us-west-1": 0.2956, + "us-west-2": 0.2718 + }, + "r7g.metal": { + "ap-east-1": 5.2352, + "ap-northeast-1": 4.8256, + "ap-northeast-2": 4.8256, + "ap-south-1": 3.0938, + "ap-south-2": 3.0938, + "ap-southeast-1": 4.8256, + "ap-southeast-2": 4.7987, + "ap-southeast-5": 4.2054, + "ap-southeast-7": 4.2054, + "ca-central-1": 4.4448, + "eu-central-1": 4.8256, + "eu-north-1": 4.336, + "eu-south-1": 4.7073, + "eu-south-2": 0.0, + "eu-west-1": 4.5264, + "eu-west-2": 0.0, + "me-south-1": 4.9099, + "mx-central-1": 0.0, + "sa-east-1": 6.1453, + "us-east-1": 4.1184, + "us-east-2": 4.1184, + "us-west-1": 0.0, + "us-west-2": 4.1184 + }, + "r7g.2xlarge": { + "ap-east-1": 0.6832, + "ap-northeast-1": 0.632, + "ap-northeast-2": 0.6645, + "ap-south-1": 0.4155, + "ap-south-2": 0.4155, + "ap-southeast-1": 0.632, + "ap-southeast-2": 0.6286, + "ap-southeast-5": 0.5545, + "ap-southeast-7": 0.5822, + "ca-central-1": 0.614, + "eu-central-1": 0.0, + "eu-north-1": 0.5981, + "eu-south-1": 0.6489, + "eu-south-2": 0.0, + "eu-west-1": 0.5946, + "eu-west-2": 0.6184, + "me-south-1": 0.6425, + "mx-central-1": 0.5934, + "sa-east-1": 0.797, + "us-east-1": 0.5706, + "us-east-2": 0.5706, + "us-west-1": 0.6212, + "us-west-2": 0.0 + }, + "r7g.4xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 1.2064, + "ap-northeast-2": 1.2064, + "ap-south-1": 0.7734, + "ap-south-2": 0.7734, + "ap-southeast-1": 1.2715, + "ap-southeast-2": 1.1997, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.0514, + "ca-central-1": 1.1705, + "eu-central-1": 1.2064, + "eu-north-1": 1.084, + "eu-south-1": 0.0, + "eu-south-2": 1.1312, + "eu-west-1": 0.0, + "eu-west-2": 1.1792, + "me-south-1": 0.0, + "mx-central-1": 1.0725, + "sa-east-1": 1.5363, + "us-east-1": 1.0296, + "us-east-2": 1.0296, + "us-west-1": 1.1248, + "us-west-2": 1.0836 + }, + "r7g.8xlarge": { + "ap-east-1": 2.6176, + "ap-northeast-1": 2.4128, + "ap-northeast-2": 0.0, + "ap-south-1": 1.5469, + "ap-south-2": 1.5469, + "ap-southeast-1": 2.4128, + "ap-southeast-2": 2.5286, + "ap-southeast-5": 2.1027, + "ap-southeast-7": 2.1027, + "ca-central-1": 2.2224, + "eu-central-1": 0.0, + "eu-north-1": 2.168, + "eu-south-1": 2.4805, + "eu-south-2": 2.2624, + "eu-west-1": 0.0, + "eu-west-2": 2.3584, + "me-south-1": 0.0, + "mx-central-1": 2.2583, + "sa-east-1": 3.0726, + "us-east-1": 0.0, + "us-east-2": 2.1672, + "us-west-1": 2.2496, + "us-west-2": 2.0592 + }, + "r7g.12xlarge": { + "ap-east-1": 3.9264, + "ap-northeast-1": 3.6192, + "ap-northeast-2": 3.6192, + "ap-south-1": 0.0, + "ap-south-2": 2.3203, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.599, + "ap-southeast-5": 3.1541, + "ap-southeast-7": 3.1541, + "ca-central-1": 3.5114, + "eu-central-1": 3.6192, + "eu-north-1": 3.252, + "eu-south-1": 0.0, + "eu-south-2": 3.5748, + "eu-west-1": 3.3948, + "eu-west-2": 3.5376, + "me-south-1": 3.6824, + "mx-central-1": 3.2174, + "sa-east-1": 4.8671, + "us-east-1": 3.0888, + "us-east-2": 3.0888, + "us-west-1": 3.3744, + "us-west-2": 3.0888 + }, + "r7g.16xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 4.8256, + "ap-northeast-2": 4.8256, + "ap-south-1": 3.0938, + "ap-south-2": 3.0938, + "ap-southeast-1": 4.8256, + "ap-southeast-2": 4.7987, + "ap-southeast-5": 4.2054, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 4.8256, + "eu-north-1": 4.336, + "eu-south-1": 4.7073, + "eu-south-2": 4.5248, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "me-south-1": 4.9099, + "mx-central-1": 4.2899, + "sa-east-1": 6.1453, + "us-east-1": 4.1184, + "us-east-2": 0.0, + "us-west-1": 4.4992, + "us-west-2": 4.1184 + }, + "r7gd.medium": { + "ap-east-1": 0.0971, + "ap-northeast-1": 0.0966, + "ap-south-1": 0.0584, + "ap-southeast-1": 0.0966, + "ap-southeast-2": 0.0974, + "ap-southeast-3": 0.0966, + "ap-southeast-5": 0.0843, + "ap-southeast-7": 0.0843, + "eu-central-1": 0.0961, + "eu-north-1": 0.0862, + "eu-south-2": 0.0945, + "eu-west-1": 0.0945, + "me-central-1": 0.1025, + "mx-central-1": 0.0858, + "us-east-1": 0.0, + "us-east-2": 0.0865, + "us-gov-east-1": 0.0961, + "us-gov-west-1": 0.0962, + "us-west-1": 0.0909, + "us-west-2": 0.0865 + }, + "r7gd.large": { + "ap-east-1": 0.1942, + "ap-northeast-1": 0.1932, + "ap-south-1": 0.0, + "ap-southeast-1": 0.2031, + "ap-southeast-2": 0.1854, + "ap-southeast-3": 0.2031, + "ap-southeast-5": 0.1686, + "ap-southeast-7": 0.1769, + "eu-central-1": 0.2021, + "eu-north-1": 0.1724, + "eu-south-2": 0.18, + "eu-west-1": 0.0, + "me-central-1": 0.1951, + "mx-central-1": 0.1802, + "us-east-1": 0.0, + "us-east-2": 0.173, + "us-gov-east-1": 0.2021, + "us-gov-west-1": 0.1923, + "us-west-1": 0.1819, + "us-west-2": 0.1649 + }, + "r7gd.xlarge": { + "ap-east-1": 0.4082, + "ap-northeast-1": 0.3865, + "ap-south-1": 0.2336, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.3371, + "ap-southeast-7": 0.3371, + "eu-central-1": 0.3846, + "eu-north-1": 0.0, + "eu-south-2": 0.36, + "eu-west-1": 0.3781, + "me-central-1": 0.4102, + "mx-central-1": 0.3434, + "us-east-1": 0.3298, + "us-east-2": 0.3298, + "us-gov-east-1": 0.3846, + "us-gov-west-1": 0.3847, + "us-west-1": 0.3638, + "us-west-2": 0.3298 + }, + "r7gd.metal": { + "ap-east-1": 5.9834, + "ap-northeast-1": 5.953, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 5.1635, + "eu-central-1": 5.9227, + "eu-north-1": 5.2877, + "eu-south-2": 5.5296, + "eu-west-1": 5.5296, + "me-central-1": 0.0, + "mx-central-1": 5.2634, + "us-east-1": 5.0458, + "us-east-2": 5.0458, + "us-gov-east-1": 5.9226, + "us-gov-west-1": 5.9245, + "us-west-1": 5.5901, + "us-west-2": 5.0458 + }, + "r7gd.2xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.8124, + "ap-south-1": 0.4672, + "ap-southeast-1": 0.8124, + "ap-southeast-2": 0.7416, + "ap-southeast-3": 0.7729, + "ap-southeast-5": 0.7078, + "ap-southeast-7": 0.6742, + "eu-central-1": 0.7691, + "eu-north-1": 0.6898, + "eu-south-2": 0.72, + "eu-west-1": 0.72, + "me-central-1": 0.0, + "mx-central-1": 0.6867, + "us-east-1": 0.6595, + "us-east-2": 0.6921, + "us-gov-east-1": 0.7691, + "us-gov-west-1": 0.7694, + "us-west-1": 0.7276, + "us-west-2": 0.6595 + }, + "r7gd.4xlarge": { + "ap-east-1": 1.4958, + "ap-northeast-1": 0.0, + "ap-south-1": 0.8768, + "ap-southeast-1": 1.4882, + "ap-southeast-2": 1.5008, + "ap-southeast-3": 1.4882, + "ap-southeast-5": 1.358, + "ap-southeast-7": 1.2909, + "eu-central-1": 0.0, + "eu-north-1": 1.3909, + "eu-south-2": 1.3824, + "eu-west-1": 1.3824, + "me-central-1": 1.5034, + "mx-central-1": 1.3158, + "us-east-1": 1.2614, + "us-east-2": 1.3266, + "us-gov-east-1": 1.4806, + "us-gov-west-1": 1.4811, + "us-west-1": 1.3975, + "us-west-2": 1.2614 + }, + "r7gd.8xlarge": { + "ap-east-1": 2.9917, + "ap-northeast-1": 0.0, + "ap-south-1": 1.7536, + "ap-southeast-1": 2.9765, + "ap-southeast-2": 2.8512, + "ap-southeast-3": 0.0, + "ap-southeast-5": 2.5818, + "ap-southeast-7": 2.5818, + "eu-central-1": 2.9614, + "eu-north-1": 2.6438, + "eu-south-2": 2.7648, + "eu-west-1": 2.7648, + "me-central-1": 3.0067, + "mx-central-1": 2.6317, + "us-east-1": 2.5229, + "us-east-2": 2.5229, + "us-gov-east-1": 2.9613, + "us-gov-west-1": 0.0, + "us-west-1": 2.795, + "us-west-2": 2.6532 + }, + "r7gd.12xlarge": { + "ap-east-1": 4.4875, + "ap-northeast-1": 4.4647, + "ap-south-1": 2.6304, + "ap-southeast-1": 4.4647, + "ap-southeast-2": 0.0, + "ap-southeast-3": 4.4645, + "ap-southeast-5": 3.8726, + "ap-southeast-7": 4.0739, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 4.3649, + "eu-west-1": 4.3649, + "me-central-1": 4.5101, + "mx-central-1": 3.9475, + "us-east-1": 3.7843, + "us-east-2": 3.9798, + "us-gov-east-1": 4.4419, + "us-gov-west-1": 4.4434, + "us-west-1": 0.0, + "us-west-2": 3.7843 + }, + "r7gd.16xlarge": { + "ap-east-1": 5.9834, + "ap-northeast-1": 5.953, + "ap-south-1": 0.0, + "ap-southeast-1": 5.953, + "ap-southeast-2": 5.7024, + "ap-southeast-3": 0.0, + "ap-southeast-5": 5.1635, + "ap-southeast-7": 5.1635, + "eu-central-1": 0.0, + "eu-north-1": 5.2877, + "eu-south-2": 5.5296, + "eu-west-1": 5.5296, + "me-central-1": 6.0134, + "mx-central-1": 5.2634, + "us-east-1": 5.0458, + "us-east-2": 5.0458, + "us-gov-east-1": 5.9226, + "us-gov-west-1": 0.0, + "us-west-1": 5.5901, + "us-west-2": 5.0458 + }, + "r7i.large": { + "ap-northeast-1": 0.1884, + "ap-northeast-2": 0.20436, + "ap-south-1": 0.1653, + "ap-southeast-1": 0.1884, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.20436, + "ap-southeast-5": 0.16446, + "ap-southeast-7": 0.16446, + "ca-central-1": 0.1737, + "eu-central-1": 0.1884, + "eu-north-1": 0.0, + "eu-south-1": 0.1842, + "eu-south-2": 0.17685, + "eu-west-1": 0.17685, + "eu-west-2": 0.19974, + "eu-west-3": 0.1842, + "mx-central-1": 0.16772, + "sa-east-1": 0.23985, + "us-east-1": 0.17433, + "us-east-2": 0.17433, + "us-gov-east-1": 0.20321, + "us-gov-west-1": 0.18735, + "us-west-1": 0.1758, + "us-west-2": 0.1611 + }, + "r7i.xlarge": { + "ap-northeast-1": 0.3768, + "ap-northeast-2": 0.3768, + "ap-south-1": 0.3579, + "ap-southeast-1": 0.3768, + "ap-southeast-2": 0.3747, + "ap-southeast-3": 0.40872, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.32892, + "ca-central-1": 0.37638, + "eu-central-1": 0.0, + "eu-north-1": 0.339, + "eu-south-1": 0.39948, + "eu-south-2": 0.38331, + "eu-west-1": 0.3537, + "eu-west-2": 0.3684, + "eu-west-3": 0.3684, + "mx-central-1": 0.36322, + "sa-east-1": 0.4797, + "us-east-1": 0.3222, + "us-east-2": 0.3222, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.3747, + "us-west-1": 0.3516, + "us-west-2": 0.3222 + }, + "r7i.metal-24xl": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 8.6976, + "ap-south-1": 7.5888, + "ap-southeast-1": 8.6976, + "ap-southeast-2": 9.40824, + "ap-southeast-3": 8.6976, + "ap-southeast-5": 7.54848, + "ap-southeast-7": 8.19965, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 7.7904, + "eu-south-1": 8.496, + "eu-south-2": 8.1432, + "eu-west-1": 8.85384, + "eu-west-2": 8.496, + "eu-west-3": 8.496, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 7.3872, + "us-east-2": 0.0, + "us-gov-east-1": 8.6472, + "us-gov-west-1": 8.6472, + "us-west-1": 0.0, + "us-west-2": 7.3872 + }, + "r7i.metal-48xl": { + "ap-northeast-1": 17.1648, + "ap-northeast-2": 17.1648, + "ap-south-1": 14.9472, + "ap-southeast-1": 17.1648, + "ap-southeast-2": 0.0, + "ap-southeast-3": 17.1648, + "ap-southeast-5": 14.86656, + "ap-southeast-7": 14.86656, + "ca-central-1": 15.7536, + "eu-central-1": 17.1648, + "eu-north-1": 15.3504, + "eu-south-1": 16.7616, + "eu-south-2": 16.056, + "eu-west-1": 16.056, + "eu-west-2": 16.7616, + "eu-west-3": 16.7616, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 14.544, + "us-east-2": 14.544, + "us-gov-east-1": 17.064, + "us-gov-west-1": 17.064, + "us-west-1": 15.9552, + "us-west-2": 14.544 + }, + "r7i.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 0.7158, + "ap-southeast-1": 0.7536, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.65784, + "ap-southeast-7": 0.65784, + "ca-central-1": 0.6948, + "eu-central-1": 0.7536, + "eu-north-1": 0.0, + "eu-south-1": 0.7368, + "eu-south-2": 0.7074, + "eu-west-1": 0.7074, + "eu-west-2": 0.7368, + "eu-west-3": 0.7368, + "mx-central-1": 0.67088, + "sa-east-1": 0.9594, + "us-east-1": 0.6444, + "us-east-2": 0.6444, + "us-gov-east-1": 0.7494, + "us-gov-west-1": 0.7494, + "us-west-1": 0.0, + "us-west-2": 0.6444 + }, + "r7i.4xlarge": { + "ap-northeast-1": 1.4496, + "ap-northeast-2": 1.4496, + "ap-south-1": 1.2648, + "ap-southeast-1": 1.4496, + "ap-southeast-2": 1.56804, + "ap-southeast-3": 1.57728, + "ap-southeast-5": 1.25808, + "ap-southeast-7": 1.25808, + "ca-central-1": 1.332, + "eu-central-1": 1.4496, + "eu-north-1": 1.2984, + "eu-south-1": 1.54032, + "eu-south-2": 1.47564, + "eu-west-1": 1.3572, + "eu-west-2": 1.416, + "eu-west-3": 1.416, + "mx-central-1": 1.3953, + "sa-east-1": 1.8612, + "us-east-1": 1.33704, + "us-east-2": 1.2312, + "us-gov-east-1": 1.4412, + "us-gov-west-1": 1.4412, + "us-west-1": 1.4664, + "us-west-2": 1.33704 + }, + "r7i.8xlarge": { + "ap-northeast-1": 2.8992, + "ap-northeast-2": 3.15456, + "ap-south-1": 2.5296, + "ap-southeast-1": 2.8992, + "ap-southeast-2": 2.8824, + "ap-southeast-3": 3.15456, + "ap-southeast-5": 2.51616, + "ap-southeast-7": 2.51616, + "ca-central-1": 2.664, + "eu-central-1": 3.15456, + "eu-north-1": 0.0, + "eu-south-1": 3.08064, + "eu-south-2": 2.95128, + "eu-west-1": 2.95128, + "eu-west-2": 3.08064, + "eu-west-3": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 3.7224, + "us-east-1": 2.4624, + "us-east-2": 2.4624, + "us-gov-east-1": 2.8824, + "us-gov-west-1": 0.0, + "us-west-1": 2.6976, + "us-west-2": 0.0 + }, + "r7i.12xlarge": { + "ap-northeast-1": 4.3488, + "ap-northeast-2": 0.0, + "ap-south-1": 3.7944, + "ap-southeast-1": 4.3488, + "ap-southeast-2": 4.3236, + "ap-southeast-3": 4.3488, + "ap-southeast-5": 3.77424, + "ap-southeast-7": 4.09982, + "ca-central-1": 3.996, + "eu-central-1": 4.3488, + "eu-north-1": 3.8952, + "eu-south-1": 4.248, + "eu-south-2": 4.42692, + "eu-west-1": 4.0716, + "eu-west-2": 4.248, + "eu-west-3": 4.62096, + "mx-central-1": 3.85248, + "sa-east-1": 5.5836, + "us-east-1": 3.6936, + "us-east-2": 0.0, + "us-gov-east-1": 4.3236, + "us-gov-west-1": 4.3236, + "us-west-1": 4.0464, + "us-west-2": 3.6936 + }, + "r7i.16xlarge": { + "ap-northeast-1": 6.30912, + "ap-northeast-2": 5.7984, + "ap-south-1": 0.0, + "ap-southeast-1": 5.7984, + "ap-southeast-2": 0.0, + "ap-southeast-3": 5.7984, + "ap-southeast-5": 5.03232, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 6.30912, + "eu-north-1": 0.0, + "eu-south-1": 6.16128, + "eu-south-2": 5.4288, + "eu-west-1": 5.90256, + "eu-west-2": 0.0, + "eu-west-3": 6.16128, + "mx-central-1": 5.13664, + "sa-east-1": 8.12016, + "us-east-1": 4.9248, + "us-east-2": 4.9248, + "us-gov-east-1": 6.27216, + "us-gov-west-1": 6.27216, + "us-west-1": 0.0, + "us-west-2": 4.9248 + }, + "r7i.24xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 9.46368, + "ap-south-1": 7.5888, + "ap-southeast-1": 9.46368, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 7.54848, + "ca-central-1": 0.0, + "eu-central-1": 8.6976, + "eu-north-1": 8.46576, + "eu-south-1": 8.496, + "eu-south-2": 8.1432, + "eu-west-1": 8.85384, + "eu-west-2": 8.496, + "eu-west-3": 8.496, + "mx-central-1": 7.70496, + "sa-east-1": 12.18024, + "us-east-1": 7.3872, + "us-east-2": 8.02224, + "us-gov-east-1": 9.40824, + "us-gov-west-1": 8.6472, + "us-west-1": 8.0928, + "us-west-2": 8.02224 + }, + "r7i.48xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 17.1648, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 17.064, + "ap-southeast-3": 17.1648, + "ap-southeast-5": 14.86656, + "ap-southeast-7": 14.86656, + "ca-central-1": 15.7536, + "eu-central-1": 17.1648, + "eu-north-1": 15.3504, + "eu-south-1": 16.7616, + "eu-south-2": 16.056, + "eu-west-1": 16.056, + "eu-west-2": 0.0, + "eu-west-3": 16.7616, + "mx-central-1": 15.17952, + "sa-east-1": 0.0, + "us-east-1": 14.544, + "us-east-2": 14.544, + "us-gov-east-1": 17.064, + "us-gov-west-1": 17.064, + "us-west-1": 15.9552, + "us-west-2": 14.544 + }, + "r7iz.large": { + "ap-northeast-1": 0.2558, + "eu-central-1": 0.2538, + "eu-west-1": 0.2368, + "us-east-1": 0.2148, + "us-east-2": 0.2148, + "us-west-2": 0.2148 + }, + "r7iz.xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.4736, + "us-east-1": 0.4296, + "us-east-2": 0.4296, + "us-west-2": 0.4668 + }, + "r7iz.metal-16xl": { + "ap-northeast-1": 7.9552, + "eu-central-1": 0.0, + "eu-west-1": 7.3472, + "us-east-1": 7.2384, + "us-east-2": 6.6432, + "us-west-2": 0.0 + }, + "r7iz.metal-32xl": { + "ap-northeast-1": 15.7568, + "eu-central-1": 0.0, + "eu-west-1": 14.5408, + "us-east-1": 14.3232, + "us-east-2": 0.0, + "us-west-2": 13.1328 + }, + "r7iz.2xlarge": { + "ap-northeast-1": 1.0232, + "eu-central-1": 1.0152, + "eu-west-1": 0.9472, + "us-east-1": 0.9336, + "us-east-2": 0.8592, + "us-west-2": 0.8592 + }, + "r7iz.4xlarge": { + "ap-northeast-1": 2.1704, + "eu-central-1": 1.9728, + "eu-west-1": 1.8368, + "us-east-1": 1.6608, + "us-east-2": 1.6608, + "us-west-2": 1.8096 + }, + "r7iz.8xlarge": { + "ap-northeast-1": 3.9776, + "eu-central-1": 4.3056, + "eu-west-1": 3.6736, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 3.3216 + }, + "r7iz.12xlarge": { + "ap-northeast-1": 5.9664, + "eu-central-1": 6.4584, + "eu-west-1": 6.0096, + "us-east-1": 4.9824, + "us-east-2": 0.0, + "us-west-2": 4.9824 + }, + "r7iz.16xlarge": { + "ap-northeast-1": 7.9552, + "eu-central-1": 7.8912, + "eu-west-1": 0.0, + "us-east-1": 6.6432, + "us-east-2": 0.0, + "us-west-2": 6.6432 + }, + "r7iz.32xlarge": { + "ap-northeast-1": 15.7568, + "eu-central-1": 17.0688, + "eu-west-1": 15.872, + "us-east-1": 13.1328, + "us-east-2": 13.1328, + "us-west-2": 13.1328 + }, + "r8g.medium": { + "ap-northeast-1": 0.08546, + "ap-south-1": 0.05569, + "ap-southeast-2": 0.085, + "eu-central-1": 0.08546, + "eu-north-1": 0.08331, + "eu-south-2": 0.08029, + "eu-west-1": 0.08032, + "us-east-1": 0.07331, + "us-east-2": 0.07331, + "us-west-2": 0.07331 + }, + "r8g.large": { + "ap-northeast-1": 0.18513, + "ap-south-1": 0.11964, + "ap-southeast-2": 0.17, + "eu-central-1": 0.17092, + "eu-north-1": 0.15409, + "eu-south-2": 0.16058, + "eu-west-1": 0.16064, + "us-east-1": 0.1584, + "us-east-2": 0.14662, + "us-west-2": 0.14662 + }, + "r8g.xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.0, + "ap-southeast-2": 0.34, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.32116, + "eu-west-1": 0.0, + "us-east-1": 0.3168, + "us-east-2": 0.29324, + "us-west-2": 0.3168 + }, + "r8g.metal-24xl": { + "ap-northeast-1": 7.85856, + "ap-south-1": 0.0, + "ap-southeast-2": 7.8144, + "eu-central-1": 7.85856, + "eu-north-1": 7.05072, + "eu-south-2": 7.36224, + "eu-west-1": 7.99795, + "us-east-1": 6.69216, + "us-east-2": 7.2577, + "us-west-2": 6.69216 + }, + "r8g.metal-48xl": { + "ap-northeast-1": 15.48672, + "ap-south-1": 9.77088, + "ap-southeast-2": 15.3984, + "eu-central-1": 15.48672, + "eu-north-1": 0.0, + "eu-south-2": 14.49408, + "eu-west-1": 14.49984, + "us-east-1": 13.15392, + "us-east-2": 13.15392, + "us-west-2": 13.15392 + }, + "r8g.2xlarge": { + "ap-northeast-1": 0.68368, + "ap-south-1": 0.0, + "ap-southeast-2": 0.68, + "eu-central-1": 0.68368, + "eu-north-1": 0.61636, + "eu-south-2": 0.64232, + "eu-west-1": 0.0, + "us-east-1": 0.58648, + "us-east-2": 0.58648, + "us-west-2": 0.58648 + }, + "r8g.4xlarge": { + "ap-northeast-1": 1.30976, + "ap-south-1": 0.83344, + "ap-southeast-2": 1.3024, + "eu-central-1": 1.30976, + "eu-north-1": 1.17512, + "eu-south-2": 1.22704, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 1.11536 + }, + "r8g.8xlarge": { + "ap-northeast-1": 2.84691, + "ap-south-1": 1.66688, + "ap-southeast-2": 2.6048, + "eu-central-1": 0.0, + "eu-north-1": 2.35024, + "eu-south-2": 0.0, + "eu-west-1": 2.45504, + "us-east-1": 2.23072, + "us-east-2": 2.23072, + "us-west-2": 2.23072 + }, + "r8g.12xlarge": { + "ap-northeast-1": 3.92928, + "ap-south-1": 2.50032, + "ap-southeast-2": 3.9072, + "eu-central-1": 3.92928, + "eu-north-1": 3.52536, + "eu-south-2": 3.68112, + "eu-west-1": 3.68256, + "us-east-1": 3.34608, + "us-east-2": 3.34608, + "us-west-2": 0.0 + }, + "r8g.16xlarge": { + "ap-northeast-1": 5.23904, + "ap-south-1": 3.33376, + "ap-southeast-2": 5.66144, + "eu-central-1": 5.69382, + "eu-north-1": 0.0, + "eu-south-2": 4.90816, + "eu-west-1": 5.33197, + "us-east-1": 4.46144, + "us-east-2": 0.0, + "us-west-2": 4.46144 + }, + "r8g.24xlarge": { + "ap-northeast-1": 7.85856, + "ap-south-1": 0.0, + "ap-southeast-2": 7.8144, + "eu-central-1": 7.85856, + "eu-north-1": 7.05072, + "eu-south-2": 7.36224, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 7.2577, + "us-west-2": 6.69216 + }, + "r8g.48xlarge": { + "ap-northeast-1": 15.48672, + "ap-south-1": 9.77088, + "ap-southeast-2": 15.3984, + "eu-central-1": 15.48672, + "eu-north-1": 13.87104, + "eu-south-2": 14.49408, + "eu-west-1": 14.49984, + "us-east-1": 13.15392, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "t1.micro": { + "ap-northeast-1": 0.04, + "ap-southeast-1": 0.03, + "ap-southeast-2": 0.03, + "eu-west-1": 0.03, + "sa-east-1": 0.041, + "us-east-1": 0.03, + "us-gov-west-1": 0.038, + "us-west-1": 0.039, + "us-west-2": 0.03 + }, + "t2.micro": { + "ap-northeast-1": 0.0296, + "ap-northeast-2": 0.0288, + "ap-northeast-3": 0.0296, + "ap-south-1": 0.0, + "ap-southeast-1": 0.029, + "ap-southeast-2": 0.029, + "ca-central-1": 0.0272, + "eu-central-1": 0.0278, + "eu-west-1": 0.027, + "eu-west-2": 0.0276, + "eu-west-3": 0.0276, + "sa-east-1": 0.033, + "us-east-1": 0.026, + "us-east-2": 0.026, + "us-gov-west-1": 0.028, + "us-west-1": 0.0282, + "us-west-2": 0.026 + }, + "t2.small": { + "ap-northeast-1": 0.0448, + "ap-northeast-2": 0.0432, + "ap-northeast-3": 0.0448, + "ap-south-1": 0.0392, + "ap-southeast-1": 0.0436, + "ap-southeast-2": 0.0436, + "ca-central-1": 0.04, + "eu-central-1": 0.0412, + "eu-west-1": 0.0396, + "eu-west-2": 0.0408, + "eu-west-3": 0.0408, + "sa-east-1": 0.0516, + "us-east-1": 0.0376, + "us-east-2": 0.0376, + "us-gov-west-1": 0.0416, + "us-west-1": 0.042, + "us-west-2": 0.0376 + }, + "t2.medium": { + "ap-northeast-1": 0.0896, + "ap-northeast-2": 0.0864, + "ap-northeast-3": 0.0896, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0872, + "ap-southeast-2": 0.0872, + "ca-central-1": 0.08, + "eu-central-1": 0.0824, + "eu-west-1": 0.0792, + "eu-west-2": 0.0816, + "eu-west-3": 0.0816, + "sa-east-1": 0.1032, + "us-east-1": 0.0752, + "us-east-2": 0.0752, + "us-gov-west-1": 0.0832, + "us-west-1": 0.084, + "us-west-2": 0.0752 + }, + "t2.large": { + "ap-northeast-1": 0.1504, + "ap-northeast-2": 0.144, + "ap-northeast-3": 0.1504, + "ap-south-1": 0.0, + "ap-southeast-1": 0.1456, + "ap-southeast-2": 0.1456, + "ca-central-1": 0.1312, + "eu-central-1": 0.136, + "eu-west-1": 0.1296, + "eu-west-2": 0.1344, + "eu-west-3": 0.1344, + "sa-east-1": 0.1776, + "us-east-1": 0.1216, + "us-east-2": 0.1216, + "us-gov-west-1": 0.1376, + "us-west-1": 0.1392, + "us-west-2": 0.1216 + }, + "t2.xlarge": { + "ap-northeast-1": 0.3008, + "ap-northeast-2": 0.288, + "ap-northeast-3": 0.3008, + "ap-south-1": 0.256, + "ap-southeast-1": 0.2912, + "ap-southeast-2": 0.2912, + "ca-central-1": 0.2624, + "eu-central-1": 0.272, + "eu-west-1": 0.2592, + "eu-west-2": 0.2688, + "eu-west-3": 0.2688, + "sa-east-1": 0.3552, + "us-east-1": 0.2432, + "us-east-2": 0.2432, + "us-gov-west-1": 0.2752, + "us-west-1": 0.2784, + "us-west-2": 0.2432 + }, + "t2.2xlarge": { + "ap-northeast-1": 0.6016, + "ap-northeast-2": 0.576, + "ap-northeast-3": 0.6016, + "ap-south-1": 0.512, + "ap-southeast-1": 0.5824, + "ap-southeast-2": 0.5824, + "ca-central-1": 0.5248, + "eu-central-1": 0.544, + "eu-west-1": 0.5184, + "eu-west-2": 0.5376, + "eu-west-3": 0.5376, + "sa-east-1": 0.7104, + "us-east-1": 0.4864, + "us-east-2": 0.4864, + "us-gov-west-1": 0.5504, + "us-west-1": 0.5568, + "us-west-2": 0.4864 + }, + "t3.micro": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0432, + "ap-northeast-2": 0.0425, + "ap-northeast-3": 0.0, + "ap-south-1": 0.04, + "ap-south-2": 0.04, + "ap-southeast-1": 0.0428, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.042, + "ap-southeast-4": 0.042, + "ap-southeast-5": 0.0407, + "ap-southeast-7": 0.0407, + "ca-central-1": 0.0404, + "ca-west-1": 0.0411, + "eu-central-1": 0.0408, + "eu-central-2": 0.0, + "eu-north-1": 0.0396, + "eu-south-1": 0.0408, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0406, + "eu-west-3": 0.0406, + "il-central-1": 0.0408, + "me-central-1": 0.0413, + "me-south-1": 0.0, + "mx-central-1": 0.0397, + "sa-east-1": 0.0456, + "us-east-1": 0.0392, + "us-east-2": 0.0, + "us-gov-east-1": 0.041, + "us-gov-west-1": 0.0, + "us-west-1": 0.0412, + "us-west-2": 0.0398, + "us-west-2-lax-1": 0.0413 + }, + "t3.small": { + "af-south-1": 0.0575, + "ap-east-1": 0.0, + "ap-northeast-1": 0.056, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.056, + "ap-south-1": 0.0512, + "ap-south-2": 0.0512, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0552, + "ap-southeast-3": 0.0552, + "ap-southeast-4": 0.0568, + "ap-southeast-5": 0.0526, + "ap-southeast-7": 0.0526, + "ca-central-1": 0.052, + "ca-west-1": 0.052, + "eu-central-1": 0.0528, + "eu-central-2": 0.0552, + "eu-north-1": 0.0504, + "eu-south-1": 0.0542, + "eu-south-2": 0.0516, + "eu-west-1": 0.0, + "eu-west-2": 0.0524, + "eu-west-3": 0.0524, + "il-central-1": 0.0528, + "me-central-1": 0.0539, + "me-south-1": 0.0539, + "mx-central-1": 0.0506, + "sa-east-1": 0.0, + "us-east-1": 0.0508, + "us-east-2": 0.0496, + "us-gov-east-1": 0.0532, + "us-gov-west-1": 0.0532, + "us-west-1": 0.0536, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0538 + }, + "t3.medium": { + "af-south-1": 0.083, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0832, + "ap-northeast-2": 0.0808, + "ap-northeast-3": 0.0832, + "ap-south-1": 0.0736, + "ap-south-2": 0.0736, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0848, + "ap-southeast-3": 0.0816, + "ap-southeast-4": 0.0848, + "ap-southeast-5": 0.0763, + "ap-southeast-7": 0.0763, + "ca-central-1": 0.0752, + "ca-west-1": 0.0, + "eu-central-1": 0.0768, + "eu-central-2": 0.0816, + "eu-north-1": 0.0, + "eu-south-1": 0.0767, + "eu-south-2": 0.0744, + "eu-west-1": 0.0744, + "eu-west-2": 0.076, + "eu-west-3": 0.0788, + "il-central-1": 0.0796, + "me-central-1": 0.079, + "me-south-1": 0.079, + "mx-central-1": 0.0725, + "sa-east-1": 0.096, + "us-east-1": 0.0704, + "us-east-2": 0.0, + "us-gov-east-1": 0.0776, + "us-gov-west-1": 0.0805, + "us-west-1": 0.0784, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0787 + }, + "t3.large": { + "af-south-1": 0.0, + "ap-east-1": 0.1456, + "ap-northeast-1": 0.1376, + "ap-northeast-2": 0.1388, + "ap-northeast-3": 0.0, + "ap-south-1": 0.1184, + "ap-south-2": 0.1184, + "ap-southeast-1": 0.1344, + "ap-southeast-2": 0.1344, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.1344, + "ap-southeast-5": 0.1238, + "ap-southeast-7": 0.1238, + "ca-central-1": 0.1216, + "ca-west-1": 0.1216, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.1152, + "eu-south-1": 0.1246, + "eu-south-2": 0.12, + "eu-west-1": 0.12, + "eu-west-2": 0.1289, + "eu-west-3": 0.0, + "il-central-1": 0.1304, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 0.1162, + "sa-east-1": 0.0, + "us-east-1": 0.112, + "us-east-2": 0.112, + "us-gov-east-1": 0.1264, + "us-gov-west-1": 0.1323, + "us-west-1": 0.128, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.1286 + }, + "t3.xlarge": { + "af-south-1": 0.2746, + "ap-east-1": 0.0, + "ap-northeast-1": 0.2752, + "ap-northeast-2": 0.2656, + "ap-northeast-3": 0.2752, + "ap-south-1": 0.2368, + "ap-south-2": 0.2368, + "ap-southeast-1": 0.2688, + "ap-southeast-2": 0.2815, + "ap-southeast-3": 0.2688, + "ap-southeast-4": 0.2688, + "ap-southeast-5": 0.2477, + "ap-southeast-7": 0.2477, + "ca-central-1": 0.2432, + "ca-west-1": 0.2432, + "eu-central-1": 0.2496, + "eu-central-2": 0.0, + "eu-north-1": 0.2304, + "eu-south-1": 0.2608, + "eu-south-2": 0.24, + "eu-west-1": 0.24, + "eu-west-2": 0.2577, + "eu-west-3": 0.2464, + "il-central-1": 0.2608, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 0.2323, + "sa-east-1": 0.3264, + "us-east-1": 0.2339, + "us-east-2": 0.224, + "us-gov-east-1": 0.2528, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.224, + "us-west-2-lax-1": 0.2573 + }, + "t3.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.5504, + "ap-northeast-2": 0.5312, + "ap-northeast-3": 0.5504, + "ap-south-1": 0.4736, + "ap-south-2": 0.0, + "ap-southeast-1": 0.5376, + "ap-southeast-2": 0.5629, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.5376, + "ap-southeast-5": 0.4954, + "ap-southeast-7": 0.4954, + "ca-central-1": 0.0, + "ca-west-1": 0.4864, + "eu-central-1": 0.4992, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.48, + "eu-west-2": 0.5155, + "eu-west-3": 0.0, + "il-central-1": 0.4986, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 0.4646, + "sa-east-1": 0.6528, + "us-east-1": 0.4679, + "us-east-2": 0.4679, + "us-gov-east-1": 0.5056, + "us-gov-west-1": 0.5056, + "us-west-1": 0.512, + "us-west-2": 0.4679, + "us-west-2-lax-1": 0.5146 + }, + "t3a.micro": { + "ap-northeast-1": 0.041, + "ap-northeast-2": 0.0405, + "ap-south-1": 0.035, + "ap-southeast-1": 0.0406, + "ap-southeast-2": 0.0407, + "ca-central-1": 0.0392, + "eu-central-1": 0.0396, + "eu-south-1": 0.0396, + "eu-west-1": 0.039, + "eu-west-2": 0.0394, + "eu-west-3": 0.0394, + "il-central-1": 0.0395, + "sa-east-1": 0.0439, + "us-east-1": 0.0382, + "us-east-2": 0.0382, + "us-gov-east-1": 0.0398, + "us-gov-west-1": 0.0398, + "us-west-1": 0.04, + "us-west-2": 0.0382 + }, + "t3a.small": { + "ap-northeast-1": 0.0533, + "ap-northeast-2": 0.0522, + "ap-south-1": 0.0411, + "ap-southeast-1": 0.0524, + "ap-southeast-2": 0.0526, + "ca-central-1": 0.0497, + "eu-central-1": 0.0504, + "eu-south-1": 0.0504, + "eu-west-1": 0.0492, + "eu-west-2": 0.05, + "eu-west-3": 0.05, + "il-central-1": 0.0502, + "sa-east-1": 0.059, + "us-east-1": 0.0476, + "us-east-2": 0.0476, + "us-gov-east-1": 0.0508, + "us-gov-west-1": 0.0508, + "us-west-1": 0.0511, + "us-west-2": 0.0476 + }, + "t3a.medium": { + "ap-northeast-1": 0.0778, + "ap-northeast-2": 0.0756, + "ap-south-1": 0.0534, + "ap-southeast-1": 0.076, + "ap-southeast-2": 0.0763, + "ca-central-1": 0.0706, + "eu-central-1": 0.072, + "eu-south-1": 0.0719, + "eu-west-1": 0.0696, + "eu-west-2": 0.0713, + "eu-west-3": 0.0713, + "il-central-1": 0.0717, + "sa-east-1": 0.0893, + "us-east-1": 0.0664, + "us-east-2": 0.0664, + "us-gov-east-1": 0.0727, + "us-gov-west-1": 0.0727, + "us-west-1": 0.0734, + "us-west-2": 0.0664 + }, + "t3a.large": { + "ap-northeast-1": 0.1267, + "ap-northeast-2": 0.1224, + "ap-south-1": 0.0781, + "ap-southeast-1": 0.1232, + "ap-southeast-2": 0.1238, + "ca-central-1": 0.1123, + "eu-central-1": 0.1152, + "eu-south-1": 0.115, + "eu-west-1": 0.1104, + "eu-west-2": 0.1138, + "eu-west-3": 0.1138, + "il-central-1": 0.1146, + "sa-east-1": 0.1498, + "us-east-1": 0.104, + "us-east-2": 0.104, + "us-gov-east-1": 0.1166, + "us-gov-west-1": 0.1166, + "us-west-1": 0.1181, + "us-west-2": 0.104 + }, + "t3a.xlarge": { + "ap-northeast-1": 0.2534, + "ap-northeast-2": 0.2448, + "ap-south-1": 0.1562, + "ap-southeast-1": 0.2464, + "ap-southeast-2": 0.2477, + "ca-central-1": 0.2246, + "eu-central-1": 0.2304, + "eu-south-1": 0.2301, + "eu-west-1": 0.2208, + "eu-west-2": 0.2275, + "eu-west-3": 0.2275, + "il-central-1": 0.2291, + "sa-east-1": 0.2995, + "us-east-1": 0.208, + "us-east-2": 0.208, + "us-gov-east-1": 0.2333, + "us-gov-west-1": 0.2333, + "us-west-1": 0.2362, + "us-west-2": 0.208 + }, + "t3a.2xlarge": { + "ap-northeast-1": 0.5069, + "ap-northeast-2": 0.4896, + "ap-south-1": 0.3123, + "ap-southeast-1": 0.4928, + "ap-southeast-2": 0.4954, + "ca-central-1": 0.4493, + "eu-central-1": 0.4608, + "eu-south-1": 0.4602, + "eu-west-1": 0.4416, + "eu-west-2": 0.455, + "eu-west-3": 0.455, + "il-central-1": 0.4582, + "sa-east-1": 0.599, + "us-east-1": 0.416, + "us-east-2": 0.416, + "us-gov-east-1": 0.4666, + "us-gov-west-1": 0.4666, + "us-west-1": 0.4723, + "us-west-2": 0.416 + }, + "t4g.micro": { + "af-south-1": 0.0396, + "ap-east-1": 0.0404, + "ap-northeast-1": 0.0396, + "ap-northeast-2": 0.0392, + "ap-northeast-3": 0.0397, + "ap-south-1": 0.0344, + "ap-south-2": 0.0344, + "ap-southeast-1": 0.0394, + "ap-southeast-2": 0.0394, + "ap-southeast-3": 0.0394, + "ap-southeast-4": 0.0394, + "ap-southeast-5": 0.0383, + "ap-southeast-7": 0.0383, + "ca-central-1": 0.038, + "ca-west-1": 0.038, + "eu-central-1": 0.0384, + "eu-central-2": 0.0394, + "eu-north-1": 0.0374, + "eu-south-1": 0.0384, + "eu-south-2": 0.038, + "eu-west-1": 0.038, + "eu-west-2": 0.0382, + "eu-west-3": 0.0382, + "il-central-1": 0.0385, + "me-central-1": 0.039, + "me-south-1": 0.0388, + "mx-central-1": 0.0376, + "sa-east-1": 0.0422, + "us-east-1": 0.0372, + "us-east-2": 0.0372, + "us-gov-east-1": 0.0386, + "us-gov-west-1": 0.0386, + "us-west-1": 0.0388, + "us-west-2": 0.0372 + }, + "t4g.small": { + "af-south-1": 0.0505, + "ap-east-1": 0.052, + "ap-northeast-1": 0.0504, + "ap-northeast-2": 0.0496, + "ap-northeast-3": 0.0506, + "ap-south-1": 0.04, + "ap-south-2": 0.04, + "ap-southeast-1": 0.05, + "ap-southeast-2": 0.05, + "ap-southeast-3": 0.05, + "ap-southeast-4": 0.05, + "ap-southeast-5": 0.0479, + "ap-southeast-7": 0.0479, + "ca-central-1": 0.0472, + "ca-west-1": 0.0472, + "eu-central-1": 0.048, + "eu-central-2": 0.0499, + "eu-north-1": 0.046, + "eu-south-1": 0.048, + "eu-south-2": 0.0472, + "eu-west-1": 0.0472, + "eu-west-2": 0.0476, + "eu-west-3": 0.0476, + "il-central-1": 0.0481, + "me-central-1": 0.0492, + "me-south-1": 0.0489, + "mx-central-1": 0.0464, + "sa-east-1": 0.0556, + "us-east-1": 0.0456, + "us-east-2": 0.0456, + "us-gov-east-1": 0.0484, + "us-gov-west-1": 0.0484, + "us-west-1": 0.0488, + "us-west-2": 0.0456 + }, + "t4g.medium": { + "af-south-1": 0.0722, + "ap-east-1": 0.0752, + "ap-northeast-1": 0.072, + "ap-northeast-2": 0.0704, + "ap-northeast-3": 0.0723, + "ap-south-1": 0.0512, + "ap-south-2": 0.0512, + "ap-southeast-1": 0.0712, + "ap-southeast-2": 0.0712, + "ap-southeast-3": 0.0712, + "ap-southeast-4": 0.0712, + "ap-southeast-5": 0.067, + "ap-southeast-7": 0.067, + "ca-central-1": 0.0656, + "ca-west-1": 0.0656, + "eu-central-1": 0.0672, + "eu-central-2": 0.071, + "eu-north-1": 0.0632, + "eu-south-1": 0.0672, + "eu-south-2": 0.0656, + "eu-west-1": 0.0656, + "eu-west-2": 0.0664, + "eu-west-3": 0.0664, + "il-central-1": 0.0674, + "me-central-1": 0.0696, + "me-south-1": 0.069, + "mx-central-1": 0.0641, + "sa-east-1": 0.0824, + "us-east-1": 0.0624, + "us-east-2": 0.0624, + "us-gov-east-1": 0.068, + "us-gov-west-1": 0.068, + "us-west-1": 0.0688, + "us-west-2": 0.0624 + }, + "t4g.large": { + "af-south-1": 0.1155, + "ap-east-1": 0.1216, + "ap-northeast-1": 0.1152, + "ap-northeast-2": 0.112, + "ap-northeast-3": 0.1158, + "ap-south-1": 0.0736, + "ap-south-2": 0.0736, + "ap-southeast-1": 0.1136, + "ap-southeast-2": 0.1136, + "ap-southeast-3": 0.1136, + "ap-southeast-4": 0.1136, + "ap-southeast-5": 0.1051, + "ap-southeast-7": 0.1051, + "ca-central-1": 0.1024, + "ca-west-1": 0.1024, + "eu-central-1": 0.1056, + "eu-central-2": 0.1133, + "eu-north-1": 0.0976, + "eu-south-1": 0.1056, + "eu-south-2": 0.1024, + "eu-west-1": 0.1024, + "eu-west-2": 0.104, + "eu-west-3": 0.104, + "il-central-1": 0.1061, + "me-central-1": 0.1104, + "me-south-1": 0.1091, + "mx-central-1": 0.0994, + "sa-east-1": 0.136, + "us-east-1": 0.096, + "us-east-2": 0.096, + "us-gov-east-1": 0.1072, + "us-gov-west-1": 0.1072, + "us-west-1": 0.1088, + "us-west-2": 0.096 + }, + "t4g.xlarge": { + "af-south-1": 0.231, + "ap-east-1": 0.2432, + "ap-northeast-1": 0.2304, + "ap-northeast-2": 0.224, + "ap-northeast-3": 0.2317, + "ap-south-1": 0.1472, + "ap-south-2": 0.1472, + "ap-southeast-1": 0.2272, + "ap-southeast-2": 0.2272, + "ap-southeast-3": 0.2272, + "ap-southeast-4": 0.2272, + "ap-southeast-5": 0.2102, + "ap-southeast-7": 0.2102, + "ca-central-1": 0.2048, + "ca-west-1": 0.2048, + "eu-central-1": 0.2112, + "eu-central-2": 0.2266, + "eu-north-1": 0.1952, + "eu-south-1": 0.2112, + "eu-south-2": 0.2048, + "eu-west-1": 0.2048, + "eu-west-2": 0.208, + "eu-west-3": 0.208, + "il-central-1": 0.2122, + "me-central-1": 0.2208, + "me-south-1": 0.2182, + "mx-central-1": 0.1987, + "sa-east-1": 0.272, + "us-east-1": 0.192, + "us-east-2": 0.192, + "us-gov-east-1": 0.2144, + "us-gov-west-1": 0.2144, + "us-west-1": 0.2176, + "us-west-2": 0.192 + }, + "t4g.2xlarge": { + "af-south-1": 0.4621, + "ap-east-1": 0.4864, + "ap-northeast-1": 0.4608, + "ap-northeast-2": 0.448, + "ap-northeast-3": 0.4634, + "ap-south-1": 0.2944, + "ap-south-2": 0.2944, + "ap-southeast-1": 0.4544, + "ap-southeast-2": 0.4544, + "ap-southeast-3": 0.4544, + "ap-southeast-4": 0.4544, + "ap-southeast-5": 0.4205, + "ap-southeast-7": 0.4205, + "ca-central-1": 0.4096, + "ca-west-1": 0.4096, + "eu-central-1": 0.4224, + "eu-central-2": 0.4531, + "eu-north-1": 0.3904, + "eu-south-1": 0.4224, + "eu-south-2": 0.4096, + "eu-west-1": 0.4096, + "eu-west-2": 0.416, + "eu-west-3": 0.416, + "il-central-1": 0.4243, + "me-central-1": 0.4416, + "me-south-1": 0.4365, + "mx-central-1": 0.3974, + "sa-east-1": 0.544, + "us-east-1": 0.384, + "us-east-2": 0.384, + "us-gov-east-1": 0.4288, + "us-gov-west-1": 0.4288, + "us-west-1": 0.4352, + "us-west-2": 0.384 + }, + "trn1.2xlarge": { + "us-east-1": 1.45895, + "us-east-2": 1.45895, + "us-west-2": 1.45895 + }, + "trn1.32xlarge": { + "us-east-1": 22.7288, + "us-east-2": 22.7288, + "us-west-2": 22.7288 + }, + "trn1n.32xlarge": { + "us-east-1": 26.0088, + "us-east-2": 26.0088, + "us-west-2": 26.0088 + }, + "trn2.48xlarge": { + "us-east-2": 87.8072 + }, + "u7i-6tb.112xlarge": { + "ap-northeast-2": 0.0, + "us-east-1": 67.0908, + "us-west-2": 67.0908 + }, + "u7i-8tb.112xlarge": { + "ap-northeast-2": 105.29686, + "us-east-1": 88.0208 + }, + "u7i-12tb.224xlarge": { + "us-east-1": 161.4816, + "us-west-2": 0.0 + }, + "u7in-16tb.224xlarge": { + "ap-northeast-2": 254.5036, + "ap-southeast-2": 0.0, + "us-east-1": 212.4416, + "us-west-2": 212.4416 + }, + "u7in-24tb.224xlarge": { + "us-east-1": 314.3616, + "us-gov-west-1": 375.0236, + "us-west-2": 314.3616 + }, + "u7in-32tb.224xlarge": { + "us-east-1": 416.2816, + "us-west-2": 416.2816 + }, + "u-3tb1.56xlarge": { + "ap-east-1": 38.37725, + "ap-northeast-1": 35.0837, + "ap-southeast-1": 35.0804, + "ap-southeast-2": 34.8654, + "ca-central-1": 32.0504, + "eu-central-1": 35.0839, + "eu-central-2": 38.37725, + "eu-south-1": 34.2279, + "eu-west-1": 32.7004, + "sa-east-1": 45.7004, + "us-east-1": 29.4504, + "us-east-2": 29.4504, + "us-gov-west-1": 34.8669, + "us-west-2": 29.4504 + }, + "u-6tb1.metal": { + "ap-northeast-1": 4.301, + "ap-northeast-2": 4.301, + "ap-south-1": 4.301, + "ap-southeast-1": 4.301, + "ap-southeast-2": 4.301, + "ap-southeast-3": 4.301, + "ca-central-1": 4.301, + "eu-central-1": 4.301, + "eu-central-2": 4.301, + "eu-north-1": 4.301, + "eu-south-1": 4.301, + "eu-south-2": 4.301, + "eu-west-1": 4.301, + "eu-west-2": 4.301, + "eu-west-3": 4.301, + "sa-east-1": 4.301, + "us-east-1": 4.301, + "us-east-2": 4.301, + "us-gov-east-1": 4.301, + "us-gov-west-1": 4.301, + "us-west-2": 4.301 + }, + "u-6tb1.56xlarge": { + "af-south-1": 63.94494, + "ap-northeast-1": 58.13, + "ap-northeast-2": 2.1504, + "ap-northeast-3": 2.1504, + "ap-south-1": 2.1504, + "ap-southeast-1": 2.1504, + "ap-southeast-2": 2.1504, + "ap-southeast-3": 58.13, + "ca-central-1": 2.1504, + "eu-central-1": 58.13, + "eu-central-2": 2.1504, + "eu-north-1": 2.1504, + "eu-south-1": 56.67499, + "eu-south-2": 54.07858, + "eu-west-1": 54.07858, + "eu-west-2": 2.1504, + "eu-west-3": 56.65629, + "sa-east-1": 2.1504, + "us-east-1": 2.1504, + "us-east-2": 2.1504, + "us-gov-east-1": 57.76115, + "us-gov-west-1": 2.1504, + "us-west-2": 2.1504 + }, + "u-6tb1.112xlarge": { + "af-south-1": 4.3008, + "ap-northeast-1": 4.3008, + "ap-northeast-2": 4.3008, + "ap-northeast-3": 70.1678, + "ap-south-1": 60.6338, + "ap-southeast-1": 4.3008, + "ap-southeast-2": 69.7338, + "ap-southeast-3": 4.3008, + "ca-central-1": 4.3008, + "eu-central-1": 4.3008, + "eu-central-2": 4.3008, + "eu-north-1": 4.3008, + "eu-south-1": 68.4558, + "eu-south-2": 4.3008, + "eu-west-1": 4.3008, + "eu-west-2": 4.3008, + "eu-west-3": 4.3008, + "sa-east-1": 4.3008, + "us-east-1": 58.9008, + "us-east-2": 4.3008, + "us-gov-east-1": 4.3008, + "us-gov-west-1": 69.7338, + "us-west-2": 58.9008 + }, + "u-9tb1.metal": { + "ap-northeast-1": 4.301, + "ap-northeast-2": 4.301, + "ap-south-1": 4.301, + "ap-south-2": 4.301, + "ap-southeast-1": 4.301, + "eu-central-1": 4.301, + "eu-north-1": 4.301, + "eu-west-1": 4.301, + "eu-west-2": 4.301, + "eu-west-3": 4.301, + "sa-east-1": 4.301, + "us-east-1": 4.301, + "us-east-2": 4.301, + "us-gov-east-1": 4.301, + "us-gov-west-1": 4.301, + "us-west-2": 4.301 + }, + "u-9tb1.112xlarge": { + "ap-northeast-1": 4.3008, + "ap-northeast-2": 103.1008, + "ap-south-1": 88.8008, + "ap-south-2": 4.3008, + "ap-southeast-1": 4.3008, + "eu-central-1": 103.1008, + "eu-north-1": 4.3008, + "eu-west-1": 95.9508, + "eu-west-2": 4.3008, + "eu-west-3": 100.5008, + "sa-east-1": 4.3008, + "us-east-1": 86.2008, + "us-east-2": 86.2008, + "us-gov-east-1": 102.4508, + "us-gov-west-1": 102.4508, + "us-west-2": 4.3008 + }, + "u-12tb1.metal": { + "af-south-1": 4.301, + "ap-northeast-1": 4.301, + "ap-northeast-2": 4.301, + "ap-northeast-3": 4.301, + "ap-south-1": 4.301, + "ap-southeast-1": 4.301, + "ap-southeast-2": 4.301, + "eu-central-1": 4.301, + "eu-south-1": 4.301, + "eu-west-1": 4.301, + "sa-east-1": 4.301, + "us-east-1": 4.301, + "us-east-2": 4.301, + "us-gov-east-1": 4.301, + "us-gov-west-1": 4.301, + "us-west-2": 4.301 + }, + "u-12tb1.112xlarge": { + "af-south-1": 149.7188, + "ap-northeast-1": 4.3008, + "ap-northeast-2": 4.3008, + "ap-northeast-3": 4.3008, + "ap-south-1": 4.3008, + "ap-southeast-1": 136.0338, + "ap-southeast-2": 4.3008, + "eu-central-1": 136.0338, + "eu-south-1": 132.6108, + "eu-west-1": 126.5008, + "sa-east-1": 4.3008, + "us-east-1": 4.3008, + "us-east-2": 4.3008, + "us-gov-east-1": 4.3008, + "us-gov-west-1": 4.3008, + "us-west-2": 4.3008 + }, + "u-18tb1.metal": { + "eu-central-1": 4.301, + "eu-west-1": 4.301, + "sa-east-1": 4.301, + "us-east-1": 4.301, + "us-west-2": 4.301 + }, + "u-18tb1.112xlarge": { + "eu-central-1": 4.3008, + "eu-west-1": 4.3008, + "sa-east-1": 265.6008, + "us-east-1": 4.3008, + "us-west-2": 4.3008 + }, + "u-24tb1.metal": { + "ap-northeast-2": 4.301, + "us-east-1": 4.301, + "us-gov-east-1": 4.301, + "us-gov-west-1": 4.301, + "us-west-2": 4.301 + }, + "u-24tb1.112xlarge": { + "ap-northeast-2": 267.7708, + "us-east-1": 4.3008, + "us-gov-east-1": 266.0308, + "us-gov-west-1": 266.0308, + "us-west-2": 222.7008 + }, + "vt1.3xlarge": { + "ap-northeast-1": 0.94784, + "eu-west-1": 0.86372, + "us-east-1": 0.7796, + "us-west-2": 0.7796 + }, + "vt1.6xlarge": { + "ap-northeast-1": 2.05932, + "eu-west-1": 1.87426, + "us-east-1": 1.5592, + "us-west-2": 1.5592 + }, + "vt1.24xlarge": { + "ap-northeast-1": 7.58268, + "eu-west-1": 6.90974, + "us-east-1": 6.2368, + "us-west-2": 6.2368 + }, + "x1.16xlarge": { + "af-south-1": 10.215, + "ap-east-1": 0.0, + "ap-northeast-1": 10.362, + "ap-northeast-2": 10.362, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 10.362, + "ap-southeast-2": 10.362, + "ca-central-1": 0.0, + "eu-central-1": 10.028, + "eu-west-1": 8.694, + "eu-west-2": 9.094, + "eu-west-3": 9.935, + "sa-east-1": 13.696, + "us-east-1": 7.36, + "us-east-2": 7.36, + "us-gov-east-1": 8.694, + "us-gov-west-1": 0.0, + "us-west-2": 7.36 + }, + "x1.32xlarge": { + "af-south-1": 20.277, + "ap-east-1": 22.505, + "ap-northeast-1": 20.571, + "ap-northeast-2": 20.571, + "ap-northeast-3": 20.571, + "ap-south-1": 14.991, + "ap-southeast-1": 20.571, + "ap-southeast-2": 20.571, + "ca-central-1": 15.901, + "eu-central-1": 19.903, + "eu-west-1": 17.235, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 27.239, + "us-east-1": 14.567, + "us-east-2": 14.567, + "us-gov-east-1": 17.235, + "us-gov-west-1": 0.0, + "us-west-2": 14.567 + }, + "x1e.xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 1.267, + "ap-northeast-2": 1.388, + "ap-northeast-3": 1.267, + "ap-south-1": 0.918, + "ap-southeast-1": 1.388, + "ap-southeast-2": 1.267, + "ca-central-1": 1.066, + "eu-central-1": 1.341, + "eu-west-1": 0.0, + "sa-east-1": 1.683, + "us-east-1": 0.892, + "us-east-2": 0.975, + "us-gov-east-1": 1.058, + "us-gov-west-1": 1.058, + "us-west-2": 0.892 + }, + "x1e.2xlarge": { + "af-south-1": 2.733, + "ap-northeast-1": 2.775, + "ap-northeast-2": 2.533, + "ap-northeast-3": 2.533, + "ap-south-1": 1.835, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.533, + "ca-central-1": 1.949, + "eu-central-1": 2.449, + "eu-west-1": 2.115, + "sa-east-1": 3.366, + "us-east-1": 1.783, + "us-east-2": 1.783, + "us-gov-east-1": 2.315, + "us-gov-west-1": 2.115, + "us-west-2": 0.0 + }, + "x1e.4xlarge": { + "af-south-1": 5.409, + "ap-northeast-1": 5.009, + "ap-northeast-2": 5.492, + "ap-northeast-3": 5.009, + "ap-south-1": 3.613, + "ap-southeast-1": 5.009, + "ap-southeast-2": 5.492, + "ca-central-1": 4.207, + "eu-central-1": 5.308, + "eu-west-1": 4.573, + "sa-east-1": 6.675, + "us-east-1": 3.509, + "us-east-2": 3.509, + "us-gov-east-1": 4.173, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "x1e.8xlarge": { + "af-south-1": 9.866, + "ap-northeast-1": 0.0, + "ap-northeast-2": 10.985, + "ap-northeast-3": 10.985, + "ap-south-1": 7.226, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 7.68, + "eu-central-1": 9.682, + "eu-west-1": 8.346, + "sa-east-1": 13.35, + "us-east-1": 0.0, + "us-east-2": 7.018, + "us-gov-east-1": 8.346, + "us-gov-west-1": 8.346, + "us-west-2": 7.018 + }, + "x1e.16xlarge": { + "af-south-1": 19.731, + "ap-northeast-1": 21.97, + "ap-northeast-2": 0.0, + "ap-northeast-3": 21.97, + "ap-south-1": 14.451, + "ap-southeast-1": 21.97, + "ap-southeast-2": 20.035, + "ca-central-1": 15.36, + "eu-central-1": 19.363, + "eu-west-1": 18.291, + "sa-east-1": 26.701, + "us-east-1": 14.035, + "us-east-2": 14.035, + "us-gov-east-1": 16.691, + "us-gov-west-1": 16.691, + "us-west-2": 14.035 + }, + "x1e.32xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 39.917, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 28.749, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 30.566, + "eu-central-1": 0.0, + "eu-west-1": 33.229, + "sa-east-1": 53.248, + "us-east-1": 27.917, + "us-east-2": 27.917, + "us-gov-east-1": 33.229, + "us-gov-west-1": 33.229, + "us-west-2": 27.917 + }, + "x2gd.medium": { + "eu-west-1": 0.1244, + "us-east-1": 0.0979, + "us-east-2": 0.1063, + "us-west-2": 0.0979 + }, + "x2gd.large": { + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.2125, + "us-west-2": 0.1958 + }, + "x2gd.xlarge": { + "eu-west-1": 0.4576, + "us-east-1": 0.425, + "us-east-2": 0.3916, + "us-west-2": 0.425 + }, + "x2gd.metal": { + "eu-west-1": 7.0912, + "us-east-1": 0.0, + "us-east-2": 6.0352, + "us-west-2": 6.0352 + }, + "x2gd.2xlarge": { + "eu-west-1": 0.9952, + "us-east-1": 0.85, + "us-east-2": 0.85, + "us-west-2": 0.7832 + }, + "x2gd.4xlarge": { + "eu-west-1": 0.0, + "us-east-1": 1.6424, + "us-east-2": 0.0, + "us-west-2": 1.5088 + }, + "x2gd.8xlarge": { + "eu-west-1": 3.5456, + "us-east-1": 3.0176, + "us-east-2": 3.2848, + "us-west-2": 0.0 + }, + "x2gd.12xlarge": { + "eu-west-1": 5.3184, + "us-east-1": 4.5264, + "us-east-2": 0.0, + "us-west-2": 4.9272 + }, + "x2gd.16xlarge": { + "eu-west-1": 7.0912, + "us-east-1": 6.0352, + "us-east-2": 6.5696, + "us-west-2": 6.0352 + }, + "x2idn.metal": { + "af-south-1": 20.2768, + "ap-northeast-1": 20.5698, + "ap-northeast-2": 20.5698, + "ap-northeast-3": 20.5708, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 20.5698, + "ap-southeast-2": 20.5698, + "ap-southeast-3": 20.5698, + "ap-southeast-5": 18.6357, + "ap-southeast-7": 18.6357, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 21.7702, + "eu-north-1": 16.4398, + "eu-south-1": 18.0298, + "eu-south-2": 17.2348, + "eu-west-1": 17.2348, + "eu-west-2": 18.0348, + "eu-west-3": 18.0348, + "me-central-1": 17.6368, + "me-south-1": 0.0, + "sa-east-1": 27.2388, + "us-east-1": 14.5668, + "us-east-2": 0.0, + "us-gov-east-1": 17.2348, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "x2idn.16xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 11.32875, + "ap-northeast-2": 10.3617, + "ap-northeast-3": 11.3293, + "ap-south-1": 8.2603, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-5": 10.265, + "ap-southeast-7": 0.0, + "ca-central-1": 8.0272, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 8.2967, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 9.9345, + "eu-west-3": 9.0942, + "me-central-1": 8.8952, + "me-south-1": 8.8952, + "sa-east-1": 13.6962, + "us-east-1": 7.3602, + "us-east-2": 7.3602, + "us-gov-east-1": 8.6942, + "us-gov-west-1": 8.6942, + "us-west-1": 9.3612, + "us-west-2": 7.3602 + }, + "x2idn.24xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 16.99313, + "ap-northeast-2": 15.54255, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 11.3583, + "ap-southeast-1": 0.0, + "ap-southeast-2": 16.99313, + "ap-southeast-3": 15.54255, + "ap-southeast-5": 14.09198, + "ap-southeast-7": 14.09198, + "ca-central-1": 12.0408, + "eu-central-1": 16.44285, + "eu-central-2": 17.98346, + "eu-north-1": 13.58588, + "eu-south-1": 13.63755, + "eu-south-2": 0.0, + "eu-west-1": 13.0413, + "eu-west-2": 13.6413, + "eu-west-3": 13.6413, + "me-central-1": 13.3428, + "me-south-1": 14.5734, + "sa-east-1": 20.5443, + "us-east-1": 11.0403, + "us-east-2": 11.0403, + "us-gov-east-1": 13.0413, + "us-gov-west-1": 0.0, + "us-west-1": 14.0418, + "us-west-2": 11.0403 + }, + "x2idn.32xlarge": { + "af-south-1": 20.2768, + "ap-northeast-1": 20.5698, + "ap-northeast-2": 20.5698, + "ap-northeast-3": 20.5708, + "ap-south-1": 0.0, + "ap-south-2": 14.9908, + "ap-southeast-1": 20.5698, + "ap-southeast-2": 20.5698, + "ap-southeast-3": 20.5698, + "ap-southeast-5": 0.0, + "ap-southeast-7": 18.6357, + "ca-central-1": 15.9008, + "eu-central-1": 0.0, + "eu-central-2": 21.7702, + "eu-north-1": 0.0, + "eu-south-1": 18.0298, + "eu-south-2": 0.0, + "eu-west-1": 17.2348, + "eu-west-2": 18.0348, + "eu-west-3": 18.0348, + "me-central-1": 17.6368, + "me-south-1": 17.6368, + "sa-east-1": 0.0, + "us-east-1": 14.5668, + "us-east-2": 14.5668, + "us-gov-east-1": 17.2348, + "us-gov-west-1": 17.2348, + "us-west-1": 18.5688, + "us-west-2": 14.5668 + }, + "x2iedn.xlarge": { + "af-south-1": 1.2481, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.38729, + "ap-northeast-3": 1.26648, + "ap-south-1": 0.0, + "ap-south-2": 1.00374, + "ap-southeast-1": 1.38729, + "ap-southeast-2": 1.38729, + "ap-southeast-3": 1.26641, + "ap-southeast-5": 1.14553, + "ca-central-1": 0.9746, + "eu-central-1": 1.22473, + "eu-north-1": 1.10339, + "eu-south-1": 1.10763, + "eu-south-2": 1.05798, + "eu-west-1": 1.05798, + "eu-west-2": 1.10798, + "eu-west-3": 1.10798, + "sa-east-1": 1.68323, + "us-east-1": 0.89123, + "us-east-2": 0.89123, + "us-gov-east-1": 1.15801, + "us-gov-west-1": 1.05798, + "us-west-1": 1.24973, + "us-west-2": 0.89123 + }, + "x2iedn.metal": { + "af-south-1": 39.3248, + "ap-northeast-1": 39.9108, + "ap-northeast-2": 0.0, + "ap-northeast-3": 39.9128, + "ap-south-1": 28.7528, + "ap-south-2": 28.7528, + "ap-southeast-1": 39.9108, + "ap-southeast-2": 39.9108, + "ap-southeast-3": 39.9108, + "ap-southeast-5": 36.0426, + "ca-central-1": 30.5728, + "eu-central-1": 38.5768, + "eu-north-1": 31.6518, + "eu-south-1": 34.8298, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 34.8408, + "eu-west-3": 34.8408, + "sa-east-1": 53.2488, + "us-east-1": 27.9048, + "us-east-2": 27.9048, + "us-gov-east-1": 33.2408, + "us-gov-west-1": 33.2408, + "us-west-1": 0.0, + "us-west-2": 27.9048 + }, + "x2iedn.2xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 2.77459, + "ap-northeast-2": 2.77459, + "ap-northeast-3": 2.53295, + "ap-south-1": 1.83545, + "ap-south-2": 1.83545, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.77459, + "ap-southeast-3": 2.53283, + "ap-southeast-5": 0.0, + "ca-central-1": 1.9492, + "eu-central-1": 2.68288, + "eu-north-1": 2.20678, + "eu-south-1": 2.21526, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 2.21595, + "sa-east-1": 3.36645, + "us-east-1": 1.78245, + "us-east-2": 1.78245, + "us-gov-east-1": 2.11595, + "us-gov-west-1": 2.11595, + "us-west-1": 2.2827, + "us-west-2": 1.94918 + }, + "x2iedn.4xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 5.00805, + "ap-northeast-2": 5.00805, + "ap-northeast-3": 5.0083, + "ap-south-1": 3.6133, + "ap-south-2": 3.6133, + "ap-southeast-1": 5.00805, + "ap-southeast-2": 5.00805, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.0, + "ca-central-1": 4.2076, + "eu-central-1": 4.8413, + "eu-north-1": 3.97568, + "eu-south-1": 4.37293, + "eu-south-2": 4.1743, + "eu-west-1": 4.1743, + "eu-west-2": 0.0, + "eu-west-3": 4.79445, + "sa-east-1": 7.32555, + "us-east-1": 3.5073, + "us-east-2": 3.84075, + "us-gov-east-1": 4.1743, + "us-gov-west-1": 4.57445, + "us-west-1": 4.5078, + "us-west-2": 0.0 + }, + "x2iedn.8xlarge": { + "af-south-1": 9.8696, + "ap-northeast-1": 10.0161, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 7.2266, + "ap-southeast-1": 10.98315, + "ap-southeast-2": 0.0, + "ap-southeast-3": 10.0161, + "ap-southeast-5": 9.9194, + "ca-central-1": 8.4152, + "eu-central-1": 10.6163, + "eu-north-1": 8.71193, + "eu-south-1": 9.58588, + "eu-south-2": 8.3486, + "eu-west-1": 8.3486, + "eu-west-2": 9.5889, + "eu-west-3": 8.7486, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 7.0146, + "us-gov-east-1": 8.3486, + "us-gov-west-1": 8.3486, + "us-west-1": 9.0156, + "us-west-2": 7.0146 + }, + "x2iedn.16xlarge": { + "af-south-1": 21.644, + "ap-northeast-1": 20.0322, + "ap-northeast-2": 20.0322, + "ap-northeast-3": 20.0332, + "ap-south-1": 15.8294, + "ap-south-2": 0.0, + "ap-southeast-1": 20.0322, + "ap-southeast-2": 20.0322, + "ap-southeast-3": 21.9663, + "ap-southeast-5": 18.0981, + "ca-central-1": 15.3632, + "eu-central-1": 21.2326, + "eu-north-1": 15.9027, + "eu-south-1": 17.4917, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 17.4972, + "eu-west-3": 0.0, + "sa-east-1": 26.7012, + "us-east-1": 15.363, + "us-east-2": 14.0292, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 14.0292 + }, + "x2iedn.24xlarge": { + "af-south-1": 29.6088, + "ap-northeast-1": 30.0483, + "ap-northeast-2": 30.0483, + "ap-northeast-3": 30.0498, + "ap-south-1": 21.6798, + "ap-south-2": 21.6798, + "ap-southeast-1": 30.0483, + "ap-southeast-2": 30.0483, + "ap-southeast-3": 30.0483, + "ap-southeast-5": 27.14715, + "ca-central-1": 25.2456, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 26.23755, + "eu-south-2": 25.0458, + "eu-west-1": 25.0458, + "eu-west-2": 28.7667, + "eu-west-3": 26.2458, + "sa-east-1": 0.0, + "us-east-1": 23.0445, + "us-east-2": 0.0, + "us-gov-east-1": 25.0458, + "us-gov-west-1": 25.0458, + "us-west-1": 27.0468, + "us-west-2": 21.0438 + }, + "x2iedn.32xlarge": { + "af-south-1": 39.3248, + "ap-northeast-1": 39.9108, + "ap-northeast-2": 39.9108, + "ap-northeast-3": 39.9128, + "ap-south-1": 28.7528, + "ap-south-2": 28.7528, + "ap-southeast-1": 39.9108, + "ap-southeast-2": 39.9108, + "ap-southeast-3": 39.9108, + "ap-southeast-5": 0.0, + "ca-central-1": 30.5728, + "eu-central-1": 38.5768, + "eu-north-1": 31.6518, + "eu-south-1": 34.8298, + "eu-south-2": 33.2408, + "eu-west-1": 33.2408, + "eu-west-2": 34.8408, + "eu-west-3": 34.8408, + "sa-east-1": 53.2488, + "us-east-1": 27.9048, + "us-east-2": 27.9048, + "us-gov-east-1": 33.2408, + "us-gov-west-1": 33.2408, + "us-west-1": 35.9088, + "us-west-2": 27.9048 + }, + "x2iezn.metal": { + "ap-northeast-1": 15.0264, + "eu-west-1": 12.5184, + "me-central-1": 12.8244, + "us-east-1": 10.5264, + "us-west-2": 10.5264 + }, + "x2iezn.2xlarge": { + "ap-northeast-1": 2.5332, + "eu-west-1": 2.1152, + "me-central-1": 2.1662, + "us-east-1": 1.95, + "us-west-2": 1.95 + }, + "x2iezn.4xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 4.1728, + "me-central-1": 4.2748, + "us-east-1": 3.5088, + "us-west-2": 3.8424 + }, + "x2iezn.6xlarge": { + "ap-northeast-1": 8.2386, + "eu-west-1": 6.2592, + "me-central-1": 6.4122, + "us-east-1": 5.7636, + "us-west-2": 5.2632 + }, + "x2iezn.8xlarge": { + "ap-northeast-1": 10.0176, + "eu-west-1": 0.0, + "me-central-1": 8.5496, + "us-east-1": 0.0, + "us-west-2": 7.6848 + }, + "x2iezn.12xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 12.5184, + "me-central-1": 0.0, + "us-east-1": 10.5264, + "us-west-2": 10.5264 + }, + "x8g.medium": { + "eu-central-1": 0.15095, + "us-east-1": 0.1121, + "us-west-2": 0.1121 + }, + "x8g.large": { + "eu-central-1": 0.32921, + "us-east-1": 0.2242, + "us-west-2": 0.2242 + }, + "x8g.xlarge": { + "eu-central-1": 0.6038, + "us-east-1": 0.48748, + "us-west-2": 0.0 + }, + "x8g.metal-24xl": { + "eu-central-1": 0.0, + "us-east-1": 0.0, + "us-west-2": 10.416 + }, + "x8g.metal-48xl": { + "eu-central-1": 28.0608, + "us-east-1": 20.6016, + "us-west-2": 0.0 + }, + "x8g.2xlarge": { + "eu-central-1": 0.0, + "us-east-1": 0.8968, + "us-west-2": 0.8968 + }, + "x8g.4xlarge": { + "eu-central-1": 2.3576, + "us-east-1": 1.736, + "us-west-2": 1.736 + }, + "x8g.8xlarge": { + "eu-central-1": 5.15216, + "us-east-1": 3.472, + "us-west-2": 3.78464 + }, + "x8g.12xlarge": { + "eu-central-1": 0.0, + "us-east-1": 5.67696, + "us-west-2": 5.208 + }, + "x8g.16xlarge": { + "eu-central-1": 0.0, + "us-east-1": 6.944, + "us-west-2": 6.944 + }, + "x8g.24xlarge": { + "eu-central-1": 14.1456, + "us-east-1": 11.35392, + "us-west-2": 10.416 + }, + "x8g.48xlarge": { + "eu-central-1": 28.0608, + "us-east-1": 20.6016, + "us-west-2": 20.6016 + }, + "z1d.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.254, + "ap-south-1": 0.225, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.255, + "eu-central-1": 0.254, + "eu-west-1": 0.237, + "eu-west-2": 0.249, + "us-east-1": 0.226, + "us-east-2": 0.0, + "us-west-1": 0.24, + "us-west-2": 0.215 + }, + "z1d.xlarge": { + "ap-northeast-1": 0.512, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.51, + "ap-southeast-2": 0.51, + "eu-central-1": 0.508, + "eu-west-1": 0.0, + "eu-west-2": 0.497, + "us-east-1": 0.43, + "us-east-2": 0.43, + "us-west-1": 0.48, + "us-west-2": 0.43 + }, + "z1d.metal": { + "ap-northeast-1": 5.966, + "ap-northeast-2": 5.918, + "ap-south-1": 5.222, + "ap-southeast-1": 5.942, + "ap-southeast-2": 5.942, + "eu-central-1": 5.918, + "eu-west-1": 0.0, + "eu-west-2": 5.791, + "us-east-1": 0.0, + "us-east-2": 4.982, + "us-west-1": 0.0, + "us-west-2": 4.982 + }, + "z1d.2xlarge": { + "ap-northeast-1": 1.023, + "ap-northeast-2": 1.015, + "ap-south-1": 0.899, + "ap-southeast-1": 1.019, + "ap-southeast-2": 1.019, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.994, + "us-east-1": 0.859, + "us-east-2": 0.904, + "us-west-1": 0.0, + "us-west-2": 0.859 + }, + "z1d.3xlarge": { + "ap-northeast-1": 1.573, + "ap-northeast-2": 1.48, + "ap-south-1": 1.376, + "ap-southeast-1": 1.567, + "ap-southeast-2": 1.486, + "eu-central-1": 0.0, + "eu-west-1": 1.378, + "eu-west-2": 1.448, + "us-east-1": 1.246, + "us-east-2": 1.313, + "us-west-1": 1.396, + "us-west-2": 1.313 + }, + "z1d.6xlarge": { + "ap-northeast-1": 3.147, + "ap-northeast-2": 2.959, + "ap-south-1": 2.611, + "ap-southeast-1": 2.971, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 2.755, + "eu-west-2": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.625, + "us-west-1": 2.791, + "us-west-2": 2.491 + }, + "z1d.12xlarge": { + "ap-northeast-1": 5.966, + "ap-northeast-2": 5.918, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.942, + "eu-central-1": 5.918, + "eu-west-1": 5.51, + "eu-west-2": 5.791, + "us-east-1": 4.982, + "us-east-2": 4.982, + "us-west-1": 5.582, + "us-west-2": 4.982 + } + }, + "ec2_rhel_ha": { + "a1.medium": { + "ap-northeast-1": 0.064, + "ap-south-1": 0.0574, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0652, + "eu-central-1": 0.061, + "eu-west-1": 0.0607, + "us-east-1": 0.0574, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "a1.large": { + "ap-northeast-1": 0.128, + "ap-south-1": 0.1148, + "ap-southeast-1": 0.1226, + "ap-southeast-2": 0.1304, + "eu-central-1": 0.1255, + "eu-west-1": 0.1214, + "us-east-1": 0.1148, + "us-east-2": 0.0, + "us-west-2": 0.1179 + }, + "a1.xlarge": { + "ap-northeast-1": 0.2637, + "ap-south-1": 0.2296, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.2608, + "eu-central-1": 0.0, + "eu-west-1": 0.2428, + "us-east-1": 0.0, + "us-east-2": 0.2357, + "us-west-2": 0.2296 + }, + "a1.metal": { + "ap-northeast-1": 0.91, + "ap-south-1": 0.805, + "ap-southeast-1": 0.867, + "ap-southeast-2": 0.93, + "eu-central-1": 0.862, + "eu-west-1": 0.0, + "us-east-1": 0.805, + "us-east-2": 0.0, + "us-west-2": 0.805 + }, + "a1.2xlarge": { + "ap-northeast-1": 0.512, + "ap-south-1": 0.4592, + "ap-southeast-1": 0.5045, + "ap-southeast-2": 0.0, + "eu-central-1": 0.488, + "eu-west-1": 0.4856, + "us-east-1": 0.4592, + "us-east-2": 0.4592, + "us-west-2": 0.4714 + }, + "a1.4xlarge": { + "ap-northeast-1": 0.9104, + "ap-south-1": 0.8048, + "ap-southeast-1": 0.8672, + "ap-southeast-2": 0.9296, + "eu-central-1": 0.0, + "eu-west-1": 0.8576, + "us-east-1": 0.8048, + "us-east-2": 0.8048, + "us-west-2": 0.8048 + }, + "c1.medium": { + "us-gov-west-1": 0.221 + }, + "c1.xlarge": { + "us-gov-west-1": 0.883 + }, + "c3.large": { + "ap-northeast-1": 0.205, + "ap-southeast-1": 0.196, + "ap-southeast-2": 0.196, + "eu-central-1": 0.206, + "eu-west-1": 0.196, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.184, + "us-west-2": 0.179 + }, + "c3.xlarge": { + "ap-northeast-1": 0.384, + "ap-southeast-1": 0.418, + "ap-southeast-2": 0.418, + "eu-central-1": 0.386, + "eu-west-1": 0.368, + "sa-east-1": 0.454, + "us-east-1": 0.338, + "us-gov-west-1": 0.38, + "us-west-1": 0.368, + "us-west-2": 0.338 + }, + "c3.2xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.783, + "ap-southeast-2": 0.783, + "eu-central-1": 0.771, + "eu-west-1": 0.735, + "sa-east-1": 0.907, + "us-east-1": 0.675, + "us-gov-west-1": 0.0, + "us-west-1": 0.735, + "us-west-2": 0.675 + }, + "c3.4xlarge": { + "ap-northeast-1": 1.523, + "ap-southeast-1": 1.453, + "ap-southeast-2": 1.453, + "eu-central-1": 1.532, + "eu-west-1": 1.357, + "sa-east-1": 1.831, + "us-east-1": 1.237, + "us-gov-west-1": 1.405, + "us-west-1": 1.357, + "us-west-2": 1.237 + }, + "c3.8xlarge": { + "ap-northeast-1": 2.842, + "ap-southeast-1": 2.906, + "ap-southeast-2": 0.0, + "eu-central-1": 2.858, + "eu-west-1": 2.714, + "sa-east-1": 3.402, + "us-east-1": 2.474, + "us-gov-west-1": 2.81, + "us-west-1": 2.714, + "us-west-2": 0.0 + }, + "c4.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.178, + "ap-northeast-3": 0.19, + "ap-south-1": 0.164, + "ap-southeast-1": 0.179, + "ap-southeast-2": 0.194, + "ca-central-1": 0.174, + "eu-central-1": 0.0, + "eu-west-1": 0.188, + "eu-west-2": 0.183, + "sa-east-1": 0.219, + "us-east-1": 0.164, + "us-east-2": 0.164, + "us-gov-west-1": 0.184, + "us-west-1": 0.188, + "us-west-2": 0.0 + }, + "c4.xlarge": { + "ap-northeast-1": 0.38, + "ap-northeast-2": 0.356, + "ap-northeast-3": 0.0, + "ap-south-1": 0.348, + "ap-southeast-1": 0.358, + "ap-southeast-2": 0.388, + "ca-central-1": 0.348, + "eu-central-1": 0.378, + "eu-west-1": 0.0, + "eu-west-2": 0.366, + "sa-east-1": 0.0, + "us-east-1": 0.328, + "us-east-2": 0.328, + "us-gov-west-1": 0.392, + "us-west-1": 0.376, + "us-west-2": 0.348 + }, + "c4.2xlarge": { + "ap-northeast-1": 0.759, + "ap-northeast-2": 0.711, + "ap-northeast-3": 0.759, + "ap-south-1": 0.655, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.775, + "ca-central-1": 0.695, + "eu-central-1": 0.711, + "eu-west-1": 0.707, + "eu-west-2": 0.731, + "sa-east-1": 0.875, + "us-east-1": 0.655, + "us-east-2": 0.695, + "us-gov-west-1": 0.783, + "us-west-1": 0.0, + "us-west-2": 0.655 + }, + "c4.4xlarge": { + "ap-northeast-1": 1.506, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 1.197, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.437, + "ca-central-1": 1.277, + "eu-central-1": 0.0, + "eu-west-1": 1.301, + "eu-west-2": 1.349, + "sa-east-1": 1.637, + "us-east-1": 0.0, + "us-east-2": 1.197, + "us-gov-west-1": 1.357, + "us-west-1": 1.389, + "us-west-2": 1.197 + }, + "c4.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.717, + "ap-northeast-3": 2.909, + "ap-south-1": 0.0, + "ap-southeast-1": 2.733, + "ap-southeast-2": 2.973, + "ca-central-1": 2.653, + "eu-central-1": 2.717, + "eu-west-1": 2.701, + "eu-west-2": 2.797, + "sa-east-1": 3.373, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 2.813, + "us-west-1": 0.0, + "us-west-2": 2.493 + }, + "c5.large": { + "af-south-1": 0.178, + "ap-east-1": 0.172, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.171, + "ap-south-1": 0.0, + "ap-south-2": 0.154, + "ap-southeast-1": 0.162, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.162, + "ap-southeast-4": 0.175, + "ca-central-1": 0.162, + "ca-west-1": 0.157, + "eu-central-1": 0.0, + "eu-central-2": 0.171, + "eu-north-1": 0.155, + "eu-south-1": 0.0, + "eu-south-2": 0.16, + "eu-west-1": 0.16, + "eu-west-2": 0.165, + "eu-west-3": 0.171, + "il-central-1": 0.171, + "me-central-1": 0.176, + "me-south-1": 0.0, + "sa-east-1": 0.203, + "us-east-1": 0.154, + "us-east-2": 0.149, + "us-gov-east-1": 0.166, + "us-gov-west-1": 0.166, + "us-west-1": 0.17, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.166 + }, + "c5.xlarge": { + "af-south-1": 0.369, + "ap-east-1": 0.344, + "ap-northeast-1": 0.342, + "ap-northeast-2": 0.331, + "ap-northeast-3": 0.342, + "ap-south-1": 0.308, + "ap-south-2": 0.298, + "ap-southeast-1": 0.324, + "ap-southeast-2": 0.35, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.363, + "ca-central-1": 0.314, + "ca-west-1": 0.325, + "eu-central-1": 0.0, + "eu-central-2": 0.341, + "eu-north-1": 0.31, + "eu-south-1": 0.0, + "eu-south-2": 0.331, + "eu-west-1": 0.32, + "eu-west-2": 0.33, + "eu-west-3": 0.33, + "il-central-1": 0.329, + "me-central-1": 0.351, + "me-south-1": 0.339, + "sa-east-1": 0.39, + "us-east-1": 0.298, + "us-east-2": 0.0, + "us-gov-east-1": 0.332, + "us-gov-west-1": 0.344, + "us-west-1": 0.352, + "us-west-2": 0.298, + "us-west-2-lax-1": 0.332 + }, + "c5.metal": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 7.517, + "ap-northeast-2": 6.989, + "ap-northeast-3": 0.0, + "ap-south-1": 6.461, + "ap-south-2": 6.461, + "ap-southeast-1": 7.085, + "ap-southeast-2": 7.709, + "ap-southeast-3": 7.085, + "ap-southeast-4": 7.709, + "ca-central-1": 6.845, + "ca-west-1": 6.845, + "eu-central-1": 0.0, + "eu-central-2": 7.502, + "eu-north-1": 6.749, + "eu-south-1": 7.229, + "eu-south-2": 6.989, + "eu-west-1": 0.0, + "eu-west-2": 7.229, + "eu-west-3": 7.229, + "il-central-1": 7.219, + "me-central-1": 7.45, + "me-south-1": 7.45, + "sa-east-1": 8.669, + "us-east-1": 0.0, + "us-east-2": 6.461, + "us-gov-east-1": 7.277, + "us-gov-west-1": 0.0, + "us-west-1": 7.469, + "us-west-2": 6.461, + "us-west-2-lax-1": 7.277 + }, + "c5.2xlarge": { + "af-south-1": 0.711, + "ap-east-1": 0.713, + "ap-northeast-1": 0.709, + "ap-northeast-2": 0.662, + "ap-northeast-3": 0.683, + "ap-south-1": 0.595, + "ap-south-2": 0.595, + "ap-southeast-1": 0.647, + "ap-southeast-2": 0.726, + "ap-southeast-3": 0.647, + "ap-southeast-4": 0.699, + "ca-central-1": 0.0, + "ca-west-1": 0.627, + "eu-central-1": 0.0, + "eu-central-2": 0.682, + "eu-north-1": 0.619, + "eu-south-1": 0.659, + "eu-south-2": 0.639, + "eu-west-1": 0.639, + "eu-west-2": 0.683, + "eu-west-3": 0.683, + "il-central-1": 0.683, + "me-central-1": 0.0, + "me-south-1": 0.678, + "sa-east-1": 0.779, + "us-east-1": 0.595, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.663, + "us-west-1": 0.679, + "us-west-2": 0.595, + "us-west-2-lax-1": 0.0 + }, + "c5.4xlarge": { + "af-south-1": 1.309, + "ap-east-1": 0.0, + "ap-northeast-1": 1.253, + "ap-northeast-2": 1.211, + "ap-northeast-3": 1.253, + "ap-south-1": 0.0, + "ap-south-2": 1.077, + "ap-southeast-1": 1.228, + "ap-southeast-2": 1.285, + "ap-southeast-3": 1.181, + "ap-southeast-4": 1.285, + "ca-central-1": 0.0, + "ca-west-1": 1.141, + "eu-central-1": 1.219, + "eu-central-2": 1.302, + "eu-north-1": 1.125, + "eu-south-1": 1.205, + "eu-south-2": 1.165, + "eu-west-1": 1.165, + "eu-west-2": 1.253, + "eu-west-3": 0.0, + "il-central-1": 1.203, + "me-central-1": 1.242, + "me-south-1": 1.292, + "sa-east-1": 1.445, + "us-east-1": 0.0, + "us-east-2": 1.077, + "us-gov-east-1": 1.213, + "us-gov-west-1": 1.213, + "us-west-1": 1.245, + "us-west-2": 1.077, + "us-west-2-lax-1": 1.262 + }, + "c5.9xlarge": { + "af-south-1": 2.945, + "ap-east-1": 2.837, + "ap-northeast-1": 2.819, + "ap-northeast-2": 2.621, + "ap-northeast-3": 2.819, + "ap-south-1": 2.515, + "ap-south-2": 2.423, + "ap-southeast-1": 2.657, + "ap-southeast-2": 2.891, + "ap-southeast-3": 2.657, + "ap-southeast-4": 2.891, + "ca-central-1": 2.567, + "ca-west-1": 2.667, + "eu-central-1": 2.744, + "eu-central-2": 2.813, + "eu-north-1": 2.531, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 2.621, + "eu-west-2": 2.711, + "eu-west-3": 0.0, + "il-central-1": 2.816, + "me-central-1": 2.794, + "me-south-1": 2.908, + "sa-east-1": 3.251, + "us-east-1": 2.423, + "us-east-2": 2.423, + "us-gov-east-1": 2.729, + "us-gov-west-1": 2.839, + "us-west-1": 2.801, + "us-west-2": 0.0, + "us-west-2-lax-1": 2.729 + }, + "c5.12xlarge": { + "af-south-1": 4.091, + "ap-east-1": 3.782, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.494, + "ap-northeast-3": 3.758, + "ap-south-1": 3.353, + "ap-south-2": 3.23, + "ap-southeast-1": 3.542, + "ap-southeast-2": 3.854, + "ap-southeast-3": 3.684, + "ap-southeast-4": 3.854, + "ca-central-1": 3.422, + "ca-west-1": 3.556, + "eu-central-1": 3.658, + "eu-central-2": 3.751, + "eu-north-1": 3.374, + "eu-south-1": 3.614, + "eu-south-2": 3.494, + "eu-west-1": 3.494, + "eu-west-2": 0.0, + "eu-west-3": 3.614, + "il-central-1": 3.61, + "me-central-1": 3.725, + "me-south-1": 3.725, + "sa-east-1": 4.334, + "us-east-1": 3.353, + "us-east-2": 3.23, + "us-gov-east-1": 3.638, + "us-gov-west-1": 3.638, + "us-west-1": 0.0, + "us-west-2": 3.23, + "us-west-2-lax-1": 3.638 + }, + "c5.18xlarge": { + "af-south-1": 0.0, + "ap-east-1": 5.674, + "ap-northeast-1": 5.638, + "ap-northeast-2": 5.242, + "ap-northeast-3": 5.638, + "ap-south-1": 4.846, + "ap-south-2": 4.846, + "ap-southeast-1": 5.314, + "ap-southeast-2": 5.782, + "ap-southeast-3": 0.0, + "ap-southeast-4": 5.782, + "ca-central-1": 5.134, + "ca-west-1": 0.0, + "eu-central-1": 5.278, + "eu-central-2": 5.627, + "eu-north-1": 0.0, + "eu-south-1": 5.422, + "eu-south-2": 0.0, + "eu-west-1": 5.242, + "eu-west-2": 5.422, + "eu-west-3": 5.422, + "il-central-1": 0.0, + "me-central-1": 5.587, + "me-south-1": 5.587, + "sa-east-1": 6.502, + "us-east-1": 0.0, + "us-east-2": 4.846, + "us-gov-east-1": 5.458, + "us-gov-west-1": 5.458, + "us-west-1": 5.602, + "us-west-2": 4.846, + "us-west-2-lax-1": 0.0 + }, + "c5.24xlarge": { + "af-south-1": 7.853, + "ap-east-1": 7.565, + "ap-northeast-1": 7.517, + "ap-northeast-2": 0.0, + "ap-northeast-3": 7.517, + "ap-south-1": 6.461, + "ap-south-2": 6.461, + "ap-southeast-1": 7.085, + "ap-southeast-2": 7.709, + "ap-southeast-3": 7.085, + "ap-southeast-4": 7.709, + "ca-central-1": 6.845, + "ca-west-1": 0.0, + "eu-central-1": 7.037, + "eu-central-2": 7.502, + "eu-north-1": 6.749, + "eu-south-1": 7.229, + "eu-south-2": 6.989, + "eu-west-1": 6.989, + "eu-west-2": 7.229, + "eu-west-3": 7.229, + "il-central-1": 0.0, + "me-central-1": 7.45, + "me-south-1": 7.45, + "sa-east-1": 8.669, + "us-east-1": 6.461, + "us-east-2": 6.461, + "us-gov-east-1": 7.277, + "us-gov-west-1": 0.0, + "us-west-1": 7.469, + "us-west-2": 6.461, + "us-west-2-lax-1": 7.277 + }, + "c5a.large": { + "af-south-1": 0.167, + "ap-east-1": 0.161, + "ap-northeast-1": 0.16, + "ap-northeast-2": 0.15, + "ap-south-1": 0.111, + "ap-southeast-1": 0.152, + "ap-southeast-2": 0.164, + "ca-central-1": 0.148, + "eu-central-1": 0.151, + "eu-north-1": 0.146, + "eu-south-1": 0.155, + "eu-west-1": 0.15, + "eu-west-2": 0.155, + "eu-west-3": 0.155, + "me-south-1": 0.159, + "sa-east-1": 0.182, + "us-east-1": 0.141, + "us-east-2": 0.141, + "us-gov-east-1": 0.156, + "us-gov-west-1": 0.156, + "us-west-1": 0.159, + "us-west-2": 0.141 + }, + "c5a.xlarge": { + "af-south-1": 0.334, + "ap-east-1": 0.322, + "ap-northeast-1": 0.32, + "ap-northeast-2": 0.3, + "ap-south-1": 0.222, + "ap-southeast-1": 0.304, + "ap-southeast-2": 0.328, + "ca-central-1": 0.296, + "eu-central-1": 0.302, + "eu-north-1": 0.292, + "eu-south-1": 0.31, + "eu-west-1": 0.3, + "eu-west-2": 0.31, + "eu-west-3": 0.31, + "me-south-1": 0.318, + "sa-east-1": 0.364, + "us-east-1": 0.282, + "us-east-2": 0.282, + "us-gov-east-1": 0.312, + "us-gov-west-1": 0.312, + "us-west-1": 0.318, + "us-west-2": 0.282 + }, + "c5a.2xlarge": { + "af-south-1": 0.667, + "ap-east-1": 0.643, + "ap-northeast-1": 0.639, + "ap-northeast-2": 0.599, + "ap-south-1": 0.443, + "ap-southeast-1": 0.607, + "ap-southeast-2": 0.655, + "ca-central-1": 0.591, + "eu-central-1": 0.603, + "eu-north-1": 0.583, + "eu-south-1": 0.619, + "eu-west-1": 0.599, + "eu-west-2": 0.619, + "eu-west-3": 0.619, + "me-south-1": 0.635, + "sa-east-1": 0.727, + "us-east-1": 0.563, + "us-east-2": 0.563, + "us-gov-east-1": 0.623, + "us-gov-west-1": 0.623, + "us-west-1": 0.635, + "us-west-2": 0.563 + }, + "c5a.4xlarge": { + "af-south-1": 1.221, + "ap-east-1": 1.173, + "ap-northeast-1": 1.165, + "ap-northeast-2": 1.085, + "ap-south-1": 0.773, + "ap-southeast-1": 1.101, + "ap-southeast-2": 1.197, + "ca-central-1": 1.069, + "eu-central-1": 1.093, + "eu-north-1": 1.053, + "eu-south-1": 1.125, + "eu-west-1": 1.085, + "eu-west-2": 1.125, + "eu-west-3": 1.125, + "me-south-1": 1.157, + "sa-east-1": 1.341, + "us-east-1": 1.013, + "us-east-2": 1.013, + "us-gov-east-1": 1.133, + "us-gov-west-1": 1.133, + "us-west-1": 1.157, + "us-west-2": 1.013 + }, + "c5a.8xlarge": { + "af-south-1": 2.442, + "ap-east-1": 2.346, + "ap-northeast-1": 2.33, + "ap-northeast-2": 2.17, + "ap-south-1": 1.546, + "ap-southeast-1": 2.202, + "ap-southeast-2": 2.394, + "ca-central-1": 2.138, + "eu-central-1": 2.186, + "eu-north-1": 2.106, + "eu-south-1": 2.25, + "eu-west-1": 2.17, + "eu-west-2": 2.25, + "eu-west-3": 2.25, + "me-south-1": 2.314, + "sa-east-1": 2.682, + "us-east-1": 2.026, + "us-east-2": 2.026, + "us-gov-east-1": 2.266, + "us-gov-west-1": 2.266, + "us-west-1": 2.314, + "us-west-2": 2.026 + }, + "c5a.12xlarge": { + "af-south-1": 3.662, + "ap-east-1": 3.518, + "ap-northeast-1": 3.494, + "ap-northeast-2": 3.254, + "ap-south-1": 2.318, + "ap-southeast-1": 3.302, + "ap-southeast-2": 3.59, + "ca-central-1": 3.206, + "eu-central-1": 3.278, + "eu-north-1": 3.158, + "eu-south-1": 3.374, + "eu-west-1": 3.254, + "eu-west-2": 3.374, + "eu-west-3": 3.374, + "me-south-1": 3.47, + "sa-east-1": 4.022, + "us-east-1": 3.038, + "us-east-2": 3.038, + "us-gov-east-1": 3.398, + "us-gov-west-1": 3.398, + "us-west-1": 3.47, + "us-west-2": 3.038 + }, + "c5a.16xlarge": { + "af-south-1": 4.883, + "ap-east-1": 4.691, + "ap-northeast-1": 4.659, + "ap-northeast-2": 4.339, + "ap-south-1": 3.091, + "ap-southeast-1": 4.403, + "ap-southeast-2": 4.787, + "ca-central-1": 4.275, + "eu-central-1": 4.371, + "eu-north-1": 4.211, + "eu-south-1": 4.499, + "eu-west-1": 4.339, + "eu-west-2": 4.499, + "eu-west-3": 4.499, + "me-south-1": 4.627, + "sa-east-1": 5.363, + "us-east-1": 4.051, + "us-east-2": 4.051, + "us-gov-east-1": 4.531, + "us-gov-west-1": 4.531, + "us-west-1": 4.627, + "us-west-2": 4.051 + }, + "c5a.24xlarge": { + "af-south-1": 7.325, + "ap-east-1": 7.037, + "ap-northeast-1": 6.989, + "ap-northeast-2": 6.509, + "ap-south-1": 4.637, + "ap-southeast-1": 6.605, + "ap-southeast-2": 7.181, + "ca-central-1": 6.413, + "eu-central-1": 6.557, + "eu-north-1": 6.317, + "eu-south-1": 6.749, + "eu-west-1": 6.509, + "eu-west-2": 6.749, + "eu-west-3": 6.749, + "me-south-1": 6.941, + "sa-east-1": 8.045, + "us-east-1": 6.077, + "us-east-2": 6.077, + "us-gov-east-1": 6.797, + "us-gov-west-1": 6.797, + "us-west-1": 6.941, + "us-west-2": 6.077 + }, + "c5ad.large": { + "af-south-1": 0.181, + "ap-southeast-1": 0.165, + "ap-southeast-2": 0.177, + "eu-central-1": 0.164, + "eu-south-1": 0.167, + "eu-west-1": 0.162, + "me-south-1": 0.172, + "sa-east-1": 0.198, + "us-east-1": 0.15, + "us-east-2": 0.15, + "us-west-2": 0.15 + }, + "c5ad.xlarge": { + "af-south-1": 0.362, + "ap-southeast-1": 0.33, + "ap-southeast-2": 0.354, + "eu-central-1": 0.328, + "eu-south-1": 0.334, + "eu-west-1": 0.324, + "me-south-1": 0.344, + "sa-east-1": 0.396, + "us-east-1": 0.3, + "us-east-2": 0.3, + "us-west-2": 0.3 + }, + "c5ad.2xlarge": { + "af-south-1": 0.723, + "ap-southeast-1": 0.659, + "ap-southeast-2": 0.707, + "eu-central-1": 0.655, + "eu-south-1": 0.667, + "eu-west-1": 0.647, + "me-south-1": 0.687, + "sa-east-1": 0.791, + "us-east-1": 0.599, + "us-east-2": 0.599, + "us-west-2": 0.599 + }, + "c5ad.4xlarge": { + "af-south-1": 1.333, + "ap-southeast-1": 1.205, + "ap-southeast-2": 1.301, + "eu-central-1": 1.197, + "eu-south-1": 1.221, + "eu-west-1": 1.181, + "me-south-1": 1.261, + "sa-east-1": 1.469, + "us-east-1": 1.085, + "us-east-2": 1.085, + "us-west-2": 1.085 + }, + "c5ad.8xlarge": { + "af-south-1": 2.666, + "ap-southeast-1": 2.41, + "ap-southeast-2": 2.602, + "eu-central-1": 2.394, + "eu-south-1": 2.442, + "eu-west-1": 2.362, + "me-south-1": 2.522, + "sa-east-1": 2.938, + "us-east-1": 2.17, + "us-east-2": 2.17, + "us-west-2": 2.17 + }, + "c5ad.12xlarge": { + "af-south-1": 3.998, + "ap-southeast-1": 3.614, + "ap-southeast-2": 3.902, + "eu-central-1": 3.59, + "eu-south-1": 3.662, + "eu-west-1": 3.542, + "me-south-1": 3.782, + "sa-east-1": 4.406, + "us-east-1": 3.254, + "us-east-2": 3.254, + "us-west-2": 3.254 + }, + "c5ad.16xlarge": { + "af-south-1": 5.331, + "ap-southeast-1": 4.819, + "ap-southeast-2": 5.203, + "eu-central-1": 4.787, + "eu-south-1": 4.883, + "eu-west-1": 4.723, + "me-south-1": 5.043, + "sa-east-1": 5.875, + "us-east-1": 4.339, + "us-east-2": 4.339, + "us-west-2": 4.339 + }, + "c5ad.24xlarge": { + "af-south-1": 7.997, + "ap-southeast-1": 7.229, + "ap-southeast-2": 7.805, + "eu-central-1": 7.181, + "eu-south-1": 7.325, + "eu-west-1": 7.085, + "me-south-1": 7.565, + "sa-east-1": 8.813, + "us-east-1": 6.509, + "us-east-2": 6.509, + "us-west-2": 6.509 + }, + "c5d.large": { + "af-south-1": 0.202, + "ap-east-1": 0.187, + "ap-northeast-1": 0.193, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.169, + "ap-south-2": 0.169, + "ap-southeast-1": 0.176, + "ap-southeast-2": 0.197, + "ap-southeast-3": 0.176, + "ap-southeast-4": 0.19, + "ca-central-1": 0.17, + "eu-central-1": 0.175, + "eu-central-2": 0.186, + "eu-north-1": 0.168, + "eu-south-1": 0.185, + "eu-south-2": 0.173, + "eu-west-1": 0.173, + "eu-west-2": 0.179, + "eu-west-3": 0.186, + "il-central-1": 0.178, + "me-central-1": 0.184, + "me-south-1": 0.184, + "sa-east-1": 0.213, + "us-east-1": 0.16, + "us-east-2": 0.16, + "us-gov-east-1": 0.187, + "us-gov-west-1": 0.18, + "us-west-1": 0.184, + "us-west-2": 0.166 + }, + "c5d.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.374, + "ap-northeast-1": 0.372, + "ap-northeast-2": 0.361, + "ap-northeast-3": 0.386, + "ap-south-1": 0.326, + "ap-south-2": 0.326, + "ap-southeast-1": 0.352, + "ap-southeast-2": 0.38, + "ap-southeast-3": 0.352, + "ap-southeast-4": 0.38, + "ca-central-1": 0.34, + "eu-central-1": 0.0, + "eu-central-2": 0.386, + "eu-north-1": 0.348, + "eu-south-1": 0.356, + "eu-south-2": 0.346, + "eu-west-1": 0.359, + "eu-west-2": 0.358, + "eu-west-3": 0.371, + "il-central-1": 0.0, + "me-central-1": 0.367, + "me-south-1": 0.367, + "sa-east-1": 0.426, + "us-east-1": 0.32, + "us-east-2": 0.32, + "us-gov-east-1": 0.36, + "us-gov-west-1": 0.36, + "us-west-1": 0.368, + "us-west-2": 0.32 + }, + "c5d.metal": { + "af-south-1": 8.621, + "ap-northeast-1": 8.237, + "ap-northeast-2": 7.661, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 7.757, + "ap-southeast-2": 8.429, + "ap-southeast-3": 7.757, + "ap-southeast-4": 8.429, + "ca-central-1": 7.469, + "eu-central-1": 7.709, + "eu-central-2": 8.242, + "eu-north-1": 7.373, + "eu-south-1": 7.853, + "eu-south-2": 0.0, + "eu-west-1": 7.613, + "eu-west-2": 7.901, + "il-central-1": 7.874, + "me-central-1": 8.136, + "sa-east-1": 9.533, + "us-east-1": 6.989, + "us-east-2": 6.989, + "us-gov-west-1": 7.949, + "us-west-1": 8.141, + "us-west-2": 6.989 + }, + "c5d.2xlarge": { + "af-south-1": 0.806, + "ap-east-1": 0.747, + "ap-northeast-1": 0.743, + "ap-northeast-2": 0.695, + "ap-northeast-3": 0.743, + "ap-south-1": 0.0, + "ap-south-2": 0.651, + "ap-southeast-1": 0.703, + "ap-southeast-2": 0.789, + "ap-southeast-3": 0.73, + "ap-southeast-4": 0.759, + "ca-central-1": 0.679, + "eu-central-1": 0.726, + "eu-central-2": 0.744, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.691, + "eu-west-1": 0.691, + "eu-west-2": 0.715, + "eu-west-3": 0.0, + "il-central-1": 0.713, + "me-central-1": 0.0, + "me-south-1": 0.735, + "sa-east-1": 0.851, + "us-east-1": 0.662, + "us-east-2": 0.639, + "us-gov-east-1": 0.719, + "us-gov-west-1": 0.0, + "us-west-1": 0.764, + "us-west-2": 0.662 + }, + "c5d.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.381, + "ap-northeast-1": 1.373, + "ap-northeast-2": 1.33, + "ap-northeast-3": 1.373, + "ap-south-1": 1.189, + "ap-south-2": 0.0, + "ap-southeast-1": 1.347, + "ap-southeast-2": 1.465, + "ap-southeast-3": 0.0, + "ap-southeast-4": 1.465, + "ca-central-1": 1.296, + "eu-central-1": 1.285, + "eu-central-2": 1.374, + "eu-north-1": 1.229, + "eu-south-1": 1.309, + "eu-south-2": 1.269, + "eu-west-1": 1.269, + "eu-west-2": 0.0, + "eu-west-3": 1.317, + "il-central-1": 1.312, + "me-central-1": 1.356, + "me-south-1": 1.356, + "sa-east-1": 1.66, + "us-east-1": 0.0, + "us-east-2": 1.165, + "us-gov-east-1": 1.38, + "us-gov-west-1": 0.0, + "us-west-1": 1.357, + "us-west-2": 1.165 + }, + "c5d.9xlarge": { + "af-south-1": 3.373, + "ap-east-1": 3.107, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.992, + "ap-northeast-3": 3.089, + "ap-south-1": 2.675, + "ap-south-2": 2.675, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.161, + "ap-southeast-3": 2.909, + "ap-southeast-4": 0.0, + "ca-central-1": 2.801, + "eu-central-1": 2.891, + "eu-central-2": 0.0, + "eu-north-1": 2.765, + "eu-south-1": 0.0, + "eu-south-2": 2.973, + "eu-west-1": 2.973, + "eu-west-2": 2.963, + "eu-west-3": 2.963, + "il-central-1": 3.077, + "me-central-1": 3.18, + "me-south-1": 3.051, + "sa-east-1": 3.575, + "us-east-1": 2.621, + "us-east-2": 2.621, + "us-gov-east-1": 3.106, + "us-gov-west-1": 3.106, + "us-west-1": 3.053, + "us-west-2": 2.621 + }, + "c5d.12xlarge": { + "af-south-1": 4.31, + "ap-northeast-1": 4.118, + "ap-northeast-2": 3.83, + "ap-northeast-3": 4.118, + "ap-south-1": 0.0, + "ap-south-2": 3.709, + "ap-southeast-1": 3.878, + "ap-southeast-2": 4.396, + "ap-southeast-3": 4.04, + "ap-southeast-4": 4.214, + "ca-central-1": 3.734, + "eu-central-1": 3.854, + "eu-central-2": 4.121, + "eu-north-1": 3.686, + "eu-south-1": 4.091, + "eu-south-2": 3.806, + "eu-west-1": 3.806, + "eu-west-2": 4.116, + "il-central-1": 3.937, + "me-central-1": 4.068, + "sa-east-1": 4.766, + "us-east-1": 3.494, + "us-east-2": 3.494, + "us-gov-west-1": 3.974, + "us-west-1": 4.07, + "us-west-2": 3.494 + }, + "c5d.18xlarge": { + "af-south-1": 6.466, + "ap-east-1": 6.214, + "ap-northeast-1": 6.178, + "ap-northeast-2": 5.746, + "ap-northeast-3": 6.178, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 5.818, + "ap-southeast-2": 6.322, + "ap-southeast-3": 5.818, + "ap-southeast-4": 6.322, + "ca-central-1": 0.0, + "eu-central-1": 5.782, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 5.89, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 5.926, + "eu-west-3": 5.926, + "il-central-1": 5.906, + "me-central-1": 6.102, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 5.242, + "us-gov-east-1": 5.962, + "us-gov-west-1": 0.0, + "us-west-1": 6.106, + "us-west-2": 5.242 + }, + "c5d.24xlarge": { + "af-south-1": 8.621, + "ap-northeast-1": 8.237, + "ap-northeast-2": 7.661, + "ap-northeast-3": 8.237, + "ap-south-1": 7.133, + "ap-south-2": 7.133, + "ap-southeast-1": 7.757, + "ap-southeast-2": 8.429, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 7.774, + "eu-central-1": 7.709, + "eu-central-2": 8.242, + "eu-north-1": 7.373, + "eu-south-1": 8.181, + "eu-south-2": 7.613, + "eu-west-1": 7.927, + "eu-west-2": 8.232, + "il-central-1": 7.874, + "me-central-1": 0.0, + "sa-east-1": 9.533, + "us-east-1": 6.989, + "us-east-2": 6.989, + "us-gov-west-1": 7.949, + "us-west-1": 8.141, + "us-west-2": 6.989 + }, + "c5n.large": { + "af-south-1": 0.218, + "ap-east-1": 0.207, + "ap-northeast-1": 0.2, + "ap-northeast-2": 0.186, + "ap-northeast-3": 0.2, + "ap-south-1": 0.172, + "ap-southeast-1": 0.188, + "ap-southeast-2": 0.213, + "ap-southeast-3": 0.0, + "ca-central-1": 0.182, + "eu-central-1": 0.187, + "eu-north-1": 0.18, + "eu-south-1": 0.193, + "eu-west-1": 0.186, + "eu-west-2": 0.192, + "eu-west-3": 0.192, + "me-south-1": 0.198, + "sa-east-1": 0.0, + "us-east-1": 0.178, + "us-east-2": 0.178, + "us-gov-east-1": 0.194, + "us-gov-west-1": 0.202, + "us-west-1": 0.199, + "us-west-2": 0.172 + }, + "c5n.xlarge": { + "af-south-1": 0.418, + "ap-east-1": 0.414, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.372, + "ap-northeast-3": 0.4, + "ap-south-1": 0.357, + "ap-southeast-1": 0.39, + "ap-southeast-2": 0.427, + "ap-southeast-3": 0.376, + "ca-central-1": 0.364, + "eu-central-1": 0.374, + "eu-north-1": 0.36, + "eu-south-1": 0.386, + "eu-west-1": 0.372, + "eu-west-2": 0.384, + "eu-west-3": 0.384, + "me-south-1": 0.396, + "sa-east-1": 0.48, + "us-east-1": 0.357, + "us-east-2": 0.344, + "us-gov-east-1": 0.388, + "us-gov-west-1": 0.403, + "us-west-1": 0.398, + "us-west-2": 0.344 + }, + "c5n.metal": { + "af-south-1": 7.013, + "ap-east-1": 6.934, + "ap-northeast-1": 0.0, + "ap-northeast-2": 6.178, + "ap-northeast-3": 6.682, + "ap-south-1": 5.674, + "ap-southeast-1": 6.25, + "ap-southeast-2": 6.862, + "ap-southeast-3": 6.25, + "ca-central-1": 6.034, + "eu-central-1": 6.214, + "eu-north-1": 0.0, + "eu-south-1": 6.43, + "eu-west-1": 6.178, + "eu-west-2": 0.0, + "eu-west-3": 6.394, + "me-south-1": 6.61, + "sa-east-1": 7.762, + "us-east-1": 5.674, + "us-east-2": 5.674, + "us-gov-east-1": 6.466, + "us-gov-west-1": 6.466, + "us-west-1": 6.646, + "us-west-2": 5.674 + }, + "c5n.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.827, + "ap-northeast-1": 0.832, + "ap-northeast-2": 0.743, + "ap-northeast-3": 0.799, + "ap-south-1": 0.687, + "ap-southeast-1": 0.751, + "ap-southeast-2": 0.819, + "ap-southeast-3": 0.0, + "ca-central-1": 0.756, + "eu-central-1": 0.777, + "eu-north-1": 0.0, + "eu-south-1": 0.771, + "eu-west-1": 0.743, + "eu-west-2": 0.0, + "eu-west-3": 0.767, + "me-south-1": 0.791, + "sa-east-1": 0.0, + "us-east-1": 0.687, + "us-east-2": 0.687, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.775, + "us-west-1": 0.828, + "us-west-2": 0.687 + }, + "c5n.4xlarge": { + "af-south-1": 1.558, + "ap-east-1": 0.0, + "ap-northeast-1": 1.55, + "ap-northeast-2": 1.373, + "ap-northeast-3": 1.55, + "ap-south-1": 0.0, + "ap-southeast-1": 1.389, + "ap-southeast-2": 1.525, + "ap-southeast-3": 0.0, + "ca-central-1": 1.341, + "eu-central-1": 1.381, + "eu-north-1": 1.38, + "eu-south-1": 1.429, + "eu-west-1": 1.373, + "eu-west-2": 0.0, + "eu-west-3": 1.421, + "me-south-1": 1.469, + "sa-east-1": 1.725, + "us-east-1": 1.313, + "us-east-2": 1.313, + "us-gov-east-1": 1.437, + "us-gov-west-1": 1.499, + "us-west-1": 1.477, + "us-west-2": 1.313 + }, + "c5n.9xlarge": { + "af-south-1": 3.506, + "ap-east-1": 3.467, + "ap-northeast-1": 3.341, + "ap-northeast-2": 3.221, + "ap-northeast-3": 3.341, + "ap-south-1": 2.837, + "ap-southeast-1": 3.125, + "ap-southeast-2": 3.431, + "ap-southeast-3": 3.125, + "ca-central-1": 0.0, + "eu-central-1": 3.24, + "eu-north-1": 0.0, + "eu-south-1": 3.215, + "eu-west-1": 3.089, + "eu-west-2": 0.0, + "eu-west-3": 3.197, + "me-south-1": 3.305, + "sa-east-1": 0.0, + "us-east-1": 2.837, + "us-east-2": 2.837, + "us-gov-east-1": 3.233, + "us-gov-west-1": 3.233, + "us-west-1": 3.469, + "us-west-2": 2.837 + }, + "c5n.18xlarge": { + "af-south-1": 7.013, + "ap-east-1": 6.934, + "ap-northeast-1": 6.682, + "ap-northeast-2": 6.178, + "ap-northeast-3": 6.682, + "ap-south-1": 0.0, + "ap-southeast-1": 6.25, + "ap-southeast-2": 6.862, + "ap-southeast-3": 6.25, + "ca-central-1": 6.034, + "eu-central-1": 6.214, + "eu-north-1": 5.962, + "eu-south-1": 6.43, + "eu-west-1": 0.0, + "eu-west-2": 6.394, + "eu-west-3": 6.394, + "me-south-1": 6.61, + "sa-east-1": 7.762, + "us-east-1": 5.674, + "us-east-2": 5.674, + "us-gov-east-1": 0.0, + "us-gov-west-1": 6.466, + "us-west-1": 6.646, + "us-west-2": 5.674 + }, + "c6a.large": { + "ap-east-1": 0.20192, + "ap-northeast-1": 0.16973, + "ap-south-1": 0.11523, + "ap-south-2": 0.0, + "ap-southeast-1": 0.152, + "ap-southeast-2": 0.1637, + "ca-central-1": 0.1475, + "eu-central-1": 0.0, + "eu-west-1": 0.15409, + "eu-west-2": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.1403, + "us-east-2": 0.1403, + "us-west-1": 0.1592, + "us-west-2": 0.1403 + }, + "c6a.xlarge": { + "ap-east-1": 0.30884, + "ap-northeast-1": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.32164, + "ap-southeast-2": 0.3274, + "ca-central-1": 0.0, + "eu-central-1": 0.3022, + "eu-west-1": 0.30818, + "eu-west-2": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.2806 + }, + "c6a.metal": { + "ap-east-1": 9.4962, + "ap-northeast-1": 13.104, + "ap-south-1": 8.3472, + "ap-south-2": 8.3472, + "ap-southeast-1": 0.0, + "ap-southeast-2": 13.4496, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 11.73888, + "eu-west-2": 12.5856, + "sa-east-1": 0.0, + "us-east-1": 11.2032, + "us-east-2": 11.2032, + "us-west-1": 0.0, + "us-west-2": 11.2032 + }, + "c6a.2xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-south-1": 0.4422, + "ap-south-2": 0.4422, + "ap-southeast-1": 0.64328, + "ap-southeast-2": 0.0, + "ca-central-1": 0.59, + "eu-central-1": 0.63932, + "eu-west-1": 0.58352, + "eu-west-2": 0.0, + "sa-east-1": 0.7268, + "us-east-1": 0.5918, + "us-east-2": 0.5612, + "us-west-1": 0.6368, + "us-west-2": 0.5612 + }, + "c6a.4xlarge": { + "ap-east-1": 0.9426, + "ap-northeast-1": 1.1672, + "ap-south-1": 0.0, + "ap-south-2": 0.7708, + "ap-southeast-1": 1.1024, + "ap-southeast-2": 1.27592, + "ca-central-1": 1.0664, + "eu-central-1": 1.0952, + "eu-west-1": 1.05344, + "eu-west-2": 1.19672, + "sa-east-1": 0.0, + "us-east-1": 1.0088, + "us-east-2": 1.0088, + "us-west-1": 1.23632, + "us-west-2": 1.0088 + }, + "c6a.8xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-south-1": 1.5416, + "ap-south-2": 1.6164, + "ap-southeast-1": 2.2048, + "ap-southeast-2": 2.55184, + "ca-central-1": 2.1328, + "eu-central-1": 2.33008, + "eu-west-1": 2.10688, + "eu-west-2": 2.248, + "sa-east-1": 2.86864, + "us-east-1": 2.0176, + "us-east-2": 2.0176, + "us-west-1": 2.47264, + "us-west-2": 2.0176 + }, + "c6a.12xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 3.5016, + "ap-south-1": 2.4246, + "ap-south-2": 2.3124, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.588, + "ca-central-1": 3.40008, + "eu-central-1": 3.2856, + "eu-west-1": 3.16032, + "eu-west-2": 3.59016, + "sa-east-1": 0.0, + "us-east-1": 3.0264, + "us-east-2": 3.0264, + "us-west-1": 3.48, + "us-west-2": 3.0264 + }, + "c6a.16xlarge": { + "ap-east-1": 3.2754, + "ap-northeast-1": 4.6688, + "ap-south-1": 3.0832, + "ap-south-2": 3.0832, + "ap-southeast-1": 4.4096, + "ap-southeast-2": 5.10368, + "ca-central-1": 4.53344, + "eu-central-1": 4.66016, + "eu-west-1": 4.21376, + "eu-west-2": 4.496, + "sa-east-1": 5.73728, + "us-east-1": 4.0352, + "us-east-2": 4.0352, + "us-west-1": 4.94528, + "us-west-2": 0.0 + }, + "c6a.24xlarge": { + "ap-east-1": 4.8306, + "ap-northeast-1": 7.0032, + "ap-south-1": 4.6248, + "ap-south-2": 4.6248, + "ap-southeast-1": 6.6144, + "ap-southeast-2": 7.176, + "ca-central-1": 6.80016, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 6.744, + "sa-east-1": 8.04, + "us-east-1": 0.0, + "us-east-2": 6.0528, + "us-west-1": 6.96, + "us-west-2": 6.0528 + }, + "c6a.32xlarge": { + "ap-east-1": 6.3858, + "ap-northeast-1": 8.736, + "ap-south-1": 5.5648, + "ap-south-2": 5.5648, + "ap-southeast-1": 8.78208, + "ap-southeast-2": 0.0, + "ca-central-1": 7.9296, + "eu-central-1": 8.16, + "eu-west-1": 7.82592, + "eu-west-2": 8.3904, + "sa-east-1": 10.87296, + "us-east-1": 7.9584, + "us-east-2": 7.9584, + "us-west-1": 8.6784, + "us-west-2": 7.4688 + }, + "c6a.48xlarge": { + "ap-east-1": 9.4962, + "ap-northeast-1": 13.104, + "ap-south-1": 0.0, + "ap-south-2": 8.3472, + "ap-southeast-1": 12.3264, + "ap-southeast-2": 13.4496, + "ca-central-1": 11.8944, + "eu-central-1": 12.24, + "eu-west-1": 11.73888, + "eu-west-2": 12.5856, + "sa-east-1": 0.0, + "us-east-1": 11.2032, + "us-east-2": 11.2032, + "us-west-1": 13.0176, + "us-west-2": 11.2032 + }, + "c6g.medium": { + "af-south-1": 0.0775, + "ap-east-1": 0.0749, + "ap-northeast-1": 0.0747, + "ap-northeast-2": 0.0727, + "ap-northeast-3": 0.0774, + "ap-south-1": 0.0545, + "ap-south-2": 0.0532, + "ap-southeast-1": 0.0711, + "ap-southeast-2": 0.079, + "ap-southeast-3": 0.0711, + "ap-southeast-4": 0.0763, + "ap-southeast-5": 0.0652, + "ap-southeast-7": 0.0652, + "ca-central-1": 0.0691, + "ca-west-1": 0.0691, + "eu-central-1": 0.0707, + "eu-central-2": 0.0771, + "eu-north-1": 0.0684, + "eu-south-1": 0.0, + "eu-south-2": 0.0684, + "eu-west-1": 0.0684, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 0.0676, + "sa-east-1": 0.0843, + "us-east-1": 0.0659, + "us-east-2": 0.0659, + "us-gov-east-1": 0.0727, + "us-gov-west-1": 0.0727, + "us-west-1": 0.0743, + "us-west-2": 0.0659 + }, + "c6g.large": { + "af-south-1": 0.155, + "ap-east-1": 0.1498, + "ap-northeast-1": 0.1545, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.1498, + "ap-south-1": 0.1064, + "ap-south-2": 0.1064, + "ap-southeast-1": 0.1422, + "ap-southeast-2": 0.1579, + "ap-southeast-3": 0.1422, + "ap-southeast-4": 0.1526, + "ap-southeast-5": 0.1304, + "ap-southeast-7": 0.0, + "ca-central-1": 0.1427, + "ca-west-1": 0.1382, + "eu-central-1": 0.1461, + "eu-central-2": 0.1492, + "eu-north-1": 0.1368, + "eu-south-1": 0.1446, + "eu-south-2": 0.1414, + "eu-west-1": 0.1368, + "eu-west-2": 0.1446, + "eu-west-3": 0.1448, + "il-central-1": 0.1404, + "me-central-1": 0.0, + "me-south-1": 0.1539, + "mx-central-1": 0.0, + "sa-east-1": 0.1686, + "us-east-1": 0.1318, + "us-east-2": 0.1359, + "us-gov-east-1": 0.1454, + "us-gov-west-1": 0.1454, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6g.xlarge": { + "af-south-1": 0.31, + "ap-east-1": 0.2996, + "ap-northeast-1": 0.3091, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.2996, + "ap-south-1": 0.0, + "ap-south-2": 0.2128, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.3052, + "ap-southeast-3": 0.2844, + "ap-southeast-4": 0.3052, + "ap-southeast-5": 0.2609, + "ap-southeast-7": 0.2609, + "ca-central-1": 0.2764, + "ca-west-1": 0.2764, + "eu-central-1": 0.2828, + "eu-central-2": 0.2983, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.2735, + "eu-west-1": 0.2735, + "eu-west-2": 0.0, + "eu-west-3": 0.2992, + "il-central-1": 0.2808, + "me-central-1": 0.2982, + "me-south-1": 0.2976, + "mx-central-1": 0.279, + "sa-east-1": 0.3372, + "us-east-1": 0.2636, + "us-east-2": 0.2636, + "us-gov-east-1": 0.2908, + "us-gov-west-1": 0.3006, + "us-west-1": 0.2972, + "us-west-2": 0.2636 + }, + "c6g.metal": { + "af-south-1": 4.5056, + "ap-east-1": 4.3392, + "ap-northeast-1": 4.3264, + "ap-northeast-2": 4.0512, + "ap-northeast-3": 0.0, + "ap-south-1": 2.9504, + "ap-south-2": 2.9504, + "ap-southeast-1": 4.096, + "ap-southeast-2": 4.4288, + "ap-southeast-3": 4.096, + "ap-southeast-4": 4.4288, + "ap-southeast-5": 0.0, + "ap-southeast-7": 3.7197, + "ca-central-1": 3.968, + "ca-west-1": 3.968, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 3.9219, + "eu-west-1": 3.9219, + "eu-west-2": 4.1728, + "eu-west-3": 4.1792, + "il-central-1": 4.0384, + "me-central-1": 0.0, + "me-south-1": 4.3072, + "mx-central-1": 3.872, + "sa-east-1": 4.9408, + "us-east-1": 3.7632, + "us-east-2": 3.7632, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.1984, + "us-west-1": 0.0, + "us-west-2": 3.7632 + }, + "c6g.2xlarge": { + "af-south-1": 0.62, + "ap-east-1": 0.5992, + "ap-northeast-1": 0.5976, + "ap-northeast-2": 0.5632, + "ap-northeast-3": 0.5992, + "ap-south-1": 0.4358, + "ap-south-2": 0.4256, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.6104, + "ap-southeast-3": 0.5688, + "ap-southeast-4": 0.6317, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.5218, + "ca-central-1": 0.5707, + "ca-west-1": 0.5707, + "eu-central-1": 0.5656, + "eu-central-2": 0.5966, + "eu-north-1": 0.0, + "eu-south-1": 0.5784, + "eu-south-2": 0.547, + "eu-west-1": 0.547, + "eu-west-2": 0.5784, + "eu-west-3": 0.5792, + "il-central-1": 0.5616, + "me-central-1": 0.5762, + "me-south-1": 0.5952, + "mx-central-1": 0.5408, + "sa-east-1": 0.6744, + "us-east-1": 0.5272, + "us-east-2": 0.5272, + "us-gov-east-1": 0.5816, + "us-gov-west-1": 0.5816, + "us-west-1": 0.6148, + "us-west-2": 0.5435 + }, + "c6g.4xlarge": { + "af-south-1": 1.1264, + "ap-east-1": 1.0848, + "ap-northeast-1": 1.1227, + "ap-northeast-2": 1.0128, + "ap-northeast-3": 0.0, + "ap-south-1": 0.7376, + "ap-south-2": 0.7376, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.024, + "ap-southeast-4": 1.1072, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.9299, + "ca-central-1": 1.0277, + "ca-west-1": 0.992, + "eu-central-1": 0.0, + "eu-central-2": 1.0797, + "eu-north-1": 0.0, + "eu-south-1": 1.0432, + "eu-south-2": 0.0, + "eu-west-1": 0.9805, + "eu-west-2": 1.0432, + "eu-west-3": 1.0448, + "il-central-1": 0.0, + "me-central-1": 1.0794, + "me-south-1": 1.0768, + "mx-central-1": 0.968, + "sa-east-1": 1.2352, + "us-east-1": 0.9408, + "us-east-2": 0.9408, + "us-gov-east-1": 1.0496, + "us-gov-west-1": 1.0496, + "us-west-1": 1.1159, + "us-west-2": 0.0 + }, + "c6g.8xlarge": { + "af-south-1": 2.2528, + "ap-east-1": 2.2528, + "ap-northeast-1": 2.1632, + "ap-northeast-2": 2.0256, + "ap-northeast-3": 0.0, + "ap-south-1": 1.4752, + "ap-south-2": 1.5161, + "ap-southeast-1": 2.048, + "ap-southeast-2": 0.0, + "ap-southeast-3": 2.048, + "ap-southeast-4": 2.2144, + "ap-southeast-5": 1.9238, + "ap-southeast-7": 1.8598, + "ca-central-1": 2.0554, + "ca-west-1": 0.0, + "eu-central-1": 2.0352, + "eu-central-2": 2.1594, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 1.961, + "eu-west-1": 2.0346, + "eu-west-2": 2.0864, + "eu-west-3": 2.0896, + "il-central-1": 2.0965, + "me-central-1": 2.1587, + "me-south-1": 2.1536, + "mx-central-1": 0.0, + "sa-east-1": 2.4704, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 2.1504, + "us-west-2": 1.8816 + }, + "c6g.12xlarge": { + "af-south-1": 3.5105, + "ap-east-1": 3.2544, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.0384, + "ap-northeast-3": 3.2544, + "ap-south-1": 2.2128, + "ap-south-2": 2.2128, + "ap-southeast-1": 3.1849, + "ap-southeast-2": 3.4495, + "ap-southeast-3": 3.072, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.7898, + "ca-central-1": 3.0831, + "ca-west-1": 2.976, + "eu-central-1": 3.0528, + "eu-central-2": 3.239, + "eu-north-1": 2.9424, + "eu-south-1": 3.1296, + "eu-south-2": 3.0518, + "eu-west-1": 2.9414, + "eu-west-2": 3.1296, + "eu-west-3": 3.1344, + "il-central-1": 3.0288, + "me-central-1": 0.0, + "me-south-1": 3.2304, + "mx-central-1": 3.0068, + "sa-east-1": 3.7056, + "us-east-1": 2.8224, + "us-east-2": 2.9203, + "us-gov-east-1": 3.1488, + "us-gov-west-1": 3.1488, + "us-west-1": 3.2256, + "us-west-2": 2.8224 + }, + "c6g.16xlarge": { + "af-south-1": 4.5056, + "ap-east-1": 4.3392, + "ap-northeast-1": 4.3264, + "ap-northeast-2": 4.0512, + "ap-northeast-3": 4.3392, + "ap-south-1": 2.9504, + "ap-south-2": 2.9504, + "ap-southeast-1": 4.096, + "ap-southeast-2": 4.4288, + "ap-southeast-3": 4.096, + "ap-southeast-4": 4.4288, + "ap-southeast-5": 3.7197, + "ap-southeast-7": 3.7197, + "ca-central-1": 3.968, + "ca-west-1": 0.0, + "eu-central-1": 4.0704, + "eu-central-2": 4.3187, + "eu-north-1": 3.9232, + "eu-south-1": 4.1728, + "eu-south-2": 0.0, + "eu-west-1": 3.9219, + "eu-west-2": 4.1728, + "eu-west-3": 0.0, + "il-central-1": 4.0384, + "me-central-1": 4.1555, + "me-south-1": 0.0, + "mx-central-1": 3.872, + "sa-east-1": 4.9408, + "us-east-1": 3.7632, + "us-east-2": 3.7632, + "us-gov-east-1": 4.1984, + "us-gov-west-1": 4.1984, + "us-west-1": 4.3008, + "us-west-2": 0.0 + }, + "c6gd.medium": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0785, + "ap-northeast-3": 0.0809, + "ap-south-1": 0.0564, + "ap-southeast-1": 0.0769, + "ap-southeast-2": 0.0824, + "ap-southeast-3": 0.0, + "ca-central-1": 0.0743, + "eu-central-1": 0.0, + "eu-central-2": 0.0809, + "eu-north-1": 0.076, + "eu-south-2": 0.0755, + "eu-west-1": 0.0755, + "eu-west-2": 0.0779, + "eu-west-3": 0.0807, + "sa-east-1": 0.0914, + "us-east-1": 0.0703, + "us-east-2": 0.0703, + "us-gov-east-1": 0.0783, + "us-gov-west-1": 0.0783, + "us-west-1": 0.0799, + "us-west-2": 0.0703 + }, + "c6gd.large": { + "ap-northeast-1": 0.1618, + "ap-northeast-2": 0.1518, + "ap-northeast-3": 0.1618, + "ap-south-1": 0.1128, + "ap-southeast-1": 0.1538, + "ap-southeast-2": 0.1648, + "ap-southeast-3": 0.1538, + "ca-central-1": 0.1537, + "eu-central-1": 0.1581, + "eu-central-2": 0.1617, + "eu-north-1": 0.147, + "eu-south-2": 0.1562, + "eu-west-1": 0.1562, + "eu-west-2": 0.1613, + "eu-west-3": 0.1558, + "sa-east-1": 0.1828, + "us-east-1": 0.0, + "us-east-2": 0.1452, + "us-gov-east-1": 0.1566, + "us-gov-west-1": 0.1566, + "us-west-1": 0.1598, + "us-west-2": 0.0 + }, + "c6gd.xlarge": { + "ap-northeast-1": 0.3236, + "ap-northeast-2": 0.3036, + "ap-northeast-3": 0.0, + "ap-south-1": 0.2315, + "ap-southeast-1": 0.3184, + "ap-southeast-2": 0.3296, + "ap-southeast-3": 0.3076, + "ca-central-1": 0.3074, + "eu-central-1": 0.3056, + "eu-central-2": 0.3351, + "eu-north-1": 0.294, + "eu-south-2": 0.0, + "eu-west-1": 0.302, + "eu-west-2": 0.3116, + "eu-west-3": 0.3116, + "sa-east-1": 0.38, + "us-east-1": 0.2812, + "us-east-2": 0.2904, + "us-gov-east-1": 0.3243, + "us-gov-west-1": 0.0, + "us-west-1": 0.3196, + "us-west-2": 0.2812 + }, + "c6gd.metal": { + "ap-northeast-1": 4.7232, + "ap-northeast-2": 4.4032, + "ap-northeast-3": 4.7232, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.8192, + "ap-southeast-3": 4.4672, + "ca-central-1": 4.3008, + "eu-central-1": 4.4352, + "eu-central-2": 4.72, + "eu-north-1": 4.2496, + "eu-south-2": 4.3776, + "eu-west-1": 4.3776, + "eu-west-2": 4.5312, + "eu-west-3": 4.5312, + "sa-east-1": 5.3952, + "us-east-1": 4.0448, + "us-east-2": 4.0448, + "us-gov-east-1": 4.5568, + "us-gov-west-1": 4.5568, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6gd.2xlarge": { + "ap-northeast-1": 0.6472, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.6472, + "ap-south-1": 0.4512, + "ap-southeast-1": 0.6152, + "ap-southeast-2": 0.6832, + "ap-southeast-3": 0.6152, + "ca-central-1": 0.5944, + "eu-central-1": 0.6112, + "eu-central-2": 0.6468, + "eu-north-1": 0.0, + "eu-south-2": 0.604, + "eu-west-1": 0.6249, + "eu-west-2": 0.6453, + "eu-west-3": 0.6232, + "sa-east-1": 0.76, + "us-east-1": 0.5624, + "us-east-2": 0.5624, + "us-gov-east-1": 0.6487, + "us-gov-west-1": 0.6264, + "us-west-1": 0.6392, + "us-west-2": 0.5624 + }, + "c6gd.4xlarge": { + "ap-northeast-1": 1.1808, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.1808, + "ap-south-1": 0.7888, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.1168, + "ca-central-1": 1.0752, + "eu-central-1": 0.0, + "eu-central-2": 1.2266, + "eu-north-1": 1.0624, + "eu-south-2": 1.0944, + "eu-west-1": 1.1363, + "eu-west-2": 0.0, + "eu-west-3": 1.1328, + "sa-east-1": 1.3488, + "us-east-1": 1.0112, + "us-east-2": 1.0112, + "us-gov-east-1": 1.1392, + "us-gov-west-1": 1.1392, + "us-west-1": 1.2112, + "us-west-2": 1.0112 + }, + "c6gd.8xlarge": { + "ap-northeast-1": 2.3616, + "ap-northeast-2": 2.2016, + "ap-northeast-3": 2.3616, + "ap-south-1": 0.0, + "ap-southeast-1": 2.2336, + "ap-southeast-2": 2.4096, + "ap-southeast-3": 2.2336, + "ca-central-1": 2.1504, + "eu-central-1": 2.2176, + "eu-central-2": 2.36, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 2.1888, + "eu-west-2": 2.2656, + "eu-west-3": 2.2656, + "sa-east-1": 2.6976, + "us-east-1": 2.0224, + "us-east-2": 2.0961, + "us-gov-east-1": 2.2784, + "us-gov-west-1": 2.2784, + "us-west-1": 2.4224, + "us-west-2": 0.0 + }, + "c6gd.12xlarge": { + "ap-northeast-1": 3.5424, + "ap-northeast-2": 3.3024, + "ap-northeast-3": 3.5424, + "ap-south-1": 0.0, + "ap-southeast-1": 3.3504, + "ap-southeast-2": 3.6144, + "ap-southeast-3": 0.0, + "ca-central-1": 3.2256, + "eu-central-1": 0.0, + "eu-central-2": 3.54, + "eu-north-1": 0.0, + "eu-south-2": 3.2832, + "eu-west-1": 3.2832, + "eu-west-2": 3.3984, + "eu-west-3": 3.3984, + "sa-east-1": 4.0464, + "us-east-1": 3.0336, + "us-east-2": 0.0, + "us-gov-east-1": 3.4176, + "us-gov-west-1": 3.4176, + "us-west-1": 3.4944, + "us-west-2": 3.0336 + }, + "c6gd.16xlarge": { + "ap-northeast-1": 4.7232, + "ap-northeast-2": 4.4032, + "ap-northeast-3": 4.7232, + "ap-south-1": 3.1552, + "ap-southeast-1": 4.4672, + "ap-southeast-2": 4.8192, + "ap-southeast-3": 4.4672, + "ca-central-1": 0.0, + "eu-central-1": 4.4352, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 4.3776, + "eu-west-1": 4.3776, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 5.3952, + "us-east-1": 4.0448, + "us-east-2": 0.0, + "us-gov-east-1": 4.5568, + "us-gov-west-1": 0.0, + "us-west-1": 4.6592, + "us-west-2": 4.0448 + }, + "c6gn.medium": { + "ap-east-1": 0.08915, + "ap-northeast-1": 0.0864, + "ap-northeast-2": 0.08065, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0814, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.07398, + "ap-southeast-7": 0.07398, + "ca-central-1": 0.08393, + "ca-west-1": 0.0792, + "eu-central-1": 0.0812, + "eu-north-1": 0.0784, + "eu-south-1": 0.0835, + "eu-west-1": 0.0807, + "eu-west-2": 0.08315, + "eu-west-3": 0.0, + "il-central-1": 0.08314, + "me-south-1": 0.0855, + "mx-central-1": 0.07726, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0751, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0891, + "us-west-1": 0.0859, + "us-west-2": 0.0 + }, + "c6gn.large": { + "ap-east-1": 0.1783, + "ap-northeast-1": 0.1728, + "ap-northeast-2": 0.17105, + "ap-northeast-3": 0.17302, + "ap-south-1": 0.1503, + "ap-southeast-1": 0.1628, + "ap-southeast-2": 0.1881, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.15638, + "ap-southeast-7": 0.0, + "ca-central-1": 0.1584, + "ca-west-1": 0.1584, + "eu-central-1": 0.1624, + "eu-north-1": 0.1568, + "eu-south-1": 0.17732, + "eu-west-1": 0.1614, + "eu-west-2": 0.1663, + "eu-west-3": 0.17655, + "il-central-1": 0.16628, + "me-south-1": 0.18172, + "mx-central-1": 0.15452, + "sa-east-1": 0.1968, + "us-east-1": 0.15884, + "us-east-2": 0.0, + "us-gov-east-1": 0.1678, + "us-gov-west-1": 0.0, + "us-west-1": 0.1718, + "us-west-2": 0.0 + }, + "c6gn.xlarge": { + "ap-east-1": 0.3566, + "ap-northeast-1": 0.3456, + "ap-northeast-2": 0.3226, + "ap-northeast-3": 0.0, + "ap-south-1": 0.3006, + "ap-southeast-1": 0.3256, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.326, + "ap-southeast-5": 0.29592, + "ap-southeast-7": 0.31275, + "ca-central-1": 0.0, + "ca-west-1": 0.3168, + "eu-central-1": 0.3248, + "eu-north-1": 0.3136, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.3531, + "il-central-1": 0.33256, + "me-south-1": 0.0, + "mx-central-1": 0.32718, + "sa-east-1": 0.3936, + "us-east-1": 0.3004, + "us-east-2": 0.31768, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.3356, + "us-west-1": 0.0, + "us-west-2": 0.3004 + }, + "c6gn.metal": { + "ca-central-1": 0.0, + "eu-west-3": 4.8672 + }, + "c6gn.2xlarge": { + "ap-east-1": 0.7132, + "ap-northeast-1": 0.7348, + "ap-northeast-2": 0.6842, + "ap-northeast-3": 0.0, + "ap-south-1": 0.6012, + "ap-southeast-1": 0.6512, + "ap-southeast-2": 0.7072, + "ap-southeast-3": 0.652, + "ap-southeast-5": 0.6255, + "ap-southeast-7": 0.59184, + "ca-central-1": 0.6336, + "ca-west-1": 0.0, + "eu-central-1": 0.6496, + "eu-north-1": 0.6272, + "eu-south-1": 0.668, + "eu-west-1": 0.68464, + "eu-west-2": 0.6652, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-south-1": 0.72688, + "mx-central-1": 0.61808, + "sa-east-1": 0.0, + "us-east-1": 0.6008, + "us-east-2": 0.0, + "us-gov-east-1": 0.6712, + "us-gov-west-1": 0.6712, + "us-west-1": 0.0, + "us-west-2": 0.6008 + }, + "c6gn.4xlarge": { + "ap-east-1": 1.3128, + "ap-northeast-1": 1.2688, + "ap-northeast-2": 1.1768, + "ap-northeast-3": 1.27056, + "ap-south-1": 1.0888, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.3008, + "ap-southeast-3": 1.1904, + "ap-southeast-5": 1.07008, + "ap-southeast-7": 0.0, + "ca-central-1": 1.1536, + "ca-west-1": 0.0, + "eu-central-1": 1.1856, + "eu-north-1": 1.1408, + "eu-south-1": 1.2224, + "eu-west-1": 1.25568, + "eu-west-2": 1.2168, + "eu-west-3": 1.2168, + "il-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 1.19514, + "sa-east-1": 1.4608, + "us-east-1": 1.088, + "us-east-2": 1.088, + "us-gov-east-1": 1.2288, + "us-gov-west-1": 1.2288, + "us-west-1": 1.2608, + "us-west-2": 1.088 + }, + "c6gn.8xlarge": { + "ap-east-1": 2.6256, + "ap-northeast-1": 2.5376, + "ap-northeast-2": 2.5096, + "ap-northeast-3": 2.54112, + "ap-south-1": 2.1776, + "ap-southeast-1": 2.3776, + "ap-southeast-2": 2.6016, + "ap-southeast-3": 2.3808, + "ap-southeast-5": 2.14016, + "ap-southeast-7": 0.0, + "ca-central-1": 2.45856, + "ca-west-1": 2.3072, + "eu-central-1": 2.52896, + "eu-north-1": 2.2816, + "eu-south-1": 2.4448, + "eu-west-1": 0.0, + "eu-west-2": 2.5976, + "eu-west-3": 2.4336, + "il-central-1": 2.43328, + "me-south-1": 2.5088, + "mx-central-1": 2.24512, + "sa-east-1": 0.0, + "us-east-1": 2.176, + "us-east-2": 2.176, + "us-gov-east-1": 2.4576, + "us-gov-west-1": 0.0, + "us-west-1": 2.5216, + "us-west-2": 2.31424 + }, + "c6gn.12xlarge": { + "ap-east-1": 4.2132, + "ap-northeast-1": 3.8064, + "ap-northeast-2": 3.5304, + "ap-northeast-3": 0.0, + "ap-south-1": 3.2664, + "ap-southeast-1": 3.804, + "ap-southeast-2": 4.1736, + "ap-southeast-3": 3.5712, + "ap-southeast-5": 3.21024, + "ap-southeast-7": 3.41222, + "ca-central-1": 3.4608, + "ca-west-1": 3.68784, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 3.6672, + "eu-west-1": 3.5328, + "eu-west-2": 3.6504, + "eu-west-3": 3.8964, + "il-central-1": 0.0, + "me-south-1": 4.02048, + "mx-central-1": 3.58541, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 3.264, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.6864, + "us-west-1": 3.7824, + "us-west-2": 3.264 + }, + "c6gn.16xlarge": { + "ap-east-1": 5.6176, + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.7072, + "ap-northeast-3": 5.43174, + "ap-south-1": 0.0, + "ap-southeast-1": 4.7552, + "ap-southeast-2": 5.2032, + "ap-southeast-3": 4.7616, + "ap-southeast-5": 4.28032, + "ap-southeast-7": 0.0, + "ca-central-1": 4.6144, + "ca-west-1": 4.6144, + "eu-central-1": 5.05792, + "eu-north-1": 4.8608, + "eu-south-1": 4.8896, + "eu-west-1": 4.7104, + "eu-west-2": 5.1952, + "eu-west-3": 4.8672, + "il-central-1": 4.86656, + "me-south-1": 5.36064, + "mx-central-1": 4.49024, + "sa-east-1": 5.8432, + "us-east-1": 4.62848, + "us-east-2": 4.352, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.9152, + "us-west-1": 5.0432, + "us-west-2": 4.352 + }, + "c6i.large": { + "af-south-1": 0.1892, + "ap-east-1": 0.0, + "ap-northeast-1": 0.1708, + "ap-northeast-2": 0.1598, + "ap-northeast-3": 0.1708, + "ap-south-1": 0.1573, + "ap-south-2": 0.1488, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.15543, + "ap-southeast-7": 0.1471, + "ca-central-1": 0.1568, + "ca-west-1": 0.1661, + "eu-central-1": 0.0, + "eu-north-1": 0.1548, + "eu-south-1": 0.0, + "eu-west-1": 0.155, + "eu-west-2": 0.1648, + "eu-west-3": 0.1749, + "il-central-1": 0.15956, + "me-south-1": 0.1694, + "mx-central-1": 0.15305, + "sa-east-1": 0.1948, + "us-east-1": 0.1573, + "us-east-2": 0.1488, + "us-gov-east-1": 0.176, + "us-gov-west-1": 0.0, + "us-west-1": 0.1698, + "us-west-2": 0.1488 + }, + "c6i.xlarge": { + "af-south-1": 0.3556, + "ap-east-1": 0.3436, + "ap-northeast-1": 0.363, + "ap-northeast-2": 0.3196, + "ap-northeast-3": 0.3416, + "ap-south-1": 0.3146, + "ap-south-2": 0.3146, + "ap-southeast-1": 0.3236, + "ap-southeast-2": 0.3496, + "ap-southeast-5": 0.31086, + "ap-southeast-7": 0.2942, + "ca-central-1": 0.3136, + "ca-west-1": 0.3136, + "eu-central-1": 0.3216, + "eu-north-1": 0.3096, + "eu-south-1": 0.3296, + "eu-west-1": 0.31, + "eu-west-2": 0.0, + "eu-west-3": 0.3498, + "il-central-1": 0.31912, + "me-south-1": 0.3388, + "mx-central-1": 0.3061, + "sa-east-1": 0.3896, + "us-east-1": 0.2976, + "us-east-2": 0.2976, + "us-gov-east-1": 0.3316, + "us-gov-west-1": 0.3316, + "us-west-1": 0.3396, + "us-west-2": 0.2976 + }, + "c6i.metal": { + "af-south-1": 9.8688, + "ap-east-1": 9.4848, + "ap-northeast-1": 9.4208, + "ap-northeast-2": 8.7168, + "ap-northeast-3": 9.4208, + "ap-south-1": 8.0128, + "ap-south-2": 8.0128, + "ap-southeast-1": 8.8448, + "ap-southeast-2": 0.0, + "ap-southeast-5": 7.904, + "ap-southeast-7": 7.904, + "ca-central-1": 8.5248, + "ca-west-1": 8.5248, + "eu-central-1": 8.7808, + "eu-north-1": 8.3968, + "eu-south-1": 0.0, + "eu-west-1": 8.4096, + "eu-west-2": 9.0368, + "eu-west-3": 9.0368, + "il-central-1": 8.70144, + "me-south-1": 9.3312, + "mx-central-1": 8.2848, + "sa-east-1": 10.9568, + "us-east-1": 8.0128, + "us-east-2": 8.0128, + "us-gov-east-1": 9.1008, + "us-gov-west-1": 9.1008, + "us-west-1": 9.3568, + "us-west-2": 8.0128 + }, + "c6i.2xlarge": { + "af-south-1": 0.7112, + "ap-east-1": 0.6872, + "ap-northeast-1": 0.726, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.726, + "ap-south-1": 0.6292, + "ap-south-2": 0.5952, + "ap-southeast-1": 0.6472, + "ap-southeast-2": 0.6992, + "ap-southeast-5": 0.5884, + "ap-southeast-7": 0.5884, + "ca-central-1": 0.6272, + "ca-west-1": 0.6272, + "eu-central-1": 0.0, + "eu-north-1": 0.6556, + "eu-south-1": 0.6592, + "eu-west-1": 0.62, + "eu-west-2": 0.6996, + "eu-west-3": 0.6592, + "il-central-1": 0.63824, + "me-south-1": 0.0, + "mx-central-1": 0.6122, + "sa-east-1": 0.0, + "us-east-1": 0.6292, + "us-east-2": 0.6292, + "us-gov-east-1": 0.704, + "us-gov-west-1": 0.6632, + "us-west-1": 0.6792, + "us-west-2": 0.5952 + }, + "c6i.4xlarge": { + "af-south-1": 1.3088, + "ap-east-1": 1.2608, + "ap-northeast-1": 1.2528, + "ap-northeast-2": 1.2416, + "ap-northeast-3": 1.3384, + "ap-south-1": 1.0768, + "ap-south-2": 1.0768, + "ap-southeast-1": 1.2592, + "ap-southeast-2": 1.2848, + "ap-southeast-5": 1.0632, + "ap-southeast-7": 1.0632, + "ca-central-1": 1.2152, + "ca-west-1": 1.1408, + "eu-central-1": 1.1728, + "eu-north-1": 0.0, + "eu-south-1": 1.2048, + "eu-west-1": 1.1264, + "eu-west-2": 1.2856, + "eu-west-3": 1.2856, + "il-central-1": 1.16288, + "me-south-1": 1.32608, + "mx-central-1": 1.1108, + "sa-east-1": 1.4448, + "us-east-1": 1.0768, + "us-east-2": 1.0768, + "us-gov-east-1": 1.2128, + "us-gov-west-1": 1.2128, + "us-west-1": 1.3296, + "us-west-2": 1.0768 + }, + "c6i.8xlarge": { + "af-south-1": 2.6176, + "ap-east-1": 2.6944, + "ap-northeast-1": 2.5056, + "ap-northeast-2": 2.3296, + "ap-northeast-3": 2.5056, + "ap-south-1": 0.0, + "ap-south-2": 2.1536, + "ap-southeast-1": 2.5184, + "ap-southeast-2": 2.5696, + "ap-southeast-5": 2.1264, + "ap-southeast-7": 2.1264, + "ca-central-1": 2.4304, + "ca-west-1": 2.2816, + "eu-central-1": 2.5008, + "eu-north-1": 2.2496, + "eu-south-1": 2.4096, + "eu-west-1": 2.2528, + "eu-west-2": 2.5712, + "eu-west-3": 2.4096, + "il-central-1": 2.47898, + "me-south-1": 2.4832, + "mx-central-1": 2.2216, + "sa-east-1": 2.8896, + "us-east-1": 2.2896, + "us-east-2": 2.1536, + "us-gov-east-1": 2.5888, + "us-gov-west-1": 2.4256, + "us-west-1": 2.6592, + "us-west-2": 2.1536 + }, + "c6i.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 3.7824, + "ap-northeast-1": 3.7584, + "ap-northeast-2": 3.7248, + "ap-northeast-3": 3.7584, + "ap-south-1": 3.2304, + "ap-south-2": 3.4344, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 3.1896, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 3.4224, + "eu-central-1": 3.5184, + "eu-north-1": 3.3744, + "eu-south-1": 3.6144, + "eu-west-1": 3.3792, + "eu-west-2": 0.0, + "eu-west-3": 3.6144, + "il-central-1": 3.48864, + "me-south-1": 3.7248, + "mx-central-1": 3.3324, + "sa-east-1": 4.3344, + "us-east-1": 3.4344, + "us-east-2": 3.4344, + "us-gov-east-1": 3.6384, + "us-gov-west-1": 3.6384, + "us-west-1": 3.7344, + "us-west-2": 3.4344 + }, + "c6i.16xlarge": { + "af-south-1": 5.6, + "ap-east-1": 5.0432, + "ap-northeast-1": 5.0112, + "ap-northeast-2": 4.9664, + "ap-northeast-3": 5.0112, + "ap-south-1": 4.5792, + "ap-south-2": 4.5792, + "ap-southeast-1": 5.0368, + "ap-southeast-2": 5.1392, + "ap-southeast-5": 4.2528, + "ap-southeast-7": 4.2528, + "ca-central-1": 4.5632, + "ca-west-1": 4.5632, + "eu-central-1": 5.0016, + "eu-north-1": 0.0, + "eu-south-1": 4.8192, + "eu-west-1": 4.5056, + "eu-west-2": 4.8192, + "eu-west-3": 4.8192, + "il-central-1": 4.65152, + "me-south-1": 4.9664, + "mx-central-1": 4.7288, + "sa-east-1": 5.7792, + "us-east-1": 4.3072, + "us-east-2": 4.3072, + "us-gov-east-1": 4.8512, + "us-gov-west-1": 4.8512, + "us-west-1": 4.9792, + "us-west-2": 0.0 + }, + "c6i.24xlarge": { + "af-south-1": 8.4, + "ap-east-1": 7.5648, + "ap-northeast-1": 7.5168, + "ap-northeast-2": 7.4496, + "ap-northeast-3": 0.0, + "ap-south-1": 6.8688, + "ap-south-2": 6.4608, + "ap-southeast-1": 7.0848, + "ap-southeast-2": 8.2416, + "ap-southeast-5": 0.0, + "ap-southeast-7": 6.3792, + "ca-central-1": 6.8448, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 6.7488, + "eu-south-1": 0.0, + "eu-west-1": 6.7584, + "eu-west-2": 7.2288, + "eu-west-3": 7.7136, + "il-central-1": 0.0, + "me-south-1": 7.95648, + "mx-central-1": 6.6648, + "sa-east-1": 9.2976, + "us-east-1": 6.4608, + "us-east-2": 0.0, + "us-gov-east-1": 7.2768, + "us-gov-west-1": 0.0, + "us-west-1": 7.4688, + "us-west-2": 6.4608 + }, + "c6i.32xlarge": { + "af-south-1": 9.8688, + "ap-east-1": 9.4848, + "ap-northeast-1": 9.4208, + "ap-northeast-2": 8.7168, + "ap-northeast-3": 0.0, + "ap-south-1": 8.0128, + "ap-south-2": 0.0, + "ap-southeast-1": 8.8448, + "ap-southeast-2": 9.6768, + "ap-southeast-5": 7.904, + "ap-southeast-7": 7.904, + "ca-central-1": 8.5248, + "ca-west-1": 8.5248, + "eu-central-1": 8.7808, + "eu-north-1": 0.0, + "eu-south-1": 9.0368, + "eu-west-1": 8.4096, + "eu-west-2": 9.0368, + "eu-west-3": 9.0368, + "il-central-1": 0.0, + "me-south-1": 9.3312, + "mx-central-1": 8.2848, + "sa-east-1": 10.9568, + "us-east-1": 8.0128, + "us-east-2": 8.0128, + "us-gov-east-1": 9.1008, + "us-gov-west-1": 9.1008, + "us-west-1": 9.3568, + "us-west-2": 8.0128 + }, + "c6id.large": { + "ap-northeast-1": 0.1919, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.1814, + "ap-southeast-2": 0.1961, + "ap-southeast-5": 0.16376, + "ap-southeast-7": 0.16376, + "ca-central-1": 0.1751, + "ca-west-1": 0.1751, + "eu-central-1": 0.18035, + "eu-west-1": 0.1897, + "eu-west-2": 0.18455, + "il-central-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.17468, + "us-east-2": 0.1646, + "us-gov-west-1": 0.19778, + "us-west-2": 0.1646 + }, + "c6id.xlarge": { + "ap-northeast-1": 0.3838, + "ap-northeast-2": 0.3586, + "ap-southeast-1": 0.3628, + "ap-southeast-2": 0.3922, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.32752, + "ca-central-1": 0.37246, + "ca-west-1": 0.0, + "eu-central-1": 0.3607, + "eu-west-1": 0.37939, + "eu-west-2": 0.39325, + "il-central-1": 0.39197, + "mx-central-1": 0.33928, + "sa-east-1": 0.4405, + "us-east-1": 0.34936, + "us-east-2": 0.34936, + "us-gov-west-1": 0.3712, + "us-west-2": 0.3292 + }, + "c6id.metal": { + "ap-northeast-1": 10.7712, + "ap-northeast-2": 9.9648, + "ap-southeast-1": 10.0992, + "ap-southeast-2": 11.04, + "ap-southeast-5": 8.97024, + "ap-southeast-7": 0.0, + "ca-central-1": 9.696, + "ca-west-1": 9.696, + "eu-central-1": 10.032, + "eu-west-1": 9.8976, + "eu-west-2": 10.3008, + "il-central-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 9.024, + "us-east-2": 0.0, + "us-gov-west-1": 10.368, + "us-west-2": 0.0 + }, + "c6id.2xlarge": { + "ap-northeast-1": 0.7676, + "ap-northeast-2": 0.7634, + "ap-southeast-1": 0.7256, + "ap-southeast-2": 0.7844, + "ap-southeast-5": 0.65504, + "ap-southeast-7": 0.65504, + "ca-central-1": 0.7004, + "ca-west-1": 0.7004, + "eu-central-1": 0.0, + "eu-west-1": 0.75878, + "eu-west-2": 0.7382, + "il-central-1": 0.73588, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.6584, + "us-east-2": 0.69872, + "us-gov-west-1": 0.7424, + "us-west-2": 0.6584 + }, + "c6id.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.3208, + "ap-southeast-1": 1.43168, + "ap-southeast-2": 1.4552, + "ap-southeast-5": 1.19648, + "ap-southeast-7": 1.19648, + "ca-central-1": 1.2872, + "ca-west-1": 0.0, + "eu-central-1": 1.42244, + "eu-west-1": 1.3124, + "eu-west-2": 1.3628, + "il-central-1": 0.0, + "mx-central-1": 1.24352, + "sa-east-1": 1.6484, + "us-east-1": 1.2032, + "us-east-2": 1.2032, + "us-gov-west-1": 1.3712, + "us-west-2": 1.28384 + }, + "c6id.8xlarge": { + "ap-northeast-1": 2.8432, + "ap-northeast-2": 2.6416, + "ap-southeast-1": 2.6752, + "ap-southeast-2": 2.9104, + "ap-southeast-5": 2.39296, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 2.5744, + "eu-central-1": 2.6584, + "eu-west-1": 2.6248, + "eu-west-2": 2.7256, + "il-central-1": 2.71632, + "mx-central-1": 2.65638, + "sa-east-1": 3.2968, + "us-east-1": 2.4064, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 2.4064 + }, + "c6id.12xlarge": { + "ap-northeast-1": 4.2648, + "ap-northeast-2": 3.9624, + "ap-southeast-1": 4.0128, + "ap-southeast-2": 4.68312, + "ap-southeast-5": 3.58944, + "ap-southeast-7": 3.58944, + "ca-central-1": 3.8616, + "ca-west-1": 4.12872, + "eu-central-1": 3.9876, + "eu-west-1": 3.9372, + "eu-west-2": 4.0884, + "il-central-1": 4.07448, + "mx-central-1": 3.98458, + "sa-east-1": 4.9452, + "us-east-1": 3.6096, + "us-east-2": 0.0, + "us-gov-west-1": 4.1136, + "us-west-2": 3.6096 + }, + "c6id.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.2832, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.8208, + "ap-southeast-5": 0.0, + "ap-southeast-7": 5.10579, + "ca-central-1": 5.1488, + "ca-west-1": 5.1488, + "eu-central-1": 5.3168, + "eu-west-1": 0.0, + "eu-west-2": 5.4512, + "il-central-1": 5.43264, + "mx-central-1": 4.97408, + "sa-east-1": 6.5936, + "us-east-1": 5.13536, + "us-east-2": 5.13536, + "us-gov-west-1": 5.4848, + "us-west-2": 0.0 + }, + "c6id.24xlarge": { + "ap-northeast-1": 9.14448, + "ap-northeast-2": 7.9248, + "ap-southeast-1": 8.59008, + "ap-southeast-2": 8.7312, + "ap-southeast-5": 7.65869, + "ap-southeast-7": 7.17888, + "ca-central-1": 0.0, + "ca-west-1": 7.7232, + "eu-central-1": 0.0, + "eu-west-1": 8.42376, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "mx-central-1": 7.46112, + "sa-east-1": 9.8904, + "us-east-1": 0.0, + "us-east-2": 7.2192, + "us-gov-west-1": 8.2272, + "us-west-2": 0.0 + }, + "c6id.32xlarge": { + "ap-northeast-1": 10.7712, + "ap-northeast-2": 9.9648, + "ap-southeast-1": 10.0992, + "ap-southeast-2": 11.04, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 9.696, + "ca-west-1": 9.696, + "eu-central-1": 10.032, + "eu-west-1": 9.8976, + "eu-west-2": 0.0, + "il-central-1": 10.26368, + "mx-central-1": 9.34656, + "sa-east-1": 12.5856, + "us-east-1": 9.024, + "us-east-2": 0.0, + "us-gov-west-1": 10.368, + "us-west-2": 9.024 + }, + "c6in.large": { + "af-south-1": 0.21626, + "ap-east-1": 0.0, + "ap-northeast-1": 0.2066, + "ap-northeast-2": 0.20471, + "ap-south-1": 0.1772, + "ap-south-2": 0.18843, + "ap-southeast-1": 0.194, + "ap-southeast-2": 0.22666, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.17447, + "ca-central-1": 0.20009, + "eu-central-1": 0.20587, + "eu-central-2": 0.0, + "eu-north-1": 0.1856, + "eu-south-1": 0.19925, + "eu-south-2": 0.1918, + "eu-west-1": 0.1919, + "eu-west-2": 0.0, + "eu-west-3": 0.1982, + "il-central-1": 0.19831, + "me-central-1": 0.2046, + "me-south-1": 0.2045, + "sa-east-1": 0.2381, + "us-east-1": 0.1772, + "us-east-2": 0.0, + "us-gov-east-1": 0.2003, + "us-gov-west-1": 0.0, + "us-west-1": 0.20555, + "us-west-2": 0.0 + }, + "c6in.xlarge": { + "af-south-1": 0.43252, + "ap-east-1": 0.4279, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.3838, + "ap-south-1": 0.0, + "ap-south-2": 0.3542, + "ap-southeast-1": 0.388, + "ap-southeast-2": 0.4237, + "ap-southeast-3": 0.41404, + "ap-southeast-4": 0.4236, + "ap-southeast-5": 0.34894, + "ca-central-1": 0.3754, + "eu-central-1": 0.3859, + "eu-central-2": 0.44066, + "eu-north-1": 0.3712, + "eu-south-1": 0.3985, + "eu-south-2": 0.4092, + "eu-west-1": 0.40942, + "eu-west-2": 0.42328, + "eu-west-3": 0.3964, + "il-central-1": 0.39662, + "me-central-1": 0.4092, + "me-south-1": 0.43714, + "sa-east-1": 0.0, + "us-east-1": 0.37708, + "us-east-2": 0.3544, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.4111, + "us-west-2": 0.3544 + }, + "c6in.metal": { + "af-south-1": 12.33024, + "ap-east-1": 12.1824, + "ap-northeast-1": 0.0, + "ap-northeast-2": 10.7712, + "ap-south-1": 9.8304, + "ap-south-2": 9.824, + "ap-southeast-1": 10.9056, + "ap-southeast-2": 12.048, + "ap-southeast-3": 10.9056, + "ap-southeast-4": 12.0448, + "ap-southeast-5": 9.65568, + "ca-central-1": 0.0, + "eu-central-1": 10.8384, + "eu-central-2": 11.68, + "eu-north-1": 10.368, + "eu-south-1": 11.2416, + "eu-south-2": 10.7648, + "eu-west-1": 10.7712, + "eu-west-2": 11.1744, + "eu-west-3": 11.1744, + "il-central-1": 11.18144, + "me-central-1": 11.584, + "me-south-1": 11.5776, + "sa-east-1": 13.728, + "us-east-1": 9.8304, + "us-east-2": 9.8304, + "us-gov-east-1": 11.3088, + "us-gov-west-1": 0.0, + "us-west-1": 11.6448, + "us-west-2": 9.8304 + }, + "c6in.2xlarge": { + "af-south-1": 0.86504, + "ap-east-1": 0.8558, + "ap-northeast-1": 0.88352, + "ap-northeast-2": 0.7676, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.90662, + "ap-southeast-3": 0.776, + "ap-southeast-4": 0.8472, + "ap-southeast-5": 0.74215, + "ca-central-1": 0.7508, + "eu-central-1": 0.7718, + "eu-central-2": 0.8244, + "eu-north-1": 0.79112, + "eu-south-1": 0.797, + "eu-south-2": 0.7672, + "eu-west-1": 0.7676, + "eu-west-2": 0.84656, + "eu-west-3": 0.84656, + "il-central-1": 0.79324, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 0.9524, + "us-east-1": 0.75416, + "us-east-2": 0.7088, + "us-gov-east-1": 0.8012, + "us-gov-west-1": 0.8012, + "us-west-1": 0.8222, + "us-west-2": 0.0 + }, + "c6in.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.598, + "ap-northeast-1": 1.5392, + "ap-northeast-2": 1.4216, + "ap-south-1": 1.304, + "ap-south-2": 1.3032, + "ap-southeast-1": 1.54256, + "ap-southeast-2": 1.69964, + "ap-southeast-3": 1.54256, + "ap-southeast-4": 0.0, + "ap-southeast-5": 1.28216, + "ca-central-1": 1.388, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 1.4208, + "eu-west-1": 1.52408, + "eu-west-2": 1.472, + "eu-west-3": 1.472, + "il-central-1": 1.47288, + "me-central-1": 1.63584, + "me-south-1": 1.63496, + "sa-east-1": 1.7912, + "us-east-1": 1.304, + "us-east-2": 1.39472, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.4888, + "us-west-1": 1.5308, + "us-west-2": 1.304 + }, + "c6in.8xlarge": { + "af-south-1": 3.23296, + "ap-east-1": 3.43624, + "ap-northeast-1": 3.0784, + "ap-northeast-2": 2.8432, + "ap-south-1": 0.0, + "ap-south-2": 2.6064, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.39928, + "ap-southeast-3": 3.08512, + "ap-southeast-4": 3.3984, + "ap-southeast-5": 2.56432, + "ca-central-1": 2.97424, + "eu-central-1": 2.86, + "eu-central-2": 3.0704, + "eu-north-1": 2.7424, + "eu-south-1": 2.9608, + "eu-south-2": 0.0, + "eu-west-1": 2.8432, + "eu-west-2": 0.0, + "eu-west-3": 2.944, + "il-central-1": 2.94576, + "me-central-1": 0.0, + "me-south-1": 3.0448, + "sa-east-1": 3.86128, + "us-east-1": 2.608, + "us-east-2": 2.608, + "us-gov-east-1": 2.9776, + "us-gov-west-1": 2.9776, + "us-west-1": 3.2884, + "us-west-2": 2.608 + }, + "c6in.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.794, + "ap-northeast-1": 4.6176, + "ap-northeast-2": 4.57224, + "ap-south-1": 3.912, + "ap-south-2": 3.9096, + "ap-southeast-1": 4.3152, + "ap-southeast-2": 4.7436, + "ap-southeast-3": 4.3152, + "ap-southeast-4": 4.7424, + "ap-southeast-5": 4.11209, + "ca-central-1": 4.164, + "eu-central-1": 4.59996, + "eu-central-2": 4.94712, + "eu-north-1": 4.1136, + "eu-south-1": 0.0, + "eu-south-2": 4.2624, + "eu-west-1": 4.2648, + "eu-west-2": 4.416, + "eu-west-3": 4.416, + "il-central-1": 4.74146, + "me-central-1": 4.5696, + "me-south-1": 4.90488, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 4.794, + "us-gov-west-1": 4.794, + "us-west-1": 0.0, + "us-west-2": 3.912 + }, + "c6in.16xlarge": { + "af-south-1": 6.46592, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.6864, + "ap-south-1": 5.216, + "ap-south-2": 5.2128, + "ap-southeast-1": 5.7536, + "ap-southeast-2": 6.3248, + "ap-southeast-3": 6.17024, + "ap-southeast-4": 0.0, + "ap-southeast-5": 5.12864, + "ca-central-1": 5.552, + "eu-central-1": 0.0, + "eu-central-2": 6.59616, + "eu-north-1": 5.4848, + "eu-south-1": 0.0, + "eu-south-2": 5.6832, + "eu-west-1": 0.0, + "eu-west-2": 5.888, + "eu-west-3": 5.888, + "il-central-1": 6.32195, + "me-central-1": 6.0928, + "me-south-1": 6.0896, + "sa-east-1": 0.0, + "us-east-1": 5.57888, + "us-east-2": 0.0, + "us-gov-east-1": 5.9552, + "us-gov-west-1": 6.392, + "us-west-1": 6.5768, + "us-west-2": 0.0 + }, + "c6in.24xlarge": { + "af-south-1": 9.69888, + "ap-east-1": 9.588, + "ap-northeast-1": 9.92064, + "ap-northeast-2": 8.5296, + "ap-south-1": 7.824, + "ap-south-2": 8.36304, + "ap-southeast-1": 9.25536, + "ap-southeast-2": 9.4872, + "ap-southeast-3": 8.6304, + "ap-southeast-4": 10.1952, + "ap-southeast-5": 0.0, + "ca-central-1": 8.328, + "eu-central-1": 8.58, + "eu-central-2": 0.0, + "eu-north-1": 8.81184, + "eu-south-1": 0.0, + "eu-south-2": 8.5248, + "eu-west-1": 8.5296, + "eu-west-2": 0.0, + "eu-west-3": 8.832, + "il-central-1": 8.83728, + "me-central-1": 9.1392, + "me-south-1": 9.80976, + "sa-east-1": 10.7472, + "us-east-1": 0.0, + "us-east-2": 8.36832, + "us-gov-east-1": 8.9328, + "us-gov-west-1": 8.9328, + "us-west-1": 9.1848, + "us-west-2": 7.824 + }, + "c6in.32xlarge": { + "af-south-1": 0.0, + "ap-east-1": 12.1824, + "ap-northeast-1": 11.712, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 9.824, + "ap-southeast-1": 10.9056, + "ap-southeast-2": 12.048, + "ap-southeast-3": 10.9056, + "ap-southeast-4": 12.0448, + "ap-southeast-5": 9.65568, + "ca-central-1": 10.5024, + "eu-central-1": 10.8384, + "eu-central-2": 11.68, + "eu-north-1": 10.368, + "eu-south-1": 11.2416, + "eu-south-2": 10.7648, + "eu-west-1": 10.7712, + "eu-west-2": 11.1744, + "eu-west-3": 11.1744, + "il-central-1": 11.18144, + "me-central-1": 11.584, + "me-south-1": 11.5776, + "sa-east-1": 13.728, + "us-east-1": 9.8304, + "us-east-2": 9.8304, + "us-gov-east-1": 11.3088, + "us-gov-west-1": 0.0, + "us-west-1": 11.6448, + "us-west-2": 0.0 + }, + "c7a.medium": { + "ap-northeast-1": 0.10296, + "eu-central-1": 0.09632, + "eu-north-1": 0.0, + "eu-south-2": 0.08986, + "eu-west-1": 0.08696, + "us-east-1": 0.08322, + "us-east-2": 0.08835, + "us-west-2": 0.08322 + }, + "c7a.large": { + "ap-northeast-1": 0.193, + "eu-central-1": 0.19264, + "eu-north-1": 0.0, + "eu-south-2": 0.17972, + "eu-west-1": 0.17392, + "us-east-1": 0.16644, + "us-east-2": 0.16644, + "us-west-2": 0.16644 + }, + "c7a.xlarge": { + "ap-northeast-1": 0.386, + "eu-central-1": 0.36186, + "eu-north-1": 0.0, + "eu-south-2": 0.35944, + "eu-west-1": 0.34784, + "us-east-1": 0.35341, + "us-east-2": 0.33288, + "us-west-2": 0.33288 + }, + "c7a.metal-48xl": { + "ap-northeast-1": 16.2624, + "eu-central-1": 15.10368, + "eu-north-1": 0.0, + "eu-south-2": 14.98752, + "eu-west-1": 14.43072, + "us-east-1": 13.71264, + "us-east-2": 13.71264, + "us-west-2": 13.71264 + }, + "c7a.2xlarge": { + "ap-northeast-1": 0.772, + "eu-central-1": 0.72372, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.69568, + "us-east-1": 0.0, + "us-east-2": 0.70682, + "us-west-2": 0.66576 + }, + "c7a.4xlarge": { + "ap-northeast-1": 1.4304, + "eu-central-1": 1.42754, + "eu-north-1": 1.27584, + "eu-south-2": 1.32416, + "eu-west-1": 1.27776, + "us-east-1": 1.21792, + "us-east-2": 1.21792, + "us-west-2": 1.21792 + }, + "c7a.8xlarge": { + "ap-northeast-1": 2.8608, + "eu-central-1": 2.66768, + "eu-north-1": 2.55168, + "eu-south-2": 0.0, + "eu-west-1": 2.55552, + "us-east-1": 2.43584, + "us-east-2": 0.0, + "us-west-2": 2.43584 + }, + "c7a.12xlarge": { + "ap-northeast-1": 4.2912, + "eu-central-1": 0.0, + "eu-north-1": 3.82752, + "eu-south-2": 0.0, + "eu-west-1": 4.09757, + "us-east-1": 3.65376, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "c7a.16xlarge": { + "ap-northeast-1": 5.7216, + "eu-central-1": 5.33536, + "eu-north-1": 5.10336, + "eu-south-2": 5.29664, + "eu-west-1": 5.11104, + "us-east-1": 5.20013, + "us-east-2": 4.87168, + "us-west-2": 5.20013 + }, + "c7a.24xlarge": { + "ap-northeast-1": 8.5824, + "eu-central-1": 8.00304, + "eu-north-1": 7.65504, + "eu-south-2": 8.50138, + "eu-west-1": 8.19514, + "us-east-1": 7.30752, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "c7a.32xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 9.60512, + "eu-south-2": 9.99168, + "eu-west-1": 9.62048, + "us-east-1": 9.14176, + "us-east-2": 9.79866, + "us-west-2": 9.14176 + }, + "c7a.48xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 15.10368, + "eu-north-1": 0.0, + "eu-south-2": 14.98752, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 13.71264, + "us-west-2": 13.71264 + }, + "c7g.medium": { + "ap-east-1": 0.0774, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0802, + "ap-south-1": 0.0, + "ap-south-2": 0.0564, + "ap-southeast-1": 0.0736, + "ap-southeast-2": 0.0791, + "ap-southeast-5": 0.0673, + "ap-southeast-7": 0.0673, + "ca-central-1": 0.0714, + "eu-central-1": 0.0757, + "eu-central-2": 0.0773, + "eu-north-1": 0.0706, + "eu-south-1": 0.0774, + "eu-south-2": 0.0707, + "eu-west-1": 0.0707, + "eu-west-2": 0.0748, + "eu-west-3": 0.0, + "mx-central-1": 0.07, + "sa-east-1": 0.0874, + "us-east-1": 0.0682, + "us-east-2": 0.0703, + "us-gov-east-1": 0.078, + "us-gov-west-1": 0.078, + "us-west-1": 0.077, + "us-west-2": 0.0704 + }, + "c7g.large": { + "ap-east-1": 0.1548, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1454, + "ap-northeast-3": 0.0, + "ap-south-1": 0.1129, + "ap-south-2": 0.1129, + "ap-southeast-1": 0.1471, + "ap-southeast-2": 0.1641, + "ap-southeast-5": 0.1346, + "ap-southeast-7": 0.0, + "ca-central-1": 0.1429, + "eu-central-1": 0.1463, + "eu-central-2": 0.1602, + "eu-north-1": 0.1412, + "eu-south-1": 0.1494, + "eu-south-2": 0.1413, + "eu-west-1": 0.1413, + "eu-west-2": 0.1551, + "eu-west-3": 0.0, + "mx-central-1": 0.1399, + "sa-east-1": 0.1819, + "us-east-1": 0.1408, + "us-east-2": 0.1361, + "us-gov-east-1": 0.1505, + "us-gov-west-1": 0.1505, + "us-west-1": 0.1539, + "us-west-2": 0.1363 + }, + "c7g.xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.3209, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.3209, + "ap-south-1": 0.2258, + "ap-south-2": 0.0, + "ap-southeast-1": 0.2942, + "ap-southeast-2": 0.3163, + "ap-southeast-5": 0.2692, + "ap-southeast-7": 0.2692, + "ca-central-1": 0.2857, + "eu-central-1": 0.2925, + "eu-central-2": 0.0, + "eu-north-1": 0.2823, + "eu-south-1": 0.2989, + "eu-south-2": 0.2826, + "eu-west-1": 0.2826, + "eu-west-2": 0.2993, + "eu-west-3": 0.2993, + "mx-central-1": 0.2798, + "sa-east-1": 0.0, + "us-east-1": 0.2726, + "us-east-2": 0.2812, + "us-gov-east-1": 0.301, + "us-gov-west-1": 0.301, + "us-west-1": 0.3078, + "us-west-2": 0.2726 + }, + "c7g.metal": { + "ap-east-1": 0.0, + "ap-northeast-1": 4.4979, + "ap-northeast-2": 4.1984, + "ap-northeast-3": 4.4976, + "ap-south-1": 3.1578, + "ap-south-2": 0.0, + "ap-southeast-1": 4.2528, + "ap-southeast-2": 0.0, + "ap-southeast-5": 3.8528, + "ap-southeast-7": 0.0, + "ca-central-1": 4.1171, + "eu-central-1": 4.2256, + "eu-central-2": 4.4896, + "eu-north-1": 4.0627, + "eu-south-1": 4.3279, + "eu-south-2": 4.0672, + "eu-west-1": 0.0, + "eu-west-2": 4.3347, + "eu-west-3": 4.3347, + "mx-central-1": 4.023, + "sa-east-1": 5.1418, + "us-east-1": 3.9072, + "us-east-2": 3.8995, + "us-gov-east-1": 4.3616, + "us-gov-west-1": 4.3616, + "us-west-1": 4.4704, + "us-west-2": 3.9072 + }, + "c7g.2xlarge": { + "ap-east-1": 0.6424, + "ap-northeast-1": 0.6419, + "ap-northeast-2": 0.5816, + "ap-northeast-3": 0.619, + "ap-south-1": 0.4639, + "ap-south-2": 0.4515, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.6564, + "ap-southeast-5": 0.5563, + "ap-southeast-7": 0.5384, + "ca-central-1": 0.5914, + "eu-central-1": 0.585, + "eu-central-2": 0.0, + "eu-north-1": 0.5646, + "eu-south-1": 0.5978, + "eu-south-2": 0.5847, + "eu-west-1": 0.5653, + "eu-west-2": 0.6202, + "eu-west-3": 0.0, + "mx-central-1": 0.5788, + "sa-east-1": 0.7275, + "us-east-1": 0.5452, + "us-east-2": 0.5442, + "us-gov-east-1": 0.602, + "us-gov-west-1": 0.6238, + "us-west-1": 0.6156, + "us-west-2": 0.5452 + }, + "c7g.4xlarge": { + "ap-east-1": 1.1712, + "ap-northeast-1": 1.1245, + "ap-northeast-2": 1.0496, + "ap-northeast-3": 1.1244, + "ap-south-1": 0.0, + "ap-south-2": 0.8142, + "ap-southeast-1": 1.0632, + "ap-southeast-2": 1.1991, + "ap-southeast-5": 0.9632, + "ap-southeast-7": 0.9632, + "ca-central-1": 1.0293, + "eu-central-1": 1.0564, + "eu-central-2": 1.1224, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 1.0168, + "eu-west-1": 0.0, + "eu-west-2": 1.0837, + "eu-west-3": 1.0837, + "mx-central-1": 1.0058, + "sa-east-1": 1.2854, + "us-east-1": 0.9768, + "us-east-2": 0.9749, + "us-gov-east-1": 1.1341, + "us-gov-west-1": 1.0904, + "us-west-1": 1.1629, + "us-west-2": 0.9768 + }, + "c7g.8xlarge": { + "ap-east-1": 2.2496, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.0992, + "ap-northeast-3": 2.2488, + "ap-south-1": 0.0, + "ap-south-2": 1.6284, + "ap-southeast-1": 2.1264, + "ap-southeast-2": 2.3034, + "ap-southeast-5": 1.9264, + "ap-southeast-7": 1.9264, + "ca-central-1": 2.0586, + "eu-central-1": 2.1128, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 2.164, + "eu-south-2": 2.0336, + "eu-west-1": 2.0339, + "eu-west-2": 2.1674, + "eu-west-3": 2.2537, + "mx-central-1": 2.088, + "sa-east-1": 2.5709, + "us-east-1": 1.9536, + "us-east-2": 1.9498, + "us-gov-east-1": 2.1808, + "us-gov-west-1": 2.2682, + "us-west-1": 2.3259, + "us-west-2": 1.9536 + }, + "c7g.12xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.1488, + "ap-northeast-3": 3.3732, + "ap-south-1": 2.3683, + "ap-south-2": 2.4425, + "ap-southeast-1": 3.1896, + "ap-southeast-2": 3.455, + "ap-southeast-5": 2.8896, + "ap-southeast-7": 2.8896, + "ca-central-1": 3.2078, + "eu-central-1": 3.1692, + "eu-central-2": 3.3672, + "eu-north-1": 3.047, + "eu-south-1": 3.246, + "eu-south-2": 3.0504, + "eu-west-1": 3.0509, + "eu-west-2": 3.251, + "eu-west-3": 3.251, + "mx-central-1": 3.1319, + "sa-east-1": 3.8563, + "us-east-1": 3.0396, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.4023, + "us-west-1": 3.3528, + "us-west-2": 2.9304 + }, + "c7g.16xlarge": { + "ap-east-1": 4.4992, + "ap-northeast-1": 4.4979, + "ap-northeast-2": 4.1984, + "ap-northeast-3": 0.0, + "ap-south-1": 3.1578, + "ap-south-2": 3.1578, + "ap-southeast-1": 4.2528, + "ap-southeast-2": 4.6067, + "ap-southeast-5": 3.8528, + "ap-southeast-7": 3.8528, + "ca-central-1": 0.0, + "eu-central-1": 4.2256, + "eu-central-2": 4.4896, + "eu-north-1": 0.0, + "eu-south-1": 4.3279, + "eu-south-2": 4.0672, + "eu-west-1": 0.0, + "eu-west-2": 4.3347, + "eu-west-3": 4.3347, + "mx-central-1": 0.0, + "sa-east-1": 5.1418, + "us-east-1": 3.9072, + "us-east-2": 3.8995, + "us-gov-east-1": 4.3616, + "us-gov-west-1": 4.3616, + "us-west-1": 4.4704, + "us-west-2": 0.0 + }, + "c7gd.medium": { + "ap-northeast-1": 0.0932, + "ap-south-1": 0.0607, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0914, + "ap-southeast-5": 0.0796, + "eu-central-1": 0.0844, + "eu-north-1": 0.081, + "eu-south-2": 0.0834, + "eu-west-1": 0.0865, + "us-east-1": 0.0, + "us-east-2": 0.0773, + "us-gov-east-1": 0.0867, + "us-west-1": 0.092, + "us-west-2": 0.08 + }, + "c7gd.large": { + "ap-northeast-1": 0.1791, + "ap-south-1": 0.1214, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1829, + "ap-southeast-5": 0.1538, + "eu-central-1": 0.0, + "eu-north-1": 0.168, + "eu-south-2": 0.1668, + "eu-west-1": 0.1668, + "us-east-1": 0.1545, + "us-east-2": 0.1545, + "us-gov-east-1": 0.18, + "us-west-1": 0.1772, + "us-west-2": 0.0 + }, + "c7gd.xlarge": { + "ap-northeast-1": 0.3727, + "ap-south-1": 0.2497, + "ap-southeast-1": 0.3393, + "ap-southeast-2": 0.3658, + "ap-southeast-5": 0.0, + "eu-central-1": 0.3374, + "eu-north-1": 0.0, + "eu-south-2": 0.346, + "eu-west-1": 0.3336, + "us-east-1": 0.0, + "us-east-2": 0.3199, + "us-gov-east-1": 0.3468, + "us-west-1": 0.3544, + "us-west-2": 0.309 + }, + "c7gd.metal": { + "ap-northeast-1": 5.2768, + "ap-south-1": 3.4304, + "ap-southeast-1": 4.9741, + "ap-southeast-2": 5.3978, + "ap-southeast-5": 4.4659, + "eu-central-1": 4.944, + "eu-north-1": 4.7322, + "eu-south-2": 4.8834, + "eu-west-1": 4.8832, + "us-east-1": 4.4902, + "us-east-2": 0.0, + "us-gov-east-1": 5.095, + "us-west-1": 5.216, + "us-west-2": 0.0 + }, + "c7gd.2xlarge": { + "ap-northeast-1": 0.7164, + "ap-south-1": 0.4856, + "ap-southeast-1": 0.6786, + "ap-southeast-2": 0.7315, + "ap-southeast-5": 0.615, + "eu-central-1": 0.6748, + "eu-north-1": 0.6483, + "eu-south-2": 0.6672, + "eu-west-1": 0.6672, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-west-1": 0.7088, + "us-west-2": 0.6181 + }, + "c7gd.4xlarge": { + "ap-northeast-1": 1.3192, + "ap-south-1": 0.8852, + "ap-southeast-1": 1.2435, + "ap-southeast-2": 1.4066, + "ap-southeast-5": 1.1165, + "eu-central-1": 1.2864, + "eu-north-1": 1.183, + "eu-south-2": 1.2208, + "eu-west-1": 1.2702, + "us-east-1": 1.1226, + "us-east-2": 1.1661, + "us-gov-east-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 1.1226 + }, + "c7gd.8xlarge": { + "ap-northeast-1": 2.6384, + "ap-south-1": 1.7152, + "ap-southeast-1": 2.487, + "ap-southeast-2": 2.6989, + "ap-southeast-5": 2.233, + "eu-central-1": 2.472, + "eu-north-1": 2.3661, + "eu-south-2": 2.4417, + "eu-west-1": 2.4416, + "us-east-1": 0.0, + "us-east-2": 2.3322, + "us-gov-east-1": 2.5475, + "us-west-1": 2.608, + "us-west-2": 2.2451 + }, + "c7gd.12xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 2.5728, + "ap-southeast-1": 3.883, + "ap-southeast-2": 4.0483, + "ap-southeast-5": 3.3494, + "eu-central-1": 3.708, + "eu-north-1": 3.6906, + "eu-south-2": 0.0, + "eu-west-1": 3.8107, + "us-east-1": 3.3677, + "us-east-2": 3.3677, + "us-gov-east-1": 3.9791, + "us-west-1": 3.912, + "us-west-2": 3.3677 + }, + "c7gd.16xlarge": { + "ap-northeast-1": 5.2768, + "ap-south-1": 3.4304, + "ap-southeast-1": 4.9741, + "ap-southeast-2": 5.3978, + "ap-southeast-5": 4.4659, + "eu-central-1": 0.0, + "eu-north-1": 4.7322, + "eu-south-2": 4.8834, + "eu-west-1": 4.8832, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 5.095, + "us-west-1": 0.0, + "us-west-2": 4.4902 + }, + "c7gn.medium": { + "ap-northeast-1": 0.1106, + "eu-west-1": 0.1024, + "us-east-1": 0.0, + "us-east-2": 0.0943, + "us-west-2": 0.0943 + }, + "c7gn.large": { + "ap-northeast-1": 0.2306, + "eu-west-1": 0.2048, + "us-east-1": 0.1886, + "us-east-2": 0.1886, + "us-west-2": 0.1886 + }, + "c7gn.xlarge": { + "ap-northeast-1": 0.4611, + "eu-west-1": 0.4096, + "us-east-1": 0.3772, + "us-east-2": 0.0, + "us-west-2": 0.3772 + }, + "c7gn.metal": { + "ap-northeast-1": 6.624, + "eu-west-1": 6.0992, + "us-east-1": 5.5808, + "us-east-2": 5.5808, + "us-west-2": 5.5808 + }, + "c7gn.2xlarge": { + "ap-northeast-1": 0.8848, + "eu-west-1": 0.8192, + "us-east-1": 0.7544, + "us-east-2": 0.7544, + "us-west-2": 0.7544 + }, + "c7gn.4xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 1.5248, + "us-east-1": 0.0, + "us-east-2": 1.3952, + "us-west-2": 0.0 + }, + "c7gn.8xlarge": { + "ap-northeast-1": 3.4618, + "eu-west-1": 0.0, + "us-east-1": 2.7904, + "us-east-2": 0.0, + "us-west-2": 2.7904 + }, + "c7gn.12xlarge": { + "ap-northeast-1": 4.968, + "eu-west-1": 0.0, + "us-east-1": 4.3653, + "us-east-2": 4.1856, + "us-west-2": 4.1856 + }, + "c7gn.16xlarge": { + "ap-northeast-1": 6.624, + "eu-west-1": 6.0992, + "us-east-1": 0.0, + "us-east-2": 5.5808, + "us-west-2": 0.0 + }, + "c7i.large": { + "ap-northeast-1": 0.18739, + "ap-northeast-2": 0.1646, + "ap-south-1": 0.15305, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.18035, + "ap-southeast-5": 0.15127, + "ap-southeast-7": 0.16002, + "ca-central-1": 0.0, + "eu-central-1": 0.16565, + "eu-north-1": 0.15935, + "eu-south-2": 0.1646, + "eu-west-1": 0.15956, + "eu-west-2": 0.16985, + "eu-west-3": 0.18046, + "mx-central-1": 0.0, + "sa-east-1": 0.20135, + "us-east-1": 0.15305, + "us-east-2": 0.15305, + "us-gov-east-1": 0.1709, + "us-gov-west-1": 0.1709, + "us-west-1": 0.1751, + "us-west-2": 0.0 + }, + "c7i.xlarge": { + "ap-northeast-1": 0.3523, + "ap-northeast-2": 0.34936, + "ap-south-1": 0.32395, + "ap-southeast-1": 0.3334, + "ap-southeast-2": 0.3607, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.30254, + "ca-central-1": 0.3229, + "eu-central-1": 0.3313, + "eu-north-1": 0.33781, + "eu-south-2": 0.3292, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "mx-central-1": 0.31502, + "sa-east-1": 0.4027, + "us-east-1": 0.3061, + "us-east-2": 0.32395, + "us-gov-east-1": 0.3418, + "us-gov-west-1": 0.36322, + "us-west-1": 0.37246, + "us-west-2": 0.32395 + }, + "c7i.metal-24xl": { + "ap-northeast-1": 7.7736, + "ap-northeast-2": 7.2192, + "ap-south-1": 6.6648, + "ap-southeast-1": 7.32, + "ap-southeast-2": 7.9752, + "ap-southeast-5": 6.57936, + "ap-southeast-7": 0.0, + "ca-central-1": 7.53672, + "eu-central-1": 7.75848, + "eu-north-1": 6.9672, + "eu-south-2": 7.2192, + "eu-west-1": 6.97728, + "eu-west-2": 7.4712, + "eu-west-3": 0.0, + "mx-central-1": 6.87888, + "sa-east-1": 8.9832, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 7.5216, + "us-gov-west-1": 7.5216, + "us-west-1": 7.7232, + "us-west-2": 0.0 + }, + "c7i.metal-48xl": { + "ap-northeast-1": 14.6448, + "ap-northeast-2": 13.536, + "ap-south-1": 12.4272, + "ap-southeast-1": 0.0, + "ap-southeast-2": 15.048, + "ap-southeast-5": 12.25632, + "ap-southeast-7": 0.0, + "ca-central-1": 13.2336, + "eu-central-1": 13.6368, + "eu-north-1": 13.032, + "eu-south-2": 13.536, + "eu-west-1": 13.05216, + "eu-west-2": 14.04, + "eu-west-3": 14.04, + "mx-central-1": 12.85536, + "sa-east-1": 17.064, + "us-east-1": 12.4272, + "us-east-2": 12.4272, + "us-gov-east-1": 14.1408, + "us-gov-west-1": 14.1408, + "us-west-1": 14.544, + "us-west-2": 0.0 + }, + "c7i.2xlarge": { + "ap-northeast-1": 0.7046, + "ap-northeast-2": 0.6584, + "ap-south-1": 0.6122, + "ap-southeast-1": 0.6668, + "ap-southeast-2": 0.7214, + "ap-southeast-5": 0.60508, + "ap-southeast-7": 0.0, + "ca-central-1": 0.6458, + "eu-central-1": 0.70334, + "eu-north-1": 0.6374, + "eu-south-2": 0.6584, + "eu-west-1": 0.63824, + "eu-west-2": 0.6794, + "eu-west-3": 0.6794, + "mx-central-1": 0.63004, + "sa-east-1": 0.0, + "us-east-1": 0.6122, + "us-east-2": 0.6122, + "us-gov-east-1": 0.72644, + "us-gov-west-1": 0.0, + "us-west-1": 0.7004, + "us-west-2": 0.0 + }, + "c7i.4xlarge": { + "ap-northeast-1": 1.2956, + "ap-northeast-2": 0.0, + "ap-south-1": 1.1108, + "ap-southeast-1": 1.22, + "ap-southeast-2": 0.0, + "ap-southeast-5": 1.09656, + "ap-southeast-7": 1.09656, + "ca-central-1": 1.25612, + "eu-central-1": 1.2116, + "eu-north-1": 1.23764, + "eu-south-2": 1.2032, + "eu-west-1": 1.16288, + "eu-west-2": 1.33004, + "eu-west-3": 0.0, + "mx-central-1": 1.14648, + "sa-east-1": 1.4972, + "us-east-1": 1.1108, + "us-east-2": 1.1822, + "us-gov-east-1": 1.33928, + "us-gov-west-1": 1.2536, + "us-west-1": 1.2872, + "us-west-2": 1.1108 + }, + "c7i.8xlarge": { + "ap-northeast-1": 2.77096, + "ap-northeast-2": 2.4064, + "ap-south-1": 0.0, + "ap-southeast-1": 2.44, + "ap-southeast-2": 2.84488, + "ap-southeast-5": 2.33307, + "ap-southeast-7": 2.19312, + "ca-central-1": 2.356, + "eu-central-1": 0.0, + "eu-north-1": 2.47528, + "eu-south-2": 0.0, + "eu-west-1": 2.32576, + "eu-west-2": 2.66008, + "eu-west-3": 2.4904, + "mx-central-1": 2.29296, + "sa-east-1": 0.0, + "us-east-1": 2.2216, + "us-east-2": 2.2216, + "us-gov-east-1": 2.5072, + "us-gov-west-1": 2.5072, + "us-west-1": 2.75248, + "us-west-2": 0.0 + }, + "c7i.12xlarge": { + "ap-northeast-1": 3.8868, + "ap-northeast-2": 3.6096, + "ap-south-1": 3.3324, + "ap-southeast-1": 3.66, + "ap-southeast-2": 3.9876, + "ap-southeast-5": 3.28968, + "ap-southeast-7": 3.28968, + "ca-central-1": 3.76836, + "eu-central-1": 3.6348, + "eu-north-1": 0.0, + "eu-south-2": 3.85152, + "eu-west-1": 0.0, + "eu-west-2": 3.7356, + "eu-west-3": 0.0, + "mx-central-1": 3.43944, + "sa-east-1": 4.4916, + "us-east-1": 3.5466, + "us-east-2": 3.5466, + "us-gov-east-1": 4.01784, + "us-gov-west-1": 3.7608, + "us-west-1": 4.12872, + "us-west-2": 0.0 + }, + "c7i.16xlarge": { + "ap-northeast-1": 5.1824, + "ap-northeast-2": 5.13536, + "ap-south-1": 4.7288, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 4.66614, + "ap-southeast-7": 4.38624, + "ca-central-1": 4.712, + "eu-central-1": 4.8464, + "eu-north-1": 4.95056, + "eu-south-2": 4.8128, + "eu-west-1": 4.95795, + "eu-west-2": 5.32016, + "eu-west-3": 4.9808, + "mx-central-1": 4.58592, + "sa-east-1": 5.9888, + "us-east-1": 4.7288, + "us-east-2": 4.4432, + "us-gov-east-1": 5.0144, + "us-gov-west-1": 0.0, + "us-west-1": 5.50496, + "us-west-2": 4.7288 + }, + "c7i.24xlarge": { + "ap-northeast-1": 7.7736, + "ap-northeast-2": 7.2192, + "ap-south-1": 0.0, + "ap-southeast-1": 7.81392, + "ap-southeast-2": 8.53464, + "ap-southeast-5": 6.57936, + "ap-southeast-7": 6.57936, + "ca-central-1": 7.068, + "eu-central-1": 7.2696, + "eu-north-1": 7.42584, + "eu-south-2": 0.0, + "eu-west-1": 6.97728, + "eu-west-2": 7.4712, + "eu-west-3": 7.4712, + "mx-central-1": 0.0, + "sa-east-1": 9.64344, + "us-east-1": 6.6648, + "us-east-2": 6.6648, + "us-gov-east-1": 7.5216, + "us-gov-west-1": 0.0, + "us-west-1": 7.7232, + "us-west-2": 7.0932 + }, + "c7i.48xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 13.536, + "ap-south-1": 0.0, + "ap-southeast-1": 13.7376, + "ap-southeast-2": 15.048, + "ap-southeast-5": 12.25632, + "ap-southeast-7": 12.25632, + "ca-central-1": 13.2336, + "eu-central-1": 13.6368, + "eu-north-1": 13.032, + "eu-south-2": 13.536, + "eu-west-1": 13.05216, + "eu-west-2": 14.04, + "eu-west-3": 14.04, + "mx-central-1": 0.0, + "sa-east-1": 17.064, + "us-east-1": 12.4272, + "us-east-2": 12.4272, + "us-gov-east-1": 0.0, + "us-gov-west-1": 14.1408, + "us-west-1": 14.544, + "us-west-2": 12.4272 + }, + "c7i-flex.large": { + "ap-northeast-1": 0.17053, + "ap-northeast-2": 0.15956, + "ap-south-1": 0.14859, + "ap-southeast-1": 0.16158, + "ap-southeast-2": 0.17452, + "ap-southeast-5": 0.1469, + "ca-central-1": 0.15657, + "eu-central-1": 0.16056, + "eu-north-1": 0.15457, + "eu-south-2": 0.15956, + "eu-west-1": 0.15477, + "eu-west-2": 0.16455, + "eu-west-3": 0.16455, + "sa-east-1": 0.19447, + "us-east-1": 0.14859, + "us-east-2": 0.14859, + "us-gov-west-1": 0.16555, + "us-west-1": 0.16954, + "us-west-2": 0.14859 + }, + "c7i-flex.xlarge": { + "ap-northeast-1": 0.34107, + "ap-northeast-2": 0.31912, + "ap-south-1": 0.29718, + "ap-southeast-1": 0.32315, + "ap-southeast-2": 0.34905, + "ap-southeast-5": 0.29379, + "ca-central-1": 0.31314, + "eu-central-1": 0.32112, + "eu-north-1": 0.30915, + "eu-south-2": 0.31912, + "eu-west-1": 0.30954, + "eu-west-2": 0.3291, + "eu-west-3": 0.3291, + "sa-east-1": 0.38895, + "us-east-1": 0.29718, + "us-east-2": 0.29718, + "us-gov-west-1": 0.3311, + "us-west-1": 0.33907, + "us-west-2": 0.29718 + }, + "c7i-flex.2xlarge": { + "ap-northeast-1": 0.68213, + "ap-northeast-2": 0.63824, + "ap-south-1": 0.59435, + "ap-southeast-1": 0.6463, + "ap-southeast-2": 0.69809, + "ap-southeast-5": 0.58759, + "ca-central-1": 0.62627, + "eu-central-1": 0.64223, + "eu-north-1": 0.61829, + "eu-south-2": 0.63824, + "eu-west-1": 0.61909, + "eu-west-2": 0.65819, + "eu-west-3": 0.65819, + "sa-east-1": 0.77789, + "us-east-1": 0.59435, + "us-east-2": 0.59435, + "us-gov-west-1": 0.6622, + "us-west-1": 0.67814, + "us-west-2": 0.59435 + }, + "c7i-flex.4xlarge": { + "ap-northeast-1": 1.25066, + "ap-northeast-2": 1.16288, + "ap-south-1": 1.0751, + "ap-southeast-1": 1.179, + "ap-southeast-2": 1.28258, + "ap-southeast-5": 1.06157, + "ca-central-1": 1.13894, + "eu-central-1": 1.17086, + "eu-north-1": 1.12298, + "eu-south-2": 1.16288, + "eu-west-1": 1.12458, + "eu-west-2": 1.20278, + "eu-west-3": 1.20278, + "sa-east-1": 1.44218, + "us-east-1": 1.0751, + "us-east-2": 1.0751, + "us-gov-west-1": 1.2108, + "us-west-1": 1.24268, + "us-west-2": 1.0751 + }, + "c7i-flex.8xlarge": { + "ap-northeast-1": 2.50132, + "ap-northeast-2": 2.32576, + "ap-south-1": 2.1502, + "ap-southeast-1": 2.35801, + "ap-southeast-2": 2.56516, + "ap-southeast-5": 2.12314, + "ca-central-1": 2.27788, + "eu-central-1": 2.34172, + "eu-north-1": 2.24596, + "eu-south-2": 2.32576, + "eu-west-1": 2.24915, + "eu-west-2": 2.40556, + "eu-west-3": 2.40556, + "sa-east-1": 2.88436, + "us-east-1": 2.1502, + "us-east-2": 2.1502, + "us-gov-west-1": 2.4216, + "us-west-1": 2.48536, + "us-west-2": 2.1502 + }, + "c7i-flex.12xlarge": { + "ap-northeast-1": 3.75198, + "ap-south-1": 3.2253, + "ap-southeast-1": 3.53701, + "ap-southeast-2": 3.84774, + "ap-southeast-5": 3.18472, + "ca-central-1": 3.41682, + "eu-central-1": 3.51258, + "eu-north-1": 3.36894, + "eu-south-2": 3.48864, + "eu-west-1": 3.37373, + "eu-west-2": 3.60834, + "eu-west-3": 3.60834, + "sa-east-1": 4.32654, + "us-east-1": 3.2253, + "us-east-2": 3.2253, + "us-gov-west-1": 3.6324, + "us-west-1": 3.72804, + "us-west-2": 3.2253 + }, + "c7i-flex.16xlarge": { + "ap-northeast-1": 5.00264, + "ap-south-1": 4.3004, + "ap-southeast-1": 4.71602, + "ap-southeast-2": 5.13032, + "ap-southeast-5": 4.24629, + "ca-central-1": 4.55576, + "eu-central-1": 4.68344, + "eu-north-1": 4.49192, + "eu-south-2": 4.65152, + "eu-west-1": 4.4983, + "eu-west-2": 4.81112, + "eu-west-3": 4.81112, + "sa-east-1": 5.76872, + "us-east-1": 4.3004, + "us-east-2": 4.3004, + "us-gov-west-1": 4.8432, + "us-west-1": 4.97072, + "us-west-2": 4.3004 + }, + "c8g.medium": { + "eu-central-1": 0.07725, + "eu-north-1": 0.0, + "eu-south-2": 0.07453, + "eu-west-1": 0.07454, + "us-east-1": 0.07178, + "us-east-2": 0.07164, + "us-west-2": 0.07577 + }, + "c8g.large": { + "eu-central-1": 0.1545, + "eu-north-1": 0.1489, + "eu-south-2": 0.14906, + "eu-west-1": 0.0, + "us-east-1": 0.14356, + "us-east-2": 0.15123, + "us-west-2": 0.0 + }, + "c8g.xlarge": { + "eu-central-1": 0.309, + "eu-north-1": 0.2978, + "eu-south-2": 0.31517, + "eu-west-1": 0.31522, + "us-east-1": 0.30307, + "us-east-2": 0.28656, + "us-west-2": 0.0 + }, + "c8g.metal-24xl": { + "eu-central-1": 0.0, + "eu-north-1": 6.4656, + "eu-south-2": 0.0, + "eu-west-1": 6.88358, + "us-east-1": 0.0, + "us-east-2": 6.57734, + "us-west-2": 6.59213 + }, + "c8g.metal-48xl": { + "eu-central-1": 12.5664, + "eu-north-1": 12.0288, + "eu-south-2": 12.04416, + "eu-west-1": 12.04608, + "us-east-1": 0.0, + "us-east-2": 11.48928, + "us-west-2": 11.51616 + }, + "c8g.2xlarge": { + "eu-central-1": 0.618, + "eu-north-1": 0.0, + "eu-south-2": 0.59624, + "eu-west-1": 0.63043, + "us-east-1": 0.57424, + "us-east-2": 0.0, + "us-west-2": 0.57424 + }, + "c8g.4xlarge": { + "eu-central-1": 1.1224, + "eu-north-1": 1.0776, + "eu-south-2": 0.0, + "eu-west-1": 1.07904, + "us-east-1": 1.03488, + "us-east-2": 1.03264, + "us-west-2": 1.03488 + }, + "c8g.8xlarge": { + "eu-central-1": 2.38992, + "eu-north-1": 2.1552, + "eu-south-2": 2.15776, + "eu-west-1": 0.0, + "us-east-1": 2.19738, + "us-east-2": 2.06528, + "us-west-2": 2.06976 + }, + "c8g.12xlarge": { + "eu-central-1": 3.3672, + "eu-north-1": 0.0, + "eu-south-2": 3.23664, + "eu-west-1": 3.23712, + "us-east-1": 3.29606, + "us-east-2": 3.09792, + "us-west-2": 0.0 + }, + "c8g.16xlarge": { + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 4.31552, + "eu-west-1": 4.31616, + "us-east-1": 4.39475, + "us-east-2": 4.13056, + "us-west-2": 4.39475 + }, + "c8g.24xlarge": { + "eu-central-1": 6.7344, + "eu-north-1": 6.87408, + "eu-south-2": 6.47328, + "eu-west-1": 6.47424, + "us-east-1": 6.59213, + "us-east-2": 6.19584, + "us-west-2": 6.59213 + }, + "c8g.48xlarge": { + "eu-central-1": 12.5664, + "eu-north-1": 12.0288, + "eu-south-2": 12.04416, + "eu-west-1": 12.04608, + "us-east-1": 11.51616, + "us-east-2": 0.0, + "us-west-2": 11.51616 + }, + "d2.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.085, + "ap-northeast-1": 1.056, + "ap-northeast-2": 0.972, + "ap-northeast-3": 0.972, + "ap-south-1": 0.955, + "ap-southeast-1": 1.085, + "ap-southeast-2": 0.998, + "ca-central-1": 0.887, + "eu-central-1": 0.922, + "eu-north-1": 0.895, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.9, + "eu-west-3": 0.9, + "me-south-1": 1.017, + "us-east-1": 0.0, + "us-east-2": 0.818, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.956, + "us-west-1": 0.0, + "us-west-2": 0.818 + }, + "d2.2xlarge": { + "af-south-1": 2.005, + "ap-east-1": 2.169, + "ap-northeast-1": 2.112, + "ap-northeast-2": 2.112, + "ap-northeast-3": 1.943, + "ap-south-1": 2.075, + "ap-southeast-1": 2.169, + "ap-southeast-2": 2.169, + "ca-central-1": 1.773, + "eu-central-1": 1.843, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 1.872, + "eu-west-2": 0.0, + "eu-west-3": 1.799, + "me-south-1": 1.872, + "us-east-1": 1.773, + "us-east-2": 1.773, + "us-gov-east-1": 1.911, + "us-gov-west-1": 2.077, + "us-west-1": 1.973, + "us-west-2": 1.635 + }, + "d2.4xlarge": { + "af-south-1": 3.897, + "ap-east-1": 4.225, + "ap-northeast-1": 3.773, + "ap-northeast-2": 3.773, + "ap-northeast-3": 3.773, + "ap-south-1": 3.705, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.877, + "ca-central-1": 3.433, + "eu-central-1": 0.0, + "eu-north-1": 3.189, + "eu-south-1": 3.485, + "eu-west-1": 3.337, + "eu-west-2": 0.0, + "eu-west-3": 3.794, + "me-south-1": 3.631, + "us-east-1": 3.157, + "us-east-2": 3.157, + "us-gov-east-1": 4.04, + "us-gov-west-1": 3.709, + "us-west-1": 3.521, + "us-west-2": 3.433 + }, + "d2.8xlarge": { + "af-south-1": 7.893, + "ap-east-1": 8.549, + "ap-northeast-1": 7.645, + "ap-northeast-2": 0.0, + "ap-northeast-3": 7.645, + "ap-south-1": 7.509, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 6.965, + "eu-central-1": 7.245, + "eu-north-1": 6.477, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 7.069, + "eu-west-3": 7.069, + "me-south-1": 7.361, + "us-east-1": 6.413, + "us-east-2": 0.0, + "us-gov-east-1": 7.517, + "us-gov-west-1": 7.517, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "d3.xlarge": { + "ap-northeast-1": 0.852, + "ap-south-1": 0.651, + "ap-southeast-1": 0.754, + "ap-southeast-2": 0.754, + "ca-central-1": 0.678, + "eu-central-1": 0.786, + "eu-central-2": 0.851, + "eu-west-1": 0.737, + "eu-west-2": 0.767, + "eu-west-3": 0.735, + "il-central-1": 0.767, + "us-east-1": 0.627, + "us-east-2": 0.627, + "us-gov-west-1": 0.726, + "us-west-2": 0.627 + }, + "d3.2xlarge": { + "ap-northeast-1": 1.704, + "ap-south-1": 1.302, + "ap-southeast-1": 1.507, + "ap-southeast-2": 1.507, + "ca-central-1": 1.355, + "eu-central-1": 1.571, + "eu-central-2": 1.703, + "eu-west-1": 1.474, + "eu-west-2": 1.535, + "eu-west-3": 1.445, + "il-central-1": 1.535, + "us-east-1": 1.254, + "us-east-2": 1.254, + "us-gov-west-1": 1.452, + "us-west-2": 1.254 + }, + "d3.4xlarge": { + "ap-northeast-1": 3.294, + "ap-south-1": 2.491, + "ap-southeast-1": 2.901, + "ap-southeast-2": 2.901, + "ca-central-1": 2.597, + "eu-central-1": 3.029, + "eu-central-2": 3.292, + "eu-west-1": 2.834, + "eu-west-2": 2.956, + "eu-west-3": 2.724, + "il-central-1": 2.956, + "us-east-1": 2.395, + "us-east-2": 2.395, + "us-gov-west-1": 2.791, + "us-west-2": 2.395 + }, + "d3.8xlarge": { + "ap-northeast-1": 6.58704, + "ap-south-1": 4.98264, + "ap-southeast-1": 5.80168, + "ap-southeast-2": 5.80168, + "ca-central-1": 5.19472, + "eu-central-1": 6.05808, + "eu-central-2": 6.58456, + "eu-west-1": 5.66808, + "eu-west-2": 5.91184, + "eu-west-3": 5.28324, + "il-central-1": 5.91184, + "us-east-1": 4.78912, + "us-east-2": 4.78912, + "us-gov-west-1": 5.58136, + "us-west-2": 4.78912 + }, + "d3en.xlarge": { + "ap-northeast-1": 0.89, + "ap-southeast-1": 0.787, + "ap-southeast-2": 0.787, + "ap-southeast-3": 0.787, + "eu-central-1": 0.82, + "eu-west-1": 0.769, + "us-east-1": 0.653, + "us-west-2": 0.653 + }, + "d3en.2xlarge": { + "ap-northeast-1": 1.78, + "ap-southeast-1": 1.573, + "ap-southeast-2": 1.573, + "ap-southeast-3": 1.573, + "eu-central-1": 1.641, + "eu-west-1": 1.538, + "us-east-1": 1.307, + "us-west-2": 1.307 + }, + "d3en.4xlarge": { + "ap-northeast-1": 3.446, + "ap-southeast-1": 3.033, + "ap-southeast-2": 3.033, + "ap-southeast-3": 3.033, + "eu-central-1": 3.168, + "eu-west-1": 2.962, + "us-east-1": 2.5, + "us-west-2": 2.5 + }, + "d3en.6xlarge": { + "ap-northeast-1": 5.169, + "ap-southeast-1": 4.549, + "ap-southeast-2": 4.549, + "ap-southeast-3": 4.549, + "eu-central-1": 4.751, + "eu-west-1": 4.443, + "us-east-1": 3.75, + "us-west-2": 3.75 + }, + "d3en.8xlarge": { + "ap-northeast-1": 6.892, + "ap-southeast-1": 6.06528, + "ap-southeast-2": 6.06528, + "ap-southeast-3": 6.06528, + "eu-central-1": 6.33512, + "eu-west-1": 5.92464, + "us-east-1": 4.99936, + "us-west-2": 4.99936 + }, + "d3en.12xlarge": { + "ap-northeast-1": 10.338, + "ap-southeast-1": 9.09792, + "ap-southeast-2": 9.09792, + "ap-southeast-3": 9.09792, + "eu-central-1": 9.50268, + "eu-west-1": 8.88696, + "us-east-1": 7.49904, + "us-west-2": 7.49904 + }, + "f1.2xlarge": { + "eu-central-1": 1.9892, + "eu-west-1": 2.2517, + "us-east-1": 2.0702, + "us-gov-west-1": 2.2352, + "us-west-2": 2.0702 + }, + "f1.4xlarge": { + "eu-central-1": 4.212, + "eu-west-1": 4.39, + "us-east-1": 0.0, + "us-gov-west-1": 4.357, + "us-west-2": 3.697 + }, + "f1.16xlarge": { + "eu-west-1": 16.1072, + "us-east-1": 14.7872, + "us-gov-west-1": 17.4272, + "us-west-2": 14.7872 + }, + "f2.6xlarge": { + "ap-southeast-2": 2.9712, + "eu-west-2": 3.1692, + "us-east-1": 2.5752, + "us-west-2": 2.5752 + }, + "f2.12xlarge": { + "ap-southeast-2": 0.0, + "eu-west-2": 6.8532, + "us-east-1": 5.1504, + "us-west-2": 5.1504 + }, + "f2.48xlarge": { + "ap-southeast-2": 0.0, + "eu-west-2": 24.4512, + "us-east-1": 0.0, + "us-west-2": 19.6992 + }, + "g2.2xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "g2.8xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "g3.4xlarge": { + "ap-northeast-1": 1.9768, + "ap-northeast-2": 1.8168, + "ap-southeast-1": 2.0668, + "ap-southeast-2": 2.1508, + "ca-central-1": 1.8128, + "eu-central-1": 0.0, + "eu-west-1": 1.7278, + "eu-west-2": 1.8258, + "us-east-1": 1.6508, + "us-east-2": 1.5368, + "us-gov-west-1": 1.7168, + "us-west-1": 1.9308, + "us-west-2": 1.5368 + }, + "g3.8xlarge": { + "ap-northeast-1": 3.9536, + "ap-northeast-2": 3.6336, + "ap-southeast-1": 4.1336, + "ap-southeast-2": 4.3016, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 3.2136, + "eu-west-2": 3.6516, + "us-east-1": 3.0736, + "us-east-2": 3.0736, + "us-gov-west-1": 3.6976, + "us-west-1": 3.8616, + "us-west-2": 3.3016 + }, + "g3.16xlarge": { + "ap-northeast-1": 7.9072, + "ap-northeast-2": 7.2672, + "ap-southeast-1": 8.2672, + "ap-southeast-2": 8.6032, + "ca-central-1": 7.2512, + "eu-central-1": 7.2872, + "eu-west-1": 6.4272, + "eu-west-2": 7.3032, + "us-east-1": 0.0, + "us-east-2": 6.1472, + "us-gov-west-1": 6.8672, + "us-west-1": 0.0, + "us-west-2": 6.1472 + }, + "g3s.xlarge": { + "ap-northeast-1": 1.168, + "ap-northeast-2": 1.062, + "ap-southeast-2": 1.282, + "eu-central-1": 1.066, + "eu-west-1": 0.924, + "eu-west-2": 1.068, + "us-east-1": 0.878, + "us-east-2": 0.878, + "us-gov-west-1": 0.996, + "us-west-2": 0.878 + }, + "g4ad.xlarge": { + "ap-northeast-1": 0.63842, + "ca-central-1": 0.55023, + "eu-central-1": 0.60087, + "eu-west-1": 0.59249, + "eu-west-2": 0.61458, + "us-east-1": 0.50613, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "g4ad.2xlarge": { + "ap-northeast-1": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.93182, + "eu-west-1": 0.85941, + "eu-west-2": 0.88812, + "us-east-1": 0.79637, + "us-east-2": 0.0, + "us-west-2": 0.85049 + }, + "g4ad.4xlarge": { + "ap-northeast-1": 1.6838, + "ca-central-1": 1.4616, + "eu-central-1": 1.4808, + "eu-west-1": 0.0, + "eu-west-2": 1.4108, + "us-east-1": 1.2638, + "us-east-2": 1.2638, + "us-west-2": 1.2638 + }, + "g4ad.8xlarge": { + "ap-northeast-1": 3.1336, + "ca-central-1": 2.9232, + "eu-central-1": 2.9616, + "eu-west-1": 2.9232, + "eu-west-2": 2.8216, + "us-east-1": 2.5276, + "us-east-2": 2.5276, + "us-west-2": 0.0 + }, + "g4ad.16xlarge": { + "ap-northeast-1": 6.2672, + "ca-central-1": 5.4592, + "eu-central-1": 0.0, + "eu-west-1": 5.4592, + "eu-west-2": 5.6432, + "us-east-1": 5.402, + "us-east-2": 5.0552, + "us-west-2": 5.402 + }, + "g4dn.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.938, + "ap-northeast-1": 0.838, + "ap-northeast-2": 0.775, + "ap-northeast-3": 0.838, + "ap-south-1": 0.741, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.812, + "ca-central-1": 0.712, + "eu-central-1": 0.785, + "eu-north-1": 0.686, + "eu-south-1": 0.783, + "eu-west-1": 0.714, + "eu-west-2": 0.783, + "eu-west-3": 0.743, + "me-south-1": 0.773, + "sa-east-1": 0.0, + "us-east-1": 0.654, + "us-east-2": 0.654, + "us-gov-east-1": 0.791, + "us-gov-west-1": 0.791, + "us-west-1": 0.759, + "us-west-2": 0.654, + "us-west-2-lax-1": 0.0 + }, + "g4dn.metal": { + "af-south-1": 0.0, + "ap-east-1": 14.429, + "ap-northeast-1": 12.943, + "ap-northeast-2": 0.0, + "ap-northeast-3": 12.943, + "ap-south-1": 0.0, + "ap-southeast-1": 13.328, + "ap-southeast-2": 12.555, + "ca-central-1": 11.068, + "eu-central-1": 0.0, + "eu-north-1": 10.681, + "eu-south-1": 0.0, + "eu-west-1": 11.105, + "eu-west-2": 11.535, + "eu-west-3": 0.0, + "me-south-1": 11.977, + "sa-east-1": 15.679, + "us-east-1": 10.205, + "us-east-2": 0.0, + "us-gov-west-1": 12.243, + "us-west-1": 11.77, + "us-west-2": 0.0, + "us-west-2-lax-1": 11.77 + }, + "g4dn.2xlarge": { + "af-south-1": 1.253, + "ap-east-1": 1.413, + "ap-northeast-1": 1.27, + "ap-northeast-2": 1.18, + "ap-northeast-3": 1.27, + "ap-south-1": 0.0, + "ap-southeast-1": 1.307, + "ap-southeast-2": 0.0, + "ca-central-1": 1.09, + "eu-central-1": 0.0, + "eu-north-1": 1.053, + "eu-south-1": 1.193, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 1.187, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 1.052, + "us-east-2": 1.052, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.203, + "us-west-1": 1.158, + "us-west-2": 1.052, + "us-west-2-lax-1": 1.158 + }, + "g4dn.4xlarge": { + "af-south-1": 1.994, + "ap-east-1": 2.251, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 2.022, + "ap-south-1": 1.722, + "ap-southeast-1": 2.081, + "ap-southeast-2": 1.962, + "ca-central-1": 1.814, + "eu-central-1": 1.902, + "eu-north-1": 1.674, + "eu-south-1": 1.806, + "eu-west-1": 0.0, + "eu-west-2": 1.805, + "eu-west-3": 0.0, + "me-south-1": 1.874, + "sa-east-1": 2.443, + "us-east-1": 1.673, + "us-east-2": 1.601, + "us-gov-east-1": 1.914, + "us-gov-west-1": 1.914, + "us-west-1": 1.842, + "us-west-2": 1.673, + "us-west-2-lax-1": 1.842 + }, + "g4dn.8xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.346, + "ap-northeast-1": 3.731, + "ap-northeast-2": 3.47, + "ap-northeast-3": 0.0, + "ap-south-1": 3.189, + "ap-southeast-1": 3.838, + "ap-southeast-2": 3.623, + "ca-central-1": 3.21, + "eu-central-1": 3.514, + "eu-north-1": 3.102, + "eu-south-1": 3.341, + "eu-west-1": 3.22, + "eu-west-2": 3.339, + "eu-west-3": 3.338, + "me-south-1": 3.636, + "sa-east-1": 4.732, + "us-east-1": 3.1, + "us-east-2": 2.97, + "us-gov-east-1": 3.536, + "us-gov-west-1": 3.701, + "us-west-1": 3.405, + "us-west-2": 2.97, + "us-west-2-lax-1": 0.0 + }, + "g4dn.12xlarge": { + "af-south-1": 6.381, + "ap-east-1": 0.0, + "ap-northeast-1": 6.472, + "ap-northeast-2": 6.002, + "ap-northeast-3": 0.0, + "ap-south-1": 5.497, + "ap-southeast-1": 6.664, + "ap-southeast-2": 6.583, + "ca-central-1": 5.534, + "eu-central-1": 6.08, + "eu-north-1": 5.34, + "eu-south-1": 5.77, + "eu-west-1": 5.552, + "eu-west-2": 0.0, + "eu-west-3": 5.764, + "me-south-1": 0.0, + "sa-east-1": 7.839, + "us-east-1": 5.102, + "us-east-2": 5.102, + "us-gov-east-1": 6.121, + "us-gov-west-1": 6.121, + "us-west-1": 5.885, + "us-west-2": 5.102, + "us-west-2-lax-1": 5.885 + }, + "g4dn.16xlarge": { + "af-south-1": 7.737, + "ap-east-1": 0.0, + "ap-northeast-1": 7.462, + "ap-northeast-2": 6.94, + "ap-northeast-3": 7.462, + "ap-south-1": 6.665, + "ap-southeast-1": 7.677, + "ap-southeast-2": 7.246, + "ca-central-1": 6.419, + "eu-central-1": 7.027, + "eu-north-1": 6.481, + "eu-south-1": 6.682, + "eu-west-1": 6.44, + "eu-west-2": 6.679, + "eu-west-3": 0.0, + "me-south-1": 6.925, + "sa-east-1": 8.984, + "us-east-1": 5.939, + "us-east-2": 5.939, + "us-gov-east-1": 7.073, + "us-gov-west-1": 7.073, + "us-west-1": 6.81, + "us-west-2": 6.2, + "us-west-2-lax-1": 6.81 + }, + "g5.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.3646, + "ap-south-1": 1.3356, + "ap-southeast-2": 1.5664, + "ap-southeast-3": 1.5356, + "ca-central-1": 1.3563, + "eu-central-1": 1.3856, + "eu-north-1": 1.1946, + "eu-west-1": 1.2506, + "eu-west-2": 1.5323, + "il-central-1": 1.30675, + "me-central-1": 1.3616, + "sa-east-1": 2.0086, + "us-east-1": 1.1336, + "us-east-2": 1.1336, + "us-west-2": 0.0 + }, + "g5.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.7455, + "ap-south-1": 1.8561, + "ap-southeast-2": 1.83104, + "ap-southeast-3": 1.95152, + "ca-central-1": 1.60093, + "eu-central-1": 1.7708, + "eu-north-1": 1.66924, + "eu-west-1": 1.60816, + "eu-west-2": 1.94754, + "il-central-1": 0.0, + "me-central-1": 1.74189, + "sa-east-1": 2.31536, + "us-east-1": 0.0, + "us-east-2": 1.4672, + "us-west-2": 1.4672 + }, + "g5.4xlarge": { + "ap-northeast-1": 2.75208, + "ap-northeast-2": 2.39371, + "ap-south-1": 2.5419, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ca-central-1": 2.19999, + "eu-central-1": 2.42761, + "eu-north-1": 2.11927, + "eu-west-1": 0.0, + "eu-west-2": 2.45828, + "il-central-1": 2.30032, + "me-central-1": 2.58807, + "sa-east-1": 3.43332, + "us-east-1": 2.0208, + "us-east-2": 2.0208, + "us-west-2": 2.1832, + "us-west-2-lax-1": 0.0 + }, + "g5.8xlarge": { + "ap-northeast-1": 4.34393, + "ap-northeast-2": 3.80372, + "ap-south-1": 3.73315, + "ap-southeast-2": 4.29478, + "ap-southeast-3": 4.21983, + "ca-central-1": 3.51171, + "eu-central-1": 3.85482, + "eu-north-1": 3.39004, + "eu-west-1": 3.52631, + "eu-west-2": 3.90105, + "il-central-1": 3.66294, + "me-central-1": 3.79642, + "sa-east-1": 5.37082, + "us-east-1": 3.2416, + "us-east-2": 3.2416, + "us-west-2": 3.2416, + "us-west-2-lax-1": 0.0 + }, + "g5.12xlarge": { + "ap-northeast-1": 9.41649, + "ap-northeast-2": 8.16482, + "ap-south-1": 8.00131, + "ap-southeast-2": 8.56513, + "ap-southeast-3": 0.0, + "ca-central-1": 7.48824, + "eu-central-1": 8.28322, + "eu-north-1": 0.0, + "eu-west-1": 7.52207, + "eu-west-2": 0.0, + "il-central-1": 7.83865, + "me-central-1": 8.1479, + "sa-east-1": 0.0, + "us-east-1": 6.8624, + "us-east-2": 7.4296, + "us-west-2": 6.8624 + }, + "g5.16xlarge": { + "ap-northeast-1": 8.12166, + "ap-northeast-2": 7.12739, + "ap-south-1": 6.50566, + "ap-southeast-2": 0.0, + "ap-southeast-3": 7.31997, + "ca-central-1": 6.13514, + "eu-central-1": 7.22144, + "eu-north-1": 5.93157, + "eu-west-1": 6.15957, + "eu-west-2": 0.0, + "il-central-1": 6.38819, + "me-central-1": 6.61152, + "sa-east-1": 8.54959, + "us-east-1": 0.0, + "us-east-2": 6.0928, + "us-west-2": 5.6832 + }, + "g5.24xlarge": { + "ap-northeast-1": 14.19203, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 13.77916, + "ca-central-1": 0.0, + "eu-central-1": 12.56485, + "eu-north-1": 11.01862, + "eu-west-1": 11.47197, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "me-central-1": 13.36953, + "sa-east-1": 16.22398, + "us-east-1": 10.5248, + "us-east-2": 0.0, + "us-west-2": 11.3392 + }, + "g5.48xlarge": { + "ap-northeast-1": 27.48166, + "ap-northeast-2": 23.88729, + "ap-south-1": 23.41775, + "ap-southeast-2": 25.03684, + "ap-southeast-3": 26.65592, + "ca-central-1": 21.94438, + "eu-central-1": 0.0, + "eu-north-1": 21.13484, + "eu-west-1": 22.04153, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "me-central-1": 23.83871, + "sa-east-1": 31.54556, + "us-east-1": 20.1472, + "us-east-2": 0.0, + "us-west-2": 20.1472 + }, + "g5g.xlarge": { + "ap-northeast-1": 0.6945, + "ap-northeast-2": 0.6442, + "ap-southeast-1": 0.0, + "eu-central-1": 0.653, + "eu-south-2": 0.5963, + "us-east-1": 0.5476, + "us-west-2": 0.0 + }, + "g5g.metal": { + "ap-northeast-1": 5.2911, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "eu-central-1": 5.0198, + "eu-south-2": 0.0, + "us-east-1": 4.3312, + "us-west-2": 4.3312 + }, + "g5g.2xlarge": { + "ap-northeast-1": 1.0057, + "ap-northeast-2": 0.9391, + "ap-southeast-1": 1.0332, + "eu-central-1": 0.0, + "eu-south-2": 0.916, + "us-east-1": 0.8112, + "us-west-2": 0.8112 + }, + "g5g.4xlarge": { + "ap-northeast-1": 1.5144, + "ap-northeast-2": 1.4153, + "ap-southeast-1": 1.5554, + "eu-central-1": 1.4999, + "eu-south-2": 1.3208, + "us-east-1": 0.0, + "us-west-2": 1.2745 + }, + "g5g.8xlarge": { + "ap-northeast-1": 2.6455, + "ap-northeast-2": 2.4812, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-south-2": 2.3247, + "us-east-1": 0.0, + "us-west-2": 2.2479 + }, + "g5g.16xlarge": { + "ap-northeast-1": 5.2911, + "ap-northeast-2": 4.9624, + "ap-southeast-1": 5.4267, + "eu-central-1": 0.0, + "eu-south-2": 4.6494, + "us-east-1": 4.3312, + "us-west-2": 4.3312 + }, + "g6.xlarge": { + "ap-northeast-1": 1.2948, + "ap-northeast-2": 1.1172, + "ap-south-1": 1.094, + "ap-southeast-2": 1.174, + "ap-southeast-5": 1.1414, + "ca-central-1": 1.0212, + "eu-central-1": 1.134, + "eu-central-2": 1.2126, + "eu-north-1": 0.9812, + "eu-south-2": 0.9756, + "eu-west-2": 1.1492, + "eu-west-3": 0.0, + "sa-east-1": 1.4956, + "us-east-1": 0.9324, + "us-east-2": 0.0, + "us-gov-west-1": 1.24344, + "us-west-2": 0.9324 + }, + "g6.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.45728, + "ap-south-1": 1.54649, + "ap-southeast-2": 1.52627, + "ap-southeast-5": 1.60982, + "ca-central-1": 1.34067, + "eu-central-1": 1.47769, + "eu-central-2": 1.70496, + "eu-north-1": 1.39577, + "eu-south-2": 1.28528, + "eu-west-2": 0.0, + "eu-west-3": 1.49615, + "sa-east-1": 2.0831, + "us-east-1": 0.0, + "us-east-2": 1.33056, + "us-gov-west-1": 1.61062, + "us-west-2": 1.2328 + }, + "g6.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.02384, + "ap-south-1": 1.98569, + "ap-southeast-2": 2.11722, + "ap-southeast-5": 0.0, + "ca-central-1": 2.01292, + "eu-central-1": 2.21692, + "eu-central-2": 2.18069, + "eu-north-1": 1.80023, + "eu-south-2": 1.79103, + "eu-west-2": 2.07645, + "eu-west-3": 2.07645, + "sa-east-1": 0.0, + "us-east-1": 1.72, + "us-east-2": 1.72, + "us-gov-west-1": 2.23139, + "us-west-2": 1.72 + }, + "g6.8xlarge": { + "ap-northeast-1": 4.00723, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-2": 3.41272, + "ap-southeast-5": 3.33112, + "ca-central-1": 3.25393, + "eu-central-1": 3.3126, + "eu-central-2": 3.50934, + "eu-north-1": 2.93015, + "eu-south-2": 2.91613, + "eu-west-2": 0.0, + "eu-west-3": 3.60635, + "sa-east-1": 4.56009, + "us-east-1": 3.00944, + "us-east-2": 2.808, + "us-gov-west-1": 3.33263, + "us-west-2": 2.808 + }, + "g6.12xlarge": { + "ap-northeast-1": 7.86409, + "ap-northeast-2": 0.0, + "ap-south-1": 6.71598, + "ap-southeast-2": 0.0, + "ap-southeast-5": 6.987, + "ca-central-1": 6.29973, + "eu-central-1": 7.52012, + "eu-central-2": 0.0, + "eu-north-1": 6.07102, + "eu-south-2": 6.039, + "eu-west-2": 7.0316, + "eu-west-3": 7.0316, + "sa-east-1": 9.01221, + "us-east-1": 5.792, + "us-east-2": 6.25216, + "us-gov-west-1": 7.57043, + "us-west-2": 5.792 + }, + "g6.16xlarge": { + "ap-northeast-1": 7.00621, + "ap-northeast-2": 5.76398, + "ap-south-1": 5.66606, + "ap-southeast-2": 6.00372, + "ap-southeast-5": 5.86612, + "ca-central-1": 5.3588, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 5.16633, + "eu-west-2": 6.33023, + "eu-west-3": 0.0, + "sa-east-1": 7.36108, + "us-east-1": 5.32368, + "us-east-2": 4.984, + "us-gov-west-1": 6.2968, + "us-west-2": 4.984 + }, + "g6.24xlarge": { + "ap-northeast-1": 12.06183, + "ap-northeast-2": 0.0, + "ap-south-1": 10.39635, + "ap-southeast-2": 11.05989, + "ap-southeast-5": 0.0, + "ca-central-1": 9.79253, + "eu-central-1": 0.0, + "eu-central-2": 11.38004, + "eu-north-1": 0.0, + "eu-south-2": 9.41431, + "eu-west-2": 10.85419, + "eu-west-3": 11.70153, + "sa-east-1": 14.86196, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 10.79447, + "us-west-2": 9.056 + }, + "g6.48xlarge": { + "ap-northeast-1": 23.22126, + "ap-northeast-2": 20.27515, + "ap-south-1": 19.8903, + "ap-southeast-2": 21.21737, + "ap-southeast-5": 20.67659, + "ca-central-1": 18.68266, + "eu-central-1": 20.55384, + "eu-central-2": 21.85769, + "eu-north-1": 18.01912, + "eu-south-2": 17.92622, + "eu-west-2": 0.0, + "eu-west-3": 20.80598, + "sa-east-1": 26.55223, + "us-east-1": 17.2096, + "us-east-2": 0.0, + "us-gov-west-1": 20.68654, + "us-west-2": 0.0 + }, + "g6e.xlarge": { + "ap-northeast-1": 2.8266, + "eu-central-1": 0.0, + "eu-north-1": 2.1016, + "eu-south-2": 0.0, + "us-east-1": 1.9886, + "us-east-2": 1.9886, + "us-west-2": 1.9886 + }, + "g6e.2xlarge": { + "ap-northeast-1": 3.50688, + "eu-central-1": 3.0587, + "eu-north-1": 0.0, + "eu-south-2": 2.61776, + "us-east-1": 2.72149, + "us-east-2": 0.0, + "us-west-2": 2.49728 + }, + "g6e.4xlarge": { + "ap-northeast-1": 4.75383, + "eu-central-1": 4.15331, + "eu-north-1": 0.0, + "eu-south-2": 3.87904, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 3.40104 + }, + "g6e.8xlarge": { + "ap-northeast-1": 7.36135, + "eu-central-1": 6.45612, + "eu-north-1": 0.0, + "eu-south-2": 5.5655, + "us-east-1": 5.32216, + "us-east-2": 5.32216, + "us-west-2": 0.0 + }, + "g6e.12xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 14.31042, + "eu-north-1": 12.32015, + "eu-south-2": 12.24685, + "us-east-1": 11.68304, + "us-east-2": 0.0, + "us-west-2": 11.68304 + }, + "g6e.16xlarge": { + "ap-northeast-1": 13.67529, + "eu-central-1": 11.06174, + "eu-north-1": 10.42821, + "eu-south-2": 9.57155, + "us-east-1": 9.16439, + "us-east-2": 9.16439, + "us-west-2": 9.92211 + }, + "g6e.24xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 21.21886, + "eu-north-1": 18.36117, + "eu-south-2": 18.25593, + "us-east-1": 0.0, + "us-east-2": 17.44639, + "us-west-2": 17.44639 + }, + "g6e.48xlarge": { + "ap-northeast-1": 47.55832, + "eu-central-1": 41.53532, + "eu-north-1": 35.81995, + "eu-south-2": 35.60947, + "us-east-1": 33.99038, + "us-east-2": 33.99038, + "us-west-2": 0.0 + }, + "gr6.4xlarge": { + "ap-northeast-1": 2.6291, + "ap-northeast-2": 2.2894, + "ap-south-1": 2.2451, + "ap-southeast-2": 2.398, + "ap-southeast-5": 2.3356, + "ca-central-1": 2.1058, + "eu-central-1": 2.3216, + "eu-central-2": 2.5617, + "eu-north-1": 2.0294, + "eu-south-2": 2.0186, + "eu-west-2": 2.3507, + "eu-west-3": 2.3506, + "sa-east-1": 3.0132, + "us-east-1": 1.936, + "us-east-2": 1.936, + "us-gov-west-1": 2.3369, + "us-west-2": 1.936 + }, + "gr6.8xlarge": { + "ap-northeast-1": 4.34161, + "ap-northeast-2": 3.80169, + "ap-south-1": 3.73128, + "ap-southeast-2": 3.9743, + "ap-southeast-5": 3.87512, + "ca-central-1": 3.50988, + "eu-central-1": 3.85287, + "eu-central-2": 4.23449, + "eu-north-1": 3.38845, + "eu-south-2": 3.37128, + "eu-west-2": 3.89912, + "eu-west-3": 3.89896, + "sa-east-1": 4.9521, + "us-east-1": 3.24, + "us-east-2": 3.24, + "us-gov-west-1": 3.87719, + "us-west-2": 3.24 + }, + "h1.2xlarge": { + "eu-west-1": 0.0, + "us-east-1": 0.723, + "us-east-2": 0.723, + "us-west-2": 0.723 + }, + "h1.4xlarge": { + "eu-west-1": 1.435, + "us-east-1": 1.333, + "us-east-2": 1.333, + "us-west-2": 1.333 + }, + "h1.8xlarge": { + "eu-west-1": 2.87, + "us-east-1": 0.0, + "us-east-2": 2.666, + "us-west-2": 2.666 + }, + "h1.16xlarge": { + "eu-west-1": 0.0, + "us-east-1": 5.331, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "hpc6a.48xlarge": { + "ap-southeast-1": 5.7013, + "ap-southeast-2": 6.1417, + "eu-north-1": 5.4738, + "us-east-2": 5.2608, + "us-gov-east-1": 5.8478, + "us-gov-west-1": 5.8478 + }, + "hpc6id.32xlarge": { + "eu-north-1": 7.6224, + "eu-west-3": 8.36014, + "us-east-2": 7.2872, + "us-gov-west-1": 8.4416 + }, + "hpc7a.12xlarge": { + "eu-north-1": 8.3204, + "eu-west-1": 8.3204, + "eu-west-3": 9.1505, + "us-east-2": 7.7952, + "us-gov-west-1": 9.2626 + }, + "hpc7a.24xlarge": { + "eu-north-1": 8.9156, + "eu-west-1": 8.9156, + "eu-west-3": 9.7457, + "us-east-2": 8.3904, + "us-gov-west-1": 9.8578 + }, + "hpc7a.48xlarge": { + "eu-north-1": 10.106, + "eu-west-1": 10.106, + "eu-west-3": 10.9361, + "us-east-2": 9.5808, + "us-gov-west-1": 11.0482 + }, + "hpc7a.96xlarge": { + "eu-north-1": 11.5844, + "eu-west-1": 11.5844, + "eu-west-3": 12.4145, + "us-east-2": 11.0592, + "us-gov-west-1": 12.5266 + }, + "hpc7g.4xlarge": { + "ap-northeast-1": 2.5085, + "eu-west-1": 2.2027, + "us-east-1": 2.08, + "us-gov-west-1": 2.423 + }, + "hpc7g.8xlarge": { + "ap-northeast-1": 2.9053, + "eu-west-1": 2.5995, + "us-east-1": 2.4768, + "us-gov-west-1": 2.8198 + }, + "hpc7g.16xlarge": { + "ap-northeast-1": 3.6989, + "eu-west-1": 3.3931, + "us-east-1": 3.2704, + "us-gov-west-1": 3.6134 + }, + "i2.xlarge": { + "ap-northeast-1": 1.229, + "ap-northeast-2": 1.229, + "ap-south-1": 1.095, + "ap-southeast-1": 1.146, + "ap-southeast-2": 0.0, + "eu-central-1": 1.141, + "eu-west-1": 1.066, + "us-east-1": 0.981, + "us-east-2": 0.981, + "us-gov-west-1": 1.151, + "us-west-1": 0.0, + "us-west-2": 0.981 + }, + "i2.2xlarge": { + "ap-northeast-1": 2.257, + "ap-northeast-2": 2.257, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.291, + "eu-central-1": 2.281, + "eu-west-1": 2.319, + "us-east-1": 0.0, + "us-east-2": 1.961, + "us-gov-west-1": 2.301, + "us-west-1": 2.319, + "us-west-2": 1.961 + }, + "i2.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.401, + "ap-south-1": 4.265, + "ap-southeast-1": 4.469, + "ap-southeast-2": 4.469, + "eu-central-1": 0.0, + "eu-west-1": 4.149, + "us-east-1": 3.809, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 4.524, + "us-west-2": 4.15 + }, + "i2.8xlarge": { + "ap-northeast-1": 8.802, + "ap-northeast-2": 8.802, + "ap-south-1": 8.53, + "ap-southeast-1": 0.0, + "ap-southeast-2": 8.938, + "eu-central-1": 8.898, + "eu-west-1": 0.0, + "us-east-1": 7.618, + "us-east-2": 7.618, + "us-gov-west-1": 8.978, + "us-west-1": 0.0, + "us-west-2": 7.618 + }, + "i3.large": { + "af-south-1": 0.269, + "ap-east-1": 0.27, + "ap-northeast-1": 0.247, + "ap-northeast-2": 0.247, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.241, + "ap-southeast-1": 0.251, + "ap-southeast-2": 0.251, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 0.236, + "eu-central-1": 0.268, + "eu-central-2": 0.268, + "eu-north-1": 0.227, + "eu-south-1": 0.0, + "eu-south-2": 0.253, + "eu-west-1": 0.236, + "eu-west-2": 0.245, + "eu-west-3": 0.245, + "il-central-1": 0.0, + "me-central-1": 0.253, + "me-south-1": 0.253, + "sa-east-1": 0.313, + "us-east-1": 0.22, + "us-east-2": 0.22, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.271, + "us-west-1": 0.0, + "us-west-2": 0.22 + }, + "i3.xlarge": { + "af-south-1": 0.538, + "ap-east-1": 0.54, + "ap-northeast-1": 0.494, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.53, + "ap-south-1": 0.517, + "ap-south-2": 0.517, + "ap-southeast-1": 0.502, + "ap-southeast-2": 0.502, + "ap-southeast-3": 0.502, + "ap-southeast-4": 0.0, + "ca-central-1": 0.506, + "eu-central-1": 0.5, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.49, + "eu-south-2": 0.0, + "eu-west-1": 0.472, + "eu-west-2": 0.526, + "eu-west-3": 0.0, + "il-central-1": 0.489, + "me-central-1": 0.506, + "me-south-1": 0.544, + "sa-east-1": 0.675, + "us-east-1": 0.44, + "us-east-2": 0.44, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.541, + "us-west-1": 0.506, + "us-west-2": 0.0 + }, + "i3.metal": { + "af-south-1": 8.346, + "ap-east-1": 8.378, + "ap-northeast-1": 0.0, + "ap-northeast-2": 7.642, + "ap-northeast-3": 0.0, + "ap-south-1": 7.45, + "ap-southeast-1": 7.77, + "ap-southeast-2": 7.77, + "ca-central-1": 0.0, + "eu-central-1": 7.738, + "eu-north-1": 7.002, + "eu-south-1": 7.578, + "eu-west-1": 7.29, + "eu-west-2": 7.578, + "eu-west-3": 0.0, + "me-south-1": 7.84, + "sa-east-1": 9.754, + "us-east-1": 6.778, + "us-east-2": 6.778, + "us-gov-east-1": 7.802, + "us-gov-west-1": 0.0, + "us-west-1": 7.29, + "us-west-2": 6.778 + }, + "i3.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.079, + "ap-northeast-1": 0.987, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.987, + "ap-south-1": 0.963, + "ap-south-2": 0.963, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.078, + "ap-southeast-3": 1.003, + "ap-southeast-4": 1.003, + "ca-central-1": 1.012, + "eu-central-1": 0.999, + "eu-central-2": 1.074, + "eu-north-1": 0.907, + "eu-south-1": 0.979, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.979, + "il-central-1": 0.0, + "me-central-1": 1.088, + "me-south-1": 0.0, + "sa-east-1": 1.251, + "us-east-1": 0.0, + "us-east-2": 0.879, + "us-gov-east-1": 1.082, + "us-gov-west-1": 1.082, + "us-west-1": 0.943, + "us-west-2": 0.879 + }, + "i3.4xlarge": { + "af-south-1": 2.201, + "ap-east-1": 2.045, + "ap-northeast-1": 1.861, + "ap-northeast-2": 2.007, + "ap-northeast-3": 1.861, + "ap-south-1": 1.813, + "ap-south-2": 1.813, + "ap-southeast-1": 2.042, + "ap-southeast-2": 1.893, + "ap-southeast-3": 1.893, + "ap-southeast-4": 1.893, + "ca-central-1": 1.773, + "eu-central-1": 0.0, + "eu-central-2": 2.034, + "eu-north-1": 1.831, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 1.91, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 1.842, + "me-central-1": 1.91, + "me-south-1": 1.91, + "sa-east-1": 0.0, + "us-east-1": 1.645, + "us-east-2": 1.645, + "us-gov-east-1": 2.051, + "us-gov-west-1": 0.0, + "us-west-1": 1.773, + "us-west-2": 1.645 + }, + "i3.8xlarge": { + "af-south-1": 4.074, + "ap-east-1": 4.09, + "ap-northeast-1": 3.722, + "ap-northeast-2": 3.722, + "ap-northeast-3": 3.722, + "ap-south-1": 3.626, + "ap-south-2": 3.626, + "ap-southeast-1": 3.786, + "ap-southeast-2": 4.085, + "ap-southeast-3": 3.786, + "ap-southeast-4": 4.085, + "ca-central-1": 0.0, + "eu-central-1": 3.77, + "eu-central-2": 4.067, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 3.821, + "eu-west-2": 3.979, + "eu-west-3": 3.979, + "il-central-1": 3.683, + "me-central-1": 3.821, + "me-south-1": 0.0, + "sa-east-1": 4.778, + "us-east-1": 3.29, + "us-east-2": 0.0, + "us-gov-east-1": 3.802, + "us-gov-west-1": 3.802, + "us-west-1": 3.546, + "us-west-2": 0.0 + }, + "i3.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 8.179, + "ap-northeast-1": 7.443, + "ap-northeast-2": 0.0, + "ap-northeast-3": 7.443, + "ap-south-1": 7.251, + "ap-south-2": 7.251, + "ap-southeast-1": 7.571, + "ap-southeast-2": 7.571, + "ap-southeast-3": 7.571, + "ap-southeast-4": 7.571, + "ca-central-1": 7.091, + "eu-central-1": 7.539, + "eu-central-2": 8.134, + "eu-north-1": 6.803, + "eu-south-1": 7.379, + "eu-south-2": 0.0, + "eu-west-1": 7.091, + "eu-west-2": 7.379, + "eu-west-3": 0.0, + "il-central-1": 7.366, + "me-central-1": 7.642, + "me-south-1": 7.642, + "sa-east-1": 9.555, + "us-east-1": 6.579, + "us-east-2": 6.579, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 7.091, + "us-west-2": 0.0 + }, + "i3en.large": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.33, + "ap-south-1": 0.0, + "ap-south-2": 0.338, + "ap-southeast-1": 0.335, + "ap-southeast-2": 0.352, + "ap-southeast-3": 0.335, + "ap-southeast-4": 0.335, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.308, + "ca-central-1": 0.33, + "ca-west-1": 0.314, + "eu-central-1": 0.334, + "eu-central-2": 0.361, + "eu-north-1": 0.0, + "eu-south-1": 0.326, + "eu-south-2": 0.33, + "eu-west-1": 0.314, + "eu-west-2": 0.327, + "eu-west-3": 0.327, + "il-central-1": 0.0, + "me-central-1": 0.339, + "me-south-1": 0.338, + "mx-central-1": 0.0, + "sa-east-1": 0.424, + "us-east-1": 0.29, + "us-east-2": 0.304, + "us-gov-east-1": 0.355, + "us-gov-west-1": 0.337, + "us-west-1": 0.314, + "us-west-2": 0.29, + "us-west-2-lax-1": 0.0 + }, + "i3en.xlarge": { + "af-south-1": 0.76, + "ap-east-1": 0.0, + "ap-northeast-1": 0.66, + "ap-northeast-2": 0.66, + "ap-northeast-3": 0.66, + "ap-south-1": 0.0, + "ap-south-2": 0.675, + "ap-southeast-1": 0.67, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.67, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.615, + "ap-southeast-7": 0.647, + "ca-central-1": 0.628, + "ca-west-1": 0.66, + "eu-central-1": 0.0, + "eu-central-2": 0.722, + "eu-north-1": 0.602, + "eu-south-1": 0.652, + "eu-south-2": 0.628, + "eu-west-1": 0.628, + "eu-west-2": 0.654, + "eu-west-3": 0.654, + "il-central-1": 0.0, + "me-central-1": 0.678, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.848, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.674, + "us-west-1": 0.628, + "us-west-2": 0.58, + "us-west-2-lax-1": 0.67 + }, + "i3en.metal": { + "af-south-1": 0.0, + "ap-east-1": 16.7, + "ap-northeast-1": 15.149, + "ap-northeast-2": 15.149, + "ap-northeast-3": 15.149, + "ap-south-1": 14.717, + "ap-south-2": 14.717, + "ap-southeast-1": 15.389, + "ap-southeast-2": 15.389, + "ap-southeast-3": 15.389, + "ap-southeast-4": 15.389, + "ap-southeast-5": 14.088, + "ap-southeast-7": 14.088, + "ca-central-1": 0.0, + "ca-west-1": 14.381, + "eu-central-1": 15.341, + "eu-central-2": 16.637, + "eu-north-1": 13.757, + "eu-south-1": 14.966, + "eu-south-2": 14.381, + "eu-west-1": 14.381, + "eu-west-2": 15.005, + "eu-west-3": 15.005, + "il-central-1": 14.981, + "me-central-1": 0.0, + "me-south-1": 15.523, + "mx-central-1": 13.771, + "sa-east-1": 19.661, + "us-east-1": 13.229, + "us-east-2": 13.229, + "us-gov-east-1": 15.485, + "us-gov-west-1": 15.485, + "us-west-1": 14.381, + "us-west-2": 13.229, + "us-west-2-lax-1": 15.398 + }, + "i3en.2xlarge": { + "af-south-1": 1.443, + "ap-east-1": 1.448, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.319, + "ap-northeast-3": 1.319, + "ap-south-1": 1.283, + "ap-south-2": 0.0, + "ap-southeast-1": 1.339, + "ap-southeast-2": 1.41, + "ap-southeast-3": 1.339, + "ap-southeast-4": 1.339, + "ap-southeast-5": 1.231, + "ap-southeast-7": 0.0, + "ca-central-1": 1.255, + "ca-west-1": 1.255, + "eu-central-1": 0.0, + "eu-central-2": 1.443, + "eu-north-1": 1.203, + "eu-south-1": 0.0, + "eu-south-2": 1.255, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 1.307, + "il-central-1": 0.0, + "me-central-1": 1.355, + "me-south-1": 1.35, + "mx-central-1": 0.0, + "sa-east-1": 1.789, + "us-east-1": 1.218, + "us-east-2": 1.159, + "us-gov-east-1": 1.347, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 1.159, + "us-west-2-lax-1": 1.41 + }, + "i3en.3xlarge": { + "af-south-1": 2.08, + "ap-east-1": 2.088, + "ap-northeast-1": 1.997, + "ap-northeast-2": 1.997, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 1.94, + "ap-southeast-1": 1.924, + "ap-southeast-2": 1.924, + "ap-southeast-3": 0.0, + "ap-southeast-4": 2.029, + "ap-southeast-5": 1.761, + "ap-southeast-7": 1.761, + "ca-central-1": 1.895, + "ca-west-1": 1.798, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 1.871, + "eu-south-2": 1.798, + "eu-west-1": 1.895, + "eu-west-2": 1.978, + "eu-west-3": 1.876, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 1.94, + "mx-central-1": 1.721, + "sa-east-1": 0.0, + "us-east-1": 1.654, + "us-east-2": 0.0, + "us-gov-east-1": 1.936, + "us-gov-west-1": 0.0, + "us-west-1": 1.798, + "us-west-2": 1.654, + "us-west-2-lax-1": 0.0 + }, + "i3en.6xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.175, + "ap-northeast-1": 3.787, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 3.679, + "ap-south-2": 3.679, + "ap-southeast-1": 3.847, + "ap-southeast-2": 0.0, + "ap-southeast-3": 4.059, + "ap-southeast-4": 0.0, + "ap-southeast-5": 3.522, + "ap-southeast-7": 0.0, + "ca-central-1": 3.595, + "ca-west-1": 3.595, + "eu-central-1": 0.0, + "eu-central-2": 4.391, + "eu-north-1": 0.0, + "eu-south-1": 3.742, + "eu-south-2": 3.595, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 3.751, + "il-central-1": 3.745, + "me-central-1": 0.0, + "me-south-1": 3.881, + "mx-central-1": 3.443, + "sa-east-1": 4.915, + "us-east-1": 3.483, + "us-east-2": 3.307, + "us-gov-east-1": 3.871, + "us-gov-west-1": 3.871, + "us-west-1": 3.79, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0 + }, + "i3en.12xlarge": { + "af-south-1": 8.318, + "ap-east-1": 8.35, + "ap-northeast-1": 7.574, + "ap-northeast-2": 7.574, + "ap-northeast-3": 7.574, + "ap-south-1": 7.358, + "ap-south-2": 7.358, + "ap-southeast-1": 7.694, + "ap-southeast-2": 0.0, + "ap-southeast-3": 7.694, + "ap-southeast-4": 8.118, + "ap-southeast-5": 7.044, + "ap-southeast-7": 7.044, + "ca-central-1": 7.19, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 8.782, + "eu-north-1": 6.878, + "eu-south-1": 7.483, + "eu-south-2": 7.19, + "eu-west-1": 7.19, + "eu-west-2": 7.913, + "eu-west-3": 7.502, + "il-central-1": 7.49, + "me-central-1": 0.0, + "me-south-1": 7.762, + "mx-central-1": 6.886, + "sa-east-1": 9.83, + "us-east-1": 6.966, + "us-east-2": 6.614, + "us-gov-east-1": 7.742, + "us-gov-west-1": 0.0, + "us-west-1": 7.19, + "us-west-2": 6.614, + "us-west-2-lax-1": 7.699 + }, + "i3en.24xlarge": { + "af-south-1": 0.0, + "ap-east-1": 16.7, + "ap-northeast-1": 0.0, + "ap-northeast-2": 15.149, + "ap-northeast-3": 15.149, + "ap-south-1": 14.717, + "ap-south-2": 0.0, + "ap-southeast-1": 15.389, + "ap-southeast-2": 0.0, + "ap-southeast-3": 15.389, + "ap-southeast-4": 15.389, + "ap-southeast-5": 14.088, + "ap-southeast-7": 14.088, + "ca-central-1": 14.381, + "ca-west-1": 14.381, + "eu-central-1": 15.341, + "eu-central-2": 16.637, + "eu-north-1": 13.757, + "eu-south-1": 14.966, + "eu-south-2": 14.381, + "eu-west-1": 0.0, + "eu-west-2": 15.005, + "eu-west-3": 15.005, + "il-central-1": 14.981, + "me-central-1": 0.0, + "me-south-1": 15.523, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 13.229, + "us-east-2": 13.229, + "us-gov-east-1": 15.485, + "us-gov-west-1": 15.485, + "us-west-1": 14.381, + "us-west-2": 0.0, + "us-west-2-lax-1": 15.398 + }, + "i4g.large": { + "ap-southeast-1": 0.26744, + "ca-central-1": 0.234, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.23368, + "us-west-2": 0.21824 + }, + "i4g.xlarge": { + "ap-southeast-1": 0.49786, + "ca-central-1": 0.468, + "eu-west-1": 0.468, + "us-east-1": 0.43648, + "us-east-2": 0.0, + "us-west-2": 0.43648 + }, + "i4g.2xlarge": { + "ap-southeast-1": 0.99572, + "ca-central-1": 0.936, + "eu-west-1": 1.00408, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.93474 + }, + "i4g.4xlarge": { + "ap-southeast-1": 1.87784, + "ca-central-1": 1.75839, + "eu-west-1": 0.0, + "us-east-1": 1.63232, + "us-east-2": 1.63232, + "us-west-2": 0.0 + }, + "i4g.8xlarge": { + "ap-southeast-1": 3.75568, + "ca-central-1": 3.51679, + "eu-west-1": 3.51679, + "us-east-1": 3.26464, + "us-east-2": 3.26464, + "us-west-2": 3.51174 + }, + "i4g.16xlarge": { + "ap-southeast-1": 0.0, + "ca-central-1": 0.0, + "eu-west-1": 7.03357, + "us-east-1": 6.52928, + "us-east-2": 6.52928, + "us-west-2": 0.0 + }, + "i4i.large": { + "af-south-1": 0.289, + "ap-east-1": 0.29, + "ap-northeast-1": 0.265, + "ap-northeast-2": 0.265, + "ap-northeast-3": 0.265, + "ap-south-1": 0.259, + "ap-south-2": 0.259, + "ap-southeast-1": 0.27, + "ap-southeast-2": 0.27, + "ap-southeast-3": 0.27, + "ap-southeast-4": 0.27, + "ap-southeast-5": 0.249, + "ap-southeast-7": 0.249, + "ca-central-1": 0.272, + "ca-west-1": 0.253, + "eu-central-1": 0.289, + "eu-central-2": 0.0, + "eu-north-1": 0.243, + "eu-south-1": 0.263, + "eu-west-1": 0.253, + "eu-west-2": 0.283, + "eu-west-3": 0.263, + "il-central-1": 0.0, + "me-central-1": 0.272, + "me-south-1": 0.272, + "mx-central-1": 0.244, + "sa-east-1": 0.365, + "us-east-1": 0.253, + "us-east-2": 0.0, + "us-gov-east-1": 0.271, + "us-gov-west-1": 0.271, + "us-west-1": 0.253, + "us-west-2": 0.235 + }, + "i4i.xlarge": { + "af-south-1": 0.579, + "ap-east-1": 0.581, + "ap-northeast-1": 0.53, + "ap-northeast-2": 0.53, + "ap-northeast-3": 0.53, + "ap-south-1": 0.517, + "ap-south-2": 0.517, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.58, + "ap-southeast-3": 0.539, + "ap-southeast-4": 0.539, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.498, + "ca-central-1": 0.506, + "ca-west-1": 0.544, + "eu-central-1": 0.537, + "eu-central-2": 0.0, + "eu-north-1": 0.486, + "eu-south-1": 0.526, + "eu-west-1": 0.506, + "eu-west-2": 0.526, + "eu-west-3": 0.526, + "il-central-1": 0.525, + "me-central-1": 0.543, + "me-south-1": 0.0, + "mx-central-1": 0.488, + "sa-east-1": 0.675, + "us-east-1": 0.471, + "us-east-2": 0.0, + "us-gov-east-1": 0.541, + "us-gov-west-1": 0.583, + "us-west-1": 0.544, + "us-west-2": 0.471 + }, + "i4i.metal": { + "af-south-1": 17.005, + "ap-east-1": 17.075, + "ap-northeast-1": 0.0, + "ap-northeast-2": 15.456, + "ap-northeast-3": 15.456, + "ap-south-1": 15.034, + "ap-south-2": 15.034, + "ap-southeast-1": 15.738, + "ap-southeast-2": 15.738, + "ap-southeast-3": 15.738, + "ap-southeast-4": 15.738, + "ap-southeast-5": 14.421, + "ap-southeast-7": 14.421, + "ca-central-1": 0.0, + "ca-west-1": 14.682, + "eu-central-1": 15.667, + "eu-central-2": 16.977, + "eu-north-1": 14.048, + "eu-south-1": 15.315, + "eu-west-1": 14.682, + "eu-west-2": 0.0, + "eu-west-3": 15.315, + "il-central-1": 0.0, + "me-central-1": 15.878, + "me-south-1": 15.878, + "mx-central-1": 14.104, + "sa-east-1": 20.102, + "us-east-1": 13.555, + "us-east-2": 13.555, + "us-gov-east-1": 15.808, + "us-gov-west-1": 15.808, + "us-west-1": 14.682, + "us-west-2": 13.555 + }, + "i4i.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.162, + "ap-northeast-1": 1.141, + "ap-northeast-2": 1.141, + "ap-northeast-3": 1.06, + "ap-south-1": 1.034, + "ap-south-2": 1.112, + "ap-southeast-1": 1.078, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.078, + "ap-southeast-4": 1.078, + "ap-southeast-5": 0.996, + "ap-southeast-7": 1.07, + "ca-central-1": 1.088, + "ca-west-1": 1.012, + "eu-central-1": 1.074, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 1.012, + "eu-west-2": 1.131, + "eu-west-3": 1.052, + "il-central-1": 1.05, + "me-central-1": 1.087, + "me-south-1": 1.087, + "mx-central-1": 1.048, + "sa-east-1": 1.46, + "us-east-1": 1.01, + "us-east-2": 1.01, + "us-gov-east-1": 1.082, + "us-gov-west-1": 1.082, + "us-west-1": 0.0, + "us-west-2": 0.942 + }, + "i4i.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 2.168, + "ap-northeast-2": 2.007, + "ap-northeast-3": 2.007, + "ap-south-1": 1.954, + "ap-south-2": 2.11, + "ap-southeast-1": 2.042, + "ap-southeast-2": 2.042, + "ap-southeast-3": 2.207, + "ap-southeast-4": 2.042, + "ap-southeast-5": 1.878, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 1.91, + "eu-central-1": 0.0, + "eu-central-2": 2.197, + "eu-north-1": 1.975, + "eu-south-1": 0.0, + "eu-west-1": 1.91, + "eu-west-2": 2.149, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 2.06, + "me-south-1": 2.226, + "mx-central-1": 1.838, + "sa-east-1": 2.588, + "us-east-1": 1.77, + "us-east-2": 0.0, + "us-gov-east-1": 2.051, + "us-gov-west-1": 0.0, + "us-west-1": 2.062, + "us-west-2": 1.77 + }, + "i4i.8xlarge": { + "af-south-1": 4.402, + "ap-east-1": 4.419, + "ap-northeast-1": 4.014, + "ap-northeast-2": 4.014, + "ap-northeast-3": 4.014, + "ap-south-1": 3.909, + "ap-south-2": 3.909, + "ap-southeast-1": 4.414, + "ap-southeast-2": 4.085, + "ap-southeast-3": 0.0, + "ap-southeast-4": 4.414, + "ap-southeast-5": 3.756, + "ap-southeast-7": 3.756, + "ca-central-1": 3.821, + "ca-west-1": 0.0, + "eu-central-1": 4.067, + "eu-central-2": 4.755, + "eu-north-1": 3.662, + "eu-south-1": 4.298, + "eu-west-1": 3.821, + "eu-west-2": 4.298, + "eu-west-3": 3.979, + "il-central-1": 3.972, + "me-central-1": 4.12, + "me-south-1": 4.12, + "mx-central-1": 0.0, + "sa-east-1": 5.176, + "us-east-1": 3.539, + "us-east-2": 3.539, + "us-gov-east-1": 4.102, + "us-gov-west-1": 4.102, + "us-west-1": 3.821, + "us-west-2": 3.539 + }, + "i4i.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 6.505, + "ap-northeast-2": 6.505, + "ap-northeast-3": 6.022, + "ap-south-1": 0.0, + "ap-south-2": 6.33, + "ap-southeast-1": 6.621, + "ap-southeast-2": 6.127, + "ap-southeast-3": 6.127, + "ap-southeast-4": 6.621, + "ap-southeast-5": 6.078, + "ap-southeast-7": 5.634, + "ca-central-1": 5.731, + "ca-west-1": 6.185, + "eu-central-1": 6.101, + "eu-central-2": 7.132, + "eu-north-1": 5.494, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 5.969, + "eu-west-3": 5.969, + "me-central-1": 6.18, + "me-south-1": 6.18, + "mx-central-1": 5.515, + "sa-east-1": 7.764, + "us-east-1": 5.309, + "us-east-2": 5.309, + "us-gov-east-1": 6.65, + "us-gov-west-1": 6.154, + "us-west-1": 6.185, + "us-west-2": 0.0 + }, + "i4i.16xlarge": { + "af-south-1": 8.803, + "ap-east-1": 0.0, + "ap-northeast-1": 8.029, + "ap-northeast-2": 8.029, + "ap-northeast-3": 8.029, + "ap-south-1": 7.818, + "ap-south-2": 7.818, + "ap-southeast-1": 0.0, + "ap-southeast-2": 8.828, + "ap-southeast-3": 8.17, + "ap-southeast-4": 8.17, + "ap-southeast-5": 0.0, + "ap-southeast-7": 7.511, + "ca-central-1": 8.247, + "ca-west-1": 7.642, + "eu-central-1": 8.134, + "eu-central-2": 8.789, + "eu-north-1": 7.325, + "eu-south-1": 7.958, + "eu-west-1": 7.642, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 8.24, + "me-south-1": 8.24, + "mx-central-1": 7.353, + "sa-east-1": 10.352, + "us-east-1": 0.0, + "us-east-2": 7.078, + "us-gov-east-1": 0.0, + "us-gov-west-1": 8.205, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "i4i.24xlarge": { + "af-south-1": 13.2048, + "ap-east-1": 14.34528, + "ap-northeast-1": 12.0432, + "ap-northeast-2": 13.00944, + "ap-northeast-3": 0.0, + "ap-south-1": 11.7264, + "ap-south-2": 0.0, + "ap-southeast-1": 12.2544, + "ap-southeast-2": 12.2544, + "ap-southeast-3": 12.2544, + "ap-southeast-4": 13.24176, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 11.4624, + "ca-west-1": 0.0, + "eu-central-1": 12.2016, + "eu-central-2": 0.0, + "eu-north-1": 10.9872, + "eu-south-1": 11.9376, + "eu-west-1": 11.4624, + "eu-west-2": 11.9376, + "eu-west-3": 11.9376, + "me-central-1": 0.0, + "me-south-1": 13.35792, + "mx-central-1": 11.02944, + "sa-east-1": 15.528, + "us-east-1": 10.6176, + "us-east-2": 0.0, + "us-gov-east-1": 12.3072, + "us-gov-west-1": 0.0, + "us-west-1": 11.4624, + "us-west-2": 11.44128 + }, + "i4i.32xlarge": { + "af-south-1": 17.0048, + "ap-east-1": 0.0, + "ap-northeast-1": 15.456, + "ap-northeast-2": 15.456, + "ap-northeast-3": 15.456, + "ap-south-1": 15.0336, + "ap-south-2": 15.0336, + "ap-southeast-1": 0.0, + "ap-southeast-2": 15.7376, + "ap-southeast-3": 15.7376, + "ap-southeast-4": 15.7376, + "ap-southeast-5": 14.42112, + "ap-southeast-7": 14.42112, + "ca-central-1": 14.6816, + "ca-west-1": 14.6816, + "eu-central-1": 15.6672, + "eu-central-2": 16.97664, + "eu-north-1": 14.048, + "eu-south-1": 15.3152, + "eu-west-1": 14.6816, + "eu-west-2": 0.0, + "eu-west-3": 15.3152, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 15.8784, + "mx-central-1": 14.10432, + "sa-east-1": 20.1024, + "us-east-1": 13.5552, + "us-east-2": 0.0, + "us-gov-east-1": 15.808, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 13.5552 + }, + "i7ie.large": { + "ap-northeast-1": 0.3697, + "eu-central-1": 0.3743, + "eu-west-2": 0.0, + "us-east-1": 0.3406, + "us-east-2": 0.3237, + "us-west-2": 0.3237 + }, + "i7ie.xlarge": { + "ap-northeast-1": 0.7792, + "eu-central-1": 0.789, + "eu-west-2": 0.0, + "us-east-1": 0.6811, + "us-east-2": 0.6474, + "us-west-2": 0.0 + }, + "i7ie.2xlarge": { + "ap-northeast-1": 1.4788, + "eu-central-1": 1.4972, + "eu-west-2": 1.465, + "us-east-1": 1.3622, + "us-east-2": 1.3622, + "us-west-2": 1.3622 + }, + "i7ie.3xlarge": { + "ap-northeast-1": 2.133, + "eu-central-1": 2.2817, + "eu-west-2": 2.2305, + "us-east-1": 1.857, + "us-east-2": 1.9581, + "us-west-2": 1.857 + }, + "i7ie.6xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 4.5635, + "eu-west-2": 0.0, + "us-east-1": 3.714, + "us-east-2": 3.714, + "us-west-2": 3.714 + }, + "i7ie.12xlarge": { + "ap-northeast-1": 9.0093, + "eu-central-1": 8.6424, + "eu-west-2": 8.4492, + "us-east-1": 7.428, + "us-east-2": 7.428, + "us-west-2": 7.428 + }, + "i7ie.18xlarge": { + "ap-northeast-1": 12.798, + "eu-central-1": 12.9636, + "eu-west-2": 0.0, + "us-east-1": 11.142, + "us-east-2": 11.142, + "us-west-2": 11.142 + }, + "i7ie.24xlarge": { + "ap-northeast-1": 17.064, + "eu-central-1": 18.2539, + "eu-west-2": 16.8984, + "us-east-1": 14.856, + "us-east-2": 14.856, + "us-west-2": 14.856 + }, + "i7ie.48xlarge": { + "ap-northeast-1": 35.1348, + "eu-central-1": 33.6672, + "eu-west-2": 0.0, + "us-east-1": 28.8096, + "us-east-2": 28.8096, + "us-west-2": 0.0 + }, + "i8g.large": { + "eu-central-1": 0.2684, + "us-east-1": 0.2354, + "us-west-2": 0.2354 + }, + "i8g.xlarge": { + "eu-central-1": 0.5368, + "us-east-1": 0.4708, + "us-west-2": 0.4708 + }, + "i8g.metal-24xl": { + "eu-central-1": 12.2016, + "us-east-1": 10.6176, + "us-west-2": 0.0 + }, + "i8g.2xlarge": { + "eu-central-1": 0.0, + "us-east-1": 0.9416, + "us-west-2": 0.0 + }, + "i8g.4xlarge": { + "eu-central-1": 2.1973, + "us-east-1": 1.7696, + "us-west-2": 1.7696 + }, + "i8g.8xlarge": { + "eu-central-1": 0.0, + "us-east-1": 3.5392, + "us-west-2": 0.0 + }, + "i8g.12xlarge": { + "eu-central-1": 6.1008, + "us-east-1": 5.3088, + "us-west-2": 5.3088 + }, + "i8g.16xlarge": { + "eu-central-1": 0.0, + "us-east-1": 7.62752, + "us-west-2": 7.62752 + }, + "i8g.24xlarge": { + "eu-central-1": 13.18368, + "us-east-1": 10.6176, + "us-west-2": 10.6176 + }, + "im4gn.large": { + "ap-northeast-1": 0.27718, + "ap-southeast-1": 0.28184, + "ap-southeast-2": 0.30365, + "ca-central-1": 0.28441, + "eu-central-1": 0.0, + "eu-south-2": 0.28441, + "eu-west-1": 0.26435, + "eu-west-2": 0.27485, + "eu-west-3": 0.0, + "us-east-1": 0.2457, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "im4gn.xlarge": { + "ap-northeast-1": 0.55436, + "ap-southeast-1": 0.56368, + "ap-southeast-2": 0.60729, + "ca-central-1": 0.5287, + "eu-central-1": 0.0, + "eu-south-2": 0.5287, + "eu-west-1": 0.5287, + "eu-west-2": 0.5919, + "eu-west-3": 0.54969, + "us-east-1": 0.49139, + "us-east-2": 0.49139, + "us-west-2": 0.49139 + }, + "im4gn.2xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 1.12737, + "ap-southeast-2": 1.12737, + "ca-central-1": 1.13763, + "eu-central-1": 0.0, + "eu-south-2": 1.0574, + "eu-west-1": 1.13763, + "eu-west-2": 1.1838, + "eu-west-3": 1.1838, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.98278 + }, + "im4gn.4xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 2.14114, + "ap-southeast-2": 2.14114, + "ca-central-1": 2.16166, + "eu-central-1": 2.13181, + "eu-south-2": 2.0012, + "eu-west-1": 2.00122, + "eu-west-2": 2.08517, + "eu-west-3": 2.08517, + "us-east-1": 1.85197, + "us-east-2": 1.99748, + "us-west-2": 1.85197 + }, + "im4gn.8xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 4.63114, + "ap-southeast-2": 4.63114, + "ca-central-1": 0.0, + "eu-central-1": 4.26362, + "eu-south-2": 4.0024, + "eu-west-1": 4.32332, + "eu-west-2": 4.17034, + "eu-west-3": 4.17034, + "us-east-1": 3.99497, + "us-east-2": 3.99497, + "us-west-2": 0.0 + }, + "im4gn.16xlarge": { + "ap-northeast-1": 8.4153, + "ap-southeast-1": 8.56454, + "ap-southeast-2": 8.56454, + "ca-central-1": 8.00486, + "eu-central-1": 0.0, + "eu-south-2": 8.0048, + "eu-west-1": 0.0, + "eu-west-2": 8.34067, + "eu-west-3": 8.34067, + "us-east-1": 7.40787, + "us-east-2": 7.40787, + "us-west-2": 7.40787 + }, + "inf1.xlarge": { + "af-south-1": 0.43, + "ap-east-1": 0.479, + "ap-northeast-1": 0.436, + "ap-northeast-2": 0.408, + "ap-south-1": 0.382, + "ap-southeast-1": 0.454, + "ap-southeast-2": 0.43, + "ca-central-1": 0.382, + "eu-central-1": 0.413, + "eu-north-1": 0.37, + "eu-south-1": 0.395, + "eu-west-1": 0.382, + "eu-west-2": 0.395, + "eu-west-3": 0.394, + "me-south-1": 0.0, + "sa-east-1": 0.505, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.415, + "us-west-1": 0.0, + "us-west-2": 0.356 + }, + "inf1.2xlarge": { + "ap-east-1": 0.846, + "ap-northeast-1": 0.773, + "ap-northeast-2": 0.701, + "ap-south-1": 0.636, + "ap-southeast-1": 0.773, + "ap-southeast-2": 0.708, + "ca-central-1": 0.659, + "eu-central-1": 0.708, + "eu-north-1": 0.64, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.678, + "me-south-1": 0.699, + "sa-east-1": 0.853, + "us-east-1": 0.617, + "us-east-2": 0.617, + "us-gov-east-1": 0.739, + "us-gov-west-1": 0.712, + "us-west-1": 0.69, + "us-west-2": 0.617 + }, + "inf1.6xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 2.189, + "ap-northeast-2": 2.048, + "ap-south-1": 0.0, + "ap-southeast-1": 2.285, + "ap-southeast-2": 2.071, + "ca-central-1": 1.91, + "eu-central-1": 2.071, + "eu-north-1": 0.0, + "eu-south-1": 1.978, + "eu-west-1": 1.91, + "eu-west-2": 1.978, + "eu-west-3": 1.974, + "me-south-1": 2.042, + "sa-east-1": 0.0, + "us-east-1": 1.776, + "us-east-2": 1.776, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.083, + "us-west-1": 2.013, + "us-west-2": 1.846 + }, + "inf1.24xlarge": { + "af-south-1": 8.63, + "ap-east-1": 9.655, + "ap-northeast-1": 8.757, + "ap-northeast-2": 8.541, + "ap-south-1": 7.346, + "ap-southeast-1": 8.757, + "ap-southeast-2": 8.637, + "ca-central-1": 7.641, + "eu-central-1": 8.637, + "eu-north-1": 7.397, + "eu-south-1": 7.91, + "eu-west-1": 7.641, + "eu-west-2": 8.242, + "eu-west-3": 7.898, + "me-south-1": 8.167, + "sa-east-1": 10.649, + "us-east-1": 0.0, + "us-east-2": 7.102, + "us-gov-east-1": 8.334, + "us-gov-west-1": 8.334, + "us-west-1": 8.052, + "us-west-2": 7.102 + }, + "is4gen.medium": { + "ap-northeast-1": 0.20148, + "ap-south-1": 0.19565, + "ap-southeast-1": 0.20466, + "ap-southeast-2": 0.20466, + "ca-central-1": 0.19128, + "eu-central-1": 0.20403, + "eu-west-1": 0.19128, + "eu-west-2": 0.19956, + "eu-west-3": 0.19956, + "us-east-1": 0.17598, + "us-east-2": 0.17598, + "us-west-2": 0.17598 + }, + "is4gen.large": { + "ap-northeast-1": 0.40295, + "ap-south-1": 0.3913, + "ap-southeast-1": 0.40933, + "ap-southeast-2": 0.40933, + "ca-central-1": 0.38255, + "eu-central-1": 0.40805, + "eu-west-1": 0.38255, + "eu-west-2": 0.39913, + "eu-west-3": 0.39913, + "us-east-1": 0.35195, + "us-east-2": 0.35195, + "us-west-2": 0.35195 + }, + "is4gen.xlarge": { + "ap-northeast-1": 0.8059, + "ap-south-1": 0.7826, + "ap-southeast-1": 0.81865, + "ap-southeast-2": 0.81865, + "ca-central-1": 0.7651, + "eu-central-1": 0.8161, + "eu-west-1": 0.7651, + "eu-west-2": 0.79825, + "eu-west-3": 0.79825, + "us-east-1": 0.7039, + "us-east-2": 0.7039, + "us-west-2": 0.7039 + }, + "is4gen.2xlarge": { + "ap-northeast-1": 1.6118, + "ap-south-1": 1.5652, + "ap-southeast-1": 1.6373, + "ap-southeast-2": 1.6373, + "ca-central-1": 1.5302, + "eu-central-1": 1.6322, + "eu-west-1": 1.5302, + "eu-west-2": 1.5965, + "eu-west-3": 1.5965, + "us-east-1": 1.4078, + "us-east-2": 1.4078, + "us-west-2": 1.4078 + }, + "is4gen.4xlarge": { + "ap-northeast-1": 3.11, + "ap-south-1": 3.0168, + "ap-southeast-1": 3.16101, + "ap-southeast-2": 3.16101, + "ca-central-1": 2.9468, + "eu-central-1": 3.1508, + "eu-west-1": 2.9468, + "eu-west-2": 3.07941, + "eu-west-3": 3.07941, + "us-east-1": 2.702, + "us-east-2": 2.702, + "us-west-2": 2.702 + }, + "is4gen.8xlarge": { + "ap-northeast-1": 6.22, + "ap-south-1": 6.0336, + "ap-southeast-1": 6.32202, + "ap-southeast-2": 6.32202, + "ca-central-1": 5.8936, + "eu-central-1": 6.3016, + "eu-west-1": 5.8936, + "eu-west-2": 6.15882, + "eu-west-3": 6.15882, + "us-east-1": 5.404, + "us-east-2": 5.404, + "us-west-2": 5.404 + }, + "m3.medium": { + "ap-northeast-1": 0.128, + "ap-southeast-2": 0.125 + }, + "m3.large": { + "ap-northeast-1": 0.0, + "ap-southeast-2": 0.25 + }, + "m3.xlarge": { + "ap-northeast-1": 0.55, + "ap-southeast-2": 0.5 + }, + "m3.2xlarge": { + "ap-northeast-1": 1.023, + "ap-southeast-2": 0.999 + }, + "m4.large": { + "ap-northeast-1": 0.1928, + "ap-northeast-2": 0.1868, + "ap-northeast-3": 0.1928, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1888, + "ca-central-1": 0.0, + "eu-central-1": 0.1838, + "eu-west-1": 0.1859, + "eu-west-2": 0.0, + "sa-east-1": 0.2228, + "us-east-1": 0.1638, + "us-east-2": 0.1638, + "us-gov-west-1": 0.1898, + "us-west-1": 0.1808, + "us-west-2": 0.0 + }, + "m4.xlarge": { + "ap-northeast-1": 0.3856, + "ap-northeast-2": 0.3982, + "ap-northeast-3": 0.3856, + "ap-south-1": 0.3376, + "ap-southeast-1": 0.3776, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.3496, + "eu-west-2": 0.0, + "sa-east-1": 0.4456, + "us-east-1": 0.3276, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.3616, + "us-west-2": 0.3276 + }, + "m4.2xlarge": { + "ap-northeast-1": 0.8228, + "ap-northeast-2": 0.7472, + "ap-northeast-3": 0.7712, + "ap-south-1": 0.7172, + "ap-southeast-1": 0.7552, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.7352, + "eu-west-1": 0.7436, + "eu-west-2": 0.7192, + "sa-east-1": 0.9548, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 0.7592, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m4.4xlarge": { + "ap-northeast-1": 1.4288, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.532, + "ap-south-1": 1.3208, + "ap-southeast-1": 1.3968, + "ap-southeast-2": 1.4968, + "ca-central-1": 1.3736, + "eu-central-1": 1.3568, + "eu-west-1": 1.2848, + "eu-west-2": 1.3248, + "sa-east-1": 1.6688, + "us-east-1": 1.1968, + "us-east-2": 1.2768, + "us-gov-west-1": 1.5056, + "us-west-1": 1.4264, + "us-west-2": 1.1968 + }, + "m4.10xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.452, + "ap-south-1": 3.092, + "ap-southeast-1": 3.492, + "ap-southeast-2": 3.492, + "ca-central-1": 3.212, + "eu-central-1": 3.392, + "eu-west-1": 3.212, + "eu-west-2": 3.312, + "sa-east-1": 4.172, + "us-east-1": 0.0, + "us-east-2": 2.992, + "us-gov-west-1": 3.512, + "us-west-1": 3.332, + "us-west-2": 2.992 + }, + "m4.16xlarge": { + "ap-northeast-1": 5.7152, + "ap-northeast-2": 5.5232, + "ap-northeast-3": 5.7152, + "ap-south-1": 4.9472, + "ap-southeast-1": 5.5872, + "ap-southeast-2": 5.5872, + "ca-central-1": 5.1392, + "eu-central-1": 5.4272, + "eu-west-1": 5.1392, + "eu-west-2": 5.2992, + "sa-east-1": 6.6752, + "us-east-1": 4.7872, + "us-east-2": 4.7872, + "us-gov-west-1": 0.0, + "us-west-1": 5.3312, + "us-west-2": 4.7872 + }, + "m5.large": { + "af-south-1": 0.0, + "ap-east-1": 0.196, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.182, + "ap-northeast-3": 0.188, + "ap-south-1": 0.0, + "ap-south-2": 0.175, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.196, + "ap-southeast-3": 0.184, + "ap-southeast-4": 0.196, + "ca-central-1": 0.0, + "ca-west-1": 0.171, + "eu-central-1": 0.19, + "eu-central-2": 0.203, + "eu-north-1": 0.166, + "eu-south-1": 0.187, + "eu-south-2": 0.0, + "eu-west-1": 0.182, + "eu-west-2": 0.175, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 0.182, + "me-south-1": 0.182, + "sa-east-1": 0.232, + "us-east-1": 0.169, + "us-east-2": 0.16, + "us-gov-east-1": 0.185, + "us-gov-west-1": 0.185, + "us-west-1": 0.0, + "us-west-2": 0.169, + "us-west-2-lax-1": 0.179 + }, + "m5.xlarge": { + "af-south-1": 0.382, + "ap-east-1": 0.392, + "ap-northeast-1": 0.376, + "ap-northeast-2": 0.364, + "ap-northeast-3": 0.0, + "ap-south-1": 0.33, + "ap-south-2": 0.33, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.368, + "ap-southeast-4": 0.368, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.358, + "eu-central-2": 0.381, + "eu-north-1": 0.0, + "eu-south-1": 0.352, + "eu-south-2": 0.342, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.352, + "il-central-1": 0.375, + "me-central-1": 0.363, + "me-south-1": 0.363, + "sa-east-1": 0.464, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.37, + "us-gov-west-1": 0.37, + "us-west-1": 0.0, + "us-west-2": 0.32, + "us-west-2-lax-1": 0.381 + }, + "m5.metal": { + "af-south-1": 8.477, + "ap-east-1": 8.717, + "ap-northeast-1": 8.333, + "ap-northeast-2": 8.045, + "ap-northeast-3": 8.333, + "ap-south-1": 7.229, + "ap-south-2": 7.229, + "ap-southeast-1": 8.141, + "ap-southeast-2": 8.141, + "ap-southeast-3": 8.141, + "ap-southeast-4": 8.141, + "ca-central-1": 7.517, + "ca-west-1": 7.517, + "eu-central-1": 0.0, + "eu-central-2": 8.453, + "eu-north-1": 7.277, + "eu-south-1": 7.757, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 7.709, + "eu-west-3": 7.757, + "il-central-1": 7.774, + "me-central-1": 8.03, + "me-south-1": 0.0, + "sa-east-1": 9.725, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 8.189, + "us-gov-west-1": 8.189, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 7.91 + }, + "m5.2xlarge": { + "af-south-1": 0.814, + "ap-east-1": 0.783, + "ap-northeast-1": 0.801, + "ap-northeast-2": 0.727, + "ap-northeast-3": 0.751, + "ap-south-1": 0.659, + "ap-south-2": 0.659, + "ap-southeast-1": 0.735, + "ap-southeast-2": 0.783, + "ap-southeast-3": 0.735, + "ap-southeast-4": 0.783, + "ca-central-1": 0.726, + "ca-west-1": 0.683, + "eu-central-1": 0.761, + "eu-central-2": 0.0, + "eu-north-1": 0.704, + "eu-south-1": 0.0, + "eu-south-2": 0.726, + "eu-west-1": 0.683, + "eu-west-2": 0.699, + "eu-west-3": 0.703, + "il-central-1": 0.705, + "me-central-1": 0.726, + "me-south-1": 0.726, + "sa-east-1": 0.0, + "us-east-1": 0.678, + "us-east-2": 0.678, + "us-gov-east-1": 0.739, + "us-gov-west-1": 0.739, + "us-west-1": 0.748, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.716 + }, + "m5.4xlarge": { + "af-south-1": 1.413, + "ap-east-1": 1.453, + "ap-northeast-1": 1.389, + "ap-northeast-2": 1.341, + "ap-northeast-3": 1.389, + "ap-south-1": 1.286, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 1.357, + "ca-central-1": 0.0, + "ca-west-1": 1.253, + "eu-central-1": 1.317, + "eu-central-2": 1.409, + "eu-north-1": 1.294, + "eu-south-1": 1.293, + "eu-south-2": 1.253, + "eu-west-1": 1.253, + "eu-west-2": 1.374, + "eu-west-3": 1.382, + "il-central-1": 1.296, + "me-central-1": 1.433, + "me-south-1": 1.338, + "sa-east-1": 0.0, + "us-east-1": 1.165, + "us-east-2": 0.0, + "us-gov-east-1": 1.462, + "us-gov-west-1": 1.365, + "us-west-1": 1.293, + "us-west-2": 1.165, + "us-west-2-lax-1": 1.318 + }, + "m5.8xlarge": { + "af-south-1": 3.029, + "ap-east-1": 0.0, + "ap-northeast-1": 2.976, + "ap-northeast-2": 2.682, + "ap-northeast-3": 2.778, + "ap-south-1": 2.41, + "ap-south-2": 2.41, + "ap-southeast-1": 2.714, + "ap-southeast-2": 2.714, + "ap-southeast-3": 2.714, + "ap-southeast-4": 0.0, + "ca-central-1": 2.506, + "ca-west-1": 2.677, + "eu-central-1": 2.634, + "eu-central-2": 2.818, + "eu-north-1": 2.426, + "eu-south-1": 2.586, + "eu-south-2": 2.506, + "eu-west-1": 0.0, + "eu-west-2": 2.747, + "eu-west-3": 2.765, + "il-central-1": 2.771, + "me-central-1": 2.677, + "me-south-1": 2.677, + "sa-east-1": 3.242, + "us-east-1": 2.483, + "us-east-2": 2.33, + "us-gov-east-1": 2.73, + "us-gov-west-1": 2.923, + "us-west-1": 2.586, + "us-west-2": 2.483, + "us-west-2-lax-1": 0.0 + }, + "m5.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.358, + "ap-northeast-1": 4.166, + "ap-northeast-2": 4.022, + "ap-northeast-3": 0.0, + "ap-south-1": 3.857, + "ap-south-2": 3.614, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 4.07, + "ap-southeast-4": 4.07, + "ca-central-1": 3.758, + "ca-west-1": 3.758, + "eu-central-1": 3.95, + "eu-central-2": 4.226, + "eu-north-1": 3.638, + "eu-south-1": 4.147, + "eu-south-2": 3.758, + "eu-west-1": 0.0, + "eu-west-2": 4.121, + "eu-west-3": 0.0, + "il-central-1": 3.887, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 4.862, + "us-east-1": 3.494, + "us-east-2": 3.725, + "us-gov-east-1": 4.094, + "us-gov-west-1": 0.0, + "us-west-1": 4.147, + "us-west-2": 0.0, + "us-west-2-lax-1": 3.955 + }, + "m5.16xlarge": { + "af-south-1": 5.651, + "ap-east-1": 5.811, + "ap-northeast-1": 5.555, + "ap-northeast-2": 0.0, + "ap-northeast-3": 5.555, + "ap-south-1": 5.142, + "ap-south-2": 4.819, + "ap-southeast-1": 5.427, + "ap-southeast-2": 0.0, + "ap-southeast-3": 5.427, + "ap-southeast-4": 5.427, + "ca-central-1": 5.011, + "ca-west-1": 5.354, + "eu-central-1": 5.267, + "eu-central-2": 6.04, + "eu-north-1": 4.851, + "eu-south-1": 0.0, + "eu-south-2": 5.011, + "eu-west-1": 5.011, + "eu-west-2": 0.0, + "eu-west-3": 5.171, + "il-central-1": 5.182, + "me-central-1": 5.354, + "me-south-1": 5.73, + "sa-east-1": 6.483, + "us-east-1": 4.659, + "us-east-2": 4.659, + "us-gov-east-1": 5.459, + "us-gov-west-1": 0.0, + "us-west-1": 5.171, + "us-west-2": 4.966, + "us-west-2-lax-1": 0.0 + }, + "m5.24xlarge": { + "af-south-1": 8.477, + "ap-east-1": 8.717, + "ap-northeast-1": 8.333, + "ap-northeast-2": 8.045, + "ap-northeast-3": 8.333, + "ap-south-1": 7.229, + "ap-south-2": 7.229, + "ap-southeast-1": 8.141, + "ap-southeast-2": 0.0, + "ap-southeast-3": 8.141, + "ap-southeast-4": 8.141, + "ca-central-1": 7.517, + "ca-west-1": 0.0, + "eu-central-1": 7.901, + "eu-central-2": 8.453, + "eu-north-1": 7.277, + "eu-south-1": 7.757, + "eu-south-2": 7.517, + "eu-west-1": 7.517, + "eu-west-2": 7.709, + "eu-west-3": 0.0, + "il-central-1": 7.774, + "me-central-1": 8.03, + "me-south-1": 8.03, + "sa-east-1": 9.725, + "us-east-1": 6.989, + "us-east-2": 6.989, + "us-gov-east-1": 8.189, + "us-gov-west-1": 8.189, + "us-west-1": 7.757, + "us-west-2": 6.989, + "us-west-2-lax-1": 7.91 + }, + "m5a.large": { + "ap-northeast-1": 0.176, + "ap-northeast-2": 0.17, + "ap-south-1": 0.119, + "ap-southeast-1": 0.172, + "ap-southeast-2": 0.172, + "ca-central-1": 0.16, + "eu-central-1": 0.168, + "eu-south-1": 0.165, + "eu-west-1": 0.16, + "eu-west-2": 0.164, + "eu-west-3": 0.165, + "sa-east-1": 0.202, + "us-east-1": 0.15, + "us-east-2": 0.15, + "us-gov-east-1": 0.173, + "us-gov-west-1": 0.173, + "us-west-1": 0.165, + "us-west-2": 0.15 + }, + "m5a.xlarge": { + "ap-northeast-1": 0.352, + "ap-northeast-2": 0.34, + "ap-south-1": 0.239, + "ap-southeast-1": 0.344, + "ap-southeast-2": 0.344, + "ca-central-1": 0.32, + "eu-central-1": 0.336, + "eu-south-1": 0.33, + "eu-west-1": 0.32, + "eu-west-2": 0.328, + "eu-west-3": 0.33, + "sa-east-1": 0.404, + "us-east-1": 0.3, + "us-east-2": 0.3, + "us-gov-east-1": 0.346, + "us-gov-west-1": 0.346, + "us-west-1": 0.33, + "us-west-2": 0.3 + }, + "m5a.2xlarge": { + "ap-northeast-1": 0.703, + "ap-northeast-2": 0.679, + "ap-south-1": 0.477, + "ap-southeast-1": 0.687, + "ap-southeast-2": 0.687, + "ca-central-1": 0.639, + "eu-central-1": 0.671, + "eu-south-1": 0.659, + "eu-west-1": 0.639, + "eu-west-2": 0.655, + "eu-west-3": 0.659, + "sa-east-1": 0.807, + "us-east-1": 0.599, + "us-east-2": 0.599, + "us-gov-east-1": 0.691, + "us-gov-west-1": 0.691, + "us-west-1": 0.659, + "us-west-2": 0.599 + }, + "m5a.4xlarge": { + "ap-northeast-1": 1.293, + "ap-northeast-2": 1.245, + "ap-south-1": 0.841, + "ap-southeast-1": 1.261, + "ap-southeast-2": 1.261, + "ca-central-1": 1.165, + "eu-central-1": 1.229, + "eu-south-1": 1.205, + "eu-west-1": 1.165, + "eu-west-2": 1.197, + "eu-west-3": 1.205, + "sa-east-1": 1.501, + "us-east-1": 1.085, + "us-east-2": 1.085, + "us-gov-east-1": 1.269, + "us-gov-west-1": 1.269, + "us-west-1": 1.205, + "us-west-2": 1.085 + }, + "m5a.8xlarge": { + "ap-northeast-1": 2.586, + "ap-northeast-2": 2.49, + "ap-south-1": 1.682, + "ap-southeast-1": 2.522, + "ap-southeast-2": 2.522, + "ca-central-1": 2.33, + "eu-central-1": 2.458, + "eu-south-1": 2.41, + "eu-west-1": 2.33, + "eu-west-2": 2.394, + "eu-west-3": 2.41, + "sa-east-1": 3.002, + "us-east-1": 2.17, + "us-east-2": 2.17, + "us-gov-east-1": 2.538, + "us-gov-west-1": 2.538, + "us-west-1": 2.41, + "us-west-2": 2.17 + }, + "m5a.12xlarge": { + "ap-northeast-1": 3.878, + "ap-northeast-2": 3.734, + "ap-south-1": 2.524, + "ap-southeast-1": 3.782, + "ap-southeast-2": 3.782, + "ca-central-1": 3.494, + "eu-central-1": 3.686, + "eu-south-1": 3.614, + "eu-west-1": 3.494, + "eu-west-2": 3.59, + "eu-west-3": 3.614, + "sa-east-1": 4.502, + "us-east-1": 3.254, + "us-east-2": 3.254, + "us-gov-east-1": 3.806, + "us-gov-west-1": 3.806, + "us-west-1": 3.614, + "us-west-2": 3.254 + }, + "m5a.16xlarge": { + "ap-northeast-1": 5.171, + "ap-northeast-2": 4.979, + "ap-south-1": 3.365, + "ap-southeast-1": 5.043, + "ap-southeast-2": 5.043, + "ca-central-1": 4.659, + "eu-central-1": 4.915, + "eu-south-1": 4.819, + "eu-west-1": 4.659, + "eu-west-2": 4.787, + "eu-west-3": 4.819, + "sa-east-1": 6.003, + "us-east-1": 4.339, + "us-east-2": 4.339, + "us-gov-east-1": 5.075, + "us-gov-west-1": 5.075, + "us-west-1": 4.819, + "us-west-2": 4.339 + }, + "m5a.24xlarge": { + "ap-northeast-1": 7.757, + "ap-northeast-2": 7.469, + "ap-south-1": 5.047, + "ap-southeast-1": 7.565, + "ap-southeast-2": 7.565, + "ca-central-1": 6.989, + "eu-central-1": 7.373, + "eu-south-1": 7.229, + "eu-west-1": 6.989, + "eu-west-2": 7.181, + "eu-west-3": 7.229, + "sa-east-1": 9.005, + "us-east-1": 6.509, + "us-east-2": 6.509, + "us-gov-east-1": 7.613, + "us-gov-west-1": 7.613, + "us-west-1": 7.229, + "us-west-2": 6.509 + }, + "m5ad.large": { + "ap-northeast-1": 0.198, + "ap-northeast-2": 0.191, + "ap-south-1": 0.131, + "ap-southeast-1": 0.193, + "ap-southeast-2": 0.194, + "ca-central-1": 0.179, + "eu-central-1": 0.189, + "eu-west-1": 0.179, + "eu-west-2": 0.184, + "eu-west-3": 0.185, + "sa-east-1": 0.229, + "us-east-1": 0.167, + "us-east-2": 0.167, + "us-gov-west-1": 0.195, + "us-west-1": 0.186, + "us-west-2": 0.167 + }, + "m5ad.xlarge": { + "ap-northeast-1": 0.396, + "ap-northeast-2": 0.382, + "ap-south-1": 0.262, + "ap-southeast-1": 0.386, + "ap-southeast-2": 0.388, + "ca-central-1": 0.358, + "eu-central-1": 0.378, + "eu-west-1": 0.358, + "eu-west-2": 0.368, + "eu-west-3": 0.37, + "sa-east-1": 0.458, + "us-east-1": 0.334, + "us-east-2": 0.334, + "us-gov-west-1": 0.39, + "us-west-1": 0.372, + "us-west-2": 0.334 + }, + "m5ad.2xlarge": { + "ap-northeast-1": 0.791, + "ap-northeast-2": 0.763, + "ap-south-1": 0.524, + "ap-southeast-1": 0.771, + "ap-southeast-2": 0.775, + "ca-central-1": 0.715, + "eu-central-1": 0.755, + "eu-west-1": 0.715, + "eu-west-2": 0.735, + "eu-west-3": 0.739, + "sa-east-1": 0.915, + "us-east-1": 0.667, + "us-east-2": 0.667, + "us-gov-west-1": 0.779, + "us-west-1": 0.743, + "us-west-2": 0.667 + }, + "m5ad.4xlarge": { + "ap-northeast-1": 1.469, + "ap-northeast-2": 1.413, + "ap-south-1": 0.934, + "ap-southeast-1": 1.429, + "ap-southeast-2": 1.437, + "ca-central-1": 1.317, + "eu-central-1": 1.397, + "eu-west-1": 1.317, + "eu-west-2": 1.357, + "eu-west-3": 1.365, + "sa-east-1": 1.717, + "us-east-1": 1.221, + "us-east-2": 1.221, + "us-gov-west-1": 1.445, + "us-west-1": 1.373, + "us-west-2": 1.221 + }, + "m5ad.8xlarge": { + "ap-northeast-1": 2.938, + "ap-northeast-2": 2.826, + "ap-south-1": 1.867, + "ap-southeast-1": 2.858, + "ap-southeast-2": 2.874, + "ca-central-1": 2.634, + "eu-central-1": 2.794, + "eu-west-1": 2.634, + "eu-west-2": 2.714, + "eu-west-3": 2.73, + "sa-east-1": 3.434, + "us-east-1": 2.442, + "us-east-2": 2.442, + "us-gov-west-1": 2.89, + "us-west-1": 2.746, + "us-west-2": 2.442 + }, + "m5ad.12xlarge": { + "ap-northeast-1": 4.406, + "ap-northeast-2": 4.238, + "ap-south-1": 2.801, + "ap-southeast-1": 4.286, + "ap-southeast-2": 4.31, + "ca-central-1": 3.95, + "eu-central-1": 4.19, + "eu-west-1": 3.95, + "eu-west-2": 4.07, + "eu-west-3": 4.094, + "sa-east-1": 5.15, + "us-east-1": 3.662, + "us-east-2": 3.662, + "us-gov-west-1": 4.334, + "us-west-1": 4.118, + "us-west-2": 3.662 + }, + "m5ad.16xlarge": { + "ap-northeast-1": 5.875, + "ap-northeast-2": 5.651, + "ap-south-1": 3.734, + "ap-southeast-1": 5.715, + "ap-southeast-2": 5.747, + "ca-central-1": 5.267, + "eu-central-1": 5.587, + "eu-west-1": 5.267, + "eu-west-2": 5.427, + "eu-west-3": 5.459, + "sa-east-1": 6.867, + "us-east-1": 4.883, + "us-east-2": 4.883, + "us-gov-west-1": 5.779, + "us-west-1": 5.491, + "us-west-2": 4.883 + }, + "m5ad.24xlarge": { + "ap-northeast-1": 8.813, + "ap-northeast-2": 8.477, + "ap-south-1": 5.602, + "ap-southeast-1": 8.573, + "ap-southeast-2": 8.621, + "ca-central-1": 7.901, + "eu-central-1": 8.381, + "eu-west-1": 7.901, + "eu-west-2": 8.141, + "eu-west-3": 8.189, + "sa-east-1": 10.301, + "us-east-1": 7.325, + "us-east-2": 7.325, + "us-gov-west-1": 8.669, + "us-west-1": 8.237, + "us-west-2": 7.325 + }, + "m5d.large": { + "af-south-1": 0.214, + "ap-east-1": 0.219, + "ap-northeast-1": 0.219, + "ap-northeast-2": 0.203, + "ap-northeast-3": 0.21, + "ap-south-1": 0.186, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.205, + "ap-southeast-4": 0.206, + "ca-central-1": 0.19, + "ca-west-1": 0.197, + "eu-central-1": 0.0, + "eu-central-2": 0.222, + "eu-north-1": 0.0, + "eu-south-1": 0.196, + "eu-south-2": 0.197, + "eu-west-1": 0.19, + "eu-west-2": 0.195, + "eu-west-3": 0.196, + "il-central-1": 0.204, + "me-central-1": 0.0, + "me-south-1": 0.202, + "sa-east-1": 0.244, + "us-east-1": 0.184, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.207, + "us-west-1": 0.197, + "us-west-2": 0.184 + }, + "m5d.xlarge": { + "af-south-1": 0.446, + "ap-east-1": 0.456, + "ap-northeast-1": 0.42, + "ap-northeast-2": 0.406, + "ap-northeast-3": 0.42, + "ap-south-1": 0.0, + "ap-south-2": 0.372, + "ap-southeast-1": 0.41, + "ap-southeast-2": 0.412, + "ap-southeast-3": 0.41, + "ap-southeast-4": 0.412, + "ca-central-1": 0.395, + "ca-west-1": 0.395, + "eu-central-1": 0.4, + "eu-central-2": 0.0, + "eu-north-1": 0.368, + "eu-south-1": 0.392, + "eu-south-2": 0.38, + "eu-west-1": 0.0, + "eu-west-2": 0.405, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 0.405, + "me-south-1": 0.405, + "sa-east-1": 0.508, + "us-east-1": 0.354, + "us-east-2": 0.367, + "us-gov-east-1": 0.414, + "us-gov-west-1": 0.431, + "us-west-1": 0.394, + "us-west-2": 0.0 + }, + "m5d.metal": { + "af-south-1": 9.581, + "ap-east-1": 9.821, + "ap-northeast-1": 9.389, + "ap-northeast-2": 9.053, + "ap-northeast-3": 9.389, + "ap-south-1": 8.237, + "ap-south-2": 8.237, + "ap-southeast-1": 9.149, + "ap-southeast-2": 9.197, + "ap-southeast-3": 0.0, + "ap-southeast-4": 9.197, + "ca-central-1": 8.429, + "ca-west-1": 0.0, + "eu-central-1": 8.909, + "eu-central-2": 9.562, + "eu-north-1": 8.141, + "eu-south-1": 0.0, + "eu-south-2": 8.429, + "eu-west-1": 8.429, + "eu-west-2": 8.669, + "eu-west-3": 8.717, + "il-central-1": 8.731, + "me-central-1": 9.034, + "me-south-1": 0.0, + "sa-east-1": 11.021, + "us-east-1": 7.805, + "us-east-2": 7.805, + "us-gov-east-1": 9.245, + "us-gov-west-1": 9.245, + "us-west-1": 8.765, + "us-west-2": 7.805 + }, + "m5d.2xlarge": { + "af-south-1": 0.891, + "ap-east-1": 0.875, + "ap-northeast-1": 0.874, + "ap-northeast-2": 0.811, + "ap-northeast-3": 0.874, + "ap-south-1": 0.743, + "ap-south-2": 0.772, + "ap-southeast-1": 0.819, + "ap-southeast-2": 0.857, + "ap-southeast-3": 0.819, + "ap-southeast-4": 0.823, + "ca-central-1": 0.0, + "ca-west-1": 0.789, + "eu-central-1": 0.799, + "eu-central-2": 0.0, + "eu-north-1": 0.764, + "eu-south-1": 0.815, + "eu-south-2": 0.0, + "eu-west-1": 0.759, + "eu-west-2": 0.0, + "eu-west-3": 0.783, + "il-central-1": 0.784, + "me-central-1": 0.81, + "me-south-1": 0.81, + "sa-east-1": 0.975, + "us-east-1": 0.707, + "us-east-2": 0.707, + "us-gov-east-1": 0.827, + "us-gov-west-1": 0.827, + "us-west-1": 0.787, + "us-west-2": 0.707 + }, + "m5d.4xlarge": { + "af-south-1": 1.597, + "ap-east-1": 1.637, + "ap-northeast-1": 1.635, + "ap-northeast-2": 1.509, + "ap-northeast-3": 1.565, + "ap-south-1": 1.373, + "ap-south-2": 1.431, + "ap-southeast-1": 1.525, + "ap-southeast-2": 1.533, + "ap-southeast-3": 1.525, + "ap-southeast-4": 0.0, + "ca-central-1": 1.405, + "ca-west-1": 1.405, + "eu-central-1": 1.485, + "eu-central-2": 1.594, + "eu-north-1": 1.414, + "eu-south-1": 1.453, + "eu-south-2": 0.0, + "eu-west-1": 1.405, + "eu-west-2": 1.445, + "eu-west-3": 0.0, + "il-central-1": 1.455, + "me-central-1": 1.572, + "me-south-1": 1.506, + "sa-east-1": 1.837, + "us-east-1": 1.301, + "us-east-2": 1.355, + "us-gov-east-1": 1.541, + "us-gov-west-1": 0.0, + "us-west-1": 1.525, + "us-west-2": 1.301 + }, + "m5d.8xlarge": { + "af-south-1": 0.0, + "ap-east-1": 3.274, + "ap-northeast-1": 3.13, + "ap-northeast-2": 3.018, + "ap-northeast-3": 3.13, + "ap-south-1": 2.746, + "ap-south-2": 2.746, + "ap-southeast-1": 3.05, + "ap-southeast-2": 3.066, + "ap-southeast-3": 3.05, + "ap-southeast-4": 3.202, + "ca-central-1": 2.81, + "ca-west-1": 2.81, + "eu-central-1": 2.97, + "eu-central-2": 3.331, + "eu-north-1": 2.714, + "eu-south-1": 3.032, + "eu-south-2": 2.931, + "eu-west-1": 2.81, + "eu-west-2": 3.015, + "eu-west-3": 2.906, + "il-central-1": 0.0, + "me-central-1": 3.011, + "me-south-1": 3.011, + "sa-east-1": 3.674, + "us-east-1": 2.602, + "us-east-2": 2.602, + "us-gov-east-1": 3.082, + "us-gov-west-1": 3.082, + "us-west-1": 2.922, + "us-west-2": 2.602 + }, + "m5d.12xlarge": { + "af-south-1": 4.79, + "ap-east-1": 4.91, + "ap-northeast-1": 4.694, + "ap-northeast-2": 4.526, + "ap-northeast-3": 4.694, + "ap-south-1": 4.118, + "ap-south-2": 4.294, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.598, + "ap-southeast-3": 4.574, + "ap-southeast-4": 0.0, + "ca-central-1": 4.214, + "ca-west-1": 4.214, + "eu-central-1": 4.454, + "eu-central-2": 4.781, + "eu-north-1": 4.243, + "eu-south-1": 4.358, + "eu-south-2": 4.214, + "eu-west-1": 4.214, + "eu-west-2": 4.334, + "eu-west-3": 4.548, + "il-central-1": 4.556, + "me-central-1": 4.517, + "me-south-1": 0.0, + "sa-east-1": 5.51, + "us-east-1": 4.065, + "us-east-2": 4.065, + "us-gov-east-1": 4.828, + "us-gov-west-1": 4.622, + "us-west-1": 4.574, + "us-west-2": 0.0 + }, + "m5d.16xlarge": { + "af-south-1": 6.387, + "ap-east-1": 6.845, + "ap-northeast-1": 6.259, + "ap-northeast-2": 6.035, + "ap-northeast-3": 0.0, + "ap-south-1": 5.491, + "ap-south-2": 5.491, + "ap-southeast-1": 6.099, + "ap-southeast-2": 0.0, + "ap-southeast-3": 6.099, + "ap-southeast-4": 6.131, + "ca-central-1": 5.861, + "ca-west-1": 5.619, + "eu-central-1": 5.939, + "eu-central-2": 6.374, + "eu-north-1": 5.427, + "eu-south-1": 5.811, + "eu-south-2": 5.619, + "eu-west-1": 5.861, + "eu-west-2": 5.779, + "eu-west-3": 5.811, + "il-central-1": 0.0, + "me-central-1": 6.022, + "me-south-1": 6.022, + "sa-east-1": 7.347, + "us-east-1": 5.203, + "us-east-2": 5.203, + "us-gov-east-1": 6.163, + "us-gov-west-1": 6.438, + "us-west-1": 5.843, + "us-west-2": 5.203 + }, + "m5d.24xlarge": { + "af-south-1": 9.581, + "ap-east-1": 9.821, + "ap-northeast-1": 9.389, + "ap-northeast-2": 9.053, + "ap-northeast-3": 9.389, + "ap-south-1": 8.237, + "ap-south-2": 8.237, + "ap-southeast-1": 9.149, + "ap-southeast-2": 9.197, + "ap-southeast-3": 9.149, + "ap-southeast-4": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 8.429, + "eu-central-1": 0.0, + "eu-central-2": 9.562, + "eu-north-1": 8.141, + "eu-south-1": 8.717, + "eu-south-2": 8.429, + "eu-west-1": 0.0, + "eu-west-2": 8.669, + "eu-west-3": 8.717, + "il-central-1": 8.731, + "me-central-1": 9.034, + "me-south-1": 9.034, + "sa-east-1": 11.021, + "us-east-1": 7.805, + "us-east-2": 7.805, + "us-gov-east-1": 9.245, + "us-gov-west-1": 9.245, + "us-west-1": 8.765, + "us-west-2": 7.805 + }, + "m5dn.large": { + "ap-northeast-1": 0.239, + "ap-southeast-1": 0.0, + "eu-central-1": 0.226, + "eu-west-1": 0.216, + "us-east-1": 0.0, + "us-east-2": 0.2, + "us-gov-east-1": 0.235, + "us-gov-west-1": 0.0, + "us-west-2": 0.2 + }, + "m5dn.xlarge": { + "ap-northeast-1": 0.478, + "ap-southeast-1": 0.462, + "eu-central-1": 0.0, + "eu-west-1": 0.432, + "us-east-1": 0.4, + "us-east-2": 0.4, + "us-gov-east-1": 0.47, + "us-gov-west-1": 0.47, + "us-west-2": 0.0 + }, + "m5dn.metal": { + "ap-northeast-1": 10.781, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 9.677, + "us-east-1": 0.0, + "us-east-2": 8.909, + "us-gov-east-1": 0.0, + "us-gov-west-1": 10.589, + "us-west-2": 8.909 + }, + "m5dn.2xlarge": { + "ap-northeast-1": 0.997, + "ap-southeast-1": 0.0, + "eu-central-1": 0.942, + "eu-west-1": 0.863, + "us-east-1": 0.799, + "us-east-2": 0.799, + "us-gov-east-1": 0.98, + "us-gov-west-1": 0.939, + "us-west-2": 0.832 + }, + "m5dn.4xlarge": { + "ap-northeast-1": 1.797, + "ap-southeast-1": 1.733, + "eu-central-1": 1.693, + "eu-west-1": 0.0, + "us-east-1": 1.485, + "us-east-2": 1.55, + "us-gov-east-1": 1.765, + "us-gov-west-1": 1.765, + "us-west-2": 1.485 + }, + "m5dn.8xlarge": { + "ap-northeast-1": 3.594, + "ap-southeast-1": 0.0, + "eu-central-1": 3.541, + "eu-west-1": 3.372, + "us-east-1": 2.97, + "us-east-2": 0.0, + "us-gov-east-1": 3.694, + "us-gov-west-1": 3.53, + "us-west-2": 0.0 + }, + "m5dn.12xlarge": { + "ap-northeast-1": 5.642, + "ap-southeast-1": 5.198, + "eu-central-1": 0.0, + "eu-west-1": 4.838, + "us-east-1": 4.454, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 5.294, + "us-west-2": 4.454 + }, + "m5dn.16xlarge": { + "ap-northeast-1": 7.187, + "ap-southeast-1": 6.931, + "eu-central-1": 0.0, + "eu-west-1": 6.451, + "us-east-1": 5.939, + "us-east-2": 5.939, + "us-gov-east-1": 7.059, + "us-gov-west-1": 7.059, + "us-west-2": 0.0 + }, + "m5dn.24xlarge": { + "ap-northeast-1": 10.781, + "ap-southeast-1": 0.0, + "eu-central-1": 10.157, + "eu-west-1": 9.677, + "us-east-1": 0.0, + "us-east-2": 8.909, + "us-gov-east-1": 10.589, + "us-gov-west-1": 10.589, + "us-west-2": 8.909 + }, + "m5n.large": { + "ap-northeast-1": 0.226, + "ap-southeast-1": 0.219, + "eu-central-1": 0.205, + "eu-west-1": 0.197, + "us-east-1": 0.19, + "us-east-2": 0.19, + "us-gov-east-1": 0.213, + "us-gov-west-1": 0.0, + "us-west-2": 0.183 + }, + "m5n.xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.42, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.366, + "us-gov-east-1": 0.443, + "us-gov-west-1": 0.443, + "us-west-2": 0.366 + }, + "m5n.metal": { + "ap-northeast-1": 9.725, + "ap-southeast-1": 9.389, + "eu-central-1": 9.149, + "eu-west-1": 8.765, + "us-east-1": 0.0, + "us-east-2": 8.093, + "us-gov-east-1": 9.533, + "us-gov-west-1": 0.0, + "us-west-2": 8.093 + }, + "m5n.2xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.874, + "eu-central-1": 0.819, + "eu-west-1": 0.0, + "us-east-1": 0.76, + "us-east-2": 0.76, + "us-gov-east-1": 0.887, + "us-gov-west-1": 0.851, + "us-west-2": 0.731 + }, + "m5n.4xlarge": { + "ap-northeast-1": 1.694, + "ap-southeast-1": 1.565, + "eu-central-1": 1.592, + "eu-west-1": 0.0, + "us-east-1": 1.349, + "us-east-2": 1.349, + "us-gov-east-1": 1.589, + "us-gov-west-1": 1.66, + "us-west-2": 1.349 + }, + "m5n.8xlarge": { + "ap-northeast-1": 3.242, + "ap-southeast-1": 3.13, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 2.698, + "us-east-2": 2.698, + "us-gov-east-1": 3.321, + "us-gov-west-1": 3.321, + "us-west-2": 2.812 + }, + "m5n.12xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "eu-central-1": 4.574, + "eu-west-1": 4.382, + "us-east-1": 4.218, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.766, + "us-west-2": 4.046 + }, + "m5n.16xlarge": { + "ap-northeast-1": 6.777, + "ap-southeast-1": 0.0, + "eu-central-1": 6.099, + "eu-west-1": 5.843, + "us-east-1": 5.624, + "us-east-2": 5.624, + "us-gov-east-1": 0.0, + "us-gov-west-1": 6.355, + "us-west-2": 5.395 + }, + "m5n.24xlarge": { + "ap-northeast-1": 9.725, + "ap-southeast-1": 9.389, + "eu-central-1": 9.149, + "eu-west-1": 8.765, + "us-east-1": 8.093, + "us-east-2": 0.0, + "us-gov-east-1": 9.533, + "us-gov-west-1": 9.533, + "us-west-2": 8.093 + }, + "m5zn.large": { + "ap-northeast-1": 0.2772, + "ap-northeast-2": 0.2668, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.2617, + "eu-west-1": 0.2479, + "sa-east-1": 0.3534, + "us-east-1": 0.229, + "us-east-2": 0.229, + "us-west-1": 0.2565, + "us-west-2": 0.229 + }, + "m5zn.xlarge": { + "ap-northeast-1": 0.5543, + "ap-northeast-2": 0.5336, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.5233, + "eu-west-1": 0.4958, + "sa-east-1": 0.6541, + "us-east-1": 0.4579, + "us-east-2": 0.4579, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m5zn.metal": { + "ap-northeast-1": 6.3108, + "ap-northeast-2": 6.0624, + "ap-southeast-1": 6.1464, + "ap-southeast-2": 6.1464, + "eu-central-1": 5.939, + "eu-west-1": 5.6088, + "sa-east-1": 7.5082, + "us-east-1": 5.1545, + "us-east-2": 5.1545, + "us-west-1": 5.8152, + "us-west-2": 5.1545 + }, + "m5zn.2xlarge": { + "ap-northeast-1": 1.1086, + "ap-northeast-2": 1.1484, + "ap-southeast-1": 1.1638, + "ap-southeast-2": 1.0812, + "eu-central-1": 1.1258, + "eu-west-1": 0.0, + "sa-east-1": 1.3082, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 1.026, + "us-west-2": 0.9159 + }, + "m5zn.3xlarge": { + "ap-northeast-1": 1.5777, + "ap-northeast-2": 1.6374, + "ap-southeast-1": 1.5366, + "ap-southeast-2": 1.6605, + "eu-central-1": 1.6035, + "eu-west-1": 1.4022, + "sa-east-1": 0.0, + "us-east-1": 1.3877, + "us-east-2": 1.2886, + "us-west-1": 1.5694, + "us-west-2": 1.2886 + }, + "m5zn.6xlarge": { + "ap-northeast-1": 3.1554, + "ap-northeast-2": 3.2748, + "ap-southeast-1": 3.0732, + "ap-southeast-2": 3.0732, + "eu-central-1": 3.207, + "eu-west-1": 3.0253, + "sa-east-1": 3.7541, + "us-east-1": 2.5772, + "us-east-2": 0.0, + "us-west-1": 2.9076, + "us-west-2": 2.5772 + }, + "m5zn.12xlarge": { + "ap-northeast-1": 6.8228, + "ap-northeast-2": 6.0624, + "ap-southeast-1": 6.642, + "ap-southeast-2": 0.0, + "eu-central-1": 5.939, + "eu-west-1": 5.6088, + "sa-east-1": 7.5082, + "us-east-1": 0.0, + "us-east-2": 5.1545, + "us-west-1": 5.8152, + "us-west-2": 5.5509 + }, + "m6a.large": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.11935, + "ap-south-2": 0.0, + "ap-southeast-1": 0.1718, + "ap-southeast-2": 0.1826, + "ca-central-1": 0.1601, + "eu-central-1": 0.1673, + "eu-south-1": 0.0, + "eu-west-1": 0.16973, + "eu-west-2": 0.1637, + "eu-west-3": 0.0, + "sa-east-1": 0.2015, + "us-east-1": 0.1502, + "us-east-2": 0.0, + "us-west-1": 0.17468, + "us-west-2": 0.1502 + }, + "m6a.xlarge": { + "ap-northeast-1": 0.37312, + "ap-south-1": 0.2387, + "ap-south-2": 0.24981, + "ap-southeast-1": 0.3652, + "ap-southeast-2": 0.3436, + "ca-central-1": 0.3202, + "eu-central-1": 0.3346, + "eu-south-1": 0.34936, + "eu-west-1": 0.3202, + "eu-west-2": 0.34738, + "eu-west-3": 0.34936, + "sa-east-1": 0.403, + "us-east-1": 0.31768, + "us-east-2": 0.3004, + "us-west-1": 0.3292, + "us-west-2": 0.3004 + }, + "m6a.metal": { + "ap-northeast-1": 14.5728, + "ap-south-1": 9.192, + "ap-south-2": 9.192, + "ap-southeast-1": 14.2272, + "ap-southeast-2": 0.0, + "ca-central-1": 13.104, + "eu-central-1": 13.7952, + "eu-south-1": 13.536, + "eu-west-1": 13.104, + "eu-west-2": 13.4496, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 12.1536, + "us-east-2": 0.0, + "us-west-1": 13.536, + "us-west-2": 12.1536 + }, + "m6a.2xlarge": { + "ap-northeast-1": 0.7016, + "ap-south-1": 0.49962, + "ap-south-2": 0.4774, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 0.6404, + "eu-central-1": 0.6692, + "eu-south-1": 0.0, + "eu-west-1": 0.6404, + "eu-west-2": 0.0, + "eu-west-3": 0.69872, + "sa-east-1": 0.0, + "us-east-1": 0.6008, + "us-east-2": 0.63536, + "us-west-1": 0.6584, + "us-west-2": 0.6008 + }, + "m6a.4xlarge": { + "ap-northeast-1": 1.37888, + "ap-south-1": 0.8412, + "ap-south-2": 0.0, + "ap-southeast-1": 1.2608, + "ap-southeast-2": 1.2608, + "ca-central-1": 1.1672, + "eu-central-1": 1.3076, + "eu-south-1": 1.2032, + "eu-west-1": 0.0, + "eu-west-2": 1.27592, + "eu-west-3": 1.2032, + "sa-east-1": 0.0, + "us-east-1": 1.088, + "us-east-2": 1.088, + "us-west-1": 1.2032, + "us-west-2": 1.088 + }, + "m6a.8xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 1.6824, + "ap-south-2": 1.77128, + "ap-southeast-1": 2.6944, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 2.4496, + "eu-south-1": 2.56768, + "eu-west-1": 2.3344, + "eu-west-2": 0.0, + "eu-west-3": 2.4064, + "sa-east-1": 3.21712, + "us-east-1": 2.176, + "us-east-2": 0.0, + "us-west-1": 0.0, + "us-west-2": 2.31424 + }, + "m6a.12xlarge": { + "ap-northeast-1": 3.8688, + "ap-south-1": 2.5236, + "ap-south-2": 2.5236, + "ap-southeast-1": 3.7824, + "ap-southeast-2": 4.0416, + "ca-central-1": 3.5016, + "eu-central-1": 3.6744, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 3.82776, + "eu-west-3": 3.85152, + "sa-east-1": 4.4952, + "us-east-1": 3.47136, + "us-east-2": 3.264, + "us-west-1": 0.0, + "us-west-2": 3.264 + }, + "m6a.16xlarge": { + "ap-northeast-1": 5.1584, + "ap-south-1": 3.54256, + "ap-south-2": 3.3648, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.0432, + "ca-central-1": 4.6688, + "eu-central-1": 4.8992, + "eu-south-1": 5.13536, + "eu-west-1": 4.97696, + "eu-west-2": 4.784, + "eu-west-3": 4.8128, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 5.13536, + "us-west-2": 4.352 + }, + "m6a.24xlarge": { + "ap-northeast-1": 8.27328, + "ap-south-1": 5.0472, + "ap-south-2": 5.31384, + "ap-southeast-1": 7.5648, + "ap-southeast-2": 7.5648, + "ca-central-1": 7.0032, + "eu-central-1": 7.3488, + "eu-south-1": 7.2192, + "eu-west-1": 7.0032, + "eu-west-2": 0.0, + "eu-west-3": 7.2192, + "sa-east-1": 8.9904, + "us-east-1": 0.0, + "us-east-2": 6.94272, + "us-west-1": 0.0, + "us-west-2": 6.528 + }, + "m6a.32xlarge": { + "ap-northeast-1": 9.7152, + "ap-south-1": 6.128, + "ap-south-2": 6.128, + "ap-southeast-1": 9.4848, + "ap-southeast-2": 9.4848, + "ca-central-1": 8.736, + "eu-central-1": 9.1968, + "eu-south-1": 9.024, + "eu-west-1": 8.736, + "eu-west-2": 8.9664, + "eu-west-3": 9.024, + "sa-east-1": 11.3856, + "us-east-1": 0.0, + "us-east-2": 8.1024, + "us-west-1": 9.66912, + "us-west-2": 8.1024 + }, + "m6a.48xlarge": { + "ap-northeast-1": 14.5728, + "ap-south-1": 0.0, + "ap-south-2": 9.192, + "ap-southeast-1": 14.2272, + "ap-southeast-2": 14.2272, + "ca-central-1": 13.104, + "eu-central-1": 13.7952, + "eu-south-1": 13.536, + "eu-west-1": 13.104, + "eu-west-2": 13.4496, + "eu-west-3": 13.536, + "sa-east-1": 17.0784, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 13.536, + "us-west-2": 12.1536 + }, + "m6g.medium": { + "af-south-1": 0.0827, + "ap-east-1": 0.088, + "ap-northeast-1": 0.0814, + "ap-northeast-2": 0.0789, + "ap-northeast-3": 0.0815, + "ap-south-1": 0.0572, + "ap-south-2": 0.0572, + "ap-southeast-1": 0.0799, + "ap-southeast-2": 0.0799, + "ap-southeast-3": 0.0828, + "ap-southeast-4": 0.0828, + "ap-southeast-5": 0.0727, + "ap-southeast-7": 0.0727, + "ca-central-1": 0.0747, + "ca-west-1": 0.0747, + "eu-central-1": 0.0779, + "eu-central-2": 0.0, + "eu-north-1": 0.0754, + "eu-south-1": 0.0767, + "eu-south-2": 0.0774, + "eu-west-1": 0.0749, + "eu-west-2": 0.0763, + "eu-west-3": 0.0796, + "il-central-1": 0.0771, + "me-central-1": 0.0792, + "me-south-1": 0.0789, + "mx-central-1": 0.0723, + "sa-east-1": 0.0968, + "us-east-1": 0.0704, + "us-east-2": 0.0727, + "us-gov-east-1": 0.0832, + "us-gov-west-1": 0.0803, + "us-west-1": 0.0767, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0781 + }, + "m6g.large": { + "af-south-1": 0.1654, + "ap-east-1": 0.1698, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.169, + "ap-south-1": 0.1144, + "ap-south-2": 0.1174, + "ap-southeast-1": 0.1598, + "ap-southeast-2": 0.1598, + "ap-southeast-3": 0.1656, + "ap-southeast-4": 0.1598, + "ap-southeast-5": 0.1454, + "ap-southeast-7": 0.1454, + "ca-central-1": 0.1494, + "ca-west-1": 0.1545, + "eu-central-1": 0.0, + "eu-central-2": 0.1711, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.1498, + "eu-west-1": 0.1498, + "eu-west-2": 0.1579, + "eu-west-3": 0.0, + "il-central-1": 0.1595, + "me-central-1": 0.1584, + "me-south-1": 0.1578, + "mx-central-1": 0.1495, + "sa-east-1": 0.1935, + "us-east-1": 0.1408, + "us-east-2": 0.1408, + "us-gov-east-1": 0.1606, + "us-gov-west-1": 0.0, + "us-west-1": 0.1534, + "us-west-2": 0.1408, + "us-west-2-lax-1": 0.1617 + }, + "m6g.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.3396, + "ap-northeast-1": 0.3376, + "ap-northeast-2": 0.327, + "ap-northeast-3": 0.326, + "ap-south-1": 0.2349, + "ap-south-2": 0.2288, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.3196, + "ap-southeast-3": 0.3196, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.2908, + "ap-southeast-7": 0.2908, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.3116, + "eu-central-2": 0.3421, + "eu-north-1": 0.2916, + "eu-south-1": 0.3068, + "eu-south-2": 0.2996, + "eu-west-1": 0.2996, + "eu-west-2": 0.3052, + "eu-west-3": 0.3076, + "il-central-1": 0.3082, + "me-central-1": 0.328, + "me-south-1": 0.3156, + "mx-central-1": 0.299, + "sa-east-1": 0.3724, + "us-east-1": 0.0, + "us-east-2": 0.2908, + "us-gov-east-1": 0.3328, + "us-gov-west-1": 0.3212, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.3124 + }, + "m6g.metal": { + "af-south-1": 0.0, + "ap-east-1": 4.9792, + "ap-northeast-1": 4.7552, + "ap-northeast-2": 4.5952, + "ap-northeast-3": 4.7616, + "ap-south-1": 3.3036, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 4.6592, + "ap-southeast-4": 4.6592, + "ap-southeast-5": 4.1984, + "ap-southeast-7": 4.1984, + "ca-central-1": 4.4908, + "ca-west-1": 4.3264, + "eu-central-1": 4.7072, + "eu-central-2": 4.8256, + "eu-north-1": 4.2112, + "eu-south-1": 4.4544, + "eu-south-2": 0.0, + "eu-west-1": 4.3392, + "eu-west-2": 4.4288, + "eu-west-3": 4.4672, + "il-central-1": 4.4768, + "me-central-1": 4.7939, + "me-south-1": 4.5952, + "mx-central-1": 4.1747, + "sa-east-1": 5.504, + "us-east-1": 4.0512, + "us-east-2": 4.0512, + "us-gov-east-1": 4.6848, + "us-gov-west-1": 4.6848, + "us-west-1": 4.4544, + "us-west-2": 4.0512, + "us-west-2-lax-1": 4.544 + }, + "m6g.2xlarge": { + "af-south-1": 0.6616, + "ap-east-1": 0.6792, + "ap-northeast-1": 0.6512, + "ap-northeast-2": 0.6312, + "ap-northeast-3": 0.652, + "ap-south-1": 0.4576, + "ap-south-2": 0.4697, + "ap-southeast-1": 0.6392, + "ap-southeast-2": 0.6392, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.6622, + "ap-southeast-5": 0.6012, + "ap-southeast-7": 0.5816, + "ca-central-1": 0.5976, + "ca-west-1": 0.5976, + "eu-central-1": 0.0, + "eu-central-2": 0.6843, + "eu-north-1": 0.5832, + "eu-south-1": 0.635, + "eu-south-2": 0.6196, + "eu-west-1": 0.6196, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 0.6336, + "me-south-1": 0.0, + "mx-central-1": 0.598, + "sa-east-1": 0.7742, + "us-east-1": 0.5632, + "us-east-2": 0.5632, + "us-gov-east-1": 0.6424, + "us-gov-west-1": 0.6424, + "us-west-1": 0.6136, + "us-west-2": 0.5632, + "us-west-2-lax-1": 0.6469 + }, + "m6g.4xlarge": { + "af-south-1": 1.2584, + "ap-east-1": 1.2952, + "ap-northeast-1": 1.1888, + "ap-northeast-2": 1.1488, + "ap-northeast-3": 1.1904, + "ap-south-1": 0.8016, + "ap-south-2": 0.8016, + "ap-southeast-1": 1.2109, + "ap-southeast-2": 1.1648, + "ap-southeast-3": 1.1648, + "ap-southeast-4": 1.1648, + "ap-southeast-5": 1.0888, + "ap-southeast-7": 0.0, + "ca-central-1": 1.1227, + "ca-west-1": 1.1227, + "eu-central-1": 0.0, + "eu-central-2": 1.2064, + "eu-north-1": 1.0528, + "eu-south-1": 1.1136, + "eu-south-2": 1.0848, + "eu-west-1": 1.0848, + "eu-west-2": 1.1072, + "eu-west-3": 1.1168, + "il-central-1": 1.162, + "me-central-1": 1.1536, + "me-south-1": 1.1944, + "mx-central-1": 1.0437, + "sa-east-1": 1.4348, + "us-east-1": 1.0128, + "us-east-2": 1.0128, + "us-gov-east-1": 1.1712, + "us-gov-west-1": 1.2177, + "us-west-1": 1.1136, + "us-west-2": 1.0128, + "us-west-2-lax-1": 1.1802 + }, + "m6g.8xlarge": { + "af-south-1": 2.4192, + "ap-east-1": 2.4896, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.2976, + "ap-northeast-3": 2.476, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 2.3296, + "ap-southeast-2": 2.4218, + "ap-southeast-3": 2.3296, + "ap-southeast-4": 2.3296, + "ap-southeast-5": 2.0992, + "ap-southeast-7": 2.0992, + "ca-central-1": 2.1632, + "ca-west-1": 2.1632, + "eu-central-1": 2.2656, + "eu-central-2": 2.51, + "eu-north-1": 0.0, + "eu-south-1": 2.2272, + "eu-south-2": 0.0, + "eu-west-1": 2.1696, + "eu-west-2": 2.2144, + "eu-west-3": 2.32, + "il-central-1": 0.0, + "me-central-1": 2.397, + "me-south-1": 2.3888, + "mx-central-1": 0.0, + "sa-east-1": 2.752, + "us-east-1": 0.0, + "us-east-2": 2.0256, + "us-gov-east-1": 2.3424, + "us-gov-west-1": 2.3424, + "us-west-1": 2.2272, + "us-west-2": 2.0256, + "us-west-2-lax-1": 2.272 + }, + "m6g.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 3.7344, + "ap-northeast-1": 3.5664, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.5712, + "ap-south-1": 2.4048, + "ap-south-2": 2.4777, + "ap-southeast-1": 3.6326, + "ap-southeast-2": 3.6326, + "ap-southeast-3": 3.4944, + "ap-southeast-4": 3.4944, + "ap-southeast-5": 3.1488, + "ap-southeast-7": 3.1488, + "ca-central-1": 3.2448, + "ca-west-1": 3.3681, + "eu-central-1": 0.0, + "eu-central-2": 3.6192, + "eu-north-1": 3.1584, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 3.3768, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 3.3576, + "me-central-1": 3.4608, + "me-south-1": 0.0, + "mx-central-1": 3.131, + "sa-east-1": 4.128, + "us-east-1": 3.1488, + "us-east-2": 3.1488, + "us-gov-east-1": 3.5136, + "us-gov-west-1": 3.5136, + "us-west-1": 0.0, + "us-west-2": 3.0384, + "us-west-2-lax-1": 3.408 + }, + "m6g.16xlarge": { + "af-south-1": 5.0335, + "ap-east-1": 0.0, + "ap-northeast-1": 4.9472, + "ap-northeast-2": 4.5952, + "ap-northeast-3": 4.7616, + "ap-south-1": 3.2064, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 4.8435, + "ap-southeast-4": 4.6592, + "ap-southeast-5": 4.3551, + "ap-southeast-7": 4.1984, + "ca-central-1": 4.3264, + "ca-west-1": 4.3264, + "eu-central-1": 0.0, + "eu-central-2": 4.8256, + "eu-north-1": 4.2112, + "eu-south-1": 4.6259, + "eu-south-2": 4.3392, + "eu-west-1": 4.3392, + "eu-west-2": 4.4288, + "eu-west-3": 4.4672, + "il-central-1": 0.0, + "me-central-1": 4.6144, + "me-south-1": 4.7776, + "mx-central-1": 4.1747, + "sa-east-1": 5.504, + "us-east-1": 4.0512, + "us-east-2": 4.0512, + "us-gov-east-1": 4.6848, + "us-gov-west-1": 4.6848, + "us-west-1": 4.4544, + "us-west-2": 4.1984, + "us-west-2-lax-1": 4.544 + }, + "m6gd.medium": { + "af-south-1": 0.0919, + "ap-east-1": 0.0976, + "ap-northeast-1": 0.0904, + "ap-northeast-2": 0.0875, + "ap-northeast-3": 0.0938, + "ap-south-1": 0.0621, + "ap-south-2": 0.0621, + "ap-southeast-1": 0.0918, + "ap-southeast-2": 0.0889, + "ap-southeast-3": 0.0884, + "ap-southeast-4": 0.0889, + "ap-southeast-5": 0.0799, + "ap-southeast-7": 0.0799, + "ca-central-1": 0.0823, + "ca-west-1": 0.0, + "eu-central-1": 0.0864, + "eu-central-2": 0.0919, + "eu-north-1": 0.0799, + "eu-south-1": 0.0847, + "eu-south-2": 0.0823, + "eu-west-1": 0.0853, + "eu-west-2": 0.0843, + "eu-west-3": 0.0847, + "il-central-1": 0.0848, + "me-central-1": 0.0873, + "me-south-1": 0.0873, + "mx-central-1": 0.0822, + "sa-east-1": 0.1039, + "us-east-1": 0.0771, + "us-east-2": 0.0771, + "us-gov-east-1": 0.0891, + "us-gov-west-1": 0.0891, + "us-west-1": 0.0849, + "us-west-2": 0.0771 + }, + "m6gd.large": { + "af-south-1": 0.1838, + "ap-east-1": 0.1878, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1816, + "ap-northeast-3": 0.1806, + "ap-south-1": 0.1278, + "ap-south-2": 0.1242, + "ap-southeast-1": 0.1768, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1768, + "ap-southeast-4": 0.1778, + "ap-southeast-5": 0.1656, + "ap-southeast-7": 0.1598, + "ca-central-1": 0.1646, + "ca-west-1": 0.1706, + "eu-central-1": 0.1793, + "eu-central-2": 0.1837, + "eu-north-1": 0.1656, + "eu-south-1": 0.0, + "eu-south-2": 0.1706, + "eu-west-1": 0.1646, + "eu-west-2": 0.1749, + "eu-west-3": 0.0, + "il-central-1": 0.1696, + "me-central-1": 0.1746, + "me-south-1": 0.0, + "mx-central-1": 0.1587, + "sa-east-1": 0.2161, + "us-east-1": 0.0, + "us-east-2": 0.1596, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.1782, + "us-west-1": 0.1698, + "us-west-2": 0.1542 + }, + "m6gd.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.3756, + "ap-northeast-1": 0.3616, + "ap-northeast-2": 0.35, + "ap-northeast-3": 0.3612, + "ap-south-1": 0.2484, + "ap-south-2": 0.2484, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.3536, + "ap-southeast-4": 0.3556, + "ap-southeast-5": 0.3197, + "ap-southeast-7": 0.3312, + "ca-central-1": 0.0, + "ca-west-1": 0.3292, + "eu-central-1": 0.3586, + "eu-central-2": 0.0, + "eu-north-1": 0.3196, + "eu-south-1": 0.3388, + "eu-south-2": 0.3292, + "eu-west-1": 0.0, + "eu-west-2": 0.3372, + "eu-west-3": 0.3388, + "il-central-1": 0.3393, + "me-central-1": 0.3625, + "me-south-1": 0.3494, + "mx-central-1": 0.3174, + "sa-east-1": 0.4156, + "us-east-1": 0.3084, + "us-east-2": 0.3192, + "us-gov-east-1": 0.3701, + "us-gov-west-1": 0.3564, + "us-west-1": 0.3396, + "us-west-2": 0.0 + }, + "m6gd.metal": { + "af-south-1": 0.0, + "ap-east-1": 5.5552, + "ap-northeast-1": 5.3312, + "ap-northeast-2": 5.1456, + "ap-northeast-3": 5.5491, + "ap-south-1": 3.52, + "ap-south-2": 3.52, + "ap-southeast-1": 5.2032, + "ap-southeast-2": 5.2352, + "ap-southeast-3": 5.2032, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 4.6605, + "ca-central-1": 4.8128, + "ca-west-1": 5.0063, + "eu-central-1": 5.2832, + "eu-central-2": 5.424, + "eu-north-1": 0.0, + "eu-south-1": 4.9664, + "eu-south-2": 4.8128, + "eu-west-1": 4.8128, + "eu-west-2": 0.0, + "eu-west-3": 4.9664, + "il-central-1": 4.9741, + "me-central-1": 5.3455, + "me-south-1": 5.1354, + "mx-central-1": 0.0, + "sa-east-1": 6.4611, + "us-east-1": 4.6536, + "us-east-2": 4.48, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 4.9792, + "us-west-2": 4.48 + }, + "m6gd.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.7512, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.7, + "ap-northeast-3": 0.7224, + "ap-south-1": 0.5113, + "ap-south-2": 0.0, + "ap-southeast-1": 0.7072, + "ap-southeast-2": 0.7384, + "ap-southeast-3": 0.7072, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.6394, + "ap-southeast-7": 0.6394, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.7172, + "eu-central-2": 0.7348, + "eu-north-1": 0.6392, + "eu-south-1": 0.6776, + "eu-south-2": 0.6584, + "eu-west-1": 0.6826, + "eu-west-2": 0.6744, + "eu-west-3": 0.6776, + "il-central-1": 0.0, + "me-central-1": 0.6984, + "me-south-1": 0.6987, + "mx-central-1": 0.6349, + "sa-east-1": 0.8644, + "us-east-1": 0.6168, + "us-east-2": 0.0, + "us-gov-east-1": 0.7128, + "us-gov-west-1": 0.7128, + "us-west-1": 0.0, + "us-west-2": 0.6168 + }, + "m6gd.4xlarge": { + "af-south-1": 1.4144, + "ap-east-1": 1.4483, + "ap-northeast-1": 1.3328, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.3312, + "ap-south-1": 0.0, + "ap-south-2": 0.88, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.3008, + "ap-southeast-4": 1.3088, + "ap-southeast-5": 1.1651, + "ap-southeast-7": 0.0, + "ca-central-1": 1.2516, + "ca-west-1": 0.0, + "eu-central-1": 1.2688, + "eu-central-2": 1.356, + "eu-north-1": 1.1648, + "eu-south-1": 0.0, + "eu-south-2": 1.2032, + "eu-west-1": 1.2032, + "eu-west-2": 1.2352, + "eu-west-3": 1.2923, + "il-central-1": 0.0, + "me-central-1": 1.3364, + "me-south-1": 1.2838, + "mx-central-1": 0.0, + "sa-east-1": 1.5488, + "us-east-1": 1.12, + "us-east-2": 1.12, + "us-gov-east-1": 1.312, + "us-gov-west-1": 1.312, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6gd.8xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 2.6656, + "ap-northeast-2": 2.6785, + "ap-northeast-3": 2.6624, + "ap-south-1": 1.76, + "ap-south-2": 0.0, + "ap-southeast-1": 2.6016, + "ap-southeast-2": 2.6176, + "ap-southeast-3": 0.0, + "ap-southeast-4": 2.6176, + "ap-southeast-5": 2.3302, + "ap-southeast-7": 0.0, + "ca-central-1": 2.4064, + "ca-west-1": 2.5032, + "eu-central-1": 2.5376, + "eu-central-2": 2.712, + "eu-north-1": 0.0, + "eu-south-1": 2.4832, + "eu-south-2": 2.5032, + "eu-west-1": 2.4064, + "eu-west-2": 2.4704, + "eu-west-3": 2.5846, + "il-central-1": 2.487, + "me-central-1": 2.5664, + "me-south-1": 2.6741, + "mx-central-1": 2.3123, + "sa-east-1": 3.0976, + "us-east-1": 2.24, + "us-east-2": 2.24, + "us-gov-east-1": 2.624, + "us-gov-west-1": 2.624, + "us-west-1": 2.592, + "us-west-2": 2.24 + }, + "m6gd.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.1664, + "ap-northeast-1": 3.9984, + "ap-northeast-2": 3.8592, + "ap-northeast-3": 3.9936, + "ap-south-1": 2.64, + "ap-south-2": 0.0, + "ap-southeast-1": 4.0656, + "ap-southeast-2": 3.9264, + "ap-southeast-3": 3.9024, + "ap-southeast-4": 3.9264, + "ap-southeast-5": 3.4954, + "ap-southeast-7": 3.4954, + "ca-central-1": 3.6096, + "ca-west-1": 3.7548, + "eu-central-1": 3.8064, + "eu-central-2": 4.068, + "eu-north-1": 0.0, + "eu-south-1": 3.7248, + "eu-south-2": 0.0, + "eu-west-1": 3.7548, + "eu-west-2": 3.7056, + "eu-west-3": 3.7248, + "il-central-1": 3.7306, + "me-central-1": 3.8496, + "me-south-1": 4.0112, + "mx-central-1": 3.4685, + "sa-east-1": 4.8458, + "us-east-1": 3.36, + "us-east-2": 3.4902, + "us-gov-east-1": 4.1007, + "us-gov-west-1": 3.936, + "us-west-1": 3.7344, + "us-west-2": 3.4902 + }, + "m6gd.16xlarge": { + "af-south-1": 5.4272, + "ap-east-1": 5.7933, + "ap-northeast-1": 5.5552, + "ap-northeast-2": 0.0, + "ap-northeast-3": 5.5491, + "ap-south-1": 3.636, + "ap-south-2": 3.52, + "ap-southeast-1": 5.2032, + "ap-southeast-2": 5.2352, + "ap-southeast-3": 5.4208, + "ap-southeast-4": 5.2352, + "ap-southeast-5": 4.6605, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 4.8128, + "eu-central-1": 5.0752, + "eu-central-2": 5.424, + "eu-north-1": 4.6592, + "eu-south-1": 4.9664, + "eu-south-2": 4.8128, + "eu-west-1": 5.0063, + "eu-west-2": 5.142, + "eu-west-3": 0.0, + "il-central-1": 4.9741, + "me-central-1": 5.1328, + "me-south-1": 5.1354, + "mx-central-1": 4.6246, + "sa-east-1": 6.1952, + "us-east-1": 4.48, + "us-east-2": 4.48, + "us-gov-east-1": 5.248, + "us-gov-west-1": 5.248, + "us-west-1": 4.9792, + "us-west-2": 4.6536 + }, + "m6i.large": { + "af-south-1": 0.1908, + "ap-east-1": 0.0, + "ap-northeast-1": 0.1878, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.1648, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1838, + "ap-southeast-5": 0.1658, + "ap-southeast-7": 0.1658, + "ca-central-1": 0.1708, + "ca-west-1": 0.1815, + "eu-central-1": 0.1788, + "eu-central-2": 0.1903, + "eu-north-1": 0.0, + "eu-south-1": 0.1758, + "eu-west-1": 0.0, + "eu-west-2": 0.1859, + "eu-west-3": 0.1758, + "il-central-1": 0.17615, + "me-central-1": 0.1815, + "me-south-1": 0.1958, + "mx-central-1": 0.1646, + "sa-east-1": 0.2168, + "us-east-1": 0.1598, + "us-east-2": 0.0, + "us-gov-east-1": 0.1848, + "us-gov-west-1": 0.1848, + "us-west-1": 0.0, + "us-west-2": 0.1694 + }, + "m6i.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.418, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.3498, + "ap-southeast-1": 0.3676, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.3676, + "ap-southeast-5": 0.3316, + "ap-southeast-7": 0.3316, + "ca-central-1": 0.363, + "ca-west-1": 0.3416, + "eu-central-1": 0.0, + "eu-central-2": 0.3806, + "eu-north-1": 0.352, + "eu-south-1": 0.3516, + "eu-west-1": 0.363, + "eu-west-2": 0.3496, + "eu-west-3": 0.374, + "il-central-1": 0.3523, + "me-central-1": 0.38654, + "me-south-1": 0.418, + "mx-central-1": 0.3292, + "sa-east-1": 0.4336, + "us-east-1": 0.3196, + "us-east-2": 0.3388, + "us-gov-east-1": 0.3696, + "us-gov-west-1": 0.3938, + "us-west-1": 0.3516, + "us-west-2": 0.3196 + }, + "m6i.metal": { + "af-south-1": 10.7008, + "ap-east-1": 11.0208, + "ap-northeast-1": 10.5088, + "ap-northeast-2": 10.1248, + "ap-northeast-3": 10.5088, + "ap-south-1": 9.0368, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 10.2528, + "ap-southeast-3": 10.2528, + "ap-southeast-5": 9.1008, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 9.4208, + "eu-central-1": 9.9328, + "eu-central-2": 10.6688, + "eu-north-1": 9.1008, + "eu-south-1": 9.7408, + "eu-west-1": 9.4208, + "eu-west-2": 9.6768, + "eu-west-3": 9.7408, + "il-central-1": 0.0, + "me-central-1": 10.1056, + "me-south-1": 11.0208, + "mx-central-1": 9.024, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 8.7168, + "us-gov-east-1": 10.3168, + "us-gov-west-1": 10.3168, + "us-west-1": 0.0, + "us-west-2": 8.7168 + }, + "m6i.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.7832, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.7744, + "ap-northeast-3": 0.7512, + "ap-south-1": 0.6592, + "ap-south-2": 0.0, + "ap-southeast-1": 0.7352, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.7352, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.6632, + "ca-central-1": 0.6832, + "ca-west-1": 0.6832, + "eu-central-1": 0.7152, + "eu-central-2": 0.7612, + "eu-north-1": 0.0, + "eu-south-1": 0.7032, + "eu-west-1": 0.6832, + "eu-west-2": 0.0, + "eu-west-3": 0.7032, + "il-central-1": 0.0, + "me-central-1": 0.726, + "me-south-1": 0.7832, + "mx-central-1": 0.6584, + "sa-east-1": 0.9284, + "us-east-1": 0.6776, + "us-east-2": 0.6392, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.7392, + "us-west-1": 0.748, + "us-west-2": 0.6392 + }, + "m6i.4xlarge": { + "af-south-1": 1.4128, + "ap-east-1": 1.4528, + "ap-northeast-1": 1.3888, + "ap-northeast-2": 1.3408, + "ap-northeast-3": 1.3888, + "ap-south-1": 1.2048, + "ap-south-2": 1.2048, + "ap-southeast-1": 1.3568, + "ap-southeast-2": 1.4528, + "ap-southeast-3": 1.3568, + "ap-southeast-5": 1.2944, + "ap-southeast-7": 1.2128, + "ca-central-1": 1.2528, + "ca-west-1": 0.0, + "eu-central-1": 1.4088, + "eu-central-2": 1.4088, + "eu-north-1": 1.2944, + "eu-south-1": 0.0, + "eu-west-1": 1.2528, + "eu-west-2": 1.3736, + "eu-west-3": 1.2928, + "il-central-1": 1.38548, + "me-central-1": 1.3384, + "me-south-1": 1.4528, + "mx-central-1": 1.2032, + "sa-east-1": 1.6208, + "us-east-1": 1.1648, + "us-east-2": 1.1648, + "us-gov-east-1": 1.3648, + "us-gov-west-1": 1.3648, + "us-west-1": 0.0, + "us-west-2": 1.2416 + }, + "m6i.8xlarge": { + "af-south-1": 3.0288, + "ap-east-1": 2.9056, + "ap-northeast-1": 2.7776, + "ap-northeast-2": 2.6816, + "ap-northeast-3": 2.976, + "ap-south-1": 2.4096, + "ap-south-2": 2.4096, + "ap-southeast-1": 2.7136, + "ap-southeast-2": 0.0, + "ap-southeast-3": 2.7136, + "ap-southeast-5": 2.4256, + "ap-southeast-7": 2.4256, + "ca-central-1": 2.6768, + "ca-west-1": 2.5056, + "eu-central-1": 2.8176, + "eu-central-2": 2.8176, + "eu-north-1": 2.5888, + "eu-south-1": 2.5856, + "eu-west-1": 2.5056, + "eu-west-2": 2.7472, + "eu-west-3": 0.0, + "il-central-1": 2.77096, + "me-central-1": 2.6768, + "me-south-1": 2.9056, + "mx-central-1": 2.4064, + "sa-east-1": 3.4864, + "us-east-1": 2.4832, + "us-east-2": 2.3296, + "us-gov-east-1": 2.7296, + "us-gov-west-1": 2.7296, + "us-west-1": 2.5856, + "us-west-2": 2.4832 + }, + "m6i.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.3584, + "ap-northeast-1": 4.464, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 3.6144, + "ap-southeast-1": 4.3584, + "ap-southeast-2": 4.0704, + "ap-southeast-3": 4.0704, + "ap-southeast-5": 3.6384, + "ap-southeast-7": 3.6384, + "ca-central-1": 4.0152, + "ca-west-1": 3.7584, + "eu-central-1": 4.2264, + "eu-central-2": 4.2264, + "eu-north-1": 3.6384, + "eu-south-1": 4.1472, + "eu-west-1": 3.7584, + "eu-west-2": 4.1208, + "eu-west-3": 3.8784, + "il-central-1": 3.8868, + "me-central-1": 4.0152, + "me-south-1": 4.6752, + "mx-central-1": 3.6096, + "sa-east-1": 4.8624, + "us-east-1": 3.4944, + "us-east-2": 3.7248, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.3848, + "us-west-1": 0.0, + "us-west-2": 3.4944 + }, + "m6i.16xlarge": { + "af-south-1": 5.6512, + "ap-east-1": 0.0, + "ap-northeast-1": 5.5552, + "ap-northeast-2": 5.3632, + "ap-northeast-3": 5.5552, + "ap-south-1": 4.8192, + "ap-south-2": 0.0, + "ap-southeast-1": 5.4272, + "ap-southeast-2": 5.8112, + "ap-southeast-3": 5.4272, + "ap-southeast-5": 4.8512, + "ap-southeast-7": 4.8512, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 5.2672, + "eu-central-2": 5.6352, + "eu-north-1": 4.8512, + "eu-south-1": 5.1712, + "eu-west-1": 5.0112, + "eu-west-2": 5.1392, + "eu-west-3": 5.1712, + "il-central-1": 5.1824, + "me-central-1": 5.3536, + "me-south-1": 6.2336, + "mx-central-1": 5.13536, + "sa-east-1": 6.4832, + "us-east-1": 4.6592, + "us-east-2": 0.0, + "us-gov-east-1": 5.8464, + "us-gov-west-1": 0.0, + "us-west-1": 5.1712, + "us-west-2": 4.6592 + }, + "m6i.24xlarge": { + "af-south-1": 8.4768, + "ap-east-1": 8.7168, + "ap-northeast-1": 0.0, + "ap-northeast-2": 8.0448, + "ap-northeast-3": 8.3328, + "ap-south-1": 7.7136, + "ap-south-2": 7.2288, + "ap-southeast-1": 8.1408, + "ap-southeast-2": 8.1408, + "ap-southeast-3": 8.1408, + "ap-southeast-5": 7.7664, + "ap-southeast-7": 7.2768, + "ca-central-1": 7.5168, + "ca-west-1": 7.5168, + "eu-central-1": 8.4528, + "eu-central-2": 9.06, + "eu-north-1": 7.2768, + "eu-south-1": 7.7568, + "eu-west-1": 7.5168, + "eu-west-2": 7.7088, + "eu-west-3": 7.7568, + "il-central-1": 8.31288, + "me-central-1": 8.0304, + "me-south-1": 9.3504, + "mx-central-1": 0.0, + "sa-east-1": 10.4592, + "us-east-1": 7.4496, + "us-east-2": 0.0, + "us-gov-east-1": 8.7696, + "us-gov-west-1": 8.1888, + "us-west-1": 7.7568, + "us-west-2": 0.0 + }, + "m6i.32xlarge": { + "af-south-1": 10.7008, + "ap-east-1": 11.0208, + "ap-northeast-1": 10.5088, + "ap-northeast-2": 10.1248, + "ap-northeast-3": 10.5088, + "ap-south-1": 9.0368, + "ap-south-2": 9.0368, + "ap-southeast-1": 10.2528, + "ap-southeast-2": 10.2528, + "ap-southeast-3": 10.2528, + "ap-southeast-5": 0.0, + "ap-southeast-7": 9.1008, + "ca-central-1": 9.4208, + "ca-west-1": 0.0, + "eu-central-1": 9.9328, + "eu-central-2": 10.6688, + "eu-north-1": 9.1008, + "eu-south-1": 9.7408, + "eu-west-1": 9.4208, + "eu-west-2": 9.6768, + "eu-west-3": 9.7408, + "il-central-1": 9.7632, + "me-central-1": 10.1056, + "me-south-1": 11.0208, + "mx-central-1": 9.024, + "sa-east-1": 12.3648, + "us-east-1": 0.0, + "us-east-2": 8.7168, + "us-gov-east-1": 10.3168, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 8.7168 + }, + "m6id.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.20975, + "ap-south-1": 0.20471, + "ap-southeast-1": 0.21185, + "ap-southeast-2": 0.22781, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.18964, + "ca-central-1": 0.0, + "ca-west-1": 0.1961, + "eu-central-1": 0.2066, + "eu-central-2": 0.22088, + "eu-west-1": 0.1961, + "eu-west-2": 0.0, + "il-central-1": 0.20272, + "mx-central-1": 0.20084, + "sa-east-1": 0.2528, + "us-east-1": 0.18245, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 0.18245 + }, + "m6id.xlarge": { + "ap-northeast-1": 0.46486, + "ap-northeast-2": 0.44869, + "ap-south-1": 0.40942, + "ap-southeast-1": 0.4237, + "ap-southeast-2": 0.45562, + "ap-southeast-5": 0.40445, + "ap-southeast-7": 0.37928, + "ca-central-1": 0.0, + "ca-west-1": 0.3922, + "eu-central-1": 0.4132, + "eu-central-2": 0.44176, + "eu-west-1": 0.3922, + "eu-west-2": 0.4027, + "il-central-1": 0.40544, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.3649, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6id.metal": { + "ap-northeast-1": 12.384, + "ap-northeast-2": 11.9136, + "ap-south-1": 10.7712, + "ap-southeast-1": 12.048, + "ap-southeast-2": 12.1152, + "ap-southeast-5": 10.62656, + "ap-southeast-7": 10.62656, + "ca-central-1": 11.04, + "ca-west-1": 11.04, + "eu-central-1": 11.712, + "eu-central-2": 12.62592, + "eu-west-1": 11.04, + "eu-west-2": 11.376, + "il-central-1": 11.46368, + "mx-central-1": 10.54592, + "sa-east-1": 14.6688, + "us-east-1": 10.1664, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6id.2xlarge": { + "ap-northeast-1": 0.92972, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.8474, + "ap-southeast-2": 0.8516, + "ap-southeast-5": 0.75856, + "ap-southeast-7": 0.75856, + "ca-central-1": 0.7844, + "ca-west-1": 0.7844, + "eu-central-1": 0.8264, + "eu-central-2": 0.88352, + "eu-west-1": 0.7844, + "eu-west-2": 0.8054, + "il-central-1": 0.81088, + "mx-central-1": 0.75352, + "sa-east-1": 1.0112, + "us-east-1": 0.7298, + "us-east-2": 0.7298, + "us-gov-west-1": 0.856, + "us-west-2": 0.77726 + }, + "m6id.4xlarge": { + "ap-northeast-1": 1.6232, + "ap-northeast-2": 1.68116, + "ap-south-1": 1.4216, + "ap-southeast-1": 1.5812, + "ap-southeast-2": 0.0, + "ap-southeast-5": 1.50419, + "ap-southeast-7": 1.40352, + "ca-central-1": 1.4552, + "ca-west-1": 1.4552, + "eu-central-1": 1.65344, + "eu-central-2": 0.0, + "eu-west-1": 1.4552, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "mx-central-1": 1.4931, + "sa-east-1": 1.9088, + "us-east-1": 1.346, + "us-east-2": 1.346, + "us-gov-west-1": 1.5984, + "us-west-2": 1.44092 + }, + "m6id.8xlarge": { + "ap-northeast-1": 3.2464, + "ap-northeast-2": 3.1288, + "ap-south-1": 2.8432, + "ap-southeast-1": 3.1624, + "ap-southeast-2": 3.1792, + "ap-southeast-5": 2.80704, + "ap-southeast-7": 0.0, + "ca-central-1": 2.9104, + "ca-west-1": 2.9104, + "eu-central-1": 3.0784, + "eu-central-2": 3.30688, + "eu-west-1": 3.12208, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 3.8176, + "us-east-1": 2.88184, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 2.692 + }, + "m6id.12xlarge": { + "ap-northeast-1": 5.23752, + "ap-northeast-2": 0.0, + "ap-south-1": 4.2648, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.12664, + "ap-southeast-5": 4.21056, + "ap-southeast-7": 4.21056, + "ca-central-1": 4.3656, + "ca-west-1": 4.3656, + "eu-central-1": 4.6176, + "eu-central-2": 4.96032, + "eu-west-1": 4.68312, + "eu-west-2": 4.82172, + "il-central-1": 4.85789, + "mx-central-1": 4.18032, + "sa-east-1": 5.7264, + "us-east-1": 0.0, + "us-east-2": 4.32276, + "us-gov-west-1": 4.7952, + "us-west-2": 0.0 + }, + "m6id.16xlarge": { + "ap-northeast-1": 6.98336, + "ap-northeast-2": 6.2576, + "ap-south-1": 5.6864, + "ap-southeast-1": 6.3248, + "ap-southeast-2": 6.3584, + "ap-southeast-5": 6.01677, + "ap-southeast-7": 5.61408, + "ca-central-1": 6.24416, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 6.61376, + "eu-west-1": 5.8208, + "eu-west-2": 0.0, + "il-central-1": 6.03264, + "mx-central-1": 5.57376, + "sa-east-1": 8.24, + "us-east-1": 0.0, + "us-east-2": 5.384, + "us-gov-west-1": 0.0, + "us-west-2": 5.384 + }, + "m6id.24xlarge": { + "ap-northeast-1": 10.47504, + "ap-northeast-2": 9.3864, + "ap-south-1": 9.14448, + "ap-southeast-1": 9.4872, + "ap-southeast-2": 9.5376, + "ap-southeast-5": 0.0, + "ap-southeast-7": 9.02515, + "ca-central-1": 8.7312, + "ca-west-1": 8.7312, + "eu-central-1": 9.92064, + "eu-central-2": 9.92064, + "eu-west-1": 9.36624, + "eu-west-2": 9.64344, + "il-central-1": 9.71578, + "mx-central-1": 8.36064, + "sa-east-1": 11.4528, + "us-east-1": 8.076, + "us-east-2": 0.0, + "us-gov-west-1": 9.5904, + "us-west-2": 8.076 + }, + "m6id.32xlarge": { + "ap-northeast-1": 12.384, + "ap-northeast-2": 11.9136, + "ap-south-1": 10.7712, + "ap-southeast-1": 12.048, + "ap-southeast-2": 12.1152, + "ap-southeast-5": 10.62656, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 11.04, + "eu-central-1": 11.712, + "eu-central-2": 12.62592, + "eu-west-1": 11.04, + "eu-west-2": 11.376, + "il-central-1": 11.46368, + "mx-central-1": 10.54592, + "sa-east-1": 0.0, + "us-east-1": 10.1664, + "us-east-2": 10.1664, + "us-gov-west-1": 12.1856, + "us-west-2": 0.0 + }, + "m6idn.large": { + "ap-northeast-1": 0.26855, + "ap-south-1": 0.25042, + "ap-southeast-1": 0.25919, + "ap-southeast-2": 0.26504, + "ca-central-1": 0.23798, + "eu-central-1": 0.0, + "eu-central-2": 0.29102, + "eu-north-1": 0.2298, + "eu-south-2": 0.0, + "eu-west-1": 0.24164, + "us-east-1": 0.22292, + "us-east-2": 0.0, + "us-gov-west-1": 0.26387, + "us-west-1": 0.24724, + "us-west-2": 0.22292 + }, + "m6idn.xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.4669, + "ap-southeast-1": 0.51838, + "ap-southeast-2": 0.57033, + "ca-central-1": 0.47596, + "eu-central-1": 0.50668, + "eu-central-2": 0.0, + "eu-north-1": 0.4596, + "eu-south-2": 0.0, + "eu-west-1": 0.48328, + "us-east-1": 0.44584, + "us-east-2": 0.44584, + "us-gov-west-1": 0.52774, + "us-west-1": 0.53117, + "us-west-2": 0.44584 + }, + "m6idn.metal": { + "ap-northeast-1": 15.6768, + "ap-south-1": 13.4304, + "ap-southeast-1": 15.07776, + "ap-southeast-2": 0.0, + "ca-central-1": 13.72032, + "eu-central-1": 0.0, + "eu-central-2": 15.79264, + "eu-north-1": 0.0, + "eu-south-2": 13.72032, + "eu-west-1": 0.0, + "us-east-1": 12.75648, + "us-east-2": 12.75648, + "us-gov-west-1": 15.37728, + "us-west-1": 14.31296, + "us-west-2": 0.0 + }, + "m6idn.2xlarge": { + "ap-northeast-1": 1.1561, + "ap-south-1": 0.9338, + "ap-southeast-1": 1.03676, + "ap-southeast-2": 1.06016, + "ca-central-1": 0.95192, + "eu-central-1": 1.08918, + "eu-central-2": 1.08144, + "eu-north-1": 0.9192, + "eu-south-2": 0.95192, + "eu-west-1": 0.96656, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 1.05548, + "us-west-1": 0.0, + "us-west-2": 0.89168 + }, + "m6idn.4xlarge": { + "ap-northeast-1": 2.0348, + "ap-south-1": 1.754, + "ap-southeast-1": 2.11623, + "ap-southeast-2": 2.00672, + "ca-central-1": 0.0, + "eu-central-1": 2.06475, + "eu-central-2": 2.04928, + "eu-north-1": 1.7248, + "eu-south-2": 1.79024, + "eu-west-1": 1.96179, + "us-east-1": 1.66976, + "us-east-2": 1.66976, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 1.66976 + }, + "m6idn.8xlarge": { + "ap-northeast-1": 4.0696, + "ap-south-1": 3.508, + "ap-southeast-1": 4.23246, + "ap-southeast-2": 4.01344, + "ca-central-1": 3.58048, + "eu-central-1": 3.82624, + "eu-central-2": 4.42906, + "eu-north-1": 3.7152, + "eu-south-2": 3.58048, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 3.99472, + "us-west-1": 0.0, + "us-west-2": 3.33952 + }, + "m6idn.12xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 5.262, + "ap-southeast-1": 5.87976, + "ap-southeast-2": 6.02016, + "ca-central-1": 5.37072, + "eu-central-1": 0.0, + "eu-central-2": 6.64358, + "eu-north-1": 0.0, + "eu-south-2": 5.37072, + "eu-west-1": 5.45856, + "us-east-1": 5.00928, + "us-east-2": 5.39117, + "us-gov-west-1": 0.0, + "us-west-1": 5.59296, + "us-west-2": 5.00928 + }, + "m6idn.16xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 7.55888, + "ap-southeast-1": 7.83968, + "ap-southeast-2": 8.02688, + "ca-central-1": 7.16096, + "eu-central-1": 7.65248, + "eu-central-2": 8.85811, + "eu-north-1": 6.8992, + "eu-south-2": 7.16096, + "eu-west-1": 7.27808, + "us-east-1": 6.67904, + "us-east-2": 7.18822, + "us-gov-west-1": 7.98944, + "us-west-1": 7.45728, + "us-west-2": 0.0 + }, + "m6idn.24xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 11.33832, + "ap-southeast-1": 11.75952, + "ap-southeast-2": 12.04032, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 10.3488, + "eu-south-2": 10.74144, + "eu-west-1": 10.91712, + "us-east-1": 10.01856, + "us-east-2": 10.01856, + "us-gov-west-1": 11.98416, + "us-west-1": 11.18592, + "us-west-2": 10.01856 + }, + "m6idn.32xlarge": { + "ap-northeast-1": 15.6768, + "ap-south-1": 13.4304, + "ap-southeast-1": 15.07776, + "ap-southeast-2": 15.45216, + "ca-central-1": 13.72032, + "eu-central-1": 14.70336, + "eu-central-2": 15.79264, + "eu-north-1": 0.0, + "eu-south-2": 13.72032, + "eu-west-1": 13.95456, + "us-east-1": 12.75648, + "us-east-2": 12.75648, + "us-gov-west-1": 15.37728, + "us-west-1": 14.31296, + "us-west-2": 12.75648 + }, + "m6in.large": { + "ap-northeast-1": 0.26071, + "ap-south-1": 0.20888, + "ap-southeast-1": 0.23462, + "ap-southeast-2": 0.25685, + "ca-central-1": 0.0, + "eu-central-1": 0.22877, + "eu-central-2": 0.24726, + "eu-north-1": 0.2118, + "eu-south-2": 0.2345, + "eu-west-1": 0.21941, + "us-east-1": 0.20303, + "us-east-2": 0.20303, + "us-gov-west-1": 0.23813, + "us-west-1": 0.22624, + "us-west-2": 0.21695 + }, + "m6in.xlarge": { + "ap-northeast-1": 0.48562, + "ap-south-1": 0.41776, + "ap-southeast-1": 0.46924, + "ap-southeast-2": 0.4786, + "ca-central-1": 0.43796, + "eu-central-1": 0.49053, + "eu-central-2": 0.49452, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.46994, + "us-east-1": 0.40606, + "us-east-2": 0.0, + "us-gov-west-1": 0.47626, + "us-west-1": 0.45248, + "us-west-2": 0.40606 + }, + "m6in.metal": { + "ap-northeast-1": 14.02944, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 13.8048, + "ca-central-1": 12.50432, + "eu-central-1": 13.13088, + "eu-central-2": 0.0, + "eu-north-1": 12.0448, + "eu-south-2": 12.50432, + "eu-west-1": 12.53184, + "us-east-1": 11.48352, + "us-east-2": 11.48352, + "us-gov-west-1": 13.72992, + "us-west-1": 12.96896, + "us-west-2": 0.0 + }, + "m6in.2xlarge": { + "ap-northeast-1": 0.97124, + "ap-south-1": 0.89355, + "ap-southeast-1": 0.93848, + "ap-southeast-2": 1.0274, + "ca-central-1": 0.87592, + "eu-central-1": 0.91508, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.81212, + "us-east-2": 0.81212, + "us-gov-west-1": 0.95252, + "us-west-1": 0.90496, + "us-west-2": 0.81212 + }, + "m6in.4xlarge": { + "ap-northeast-1": 1.97209, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.9412, + "ca-central-1": 1.63824, + "eu-central-1": 0.0, + "eu-central-2": 2.01125, + "eu-north-1": 1.5808, + "eu-south-2": 0.0, + "eu-west-1": 1.64168, + "us-east-1": 1.51064, + "us-east-2": 1.51064, + "us-gov-west-1": 1.79144, + "us-west-1": 0.0, + "us-west-2": 1.51064 + }, + "m6in.8xlarge": { + "ap-northeast-1": 3.94418, + "ap-south-1": 3.11488, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.6016, + "ca-central-1": 3.52477, + "eu-central-1": 3.43312, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 3.27648, + "eu-west-1": 3.28336, + "us-east-1": 3.02128, + "us-east-2": 3.02128, + "us-gov-west-1": 3.58288, + "us-west-1": 3.39264, + "us-west-2": 3.24405 + }, + "m6in.12xlarge": { + "ap-northeast-1": 5.48664, + "ap-south-1": 4.67232, + "ap-southeast-1": 5.29008, + "ap-southeast-2": 0.0, + "ca-central-1": 4.91472, + "eu-central-1": 5.54561, + "eu-central-2": 5.59344, + "eu-north-1": 0.0, + "eu-south-2": 5.28715, + "eu-west-1": 4.92504, + "us-east-1": 4.53192, + "us-east-2": 4.53192, + "us-gov-west-1": 5.37432, + "us-west-1": 5.08896, + "us-west-2": 4.53192 + }, + "m6in.16xlarge": { + "ap-northeast-1": 7.31552, + "ap-south-1": 0.0, + "ap-southeast-1": 7.60006, + "ap-southeast-2": 7.7648, + "ca-central-1": 0.0, + "eu-central-1": 6.86624, + "eu-central-2": 7.45792, + "eu-north-1": 0.0, + "eu-south-2": 6.55296, + "eu-west-1": 6.56672, + "us-east-1": 6.04256, + "us-east-2": 6.04256, + "us-gov-west-1": 7.16576, + "us-west-1": 6.78528, + "us-west-2": 0.0 + }, + "m6in.24xlarge": { + "ap-northeast-1": 10.97328, + "ap-south-1": 9.34464, + "ap-southeast-1": 11.4001, + "ap-southeast-2": 11.6472, + "ca-central-1": 10.5743, + "eu-central-1": 0.0, + "eu-central-2": 11.18688, + "eu-north-1": 9.4848, + "eu-south-2": 0.0, + "eu-west-1": 9.85008, + "us-east-1": 9.06384, + "us-east-2": 9.06384, + "us-gov-west-1": 11.58542, + "us-west-1": 10.95763, + "us-west-2": 9.06384 + }, + "m6in.32xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 11.85792, + "ap-southeast-1": 13.50528, + "ap-southeast-2": 13.8048, + "ca-central-1": 12.50432, + "eu-central-1": 13.13088, + "eu-central-2": 14.31424, + "eu-north-1": 12.0448, + "eu-south-2": 12.50432, + "eu-west-1": 12.53184, + "us-east-1": 11.48352, + "us-east-2": 11.48352, + "us-gov-west-1": 13.72992, + "us-west-1": 12.96896, + "us-west-2": 11.48352 + }, + "m7a.medium": { + "ap-northeast-1": 0.10677, + "eu-central-1": 0.10133, + "eu-north-1": 0.09348, + "eu-south-2": 0.0965, + "eu-west-1": 0.0, + "us-east-1": 0.09566, + "us-east-2": 0.08986, + "us-west-2": 0.08986 + }, + "m7a.large": { + "ap-northeast-1": 0.2285, + "eu-central-1": 0.20266, + "eu-north-1": 0.18696, + "eu-south-2": 0.20592, + "eu-west-1": 0.193, + "us-east-1": 0.17972, + "us-east-2": 0.17972, + "us-west-2": 0.17972 + }, + "m7a.xlarge": { + "ap-northeast-1": 0.42706, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.41184, + "eu-west-1": 0.41184, + "us-east-1": 0.35944, + "us-east-2": 0.35944, + "us-west-2": 0.35944 + }, + "m7a.metal-48xl": { + "ap-northeast-1": 18.23328, + "eu-central-1": 0.0, + "eu-north-1": 15.68256, + "eu-south-2": 16.2624, + "eu-west-1": 16.2624, + "us-east-1": 0.0, + "us-east-2": 14.98752, + "us-west-2": 14.98752 + }, + "m7a.2xlarge": { + "ap-northeast-1": 0.91401, + "eu-central-1": 0.0, + "eu-north-1": 0.74784, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.71888, + "us-east-2": 0.71888, + "us-west-2": 0.71888 + }, + "m7a.4xlarge": { + "ap-northeast-1": 1.59464, + "eu-central-1": 1.50768, + "eu-north-1": 0.0, + "eu-south-2": 1.4304, + "eu-west-1": 1.4304, + "us-east-1": 1.4169, + "us-east-2": 1.32416, + "us-west-2": 1.32416 + }, + "m7a.8xlarge": { + "ap-northeast-1": 3.18928, + "eu-central-1": 3.01536, + "eu-north-1": 2.76416, + "eu-south-2": 2.8608, + "eu-west-1": 3.06752, + "us-east-1": 2.64832, + "us-east-2": 2.64832, + "us-west-2": 0.0 + }, + "m7a.12xlarge": { + "ap-northeast-1": 5.14327, + "eu-central-1": 4.52304, + "eu-north-1": 4.44182, + "eu-south-2": 4.2912, + "eu-west-1": 4.2912, + "us-east-1": 4.25069, + "us-east-2": 3.97248, + "us-west-2": 0.0 + }, + "m7a.16xlarge": { + "ap-northeast-1": 6.37856, + "eu-central-1": 0.0, + "eu-north-1": 5.52832, + "eu-south-2": 5.7216, + "eu-west-1": 0.0, + "us-east-1": 5.66758, + "us-east-2": 5.29664, + "us-west-2": 5.29664 + }, + "m7a.24xlarge": { + "ap-northeast-1": 10.28654, + "eu-central-1": 9.04608, + "eu-north-1": 8.29248, + "eu-south-2": 0.0, + "eu-west-1": 9.20256, + "us-east-1": 7.94496, + "us-east-2": 7.94496, + "us-west-2": 0.0 + }, + "m7a.32xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 12.34854, + "eu-north-1": 0.0, + "eu-south-2": 11.66848, + "eu-west-1": 10.8416, + "us-east-1": 9.99168, + "us-east-2": 9.99168, + "us-west-2": 9.99168 + }, + "m7a.48xlarge": { + "ap-northeast-1": 18.23328, + "eu-central-1": 0.0, + "eu-north-1": 15.68256, + "eu-south-2": 16.2624, + "eu-west-1": 0.0, + "us-east-1": 14.98752, + "us-east-2": 14.98752, + "us-west-2": 14.98752 + }, + "m7g.medium": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0852, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0611, + "ap-south-2": 0.0611, + "ap-southeast-1": 0.0829, + "ap-southeast-2": 0.0861, + "ap-southeast-3": 0.0829, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0753, + "ca-central-1": 0.0, + "eu-central-1": 0.0839, + "eu-north-1": 0.0753, + "eu-south-2": 0.0774, + "eu-west-1": 0.0774, + "eu-west-2": 0.082, + "eu-west-3": 0.0825, + "me-central-1": 0.0819, + "me-south-1": 0.0, + "mx-central-1": 0.0747, + "sa-east-1": 0.0969, + "us-east-1": 0.0727, + "us-east-2": 0.0727, + "us-gov-east-1": 0.0833, + "us-west-1": 0.0795, + "us-west-2": 0.0727 + }, + "m7g.large": { + "ap-northeast-1": 0.1759, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.1692, + "ap-south-1": 0.1221, + "ap-south-2": 0.1221, + "ap-southeast-1": 0.1658, + "ap-southeast-2": 0.1658, + "ap-southeast-3": 0.1722, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.1505, + "ca-central-1": 0.1548, + "eu-central-1": 0.1616, + "eu-north-1": 0.0, + "eu-south-2": 0.1604, + "eu-west-1": 0.1605, + "eu-west-2": 0.1582, + "eu-west-3": 0.0, + "me-central-1": 0.0, + "me-south-1": 0.176, + "mx-central-1": 0.1549, + "sa-east-1": 0.2015, + "us-east-1": 0.1454, + "us-east-2": 0.1454, + "us-gov-east-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.1454 + }, + "m7g.xlarge": { + "ap-northeast-1": 0.3517, + "ap-northeast-2": 0.3282, + "ap-northeast-3": 0.3384, + "ap-south-1": 0.2442, + "ap-south-2": 0.2442, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.3316, + "ap-southeast-5": 0.301, + "ap-southeast-7": 0.301, + "ca-central-1": 0.3095, + "eu-central-1": 0.3231, + "eu-north-1": 0.301, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.3163, + "eu-west-3": 0.318, + "me-central-1": 0.3277, + "me-south-1": 0.352, + "mx-central-1": 0.299, + "sa-east-1": 0.3877, + "us-east-1": 0.2908, + "us-east-2": 0.0, + "us-gov-east-1": 0.3462, + "us-west-1": 0.318, + "us-west-2": 0.0 + }, + "m7g.metal": { + "ap-northeast-1": 4.96, + "ap-northeast-2": 4.7968, + "ap-northeast-3": 4.96, + "ap-south-1": 3.4534, + "ap-south-2": 0.0, + "ap-southeast-1": 4.8512, + "ap-southeast-2": 4.8512, + "ap-southeast-3": 4.8512, + "ap-southeast-4": 4.8512, + "ap-southeast-5": 4.3616, + "ap-southeast-7": 4.3616, + "ca-central-1": 4.4979, + "eu-central-1": 4.7155, + "eu-north-1": 4.3616, + "eu-south-2": 4.496, + "eu-west-1": 4.4976, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "me-central-1": 4.7886, + "me-south-1": 5.1776, + "mx-central-1": 4.329, + "sa-east-1": 5.7488, + "us-east-1": 4.1984, + "us-east-2": 4.1984, + "us-gov-east-1": 4.8768, + "us-west-1": 4.6336, + "us-west-2": 4.1984 + }, + "m7g.2xlarge": { + "ap-northeast-1": 0.6768, + "ap-northeast-2": 0.6564, + "ap-northeast-3": 0.6768, + "ap-south-1": 0.0, + "ap-south-2": 0.4885, + "ap-southeast-1": 0.6632, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.6889, + "ap-southeast-4": 0.6889, + "ap-southeast-5": 0.6238, + "ap-southeast-7": 0.6238, + "ca-central-1": 0.0, + "eu-central-1": 0.6462, + "eu-north-1": 0.6238, + "eu-south-2": 0.0, + "eu-west-1": 0.619, + "eu-west-2": 0.6564, + "eu-west-3": 0.6599, + "me-central-1": 0.6806, + "me-south-1": 0.7323, + "mx-central-1": 0.5979, + "sa-east-1": 0.8061, + "us-east-1": 0.5816, + "us-east-2": 0.6022, + "us-gov-east-1": 0.6923, + "us-west-1": 0.6599, + "us-west-2": 0.5816 + }, + "m7g.4xlarge": { + "ap-northeast-1": 1.24, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.24, + "ap-south-1": 0.8634, + "ap-south-2": 0.8634, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.2128, + "ap-southeast-4": 1.2128, + "ap-southeast-5": 1.0904, + "ap-southeast-7": 1.1341, + "ca-central-1": 1.1245, + "eu-central-1": 1.1789, + "eu-north-1": 1.0904, + "eu-south-2": 1.124, + "eu-west-1": 1.1244, + "eu-west-2": 1.1992, + "eu-west-3": 1.2062, + "me-central-1": 1.2476, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 1.0496, + "us-gov-east-1": 1.2192, + "us-west-1": 1.1584, + "us-west-2": 1.0496 + }, + "m7g.8xlarge": { + "ap-northeast-1": 2.48, + "ap-northeast-2": 2.3984, + "ap-northeast-3": 2.5812, + "ap-south-1": 1.7854, + "ap-south-2": 1.7267, + "ap-southeast-1": 2.4256, + "ap-southeast-2": 2.5284, + "ap-southeast-3": 2.5284, + "ap-southeast-4": 2.4256, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.1808, + "ca-central-1": 2.249, + "eu-central-1": 2.3578, + "eu-north-1": 2.1808, + "eu-south-2": 2.248, + "eu-west-1": 2.2488, + "eu-west-2": 2.3034, + "eu-west-3": 2.3168, + "me-central-1": 2.3943, + "me-south-1": 2.5888, + "mx-central-1": 2.1645, + "sa-east-1": 2.8744, + "us-east-1": 2.0992, + "us-east-2": 2.0992, + "us-gov-east-1": 0.0, + "us-west-1": 2.3168, + "us-west-2": 2.0992 + }, + "m7g.12xlarge": { + "ap-northeast-1": 3.72, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.72, + "ap-south-1": 2.5901, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.7926, + "ap-southeast-3": 3.6384, + "ap-southeast-4": 3.6384, + "ap-southeast-5": 0.0, + "ap-southeast-7": 3.2712, + "ca-central-1": 3.3734, + "eu-central-1": 0.0, + "eu-north-1": 3.2712, + "eu-south-2": 3.372, + "eu-west-1": 3.3732, + "eu-west-2": 3.455, + "eu-west-3": 3.6187, + "me-central-1": 3.5915, + "me-south-1": 3.8832, + "mx-central-1": 3.2467, + "sa-east-1": 4.4958, + "us-east-1": 3.1488, + "us-east-2": 3.1488, + "us-gov-east-1": 3.6576, + "us-west-1": 3.6187, + "us-west-2": 3.1488 + }, + "m7g.16xlarge": { + "ap-northeast-1": 4.96, + "ap-northeast-2": 4.7968, + "ap-northeast-3": 0.0, + "ap-south-1": 3.4534, + "ap-south-2": 3.4534, + "ap-southeast-1": 4.8512, + "ap-southeast-2": 4.8512, + "ap-southeast-3": 0.0, + "ap-southeast-4": 4.8512, + "ap-southeast-5": 4.3616, + "ap-southeast-7": 4.3616, + "ca-central-1": 4.4979, + "eu-central-1": 4.7155, + "eu-north-1": 4.3616, + "eu-south-2": 0.0, + "eu-west-1": 4.4976, + "eu-west-2": 4.6067, + "eu-west-3": 0.0, + "me-central-1": 4.7886, + "me-south-1": 5.1776, + "mx-central-1": 4.329, + "sa-east-1": 5.7488, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 4.8768, + "us-west-1": 4.6336, + "us-west-2": 4.1984 + }, + "m7gd.medium": { + "ap-northeast-1": 0.105, + "ap-south-1": 0.0695, + "ap-southeast-1": 0.0985, + "ap-southeast-2": 0.103, + "ap-southeast-5": 0.0885, + "ap-southeast-7": 0.0885, + "eu-central-1": 0.1, + "eu-north-1": 0.0886, + "eu-south-2": 0.0914, + "eu-west-1": 0.095, + "eu-west-3": 0.0943, + "mx-central-1": 0.0, + "sa-east-1": 0.117, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 0.0947, + "us-west-2": 0.0853 + }, + "m7gd.large": { + "ap-northeast-1": 0.2018, + "ap-south-1": 0.1348, + "ap-southeast-1": 0.197, + "ap-southeast-2": 0.198, + "ap-southeast-5": 0.1771, + "ap-southeast-7": 0.1771, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-3": 0.196, + "mx-central-1": 0.1759, + "sa-east-1": 0.2437, + "us-east-1": 0.1706, + "us-east-2": 0.1706, + "us-west-1": 0.1895, + "us-west-2": 0.0 + }, + "m7gd.xlarge": { + "ap-northeast-1": 0.4035, + "ap-south-1": 0.2781, + "ap-southeast-1": 0.3941, + "ap-southeast-2": 0.396, + "ap-southeast-5": 0.3541, + "ap-southeast-7": 0.3541, + "eu-central-1": 0.3846, + "eu-north-1": 0.3544, + "eu-south-2": 0.3657, + "eu-west-1": 0.0, + "eu-west-3": 0.0, + "mx-central-1": 0.3518, + "sa-east-1": 0.0, + "us-east-1": 0.354, + "us-east-2": 0.0, + "us-west-1": 0.379, + "us-west-2": 0.3412 + }, + "m7gd.metal": { + "ap-northeast-1": 0.0, + "ap-south-1": 3.8592, + "ap-southeast-1": 5.851, + "ap-southeast-2": 5.8813, + "ap-southeast-5": 5.2115, + "ap-southeast-7": 5.2115, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 5.3974, + "eu-west-1": 5.3974, + "eu-west-3": 5.5789, + "mx-central-1": 5.175, + "sa-east-1": 7.0304, + "us-east-1": 5.0043, + "us-east-2": 5.0043, + "us-west-1": 5.6091, + "us-west-2": 5.0043 + }, + "m7gd.2xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.5392, + "ap-southeast-1": 0.7882, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.7082, + "ap-southeast-7": 0.7082, + "eu-central-1": 0.0, + "eu-north-1": 0.736, + "eu-south-2": 0.7315, + "eu-west-1": 0.7315, + "eu-west-3": 0.7542, + "mx-central-1": 0.7037, + "sa-east-1": 0.0, + "us-east-1": 0.708, + "us-east-2": 0.6823, + "us-west-1": 0.7579, + "us-west-2": 0.6823 + }, + "m7gd.4xlarge": { + "ap-northeast-1": 1.5668, + "ap-south-1": 0.9648, + "ap-southeast-1": 1.5267, + "ap-southeast-2": 1.5347, + "ap-southeast-5": 1.3572, + "ap-southeast-7": 1.3029, + "eu-central-1": 1.425, + "eu-north-1": 1.3584, + "eu-south-2": 1.3494, + "eu-west-1": 1.4065, + "eu-west-3": 1.3947, + "mx-central-1": 1.3476, + "sa-east-1": 1.7576, + "us-east-1": 1.2511, + "us-east-2": 1.2511, + "us-west-1": 0.0, + "us-west-2": 1.2511 + }, + "m7gd.8xlarge": { + "ap-northeast-1": 3.0011, + "ap-south-1": 1.9296, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.9406, + "ap-southeast-5": 2.7145, + "ap-southeast-7": 2.6058, + "eu-central-1": 0.0, + "eu-north-1": 2.7169, + "eu-south-2": 2.6987, + "eu-west-1": 2.6987, + "eu-west-3": 2.7894, + "mx-central-1": 0.0, + "sa-east-1": 3.5152, + "us-east-1": 2.5022, + "us-east-2": 2.6047, + "us-west-1": 2.8046, + "us-west-2": 2.5022 + }, + "m7gd.12xlarge": { + "ap-northeast-1": 4.7004, + "ap-south-1": 2.9966, + "ap-southeast-1": 4.3883, + "ap-southeast-2": 4.411, + "ap-southeast-5": 3.9086, + "ap-southeast-7": 0.0, + "eu-central-1": 4.2749, + "eu-north-1": 4.0753, + "eu-south-2": 4.2195, + "eu-west-1": 4.0481, + "eu-west-3": 4.1842, + "mx-central-1": 4.0427, + "sa-east-1": 5.2728, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 4.2068, + "us-west-2": 0.0 + }, + "m7gd.16xlarge": { + "ap-northeast-1": 6.0022, + "ap-south-1": 3.8592, + "ap-southeast-1": 5.851, + "ap-southeast-2": 5.8813, + "ap-southeast-5": 5.2115, + "ap-southeast-7": 5.2115, + "eu-central-1": 5.6998, + "eu-north-1": 0.0, + "eu-south-2": 5.3974, + "eu-west-1": 5.3974, + "eu-west-3": 5.5789, + "mx-central-1": 5.175, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 5.0043, + "us-west-1": 5.6091, + "us-west-2": 0.0 + }, + "m7i.large": { + "ap-northeast-1": 0.194, + "ap-northeast-2": 0.1877, + "ap-south-1": 0.16985, + "ap-southeast-1": 0.1898, + "ap-southeast-2": 0.1898, + "ap-southeast-3": 0.1898, + "ap-southeast-5": 0.18161, + "ap-southeast-7": 0.0, + "ca-central-1": 0.17615, + "eu-central-1": 0.19663, + "eu-north-1": 0.18161, + "eu-south-2": 0.0, + "eu-west-1": 0.18739, + "eu-west-2": 0.19201, + "eu-west-3": 0.1814, + "mx-central-1": 0.16964, + "sa-east-1": 0.24052, + "us-east-1": 0.1646, + "us-east-2": 0.0, + "us-gov-east-1": 0.19085, + "us-gov-west-1": 0.19085, + "us-west-1": 0.19316, + "us-west-2": 0.17468 + }, + "m7i.xlarge": { + "ap-northeast-1": 0.388, + "ap-northeast-2": 0.3754, + "ap-south-1": 0.3397, + "ap-southeast-1": 0.3796, + "ap-southeast-2": 0.3796, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.3418, + "ca-central-1": 0.3523, + "eu-central-1": 0.39325, + "eu-north-1": 0.3418, + "eu-south-2": 0.0, + "eu-west-1": 0.37477, + "eu-west-2": 0.0, + "eu-west-3": 0.3628, + "mx-central-1": 0.33928, + "sa-east-1": 0.4489, + "us-east-1": 0.34936, + "us-east-2": 0.0, + "us-gov-east-1": 0.3817, + "us-gov-west-1": 0.3817, + "us-west-1": 0.3628, + "us-west-2": 0.3292 + }, + "m7i.metal-24xl": { + "ap-northeast-1": 8.6304, + "ap-northeast-2": 0.0, + "ap-south-1": 7.4712, + "ap-southeast-1": 8.4288, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-5": 7.5216, + "ap-southeast-7": 7.5216, + "ca-central-1": 0.0, + "eu-central-1": 8.1768, + "eu-north-1": 7.5216, + "eu-south-2": 7.7736, + "eu-west-1": 7.7736, + "eu-west-2": 7.9752, + "eu-west-3": 8.0256, + "mx-central-1": 7.46112, + "sa-east-1": 10.86312, + "us-east-1": 0.0, + "us-east-2": 7.2192, + "us-gov-east-1": 0.0, + "us-gov-west-1": 8.4792, + "us-west-1": 8.0256, + "us-west-2": 7.70304 + }, + "m7i.metal-48xl": { + "ap-northeast-1": 16.3584, + "ap-northeast-2": 15.7536, + "ap-south-1": 14.04, + "ap-southeast-1": 15.9552, + "ap-southeast-2": 15.9552, + "ap-southeast-3": 15.9552, + "ap-southeast-5": 0.0, + "ap-southeast-7": 14.1408, + "ca-central-1": 0.0, + "eu-central-1": 15.4512, + "eu-north-1": 0.0, + "eu-south-2": 14.6448, + "eu-west-1": 0.0, + "eu-west-2": 15.048, + "eu-west-3": 15.1488, + "mx-central-1": 14.01984, + "sa-east-1": 0.0, + "us-east-1": 13.536, + "us-east-2": 0.0, + "us-gov-east-1": 16.056, + "us-gov-west-1": 16.056, + "us-west-1": 15.1488, + "us-west-2": 13.536 + }, + "m7i.2xlarge": { + "ap-northeast-1": 0.776, + "ap-northeast-2": 0.7508, + "ap-south-1": 0.72182, + "ap-southeast-1": 0.7592, + "ap-southeast-2": 0.7592, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.6836, + "ap-southeast-7": 0.0, + "ca-central-1": 0.7046, + "eu-central-1": 0.7382, + "eu-north-1": 0.6836, + "eu-south-2": 0.7046, + "eu-west-1": 0.7046, + "eu-west-2": 0.7214, + "eu-west-3": 0.7256, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.6584, + "us-east-2": 0.6584, + "us-gov-east-1": 0.7634, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.69872 + }, + "m7i.4xlarge": { + "ap-northeast-1": 1.4384, + "ap-northeast-2": 1.48712, + "ap-south-1": 1.2452, + "ap-southeast-1": 1.5056, + "ap-southeast-2": 1.4048, + "ap-southeast-3": 1.4048, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.2536, + "ca-central-1": 1.2956, + "eu-central-1": 0.0, + "eu-north-1": 1.2536, + "eu-south-2": 1.2956, + "eu-west-1": 1.2956, + "eu-west-2": 1.3292, + "eu-west-3": 1.3376, + "mx-central-1": 1.24352, + "sa-east-1": 1.682, + "us-east-1": 1.2032, + "us-east-2": 1.28384, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.4132, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m7i.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.776, + "ap-south-1": 2.66008, + "ap-southeast-1": 3.0112, + "ap-southeast-2": 0.0, + "ap-southeast-3": 3.0112, + "ap-southeast-5": 2.5072, + "ap-southeast-7": 2.5072, + "ca-central-1": 0.0, + "eu-central-1": 2.7256, + "eu-north-1": 2.5072, + "eu-south-2": 2.77096, + "eu-west-1": 2.5912, + "eu-west-2": 0.0, + "eu-west-3": 2.6752, + "mx-central-1": 2.48704, + "sa-east-1": 3.62104, + "us-east-1": 2.4064, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.02968, + "us-west-1": 2.6752, + "us-west-2": 2.4064 + }, + "m7i.12xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.164, + "ap-south-1": 3.99012, + "ap-southeast-1": 4.2144, + "ap-southeast-2": 4.2144, + "ap-southeast-3": 4.2144, + "ap-southeast-5": 3.7608, + "ap-southeast-7": 4.01784, + "ca-central-1": 3.8868, + "eu-central-1": 4.0884, + "eu-north-1": 0.0, + "eu-south-2": 3.8868, + "eu-west-1": 0.0, + "eu-west-2": 3.9876, + "eu-west-3": 4.29504, + "mx-central-1": 3.73056, + "sa-east-1": 5.046, + "us-east-1": 3.6096, + "us-east-2": 3.6096, + "us-gov-east-1": 4.2396, + "us-gov-west-1": 4.2396, + "us-west-1": 4.0128, + "us-west-2": 3.6096 + }, + "m7i.16xlarge": { + "ap-northeast-1": 5.7536, + "ap-northeast-2": 0.0, + "ap-south-1": 4.9808, + "ap-southeast-1": 6.0224, + "ap-southeast-2": 5.6192, + "ap-southeast-3": 5.6192, + "ap-southeast-5": 5.35712, + "ap-southeast-7": 0.0, + "ca-central-1": 5.1824, + "eu-central-1": 5.4512, + "eu-north-1": 5.0144, + "eu-south-2": 5.1824, + "eu-west-1": 5.1824, + "eu-west-2": 0.0, + "eu-west-3": 5.3504, + "mx-central-1": 4.97408, + "sa-east-1": 0.0, + "us-east-1": 4.8128, + "us-east-2": 4.8128, + "us-gov-east-1": 0.0, + "us-gov-west-1": 5.6528, + "us-west-1": 5.72672, + "us-west-2": 4.8128 + }, + "m7i.24xlarge": { + "ap-northeast-1": 8.6304, + "ap-northeast-2": 0.0, + "ap-south-1": 7.4712, + "ap-southeast-1": 8.4288, + "ap-southeast-2": 8.4288, + "ap-southeast-3": 8.4288, + "ap-southeast-5": 0.0, + "ap-southeast-7": 7.5216, + "ca-central-1": 7.7736, + "eu-central-1": 8.1768, + "eu-north-1": 7.5216, + "eu-south-2": 7.7736, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 8.0256, + "mx-central-1": 7.46112, + "sa-east-1": 10.092, + "us-east-1": 0.0, + "us-east-2": 7.2192, + "us-gov-east-1": 8.4792, + "us-gov-west-1": 0.0, + "us-west-1": 8.59008, + "us-west-2": 7.2192 + }, + "m7i.48xlarge": { + "ap-northeast-1": 16.3584, + "ap-northeast-2": 15.7536, + "ap-south-1": 14.04, + "ap-southeast-1": 15.9552, + "ap-southeast-2": 15.9552, + "ap-southeast-3": 15.9552, + "ap-southeast-5": 14.1408, + "ap-southeast-7": 14.1408, + "ca-central-1": 14.6448, + "eu-central-1": 15.4512, + "eu-north-1": 0.0, + "eu-south-2": 14.6448, + "eu-west-1": 14.6448, + "eu-west-2": 15.048, + "eu-west-3": 15.1488, + "mx-central-1": 14.01984, + "sa-east-1": 19.2816, + "us-east-1": 13.536, + "us-east-2": 13.536, + "us-gov-east-1": 16.056, + "us-gov-west-1": 16.056, + "us-west-1": 15.1488, + "us-west-2": 13.536 + }, + "m7i-flex.large": { + "ap-northeast-1": 0.18749, + "ap-northeast-2": 0.18151, + "ap-south-1": 0.16455, + "ap-southeast-1": 0.1835, + "ap-southeast-2": 0.1835, + "ap-southeast-3": 0.1835, + "ap-southeast-5": 0.16555, + "ca-central-1": 0.17053, + "eu-central-1": 0.17851, + "eu-north-1": 0.16555, + "eu-south-2": 0.17053, + "eu-west-1": 0.17053, + "eu-west-2": 0.17452, + "eu-west-3": 0.17552, + "sa-east-1": 0.21642, + "us-east-1": 0.15956, + "us-east-2": 0.15956, + "us-gov-east-1": 0.1845, + "us-gov-west-1": 0.1845, + "us-west-1": 0.17552, + "us-west-2": 0.15956 + }, + "m7i-flex.xlarge": { + "ap-northeast-1": 0.37498, + "ap-northeast-2": 0.36302, + "ap-south-1": 0.3291, + "ap-southeast-1": 0.367, + "ap-southeast-2": 0.367, + "ap-southeast-3": 0.367, + "ap-southeast-5": 0.33109, + "ca-central-1": 0.34106, + "eu-central-1": 0.35702, + "eu-north-1": 0.3311, + "eu-south-2": 0.34106, + "eu-west-1": 0.34106, + "eu-west-2": 0.34904, + "eu-west-3": 0.35104, + "sa-east-1": 0.43284, + "us-east-1": 0.31912, + "us-east-2": 0.31912, + "us-gov-east-1": 0.369, + "us-gov-west-1": 0.369, + "us-west-1": 0.35104, + "us-west-2": 0.31912 + }, + "m7i-flex.2xlarge": { + "ap-northeast-1": 0.74996, + "ap-northeast-2": 0.72604, + "ap-south-1": 0.6582, + "ap-southeast-1": 0.734, + "ap-southeast-2": 0.734, + "ap-southeast-3": 0.734, + "ap-southeast-5": 0.66218, + "ca-central-1": 0.68212, + "eu-central-1": 0.71404, + "eu-north-1": 0.6622, + "eu-south-2": 0.68212, + "eu-west-1": 0.68212, + "eu-west-2": 0.69808, + "eu-west-3": 0.70208, + "sa-east-1": 0.86568, + "us-east-1": 0.63824, + "us-east-2": 0.63824, + "us-gov-east-1": 0.738, + "us-gov-west-1": 0.738, + "us-west-1": 0.70208, + "us-west-2": 0.63824 + }, + "m7i-flex.4xlarge": { + "ap-northeast-1": 1.38632, + "ap-northeast-2": 1.33848, + "ap-south-1": 1.2028, + "ap-southeast-1": 1.3544, + "ap-southeast-2": 1.3544, + "ap-southeast-3": 1.3544, + "ap-southeast-5": 1.21076, + "ca-central-1": 1.25064, + "eu-central-1": 1.31448, + "eu-north-1": 1.2108, + "eu-south-2": 1.25064, + "eu-west-1": 1.25064, + "eu-west-2": 1.28256, + "eu-west-3": 1.29056, + "sa-east-1": 1.61776, + "us-east-1": 1.16288, + "us-east-2": 1.16288, + "us-gov-east-1": 1.3624, + "us-gov-west-1": 1.3624, + "us-west-1": 1.29056, + "us-west-2": 1.16288 + }, + "m7i-flex.8xlarge": { + "ap-northeast-1": 2.77264, + "ap-northeast-2": 2.67696, + "ap-south-1": 2.4056, + "ap-southeast-1": 2.7088, + "ap-southeast-2": 2.7088, + "ap-southeast-3": 2.7088, + "ap-southeast-5": 2.42152, + "ca-central-1": 2.50128, + "eu-central-1": 2.62896, + "eu-north-1": 2.4216, + "eu-south-2": 2.50128, + "eu-west-1": 2.50128, + "eu-west-2": 2.56512, + "eu-west-3": 2.58112, + "sa-east-1": 3.23552, + "us-east-1": 2.32576, + "us-east-2": 2.32576, + "us-gov-east-1": 2.7248, + "us-gov-west-1": 2.7248, + "us-west-1": 2.58112, + "us-west-2": 2.32576 + }, + "m7i-flex.12xlarge": { + "ap-northeast-1": 4.15896, + "ap-south-1": 3.6084, + "ap-southeast-1": 4.0632, + "ap-southeast-2": 4.0632, + "ap-southeast-5": 3.63228, + "ca-central-1": 3.75192, + "eu-central-1": 3.94344, + "eu-north-1": 3.6324, + "eu-south-2": 3.75192, + "eu-west-1": 3.75192, + "eu-west-3": 3.87168, + "sa-east-1": 4.85328, + "us-east-1": 3.48864, + "us-east-2": 3.48864, + "us-gov-east-1": 4.0872, + "us-gov-west-1": 4.0872, + "us-west-1": 3.87168, + "us-west-2": 3.48864 + }, + "m7i-flex.16xlarge": { + "ap-northeast-1": 5.54528, + "ap-south-1": 4.8112, + "ap-southeast-1": 5.4176, + "ap-southeast-2": 5.4176, + "ap-southeast-5": 4.84304, + "ca-central-1": 5.00256, + "eu-central-1": 5.25792, + "eu-north-1": 4.8432, + "eu-south-2": 5.00256, + "eu-west-1": 5.00256, + "eu-west-3": 5.16224, + "sa-east-1": 6.47104, + "us-east-1": 4.65152, + "us-east-2": 4.65152, + "us-gov-east-1": 5.4496, + "us-gov-west-1": 5.4496, + "us-west-1": 5.16224, + "us-west-2": 4.65152 + }, + "m8g.medium": { + "eu-central-1": 0.0, + "eu-north-1": 0.08436, + "eu-south-2": 0.08189, + "eu-west-2": 0.0838, + "us-east-1": 0.08127, + "us-east-2": 0.08127, + "us-west-2": 0.07678 + }, + "m8g.large": { + "eu-central-1": 0.17134, + "eu-north-1": 0.15918, + "eu-south-2": 0.17378, + "eu-west-2": 0.17798, + "us-east-1": 0.15356, + "us-east-2": 0.15356, + "us-west-2": 0.15356 + }, + "m8g.xlarge": { + "eu-central-1": 0.34268, + "eu-north-1": 0.0, + "eu-south-2": 0.32756, + "eu-west-2": 0.3352, + "us-east-1": 0.0, + "us-east-2": 0.32507, + "us-west-2": 0.30712 + }, + "m8g.metal-24xl": { + "eu-central-1": 7.54272, + "eu-north-1": 0.0, + "eu-south-2": 7.65974, + "eu-west-2": 7.3632, + "us-east-1": 7.12013, + "us-east-2": 6.68928, + "us-west-2": 6.68928 + }, + "m8g.metal-48xl": { + "eu-central-1": 14.18304, + "eu-north-1": 13.01568, + "eu-south-2": 13.45728, + "eu-west-2": 13.824, + "us-east-1": 12.47616, + "us-east-2": 12.47616, + "us-west-2": 12.47616 + }, + "m8g.2xlarge": { + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.65512, + "eu-west-2": 0.6704, + "us-east-1": 0.61424, + "us-east-2": 0.65014, + "us-west-2": 0.61424 + }, + "m8g.4xlarge": { + "eu-central-1": 1.25712, + "eu-north-1": 1.15984, + "eu-south-2": 1.19664, + "eu-west-2": 1.2272, + "us-east-1": 1.18669, + "us-east-2": 0.0, + "us-west-2": 1.11488 + }, + "m8g.8xlarge": { + "eu-central-1": 2.6863, + "eu-north-1": 2.31968, + "eu-south-2": 2.55325, + "eu-west-2": 2.4544, + "us-east-1": 2.22976, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "m8g.12xlarge": { + "eu-central-1": 3.77136, + "eu-north-1": 3.47952, + "eu-south-2": 3.58992, + "eu-west-2": 3.6816, + "us-east-1": 3.34464, + "us-east-2": 3.34464, + "us-west-2": 3.34464 + }, + "m8g.16xlarge": { + "eu-central-1": 5.37261, + "eu-north-1": 4.63936, + "eu-south-2": 4.78656, + "eu-west-2": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 4.45952 + }, + "m8g.24xlarge": { + "eu-central-1": 8.05891, + "eu-north-1": 6.95904, + "eu-south-2": 7.17984, + "eu-west-2": 0.0, + "us-east-1": 7.12013, + "us-east-2": 6.68928, + "us-west-2": 6.68928 + }, + "m8g.48xlarge": { + "eu-central-1": 14.18304, + "eu-north-1": 0.0, + "eu-south-2": 13.45728, + "eu-west-2": 0.0, + "us-east-1": 12.47616, + "us-east-2": 12.47616, + "us-west-2": 12.47616 + }, + "p2.xlarge": { + "ap-northeast-1": 1.824, + "ap-northeast-2": 0.0, + "ap-south-1": 1.846, + "ap-southeast-1": 1.846, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 1.1, + "us-east-1": 1.028, + "us-east-2": 1.028, + "us-gov-west-1": 0.0, + "us-west-2": 1.028 + }, + "p2.8xlarge": { + "ap-northeast-1": 13.13, + "ap-northeast-2": 13.686, + "ap-south-1": 0.0, + "ap-southeast-1": 14.538, + "ap-southeast-2": 13.13, + "eu-central-1": 0.0, + "eu-west-1": 8.57, + "us-east-1": 7.994, + "us-east-2": 7.994, + "us-gov-west-1": 10.298, + "us-west-2": 7.994 + }, + "p2.16xlarge": { + "ap-northeast-1": 26.259, + "ap-northeast-2": 25.027, + "ap-south-1": 29.075, + "ap-southeast-1": 29.075, + "ap-southeast-2": 26.259, + "eu-central-1": 22.803, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 18.867, + "us-west-2": 15.987 + }, + "p3.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.489, + "ap-southeast-1": 4.772, + "ap-southeast-2": 4.489, + "ca-central-1": 0.0, + "eu-central-1": 4.078, + "eu-west-1": 3.776, + "eu-west-2": 3.844, + "us-east-1": 3.315, + "us-east-2": 3.514, + "us-gov-west-1": 0.0, + "us-west-2": 3.514 + }, + "p3.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-southeast-1": 17.73, + "ap-southeast-2": 18.859, + "ca-central-1": 14.258, + "eu-central-1": 0.0, + "eu-west-1": 14.014, + "eu-west-2": 0.0, + "us-east-1": 13.034, + "us-east-2": 13.034, + "us-gov-west-1": 0.0, + "us-west-2": 13.829 + }, + "p3.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 35.459, + "ap-southeast-1": 35.459, + "ap-southeast-2": 35.459, + "ca-central-1": 28.515, + "eu-central-1": 0.0, + "eu-west-1": 28.027, + "eu-west-2": 30.299, + "us-east-1": 26.067, + "us-east-2": 26.067, + "us-gov-west-1": 30.963, + "us-west-2": 26.067 + }, + "p3dn.24xlarge": { + "ap-northeast-1": 45.164, + "eu-west-1": 36.092, + "us-east-1": 0.0, + "us-gov-east-1": 39.835, + "us-gov-west-1": 39.835, + "us-west-2": 33.593 + }, + "p4d.24xlarge": { + "ap-northeast-1": 51.795165, + "ap-northeast-2": 52.308128, + "ap-south-1": 41.7008, + "ap-southeast-1": 41.7079, + "ap-southeast-2": 44.98518, + "ca-central-1": 40.0708, + "eu-central-1": 43.32555, + "eu-west-1": 37.77735, + "sa-east-1": 0.0, + "us-east-1": 35.1534, + "us-east-2": 35.1534, + "us-gov-west-1": 41.7108, + "us-west-2": 0.0 + }, + "p4de.24xlarge": { + "ap-southeast-1": 51.5398, + "eu-central-1": 53.5881, + "il-central-1": 55.47552, + "us-east-1": 43.34655, + "us-west-2": 47.443125 + }, + "p5.48xlarge": { + "ap-northeast-1": 127.05416, + "ap-south-1": 121.8432, + "ap-southeast-2": 131.6752, + "ca-central-1": 116.9272, + "eu-north-1": 109.0616, + "eu-west-2": 131.6752, + "sa-east-1": 169.0368, + "us-east-1": 102.1792, + "us-east-2": 102.1792, + "us-gov-west-1": 121.8432, + "us-west-1": 126.7592, + "us-west-2": 3.8592 + }, + "p5e.48xlarge": { + "us-east-2": 3.8592 + }, + "p5en.48xlarge": { + "ap-northeast-1": 109.8592, + "ap-northeast-2": 3.8592, + "ap-south-1": 105.6192, + "eu-south-2": 3.8592, + "us-east-2": 88.6592, + "us-west-2": 88.6592 + }, + "r3.large": { + "ap-northeast-1": 0.264, + "ap-northeast-2": 0.284, + "ap-south-1": 0.0, + "ap-southeast-1": 0.264, + "ap-southeast-2": 0.264, + "eu-central-1": 0.0, + "eu-west-1": 0.267, + "sa-east-1": 0.0, + "us-east-1": 0.23, + "us-east-2": 0.23, + "us-gov-west-1": 0.264, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "r3.xlarge": { + "ap-northeast-1": 0.528, + "ap-northeast-2": 0.528, + "ap-south-1": 0.546, + "ap-southeast-1": 0.528, + "ap-southeast-2": 0.528, + "eu-central-1": 0.568, + "eu-west-1": 0.498, + "sa-east-1": 0.898, + "us-east-1": 0.493, + "us-east-2": 0.493, + "us-gov-west-1": 0.0, + "us-west-1": 0.535, + "us-west-2": 0.493 + }, + "r3.2xlarge": { + "ap-northeast-1": 1.055, + "ap-northeast-2": 1.055, + "ap-south-1": 0.0, + "ap-southeast-1": 1.055, + "ap-southeast-2": 1.055, + "eu-central-1": 1.055, + "eu-west-1": 0.0, + "sa-east-1": 1.795, + "us-east-1": 0.919, + "us-east-2": 0.919, + "us-gov-west-1": 0.0, + "us-west-1": 1.069, + "us-west-2": 0.986 + }, + "r3.4xlarge": { + "ap-northeast-1": 1.997, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 1.997, + "ap-southeast-2": 0.0, + "eu-central-1": 2.157, + "eu-west-1": 1.877, + "sa-east-1": 3.197, + "us-east-1": 0.0, + "us-east-2": 1.858, + "us-gov-west-1": 1.997, + "us-west-1": 1.877, + "us-west-2": 1.725 + }, + "r3.8xlarge": { + "ap-northeast-1": 3.994, + "ap-northeast-2": 3.994, + "ap-south-1": 3.834, + "ap-southeast-1": 3.994, + "ap-southeast-2": 0.0, + "eu-central-1": 3.994, + "eu-west-1": 3.754, + "sa-east-1": 6.394, + "us-east-1": 0.0, + "us-east-2": 3.45, + "us-gov-west-1": 3.994, + "us-west-1": 3.754, + "us-west-2": 0.0 + }, + "r4.large": { + "ap-northeast-1": 0.2398, + "ap-northeast-2": 0.2238, + "ap-northeast-3": 0.2238, + "ap-south-1": 0.2008, + "ap-southeast-1": 0.2238, + "ap-southeast-2": 0.2238, + "ca-central-1": 0.0, + "eu-central-1": 0.2238, + "eu-west-1": 0.2266, + "eu-west-2": 0.0, + "eu-west-3": 0.2198, + "sa-east-1": 0.3438, + "us-east-1": 0.1968, + "us-east-2": 0.1968, + "us-gov-west-1": 0.2238, + "us-west-1": 0.0, + "us-west-2": 0.1968 + }, + "r4.xlarge": { + "ap-northeast-1": 0.4476, + "ap-northeast-2": 0.4476, + "ap-northeast-3": 0.4476, + "ap-south-1": 0.4016, + "ap-southeast-1": 0.4476, + "ap-southeast-2": 0.4476, + "ca-central-1": 0.4488, + "eu-central-1": 0.0, + "eu-west-1": 0.4236, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 0.6876, + "us-east-1": 0.3936, + "us-east-2": 0.3936, + "us-gov-west-1": 0.4476, + "us-west-1": 0.4236, + "us-west-2": 0.3936 + }, + "r4.2xlarge": { + "ap-northeast-1": 0.8952, + "ap-northeast-2": 0.8952, + "ap-northeast-3": 0.0, + "ap-south-1": 0.8032, + "ap-southeast-1": 0.8952, + "ap-southeast-2": 0.9592, + "ca-central-1": 0.8976, + "eu-central-1": 0.8952, + "eu-west-1": 0.8472, + "eu-west-2": 0.9416, + "eu-west-3": 0.8792, + "sa-east-1": 1.3752, + "us-east-1": 0.7872, + "us-east-2": 0.7872, + "us-gov-west-1": 0.8952, + "us-west-1": 0.8472, + "us-west-2": 0.8404 + }, + "r4.4xlarge": { + "ap-northeast-1": 1.6768, + "ap-northeast-2": 1.6768, + "ap-northeast-3": 1.6768, + "ap-south-1": 1.4928, + "ap-southeast-1": 1.6768, + "ap-southeast-2": 1.6768, + "ca-central-1": 1.5648, + "eu-central-1": 0.0, + "eu-west-1": 1.5808, + "eu-west-2": 1.6448, + "eu-west-3": 1.7696, + "sa-east-1": 2.6368, + "us-east-1": 1.4608, + "us-east-2": 1.4608, + "us-gov-west-1": 0.0, + "us-west-1": 1.6992, + "us-west-2": 1.5672 + }, + "r4.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.3536, + "ap-northeast-3": 3.3536, + "ap-south-1": 2.9856, + "ap-southeast-1": 3.3536, + "ap-southeast-2": 3.3536, + "ca-central-1": 3.3632, + "eu-central-1": 3.3536, + "eu-west-1": 3.1616, + "eu-west-2": 3.5392, + "eu-west-3": 3.5392, + "sa-east-1": 5.7216, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 3.6096, + "us-west-1": 3.1616, + "us-west-2": 2.9216 + }, + "r4.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 6.7072, + "ap-northeast-3": 6.7072, + "ap-south-1": 5.9712, + "ap-southeast-1": 6.7072, + "ap-southeast-2": 6.7072, + "ca-central-1": 6.2592, + "eu-central-1": 6.7072, + "eu-west-1": 6.3232, + "eu-west-2": 6.5792, + "eu-west-3": 6.5792, + "sa-east-1": 10.5472, + "us-east-1": 5.8432, + "us-east-2": 5.8432, + "us-gov-west-1": 6.7072, + "us-west-1": 6.3232, + "us-west-2": 5.8432 + }, + "r5.large": { + "af-south-1": 0.232, + "ap-east-1": 0.0, + "ap-northeast-1": 0.216, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.216, + "ap-south-1": 0.194, + "ap-south-2": 0.194, + "ap-southeast-1": 0.216, + "ap-southeast-2": 0.215, + "ap-southeast-3": 0.225, + "ap-southeast-4": 0.215, + "ca-central-1": 0.0, + "ca-west-1": 0.202, + "eu-central-1": 0.216, + "eu-central-2": 0.0, + "eu-north-1": 0.206, + "eu-south-1": 0.0, + "eu-south-2": 0.205, + "eu-west-1": 0.213, + "eu-west-2": 0.212, + "eu-west-3": 0.212, + "il-central-1": 0.212, + "me-central-1": 0.219, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.19, + "us-gov-east-1": 0.215, + "us-gov-west-1": 0.0, + "us-west-1": 0.212, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0 + }, + "r5.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.482, + "ap-northeast-1": 0.432, + "ap-northeast-2": 0.432, + "ap-northeast-3": 0.45, + "ap-south-1": 0.0, + "ap-south-2": 0.388, + "ap-southeast-1": 0.432, + "ap-southeast-2": 0.43, + "ap-southeast-3": 0.432, + "ap-southeast-4": 0.43, + "ca-central-1": 0.0, + "ca-west-1": 0.404, + "eu-central-1": 0.432, + "eu-central-2": 0.0, + "eu-north-1": 0.396, + "eu-south-1": 0.424, + "eu-south-2": 0.427, + "eu-west-1": 0.41, + "eu-west-2": 0.424, + "eu-west-3": 0.424, + "il-central-1": 0.424, + "me-central-1": 0.438, + "me-south-1": 0.438, + "sa-east-1": 0.53, + "us-east-1": 0.38, + "us-east-2": 0.395, + "us-gov-east-1": 0.43, + "us-gov-west-1": 0.43, + "us-west-1": 0.424, + "us-west-2": 0.395, + "us-west-2-lax-1": 0.448 + }, + "r5.metal": { + "af-south-1": 0.0, + "ap-east-1": 10.397, + "ap-northeast-1": 9.677, + "ap-northeast-2": 9.677, + "ap-northeast-3": 9.677, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 9.677, + "ap-southeast-2": 9.629, + "ap-southeast-3": 0.0, + "ap-southeast-4": 9.629, + "ca-central-1": 9.005, + "ca-west-1": 9.005, + "eu-central-1": 9.677, + "eu-central-2": 0.0, + "eu-north-1": 8.813, + "eu-south-1": 9.485, + "eu-south-2": 9.149, + "eu-west-1": 0.0, + "eu-west-2": 9.485, + "eu-west-3": 9.485, + "il-central-1": 9.487, + "me-central-1": 9.826, + "me-south-1": 9.826, + "sa-east-1": 12.029, + "us-east-1": 8.429, + "us-east-2": 8.429, + "us-gov-east-1": 9.629, + "us-gov-west-1": 0.0, + "us-west-1": 9.101, + "us-west-2": 0.0, + "us-west-2-lax-1": 9.638 + }, + "r5.2xlarge": { + "af-south-1": 0.927, + "ap-east-1": 0.923, + "ap-northeast-1": 0.863, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.863, + "ap-south-1": 0.806, + "ap-south-2": 0.0, + "ap-southeast-1": 0.863, + "ap-southeast-2": 0.859, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.859, + "ca-central-1": 0.807, + "ca-west-1": 0.807, + "eu-central-1": 0.863, + "eu-central-2": 0.924, + "eu-north-1": 0.823, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.819, + "eu-west-2": 0.847, + "eu-west-3": 0.847, + "il-central-1": 0.847, + "me-central-1": 0.876, + "me-south-1": 0.876, + "sa-east-1": 1.059, + "us-east-1": 0.759, + "us-east-2": 0.0, + "us-gov-east-1": 0.859, + "us-gov-west-1": 0.859, + "us-west-1": 0.815, + "us-west-2": 0.759, + "us-west-2-lax-1": 0.86 + }, + "r5.4xlarge": { + "af-south-1": 1.741, + "ap-east-1": 1.813, + "ap-northeast-1": 1.613, + "ap-northeast-2": 1.613, + "ap-northeast-3": 0.0, + "ap-south-1": 1.437, + "ap-south-2": 0.0, + "ap-southeast-1": 1.613, + "ap-southeast-2": 1.605, + "ap-southeast-3": 1.613, + "ap-southeast-4": 0.0, + "ca-central-1": 1.501, + "ca-west-1": 1.501, + "eu-central-1": 0.0, + "eu-central-2": 1.734, + "eu-north-1": 1.469, + "eu-south-1": 1.581, + "eu-south-2": 1.525, + "eu-west-1": 1.525, + "eu-west-2": 1.581, + "eu-west-3": 1.581, + "il-central-1": 0.0, + "me-central-1": 1.638, + "me-south-1": 1.712, + "sa-east-1": 0.0, + "us-east-1": 1.405, + "us-east-2": 0.0, + "us-gov-east-1": 1.677, + "us-gov-west-1": 1.605, + "us-west-1": 1.517, + "us-west-2": 0.0, + "us-west-2-lax-1": 1.606 + }, + "r5.8xlarge": { + "af-south-1": 3.482, + "ap-east-1": 3.466, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.226, + "ap-northeast-3": 3.226, + "ap-south-1": 2.998, + "ap-south-2": 2.874, + "ap-southeast-1": 3.226, + "ap-southeast-2": 3.21, + "ap-southeast-3": 3.226, + "ap-southeast-4": 3.21, + "ca-central-1": 3.002, + "ca-west-1": 0.0, + "eu-central-1": 3.226, + "eu-central-2": 3.629, + "eu-north-1": 2.938, + "eu-south-1": 3.162, + "eu-south-2": 3.05, + "eu-west-1": 3.185, + "eu-west-2": 0.0, + "eu-west-3": 3.162, + "il-central-1": 0.0, + "me-central-1": 3.424, + "me-south-1": 3.275, + "sa-east-1": 4.01, + "us-east-1": 0.0, + "us-east-2": 2.931, + "us-gov-east-1": 3.21, + "us-gov-west-1": 3.21, + "us-west-1": 3.034, + "us-west-2": 2.81, + "us-west-2-lax-1": 3.213 + }, + "r5.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 5.439, + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.838, + "ap-northeast-3": 4.838, + "ap-south-1": 0.0, + "ap-south-2": 4.497, + "ap-southeast-1": 4.838, + "ap-southeast-2": 5.032, + "ap-southeast-3": 4.838, + "ap-southeast-4": 5.032, + "ca-central-1": 4.502, + "ca-west-1": 4.502, + "eu-central-1": 4.838, + "eu-central-2": 0.0, + "eu-north-1": 4.406, + "eu-south-1": 4.742, + "eu-south-2": 4.574, + "eu-west-1": 4.574, + "eu-west-2": 4.742, + "eu-west-3": 4.742, + "il-central-1": 4.744, + "me-central-1": 4.913, + "me-south-1": 4.913, + "sa-east-1": 6.014, + "us-east-1": 0.0, + "us-east-2": 4.214, + "us-gov-east-1": 4.814, + "us-gov-west-1": 4.814, + "us-west-1": 4.55, + "us-west-2": 4.214, + "us-west-2-lax-1": 4.819 + }, + "r5.16xlarge": { + "af-south-1": 7.286, + "ap-east-1": 6.931, + "ap-northeast-1": 6.451, + "ap-northeast-2": 6.451, + "ap-northeast-3": 6.451, + "ap-south-1": 5.996, + "ap-south-2": 0.0, + "ap-southeast-1": 6.451, + "ap-southeast-2": 6.419, + "ap-southeast-3": 6.743, + "ap-southeast-4": 6.419, + "ca-central-1": 6.003, + "ca-west-1": 6.003, + "eu-central-1": 6.451, + "eu-central-2": 6.938, + "eu-north-1": 5.875, + "eu-south-1": 6.323, + "eu-south-2": 6.099, + "eu-west-1": 6.37, + "eu-west-2": 0.0, + "eu-west-3": 6.323, + "il-central-1": 6.609, + "me-central-1": 6.55, + "me-south-1": 6.55, + "sa-east-1": 8.019, + "us-east-1": 5.619, + "us-east-2": 5.619, + "us-gov-east-1": 6.419, + "us-gov-west-1": 6.709, + "us-west-1": 0.0, + "us-west-2": 5.619, + "us-west-2-lax-1": 6.426 + }, + "r5.24xlarge": { + "af-south-1": 10.445, + "ap-east-1": 10.397, + "ap-northeast-1": 0.0, + "ap-northeast-2": 9.677, + "ap-northeast-3": 9.677, + "ap-south-1": 8.621, + "ap-south-2": 8.621, + "ap-southeast-1": 9.677, + "ap-southeast-2": 9.629, + "ap-southeast-3": 9.677, + "ap-southeast-4": 9.629, + "ca-central-1": 9.005, + "ca-west-1": 9.005, + "eu-central-1": 9.677, + "eu-central-2": 10.406, + "eu-north-1": 8.813, + "eu-south-1": 9.485, + "eu-south-2": 0.0, + "eu-west-1": 9.149, + "eu-west-2": 9.485, + "eu-west-3": 0.0, + "il-central-1": 9.487, + "me-central-1": 9.826, + "me-south-1": 9.826, + "sa-east-1": 12.029, + "us-east-1": 8.429, + "us-east-2": 8.429, + "us-gov-east-1": 9.629, + "us-gov-west-1": 9.629, + "us-west-1": 9.101, + "us-west-2": 8.429, + "us-west-2-lax-1": 0.0 + }, + "r5a.large": { + "ap-northeast-1": 0.201, + "ap-northeast-2": 0.2, + "ap-south-1": 0.135, + "ap-southeast-1": 0.2, + "ap-southeast-2": 0.2, + "ca-central-1": 0.188, + "eu-central-1": 0.201, + "eu-south-1": 0.197, + "eu-west-1": 0.191, + "eu-west-2": 0.197, + "eu-west-3": 0.197, + "sa-east-1": 0.245, + "us-east-1": 0.177, + "us-east-2": 0.177, + "us-gov-east-1": 0.2, + "us-gov-west-1": 0.2, + "us-west-1": 0.19, + "us-west-2": 0.177 + }, + "r5a.xlarge": { + "ap-northeast-1": 0.402, + "ap-northeast-2": 0.4, + "ap-south-1": 0.271, + "ap-southeast-1": 0.4, + "ap-southeast-2": 0.4, + "ca-central-1": 0.376, + "eu-central-1": 0.402, + "eu-south-1": 0.394, + "eu-west-1": 0.382, + "eu-west-2": 0.394, + "eu-west-3": 0.394, + "sa-east-1": 0.49, + "us-east-1": 0.354, + "us-east-2": 0.354, + "us-gov-east-1": 0.4, + "us-gov-west-1": 0.4, + "us-west-1": 0.38, + "us-west-2": 0.354 + }, + "r5a.2xlarge": { + "ap-northeast-1": 0.803, + "ap-northeast-2": 0.799, + "ap-south-1": 0.541, + "ap-southeast-1": 0.799, + "ap-southeast-2": 0.799, + "ca-central-1": 0.751, + "eu-central-1": 0.803, + "eu-south-1": 0.787, + "eu-west-1": 0.763, + "eu-west-2": 0.787, + "eu-west-3": 0.787, + "sa-east-1": 0.979, + "us-east-1": 0.707, + "us-east-2": 0.707, + "us-gov-east-1": 0.799, + "us-gov-west-1": 0.799, + "us-west-1": 0.759, + "us-west-2": 0.707 + }, + "r5a.4xlarge": { + "ap-northeast-1": 1.493, + "ap-northeast-2": 1.485, + "ap-south-1": 0.969, + "ap-southeast-1": 1.485, + "ap-southeast-2": 1.485, + "ca-central-1": 1.389, + "eu-central-1": 1.493, + "eu-south-1": 1.461, + "eu-west-1": 1.413, + "eu-west-2": 1.461, + "eu-west-3": 1.461, + "sa-east-1": 1.845, + "us-east-1": 1.301, + "us-east-2": 1.301, + "us-gov-east-1": 1.485, + "us-gov-west-1": 1.485, + "us-west-1": 1.405, + "us-west-2": 1.301 + }, + "r5a.8xlarge": { + "ap-northeast-1": 2.986, + "ap-northeast-2": 2.97, + "ap-south-1": 1.938, + "ap-southeast-1": 2.97, + "ap-southeast-2": 2.97, + "ca-central-1": 2.778, + "eu-central-1": 2.986, + "eu-south-1": 2.922, + "eu-west-1": 2.826, + "eu-west-2": 2.922, + "eu-west-3": 2.922, + "sa-east-1": 3.69, + "us-east-1": 2.602, + "us-east-2": 2.602, + "us-gov-east-1": 2.97, + "us-gov-west-1": 2.97, + "us-west-1": 2.81, + "us-west-2": 2.602 + }, + "r5a.12xlarge": { + "ap-northeast-1": 4.478, + "ap-northeast-2": 4.454, + "ap-south-1": 2.906, + "ap-southeast-1": 4.454, + "ap-southeast-2": 4.454, + "ca-central-1": 4.166, + "eu-central-1": 4.478, + "eu-south-1": 4.382, + "eu-west-1": 4.238, + "eu-west-2": 4.382, + "eu-west-3": 4.382, + "sa-east-1": 5.534, + "us-east-1": 3.902, + "us-east-2": 3.902, + "us-gov-east-1": 4.454, + "us-gov-west-1": 4.454, + "us-west-1": 4.214, + "us-west-2": 3.902 + }, + "r5a.16xlarge": { + "ap-northeast-1": 5.971, + "ap-northeast-2": 5.939, + "ap-south-1": 3.875, + "ap-southeast-1": 5.939, + "ap-southeast-2": 5.939, + "ca-central-1": 5.555, + "eu-central-1": 5.971, + "eu-south-1": 5.843, + "eu-west-1": 5.651, + "eu-west-2": 5.843, + "eu-west-3": 5.843, + "sa-east-1": 7.379, + "us-east-1": 5.203, + "us-east-2": 5.203, + "us-gov-east-1": 5.939, + "us-gov-west-1": 5.939, + "us-west-1": 5.619, + "us-west-2": 5.203 + }, + "r5a.24xlarge": { + "ap-northeast-1": 8.957, + "ap-northeast-2": 8.909, + "ap-south-1": 5.813, + "ap-southeast-1": 8.909, + "ap-southeast-2": 8.909, + "ca-central-1": 8.333, + "eu-central-1": 8.957, + "eu-south-1": 8.765, + "eu-west-1": 8.477, + "eu-west-2": 8.765, + "eu-west-3": 8.765, + "sa-east-1": 11.069, + "us-east-1": 7.805, + "us-east-2": 7.805, + "us-gov-east-1": 8.909, + "us-gov-west-1": 8.909, + "us-west-1": 8.429, + "us-west-2": 7.805 + }, + "r5ad.large": { + "ap-northeast-1": 0.223, + "ap-northeast-2": 0.222, + "ap-south-1": 0.147, + "ap-southeast-1": 0.223, + "ap-southeast-2": 0.223, + "ca-central-1": 0.208, + "eu-central-1": 0.222, + "eu-west-1": 0.21, + "eu-west-2": 0.218, + "eu-west-3": 0.217, + "sa-east-1": 0.272, + "us-east-1": 0.195, + "us-east-2": 0.195, + "us-gov-west-1": 0.222, + "us-west-1": 0.212, + "us-west-2": 0.195 + }, + "r5ad.xlarge": { + "ap-northeast-1": 0.446, + "ap-northeast-2": 0.444, + "ap-south-1": 0.294, + "ap-southeast-1": 0.446, + "ap-southeast-2": 0.446, + "ca-central-1": 0.416, + "eu-central-1": 0.444, + "eu-west-1": 0.42, + "eu-west-2": 0.436, + "eu-west-3": 0.434, + "sa-east-1": 0.544, + "us-east-1": 0.39, + "us-east-2": 0.39, + "us-gov-west-1": 0.444, + "us-west-1": 0.424, + "us-west-2": 0.39 + }, + "r5ad.2xlarge": { + "ap-northeast-1": 0.891, + "ap-northeast-2": 0.887, + "ap-south-1": 0.587, + "ap-southeast-1": 0.891, + "ap-southeast-2": 0.891, + "ca-central-1": 0.831, + "eu-central-1": 0.887, + "eu-west-1": 0.839, + "eu-west-2": 0.871, + "eu-west-3": 0.867, + "sa-east-1": 1.087, + "us-east-1": 0.779, + "us-east-2": 0.779, + "us-gov-west-1": 0.887, + "us-west-1": 0.847, + "us-west-2": 0.779 + }, + "r5ad.4xlarge": { + "ap-northeast-1": 1.669, + "ap-northeast-2": 1.661, + "ap-south-1": 1.061, + "ap-southeast-1": 1.669, + "ap-southeast-2": 1.669, + "ca-central-1": 1.549, + "eu-central-1": 1.661, + "eu-west-1": 1.565, + "eu-west-2": 1.629, + "eu-west-3": 1.621, + "sa-east-1": 2.061, + "us-east-1": 1.445, + "us-east-2": 1.445, + "us-gov-west-1": 1.661, + "us-west-1": 1.581, + "us-west-2": 1.445 + }, + "r5ad.8xlarge": { + "ap-northeast-1": 3.338, + "ap-northeast-2": 3.322, + "ap-south-1": 2.122, + "ap-southeast-1": 3.338, + "ap-southeast-2": 3.338, + "ca-central-1": 3.098, + "eu-central-1": 3.322, + "eu-west-1": 3.13, + "eu-west-2": 3.258, + "eu-west-3": 3.242, + "sa-east-1": 4.122, + "us-east-1": 2.89, + "us-east-2": 2.89, + "us-gov-west-1": 3.322, + "us-west-1": 3.162, + "us-west-2": 2.89 + }, + "r5ad.12xlarge": { + "ap-northeast-1": 5.006, + "ap-northeast-2": 4.982, + "ap-south-1": 3.184, + "ap-southeast-1": 5.006, + "ap-southeast-2": 5.006, + "ca-central-1": 4.646, + "eu-central-1": 4.982, + "eu-west-1": 4.694, + "eu-west-2": 4.886, + "eu-west-3": 4.862, + "sa-east-1": 6.182, + "us-east-1": 4.334, + "us-east-2": 4.334, + "us-gov-west-1": 4.982, + "us-west-1": 4.742, + "us-west-2": 4.334 + }, + "r5ad.16xlarge": { + "ap-northeast-1": 6.675, + "ap-northeast-2": 6.643, + "ap-south-1": 4.245, + "ap-southeast-1": 6.675, + "ap-southeast-2": 6.675, + "ca-central-1": 6.195, + "eu-central-1": 6.643, + "eu-west-1": 6.259, + "eu-west-2": 6.515, + "eu-west-3": 6.483, + "sa-east-1": 8.243, + "us-east-1": 5.779, + "us-east-2": 5.779, + "us-gov-west-1": 6.643, + "us-west-1": 6.323, + "us-west-2": 5.779 + }, + "r5ad.24xlarge": { + "ap-northeast-1": 10.013, + "ap-northeast-2": 9.965, + "ap-south-1": 6.367, + "ap-southeast-1": 10.013, + "ap-southeast-2": 10.013, + "ca-central-1": 9.293, + "eu-central-1": 9.965, + "eu-west-1": 9.389, + "eu-west-2": 9.773, + "eu-west-3": 9.725, + "sa-east-1": 12.365, + "us-east-1": 8.669, + "us-east-2": 8.669, + "us-gov-west-1": 9.965, + "us-west-1": 9.485, + "us-west-2": 8.669 + }, + "r5b.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.2418, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.2448, + "ca-central-1": 0.2431, + "eu-central-1": 0.2418, + "eu-north-1": 0.22174, + "eu-south-1": 0.2388, + "eu-west-1": 0.2308, + "eu-west-2": 0.0, + "sa-east-1": 0.3008, + "us-east-1": 0.2128, + "us-east-2": 0.0, + "us-west-2": 0.2128 + }, + "r5b.xlarge": { + "ap-northeast-1": 0.5258, + "ap-northeast-2": 0.4836, + "ap-southeast-1": 0.5192, + "ap-southeast-2": 0.4896, + "ca-central-1": 0.4536, + "eu-central-1": 0.0, + "eu-north-1": 0.44348, + "eu-south-1": 0.4776, + "eu-west-1": 0.0, + "eu-west-2": 0.4776, + "sa-east-1": 0.0, + "us-east-1": 0.4256, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "r5b.metal": { + "ap-northeast-1": 11.9376, + "ap-northeast-2": 11.7792, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 10.2048, + "eu-central-1": 10.9248, + "eu-north-1": 9.96192, + "eu-south-1": 10.7808, + "eu-west-1": 10.3968, + "eu-west-2": 0.0, + "sa-east-1": 13.7568, + "us-east-1": 9.5328, + "us-east-2": 10.248, + "us-west-2": 9.5328 + }, + "r5b.2xlarge": { + "ap-northeast-1": 0.9792, + "ap-northeast-2": 0.9672, + "ap-southeast-1": 0.9672, + "ap-southeast-2": 0.9792, + "ca-central-1": 0.9724, + "eu-central-1": 0.9672, + "eu-north-1": 0.88696, + "eu-south-1": 0.9552, + "eu-west-1": 0.0, + "eu-west-2": 1.0252, + "sa-east-1": 0.0, + "us-east-1": 0.8512, + "us-east-2": 0.8512, + "us-west-2": 0.8512 + }, + "r5b.4xlarge": { + "ap-northeast-1": 1.8448, + "ap-northeast-2": 1.8208, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 1.8312, + "eu-central-1": 1.8208, + "eu-north-1": 1.66032, + "eu-south-1": 1.9368, + "eu-west-1": 1.7328, + "eu-west-2": 1.7968, + "sa-east-1": 2.2928, + "us-east-1": 1.5888, + "us-east-2": 0.0, + "us-west-2": 1.5888 + }, + "r5b.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-southeast-1": 3.9264, + "ap-southeast-2": 3.6896, + "ca-central-1": 3.4016, + "eu-central-1": 3.6416, + "eu-north-1": 0.0, + "eu-south-1": 3.5936, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "sa-east-1": 4.5856, + "us-east-1": 3.416, + "us-east-2": 3.1776, + "us-west-2": 3.1776 + }, + "r5b.12xlarge": { + "ap-northeast-1": 5.5344, + "ap-northeast-2": 5.4624, + "ap-southeast-1": 5.4624, + "ap-southeast-2": 5.9688, + "ca-central-1": 5.1024, + "eu-central-1": 5.4624, + "eu-north-1": 4.98096, + "eu-south-1": 5.8104, + "eu-west-1": 5.5992, + "eu-west-2": 5.3904, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 4.7664, + "us-west-2": 0.0 + }, + "r5b.16xlarge": { + "ap-northeast-1": 7.3792, + "ap-northeast-2": 0.0, + "ap-southeast-1": 7.8528, + "ap-southeast-2": 7.3792, + "ca-central-1": 6.8032, + "eu-central-1": 7.8528, + "eu-north-1": 6.64128, + "eu-south-1": 7.1872, + "eu-west-1": 7.4656, + "eu-west-2": 7.1872, + "sa-east-1": 9.9296, + "us-east-1": 6.832, + "us-east-2": 6.832, + "us-west-2": 6.3552 + }, + "r5b.24xlarge": { + "ap-northeast-1": 11.0688, + "ap-northeast-2": 11.7792, + "ap-southeast-1": 0.0, + "ap-southeast-2": 11.9376, + "ca-central-1": 0.0, + "eu-central-1": 10.9248, + "eu-north-1": 9.96192, + "eu-south-1": 10.7808, + "eu-west-1": 11.1984, + "eu-west-2": 10.7808, + "sa-east-1": 13.7568, + "us-east-1": 0.0, + "us-east-2": 10.248, + "us-west-2": 10.248 + }, + "r5d.large": { + "af-south-1": 0.254, + "ap-east-1": 0.239, + "ap-northeast-1": 0.248, + "ap-northeast-2": 0.237, + "ap-northeast-3": 0.238, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.238, + "ap-southeast-2": 0.248, + "ap-southeast-3": 0.238, + "ap-southeast-4": 0.0, + "ca-central-1": 0.222, + "eu-central-1": 0.237, + "eu-central-2": 0.254, + "eu-north-1": 0.216, + "eu-south-1": 0.242, + "eu-south-2": 0.224, + "eu-west-1": 0.224, + "eu-west-2": 0.233, + "eu-west-3": 0.233, + "il-central-1": 0.242, + "me-central-1": 0.25, + "me-south-1": 0.24, + "sa-east-1": 0.292, + "us-east-1": 0.208, + "us-east-2": 0.216, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.247, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.237 + }, + "r5d.xlarge": { + "af-south-1": 0.508, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.474, + "ap-northeast-3": 0.496, + "ap-south-1": 0.448, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.476, + "ap-southeast-3": 0.496, + "ap-southeast-4": 0.496, + "ca-central-1": 0.444, + "eu-central-1": 0.474, + "eu-central-2": 0.531, + "eu-north-1": 0.432, + "eu-south-1": 0.464, + "eu-south-2": 0.448, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.466, + "il-central-1": 0.464, + "me-central-1": 0.48, + "me-south-1": 0.501, + "sa-east-1": 0.584, + "us-east-1": 0.0, + "us-east-2": 0.416, + "us-gov-east-1": 0.474, + "us-gov-west-1": 0.474, + "us-west-1": 0.0, + "us-west-2": 0.433, + "us-west-2-lax-1": 0.473 + }, + "r5d.metal": { + "af-south-1": 0.0, + "ap-east-1": 10.781, + "ap-northeast-1": 10.733, + "ap-northeast-2": 10.685, + "ap-northeast-3": 10.733, + "ap-south-1": 9.629, + "ap-south-2": 9.629, + "ap-southeast-1": 10.733, + "ap-southeast-2": 10.733, + "ap-southeast-3": 10.733, + "ap-southeast-4": 10.733, + "ca-central-1": 0.0, + "eu-central-1": 10.685, + "eu-central-2": 11.515, + "eu-north-1": 0.0, + "eu-south-1": 10.445, + "eu-south-2": 0.0, + "eu-west-1": 10.061, + "eu-west-2": 10.493, + "eu-west-3": 10.493, + "il-central-1": 10.445, + "me-central-1": 10.829, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 9.293, + "us-east-2": 9.293, + "us-gov-east-1": 10.685, + "us-gov-west-1": 10.685, + "us-west-1": 10.157, + "us-west-2": 9.293, + "us-west-2-lax-1": 10.675 + }, + "r5d.2xlarge": { + "af-south-1": 1.015, + "ap-east-1": 0.955, + "ap-northeast-1": 0.951, + "ap-northeast-2": 0.989, + "ap-northeast-3": 0.951, + "ap-south-1": 0.859, + "ap-south-2": 0.859, + "ap-southeast-1": 0.951, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.951, + "ap-southeast-4": 0.951, + "ca-central-1": 0.887, + "eu-central-1": 0.989, + "eu-central-2": 0.0, + "eu-north-1": 0.863, + "eu-south-1": 0.927, + "eu-south-2": 0.0, + "eu-west-1": 0.934, + "eu-west-2": 0.931, + "eu-west-3": 0.931, + "il-central-1": 0.968, + "me-central-1": 0.959, + "me-south-1": 0.959, + "sa-east-1": 1.167, + "us-east-1": 0.866, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.947, + "us-west-1": 0.903, + "us-west-2": 0.831, + "us-west-2-lax-1": 0.946 + }, + "r5d.4xlarge": { + "af-south-1": 1.917, + "ap-east-1": 1.797, + "ap-northeast-1": 1.789, + "ap-northeast-2": 1.864, + "ap-northeast-3": 1.789, + "ap-south-1": 1.605, + "ap-south-2": 1.605, + "ap-southeast-1": 1.872, + "ap-southeast-2": 1.872, + "ap-southeast-3": 0.0, + "ap-southeast-4": 1.789, + "ca-central-1": 0.0, + "eu-central-1": 1.781, + "eu-central-2": 1.919, + "eu-north-1": 1.686, + "eu-south-1": 1.741, + "eu-south-2": 1.754, + "eu-west-1": 1.677, + "eu-west-2": 1.749, + "eu-west-3": 1.83, + "il-central-1": 1.741, + "me-central-1": 1.805, + "me-south-1": 1.889, + "sa-east-1": 2.221, + "us-east-1": 1.549, + "us-east-2": 1.549, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.781, + "us-west-1": 1.693, + "us-west-2": 1.549, + "us-west-2-lax-1": 1.862 + }, + "r5d.8xlarge": { + "af-south-1": 3.834, + "ap-east-1": 3.594, + "ap-northeast-1": 3.578, + "ap-northeast-2": 3.562, + "ap-northeast-3": 0.0, + "ap-south-1": 3.21, + "ap-south-2": 3.21, + "ap-southeast-1": 3.578, + "ap-southeast-2": 3.578, + "ap-southeast-3": 3.578, + "ap-southeast-4": 3.578, + "ca-central-1": 3.322, + "eu-central-1": 3.562, + "eu-central-2": 3.838, + "eu-north-1": 3.226, + "eu-south-1": 3.482, + "eu-south-2": 0.0, + "eu-west-1": 3.354, + "eu-west-2": 3.66, + "eu-west-3": 3.498, + "il-central-1": 0.0, + "me-central-1": 3.61, + "me-south-1": 3.61, + "sa-east-1": 4.442, + "us-east-1": 3.098, + "us-east-2": 3.098, + "us-gov-east-1": 3.562, + "us-gov-west-1": 0.0, + "us-west-1": 3.386, + "us-west-2": 3.098, + "us-west-2-lax-1": 3.558 + }, + "r5d.12xlarge": { + "af-south-1": 5.75, + "ap-east-1": 5.39, + "ap-northeast-1": 5.617, + "ap-northeast-2": 5.342, + "ap-northeast-3": 0.0, + "ap-south-1": 4.814, + "ap-south-2": 4.814, + "ap-southeast-1": 5.617, + "ap-southeast-2": 0.0, + "ap-southeast-3": 5.366, + "ap-southeast-4": 5.617, + "ca-central-1": 5.21, + "eu-central-1": 5.592, + "eu-central-2": 5.758, + "eu-north-1": 4.838, + "eu-south-1": 5.222, + "eu-south-2": 5.03, + "eu-west-1": 5.03, + "eu-west-2": 0.0, + "eu-west-3": 5.246, + "il-central-1": 5.222, + "me-central-1": 5.414, + "me-south-1": 5.668, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 4.854, + "us-gov-east-1": 5.342, + "us-gov-west-1": 5.342, + "us-west-1": 5.078, + "us-west-2": 4.646, + "us-west-2-lax-1": 5.338 + }, + "r5d.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 7.155, + "ap-northeast-2": 7.123, + "ap-northeast-3": 7.489, + "ap-south-1": 6.419, + "ap-south-2": 6.419, + "ap-southeast-1": 7.155, + "ap-southeast-2": 7.155, + "ap-southeast-3": 7.489, + "ap-southeast-4": 7.489, + "ca-central-1": 6.643, + "eu-central-1": 7.123, + "eu-central-2": 7.677, + "eu-north-1": 6.451, + "eu-south-1": 6.963, + "eu-south-2": 6.707, + "eu-west-1": 6.707, + "eu-west-2": 6.995, + "eu-west-3": 6.995, + "il-central-1": 0.0, + "me-central-1": 7.219, + "me-south-1": 7.219, + "sa-east-1": 8.883, + "us-east-1": 6.195, + "us-east-2": 6.195, + "us-gov-east-1": 7.123, + "us-gov-west-1": 7.455, + "us-west-1": 6.771, + "us-west-2": 6.195, + "us-west-2-lax-1": 7.448 + }, + "r5d.24xlarge": { + "af-south-1": 11.501, + "ap-east-1": 10.781, + "ap-northeast-1": 10.733, + "ap-northeast-2": 10.685, + "ap-northeast-3": 0.0, + "ap-south-1": 9.629, + "ap-south-2": 9.629, + "ap-southeast-1": 10.733, + "ap-southeast-2": 10.733, + "ap-southeast-3": 10.733, + "ap-southeast-4": 0.0, + "ca-central-1": 9.965, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 9.677, + "eu-south-1": 10.445, + "eu-south-2": 10.061, + "eu-west-1": 0.0, + "eu-west-2": 10.493, + "eu-west-3": 10.493, + "il-central-1": 10.445, + "me-central-1": 10.829, + "me-south-1": 10.829, + "sa-east-1": 13.325, + "us-east-1": 9.293, + "us-east-2": 9.293, + "us-gov-east-1": 0.0, + "us-gov-west-1": 10.685, + "us-west-1": 10.157, + "us-west-2": 0.0, + "us-west-2-lax-1": 10.675 + }, + "r5dn.large": { + "af-south-1": 0.2848, + "ap-northeast-1": 0.27898, + "ap-northeast-2": 0.2628, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.27474, + "eu-north-1": 0.25142, + "eu-south-1": 0.2598, + "eu-west-1": 0.2498, + "eu-west-3": 0.2598, + "us-east-1": 0.24082, + "us-east-2": 0.24082, + "us-gov-east-1": 0.2648, + "us-gov-west-1": 0.0, + "us-west-2": 0.24082 + }, + "r5dn.xlarge": { + "af-south-1": 0.59612, + "ap-northeast-1": 0.5336, + "ap-northeast-2": 0.54948, + "ap-southeast-1": 0.5276, + "ap-southeast-2": 0.5356, + "eu-central-1": 0.54948, + "eu-north-1": 0.0, + "eu-south-1": 0.5196, + "eu-west-1": 0.52192, + "eu-west-3": 0.5196, + "us-east-1": 0.4616, + "us-east-2": 0.4616, + "us-gov-east-1": 0.55372, + "us-gov-west-1": 0.5296, + "us-west-2": 0.48164 + }, + "r5dn.metal": { + "af-south-1": 12.9888, + "ap-northeast-1": 12.1248, + "ap-northeast-2": 11.9328, + "ap-southeast-1": 11.9808, + "ap-southeast-2": 0.0, + "eu-central-1": 11.9328, + "eu-north-1": 0.0, + "eu-south-1": 11.7888, + "eu-west-1": 0.0, + "eu-west-3": 11.7888, + "us-east-1": 10.3968, + "us-east-2": 0.0, + "us-gov-east-1": 12.0288, + "us-gov-west-1": 12.0288, + "us-west-2": 10.3968 + }, + "r5dn.2xlarge": { + "af-south-1": 1.1392, + "ap-northeast-1": 1.0672, + "ap-northeast-2": 1.09896, + "ap-southeast-1": 1.0552, + "ap-southeast-2": 1.0712, + "eu-central-1": 1.0512, + "eu-north-1": 1.00568, + "eu-south-1": 1.08624, + "eu-west-1": 0.9992, + "eu-west-3": 1.0392, + "us-east-1": 0.9232, + "us-east-2": 0.9232, + "us-gov-east-1": 1.0592, + "us-gov-west-1": 1.0592, + "us-west-2": 0.9232 + }, + "r5dn.4xlarge": { + "af-south-1": 2.1648, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.9888, + "ap-southeast-1": 1.9968, + "ap-southeast-2": 2.12672, + "eu-central-1": 1.9888, + "eu-north-1": 1.8128, + "eu-south-1": 1.9648, + "eu-west-1": 1.8848, + "eu-west-3": 1.9648, + "us-east-1": 1.81296, + "us-east-2": 1.81296, + "us-gov-east-1": 2.0048, + "us-gov-west-1": 2.10128, + "us-west-2": 0.0 + }, + "r5dn.8xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 4.0416, + "ap-northeast-2": 3.9776, + "ap-southeast-1": 3.9936, + "ap-southeast-2": 4.0576, + "eu-central-1": 3.9776, + "eu-north-1": 3.6256, + "eu-south-1": 3.9296, + "eu-west-1": 3.7696, + "eu-west-3": 4.11776, + "us-east-1": 3.4656, + "us-east-2": 3.62592, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.0096, + "us-west-2": 3.4656 + }, + "r5dn.12xlarge": { + "af-south-1": 6.81264, + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.9664, + "ap-southeast-1": 6.2784, + "ap-southeast-2": 6.0864, + "eu-central-1": 5.9664, + "eu-north-1": 5.4384, + "eu-south-1": 6.17664, + "eu-west-1": 0.0, + "eu-west-3": 6.17664, + "us-east-1": 5.43888, + "us-east-2": 5.1984, + "us-gov-east-1": 6.0144, + "us-gov-west-1": 6.0144, + "us-west-2": 5.1984 + }, + "r5dn.16xlarge": { + "af-south-1": 8.6592, + "ap-northeast-1": 8.0832, + "ap-northeast-2": 7.9552, + "ap-southeast-1": 0.0, + "ap-southeast-2": 8.1152, + "eu-central-1": 0.0, + "eu-north-1": 7.59104, + "eu-south-1": 8.23552, + "eu-west-1": 7.5392, + "eu-west-3": 7.8592, + "us-east-1": 6.9312, + "us-east-2": 6.9312, + "us-gov-east-1": 8.0192, + "us-gov-west-1": 8.40512, + "us-west-2": 6.9312 + }, + "r5dn.24xlarge": { + "af-south-1": 12.9888, + "ap-northeast-1": 12.1248, + "ap-northeast-2": 11.9328, + "ap-southeast-1": 0.0, + "ap-southeast-2": 12.1728, + "eu-central-1": 11.9328, + "eu-north-1": 0.0, + "eu-south-1": 11.7888, + "eu-west-1": 11.3088, + "eu-west-3": 11.7888, + "us-east-1": 10.3968, + "us-east-2": 0.0, + "us-gov-east-1": 12.0288, + "us-gov-west-1": 0.0, + "us-west-2": 10.3968 + }, + "r5n.large": { + "af-south-1": 0.262, + "ap-east-1": 0.266, + "ap-northeast-1": 0.256, + "ap-northeast-2": 0.242, + "ap-south-1": 0.226, + "ap-southeast-1": 0.242, + "ap-southeast-2": 0.245, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.232, + "eu-south-1": 0.239, + "eu-west-1": 0.241, + "eu-west-2": 0.239, + "eu-west-3": 0.0, + "sa-east-1": 0.3, + "us-east-1": 0.0, + "us-east-2": 0.222, + "us-gov-east-1": 0.243, + "us-gov-west-1": 0.0, + "us-west-1": 0.233, + "us-west-2": 0.213 + }, + "r5n.xlarge": { + "af-south-1": 0.525, + "ap-east-1": 0.532, + "ap-northeast-1": 0.49, + "ap-northeast-2": 0.484, + "ap-south-1": 0.452, + "ap-southeast-1": 0.484, + "ap-southeast-2": 0.49, + "ca-central-1": 0.454, + "eu-central-1": 0.484, + "eu-north-1": 0.446, + "eu-south-1": 0.478, + "eu-west-1": 0.462, + "eu-west-2": 0.478, + "eu-west-3": 0.478, + "sa-east-1": 0.0, + "us-east-1": 0.443, + "us-east-2": 0.443, + "us-gov-east-1": 0.486, + "us-gov-west-1": 0.486, + "us-west-1": 0.0, + "us-west-2": 0.443 + }, + "r5n.metal": { + "af-south-1": 11.917, + "ap-east-1": 12.077, + "ap-northeast-1": 0.0, + "ap-northeast-2": 10.925, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 11.069, + "ca-central-1": 10.205, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 10.782, + "eu-west-1": 10.397, + "eu-west-2": 10.781, + "eu-west-3": 10.781, + "sa-east-1": 13.709, + "us-east-1": 9.533, + "us-east-2": 9.533, + "us-gov-east-1": 10.973, + "us-gov-west-1": 10.973, + "us-west-1": 10.493, + "us-west-2": 9.533 + }, + "r5n.2xlarge": { + "af-south-1": 1.05, + "ap-east-1": 1.063, + "ap-northeast-1": 0.979, + "ap-northeast-2": 0.967, + "ap-south-1": 0.904, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.979, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.891, + "eu-south-1": 0.997, + "eu-west-1": 0.923, + "eu-west-2": 0.955, + "eu-west-3": 0.997, + "sa-east-1": 1.256, + "us-east-1": 0.851, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.972, + "us-west-2": 0.851 + }, + "r5n.4xlarge": { + "af-south-1": 1.986, + "ap-east-1": 2.013, + "ap-northeast-1": 1.845, + "ap-northeast-2": 1.821, + "ap-south-1": 1.621, + "ap-southeast-1": 1.821, + "ap-southeast-2": 1.845, + "ca-central-1": 1.701, + "eu-central-1": 1.821, + "eu-north-1": 1.745, + "eu-south-1": 1.797, + "eu-west-1": 1.733, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 2.398, + "us-east-1": 1.589, + "us-east-2": 1.589, + "us-gov-east-1": 1.829, + "us-gov-west-1": 0.0, + "us-west-1": 1.749, + "us-west-2": 0.0 + }, + "r5n.8xlarge": { + "af-south-1": 3.972, + "ap-east-1": 0.0, + "ap-northeast-1": 3.69, + "ap-northeast-2": 3.642, + "ap-south-1": 3.388, + "ap-southeast-1": 3.642, + "ap-southeast-2": 3.69, + "ca-central-1": 3.402, + "eu-central-1": 3.642, + "eu-north-1": 3.49, + "eu-south-1": 0.0, + "eu-west-1": 3.626, + "eu-west-2": 3.594, + "eu-west-3": 3.762, + "sa-east-1": 4.57, + "us-east-1": 3.178, + "us-east-2": 3.321, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.829, + "us-west-1": 3.498, + "us-west-2": 3.321 + }, + "r5n.12xlarge": { + "af-south-1": 6.245, + "ap-east-1": 6.329, + "ap-northeast-1": 5.534, + "ap-northeast-2": 5.462, + "ap-south-1": 4.862, + "ap-southeast-1": 5.462, + "ap-southeast-2": 5.795, + "ca-central-1": 5.102, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 5.391, + "eu-west-1": 5.198, + "eu-west-2": 5.39, + "eu-west-3": 5.39, + "sa-east-1": 6.854, + "us-east-1": 4.981, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 5.486, + "us-west-1": 5.246, + "us-west-2": 4.981 + }, + "r5n.16xlarge": { + "af-south-1": 7.945, + "ap-east-1": 8.051, + "ap-northeast-1": 7.379, + "ap-northeast-2": 7.283, + "ap-south-1": 6.483, + "ap-southeast-1": 7.283, + "ap-southeast-2": 0.0, + "ca-central-1": 6.803, + "eu-central-1": 7.283, + "eu-north-1": 0.0, + "eu-south-1": 7.188, + "eu-west-1": 6.931, + "eu-west-2": 7.187, + "eu-west-3": 7.187, + "sa-east-1": 9.592, + "us-east-1": 6.355, + "us-east-2": 6.355, + "us-gov-east-1": 7.315, + "us-gov-west-1": 7.315, + "us-west-1": 6.995, + "us-west-2": 0.0 + }, + "r5n.24xlarge": { + "af-south-1": 11.917, + "ap-east-1": 12.077, + "ap-northeast-1": 0.0, + "ap-northeast-2": 10.925, + "ap-south-1": 9.725, + "ap-southeast-1": 10.925, + "ap-southeast-2": 11.069, + "ca-central-1": 10.205, + "eu-central-1": 10.925, + "eu-north-1": 10.013, + "eu-south-1": 10.782, + "eu-west-1": 10.397, + "eu-west-2": 10.781, + "eu-west-3": 10.781, + "sa-east-1": 13.709, + "us-east-1": 0.0, + "us-east-2": 9.533, + "us-gov-east-1": 10.973, + "us-gov-west-1": 10.973, + "us-west-1": 10.493, + "us-west-2": 9.533 + }, + "r6a.large": { + "ap-northeast-1": 0.2006, + "ap-south-1": 0.1353, + "ap-south-2": 0.0, + "ap-southeast-1": 0.2006, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.1907, + "us-east-1": 0.0, + "us-east-2": 0.18854, + "us-west-1": 0.1898, + "us-west-2": 0.1772 + }, + "r6a.xlarge": { + "ap-northeast-1": 0.4012, + "ap-south-1": 0.2706, + "ap-south-2": 0.2706, + "ap-southeast-1": 0.42856, + "ap-southeast-2": 0.42658, + "ca-central-1": 0.376, + "eu-central-1": 0.4012, + "eu-west-1": 0.3814, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 0.3796, + "us-west-2": 0.3544 + }, + "r6a.metal": { + "ap-northeast-1": 16.992, + "ap-south-1": 10.7232, + "ap-south-2": 10.7232, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 15.7824, + "eu-central-1": 16.992, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 14.7456, + "us-west-1": 15.9552, + "us-west-2": 14.7456 + }, + "r6a.2xlarge": { + "ap-northeast-1": 0.85712, + "ap-south-1": 0.5412, + "ap-south-2": 0.5412, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.85712, + "eu-west-1": 0.7628, + "us-east-1": 0.7088, + "us-east-2": 0.7088, + "us-west-1": 0.8096, + "us-west-2": 0.7088 + }, + "r6a.4xlarge": { + "ap-northeast-1": 1.4912, + "ap-south-1": 0.9688, + "ap-south-2": 0.9688, + "ap-southeast-1": 1.4912, + "ap-southeast-2": 1.484, + "ca-central-1": 1.48976, + "eu-central-1": 1.4912, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 1.39472, + "us-west-1": 0.0, + "us-west-2": 1.304 + }, + "r6a.8xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 1.9376, + "ap-south-2": 1.9376, + "ap-southeast-1": 2.9824, + "ap-southeast-2": 2.968, + "ca-central-1": 2.7808, + "eu-central-1": 2.9824, + "eu-west-1": 3.02704, + "us-east-1": 2.78944, + "us-east-2": 2.608, + "us-west-1": 3.0112, + "us-west-2": 2.608 + }, + "r6a.12xlarge": { + "ap-northeast-1": 4.4736, + "ap-south-1": 2.9064, + "ap-south-2": 2.9064, + "ap-southeast-1": 4.4736, + "ap-southeast-2": 4.452, + "ca-central-1": 4.46928, + "eu-central-1": 4.4736, + "eu-west-1": 4.236, + "us-east-1": 3.912, + "us-east-2": 3.912, + "us-west-1": 0.0, + "us-west-2": 4.18416 + }, + "r6a.16xlarge": { + "ap-northeast-1": 5.9648, + "ap-south-1": 3.8752, + "ap-south-2": 4.104, + "ap-southeast-1": 5.9648, + "ap-southeast-2": 5.936, + "ca-central-1": 5.5616, + "eu-central-1": 0.0, + "eu-west-1": 6.05408, + "us-east-1": 5.216, + "us-east-2": 5.216, + "us-west-1": 5.6192, + "us-west-2": 5.216 + }, + "r6a.24xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 5.8128, + "ap-south-2": 0.0, + "ap-southeast-1": 8.9472, + "ap-southeast-2": 9.55632, + "ca-central-1": 8.3424, + "eu-central-1": 8.9472, + "eu-west-1": 8.472, + "us-east-1": 7.824, + "us-east-2": 7.824, + "us-west-1": 8.4288, + "us-west-2": 7.824 + }, + "r6a.32xlarge": { + "ap-northeast-1": 11.328, + "ap-south-1": 7.6064, + "ap-south-2": 7.1488, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 11.31648, + "eu-central-1": 0.0, + "eu-west-1": 10.6944, + "us-east-1": 9.8304, + "us-east-2": 10.55616, + "us-west-1": 0.0, + "us-west-2": 9.8304 + }, + "r6a.48xlarge": { + "ap-northeast-1": 16.992, + "ap-south-1": 10.7232, + "ap-south-2": 10.7232, + "ap-southeast-1": 16.992, + "ap-southeast-2": 16.9056, + "ca-central-1": 15.7824, + "eu-central-1": 16.992, + "eu-west-1": 16.0416, + "us-east-1": 0.0, + "us-east-2": 14.7456, + "us-west-1": 15.9552, + "us-west-2": 0.0 + }, + "r6g.medium": { + "af-south-1": 0.0991, + "ap-east-1": 0.0989, + "ap-northeast-1": 0.0927, + "ap-northeast-2": 0.0929, + "ap-northeast-3": 0.0927, + "ap-south-1": 0.0664, + "ap-south-2": 0.0664, + "ap-southeast-1": 0.0963, + "ap-southeast-2": 0.0923, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0923, + "ap-southeast-5": 0.0836, + "ap-southeast-7": 0.0836, + "ca-central-1": 0.0871, + "ca-west-1": 0.0871, + "eu-central-1": 0.0927, + "eu-central-2": 0.1028, + "eu-north-1": 0.0854, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0917, + "eu-west-2": 0.0911, + "eu-west-3": 0.0909, + "il-central-1": 0.0947, + "me-central-1": 0.0, + "me-south-1": 0.0939, + "mx-central-1": 0.0, + "sa-east-1": 0.1123, + "us-east-1": 0.0823, + "us-east-2": 0.0823, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0959, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "r6g.large": { + "af-south-1": 0.1982, + "ap-east-1": 0.1978, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1858, + "ap-northeast-3": 0.1854, + "ap-south-1": 0.0, + "ap-south-2": 0.1288, + "ap-southeast-1": 0.1854, + "ap-southeast-2": 0.1846, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.1918, + "ap-southeast-5": 0.1672, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.1742, + "eu-central-1": 0.1854, + "eu-central-2": 0.1976, + "eu-north-1": 0.1708, + "eu-south-1": 0.1822, + "eu-south-2": 0.1766, + "eu-west-1": 0.1766, + "eu-west-2": 0.1822, + "eu-west-3": 0.1889, + "il-central-1": 0.1822, + "me-central-1": 0.1953, + "me-south-1": 0.1879, + "mx-central-1": 0.176, + "sa-east-1": 0.2246, + "us-east-1": 0.1646, + "us-east-2": 0.1646, + "us-gov-east-1": 0.1846, + "us-gov-west-1": 0.1846, + "us-west-1": 0.1758, + "us-west-2": 0.1646 + }, + "r6g.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.3956, + "ap-northeast-1": 0.3854, + "ap-northeast-2": 0.3716, + "ap-northeast-3": 0.3708, + "ap-south-1": 0.0, + "ap-south-2": 0.2576, + "ap-southeast-1": 0.3708, + "ap-southeast-2": 0.3692, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.3692, + "ap-southeast-5": 0.3467, + "ap-southeast-7": 0.0, + "ca-central-1": 0.3484, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.3951, + "eu-north-1": 0.3416, + "eu-south-1": 0.0, + "eu-south-2": 0.3532, + "eu-west-1": 0.0, + "eu-west-2": 0.3786, + "eu-west-3": 0.3636, + "il-central-1": 0.3787, + "me-central-1": 0.3758, + "me-south-1": 0.3758, + "mx-central-1": 0.0, + "sa-east-1": 0.4685, + "us-east-1": 0.0, + "us-east-2": 0.3292, + "us-gov-east-1": 0.3692, + "us-gov-west-1": 0.3837, + "us-west-1": 0.3516, + "us-west-2": 0.3292 + }, + "r6g.metal": { + "af-south-1": 0.0, + "ap-east-1": 5.8752, + "ap-northeast-1": 5.4784, + "ap-northeast-2": 5.4912, + "ap-northeast-3": 5.4784, + "ap-south-1": 0.0, + "ap-south-2": 3.6672, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.4528, + "ap-southeast-3": 5.4784, + "ap-southeast-4": 5.4528, + "ap-southeast-5": 4.8947, + "ap-southeast-7": 0.0, + "ca-central-1": 5.12, + "ca-west-1": 5.12, + "eu-central-1": 5.4784, + "eu-central-2": 5.8675, + "eu-north-1": 5.0112, + "eu-south-1": 5.376, + "eu-south-2": 5.1968, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 5.3632, + "il-central-1": 5.3773, + "me-central-1": 5.5578, + "me-south-1": 5.5578, + "mx-central-1": 4.9741, + "sa-east-1": 6.7328, + "us-east-1": 4.8128, + "us-east-2": 4.8128, + "us-gov-east-1": 0.0, + "us-gov-west-1": 5.4528, + "us-west-1": 5.1712, + "us-west-2": 4.8128 + }, + "r6g.2xlarge": { + "af-south-1": 0.7928, + "ap-east-1": 0.8232, + "ap-northeast-1": 0.7416, + "ap-northeast-2": 0.7724, + "ap-northeast-3": 0.7416, + "ap-south-1": 0.5152, + "ap-south-2": 0.5308, + "ap-southeast-1": 0.7416, + "ap-southeast-2": 0.7674, + "ap-southeast-3": 0.7416, + "ap-southeast-4": 0.7384, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.6686, + "ca-central-1": 0.6968, + "ca-west-1": 0.7233, + "eu-central-1": 0.7416, + "eu-central-2": 0.7902, + "eu-north-1": 0.0, + "eu-south-1": 0.7288, + "eu-south-2": 0.7064, + "eu-west-1": 0.7335, + "eu-west-2": 0.7288, + "eu-west-3": 0.0, + "il-central-1": 0.7574, + "me-central-1": 0.0, + "me-south-1": 0.7813, + "mx-central-1": 0.704, + "sa-east-1": 0.8984, + "us-east-1": 0.6826, + "us-east-2": 0.6584, + "us-gov-east-1": 0.7384, + "us-gov-west-1": 0.7384, + "us-west-1": 0.7032, + "us-west-2": 0.6826 + }, + "r6g.4xlarge": { + "af-south-1": 1.5365, + "ap-east-1": 1.4688, + "ap-northeast-1": 1.3696, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.9168, + "ap-south-2": 0.0, + "ap-southeast-1": 1.3696, + "ap-southeast-2": 1.3632, + "ap-southeast-3": 1.428, + "ap-southeast-4": 1.3632, + "ap-southeast-5": 1.2237, + "ap-southeast-7": 1.2237, + "ca-central-1": 1.28, + "ca-west-1": 1.28, + "eu-central-1": 1.3696, + "eu-central-2": 1.4669, + "eu-north-1": 1.2528, + "eu-south-1": 0.0, + "eu-south-2": 1.2992, + "eu-west-1": 1.2992, + "eu-west-2": 1.4008, + "eu-west-3": 1.3976, + "il-central-1": 1.3443, + "me-central-1": 1.3894, + "me-south-1": 1.3894, + "mx-central-1": 1.2435, + "sa-east-1": 1.6832, + "us-east-1": 1.2032, + "us-east-2": 1.2032, + "us-gov-east-1": 1.3632, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 1.2032 + }, + "r6g.8xlarge": { + "af-south-1": 2.944, + "ap-east-1": 2.9376, + "ap-northeast-1": 2.7392, + "ap-northeast-2": 2.7456, + "ap-northeast-3": 2.7392, + "ap-south-1": 1.8336, + "ap-south-2": 1.8336, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.7264, + "ap-southeast-3": 2.8559, + "ap-southeast-4": 2.7264, + "ap-southeast-5": 2.5466, + "ap-southeast-7": 0.0, + "ca-central-1": 2.56, + "ca-west-1": 2.56, + "eu-central-1": 2.7392, + "eu-central-2": 2.9338, + "eu-north-1": 2.608, + "eu-south-1": 2.688, + "eu-south-2": 2.7067, + "eu-west-1": 2.5984, + "eu-west-2": 2.688, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 2.7789, + "me-south-1": 2.7789, + "mx-central-1": 2.487, + "sa-east-1": 3.3664, + "us-east-1": 2.4064, + "us-east-2": 2.5032, + "us-gov-east-1": 2.7264, + "us-gov-west-1": 2.7264, + "us-west-1": 2.6931, + "us-west-2": 2.5032 + }, + "r6g.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.4064, + "ap-northeast-1": 4.1088, + "ap-northeast-2": 4.1184, + "ap-northeast-3": 4.1088, + "ap-south-1": 2.844, + "ap-south-2": 0.0, + "ap-southeast-1": 4.1088, + "ap-southeast-2": 4.0896, + "ap-southeast-3": 4.1088, + "ap-southeast-4": 4.2636, + "ap-southeast-5": 3.8199, + "ap-southeast-7": 3.671, + "ca-central-1": 3.999, + "ca-west-1": 3.84, + "eu-central-1": 4.1088, + "eu-central-2": 4.5933, + "eu-north-1": 3.912, + "eu-south-1": 0.0, + "eu-south-2": 3.8976, + "eu-west-1": 3.8976, + "eu-west-2": 4.2025, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 4.1683, + "me-south-1": 4.1683, + "mx-central-1": 3.7306, + "sa-east-1": 5.0496, + "us-east-1": 3.6096, + "us-east-2": 3.6096, + "us-gov-east-1": 4.2636, + "us-gov-west-1": 4.0896, + "us-west-1": 3.8784, + "us-west-2": 3.6096 + }, + "r6g.16xlarge": { + "af-south-1": 5.888, + "ap-east-1": 5.8752, + "ap-northeast-1": 5.4784, + "ap-northeast-2": 5.4912, + "ap-northeast-3": 5.4784, + "ap-south-1": 3.6672, + "ap-south-2": 3.6672, + "ap-southeast-1": 5.4784, + "ap-southeast-2": 0.0, + "ap-southeast-3": 5.4784, + "ap-southeast-4": 5.4528, + "ap-southeast-5": 4.8947, + "ap-southeast-7": 4.8947, + "ca-central-1": 0.0, + "ca-west-1": 5.12, + "eu-central-1": 5.4784, + "eu-central-2": 5.8675, + "eu-north-1": 0.0, + "eu-south-1": 5.376, + "eu-south-2": 5.1968, + "eu-west-1": 5.1968, + "eu-west-2": 5.376, + "eu-west-3": 5.3632, + "il-central-1": 5.3773, + "me-central-1": 5.5578, + "me-south-1": 5.5578, + "mx-central-1": 0.0, + "sa-east-1": 6.7328, + "us-east-1": 4.8128, + "us-east-2": 4.8128, + "us-gov-east-1": 5.4528, + "us-gov-west-1": 5.4528, + "us-west-1": 5.1712, + "us-west-2": 4.8128 + }, + "r6gd.medium": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1052, + "ap-northeast-3": 0.1015, + "ap-south-1": 0.0693, + "ap-southeast-1": 0.1014, + "ap-southeast-2": 0.1056, + "ap-southeast-3": 0.1014, + "ca-central-1": 0.0951, + "eu-central-1": 0.1009, + "eu-central-2": 0.1078, + "eu-north-1": 0.0, + "eu-south-2": 0.0959, + "eu-west-1": 0.0997, + "eu-west-2": 0.0995, + "eu-west-3": 0.0995, + "sa-east-1": 0.1231, + "us-east-1": 0.0895, + "us-east-2": 0.0895, + "us-gov-east-1": 0.1053, + "us-gov-west-1": 0.0, + "us-west-1": 0.0969, + "us-west-2": 0.0895 + }, + "r6gd.large": { + "ap-northeast-1": 0.2112, + "ap-northeast-2": 0.2022, + "ap-northeast-3": 0.0, + "ap-south-1": 0.143, + "ap-southeast-1": 0.2028, + "ap-southeast-2": 0.2112, + "ap-southeast-3": 0.2028, + "ca-central-1": 0.1978, + "eu-central-1": 0.2018, + "eu-central-2": 0.2156, + "eu-north-1": 0.1854, + "eu-south-2": 0.1995, + "eu-west-1": 0.0, + "eu-west-2": 0.2071, + "eu-west-3": 0.199, + "sa-east-1": 0.2462, + "us-east-1": 0.1859, + "us-east-2": 0.179, + "us-gov-east-1": 0.2022, + "us-gov-west-1": 0.0, + "us-west-1": 0.1938, + "us-west-2": 0.1859 + }, + "r6gd.xlarge": { + "ap-northeast-1": 0.4224, + "ap-northeast-2": 0.4044, + "ap-northeast-3": 0.4227, + "ap-south-1": 0.2771, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.4056, + "ca-central-1": 0.3956, + "eu-central-1": 0.4036, + "eu-central-2": 0.0, + "eu-north-1": 0.3708, + "eu-south-2": 0.3836, + "eu-west-1": 0.3836, + "eu-west-2": 0.0, + "eu-west-3": 0.4142, + "sa-east-1": 0.5143, + "us-east-1": 0.358, + "us-east-2": 0.0, + "us-gov-east-1": 0.421, + "us-gov-west-1": 0.4044, + "us-west-1": 0.4032, + "us-west-2": 0.358 + }, + "r6gd.metal": { + "ap-northeast-1": 6.0352, + "ap-northeast-2": 6.016, + "ap-northeast-3": 6.0416, + "ap-south-1": 3.9789, + "ap-southeast-1": 6.0352, + "ap-southeast-2": 6.0352, + "ap-southeast-3": 0.0, + "ca-central-1": 5.632, + "eu-central-1": 6.0032, + "eu-central-2": 6.4448, + "eu-north-1": 5.4784, + "eu-south-2": 5.6832, + "eu-west-1": 5.6832, + "eu-west-2": 5.9136, + "eu-west-3": 5.9136, + "sa-east-1": 7.424, + "us-east-1": 5.2736, + "us-east-2": 5.2736, + "us-gov-east-1": 6.016, + "us-gov-west-1": 6.016, + "us-west-1": 5.7472, + "us-west-2": 5.2736 + }, + "r6gd.2xlarge": { + "ap-northeast-1": 0.8112, + "ap-northeast-2": 0.8088, + "ap-northeast-3": 0.812, + "ap-south-1": 0.5542, + "ap-southeast-1": 0.8448, + "ap-southeast-2": 0.8448, + "ap-southeast-3": 0.0, + "ca-central-1": 0.7608, + "eu-central-1": 0.0, + "eu-central-2": 0.8624, + "eu-north-1": 0.7416, + "eu-south-2": 0.0, + "eu-west-1": 0.7672, + "eu-west-2": 0.796, + "eu-west-3": 0.796, + "sa-east-1": 1.0286, + "us-east-1": 0.716, + "us-east-2": 0.716, + "us-gov-east-1": 0.8088, + "us-gov-west-1": 0.8088, + "us-west-1": 0.7752, + "us-west-2": 0.716 + }, + "r6gd.4xlarge": { + "ap-northeast-1": 1.576, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.5104, + "ap-south-1": 1.0306, + "ap-southeast-1": 1.5088, + "ap-southeast-2": 1.576, + "ap-southeast-3": 1.5088, + "ca-central-1": 1.408, + "eu-central-1": 1.5008, + "eu-central-2": 1.6112, + "eu-north-1": 1.428, + "eu-south-2": 1.4822, + "eu-west-1": 1.4208, + "eu-west-2": 0.0, + "eu-west-3": 1.5433, + "sa-east-1": 1.856, + "us-east-1": 1.3184, + "us-east-2": 1.3184, + "us-gov-east-1": 1.5704, + "us-gov-west-1": 1.5704, + "us-west-1": 1.4992, + "us-west-2": 0.0 + }, + "r6gd.8xlarge": { + "ap-northeast-1": 3.0176, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 1.9894, + "ap-southeast-1": 3.0176, + "ap-southeast-2": 3.0176, + "ap-southeast-3": 3.0176, + "ca-central-1": 2.816, + "eu-central-1": 3.0016, + "eu-central-2": 3.2224, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 2.8416, + "eu-west-2": 3.0866, + "eu-west-3": 2.9568, + "sa-east-1": 3.8871, + "us-east-1": 2.6368, + "us-east-2": 2.6368, + "us-gov-east-1": 3.008, + "us-gov-west-1": 3.008, + "us-west-1": 0.0, + "us-west-2": 2.6368 + }, + "r6gd.12xlarge": { + "ap-northeast-1": 4.5264, + "ap-northeast-2": 4.7109, + "ap-northeast-3": 4.5312, + "ap-south-1": 3.0918, + "ap-southeast-1": 4.728, + "ap-southeast-2": 4.5264, + "ap-southeast-3": 4.5264, + "ca-central-1": 4.224, + "eu-central-1": 4.7016, + "eu-central-2": 4.8336, + "eu-north-1": 4.1088, + "eu-south-2": 4.2624, + "eu-west-1": 4.2624, + "eu-west-2": 4.4352, + "eu-west-3": 4.4352, + "sa-east-1": 5.568, + "us-east-1": 3.9552, + "us-east-2": 0.0, + "us-gov-east-1": 4.512, + "us-gov-west-1": 4.512, + "us-west-1": 4.3104, + "us-west-2": 0.0 + }, + "r6gd.16xlarge": { + "ap-northeast-1": 6.0352, + "ap-northeast-2": 6.016, + "ap-northeast-3": 6.0416, + "ap-south-1": 3.9789, + "ap-southeast-1": 6.0352, + "ap-southeast-2": 6.0352, + "ap-southeast-3": 6.0352, + "ca-central-1": 5.632, + "eu-central-1": 0.0, + "eu-central-2": 6.4448, + "eu-north-1": 5.4784, + "eu-south-2": 5.6832, + "eu-west-1": 0.0, + "eu-west-2": 5.9136, + "eu-west-3": 5.9136, + "sa-east-1": 0.0, + "us-east-1": 5.2736, + "us-east-2": 5.2736, + "us-gov-east-1": 6.016, + "us-gov-west-1": 6.016, + "us-west-1": 5.7472, + "us-west-2": 5.2736 + }, + "r6i.large": { + "af-south-1": 0.0, + "ap-east-1": 0.2308, + "ap-northeast-1": 0.2158, + "ap-northeast-2": 0.2158, + "ap-northeast-3": 0.231, + "ap-south-1": 0.1938, + "ap-south-2": 0.1938, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.2148, + "ap-southeast-5": 0.193, + "ap-southeast-7": 0.20592, + "ca-central-1": 0.0, + "ca-west-1": 0.2156, + "eu-central-1": 0.2158, + "eu-central-2": 0.0, + "eu-north-1": 0.1978, + "eu-south-1": 0.2118, + "eu-west-1": 0.0, + "eu-west-2": 0.2266, + "eu-west-3": 0.2266, + "il-central-1": 0.21185, + "me-central-1": 0.23441, + "me-south-1": 0.23441, + "mx-central-1": 0.1961, + "sa-east-1": 0.2648, + "us-east-1": 0.0, + "us-east-2": 0.1898, + "us-gov-east-1": 0.2148, + "us-gov-west-1": 0.2148, + "us-west-1": 0.2178, + "us-west-2": 0.0 + }, + "r6i.xlarge": { + "af-south-1": 0.4636, + "ap-east-1": 0.4616, + "ap-northeast-1": 0.462, + "ap-northeast-2": 0.4316, + "ap-northeast-3": 0.4316, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.462, + "ap-southeast-2": 0.4598, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.41184, + "ca-central-1": 0.4036, + "ca-west-1": 0.4312, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.3956, + "eu-south-1": 0.4532, + "eu-west-1": 0.4096, + "eu-west-2": 0.0, + "eu-west-3": 0.4236, + "il-central-1": 0.0, + "me-central-1": 0.4378, + "me-south-1": 0.4378, + "mx-central-1": 0.0, + "sa-east-1": 0.5698, + "us-east-1": 0.3796, + "us-east-2": 0.3796, + "us-gov-east-1": 0.4296, + "us-gov-west-1": 0.4296, + "us-west-1": 0.4076, + "us-west-2": 0.3796 + }, + "r6i.metal": { + "af-south-1": 13.3248, + "ap-east-1": 13.2608, + "ap-northeast-1": 12.3008, + "ap-northeast-2": 0.0, + "ap-northeast-3": 12.3008, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 12.3008, + "ap-southeast-2": 12.2368, + "ap-southeast-5": 10.8416, + "ap-southeast-7": 10.8416, + "ca-central-1": 11.4048, + "ca-west-1": 11.4048, + "eu-central-1": 12.3008, + "eu-central-2": 13.2736, + "eu-north-1": 11.1488, + "eu-south-1": 12.0448, + "eu-west-1": 0.0, + "eu-west-2": 12.0448, + "eu-west-3": 12.0448, + "il-central-1": 0.0, + "me-central-1": 12.4992, + "me-south-1": 12.4992, + "mx-central-1": 11.04, + "sa-east-1": 15.4368, + "us-east-1": 10.6368, + "us-east-2": 0.0, + "us-gov-east-1": 12.2368, + "us-gov-west-1": 12.2368, + "us-west-1": 11.5328, + "us-west-2": 10.6368 + }, + "r6i.2xlarge": { + "af-south-1": 0.9272, + "ap-east-1": 0.0, + "ap-northeast-1": 0.8632, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.8632, + "ap-south-1": 0.8272, + "ap-south-2": 0.7752, + "ap-southeast-1": 0.8632, + "ap-southeast-2": 0.9196, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.772, + "ca-central-1": 0.0, + "ca-west-1": 0.8072, + "eu-central-1": 0.8632, + "eu-central-2": 0.924, + "eu-north-1": 0.7912, + "eu-south-1": 0.9064, + "eu-west-1": 0.8192, + "eu-west-2": 0.8472, + "eu-west-3": 0.8472, + "il-central-1": 0.0, + "me-central-1": 0.8756, + "me-south-1": 0.0, + "mx-central-1": 0.7844, + "sa-east-1": 1.1396, + "us-east-1": 0.7592, + "us-east-2": 0.7592, + "us-gov-east-1": 0.8592, + "us-gov-west-1": 0.8592, + "us-west-1": 0.8152, + "us-west-2": 0.7592 + }, + "r6i.4xlarge": { + "af-south-1": 1.7408, + "ap-east-1": 1.7328, + "ap-northeast-1": 1.6128, + "ap-northeast-2": 1.6128, + "ap-northeast-3": 1.6128, + "ap-south-1": 1.4368, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 1.4304, + "ap-southeast-7": 0.0, + "ca-central-1": 1.6112, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 1.4688, + "eu-south-1": 1.5808, + "eu-west-1": 0.0, + "eu-west-2": 1.5808, + "eu-west-3": 1.5808, + "il-central-1": 1.5812, + "me-central-1": 0.0, + "me-south-1": 1.76168, + "mx-central-1": 1.4552, + "sa-east-1": 2.0048, + "us-east-1": 1.4048, + "us-east-2": 1.5056, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.6048, + "us-west-1": 1.5168, + "us-west-2": 1.4048 + }, + "r6i.8xlarge": { + "af-south-1": 3.7504, + "ap-east-1": 3.4656, + "ap-northeast-1": 3.2256, + "ap-northeast-2": 3.2256, + "ap-northeast-3": 3.2256, + "ap-south-1": 0.0, + "ap-south-2": 2.8736, + "ap-southeast-1": 3.4688, + "ap-southeast-2": 3.2096, + "ap-southeast-5": 2.8608, + "ap-southeast-7": 2.8608, + "ca-central-1": 3.0016, + "ca-west-1": 0.0, + "eu-central-1": 3.2256, + "eu-central-2": 3.4688, + "eu-north-1": 2.9376, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 3.3984, + "il-central-1": 3.1624, + "me-central-1": 3.2752, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 4.0096, + "us-east-1": 3.0112, + "us-east-2": 3.0112, + "us-gov-east-1": 3.4512, + "us-gov-west-1": 3.2096, + "us-west-1": 3.2576, + "us-west-2": 3.0112 + }, + "r6i.12xlarge": { + "af-south-1": 5.2224, + "ap-east-1": 5.1984, + "ap-northeast-1": 4.8384, + "ap-northeast-2": 0.0, + "ap-northeast-3": 4.8384, + "ap-south-1": 4.3104, + "ap-south-2": 4.3104, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.8144, + "ap-southeast-5": 4.2912, + "ap-southeast-7": 4.2912, + "ca-central-1": 4.5024, + "ca-west-1": 4.5024, + "eu-central-1": 4.8384, + "eu-central-2": 0.0, + "eu-north-1": 4.4064, + "eu-south-1": 4.7424, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 5.09892, + "me-central-1": 4.9128, + "me-south-1": 4.9128, + "mx-central-1": 4.3656, + "sa-east-1": 6.4968, + "us-east-1": 4.2144, + "us-east-2": 4.2144, + "us-gov-east-1": 4.8144, + "us-gov-west-1": 4.8144, + "us-west-1": 4.5504, + "us-west-2": 4.2144 + }, + "r6i.16xlarge": { + "af-south-1": 6.9632, + "ap-east-1": 7.4656, + "ap-northeast-1": 6.4512, + "ap-northeast-2": 6.4512, + "ap-northeast-3": 6.4512, + "ap-south-1": 5.7472, + "ap-south-2": 5.7472, + "ap-southeast-1": 6.9376, + "ap-southeast-2": 6.4192, + "ap-southeast-5": 5.7216, + "ap-southeast-7": 5.7216, + "ca-central-1": 6.0032, + "ca-west-1": 6.0032, + "eu-central-1": 6.4512, + "eu-central-2": 6.9376, + "eu-north-1": 5.8752, + "eu-south-1": 6.7968, + "eu-west-1": 0.0, + "eu-west-2": 6.7968, + "eu-west-3": 6.7968, + "il-central-1": 6.3248, + "me-central-1": 0.0, + "me-south-1": 6.5504, + "mx-central-1": 0.0, + "sa-east-1": 8.6624, + "us-east-1": 0.0, + "us-east-2": 5.6192, + "us-gov-east-1": 6.4192, + "us-gov-west-1": 6.4192, + "us-west-1": 0.0, + "us-west-2": 5.6192 + }, + "r6i.24xlarge": { + "af-south-1": 0.0, + "ap-east-1": 10.3968, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 9.6768, + "ap-south-1": 0.0, + "ap-south-2": 8.6208, + "ap-southeast-1": 9.6768, + "ap-southeast-2": 9.6288, + "ap-southeast-5": 8.5824, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 9.6768, + "eu-central-2": 11.20896, + "eu-north-1": 8.8128, + "eu-south-1": 9.4848, + "eu-west-1": 0.0, + "eu-west-2": 9.4848, + "eu-west-3": 0.0, + "il-central-1": 9.4872, + "me-central-1": 9.8256, + "me-south-1": 9.8256, + "mx-central-1": 0.0, + "sa-east-1": 12.0288, + "us-east-1": 0.0, + "us-east-2": 8.4288, + "us-gov-east-1": 0.0, + "us-gov-west-1": 9.6288, + "us-west-1": 9.1008, + "us-west-2": 8.4288 + }, + "r6i.32xlarge": { + "af-south-1": 0.0, + "ap-east-1": 13.2608, + "ap-northeast-1": 12.3008, + "ap-northeast-2": 12.3008, + "ap-northeast-3": 12.3008, + "ap-south-1": 10.8928, + "ap-south-2": 0.0, + "ap-southeast-1": 12.3008, + "ap-southeast-2": 12.2368, + "ap-southeast-5": 10.8416, + "ap-southeast-7": 10.8416, + "ca-central-1": 11.4048, + "ca-west-1": 11.4048, + "eu-central-1": 12.3008, + "eu-central-2": 13.2736, + "eu-north-1": 11.1488, + "eu-south-1": 12.0448, + "eu-west-1": 11.5968, + "eu-west-2": 12.0448, + "eu-west-3": 12.0448, + "il-central-1": 12.048, + "me-central-1": 12.4992, + "me-south-1": 12.4992, + "mx-central-1": 11.04, + "sa-east-1": 0.0, + "us-east-1": 10.6368, + "us-east-2": 10.6368, + "us-gov-east-1": 12.2368, + "us-gov-west-1": 0.0, + "us-west-1": 11.5328, + "us-west-2": 10.6368 + }, + "r6id.large": { + "ap-northeast-1": 0.2465, + "ap-northeast-2": 0.0, + "ap-south-1": 0.2224, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.2378, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.23462, + "ca-west-1": 0.24629, + "eu-central-1": 0.24545, + "eu-west-1": 0.2318, + "eu-west-2": 0.259, + "il-central-1": 0.0, + "mx-central-1": 0.23844, + "us-east-1": 0.23012, + "us-east-2": 0.23012, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "r6id.xlarge": { + "ap-northeast-1": 0.52954, + "ap-northeast-2": 0.491, + "ap-south-1": 0.47652, + "ap-southeast-1": 0.493, + "ap-southeast-2": 0.4756, + "ap-southeast-5": 0.46924, + "ap-southeast-7": 0.43818, + "ca-west-1": 0.4594, + "eu-central-1": 0.4909, + "eu-west-1": 0.0, + "eu-west-2": 0.4825, + "il-central-1": 0.4804, + "mx-central-1": 0.44512, + "us-east-1": 0.46024, + "us-east-2": 0.46024, + "us-gov-west-1": 0.491, + "us-west-2": 0.43 + }, + "r6id.metal": { + "ap-northeast-1": 14.2656, + "ap-northeast-2": 0.0, + "ap-south-1": 12.7232, + "ap-southeast-1": 0.0, + "ap-southeast-2": 13.7088, + "ap-southeast-5": 12.51136, + "ap-southeast-7": 12.51136, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 13.3248, + "eu-west-2": 13.9296, + "il-central-1": 0.0, + "mx-central-1": 12.73344, + "us-east-1": 12.2496, + "us-east-2": 12.2496, + "us-gov-west-1": 14.2016, + "us-west-2": 12.2496 + }, + "r6id.2xlarge": { + "ap-northeast-1": 1.05908, + "ap-northeast-2": 0.982, + "ap-south-1": 0.8896, + "ap-southeast-1": 1.05908, + "ap-southeast-2": 0.9512, + "ap-southeast-5": 0.87636, + "ap-southeast-7": 0.87636, + "ca-west-1": 0.98516, + "eu-central-1": 0.9818, + "eu-west-1": 0.9272, + "eu-west-2": 1.03598, + "il-central-1": 0.9608, + "mx-central-1": 0.95374, + "us-east-1": 0.86, + "us-east-2": 0.0, + "us-gov-west-1": 0.982, + "us-west-2": 0.86 + }, + "r6id.4xlarge": { + "ap-northeast-1": 1.8584, + "ap-northeast-2": 1.8504, + "ap-south-1": 1.6656, + "ap-southeast-1": 1.8584, + "ap-southeast-2": 1.7888, + "ap-southeast-5": 1.63912, + "ap-southeast-7": 1.63912, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 1.8164, + "il-central-1": 1.808, + "mx-central-1": 1.79389, + "us-east-1": 0.0, + "us-east-2": 1.72736, + "us-gov-west-1": 1.8504, + "us-west-2": 1.6064 + }, + "r6id.8xlarge": { + "ap-northeast-1": 3.7168, + "ap-northeast-2": 3.7008, + "ap-south-1": 3.3312, + "ap-southeast-1": 3.7168, + "ap-southeast-2": 3.5776, + "ap-southeast-5": 3.5267, + "ap-southeast-7": 3.5267, + "ca-west-1": 3.71344, + "eu-central-1": 3.7, + "eu-west-1": 3.4816, + "eu-west-2": 0.0, + "il-central-1": 3.616, + "mx-central-1": 3.33376, + "us-east-1": 3.2128, + "us-east-2": 3.2128, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "r6id.12xlarge": { + "ap-northeast-1": 5.5752, + "ap-northeast-2": 5.98728, + "ap-south-1": 4.9968, + "ap-southeast-1": 5.5752, + "ap-southeast-2": 5.3664, + "ap-southeast-5": 4.91736, + "ap-southeast-7": 5.29006, + "ca-west-1": 5.172, + "eu-central-1": 5.55, + "eu-west-1": 5.6256, + "eu-west-2": 5.87508, + "il-central-1": 5.424, + "mx-central-1": 0.0, + "us-east-1": 5.18208, + "us-east-2": 4.8192, + "us-gov-west-1": 5.5512, + "us-west-2": 4.8192 + }, + "r6id.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 7.4016, + "ap-south-1": 6.6624, + "ap-southeast-1": 7.4336, + "ap-southeast-2": 7.1552, + "ap-southeast-5": 6.55648, + "ap-southeast-7": 7.05341, + "ca-west-1": 6.896, + "eu-central-1": 7.4, + "eu-west-1": 6.9632, + "eu-west-2": 7.2656, + "il-central-1": 7.232, + "mx-central-1": 6.66752, + "us-east-1": 6.4256, + "us-east-2": 6.4256, + "us-gov-west-1": 7.98304, + "us-west-2": 6.90944 + }, + "r6id.24xlarge": { + "ap-northeast-1": 11.1504, + "ap-northeast-2": 0.0, + "ap-south-1": 9.9936, + "ap-southeast-1": 11.1504, + "ap-southeast-2": 10.7328, + "ap-southeast-5": 0.0, + "ap-southeast-7": 9.83472, + "ca-west-1": 10.344, + "eu-central-1": 11.1, + "eu-west-1": 0.0, + "eu-west-2": 10.8984, + "il-central-1": 10.848, + "mx-central-1": 10.00128, + "us-east-1": 10.36416, + "us-east-2": 9.6384, + "us-gov-west-1": 11.1024, + "us-west-2": 9.6384 + }, + "r6id.32xlarge": { + "ap-northeast-1": 14.2656, + "ap-northeast-2": 14.2016, + "ap-south-1": 12.7232, + "ap-southeast-1": 14.2656, + "ap-southeast-2": 13.7088, + "ap-southeast-5": 12.51136, + "ap-southeast-7": 12.51136, + "ca-west-1": 0.0, + "eu-central-1": 14.1984, + "eu-west-1": 13.3248, + "eu-west-2": 13.9296, + "il-central-1": 13.8624, + "mx-central-1": 12.73344, + "us-east-1": 12.2496, + "us-east-2": 12.2496, + "us-gov-west-1": 14.2016, + "us-west-2": 12.2496 + }, + "r6idn.large": { + "ap-northeast-1": 0.30131, + "ap-southeast-1": 0.3212, + "ap-southeast-2": 0.30248, + "eu-central-1": 0.29663, + "eu-north-1": 0.27089, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 0.29897, + "us-west-2": 0.27873 + }, + "r6idn.xlarge": { + "ap-northeast-1": 0.65012, + "ap-southeast-1": 0.6424, + "ap-southeast-2": 0.0, + "eu-central-1": 0.59326, + "eu-north-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.51838, + "us-east-2": 0.0, + "us-gov-west-1": 0.59794, + "us-west-2": 0.51838 + }, + "r6idn.metal": { + "ap-northeast-1": 17.77344, + "ap-southeast-1": 17.5488, + "ap-southeast-2": 17.84832, + "eu-central-1": 17.47392, + "eu-north-1": 15.82656, + "eu-west-1": 16.50048, + "us-east-1": 15.07776, + "us-east-2": 0.0, + "us-gov-west-1": 17.62368, + "us-west-2": 15.07776 + }, + "r6idn.2xlarge": { + "ap-northeast-1": 1.20524, + "ap-southeast-1": 1.1912, + "ap-southeast-2": 1.30539, + "eu-central-1": 1.18652, + "eu-north-1": 1.08356, + "eu-west-1": 1.12568, + "us-east-1": 1.03676, + "us-east-2": 1.03676, + "us-gov-west-1": 1.28995, + "us-west-2": 1.03676 + }, + "r6idn.4xlarge": { + "ap-northeast-1": 2.29688, + "ap-southeast-1": 2.2688, + "ap-southeast-2": 0.0, + "eu-central-1": 2.25944, + "eu-north-1": 2.05352, + "eu-west-1": 2.13776, + "us-east-1": 0.0, + "us-east-2": 2.11623, + "us-gov-west-1": 2.27816, + "us-west-2": 2.11623 + }, + "r6idn.8xlarge": { + "ap-northeast-1": 4.97378, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 4.51888, + "eu-north-1": 0.0, + "eu-west-1": 4.62371, + "us-east-1": 3.91984, + "us-east-2": 0.0, + "us-gov-west-1": 4.55632, + "us-west-2": 0.0 + }, + "r6idn.12xlarge": { + "ap-northeast-1": 7.46066, + "ap-southeast-1": 6.8064, + "ap-southeast-2": 6.91872, + "eu-central-1": 7.33711, + "eu-north-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 5.87976, + "us-east-2": 5.87976, + "us-gov-west-1": 6.83448, + "us-west-2": 5.87976 + }, + "r6idn.16xlarge": { + "ap-northeast-1": 9.18752, + "ap-southeast-1": 0.0, + "ap-southeast-2": 9.22496, + "eu-central-1": 9.78282, + "eu-north-1": 8.21408, + "eu-west-1": 0.0, + "us-east-1": 7.83968, + "us-east-2": 7.83968, + "us-gov-west-1": 9.11264, + "us-west-2": 8.46493 + }, + "r6idn.24xlarge": { + "ap-northeast-1": 14.92133, + "ap-southeast-1": 13.6128, + "ap-southeast-2": 13.83744, + "eu-central-1": 0.0, + "eu-north-1": 13.31515, + "eu-west-1": 12.82656, + "us-east-1": 11.75952, + "us-east-2": 12.69739, + "us-gov-west-1": 13.66896, + "us-west-2": 11.75952 + }, + "r6idn.32xlarge": { + "ap-northeast-1": 17.77344, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 17.47392, + "eu-north-1": 0.0, + "eu-west-1": 16.50048, + "us-east-1": 15.07776, + "us-east-2": 15.07776, + "us-gov-west-1": 17.62368, + "us-west-2": 15.07776 + }, + "r6in.large": { + "ap-northeast-1": 0.29675, + "ap-southeast-1": 0.27206, + "ap-southeast-2": 0.27557, + "eu-central-1": 0.27206, + "eu-north-1": 0.24983, + "eu-west-1": 0.25919, + "us-east-1": 0.23813, + "us-east-2": 0.23813, + "us-gov-west-1": 0.27323, + "us-west-2": 0.23813 + }, + "r6in.xlarge": { + "ap-northeast-1": 0.59349, + "ap-southeast-1": 0.54412, + "ap-southeast-2": 0.55114, + "eu-central-1": 0.54412, + "eu-north-1": 0.49966, + "eu-west-1": 0.51838, + "us-east-1": 0.47626, + "us-east-2": 0.47626, + "us-gov-west-1": 0.54646, + "us-west-2": 0.0 + }, + "r6in.metal": { + "ap-northeast-1": 16.12608, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 15.90144, + "eu-north-1": 14.47872, + "eu-west-1": 15.07776, + "us-east-1": 13.72992, + "us-east-2": 0.0, + "us-gov-west-1": 15.97632, + "us-west-2": 13.72992 + }, + "r6in.2xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 1.17154, + "ap-southeast-2": 1.10228, + "eu-central-1": 1.08824, + "eu-north-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.95252, + "us-east-2": 0.95252, + "us-gov-west-1": 1.09292, + "us-west-2": 0.95252 + }, + "r6in.4xlarge": { + "ap-northeast-1": 2.09096, + "ap-southeast-1": 2.06288, + "ap-southeast-2": 2.09096, + "eu-central-1": 2.06288, + "eu-north-1": 1.88504, + "eu-west-1": 1.95992, + "us-east-1": 1.79144, + "us-east-2": 1.79144, + "us-gov-west-1": 2.23978, + "us-west-2": 1.79144 + }, + "r6in.8xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 4.12576, + "ap-southeast-2": 4.18192, + "eu-central-1": 4.45898, + "eu-north-1": 3.77008, + "eu-west-1": 3.91984, + "us-east-1": 3.86181, + "us-east-2": 3.58288, + "us-gov-west-1": 4.14448, + "us-west-2": 0.0 + }, + "r6in.12xlarge": { + "ap-northeast-1": 6.27288, + "ap-southeast-1": 0.0, + "ap-southeast-2": 6.27288, + "eu-central-1": 6.68846, + "eu-north-1": 6.10159, + "eu-west-1": 5.87976, + "us-east-1": 5.37432, + "us-east-2": 5.37432, + "us-gov-west-1": 0.0, + "us-west-2": 5.37432 + }, + "r6in.16xlarge": { + "ap-northeast-1": 8.36384, + "ap-southeast-1": 0.0, + "ap-southeast-2": 8.36384, + "eu-central-1": 8.25152, + "eu-north-1": 8.13546, + "eu-west-1": 8.46493, + "us-east-1": 0.0, + "us-east-2": 7.72362, + "us-gov-west-1": 8.95914, + "us-west-2": 7.16576 + }, + "r6in.24xlarge": { + "ap-northeast-1": 12.54576, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 12.37728, + "eu-north-1": 11.31024, + "eu-west-1": 11.75952, + "us-east-1": 10.74864, + "us-east-2": 11.58542, + "us-gov-west-1": 0.0, + "us-west-2": 11.58542 + }, + "r6in.32xlarge": { + "ap-northeast-1": 16.12608, + "ap-southeast-1": 15.90144, + "ap-southeast-2": 16.12608, + "eu-central-1": 15.90144, + "eu-north-1": 14.47872, + "eu-west-1": 15.07776, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 13.72992 + }, + "r7a.medium": { + "ap-northeast-1": 0.12367, + "eu-central-1": 0.0, + "eu-north-1": 0.1128, + "eu-south-2": 0.11703, + "eu-west-1": 0.11703, + "us-east-1": 0.10798, + "us-east-2": 0.11558, + "us-west-2": 0.10798 + }, + "r7a.large": { + "ap-northeast-1": 0.26569, + "eu-central-1": 0.24734, + "eu-north-1": 0.0, + "eu-south-2": 0.23406, + "eu-west-1": 0.23406, + "us-east-1": 0.21595, + "us-east-2": 0.0, + "us-west-2": 0.21595 + }, + "r7a.xlarge": { + "ap-northeast-1": 0.49468, + "eu-central-1": 0.49468, + "eu-north-1": 0.48356, + "eu-south-2": 0.46812, + "eu-west-1": 0.50217, + "us-east-1": 0.4319, + "us-east-2": 0.0, + "us-west-2": 0.46233 + }, + "r7a.metal-48xl": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 19.392, + "eu-south-2": 20.20416, + "eu-west-1": 20.20416, + "us-east-1": 18.4656, + "us-east-2": 18.4656, + "us-west-2": 18.4656 + }, + "r7a.2xlarge": { + "ap-northeast-1": 0.98936, + "eu-central-1": 0.0, + "eu-north-1": 0.96712, + "eu-south-2": 1.00434, + "eu-west-1": 0.93624, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.8638 + }, + "r7a.4xlarge": { + "ap-northeast-1": 1.86512, + "eu-central-1": 1.86512, + "eu-north-1": 1.6912, + "eu-south-2": 1.75888, + "eu-west-1": 1.75888, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 1.614 + }, + "r7a.8xlarge": { + "ap-northeast-1": 4.0239, + "eu-central-1": 3.73024, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 3.79018, + "us-east-1": 3.228, + "us-east-2": 3.228, + "us-west-2": 3.228 + }, + "r7a.12xlarge": { + "ap-northeast-1": 5.59536, + "eu-central-1": 6.03586, + "eu-north-1": 5.0736, + "eu-south-2": 5.27664, + "eu-west-1": 5.27664, + "us-east-1": 5.20716, + "us-east-2": 4.842, + "us-west-2": 4.842 + }, + "r7a.16xlarge": { + "ap-northeast-1": 7.46048, + "eu-central-1": 7.46048, + "eu-north-1": 0.0, + "eu-south-2": 7.03552, + "eu-west-1": 7.58035, + "us-east-1": 6.94288, + "us-east-2": 6.456, + "us-west-2": 6.456 + }, + "r7a.24xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 12.07171, + "eu-north-1": 10.1472, + "eu-south-2": 10.55328, + "eu-west-1": 10.55328, + "us-east-1": 9.684, + "us-east-2": 10.41432, + "us-west-2": 10.41432 + }, + "r7a.32xlarge": { + "ap-northeast-1": 14.31936, + "eu-central-1": 15.49402, + "eu-north-1": 12.928, + "eu-south-2": 14.5591, + "eu-west-1": 14.5591, + "us-east-1": 12.3104, + "us-east-2": 13.28416, + "us-west-2": 0.0 + }, + "r7a.48xlarge": { + "ap-northeast-1": 21.47904, + "eu-central-1": 21.47904, + "eu-north-1": 19.392, + "eu-south-2": 20.20416, + "eu-west-1": 0.0, + "us-east-1": 18.4656, + "us-east-2": 18.4656, + "us-west-2": 18.4656 + }, + "r7g.medium": { + "ap-east-1": 0.1029, + "ap-northeast-1": 0.0965, + "ap-northeast-2": 0.0965, + "ap-south-1": 0.0694, + "ap-south-2": 0.0694, + "ap-southeast-1": 0.0965, + "ap-southeast-2": 0.1001, + "ap-southeast-5": 0.0868, + "ap-southeast-7": 0.0868, + "ca-central-1": 0.0943, + "eu-central-1": 0.0965, + "eu-north-1": 0.0889, + "eu-south-1": 0.0, + "eu-south-2": 0.0956, + "eu-west-1": 0.0918, + "eu-west-2": 0.0988, + "me-south-1": 0.102, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0855, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "r7g.large": { + "ap-east-1": 0.2058, + "ap-northeast-1": 0.193, + "ap-northeast-2": 0.2011, + "ap-south-1": 0.1436, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1922, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.1736, + "ca-central-1": 0.1811, + "eu-central-1": 0.2011, + "eu-north-1": 0.1777, + "eu-south-1": 0.1893, + "eu-south-2": 0.1836, + "eu-west-1": 0.0, + "eu-west-2": 0.1896, + "me-south-1": 0.2039, + "mx-central-1": 0.1833, + "sa-east-1": 0.0, + "us-east-1": 0.1709, + "us-east-2": 0.1709, + "us-west-1": 0.1828, + "us-west-2": 0.1709 + }, + "r7g.xlarge": { + "ap-east-1": 0.4116, + "ap-northeast-1": 0.386, + "ap-northeast-2": 0.4022, + "ap-south-1": 0.2778, + "ap-south-2": 0.2872, + "ap-southeast-1": 0.4023, + "ap-southeast-2": 0.4005, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.3472, + "ca-central-1": 0.3622, + "eu-central-1": 0.4023, + "eu-north-1": 0.3554, + "eu-south-1": 0.3945, + "eu-south-2": 0.3823, + "eu-west-1": 0.3673, + "eu-west-2": 0.3951, + "me-south-1": 0.4079, + "mx-central-1": 0.3667, + "sa-east-1": 0.4685, + "us-east-1": 0.3418, + "us-east-2": 0.3418, + "us-west-1": 0.0, + "us-west-2": 0.3418 + }, + "r7g.metal": { + "ap-east-1": 6.1312, + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.7216, + "ap-south-1": 3.9898, + "ap-south-2": 0.0, + "ap-southeast-1": 5.7216, + "ap-southeast-2": 5.6947, + "ap-southeast-5": 0.0, + "ap-southeast-7": 5.1014, + "ca-central-1": 5.3408, + "eu-central-1": 5.7216, + "eu-north-1": 5.232, + "eu-south-1": 5.6033, + "eu-south-2": 5.4208, + "eu-west-1": 0.0, + "eu-west-2": 5.6128, + "me-south-1": 5.8059, + "mx-central-1": 5.1859, + "sa-east-1": 0.0, + "us-east-1": 5.0144, + "us-east-2": 5.0144, + "us-west-1": 5.3952, + "us-west-2": 5.0144 + }, + "r7g.2xlarge": { + "ap-east-1": 0.8232, + "ap-northeast-1": 0.772, + "ap-northeast-2": 0.772, + "ap-south-1": 0.5555, + "ap-south-2": 0.5743, + "ap-southeast-1": 0.772, + "ap-southeast-2": 0.801, + "ap-southeast-5": 0.6945, + "ap-southeast-7": 0.6945, + "ca-central-1": 0.7244, + "eu-central-1": 0.0, + "eu-north-1": 0.7108, + "eu-south-1": 0.7889, + "eu-south-2": 0.0, + "eu-west-1": 0.7346, + "eu-west-2": 0.7902, + "me-south-1": 0.7825, + "mx-central-1": 0.7334, + "sa-east-1": 0.937, + "us-east-1": 0.0, + "us-east-2": 0.6836, + "us-west-1": 0.7312, + "us-west-2": 0.0 + }, + "r7g.4xlarge": { + "ap-east-1": 1.5328, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 0.9974, + "ap-south-2": 0.9974, + "ap-southeast-1": 1.4304, + "ap-southeast-2": 1.4237, + "ap-southeast-5": 1.2754, + "ap-southeast-7": 1.2754, + "ca-central-1": 1.3352, + "eu-central-1": 1.4304, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 1.4156, + "eu-west-1": 1.416, + "eu-west-2": 1.4032, + "me-south-1": 1.4515, + "mx-central-1": 1.2965, + "sa-east-1": 1.7603, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 0.0, + "us-west-2": 1.3076 + }, + "r7g.8xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 2.991, + "ap-northeast-2": 2.9907, + "ap-south-1": 2.0701, + "ap-south-2": 1.9949, + "ap-southeast-1": 2.991, + "ap-southeast-2": 2.8474, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.6614, + "ca-central-1": 2.6704, + "eu-central-1": 2.8608, + "eu-north-1": 2.616, + "eu-south-1": 2.9285, + "eu-south-2": 2.7104, + "eu-west-1": 2.832, + "eu-west-2": 0.0, + "me-south-1": 0.0, + "mx-central-1": 2.593, + "sa-east-1": 3.6928, + "us-east-1": 0.0, + "us-east-2": 2.5072, + "us-west-1": 2.6976, + "us-west-2": 2.5072 + }, + "r7g.12xlarge": { + "ap-east-1": 4.5984, + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.2912, + "ap-south-1": 3.1051, + "ap-south-2": 2.9923, + "ap-southeast-1": 4.2912, + "ap-southeast-2": 4.271, + "ap-southeast-5": 3.9921, + "ap-southeast-7": 3.8261, + "ca-central-1": 4.0056, + "eu-central-1": 0.0, + "eu-north-1": 3.924, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 4.0668, + "eu-west-2": 4.2096, + "me-south-1": 4.3544, + "mx-central-1": 3.8894, + "sa-east-1": 5.281, + "us-east-1": 3.7608, + "us-east-2": 3.7608, + "us-west-1": 4.0464, + "us-west-2": 0.0 + }, + "r7g.16xlarge": { + "ap-east-1": 6.1312, + "ap-northeast-1": 5.7216, + "ap-northeast-2": 5.7216, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 5.7216, + "ap-southeast-2": 5.6947, + "ap-southeast-5": 5.1014, + "ap-southeast-7": 5.1014, + "ca-central-1": 5.3408, + "eu-central-1": 5.7216, + "eu-north-1": 5.232, + "eu-south-1": 5.6033, + "eu-south-2": 5.4208, + "eu-west-1": 5.4224, + "eu-west-2": 5.6128, + "me-south-1": 5.8059, + "mx-central-1": 5.1859, + "sa-east-1": 7.0413, + "us-east-1": 0.0, + "us-east-2": 5.0144, + "us-west-1": 5.3952, + "us-west-2": 0.0 + }, + "r7gd.medium": { + "ap-east-1": 0.1146, + "ap-northeast-1": 0.1141, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1149, + "ap-southeast-3": 0.1141, + "ap-southeast-5": 0.1018, + "ap-southeast-7": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.1037, + "eu-south-2": 0.0, + "eu-west-1": 0.1075, + "me-central-1": 0.12, + "mx-central-1": 0.1076, + "us-east-1": 0.0, + "us-east-2": 0.0999, + "us-gov-east-1": 0.1136, + "us-gov-west-1": 0.1137, + "us-west-1": 0.1084, + "us-west-2": 0.104 + }, + "r7gd.large": { + "ap-east-1": 0.2292, + "ap-northeast-1": 0.2381, + "ap-south-1": 0.1518, + "ap-southeast-1": 0.2282, + "ap-southeast-2": 0.2204, + "ap-southeast-3": 0.2381, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.2119, + "eu-central-1": 0.2273, + "eu-north-1": 0.0, + "eu-south-2": 0.215, + "eu-west-1": 0.215, + "me-central-1": 0.2301, + "mx-central-1": 0.2067, + "us-east-1": 0.1999, + "us-east-2": 0.208, + "us-gov-east-1": 0.2273, + "us-gov-west-1": 0.0, + "us-west-1": 0.2169, + "us-west-2": 0.0 + }, + "r7gd.xlarge": { + "ap-east-1": 0.4584, + "ap-northeast-1": 0.4565, + "ap-south-1": 0.3036, + "ap-southeast-1": 0.4565, + "ap-southeast-2": 0.4408, + "ap-southeast-3": 0.4564, + "ap-southeast-5": 0.4071, + "ap-southeast-7": 0.4239, + "eu-central-1": 0.4742, + "eu-north-1": 0.4321, + "eu-south-2": 0.43, + "eu-west-1": 0.43, + "me-central-1": 0.0, + "mx-central-1": 0.4134, + "us-east-1": 0.3998, + "us-east-2": 0.3998, + "us-gov-east-1": 0.4546, + "us-gov-west-1": 0.4743, + "us-west-1": 0.4338, + "us-west-2": 0.3998 + }, + "r7gd.metal": { + "ap-east-1": 6.8794, + "ap-northeast-1": 0.0, + "ap-south-1": 4.4032, + "ap-southeast-1": 6.849, + "ap-southeast-2": 0.0, + "ap-southeast-3": 6.8486, + "ap-southeast-5": 0.0, + "ap-southeast-7": 6.0595, + "eu-central-1": 6.8187, + "eu-north-1": 6.1837, + "eu-south-2": 0.0, + "eu-west-1": 6.4256, + "me-central-1": 0.0, + "mx-central-1": 6.1594, + "us-east-1": 5.9418, + "us-east-2": 5.9418, + "us-gov-east-1": 6.8186, + "us-gov-west-1": 6.8205, + "us-west-1": 6.4861, + "us-west-2": 5.9418 + }, + "r7gd.2xlarge": { + "ap-east-1": 0.9167, + "ap-northeast-1": 0.9129, + "ap-south-1": 0.6283, + "ap-southeast-1": 0.9129, + "ap-southeast-2": 0.8816, + "ap-southeast-3": 0.9129, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "eu-central-1": 0.9091, + "eu-north-1": 0.0, + "eu-south-2": 0.8963, + "eu-west-1": 0.86, + "me-central-1": 0.9604, + "mx-central-1": 0.8267, + "us-east-1": 0.8321, + "us-east-2": 0.0, + "us-gov-east-1": 0.9484, + "us-gov-west-1": 0.9094, + "us-west-1": 0.8676, + "us-west-2": 0.7995 + }, + "r7gd.4xlarge": { + "ap-east-1": 1.7198, + "ap-northeast-1": 1.7122, + "ap-south-1": 1.1008, + "ap-southeast-1": 1.7122, + "ap-southeast-2": 1.7248, + "ap-southeast-3": 1.7911, + "ap-southeast-5": 1.5149, + "ap-southeast-7": 1.5149, + "eu-central-1": 1.7047, + "eu-north-1": 1.5459, + "eu-south-2": 1.679, + "eu-west-1": 1.6064, + "me-central-1": 0.0, + "mx-central-1": 1.6083, + "us-east-1": 0.0, + "us-east-2": 1.5506, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 1.6215, + "us-west-2": 0.0 + }, + "r7gd.8xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 3.5823, + "ap-south-1": 2.2861, + "ap-southeast-1": 3.5823, + "ap-southeast-2": 3.4495, + "ap-southeast-3": 0.0, + "ap-southeast-5": 3.1639, + "ap-southeast-7": 0.0, + "eu-central-1": 3.4094, + "eu-north-1": 3.0918, + "eu-south-2": 3.2128, + "eu-west-1": 3.2128, + "me-central-1": 3.4547, + "mx-central-1": 3.0797, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 3.4093, + "us-gov-west-1": 3.4102, + "us-west-1": 3.39, + "us-west-2": 2.9709 + }, + "r7gd.12xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 5.1367, + "ap-south-1": 3.4291, + "ap-southeast-1": 5.1367, + "ap-southeast-2": 0.0, + "ap-southeast-3": 5.3732, + "ap-southeast-5": 4.5446, + "ap-southeast-7": 4.5446, + "eu-central-1": 5.114, + "eu-north-1": 4.8446, + "eu-south-2": 0.0, + "eu-west-1": 4.8192, + "me-central-1": 5.1821, + "mx-central-1": 4.6195, + "us-east-1": 4.4563, + "us-east-2": 4.4563, + "us-gov-east-1": 5.3493, + "us-gov-west-1": 5.1154, + "us-west-1": 4.8646, + "us-west-2": 4.4563 + }, + "r7gd.16xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 6.849, + "ap-south-1": 4.4032, + "ap-southeast-1": 6.849, + "ap-southeast-2": 0.0, + "ap-southeast-3": 6.8486, + "ap-southeast-5": 0.0, + "ap-southeast-7": 6.0595, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 6.4256, + "eu-west-1": 6.4256, + "me-central-1": 6.9094, + "mx-central-1": 6.1594, + "us-east-1": 5.9418, + "us-east-2": 0.0, + "us-gov-east-1": 6.8186, + "us-gov-west-1": 6.8205, + "us-west-1": 0.0, + "us-west-2": 5.9418 + }, + "r7i.large": { + "ap-northeast-1": 0.2234, + "ap-northeast-2": 0.2234, + "ap-south-1": 0.2003, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.22235, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.21303, + "ap-southeast-7": 0.19946, + "ca-central-1": 0.2087, + "eu-central-1": 0.2234, + "eu-north-1": 0.0, + "eu-south-1": 0.2192, + "eu-south-2": 0.21185, + "eu-west-1": 0.22666, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "mx-central-1": 0.21661, + "sa-east-1": 0.0, + "us-east-1": 0.1961, + "us-east-2": 0.1961, + "us-gov-east-1": 0.22235, + "us-gov-west-1": 0.0, + "us-west-1": 0.2108, + "us-west-2": 0.1961 + }, + "r7i.xlarge": { + "ap-northeast-1": 0.4468, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.4468, + "ap-southeast-2": 0.4447, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.42605, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.4468, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.4237, + "eu-west-2": 0.4384, + "eu-west-3": 0.4384, + "mx-central-1": 0.43322, + "sa-east-1": 0.0, + "us-east-1": 0.3922, + "us-east-2": 0.0, + "us-gov-east-1": 0.4447, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.41866 + }, + "r7i.metal-24xl": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 10.0416, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 9.9912, + "ap-southeast-3": 0.0, + "ap-southeast-5": 8.89248, + "ap-southeast-7": 0.0, + "ca-central-1": 10.03152, + "eu-central-1": 10.0416, + "eu-north-1": 0.0, + "eu-south-1": 9.84, + "eu-south-2": 10.19784, + "eu-west-1": 9.4872, + "eu-west-2": 9.84, + "eu-west-3": 9.84, + "mx-central-1": 9.04896, + "sa-east-1": 12.5112, + "us-east-1": 9.36624, + "us-east-2": 8.7312, + "us-gov-east-1": 10.75224, + "us-gov-west-1": 9.9912, + "us-west-1": 9.4368, + "us-west-2": 9.36624 + }, + "r7i.metal-48xl": { + "ap-northeast-1": 19.1808, + "ap-northeast-2": 19.1808, + "ap-south-1": 16.9632, + "ap-southeast-1": 19.1808, + "ap-southeast-2": 19.08, + "ap-southeast-3": 19.1808, + "ap-southeast-5": 16.88256, + "ap-southeast-7": 16.88256, + "ca-central-1": 0.0, + "eu-central-1": 19.1808, + "eu-north-1": 17.3664, + "eu-south-1": 18.7776, + "eu-south-2": 0.0, + "eu-west-1": 18.072, + "eu-west-2": 18.7776, + "eu-west-3": 18.7776, + "mx-central-1": 17.19552, + "sa-east-1": 24.12, + "us-east-1": 16.56, + "us-east-2": 0.0, + "us-gov-east-1": 19.08, + "us-gov-west-1": 0.0, + "us-west-1": 17.9712, + "us-west-2": 16.56 + }, + "r7i.2xlarge": { + "ap-northeast-1": 0.8936, + "ap-northeast-2": 0.8936, + "ap-south-1": 0.8012, + "ap-southeast-1": 0.95744, + "ap-southeast-2": 0.8894, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.79784, + "ap-southeast-7": 0.79784, + "ca-central-1": 0.0, + "eu-central-1": 0.8936, + "eu-north-1": 0.87428, + "eu-south-1": 0.0, + "eu-south-2": 0.8474, + "eu-west-1": 0.8474, + "eu-west-2": 0.93896, + "eu-west-3": 0.8768, + "mx-central-1": 0.0, + "sa-east-1": 1.0994, + "us-east-1": 0.7844, + "us-east-2": 0.7844, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.8894, + "us-west-1": 0.8432, + "us-west-2": 0.7844 + }, + "r7i.4xlarge": { + "ap-northeast-1": 1.6736, + "ap-northeast-2": 1.80128, + "ap-south-1": 1.4888, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.6736, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.59061, + "ca-central-1": 1.556, + "eu-central-1": 1.6736, + "eu-north-1": 1.5224, + "eu-south-1": 1.64, + "eu-south-2": 1.5812, + "eu-west-1": 0.0, + "eu-west-2": 1.76432, + "eu-west-3": 1.76432, + "mx-central-1": 0.0, + "sa-east-1": 2.0852, + "us-east-1": 1.4552, + "us-east-2": 1.4552, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.6652, + "us-west-1": 1.6904, + "us-west-2": 0.0 + }, + "r7i.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.60256, + "ap-south-1": 2.9776, + "ap-southeast-1": 3.3472, + "ap-southeast-2": 3.58408, + "ap-southeast-3": 3.3472, + "ap-southeast-5": 0.0, + "ap-southeast-7": 3.18122, + "ca-central-1": 3.112, + "eu-central-1": 3.60256, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 3.1624, + "eu-west-1": 3.1624, + "eu-west-2": 3.28, + "eu-west-3": 0.0, + "mx-central-1": 3.01632, + "sa-east-1": 4.1704, + "us-east-1": 2.9104, + "us-east-2": 2.9104, + "us-gov-east-1": 3.3304, + "us-gov-west-1": 3.3304, + "us-west-1": 3.1456, + "us-west-2": 3.12208 + }, + "r7i.12xlarge": { + "ap-northeast-1": 5.0208, + "ap-northeast-2": 5.0208, + "ap-south-1": 4.794, + "ap-southeast-1": 5.0208, + "ap-southeast-2": 4.9956, + "ap-southeast-3": 5.0208, + "ap-southeast-5": 4.44624, + "ap-southeast-7": 4.44624, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 4.5672, + "eu-south-1": 4.92, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 4.92, + "eu-west-3": 4.92, + "mx-central-1": 4.52448, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 4.3656, + "us-gov-east-1": 5.37612, + "us-gov-west-1": 4.9956, + "us-west-1": 0.0, + "us-west-2": 4.3656 + }, + "r7i.16xlarge": { + "ap-northeast-1": 6.6944, + "ap-northeast-2": 6.6944, + "ap-south-1": 5.9552, + "ap-southeast-1": 6.6944, + "ap-southeast-2": 0.0, + "ap-southeast-3": 6.6944, + "ap-southeast-5": 5.92832, + "ap-southeast-7": 5.92832, + "ca-central-1": 6.68768, + "eu-central-1": 6.6944, + "eu-north-1": 0.0, + "eu-south-1": 7.05728, + "eu-south-2": 0.0, + "eu-west-1": 6.3248, + "eu-west-2": 6.56, + "eu-west-3": 6.56, + "mx-central-1": 6.03264, + "sa-east-1": 9.01616, + "us-east-1": 0.0, + "us-east-2": 6.24416, + "us-gov-east-1": 6.6608, + "us-gov-west-1": 7.16816, + "us-west-1": 6.2912, + "us-west-2": 5.8208 + }, + "r7i.24xlarge": { + "ap-northeast-1": 10.0416, + "ap-northeast-2": 10.0416, + "ap-south-1": 8.9328, + "ap-southeast-1": 10.0416, + "ap-southeast-2": 9.9912, + "ap-southeast-3": 10.0416, + "ap-southeast-5": 8.89248, + "ap-southeast-7": 9.54365, + "ca-central-1": 0.0, + "eu-central-1": 10.0416, + "eu-north-1": 9.1344, + "eu-south-1": 9.84, + "eu-south-2": 9.4872, + "eu-west-1": 9.4872, + "eu-west-2": 9.84, + "eu-west-3": 9.84, + "mx-central-1": 0.0, + "sa-east-1": 12.5112, + "us-east-1": 8.7312, + "us-east-2": 8.7312, + "us-gov-east-1": 9.9912, + "us-gov-west-1": 0.0, + "us-west-1": 9.4368, + "us-west-2": 9.36624 + }, + "r7i.48xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 16.9632, + "ap-southeast-1": 19.1808, + "ap-southeast-2": 19.08, + "ap-southeast-3": 19.1808, + "ap-southeast-5": 16.88256, + "ap-southeast-7": 16.88256, + "ca-central-1": 17.7696, + "eu-central-1": 0.0, + "eu-north-1": 17.3664, + "eu-south-1": 18.7776, + "eu-south-2": 18.072, + "eu-west-1": 0.0, + "eu-west-2": 18.7776, + "eu-west-3": 18.7776, + "mx-central-1": 0.0, + "sa-east-1": 24.12, + "us-east-1": 16.56, + "us-east-2": 16.56, + "us-gov-east-1": 19.08, + "us-gov-west-1": 19.08, + "us-west-1": 17.9712, + "us-west-2": 0.0 + }, + "r7iz.large": { + "ap-northeast-1": 0.2908, + "eu-central-1": 0.2888, + "eu-west-1": 0.0, + "us-east-1": 0.2498, + "us-east-2": 0.2498, + "us-west-2": 0.0 + }, + "r7iz.xlarge": { + "ap-northeast-1": 0.5816, + "eu-central-1": 0.0, + "eu-west-1": 0.5436, + "us-east-1": 0.4996, + "us-east-2": 0.4996, + "us-west-2": 0.4996 + }, + "r7iz.metal-16xl": { + "ap-northeast-1": 8.8512, + "eu-central-1": 9.5072, + "eu-west-1": 0.0, + "us-east-1": 8.1344, + "us-east-2": 7.5392, + "us-west-2": 7.5392 + }, + "r7iz.metal-32xl": { + "ap-northeast-1": 17.1008, + "eu-central-1": 16.9728, + "eu-west-1": 15.8848, + "us-east-1": 15.6672, + "us-east-2": 15.6672, + "us-west-2": 0.0 + }, + "r7iz.2xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 1.1552, + "eu-west-1": 1.1704, + "us-east-1": 0.9992, + "us-east-2": 0.0, + "us-west-2": 0.9992 + }, + "r7iz.4xlarge": { + "ap-northeast-1": 2.3944, + "eu-central-1": 2.1968, + "eu-west-1": 0.0, + "us-east-1": 1.8848, + "us-east-2": 1.8848, + "us-west-2": 0.0 + }, + "r7iz.8xlarge": { + "ap-northeast-1": 4.7888, + "eu-central-1": 0.0, + "eu-west-1": 4.4544, + "us-east-1": 3.7696, + "us-east-2": 3.7696, + "us-west-2": 3.7696 + }, + "r7iz.12xlarge": { + "ap-northeast-1": 6.6384, + "eu-central-1": 6.5904, + "eu-west-1": 6.1824, + "us-east-1": 6.1008, + "us-east-2": 6.1008, + "us-west-2": 6.1008 + }, + "r7iz.16xlarge": { + "ap-northeast-1": 8.8512, + "eu-central-1": 8.7872, + "eu-west-1": 0.0, + "us-east-1": 8.1344, + "us-east-2": 8.1344, + "us-west-2": 7.5392 + }, + "r7iz.32xlarge": { + "ap-northeast-1": 17.1008, + "eu-central-1": 16.9728, + "eu-west-1": 15.8848, + "us-east-1": 14.4768, + "us-east-2": 14.4768, + "us-west-2": 15.6672 + }, + "r8g.medium": { + "ap-northeast-1": 0.10296, + "ap-south-1": 0.07319, + "ap-southeast-2": 0.0, + "eu-central-1": 0.10296, + "eu-north-1": 0.09455, + "eu-south-2": 0.09779, + "eu-west-1": 0.09782, + "us-east-1": 0.09081, + "us-east-2": 0.0967, + "us-west-2": 0.09081 + }, + "r8g.large": { + "ap-northeast-1": 0.20592, + "ap-south-1": 0.15464, + "ap-southeast-2": 0.205, + "eu-central-1": 0.0, + "eu-north-1": 0.20162, + "eu-south-2": 0.0, + "eu-west-1": 0.19564, + "us-east-1": 0.18162, + "us-east-2": 0.18162, + "us-west-2": 0.18162 + }, + "r8g.xlarge": { + "ap-northeast-1": 0.41184, + "ap-south-1": 0.29276, + "ap-southeast-2": 0.43824, + "eu-central-1": 0.41184, + "eu-north-1": 0.37818, + "eu-south-2": 0.39116, + "eu-west-1": 0.41765, + "us-east-1": 0.3868, + "us-east-2": 0.0, + "us-west-2": 0.36324 + }, + "r8g.metal-24xl": { + "ap-northeast-1": 9.20256, + "ap-south-1": 6.34464, + "ap-southeast-2": 9.1584, + "eu-central-1": 9.88474, + "eu-north-1": 8.39472, + "eu-south-2": 0.0, + "eu-west-1": 9.34195, + "us-east-1": 8.03616, + "us-east-2": 8.03616, + "us-west-2": 0.0 + }, + "r8g.metal-48xl": { + "ap-northeast-1": 17.50272, + "ap-south-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 17.50272, + "eu-north-1": 0.0, + "eu-south-2": 16.51008, + "eu-west-1": 16.51584, + "us-east-1": 0.0, + "us-east-2": 15.16992, + "us-west-2": 15.16992 + }, + "r8g.2xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.58552, + "ap-southeast-2": 0.87648, + "eu-central-1": 0.82368, + "eu-north-1": 0.0, + "eu-south-2": 0.78232, + "eu-west-1": 0.78256, + "us-east-1": 0.72648, + "us-east-2": 0.72648, + "us-west-2": 0.72648 + }, + "r8g.4xlarge": { + "ap-northeast-1": 1.64746, + "ap-south-1": 1.05744, + "ap-southeast-2": 1.63936, + "eu-central-1": 1.53376, + "eu-north-1": 1.49935, + "eu-south-2": 1.45104, + "eu-west-1": 1.45152, + "us-east-1": 1.33936, + "us-east-2": 1.33936, + "us-west-2": 0.0 + }, + "r8g.8xlarge": { + "ap-northeast-1": 3.06752, + "ap-south-1": 2.11488, + "ap-southeast-2": 0.0, + "eu-central-1": 3.06752, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 3.11398, + "us-east-1": 2.67872, + "us-east-2": 0.0, + "us-west-2": 2.67872 + }, + "r8g.12xlarge": { + "ap-northeast-1": 4.60128, + "ap-south-1": 3.17232, + "ap-southeast-2": 4.5792, + "eu-central-1": 4.60128, + "eu-north-1": 4.19736, + "eu-south-2": 0.0, + "eu-west-1": 4.35456, + "us-east-1": 4.01808, + "us-east-2": 4.01808, + "us-west-2": 4.01808 + }, + "r8g.16xlarge": { + "ap-northeast-1": 6.58982, + "ap-south-1": 4.22976, + "ap-southeast-2": 6.1056, + "eu-central-1": 6.13504, + "eu-north-1": 0.0, + "eu-south-2": 5.80416, + "eu-west-1": 5.80608, + "us-east-1": 0.0, + "us-east-2": 5.35744, + "us-west-2": 5.73446 + }, + "r8g.24xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.0, + "ap-southeast-2": 9.1584, + "eu-central-1": 0.0, + "eu-north-1": 8.39472, + "eu-south-2": 8.70624, + "eu-west-1": 9.34195, + "us-east-1": 8.03616, + "us-east-2": 8.03616, + "us-west-2": 0.0 + }, + "r8g.48xlarge": { + "ap-northeast-1": 17.50272, + "ap-south-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 17.50272, + "eu-north-1": 15.88704, + "eu-south-2": 0.0, + "eu-west-1": 16.51584, + "us-east-1": 15.16992, + "us-east-2": 15.16992, + "us-west-2": 15.16992 + }, + "t2.micro": { + "ap-northeast-1": 0.0471, + "ap-northeast-2": 0.0463, + "ap-northeast-3": 0.0471, + "ap-south-1": 0.0443, + "ap-southeast-1": 0.0465, + "ap-southeast-2": 0.0465, + "ca-central-1": 0.0447, + "eu-central-1": 0.0453, + "eu-west-1": 0.0445, + "eu-west-2": 0.0451, + "eu-west-3": 0.0451, + "sa-east-1": 0.0505, + "us-east-1": 0.0435, + "us-east-2": 0.0435, + "us-gov-west-1": 0.0455, + "us-west-1": 0.0457, + "us-west-2": 0.0435 + }, + "t2.small": { + "ap-northeast-1": 0.0623, + "ap-northeast-2": 0.0607, + "ap-northeast-3": 0.0623, + "ap-south-1": 0.0567, + "ap-southeast-1": 0.0611, + "ap-southeast-2": 0.0611, + "ca-central-1": 0.0575, + "eu-central-1": 0.0587, + "eu-west-1": 0.0571, + "eu-west-2": 0.0583, + "eu-west-3": 0.0583, + "sa-east-1": 0.0691, + "us-east-1": 0.0551, + "us-east-2": 0.0551, + "us-gov-west-1": 0.0591, + "us-west-1": 0.0595, + "us-west-2": 0.0551 + }, + "t2.medium": { + "ap-northeast-1": 0.1246, + "ap-northeast-2": 0.1214, + "ap-northeast-3": 0.1246, + "ap-south-1": 0.1134, + "ap-southeast-1": 0.1222, + "ap-southeast-2": 0.1222, + "ca-central-1": 0.115, + "eu-central-1": 0.1174, + "eu-west-1": 0.1142, + "eu-west-2": 0.1166, + "eu-west-3": 0.1166, + "sa-east-1": 0.1382, + "us-east-1": 0.1102, + "us-east-2": 0.1102, + "us-gov-west-1": 0.1182, + "us-west-1": 0.119, + "us-west-2": 0.1102 + }, + "t2.large": { + "ap-northeast-1": 0.1854, + "ap-northeast-2": 0.179, + "ap-northeast-3": 0.1854, + "ap-south-1": 0.163, + "ap-southeast-1": 0.1806, + "ap-southeast-2": 0.1806, + "ca-central-1": 0.1662, + "eu-central-1": 0.171, + "eu-west-1": 0.1646, + "eu-west-2": 0.1694, + "eu-west-3": 0.1694, + "sa-east-1": 0.2126, + "us-east-1": 0.1566, + "us-east-2": 0.1566, + "us-gov-west-1": 0.1726, + "us-west-1": 0.1742, + "us-west-2": 0.1566 + }, + "t2.xlarge": { + "ap-northeast-1": 0.3708, + "ap-northeast-2": 0.358, + "ap-northeast-3": 0.3708, + "ap-south-1": 0.326, + "ap-southeast-1": 0.3612, + "ap-southeast-2": 0.3612, + "ca-central-1": 0.3324, + "eu-central-1": 0.342, + "eu-west-1": 0.3292, + "eu-west-2": 0.3388, + "eu-west-3": 0.3388, + "sa-east-1": 0.4252, + "us-east-1": 0.3132, + "us-east-2": 0.3132, + "us-gov-west-1": 0.3452, + "us-west-1": 0.3484, + "us-west-2": 0.3132 + }, + "t2.2xlarge": { + "ap-northeast-1": 0.7416, + "ap-northeast-2": 0.716, + "ap-northeast-3": 0.7416, + "ap-south-1": 0.652, + "ap-southeast-1": 0.7224, + "ap-southeast-2": 0.7224, + "ca-central-1": 0.6648, + "eu-central-1": 0.684, + "eu-west-1": 0.6584, + "eu-west-2": 0.6776, + "eu-west-3": 0.6776, + "sa-east-1": 0.8504, + "us-east-1": 0.6264, + "us-east-2": 0.6264, + "us-gov-west-1": 0.6904, + "us-west-1": 0.6968, + "us-west-2": 0.6264 + }, + "t3.micro": { + "af-south-1": 0.0774, + "ap-east-1": 0.0784, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0768, + "ap-northeast-3": 0.0774, + "ap-south-1": 0.0, + "ap-south-2": 0.075, + "ap-southeast-1": 0.077, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.077, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0757, + "ap-southeast-7": 0.0757, + "ca-central-1": 0.0754, + "ca-west-1": 0.0754, + "eu-central-1": 0.0, + "eu-central-2": 0.077, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0752, + "eu-west-2": 0.0, + "eu-west-3": 0.0756, + "il-central-1": 0.0758, + "me-central-1": 0.0763, + "me-south-1": 0.0763, + "mx-central-1": 0.0747, + "sa-east-1": 0.0806, + "us-east-1": 0.0, + "us-east-2": 0.0742, + "us-gov-east-1": 0.076, + "us-gov-west-1": 0.076, + "us-west-1": 0.0, + "us-west-2": 0.0742, + "us-west-2-lax-1": 0.0763 + }, + "t3.small": { + "af-south-1": 0.0, + "ap-east-1": 0.093, + "ap-northeast-1": 0.091, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.091, + "ap-south-1": 0.0862, + "ap-south-2": 0.0862, + "ap-southeast-1": 0.0918, + "ap-southeast-2": 0.0902, + "ap-southeast-3": 0.0902, + "ap-southeast-4": 0.0902, + "ap-southeast-5": 0.0876, + "ap-southeast-7": 0.0876, + "ca-central-1": 0.087, + "ca-west-1": 0.087, + "eu-central-1": 0.0878, + "eu-central-2": 0.0, + "eu-north-1": 0.0854, + "eu-south-1": 0.0878, + "eu-south-2": 0.0866, + "eu-west-1": 0.0866, + "eu-west-2": 0.0874, + "eu-west-3": 0.0888, + "il-central-1": 0.0878, + "me-central-1": 0.0889, + "me-south-1": 0.0889, + "mx-central-1": 0.0856, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0882, + "us-gov-west-1": 0.0, + "us-west-1": 0.0886, + "us-west-2": 0.0846, + "us-west-2-lax-1": 0.0888 + }, + "t3.medium": { + "af-south-1": 0.118, + "ap-east-1": 0.1222, + "ap-northeast-1": 0.1182, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.1086, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1166, + "ap-southeast-4": 0.1166, + "ap-southeast-5": 0.1113, + "ap-southeast-7": 0.1113, + "ca-central-1": 0.1102, + "ca-west-1": 0.1102, + "eu-central-1": 0.1118, + "eu-central-2": 0.0, + "eu-north-1": 0.107, + "eu-south-1": 0.1117, + "eu-south-2": 0.1094, + "eu-west-1": 0.1121, + "eu-west-2": 0.111, + "eu-west-3": 0.1138, + "il-central-1": 0.1146, + "me-central-1": 0.114, + "me-south-1": 0.114, + "mx-central-1": 0.1075, + "sa-east-1": 0.0, + "us-east-1": 0.1054, + "us-east-2": 0.1054, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.1126, + "us-west-1": 0.1134, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.1137 + }, + "t3.large": { + "af-south-1": 0.0, + "ap-east-1": 0.1806, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1678, + "ap-northeast-3": 0.1726, + "ap-south-1": 0.1534, + "ap-south-2": 0.1534, + "ap-southeast-1": 0.1757, + "ap-southeast-2": 0.1694, + "ap-southeast-3": 0.1694, + "ap-southeast-4": 0.1694, + "ap-southeast-5": 0.1588, + "ap-southeast-7": 0.1588, + "ca-central-1": 0.1566, + "ca-west-1": 0.1566, + "eu-central-1": 0.1598, + "eu-central-2": 0.1694, + "eu-north-1": 0.1502, + "eu-south-1": 0.0, + "eu-south-2": 0.155, + "eu-west-1": 0.155, + "eu-west-2": 0.1582, + "eu-west-3": 0.1639, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 0.1641, + "mx-central-1": 0.1512, + "sa-east-1": 0.1982, + "us-east-1": 0.0, + "us-east-2": 0.147, + "us-gov-east-1": 0.1614, + "us-gov-west-1": 0.1673, + "us-west-1": 0.0, + "us-west-2": 0.147, + "us-west-2-lax-1": 0.1636 + }, + "t3.xlarge": { + "af-south-1": 0.3446, + "ap-east-1": 0.3612, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.3356, + "ap-northeast-3": 0.3452, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.3388, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.3388, + "ap-southeast-5": 0.3177, + "ap-southeast-7": 0.3177, + "ca-central-1": 0.0, + "ca-west-1": 0.3132, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.3193, + "eu-south-2": 0.31, + "eu-west-1": 0.3209, + "eu-west-2": 0.3164, + "eu-west-3": 0.0, + "il-central-1": 0.3193, + "me-central-1": 0.3282, + "me-south-1": 0.0, + "mx-central-1": 0.3023, + "sa-east-1": 0.3964, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.3345, + "us-west-1": 0.0, + "us-west-2": 0.294, + "us-west-2-lax-1": 0.3273 + }, + "t3.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.7224, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.6712, + "ap-northeast-3": 0.6904, + "ap-south-1": 0.0, + "ap-south-2": 0.6136, + "ap-southeast-1": 0.6776, + "ap-southeast-2": 0.6776, + "ap-southeast-3": 0.6776, + "ap-southeast-4": 0.7029, + "ap-southeast-5": 0.6354, + "ap-southeast-7": 0.6354, + "ca-central-1": 0.0, + "ca-west-1": 0.6264, + "eu-central-1": 0.6392, + "eu-central-2": 0.6776, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.6419, + "eu-west-2": 0.6328, + "eu-west-3": 0.6555, + "il-central-1": 0.0, + "me-central-1": 0.6565, + "me-south-1": 0.6565, + "mx-central-1": 0.6046, + "sa-east-1": 0.7928, + "us-east-1": 0.588, + "us-east-2": 0.588, + "us-gov-east-1": 0.6456, + "us-gov-west-1": 0.6456, + "us-west-1": 0.652, + "us-west-2": 0.588, + "us-west-2-lax-1": 0.6546 + }, + "t3a.micro": { + "ap-northeast-1": 0.076, + "ap-northeast-2": 0.0755, + "ap-south-1": 0.07, + "ap-southeast-1": 0.0756, + "ap-southeast-2": 0.0757, + "ca-central-1": 0.0742, + "eu-central-1": 0.0746, + "eu-south-1": 0.0746, + "eu-west-1": 0.074, + "eu-west-2": 0.0744, + "eu-west-3": 0.0744, + "il-central-1": 0.0745, + "sa-east-1": 0.0789, + "us-east-1": 0.0732, + "us-east-2": 0.0732, + "us-gov-east-1": 0.0748, + "us-gov-west-1": 0.0748, + "us-west-1": 0.075, + "us-west-2": 0.0732 + }, + "t3a.small": { + "ap-northeast-1": 0.0883, + "ap-northeast-2": 0.0872, + "ap-south-1": 0.0761, + "ap-southeast-1": 0.0874, + "ap-southeast-2": 0.0876, + "ca-central-1": 0.0847, + "eu-central-1": 0.0854, + "eu-south-1": 0.0854, + "eu-west-1": 0.0842, + "eu-west-2": 0.085, + "eu-west-3": 0.085, + "il-central-1": 0.0852, + "sa-east-1": 0.094, + "us-east-1": 0.0826, + "us-east-2": 0.0826, + "us-gov-east-1": 0.0858, + "us-gov-west-1": 0.0858, + "us-west-1": 0.0861, + "us-west-2": 0.0826 + }, + "t3a.medium": { + "ap-northeast-1": 0.1128, + "ap-northeast-2": 0.1106, + "ap-south-1": 0.0884, + "ap-southeast-1": 0.111, + "ap-southeast-2": 0.1113, + "ca-central-1": 0.1056, + "eu-central-1": 0.107, + "eu-south-1": 0.1069, + "eu-west-1": 0.1046, + "eu-west-2": 0.1063, + "eu-west-3": 0.1063, + "il-central-1": 0.1067, + "sa-east-1": 0.1243, + "us-east-1": 0.1014, + "us-east-2": 0.1014, + "us-gov-east-1": 0.1077, + "us-gov-west-1": 0.1077, + "us-west-1": 0.1084, + "us-west-2": 0.1014 + }, + "t3a.large": { + "ap-northeast-1": 0.1617, + "ap-northeast-2": 0.1574, + "ap-south-1": 0.1131, + "ap-southeast-1": 0.1582, + "ap-southeast-2": 0.1588, + "ca-central-1": 0.1473, + "eu-central-1": 0.1502, + "eu-south-1": 0.15, + "eu-west-1": 0.1454, + "eu-west-2": 0.1488, + "eu-west-3": 0.1488, + "il-central-1": 0.1496, + "sa-east-1": 0.1848, + "us-east-1": 0.139, + "us-east-2": 0.139, + "us-gov-east-1": 0.1516, + "us-gov-west-1": 0.1516, + "us-west-1": 0.1531, + "us-west-2": 0.139 + }, + "t3a.xlarge": { + "ap-northeast-1": 0.3234, + "ap-northeast-2": 0.3148, + "ap-south-1": 0.2262, + "ap-southeast-1": 0.3164, + "ap-southeast-2": 0.3177, + "ca-central-1": 0.2946, + "eu-central-1": 0.3004, + "eu-south-1": 0.3001, + "eu-west-1": 0.2908, + "eu-west-2": 0.2975, + "eu-west-3": 0.2975, + "il-central-1": 0.2991, + "sa-east-1": 0.3695, + "us-east-1": 0.278, + "us-east-2": 0.278, + "us-gov-east-1": 0.3033, + "us-gov-west-1": 0.3033, + "us-west-1": 0.3062, + "us-west-2": 0.278 + }, + "t3a.2xlarge": { + "ap-northeast-1": 0.6469, + "ap-northeast-2": 0.6296, + "ap-south-1": 0.4523, + "ap-southeast-1": 0.6328, + "ap-southeast-2": 0.6354, + "ca-central-1": 0.5893, + "eu-central-1": 0.6008, + "eu-south-1": 0.6002, + "eu-west-1": 0.5816, + "eu-west-2": 0.595, + "eu-west-3": 0.595, + "il-central-1": 0.5982, + "sa-east-1": 0.739, + "us-east-1": 0.556, + "us-east-2": 0.556, + "us-gov-east-1": 0.6066, + "us-gov-west-1": 0.6066, + "us-west-1": 0.6123, + "us-west-2": 0.556 + }, + "t4g.micro": { + "af-south-1": 0.0746, + "ap-east-1": 0.0754, + "ap-northeast-1": 0.0746, + "ap-northeast-2": 0.0742, + "ap-northeast-3": 0.0747, + "ap-south-1": 0.0694, + "ap-south-2": 0.0694, + "ap-southeast-1": 0.0744, + "ap-southeast-2": 0.0744, + "ap-southeast-3": 0.0744, + "ap-southeast-4": 0.0744, + "ap-southeast-5": 0.0733, + "ap-southeast-7": 0.0733, + "ca-central-1": 0.073, + "ca-west-1": 0.073, + "eu-central-1": 0.0734, + "eu-central-2": 0.0744, + "eu-north-1": 0.0724, + "eu-south-1": 0.0734, + "eu-south-2": 0.073, + "eu-west-1": 0.073, + "eu-west-2": 0.0732, + "eu-west-3": 0.0732, + "il-central-1": 0.0735, + "me-central-1": 0.074, + "me-south-1": 0.0738, + "mx-central-1": 0.0726, + "sa-east-1": 0.0772, + "us-east-1": 0.0722, + "us-east-2": 0.0722, + "us-gov-east-1": 0.0736, + "us-gov-west-1": 0.0736, + "us-west-1": 0.0738, + "us-west-2": 0.0722 + }, + "t4g.small": { + "af-south-1": 0.0855, + "ap-east-1": 0.087, + "ap-northeast-1": 0.0854, + "ap-northeast-2": 0.0846, + "ap-northeast-3": 0.0856, + "ap-south-1": 0.075, + "ap-south-2": 0.075, + "ap-southeast-1": 0.085, + "ap-southeast-2": 0.085, + "ap-southeast-3": 0.085, + "ap-southeast-4": 0.085, + "ap-southeast-5": 0.0829, + "ap-southeast-7": 0.0829, + "ca-central-1": 0.0822, + "ca-west-1": 0.0822, + "eu-central-1": 0.083, + "eu-central-2": 0.0849, + "eu-north-1": 0.081, + "eu-south-1": 0.083, + "eu-south-2": 0.0822, + "eu-west-1": 0.0822, + "eu-west-2": 0.0826, + "eu-west-3": 0.0826, + "il-central-1": 0.0831, + "me-central-1": 0.0842, + "me-south-1": 0.0839, + "mx-central-1": 0.0814, + "sa-east-1": 0.0906, + "us-east-1": 0.0806, + "us-east-2": 0.0806, + "us-gov-east-1": 0.0834, + "us-gov-west-1": 0.0834, + "us-west-1": 0.0838, + "us-west-2": 0.0806 + }, + "t4g.medium": { + "af-south-1": 0.1072, + "ap-east-1": 0.1102, + "ap-northeast-1": 0.107, + "ap-northeast-2": 0.1054, + "ap-northeast-3": 0.1073, + "ap-south-1": 0.0862, + "ap-south-2": 0.0862, + "ap-southeast-1": 0.1062, + "ap-southeast-2": 0.1062, + "ap-southeast-3": 0.1062, + "ap-southeast-4": 0.1062, + "ap-southeast-5": 0.102, + "ap-southeast-7": 0.102, + "ca-central-1": 0.1006, + "ca-west-1": 0.1006, + "eu-central-1": 0.1022, + "eu-central-2": 0.106, + "eu-north-1": 0.0982, + "eu-south-1": 0.1022, + "eu-south-2": 0.1006, + "eu-west-1": 0.1006, + "eu-west-2": 0.1014, + "eu-west-3": 0.1014, + "il-central-1": 0.1024, + "me-central-1": 0.1046, + "me-south-1": 0.104, + "mx-central-1": 0.0991, + "sa-east-1": 0.1174, + "us-east-1": 0.0974, + "us-east-2": 0.0974, + "us-gov-east-1": 0.103, + "us-gov-west-1": 0.103, + "us-west-1": 0.1038, + "us-west-2": 0.0974 + }, + "t4g.large": { + "af-south-1": 0.1505, + "ap-east-1": 0.1566, + "ap-northeast-1": 0.1502, + "ap-northeast-2": 0.147, + "ap-northeast-3": 0.1508, + "ap-south-1": 0.1086, + "ap-south-2": 0.1086, + "ap-southeast-1": 0.1486, + "ap-southeast-2": 0.1486, + "ap-southeast-3": 0.1486, + "ap-southeast-4": 0.1486, + "ap-southeast-5": 0.1401, + "ap-southeast-7": 0.1401, + "ca-central-1": 0.1374, + "ca-west-1": 0.1374, + "eu-central-1": 0.1406, + "eu-central-2": 0.1483, + "eu-north-1": 0.1326, + "eu-south-1": 0.1406, + "eu-south-2": 0.1374, + "eu-west-1": 0.1374, + "eu-west-2": 0.139, + "eu-west-3": 0.139, + "il-central-1": 0.1411, + "me-central-1": 0.1454, + "me-south-1": 0.1441, + "mx-central-1": 0.1344, + "sa-east-1": 0.171, + "us-east-1": 0.131, + "us-east-2": 0.131, + "us-gov-east-1": 0.1422, + "us-gov-west-1": 0.1422, + "us-west-1": 0.1438, + "us-west-2": 0.131 + }, + "t4g.xlarge": { + "af-south-1": 0.301, + "ap-east-1": 0.3132, + "ap-northeast-1": 0.3004, + "ap-northeast-2": 0.294, + "ap-northeast-3": 0.3017, + "ap-south-1": 0.2172, + "ap-south-2": 0.2172, + "ap-southeast-1": 0.2972, + "ap-southeast-2": 0.2972, + "ap-southeast-3": 0.2972, + "ap-southeast-4": 0.2972, + "ap-southeast-5": 0.2802, + "ap-southeast-7": 0.2802, + "ca-central-1": 0.2748, + "ca-west-1": 0.2748, + "eu-central-1": 0.2812, + "eu-central-2": 0.2966, + "eu-north-1": 0.2652, + "eu-south-1": 0.2812, + "eu-south-2": 0.2748, + "eu-west-1": 0.2748, + "eu-west-2": 0.278, + "eu-west-3": 0.278, + "il-central-1": 0.2822, + "me-central-1": 0.2908, + "me-south-1": 0.2882, + "mx-central-1": 0.2687, + "sa-east-1": 0.342, + "us-east-1": 0.262, + "us-east-2": 0.262, + "us-gov-east-1": 0.2844, + "us-gov-west-1": 0.2844, + "us-west-1": 0.2876, + "us-west-2": 0.262 + }, + "t4g.2xlarge": { + "af-south-1": 0.6021, + "ap-east-1": 0.6264, + "ap-northeast-1": 0.6008, + "ap-northeast-2": 0.588, + "ap-northeast-3": 0.6034, + "ap-south-1": 0.4344, + "ap-south-2": 0.4344, + "ap-southeast-1": 0.5944, + "ap-southeast-2": 0.5944, + "ap-southeast-3": 0.5944, + "ap-southeast-4": 0.5944, + "ap-southeast-5": 0.5605, + "ap-southeast-7": 0.5605, + "ca-central-1": 0.5496, + "ca-west-1": 0.5496, + "eu-central-1": 0.5624, + "eu-central-2": 0.5931, + "eu-north-1": 0.5304, + "eu-south-1": 0.5624, + "eu-south-2": 0.5496, + "eu-west-1": 0.5496, + "eu-west-2": 0.556, + "eu-west-3": 0.556, + "il-central-1": 0.5643, + "me-central-1": 0.5816, + "me-south-1": 0.5765, + "mx-central-1": 0.5374, + "sa-east-1": 0.684, + "us-east-1": 0.524, + "us-east-2": 0.524, + "us-gov-east-1": 0.5688, + "us-gov-west-1": 0.5688, + "us-west-1": 0.5752, + "us-west-2": 0.524 + }, + "u7i-6tb.112xlarge": { + "ap-northeast-2": 0.0, + "us-east-1": 71.7948, + "us-west-2": 71.7948 + }, + "u7i-8tb.112xlarge": { + "ap-northeast-2": 0.0, + "us-east-1": 92.7248 + }, + "u7i-12tb.224xlarge": { + "us-east-1": 0.0, + "us-west-2": 170.8896 + }, + "u7in-16tb.224xlarge": { + "ap-northeast-2": 263.9116, + "ap-southeast-2": 262.2936, + "us-east-1": 221.8496, + "us-west-2": 0.0 + }, + "u7in-24tb.224xlarge": { + "us-east-1": 0.0, + "us-gov-west-1": 384.4316, + "us-west-2": 323.7696 + }, + "u7in-32tb.224xlarge": { + "us-east-1": 0.0, + "us-west-2": 425.6896 + }, + "u-3tb1.56xlarge": { + "ap-east-1": 40.72925, + "ap-northeast-1": 37.4357, + "ap-southeast-1": 37.4324, + "ap-southeast-2": 37.2174, + "ca-central-1": 34.4024, + "eu-central-1": 37.4359, + "eu-central-2": 40.72925, + "eu-south-1": 36.5799, + "eu-west-1": 35.0524, + "sa-east-1": 48.0524, + "us-east-1": 31.8024, + "us-east-2": 31.8024, + "us-gov-west-1": 37.2189, + "us-west-2": 31.8024 + }, + "u-6tb1.metal": { + "ap-northeast-1": 9.005, + "ap-northeast-2": 9.005, + "ap-south-1": 9.005, + "ap-southeast-1": 9.005, + "ap-southeast-2": 9.005, + "ap-southeast-3": 9.005, + "ca-central-1": 9.005, + "eu-central-1": 9.005, + "eu-central-2": 9.005, + "eu-north-1": 9.005, + "eu-south-1": 9.005, + "eu-south-2": 9.005, + "eu-west-1": 9.005, + "eu-west-2": 9.005, + "eu-west-3": 9.005, + "sa-east-1": 9.005, + "us-east-1": 9.005, + "us-east-2": 9.005, + "us-gov-east-1": 9.005, + "us-gov-west-1": 9.005, + "us-west-2": 9.005 + }, + "u-6tb1.56xlarge": { + "af-south-1": 4.5024, + "ap-northeast-1": 60.482, + "ap-northeast-2": 4.5024, + "ap-northeast-3": 60.482, + "ap-south-1": 52.37916, + "ap-southeast-1": 4.5024, + "ap-southeast-2": 60.11315, + "ap-southeast-3": 4.5024, + "ca-central-1": 55.32573, + "eu-central-1": 60.482, + "eu-central-2": 4.5024, + "eu-north-1": 53.83417, + "eu-south-1": 4.5024, + "eu-south-2": 4.5024, + "eu-west-1": 4.5024, + "eu-west-2": 4.5024, + "eu-west-3": 4.5024, + "sa-east-1": 4.5024, + "us-east-1": 4.5024, + "us-east-2": 4.5024, + "us-gov-east-1": 60.11315, + "us-gov-west-1": 4.5024, + "us-west-2": 4.5024 + }, + "u-6tb1.112xlarge": { + "af-south-1": 9.0048, + "ap-northeast-1": 9.0048, + "ap-northeast-2": 74.8718, + "ap-northeast-3": 74.8718, + "ap-south-1": 65.3378, + "ap-southeast-1": 74.8718, + "ap-southeast-2": 74.4378, + "ap-southeast-3": 74.8718, + "ca-central-1": 68.8048, + "eu-central-1": 9.0048, + "eu-central-2": 9.0048, + "eu-north-1": 67.0498, + "eu-south-1": 9.0048, + "eu-south-2": 9.0048, + "eu-west-1": 9.0048, + "eu-west-2": 73.1378, + "eu-west-3": 9.0048, + "sa-east-1": 96.1048, + "us-east-1": 63.6048, + "us-east-2": 63.6048, + "us-gov-east-1": 9.0048, + "us-gov-west-1": 9.0048, + "us-west-2": 63.6048 + }, + "u-9tb1.metal": { + "ap-northeast-1": 9.005, + "ap-northeast-2": 9.005, + "ap-south-1": 9.005, + "ap-south-2": 9.005, + "ap-southeast-1": 9.005, + "eu-central-1": 9.005, + "eu-north-1": 9.005, + "eu-west-1": 9.005, + "eu-west-2": 9.005, + "eu-west-3": 9.005, + "sa-east-1": 9.005, + "us-east-1": 9.005, + "us-east-2": 9.005, + "us-gov-east-1": 9.005, + "us-gov-west-1": 9.005, + "us-west-2": 9.005 + }, + "u-9tb1.112xlarge": { + "ap-northeast-1": 9.0048, + "ap-northeast-2": 107.8048, + "ap-south-1": 9.0048, + "ap-south-2": 9.0048, + "ap-southeast-1": 9.0048, + "eu-central-1": 9.0048, + "eu-north-1": 100.6548, + "eu-west-1": 9.0048, + "eu-west-2": 105.2048, + "eu-west-3": 9.0048, + "sa-east-1": 139.6548, + "us-east-1": 9.0048, + "us-east-2": 9.0048, + "us-gov-east-1": 9.0048, + "us-gov-west-1": 9.0048, + "us-west-2": 9.0048 + }, + "u-12tb1.metal": { + "af-south-1": 9.005, + "ap-northeast-1": 9.005, + "ap-northeast-2": 9.005, + "ap-northeast-3": 9.005, + "ap-south-1": 9.005, + "ap-southeast-1": 9.005, + "ap-southeast-2": 9.005, + "eu-central-1": 9.005, + "eu-south-1": 9.005, + "eu-west-1": 9.005, + "sa-east-1": 9.005, + "us-east-1": 9.005, + "us-east-2": 9.005, + "us-gov-east-1": 9.005, + "us-gov-west-1": 9.005, + "us-west-2": 9.005 + }, + "u-12tb1.112xlarge": { + "af-south-1": 154.4228, + "ap-northeast-1": 9.0048, + "ap-northeast-2": 140.7378, + "ap-northeast-3": 9.0048, + "ap-south-1": 121.6718, + "ap-southeast-1": 140.7378, + "ap-southeast-2": 139.8718, + "eu-central-1": 140.7378, + "eu-south-1": 137.3148, + "eu-west-1": 9.0048, + "sa-east-1": 9.0048, + "us-east-1": 118.2048, + "us-east-2": 118.2048, + "us-gov-east-1": 9.0048, + "us-gov-west-1": 139.8718, + "us-west-2": 9.0048 + }, + "u-18tb1.metal": { + "eu-central-1": 9.005, + "eu-west-1": 9.005, + "sa-east-1": 9.005, + "us-east-1": 9.005, + "us-west-2": 9.005 + }, + "u-18tb1.112xlarge": { + "eu-central-1": 9.0048, + "eu-west-1": 9.0048, + "sa-east-1": 9.0048, + "us-east-1": 9.0048, + "us-west-2": 172.8048 + }, + "u-24tb1.metal": { + "ap-northeast-2": 9.005, + "us-east-1": 9.005, + "us-gov-east-1": 9.005, + "us-gov-west-1": 9.005, + "us-west-2": 9.005 + }, + "u-24tb1.112xlarge": { + "ap-northeast-2": 9.0048, + "us-east-1": 9.0048, + "us-gov-east-1": 270.7348, + "us-gov-west-1": 9.0048, + "us-west-2": 9.0048 + }, + "vt1.3xlarge": { + "ap-northeast-1": 1.11584, + "eu-west-1": 1.03172, + "us-east-1": 0.0, + "us-west-2": 1.0126 + }, + "vt1.6xlarge": { + "ap-northeast-1": 2.23167, + "eu-west-1": 2.06344, + "us-east-1": 0.0, + "us-west-2": 0.0 + }, + "vt1.24xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 8.25374, + "us-east-1": 7.5808, + "us-west-2": 7.5808 + }, + "x1.16xlarge": { + "af-south-1": 11.111, + "ap-east-1": 13.289, + "ap-northeast-1": 11.258, + "ap-northeast-2": 11.258, + "ap-northeast-3": 0.0, + "ap-south-1": 8.468, + "ap-southeast-1": 11.258, + "ap-southeast-2": 11.258, + "ca-central-1": 8.923, + "eu-central-1": 10.924, + "eu-west-1": 9.59, + "eu-west-2": 9.99, + "eu-west-3": 0.0, + "sa-east-1": 14.592, + "us-east-1": 8.256, + "us-east-2": 8.256, + "us-gov-east-1": 9.59, + "us-gov-west-1": 9.59, + "us-west-2": 8.256 + }, + "x1.32xlarge": { + "af-south-1": 21.621, + "ap-east-1": 23.849, + "ap-northeast-1": 21.915, + "ap-northeast-2": 21.915, + "ap-northeast-3": 21.915, + "ap-south-1": 16.335, + "ap-southeast-1": 21.915, + "ap-southeast-2": 21.915, + "ca-central-1": 17.245, + "eu-central-1": 21.247, + "eu-west-1": 18.579, + "eu-west-2": 19.379, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 15.911, + "us-east-2": 15.911, + "us-gov-east-1": 18.579, + "us-gov-west-1": 0.0, + "us-west-2": 15.911 + }, + "x1e.xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.337, + "ap-northeast-3": 1.337, + "ap-south-1": 0.988, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.337, + "ca-central-1": 1.044, + "eu-central-1": 1.295, + "eu-west-1": 1.128, + "sa-east-1": 1.753, + "us-east-1": 0.962, + "us-east-2": 1.045, + "us-gov-east-1": 1.228, + "us-gov-west-1": 1.128, + "us-west-2": 1.045 + }, + "x1e.2xlarge": { + "af-south-1": 2.635, + "ap-northeast-1": 2.673, + "ap-northeast-2": 2.673, + "ap-northeast-3": 2.915, + "ap-south-1": 1.975, + "ap-southeast-1": 2.673, + "ap-southeast-2": 0.0, + "ca-central-1": 2.272, + "eu-central-1": 2.589, + "eu-west-1": 2.255, + "sa-east-1": 3.506, + "us-east-1": 1.923, + "us-east-2": 1.923, + "us-gov-east-1": 2.255, + "us-gov-west-1": 2.255, + "us-west-2": 1.923 + }, + "x1e.4xlarge": { + "af-south-1": 5.633, + "ap-northeast-1": 5.233, + "ap-northeast-2": 0.0, + "ap-northeast-3": 5.233, + "ap-south-1": 3.837, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 4.064, + "eu-central-1": 0.0, + "eu-west-1": 4.397, + "sa-east-1": 6.899, + "us-east-1": 3.733, + "us-east-2": 3.733, + "us-gov-east-1": 4.397, + "us-gov-west-1": 4.397, + "us-west-2": 0.0 + }, + "x1e.8xlarge": { + "af-south-1": 10.314, + "ap-northeast-1": 10.466, + "ap-northeast-2": 11.433, + "ap-northeast-3": 10.466, + "ap-south-1": 7.674, + "ap-southeast-1": 0.0, + "ap-southeast-2": 10.466, + "ca-central-1": 0.0, + "eu-central-1": 10.13, + "eu-west-1": 8.794, + "sa-east-1": 13.798, + "us-east-1": 7.466, + "us-east-2": 7.466, + "us-gov-east-1": 8.794, + "us-gov-west-1": 8.794, + "us-west-2": 7.466 + }, + "x1e.16xlarge": { + "af-south-1": 20.627, + "ap-northeast-1": 20.931, + "ap-northeast-2": 0.0, + "ap-northeast-3": 22.866, + "ap-south-1": 15.347, + "ap-southeast-1": 22.866, + "ap-southeast-2": 20.931, + "ca-central-1": 16.256, + "eu-central-1": 22.126, + "eu-west-1": 17.587, + "sa-east-1": 27.597, + "us-east-1": 14.931, + "us-east-2": 14.931, + "us-gov-east-1": 0.0, + "us-gov-west-1": 17.587, + "us-west-2": 16.266 + }, + "x1e.32xlarge": { + "af-south-1": 40.653, + "ap-northeast-1": 41.261, + "ap-northeast-2": 41.261, + "ap-northeast-3": 0.0, + "ap-south-1": 30.093, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 31.91, + "eu-central-1": 39.917, + "eu-west-1": 34.573, + "sa-east-1": 54.592, + "us-east-1": 29.261, + "us-east-2": 29.261, + "us-gov-east-1": 34.573, + "us-gov-west-1": 0.0, + "us-west-2": 29.261 + }, + "x2idn.metal": { + "af-south-1": 21.6208, + "ap-northeast-1": 21.9138, + "ap-northeast-2": 21.9138, + "ap-northeast-3": 0.0, + "ap-south-1": 16.3348, + "ap-south-2": 16.3348, + "ap-southeast-1": 21.9138, + "ap-southeast-2": 21.9138, + "ap-southeast-3": 21.9138, + "ap-southeast-5": 19.9797, + "ap-southeast-7": 19.9797, + "ca-central-1": 17.2448, + "eu-central-1": 21.2468, + "eu-central-2": 23.1142, + "eu-north-1": 17.7838, + "eu-south-1": 19.3738, + "eu-south-2": 18.5788, + "eu-west-1": 18.5788, + "eu-west-2": 19.3788, + "eu-west-3": 0.0, + "me-central-1": 0.0, + "me-south-1": 18.9808, + "sa-east-1": 28.5828, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 18.5788, + "us-gov-west-1": 0.0, + "us-west-1": 19.9128, + "us-west-2": 15.9108 + }, + "x2idn.16xlarge": { + "af-south-1": 11.1112, + "ap-northeast-1": 11.2577, + "ap-northeast-2": 12.22475, + "ap-northeast-3": 0.0, + "ap-south-1": 8.4682, + "ap-south-2": 9.1563, + "ap-southeast-1": 0.0, + "ap-southeast-2": 11.2577, + "ap-southeast-3": 11.2577, + "ap-southeast-5": 11.161, + "ap-southeast-7": 10.29065, + "ca-central-1": 0.0, + "eu-central-1": 10.9242, + "eu-central-2": 0.0, + "eu-north-1": 9.1927, + "eu-south-1": 9.9877, + "eu-south-2": 9.5902, + "eu-west-1": 0.0, + "eu-west-2": 9.9902, + "eu-west-3": 9.9902, + "me-central-1": 10.6116, + "me-south-1": 9.7912, + "sa-east-1": 15.8927, + "us-east-1": 8.2562, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 9.5902, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "x2idn.24xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 18.33713, + "ap-northeast-2": 16.88655, + "ap-northeast-3": 18.33795, + "ap-south-1": 12.7023, + "ap-south-2": 13.73445, + "ap-southeast-1": 16.88655, + "ap-southeast-2": 16.88655, + "ap-southeast-3": 16.88655, + "ap-southeast-5": 15.43598, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 17.78685, + "eu-central-2": 0.0, + "eu-north-1": 13.78905, + "eu-south-1": 14.98155, + "eu-south-2": 14.3853, + "eu-west-1": 14.3853, + "eu-west-2": 0.0, + "eu-west-3": 14.9853, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 23.83905, + "us-east-1": 12.3843, + "us-east-2": 12.3843, + "us-gov-east-1": 15.58575, + "us-gov-west-1": 14.3853, + "us-west-1": 16.6863, + "us-west-2": 12.3843 + }, + "x2idn.32xlarge": { + "af-south-1": 21.6208, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 21.9148, + "ap-south-1": 16.3348, + "ap-south-2": 0.0, + "ap-southeast-1": 21.9138, + "ap-southeast-2": 21.9138, + "ap-southeast-3": 0.0, + "ap-southeast-5": 19.9797, + "ap-southeast-7": 19.9797, + "ca-central-1": 17.2448, + "eu-central-1": 21.2468, + "eu-central-2": 23.1142, + "eu-north-1": 17.7838, + "eu-south-1": 19.3738, + "eu-south-2": 18.5788, + "eu-west-1": 18.5788, + "eu-west-2": 19.3788, + "eu-west-3": 19.3788, + "me-central-1": 18.9808, + "me-south-1": 18.9808, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 15.9108, + "us-gov-east-1": 18.5788, + "us-gov-west-1": 18.5788, + "us-west-1": 0.0, + "us-west-2": 15.9108 + }, + "x2iedn.xlarge": { + "af-south-1": 1.3181, + "ap-northeast-1": 1.33641, + "ap-northeast-2": 1.45729, + "ap-northeast-3": 0.0, + "ap-south-1": 0.98773, + "ap-south-2": 0.98773, + "ap-southeast-1": 1.33641, + "ap-southeast-2": 1.45729, + "ap-southeast-3": 1.33641, + "ap-southeast-5": 0.0, + "ca-central-1": 1.1363, + "eu-central-1": 1.29473, + "eu-north-1": 1.07832, + "eu-south-1": 1.28263, + "eu-south-2": 0.0, + "eu-west-1": 1.12798, + "eu-west-2": 1.17798, + "eu-west-3": 1.28301, + "sa-east-1": 1.75323, + "us-east-1": 1.04459, + "us-east-2": 0.96123, + "us-gov-east-1": 1.12798, + "us-gov-west-1": 1.12798, + "us-west-1": 1.31973, + "us-west-2": 0.0 + }, + "x2iedn.metal": { + "af-south-1": 40.6688, + "ap-northeast-1": 41.2548, + "ap-northeast-2": 0.0, + "ap-northeast-3": 41.2568, + "ap-south-1": 30.0968, + "ap-south-2": 30.0968, + "ap-southeast-1": 41.2548, + "ap-southeast-2": 41.2548, + "ap-southeast-3": 41.2548, + "ap-southeast-5": 37.3866, + "ca-central-1": 31.9168, + "eu-central-1": 39.9208, + "eu-north-1": 32.9958, + "eu-south-1": 36.1738, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 36.1848, + "sa-east-1": 0.0, + "us-east-1": 29.2488, + "us-east-2": 29.2488, + "us-gov-east-1": 34.5848, + "us-gov-west-1": 34.5848, + "us-west-1": 37.2528, + "us-west-2": 29.2488 + }, + "x2iedn.2xlarge": { + "af-south-1": 2.6362, + "ap-northeast-1": 2.67283, + "ap-northeast-2": 2.67283, + "ap-northeast-3": 0.0, + "ap-south-1": 2.14748, + "ap-south-2": 1.97545, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-5": 2.43106, + "ca-central-1": 0.0, + "eu-central-1": 2.82288, + "eu-north-1": 2.34678, + "eu-south-1": 2.35526, + "eu-south-2": 0.0, + "eu-west-1": 2.25595, + "eu-west-2": 2.35595, + "eu-west-3": 2.35595, + "sa-east-1": 3.50645, + "us-east-1": 2.08918, + "us-east-2": 1.92245, + "us-gov-east-1": 2.25595, + "us-gov-west-1": 2.25595, + "us-west-1": 2.4227, + "us-west-2": 0.0 + }, + "x2iedn.4xlarge": { + "af-south-1": 5.635, + "ap-northeast-1": 5.23205, + "ap-northeast-2": 5.23205, + "ap-northeast-3": 5.2323, + "ap-south-1": 0.0, + "ap-south-2": 3.8373, + "ap-southeast-1": 5.71558, + "ap-southeast-2": 5.71558, + "ap-southeast-3": 5.23205, + "ap-southeast-5": 0.0, + "ca-central-1": 4.4316, + "eu-central-1": 5.0653, + "eu-north-1": 4.57996, + "eu-south-1": 4.59693, + "eu-south-2": 0.0, + "eu-west-1": 4.3983, + "eu-west-2": 4.5983, + "eu-west-3": 4.5983, + "sa-east-1": 7.54955, + "us-east-1": 0.0, + "us-east-2": 3.7313, + "us-gov-east-1": 4.3983, + "us-gov-west-1": 4.3983, + "us-west-1": 4.7318, + "us-west-2": 0.0 + }, + "x2iedn.8xlarge": { + "af-south-1": 10.3176, + "ap-northeast-1": 11.43115, + "ap-northeast-2": 11.43115, + "ap-northeast-3": 10.4646, + "ap-south-1": 7.6746, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 11.43115, + "ap-southeast-3": 0.0, + "ap-southeast-5": 10.3674, + "ca-central-1": 8.1296, + "eu-central-1": 10.1306, + "eu-north-1": 9.15993, + "eu-south-1": 10.03388, + "eu-south-2": 8.7966, + "eu-west-1": 8.7966, + "eu-west-2": 9.1966, + "eu-west-3": 10.0369, + "sa-east-1": 0.0, + "us-east-1": 8.1295, + "us-east-2": 8.1295, + "us-gov-east-1": 9.5969, + "us-gov-west-1": 0.0, + "us-west-1": 9.4636, + "us-west-2": 7.4626 + }, + "x2iedn.16xlarge": { + "af-south-1": 22.54, + "ap-northeast-1": 20.9282, + "ap-northeast-2": 20.9282, + "ap-northeast-3": 20.9292, + "ap-south-1": 16.7254, + "ap-south-2": 16.7254, + "ap-southeast-1": 22.8623, + "ap-southeast-2": 20.9282, + "ap-southeast-3": 22.8623, + "ap-southeast-5": 18.9941, + "ca-central-1": 16.2592, + "eu-central-1": 20.2612, + "eu-north-1": 16.7987, + "eu-south-1": 18.3877, + "eu-south-2": 19.1938, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 30.1982, + "us-east-1": 16.259, + "us-east-2": 16.259, + "us-gov-east-1": 17.5932, + "us-gov-west-1": 17.5932, + "us-west-1": 18.9272, + "us-west-2": 14.9252 + }, + "x2iedn.24xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 31.3923, + "ap-northeast-2": 31.3923, + "ap-northeast-3": 31.3938, + "ap-south-1": 23.0238, + "ap-south-2": 23.0238, + "ap-southeast-1": 31.3923, + "ap-southeast-2": 0.0, + "ap-southeast-3": 31.3923, + "ap-southeast-5": 31.10219, + "ca-central-1": 24.3888, + "eu-central-1": 33.1929, + "eu-north-1": 0.0, + "eu-south-1": 30.10163, + "eu-south-2": 28.7907, + "eu-west-1": 26.3898, + "eu-west-2": 30.1107, + "eu-west-3": 27.5898, + "sa-east-1": 45.2973, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 26.3898, + "us-gov-west-1": 0.0, + "us-west-1": 30.9918, + "us-west-2": 22.3878 + }, + "x2iedn.32xlarge": { + "af-south-1": 40.6688, + "ap-northeast-1": 41.2548, + "ap-northeast-2": 41.2548, + "ap-northeast-3": 41.2568, + "ap-south-1": 30.0968, + "ap-south-2": 0.0, + "ap-southeast-1": 41.2548, + "ap-southeast-2": 41.2548, + "ap-southeast-3": 41.2548, + "ap-southeast-5": 37.3866, + "ca-central-1": 31.9168, + "eu-central-1": 39.9208, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 34.5848, + "eu-west-1": 34.5848, + "eu-west-2": 36.1848, + "eu-west-3": 36.1848, + "sa-east-1": 54.5928, + "us-east-1": 29.2488, + "us-east-2": 29.2488, + "us-gov-east-1": 34.5848, + "us-gov-west-1": 34.5848, + "us-west-1": 37.2528, + "us-west-2": 29.2488 + }, + "x2iezn.metal": { + "ap-northeast-1": 15.6984, + "eu-west-1": 13.1904, + "me-central-1": 13.4964, + "us-east-1": 11.1984, + "us-west-2": 11.1984 + }, + "x2iezn.2xlarge": { + "ap-northeast-1": 2.915, + "eu-west-1": 2.4552, + "me-central-1": 2.3062, + "us-east-1": 2.09, + "us-west-2": 0.0 + }, + "x2iezn.4xlarge": { + "ap-northeast-1": 5.2328, + "eu-west-1": 0.0, + "me-central-1": 0.0, + "us-east-1": 3.7328, + "us-west-2": 3.7328 + }, + "x2iezn.6xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 6.5952, + "me-central-1": 6.7482, + "us-east-1": 5.5992, + "us-west-2": 5.5992 + }, + "x2iezn.8xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 8.7936, + "me-central-1": 0.0, + "us-east-1": 7.4656, + "us-west-2": 7.4656 + }, + "x2iezn.12xlarge": { + "ap-northeast-1": 15.6984, + "eu-west-1": 13.1904, + "me-central-1": 0.0, + "us-east-1": 11.1984, + "us-west-2": 11.1984 + }, + "x8g.medium": { + "eu-central-1": 0.16845, + "us-east-1": 0.0, + "us-west-2": 0.1296 + }, + "x8g.large": { + "eu-central-1": 0.36421, + "us-east-1": 0.2592, + "us-west-2": 0.27874 + }, + "x8g.xlarge": { + "eu-central-1": 0.6738, + "us-east-1": 0.5184, + "us-west-2": 0.5184 + }, + "x8g.metal-24xl": { + "eu-central-1": 0.0, + "us-east-1": 11.76, + "us-west-2": 0.0 + }, + "x8g.metal-48xl": { + "eu-central-1": 30.0768, + "us-east-1": 22.6176, + "us-west-2": 22.6176 + }, + "x8g.2xlarge": { + "eu-central-1": 1.45684, + "us-east-1": 1.0368, + "us-west-2": 1.11496 + }, + "x8g.4xlarge": { + "eu-central-1": 2.5816, + "us-east-1": 2.11632, + "us-west-2": 2.11632 + }, + "x8g.8xlarge": { + "eu-central-1": 5.1632, + "us-east-1": 3.92, + "us-west-2": 0.0 + }, + "x8g.12xlarge": { + "eu-central-1": 7.7448, + "us-east-1": 0.0, + "us-west-2": 0.0 + }, + "x8g.16xlarge": { + "eu-central-1": 10.3264, + "us-east-1": 7.84, + "us-west-2": 7.84 + }, + "x8g.24xlarge": { + "eu-central-1": 15.4896, + "us-east-1": 11.76, + "us-west-2": 12.69792 + }, + "x8g.48xlarge": { + "eu-central-1": 30.0768, + "us-east-1": 22.6176, + "us-west-2": 22.6176 + }, + "z1d.large": { + "ap-northeast-1": 0.291, + "ap-northeast-2": 0.289, + "ap-south-1": 0.26, + "ap-southeast-1": 0.29, + "ap-southeast-2": 0.303, + "eu-central-1": 0.289, + "eu-west-1": 0.272, + "eu-west-2": 0.284, + "us-east-1": 0.261, + "us-east-2": 0.261, + "us-west-1": 0.275, + "us-west-2": 0.25 + }, + "z1d.xlarge": { + "ap-northeast-1": 0.582, + "ap-northeast-2": 0.578, + "ap-south-1": 0.52, + "ap-southeast-1": 0.607, + "ap-southeast-2": 0.0, + "eu-central-1": 0.578, + "eu-west-1": 0.544, + "eu-west-2": 0.567, + "us-east-1": 0.5, + "us-east-2": 0.5, + "us-west-1": 0.55, + "us-west-2": 0.522 + }, + "z1d.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 5.894, + "ap-southeast-1": 6.614, + "ap-southeast-2": 6.614, + "eu-central-1": 6.59, + "eu-west-1": 6.182, + "eu-west-2": 6.463, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 0.0, + "us-west-2": 5.654 + }, + "z1d.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.155, + "ap-south-1": 1.086, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 1.209, + "eu-west-1": 1.087, + "eu-west-2": 1.187, + "us-east-1": 0.999, + "us-east-2": 0.999, + "us-west-1": 1.15, + "us-west-2": 0.999 + }, + "z1d.3xlarge": { + "ap-northeast-1": 1.66, + "ap-northeast-2": 1.648, + "ap-south-1": 1.474, + "ap-southeast-1": 1.735, + "ap-southeast-2": 1.654, + "eu-central-1": 0.0, + "eu-west-1": 1.546, + "eu-west-2": 1.616, + "us-east-1": 1.414, + "us-east-2": 1.414, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "z1d.6xlarge": { + "ap-northeast-1": 3.319, + "ap-northeast-2": 3.295, + "ap-south-1": 0.0, + "ap-southeast-1": 3.307, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 3.091, + "eu-west-2": 0.0, + "us-east-1": 2.961, + "us-east-2": 2.827, + "us-west-1": 3.127, + "us-west-2": 2.827 + }, + "z1d.12xlarge": { + "ap-northeast-1": 6.638, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 6.614, + "ap-southeast-2": 0.0, + "eu-central-1": 6.59, + "eu-west-1": 6.182, + "eu-west-2": 0.0, + "us-east-1": 5.654, + "us-east-2": 5.654, + "us-west-1": 6.254, + "us-west-2": 5.654 + } }, "ec2_sa_east": { - "c1.medium": "0.179", - "c1.xlarge": "0.718", - "c3.2xlarge": "0.650", - "c3.4xlarge": "1.300", - "c3.8xlarge": "2.600", - "c3.large": "0.163", - "c3.xlarge": "0.325", - "hi1.4xlarge": "N/A", - "hs1.8xlarge": "N/A", - "m1.large": "0.233", - "m1.medium": "0.117", - "m1.small": "0.058", - "m1.xlarge": "0.467", - "m2.2xlarge": "0.645", - "m2.4xlarge": "1.291", - "m2.xlarge": "0.323", - "m3.2xlarge": "0.761", - "m3.large": "0.190", - "m3.medium": "0.095", - "m3.xlarge": "0.381", - "t1.micro": "0.027", - "t2.medium": "0.108", - "t2.micro": "0.027", - "t2.small": "0.054" + "c1.medium": 0.179, + "c1.xlarge": 0.718, + "c3.large": 0.163, + "c3.xlarge": 0.325, + "c3.2xlarge": 0.65, + "c3.4xlarge": 1.3, + "c3.8xlarge": 2.6, + "c4.large": 0.155, + "c4.xlarge": 0.309, + "c4.2xlarge": 0.618, + "c4.4xlarge": 1.235, + "c4.8xlarge": 2.47, + "c5.large": 0.131, + "c5.xlarge": 0.262, + "c5.2xlarge": 0.524, + "c5.4xlarge": 1.048, + "c5.9xlarge": 2.358, + "c5.18xlarge": 4.716, + "i3.large": 0.286, + "i3.xlarge": 0.572, + "i3.2xlarge": 1.144, + "i3.4xlarge": 2.288, + "i3.8xlarge": 4.576, + "i3.16xlarge": 9.152, + "m1.small": 0.058, + "m1.medium": 0.117, + "m1.large": 0.233, + "m1.xlarge": 0.467, + "m2.xlarge": 0.323, + "m2.2xlarge": 0.645, + "m2.4xlarge": 1.291, + "m3.medium": 0.095, + "m3.large": 0.19, + "m3.xlarge": 0.381, + "m3.2xlarge": 0.761, + "m4.large": 0.159, + "m4.xlarge": 0.318, + "m4.2xlarge": 0.636, + "m4.4xlarge": 1.272, + "m4.10xlarge": 3.18, + "m4.16xlarge": 5.088, + "m5.large": 0.153, + "m5.xlarge": 0.306, + "m5.2xlarge": 0.612, + "m5.4xlarge": 1.224, + "m5.12xlarge": 3.672, + "m5.24xlarge": 7.344, + "r3.large": 0.35, + "r3.xlarge": 0.7, + "r3.2xlarge": 1.399, + "r3.4xlarge": 2.799, + "r3.8xlarge": 5.597, + "r4.large": 0.28, + "r4.xlarge": 0.56, + "r4.2xlarge": 1.12, + "r4.4xlarge": 2.24, + "r4.8xlarge": 4.48, + "r4.16xlarge": 8.96, + "t1.micro": 0.027, + "t2.micro": 0.0186, + "t2.small": 0.0372, + "t2.medium": 0.0744, + "t2.large": 0.1488, + "t2.xlarge": 0.2976, + "t2.nano": 0.0093, + "t2.2xlarge": 0.5952, + "x1.16xlarge": 13.005, + "x1.32xlarge": 26.01 + }, + "ec2_suse": { + "a1.medium": { + "ap-northeast-1": 0.0631, + "ap-south-1": 0.0565, + "ap-southeast-1": 0.0623, + "ap-southeast-2": 0.0663, + "eu-central-1": 0.0601, + "eu-west-1": 0.0598, + "us-east-1": 0.0565, + "us-east-2": 0.058, + "us-west-2": 0.058 + }, + "a1.large": { + "ap-northeast-1": 0.1205, + "ap-south-1": 0.1073, + "ap-southeast-1": 0.1151, + "ap-southeast-2": 0.0, + "eu-central-1": 0.1145, + "eu-west-1": 0.0, + "us-east-1": 0.1073, + "us-east-2": 0.1073, + "us-west-2": 0.1073 + }, + "a1.xlarge": { + "ap-northeast-1": 0.1847, + "ap-south-1": 0.1583, + "ap-southeast-1": 0.1739, + "ap-southeast-2": 0.0, + "eu-central-1": 0.1797, + "eu-west-1": 0.0, + "us-east-1": 0.1644, + "us-east-2": 0.1583, + "us-west-2": 0.1583 + }, + "a1.metal": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.533, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.591, + "eu-west-1": 0.586, + "us-east-1": 0.533, + "us-east-2": 0.533, + "us-west-2": 0.533 + }, + "a1.2xlarge": { + "ap-northeast-1": 0.3972, + "ap-south-1": 0.329, + "ap-southeast-1": 0.3602, + "ap-southeast-2": 0.0, + "eu-central-1": 0.3578, + "eu-west-1": 0.3554, + "us-east-1": 0.329, + "us-east-2": 0.329, + "us-west-2": 0.329 + }, + "a1.4xlarge": { + "ap-northeast-1": 0.6386, + "ap-south-1": 0.533, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.6578, + "eu-central-1": 0.5906, + "eu-west-1": 0.5858, + "us-east-1": 0.533, + "us-east-2": 0.533, + "us-west-2": 0.533 + }, + "c1.medium": { + "ap-northeast-1": 0.258, + "ap-southeast-1": 0.264, + "ap-southeast-2": 0.264, + "eu-west-1": 0.248, + "sa-east-1": 0.279, + "us-east-1": 0.23, + "us-gov-west-1": 0.257, + "us-west-1": 0.248, + "us-west-2": 0.23 + }, + "c1.xlarge": { + "ap-northeast-1": 0.732, + "ap-southeast-1": 0.755, + "ap-southeast-2": 0.755, + "eu-west-1": 0.692, + "sa-east-1": 0.818, + "us-east-1": 0.62, + "us-gov-west-1": 0.728, + "us-west-1": 0.692, + "us-west-2": 0.62 + }, + "c3.large": { + "ap-northeast-1": 0.228, + "ap-northeast-2": 0.22672, + "ap-southeast-1": 0.232, + "ap-southeast-2": 0.232, + "eu-central-1": 0.229, + "eu-west-1": 0.22, + "sa-east-1": 0.263, + "us-east-1": 0.205, + "us-gov-west-1": 0.0, + "us-west-1": 0.22, + "us-west-2": 0.216 + }, + "c3.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.33, + "ap-southeast-1": 0.365, + "ap-southeast-2": 0.0, + "eu-central-1": 0.358, + "eu-west-1": 0.339, + "sa-east-1": 0.458, + "us-east-1": 0.31, + "us-gov-west-1": 0.352, + "us-west-1": 0.339, + "us-west-2": 0.331 + }, + "c3.2xlarge": { + "ap-northeast-1": 0.662, + "ap-northeast-2": 0.60589, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.682, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "sa-east-1": 0.75, + "us-east-1": 0.52, + "us-gov-west-1": 0.604, + "us-west-1": 0.578, + "us-west-2": 0.562 + }, + "c3.4xlarge": { + "ap-northeast-1": 1.223, + "ap-northeast-2": 1.11079, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.264, + "eu-central-1": 1.132, + "eu-west-1": 1.056, + "sa-east-1": 1.4, + "us-east-1": 0.94, + "us-gov-west-1": 0.0, + "us-west-1": 1.152, + "us-west-2": 0.94 + }, + "c3.8xlarge": { + "ap-northeast-1": 2.143, + "ap-northeast-2": 1.939, + "ap-southeast-1": 2.217, + "ap-southeast-2": 2.217, + "eu-central-1": 2.164, + "eu-west-1": 2.012, + "sa-east-1": 0.0, + "us-east-1": 1.78, + "us-gov-west-1": 2.116, + "us-west-1": 0.0, + "us-west-2": 1.78 + }, + "c4.large": { + "ap-northeast-1": 0.239, + "ap-northeast-2": 0.214, + "ap-northeast-3": 0.239, + "ap-south-1": 0.2, + "ap-southeast-1": 0.215, + "ap-southeast-2": 0.23, + "ca-central-1": 0.221, + "eu-central-1": 0.214, + "eu-west-1": 0.0, + "eu-west-2": 0.219, + "sa-east-1": 0.255, + "us-east-1": 0.2, + "us-east-2": 0.2, + "us-gov-west-1": 0.22, + "us-west-1": 0.224, + "us-west-2": 0.2 + }, + "c4.xlarge": { + "ap-northeast-1": 0.352, + "ap-northeast-2": 0.327, + "ap-northeast-3": 0.352, + "ap-south-1": 0.32, + "ap-southeast-1": 0.331, + "ap-southeast-2": 0.361, + "ca-central-1": 0.34, + "eu-central-1": 0.327, + "eu-west-1": 0.326, + "eu-west-2": 0.337, + "sa-east-1": 0.409, + "us-east-1": 0.299, + "us-east-2": 0.319, + "us-gov-west-1": 0.339, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c4.2xlarge": { + "ap-northeast-1": 0.604, + "ap-northeast-2": 0.554, + "ap-northeast-3": 0.654, + "ap-south-1": 0.5, + "ap-southeast-1": 0.562, + "ap-southeast-2": 0.622, + "ca-central-1": 0.538, + "eu-central-1": 0.0, + "eu-west-1": 0.598, + "eu-west-2": 0.0, + "sa-east-1": 0.718, + "us-east-1": 0.538, + "us-east-2": 0.538, + "us-gov-west-1": 0.579, + "us-west-1": 0.598, + "us-west-2": 0.0 + }, + "c4.4xlarge": { + "ap-northeast-1": 1.209, + "ap-northeast-2": 1.098, + "ap-northeast-3": 0.0, + "ap-south-1": 0.98, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.246, + "ca-central-1": 0.0, + "eu-central-1": 1.1, + "eu-west-1": 1.005, + "eu-west-2": 1.05, + "sa-east-1": 1.335, + "us-east-1": 0.896, + "us-east-2": 0.896, + "us-gov-west-1": 1.058, + "us-west-1": 1.097, + "us-west-2": 0.0 + }, + "c4.8xlarge": { + "ap-northeast-1": 2.116, + "ap-northeast-2": 1.915, + "ap-northeast-3": 0.0, + "ap-south-1": 1.7, + "ap-southeast-1": 1.948, + "ap-southeast-2": 2.185, + "ca-central-1": 1.85, + "eu-central-1": 1.917, + "eu-west-1": 1.911, + "eu-west-2": 2.002, + "sa-east-1": 2.57, + "us-east-1": 1.691, + "us-east-2": 1.691, + "us-gov-west-1": 2.015, + "us-west-1": 2.093, + "us-west-2": 1.691 + }, + "c5.large": { + "af-south-1": 0.0, + "ap-east-1": 0.171, + "ap-northeast-1": 0.163, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.17, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.154, + "ap-southeast-2": 0.167, + "ap-southeast-3": 0.154, + "ap-southeast-4": 0.167, + "ca-central-1": 0.149, + "ca-west-1": 0.0, + "eu-central-1": 0.159, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.157, + "eu-south-2": 0.0, + "eu-west-1": 0.158, + "eu-west-2": 0.157, + "eu-west-3": 0.157, + "il-central-1": 0.163, + "me-central-1": 0.162, + "me-south-1": 0.162, + "sa-east-1": 0.187, + "us-east-1": 0.0, + "us-east-2": 0.141, + "us-gov-east-1": 0.158, + "us-gov-west-1": 0.158, + "us-west-1": 0.162, + "us-west-2": 0.141, + "us-west-2-lax-1": 0.158 + }, + "c5.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.272, + "ap-northeast-1": 0.283, + "ap-northeast-2": 0.26, + "ap-northeast-3": 0.0, + "ap-south-1": 0.237, + "ap-south-2": 0.0, + "ap-southeast-1": 0.252, + "ap-southeast-2": 0.278, + "ap-southeast-3": 0.252, + "ap-southeast-4": 0.292, + "ca-central-1": 0.0, + "ca-west-1": 0.242, + "eu-central-1": 0.0, + "eu-central-2": 0.27, + "eu-north-1": 0.249, + "eu-south-1": 0.258, + "eu-south-2": 0.248, + "eu-west-1": 0.0, + "eu-west-2": 0.258, + "eu-west-3": 0.258, + "il-central-1": 0.0, + "me-central-1": 0.268, + "me-south-1": 0.268, + "sa-east-1": 0.318, + "us-east-1": 0.226, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.273, + "us-west-1": 0.281, + "us-west-2": 0.226, + "us-west-2-lax-1": 0.0 + }, + "c5.metal": { + "af-south-1": 5.572, + "ap-east-1": 5.284, + "ap-northeast-1": 5.236, + "ap-northeast-2": 4.708, + "ap-northeast-3": 0.0, + "ap-south-1": 4.18, + "ap-south-2": 4.205, + "ap-southeast-1": 4.804, + "ap-southeast-2": 5.428, + "ap-southeast-3": 4.804, + "ap-southeast-4": 5.453, + "ca-central-1": 4.564, + "ca-west-1": 4.589, + "eu-central-1": 4.756, + "eu-central-2": 5.247, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 4.733, + "eu-west-1": 4.708, + "eu-west-2": 4.948, + "eu-west-3": 4.948, + "il-central-1": 4.963, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 6.388, + "us-east-1": 4.18, + "us-east-2": 4.18, + "us-gov-east-1": 4.996, + "us-gov-west-1": 4.996, + "us-west-1": 5.188, + "us-west-2": 4.18, + "us-west-2-lax-1": 4.996 + }, + "c5.2xlarge": { + "af-south-1": 0.583, + "ap-east-1": 0.56, + "ap-northeast-1": 0.528, + "ap-northeast-2": 0.484, + "ap-northeast-3": 0.0, + "ap-south-1": 0.44, + "ap-south-2": 0.465, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.544, + "ap-southeast-3": 0.492, + "ap-southeast-4": 0.569, + "ca-central-1": 0.472, + "ca-west-1": 0.497, + "eu-central-1": 0.488, + "eu-central-2": 0.552, + "eu-north-1": 0.464, + "eu-south-1": 0.0, + "eu-south-2": 0.509, + "eu-west-1": 0.484, + "eu-west-2": 0.504, + "eu-west-3": 0.0, + "il-central-1": 0.528, + "me-central-1": 0.547, + "me-south-1": 0.522, + "sa-east-1": 0.624, + "us-east-1": 0.46, + "us-east-2": 0.44, + "us-gov-east-1": 0.508, + "us-gov-west-1": 0.0, + "us-west-1": 0.552, + "us-west-2": 0.44, + "us-west-2-lax-1": 0.533 + }, + "c5.4xlarge": { + "af-south-1": 1.012, + "ap-east-1": 0.964, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.918, + "ap-northeast-3": 1.007, + "ap-south-1": 0.824, + "ap-south-2": 0.0, + "ap-southeast-1": 0.934, + "ap-southeast-2": 0.988, + "ap-southeast-3": 0.931, + "ap-southeast-4": 1.066, + "ca-central-1": 0.892, + "ca-west-1": 0.0, + "eu-central-1": 0.876, + "eu-central-2": 0.979, + "eu-north-1": 0.0, + "eu-south-1": 0.956, + "eu-south-2": 0.939, + "eu-west-1": 0.868, + "eu-west-2": 0.0, + "eu-west-3": 0.908, + "il-central-1": 0.0, + "me-central-1": 1.02, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.78, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.948, + "us-west-2": 0.78, + "us-west-2-lax-1": 0.916 + }, + "c5.9xlarge": { + "af-south-1": 0.0, + "ap-east-1": 2.044, + "ap-northeast-1": 2.158, + "ap-northeast-2": 1.828, + "ap-northeast-3": 2.026, + "ap-south-1": 1.63, + "ap-south-2": 1.655, + "ap-southeast-1": 1.864, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.97, + "ap-southeast-4": 0.0, + "ca-central-1": 1.774, + "ca-west-1": 0.0, + "eu-central-1": 1.846, + "eu-central-2": 2.046, + "eu-north-1": 1.738, + "eu-south-1": 1.918, + "eu-south-2": 1.853, + "eu-west-1": 1.941, + "eu-west-2": 0.0, + "eu-west-3": 2.037, + "il-central-1": 1.939, + "me-central-1": 2.026, + "me-south-1": 2.001, + "sa-east-1": 2.458, + "us-east-1": 0.0, + "us-east-2": 1.63, + "us-gov-east-1": 1.936, + "us-gov-west-1": 2.046, + "us-west-1": 2.008, + "us-west-2": 1.63, + "us-west-2-lax-1": 1.936 + }, + "c5.12xlarge": { + "af-south-1": 2.836, + "ap-east-1": 0.0, + "ap-northeast-1": 2.668, + "ap-northeast-2": 2.553, + "ap-northeast-3": 2.668, + "ap-south-1": 2.271, + "ap-south-2": 2.165, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.926, + "ap-southeast-3": 2.593, + "ap-southeast-4": 2.789, + "ca-central-1": 2.332, + "ca-west-1": 2.357, + "eu-central-1": 2.428, + "eu-central-2": 2.686, + "eu-north-1": 2.284, + "eu-south-1": 0.0, + "eu-south-2": 2.567, + "eu-west-1": 2.404, + "eu-west-2": 2.524, + "eu-west-3": 2.682, + "il-central-1": 2.544, + "me-central-1": 2.811, + "me-south-1": 2.786, + "sa-east-1": 3.244, + "us-east-1": 2.14, + "us-east-2": 0.0, + "us-gov-east-1": 2.548, + "us-gov-west-1": 2.548, + "us-west-1": 2.81, + "us-west-2": 2.14, + "us-west-2-lax-1": 2.548 + }, + "c5.18xlarge": { + "af-south-1": 0.0, + "ap-east-1": 3.988, + "ap-northeast-1": 3.952, + "ap-northeast-2": 3.556, + "ap-northeast-3": 3.952, + "ap-south-1": 3.16, + "ap-south-2": 3.185, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.096, + "ap-southeast-3": 3.628, + "ap-southeast-4": 4.121, + "ca-central-1": 3.448, + "ca-west-1": 3.473, + "eu-central-1": 3.592, + "eu-central-2": 0.0, + "eu-north-1": 3.376, + "eu-south-1": 3.736, + "eu-south-2": 0.0, + "eu-west-1": 3.556, + "eu-west-2": 0.0, + "eu-west-3": 3.736, + "il-central-1": 3.754, + "me-central-1": 3.927, + "me-south-1": 0.0, + "sa-east-1": 4.816, + "us-east-1": 0.0, + "us-east-2": 3.16, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.772, + "us-west-1": 0.0, + "us-west-2": 3.16, + "us-west-2-lax-1": 3.772 + }, + "c5.24xlarge": { + "af-south-1": 5.572, + "ap-east-1": 5.284, + "ap-northeast-1": 5.236, + "ap-northeast-2": 4.708, + "ap-northeast-3": 0.0, + "ap-south-1": 4.18, + "ap-south-2": 4.205, + "ap-southeast-1": 4.829, + "ap-southeast-2": 5.428, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 4.564, + "ca-west-1": 4.589, + "eu-central-1": 4.781, + "eu-central-2": 5.247, + "eu-north-1": 0.0, + "eu-south-1": 4.948, + "eu-south-2": 4.733, + "eu-west-1": 4.708, + "eu-west-2": 4.948, + "eu-west-3": 4.948, + "il-central-1": 4.963, + "me-central-1": 5.194, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 4.18, + "us-east-2": 0.0, + "us-gov-east-1": 4.996, + "us-gov-west-1": 4.996, + "us-west-1": 0.0, + "us-west-2": 4.18, + "us-west-2-lax-1": 4.996 + }, + "c5a.large": { + "af-south-1": 0.159, + "ap-east-1": 0.153, + "ap-northeast-1": 0.152, + "ap-northeast-2": 0.142, + "ap-south-1": 0.103, + "ap-southeast-1": 0.144, + "ap-southeast-2": 0.156, + "ca-central-1": 0.14, + "eu-central-1": 0.143, + "eu-north-1": 0.138, + "eu-south-1": 0.147, + "eu-west-1": 0.142, + "eu-west-2": 0.147, + "eu-west-3": 0.147, + "me-south-1": 0.151, + "sa-east-1": 0.174, + "us-east-1": 0.133, + "us-east-2": 0.133, + "us-gov-east-1": 0.148, + "us-gov-west-1": 0.148, + "us-west-1": 0.151, + "us-west-2": 0.133 + }, + "c5a.xlarge": { + "af-south-1": 0.262, + "ap-east-1": 0.25, + "ap-northeast-1": 0.248, + "ap-northeast-2": 0.228, + "ap-south-1": 0.15, + "ap-southeast-1": 0.232, + "ap-southeast-2": 0.256, + "ca-central-1": 0.224, + "eu-central-1": 0.23, + "eu-north-1": 0.22, + "eu-south-1": 0.238, + "eu-west-1": 0.228, + "eu-west-2": 0.238, + "eu-west-3": 0.238, + "me-south-1": 0.246, + "sa-east-1": 0.292, + "us-east-1": 0.21, + "us-east-2": 0.21, + "us-gov-east-1": 0.24, + "us-gov-west-1": 0.24, + "us-west-1": 0.246, + "us-west-2": 0.21 + }, + "c5a.2xlarge": { + "af-south-1": 0.537, + "ap-east-1": 0.513, + "ap-northeast-1": 0.509, + "ap-northeast-2": 0.469, + "ap-south-1": 0.313, + "ap-southeast-1": 0.477, + "ap-southeast-2": 0.525, + "ca-central-1": 0.461, + "eu-central-1": 0.473, + "eu-north-1": 0.453, + "eu-south-1": 0.489, + "eu-west-1": 0.469, + "eu-west-2": 0.489, + "eu-west-3": 0.489, + "me-south-1": 0.505, + "sa-east-1": 0.597, + "us-east-1": 0.433, + "us-east-2": 0.433, + "us-gov-east-1": 0.493, + "us-gov-west-1": 0.493, + "us-west-1": 0.505, + "us-west-2": 0.433 + }, + "c5a.4xlarge": { + "af-south-1": 0.949, + "ap-east-1": 0.901, + "ap-northeast-1": 0.893, + "ap-northeast-2": 0.813, + "ap-south-1": 0.501, + "ap-southeast-1": 0.829, + "ap-southeast-2": 0.925, + "ca-central-1": 0.797, + "eu-central-1": 0.821, + "eu-north-1": 0.781, + "eu-south-1": 0.853, + "eu-west-1": 0.813, + "eu-west-2": 0.853, + "eu-west-3": 0.853, + "me-south-1": 0.885, + "sa-east-1": 1.069, + "us-east-1": 0.741, + "us-east-2": 0.741, + "us-gov-east-1": 0.861, + "us-gov-west-1": 0.861, + "us-west-1": 0.885, + "us-west-2": 0.741 + }, + "c5a.8xlarge": { + "af-south-1": 1.773, + "ap-east-1": 1.677, + "ap-northeast-1": 1.661, + "ap-northeast-2": 1.501, + "ap-south-1": 0.877, + "ap-southeast-1": 1.533, + "ap-southeast-2": 1.725, + "ca-central-1": 1.469, + "eu-central-1": 1.517, + "eu-north-1": 1.437, + "eu-south-1": 1.581, + "eu-west-1": 1.501, + "eu-west-2": 1.581, + "eu-west-3": 1.581, + "me-south-1": 1.645, + "sa-east-1": 2.013, + "us-east-1": 1.357, + "us-east-2": 1.357, + "us-gov-east-1": 1.597, + "us-gov-west-1": 1.597, + "us-west-1": 1.645, + "us-west-2": 1.357 + }, + "c5a.12xlarge": { + "af-south-1": 2.597, + "ap-east-1": 2.453, + "ap-northeast-1": 2.429, + "ap-northeast-2": 2.189, + "ap-south-1": 1.253, + "ap-southeast-1": 2.237, + "ap-southeast-2": 2.525, + "ca-central-1": 2.141, + "eu-central-1": 2.213, + "eu-north-1": 2.093, + "eu-south-1": 2.309, + "eu-west-1": 2.189, + "eu-west-2": 2.309, + "eu-west-3": 2.309, + "me-south-1": 2.405, + "sa-east-1": 2.957, + "us-east-1": 1.973, + "us-east-2": 1.973, + "us-gov-east-1": 2.333, + "us-gov-west-1": 2.333, + "us-west-1": 2.405, + "us-west-2": 1.973 + }, + "c5a.16xlarge": { + "af-south-1": 3.421, + "ap-east-1": 3.229, + "ap-northeast-1": 3.197, + "ap-northeast-2": 2.877, + "ap-south-1": 1.629, + "ap-southeast-1": 2.941, + "ap-southeast-2": 3.325, + "ca-central-1": 2.813, + "eu-central-1": 2.909, + "eu-north-1": 2.749, + "eu-south-1": 3.037, + "eu-west-1": 2.877, + "eu-west-2": 3.037, + "eu-west-3": 3.037, + "me-south-1": 3.165, + "sa-east-1": 3.901, + "us-east-1": 2.589, + "us-east-2": 2.589, + "us-gov-east-1": 3.069, + "us-gov-west-1": 3.069, + "us-west-1": 3.165, + "us-west-2": 2.589 + }, + "c5a.24xlarge": { + "af-south-1": 5.069, + "ap-east-1": 4.781, + "ap-northeast-1": 4.733, + "ap-northeast-2": 4.253, + "ap-south-1": 2.381, + "ap-southeast-1": 4.349, + "ap-southeast-2": 4.925, + "ca-central-1": 4.157, + "eu-central-1": 4.301, + "eu-north-1": 4.061, + "eu-south-1": 4.493, + "eu-west-1": 4.253, + "eu-west-2": 4.493, + "eu-west-3": 4.493, + "me-south-1": 4.685, + "sa-east-1": 5.789, + "us-east-1": 3.821, + "us-east-2": 3.821, + "us-gov-east-1": 4.541, + "us-gov-west-1": 4.541, + "us-west-1": 4.685, + "us-west-2": 3.821 + }, + "c5ad.large": { + "af-south-1": 0.173, + "ap-southeast-1": 0.157, + "ap-southeast-2": 0.169, + "eu-central-1": 0.156, + "eu-south-1": 0.159, + "eu-west-1": 0.154, + "me-south-1": 0.164, + "sa-east-1": 0.19, + "us-east-1": 0.142, + "us-east-2": 0.142, + "us-west-2": 0.142 + }, + "c5ad.xlarge": { + "af-south-1": 0.29, + "ap-southeast-1": 0.258, + "ap-southeast-2": 0.282, + "eu-central-1": 0.256, + "eu-south-1": 0.262, + "eu-west-1": 0.252, + "me-south-1": 0.272, + "sa-east-1": 0.324, + "us-east-1": 0.228, + "us-east-2": 0.228, + "us-west-2": 0.228 + }, + "c5ad.2xlarge": { + "af-south-1": 0.593, + "ap-southeast-1": 0.529, + "ap-southeast-2": 0.577, + "eu-central-1": 0.525, + "eu-south-1": 0.537, + "eu-west-1": 0.517, + "me-south-1": 0.557, + "sa-east-1": 0.661, + "us-east-1": 0.469, + "us-east-2": 0.469, + "us-west-2": 0.469 + }, + "c5ad.4xlarge": { + "af-south-1": 1.061, + "ap-southeast-1": 0.933, + "ap-southeast-2": 1.029, + "eu-central-1": 0.925, + "eu-south-1": 0.949, + "eu-west-1": 0.909, + "me-south-1": 0.989, + "sa-east-1": 1.197, + "us-east-1": 0.813, + "us-east-2": 0.813, + "us-west-2": 0.813 + }, + "c5ad.8xlarge": { + "af-south-1": 1.997, + "ap-southeast-1": 1.741, + "ap-southeast-2": 1.933, + "eu-central-1": 1.725, + "eu-south-1": 1.773, + "eu-west-1": 1.693, + "me-south-1": 1.853, + "sa-east-1": 2.269, + "us-east-1": 1.501, + "us-east-2": 1.501, + "us-west-2": 1.501 + }, + "c5ad.12xlarge": { + "af-south-1": 2.933, + "ap-southeast-1": 2.549, + "ap-southeast-2": 2.837, + "eu-central-1": 2.525, + "eu-south-1": 2.597, + "eu-west-1": 2.477, + "me-south-1": 2.717, + "sa-east-1": 3.341, + "us-east-1": 2.189, + "us-east-2": 2.189, + "us-west-2": 2.189 + }, + "c5ad.16xlarge": { + "af-south-1": 3.869, + "ap-southeast-1": 3.357, + "ap-southeast-2": 3.741, + "eu-central-1": 3.325, + "eu-south-1": 3.421, + "eu-west-1": 3.261, + "me-south-1": 3.581, + "sa-east-1": 4.413, + "us-east-1": 2.877, + "us-east-2": 2.877, + "us-west-2": 2.877 + }, + "c5ad.24xlarge": { + "af-south-1": 5.741, + "ap-southeast-1": 4.973, + "ap-southeast-2": 5.549, + "eu-central-1": 4.925, + "eu-south-1": 5.069, + "eu-west-1": 4.829, + "me-south-1": 5.309, + "sa-east-1": 6.557, + "us-east-1": 4.253, + "us-east-2": 4.253, + "us-west-2": 4.253 + }, + "c5d.large": { + "af-south-1": 0.194, + "ap-east-1": 0.179, + "ap-northeast-1": 0.178, + "ap-northeast-2": 0.166, + "ap-northeast-3": 0.0, + "ap-south-1": 0.155, + "ap-south-2": 0.161, + "ap-southeast-1": 0.168, + "ap-southeast-2": 0.182, + "ap-southeast-3": 0.175, + "ap-southeast-4": 0.182, + "ca-central-1": 0.162, + "eu-central-1": 0.174, + "eu-central-2": 0.178, + "eu-north-1": 0.16, + "eu-south-1": 0.17, + "eu-south-2": 0.172, + "eu-west-1": 0.165, + "eu-west-2": 0.171, + "eu-west-3": 0.171, + "il-central-1": 0.0, + "me-central-1": 0.176, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.152, + "us-east-2": 0.0, + "us-gov-east-1": 0.179, + "us-gov-west-1": 0.172, + "us-west-1": 0.176, + "us-west-2": 0.152 + }, + "c5d.xlarge": { + "af-south-1": 0.316, + "ap-east-1": 0.302, + "ap-northeast-1": 0.3, + "ap-northeast-2": 0.276, + "ap-northeast-3": 0.3, + "ap-south-1": 0.254, + "ap-south-2": 0.254, + "ap-southeast-1": 0.28, + "ap-southeast-2": 0.308, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 0.268, + "eu-central-1": 0.0, + "eu-central-2": 0.301, + "eu-north-1": 0.277, + "eu-south-1": 0.284, + "eu-south-2": 0.287, + "eu-west-1": 0.287, + "eu-west-2": 0.286, + "eu-west-3": 0.0, + "il-central-1": 0.285, + "me-central-1": 0.296, + "me-south-1": 0.0, + "sa-east-1": 0.354, + "us-east-1": 0.248, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.288, + "us-west-1": 0.311, + "us-west-2": 0.248 + }, + "c5d.metal": { + "af-south-1": 0.0, + "ap-northeast-1": 5.956, + "ap-northeast-2": 5.38, + "ap-northeast-3": 5.956, + "ap-south-1": 4.852, + "ap-south-2": 4.877, + "ap-southeast-1": 5.476, + "ap-southeast-2": 6.148, + "ap-southeast-3": 5.476, + "ap-southeast-4": 6.173, + "ca-central-1": 5.188, + "eu-central-1": 5.428, + "eu-central-2": 5.986, + "eu-north-1": 5.092, + "eu-south-1": 5.572, + "eu-south-2": 5.357, + "eu-west-1": 5.332, + "eu-west-2": 5.62, + "il-central-1": 5.619, + "me-central-1": 0.0, + "sa-east-1": 7.252, + "us-east-1": 4.708, + "us-east-2": 4.708, + "us-gov-west-1": 5.668, + "us-west-1": 5.86, + "us-west-2": 4.708 + }, + "c5d.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.623, + "ap-northeast-1": 0.588, + "ap-northeast-2": 0.54, + "ap-northeast-3": 0.588, + "ap-south-1": 0.0, + "ap-south-2": 0.521, + "ap-southeast-1": 0.577, + "ap-southeast-2": 0.635, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.629, + "ca-central-1": 0.524, + "eu-central-1": 0.544, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.556, + "eu-south-2": 0.561, + "eu-west-1": 0.0, + "eu-west-2": 0.56, + "eu-west-3": 0.0, + "il-central-1": 0.583, + "me-central-1": 0.633, + "me-south-1": 0.58, + "sa-east-1": 0.736, + "us-east-1": 0.484, + "us-east-2": 0.484, + "us-gov-east-1": 0.592, + "us-gov-west-1": 0.592, + "us-west-1": 0.58, + "us-west-2": 0.0 + }, + "c5d.4xlarge": { + "af-south-1": 1.202, + "ap-east-1": 1.147, + "ap-northeast-1": 1.076, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.076, + "ap-south-1": 0.892, + "ap-south-2": 0.917, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.17, + "ap-southeast-3": 0.996, + "ap-southeast-4": 1.133, + "ca-central-1": 0.948, + "eu-central-1": 1.047, + "eu-central-2": 0.0, + "eu-north-1": 0.932, + "eu-south-1": 1.067, + "eu-south-2": 0.997, + "eu-west-1": 0.972, + "eu-west-2": 1.08, + "eu-west-3": 1.02, + "il-central-1": 1.041, + "me-central-1": 1.084, + "me-south-1": 1.059, + "sa-east-1": 1.292, + "us-east-1": 0.914, + "us-east-2": 0.914, + "us-gov-east-1": 1.028, + "us-gov-west-1": 1.028, + "us-west-1": 0.0, + "us-west-2": 0.914 + }, + "c5d.9xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 2.445, + "ap-northeast-2": 2.08, + "ap-northeast-3": 2.296, + "ap-south-1": 1.996, + "ap-south-2": 1.907, + "ap-southeast-1": 2.245, + "ap-southeast-2": 0.0, + "ap-southeast-3": 2.116, + "ap-southeast-4": 2.529, + "ca-central-1": 2.13, + "eu-central-1": 2.098, + "eu-central-2": 2.455, + "eu-north-1": 0.0, + "eu-south-1": 2.152, + "eu-south-2": 2.087, + "eu-west-1": 2.191, + "eu-west-2": 2.17, + "eu-west-3": 2.17, + "il-central-1": 2.185, + "me-central-1": 2.413, + "me-south-1": 2.4, + "sa-east-1": 0.0, + "us-east-1": 1.932, + "us-east-2": 1.932, + "us-gov-east-1": 2.314, + "us-gov-west-1": 2.188, + "us-west-1": 2.26, + "us-west-2": 1.828 + }, + "c5d.12xlarge": { + "af-south-1": 3.22, + "ap-northeast-1": 3.028, + "ap-northeast-2": 2.74, + "ap-northeast-3": 3.028, + "ap-south-1": 2.476, + "ap-south-2": 2.501, + "ap-southeast-1": 2.788, + "ap-southeast-2": 3.124, + "ap-southeast-3": 2.949, + "ap-southeast-4": 3.149, + "ca-central-1": 2.644, + "eu-central-1": 2.764, + "eu-central-2": 0.0, + "eu-north-1": 2.596, + "eu-south-1": 0.0, + "eu-south-2": 2.898, + "eu-west-1": 2.716, + "eu-west-2": 2.86, + "il-central-1": 3.037, + "me-central-1": 0.0, + "sa-east-1": 3.676, + "us-east-1": 2.404, + "us-east-2": 2.404, + "us-gov-west-1": 0.0, + "us-west-1": 2.98, + "us-west-2": 2.404 + }, + "c5d.18xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.06, + "ap-northeast-3": 4.492, + "ap-south-1": 3.664, + "ap-south-2": 3.689, + "ap-southeast-1": 4.132, + "ap-southeast-2": 4.636, + "ap-southeast-3": 4.132, + "ap-southeast-4": 0.0, + "ca-central-1": 3.916, + "eu-central-1": 4.096, + "eu-central-2": 0.0, + "eu-north-1": 3.844, + "eu-south-1": 0.0, + "eu-south-2": 4.049, + "eu-west-1": 4.024, + "eu-west-2": 0.0, + "eu-west-3": 4.24, + "il-central-1": 4.245, + "me-central-1": 4.441, + "me-south-1": 4.416, + "sa-east-1": 5.464, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 4.276, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 3.556 + }, + "c5d.24xlarge": { + "af-south-1": 6.714, + "ap-northeast-1": 5.956, + "ap-northeast-2": 5.38, + "ap-northeast-3": 5.956, + "ap-south-1": 4.852, + "ap-south-2": 0.0, + "ap-southeast-1": 5.476, + "ap-southeast-2": 0.0, + "ap-southeast-3": 5.799, + "ap-southeast-4": 0.0, + "ca-central-1": 5.188, + "eu-central-1": 5.428, + "eu-central-2": 6.337, + "eu-north-1": 5.092, + "eu-south-1": 5.572, + "eu-south-2": 5.357, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "il-central-1": 5.619, + "me-central-1": 5.88, + "sa-east-1": 7.252, + "us-east-1": 4.708, + "us-east-2": 4.708, + "us-gov-west-1": 6.005, + "us-west-1": 5.86, + "us-west-2": 4.708 + }, + "c5n.large": { + "af-south-1": 0.202, + "ap-east-1": 0.208, + "ap-northeast-1": 0.192, + "ap-northeast-2": 0.178, + "ap-northeast-3": 0.0, + "ap-south-1": 0.164, + "ap-southeast-1": 0.188, + "ap-southeast-2": 0.206, + "ap-southeast-3": 0.0, + "ca-central-1": 0.174, + "eu-central-1": 0.179, + "eu-north-1": 0.179, + "eu-south-1": 0.185, + "eu-west-1": 0.178, + "eu-west-2": 0.0, + "eu-west-3": 0.184, + "me-south-1": 0.19, + "sa-east-1": 0.0, + "us-east-1": 0.171, + "us-east-2": 0.164, + "us-gov-east-1": 0.186, + "us-gov-west-1": 0.194, + "us-west-1": 0.191, + "us-west-2": 0.164 + }, + "c5n.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.359, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.3, + "ap-northeast-3": 0.345, + "ap-south-1": 0.272, + "ap-southeast-1": 0.304, + "ap-southeast-2": 0.338, + "ap-southeast-3": 0.0, + "ca-central-1": 0.292, + "eu-central-1": 0.0, + "eu-north-1": 0.288, + "eu-south-1": 0.314, + "eu-west-1": 0.3, + "eu-west-2": 0.312, + "eu-west-3": 0.312, + "me-south-1": 0.324, + "sa-east-1": 0.388, + "us-east-1": 0.272, + "us-east-2": 0.285, + "us-gov-east-1": 0.316, + "us-gov-west-1": 0.316, + "us-west-1": 0.0, + "us-west-2": 0.272 + }, + "c5n.metal": { + "af-south-1": 0.0, + "ap-east-1": 5.273, + "ap-northeast-1": 5.021, + "ap-northeast-2": 4.517, + "ap-northeast-3": 5.021, + "ap-south-1": 4.013, + "ap-southeast-1": 4.589, + "ap-southeast-2": 5.201, + "ap-southeast-3": 4.589, + "ca-central-1": 0.0, + "eu-central-1": 4.553, + "eu-north-1": 4.301, + "eu-south-1": 4.769, + "eu-west-1": 4.517, + "eu-west-2": 4.733, + "eu-west-3": 4.733, + "me-south-1": 4.949, + "sa-east-1": 6.101, + "us-east-1": 4.013, + "us-east-2": 4.013, + "us-gov-east-1": 4.805, + "us-gov-west-1": 4.805, + "us-west-1": 4.985, + "us-west-2": 4.013 + }, + "c5n.2xlarge": { + "af-south-1": 0.706, + "ap-east-1": 0.731, + "ap-northeast-1": 0.669, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.669, + "ap-south-1": 0.0, + "ap-southeast-1": 0.621, + "ap-southeast-2": 0.689, + "ap-southeast-3": 0.621, + "ca-central-1": 0.0, + "eu-central-1": 0.617, + "eu-north-1": 0.617, + "eu-south-1": 0.641, + "eu-west-1": 0.613, + "eu-west-2": 0.0, + "eu-west-3": 0.637, + "me-south-1": 0.661, + "sa-east-1": 0.829, + "us-east-1": 0.557, + "us-east-2": 0.557, + "us-gov-east-1": 0.645, + "us-gov-west-1": 0.645, + "us-west-1": 0.697, + "us-west-2": 0.557 + }, + "c5n.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.338, + "ap-northeast-1": 1.213, + "ap-northeast-2": 1.101, + "ap-northeast-3": 0.0, + "ap-south-1": 0.989, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.321, + "ap-southeast-3": 0.0, + "ca-central-1": 1.069, + "eu-central-1": 1.109, + "eu-north-1": 1.109, + "eu-south-1": 1.157, + "eu-west-1": 1.101, + "eu-west-2": 1.149, + "eu-west-3": 1.149, + "me-south-1": 1.197, + "sa-east-1": 1.453, + "us-east-1": 1.041, + "us-east-2": 0.989, + "us-gov-east-1": 1.165, + "us-gov-west-1": 1.165, + "us-west-1": 1.205, + "us-west-2": 0.989 + }, + "c5n.9xlarge": { + "af-south-1": 2.739, + "ap-east-1": 2.853, + "ap-northeast-1": 2.573, + "ap-northeast-2": 2.321, + "ap-northeast-3": 2.573, + "ap-south-1": 0.0, + "ap-southeast-1": 2.357, + "ap-southeast-2": 2.663, + "ap-southeast-3": 2.357, + "ca-central-1": 0.0, + "eu-central-1": 2.339, + "eu-north-1": 0.0, + "eu-south-1": 2.447, + "eu-west-1": 2.321, + "eu-west-2": 2.429, + "eu-west-3": 2.429, + "me-south-1": 2.537, + "sa-east-1": 0.0, + "us-east-1": 2.069, + "us-east-2": 0.0, + "us-gov-east-1": 2.465, + "us-gov-west-1": 2.465, + "us-west-1": 2.701, + "us-west-2": 0.0 + }, + "c5n.18xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 5.021, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 4.013, + "ap-southeast-1": 4.589, + "ap-southeast-2": 5.201, + "ap-southeast-3": 4.589, + "ca-central-1": 0.0, + "eu-central-1": 4.553, + "eu-north-1": 4.301, + "eu-south-1": 4.769, + "eu-west-1": 4.517, + "eu-west-2": 4.733, + "eu-west-3": 4.733, + "me-south-1": 4.949, + "sa-east-1": 6.101, + "us-east-1": 4.013, + "us-east-2": 0.0, + "us-gov-east-1": 4.805, + "us-gov-west-1": 4.805, + "us-west-1": 4.985, + "us-west-2": 0.0 + }, + "c6a.large": { + "ap-east-1": 0.1535, + "ap-northeast-1": 0.1526, + "ap-south-1": 0.10305, + "ap-south-2": 0.10305, + "ap-southeast-1": 0.1445, + "ap-southeast-2": 0.16619, + "ca-central-1": 0.14, + "eu-central-1": 0.0, + "eu-west-1": 0.13838, + "eu-west-2": 0.0, + "sa-east-1": 0.1742, + "us-east-1": 0.1328, + "us-east-2": 0.0, + "us-west-1": 0.16124, + "us-west-2": 0.1328 + }, + "c6a.xlarge": { + "ap-east-1": 0.27014, + "ap-northeast-1": 0.26816, + "ap-south-1": 0.1498, + "ap-south-2": 0.15915, + "ap-southeast-1": 0.25034, + "ap-southeast-2": 0.2561, + "ca-central-1": 0.24044, + "eu-central-1": 0.2309, + "eu-west-1": 0.22046, + "eu-west-2": 0.2381, + "sa-east-1": 0.31568, + "us-east-1": 0.0, + "us-east-2": 0.2246, + "us-west-1": 0.2471, + "us-west-2": 0.2093 + }, + "c6a.metal": { + "ap-east-1": 9.4562, + "ap-northeast-1": 9.3698, + "ap-south-1": 0.0, + "ap-south-2": 4.613, + "ap-southeast-1": 8.5922, + "ap-southeast-2": 9.7154, + "ca-central-1": 8.1602, + "eu-central-1": 8.5058, + "eu-west-1": 8.00468, + "eu-west-2": 0.0, + "sa-east-1": 11.4434, + "us-east-1": 7.469, + "us-east-2": 7.469, + "us-west-1": 0.0, + "us-west-2": 7.469 + }, + "c6a.2xlarge": { + "ap-east-1": 0.5138, + "ap-northeast-1": 0.5102, + "ap-south-1": 0.312, + "ap-south-2": 0.0, + "ap-southeast-1": 0.4778, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.4742, + "eu-west-1": 0.48615, + "eu-west-2": 0.0, + "sa-east-1": 0.5966, + "us-east-1": 0.431, + "us-east-2": 0.4616, + "us-west-1": 0.54476, + "us-west-2": 0.431 + }, + "c6a.4xlarge": { + "ap-east-1": 0.9026, + "ap-northeast-1": 0.97244, + "ap-south-1": 0.499, + "ap-south-2": 0.499, + "ap-southeast-1": 0.8306, + "ap-southeast-2": 1.00412, + "ca-central-1": 0.7946, + "eu-central-1": 0.8234, + "eu-west-1": 0.78164, + "eu-west-2": 0.8522, + "sa-east-1": 1.0682, + "us-east-1": 0.737, + "us-east-2": 0.0, + "us-west-1": 0.8882, + "us-west-2": 0.737 + }, + "c6a.8xlarge": { + "ap-east-1": 1.6802, + "ap-northeast-1": 1.81988, + "ap-south-1": 0.873, + "ap-south-2": 0.873, + "ap-southeast-1": 1.67732, + "ap-southeast-2": 0.0, + "ca-central-1": 1.59812, + "eu-central-1": 1.5218, + "eu-west-1": 1.43828, + "eu-west-2": 1.5794, + "sa-east-1": 2.0114, + "us-east-1": 1.349, + "us-east-2": 0.0, + "us-west-1": 1.6514, + "us-west-2": 1.349 + }, + "c6a.12xlarge": { + "ap-east-1": 2.4578, + "ap-northeast-1": 2.66732, + "ap-south-1": 1.247, + "ap-south-2": 1.247, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.5226, + "ca-central-1": 2.1338, + "eu-central-1": 2.2202, + "eu-west-1": 0.0, + "eu-west-2": 2.52476, + "sa-east-1": 2.9546, + "us-east-1": 1.961, + "us-east-2": 1.961, + "us-west-1": 2.4146, + "us-west-2": 1.961 + }, + "c6a.16xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-south-1": 1.621, + "ap-south-2": 1.7706, + "ap-southeast-1": 2.9474, + "ap-southeast-2": 3.64148, + "ca-central-1": 0.0, + "eu-central-1": 2.9186, + "eu-west-1": 2.75156, + "eu-west-2": 3.0338, + "sa-east-1": 0.0, + "us-east-1": 2.8178, + "us-east-2": 2.573, + "us-west-1": 3.1778, + "us-west-2": 2.8178 + }, + "c6a.24xlarge": { + "ap-east-1": 4.7906, + "ap-northeast-1": 4.7474, + "ap-south-1": 2.5934, + "ap-south-2": 0.0, + "ap-southeast-1": 4.78196, + "ap-southeast-2": 4.9202, + "ca-central-1": 4.54436, + "eu-central-1": 4.3154, + "eu-west-1": 4.06484, + "eu-west-2": 4.4882, + "sa-east-1": 5.7842, + "us-east-1": 0.0, + "us-east-2": 4.1642, + "us-west-1": 4.7042, + "us-west-2": 3.797 + }, + "c6a.32xlarge": { + "ap-east-1": 6.96788, + "ap-northeast-1": 6.2882, + "ap-south-1": 3.4162, + "ap-south-2": 0.0, + "ap-southeast-1": 5.7698, + "ap-southeast-2": 0.0, + "ca-central-1": 6.01748, + "eu-central-1": 0.0, + "eu-west-1": 5.37812, + "eu-west-2": 0.0, + "sa-east-1": 0.0, + "us-east-1": 5.021, + "us-east-2": 5.021, + "us-west-1": 6.2306, + "us-west-2": 5.021 + }, + "c6a.48xlarge": { + "ap-east-1": 9.4562, + "ap-northeast-1": 0.0, + "ap-south-1": 4.613, + "ap-south-2": 4.613, + "ap-southeast-1": 8.5922, + "ap-southeast-2": 0.0, + "ca-central-1": 8.1602, + "eu-central-1": 8.5058, + "eu-west-1": 8.00468, + "eu-west-2": 8.8514, + "sa-east-1": 11.4434, + "us-east-1": 7.469, + "us-east-2": 7.469, + "us-west-1": 9.2834, + "us-west-2": 0.0 + }, + "c6g.medium": { + "af-south-1": 0.1046, + "ap-east-1": 0.074, + "ap-northeast-1": 0.0764, + "ap-northeast-2": 0.0718, + "ap-northeast-3": 0.0993, + "ap-south-1": 0.0523, + "ap-south-2": 0.0789, + "ap-southeast-1": 0.0702, + "ap-southeast-2": 0.0754, + "ap-southeast-3": 0.0979, + "ap-southeast-4": 0.1034, + "ap-southeast-5": 0.0896, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.0935, + "eu-central-1": 0.0, + "eu-central-2": 0.099, + "eu-north-1": 0.0675, + "eu-south-1": 0.0714, + "eu-south-2": 0.0951, + "eu-west-1": 0.0, + "eu-west-2": 0.0714, + "eu-west-3": 0.0739, + "il-central-1": 0.097, + "me-central-1": 0.099, + "me-south-1": 0.0735, + "mx-central-1": 0.092, + "sa-east-1": 0.0834, + "us-east-1": 0.0, + "us-east-2": 0.067, + "us-gov-east-1": 0.0718, + "us-gov-west-1": 0.0718, + "us-west-1": 0.0734, + "us-west-2": 0.067 + }, + "c6g.large": { + "af-south-1": 0.153, + "ap-east-1": 0.1423, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1333, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0989, + "ap-south-2": 0.1015, + "ap-southeast-1": 0.1347, + "ap-southeast-2": 0.1504, + "ap-southeast-3": 0.1347, + "ap-southeast-4": 0.1451, + "ap-southeast-5": 0.1229, + "ap-southeast-7": 0.1269, + "ca-central-1": 0.1352, + "ca-west-1": 0.0, + "eu-central-1": 0.1339, + "eu-central-2": 0.1417, + "eu-north-1": 0.0, + "eu-south-1": 0.1371, + "eu-south-2": 0.1339, + "eu-west-1": 0.1293, + "eu-west-2": 0.1371, + "eu-west-3": 0.0, + "il-central-1": 0.1329, + "me-central-1": 0.1416, + "me-south-1": 0.1413, + "mx-central-1": 0.1277, + "sa-east-1": 0.1611, + "us-east-1": 0.1243, + "us-east-2": 0.1243, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6g.xlarge": { + "af-south-1": 0.2387, + "ap-east-1": 0.2387, + "ap-northeast-1": 0.2378, + "ap-northeast-2": 0.2195, + "ap-northeast-3": 0.0, + "ap-south-1": 0.1415, + "ap-south-2": 0.1415, + "ap-southeast-1": 0.2225, + "ap-southeast-2": 0.2339, + "ap-southeast-3": 0.2131, + "ap-southeast-4": 0.2446, + "ap-southeast-5": 0.1896, + "ap-southeast-7": 0.1896, + "ca-central-1": 0.214, + "ca-west-1": 0.214, + "eu-central-1": 0.0, + "eu-central-2": 0.227, + "eu-north-1": 0.2111, + "eu-south-1": 0.2179, + "eu-south-2": 0.2022, + "eu-west-1": 0.2022, + "eu-west-2": 0.2276, + "eu-west-3": 0.2279, + "il-central-1": 0.0, + "me-central-1": 0.2168, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.2659, + "us-east-1": 0.1923, + "us-east-2": 0.0, + "us-gov-east-1": 0.2195, + "us-gov-west-1": 0.2195, + "us-west-1": 0.2259, + "us-west-2": 0.1923 + }, + "c6g.metal": { + "af-south-1": 3.0434, + "ap-east-1": 2.877, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.589, + "ap-northeast-3": 2.877, + "ap-south-1": 1.4882, + "ap-south-2": 0.0, + "ap-southeast-1": 2.6338, + "ap-southeast-2": 0.0, + "ap-southeast-3": 2.6338, + "ap-southeast-4": 2.9666, + "ap-southeast-5": 2.2575, + "ap-southeast-7": 0.0, + "ca-central-1": 2.5058, + "ca-west-1": 2.5058, + "eu-central-1": 0.0, + "eu-central-2": 2.8565, + "eu-north-1": 2.461, + "eu-south-1": 2.7106, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 2.7106, + "eu-west-3": 2.717, + "il-central-1": 2.5762, + "me-central-1": 2.6933, + "me-south-1": 0.0, + "mx-central-1": 2.4098, + "sa-east-1": 3.4786, + "us-east-1": 2.301, + "us-east-2": 2.301, + "us-gov-east-1": 2.7362, + "us-gov-west-1": 2.7362, + "us-west-1": 2.8386, + "us-west-2": 2.301 + }, + "c6g.2xlarge": { + "af-south-1": 0.4898, + "ap-east-1": 0.4898, + "ap-northeast-1": 0.4674, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.469, + "ap-south-1": 0.3056, + "ap-south-2": 0.3056, + "ap-southeast-1": 0.4574, + "ap-southeast-2": 0.5015, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.4802, + "ap-southeast-5": 0.4076, + "ap-southeast-7": 0.4076, + "ca-central-1": 0.4405, + "ca-west-1": 0.4226, + "eu-central-1": 0.4354, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.4482, + "eu-south-2": 0.4168, + "eu-west-1": 0.4168, + "eu-west-2": 0.4676, + "eu-west-3": 0.0, + "il-central-1": 0.4507, + "me-central-1": 0.4663, + "me-south-1": 0.4854, + "mx-central-1": 0.4106, + "sa-east-1": 0.5442, + "us-east-1": 0.397, + "us-east-2": 0.4133, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.4514, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6g.4xlarge": { + "af-south-1": 0.8546, + "ap-east-1": 0.8546, + "ap-northeast-1": 0.8098, + "ap-northeast-2": 0.7778, + "ap-northeast-3": 0.0, + "ap-south-1": 0.4862, + "ap-south-2": 0.4658, + "ap-southeast-1": 0.7898, + "ap-southeast-2": 0.8354, + "ap-southeast-3": 0.7522, + "ap-southeast-4": 0.878, + "ap-southeast-5": 0.6581, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.7202, + "eu-central-1": 0.7458, + "eu-central-2": 0.0, + "eu-north-1": 0.709, + "eu-south-1": 0.8101, + "eu-south-2": 0.7087, + "eu-west-1": 0.7087, + "eu-west-2": 0.7714, + "eu-west-3": 0.773, + "il-central-1": 0.7378, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 0.6962, + "sa-east-1": 0.9634, + "us-east-1": 0.7016, + "us-east-2": 0.7016, + "us-gov-east-1": 0.817, + "us-gov-west-1": 0.7778, + "us-west-1": 0.8034, + "us-west-2": 0.669 + }, + "c6g.8xlarge": { + "af-south-1": 1.5842, + "ap-east-1": 1.501, + "ap-northeast-1": 1.4946, + "ap-northeast-2": 1.357, + "ap-northeast-3": 1.501, + "ap-south-1": 0.8066, + "ap-south-2": 0.8066, + "ap-southeast-1": 1.4547, + "ap-southeast-2": 1.631, + "ap-southeast-3": 1.3794, + "ap-southeast-4": 1.5458, + "ap-southeast-5": 1.2552, + "ap-southeast-7": 1.2552, + "ca-central-1": 1.3154, + "ca-west-1": 1.3154, + "eu-central-1": 1.3666, + "eu-central-2": 1.4908, + "eu-north-1": 1.293, + "eu-south-1": 0.0, + "eu-south-2": 1.2924, + "eu-west-1": 1.2924, + "eu-west-2": 1.4178, + "eu-west-3": 1.4978, + "il-central-1": 1.3506, + "me-central-1": 1.4092, + "me-south-1": 0.0, + "mx-central-1": 1.2674, + "sa-east-1": 1.9024, + "us-east-1": 1.213, + "us-east-2": 1.213, + "us-gov-east-1": 1.4306, + "us-gov-west-1": 0.0, + "us-west-1": 1.4818, + "us-west-2": 1.213 + }, + "c6g.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 2.189, + "ap-northeast-1": 2.1794, + "ap-northeast-2": 1.973, + "ap-northeast-3": 2.189, + "ap-south-1": 1.1474, + "ap-south-2": 1.1474, + "ap-southeast-1": 2.1195, + "ap-southeast-2": 2.2562, + "ap-southeast-3": 2.0066, + "ap-southeast-4": 2.2562, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.7244, + "ca-central-1": 1.9106, + "ca-west-1": 2.0177, + "eu-central-1": 1.9874, + "eu-central-2": 2.1736, + "eu-north-1": 0.0, + "eu-south-1": 2.0642, + "eu-south-2": 0.0, + "eu-west-1": 1.876, + "eu-west-2": 2.1806, + "eu-west-3": 2.069, + "il-central-1": 2.0793, + "me-central-1": 2.0512, + "me-south-1": 2.165, + "mx-central-1": 1.8386, + "sa-east-1": 2.7911, + "us-east-1": 0.0, + "us-east-2": 1.757, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.0834, + "us-west-1": 2.1602, + "us-west-2": 1.757 + }, + "c6g.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 2.877, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.589, + "ap-northeast-3": 2.877, + "ap-south-1": 1.4882, + "ap-south-2": 1.4882, + "ap-southeast-1": 2.6338, + "ap-southeast-2": 0.0, + "ap-southeast-3": 2.6338, + "ap-southeast-4": 3.1371, + "ap-southeast-5": 2.2575, + "ap-southeast-7": 2.2575, + "ca-central-1": 2.5058, + "ca-west-1": 2.5058, + "eu-central-1": 2.6082, + "eu-central-2": 2.8565, + "eu-north-1": 2.461, + "eu-south-1": 2.7106, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 2.7106, + "eu-west-3": 2.717, + "il-central-1": 2.5762, + "me-central-1": 2.6933, + "me-south-1": 2.845, + "mx-central-1": 2.4098, + "sa-east-1": 3.4786, + "us-east-1": 2.301, + "us-east-2": 0.0, + "us-gov-east-1": 2.7362, + "us-gov-west-1": 2.7362, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6gd.medium": { + "ap-northeast-1": 0.08, + "ap-northeast-2": 0.1003, + "ap-northeast-3": 0.1053, + "ap-south-1": 0.0555, + "ap-southeast-1": 0.076, + "ap-southeast-2": 0.0815, + "ap-southeast-3": 0.1013, + "ca-central-1": 0.0734, + "eu-central-1": 0.0755, + "eu-central-2": 0.1082, + "eu-north-1": 0.0979, + "eu-south-2": 0.0999, + "eu-west-1": 0.0746, + "eu-west-2": 0.0, + "eu-west-3": 0.1051, + "sa-east-1": 0.1158, + "us-east-1": 0.0717, + "us-east-2": 0.0694, + "us-gov-east-1": 0.1027, + "us-gov-west-1": 0.1027, + "us-west-1": 0.079, + "us-west-2": 0.0694 + }, + "c6gd.large": { + "ap-northeast-1": 0.1602, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.1053, + "ap-southeast-1": 0.1463, + "ap-southeast-2": 0.1573, + "ap-southeast-3": 0.1517, + "ca-central-1": 0.1411, + "eu-central-1": 0.1453, + "eu-central-2": 0.0, + "eu-north-1": 0.1395, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.1483, + "eu-west-3": 0.1483, + "sa-east-1": 0.1753, + "us-east-1": 0.1377, + "us-east-2": 0.0, + "us-gov-east-1": 0.1491, + "us-gov-west-1": 0.1547, + "us-west-1": 0.0, + "us-west-2": 0.1331 + }, + "c6gd.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.2523, + "ap-south-1": 0.1602, + "ap-southeast-1": 0.2363, + "ap-southeast-2": 0.2703, + "ap-southeast-3": 0.2363, + "ca-central-1": 0.2259, + "eu-central-1": 0.2343, + "eu-central-2": 0.0, + "eu-north-1": 0.2327, + "eu-south-2": 0.2307, + "eu-west-1": 0.2307, + "eu-west-2": 0.2403, + "eu-west-3": 0.2403, + "sa-east-1": 0.2943, + "us-east-1": 0.2099, + "us-east-2": 0.2099, + "us-gov-east-1": 0.2419, + "us-gov-west-1": 0.2419, + "us-west-1": 0.2483, + "us-west-2": 0.2099 + }, + "c6gd.metal": { + "ap-northeast-1": 3.261, + "ap-northeast-2": 2.941, + "ap-northeast-3": 3.261, + "ap-south-1": 1.693, + "ap-southeast-1": 3.005, + "ap-southeast-2": 3.357, + "ap-southeast-3": 3.005, + "ca-central-1": 2.8386, + "eu-central-1": 2.973, + "eu-central-2": 0.0, + "eu-north-1": 2.7874, + "eu-south-2": 2.9154, + "eu-west-1": 2.9154, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 3.933, + "us-east-1": 0.0, + "us-east-2": 2.5826, + "us-gov-east-1": 3.0946, + "us-gov-west-1": 0.0, + "us-west-1": 3.197, + "us-west-2": 2.5826 + }, + "c6gd.2xlarge": { + "ap-northeast-1": 0.517, + "ap-northeast-2": 0.477, + "ap-northeast-3": 0.517, + "ap-south-1": 0.321, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.485, + "ca-central-1": 0.4846, + "eu-central-1": 0.481, + "eu-central-2": 0.5166, + "eu-north-1": 0.4778, + "eu-south-2": 0.4738, + "eu-west-1": 0.4738, + "eu-west-2": 0.5151, + "eu-west-3": 0.493, + "sa-east-1": 0.601, + "us-east-1": 0.4322, + "us-east-2": 0.4506, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.5185, + "us-west-1": 0.509, + "us-west-2": 0.4506 + }, + "c6gd.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.829, + "ap-northeast-3": 0.0, + "ap-south-1": 0.517, + "ap-southeast-1": 0.845, + "ap-southeast-2": 0.981, + "ap-southeast-3": 0.845, + "ca-central-1": 0.8441, + "eu-central-1": 0.837, + "eu-central-2": 0.0, + "eu-north-1": 0.7906, + "eu-south-2": 0.8226, + "eu-west-1": 0.8645, + "eu-west-2": 0.861, + "eu-west-3": 0.861, + "sa-east-1": 1.077, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.8674, + "us-gov-west-1": 0.8674, + "us-west-1": 0.893, + "us-west-2": 0.0 + }, + "c6gd.8xlarge": { + "ap-northeast-1": 1.7874, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.693, + "ap-south-1": 0.909, + "ap-southeast-1": 1.6514, + "ap-southeast-2": 1.741, + "ap-southeast-3": 1.565, + "ca-central-1": 1.4818, + "eu-central-1": 1.549, + "eu-central-2": 1.6914, + "eu-north-1": 1.5361, + "eu-south-2": 1.6039, + "eu-west-1": 1.5202, + "eu-west-2": 1.597, + "eu-west-3": 1.597, + "sa-east-1": 2.029, + "us-east-1": 1.3538, + "us-east-2": 1.4275, + "us-gov-east-1": 1.6098, + "us-gov-west-1": 1.6098, + "us-west-1": 1.661, + "us-west-2": 0.0 + }, + "c6gd.12xlarge": { + "ap-northeast-1": 2.477, + "ap-northeast-2": 2.237, + "ap-northeast-3": 2.477, + "ap-south-1": 1.301, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.549, + "ap-southeast-3": 2.4146, + "ca-central-1": 0.0, + "eu-central-1": 2.261, + "eu-central-2": 2.4746, + "eu-north-1": 2.2416, + "eu-south-2": 2.2178, + "eu-west-1": 2.3434, + "eu-west-2": 2.333, + "eu-west-3": 2.333, + "sa-east-1": 3.1538, + "us-east-1": 1.9682, + "us-east-2": 1.9682, + "us-gov-east-1": 2.4858, + "us-gov-west-1": 0.0, + "us-west-1": 2.429, + "us-west-2": 2.0788 + }, + "c6gd.16xlarge": { + "ap-northeast-1": 3.261, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.261, + "ap-south-1": 1.693, + "ap-southeast-1": 3.005, + "ap-southeast-2": 3.357, + "ap-southeast-3": 0.0, + "ca-central-1": 2.8386, + "eu-central-1": 2.973, + "eu-central-2": 3.2578, + "eu-north-1": 2.7874, + "eu-south-2": 2.9154, + "eu-west-1": 2.9154, + "eu-west-2": 3.069, + "eu-west-3": 0.0, + "sa-east-1": 3.933, + "us-east-1": 0.0, + "us-east-2": 2.5826, + "us-gov-east-1": 3.0946, + "us-gov-west-1": 0.0, + "us-west-1": 3.197, + "us-west-2": 2.5826 + }, + "c6gn.medium": { + "ap-east-1": 0.08825, + "ap-northeast-1": 0.0855, + "ap-northeast-2": 0.10505, + "ap-northeast-3": 0.11637, + "ap-south-1": 0.07425, + "ap-southeast-1": 0.0805, + "ap-southeast-2": 0.09315, + "ap-southeast-3": 0.11086, + "ap-southeast-5": 0.09838, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0783, + "ca-west-1": 0.10833, + "eu-central-1": 0.0803, + "eu-north-1": 0.08215, + "eu-south-1": 0.0, + "eu-west-1": 0.08468, + "eu-west-2": 0.0, + "eu-west-3": 0.10755, + "il-central-1": 0.10754, + "me-south-1": 0.1099, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.07852, + "us-east-2": 0.0742, + "us-gov-east-1": 0.1083, + "us-gov-west-1": 0.1083, + "us-west-1": 0.085, + "us-west-2": 0.0 + }, + "c6gn.large": { + "ap-east-1": 0.1708, + "ap-northeast-1": 0.1653, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.1428, + "ap-southeast-1": 0.1553, + "ap-southeast-2": 0.1693, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.14046, + "ap-southeast-7": 0.14046, + "ca-central-1": 0.1509, + "ca-west-1": 0.1509, + "eu-central-1": 0.16476, + "eu-north-1": 0.1493, + "eu-south-1": 0.0, + "eu-west-1": 0.16366, + "eu-west-2": 0.1588, + "eu-west-3": 0.1588, + "il-central-1": 0.15878, + "me-south-1": 0.1635, + "mx-central-1": 0.14702, + "sa-east-1": 0.0, + "us-east-1": 0.1427, + "us-east-2": 0.0, + "us-gov-east-1": 0.1603, + "us-gov-west-1": 0.1707, + "us-west-1": 0.1751, + "us-west-2": 0.1427 + }, + "c6gn.xlarge": { + "ap-east-1": 0.2853, + "ap-northeast-1": 0.2961, + "ap-northeast-2": 0.2513, + "ap-northeast-3": 0.29658, + "ap-south-1": 0.2293, + "ap-southeast-1": 0.2543, + "ap-southeast-2": 0.3049, + "ap-southeast-3": 0.27454, + "ap-southeast-5": 0.22462, + "ap-southeast-7": 0.22462, + "ca-central-1": 0.2455, + "ca-west-1": 0.2455, + "eu-central-1": 0.27322, + "eu-north-1": 0.2423, + "eu-south-1": 0.2627, + "eu-west-1": 0.0, + "eu-west-2": 0.2613, + "eu-west-3": 0.0, + "il-central-1": 0.26126, + "me-south-1": 0.2707, + "mx-central-1": 0.0, + "sa-east-1": 0.3223, + "us-east-1": 0.2291, + "us-east-2": 0.2291, + "us-gov-east-1": 0.2851, + "us-gov-west-1": 0.2643, + "us-west-1": 0.2723, + "us-west-2": 0.2291 + }, + "c6gn.metal": { + "ca-central-1": 0.0, + "eu-west-3": 3.733 + }, + "c6gn.2xlarge": { + "ap-east-1": 0.583, + "ap-northeast-1": 0.561, + "ap-northeast-2": 0.515, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.521, + "ap-southeast-2": 0.577, + "ap-southeast-3": 0.5218, + "ap-southeast-5": 0.46164, + "ap-southeast-7": 0.46164, + "ca-central-1": 0.5034, + "ca-west-1": 0.0, + "eu-central-1": 0.5194, + "eu-north-1": 0.0, + "eu-south-1": 0.5378, + "eu-west-1": 0.5154, + "eu-west-2": 0.0, + "eu-west-3": 0.576, + "il-central-1": 0.53492, + "me-south-1": 0.5538, + "mx-central-1": 0.0, + "sa-east-1": 0.657, + "us-east-1": 0.50516, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.541, + "us-west-1": 0.557, + "us-west-2": 0.4706 + }, + "c6gn.4xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 1.0842, + "ap-northeast-2": 0.905, + "ap-northeast-3": 0.0, + "ap-south-1": 0.817, + "ap-southeast-1": 0.917, + "ap-southeast-2": 1.029, + "ap-southeast-3": 0.9186, + "ap-southeast-5": 0.86561, + "ap-southeast-7": 0.79828, + "ca-central-1": 0.0, + "ca-west-1": 0.8818, + "eu-central-1": 0.9138, + "eu-north-1": 0.869, + "eu-south-1": 0.0, + "eu-west-1": 0.9058, + "eu-west-2": 0.945, + "eu-west-3": 1.027, + "il-central-1": 0.0, + "me-south-1": 0.9826, + "mx-central-1": 0.92334, + "sa-east-1": 1.189, + "us-east-1": 0.0, + "us-east-2": 0.88532, + "us-gov-east-1": 1.0402, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.88532 + }, + "c6gn.8xlarge": { + "ap-east-1": 1.957, + "ap-northeast-1": 2.0434, + "ap-northeast-2": 1.685, + "ap-northeast-3": 1.87252, + "ap-south-1": 1.509, + "ap-southeast-1": 1.709, + "ap-southeast-2": 1.933, + "ap-southeast-3": 1.7122, + "ap-southeast-5": 1.47156, + "ap-southeast-7": 1.60622, + "ca-central-1": 1.6386, + "ca-west-1": 0.0, + "eu-central-1": 1.7026, + "eu-north-1": 1.7618, + "eu-south-1": 1.94132, + "eu-west-1": 1.84276, + "eu-west-2": 1.765, + "eu-west-3": 1.765, + "il-central-1": 0.0, + "me-south-1": 1.8402, + "mx-central-1": 1.57652, + "sa-east-1": 2.253, + "us-east-1": 1.5074, + "us-east-2": 0.0, + "us-gov-east-1": 1.789, + "us-gov-west-1": 1.789, + "us-west-1": 2.0258, + "us-west-2": 1.64564 + }, + "c6gn.12xlarge": { + "ap-east-1": 3.1478, + "ap-northeast-1": 2.741, + "ap-northeast-2": 2.465, + "ap-northeast-3": 2.74628, + "ap-south-1": 2.4086, + "ap-southeast-1": 2.501, + "ap-southeast-2": 2.837, + "ap-southeast-3": 2.5058, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.34682, + "ca-central-1": 2.3954, + "ca-west-1": 0.0, + "eu-central-1": 2.72804, + "eu-north-1": 2.357, + "eu-south-1": 2.6018, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 2.585, + "il-central-1": 2.58452, + "me-south-1": 2.6978, + "mx-central-1": 2.30228, + "sa-east-1": 3.317, + "us-east-1": 2.40596, + "us-east-2": 2.40596, + "us-gov-east-1": 2.8706, + "us-gov-west-1": 0.0, + "us-west-1": 2.717, + "us-west-2": 2.40596 + }, + "c6gn.16xlarge": { + "ap-east-1": 4.1554, + "ap-northeast-1": 3.613, + "ap-northeast-2": 3.245, + "ap-northeast-3": 3.62004, + "ap-south-1": 2.893, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.741, + "ap-southeast-3": 3.2994, + "ap-southeast-5": 2.81812, + "ap-southeast-7": 2.81812, + "ca-central-1": 0.0, + "ca-west-1": 3.1522, + "eu-central-1": 0.0, + "eu-north-1": 3.101, + "eu-south-1": 3.4274, + "eu-west-1": 3.2482, + "eu-west-2": 3.405, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-south-1": 3.5554, + "mx-central-1": 0.0, + "sa-east-1": 4.8066, + "us-east-1": 2.8898, + "us-east-2": 2.8898, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.7858, + "us-west-1": 3.581, + "us-west-2": 2.8898 + }, + "c6i.large": { + "af-south-1": 0.1817, + "ap-east-1": 0.0, + "ap-northeast-1": 0.174, + "ap-northeast-2": 0.1523, + "ap-northeast-3": 0.1633, + "ap-south-1": 0.0, + "ap-south-2": 0.1413, + "ap-southeast-1": 0.1543, + "ap-southeast-2": 0.1673, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.1493, + "ca-west-1": 0.1493, + "eu-central-1": 0.1533, + "eu-north-1": 0.1473, + "eu-south-1": 0.0, + "eu-west-1": 0.1475, + "eu-west-2": 0.1573, + "eu-west-3": 0.1573, + "il-central-1": 0.15206, + "me-south-1": 0.0, + "mx-central-1": 0.14555, + "sa-east-1": 0.1873, + "us-east-1": 0.0, + "us-east-2": 0.1498, + "us-gov-east-1": 0.1583, + "us-gov-west-1": 0.1583, + "us-west-1": 0.1623, + "us-west-2": 0.1413 + }, + "c6i.xlarge": { + "af-south-1": 0.3071, + "ap-east-1": 0.2723, + "ap-northeast-1": 0.2703, + "ap-northeast-2": 0.2675, + "ap-northeast-3": 0.0, + "ap-south-1": 0.2263, + "ap-south-2": 0.0, + "ap-southeast-1": 0.2523, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.2229, + "ca-central-1": 0.2423, + "ca-west-1": 0.0, + "eu-central-1": 0.2503, + "eu-north-1": 0.2383, + "eu-south-1": 0.2583, + "eu-west-1": 0.2387, + "eu-west-2": 0.2583, + "eu-west-3": 0.0, + "il-central-1": 0.26697, + "me-south-1": 0.2675, + "mx-central-1": 0.25265, + "sa-east-1": 0.3183, + "us-east-1": 0.0, + "us-east-2": 0.2263, + "us-gov-east-1": 0.2603, + "us-gov-west-1": 0.2603, + "us-west-1": 0.0, + "us-west-2": 0.2263 + }, + "c6i.metal": { + "af-south-1": 7.421, + "ap-east-1": 7.037, + "ap-northeast-1": 6.973, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 5.565, + "ap-south-2": 5.565, + "ap-southeast-1": 6.397, + "ap-southeast-2": 0.0, + "ap-southeast-5": 5.4562, + "ap-southeast-7": 0.0, + "ca-central-1": 6.077, + "ca-west-1": 6.077, + "eu-central-1": 6.333, + "eu-north-1": 5.949, + "eu-south-1": 6.589, + "eu-west-1": 0.0, + "eu-west-2": 6.589, + "eu-west-3": 0.0, + "il-central-1": 6.25364, + "me-south-1": 6.8834, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 5.565, + "us-east-2": 5.565, + "us-gov-east-1": 0.0, + "us-gov-west-1": 6.653, + "us-west-1": 6.909, + "us-west-2": 5.565 + }, + "c6i.2xlarge": { + "af-south-1": 0.581, + "ap-east-1": 0.557, + "ap-northeast-1": 0.553, + "ap-northeast-2": 0.509, + "ap-northeast-3": 0.0, + "ap-south-1": 0.465, + "ap-south-2": 0.0, + "ap-southeast-1": 0.5562, + "ap-southeast-2": 0.569, + "ap-southeast-5": 0.49152, + "ap-southeast-7": 0.4582, + "ca-central-1": 0.497, + "ca-west-1": 0.0, + "eu-central-1": 0.5518, + "eu-north-1": 0.489, + "eu-south-1": 0.529, + "eu-west-1": 0.52628, + "eu-west-2": 0.529, + "eu-west-3": 0.529, + "il-central-1": 0.50804, + "me-south-1": 0.5474, + "mx-central-1": 0.0, + "sa-east-1": 0.649, + "us-east-1": 0.465, + "us-east-2": 0.465, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.5738, + "us-west-1": 0.549, + "us-west-2": 0.465 + }, + "c6i.4xlarge": { + "af-south-1": 1.037, + "ap-east-1": 0.0, + "ap-northeast-1": 1.0666, + "ap-northeast-2": 0.9698, + "ap-northeast-3": 0.981, + "ap-south-1": 0.805, + "ap-south-2": 0.805, + "ap-southeast-1": 0.909, + "ap-southeast-2": 1.013, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.7914, + "ca-central-1": 0.869, + "ca-west-1": 0.869, + "eu-central-1": 0.0, + "eu-north-1": 0.853, + "eu-south-1": 0.933, + "eu-west-1": 0.92756, + "eu-west-2": 0.0, + "eu-west-3": 0.933, + "il-central-1": 0.96769, + "me-south-1": 0.9698, + "mx-central-1": 0.0, + "sa-east-1": 1.173, + "us-east-1": 0.0, + "us-east-2": 0.805, + "us-gov-east-1": 0.941, + "us-gov-west-1": 0.941, + "us-west-1": 0.973, + "us-west-2": 0.805 + }, + "c6i.8xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 1.837, + "ap-northeast-2": 1.661, + "ap-northeast-3": 1.837, + "ap-south-1": 0.0, + "ap-south-2": 1.621, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.901, + "ap-southeast-5": 1.59108, + "ap-southeast-7": 0.0, + "ca-central-1": 1.7618, + "ca-west-1": 0.0, + "eu-central-1": 1.8322, + "eu-north-1": 0.0, + "eu-south-1": 1.741, + "eu-west-1": 1.73012, + "eu-west-2": 1.741, + "eu-west-3": 1.741, + "il-central-1": 1.81038, + "me-south-1": 1.8146, + "mx-central-1": 1.553, + "sa-east-1": 2.4306, + "us-east-1": 1.485, + "us-east-2": 1.485, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.757, + "us-west-1": 1.9906, + "us-west-2": 0.0 + }, + "c6i.12xlarge": { + "af-south-1": 2.861, + "ap-east-1": 2.717, + "ap-northeast-1": 2.9498, + "ap-northeast-2": 2.429, + "ap-northeast-3": 2.693, + "ap-south-1": 2.165, + "ap-south-2": 0.0, + "ap-southeast-1": 2.7122, + "ap-southeast-2": 2.789, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 2.357, + "ca-west-1": 2.5802, + "eu-central-1": 0.0, + "eu-north-1": 2.5274, + "eu-south-1": 2.549, + "eu-west-1": 2.3138, + "eu-west-2": 2.549, + "eu-west-3": 2.549, + "il-central-1": 2.42324, + "me-south-1": 2.6594, + "mx-central-1": 2.267, + "sa-east-1": 0.0, + "us-east-1": 2.369, + "us-east-2": 2.369, + "us-gov-east-1": 2.8178, + "us-gov-west-1": 0.0, + "us-west-1": 2.669, + "us-west-2": 2.165 + }, + "c6i.16xlarge": { + "af-south-1": 4.1378, + "ap-east-1": 3.581, + "ap-northeast-1": 3.549, + "ap-northeast-2": 3.197, + "ap-northeast-3": 0.0, + "ap-south-1": 2.845, + "ap-south-2": 2.845, + "ap-southeast-1": 3.261, + "ap-southeast-2": 4.0322, + "ap-southeast-5": 2.7906, + "ap-southeast-7": 0.0, + "ca-central-1": 3.101, + "ca-west-1": 3.101, + "eu-central-1": 3.229, + "eu-north-1": 3.037, + "eu-south-1": 3.6802, + "eu-west-1": 3.33524, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 3.18932, + "me-south-1": 3.5042, + "mx-central-1": 0.0, + "sa-east-1": 4.317, + "us-east-1": 0.0, + "us-east-2": 2.845, + "us-gov-east-1": 3.389, + "us-gov-west-1": 3.389, + "us-west-1": 3.8562, + "us-west-2": 2.845 + }, + "c6i.24xlarge": { + "af-south-1": 0.0, + "ap-east-1": 5.309, + "ap-northeast-1": 5.7746, + "ap-northeast-2": 4.733, + "ap-northeast-3": 5.261, + "ap-south-1": 4.205, + "ap-south-2": 4.205, + "ap-southeast-1": 5.2994, + "ap-southeast-2": 5.9858, + "ap-southeast-5": 4.1234, + "ap-southeast-7": 4.1234, + "ca-central-1": 5.0354, + "ca-west-1": 5.0354, + "eu-central-1": 4.781, + "eu-north-1": 4.493, + "eu-south-1": 5.4578, + "eu-west-1": 4.5026, + "eu-west-2": 4.973, + "eu-west-3": 4.973, + "il-central-1": 4.72148, + "me-south-1": 0.0, + "mx-central-1": 4.409, + "sa-east-1": 7.0418, + "us-east-1": 4.613, + "us-east-2": 0.0, + "us-gov-east-1": 5.021, + "us-gov-west-1": 0.0, + "us-west-1": 5.213, + "us-west-2": 4.613 + }, + "c6i.32xlarge": { + "af-south-1": 0.0, + "ap-east-1": 7.037, + "ap-northeast-1": 6.973, + "ap-northeast-2": 0.0, + "ap-northeast-3": 6.973, + "ap-south-1": 5.565, + "ap-south-2": 5.565, + "ap-southeast-1": 6.397, + "ap-southeast-2": 7.229, + "ap-southeast-5": 5.4562, + "ap-southeast-7": 0.0, + "ca-central-1": 6.077, + "ca-west-1": 6.077, + "eu-central-1": 0.0, + "eu-north-1": 5.949, + "eu-south-1": 0.0, + "eu-west-1": 5.9618, + "eu-west-2": 6.589, + "eu-west-3": 6.589, + "il-central-1": 6.25364, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 8.509, + "us-east-1": 5.565, + "us-east-2": 5.565, + "us-gov-east-1": 6.653, + "us-gov-west-1": 6.653, + "us-west-1": 6.909, + "us-west-2": 5.565 + }, + "c6id.large": { + "ap-northeast-1": 0.1844, + "ap-northeast-2": 0.1718, + "ap-southeast-1": 0.18566, + "ap-southeast-2": 0.1886, + "ap-southeast-5": 0.15626, + "ap-southeast-7": 0.0, + "ca-central-1": 0.17873, + "ca-west-1": 0.17873, + "eu-central-1": 0.18451, + "eu-west-1": 0.0, + "eu-west-2": 0.17705, + "il-central-1": 0.0, + "mx-central-1": 0.16214, + "sa-east-1": 0.21275, + "us-east-1": 0.0, + "us-east-2": 0.1571, + "us-gov-west-1": 0.0, + "us-west-2": 0.16718 + }, + "c6id.xlarge": { + "ap-northeast-1": 0.3125, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.2915, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.25622, + "ap-southeast-7": 0.25622, + "ca-central-1": 0.2789, + "ca-west-1": 0.2789, + "eu-central-1": 0.2894, + "eu-west-1": 0.0, + "eu-west-2": 0.2978, + "il-central-1": 0.29664, + "mx-central-1": 0.26798, + "sa-east-1": 0.0, + "us-east-1": 0.27806, + "us-east-2": 0.2579, + "us-gov-west-1": 0.2999, + "us-west-2": 0.2579 + }, + "c6id.metal": { + "ap-northeast-1": 8.3234, + "ap-northeast-2": 7.517, + "ap-southeast-1": 7.6514, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 6.52244, + "ca-central-1": 7.2482, + "ca-west-1": 7.2482, + "eu-central-1": 7.5842, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "il-central-1": 7.81588, + "mx-central-1": 6.89876, + "sa-east-1": 10.1378, + "us-east-1": 6.5762, + "us-east-2": 6.5762, + "us-gov-west-1": 0.0, + "us-west-2": 6.5762 + }, + "c6id.2xlarge": { + "ap-northeast-1": 0.6374, + "ap-northeast-2": 0.587, + "ap-southeast-1": 0.5954, + "ap-southeast-2": 0.6542, + "ap-southeast-5": 0.52484, + "ap-southeast-7": 0.52484, + "ca-central-1": 0.0, + "ca-west-1": 0.5702, + "eu-central-1": 0.5912, + "eu-west-1": 0.0, + "eu-west-2": 0.608, + "il-central-1": 0.60568, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.5282, + "us-east-2": 0.0, + "us-gov-west-1": 0.6122, + "us-west-2": 0.5282 + }, + "c6id.4xlarge": { + "ap-northeast-1": 1.1498, + "ap-northeast-2": 1.049, + "ap-southeast-1": 1.0658, + "ap-southeast-2": 1.1834, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 1.0406, + "eu-west-2": 1.091, + "il-central-1": 1.08636, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.9314, + "us-gov-west-1": 1.19684, + "us-west-2": 0.9314 + }, + "c6id.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.973, + "ap-southeast-1": 2.0066, + "ap-southeast-2": 2.2418, + "ap-southeast-5": 1.72436, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 1.9058, + "eu-central-1": 1.9898, + "eu-west-1": 2.13932, + "eu-west-2": 2.057, + "il-central-1": 2.04772, + "mx-central-1": 1.81844, + "sa-east-1": 2.6282, + "us-east-1": 1.7378, + "us-east-2": 1.7378, + "us-gov-west-1": 2.0738, + "us-west-2": 1.89908 + }, + "c6id.12xlarge": { + "ap-northeast-1": 3.1994, + "ap-northeast-2": 0.0, + "ap-southeast-1": 3.22964, + "ap-southeast-2": 3.61772, + "ap-southeast-5": 2.52404, + "ap-southeast-7": 0.0, + "ca-central-1": 2.7962, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 2.8718, + "eu-west-2": 3.023, + "il-central-1": 3.00908, + "mx-central-1": 2.66516, + "sa-east-1": 3.8798, + "us-east-1": 0.0, + "us-east-2": 2.5442, + "us-gov-west-1": 3.0482, + "us-west-2": 2.5442 + }, + "c6id.16xlarge": { + "ap-northeast-1": 4.63412, + "ap-northeast-2": 0.0, + "ap-southeast-1": 3.8882, + "ap-southeast-2": 4.3586, + "ap-southeast-5": 3.64359, + "ap-southeast-7": 3.32372, + "ca-central-1": 3.6866, + "ca-west-1": 3.6866, + "eu-central-1": 3.8546, + "eu-west-1": 3.7874, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "mx-central-1": 3.85057, + "sa-east-1": 5.1314, + "us-east-1": 3.3506, + "us-east-2": 3.3506, + "us-gov-west-1": 4.41236, + "us-west-2": 3.3506 + }, + "c6id.24xlarge": { + "ap-northeast-1": 6.2738, + "ap-northeast-2": 5.669, + "ap-southeast-1": 5.7698, + "ap-southeast-2": 7.11044, + "ap-southeast-5": 4.92308, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 6.16796, + "eu-west-2": 6.5006, + "il-central-1": 5.89316, + "mx-central-1": 5.71335, + "sa-east-1": 0.0, + "us-east-1": 4.9634, + "us-east-2": 4.9634, + "us-gov-west-1": 5.9714, + "us-west-2": 0.0 + }, + "c6id.32xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 7.517, + "ap-southeast-1": 0.0, + "ap-southeast-2": 8.5922, + "ap-southeast-5": 6.52244, + "ap-southeast-7": 0.0, + "ca-central-1": 7.2482, + "ca-west-1": 7.2482, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 7.853, + "il-central-1": 7.81588, + "mx-central-1": 6.89876, + "sa-east-1": 0.0, + "us-east-1": 6.5762, + "us-east-2": 6.5762, + "us-gov-west-1": 7.9202, + "us-west-2": 6.5762 + }, + "c6in.large": { + "af-south-1": 0.20876, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1844, + "ap-south-1": 0.1697, + "ap-south-2": 0.1696, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.20435, + "ap-southeast-3": 0.19952, + "ap-southeast-4": 0.2043, + "ap-southeast-5": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.18545, + "eu-central-2": 0.1986, + "eu-north-1": 0.19028, + "eu-south-1": 0.2053, + "eu-south-2": 0.1971, + "eu-west-1": 0.1844, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 0.20426, + "me-central-1": 0.1971, + "me-south-1": 0.197, + "sa-east-1": 0.0, + "us-east-1": 0.18104, + "us-east-2": 0.0, + "us-gov-east-1": 0.20645, + "us-gov-west-1": 0.1928, + "us-west-1": 0.0, + "us-west-2": 0.1697 + }, + "c6in.xlarge": { + "af-south-1": 0.36122, + "ap-east-1": 0.3566, + "ap-northeast-1": 0.3419, + "ap-northeast-2": 0.3125, + "ap-south-1": 0.30578, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.3523, + "ap-southeast-5": 0.27764, + "ca-central-1": 0.3041, + "eu-central-1": 0.3146, + "eu-central-2": 0.3409, + "eu-north-1": 0.32426, + "eu-south-1": 0.3272, + "eu-south-2": 0.3123, + "eu-west-1": 0.3125, + "eu-west-2": 0.0, + "eu-west-3": 0.35198, + "il-central-1": 0.32532, + "me-central-1": 0.0, + "me-south-1": 0.3377, + "sa-east-1": 0.4049, + "us-east-1": 0.30578, + "us-east-2": 0.2831, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.3293, + "us-west-1": 0.36815, + "us-west-2": 0.30578 + }, + "c6in.metal": { + "af-south-1": 9.88244, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 7.3826, + "ap-south-2": 7.3762, + "ap-southeast-1": 8.4578, + "ap-southeast-2": 9.6002, + "ap-southeast-3": 8.4578, + "ap-southeast-4": 9.597, + "ap-southeast-5": 7.20788, + "ca-central-1": 8.0546, + "eu-central-1": 0.0, + "eu-central-2": 9.2322, + "eu-north-1": 7.9202, + "eu-south-1": 8.7938, + "eu-south-2": 8.317, + "eu-west-1": 8.3234, + "eu-west-2": 8.7266, + "eu-west-3": 8.7266, + "il-central-1": 0.0, + "me-central-1": 9.1362, + "me-south-1": 9.1298, + "sa-east-1": 0.0, + "us-east-1": 7.3826, + "us-east-2": 7.3826, + "us-gov-east-1": 8.861, + "us-gov-west-1": 8.861, + "us-west-1": 0.0, + "us-west-2": 7.3826 + }, + "c6in.2xlarge": { + "af-south-1": 0.73484, + "ap-east-1": 0.7256, + "ap-northeast-1": 0.6962, + "ap-northeast-2": 0.6374, + "ap-south-1": 0.5786, + "ap-south-2": 0.5782, + "ap-southeast-1": 0.6458, + "ap-southeast-2": 0.7172, + "ap-southeast-3": 0.69788, + "ap-southeast-4": 0.7762, + "ap-southeast-5": 0.56768, + "ca-central-1": 0.0, + "eu-central-1": 0.6416, + "eu-central-2": 0.6942, + "eu-north-1": 0.66092, + "eu-south-1": 0.72098, + "eu-south-2": 0.0, + "eu-west-1": 0.6374, + "eu-west-2": 0.0, + "eu-west-3": 0.6626, + "il-central-1": 0.66304, + "me-central-1": 0.6882, + "me-south-1": 0.6878, + "sa-east-1": 0.0, + "us-east-1": 0.5786, + "us-east-2": 0.5786, + "us-gov-east-1": 0.7256, + "us-gov-west-1": 0.671, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c6in.4xlarge": { + "af-south-1": 1.46665, + "ap-east-1": 1.3262, + "ap-northeast-1": 1.2674, + "ap-northeast-2": 1.1498, + "ap-south-1": 0.0, + "ap-south-2": 1.0314, + "ap-southeast-1": 1.1666, + "ap-southeast-2": 1.3094, + "ap-southeast-3": 1.27076, + "ap-southeast-4": 0.0, + "ap-southeast-5": 1.01036, + "ca-central-1": 1.1162, + "eu-central-1": 1.1582, + "eu-central-2": 1.2634, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 1.149, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 1.2002, + "il-central-1": 1.30869, + "me-central-1": 1.2514, + "me-south-1": 1.2506, + "sa-east-1": 1.5194, + "us-east-1": 1.0322, + "us-east-2": 1.0322, + "us-gov-east-1": 1.217, + "us-gov-west-1": 1.217, + "us-west-1": 1.3724, + "us-west-2": 0.0 + }, + "c6in.8xlarge": { + "af-south-1": 0.0, + "ap-east-1": 2.5274, + "ap-northeast-1": 2.63828, + "ap-northeast-2": 2.1746, + "ap-south-1": 1.9394, + "ap-south-2": 1.9378, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.4938, + "ap-southeast-3": 2.2082, + "ap-southeast-4": 0.0, + "ap-southeast-5": 1.89572, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 2.4018, + "eu-north-1": 2.0738, + "eu-south-1": 2.2922, + "eu-south-2": 2.173, + "eu-west-1": 2.1746, + "eu-west-2": 0.0, + "eu-west-3": 2.49044, + "il-central-1": 2.27716, + "me-central-1": 0.0, + "me-south-1": 2.60132, + "sa-east-1": 0.0, + "us-east-1": 1.9394, + "us-east-2": 1.9394, + "us-gov-east-1": 2.309, + "us-gov-west-1": 2.309, + "us-west-1": 2.393, + "us-west-2": 0.0 + }, + "c6in.12xlarge": { + "af-south-1": 3.78404, + "ap-east-1": 3.7286, + "ap-northeast-1": 3.5522, + "ap-northeast-2": 3.1994, + "ap-south-1": 2.8466, + "ap-south-2": 2.8442, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.03352, + "ap-southeast-3": 3.2498, + "ap-southeast-4": 3.677, + "ap-southeast-5": 2.78108, + "ca-central-1": 3.39596, + "eu-central-1": 3.2246, + "eu-central-2": 3.5402, + "eu-north-1": 3.0482, + "eu-south-1": 3.3758, + "eu-south-2": 3.197, + "eu-west-1": 3.50684, + "eu-west-2": 3.3506, + "eu-west-3": 0.0, + "il-central-1": 3.67606, + "me-central-1": 3.84212, + "me-south-1": 3.5018, + "sa-east-1": 4.72652, + "us-east-1": 2.8466, + "us-east-2": 2.8466, + "us-gov-east-1": 3.401, + "us-gov-west-1": 3.401, + "us-west-1": 3.527, + "us-west-2": 0.0 + }, + "c6in.16xlarge": { + "af-south-1": 5.49159, + "ap-east-1": 4.9298, + "ap-northeast-1": 4.6946, + "ap-northeast-2": 0.0, + "ap-south-1": 3.7538, + "ap-south-2": 3.7506, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.8626, + "ap-southeast-3": 4.2914, + "ap-southeast-4": 4.861, + "ap-southeast-5": 0.0, + "ca-central-1": 4.48628, + "eu-central-1": 4.2578, + "eu-central-2": 4.6786, + "eu-north-1": 4.41236, + "eu-south-1": 4.89284, + "eu-south-2": 4.221, + "eu-west-1": 4.2242, + "eu-west-2": 4.4258, + "eu-west-3": 0.0, + "il-central-1": 4.85975, + "me-central-1": 5.08116, + "me-south-1": 4.6274, + "sa-east-1": 6.26036, + "us-east-1": 0.0, + "us-east-2": 3.7538, + "us-gov-east-1": 4.493, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 4.11668 + }, + "c6in.24xlarge": { + "af-south-1": 7.44308, + "ap-east-1": 7.3322, + "ap-northeast-1": 6.9794, + "ap-northeast-2": 6.2738, + "ap-south-1": 6.11252, + "ap-south-2": 5.5634, + "ap-southeast-1": 0.0, + "ap-southeast-2": 7.2314, + "ap-southeast-3": 6.3746, + "ap-southeast-4": 7.229, + "ap-southeast-5": 5.43716, + "ca-central-1": 6.66692, + "eu-central-1": 0.0, + "eu-central-2": 6.9554, + "eu-north-1": 0.0, + "eu-south-1": 7.27676, + "eu-south-2": 6.269, + "eu-west-1": 6.88868, + "eu-west-2": 6.5762, + "eu-west-3": 6.5762, + "il-central-1": 7.22713, + "me-central-1": 7.55924, + "me-south-1": 6.8786, + "sa-east-1": 8.4914, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 7.3322, + "us-gov-west-1": 0.0, + "us-west-1": 6.929, + "us-west-2": 0.0 + }, + "c6in.32xlarge": { + "af-south-1": 9.88244, + "ap-east-1": 0.0, + "ap-northeast-1": 9.2642, + "ap-northeast-2": 8.3234, + "ap-south-1": 7.3826, + "ap-south-2": 7.3762, + "ap-southeast-1": 8.4578, + "ap-southeast-2": 9.6002, + "ap-southeast-3": 8.4578, + "ap-southeast-4": 9.597, + "ap-southeast-5": 7.20788, + "ca-central-1": 8.0546, + "eu-central-1": 8.3906, + "eu-central-2": 0.0, + "eu-north-1": 7.9202, + "eu-south-1": 8.7938, + "eu-south-2": 8.317, + "eu-west-1": 8.3234, + "eu-west-2": 8.7266, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 9.1298, + "sa-east-1": 11.2802, + "us-east-1": 0.0, + "us-east-2": 7.3826, + "us-gov-east-1": 8.861, + "us-gov-west-1": 8.861, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c7a.medium": { + "ap-northeast-1": 0.1209, + "eu-central-1": 0.11487, + "eu-north-1": 0.0, + "eu-south-2": 0.11426, + "eu-west-1": 0.11136, + "us-east-1": 0.10762, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "c7a.large": { + "ap-northeast-1": 0.1855, + "eu-central-1": 0.17343, + "eu-north-1": 0.0, + "eu-south-2": 0.17222, + "eu-west-1": 0.17743, + "us-east-1": 0.15894, + "us-east-2": 0.1692, + "us-west-2": 0.1692 + }, + "c7a.xlarge": { + "ap-northeast-1": 0.3147, + "eu-central-1": 0.29056, + "eu-north-1": 0.27606, + "eu-south-2": 0.31132, + "eu-west-1": 0.27654, + "us-east-1": 0.26158, + "us-east-2": 0.26158, + "us-west-2": 0.0 + }, + "c7a.metal-48xl": { + "ap-northeast-1": 12.5282, + "eu-central-1": 11.36948, + "eu-north-1": 10.67348, + "eu-south-2": 11.25332, + "eu-west-1": 10.69652, + "us-east-1": 0.0, + "us-east-2": 9.97844, + "us-west-2": 0.0 + }, + "c7a.2xlarge": { + "ap-northeast-1": 0.6418, + "eu-central-1": 0.59352, + "eu-north-1": 0.56452, + "eu-south-2": 0.58868, + "eu-west-1": 0.60953, + "us-east-1": 0.57662, + "us-east-2": 0.0, + "us-west-2": 0.53556 + }, + "c7a.4xlarge": { + "ap-northeast-1": 1.1586, + "eu-central-1": 0.0, + "eu-north-1": 1.00404, + "eu-south-2": 1.05236, + "eu-west-1": 1.09406, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.94612 + }, + "c7a.8xlarge": { + "ap-northeast-1": 2.39892, + "eu-central-1": 1.99908, + "eu-north-1": 2.05889, + "eu-south-2": 1.97972, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 1.93146, + "us-west-2": 1.76724 + }, + "c7a.12xlarge": { + "ap-northeast-1": 3.2258, + "eu-central-1": 3.21723, + "eu-north-1": 3.02583, + "eu-south-2": 0.0, + "eu-west-1": 2.76788, + "us-east-1": 2.58836, + "us-east-2": 2.8347, + "us-west-2": 2.58836 + }, + "c7a.16xlarge": { + "ap-northeast-1": 4.2594, + "eu-central-1": 0.0, + "eu-north-1": 3.64116, + "eu-south-2": 3.83444, + "eu-west-1": 0.0, + "us-east-1": 3.73793, + "us-east-2": 3.40948, + "us-west-2": 3.40948 + }, + "c7a.24xlarge": { + "ap-northeast-1": 6.94676, + "eu-central-1": 5.74724, + "eu-north-1": 5.39924, + "eu-south-2": 5.68916, + "eu-west-1": 5.41076, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "c7a.32xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 7.62132, + "eu-north-1": 7.15732, + "eu-south-2": 0.0, + "eu-west-1": 7.17268, + "us-east-1": 6.69396, + "us-east-2": 6.69396, + "us-west-2": 6.69396 + }, + "c7a.48xlarge": { + "ap-northeast-1": 12.5282, + "eu-central-1": 11.36948, + "eu-north-1": 10.67348, + "eu-south-2": 11.25332, + "eu-west-1": 10.69652, + "us-east-1": 0.0, + "us-east-2": 9.97844, + "us-west-2": 0.0 + }, + "c7g.medium": { + "ap-east-1": 0.1018, + "ap-northeast-1": 0.1018, + "ap-northeast-2": 0.0971, + "ap-northeast-3": 0.1046, + "ap-south-1": 0.0808, + "ap-south-2": 0.0808, + "ap-southeast-1": 0.098, + "ap-southeast-2": 0.1064, + "ap-southeast-5": 0.0917, + "ap-southeast-7": 0.0917, + "ca-central-1": 0.0, + "eu-central-1": 0.0975, + "eu-central-2": 0.0, + "eu-north-1": 0.095, + "eu-south-1": 0.0, + "eu-south-2": 0.0975, + "eu-west-1": 0.0951, + "eu-west-2": 0.0992, + "eu-west-3": 0.0, + "mx-central-1": 0.0944, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0997, + "us-gov-west-1": 0.0997, + "us-west-1": 0.1014, + "us-west-2": 0.0695 + }, + "c7g.large": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.1473, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.1529, + "ap-south-1": 0.1054, + "ap-south-2": 0.1085, + "ap-southeast-1": 0.1449, + "ap-southeast-2": 0.1507, + "ap-southeast-5": 0.1316, + "ap-southeast-7": 0.1316, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.147, + "eu-north-1": 0.1337, + "eu-south-1": 0.1419, + "eu-south-2": 0.1338, + "eu-west-1": 0.1338, + "eu-west-2": 0.1422, + "eu-west-3": 0.1422, + "mx-central-1": 0.0, + "sa-east-1": 0.1674, + "us-east-1": 0.1288, + "us-east-2": 0.1286, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.1464, + "us-west-2": 0.1288 + }, + "c7g.xlarge": { + "ap-east-1": 0.2499, + "ap-northeast-1": 0.2382, + "ap-northeast-2": 0.2298, + "ap-northeast-3": 0.2382, + "ap-south-1": 0.1545, + "ap-south-2": 0.1545, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.2144, + "eu-central-1": 0.2212, + "eu-central-2": 0.0, + "eu-north-1": 0.211, + "eu-south-1": 0.2276, + "eu-south-2": 0.2211, + "eu-west-1": 0.2113, + "eu-west-2": 0.228, + "eu-west-3": 0.228, + "mx-central-1": 0.2085, + "sa-east-1": 0.2785, + "us-east-1": 0.0, + "us-east-2": 0.2099, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.2406, + "us-west-1": 0.2365, + "us-west-2": 0.2013 + }, + "c7g.metal": { + "ap-east-1": 0.0, + "ap-northeast-1": 3.0357, + "ap-northeast-2": 2.7362, + "ap-northeast-3": 3.0354, + "ap-south-1": 1.6956, + "ap-south-2": 0.0, + "ap-southeast-1": 2.7906, + "ap-southeast-2": 3.1445, + "ap-southeast-5": 2.3906, + "ap-southeast-7": 2.3906, + "ca-central-1": 2.6549, + "eu-central-1": 2.7634, + "eu-central-2": 3.0274, + "eu-north-1": 2.6005, + "eu-south-1": 2.8657, + "eu-south-2": 2.605, + "eu-west-1": 2.6056, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "mx-central-1": 2.5608, + "sa-east-1": 3.6796, + "us-east-1": 2.445, + "us-east-2": 2.4373, + "us-gov-east-1": 2.8994, + "us-gov-west-1": 2.8994, + "us-west-1": 0.0, + "us-west-2": 2.445 + }, + "c7g.2xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.4888, + "ap-northeast-2": 0.4514, + "ap-northeast-3": 0.4888, + "ap-south-1": 0.0, + "ap-south-2": 0.3213, + "ap-southeast-1": 0.4582, + "ap-southeast-2": 0.5262, + "ap-southeast-5": 0.4082, + "ap-southeast-7": 0.4082, + "ca-central-1": 0.4412, + "eu-central-1": 0.0, + "eu-central-2": 0.4878, + "eu-north-1": 0.4344, + "eu-south-1": 0.4892, + "eu-south-2": 0.435, + "eu-west-1": 0.4351, + "eu-west-2": 0.4684, + "eu-west-3": 0.4684, + "mx-central-1": 0.0, + "sa-east-1": 0.5693, + "us-east-1": 0.415, + "us-east-2": 0.4322, + "us-gov-east-1": 0.4718, + "us-gov-west-1": 0.0, + "us-west-1": 0.5081, + "us-west-2": 0.415 + }, + "c7g.4xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.8527, + "ap-northeast-2": 0.8189, + "ap-northeast-3": 0.0, + "ap-south-1": 0.5424, + "ap-south-2": 0.5176, + "ap-southeast-1": 0.8335, + "ap-southeast-2": 0.8799, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.6914, + "ca-central-1": 0.7575, + "eu-central-1": 0.826, + "eu-central-2": 0.8962, + "eu-north-1": 0.7439, + "eu-south-1": 0.8102, + "eu-south-2": 0.784, + "eu-west-1": 0.7452, + "eu-west-2": 0.8551, + "eu-west-3": 0.8551, + "mx-central-1": 0.7722, + "sa-east-1": 1.0697, + "us-east-1": 0.705, + "us-east-2": 0.7031, + "us-gov-east-1": 0.8186, + "us-gov-west-1": 0.0, + "us-west-1": 0.8911, + "us-west-2": 0.7414 + }, + "c7g.8xlarge": { + "ap-east-1": 1.581, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.5127, + "ap-northeast-3": 1.5802, + "ap-south-1": 0.9103, + "ap-south-2": 0.9103, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.6348, + "ap-southeast-5": 1.2578, + "ap-southeast-7": 0.0, + "ca-central-1": 1.39, + "eu-central-1": 1.527, + "eu-central-2": 1.5762, + "eu-north-1": 1.4407, + "eu-south-1": 1.4954, + "eu-south-2": 1.365, + "eu-west-1": 1.3653, + "eu-west-2": 1.4988, + "eu-west-3": 1.5851, + "mx-central-1": 1.3429, + "sa-east-1": 0.0, + "us-east-1": 1.285, + "us-east-2": 1.2812, + "us-gov-east-1": 1.5996, + "us-gov-west-1": 1.5996, + "us-west-1": 1.6573, + "us-west-2": 0.0 + }, + "c7g.12xlarge": { + "ap-east-1": 2.309, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 2.3078, + "ap-south-1": 1.3029, + "ap-south-2": 1.3029, + "ap-southeast-1": 2.2505, + "ap-southeast-2": 2.532, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 2.0224, + "eu-central-1": 2.1038, + "eu-central-2": 2.3018, + "eu-north-1": 0.0, + "eu-south-1": 2.1806, + "eu-south-2": 1.985, + "eu-west-1": 2.1028, + "eu-west-2": 2.3152, + "eu-west-3": 2.1856, + "mx-central-1": 1.9519, + "sa-east-1": 2.7909, + "us-east-1": 0.0, + "us-east-2": 1.8592, + "us-gov-east-1": 2.3369, + "us-gov-west-1": 2.2058, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c7g.16xlarge": { + "ap-east-1": 3.037, + "ap-northeast-1": 3.0357, + "ap-northeast-2": 2.7362, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 1.6956, + "ap-southeast-1": 2.7906, + "ap-southeast-2": 3.1445, + "ap-southeast-5": 2.3906, + "ap-southeast-7": 2.3906, + "ca-central-1": 2.6549, + "eu-central-1": 2.7634, + "eu-central-2": 3.0274, + "eu-north-1": 2.6005, + "eu-south-1": 2.8657, + "eu-south-2": 0.0, + "eu-west-1": 2.6056, + "eu-west-2": 2.8725, + "eu-west-3": 2.8725, + "mx-central-1": 2.5608, + "sa-east-1": 3.6796, + "us-east-1": 2.445, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.8994, + "us-west-1": 3.0082, + "us-west-2": 2.445 + }, + "c7gd.medium": { + "ap-northeast-1": 0.1176, + "ap-south-1": 0.0851, + "ap-southeast-1": 0.1124, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "eu-central-1": 0.1088, + "eu-north-1": 0.1054, + "eu-south-2": 0.0, + "eu-west-1": 0.1078, + "us-east-1": 0.1017, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-west-1": 0.113, + "us-west-2": 0.1044 + }, + "c7gd.large": { + "ap-northeast-1": 0.1788, + "ap-south-1": 0.1139, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1754, + "ap-southeast-5": 0.1517, + "eu-central-1": 0.1675, + "eu-north-1": 0.1546, + "eu-south-2": 0.1593, + "eu-west-1": 0.1593, + "us-east-1": 0.147, + "us-east-2": 0.147, + "us-gov-east-1": 0.1659, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c7gd.xlarge": { + "ap-northeast-1": 0.2869, + "ap-south-1": 0.1784, + "ap-southeast-1": 0.2807, + "ap-southeast-2": 0.3087, + "ap-southeast-5": 0.2362, + "eu-central-1": 0.2661, + "eu-north-1": 0.0, + "eu-south-2": 0.2623, + "eu-west-1": 0.2623, + "us-east-1": 0.2486, + "us-east-2": 0.2377, + "us-gov-east-1": 0.2755, + "us-west-1": 0.2831, + "us-west-2": 0.2377 + }, + "c7gd.metal": { + "ap-northeast-1": 3.8146, + "ap-south-1": 1.9682, + "ap-southeast-1": 3.5119, + "ap-southeast-2": 0.0, + "ap-southeast-5": 3.0037, + "eu-central-1": 3.4818, + "eu-north-1": 3.27, + "eu-south-2": 0.0, + "eu-west-1": 3.421, + "us-east-1": 3.028, + "us-east-2": 3.028, + "us-gov-east-1": 3.6328, + "us-west-1": 0.0, + "us-west-2": 3.028 + }, + "c7gd.2xlarge": { + "ap-northeast-1": 0.5862, + "ap-south-1": 0.3554, + "ap-southeast-1": 0.5484, + "ap-southeast-2": 0.6013, + "ap-southeast-5": 0.4848, + "eu-central-1": 0.5446, + "eu-north-1": 0.5181, + "eu-south-2": 0.537, + "eu-west-1": 0.5617, + "us-east-1": 0.4879, + "us-east-2": 0.4879, + "us-gov-east-1": 0.5635, + "us-west-1": 0.6058, + "us-west-2": 0.0 + }, + "c7gd.4xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.5858, + "ap-southeast-1": 0.9717, + "ap-southeast-2": 1.0776, + "ap-southeast-5": 0.0, + "eu-central-1": 0.9642, + "eu-north-1": 0.9112, + "eu-south-2": 0.0, + "eu-west-1": 0.949, + "us-east-1": 0.0, + "us-east-2": 0.8508, + "us-gov-east-1": 1.002, + "us-west-1": 1.0322, + "us-west-2": 0.0 + }, + "c7gd.8xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 1.0466, + "ap-southeast-1": 1.92, + "ap-southeast-2": 0.0, + "ap-southeast-5": 1.5644, + "eu-central-1": 1.8034, + "eu-north-1": 1.6975, + "eu-south-2": 1.7731, + "eu-west-1": 1.773, + "us-east-1": 1.5765, + "us-east-2": 1.5765, + "us-gov-east-1": 0.0, + "us-west-1": 1.9394, + "us-west-2": 1.5765 + }, + "c7gd.12xlarge": { + "ap-northeast-1": 2.8922, + "ap-south-1": 1.5903, + "ap-southeast-1": 2.8176, + "ap-southeast-2": 2.9829, + "ap-southeast-5": 0.0, + "eu-central-1": 2.6426, + "eu-north-1": 0.0, + "eu-south-2": 2.5971, + "eu-west-1": 2.597, + "us-east-1": 2.3023, + "us-east-2": 2.3023, + "us-gov-east-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 2.3023 + }, + "c7gd.16xlarge": { + "ap-northeast-1": 3.8146, + "ap-south-1": 1.9682, + "ap-southeast-1": 3.5119, + "ap-southeast-2": 3.9356, + "ap-southeast-5": 3.0037, + "eu-central-1": 3.4818, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 3.421, + "us-east-1": 3.028, + "us-east-2": 3.028, + "us-gov-east-1": 3.6328, + "us-west-1": 3.7538, + "us-west-2": 3.028 + }, + "c7gn.medium": { + "ap-northeast-1": 0.135, + "eu-west-1": 0.1268, + "us-east-1": 0.1224, + "us-east-2": 0.1187, + "us-west-2": 0.1187 + }, + "c7gn.large": { + "ap-northeast-1": 0.2231, + "eu-west-1": 0.1973, + "us-east-1": 0.1886, + "us-east-2": 0.0, + "us-west-2": 0.1811 + }, + "c7gn.xlarge": { + "ap-northeast-1": 0.3711, + "eu-west-1": 0.0, + "us-east-1": 0.3059, + "us-east-2": 0.3059, + "us-west-2": 0.0 + }, + "c7gn.metal": { + "ap-northeast-1": 5.1618, + "eu-west-1": 4.637, + "us-east-1": 4.1186, + "us-east-2": 4.1186, + "us-west-2": 4.1186 + }, + "c7gn.2xlarge": { + "ap-northeast-1": 0.7546, + "eu-west-1": 0.689, + "us-east-1": 0.0, + "us-east-2": 0.6242, + "us-west-2": 0.6242 + }, + "c7gn.4xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 1.253, + "us-east-1": 1.1234, + "us-east-2": 1.1833, + "us-west-2": 1.1833 + }, + "c7gn.8xlarge": { + "ap-northeast-1": 2.6434, + "eu-west-1": 0.0, + "us-east-1": 2.2416, + "us-east-2": 2.1218, + "us-west-2": 0.0 + }, + "c7gn.12xlarge": { + "ap-northeast-1": 3.9026, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 3.1202, + "us-west-2": 0.0 + }, + "c7gn.16xlarge": { + "ap-northeast-1": 5.1618, + "eu-west-1": 4.637, + "us-east-1": 4.1186, + "us-east-2": 4.1186, + "us-west-2": 4.1186 + }, + "c7i.large": { + "ap-northeast-1": 0.17989, + "ap-northeast-2": 0.1571, + "ap-south-1": 0.14555, + "ap-southeast-1": 0.16949, + "ap-southeast-2": 0.17285, + "ap-southeast-5": 0.14377, + "ap-southeast-7": 0.0, + "ca-central-1": 0.15395, + "eu-central-1": 0.16834, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.15206, + "eu-west-2": 0.16235, + "eu-west-3": 0.16235, + "mx-central-1": 0.15001, + "sa-east-1": 0.19385, + "us-east-1": 0.14555, + "us-east-2": 0.14555, + "us-gov-east-1": 0.1634, + "us-gov-west-1": 0.1634, + "us-west-1": 0.1676, + "us-west-2": 0.15448 + }, + "c7i.xlarge": { + "ap-northeast-1": 0.281, + "ap-northeast-2": 0.27806, + "ap-south-1": 0.0, + "ap-southeast-1": 0.2621, + "ap-southeast-2": 0.2894, + "ap-southeast-5": 0.23124, + "ap-southeast-7": 0.23124, + "ca-central-1": 0.2516, + "eu-central-1": 0.26, + "eu-north-1": 0.0, + "eu-south-2": 0.2579, + "eu-west-1": 0.26697, + "eu-west-2": 0.2684, + "eu-west-3": 0.28961, + "mx-central-1": 0.26246, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.25265, + "us-gov-east-1": 0.2705, + "us-gov-west-1": 0.0, + "us-west-1": 0.2789, + "us-west-2": 0.2348 + }, + "c7i.metal-24xl": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.9634, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 6.27884, + "ap-southeast-5": 4.74342, + "ap-southeast-7": 4.32356, + "ca-central-1": 4.8122, + "eu-central-1": 5.0138, + "eu-north-1": 0.0, + "eu-south-2": 4.9634, + "eu-west-1": 0.0, + "eu-west-2": 5.2154, + "eu-west-3": 5.2154, + "mx-central-1": 4.62308, + "sa-east-1": 7.38764, + "us-east-1": 4.409, + "us-east-2": 4.409, + "us-gov-east-1": 5.2658, + "us-gov-west-1": 5.77988, + "us-west-1": 5.4674, + "us-west-2": 4.8374 + }, + "c7i.metal-48xl": { + "ap-northeast-1": 10.9106, + "ap-northeast-2": 9.8018, + "ap-south-1": 8.693, + "ap-southeast-1": 10.0034, + "ap-southeast-2": 11.3138, + "ap-southeast-5": 8.52212, + "ap-southeast-7": 8.52212, + "ca-central-1": 9.4994, + "eu-central-1": 9.9026, + "eu-north-1": 9.2978, + "eu-south-2": 9.8018, + "eu-west-1": 9.31796, + "eu-west-2": 10.3058, + "eu-west-3": 0.0, + "mx-central-1": 9.12116, + "sa-east-1": 13.3298, + "us-east-1": 8.693, + "us-east-2": 8.693, + "us-gov-east-1": 10.4066, + "us-gov-west-1": 10.4066, + "us-west-1": 10.8098, + "us-west-2": 8.693 + }, + "c7i.2xlarge": { + "ap-northeast-1": 0.5744, + "ap-northeast-2": 0.5282, + "ap-south-1": 0.0, + "ap-southeast-1": 0.5366, + "ap-southeast-2": 0.5912, + "ap-southeast-5": 0.47488, + "ap-southeast-7": 0.47488, + "ca-central-1": 0.5156, + "eu-central-1": 0.5324, + "eu-north-1": 0.54542, + "eu-south-2": 0.0, + "eu-west-1": 0.50804, + "eu-west-2": 0.0, + "eu-west-3": 0.5492, + "mx-central-1": 0.49984, + "sa-east-1": 0.6752, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.5534, + "us-gov-west-1": 0.5534, + "us-west-1": 0.5702, + "us-west-2": 0.482 + }, + "c7i.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.9314, + "ap-south-1": 0.839, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.0574, + "ap-southeast-5": 0.89474, + "ap-southeast-7": 0.89474, + "ca-central-1": 0.0, + "eu-central-1": 0.9398, + "eu-north-1": 0.0, + "eu-south-2": 0.9314, + "eu-west-1": 0.89108, + "eu-west-2": 0.9734, + "eu-west-3": 0.0, + "mx-central-1": 0.94965, + "sa-east-1": 1.2254, + "us-east-1": 0.9104, + "us-east-2": 0.839, + "us-gov-east-1": 0.9818, + "us-gov-west-1": 0.9818, + "us-west-1": 1.0154, + "us-west-2": 0.9104 + }, + "c7i.8xlarge": { + "ap-northeast-1": 1.9226, + "ap-northeast-2": 1.7378, + "ap-south-1": 1.553, + "ap-southeast-1": 1.93604, + "ap-southeast-2": 1.9898, + "ap-southeast-5": 1.52452, + "ap-southeast-7": 1.52452, + "ca-central-1": 1.6874, + "eu-central-1": 1.7546, + "eu-north-1": 1.6538, + "eu-south-2": 1.7378, + "eu-west-1": 1.81038, + "eu-west-2": 1.8218, + "eu-west-3": 1.8218, + "mx-central-1": 0.0, + "sa-east-1": 2.3258, + "us-east-1": 1.6958, + "us-east-2": 1.553, + "us-gov-east-1": 1.8386, + "us-gov-west-1": 1.8386, + "us-west-1": 1.9058, + "us-west-2": 0.0 + }, + "c7i.12xlarge": { + "ap-northeast-1": 2.8214, + "ap-northeast-2": 2.5442, + "ap-south-1": 2.267, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 2.22428, + "ap-southeast-7": 2.43421, + "ca-central-1": 0.0, + "eu-central-1": 2.5694, + "eu-north-1": 2.4182, + "eu-south-2": 2.5442, + "eu-west-1": 2.42324, + "eu-west-2": 2.6702, + "eu-west-3": 0.0, + "mx-central-1": 2.59894, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.267, + "us-gov-east-1": 2.6954, + "us-gov-west-1": 2.6954, + "us-west-1": 2.7962, + "us-west-2": 2.267 + }, + "c7i.16xlarge": { + "ap-northeast-1": 4.07972, + "ap-northeast-2": 0.0, + "ap-south-1": 3.2666, + "ap-southeast-1": 3.4178, + "ap-southeast-2": 3.8546, + "ap-southeast-5": 2.92404, + "ap-southeast-7": 0.0, + "ca-central-1": 3.2498, + "eu-central-1": 3.3842, + "eu-north-1": 3.1826, + "eu-south-2": 3.3506, + "eu-west-1": 3.18932, + "eu-west-2": 3.85796, + "eu-west-3": 3.5186, + "mx-central-1": 3.12372, + "sa-east-1": 4.5266, + "us-east-1": 0.0, + "us-east-2": 2.981, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.89492, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c7i.24xlarge": { + "ap-northeast-1": 5.5178, + "ap-northeast-2": 4.9634, + "ap-south-1": 4.8374, + "ap-southeast-1": 5.0642, + "ap-southeast-2": 6.27884, + "ap-southeast-5": 4.74342, + "ap-southeast-7": 4.74342, + "ca-central-1": 4.8122, + "eu-central-1": 5.50268, + "eu-north-1": 4.7114, + "eu-south-2": 4.9634, + "eu-west-1": 4.72148, + "eu-west-2": 5.2154, + "eu-west-3": 5.2154, + "mx-central-1": 4.62308, + "sa-east-1": 7.38764, + "us-east-1": 4.8374, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 5.2658, + "us-west-1": 5.4674, + "us-west-2": 0.0 + }, + "c7i.48xlarge": { + "ap-northeast-1": 10.9106, + "ap-northeast-2": 9.8018, + "ap-south-1": 8.693, + "ap-southeast-1": 0.0, + "ap-southeast-2": 11.3138, + "ap-southeast-5": 8.52212, + "ap-southeast-7": 8.52212, + "ca-central-1": 9.4994, + "eu-central-1": 0.0, + "eu-north-1": 9.2978, + "eu-south-2": 9.8018, + "eu-west-1": 9.31796, + "eu-west-2": 10.3058, + "eu-west-3": 10.3058, + "mx-central-1": 9.12116, + "sa-east-1": 13.3298, + "us-east-1": 8.693, + "us-east-2": 8.693, + "us-gov-east-1": 10.4066, + "us-gov-west-1": 0.0, + "us-west-1": 10.8098, + "us-west-2": 8.693 + }, + "c7i-flex.large": { + "ap-northeast-1": 0.16303, + "ap-northeast-2": 0.15206, + "ap-south-1": 0.14109, + "ap-southeast-1": 0.15408, + "ap-southeast-2": 0.16702, + "ap-southeast-5": 0.1394, + "ca-central-1": 0.14907, + "eu-central-1": 0.15306, + "eu-north-1": 0.14707, + "eu-south-2": 0.15206, + "eu-west-1": 0.14727, + "eu-west-2": 0.15705, + "eu-west-3": 0.15705, + "sa-east-1": 0.18697, + "us-east-1": 0.14109, + "us-east-2": 0.14109, + "us-gov-west-1": 0.15805, + "us-west-1": 0.16204, + "us-west-2": 0.14109 + }, + "c7i-flex.xlarge": { + "ap-northeast-1": 0.26977, + "ap-northeast-2": 0.24782, + "ap-south-1": 0.22588, + "ap-southeast-1": 0.25185, + "ap-southeast-2": 0.27775, + "ap-southeast-5": 0.22249, + "ca-central-1": 0.24184, + "eu-central-1": 0.24982, + "eu-north-1": 0.23785, + "eu-south-2": 0.24782, + "eu-west-1": 0.23824, + "eu-west-2": 0.2578, + "eu-west-3": 0.2578, + "sa-east-1": 0.31765, + "us-east-1": 0.22588, + "us-east-2": 0.22588, + "us-gov-west-1": 0.2598, + "us-west-1": 0.26777, + "us-west-2": 0.22588 + }, + "c7i-flex.2xlarge": { + "ap-northeast-1": 0.55193, + "ap-northeast-2": 0.50804, + "ap-south-1": 0.46415, + "ap-southeast-1": 0.5161, + "ap-southeast-2": 0.56789, + "ap-southeast-5": 0.45739, + "ca-central-1": 0.49607, + "eu-central-1": 0.51203, + "eu-north-1": 0.48809, + "eu-south-2": 0.50804, + "eu-west-1": 0.48889, + "eu-west-2": 0.52799, + "eu-west-3": 0.52799, + "sa-east-1": 0.64769, + "us-east-1": 0.46415, + "us-east-2": 0.46415, + "us-gov-west-1": 0.532, + "us-west-1": 0.54794, + "us-west-2": 0.46415 + }, + "c7i-flex.4xlarge": { + "ap-northeast-1": 0.97886, + "ap-northeast-2": 0.89108, + "ap-south-1": 0.8033, + "ap-southeast-1": 0.9072, + "ap-southeast-2": 1.01078, + "ap-southeast-5": 0.78977, + "ca-central-1": 0.86714, + "eu-central-1": 0.89906, + "eu-north-1": 0.85118, + "eu-south-2": 0.89108, + "eu-west-1": 0.85278, + "eu-west-2": 0.93098, + "eu-west-3": 0.93098, + "sa-east-1": 1.17038, + "us-east-1": 0.8033, + "us-east-2": 0.8033, + "us-gov-west-1": 0.939, + "us-west-1": 0.97088, + "us-west-2": 0.8033 + }, + "c7i-flex.8xlarge": { + "ap-northeast-1": 1.83272, + "ap-northeast-2": 1.65716, + "ap-south-1": 1.4816, + "ap-southeast-1": 1.68941, + "ap-southeast-2": 1.89656, + "ap-southeast-5": 1.45454, + "ca-central-1": 1.60928, + "eu-central-1": 1.67312, + "eu-north-1": 1.57736, + "eu-south-2": 1.65716, + "eu-west-1": 1.58055, + "eu-west-2": 1.73696, + "eu-west-3": 1.73696, + "sa-east-1": 2.21576, + "us-east-1": 1.4816, + "us-east-2": 1.4816, + "us-gov-west-1": 1.753, + "us-west-1": 1.81676, + "us-west-2": 1.4816 + }, + "c7i-flex.12xlarge": { + "ap-northeast-1": 2.68658, + "ap-south-1": 2.1599, + "ap-southeast-1": 2.47161, + "ap-southeast-2": 2.78234, + "ap-southeast-5": 2.11932, + "ca-central-1": 2.35142, + "eu-central-1": 2.44718, + "eu-north-1": 2.30354, + "eu-south-2": 2.42324, + "eu-west-1": 2.30833, + "eu-west-2": 2.54294, + "eu-west-3": 2.54294, + "sa-east-1": 3.26114, + "us-east-1": 2.1599, + "us-east-2": 2.1599, + "us-gov-west-1": 2.567, + "us-west-1": 2.66264, + "us-west-2": 2.1599 + }, + "c7i-flex.16xlarge": { + "ap-northeast-1": 3.54044, + "ap-south-1": 2.8382, + "ap-southeast-1": 3.25382, + "ap-southeast-2": 3.66812, + "ap-southeast-5": 2.78409, + "ca-central-1": 3.09356, + "eu-central-1": 3.22124, + "eu-north-1": 3.02972, + "eu-south-2": 3.18932, + "eu-west-1": 3.0361, + "eu-west-2": 3.34892, + "eu-west-3": 3.34892, + "sa-east-1": 4.30652, + "us-east-1": 2.8382, + "us-east-2": 2.8382, + "us-gov-west-1": 3.381, + "us-west-1": 3.50852, + "us-west-2": 2.8382 + }, + "c8g.medium": { + "eu-central-1": 0.10165, + "eu-north-1": 0.09885, + "eu-south-2": 0.09893, + "eu-west-1": 0.09894, + "us-east-1": 0.09618, + "us-east-2": 0.09604, + "us-west-2": 0.10017 + }, + "c8g.large": { + "eu-central-1": 0.147, + "eu-north-1": 0.0, + "eu-south-2": 0.14156, + "eu-west-1": 0.14158, + "us-east-1": 0.13606, + "us-east-2": 0.13578, + "us-west-2": 0.14404 + }, + "c8g.xlarge": { + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.22682, + "eu-west-1": 0.0, + "us-east-1": 0.21582, + "us-east-2": 0.0, + "us-west-2": 0.21582 + }, + "c8g.metal-24xl": { + "eu-central-1": 4.4786, + "eu-north-1": 4.2098, + "eu-south-2": 0.0, + "eu-west-1": 4.21844, + "us-east-1": 3.95348, + "us-east-2": 4.32154, + "us-west-2": 3.95348 + }, + "c8g.metal-48xl": { + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 8.30996, + "eu-west-1": 8.31188, + "us-east-1": 7.78196, + "us-east-2": 0.0, + "us-west-2": 7.78196 + }, + "c8g.2xlarge": { + "eu-central-1": 0.4878, + "eu-north-1": 0.4654, + "eu-south-2": 0.46604, + "eu-west-1": 0.46612, + "us-east-1": 0.44404, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "c8g.4xlarge": { + "eu-central-1": 0.8506, + "eu-north-1": 0.8058, + "eu-south-2": 0.0, + "eu-west-1": 0.80724, + "us-east-1": 0.76308, + "us-east-2": 0.76084, + "us-west-2": 0.0 + }, + "c8g.8xlarge": { + "eu-central-1": 0.0, + "eu-north-1": 1.4866, + "eu-south-2": 0.0, + "eu-west-1": 1.48948, + "us-east-1": 1.52878, + "us-east-2": 1.39668, + "us-west-2": 1.40116 + }, + "c8g.12xlarge": { + "eu-central-1": 2.51948, + "eu-north-1": 2.37164, + "eu-south-2": 2.17124, + "eu-west-1": 2.17172, + "us-east-1": 2.03924, + "us-east-2": 2.03252, + "us-west-2": 2.23066 + }, + "c8g.16xlarge": { + "eu-central-1": 3.0274, + "eu-north-1": 3.12052, + "eu-south-2": 2.85332, + "eu-west-1": 2.85396, + "us-east-1": 0.0, + "us-east-2": 2.66836, + "us-west-2": 2.67732 + }, + "c8g.24xlarge": { + "eu-central-1": 4.91396, + "eu-north-1": 4.2098, + "eu-south-2": 0.0, + "eu-west-1": 4.21844, + "us-east-1": 3.95348, + "us-east-2": 3.94004, + "us-west-2": 3.95348 + }, + "c8g.48xlarge": { + "eu-central-1": 8.8322, + "eu-north-1": 8.2946, + "eu-south-2": 8.30996, + "eu-west-1": 8.31188, + "us-east-1": 7.78196, + "us-east-2": 7.75508, + "us-west-2": 7.78196 + }, + "cc2.8xlarge": { + "ap-northeast-1": 2.449, + "eu-west-1": 2.35, + "us-east-1": 2.1, + "us-gov-west-1": 2.35, + "us-west-2": 2.1 + }, + "cr1.8xlarge": { + "ap-northeast-1": 4.205, + "eu-west-1": 3.85, + "us-east-1": 3.6, + "us-west-2": 3.6 + }, + "d2.xlarge": { + "af-south-1": 0.975, + "ap-east-1": 0.0, + "ap-northeast-1": 0.944, + "ap-northeast-2": 0.944, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 1.067, + "ap-southeast-2": 1.067, + "ca-central-1": 0.859, + "eu-central-1": 0.894, + "eu-north-1": 0.798, + "eu-south-1": 0.949, + "eu-west-1": 0.835, + "eu-west-2": 0.872, + "eu-west-3": 0.949, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 0.79, + "us-east-2": 0.79, + "us-gov-east-1": 0.928, + "us-gov-west-1": 0.841, + "us-west-1": 0.881, + "us-west-2": 0.79 + }, + "d2.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 2.014, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.788, + "ap-south-1": 1.753, + "ap-southeast-1": 1.84, + "ap-southeast-2": 2.024, + "ca-central-1": 1.618, + "eu-central-1": 1.688, + "eu-north-1": 1.496, + "eu-south-1": 0.0, + "eu-west-1": 1.57, + "eu-west-2": 1.644, + "eu-west-3": 1.798, + "me-south-1": 1.717, + "sa-east-1": 0.0, + "us-east-1": 1.628, + "us-east-2": 1.628, + "us-gov-east-1": 1.756, + "us-gov-west-1": 0.0, + "us-west-1": 1.663, + "us-west-2": 0.0 + }, + "d2.4xlarge": { + "af-south-1": 3.6, + "ap-east-1": 3.928, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.476, + "ap-northeast-3": 0.0, + "ap-south-1": 3.406, + "ap-southeast-1": 3.58, + "ap-southeast-2": 3.938, + "ca-central-1": 3.136, + "eu-central-1": 3.604, + "eu-north-1": 2.892, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 3.188, + "me-south-1": 3.334, + "sa-east-1": 0.0, + "us-east-1": 2.86, + "us-east-2": 2.86, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.325, + "us-west-1": 3.538, + "us-west-2": 2.86 + }, + "d2.8xlarge": { + "af-south-1": 7.1, + "ap-east-1": 7.756, + "ap-northeast-1": 0.0, + "ap-northeast-2": 6.852, + "ap-northeast-3": 6.852, + "ap-south-1": 0.0, + "ap-southeast-1": 7.06, + "ap-southeast-2": 7.06, + "ca-central-1": 6.172, + "eu-central-1": 6.452, + "eu-north-1": 5.684, + "eu-south-1": 6.276, + "eu-west-1": 5.98, + "eu-west-2": 6.274, + "eu-west-3": 6.276, + "me-south-1": 6.568, + "sa-east-1": 0.0, + "us-east-1": 5.62, + "us-east-2": 5.62, + "us-gov-east-1": 6.724, + "us-gov-west-1": 6.637, + "us-west-1": 6.35, + "us-west-2": 5.62 + }, + "d3.xlarge": { + "ap-northeast-1": 0.78, + "ap-south-1": 0.58, + "ap-southeast-1": 0.682, + "ap-southeast-2": 0.682, + "ca-central-1": 0.606, + "eu-central-1": 0.714, + "eu-central-2": 0.78, + "eu-west-1": 0.666, + "eu-west-2": 0.696, + "eu-west-3": 0.696, + "il-central-1": 0.696, + "us-east-1": 0.556, + "us-east-2": 0.556, + "us-gov-west-1": 0.655, + "us-west-2": 0.556 + }, + "d3.2xlarge": { + "ap-northeast-1": 1.573, + "ap-south-1": 1.172, + "ap-southeast-1": 1.377, + "ap-southeast-2": 1.377, + "ca-central-1": 1.225, + "eu-central-1": 1.441, + "eu-central-2": 1.573, + "eu-west-1": 1.344, + "eu-west-2": 1.405, + "eu-west-3": 1.405, + "il-central-1": 1.405, + "us-east-1": 1.124, + "us-east-2": 1.124, + "us-gov-west-1": 1.322, + "us-west-2": 1.124 + }, + "d3.4xlarge": { + "ap-northeast-1": 3.022, + "ap-south-1": 2.22, + "ap-southeast-1": 2.629, + "ap-southeast-2": 2.629, + "ca-central-1": 2.326, + "eu-central-1": 2.757, + "eu-central-2": 3.02, + "eu-west-1": 2.562, + "eu-west-2": 2.684, + "eu-west-3": 2.684, + "il-central-1": 2.684, + "us-east-1": 2.123, + "us-east-2": 2.123, + "us-gov-west-1": 2.519, + "us-west-2": 2.123 + }, + "d3.8xlarge": { + "ap-northeast-1": 5.91844, + "ap-south-1": 4.31404, + "ap-southeast-1": 5.13308, + "ap-southeast-2": 5.13308, + "ca-central-1": 4.52612, + "eu-central-1": 5.38948, + "eu-central-2": 5.91596, + "eu-west-1": 4.99948, + "eu-west-2": 5.24324, + "eu-west-3": 5.24324, + "il-central-1": 5.24324, + "us-east-1": 4.12052, + "us-east-2": 4.12052, + "us-gov-west-1": 4.91276, + "us-west-2": 4.12052 + }, + "d3en.xlarge": { + "ap-northeast-1": 0.819, + "ap-southeast-1": 0.715, + "ap-southeast-2": 0.715, + "ap-southeast-3": 0.715, + "eu-central-1": 0.749, + "eu-west-1": 0.698, + "us-east-1": 0.582, + "us-west-2": 0.582 + }, + "d3en.2xlarge": { + "ap-northeast-1": 1.65, + "ap-southeast-1": 1.443, + "ap-southeast-2": 1.443, + "ap-southeast-3": 1.443, + "eu-central-1": 1.51, + "eu-west-1": 1.408, + "us-east-1": 1.176, + "us-west-2": 1.176 + }, + "d3en.4xlarge": { + "ap-northeast-1": 3.174, + "ap-southeast-1": 2.761, + "ap-southeast-2": 2.761, + "ap-southeast-3": 2.761, + "eu-central-1": 2.896, + "eu-west-1": 2.691, + "us-east-1": 2.228, + "us-west-2": 2.228 + }, + "d3en.6xlarge": { + "ap-northeast-1": 4.699, + "ap-southeast-1": 4.079, + "ap-southeast-2": 4.079, + "ap-southeast-3": 4.079, + "eu-central-1": 4.281, + "eu-west-1": 3.973, + "us-east-1": 3.279, + "us-west-2": 3.279 + }, + "d3en.8xlarge": { + "ap-northeast-1": 6.2234, + "ap-southeast-1": 5.39668, + "ap-southeast-2": 5.39668, + "ap-southeast-3": 5.39668, + "eu-central-1": 5.66652, + "eu-west-1": 5.25604, + "us-east-1": 4.33076, + "us-west-2": 4.33076 + }, + "d3en.12xlarge": { + "ap-northeast-1": 9.2726, + "ap-southeast-1": 8.03252, + "ap-southeast-2": 8.03252, + "ap-southeast-3": 8.03252, + "eu-central-1": 8.43728, + "eu-west-1": 7.82156, + "us-east-1": 6.43364, + "us-west-2": 6.43364 + }, + "dl2q.24xlarge": { + "eu-central-1": 11.7202, + "us-west-2": 9.0444 + }, + "f1.2xlarge": { + "eu-central-1": 1.834, + "eu-west-1": 1.915, + "eu-west-2": 2.006, + "us-east-1": 1.915, + "us-gov-west-1": 0.0, + "us-west-2": 1.915 + }, + "f1.4xlarge": { + "eu-central-1": 3.568, + "eu-west-1": 4.093, + "eu-west-2": 3.912, + "us-east-1": 3.4, + "us-gov-west-1": 4.06, + "us-west-2": 3.4 + }, + "f1.16xlarge": { + "eu-west-1": 14.62, + "us-east-1": 0.0, + "us-gov-west-1": 15.94, + "us-west-2": 13.3 + }, + "f2.6xlarge": { + "ap-southeast-2": 2.501, + "eu-west-2": 2.699, + "us-east-1": 2.303, + "us-west-2": 2.105 + }, + "f2.12xlarge": { + "ap-southeast-2": 5.3522, + "eu-west-2": 5.273, + "us-east-1": 4.085, + "us-west-2": 4.085 + }, + "f2.48xlarge": { + "ap-southeast-2": 19.133, + "eu-west-2": 20.717, + "us-east-1": 15.965, + "us-west-2": 17.549 + }, + "g2.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.998, + "ap-southeast-1": 1.1, + "ap-southeast-2": 0.998, + "eu-central-1": 0.872, + "eu-west-1": 0.802, + "sa-east-1": 0.0, + "us-east-1": 0.75, + "us-west-1": 0.0, + "us-west-2": 0.75 + }, + "g2.8xlarge": { + "ap-northeast-1": 3.692, + "ap-northeast-2": 3.692, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.692, + "eu-central-1": 3.188, + "eu-west-1": 2.908, + "sa-east-1": 0.0, + "us-east-1": 2.7, + "us-west-1": 2.908, + "us-west-2": 2.7 + }, + "g3.4xlarge": { + "ap-northeast-1": 1.838, + "ap-northeast-2": 0.0, + "ap-southeast-1": 1.77, + "ap-southeast-2": 1.854, + "ca-central-1": 1.516, + "eu-central-1": 0.0, + "eu-west-1": 1.431, + "eu-west-2": 0.0, + "us-east-1": 1.354, + "us-east-2": 1.354, + "us-gov-west-1": 1.42, + "us-west-1": 1.634, + "us-west-2": 1.354 + }, + "g3.8xlarge": { + "ap-northeast-1": 3.26, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.608, + "ca-central-1": 3.2152, + "eu-central-1": 0.0, + "eu-west-1": 2.762, + "eu-west-2": 0.0, + "us-east-1": 2.608, + "us-east-2": 2.38, + "us-gov-west-1": 3.004, + "us-west-1": 3.168, + "us-west-2": 2.38 + }, + "g3.16xlarge": { + "ap-northeast-1": 6.42, + "ap-northeast-2": 5.78, + "ap-southeast-1": 6.78, + "ap-southeast-2": 7.116, + "ca-central-1": 0.0, + "eu-central-1": 5.8, + "eu-west-1": 4.94, + "eu-west-2": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 5.38, + "us-west-1": 6.236, + "us-west-2": 4.66 + }, + "g3s.xlarge": { + "ap-northeast-1": 1.096, + "ap-northeast-2": 0.99, + "ap-southeast-2": 1.21, + "eu-central-1": 0.994, + "eu-west-1": 0.852, + "eu-west-2": 0.996, + "us-east-1": 0.806, + "us-east-2": 0.806, + "us-gov-west-1": 0.924, + "us-west-2": 0.806 + }, + "g4ad.xlarge": { + "ap-northeast-1": 0.6182, + "ca-central-1": 0.47893, + "eu-central-1": 0.52957, + "eu-west-1": 0.52119, + "eu-west-2": 0.49901, + "us-east-1": 0.43483, + "us-east-2": 0.43483, + "us-west-2": 0.0 + }, + "g4ad.2xlarge": { + "ap-northeast-1": 0.8553, + "ca-central-1": 0.72921, + "eu-central-1": 0.80162, + "eu-west-1": 0.78963, + "eu-west-2": 0.75792, + "us-east-1": 0.66617, + "us-east-2": 0.66617, + "us-west-2": 0.0 + }, + "g4ad.4xlarge": { + "ap-northeast-1": 1.295, + "ca-central-1": 0.0, + "eu-central-1": 1.209, + "eu-west-1": 1.093, + "eu-west-2": 1.2404, + "us-east-1": 0.0, + "us-east-2": 0.992, + "us-west-2": 1.0787 + }, + "g4ad.8xlarge": { + "ap-northeast-1": 0.0, + "ca-central-1": 2.061, + "eu-central-1": 0.0, + "eu-west-1": 2.061, + "eu-west-2": 2.153, + "us-east-1": 2.0324, + "us-east-2": 1.859, + "us-west-2": 1.859 + }, + "g4ad.16xlarge": { + "ap-northeast-1": 5.273, + "ca-central-1": 4.3842, + "eu-central-1": 0.0, + "eu-west-1": 3.997, + "eu-west-2": 4.181, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 3.593 + }, + "g4dn.xlarge": { + "af-south-1": 0.754, + "ap-east-1": 0.0, + "ap-northeast-1": 0.766, + "ap-northeast-2": 0.703, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.836, + "ap-southeast-2": 0.74, + "ca-central-1": 0.64, + "eu-central-1": 0.714, + "eu-north-1": 0.648, + "eu-south-1": 0.672, + "eu-west-1": 0.643, + "eu-west-2": 0.672, + "eu-west-3": 0.0, + "me-south-1": 0.743, + "sa-east-1": 0.95, + "us-east-1": 0.582, + "us-east-2": 0.0, + "us-gov-east-1": 0.719, + "us-gov-west-1": 0.719, + "us-west-1": 0.688, + "us-west-2": 0.582, + "us-west-2-lax-1": 0.73 + }, + "g4dn.metal": { + "af-south-1": 10.506, + "ap-east-1": 12.173, + "ap-northeast-1": 10.687, + "ap-northeast-2": 9.749, + "ap-northeast-3": 10.687, + "ap-south-1": 8.737, + "ap-southeast-1": 11.073, + "ap-southeast-2": 10.299, + "ca-central-1": 8.812, + "eu-central-1": 9.905, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 8.849, + "eu-west-2": 0.0, + "eu-west-3": 9.273, + "me-south-1": 9.721, + "sa-east-1": 13.423, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 9.987, + "us-west-1": 9.514, + "us-west-2": 7.949, + "us-west-2-lax-1": 9.514 + }, + "g4dn.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.283, + "ap-northeast-1": 1.14, + "ap-northeast-2": 1.05, + "ap-northeast-3": 1.206, + "ap-south-1": 0.953, + "ap-southeast-1": 1.177, + "ap-southeast-2": 1.103, + "ca-central-1": 1.01, + "eu-central-1": 1.065, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.963, + "eu-west-2": 1.005, + "eu-west-3": 1.004, + "me-south-1": 1.047, + "sa-east-1": 1.486, + "us-east-1": 0.922, + "us-east-2": 0.877, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.073, + "us-west-1": 1.027, + "us-west-2": 0.0, + "us-west-2-lax-1": 1.088 + }, + "g4dn.4xlarge": { + "af-south-1": 1.722, + "ap-east-1": 1.979, + "ap-northeast-1": 1.856, + "ap-northeast-2": 1.606, + "ap-northeast-3": 1.75, + "ap-south-1": 1.45, + "ap-southeast-1": 1.911, + "ap-southeast-2": 1.691, + "ca-central-1": 1.462, + "eu-central-1": 1.63, + "eu-north-1": 1.479, + "eu-south-1": 1.626, + "eu-west-1": 1.467, + "eu-west-2": 0.0, + "eu-west-3": 1.533, + "me-south-1": 1.602, + "sa-east-1": 2.171, + "us-east-1": 1.329, + "us-east-2": 1.329, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.643, + "us-west-1": 1.57, + "us-west-2": 0.0, + "us-west-2-lax-1": 1.57 + }, + "g4dn.8xlarge": { + "af-south-1": 3.012, + "ap-east-1": 3.476, + "ap-northeast-1": 3.063, + "ap-northeast-2": 2.802, + "ap-northeast-3": 3.254, + "ap-south-1": 0.0, + "ap-southeast-1": 3.17, + "ap-southeast-2": 0.0, + "ca-central-1": 2.541, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 2.672, + "eu-west-1": 2.551, + "eu-west-2": 0.0, + "eu-west-3": 2.669, + "me-south-1": 2.794, + "sa-east-1": 0.0, + "us-east-1": 2.432, + "us-east-2": 2.301, + "us-gov-east-1": 3.032, + "us-gov-west-1": 2.868, + "us-west-1": 2.911, + "us-west-2": 2.301, + "us-west-2-lax-1": 0.0 + }, + "g4dn.12xlarge": { + "af-south-1": 5.315, + "ap-east-1": 6.511, + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.225, + "ap-northeast-3": 5.406, + "ap-south-1": 4.431, + "ap-southeast-1": 5.599, + "ap-southeast-2": 5.517, + "ca-central-1": 4.729, + "eu-central-1": 5.015, + "eu-north-1": 0.0, + "eu-south-1": 4.705, + "eu-west-1": 4.487, + "eu-west-2": 4.702, + "eu-west-3": 4.699, + "me-south-1": 5.235, + "sa-east-1": 6.774, + "us-east-1": 4.037, + "us-east-2": 4.037, + "us-gov-east-1": 5.056, + "us-gov-west-1": 0.0, + "us-west-1": 4.819, + "us-west-2": 4.037, + "us-west-2-lax-1": 4.819 + }, + "g4dn.16xlarge": { + "af-south-1": 6.275, + "ap-east-1": 6.827, + "ap-northeast-1": 6.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 4.916, + "ap-southeast-1": 6.214, + "ap-southeast-2": 0.0, + "ca-central-1": 4.957, + "eu-central-1": 5.919, + "eu-north-1": 4.742, + "eu-south-1": 0.0, + "eu-west-1": 4.978, + "eu-west-2": 5.217, + "eu-west-3": 0.0, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 4.477, + "us-east-2": 4.738, + "us-gov-east-1": 5.94, + "us-gov-west-1": 0.0, + "us-west-1": 5.347, + "us-west-2": 4.477, + "us-west-2-lax-1": 5.697 + }, + "g5.xlarge": { + "ap-northeast-1": 1.5153, + "ap-northeast-2": 1.2933, + "ap-south-1": 1.2643, + "ap-southeast-2": 1.3643, + "ap-southeast-3": 1.4643, + "ca-central-1": 1.285, + "eu-central-1": 0.0, + "eu-north-1": 1.1233, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "me-central-1": 1.2903, + "sa-east-1": 1.7663, + "us-east-1": 1.0623, + "us-east-2": 1.1629, + "us-west-2": 1.0623 + }, + "g5.2xlarge": { + "ap-northeast-1": 2.05854, + "ap-northeast-2": 1.6153, + "ap-south-1": 1.58036, + "ap-southeast-2": 1.70084, + "ap-southeast-3": 1.82132, + "ca-central-1": 0.0, + "eu-central-1": 1.79216, + "eu-north-1": 1.41049, + "eu-west-1": 1.47796, + "eu-west-2": 0.0, + "il-central-1": 1.54561, + "me-central-1": 1.61169, + "sa-east-1": 2.18516, + "us-east-1": 1.337, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "g5.4xlarge": { + "ap-northeast-1": 2.48028, + "ap-northeast-2": 2.12191, + "ap-south-1": 2.2701, + "ap-southeast-2": 2.23652, + "ap-southeast-3": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 2.15581, + "eu-north-1": 0.0, + "eu-west-1": 1.93787, + "eu-west-2": 2.18648, + "il-central-1": 2.02852, + "me-central-1": 0.0, + "sa-east-1": 2.88548, + "us-east-1": 0.0, + "us-east-2": 1.749, + "us-west-2": 1.9114, + "us-west-2-lax-1": 0.0 + }, + "g5.8xlarge": { + "ap-northeast-1": 3.67533, + "ap-northeast-2": 3.13512, + "ap-south-1": 0.0, + "ap-southeast-2": 3.30789, + "ap-southeast-3": 3.55123, + "ca-central-1": 0.0, + "eu-central-1": 3.49234, + "eu-north-1": 2.72144, + "eu-west-1": 3.13098, + "eu-west-2": 3.5432, + "il-central-1": 2.99434, + "me-central-1": 3.12782, + "sa-east-1": 4.70222, + "us-east-1": 2.573, + "us-east-2": 2.573, + "us-west-2": 2.573, + "us-west-2-lax-1": 0.0 + }, + "g5.12xlarge": { + "ap-northeast-1": 8.35109, + "ap-northeast-2": 7.09942, + "ap-south-1": 6.93591, + "ap-southeast-2": 7.49973, + "ap-southeast-3": 8.06354, + "ca-central-1": 6.42284, + "eu-central-1": 0.0, + "eu-north-1": 6.14093, + "eu-west-1": 6.45667, + "eu-west-2": 8.04494, + "il-central-1": 6.77325, + "me-central-1": 7.0825, + "sa-east-1": 0.0, + "us-east-1": 5.797, + "us-east-2": 5.797, + "us-west-2": 0.0 + }, + "g5.16xlarge": { + "ap-northeast-1": 6.06542, + "ap-northeast-2": 5.16153, + "ap-south-1": 5.04346, + "ap-southeast-2": 0.0, + "ap-southeast-3": 6.43105, + "ca-central-1": 4.67294, + "eu-central-1": 5.75924, + "eu-north-1": 4.46937, + "eu-west-1": 4.69737, + "eu-west-2": 5.3244, + "il-central-1": 4.92599, + "me-central-1": 5.65175, + "sa-east-1": 7.08739, + "us-east-1": 4.221, + "us-east-2": 4.221, + "us-west-2": 4.221 + }, + "g5.24xlarge": { + "ap-northeast-1": 11.93623, + "ap-northeast-2": 10.13904, + "ap-south-1": 10.8822, + "ap-southeast-2": 10.71382, + "ap-southeast-3": 11.52336, + "ca-central-1": 10.07185, + "eu-central-1": 10.30905, + "eu-north-1": 8.76282, + "eu-west-1": 9.21617, + "eu-west-2": 10.46286, + "il-central-1": 9.67072, + "me-central-1": 10.11476, + "sa-east-1": 13.96818, + "us-east-1": 8.269, + "us-east-2": 0.0, + "us-west-2": 9.0834 + }, + "g5.48xlarge": { + "ap-northeast-1": 23.74746, + "ap-northeast-2": 20.15309, + "ap-south-1": 19.68355, + "ap-southeast-2": 21.30264, + "ap-southeast-3": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 17.40064, + "eu-west-1": 18.30733, + "eu-west-2": 20.80072, + "il-central-1": 19.21645, + "me-central-1": 20.10451, + "sa-east-1": 27.81136, + "us-east-1": 16.413, + "us-east-2": 16.413, + "us-west-2": 16.413 + }, + "g5g.xlarge": { + "ap-northeast-1": 0.6232, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.644, + "eu-central-1": 0.0, + "eu-south-2": 0.525, + "us-east-1": 0.4763, + "us-west-2": 0.0 + }, + "g5g.metal": { + "ap-northeast-1": 3.8289, + "ap-northeast-2": 3.5002, + "ap-southeast-1": 3.9645, + "eu-central-1": 3.5576, + "eu-south-2": 3.1872, + "us-east-1": 0.0, + "us-west-2": 0.0 + }, + "g5g.2xlarge": { + "ap-northeast-1": 0.8755, + "ap-northeast-2": 0.8089, + "ap-southeast-1": 0.903, + "eu-central-1": 0.8657, + "eu-south-2": 0.7455, + "us-east-1": 0.681, + "us-west-2": 0.681 + }, + "g5g.4xlarge": { + "ap-northeast-1": 1.2426, + "ap-northeast-2": 1.1435, + "ap-southeast-1": 0.0, + "eu-central-1": 1.2281, + "eu-south-2": 1.049, + "us-east-1": 0.0, + "us-west-2": 0.953 + }, + "g5g.8xlarge": { + "ap-northeast-1": 1.9769, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-south-2": 1.6561, + "us-east-1": 1.497, + "us-west-2": 1.497 + }, + "g5g.16xlarge": { + "ap-northeast-1": 3.8289, + "ap-northeast-2": 3.5002, + "ap-southeast-1": 0.0, + "eu-central-1": 3.5576, + "eu-south-2": 0.0, + "us-east-1": 2.869, + "us-west-2": 0.0 + }, + "g6.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.0459, + "ap-south-1": 1.0227, + "ap-southeast-2": 1.1027, + "ap-southeast-5": 1.0701, + "ca-central-1": 0.0, + "eu-central-1": 1.0627, + "eu-central-2": 0.0, + "eu-north-1": 0.9099, + "eu-south-2": 0.0, + "eu-west-2": 1.0779, + "eu-west-3": 1.0779, + "sa-east-1": 0.0, + "us-east-1": 0.94158, + "us-east-2": 0.0, + "us-gov-west-1": 1.0707, + "us-west-2": 0.8611 + }, + "g6.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 1.41629, + "ap-southeast-2": 1.52318, + "ap-southeast-5": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 1.46973, + "eu-central-2": 1.44296, + "eu-north-1": 1.16188, + "eu-south-2": 0.0, + "eu-west-2": 1.49004, + "eu-west-3": 1.36595, + "sa-east-1": 1.9529, + "us-east-1": 1.1026, + "us-east-2": 1.1026, + "us-gov-west-1": 1.3572, + "us-west-2": 1.1026 + }, + "g6.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 1.87278, + "ap-southeast-2": 1.84542, + "ap-southeast-5": 1.95851, + "ca-central-1": 0.0, + "eu-central-1": 1.77966, + "eu-central-2": 1.90889, + "eu-north-1": 1.52843, + "eu-south-2": 0.0, + "eu-west-2": 1.80465, + "eu-west-3": 1.80465, + "sa-east-1": 2.37418, + "us-east-1": 1.4482, + "us-east-2": 1.4482, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "g6.8xlarge": { + "ap-northeast-1": 3.04648, + "ap-northeast-2": 2.60195, + "ap-south-1": 2.54388, + "ap-southeast-2": 0.0, + "ap-southeast-5": 2.66252, + "ca-central-1": 2.58533, + "eu-central-1": 2.644, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 2.24753, + "eu-west-2": 0.0, + "eu-west-3": 2.93775, + "sa-east-1": 3.89149, + "us-east-1": 2.34084, + "us-east-2": 2.1394, + "us-gov-west-1": 2.91793, + "us-west-2": 2.34084 + }, + "g6.12xlarge": { + "ap-northeast-1": 6.79869, + "ap-northeast-2": 5.78323, + "ap-south-1": 6.20314, + "ap-southeast-2": 6.10799, + "ap-southeast-5": 5.9216, + "ca-central-1": 0.0, + "eu-central-1": 5.87929, + "eu-central-2": 6.3287, + "eu-north-1": 5.49369, + "eu-south-2": 5.45846, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 7.94681, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 6.50503, + "us-west-2": 4.7266 + }, + "g6.16xlarge": { + "ap-northeast-1": 5.05137, + "ap-northeast-2": 0.0, + "ap-south-1": 4.20386, + "ap-southeast-2": 4.54152, + "ap-southeast-5": 4.40392, + "ca-central-1": 3.8966, + "eu-central-1": 4.79746, + "eu-central-2": 5.16238, + "eu-north-1": 3.72777, + "eu-south-2": 4.06205, + "eu-west-2": 4.43684, + "eu-west-3": 4.43684, + "sa-east-1": 0.0, + "us-east-1": 3.86148, + "us-east-2": 3.86148, + "us-gov-west-1": 4.8346, + "us-west-2": 0.0 + }, + "g6.24xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 8.33297, + "ap-south-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "ca-central-1": 7.53673, + "eu-central-1": 8.47232, + "eu-central-2": 9.12424, + "eu-north-1": 7.91295, + "eu-south-2": 7.15851, + "eu-west-2": 8.59839, + "eu-west-3": 8.59839, + "sa-east-1": 11.47151, + "us-east-1": 6.8002, + "us-east-2": 7.46772, + "us-gov-west-1": 8.53867, + "us-west-2": 7.46772 + }, + "g6.48xlarge": { + "ap-northeast-1": 19.48706, + "ap-northeast-2": 0.0, + "ap-south-1": 16.1561, + "ap-southeast-2": 0.0, + "ap-southeast-5": 16.94239, + "ca-central-1": 14.94846, + "eu-central-1": 0.0, + "eu-central-2": 18.12349, + "eu-north-1": 0.0, + "eu-south-2": 14.19202, + "eu-west-2": 0.0, + "eu-west-3": 17.07178, + "sa-east-1": 22.81803, + "us-east-1": 13.4754, + "us-east-2": 13.4754, + "us-gov-west-1": 16.95234, + "us-west-2": 13.4754 + }, + "g6e.xlarge": { + "ap-northeast-1": 3.0252, + "eu-central-1": 2.3833, + "eu-north-1": 2.0303, + "eu-south-2": 2.0173, + "us-east-1": 1.9173, + "us-east-2": 1.9173, + "us-west-2": 2.1034 + }, + "g6e.2xlarge": { + "ap-northeast-1": 3.37668, + "eu-central-1": 2.9285, + "eu-north-1": 0.0, + "eu-south-2": 2.48756, + "us-east-1": 2.59129, + "us-east-2": 0.0, + "us-west-2": 2.59129 + }, + "g6e.4xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 3.88151, + "eu-north-1": 3.31166, + "eu-south-2": 3.29067, + "us-east-1": 0.0, + "us-east-2": 3.12924, + "us-west-2": 3.12924 + }, + "g6e.8xlarge": { + "ap-northeast-1": 7.34952, + "eu-central-1": 5.78752, + "eu-north-1": 0.0, + "eu-south-2": 5.37409, + "us-east-1": 0.0, + "us-east-2": 5.10641, + "us-west-2": 5.10641 + }, + "g6e.12xlarge": { + "ap-northeast-1": 15.34242, + "eu-central-1": 14.55703, + "eu-north-1": 11.25475, + "eu-south-2": 11.18145, + "us-east-1": 11.6669, + "us-east-2": 10.61764, + "us-west-2": 10.61764 + }, + "g6e.16xlarge": { + "ap-northeast-1": 11.11417, + "eu-central-1": 10.547, + "eu-north-1": 8.16228, + "eu-south-2": 8.10935, + "us-east-1": 0.0, + "us-east-2": 7.70219, + "us-west-2": 8.45991 + }, + "g6e.24xlarge": { + "ap-northeast-1": 21.97456, + "eu-central-1": 20.84687, + "eu-north-1": 17.70341, + "eu-south-2": 16.00013, + "us-east-1": 15.19059, + "us-east-2": 0.0, + "us-west-2": 15.19059 + }, + "g6e.48xlarge": { + "ap-northeast-1": 43.82412, + "eu-central-1": 37.80112, + "eu-north-1": 32.08575, + "eu-south-2": 31.87527, + "us-east-1": 30.25618, + "us-east-2": 30.25618, + "us-west-2": 0.0 + }, + "gr6.4xlarge": { + "ap-northeast-1": 2.3573, + "ap-northeast-2": 2.0176, + "ap-south-1": 1.9733, + "ap-southeast-2": 2.1262, + "ap-southeast-5": 2.0638, + "ca-central-1": 1.834, + "eu-central-1": 2.0498, + "eu-central-2": 2.2899, + "eu-north-1": 1.7576, + "eu-south-2": 1.7468, + "eu-west-2": 2.0789, + "eu-west-3": 2.0788, + "sa-east-1": 2.7414, + "us-east-1": 1.6642, + "us-east-2": 1.6642, + "us-gov-west-1": 2.0651, + "us-west-2": 1.6642 + }, + "gr6.8xlarge": { + "ap-northeast-1": 3.67301, + "ap-northeast-2": 3.13309, + "ap-south-1": 3.06268, + "ap-southeast-2": 3.3057, + "ap-southeast-5": 3.20652, + "ca-central-1": 2.84128, + "eu-central-1": 3.18427, + "eu-central-2": 3.56589, + "eu-north-1": 2.71985, + "eu-south-2": 2.70268, + "eu-west-2": 3.23052, + "eu-west-3": 3.23036, + "sa-east-1": 4.2835, + "us-east-1": 2.5714, + "us-east-2": 2.5714, + "us-gov-west-1": 3.20859, + "us-west-2": 2.5714 + }, + "h1.2xlarge": { + "eu-west-1": 0.655, + "us-east-1": 0.598, + "us-east-2": 0.598, + "us-west-2": 0.568 + }, + "h1.4xlarge": { + "eu-west-1": 0.0, + "us-east-1": 1.097, + "us-east-2": 1.036, + "us-west-2": 1.036 + }, + "h1.8xlarge": { + "eu-west-1": 2.176, + "us-east-1": 1.972, + "us-east-2": 2.093, + "us-west-2": 0.0 + }, + "h1.16xlarge": { + "eu-west-1": 0.0, + "us-east-1": 3.844, + "us-east-2": 3.844, + "us-west-2": 0.0 + }, + "hpc6a.48xlarge": { + "ap-southeast-1": 3.4455, + "ap-southeast-2": 3.8859, + "eu-north-1": 3.218, + "us-east-2": 3.005, + "us-gov-east-1": 3.592, + "us-gov-west-1": 3.592 + }, + "hpc6id.32xlarge": { + "eu-north-1": 6.1602, + "eu-west-3": 6.89794, + "us-east-2": 5.825, + "us-gov-west-1": 6.9794 + }, + "hpc7a.12xlarge": { + "eu-north-1": 7.8502, + "eu-west-1": 7.8502, + "eu-west-3": 8.6803, + "us-east-2": 7.325, + "us-gov-west-1": 8.7924 + }, + "hpc7a.24xlarge": { + "eu-north-1": 7.8502, + "eu-west-1": 7.8502, + "eu-west-3": 8.6803, + "us-east-2": 7.325, + "us-gov-west-1": 8.7924 + }, + "hpc7a.48xlarge": { + "eu-north-1": 7.8502, + "eu-west-1": 7.8502, + "eu-west-3": 8.6803, + "us-east-2": 7.325, + "us-gov-west-1": 8.7924 + }, + "hpc7a.96xlarge": { + "eu-north-1": 7.8502, + "eu-west-1": 7.8502, + "eu-west-3": 8.6803, + "us-east-2": 7.325, + "us-gov-west-1": 8.7924 + }, + "hpc7g.4xlarge": { + "ap-northeast-1": 2.2367, + "eu-west-1": 1.9309, + "us-east-1": 1.8082, + "us-gov-west-1": 2.1512 + }, + "hpc7g.8xlarge": { + "ap-northeast-1": 2.2367, + "eu-west-1": 1.9309, + "us-east-1": 1.8082, + "us-gov-west-1": 2.1512 + }, + "hpc7g.16xlarge": { + "ap-northeast-1": 2.2367, + "eu-west-1": 1.9309, + "us-east-1": 1.8082, + "us-gov-west-1": 2.1512 + }, + "hs1.8xlarge": { + "ap-northeast-1": 5.5, + "ap-southeast-1": 5.67, + "ap-southeast-2": 5.67, + "eu-west-1": 5.0, + "us-east-1": 4.7, + "us-gov-west-1": 5.62, + "us-west-2": 4.7 + }, + "i2.xlarge": { + "ap-northeast-1": 1.101, + "ap-northeast-2": 1.101, + "ap-south-1": 1.067, + "ap-southeast-1": 1.118, + "ap-southeast-2": 1.22, + "eu-central-1": 1.113, + "eu-west-1": 1.038, + "sa-east-1": 0.0, + "us-east-1": 0.953, + "us-east-2": 0.0, + "us-gov-west-1": 1.123, + "us-west-1": 1.038, + "us-west-2": 0.0 + }, + "i2.2xlarge": { + "ap-northeast-1": 2.101, + "ap-northeast-2": 0.0, + "ap-south-1": 2.236, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.135, + "eu-central-1": 2.338, + "eu-west-1": 2.164, + "sa-east-1": 0.0, + "us-east-1": 1.805, + "us-east-2": 1.976, + "us-gov-west-1": 2.146, + "us-west-1": 2.164, + "us-west-2": 1.805 + }, + "i2.4xlarge": { + "ap-northeast-1": 4.102, + "ap-northeast-2": 4.102, + "ap-south-1": 3.967, + "ap-southeast-1": 4.17, + "ap-southeast-2": 4.17, + "eu-central-1": 4.151, + "eu-west-1": 3.851, + "sa-east-1": 0.0, + "us-east-1": 3.851, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 3.851, + "us-west-2": 3.851 + }, + "i2.8xlarge": { + "ap-northeast-1": 8.104, + "ap-northeast-2": 8.104, + "ap-south-1": 7.833, + "ap-southeast-1": 8.24, + "ap-southeast-2": 0.0, + "eu-central-1": 8.202, + "eu-west-1": 7.602, + "sa-east-1": 0.0, + "us-east-1": 6.92, + "us-east-2": 6.92, + "us-gov-west-1": 8.284, + "us-west-1": 7.602, + "us-west-2": 6.92 + }, + "i3.large": { + "af-south-1": 0.305, + "ap-east-1": 0.306, + "ap-northeast-1": 0.283, + "ap-northeast-2": 0.283, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.295, + "ap-southeast-1": 0.287, + "ap-southeast-2": 0.287, + "ap-southeast-3": 0.287, + "ap-southeast-4": 0.306, + "ca-central-1": 0.272, + "eu-central-1": 0.286, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.281, + "eu-south-2": 0.272, + "eu-west-1": 0.289, + "eu-west-2": 0.0, + "eu-west-3": 0.281, + "il-central-1": 0.281, + "me-central-1": 0.289, + "me-south-1": 0.289, + "sa-east-1": 0.374, + "us-east-1": 0.256, + "us-east-2": 0.256, + "us-gov-east-1": 0.288, + "us-gov-west-1": 0.288, + "us-west-1": 0.272, + "us-west-2": 0.0 + }, + "i3.xlarge": { + "af-south-1": 0.551, + "ap-east-1": 0.512, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.466, + "ap-northeast-3": 0.0, + "ap-south-1": 0.489, + "ap-south-2": 0.0, + "ap-southeast-1": 0.474, + "ap-southeast-2": 0.474, + "ap-southeast-3": 0.511, + "ap-southeast-4": 0.511, + "ca-central-1": 0.478, + "eu-central-1": 0.0, + "eu-central-2": 0.509, + "eu-north-1": 0.426, + "eu-south-1": 0.0, + "eu-south-2": 0.444, + "eu-west-1": 0.478, + "eu-west-2": 0.0, + "eu-west-3": 0.462, + "il-central-1": 0.0, + "me-central-1": 0.478, + "me-south-1": 0.516, + "sa-east-1": 0.598, + "us-east-1": 0.0, + "us-east-2": 0.412, + "us-gov-east-1": 0.476, + "us-gov-west-1": 0.476, + "us-west-1": 0.444, + "us-west-2": 0.443 + }, + "i3.metal": { + "af-south-1": 6.66, + "ap-east-1": 6.692, + "ap-northeast-1": 5.956, + "ap-northeast-2": 5.956, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 6.084, + "ap-southeast-2": 6.084, + "ca-central-1": 5.604, + "eu-central-1": 0.0, + "eu-north-1": 5.316, + "eu-south-1": 5.892, + "eu-west-1": 5.604, + "eu-west-2": 0.0, + "eu-west-3": 5.892, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 5.092, + "us-east-2": 5.092, + "us-gov-east-1": 6.116, + "us-gov-west-1": 0.0, + "us-west-1": 5.604, + "us-west-2": 5.092 + }, + "i3.2xlarge": { + "af-south-1": 0.92, + "ap-east-1": 0.924, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.832, + "ap-northeast-3": 0.832, + "ap-south-1": 0.808, + "ap-south-2": 0.808, + "ap-southeast-1": 0.848, + "ap-southeast-2": 0.848, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.848, + "ca-central-1": 0.857, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.817, + "eu-south-1": 0.896, + "eu-south-2": 0.788, + "eu-west-1": 0.857, + "eu-west-2": 0.824, + "eu-west-3": 0.824, + "il-central-1": 0.822, + "me-central-1": 0.0, + "me-south-1": 0.857, + "sa-east-1": 0.0, + "us-east-1": 0.786, + "us-east-2": 0.724, + "us-gov-east-1": 0.852, + "us-gov-west-1": 0.852, + "us-west-1": 0.0, + "us-west-2": 0.724 + }, + "i3.4xlarge": { + "af-south-1": 1.74, + "ap-east-1": 1.748, + "ap-northeast-1": 1.564, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.71, + "ap-south-1": 1.516, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.746, + "ap-southeast-4": 1.746, + "ca-central-1": 1.476, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 1.404, + "eu-south-1": 1.548, + "eu-south-2": 1.476, + "eu-west-1": 1.614, + "eu-west-2": 1.693, + "eu-west-3": 1.693, + "il-central-1": 1.545, + "me-central-1": 1.765, + "me-south-1": 1.614, + "sa-east-1": 2.092, + "us-east-1": 0.0, + "us-east-2": 1.348, + "us-gov-east-1": 1.604, + "us-gov-west-1": 1.604, + "us-west-1": 1.476, + "us-west-2": 1.348 + }, + "i3.8xlarge": { + "af-south-1": 3.38, + "ap-east-1": 3.396, + "ap-northeast-1": 3.321, + "ap-northeast-2": 3.028, + "ap-northeast-3": 3.028, + "ap-south-1": 2.932, + "ap-south-2": 2.932, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.391, + "ap-southeast-3": 0.0, + "ap-southeast-4": 3.092, + "ca-central-1": 3.127, + "eu-central-1": 0.0, + "eu-central-2": 3.374, + "eu-north-1": 2.708, + "eu-south-1": 3.286, + "eu-south-2": 0.0, + "eu-west-1": 2.852, + "eu-west-2": 2.996, + "eu-west-3": 3.286, + "il-central-1": 3.279, + "me-central-1": 3.43, + "me-south-1": 3.127, + "sa-east-1": 0.0, + "us-east-1": 2.596, + "us-east-2": 2.846, + "us-gov-east-1": 3.108, + "us-gov-west-1": 3.108, + "us-west-1": 2.852, + "us-west-2": 2.596 + }, + "i3.16xlarge": { + "af-south-1": 6.66, + "ap-east-1": 6.692, + "ap-northeast-1": 5.956, + "ap-northeast-2": 5.956, + "ap-northeast-3": 5.956, + "ap-south-1": 5.764, + "ap-south-2": 5.764, + "ap-southeast-1": 6.084, + "ap-southeast-2": 6.084, + "ap-southeast-3": 6.084, + "ap-southeast-4": 6.084, + "ca-central-1": 5.604, + "eu-central-1": 6.052, + "eu-central-2": 6.647, + "eu-north-1": 5.316, + "eu-south-1": 0.0, + "eu-south-2": 5.604, + "eu-west-1": 5.604, + "eu-west-2": 5.892, + "eu-west-3": 5.892, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 6.154, + "sa-east-1": 8.068, + "us-east-1": 5.092, + "us-east-2": 5.092, + "us-gov-east-1": 6.116, + "us-gov-west-1": 0.0, + "us-west-1": 5.604, + "us-west-2": 5.092 + }, + "i3en.large": { + "af-south-1": 0.353, + "ap-east-1": 0.355, + "ap-northeast-1": 0.322, + "ap-northeast-2": 0.322, + "ap-northeast-3": 0.322, + "ap-south-1": 0.313, + "ap-south-2": 0.0, + "ap-southeast-1": 0.327, + "ap-southeast-2": 0.327, + "ap-southeast-3": 0.327, + "ap-southeast-4": 0.327, + "ap-southeast-5": 0.3, + "ap-southeast-7": 0.3, + "ca-central-1": 0.306, + "ca-west-1": 0.306, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.306, + "eu-west-1": 0.0, + "eu-west-2": 0.319, + "eu-west-3": 0.319, + "il-central-1": 0.336, + "me-central-1": 0.0, + "me-south-1": 0.33, + "mx-central-1": 0.294, + "sa-east-1": 0.0, + "us-east-1": 0.297, + "us-east-2": 0.282, + "us-gov-east-1": 0.347, + "us-gov-west-1": 0.347, + "us-west-1": 0.0, + "us-west-2": 0.282, + "us-west-2-lax-1": 0.328 + }, + "i3en.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.653, + "ap-northeast-1": 0.588, + "ap-northeast-2": 0.623, + "ap-northeast-3": 0.623, + "ap-south-1": 0.0, + "ap-south-2": 0.57, + "ap-southeast-1": 0.598, + "ap-southeast-2": 0.598, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.598, + "ap-southeast-5": 0.576, + "ap-southeast-7": 0.544, + "ca-central-1": 0.0, + "ca-west-1": 0.556, + "eu-central-1": 0.596, + "eu-central-2": 0.689, + "eu-north-1": 0.561, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.589, + "eu-west-2": 0.0, + "eu-west-3": 0.582, + "il-central-1": 0.581, + "me-central-1": 0.606, + "me-south-1": 0.0, + "mx-central-1": 0.531, + "sa-east-1": 0.776, + "us-east-1": 0.0, + "us-east-2": 0.508, + "us-gov-east-1": 0.602, + "us-gov-west-1": 0.602, + "us-west-1": 0.556, + "us-west-2": 0.508, + "us-west-2-lax-1": 0.599 + }, + "i3en.metal": { + "af-south-1": 0.0, + "ap-east-1": 14.444, + "ap-northeast-1": 12.893, + "ap-northeast-2": 12.893, + "ap-northeast-3": 12.893, + "ap-south-1": 12.461, + "ap-south-2": 12.461, + "ap-southeast-1": 13.133, + "ap-southeast-2": 13.133, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 11.832, + "ap-southeast-7": 11.832, + "ca-central-1": 12.125, + "ca-west-1": 12.125, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 11.501, + "eu-south-1": 12.711, + "eu-south-2": 12.125, + "eu-west-1": 12.125, + "eu-west-2": 12.749, + "eu-west-3": 12.749, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 13.267, + "mx-central-1": 11.515, + "sa-east-1": 17.405, + "us-east-1": 10.973, + "us-east-2": 10.973, + "us-gov-east-1": 13.229, + "us-gov-west-1": 0.0, + "us-west-1": 12.125, + "us-west-2": 10.973, + "us-west-2-lax-1": 13.143 + }, + "i3en.2xlarge": { + "af-south-1": 1.313, + "ap-east-1": 1.396, + "ap-northeast-1": 1.189, + "ap-northeast-2": 1.258, + "ap-northeast-3": 0.0, + "ap-south-1": 1.153, + "ap-south-2": 0.0, + "ap-southeast-1": 1.209, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.209, + "ap-southeast-4": 1.28, + "ap-southeast-5": 1.101, + "ap-southeast-7": 1.101, + "ca-central-1": 1.19, + "ca-west-1": 1.125, + "eu-central-1": 1.205, + "eu-central-2": 1.39, + "eu-north-1": 1.073, + "eu-south-1": 1.174, + "eu-south-2": 1.125, + "eu-west-1": 1.125, + "eu-west-2": 1.177, + "eu-west-3": 1.177, + "il-central-1": 1.175, + "me-central-1": 1.297, + "me-south-1": 1.22, + "mx-central-1": 1.074, + "sa-east-1": 1.659, + "us-east-1": 1.029, + "us-east-2": 1.029, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.217, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 1.21 + }, + "i3en.3xlarge": { + "af-south-1": 1.907, + "ap-east-1": 0.0, + "ap-northeast-1": 1.721, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 1.751, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.857, + "ap-southeast-4": 1.751, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 1.723, + "eu-central-1": 1.745, + "eu-central-2": 1.907, + "eu-north-1": 0.0, + "eu-south-1": 1.801, + "eu-south-2": 1.723, + "eu-west-1": 1.625, + "eu-west-2": 1.806, + "eu-west-3": 1.703, + "il-central-1": 0.0, + "me-central-1": 1.882, + "me-south-1": 1.768, + "mx-central-1": 1.549, + "sa-east-1": 2.285, + "us-east-1": 0.0, + "us-east-2": 1.481, + "us-gov-east-1": 1.869, + "us-gov-west-1": 0.0, + "us-west-1": 1.625, + "us-west-2": 1.481, + "us-west-2-lax-1": 1.752 + }, + "i3en.6xlarge": { + "af-south-1": 0.0, + "ap-east-1": 3.705, + "ap-northeast-1": 3.525, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 3.409, + "ap-south-2": 3.209, + "ap-southeast-1": 3.589, + "ap-southeast-2": 3.589, + "ap-southeast-3": 3.377, + "ap-southeast-4": 3.589, + "ap-southeast-5": 3.052, + "ap-southeast-7": 0.0, + "ca-central-1": 3.125, + "ca-west-1": 3.32, + "eu-central-1": 3.365, + "eu-central-2": 0.0, + "eu-north-1": 3.154, + "eu-south-1": 3.271, + "eu-south-2": 3.125, + "eu-west-1": 3.32, + "eu-west-2": 3.281, + "eu-west-3": 3.281, + "il-central-1": 3.275, + "me-central-1": 3.425, + "me-south-1": 3.411, + "mx-central-1": 2.973, + "sa-east-1": 4.445, + "us-east-1": 2.837, + "us-east-2": 2.837, + "us-gov-east-1": 3.614, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 2.837, + "us-west-2-lax-1": 0.0 + }, + "i3en.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 7.285, + "ap-northeast-1": 6.509, + "ap-northeast-2": 6.924, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 6.293, + "ap-southeast-1": 7.053, + "ap-southeast-2": 6.629, + "ap-southeast-3": 6.629, + "ap-southeast-4": 6.629, + "ap-southeast-5": 6.36, + "ap-southeast-7": 6.36, + "ca-central-1": 6.125, + "ca-west-1": 6.125, + "eu-central-1": 6.605, + "eu-central-2": 0.0, + "eu-north-1": 5.813, + "eu-south-1": 6.418, + "eu-south-2": 6.515, + "eu-west-1": 0.0, + "eu-west-2": 6.437, + "eu-west-3": 6.437, + "il-central-1": 6.425, + "me-central-1": 7.154, + "me-south-1": 6.696, + "mx-central-1": 5.82, + "sa-east-1": 8.765, + "us-east-1": 5.549, + "us-east-2": 5.549, + "us-gov-east-1": 6.677, + "us-gov-west-1": 6.677, + "us-west-1": 0.0, + "us-west-2": 5.549, + "us-west-2-lax-1": 6.634 + }, + "i3en.24xlarge": { + "af-south-1": 14.381, + "ap-east-1": 14.444, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 12.461, + "ap-south-2": 12.461, + "ap-southeast-1": 13.133, + "ap-southeast-2": 13.133, + "ap-southeast-3": 0.0, + "ap-southeast-4": 13.133, + "ap-southeast-5": 11.832, + "ap-southeast-7": 0.0, + "ca-central-1": 12.125, + "ca-west-1": 12.125, + "eu-central-1": 13.085, + "eu-central-2": 14.381, + "eu-north-1": 11.501, + "eu-south-1": 0.0, + "eu-south-2": 12.125, + "eu-west-1": 12.125, + "eu-west-2": 12.749, + "eu-west-3": 12.749, + "il-central-1": 12.725, + "me-central-1": 13.325, + "me-south-1": 13.267, + "mx-central-1": 11.515, + "sa-east-1": 0.0, + "us-east-1": 10.973, + "us-east-2": 0.0, + "us-gov-east-1": 13.229, + "us-gov-west-1": 13.229, + "us-west-1": 0.0, + "us-west-2": 10.973, + "us-west-2-lax-1": 13.143 + }, + "i3p.16xlarge": { + "us-gov-west-1": 6.141 + }, + "i4g.large": { + "ap-southeast-1": 0.24143, + "ca-central-1": 0.2265, + "eu-west-1": 0.0, + "us-east-1": 0.21074, + "us-east-2": 0.21074, + "us-west-2": 0.21074 + }, + "i4g.xlarge": { + "ap-southeast-1": 0.42656, + "ca-central-1": 0.3967, + "eu-west-1": 0.3967, + "us-east-1": 0.36518, + "us-east-2": 0.36518, + "us-west-2": 0.0 + }, + "i4g.2xlarge": { + "ap-southeast-1": 0.93957, + "ca-central-1": 0.8058, + "eu-west-1": 0.8058, + "us-east-1": 0.74276, + "us-east-2": 0.74276, + "us-west-2": 0.74276 + }, + "i4g.4xlarge": { + "ap-southeast-1": 1.75414, + "ca-central-1": 1.48659, + "eu-west-1": 1.48659, + "us-east-1": 1.48407, + "us-east-2": 1.36052, + "us-west-2": 1.36052 + }, + "i4g.8xlarge": { + "ap-southeast-1": 3.08708, + "ca-central-1": 0.0, + "eu-west-1": 3.12051, + "us-east-1": 2.84314, + "us-east-2": 2.84314, + "us-west-2": 2.59604 + }, + "i4g.16xlarge": { + "ap-southeast-1": 6.04916, + "ca-central-1": 0.0, + "eu-west-1": 5.57137, + "us-east-1": 0.0, + "us-east-2": 5.06708, + "us-west-2": 5.06708 + }, + "i4i.large": { + "af-south-1": 0.0, + "ap-east-1": 0.306, + "ap-northeast-1": 0.258, + "ap-northeast-2": 0.258, + "ap-northeast-3": 0.278, + "ap-south-1": 0.251, + "ap-south-2": 0.27, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.283, + "ap-southeast-4": 0.283, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.26, + "ca-central-1": 0.246, + "ca-west-1": 0.246, + "eu-central-1": 0.261, + "eu-central-2": 0.304, + "eu-north-1": 0.236, + "eu-south-1": 0.275, + "eu-west-1": 0.0, + "eu-west-2": 0.255, + "eu-west-3": 0.255, + "il-central-1": 0.0, + "me-central-1": 0.285, + "me-south-1": 0.285, + "mx-central-1": 0.236, + "sa-east-1": 0.358, + "us-east-1": 0.245, + "us-east-2": 0.245, + "us-gov-east-1": 0.263, + "us-gov-west-1": 0.263, + "us-west-1": 0.264, + "us-west-2": 0.0 + }, + "i4i.xlarge": { + "af-south-1": 0.507, + "ap-east-1": 0.51, + "ap-northeast-1": 0.459, + "ap-northeast-2": 0.459, + "ap-northeast-3": 0.459, + "ap-south-1": 0.0, + "ap-south-2": 0.485, + "ap-southeast-1": 0.468, + "ap-southeast-2": 0.468, + "ap-southeast-3": 0.468, + "ap-southeast-4": 0.468, + "ap-southeast-5": 0.427, + "ap-southeast-7": 0.427, + "ca-central-1": 0.0, + "ca-west-1": 0.473, + "eu-central-1": 0.0, + "eu-central-2": 0.506, + "eu-north-1": 0.451, + "eu-south-1": 0.455, + "eu-west-1": 0.435, + "eu-west-2": 0.494, + "eu-west-3": 0.455, + "il-central-1": 0.454, + "me-central-1": 0.472, + "me-south-1": 0.472, + "mx-central-1": 0.453, + "sa-east-1": 0.604, + "us-east-1": 0.4, + "us-east-2": 0.434, + "us-gov-east-1": 0.511, + "us-gov-west-1": 0.47, + "us-west-1": 0.435, + "us-west-2": 0.434 + }, + "i4i.metal": { + "af-south-1": 14.557, + "ap-east-1": 14.627, + "ap-northeast-1": 13.008, + "ap-northeast-2": 13.008, + "ap-northeast-3": 13.008, + "ap-south-1": 12.586, + "ap-south-2": 12.586, + "ap-southeast-1": 13.29, + "ap-southeast-2": 13.29, + "ap-southeast-3": 13.29, + "ap-southeast-4": 0.0, + "ap-southeast-5": 11.973, + "ap-southeast-7": 0.0, + "ca-central-1": 12.234, + "ca-west-1": 12.234, + "eu-central-1": 13.219, + "eu-central-2": 14.529, + "eu-north-1": 11.6, + "eu-south-1": 12.867, + "eu-west-1": 12.234, + "eu-west-2": 12.867, + "eu-west-3": 12.867, + "il-central-1": 12.839, + "me-central-1": 0.0, + "me-south-1": 13.431, + "mx-central-1": 11.657, + "sa-east-1": 17.655, + "us-east-1": 11.107, + "us-east-2": 11.107, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 11.107 + }, + "i4i.2xlarge": { + "af-south-1": 1.027, + "ap-east-1": 1.122, + "ap-northeast-1": 0.93, + "ap-northeast-2": 0.93, + "ap-northeast-3": 0.93, + "ap-south-1": 0.0, + "ap-south-2": 0.982, + "ap-southeast-1": 0.948, + "ap-southeast-2": 0.948, + "ap-southeast-3": 0.948, + "ap-southeast-4": 0.948, + "ap-southeast-5": 0.94, + "ap-southeast-7": 0.866, + "ca-central-1": 0.882, + "ca-west-1": 0.882, + "eu-central-1": 0.943, + "eu-central-2": 1.115, + "eu-north-1": 0.842, + "eu-south-1": 0.921, + "eu-west-1": 0.882, + "eu-west-2": 0.0, + "eu-west-3": 0.921, + "il-central-1": 0.0, + "me-central-1": 1.04, + "me-south-1": 0.957, + "mx-central-1": 0.918, + "sa-east-1": 1.221, + "us-east-1": 0.811, + "us-east-2": 0.811, + "us-gov-east-1": 0.952, + "us-gov-west-1": 1.035, + "us-west-1": 0.882, + "us-west-2": 0.0 + }, + "i4i.4xlarge": { + "af-south-1": 2.109, + "ap-east-1": 0.0, + "ap-northeast-1": 1.896, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.735, + "ap-south-1": 1.683, + "ap-south-2": 1.683, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.771, + "ap-southeast-4": 1.935, + "ap-southeast-5": 1.606, + "ap-southeast-7": 1.606, + "ca-central-1": 1.79, + "ca-west-1": 1.79, + "eu-central-1": 1.925, + "eu-central-2": 2.106, + "eu-north-1": 1.559, + "eu-south-1": 1.877, + "eu-west-1": 0.0, + "eu-west-2": 1.718, + "eu-west-3": 1.718, + "il-central-1": 1.714, + "me-central-1": 1.788, + "me-south-1": 1.788, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 1.498, + "us-east-2": 1.498, + "us-gov-east-1": 1.945, + "us-gov-west-1": 1.779, + "us-west-1": 1.79, + "us-west-2": 1.635 + }, + "i4i.8xlarge": { + "af-south-1": 3.733, + "ap-east-1": 3.751, + "ap-northeast-1": 3.668, + "ap-northeast-2": 3.346, + "ap-northeast-3": 3.668, + "ap-south-1": 0.0, + "ap-south-2": 3.552, + "ap-southeast-1": 3.416, + "ap-southeast-2": 0.0, + "ap-southeast-3": 3.416, + "ap-southeast-4": 3.416, + "ap-southeast-5": 3.087, + "ap-southeast-7": 3.383, + "ca-central-1": 3.152, + "ca-west-1": 3.152, + "eu-central-1": 3.399, + "eu-central-2": 3.726, + "eu-north-1": 0.0, + "eu-south-1": 3.629, + "eu-west-1": 3.152, + "eu-west-2": 3.311, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 3.451, + "me-south-1": 3.451, + "mx-central-1": 0.0, + "sa-east-1": 4.507, + "us-east-1": 2.871, + "us-east-2": 3.145, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.765, + "us-west-1": 3.152, + "us-west-2": 2.871 + }, + "i4i.12xlarge": { + "af-south-1": 5.537, + "ap-east-1": 5.563, + "ap-northeast-1": 4.956, + "ap-northeast-2": 0.0, + "ap-northeast-3": 5.439, + "ap-south-1": 0.0, + "ap-south-2": 4.798, + "ap-southeast-1": 5.062, + "ap-southeast-2": 5.062, + "ap-southeast-3": 5.062, + "ap-southeast-4": 0.0, + "ap-southeast-5": 5.012, + "ap-southeast-7": 4.568, + "ca-central-1": 5.12, + "ca-west-1": 0.0, + "eu-central-1": 5.035, + "eu-central-2": 5.526, + "eu-north-1": 4.428, + "eu-south-1": 4.903, + "eu-west-1": 4.666, + "eu-west-2": 4.903, + "eu-west-3": 4.903, + "me-central-1": 0.0, + "me-south-1": 5.614, + "mx-central-1": 4.449, + "sa-east-1": 0.0, + "us-east-1": 4.655, + "us-east-2": 0.0, + "us-gov-east-1": 5.088, + "us-gov-west-1": 5.585, + "us-west-1": 4.666, + "us-west-2": 4.243 + }, + "i4i.16xlarge": { + "af-south-1": 7.341, + "ap-east-1": 7.376, + "ap-northeast-1": 6.567, + "ap-northeast-2": 7.211, + "ap-northeast-3": 7.211, + "ap-south-1": 6.355, + "ap-south-2": 6.355, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 6.707, + "ap-southeast-5": 6.049, + "ap-southeast-7": 6.642, + "ca-central-1": 6.785, + "ca-west-1": 6.785, + "eu-central-1": 6.672, + "eu-central-2": 8.047, + "eu-north-1": 6.436, + "eu-south-1": 7.133, + "eu-west-1": 6.179, + "eu-west-2": 0.0, + "eu-west-3": 6.496, + "il-central-1": 0.0, + "me-central-1": 6.778, + "me-south-1": 6.778, + "mx-central-1": 5.891, + "sa-east-1": 0.0, + "us-east-1": 5.616, + "us-east-2": 0.0, + "us-gov-east-1": 6.743, + "us-gov-west-1": 6.743, + "us-west-1": 0.0, + "us-west-2": 5.616 + }, + "i4i.24xlarge": { + "af-south-1": 10.949, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 9.7874, + "ap-northeast-3": 9.7874, + "ap-south-1": 9.4706, + "ap-south-2": 0.0, + "ap-southeast-1": 9.9986, + "ap-southeast-2": 9.9986, + "ap-southeast-3": 9.9986, + "ap-southeast-4": 9.9986, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 9.2066, + "ca-west-1": 9.2066, + "eu-central-1": 0.0, + "eu-central-2": 12.00817, + "eu-north-1": 8.7314, + "eu-south-1": 10.63748, + "eu-west-1": 10.11476, + "eu-west-2": 9.6818, + "eu-west-3": 9.6818, + "me-central-1": 10.1042, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 13.2722, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 11.04404, + "us-gov-west-1": 10.0514, + "us-west-1": 9.2066, + "us-west-2": 8.3618 + }, + "i4i.32xlarge": { + "af-south-1": 0.0, + "ap-east-1": 14.6274, + "ap-northeast-1": 13.0082, + "ap-northeast-2": 0.0, + "ap-northeast-3": 13.0082, + "ap-south-1": 12.5858, + "ap-south-2": 12.5858, + "ap-southeast-1": 13.2898, + "ap-southeast-2": 13.2898, + "ap-southeast-3": 13.2898, + "ap-southeast-4": 13.2898, + "ap-southeast-5": 11.97332, + "ap-southeast-7": 11.97332, + "ca-central-1": 12.2338, + "ca-west-1": 0.0, + "eu-central-1": 13.2194, + "eu-central-2": 14.52884, + "eu-north-1": 11.6002, + "eu-south-1": 12.8674, + "eu-west-1": 0.0, + "eu-west-2": 12.8674, + "eu-west-3": 12.8674, + "il-central-1": 12.83924, + "me-central-1": 13.4306, + "me-south-1": 13.4306, + "mx-central-1": 0.0, + "sa-east-1": 17.6546, + "us-east-1": 0.0, + "us-east-2": 11.1074, + "us-gov-east-1": 13.3602, + "us-gov-west-1": 0.0, + "us-west-1": 12.2338, + "us-west-2": 0.0 + }, + "i7ie.large": { + "ap-northeast-1": 0.3622, + "eu-central-1": 0.3668, + "eu-west-2": 0.3588, + "us-east-1": 0.0, + "us-east-2": 0.3162, + "us-west-2": 0.3162 + }, + "i7ie.xlarge": { + "ap-northeast-1": 0.6681, + "eu-central-1": 0.6773, + "eu-west-2": 0.6612, + "us-east-1": 0.5761, + "us-east-2": 0.5761, + "us-west-2": 0.5761 + }, + "i7ie.2xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 1.367, + "eu-west-2": 1.4136, + "us-east-1": 0.0, + "us-east-2": 1.232, + "us-west-2": 1.232 + }, + "i7ie.3xlarge": { + "ap-northeast-1": 1.9604, + "eu-central-1": 2.1091, + "eu-west-2": 2.0579, + "us-east-1": 1.6844, + "us-east-2": 1.6844, + "us-west-2": 1.6844 + }, + "i7ie.6xlarge": { + "ap-northeast-1": 3.7958, + "eu-central-1": 4.0933, + "eu-west-2": 3.7544, + "us-east-1": 3.2438, + "us-east-2": 3.4461, + "us-west-2": 3.2438 + }, + "i7ie.12xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 7.577, + "eu-west-2": 7.3838, + "us-east-1": 6.3626, + "us-east-2": 6.7672, + "us-west-2": 0.0 + }, + "i7ie.18xlarge": { + "ap-northeast-1": 11.8534, + "eu-central-1": 12.0298, + "eu-west-2": 0.0, + "us-east-1": 0.0, + "us-east-2": 10.0883, + "us-west-2": 10.0883 + }, + "i7ie.24xlarge": { + "ap-northeast-1": 14.8082, + "eu-central-1": 15.9981, + "eu-west-2": 0.0, + "us-east-1": 13.4094, + "us-east-2": 12.6002, + "us-west-2": 0.0 + }, + "i7ie.48xlarge": { + "ap-northeast-1": 29.4914, + "eu-central-1": 29.933, + "eu-west-2": 31.0507, + "us-east-1": 26.6937, + "us-east-2": 25.0754, + "us-west-2": 0.0 + }, + "i8g.large": { + "eu-central-1": 0.2814, + "us-east-1": 0.2279, + "us-west-2": 0.2279 + }, + "i8g.xlarge": { + "eu-central-1": 0.4655, + "us-east-1": 0.4338, + "us-west-2": 0.3995 + }, + "i8g.metal-24xl": { + "eu-central-1": 10.92788, + "us-east-1": 8.3618, + "us-west-2": 8.3618 + }, + "i8g.2xlarge": { + "eu-central-1": 0.0, + "us-east-1": 0.88, + "us-west-2": 0.8114 + }, + "i8g.4xlarge": { + "eu-central-1": 1.7618, + "us-east-1": 0.0, + "us-west-2": 1.4978 + }, + "i8g.8xlarge": { + "eu-central-1": 3.3986, + "us-east-1": 2.8706, + "us-west-2": 2.8706 + }, + "i8g.12xlarge": { + "eu-central-1": 5.0354, + "us-east-1": 0.0, + "us-west-2": 4.2434 + }, + "i8g.16xlarge": { + "eu-central-1": 6.6722, + "us-east-1": 5.6162, + "us-west-2": 5.6162 + }, + "i8g.24xlarge": { + "eu-central-1": 9.9458, + "us-east-1": 8.3618, + "us-west-2": 8.3618 + }, + "im4gn.large": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.27434, + "ap-southeast-2": 0.29615, + "ca-central-1": 0.27691, + "eu-central-1": 0.27318, + "eu-south-2": 0.27691, + "eu-west-1": 0.25685, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.25639, + "us-west-2": 0.25639 + }, + "im4gn.xlarge": { + "ap-northeast-1": 0.48306, + "ap-southeast-1": 0.49238, + "ap-southeast-2": 0.49238, + "ca-central-1": 0.4574, + "eu-central-1": 0.49005, + "eu-south-2": 0.4574, + "eu-west-1": 0.4574, + "eu-west-2": 0.47839, + "eu-west-3": 0.0, + "us-east-1": 0.42009, + "us-east-2": 0.42009, + "us-west-2": 0.42009 + }, + "im4gn.2xlarge": { + "ap-northeast-1": 1.06386, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.08438, + "ca-central-1": 0.92721, + "eu-central-1": 0.9925, + "eu-south-2": 1.00742, + "eu-west-1": 0.0, + "eu-west-2": 0.96918, + "eu-west-3": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.92534, + "us-west-2": 0.0 + }, + "im4gn.4xlarge": { + "ap-northeast-1": 1.83202, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.86934, + "ca-central-1": 1.72942, + "eu-central-1": 1.86001, + "eu-south-2": 1.88984, + "eu-west-1": 1.72942, + "eu-west-2": 0.0, + "eu-west-3": 1.81337, + "us-east-1": 1.58017, + "us-east-2": 0.0, + "us-west-2": 1.72568 + }, + "im4gn.8xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 3.61367, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 3.59502, + "eu-south-2": 3.65468, + "eu-west-1": 3.65472, + "eu-west-2": 3.50174, + "eu-west-3": 3.50174, + "us-east-1": 3.32637, + "us-east-2": 3.03534, + "us-west-2": 3.03534 + }, + "im4gn.16xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 7.10234, + "ap-southeast-2": 7.10234, + "ca-central-1": 6.54266, + "eu-central-1": 7.06503, + "eu-south-2": 6.5426, + "eu-west-1": 6.54266, + "eu-west-2": 6.87847, + "eu-west-3": 0.0, + "us-east-1": 5.94567, + "us-east-2": 5.94567, + "us-west-2": 0.0 + }, + "inf1.xlarge": { + "af-south-1": 0.358, + "ap-east-1": 0.429, + "ap-northeast-1": 0.364, + "ap-northeast-2": 0.354, + "ap-northeast-3": 0.0, + "ap-south-1": 0.296, + "ap-southeast-1": 0.364, + "ap-southeast-2": 0.342, + "ca-central-1": 0.311, + "eu-central-1": 0.0, + "eu-north-1": 0.299, + "eu-south-1": 0.0, + "eu-west-1": 0.311, + "eu-west-2": 0.324, + "eu-west-3": 0.323, + "me-south-1": 0.0, + "sa-east-1": 0.456, + "us-east-1": 0.284, + "us-east-2": 0.0, + "us-gov-east-1": 0.344, + "us-gov-west-1": 0.344, + "us-west-1": 0.33, + "us-west-2": 0.284 + }, + "inf1.2xlarge": { + "ap-east-1": 0.683, + "ap-northeast-1": 0.614, + "ap-northeast-2": 0.597, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.614, + "ap-southeast-2": 0.0, + "ca-central-1": 0.528, + "eu-central-1": 0.578, + "eu-north-1": 0.51, + "eu-south-1": 0.549, + "eu-west-1": 0.553, + "eu-west-2": 0.574, + "eu-west-3": 0.548, + "me-south-1": 0.597, + "sa-east-1": 0.0, + "us-east-1": 0.487, + "us-east-2": 0.487, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.609, + "us-west-1": 0.56, + "us-west-2": 0.0 + }, + "inf1.6xlarge": { + "ap-east-1": 2.053, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.578, + "ap-northeast-3": 0.0, + "ap-south-1": 1.441, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.6, + "ca-central-1": 1.44, + "eu-central-1": 1.6, + "eu-north-1": 1.379, + "eu-south-1": 1.507, + "eu-west-1": 1.44, + "eu-west-2": 1.59, + "eu-west-3": 1.504, + "me-south-1": 0.0, + "sa-east-1": 2.075, + "us-east-1": 1.305, + "us-east-2": 0.0, + "us-gov-east-1": 1.703, + "us-gov-west-1": 1.613, + "us-west-1": 1.543, + "us-west-2": 0.0 + }, + "inf1.24xlarge": { + "af-south-1": 6.374, + "ap-east-1": 7.836, + "ap-northeast-1": 6.884, + "ap-northeast-2": 5.937, + "ap-northeast-3": 0.0, + "ap-south-1": 5.09, + "ap-southeast-1": 0.0, + "ap-southeast-2": 6.027, + "ca-central-1": 0.0, + "eu-central-1": 6.027, + "eu-north-1": 0.0, + "eu-south-1": 5.655, + "eu-west-1": 5.385, + "eu-west-2": 5.655, + "eu-west-3": 5.642, + "me-south-1": 5.911, + "sa-east-1": 8.393, + "us-east-1": 0.0, + "us-east-2": 4.846, + "us-gov-east-1": 6.078, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "is4gen.medium": { + "ap-northeast-1": 0.22588, + "ap-south-1": 0.22005, + "ap-southeast-1": 0.22906, + "ap-southeast-2": 0.22906, + "ca-central-1": 0.21568, + "eu-central-1": 0.22843, + "eu-west-1": 0.19038, + "eu-west-2": 0.22396, + "eu-west-3": 0.22396, + "us-east-1": 0.17508, + "us-east-2": 0.17508, + "us-west-2": 0.17508 + }, + "is4gen.large": { + "ap-northeast-1": 0.39545, + "ap-south-1": 0.3838, + "ap-southeast-1": 0.40183, + "ap-southeast-2": 0.40183, + "ca-central-1": 0.37505, + "eu-central-1": 0.40055, + "eu-west-1": 0.37505, + "eu-west-2": 0.39163, + "eu-west-3": 0.39163, + "us-east-1": 0.34445, + "us-east-2": 0.34445, + "us-west-2": 0.34445 + }, + "is4gen.xlarge": { + "ap-northeast-1": 0.7346, + "ap-south-1": 0.7113, + "ap-southeast-1": 0.74735, + "ap-southeast-2": 0.74735, + "ca-central-1": 0.6938, + "eu-central-1": 0.7448, + "eu-west-1": 0.6938, + "eu-west-2": 0.72695, + "eu-west-3": 0.72695, + "us-east-1": 0.6326, + "us-east-2": 0.6326, + "us-west-2": 0.6326 + }, + "is4gen.2xlarge": { + "ap-northeast-1": 1.4816, + "ap-south-1": 1.435, + "ap-southeast-1": 1.5071, + "ap-southeast-2": 1.5071, + "ca-central-1": 1.4, + "eu-central-1": 1.502, + "eu-west-1": 1.4, + "eu-west-2": 1.4663, + "eu-west-3": 1.4663, + "us-east-1": 1.2776, + "us-east-2": 1.2776, + "us-west-2": 1.2776 + }, + "is4gen.4xlarge": { + "ap-northeast-1": 2.8382, + "ap-south-1": 2.745, + "ap-southeast-1": 2.88921, + "ap-southeast-2": 2.88921, + "ca-central-1": 2.675, + "eu-central-1": 2.879, + "eu-west-1": 2.675, + "eu-west-2": 2.80761, + "eu-west-3": 2.80761, + "us-east-1": 2.4302, + "us-east-2": 2.4302, + "us-west-2": 2.4302 + }, + "is4gen.8xlarge": { + "ap-northeast-1": 5.5514, + "ap-south-1": 5.365, + "ap-southeast-1": 5.65342, + "ap-southeast-2": 5.65342, + "ca-central-1": 5.225, + "eu-central-1": 5.633, + "eu-west-1": 5.225, + "eu-west-2": 5.49022, + "eu-west-3": 5.49022, + "us-east-1": 4.7354, + "us-east-2": 4.7354, + "us-west-2": 4.7354 + }, + "m1.small": { + "ap-northeast-1": 0.091, + "ap-southeast-1": 0.088, + "ap-southeast-2": 0.088, + "eu-west-1": 0.077, + "sa-east-1": 0.088, + "us-east-1": 0.074, + "us-gov-west-1": 0.083, + "us-west-1": 0.077, + "us-west-2": 0.074 + }, + "m1.medium": { + "ap-northeast-1": 0.222, + "ap-southeast-1": 0.217, + "ap-southeast-2": 0.217, + "eu-west-1": 0.195, + "sa-east-1": 0.217, + "us-east-1": 0.187, + "us-gov-west-1": 0.206, + "us-west-1": 0.195, + "us-west-2": 0.187 + }, + "m1.large": { + "ap-northeast-1": 0.343, + "ap-southeast-1": 0.333, + "ap-southeast-2": 0.333, + "eu-west-1": 0.29, + "sa-east-1": 0.333, + "us-east-1": 0.275, + "us-gov-west-1": 0.311, + "us-west-1": 0.29, + "us-west-2": 0.275 + }, + "m1.xlarge": { + "ap-northeast-1": 0.586, + "ap-southeast-1": 0.567, + "ap-southeast-2": 0.567, + "eu-west-1": 0.479, + "sa-east-1": 0.567, + "us-east-1": 0.45, + "us-gov-west-1": 0.523, + "us-west-1": 0.479, + "us-west-2": 0.45 + }, + "m2.xlarge": { + "ap-northeast-1": 0.387, + "ap-southeast-1": 0.396, + "ap-southeast-2": 0.396, + "eu-west-1": 0.375, + "sa-east-1": 0.423, + "us-east-1": 0.345, + "us-gov-west-1": 0.393, + "us-west-1": 0.375, + "us-west-2": 0.345 + }, + "m2.2xlarge": { + "ap-northeast-1": 0.675, + "ap-southeast-1": 0.692, + "ap-southeast-2": 0.692, + "eu-west-1": 0.65, + "sa-east-1": 0.745, + "us-east-1": 0.59, + "us-gov-west-1": 0.686, + "us-west-1": 0.65, + "us-west-2": 0.59 + }, + "m2.4xlarge": { + "ap-northeast-1": 1.25, + "ap-southeast-1": 1.283, + "ap-southeast-2": 1.283, + "eu-west-1": 1.2, + "sa-east-1": 1.391, + "us-east-1": 1.08, + "us-gov-west-1": 1.271, + "us-west-1": 1.2, + "us-west-2": 1.08 + }, + "m3.medium": { + "ap-northeast-1": 0.196, + "ap-northeast-2": 0.191, + "ap-southeast-1": 0.208, + "ap-southeast-2": 0.212, + "eu-central-1": 0.179, + "eu-west-1": 0.0, + "sa-east-1": 0.195, + "us-east-1": 0.167, + "us-gov-west-1": 0.184, + "us-west-1": 0.177, + "us-west-2": 0.167 + }, + "m3.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.301685, + "ap-southeast-1": 0.296, + "ap-southeast-2": 0.286, + "eu-central-1": 0.258, + "eu-west-1": 0.271, + "sa-east-1": 0.309, + "us-east-1": 0.256, + "us-gov-west-1": 0.268, + "us-west-1": 0.254, + "us-west-2": 0.256 + }, + "m3.xlarge": { + "ap-northeast-1": 0.534, + "ap-northeast-2": 0.502325, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.472, + "eu-central-1": 0.415, + "eu-west-1": 0.432, + "sa-east-1": 0.481, + "us-east-1": 0.366, + "us-gov-west-1": 0.0, + "us-west-1": 0.408, + "us-west-2": 0.366 + }, + "m3.2xlarge": { + "ap-northeast-1": 0.87, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.884, + "ap-southeast-2": 0.93, + "eu-central-1": 0.732, + "eu-west-1": 0.685, + "sa-east-1": 0.937, + "us-east-1": 0.0, + "us-gov-west-1": 0.839, + "us-west-1": 0.716, + "us-west-2": 0.0 + }, + "m4.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.223, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.2375, + "ap-southeast-2": 0.225, + "ca-central-1": 0.0, + "eu-central-1": 0.22, + "eu-west-1": 0.211, + "eu-west-2": 0.2276, + "sa-east-1": 0.259, + "us-east-1": 0.2, + "us-east-2": 0.2, + "us-gov-west-1": 0.0, + "us-west-1": 0.217, + "us-west-2": 0.21 + }, + "m4.xlarge": { + "ap-northeast-1": 0.358, + "ap-northeast-2": 0.346, + "ap-northeast-3": 0.3838, + "ap-south-1": 0.331, + "ap-southeast-1": 0.35, + "ap-southeast-2": 0.0, + "ca-central-1": 0.322, + "eu-central-1": 0.34, + "eu-west-1": 0.3442, + "eu-west-2": 0.332, + "sa-east-1": 0.418, + "us-east-1": 0.0, + "us-east-2": 0.3, + "us-gov-west-1": 0.0, + "us-west-1": 0.334, + "us-west-2": 0.3 + }, + "m4.2xlarge": { + "ap-northeast-1": 0.616, + "ap-northeast-2": 0.592, + "ap-northeast-3": 0.616, + "ap-south-1": 0.52, + "ap-southeast-1": 0.6, + "ap-southeast-2": 0.6, + "ca-central-1": 0.544, + "eu-central-1": 0.58, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "sa-east-1": 0.736, + "us-east-1": 0.5, + "us-east-2": 0.5, + "us-gov-west-1": 0.604, + "us-west-1": 0.6148, + "us-west-2": 0.5 + }, + "m4.4xlarge": { + "ap-northeast-1": 1.132, + "ap-northeast-2": 1.084, + "ap-northeast-3": 0.0, + "ap-south-1": 0.94, + "ap-southeast-1": 1.1, + "ap-southeast-2": 1.1, + "ca-central-1": 0.988, + "eu-central-1": 1.06, + "eu-west-1": 1.0768, + "eu-west-2": 1.028, + "sa-east-1": 1.372, + "us-east-1": 0.9, + "us-east-2": 0.98, + "us-gov-west-1": 0.0, + "us-west-1": 1.036, + "us-west-2": 0.9 + }, + "m4.10xlarge": { + "ap-northeast-1": 2.68, + "ap-northeast-2": 2.56, + "ap-south-1": 2.2, + "ap-southeast-1": 2.6, + "ap-southeast-2": 2.6, + "ca-central-1": 2.32, + "eu-central-1": 2.5, + "eu-west-1": 2.32, + "eu-west-2": 2.42, + "sa-east-1": 0.0, + "us-east-1": 2.1, + "us-east-2": 2.1, + "us-gov-west-1": 2.62, + "us-west-1": 2.44, + "us-west-2": 2.1 + }, + "m4.16xlarge": { + "ap-northeast-1": 4.228, + "ap-northeast-2": 4.036, + "ap-northeast-3": 4.228, + "ap-south-1": 3.46, + "ap-southeast-1": 4.1, + "ap-southeast-2": 4.1, + "ca-central-1": 3.652, + "eu-central-1": 3.94, + "eu-west-1": 3.652, + "eu-west-2": 3.812, + "sa-east-1": 5.188, + "us-east-1": 3.3, + "us-east-2": 3.3, + "us-gov-west-1": 0.0, + "us-west-1": 3.844, + "us-west-2": 3.3 + }, + "m5.large": { + "af-south-1": 0.183, + "ap-east-1": 0.188, + "ap-northeast-1": 0.18, + "ap-northeast-2": 0.174, + "ap-northeast-3": 0.18, + "ap-south-1": 0.157, + "ap-south-2": 0.0, + "ap-southeast-1": 0.176, + "ap-southeast-2": 0.176, + "ap-southeast-3": 0.176, + "ap-southeast-4": 0.176, + "ca-central-1": 0.163, + "ca-west-1": 0.174, + "eu-central-1": 0.178, + "eu-central-2": 0.183, + "eu-north-1": 0.158, + "eu-south-1": 0.168, + "eu-south-2": 0.163, + "eu-west-1": 0.0, + "eu-west-2": 0.167, + "eu-west-3": 0.175, + "il-central-1": 0.169, + "me-central-1": 0.0, + "me-south-1": 0.174, + "sa-east-1": 0.209, + "us-east-1": 0.152, + "us-east-2": 0.0, + "us-gov-east-1": 0.185, + "us-gov-west-1": 0.177, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.172 + }, + "m5.xlarge": { + "af-south-1": 0.31, + "ap-east-1": 0.32, + "ap-northeast-1": 0.304, + "ap-northeast-2": 0.292, + "ap-northeast-3": 0.319, + "ap-south-1": 0.258, + "ap-south-2": 0.258, + "ap-southeast-1": 0.296, + "ap-southeast-2": 0.296, + "ap-southeast-3": 0.296, + "ap-southeast-4": 0.296, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.286, + "eu-central-2": 0.324, + "eu-north-1": 0.0, + "eu-south-1": 0.294, + "eu-south-2": 0.27, + "eu-west-1": 0.0, + "eu-west-2": 0.278, + "eu-west-3": 0.294, + "il-central-1": 0.0, + "me-central-1": 0.292, + "me-south-1": 0.292, + "sa-east-1": 0.38, + "us-east-1": 0.248, + "us-east-2": 0.0, + "us-gov-east-1": 0.298, + "us-gov-west-1": 0.298, + "us-west-1": 0.28, + "us-west-2": 0.248, + "us-west-2-lax-1": 0.287 + }, + "m5.metal": { + "af-south-1": 0.0, + "ap-east-1": 6.436, + "ap-northeast-1": 6.052, + "ap-northeast-2": 5.764, + "ap-northeast-3": 6.052, + "ap-south-1": 4.948, + "ap-south-2": 0.0, + "ap-southeast-1": 5.86, + "ap-southeast-2": 5.86, + "ap-southeast-3": 5.86, + "ap-southeast-4": 5.885, + "ca-central-1": 5.236, + "ca-west-1": 5.261, + "eu-central-1": 5.62, + "eu-central-2": 6.197, + "eu-north-1": 4.996, + "eu-south-1": 5.476, + "eu-south-2": 5.261, + "eu-west-1": 5.236, + "eu-west-2": 0.0, + "eu-west-3": 5.476, + "il-central-1": 5.518, + "me-central-1": 5.775, + "me-south-1": 5.75, + "sa-east-1": 7.444, + "us-east-1": 4.708, + "us-east-2": 4.708, + "us-gov-east-1": 5.908, + "us-gov-west-1": 5.908, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 5.63 + }, + "m5.2xlarge": { + "af-south-1": 0.608, + "ap-east-1": 0.628, + "ap-northeast-1": 0.596, + "ap-northeast-2": 0.572, + "ap-northeast-3": 0.596, + "ap-south-1": 0.504, + "ap-south-2": 0.553, + "ap-southeast-1": 0.58, + "ap-southeast-2": 0.612, + "ap-southeast-3": 0.609, + "ap-southeast-4": 0.605, + "ca-central-1": 0.528, + "ca-west-1": 0.0, + "eu-central-1": 0.56, + "eu-central-2": 0.631, + "eu-north-1": 0.535, + "eu-south-1": 0.575, + "eu-south-2": 0.553, + "eu-west-1": 0.528, + "eu-west-2": 0.574, + "eu-west-3": 0.578, + "il-central-1": 0.574, + "me-central-1": 0.596, + "me-south-1": 0.571, + "sa-east-1": 0.712, + "us-east-1": 0.484, + "us-east-2": 0.0, + "us-gov-east-1": 0.616, + "us-gov-west-1": 0.0, + "us-west-1": 0.548, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.561 + }, + "m5.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.221, + "ap-northeast-1": 1.092, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.092, + "ap-south-1": 0.908, + "ap-south-2": 0.981, + "ap-southeast-1": 1.06, + "ap-southeast-2": 1.123, + "ap-southeast-3": 1.06, + "ap-southeast-4": 1.085, + "ca-central-1": 0.0, + "ca-west-1": 0.981, + "eu-central-1": 0.0, + "eu-central-2": 1.137, + "eu-north-1": 0.916, + "eu-south-1": 0.996, + "eu-south-2": 1.032, + "eu-west-1": 0.956, + "eu-west-2": 0.988, + "eu-west-3": 0.996, + "il-central-1": 0.0, + "me-central-1": 1.067, + "me-south-1": 0.0, + "sa-east-1": 1.324, + "us-east-1": 0.915, + "us-east-2": 0.868, + "us-gov-east-1": 1.068, + "us-gov-west-1": 1.068, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0 + }, + "m5.8xlarge": { + "af-south-1": 2.132, + "ap-east-1": 2.212, + "ap-northeast-1": 2.084, + "ap-northeast-2": 1.988, + "ap-northeast-3": 2.203, + "ap-south-1": 1.716, + "ap-south-2": 1.741, + "ap-southeast-1": 2.02, + "ap-southeast-2": 0.0, + "ap-southeast-3": 2.135, + "ap-southeast-4": 2.045, + "ca-central-1": 1.915, + "ca-west-1": 2.008, + "eu-central-1": 1.94, + "eu-central-2": 0.0, + "eu-north-1": 1.732, + "eu-south-1": 1.892, + "eu-south-2": 1.94, + "eu-west-1": 1.812, + "eu-west-2": 1.876, + "eu-west-3": 2.012, + "il-central-1": 1.923, + "me-central-1": 2.008, + "me-south-1": 1.983, + "sa-east-1": 2.548, + "us-east-1": 1.636, + "us-east-2": 1.636, + "us-gov-east-1": 2.163, + "us-gov-west-1": 2.036, + "us-west-1": 1.892, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0 + }, + "m5.12xlarge": { + "af-south-1": 3.331, + "ap-east-1": 3.268, + "ap-northeast-1": 3.076, + "ap-northeast-2": 3.1, + "ap-northeast-3": 3.076, + "ap-south-1": 2.524, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.98, + "ap-southeast-3": 3.153, + "ap-southeast-4": 3.005, + "ca-central-1": 2.668, + "ca-west-1": 2.95, + "eu-central-1": 2.86, + "eu-central-2": 3.343, + "eu-north-1": 0.0, + "eu-south-1": 2.788, + "eu-south-2": 2.693, + "eu-west-1": 2.668, + "eu-west-2": 2.942, + "eu-west-3": 2.788, + "il-central-1": 3.091, + "me-central-1": 2.95, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 2.404, + "us-east-2": 2.404, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.004, + "us-west-1": 2.974, + "us-west-2": 2.404, + "us-west-2-lax-1": 0.0 + }, + "m5.16xlarge": { + "af-south-1": 4.164, + "ap-east-1": 4.324, + "ap-northeast-1": 4.068, + "ap-northeast-2": 3.876, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 4.177, + "ap-southeast-2": 3.94, + "ap-southeast-3": 3.94, + "ap-southeast-4": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 3.549, + "eu-central-1": 0.0, + "eu-central-2": 4.173, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 3.549, + "eu-west-1": 3.524, + "eu-west-2": 3.652, + "eu-west-3": 3.924, + "il-central-1": 3.72, + "me-central-1": 0.0, + "me-south-1": 3.866, + "sa-east-1": 5.271, + "us-east-1": 0.0, + "us-east-2": 3.172, + "us-gov-east-1": 4.226, + "us-gov-west-1": 4.226, + "us-west-1": 3.924, + "us-west-2": 3.172, + "us-west-2-lax-1": 3.786 + }, + "m5.24xlarge": { + "af-south-1": 6.196, + "ap-east-1": 6.436, + "ap-northeast-1": 6.052, + "ap-northeast-2": 0.0, + "ap-northeast-3": 6.052, + "ap-south-1": 4.948, + "ap-south-2": 4.973, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.86, + "ap-southeast-3": 5.86, + "ap-southeast-4": 5.885, + "ca-central-1": 5.236, + "ca-west-1": 0.0, + "eu-central-1": 5.62, + "eu-central-2": 6.197, + "eu-north-1": 4.996, + "eu-south-1": 5.476, + "eu-south-2": 5.261, + "eu-west-1": 5.236, + "eu-west-2": 0.0, + "eu-west-3": 5.476, + "il-central-1": 5.518, + "me-central-1": 5.775, + "me-south-1": 0.0, + "sa-east-1": 7.444, + "us-east-1": 4.708, + "us-east-2": 4.708, + "us-gov-east-1": 5.908, + "us-gov-west-1": 5.908, + "us-west-1": 5.476, + "us-west-2": 4.708, + "us-west-2-lax-1": 5.63 + }, + "m5a.large": { + "ap-northeast-1": 0.168, + "ap-northeast-2": 0.162, + "ap-south-1": 0.112, + "ap-southeast-1": 0.164, + "ap-southeast-2": 0.164, + "ca-central-1": 0.152, + "eu-central-1": 0.16, + "eu-south-1": 0.157, + "eu-west-1": 0.152, + "eu-west-2": 0.156, + "eu-west-3": 0.157, + "sa-east-1": 0.194, + "us-east-1": 0.142, + "us-east-2": 0.142, + "us-gov-east-1": 0.165, + "us-gov-west-1": 0.165, + "us-west-1": 0.157, + "us-west-2": 0.142 + }, + "m5a.xlarge": { + "ap-northeast-1": 0.28, + "ap-northeast-2": 0.268, + "ap-south-1": 0.167, + "ap-southeast-1": 0.272, + "ap-southeast-2": 0.272, + "ca-central-1": 0.248, + "eu-central-1": 0.264, + "eu-south-1": 0.258, + "eu-west-1": 0.248, + "eu-west-2": 0.256, + "eu-west-3": 0.258, + "sa-east-1": 0.332, + "us-east-1": 0.228, + "us-east-2": 0.228, + "us-gov-east-1": 0.274, + "us-gov-west-1": 0.274, + "us-west-1": 0.258, + "us-west-2": 0.228 + }, + "m5a.2xlarge": { + "ap-northeast-1": 0.573, + "ap-northeast-2": 0.549, + "ap-south-1": 0.347, + "ap-southeast-1": 0.557, + "ap-southeast-2": 0.557, + "ca-central-1": 0.509, + "eu-central-1": 0.541, + "eu-south-1": 0.529, + "eu-west-1": 0.509, + "eu-west-2": 0.525, + "eu-west-3": 0.529, + "sa-east-1": 0.677, + "us-east-1": 0.469, + "us-east-2": 0.469, + "us-gov-east-1": 0.561, + "us-gov-west-1": 0.561, + "us-west-1": 0.529, + "us-west-2": 0.469 + }, + "m5a.4xlarge": { + "ap-northeast-1": 1.021, + "ap-northeast-2": 0.973, + "ap-south-1": 0.569, + "ap-southeast-1": 0.989, + "ap-southeast-2": 0.989, + "ca-central-1": 0.893, + "eu-central-1": 0.957, + "eu-south-1": 0.933, + "eu-west-1": 0.893, + "eu-west-2": 0.925, + "eu-west-3": 0.933, + "sa-east-1": 1.229, + "us-east-1": 0.813, + "us-east-2": 0.813, + "us-gov-east-1": 0.997, + "us-gov-west-1": 0.997, + "us-west-1": 0.933, + "us-west-2": 0.813 + }, + "m5a.8xlarge": { + "ap-northeast-1": 1.917, + "ap-northeast-2": 1.821, + "ap-south-1": 1.014, + "ap-southeast-1": 1.853, + "ap-southeast-2": 1.853, + "ca-central-1": 1.661, + "eu-central-1": 1.789, + "eu-south-1": 1.741, + "eu-west-1": 1.661, + "eu-west-2": 1.725, + "eu-west-3": 1.741, + "sa-east-1": 2.333, + "us-east-1": 1.501, + "us-east-2": 1.501, + "us-gov-east-1": 1.869, + "us-gov-west-1": 1.869, + "us-west-1": 1.741, + "us-west-2": 1.501 + }, + "m5a.12xlarge": { + "ap-northeast-1": 2.813, + "ap-northeast-2": 2.669, + "ap-south-1": 1.458, + "ap-southeast-1": 2.717, + "ap-southeast-2": 2.717, + "ca-central-1": 2.429, + "eu-central-1": 2.621, + "eu-south-1": 2.549, + "eu-west-1": 2.429, + "eu-west-2": 2.525, + "eu-west-3": 2.549, + "sa-east-1": 3.437, + "us-east-1": 2.189, + "us-east-2": 2.189, + "us-gov-east-1": 2.741, + "us-gov-west-1": 2.741, + "us-west-1": 2.549, + "us-west-2": 2.189 + }, + "m5a.16xlarge": { + "ap-northeast-1": 3.709, + "ap-northeast-2": 3.517, + "ap-south-1": 1.903, + "ap-southeast-1": 3.581, + "ap-southeast-2": 3.581, + "ca-central-1": 3.197, + "eu-central-1": 3.453, + "eu-south-1": 3.357, + "eu-west-1": 3.197, + "eu-west-2": 3.325, + "eu-west-3": 3.357, + "sa-east-1": 4.541, + "us-east-1": 2.877, + "us-east-2": 2.877, + "us-gov-east-1": 3.613, + "us-gov-west-1": 3.613, + "us-west-1": 3.357, + "us-west-2": 2.877 + }, + "m5a.24xlarge": { + "ap-northeast-1": 5.501, + "ap-northeast-2": 5.213, + "ap-south-1": 2.791, + "ap-southeast-1": 5.309, + "ap-southeast-2": 5.309, + "ca-central-1": 4.733, + "eu-central-1": 5.117, + "eu-south-1": 4.973, + "eu-west-1": 4.733, + "eu-west-2": 4.925, + "eu-west-3": 4.973, + "sa-east-1": 6.749, + "us-east-1": 4.253, + "us-east-2": 4.253, + "us-gov-east-1": 5.357, + "us-gov-west-1": 5.357, + "us-west-1": 4.973, + "us-west-2": 4.253 + }, + "m5ad.large": { + "ap-northeast-1": 0.19, + "ap-northeast-2": 0.183, + "ap-south-1": 0.123, + "ap-southeast-1": 0.185, + "ap-southeast-2": 0.186, + "ca-central-1": 0.171, + "eu-central-1": 0.181, + "eu-west-1": 0.171, + "eu-west-2": 0.176, + "eu-west-3": 0.177, + "sa-east-1": 0.221, + "us-east-1": 0.159, + "us-east-2": 0.159, + "us-gov-west-1": 0.187, + "us-west-1": 0.178, + "us-west-2": 0.159 + }, + "m5ad.xlarge": { + "ap-northeast-1": 0.324, + "ap-northeast-2": 0.31, + "ap-south-1": 0.191, + "ap-southeast-1": 0.314, + "ap-southeast-2": 0.316, + "ca-central-1": 0.286, + "eu-central-1": 0.306, + "eu-west-1": 0.286, + "eu-west-2": 0.296, + "eu-west-3": 0.298, + "sa-east-1": 0.386, + "us-east-1": 0.262, + "us-east-2": 0.262, + "us-gov-west-1": 0.318, + "us-west-1": 0.3, + "us-west-2": 0.262 + }, + "m5ad.2xlarge": { + "ap-northeast-1": 0.661, + "ap-northeast-2": 0.633, + "ap-south-1": 0.393, + "ap-southeast-1": 0.641, + "ap-southeast-2": 0.645, + "ca-central-1": 0.585, + "eu-central-1": 0.625, + "eu-west-1": 0.585, + "eu-west-2": 0.605, + "eu-west-3": 0.609, + "sa-east-1": 0.785, + "us-east-1": 0.537, + "us-east-2": 0.537, + "us-gov-west-1": 0.649, + "us-west-1": 0.613, + "us-west-2": 0.537 + }, + "m5ad.4xlarge": { + "ap-northeast-1": 1.197, + "ap-northeast-2": 1.141, + "ap-south-1": 0.662, + "ap-southeast-1": 1.157, + "ap-southeast-2": 1.165, + "ca-central-1": 1.045, + "eu-central-1": 1.125, + "eu-west-1": 1.045, + "eu-west-2": 1.085, + "eu-west-3": 1.093, + "sa-east-1": 1.445, + "us-east-1": 0.949, + "us-east-2": 0.949, + "us-gov-west-1": 1.173, + "us-west-1": 1.101, + "us-west-2": 0.949 + }, + "m5ad.8xlarge": { + "ap-northeast-1": 2.269, + "ap-northeast-2": 2.157, + "ap-south-1": 1.199, + "ap-southeast-1": 2.189, + "ap-southeast-2": 2.205, + "ca-central-1": 1.965, + "eu-central-1": 2.125, + "eu-west-1": 1.965, + "eu-west-2": 2.045, + "eu-west-3": 2.061, + "sa-east-1": 2.765, + "us-east-1": 1.773, + "us-east-2": 1.773, + "us-gov-west-1": 2.221, + "us-west-1": 2.077, + "us-west-2": 1.773 + }, + "m5ad.12xlarge": { + "ap-northeast-1": 3.341, + "ap-northeast-2": 3.173, + "ap-south-1": 1.735, + "ap-southeast-1": 3.221, + "ap-southeast-2": 3.245, + "ca-central-1": 2.885, + "eu-central-1": 3.125, + "eu-west-1": 2.885, + "eu-west-2": 3.005, + "eu-west-3": 3.029, + "sa-east-1": 4.085, + "us-east-1": 2.597, + "us-east-2": 2.597, + "us-gov-west-1": 3.269, + "us-west-1": 3.053, + "us-west-2": 2.597 + }, + "m5ad.16xlarge": { + "ap-northeast-1": 4.413, + "ap-northeast-2": 4.189, + "ap-south-1": 2.272, + "ap-southeast-1": 4.253, + "ap-southeast-2": 4.285, + "ca-central-1": 3.805, + "eu-central-1": 4.125, + "eu-west-1": 3.805, + "eu-west-2": 3.965, + "eu-west-3": 3.997, + "sa-east-1": 5.405, + "us-east-1": 3.421, + "us-east-2": 3.421, + "us-gov-west-1": 4.317, + "us-west-1": 4.029, + "us-west-2": 3.421 + }, + "m5ad.24xlarge": { + "ap-northeast-1": 6.557, + "ap-northeast-2": 6.221, + "ap-south-1": 3.346, + "ap-southeast-1": 6.317, + "ap-southeast-2": 6.365, + "ca-central-1": 5.645, + "eu-central-1": 6.125, + "eu-west-1": 5.645, + "eu-west-2": 5.885, + "eu-west-3": 5.933, + "sa-east-1": 8.045, + "us-east-1": 5.069, + "us-east-2": 5.069, + "us-gov-west-1": 6.413, + "us-west-1": 5.981, + "us-west-2": 5.069 + }, + "m5d.large": { + "af-south-1": 0.206, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.202, + "ap-south-1": 0.178, + "ap-south-2": 0.186, + "ap-southeast-1": 0.197, + "ap-southeast-2": 0.207, + "ap-southeast-3": 0.206, + "ap-southeast-4": 0.198, + "ca-central-1": 0.182, + "ca-west-1": 0.182, + "eu-central-1": 0.0, + "eu-central-2": 0.206, + "eu-north-1": 0.176, + "eu-south-1": 0.188, + "eu-south-2": 0.182, + "eu-west-1": 0.182, + "eu-west-2": 0.0, + "eu-west-3": 0.188, + "il-central-1": 0.189, + "me-central-1": 0.195, + "me-south-1": 0.195, + "sa-east-1": 0.236, + "us-east-1": 0.169, + "us-east-2": 0.169, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.208, + "us-west-1": 0.189, + "us-west-2": 0.169 + }, + "m5d.xlarge": { + "af-south-1": 0.356, + "ap-east-1": 0.366, + "ap-northeast-1": 0.366, + "ap-northeast-2": 0.334, + "ap-northeast-3": 0.348, + "ap-south-1": 0.3, + "ap-south-2": 0.0, + "ap-southeast-1": 0.338, + "ap-southeast-2": 0.34, + "ap-southeast-3": 0.338, + "ap-southeast-4": 0.0, + "ca-central-1": 0.308, + "ca-west-1": 0.308, + "eu-central-1": 0.328, + "eu-central-2": 0.0, + "eu-north-1": 0.311, + "eu-south-1": 0.32, + "eu-south-2": 0.308, + "eu-west-1": 0.323, + "eu-west-2": 0.0, + "eu-west-3": 0.336, + "il-central-1": 0.337, + "me-central-1": 0.334, + "me-south-1": 0.334, + "sa-east-1": 0.0, + "us-east-1": 0.282, + "us-east-2": 0.296, + "us-gov-east-1": 0.342, + "us-gov-west-1": 0.342, + "us-west-1": 0.322, + "us-west-2": 0.282 + }, + "m5d.metal": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 7.108, + "ap-northeast-2": 6.772, + "ap-northeast-3": 7.108, + "ap-south-1": 5.956, + "ap-south-2": 5.981, + "ap-southeast-1": 6.868, + "ap-southeast-2": 6.916, + "ap-southeast-3": 6.868, + "ap-southeast-4": 6.941, + "ca-central-1": 6.148, + "ca-west-1": 6.173, + "eu-central-1": 6.628, + "eu-central-2": 7.306, + "eu-north-1": 5.86, + "eu-south-1": 6.436, + "eu-south-2": 6.173, + "eu-west-1": 0.0, + "eu-west-2": 6.388, + "eu-west-3": 6.436, + "il-central-1": 6.475, + "me-central-1": 6.778, + "me-south-1": 6.753, + "sa-east-1": 0.0, + "us-east-1": 5.524, + "us-east-2": 5.524, + "us-gov-east-1": 6.964, + "us-gov-west-1": 6.964, + "us-west-1": 0.0, + "us-west-2": 5.524 + }, + "m5d.2xlarge": { + "af-south-1": 0.7, + "ap-east-1": 0.0, + "ap-northeast-1": 0.684, + "ap-northeast-2": 0.656, + "ap-northeast-3": 0.684, + "ap-south-1": 0.588, + "ap-south-2": 0.642, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.668, + "ap-southeast-3": 0.664, + "ap-southeast-4": 0.693, + "ca-central-1": 0.604, + "ca-west-1": 0.629, + "eu-central-1": 0.681, + "eu-central-2": 0.723, + "eu-north-1": 0.58, + "eu-south-1": 0.66, + "eu-south-2": 0.629, + "eu-west-1": 0.0, + "eu-west-2": 0.624, + "eu-west-3": 0.0, + "il-central-1": 0.654, + "me-central-1": 0.679, + "me-south-1": 0.654, + "sa-east-1": 0.862, + "us-east-1": 0.0, + "us-east-2": 0.552, + "us-gov-east-1": 0.672, + "us-gov-west-1": 0.672, + "us-west-1": 0.632, + "us-west-2": 0.0 + }, + "m5d.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.416, + "ap-northeast-1": 1.268, + "ap-northeast-2": 1.212, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 1.101, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.236, + "ap-southeast-3": 1.228, + "ap-southeast-4": 1.261, + "ca-central-1": 1.108, + "ca-west-1": 1.133, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 1.06, + "eu-south-1": 1.156, + "eu-south-2": 0.0, + "eu-west-1": 1.176, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 1.183, + "me-central-1": 1.3, + "me-south-1": 1.209, + "sa-east-1": 1.623, + "us-east-1": 1.059, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 1.004 + }, + "m5d.8xlarge": { + "af-south-1": 2.644, + "ap-east-1": 2.58, + "ap-northeast-1": 2.436, + "ap-northeast-2": 2.324, + "ap-northeast-3": 2.576, + "ap-south-1": 2.052, + "ap-south-2": 2.194, + "ap-southeast-1": 2.356, + "ap-southeast-2": 0.0, + "ap-southeast-3": 2.356, + "ap-southeast-4": 2.397, + "ca-central-1": 2.116, + "ca-west-1": 2.262, + "eu-central-1": 2.276, + "eu-central-2": 2.662, + "eu-north-1": 2.02, + "eu-south-1": 2.212, + "eu-south-2": 2.141, + "eu-west-1": 2.251, + "eu-west-2": 2.336, + "eu-west-3": 2.212, + "il-central-1": 2.242, + "me-central-1": 0.0, + "me-south-1": 2.318, + "sa-east-1": 2.98, + "us-east-1": 1.908, + "us-east-2": 1.908, + "us-gov-east-1": 2.388, + "us-gov-west-1": 2.538, + "us-west-1": 2.228, + "us-west-2": 1.908 + }, + "m5d.12xlarge": { + "af-south-1": 3.7, + "ap-east-1": 3.82, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.634, + "ap-northeast-3": 3.814, + "ap-south-1": 3.028, + "ap-south-2": 3.053, + "ap-southeast-1": 3.692, + "ap-southeast-2": 3.508, + "ap-southeast-3": 3.687, + "ap-southeast-4": 3.533, + "ca-central-1": 3.308, + "ca-west-1": 3.149, + "eu-central-1": 0.0, + "eu-central-2": 3.931, + "eu-north-1": 2.98, + "eu-south-1": 3.268, + "eu-south-2": 3.149, + "eu-west-1": 3.124, + "eu-west-2": 3.453, + "eu-west-3": 3.268, + "il-central-1": 0.0, + "me-central-1": 3.451, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 2.976, + "us-east-2": 2.812, + "us-gov-east-1": 3.532, + "us-gov-west-1": 3.532, + "us-west-1": 3.509, + "us-west-2": 2.812 + }, + "m5d.16xlarge": { + "af-south-1": 4.9, + "ap-east-1": 5.06, + "ap-northeast-1": 4.772, + "ap-northeast-2": 4.548, + "ap-northeast-3": 4.772, + "ap-south-1": 4.004, + "ap-south-2": 4.029, + "ap-southeast-1": 4.612, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 4.942, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 4.452, + "eu-central-2": 4.912, + "eu-north-1": 3.94, + "eu-south-1": 4.324, + "eu-south-2": 4.157, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 4.324, + "il-central-1": 4.613, + "me-central-1": 4.56, + "me-south-1": 0.0, + "sa-east-1": 6.192, + "us-east-1": 3.716, + "us-east-2": 3.716, + "us-gov-east-1": 4.676, + "us-gov-west-1": 4.676, + "us-west-1": 4.356, + "us-west-2": 3.716 + }, + "m5d.24xlarge": { + "af-south-1": 7.3, + "ap-east-1": 7.54, + "ap-northeast-1": 7.108, + "ap-northeast-2": 0.0, + "ap-northeast-3": 7.108, + "ap-south-1": 5.956, + "ap-south-2": 5.981, + "ap-southeast-1": 6.868, + "ap-southeast-2": 6.916, + "ap-southeast-3": 6.868, + "ap-southeast-4": 6.941, + "ca-central-1": 6.148, + "ca-west-1": 6.173, + "eu-central-1": 6.628, + "eu-central-2": 7.306, + "eu-north-1": 5.86, + "eu-south-1": 6.436, + "eu-south-2": 6.173, + "eu-west-1": 6.148, + "eu-west-2": 6.388, + "eu-west-3": 6.436, + "il-central-1": 6.475, + "me-central-1": 6.778, + "me-south-1": 6.753, + "sa-east-1": 8.74, + "us-east-1": 5.524, + "us-east-2": 5.524, + "us-gov-east-1": 6.964, + "us-gov-west-1": 6.964, + "us-west-1": 6.484, + "us-west-2": 5.524 + }, + "m5dn.large": { + "ap-northeast-1": 0.231, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.227, + "us-gov-west-1": 0.227, + "us-west-2": 0.0 + }, + "m5dn.xlarge": { + "ap-northeast-1": 0.406, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.398, + "us-gov-west-1": 0.398, + "us-west-2": 0.0 + }, + "m5dn.metal": { + "ap-northeast-1": 8.525, + "ap-southeast-1": 8.141, + "eu-central-1": 0.0, + "eu-west-1": 7.421, + "us-east-1": 6.653, + "us-east-2": 6.653, + "us-gov-east-1": 8.333, + "us-gov-west-1": 8.333, + "us-west-2": 6.653 + }, + "m5dn.2xlarge": { + "ap-northeast-1": 0.825, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.809, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "m5dn.4xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 1.493, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "m5dn.8xlarge": { + "ap-northeast-1": 2.925, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 3.025, + "us-gov-west-1": 2.861, + "us-west-2": 0.0 + }, + "m5dn.12xlarge": { + "ap-northeast-1": 4.325, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.229, + "us-west-2": 0.0 + }, + "m5dn.16xlarge": { + "ap-northeast-1": 5.725, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 5.925, + "us-gov-west-1": 5.597, + "us-west-2": 0.0 + }, + "m5dn.24xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 8.333, + "us-gov-west-1": 8.333, + "us-west-2": 0.0 + }, + "m5n.large": { + "ap-northeast-1": 0.218, + "ap-southeast-1": 0.202, + "eu-central-1": 0.0, + "eu-west-1": 0.189, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.205, + "us-west-2": 0.175 + }, + "m5n.xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.348, + "eu-central-1": 0.338, + "eu-west-1": 0.322, + "us-east-1": 0.294, + "us-east-2": 0.0, + "us-gov-east-1": 0.354, + "us-gov-west-1": 0.372, + "us-west-2": 0.294 + }, + "m5n.metal": { + "ap-northeast-1": 7.469, + "ap-southeast-1": 7.133, + "eu-central-1": 0.0, + "eu-west-1": 6.509, + "us-east-1": 5.837, + "us-east-2": 0.0, + "us-gov-east-1": 7.277, + "us-gov-west-1": 7.277, + "us-west-2": 0.0 + }, + "m5n.2xlarge": { + "ap-northeast-1": 0.774, + "ap-southeast-1": 0.709, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "us-east-1": 0.601, + "us-east-2": 0.601, + "us-gov-east-1": 0.721, + "us-gov-west-1": 0.721, + "us-west-2": 0.63 + }, + "m5n.4xlarge": { + "ap-northeast-1": 1.349, + "ap-southeast-1": 1.293, + "eu-central-1": 0.0, + "eu-west-1": 1.189, + "us-east-1": 1.134, + "us-east-2": 1.077, + "us-gov-east-1": 1.389, + "us-gov-west-1": 1.389, + "us-west-2": 1.077 + }, + "m5n.8xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 2.461, + "eu-central-1": 2.381, + "eu-west-1": 0.0, + "us-east-1": 2.029, + "us-east-2": 2.029, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.509, + "us-west-2": 2.029 + }, + "m5n.12xlarge": { + "ap-northeast-1": 3.797, + "ap-southeast-1": 3.629, + "eu-central-1": 3.509, + "eu-west-1": 3.317, + "us-east-1": 0.0, + "us-east-2": 3.152, + "us-gov-east-1": 3.701, + "us-gov-west-1": 3.916, + "us-west-2": 2.981 + }, + "m5n.16xlarge": { + "ap-northeast-1": 5.315, + "ap-southeast-1": 5.077, + "eu-central-1": 4.637, + "eu-west-1": 4.381, + "us-east-1": 3.933, + "us-east-2": 0.0, + "us-gov-east-1": 4.893, + "us-gov-west-1": 4.893, + "us-west-2": 3.933 + }, + "m5n.24xlarge": { + "ap-northeast-1": 7.469, + "ap-southeast-1": 0.0, + "eu-central-1": 6.893, + "eu-west-1": 6.509, + "us-east-1": 5.837, + "us-east-2": 0.0, + "us-gov-east-1": 7.277, + "us-gov-west-1": 7.277, + "us-west-2": 0.0 + }, + "m5zn.large": { + "ap-northeast-1": 0.2697, + "ap-northeast-2": 0.2593, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.2404, + "sa-east-1": 0.3195, + "us-east-1": 0.2215, + "us-east-2": 0.2215, + "us-west-1": 0.2683, + "us-west-2": 0.2215 + }, + "m5zn.xlarge": { + "ap-northeast-1": 0.483, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.5106, + "ap-southeast-2": 0.0, + "eu-central-1": 0.4916, + "eu-west-1": 0.4613, + "sa-east-1": 0.5828, + "us-east-1": 0.3866, + "us-east-2": 0.3866, + "us-west-1": 0.4417, + "us-west-2": 0.3866 + }, + "m5zn.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.997, + "ap-southeast-1": 5.081, + "ap-southeast-2": 0.0, + "eu-central-1": 5.3485, + "eu-west-1": 0.0, + "sa-east-1": 6.4428, + "us-east-1": 4.0891, + "us-east-2": 4.0891, + "us-west-1": 4.7498, + "us-west-2": 4.0891 + }, + "m5zn.2xlarge": { + "ap-northeast-1": 1.0637, + "ap-northeast-2": 0.937, + "ap-southeast-1": 1.0336, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.8614, + "sa-east-1": 1.178, + "us-east-1": 0.0, + "us-east-2": 0.7857, + "us-west-1": 0.8958, + "us-west-2": 0.7857 + }, + "m5zn.3xlarge": { + "ap-northeast-1": 1.4051, + "ap-northeast-2": 1.343, + "ap-southeast-1": 1.4879, + "ap-southeast-2": 1.4879, + "eu-central-1": 0.0, + "eu-west-1": 1.2296, + "sa-east-1": 1.7044, + "us-east-1": 1.116, + "us-east-2": 0.0, + "us-west-1": 1.2812, + "us-west-2": 1.2151 + }, + "m5zn.6xlarge": { + "ap-northeast-1": 2.6852, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 2.7368, + "eu-west-1": 2.3342, + "sa-east-1": 0.0, + "us-east-1": 2.107, + "us-east-2": 2.107, + "us-west-1": 2.4374, + "us-west-2": 2.3052 + }, + "m5zn.12xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.997, + "ap-southeast-1": 5.081, + "ap-southeast-2": 5.081, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "sa-east-1": 6.4428, + "us-east-1": 4.0891, + "us-east-2": 4.4855, + "us-west-1": 5.2123, + "us-west-2": 4.0891 + }, + "m6a.large": { + "ap-northeast-1": 0.1679, + "ap-south-1": 0.11185, + "ap-south-2": 0.11185, + "ap-southeast-1": 0.1643, + "ap-southeast-2": 0.1643, + "ca-central-1": 0.1526, + "eu-central-1": 0.17015, + "eu-south-1": 0.1571, + "eu-west-1": 0.1526, + "eu-west-2": 0.1562, + "eu-west-3": 0.16718, + "sa-east-1": 0.194, + "us-east-1": 0.0, + "us-east-2": 0.15134, + "us-west-1": 0.0, + "us-west-2": 0.1427 + }, + "m6a.xlarge": { + "ap-northeast-1": 0.30182, + "ap-south-1": 0.1674, + "ap-south-2": 0.0, + "ap-southeast-1": 0.2723, + "ap-southeast-2": 0.2723, + "ca-central-1": 0.0, + "eu-central-1": 0.2633, + "eu-south-1": 0.27806, + "eu-west-1": 0.0, + "eu-west-2": 0.2561, + "eu-west-3": 0.2579, + "sa-east-1": 0.3317, + "us-east-1": 0.2291, + "us-east-2": 0.2291, + "us-west-1": 0.2579, + "us-west-2": 0.2291 + }, + "m6a.metal": { + "ap-northeast-1": 0.0, + "ap-south-1": 5.4578, + "ap-south-2": 5.4578, + "ap-southeast-1": 0.0, + "ap-southeast-2": 10.493, + "ca-central-1": 9.3698, + "eu-central-1": 10.061, + "eu-south-1": 9.8018, + "eu-west-1": 9.3698, + "eu-west-2": 9.7154, + "eu-west-3": 9.8018, + "sa-east-1": 0.0, + "us-east-1": 8.4194, + "us-east-2": 8.4194, + "us-west-1": 9.8018, + "us-west-2": 8.4194 + }, + "m6a.2xlarge": { + "ap-northeast-1": 0.61604, + "ap-south-1": 0.3472, + "ap-south-2": 0.3472, + "ap-southeast-1": 0.6002, + "ap-southeast-2": 0.557, + "ca-central-1": 0.54872, + "eu-central-1": 0.539, + "eu-south-1": 0.0, + "eu-west-1": 0.5102, + "eu-west-2": 0.0, + "eu-west-3": 0.5282, + "sa-east-1": 0.6758, + "us-east-1": 0.50516, + "us-east-2": 0.4706, + "us-west-1": 0.56852, + "us-west-2": 0.4706 + }, + "m6a.4xlarge": { + "ap-northeast-1": 1.10708, + "ap-south-1": 0.5694, + "ap-south-2": 0.5694, + "ap-southeast-1": 0.989, + "ap-southeast-2": 0.989, + "ca-central-1": 0.0, + "eu-central-1": 0.953, + "eu-south-1": 0.9314, + "eu-west-1": 0.8954, + "eu-west-2": 0.9242, + "eu-west-3": 1.01204, + "sa-east-1": 1.2266, + "us-east-1": 0.88532, + "us-east-2": 0.8162, + "us-west-1": 0.9314, + "us-west-2": 0.0 + }, + "m6a.8xlarge": { + "ap-northeast-1": 1.9106, + "ap-south-1": 1.0138, + "ap-south-2": 0.0, + "ap-southeast-1": 2.0258, + "ap-southeast-2": 2.0258, + "ca-central-1": 1.6658, + "eu-central-1": 1.781, + "eu-south-1": 1.7378, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 1.89908, + "sa-east-1": 2.3282, + "us-east-1": 1.5074, + "us-east-2": 1.5074, + "us-west-1": 1.89908, + "us-west-2": 1.64564 + }, + "m6a.12xlarge": { + "ap-northeast-1": 3.07124, + "ap-south-1": 0.0, + "ap-south-2": 1.4582, + "ap-southeast-1": 2.9762, + "ap-southeast-2": 2.9762, + "ca-central-1": 2.4362, + "eu-central-1": 2.609, + "eu-south-1": 2.5442, + "eu-west-1": 2.4362, + "eu-west-2": 2.5226, + "eu-west-3": 2.5442, + "sa-east-1": 3.4298, + "us-east-1": 2.40596, + "us-east-2": 2.40596, + "us-west-1": 2.5442, + "us-west-2": 0.0 + }, + "m6a.16xlarge": { + "ap-northeast-1": 3.6962, + "ap-south-1": 1.9026, + "ap-south-2": 0.0, + "ap-southeast-1": 3.581, + "ap-southeast-2": 3.9266, + "ca-central-1": 3.2066, + "eu-central-1": 3.7682, + "eu-south-1": 3.3506, + "eu-west-1": 3.2066, + "eu-west-2": 3.3218, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 2.8898, + "us-east-2": 2.8898, + "us-west-1": 3.3506, + "us-west-2": 0.0 + }, + "m6a.24xlarge": { + "ap-northeast-1": 5.4818, + "ap-south-1": 2.7914, + "ap-south-2": 2.7914, + "ap-southeast-1": 5.309, + "ap-southeast-2": 5.309, + "ca-central-1": 4.7474, + "eu-central-1": 5.5898, + "eu-south-1": 5.44724, + "eu-west-1": 4.7474, + "eu-west-2": 4.9202, + "eu-west-3": 5.44724, + "sa-east-1": 6.7346, + "us-east-1": 4.2722, + "us-east-2": 4.68692, + "us-west-1": 0.0, + "us-west-2": 4.2722 + }, + "m6a.32xlarge": { + "ap-northeast-1": 7.2674, + "ap-south-1": 4.03572, + "ap-south-2": 3.6802, + "ap-southeast-1": 7.7282, + "ap-southeast-2": 7.7282, + "ca-central-1": 6.2882, + "eu-central-1": 7.4114, + "eu-south-1": 6.5762, + "eu-west-1": 6.2882, + "eu-west-2": 7.15796, + "eu-west-3": 6.5762, + "sa-east-1": 8.9378, + "us-east-1": 5.6546, + "us-east-2": 5.6546, + "us-west-1": 7.22132, + "us-west-2": 0.0 + }, + "m6a.48xlarge": { + "ap-northeast-1": 10.8386, + "ap-south-1": 0.0, + "ap-south-2": 5.4578, + "ap-southeast-1": 10.493, + "ap-southeast-2": 0.0, + "ca-central-1": 9.3698, + "eu-central-1": 10.061, + "eu-south-1": 9.8018, + "eu-west-1": 9.3698, + "eu-west-2": 9.7154, + "eu-west-3": 0.0, + "sa-east-1": 13.3442, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 9.8018, + "us-west-2": 8.4194 + }, + "m6g.medium": { + "af-south-1": 0.1071, + "ap-east-1": 0.084, + "ap-northeast-1": 0.0835, + "ap-northeast-2": 0.078, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0563, + "ap-south-2": 0.0831, + "ap-southeast-1": 0.079, + "ap-southeast-2": 0.079, + "ap-southeast-3": 0.1043, + "ap-southeast-4": 0.1072, + "ap-southeast-5": 0.0971, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0738, + "ca-west-1": 0.0991, + "eu-central-1": 0.077, + "eu-central-2": 0.1069, + "eu-north-1": 0.072, + "eu-south-1": 0.0, + "eu-south-2": 0.0993, + "eu-west-1": 0.074, + "eu-west-2": 0.0754, + "eu-west-3": 0.076, + "il-central-1": 0.1015, + "me-central-1": 0.1036, + "me-south-1": 0.078, + "mx-central-1": 0.0, + "sa-east-1": 0.0922, + "us-east-1": 0.0695, + "us-east-2": 0.0695, + "us-gov-east-1": 0.0794, + "us-gov-west-1": 0.0, + "us-west-1": 0.0785, + "us-west-2": 0.0695, + "us-west-2-lax-1": 0.1053 + }, + "m6g.large": { + "af-south-1": 0.1579, + "ap-east-1": 0.1686, + "ap-northeast-1": 0.1553, + "ap-northeast-2": 0.156, + "ap-northeast-3": 0.1555, + "ap-south-1": 0.1069, + "ap-south-2": 0.0, + "ap-southeast-1": 0.1523, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.1523, + "ap-southeast-5": 0.1428, + "ap-southeast-7": 0.1379, + "ca-central-1": 0.1419, + "ca-west-1": 0.1419, + "eu-central-1": 0.1483, + "eu-central-2": 0.0, + "eu-north-1": 0.1383, + "eu-south-1": 0.0, + "eu-south-2": 0.1474, + "eu-west-1": 0.1474, + "eu-west-2": 0.1451, + "eu-west-3": 0.1463, + "il-central-1": 0.1466, + "me-central-1": 0.0, + "me-south-1": 0.1503, + "mx-central-1": 0.0, + "sa-east-1": 0.1787, + "us-east-1": 0.1333, + "us-east-2": 0.1333, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.1531, + "us-west-1": 0.1459, + "us-west-2": 0.1333, + "us-west-2-lax-1": 0.1487 + }, + "m6g.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.2683, + "ap-northeast-1": 0.2663, + "ap-northeast-2": 0.2557, + "ap-northeast-3": 0.2547, + "ap-south-1": 0.1636, + "ap-south-2": 0.1636, + "ap-southeast-1": 0.2483, + "ap-southeast-2": 0.2483, + "ap-southeast-3": 0.2483, + "ap-southeast-4": 0.2598, + "ap-southeast-5": 0.2195, + "ap-southeast-7": 0.0, + "ca-central-1": 0.2275, + "ca-west-1": 0.2378, + "eu-central-1": 0.2403, + "eu-central-2": 0.2587, + "eu-north-1": 0.2203, + "eu-south-1": 0.0, + "eu-south-2": 0.2283, + "eu-west-1": 0.2283, + "eu-west-2": 0.2339, + "eu-west-3": 0.2363, + "il-central-1": 0.2476, + "me-central-1": 0.2455, + "me-south-1": 0.2557, + "mx-central-1": 0.2277, + "sa-east-1": 0.3158, + "us-east-1": 0.2103, + "us-east-2": 0.0, + "us-gov-east-1": 0.2499, + "us-gov-west-1": 0.2499, + "us-west-1": 0.0, + "us-west-2": 0.2195, + "us-west-2-lax-1": 0.2411 + }, + "m6g.metal": { + "af-south-1": 3.3762, + "ap-east-1": 3.517, + "ap-northeast-1": 3.293, + "ap-northeast-2": 3.133, + "ap-northeast-3": 3.4899, + "ap-south-1": 0.0, + "ap-south-2": 1.8414, + "ap-southeast-1": 3.197, + "ap-southeast-2": 3.3813, + "ap-southeast-3": 3.197, + "ap-southeast-4": 3.197, + "ap-southeast-5": 2.7362, + "ap-southeast-7": 2.8929, + "ca-central-1": 2.8642, + "ca-west-1": 2.8642, + "eu-central-1": 3.245, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 2.9922, + "eu-south-2": 2.877, + "eu-west-1": 2.877, + "eu-west-2": 2.9666, + "eu-west-3": 3.005, + "il-central-1": 3.186, + "me-central-1": 3.3317, + "me-south-1": 3.133, + "mx-central-1": 2.7125, + "sa-east-1": 4.0418, + "us-east-1": 0.0, + "us-east-2": 2.589, + "us-gov-east-1": 3.2226, + "us-gov-west-1": 3.2226, + "us-west-1": 0.0, + "us-west-2": 2.589, + "us-west-2-lax-1": 3.2584 + }, + "m6g.2xlarge": { + "af-south-1": 0.5314, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.5456, + "ap-south-1": 0.3274, + "ap-south-2": 0.3395, + "ap-southeast-1": 0.509, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.509, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.471, + "ap-southeast-7": 0.4514, + "ca-central-1": 0.4674, + "ca-west-1": 0.0, + "eu-central-1": 0.493, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.4834, + "eu-south-2": 0.469, + "eu-west-1": 0.469, + "eu-west-2": 0.4802, + "eu-west-3": 0.485, + "il-central-1": 0.4862, + "me-central-1": 0.5034, + "me-south-1": 0.501, + "mx-central-1": 0.4678, + "sa-east-1": 0.6146, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.5122, + "us-gov-west-1": 0.5122, + "us-west-1": 0.4834, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.4946 + }, + "m6g.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.973, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.877, + "ap-northeast-3": 0.9662, + "ap-south-1": 0.5541, + "ap-south-2": 0.5298, + "ap-southeast-1": 0.9391, + "ap-southeast-2": 0.893, + "ap-southeast-3": 0.9391, + "ap-southeast-4": 0.893, + "ap-southeast-5": 0.817, + "ap-southeast-7": 0.7778, + "ca-central-1": 0.8098, + "ca-west-1": 0.8509, + "eu-central-1": 0.861, + "eu-central-2": 0.9346, + "eu-north-1": 0.781, + "eu-south-1": 0.8418, + "eu-south-2": 0.813, + "eu-west-1": 0.813, + "eu-west-2": 0.8354, + "eu-west-3": 0.845, + "il-central-1": 0.8902, + "me-central-1": 0.8818, + "me-south-1": 0.877, + "mx-central-1": 0.7719, + "sa-east-1": 1.1042, + "us-east-1": 0.741, + "us-east-2": 0.0, + "us-gov-east-1": 0.8994, + "us-gov-west-1": 0.8994, + "us-west-1": 0.8418, + "us-west-2": 0.741, + "us-west-2-lax-1": 0.8642 + }, + "m6g.8xlarge": { + "af-south-1": 1.7506, + "ap-east-1": 1.9218, + "ap-northeast-1": 1.709, + "ap-northeast-2": 1.629, + "ap-northeast-3": 1.7122, + "ap-south-1": 0.9346, + "ap-south-2": 0.0, + "ap-southeast-1": 1.661, + "ap-southeast-2": 1.661, + "ap-southeast-3": 1.661, + "ap-southeast-4": 1.661, + "ap-southeast-5": 1.4306, + "ap-southeast-7": 0.0, + "ca-central-1": 1.4946, + "ca-west-1": 0.0, + "eu-central-1": 1.597, + "eu-central-2": 1.7442, + "eu-north-1": 0.0, + "eu-south-1": 1.5586, + "eu-south-2": 0.0, + "eu-west-1": 1.5826, + "eu-west-2": 1.5458, + "eu-west-3": 1.6514, + "il-central-1": 1.5698, + "me-central-1": 1.7284, + "me-south-1": 1.629, + "mx-central-1": 1.4188, + "sa-east-1": 2.0834, + "us-east-1": 1.357, + "us-east-2": 1.357, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.7667, + "us-west-1": 1.6446, + "us-west-2": 1.4306, + "us-west-2-lax-1": 1.6917 + }, + "m6g.12xlarge": { + "af-south-1": 2.5634, + "ap-east-1": 2.669, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 2.5058, + "ap-south-1": 1.3394, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.429, + "ap-southeast-3": 2.5672, + "ap-southeast-4": 2.5672, + "ap-southeast-5": 2.0834, + "ap-southeast-7": 2.0834, + "ca-central-1": 2.1794, + "ca-west-1": 2.1794, + "eu-central-1": 2.333, + "eu-central-2": 2.5538, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 2.3114, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 2.285, + "il-central-1": 2.2922, + "me-central-1": 2.3954, + "me-south-1": 2.5178, + "mx-central-1": 2.0656, + "sa-east-1": 0.0, + "us-east-1": 1.973, + "us-east-2": 1.973, + "us-gov-east-1": 2.4482, + "us-gov-west-1": 0.0, + "us-west-1": 2.4044, + "us-west-2": 1.973, + "us-west-2-lax-1": 2.3426 + }, + "m6g.16xlarge": { + "af-south-1": 3.3762, + "ap-east-1": 3.7186, + "ap-northeast-1": 3.485, + "ap-northeast-2": 3.133, + "ap-northeast-3": 3.2994, + "ap-south-1": 1.7442, + "ap-south-2": 0.0, + "ap-southeast-1": 3.197, + "ap-southeast-2": 3.197, + "ap-southeast-3": 3.197, + "ap-southeast-4": 3.197, + "ap-southeast-5": 2.7362, + "ap-southeast-7": 2.7362, + "ca-central-1": 0.0, + "ca-west-1": 2.8642, + "eu-central-1": 3.245, + "eu-central-2": 3.3634, + "eu-north-1": 0.0, + "eu-south-1": 2.9922, + "eu-south-2": 2.877, + "eu-west-1": 3.0402, + "eu-west-2": 2.9666, + "eu-west-3": 3.005, + "il-central-1": 3.0146, + "me-central-1": 3.3317, + "me-south-1": 3.133, + "mx-central-1": 2.7125, + "sa-east-1": 4.0418, + "us-east-1": 2.589, + "us-east-2": 2.589, + "us-gov-east-1": 3.2226, + "us-gov-west-1": 3.4085, + "us-west-1": 3.1642, + "us-west-2": 0.0, + "us-west-2-lax-1": 3.0818 + }, + "m6gd.medium": { + "af-south-1": 0.0, + "ap-east-1": 0.1183, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1119, + "ap-northeast-3": 0.1147, + "ap-south-1": 0.063, + "ap-south-2": 0.0883, + "ap-southeast-1": 0.0875, + "ap-southeast-2": 0.0914, + "ap-southeast-3": 0.1162, + "ap-southeast-4": 0.1133, + "ap-southeast-5": 0.1072, + "ap-southeast-7": 0.0, + "ca-central-1": 0.1097, + "ca-west-1": 0.1067, + "eu-central-1": 0.0855, + "eu-central-2": 0.1163, + "eu-north-1": 0.1072, + "eu-south-1": 0.0, + "eu-south-2": 0.1067, + "eu-west-1": 0.0844, + "eu-west-2": 0.0834, + "eu-west-3": 0.0, + "il-central-1": 0.1124, + "me-central-1": 0.115, + "me-south-1": 0.0, + "mx-central-1": 0.1066, + "sa-east-1": 0.1283, + "us-east-1": 0.0762, + "us-east-2": 0.0762, + "us-gov-east-1": 0.1169, + "us-gov-west-1": 0.1169, + "us-west-1": 0.084, + "us-west-2": 0.0762 + }, + "m6gd.large": { + "af-south-1": 0.1763, + "ap-east-1": 0.1877, + "ap-northeast-1": 0.1733, + "ap-northeast-2": 0.1675, + "ap-northeast-3": 0.1731, + "ap-south-1": 0.1167, + "ap-south-2": 0.1167, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1693, + "ap-southeast-4": 0.1703, + "ap-southeast-5": 0.1523, + "ap-southeast-7": 0.1523, + "ca-central-1": 0.1571, + "ca-west-1": 0.1631, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.1682, + "eu-south-2": 0.1571, + "eu-west-1": 0.1631, + "eu-west-2": 0.0, + "eu-west-3": 0.1619, + "il-central-1": 0.1685, + "me-central-1": 0.1737, + "me-south-1": 0.1672, + "mx-central-1": 0.1512, + "sa-east-1": 0.2003, + "us-east-1": 0.0, + "us-east-2": 0.1521, + "us-gov-east-1": 0.1707, + "us-gov-west-1": 0.1707, + "us-west-1": 0.0, + "us-west-2": 0.1467 + }, + "m6gd.xlarge": { + "af-south-1": 0.2963, + "ap-east-1": 0.3043, + "ap-northeast-1": 0.2903, + "ap-northeast-2": 0.2787, + "ap-northeast-3": 0.0, + "ap-south-1": 0.1843, + "ap-south-2": 0.1843, + "ap-southeast-1": 0.2823, + "ap-southeast-2": 0.2843, + "ap-southeast-3": 0.2823, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.2599, + "ap-southeast-7": 0.2484, + "ca-central-1": 0.2579, + "ca-west-1": 0.27, + "eu-central-1": 0.2873, + "eu-central-2": 0.2961, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.2579, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.2675, + "il-central-1": 0.0, + "me-central-1": 0.2779, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.3443, + "us-east-1": 0.2371, + "us-east-2": 0.2371, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.2683, + "us-west-2": 0.2371 + }, + "m6gd.metal": { + "af-south-1": 3.965, + "ap-east-1": 0.0, + "ap-northeast-1": 3.869, + "ap-northeast-2": 3.8947, + "ap-northeast-3": 3.8626, + "ap-south-1": 2.0578, + "ap-south-2": 2.0578, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.773, + "ap-southeast-3": 3.741, + "ap-southeast-4": 3.9906, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 3.3506, + "ca-west-1": 0.0, + "eu-central-1": 3.613, + "eu-central-2": 3.9618, + "eu-north-1": 3.197, + "eu-south-1": 3.5042, + "eu-south-2": 3.3506, + "eu-west-1": 3.3506, + "eu-west-2": 0.0, + "eu-west-3": 3.5042, + "il-central-1": 3.7151, + "me-central-1": 3.6706, + "me-south-1": 3.6732, + "mx-central-1": 3.1624, + "sa-east-1": 4.733, + "us-east-1": 3.0178, + "us-east-2": 3.0178, + "us-gov-east-1": 3.7858, + "us-gov-west-1": 4.0054, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6gd.2xlarge": { + "af-south-1": 0.605, + "ap-east-1": 0.621, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.5962, + "ap-northeast-3": 0.5922, + "ap-south-1": 0.3666, + "ap-south-2": 0.3811, + "ap-southeast-1": 0.577, + "ap-southeast-2": 0.581, + "ap-southeast-3": 0.577, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.5092, + "ap-southeast-7": 0.5092, + "ca-central-1": 0.5282, + "ca-west-1": 0.5282, + "eu-central-1": 0.561, + "eu-central-2": 0.6046, + "eu-north-1": 0.509, + "eu-south-1": 0.5474, + "eu-south-2": 0.5282, + "eu-west-1": 0.5524, + "eu-west-2": 0.5442, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 0.5682, + "me-south-1": 0.5685, + "mx-central-1": 0.5047, + "sa-east-1": 0.701, + "us-east-1": 0.4866, + "us-east-2": 0.4866, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.6101, + "us-west-1": 0.5746, + "us-west-2": 0.5083 + }, + "m6gd.4xlarge": { + "af-south-1": 1.085, + "ap-east-1": 1.1765, + "ap-northeast-1": 1.061, + "ap-northeast-2": 1.0146, + "ap-northeast-3": 1.0594, + "ap-south-1": 0.6082, + "ap-south-2": 0.6372, + "ap-southeast-1": 1.029, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.0834, + "ap-southeast-4": 1.0914, + "ap-southeast-5": 0.8933, + "ap-southeast-7": 0.8933, + "ca-central-1": 0.0, + "ca-west-1": 0.9314, + "eu-central-1": 0.0, + "eu-central-2": 1.0842, + "eu-north-1": 0.893, + "eu-south-1": 0.9698, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.9634, + "eu-west-3": 0.9698, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 1.012, + "mx-central-1": 0.8844, + "sa-east-1": 1.3435, + "us-east-1": 0.8482, + "us-east-2": 0.8482, + "us-gov-east-1": 1.0402, + "us-gov-west-1": 0.0, + "us-west-1": 0.973, + "us-west-2": 0.8482 + }, + "m6gd.8xlarge": { + "af-south-1": 2.045, + "ap-east-1": 2.109, + "ap-northeast-1": 1.997, + "ap-northeast-2": 1.9042, + "ap-northeast-3": 0.0, + "ap-south-1": 1.0914, + "ap-south-2": 1.0914, + "ap-southeast-1": 1.933, + "ap-southeast-2": 1.949, + "ap-southeast-3": 1.933, + "ap-southeast-4": 1.949, + "ap-southeast-5": 1.7541, + "ap-southeast-7": 1.6616, + "ca-central-1": 1.7378, + "ca-west-1": 1.7378, + "eu-central-1": 1.869, + "eu-central-2": 2.0434, + "eu-north-1": 1.661, + "eu-south-1": 1.8146, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 1.8146, + "il-central-1": 1.8184, + "me-central-1": 1.8978, + "me-south-1": 1.8991, + "mx-central-1": 1.6437, + "sa-east-1": 2.562, + "us-east-1": 1.6582, + "us-east-2": 1.5714, + "us-gov-east-1": 1.9554, + "us-gov-west-1": 1.9554, + "us-west-1": 1.821, + "us-west-2": 1.6582 + }, + "m6gd.12xlarge": { + "af-south-1": 3.005, + "ap-east-1": 3.101, + "ap-northeast-1": 2.933, + "ap-northeast-2": 2.7938, + "ap-northeast-3": 0.0, + "ap-south-1": 1.5746, + "ap-south-2": 1.5746, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.0242, + "ap-southeast-3": 3.0002, + "ap-southeast-4": 2.861, + "ap-southeast-5": 2.43, + "ap-southeast-7": 2.5687, + "ca-central-1": 2.5442, + "ca-west-1": 2.6894, + "eu-central-1": 2.897, + "eu-central-2": 3.0026, + "eu-north-1": 2.429, + "eu-south-1": 0.0, + "eu-south-2": 2.6894, + "eu-west-1": 2.5442, + "eu-west-2": 2.6402, + "eu-west-3": 2.6594, + "il-central-1": 0.0, + "me-central-1": 2.9438, + "me-south-1": 2.9458, + "mx-central-1": 2.4031, + "sa-east-1": 3.581, + "us-east-1": 0.0, + "us-east-2": 2.4248, + "us-gov-east-1": 3.0353, + "us-gov-west-1": 2.8706, + "us-west-1": 0.0, + "us-west-2": 2.2946 + }, + "m6gd.16xlarge": { + "af-south-1": 3.965, + "ap-east-1": 4.093, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.8626, + "ap-south-1": 0.0, + "ap-south-2": 2.0578, + "ap-southeast-1": 3.741, + "ap-southeast-2": 3.773, + "ap-southeast-3": 3.741, + "ap-southeast-4": 3.773, + "ap-southeast-5": 0.0, + "ap-southeast-7": 3.1983, + "ca-central-1": 3.3506, + "ca-west-1": 3.3506, + "eu-central-1": 3.613, + "eu-central-2": 3.9618, + "eu-north-1": 0.0, + "eu-south-1": 3.5042, + "eu-south-2": 3.3506, + "eu-west-1": 3.3506, + "eu-west-2": 3.4786, + "eu-west-3": 3.5042, + "il-central-1": 3.5119, + "me-central-1": 3.6706, + "me-south-1": 3.6732, + "mx-central-1": 3.3447, + "sa-east-1": 4.733, + "us-east-1": 3.0178, + "us-east-2": 0.0, + "us-gov-east-1": 3.7858, + "us-gov-west-1": 3.7858, + "us-west-1": 3.517, + "us-west-2": 0.0 + }, + "m6i.large": { + "af-south-1": 0.1833, + "ap-east-1": 0.2015, + "ap-northeast-1": 0.1803, + "ap-northeast-2": 0.1743, + "ap-northeast-3": 0.1803, + "ap-south-1": 0.1674, + "ap-south-2": 0.1573, + "ap-southeast-1": 0.1883, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1763, + "ap-southeast-5": 0.1685, + "ap-southeast-7": 0.1583, + "ca-central-1": 0.0, + "ca-west-1": 0.1633, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.1583, + "eu-south-1": 0.1683, + "eu-west-1": 0.1633, + "eu-west-2": 0.0, + "eu-west-3": 0.1683, + "il-central-1": 0.17989, + "me-central-1": 0.0, + "me-south-1": 0.1883, + "mx-central-1": 0.1571, + "sa-east-1": 0.2093, + "us-east-1": 0.1523, + "us-east-2": 0.1523, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.1619 + }, + "m6i.xlarge": { + "af-south-1": 0.3357, + "ap-east-1": 0.3203, + "ap-northeast-1": 0.3043, + "ap-northeast-2": 0.3159, + "ap-northeast-3": 0.3291, + "ap-south-1": 0.2583, + "ap-south-2": 0.2583, + "ap-southeast-1": 0.2963, + "ap-southeast-2": 0.3203, + "ap-southeast-3": 0.2963, + "ap-southeast-5": 0.2603, + "ap-southeast-7": 0.2603, + "ca-central-1": 0.2703, + "ca-west-1": 0.2703, + "eu-central-1": 0.2863, + "eu-central-2": 0.3093, + "eu-north-1": 0.2807, + "eu-south-1": 0.0, + "eu-west-1": 0.2703, + "eu-west-2": 0.0, + "eu-west-3": 0.2803, + "il-central-1": 0.30347, + "me-central-1": 0.0, + "me-south-1": 0.3203, + "mx-central-1": 0.2579, + "sa-east-1": 0.3623, + "us-east-1": 0.0, + "us-east-2": 0.2483, + "us-gov-east-1": 0.2983, + "us-gov-west-1": 0.2983, + "us-west-1": 0.0, + "us-west-2": 0.2675 + }, + "m6i.metal": { + "af-south-1": 8.253, + "ap-east-1": 0.0, + "ap-northeast-1": 8.061, + "ap-northeast-2": 7.677, + "ap-northeast-3": 0.0, + "ap-south-1": 6.589, + "ap-south-2": 6.589, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 7.805, + "ap-southeast-5": 6.653, + "ap-southeast-7": 6.653, + "ca-central-1": 0.0, + "ca-west-1": 6.973, + "eu-central-1": 7.485, + "eu-central-2": 8.221, + "eu-north-1": 6.653, + "eu-south-1": 7.293, + "eu-west-1": 6.973, + "eu-west-2": 7.229, + "eu-west-3": 7.293, + "il-central-1": 0.0, + "me-central-1": 7.6578, + "me-south-1": 8.573, + "mx-central-1": 6.5762, + "sa-east-1": 9.917, + "us-east-1": 6.269, + "us-east-2": 6.269, + "us-gov-east-1": 7.869, + "us-gov-west-1": 7.869, + "us-west-1": 7.293, + "us-west-2": 0.0 + }, + "m6i.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.621, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.6706, + "ap-south-1": 0.529, + "ap-south-2": 0.5694, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.653, + "ap-southeast-3": 0.605, + "ap-southeast-5": 0.533, + "ap-southeast-7": 0.533, + "ca-central-1": 0.553, + "ca-west-1": 0.0, + "eu-central-1": 0.631, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.6178, + "eu-west-1": 0.5958, + "eu-west-2": 0.6134, + "eu-west-3": 0.0, + "il-central-1": 0.5744, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 0.56852, + "sa-east-1": 0.737, + "us-east-1": 0.509, + "us-east-2": 0.509, + "us-gov-east-1": 0.609, + "us-gov-west-1": 0.6574, + "us-west-1": 0.6178, + "us-west-2": 0.5474 + }, + "m6i.4xlarge": { + "af-south-1": 1.2426, + "ap-east-1": 1.181, + "ap-northeast-1": 1.117, + "ap-northeast-2": 1.069, + "ap-northeast-3": 1.2162, + "ap-south-1": 0.933, + "ap-south-2": 0.933, + "ap-southeast-1": 1.181, + "ap-southeast-2": 1.085, + "ap-southeast-3": 1.085, + "ap-southeast-5": 1.0226, + "ap-southeast-7": 0.941, + "ca-central-1": 0.981, + "ca-west-1": 0.981, + "eu-central-1": 1.045, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.981, + "eu-west-2": 1.013, + "eu-west-3": 1.021, + "il-central-1": 1.11368, + "me-central-1": 1.16076, + "me-south-1": 0.0, + "mx-central-1": 0.9314, + "sa-east-1": 1.4714, + "us-east-1": 0.893, + "us-east-2": 0.0, + "us-gov-east-1": 1.093, + "us-gov-west-1": 1.1898, + "us-west-1": 1.021, + "us-west-2": 0.893 + }, + "m6i.8xlarge": { + "af-south-1": 0.0, + "ap-east-1": 2.237, + "ap-northeast-1": 2.109, + "ap-northeast-2": 2.013, + "ap-northeast-3": 2.109, + "ap-south-1": 1.9026, + "ap-south-2": 1.9026, + "ap-southeast-1": 2.045, + "ap-southeast-2": 2.045, + "ap-southeast-3": 2.045, + "ap-southeast-5": 1.757, + "ap-southeast-7": 1.757, + "ca-central-1": 1.837, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 2.149, + "eu-north-1": 1.757, + "eu-south-1": 2.0962, + "eu-west-1": 2.0082, + "eu-west-2": 1.901, + "eu-west-3": 0.0, + "il-central-1": 1.9226, + "me-central-1": 2.0082, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 2.8178, + "us-east-1": 1.8146, + "us-east-2": 0.0, + "us-gov-east-1": 2.061, + "us-gov-west-1": 2.2546, + "us-west-1": 1.917, + "us-west-2": 1.661 + }, + "m6i.12xlarge": { + "af-south-1": 3.4778, + "ap-east-1": 3.6098, + "ap-northeast-1": 3.3986, + "ap-northeast-2": 2.957, + "ap-northeast-3": 3.101, + "ap-south-1": 2.549, + "ap-south-2": 2.549, + "ap-southeast-1": 3.005, + "ap-southeast-2": 3.005, + "ap-southeast-3": 3.005, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.573, + "ca-central-1": 2.9498, + "ca-west-1": 2.693, + "eu-central-1": 2.885, + "eu-central-2": 0.0, + "eu-north-1": 2.8178, + "eu-south-1": 0.0, + "eu-west-1": 2.693, + "eu-west-2": 2.789, + "eu-west-3": 2.813, + "il-central-1": 2.8214, + "me-central-1": 0.0, + "me-south-1": 3.293, + "mx-central-1": 2.5442, + "sa-east-1": 3.797, + "us-east-1": 2.429, + "us-east-2": 2.429, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.029, + "us-west-1": 2.813, + "us-west-2": 2.6594 + }, + "m6i.16xlarge": { + "af-south-1": 4.189, + "ap-east-1": 4.7714, + "ap-northeast-1": 4.093, + "ap-northeast-2": 4.2786, + "ap-northeast-3": 4.093, + "ap-south-1": 3.6802, + "ap-south-2": 3.357, + "ap-southeast-1": 3.965, + "ap-southeast-2": 4.349, + "ap-southeast-3": 3.965, + "ap-southeast-5": 3.389, + "ap-southeast-7": 3.389, + "ca-central-1": 3.549, + "ca-west-1": 3.8914, + "eu-central-1": 0.0, + "eu-central-2": 4.173, + "eu-north-1": 3.389, + "eu-south-1": 3.709, + "eu-west-1": 3.549, + "eu-west-2": 4.0322, + "eu-west-3": 4.0674, + "il-central-1": 0.0, + "me-central-1": 3.8914, + "me-south-1": 4.7714, + "mx-central-1": 0.0, + "sa-east-1": 5.5106, + "us-east-1": 3.197, + "us-east-2": 0.0, + "us-gov-east-1": 3.997, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6i.24xlarge": { + "af-south-1": 6.8306, + "ap-east-1": 7.0946, + "ap-northeast-1": 6.077, + "ap-northeast-2": 5.789, + "ap-northeast-3": 6.077, + "ap-south-1": 4.973, + "ap-south-2": 4.973, + "ap-southeast-1": 5.885, + "ap-southeast-2": 6.461, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 5.7746, + "ca-west-1": 5.7746, + "eu-central-1": 6.197, + "eu-central-2": 6.197, + "eu-north-1": 5.021, + "eu-south-1": 6.0386, + "eu-west-1": 5.261, + "eu-west-2": 5.453, + "eu-west-3": 5.501, + "il-central-1": 5.5178, + "me-central-1": 6.33956, + "me-south-1": 6.461, + "mx-central-1": 5.44724, + "sa-east-1": 7.469, + "us-east-1": 4.733, + "us-east-2": 5.1938, + "us-gov-east-1": 5.933, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 4.733 + }, + "m6i.32xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 8.061, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 6.589, + "ap-south-2": 6.589, + "ap-southeast-1": 7.805, + "ap-southeast-2": 0.0, + "ap-southeast-3": 7.805, + "ap-southeast-5": 6.653, + "ap-southeast-7": 6.653, + "ca-central-1": 6.973, + "ca-west-1": 6.973, + "eu-central-1": 7.485, + "eu-central-2": 8.221, + "eu-north-1": 6.653, + "eu-south-1": 7.293, + "eu-west-1": 6.973, + "eu-west-2": 7.229, + "eu-west-3": 0.0, + "il-central-1": 7.3154, + "me-central-1": 7.6578, + "me-south-1": 0.0, + "mx-central-1": 6.5762, + "sa-east-1": 9.917, + "us-east-1": 6.269, + "us-east-2": 0.0, + "us-gov-east-1": 7.869, + "us-gov-west-1": 7.869, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6id.large": { + "ap-northeast-1": 0.2096, + "ap-northeast-2": 0.0, + "ap-south-1": 0.19721, + "ap-southeast-1": 0.20435, + "ap-southeast-2": 0.2054, + "ap-southeast-5": 0.18214, + "ap-southeast-7": 0.18214, + "ca-central-1": 0.1886, + "ca-west-1": 0.20183, + "eu-central-1": 0.1991, + "eu-central-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "il-central-1": 0.20911, + "mx-central-1": 0.18088, + "sa-east-1": 0.2453, + "us-east-1": 0.0, + "us-east-2": 0.17495, + "us-gov-west-1": 0.22152, + "us-west-2": 0.18682 + }, + "m6id.xlarge": { + "ap-northeast-1": 0.3629, + "ap-northeast-2": 0.37739, + "ap-south-1": 0.0, + "ap-southeast-1": 0.3524, + "ap-southeast-2": 0.3545, + "ap-southeast-5": 0.30798, + "ap-southeast-7": 0.30798, + "ca-central-1": 0.3209, + "ca-west-1": 0.3209, + "eu-central-1": 0.3419, + "eu-central-2": 0.37046, + "eu-west-1": 0.0, + "eu-west-2": 0.3314, + "il-central-1": 0.36192, + "mx-central-1": 0.0, + "sa-east-1": 0.4343, + "us-east-1": 0.2936, + "us-east-2": 0.2936, + "us-gov-west-1": 0.38674, + "us-west-2": 0.2936 + }, + "m6id.metal": { + "ap-northeast-1": 9.9362, + "ap-northeast-2": 9.4658, + "ap-south-1": 8.3234, + "ap-southeast-1": 9.6002, + "ap-southeast-2": 9.6674, + "ap-southeast-5": 0.0, + "ap-southeast-7": 8.17876, + "ca-central-1": 8.5922, + "ca-west-1": 0.0, + "eu-central-1": 9.2642, + "eu-central-2": 10.17812, + "eu-west-1": 8.5922, + "eu-west-2": 8.9282, + "il-central-1": 9.01588, + "mx-central-1": 0.0, + "sa-east-1": 12.221, + "us-east-1": 7.7186, + "us-east-2": 7.7186, + "us-gov-west-1": 9.7378, + "us-west-2": 7.7186 + }, + "m6id.2xlarge": { + "ap-northeast-1": 0.7382, + "ap-northeast-2": 0.7088, + "ap-south-1": 0.6374, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.6787, + "ap-southeast-7": 0.6787, + "ca-central-1": 0.6542, + "ca-west-1": 0.6542, + "eu-central-1": 0.6962, + "eu-central-2": 0.75332, + "eu-west-1": 0.6542, + "eu-west-2": 0.0, + "il-central-1": 0.68068, + "mx-central-1": 0.62332, + "sa-east-1": 0.881, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 0.7258, + "us-west-2": 0.5996 + }, + "m6id.4xlarge": { + "ap-northeast-1": 1.3514, + "ap-northeast-2": 1.2926, + "ap-south-1": 1.1498, + "ap-southeast-1": 1.3094, + "ap-southeast-2": 1.3178, + "ap-southeast-5": 1.13172, + "ap-southeast-7": 1.23239, + "ca-central-1": 1.1834, + "ca-west-1": 0.0, + "eu-central-1": 1.2674, + "eu-central-2": 1.5073, + "eu-west-1": 1.1834, + "eu-west-2": 1.2254, + "il-central-1": 1.23636, + "mx-central-1": 1.12164, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 1.0742, + "us-gov-west-1": 1.3266, + "us-west-2": 1.0742 + }, + "m6id.8xlarge": { + "ap-northeast-1": 2.82308, + "ap-northeast-2": 2.69372, + "ap-south-1": 2.37956, + "ap-southeast-1": 2.4938, + "ap-southeast-2": 2.5106, + "ap-southeast-5": 2.13844, + "ap-southeast-7": 2.13844, + "ca-central-1": 2.2418, + "ca-west-1": 2.2418, + "eu-central-1": 2.4098, + "eu-central-2": 2.63828, + "eu-west-1": 2.2418, + "eu-west-2": 2.3258, + "il-central-1": 2.56999, + "mx-central-1": 2.31761, + "sa-east-1": 3.149, + "us-east-1": 2.0234, + "us-east-2": 2.0234, + "us-gov-west-1": 0.0, + "us-west-2": 2.21324 + }, + "m6id.12xlarge": { + "ap-northeast-1": 3.8042, + "ap-northeast-2": 3.6278, + "ap-south-1": 3.1994, + "ap-southeast-1": 3.6782, + "ap-southeast-2": 3.7034, + "ap-southeast-5": 3.14516, + "ap-southeast-7": 3.14516, + "ca-central-1": 0.0, + "ca-west-1": 3.3002, + "eu-central-1": 3.89492, + "eu-central-2": 3.89492, + "eu-west-1": 3.3002, + "eu-west-2": 3.4262, + "il-central-1": 3.45908, + "mx-central-1": 3.41391, + "sa-east-1": 4.661, + "us-east-1": 3.25736, + "us-east-2": 2.9726, + "us-gov-west-1": 3.7298, + "us-west-2": 2.9726 + }, + "m6id.16xlarge": { + "ap-northeast-1": 5.0306, + "ap-northeast-2": 4.7954, + "ap-south-1": 4.2242, + "ap-southeast-1": 4.8626, + "ap-southeast-2": 4.8962, + "ap-southeast-5": 4.55457, + "ap-southeast-7": 4.55457, + "ca-central-1": 4.3586, + "ca-west-1": 4.78196, + "eu-central-1": 4.6946, + "eu-central-2": 0.0, + "eu-west-1": 4.78196, + "eu-west-2": 4.5266, + "il-central-1": 4.57044, + "mx-central-1": 0.0, + "sa-east-1": 6.7778, + "us-east-1": 3.9218, + "us-east-2": 3.9218, + "us-gov-west-1": 4.9314, + "us-west-2": 4.30148 + }, + "m6id.24xlarge": { + "ap-northeast-1": 7.4834, + "ap-northeast-2": 7.1306, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 6.4754, + "ca-west-1": 6.4754, + "eu-central-1": 6.9794, + "eu-central-2": 7.66484, + "eu-west-1": 0.0, + "eu-west-2": 7.38764, + "il-central-1": 6.79316, + "mx-central-1": 0.0, + "sa-east-1": 10.1042, + "us-east-1": 6.38972, + "us-east-2": 5.8202, + "us-gov-west-1": 0.0, + "us-west-2": 5.8202 + }, + "m6id.32xlarge": { + "ap-northeast-1": 9.9362, + "ap-northeast-2": 9.4658, + "ap-south-1": 8.3234, + "ap-southeast-1": 9.6002, + "ap-southeast-2": 9.6674, + "ap-southeast-5": 8.17876, + "ap-southeast-7": 8.17876, + "ca-central-1": 8.5922, + "ca-west-1": 8.5922, + "eu-central-1": 0.0, + "eu-central-2": 10.17812, + "eu-west-1": 8.5922, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "mx-central-1": 8.09812, + "sa-east-1": 12.221, + "us-east-1": 0.0, + "us-east-2": 7.7186, + "us-gov-west-1": 9.7378, + "us-west-2": 7.7186 + }, + "m6idn.large": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.22595, + "ap-southeast-1": 0.25169, + "ap-southeast-2": 0.25754, + "ca-central-1": 0.23048, + "eu-central-1": 0.24584, + "eu-central-2": 0.26286, + "eu-north-1": 0.2223, + "eu-south-2": 0.2479, + "eu-west-1": 0.25192, + "us-east-1": 0.0, + "us-east-2": 0.21542, + "us-gov-west-1": 0.0, + "us-west-1": 0.23974, + "us-west-2": 0.21542 + }, + "m6idn.xlarge": { + "ap-northeast-1": 0.4658, + "ap-south-1": 0.3956, + "ap-southeast-1": 0.44708, + "ap-southeast-2": 0.49903, + "ca-central-1": 0.4395, + "eu-central-1": 0.43538, + "eu-central-2": 0.46942, + "eu-north-1": 0.4215, + "eu-south-2": 0.4395, + "eu-west-1": 0.44755, + "us-east-1": 0.37454, + "us-east-2": 0.37454, + "us-gov-west-1": 0.45644, + "us-west-1": 0.0, + "us-west-2": 0.40636 + }, + "m6idn.metal": { + "ap-northeast-1": 13.229, + "ap-south-1": 10.9826, + "ap-southeast-1": 12.62996, + "ap-southeast-2": 13.00436, + "ca-central-1": 11.27252, + "eu-central-1": 12.25556, + "eu-central-2": 13.34484, + "eu-north-1": 10.749, + "eu-south-2": 0.0, + "eu-west-1": 11.50676, + "us-east-1": 10.30868, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 11.86516, + "us-west-2": 10.30868 + }, + "m6idn.2xlarge": { + "ap-northeast-1": 0.944, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.92996, + "ca-central-1": 0.82172, + "eu-central-1": 0.95898, + "eu-central-2": 0.95124, + "eu-north-1": 0.8554, + "eu-south-2": 0.89139, + "eu-west-1": 0.83636, + "us-east-1": 0.76148, + "us-east-2": 0.76148, + "us-gov-west-1": 0.92528, + "us-west-1": 0.85876, + "us-west-2": 0.76148 + }, + "m6idn.4xlarge": { + "ap-northeast-1": 1.9268, + "ap-south-1": 0.0, + "ap-southeast-1": 1.84443, + "ap-southeast-2": 1.73492, + "ca-central-1": 1.51844, + "eu-central-1": 1.64132, + "eu-central-2": 1.77748, + "eu-north-1": 1.453, + "eu-south-2": 1.65778, + "eu-west-1": 1.68999, + "us-east-1": 1.39796, + "us-east-2": 1.52526, + "us-gov-west-1": 1.88562, + "us-west-1": 1.73927, + "us-west-2": 1.52526 + }, + "m6idn.8xlarge": { + "ap-northeast-1": 3.7286, + "ap-south-1": 2.8394, + "ap-southeast-1": 3.25124, + "ap-southeast-2": 3.34484, + "ca-central-1": 0.0, + "eu-central-1": 3.4609, + "eu-central-2": 3.42996, + "eu-north-1": 3.0466, + "eu-south-2": 2.91188, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.92551, + "us-gov-west-1": 3.64623, + "us-west-1": 3.06004, + "us-west-2": 2.92551 + }, + "m6idn.12xlarge": { + "ap-northeast-1": 5.5304, + "ap-south-1": 4.1966, + "ap-southeast-1": 4.81436, + "ap-southeast-2": 4.95476, + "ca-central-1": 4.30532, + "eu-central-1": 5.12886, + "eu-central-2": 0.0, + "eu-north-1": 4.109, + "eu-south-2": 4.30532, + "eu-west-1": 4.39316, + "us-east-1": 3.94388, + "us-east-2": 3.94388, + "us-gov-west-1": 4.92668, + "us-west-1": 4.52756, + "us-west-2": 0.0 + }, + "m6idn.16xlarge": { + "ap-northeast-1": 6.677, + "ap-south-1": 6.09668, + "ap-southeast-1": 6.37748, + "ap-southeast-2": 7.20865, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 7.39591, + "eu-north-1": 5.437, + "eu-south-2": 5.69876, + "eu-west-1": 6.38497, + "us-east-1": 5.21684, + "us-east-2": 5.21684, + "us-gov-west-1": 6.52724, + "us-west-1": 5.99508, + "us-west-2": 5.21684 + }, + "m6idn.24xlarge": { + "ap-northeast-1": 9.953, + "ap-south-1": 8.2682, + "ap-southeast-1": 10.44159, + "ap-southeast-2": 9.78452, + "ca-central-1": 9.3217, + "eu-central-1": 0.0, + "eu-central-2": 11.03137, + "eu-north-1": 0.0, + "eu-south-2": 8.48564, + "eu-west-1": 8.66132, + "us-east-1": 7.76276, + "us-east-2": 8.52654, + "us-gov-west-1": 9.72836, + "us-west-1": 8.93012, + "us-west-2": 8.52654 + }, + "m6idn.32xlarge": { + "ap-northeast-1": 13.229, + "ap-south-1": 10.9826, + "ap-southeast-1": 12.62996, + "ap-southeast-2": 13.00436, + "ca-central-1": 0.0, + "eu-central-1": 12.25556, + "eu-central-2": 13.34484, + "eu-north-1": 10.749, + "eu-south-2": 11.27252, + "eu-west-1": 11.50676, + "us-east-1": 10.30868, + "us-east-2": 10.30868, + "us-gov-west-1": 0.0, + "us-west-1": 11.86516, + "us-west-2": 10.30868 + }, + "m6in.large": { + "ap-northeast-1": 0.23531, + "ap-south-1": 0.20138, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.2318, + "ca-central-1": 0.21148, + "eu-central-1": 0.22127, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.21148, + "eu-west-1": 0.21191, + "us-east-1": 0.20945, + "us-east-2": 0.19553, + "us-gov-west-1": 0.24806, + "us-west-1": 0.23498, + "us-west-2": 0.19553 + }, + "m6in.xlarge": { + "ap-northeast-1": 0.41432, + "ap-south-1": 0.0, + "ap-southeast-1": 0.4321, + "ap-southeast-2": 0.4424, + "ca-central-1": 0.3977, + "eu-central-1": 0.38624, + "eu-central-2": 0.42322, + "eu-north-1": 0.3523, + "eu-south-2": 0.36666, + "eu-west-1": 0.36752, + "us-east-1": 0.33476, + "us-east-2": 0.0, + "us-gov-west-1": 0.40496, + "us-west-1": 0.38118, + "us-west-2": 0.33476 + }, + "m6in.metal": { + "ap-northeast-1": 11.58164, + "ap-south-1": 9.41012, + "ap-southeast-1": 11.05748, + "ap-southeast-2": 11.357, + "ca-central-1": 10.05652, + "eu-central-1": 0.0, + "eu-central-2": 11.86644, + "eu-north-1": 9.597, + "eu-south-2": 10.05652, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 11.28212, + "us-west-1": 10.52116, + "us-west-2": 9.03572 + }, + "m6in.2xlarge": { + "ap-northeast-1": 0.84104, + "ap-south-1": 0.70532, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.827, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.85884, + "eu-north-1": 0.717, + "eu-south-2": 0.74572, + "eu-west-1": 0.74744, + "us-east-1": 0.73761, + "us-east-2": 0.73761, + "us-gov-west-1": 0.82232, + "us-west-1": 0.77476, + "us-west-2": 0.68192 + }, + "m6in.4xlarge": { + "ap-northeast-1": 1.55708, + "ap-south-1": 1.28564, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.529, + "ca-central-1": 0.0, + "eu-central-1": 1.57674, + "eu-central-2": 1.73945, + "eu-north-1": 1.309, + "eu-south-2": 1.49058, + "eu-west-1": 1.36988, + "us-east-1": 1.23884, + "us-east-2": 1.23884, + "us-gov-west-1": 0.0, + "us-west-1": 1.42452, + "us-west-2": 1.23884 + }, + "m6in.8xlarge": { + "ap-northeast-1": 2.98916, + "ap-south-1": 2.67841, + "ap-southeast-1": 2.85812, + "ap-southeast-2": 0.0, + "ca-central-1": 2.60788, + "eu-central-1": 2.76452, + "eu-central-2": 3.06036, + "eu-north-1": 2.493, + "eu-south-2": 2.60788, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.35268, + "us-gov-west-1": 2.91428, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6in.12xlarge": { + "ap-northeast-1": 4.42124, + "ap-south-1": 3.95511, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.7582, + "ca-central-1": 0.0, + "eu-central-1": 4.48021, + "eu-central-2": 4.52804, + "eu-north-1": 3.677, + "eu-south-2": 3.84932, + "eu-west-1": 3.85964, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 4.30892, + "us-west-1": 0.0, + "us-west-2": 3.46652 + }, + "m6in.16xlarge": { + "ap-northeast-1": 5.85332, + "ap-south-1": 4.76756, + "ap-southeast-1": 6.13786, + "ap-southeast-2": 6.3026, + "ca-central-1": 5.09076, + "eu-central-1": 5.40404, + "eu-central-2": 5.99572, + "eu-north-1": 4.861, + "eu-south-2": 0.0, + "eu-west-1": 5.10452, + "us-east-1": 5.0259, + "us-east-2": 5.0259, + "us-gov-west-1": 5.70356, + "us-west-1": 5.32308, + "us-west-2": 4.58036 + }, + "m6in.24xlarge": { + "ap-northeast-1": 9.57673, + "ap-south-1": 7.08884, + "ap-southeast-1": 8.32436, + "ap-southeast-2": 8.549, + "ca-central-1": 7.57364, + "eu-central-1": 8.04356, + "eu-central-2": 8.93108, + "eu-north-1": 7.229, + "eu-south-2": 7.57364, + "eu-west-1": 0.0, + "us-east-1": 6.80804, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 7.92212, + "us-west-2": 6.80804 + }, + "m6in.32xlarge": { + "ap-northeast-1": 11.58164, + "ap-south-1": 9.41012, + "ap-southeast-1": 0.0, + "ap-southeast-2": 11.357, + "ca-central-1": 10.05652, + "eu-central-1": 10.68308, + "eu-central-2": 11.86644, + "eu-north-1": 9.597, + "eu-south-2": 10.05652, + "eu-west-1": 10.08404, + "us-east-1": 9.03572, + "us-east-2": 9.03572, + "us-gov-west-1": 11.28212, + "us-west-1": 0.0, + "us-west-2": 9.03572 + }, + "m7a.medium": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.12573, + "eu-north-1": 0.11788, + "eu-south-2": 0.12736, + "eu-west-1": 0.1209, + "us-east-1": 0.11426, + "us-east-2": 0.11426, + "us-west-2": 0.11426 + }, + "m7a.large": { + "ap-northeast-1": 0.221, + "eu-central-1": 0.19516, + "eu-north-1": 0.0, + "eu-south-2": 0.1855, + "eu-west-1": 0.1855, + "us-east-1": 0.17222, + "us-east-2": 0.0, + "us-west-2": 0.17222 + }, + "m7a.xlarge": { + "ap-northeast-1": 0.35576, + "eu-central-1": 0.33402, + "eu-north-1": 0.30262, + "eu-south-2": 0.34054, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.28814, + "us-west-2": 0.28814 + }, + "m7a.metal-48xl": { + "ap-northeast-1": 14.49908, + "eu-central-1": 13.45556, + "eu-north-1": 11.94836, + "eu-south-2": 12.5282, + "eu-west-1": 12.5282, + "us-east-1": 0.0, + "us-east-2": 11.25332, + "us-west-2": 11.25332 + }, + "m7a.2xlarge": { + "ap-northeast-1": 0.72392, + "eu-central-1": 0.68044, + "eu-north-1": 0.0, + "eu-south-2": 0.6418, + "eu-west-1": 0.6418, + "us-east-1": 0.58868, + "us-east-2": 0.58868, + "us-west-2": 0.58868 + }, + "m7a.4xlarge": { + "ap-northeast-1": 1.32284, + "eu-central-1": 1.23588, + "eu-north-1": 0.0, + "eu-south-2": 1.1586, + "eu-west-1": 1.26196, + "us-east-1": 1.05236, + "us-east-2": 1.05236, + "us-west-2": 1.05236 + }, + "m7a.8xlarge": { + "ap-northeast-1": 2.52068, + "eu-central-1": 2.34676, + "eu-north-1": 2.09556, + "eu-south-2": 0.0, + "eu-west-1": 2.39892, + "us-east-1": 2.16519, + "us-east-2": 2.16519, + "us-west-2": 1.97972 + }, + "m7a.12xlarge": { + "ap-northeast-1": 3.71852, + "eu-central-1": 3.7909, + "eu-north-1": 0.0, + "eu-south-2": 3.2258, + "eu-west-1": 3.2258, + "us-east-1": 3.18529, + "us-east-2": 2.90708, + "us-west-2": 2.90708 + }, + "m7a.16xlarge": { + "ap-northeast-1": 4.91636, + "eu-central-1": 4.56852, + "eu-north-1": 0.0, + "eu-south-2": 4.2594, + "eu-west-1": 4.2594, + "us-east-1": 0.0, + "us-east-2": 4.20538, + "us-west-2": 4.20538 + }, + "m7a.24xlarge": { + "ap-northeast-1": 7.31204, + "eu-central-1": 7.45681, + "eu-north-1": 6.03668, + "eu-south-2": 6.3266, + "eu-west-1": 6.94676, + "us-east-1": 5.68916, + "us-east-2": 5.68916, + "us-west-2": 0.0 + }, + "m7a.32xlarge": { + "ap-northeast-1": 9.70772, + "eu-central-1": 0.0, + "eu-north-1": 8.00724, + "eu-south-2": 8.3938, + "eu-west-1": 8.3938, + "us-east-1": 0.0, + "us-east-2": 7.54388, + "us-west-2": 7.54388 + }, + "m7a.48xlarge": { + "ap-northeast-1": 14.49908, + "eu-central-1": 13.45556, + "eu-north-1": 11.94836, + "eu-south-2": 12.5282, + "eu-west-1": 12.5282, + "us-east-1": 11.25332, + "us-east-2": 0.0, + "us-west-2": 11.25332 + }, + "m7g.medium": { + "ap-northeast-1": 0.109, + "ap-northeast-2": 0.1096, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0855, + "ap-south-2": 0.0855, + "ap-southeast-1": 0.1073, + "ap-southeast-2": 0.1073, + "ap-southeast-3": 0.1105, + "ap-southeast-4": 0.1105, + "ap-southeast-5": 0.1024, + "ap-southeast-7": 0.1024, + "ca-central-1": 0.1018, + "eu-central-1": 0.1052, + "eu-north-1": 0.0, + "eu-south-2": 0.1018, + "eu-west-1": 0.1018, + "eu-west-2": 0.0, + "eu-west-3": 0.1039, + "me-central-1": 0.1063, + "me-south-1": 0.1159, + "mx-central-1": 0.0, + "sa-east-1": 0.1213, + "us-east-1": 0.0997, + "us-east-2": 0.0971, + "us-gov-east-1": 0.1109, + "us-west-1": 0.0, + "us-west-2": 0.0971 + }, + "m7g.large": { + "ap-northeast-1": 0.1684, + "ap-northeast-2": 0.1628, + "ap-northeast-3": 0.1617, + "ap-south-1": 0.1183, + "ap-south-2": 0.1146, + "ap-southeast-1": 0.1583, + "ap-southeast-2": 0.1583, + "ap-southeast-3": 0.1583, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.143, + "ap-southeast-7": 0.143, + "ca-central-1": 0.1473, + "eu-central-1": 0.1541, + "eu-north-1": 0.143, + "eu-south-2": 0.1529, + "eu-west-1": 0.1473, + "eu-west-2": 0.1566, + "eu-west-3": 0.1575, + "me-central-1": 0.0, + "me-south-1": 0.1685, + "mx-central-1": 0.142, + "sa-east-1": 0.1864, + "us-east-1": 0.143, + "us-east-2": 0.1379, + "us-gov-east-1": 0.1591, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m7g.xlarge": { + "ap-northeast-1": 0.2671, + "ap-northeast-2": 0.2569, + "ap-northeast-3": 0.2671, + "ap-south-1": 0.1803, + "ap-south-2": 0.1729, + "ap-southeast-1": 0.2603, + "ap-southeast-2": 0.2603, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.2732, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.2297, + "ca-central-1": 0.0, + "eu-central-1": 0.2641, + "eu-north-1": 0.2297, + "eu-south-2": 0.2495, + "eu-west-1": 0.2382, + "eu-west-2": 0.245, + "eu-west-3": 0.0, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 0.2277, + "sa-east-1": 0.3164, + "us-east-1": 0.2195, + "us-east-2": 0.2195, + "us-gov-east-1": 0.2619, + "us-west-1": 0.2587, + "us-west-2": 0.2195 + }, + "m7g.metal": { + "ap-northeast-1": 3.4978, + "ap-northeast-2": 3.3346, + "ap-northeast-3": 3.4978, + "ap-south-1": 1.9912, + "ap-south-2": 1.9912, + "ap-southeast-1": 3.389, + "ap-southeast-2": 3.389, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ap-southeast-5": 2.8994, + "ap-southeast-7": 2.8994, + "ca-central-1": 3.0357, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 3.0338, + "eu-west-1": 3.0354, + "eu-west-2": 3.1445, + "eu-west-3": 3.1714, + "me-central-1": 3.3264, + "me-south-1": 3.7154, + "mx-central-1": 2.8668, + "sa-east-1": 4.2866, + "us-east-1": 2.7362, + "us-east-2": 2.7362, + "us-gov-east-1": 0.0, + "us-west-1": 3.1714, + "us-west-2": 2.7362 + }, + "m7g.2xlarge": { + "ap-northeast-1": 0.5466, + "ap-northeast-2": 0.5512, + "ap-northeast-3": 0.5466, + "ap-south-1": 0.3583, + "ap-south-2": 0.0, + "ap-southeast-1": 0.5587, + "ap-southeast-2": 0.533, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.5587, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 0.4886, + "eu-west-1": 0.4888, + "eu-west-2": 0.0, + "eu-west-3": 0.5297, + "me-central-1": 0.5252, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.6452, + "us-east-1": 0.4514, + "us-east-2": 0.4514, + "us-gov-east-1": 0.5362, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m7g.4xlarge": { + "ap-northeast-1": 0.9682, + "ap-northeast-2": 0.9274, + "ap-northeast-3": 0.9682, + "ap-south-1": 0.5916, + "ap-south-2": 0.5916, + "ap-southeast-1": 0.941, + "ap-southeast-2": 0.941, + "ap-southeast-3": 0.941, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.8186, + "ap-southeast-7": 0.8186, + "ca-central-1": 0.8527, + "eu-central-1": 0.9071, + "eu-north-1": 0.8186, + "eu-south-2": 0.898, + "eu-west-1": 0.8526, + "eu-west-2": 0.9274, + "eu-west-3": 0.9344, + "me-central-1": 0.0, + "me-south-1": 1.0791, + "mx-central-1": 0.0, + "sa-east-1": 1.1654, + "us-east-1": 0.7778, + "us-east-2": 0.7778, + "us-gov-east-1": 0.9992, + "us-west-1": 0.8866, + "us-west-2": 0.7778 + }, + "m7g.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.7298, + "ap-northeast-3": 1.9126, + "ap-south-1": 1.0581, + "ap-south-2": 1.0581, + "ap-southeast-1": 1.757, + "ap-southeast-2": 1.757, + "ap-southeast-3": 1.8598, + "ap-southeast-4": 1.757, + "ap-southeast-5": 1.5122, + "ap-southeast-7": 1.5996, + "ca-central-1": 1.5804, + "eu-central-1": 1.7877, + "eu-north-1": 1.5122, + "eu-south-2": 1.5794, + "eu-west-1": 1.5802, + "eu-west-2": 1.6348, + "eu-west-3": 1.6482, + "me-central-1": 1.7257, + "me-south-1": 1.9202, + "mx-central-1": 1.4959, + "sa-east-1": 2.2058, + "us-east-1": 1.5129, + "us-east-2": 1.4306, + "us-gov-east-1": 1.7698, + "us-west-1": 1.6482, + "us-west-2": 0.0 + }, + "m7g.12xlarge": { + "ap-northeast-1": 2.8142, + "ap-northeast-2": 2.5322, + "ap-northeast-3": 2.6546, + "ap-south-1": 1.6127, + "ap-south-2": 1.5247, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.573, + "ap-southeast-3": 2.573, + "ap-southeast-4": 0.0, + "ap-southeast-5": 2.2058, + "ap-southeast-7": 2.2058, + "ca-central-1": 2.308, + "eu-central-1": 2.6191, + "eu-north-1": 2.2058, + "eu-south-2": 0.0, + "eu-west-1": 2.3078, + "eu-west-2": 2.3896, + "eu-west-3": 2.4098, + "me-central-1": 2.6773, + "me-south-1": 2.8178, + "mx-central-1": 2.1813, + "sa-east-1": 3.2462, + "us-east-1": 2.2068, + "us-east-2": 2.0834, + "us-gov-east-1": 2.7476, + "us-west-1": 2.5533, + "us-west-2": 0.0 + }, + "m7g.16xlarge": { + "ap-northeast-1": 3.4978, + "ap-northeast-2": 3.3346, + "ap-northeast-3": 3.4978, + "ap-south-1": 1.9912, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.389, + "ap-southeast-3": 0.0, + "ap-southeast-4": 3.389, + "ap-southeast-5": 2.8994, + "ap-southeast-7": 2.8994, + "ca-central-1": 3.0357, + "eu-central-1": 3.2533, + "eu-north-1": 2.8994, + "eu-south-2": 3.0338, + "eu-west-1": 3.0354, + "eu-west-2": 0.0, + "eu-west-3": 3.1714, + "me-central-1": 3.3264, + "me-south-1": 3.7154, + "mx-central-1": 2.8668, + "sa-east-1": 0.0, + "us-east-1": 2.7362, + "us-east-2": 2.7362, + "us-gov-east-1": 3.4146, + "us-west-1": 3.1714, + "us-west-2": 2.7362 + }, + "m7gd.medium": { + "ap-northeast-1": 0.1253, + "ap-south-1": 0.0918, + "ap-southeast-1": 0.1229, + "ap-southeast-2": 0.1234, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.1129, + "eu-central-1": 0.1244, + "eu-north-1": 0.0, + "eu-south-2": 0.1158, + "eu-west-1": 0.1194, + "eu-west-3": 0.0, + "mx-central-1": 0.1124, + "sa-east-1": 0.1414, + "us-east-1": 0.1097, + "us-east-2": 0.1097, + "us-west-1": 0.0, + "us-west-2": 0.1097 + }, + "m7gd.large": { + "ap-northeast-1": 0.2025, + "ap-south-1": 0.0, + "ap-southeast-1": 0.1895, + "ap-southeast-2": 0.1905, + "ap-southeast-5": 0.1696, + "ap-southeast-7": 0.1696, + "eu-central-1": 0.1848, + "eu-north-1": 0.1697, + "eu-south-2": 0.1754, + "eu-west-1": 0.1754, + "eu-west-3": 0.181, + "mx-central-1": 0.0, + "sa-east-1": 0.2264, + "us-east-1": 0.1631, + "us-east-2": 0.1695, + "us-west-1": 0.1895, + "us-west-2": 0.1631 + }, + "m7gd.xlarge": { + "ap-northeast-1": 0.3322, + "ap-south-1": 0.1983, + "ap-southeast-1": 0.3228, + "ap-southeast-2": 0.3247, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.2828, + "eu-central-1": 0.3133, + "eu-north-1": 0.2831, + "eu-south-2": 0.3087, + "eu-west-1": 0.2944, + "eu-west-3": 0.3058, + "mx-central-1": 0.294, + "sa-east-1": 0.3965, + "us-east-1": 0.2827, + "us-east-2": 0.2699, + "us-west-1": 0.0, + "us-west-2": 0.2699 + }, + "m7gd.metal": { + "ap-northeast-1": 4.54, + "ap-south-1": 2.397, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.4191, + "ap-southeast-5": 3.7493, + "ap-southeast-7": 3.7493, + "eu-central-1": 4.2376, + "eu-north-1": 3.7538, + "eu-south-2": 3.9352, + "eu-west-1": 3.9352, + "eu-west-3": 4.1167, + "mx-central-1": 3.7128, + "sa-east-1": 5.5682, + "us-east-1": 3.5421, + "us-east-2": 3.5421, + "us-west-1": 4.1469, + "us-west-2": 3.5421 + }, + "m7gd.2xlarge": { + "ap-northeast-1": 0.6769, + "ap-south-1": 0.409, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.694, + "ap-southeast-5": 0.6052, + "ap-southeast-7": 0.578, + "eu-central-1": 0.6699, + "eu-north-1": 0.5786, + "eu-south-2": 0.6013, + "eu-west-1": 0.6013, + "eu-west-3": 0.0, + "mx-central-1": 0.5735, + "sa-east-1": 0.8054, + "us-east-1": 0.5521, + "us-east-2": 0.5778, + "us-west-1": 0.6277, + "us-west-2": 0.5778 + }, + "m7gd.4xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.693, + "ap-southeast-1": 1.191, + "ap-southeast-2": 1.2629, + "ap-southeast-5": 1.0311, + "ap-southeast-7": 1.0854, + "eu-central-1": 1.1532, + "eu-north-1": 1.0866, + "eu-south-2": 1.1347, + "eu-west-1": 0.0, + "eu-west-3": 1.1229, + "mx-central-1": 1.022, + "sa-east-1": 1.5643, + "us-east-1": 0.9793, + "us-east-2": 0.9793, + "us-west-1": 0.0, + "us-west-2": 0.9793 + }, + "m7gd.8xlarge": { + "ap-northeast-1": 2.465, + "ap-south-1": 1.261, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-5": 1.9372, + "ap-southeast-7": 0.0, + "eu-central-1": 2.1813, + "eu-north-1": 1.9394, + "eu-south-2": 2.0301, + "eu-west-1": 2.0301, + "eu-west-3": 2.1208, + "mx-central-1": 1.9189, + "sa-east-1": 2.8466, + "us-east-1": 1.8336, + "us-east-2": 1.8336, + "us-west-1": 2.136, + "us-west-2": 1.8336 + }, + "m7gd.12xlarge": { + "ap-northeast-1": 3.635, + "ap-south-1": 1.829, + "ap-southeast-1": 3.3229, + "ap-southeast-2": 3.3456, + "ap-southeast-5": 2.8432, + "ap-southeast-7": 2.8432, + "eu-central-1": 3.2095, + "eu-north-1": 2.8466, + "eu-south-2": 0.0, + "eu-west-1": 2.9827, + "eu-west-3": 3.1188, + "mx-central-1": 0.0, + "sa-east-1": 4.443, + "us-east-1": 2.6878, + "us-east-2": 2.8416, + "us-west-1": 3.3224, + "us-west-2": 2.6878 + }, + "m7gd.16xlarge": { + "ap-northeast-1": 4.54, + "ap-south-1": 2.397, + "ap-southeast-1": 4.3888, + "ap-southeast-2": 4.4191, + "ap-southeast-5": 0.0, + "ap-southeast-7": 3.7493, + "eu-central-1": 4.2376, + "eu-north-1": 3.7538, + "eu-south-2": 3.9352, + "eu-west-1": 3.9352, + "eu-west-3": 4.1167, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 3.5421, + "us-east-2": 3.5421, + "us-west-1": 4.1469, + "us-west-2": 3.5421 + }, + "m7i.large": { + "ap-northeast-1": 0.1865, + "ap-northeast-2": 0.0, + "ap-south-1": 0.17296, + "ap-southeast-1": 0.1949, + "ap-southeast-2": 0.1823, + "ap-southeast-3": 0.1823, + "ap-southeast-5": 0.1634, + "ap-southeast-7": 0.1634, + "ca-central-1": 0.0, + "eu-central-1": 0.17705, + "eu-north-1": 0.1634, + "eu-south-2": 0.16865, + "eu-west-1": 0.0, + "eu-west-2": 0.17285, + "eu-west-3": 0.1739, + "mx-central-1": 0.16214, + "sa-east-1": 0.0, + "us-east-1": 0.1571, + "us-east-2": 0.1571, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.19606, + "us-west-1": 0.1739, + "us-west-2": 0.0 + }, + "m7i.xlarge": { + "ap-northeast-1": 0.3167, + "ap-northeast-2": 0.32888, + "ap-south-1": 0.28961, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.3083, + "ap-southeast-3": 0.3083, + "ap-southeast-5": 0.29192, + "ap-southeast-7": 0.2705, + "ca-central-1": 0.281, + "eu-central-1": 0.2978, + "eu-north-1": 0.0, + "eu-south-2": 0.281, + "eu-west-1": 0.281, + "eu-west-2": 0.2894, + "eu-west-3": 0.2915, + "mx-central-1": 0.26798, + "sa-east-1": 0.3776, + "us-east-1": 0.2579, + "us-east-2": 0.2579, + "us-gov-east-1": 0.3104, + "us-gov-west-1": 0.3104, + "us-west-1": 0.2915, + "us-west-2": 0.2579 + }, + "m7i.metal-24xl": { + "ap-northeast-1": 6.3746, + "ap-northeast-2": 6.0722, + "ap-south-1": 5.2154, + "ap-southeast-1": 6.7778, + "ap-southeast-2": 6.7778, + "ap-southeast-3": 6.173, + "ap-southeast-5": 5.77988, + "ap-southeast-7": 5.2658, + "ca-central-1": 6.05708, + "eu-central-1": 5.921, + "eu-north-1": 5.2658, + "eu-south-2": 5.5178, + "eu-west-1": 5.5178, + "eu-west-2": 5.7194, + "eu-west-3": 5.7698, + "mx-central-1": 0.0, + "sa-east-1": 7.8362, + "us-east-1": 4.9634, + "us-east-2": 0.0, + "us-gov-east-1": 6.2234, + "us-gov-west-1": 6.2234, + "us-west-1": 5.7698, + "us-west-2": 0.0 + }, + "m7i.metal-48xl": { + "ap-northeast-1": 12.6242, + "ap-northeast-2": 0.0, + "ap-south-1": 10.3058, + "ap-southeast-1": 12.221, + "ap-southeast-2": 12.221, + "ap-southeast-3": 12.221, + "ap-southeast-5": 10.4066, + "ap-southeast-7": 10.4066, + "ca-central-1": 10.9106, + "eu-central-1": 11.717, + "eu-north-1": 0.0, + "eu-south-2": 10.9106, + "eu-west-1": 10.9106, + "eu-west-2": 11.3138, + "eu-west-3": 11.4146, + "mx-central-1": 10.28564, + "sa-east-1": 15.5474, + "us-east-1": 9.8018, + "us-east-2": 9.8018, + "us-gov-east-1": 12.3218, + "us-gov-west-1": 0.0, + "us-west-1": 11.4146, + "us-west-2": 9.8018 + }, + "m7i.2xlarge": { + "ap-northeast-1": 0.69788, + "ap-northeast-2": 0.6206, + "ap-south-1": 0.5492, + "ap-southeast-1": 0.629, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.629, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.608, + "eu-north-1": 0.0, + "eu-south-2": 0.61934, + "eu-west-1": 0.5744, + "eu-west-2": 0.63782, + "eu-west-3": 0.5954, + "mx-central-1": 0.5907, + "sa-east-1": 0.7676, + "us-east-1": 0.5282, + "us-east-2": 0.0, + "us-gov-east-1": 0.6332, + "us-gov-west-1": 0.6332, + "us-west-1": 0.5954, + "us-west-2": 0.5282 + }, + "m7i.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.21532, + "ap-south-1": 0.0, + "ap-southeast-1": 1.133, + "ap-southeast-2": 1.133, + "ap-southeast-3": 1.133, + "ap-southeast-5": 0.9818, + "ap-southeast-7": 0.9818, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.9818, + "eu-south-2": 1.0238, + "eu-west-1": 1.0238, + "eu-west-2": 1.0574, + "eu-west-3": 1.0658, + "mx-central-1": 0.97172, + "sa-east-1": 1.4102, + "us-east-1": 0.0, + "us-east-2": 0.9314, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.1414, + "us-west-1": 1.0658, + "us-west-2": 0.9314 + }, + "m7i.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 1.99148, + "ap-southeast-1": 2.141, + "ap-southeast-2": 2.141, + "ap-southeast-3": 2.141, + "ap-southeast-5": 2.00996, + "ap-southeast-7": 1.8386, + "ca-central-1": 2.10236, + "eu-central-1": 2.057, + "eu-north-1": 1.8386, + "eu-south-2": 0.0, + "eu-west-1": 1.9226, + "eu-west-2": 1.9898, + "eu-west-3": 2.0066, + "mx-central-1": 1.81844, + "sa-east-1": 0.0, + "us-east-1": 1.89908, + "us-east-2": 1.89908, + "us-gov-east-1": 2.1578, + "us-gov-west-1": 2.1578, + "us-west-1": 0.0, + "us-west-2": 1.7378 + }, + "m7i.12xlarge": { + "ap-northeast-1": 3.2498, + "ap-northeast-2": 3.0986, + "ap-south-1": 2.6702, + "ap-southeast-1": 3.149, + "ap-southeast-2": 3.4514, + "ap-southeast-3": 3.4514, + "ap-southeast-5": 2.6954, + "ap-southeast-7": 2.95244, + "ca-central-1": 3.09104, + "eu-central-1": 0.0, + "eu-north-1": 2.95244, + "eu-south-2": 0.0, + "eu-west-1": 2.8214, + "eu-west-2": 0.0, + "eu-west-3": 2.9474, + "mx-central-1": 2.66516, + "sa-east-1": 3.9806, + "us-east-1": 2.78612, + "us-east-2": 2.78612, + "us-gov-east-1": 3.1742, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 2.5442 + }, + "m7i.16xlarge": { + "ap-northeast-1": 4.2914, + "ap-northeast-2": 4.0898, + "ap-south-1": 0.0, + "ap-southeast-1": 4.157, + "ap-southeast-2": 4.5602, + "ap-southeast-3": 4.157, + "ap-southeast-5": 3.5522, + "ap-southeast-7": 3.5522, + "ca-central-1": 3.7202, + "eu-central-1": 3.989, + "eu-north-1": 3.89492, + "eu-south-2": 3.7202, + "eu-west-1": 0.0, + "eu-west-2": 4.22756, + "eu-west-3": 3.8882, + "mx-central-1": 3.51188, + "sa-east-1": 0.0, + "us-east-1": 3.3506, + "us-east-2": 3.3506, + "us-gov-east-1": 4.1906, + "us-gov-west-1": 4.1906, + "us-west-1": 3.8882, + "us-west-2": 0.0 + }, + "m7i.24xlarge": { + "ap-northeast-1": 6.3746, + "ap-northeast-2": 0.0, + "ap-south-1": 5.72444, + "ap-southeast-1": 6.7778, + "ap-southeast-2": 6.173, + "ap-southeast-3": 6.173, + "ap-southeast-5": 5.2658, + "ap-southeast-7": 0.0, + "ca-central-1": 5.5178, + "eu-central-1": 0.0, + "eu-north-1": 5.2658, + "eu-south-2": 6.05708, + "eu-west-1": 5.5178, + "eu-west-2": 5.7194, + "eu-west-3": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 7.8362, + "us-east-1": 4.9634, + "us-east-2": 4.9634, + "us-gov-east-1": 6.83324, + "us-gov-west-1": 6.2234, + "us-west-1": 6.33428, + "us-west-2": 4.9634 + }, + "m7i.48xlarge": { + "ap-northeast-1": 12.6242, + "ap-northeast-2": 12.0194, + "ap-south-1": 10.3058, + "ap-southeast-1": 0.0, + "ap-southeast-2": 12.221, + "ap-southeast-3": 12.221, + "ap-southeast-5": 10.4066, + "ap-southeast-7": 10.4066, + "ca-central-1": 10.9106, + "eu-central-1": 0.0, + "eu-north-1": 10.4066, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 11.4146, + "mx-central-1": 10.28564, + "sa-east-1": 15.5474, + "us-east-1": 9.8018, + "us-east-2": 9.8018, + "us-gov-east-1": 12.3218, + "us-gov-west-1": 12.3218, + "us-west-1": 11.4146, + "us-west-2": 9.8018 + }, + "m7i-flex.large": { + "ap-northeast-1": 0.17999, + "ap-northeast-2": 0.17401, + "ap-south-1": 0.15705, + "ap-southeast-1": 0.176, + "ap-southeast-2": 0.176, + "ap-southeast-3": 0.176, + "ap-southeast-5": 0.15805, + "ca-central-1": 0.16303, + "eu-central-1": 0.17101, + "eu-north-1": 0.15805, + "eu-south-2": 0.16303, + "eu-west-1": 0.16303, + "eu-west-2": 0.16702, + "eu-west-3": 0.16802, + "sa-east-1": 0.20892, + "us-east-1": 0.15206, + "us-east-2": 0.15206, + "us-gov-east-1": 0.177, + "us-gov-west-1": 0.177, + "us-west-1": 0.16802, + "us-west-2": 0.15206 + }, + "m7i-flex.xlarge": { + "ap-northeast-1": 0.30368, + "ap-northeast-2": 0.29172, + "ap-south-1": 0.2578, + "ap-southeast-1": 0.2957, + "ap-southeast-2": 0.2957, + "ap-southeast-3": 0.2957, + "ap-southeast-5": 0.25979, + "ca-central-1": 0.26976, + "eu-central-1": 0.28572, + "eu-north-1": 0.2598, + "eu-south-2": 0.26976, + "eu-west-1": 0.26976, + "eu-west-2": 0.27774, + "eu-west-3": 0.27974, + "sa-east-1": 0.36154, + "us-east-1": 0.24782, + "us-east-2": 0.24782, + "us-gov-east-1": 0.2977, + "us-gov-west-1": 0.2977, + "us-west-1": 0.27974, + "us-west-2": 0.24782 + }, + "m7i-flex.2xlarge": { + "ap-northeast-1": 0.61976, + "ap-northeast-2": 0.59584, + "ap-south-1": 0.528, + "ap-southeast-1": 0.6038, + "ap-southeast-2": 0.6038, + "ap-southeast-3": 0.6038, + "ap-southeast-5": 0.53198, + "ca-central-1": 0.55192, + "eu-central-1": 0.58384, + "eu-north-1": 0.532, + "eu-south-2": 0.55192, + "eu-west-1": 0.55192, + "eu-west-2": 0.56788, + "eu-west-3": 0.57188, + "sa-east-1": 0.73548, + "us-east-1": 0.50804, + "us-east-2": 0.50804, + "us-gov-east-1": 0.6078, + "us-gov-west-1": 0.6078, + "us-west-1": 0.57188, + "us-west-2": 0.50804 + }, + "m7i-flex.4xlarge": { + "ap-northeast-1": 1.11452, + "ap-northeast-2": 1.06668, + "ap-south-1": 0.931, + "ap-southeast-1": 1.0826, + "ap-southeast-2": 1.0826, + "ap-southeast-3": 1.0826, + "ap-southeast-5": 0.93896, + "ca-central-1": 0.97884, + "eu-central-1": 1.04268, + "eu-north-1": 0.939, + "eu-south-2": 0.97884, + "eu-west-1": 0.97884, + "eu-west-2": 1.01076, + "eu-west-3": 1.01876, + "sa-east-1": 1.34596, + "us-east-1": 0.89108, + "us-east-2": 0.89108, + "us-gov-east-1": 1.0906, + "us-gov-west-1": 1.0906, + "us-west-1": 1.01876, + "us-west-2": 0.89108 + }, + "m7i-flex.8xlarge": { + "ap-northeast-1": 2.10404, + "ap-northeast-2": 2.00836, + "ap-south-1": 1.737, + "ap-southeast-1": 2.0402, + "ap-southeast-2": 2.0402, + "ap-southeast-3": 2.0402, + "ap-southeast-5": 1.75292, + "ca-central-1": 1.83268, + "eu-central-1": 1.96036, + "eu-north-1": 1.753, + "eu-south-2": 1.83268, + "eu-west-1": 1.83268, + "eu-west-2": 1.89652, + "eu-west-3": 1.91252, + "sa-east-1": 2.56692, + "us-east-1": 1.65716, + "us-east-2": 1.65716, + "us-gov-east-1": 2.0562, + "us-gov-west-1": 2.0562, + "us-west-1": 1.91252, + "us-west-2": 1.65716 + }, + "m7i-flex.12xlarge": { + "ap-northeast-1": 3.09356, + "ap-south-1": 2.543, + "ap-southeast-1": 2.9978, + "ap-southeast-2": 2.9978, + "ap-southeast-5": 2.56688, + "ca-central-1": 2.68652, + "eu-central-1": 2.87804, + "eu-north-1": 2.567, + "eu-south-2": 2.68652, + "eu-west-1": 2.68652, + "eu-west-3": 2.80628, + "sa-east-1": 3.78788, + "us-east-1": 2.42324, + "us-east-2": 2.42324, + "us-gov-east-1": 3.0218, + "us-gov-west-1": 3.0218, + "us-west-1": 2.80628, + "us-west-2": 2.42324 + }, + "m7i-flex.16xlarge": { + "ap-northeast-1": 4.08308, + "ap-south-1": 3.349, + "ap-southeast-1": 3.9554, + "ap-southeast-2": 3.9554, + "ap-southeast-5": 3.38084, + "ca-central-1": 3.54036, + "eu-central-1": 3.79572, + "eu-north-1": 3.381, + "eu-south-2": 3.54036, + "eu-west-1": 3.54036, + "eu-west-3": 3.70004, + "sa-east-1": 5.00884, + "us-east-1": 3.18932, + "us-east-2": 3.18932, + "us-gov-east-1": 3.9874, + "us-gov-west-1": 3.9874, + "us-west-1": 3.70004, + "us-west-2": 3.18932 + }, + "m8g.medium": { + "eu-central-1": 0.11007, + "eu-north-1": 0.0, + "eu-south-2": 0.10629, + "eu-west-2": 0.1082, + "us-east-1": 0.10118, + "us-east-2": 0.10567, + "us-west-2": 0.10567 + }, + "m8g.large": { + "eu-central-1": 0.16384, + "eu-north-1": 0.15168, + "eu-south-2": 0.0, + "eu-west-2": 0.0, + "us-east-1": 0.14606, + "us-east-2": 0.14606, + "us-west-2": 0.14606 + }, + "m8g.xlarge": { + "eu-central-1": 0.0, + "eu-north-1": 0.24706, + "eu-south-2": 0.25626, + "eu-west-2": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.25377, + "us-west-2": 0.23582 + }, + "m8g.metal-24xl": { + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-2": 4.92404, + "eu-west-2": 5.60564, + "us-east-1": 0.0, + "us-east-2": 4.43348, + "us-west-2": 4.43348 + }, + "m8g.metal-48xl": { + "eu-central-1": 10.44884, + "eu-north-1": 9.28148, + "eu-south-2": 0.0, + "eu-west-2": 10.0898, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 8.74196 + }, + "m8g.2xlarge": { + "eu-central-1": 0.55516, + "eu-north-1": 0.54467, + "eu-south-2": 0.0, + "eu-west-2": 0.5402, + "us-east-1": 0.48404, + "us-east-2": 0.48404, + "us-west-2": 0.48404 + }, + "m8g.4xlarge": { + "eu-central-1": 0.98532, + "eu-north-1": 0.88804, + "eu-south-2": 0.92484, + "eu-west-2": 0.0, + "us-east-1": 0.91489, + "us-east-2": 0.84308, + "us-west-2": 0.84308 + }, + "m8g.8xlarge": { + "eu-central-1": 2.0177, + "eu-north-1": 1.65108, + "eu-south-2": 1.72468, + "eu-west-2": 1.95188, + "us-east-1": 1.56116, + "us-east-2": 1.56116, + "us-west-2": 1.56116 + }, + "m8g.12xlarge": { + "eu-central-1": 2.70596, + "eu-north-1": 2.41412, + "eu-south-2": 2.52452, + "eu-west-2": 0.0, + "us-east-1": 2.27924, + "us-east-2": 2.27924, + "us-west-2": 2.49466 + }, + "m8g.16xlarge": { + "eu-central-1": 3.56628, + "eu-north-1": 3.17716, + "eu-south-2": 3.32436, + "eu-west-2": 3.4466, + "us-east-1": 3.28455, + "us-east-2": 2.99732, + "us-west-2": 2.99732 + }, + "m8g.24xlarge": { + "eu-central-1": 5.28692, + "eu-north-1": 4.70324, + "eu-south-2": 4.92404, + "eu-west-2": 5.1074, + "us-east-1": 4.43348, + "us-east-2": 4.86433, + "us-west-2": 4.43348 + }, + "m8g.48xlarge": { + "eu-central-1": 10.44884, + "eu-north-1": 9.28148, + "eu-south-2": 9.72308, + "eu-west-2": 0.0, + "us-east-1": 8.74196, + "us-east-2": 8.74196, + "us-west-2": 8.74196 + }, + "p2.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.565, + "ap-south-1": 1.818, + "ap-southeast-1": 1.818, + "ap-southeast-2": 1.642, + "eu-central-1": 1.426, + "eu-west-1": 1.072, + "us-east-1": 0.0, + "us-east-2": 1.0, + "us-gov-west-1": 1.18, + "us-west-2": 1.09 + }, + "p2.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 13.844, + "ap-southeast-1": 13.844, + "ap-southeast-2": 13.67, + "eu-central-1": 11.769, + "eu-west-1": 7.876, + "us-east-1": 7.3, + "us-east-2": 0.0, + "us-gov-west-1": 8.74, + "us-west-2": 7.3 + }, + "p2.16xlarge": { + "ap-northeast-1": 24.772, + "ap-northeast-2": 23.54, + "ap-south-1": 27.588, + "ap-southeast-1": 27.588, + "ap-southeast-2": 24.772, + "eu-central-1": 21.316, + "eu-west-1": 15.652, + "us-east-1": 14.5, + "us-east-2": 14.5, + "us-gov-west-1": 17.38, + "us-west-2": 14.5 + }, + "p3.2xlarge": { + "ap-northeast-1": 4.294, + "ap-northeast-2": 4.334, + "ap-southeast-1": 4.334, + "ap-southeast-2": 4.334, + "ca-central-1": 3.685, + "eu-central-1": 3.923, + "eu-west-1": 3.62, + "eu-west-2": 3.689, + "us-east-1": 3.16, + "us-east-2": 3.16, + "us-gov-west-1": 3.772, + "us-west-2": 3.16 + }, + "p3.8xlarge": { + "ap-northeast-1": 16.876, + "ap-northeast-2": 17.036, + "ap-southeast-1": 17.036, + "ap-southeast-2": 0.0, + "ca-central-1": 13.564, + "eu-central-1": 15.392, + "eu-west-1": 13.32, + "eu-west-2": 14.456, + "us-east-1": 13.136, + "us-east-2": 12.34, + "us-gov-west-1": 0.0, + "us-west-2": 12.34 + }, + "p3.16xlarge": { + "ap-northeast-1": 33.652, + "ap-northeast-2": 33.972, + "ap-southeast-1": 33.972, + "ap-southeast-2": 33.972, + "ca-central-1": 27.028, + "eu-central-1": 30.684, + "eu-west-1": 0.0, + "eu-west-2": 28.812, + "us-east-1": 24.58, + "us-east-2": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 24.58 + }, + "p3dn.24xlarge": { + "ap-northeast-1": 42.908, + "eu-west-1": 0.0, + "us-east-1": 31.337, + "us-gov-east-1": 37.579, + "us-gov-west-1": 37.579, + "us-west-2": 31.337 + }, + "p4d.24xlarge": { + "ap-northeast-1": 45.04715, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 39.4521, + "ap-southeast-2": 42.72938, + "ca-central-1": 41.584, + "eu-central-1": 41.06975, + "eu-west-1": 0.0, + "sa-east-1": 53.195, + "us-east-1": 32.8976, + "us-east-2": 0.125, + "us-gov-west-1": 39.455, + "us-west-2": 0.125 + }, + "p4de.24xlarge": { + "ap-southeast-1": 0.0, + "eu-central-1": 51.3323, + "il-central-1": 53.21972, + "us-east-1": 45.187325, + "us-west-2": 0.0 + }, + "p5.48xlarge": { + "ap-northeast-1": 123.31996, + "ap-south-1": 118.109, + "ap-southeast-2": 127.941, + "ca-central-1": 113.193, + "eu-north-1": 105.3274, + "eu-west-2": 127.941, + "sa-east-1": 165.3026, + "us-east-1": 98.445, + "us-east-2": 98.445, + "us-gov-west-1": 118.109, + "us-west-1": 123.025, + "us-west-2": 0.125 + }, + "p5e.48xlarge": { + "us-east-2": 0.125 + }, + "p5en.48xlarge": { + "ap-northeast-1": 0.125, + "ap-northeast-2": 117.149, + "ap-south-1": 0.125, + "eu-south-2": 91.709, + "us-east-2": 0.125, + "us-west-2": 84.925 + }, + "r3.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 0.29, + "ap-southeast-1": 0.3, + "ap-southeast-2": 0.3, + "eu-central-1": 0.329, + "eu-west-1": 0.0, + "sa-east-1": 0.45, + "us-east-1": 0.0, + "us-east-2": 0.283, + "us-gov-west-1": 0.3, + "us-west-1": 0.285, + "us-west-2": 0.0 + }, + "r3.xlarge": { + "ap-northeast-1": 0.539, + "ap-northeast-2": 0.539, + "ap-south-1": 0.479, + "ap-southeast-1": 0.539, + "ap-southeast-2": 0.499, + "eu-central-1": 0.5, + "eu-west-1": 0.471, + "sa-east-1": 0.0, + "us-east-1": 0.433, + "us-east-2": 0.0, + "us-gov-west-1": 0.499, + "us-west-1": 0.471, + "us-west-2": 0.0 + }, + "r3.2xlarge": { + "ap-northeast-1": 0.898, + "ap-northeast-2": 0.0, + "ap-south-1": 0.858, + "ap-southeast-1": 0.898, + "ap-southeast-2": 0.0, + "eu-central-1": 0.9, + "eu-west-1": 0.841, + "sa-east-1": 1.639, + "us-east-1": 0.765, + "us-east-2": 0.765, + "us-gov-west-1": 0.898, + "us-west-1": 0.841, + "us-west-2": 0.832 + }, + "r3.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.696, + "ap-south-1": 1.778, + "ap-southeast-1": 1.696, + "ap-southeast-2": 1.696, + "eu-central-1": 1.7, + "eu-west-1": 1.582, + "sa-east-1": 3.189, + "us-east-1": 1.43, + "us-east-2": 1.43, + "us-gov-west-1": 1.866, + "us-west-1": 1.73, + "us-west-2": 0.0 + }, + "r3.8xlarge": { + "ap-northeast-1": 3.292, + "ap-northeast-2": 3.292, + "ap-south-1": 0.0, + "ap-southeast-1": 3.292, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 3.064, + "sa-east-1": 0.0, + "us-east-1": 2.76, + "us-east-2": 2.76, + "us-gov-west-1": 3.292, + "us-west-1": 0.0, + "us-west-2": 2.76 + }, + "r4.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.26, + "ap-northeast-3": 0.26, + "ap-south-1": 0.237, + "ap-southeast-1": 0.26, + "ap-southeast-2": 0.0, + "ca-central-1": 0.246, + "eu-central-1": 0.26005, + "eu-west-1": 0.2482, + "eu-west-2": 0.272, + "eu-west-3": 0.256, + "sa-east-1": 0.408, + "us-east-1": 0.0, + "us-east-2": 0.233, + "us-gov-west-1": 0.2596, + "us-west-1": 0.2482, + "us-west-2": 0.246 + }, + "r4.xlarge": { + "ap-northeast-1": 0.42, + "ap-northeast-2": 0.42, + "ap-northeast-3": 0.42, + "ap-south-1": 0.4014, + "ap-southeast-1": 0.452, + "ap-southeast-2": 0.4192, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.3964, + "eu-west-2": 0.0, + "eu-west-3": 0.412, + "sa-east-1": 0.716, + "us-east-1": 0.366, + "us-east-2": 0.366, + "us-gov-west-1": 0.4192, + "us-west-1": 0.3964, + "us-west-2": 0.393 + }, + "r4.2xlarge": { + "ap-northeast-1": 0.74, + "ap-northeast-2": 0.74, + "ap-northeast-3": 0.74, + "ap-south-1": 0.0, + "ap-southeast-1": 0.74, + "ap-southeast-2": 0.802, + "ca-central-1": 0.0, + "eu-central-1": 0.7402, + "eu-west-1": 0.6928, + "eu-west-2": 0.786, + "eu-west-3": 0.724, + "sa-east-1": 1.22, + "us-east-1": 0.632, + "us-east-2": 0.632, + "us-gov-west-1": 0.802, + "us-west-1": 0.0, + "us-west-2": 0.685 + }, + "r4.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 1.268, + "eu-central-1": 1.3804, + "eu-west-1": 1.2856, + "eu-west-2": 0.0, + "eu-west-3": 1.4728, + "sa-east-1": 0.0, + "us-east-1": 1.164, + "us-east-2": 1.164, + "us-gov-west-1": 1.3768, + "us-west-1": 1.404, + "us-west-2": 1.27 + }, + "r4.8xlarge": { + "ap-northeast-1": 2.66, + "ap-northeast-2": 2.66, + "ap-northeast-3": 0.0, + "ap-south-1": 2.292, + "ap-southeast-1": 2.916, + "ap-southeast-2": 0.0, + "ca-central-1": 2.67, + "eu-central-1": 0.0, + "eu-west-1": 2.4712, + "eu-west-2": 2.596, + "eu-west-3": 2.596, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.228, + "us-gov-west-1": 2.6536, + "us-west-1": 2.4712, + "us-west-2": 2.228 + }, + "r4.16xlarge": { + "ap-northeast-1": 5.22, + "ap-northeast-2": 0.0, + "ap-northeast-3": 5.22, + "ap-south-1": 4.484, + "ap-southeast-1": 5.22, + "ap-southeast-2": 5.2072, + "ca-central-1": 4.772, + "eu-central-1": 5.222, + "eu-west-1": 4.8424, + "eu-west-2": 5.092, + "eu-west-3": 5.092, + "sa-east-1": 9.06, + "us-east-1": 4.356, + "us-east-2": 4.356, + "us-gov-west-1": 5.2072, + "us-west-1": 0.0, + "us-west-2": 4.356 + }, + "r5.large": { + "af-south-1": 0.224, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.208, + "ap-northeast-3": 0.217, + "ap-south-1": 0.186, + "ap-south-2": 0.186, + "ap-southeast-1": 0.208, + "ap-southeast-2": 0.207, + "ap-southeast-3": 0.208, + "ap-southeast-4": 0.216, + "ca-central-1": 0.203, + "ca-west-1": 0.203, + "eu-central-1": 0.208, + "eu-central-2": 0.224, + "eu-north-1": 0.198, + "eu-south-1": 0.213, + "eu-south-2": 0.197, + "eu-west-1": 0.197, + "eu-west-2": 0.0, + "eu-west-3": 0.204, + "il-central-1": 0.213, + "me-central-1": 0.0, + "me-south-1": 0.211, + "sa-east-1": 0.0, + "us-east-1": 0.182, + "us-east-2": 0.0, + "us-gov-east-1": 0.207, + "us-gov-west-1": 0.207, + "us-west-1": 0.196, + "us-west-2": 0.182, + "us-west-2-lax-1": 0.0 + }, + "r5.xlarge": { + "af-south-1": 0.392, + "ap-east-1": 0.41, + "ap-northeast-1": 0.379, + "ap-northeast-2": 0.36, + "ap-northeast-3": 0.36, + "ap-south-1": 0.316, + "ap-south-2": 0.316, + "ap-southeast-1": 0.379, + "ap-southeast-2": 0.376, + "ap-southeast-3": 0.36, + "ap-southeast-4": 0.358, + "ca-central-1": 0.349, + "ca-west-1": 0.332, + "eu-central-1": 0.379, + "eu-central-2": 0.391, + "eu-north-1": 0.324, + "eu-south-1": 0.352, + "eu-south-2": 0.355, + "eu-west-1": 0.338, + "eu-west-2": 0.352, + "eu-west-3": 0.352, + "il-central-1": 0.352, + "me-central-1": 0.367, + "me-south-1": 0.0, + "sa-east-1": 0.458, + "us-east-1": 0.0, + "us-east-2": 0.323, + "us-gov-east-1": 0.358, + "us-gov-west-1": 0.358, + "us-west-1": 0.336, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.359 + }, + "r5.metal": { + "af-south-1": 8.189, + "ap-east-1": 0.0, + "ap-northeast-1": 7.421, + "ap-northeast-2": 7.421, + "ap-northeast-3": 0.0, + "ap-south-1": 6.365, + "ap-south-2": 6.365, + "ap-southeast-1": 7.421, + "ap-southeast-2": 7.373, + "ap-southeast-3": 7.421, + "ap-southeast-4": 7.373, + "ca-central-1": 6.749, + "ca-west-1": 6.749, + "eu-central-1": 7.421, + "eu-central-2": 8.151, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 6.893, + "eu-west-1": 0.0, + "eu-west-2": 7.229, + "eu-west-3": 0.0, + "il-central-1": 7.231, + "me-central-1": 7.57, + "me-south-1": 7.57, + "sa-east-1": 9.773, + "us-east-1": 0.0, + "us-east-2": 6.173, + "us-gov-east-1": 7.373, + "us-gov-west-1": 0.0, + "us-west-1": 6.845, + "us-west-2": 0.0, + "us-west-2-lax-1": 7.383 + }, + "r5.2xlarge": { + "af-south-1": 0.797, + "ap-east-1": 0.793, + "ap-northeast-1": 0.733, + "ap-northeast-2": 0.733, + "ap-northeast-3": 0.0, + "ap-south-1": 0.676, + "ap-south-2": 0.645, + "ap-southeast-1": 0.733, + "ap-southeast-2": 0.729, + "ap-southeast-3": 0.733, + "ap-southeast-4": 0.765, + "ca-central-1": 0.677, + "ca-west-1": 0.677, + "eu-central-1": 0.733, + "eu-central-2": 0.794, + "eu-north-1": 0.661, + "eu-south-1": 0.717, + "eu-south-2": 0.689, + "eu-west-1": 0.689, + "eu-west-2": 0.717, + "eu-west-3": 0.717, + "il-central-1": 0.717, + "me-central-1": 0.745, + "me-south-1": 0.783, + "sa-east-1": 0.929, + "us-east-1": 0.629, + "us-east-2": 0.629, + "us-gov-east-1": 0.765, + "us-gov-west-1": 0.729, + "us-west-1": 0.685, + "us-west-2": 0.659, + "us-west-2-lax-1": 0.73 + }, + "r5.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.461, + "ap-northeast-1": 1.341, + "ap-northeast-2": 1.341, + "ap-northeast-3": 1.414, + "ap-south-1": 0.0, + "ap-south-2": 1.227, + "ap-southeast-1": 1.341, + "ap-southeast-2": 1.333, + "ap-southeast-3": 1.341, + "ap-southeast-4": 1.333, + "ca-central-1": 1.295, + "ca-west-1": 1.229, + "eu-central-1": 0.0, + "eu-central-2": 1.463, + "eu-north-1": 0.0, + "eu-south-1": 1.38, + "eu-south-2": 0.0, + "eu-west-1": 1.321, + "eu-west-2": 1.309, + "eu-west-3": 1.309, + "il-central-1": 1.309, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 1.733, + "us-east-1": 1.133, + "us-east-2": 1.193, + "us-gov-east-1": 1.333, + "us-gov-west-1": 1.405, + "us-west-1": 1.245, + "us-west-2": 0.0, + "us-west-2-lax-1": 1.335 + }, + "r5.8xlarge": { + "af-south-1": 0.0, + "ap-east-1": 2.797, + "ap-northeast-1": 2.557, + "ap-northeast-2": 0.0, + "ap-northeast-3": 2.557, + "ap-south-1": 2.205, + "ap-south-2": 2.205, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 2.333, + "eu-central-1": 2.557, + "eu-central-2": 2.961, + "eu-north-1": 0.0, + "eu-south-1": 2.635, + "eu-south-2": 2.381, + "eu-west-1": 2.381, + "eu-west-2": 0.0, + "eu-west-3": 2.635, + "il-central-1": 2.494, + "me-central-1": 2.607, + "me-south-1": 2.607, + "sa-east-1": 3.534, + "us-east-1": 2.141, + "us-east-2": 2.262, + "us-gov-east-1": 2.541, + "us-gov-west-1": 2.541, + "us-west-1": 2.365, + "us-west-2": 2.141, + "us-west-2-lax-1": 2.544 + }, + "r5.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.133, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.773, + "ap-northeast-3": 3.773, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 3.773, + "ap-southeast-2": 0.0, + "ap-southeast-3": 3.773, + "ap-southeast-4": 3.749, + "ca-central-1": 3.437, + "ca-west-1": 0.0, + "eu-central-1": 3.773, + "eu-central-2": 4.138, + "eu-north-1": 3.341, + "eu-south-1": 0.0, + "eu-south-2": 3.509, + "eu-west-1": 3.712, + "eu-west-2": 3.677, + "eu-west-3": 3.677, + "il-central-1": 3.891, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 5.238, + "us-east-1": 3.33, + "us-east-2": 3.33, + "us-gov-east-1": 3.749, + "us-gov-west-1": 3.749, + "us-west-1": 3.485, + "us-west-2": 3.149, + "us-west-2-lax-1": 0.0 + }, + "r5.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.989, + "ap-northeast-3": 4.989, + "ap-south-1": 4.285, + "ap-south-2": 4.285, + "ap-southeast-1": 5.281, + "ap-southeast-2": 4.957, + "ap-southeast-3": 4.989, + "ap-southeast-4": 4.957, + "ca-central-1": 4.541, + "ca-west-1": 4.541, + "eu-central-1": 0.0, + "eu-central-2": 5.796, + "eu-north-1": 4.413, + "eu-south-1": 4.861, + "eu-south-2": 4.637, + "eu-west-1": 4.637, + "eu-west-2": 4.861, + "eu-west-3": 5.145, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 4.157, + "us-east-2": 0.0, + "us-gov-east-1": 4.957, + "us-gov-west-1": 5.247, + "us-west-1": 4.605, + "us-west-2": 4.157, + "us-west-2-lax-1": 4.963 + }, + "r5.24xlarge": { + "af-south-1": 0.0, + "ap-east-1": 8.141, + "ap-northeast-1": 7.421, + "ap-northeast-2": 7.421, + "ap-northeast-3": 7.421, + "ap-south-1": 6.365, + "ap-south-2": 6.365, + "ap-southeast-1": 7.421, + "ap-southeast-2": 0.0, + "ap-southeast-3": 7.421, + "ap-southeast-4": 7.373, + "ca-central-1": 6.749, + "ca-west-1": 6.749, + "eu-central-1": 7.421, + "eu-central-2": 0.0, + "eu-north-1": 6.557, + "eu-south-1": 7.229, + "eu-south-2": 6.893, + "eu-west-1": 6.893, + "eu-west-2": 7.229, + "eu-west-3": 7.229, + "il-central-1": 7.231, + "me-central-1": 7.57, + "me-south-1": 7.57, + "sa-east-1": 9.773, + "us-east-1": 6.173, + "us-east-2": 6.173, + "us-gov-east-1": 7.373, + "us-gov-west-1": 7.373, + "us-west-1": 6.845, + "us-west-2": 6.173, + "us-west-2-lax-1": 7.383 + }, + "r5a.large": { + "ap-northeast-1": 0.193, + "ap-northeast-2": 0.192, + "ap-south-1": 0.128, + "ap-southeast-1": 0.192, + "ap-southeast-2": 0.192, + "ca-central-1": 0.18, + "eu-central-1": 0.193, + "eu-south-1": 0.189, + "eu-west-1": 0.183, + "eu-west-2": 0.189, + "eu-west-3": 0.189, + "sa-east-1": 0.237, + "us-east-1": 0.169, + "us-east-2": 0.169, + "us-gov-east-1": 0.192, + "us-gov-west-1": 0.192, + "us-west-1": 0.182, + "us-west-2": 0.169 + }, + "r5a.xlarge": { + "ap-northeast-1": 0.33, + "ap-northeast-2": 0.328, + "ap-south-1": 0.199, + "ap-southeast-1": 0.328, + "ap-southeast-2": 0.328, + "ca-central-1": 0.304, + "eu-central-1": 0.33, + "eu-south-1": 0.322, + "eu-west-1": 0.31, + "eu-west-2": 0.322, + "eu-west-3": 0.322, + "sa-east-1": 0.418, + "us-east-1": 0.282, + "us-east-2": 0.282, + "us-gov-east-1": 0.328, + "us-gov-west-1": 0.328, + "us-west-1": 0.308, + "us-west-2": 0.282 + }, + "r5a.2xlarge": { + "ap-northeast-1": 0.673, + "ap-northeast-2": 0.669, + "ap-south-1": 0.411, + "ap-southeast-1": 0.669, + "ap-southeast-2": 0.669, + "ca-central-1": 0.621, + "eu-central-1": 0.673, + "eu-south-1": 0.657, + "eu-west-1": 0.633, + "eu-west-2": 0.657, + "eu-west-3": 0.657, + "sa-east-1": 0.849, + "us-east-1": 0.577, + "us-east-2": 0.577, + "us-gov-east-1": 0.669, + "us-gov-west-1": 0.669, + "us-west-1": 0.629, + "us-west-2": 0.577 + }, + "r5a.4xlarge": { + "ap-northeast-1": 1.221, + "ap-northeast-2": 1.213, + "ap-south-1": 0.697, + "ap-southeast-1": 1.213, + "ap-southeast-2": 1.213, + "ca-central-1": 1.117, + "eu-central-1": 1.221, + "eu-south-1": 1.189, + "eu-west-1": 1.141, + "eu-west-2": 1.189, + "eu-west-3": 1.189, + "sa-east-1": 1.573, + "us-east-1": 1.029, + "us-east-2": 1.029, + "us-gov-east-1": 1.213, + "us-gov-west-1": 1.213, + "us-west-1": 1.133, + "us-west-2": 1.029 + }, + "r5a.8xlarge": { + "ap-northeast-1": 2.317, + "ap-northeast-2": 2.301, + "ap-south-1": 1.269, + "ap-southeast-1": 2.301, + "ap-southeast-2": 2.301, + "ca-central-1": 2.109, + "eu-central-1": 2.317, + "eu-south-1": 2.253, + "eu-west-1": 2.157, + "eu-west-2": 2.253, + "eu-west-3": 2.253, + "sa-east-1": 3.021, + "us-east-1": 1.933, + "us-east-2": 1.933, + "us-gov-east-1": 2.301, + "us-gov-west-1": 2.301, + "us-west-1": 2.141, + "us-west-2": 1.933 + }, + "r5a.12xlarge": { + "ap-northeast-1": 3.413, + "ap-northeast-2": 3.389, + "ap-south-1": 1.841, + "ap-southeast-1": 3.389, + "ap-southeast-2": 3.389, + "ca-central-1": 3.101, + "eu-central-1": 3.413, + "eu-south-1": 3.317, + "eu-west-1": 3.173, + "eu-west-2": 3.317, + "eu-west-3": 3.317, + "sa-east-1": 4.469, + "us-east-1": 2.837, + "us-east-2": 2.837, + "us-gov-east-1": 3.389, + "us-gov-west-1": 3.389, + "us-west-1": 3.149, + "us-west-2": 2.837 + }, + "r5a.16xlarge": { + "ap-northeast-1": 4.509, + "ap-northeast-2": 4.477, + "ap-south-1": 2.413, + "ap-southeast-1": 4.477, + "ap-southeast-2": 4.477, + "ca-central-1": 4.093, + "eu-central-1": 4.509, + "eu-south-1": 4.381, + "eu-west-1": 4.189, + "eu-west-2": 4.381, + "eu-west-3": 4.381, + "sa-east-1": 5.917, + "us-east-1": 3.741, + "us-east-2": 3.741, + "us-gov-east-1": 4.477, + "us-gov-west-1": 4.477, + "us-west-1": 4.157, + "us-west-2": 3.741 + }, + "r5a.24xlarge": { + "ap-northeast-1": 6.701, + "ap-northeast-2": 6.653, + "ap-south-1": 3.557, + "ap-southeast-1": 6.653, + "ap-southeast-2": 6.653, + "ca-central-1": 6.077, + "eu-central-1": 6.701, + "eu-south-1": 6.509, + "eu-west-1": 6.221, + "eu-west-2": 6.509, + "eu-west-3": 6.509, + "sa-east-1": 8.813, + "us-east-1": 5.549, + "us-east-2": 5.549, + "us-gov-east-1": 6.653, + "us-gov-west-1": 6.653, + "us-west-1": 6.173, + "us-west-2": 5.549 + }, + "r5ad.large": { + "ap-northeast-1": 0.215, + "ap-northeast-2": 0.214, + "ap-south-1": 0.139, + "ap-southeast-1": 0.215, + "ap-southeast-2": 0.215, + "ca-central-1": 0.2, + "eu-central-1": 0.214, + "eu-west-1": 0.202, + "eu-west-2": 0.21, + "eu-west-3": 0.209, + "sa-east-1": 0.264, + "us-east-1": 0.187, + "us-east-2": 0.187, + "us-gov-west-1": 0.214, + "us-west-1": 0.204, + "us-west-2": 0.187 + }, + "r5ad.xlarge": { + "ap-northeast-1": 0.374, + "ap-northeast-2": 0.372, + "ap-south-1": 0.222, + "ap-southeast-1": 0.374, + "ap-southeast-2": 0.374, + "ca-central-1": 0.344, + "eu-central-1": 0.372, + "eu-west-1": 0.348, + "eu-west-2": 0.364, + "eu-west-3": 0.362, + "sa-east-1": 0.472, + "us-east-1": 0.318, + "us-east-2": 0.318, + "us-gov-west-1": 0.372, + "us-west-1": 0.352, + "us-west-2": 0.318 + }, + "r5ad.2xlarge": { + "ap-northeast-1": 0.761, + "ap-northeast-2": 0.757, + "ap-south-1": 0.457, + "ap-southeast-1": 0.761, + "ap-southeast-2": 0.761, + "ca-central-1": 0.701, + "eu-central-1": 0.757, + "eu-west-1": 0.709, + "eu-west-2": 0.741, + "eu-west-3": 0.737, + "sa-east-1": 0.957, + "us-east-1": 0.649, + "us-east-2": 0.649, + "us-gov-west-1": 0.757, + "us-west-1": 0.717, + "us-west-2": 0.649 + }, + "r5ad.4xlarge": { + "ap-northeast-1": 1.397, + "ap-northeast-2": 1.389, + "ap-south-1": 0.789, + "ap-southeast-1": 1.397, + "ap-southeast-2": 1.397, + "ca-central-1": 1.277, + "eu-central-1": 1.389, + "eu-west-1": 1.293, + "eu-west-2": 1.357, + "eu-west-3": 1.349, + "sa-east-1": 1.789, + "us-east-1": 1.173, + "us-east-2": 1.173, + "us-gov-west-1": 1.389, + "us-west-1": 1.309, + "us-west-2": 1.173 + }, + "r5ad.8xlarge": { + "ap-northeast-1": 2.669, + "ap-northeast-2": 2.653, + "ap-south-1": 1.454, + "ap-southeast-1": 2.669, + "ap-southeast-2": 2.669, + "ca-central-1": 2.429, + "eu-central-1": 2.653, + "eu-west-1": 2.461, + "eu-west-2": 2.589, + "eu-west-3": 2.573, + "sa-east-1": 3.453, + "us-east-1": 2.221, + "us-east-2": 2.221, + "us-gov-west-1": 2.653, + "us-west-1": 2.493, + "us-west-2": 2.221 + }, + "r5ad.12xlarge": { + "ap-northeast-1": 3.941, + "ap-northeast-2": 3.917, + "ap-south-1": 2.118, + "ap-southeast-1": 3.941, + "ap-southeast-2": 3.941, + "ca-central-1": 3.581, + "eu-central-1": 3.917, + "eu-west-1": 3.629, + "eu-west-2": 3.821, + "eu-west-3": 3.797, + "sa-east-1": 5.117, + "us-east-1": 3.269, + "us-east-2": 3.269, + "us-gov-west-1": 3.917, + "us-west-1": 3.677, + "us-west-2": 3.269 + }, + "r5ad.16xlarge": { + "ap-northeast-1": 5.213, + "ap-northeast-2": 5.181, + "ap-south-1": 2.783, + "ap-southeast-1": 5.213, + "ap-southeast-2": 5.213, + "ca-central-1": 4.733, + "eu-central-1": 5.181, + "eu-west-1": 4.797, + "eu-west-2": 5.053, + "eu-west-3": 5.021, + "sa-east-1": 6.781, + "us-east-1": 4.317, + "us-east-2": 4.317, + "us-gov-west-1": 5.181, + "us-west-1": 4.861, + "us-west-2": 4.317 + }, + "r5ad.24xlarge": { + "ap-northeast-1": 7.757, + "ap-northeast-2": 7.709, + "ap-south-1": 4.111, + "ap-southeast-1": 7.757, + "ap-southeast-2": 7.757, + "ca-central-1": 7.037, + "eu-central-1": 7.709, + "eu-west-1": 7.133, + "eu-west-2": 7.517, + "eu-west-3": 7.469, + "sa-east-1": 10.109, + "us-east-1": 6.413, + "us-east-2": 6.413, + "us-gov-west-1": 7.709, + "us-west-1": 7.229, + "us-west-2": 6.413 + }, + "r5b.large": { + "ap-northeast-1": 0.2373, + "ap-northeast-2": 0.2343, + "ap-southeast-1": 0.2343, + "ap-southeast-2": 0.0, + "ca-central-1": 0.2193, + "eu-central-1": 0.2521, + "eu-north-1": 0.21424, + "eu-south-1": 0.2313, + "eu-west-1": 0.2233, + "eu-west-2": 0.2313, + "sa-east-1": 0.2933, + "us-east-1": 0.2202, + "us-east-2": 0.2053, + "us-west-2": 0.2202 + }, + "r5b.xlarge": { + "ap-northeast-1": 0.4183, + "ap-northeast-2": 0.4123, + "ap-southeast-1": 0.4123, + "ap-southeast-2": 0.4545, + "ca-central-1": 0.4149, + "eu-central-1": 0.4123, + "eu-north-1": 0.37218, + "eu-south-1": 0.4063, + "eu-west-1": 0.3903, + "eu-west-2": 0.4063, + "sa-east-1": 0.5303, + "us-east-1": 0.3543, + "us-east-2": 0.3543, + "us-west-2": 0.3543 + }, + "r5b.metal": { + "ap-northeast-1": 8.813, + "ap-northeast-2": 8.669, + "ap-southeast-1": 8.669, + "ap-southeast-2": 8.813, + "ca-central-1": 0.0, + "eu-central-1": 8.669, + "eu-north-1": 7.70612, + "eu-south-1": 8.525, + "eu-west-1": 0.0, + "eu-west-2": 8.525, + "sa-east-1": 12.6386, + "us-east-1": 7.277, + "us-east-2": 7.277, + "us-west-2": 0.0 + }, + "r5b.2xlarge": { + "ap-northeast-1": 0.849, + "ap-northeast-2": 0.9082, + "ap-southeast-1": 0.837, + "ap-southeast-2": 0.849, + "ca-central-1": 0.777, + "eu-central-1": 0.837, + "eu-north-1": 0.75676, + "eu-south-1": 0.825, + "eu-west-1": 0.793, + "eu-west-2": 0.825, + "sa-east-1": 1.1678, + "us-east-1": 0.0, + "us-east-2": 0.7806, + "us-west-2": 0.721 + }, + "r5b.4xlarge": { + "ap-northeast-1": 1.573, + "ap-northeast-2": 1.549, + "ap-southeast-1": 1.549, + "ap-southeast-2": 1.7178, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 1.38852, + "eu-south-1": 0.0, + "eu-west-1": 1.5946, + "eu-west-2": 1.525, + "sa-east-1": 2.2106, + "us-east-1": 1.317, + "us-east-2": 1.317, + "us-west-2": 1.317 + }, + "r5b.8xlarge": { + "ap-northeast-1": 3.021, + "ap-northeast-2": 0.0, + "ap-southeast-1": 3.2578, + "ap-southeast-2": 0.0, + "ca-central-1": 2.733, + "eu-central-1": 0.0, + "eu-north-1": 2.65204, + "eu-south-1": 0.0, + "eu-west-1": 2.797, + "eu-west-2": 2.925, + "sa-east-1": 3.917, + "us-east-1": 2.509, + "us-east-2": 2.7474, + "us-west-2": 2.509 + }, + "r5b.12xlarge": { + "ap-northeast-1": 4.469, + "ap-northeast-2": 4.397, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.469, + "ca-central-1": 4.037, + "eu-central-1": 4.397, + "eu-north-1": 3.91556, + "eu-south-1": 0.0, + "eu-west-1": 4.133, + "eu-west-2": 4.325, + "sa-east-1": 0.0, + "us-east-1": 3.701, + "us-east-2": 4.0586, + "us-west-2": 0.0 + }, + "r5b.16xlarge": { + "ap-northeast-1": 5.917, + "ap-northeast-2": 5.821, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.917, + "ca-central-1": 5.341, + "eu-central-1": 6.3906, + "eu-north-1": 5.684488, + "eu-south-1": 0.0, + "eu-west-1": 5.469, + "eu-west-2": 5.725, + "sa-east-1": 8.4674, + "us-east-1": 5.3698, + "us-east-2": 0.0, + "us-west-2": 4.893 + }, + "r5b.24xlarge": { + "ap-northeast-1": 9.6818, + "ap-northeast-2": 8.669, + "ap-southeast-1": 9.5234, + "ap-southeast-2": 8.813, + "ca-central-1": 8.7314, + "eu-central-1": 8.669, + "eu-north-1": 7.70612, + "eu-south-1": 9.365, + "eu-west-1": 8.141, + "eu-west-2": 8.525, + "sa-east-1": 11.501, + "us-east-1": 7.277, + "us-east-2": 0.0, + "us-west-2": 7.277 + }, + "r5d.large": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.229, + "ap-northeast-3": 0.23, + "ap-south-1": 0.216, + "ap-south-2": 0.207, + "ap-southeast-1": 0.23, + "ap-southeast-2": 0.23, + "ap-southeast-3": 0.23, + "ap-southeast-4": 0.23, + "ca-central-1": 0.214, + "eu-central-1": 0.229, + "eu-central-2": 0.247, + "eu-north-1": 0.217, + "eu-south-1": 0.0, + "eu-south-2": 0.216, + "eu-west-1": 0.0, + "eu-west-2": 0.235, + "eu-west-3": 0.225, + "il-central-1": 0.234, + "me-central-1": 0.0, + "me-south-1": 0.232, + "sa-east-1": 0.284, + "us-east-1": 0.209, + "us-east-2": 0.0, + "us-gov-east-1": 0.229, + "us-gov-west-1": 0.229, + "us-west-1": 0.0, + "us-west-2": 0.209, + "us-west-2-lax-1": 0.0 + }, + "r5d.xlarge": { + "af-south-1": 0.436, + "ap-east-1": 0.406, + "ap-northeast-1": 0.404, + "ap-northeast-2": 0.402, + "ap-northeast-3": 0.425, + "ap-south-1": 0.0, + "ap-south-2": 0.358, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.404, + "ap-southeast-3": 0.404, + "ap-southeast-4": 0.404, + "ca-central-1": 0.372, + "eu-central-1": 0.402, + "eu-central-2": 0.46, + "eu-north-1": 0.0, + "eu-south-1": 0.392, + "eu-south-2": 0.376, + "eu-west-1": 0.396, + "eu-west-2": 0.415, + "eu-west-3": 0.394, + "il-central-1": 0.0, + "me-central-1": 0.429, + "me-south-1": 0.408, + "sa-east-1": 0.512, + "us-east-1": 0.362, + "us-east-2": 0.344, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.38, + "us-west-2": 0.344, + "us-west-2-lax-1": 0.402 + }, + "r5d.metal": { + "af-south-1": 0.0, + "ap-east-1": 8.525, + "ap-northeast-1": 8.477, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 7.373, + "ap-south-2": 7.373, + "ap-southeast-1": 0.0, + "ap-southeast-2": 8.477, + "ap-southeast-3": 8.477, + "ap-southeast-4": 8.477, + "ca-central-1": 7.709, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 7.421, + "eu-south-1": 8.189, + "eu-south-2": 7.805, + "eu-west-1": 7.805, + "eu-west-2": 8.237, + "eu-west-3": 8.237, + "il-central-1": 0.0, + "me-central-1": 8.573, + "me-south-1": 8.573, + "sa-east-1": 11.069, + "us-east-1": 7.037, + "us-east-2": 7.037, + "us-gov-east-1": 8.429, + "us-gov-west-1": 0.0, + "us-west-1": 7.901, + "us-west-2": 0.0, + "us-west-2-lax-1": 8.419 + }, + "r5d.2xlarge": { + "af-south-1": 0.885, + "ap-east-1": 0.0, + "ap-northeast-1": 0.821, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.765, + "ap-southeast-1": 0.821, + "ap-southeast-2": 0.821, + "ap-southeast-3": 0.863, + "ap-southeast-4": 0.0, + "ca-central-1": 0.757, + "eu-central-1": 0.817, + "eu-central-2": 0.932, + "eu-north-1": 0.733, + "eu-south-1": 0.837, + "eu-south-2": 0.803, + "eu-west-1": 0.765, + "eu-west-2": 0.801, + "eu-west-3": 0.801, + "il-central-1": 0.797, + "me-central-1": 0.0, + "me-south-1": 0.829, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.736, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.817, + "us-west-1": 0.773, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0 + }, + "r5d.4xlarge": { + "af-south-1": 1.645, + "ap-east-1": 1.525, + "ap-northeast-1": 1.601, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.601, + "ap-south-1": 1.333, + "ap-south-2": 1.405, + "ap-southeast-1": 1.517, + "ap-southeast-2": 1.601, + "ap-southeast-3": 0.0, + "ap-southeast-4": 1.517, + "ca-central-1": 1.389, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 1.341, + "eu-south-1": 1.469, + "eu-south-2": 1.482, + "eu-west-1": 1.405, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 1.533, + "me-south-1": 1.533, + "sa-east-1": 0.0, + "us-east-1": 1.277, + "us-east-2": 1.277, + "us-gov-east-1": 1.509, + "us-gov-west-1": 1.509, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 1.507 + }, + "r5d.8xlarge": { + "af-south-1": 3.165, + "ap-east-1": 2.925, + "ap-northeast-1": 2.909, + "ap-northeast-2": 2.893, + "ap-northeast-3": 2.909, + "ap-south-1": 2.541, + "ap-south-2": 2.541, + "ap-southeast-1": 2.909, + "ap-southeast-2": 3.076, + "ap-southeast-3": 2.909, + "ap-southeast-4": 2.909, + "ca-central-1": 2.653, + "eu-central-1": 2.893, + "eu-central-2": 3.17, + "eu-north-1": 2.557, + "eu-south-1": 2.813, + "eu-south-2": 2.685, + "eu-west-1": 2.685, + "eu-west-2": 2.829, + "eu-west-3": 2.829, + "il-central-1": 2.813, + "me-central-1": 2.941, + "me-south-1": 2.941, + "sa-east-1": 3.773, + "us-east-1": 2.429, + "us-east-2": 2.429, + "us-gov-east-1": 2.893, + "us-gov-west-1": 2.893, + "us-west-1": 2.717, + "us-west-2": 2.429, + "us-west-2-lax-1": 2.89 + }, + "r5d.12xlarge": { + "af-south-1": 4.685, + "ap-east-1": 4.325, + "ap-northeast-1": 4.552, + "ap-northeast-2": 0.0, + "ap-northeast-3": 4.301, + "ap-south-1": 3.749, + "ap-south-2": 3.966, + "ap-southeast-1": 4.301, + "ap-southeast-2": 4.301, + "ap-southeast-3": 0.0, + "ap-southeast-4": 4.301, + "ca-central-1": 3.917, + "eu-central-1": 4.526, + "eu-central-2": 4.692, + "eu-north-1": 3.773, + "eu-south-1": 4.157, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 4.181, + "il-central-1": 4.157, + "me-central-1": 0.0, + "me-south-1": 4.349, + "sa-east-1": 5.597, + "us-east-1": 3.788, + "us-east-2": 3.581, + "us-gov-east-1": 4.277, + "us-gov-west-1": 4.526, + "us-west-1": 4.013, + "us-west-2": 3.788, + "us-west-2-lax-1": 4.521 + }, + "r5d.16xlarge": { + "af-south-1": 6.57, + "ap-east-1": 5.725, + "ap-northeast-1": 5.693, + "ap-northeast-2": 5.661, + "ap-northeast-3": 5.693, + "ap-south-1": 4.957, + "ap-south-2": 4.957, + "ap-southeast-1": 5.693, + "ap-southeast-2": 5.693, + "ap-southeast-3": 5.693, + "ap-southeast-4": 5.693, + "ca-central-1": 5.181, + "eu-central-1": 5.661, + "eu-central-2": 6.215, + "eu-north-1": 4.989, + "eu-south-1": 5.501, + "eu-south-2": 5.245, + "eu-west-1": 5.245, + "eu-west-2": 5.533, + "eu-west-3": 5.533, + "il-central-1": 5.501, + "me-central-1": 5.757, + "me-south-1": 5.757, + "sa-east-1": 7.859, + "us-east-1": 4.733, + "us-east-2": 4.733, + "us-gov-east-1": 5.661, + "us-gov-west-1": 5.661, + "us-west-1": 5.309, + "us-west-2": 4.733, + "us-west-2-lax-1": 5.655 + }, + "r5d.24xlarge": { + "af-south-1": 9.245, + "ap-east-1": 8.525, + "ap-northeast-1": 8.477, + "ap-northeast-2": 8.429, + "ap-northeast-3": 8.477, + "ap-south-1": 7.373, + "ap-south-2": 7.373, + "ap-southeast-1": 0.0, + "ap-southeast-2": 8.477, + "ap-southeast-3": 8.477, + "ap-southeast-4": 8.477, + "ca-central-1": 7.709, + "eu-central-1": 8.429, + "eu-central-2": 9.259, + "eu-north-1": 0.0, + "eu-south-1": 8.189, + "eu-south-2": 0.0, + "eu-west-1": 7.805, + "eu-west-2": 8.237, + "eu-west-3": 8.237, + "il-central-1": 8.189, + "me-central-1": 8.573, + "me-south-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 7.037, + "us-east-2": 7.037, + "us-gov-east-1": 0.0, + "us-gov-west-1": 8.429, + "us-west-1": 7.901, + "us-west-2": 7.037, + "us-west-2-lax-1": 0.0 + }, + "r5dn.large": { + "af-south-1": 0.0, + "ap-northeast-1": 0.2593, + "ap-northeast-2": 0.2553, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.2603, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-3": 0.2523, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.2573, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "r5dn.xlarge": { + "af-south-1": 0.4983, + "ap-northeast-1": 0.4623, + "ap-northeast-2": 0.47818, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.4643, + "eu-central-1": 0.0, + "eu-north-1": 0.4103, + "eu-south-1": 0.4483, + "eu-west-1": 0.0, + "eu-west-3": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.4583, + "us-west-2": 0.0 + }, + "r5dn.metal": { + "af-south-1": 10.733, + "ap-northeast-1": 9.869, + "ap-northeast-2": 9.677, + "ap-southeast-1": 0.0, + "ap-southeast-2": 9.917, + "eu-central-1": 9.677, + "eu-north-1": 8.621, + "eu-south-1": 9.533, + "eu-west-1": 9.053, + "eu-west-3": 9.533, + "us-east-1": 8.141, + "us-east-2": 8.141, + "us-gov-east-1": 0.0, + "us-gov-west-1": 9.773, + "us-west-2": 0.0 + }, + "r5dn.2xlarge": { + "af-south-1": 1.009, + "ap-northeast-1": 0.937, + "ap-northeast-2": 0.921, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.941, + "eu-central-1": 0.0, + "eu-north-1": 0.833, + "eu-south-1": 0.909, + "eu-west-1": 0.0, + "eu-west-3": 0.909, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.929, + "us-west-2": 0.0 + }, + "r5dn.4xlarge": { + "af-south-1": 1.893, + "ap-northeast-1": 1.84644, + "ap-northeast-2": 1.81252, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 1.541, + "eu-south-1": 1.693, + "eu-west-1": 0.0, + "eu-west-3": 1.693, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 1.733, + "us-gov-west-1": 1.733, + "us-west-2": 0.0 + }, + "r5dn.8xlarge": { + "af-south-1": 3.661, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.389, + "eu-central-1": 0.0, + "eu-north-1": 2.957, + "eu-south-1": 3.261, + "eu-west-1": 0.0, + "eu-west-3": 3.261, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 3.341, + "us-gov-west-1": 3.341, + "us-west-2": 0.0 + }, + "r5dn.12xlarge": { + "af-south-1": 5.429, + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.901, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.021, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 4.829, + "eu-west-1": 0.0, + "eu-west-3": 4.829, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.949, + "us-west-2": 0.0 + }, + "r5dn.16xlarge": { + "af-south-1": 7.197, + "ap-northeast-1": 6.621, + "ap-northeast-2": 6.493, + "ap-southeast-1": 0.0, + "ap-southeast-2": 6.653, + "eu-central-1": 0.0, + "eu-north-1": 5.789, + "eu-south-1": 6.397, + "eu-west-1": 0.0, + "eu-west-3": 6.397, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 6.557, + "us-gov-west-1": 6.557, + "us-west-2": 0.0 + }, + "r5dn.24xlarge": { + "af-south-1": 10.733, + "ap-northeast-1": 9.869, + "ap-northeast-2": 9.677, + "ap-southeast-1": 0.0, + "ap-southeast-2": 9.917, + "eu-central-1": 0.0, + "eu-north-1": 8.621, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-3": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 9.773, + "us-gov-west-1": 9.773, + "us-west-2": 0.0 + }, + "r5n.large": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.248, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.245, + "ap-southeast-2": 0.248, + "ca-central-1": 0.219, + "eu-central-1": 0.234, + "eu-north-1": 0.215, + "eu-south-1": 0.0, + "eu-west-1": 0.223, + "eu-west-2": 0.231, + "eu-west-3": 0.242, + "sa-east-1": 0.0, + "us-east-1": 0.205, + "us-east-2": 0.205, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.235, + "us-west-1": 0.225, + "us-west-2": 0.205 + }, + "r5n.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.418, + "ap-northeast-2": 0.434, + "ap-south-1": 0.362, + "ap-southeast-1": 0.412, + "ap-southeast-2": 0.418, + "ca-central-1": 0.382, + "eu-central-1": 0.412, + "eu-north-1": 0.0, + "eu-south-1": 0.406, + "eu-west-1": 0.39, + "eu-west-2": 0.406, + "eu-west-3": 0.406, + "sa-east-1": 0.528, + "us-east-1": 0.372, + "us-east-2": 0.354, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.436, + "us-west-1": 0.415, + "us-west-2": 0.0 + }, + "r5n.metal": { + "af-south-1": 0.0, + "ap-east-1": 9.821, + "ap-northeast-1": 8.813, + "ap-northeast-2": 8.669, + "ap-south-1": 7.469, + "ap-southeast-1": 8.669, + "ap-southeast-2": 8.813, + "ca-central-1": 7.949, + "eu-central-1": 8.669, + "eu-north-1": 7.757, + "eu-south-1": 8.526, + "eu-west-1": 8.141, + "eu-west-2": 8.525, + "eu-west-3": 8.525, + "sa-east-1": 11.453, + "us-east-1": 7.277, + "us-east-2": 7.277, + "us-gov-east-1": 8.717, + "us-gov-west-1": 8.717, + "us-west-1": 8.237, + "us-west-2": 7.277 + }, + "r5n.2xlarge": { + "af-south-1": 0.92, + "ap-east-1": 0.933, + "ap-northeast-1": 0.849, + "ap-northeast-2": 0.88, + "ap-south-1": 0.737, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.849, + "ca-central-1": 0.777, + "eu-central-1": 0.837, + "eu-north-1": 0.761, + "eu-south-1": 0.867, + "eu-west-1": 0.793, + "eu-west-2": 0.825, + "eu-west-3": 0.825, + "sa-east-1": 1.126, + "us-east-1": 0.757, + "us-east-2": 0.721, + "us-gov-east-1": 0.841, + "us-gov-west-1": 0.841, + "us-west-1": 0.801, + "us-west-2": 0.721 + }, + "r5n.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.838, + "ap-northeast-1": 1.573, + "ap-northeast-2": 1.634, + "ap-south-1": 1.349, + "ap-southeast-1": 1.549, + "ap-southeast-2": 1.573, + "ca-central-1": 1.429, + "eu-central-1": 1.549, + "eu-north-1": 1.397, + "eu-south-1": 1.525, + "eu-west-1": 1.541, + "eu-west-2": 1.525, + "eu-west-3": 1.609, + "sa-east-1": 0.0, + "us-east-1": 1.317, + "us-east-2": 1.317, + "us-gov-east-1": 1.557, + "us-gov-west-1": 1.643, + "us-west-1": 1.477, + "us-west-2": 1.317 + }, + "r5n.8xlarge": { + "af-south-1": 0.0, + "ap-east-1": 3.357, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.973, + "ap-south-1": 0.0, + "ap-southeast-1": 3.144, + "ap-southeast-2": 3.021, + "ca-central-1": 0.0, + "eu-central-1": 2.973, + "eu-north-1": 2.669, + "eu-south-1": 0.0, + "eu-west-1": 2.957, + "eu-west-2": 2.925, + "eu-west-3": 2.925, + "sa-east-1": 3.901, + "us-east-1": 2.509, + "us-east-2": 2.509, + "us-gov-east-1": 2.989, + "us-gov-west-1": 2.989, + "us-west-1": 2.829, + "us-west-2": 2.509 + }, + "r5n.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.973, + "ap-northeast-1": 4.469, + "ap-northeast-2": 4.397, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.73, + "ca-central-1": 4.272, + "eu-central-1": 4.397, + "eu-north-1": 3.941, + "eu-south-1": 4.325, + "eu-west-1": 4.133, + "eu-west-2": 4.325, + "eu-west-3": 0.0, + "sa-east-1": 5.789, + "us-east-1": 3.701, + "us-east-2": 3.916, + "us-gov-east-1": 4.421, + "us-gov-west-1": 0.0, + "us-west-1": 4.425, + "us-west-2": 3.701 + }, + "r5n.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 6.589, + "ap-northeast-1": 6.265, + "ap-northeast-2": 5.821, + "ap-south-1": 5.021, + "ap-southeast-1": 5.821, + "ap-southeast-2": 5.917, + "ca-central-1": 5.341, + "eu-central-1": 5.821, + "eu-north-1": 5.213, + "eu-south-1": 5.726, + "eu-west-1": 5.469, + "eu-west-2": 0.0, + "eu-west-3": 5.725, + "sa-east-1": 7.677, + "us-east-1": 0.0, + "us-east-2": 4.893, + "us-gov-east-1": 5.853, + "us-gov-west-1": 6.197, + "us-west-1": 5.533, + "us-west-2": 0.0 + }, + "r5n.24xlarge": { + "af-south-1": 9.661, + "ap-east-1": 9.821, + "ap-northeast-1": 0.0, + "ap-northeast-2": 8.669, + "ap-south-1": 7.469, + "ap-southeast-1": 8.669, + "ap-southeast-2": 8.813, + "ca-central-1": 7.949, + "eu-central-1": 8.669, + "eu-north-1": 0.0, + "eu-south-1": 8.526, + "eu-west-1": 8.141, + "eu-west-2": 8.525, + "eu-west-3": 8.525, + "sa-east-1": 0.0, + "us-east-1": 7.277, + "us-east-2": 7.277, + "us-gov-east-1": 0.0, + "us-gov-west-1": 8.717, + "us-west-1": 8.237, + "us-west-2": 0.0 + }, + "r6a.large": { + "ap-northeast-1": 0.20678, + "ap-south-1": 0.0, + "ap-south-2": 0.13495, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1922, + "ca-central-1": 0.1805, + "eu-central-1": 0.20678, + "eu-west-1": 0.1832, + "us-east-1": 0.1697, + "us-east-2": 0.18104, + "us-west-1": 0.1949, + "us-west-2": 0.0 + }, + "r6a.xlarge": { + "ap-northeast-1": 0.3299, + "ap-south-1": 0.0, + "ap-south-2": 0.1993, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.3281, + "ca-central-1": 0.3047, + "eu-central-1": 0.3299, + "eu-west-1": 0.3101, + "us-east-1": 0.2831, + "us-east-2": 0.30578, + "us-west-1": 0.3335, + "us-west-2": 0.0 + }, + "r6a.metal": { + "ap-northeast-1": 0.0, + "ap-south-1": 6.989, + "ap-south-2": 0.0, + "ap-southeast-1": 13.2578, + "ap-southeast-2": 0.0, + "ca-central-1": 12.0482, + "eu-central-1": 13.2578, + "eu-west-1": 12.3074, + "us-east-1": 11.0114, + "us-east-2": 11.0114, + "us-west-1": 12.221, + "us-west-2": 0.0 + }, + "r6a.2xlarge": { + "ap-northeast-1": 0.6722, + "ap-south-1": 0.0, + "ap-south-2": 0.411, + "ap-southeast-1": 0.72692, + "ap-southeast-2": 0.72296, + "ca-central-1": 0.6218, + "eu-central-1": 0.6722, + "eu-west-1": 0.6326, + "us-east-1": 0.0, + "us-east-2": 0.5786, + "us-west-1": 0.629, + "us-west-2": 0.5786 + }, + "r6a.4xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.7542, + "ap-south-2": 0.697, + "ap-southeast-1": 1.2194, + "ap-southeast-2": 1.2122, + "ca-central-1": 1.21796, + "eu-central-1": 1.32884, + "eu-west-1": 0.0, + "us-east-1": 1.0322, + "us-east-2": 1.0322, + "us-west-1": 0.0, + "us-west-2": 1.0322 + }, + "r6a.8xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 1.269, + "ap-south-2": 1.3834, + "ap-southeast-1": 2.3138, + "ap-southeast-2": 2.51684, + "ca-central-1": 0.0, + "eu-central-1": 2.3138, + "eu-west-1": 2.1554, + "us-east-1": 1.9394, + "us-east-2": 1.9394, + "us-west-1": 2.141, + "us-west-2": 0.0 + }, + "r6a.12xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 1.841, + "ap-south-2": 1.841, + "ap-southeast-1": 3.4082, + "ap-southeast-2": 3.3866, + "ca-central-1": 3.1058, + "eu-central-1": 3.4082, + "eu-west-1": 3.1706, + "us-east-1": 2.8466, + "us-east-2": 2.8466, + "us-west-1": 3.149, + "us-west-2": 2.8466 + }, + "r6a.16xlarge": { + "ap-northeast-1": 4.5026, + "ap-south-1": 2.413, + "ap-south-2": 2.413, + "ap-southeast-1": 4.5026, + "ap-southeast-2": 4.4738, + "ca-central-1": 4.0994, + "eu-central-1": 4.5026, + "eu-west-1": 4.1858, + "us-east-1": 3.7538, + "us-east-2": 4.11668, + "us-west-1": 4.157, + "us-west-2": 3.7538 + }, + "r6a.24xlarge": { + "ap-northeast-1": 6.6914, + "ap-south-1": 3.557, + "ap-south-2": 3.557, + "ap-southeast-1": 6.6914, + "ap-southeast-2": 6.6482, + "ca-central-1": 6.0866, + "eu-central-1": 7.34804, + "eu-west-1": 6.82532, + "us-east-1": 5.5682, + "us-east-2": 5.5682, + "us-west-1": 6.7778, + "us-west-2": 6.11252 + }, + "r6a.32xlarge": { + "ap-northeast-1": 8.8802, + "ap-south-1": 4.701, + "ap-south-2": 4.701, + "ap-southeast-1": 8.8802, + "ap-southeast-2": 8.8226, + "ca-central-1": 8.0738, + "eu-central-1": 8.8802, + "eu-west-1": 8.2466, + "us-east-1": 8.10836, + "us-east-2": 7.3826, + "us-west-1": 8.189, + "us-west-2": 7.3826 + }, + "r6a.48xlarge": { + "ap-northeast-1": 13.2578, + "ap-south-1": 0.0, + "ap-south-2": 6.989, + "ap-southeast-1": 13.2578, + "ap-southeast-2": 13.1714, + "ca-central-1": 12.0482, + "eu-central-1": 13.2578, + "eu-west-1": 12.3074, + "us-east-1": 0.0, + "us-east-2": 11.0114, + "us-west-1": 0.0, + "us-west-2": 11.0114 + }, + "r6g.medium": { + "af-south-1": 0.1235, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0918, + "ap-northeast-2": 0.092, + "ap-northeast-3": 0.1171, + "ap-south-1": 0.0, + "ap-south-2": 0.0888, + "ap-southeast-1": 0.0918, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1171, + "ap-southeast-4": 0.1167, + "ap-southeast-5": 0.108, + "ap-southeast-7": 0.108, + "ca-central-1": 0.0862, + "ca-west-1": 0.1115, + "eu-central-1": 0.0918, + "eu-central-2": 0.1232, + "eu-north-1": 0.0845, + "eu-south-1": 0.0938, + "eu-south-2": 0.1127, + "eu-west-1": 0.0874, + "eu-west-2": 0.0, + "eu-west-3": 0.09, + "il-central-1": 0.1155, + "me-central-1": 0.1183, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 0.1114, + "us-east-1": 0.0844, + "us-east-2": 0.0, + "us-gov-east-1": 0.0914, + "us-gov-west-1": 0.095, + "us-west-1": 0.087, + "us-west-2": 0.0 + }, + "r6g.large": { + "af-south-1": 0.1907, + "ap-east-1": 0.1983, + "ap-northeast-1": 0.1852, + "ap-northeast-2": 0.1783, + "ap-northeast-3": 0.1852, + "ap-south-1": 0.1252, + "ap-south-2": 0.1213, + "ap-southeast-1": 0.1852, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1779, + "ap-southeast-4": 0.1843, + "ap-southeast-5": 0.1597, + "ap-southeast-7": 0.0, + "ca-central-1": 0.1667, + "ca-west-1": 0.0, + "eu-central-1": 0.1779, + "eu-central-2": 0.1901, + "eu-north-1": 0.1697, + "eu-south-1": 0.0, + "eu-south-2": 0.1759, + "eu-west-1": 0.0, + "eu-west-2": 0.1747, + "eu-west-3": 0.1743, + "il-central-1": 0.1747, + "me-central-1": 0.1804, + "me-south-1": 0.0, + "mx-central-1": 0.1621, + "sa-east-1": 0.0, + "us-east-1": 0.1571, + "us-east-2": 0.1571, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.1771, + "us-west-1": 0.0, + "us-west-2": 0.1571 + }, + "r6g.xlarge": { + "af-south-1": 0.3251, + "ap-east-1": 0.3403, + "ap-northeast-1": 0.3141, + "ap-northeast-2": 0.3003, + "ap-northeast-3": 0.2995, + "ap-south-1": 0.1863, + "ap-south-2": 0.0, + "ap-southeast-1": 0.2995, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.2995, + "ap-southeast-4": 0.2979, + "ap-southeast-5": 0.2754, + "ap-southeast-7": 0.2754, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.2995, + "eu-central-2": 0.3238, + "eu-north-1": 0.0, + "eu-south-1": 0.3073, + "eu-south-2": 0.2819, + "eu-west-1": 0.2954, + "eu-west-2": 0.2931, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 0.3045, + "me-south-1": 0.0, + "mx-central-1": 0.268, + "sa-east-1": 0.3972, + "us-east-1": 0.2579, + "us-east-2": 0.2579, + "us-gov-east-1": 0.2979, + "us-gov-west-1": 0.2979, + "us-west-1": 0.2937, + "us-west-2": 0.2579 + }, + "r6g.metal": { + "af-south-1": 4.4258, + "ap-east-1": 4.413, + "ap-northeast-1": 4.0162, + "ap-northeast-2": 4.029, + "ap-northeast-3": 4.0162, + "ap-south-1": 2.205, + "ap-south-2": 2.205, + "ap-southeast-1": 4.0162, + "ap-southeast-2": 0.0, + "ap-southeast-3": 4.0162, + "ap-southeast-4": 3.9906, + "ap-southeast-5": 3.4325, + "ap-southeast-7": 3.4325, + "ca-central-1": 3.6578, + "ca-west-1": 0.0, + "eu-central-1": 4.0162, + "eu-central-2": 4.4053, + "eu-north-1": 3.549, + "eu-south-1": 3.9138, + "eu-south-2": 3.7346, + "eu-west-1": 3.7346, + "eu-west-2": 3.9138, + "eu-west-3": 3.901, + "il-central-1": 3.9151, + "me-central-1": 4.0956, + "me-south-1": 4.0956, + "mx-central-1": 0.0, + "sa-east-1": 5.2706, + "us-east-1": 3.3506, + "us-east-2": 3.3506, + "us-gov-east-1": 3.9906, + "us-gov-west-1": 3.9906, + "us-west-1": 3.709, + "us-west-2": 3.3506 + }, + "r6g.2xlarge": { + "af-south-1": 0.6626, + "ap-east-1": 0.693, + "ap-northeast-1": 0.6114, + "ap-northeast-2": 0.613, + "ap-northeast-3": 0.6406, + "ap-south-1": 0.385, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.6082, + "ap-southeast-3": 0.6114, + "ap-southeast-4": 0.6082, + "ap-southeast-5": 0.5384, + "ap-southeast-7": 0.5384, + "ca-central-1": 0.5666, + "ca-west-1": 0.5666, + "eu-central-1": 0.0, + "eu-central-2": 0.6921, + "eu-north-1": 0.553, + "eu-south-1": 0.627, + "eu-south-2": 0.5762, + "eu-west-1": 0.5762, + "eu-west-2": 0.5986, + "eu-west-3": 0.597, + "il-central-1": 0.5988, + "me-central-1": 0.6213, + "me-south-1": 0.6213, + "mx-central-1": 0.5484, + "sa-east-1": 0.8068, + "us-east-1": 0.0, + "us-east-2": 0.5282, + "us-gov-east-1": 0.6082, + "us-gov-west-1": 0.0, + "us-west-1": 0.573, + "us-west-2": 0.0 + }, + "r6g.4xlarge": { + "af-south-1": 0.0, + "ap-east-1": 1.261, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.101, + "ap-northeast-3": 1.0978, + "ap-south-1": 0.645, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.0978, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.9519, + "ap-southeast-7": 1.0015, + "ca-central-1": 1.0082, + "ca-west-1": 1.0082, + "eu-central-1": 1.0978, + "eu-central-2": 1.1951, + "eu-north-1": 1.0322, + "eu-south-1": 1.0722, + "eu-south-2": 1.0274, + "eu-west-1": 1.0274, + "eu-west-2": 0.0, + "eu-west-3": 1.069, + "il-central-1": 1.0725, + "me-central-1": 1.1176, + "me-south-1": 1.1176, + "mx-central-1": 0.9717, + "sa-east-1": 0.0, + "us-east-1": 0.9314, + "us-east-2": 0.9314, + "us-gov-east-1": 1.0914, + "us-gov-west-1": 1.0914, + "us-west-1": 1.0748, + "us-west-2": 0.9798 + }, + "r6g.8xlarge": { + "af-south-1": 2.2754, + "ap-east-1": 2.269, + "ap-northeast-1": 2.0706, + "ap-northeast-2": 2.077, + "ap-northeast-3": 2.0706, + "ap-south-1": 1.165, + "ap-south-2": 1.165, + "ap-southeast-1": 2.0706, + "ap-southeast-2": 2.1738, + "ap-southeast-3": 2.0706, + "ap-southeast-4": 2.1738, + "ap-southeast-5": 1.7788, + "ap-southeast-7": 1.878, + "ca-central-1": 1.8914, + "ca-west-1": 1.8914, + "eu-central-1": 2.0706, + "eu-central-2": 0.0, + "eu-north-1": 1.9394, + "eu-south-1": 2.0194, + "eu-south-2": 1.9298, + "eu-west-1": 1.9298, + "eu-west-2": 2.0194, + "eu-west-3": 2.013, + "il-central-1": 2.02, + "me-central-1": 2.1103, + "me-south-1": 0.0, + "mx-central-1": 1.92, + "sa-east-1": 2.6978, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 2.1738, + "us-gov-west-1": 2.0578, + "us-west-1": 1.917, + "us-west-2": 1.7378 + }, + "r6g.12xlarge": { + "af-south-1": 3.3506, + "ap-east-1": 3.341, + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.053, + "ap-northeast-3": 3.0434, + "ap-south-1": 1.685, + "ap-south-2": 1.685, + "ap-southeast-1": 3.0434, + "ap-southeast-2": 3.0242, + "ap-southeast-3": 3.0434, + "ap-southeast-4": 3.0242, + "ap-southeast-5": 2.6056, + "ap-southeast-7": 0.0, + "ca-central-1": 2.7746, + "ca-west-1": 2.7746, + "eu-central-1": 3.0434, + "eu-central-2": 3.3352, + "eu-north-1": 2.693, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 2.8322, + "eu-west-2": 2.9666, + "eu-west-3": 0.0, + "il-central-1": 3.1381, + "me-central-1": 3.1029, + "me-south-1": 3.1029, + "mx-central-1": 2.6652, + "sa-east-1": 3.9842, + "us-east-1": 0.0, + "us-east-2": 2.5442, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 2.813, + "us-west-2": 2.5442 + }, + "r6g.16xlarge": { + "af-south-1": 4.4258, + "ap-east-1": 4.413, + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.029, + "ap-northeast-3": 4.0162, + "ap-south-1": 2.205, + "ap-south-2": 2.205, + "ap-southeast-1": 4.0162, + "ap-southeast-2": 3.9906, + "ap-southeast-3": 0.0, + "ap-southeast-4": 3.9906, + "ap-southeast-5": 3.4325, + "ap-southeast-7": 3.4325, + "ca-central-1": 3.6578, + "ca-west-1": 3.6578, + "eu-central-1": 4.0162, + "eu-central-2": 0.0, + "eu-north-1": 3.549, + "eu-south-1": 3.9138, + "eu-south-2": 3.7346, + "eu-west-1": 3.7346, + "eu-west-2": 3.9138, + "eu-west-3": 3.901, + "il-central-1": 0.0, + "me-central-1": 4.0956, + "me-south-1": 4.0956, + "mx-central-1": 3.5119, + "sa-east-1": 5.2706, + "us-east-1": 3.3506, + "us-east-2": 3.3506, + "us-gov-east-1": 3.9906, + "us-gov-west-1": 3.9906, + "us-west-1": 3.709, + "us-west-2": 3.3506 + }, + "r6gd.medium": { + "ap-northeast-1": 0.1047, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.1259, + "ap-south-1": 0.0706, + "ap-southeast-1": 0.1047, + "ap-southeast-2": 0.1005, + "ap-southeast-3": 0.13, + "ca-central-1": 0.0942, + "eu-central-1": 0.0, + "eu-central-2": 0.1322, + "eu-north-1": 0.1171, + "eu-south-2": 0.1241, + "eu-west-1": 0.095, + "eu-west-2": 0.1239, + "eu-west-3": 0.0986, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0886, + "us-gov-east-1": 0.1297, + "us-gov-west-1": 0.1297, + "us-west-1": 0.096, + "us-west-2": 0.0886 + }, + "r6gd.large": { + "ap-northeast-1": 0.2037, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.131, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.2037, + "ap-southeast-3": 0.0, + "ca-central-1": 0.1827, + "eu-central-1": 0.0, + "eu-central-2": 0.0, + "eu-north-1": 0.1779, + "eu-south-2": 0.1843, + "eu-west-1": 0.1843, + "eu-west-2": 0.1915, + "eu-west-3": 0.1915, + "sa-east-1": 0.2387, + "us-east-1": 0.1715, + "us-east-2": 0.1784, + "us-gov-east-1": 0.1947, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.1715 + }, + "r6gd.xlarge": { + "ap-northeast-1": 0.3511, + "ap-northeast-2": 0.3331, + "ap-northeast-3": 0.3514, + "ap-south-1": 0.2147, + "ap-southeast-1": 0.3343, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.3511, + "ca-central-1": 0.3091, + "eu-central-1": 0.0, + "eu-central-2": 0.3599, + "eu-north-1": 0.2995, + "eu-south-2": 0.3123, + "eu-west-1": 0.3277, + "eu-west-2": 0.3267, + "eu-west-3": 0.3267, + "sa-east-1": 0.4211, + "us-east-1": 0.3005, + "us-east-2": 0.3005, + "us-gov-east-1": 0.3331, + "us-gov-west-1": 0.3331, + "us-west-1": 0.3163, + "us-west-2": 0.0 + }, + "r6gd.metal": { + "ap-northeast-1": 4.573, + "ap-northeast-2": 4.5538, + "ap-northeast-3": 4.5794, + "ap-south-1": 2.5167, + "ap-southeast-1": 4.573, + "ap-southeast-2": 4.573, + "ap-southeast-3": 0.0, + "ca-central-1": 4.1698, + "eu-central-1": 0.0, + "eu-central-2": 4.9826, + "eu-north-1": 4.0162, + "eu-south-2": 4.221, + "eu-west-1": 4.221, + "eu-west-2": 4.4514, + "eu-west-3": 4.4514, + "sa-east-1": 5.9618, + "us-east-1": 0.0, + "us-east-2": 3.8114, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.5538, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "r6gd.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.6786, + "ap-northeast-3": 0.6818, + "ap-south-1": 0.424, + "ap-southeast-1": 0.681, + "ap-southeast-2": 0.681, + "ap-southeast-3": 0.681, + "ca-central-1": 0.6306, + "eu-central-1": 0.677, + "eu-central-2": 0.0, + "eu-north-1": 0.6114, + "eu-south-2": 0.637, + "eu-west-1": 0.637, + "eu-west-2": 0.6982, + "eu-west-3": 0.0, + "sa-east-1": 0.8546, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.6786, + "us-gov-west-1": 0.6786, + "us-west-1": 0.6762, + "us-west-2": 0.5858 + }, + "r6gd.4xlarge": { + "ap-northeast-1": 1.237, + "ap-northeast-2": 1.2322, + "ap-northeast-3": 1.2386, + "ap-south-1": 0.7229, + "ap-southeast-1": 1.3042, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.237, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 1.4124, + "eu-north-1": 1.0978, + "eu-south-2": 1.149, + "eu-west-1": 1.149, + "eu-west-2": 1.2066, + "eu-west-3": 1.2066, + "sa-east-1": 0.0, + "us-east-1": 1.0466, + "us-east-2": 0.0, + "us-gov-east-1": 1.2322, + "us-gov-west-1": 0.0, + "us-west-1": 1.165, + "us-west-2": 0.0 + }, + "r6gd.8xlarge": { + "ap-northeast-1": 2.349, + "ap-northeast-2": 2.3394, + "ap-northeast-3": 0.0, + "ap-south-1": 1.3208, + "ap-southeast-1": 2.4834, + "ap-southeast-2": 2.349, + "ap-southeast-3": 0.0, + "ca-central-1": 2.1474, + "eu-central-1": 2.333, + "eu-central-2": 2.5538, + "eu-north-1": 0.0, + "eu-south-2": 2.173, + "eu-west-1": 0.0, + "eu-west-2": 2.2882, + "eu-west-3": 2.2882, + "sa-east-1": 3.2185, + "us-east-1": 1.9682, + "us-east-2": 1.9682, + "us-gov-east-1": 2.3394, + "us-gov-west-1": 2.3394, + "us-west-1": 2.205, + "us-west-2": 1.9682 + }, + "r6gd.12xlarge": { + "ap-northeast-1": 3.6626, + "ap-northeast-2": 3.4466, + "ap-northeast-3": 3.4658, + "ap-south-1": 1.9188, + "ap-southeast-1": 3.461, + "ap-southeast-2": 3.461, + "ap-southeast-3": 3.461, + "ca-central-1": 3.1586, + "eu-central-1": 3.437, + "eu-central-2": 3.7682, + "eu-north-1": 3.2185, + "eu-south-2": 3.3813, + "eu-west-1": 0.0, + "eu-west-2": 3.5645, + "eu-west-3": 3.5645, + "sa-east-1": 4.5026, + "us-east-1": 2.8898, + "us-east-2": 2.8898, + "us-gov-east-1": 3.4466, + "us-gov-west-1": 3.4466, + "us-west-1": 0.0, + "us-west-2": 2.8898 + }, + "r6gd.16xlarge": { + "ap-northeast-1": 4.573, + "ap-northeast-2": 4.5538, + "ap-northeast-3": 4.5794, + "ap-south-1": 2.5167, + "ap-southeast-1": 4.573, + "ap-southeast-2": 4.573, + "ap-southeast-3": 0.0, + "ca-central-1": 4.1698, + "eu-central-1": 4.541, + "eu-central-2": 4.9826, + "eu-north-1": 4.0162, + "eu-south-2": 4.221, + "eu-west-1": 4.221, + "eu-west-2": 4.4514, + "eu-west-3": 0.0, + "sa-east-1": 5.9618, + "us-east-1": 3.8114, + "us-east-2": 0.0, + "us-gov-east-1": 4.5538, + "us-gov-west-1": 4.5538, + "us-west-1": 4.285, + "us-west-2": 3.8114 + }, + "r6i.large": { + "af-south-1": 0.2243, + "ap-east-1": 0.2233, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 0.1863, + "ap-south-2": 0.1863, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.2073, + "ap-southeast-5": 0.19842, + "ap-southeast-7": 0.1855, + "ca-central-1": 0.1943, + "ca-west-1": 0.1943, + "eu-central-1": 0.2235, + "eu-central-2": 0.2235, + "eu-north-1": 0.1903, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.2043, + "eu-west-3": 0.0, + "il-central-1": 0.20435, + "me-central-1": 0.2114, + "me-south-1": 0.0, + "mx-central-1": 0.20183, + "sa-east-1": 0.2573, + "us-east-1": 0.1823, + "us-east-2": 0.1823, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.2103, + "us-west-2": 0.1823 + }, + "r6i.xlarge": { + "af-south-1": 0.3923, + "ap-east-1": 0.3903, + "ap-northeast-1": 0.3603, + "ap-northeast-2": 0.3603, + "ap-northeast-3": 0.3603, + "ap-south-1": 0.3163, + "ap-south-2": 0.3163, + "ap-southeast-1": 0.3907, + "ap-southeast-2": 0.3583, + "ap-southeast-5": 0.3147, + "ap-southeast-7": 0.0, + "ca-central-1": 0.3323, + "ca-west-1": 0.3599, + "eu-central-1": 0.3603, + "eu-central-2": 0.3907, + "eu-north-1": 0.3243, + "eu-south-1": 0.3523, + "eu-west-1": 0.3665, + "eu-west-2": 0.3523, + "eu-west-3": 0.3523, + "il-central-1": 0.0, + "me-central-1": 0.39752, + "me-south-1": 0.39752, + "mx-central-1": 0.3209, + "sa-east-1": 0.4583, + "us-east-1": 0.3083, + "us-east-2": 0.3083, + "us-gov-east-1": 0.3583, + "us-gov-west-1": 0.3583, + "us-west-1": 0.3363, + "us-west-2": 0.0 + }, + "r6i.metal": { + "af-south-1": 10.877, + "ap-east-1": 10.813, + "ap-northeast-1": 9.853, + "ap-northeast-2": 9.853, + "ap-northeast-3": 9.853, + "ap-south-1": 0.0, + "ap-south-2": 8.445, + "ap-southeast-1": 9.853, + "ap-southeast-2": 9.789, + "ap-southeast-5": 8.3938, + "ap-southeast-7": 8.3938, + "ca-central-1": 0.0, + "ca-west-1": 8.957, + "eu-central-1": 9.853, + "eu-central-2": 10.8258, + "eu-north-1": 0.0, + "eu-south-1": 9.597, + "eu-west-1": 0.0, + "eu-west-2": 9.597, + "eu-west-3": 0.0, + "il-central-1": 9.6002, + "me-central-1": 10.0514, + "me-south-1": 10.0514, + "mx-central-1": 8.5922, + "sa-east-1": 12.989, + "us-east-1": 8.189, + "us-east-2": 8.189, + "us-gov-east-1": 9.789, + "us-gov-west-1": 9.789, + "us-west-1": 9.085, + "us-west-2": 8.189 + }, + "r6i.2xlarge": { + "af-south-1": 0.8642, + "ap-east-1": 0.8598, + "ap-northeast-1": 0.733, + "ap-northeast-2": 0.733, + "ap-northeast-3": 0.7938, + "ap-south-1": 0.645, + "ap-south-2": 0.645, + "ap-southeast-1": 0.733, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.6418, + "ap-southeast-7": 0.0, + "ca-central-1": 0.677, + "ca-west-1": 0.677, + "eu-central-1": 0.733, + "eu-central-2": 0.86068, + "eu-north-1": 0.661, + "eu-south-1": 0.0, + "eu-west-1": 0.689, + "eu-west-2": 0.717, + "eu-west-3": 0.717, + "il-central-1": 0.7172, + "me-central-1": 0.7454, + "me-south-1": 0.80744, + "mx-central-1": 0.6542, + "sa-east-1": 0.929, + "us-east-1": 0.0, + "us-east-2": 0.629, + "us-gov-east-1": 0.729, + "us-gov-west-1": 0.729, + "us-west-1": 0.685, + "us-west-2": 0.629 + }, + "r6i.4xlarge": { + "af-south-1": 1.469, + "ap-east-1": 1.461, + "ap-northeast-1": 1.341, + "ap-northeast-2": 0.0, + "ap-northeast-3": 1.341, + "ap-south-1": 1.165, + "ap-south-2": 1.165, + "ap-southeast-1": 1.341, + "ap-southeast-2": 1.333, + "ap-southeast-5": 1.1586, + "ap-southeast-7": 0.0, + "ca-central-1": 1.229, + "ca-west-1": 1.3394, + "eu-central-1": 1.341, + "eu-central-2": 1.59636, + "eu-north-1": 0.0, + "eu-south-1": 1.309, + "eu-west-1": 1.3658, + "eu-west-2": 1.309, + "eu-west-3": 1.309, + "il-central-1": 1.3094, + "me-central-1": 1.48988, + "me-south-1": 1.48988, + "mx-central-1": 1.1834, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 1.333, + "us-gov-west-1": 1.4538, + "us-west-1": 0.0, + "us-west-2": 1.2338 + }, + "r6i.8xlarge": { + "af-south-1": 3.0818, + "ap-east-1": 3.0642, + "ap-northeast-1": 2.8002, + "ap-northeast-2": 0.0, + "ap-northeast-3": 2.557, + "ap-south-1": 2.205, + "ap-south-2": 2.205, + "ap-southeast-1": 2.557, + "ap-southeast-2": 2.541, + "ap-southeast-5": 2.1922, + "ap-southeast-7": 0.0, + "ca-central-1": 2.333, + "ca-west-1": 2.333, + "eu-central-1": 2.557, + "eu-central-2": 2.8002, + "eu-north-1": 2.4834, + "eu-south-1": 0.0, + "eu-west-1": 2.381, + "eu-west-2": 2.493, + "eu-west-3": 0.0, + "il-central-1": 2.4938, + "me-central-1": 2.6066, + "me-south-1": 2.6066, + "mx-central-1": 2.2418, + "sa-east-1": 0.0, + "us-east-1": 2.141, + "us-east-2": 2.141, + "us-gov-east-1": 2.7826, + "us-gov-west-1": 2.541, + "us-west-1": 2.365, + "us-west-2": 2.3426 + }, + "r6i.12xlarge": { + "af-south-1": 4.5602, + "ap-east-1": 4.133, + "ap-northeast-1": 4.1378, + "ap-northeast-2": 3.773, + "ap-northeast-3": 3.773, + "ap-south-1": 3.245, + "ap-south-2": 3.245, + "ap-southeast-1": 4.1378, + "ap-southeast-2": 0.0, + "ap-southeast-5": 3.2258, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 3.773, + "eu-central-2": 4.1378, + "eu-north-1": 3.6626, + "eu-south-1": 0.0, + "eu-west-1": 3.509, + "eu-west-2": 4.0322, + "eu-west-3": 4.0322, + "il-central-1": 3.6782, + "me-central-1": 0.0, + "me-south-1": 3.8474, + "mx-central-1": 3.3002, + "sa-east-1": 0.0, + "us-east-1": 3.149, + "us-east-2": 3.149, + "us-gov-east-1": 4.1114, + "us-gov-west-1": 3.749, + "us-west-1": 3.821, + "us-west-2": 3.149 + }, + "r6i.16xlarge": { + "af-south-1": 5.501, + "ap-east-1": 6.0034, + "ap-northeast-1": 5.4754, + "ap-northeast-2": 4.989, + "ap-northeast-3": 0.0, + "ap-south-1": 4.285, + "ap-south-2": 4.285, + "ap-southeast-1": 5.4754, + "ap-southeast-2": 4.957, + "ap-southeast-5": 4.2594, + "ap-southeast-7": 4.67284, + "ca-central-1": 4.541, + "ca-west-1": 4.541, + "eu-central-1": 4.989, + "eu-central-2": 5.4754, + "eu-north-1": 4.413, + "eu-south-1": 0.0, + "eu-west-1": 4.637, + "eu-west-2": 4.861, + "eu-west-3": 0.0, + "il-central-1": 4.8626, + "me-central-1": 5.0882, + "me-south-1": 5.0882, + "mx-central-1": 4.3586, + "sa-east-1": 6.557, + "us-east-1": 4.157, + "us-east-2": 4.157, + "us-gov-east-1": 0.0, + "us-gov-west-1": 4.957, + "us-west-1": 4.605, + "us-west-2": 0.0 + }, + "r6i.24xlarge": { + "af-south-1": 8.189, + "ap-east-1": 8.141, + "ap-northeast-1": 0.0, + "ap-northeast-2": 7.421, + "ap-northeast-3": 0.0, + "ap-south-1": 6.365, + "ap-south-2": 6.989, + "ap-southeast-1": 0.0, + "ap-southeast-2": 7.373, + "ap-southeast-5": 6.94676, + "ap-southeast-7": 6.3266, + "ca-central-1": 7.4114, + "ca-west-1": 6.749, + "eu-central-1": 7.421, + "eu-central-2": 8.95316, + "eu-north-1": 0.0, + "eu-south-1": 7.229, + "eu-west-1": 7.5698, + "eu-west-2": 0.0, + "eu-west-3": 7.229, + "il-central-1": 0.0, + "me-central-1": 7.5698, + "me-south-1": 0.0, + "mx-central-1": 6.4754, + "sa-east-1": 9.773, + "us-east-1": 6.7778, + "us-east-2": 6.7778, + "us-gov-east-1": 0.0, + "us-gov-west-1": 7.373, + "us-west-1": 7.517, + "us-west-2": 0.0 + }, + "r6i.32xlarge": { + "af-south-1": 10.877, + "ap-east-1": 10.813, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 9.853, + "ap-south-1": 8.445, + "ap-south-2": 8.445, + "ap-southeast-1": 9.853, + "ap-southeast-2": 9.789, + "ap-southeast-5": 8.3938, + "ap-southeast-7": 8.3938, + "ca-central-1": 8.957, + "ca-west-1": 8.957, + "eu-central-1": 0.0, + "eu-central-2": 10.8258, + "eu-north-1": 8.701, + "eu-south-1": 9.597, + "eu-west-1": 9.149, + "eu-west-2": 9.597, + "eu-west-3": 9.597, + "il-central-1": 9.6002, + "me-central-1": 10.0514, + "me-south-1": 10.0514, + "mx-central-1": 8.5922, + "sa-east-1": 12.989, + "us-east-1": 8.189, + "us-east-2": 8.189, + "us-gov-east-1": 0.0, + "us-gov-west-1": 9.789, + "us-west-1": 0.0, + "us-west-2": 8.189 + }, + "r6id.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 0.2149, + "ap-southeast-1": 0.25727, + "ap-southeast-2": 0.2303, + "ap-southeast-5": 0.21159, + "ap-southeast-7": 0.22712, + "ca-west-1": 0.0, + "eu-central-1": 0.23795, + "eu-west-1": 0.2243, + "eu-west-2": 0.23375, + "il-central-1": 0.0, + "mx-central-1": 0.23094, + "us-east-1": 0.2075, + "us-east-2": 0.2075, + "us-gov-west-1": 0.25617, + "us-west-2": 0.22262 + }, + "r6id.xlarge": { + "ap-northeast-1": 0.4217, + "ap-northeast-2": 0.4197, + "ap-south-1": 0.3735, + "ap-southeast-1": 0.4217, + "ap-southeast-2": 0.4043, + "ap-southeast-5": 0.39794, + "ap-southeast-7": 0.36688, + "ca-west-1": 0.42128, + "eu-central-1": 0.45593, + "eu-west-1": 0.3923, + "eu-west-2": 0.0, + "il-central-1": 0.4091, + "mx-central-1": 0.37382, + "us-east-1": 0.0, + "us-east-2": 0.3587, + "us-gov-west-1": 0.4197, + "us-west-2": 0.3587 + }, + "r6id.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 11.7538, + "ap-south-1": 10.2754, + "ap-southeast-1": 11.8178, + "ap-southeast-2": 11.261, + "ap-southeast-5": 10.06356, + "ap-southeast-7": 10.06356, + "ca-west-1": 10.7426, + "eu-central-1": 11.7506, + "eu-west-1": 10.877, + "eu-west-2": 11.4818, + "il-central-1": 11.4146, + "mx-central-1": 10.28564, + "us-east-1": 9.8018, + "us-east-2": 9.8018, + "us-gov-west-1": 11.7538, + "us-west-2": 9.8018 + }, + "r6id.2xlarge": { + "ap-northeast-1": 0.8558, + "ap-northeast-2": 0.92448, + "ap-south-1": 0.7594, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.821, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.80828, + "ca-west-1": 0.7886, + "eu-central-1": 0.8516, + "eu-west-1": 0.0, + "eu-west-2": 0.8348, + "il-central-1": 0.8306, + "mx-central-1": 0.76004, + "us-east-1": 0.7298, + "us-east-2": 0.7298, + "us-gov-west-1": 0.92448, + "us-west-2": 0.7298 + }, + "r6id.4xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.5786, + "ap-south-1": 1.3938, + "ap-southeast-1": 1.5866, + "ap-southeast-2": 1.517, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.49155, + "ca-west-1": 1.4522, + "eu-central-1": 0.0, + "eu-west-1": 1.6034, + "eu-west-2": 1.5446, + "il-central-1": 0.0, + "mx-central-1": 1.39508, + "us-east-1": 1.3346, + "us-east-2": 0.0, + "us-gov-west-1": 1.72396, + "us-west-2": 0.0 + }, + "r6id.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 3.0322, + "ap-south-1": 0.0, + "ap-southeast-1": 3.0482, + "ap-southeast-2": 2.909, + "ap-southeast-5": 2.8581, + "ap-southeast-7": 0.0, + "ca-west-1": 2.7794, + "eu-central-1": 3.0314, + "eu-west-1": 2.813, + "eu-west-2": 2.9642, + "il-central-1": 2.9474, + "mx-central-1": 2.66516, + "us-east-1": 2.5442, + "us-east-2": 2.5442, + "us-gov-west-1": 3.0322, + "us-west-2": 2.5442 + }, + "r6id.12xlarge": { + "ap-northeast-1": 4.94828, + "ap-northeast-2": 4.4858, + "ap-south-1": 3.9314, + "ap-southeast-1": 4.5098, + "ap-southeast-2": 4.301, + "ap-southeast-5": 3.85196, + "ap-southeast-7": 0.0, + "ca-west-1": 4.50476, + "eu-central-1": 4.4846, + "eu-west-1": 4.157, + "eu-west-2": 4.3838, + "il-central-1": 4.3586, + "mx-central-1": 3.93524, + "us-east-1": 0.0, + "us-east-2": 3.7538, + "us-gov-west-1": 4.4858, + "us-west-2": 3.7538 + }, + "r6id.16xlarge": { + "ap-northeast-1": 5.9714, + "ap-northeast-2": 5.9394, + "ap-south-1": 5.2002, + "ap-southeast-1": 5.9714, + "ap-southeast-2": 6.2498, + "ap-southeast-5": 5.09428, + "ap-southeast-7": 5.09428, + "ca-west-1": 5.4338, + "eu-central-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 5.8034, + "il-central-1": 0.0, + "mx-central-1": 5.20532, + "us-east-1": 4.9634, + "us-east-2": 4.9634, + "us-gov-west-1": 5.9394, + "us-west-2": 4.9634 + }, + "r6id.24xlarge": { + "ap-northeast-1": 9.77156, + "ap-northeast-2": 8.8466, + "ap-south-1": 8.49908, + "ap-southeast-1": 8.8946, + "ap-southeast-2": 9.3122, + "ap-southeast-5": 7.57892, + "ap-southeast-7": 8.32431, + "ca-west-1": 8.0882, + "eu-central-1": 0.0, + "eu-west-1": 8.189, + "eu-west-2": 9.49436, + "il-central-1": 9.43892, + "mx-central-1": 7.74548, + "us-east-1": 8.10836, + "us-east-2": 7.3826, + "us-gov-west-1": 0.0, + "us-west-2": 7.3826 + }, + "r6id.32xlarge": { + "ap-northeast-1": 11.8178, + "ap-northeast-2": 0.0, + "ap-south-1": 10.2754, + "ap-southeast-1": 11.8178, + "ap-southeast-2": 11.261, + "ap-southeast-5": 10.06356, + "ap-southeast-7": 10.06356, + "ca-west-1": 10.7426, + "eu-central-1": 11.7506, + "eu-west-1": 10.877, + "eu-west-2": 11.4818, + "il-central-1": 11.4146, + "mx-central-1": 0.0, + "us-east-1": 9.8018, + "us-east-2": 9.8018, + "us-gov-west-1": 0.0, + "us-west-2": 9.8018 + }, + "r6idn.large": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.2903, + "ap-southeast-2": 0.29498, + "eu-central-1": 0.28913, + "eu-north-1": 0.26339, + "eu-west-1": 0.0, + "us-east-1": 0.25169, + "us-east-2": 0.25169, + "us-gov-west-1": 0.0, + "us-west-2": 0.0 + }, + "r6idn.xlarge": { + "ap-northeast-1": 0.53132, + "ap-southeast-1": 0.5243, + "ap-southeast-2": 0.53366, + "eu-central-1": 0.0, + "eu-north-1": 0.47048, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.44708, + "us-gov-west-1": 0.52664, + "us-west-2": 0.48616 + }, + "r6idn.metal": { + "ap-northeast-1": 15.32564, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 15.02612, + "eu-north-1": 13.37876, + "eu-west-1": 14.05268, + "us-east-1": 12.62996, + "us-east-2": 12.62996, + "us-gov-west-1": 15.17588, + "us-west-2": 12.62996 + }, + "r6idn.2xlarge": { + "ap-northeast-1": 1.17004, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.07972, + "eu-central-1": 1.05632, + "eu-north-1": 0.95336, + "eu-west-1": 0.99548, + "us-east-1": 0.98472, + "us-east-2": 0.90656, + "us-gov-west-1": 1.06568, + "us-west-2": 0.0 + }, + "r6idn.4xlarge": { + "ap-northeast-1": 2.02508, + "ap-southeast-1": 1.997, + "ap-southeast-2": 2.03444, + "eu-central-1": 1.98764, + "eu-north-1": 0.0, + "eu-west-1": 1.86596, + "us-east-1": 0.0, + "us-east-2": 1.68812, + "us-gov-west-1": 2.00636, + "us-west-2": 1.68812 + }, + "r6idn.8xlarge": { + "ap-northeast-1": 3.92516, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.94388, + "eu-central-1": 3.85028, + "eu-north-1": 0.0, + "eu-west-1": 3.60692, + "us-east-1": 3.56386, + "us-east-2": 3.56386, + "us-gov-west-1": 3.88772, + "us-west-2": 3.25124 + }, + "r6idn.12xlarge": { + "ap-northeast-1": 5.82524, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.85332, + "eu-central-1": 5.71292, + "eu-north-1": 5.09516, + "eu-west-1": 5.34788, + "us-east-1": 4.81436, + "us-east-2": 4.81436, + "us-gov-west-1": 6.33349, + "us-west-2": 4.81436 + }, + "r6idn.16xlarge": { + "ap-northeast-1": 7.72532, + "ap-southeast-1": 0.0, + "ap-southeast-2": 7.76276, + "eu-central-1": 8.32062, + "eu-north-1": 7.41457, + "eu-west-1": 7.08884, + "us-east-1": 7.00273, + "us-east-2": 6.37748, + "us-gov-west-1": 7.65044, + "us-west-2": 6.37748 + }, + "r6idn.24xlarge": { + "ap-northeast-1": 11.52548, + "ap-southeast-1": 11.357, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 10.06532, + "eu-west-1": 11.61534, + "us-east-1": 0.0, + "us-east-2": 9.50372, + "us-gov-west-1": 11.41316, + "us-west-2": 10.44159 + }, + "r6idn.32xlarge": { + "ap-northeast-1": 15.32564, + "ap-southeast-1": 15.101, + "ap-southeast-2": 15.40052, + "eu-central-1": 15.02612, + "eu-north-1": 13.37876, + "eu-west-1": 14.05268, + "us-east-1": 12.62996, + "us-east-2": 0.0, + "us-gov-west-1": 15.17588, + "us-west-2": 0.0 + }, + "r6in.large": { + "ap-northeast-1": 0.28925, + "ap-southeast-1": 0.26456, + "ap-southeast-2": 0.0, + "eu-central-1": 0.26456, + "eu-north-1": 0.24233, + "eu-west-1": 0.0, + "us-east-1": 0.23063, + "us-east-2": 0.23063, + "us-gov-west-1": 0.26573, + "us-west-2": 0.23063 + }, + "r6in.xlarge": { + "ap-northeast-1": 0.47984, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.52219, + "eu-central-1": 0.0, + "eu-north-1": 0.46557, + "eu-west-1": 0.44708, + "us-east-1": 0.40496, + "us-east-2": 0.40496, + "us-gov-west-1": 0.47516, + "us-west-2": 0.43983 + }, + "r6in.metal": { + "ap-northeast-1": 13.67828, + "ap-southeast-1": 13.45364, + "ap-southeast-2": 13.67828, + "eu-central-1": 13.45364, + "eu-north-1": 12.03092, + "eu-west-1": 12.62996, + "us-east-1": 11.28212, + "us-east-2": 11.28212, + "us-gov-west-1": 13.52852, + "us-west-2": 11.28212 + }, + "r6in.2xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.97208, + "eu-central-1": 1.04134, + "eu-north-1": 0.86912, + "eu-west-1": 0.90656, + "us-east-1": 0.82232, + "us-east-2": 0.82232, + "us-gov-west-1": 0.0, + "us-west-2": 0.89205 + }, + "r6in.4xlarge": { + "ap-northeast-1": 1.98858, + "ap-southeast-1": 1.79108, + "ap-southeast-2": 1.81916, + "eu-central-1": 0.0, + "eu-north-1": 1.76206, + "eu-west-1": 0.0, + "us-east-1": 1.51964, + "us-east-2": 1.51964, + "us-gov-west-1": 1.80044, + "us-west-2": 1.6591 + }, + "r6in.8xlarge": { + "ap-northeast-1": 3.85215, + "ap-southeast-1": 3.45716, + "ap-southeast-2": 3.51332, + "eu-central-1": 0.0, + "eu-north-1": 3.10148, + "eu-west-1": 3.25124, + "us-east-1": 3.19321, + "us-east-2": 2.91428, + "us-gov-west-1": 3.47588, + "us-west-2": 2.91428 + }, + "r6in.12xlarge": { + "ap-northeast-1": 5.20748, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.20748, + "eu-central-1": 0.0, + "eu-north-1": 4.58972, + "eu-west-1": 4.81436, + "us-east-1": 4.30892, + "us-east-2": 4.30892, + "us-gov-west-1": 5.15132, + "us-west-2": 4.72731 + }, + "r6in.16xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 6.78932, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 0.0, + "eu-west-1": 6.37748, + "us-east-1": 6.26142, + "us-east-2": 5.70356, + "us-gov-west-1": 0.0, + "us-west-2": 6.26142 + }, + "r6in.24xlarge": { + "ap-northeast-1": 10.28996, + "ap-southeast-1": 10.12148, + "ap-southeast-2": 10.28996, + "eu-central-1": 10.12148, + "eu-north-1": 9.94738, + "eu-west-1": 9.50372, + "us-east-1": 0.0, + "us-east-2": 8.49284, + "us-gov-west-1": 11.1829, + "us-west-2": 0.0 + }, + "r6in.32xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 13.67828, + "eu-central-1": 13.45364, + "eu-north-1": 0.0, + "eu-west-1": 12.62996, + "us-east-1": 11.28212, + "us-east-2": 11.28212, + "us-gov-west-1": 13.52852, + "us-west-2": 11.28212 + }, + "r7a.medium": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.14807, + "eu-north-1": 0.1372, + "eu-south-2": 0.14994, + "eu-west-1": 0.14143, + "us-east-1": 0.13238, + "us-east-2": 0.13998, + "us-west-2": 0.13238 + }, + "r7a.large": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.25819, + "eu-north-1": 0.2181, + "eu-south-2": 0.0, + "eu-west-1": 0.22656, + "us-east-1": 0.20845, + "us-east-2": 0.20845, + "us-west-2": 0.20845 + }, + "r7a.xlarge": { + "ap-northeast-1": 0.42338, + "eu-central-1": 0.46009, + "eu-north-1": 0.3799, + "eu-south-2": 0.0, + "eu-west-1": 0.39682, + "us-east-1": 0.0, + "us-east-2": 0.3606, + "us-west-2": 0.3606 + }, + "r7a.metal-48xl": { + "ap-northeast-1": 17.74484, + "eu-central-1": 17.74484, + "eu-north-1": 15.6578, + "eu-south-2": 16.46996, + "eu-west-1": 0.0, + "us-east-1": 14.7314, + "us-east-2": 0.0, + "us-west-2": 14.7314 + }, + "r7a.2xlarge": { + "ap-northeast-1": 0.93258, + "eu-central-1": 0.85916, + "eu-north-1": 0.7722, + "eu-south-2": 0.80604, + "eu-west-1": 0.0, + "us-east-1": 0.7336, + "us-east-2": 0.0, + "us-west-2": 0.7336 + }, + "r7a.4xlarge": { + "ap-northeast-1": 1.74015, + "eu-central-1": 1.59332, + "eu-north-1": 0.0, + "eu-south-2": 1.48708, + "eu-west-1": 1.62329, + "us-east-1": 1.3422, + "us-east-2": 1.3422, + "us-west-2": 1.3422 + }, + "r7a.8xlarge": { + "ap-northeast-1": 3.06164, + "eu-central-1": 3.3553, + "eu-north-1": 2.7138, + "eu-south-2": 2.84916, + "eu-west-1": 3.12158, + "us-east-1": 2.5594, + "us-east-2": 2.80284, + "us-west-2": 2.5594 + }, + "r7a.12xlarge": { + "ap-northeast-1": 4.52996, + "eu-central-1": 4.52996, + "eu-north-1": 0.0, + "eu-south-2": 4.21124, + "eu-west-1": 4.61986, + "us-east-1": 3.7766, + "us-east-2": 4.14176, + "us-west-2": 4.14176 + }, + "r7a.16xlarge": { + "ap-northeast-1": 5.99828, + "eu-central-1": 5.99828, + "eu-north-1": 5.82036, + "eu-south-2": 5.57332, + "eu-west-1": 6.11815, + "us-east-1": 0.0, + "us-east-2": 5.48068, + "us-west-2": 0.0 + }, + "r7a.24xlarge": { + "ap-northeast-1": 9.81591, + "eu-central-1": 9.81591, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 8.29748, + "us-east-1": 7.4282, + "us-east-2": 7.4282, + "us-west-2": 7.4282 + }, + "r7a.32xlarge": { + "ap-northeast-1": 11.87156, + "eu-central-1": 11.87156, + "eu-north-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 12.1113, + "us-east-1": 10.83636, + "us-east-2": 9.8626, + "us-west-2": 9.8626 + }, + "r7a.48xlarge": { + "ap-northeast-1": 17.74484, + "eu-central-1": 0.0, + "eu-north-1": 15.6578, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "us-east-1": 14.7314, + "us-east-2": 14.7314, + "us-west-2": 14.7314 + }, + "r7g.medium": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.1209, + "ap-south-1": 0.0, + "ap-south-2": 0.0938, + "ap-southeast-1": 0.1209, + "ap-southeast-2": 0.1205, + "ap-southeast-5": 0.1112, + "ap-southeast-7": 0.1112, + "ca-central-1": 0.0, + "eu-central-1": 0.1209, + "eu-north-1": 0.1167, + "eu-south-1": 0.1191, + "eu-south-2": 0.1162, + "eu-west-1": 0.12, + "eu-west-2": 0.1192, + "me-south-1": 0.1222, + "mx-central-1": 0.0, + "sa-east-1": 0.1469, + "us-east-1": 0.1132, + "us-east-2": 0.0, + "us-west-1": 0.1158, + "us-west-2": 0.1099 + }, + "r7g.large": { + "ap-east-1": 0.2072, + "ap-northeast-1": 0.1936, + "ap-northeast-2": 0.1855, + "ap-south-1": 0.1314, + "ap-south-2": 0.1314, + "ap-southeast-1": 0.1855, + "ap-southeast-2": 0.1927, + "ap-southeast-5": 0.1661, + "ap-southeast-7": 0.1661, + "ca-central-1": 0.1736, + "eu-central-1": 0.1855, + "eu-north-1": 0.1702, + "eu-south-1": 0.1818, + "eu-south-2": 0.1761, + "eu-west-1": 0.0, + "eu-west-2": 0.1821, + "me-south-1": 0.1881, + "mx-central-1": 0.1688, + "sa-east-1": 0.2267, + "us-east-1": 0.0, + "us-east-2": 0.1634, + "us-west-1": 0.1828, + "us-west-2": 0.1701 + }, + "r7g.xlarge": { + "ap-east-1": 0.3403, + "ap-northeast-1": 0.3147, + "ap-northeast-2": 0.0, + "ap-south-1": 0.2065, + "ap-south-2": 0.2065, + "ap-southeast-1": 0.331, + "ap-southeast-2": 0.313, + "ap-southeast-5": 0.2898, + "ap-southeast-7": 0.2759, + "ca-central-1": 0.0, + "eu-central-1": 0.331, + "eu-north-1": 0.0, + "eu-south-1": 0.3232, + "eu-south-2": 0.311, + "eu-west-1": 0.296, + "eu-west-2": 0.3079, + "me-south-1": 0.32, + "mx-central-1": 0.2812, + "sa-east-1": 0.3972, + "us-east-1": 0.0, + "us-east-2": 0.2705, + "us-west-1": 0.2943, + "us-west-2": 0.0 + }, + "r7g.metal": { + "ap-east-1": 0.0, + "ap-northeast-1": 4.2594, + "ap-northeast-2": 4.2594, + "ap-south-1": 2.5276, + "ap-south-2": 2.5276, + "ap-southeast-1": 4.2594, + "ap-southeast-2": 4.2325, + "ap-southeast-5": 3.6392, + "ap-southeast-7": 3.6392, + "ca-central-1": 3.8786, + "eu-central-1": 4.2594, + "eu-north-1": 3.7698, + "eu-south-1": 4.1411, + "eu-south-2": 0.0, + "eu-west-1": 3.9602, + "eu-west-2": 0.0, + "me-south-1": 4.3437, + "mx-central-1": 0.0, + "sa-east-1": 5.5791, + "us-east-1": 3.5522, + "us-east-2": 3.5522, + "us-west-1": 3.933, + "us-west-2": 3.5522 + }, + "r7g.2xlarge": { + "ap-east-1": 0.693, + "ap-northeast-1": 0.6418, + "ap-northeast-2": 0.6418, + "ap-south-1": 0.4253, + "ap-south-2": 0.4253, + "ap-southeast-1": 0.6418, + "ap-southeast-2": 0.6384, + "ap-southeast-5": 0.5643, + "ap-southeast-7": 0.5643, + "ca-central-1": 0.0, + "eu-central-1": 0.6744, + "eu-north-1": 0.5806, + "eu-south-1": 0.627, + "eu-south-2": 0.6344, + "eu-west-1": 0.6346, + "eu-west-2": 0.6282, + "me-south-1": 0.6856, + "mx-central-1": 0.5748, + "sa-east-1": 0.8068, + "us-east-1": 0.5534, + "us-east-2": 0.0, + "us-west-1": 0.601, + "us-west-2": 0.5534 + }, + "r7g.4xlarge": { + "ap-east-1": 1.261, + "ap-northeast-1": 1.1586, + "ap-northeast-2": 1.1586, + "ap-south-1": 0.7256, + "ap-south-2": 0.7256, + "ap-southeast-1": 1.1586, + "ap-southeast-2": 1.1519, + "ap-southeast-5": 1.0589, + "ap-southeast-7": 1.0036, + "ca-central-1": 1.0634, + "eu-central-1": 1.1586, + "eu-north-1": 1.0362, + "eu-south-1": 1.129, + "eu-south-2": 0.0, + "eu-west-1": 1.0838, + "eu-west-2": 1.1314, + "me-south-1": 0.0, + "mx-central-1": 1.0247, + "sa-east-1": 1.4885, + "us-east-1": 0.9818, + "us-east-2": 0.0, + "us-west-1": 1.077, + "us-west-2": 1.0358 + }, + "r7g.8xlarge": { + "ap-east-1": 2.397, + "ap-northeast-1": 2.1922, + "ap-northeast-2": 2.1922, + "ap-south-1": 1.3263, + "ap-south-2": 1.4016, + "ap-southeast-1": 2.1922, + "ap-southeast-2": 0.0, + "ap-southeast-5": 1.9928, + "ap-southeast-7": 1.8821, + "ca-central-1": 2.0018, + "eu-central-1": 0.0, + "eu-north-1": 1.9474, + "eu-south-1": 2.2599, + "eu-south-2": 2.1626, + "eu-west-1": 2.0426, + "eu-west-2": 0.0, + "me-south-1": 2.2344, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 1.9466, + "us-east-2": 1.8386, + "us-west-1": 2.029, + "us-west-2": 1.9466 + }, + "r7g.12xlarge": { + "ap-east-1": 3.533, + "ap-northeast-1": 3.2258, + "ap-northeast-2": 0.0, + "ap-south-1": 1.9269, + "ap-south-2": 2.0399, + "ap-southeast-1": 3.2258, + "ap-southeast-2": 3.2056, + "ap-southeast-5": 2.9267, + "ap-southeast-7": 0.0, + "ca-central-1": 3.118, + "eu-central-1": 3.2258, + "eu-north-1": 2.8586, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 3.1442, + "me-south-1": 3.289, + "mx-central-1": 2.824, + "sa-east-1": 4.2156, + "us-east-1": 2.6954, + "us-east-2": 2.6954, + "us-west-1": 2.981, + "us-west-2": 2.6954 + }, + "r7g.16xlarge": { + "ap-east-1": 4.669, + "ap-northeast-1": 4.2594, + "ap-northeast-2": 4.2594, + "ap-south-1": 2.5276, + "ap-south-2": 2.5276, + "ap-southeast-1": 4.2594, + "ap-southeast-2": 0.0, + "ap-southeast-5": 3.6392, + "ap-southeast-7": 3.6392, + "ca-central-1": 3.8786, + "eu-central-1": 4.2594, + "eu-north-1": 3.7698, + "eu-south-1": 4.1411, + "eu-south-2": 3.9586, + "eu-west-1": 3.9602, + "eu-west-2": 4.1506, + "me-south-1": 4.3437, + "mx-central-1": 3.7237, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 3.5522, + "us-west-1": 3.933, + "us-west-2": 3.5522 + }, + "r7gd.medium": { + "ap-east-1": 0.139, + "ap-northeast-1": 0.1434, + "ap-south-1": 0.1003, + "ap-southeast-1": 0.1434, + "ap-southeast-2": 0.1346, + "ap-southeast-3": 0.1385, + "ap-southeast-5": 0.1262, + "ap-southeast-7": 0.1304, + "eu-central-1": 0.0, + "eu-north-1": 0.1281, + "eu-south-2": 0.1364, + "eu-west-1": 0.1319, + "me-central-1": 0.1395, + "mx-central-1": 0.1277, + "us-east-1": 0.1243, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.1328, + "us-west-2": 0.1243 + }, + "r7gd.large": { + "ap-east-1": 0.2217, + "ap-northeast-1": 0.2306, + "ap-south-1": 0.1443, + "ap-southeast-1": 0.2207, + "ap-southeast-2": 0.2129, + "ap-southeast-3": 0.2207, + "ap-southeast-5": 0.2044, + "ap-southeast-7": 0.1961, + "eu-central-1": 0.2198, + "eu-north-1": 0.2086, + "eu-south-2": 0.0, + "eu-west-1": 0.2075, + "me-central-1": 0.2226, + "mx-central-1": 0.1992, + "us-east-1": 0.1924, + "us-east-2": 0.1924, + "us-gov-east-1": 0.2198, + "us-gov-west-1": 0.2198, + "us-west-1": 0.2094, + "us-west-2": 0.1924 + }, + "r7gd.xlarge": { + "ap-east-1": 0.4069, + "ap-northeast-1": 0.3852, + "ap-south-1": 0.0, + "ap-southeast-1": 0.3852, + "ap-southeast-2": 0.3695, + "ap-southeast-3": 0.3851, + "ap-southeast-5": 0.3358, + "ap-southeast-7": 0.0, + "eu-central-1": 0.3833, + "eu-north-1": 0.3608, + "eu-south-2": 0.3587, + "eu-west-1": 0.0, + "me-central-1": 0.4089, + "mx-central-1": 0.3421, + "us-east-1": 0.0, + "us-east-2": 0.3285, + "us-gov-east-1": 0.4029, + "us-gov-west-1": 0.0, + "us-west-1": 0.3809, + "us-west-2": 0.3448 + }, + "r7gd.metal": { + "ap-east-1": 5.4172, + "ap-northeast-1": 5.3868, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.1362, + "ap-southeast-3": 5.3864, + "ap-southeast-5": 0.0, + "ap-southeast-7": 4.5973, + "eu-central-1": 5.3565, + "eu-north-1": 0.0, + "eu-south-2": 4.9634, + "eu-west-1": 4.9634, + "me-central-1": 0.0, + "mx-central-1": 4.6972, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 5.3564, + "us-gov-west-1": 5.3583, + "us-west-1": 5.0239, + "us-west-2": 4.4796 + }, + "r7gd.2xlarge": { + "ap-east-1": 0.7865, + "ap-northeast-1": 0.7827, + "ap-south-1": 0.4981, + "ap-southeast-1": 0.7827, + "ap-southeast-2": 0.7514, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.684, + "ap-southeast-7": 0.0, + "eu-central-1": 0.7789, + "eu-north-1": 0.6996, + "eu-south-2": 0.7298, + "eu-west-1": 0.7661, + "me-central-1": 0.8302, + "mx-central-1": 0.0, + "us-east-1": 0.6693, + "us-east-2": 0.7019, + "us-gov-east-1": 0.7789, + "us-gov-west-1": 0.7792, + "us-west-1": 0.7741, + "us-west-2": 0.6693 + }, + "r7gd.4xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-south-1": 0.829, + "ap-southeast-1": 1.5194, + "ap-southeast-2": 1.3778, + "ap-southeast-3": 0.0, + "ap-southeast-5": 1.2431, + "ap-southeast-7": 1.2431, + "eu-central-1": 0.0, + "eu-north-1": 1.2741, + "eu-south-2": 1.3346, + "eu-west-1": 1.3346, + "me-central-1": 1.4556, + "mx-central-1": 1.268, + "us-east-1": 1.2136, + "us-east-2": 1.2136, + "us-gov-east-1": 1.4328, + "us-gov-west-1": 1.4333, + "us-west-1": 1.4232, + "us-west-2": 1.2788 + }, + "r7gd.8xlarge": { + "ap-east-1": 2.9298, + "ap-northeast-1": 2.7559, + "ap-south-1": 1.533, + "ap-southeast-1": 2.7559, + "ap-southeast-2": 0.0, + "ap-southeast-3": 2.7557, + "ap-southeast-5": 2.4953, + "ap-southeast-7": 2.3612, + "eu-central-1": 2.7408, + "eu-north-1": 2.4232, + "eu-south-2": 2.5442, + "eu-west-1": 2.5442, + "me-central-1": 2.7861, + "mx-central-1": 2.4111, + "us-east-1": 2.3023, + "us-east-2": 2.4326, + "us-gov-east-1": 2.8976, + "us-gov-west-1": 2.7416, + "us-west-1": 2.5744, + "us-west-2": 2.3023 + }, + "r7gd.12xlarge": { + "ap-east-1": 4.0941, + "ap-northeast-1": 4.0713, + "ap-south-1": 2.237, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.1089, + "ap-southeast-3": 4.3078, + "ap-southeast-5": 3.4792, + "ap-southeast-7": 3.6805, + "eu-central-1": 0.0, + "eu-north-1": 3.7792, + "eu-south-2": 3.7538, + "eu-west-1": 3.7538, + "me-central-1": 4.1167, + "mx-central-1": 3.5541, + "us-east-1": 3.3909, + "us-east-2": 3.3909, + "us-gov-east-1": 4.0485, + "us-gov-west-1": 0.0, + "us-west-1": 3.7992, + "us-west-2": 3.3909 + }, + "r7gd.16xlarge": { + "ap-east-1": 5.4172, + "ap-northeast-1": 5.3868, + "ap-south-1": 2.941, + "ap-southeast-1": 5.3868, + "ap-southeast-2": 5.1362, + "ap-southeast-3": 5.3864, + "ap-southeast-5": 4.5973, + "ap-southeast-7": 4.5973, + "eu-central-1": 0.0, + "eu-north-1": 4.7215, + "eu-south-2": 4.9634, + "eu-west-1": 0.0, + "me-central-1": 5.4472, + "mx-central-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 4.4796, + "us-gov-east-1": 5.3564, + "us-gov-west-1": 5.3583, + "us-west-1": 0.0, + "us-west-2": 4.4796 + }, + "r7i.large": { + "ap-northeast-1": 0.2159, + "ap-northeast-2": 0.23186, + "ap-south-1": 0.1928, + "ap-southeast-1": 0.2159, + "ap-southeast-2": 0.21485, + "ap-southeast-3": 0.2159, + "ap-southeast-5": 0.20553, + "ap-southeast-7": 0.19196, + "ca-central-1": 0.21569, + "eu-central-1": 0.2159, + "eu-north-1": 0.21107, + "eu-south-1": 0.2117, + "eu-south-2": 0.20435, + "eu-west-1": 0.20435, + "eu-west-2": 0.2117, + "eu-west-3": 0.0, + "mx-central-1": 0.20911, + "sa-east-1": 0.26735, + "us-east-1": 0.0, + "us-east-2": 0.1886, + "us-gov-east-1": 0.21485, + "us-gov-west-1": 0.21485, + "us-west-1": 0.2033, + "us-west-2": 0.1886 + }, + "r7i.xlarge": { + "ap-northeast-1": 0.3755, + "ap-northeast-2": 0.3755, + "ap-south-1": 0.3293, + "ap-southeast-1": 0.3755, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.3755, + "ap-southeast-5": 0.32762, + "ap-southeast-7": 0.0, + "ca-central-1": 0.3461, + "eu-central-1": 0.3755, + "eu-north-1": 0.3377, + "eu-south-1": 0.0, + "eu-south-2": 0.3524, + "eu-west-1": 0.38201, + "eu-west-2": 0.3671, + "eu-west-3": 0.3671, + "mx-central-1": 0.36192, + "sa-east-1": 0.4784, + "us-east-1": 0.3209, + "us-east-2": 0.34736, + "us-gov-east-1": 0.3734, + "us-gov-west-1": 0.3734, + "us-west-1": 0.3503, + "us-west-2": 0.3209 + }, + "r7i.metal-24xl": { + "ap-northeast-1": 7.7858, + "ap-northeast-2": 7.7858, + "ap-south-1": 6.677, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 7.7858, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-central-1": 7.0802, + "eu-central-1": 7.7858, + "eu-north-1": 6.8786, + "eu-south-1": 0.0, + "eu-south-2": 7.2314, + "eu-west-1": 7.2314, + "eu-west-2": 0.0, + "eu-west-3": 7.5842, + "mx-central-1": 0.0, + "sa-east-1": 10.2554, + "us-east-1": 6.4754, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 7.7354, + "us-west-1": 7.181, + "us-west-2": 7.11044 + }, + "r7i.metal-48xl": { + "ap-northeast-1": 15.4466, + "ap-northeast-2": 15.4466, + "ap-south-1": 13.229, + "ap-southeast-1": 15.4466, + "ap-southeast-2": 15.3458, + "ap-southeast-3": 15.4466, + "ap-southeast-5": 13.14836, + "ap-southeast-7": 13.14836, + "ca-central-1": 14.0354, + "eu-central-1": 15.4466, + "eu-north-1": 13.6322, + "eu-south-1": 15.0434, + "eu-south-2": 14.3378, + "eu-west-1": 14.3378, + "eu-west-2": 0.0, + "eu-west-3": 15.0434, + "mx-central-1": 0.0, + "sa-east-1": 20.3858, + "us-east-1": 12.8258, + "us-east-2": 12.8258, + "us-gov-east-1": 15.3458, + "us-gov-west-1": 15.3458, + "us-west-1": 14.237, + "us-west-2": 12.8258 + }, + "r7i.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.7634, + "ap-south-1": 0.671, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.7592, + "ap-southeast-3": 0.7634, + "ap-southeast-5": 0.66764, + "ap-southeast-7": 0.0, + "ca-central-1": 0.7046, + "eu-central-1": 0.7634, + "eu-north-1": 0.6878, + "eu-south-1": 0.7466, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.7466, + "eu-west-3": 0.7466, + "mx-central-1": 0.68068, + "sa-east-1": 0.9692, + "us-east-1": 0.70712, + "us-east-2": 0.6542, + "us-gov-east-1": 0.82262, + "us-gov-west-1": 0.82262, + "us-west-1": 0.713, + "us-west-2": 0.70712 + }, + "r7i.4xlarge": { + "ap-northeast-1": 1.4018, + "ap-northeast-2": 1.52948, + "ap-south-1": 1.217, + "ap-southeast-1": 1.4018, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.4018, + "ap-southeast-5": 1.31881, + "ap-southeast-7": 1.31881, + "ca-central-1": 1.2842, + "eu-central-1": 1.4018, + "eu-north-1": 1.2506, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 1.42784, + "eu-west-2": 1.3682, + "eu-west-3": 1.3682, + "mx-central-1": 1.23636, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 1.1834, + "us-gov-east-1": 1.3934, + "us-gov-west-1": 1.3934, + "us-west-1": 0.0, + "us-west-2": 1.1834 + }, + "r7i.8xlarge": { + "ap-northeast-1": 2.6786, + "ap-northeast-2": 2.6786, + "ap-south-1": 2.309, + "ap-southeast-1": 2.6786, + "ap-southeast-2": 2.6618, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 2.29556, + "ca-central-1": 2.4434, + "eu-central-1": 2.93396, + "eu-north-1": 0.0, + "eu-south-1": 2.6114, + "eu-south-2": 0.0, + "eu-west-1": 2.4938, + "eu-west-2": 2.86004, + "eu-west-3": 2.6114, + "mx-central-1": 2.56999, + "sa-east-1": 0.0, + "us-east-1": 2.45348, + "us-east-2": 2.2418, + "us-gov-east-1": 2.6618, + "us-gov-west-1": 2.6618, + "us-west-1": 0.0, + "us-west-2": 2.2418 + }, + "r7i.12xlarge": { + "ap-northeast-1": 4.33844, + "ap-northeast-2": 3.9554, + "ap-south-1": 0.0, + "ap-southeast-1": 3.9554, + "ap-southeast-2": 3.9302, + "ap-southeast-3": 4.33844, + "ap-southeast-5": 3.38084, + "ap-southeast-7": 3.38084, + "ca-central-1": 3.95036, + "eu-central-1": 0.0, + "eu-north-1": 3.5018, + "eu-south-1": 3.8546, + "eu-south-2": 0.0, + "eu-west-1": 3.6782, + "eu-west-2": 3.8546, + "eu-west-3": 3.8546, + "mx-central-1": 3.45908, + "sa-east-1": 5.1902, + "us-east-1": 3.3002, + "us-east-2": 3.61772, + "us-gov-east-1": 4.31072, + "us-gov-west-1": 3.9302, + "us-west-1": 3.653, + "us-west-2": 3.3002 + }, + "r7i.16xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.2322, + "ap-south-1": 4.9298, + "ap-southeast-1": 5.2322, + "ap-southeast-2": 5.1986, + "ap-southeast-3": 5.2322, + "ap-southeast-5": 4.90023, + "ap-southeast-7": 0.0, + "ca-central-1": 4.7618, + "eu-central-1": 5.74292, + "eu-north-1": 4.6274, + "eu-south-1": 0.0, + "eu-south-2": 4.8626, + "eu-west-1": 4.8626, + "eu-west-2": 0.0, + "eu-west-3": 5.0978, + "mx-central-1": 5.01498, + "sa-east-1": 6.8786, + "us-east-1": 4.3586, + "us-east-2": 4.78196, + "us-gov-east-1": 5.70596, + "us-gov-west-1": 5.1986, + "us-west-1": 5.2994, + "us-west-2": 4.78196 + }, + "r7i.24xlarge": { + "ap-northeast-1": 7.7858, + "ap-northeast-2": 0.0, + "ap-south-1": 6.677, + "ap-southeast-1": 8.55188, + "ap-southeast-2": 7.7354, + "ap-southeast-3": 8.55188, + "ap-southeast-5": 6.63668, + "ap-southeast-7": 6.63668, + "ca-central-1": 7.0802, + "eu-central-1": 0.0, + "eu-north-1": 6.8786, + "eu-south-1": 7.5842, + "eu-south-2": 7.94204, + "eu-west-1": 7.94204, + "eu-west-2": 0.0, + "eu-west-3": 7.5842, + "mx-central-1": 6.79316, + "sa-east-1": 11.26844, + "us-east-1": 7.11044, + "us-east-2": 7.11044, + "us-gov-east-1": 7.7354, + "us-gov-west-1": 7.7354, + "us-west-1": 7.8866, + "us-west-2": 7.11044 + }, + "r7i.48xlarge": { + "ap-northeast-1": 15.4466, + "ap-northeast-2": 15.4466, + "ap-south-1": 13.229, + "ap-southeast-1": 15.4466, + "ap-southeast-2": 0.0, + "ap-southeast-3": 15.4466, + "ap-southeast-5": 13.14836, + "ap-southeast-7": 13.14836, + "ca-central-1": 14.0354, + "eu-central-1": 15.4466, + "eu-north-1": 13.6322, + "eu-south-1": 15.0434, + "eu-south-2": 14.3378, + "eu-west-1": 14.3378, + "eu-west-2": 15.0434, + "eu-west-3": 15.0434, + "mx-central-1": 13.46132, + "sa-east-1": 20.3858, + "us-east-1": 0.0, + "us-east-2": 12.8258, + "us-gov-east-1": 15.3458, + "us-gov-west-1": 15.3458, + "us-west-1": 14.237, + "us-west-2": 12.8258 + }, + "r7iz.large": { + "ap-northeast-1": 0.2833, + "eu-central-1": 0.2813, + "eu-west-1": 0.2643, + "us-east-1": 0.2423, + "us-east-2": 0.2423, + "us-west-2": 0.2609 + }, + "r7iz.xlarge": { + "ap-northeast-1": 0.5557, + "eu-central-1": 0.5063, + "eu-west-1": 0.4723, + "us-east-1": 0.4283, + "us-east-2": 0.4283, + "us-west-2": 0.0 + }, + "r7iz.metal-16xl": { + "ap-northeast-1": 7.389, + "eu-central-1": 8.045, + "eu-west-1": 6.781, + "us-east-1": 6.077, + "us-east-2": 0.0, + "us-west-2": 6.077 + }, + "r7iz.metal-32xl": { + "ap-northeast-1": 0.0, + "eu-central-1": 14.525, + "eu-west-1": 13.437, + "us-east-1": 12.029, + "us-east-2": 12.029, + "us-west-2": 12.029 + }, + "r7iz.2xlarge": { + "ap-northeast-1": 1.033, + "eu-central-1": 1.025, + "eu-west-1": 0.957, + "us-east-1": 0.869, + "us-east-2": 0.0, + "us-west-2": 0.869 + }, + "r7iz.4xlarge": { + "ap-northeast-1": 1.941, + "eu-central-1": 1.925, + "eu-west-1": 0.0, + "us-east-1": 1.613, + "us-east-2": 1.613, + "us-west-2": 0.0 + }, + "r7iz.8xlarge": { + "ap-northeast-1": 3.757, + "eu-central-1": 4.085, + "eu-west-1": 3.7858, + "us-east-1": 3.101, + "us-east-2": 3.101, + "us-west-2": 3.101 + }, + "r7iz.12xlarge": { + "ap-northeast-1": 5.573, + "eu-central-1": 5.525, + "eu-west-1": 5.117, + "us-east-1": 4.589, + "us-east-2": 5.0354, + "us-west-2": 0.0 + }, + "r7iz.16xlarge": { + "ap-northeast-1": 7.389, + "eu-central-1": 7.325, + "eu-west-1": 6.781, + "us-east-1": 6.077, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "r7iz.32xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 13.437, + "us-east-1": 12.029, + "us-east-2": 13.2194, + "us-west-2": 0.0 + }, + "r8g.medium": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.09759, + "ap-southeast-2": 0.1269, + "eu-central-1": 0.12736, + "eu-north-1": 0.11895, + "eu-south-2": 0.12219, + "eu-west-1": 0.12222, + "us-east-1": 0.1211, + "us-east-2": 0.0, + "us-west-2": 0.11521 + }, + "r8g.large": { + "ap-northeast-1": 0.21263, + "ap-south-1": 0.13888, + "ap-southeast-2": 0.1975, + "eu-central-1": 0.19842, + "eu-north-1": 0.18159, + "eu-south-2": 0.0, + "eu-west-1": 0.18814, + "us-east-1": 0.17412, + "us-east-2": 0.17412, + "us-west-2": 0.17412 + }, + "r8g.xlarge": { + "ap-northeast-1": 0.36896, + "ap-south-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.36896, + "eu-north-1": 0.33194, + "eu-south-2": 0.31986, + "eu-west-1": 0.31998, + "us-east-1": 0.29194, + "us-east-2": 0.29194, + "us-west-2": 0.29194 + }, + "r8g.metal-24xl": { + "ap-northeast-1": 6.94676, + "ap-south-1": 4.08884, + "ap-southeast-2": 7.58036, + "eu-central-1": 0.0, + "eu-north-1": 6.74031, + "eu-south-2": 6.45044, + "eu-west-1": 6.45332, + "us-east-1": 5.78036, + "us-east-2": 5.78036, + "us-west-2": 5.78036 + }, + "r8g.metal-48xl": { + "ap-northeast-1": 13.76852, + "ap-south-1": 8.05268, + "ap-southeast-2": 13.6802, + "eu-central-1": 13.76852, + "eu-north-1": 0.0, + "eu-south-2": 12.77588, + "eu-west-1": 12.78164, + "us-east-1": 11.43572, + "us-east-2": 11.43572, + "us-west-2": 11.43572 + }, + "r8g.2xlarge": { + "ap-northeast-1": 0.69348, + "ap-south-1": 0.45532, + "ap-southeast-2": 0.6898, + "eu-central-1": 0.69348, + "eu-north-1": 0.62616, + "eu-south-2": 0.65212, + "eu-west-1": 0.65236, + "us-east-1": 0.0, + "us-east-2": 0.59628, + "us-west-2": 0.59628 + }, + "r8g.4xlarge": { + "ap-northeast-1": 1.26196, + "ap-south-1": 0.0, + "ap-southeast-2": 1.36756, + "eu-central-1": 1.26196, + "eu-north-1": 1.12732, + "eu-south-2": 1.17924, + "eu-west-1": 1.28519, + "us-east-1": 0.0, + "us-east-2": 1.06756, + "us-west-2": 1.16182 + }, + "r8g.8xlarge": { + "ap-northeast-1": 2.39892, + "ap-south-1": 1.44628, + "ap-southeast-2": 0.0, + "eu-central-1": 2.39892, + "eu-north-1": 2.12964, + "eu-south-2": 2.44433, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.01012, + "us-west-2": 2.01012 + }, + "r8g.12xlarge": { + "ap-northeast-1": 3.53588, + "ap-south-1": 2.10692, + "ap-southeast-2": 0.0, + "eu-central-1": 3.53588, + "eu-north-1": 3.13196, + "eu-south-2": 3.60399, + "eu-west-1": 3.60558, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-2": 2.95268 + }, + "r8g.16xlarge": { + "ap-northeast-1": 4.67284, + "ap-south-1": 2.76756, + "ap-southeast-2": 4.6434, + "eu-central-1": 4.67284, + "eu-north-1": 4.13428, + "eu-south-2": 4.34196, + "eu-west-1": 4.34388, + "us-east-1": 4.27226, + "us-east-2": 3.89524, + "us-west-2": 3.89524 + }, + "r8g.24xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 4.08884, + "ap-southeast-2": 6.9026, + "eu-central-1": 6.94676, + "eu-north-1": 6.13892, + "eu-south-2": 0.0, + "eu-west-1": 7.08615, + "us-east-1": 5.78036, + "us-east-2": 5.78036, + "us-west-2": 6.3459 + }, + "r8g.48xlarge": { + "ap-northeast-1": 13.76852, + "ap-south-1": 0.0, + "ap-southeast-2": 13.6802, + "eu-central-1": 13.76852, + "eu-north-1": 12.15284, + "eu-south-2": 0.0, + "eu-west-1": 12.78164, + "us-east-1": 11.43572, + "us-east-2": 11.43572, + "us-west-2": 0.0 + }, + "t1.micro": { + "ap-northeast-1": 0.026, + "ap-southeast-1": 0.02, + "ap-southeast-2": 0.02, + "eu-west-1": 0.02, + "sa-east-1": 0.027, + "us-east-1": 0.02, + "us-gov-west-1": 0.024, + "us-west-1": 0.025, + "us-west-2": 0.02 + }, + "t2.micro": { + "ap-northeast-1": 0.0152, + "ap-northeast-2": 0.0144, + "ap-northeast-3": 0.0152, + "ap-south-1": 0.0124, + "ap-southeast-1": 0.0146, + "ap-southeast-2": 0.0146, + "ca-central-1": 0.0128, + "eu-central-1": 0.0134, + "eu-west-1": 0.0126, + "eu-west-2": 0.0132, + "eu-west-3": 0.0132, + "sa-east-1": 0.0186, + "us-east-1": 0.0116, + "us-east-2": 0.0116, + "us-gov-west-1": 0.0136, + "us-west-1": 0.0138, + "us-west-2": 0.0116 + }, + "t2.small": { + "ap-northeast-1": 0.0604, + "ap-northeast-2": 0.0588, + "ap-northeast-3": 0.0604, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0592, + "ap-southeast-2": 0.0592, + "ca-central-1": 0.0556, + "eu-central-1": 0.0568, + "eu-west-1": 0.055, + "eu-west-2": 0.056, + "eu-west-3": 0.0564, + "sa-east-1": 0.0672, + "us-east-1": 0.053, + "us-east-2": 0.053, + "us-gov-west-1": 0.0572, + "us-west-1": 0.0576, + "us-west-2": 0.053 + }, + "t2.medium": { + "ap-northeast-1": 0.1608, + "ap-northeast-2": 0.1576, + "ap-northeast-3": 0.1608, + "ap-south-1": 0.1496, + "ap-southeast-1": 0.1584, + "ap-southeast-2": 0.1584, + "ca-central-1": 0.1512, + "eu-central-1": 0.1536, + "eu-west-1": 0.15, + "eu-west-2": 0.152, + "eu-west-3": 0.1528, + "sa-east-1": 0.1744, + "us-east-1": 0.1464, + "us-east-2": 0.1464, + "us-gov-west-1": 0.1544, + "us-west-1": 0.1552, + "us-west-2": 0.1464 + }, + "t2.large": { + "ap-northeast-1": 0.2216, + "ap-northeast-2": 0.2152, + "ap-northeast-3": 0.2216, + "ap-south-1": 0.0, + "ap-southeast-1": 0.2168, + "ap-southeast-2": 0.2168, + "ca-central-1": 0.2024, + "eu-central-1": 0.2072, + "eu-west-1": 0.2008, + "eu-west-2": 0.2056, + "eu-west-3": 0.2056, + "sa-east-1": 0.2488, + "us-east-1": 0.1928, + "us-east-2": 0.1928, + "us-gov-west-1": 0.2088, + "us-west-1": 0.2104, + "us-west-2": 0.1928 + }, + "t2.xlarge": { + "ap-northeast-1": 0.3432, + "ap-northeast-2": 0.3304, + "ap-northeast-3": 0.3432, + "ap-south-1": 0.2984, + "ap-southeast-1": 0.3336, + "ap-southeast-2": 0.3336, + "ca-central-1": 0.3048, + "eu-central-1": 0.3144, + "eu-west-1": 0.3016, + "eu-west-2": 0.3112, + "eu-west-3": 0.3112, + "sa-east-1": 0.3976, + "us-east-1": 0.2856, + "us-east-2": 0.2856, + "us-gov-west-1": 0.3176, + "us-west-1": 0.3208, + "us-west-2": 0.2856 + }, + "t2.nano": { + "ap-northeast-1": 0.0076, + "ap-northeast-2": 0.0072, + "ap-northeast-3": 0.0076, + "ap-south-1": 0.0062, + "ap-southeast-1": 0.0073, + "ap-southeast-2": 0.0073, + "ca-central-1": 0.0064, + "eu-central-1": 0.0067, + "eu-west-1": 0.0063, + "eu-west-2": 0.0066, + "eu-west-3": 0.0066, + "sa-east-1": 0.0093, + "us-east-1": 0.0058, + "us-east-2": 0.0058, + "us-gov-west-1": 0.0068, + "us-west-1": 0.0069, + "us-west-2": 0.0058 + }, + "t2.2xlarge": { + "ap-northeast-1": 0.5864, + "ap-northeast-2": 0.5608, + "ap-northeast-3": 0.5864, + "ap-south-1": 0.4968, + "ap-southeast-1": 0.5672, + "ap-southeast-2": 0.5672, + "ca-central-1": 0.5096, + "eu-central-1": 0.5288, + "eu-west-1": 0.5032, + "eu-west-2": 0.5224, + "eu-west-3": 0.0, + "sa-east-1": 0.6952, + "us-east-1": 0.4712, + "us-east-2": 0.4712, + "us-gov-west-1": 0.5352, + "us-west-1": 0.5416, + "us-west-2": 0.4712 + }, + "t3.micro": { + "af-south-1": 0.0144, + "ap-east-1": 0.0146, + "ap-northeast-1": 0.0144, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0144, + "ap-south-1": 0.0119, + "ap-south-2": 0.0112, + "ap-southeast-1": 0.0132, + "ap-southeast-2": 0.0132, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0132, + "ap-southeast-5": 0.0119, + "ap-southeast-7": 0.0119, + "ca-central-1": 0.0, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.0132, + "eu-north-1": 0.0108, + "eu-south-1": 0.012, + "eu-south-2": 0.0, + "eu-west-1": 0.0114, + "eu-west-2": 0.0118, + "eu-west-3": 0.0118, + "il-central-1": 0.0127, + "me-central-1": 0.0125, + "me-south-1": 0.0125, + "mx-central-1": 0.0109, + "sa-east-1": 0.0177, + "us-east-1": 0.0104, + "us-east-2": 0.0104, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0124, + "us-west-2": 0.0104, + "us-west-2-lax-1": 0.0125 + }, + "t3.small": { + "af-south-1": 0.0, + "ap-east-1": 0.0602, + "ap-northeast-1": 0.0582, + "ap-northeast-2": 0.0585, + "ap-northeast-3": 0.0582, + "ap-south-1": 0.0534, + "ap-south-2": 0.0537, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0574, + "ap-southeast-3": 0.0574, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.0551, + "ap-southeast-7": 0.0551, + "ca-central-1": 0.0542, + "ca-west-1": 0.0545, + "eu-central-1": 0.055, + "eu-central-2": 0.0577, + "eu-north-1": 0.0526, + "eu-south-1": 0.055, + "eu-south-2": 0.0541, + "eu-west-1": 0.0538, + "eu-west-2": 0.0546, + "eu-west-3": 0.0546, + "il-central-1": 0.0553, + "me-central-1": 0.0, + "me-south-1": 0.0561, + "mx-central-1": 0.0531, + "sa-east-1": 0.0646, + "us-east-1": 0.0, + "us-east-2": 0.053, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0575, + "us-west-2": 0.053, + "us-west-2-lax-1": 0.056 + }, + "t3.medium": { + "af-south-1": 0.1138, + "ap-east-1": 0.1147, + "ap-northeast-1": 0.1107, + "ap-northeast-2": 0.1083, + "ap-northeast-3": 0.1107, + "ap-south-1": 0.1011, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.1091, + "ap-southeast-4": 0.1091, + "ap-southeast-5": 0.1038, + "ap-southeast-7": 0.1038, + "ca-central-1": 0.1027, + "ca-west-1": 0.1027, + "eu-central-1": 0.1043, + "eu-central-2": 0.1091, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.1019, + "eu-west-1": 0.1019, + "eu-west-2": 0.1035, + "eu-west-3": 0.1035, + "il-central-1": 0.1071, + "me-central-1": 0.1065, + "me-south-1": 0.0, + "mx-central-1": 0.1, + "sa-east-1": 0.0, + "us-east-1": 0.0979, + "us-east-2": 0.0979, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0979, + "us-west-2-lax-1": 0.1062 + }, + "t3.large": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.1651, + "ap-northeast-2": 0.1603, + "ap-northeast-3": 0.0, + "ap-south-1": 0.1459, + "ap-south-2": 0.1459, + "ap-southeast-1": 0.1619, + "ap-southeast-2": 0.1619, + "ap-southeast-3": 0.1619, + "ap-southeast-4": 0.1682, + "ap-southeast-5": 0.1513, + "ap-southeast-7": 0.1513, + "ca-central-1": 0.1491, + "ca-west-1": 0.1491, + "eu-central-1": 0.1523, + "eu-central-2": 0.0, + "eu-north-1": 0.1427, + "eu-south-1": 0.1579, + "eu-south-2": 0.1475, + "eu-west-1": 0.0, + "eu-west-2": 0.1507, + "eu-west-3": 0.1507, + "il-central-1": 0.1521, + "me-central-1": 0.1566, + "me-south-1": 0.0, + "mx-central-1": 0.1437, + "sa-east-1": 0.1981, + "us-east-1": 0.1395, + "us-east-2": 0.1395, + "us-gov-east-1": 0.1539, + "us-gov-west-1": 0.0, + "us-west-1": 0.1555, + "us-west-2": 0.1395, + "us-west-2-lax-1": 0.1561 + }, + "t3.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.2899, + "ap-northeast-1": 0.2739, + "ap-northeast-2": 0.2763, + "ap-northeast-3": 0.2739, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.2675, + "ap-southeast-2": 0.2675, + "ap-southeast-3": 0.2675, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.2464, + "ap-southeast-7": 0.2464, + "ca-central-1": 0.2419, + "ca-west-1": 0.0, + "eu-central-1": 0.2483, + "eu-central-2": 0.2675, + "eu-north-1": 0.2291, + "eu-south-1": 0.248, + "eu-south-2": 0.0, + "eu-west-1": 0.2387, + "eu-west-2": 0.2451, + "eu-west-3": 0.2451, + "il-central-1": 0.248, + "me-central-1": 0.0, + "me-south-1": 0.2569, + "mx-central-1": 0.231, + "sa-east-1": 0.3251, + "us-east-1": 0.0, + "us-east-2": 0.2227, + "us-gov-east-1": 0.2515, + "us-gov-west-1": 0.2515, + "us-west-1": 0.2547, + "us-west-2": 0.2326, + "us-west-2-lax-1": 0.256 + }, + "t3.nano": { + "af-south-1": 0.0068, + "ap-east-1": 0.0073, + "ap-northeast-1": 0.0068, + "ap-northeast-2": 0.0065, + "ap-northeast-3": 0.0068, + "ap-south-1": 0.0056, + "ap-south-2": 0.0056, + "ap-southeast-1": 0.0066, + "ap-southeast-2": 0.0066, + "ap-southeast-3": 0.0066, + "ap-southeast-4": 0.0066, + "ap-southeast-5": 0.0059, + "ap-southeast-7": 0.0059, + "ca-central-1": 0.0058, + "ca-west-1": 0.0058, + "eu-central-1": 0.006, + "eu-central-2": 0.0066, + "eu-north-1": 0.0054, + "eu-south-1": 0.006, + "eu-south-2": 0.0057, + "eu-west-1": 0.0057, + "eu-west-2": 0.0, + "eu-west-3": 0.0059, + "il-central-1": 0.006, + "me-central-1": 0.0, + "me-south-1": 0.0063, + "mx-central-1": 0.0055, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0061, + "us-west-1": 0.0062, + "us-west-2": 0.0052, + "us-west-2-lax-1": 0.0062 + }, + "t3.2xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.5922, + "ap-northeast-1": 0.5602, + "ap-northeast-2": 0.541, + "ap-northeast-3": 0.5602, + "ap-south-1": 0.5049, + "ap-south-2": 0.4834, + "ap-southeast-1": 0.5474, + "ap-southeast-2": 0.5474, + "ap-southeast-3": 0.5474, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.5052, + "ap-southeast-7": 0.5052, + "ca-central-1": 0.4962, + "ca-west-1": 0.4962, + "eu-central-1": 0.532, + "eu-central-2": 0.0, + "eu-north-1": 0.4706, + "eu-south-1": 0.5084, + "eu-south-2": 0.4898, + "eu-west-1": 0.5117, + "eu-west-2": 0.0, + "eu-west-3": 0.5253, + "il-central-1": 0.5084, + "me-central-1": 0.5263, + "me-south-1": 0.5263, + "mx-central-1": 0.4744, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.4578, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.5154, + "us-west-1": 0.5218, + "us-west-2": 0.4578, + "us-west-2-lax-1": 0.5244 + }, + "t3a.micro": { + "ap-northeast-1": 0.0122, + "ap-northeast-2": 0.0117, + "ap-south-1": 0.0062, + "ap-southeast-1": 0.0118, + "ap-southeast-2": 0.0119, + "ca-central-1": 0.0104, + "eu-central-1": 0.0108, + "eu-south-1": 0.0108, + "eu-west-1": 0.0102, + "eu-west-2": 0.0106, + "eu-west-3": 0.0106, + "il-central-1": 0.0107, + "sa-east-1": 0.0151, + "us-east-1": 0.0094, + "us-east-2": 0.0094, + "us-gov-east-1": 0.011, + "us-gov-west-1": 0.011, + "us-west-1": 0.0112, + "us-west-2": 0.0094 + }, + "t3a.small": { + "ap-northeast-1": 0.0555, + "ap-northeast-2": 0.0544, + "ap-south-1": 0.0433, + "ap-southeast-1": 0.0546, + "ap-southeast-2": 0.0548, + "ca-central-1": 0.0519, + "eu-central-1": 0.0526, + "eu-south-1": 0.0526, + "eu-west-1": 0.0514, + "eu-west-2": 0.0522, + "eu-west-3": 0.0522, + "il-central-1": 0.0527, + "sa-east-1": 0.0612, + "us-east-1": 0.0498, + "us-east-2": 0.0498, + "us-gov-east-1": 0.053, + "us-gov-west-1": 0.053, + "us-west-1": 0.0533, + "us-west-2": 0.0498 + }, + "t3a.medium": { + "ap-northeast-1": 0.1053, + "ap-northeast-2": 0.1031, + "ap-south-1": 0.0809, + "ap-southeast-1": 0.1035, + "ap-southeast-2": 0.1038, + "ca-central-1": 0.0981, + "eu-central-1": 0.0995, + "eu-south-1": 0.0994, + "eu-west-1": 0.0971, + "eu-west-2": 0.0988, + "eu-west-3": 0.0988, + "il-central-1": 0.0992, + "sa-east-1": 0.1168, + "us-east-1": 0.0939, + "us-east-2": 0.0939, + "us-gov-east-1": 0.1002, + "us-gov-west-1": 0.1002, + "us-west-1": 0.1009, + "us-west-2": 0.0939 + }, + "t3a.large": { + "ap-northeast-1": 0.1542, + "ap-northeast-2": 0.1499, + "ap-south-1": 0.1056, + "ap-southeast-1": 0.1507, + "ap-southeast-2": 0.1513, + "ca-central-1": 0.1398, + "eu-central-1": 0.1427, + "eu-south-1": 0.1425, + "eu-west-1": 0.1379, + "eu-west-2": 0.1413, + "eu-west-3": 0.1413, + "il-central-1": 0.1421, + "sa-east-1": 0.1773, + "us-east-1": 0.1315, + "us-east-2": 0.1315, + "us-gov-east-1": 0.1441, + "us-gov-west-1": 0.1441, + "us-west-1": 0.1456, + "us-west-2": 0.1315 + }, + "t3a.xlarge": { + "ap-northeast-1": 0.2521, + "ap-northeast-2": 0.2435, + "ap-south-1": 0.1549, + "ap-southeast-1": 0.2451, + "ap-southeast-2": 0.2464, + "ca-central-1": 0.2233, + "eu-central-1": 0.2291, + "eu-south-1": 0.2288, + "eu-west-1": 0.2195, + "eu-west-2": 0.2262, + "eu-west-3": 0.2262, + "il-central-1": 0.2278, + "sa-east-1": 0.2982, + "us-east-1": 0.2067, + "us-east-2": 0.2067, + "us-gov-east-1": 0.232, + "us-gov-west-1": 0.232, + "us-west-1": 0.2349, + "us-west-2": 0.2067 + }, + "t3a.nano": { + "ap-northeast-1": 0.0061, + "ap-northeast-2": 0.0059, + "ap-south-1": 0.0031, + "ap-southeast-1": 0.0059, + "ap-southeast-2": 0.0059, + "ca-central-1": 0.0052, + "eu-central-1": 0.0054, + "eu-south-1": 0.0054, + "eu-west-1": 0.0051, + "eu-west-2": 0.0053, + "eu-west-3": 0.0053, + "il-central-1": 0.0054, + "sa-east-1": 0.0076, + "us-east-1": 0.0047, + "us-east-2": 0.0047, + "us-gov-east-1": 0.0055, + "us-gov-west-1": 0.0055, + "us-west-1": 0.0056, + "us-west-2": 0.0047 + }, + "t3a.2xlarge": { + "ap-northeast-1": 0.5167, + "ap-northeast-2": 0.4994, + "ap-south-1": 0.3221, + "ap-southeast-1": 0.5026, + "ap-southeast-2": 0.5052, + "ca-central-1": 0.4591, + "eu-central-1": 0.4706, + "eu-south-1": 0.47, + "eu-west-1": 0.4514, + "eu-west-2": 0.4648, + "eu-west-3": 0.4648, + "il-central-1": 0.468, + "sa-east-1": 0.6088, + "us-east-1": 0.4258, + "us-east-2": 0.4258, + "us-gov-east-1": 0.4764, + "us-gov-west-1": 0.4764, + "us-west-1": 0.4821, + "us-west-2": 0.4258 + }, + "t4g.micro": { + "af-south-1": 0.0108, + "ap-east-1": 0.0116, + "ap-northeast-1": 0.0108, + "ap-northeast-2": 0.0104, + "ap-northeast-3": 0.0109, + "ap-south-1": 0.0056, + "ap-south-2": 0.0056, + "ap-southeast-1": 0.0106, + "ap-southeast-2": 0.0106, + "ap-southeast-3": 0.0106, + "ap-southeast-4": 0.0106, + "ap-southeast-5": 0.0095, + "ap-southeast-7": 0.0095, + "ca-central-1": 0.0092, + "ca-west-1": 0.0092, + "eu-central-1": 0.0096, + "eu-central-2": 0.0106, + "eu-north-1": 0.0086, + "eu-south-1": 0.0096, + "eu-south-2": 0.0092, + "eu-west-1": 0.0092, + "eu-west-2": 0.0094, + "eu-west-3": 0.0094, + "il-central-1": 0.0097, + "me-central-1": 0.0102, + "me-south-1": 0.01, + "mx-central-1": 0.0088, + "sa-east-1": 0.0134, + "us-east-1": 0.0084, + "us-east-2": 0.0084, + "us-gov-east-1": 0.0098, + "us-gov-west-1": 0.0098, + "us-west-1": 0.01, + "us-west-2": 0.0084 + }, + "t4g.small": { + "af-south-1": 0.053, + "ap-east-1": 0.0545, + "ap-northeast-1": 0.0529, + "ap-northeast-2": 0.0521, + "ap-northeast-3": 0.0531, + "ap-south-1": 0.0425, + "ap-south-2": 0.0425, + "ap-southeast-1": 0.0525, + "ap-southeast-2": 0.0525, + "ap-southeast-3": 0.0525, + "ap-southeast-4": 0.0525, + "ap-southeast-5": 0.0504, + "ap-southeast-7": 0.0504, + "ca-central-1": 0.0497, + "ca-west-1": 0.0497, + "eu-central-1": 0.0505, + "eu-central-2": 0.0524, + "eu-north-1": 0.0485, + "eu-south-1": 0.0505, + "eu-south-2": 0.0497, + "eu-west-1": 0.0497, + "eu-west-2": 0.0501, + "eu-west-3": 0.0501, + "il-central-1": 0.0506, + "me-central-1": 0.0517, + "me-south-1": 0.0514, + "mx-central-1": 0.0489, + "sa-east-1": 0.0581, + "us-east-1": 0.0481, + "us-east-2": 0.0481, + "us-gov-east-1": 0.0509, + "us-gov-west-1": 0.0509, + "us-west-1": 0.0513, + "us-west-2": 0.0481 + }, + "t4g.medium": { + "af-south-1": 0.0997, + "ap-east-1": 0.1027, + "ap-northeast-1": 0.0995, + "ap-northeast-2": 0.0979, + "ap-northeast-3": 0.0998, + "ap-south-1": 0.0787, + "ap-south-2": 0.0787, + "ap-southeast-1": 0.0987, + "ap-southeast-2": 0.0987, + "ap-southeast-3": 0.0987, + "ap-southeast-4": 0.0987, + "ap-southeast-5": 0.0945, + "ap-southeast-7": 0.0945, + "ca-central-1": 0.0931, + "ca-west-1": 0.0931, + "eu-central-1": 0.0947, + "eu-central-2": 0.0985, + "eu-north-1": 0.0907, + "eu-south-1": 0.0947, + "eu-south-2": 0.0931, + "eu-west-1": 0.0931, + "eu-west-2": 0.0939, + "eu-west-3": 0.0939, + "il-central-1": 0.0949, + "me-central-1": 0.0971, + "me-south-1": 0.0965, + "mx-central-1": 0.0916, + "sa-east-1": 0.1099, + "us-east-1": 0.0899, + "us-east-2": 0.0899, + "us-gov-east-1": 0.0955, + "us-gov-west-1": 0.0955, + "us-west-1": 0.0963, + "us-west-2": 0.0899 + }, + "t4g.large": { + "af-south-1": 0.143, + "ap-east-1": 0.1491, + "ap-northeast-1": 0.1427, + "ap-northeast-2": 0.1395, + "ap-northeast-3": 0.1433, + "ap-south-1": 0.1011, + "ap-south-2": 0.1011, + "ap-southeast-1": 0.1411, + "ap-southeast-2": 0.1411, + "ap-southeast-3": 0.1411, + "ap-southeast-4": 0.1411, + "ap-southeast-5": 0.1326, + "ap-southeast-7": 0.1326, + "ca-central-1": 0.1299, + "ca-west-1": 0.1299, + "eu-central-1": 0.1331, + "eu-central-2": 0.1408, + "eu-north-1": 0.1251, + "eu-south-1": 0.1331, + "eu-south-2": 0.1299, + "eu-west-1": 0.1299, + "eu-west-2": 0.1315, + "eu-west-3": 0.1315, + "il-central-1": 0.1336, + "me-central-1": 0.1379, + "me-south-1": 0.1366, + "mx-central-1": 0.1269, + "sa-east-1": 0.1635, + "us-east-1": 0.1235, + "us-east-2": 0.1235, + "us-gov-east-1": 0.1347, + "us-gov-west-1": 0.1347, + "us-west-1": 0.1363, + "us-west-2": 0.1235 + }, + "t4g.xlarge": { + "af-south-1": 0.2297, + "ap-east-1": 0.2419, + "ap-northeast-1": 0.2291, + "ap-northeast-2": 0.2227, + "ap-northeast-3": 0.2304, + "ap-south-1": 0.1459, + "ap-south-2": 0.1459, + "ap-southeast-1": 0.2259, + "ap-southeast-2": 0.2259, + "ap-southeast-3": 0.2259, + "ap-southeast-4": 0.2259, + "ap-southeast-5": 0.2089, + "ap-southeast-7": 0.2089, + "ca-central-1": 0.2035, + "ca-west-1": 0.2035, + "eu-central-1": 0.2099, + "eu-central-2": 0.2253, + "eu-north-1": 0.1939, + "eu-south-1": 0.2099, + "eu-south-2": 0.2035, + "eu-west-1": 0.2035, + "eu-west-2": 0.2067, + "eu-west-3": 0.2067, + "il-central-1": 0.2109, + "me-central-1": 0.2195, + "me-south-1": 0.2169, + "mx-central-1": 0.1974, + "sa-east-1": 0.2707, + "us-east-1": 0.1907, + "us-east-2": 0.1907, + "us-gov-east-1": 0.2131, + "us-gov-west-1": 0.2131, + "us-west-1": 0.2163, + "us-west-2": 0.1907 + }, + "t4g.nano": { + "af-south-1": 0.0054, + "ap-east-1": 0.0058, + "ap-northeast-1": 0.0054, + "ap-northeast-2": 0.0052, + "ap-northeast-3": 0.0054, + "ap-south-1": 0.0028, + "ap-south-2": 0.0028, + "ap-southeast-1": 0.0053, + "ap-southeast-2": 0.0053, + "ap-southeast-3": 0.0053, + "ap-southeast-4": 0.0053, + "ap-southeast-5": 0.0048, + "ap-southeast-7": 0.0048, + "ca-central-1": 0.0046, + "ca-west-1": 0.0046, + "eu-central-1": 0.0048, + "eu-central-2": 0.0053, + "eu-north-1": 0.0043, + "eu-south-1": 0.0048, + "eu-south-2": 0.0046, + "eu-west-1": 0.0046, + "eu-west-2": 0.0047, + "eu-west-3": 0.0047, + "il-central-1": 0.0048, + "me-central-1": 0.0051, + "me-south-1": 0.005, + "mx-central-1": 0.0044, + "sa-east-1": 0.0067, + "us-east-1": 0.0042, + "us-east-2": 0.0042, + "us-gov-east-1": 0.0049, + "us-gov-west-1": 0.0049, + "us-west-1": 0.005, + "us-west-2": 0.0042 + }, + "t4g.2xlarge": { + "af-south-1": 0.4719, + "ap-east-1": 0.4962, + "ap-northeast-1": 0.4706, + "ap-northeast-2": 0.4578, + "ap-northeast-3": 0.4732, + "ap-south-1": 0.3042, + "ap-south-2": 0.3042, + "ap-southeast-1": 0.4642, + "ap-southeast-2": 0.4642, + "ap-southeast-3": 0.4642, + "ap-southeast-4": 0.4642, + "ap-southeast-5": 0.4303, + "ap-southeast-7": 0.4303, + "ca-central-1": 0.4194, + "ca-west-1": 0.4194, + "eu-central-1": 0.4322, + "eu-central-2": 0.4629, + "eu-north-1": 0.4002, + "eu-south-1": 0.4322, + "eu-south-2": 0.4194, + "eu-west-1": 0.4194, + "eu-west-2": 0.4258, + "eu-west-3": 0.4258, + "il-central-1": 0.4341, + "me-central-1": 0.4514, + "me-south-1": 0.4463, + "mx-central-1": 0.4072, + "sa-east-1": 0.5538, + "us-east-1": 0.3938, + "us-east-2": 0.3938, + "us-gov-east-1": 0.4386, + "us-gov-west-1": 0.4386, + "us-west-1": 0.445, + "us-west-2": 0.3938 + }, + "trn1.2xlarge": { + "us-east-1": 1.46875, + "us-east-2": 1.46875, + "us-west-2": 1.46875 + }, + "trn1.32xlarge": { + "us-east-1": 21.625, + "us-east-2": 21.625, + "us-west-2": 21.625 + }, + "trn1n.32xlarge": { + "us-east-1": 24.905, + "us-east-2": 24.905, + "us-west-2": 24.905 + }, + "trn2.48xlarge": { + "us-east-2": 0.125 + }, + "u7i-6tb.112xlarge": { + "ap-northeast-2": 0.0, + "us-east-1": 62.915, + "us-west-2": 62.915 + }, + "u7i-8tb.112xlarge": { + "ap-northeast-2": 101.12106, + "us-east-1": 83.845 + }, + "u7i-12tb.224xlarge": { + "us-east-1": 0.0, + "us-west-2": 153.005 + }, + "u7in-16tb.224xlarge": { + "ap-northeast-2": 0.0, + "ap-southeast-2": 244.409, + "us-east-1": 203.965, + "us-west-2": 203.965 + }, + "u7in-24tb.224xlarge": { + "us-east-1": 305.885, + "us-gov-west-1": 366.547, + "us-west-2": 305.885 + }, + "u7in-32tb.224xlarge": { + "us-east-1": 407.805, + "us-west-2": 407.805 + }, + "u-3tb1.56xlarge": { + "ap-east-1": 36.35185, + "ap-northeast-1": 33.0583, + "ap-southeast-1": 33.055, + "ap-southeast-2": 32.84, + "ca-central-1": 30.025, + "eu-central-1": 33.0585, + "eu-central-2": 36.35185, + "eu-south-1": 32.2025, + "eu-west-1": 30.675, + "sa-east-1": 43.675, + "us-east-1": 27.425, + "us-east-2": 27.425, + "us-gov-west-1": 32.8415, + "us-west-2": 27.425 + }, + "u-6tb1.metal": { + "ap-northeast-1": 0.125, + "ap-northeast-2": 0.125, + "ap-south-1": 0.125, + "ap-southeast-1": 0.125, + "ap-southeast-2": 0.125, + "ap-southeast-3": 0.125, + "ca-central-1": 0.125, + "eu-central-1": 0.125, + "eu-central-2": 0.125, + "eu-north-1": 0.125, + "eu-south-1": 0.125, + "eu-south-2": 0.125, + "eu-west-1": 0.125, + "eu-west-2": 0.125, + "eu-west-3": 0.125, + "sa-east-1": 0.125, + "us-east-1": 0.125, + "us-east-2": 0.125, + "us-gov-east-1": 0.125, + "us-gov-west-1": 0.125, + "us-west-2": 0.125 + }, + "u-6tb1.56xlarge": { + "af-south-1": 0.125, + "ap-northeast-1": 56.1046, + "ap-northeast-2": 56.1046, + "ap-northeast-3": 56.1046, + "ap-south-1": 48.00176, + "ap-southeast-1": 56.1046, + "ap-southeast-2": 0.125, + "ap-southeast-3": 0.125, + "ca-central-1": 0.125, + "eu-central-1": 0.125, + "eu-central-2": 0.125, + "eu-north-1": 0.125, + "eu-south-1": 0.125, + "eu-south-2": 0.125, + "eu-west-1": 0.125, + "eu-west-2": 0.125, + "eu-west-3": 54.63089, + "sa-east-1": 0.125, + "us-east-1": 0.125, + "us-east-2": 0.125, + "us-gov-east-1": 55.73575, + "us-gov-west-1": 55.73575, + "us-west-2": 0.125 + }, + "u-6tb1.112xlarge": { + "af-south-1": 72.834, + "ap-northeast-1": 0.125, + "ap-northeast-2": 65.992, + "ap-northeast-3": 65.992, + "ap-south-1": 56.458, + "ap-southeast-1": 65.992, + "ap-southeast-2": 0.125, + "ap-southeast-3": 65.992, + "ca-central-1": 59.925, + "eu-central-1": 0.125, + "eu-central-2": 72.5787, + "eu-north-1": 58.17, + "eu-south-1": 64.28, + "eu-south-2": 61.225, + "eu-west-1": 61.225, + "eu-west-2": 0.125, + "eu-west-3": 64.258, + "sa-east-1": 0.125, + "us-east-1": 54.725, + "us-east-2": 0.125, + "us-gov-east-1": 0.125, + "us-gov-west-1": 0.125, + "us-west-2": 54.725 + }, + "u-9tb1.metal": { + "ap-northeast-1": 0.125, + "ap-northeast-2": 0.125, + "ap-south-1": 0.125, + "ap-south-2": 0.125, + "ap-southeast-1": 0.125, + "eu-central-1": 0.125, + "eu-north-1": 0.125, + "eu-west-1": 0.125, + "eu-west-2": 0.125, + "eu-west-3": 0.125, + "sa-east-1": 0.125, + "us-east-1": 0.125, + "us-east-2": 0.125, + "us-gov-east-1": 0.125, + "us-gov-west-1": 0.125, + "us-west-2": 0.125 + }, + "u-9tb1.112xlarge": { + "ap-northeast-1": 98.925, + "ap-northeast-2": 0.125, + "ap-south-1": 84.625, + "ap-south-2": 84.10543, + "ap-southeast-1": 0.125, + "eu-central-1": 98.925, + "eu-north-1": 91.775, + "eu-west-1": 0.125, + "eu-west-2": 96.325, + "eu-west-3": 96.325, + "sa-east-1": 0.125, + "us-east-1": 82.025, + "us-east-2": 82.025, + "us-gov-east-1": 98.275, + "us-gov-west-1": 0.125, + "us-west-2": 82.025 + }, + "u-12tb1.metal": { + "af-south-1": 0.125, + "ap-northeast-1": 0.125, + "ap-northeast-2": 0.125, + "ap-northeast-3": 0.125, + "ap-south-1": 0.125, + "ap-southeast-1": 0.125, + "ap-southeast-2": 0.125, + "eu-central-1": 0.125, + "eu-south-1": 0.125, + "eu-west-1": 0.125, + "sa-east-1": 0.125, + "us-east-1": 0.125, + "us-east-2": 0.125, + "us-gov-east-1": 0.125, + "us-gov-west-1": 0.125, + "us-west-2": 0.125 + }, + "u-12tb1.112xlarge": { + "af-south-1": 0.125, + "ap-northeast-1": 0.125, + "ap-northeast-2": 0.125, + "ap-northeast-3": 0.125, + "ap-south-1": 0.125, + "ap-southeast-1": 131.858, + "ap-southeast-2": 130.992, + "eu-central-1": 131.858, + "eu-south-1": 128.435, + "eu-west-1": 0.125, + "sa-east-1": 174.325, + "us-east-1": 0.125, + "us-east-2": 0.125, + "us-gov-east-1": 130.992, + "us-gov-west-1": 0.125, + "us-west-2": 109.325 + }, + "u-18tb1.metal": { + "eu-central-1": 0.125, + "eu-west-1": 0.125, + "sa-east-1": 0.125, + "us-east-1": 0.125, + "us-west-2": 0.125 + }, + "u-18tb1.112xlarge": { + "eu-central-1": 0.125, + "eu-west-1": 0.125, + "sa-east-1": 261.425, + "us-east-1": 0.125, + "us-west-2": 0.125 + }, + "u-24tb1.metal": { + "ap-northeast-2": 0.125, + "us-east-1": 0.125, + "us-gov-east-1": 0.125, + "us-gov-west-1": 0.125, + "us-west-2": 0.125 + }, + "u-24tb1.112xlarge": { + "ap-northeast-2": 0.125, + "us-east-1": 0.125, + "us-gov-east-1": 261.855, + "us-gov-west-1": 261.855, + "us-west-2": 218.525 + }, + "x1.16xlarge": { + "af-south-1": 9.624, + "ap-east-1": 10.738, + "ap-northeast-1": 9.771, + "ap-northeast-2": 9.771, + "ap-northeast-3": 9.771, + "ap-south-1": 0.0, + "ap-southeast-1": 9.771, + "ap-southeast-2": 9.771, + "ca-central-1": 0.0, + "eu-central-1": 9.437, + "eu-west-1": 8.103, + "eu-west-2": 8.503, + "eu-west-3": 0.0, + "sa-east-1": 13.105, + "us-east-1": 6.769, + "us-east-2": 6.769, + "us-gov-east-1": 8.103, + "us-gov-west-1": 0.0, + "us-west-2": 6.769 + }, + "x1.32xlarge": { + "af-south-1": 0.0, + "ap-east-1": 21.376, + "ap-northeast-1": 19.441, + "ap-northeast-2": 19.441, + "ap-northeast-3": 0.0, + "ap-south-1": 13.862, + "ap-southeast-1": 19.441, + "ap-southeast-2": 19.441, + "ca-central-1": 0.0, + "eu-central-1": 18.774, + "eu-west-1": 16.106, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 26.11, + "us-east-1": 13.438, + "us-east-2": 13.438, + "us-gov-east-1": 16.106, + "us-gov-west-1": 0.0, + "us-west-2": 13.438 + }, + "x1e.xlarge": { + "af-south-1": 1.246, + "ap-northeast-1": 1.386, + "ap-northeast-2": 1.265, + "ap-northeast-3": 0.0, + "ap-south-1": 0.916, + "ap-southeast-1": 1.386, + "ap-southeast-2": 1.265, + "ca-central-1": 0.973, + "eu-central-1": 0.0, + "eu-west-1": 1.056, + "sa-east-1": 1.682, + "us-east-1": 0.0, + "us-east-2": 0.89, + "us-gov-east-1": 1.056, + "us-gov-west-1": 1.056, + "us-west-2": 0.974 + }, + "x1e.2xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 2.518, + "ap-northeast-2": 2.518, + "ap-northeast-3": 0.0, + "ap-south-1": 1.82, + "ap-southeast-1": 2.518, + "ap-southeast-2": 2.518, + "ca-central-1": 1.934, + "eu-central-1": 2.667, + "eu-west-1": 2.1, + "sa-east-1": 3.351, + "us-east-1": 1.935, + "us-east-2": 1.935, + "us-gov-east-1": 2.1, + "us-gov-west-1": 2.1, + "us-west-2": 1.768 + }, + "x1e.4xlarge": { + "af-south-1": 4.86, + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.936, + "ap-northeast-3": 0.0, + "ap-south-1": 3.54, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.936, + "ca-central-1": 3.767, + "eu-central-1": 4.768, + "eu-west-1": 0.0, + "sa-east-1": 6.602, + "us-east-1": 3.436, + "us-east-2": 3.436, + "us-gov-east-1": 4.5, + "us-gov-west-1": 4.1, + "us-west-2": 0.0 + }, + "x1e.8xlarge": { + "af-south-1": 10.572, + "ap-northeast-1": 9.772, + "ap-northeast-2": 9.772, + "ap-northeast-3": 10.739, + "ap-south-1": 6.98, + "ap-southeast-1": 9.772, + "ap-southeast-2": 9.772, + "ca-central-1": 0.0, + "eu-central-1": 9.436, + "eu-west-1": 8.1, + "sa-east-1": 13.105, + "us-east-1": 7.439, + "us-east-2": 6.772, + "us-gov-east-1": 8.1, + "us-gov-west-1": 8.9, + "us-west-2": 6.772 + }, + "x1e.16xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 19.444, + "ap-northeast-2": 19.444, + "ap-northeast-3": 21.378, + "ap-south-1": 13.86, + "ap-southeast-1": 21.378, + "ap-southeast-2": 19.444, + "ca-central-1": 16.236, + "eu-central-1": 18.772, + "eu-west-1": 16.1, + "sa-east-1": 26.11, + "us-east-1": 13.444, + "us-east-2": 13.444, + "us-gov-east-1": 16.1, + "us-gov-west-1": 16.1, + "us-west-2": 14.778 + }, + "x1e.32xlarge": { + "af-south-1": 38.18, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 27.62, + "ap-southeast-1": 38.788, + "ap-southeast-2": 38.788, + "ca-central-1": 29.438, + "eu-central-1": 37.444, + "eu-west-1": 32.1, + "sa-east-1": 0.0, + "us-east-1": 26.788, + "us-east-2": 26.788, + "us-gov-east-1": 32.1, + "us-gov-west-1": 32.1, + "us-west-2": 26.788 + }, + "x2gd.medium": { + "eu-west-1": 0.0, + "us-east-1": 0.1145, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "x2gd.large": { + "eu-west-1": 0.2563, + "us-east-1": 0.2233, + "us-east-2": 0.2233, + "us-west-2": 0.2233 + }, + "x2gd.xlarge": { + "eu-west-1": 0.0, + "us-east-1": 0.3903, + "us-east-2": 0.3903, + "us-west-2": 0.3903 + }, + "x2gd.metal": { + "eu-west-1": 0.0, + "us-east-1": 5.469, + "us-east-2": 5.469, + "us-west-2": 5.469 + }, + "x2gd.2xlarge": { + "eu-west-1": 0.925, + "us-east-1": 0.793, + "us-east-2": 0.793, + "us-west-2": 0.793 + }, + "x2gd.4xlarge": { + "eu-west-1": 1.725, + "us-east-1": 1.5946, + "us-east-2": 1.5946, + "us-west-2": 1.5946 + }, + "x2gd.8xlarge": { + "eu-west-1": 3.325, + "us-east-1": 0.0, + "us-east-2": 2.797, + "us-west-2": 3.0642 + }, + "x2gd.12xlarge": { + "eu-west-1": 5.405, + "us-east-1": 4.5338, + "us-east-2": 0.0, + "us-west-2": 4.133 + }, + "x2gd.16xlarge": { + "eu-west-1": 6.525, + "us-east-1": 5.469, + "us-east-2": 0.0, + "us-west-2": 5.469 + }, + "x2idn.metal": { + "af-south-1": 0.0, + "ap-northeast-1": 19.466, + "ap-northeast-2": 19.466, + "ap-northeast-3": 19.467, + "ap-south-1": 13.887, + "ap-south-2": 13.887, + "ap-southeast-1": 19.466, + "ap-southeast-2": 19.466, + "ap-southeast-3": 0.0, + "ap-southeast-5": 17.5319, + "ap-southeast-7": 17.5319, + "ca-central-1": 14.797, + "eu-central-1": 18.799, + "eu-central-2": 20.6664, + "eu-north-1": 15.336, + "eu-south-1": 16.926, + "eu-south-2": 16.131, + "eu-west-1": 16.131, + "eu-west-2": 16.931, + "eu-west-3": 0.0, + "me-central-1": 16.533, + "me-south-1": 16.533, + "sa-east-1": 26.135, + "us-east-1": 13.463, + "us-east-2": 13.463, + "us-gov-east-1": 16.131, + "us-gov-west-1": 16.131, + "us-west-1": 17.465, + "us-west-2": 13.463 + }, + "x2idn.16xlarge": { + "af-south-1": 9.649, + "ap-northeast-1": 9.7955, + "ap-northeast-2": 0.0, + "ap-northeast-3": 9.796, + "ap-south-1": 7.006, + "ap-south-2": 7.006, + "ap-southeast-1": 9.7955, + "ap-southeast-2": 9.7955, + "ap-southeast-3": 10.76255, + "ap-southeast-5": 8.82845, + "ap-southeast-7": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 9.462, + "eu-central-2": 11.42277, + "eu-north-1": 7.7305, + "eu-south-1": 8.5255, + "eu-south-2": 0.0, + "eu-west-1": 8.128, + "eu-west-2": 8.528, + "eu-west-3": 9.3683, + "me-central-1": 8.329, + "me-south-1": 9.1494, + "sa-east-1": 13.13, + "us-east-1": 0.0, + "us-east-2": 7.4609, + "us-gov-east-1": 8.128, + "us-gov-west-1": 0.0, + "us-west-1": 8.795, + "us-west-2": 7.4609 + }, + "x2idn.24xlarge": { + "af-south-1": 14.411, + "ap-northeast-1": 14.63075, + "ap-northeast-2": 14.63075, + "ap-northeast-3": 16.08215, + "ap-south-1": 11.47865, + "ap-south-2": 0.0, + "ap-southeast-1": 14.63075, + "ap-southeast-2": 16.08133, + "ap-southeast-3": 14.63075, + "ap-southeast-5": 13.18018, + "ap-southeast-7": 13.18018, + "ca-central-1": 0.0, + "eu-central-1": 15.53105, + "eu-central-2": 15.53105, + "eu-north-1": 11.53325, + "eu-south-1": 13.98583, + "eu-south-2": 12.1295, + "eu-west-1": 12.1295, + "eu-west-2": 12.7295, + "eu-west-3": 12.7295, + "me-central-1": 12.431, + "me-south-1": 13.6616, + "sa-east-1": 19.6325, + "us-east-1": 10.1285, + "us-east-2": 11.12885, + "us-gov-east-1": 13.32995, + "us-gov-west-1": 0.0, + "us-west-1": 14.4305, + "us-west-2": 0.0 + }, + "x2idn.32xlarge": { + "af-south-1": 19.173, + "ap-northeast-1": 19.466, + "ap-northeast-2": 0.0, + "ap-northeast-3": 19.467, + "ap-south-1": 13.887, + "ap-south-2": 13.887, + "ap-southeast-1": 19.466, + "ap-southeast-2": 19.466, + "ap-southeast-3": 19.466, + "ap-southeast-5": 17.5319, + "ap-southeast-7": 0.0, + "ca-central-1": 14.797, + "eu-central-1": 0.0, + "eu-central-2": 20.6664, + "eu-north-1": 15.336, + "eu-south-1": 16.926, + "eu-south-2": 16.131, + "eu-west-1": 0.0, + "eu-west-2": 16.931, + "eu-west-3": 16.931, + "me-central-1": 0.0, + "me-south-1": 0.0, + "sa-east-1": 26.135, + "us-east-1": 13.463, + "us-east-2": 13.463, + "us-gov-east-1": 16.131, + "us-gov-west-1": 16.131, + "us-west-1": 17.465, + "us-west-2": 13.463 + }, + "x2iedn.xlarge": { + "af-south-1": 1.2468, + "ap-northeast-1": 1.26511, + "ap-northeast-2": 1.26511, + "ap-northeast-3": 1.26518, + "ap-south-1": 1.00244, + "ap-south-2": 0.0, + "ap-southeast-1": 1.26511, + "ap-southeast-2": 1.38599, + "ap-southeast-3": 1.26511, + "ap-southeast-5": 1.14423, + "ca-central-1": 1.065, + "eu-central-1": 1.22343, + "eu-north-1": 1.00702, + "eu-south-1": 1.10633, + "eu-south-2": 1.15671, + "eu-west-1": 1.15671, + "eu-west-2": 1.10668, + "eu-west-3": 1.10668, + "sa-east-1": 1.68193, + "us-east-1": 0.97329, + "us-east-2": 0.88993, + "us-gov-east-1": 1.05668, + "us-gov-west-1": 1.15671, + "us-west-1": 1.14005, + "us-west-2": 0.88993 + }, + "x2iedn.metal": { + "af-south-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 38.807, + "ap-northeast-3": 38.809, + "ap-south-1": 27.649, + "ap-south-2": 0.0, + "ap-southeast-1": 38.807, + "ap-southeast-2": 38.807, + "ap-southeast-3": 38.807, + "ap-southeast-5": 34.9388, + "ca-central-1": 29.469, + "eu-central-1": 0.0, + "eu-north-1": 30.548, + "eu-south-1": 33.726, + "eu-south-2": 32.137, + "eu-west-1": 32.137, + "eu-west-2": 0.0, + "eu-west-3": 33.737, + "sa-east-1": 52.145, + "us-east-1": 26.801, + "us-east-2": 26.801, + "us-gov-east-1": 32.137, + "us-gov-west-1": 32.137, + "us-west-1": 0.0, + "us-west-2": 26.801 + }, + "x2iedn.2xlarge": { + "af-south-1": 2.506, + "ap-northeast-1": 2.54263, + "ap-northeast-2": 2.78439, + "ap-northeast-3": 2.54275, + "ap-south-1": 2.01728, + "ap-south-2": 0.0, + "ap-southeast-1": 2.54263, + "ap-southeast-2": 2.78439, + "ap-southeast-3": 2.54263, + "ap-southeast-5": 2.30086, + "ca-central-1": 1.959, + "eu-central-1": 0.0, + "eu-north-1": 2.02644, + "eu-south-1": 2.43507, + "eu-south-2": 0.0, + "eu-west-1": 2.12575, + "eu-west-2": 2.22575, + "eu-west-3": 2.22575, + "sa-east-1": 0.0, + "us-east-1": 1.79225, + "us-east-2": 1.95898, + "us-gov-east-1": 2.32583, + "us-gov-west-1": 2.12575, + "us-west-1": 2.2925, + "us-west-2": 1.79225 + }, + "x2iedn.4xlarge": { + "af-south-1": 4.887, + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.96025, + "ap-northeast-3": 4.9605, + "ap-south-1": 3.5655, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 4.96025, + "ap-southeast-3": 5.44378, + "ap-southeast-5": 4.9119, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 3.92788, + "eu-south-1": 4.32513, + "eu-south-2": 4.52665, + "eu-west-1": 0.0, + "eu-west-2": 4.3265, + "eu-west-3": 4.3265, + "sa-east-1": 6.6275, + "us-east-1": 3.4595, + "us-east-2": 0.0, + "us-gov-east-1": 4.1265, + "us-gov-west-1": 4.1265, + "us-west-1": 4.46, + "us-west-2": 3.4595 + }, + "x2iedn.8xlarge": { + "af-south-1": 9.649, + "ap-northeast-1": 0.0, + "ap-northeast-2": 9.7955, + "ap-northeast-3": 9.796, + "ap-south-1": 7.6941, + "ap-south-2": 7.006, + "ap-southeast-1": 9.7955, + "ap-southeast-2": 9.7955, + "ap-southeast-3": 9.7955, + "ap-southeast-5": 8.82845, + "ca-central-1": 7.461, + "eu-central-1": 0.0, + "eu-north-1": 7.73075, + "eu-south-1": 9.36528, + "eu-south-2": 8.128, + "eu-west-1": 8.128, + "eu-west-2": 0.0, + "eu-west-3": 8.528, + "sa-east-1": 13.13, + "us-east-1": 7.4609, + "us-east-2": 0.0, + "us-gov-east-1": 8.128, + "us-gov-west-1": 8.9283, + "us-west-1": 8.795, + "us-west-2": 6.794 + }, + "x2iedn.16xlarge": { + "af-south-1": 19.173, + "ap-northeast-1": 0.0, + "ap-northeast-2": 19.466, + "ap-northeast-3": 19.467, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 19.466, + "ap-southeast-3": 0.0, + "ap-southeast-5": 19.27259, + "ca-central-1": 0.0, + "eu-central-1": 18.799, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 16.131, + "eu-west-1": 16.131, + "eu-west-2": 16.931, + "eu-west-3": 16.931, + "sa-east-1": 26.135, + "us-east-1": 0.0, + "us-east-2": 14.7968, + "us-gov-east-1": 17.7316, + "us-gov-west-1": 16.131, + "us-west-1": 17.465, + "us-west-2": 13.463 + }, + "x2iedn.24xlarge": { + "af-south-1": 28.697, + "ap-northeast-1": 32.03765, + "ap-northeast-2": 29.1365, + "ap-northeast-3": 29.138, + "ap-south-1": 0.0, + "ap-south-2": 20.768, + "ap-southeast-1": 29.1365, + "ap-southeast-2": 29.1365, + "ap-southeast-3": 0.0, + "ap-southeast-5": 28.84639, + "ca-central-1": 0.0, + "eu-central-1": 30.9371, + "eu-north-1": 22.94225, + "eu-south-1": 25.32575, + "eu-south-2": 24.134, + "eu-west-1": 26.5349, + "eu-west-2": 25.334, + "eu-west-3": 0.0, + "sa-east-1": 39.14, + "us-east-1": 20.132, + "us-east-2": 20.132, + "us-gov-east-1": 26.5349, + "us-gov-west-1": 24.134, + "us-west-1": 28.736, + "us-west-2": 20.132 + }, + "x2iedn.32xlarge": { + "af-south-1": 38.221, + "ap-northeast-1": 38.807, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 27.649, + "ap-south-2": 27.649, + "ap-southeast-1": 38.807, + "ap-southeast-2": 38.807, + "ap-southeast-3": 38.807, + "ap-southeast-5": 34.9388, + "ca-central-1": 29.469, + "eu-central-1": 37.473, + "eu-north-1": 0.0, + "eu-south-1": 33.726, + "eu-south-2": 32.137, + "eu-west-1": 0.0, + "eu-west-2": 33.737, + "eu-west-3": 33.737, + "sa-east-1": 52.145, + "us-east-1": 26.801, + "us-east-2": 26.801, + "us-gov-east-1": 32.137, + "us-gov-west-1": 32.137, + "us-west-1": 34.805, + "us-west-2": 26.801 + }, + "x2iezn.metal": { + "ap-northeast-1": 0.0, + "eu-west-1": 0.0, + "me-central-1": 0.0, + "us-east-1": 10.133, + "us-west-2": 0.0 + }, + "x2iezn.2xlarge": { + "ap-northeast-1": 2.7848, + "eu-west-1": 2.125, + "me-central-1": 2.3811, + "us-east-1": 1.793, + "us-west-2": 1.9598 + }, + "x2iezn.4xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 0.0, + "me-central-1": 4.6372, + "us-east-1": 0.0, + "us-west-2": 3.461 + }, + "x2iezn.6xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 6.125, + "me-central-1": 6.8933, + "us-east-1": 5.129, + "us-west-2": 5.6294 + }, + "x2iezn.8xlarge": { + "ap-northeast-1": 9.797, + "eu-west-1": 8.925, + "me-central-1": 9.1494, + "us-east-1": 0.0, + "us-west-2": 6.797 + }, + "x2iezn.12xlarge": { + "ap-northeast-1": 14.633, + "eu-west-1": 0.0, + "me-central-1": 12.431, + "us-east-1": 0.0, + "us-west-2": 0.0 + }, + "x8g.medium": { + "eu-central-1": 0.19285, + "us-east-1": 0.0, + "us-west-2": 0.154 + }, + "x8g.large": { + "eu-central-1": 0.3294, + "us-east-1": 0.27124, + "us-west-2": 0.27124 + }, + "x8g.xlarge": { + "eu-central-1": 0.65712, + "us-east-1": 0.0, + "us-west-2": 0.4471 + }, + "x8g.metal-24xl": { + "eu-central-1": 13.2338, + "us-east-1": 9.5042, + "us-west-2": 9.5042 + }, + "x8g.metal-48xl": { + "eu-central-1": 0.0, + "us-east-1": 18.8834, + "us-west-2": 0.0 + }, + "x8g.2xlarge": { + "eu-central-1": 0.0, + "us-east-1": 0.0, + "us-west-2": 0.9066 + }, + "x8g.4xlarge": { + "eu-central-1": 2.3098, + "us-east-1": 0.0, + "us-west-2": 1.84452 + }, + "x8g.8xlarge": { + "eu-central-1": 4.93156, + "us-east-1": 3.2514, + "us-west-2": 3.2514 + }, + "x8g.12xlarge": { + "eu-central-1": 0.0, + "us-east-1": 4.8146, + "us-west-2": 4.8146 + }, + "x8g.16xlarge": { + "eu-central-1": 8.8642, + "us-east-1": 7.00308, + "us-west-2": 7.00308 + }, + "x8g.24xlarge": { + "eu-central-1": 13.2338, + "us-east-1": 0.0, + "us-west-2": 10.44212 + }, + "x8g.48xlarge": { + "eu-central-1": 0.0, + "us-east-1": 18.8834, + "us-west-2": 18.8834 + }, + "z1d.large": { + "ap-northeast-1": 0.283, + "ap-northeast-2": 0.295, + "ap-south-1": 0.252, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.296, + "eu-central-1": 0.281, + "eu-west-1": 0.264, + "eu-west-2": 0.289, + "us-east-1": 0.253, + "us-east-2": 0.253, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "z1d.xlarge": { + "ap-northeast-1": 0.538, + "ap-northeast-2": 0.506, + "ap-south-1": 0.472, + "ap-southeast-1": 0.508, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 0.472, + "eu-west-2": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.451, + "us-west-1": 0.478, + "us-west-2": 0.428 + }, + "z1d.metal": { + "ap-northeast-1": 5.573, + "ap-northeast-2": 0.0, + "ap-south-1": 4.829, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.549, + "eu-central-1": 5.525, + "eu-west-1": 5.117, + "eu-west-2": 5.398, + "us-east-1": 0.0, + "us-east-2": 4.589, + "us-west-1": 5.189, + "us-west-2": 4.589 + }, + "z1d.2xlarge": { + "ap-northeast-1": 1.033, + "ap-northeast-2": 1.025, + "ap-south-1": 0.909, + "ap-southeast-1": 1.029, + "ap-southeast-2": 0.0, + "eu-central-1": 1.025, + "eu-west-1": 0.957, + "eu-west-2": 0.0, + "us-east-1": 0.869, + "us-east-2": 0.869, + "us-west-1": 0.0, + "us-west-2": 0.869 + }, + "z1d.3xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-south-1": 1.301, + "ap-southeast-1": 1.481, + "ap-southeast-2": 0.0, + "eu-central-1": 1.556, + "eu-west-1": 1.448, + "eu-west-2": 1.443, + "us-east-1": 1.241, + "us-east-2": 1.241, + "us-west-1": 0.0, + "us-west-2": 1.241 + }, + "z1d.6xlarge": { + "ap-northeast-1": 2.849, + "ap-northeast-2": 0.0, + "ap-south-1": 2.477, + "ap-southeast-1": 2.837, + "ap-southeast-2": 2.837, + "eu-central-1": 2.825, + "eu-west-1": 2.771, + "eu-west-2": 2.761, + "us-east-1": 2.491, + "us-east-2": 2.357, + "us-west-1": 2.657, + "us-west-2": 2.491 + }, + "z1d.12xlarge": { + "ap-northeast-1": 5.573, + "ap-northeast-2": 5.525, + "ap-south-1": 4.829, + "ap-southeast-1": 5.549, + "ap-southeast-2": 5.549, + "eu-central-1": 5.525, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "us-east-1": 4.589, + "us-east-2": 4.589, + "us-west-1": 5.189, + "us-west-2": 0.0 + } }, "ec2_us_east": { - "c1.medium": "0.130", - "c1.xlarge": "0.520", - "c3.2xlarge": "0.420", - "c3.4xlarge": "0.840", - "c3.8xlarge": "1.680", - "c3.large": "0.105", - "c3.xlarge": "0.210", - "c4.2xlarge": "0.464", - "c4.4xlarge": "0.928", - "c4.8xlarge": "1.856", - "c4.large": "0.116", - "c4.xlarge": "0.232", - "cc2.8xlarge": "2.000", - "cg1.4xlarge": "2.100", - "cr1.8xlarge": "3.500", - "d2.2xlarge": "1.380", - "d2.4xlarge": "2.760", - "d2.8xlarge": "5.520", - "d2.xlarge": "0.690", - "g2.2xlarge": "0.650", - "hi1.4xlarge": "3.100", - "hs1.8xlarge": "4.600", - "i2.2xlarge": "1.705", - "i2.4xlarge": "3.410", - "i2.8xlarge": "6.820", - "i2.xlarge": "0.853", - "m1.large": "0.175", - "m1.medium": "0.087", - "m1.small": "0.044", - "m1.xlarge": "0.350", - "m2.2xlarge": "0.490", - "m2.4xlarge": "0.980", - "m2.xlarge": "0.245", - "m3.2xlarge": "0.560", - "m3.large": "0.140", - "m3.medium": "0.070", - "m3.xlarge": "0.280", - "r3.2xlarge": "0.700", - "r3.4xlarge": "1.400", - "r3.8xlarge": "2.800", - "r3.large": "0.175", - "r3.xlarge": "0.350", - "t1.micro": "0.020", - "t2.medium": "0.052", - "t2.micro": "0.013", - "t2.small": "0.026" + "c1.medium": 0.13, + "c1.xlarge": 0.52, + "c3.large": 0.105, + "c3.xlarge": 0.21, + "c3.2xlarge": 0.42, + "c3.4xlarge": 0.84, + "c3.8xlarge": 1.68, + "c4.large": 0.1, + "c4.xlarge": 0.199, + "c4.2xlarge": 0.398, + "c4.4xlarge": 0.796, + "c4.8xlarge": 1.591, + "c5.large": 0.085, + "c5.xlarge": 0.17, + "c5.2xlarge": 0.34, + "c5.4xlarge": 0.68, + "c5.9xlarge": 1.53, + "c5.18xlarge": 3.06, + "c5d.large": 0.096, + "c5d.xlarge": 0.192, + "c5d.2xlarge": 0.384, + "c5d.4xlarge": 0.768, + "c5d.9xlarge": 1.728, + "c5d.18xlarge": 3.456, + "cc2.8xlarge": 2.0, + "cr1.8xlarge": 3.5, + "d2.xlarge": 0.69, + "d2.2xlarge": 1.38, + "d2.4xlarge": 2.76, + "d2.8xlarge": 5.52, + "f1.2xlarge": 1.65, + "f1.16xlarge": 13.2, + "g2.2xlarge": 0.65, + "g2.8xlarge": 2.6, + "g3.4xlarge": 1.14, + "g3.8xlarge": 2.28, + "g3.16xlarge": 4.56, + "h1.2xlarge": 0.468, + "h1.4xlarge": 0.936, + "h1.8xlarge": 1.872, + "h1.16xlarge": 3.744, + "hs1.8xlarge": 4.6, + "i2.xlarge": 0.853, + "i2.2xlarge": 1.705, + "i2.4xlarge": 3.41, + "i2.8xlarge": 6.82, + "i3.large": 0.156, + "i3.xlarge": 0.312, + "i3.metal": 4.992, + "i3.2xlarge": 0.624, + "i3.4xlarge": 1.248, + "i3.8xlarge": 2.496, + "i3.16xlarge": 4.992, + "m1.small": 0.044, + "m1.medium": 0.087, + "m1.large": 0.175, + "m1.xlarge": 0.35, + "m2.xlarge": 0.245, + "m2.2xlarge": 0.49, + "m2.4xlarge": 0.98, + "m3.medium": 0.067, + "m3.large": 0.133, + "m3.xlarge": 0.266, + "m3.2xlarge": 0.532, + "m4.large": 0.1, + "m4.xlarge": 0.2, + "m4.2xlarge": 0.4, + "m4.4xlarge": 0.8, + "m4.10xlarge": 2.0, + "m4.16xlarge": 3.2, + "m5.large": 0.096, + "m5.xlarge": 0.192, + "m5.2xlarge": 0.384, + "m5.4xlarge": 0.768, + "m5.12xlarge": 2.304, + "m5.24xlarge": 4.608, + "m5d.large": 0.113, + "m5d.xlarge": 0.226, + "m5d.2xlarge": 0.452, + "m5d.4xlarge": 0.904, + "m5d.12xlarge": 2.712, + "m5d.24xlarge": 5.424, + "p2.xlarge": 0.9, + "p2.8xlarge": 7.2, + "p2.16xlarge": 14.4, + "p3.2xlarge": 3.06, + "p3.8xlarge": 12.24, + "p3.16xlarge": 24.48, + "r3.large": 0.166, + "r3.xlarge": 0.333, + "r3.2xlarge": 0.665, + "r3.4xlarge": 1.33, + "r3.8xlarge": 2.66, + "r4.large": 0.133, + "r4.xlarge": 0.266, + "r4.2xlarge": 0.532, + "r4.4xlarge": 1.064, + "r4.8xlarge": 2.128, + "r4.16xlarge": 4.256, + "t1.micro": 0.02, + "t2.micro": 0.0116, + "t2.small": 0.023, + "t2.medium": 0.0464, + "t2.large": 0.0928, + "t2.xlarge": 0.1856, + "t2.nano": 0.0058, + "t2.2xlarge": 0.3712, + "x1.16xlarge": 6.669, + "x1.32xlarge": 13.338, + "x1e.xlarge": 0.834, + "x1e.2xlarge": 1.668, + "x1e.4xlarge": 3.336, + "x1e.8xlarge": 6.672, + "x1e.16xlarge": 13.344, + "x1e.32xlarge": 26.688 + }, + "ec2_us_east_ohio": { + "c4.large": 0.1, + "c4.xlarge": 0.199, + "c4.2xlarge": 0.398, + "c4.4xlarge": 0.796, + "c4.8xlarge": 1.591, + "c5.large": 0.085, + "c5.xlarge": 0.17, + "c5.2xlarge": 0.34, + "c5.4xlarge": 0.68, + "c5.9xlarge": 1.53, + "c5.18xlarge": 3.06, + "c5d.large": 0.096, + "c5d.xlarge": 0.192, + "c5d.2xlarge": 0.384, + "c5d.4xlarge": 0.768, + "c5d.9xlarge": 1.728, + "c5d.18xlarge": 3.456, + "d2.xlarge": 0.69, + "d2.2xlarge": 1.38, + "d2.4xlarge": 2.76, + "d2.8xlarge": 5.52, + "g3.4xlarge": 1.14, + "g3.8xlarge": 2.28, + "g3.16xlarge": 4.56, + "h1.2xlarge": 0.468, + "h1.4xlarge": 0.936, + "h1.8xlarge": 1.872, + "h1.16xlarge": 3.744, + "i2.xlarge": 0.853, + "i2.2xlarge": 1.705, + "i2.4xlarge": 3.41, + "i2.8xlarge": 6.82, + "i3.large": 0.156, + "i3.xlarge": 0.312, + "i3.metal": 4.992, + "i3.2xlarge": 0.624, + "i3.4xlarge": 1.248, + "i3.8xlarge": 2.496, + "i3.16xlarge": 4.992, + "m4.large": 0.1, + "m4.xlarge": 0.2, + "m4.2xlarge": 0.4, + "m4.4xlarge": 0.8, + "m4.10xlarge": 2.0, + "m4.16xlarge": 3.2, + "m5.large": 0.096, + "m5.xlarge": 0.192, + "m5.2xlarge": 0.384, + "m5.4xlarge": 0.768, + "m5.12xlarge": 2.304, + "m5.24xlarge": 4.608, + "m5d.large": 0.113, + "m5d.xlarge": 0.226, + "m5d.2xlarge": 0.452, + "m5d.4xlarge": 0.904, + "m5d.12xlarge": 2.712, + "m5d.24xlarge": 5.424, + "p2.xlarge": 0.9, + "p2.8xlarge": 7.2, + "p2.16xlarge": 14.4, + "p3.2xlarge": 3.06, + "p3.8xlarge": 12.24, + "p3.16xlarge": 24.48, + "r3.large": 0.166, + "r3.xlarge": 0.333, + "r3.2xlarge": 0.665, + "r3.4xlarge": 1.33, + "r3.8xlarge": 2.66, + "r4.large": 0.133, + "r4.xlarge": 0.266, + "r4.2xlarge": 0.532, + "r4.4xlarge": 1.064, + "r4.8xlarge": 2.128, + "r4.16xlarge": 4.256, + "t2.micro": 0.0116, + "t2.small": 0.023, + "t2.medium": 0.0464, + "t2.large": 0.0928, + "t2.xlarge": 0.1856, + "t2.nano": 0.0058, + "t2.2xlarge": 0.3712, + "x1.16xlarge": 6.669, + "x1.32xlarge": 13.338 }, "ec2_us_govwest": { - "c1.medium": "0.157", - "c1.xlarge": "0.628", - "c3.2xlarge": "0.504", - "c3.4xlarge": "1.008", - "c3.8xlarge": "2.016", - "c3.large": "0.126", - "c3.xlarge": "0.252", - "cc2.8xlarge": "2.250", - "hi1.4xlarge": "N/A", - "hs1.8xlarge": "5.520", - "i2.2xlarge": "2.046", - "i2.4xlarge": "4.092", - "i2.8xlarge": "8.184", - "i2.xlarge": "1.023", - "m1.large": "0.211", - "m1.medium": "0.106", - "m1.small": "0.053", - "m1.xlarge": "0.423", - "m2.2xlarge": "0.586", - "m2.4xlarge": "1.171", - "m2.xlarge": "0.293", - "m3.2xlarge": "0.672", - "m3.large": "0.168", - "m3.medium": "0.084", - "m3.xlarge": "0.336", - "r3.2xlarge": "0.840", - "r3.4xlarge": "1.680", - "r3.8xlarge": "3.360", - "r3.large": "0.210", - "r3.xlarge": "0.420", - "t1.micro": "0.024", - "t2.medium": "0.062", - "t2.micro": "0.015", - "t2.small": "0.031" + "c1.medium": 0.157, + "c1.xlarge": 0.628, + "c3.large": 0.126, + "c3.xlarge": 0.252, + "c3.2xlarge": 0.504, + "c3.4xlarge": 1.008, + "c3.8xlarge": 2.016, + "c4.large": 0.12, + "c4.xlarge": 0.239, + "c4.2xlarge": 0.479, + "c4.4xlarge": 0.958, + "c4.8xlarge": 1.915, + "c5.large": 0.102, + "c5.xlarge": 0.204, + "c5.2xlarge": 0.408, + "c5.4xlarge": 0.816, + "c5.9xlarge": 1.836, + "c5.18xlarge": 3.672, + "cc2.8xlarge": 2.25, + "d2.xlarge": 0.828, + "d2.2xlarge": 1.656, + "d2.4xlarge": 3.312, + "d2.8xlarge": 6.624, + "f1.2xlarge": 1.98, + "f1.16xlarge": 15.84, + "g3.4xlarge": 1.32, + "g3.8xlarge": 2.64, + "g3.16xlarge": 5.28, + "hs1.8xlarge": 5.52, + "i2.xlarge": 1.023, + "i2.2xlarge": 2.046, + "i2.4xlarge": 4.092, + "i2.8xlarge": 8.184, + "i3.large": 0.188, + "i3.xlarge": 0.376, + "i3.metal": 6.016, + "i3.2xlarge": 0.752, + "i3.4xlarge": 1.504, + "i3.8xlarge": 3.008, + "i3.16xlarge": 6.016, + "m1.small": 0.053, + "m1.medium": 0.106, + "m1.large": 0.211, + "m1.xlarge": 0.423, + "m2.xlarge": 0.293, + "m2.2xlarge": 0.586, + "m2.4xlarge": 1.171, + "m3.medium": 0.084, + "m3.large": 0.168, + "m3.xlarge": 0.336, + "m3.2xlarge": 0.672, + "m4.large": 0.126, + "m4.xlarge": 0.252, + "m4.2xlarge": 0.504, + "m4.4xlarge": 1.008, + "m4.10xlarge": 2.52, + "m4.16xlarge": 4.032, + "m5.large": 0.121, + "m5.xlarge": 0.242, + "m5.2xlarge": 0.484, + "m5.4xlarge": 0.968, + "m5.12xlarge": 2.904, + "m5.24xlarge": 5.808, + "p2.xlarge": 1.08, + "p2.8xlarge": 8.64, + "p2.16xlarge": 17.28, + "p3.2xlarge": 3.672, + "p3.8xlarge": 14.688, + "p3.16xlarge": 29.376, + "r3.large": 0.2, + "r3.xlarge": 0.399, + "r3.2xlarge": 0.798, + "r3.4xlarge": 1.596, + "r3.8xlarge": 3.192, + "r4.large": 0.16, + "r4.xlarge": 0.319, + "r4.2xlarge": 0.638, + "r4.4xlarge": 1.277, + "r4.8xlarge": 2.554, + "r4.16xlarge": 5.107, + "t1.micro": 0.024, + "t2.micro": 0.0136, + "t2.small": 0.0272, + "t2.medium": 0.0544, + "t2.large": 0.1088, + "t2.xlarge": 0.2176, + "t2.nano": 0.0068, + "t2.2xlarge": 0.4352, + "x1.16xlarge": 8.003, + "x1.32xlarge": 16.006 }, "ec2_us_west": { - "c1.medium": "0.148", - "c1.xlarge": "0.592", - "c3.2xlarge": "0.478", - "c3.4xlarge": "0.956", - "c3.8xlarge": "1.912", - "c3.large": "0.120", - "c3.xlarge": "0.239", - "c4.2xlarge": "0.552", - "c4.4xlarge": "1.104", - "c4.8xlarge": "2.208", - "c4.large": "0.138", - "c4.xlarge": "0.276", - "g2.2xlarge": "0.702", - "hi1.4xlarge": "N/A", - "hs1.8xlarge": "N/A", - "i2.2xlarge": "1.876", - "i2.4xlarge": "3.751", - "i2.8xlarge": "7.502", - "i2.xlarge": "0.938", - "m1.large": "0.190", - "m1.medium": "0.095", - "m1.small": "0.047", - "m1.xlarge": "0.379", - "m2.2xlarge": "0.550", - "m2.4xlarge": "1.100", - "m2.xlarge": "0.275", - "m3.2xlarge": "0.616", - "m3.large": "0.154", - "m3.medium": "0.077", - "m3.xlarge": "0.308", - "r3.2xlarge": "0.780", - "r3.4xlarge": "1.560", - "r3.8xlarge": "3.120", - "r3.large": "0.195", - "r3.xlarge": "0.390", - "t1.micro": "0.025", - "t2.medium": "0.068", - "t2.micro": "0.017", - "t2.small": "0.034" + "c1.medium": 0.148, + "c1.xlarge": 0.592, + "c3.large": 0.12, + "c3.xlarge": 0.239, + "c3.2xlarge": 0.478, + "c3.4xlarge": 0.956, + "c3.8xlarge": 1.912, + "c4.large": 0.124, + "c4.xlarge": 0.249, + "c4.2xlarge": 0.498, + "c4.4xlarge": 0.997, + "c4.8xlarge": 1.993, + "c5.large": 0.106, + "c5.xlarge": 0.212, + "c5.2xlarge": 0.424, + "c5.4xlarge": 0.848, + "c5.9xlarge": 1.908, + "c5.18xlarge": 3.816, + "d2.xlarge": 0.781, + "d2.2xlarge": 1.563, + "d2.4xlarge": 3.125, + "d2.8xlarge": 6.25, + "g2.2xlarge": 0.702, + "g2.8xlarge": 2.808, + "g3.4xlarge": 1.534, + "g3.8xlarge": 3.068, + "g3.16xlarge": 6.136, + "i2.xlarge": 0.938, + "i2.2xlarge": 1.876, + "i2.4xlarge": 3.751, + "i2.8xlarge": 7.502, + "i3.large": 0.172, + "i3.xlarge": 0.344, + "i3.2xlarge": 0.688, + "i3.4xlarge": 1.376, + "i3.8xlarge": 2.752, + "i3.16xlarge": 5.504, + "m1.small": 0.047, + "m1.medium": 0.095, + "m1.large": 0.19, + "m1.xlarge": 0.379, + "m2.xlarge": 0.275, + "m2.2xlarge": 0.55, + "m2.4xlarge": 1.1, + "m3.medium": 0.077, + "m3.large": 0.154, + "m3.xlarge": 0.308, + "m3.2xlarge": 0.616, + "m4.large": 0.117, + "m4.xlarge": 0.234, + "m4.2xlarge": 0.468, + "m4.4xlarge": 0.936, + "m4.10xlarge": 2.34, + "m4.16xlarge": 3.744, + "m5.large": 0.112, + "m5.xlarge": 0.224, + "m5.2xlarge": 0.448, + "m5.4xlarge": 0.896, + "m5.12xlarge": 2.688, + "m5.24xlarge": 5.376, + "r3.large": 0.185, + "r3.xlarge": 0.371, + "r3.2xlarge": 0.741, + "r3.4xlarge": 1.482, + "r3.8xlarge": 2.964, + "r4.large": 0.148, + "r4.xlarge": 0.296, + "r4.2xlarge": 0.593, + "r4.4xlarge": 1.186, + "r4.8xlarge": 2.371, + "r4.16xlarge": 4.742, + "t1.micro": 0.025, + "t2.micro": 0.0138, + "t2.small": 0.0276, + "t2.medium": 0.0552, + "t2.large": 0.1104, + "t2.xlarge": 0.2208, + "t2.nano": 0.0069, + "t2.2xlarge": 0.4416 }, "ec2_us_west_oregon": { - "c1.medium": "0.130", - "c1.xlarge": "0.520", - "c3.2xlarge": "0.420", - "c3.4xlarge": "0.840", - "c3.8xlarge": "1.680", - "c3.large": "0.105", - "c3.xlarge": "0.210", - "c4.2xlarge": "0.464", - "c4.4xlarge": "0.928", - "c4.8xlarge": "1.856", - "c4.large": "0.116", - "c4.xlarge": "0.232", - "cc2.8xlarge": "2.000", - "cr1.8xlarge": "3.500", - "d2.2xlarge": "1.380", - "d2.4xlarge": "2.760", - "d2.8xlarge": "5.520", - "d2.xlarge": "0.690", - "g2.2xlarge": "0.650", - "hi1.4xlarge": "3.100", - "hs1.8xlarge": "4.600", - "i2.2xlarge": "1.705", - "i2.4xlarge": "3.410", - "i2.8xlarge": "6.820", - "i2.xlarge": "0.853", - "m1.large": "0.175", - "m1.medium": "0.087", - "m1.small": "0.044", - "m1.xlarge": "0.350", - "m2.2xlarge": "0.490", - "m2.4xlarge": "0.980", - "m2.xlarge": "0.245", - "m3.2xlarge": "0.560", - "m3.large": "0.140", - "m3.medium": "0.070", - "m3.xlarge": "0.280", - "r3.2xlarge": "0.700", - "r3.4xlarge": "1.400", - "r3.8xlarge": "2.800", - "r3.large": "0.175", - "r3.xlarge": "0.350", - "t1.micro": "0.020", - "t2.medium": "0.052", - "t2.micro": "0.013", - "t2.small": "0.026" + "c1.medium": 0.13, + "c1.xlarge": 0.52, + "c3.large": 0.105, + "c3.xlarge": 0.21, + "c3.2xlarge": 0.42, + "c3.4xlarge": 0.84, + "c3.8xlarge": 1.68, + "c4.large": 0.1, + "c4.xlarge": 0.199, + "c4.2xlarge": 0.398, + "c4.4xlarge": 0.796, + "c4.8xlarge": 1.591, + "c5.large": 0.085, + "c5.xlarge": 0.17, + "c5.2xlarge": 0.34, + "c5.4xlarge": 0.68, + "c5.9xlarge": 1.53, + "c5.18xlarge": 3.06, + "c5d.large": 0.096, + "c5d.xlarge": 0.192, + "c5d.2xlarge": 0.384, + "c5d.4xlarge": 0.768, + "c5d.9xlarge": 1.728, + "c5d.18xlarge": 3.456, + "cc2.8xlarge": 2.0, + "cr1.8xlarge": 3.5, + "d2.xlarge": 0.69, + "d2.2xlarge": 1.38, + "d2.4xlarge": 2.76, + "d2.8xlarge": 5.52, + "f1.2xlarge": 1.65, + "f1.16xlarge": 13.2, + "g2.2xlarge": 0.65, + "g2.8xlarge": 2.6, + "g3.4xlarge": 1.14, + "g3.8xlarge": 2.28, + "g3.16xlarge": 4.56, + "h1.2xlarge": 0.468, + "h1.4xlarge": 0.936, + "h1.8xlarge": 1.872, + "h1.16xlarge": 3.744, + "hs1.8xlarge": 4.6, + "i2.xlarge": 0.853, + "i2.2xlarge": 1.705, + "i2.4xlarge": 3.41, + "i2.8xlarge": 6.82, + "i3.large": 0.156, + "i3.xlarge": 0.312, + "i3.metal": 4.992, + "i3.2xlarge": 0.624, + "i3.4xlarge": 1.248, + "i3.8xlarge": 2.496, + "i3.16xlarge": 4.992, + "m1.small": 0.044, + "m1.medium": 0.087, + "m1.large": 0.175, + "m1.xlarge": 0.35, + "m2.xlarge": 0.245, + "m2.2xlarge": 0.49, + "m2.4xlarge": 0.98, + "m3.medium": 0.067, + "m3.large": 0.133, + "m3.xlarge": 0.266, + "m3.2xlarge": 0.532, + "m4.large": 0.1, + "m4.xlarge": 0.2, + "m4.2xlarge": 0.4, + "m4.4xlarge": 0.8, + "m4.10xlarge": 2.0, + "m4.16xlarge": 3.2, + "m5.large": 0.096, + "m5.xlarge": 0.192, + "m5.2xlarge": 0.384, + "m5.4xlarge": 0.768, + "m5.12xlarge": 2.304, + "m5.24xlarge": 4.608, + "m5d.large": 0.113, + "m5d.xlarge": 0.226, + "m5d.2xlarge": 0.452, + "m5d.4xlarge": 0.904, + "m5d.12xlarge": 2.712, + "m5d.24xlarge": 5.424, + "p2.xlarge": 0.9, + "p2.8xlarge": 7.2, + "p2.16xlarge": 14.4, + "p3.2xlarge": 3.06, + "p3.8xlarge": 12.24, + "p3.16xlarge": 24.48, + "r3.large": 0.166, + "r3.xlarge": 0.333, + "r3.2xlarge": 0.665, + "r3.4xlarge": 1.33, + "r3.8xlarge": 2.66, + "r4.large": 0.133, + "r4.xlarge": 0.266, + "r4.2xlarge": 0.532, + "r4.4xlarge": 1.064, + "r4.8xlarge": 2.128, + "r4.16xlarge": 4.256, + "t1.micro": 0.02, + "t2.micro": 0.0116, + "t2.small": 0.023, + "t2.medium": 0.0464, + "t2.large": 0.0928, + "t2.xlarge": 0.1856, + "t2.nano": 0.0058, + "t2.2xlarge": 0.3712, + "x1.16xlarge": 6.669, + "x1.32xlarge": 13.338, + "x1e.xlarge": 0.834, + "x1e.2xlarge": 1.668, + "x1e.4xlarge": 3.336, + "x1e.8xlarge": 6.672, + "x1e.16xlarge": 13.344, + "x1e.32xlarge": 26.688 + }, + "ec2_windows": { + "c1.medium": { + "ap-northeast-1": 0.258, + "ap-southeast-1": 0.266, + "ap-southeast-2": 0.266, + "eu-west-1": 0.21, + "sa-east-1": 0.259, + "us-east-1": 0.13, + "us-gov-west-1": 0.237, + "us-west-1": 0.228, + "us-west-2": 0.13 + }, + "c1.xlarge": { + "ap-northeast-1": 0.632, + "ap-southeast-1": 1.065, + "ap-southeast-2": 1.065, + "eu-west-1": 0.84, + "sa-east-1": 1.038, + "us-east-1": 0.52, + "us-gov-west-1": 0.628, + "us-west-1": 0.592, + "us-west-2": 0.84 + }, + "c3.large": { + "ap-northeast-1": 0.254, + "ap-northeast-2": 0.12672, + "ap-southeast-1": 0.132, + "ap-southeast-2": 0.132, + "eu-central-1": 0.129, + "eu-west-1": 0.188, + "sa-east-1": 0.246, + "us-east-1": 0.105, + "us-gov-west-1": 0.209, + "us-west-1": 0.188, + "us-west-2": 0.188 + }, + "c3.xlarge": { + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.477, + "eu-central-1": 0.258, + "eu-west-1": 0.184, + "sa-east-1": 0.0, + "us-east-1": 0.21, + "us-gov-west-1": 0.252, + "us-west-1": 0.184, + "us-west-2": 0.21 + }, + "c3.2xlarge": { + "ap-northeast-1": 0.511, + "ap-northeast-2": 0.50589, + "ap-southeast-1": 0.529, + "ap-southeast-2": 0.953, + "eu-central-1": 0.516, + "eu-west-1": 0.752, + "sa-east-1": 0.368, + "us-east-1": 0.42, + "us-gov-west-1": 0.0, + "us-west-1": 0.368, + "us-west-2": 0.42 + }, + "c3.4xlarge": { + "ap-northeast-1": 1.021, + "ap-northeast-2": 1.655, + "ap-southeast-1": 0.736, + "ap-southeast-2": 0.0, + "eu-central-1": 1.696, + "eu-west-1": 1.504, + "sa-east-1": 1.964, + "us-east-1": 0.736, + "us-gov-west-1": 1.008, + "us-west-1": 0.736, + "us-west-2": 1.504 + }, + "c3.8xlarge": { + "ap-northeast-1": 1.472, + "ap-northeast-2": 0.0, + "ap-southeast-1": 1.472, + "ap-southeast-2": 3.813, + "eu-central-1": 3.392, + "eu-west-1": 3.008, + "sa-east-1": 2.6, + "us-east-1": 3.008, + "us-gov-west-1": 3.344, + "us-west-1": 3.008, + "us-west-2": 1.68 + }, + "c4.large": { + "ap-northeast-1": 0.126, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.092, + "ap-south-1": 0.092, + "ap-southeast-1": 0.115, + "ap-southeast-2": 0.13, + "ca-central-1": 0.202, + "eu-central-1": 0.092, + "eu-west-1": 0.113, + "eu-west-2": 0.0, + "sa-east-1": 0.247, + "us-east-1": 0.1, + "us-east-2": 0.1, + "us-gov-west-1": 0.092, + "us-west-1": 0.124, + "us-west-2": 0.092 + }, + "c4.xlarge": { + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.227, + "ap-northeast-3": 0.436, + "ap-south-1": 0.384, + "ap-southeast-1": 0.415, + "ap-southeast-2": 0.0, + "ca-central-1": 0.424, + "eu-central-1": 0.411, + "eu-west-1": 0.226, + "eu-west-2": 0.237, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.184, + "us-gov-west-1": 0.184, + "us-west-1": 0.249, + "us-west-2": 0.199 + }, + "c4.2xlarge": { + "ap-northeast-1": 0.504, + "ap-northeast-2": 0.822, + "ap-northeast-3": 0.872, + "ap-south-1": 0.368, + "ap-southeast-1": 0.876, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 0.822, + "eu-west-1": 0.821, + "eu-west-2": 0.368, + "sa-east-1": 0.986, + "us-east-1": 0.766, + "us-east-2": 0.368, + "us-gov-west-1": 0.847, + "us-west-1": 0.866, + "us-west-2": 0.398 + }, + "c4.4xlarge": { + "ap-northeast-1": 0.736, + "ap-northeast-2": 0.907, + "ap-northeast-3": 0.736, + "ap-south-1": 0.0, + "ap-southeast-1": 0.924, + "ap-southeast-2": 0.736, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 1.641, + "eu-west-2": 0.736, + "sa-east-1": 0.0, + "us-east-1": 1.532, + "us-east-2": 1.532, + "us-gov-west-1": 0.958, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c4.8xlarge": { + "ap-northeast-1": 3.672, + "ap-northeast-2": 0.0, + "ap-northeast-3": 3.672, + "ap-south-1": 1.656, + "ap-southeast-1": 1.848, + "ap-southeast-2": 1.656, + "ca-central-1": 3.406, + "eu-central-1": 3.473, + "eu-west-1": 0.0, + "eu-west-2": 1.902, + "sa-east-1": 1.656, + "us-east-1": 0.0, + "us-east-2": 1.656, + "us-gov-west-1": 1.656, + "us-west-1": 3.536, + "us-west-2": 1.656 + }, + "c5.large": { + "af-south-1": 0.092, + "ap-east-1": 0.092, + "ap-northeast-1": 0.092, + "ap-northeast-2": 0.188, + "ap-northeast-3": 0.0, + "ap-south-1": 0.177, + "ap-south-2": 0.0, + "ap-southeast-1": 0.19, + "ap-southeast-2": 0.203, + "ap-southeast-3": 0.098, + "ap-southeast-4": 0.111, + "ca-central-1": 0.093, + "ca-west-1": 0.092, + "eu-central-1": 0.195, + "eu-central-2": 0.107, + "eu-north-1": 0.091, + "eu-south-1": 0.199, + "eu-south-2": 0.102, + "eu-west-1": 0.092, + "eu-west-2": 0.0, + "eu-west-3": 0.092, + "il-central-1": 0.193, + "me-central-1": 0.198, + "me-south-1": 0.106, + "sa-east-1": 0.092, + "us-east-1": 0.092, + "us-east-2": 0.085, + "us-gov-east-1": 0.194, + "us-gov-west-1": 0.108, + "us-west-1": 0.0, + "us-west-2": 0.085, + "us-west-2-lax-1": 0.194 + }, + "c5.xlarge": { + "af-south-1": 0.412, + "ap-east-1": 0.216, + "ap-northeast-1": 0.214, + "ap-northeast-2": 0.184, + "ap-northeast-3": 0.214, + "ap-south-1": 0.354, + "ap-south-2": 0.354, + "ap-southeast-1": 0.38, + "ap-southeast-2": 0.184, + "ap-southeast-3": 0.208, + "ap-southeast-4": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 0.186, + "eu-central-1": 0.378, + "eu-central-2": 0.184, + "eu-north-1": 0.366, + "eu-south-1": 0.386, + "eu-south-2": 0.192, + "eu-west-1": 0.184, + "eu-west-2": 0.386, + "eu-west-3": 0.215, + "il-central-1": 0.202, + "me-central-1": 0.184, + "me-south-1": 0.184, + "sa-east-1": 0.28, + "us-east-1": 0.184, + "us-east-2": 0.0, + "us-gov-east-1": 0.388, + "us-gov-west-1": 0.388, + "us-west-1": 0.212, + "us-west-2": 0.184, + "us-west-2-lax-1": 0.184 + }, + "c5.metal": { + "af-south-1": 4.416, + "ap-east-1": 9.6, + "ap-northeast-1": 5.136, + "ap-northeast-2": 9.024, + "ap-northeast-3": 4.416, + "ap-south-1": 8.496, + "ap-south-2": 8.496, + "ap-southeast-1": 4.704, + "ap-southeast-2": 5.328, + "ap-southeast-3": 4.704, + "ap-southeast-4": 5.328, + "ca-central-1": 4.416, + "ca-west-1": 4.416, + "eu-central-1": 9.072, + "eu-central-2": 0.0, + "eu-north-1": 4.368, + "eu-south-1": 4.416, + "eu-south-2": 9.024, + "eu-west-1": 4.416, + "eu-west-2": 4.848, + "eu-west-3": 9.264, + "il-central-1": 9.254, + "me-central-1": 4.416, + "me-south-1": 4.416, + "sa-east-1": 10.704, + "us-east-1": 0.0, + "us-east-2": 8.496, + "us-gov-east-1": 4.896, + "us-gov-west-1": 4.416, + "us-west-1": 5.088, + "us-west-2": 4.416, + "us-west-2-lax-1": 4.416 + }, + "c5.2xlarge": { + "af-south-1": 0.851, + "ap-east-1": 0.432, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.368, + "ap-northeast-3": 0.428, + "ap-south-1": 0.708, + "ap-south-2": 0.708, + "ap-southeast-1": 0.392, + "ap-southeast-2": 0.444, + "ap-southeast-3": 0.368, + "ap-southeast-4": 0.444, + "ca-central-1": 0.74, + "ca-west-1": 0.368, + "eu-central-1": 0.368, + "eu-central-2": 0.427, + "eu-north-1": 0.732, + "eu-south-1": 0.368, + "eu-south-2": 0.368, + "eu-west-1": 0.384, + "eu-west-2": 0.404, + "eu-west-3": 0.404, + "il-central-1": 0.0, + "me-central-1": 0.0, + "me-south-1": 0.368, + "sa-east-1": 0.892, + "us-east-1": 0.34, + "us-east-2": 0.368, + "us-gov-east-1": 0.408, + "us-gov-west-1": 0.408, + "us-west-1": 0.0, + "us-west-2": 0.708, + "us-west-2-lax-1": 0.776 + }, + "c5.4xlarge": { + "af-south-1": 1.648, + "ap-east-1": 0.864, + "ap-northeast-1": 1.651, + "ap-northeast-2": 0.736, + "ap-northeast-3": 0.736, + "ap-south-1": 0.736, + "ap-south-2": 1.416, + "ap-southeast-1": 1.52, + "ap-southeast-2": 0.888, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.736, + "ca-central-1": 0.744, + "ca-west-1": 0.736, + "eu-central-1": 1.512, + "eu-central-2": 1.59, + "eu-north-1": 1.464, + "eu-south-1": 0.856, + "eu-south-2": 0.736, + "eu-west-1": 0.0, + "eu-west-2": 0.808, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 0.845, + "me-south-1": 1.581, + "sa-east-1": 0.736, + "us-east-1": 0.68, + "us-east-2": 1.416, + "us-gov-east-1": 1.552, + "us-gov-west-1": 0.816, + "us-west-1": 0.903, + "us-west-2": 1.416, + "us-west-2-lax-1": 0.736 + }, + "c5.9xlarge": { + "af-south-1": 1.656, + "ap-east-1": 3.725, + "ap-northeast-1": 2.058, + "ap-northeast-2": 1.656, + "ap-northeast-3": 3.582, + "ap-south-1": 0.0, + "ap-south-2": 1.53, + "ap-southeast-1": 3.533, + "ap-southeast-2": 2.119, + "ap-southeast-3": 3.42, + "ap-southeast-4": 1.998, + "ca-central-1": 1.656, + "ca-west-1": 0.0, + "eu-central-1": 3.402, + "eu-central-2": 1.921, + "eu-north-1": 3.294, + "eu-south-1": 3.474, + "eu-south-2": 3.384, + "eu-west-1": 1.656, + "eu-west-2": 1.656, + "eu-west-3": 1.818, + "il-central-1": 3.47, + "me-central-1": 1.901, + "me-south-1": 1.656, + "sa-east-1": 4.014, + "us-east-1": 1.53, + "us-east-2": 3.186, + "us-gov-east-1": 3.492, + "us-gov-west-1": 1.656, + "us-west-1": 1.656, + "us-west-2": 1.656, + "us-west-2-lax-1": 3.492 + }, + "c5.12xlarge": { + "af-south-1": 4.944, + "ap-east-1": 2.208, + "ap-northeast-1": 4.776, + "ap-northeast-2": 2.453, + "ap-northeast-3": 0.0, + "ap-south-1": 2.171, + "ap-south-2": 2.208, + "ap-southeast-1": 2.352, + "ap-southeast-2": 2.664, + "ap-southeast-3": 2.208, + "ap-southeast-4": 4.872, + "ca-central-1": 2.232, + "ca-west-1": 2.208, + "eu-central-1": 4.536, + "eu-central-2": 2.208, + "eu-north-1": 4.392, + "eu-south-1": 2.569, + "eu-south-2": 2.304, + "eu-west-1": 2.208, + "eu-west-2": 2.208, + "eu-west-3": 0.0, + "il-central-1": 2.419, + "me-central-1": 0.0, + "me-south-1": 2.208, + "sa-east-1": 0.0, + "us-east-1": 4.248, + "us-east-2": 2.208, + "us-gov-east-1": 4.803, + "us-gov-west-1": 2.448, + "us-west-1": 2.544, + "us-west-2": 2.04, + "us-west-2-lax-1": 2.208 + }, + "c5.18xlarge": { + "af-south-1": 3.312, + "ap-east-1": 3.312, + "ap-northeast-1": 3.312, + "ap-northeast-2": 6.768, + "ap-northeast-3": 7.164, + "ap-south-1": 3.312, + "ap-south-2": 6.372, + "ap-southeast-1": 3.528, + "ap-southeast-2": 7.308, + "ap-southeast-3": 3.312, + "ap-southeast-4": 7.308, + "ca-central-1": 6.66, + "ca-west-1": 3.312, + "eu-central-1": 0.0, + "eu-central-2": 7.153, + "eu-north-1": 3.312, + "eu-south-1": 3.636, + "eu-south-2": 3.456, + "eu-west-1": 3.312, + "eu-west-2": 3.636, + "eu-west-3": 3.312, + "il-central-1": 6.941, + "me-central-1": 7.114, + "me-south-1": 3.802, + "sa-east-1": 4.716, + "us-east-1": 3.06, + "us-east-2": 3.312, + "us-gov-east-1": 3.672, + "us-gov-west-1": 6.984, + "us-west-1": 0.0, + "us-west-2": 6.372, + "us-west-2-lax-1": 6.984 + }, + "c5.24xlarge": { + "af-south-1": 9.888, + "ap-east-1": 9.6, + "ap-northeast-1": 5.136, + "ap-northeast-2": 0.0, + "ap-northeast-3": 5.136, + "ap-south-1": 8.496, + "ap-south-2": 4.08, + "ap-southeast-1": 5.006, + "ap-southeast-2": 4.416, + "ap-southeast-3": 4.704, + "ap-southeast-4": 0.0, + "ca-central-1": 8.88, + "ca-west-1": 8.88, + "eu-central-1": 4.656, + "eu-central-2": 9.538, + "eu-north-1": 4.416, + "eu-south-1": 4.848, + "eu-south-2": 4.416, + "eu-west-1": 9.024, + "eu-west-2": 9.264, + "eu-west-3": 9.264, + "il-central-1": 4.838, + "me-central-1": 9.485, + "me-south-1": 0.0, + "sa-east-1": 6.288, + "us-east-1": 8.496, + "us-east-2": 0.0, + "us-gov-east-1": 5.191, + "us-gov-west-1": 0.0, + "us-west-1": 4.416, + "us-west-2": 4.08, + "us-west-2-lax-1": 4.416 + }, + "c5a.large": { + "af-south-1": 0.195, + "ap-east-1": 0.189, + "ap-northeast-1": 0.188, + "ap-northeast-2": 0.178, + "ap-south-1": 0.139, + "ap-southeast-1": 0.18, + "ap-southeast-2": 0.192, + "ca-central-1": 0.176, + "eu-central-1": 0.179, + "eu-north-1": 0.174, + "eu-south-1": 0.183, + "eu-west-1": 0.178, + "eu-west-2": 0.183, + "eu-west-3": 0.183, + "me-south-1": 0.187, + "sa-east-1": 0.21, + "us-east-1": 0.169, + "us-east-2": 0.169, + "us-gov-east-1": 0.184, + "us-gov-west-1": 0.184, + "us-west-1": 0.187, + "us-west-2": 0.077 + }, + "c5a.xlarge": { + "af-south-1": 0.39, + "ap-east-1": 0.378, + "ap-northeast-1": 0.376, + "ap-northeast-2": 0.356, + "ap-south-1": 0.278, + "ap-southeast-1": 0.36, + "ap-southeast-2": 0.384, + "ca-central-1": 0.352, + "eu-central-1": 0.358, + "eu-north-1": 0.348, + "eu-south-1": 0.366, + "eu-west-1": 0.356, + "eu-west-2": 0.366, + "eu-west-3": 0.366, + "me-south-1": 0.374, + "sa-east-1": 0.42, + "us-east-1": 0.338, + "us-east-2": 0.338, + "us-gov-east-1": 0.368, + "us-gov-west-1": 0.368, + "us-west-1": 0.374, + "us-west-2": 0.338 + }, + "c5a.2xlarge": { + "af-south-1": 0.78, + "ap-east-1": 0.756, + "ap-northeast-1": 0.752, + "ap-northeast-2": 0.712, + "ap-south-1": 0.556, + "ap-southeast-1": 0.72, + "ap-southeast-2": 0.768, + "ca-central-1": 0.704, + "eu-central-1": 0.716, + "eu-north-1": 0.696, + "eu-south-1": 0.732, + "eu-west-1": 0.712, + "eu-west-2": 0.732, + "eu-west-3": 0.732, + "me-south-1": 0.748, + "sa-east-1": 0.84, + "us-east-1": 0.676, + "us-east-2": 0.676, + "us-gov-east-1": 0.736, + "us-gov-west-1": 0.736, + "us-west-1": 0.748, + "us-west-2": 0.308 + }, + "c5a.4xlarge": { + "af-south-1": 1.56, + "ap-east-1": 1.512, + "ap-northeast-1": 1.504, + "ap-northeast-2": 1.424, + "ap-south-1": 1.112, + "ap-southeast-1": 1.44, + "ap-southeast-2": 1.536, + "ca-central-1": 1.408, + "eu-central-1": 1.432, + "eu-north-1": 1.392, + "eu-south-1": 1.464, + "eu-west-1": 1.424, + "eu-west-2": 1.464, + "eu-west-3": 1.464, + "me-south-1": 1.496, + "sa-east-1": 1.68, + "us-east-1": 1.352, + "us-east-2": 1.352, + "us-gov-east-1": 1.472, + "us-gov-west-1": 1.472, + "us-west-1": 1.496, + "us-west-2": 1.352 + }, + "c5a.8xlarge": { + "af-south-1": 3.12, + "ap-east-1": 3.024, + "ap-northeast-1": 3.008, + "ap-northeast-2": 2.848, + "ap-south-1": 2.224, + "ap-southeast-1": 2.88, + "ap-southeast-2": 3.072, + "ca-central-1": 2.816, + "eu-central-1": 2.864, + "eu-north-1": 2.784, + "eu-south-1": 2.928, + "eu-west-1": 2.848, + "eu-west-2": 2.928, + "eu-west-3": 2.928, + "me-south-1": 2.992, + "sa-east-1": 3.36, + "us-east-1": 2.704, + "us-east-2": 2.704, + "us-gov-east-1": 2.944, + "us-gov-west-1": 2.944, + "us-west-1": 2.992, + "us-west-2": 1.232 + }, + "c5a.12xlarge": { + "af-south-1": 4.68, + "ap-east-1": 4.536, + "ap-northeast-1": 4.512, + "ap-northeast-2": 4.272, + "ap-south-1": 3.336, + "ap-southeast-1": 4.32, + "ap-southeast-2": 4.608, + "ca-central-1": 4.224, + "eu-central-1": 4.296, + "eu-north-1": 4.176, + "eu-south-1": 4.392, + "eu-west-1": 4.272, + "eu-west-2": 4.392, + "eu-west-3": 4.392, + "me-south-1": 4.488, + "sa-east-1": 5.04, + "us-east-1": 4.056, + "us-east-2": 4.056, + "us-gov-east-1": 4.416, + "us-gov-west-1": 4.416, + "us-west-1": 4.488, + "us-west-2": 1.848 + }, + "c5a.16xlarge": { + "af-south-1": 6.24, + "ap-east-1": 6.048, + "ap-northeast-1": 6.016, + "ap-northeast-2": 5.696, + "ap-south-1": 4.448, + "ap-southeast-1": 5.76, + "ap-southeast-2": 6.144, + "ca-central-1": 5.632, + "eu-central-1": 5.728, + "eu-north-1": 5.568, + "eu-south-1": 5.856, + "eu-west-1": 5.696, + "eu-west-2": 5.856, + "eu-west-3": 5.856, + "me-south-1": 5.984, + "sa-east-1": 6.72, + "us-east-1": 5.408, + "us-east-2": 5.408, + "us-gov-east-1": 5.888, + "us-gov-west-1": 5.888, + "us-west-1": 5.984, + "us-west-2": 2.464 + }, + "c5a.24xlarge": { + "af-south-1": 9.36, + "ap-east-1": 9.072, + "ap-northeast-1": 9.024, + "ap-northeast-2": 8.544, + "ap-south-1": 6.672, + "ap-southeast-1": 8.64, + "ap-southeast-2": 9.216, + "ca-central-1": 8.448, + "eu-central-1": 8.592, + "eu-north-1": 8.352, + "eu-south-1": 8.784, + "eu-west-1": 8.544, + "eu-west-2": 8.784, + "eu-west-3": 8.784, + "me-south-1": 8.976, + "sa-east-1": 10.08, + "us-east-1": 8.112, + "us-east-2": 8.112, + "us-gov-east-1": 8.832, + "us-gov-west-1": 8.832, + "us-west-1": 8.976, + "us-west-2": 8.112 + }, + "c5ad.large": { + "af-south-1": 0.209, + "ap-southeast-1": 0.193, + "ap-southeast-2": 0.205, + "eu-central-1": 0.192, + "eu-south-1": 0.195, + "eu-west-1": 0.19, + "me-south-1": 0.2, + "sa-east-1": 0.226, + "us-east-1": 0.178, + "us-east-2": 0.178, + "us-west-2": 0.178 + }, + "c5ad.xlarge": { + "af-south-1": 0.418, + "ap-southeast-1": 0.386, + "ap-southeast-2": 0.41, + "eu-central-1": 0.384, + "eu-south-1": 0.39, + "eu-west-1": 0.196, + "me-south-1": 0.4, + "sa-east-1": 0.452, + "us-east-1": 0.356, + "us-east-2": 0.356, + "us-west-2": 0.356 + }, + "c5ad.2xlarge": { + "af-south-1": 0.836, + "ap-southeast-1": 0.772, + "ap-southeast-2": 0.82, + "eu-central-1": 0.768, + "eu-south-1": 0.78, + "eu-west-1": 0.76, + "me-south-1": 0.8, + "sa-east-1": 0.904, + "us-east-1": 0.712, + "us-east-2": 0.712, + "us-west-2": 0.712 + }, + "c5ad.4xlarge": { + "af-south-1": 1.672, + "ap-southeast-1": 1.544, + "ap-southeast-2": 1.64, + "eu-central-1": 1.536, + "eu-south-1": 1.56, + "eu-west-1": 1.52, + "me-south-1": 1.6, + "sa-east-1": 1.808, + "us-east-1": 1.424, + "us-east-2": 1.424, + "us-west-2": 1.424 + }, + "c5ad.8xlarge": { + "af-south-1": 3.344, + "ap-southeast-1": 3.088, + "ap-southeast-2": 3.28, + "eu-central-1": 3.072, + "eu-south-1": 3.12, + "eu-west-1": 1.568, + "me-south-1": 3.2, + "sa-east-1": 3.616, + "us-east-1": 2.848, + "us-east-2": 2.848, + "us-west-2": 2.848 + }, + "c5ad.12xlarge": { + "af-south-1": 5.016, + "ap-southeast-1": 4.632, + "ap-southeast-2": 4.92, + "eu-central-1": 4.608, + "eu-south-1": 4.68, + "eu-west-1": 4.56, + "me-south-1": 4.8, + "sa-east-1": 5.424, + "us-east-1": 4.272, + "us-east-2": 4.272, + "us-west-2": 4.272 + }, + "c5ad.16xlarge": { + "af-south-1": 6.688, + "ap-southeast-1": 6.176, + "ap-southeast-2": 6.56, + "eu-central-1": 6.144, + "eu-south-1": 6.24, + "eu-west-1": 6.08, + "me-south-1": 6.4, + "sa-east-1": 7.232, + "us-east-1": 5.696, + "us-east-2": 5.696, + "us-west-2": 5.696 + }, + "c5ad.24xlarge": { + "af-south-1": 10.032, + "ap-southeast-1": 9.264, + "ap-southeast-2": 9.84, + "eu-central-1": 9.216, + "eu-south-1": 9.36, + "eu-west-1": 4.704, + "me-south-1": 9.6, + "sa-east-1": 10.848, + "us-east-1": 8.544, + "us-east-2": 8.544, + "us-west-2": 8.544 + }, + "c5d.large": { + "af-south-1": 0.092, + "ap-east-1": 0.215, + "ap-northeast-1": 0.092, + "ap-northeast-2": 0.202, + "ap-northeast-3": 0.214, + "ap-south-1": 0.092, + "ap-south-2": 0.092, + "ap-southeast-1": 0.204, + "ap-southeast-2": 0.218, + "ap-southeast-3": 0.204, + "ap-southeast-4": 0.092, + "ca-central-1": 0.198, + "eu-central-1": 0.21, + "eu-central-2": 0.122, + "eu-north-1": 0.196, + "eu-south-1": 0.206, + "eu-south-2": 0.201, + "eu-west-1": 0.208, + "eu-west-2": 0.0, + "eu-west-3": 0.207, + "il-central-1": 0.206, + "me-central-1": 0.12, + "me-south-1": 0.212, + "sa-east-1": 0.092, + "us-east-1": 0.188, + "us-east-2": 0.096, + "us-gov-east-1": 0.092, + "us-gov-west-1": 0.092, + "us-west-1": 0.212, + "us-west-2": 0.096 + }, + "c5d.xlarge": { + "af-south-1": 0.184, + "ap-east-1": 0.43, + "ap-northeast-1": 0.428, + "ap-northeast-2": 0.404, + "ap-northeast-3": 0.184, + "ap-south-1": 0.382, + "ap-south-2": 0.382, + "ap-southeast-1": 0.408, + "ap-southeast-2": 0.436, + "ap-southeast-3": 0.224, + "ap-southeast-4": 0.436, + "ca-central-1": 0.212, + "eu-central-1": 0.406, + "eu-central-2": 0.184, + "eu-north-1": 0.392, + "eu-south-1": 0.184, + "eu-south-2": 0.402, + "eu-west-1": 0.402, + "eu-west-2": 0.414, + "eu-west-3": 0.414, + "il-central-1": 0.229, + "me-central-1": 0.0, + "me-south-1": 0.184, + "sa-east-1": 0.482, + "us-east-1": 0.0, + "us-east-2": 0.184, + "us-gov-east-1": 0.184, + "us-gov-west-1": 0.232, + "us-west-1": 0.424, + "us-west-2": 0.192 + }, + "c5d.metal": { + "af-south-1": 4.416, + "ap-northeast-1": 10.272, + "ap-northeast-2": 9.696, + "ap-northeast-3": 4.416, + "ap-south-1": 9.168, + "ap-south-2": 9.168, + "ap-southeast-1": 9.792, + "ap-southeast-2": 10.464, + "ap-southeast-3": 0.0, + "ap-southeast-4": 10.464, + "ca-central-1": 4.416, + "eu-central-1": 9.744, + "eu-central-2": 10.277, + "eu-north-1": 9.408, + "eu-south-1": 9.888, + "eu-south-2": 4.416, + "eu-west-1": 9.648, + "eu-west-2": 4.416, + "il-central-1": 0.0, + "me-central-1": 0.0, + "sa-east-1": 11.568, + "us-east-1": 9.024, + "us-east-2": 9.024, + "us-gov-west-1": 5.568, + "us-west-1": 10.176, + "us-west-2": 9.024 + }, + "c5d.2xlarge": { + "af-south-1": 0.888, + "ap-east-1": 0.86, + "ap-northeast-1": 0.368, + "ap-northeast-2": 0.808, + "ap-northeast-3": 0.856, + "ap-south-1": 0.368, + "ap-south-2": 0.764, + "ap-southeast-1": 0.816, + "ap-southeast-2": 0.872, + "ap-southeast-3": 0.448, + "ap-southeast-4": 0.368, + "ca-central-1": 0.368, + "eu-central-1": 0.812, + "eu-central-2": 0.368, + "eu-north-1": 0.784, + "eu-south-1": 0.368, + "eu-south-2": 0.804, + "eu-west-1": 0.804, + "eu-west-2": 0.828, + "eu-west-3": 0.368, + "il-central-1": 0.0, + "me-central-1": 0.848, + "me-south-1": 0.368, + "sa-east-1": 0.368, + "us-east-1": 0.384, + "us-east-2": 0.0, + "us-gov-east-1": 0.832, + "us-gov-west-1": 0.0, + "us-west-1": 0.848, + "us-west-2": 0.0 + }, + "c5d.4xlarge": { + "af-south-1": 0.736, + "ap-east-1": 1.72, + "ap-northeast-1": 0.736, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.736, + "ap-south-1": 1.528, + "ap-south-2": 0.736, + "ap-southeast-1": 0.736, + "ap-southeast-2": 1.744, + "ap-southeast-3": 1.632, + "ap-southeast-4": 1.744, + "ca-central-1": 0.736, + "eu-central-1": 0.888, + "eu-central-2": 1.713, + "eu-north-1": 0.736, + "eu-south-1": 1.648, + "eu-south-2": 0.736, + "eu-west-1": 0.929, + "eu-west-2": 0.92, + "eu-west-3": 0.736, + "il-central-1": 0.916, + "me-central-1": 0.959, + "me-south-1": 0.736, + "sa-east-1": 1.928, + "us-east-1": 1.504, + "us-east-2": 0.736, + "us-gov-east-1": 1.664, + "us-gov-west-1": 0.928, + "us-west-1": 0.96, + "us-west-2": 0.0 + }, + "c5d.9xlarge": { + "af-south-1": 1.656, + "ap-east-1": 3.87, + "ap-northeast-1": 3.852, + "ap-northeast-2": 1.98, + "ap-northeast-3": 3.852, + "ap-south-1": 3.438, + "ap-south-2": 3.438, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.924, + "ap-southeast-3": 3.672, + "ap-southeast-4": 1.656, + "ca-central-1": 1.908, + "eu-central-1": 0.0, + "eu-central-2": 3.854, + "eu-north-1": 3.528, + "eu-south-1": 3.708, + "eu-south-2": 3.618, + "eu-west-1": 1.656, + "eu-west-2": 2.07, + "eu-west-3": 1.656, + "il-central-1": 0.0, + "me-central-1": 1.656, + "me-south-1": 3.814, + "sa-east-1": 1.656, + "us-east-1": 1.656, + "us-east-2": 1.728, + "us-gov-east-1": 1.656, + "us-gov-west-1": 3.744, + "us-west-1": 1.656, + "us-west-2": 1.656 + }, + "c5d.12xlarge": { + "af-south-1": 5.328, + "ap-northeast-1": 5.136, + "ap-northeast-2": 4.848, + "ap-northeast-3": 5.136, + "ap-south-1": 2.208, + "ap-south-2": 4.584, + "ap-southeast-1": 4.896, + "ap-southeast-2": 5.232, + "ap-southeast-3": 4.896, + "ap-southeast-4": 5.232, + "ca-central-1": 4.752, + "eu-central-1": 4.872, + "eu-central-2": 2.208, + "eu-north-1": 4.704, + "eu-south-1": 2.208, + "eu-south-2": 2.773, + "eu-west-1": 2.208, + "eu-west-2": 4.968, + "il-central-1": 2.208, + "me-central-1": 2.878, + "sa-east-1": 5.784, + "us-east-1": 4.512, + "us-east-2": 4.512, + "us-gov-west-1": 5.16, + "us-west-1": 5.088, + "us-west-2": 4.512 + }, + "c5d.18xlarge": { + "af-south-1": 3.312, + "ap-east-1": 7.74, + "ap-northeast-1": 3.312, + "ap-northeast-2": 3.312, + "ap-northeast-3": 3.312, + "ap-south-1": 3.312, + "ap-south-2": 0.0, + "ap-southeast-1": 4.032, + "ap-southeast-2": 7.848, + "ap-southeast-3": 7.344, + "ap-southeast-4": 4.536, + "ca-central-1": 0.0, + "eu-central-1": 7.308, + "eu-central-2": 3.312, + "eu-north-1": 3.312, + "eu-south-1": 3.312, + "eu-south-2": 3.924, + "eu-west-1": 0.0, + "eu-west-2": 3.312, + "eu-west-3": 7.452, + "il-central-1": 7.432, + "me-central-1": 7.628, + "me-south-1": 3.312, + "sa-east-1": 3.312, + "us-east-1": 6.768, + "us-east-2": 3.456, + "us-gov-east-1": 3.312, + "us-gov-west-1": 7.488, + "us-west-1": 0.0, + "us-west-2": 6.768 + }, + "c5d.24xlarge": { + "af-south-1": 10.656, + "ap-northeast-1": 10.272, + "ap-northeast-2": 9.696, + "ap-northeast-3": 4.416, + "ap-south-1": 4.416, + "ap-south-2": 0.0, + "ap-southeast-1": 9.792, + "ap-southeast-2": 10.464, + "ap-southeast-3": 4.416, + "ap-southeast-4": 4.416, + "ca-central-1": 9.504, + "eu-central-1": 9.744, + "eu-central-2": 5.861, + "eu-north-1": 9.408, + "eu-south-1": 9.888, + "eu-south-2": 5.232, + "eu-west-1": 5.546, + "eu-west-2": 4.416, + "il-central-1": 9.91, + "me-central-1": 4.416, + "sa-east-1": 11.568, + "us-east-1": 9.024, + "us-east-2": 9.024, + "us-gov-west-1": 9.984, + "us-west-1": 10.176, + "us-west-2": 9.024 + }, + "c5n.large": { + "af-south-1": 0.145, + "ap-east-1": 0.143, + "ap-northeast-1": 0.092, + "ap-northeast-2": 0.092, + "ap-northeast-3": 0.136, + "ap-south-1": 0.2, + "ap-southeast-1": 0.216, + "ap-southeast-2": 0.092, + "ap-southeast-3": 0.124, + "ca-central-1": 0.092, + "eu-central-1": 0.215, + "eu-north-1": 0.208, + "eu-south-1": 0.129, + "eu-west-1": 0.092, + "eu-west-2": 0.128, + "eu-west-3": 0.128, + "me-south-1": 0.134, + "sa-east-1": 0.166, + "us-east-1": 0.2, + "us-east-2": 0.2, + "us-gov-east-1": 0.092, + "us-gov-west-1": 0.092, + "us-west-1": 0.092, + "us-west-2": 0.2 + }, + "c5n.xlarge": { + "af-south-1": 0.474, + "ap-east-1": 0.286, + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.184, + "ap-northeast-3": 0.0, + "ap-south-1": 0.4, + "ap-southeast-1": 0.432, + "ap-southeast-2": 0.184, + "ap-southeast-3": 0.248, + "ca-central-1": 0.42, + "eu-central-1": 0.184, + "eu-north-1": 0.184, + "eu-south-1": 0.258, + "eu-west-1": 0.428, + "eu-west-2": 0.184, + "eu-west-3": 0.44, + "me-south-1": 0.268, + "sa-east-1": 0.516, + "us-east-1": 0.4, + "us-east-2": 0.4, + "us-gov-east-1": 0.184, + "us-gov-west-1": 0.276, + "us-west-1": 0.184, + "us-west-2": 0.216 + }, + "c5n.metal": { + "af-south-1": 0.0, + "ap-east-1": 5.148, + "ap-northeast-1": 8.208, + "ap-northeast-2": 7.704, + "ap-northeast-3": 4.896, + "ap-south-1": 7.2, + "ap-southeast-1": 7.776, + "ap-southeast-2": 8.388, + "ap-southeast-3": 7.776, + "ca-central-1": 3.312, + "eu-central-1": 7.74, + "eu-north-1": 7.488, + "eu-south-1": 7.956, + "eu-west-1": 7.704, + "eu-west-2": 4.608, + "eu-west-3": 4.608, + "me-south-1": 8.136, + "sa-east-1": 5.976, + "us-east-1": 7.2, + "us-east-2": 7.2, + "us-gov-east-1": 7.992, + "us-gov-west-1": 0.0, + "us-west-1": 8.172, + "us-west-2": 7.2 + }, + "c5n.2xlarge": { + "af-south-1": 0.949, + "ap-east-1": 0.368, + "ap-northeast-1": 0.912, + "ap-northeast-2": 0.856, + "ap-northeast-3": 0.544, + "ap-south-1": 0.368, + "ap-southeast-1": 0.368, + "ap-southeast-2": 0.932, + "ap-southeast-3": 0.864, + "ca-central-1": 0.368, + "eu-central-1": 0.368, + "eu-north-1": 0.832, + "eu-south-1": 0.516, + "eu-west-1": 0.856, + "eu-west-2": 0.88, + "eu-west-3": 0.512, + "me-south-1": 0.536, + "sa-east-1": 0.368, + "us-east-1": 0.8, + "us-east-2": 0.8, + "us-gov-east-1": 0.368, + "us-gov-west-1": 0.888, + "us-west-1": 0.368, + "us-west-2": 0.432 + }, + "c5n.4xlarge": { + "af-south-1": 1.162, + "ap-east-1": 1.144, + "ap-northeast-1": 1.824, + "ap-northeast-2": 1.712, + "ap-northeast-3": 1.889, + "ap-south-1": 0.736, + "ap-southeast-1": 1.728, + "ap-southeast-2": 1.864, + "ap-southeast-3": 1.728, + "ca-central-1": 1.68, + "eu-central-1": 0.736, + "eu-north-1": 1.664, + "eu-south-1": 1.768, + "eu-west-1": 0.736, + "eu-west-2": 1.76, + "eu-west-3": 1.024, + "me-south-1": 1.808, + "sa-east-1": 2.064, + "us-east-1": 1.6, + "us-east-2": 1.6, + "us-gov-east-1": 1.776, + "us-gov-west-1": 1.04, + "us-west-1": 1.816, + "us-west-2": 0.864 + }, + "c5n.9xlarge": { + "af-south-1": 1.656, + "ap-east-1": 4.23, + "ap-northeast-1": 1.656, + "ap-northeast-2": 3.852, + "ap-northeast-3": 4.104, + "ap-south-1": 1.656, + "ap-southeast-1": 3.888, + "ap-southeast-2": 1.656, + "ap-southeast-3": 1.656, + "ca-central-1": 3.78, + "eu-central-1": 3.87, + "eu-north-1": 3.744, + "eu-south-1": 3.978, + "eu-west-1": 3.852, + "eu-west-2": 1.656, + "eu-west-3": 2.304, + "me-south-1": 4.068, + "sa-east-1": 4.644, + "us-east-1": 3.6, + "us-east-2": 3.6, + "us-gov-east-1": 1.656, + "us-gov-west-1": 2.34, + "us-west-1": 4.086, + "us-west-2": 1.656 + }, + "c5n.18xlarge": { + "af-south-1": 3.312, + "ap-east-1": 8.46, + "ap-northeast-1": 3.312, + "ap-northeast-2": 3.312, + "ap-northeast-3": 4.896, + "ap-south-1": 7.2, + "ap-southeast-1": 3.312, + "ap-southeast-2": 8.388, + "ap-southeast-3": 3.312, + "ca-central-1": 7.56, + "eu-central-1": 7.74, + "eu-north-1": 7.488, + "eu-south-1": 4.644, + "eu-west-1": 3.312, + "eu-west-2": 3.312, + "eu-west-3": 4.608, + "me-south-1": 4.824, + "sa-east-1": 3.312, + "us-east-1": 3.312, + "us-east-2": 7.2, + "us-gov-east-1": 3.312, + "us-gov-west-1": 4.68, + "us-west-1": 3.312, + "us-west-2": 3.312 + }, + "c6a.large": { + "ap-east-1": 0.1892, + "ap-northeast-1": 0.1883, + "ap-south-1": 0.04675, + "ap-south-2": 0.0, + "ap-southeast-1": 0.1802, + "ap-southeast-2": 0.0999, + "ca-central-1": 0.18407, + "eu-central-1": 0.092, + "eu-west-1": 0.092, + "eu-west-2": 0.1829, + "sa-east-1": 0.092, + "us-east-1": 0.0, + "us-east-2": 0.092, + "us-west-1": 0.092, + "us-west-2": 0.092 + }, + "c6a.xlarge": { + "ap-east-1": 0.1944, + "ap-northeast-1": 0.21186, + "ap-south-1": 0.2775, + "ap-south-2": 0.2775, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 0.18414, + "eu-central-1": 0.3586, + "eu-west-1": 0.36458, + "eu-west-2": 0.1818, + "sa-east-1": 0.184, + "us-east-1": 0.153, + "us-east-2": 0.337, + "us-west-1": 0.3748, + "us-west-2": 0.337 + }, + "c6a.metal": { + "ap-east-1": 9.3312, + "ap-northeast-1": 8.832, + "ap-south-1": 13.32, + "ap-south-2": 4.488, + "ap-southeast-1": 8.4672, + "ap-southeast-2": 18.4224, + "ca-central-1": 16.8672, + "eu-central-1": 8.832, + "eu-west-1": 8.832, + "eu-west-2": 8.7264, + "sa-east-1": 8.832, + "us-east-1": 7.344, + "us-east-2": 7.344, + "us-west-1": 17.9904, + "us-west-2": 16.176 + }, + "c6a.2xlarge": { + "ap-east-1": 0.368, + "ap-northeast-1": 0.79172, + "ap-south-1": 0.555, + "ap-south-2": 0.187, + "ap-southeast-1": 0.7208, + "ap-southeast-2": 0.7676, + "ca-central-1": 0.368, + "eu-central-1": 0.7172, + "eu-west-1": 0.368, + "eu-west-2": 0.3636, + "sa-east-1": 0.51876, + "us-east-1": 0.306, + "us-east-2": 0.674, + "us-west-1": 0.41976, + "us-west-2": 0.368 + }, + "c6a.4xlarge": { + "ap-east-1": 0.0, + "ap-northeast-1": 0.84744, + "ap-south-1": 0.374, + "ap-south-2": 0.374, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.7992, + "ca-central-1": 1.47256, + "eu-central-1": 0.6984, + "eu-west-1": 0.65664, + "eu-west-2": 1.4632, + "sa-east-1": 1.03752, + "us-east-1": 1.348, + "us-east-2": 1.348, + "us-west-1": 1.4992, + "us-west-2": 1.348 + }, + "c6a.8xlarge": { + "ap-east-1": 1.5552, + "ap-northeast-1": 3.0128, + "ap-south-1": 0.748, + "ap-south-2": 2.22, + "ap-southeast-1": 2.8832, + "ap-southeast-2": 0.0, + "ca-central-1": 2.8112, + "eu-central-1": 1.3968, + "eu-west-1": 2.78528, + "eu-west-2": 0.0, + "sa-east-1": 3.3584, + "us-east-1": 1.3464, + "us-east-2": 0.0, + "us-west-1": 1.472, + "us-west-2": 1.472 + }, + "c6a.12xlarge": { + "ap-east-1": 2.3328, + "ap-northeast-1": 4.5192, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 4.3248, + "ap-southeast-2": 4.6056, + "ca-central-1": 4.2168, + "eu-central-1": 0.0, + "eu-west-1": 2.208, + "eu-west-2": 2.1816, + "sa-east-1": 5.0376, + "us-east-1": 1.836, + "us-east-2": 4.044, + "us-west-1": 2.208, + "us-west-2": 0.0 + }, + "c6a.16xlarge": { + "ap-east-1": 3.1104, + "ap-northeast-1": 6.33376, + "ap-south-1": 4.44, + "ap-south-2": 0.0, + "ap-southeast-1": 6.04864, + "ap-southeast-2": 2.944, + "ca-central-1": 2.944, + "eu-central-1": 5.7376, + "eu-west-1": 2.62656, + "eu-west-2": 2.9088, + "sa-east-1": 2.944, + "us-east-1": 5.392, + "us-east-2": 5.392, + "us-west-1": 3.0528, + "us-west-2": 2.448 + }, + "c6a.24xlarge": { + "ap-east-1": 9.0816, + "ap-northeast-1": 5.08464, + "ap-south-1": 4.416, + "ap-south-2": 2.244, + "ap-southeast-1": 4.416, + "ap-southeast-2": 9.2112, + "ca-central-1": 8.83536, + "eu-central-1": 4.1904, + "eu-west-1": 0.0, + "eu-west-2": 4.79952, + "sa-east-1": 4.416, + "us-east-1": 4.416, + "us-east-2": 8.088, + "us-west-1": 4.5792, + "us-west-2": 3.672 + }, + "c6a.32xlarge": { + "ap-east-1": 5.888, + "ap-northeast-1": 6.1632, + "ap-south-1": 5.888, + "ap-south-2": 5.888, + "ap-southeast-1": 12.09728, + "ap-southeast-2": 6.3936, + "ca-central-1": 0.0, + "eu-central-1": 11.4752, + "eu-west-1": 5.888, + "eu-west-2": 11.7056, + "sa-east-1": 5.888, + "us-east-1": 10.784, + "us-east-2": 10.784, + "us-west-1": 5.888, + "us-west-2": 5.888 + }, + "c6a.48xlarge": { + "ap-east-1": 9.3312, + "ap-northeast-1": 9.2448, + "ap-south-1": 13.32, + "ap-south-2": 0.0, + "ap-southeast-1": 8.832, + "ap-southeast-2": 8.832, + "ca-central-1": 16.8672, + "eu-central-1": 8.832, + "eu-west-1": 16.71168, + "eu-west-2": 0.0, + "sa-east-1": 8.832, + "us-east-1": 7.344, + "us-east-2": 16.176, + "us-west-1": 9.1584, + "us-west-2": 7.344 + }, + "c6i.large": { + "af-south-1": 0.0, + "ap-east-1": 0.108, + "ap-northeast-1": 0.199, + "ap-northeast-2": 0.096, + "ap-northeast-3": 0.199, + "ap-south-1": 0.092, + "ap-south-2": 0.092, + "ap-southeast-1": 0.092, + "ap-southeast-2": 0.203, + "ap-southeast-5": 0.092, + "ap-southeast-7": 0.0833, + "ca-central-1": 0.0, + "ca-west-1": 0.093, + "eu-central-1": 0.189, + "eu-north-1": 0.091, + "eu-south-1": 0.193, + "eu-west-1": 0.1832, + "eu-west-2": 0.101, + "eu-west-3": 0.092, + "il-central-1": 0.09576, + "me-south-1": 0.092, + "mx-central-1": 0.18125, + "sa-east-1": 0.092, + "us-east-1": 0.0935, + "us-east-2": 0.177, + "us-gov-east-1": 0.092, + "us-gov-west-1": 0.092, + "us-west-1": 0.0, + "us-west-2": 0.085 + }, + "c6i.xlarge": { + "af-south-1": 0.184, + "ap-east-1": 0.4, + "ap-northeast-1": 0.214, + "ap-northeast-2": 0.376, + "ap-northeast-3": 0.184, + "ap-south-1": 0.0, + "ap-south-2": 0.17, + "ap-southeast-1": 0.2156, + "ap-southeast-2": 0.406, + "ap-southeast-5": 0.1666, + "ap-southeast-7": 0.1666, + "ca-central-1": 0.37, + "ca-west-1": 0.0, + "eu-central-1": 0.184, + "eu-north-1": 0.182, + "eu-south-1": 0.202, + "eu-west-1": 0.184, + "eu-west-2": 0.386, + "eu-west-3": 0.202, + "il-central-1": 0.184, + "me-south-1": 0.0, + "mx-central-1": 0.1785, + "sa-east-1": 0.446, + "us-east-1": 0.187, + "us-east-2": 0.0, + "us-gov-east-1": 0.184, + "us-gov-west-1": 0.204, + "us-west-1": 0.184, + "us-west-2": 0.0 + }, + "c6i.metal": { + "af-south-1": 5.888, + "ap-east-1": 6.912, + "ap-northeast-1": 12.736, + "ap-northeast-2": 12.032, + "ap-northeast-3": 6.848, + "ap-south-1": 5.888, + "ap-south-2": 11.328, + "ap-southeast-1": 5.888, + "ap-southeast-2": 12.992, + "ap-southeast-5": 0.0, + "ap-southeast-7": 5.888, + "ca-central-1": 5.888, + "ca-west-1": 5.952, + "eu-central-1": 6.208, + "eu-north-1": 11.712, + "eu-south-1": 5.888, + "eu-west-1": 11.7248, + "eu-west-2": 5.888, + "eu-west-3": 5.888, + "il-central-1": 12.01664, + "me-south-1": 6.7584, + "mx-central-1": 5.712, + "sa-east-1": 8.384, + "us-east-1": 5.44, + "us-east-2": 11.328, + "us-gov-east-1": 12.416, + "us-gov-west-1": 5.888, + "us-west-1": 12.672, + "us-west-2": 5.888 + }, + "c6i.2xlarge": { + "af-south-1": 0.456, + "ap-east-1": 0.432, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.4708, + "ap-south-1": 0.368, + "ap-south-2": 0.368, + "ap-southeast-1": 0.392, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.368, + "ap-southeast-7": 0.7012, + "ca-central-1": 0.4092, + "ca-west-1": 0.4092, + "eu-central-1": 0.388, + "eu-north-1": 0.732, + "eu-south-1": 0.368, + "eu-west-1": 0.368, + "eu-west-2": 0.404, + "eu-west-3": 0.772, + "il-central-1": 0.0, + "me-south-1": 0.368, + "mx-central-1": 0.0, + "sa-east-1": 0.368, + "us-east-1": 0.368, + "us-east-2": 0.368, + "us-gov-east-1": 0.368, + "us-gov-west-1": 0.776, + "us-west-1": 0.424, + "us-west-2": 0.34 + }, + "c6i.4xlarge": { + "af-south-1": 1.648, + "ap-east-1": 0.736, + "ap-northeast-1": 0.9416, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.856, + "ap-south-1": 0.736, + "ap-south-2": 0.748, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.736, + "ap-southeast-5": 1.4024, + "ap-southeast-7": 0.736, + "ca-central-1": 0.744, + "ca-west-1": 0.744, + "eu-central-1": 0.736, + "eu-north-1": 1.464, + "eu-south-1": 1.6248, + "eu-west-1": 1.4656, + "eu-west-2": 0.808, + "eu-west-3": 1.6248, + "il-central-1": 0.76608, + "me-south-1": 1.5808, + "mx-central-1": 1.45, + "sa-east-1": 0.736, + "us-east-1": 1.416, + "us-east-2": 1.416, + "us-gov-east-1": 1.552, + "us-gov-west-1": 0.816, + "us-west-1": 0.0, + "us-west-2": 0.736 + }, + "c6i.8xlarge": { + "af-south-1": 1.472, + "ap-east-1": 1.728, + "ap-northeast-1": 1.8832, + "ap-northeast-2": 1.6896, + "ap-northeast-3": 3.184, + "ap-south-1": 1.36, + "ap-south-2": 1.36, + "ap-southeast-1": 1.472, + "ap-southeast-2": 1.776, + "ap-southeast-5": 1.3328, + "ap-southeast-7": 1.472, + "ca-central-1": 1.488, + "ca-west-1": 1.6368, + "eu-central-1": 0.0, + "eu-north-1": 1.456, + "eu-south-1": 3.088, + "eu-west-1": 1.4592, + "eu-west-2": 1.616, + "eu-west-3": 1.616, + "il-central-1": 3.00416, + "me-south-1": 3.1616, + "mx-central-1": 2.9, + "sa-east-1": 3.568, + "us-east-1": 1.36, + "us-east-2": 0.0, + "us-gov-east-1": 1.472, + "us-gov-west-1": 3.104, + "us-west-1": 3.168, + "us-west-2": 2.832 + }, + "c6i.12xlarge": { + "af-south-1": 4.944, + "ap-east-1": 2.592, + "ap-northeast-1": 4.776, + "ap-northeast-2": 2.304, + "ap-northeast-3": 4.776, + "ap-south-1": 2.04, + "ap-south-2": 2.208, + "ap-southeast-1": 2.5872, + "ap-southeast-2": 5.1384, + "ap-southeast-5": 1.9992, + "ap-southeast-7": 4.2072, + "ca-central-1": 2.208, + "ca-west-1": 2.208, + "eu-central-1": 0.0, + "eu-north-1": 2.184, + "eu-south-1": 2.424, + "eu-west-1": 4.3968, + "eu-west-2": 2.424, + "eu-west-3": 4.632, + "il-central-1": 0.0, + "me-south-1": 4.99584, + "mx-central-1": 2.208, + "sa-east-1": 5.352, + "us-east-1": 2.208, + "us-east-2": 2.208, + "us-gov-east-1": 4.656, + "us-gov-west-1": 2.208, + "us-west-1": 2.208, + "us-west-2": 2.208 + }, + "c6i.16xlarge": { + "af-south-1": 2.944, + "ap-east-1": 0.0, + "ap-northeast-1": 6.368, + "ap-northeast-2": 2.944, + "ap-northeast-3": 3.424, + "ap-south-1": 2.944, + "ap-south-2": 2.72, + "ap-southeast-1": 3.136, + "ap-southeast-2": 2.944, + "ap-southeast-5": 2.944, + "ap-southeast-7": 2.944, + "ca-central-1": 5.92, + "ca-west-1": 6.2176, + "eu-central-1": 6.048, + "eu-north-1": 2.912, + "eu-south-1": 3.232, + "eu-west-1": 0.0, + "eu-west-2": 3.232, + "eu-west-3": 2.944, + "il-central-1": 2.944, + "me-south-1": 2.944, + "mx-central-1": 2.944, + "sa-east-1": 4.192, + "us-east-1": 2.72, + "us-east-2": 5.664, + "us-gov-east-1": 3.264, + "us-gov-west-1": 3.264, + "us-west-1": 2.944, + "us-west-2": 5.664 + }, + "c6i.24xlarge": { + "af-south-1": 9.888, + "ap-east-1": 9.6, + "ap-northeast-1": 5.136, + "ap-northeast-2": 9.024, + "ap-northeast-3": 5.136, + "ap-south-1": 4.416, + "ap-south-2": 4.416, + "ap-southeast-1": 4.416, + "ap-southeast-2": 5.328, + "ap-southeast-5": 8.4144, + "ap-southeast-7": 4.416, + "ca-central-1": 0.0, + "ca-west-1": 9.3264, + "eu-central-1": 9.072, + "eu-north-1": 8.784, + "eu-south-1": 9.264, + "eu-west-1": 4.416, + "eu-west-2": 4.416, + "eu-west-3": 9.264, + "il-central-1": 9.01248, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 11.3328, + "us-east-1": 4.08, + "us-east-2": 4.08, + "us-gov-east-1": 4.416, + "us-gov-west-1": 0.0, + "us-west-1": 4.416, + "us-west-2": 4.08 + }, + "c6i.32xlarge": { + "af-south-1": 0.0, + "ap-east-1": 12.8, + "ap-northeast-1": 6.848, + "ap-northeast-2": 12.032, + "ap-northeast-3": 12.736, + "ap-south-1": 0.0, + "ap-south-2": 11.328, + "ap-southeast-1": 6.272, + "ap-southeast-2": 5.888, + "ap-southeast-5": 5.888, + "ap-southeast-7": 5.888, + "ca-central-1": 5.952, + "ca-west-1": 5.952, + "eu-central-1": 12.096, + "eu-north-1": 5.824, + "eu-south-1": 6.464, + "eu-west-1": 11.7248, + "eu-west-2": 6.464, + "eu-west-3": 6.464, + "il-central-1": 12.01664, + "me-south-1": 0.0, + "mx-central-1": 11.6, + "sa-east-1": 14.272, + "us-east-1": 5.984, + "us-east-2": 5.888, + "us-gov-east-1": 6.528, + "us-gov-west-1": 5.888, + "us-west-1": 5.888, + "us-west-2": 5.888 + }, + "c6id.large": { + "ap-northeast-1": 0.2201, + "ap-northeast-2": 0.21905, + "ap-southeast-1": 0.092, + "ap-southeast-2": 0.2243, + "ap-southeast-5": 0.19196, + "ap-southeast-7": 0.092, + "ca-central-1": 0.092, + "ca-west-1": 0.12243, + "eu-central-1": 0.22021, + "eu-west-1": 0.11445, + "eu-west-2": 0.092, + "il-central-1": 0.12017, + "mx-central-1": 0.10584, + "sa-east-1": 0.15645, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 0.1218, + "us-west-2": 0.20288 + }, + "c6id.xlarge": { + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.184, + "ap-southeast-1": 0.25872, + "ap-southeast-2": 0.4486, + "ap-southeast-5": 0.38392, + "ap-southeast-7": 0.19992, + "ca-central-1": 0.0, + "ca-west-1": 0.184, + "eu-central-1": 0.184, + "eu-west-1": 0.2289, + "eu-west-2": 0.2415, + "il-central-1": 0.184, + "mx-central-1": 0.21168, + "sa-east-1": 0.52819, + "us-east-1": 0.0, + "us-east-2": 0.3856, + "us-gov-west-1": 0.0, + "us-west-2": 0.3856 + }, + "c6id.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 13.28, + "ap-southeast-1": 7.5264, + "ap-southeast-2": 14.3552, + "ap-southeast-5": 6.39744, + "ap-southeast-7": 6.39744, + "ca-central-1": 0.0, + "ca-west-1": 7.1232, + "eu-central-1": 5.888, + "eu-west-1": 7.3248, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "mx-central-1": 6.77376, + "sa-east-1": 15.9008, + "us-east-1": 12.3392, + "us-east-2": 12.3392, + "us-gov-west-1": 5.888, + "us-west-2": 12.3392 + }, + "c6id.2xlarge": { + "ap-northeast-1": 0.8804, + "ap-northeast-2": 0.83, + "ap-southeast-1": 0.368, + "ap-southeast-2": 0.5292, + "ap-southeast-5": 0.39984, + "ap-southeast-7": 0.39984, + "ca-central-1": 0.0, + "ca-west-1": 0.8132, + "eu-central-1": 0.368, + "eu-west-1": 0.4578, + "eu-west-2": 0.851, + "il-central-1": 0.0, + "mx-central-1": 0.42336, + "sa-east-1": 0.368, + "us-east-1": 0.4032, + "us-east-2": 0.368, + "us-gov-west-1": 0.368, + "us-west-2": 0.7712 + }, + "c6id.4xlarge": { + "ap-northeast-1": 0.736, + "ap-northeast-2": 1.66, + "ap-southeast-1": 0.9408, + "ap-southeast-2": 0.736, + "ap-southeast-5": 0.87965, + "ap-southeast-7": 0.87965, + "ca-central-1": 0.8904, + "ca-west-1": 0.8904, + "eu-central-1": 0.0, + "eu-west-1": 0.9156, + "eu-west-2": 1.7986, + "il-central-1": 0.96136, + "mx-central-1": 0.84672, + "sa-east-1": 0.736, + "us-east-1": 1.5424, + "us-east-2": 0.736, + "us-gov-west-1": 0.736, + "us-west-2": 0.0 + }, + "c6id.8xlarge": { + "ap-northeast-1": 3.5216, + "ap-northeast-2": 1.472, + "ap-southeast-1": 1.8816, + "ap-southeast-2": 1.472, + "ap-southeast-5": 3.07136, + "ap-southeast-7": 0.0, + "ca-central-1": 1.472, + "ca-west-1": 1.7808, + "eu-central-1": 1.8648, + "eu-west-1": 1.472, + "eu-west-2": 1.472, + "il-central-1": 3.39472, + "mx-central-1": 1.472, + "sa-east-1": 2.5032, + "us-east-1": 1.6128, + "us-east-2": 3.0848, + "us-gov-west-1": 1.9488, + "us-west-2": 0.0 + }, + "c6id.12xlarge": { + "ap-northeast-1": 5.58984, + "ap-northeast-2": 4.98, + "ap-southeast-1": 2.8224, + "ap-southeast-2": 0.0, + "ap-southeast-5": 2.208, + "ap-southeast-7": 2.208, + "ca-central-1": 2.6712, + "ca-west-1": 2.6712, + "eu-central-1": 2.208, + "eu-west-1": 3.02148, + "eu-west-2": 2.898, + "il-central-1": 0.0, + "mx-central-1": 2.54016, + "sa-east-1": 5.9628, + "us-east-1": 2.66112, + "us-east-2": 2.4192, + "us-gov-west-1": 2.208, + "us-west-2": 2.4192 + }, + "c6id.16xlarge": { + "ap-northeast-1": 4.0992, + "ap-northeast-2": 6.64, + "ap-southeast-1": 6.7072, + "ap-southeast-2": 2.944, + "ap-southeast-5": 2.944, + "ap-southeast-7": 2.944, + "ca-central-1": 6.5056, + "ca-west-1": 3.5616, + "eu-central-1": 3.7296, + "eu-west-1": 6.6064, + "eu-west-2": 0.0, + "il-central-1": 0.0, + "mx-central-1": 3.38688, + "sa-east-1": 8.45104, + "us-east-1": 2.944, + "us-east-2": 6.1696, + "us-gov-west-1": 6.8416, + "us-west-2": 6.1696 + }, + "c6id.24xlarge": { + "ap-northeast-1": 6.1488, + "ap-northeast-2": 4.416, + "ap-southeast-1": 10.0608, + "ap-southeast-2": 6.3504, + "ap-southeast-5": 4.79808, + "ap-southeast-7": 0.0, + "ca-central-1": 4.416, + "ca-west-1": 5.3424, + "eu-central-1": 10.0104, + "eu-west-1": 5.4936, + "eu-west-2": 10.212, + "il-central-1": 0.0, + "mx-central-1": 5.08032, + "sa-east-1": 7.5096, + "us-east-1": 4.416, + "us-east-2": 4.416, + "us-gov-west-1": 10.2624, + "us-west-2": 4.416 + }, + "c6id.32xlarge": { + "ap-northeast-1": 8.1984, + "ap-northeast-2": 7.392, + "ap-southeast-1": 0.0, + "ap-southeast-2": 14.3552, + "ap-southeast-5": 6.39744, + "ap-southeast-7": 5.888, + "ca-central-1": 7.1232, + "ca-west-1": 7.1232, + "eu-central-1": 0.0, + "eu-west-1": 5.888, + "eu-west-2": 7.728, + "il-central-1": 13.57888, + "mx-central-1": 12.66176, + "sa-east-1": 15.9008, + "us-east-1": 6.4512, + "us-east-2": 12.3392, + "us-gov-west-1": 5.888, + "us-west-2": 0.0 + }, + "c6in.large": { + "af-south-1": 0.092, + "ap-east-1": 0.15015, + "ap-northeast-1": 0.15708, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.1133, + "ap-southeast-1": 0.1302, + "ap-southeast-2": 0.14805, + "ap-southeast-3": 0.1302, + "ap-southeast-4": 0.092, + "ap-southeast-5": 0.20267, + "ca-central-1": 0.2159, + "eu-central-1": 0.22115, + "eu-central-2": 0.092, + "eu-north-1": 0.1218, + "eu-south-1": 0.092, + "eu-south-2": 0.128, + "eu-west-1": 0.092, + "eu-west-2": 0.2264, + "eu-west-3": 0.2264, + "il-central-1": 0.22651, + "me-central-1": 0.24688, + "me-south-1": 0.092, + "sa-east-1": 0.2663, + "us-east-1": 0.2054, + "us-east-2": 0.092, + "us-gov-east-1": 0.092, + "us-gov-west-1": 0.092, + "us-west-1": 0.092, + "us-west-2": 0.2054 + }, + "c6in.xlarge": { + "af-south-1": 0.48892, + "ap-east-1": 0.184, + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.2562, + "ap-south-1": 0.184, + "ap-south-2": 0.4106, + "ap-southeast-1": 0.4444, + "ap-southeast-2": 0.4801, + "ap-southeast-3": 0.184, + "ap-southeast-4": 0.184, + "ap-southeast-5": 0.184, + "ca-central-1": 0.2478, + "eu-central-1": 0.184, + "eu-central-2": 0.184, + "eu-north-1": 0.4276, + "eu-south-1": 0.4549, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 0.2688, + "eu-west-3": 0.29568, + "il-central-1": 0.184, + "me-central-1": 0.2816, + "me-south-1": 0.184, + "sa-east-1": 0.5326, + "us-east-1": 0.184, + "us-east-2": 0.43348, + "us-gov-east-1": 0.184, + "us-gov-west-1": 0.457, + "us-west-1": 0.184, + "us-west-2": 0.2268 + }, + "c6in.metal": { + "af-south-1": 9.75744, + "ap-east-1": 5.888, + "ap-northeast-1": 9.1392, + "ap-northeast-2": 8.1984, + "ap-south-1": 5.888, + "ap-south-2": 5.888, + "ap-southeast-1": 0.0, + "ap-southeast-2": 15.3632, + "ap-southeast-3": 14.2208, + "ap-southeast-4": 15.36, + "ap-southeast-5": 0.0, + "ca-central-1": 5.888, + "eu-central-1": 0.0, + "eu-central-2": 9.1072, + "eu-north-1": 7.7952, + "eu-south-1": 5.888, + "eu-south-2": 14.08, + "eu-west-1": 5.888, + "eu-west-2": 5.888, + "eu-west-3": 14.4896, + "il-central-1": 8.60864, + "me-central-1": 5.888, + "me-south-1": 14.8928, + "sa-east-1": 11.1552, + "us-east-1": 5.888, + "us-east-2": 5.888, + "us-gov-east-1": 0.0, + "us-gov-west-1": 14.624, + "us-west-1": 14.96, + "us-west-2": 5.888 + }, + "c6in.2xlarge": { + "af-south-1": 0.60984, + "ap-east-1": 1.02866, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.368, + "ap-south-1": 0.8216, + "ap-south-2": 0.4532, + "ap-southeast-1": 0.368, + "ap-southeast-2": 0.368, + "ap-southeast-3": 0.5208, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.85495, + "ca-central-1": 0.8636, + "eu-central-1": 0.5166, + "eu-central-2": 0.368, + "eu-north-1": 0.4872, + "eu-south-1": 0.9098, + "eu-south-2": 0.88, + "eu-west-1": 0.0, + "eu-west-2": 0.368, + "eu-west-3": 0.9056, + "il-central-1": 0.368, + "me-central-1": 0.5632, + "me-south-1": 0.9308, + "sa-east-1": 0.6972, + "us-east-1": 0.4536, + "us-east-2": 0.368, + "us-gov-east-1": 0.368, + "us-gov-west-1": 0.0, + "us-west-1": 0.368, + "us-west-2": 0.4536 + }, + "c6in.4xlarge": { + "af-south-1": 1.21968, + "ap-east-1": 0.736, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.7608, + "ap-south-1": 0.736, + "ap-south-2": 0.0, + "ap-southeast-1": 1.7776, + "ap-southeast-2": 1.1844, + "ap-southeast-3": 1.7776, + "ap-southeast-4": 1.184, + "ap-southeast-5": 0.88536, + "ca-central-1": 1.7272, + "eu-central-1": 1.7692, + "eu-central-2": 1.1384, + "eu-north-1": 0.9744, + "eu-south-1": 1.8196, + "eu-south-2": 1.1264, + "eu-west-1": 1.0248, + "eu-west-2": 1.8112, + "eu-west-3": 0.0, + "il-central-1": 0.736, + "me-central-1": 1.23904, + "me-south-1": 1.8616, + "sa-east-1": 1.53384, + "us-east-1": 0.9072, + "us-east-2": 1.6432, + "us-gov-east-1": 1.092, + "us-gov-west-1": 1.828, + "us-west-1": 1.87, + "us-west-2": 1.6432 + }, + "c6in.8xlarge": { + "af-south-1": 1.472, + "ap-east-1": 3.8744, + "ap-northeast-1": 2.2848, + "ap-northeast-2": 1.472, + "ap-south-1": 3.2864, + "ap-south-2": 1.472, + "ap-southeast-1": 1.472, + "ap-southeast-2": 2.3688, + "ap-southeast-3": 2.29152, + "ap-southeast-4": 1.472, + "ap-southeast-5": 0.0, + "ca-central-1": 3.4544, + "eu-central-1": 1.472, + "eu-central-2": 2.2768, + "eu-north-1": 3.4208, + "eu-south-1": 2.1672, + "eu-south-2": 2.048, + "eu-west-1": 3.5216, + "eu-west-2": 2.1504, + "eu-west-3": 3.6224, + "il-central-1": 3.83938, + "me-central-1": 3.7248, + "me-south-1": 1.472, + "sa-east-1": 2.7888, + "us-east-1": 1.472, + "us-east-2": 0.0, + "us-gov-east-1": 3.8744, + "us-gov-west-1": 1.472, + "us-west-1": 2.268, + "us-west-2": 1.8144 + }, + "c6in.12xlarge": { + "af-south-1": 6.23294, + "ap-east-1": 5.8116, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.208, + "ap-south-1": 2.7216, + "ap-south-2": 2.99112, + "ap-southeast-1": 5.64528, + "ap-southeast-2": 2.208, + "ap-southeast-3": 2.208, + "ap-southeast-4": 2.208, + "ap-southeast-5": 2.208, + "ca-central-1": 2.9736, + "eu-central-1": 5.3076, + "eu-central-2": 0.0, + "eu-north-1": 2.9232, + "eu-south-1": 3.2508, + "eu-south-2": 2.208, + "eu-west-1": 5.58984, + "eu-west-2": 3.2256, + "eu-west-3": 3.2256, + "il-central-1": 5.43624, + "me-central-1": 3.3792, + "me-south-1": 2.208, + "sa-east-1": 6.3912, + "us-east-1": 4.9296, + "us-east-2": 0.0, + "us-gov-east-1": 5.484, + "us-gov-west-1": 0.0, + "us-west-1": 5.61, + "us-west-2": 2.208 + }, + "c6in.16xlarge": { + "af-south-1": 4.87872, + "ap-east-1": 4.8048, + "ap-northeast-1": 7.5136, + "ap-northeast-2": 7.45312, + "ap-south-1": 2.944, + "ap-south-2": 2.944, + "ap-southeast-1": 4.1664, + "ap-southeast-2": 4.7376, + "ap-southeast-3": 0.0, + "ap-southeast-4": 7.68, + "ap-southeast-5": 2.944, + "ca-central-1": 6.9088, + "eu-central-1": 2.944, + "eu-central-2": 0.0, + "eu-north-1": 3.8976, + "eu-south-1": 2.944, + "eu-south-2": 2.944, + "eu-west-1": 4.0992, + "eu-west-2": 7.2448, + "eu-west-3": 2.944, + "il-central-1": 4.30432, + "me-central-1": 7.90016, + "me-south-1": 7.4464, + "sa-east-1": 8.5216, + "us-east-1": 2.944, + "us-east-2": 0.0, + "us-gov-east-1": 7.7488, + "us-gov-west-1": 7.312, + "us-west-1": 2.944, + "us-west-2": 3.6288 + }, + "c6in.24xlarge": { + "af-south-1": 4.416, + "ap-east-1": 4.416, + "ap-northeast-1": 4.416, + "ap-northeast-2": 4.416, + "ap-south-1": 5.4432, + "ap-south-2": 0.0, + "ap-southeast-1": 6.2496, + "ap-southeast-2": 0.0, + "ap-southeast-3": 10.6656, + "ap-southeast-4": 4.416, + "ap-southeast-5": 9.72816, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 4.416, + "eu-north-1": 10.2624, + "eu-south-1": 10.9176, + "eu-south-2": 11.1744, + "eu-west-1": 10.5648, + "eu-west-2": 4.416, + "eu-west-3": 4.416, + "il-central-1": 4.416, + "me-central-1": 4.416, + "me-south-1": 6.7536, + "sa-east-1": 12.7824, + "us-east-1": 0.0, + "us-east-2": 9.8592, + "us-gov-east-1": 4.416, + "us-gov-west-1": 11.6232, + "us-west-1": 11.22, + "us-west-2": 4.416 + }, + "c6in.32xlarge": { + "af-south-1": 9.75744, + "ap-east-1": 5.888, + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.888, + "ap-south-1": 5.888, + "ap-south-2": 7.2512, + "ap-southeast-1": 8.3328, + "ap-southeast-2": 0.0, + "ap-southeast-3": 14.2208, + "ap-southeast-4": 9.472, + "ap-southeast-5": 12.97088, + "ca-central-1": 0.0, + "eu-central-1": 5.888, + "eu-central-2": 5.888, + "eu-north-1": 7.7952, + "eu-south-1": 14.5568, + "eu-south-2": 5.888, + "eu-west-1": 8.1984, + "eu-west-2": 5.888, + "eu-west-3": 8.6016, + "il-central-1": 14.49664, + "me-central-1": 14.8992, + "me-south-1": 9.0048, + "sa-east-1": 17.0432, + "us-east-1": 13.1456, + "us-east-2": 5.888, + "us-gov-east-1": 8.736, + "us-gov-west-1": 14.624, + "us-west-1": 5.888, + "us-west-2": 13.1456 + }, + "c7a.medium": { + "ap-northeast-1": 0.1106, + "eu-central-1": 0.10457, + "eu-north-1": 0.05494, + "eu-south-2": 0.046, + "eu-west-1": 0.05506, + "us-east-1": 0.046, + "us-east-2": 0.09732, + "us-west-2": 0.09732 + }, + "c7a.large": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.092, + "eu-north-1": 0.12087, + "eu-south-2": 0.20792, + "eu-west-1": 0.092, + "us-east-1": 0.10264, + "us-east-2": 0.10264, + "us-west-2": 0.19464 + }, + "c7a.xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.23426, + "eu-north-1": 0.184, + "eu-south-2": 0.41584, + "eu-west-1": 0.22024, + "us-east-1": 0.20528, + "us-east-2": 0.20528, + "us-west-2": 0.38928 + }, + "c7a.metal-48xl": { + "ap-northeast-1": 21.2352, + "eu-central-1": 8.832, + "eu-north-1": 19.38048, + "eu-south-2": 11.12832, + "eu-west-1": 19.40352, + "us-east-1": 18.68544, + "us-east-2": 18.68544, + "us-west-2": 18.68544 + }, + "c7a.2xlarge": { + "ap-northeast-1": 0.368, + "eu-central-1": 0.83652, + "eu-north-1": 0.80752, + "eu-south-2": 0.46368, + "eu-west-1": 0.368, + "us-east-1": 0.41056, + "us-east-2": 0.368, + "us-west-2": 0.368 + }, + "c7a.4xlarge": { + "ap-northeast-1": 0.736, + "eu-central-1": 1.67304, + "eu-north-1": 0.96694, + "eu-south-2": 0.736, + "eu-west-1": 1.61696, + "us-east-1": 0.736, + "us-east-2": 0.736, + "us-west-2": 1.55712 + }, + "c7a.8xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 3.34608, + "eu-north-1": 1.75808, + "eu-south-2": 3.32672, + "eu-west-1": 1.472, + "us-east-1": 3.11424, + "us-east-2": 1.472, + "us-west-2": 0.0 + }, + "c7a.12xlarge": { + "ap-northeast-1": 3.1008, + "eu-central-1": 5.01912, + "eu-north-1": 0.0, + "eu-south-2": 2.208, + "eu-west-1": 2.64288, + "us-east-1": 4.67136, + "us-east-2": 2.46336, + "us-west-2": 2.46336 + }, + "c7a.16xlarge": { + "ap-northeast-1": 4.1344, + "eu-central-1": 6.69216, + "eu-north-1": 2.944, + "eu-south-2": 6.65344, + "eu-west-1": 6.46784, + "us-east-1": 6.22848, + "us-east-2": 3.28448, + "us-west-2": 2.944 + }, + "c7a.24xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 9.69024, + "eu-south-2": 5.56416, + "eu-west-1": 0.0, + "us-east-1": 4.416, + "us-east-2": 9.34272, + "us-west-2": 4.92672 + }, + "c7a.32xlarge": { + "ap-northeast-1": 9.09568, + "eu-central-1": 8.24595, + "eu-north-1": 5.888, + "eu-south-2": 13.30688, + "eu-west-1": 12.93568, + "us-east-1": 6.56896, + "us-east-2": 12.45696, + "us-west-2": 12.45696 + }, + "c7a.48xlarge": { + "ap-northeast-1": 21.2352, + "eu-central-1": 20.07648, + "eu-north-1": 0.0, + "eu-south-2": 8.832, + "eu-west-1": 19.40352, + "us-east-1": 18.68544, + "us-east-2": 18.68544, + "us-west-2": 9.85344 + }, + "c7i.large": { + "ap-northeast-1": 0.12359, + "ap-northeast-2": 0.1928, + "ap-south-1": 0.18125, + "ap-southeast-1": 0.1949, + "ap-southeast-2": 0.11655, + "ap-southeast-5": 0.18822, + "ap-southeast-7": 0.17947, + "ca-central-1": 0.092, + "eu-central-1": 0.092, + "eu-north-1": 0.092, + "eu-south-2": 0.1008, + "eu-west-1": 0.18776, + "eu-west-2": 0.11666, + "eu-west-3": 0.092, + "mx-central-1": 0.092, + "sa-east-1": 0.092, + "us-east-1": 0.18125, + "us-east-2": 0.092, + "us-gov-east-1": 0.11781, + "us-gov-west-1": 0.092, + "us-west-1": 0.2033, + "us-west-2": 0.18125 + }, + "c7i.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.3856, + "ap-south-1": 0.38035, + "ap-southeast-1": 0.2058, + "ap-southeast-2": 0.4171, + "ap-southeast-5": 0.35894, + "ap-southeast-7": 0.35894, + "ca-central-1": 0.3793, + "eu-central-1": 0.0, + "eu-north-1": 0.3751, + "eu-south-2": 0.2016, + "eu-west-1": 0.0, + "eu-west-2": 0.3961, + "eu-west-3": 0.0, + "mx-central-1": 0.184, + "sa-east-1": 0.0, + "us-east-1": 0.184, + "us-east-2": 0.19635, + "us-gov-east-1": 0.2142, + "us-gov-west-1": 0.3982, + "us-west-1": 0.2226, + "us-west-2": 0.0 + }, + "c7i.metal-24xl": { + "ap-northeast-1": 4.416, + "ap-northeast-2": 4.416, + "ap-south-1": 4.7124, + "ap-southeast-1": 9.3552, + "ap-southeast-2": 5.5944, + "ap-southeast-5": 8.61456, + "ap-southeast-7": 4.19856, + "ca-central-1": 4.416, + "eu-central-1": 0.0, + "eu-north-1": 4.5864, + "eu-south-2": 4.416, + "eu-west-1": 9.01248, + "eu-west-2": 4.416, + "eu-west-3": 5.0904, + "mx-central-1": 4.416, + "sa-east-1": 6.6024, + "us-east-1": 4.416, + "us-east-2": 4.284, + "us-gov-east-1": 5.1408, + "us-gov-west-1": 9.5568, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "c7i.metal-48xl": { + "ap-northeast-1": 19.6176, + "ap-northeast-2": 18.5088, + "ap-south-1": 8.832, + "ap-southeast-1": 9.8784, + "ap-southeast-2": 11.1888, + "ap-southeast-5": 8.39712, + "ap-southeast-7": 8.832, + "ca-central-1": 0.0, + "eu-central-1": 9.7776, + "eu-north-1": 8.832, + "eu-south-2": 18.5088, + "eu-west-1": 18.02496, + "eu-west-2": 10.1808, + "eu-west-3": 19.0128, + "mx-central-1": 8.99616, + "sa-east-1": 0.0, + "us-east-1": 17.4, + "us-east-2": 0.0, + "us-gov-east-1": 10.2816, + "us-gov-west-1": 19.1136, + "us-west-1": 19.5168, + "us-west-2": 8.568 + }, + "c7i.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.44352, + "ap-south-1": 0.368, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.8342, + "ap-southeast-5": 0.368, + "ap-southeast-7": 0.71788, + "ca-central-1": 0.7586, + "eu-central-1": 0.7754, + "eu-north-1": 0.368, + "eu-south-2": 0.7712, + "eu-west-1": 0.75104, + "eu-west-2": 0.368, + "eu-west-3": 0.7922, + "mx-central-1": 0.41232, + "sa-east-1": 0.9182, + "us-east-1": 0.357, + "us-east-2": 0.725, + "us-gov-east-1": 0.368, + "us-gov-west-1": 0.83924, + "us-west-1": 0.8132, + "us-west-2": 0.0 + }, + "c7i.4xlarge": { + "ap-northeast-1": 1.6348, + "ap-northeast-2": 0.88704, + "ap-south-1": 1.45, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.6684, + "ap-southeast-5": 1.43576, + "ap-southeast-7": 1.43576, + "ca-central-1": 0.7812, + "eu-central-1": 0.736, + "eu-north-1": 0.736, + "eu-south-2": 0.736, + "eu-west-1": 1.50208, + "eu-west-2": 0.8484, + "eu-west-3": 0.0, + "mx-central-1": 0.736, + "sa-east-1": 1.8364, + "us-east-1": 0.714, + "us-east-2": 0.736, + "us-gov-east-1": 0.736, + "us-gov-west-1": 0.0, + "us-west-1": 0.736, + "us-west-2": 0.736 + }, + "c7i.8xlarge": { + "ap-northeast-1": 1.7976, + "ap-northeast-2": 1.6128, + "ap-south-1": 0.0, + "ap-southeast-1": 3.1184, + "ap-southeast-2": 1.472, + "ap-southeast-5": 1.39952, + "ap-southeast-7": 1.39952, + "ca-central-1": 0.0, + "eu-central-1": 3.1016, + "eu-north-1": 1.68168, + "eu-south-2": 1.472, + "eu-west-1": 3.00416, + "eu-west-2": 3.1688, + "eu-west-3": 3.1688, + "mx-central-1": 2.97136, + "sa-east-1": 3.6728, + "us-east-1": 1.5708, + "us-east-2": 2.9, + "us-gov-east-1": 3.35696, + "us-gov-west-1": 3.1856, + "us-west-1": 1.472, + "us-west-2": 2.9 + }, + "c7i.12xlarge": { + "ap-northeast-1": 2.208, + "ap-northeast-2": 2.208, + "ap-south-1": 4.35, + "ap-southeast-1": 4.6776, + "ap-southeast-2": 2.208, + "ap-southeast-5": 2.09928, + "ap-southeast-7": 4.51721, + "ca-central-1": 2.208, + "eu-central-1": 4.6524, + "eu-north-1": 4.5012, + "eu-south-2": 0.0, + "eu-west-1": 2.29824, + "eu-west-2": 2.208, + "eu-west-3": 2.208, + "mx-central-1": 2.24904, + "sa-east-1": 2.208, + "us-east-1": 2.142, + "us-east-2": 4.35, + "us-gov-east-1": 2.208, + "us-gov-west-1": 5.03544, + "us-west-1": 2.208, + "us-west-2": 2.208 + }, + "c7i.16xlarge": { + "ap-northeast-1": 2.944, + "ap-northeast-2": 6.1696, + "ap-south-1": 5.8, + "ap-southeast-1": 2.944, + "ap-southeast-2": 2.944, + "ap-southeast-5": 2.944, + "ap-southeast-7": 0.0, + "ca-central-1": 6.0688, + "eu-central-1": 2.944, + "eu-north-1": 6.0016, + "eu-south-2": 3.54816, + "eu-west-1": 3.37075, + "eu-west-2": 3.73296, + "eu-west-3": 3.3936, + "mx-central-1": 2.944, + "sa-east-1": 4.4016, + "us-east-1": 3.1416, + "us-east-2": 2.856, + "us-gov-east-1": 6.3712, + "us-gov-west-1": 3.76992, + "us-west-1": 6.86176, + "us-west-2": 2.856 + }, + "c7i.24xlarge": { + "ap-northeast-1": 9.8088, + "ap-northeast-2": 4.8384, + "ap-south-1": 4.284, + "ap-southeast-1": 9.3552, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 4.416, + "ca-central-1": 9.1032, + "eu-central-1": 4.8888, + "eu-north-1": 4.5864, + "eu-south-2": 9.2544, + "eu-west-1": 4.59648, + "eu-west-2": 4.416, + "eu-west-3": 0.0, + "mx-central-1": 8.91408, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 4.284, + "us-gov-east-1": 9.5568, + "us-gov-west-1": 9.5568, + "us-west-1": 9.7584, + "us-west-2": 8.7 + }, + "c7i.48xlarge": { + "ap-northeast-1": 8.832, + "ap-northeast-2": 8.832, + "ap-south-1": 8.568, + "ap-southeast-1": 9.8784, + "ap-southeast-2": 20.0208, + "ap-southeast-5": 17.22912, + "ap-southeast-7": 8.39712, + "ca-central-1": 9.3744, + "eu-central-1": 9.7776, + "eu-north-1": 0.0, + "eu-south-2": 18.5088, + "eu-west-1": 8.832, + "eu-west-2": 8.832, + "eu-west-3": 10.1808, + "mx-central-1": 17.82816, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 8.568, + "us-gov-east-1": 0.0, + "us-gov-west-1": 8.832, + "us-west-1": 19.5168, + "us-west-2": 8.568 + }, + "c7i-flex.large": { + "ap-northeast-1": 0.10673, + "ap-northeast-2": 0.09576, + "ap-south-1": 0.17219, + "ap-southeast-1": 0.09778, + "ap-southeast-2": 0.11072, + "ap-southeast-5": 0.1705, + "ca-central-1": 0.18017, + "eu-central-1": 0.18416, + "eu-north-1": 0.09077, + "eu-south-2": 0.09576, + "eu-west-1": 0.09097, + "eu-west-2": 0.10075, + "eu-west-3": 0.18815, + "sa-east-1": 0.13067, + "us-east-1": 0.17219, + "us-east-2": 0.08479, + "us-gov-west-1": 0.10175, + "us-west-1": 0.10574, + "us-west-2": 0.17219 + }, + "c7i-flex.xlarge": { + "ap-northeast-1": 0.21347, + "ap-northeast-2": 0.19152, + "ap-south-1": 0.34438, + "ap-southeast-1": 0.37035, + "ap-southeast-2": 0.22145, + "ap-southeast-5": 0.16619, + "ca-central-1": 0.18554, + "eu-central-1": 0.19352, + "eu-north-1": 0.18155, + "eu-south-2": 0.36632, + "eu-west-1": 0.18194, + "eu-west-2": 0.3763, + "eu-west-3": 0.2015, + "sa-east-1": 0.26135, + "us-east-1": 0.34438, + "us-east-2": 0.16958, + "us-gov-west-1": 0.2035, + "us-west-1": 0.21147, + "us-west-2": 0.34438 + }, + "c7i-flex.2xlarge": { + "ap-northeast-1": 0.77653, + "ap-northeast-2": 0.73264, + "ap-south-1": 0.68875, + "ap-southeast-1": 0.7407, + "ap-southeast-2": 0.44289, + "ap-southeast-5": 0.33239, + "ca-central-1": 0.72067, + "eu-central-1": 0.73663, + "eu-north-1": 0.71269, + "eu-south-2": 0.73264, + "eu-west-1": 0.36389, + "eu-west-2": 0.40299, + "eu-west-3": 0.40299, + "sa-east-1": 0.87229, + "us-east-1": 0.33915, + "us-east-2": 0.68875, + "us-gov-west-1": 0.7566, + "us-west-1": 0.42294, + "us-west-2": 0.68875 + }, + "c7i-flex.4xlarge": { + "ap-northeast-1": 1.55306, + "ap-northeast-2": 1.46528, + "ap-south-1": 0.6783, + "ap-southeast-1": 1.4814, + "ap-southeast-2": 1.58498, + "ap-southeast-5": 0.66477, + "ca-central-1": 1.44134, + "eu-central-1": 1.47326, + "eu-north-1": 0.72618, + "eu-south-2": 1.46528, + "eu-west-1": 0.72778, + "eu-west-2": 0.80598, + "eu-west-3": 1.50518, + "sa-east-1": 1.74458, + "us-east-1": 0.6783, + "us-east-2": 0.6783, + "us-gov-west-1": 1.5132, + "us-west-1": 0.84588, + "us-west-2": 1.3775 + }, + "c7i-flex.8xlarge": { + "ap-northeast-1": 1.70772, + "ap-northeast-2": 2.93056, + "ap-south-1": 1.3566, + "ap-southeast-1": 1.56441, + "ap-southeast-2": 3.16996, + "ap-southeast-5": 2.72794, + "ca-central-1": 1.48428, + "eu-central-1": 2.94652, + "eu-north-1": 2.85076, + "eu-south-2": 2.93056, + "eu-west-1": 1.45555, + "eu-west-2": 3.01036, + "eu-west-3": 1.61196, + "sa-east-1": 3.48916, + "us-east-1": 1.3566, + "us-east-2": 2.755, + "us-gov-west-1": 3.0264, + "us-west-1": 1.69176, + "us-west-2": 1.3566 + }, + "c7i-flex.12xlarge": { + "ap-northeast-1": 4.76958, + "ap-south-1": 2.0349, + "ap-southeast-1": 4.55461, + "ap-southeast-2": 4.86534, + "ap-southeast-5": 4.20232, + "ca-central-1": 4.43442, + "eu-central-1": 2.32218, + "eu-north-1": 2.17854, + "eu-south-2": 2.29824, + "eu-west-1": 2.18333, + "eu-west-2": 4.62594, + "eu-west-3": 2.41794, + "sa-east-1": 5.34414, + "us-east-1": 4.2429, + "us-east-2": 4.2429, + "us-gov-west-1": 4.65, + "us-west-1": 2.53764, + "us-west-2": 4.2429 + }, + "c7i-flex.16xlarge": { + "ap-northeast-1": 3.41544, + "ap-south-1": 5.6572, + "ap-southeast-1": 3.12882, + "ap-southeast-2": 6.48712, + "ap-southeast-5": 2.65909, + "ca-central-1": 2.96856, + "eu-central-1": 6.04024, + "eu-north-1": 2.90472, + "eu-south-2": 6.00832, + "eu-west-1": 2.9111, + "eu-west-2": 6.16792, + "eu-west-3": 6.16792, + "sa-east-1": 7.12552, + "us-east-1": 2.7132, + "us-east-2": 2.7132, + "us-gov-west-1": 3.256, + "us-west-1": 6.32752, + "us-west-2": 2.7132 + }, + "cc2.8xlarge": { + "ap-northeast-1": 2.349, + "eu-west-1": 2.25, + "us-east-1": 2.0, + "us-gov-west-1": 2.57, + "us-west-2": 2.0 + }, + "cr1.8xlarge": { + "ap-northeast-1": 4.42, + "eu-west-1": 3.75, + "us-east-1": 3.5, + "us-west-2": 3.831 + }, + "d2.xlarge": { + "af-south-1": 1.059, + "ap-east-1": 0.184, + "ap-northeast-1": 0.844, + "ap-northeast-2": 1.028, + "ap-northeast-3": 1.028, + "ap-south-1": 0.91, + "ap-southeast-1": 0.184, + "ap-southeast-2": 1.101, + "ca-central-1": 0.943, + "eu-central-1": 0.0, + "eu-north-1": 0.882, + "eu-south-1": 0.184, + "eu-west-1": 0.866, + "eu-west-2": 0.772, + "eu-west-3": 0.956, + "me-south-1": 0.993, + "sa-east-1": 0.0, + "us-east-1": 0.821, + "us-east-2": 0.821, + "us-gov-east-1": 0.184, + "us-gov-west-1": 0.976, + "us-west-1": 0.859, + "us-west-2": 0.69 + }, + "d2.2xlarge": { + "af-south-1": 0.368, + "ap-east-1": 0.368, + "ap-northeast-1": 0.368, + "ap-northeast-2": 1.688, + "ap-northeast-3": 1.688, + "ap-south-1": 0.368, + "ap-southeast-1": 1.961, + "ap-southeast-2": 1.961, + "ca-central-1": 1.886, + "eu-central-1": 0.0, + "eu-north-1": 0.368, + "eu-south-1": 0.368, + "eu-west-1": 1.691, + "eu-west-2": 1.912, + "eu-west-3": 1.912, + "me-south-1": 1.985, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.368, + "us-gov-west-1": 1.952, + "us-west-1": 1.931, + "us-west-2": 1.601 + }, + "d2.4xlarge": { + "af-south-1": 4.236, + "ap-east-1": 4.564, + "ap-northeast-1": 3.678, + "ap-northeast-2": 0.736, + "ap-northeast-3": 3.376, + "ap-south-1": 3.306, + "ap-southeast-1": 4.16, + "ap-southeast-2": 3.782, + "ca-central-1": 3.34, + "eu-central-1": 3.176, + "eu-north-1": 0.736, + "eu-south-1": 0.736, + "eu-west-1": 2.94, + "eu-west-2": 3.823, + "eu-west-3": 3.824, + "me-south-1": 3.97, + "sa-east-1": 0.0, + "us-east-1": 0.736, + "us-east-2": 3.062, + "us-gov-east-1": 4.048, + "us-gov-west-1": 0.736, + "us-west-1": 3.125, + "us-west-2": 2.76 + }, + "d2.8xlarge": { + "af-south-1": 1.656, + "ap-east-1": 1.656, + "ap-northeast-1": 7.43, + "ap-northeast-2": 6.752, + "ap-northeast-3": 6.752, + "ap-south-1": 6.612, + "ap-southeast-1": 1.656, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 7.03, + "eu-north-1": 1.656, + "eu-south-1": 1.656, + "eu-west-1": 0.0, + "eu-west-2": 1.656, + "eu-west-3": 7.832, + "me-south-1": 1.656, + "sa-east-1": 0.0, + "us-east-1": 5.52, + "us-east-2": 6.198, + "us-gov-east-1": 8.28, + "us-gov-west-1": 1.656, + "us-west-1": 7.906, + "us-west-2": 5.52 + }, + "d3.xlarge": { + "ap-northeast-1": 0.724, + "ap-south-1": 0.524, + "ap-southeast-1": 0.81, + "ap-southeast-2": 0.81, + "ca-central-1": 0.734, + "eu-central-1": 0.842, + "eu-central-2": 0.724, + "eu-west-1": 0.793, + "eu-west-2": 0.824, + "eu-west-3": 0.824, + "il-central-1": 0.64, + "us-east-1": 0.683, + "us-east-2": 0.683, + "us-gov-west-1": 0.782, + "us-west-2": 0.683 + }, + "d3.2xlarge": { + "ap-northeast-1": 1.448, + "ap-south-1": 1.047, + "ap-southeast-1": 1.62, + "ap-southeast-2": 1.62, + "ca-central-1": 1.1, + "eu-central-1": 1.684, + "eu-central-2": 1.816, + "eu-west-1": 1.587, + "eu-west-2": 1.28, + "eu-west-3": 1.28, + "il-central-1": 1.28, + "us-east-1": 1.367, + "us-east-2": 1.367, + "us-gov-west-1": 1.565, + "us-west-2": 1.367 + }, + "d3.4xlarge": { + "ap-northeast-1": 3.633, + "ap-south-1": 2.095, + "ap-southeast-1": 3.24, + "ap-southeast-2": 3.24, + "ca-central-1": 2.937, + "eu-central-1": 3.368, + "eu-central-2": 2.895, + "eu-west-1": 2.437, + "eu-west-2": 3.295, + "eu-west-3": 2.559, + "il-central-1": 2.559, + "us-east-1": 2.734, + "us-east-2": 2.734, + "us-gov-west-1": 3.13, + "us-west-2": 2.734 + }, + "d3.8xlarge": { + "ap-northeast-1": 5.79344, + "ap-south-1": 5.66104, + "ap-southeast-1": 6.48008, + "ap-southeast-2": 6.48008, + "ca-central-1": 5.87312, + "eu-central-1": 6.73648, + "eu-central-2": 5.79096, + "eu-west-1": 4.87448, + "eu-west-2": 6.59024, + "eu-west-3": 5.11824, + "il-central-1": 5.11824, + "us-east-1": 5.46752, + "us-east-2": 5.46752, + "us-gov-west-1": 4.78776, + "us-west-2": 5.46752 + }, + "d3en.xlarge": { + "ap-northeast-1": 0.762, + "ap-southeast-1": 0.843, + "ap-southeast-2": 0.843, + "ap-southeast-3": 0.843, + "eu-central-1": 0.877, + "eu-west-1": 0.825, + "us-east-1": 0.71, + "us-west-2": 0.71 + }, + "d3en.2xlarge": { + "ap-northeast-1": 1.893, + "ap-southeast-1": 1.686, + "ap-southeast-2": 1.686, + "ap-southeast-3": 1.686, + "eu-central-1": 1.385, + "eu-west-1": 1.651, + "us-east-1": 1.419, + "us-west-2": 1.419 + }, + "d3en.4xlarge": { + "ap-northeast-1": 3.049, + "ap-southeast-1": 3.372, + "ap-southeast-2": 3.372, + "ap-southeast-3": 2.636, + "eu-central-1": 3.507, + "eu-west-1": 3.302, + "us-east-1": 2.839, + "us-west-2": 2.839 + }, + "d3en.6xlarge": { + "ap-northeast-1": 5.678, + "ap-southeast-1": 5.058, + "ap-southeast-2": 3.954, + "ap-southeast-3": 5.058, + "eu-central-1": 4.156, + "eu-west-1": 4.952, + "us-east-1": 4.258, + "us-west-2": 4.258 + }, + "d3en.8xlarge": { + "ap-northeast-1": 6.0984, + "ap-southeast-1": 5.27168, + "ap-southeast-2": 5.27168, + "ap-southeast-3": 6.74368, + "eu-central-1": 7.01352, + "eu-west-1": 6.60304, + "us-east-1": 5.67776, + "us-west-2": 5.67776 + }, + "d3en.12xlarge": { + "ap-northeast-1": 9.1476, + "ap-southeast-1": 7.90752, + "ap-southeast-2": 7.90752, + "ap-southeast-3": 10.11552, + "eu-central-1": 8.31228, + "eu-west-1": 9.90456, + "us-east-1": 8.51664, + "us-west-2": 8.51664 + }, + "f1.2xlarge": { + "eu-west-1": 1.815, + "us-east-1": 1.65, + "us-west-2": 1.815 + }, + "f1.16xlarge": { + "eu-west-1": 14.52, + "us-east-1": 13.2, + "us-west-2": 13.2 + }, + "g2.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-southeast-1": 1.0, + "ap-southeast-2": 1.058, + "eu-central-1": 0.0, + "eu-west-1": 0.767, + "sa-east-1": 0.0, + "us-east-1": 0.844, + "us-west-1": 0.819, + "us-west-2": 0.0 + }, + "g2.8xlarge": { + "ap-northeast-1": 3.87, + "ap-northeast-2": 0.0, + "ap-southeast-1": 4.278, + "ap-southeast-2": 3.592, + "eu-central-1": 3.366, + "eu-west-1": 2.808, + "sa-east-1": 0.0, + "us-east-1": 2.6, + "us-west-1": 2.808, + "us-west-2": 1.472 + }, + "g3.4xlarge": { + "ap-northeast-1": 2.316, + "ap-northeast-2": 2.156, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 0.736, + "eu-central-1": 0.736, + "eu-west-1": 0.0, + "eu-west-2": 0.736, + "us-east-1": 1.876, + "us-east-2": 1.14, + "us-gov-west-1": 0.736, + "us-west-1": 2.4234, + "us-west-2": 0.736 + }, + "g3.8xlarge": { + "ap-northeast-1": 1.472, + "ap-northeast-2": 1.472, + "ap-southeast-1": 3.674, + "ap-southeast-2": 0.0, + "ca-central-1": 4.304, + "eu-central-1": 1.472, + "eu-west-1": 2.42, + "eu-west-2": 1.472, + "us-east-1": 1.472, + "us-east-2": 3.752, + "us-gov-west-1": 4.112, + "us-west-1": 3.068, + "us-west-2": 0.0 + }, + "g3.16xlarge": { + "ap-northeast-1": 2.944, + "ap-northeast-2": 2.944, + "ap-southeast-1": 6.68, + "ap-southeast-2": 9.96, + "ca-central-1": 8.608, + "eu-central-1": 0.0, + "eu-west-1": 2.944, + "eu-west-2": 2.944, + "us-east-1": 2.944, + "us-east-2": 0.0, + "us-gov-west-1": 2.944, + "us-west-1": 6.136, + "us-west-2": 4.56 + }, + "g3s.xlarge": { + "ap-northeast-1": 1.224, + "ap-northeast-2": 1.118, + "ap-southeast-2": 1.338, + "eu-central-1": 1.122, + "eu-west-1": 0.98, + "eu-west-2": 1.124, + "us-east-1": 0.934, + "us-east-2": 0.934, + "us-gov-west-1": 0.868, + "us-west-2": 0.934 + }, + "g4ad.xlarge": { + "ap-northeast-1": 0.184, + "ca-central-1": 0.60663, + "eu-central-1": 0.184, + "eu-west-1": 0.60663, + "eu-west-2": 0.184, + "us-east-1": 0.184, + "us-east-2": 0.56253, + "us-west-2": 0.184 + }, + "g4ad.2xlarge": { + "ap-northeast-1": 0.368, + "ca-central-1": 0.97221, + "eu-central-1": 0.368, + "eu-west-1": 0.368, + "eu-west-2": 0.368, + "us-east-1": 0.90917, + "us-east-2": 0.90917, + "us-west-2": 0.90917 + }, + "g4ad.4xlarge": { + "ap-northeast-1": 1.906, + "ca-central-1": 0.736, + "eu-central-1": 1.82, + "eu-west-1": 1.704, + "eu-west-2": 1.75, + "us-east-1": 0.736, + "us-east-2": 0.736, + "us-west-2": 1.603 + }, + "g4ad.8xlarge": { + "ap-northeast-1": 3.812, + "ca-central-1": 1.472, + "eu-central-1": 1.472, + "eu-west-1": 1.472, + "eu-west-2": 1.472, + "us-east-1": 1.472, + "us-east-2": 1.472, + "us-west-2": 3.206 + }, + "g4ad.16xlarge": { + "ap-northeast-1": 7.624, + "ca-central-1": 6.816, + "eu-central-1": 7.28, + "eu-west-1": 6.816, + "eu-west-2": 2.944, + "us-east-1": 2.944, + "us-east-2": 6.412, + "us-west-2": 2.944 + }, + "g4dn.xlarge": { + "af-south-1": 0.184, + "ap-east-1": 0.184, + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.184, + "ap-northeast-3": 0.894, + "ap-south-1": 0.184, + "ap-southeast-1": 0.736, + "ap-southeast-2": 0.184, + "ca-central-1": 0.184, + "eu-central-1": 0.884, + "eu-north-1": 0.184, + "eu-south-1": 0.184, + "eu-west-1": 0.184, + "eu-west-2": 0.799, + "eu-west-3": 0.799, + "me-south-1": 0.184, + "sa-east-1": 1.078, + "us-east-1": 0.184, + "us-east-2": 0.71, + "us-gov-east-1": 0.847, + "us-gov-west-1": 0.847, + "us-west-1": 0.815, + "us-west-2": 0.184, + "us-west-2-lax-1": 0.184 + }, + "g4dn.metal": { + "af-south-1": 14.797, + "ap-east-1": 16.464, + "ap-northeast-1": 14.978, + "ap-northeast-2": 4.416, + "ap-northeast-3": 10.562, + "ap-south-1": 4.416, + "ap-southeast-1": 4.416, + "ap-southeast-2": 14.59, + "ca-central-1": 13.103, + "eu-central-1": 4.416, + "eu-north-1": 4.416, + "eu-south-1": 13.576, + "eu-west-1": 4.416, + "eu-west-2": 4.416, + "eu-west-3": 4.416, + "me-south-1": 14.012, + "sa-east-1": 17.714, + "us-east-1": 4.416, + "us-east-2": 4.416, + "us-gov-west-1": 9.862, + "us-west-1": 13.805, + "us-west-2": 4.416, + "us-west-2-lax-1": 4.416 + }, + "g4dn.2xlarge": { + "af-south-1": 0.368, + "ap-east-1": 0.368, + "ap-northeast-1": 0.368, + "ap-northeast-2": 1.293, + "ap-northeast-3": 1.383, + "ap-south-1": 0.368, + "ap-southeast-1": 1.42, + "ap-southeast-2": 1.346, + "ca-central-1": 0.368, + "eu-central-1": 1.001, + "eu-north-1": 0.368, + "eu-south-1": 1.248, + "eu-west-1": 1.206, + "eu-west-2": 0.368, + "eu-west-3": 0.368, + "me-south-1": 0.368, + "sa-east-1": 0.368, + "us-east-1": 1.12, + "us-east-2": 1.12, + "us-gov-east-1": 0.368, + "us-gov-west-1": 0.948, + "us-west-1": 0.368, + "us-west-2": 1.12, + "us-west-2-lax-1": 0.368 + }, + "g4dn.4xlarge": { + "af-south-1": 0.736, + "ap-east-1": 2.59, + "ap-northeast-1": 2.361, + "ap-northeast-2": 0.736, + "ap-northeast-3": 0.736, + "ap-south-1": 0.736, + "ap-southeast-1": 2.421, + "ap-southeast-2": 2.302, + "ca-central-1": 0.736, + "eu-central-1": 0.736, + "eu-north-1": 2.013, + "eu-south-1": 2.146, + "eu-west-1": 2.078, + "eu-west-2": 0.736, + "eu-west-3": 2.144, + "me-south-1": 2.213, + "sa-east-1": 0.736, + "us-east-1": 1.94, + "us-east-2": 0.736, + "us-gov-east-1": 2.254, + "us-gov-west-1": 1.518, + "us-west-1": 0.736, + "us-west-2": 1.94, + "us-west-2-lax-1": 2.181 + }, + "g4dn.8xlarge": { + "af-south-1": 1.472, + "ap-east-1": 4.823, + "ap-northeast-1": 4.41, + "ap-northeast-2": 4.149, + "ap-northeast-3": 2.938, + "ap-south-1": 1.472, + "ap-southeast-1": 1.472, + "ap-southeast-2": 1.472, + "ca-central-1": 3.888, + "eu-central-1": 4.192, + "eu-north-1": 3.78, + "eu-south-1": 4.019, + "eu-west-1": 3.898, + "eu-west-2": 1.472, + "eu-west-3": 1.472, + "me-south-1": 4.141, + "sa-east-1": 5.17, + "us-east-1": 3.648, + "us-east-2": 3.648, + "us-gov-east-1": 4.215, + "us-gov-west-1": 4.215, + "us-west-1": 1.472, + "us-west-2": 3.648, + "us-west-2-lax-1": 1.472 + }, + "g4dn.12xlarge": { + "af-south-1": 7.398, + "ap-east-1": 8.232, + "ap-northeast-1": 2.208, + "ap-northeast-2": 7.02, + "ap-northeast-3": 5.281, + "ap-south-1": 6.514, + "ap-southeast-1": 2.208, + "ap-southeast-2": 2.208, + "ca-central-1": 2.208, + "eu-central-1": 2.208, + "eu-north-1": 2.208, + "eu-south-1": 2.208, + "eu-west-1": 2.208, + "eu-west-2": 6.785, + "eu-west-3": 2.208, + "me-south-1": 7.006, + "sa-east-1": 2.208, + "us-east-1": 6.12, + "us-east-2": 6.12, + "us-gov-east-1": 2.208, + "us-gov-west-1": 4.931, + "us-west-1": 6.902, + "us-west-2": 6.12, + "us-west-2-lax-1": 6.902 + }, + "g4dn.16xlarge": { + "af-south-1": 8.718, + "ap-east-1": 2.944, + "ap-northeast-1": 8.819, + "ap-northeast-2": 2.944, + "ap-northeast-3": 2.944, + "ap-south-1": 2.944, + "ap-southeast-1": 2.944, + "ap-southeast-2": 2.944, + "ca-central-1": 2.944, + "eu-central-1": 8.384, + "eu-north-1": 7.561, + "eu-south-1": 8.039, + "eu-west-1": 7.797, + "eu-west-2": 2.944, + "eu-west-3": 2.944, + "me-south-1": 2.944, + "sa-east-1": 10.341, + "us-east-1": 7.296, + "us-east-2": 7.296, + "us-gov-east-1": 2.944, + "us-gov-west-1": 5.486, + "us-west-1": 8.166, + "us-west-2": 2.944, + "us-west-2-lax-1": 8.166 + }, + "g5.xlarge": { + "ap-northeast-1": 1.643, + "ap-northeast-2": 0.184, + "ap-south-1": 0.184, + "ap-southeast-2": 1.492, + "ap-southeast-3": 1.408, + "ca-central-1": 1.117, + "eu-central-1": 1.442, + "eu-north-1": 1.251, + "eu-west-1": 1.123, + "eu-west-2": 1.277, + "il-central-1": 1.36315, + "me-central-1": 1.418, + "sa-east-1": 1.894, + "us-east-1": 1.2906, + "us-east-2": 0.0, + "us-west-2": 0.0 + }, + "g5.2xlarge": { + "ap-northeast-1": 2.12576, + "ap-northeast-2": 1.4903, + "ap-south-1": 1.82336, + "ap-southeast-2": 0.368, + "ap-southeast-3": 2.23395, + "ca-central-1": 1.8483, + "eu-central-1": 1.5156, + "eu-north-1": 1.41404, + "eu-west-1": 0.368, + "eu-west-2": 1.53849, + "il-central-1": 1.78861, + "me-central-1": 0.368, + "sa-east-1": 2.42816, + "us-east-1": 1.212, + "us-east-2": 1.212, + "us-west-2": 1.58 + }, + "g5.4xlarge": { + "ap-northeast-1": 3.09128, + "ap-northeast-2": 2.73291, + "ap-south-1": 0.736, + "ap-southeast-2": 2.11152, + "ap-southeast-3": 0.736, + "ca-central-1": 1.80319, + "eu-central-1": 2.76681, + "eu-north-1": 0.736, + "eu-west-1": 0.736, + "eu-west-2": 2.79748, + "il-central-1": 0.736, + "me-central-1": 0.0, + "sa-east-1": 3.49648, + "us-east-1": 0.736, + "us-east-2": 0.736, + "us-west-2": 1.624, + "us-west-2-lax-1": 2.23098 + }, + "g5.8xlarge": { + "ap-northeast-1": 5.37736, + "ap-northeast-2": 1.472, + "ap-south-1": 4.7055, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.472, + "ca-central-1": 0.0, + "eu-central-1": 1.472, + "eu-north-1": 1.472, + "eu-west-1": 4.20471, + "eu-west-2": 1.472, + "il-central-1": 1.472, + "me-central-1": 4.47482, + "sa-east-1": 5.63311, + "us-east-1": 3.92, + "us-east-2": 3.92, + "us-west-2": 3.92, + "us-west-2-lax-1": 4.83496 + }, + "g5.12xlarge": { + "ap-northeast-1": 8.22609, + "ap-northeast-2": 9.18242, + "ap-south-1": 9.01891, + "ap-southeast-2": 2.208, + "ap-southeast-3": 7.93854, + "ca-central-1": 8.50584, + "eu-central-1": 9.30082, + "eu-north-1": 8.22393, + "eu-west-1": 2.208, + "eu-west-2": 7.19994, + "il-central-1": 6.64825, + "me-central-1": 0.0, + "sa-east-1": 11.84927, + "us-east-1": 0.0, + "us-east-2": 7.88, + "us-west-2": 2.208 + }, + "g5.16xlarge": { + "ap-northeast-1": 9.47846, + "ap-northeast-2": 0.0, + "ap-south-1": 2.944, + "ap-southeast-2": 5.32561, + "ap-southeast-3": 8.67677, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 2.944, + "eu-west-1": 2.944, + "eu-west-2": 0.0, + "il-central-1": 7.74499, + "me-central-1": 0.0, + "sa-east-1": 2.944, + "us-east-1": 0.0, + "us-east-2": 2.944, + "us-west-2": 4.096 + }, + "g5.24xlarge": { + "ap-northeast-1": 16.22723, + "ap-northeast-2": 14.43004, + "ap-south-1": 14.19528, + "ap-southeast-2": 4.416, + "ap-southeast-3": 15.81436, + "ca-central-1": 9.04259, + "eu-central-1": 15.61845, + "eu-north-1": 4.416, + "eu-west-1": 0.0, + "eu-west-2": 4.416, + "il-central-1": 13.96172, + "me-central-1": 10.98873, + "sa-east-1": 0.0, + "us-east-1": 12.56, + "us-east-2": 4.416, + "us-west-2": 8.144 + }, + "g5.48xlarge": { + "ap-northeast-1": 32.45446, + "ap-northeast-2": 0.0, + "ap-south-1": 28.39055, + "ap-southeast-2": 30.00964, + "ap-southeast-3": 22.79672, + "ca-central-1": 8.832, + "eu-central-1": 20.3681, + "eu-north-1": 0.0, + "eu-west-1": 18.18233, + "eu-west-2": 29.50772, + "il-central-1": 19.09145, + "me-central-1": 8.832, + "sa-east-1": 36.51836, + "us-east-1": 25.12, + "us-east-2": 25.12, + "us-west-2": 25.12 + }, + "g6.xlarge": { + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.184, + "ap-south-1": 1.24704, + "ap-southeast-2": 1.0464, + "ap-southeast-5": 1.0138, + "ca-central-1": 0.0, + "eu-central-1": 1.0064, + "eu-central-2": 0.184, + "eu-north-1": 1.0376, + "eu-south-2": 0.184, + "eu-west-2": 0.184, + "eu-west-3": 1.2056, + "sa-east-1": 0.184, + "us-east-1": 0.8048, + "us-east-2": 0.9888, + "us-gov-west-1": 1.29984, + "us-west-2": 0.9888 + }, + "g6.2xlarge": { + "ap-northeast-1": 1.41781, + "ap-northeast-2": 1.57008, + "ap-south-1": 1.1739, + "ap-southeast-2": 0.0, + "ap-southeast-5": 1.23147, + "ca-central-1": 0.368, + "eu-central-1": 0.368, + "eu-central-2": 0.368, + "eu-north-1": 1.40488, + "eu-south-2": 1.03008, + "eu-west-2": 1.24095, + "eu-west-3": 1.60895, + "sa-east-1": 2.02973, + "us-east-1": 1.44336, + "us-east-2": 1.3456, + "us-gov-west-1": 1.6002, + "us-west-2": 0.368 + }, + "g6.4xlarge": { + "ap-northeast-1": 2.65503, + "ap-northeast-2": 0.736, + "ap-south-1": 2.32489, + "ap-southeast-2": 2.62847, + "ap-southeast-5": 2.56951, + "ca-central-1": 1.4692, + "eu-central-1": 1.65466, + "eu-central-2": 2.51989, + "eu-north-1": 1.40343, + "eu-south-2": 1.39423, + "eu-west-2": 2.41565, + "eu-west-3": 0.0, + "sa-east-1": 2.24918, + "us-east-1": 1.3232, + "us-east-2": 0.0, + "us-gov-west-1": 2.40381, + "us-west-2": 2.0592 + }, + "g6.8xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.472, + "ap-south-1": 2.41888, + "ap-southeast-2": 4.09112, + "ap-southeast-5": 2.53752, + "ca-central-1": 2.23666, + "eu-central-1": 3.991, + "eu-central-2": 1.472, + "eu-north-1": 3.60855, + "eu-south-2": 3.59453, + "eu-west-2": 0.0, + "eu-west-3": 4.02905, + "sa-east-1": 4.89608, + "us-east-1": 1.472, + "us-east-2": 0.0, + "us-gov-west-1": 4.01103, + "us-west-2": 1.472 + }, + "g6.12xlarge": { + "ap-northeast-1": 2.208, + "ap-northeast-2": 5.65823, + "ap-south-1": 7.73358, + "ap-southeast-2": 2.208, + "ap-southeast-5": 5.7966, + "ca-central-1": 5.10933, + "eu-central-1": 5.75429, + "eu-central-2": 8.4117, + "eu-north-1": 7.08862, + "eu-south-2": 2.208, + "eu-west-2": 2.208, + "eu-west-3": 2.208, + "sa-east-1": 10.02981, + "us-east-1": 6.8096, + "us-east-2": 2.208, + "us-gov-west-1": 6.38003, + "us-west-2": 6.8096 + }, + "g6.16xlarge": { + "ap-northeast-1": 7.87037, + "ap-northeast-2": 7.12078, + "ap-south-1": 4.07886, + "ap-southeast-2": 4.41652, + "ap-southeast-5": 7.22292, + "ca-central-1": 3.7716, + "eu-central-1": 7.61646, + "eu-central-2": 7.52343, + "eu-north-1": 3.60277, + "eu-south-2": 6.52313, + "eu-west-2": 4.31184, + "eu-west-3": 4.74303, + "sa-east-1": 9.29527, + "us-east-1": 3.3968, + "us-east-2": 3.3968, + "us-gov-west-1": 4.7096, + "us-west-2": 6.3408 + }, + "g6.24xlarge": { + "ap-northeast-1": 4.416, + "ap-northeast-2": 4.416, + "ap-south-1": 12.43155, + "ap-southeast-2": 8.67909, + "ap-southeast-5": 4.416, + "ca-central-1": 11.82773, + "eu-central-1": 8.34732, + "eu-central-2": 8.99924, + "eu-north-1": 12.20395, + "eu-south-2": 11.44951, + "eu-west-2": 12.88939, + "eu-west-3": 12.88939, + "sa-east-1": 11.34651, + "us-east-1": 6.6752, + "us-east-2": 0.0, + "us-gov-west-1": 8.41367, + "us-west-2": 11.0912 + }, + "g6.48xlarge": { + "ap-northeast-1": 28.19406, + "ap-northeast-2": 16.41595, + "ap-south-1": 0.0, + "ap-southeast-2": 26.19017, + "ap-southeast-5": 25.64939, + "ca-central-1": 0.0, + "eu-central-1": 8.832, + "eu-central-2": 8.832, + "eu-north-1": 8.832, + "eu-south-2": 14.06702, + "eu-west-2": 25.77878, + "eu-west-3": 25.77878, + "sa-east-1": 8.832, + "us-east-1": 8.832, + "us-east-2": 8.832, + "us-gov-west-1": 16.82734, + "us-west-2": 13.3504 + }, + "g6e.xlarge": { + "ap-northeast-1": 0.184, + "eu-central-1": 2.511, + "eu-north-1": 2.3554, + "eu-south-2": 1.961, + "us-east-1": 0.0, + "us-east-2": 1.861, + "us-west-2": 2.045 + }, + "g6e.2xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 3.1715, + "eu-north-1": 0.0, + "eu-south-2": 0.368, + "us-east-1": 2.24208, + "us-east-2": 2.24208, + "us-west-2": 2.24208 + }, + "g6e.4xlarge": { + "ap-northeast-1": 4.35703, + "eu-central-1": 0.0, + "eu-north-1": 3.92266, + "eu-south-2": 0.736, + "us-east-1": 3.00424, + "us-east-2": 4.04066, + "us-west-2": 0.0 + }, + "g6e.8xlarge": { + "ap-northeast-1": 6.56775, + "eu-central-1": 1.472, + "eu-north-1": 0.0, + "eu-south-2": 6.2439, + "us-east-1": 6.45341, + "us-east-2": 6.45341, + "us-west-2": 1.472 + }, + "g6e.12xlarge": { + "ap-northeast-1": 17.42542, + "eu-central-1": 15.32802, + "eu-north-1": 11.12975, + "eu-south-2": 0.0, + "us-east-1": 2.208, + "us-east-2": 10.49264, + "us-west-2": 10.49264 + }, + "g6e.16xlarge": { + "ap-northeast-1": 2.944, + "eu-central-1": 12.41854, + "eu-north-1": 10.98128, + "eu-south-2": 0.0, + "us-east-1": 8.33491, + "us-east-2": 10.52119, + "us-west-2": 2.944 + }, + "g6e.24xlarge": { + "ap-northeast-1": 26.26556, + "eu-central-1": 18.83806, + "eu-north-1": 17.57841, + "eu-south-2": 20.29113, + "us-east-1": 4.416, + "us-east-2": 19.48159, + "us-west-2": 15.06559 + }, + "g6e.48xlarge": { + "ap-northeast-1": 43.69912, + "eu-central-1": 46.50812, + "eu-north-1": 40.79275, + "eu-south-2": 31.75027, + "us-east-1": 30.13118, + "us-east-2": 38.96318, + "us-west-2": 8.832 + }, + "gr6.4xlarge": { + "ap-northeast-1": 2.9683, + "ap-northeast-2": 2.6286, + "ap-south-1": 1.8483, + "ap-southeast-2": 2.0012, + "ap-southeast-5": 1.9388, + "ca-central-1": 2.445, + "eu-central-1": 2.6608, + "eu-central-2": 2.9009, + "eu-north-1": 1.6326, + "eu-south-2": 1.6218, + "eu-west-2": 1.9539, + "eu-west-3": 2.6898, + "sa-east-1": 3.3524, + "us-east-1": 2.2752, + "us-east-2": 1.5392, + "us-gov-west-1": 2.6761, + "us-west-2": 2.2752 + }, + "gr6.8xlarge": { + "ap-northeast-1": 3.54801, + "ap-northeast-2": 3.00809, + "ap-south-1": 2.93768, + "ap-southeast-2": 3.1807, + "ap-southeast-5": 4.55352, + "ca-central-1": 2.71628, + "eu-central-1": 3.05927, + "eu-central-2": 4.91289, + "eu-north-1": 2.59485, + "eu-south-2": 4.04968, + "eu-west-2": 3.10552, + "eu-west-3": 4.57736, + "sa-east-1": 5.6305, + "us-east-1": 3.9184, + "us-east-2": 2.4464, + "us-gov-west-1": 3.08359, + "us-west-2": 2.4464 + }, + "h1.2xlarge": { + "eu-west-1": 1.021, + "us-east-1": 0.0, + "us-east-2": 0.368, + "us-west-2": 0.836 + }, + "h1.4xlarge": { + "eu-west-1": 1.038, + "us-east-1": 1.672, + "us-east-2": 0.997, + "us-west-2": 0.736 + }, + "h1.8xlarge": { + "eu-west-1": 2.076, + "us-east-1": 1.872, + "us-east-2": 1.472, + "us-west-2": 1.872 + }, + "h1.16xlarge": { + "eu-west-1": 2.944, + "us-east-1": 3.744, + "us-east-2": 2.944, + "us-west-2": 3.744 + }, + "hpc6a.48xlarge": { + "ap-southeast-1": 7.7365, + "ap-southeast-2": 8.1769, + "eu-north-1": 7.509, + "us-east-2": 2.88, + "us-gov-east-1": 7.883, + "us-gov-west-1": 3.467 + }, + "hpc6id.32xlarge": { + "eu-north-1": 6.0352, + "eu-west-3": 6.77294, + "us-east-2": 5.7, + "us-gov-west-1": 9.7984 + }, + "hpc7a.12xlarge": { + "eu-north-1": 8.8292, + "eu-west-1": 8.8292, + "eu-west-3": 8.5553, + "us-east-2": 7.2, + "us-gov-west-1": 9.7714 + }, + "hpc7a.24xlarge": { + "eu-north-1": 9.9332, + "eu-west-1": 7.7252, + "eu-west-3": 10.7633, + "us-east-2": 7.2, + "us-gov-west-1": 8.6674 + }, + "hpc7a.48xlarge": { + "eu-north-1": 12.1412, + "eu-west-1": 7.7252, + "eu-west-3": 12.9713, + "us-east-2": 7.2, + "us-gov-west-1": 13.0834 + }, + "hpc7a.96xlarge": { + "eu-north-1": 7.7252, + "eu-west-1": 16.5572, + "eu-west-3": 8.5553, + "us-east-2": 16.032, + "us-gov-west-1": 8.6674 + }, + "hs1.8xlarge": { + "ap-northeast-1": 5.4, + "ap-southeast-1": 5.57, + "ap-southeast-2": 5.57, + "eu-west-1": 4.9, + "us-east-1": 4.6, + "us-gov-west-1": 6.126, + "us-west-2": 4.6 + }, + "i2.xlarge": { + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.0, + "ap-south-1": 0.184, + "ap-southeast-1": 1.169, + "ap-southeast-2": 1.169, + "eu-central-1": 1.133, + "eu-west-1": 1.07, + "sa-east-1": 0.0, + "us-east-1": 0.184, + "us-east-2": 0.973, + "us-gov-west-1": 1.144, + "us-west-1": 0.938, + "us-west-2": 0.853 + }, + "i2.2xlarge": { + "ap-northeast-1": 2.226, + "ap-northeast-2": 2.369, + "ap-south-1": 0.368, + "ap-southeast-1": 2.035, + "ap-southeast-2": 2.337, + "eu-central-1": 0.0, + "eu-west-1": 0.368, + "sa-east-1": 0.0, + "us-east-1": 2.141, + "us-east-2": 1.705, + "us-gov-west-1": 2.515, + "us-west-1": 0.0, + "us-west-2": 1.705 + }, + "i2.4xlarge": { + "ap-northeast-1": 4.002, + "ap-northeast-2": 4.002, + "ap-south-1": 0.736, + "ap-southeast-1": 4.07, + "ap-southeast-2": 4.674, + "eu-central-1": 0.736, + "eu-west-1": 3.891, + "sa-east-1": 0.0, + "us-east-1": 3.751, + "us-east-2": 3.891, + "us-gov-west-1": 0.736, + "us-west-1": 3.751, + "us-west-2": 0.0 + }, + "i2.8xlarge": { + "ap-northeast-1": 8.903, + "ap-northeast-2": 1.472, + "ap-south-1": 0.0, + "ap-southeast-1": 9.348, + "ap-southeast-2": 8.14, + "eu-central-1": 8.102, + "eu-west-1": 7.502, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 6.82, + "us-gov-west-1": 9.146, + "us-west-1": 1.472, + "us-west-2": 7.782 + }, + "i3.large": { + "af-south-1": 0.297, + "ap-east-1": 0.298, + "ap-northeast-1": 0.275, + "ap-northeast-2": 0.183, + "ap-northeast-3": 0.275, + "ap-south-1": 0.269, + "ap-south-2": 0.177, + "ap-southeast-1": 0.187, + "ap-southeast-2": 0.279, + "ap-southeast-3": 0.187, + "ap-southeast-4": 0.279, + "ca-central-1": 0.264, + "eu-central-1": 0.186, + "eu-central-2": 0.092, + "eu-north-1": 0.092, + "eu-south-1": 0.092, + "eu-south-2": 0.281, + "eu-west-1": 0.264, + "eu-west-2": 0.092, + "eu-west-3": 0.273, + "il-central-1": 0.181, + "me-central-1": 0.0, + "me-south-1": 0.092, + "sa-east-1": 0.092, + "us-east-1": 0.156, + "us-east-2": 0.156, + "us-gov-east-1": 0.28, + "us-gov-west-1": 0.188, + "us-west-1": 0.264, + "us-west-2": 0.156 + }, + "i3.xlarge": { + "af-south-1": 0.184, + "ap-east-1": 0.184, + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.184, + "ap-south-1": 0.538, + "ap-south-2": 0.184, + "ap-southeast-1": 0.558, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.184, + "ap-southeast-4": 0.595, + "ca-central-1": 0.528, + "eu-central-1": 0.184, + "eu-central-2": 0.45, + "eu-north-1": 0.51, + "eu-south-1": 0.546, + "eu-south-2": 0.184, + "eu-west-1": 0.528, + "eu-west-2": 0.546, + "eu-west-3": 0.398, + "il-central-1": 0.361, + "me-central-1": 0.0, + "me-south-1": 0.184, + "sa-east-1": 0.0, + "us-east-1": 0.312, + "us-east-2": 0.184, + "us-gov-east-1": 0.56, + "us-gov-west-1": 0.184, + "us-west-1": 0.184, + "us-west-2": 0.312 + }, + "i3.metal": { + "af-south-1": 2.944, + "ap-east-1": 6.592, + "ap-northeast-1": 0.0, + "ap-northeast-2": 5.856, + "ap-northeast-3": 8.8, + "ap-south-1": 2.944, + "ap-southeast-1": 5.984, + "ap-southeast-2": 0.0, + "ca-central-1": 5.504, + "eu-central-1": 2.944, + "eu-north-1": 5.216, + "eu-south-1": 8.736, + "eu-west-1": 5.504, + "eu-west-2": 5.792, + "eu-west-3": 8.736, + "me-south-1": 9.366, + "sa-east-1": 2.944, + "us-east-1": 7.936, + "us-east-2": 4.992, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.944, + "us-west-1": 2.944, + "us-west-2": 7.936 + }, + "i3.2xlarge": { + "af-south-1": 1.188, + "ap-east-1": 1.192, + "ap-northeast-1": 0.368, + "ap-northeast-2": 0.732, + "ap-northeast-3": 1.1, + "ap-south-1": 0.708, + "ap-south-2": 0.368, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.116, + "ap-southeast-3": 0.368, + "ap-southeast-4": 0.368, + "ca-central-1": 0.688, + "eu-central-1": 0.744, + "eu-central-2": 0.0, + "eu-north-1": 0.368, + "eu-south-1": 1.092, + "eu-south-2": 1.125, + "eu-west-1": 0.368, + "eu-west-2": 0.724, + "eu-west-3": 0.724, + "il-central-1": 1.09, + "me-central-1": 0.757, + "me-south-1": 1.125, + "sa-east-1": 1.364, + "us-east-1": 0.368, + "us-east-2": 0.992, + "us-gov-east-1": 0.368, + "us-gov-west-1": 1.12, + "us-west-1": 1.056, + "us-west-2": 0.992 + }, + "i3.4xlarge": { + "af-south-1": 0.736, + "ap-east-1": 2.384, + "ap-northeast-1": 2.2, + "ap-northeast-2": 2.2, + "ap-northeast-3": 2.2, + "ap-south-1": 1.416, + "ap-south-2": 0.736, + "ap-southeast-1": 0.736, + "ap-southeast-2": 2.232, + "ap-southeast-3": 0.736, + "ap-southeast-4": 2.232, + "ca-central-1": 2.112, + "eu-central-1": 2.224, + "eu-central-2": 1.637, + "eu-north-1": 0.736, + "eu-south-1": 2.184, + "eu-south-2": 2.112, + "eu-west-1": 0.736, + "eu-west-2": 2.184, + "eu-west-3": 2.184, + "il-central-1": 1.445, + "me-central-1": 0.736, + "me-south-1": 0.736, + "sa-east-1": 2.191, + "us-east-1": 1.248, + "us-east-2": 0.736, + "us-gov-east-1": 2.24, + "us-gov-west-1": 0.736, + "us-west-1": 0.0, + "us-west-2": 0.736 + }, + "i3.8xlarge": { + "af-south-1": 4.752, + "ap-east-1": 1.472, + "ap-northeast-1": 4.4, + "ap-northeast-2": 4.4, + "ap-northeast-3": 1.472, + "ap-south-1": 0.0, + "ap-south-2": 1.472, + "ap-southeast-1": 1.472, + "ap-southeast-2": 4.763, + "ap-southeast-3": 1.472, + "ap-southeast-4": 1.472, + "ca-central-1": 0.0, + "eu-central-1": 4.448, + "eu-central-2": 3.274, + "eu-north-1": 4.08, + "eu-south-1": 4.368, + "eu-south-2": 4.224, + "eu-west-1": 2.752, + "eu-west-2": 4.368, + "eu-west-3": 4.658, + "il-central-1": 2.89, + "me-central-1": 4.802, + "me-south-1": 1.472, + "sa-east-1": 3.984, + "us-east-1": 2.496, + "us-east-2": 3.968, + "us-gov-east-1": 1.472, + "us-gov-west-1": 4.48, + "us-west-1": 1.472, + "us-west-2": 1.472 + }, + "i3.16xlarge": { + "af-south-1": 9.504, + "ap-east-1": 2.944, + "ap-northeast-1": 5.856, + "ap-northeast-2": 8.8, + "ap-northeast-3": 8.8, + "ap-south-1": 2.944, + "ap-south-2": 5.664, + "ap-southeast-1": 8.928, + "ap-southeast-2": 2.944, + "ap-southeast-3": 2.944, + "ap-southeast-4": 0.0, + "ca-central-1": 5.504, + "eu-central-1": 5.952, + "eu-central-2": 2.944, + "eu-north-1": 8.16, + "eu-south-1": 2.944, + "eu-south-2": 2.944, + "eu-west-1": 5.504, + "eu-west-2": 5.792, + "eu-west-3": 2.944, + "il-central-1": 5.779, + "me-central-1": 0.0, + "me-south-1": 2.944, + "sa-east-1": 2.944, + "us-east-1": 4.992, + "us-east-2": 7.936, + "us-gov-east-1": 8.96, + "us-gov-west-1": 2.944, + "us-west-1": 8.448, + "us-west-2": 7.936 + }, + "i3en.large": { + "af-south-1": 0.316, + "ap-east-1": 0.39, + "ap-northeast-1": 0.358, + "ap-northeast-2": 0.092, + "ap-northeast-3": 0.358, + "ap-south-1": 0.349, + "ap-south-2": 0.349, + "ap-southeast-1": 0.363, + "ap-southeast-2": 0.363, + "ap-southeast-3": 0.363, + "ap-southeast-4": 0.271, + "ap-southeast-5": 0.26, + "ap-southeast-7": 0.0, + "ca-central-1": 0.092, + "ca-west-1": 0.342, + "eu-central-1": 0.362, + "eu-central-2": 0.297, + "eu-north-1": 0.329, + "eu-south-1": 0.354, + "eu-south-2": 0.342, + "eu-west-1": 0.342, + "eu-west-2": 0.263, + "eu-west-3": 0.355, + "il-central-1": 0.28, + "me-central-1": 0.385, + "me-south-1": 0.092, + "mx-central-1": 0.253, + "sa-east-1": 0.092, + "us-east-1": 0.318, + "us-east-2": 0.092, + "us-gov-east-1": 0.365, + "us-gov-west-1": 0.0, + "us-west-1": 0.092, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.092 + }, + "i3en.xlarge": { + "af-south-1": 0.184, + "ap-east-1": 0.184, + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.716, + "ap-northeast-3": 0.716, + "ap-south-1": 0.698, + "ap-south-2": 0.698, + "ap-southeast-1": 0.184, + "ap-southeast-2": 0.184, + "ap-southeast-3": 0.761, + "ap-southeast-4": 0.542, + "ap-southeast-5": 0.488, + "ap-southeast-7": 0.488, + "ca-central-1": 0.184, + "ca-west-1": 0.184, + "eu-central-1": 0.184, + "eu-central-2": 0.184, + "eu-north-1": 0.184, + "eu-south-1": 0.524, + "eu-south-2": 0.684, + "eu-west-1": 0.684, + "eu-west-2": 0.71, + "eu-west-3": 0.71, + "il-central-1": 0.525, + "me-central-1": 0.734, + "me-south-1": 0.583, + "mx-central-1": 0.475, + "sa-east-1": 0.184, + "us-east-1": 0.636, + "us-east-2": 0.184, + "us-gov-east-1": 0.73, + "us-gov-west-1": 0.546, + "us-west-1": 0.184, + "us-west-2": 0.636, + "us-west-2-lax-1": 0.726 + }, + "i3en.metal": { + "af-south-1": 18.672, + "ap-east-1": 4.416, + "ap-northeast-1": 17.184, + "ap-northeast-2": 17.184, + "ap-northeast-3": 0.0, + "ap-south-1": 4.416, + "ap-south-2": 16.752, + "ap-southeast-1": 4.416, + "ap-southeast-2": 4.416, + "ap-southeast-3": 13.008, + "ap-southeast-4": 4.416, + "ap-southeast-5": 4.416, + "ap-southeast-7": 11.707, + "ca-central-1": 16.416, + "ca-west-1": 16.416, + "eu-central-1": 17.376, + "eu-central-2": 18.672, + "eu-north-1": 15.792, + "eu-south-1": 4.416, + "eu-south-2": 12.0, + "eu-west-1": 16.416, + "eu-west-2": 0.0, + "eu-west-3": 17.04, + "il-central-1": 4.416, + "me-central-1": 17.616, + "me-south-1": 4.416, + "mx-central-1": 0.0, + "sa-east-1": 21.696, + "us-east-1": 15.264, + "us-east-2": 15.264, + "us-gov-east-1": 17.52, + "us-gov-west-1": 13.104, + "us-west-1": 16.416, + "us-west-2": 4.416, + "us-west-2-lax-1": 4.416 + }, + "i3en.2xlarge": { + "af-south-1": 1.188, + "ap-east-1": 1.561, + "ap-northeast-1": 1.432, + "ap-northeast-2": 0.368, + "ap-northeast-3": 1.064, + "ap-south-1": 0.368, + "ap-south-2": 0.0, + "ap-southeast-1": 0.368, + "ap-southeast-2": 1.452, + "ap-southeast-3": 1.452, + "ap-southeast-4": 1.084, + "ap-southeast-5": 0.368, + "ap-southeast-7": 0.0, + "ca-central-1": 0.368, + "ca-west-1": 0.368, + "eu-central-1": 0.368, + "eu-central-2": 0.0, + "eu-north-1": 0.368, + "eu-south-1": 0.368, + "eu-south-2": 0.368, + "eu-west-1": 0.368, + "eu-west-2": 0.368, + "eu-west-3": 1.42, + "il-central-1": 1.418, + "me-central-1": 1.1, + "me-south-1": 0.368, + "mx-central-1": 0.0, + "sa-east-1": 0.368, + "us-east-1": 1.272, + "us-east-2": 1.272, + "us-gov-east-1": 0.368, + "us-gov-west-1": 1.46, + "us-west-1": 0.368, + "us-west-2": 0.904, + "us-west-2-lax-1": 1.453 + }, + "i3en.3xlarge": { + "af-south-1": 1.782, + "ap-east-1": 0.552, + "ap-northeast-1": 2.148, + "ap-northeast-2": 2.148, + "ap-northeast-3": 2.251, + "ap-south-1": 2.094, + "ap-south-2": 2.094, + "ap-southeast-1": 0.552, + "ap-southeast-2": 0.552, + "ap-southeast-3": 0.552, + "ap-southeast-4": 2.178, + "ap-southeast-5": 0.552, + "ap-southeast-7": 1.463, + "ca-central-1": 2.052, + "ca-west-1": 2.052, + "eu-central-1": 0.552, + "eu-central-2": 0.552, + "eu-north-1": 0.552, + "eu-south-1": 1.573, + "eu-south-2": 2.052, + "eu-west-1": 2.052, + "eu-west-2": 2.13, + "eu-west-3": 2.13, + "il-central-1": 2.229, + "me-central-1": 1.65, + "me-south-1": 2.195, + "mx-central-1": 0.552, + "sa-east-1": 0.552, + "us-east-1": 0.552, + "us-east-2": 0.552, + "us-gov-east-1": 0.552, + "us-gov-west-1": 1.638, + "us-west-1": 2.052, + "us-west-2": 1.908, + "us-west-2-lax-1": 2.179 + }, + "i3en.6xlarge": { + "af-south-1": 1.104, + "ap-east-1": 1.104, + "ap-northeast-1": 4.296, + "ap-northeast-2": 1.104, + "ap-northeast-3": 4.296, + "ap-south-1": 1.104, + "ap-south-2": 0.0, + "ap-southeast-1": 4.356, + "ap-southeast-2": 4.356, + "ap-southeast-3": 4.356, + "ap-southeast-4": 1.104, + "ap-southeast-5": 3.117, + "ap-southeast-7": 4.031, + "ca-central-1": 4.104, + "ca-west-1": 4.104, + "eu-central-1": 1.104, + "eu-central-2": 4.668, + "eu-north-1": 1.104, + "eu-south-1": 4.25, + "eu-south-2": 1.104, + "eu-west-1": 0.0, + "eu-west-2": 4.26, + "eu-west-3": 4.26, + "il-central-1": 1.104, + "me-central-1": 4.404, + "me-south-1": 3.5, + "mx-central-1": 3.952, + "sa-east-1": 1.104, + "us-east-1": 3.816, + "us-east-2": 1.104, + "us-gov-east-1": 1.104, + "us-gov-west-1": 1.104, + "us-west-1": 1.104, + "us-west-2": 2.712, + "us-west-2-lax-1": 1.104 + }, + "i3en.12xlarge": { + "af-south-1": 7.128, + "ap-east-1": 9.368, + "ap-northeast-1": 8.592, + "ap-northeast-2": 8.592, + "ap-northeast-3": 6.384, + "ap-south-1": 2.208, + "ap-south-2": 2.208, + "ap-southeast-1": 2.208, + "ap-southeast-2": 2.208, + "ap-southeast-3": 8.712, + "ap-southeast-4": 8.712, + "ap-southeast-5": 5.854, + "ap-southeast-7": 8.062, + "ca-central-1": 8.208, + "ca-west-1": 6.0, + "eu-central-1": 8.688, + "eu-central-2": 9.336, + "eu-north-1": 7.896, + "eu-south-1": 2.208, + "eu-south-2": 8.208, + "eu-west-1": 8.598, + "eu-west-2": 6.312, + "eu-west-3": 8.52, + "il-central-1": 8.508, + "me-central-1": 2.208, + "me-south-1": 8.779, + "mx-central-1": 7.903, + "sa-east-1": 2.208, + "us-east-1": 2.208, + "us-east-2": 7.632, + "us-gov-east-1": 2.208, + "us-gov-west-1": 6.977, + "us-west-1": 2.208, + "us-west-2": 7.984, + "us-west-2-lax-1": 2.208 + }, + "i3en.24xlarge": { + "af-south-1": 4.416, + "ap-east-1": 4.416, + "ap-northeast-1": 4.416, + "ap-northeast-2": 4.416, + "ap-northeast-3": 4.416, + "ap-south-1": 16.752, + "ap-south-2": 16.752, + "ap-southeast-1": 4.416, + "ap-southeast-2": 17.424, + "ap-southeast-3": 4.416, + "ap-southeast-4": 13.008, + "ap-southeast-5": 4.416, + "ap-southeast-7": 4.416, + "ca-central-1": 4.416, + "ca-west-1": 12.0, + "eu-central-1": 4.416, + "eu-central-2": 14.256, + "eu-north-1": 4.416, + "eu-south-1": 17.002, + "eu-south-2": 16.416, + "eu-west-1": 12.0, + "eu-west-2": 4.416, + "eu-west-3": 17.04, + "il-central-1": 17.016, + "me-central-1": 4.416, + "me-south-1": 4.416, + "mx-central-1": 15.806, + "sa-east-1": 21.696, + "us-east-1": 4.416, + "us-east-2": 4.416, + "us-gov-east-1": 4.416, + "us-gov-west-1": 17.52, + "us-west-1": 4.416, + "us-west-2": 4.416, + "us-west-2-lax-1": 17.434 + }, + "i3p.16xlarge": { + "us-gov-west-1": 6.016 + }, + "i4i.large": { + "af-south-1": 0.092, + "ap-east-1": 0.319, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.092, + "ap-northeast-3": 0.0, + "ap-south-1": 0.195, + "ap-south-2": 0.195, + "ap-southeast-1": 0.092, + "ap-southeast-2": 0.206, + "ap-southeast-3": 0.206, + "ap-southeast-4": 0.206, + "ap-southeast-5": 0.092, + "ap-southeast-7": 0.0, + "ca-central-1": 0.281, + "ca-west-1": 0.092, + "eu-central-1": 0.0, + "eu-central-2": 0.317, + "eu-north-1": 0.271, + "eu-south-1": 0.291, + "eu-west-1": 0.208, + "eu-west-2": 0.0, + "eu-west-3": 0.199, + "il-central-1": 0.199, + "me-central-1": 0.3, + "me-south-1": 0.092, + "mx-central-1": 0.272, + "sa-east-1": 0.393, + "us-east-1": 0.264, + "us-east-2": 0.092, + "us-gov-east-1": 0.299, + "us-gov-west-1": 0.319, + "us-west-1": 0.0, + "us-west-2": 0.172 + }, + "i4i.xlarge": { + "af-south-1": 0.0, + "ap-east-1": 0.637, + "ap-northeast-1": 0.403, + "ap-northeast-2": 0.627, + "ap-northeast-3": 0.403, + "ap-south-1": 0.612, + "ap-south-2": 0.184, + "ap-southeast-1": 0.411, + "ap-southeast-2": 0.595, + "ap-southeast-3": 0.184, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.407, + "ap-southeast-7": 0.591, + "ca-central-1": 0.562, + "ca-west-1": 0.184, + "eu-central-1": 0.593, + "eu-central-2": 0.184, + "eu-north-1": 0.184, + "eu-south-1": 0.582, + "eu-west-1": 0.562, + "eu-west-2": 0.398, + "eu-west-3": 0.438, + "il-central-1": 0.397, + "me-central-1": 0.184, + "me-south-1": 0.6, + "mx-central-1": 0.396, + "sa-east-1": 0.732, + "us-east-1": 0.527, + "us-east-2": 0.184, + "us-gov-east-1": 0.598, + "us-gov-west-1": 0.598, + "us-west-1": 0.378, + "us-west-2": 0.562 + }, + "i4i.metal": { + "af-south-1": 14.432, + "ap-east-1": 14.502, + "ap-northeast-1": 12.883, + "ap-northeast-2": 18.771, + "ap-northeast-3": 18.771, + "ap-south-1": 0.0, + "ap-south-2": 12.461, + "ap-southeast-1": 19.053, + "ap-southeast-2": 5.888, + "ap-southeast-3": 19.053, + "ap-southeast-4": 5.888, + "ap-southeast-5": 11.848, + "ap-southeast-7": 0.0, + "ca-central-1": 5.888, + "ca-west-1": 5.888, + "eu-central-1": 18.982, + "eu-central-2": 5.888, + "eu-north-1": 11.475, + "eu-south-1": 12.742, + "eu-west-1": 5.888, + "eu-west-2": 18.63, + "eu-west-3": 12.742, + "il-central-1": 18.602, + "me-central-1": 13.306, + "me-south-1": 19.194, + "mx-central-1": 5.888, + "sa-east-1": 17.53, + "us-east-1": 5.888, + "us-east-2": 10.982, + "us-gov-east-1": 5.888, + "us-gov-west-1": 5.888, + "us-west-1": 12.109, + "us-west-2": 16.87 + }, + "i4i.2xlarge": { + "af-south-1": 0.368, + "ap-east-1": 1.274, + "ap-northeast-1": 1.173, + "ap-northeast-2": 0.886, + "ap-northeast-3": 0.805, + "ap-south-1": 1.147, + "ap-south-2": 0.368, + "ap-southeast-1": 0.905, + "ap-southeast-2": 0.0, + "ap-southeast-3": 1.191, + "ap-southeast-4": 1.191, + "ap-southeast-5": 0.741, + "ap-southeast-7": 1.109, + "ca-central-1": 0.0, + "ca-west-1": 0.757, + "eu-central-1": 0.368, + "eu-central-2": 0.0, + "eu-north-1": 0.368, + "eu-south-1": 0.368, + "eu-west-1": 0.368, + "eu-west-2": 0.368, + "eu-west-3": 0.368, + "il-central-1": 0.795, + "me-central-1": 0.832, + "me-south-1": 0.832, + "mx-central-1": 1.089, + "sa-east-1": 1.573, + "us-east-1": 0.755, + "us-east-2": 0.686, + "us-gov-east-1": 0.91, + "us-gov-west-1": 0.368, + "us-west-1": 0.368, + "us-west-2": 0.368 + }, + "i4i.4xlarge": { + "af-south-1": 2.54, + "ap-east-1": 0.736, + "ap-northeast-1": 0.0, + "ap-northeast-2": 2.346, + "ap-northeast-3": 1.61, + "ap-south-1": 0.736, + "ap-south-2": 0.0, + "ap-southeast-1": 2.382, + "ap-southeast-2": 2.382, + "ap-southeast-3": 1.646, + "ap-southeast-4": 1.646, + "ap-southeast-5": 2.217, + "ap-southeast-7": 1.481, + "ca-central-1": 0.736, + "ca-west-1": 0.736, + "eu-central-1": 0.736, + "eu-central-2": 0.736, + "eu-north-1": 2.17, + "eu-south-1": 0.736, + "eu-west-1": 0.736, + "eu-west-2": 0.736, + "eu-west-3": 2.329, + "il-central-1": 0.736, + "me-central-1": 0.736, + "me-south-1": 2.399, + "mx-central-1": 1.441, + "sa-east-1": 2.927, + "us-east-1": 2.246, + "us-east-2": 1.51, + "us-gov-east-1": 1.654, + "us-gov-west-1": 2.39, + "us-west-1": 0.736, + "us-west-2": 2.109 + }, + "i4i.8xlarge": { + "af-south-1": 0.0, + "ap-east-1": 5.098, + "ap-northeast-1": 4.693, + "ap-northeast-2": 3.221, + "ap-northeast-3": 4.693, + "ap-south-1": 3.115, + "ap-south-2": 4.899, + "ap-southeast-1": 5.092, + "ap-southeast-2": 4.763, + "ap-southeast-3": 1.472, + "ap-southeast-4": 3.291, + "ap-southeast-5": 1.472, + "ap-southeast-7": 2.962, + "ca-central-1": 0.0, + "ca-west-1": 3.027, + "eu-central-1": 4.746, + "eu-central-2": 3.961, + "eu-north-1": 1.472, + "eu-south-1": 0.0, + "eu-west-1": 3.027, + "eu-west-2": 0.0, + "eu-west-3": 4.658, + "il-central-1": 3.179, + "me-central-1": 3.326, + "me-south-1": 5.131, + "mx-central-1": 2.883, + "sa-east-1": 0.0, + "us-east-1": 1.472, + "us-east-2": 1.472, + "us-gov-east-1": 4.781, + "us-gov-west-1": 3.309, + "us-west-1": 4.499, + "us-west-2": 4.218 + }, + "i4i.12xlarge": { + "af-south-1": 7.62, + "ap-east-1": 8.19, + "ap-northeast-1": 2.208, + "ap-northeast-2": 7.039, + "ap-northeast-3": 4.831, + "ap-south-1": 0.0, + "ap-south-2": 4.673, + "ap-southeast-1": 7.145, + "ap-southeast-2": 0.0, + "ap-southeast-3": 5.43, + "ap-southeast-4": 2.208, + "ap-southeast-5": 2.208, + "ap-southeast-7": 2.208, + "ca-central-1": 2.208, + "ca-west-1": 4.541, + "eu-central-1": 7.118, + "eu-central-2": 0.0, + "eu-north-1": 0.0, + "eu-south-1": 4.778, + "eu-west-1": 0.0, + "eu-west-2": 4.778, + "eu-west-3": 4.778, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 2.208, + "sa-east-1": 6.574, + "us-east-1": 6.738, + "us-east-2": 6.738, + "us-gov-east-1": 4.963, + "us-gov-west-1": 4.963, + "us-west-1": 2.208, + "us-west-2": 4.118 + }, + "i4i.16xlarge": { + "af-south-1": 7.216, + "ap-east-1": 2.944, + "ap-northeast-1": 6.442, + "ap-northeast-2": 2.944, + "ap-northeast-3": 9.386, + "ap-south-1": 6.23, + "ap-south-2": 2.944, + "ap-southeast-1": 9.526, + "ap-southeast-2": 2.944, + "ap-southeast-3": 0.0, + "ap-southeast-4": 6.582, + "ap-southeast-5": 5.924, + "ap-southeast-7": 8.868, + "ca-central-1": 0.0, + "ca-west-1": 2.944, + "eu-central-1": 2.944, + "eu-central-2": 2.944, + "eu-north-1": 8.682, + "eu-south-1": 9.952, + "eu-west-1": 6.054, + "eu-west-2": 2.944, + "eu-west-3": 9.315, + "il-central-1": 9.937, + "me-central-1": 2.944, + "me-south-1": 9.597, + "mx-central-1": 9.286, + "sa-east-1": 2.944, + "us-east-1": 8.435, + "us-east-2": 6.04, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.944, + "us-west-1": 8.998, + "us-west-2": 8.984 + }, + "i4i.24xlarge": { + "af-south-1": 10.824, + "ap-east-1": 10.8768, + "ap-northeast-1": 10.62864, + "ap-northeast-2": 0.0, + "ap-northeast-3": 9.6624, + "ap-south-1": 0.0, + "ap-south-2": 13.7616, + "ap-southeast-1": 0.0, + "ap-southeast-2": 9.8736, + "ap-southeast-3": 4.416, + "ap-southeast-4": 9.8736, + "ap-southeast-5": 4.416, + "ap-southeast-7": 14.19086, + "ca-central-1": 9.0816, + "ca-west-1": 9.0816, + "eu-central-1": 14.2368, + "eu-central-2": 10.80288, + "eu-north-1": 13.0224, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 4.416, + "eu-west-3": 4.416, + "me-central-1": 14.3952, + "me-south-1": 4.416, + "mx-central-1": 4.416, + "sa-east-1": 17.5632, + "us-east-1": 8.2368, + "us-east-2": 8.2368, + "us-gov-east-1": 14.3424, + "us-gov-west-1": 9.9264, + "us-west-1": 9.0816, + "us-west-2": 8.2368 + }, + "i4i.32xlarge": { + "af-south-1": 5.888, + "ap-east-1": 5.888, + "ap-northeast-1": 5.888, + "ap-northeast-2": 12.8832, + "ap-northeast-3": 12.8832, + "ap-south-1": 12.4608, + "ap-south-2": 18.3488, + "ap-southeast-1": 5.888, + "ap-southeast-2": 19.0528, + "ap-southeast-3": 19.0528, + "ap-southeast-4": 19.0528, + "ap-southeast-5": 5.888, + "ap-southeast-7": 17.73632, + "ca-central-1": 17.9968, + "ca-west-1": 12.1088, + "eu-central-1": 13.0944, + "eu-central-2": 20.29184, + "eu-north-1": 17.3632, + "eu-south-1": 18.6304, + "eu-west-1": 12.1088, + "eu-west-2": 5.888, + "eu-west-3": 0.0, + "il-central-1": 0.0, + "me-central-1": 19.1936, + "me-south-1": 5.888, + "mx-central-1": 11.53152, + "sa-east-1": 23.4176, + "us-east-1": 5.888, + "us-east-2": 0.0, + "us-gov-east-1": 5.888, + "us-gov-west-1": 5.888, + "us-west-1": 12.1088, + "us-west-2": 10.9824 + }, + "i7ie.large": { + "ap-northeast-1": 0.3979, + "eu-central-1": 0.092, + "eu-west-2": 0.0, + "us-east-1": 0.092, + "us-east-2": 0.092, + "us-west-2": 0.2768 + }, + "i7ie.xlarge": { + "ap-northeast-1": 0.6118, + "eu-central-1": 0.184, + "eu-west-2": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.5535, + "us-west-2": 0.184 + }, + "i7ie.2xlarge": { + "ap-northeast-1": 1.5916, + "eu-central-1": 0.368, + "eu-west-2": 1.2098, + "us-east-1": 1.4076, + "us-east-2": 1.475, + "us-west-2": 0.368 + }, + "i7ie.3xlarge": { + "ap-northeast-1": 0.552, + "eu-central-1": 1.9841, + "eu-west-2": 2.3667, + "us-east-1": 1.5594, + "us-east-2": 0.552, + "us-west-2": 1.6605 + }, + "i7ie.6xlarge": { + "ap-northeast-1": 5.0135, + "eu-central-1": 1.104, + "eu-west-2": 1.104, + "us-east-1": 4.2228, + "us-east-2": 4.2228, + "us-west-2": 4.2228 + }, + "i7ie.12xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 9.66, + "eu-west-2": 7.2588, + "us-east-1": 0.0, + "us-east-2": 8.4456, + "us-west-2": 0.0 + }, + "i7ie.18xlarge": { + "ap-northeast-1": 14.3244, + "eu-central-1": 0.0, + "eu-west-2": 3.312, + "us-east-1": 9.3564, + "us-east-2": 12.6684, + "us-west-2": 9.9633 + }, + "i7ie.24xlarge": { + "ap-northeast-1": 19.0992, + "eu-central-1": 14.904, + "eu-west-2": 18.9336, + "us-east-1": 12.4752, + "us-east-2": 12.4752, + "us-west-2": 16.8912 + }, + "i7ie.48xlarge": { + "ap-northeast-1": 40.1076, + "eu-central-1": 0.0, + "eu-west-2": 37.8672, + "us-east-1": 33.7824, + "us-east-2": 24.9504, + "us-west-2": 24.9504 + }, + "m1.small": { + "ap-northeast-1": 0.088, + "ap-southeast-1": 0.058, + "ap-southeast-2": 0.093, + "eu-west-1": 0.075, + "sa-east-1": 0.058, + "us-east-1": 0.075, + "us-gov-west-1": 0.053, + "us-west-1": 0.078, + "us-west-2": 0.075 + }, + "m1.medium": { + "ap-northeast-1": 0.177, + "ap-southeast-1": 0.187, + "ap-southeast-2": 0.117, + "eu-west-1": 0.149, + "sa-east-1": 0.117, + "us-east-1": 0.149, + "us-gov-west-1": 0.106, + "us-west-1": 0.095, + "us-west-2": 0.087 + }, + "m1.large": { + "ap-northeast-1": 0.353, + "ap-southeast-1": 0.373, + "ap-southeast-2": 0.233, + "eu-west-1": 0.299, + "sa-east-1": 0.233, + "us-east-1": 0.175, + "us-gov-west-1": 0.211, + "us-west-1": 0.314, + "us-west-2": 0.175 + }, + "m1.xlarge": { + "ap-northeast-1": 0.706, + "ap-southeast-1": 0.467, + "ap-southeast-2": 0.747, + "eu-west-1": 0.598, + "sa-east-1": 0.467, + "us-east-1": 0.35, + "us-gov-west-1": 0.671, + "us-west-1": 0.627, + "us-west-2": 0.598 + }, + "m2.xlarge": { + "ap-northeast-1": 0.287, + "ap-southeast-1": 0.371, + "ap-southeast-2": 0.371, + "eu-west-1": 0.275, + "sa-east-1": 0.423, + "us-east-1": 0.345, + "us-gov-west-1": 0.293, + "us-west-1": 0.375, + "us-west-2": 0.245 + }, + "m2.2xlarge": { + "ap-northeast-1": 0.705, + "ap-southeast-1": 0.742, + "ap-southeast-2": 0.742, + "eu-west-1": 0.69, + "sa-east-1": 0.845, + "us-east-1": 0.49, + "us-gov-west-1": 0.586, + "us-west-1": 0.75, + "us-west-2": 0.49 + }, + "m2.4xlarge": { + "ap-northeast-1": 1.41, + "ap-southeast-1": 1.183, + "ap-southeast-2": 1.483, + "eu-west-1": 1.1, + "sa-east-1": 1.291, + "us-east-1": 0.98, + "us-gov-west-1": 1.571, + "us-west-1": 1.5, + "us-west-2": 1.38 + }, + "m3.medium": { + "ap-northeast-1": 0.096, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.098, + "ap-southeast-2": 0.093, + "eu-central-1": 0.046, + "eu-west-1": 0.0, + "sa-east-1": 0.095, + "us-east-1": 0.046, + "us-gov-west-1": 0.147, + "us-west-1": 0.046, + "us-west-2": 0.13 + }, + "m3.large": { + "ap-northeast-1": 0.292, + "ap-northeast-2": 0.201685, + "ap-southeast-1": 0.092, + "ap-southeast-2": 0.092, + "eu-central-1": 0.092, + "eu-west-1": 0.146, + "sa-east-1": 0.092, + "us-east-1": 0.259, + "us-gov-west-1": 0.092, + "us-west-1": 0.0, + "us-west-2": 0.285 + }, + "m3.xlarge": { + "ap-northeast-1": 0.583, + "ap-northeast-2": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.567, + "eu-west-1": 0.0, + "sa-east-1": 0.381, + "us-east-1": 0.266, + "us-gov-west-1": 0.588, + "us-west-1": 0.308, + "us-west-2": 0.184 + }, + "m3.2xlarge": { + "ap-northeast-1": 0.368, + "ap-northeast-2": 0.80465, + "ap-southeast-1": 1.288, + "ap-southeast-2": 1.374, + "eu-central-1": 0.632, + "eu-west-1": 0.585, + "sa-east-1": 0.0, + "us-east-1": 0.368, + "us-gov-west-1": 1.176, + "us-west-1": 1.12, + "us-west-2": 0.368 + }, + "m4.large": { + "ap-northeast-1": 0.221, + "ap-northeast-2": 0.123, + "ap-northeast-3": 0.129, + "ap-south-1": 0.197, + "ap-southeast-1": 0.125, + "ap-southeast-2": 0.092, + "ca-central-1": 0.203, + "eu-central-1": 0.212, + "eu-west-1": 0.111, + "eu-west-2": 0.116, + "sa-east-1": 0.0, + "us-east-1": 0.1, + "us-east-2": 0.192, + "us-gov-west-1": 0.218, + "us-west-1": 0.117, + "us-west-2": 0.192 + }, + "m4.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.184, + "ap-northeast-3": 0.442, + "ap-south-1": 0.0, + "ap-southeast-1": 0.25, + "ap-southeast-2": 0.434, + "ca-central-1": 0.222, + "eu-central-1": 0.24, + "eu-west-1": 0.406, + "eu-west-2": 0.184, + "sa-east-1": 0.0, + "us-east-1": 0.184, + "us-east-2": 0.2, + "us-gov-west-1": 0.436, + "us-west-1": 0.0, + "us-west-2": 0.404 + }, + "m4.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.492, + "ap-northeast-3": 0.0, + "ap-south-1": 0.368, + "ap-southeast-1": 0.918, + "ap-southeast-2": 0.0, + "ca-central-1": 0.8564, + "eu-central-1": 0.848, + "eu-west-1": 0.812, + "eu-west-2": 0.832, + "sa-east-1": 0.636, + "us-east-1": 0.4, + "us-east-2": 0.4, + "us-gov-west-1": 0.872, + "us-west-1": 0.468, + "us-west-2": 0.4 + }, + "m4.4xlarge": { + "ap-northeast-1": 1.768, + "ap-northeast-2": 1.72, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 1.736, + "ap-southeast-2": 1.836, + "ca-central-1": 1.624, + "eu-central-1": 1.056, + "eu-west-1": 1.624, + "eu-west-2": 0.736, + "sa-east-1": 2.008, + "us-east-1": 1.536, + "us-east-2": 1.536, + "us-gov-west-1": 0.736, + "us-west-1": 0.936, + "us-west-2": 0.0 + }, + "m4.10xlarge": { + "ap-northeast-1": 2.58, + "ap-northeast-2": 4.3, + "ap-south-1": 2.1, + "ap-southeast-1": 4.34, + "ap-southeast-2": 1.84, + "ca-central-1": 4.06, + "eu-central-1": 4.24, + "eu-west-1": 4.06, + "eu-west-2": 1.84, + "sa-east-1": 5.02, + "us-east-1": 3.84, + "us-east-2": 3.84, + "us-gov-west-1": 1.84, + "us-west-1": 1.84, + "us-west-2": 3.84 + }, + "m4.16xlarge": { + "ap-northeast-1": 2.944, + "ap-northeast-2": 3.936, + "ap-northeast-3": 7.072, + "ap-south-1": 6.304, + "ap-southeast-1": 6.944, + "ap-southeast-2": 6.944, + "ca-central-1": 3.552, + "eu-central-1": 3.84, + "eu-west-1": 6.496, + "eu-west-2": 6.656, + "sa-east-1": 5.088, + "us-east-1": 3.2, + "us-east-2": 6.144, + "us-gov-west-1": 2.944, + "us-west-1": 3.744, + "us-west-2": 6.144 + }, + "m5.large": { + "af-south-1": 0.219, + "ap-east-1": 0.092, + "ap-northeast-1": 0.092, + "ap-northeast-2": 0.21, + "ap-northeast-3": 0.092, + "ap-south-1": 0.193, + "ap-south-2": 0.092, + "ap-southeast-1": 0.127, + "ap-southeast-2": 0.12, + "ap-southeast-3": 0.092, + "ap-southeast-4": 0.212, + "ca-central-1": 0.0, + "ca-west-1": 0.107, + "eu-central-1": 0.215, + "eu-central-2": 0.092, + "eu-north-1": 0.0, + "eu-south-1": 0.112, + "eu-south-2": 0.199, + "eu-west-1": 0.107, + "eu-west-2": 0.111, + "eu-west-3": 0.0, + "il-central-1": 0.124, + "me-central-1": 0.21, + "me-south-1": 0.21, + "sa-east-1": 0.153, + "us-east-1": 0.188, + "us-east-2": 0.188, + "us-gov-east-1": 0.213, + "us-gov-west-1": 0.0, + "us-west-1": 0.204, + "us-west-2": 0.092, + "us-west-2-lax-1": 0.207 + }, + "m5.xlarge": { + "af-south-1": 0.269, + "ap-east-1": 0.448, + "ap-northeast-1": 0.248, + "ap-northeast-2": 0.236, + "ap-northeast-3": 0.248, + "ap-south-1": 0.202, + "ap-south-2": 0.398, + "ap-southeast-1": 0.424, + "ap-southeast-2": 0.24, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.184, + "ca-central-1": 0.184, + "ca-west-1": 0.419, + "eu-central-1": 0.246, + "eu-central-2": 0.452, + "eu-north-1": 0.204, + "eu-south-1": 0.224, + "eu-south-2": 0.398, + "eu-west-1": 0.398, + "eu-west-2": 0.184, + "eu-west-3": 0.184, + "il-central-1": 0.225, + "me-central-1": 0.184, + "me-south-1": 0.235, + "sa-east-1": 0.49, + "us-east-1": 0.192, + "us-east-2": 0.388, + "us-gov-east-1": 0.242, + "us-gov-west-1": 0.426, + "us-west-1": 0.184, + "us-west-2": 0.376, + "us-west-2-lax-1": 0.414 + }, + "m5.metal": { + "af-south-1": 10.512, + "ap-east-1": 10.752, + "ap-northeast-1": 4.416, + "ap-northeast-2": 4.416, + "ap-northeast-3": 4.416, + "ap-south-1": 9.264, + "ap-south-2": 4.416, + "ap-southeast-1": 10.176, + "ap-southeast-2": 5.76, + "ap-southeast-3": 4.416, + "ap-southeast-4": 10.176, + "ca-central-1": 5.136, + "ca-west-1": 5.136, + "eu-central-1": 9.936, + "eu-central-2": 10.488, + "eu-north-1": 9.312, + "eu-south-1": 9.792, + "eu-south-2": 5.136, + "eu-west-1": 4.416, + "eu-west-2": 5.328, + "eu-west-3": 5.376, + "il-central-1": 5.393, + "me-central-1": 10.066, + "me-south-1": 10.066, + "sa-east-1": 11.76, + "us-east-1": 4.608, + "us-east-2": 4.608, + "us-gov-east-1": 10.224, + "us-gov-west-1": 0.0, + "us-west-1": 4.416, + "us-west-2": 4.416, + "us-west-2-lax-1": 9.946 + }, + "m5.2xlarge": { + "af-south-1": 0.368, + "ap-east-1": 0.528, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.84, + "ap-northeast-3": 0.864, + "ap-south-1": 0.404, + "ap-south-2": 0.428, + "ap-southeast-1": 0.368, + "ap-southeast-2": 0.368, + "ap-southeast-3": 0.48, + "ap-southeast-4": 0.848, + "ca-central-1": 0.454, + "ca-west-1": 0.796, + "eu-central-1": 0.828, + "eu-central-2": 0.506, + "eu-north-1": 0.368, + "eu-south-1": 0.816, + "eu-south-2": 0.428, + "eu-west-1": 0.368, + "eu-west-2": 0.0, + "eu-west-3": 0.448, + "il-central-1": 0.0, + "me-central-1": 0.471, + "me-south-1": 0.368, + "sa-east-1": 0.98, + "us-east-1": 0.0, + "us-east-2": 0.752, + "us-gov-east-1": 0.852, + "us-gov-west-1": 0.0, + "us-west-1": 0.448, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.829 + }, + "m5.4xlarge": { + "af-south-1": 0.736, + "ap-east-1": 1.792, + "ap-northeast-1": 0.992, + "ap-northeast-2": 1.68, + "ap-northeast-3": 0.736, + "ap-south-1": 1.544, + "ap-south-2": 0.808, + "ap-southeast-1": 1.696, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.96, + "ca-central-1": 1.592, + "ca-west-1": 0.736, + "eu-central-1": 1.656, + "eu-central-2": 1.748, + "eu-north-1": 0.736, + "eu-south-1": 0.95, + "eu-south-2": 1.592, + "eu-west-1": 0.736, + "eu-west-2": 0.736, + "eu-west-3": 0.896, + "il-central-1": 0.0, + "me-central-1": 0.998, + "me-south-1": 1.678, + "sa-east-1": 1.96, + "us-east-1": 0.736, + "us-east-2": 1.504, + "us-gov-east-1": 1.704, + "us-gov-west-1": 0.968, + "us-west-1": 0.736, + "us-west-2": 0.768, + "us-west-2-lax-1": 0.736 + }, + "m5.8xlarge": { + "af-south-1": 3.504, + "ap-east-1": 1.472, + "ap-northeast-1": 1.984, + "ap-northeast-2": 3.472, + "ap-northeast-3": 0.0, + "ap-south-1": 1.472, + "ap-south-2": 1.616, + "ap-southeast-1": 1.92, + "ap-southeast-2": 1.92, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0, + "ca-central-1": 0.0, + "ca-west-1": 3.355, + "eu-central-1": 3.312, + "eu-central-2": 2.024, + "eu-north-1": 0.0, + "eu-south-1": 3.264, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 1.472, + "eu-west-3": 1.792, + "il-central-1": 1.798, + "me-central-1": 1.883, + "me-south-1": 1.883, + "sa-east-1": 3.92, + "us-east-1": 1.536, + "us-east-2": 3.101, + "us-gov-east-1": 1.472, + "us-gov-west-1": 0.0, + "us-west-1": 1.792, + "us-west-2": 3.008, + "us-west-2-lax-1": 3.315 + }, + "m5.12xlarge": { + "af-south-1": 3.231, + "ap-east-1": 3.168, + "ap-northeast-1": 2.208, + "ap-northeast-2": 5.04, + "ap-northeast-3": 2.976, + "ap-south-1": 2.424, + "ap-south-2": 2.208, + "ap-southeast-1": 3.058, + "ap-southeast-2": 2.208, + "ap-southeast-3": 2.208, + "ap-southeast-4": 5.088, + "ca-central-1": 2.208, + "ca-west-1": 0.0, + "eu-central-1": 4.968, + "eu-central-2": 3.218, + "eu-north-1": 2.612, + "eu-south-1": 4.896, + "eu-south-2": 2.208, + "eu-west-1": 4.776, + "eu-west-2": 4.872, + "eu-west-3": 2.688, + "il-central-1": 2.208, + "me-central-1": 5.033, + "me-south-1": 0.0, + "sa-east-1": 3.672, + "us-east-1": 0.0, + "us-east-2": 4.512, + "us-gov-east-1": 5.112, + "us-gov-west-1": 5.112, + "us-west-1": 4.896, + "us-west-2": 2.304, + "us-west-2-lax-1": 4.973 + }, + "m5.16xlarge": { + "af-south-1": 4.308, + "ap-east-1": 4.224, + "ap-northeast-1": 6.912, + "ap-northeast-2": 2.944, + "ap-northeast-3": 3.968, + "ap-south-1": 3.232, + "ap-south-2": 0.0, + "ap-southeast-1": 6.784, + "ap-southeast-2": 7.037, + "ap-southeast-3": 0.0, + "ap-southeast-4": 6.784, + "ca-central-1": 3.424, + "ca-west-1": 2.944, + "eu-central-1": 6.624, + "eu-central-2": 4.048, + "eu-north-1": 6.208, + "eu-south-1": 3.584, + "eu-south-2": 6.368, + "eu-west-1": 3.424, + "eu-west-2": 6.496, + "eu-west-3": 3.584, + "il-central-1": 6.539, + "me-central-1": 6.936, + "me-south-1": 3.766, + "sa-east-1": 2.944, + "us-east-1": 3.259, + "us-east-2": 6.016, + "us-gov-east-1": 6.816, + "us-gov-west-1": 3.872, + "us-west-1": 6.528, + "us-west-2": 3.072, + "us-west-2-lax-1": 2.944 + }, + "m5.24xlarge": { + "af-south-1": 4.416, + "ap-east-1": 10.752, + "ap-northeast-1": 4.416, + "ap-northeast-2": 10.08, + "ap-northeast-3": 5.952, + "ap-south-1": 0.0, + "ap-south-2": 4.848, + "ap-southeast-1": 4.416, + "ap-southeast-2": 4.416, + "ap-southeast-3": 0.0, + "ap-southeast-4": 10.176, + "ca-central-1": 9.552, + "ca-west-1": 5.136, + "eu-central-1": 5.52, + "eu-central-2": 6.072, + "eu-north-1": 4.896, + "eu-south-1": 4.416, + "eu-south-2": 4.416, + "eu-west-1": 9.552, + "eu-west-2": 4.416, + "eu-west-3": 5.376, + "il-central-1": 5.393, + "me-central-1": 4.416, + "me-south-1": 10.066, + "sa-east-1": 11.76, + "us-east-1": 4.608, + "us-east-2": 4.608, + "us-gov-east-1": 0.0, + "us-gov-west-1": 5.808, + "us-west-1": 4.416, + "us-west-2": 9.024, + "us-west-2-lax-1": 9.946 + }, + "m5a.large": { + "ap-northeast-1": 0.204, + "ap-northeast-2": 0.198, + "ap-south-1": 0.148, + "ap-southeast-1": 0.108, + "ap-southeast-2": 0.2, + "ca-central-1": 0.096, + "eu-central-1": 0.196, + "eu-south-1": 0.193, + "eu-west-1": 0.188, + "eu-west-2": 0.192, + "eu-west-3": 0.193, + "sa-east-1": 0.23, + "us-east-1": 0.086, + "us-east-2": 0.086, + "us-gov-east-1": 0.201, + "us-gov-west-1": 0.201, + "us-west-1": 0.193, + "us-west-2": 0.178 + }, + "m5a.xlarge": { + "ap-northeast-1": 0.408, + "ap-northeast-2": 0.396, + "ap-south-1": 0.295, + "ap-southeast-1": 0.216, + "ap-southeast-2": 0.4, + "ca-central-1": 0.376, + "eu-central-1": 0.392, + "eu-south-1": 0.386, + "eu-west-1": 0.376, + "eu-west-2": 0.384, + "eu-west-3": 0.386, + "sa-east-1": 0.46, + "us-east-1": 0.172, + "us-east-2": 0.172, + "us-gov-east-1": 0.402, + "us-gov-west-1": 0.402, + "us-west-1": 0.386, + "us-west-2": 0.172 + }, + "m5a.2xlarge": { + "ap-northeast-1": 0.816, + "ap-northeast-2": 0.792, + "ap-south-1": 0.59, + "ap-southeast-1": 0.432, + "ap-southeast-2": 0.8, + "ca-central-1": 0.384, + "eu-central-1": 0.784, + "eu-south-1": 0.772, + "eu-west-1": 0.384, + "eu-west-2": 0.768, + "eu-west-3": 0.772, + "sa-east-1": 0.92, + "us-east-1": 0.344, + "us-east-2": 0.344, + "us-gov-east-1": 0.804, + "us-gov-west-1": 0.804, + "us-west-1": 0.772, + "us-west-2": 0.712 + }, + "m5a.4xlarge": { + "ap-northeast-1": 1.632, + "ap-northeast-2": 1.584, + "ap-south-1": 1.18, + "ap-southeast-1": 0.864, + "ap-southeast-2": 1.6, + "ca-central-1": 1.504, + "eu-central-1": 1.568, + "eu-south-1": 1.544, + "eu-west-1": 1.504, + "eu-west-2": 1.536, + "eu-west-3": 1.544, + "sa-east-1": 1.84, + "us-east-1": 1.424, + "us-east-2": 0.688, + "us-gov-east-1": 1.608, + "us-gov-west-1": 0.872, + "us-west-1": 1.544, + "us-west-2": 0.688 + }, + "m5a.8xlarge": { + "ap-northeast-1": 3.264, + "ap-northeast-2": 3.168, + "ap-south-1": 2.361, + "ap-southeast-1": 3.2, + "ap-southeast-2": 3.2, + "ca-central-1": 1.536, + "eu-central-1": 3.136, + "eu-south-1": 3.088, + "eu-west-1": 3.008, + "eu-west-2": 3.072, + "eu-west-3": 3.088, + "sa-east-1": 3.68, + "us-east-1": 2.848, + "us-east-2": 2.848, + "us-gov-east-1": 3.216, + "us-gov-west-1": 3.216, + "us-west-1": 3.088, + "us-west-2": 2.848 + }, + "m5a.12xlarge": { + "ap-northeast-1": 4.896, + "ap-northeast-2": 4.752, + "ap-south-1": 3.541, + "ap-southeast-1": 2.592, + "ap-southeast-2": 4.8, + "ca-central-1": 2.304, + "eu-central-1": 4.704, + "eu-south-1": 4.632, + "eu-west-1": 4.512, + "eu-west-2": 4.608, + "eu-west-3": 4.632, + "sa-east-1": 5.52, + "us-east-1": 2.064, + "us-east-2": 4.272, + "us-gov-east-1": 4.824, + "us-gov-west-1": 2.616, + "us-west-1": 4.632, + "us-west-2": 2.064 + }, + "m5a.16xlarge": { + "ap-northeast-1": 6.528, + "ap-northeast-2": 6.336, + "ap-south-1": 4.722, + "ap-southeast-1": 6.4, + "ap-southeast-2": 6.4, + "ca-central-1": 3.072, + "eu-central-1": 6.272, + "eu-south-1": 6.176, + "eu-west-1": 6.016, + "eu-west-2": 6.144, + "eu-west-3": 6.176, + "sa-east-1": 7.36, + "us-east-1": 5.696, + "us-east-2": 5.696, + "us-gov-east-1": 6.432, + "us-gov-west-1": 3.488, + "us-west-1": 6.176, + "us-west-2": 5.696 + }, + "m5a.24xlarge": { + "ap-northeast-1": 9.792, + "ap-northeast-2": 9.504, + "ap-south-1": 7.082, + "ap-southeast-1": 5.184, + "ap-southeast-2": 9.6, + "ca-central-1": 4.608, + "eu-central-1": 9.408, + "eu-south-1": 9.264, + "eu-west-1": 4.608, + "eu-west-2": 9.216, + "eu-west-3": 9.264, + "sa-east-1": 11.04, + "us-east-1": 4.128, + "us-east-2": 4.128, + "us-gov-east-1": 9.648, + "us-gov-west-1": 9.648, + "us-west-1": 9.264, + "us-west-2": 4.128 + }, + "m5ad.large": { + "ap-northeast-1": 0.226, + "ap-northeast-2": 0.219, + "ap-south-1": 0.159, + "ap-southeast-1": 0.221, + "ap-southeast-2": 0.222, + "ca-central-1": 0.207, + "eu-central-1": 0.217, + "eu-west-1": 0.207, + "eu-west-2": 0.212, + "eu-west-3": 0.213, + "sa-east-1": 0.257, + "us-east-1": 0.195, + "us-east-2": 0.195, + "us-gov-west-1": 0.223, + "us-west-1": 0.214, + "us-west-2": 0.195 + }, + "m5ad.xlarge": { + "ap-northeast-1": 0.452, + "ap-northeast-2": 0.438, + "ap-south-1": 0.318, + "ap-southeast-1": 0.442, + "ap-southeast-2": 0.444, + "ca-central-1": 0.414, + "eu-central-1": 0.434, + "eu-west-1": 0.414, + "eu-west-2": 0.424, + "eu-west-3": 0.426, + "sa-east-1": 0.514, + "us-east-1": 0.39, + "us-east-2": 0.39, + "us-gov-west-1": 0.446, + "us-west-1": 0.428, + "us-west-2": 0.39 + }, + "m5ad.2xlarge": { + "ap-northeast-1": 0.904, + "ap-northeast-2": 0.876, + "ap-south-1": 0.636, + "ap-southeast-1": 0.884, + "ap-southeast-2": 0.888, + "ca-central-1": 0.828, + "eu-central-1": 0.868, + "eu-west-1": 0.828, + "eu-west-2": 0.848, + "eu-west-3": 0.852, + "sa-east-1": 1.028, + "us-east-1": 0.78, + "us-east-2": 0.78, + "us-gov-west-1": 0.524, + "us-west-1": 0.856, + "us-west-2": 0.78 + }, + "m5ad.4xlarge": { + "ap-northeast-1": 1.808, + "ap-northeast-2": 1.752, + "ap-south-1": 1.273, + "ap-southeast-1": 1.768, + "ap-southeast-2": 1.776, + "ca-central-1": 1.656, + "eu-central-1": 1.736, + "eu-west-1": 1.656, + "eu-west-2": 1.696, + "eu-west-3": 1.704, + "sa-east-1": 2.056, + "us-east-1": 1.56, + "us-east-2": 1.56, + "us-gov-west-1": 1.048, + "us-west-1": 1.712, + "us-west-2": 1.56 + }, + "m5ad.8xlarge": { + "ap-northeast-1": 3.616, + "ap-northeast-2": 3.504, + "ap-south-1": 2.546, + "ap-southeast-1": 3.536, + "ap-southeast-2": 3.552, + "ca-central-1": 3.312, + "eu-central-1": 3.472, + "eu-west-1": 3.312, + "eu-west-2": 3.392, + "eu-west-3": 3.408, + "sa-east-1": 4.112, + "us-east-1": 3.12, + "us-east-2": 3.12, + "us-gov-west-1": 3.568, + "us-west-1": 3.424, + "us-west-2": 3.12 + }, + "m5ad.12xlarge": { + "ap-northeast-1": 5.424, + "ap-northeast-2": 5.256, + "ap-south-1": 3.818, + "ap-southeast-1": 5.304, + "ap-southeast-2": 5.328, + "ca-central-1": 4.968, + "eu-central-1": 5.208, + "eu-west-1": 4.968, + "eu-west-2": 5.088, + "eu-west-3": 5.112, + "sa-east-1": 6.168, + "us-east-1": 4.68, + "us-east-2": 4.68, + "us-gov-west-1": 5.352, + "us-west-1": 5.136, + "us-west-2": 4.68 + }, + "m5ad.16xlarge": { + "ap-northeast-1": 7.232, + "ap-northeast-2": 7.008, + "ap-south-1": 5.091, + "ap-southeast-1": 7.072, + "ap-southeast-2": 7.104, + "ca-central-1": 6.624, + "eu-central-1": 6.944, + "eu-west-1": 6.624, + "eu-west-2": 6.784, + "eu-west-3": 6.816, + "sa-east-1": 8.224, + "us-east-1": 6.24, + "us-east-2": 6.24, + "us-gov-west-1": 7.136, + "us-west-1": 6.848, + "us-west-2": 6.24 + }, + "m5ad.24xlarge": { + "ap-northeast-1": 10.848, + "ap-northeast-2": 10.512, + "ap-south-1": 7.637, + "ap-southeast-1": 10.608, + "ap-southeast-2": 10.656, + "ca-central-1": 9.936, + "eu-central-1": 10.416, + "eu-west-1": 9.936, + "eu-west-2": 10.176, + "eu-west-3": 10.224, + "sa-east-1": 12.336, + "us-east-1": 9.36, + "us-east-2": 9.36, + "us-gov-west-1": 6.288, + "us-west-1": 10.272, + "us-west-2": 9.36 + }, + "m5d.large": { + "af-south-1": 0.092, + "ap-east-1": 0.092, + "ap-northeast-1": 0.092, + "ap-northeast-2": 0.092, + "ap-northeast-3": 0.092, + "ap-south-1": 0.214, + "ap-south-2": 0.122, + "ap-southeast-1": 0.092, + "ap-southeast-2": 0.092, + "ap-southeast-3": 0.233, + "ap-southeast-4": 0.243, + "ca-central-1": 0.126, + "ca-west-1": 0.092, + "eu-central-1": 0.0, + "eu-central-2": 0.092, + "eu-north-1": 0.092, + "eu-south-1": 0.224, + "eu-south-2": 0.092, + "eu-west-1": 0.0, + "eu-west-2": 0.223, + "eu-west-3": 0.092, + "il-central-1": 0.092, + "me-central-1": 0.231, + "me-south-1": 0.231, + "sa-east-1": 0.092, + "us-east-1": 0.0, + "us-east-2": 0.113, + "us-gov-east-1": 0.092, + "us-gov-west-1": 0.143, + "us-west-1": 0.133, + "us-west-2": 0.092 + }, + "m5d.xlarge": { + "af-south-1": 0.184, + "ap-east-1": 0.184, + "ap-northeast-1": 0.476, + "ap-northeast-2": 0.462, + "ap-northeast-3": 0.184, + "ap-south-1": 0.428, + "ap-south-2": 0.259, + "ap-southeast-1": 0.184, + "ap-southeast-2": 0.468, + "ap-southeast-3": 0.184, + "ap-southeast-4": 0.284, + "ca-central-1": 0.436, + "ca-west-1": 0.436, + "eu-central-1": 0.272, + "eu-central-2": 0.483, + "eu-north-1": 0.424, + "eu-south-1": 0.448, + "eu-south-2": 0.0, + "eu-west-1": 0.269, + "eu-west-2": 0.262, + "eu-west-3": 0.184, + "il-central-1": 0.184, + "me-central-1": 0.184, + "me-south-1": 0.184, + "sa-east-1": 0.544, + "us-east-1": 0.41, + "us-east-2": 0.41, + "us-gov-east-1": 0.184, + "us-gov-west-1": 0.286, + "us-west-1": 0.184, + "us-west-2": 0.184 + }, + "m5d.metal": { + "af-south-1": 4.416, + "ap-east-1": 4.416, + "ap-northeast-1": 11.424, + "ap-northeast-2": 11.088, + "ap-northeast-3": 4.416, + "ap-south-1": 10.272, + "ap-south-2": 4.416, + "ap-southeast-1": 11.184, + "ap-southeast-2": 4.416, + "ap-southeast-3": 11.184, + "ap-southeast-4": 6.816, + "ca-central-1": 10.464, + "ca-west-1": 4.416, + "eu-central-1": 4.416, + "eu-central-2": 7.181, + "eu-north-1": 10.176, + "eu-south-1": 4.416, + "eu-south-2": 10.464, + "eu-west-1": 10.464, + "eu-west-2": 10.704, + "eu-west-3": 10.752, + "il-central-1": 4.416, + "me-central-1": 4.416, + "me-south-1": 11.069, + "sa-east-1": 4.416, + "us-east-1": 9.84, + "us-east-2": 4.416, + "us-gov-east-1": 4.416, + "us-gov-west-1": 6.864, + "us-west-1": 4.416, + "us-west-2": 4.416 + }, + "m5d.2xlarge": { + "af-south-1": 0.968, + "ap-east-1": 0.368, + "ap-northeast-1": 0.368, + "ap-northeast-2": 0.368, + "ap-northeast-3": 0.368, + "ap-south-1": 0.368, + "ap-south-2": 0.856, + "ap-southeast-1": 0.932, + "ap-southeast-2": 0.368, + "ap-southeast-3": 0.598, + "ap-southeast-4": 0.936, + "ca-central-1": 0.368, + "ca-west-1": 0.368, + "eu-central-1": 0.544, + "eu-central-2": 0.0, + "eu-north-1": 0.848, + "eu-south-1": 0.896, + "eu-south-2": 0.872, + "eu-west-1": 0.872, + "eu-west-2": 0.927, + "eu-west-3": 0.896, + "il-central-1": 0.929, + "me-central-1": 0.956, + "me-south-1": 0.368, + "sa-east-1": 1.088, + "us-east-1": 0.847, + "us-east-2": 0.82, + "us-gov-east-1": 0.368, + "us-gov-west-1": 0.368, + "us-west-1": 0.532, + "us-west-2": 0.368 + }, + "m5d.4xlarge": { + "af-south-1": 0.736, + "ap-east-1": 0.736, + "ap-northeast-1": 1.904, + "ap-northeast-2": 0.736, + "ap-northeast-3": 1.904, + "ap-south-1": 0.736, + "ap-south-2": 0.736, + "ap-southeast-1": 1.864, + "ap-southeast-2": 0.736, + "ap-southeast-3": 1.932, + "ap-southeast-4": 0.736, + "ca-central-1": 0.0, + "ca-west-1": 1.744, + "eu-central-1": 1.824, + "eu-central-2": 0.0, + "eu-north-1": 1.696, + "eu-south-1": 1.792, + "eu-south-2": 1.744, + "eu-west-1": 1.744, + "eu-west-2": 1.784, + "eu-west-3": 1.792, + "il-central-1": 1.058, + "me-central-1": 1.175, + "me-south-1": 1.845, + "sa-east-1": 2.176, + "us-east-1": 0.736, + "us-east-2": 1.64, + "us-gov-east-1": 1.88, + "us-gov-west-1": 1.219, + "us-west-1": 1.8, + "us-west-2": 1.64 + }, + "m5d.8xlarge": { + "af-south-1": 1.472, + "ap-east-1": 3.952, + "ap-northeast-1": 3.808, + "ap-northeast-2": 3.696, + "ap-northeast-3": 3.808, + "ap-south-1": 3.424, + "ap-south-2": 3.541, + "ap-southeast-1": 3.728, + "ap-southeast-2": 3.744, + "ap-southeast-3": 3.728, + "ap-southeast-4": 3.744, + "ca-central-1": 1.472, + "ca-west-1": 2.016, + "eu-central-1": 3.648, + "eu-central-2": 2.394, + "eu-north-1": 3.392, + "eu-south-1": 3.584, + "eu-south-2": 1.472, + "eu-west-1": 3.488, + "eu-west-2": 3.708, + "eu-west-3": 3.584, + "il-central-1": 1.472, + "me-central-1": 1.472, + "me-south-1": 3.69, + "sa-east-1": 4.352, + "us-east-1": 3.28, + "us-east-2": 3.28, + "us-gov-east-1": 3.76, + "us-gov-west-1": 2.438, + "us-west-1": 3.6, + "us-west-2": 3.28 + }, + "m5d.12xlarge": { + "af-south-1": 5.808, + "ap-east-1": 5.928, + "ap-northeast-1": 5.712, + "ap-northeast-2": 2.208, + "ap-northeast-3": 2.208, + "ap-south-1": 2.208, + "ap-south-2": 5.136, + "ap-southeast-1": 5.592, + "ap-southeast-2": 5.616, + "ap-southeast-3": 2.208, + "ap-southeast-4": 5.616, + "ca-central-1": 2.208, + "ca-west-1": 5.232, + "eu-central-1": 0.0, + "eu-central-2": 6.014, + "eu-north-1": 2.208, + "eu-south-1": 2.208, + "eu-south-2": 2.208, + "eu-west-1": 2.208, + "eu-west-2": 2.208, + "eu-west-3": 5.376, + "il-central-1": 2.208, + "me-central-1": 3.326, + "me-south-1": 5.534, + "sa-east-1": 6.528, + "us-east-1": 2.712, + "us-east-2": 2.208, + "us-gov-east-1": 2.208, + "us-gov-west-1": 5.865, + "us-west-1": 3.192, + "us-west-2": 2.712 + }, + "m5d.16xlarge": { + "af-south-1": 2.944, + "ap-east-1": 7.904, + "ap-northeast-1": 7.616, + "ap-northeast-2": 7.392, + "ap-northeast-3": 2.944, + "ap-south-1": 6.848, + "ap-south-2": 6.848, + "ap-southeast-1": 7.456, + "ap-southeast-2": 7.488, + "ap-southeast-3": 2.944, + "ap-southeast-4": 0.0, + "ca-central-1": 6.976, + "ca-west-1": 7.218, + "eu-central-1": 7.296, + "eu-central-2": 2.944, + "eu-north-1": 6.784, + "eu-south-1": 2.944, + "eu-south-2": 7.218, + "eu-west-1": 4.032, + "eu-west-2": 7.136, + "eu-west-3": 7.168, + "il-central-1": 7.432, + "me-central-1": 0.0, + "me-south-1": 2.944, + "sa-east-1": 8.704, + "us-east-1": 6.56, + "us-east-2": 6.56, + "us-gov-east-1": 7.52, + "us-gov-west-1": 7.52, + "us-west-1": 7.2, + "us-west-2": 6.56 + }, + "m5d.24xlarge": { + "af-south-1": 4.416, + "ap-east-1": 11.856, + "ap-northeast-1": 4.416, + "ap-northeast-2": 11.088, + "ap-northeast-3": 4.416, + "ap-south-1": 10.272, + "ap-south-2": 4.416, + "ap-southeast-1": 4.416, + "ap-southeast-2": 4.416, + "ap-southeast-3": 11.184, + "ap-southeast-4": 0.0, + "ca-central-1": 10.464, + "ca-west-1": 10.464, + "eu-central-1": 6.528, + "eu-central-2": 11.597, + "eu-north-1": 10.176, + "eu-south-1": 4.416, + "eu-south-2": 10.464, + "eu-west-1": 4.416, + "eu-west-2": 10.704, + "eu-west-3": 10.752, + "il-central-1": 6.35, + "me-central-1": 11.069, + "me-south-1": 4.416, + "sa-east-1": 13.056, + "us-east-1": 9.84, + "us-east-2": 0.0, + "us-gov-east-1": 11.28, + "us-gov-west-1": 11.28, + "us-west-1": 6.384, + "us-west-2": 5.424 + }, + "m5dn.large": { + "ap-northeast-1": 0.267, + "ap-southeast-1": 0.259, + "eu-central-1": 0.092, + "eu-west-1": 0.092, + "us-east-1": 0.092, + "us-east-2": 0.228, + "us-gov-east-1": 0.263, + "us-gov-west-1": 0.0, + "us-west-2": 0.092 + }, + "m5dn.xlarge": { + "ap-northeast-1": 0.184, + "ap-southeast-1": 0.184, + "eu-central-1": 0.184, + "eu-west-1": 0.488, + "us-east-1": 0.184, + "us-east-2": 0.184, + "us-gov-east-1": 0.526, + "us-gov-west-1": 0.526, + "us-west-2": 0.184 + }, + "m5dn.metal": { + "ap-northeast-1": 12.816, + "ap-southeast-1": 4.416, + "eu-central-1": 12.192, + "eu-west-1": 4.416, + "us-east-1": 4.416, + "us-east-2": 4.416, + "us-gov-east-1": 4.416, + "us-gov-west-1": 4.416, + "us-west-2": 10.944 + }, + "m5dn.2xlarge": { + "ap-northeast-1": 0.368, + "ap-southeast-1": 1.036, + "eu-central-1": 0.368, + "eu-west-1": 0.368, + "us-east-1": 0.368, + "us-east-2": 0.912, + "us-gov-east-1": 1.052, + "us-gov-west-1": 0.368, + "us-west-2": 0.368 + }, + "m5dn.4xlarge": { + "ap-northeast-1": 0.736, + "ap-southeast-1": 2.072, + "eu-central-1": 0.736, + "eu-west-1": 0.736, + "us-east-1": 0.736, + "us-east-2": 1.824, + "us-gov-east-1": 2.104, + "us-gov-west-1": 1.368, + "us-west-2": 0.736 + }, + "m5dn.8xlarge": { + "ap-northeast-1": 4.272, + "ap-southeast-1": 4.144, + "eu-central-1": 4.064, + "eu-west-1": 1.472, + "us-east-1": 1.472, + "us-east-2": 1.472, + "us-gov-east-1": 1.472, + "us-gov-west-1": 4.208, + "us-west-2": 3.648 + }, + "m5dn.12xlarge": { + "ap-northeast-1": 6.408, + "ap-southeast-1": 6.216, + "eu-central-1": 6.096, + "eu-west-1": 2.208, + "us-east-1": 5.472, + "us-east-2": 5.472, + "us-gov-east-1": 6.312, + "us-gov-west-1": 4.104, + "us-west-2": 2.208 + }, + "m5dn.16xlarge": { + "ap-northeast-1": 8.544, + "ap-southeast-1": 8.288, + "eu-central-1": 8.128, + "eu-west-1": 2.944, + "us-east-1": 2.944, + "us-east-2": 2.944, + "us-gov-east-1": 8.416, + "us-gov-west-1": 2.944, + "us-west-2": 2.944 + }, + "m5dn.24xlarge": { + "ap-northeast-1": 12.816, + "ap-southeast-1": 4.416, + "eu-central-1": 4.416, + "eu-west-1": 4.416, + "us-east-1": 10.944, + "us-east-2": 10.944, + "us-gov-east-1": 12.624, + "us-gov-west-1": 4.416, + "us-west-2": 10.944 + }, + "m5n.large": { + "ap-northeast-1": 0.092, + "ap-southeast-1": 0.092, + "eu-central-1": 0.0, + "eu-west-1": 0.133, + "us-east-1": 0.119, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.092, + "us-west-2": 0.092 + }, + "m5n.xlarge": { + "ap-northeast-1": 0.306, + "ap-southeast-1": 0.494, + "eu-central-1": 0.184, + "eu-west-1": 0.45, + "us-east-1": 0.184, + "us-east-2": 0.422, + "us-gov-east-1": 0.298, + "us-gov-west-1": 0.184, + "us-west-2": 0.0 + }, + "m5n.metal": { + "ap-northeast-1": 11.76, + "ap-southeast-1": 11.424, + "eu-central-1": 4.416, + "eu-west-1": 0.0, + "us-east-1": 10.128, + "us-east-2": 10.128, + "us-gov-east-1": 0.0, + "us-gov-west-1": 7.152, + "us-west-2": 5.712 + }, + "m5n.2xlarge": { + "ap-northeast-1": 0.368, + "ap-southeast-1": 0.952, + "eu-central-1": 0.564, + "eu-west-1": 0.368, + "us-east-1": 0.368, + "us-east-2": 0.476, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.368, + "us-west-2": 0.0 + }, + "m5n.4xlarge": { + "ap-northeast-1": 1.224, + "ap-southeast-1": 1.168, + "eu-central-1": 1.94, + "eu-west-1": 1.871, + "us-east-1": 1.688, + "us-east-2": 1.009, + "us-gov-east-1": 0.736, + "us-gov-west-1": 1.192, + "us-west-2": 0.736 + }, + "m5n.8xlarge": { + "ap-northeast-1": 1.472, + "ap-southeast-1": 0.0, + "eu-central-1": 2.256, + "eu-west-1": 2.128, + "us-east-1": 3.376, + "us-east-2": 1.904, + "us-gov-east-1": 2.527, + "us-gov-west-1": 3.856, + "us-west-2": 1.904 + }, + "m5n.12xlarge": { + "ap-northeast-1": 3.672, + "ap-southeast-1": 3.504, + "eu-central-1": 3.384, + "eu-west-1": 3.192, + "us-east-1": 2.208, + "us-east-2": 2.856, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-2": 5.064 + }, + "m5n.16xlarge": { + "ap-northeast-1": 8.166, + "ap-southeast-1": 2.944, + "eu-central-1": 4.512, + "eu-west-1": 4.256, + "us-east-1": 3.808, + "us-east-2": 6.752, + "us-gov-east-1": 2.944, + "us-gov-west-1": 2.944, + "us-west-2": 3.808 + }, + "m5n.24xlarge": { + "ap-northeast-1": 4.416, + "ap-southeast-1": 0.0, + "eu-central-1": 4.416, + "eu-west-1": 10.8, + "us-east-1": 0.0, + "us-east-2": 5.712, + "us-gov-east-1": 7.152, + "us-gov-west-1": 7.152, + "us-west-2": 4.416 + }, + "m5zn.large": { + "ap-northeast-1": 0.3054, + "ap-northeast-2": 0.295, + "ap-southeast-1": 0.2985, + "ap-southeast-2": 0.092, + "eu-central-1": 0.2899, + "eu-west-1": 0.092, + "sa-east-1": 0.092, + "us-east-1": 0.2572, + "us-east-2": 0.092, + "us-west-1": 0.2847, + "us-west-2": 0.092 + }, + "m5zn.xlarge": { + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.184, + "ap-southeast-1": 0.184, + "ap-southeast-2": 0.184, + "eu-central-1": 0.184, + "eu-west-1": 0.184, + "sa-east-1": 0.184, + "us-east-1": 0.5143, + "us-east-2": 0.184, + "us-west-1": 0.5694, + "us-west-2": 0.184 + }, + "m5zn.metal": { + "ap-northeast-1": 2.208, + "ap-northeast-2": 7.08, + "ap-southeast-1": 7.164, + "ap-southeast-2": 2.208, + "eu-central-1": 2.208, + "eu-west-1": 6.6264, + "sa-east-1": 2.208, + "us-east-1": 2.208, + "us-east-2": 2.208, + "us-west-1": 6.8328, + "us-west-2": 2.208 + }, + "m5zn.2xlarge": { + "ap-northeast-1": 1.2214, + "ap-northeast-2": 1.18, + "ap-southeast-1": 0.368, + "ap-southeast-2": 1.194, + "eu-central-1": 1.1594, + "eu-west-1": 0.368, + "sa-east-1": 1.421, + "us-east-1": 0.368, + "us-east-2": 0.368, + "us-west-1": 0.368, + "us-west-2": 1.0287 + }, + "m5zn.3xlarge": { + "ap-northeast-1": 1.8321, + "ap-northeast-2": 0.552, + "ap-southeast-1": 0.552, + "ap-southeast-2": 1.791, + "eu-central-1": 1.7392, + "eu-west-1": 1.6566, + "sa-east-1": 0.552, + "us-east-1": 1.543, + "us-east-2": 0.552, + "us-west-1": 1.7082, + "us-west-2": 0.552 + }, + "m5zn.6xlarge": { + "ap-northeast-1": 3.6642, + "ap-northeast-2": 1.104, + "ap-southeast-1": 3.582, + "ap-southeast-2": 3.582, + "eu-central-1": 1.104, + "eu-west-1": 1.104, + "sa-east-1": 4.2629, + "us-east-1": 1.104, + "us-east-2": 3.086, + "us-west-1": 1.104, + "us-west-2": 1.104 + }, + "m5zn.12xlarge": { + "ap-northeast-1": 7.3284, + "ap-northeast-2": 4.872, + "ap-southeast-1": 7.164, + "ap-southeast-2": 2.208, + "eu-central-1": 2.208, + "eu-west-1": 6.6264, + "sa-east-1": 8.5258, + "us-east-1": 6.1721, + "us-east-2": 2.208, + "us-west-1": 2.208, + "us-west-2": 6.1721 + }, + "m6a.large": { + "ap-northeast-1": 0.2036, + "ap-south-1": 0.14755, + "ap-south-2": 0.14755, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.2, + "ca-central-1": 0.0963, + "eu-central-1": 0.092, + "eu-south-1": 0.092, + "eu-west-1": 0.092, + "eu-west-2": 0.20189, + "eu-west-3": 0.0, + "sa-east-1": 0.1377, + "us-east-1": 0.18704, + "us-east-2": 0.0, + "us-west-1": 0.0, + "us-west-2": 0.0864 + }, + "m6a.xlarge": { + "ap-northeast-1": 0.4072, + "ap-south-1": 0.0, + "ap-south-2": 0.184, + "ap-southeast-1": 0.2376, + "ap-southeast-2": 0.216, + "ca-central-1": 0.184, + "eu-central-1": 0.184, + "eu-south-1": 0.3856, + "eu-west-1": 0.3766, + "eu-west-2": 0.184, + "eu-west-3": 0.3856, + "sa-east-1": 0.184, + "us-east-1": 0.37408, + "us-east-2": 0.3568, + "us-west-1": 0.2016, + "us-west-2": 0.37408 + }, + "m6a.metal": { + "ap-northeast-1": 8.832, + "ap-south-1": 14.1648, + "ap-south-2": 5.3328, + "ap-southeast-1": 10.368, + "ap-southeast-2": 10.368, + "ca-central-1": 8.832, + "eu-central-1": 18.768, + "eu-south-1": 9.6768, + "eu-west-1": 9.2448, + "eu-west-2": 9.5904, + "eu-west-3": 18.5088, + "sa-east-1": 22.0512, + "us-east-1": 0.0, + "us-east-2": 8.832, + "us-west-1": 18.5088, + "us-west-2": 8.2944 + }, + "m6a.2xlarge": { + "ap-northeast-1": 0.4464, + "ap-south-1": 0.2222, + "ap-south-2": 0.5902, + "ap-southeast-1": 0.432, + "ap-southeast-2": 0.8, + "ca-central-1": 0.7532, + "eu-central-1": 0.414, + "eu-south-1": 0.4032, + "eu-west-1": 0.368, + "eu-west-2": 0.0, + "eu-west-3": 0.44352, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 0.7136, + "us-west-1": 0.7712, + "us-west-2": 0.368 + }, + "m6a.4xlarge": { + "ap-northeast-1": 0.8928, + "ap-south-1": 0.0, + "ap-south-2": 1.1804, + "ap-southeast-1": 0.864, + "ap-southeast-2": 0.0, + "ca-central-1": 0.736, + "eu-central-1": 1.564, + "eu-south-1": 1.5424, + "eu-west-1": 0.736, + "eu-west-2": 1.5352, + "eu-west-3": 0.8064, + "sa-east-1": 1.8376, + "us-east-1": 0.6912, + "us-east-2": 0.0, + "us-west-1": 1.5424, + "us-west-2": 0.6912 + }, + "m6a.8xlarge": { + "ap-northeast-1": 1.96416, + "ap-south-1": 1.472, + "ap-south-2": 1.472, + "ap-southeast-1": 3.2, + "ap-southeast-2": 0.0, + "ca-central-1": 1.5408, + "eu-central-1": 1.656, + "eu-south-1": 1.77408, + "eu-west-1": 1.472, + "eu-west-2": 1.472, + "eu-west-3": 3.0848, + "sa-east-1": 3.6752, + "us-east-1": 1.472, + "us-east-2": 2.8544, + "us-west-1": 3.0848, + "us-west-2": 1.3824 + }, + "m6a.12xlarge": { + "ap-northeast-1": 2.208, + "ap-south-1": 1.3332, + "ap-south-2": 2.208, + "ap-southeast-1": 2.592, + "ap-southeast-2": 4.8, + "ca-central-1": 2.3112, + "eu-central-1": 4.692, + "eu-south-1": 4.6272, + "eu-west-1": 2.208, + "eu-west-2": 2.3976, + "eu-west-3": 2.208, + "sa-east-1": 3.3048, + "us-east-1": 2.0736, + "us-east-2": 4.2816, + "us-west-1": 2.4192, + "us-west-2": 4.2816 + }, + "m6a.16xlarge": { + "ap-northeast-1": 2.944, + "ap-south-1": 4.7216, + "ap-south-2": 4.7216, + "ap-southeast-1": 3.456, + "ap-southeast-2": 6.4, + "ca-central-1": 2.944, + "eu-central-1": 2.944, + "eu-south-1": 3.2256, + "eu-west-1": 3.0816, + "eu-west-2": 3.1968, + "eu-west-3": 6.1696, + "sa-east-1": 7.79104, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-west-1": 2.944, + "us-west-2": 2.944 + }, + "m6a.24xlarge": { + "ap-northeast-1": 9.7728, + "ap-south-1": 7.0824, + "ap-south-2": 2.6664, + "ap-southeast-1": 5.184, + "ap-southeast-2": 4.416, + "ca-central-1": 9.0384, + "eu-central-1": 4.416, + "eu-south-1": 9.2544, + "eu-west-1": 4.6224, + "eu-west-2": 4.416, + "eu-west-3": 9.2544, + "sa-east-1": 6.6096, + "us-east-1": 4.416, + "us-east-2": 8.5632, + "us-west-1": 5.32224, + "us-west-2": 8.5632 + }, + "m6a.32xlarge": { + "ap-northeast-1": 5.888, + "ap-south-1": 3.5552, + "ap-south-2": 5.888, + "ap-southeast-1": 12.8, + "ap-southeast-2": 6.912, + "ca-central-1": 12.0512, + "eu-central-1": 0.0, + "eu-south-1": 6.4512, + "eu-west-1": 12.0512, + "eu-west-2": 0.0, + "eu-west-3": 6.4512, + "sa-east-1": 9.69408, + "us-east-1": 5.888, + "us-east-2": 5.5296, + "us-west-1": 12.3392, + "us-west-2": 5.888 + }, + "m6a.48xlarge": { + "ap-northeast-1": 19.5456, + "ap-south-1": 8.832, + "ap-south-2": 8.832, + "ap-southeast-1": 8.832, + "ap-southeast-2": 10.368, + "ca-central-1": 8.832, + "eu-central-1": 9.936, + "eu-south-1": 9.6768, + "eu-west-1": 18.0768, + "eu-west-2": 9.5904, + "eu-west-3": 9.6768, + "sa-east-1": 8.832, + "us-east-1": 8.2944, + "us-east-2": 8.2944, + "us-west-1": 18.5088, + "us-west-2": 17.1264 + }, + "m6i.large": { + "af-south-1": 0.127, + "ap-east-1": 0.092, + "ap-northeast-1": 0.216, + "ap-northeast-2": 0.21, + "ap-northeast-3": 0.124, + "ap-south-1": 0.193, + "ap-south-2": 0.193, + "ap-southeast-1": 0.12, + "ap-southeast-2": 0.212, + "ap-southeast-3": 0.212, + "ap-southeast-5": 0.1122, + "ap-southeast-7": 0.092, + "ca-central-1": 0.199, + "ca-west-1": 0.0, + "eu-central-1": 0.092, + "eu-central-2": 0.092, + "eu-north-1": 0.194, + "eu-south-1": 0.2152, + "eu-west-1": 0.199, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "il-central-1": 0.20435, + "me-central-1": 0.092, + "me-south-1": 0.224, + "mx-central-1": 0.11088, + "sa-east-1": 0.153, + "us-east-1": 0.092, + "us-east-2": 0.0, + "us-gov-east-1": 0.121, + "us-gov-west-1": 0.2251, + "us-west-1": 0.204, + "us-west-2": 0.096 + }, + "m6i.xlarge": { + "af-south-1": 0.254, + "ap-east-1": 0.448, + "ap-northeast-1": 0.432, + "ap-northeast-2": 0.184, + "ap-northeast-3": 0.432, + "ap-south-1": 0.202, + "ap-south-2": 0.202, + "ap-southeast-1": 0.24, + "ap-southeast-2": 0.424, + "ap-southeast-3": 0.24, + "ap-southeast-5": 0.184, + "ap-southeast-7": 0.388, + "ca-central-1": 0.184, + "ca-west-1": 0.214, + "eu-central-1": 0.184, + "eu-central-2": 0.184, + "eu-north-1": 0.388, + "eu-south-1": 0.224, + "eu-west-1": 0.214, + "eu-west-2": 0.406, + "eu-west-3": 0.224, + "il-central-1": 0.4087, + "me-central-1": 0.184, + "me-south-1": 0.0, + "mx-central-1": 0.2016, + "sa-east-1": 0.184, + "us-east-1": 0.376, + "us-east-2": 0.192, + "us-gov-east-1": 0.242, + "us-gov-west-1": 0.184, + "us-west-1": 0.184, + "us-west-2": 0.3952 + }, + "m6i.metal": { + "af-south-1": 8.128, + "ap-east-1": 8.448, + "ap-northeast-1": 13.824, + "ap-northeast-2": 13.44, + "ap-northeast-3": 7.936, + "ap-south-1": 6.464, + "ap-south-2": 6.464, + "ap-southeast-1": 5.888, + "ap-southeast-2": 5.888, + "ap-southeast-3": 5.888, + "ap-southeast-5": 6.528, + "ap-southeast-7": 6.528, + "ca-central-1": 12.736, + "ca-west-1": 12.736, + "eu-central-1": 7.36, + "eu-central-2": 13.984, + "eu-north-1": 6.528, + "eu-south-1": 13.056, + "eu-west-1": 6.848, + "eu-west-2": 12.992, + "eu-west-3": 7.168, + "il-central-1": 7.1904, + "me-central-1": 5.888, + "me-south-1": 5.888, + "mx-central-1": 12.3392, + "sa-east-1": 15.68, + "us-east-1": 6.144, + "us-east-2": 12.032, + "us-gov-east-1": 5.888, + "us-gov-west-1": 13.632, + "us-west-1": 5.888, + "us-west-2": 5.888 + }, + "m6i.2xlarge": { + "af-south-1": 0.508, + "ap-east-1": 0.528, + "ap-northeast-1": 0.864, + "ap-northeast-2": 0.84, + "ap-northeast-3": 0.864, + "ap-south-1": 0.0, + "ap-south-2": 0.772, + "ap-southeast-1": 0.848, + "ap-southeast-2": 0.48, + "ap-southeast-3": 0.896, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.776, + "ca-central-1": 0.368, + "ca-west-1": 0.368, + "eu-central-1": 0.46, + "eu-central-2": 0.506, + "eu-north-1": 0.776, + "eu-south-1": 0.448, + "eu-west-1": 0.4708, + "eu-west-2": 0.812, + "eu-west-3": 0.368, + "il-central-1": 0.4494, + "me-central-1": 0.368, + "me-south-1": 0.896, + "mx-central-1": 0.7712, + "sa-east-1": 0.612, + "us-east-1": 0.384, + "us-east-2": 0.752, + "us-gov-east-1": 0.852, + "us-gov-west-1": 0.852, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m6i.4xlarge": { + "af-south-1": 0.736, + "ap-east-1": 0.736, + "ap-northeast-1": 1.8272, + "ap-northeast-2": 0.736, + "ap-northeast-3": 1.8272, + "ap-south-1": 1.6248, + "ap-south-2": 0.8888, + "ap-southeast-1": 0.736, + "ap-southeast-2": 0.736, + "ap-southeast-3": 1.696, + "ap-southeast-5": 1.552, + "ap-southeast-7": 0.816, + "ca-central-1": 0.736, + "ca-west-1": 1.592, + "eu-central-1": 0.0, + "eu-central-2": 0.736, + "eu-north-1": 0.816, + "eu-south-1": 0.736, + "eu-west-1": 0.0, + "eu-west-2": 0.736, + "eu-west-3": 1.632, + "il-central-1": 0.8988, + "me-central-1": 0.736, + "me-south-1": 0.0, + "mx-central-1": 1.5424, + "sa-east-1": 2.0824, + "us-east-1": 1.504, + "us-east-2": 1.504, + "us-gov-east-1": 0.968, + "us-gov-west-1": 1.704, + "us-west-1": 0.0, + "us-west-2": 1.504 + }, + "m6i.8xlarge": { + "af-south-1": 3.504, + "ap-east-1": 2.112, + "ap-northeast-1": 1.984, + "ap-northeast-2": 1.888, + "ap-northeast-3": 1.984, + "ap-south-1": 1.616, + "ap-south-2": 0.0, + "ap-southeast-1": 1.92, + "ap-southeast-2": 3.392, + "ap-southeast-3": 0.0, + "ap-southeast-5": 1.632, + "ap-southeast-7": 1.632, + "ca-central-1": 3.184, + "ca-west-1": 1.472, + "eu-central-1": 0.0, + "eu-central-2": 2.024, + "eu-north-1": 3.104, + "eu-south-1": 3.264, + "eu-west-1": 1.712, + "eu-west-2": 3.248, + "eu-west-3": 1.792, + "il-central-1": 1.472, + "me-central-1": 1.472, + "me-south-1": 3.584, + "mx-central-1": 1.472, + "sa-east-1": 0.0, + "us-east-1": 3.008, + "us-east-2": 1.472, + "us-gov-east-1": 0.0, + "us-gov-west-1": 1.472, + "us-west-1": 1.792, + "us-west-2": 3.008 + }, + "m6i.12xlarge": { + "af-south-1": 3.3528, + "ap-east-1": 3.168, + "ap-northeast-1": 5.184, + "ap-northeast-2": 2.832, + "ap-northeast-3": 2.208, + "ap-south-1": 2.424, + "ap-south-2": 2.424, + "ap-southeast-1": 2.88, + "ap-southeast-2": 5.376, + "ap-southeast-3": 2.88, + "ap-southeast-5": 2.208, + "ap-southeast-7": 2.448, + "ca-central-1": 4.776, + "ca-west-1": 2.568, + "eu-central-1": 2.208, + "eu-central-2": 2.208, + "eu-north-1": 2.208, + "eu-south-1": 5.1648, + "eu-west-1": 2.208, + "eu-west-2": 5.1384, + "eu-west-3": 4.896, + "il-central-1": 4.9044, + "me-central-1": 2.208, + "me-south-1": 5.6928, + "mx-central-1": 4.6272, + "sa-east-1": 2.208, + "us-east-1": 2.208, + "us-east-2": 4.512, + "us-gov-east-1": 5.4024, + "us-gov-west-1": 5.112, + "us-west-1": 4.896, + "us-west-2": 2.304 + }, + "m6i.16xlarge": { + "af-south-1": 7.008, + "ap-east-1": 2.944, + "ap-northeast-1": 6.912, + "ap-northeast-2": 2.944, + "ap-northeast-3": 3.968, + "ap-south-1": 2.944, + "ap-south-2": 2.944, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.84, + "ap-southeast-3": 3.84, + "ap-southeast-5": 3.264, + "ap-southeast-7": 6.208, + "ca-central-1": 3.424, + "ca-west-1": 2.944, + "eu-central-1": 6.624, + "eu-central-2": 4.048, + "eu-north-1": 2.944, + "eu-south-1": 3.584, + "eu-west-1": 6.368, + "eu-west-2": 3.552, + "eu-west-3": 2.944, + "il-central-1": 6.5392, + "me-central-1": 0.0, + "me-south-1": 7.168, + "mx-central-1": 6.1696, + "sa-east-1": 2.944, + "us-east-1": 6.016, + "us-east-2": 3.072, + "us-gov-east-1": 0.0, + "us-gov-west-1": 3.872, + "us-west-1": 3.584, + "us-west-2": 0.0 + }, + "m6i.24xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.416, + "ap-northeast-1": 10.368, + "ap-northeast-2": 0.0, + "ap-northeast-3": 4.416, + "ap-south-1": 4.848, + "ap-south-2": 5.3328, + "ap-southeast-1": 10.752, + "ap-southeast-2": 10.176, + "ap-southeast-3": 10.752, + "ap-southeast-5": 9.312, + "ap-southeast-7": 4.416, + "ca-central-1": 9.552, + "ca-west-1": 9.552, + "eu-central-1": 10.488, + "eu-central-2": 4.416, + "eu-north-1": 4.896, + "eu-south-1": 5.376, + "eu-west-1": 9.552, + "eu-west-2": 9.744, + "eu-west-3": 9.792, + "il-central-1": 5.3928, + "me-central-1": 5.6496, + "me-south-1": 4.416, + "mx-central-1": 4.416, + "sa-east-1": 11.76, + "us-east-1": 4.608, + "us-east-2": 4.416, + "us-gov-east-1": 4.416, + "us-gov-west-1": 4.416, + "us-west-1": 5.376, + "us-west-2": 0.0 + }, + "m6i.32xlarge": { + "af-south-1": 14.016, + "ap-east-1": 14.336, + "ap-northeast-1": 0.0, + "ap-northeast-2": 13.44, + "ap-northeast-3": 5.888, + "ap-south-1": 12.352, + "ap-south-2": 0.0, + "ap-southeast-1": 13.568, + "ap-southeast-2": 13.568, + "ap-southeast-3": 7.68, + "ap-southeast-5": 5.888, + "ap-southeast-7": 0.0, + "ca-central-1": 12.736, + "ca-west-1": 5.888, + "eu-central-1": 5.888, + "eu-central-2": 13.984, + "eu-north-1": 12.416, + "eu-south-1": 7.168, + "eu-west-1": 12.736, + "eu-west-2": 12.992, + "eu-west-3": 7.168, + "il-central-1": 13.0784, + "me-central-1": 5.888, + "me-south-1": 8.448, + "mx-central-1": 12.3392, + "sa-east-1": 9.792, + "us-east-1": 6.144, + "us-east-2": 12.6464, + "us-gov-east-1": 7.744, + "us-gov-west-1": 13.632, + "us-west-1": 13.056, + "us-west-2": 12.032 + }, + "m6id.large": { + "ap-northeast-1": 0.2453, + "ap-northeast-2": 0.092, + "ap-south-1": 0.092, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.092, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.092, + "ca-central-1": 0.092, + "ca-west-1": 0.1323, + "eu-central-1": 0.2348, + "eu-central-2": 0.0, + "eu-west-1": 0.14553, + "eu-west-2": 0.22955, + "il-central-1": 0.13892, + "mx-central-1": 0.092, + "sa-east-1": 0.092, + "us-east-1": 0.11865, + "us-east-2": 0.0, + "us-gov-west-1": 0.2422, + "us-west-2": 0.22252 + }, + "m6id.xlarge": { + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.184, + "ap-south-1": 0.46582, + "ap-southeast-1": 0.32571, + "ap-southeast-2": 0.184, + "ap-southeast-5": 0.25168, + "ap-southeast-7": 0.43568, + "ca-central-1": 0.184, + "ca-west-1": 0.0, + "eu-central-1": 0.4696, + "eu-central-2": 0.49816, + "eu-west-1": 0.47506, + "eu-west-2": 0.4591, + "il-central-1": 0.48962, + "mx-central-1": 0.184, + "sa-east-1": 0.184, + "us-east-1": 0.4213, + "us-east-2": 0.4213, + "us-gov-west-1": 0.4844, + "us-west-2": 0.184 + }, + "m6id.metal": { + "ap-northeast-1": 5.888, + "ap-northeast-2": 9.3408, + "ap-south-1": 14.0864, + "ap-southeast-1": 9.4752, + "ap-southeast-2": 9.5424, + "ap-southeast-5": 0.0, + "ap-southeast-7": 8.05376, + "ca-central-1": 14.3552, + "ca-west-1": 8.4672, + "eu-central-1": 0.0, + "eu-central-2": 5.888, + "eu-west-1": 8.4672, + "eu-west-2": 0.0, + "il-central-1": 5.888, + "mx-central-1": 7.97312, + "sa-east-1": 12.096, + "us-east-1": 0.0, + "us-east-2": 5.888, + "us-gov-west-1": 5.888, + "us-west-2": 13.4816 + }, + "m6id.2xlarge": { + "ap-northeast-1": 0.6132, + "ap-northeast-2": 0.5838, + "ap-south-1": 0.5124, + "ap-southeast-1": 0.5922, + "ap-southeast-2": 0.368, + "ap-southeast-5": 0.50336, + "ap-southeast-7": 0.9217, + "ca-central-1": 0.8972, + "ca-west-1": 0.5292, + "eu-central-1": 0.9392, + "eu-central-2": 0.69115, + "eu-west-1": 0.368, + "eu-west-2": 0.5502, + "il-central-1": 0.55568, + "mx-central-1": 0.368, + "sa-east-1": 0.756, + "us-east-1": 0.52206, + "us-east-2": 0.8426, + "us-gov-west-1": 0.9688, + "us-west-2": 0.8426 + }, + "m6id.4xlarge": { + "ap-northeast-1": 0.736, + "ap-northeast-2": 1.28436, + "ap-south-1": 0.0, + "ap-southeast-1": 1.1844, + "ap-southeast-2": 1.9288, + "ap-southeast-5": 1.84339, + "ap-southeast-7": 1.00672, + "ca-central-1": 0.0, + "ca-west-1": 0.736, + "eu-central-1": 1.8784, + "eu-central-2": 0.736, + "eu-west-1": 1.0584, + "eu-west-2": 0.0, + "il-central-1": 1.9585, + "mx-central-1": 1.73264, + "sa-east-1": 0.736, + "us-east-1": 0.9492, + "us-east-2": 1.6852, + "us-gov-west-1": 1.9376, + "us-west-2": 1.6852 + }, + "m6id.8xlarge": { + "ap-northeast-1": 1.472, + "ap-northeast-2": 2.56872, + "ap-south-1": 2.0496, + "ap-southeast-1": 2.3688, + "ap-southeast-2": 0.0, + "ap-southeast-5": 1.472, + "ap-southeast-7": 3.48544, + "ca-central-1": 1.472, + "ca-west-1": 2.1168, + "eu-central-1": 1.472, + "eu-central-2": 0.0, + "eu-west-1": 2.1168, + "eu-west-2": 2.2008, + "il-central-1": 1.472, + "mx-central-1": 3.46528, + "sa-east-1": 4.496, + "us-east-1": 1.472, + "us-east-2": 1.472, + "us-gov-west-1": 1.472, + "us-west-2": 1.472 + }, + "m6id.12xlarge": { + "ap-northeast-1": 6.25512, + "ap-northeast-2": 3.5028, + "ap-south-1": 0.0, + "ap-southeast-1": 6.11652, + "ap-southeast-2": 2.208, + "ap-southeast-5": 3.02016, + "ap-southeast-7": 5.53018, + "ca-central-1": 2.208, + "ca-west-1": 3.1752, + "eu-central-1": 0.0, + "eu-central-2": 3.76992, + "eu-west-1": 3.1752, + "eu-west-2": 2.208, + "il-central-1": 2.208, + "mx-central-1": 2.98992, + "sa-east-1": 2.208, + "us-east-1": 5.0556, + "us-east-2": 5.0556, + "us-gov-west-1": 0.0, + "us-west-2": 5.0556 + }, + "m6id.16xlarge": { + "ap-northeast-1": 7.8496, + "ap-northeast-2": 4.6704, + "ap-south-1": 4.50912, + "ap-southeast-1": 4.7376, + "ap-southeast-2": 2.944, + "ap-southeast-5": 6.97088, + "ap-southeast-7": 6.97088, + "ca-central-1": 2.944, + "ca-west-1": 2.944, + "eu-central-1": 7.5136, + "eu-central-2": 7.97056, + "eu-west-1": 7.1776, + "eu-west-2": 2.944, + "il-central-1": 4.44544, + "mx-central-1": 6.93056, + "sa-east-1": 2.944, + "us-east-1": 6.7408, + "us-east-2": 6.7408, + "us-gov-west-1": 5.28704, + "us-west-2": 3.7968 + }, + "m6id.24xlarge": { + "ap-northeast-1": 11.7744, + "ap-northeast-2": 7.70616, + "ap-south-1": 6.76368, + "ap-southeast-1": 4.416, + "ap-southeast-2": 0.0, + "ap-southeast-5": 10.45632, + "ap-southeast-7": 0.0, + "ca-central-1": 4.416, + "ca-west-1": 10.7664, + "eu-central-1": 4.416, + "eu-central-2": 4.416, + "eu-west-1": 6.3504, + "eu-west-2": 4.416, + "il-central-1": 11.08416, + "mx-central-1": 0.0, + "sa-east-1": 14.3952, + "us-east-1": 4.416, + "us-east-2": 5.6952, + "us-gov-west-1": 7.2096, + "us-west-2": 10.68072 + }, + "m6id.32xlarge": { + "ap-northeast-1": 15.6992, + "ap-northeast-2": 9.3408, + "ap-south-1": 5.888, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.888, + "ap-southeast-5": 5.888, + "ap-southeast-7": 8.05376, + "ca-central-1": 14.3552, + "ca-west-1": 5.888, + "eu-central-1": 5.888, + "eu-central-2": 5.888, + "eu-west-1": 14.3552, + "eu-west-2": 14.6912, + "il-central-1": 14.77888, + "mx-central-1": 13.86112, + "sa-east-1": 5.888, + "us-east-1": 5.888, + "us-east-2": 5.888, + "us-gov-west-1": 15.5008, + "us-west-2": 13.4816 + }, + "m6idn.large": { + "ap-northeast-1": 0.0, + "ap-south-1": 0.16965, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.20124, + "ca-central-1": 0.092, + "eu-central-1": 0.28154, + "eu-central-2": 0.29856, + "eu-north-1": 0.092, + "eu-south-2": 0.092, + "eu-west-1": 0.092, + "us-east-1": 0.15912, + "us-east-2": 0.0, + "us-gov-west-1": 0.092, + "us-west-1": 0.0, + "us-west-2": 0.15912 + }, + "m6idn.xlarge": { + "ap-northeast-1": 0.184, + "ap-south-1": 0.5233, + "ap-southeast-1": 0.184, + "ap-southeast-2": 0.62673, + "ca-central-1": 0.184, + "eu-central-1": 0.184, + "eu-central-2": 0.59712, + "eu-north-1": 0.0, + "eu-south-2": 0.34836, + "eu-west-1": 0.53968, + "us-east-1": 0.50224, + "us-east-2": 0.31824, + "us-gov-west-1": 0.40014, + "us-west-1": 0.55088, + "us-west-2": 0.50224 + }, + "m6idn.metal": { + "ap-northeast-1": 5.888, + "ap-south-1": 16.7456, + "ap-southeast-1": 18.39296, + "ap-southeast-2": 18.76736, + "ca-central-1": 5.888, + "eu-central-1": 5.888, + "eu-central-2": 19.10784, + "eu-north-1": 0.0, + "eu-south-2": 17.03552, + "eu-west-1": 17.26976, + "us-east-1": 16.07168, + "us-east-2": 10.18368, + "us-gov-west-1": 18.69248, + "us-west-1": 5.888, + "us-west-2": 5.888 + }, + "m6idn.2xlarge": { + "ap-northeast-1": 0.819, + "ap-south-1": 0.0, + "ap-southeast-1": 1.22772, + "ap-southeast-2": 0.368, + "ca-central-1": 0.69672, + "eu-central-1": 1.12616, + "eu-central-2": 0.82624, + "eu-north-1": 0.368, + "eu-south-2": 1.13439, + "eu-west-1": 0.7825, + "us-east-1": 0.0, + "us-east-2": 1.00448, + "us-gov-west-1": 0.80028, + "us-west-1": 1.10176, + "us-west-2": 0.63648 + }, + "m6idn.4xlarge": { + "ap-northeast-1": 1.638, + "ap-south-1": 0.0, + "ap-southeast-1": 2.29912, + "ap-southeast-2": 1.77091, + "ca-central-1": 0.736, + "eu-central-1": 0.736, + "eu-central-2": 0.0, + "eu-north-1": 0.736, + "eu-south-2": 2.12944, + "eu-west-1": 2.15872, + "us-east-1": 0.736, + "us-east-2": 2.13626, + "us-gov-west-1": 1.60056, + "us-west-1": 2.35027, + "us-west-2": 1.27296 + }, + "m6idn.8xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 1.472, + "ap-southeast-1": 4.59824, + "ap-southeast-2": 3.21984, + "ca-central-1": 3.06557, + "eu-central-1": 3.03264, + "eu-central-2": 3.30496, + "eu-north-1": 1.472, + "eu-south-2": 4.25888, + "eu-west-1": 2.84544, + "us-east-1": 2.54592, + "us-east-2": 1.472, + "us-gov-west-1": 0.0, + "us-west-1": 2.93504, + "us-west-2": 4.01792 + }, + "m6idn.12xlarge": { + "ap-northeast-1": 4.914, + "ap-south-1": 4.47876, + "ap-southeast-1": 2.208, + "ap-southeast-2": 4.82976, + "ca-central-1": 6.38832, + "eu-central-1": 5.00386, + "eu-central-2": 4.95744, + "eu-north-1": 6.192, + "eu-south-2": 6.38832, + "eu-west-1": 4.26816, + "us-east-1": 6.02688, + "us-east-2": 3.81888, + "us-gov-west-1": 4.80168, + "us-west-1": 4.84282, + "us-west-2": 0.0 + }, + "m6idn.16xlarge": { + "ap-northeast-1": 7.2072, + "ap-south-1": 5.4288, + "ap-southeast-1": 6.25248, + "ap-southeast-2": 9.38368, + "ca-central-1": 2.944, + "eu-central-1": 2.944, + "eu-central-2": 2.944, + "eu-north-1": 2.944, + "eu-south-2": 5.57376, + "eu-west-1": 8.63488, + "us-east-1": 5.60102, + "us-east-2": 5.09184, + "us-gov-west-1": 0.0, + "us-west-1": 8.81408, + "us-west-2": 8.54502 + }, + "m6idn.24xlarge": { + "ap-northeast-1": 9.828, + "ap-south-1": 4.416, + "ap-southeast-1": 9.37872, + "ap-southeast-2": 4.416, + "ca-central-1": 12.77664, + "eu-central-1": 13.51392, + "eu-central-2": 15.32237, + "eu-north-1": 4.416, + "eu-south-2": 12.77664, + "eu-west-1": 12.95232, + "us-east-1": 12.05376, + "us-east-2": 7.63776, + "us-gov-west-1": 14.01936, + "us-west-1": 8.80512, + "us-west-2": 12.81754 + }, + "m6idn.32xlarge": { + "ap-northeast-1": 18.992, + "ap-south-1": 10.8576, + "ap-southeast-1": 18.39296, + "ap-southeast-2": 5.888, + "ca-central-1": 11.14752, + "eu-central-1": 5.888, + "eu-central-2": 5.888, + "eu-north-1": 0.0, + "eu-south-2": 17.03552, + "eu-west-1": 17.26976, + "us-east-1": 5.888, + "us-east-2": 16.07168, + "us-gov-west-1": 5.888, + "us-west-1": 5.888, + "us-west-2": 5.888 + }, + "m6in.large": { + "ap-northeast-1": 0.17901, + "ap-south-1": 0.14508, + "ap-southeast-1": 0.26282, + "ap-southeast-2": 0.2675, + "ca-central-1": 0.24718, + "eu-central-1": 0.16497, + "eu-central-2": 0.27546, + "eu-north-1": 0.092, + "eu-south-2": 0.15518, + "eu-west-1": 0.092, + "us-east-1": 0.13923, + "us-east-2": 0.13923, + "us-gov-west-1": 0.26633, + "us-west-1": 0.16244, + "us-west-2": 0.13923 + }, + "m6in.xlarge": { + "ap-northeast-1": 0.184, + "ap-south-1": 0.29016, + "ap-southeast-1": 0.184, + "ap-southeast-2": 0.184, + "ca-central-1": 0.31036, + "eu-central-1": 0.51394, + "eu-central-2": 0.36692, + "eu-north-1": 0.48, + "eu-south-2": 0.184, + "eu-west-1": 0.49522, + "us-east-1": 0.184, + "us-east-2": 0.27846, + "us-gov-west-1": 0.184, + "us-west-1": 0.54137, + "us-west-2": 0.184 + }, + "m6in.metal": { + "ap-northeast-1": 11.45664, + "ap-south-1": 9.28512, + "ap-southeast-1": 5.888, + "ap-southeast-2": 17.12, + "ca-central-1": 0.0, + "eu-central-1": 16.44608, + "eu-central-2": 17.62944, + "eu-north-1": 5.888, + "eu-south-2": 15.81952, + "eu-west-1": 5.888, + "us-east-1": 0.0, + "us-east-2": 14.79872, + "us-gov-west-1": 17.04512, + "us-west-1": 16.28416, + "us-west-2": 8.91072 + }, + "m6in.2xlarge": { + "ap-northeast-1": 0.368, + "ap-south-1": 0.58032, + "ap-southeast-1": 1.05128, + "ap-southeast-2": 1.07, + "ca-central-1": 0.98872, + "eu-central-1": 1.02788, + "eu-central-2": 1.10184, + "eu-north-1": 0.592, + "eu-south-2": 0.0, + "eu-west-1": 0.368, + "us-east-1": 0.55692, + "us-east-2": 0.368, + "us-gov-west-1": 1.06532, + "us-west-1": 1.01776, + "us-west-2": 0.92492 + }, + "m6in.4xlarge": { + "ap-northeast-1": 2.31129, + "ap-south-1": 0.736, + "ap-southeast-1": 0.736, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 2.05576, + "eu-central-2": 2.20368, + "eu-north-1": 0.736, + "eu-south-2": 1.24144, + "eu-west-1": 1.24488, + "us-east-1": 0.736, + "us-east-2": 1.84984, + "us-gov-west-1": 0.736, + "us-west-1": 1.29952, + "us-west-2": 0.0 + }, + "m6in.8xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 1.472, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.808, + "ca-central-1": 3.95488, + "eu-central-1": 2.63952, + "eu-central-2": 0.0, + "eu-north-1": 1.472, + "eu-south-2": 3.95488, + "eu-west-1": 1.472, + "us-east-1": 2.22768, + "us-east-2": 3.69968, + "us-gov-west-1": 1.472, + "us-west-1": 4.07104, + "us-west-2": 2.22768 + }, + "m6in.12xlarge": { + "ap-northeast-1": 4.29624, + "ap-south-1": 0.0, + "ap-southeast-1": 6.30768, + "ap-southeast-2": 4.6332, + "ca-central-1": 2.208, + "eu-central-1": 3.95928, + "eu-central-2": 6.61104, + "eu-north-1": 2.208, + "eu-south-2": 0.0, + "eu-west-1": 3.73464, + "us-east-1": 5.54952, + "us-east-2": 3.34152, + "us-gov-west-1": 6.39192, + "us-west-1": 2.208, + "us-west-2": 5.54952 + }, + "m6in.16xlarge": { + "ap-northeast-1": 8.67232, + "ap-south-1": 0.0, + "ap-southeast-1": 8.41024, + "ap-southeast-2": 2.944, + "ca-central-1": 2.944, + "eu-central-1": 8.22304, + "eu-central-2": 5.87072, + "eu-north-1": 4.736, + "eu-south-2": 7.90976, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 2.944, + "us-gov-west-1": 5.57856, + "us-west-1": 8.14208, + "us-west-2": 0.0 + }, + "m6in.24xlarge": { + "ap-northeast-1": 13.00848, + "ap-south-1": 4.416, + "ap-southeast-1": 4.416, + "ap-southeast-2": 4.416, + "ca-central-1": 4.416, + "eu-central-1": 12.33456, + "eu-central-2": 13.22208, + "eu-north-1": 11.52, + "eu-south-2": 11.86464, + "eu-west-1": 7.46928, + "us-east-1": 11.09904, + "us-east-2": 11.09904, + "us-gov-west-1": 8.36784, + "us-west-1": 4.416, + "us-west-2": 11.76734 + }, + "m6in.32xlarge": { + "ap-northeast-1": 0.0, + "ap-south-1": 9.28512, + "ap-southeast-1": 10.93248, + "ap-southeast-2": 5.888, + "ca-central-1": 9.93152, + "eu-central-1": 10.55808, + "eu-central-2": 0.0, + "eu-north-1": 9.472, + "eu-south-2": 9.93152, + "eu-west-1": 9.95904, + "us-east-1": 14.79872, + "us-east-2": 8.91072, + "us-gov-west-1": 17.04512, + "us-west-1": 10.39616, + "us-west-2": 8.91072 + }, + "m7a.medium": { + "ap-northeast-1": 0.07487, + "eu-central-1": 0.12237, + "eu-north-1": 0.10758, + "eu-south-2": 0.046, + "eu-west-1": 0.046, + "us-east-1": 0.046, + "us-east-2": 0.06376, + "us-west-2": 0.10396 + }, + "m7a.large": { + "ap-northeast-1": 0.14973, + "eu-central-1": 0.24475, + "eu-north-1": 0.12316, + "eu-south-2": 0.14212, + "eu-west-1": 0.0, + "us-east-1": 0.092, + "us-east-2": 0.20792, + "us-west-2": 0.092 + }, + "m7a.xlarge": { + "ap-northeast-1": 0.51341, + "eu-central-1": 0.184, + "eu-north-1": 0.24632, + "eu-south-2": 0.4424, + "eu-west-1": 0.184, + "us-east-1": 0.25502, + "us-east-2": 0.41584, + "us-west-2": 0.23184 + }, + "m7a.metal-48xl": { + "ap-northeast-1": 14.37408, + "eu-central-1": 13.33056, + "eu-north-1": 8.832, + "eu-south-2": 21.2352, + "eu-west-1": 8.832, + "us-east-1": 19.96032, + "us-east-2": 19.96032, + "us-west-2": 19.96032 + }, + "m7a.2xlarge": { + "ap-northeast-1": 0.96692, + "eu-central-1": 0.368, + "eu-north-1": 0.368, + "eu-south-2": 0.5168, + "eu-west-1": 0.8848, + "us-east-1": 0.368, + "us-east-2": 0.0, + "us-west-2": 0.46368 + }, + "m7a.4xlarge": { + "ap-northeast-1": 1.19784, + "eu-central-1": 1.84688, + "eu-north-1": 1.72128, + "eu-south-2": 1.7696, + "eu-west-1": 1.7696, + "us-east-1": 0.92736, + "us-east-2": 1.66336, + "us-west-2": 0.92736 + }, + "m7a.8xlarge": { + "ap-northeast-1": 3.86768, + "eu-central-1": 3.69376, + "eu-north-1": 1.97056, + "eu-south-2": 3.5392, + "eu-west-1": 2.0672, + "us-east-1": 0.0, + "us-east-2": 1.472, + "us-west-2": 1.85472 + }, + "m7a.12xlarge": { + "ap-northeast-1": 2.208, + "eu-central-1": 3.33264, + "eu-north-1": 2.208, + "eu-south-2": 0.0, + "eu-west-1": 5.61888, + "us-east-1": 2.208, + "us-east-2": 2.208, + "us-west-2": 2.78208 + }, + "m7a.16xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 7.38752, + "eu-north-1": 6.88512, + "eu-south-2": 4.1344, + "eu-west-1": 4.54784, + "us-east-1": 3.70944, + "us-east-2": 2.944, + "us-west-2": 6.65344 + }, + "m7a.24xlarge": { + "ap-northeast-1": 7.18704, + "eu-central-1": 11.08128, + "eu-north-1": 5.91168, + "eu-south-2": 0.0, + "eu-west-1": 6.2016, + "us-east-1": 5.56416, + "us-east-2": 4.416, + "us-west-2": 9.98016 + }, + "m7a.32xlarge": { + "ap-northeast-1": 15.47072, + "eu-central-1": 8.88704, + "eu-north-1": 5.888, + "eu-south-2": 14.1568, + "eu-west-1": 8.2688, + "us-east-1": 0.0, + "us-east-2": 8.16077, + "us-west-2": 13.30688 + }, + "m7a.48xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 13.33056, + "eu-north-1": 11.82336, + "eu-south-2": 8.832, + "eu-west-1": 8.832, + "us-east-1": 11.12832, + "us-east-2": 8.832, + "us-west-2": 0.0 + }, + "m7i.large": { + "ap-northeast-1": 0.092, + "ap-northeast-2": 0.092, + "ap-south-1": 0.092, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.1386, + "ap-southeast-3": 0.0, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.1991, + "ca-central-1": 0.20435, + "eu-central-1": 0.092, + "eu-north-1": 0.092, + "eu-south-2": 0.20435, + "eu-west-1": 0.21559, + "eu-west-2": 0.20855, + "eu-west-3": 0.0, + "mx-central-1": 0.20842, + "sa-east-1": 0.25265, + "us-east-1": 0.092, + "us-east-2": 0.092, + "us-gov-east-1": 0.21905, + "us-gov-west-1": 0.12705, + "us-west-1": 0.1176, + "us-west-2": 0.092 + }, + "m7i.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.2478, + "ap-south-1": 0.3961, + "ap-southeast-1": 0.184, + "ap-southeast-2": 0.436, + "ap-southeast-3": 0.184, + "ap-southeast-5": 0.41962, + "ap-southeast-7": 0.2142, + "ca-central-1": 0.4087, + "eu-central-1": 0.184, + "eu-north-1": 0.3982, + "eu-south-2": 0.2247, + "eu-west-1": 0.184, + "eu-west-2": 0.2331, + "eu-west-3": 0.4192, + "mx-central-1": 0.0, + "sa-east-1": 0.5053, + "us-east-1": 0.3856, + "us-east-2": 0.2016, + "us-gov-east-1": 0.4381, + "us-gov-west-1": 0.27951, + "us-west-1": 0.4192, + "us-west-2": 0.184 + }, + "m7i.metal-24xl": { + "ap-northeast-1": 6.87456, + "ap-northeast-2": 4.416, + "ap-south-1": 5.0904, + "ap-southeast-1": 4.416, + "ap-southeast-2": 4.416, + "ap-southeast-3": 6.048, + "ap-southeast-5": 5.1408, + "ap-southeast-7": 9.5568, + "ca-central-1": 5.3928, + "eu-central-1": 0.0, + "eu-north-1": 5.1408, + "eu-south-2": 4.416, + "eu-west-1": 0.0, + "eu-west-2": 5.5944, + "eu-west-3": 10.0608, + "mx-central-1": 5.08032, + "sa-east-1": 7.7112, + "us-east-1": 4.416, + "us-east-2": 4.416, + "us-gov-east-1": 10.5144, + "us-gov-west-1": 10.5144, + "us-west-1": 5.6448, + "us-west-2": 0.0 + }, + "m7i.metal-48xl": { + "ap-northeast-1": 21.3312, + "ap-northeast-2": 8.832, + "ap-south-1": 10.1808, + "ap-southeast-1": 20.928, + "ap-southeast-2": 20.928, + "ap-southeast-3": 20.928, + "ap-southeast-5": 10.2816, + "ap-southeast-7": 19.1136, + "ca-central-1": 8.832, + "eu-central-1": 8.832, + "eu-north-1": 10.2816, + "eu-south-2": 8.832, + "eu-west-1": 10.7856, + "eu-west-2": 0.0, + "eu-west-3": 8.832, + "mx-central-1": 18.99264, + "sa-east-1": 15.4224, + "us-east-1": 18.5088, + "us-east-2": 9.6768, + "us-gov-east-1": 21.0288, + "us-gov-west-1": 21.0288, + "us-west-1": 0.0, + "us-west-2": 0.0 + }, + "m7i.2xlarge": { + "ap-northeast-1": 0.8888, + "ap-northeast-2": 0.368, + "ap-south-1": 0.368, + "ap-southeast-1": 0.5544, + "ap-southeast-2": 0.504, + "ap-southeast-3": 0.5544, + "ap-southeast-5": 0.7964, + "ap-southeast-7": 0.7964, + "ca-central-1": 0.4494, + "eu-central-1": 0.0, + "eu-north-1": 0.7964, + "eu-south-2": 0.8174, + "eu-west-1": 0.0, + "eu-west-2": 0.8342, + "eu-west-3": 0.368, + "mx-central-1": 0.42336, + "sa-east-1": 0.0, + "us-east-1": 0.7712, + "us-east-2": 0.4032, + "us-gov-east-1": 0.5082, + "us-gov-west-1": 0.5082, + "us-west-1": 0.8384, + "us-west-2": 0.7712 + }, + "m7i.4xlarge": { + "ap-northeast-1": 1.88176, + "ap-northeast-2": 1.7272, + "ap-south-1": 0.93324, + "ap-southeast-1": 1.008, + "ap-southeast-2": 1.008, + "ap-southeast-3": 1.744, + "ap-southeast-5": 0.736, + "ap-southeast-7": 1.5928, + "ca-central-1": 1.6348, + "eu-central-1": 1.702, + "eu-north-1": 0.94248, + "eu-south-2": 0.8988, + "eu-west-1": 1.6348, + "eu-west-2": 0.9324, + "eu-west-3": 1.6768, + "mx-central-1": 0.736, + "sa-east-1": 0.736, + "us-east-1": 0.8064, + "us-east-2": 0.736, + "us-gov-east-1": 1.85404, + "us-gov-west-1": 0.736, + "us-west-1": 1.6768, + "us-west-2": 0.8064 + }, + "m7i.8xlarge": { + "ap-northeast-1": 2.0832, + "ap-northeast-2": 3.65264, + "ap-south-1": 3.1688, + "ap-southeast-1": 3.488, + "ap-southeast-2": 2.016, + "ap-southeast-3": 2.016, + "ap-southeast-5": 3.1856, + "ap-southeast-7": 0.0, + "ca-central-1": 3.44936, + "eu-central-1": 3.404, + "eu-north-1": 1.472, + "eu-south-2": 1.472, + "eu-west-1": 1.472, + "eu-west-2": 1.472, + "eu-west-3": 1.8816, + "mx-central-1": 1.69344, + "sa-east-1": 1.472, + "us-east-1": 1.77408, + "us-east-2": 3.0848, + "us-gov-east-1": 1.472, + "us-gov-west-1": 0.0, + "us-west-1": 1.472, + "us-west-2": 1.472 + }, + "m7i.12xlarge": { + "ap-northeast-1": 2.208, + "ap-northeast-2": 2.208, + "ap-south-1": 2.208, + "ap-southeast-1": 0.0, + "ap-southeast-2": 3.024, + "ap-southeast-3": 5.232, + "ap-southeast-5": 4.7784, + "ap-southeast-7": 5.03544, + "ca-central-1": 2.6964, + "eu-central-1": 2.898, + "eu-north-1": 2.5704, + "eu-south-2": 2.6964, + "eu-west-1": 4.9044, + "eu-west-2": 2.7972, + "eu-west-3": 2.8224, + "mx-central-1": 2.208, + "sa-east-1": 3.8556, + "us-east-1": 2.4192, + "us-east-2": 0.0, + "us-gov-east-1": 3.0492, + "us-gov-west-1": 3.0492, + "us-west-1": 2.8224, + "us-west-2": 2.4192 + }, + "m7i.16xlarge": { + "ap-northeast-1": 7.1104, + "ap-northeast-2": 3.9648, + "ap-south-1": 3.3936, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.944, + "ap-southeast-3": 4.032, + "ap-southeast-5": 6.3712, + "ap-southeast-7": 3.4272, + "ca-central-1": 0.0, + "eu-central-1": 6.808, + "eu-north-1": 2.944, + "eu-south-2": 6.5392, + "eu-west-1": 3.5952, + "eu-west-2": 6.6736, + "eu-west-3": 6.7072, + "mx-central-1": 0.0, + "sa-east-1": 5.1408, + "us-east-1": 6.49216, + "us-east-2": 3.2256, + "us-gov-east-1": 2.944, + "us-gov-west-1": 0.0, + "us-west-1": 2.944, + "us-west-2": 2.944 + }, + "m7i.24xlarge": { + "ap-northeast-1": 6.87456, + "ap-northeast-2": 4.416, + "ap-south-1": 0.0, + "ap-southeast-1": 6.048, + "ap-southeast-2": 6.048, + "ap-southeast-3": 10.464, + "ap-southeast-5": 4.416, + "ap-southeast-7": 4.416, + "ca-central-1": 5.93208, + "eu-central-1": 4.416, + "eu-north-1": 9.5568, + "eu-south-2": 4.416, + "eu-west-1": 4.416, + "eu-west-2": 10.0104, + "eu-west-3": 10.0608, + "mx-central-1": 9.49632, + "sa-east-1": 12.89832, + "us-east-1": 4.416, + "us-east-2": 9.2544, + "us-gov-east-1": 4.416, + "us-gov-west-1": 4.416, + "us-west-1": 10.62528, + "us-west-2": 9.2544 + }, + "m7i.48xlarge": { + "ap-northeast-1": 8.832, + "ap-northeast-2": 11.8944, + "ap-south-1": 8.832, + "ap-southeast-1": 12.096, + "ap-southeast-2": 0.0, + "ap-southeast-3": 8.832, + "ap-southeast-5": 19.1136, + "ap-southeast-7": 10.2816, + "ca-central-1": 19.6176, + "eu-central-1": 8.832, + "eu-north-1": 10.2816, + "eu-south-2": 19.6176, + "eu-west-1": 19.6176, + "eu-west-2": 11.1888, + "eu-west-3": 11.2896, + "mx-central-1": 10.16064, + "sa-east-1": 15.4224, + "us-east-1": 9.6768, + "us-east-2": 8.832, + "us-gov-east-1": 8.832, + "us-gov-west-1": 21.0288, + "us-west-1": 8.832, + "us-west-2": 8.832 + }, + "m7i-flex.large": { + "ap-northeast-1": 0.12369, + "ap-northeast-2": 0.20511, + "ap-south-1": 0.18815, + "ap-southeast-1": 0.2071, + "ap-southeast-2": 0.1197, + "ap-southeast-3": 0.2071, + "ap-southeast-5": 0.18915, + "ca-central-1": 0.19413, + "eu-central-1": 0.11471, + "eu-north-1": 0.18915, + "eu-south-2": 0.19413, + "eu-west-1": 0.10673, + "eu-west-2": 0.11072, + "eu-west-3": 0.11172, + "sa-east-1": 0.24002, + "us-east-1": 0.09576, + "us-east-2": 0.09576, + "us-gov-east-1": 0.2081, + "us-gov-west-1": 0.2081, + "us-west-1": 0.19912, + "us-west-2": 0.18316 + }, + "m7i-flex.xlarge": { + "ap-northeast-1": 0.24738, + "ap-northeast-2": 0.23542, + "ap-south-1": 0.2015, + "ap-southeast-1": 0.4142, + "ap-southeast-2": 0.4142, + "ap-southeast-3": 0.4142, + "ap-southeast-5": 0.20349, + "ca-central-1": 0.38826, + "eu-central-1": 0.22942, + "eu-north-1": 0.2035, + "eu-south-2": 0.21346, + "eu-west-1": 0.38826, + "eu-west-2": 0.22144, + "eu-west-3": 0.22344, + "sa-east-1": 0.48004, + "us-east-1": 0.19152, + "us-east-2": 0.19152, + "us-gov-east-1": 0.2414, + "us-gov-west-1": 0.2414, + "us-west-1": 0.39824, + "us-west-2": 0.19152 + }, + "m7i-flex.2xlarge": { + "ap-northeast-1": 0.49476, + "ap-northeast-2": 0.47084, + "ap-south-1": 0.7526, + "ap-southeast-1": 0.8284, + "ap-southeast-2": 0.8284, + "ap-southeast-3": 0.4788, + "ap-southeast-5": 0.40698, + "ca-central-1": 0.77652, + "eu-central-1": 0.80844, + "eu-north-1": 0.7566, + "eu-south-2": 0.42692, + "eu-west-1": 0.42692, + "eu-west-2": 0.79248, + "eu-west-3": 0.79648, + "sa-east-1": 0.96008, + "us-east-1": 0.38304, + "us-east-2": 0.73264, + "us-gov-east-1": 0.8324, + "us-gov-west-1": 0.4828, + "us-west-1": 0.79648, + "us-west-2": 0.38304 + }, + "m7i-flex.4xlarge": { + "ap-northeast-1": 0.98952, + "ap-northeast-2": 1.64088, + "ap-south-1": 1.5052, + "ap-southeast-1": 1.6568, + "ap-southeast-2": 0.9576, + "ap-southeast-3": 0.9576, + "ap-southeast-5": 1.51316, + "ca-central-1": 1.55304, + "eu-central-1": 0.91768, + "eu-north-1": 0.814, + "eu-south-2": 0.85384, + "eu-west-1": 1.55304, + "eu-west-2": 0.88576, + "eu-west-3": 1.59296, + "sa-east-1": 1.92016, + "us-east-1": 0.76608, + "us-east-2": 1.46528, + "us-gov-east-1": 0.9656, + "us-gov-west-1": 0.9656, + "us-west-1": 0.89376, + "us-west-2": 1.46528 + }, + "m7i-flex.8xlarge": { + "ap-northeast-1": 1.97904, + "ap-northeast-2": 3.28176, + "ap-south-1": 1.612, + "ap-southeast-1": 3.3136, + "ap-southeast-2": 1.9152, + "ap-southeast-3": 3.3136, + "ap-southeast-5": 1.62792, + "ca-central-1": 1.70768, + "eu-central-1": 1.83536, + "eu-north-1": 3.0264, + "eu-south-2": 1.70768, + "eu-west-1": 3.10608, + "eu-west-2": 3.16992, + "eu-west-3": 1.78752, + "sa-east-1": 2.44192, + "us-east-1": 1.53216, + "us-east-2": 2.93056, + "us-gov-east-1": 1.9312, + "us-gov-west-1": 1.9312, + "us-west-1": 1.78752, + "us-west-2": 2.93056 + }, + "m7i-flex.12xlarge": { + "ap-northeast-1": 5.17656, + "ap-south-1": 4.626, + "ap-southeast-1": 5.0808, + "ap-southeast-2": 2.8728, + "ap-southeast-5": 4.64988, + "ca-central-1": 4.76952, + "eu-central-1": 4.96104, + "eu-north-1": 2.442, + "eu-south-2": 4.76952, + "eu-west-1": 4.76952, + "eu-west-3": 4.88928, + "sa-east-1": 5.87088, + "us-east-1": 2.29824, + "us-east-2": 4.50624, + "us-gov-east-1": 5.1048, + "us-gov-west-1": 2.8968, + "us-west-1": 4.88928, + "us-west-2": 2.29824 + }, + "m7i-flex.16xlarge": { + "ap-northeast-1": 6.90208, + "ap-south-1": 3.224, + "ap-southeast-1": 3.8304, + "ap-southeast-2": 6.7744, + "ap-southeast-5": 6.19984, + "ca-central-1": 3.41536, + "eu-central-1": 3.67072, + "eu-north-1": 3.256, + "eu-south-2": 6.35936, + "eu-west-1": 6.35936, + "eu-west-3": 3.57504, + "sa-east-1": 4.88384, + "us-east-1": 6.00832, + "us-east-2": 3.06432, + "us-gov-east-1": 3.8624, + "us-gov-west-1": 3.8624, + "us-west-1": 6.51904, + "us-west-2": 6.00832 + }, + "p2.xlarge": { + "ap-northeast-1": 1.726, + "ap-northeast-2": 1.649, + "ap-south-1": 1.902, + "ap-southeast-1": 0.184, + "ap-southeast-2": 1.88, + "eu-central-1": 1.326, + "eu-west-1": 0.972, + "us-east-1": 0.0, + "us-east-2": 1.084, + "us-gov-west-1": 0.184, + "us-west-2": 0.0 + }, + "p2.8xlarge": { + "ap-northeast-1": 13.808, + "ap-northeast-2": 13.192, + "ap-south-1": 15.216, + "ap-southeast-1": 15.216, + "ap-southeast-2": 13.808, + "eu-central-1": 10.608, + "eu-west-1": 9.248, + "us-east-1": 7.2, + "us-east-2": 1.472, + "us-gov-west-1": 8.64, + "us-west-2": 8.672 + }, + "p2.16xlarge": { + "ap-northeast-1": 24.672, + "ap-northeast-2": 26.384, + "ap-south-1": 0.0, + "ap-southeast-1": 27.488, + "ap-southeast-2": 27.616, + "eu-central-1": 2.944, + "eu-west-1": 15.552, + "us-east-1": 17.344, + "us-east-2": 17.344, + "us-gov-west-1": 20.224, + "us-west-2": 17.344 + }, + "p3.2xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 4.602, + "ap-southeast-1": 0.368, + "ap-southeast-2": 0.0, + "ca-central-1": 0.0, + "eu-central-1": 4.191, + "eu-west-1": 3.673, + "eu-west-2": 0.368, + "us-east-1": 3.428, + "us-east-2": 3.06, + "us-gov-west-1": 0.368, + "us-west-2": 0.368 + }, + "p3.8xlarge": { + "ap-northeast-1": 16.776, + "ap-northeast-2": 18.408, + "ap-southeast-1": 18.408, + "ap-southeast-2": 1.472, + "ca-central-1": 0.0, + "eu-central-1": 15.292, + "eu-west-1": 15.554, + "eu-west-2": 14.356, + "us-east-1": 1.472, + "us-east-2": 12.24, + "us-gov-west-1": 16.16, + "us-west-2": 13.712 + }, + "p3.16xlarge": { + "ap-northeast-1": 33.552, + "ap-northeast-2": 33.872, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ca-central-1": 2.944, + "eu-central-1": 33.528, + "eu-west-1": 29.384, + "eu-west-2": 31.656, + "us-east-1": 27.424, + "us-east-2": 0.0, + "us-gov-west-1": 2.944, + "us-west-2": 27.424 + }, + "p3dn.24xlarge": { + "ap-northeast-1": 4.416, + "eu-west-1": 4.416, + "us-east-1": 35.628, + "us-gov-east-1": 41.87, + "us-gov-west-1": 41.87, + "us-west-2": 4.416 + }, + "r3.large": { + "ap-northeast-1": 0.3, + "ap-northeast-2": 0.292, + "ap-south-1": 0.092, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.2, + "eu-central-1": 0.0, + "eu-west-1": 0.092, + "sa-east-1": 0.442, + "us-east-1": 0.291, + "us-east-2": 0.092, + "us-gov-west-1": 0.325, + "us-west-1": 0.0, + "us-west-2": 0.291 + }, + "r3.xlarge": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.399, + "ap-south-1": 0.0, + "ap-southeast-1": 0.439, + "ap-southeast-2": 0.399, + "eu-central-1": 0.4, + "eu-west-1": 0.184, + "sa-east-1": 0.884, + "us-east-1": 0.333, + "us-east-2": 0.184, + "us-gov-west-1": 0.649, + "us-west-1": 0.371, + "us-west-2": 0.184 + }, + "r3.2xlarge": { + "ap-northeast-1": 1.295, + "ap-northeast-2": 0.0, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.25, + "eu-central-1": 1.18, + "eu-west-1": 0.368, + "sa-east-1": 0.368, + "us-east-1": 1.045, + "us-east-2": 0.368, + "us-gov-west-1": 1.178, + "us-west-1": 1.247, + "us-west-2": 0.368 + }, + "r3.4xlarge": { + "ap-northeast-1": 0.736, + "ap-northeast-2": 1.756, + "ap-south-1": 0.736, + "ap-southeast-1": 1.596, + "ap-southeast-2": 1.596, + "eu-central-1": 0.736, + "eu-west-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 1.463, + "us-east-2": 1.463, + "us-gov-west-1": 1.596, + "us-west-1": 0.736, + "us-west-2": 2.138 + }, + "r3.8xlarge": { + "ap-northeast-1": 3.192, + "ap-northeast-2": 3.192, + "ap-south-1": 4.504, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.472, + "eu-central-1": 1.472, + "eu-west-1": 1.472, + "sa-east-1": 5.597, + "us-east-1": 3.5, + "us-east-2": 3.5, + "us-gov-west-1": 1.472, + "us-west-1": 3.8, + "us-west-2": 0.0 + }, + "r4.large": { + "ap-northeast-1": 0.252, + "ap-northeast-2": 0.252, + "ap-northeast-3": 0.092, + "ap-south-1": 0.229, + "ap-southeast-1": 0.092, + "ap-southeast-2": 0.092, + "ca-central-1": 0.092, + "eu-central-1": 0.092, + "eu-west-1": 0.092, + "eu-west-2": 0.0, + "eu-west-3": 0.092, + "sa-east-1": 0.092, + "us-east-1": 0.225, + "us-east-2": 0.133, + "us-gov-west-1": 0.1596, + "us-west-1": 0.092, + "us-west-2": 0.225 + }, + "r4.xlarge": { + "ap-northeast-1": 0.536, + "ap-northeast-2": 0.184, + "ap-northeast-3": 0.184, + "ap-south-1": 0.458, + "ap-southeast-1": 0.184, + "ap-southeast-2": 0.351, + "ca-central-1": 0.184, + "eu-central-1": 0.352, + "eu-west-1": 0.0, + "eu-west-2": 0.312, + "eu-west-3": 0.184, + "sa-east-1": 0.744, + "us-east-1": 0.266, + "us-east-2": 0.0, + "us-gov-west-1": 0.5032, + "us-west-1": 0.4804, + "us-west-2": 0.477 + }, + "r4.2xlarge": { + "ap-northeast-1": 1.008, + "ap-northeast-2": 0.64, + "ap-northeast-3": 1.008, + "ap-south-1": 0.548, + "ap-southeast-1": 0.64, + "ap-southeast-2": 1.0064, + "ca-central-1": 0.952, + "eu-central-1": 0.6402, + "eu-west-1": 0.9608, + "eu-west-2": 1.054, + "eu-west-3": 0.368, + "sa-east-1": 0.368, + "us-east-1": 0.0, + "us-east-2": 0.9, + "us-gov-west-1": 0.6384, + "us-west-1": 0.9608, + "us-west-2": 0.0 + }, + "r4.4xlarge": { + "ap-northeast-1": 0.736, + "ap-northeast-2": 1.28, + "ap-northeast-3": 2.016, + "ap-south-1": 0.736, + "ap-southeast-1": 1.408, + "ap-southeast-2": 2.14, + "ca-central-1": 0.736, + "eu-central-1": 2.0164, + "eu-west-1": 0.0, + "eu-west-2": 1.248, + "eu-west-3": 1.984, + "sa-east-1": 0.736, + "us-east-1": 0.736, + "us-east-2": 1.064, + "us-gov-west-1": 0.736, + "us-west-1": 1.9216, + "us-west-2": 1.064 + }, + "r4.8xlarge": { + "ap-northeast-1": 4.032, + "ap-northeast-2": 4.032, + "ap-northeast-3": 1.472, + "ap-south-1": 3.664, + "ap-southeast-1": 4.288, + "ap-southeast-2": 2.5536, + "ca-central-1": 3.808, + "eu-central-1": 4.0328, + "eu-west-1": 1.472, + "eu-west-2": 3.968, + "eu-west-3": 1.472, + "sa-east-1": 4.928, + "us-east-1": 1.472, + "us-east-2": 3.6, + "us-gov-west-1": 2.5536, + "us-west-1": 4.08, + "us-west-2": 3.6 + }, + "r4.16xlarge": { + "ap-northeast-1": 5.12, + "ap-northeast-2": 8.064, + "ap-northeast-3": 5.12, + "ap-south-1": 4.384, + "ap-southeast-1": 5.12, + "ap-southeast-2": 2.944, + "ca-central-1": 0.0, + "eu-central-1": 0.0, + "eu-west-1": 2.944, + "eu-west-2": 2.944, + "eu-west-3": 2.944, + "sa-east-1": 0.0, + "us-east-1": 7.2, + "us-east-2": 2.944, + "us-gov-west-1": 5.1072, + "us-west-1": 2.944, + "us-west-2": 2.944 + }, + "r5.large": { + "af-south-1": 0.27, + "ap-east-1": 0.259, + "ap-northeast-1": 0.152, + "ap-northeast-2": 0.092, + "ap-northeast-3": 0.092, + "ap-south-1": 0.092, + "ap-south-2": 0.222, + "ap-southeast-1": 0.152, + "ap-southeast-2": 0.151, + "ap-southeast-3": 0.152, + "ap-southeast-4": 0.092, + "ca-central-1": 0.23, + "ca-west-1": 0.23, + "eu-central-1": 0.244, + "eu-central-2": 0.259, + "eu-north-1": 0.0, + "eu-south-1": 0.148, + "eu-south-2": 0.233, + "eu-west-1": 0.149, + "eu-west-2": 0.24, + "eu-west-3": 0.0, + "il-central-1": 0.148, + "me-central-1": 0.0, + "me-south-1": 0.092, + "sa-east-1": 0.092, + "us-east-1": 0.226, + "us-east-2": 0.134, + "us-gov-east-1": 0.151, + "us-gov-west-1": 0.092, + "us-west-1": 0.232, + "us-west-2": 0.126, + "us-west-2-lax-1": 0.243 + }, + "r5.xlarge": { + "af-south-1": 0.184, + "ap-east-1": 0.334, + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.488, + "ap-northeast-3": 0.304, + "ap-south-1": 0.26, + "ap-south-2": 0.444, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.486, + "ap-southeast-3": 0.488, + "ap-southeast-4": 0.486, + "ca-central-1": 0.46, + "ca-west-1": 0.46, + "eu-central-1": 0.322, + "eu-central-2": 0.518, + "eu-north-1": 0.452, + "eu-south-1": 0.0, + "eu-south-2": 0.282, + "eu-west-1": 0.466, + "eu-west-2": 0.0, + "eu-west-3": 0.184, + "il-central-1": 0.296, + "me-central-1": 0.0, + "me-south-1": 0.513, + "sa-east-1": 0.184, + "us-east-1": 0.252, + "us-east-2": 0.436, + "us-gov-east-1": 0.302, + "us-gov-west-1": 0.184, + "us-west-1": 0.28, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.486 + }, + "r5.metal": { + "af-south-1": 8.064, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 11.712, + "ap-northeast-3": 7.296, + "ap-south-1": 0.0, + "ap-south-2": 10.656, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "ap-southeast-3": 4.416, + "ap-southeast-4": 11.664, + "ca-central-1": 11.04, + "ca-west-1": 11.04, + "eu-central-1": 11.712, + "eu-central-2": 12.442, + "eu-north-1": 0.0, + "eu-south-1": 11.52, + "eu-south-2": 11.184, + "eu-west-1": 4.416, + "eu-west-2": 11.52, + "eu-west-3": 7.104, + "il-central-1": 7.106, + "me-central-1": 11.861, + "me-south-1": 7.445, + "sa-east-1": 14.064, + "us-east-1": 6.048, + "us-east-2": 0.0, + "us-gov-east-1": 11.664, + "us-gov-west-1": 11.664, + "us-west-1": 11.136, + "us-west-2": 4.416, + "us-west-2-lax-1": 11.674 + }, + "r5.2xlarge": { + "af-south-1": 1.04, + "ap-east-1": 0.668, + "ap-northeast-1": 0.368, + "ap-northeast-2": 0.976, + "ap-northeast-3": 0.976, + "ap-south-1": 0.888, + "ap-south-2": 0.368, + "ap-southeast-1": 0.976, + "ap-southeast-2": 0.972, + "ap-southeast-3": 0.976, + "ap-southeast-4": 0.368, + "ca-central-1": 0.552, + "ca-west-1": 0.92, + "eu-central-1": 0.608, + "eu-central-2": 0.669, + "eu-north-1": 0.904, + "eu-south-1": 0.592, + "eu-south-2": 0.932, + "eu-west-1": 0.932, + "eu-west-2": 0.368, + "eu-west-3": 0.96, + "il-central-1": 0.96, + "me-central-1": 0.988, + "me-south-1": 0.368, + "sa-east-1": 0.804, + "us-east-1": 0.0, + "us-east-2": 0.504, + "us-gov-east-1": 0.972, + "us-gov-west-1": 0.972, + "us-west-1": 0.928, + "us-west-2": 0.872, + "us-west-2-lax-1": 0.973 + }, + "r5.4xlarge": { + "af-south-1": 2.08, + "ap-east-1": 2.152, + "ap-northeast-1": 1.952, + "ap-northeast-2": 1.289, + "ap-northeast-3": 1.216, + "ap-south-1": 1.776, + "ap-south-2": 1.776, + "ap-southeast-1": 1.952, + "ap-southeast-2": 0.736, + "ap-southeast-3": 1.952, + "ap-southeast-4": 0.736, + "ca-central-1": 1.104, + "ca-west-1": 1.84, + "eu-central-1": 1.952, + "eu-central-2": 2.074, + "eu-north-1": 1.072, + "eu-south-1": 0.736, + "eu-south-2": 0.736, + "eu-west-1": 1.128, + "eu-west-2": 1.92, + "eu-west-3": 0.736, + "il-central-1": 0.736, + "me-central-1": 1.977, + "me-south-1": 1.241, + "sa-east-1": 2.344, + "us-east-1": 1.008, + "us-east-2": 1.744, + "us-gov-east-1": 1.944, + "us-gov-west-1": 1.944, + "us-west-1": 1.856, + "us-west-2": 0.736, + "us-west-2-lax-1": 1.946 + }, + "r5.8xlarge": { + "af-south-1": 4.16, + "ap-east-1": 1.472, + "ap-northeast-1": 2.432, + "ap-northeast-2": 3.904, + "ap-northeast-3": 2.432, + "ap-south-1": 2.204, + "ap-south-2": 2.08, + "ap-southeast-1": 3.904, + "ap-southeast-2": 1.472, + "ap-southeast-3": 2.432, + "ap-southeast-4": 2.416, + "ca-central-1": 0.0, + "ca-west-1": 3.68, + "eu-central-1": 3.904, + "eu-central-2": 4.147, + "eu-north-1": 0.0, + "eu-south-1": 2.51, + "eu-south-2": 3.728, + "eu-west-1": 2.391, + "eu-west-2": 0.0, + "eu-west-3": 3.84, + "il-central-1": 2.369, + "me-central-1": 3.954, + "me-south-1": 2.482, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 3.488, + "us-gov-east-1": 1.472, + "us-gov-west-1": 1.472, + "us-west-1": 2.374, + "us-west-2": 1.472, + "us-west-2-lax-1": 1.472 + }, + "r5.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 4.008, + "ap-northeast-1": 3.648, + "ap-northeast-2": 2.208, + "ap-northeast-3": 5.856, + "ap-south-1": 3.12, + "ap-south-2": 5.328, + "ap-southeast-1": 5.856, + "ap-southeast-2": 3.624, + "ap-southeast-3": 0.0, + "ap-southeast-4": 5.832, + "ca-central-1": 0.0, + "ca-west-1": 5.52, + "eu-central-1": 0.0, + "eu-central-2": 6.221, + "eu-north-1": 2.208, + "eu-south-1": 2.208, + "eu-south-2": 5.592, + "eu-west-1": 2.208, + "eu-west-2": 0.0, + "eu-west-3": 2.208, + "il-central-1": 3.553, + "me-central-1": 0.0, + "me-south-1": 3.722, + "sa-east-1": 7.321, + "us-east-1": 3.024, + "us-east-2": 5.232, + "us-gov-east-1": 3.624, + "us-gov-west-1": 5.832, + "us-west-1": 3.36, + "us-west-2": 3.024, + "us-west-2-lax-1": 5.837 + }, + "r5.16xlarge": { + "af-south-1": 5.376, + "ap-east-1": 8.288, + "ap-northeast-1": 4.864, + "ap-northeast-2": 7.808, + "ap-northeast-3": 2.944, + "ap-south-1": 7.104, + "ap-south-2": 2.944, + "ap-southeast-1": 2.944, + "ap-southeast-2": 2.944, + "ap-southeast-3": 5.156, + "ap-southeast-4": 7.776, + "ca-central-1": 2.944, + "ca-west-1": 7.36, + "eu-central-1": 4.864, + "eu-central-2": 2.944, + "eu-north-1": 2.944, + "eu-south-1": 4.736, + "eu-south-2": 2.944, + "eu-west-1": 2.944, + "eu-west-2": 7.68, + "eu-west-3": 7.68, + "il-central-1": 7.682, + "me-central-1": 4.963, + "me-south-1": 4.963, + "sa-east-1": 6.432, + "us-east-1": 2.944, + "us-east-2": 0.0, + "us-gov-east-1": 7.776, + "us-gov-west-1": 4.832, + "us-west-1": 2.944, + "us-west-2": 2.944, + "us-west-2-lax-1": 2.944 + }, + "r5.24xlarge": { + "af-south-1": 12.48, + "ap-east-1": 4.416, + "ap-northeast-1": 11.712, + "ap-northeast-2": 4.416, + "ap-northeast-3": 11.712, + "ap-south-1": 4.416, + "ap-south-2": 10.656, + "ap-southeast-1": 0.0, + "ap-southeast-2": 7.248, + "ap-southeast-3": 11.712, + "ap-southeast-4": 7.248, + "ca-central-1": 11.04, + "ca-west-1": 11.04, + "eu-central-1": 11.712, + "eu-central-2": 4.416, + "eu-north-1": 6.432, + "eu-south-1": 7.104, + "eu-south-2": 11.184, + "eu-west-1": 4.416, + "eu-west-2": 4.416, + "eu-west-3": 0.0, + "il-central-1": 7.106, + "me-central-1": 7.445, + "me-south-1": 11.861, + "sa-east-1": 9.648, + "us-east-1": 10.464, + "us-east-2": 10.464, + "us-gov-east-1": 7.248, + "us-gov-west-1": 11.664, + "us-west-1": 4.416, + "us-west-2": 10.464, + "us-west-2-lax-1": 4.416 + }, + "r5a.large": { + "ap-northeast-1": 0.229, + "ap-northeast-2": 0.228, + "ap-south-1": 0.164, + "ap-southeast-1": 0.136, + "ap-southeast-2": 0.228, + "ca-central-1": 0.216, + "eu-central-1": 0.229, + "eu-south-1": 0.225, + "eu-west-1": 0.219, + "eu-west-2": 0.225, + "eu-west-3": 0.225, + "sa-east-1": 0.273, + "us-east-1": 0.205, + "us-east-2": 0.113, + "us-gov-east-1": 0.228, + "us-gov-west-1": 0.136, + "us-west-1": 0.218, + "us-west-2": 0.113 + }, + "r5a.xlarge": { + "ap-northeast-1": 0.458, + "ap-northeast-2": 0.456, + "ap-south-1": 0.327, + "ap-southeast-1": 0.456, + "ap-southeast-2": 0.456, + "ca-central-1": 0.432, + "eu-central-1": 0.458, + "eu-south-1": 0.45, + "eu-west-1": 0.254, + "eu-west-2": 0.45, + "eu-west-3": 0.45, + "sa-east-1": 0.546, + "us-east-1": 0.226, + "us-east-2": 0.226, + "us-gov-east-1": 0.456, + "us-gov-west-1": 0.456, + "us-west-1": 0.436, + "us-west-2": 0.226 + }, + "r5a.2xlarge": { + "ap-northeast-1": 0.916, + "ap-northeast-2": 0.912, + "ap-south-1": 0.654, + "ap-southeast-1": 0.544, + "ap-southeast-2": 0.912, + "ca-central-1": 0.864, + "eu-central-1": 0.916, + "eu-south-1": 0.9, + "eu-west-1": 0.508, + "eu-west-2": 0.9, + "eu-west-3": 0.9, + "sa-east-1": 1.092, + "us-east-1": 0.82, + "us-east-2": 0.82, + "us-gov-east-1": 0.912, + "us-gov-west-1": 0.544, + "us-west-1": 0.872, + "us-west-2": 0.82 + }, + "r5a.4xlarge": { + "ap-northeast-1": 1.832, + "ap-northeast-2": 1.824, + "ap-south-1": 1.308, + "ap-southeast-1": 1.088, + "ap-southeast-2": 1.824, + "ca-central-1": 1.728, + "eu-central-1": 1.832, + "eu-south-1": 1.8, + "eu-west-1": 1.016, + "eu-west-2": 1.8, + "eu-west-3": 1.8, + "sa-east-1": 2.184, + "us-east-1": 1.64, + "us-east-2": 1.64, + "us-gov-east-1": 1.824, + "us-gov-west-1": 1.824, + "us-west-1": 1.744, + "us-west-2": 1.64 + }, + "r5a.8xlarge": { + "ap-northeast-1": 3.664, + "ap-northeast-2": 3.648, + "ap-south-1": 2.616, + "ap-southeast-1": 3.648, + "ap-southeast-2": 3.648, + "ca-central-1": 3.456, + "eu-central-1": 3.664, + "eu-south-1": 3.6, + "eu-west-1": 3.504, + "eu-west-2": 3.6, + "eu-west-3": 3.6, + "sa-east-1": 4.368, + "us-east-1": 3.28, + "us-east-2": 3.28, + "us-gov-east-1": 3.648, + "us-gov-west-1": 3.648, + "us-west-1": 3.488, + "us-west-2": 3.28 + }, + "r5a.12xlarge": { + "ap-northeast-1": 5.496, + "ap-northeast-2": 5.472, + "ap-south-1": 3.924, + "ap-southeast-1": 5.472, + "ap-southeast-2": 5.472, + "ca-central-1": 5.184, + "eu-central-1": 5.496, + "eu-south-1": 5.4, + "eu-west-1": 3.048, + "eu-west-2": 5.4, + "eu-west-3": 5.4, + "sa-east-1": 6.552, + "us-east-1": 4.92, + "us-east-2": 4.92, + "us-gov-east-1": 5.472, + "us-gov-west-1": 5.472, + "us-west-1": 5.232, + "us-west-2": 4.92 + }, + "r5a.16xlarge": { + "ap-northeast-1": 7.328, + "ap-northeast-2": 7.296, + "ap-south-1": 5.232, + "ap-southeast-1": 7.296, + "ap-southeast-2": 7.296, + "ca-central-1": 6.912, + "eu-central-1": 7.328, + "eu-south-1": 7.2, + "eu-west-1": 7.008, + "eu-west-2": 7.2, + "eu-west-3": 7.2, + "sa-east-1": 8.736, + "us-east-1": 6.56, + "us-east-2": 6.56, + "us-gov-east-1": 7.296, + "us-gov-west-1": 4.352, + "us-west-1": 6.976, + "us-west-2": 6.56 + }, + "r5a.24xlarge": { + "ap-northeast-1": 10.992, + "ap-northeast-2": 10.944, + "ap-south-1": 7.848, + "ap-southeast-1": 6.528, + "ap-southeast-2": 10.944, + "ca-central-1": 10.368, + "eu-central-1": 10.992, + "eu-south-1": 10.8, + "eu-west-1": 6.096, + "eu-west-2": 10.8, + "eu-west-3": 10.8, + "sa-east-1": 13.104, + "us-east-1": 9.84, + "us-east-2": 9.84, + "us-gov-east-1": 10.944, + "us-gov-west-1": 6.528, + "us-west-1": 10.464, + "us-west-2": 5.424 + }, + "r5ad.large": { + "ap-northeast-1": 0.251, + "ap-northeast-2": 0.25, + "ap-south-1": 0.175, + "ap-southeast-1": 0.251, + "ap-southeast-2": 0.251, + "ca-central-1": 0.236, + "eu-central-1": 0.25, + "eu-west-1": 0.238, + "eu-west-2": 0.246, + "eu-west-3": 0.245, + "sa-east-1": 0.3, + "us-east-1": 0.223, + "us-east-2": 0.223, + "us-gov-west-1": 0.158, + "us-west-1": 0.24, + "us-west-2": 0.223 + }, + "r5ad.xlarge": { + "ap-northeast-1": 0.502, + "ap-northeast-2": 0.5, + "ap-south-1": 0.35, + "ap-southeast-1": 0.502, + "ap-southeast-2": 0.502, + "ca-central-1": 0.472, + "eu-central-1": 0.5, + "eu-west-1": 0.476, + "eu-west-2": 0.492, + "eu-west-3": 0.49, + "sa-east-1": 0.6, + "us-east-1": 0.446, + "us-east-2": 0.446, + "us-gov-west-1": 0.5, + "us-west-1": 0.48, + "us-west-2": 0.446 + }, + "r5ad.2xlarge": { + "ap-northeast-1": 1.004, + "ap-northeast-2": 1.0, + "ap-south-1": 0.7, + "ap-southeast-1": 1.004, + "ap-southeast-2": 1.004, + "ca-central-1": 0.944, + "eu-central-1": 1.0, + "eu-west-1": 0.952, + "eu-west-2": 0.984, + "eu-west-3": 0.98, + "sa-east-1": 1.2, + "us-east-1": 0.892, + "us-east-2": 0.892, + "us-gov-west-1": 0.632, + "us-west-1": 0.96, + "us-west-2": 0.892 + }, + "r5ad.4xlarge": { + "ap-northeast-1": 2.008, + "ap-northeast-2": 2.0, + "ap-south-1": 1.4, + "ap-southeast-1": 2.008, + "ap-southeast-2": 2.008, + "ca-central-1": 1.888, + "eu-central-1": 2.0, + "eu-west-1": 1.904, + "eu-west-2": 1.968, + "eu-west-3": 1.96, + "sa-east-1": 2.4, + "us-east-1": 1.784, + "us-east-2": 1.784, + "us-gov-west-1": 2.0, + "us-west-1": 1.92, + "us-west-2": 1.784 + }, + "r5ad.8xlarge": { + "ap-northeast-1": 4.016, + "ap-northeast-2": 4.0, + "ap-south-1": 2.801, + "ap-southeast-1": 4.016, + "ap-southeast-2": 4.016, + "ca-central-1": 3.776, + "eu-central-1": 4.0, + "eu-west-1": 3.808, + "eu-west-2": 3.936, + "eu-west-3": 3.92, + "sa-east-1": 4.8, + "us-east-1": 3.568, + "us-east-2": 3.568, + "us-gov-west-1": 4.0, + "us-west-1": 3.84, + "us-west-2": 3.568 + }, + "r5ad.12xlarge": { + "ap-northeast-1": 6.024, + "ap-northeast-2": 6.0, + "ap-south-1": 4.201, + "ap-southeast-1": 6.024, + "ap-southeast-2": 6.024, + "ca-central-1": 5.664, + "eu-central-1": 6.0, + "eu-west-1": 5.712, + "eu-west-2": 5.904, + "eu-west-3": 5.88, + "sa-east-1": 7.2, + "us-east-1": 5.352, + "us-east-2": 5.352, + "us-gov-west-1": 6.0, + "us-west-1": 5.76, + "us-west-2": 5.352 + }, + "r5ad.16xlarge": { + "ap-northeast-1": 8.032, + "ap-northeast-2": 8.0, + "ap-south-1": 5.602, + "ap-southeast-1": 8.032, + "ap-southeast-2": 8.032, + "ca-central-1": 7.552, + "eu-central-1": 8.0, + "eu-west-1": 7.616, + "eu-west-2": 7.872, + "eu-west-3": 7.84, + "sa-east-1": 9.6, + "us-east-1": 7.136, + "us-east-2": 7.136, + "us-gov-west-1": 5.056, + "us-west-1": 7.68, + "us-west-2": 7.136 + }, + "r5ad.24xlarge": { + "ap-northeast-1": 12.048, + "ap-northeast-2": 12.0, + "ap-south-1": 8.402, + "ap-southeast-1": 12.048, + "ap-southeast-2": 12.048, + "ca-central-1": 11.328, + "eu-central-1": 12.0, + "eu-west-1": 11.424, + "eu-west-2": 11.808, + "eu-west-3": 11.76, + "sa-east-1": 14.4, + "us-east-1": 10.704, + "us-east-2": 10.704, + "us-gov-west-1": 7.584, + "us-west-1": 11.52, + "us-west-2": 10.704 + }, + "r5b.large": { + "ap-northeast-1": 0.092, + "ap-northeast-2": 0.27, + "ap-southeast-1": 0.092, + "ap-southeast-2": 0.1991, + "ca-central-1": 0.163, + "eu-central-1": 0.092, + "eu-north-1": 0.092, + "eu-south-1": 0.092, + "eu-west-1": 0.259, + "eu-west-2": 0.267, + "sa-east-1": 0.092, + "us-east-1": 0.241, + "us-east-2": 0.092, + "us-west-2": 0.241 + }, + "r5b.xlarge": { + "ap-northeast-1": 0.546, + "ap-northeast-2": 0.356, + "ap-southeast-1": 0.184, + "ap-southeast-2": 0.546, + "ca-central-1": 0.5426, + "eu-central-1": 0.54, + "eu-north-1": 0.0, + "eu-south-1": 0.184, + "eu-west-1": 0.184, + "eu-west-2": 0.534, + "sa-east-1": 0.5214, + "us-east-1": 0.184, + "us-east-2": 0.184, + "us-west-2": 0.482 + }, + "r5b.metal": { + "ap-northeast-1": 8.688, + "ap-northeast-2": 8.544, + "ap-southeast-1": 12.96, + "ap-southeast-2": 4.416, + "ca-central-1": 4.416, + "eu-central-1": 12.96, + "eu-north-1": 11.99712, + "eu-south-1": 12.816, + "eu-west-1": 12.432, + "eu-west-2": 4.416, + "sa-east-1": 15.792, + "us-east-1": 7.152, + "us-east-2": 4.416, + "us-west-2": 11.568 + }, + "r5b.2xlarge": { + "ap-northeast-1": 0.368, + "ap-northeast-2": 1.1512, + "ap-southeast-1": 0.368, + "ap-southeast-2": 0.368, + "ca-central-1": 0.652, + "eu-central-1": 0.368, + "eu-north-1": 0.368, + "eu-south-1": 1.068, + "eu-west-1": 0.668, + "eu-west-2": 0.7, + "sa-east-1": 0.0, + "us-east-1": 0.964, + "us-east-2": 0.368, + "us-west-2": 0.368 + }, + "r5b.4xlarge": { + "ap-northeast-1": 0.736, + "ap-northeast-2": 1.424, + "ap-southeast-1": 0.736, + "ap-southeast-2": 0.736, + "ca-central-1": 2.04, + "eu-central-1": 0.736, + "eu-north-1": 1.26352, + "eu-south-1": 0.736, + "eu-west-1": 2.072, + "eu-west-2": 0.736, + "sa-east-1": 1.896, + "us-east-1": 1.928, + "us-east-2": 1.928, + "us-west-2": 1.928 + }, + "r5b.8xlarge": { + "ap-northeast-1": 4.368, + "ap-northeast-2": 4.32, + "ap-southeast-1": 1.472, + "ap-southeast-2": 2.896, + "ca-central-1": 4.3408, + "eu-central-1": 1.472, + "eu-north-1": 0.0, + "eu-south-1": 1.472, + "eu-west-1": 4.144, + "eu-west-2": 4.272, + "sa-east-1": 1.472, + "us-east-1": 2.384, + "us-east-2": 3.856, + "us-west-2": 1.472 + }, + "r5b.12xlarge": { + "ap-northeast-1": 6.552, + "ap-northeast-2": 6.48, + "ap-southeast-1": 2.208, + "ap-southeast-2": 4.344, + "ca-central-1": 6.12, + "eu-central-1": 2.208, + "eu-north-1": 2.208, + "eu-south-1": 6.408, + "eu-west-1": 6.216, + "eu-west-2": 2.208, + "sa-east-1": 2.208, + "us-east-1": 3.576, + "us-east-2": 2.208, + "us-west-2": 5.784 + }, + "r5b.16xlarge": { + "ap-northeast-1": 8.736, + "ap-northeast-2": 8.64, + "ap-southeast-1": 8.64, + "ap-southeast-2": 5.792, + "ca-central-1": 5.216, + "eu-central-1": 8.64, + "eu-north-1": 2.944, + "eu-south-1": 8.544, + "eu-west-1": 8.288, + "eu-west-2": 8.544, + "sa-east-1": 10.528, + "us-east-1": 2.944, + "us-east-2": 2.944, + "us-west-2": 7.712 + }, + "r5b.24xlarge": { + "ap-northeast-1": 13.104, + "ap-northeast-2": 12.96, + "ap-southeast-1": 4.416, + "ap-southeast-2": 0.0, + "ca-central-1": 12.24, + "eu-central-1": 12.96, + "eu-north-1": 7.58112, + "eu-south-1": 12.816, + "eu-west-1": 12.432, + "eu-west-2": 0.0, + "sa-east-1": 4.416, + "us-east-1": 4.416, + "us-east-2": 4.416, + "us-west-2": 4.416 + }, + "r5d.large": { + "af-south-1": 0.092, + "ap-east-1": 0.092, + "ap-northeast-1": 0.266, + "ap-northeast-2": 0.092, + "ap-northeast-3": 0.092, + "ap-south-1": 0.092, + "ap-south-2": 0.151, + "ap-southeast-1": 0.092, + "ap-southeast-2": 0.092, + "ap-southeast-3": 0.174, + "ap-southeast-4": 0.174, + "ca-central-1": 0.25, + "eu-central-1": 0.265, + "eu-central-2": 0.282, + "eu-north-1": 0.092, + "eu-south-1": 0.092, + "eu-south-2": 0.16, + "eu-west-1": 0.252, + "eu-west-2": 0.169, + "eu-west-3": 0.261, + "il-central-1": 0.168, + "me-central-1": 0.092, + "me-south-1": 0.092, + "sa-east-1": 0.32, + "us-east-1": 0.236, + "us-east-2": 0.144, + "us-gov-east-1": 0.092, + "us-gov-west-1": 0.265, + "us-west-1": 0.092, + "us-west-2": 0.245, + "us-west-2-lax-1": 0.092 + }, + "r5d.xlarge": { + "af-south-1": 0.564, + "ap-east-1": 0.534, + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.53, + "ap-northeast-3": 0.532, + "ap-south-1": 0.184, + "ap-south-2": 0.302, + "ap-southeast-1": 0.532, + "ap-southeast-2": 0.532, + "ap-southeast-3": 0.184, + "ap-southeast-4": 0.532, + "ca-central-1": 0.184, + "eu-central-1": 0.53, + "eu-central-2": 0.587, + "eu-north-1": 0.184, + "eu-south-1": 0.184, + "eu-south-2": 0.504, + "eu-west-1": 0.504, + "eu-west-2": 0.184, + "eu-west-3": 0.184, + "il-central-1": 0.184, + "me-central-1": 0.352, + "me-south-1": 0.184, + "sa-east-1": 0.64, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 0.53, + "us-gov-west-1": 0.184, + "us-west-1": 0.508, + "us-west-2": 0.472, + "us-west-2-lax-1": 0.53 + }, + "r5d.metal": { + "af-south-1": 13.536, + "ap-east-1": 12.816, + "ap-northeast-1": 4.416, + "ap-northeast-2": 4.416, + "ap-northeast-3": 12.768, + "ap-south-1": 4.416, + "ap-south-2": 7.248, + "ap-southeast-1": 4.416, + "ap-southeast-2": 4.416, + "ap-southeast-3": 12.768, + "ap-southeast-4": 4.416, + "ca-central-1": 12.0, + "eu-central-1": 12.72, + "eu-central-2": 4.416, + "eu-north-1": 4.416, + "eu-south-1": 4.416, + "eu-south-2": 7.68, + "eu-west-1": 12.096, + "eu-west-2": 4.416, + "eu-west-3": 12.528, + "il-central-1": 0.0, + "me-central-1": 4.416, + "me-south-1": 12.864, + "sa-east-1": 4.416, + "us-east-1": 11.328, + "us-east-2": 11.328, + "us-gov-east-1": 4.416, + "us-gov-west-1": 4.416, + "us-west-1": 12.192, + "us-west-2": 11.328, + "us-west-2-lax-1": 12.71 + }, + "r5d.2xlarge": { + "af-south-1": 0.368, + "ap-east-1": 0.368, + "ap-northeast-1": 1.064, + "ap-northeast-2": 1.06, + "ap-northeast-3": 1.064, + "ap-south-1": 0.368, + "ap-south-2": 0.368, + "ap-southeast-1": 1.064, + "ap-southeast-2": 1.064, + "ap-southeast-3": 0.696, + "ap-southeast-4": 1.106, + "ca-central-1": 0.368, + "eu-central-1": 1.06, + "eu-central-2": 1.129, + "eu-north-1": 0.368, + "eu-south-1": 0.368, + "eu-south-2": 0.64, + "eu-west-1": 1.008, + "eu-west-2": 1.044, + "eu-west-3": 1.044, + "il-central-1": 0.368, + "me-central-1": 0.0, + "me-south-1": 0.368, + "sa-east-1": 1.28, + "us-east-1": 0.944, + "us-east-2": 0.368, + "us-gov-east-1": 0.368, + "us-gov-west-1": 0.692, + "us-west-1": 1.016, + "us-west-2": 0.944, + "us-west-2-lax-1": 0.368 + }, + "r5d.4xlarge": { + "af-south-1": 0.736, + "ap-east-1": 0.736, + "ap-northeast-1": 0.736, + "ap-northeast-2": 0.736, + "ap-northeast-3": 2.128, + "ap-south-1": 0.736, + "ap-south-2": 2.016, + "ap-southeast-1": 0.736, + "ap-southeast-2": 2.128, + "ap-southeast-3": 2.128, + "ap-southeast-4": 0.736, + "ca-central-1": 2.0, + "eu-central-1": 0.736, + "eu-central-2": 1.522, + "eu-north-1": 1.952, + "eu-south-1": 0.736, + "eu-south-2": 2.093, + "eu-west-1": 2.016, + "eu-west-2": 2.088, + "eu-west-3": 2.088, + "il-central-1": 0.736, + "me-central-1": 1.408, + "me-south-1": 2.144, + "sa-east-1": 2.56, + "us-east-1": 1.888, + "us-east-2": 0.0, + "us-gov-east-1": 0.736, + "us-gov-west-1": 1.384, + "us-west-1": 2.032, + "us-west-2": 0.736, + "us-west-2-lax-1": 2.118 + }, + "r5d.8xlarge": { + "af-south-1": 4.512, + "ap-east-1": 4.272, + "ap-northeast-1": 4.256, + "ap-northeast-2": 4.24, + "ap-northeast-3": 4.256, + "ap-south-1": 3.888, + "ap-south-2": 2.416, + "ap-southeast-1": 4.256, + "ap-southeast-2": 4.256, + "ap-southeast-3": 4.423, + "ap-southeast-4": 1.472, + "ca-central-1": 1.472, + "eu-central-1": 4.24, + "eu-central-2": 1.472, + "eu-north-1": 3.904, + "eu-south-1": 1.472, + "eu-south-2": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 2.704, + "eu-west-3": 4.176, + "il-central-1": 2.849, + "me-central-1": 1.472, + "me-south-1": 4.288, + "sa-east-1": 1.472, + "us-east-1": 3.776, + "us-east-2": 3.776, + "us-gov-east-1": 4.24, + "us-gov-west-1": 2.768, + "us-west-1": 4.064, + "us-west-2": 3.776, + "us-west-2-lax-1": 4.237 + }, + "r5d.12xlarge": { + "af-south-1": 6.768, + "ap-east-1": 6.408, + "ap-northeast-1": 2.208, + "ap-northeast-2": 2.208, + "ap-northeast-3": 2.208, + "ap-south-1": 2.208, + "ap-south-2": 3.624, + "ap-southeast-1": 2.208, + "ap-southeast-2": 2.208, + "ap-southeast-3": 2.208, + "ap-southeast-4": 6.384, + "ca-central-1": 2.208, + "eu-central-1": 2.208, + "eu-central-2": 4.567, + "eu-north-1": 5.856, + "eu-south-1": 6.24, + "eu-south-2": 2.208, + "eu-west-1": 6.048, + "eu-west-2": 6.51, + "eu-west-3": 2.208, + "il-central-1": 6.24, + "me-central-1": 6.432, + "me-south-1": 2.208, + "sa-east-1": 7.68, + "us-east-1": 2.208, + "us-east-2": 3.456, + "us-gov-east-1": 2.208, + "us-gov-west-1": 6.36, + "us-west-1": 6.096, + "us-west-2": 5.664, + "us-west-2-lax-1": 6.355 + }, + "r5d.16xlarge": { + "af-south-1": 2.944, + "ap-east-1": 8.544, + "ap-northeast-1": 8.512, + "ap-northeast-2": 8.48, + "ap-northeast-3": 8.512, + "ap-south-1": 7.776, + "ap-south-2": 4.832, + "ap-southeast-1": 8.512, + "ap-southeast-2": 2.944, + "ap-southeast-3": 5.568, + "ap-southeast-4": 5.902, + "ca-central-1": 8.0, + "eu-central-1": 8.48, + "eu-central-2": 9.034, + "eu-north-1": 7.808, + "eu-south-1": 2.944, + "eu-south-2": 8.064, + "eu-west-1": 8.064, + "eu-west-2": 8.352, + "eu-west-3": 8.352, + "il-central-1": 8.32, + "me-central-1": 2.944, + "me-south-1": 2.944, + "sa-east-1": 10.24, + "us-east-1": 7.552, + "us-east-2": 7.552, + "us-gov-east-1": 8.48, + "us-gov-west-1": 2.944, + "us-west-1": 8.128, + "us-west-2": 7.552, + "us-west-2-lax-1": 8.474 + }, + "r5d.24xlarge": { + "af-south-1": 13.536, + "ap-east-1": 4.416, + "ap-northeast-1": 4.416, + "ap-northeast-2": 4.416, + "ap-northeast-3": 12.768, + "ap-south-1": 4.416, + "ap-south-2": 11.664, + "ap-southeast-1": 4.416, + "ap-southeast-2": 12.768, + "ap-southeast-3": 12.768, + "ap-southeast-4": 4.416, + "ca-central-1": 4.416, + "eu-central-1": 12.72, + "eu-central-2": 9.134, + "eu-north-1": 11.712, + "eu-south-1": 12.48, + "eu-south-2": 12.096, + "eu-west-1": 12.096, + "eu-west-2": 8.112, + "eu-west-3": 12.528, + "il-central-1": 8.064, + "me-central-1": 8.448, + "me-south-1": 4.416, + "sa-east-1": 15.36, + "us-east-1": 0.0, + "us-east-2": 4.416, + "us-gov-east-1": 12.72, + "us-gov-west-1": 4.416, + "us-west-1": 4.416, + "us-west-2": 6.912, + "us-west-2-lax-1": 12.71 + }, + "r5dn.large": { + "af-south-1": 0.32626, + "ap-northeast-1": 0.295, + "ap-northeast-2": 0.092, + "ap-southeast-1": 0.092, + "ap-southeast-2": 0.30824, + "eu-central-1": 0.291, + "eu-north-1": 0.269, + "eu-south-1": 0.288, + "eu-west-1": 0.092, + "eu-west-3": 0.196, + "us-east-1": 0.092, + "us-east-2": 0.092, + "us-gov-east-1": 0.293, + "us-gov-west-1": 0.201, + "us-west-2": 0.092 + }, + "r5dn.xlarge": { + "af-south-1": 0.626, + "ap-northeast-1": 0.59, + "ap-northeast-2": 0.582, + "ap-southeast-1": 0.184, + "ap-southeast-2": 0.408, + "eu-central-1": 0.582, + "eu-north-1": 0.184, + "eu-south-1": 0.576, + "eu-west-1": 0.184, + "eu-west-3": 0.576, + "us-east-1": 0.184, + "us-east-2": 0.518, + "us-gov-east-1": 0.586, + "us-gov-west-1": 0.0, + "us-west-2": 0.184 + }, + "r5dn.metal": { + "af-south-1": 15.024, + "ap-northeast-1": 14.16, + "ap-northeast-2": 9.552, + "ap-southeast-1": 14.016, + "ap-southeast-2": 14.208, + "eu-central-1": 13.968, + "eu-north-1": 12.912, + "eu-south-1": 9.408, + "eu-west-1": 13.344, + "eu-west-3": 9.408, + "us-east-1": 12.432, + "us-east-2": 4.416, + "us-gov-east-1": 14.064, + "us-gov-west-1": 9.648, + "us-west-2": 12.432 + }, + "r5dn.2xlarge": { + "af-south-1": 0.368, + "ap-northeast-1": 0.368, + "ap-northeast-2": 1.164, + "ap-southeast-1": 1.168, + "ap-southeast-2": 0.368, + "eu-central-1": 1.164, + "eu-north-1": 0.75048, + "eu-south-1": 0.83104, + "eu-west-1": 1.112, + "eu-west-3": 1.152, + "us-east-1": 1.036, + "us-east-2": 0.368, + "us-gov-east-1": 1.172, + "us-gov-west-1": 0.368, + "us-west-2": 1.036 + }, + "r5dn.4xlarge": { + "af-south-1": 2.504, + "ap-northeast-1": 0.736, + "ap-northeast-2": 0.736, + "ap-southeast-1": 0.736, + "ap-southeast-2": 2.368, + "eu-central-1": 0.736, + "eu-north-1": 0.736, + "eu-south-1": 0.0, + "eu-west-1": 0.736, + "eu-west-3": 1.66208, + "us-east-1": 2.072, + "us-east-2": 2.072, + "us-gov-east-1": 2.344, + "us-gov-west-1": 2.344, + "us-west-2": 0.736 + }, + "r5dn.8xlarge": { + "af-south-1": 3.536, + "ap-northeast-1": 4.72, + "ap-northeast-2": 3.184, + "ap-southeast-1": 4.672, + "ap-southeast-2": 3.264, + "eu-central-1": 4.656, + "eu-north-1": 4.47392, + "eu-south-1": 4.608, + "eu-west-1": 1.472, + "eu-west-3": 4.608, + "us-east-1": 1.472, + "us-east-2": 4.144, + "us-gov-east-1": 4.688, + "us-gov-west-1": 3.216, + "us-west-2": 4.144 + }, + "r5dn.12xlarge": { + "af-south-1": 5.304, + "ap-northeast-1": 2.208, + "ap-northeast-2": 6.984, + "ap-southeast-1": 7.008, + "ap-southeast-2": 2.208, + "eu-central-1": 6.984, + "eu-north-1": 2.208, + "eu-south-1": 4.704, + "eu-west-1": 6.672, + "eu-west-3": 6.912, + "us-east-1": 6.216, + "us-east-2": 6.216, + "us-gov-east-1": 2.208, + "us-gov-west-1": 5.113, + "us-west-2": 2.208 + }, + "r5dn.16xlarge": { + "af-south-1": 10.016, + "ap-northeast-1": 2.944, + "ap-northeast-2": 9.312, + "ap-southeast-1": 2.944, + "ap-southeast-2": 9.472, + "eu-central-1": 9.312, + "eu-north-1": 2.944, + "eu-south-1": 2.944, + "eu-west-1": 2.944, + "eu-west-3": 6.64832, + "us-east-1": 8.288, + "us-east-2": 2.944, + "us-gov-east-1": 9.376, + "us-gov-west-1": 2.944, + "us-west-2": 2.944 + }, + "r5dn.24xlarge": { + "af-south-1": 15.024, + "ap-northeast-1": 4.416, + "ap-northeast-2": 4.416, + "ap-southeast-1": 4.416, + "ap-southeast-2": 9.792, + "eu-central-1": 13.968, + "eu-north-1": 4.416, + "eu-south-1": 0.0, + "eu-west-1": 4.416, + "eu-west-3": 9.408, + "us-east-1": 12.432, + "us-east-2": 4.416, + "us-gov-east-1": 4.416, + "us-gov-west-1": 4.416, + "us-west-2": 12.432 + }, + "r5n.large": { + "af-south-1": 0.092, + "ap-east-1": 0.092, + "ap-northeast-1": 0.273, + "ap-northeast-2": 0.281, + "ap-south-1": 0.092, + "ap-southeast-1": 0.27, + "ap-southeast-2": 0.181, + "ca-central-1": 0.092, + "eu-central-1": 0.092, + "eu-north-1": 0.251, + "eu-south-1": 0.267, + "eu-west-1": 0.167, + "eu-west-2": 0.175, + "eu-west-3": 0.175, + "sa-east-1": 0.328, + "us-east-1": 0.241, + "us-east-2": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 0.261, + "us-west-2": 0.241 + }, + "r5n.xlarge": { + "af-south-1": 0.184, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.184, + "ap-south-1": 0.184, + "ap-southeast-1": 0.54, + "ap-southeast-2": 0.184, + "ca-central-1": 0.326, + "eu-central-1": 0.54, + "eu-north-1": 0.318, + "eu-south-1": 0.35, + "eu-west-1": 0.518, + "eu-west-2": 0.35, + "eu-west-3": 0.534, + "sa-east-1": 0.472, + "us-east-1": 0.184, + "us-east-2": 0.184, + "us-gov-east-1": 0.184, + "us-gov-west-1": 0.358, + "us-west-1": 0.522, + "us-west-2": 0.482 + }, + "r5n.metal": { + "af-south-1": 13.952, + "ap-east-1": 9.696, + "ap-northeast-1": 13.104, + "ap-northeast-2": 8.544, + "ap-south-1": 4.416, + "ap-southeast-1": 4.416, + "ap-southeast-2": 0.0, + "ca-central-1": 12.24, + "eu-central-1": 4.416, + "eu-north-1": 4.416, + "eu-south-1": 12.817, + "eu-west-1": 12.432, + "eu-west-2": 0.0, + "eu-west-3": 8.4, + "sa-east-1": 11.328, + "us-east-1": 4.416, + "us-east-2": 11.568, + "us-gov-east-1": 13.008, + "us-gov-west-1": 4.416, + "us-west-1": 4.416, + "us-west-2": 11.568 + }, + "r5n.2xlarge": { + "af-south-1": 0.368, + "ap-east-1": 1.176, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.08, + "ap-south-1": 0.612, + "ap-southeast-1": 0.368, + "ap-southeast-2": 0.724, + "ca-central-1": 0.691, + "eu-central-1": 1.08, + "eu-north-1": 0.636, + "eu-south-1": 0.368, + "eu-west-1": 0.668, + "eu-west-2": 0.7, + "eu-west-3": 0.368, + "sa-east-1": 0.0, + "us-east-1": 0.964, + "us-east-2": 0.368, + "us-gov-east-1": 1.084, + "us-gov-west-1": 1.084, + "us-west-1": 0.0, + "us-west-2": 0.368 + }, + "r5n.4xlarge": { + "af-south-1": 0.736, + "ap-east-1": 0.736, + "ap-northeast-1": 2.184, + "ap-northeast-2": 0.0, + "ap-south-1": 0.736, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.736, + "ca-central-1": 1.304, + "eu-central-1": 0.736, + "eu-north-1": 0.736, + "eu-south-1": 1.4, + "eu-west-1": 0.736, + "eu-west-2": 2.136, + "eu-west-3": 1.4, + "sa-east-1": 0.736, + "us-east-1": 1.928, + "us-east-2": 1.928, + "us-gov-east-1": 2.168, + "us-gov-west-1": 2.254, + "us-west-1": 2.088, + "us-west-2": 2.0 + }, + "r5n.8xlarge": { + "af-south-1": 3.179, + "ap-east-1": 4.704, + "ap-northeast-1": 4.368, + "ap-northeast-2": 1.472, + "ap-south-1": 2.448, + "ap-southeast-1": 4.32, + "ap-southeast-2": 0.0, + "ca-central-1": 4.237, + "eu-central-1": 1.472, + "eu-north-1": 4.168, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "eu-west-2": 2.8, + "eu-west-3": 0.0, + "sa-east-1": 3.776, + "us-east-1": 1.472, + "us-east-2": 1.472, + "us-gov-east-1": 1.472, + "us-gov-west-1": 2.864, + "us-west-1": 2.704, + "us-west-2": 3.999 + }, + "r5n.12xlarge": { + "af-south-1": 0.0, + "ap-east-1": 7.056, + "ap-northeast-1": 2.208, + "ap-northeast-2": 4.528, + "ap-south-1": 5.88, + "ap-southeast-1": 6.48, + "ap-southeast-2": 2.208, + "ca-central-1": 3.912, + "eu-central-1": 0.0, + "eu-north-1": 2.208, + "eu-south-1": 6.408, + "eu-west-1": 6.216, + "eu-west-2": 6.408, + "eu-west-3": 6.408, + "sa-east-1": 2.208, + "us-east-1": 5.999, + "us-east-2": 2.208, + "us-gov-east-1": 2.208, + "us-gov-west-1": 4.296, + "us-west-1": 4.3, + "us-west-2": 5.784 + }, + "r5n.16xlarge": { + "af-south-1": 0.0, + "ap-east-1": 9.408, + "ap-northeast-1": 0.0, + "ap-northeast-2": 8.64, + "ap-south-1": 2.944, + "ap-southeast-1": 8.64, + "ap-southeast-2": 8.736, + "ca-central-1": 8.16, + "eu-central-1": 8.985, + "eu-north-1": 5.088, + "eu-south-1": 8.881, + "eu-west-1": 8.288, + "eu-west-2": 8.544, + "eu-west-3": 2.944, + "sa-east-1": 7.552, + "us-east-1": 7.712, + "us-east-2": 7.998, + "us-gov-east-1": 2.944, + "us-gov-west-1": 8.672, + "us-west-1": 8.352, + "us-west-2": 7.998 + }, + "r5n.24xlarge": { + "af-south-1": 13.952, + "ap-east-1": 4.416, + "ap-northeast-1": 13.104, + "ap-northeast-2": 12.96, + "ap-south-1": 7.344, + "ap-southeast-1": 12.96, + "ap-southeast-2": 4.416, + "ca-central-1": 7.824, + "eu-central-1": 12.96, + "eu-north-1": 12.048, + "eu-south-1": 8.401, + "eu-west-1": 8.016, + "eu-west-2": 4.416, + "eu-west-3": 12.816, + "sa-east-1": 0.0, + "us-east-1": 11.568, + "us-east-2": 4.416, + "us-gov-east-1": 4.416, + "us-gov-west-1": 8.592, + "us-west-1": 4.416, + "us-west-2": 4.416 + }, + "r6a.large": { + "ap-northeast-1": 0.15048, + "ap-south-1": 0.1635, + "ap-south-2": 0.1635, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.24149, + "ca-central-1": 0.1242, + "eu-central-1": 0.2288, + "eu-west-1": 0.092, + "us-east-1": 0.1134, + "us-east-2": 0.092, + "us-west-1": 0.126, + "us-west-2": 0.2054 + }, + "r6a.xlarge": { + "ap-northeast-1": 0.184, + "ap-south-1": 0.0, + "ap-south-2": 0.143, + "ap-southeast-1": 0.2736, + "ap-southeast-2": 0.184, + "ca-central-1": 0.184, + "eu-central-1": 0.184, + "eu-west-1": 0.4378, + "us-east-1": 0.0, + "us-east-2": 0.2268, + "us-west-1": 0.184, + "us-west-2": 0.2268 + }, + "r6a.metal": { + "ap-northeast-1": 21.9648, + "ap-south-1": 6.864, + "ap-south-2": 8.832, + "ap-southeast-1": 21.9648, + "ap-southeast-2": 8.832, + "ca-central-1": 20.7552, + "eu-central-1": 8.832, + "eu-west-1": 8.832, + "us-east-1": 10.8864, + "us-east-2": 19.7184, + "us-west-1": 20.928, + "us-west-2": 10.8864 + }, + "r6a.2xlarge": { + "ap-northeast-1": 0.60192, + "ap-south-1": 0.286, + "ap-south-2": 0.654, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.9116, + "ca-central-1": 0.368, + "eu-central-1": 0.368, + "eu-west-1": 0.0, + "us-east-1": 0.49896, + "us-east-2": 0.8216, + "us-west-1": 0.0, + "us-west-2": 0.4536 + }, + "r6a.4xlarge": { + "ap-northeast-1": 1.0944, + "ap-south-1": 1.308, + "ap-south-2": 0.736, + "ap-southeast-1": 1.0944, + "ap-southeast-2": 1.8232, + "ca-central-1": 1.7296, + "eu-central-1": 1.20384, + "eu-west-1": 0.736, + "us-east-1": 0.99792, + "us-east-2": 0.736, + "us-west-1": 1.744, + "us-west-2": 0.9072 + }, + "r6a.8xlarge": { + "ap-northeast-1": 2.1888, + "ap-south-1": 2.616, + "ap-south-2": 1.144, + "ap-southeast-1": 0.0, + "ap-southeast-2": 2.1744, + "ca-central-1": 1.9872, + "eu-central-1": 2.1888, + "eu-west-1": 1.472, + "us-east-1": 3.2864, + "us-east-2": 1.8144, + "us-west-1": 3.488, + "us-west-2": 1.472 + }, + "r6a.12xlarge": { + "ap-northeast-1": 5.4912, + "ap-south-1": 3.924, + "ap-south-2": 3.924, + "ap-southeast-1": 3.2832, + "ap-southeast-2": 3.2616, + "ca-central-1": 2.9808, + "eu-central-1": 3.2832, + "eu-west-1": 2.208, + "us-east-1": 4.9296, + "us-east-2": 2.208, + "us-west-1": 5.232, + "us-west-2": 2.7216 + }, + "r6a.16xlarge": { + "ap-northeast-1": 4.3776, + "ap-south-1": 5.232, + "ap-south-2": 2.944, + "ap-southeast-1": 2.944, + "ap-southeast-2": 4.3488, + "ca-central-1": 0.0, + "eu-central-1": 2.944, + "eu-west-1": 7.0048, + "us-east-1": 3.6288, + "us-east-2": 6.5728, + "us-west-1": 2.944, + "us-west-2": 3.6288 + }, + "r6a.24xlarge": { + "ap-northeast-1": 6.5664, + "ap-south-1": 0.0, + "ap-south-2": 8.1912, + "ap-southeast-1": 10.9824, + "ap-southeast-2": 10.9392, + "ca-central-1": 5.9616, + "eu-central-1": 10.9824, + "eu-west-1": 0.0, + "us-east-1": 4.416, + "us-east-2": 4.416, + "us-west-1": 10.464, + "us-west-2": 9.8592 + }, + "r6a.32xlarge": { + "ap-northeast-1": 8.7552, + "ap-south-1": 10.9216, + "ap-south-2": 4.576, + "ap-southeast-1": 5.888, + "ap-southeast-2": 14.5856, + "ca-central-1": 5.888, + "eu-central-1": 8.7552, + "eu-west-1": 14.0096, + "us-east-1": 7.98336, + "us-east-2": 13.1456, + "us-west-1": 8.064, + "us-west-2": 5.888 + }, + "r6a.48xlarge": { + "ap-northeast-1": 13.1328, + "ap-south-1": 6.864, + "ap-south-2": 6.864, + "ap-southeast-1": 8.832, + "ap-southeast-2": 13.0464, + "ca-central-1": 11.9232, + "eu-central-1": 13.1328, + "eu-west-1": 0.0, + "us-east-1": 8.832, + "us-east-2": 8.832, + "us-west-1": 12.096, + "us-west-2": 0.0 + }, + "r6i.large": { + "af-south-1": 0.2768, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.152, + "ap-northeast-3": 0.1672, + "ap-south-1": 0.222, + "ap-south-2": 0.222, + "ap-southeast-1": 0.244, + "ap-southeast-2": 0.243, + "ap-southeast-5": 0.2212, + "ap-southeast-7": 0.092, + "ca-central-1": 0.138, + "ca-west-1": 0.138, + "eu-central-1": 0.244, + "eu-central-2": 0.2592, + "eu-north-1": 0.134, + "eu-south-1": 0.24, + "eu-west-1": 0.233, + "eu-west-2": 0.092, + "eu-west-3": 0.092, + "il-central-1": 0.14805, + "me-central-1": 0.1551, + "me-south-1": 0.1551, + "mx-central-1": 0.092, + "sa-east-1": 0.293, + "us-east-1": 0.1386, + "us-east-2": 0.0, + "us-gov-east-1": 0.092, + "us-gov-west-1": 0.243, + "us-west-1": 0.092, + "us-west-2": 0.218 + }, + "r6i.xlarge": { + "af-south-1": 0.52, + "ap-east-1": 0.334, + "ap-northeast-1": 0.184, + "ap-northeast-2": 0.184, + "ap-northeast-3": 0.488, + "ap-south-1": 0.444, + "ap-south-2": 0.26, + "ap-southeast-1": 0.304, + "ap-southeast-2": 0.184, + "ap-southeast-5": 0.184, + "ap-southeast-7": 0.28424, + "ca-central-1": 0.46, + "ca-west-1": 0.0, + "eu-central-1": 0.0, + "eu-central-2": 0.184, + "eu-north-1": 0.184, + "eu-south-1": 0.3256, + "eu-west-1": 0.3102, + "eu-west-2": 0.184, + "eu-west-3": 0.48, + "il-central-1": 0.184, + "me-central-1": 0.184, + "me-south-1": 0.184, + "mx-central-1": 0.2646, + "sa-east-1": 0.0, + "us-east-1": 0.436, + "us-east-2": 0.252, + "us-gov-east-1": 0.184, + "us-gov-west-1": 0.302, + "us-west-1": 0.28, + "us-west-2": 0.252 + }, + "r6i.metal": { + "af-south-1": 10.752, + "ap-east-1": 5.888, + "ap-northeast-1": 15.616, + "ap-northeast-2": 15.616, + "ap-northeast-3": 15.616, + "ap-south-1": 5.888, + "ap-south-2": 8.32, + "ap-southeast-1": 9.728, + "ap-southeast-2": 9.664, + "ap-southeast-5": 14.1568, + "ap-southeast-7": 14.1568, + "ca-central-1": 8.832, + "ca-west-1": 5.888, + "eu-central-1": 15.616, + "eu-central-2": 10.7008, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 5.888, + "eu-west-2": 9.472, + "eu-west-3": 5.888, + "il-central-1": 9.4752, + "me-central-1": 9.9264, + "me-south-1": 15.8144, + "mx-central-1": 5.888, + "sa-east-1": 5.888, + "us-east-1": 13.952, + "us-east-2": 0.0, + "us-gov-east-1": 5.888, + "us-gov-west-1": 0.0, + "us-west-1": 8.96, + "us-west-2": 8.064 + }, + "r6i.2xlarge": { + "af-south-1": 0.7392, + "ap-east-1": 0.368, + "ap-northeast-1": 0.608, + "ap-northeast-2": 0.976, + "ap-northeast-3": 0.6688, + "ap-south-1": 0.888, + "ap-south-2": 0.94, + "ap-southeast-1": 0.976, + "ap-southeast-2": 0.972, + "ap-southeast-5": 0.5168, + "ap-southeast-7": 0.8848, + "ca-central-1": 0.552, + "ca-west-1": 0.552, + "eu-central-1": 0.0, + "eu-central-2": 0.6688, + "eu-north-1": 0.536, + "eu-south-1": 0.368, + "eu-west-1": 0.9884, + "eu-west-2": 0.368, + "eu-west-3": 0.592, + "il-central-1": 0.5922, + "me-central-1": 0.9884, + "me-south-1": 0.9884, + "mx-central-1": 0.368, + "sa-east-1": 0.804, + "us-east-1": 0.9224, + "us-east-2": 0.0, + "us-gov-east-1": 0.972, + "us-gov-west-1": 0.368, + "us-west-1": 0.368, + "us-west-2": 0.872 + }, + "r6i.4xlarge": { + "af-south-1": 2.08, + "ap-east-1": 0.736, + "ap-northeast-1": 1.3376, + "ap-northeast-2": 1.3376, + "ap-northeast-3": 0.736, + "ap-south-1": 1.144, + "ap-south-2": 0.736, + "ap-southeast-1": 1.216, + "ap-southeast-2": 1.208, + "ap-southeast-5": 0.0, + "ap-southeast-7": 1.7696, + "ca-central-1": 0.736, + "ca-west-1": 1.104, + "eu-central-1": 0.736, + "eu-central-2": 2.0736, + "eu-north-1": 1.1792, + "eu-south-1": 1.92, + "eu-west-1": 0.736, + "eu-west-2": 1.92, + "eu-west-3": 1.92, + "il-central-1": 0.736, + "me-central-1": 0.736, + "me-south-1": 1.9768, + "mx-central-1": 0.736, + "sa-east-1": 2.344, + "us-east-1": 1.8448, + "us-east-2": 1.008, + "us-gov-east-1": 1.208, + "us-gov-west-1": 2.0648, + "us-west-1": 1.856, + "us-west-2": 0.736 + }, + "r6i.8xlarge": { + "af-south-1": 1.472, + "ap-east-1": 2.9392, + "ap-northeast-1": 3.904, + "ap-northeast-2": 2.432, + "ap-northeast-3": 1.472, + "ap-south-1": 1.472, + "ap-south-2": 3.552, + "ap-southeast-1": 2.432, + "ap-southeast-2": 2.416, + "ap-southeast-5": 2.0672, + "ap-southeast-7": 1.472, + "ca-central-1": 1.472, + "ca-west-1": 3.68, + "eu-central-1": 3.904, + "eu-central-2": 1.472, + "eu-north-1": 2.144, + "eu-south-1": 2.368, + "eu-west-1": 2.256, + "eu-west-2": 2.368, + "eu-west-3": 3.84, + "il-central-1": 2.3688, + "me-central-1": 2.4816, + "me-south-1": 2.4816, + "mx-central-1": 2.32848, + "sa-east-1": 1.472, + "us-east-1": 3.6896, + "us-east-2": 3.488, + "us-gov-east-1": 2.416, + "us-gov-west-1": 0.0, + "us-west-1": 2.24, + "us-west-2": 2.016 + }, + "r6i.12xlarge": { + "af-south-1": 4.032, + "ap-east-1": 4.008, + "ap-northeast-1": 2.208, + "ap-northeast-2": 2.208, + "ap-northeast-3": 2.208, + "ap-south-1": 3.12, + "ap-south-2": 3.12, + "ap-southeast-1": 2.208, + "ap-southeast-2": 2.208, + "ap-southeast-5": 3.1008, + "ap-southeast-7": 5.3088, + "ca-central-1": 3.312, + "ca-west-1": 5.52, + "eu-central-1": 4.0128, + "eu-central-2": 2.208, + "eu-north-1": 3.5376, + "eu-south-1": 6.1152, + "eu-west-1": 5.592, + "eu-west-2": 5.76, + "eu-west-3": 3.552, + "il-central-1": 2.208, + "me-central-1": 2.208, + "me-south-1": 0.0, + "mx-central-1": 0.0, + "sa-east-1": 7.032, + "us-east-1": 3.024, + "us-east-2": 2.208, + "us-gov-east-1": 0.0, + "us-gov-west-1": 2.208, + "us-west-1": 2.208, + "us-west-2": 5.232 + }, + "r6i.16xlarge": { + "af-south-1": 8.32, + "ap-east-1": 5.344, + "ap-northeast-1": 7.808, + "ap-northeast-2": 7.808, + "ap-northeast-3": 5.3504, + "ap-south-1": 2.944, + "ap-south-2": 4.16, + "ap-southeast-1": 4.864, + "ap-southeast-2": 7.776, + "ap-southeast-5": 7.0784, + "ap-southeast-7": 4.1344, + "ca-central-1": 2.944, + "ca-west-1": 7.8016, + "eu-central-1": 2.944, + "eu-central-2": 8.82944, + "eu-north-1": 4.288, + "eu-south-1": 8.1536, + "eu-west-1": 2.944, + "eu-west-2": 5.2096, + "eu-west-3": 2.944, + "il-central-1": 7.6816, + "me-central-1": 4.9632, + "me-south-1": 0.0, + "mx-central-1": 7.1776, + "sa-east-1": 6.432, + "us-east-1": 4.032, + "us-east-2": 6.976, + "us-gov-east-1": 2.944, + "us-gov-west-1": 2.944, + "us-west-1": 7.424, + "us-west-2": 2.944 + }, + "r6i.24xlarge": { + "af-south-1": 12.48, + "ap-east-1": 8.016, + "ap-northeast-1": 11.712, + "ap-northeast-2": 7.296, + "ap-northeast-3": 0.0, + "ap-south-1": 4.416, + "ap-south-2": 4.416, + "ap-southeast-1": 12.4416, + "ap-southeast-2": 4.416, + "ap-southeast-5": 10.6176, + "ap-southeast-7": 6.2016, + "ca-central-1": 4.416, + "ca-west-1": 7.2864, + "eu-central-1": 4.416, + "eu-central-2": 12.4416, + "eu-north-1": 4.416, + "eu-south-1": 11.52, + "eu-west-1": 7.4448, + "eu-west-2": 7.104, + "eu-west-3": 4.416, + "il-central-1": 11.5224, + "me-central-1": 7.4448, + "me-south-1": 8.18928, + "mx-central-1": 11.40144, + "sa-east-1": 14.064, + "us-east-1": 4.416, + "us-east-2": 6.048, + "us-gov-east-1": 0.0, + "us-gov-west-1": 7.9728, + "us-west-1": 6.72, + "us-west-2": 6.048 + }, + "r6i.32xlarge": { + "af-south-1": 5.888, + "ap-east-1": 10.688, + "ap-northeast-1": 15.616, + "ap-northeast-2": 9.728, + "ap-northeast-3": 0.0, + "ap-south-1": 5.888, + "ap-south-2": 5.888, + "ap-southeast-1": 15.616, + "ap-southeast-2": 5.888, + "ap-southeast-5": 14.1568, + "ap-southeast-7": 0.0, + "ca-central-1": 5.888, + "ca-west-1": 8.832, + "eu-central-1": 5.888, + "eu-central-2": 10.7008, + "eu-north-1": 14.464, + "eu-south-1": 9.472, + "eu-west-1": 5.888, + "eu-west-2": 15.36, + "eu-west-3": 0.0, + "il-central-1": 5.888, + "me-central-1": 15.8144, + "me-south-1": 9.9264, + "mx-central-1": 14.3552, + "sa-east-1": 12.864, + "us-east-1": 13.952, + "us-east-2": 8.064, + "us-gov-east-1": 5.888, + "us-gov-west-1": 15.552, + "us-west-1": 8.96, + "us-west-2": 5.888 + }, + "r6id.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.2737, + "ap-south-1": 0.092, + "ap-southeast-1": 0.1827, + "ap-southeast-2": 0.174, + "ap-southeast-5": 0.0, + "ap-southeast-7": 0.0, + "ca-west-1": 0.27449, + "eu-central-1": 0.27365, + "eu-west-1": 0.168, + "eu-west-2": 0.092, + "il-central-1": 0.28604, + "mx-central-1": 0.092, + "us-east-1": 0.2432, + "us-east-2": 0.2432, + "us-gov-west-1": 0.1817, + "us-west-2": 0.0 + }, + "r6id.xlarge": { + "ap-northeast-1": 0.5494, + "ap-northeast-2": 0.184, + "ap-south-1": 0.184, + "ap-southeast-1": 0.184, + "ap-southeast-2": 0.184, + "ap-southeast-5": 0.184, + "ap-southeast-7": 0.0, + "ca-west-1": 0.5158, + "eu-central-1": 0.3633, + "eu-west-1": 0.0, + "eu-west-2": 0.184, + "il-central-1": 0.3528, + "mx-central-1": 0.184, + "us-east-1": 0.3024, + "us-east-2": 0.184, + "us-gov-west-1": 0.5474, + "us-west-2": 0.4864 + }, + "r6id.metal": { + "ap-northeast-1": 17.5808, + "ap-northeast-2": 17.5168, + "ap-south-1": 10.1504, + "ap-southeast-1": 5.888, + "ap-southeast-2": 5.888, + "ap-southeast-5": 15.82656, + "ap-southeast-7": 15.82656, + "ca-west-1": 5.888, + "eu-central-1": 11.6256, + "eu-west-1": 16.64, + "eu-west-2": 11.3568, + "il-central-1": 5.888, + "mx-central-1": 0.0, + "us-east-1": 9.6768, + "us-east-2": 9.6768, + "us-gov-west-1": 17.5168, + "us-west-2": 9.6768 + }, + "r6id.2xlarge": { + "ap-northeast-1": 0.368, + "ap-northeast-2": 1.0948, + "ap-south-1": 0.368, + "ap-southeast-1": 0.7308, + "ap-southeast-2": 0.0, + "ap-southeast-5": 0.368, + "ap-southeast-7": 0.98916, + "ca-west-1": 0.368, + "eu-central-1": 0.368, + "eu-west-1": 0.672, + "eu-west-2": 1.0778, + "il-central-1": 0.7056, + "mx-central-1": 0.368, + "us-east-1": 0.66528, + "us-east-2": 0.6048, + "us-gov-west-1": 1.0948, + "us-west-2": 0.6048 + }, + "r6id.4xlarge": { + "ap-northeast-1": 0.736, + "ap-northeast-2": 0.0, + "ap-south-1": 0.736, + "ap-southeast-1": 1.60776, + "ap-southeast-2": 0.736, + "ap-southeast-5": 0.736, + "ap-southeast-7": 0.0, + "ca-west-1": 0.736, + "eu-central-1": 0.736, + "eu-west-1": 2.08, + "eu-west-2": 2.1556, + "il-central-1": 0.0, + "mx-central-1": 1.27008, + "us-east-1": 1.2096, + "us-east-2": 1.2096, + "us-gov-west-1": 0.736, + "us-west-2": 1.9456 + }, + "r6id.8xlarge": { + "ap-northeast-1": 2.9232, + "ap-northeast-2": 1.472, + "ap-south-1": 1.472, + "ap-southeast-1": 4.3952, + "ap-southeast-2": 4.256, + "ap-southeast-5": 3.95664, + "ap-southeast-7": 2.48464, + "ca-west-1": 2.6544, + "eu-central-1": 1.472, + "eu-west-1": 2.688, + "eu-west-2": 2.8392, + "il-central-1": 1.472, + "mx-central-1": 2.54016, + "us-east-1": 0.0, + "us-east-2": 3.8912, + "us-gov-west-1": 2.9072, + "us-west-2": 2.4192 + }, + "r6id.12xlarge": { + "ap-northeast-1": 2.208, + "ap-northeast-2": 6.5688, + "ap-south-1": 2.208, + "ap-southeast-1": 7.03128, + "ap-southeast-2": 6.384, + "ap-southeast-5": 0.0, + "ap-southeast-7": 3.72696, + "ca-west-1": 4.37976, + "eu-central-1": 4.3596, + "eu-west-1": 6.24, + "eu-west-2": 2.208, + "il-central-1": 2.208, + "mx-central-1": 3.81024, + "us-east-1": 3.6288, + "us-east-2": 0.0, + "us-gov-west-1": 2.208, + "us-west-2": 2.208 + }, + "r6id.16xlarge": { + "ap-northeast-1": 2.944, + "ap-northeast-2": 5.8144, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 5.568, + "ap-southeast-5": 7.91328, + "ap-southeast-7": 7.91328, + "ca-west-1": 8.2528, + "eu-central-1": 5.8128, + "eu-west-1": 5.376, + "eu-west-2": 8.6224, + "il-central-1": 5.6448, + "mx-central-1": 0.0, + "us-east-1": 4.8384, + "us-east-2": 2.944, + "us-gov-west-1": 8.7584, + "us-west-2": 5.32224 + }, + "r6id.24xlarge": { + "ap-northeast-1": 4.416, + "ap-northeast-2": 4.416, + "ap-south-1": 0.0, + "ap-southeast-1": 8.7696, + "ap-southeast-2": 4.416, + "ap-southeast-5": 11.86992, + "ap-southeast-7": 7.45392, + "ca-west-1": 4.416, + "eu-central-1": 4.416, + "eu-west-1": 8.064, + "eu-west-2": 12.9336, + "il-central-1": 8.4672, + "mx-central-1": 12.03648, + "us-east-1": 4.416, + "us-east-2": 7.2576, + "us-gov-west-1": 8.7216, + "us-west-2": 11.6736 + }, + "r6id.32xlarge": { + "ap-northeast-1": 17.5808, + "ap-northeast-2": 17.5168, + "ap-south-1": 10.1504, + "ap-southeast-1": 17.5808, + "ap-southeast-2": 17.024, + "ap-southeast-5": 9.93856, + "ap-southeast-7": 5.888, + "ca-west-1": 10.6176, + "eu-central-1": 11.6256, + "eu-west-1": 5.888, + "eu-west-2": 11.3568, + "il-central-1": 17.1776, + "mx-central-1": 16.04864, + "us-east-1": 15.5648, + "us-east-2": 9.6768, + "us-gov-west-1": 0.0, + "us-west-2": 5.888 + }, + "r6idn.large": { + "ap-northeast-1": 0.23751, + "ap-southeast-1": 0.092, + "ap-southeast-2": 0.23868, + "eu-central-1": 0.32483, + "eu-north-1": 0.20709, + "eu-west-1": 0.30962, + "us-east-1": 0.28739, + "us-east-2": 0.092, + "us-gov-west-1": 0.23517, + "us-west-2": 0.30693 + }, + "r6idn.xlarge": { + "ap-northeast-1": 0.184, + "ap-southeast-1": 0.468, + "ap-southeast-2": 0.7091, + "eu-central-1": 0.64966, + "eu-north-1": 0.184, + "eu-west-1": 0.184, + "us-east-1": 0.57478, + "us-east-2": 0.184, + "us-gov-west-1": 0.184, + "us-west-2": 0.61386 + }, + "r6idn.metal": { + "ap-northeast-1": 5.888, + "ap-southeast-1": 14.976, + "ap-southeast-2": 21.16352, + "eu-central-1": 14.90112, + "eu-north-1": 5.888, + "eu-west-1": 5.888, + "us-east-1": 12.50496, + "us-east-2": 12.50496, + "us-gov-west-1": 20.93888, + "us-west-2": 5.888 + }, + "r6idn.2xlarge": { + "ap-northeast-1": 0.95004, + "ap-southeast-1": 0.936, + "ap-southeast-2": 0.95472, + "eu-central-1": 0.368, + "eu-north-1": 1.19636, + "eu-west-1": 1.23848, + "us-east-1": 1.14956, + "us-east-2": 0.368, + "us-gov-west-1": 0.368, + "us-west-2": 0.78156 + }, + "r6idn.4xlarge": { + "ap-northeast-1": 2.63608, + "ap-southeast-1": 1.872, + "ap-southeast-2": 1.90944, + "eu-central-1": 0.736, + "eu-north-1": 2.39272, + "eu-west-1": 2.47696, + "us-east-1": 0.736, + "us-east-2": 0.736, + "us-gov-west-1": 1.88136, + "us-west-2": 1.56312 + }, + "r6idn.8xlarge": { + "ap-northeast-1": 3.80016, + "ap-southeast-1": 5.216, + "ap-southeast-2": 1.472, + "eu-central-1": 0.0, + "eu-north-1": 3.31344, + "eu-west-1": 5.30211, + "us-east-1": 3.12624, + "us-east-2": 1.472, + "us-gov-west-1": 1.472, + "us-west-2": 1.472 + }, + "r6idn.12xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 5.616, + "ap-southeast-2": 5.72832, + "eu-central-1": 5.58792, + "eu-north-1": 4.97016, + "eu-west-1": 7.43088, + "us-east-1": 4.68936, + "us-east-2": 4.68936, + "us-gov-west-1": 5.64408, + "us-west-2": 2.208 + }, + "r6idn.16xlarge": { + "ap-northeast-1": 2.944, + "ap-southeast-1": 7.488, + "ap-southeast-2": 11.34554, + "eu-central-1": 7.45056, + "eu-north-1": 6.62688, + "eu-west-1": 2.944, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-west-1": 8.27798, + "us-west-2": 2.944 + }, + "r6idn.24xlarge": { + "ap-northeast-1": 4.416, + "ap-southeast-1": 16.7712, + "ap-southeast-2": 4.416, + "eu-central-1": 4.416, + "eu-north-1": 14.35632, + "eu-west-1": 14.86176, + "us-east-1": 0.0, + "us-east-2": 9.37872, + "us-gov-west-1": 11.28816, + "us-west-2": 9.37872 + }, + "r6idn.32xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 20.864, + "ap-southeast-2": 5.888, + "eu-central-1": 14.90112, + "eu-north-1": 5.888, + "eu-west-1": 5.888, + "us-east-1": 0.0, + "us-east-2": 18.39296, + "us-gov-west-1": 15.05088, + "us-west-2": 12.50496 + }, + "r6in.large": { + "ap-northeast-1": 0.30377, + "ap-southeast-1": 0.20826, + "ap-southeast-2": 0.092, + "eu-central-1": 0.092, + "eu-north-1": 0.27803, + "eu-west-1": 0.28739, + "us-east-1": 0.092, + "us-east-2": 0.092, + "us-gov-west-1": 0.092, + "us-west-2": 0.092 + }, + "r6in.xlarge": { + "ap-northeast-1": 0.42354, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.64989, + "eu-central-1": 0.41652, + "eu-north-1": 0.55606, + "eu-west-1": 0.0, + "us-east-1": 0.184, + "us-east-2": 0.53266, + "us-gov-west-1": 0.41886, + "us-west-2": 0.184 + }, + "r6in.metal": { + "ap-northeast-1": 19.44128, + "ap-southeast-1": 13.32864, + "ap-southeast-2": 5.888, + "eu-central-1": 19.21664, + "eu-north-1": 5.888, + "eu-west-1": 18.39296, + "us-east-1": 0.0, + "us-east-2": 17.04512, + "us-gov-west-1": 13.40352, + "us-west-2": 11.15712 + }, + "r6in.2xlarge": { + "ap-northeast-1": 0.0, + "ap-southeast-1": 0.368, + "ap-southeast-2": 0.84708, + "eu-central-1": 0.83304, + "eu-north-1": 1.11212, + "eu-west-1": 0.0, + "us-east-1": 0.368, + "us-east-2": 1.06532, + "us-gov-west-1": 0.83772, + "us-west-2": 0.368 + }, + "r6in.4xlarge": { + "ap-northeast-1": 1.69416, + "ap-southeast-1": 1.66608, + "ap-southeast-2": 2.43016, + "eu-central-1": 1.83269, + "eu-north-1": 0.736, + "eu-west-1": 1.56312, + "us-east-1": 0.0, + "us-east-2": 2.13064, + "us-gov-west-1": 1.67544, + "us-west-2": 2.13064 + }, + "r6in.8xlarge": { + "ap-northeast-1": 4.86032, + "ap-southeast-1": 3.33216, + "ap-southeast-2": 3.38832, + "eu-central-1": 4.80416, + "eu-north-1": 4.44848, + "eu-west-1": 4.91086, + "us-east-1": 0.0, + "us-east-2": 4.26128, + "us-gov-west-1": 1.472, + "us-west-2": 2.78928 + }, + "r6in.12xlarge": { + "ap-northeast-1": 7.29048, + "ap-southeast-1": 2.208, + "ap-southeast-2": 5.08248, + "eu-central-1": 2.208, + "eu-north-1": 4.46472, + "eu-west-1": 2.208, + "us-east-1": 4.18392, + "us-east-2": 4.60231, + "us-gov-west-1": 5.02632, + "us-west-2": 4.18392 + }, + "r6in.16xlarge": { + "ap-northeast-1": 10.3983, + "ap-southeast-1": 6.66432, + "ap-southeast-2": 6.77664, + "eu-central-1": 6.66432, + "eu-north-1": 8.89696, + "eu-west-1": 6.25248, + "us-east-1": 0.0, + "us-east-2": 6.13642, + "us-gov-west-1": 9.64576, + "us-west-2": 8.52256 + }, + "r6in.24xlarge": { + "ap-northeast-1": 10.16496, + "ap-southeast-1": 14.41248, + "ap-southeast-2": 4.416, + "eu-central-1": 0.0, + "eu-north-1": 13.34544, + "eu-west-1": 4.416, + "us-east-1": 4.416, + "us-east-2": 13.62062, + "us-gov-west-1": 10.05264, + "us-west-2": 4.416 + }, + "r6in.32xlarge": { + "ap-northeast-1": 13.55328, + "ap-southeast-1": 13.32864, + "ap-southeast-2": 5.888, + "eu-central-1": 5.888, + "eu-north-1": 11.90592, + "eu-west-1": 18.39296, + "us-east-1": 17.04512, + "us-east-2": 5.888, + "us-gov-west-1": 13.40352, + "us-west-2": 11.15712 + }, + "r7a.medium": { + "ap-northeast-1": 0.09177, + "eu-central-1": 0.0, + "eu-north-1": 0.046, + "eu-south-2": 0.0, + "eu-west-1": 0.08513, + "us-east-1": 0.07608, + "us-east-2": 0.0, + "us-west-2": 0.046 + }, + "r7a.large": { + "ap-northeast-1": 0.092, + "eu-central-1": 0.27554, + "eu-north-1": 0.092, + "eu-south-2": 0.092, + "eu-west-1": 0.17026, + "us-east-1": 0.24415, + "us-east-2": 0.15215, + "us-west-2": 0.092 + }, + "r7a.xlarge": { + "ap-northeast-1": 0.40379, + "eu-central-1": 0.0, + "eu-north-1": 0.3236, + "eu-south-2": 0.55857, + "eu-west-1": 0.184, + "us-east-1": 0.184, + "us-east-2": 0.4883, + "us-west-2": 0.184 + }, + "r7a.metal-48xl": { + "ap-northeast-1": 26.45184, + "eu-central-1": 17.61984, + "eu-north-1": 15.5328, + "eu-south-2": 0.0, + "eu-west-1": 16.34496, + "us-east-1": 14.6064, + "us-east-2": 23.4384, + "us-west-2": 14.6064 + }, + "r7a.2xlarge": { + "ap-northeast-1": 0.0, + "eu-central-1": 1.10216, + "eu-north-1": 0.368, + "eu-south-2": 0.68104, + "eu-west-1": 1.11714, + "us-east-1": 0.9766, + "us-east-2": 0.368, + "us-west-2": 1.03746 + }, + "r7a.4xlarge": { + "ap-northeast-1": 0.736, + "eu-central-1": 2.20432, + "eu-north-1": 1.2944, + "eu-south-2": 2.23429, + "eu-west-1": 1.36208, + "us-east-1": 1.2172, + "us-east-2": 1.9532, + "us-west-2": 1.9532 + }, + "r7a.8xlarge": { + "ap-northeast-1": 1.472, + "eu-central-1": 2.93664, + "eu-north-1": 1.472, + "eu-south-2": 2.72416, + "eu-west-1": 4.19616, + "us-east-1": 3.9064, + "us-east-2": 3.9064, + "us-west-2": 1.472 + }, + "r7a.12xlarge": { + "ap-northeast-1": 4.40496, + "eu-central-1": 4.40496, + "eu-north-1": 4.27152, + "eu-south-2": 6.29424, + "eu-west-1": 0.0, + "us-east-1": 5.8596, + "us-east-2": 5.8596, + "us-west-2": 2.208 + }, + "r7a.16xlarge": { + "ap-northeast-1": 5.87328, + "eu-central-1": 8.81728, + "eu-north-1": 8.1216, + "eu-south-2": 5.44832, + "eu-west-1": 8.39232, + "us-east-1": 7.8128, + "us-east-2": 2.944, + "us-west-2": 7.8128 + }, + "r7a.24xlarge": { + "ap-northeast-1": 8.80992, + "eu-central-1": 8.80992, + "eu-north-1": 4.416, + "eu-south-2": 0.0, + "eu-west-1": 8.17248, + "us-east-1": 12.44952, + "us-east-2": 11.7192, + "us-west-2": 0.0 + }, + "r7a.32xlarge": { + "ap-northeast-1": 5.888, + "eu-central-1": 17.63456, + "eu-north-1": 16.2432, + "eu-south-2": 16.78464, + "eu-west-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 5.888, + "us-west-2": 16.59936 + }, + "r7a.48xlarge": { + "ap-northeast-1": 17.61984, + "eu-central-1": 26.45184, + "eu-north-1": 15.5328, + "eu-south-2": 16.34496, + "eu-west-1": 25.17696, + "us-east-1": 14.6064, + "us-east-2": 14.6064, + "us-west-2": 8.832 + }, + "r7i.large": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.092, + "ap-south-1": 0.0, + "ap-southeast-1": 0.092, + "ap-southeast-2": 0.15855, + "ap-southeast-3": 0.2516, + "ap-southeast-5": 0.22766, + "ap-southeast-7": 0.22766, + "ca-central-1": 0.15939, + "eu-central-1": 0.17556, + "eu-north-1": 0.092, + "eu-south-1": 0.1554, + "eu-south-2": 0.24005, + "eu-west-1": 0.24005, + "eu-west-2": 0.2474, + "eu-west-3": 0.0, + "mx-central-1": 0.23092, + "sa-east-1": 0.21105, + "us-east-1": 0.092, + "us-east-2": 0.092, + "us-gov-east-1": 0.15855, + "us-gov-west-1": 0.25055, + "us-west-1": 0.239, + "us-west-2": 0.092 + }, + "r7i.xlarge": { + "ap-northeast-1": 0.5032, + "ap-northeast-2": 0.5032, + "ap-south-1": 0.184, + "ap-southeast-1": 0.53512, + "ap-southeast-2": 0.5011, + "ap-southeast-3": 0.5032, + "ap-southeast-5": 0.29845, + "ap-southeast-7": 0.27132, + "ca-central-1": 0.2898, + "eu-central-1": 0.5032, + "eu-north-1": 0.2814, + "eu-south-1": 0.3108, + "eu-south-2": 0.184, + "eu-west-1": 0.0, + "eu-west-2": 0.4948, + "eu-west-3": 0.0, + "mx-central-1": 0.46184, + "sa-east-1": 0.64831, + "us-east-1": 0.47506, + "us-east-2": 0.0, + "us-gov-east-1": 0.3171, + "us-gov-west-1": 0.3171, + "us-west-1": 0.478, + "us-west-2": 0.0 + }, + "r7i.metal-24xl": { + "ap-northeast-1": 12.0768, + "ap-northeast-2": 12.84288, + "ap-south-1": 4.416, + "ap-southeast-1": 12.0768, + "ap-southeast-2": 12.0264, + "ap-southeast-3": 12.0768, + "ap-southeast-5": 10.92768, + "ap-southeast-7": 10.92768, + "ca-central-1": 12.06672, + "eu-central-1": 8.42688, + "eu-north-1": 0.0, + "eu-south-1": 11.8752, + "eu-south-2": 7.1064, + "eu-west-1": 0.0, + "eu-west-2": 4.416, + "eu-west-3": 11.8752, + "mx-central-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 10.7664, + "us-east-2": 10.7664, + "us-gov-east-1": 12.0264, + "us-gov-west-1": 12.0264, + "us-west-1": 7.056, + "us-west-2": 0.0 + }, + "r7i.metal-48xl": { + "ap-northeast-1": 15.3216, + "ap-northeast-2": 8.832, + "ap-south-1": 0.0, + "ap-southeast-1": 15.3216, + "ap-southeast-2": 0.0, + "ap-southeast-3": 15.3216, + "ap-southeast-5": 21.85536, + "ap-southeast-7": 13.02336, + "ca-central-1": 13.9104, + "eu-central-1": 24.1536, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 14.2128, + "eu-west-1": 14.2128, + "eu-west-2": 23.7504, + "eu-west-3": 14.9184, + "mx-central-1": 13.33632, + "sa-east-1": 29.0928, + "us-east-1": 8.832, + "us-east-2": 21.5328, + "us-gov-east-1": 15.2208, + "us-gov-west-1": 8.832, + "us-west-1": 22.944, + "us-west-2": 8.832 + }, + "r7i.2xlarge": { + "ap-northeast-1": 0.6384, + "ap-northeast-2": 0.0, + "ap-south-1": 0.914, + "ap-southeast-1": 1.07024, + "ap-southeast-2": 0.6342, + "ap-southeast-3": 0.368, + "ap-southeast-5": 0.368, + "ap-southeast-7": 0.54264, + "ca-central-1": 0.9476, + "eu-central-1": 0.6384, + "eu-north-1": 0.0, + "eu-south-1": 0.9896, + "eu-south-2": 0.5922, + "eu-west-1": 0.9602, + "eu-west-2": 0.368, + "eu-west-3": 0.368, + "mx-central-1": 0.368, + "sa-east-1": 0.368, + "us-east-1": 0.0, + "us-east-2": 0.5292, + "us-gov-east-1": 0.368, + "us-gov-west-1": 0.368, + "us-west-1": 0.368, + "us-west-2": 0.5292 + }, + "r7i.4xlarge": { + "ap-northeast-1": 2.14048, + "ap-northeast-2": 0.0, + "ap-south-1": 1.9372, + "ap-southeast-1": 2.0128, + "ap-southeast-2": 2.0044, + "ap-southeast-3": 2.0128, + "ap-southeast-5": 1.19381, + "ap-southeast-7": 1.82128, + "ca-central-1": 1.1592, + "eu-central-1": 0.736, + "eu-north-1": 1.1256, + "eu-south-1": 0.0, + "eu-south-2": 1.9204, + "eu-west-1": 1.9204, + "eu-west-2": 1.9792, + "eu-west-3": 0.736, + "mx-central-1": 1.84736, + "sa-east-1": 0.0, + "us-east-1": 1.7944, + "us-east-2": 0.736, + "us-gov-east-1": 0.736, + "us-gov-west-1": 1.2684, + "us-west-1": 1.912, + "us-west-2": 0.736 + }, + "r7i.8xlarge": { + "ap-northeast-1": 2.5536, + "ap-northeast-2": 4.0256, + "ap-south-1": 2.184, + "ap-southeast-1": 0.0, + "ap-southeast-2": 1.472, + "ap-southeast-3": 4.28096, + "ap-southeast-5": 1.472, + "ap-southeast-7": 2.17056, + "ca-central-1": 2.3184, + "eu-central-1": 1.472, + "eu-north-1": 2.2512, + "eu-south-1": 1.472, + "eu-south-2": 1.472, + "eu-west-1": 3.8408, + "eu-west-2": 3.9584, + "eu-west-3": 0.0, + "mx-central-1": 1.472, + "sa-east-1": 4.8488, + "us-east-1": 3.5888, + "us-east-2": 1.472, + "us-gov-east-1": 4.26248, + "us-gov-west-1": 1.472, + "us-west-1": 1.472, + "us-west-2": 2.1168 + }, + "r7i.12xlarge": { + "ap-northeast-1": 4.21344, + "ap-northeast-2": 2.208, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 6.0132, + "ap-southeast-3": 3.8304, + "ap-southeast-5": 5.46384, + "ap-southeast-7": 2.208, + "ca-central-1": 5.6856, + "eu-central-1": 6.0384, + "eu-north-1": 5.5848, + "eu-south-1": 4.10256, + "eu-south-2": 5.7612, + "eu-west-1": 2.208, + "eu-west-2": 3.7296, + "eu-west-3": 3.7296, + "mx-central-1": 2.208, + "sa-east-1": 5.0652, + "us-east-1": 2.208, + "us-east-2": 5.3832, + "us-gov-east-1": 2.208, + "us-gov-west-1": 3.8052, + "us-west-1": 3.528, + "us-west-2": 5.3832 + }, + "r7i.16xlarge": { + "ap-northeast-1": 5.1072, + "ap-northeast-2": 8.0512, + "ap-south-1": 2.944, + "ap-southeast-1": 5.1072, + "ap-southeast-2": 5.0736, + "ap-southeast-3": 5.61792, + "ap-southeast-5": 7.71923, + "ap-southeast-7": 4.34112, + "ca-central-1": 7.5808, + "eu-central-1": 5.1072, + "eu-north-1": 0.0, + "eu-south-1": 8.41408, + "eu-south-2": 5.21136, + "eu-west-1": 2.944, + "eu-west-2": 2.944, + "eu-west-3": 4.9728, + "mx-central-1": 4.44544, + "sa-east-1": 10.37296, + "us-east-1": 4.2336, + "us-east-2": 7.60096, + "us-gov-east-1": 5.0736, + "us-gov-west-1": 5.0736, + "us-west-1": 2.944, + "us-west-2": 2.944 + }, + "r7i.24xlarge": { + "ap-northeast-1": 4.416, + "ap-northeast-2": 12.0768, + "ap-south-1": 10.968, + "ap-southeast-1": 4.416, + "ap-southeast-2": 12.0264, + "ap-southeast-3": 7.6608, + "ap-southeast-5": 6.51168, + "ap-southeast-7": 10.92768, + "ca-central-1": 4.416, + "eu-central-1": 8.42688, + "eu-north-1": 11.1696, + "eu-south-1": 7.4592, + "eu-south-2": 0.0, + "eu-west-1": 7.1064, + "eu-west-2": 11.8752, + "eu-west-3": 11.8752, + "mx-central-1": 4.416, + "sa-east-1": 14.5464, + "us-east-1": 4.416, + "us-east-2": 11.40144, + "us-gov-east-1": 7.6104, + "us-gov-west-1": 12.0264, + "us-west-1": 11.472, + "us-west-2": 10.7664 + }, + "r7i.48xlarge": { + "ap-northeast-1": 8.832, + "ap-northeast-2": 15.3216, + "ap-south-1": 13.104, + "ap-southeast-1": 0.0, + "ap-southeast-2": 15.2208, + "ap-southeast-3": 15.3216, + "ap-southeast-5": 21.85536, + "ap-southeast-7": 21.85536, + "ca-central-1": 22.7424, + "eu-central-1": 8.832, + "eu-north-1": 8.832, + "eu-south-1": 23.7504, + "eu-south-2": 14.2128, + "eu-west-1": 23.0448, + "eu-west-2": 14.9184, + "eu-west-3": 23.7504, + "mx-central-1": 13.33632, + "sa-east-1": 29.0928, + "us-east-1": 21.5328, + "us-east-2": 8.832, + "us-gov-east-1": 8.832, + "us-gov-west-1": 8.832, + "us-west-1": 14.112, + "us-west-2": 12.7008 + }, + "r7iz.large": { + "ap-northeast-1": 0.2497, + "eu-central-1": 0.092, + "eu-west-1": 0.092, + "us-east-1": 0.278, + "us-east-2": 0.0, + "us-west-2": 0.092 + }, + "r7iz.xlarge": { + "ap-northeast-1": 0.454, + "eu-central-1": 0.0, + "eu-west-1": 0.6416, + "us-east-1": 0.372, + "us-east-2": 0.4092, + "us-west-2": 0.556 + }, + "r7iz.metal-16xl": { + "ap-northeast-1": 2.944, + "eu-central-1": 0.0, + "eu-west-1": 9.6, + "us-east-1": 5.952, + "us-east-2": 2.944, + "us-west-2": 8.896 + }, + "r7iz.metal-32xl": { + "ap-northeast-1": 0.0, + "eu-central-1": 5.888, + "eu-west-1": 5.888, + "us-east-1": 17.792, + "us-east-2": 17.792, + "us-west-2": 5.888 + }, + "r7iz.2xlarge": { + "ap-northeast-1": 0.908, + "eu-central-1": 0.368, + "eu-west-1": 0.832, + "us-east-1": 1.112, + "us-east-2": 0.368, + "us-west-2": 0.744 + }, + "r7iz.4xlarge": { + "ap-northeast-1": 2.552, + "eu-central-1": 0.736, + "eu-west-1": 2.5664, + "us-east-1": 1.488, + "us-east-2": 2.3728, + "us-west-2": 0.0 + }, + "r7iz.8xlarge": { + "ap-northeast-1": 1.472, + "eu-central-1": 5.072, + "eu-west-1": 4.8, + "us-east-1": 2.976, + "us-east-2": 4.7456, + "us-west-2": 1.472 + }, + "r7iz.12xlarge": { + "ap-northeast-1": 7.656, + "eu-central-1": 8.148, + "eu-west-1": 7.2, + "us-east-1": 4.464, + "us-east-2": 6.672, + "us-west-2": 4.464 + }, + "r7iz.16xlarge": { + "ap-northeast-1": 10.208, + "eu-central-1": 7.2, + "eu-west-1": 7.3216, + "us-east-1": 8.896, + "us-east-2": 2.944, + "us-west-2": 5.952 + }, + "r7iz.32xlarge": { + "ap-northeast-1": 5.888, + "eu-central-1": 14.4, + "eu-west-1": 19.2, + "us-east-1": 11.904, + "us-east-2": 17.792, + "us-west-2": 5.888 + }, + "t1.micro": { + "ap-northeast-1": 0.033, + "ap-southeast-1": 0.02, + "ap-southeast-2": 0.02, + "eu-west-1": 0.02, + "sa-east-1": 0.027, + "us-east-1": 0.02, + "us-gov-west-1": 0.025, + "us-west-1": 0.025, + "us-west-2": 0.02 + }, + "t2.micro": { + "ap-northeast-1": 0.0152, + "ap-northeast-2": 0.0144, + "ap-northeast-3": 0.0152, + "ap-south-1": 0.0124, + "ap-southeast-1": 0.0146, + "ap-southeast-2": 0.0192, + "ca-central-1": 0.0174, + "eu-central-1": 0.0134, + "eu-west-1": 0.0172, + "eu-west-2": 0.0178, + "eu-west-3": 0.0178, + "sa-east-1": 0.0186, + "us-east-1": 0.0116, + "us-east-2": 0.0116, + "us-gov-west-1": 0.0136, + "us-west-1": 0.0184, + "us-west-2": 0.0162 + }, + "t2.small": { + "ap-northeast-1": 0.0304, + "ap-northeast-2": 0.038, + "ap-northeast-3": 0.0304, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0292, + "ap-southeast-2": 0.0384, + "ca-central-1": 0.0256, + "eu-central-1": 0.0268, + "eu-west-1": 0.034, + "eu-west-2": 0.0352, + "eu-west-3": 0.0356, + "sa-east-1": 0.0372, + "us-east-1": 0.023, + "us-east-2": 0.032, + "us-gov-west-1": 0.0364, + "us-west-1": 0.0368, + "us-west-2": 0.032 + }, + "t2.medium": { + "ap-northeast-1": 0.0788, + "ap-northeast-2": 0.0756, + "ap-northeast-3": 0.0788, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0584, + "ap-southeast-2": 0.0584, + "ca-central-1": 0.0512, + "eu-central-1": 0.0716, + "eu-west-1": 0.068, + "eu-west-2": 0.052, + "eu-west-3": 0.0, + "sa-east-1": 0.0744, + "us-east-1": 0.0464, + "us-east-2": 0.0464, + "us-gov-west-1": 0.0544, + "us-west-1": 0.0732, + "us-west-2": 0.0644 + }, + "t2.large": { + "ap-northeast-1": 0.1216, + "ap-northeast-2": 0.1432, + "ap-northeast-3": 0.1496, + "ap-south-1": 0.0, + "ap-southeast-1": 0.1448, + "ap-southeast-2": 0.1448, + "ca-central-1": 0.1024, + "eu-central-1": 0.1352, + "eu-west-1": 0.1288, + "eu-west-2": 0.1056, + "eu-west-3": 0.0, + "sa-east-1": 0.1488, + "us-east-1": 0.0928, + "us-east-2": 0.1208, + "us-gov-west-1": 0.1088, + "us-west-1": 0.1384, + "us-west-2": 0.1208 + }, + "t2.xlarge": { + "ap-northeast-1": 0.2432, + "ap-northeast-2": 0.2304, + "ap-northeast-3": 0.2842, + "ap-south-1": 0.1984, + "ap-southeast-1": 0.2336, + "ap-southeast-2": 0.2746, + "ca-central-1": 0.2458, + "eu-central-1": 0.2554, + "eu-west-1": 0.2426, + "eu-west-2": 0.2112, + "eu-west-3": 0.2112, + "sa-east-1": 0.2976, + "us-east-1": 0.2266, + "us-east-2": 0.1856, + "us-gov-west-1": 0.2586, + "us-west-1": 0.2618, + "us-west-2": 0.2266 + }, + "t2.nano": { + "ap-northeast-1": 0.0099, + "ap-northeast-2": 0.0072, + "ap-northeast-3": 0.0076, + "ap-south-1": 0.0062, + "ap-southeast-1": 0.0073, + "ap-southeast-2": 0.0096, + "ca-central-1": 0.0087, + "eu-central-1": 0.0067, + "eu-west-1": 0.0086, + "eu-west-2": 0.0066, + "eu-west-3": 0.0089, + "sa-east-1": 0.0093, + "us-east-1": 0.0058, + "us-east-2": 0.0058, + "us-gov-west-1": 0.0091, + "us-west-1": 0.0069, + "us-west-2": 0.0058 + }, + "t2.2xlarge": { + "ap-northeast-1": 0.4864, + "ap-northeast-2": 0.4608, + "ap-northeast-3": 0.4864, + "ap-south-1": 0.4588, + "ap-southeast-1": 0.5292, + "ap-southeast-2": 0.4672, + "ca-central-1": 0.4096, + "eu-central-1": 0.4288, + "eu-west-1": 0.4652, + "eu-west-2": 0.4224, + "eu-west-3": 0.0, + "sa-east-1": 0.5952, + "us-east-1": 0.4332, + "us-east-2": 0.3712, + "us-gov-west-1": 0.4972, + "us-west-1": 0.5036, + "us-west-2": 0.4332 + }, + "t3.micro": { + "af-south-1": 0.0092, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0228, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0092, + "ap-south-1": 0.0, + "ap-south-2": 0.0211, + "ap-southeast-1": 0.0132, + "ap-southeast-2": 0.0224, + "ap-southeast-3": 0.0092, + "ap-southeast-4": 0.0132, + "ap-southeast-5": 0.0119, + "ap-southeast-7": 0.0119, + "ca-central-1": 0.0092, + "ca-west-1": 0.0208, + "eu-central-1": 0.0212, + "eu-central-2": 0.0092, + "eu-north-1": 0.02, + "eu-south-1": 0.0219, + "eu-south-2": 0.0092, + "eu-west-1": 0.0114, + "eu-west-2": 0.0118, + "eu-west-3": 0.0092, + "il-central-1": 0.012, + "me-central-1": 0.0092, + "me-south-1": 0.0217, + "mx-central-1": 0.0109, + "sa-east-1": 0.0168, + "us-east-1": 0.0104, + "us-east-2": 0.0, + "us-gov-east-1": 0.0122, + "us-gov-west-1": 0.0092, + "us-west-1": 0.0225, + "us-west-2": 0.0196, + "us-west-2-lax-1": 0.0217 + }, + "t3.small": { + "af-south-1": 0.0471, + "ap-east-1": 0.0184, + "ap-northeast-1": 0.0456, + "ap-northeast-2": 0.0444, + "ap-northeast-3": 0.0456, + "ap-south-1": 0.0, + "ap-south-2": 0.0408, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0264, + "ap-southeast-3": 0.0264, + "ap-southeast-4": 0.0448, + "ap-southeast-5": 0.0422, + "ap-southeast-7": 0.0238, + "ca-central-1": 0.0, + "ca-west-1": 0.0416, + "eu-central-1": 0.0424, + "eu-central-2": 0.0264, + "eu-north-1": 0.04, + "eu-south-1": 0.0, + "eu-south-2": 0.0228, + "eu-west-1": 0.0243, + "eu-west-2": 0.0184, + "eu-west-3": 0.0184, + "il-central-1": 0.0, + "me-central-1": 0.0184, + "me-south-1": 0.0, + "mx-central-1": 0.0218, + "sa-east-1": 0.0, + "us-east-1": 0.0208, + "us-east-2": 0.0392, + "us-gov-east-1": 0.0428, + "us-gov-west-1": 0.0428, + "us-west-1": 0.0432, + "us-west-2": 0.0404, + "us-west-2-lax-1": 0.0434 + }, + "t3.medium": { + "af-south-1": 0.0184, + "ap-east-1": 0.0184, + "ap-northeast-1": 0.0728, + "ap-northeast-2": 0.0704, + "ap-northeast-3": 0.0728, + "ap-south-1": 0.0184, + "ap-south-2": 0.0659, + "ap-southeast-1": 0.0712, + "ap-southeast-2": 0.0184, + "ap-southeast-3": 0.0, + "ap-southeast-4": 0.0184, + "ap-southeast-5": 0.0659, + "ap-southeast-7": 0.0475, + "ca-central-1": 0.0, + "ca-west-1": 0.0464, + "eu-central-1": 0.048, + "eu-central-2": 0.0712, + "eu-north-1": 0.0, + "eu-south-1": 0.0663, + "eu-south-2": 0.0456, + "eu-west-1": 0.0487, + "eu-west-2": 0.0656, + "eu-west-3": 0.0184, + "il-central-1": 0.0663, + "me-central-1": 0.0686, + "me-south-1": 0.0686, + "mx-central-1": 0.0621, + "sa-east-1": 0.0856, + "us-east-1": 0.0, + "us-east-2": 0.0416, + "us-gov-east-1": 0.0672, + "us-gov-west-1": 0.0701, + "us-west-1": 0.0715, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0683 + }, + "t3.large": { + "af-south-1": 0.0, + "ap-east-1": 0.0, + "ap-northeast-1": 0.1088, + "ap-northeast-2": 0.104, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0, + "ap-south-2": 0.1172, + "ap-southeast-1": 0.0276, + "ap-southeast-2": 0.1332, + "ap-southeast-3": 0.0276, + "ap-southeast-4": 0.0, + "ap-southeast-5": 0.095, + "ap-southeast-7": 0.095, + "ca-central-1": 0.0, + "ca-west-1": 0.0928, + "eu-central-1": 0.0276, + "eu-central-2": 0.1056, + "eu-north-1": 0.0276, + "eu-south-1": 0.0276, + "eu-south-2": 0.0276, + "eu-west-1": 0.1188, + "eu-west-2": 0.0944, + "eu-west-3": 0.0, + "il-central-1": 0.1234, + "me-central-1": 0.0, + "me-south-1": 0.0, + "mx-central-1": 0.0874, + "sa-east-1": 0.0276, + "us-east-1": 0.0832, + "us-east-2": 0.0832, + "us-gov-east-1": 0.0276, + "us-gov-west-1": 0.0276, + "us-west-1": 0.0992, + "us-west-2": 0.1108, + "us-west-2-lax-1": 0.1274 + }, + "t3.xlarge": { + "af-south-1": 0.2906, + "ap-east-1": 0.0, + "ap-northeast-1": 0.2176, + "ap-northeast-2": 0.208, + "ap-northeast-3": 0.0, + "ap-south-1": 0.0736, + "ap-south-2": 0.1792, + "ap-southeast-1": 0.2112, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.2112, + "ap-southeast-4": 0.2848, + "ap-southeast-5": 0.2637, + "ap-southeast-7": 0.2637, + "ca-central-1": 0.2592, + "ca-west-1": 0.0736, + "eu-central-1": 0.0, + "eu-central-2": 0.2112, + "eu-north-1": 0.2464, + "eu-south-1": 0.0736, + "eu-south-2": 0.1824, + "eu-west-1": 0.256, + "eu-west-2": 0.1888, + "eu-west-3": 0.0736, + "il-central-1": 0.0, + "me-central-1": 0.2742, + "me-south-1": 0.0736, + "mx-central-1": 0.2483, + "sa-east-1": 0.0736, + "us-east-1": 0.1664, + "us-east-2": 0.0736, + "us-gov-east-1": 0.2688, + "us-gov-west-1": 0.0736, + "us-west-1": 0.272, + "us-west-2": 0.0736, + "us-west-2-lax-1": 0.2733 + }, + "t3.nano": { + "af-south-1": 0.0046, + "ap-east-1": 0.0, + "ap-northeast-1": 0.0, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0114, + "ap-south-1": 0.0046, + "ap-south-2": 0.0102, + "ap-southeast-1": 0.0066, + "ap-southeast-2": 0.0112, + "ap-southeast-3": 0.0112, + "ap-southeast-4": 0.0046, + "ap-southeast-5": 0.0105, + "ap-southeast-7": 0.0105, + "ca-central-1": 0.0104, + "ca-west-1": 0.0046, + "eu-central-1": 0.0046, + "eu-central-2": 0.0066, + "eu-north-1": 0.0046, + "eu-south-1": 0.0106, + "eu-south-2": 0.0046, + "eu-west-1": 0.0057, + "eu-west-2": 0.0105, + "eu-west-3": 0.0105, + "il-central-1": 0.006, + "me-central-1": 0.0063, + "me-south-1": 0.0109, + "mx-central-1": 0.0101, + "sa-east-1": 0.013, + "us-east-1": 0.0098, + "us-east-2": 0.0098, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0061, + "us-west-1": 0.0, + "us-west-2": 0.0, + "us-west-2-lax-1": 0.0108 + }, + "t3.2xlarge": { + "af-south-1": 0.5811, + "ap-east-1": 0.6144, + "ap-northeast-1": 0.1472, + "ap-northeast-2": 0.1472, + "ap-northeast-3": 0.5824, + "ap-south-1": 0.0, + "ap-south-2": 0.5056, + "ap-southeast-1": 0.5696, + "ap-southeast-2": 0.1472, + "ap-southeast-3": 0.5696, + "ap-southeast-4": 0.1472, + "ap-southeast-5": 0.3802, + "ap-southeast-7": 0.3802, + "ca-central-1": 0.5407, + "ca-west-1": 0.1472, + "eu-central-1": 0.384, + "eu-central-2": 0.1472, + "eu-north-1": 0.4928, + "eu-south-1": 0.1472, + "eu-south-2": 0.1472, + "eu-west-1": 0.512, + "eu-west-2": 0.3776, + "eu-west-3": 0.5475, + "il-central-1": 0.3834, + "me-central-1": 0.1472, + "me-south-1": 0.1472, + "mx-central-1": 0.4966, + "sa-east-1": 0.5376, + "us-east-1": 0.3328, + "us-east-2": 0.0, + "us-gov-east-1": 0.5376, + "us-gov-west-1": 0.3904, + "us-west-1": 0.0, + "us-west-2": 0.4999, + "us-west-2-lax-1": 0.5466 + }, + "t3a.micro": { + "ap-northeast-1": 0.0214, + "ap-northeast-2": 0.0209, + "ap-south-1": 0.0062, + "ap-southeast-1": 0.021, + "ap-southeast-2": 0.0211, + "ca-central-1": 0.0196, + "eu-central-1": 0.02, + "eu-south-1": 0.02, + "eu-west-1": 0.0102, + "eu-west-2": 0.0198, + "eu-west-3": 0.0198, + "il-central-1": 0.0107, + "sa-east-1": 0.0243, + "us-east-1": 0.0094, + "us-east-2": 0.0186, + "us-gov-east-1": 0.0202, + "us-gov-west-1": 0.0202, + "us-west-1": 0.0204, + "us-west-2": 0.0186 + }, + "t3a.small": { + "ap-northeast-1": 0.0429, + "ap-northeast-2": 0.0418, + "ap-south-1": 0.0123, + "ap-southeast-1": 0.042, + "ap-southeast-2": 0.0422, + "ca-central-1": 0.0393, + "eu-central-1": 0.04, + "eu-south-1": 0.04, + "eu-west-1": 0.0204, + "eu-west-2": 0.0396, + "eu-west-3": 0.0396, + "il-central-1": 0.0398, + "sa-east-1": 0.0486, + "us-east-1": 0.0372, + "us-east-2": 0.0372, + "us-gov-east-1": 0.0404, + "us-gov-west-1": 0.022, + "us-west-1": 0.0407, + "us-west-2": 0.0372 + }, + "t3a.medium": { + "ap-northeast-1": 0.0674, + "ap-northeast-2": 0.0652, + "ap-south-1": 0.0246, + "ap-southeast-1": 0.0656, + "ap-southeast-2": 0.0659, + "ca-central-1": 0.0602, + "eu-central-1": 0.0616, + "eu-south-1": 0.0615, + "eu-west-1": 0.0592, + "eu-west-2": 0.0609, + "eu-west-3": 0.0609, + "il-central-1": 0.0613, + "sa-east-1": 0.0789, + "us-east-1": 0.056, + "us-east-2": 0.056, + "us-gov-east-1": 0.0623, + "us-gov-west-1": 0.0439, + "us-west-1": 0.063, + "us-west-2": 0.056 + }, + "t3a.large": { + "ap-northeast-1": 0.1255, + "ap-northeast-2": 0.1212, + "ap-south-1": 0.0493, + "ap-southeast-1": 0.122, + "ap-southeast-2": 0.1226, + "ca-central-1": 0.1111, + "eu-central-1": 0.114, + "eu-south-1": 0.1138, + "eu-west-1": 0.0816, + "eu-west-2": 0.1126, + "eu-west-3": 0.1126, + "il-central-1": 0.0858, + "sa-east-1": 0.1486, + "us-east-1": 0.0752, + "us-east-2": 0.1028, + "us-gov-east-1": 0.1154, + "us-gov-west-1": 0.0878, + "us-west-1": 0.1169, + "us-west-2": 0.1028 + }, + "t3a.xlarge": { + "ap-northeast-1": 0.2694, + "ap-northeast-2": 0.2608, + "ap-south-1": 0.0986, + "ap-southeast-1": 0.2624, + "ap-southeast-2": 0.2637, + "ca-central-1": 0.2406, + "eu-central-1": 0.2464, + "eu-south-1": 0.2461, + "eu-west-1": 0.1632, + "eu-west-2": 0.2435, + "eu-west-3": 0.2435, + "il-central-1": 0.1715, + "sa-east-1": 0.3155, + "us-east-1": 0.224, + "us-east-2": 0.224, + "us-gov-east-1": 0.2493, + "us-gov-west-1": 0.1757, + "us-west-1": 0.2522, + "us-west-2": 0.224 + }, + "t3a.nano": { + "ap-northeast-1": 0.0107, + "ap-northeast-2": 0.0105, + "ap-south-1": 0.0031, + "ap-southeast-1": 0.0105, + "ap-southeast-2": 0.0105, + "ca-central-1": 0.0098, + "eu-central-1": 0.01, + "eu-south-1": 0.01, + "eu-west-1": 0.0051, + "eu-west-2": 0.0099, + "eu-west-3": 0.0099, + "il-central-1": 0.01, + "sa-east-1": 0.0122, + "us-east-1": 0.0093, + "us-east-2": 0.0093, + "us-gov-east-1": 0.0101, + "us-gov-west-1": 0.0101, + "us-west-1": 0.0102, + "us-west-2": 0.0093 + }, + "t3a.2xlarge": { + "ap-northeast-1": 0.5389, + "ap-northeast-2": 0.5216, + "ap-south-1": 0.3443, + "ap-southeast-1": 0.5248, + "ap-southeast-2": 0.5274, + "ca-central-1": 0.4813, + "eu-central-1": 0.4928, + "eu-south-1": 0.4922, + "eu-west-1": 0.3264, + "eu-west-2": 0.487, + "eu-west-3": 0.487, + "il-central-1": 0.4902, + "sa-east-1": 0.631, + "us-east-1": 0.448, + "us-east-2": 0.448, + "us-gov-east-1": 0.4986, + "us-gov-west-1": 0.4986, + "us-west-1": 0.5043, + "us-west-2": 0.448 + }, + "u7i-6tb.112xlarge": { + "ap-northeast-2": 20.608, + "us-east-1": 62.79, + "us-west-2": 83.398 + }, + "u7i-8tb.112xlarge": { + "ap-northeast-2": 121.60406, + "us-east-1": 83.72 + }, + "u7i-12tb.224xlarge": { + "us-east-1": 152.88, + "us-west-2": 41.216 + }, + "u7in-16tb.224xlarge": { + "ap-northeast-2": 41.216, + "ap-southeast-2": 41.216, + "us-east-1": 41.216, + "us-west-2": 0.0 + }, + "u7in-24tb.224xlarge": { + "us-east-1": 41.216, + "us-gov-west-1": 366.422, + "us-west-2": 346.976 + }, + "u7in-32tb.224xlarge": { + "us-east-1": 407.68, + "us-west-2": 0.0 + }, + "u-3tb1.56xlarge": { + "ap-east-1": 36.22685, + "ap-northeast-1": 43.2373, + "ap-southeast-1": 43.234, + "ap-southeast-2": 32.715, + "ca-central-1": 29.9, + "eu-central-1": 32.9335, + "eu-central-2": 46.53085, + "eu-south-1": 32.0775, + "eu-west-1": 30.55, + "sa-east-1": 43.55, + "us-east-1": 37.604, + "us-east-2": 37.604, + "us-gov-west-1": 32.7165, + "us-west-2": 27.3 + }, + "u-6tb1.metal": { + "ap-northeast-1": 0.0, + "ap-northeast-2": 20.608, + "ap-south-1": 20.608, + "ap-southeast-1": 20.608, + "ap-southeast-2": 20.608, + "ap-southeast-3": 20.608, + "ca-central-1": 20.608, + "eu-central-1": 20.608, + "eu-central-2": 20.608, + "eu-north-1": 0.0, + "eu-south-1": 0.0, + "eu-south-2": 0.0, + "eu-west-1": 20.608, + "eu-west-2": 0.0, + "eu-west-3": 20.608, + "sa-east-1": 0.0, + "us-east-1": 0.0, + "us-east-2": 20.608, + "us-gov-east-1": 20.608, + "us-gov-west-1": 20.608, + "us-west-2": 20.608 + }, + "u-6tb1.56xlarge": { + "af-south-1": 72.09854, + "ap-northeast-1": 66.2836, + "ap-northeast-2": 55.9796, + "ap-northeast-3": 55.9796, + "ap-south-1": 47.87676, + "ap-southeast-1": 66.2836, + "ap-southeast-2": 55.61075, + "ap-southeast-3": 66.2836, + "ca-central-1": 50.82333, + "eu-central-1": 10.304, + "eu-central-2": 10.304, + "eu-north-1": 49.33177, + "eu-south-1": 64.82859, + "eu-south-2": 10.304, + "eu-west-1": 62.23218, + "eu-west-2": 0.0, + "eu-west-3": 64.80989, + "sa-east-1": 0.0, + "us-east-1": 56.70791, + "us-east-2": 46.40391, + "us-gov-east-1": 10.304, + "us-gov-west-1": 65.91475, + "us-west-2": 46.40391 + }, + "u-6tb1.112xlarge": { + "af-south-1": 72.709, + "ap-northeast-1": 65.867, + "ap-northeast-2": 20.608, + "ap-northeast-3": 65.867, + "ap-south-1": 56.333, + "ap-southeast-1": 86.475, + "ap-southeast-2": 65.433, + "ap-southeast-3": 86.475, + "ca-central-1": 59.8, + "eu-central-1": 86.475, + "eu-central-2": 0.0, + "eu-north-1": 20.608, + "eu-south-1": 84.763, + "eu-south-2": 20.608, + "eu-west-1": 61.1, + "eu-west-2": 84.741, + "eu-west-3": 64.133, + "sa-east-1": 107.708, + "us-east-1": 75.208, + "us-east-2": 0.0, + "us-gov-east-1": 20.608, + "us-gov-west-1": 65.433, + "us-west-2": 54.6 + }, + "u-9tb1.metal": { + "ap-northeast-1": 20.608, + "ap-northeast-2": 20.608, + "ap-south-1": 0.0, + "ap-south-2": 0.0, + "ap-southeast-1": 0.0, + "eu-central-1": 0.0, + "eu-north-1": 20.608, + "eu-west-1": 0.0, + "eu-west-2": 0.0, + "eu-west-3": 0.0, + "sa-east-1": 0.0, + "us-east-1": 20.608, + "us-east-2": 20.608, + "us-gov-east-1": 0.0, + "us-gov-west-1": 20.608, + "us-west-2": 0.0 + }, + "u-9tb1.112xlarge": { + "ap-northeast-1": 20.608, + "ap-northeast-2": 119.408, + "ap-south-1": 20.608, + "ap-south-2": 0.0, + "ap-southeast-1": 98.8, + "eu-central-1": 20.608, + "eu-north-1": 20.608, + "eu-west-1": 91.65, + "eu-west-2": 96.2, + "eu-west-3": 20.608, + "sa-east-1": 151.258, + "us-east-1": 81.9, + "us-east-2": 81.9, + "us-gov-east-1": 20.608, + "us-gov-west-1": 118.758, + "us-west-2": 102.508 + }, + "u-12tb1.metal": { + "af-south-1": 0.0, + "ap-northeast-1": 20.608, + "ap-northeast-2": 0.0, + "ap-northeast-3": 20.608, + "ap-south-1": 0.0, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.0, + "eu-central-1": 0.0, + "eu-south-1": 0.0, + "eu-west-1": 0.0, + "sa-east-1": 0.0, + "us-east-1": 20.608, + "us-east-2": 20.608, + "us-gov-east-1": 20.608, + "us-gov-west-1": 0.0, + "us-west-2": 20.608 + }, + "u-12tb1.112xlarge": { + "af-south-1": 145.418, + "ap-northeast-1": 0.0, + "ap-northeast-2": 131.733, + "ap-northeast-3": 0.0, + "ap-south-1": 133.275, + "ap-southeast-1": 152.341, + "ap-southeast-2": 151.475, + "eu-central-1": 152.341, + "eu-south-1": 148.918, + "eu-west-1": 20.608, + "sa-east-1": 174.2, + "us-east-1": 20.608, + "us-east-2": 129.808, + "us-gov-east-1": 0.0, + "us-gov-west-1": 130.867, + "us-west-2": 129.808 + }, + "u-18tb1.metal": { + "eu-central-1": 0.0, + "eu-west-1": 20.608, + "sa-east-1": 20.608, + "us-east-1": 0.0, + "us-west-2": 0.0 + }, + "u-18tb1.112xlarge": { + "eu-central-1": 197.6, + "eu-west-1": 20.608, + "sa-east-1": 261.3, + "us-east-1": 20.608, + "us-west-2": 184.408 + }, + "u-24tb1.metal": { + "ap-northeast-2": 20.608, + "us-east-1": 0.0, + "us-gov-east-1": 0.0, + "us-gov-west-1": 20.608, + "us-west-2": 20.608 + }, + "u-24tb1.112xlarge": { + "ap-northeast-2": 284.078, + "us-east-1": 239.008, + "us-gov-east-1": 20.608, + "us-gov-west-1": 20.608, + "us-west-2": 239.008 + }, + "x1.16xlarge": { + "af-south-1": 2.944, + "ap-east-1": 2.944, + "ap-northeast-1": 12.615, + "ap-northeast-2": 9.671, + "ap-northeast-3": 2.944, + "ap-south-1": 9.825, + "ap-southeast-1": 12.615, + "ap-southeast-2": 12.615, + "ca-central-1": 2.944, + "eu-central-1": 12.281, + "eu-west-1": 8.003, + "eu-west-2": 11.347, + "eu-west-3": 0.0, + "sa-east-1": 2.944, + "us-east-1": 6.669, + "us-east-2": 6.669, + "us-gov-east-1": 2.944, + "us-gov-west-1": 0.0, + "us-west-2": 9.613 + }, + "x1.32xlarge": { + "af-south-1": 5.888, + "ap-east-1": 27.164, + "ap-northeast-1": 19.341, + "ap-northeast-2": 19.341, + "ap-northeast-3": 25.23, + "ap-south-1": 19.65, + "ap-southeast-1": 25.229, + "ap-southeast-2": 19.341, + "ca-central-1": 14.672, + "eu-central-1": 24.562, + "eu-west-1": 21.894, + "eu-west-2": 16.806, + "eu-west-3": 16.806, + "sa-east-1": 5.888, + "us-east-1": 13.338, + "us-east-2": 19.226, + "us-gov-east-1": 21.894, + "us-gov-west-1": 5.888, + "us-west-2": 19.226 + }, + "x1e.xlarge": { + "af-south-1": 1.374, + "ap-northeast-1": 0.0, + "ap-northeast-2": 1.393, + "ap-northeast-3": 1.209, + "ap-south-1": 1.044, + "ap-southeast-1": 0.184, + "ap-southeast-2": 1.393, + "ca-central-1": 1.101, + "eu-central-1": 1.167, + "eu-west-1": 1.184, + "sa-east-1": 1.81, + "us-east-1": 0.0, + "us-east-2": 0.184, + "us-gov-east-1": 0.184, + "us-gov-west-1": 0.184, + "us-west-2": 0.0 + }, + "x1e.2xlarge": { + "af-south-1": 2.748, + "ap-northeast-1": 0.368, + "ap-northeast-2": 0.0, + "ap-northeast-3": 0.0, + "ap-south-1": 2.088, + "ap-southeast-1": 0.368, + "ap-southeast-2": 2.418, + "ca-central-1": 0.368, + "eu-central-1": 2.702, + "eu-west-1": 2.368, + "sa-east-1": 3.619, + "us-east-1": 0.368, + "us-east-2": 0.368, + "us-gov-east-1": 2.368, + "us-gov-west-1": 2.2, + "us-west-2": 2.203 + }, + "x1e.4xlarge": { + "af-south-1": 0.736, + "ap-northeast-1": 5.572, + "ap-northeast-2": 0.736, + "ap-northeast-3": 0.736, + "ap-south-1": 4.176, + "ap-southeast-1": 0.736, + "ap-southeast-2": 5.572, + "ca-central-1": 0.736, + "eu-central-1": 5.404, + "eu-west-1": 0.736, + "sa-east-1": 7.238, + "us-east-1": 3.336, + "us-east-2": 0.736, + "us-gov-east-1": 4.736, + "us-gov-west-1": 4.736, + "us-west-2": 0.736 + }, + "x1e.8xlarge": { + "af-south-1": 1.472, + "ap-northeast-1": 9.672, + "ap-northeast-2": 1.472, + "ap-northeast-3": 9.672, + "ap-south-1": 8.352, + "ap-southeast-1": 1.472, + "ap-southeast-2": 9.672, + "ca-central-1": 8.806, + "eu-central-1": 0.0, + "eu-west-1": 8.0, + "sa-east-1": 14.477, + "us-east-1": 1.472, + "us-east-2": 8.144, + "us-gov-east-1": 9.472, + "us-gov-west-1": 8.0, + "us-west-2": 8.144 + }, + "x1e.16xlarge": { + "af-south-1": 21.984, + "ap-northeast-1": 19.344, + "ap-northeast-2": 19.344, + "ap-northeast-3": 24.222, + "ap-south-1": 16.704, + "ap-southeast-1": 2.944, + "ap-southeast-2": 22.288, + "ca-central-1": 2.944, + "eu-central-1": 18.672, + "eu-west-1": 18.944, + "sa-east-1": 28.954, + "us-east-1": 13.344, + "us-east-2": 16.288, + "us-gov-east-1": 2.944, + "us-gov-west-1": 2.944, + "us-west-2": 0.0 + }, + "x1e.32xlarge": { + "af-south-1": 43.968, + "ap-northeast-1": 44.576, + "ap-northeast-2": 38.688, + "ap-northeast-3": 5.888, + "ap-south-1": 33.408, + "ap-southeast-1": 5.888, + "ap-southeast-2": 5.888, + "ca-central-1": 5.888, + "eu-central-1": 5.888, + "eu-west-1": 32.0, + "sa-east-1": 5.888, + "us-east-1": 0.0, + "us-east-2": 5.888, + "us-gov-east-1": 37.888, + "us-gov-west-1": 5.888, + "us-west-2": 5.888 + }, + "x2idn.metal": { + "af-south-1": 5.888, + "ap-northeast-1": 5.888, + "ap-northeast-2": 19.341, + "ap-northeast-3": 0.0, + "ap-south-1": 13.762, + "ap-south-2": 5.888, + "ap-southeast-1": 5.888, + "ap-southeast-2": 25.229, + "ap-southeast-3": 5.888, + "ap-southeast-5": 23.2949, + "ap-southeast-7": 23.2949, + "ca-central-1": 0.0, + "eu-central-1": 24.562, + "eu-central-2": 5.888, + "eu-north-1": 5.888, + "eu-south-1": 5.888, + "eu-south-2": 21.894, + "eu-west-1": 21.894, + "eu-west-2": 16.806, + "eu-west-3": 16.806, + "me-central-1": 16.408, + "me-south-1": 22.296, + "sa-east-1": 5.888, + "us-east-1": 19.226, + "us-east-2": 5.888, + "us-gov-east-1": 5.888, + "us-gov-west-1": 21.894, + "us-west-1": 17.34, + "us-west-2": 5.888 + }, + "x2idn.16xlarge": { + "af-south-1": 12.468, + "ap-northeast-1": 2.944, + "ap-northeast-2": 13.58155, + "ap-northeast-3": 2.944, + "ap-south-1": 2.944, + "ap-south-2": 6.881, + "ap-southeast-1": 0.0, + "ap-southeast-2": 12.6145, + "ap-southeast-3": 2.944, + "ap-southeast-5": 0.0, + "ap-southeast-7": 11.64745, + "ca-central-1": 7.336, + "eu-central-1": 9.337, + "eu-central-2": 13.2147, + "eu-north-1": 11.31005, + "eu-south-1": 2.944, + "eu-south-2": 0.0, + "eu-west-1": 2.944, + "eu-west-2": 8.403, + "eu-west-3": 12.1873, + "me-central-1": 8.204, + "me-south-1": 0.0, + "sa-east-1": 15.949, + "us-east-1": 9.613, + "us-east-2": 9.613, + "us-gov-east-1": 0.0, + "us-gov-west-1": 0.0, + "us-west-1": 8.67, + "us-west-2": 6.669 + }, + "x2idn.24xlarge": { + "af-south-1": 15.7146, + "ap-northeast-1": 14.50575, + "ap-northeast-2": 4.416, + "ap-northeast-3": 14.5065, + "ap-south-1": 10.3215, + "ap-south-2": 14.7375, + "ap-southeast-1": 4.416, + "ap-southeast-2": 0.0, + "ap-southeast-3": 0.0, + "ap-southeast-5": 13.05518, + "ap-southeast-7": 17.47118, + "ca-central-1": 11.004, + "eu-central-1": 4.416, + "eu-central-2": 4.416, + "eu-north-1": 4.416, + "eu-south-1": 4.416, + "eu-south-2": 16.4205, + "eu-west-1": 12.0045, + "eu-west-2": 12.6045, + "eu-west-3": 18.28095, + "me-central-1": 0.0, + "me-south-1": 13.5366, + "sa-east-1": 4.416, + "us-east-1": 15.41985, + "us-east-2": 11.00385, + "us-gov-east-1": 4.416, + "us-gov-west-1": 12.0045, + "us-west-1": 17.421, + "us-west-2": 14.4195 + }, + "x2idn.32xlarge": { + "af-south-1": 24.936, + "ap-northeast-1": 25.229, + "ap-northeast-2": 19.341, + "ap-northeast-3": 25.23, + "ap-south-1": 13.762, + "ap-south-2": 13.762, + "ap-southeast-1": 19.341, + "ap-southeast-2": 25.229, + "ap-southeast-3": 25.229, + "ap-southeast-5": 5.888, + "ap-southeast-7": 23.2949, + "ca-central-1": 5.888, + "eu-central-1": 5.888, + "eu-central-2": 5.888, + "eu-north-1": 5.888, + "eu-south-1": 16.801, + "eu-south-2": 16.006, + "eu-west-1": 21.894, + "eu-west-2": 22.694, + "eu-west-3": 5.888, + "me-central-1": 0.0, + "me-south-1": 16.408, + "sa-east-1": 26.01, + "us-east-1": 19.226, + "us-east-2": 5.888, + "us-gov-east-1": 5.888, + "us-gov-west-1": 21.894, + "us-west-1": 23.228, + "us-west-2": 19.226 + }, + "x2iedn.xlarge": { + "af-south-1": 0.184, + "ap-northeast-1": 1.39281, + "ap-northeast-2": 1.51369, + "ap-northeast-3": 1.39288, + "ap-south-1": 0.0, + "ap-south-2": 0.184, + "ap-southeast-1": 1.20881, + "ap-southeast-2": 1.51369, + "ap-southeast-3": 1.20881, + "ap-southeast-5": 0.0, + "ca-central-1": 0.184, + "eu-central-1": 1.35113, + "eu-north-1": 0.0, + "eu-south-1": 0.184, + "eu-south-2": 0.184, + "eu-west-1": 1.00038, + "eu-west-2": 1.23438, + "eu-west-3": 1.23438, + "sa-east-1": 1.62563, + "us-east-1": 0.83363, + "us-east-2": 0.91699, + "us-gov-east-1": 0.184, + "us-gov-west-1": 1.00038, + "us-west-1": 0.184, + "us-west-2": 0.184 + }, + "x2iedn.metal": { + "af-south-1": 43.984, + "ap-northeast-1": 44.57, + "ap-northeast-2": 44.57, + "ap-northeast-3": 5.888, + "ap-south-1": 33.412, + "ap-south-2": 33.412, + "ap-southeast-1": 5.888, + "ap-southeast-2": 38.682, + "ap-southeast-3": 38.682, + "ap-southeast-5": 40.7018, + "ca-central-1": 29.344, + "eu-central-1": 0.0, + "eu-north-1": 30.423, + "eu-south-1": 5.888, + "eu-south-2": 37.9, + "eu-west-1": 32.012, + "eu-west-2": 33.612, + "eu-west-3": 5.888, + "sa-east-1": 5.888, + "us-east-1": 32.564, + "us-east-2": 26.676, + "us-gov-east-1": 0.0, + "us-gov-west-1": 37.9, + "us-west-1": 34.68, + "us-west-2": 32.564 + }, + "x2iedn.2xlarge": { + "af-south-1": 0.368, + "ap-northeast-1": 3.02739, + "ap-northeast-2": 3.02739, + "ap-northeast-3": 2.78575, + "ap-south-1": 0.368, + "ap-south-2": 0.368, + "ap-southeast-1": 2.78563, + "ap-southeast-2": 2.78563, + "ap-southeast-3": 0.368, + "ap-southeast-5": 2.54386, + "ca-central-1": 2.0174, + "eu-central-1": 2.70225, + "eu-north-1": 1.90144, + "eu-south-1": 2.10006, + "eu-south-2": 2.00075, + "eu-west-1": 2.36875, + "eu-west-2": 2.10075, + "eu-west-3": 2.10075, + "sa-east-1": 0.368, + "us-east-1": 1.66725, + "us-east-2": 0.368, + "us-gov-east-1": 0.368, + "us-gov-west-1": 2.36875, + "us-west-1": 2.1675, + "us-west-2": 0.368 + }, + "x2iedn.4xlarge": { + "af-south-1": 5.9742, + "ap-northeast-1": 5.31878, + "ap-northeast-2": 0.736, + "ap-northeast-3": 0.0, + "ap-south-1": 0.736, + "ap-south-2": 0.0, + "ap-southeast-1": 4.83525, + "ap-southeast-2": 4.83525, + "ap-southeast-3": 0.736, + "ap-southeast-5": 4.7869, + "ca-central-1": 0.736, + "eu-central-1": 5.4045, + "eu-north-1": 4.53888, + "eu-south-1": 4.93613, + "eu-south-2": 4.7375, + "eu-west-1": 4.0015, + "eu-west-2": 4.2015, + "eu-west-3": 4.9375, + "sa-east-1": 7.2385, + "us-east-1": 3.3345, + "us-east-2": 4.0705, + "us-gov-east-1": 4.0015, + "us-gov-west-1": 4.40165, + "us-west-1": 0.736, + "us-west-2": 4.0705 + }, + "x2iedn.8xlarge": { + "af-south-1": 10.996, + "ap-northeast-1": 11.1425, + "ap-northeast-2": 12.10955, + "ap-northeast-3": 0.0, + "ap-south-1": 1.472, + "ap-south-2": 6.881, + "ap-southeast-1": 11.1425, + "ap-southeast-2": 0.0, + "ap-southeast-3": 11.1425, + "ap-southeast-5": 0.0, + "ca-central-1": 8.808, + "eu-central-1": 9.337, + "eu-north-1": 7.60575, + "eu-south-1": 1.472, + "eu-south-2": 9.475, + "eu-west-1": 8.003, + "eu-west-2": 1.472, + "eu-west-3": 1.472, + "sa-east-1": 13.005, + "us-east-1": 8.141, + "us-east-2": 6.669, + "us-gov-east-1": 9.475, + "us-gov-west-1": 8.003, + "us-west-1": 0.0, + "us-west-2": 1.472 + }, + "x2iedn.16xlarge": { + "af-south-1": 0.0, + "ap-northeast-1": 24.2191, + "ap-northeast-2": 2.944, + "ap-northeast-3": 0.0, + "ap-south-1": 13.762, + "ap-south-2": 13.762, + "ap-southeast-1": 19.341, + "ap-southeast-2": 2.944, + "ap-southeast-3": 2.944, + "ap-southeast-5": 20.3509, + "ca-central-1": 14.672, + "eu-central-1": 18.674, + "eu-north-1": 18.1555, + "eu-south-1": 19.7445, + "eu-south-2": 16.006, + "eu-west-1": 16.006, + "eu-west-2": 2.944, + "eu-west-3": 2.944, + "sa-east-1": 2.944, + "us-east-1": 2.944, + "us-east-2": 13.338, + "us-gov-east-1": 18.95, + "us-gov-west-1": 2.944, + "us-west-1": 20.284, + "us-west-2": 17.6158 + }, + "x2iedn.24xlarge": { + "af-south-1": 32.988, + "ap-northeast-1": 29.0115, + "ap-northeast-2": 29.0115, + "ap-northeast-3": 29.013, + "ap-south-1": 20.643, + "ap-south-2": 20.643, + "ap-southeast-1": 4.416, + "ap-southeast-2": 0.0, + "ap-southeast-3": 4.416, + "ap-southeast-5": 4.416, + "ca-central-1": 4.416, + "eu-central-1": 4.416, + "eu-north-1": 4.416, + "eu-south-1": 29.61675, + "eu-south-2": 28.425, + "eu-west-1": 28.425, + "eu-west-2": 25.209, + "eu-west-3": 25.209, + "sa-east-1": 39.015, + "us-east-1": 0.0, + "us-east-2": 0.0, + "us-gov-east-1": 28.425, + "us-gov-west-1": 4.416, + "us-west-1": 4.416, + "us-west-2": 4.416 + }, + "x2iedn.32xlarge": { + "af-south-1": 38.096, + "ap-northeast-1": 44.57, + "ap-northeast-2": 38.682, + "ap-northeast-3": 44.572, + "ap-south-1": 5.888, + "ap-south-2": 5.888, + "ap-southeast-1": 0.0, + "ap-southeast-2": 38.682, + "ap-southeast-3": 38.682, + "ap-southeast-5": 40.7018, + "ca-central-1": 0.0, + "eu-central-1": 43.236, + "eu-north-1": 30.423, + "eu-south-1": 33.601, + "eu-south-2": 0.0, + "eu-west-1": 37.9, + "eu-west-2": 39.5, + "eu-west-3": 5.888, + "sa-east-1": 5.888, + "us-east-1": 26.676, + "us-east-2": 26.676, + "us-gov-east-1": 37.9, + "us-gov-west-1": 37.9, + "us-west-1": 5.888, + "us-west-2": 5.888 + }, + "x2iezn.metal": { + "ap-northeast-1": 2.208, + "eu-west-1": 14.208, + "me-central-1": 12.306, + "us-east-1": 2.208, + "us-west-2": 12.216 + }, + "x2iezn.2xlarge": { + "ap-northeast-1": 2.418, + "eu-west-1": 2.368, + "me-central-1": 2.419, + "us-east-1": 1.668, + "us-west-2": 2.036 + }, + "x2iezn.4xlarge": { + "ap-northeast-1": 6.0556, + "eu-west-1": 0.736, + "me-central-1": 4.838, + "us-east-1": 3.336, + "us-west-2": 0.736 + }, + "x2iezn.6xlarge": { + "ap-northeast-1": 1.104, + "eu-west-1": 7.104, + "me-central-1": 1.104, + "us-east-1": 5.004, + "us-west-2": 1.104 + }, + "x2iezn.8xlarge": { + "ap-northeast-1": 0.0, + "eu-west-1": 9.472, + "me-central-1": 9.676, + "us-east-1": 8.144, + "us-west-2": 8.144 + }, + "x2iezn.12xlarge": { + "ap-northeast-1": 14.508, + "eu-west-1": 12.0, + "me-central-1": 14.514, + "us-east-1": 10.008, + "us-west-2": 12.216 + }, + "z1d.large": { + "ap-northeast-1": 0.092, + "ap-northeast-2": 0.092, + "ap-south-1": 0.288, + "ap-southeast-1": 0.0, + "ap-southeast-2": 0.092, + "eu-central-1": 0.317, + "eu-west-1": 0.0, + "eu-west-2": 0.092, + "us-east-1": 0.289, + "us-east-2": 0.092, + "us-west-1": 0.092, + "us-west-2": 0.278 + }, + "z1d.xlarge": { + "ap-northeast-1": 0.666, + "ap-northeast-2": 0.634, + "ap-south-1": 0.184, + "ap-southeast-1": 0.636, + "ap-southeast-2": 0.636, + "eu-central-1": 0.634, + "eu-west-1": 0.416, + "eu-west-2": 0.623, + "us-east-1": 0.0, + "us-east-2": 0.556, + "us-west-1": 0.448, + "us-west-2": 0.556 + }, + "z1d.metal": { + "ap-northeast-1": 7.656, + "ap-northeast-2": 7.608, + "ap-south-1": 6.912, + "ap-southeast-1": 7.632, + "ap-southeast-2": 7.632, + "eu-central-1": 2.208, + "eu-west-1": 2.208, + "eu-west-2": 2.208, + "us-east-1": 2.208, + "us-east-2": 2.208, + "us-west-1": 2.208, + "us-west-2": 2.208 + }, + "z1d.2xlarge": { + "ap-northeast-1": 0.908, + "ap-northeast-2": 0.368, + "ap-south-1": 1.152, + "ap-southeast-1": 1.272, + "ap-southeast-2": 1.272, + "eu-central-1": 0.368, + "eu-west-1": 0.368, + "eu-west-2": 1.247, + "us-east-1": 1.112, + "us-east-2": 0.368, + "us-west-1": 1.264, + "us-west-2": 0.744 + }, + "z1d.3xlarge": { + "ap-northeast-1": 1.362, + "ap-northeast-2": 0.552, + "ap-south-1": 1.728, + "ap-southeast-1": 0.552, + "ap-southeast-2": 1.908, + "eu-central-1": 1.902, + "eu-west-1": 1.248, + "eu-west-2": 1.87, + "us-east-1": 1.116, + "us-east-2": 0.552, + "us-west-1": 1.818, + "us-west-2": 1.668 + }, + "z1d.6xlarge": { + "ap-northeast-1": 2.724, + "ap-northeast-2": 3.804, + "ap-south-1": 3.456, + "ap-southeast-1": 1.104, + "ap-southeast-2": 3.816, + "eu-central-1": 1.104, + "eu-west-1": 3.6, + "eu-west-2": 3.74, + "us-east-1": 3.336, + "us-east-2": 3.336, + "us-west-1": 1.104, + "us-west-2": 3.47 + }, + "z1d.12xlarge": { + "ap-northeast-1": 7.656, + "ap-northeast-2": 7.608, + "ap-south-1": 2.208, + "ap-southeast-1": 5.424, + "ap-southeast-2": 2.208, + "eu-central-1": 2.208, + "eu-west-1": 2.208, + "eu-west-2": 7.481, + "us-east-1": 2.208, + "us-east-2": 6.672, + "us-west-1": 5.064, + "us-west-2": 0.0 + } }, "elastichosts": { + "small": 0.1, + "medium": 0.223, + "large": 0.378, "extra-large": 0.579, "high-cpu-extra-large": 0.77, - "high-cpu-medium": 0.18, - "large": 0.378, - "medium": 0.223, - "small": 0.1 + "high-cpu-medium": 0.18 }, "gandi": { - "1": 0.02, - "large": 0.06, - "medium": 0.03, "small": 0.02, - "x-large": 0.12 + "medium": 0.03, + "large": 0.06, + "x-large": 0.12, + "1": 0.02 + }, + "gce_disks": { + "Local SSD": { + "description": "ssd backed local storage", + "on_demand": { + "asia-east2": { + "price": 0.00012222222222222221, + "sku": "36DD-0D48-1538" + }, + "asia-northeast1": { + "price": 0.00014444444444444444, + "sku": "ADED-CD91-C56C" + }, + "asia-northeast2": { + "price": 0.00014444444444444444, + "sku": "A092-0DE4-8657" + }, + "asia-northeast3": { + "price": 0.00014444444444444444, + "sku": "3D6B-D4C7-3AE9" + }, + "asia-south1": { + "price": 0.00013333333333333334, + "sku": "5358-4869-64C1" + }, + "asia-southeast1": { + "price": 0.00012222222222222221, + "sku": "F8F1-D370-6212" + }, + "asia-southeast2": { + "price": 0.00013322222222222224, + "sku": "E4E8-72A1-292F" + }, + "australia-southeast1": { + "price": 0.00015, + "sku": "5A46-0D37-14AA" + }, + "europe-north1": { + "price": 0.00012222222222222221, + "sku": "42BD-4C76-86B9" + }, + "europe-west2": { + "price": 0.00013333333333333334, + "sku": "2CF6-3A15-7BB0" + }, + "europe-west3": { + "price": 0.00013333333333333334, + "sku": "0D18-A9AA-6DB3" + }, + "europe-west4": { + "price": 0.00012222222222222221, + "sku": "EFD6-4D88-8C94" + }, + "europe-west6": { + "price": 0.00014444444444444444, + "sku": "F126-3695-DA84" + }, + "northamerica-northeast1": { + "price": 0.00012222222222222221, + "sku": "6188-5783-3621" + }, + "southamerica-east1": { + "price": 0.00016666666666666666, + "sku": "A8D6-A5F2-1558" + }, + "us-central1": { + "price": 0.00011111111111111112, + "sku": "62AF-A39E-269B" + }, + "us-east4": { + "price": 0.00012222222222222221, + "sku": "1B8A-BA6B-7FB6" + }, + "us-west2": { + "price": 0.00013333333333333334, + "sku": "D77E-1723-8B31" + }, + "us-west3": { + "price": 0.00013333333333333334, + "sku": "C6F5-905B-AD47" + }, + "us-west4": { + "price": 0.00012222222222222221, + "sku": "3C20-2B95-CA0D" + } + }, + "preemptible": { + "asia-east2": { + "price": 7.333333333333333e-05, + "sku": "098E-5D71-3E4F" + }, + "asia-northeast1": { + "price": 8.61111111111111e-05, + "sku": "7417-69E6-DF0B" + }, + "asia-northeast2": { + "price": 8.61111111111111e-05, + "sku": "A278-3398-C70D" + }, + "asia-northeast3": { + "price": 8.61111111111111e-05, + "sku": "129E-F19F-D852" + }, + "asia-south1": { + "price": 8.055555555555556e-05, + "sku": "5E37-B87E-96FA" + }, + "asia-southeast1": { + "price": 7.361111111111111e-05, + "sku": "9F7C-3C75-F39B" + }, + "asia-southeast2": { + "price": 8.023611111111111e-05, + "sku": "83B7-9808-C27B" + }, + "australia-southeast1": { + "price": 9.027777777777779e-05, + "sku": "D3E7-D583-8ADB" + }, + "europe-north1": { + "price": 7.333333333333333e-05, + "sku": "DA22-3FD3-263D" + }, + "europe-west2": { + "price": 8.055555555555556e-05, + "sku": "B67B-2DCF-21FD" + }, + "europe-west3": { + "price": 8.055555555555556e-05, + "sku": "32CD-69B6-F8EE" + }, + "europe-west4": { + "price": 7.333333333333333e-05, + "sku": "8D0B-EA58-9E35" + }, + "europe-west6": { + "price": 8.666666666666667e-05, + "sku": "D4D6-A260-1324" + }, + "northamerica-northeast1": { + "price": 7.361111111111111e-05, + "sku": "DF06-F3BF-ECF5" + }, + "southamerica-east1": { + "price": 9.999999999999999e-05, + "sku": "A84C-D70F-4BAF" + }, + "us-central1": { + "price": 6.666666666666667e-05, + "sku": "E725-3CC5-D4BE" + }, + "us-east4": { + "price": 7.361111111111111e-05, + "sku": "90BB-573D-32B7" + }, + "us-west2": { + "price": 7.999999999999999e-05, + "sku": "7A48-277E-AD1A" + }, + "us-west3": { + "price": 7.999999999999999e-05, + "sku": "3233-97D3-222E" + }, + "us-west4": { + "price": 7.361111111111111e-05, + "sku": "9FE8-2651-76C8" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + }, + "Regional SSD": { + "description": "ssd backed pd capacity", + "on_demand": { + "asia-east2": { + "price": 0.0002597222222222222, + "sku": "6630-F40F-B38F" + }, + "asia-northeast1": { + "price": 0.00030694444444444443, + "sku": "704E-4991-FEE8" + }, + "asia-northeast2": { + "price": 0.00030694444444444443, + "sku": "0415-E569-EE65" + }, + "asia-northeast3": { + "price": 0.00030694444444444443, + "sku": "2C69-A050-09F7" + }, + "asia-south1": { + "price": 0.0002833333333333333, + "sku": "FF66-41CB-DE90" + }, + "asia-southeast1": { + "price": 0.0002597222222222222, + "sku": "C97A-896E-D6F0" + }, + "asia-southeast2": { + "price": 0.00030694444444444443, + "sku": "0554-F9AE-1EC6" + }, + "australia-southeast1": { + "price": 0.00031944444444444446, + "sku": "B2B0-B94F-6690" + }, + "europe-north1": { + "price": 0.0002597222222222222, + "sku": "4C09-1F46-D168" + }, + "europe-west2": { + "price": 0.0002833333333333333, + "sku": "4D98-E205-E7F1" + }, + "europe-west3": { + "price": 0.0002833333333333333, + "sku": "378C-9DAC-0A5A" + }, + "europe-west4": { + "price": 0.0002597222222222222, + "sku": "315D-05CC-A75E" + }, + "europe-west6": { + "price": 0.00030694444444444443, + "sku": "6B82-25FC-503C" + }, + "northamerica-northeast1": { + "price": 0.0002597222222222222, + "sku": "BA5B-E860-74C4" + }, + "southamerica-east1": { + "price": 0.0003541666666666667, + "sku": "28F9-6E36-3030" + }, + "us-central1": { + "price": 0.00023611111111111112, + "sku": "B188-61DD-52E4" + }, + "us-east4": { + "price": 0.0002597222222222222, + "sku": "75B0-B95E-76A8" + }, + "us-west2": { + "price": 0.0002833333333333333, + "sku": "0589-AA00-68BD" + }, + "us-west3": { + "price": 0.0002833333333333333, + "sku": "6A0C-F783-3754" + }, + "us-west4": { + "price": 0.0002597222222222222, + "sku": "CF9E-3EFB-D09B" + } + } + }, + "Regional Standard": { + "description": "regional storage pd capacity", + "on_demand": { + "asia-east2": { + "price": 0.00015555555555555556, + "sku": "92AD-0FBB-AC7C" + }, + "asia-northeast1": { + "price": 0.00014444444444444444, + "sku": "8914-A21F-7C98" + }, + "asia-northeast2": { + "price": 0.00014444444444444444, + "sku": "EE4F-E9A2-F8D1" + }, + "asia-northeast3": { + "price": 0.00014444444444444444, + "sku": "2269-4F0C-C04C" + }, + "asia-south1": { + "price": 0.00013333333333333334, + "sku": "6AA8-A6A7-C242" + }, + "asia-southeast1": { + "price": 0.00012222222222222221, + "sku": "55C0-508F-9F7F" + }, + "asia-southeast2": { + "price": 0.00014444444444444444, + "sku": "BEB2-8F93-E108" + }, + "australia-southeast1": { + "price": 0.00015, + "sku": "EE4C-7786-1B0B" + }, + "europe-north1": { + "price": 0.00012222222222222221, + "sku": "7F69-8BA2-E71C" + }, + "europe-west2": { + "price": 0.00013333333333333334, + "sku": "5712-0053-D059" + }, + "europe-west3": { + "price": 0.00013333333333333334, + "sku": "31D1-FBD8-16DD" + }, + "europe-west4": { + "price": 0.00012222222222222221, + "sku": "8E50-26E0-D2A3" + }, + "europe-west6": { + "price": 0.00014444444444444444, + "sku": "A6C5-05F9-15A1" + }, + "northamerica-northeast1": { + "price": 0.00012222222222222221, + "sku": "AB22-513F-E199" + }, + "southamerica-east1": { + "price": 0.00016666666666666666, + "sku": "9669-9A29-FF5E" + }, + "us-central1": { + "price": 0.00011111111111111112, + "sku": "3C62-891B-C73C" + }, + "us-east4": { + "price": 0.00012222222222222221, + "sku": "D60B-2646-1A2B" + }, + "us-west2": { + "price": 0.00013333333333333334, + "sku": "878F-E2CC-F899" + }, + "us-west3": { + "price": 0.00013333333333333334, + "sku": "E39F-3A27-653A" + }, + "us-west4": { + "price": 0.00012222222222222221, + "sku": "6676-5994-E362" + } + } + }, + "SSD": { + "description": "ssd backed pd", + "on_demand": { + "asia-east2": { + "price": 0.0002597222222222222, + "sku": "6630-F40F-B38F" + }, + "asia-northeast1": { + "price": 0.00030694444444444443, + "sku": "704E-4991-FEE8" + }, + "asia-northeast2": { + "price": 0.00030694444444444443, + "sku": "0415-E569-EE65" + }, + "asia-northeast3": { + "price": 0.00030694444444444443, + "sku": "2C69-A050-09F7" + }, + "asia-south1": { + "price": 0.0002833333333333333, + "sku": "FF66-41CB-DE90" + }, + "asia-southeast1": { + "price": 0.0002597222222222222, + "sku": "C97A-896E-D6F0" + }, + "asia-southeast2": { + "price": 0.00030694444444444443, + "sku": "0554-F9AE-1EC6" + }, + "australia-southeast1": { + "price": 0.00031944444444444446, + "sku": "B2B0-B94F-6690" + }, + "europe-north1": { + "price": 0.0002597222222222222, + "sku": "4C09-1F46-D168" + }, + "europe-west2": { + "price": 0.0002833333333333333, + "sku": "4D98-E205-E7F1" + }, + "europe-west3": { + "price": 0.0002833333333333333, + "sku": "378C-9DAC-0A5A" + }, + "europe-west4": { + "price": 0.0002597222222222222, + "sku": "315D-05CC-A75E" + }, + "europe-west6": { + "price": 0.00030694444444444443, + "sku": "6B82-25FC-503C" + }, + "northamerica-northeast1": { + "price": 0.0002597222222222222, + "sku": "BA5B-E860-74C4" + }, + "southamerica-east1": { + "price": 0.0003541666666666667, + "sku": "28F9-6E36-3030" + }, + "us-central1": { + "price": 0.00023611111111111112, + "sku": "B188-61DD-52E4" + }, + "us-east4": { + "price": 0.0002597222222222222, + "sku": "75B0-B95E-76A8" + }, + "us-west2": { + "price": 0.0002833333333333333, + "sku": "0589-AA00-68BD" + }, + "us-west3": { + "price": 0.0002833333333333333, + "sku": "6A0C-F783-3754" + }, + "us-west4": { + "price": 0.0002597222222222222, + "sku": "CF9E-3EFB-D09B" + } + } + }, + "Standard": { + "description": "storage pd capacity", + "on_demand": { + "asia-east2": { + "price": 6.916666666666666e-05, + "sku": "28D0-437A-CEAD" + }, + "asia-northeast1": { + "price": 7.222222222222222e-05, + "sku": "9977-2BC5-386A" + }, + "asia-northeast2": { + "price": 7.222222222222222e-05, + "sku": "5A6A-4A16-F865" + }, + "asia-northeast3": { + "price": 7.222222222222222e-05, + "sku": "0306-B164-A7B7" + }, + "asia-south1": { + "price": 6.666666666666667e-05, + "sku": "320C-7688-1A62" + }, + "asia-southeast1": { + "price": 6.111111111111111e-05, + "sku": "0572-568A-4FC4" + }, + "asia-southeast2": { + "price": 7.222222222222222e-05, + "sku": "D619-8E03-F681" + }, + "australia-southeast1": { + "price": 7.5e-05, + "sku": "5334-92F9-3E7F" + }, + "europe-north1": { + "price": 6.111111111111111e-05, + "sku": "CEF4-0773-7924" + }, + "europe-west2": { + "price": 6.666666666666667e-05, + "sku": "BF1A-6647-009D" + }, + "europe-west3": { + "price": 6.666666666666667e-05, + "sku": "7A7B-EA46-2897" + }, + "europe-west4": { + "price": 6.111111111111111e-05, + "sku": "AE8C-46C3-4994" + }, + "europe-west6": { + "price": 7.222222222222222e-05, + "sku": "17A8-D0A4-D7E5" + }, + "northamerica-northeast1": { + "price": 6.111111111111111e-05, + "sku": "92E5-B76E-D04B" + }, + "southamerica-east1": { + "price": 8.333333333333333e-05, + "sku": "DF49-E005-E705" + }, + "us-central1": { + "price": 5.555555555555556e-05, + "sku": "D973-5D65-BAB2" + }, + "us-east4": { + "price": 6.111111111111111e-05, + "sku": "8AF1-1146-E7DA" + }, + "us-west2": { + "price": 6.666666666666667e-05, + "sku": "BF8D-1C96-EE1C" + }, + "us-west3": { + "price": 6.666666666666667e-05, + "sku": "F993-B67E-E316" + }, + "us-west4": { + "price": 6.111111111111111e-05, + "sku": "9CB9-1019-8019" + } + } + } + }, + "gce_images": { + "RHEL": { + "description": "RHEL7", + "4vcpu or less": { + "price": 0, + "sku": "57A4-6443-7F8D" + }, + "6vcpu or more": { + "price": 0, + "sku": "9AAA-D8A1-1CA1" + } + }, + "RHEL with Update Services": { + "description": "Red Hat Enterprise Linux for SAP with Update Services", + "4vcpu or less": { + "price": 0, + "sku": "7E6E-54A7-319A" + }, + "6vcpu or more": { + "price": 0, + "sku": "CB1D-70B4-22E0" + } + }, + "SLES": { + "any": { + "price": 0, + "sku": "42E1-070C-7F4E" + }, + "f1": { + "price": 0, + "sku": "0469-B817-410A" + }, + "g1": { + "price": 0, + "sku": "739A-8A87-1E79" + } + }, + "SLES for SAP": { + "1-2vcpu": { + "price": 0, + "sku": "EAF4-4289-40E6" + }, + "3-4vcpu": { + "price": 0, + "sku": "86C1-64B7-1E72" + }, + "6vcpu or more": { + "price": 0, + "sku": "5E02-C3BA-6290" + } + }, + "SQL Server": { + "enterprise": { + "price": 0.399 + }, + "standard": { + "price": 0.1645 + }, + "web": { + "price": 0.011 + } + }, + "Windows Server": { + "any": { + "price": 0, + "sku": "00B2-37B0-B8BB" + }, + "f1": { + "price": 0, + "sku": "151B-229F-68E1" + }, + "g1": { + "price": 0, + "sku": "03F4-45F5-24A2" + } + } + }, + "gce_instances": { + "c2": { + "cpu": { + "description": "compute optimized core", + "on_demand": { + "asia-east1": { + "price": 0.039347, + "sku": "0431-1BCC-0DDB" + }, + "asia-east2": { + "price": 0.047548, + "sku": "65CE-4AE3-C38C" + }, + "asia-northeast1": { + "price": 0.043664, + "sku": "1E2A-8F3B-7752" + }, + "asia-northeast2": { + "price": 0.043664, + "sku": "F736-13ED-2488" + }, + "asia-northeast3": { + "price": 0.043664, + "sku": "C2BF-525E-B2BE" + }, + "asia-south1": { + "price": 0.040818, + "sku": "215B-2E7C-E190" + }, + "asia-southeast1": { + "price": 0.041924, + "sku": "BFA6-56C0-FB9C" + }, + "asia-southeast2": { + "price": 0.04569716, + "sku": "78DA-97B7-4636" + }, + "australia-southeast1": { + "price": 0.04822, + "sku": "7927-0B13-F795" + }, + "europe-north1": { + "price": 0.037416, + "sku": "5737-D08F-2536" + }, + "europe-west1": { + "price": 0.037381, + "sku": "E6D3-3221-80B3" + }, + "europe-west2": { + "price": 0.043785, + "sku": "271A-7F2A-C5C5" + }, + "europe-west3": { + "price": 0.043785, + "sku": "2108-24F6-8A71" + }, + "europe-west4": { + "price": 0.037412, + "sku": "6753-90C9-DA11" + }, + "europe-west6": { + "price": 0.0, + "sku": "2B93-9A67-0964" + }, + "northamerica-northeast1": { + "price": 0.037412, + "sku": "FACC-0440-C9FE" + }, + "southamerica-east1": { + "price": 0.053944, + "sku": "A961-9CB4-C6C2" + }, + "us-central1": { + "price": 0.033982, + "sku": "0F79-08F1-0D8A" + }, + "us-east4": { + "price": 0.043785, + "sku": "A9BF-E313-5815" + }, + "us-west2": { + "price": 0.040818, + "sku": "24CA-4FEE-D2D1" + }, + "us-west3": { + "price": 0.040818, + "sku": "8826-59B8-3246" + }, + "us-west4": { + "price": 0.043785, + "sku": "A489-6BFE-F142" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.009045, + "sku": "3F5C-6E21-66F5" + }, + "asia-east2": { + "price": 0.011503, + "sku": "DB94-AFEA-B85C" + }, + "asia-northeast1": { + "price": 0.010911, + "sku": "1E75-78F3-8233" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "9CB9-B393-67D2" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "BD7F-448F-E43C" + }, + "asia-south1": { + "price": 0.008223, + "sku": "D563-64BB-36FE" + }, + "asia-southeast1": { + "price": 0.009638, + "sku": "9DD7-D863-E19E" + }, + "asia-southeast2": { + "price": 0.01050542, + "sku": "A3D8-9C0F-1FD8" + }, + "australia-southeast1": { + "price": 0.011096, + "sku": "BA40-57F6-A831" + }, + "europe-north1": { + "price": 0.009045, + "sku": "42B1-B27C-F39C" + }, + "europe-west1": { + "price": 0.009046, + "sku": "FFC6-B5DE-8BBB" + }, + "europe-west2": { + "price": 0.01007, + "sku": "03F9-658A-AE87" + }, + "europe-west3": { + "price": 0.01007, + "sku": "FC86-969E-6297" + }, + "europe-west4": { + "price": 0.009051, + "sku": "2E06-65E5-00A8" + }, + "europe-west6": { + "price": 0.0, + "sku": "40F4-71A6-4ACB" + }, + "northamerica-northeast1": { + "price": 0.009051, + "sku": "AB41-AA97-A481" + }, + "southamerica-east1": { + "price": 0.012403, + "sku": "059A-DCCE-7274" + }, + "us-central1": { + "price": 0.008223, + "sku": "93E3-1A16-2F5C" + }, + "us-east4": { + "price": 0.008798, + "sku": "80D8-E1E8-55A3" + }, + "us-west2": { + "price": 0.009868, + "sku": "6FE8-2885-1737" + }, + "us-west3": { + "price": 0.009868, + "sku": "3505-BABD-121C" + }, + "us-west4": { + "price": 0.008798, + "sku": "F0FC-3B97-9616" + } + }, + "1yr_commitment": { + "asia-east1": { + "price": 0.024788, + "sku": "7326-0C1F-4ED1" + }, + "asia-east2": { + "price": 0.029955, + "sku": "A4AF-7B97-A0AE" + }, + "asia-northeast1": { + "price": 0.027508, + "sku": "C25E-8384-C679" + }, + "asia-northeast2": { + "price": 0.027509, + "sku": "F610-F0D8-FCC1" + }, + "asia-northeast3": { + "price": 0.027509, + "sku": "BB89-0F88-7C8C" + }, + "asia-south1": { + "price": 0.025712, + "sku": "0A1B-E1BD-4C60" + }, + "asia-southeast1": { + "price": 0.02641, + "sku": "062F-00C1-34A5" + }, + "asia-southeast2": { + "price": 0.0287869, + "sku": "8A16-258F-FB98" + }, + "australia-southeast1": { + "price": 0.030395, + "sku": "6939-B072-05BB" + }, + "europe-north1": { + "price": 0.023569, + "sku": "10A1-F3D3-0956" + }, + "europe-west1": { + "price": 0.02355, + "sku": "931E-73C7-5282" + }, + "europe-west2": { + "price": 0.027559, + "sku": "9974-9EAF-858D" + }, + "europe-west3": { + "price": 0.027559, + "sku": "0169-9D02-5049" + }, + "europe-west4": { + "price": 0.023569, + "sku": "1E06-7CE3-F41A" + }, + "europe-west6": { + "price": 0.0, + "sku": "AF8B-8E84-6A88" + }, + "northamerica-northeast1": { + "price": 0.023569, + "sku": "A8CD-571D-FA06" + }, + "southamerica-east1": { + "price": 0.033992, + "sku": "3E06-74A0-81E9" + }, + "us-central1": { + "price": 0.021409, + "sku": "4F72-F1FE-430A" + }, + "us-east4": { + "price": 0.022907, + "sku": "0C8B-FB40-DC4B" + }, + "us-west2": { + "price": 0.025715, + "sku": "987E-0B74-2E00" + }, + "us-west3": { + "price": 0.025715, + "sku": "EFA8-40E5-5321" + }, + "us-west4": { + "price": 0.022907, + "sku": "9099-4641-DA8E" + } + }, + "3yr_commitment": { + "asia-east1": { + "price": 0.015739, + "sku": "3E12-C8E2-78AB" + }, + "asia-east2": { + "price": 0.019019, + "sku": "0CA0-5A7F-93FE" + }, + "asia-northeast1": { + "price": 0.017466, + "sku": "CC55-2393-6D51" + }, + "asia-northeast2": { + "price": 0.017466, + "sku": "0A88-902F-2F33" + }, + "asia-northeast3": { + "price": 0.017466, + "sku": "CBF9-6D2E-F346" + }, + "asia-south1": { + "price": 0.016327, + "sku": "8030-E422-2F81" + }, + "asia-southeast1": { + "price": 0.01677, + "sku": "41A4-D42B-B200" + }, + "asia-southeast2": { + "price": 0.0182793, + "sku": "AA1D-8279-00AD" + }, + "australia-southeast1": { + "price": 0.019288, + "sku": "8E1B-5425-70F6" + }, + "europe-north1": { + "price": 0.014967, + "sku": "F851-E252-B17B" + }, + "europe-west1": { + "price": 0.014952, + "sku": "0A0F-8854-1626" + }, + "europe-west2": { + "price": 0.017514, + "sku": "1D56-B9E4-06D0" + }, + "europe-west3": { + "price": 0.017514, + "sku": "C080-9D3C-1C93" + }, + "europe-west4": { + "price": 0.014965, + "sku": "A93D-2048-1A6D" + }, + "europe-west6": { + "price": 0.0, + "sku": "8C61-D37C-CF3E" + }, + "northamerica-northeast1": { + "price": 0.014965, + "sku": "ED8F-7512-5A1E" + }, + "southamerica-east1": { + "price": 0.021577, + "sku": "0BC9-5635-AB6A" + }, + "us-central1": { + "price": 0.013593, + "sku": "4EAA-DE28-01C8" + }, + "us-east4": { + "price": 0.017514, + "sku": "C6CA-041D-5912" + }, + "us-west2": { + "price": 0.016327, + "sku": "02EF-0DE7-34C1" + }, + "us-west3": { + "price": 0.016327, + "sku": "A75B-D4A8-40C9" + }, + "us-west4": { + "price": 0.017514, + "sku": "3D36-6670-54B6" + } + } + }, + "ram": { + "description": "compute optimized ram", + "on_demand": { + "asia-east1": { + "price": 0.005274, + "sku": "A2FA-87E4-4955" + }, + "asia-east2": { + "price": 0.006373, + "sku": "B463-9C97-CE40" + }, + "asia-northeast1": { + "price": 0.005825, + "sku": "1B15-60C2-6B63" + }, + "asia-northeast2": { + "price": 0.005825, + "sku": "D07A-1640-0B76" + }, + "asia-northeast3": { + "price": 0.005825, + "sku": "6001-A27E-20E9" + }, + "asia-south1": { + "price": 0.00547, + "sku": "F111-FD6B-27B0" + }, + "asia-southeast1": { + "price": 0.005618, + "sku": "0A77-34FA-6E87" + }, + "asia-southeast2": { + "price": 0.00612362, + "sku": "8018-291A-18DA" + }, + "australia-southeast1": { + "price": 0.006462, + "sku": "65A7-D228-0663" + }, + "europe-north1": { + "price": 0.005014, + "sku": "BE7B-727C-97BA" + }, + "europe-west1": { + "price": 0.005011, + "sku": "72E8-3980-C96D" + }, + "europe-west2": { + "price": 0.005867, + "sku": "0BD6-E233-D705" + }, + "europe-west3": { + "price": 0.005867, + "sku": "85FB-E63F-9C09" + }, + "europe-west4": { + "price": 0.005014, + "sku": "0F6A-F245-7139" + }, + "europe-west6": { + "price": 0.0, + "sku": "C0BD-78A7-3057" + }, + "northamerica-northeast1": { + "price": 0.005014, + "sku": "7F19-4937-CDCA" + }, + "southamerica-east1": { + "price": 0.007229, + "sku": "8811-1C6A-4662" + }, + "us-central1": { + "price": 0.004555, + "sku": "E7E5-0449-5933" + }, + "us-east4": { + "price": 0.005129, + "sku": "93DA-DFF5-ED89" + }, + "us-west2": { + "price": 0.005471, + "sku": "C714-6232-656B" + }, + "us-west3": { + "price": 0.005471, + "sku": "1D4E-8988-9C5F" + }, + "us-west4": { + "price": 0.005129, + "sku": "1C54-BD47-F4E3" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.001212, + "sku": "05A0-662F-50DD" + }, + "asia-east2": { + "price": 0.001549, + "sku": "5D48-F644-7B19" + }, + "asia-northeast1": { + "price": 0.001456, + "sku": "4919-FF2B-B937" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "1F15-8C6B-BBAE" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "CA41-7563-0399" + }, + "asia-south1": { + "price": 0.001102, + "sku": "6B2F-1FE6-F951" + }, + "asia-southeast1": { + "price": 0.001297, + "sku": "2BD6-8A13-69BD" + }, + "asia-southeast2": { + "price": 0.00141373, + "sku": "E375-A7F4-E388" + }, + "australia-southeast1": { + "price": 0.001483, + "sku": "412F-8A65-E79F" + }, + "europe-north1": { + "price": 0.001212, + "sku": "D1E6-DC14-31F1" + }, + "europe-west1": { + "price": 0.001212, + "sku": "9DE0-2657-7B84" + }, + "europe-west2": { + "price": 0.001347, + "sku": "5D35-58A1-9206" + }, + "europe-west3": { + "price": 0.001347, + "sku": "B698-B91F-65F3" + }, + "europe-west4": { + "price": 0.00122, + "sku": "F7D7-76CC-DFA2" + }, + "europe-west6": { + "price": 0.0, + "sku": "89C2-D9E2-4C1E" + }, + "northamerica-northeast1": { + "price": 0.00122, + "sku": "0012-B7F2-DD14" + }, + "southamerica-east1": { + "price": 0.001663, + "sku": "B488-EED1-B06A" + }, + "us-central1": { + "price": 0.001102, + "sku": "ECAE-177C-FE40" + }, + "us-east4": { + "price": 0.001179, + "sku": "CC2C-B6F6-EE25" + }, + "us-west2": { + "price": 0.00133, + "sku": "F568-25B7-207E" + }, + "us-west3": { + "price": 0.00133, + "sku": "2319-3F66-E366" + }, + "us-west4": { + "price": 0.001179, + "sku": "2FAA-90D3-F2DC" + } + }, + "1yr_commitment": { + "asia-east1": { + "price": 0.003323, + "sku": "8B0E-A350-47B4" + }, + "asia-east2": { + "price": 0.004014, + "sku": "F44A-A1AD-E44C" + }, + "asia-northeast1": { + "price": 0.00367, + "sku": "56C1-776A-EC8C" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "EC4F-0CFD-8202" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "1487-7926-A32D" + }, + "asia-south1": { + "price": 0.003445, + "sku": "C658-C8DA-61C0" + }, + "asia-southeast1": { + "price": 0.003539, + "sku": "2851-6197-53AB" + }, + "asia-southeast2": { + "price": 0.00385751, + "sku": "741D-6837-69C9" + }, + "australia-southeast1": { + "price": 0.00407, + "sku": "56E1-6500-0AA5" + }, + "europe-north1": { + "price": 0.003158, + "sku": "6E4C-D632-20F6" + }, + "europe-west1": { + "price": 0.003156, + "sku": "F2FA-4DBA-6B53" + }, + "europe-west2": { + "price": 0.003693, + "sku": "F38E-F9DD-D2B8" + }, + "europe-west3": { + "price": 0.003693, + "sku": "ED07-FCC0-BB7D" + }, + "europe-west4": { + "price": 0.003158, + "sku": "7CC5-4BC6-3539" + }, + "europe-west6": { + "price": 0.0, + "sku": "086B-40BB-56FA" + }, + "northamerica-northeast1": { + "price": 0.003158, + "sku": "AE10-A1C9-A5FF" + }, + "southamerica-east1": { + "price": 0.004557, + "sku": "9F80-7B98-6466" + }, + "us-central1": { + "price": 0.002869, + "sku": "BE48-3D79-88EE" + }, + "us-east4": { + "price": 0.00307, + "sku": "8DE8-80FC-EC11" + }, + "us-west2": { + "price": 0.003446, + "sku": "AE0C-E2BA-EAAC" + }, + "us-west3": { + "price": 0.003446, + "sku": "27AE-41B0-43BD" + }, + "us-west4": { + "price": 0.00307, + "sku": "C20F-D066-BEF9" + } + }, + "3yr_commitment": { + "asia-east1": { + "price": 0.00211, + "sku": "39A1-0CEA-2314" + }, + "asia-east2": { + "price": 0.002549, + "sku": "8B7A-D7E0-EA74" + }, + "asia-northeast1": { + "price": 0.00233, + "sku": "318E-23BD-CD76" + }, + "asia-northeast2": { + "price": 0.00233, + "sku": "8C48-D97E-E46E" + }, + "asia-northeast3": { + "price": 0.00233, + "sku": "F940-6A09-7787" + }, + "asia-south1": { + "price": 0.002188, + "sku": "509B-832B-0621" + }, + "asia-southeast1": { + "price": 0.002247, + "sku": "E296-9CF9-3D18" + }, + "asia-southeast2": { + "price": 0.00244923, + "sku": "2EC1-F1B0-66FC" + }, + "australia-southeast1": { + "price": 0.002585, + "sku": "858B-C9AA-ED29" + }, + "europe-north1": { + "price": 0.002006, + "sku": "145B-72D1-A75B" + }, + "europe-west1": { + "price": 0.002004, + "sku": "AEA6-D2DE-CB71" + }, + "europe-west2": { + "price": 0.002347, + "sku": "78A2-E9A5-0D4D" + }, + "europe-west3": { + "price": 0.002347, + "sku": "5FF1-125B-35CF" + }, + "europe-west4": { + "price": 0.002006, + "sku": "5761-B0DF-6557" + }, + "europe-west6": { + "price": 0.0, + "sku": "187B-1D7F-8C66" + }, + "northamerica-northeast1": { + "price": 0.002006, + "sku": "2DF0-3D54-D31B" + }, + "southamerica-east1": { + "price": 0.002892, + "sku": "BA4C-441D-5954" + }, + "us-central1": { + "price": 0.001822, + "sku": "B546-5F1C-3F5A" + }, + "us-east4": { + "price": 0.002052, + "sku": "B75A-46B5-3B15" + }, + "us-west2": { + "price": 0.002188, + "sku": "BF1D-E9A4-221F" + }, + "us-west3": { + "price": 0.002188, + "sku": "4BF6-3A08-B1CB" + }, + "us-west4": { + "price": 0.002052, + "sku": "2540-7630-CCF8" + } + } + } + }, + "e2": { + "cpu": { + "description": "e2 instance core", + "on_demand": { + "asia-east1": { + "price": 0.02525538, + "sku": "92C8-7C92-6AEF" + }, + "asia-east2": { + "price": 0.03051939, + "sku": "4111-7FF1-D50A" + }, + "asia-northeast1": { + "price": 0.02802642, + "sku": "EAED-8A05-843B" + }, + "asia-northeast2": { + "price": 0.02802642, + "sku": "A126-1AD8-408B" + }, + "asia-northeast3": { + "price": 0.02802642, + "sku": "9304-94C4-2117" + }, + "asia-south1": { + "price": 0.0261993, + "sku": "DFC1-04D4-B4A1" + }, + "asia-southeast1": { + "price": 0.02690931, + "sku": "7102-B9AA-2ACF" + }, + "asia-southeast2": { + "price": 0.029331147, + "sku": "621C-41D1-4D05" + }, + "australia-southeast1": { + "price": 0.03095064, + "sku": "9819-4AB8-1A87" + }, + "europe-north1": { + "price": 0.02401614, + "sku": "0981-D144-B18E" + }, + "europe-west1": { + "price": 0.02399337, + "sku": "9FE0-8F60-A9F0" + }, + "europe-west2": { + "price": 0.0281037, + "sku": "0F2A-2FA8-3F6A" + }, + "europe-west3": { + "price": 0.0281037, + "sku": "C921-088E-792A" + }, + "europe-west4": { + "price": 0.02401338, + "sku": "012A-5DBB-1352" + }, + "europe-west6": { + "price": 0.03051939, + "sku": "CCEF-2733-ADEB" + }, + "northamerica-northeast1": { + "price": 0.02401338, + "sku": "F362-BA10-04D7" + }, + "southamerica-east1": { + "price": 0.0346242, + "sku": "0442-C445-D66A" + }, + "us-central1": { + "price": 0.02181159, + "sku": "CF4E-A0C7-E3BF" + }, + "us-east4": { + "price": 0.02456745, + "sku": "D5C5-E209-22D3" + }, + "us-west2": { + "price": 0.0261993, + "sku": "00FD-B743-831B" + }, + "us-west3": { + "price": 0.0261993, + "sku": "4722-1DF4-2BB8" + }, + "us-west4": { + "price": 0.02456745, + "sku": "A084-A7CD-D375" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.0050508, + "sku": "6973-FC9A-3477" + }, + "asia-east2": { + "price": 0.00642321, + "sku": "6210-27D9-E735" + }, + "asia-northeast1": { + "price": 0.0060927, + "sku": "8952-5D4F-2594" + }, + "asia-northeast2": { + "price": 0.0060927, + "sku": "E02F-9D00-B49E" + }, + "asia-northeast3": { + "price": 0.0060927, + "sku": "1AE1-1DDD-F88D" + }, + "asia-south1": { + "price": 0.00459195, + "sku": "30C8-7CF1-533B" + }, + "asia-southeast1": { + "price": 0.005382, + "sku": "7217-D10E-E65B" + }, + "asia-southeast2": { + "price": 0.00586638, + "sku": "1FE7-9ACD-9C6F" + }, + "australia-southeast1": { + "price": 0.0061962, + "sku": "A485-4234-1419" + }, + "europe-north1": { + "price": 0.0050508, + "sku": "7E8C-4BFD-3925" + }, + "europe-west1": { + "price": 0.00505149, + "sku": "5FAA-2D1B-B96D" + }, + "europe-west2": { + "price": 0.0056235, + "sku": "7DC7-6365-092D" + }, + "europe-west3": { + "price": 0.0056235, + "sku": "D4FD-4F7D-737D" + }, + "europe-west4": { + "price": 0.00505425, + "sku": "D55E-4C77-A49B" + }, + "europe-west6": { + "price": 0.00642321, + "sku": "6282-868E-1923" + }, + "northamerica-northeast1": { + "price": 0.00505425, + "sku": "E7F5-C6C7-E913" + }, + "southamerica-east1": { + "price": 0.00692622, + "sku": "7E31-384B-D406" + }, + "us-central1": { + "price": 0.00459195, + "sku": "F179-E1EA-D97A" + }, + "us-east4": { + "price": 0.004913386, + "sku": "4E32-F036-B1D1" + }, + "us-west2": { + "price": 0.00551034, + "sku": "5F70-6286-90D6" + }, + "us-west3": { + "price": 0.00551034, + "sku": "FEF8-3531-F2EE" + }, + "us-west4": { + "price": 0.004913386, + "sku": "9F88-D0B8-615D" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + }, + "ram": { + "description": "e2 instance ram", + "on_demand": { + "asia-east1": { + "price": 0.00338514, + "sku": "FD4D-A383-8DAB" + }, + "asia-east2": { + "price": 0.00409032, + "sku": "8A68-3C47-7367" + }, + "asia-northeast1": { + "price": 0.00373911, + "sku": "CB4B-B875-93B4" + }, + "asia-northeast2": { + "price": 0.00373911, + "sku": "A5A3-A6E0-AEA8" + }, + "asia-northeast3": { + "price": 0.00373911, + "sku": "D715-4E57-BAFB" + }, + "asia-south1": { + "price": 0.00351072, + "sku": "90AB-A7A8-F873" + }, + "asia-southeast1": { + "price": 0.00360594, + "sku": "E277-7DC2-2C7D" + }, + "asia-southeast2": { + "price": 0.003930474, + "sku": "2526-CC04-D642" + }, + "australia-southeast1": { + "price": 0.00414759, + "sku": "F9E1-E6EF-86F3" + }, + "europe-north1": { + "price": 0.00321816, + "sku": "779E-BED5-F31F" + }, + "europe-west1": { + "price": 0.00321609, + "sku": "F268-6CE7-AC16" + }, + "europe-west2": { + "price": 0.00376602, + "sku": "5D70-7762-2DE7" + }, + "europe-west3": { + "price": 0.00376602, + "sku": "7D80-F9E4-6A44" + }, + "europe-west4": { + "price": 0.00321816, + "sku": "D9EA-4FF0-E394" + }, + "europe-west6": { + "price": 0.00409032, + "sku": "9C82-E173-62D8" + }, + "northamerica-northeast1": { + "price": 0.00321816, + "sku": "699E-FF84-4093" + }, + "southamerica-east1": { + "price": 0.00464025, + "sku": "C3E6-8086-831A" + }, + "us-central1": { + "price": 0.00292353, + "sku": "F449-33EC-A5EF" + }, + "us-east4": { + "price": 0.00329199, + "sku": "6D24-3682-D284" + }, + "us-west2": { + "price": 0.00351141, + "sku": "7785-EEEA-EFBC" + }, + "us-west3": { + "price": 0.00351141, + "sku": "329A-453B-3410" + }, + "us-west4": { + "price": 0.00329199, + "sku": "060E-C97B-2CC6" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.00067689, + "sku": "64F3-9E6F-1C3E" + }, + "asia-east2": { + "price": 0.00086526, + "sku": "F936-5F6B-0EA6" + }, + "asia-northeast1": { + "price": 0.00081282, + "sku": "3A75-F417-16CD" + }, + "asia-northeast2": { + "price": 0.00081282, + "sku": "0428-415B-93BE" + }, + "asia-northeast3": { + "price": 0.00081282, + "sku": "9A29-031A-486D" + }, + "asia-south1": { + "price": 0.00061548, + "sku": "6A67-7391-255D" + }, + "asia-southeast1": { + "price": 0.0007245, + "sku": "32B3-29BC-0D1E" + }, + "asia-southeast2": { + "price": 0.000789705, + "sku": "F36D-E343-7A40" + }, + "australia-southeast1": { + "price": 0.000828, + "sku": "DF25-57C5-11E5" + }, + "europe-north1": { + "price": 0.00067689, + "sku": "BEC6-F566-B9E0" + }, + "europe-west1": { + "price": 0.00067689, + "sku": "3A30-24A2-2E3A" + }, + "europe-west2": { + "price": 0.0007521, + "sku": "5602-A5DB-3699" + }, + "europe-west3": { + "price": 0.0007521, + "sku": "4BCC-93EF-0358" + }, + "europe-west4": { + "price": 0.00068103, + "sku": "7A8F-09E3-523C" + }, + "europe-west6": { + "price": 0.00086526, + "sku": "0CA0-D82B-90A5" + }, + "northamerica-northeast1": { + "price": 0.00068103, + "sku": "644C-D1AB-BDDB" + }, + "southamerica-east1": { + "price": 0.00092874, + "sku": "BB10-2508-D062" + }, + "us-central1": { + "price": 0.00061548, + "sku": "9B1F-1E62-4061" + }, + "us-east4": { + "price": 0.000658563, + "sku": "BB7E-A48A-0879" + }, + "us-west2": { + "price": 0.00074244, + "sku": "29C9-F7BA-EA1F" + }, + "us-west3": { + "price": 0.00074244, + "sku": "3343-1813-F7C7" + }, + "us-west4": { + "price": 0.000658563, + "sku": "0A84-E9CF-5229" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "e2_custom": { + "cpu": { + "description": "e2 instance core", + "on_demand": { + "asia-east1": { + "price": 0.02525538, + "sku": "92C8-7C92-6AEF" + }, + "asia-east2": { + "price": 0.03051939, + "sku": "4111-7FF1-D50A" + }, + "asia-northeast1": { + "price": 0.02802642, + "sku": "EAED-8A05-843B" + }, + "asia-northeast2": { + "price": 0.02802642, + "sku": "A126-1AD8-408B" + }, + "asia-northeast3": { + "price": 0.02802642, + "sku": "9304-94C4-2117" + }, + "asia-south1": { + "price": 0.0261993, + "sku": "DFC1-04D4-B4A1" + }, + "asia-southeast1": { + "price": 0.02690931, + "sku": "7102-B9AA-2ACF" + }, + "asia-southeast2": { + "price": 0.029331147, + "sku": "621C-41D1-4D05" + }, + "australia-southeast1": { + "price": 0.03095064, + "sku": "9819-4AB8-1A87" + }, + "europe-north1": { + "price": 0.02401614, + "sku": "0981-D144-B18E" + }, + "europe-west1": { + "price": 0.02399337, + "sku": "9FE0-8F60-A9F0" + }, + "europe-west2": { + "price": 0.0281037, + "sku": "0F2A-2FA8-3F6A" + }, + "europe-west3": { + "price": 0.0281037, + "sku": "C921-088E-792A" + }, + "europe-west4": { + "price": 0.02401338, + "sku": "012A-5DBB-1352" + }, + "europe-west6": { + "price": 0.03051939, + "sku": "CCEF-2733-ADEB" + }, + "northamerica-northeast1": { + "price": 0.02401338, + "sku": "F362-BA10-04D7" + }, + "southamerica-east1": { + "price": 0.0346242, + "sku": "0442-C445-D66A" + }, + "us-central1": { + "price": 0.02181159, + "sku": "CF4E-A0C7-E3BF" + }, + "us-east4": { + "price": 0.02456745, + "sku": "D5C5-E209-22D3" + }, + "us-west2": { + "price": 0.0261993, + "sku": "00FD-B743-831B" + }, + "us-west3": { + "price": 0.0261993, + "sku": "4722-1DF4-2BB8" + }, + "us-west4": { + "price": 0.02456745, + "sku": "A084-A7CD-D375" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.0050508, + "sku": "6973-FC9A-3477" + }, + "asia-east2": { + "price": 0.00642321, + "sku": "6210-27D9-E735" + }, + "asia-northeast1": { + "price": 0.0060927, + "sku": "8952-5D4F-2594" + }, + "asia-northeast2": { + "price": 0.0060927, + "sku": "E02F-9D00-B49E" + }, + "asia-northeast3": { + "price": 0.0060927, + "sku": "1AE1-1DDD-F88D" + }, + "asia-south1": { + "price": 0.00459195, + "sku": "30C8-7CF1-533B" + }, + "asia-southeast1": { + "price": 0.005382, + "sku": "7217-D10E-E65B" + }, + "asia-southeast2": { + "price": 0.00586638, + "sku": "1FE7-9ACD-9C6F" + }, + "australia-southeast1": { + "price": 0.0061962, + "sku": "A485-4234-1419" + }, + "europe-north1": { + "price": 0.0050508, + "sku": "7E8C-4BFD-3925" + }, + "europe-west1": { + "price": 0.00505149, + "sku": "5FAA-2D1B-B96D" + }, + "europe-west2": { + "price": 0.0056235, + "sku": "7DC7-6365-092D" + }, + "europe-west3": { + "price": 0.0056235, + "sku": "D4FD-4F7D-737D" + }, + "europe-west4": { + "price": 0.00505425, + "sku": "D55E-4C77-A49B" + }, + "europe-west6": { + "price": 0.00642321, + "sku": "6282-868E-1923" + }, + "northamerica-northeast1": { + "price": 0.00505425, + "sku": "E7F5-C6C7-E913" + }, + "southamerica-east1": { + "price": 0.00692622, + "sku": "7E31-384B-D406" + }, + "us-central1": { + "price": 0.00459195, + "sku": "F179-E1EA-D97A" + }, + "us-east4": { + "price": 0.004913386, + "sku": "4E32-F036-B1D1" + }, + "us-west2": { + "price": 0.00551034, + "sku": "5F70-6286-90D6" + }, + "us-west3": { + "price": 0.00551034, + "sku": "FEF8-3531-F2EE" + }, + "us-west4": { + "price": 0.004913386, + "sku": "9F88-D0B8-615D" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + }, + "ram": { + "description": "e2 instance ram", + "on_demand": { + "asia-east1": { + "price": 0.00338514, + "sku": "FD4D-A383-8DAB" + }, + "asia-east2": { + "price": 0.00409032, + "sku": "8A68-3C47-7367" + }, + "asia-northeast1": { + "price": 0.00373911, + "sku": "CB4B-B875-93B4" + }, + "asia-northeast2": { + "price": 0.00373911, + "sku": "A5A3-A6E0-AEA8" + }, + "asia-northeast3": { + "price": 0.00373911, + "sku": "D715-4E57-BAFB" + }, + "asia-south1": { + "price": 0.00351072, + "sku": "90AB-A7A8-F873" + }, + "asia-southeast1": { + "price": 0.00360594, + "sku": "E277-7DC2-2C7D" + }, + "asia-southeast2": { + "price": 0.003930474, + "sku": "2526-CC04-D642" + }, + "australia-southeast1": { + "price": 0.00414759, + "sku": "F9E1-E6EF-86F3" + }, + "europe-north1": { + "price": 0.00321816, + "sku": "779E-BED5-F31F" + }, + "europe-west1": { + "price": 0.00321609, + "sku": "F268-6CE7-AC16" + }, + "europe-west2": { + "price": 0.00376602, + "sku": "5D70-7762-2DE7" + }, + "europe-west3": { + "price": 0.00376602, + "sku": "7D80-F9E4-6A44" + }, + "europe-west4": { + "price": 0.00321816, + "sku": "D9EA-4FF0-E394" + }, + "europe-west6": { + "price": 0.00409032, + "sku": "9C82-E173-62D8" + }, + "northamerica-northeast1": { + "price": 0.00321816, + "sku": "699E-FF84-4093" + }, + "southamerica-east1": { + "price": 0.00464025, + "sku": "C3E6-8086-831A" + }, + "us-central1": { + "price": 0.00292353, + "sku": "F449-33EC-A5EF" + }, + "us-east4": { + "price": 0.00329199, + "sku": "6D24-3682-D284" + }, + "us-west2": { + "price": 0.00351141, + "sku": "7785-EEEA-EFBC" + }, + "us-west3": { + "price": 0.00351141, + "sku": "329A-453B-3410" + }, + "us-west4": { + "price": 0.00329199, + "sku": "060E-C97B-2CC6" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.00067689, + "sku": "64F3-9E6F-1C3E" + }, + "asia-east2": { + "price": 0.00086526, + "sku": "F936-5F6B-0EA6" + }, + "asia-northeast1": { + "price": 0.00081282, + "sku": "3A75-F417-16CD" + }, + "asia-northeast2": { + "price": 0.00081282, + "sku": "0428-415B-93BE" + }, + "asia-northeast3": { + "price": 0.00081282, + "sku": "9A29-031A-486D" + }, + "asia-south1": { + "price": 0.00061548, + "sku": "6A67-7391-255D" + }, + "asia-southeast1": { + "price": 0.0007245, + "sku": "32B3-29BC-0D1E" + }, + "asia-southeast2": { + "price": 0.000789705, + "sku": "F36D-E343-7A40" + }, + "australia-southeast1": { + "price": 0.000828, + "sku": "DF25-57C5-11E5" + }, + "europe-north1": { + "price": 0.00067689, + "sku": "BEC6-F566-B9E0" + }, + "europe-west1": { + "price": 0.00067689, + "sku": "3A30-24A2-2E3A" + }, + "europe-west2": { + "price": 0.0007521, + "sku": "5602-A5DB-3699" + }, + "europe-west3": { + "price": 0.0007521, + "sku": "4BCC-93EF-0358" + }, + "europe-west4": { + "price": 0.00068103, + "sku": "7A8F-09E3-523C" + }, + "europe-west6": { + "price": 0.00086526, + "sku": "0CA0-D82B-90A5" + }, + "northamerica-northeast1": { + "price": 0.00068103, + "sku": "644C-D1AB-BDDB" + }, + "southamerica-east1": { + "price": 0.00092874, + "sku": "BB10-2508-D062" + }, + "us-central1": { + "price": 0.00061548, + "sku": "9B1F-1E62-4061" + }, + "us-east4": { + "price": 0.000658563, + "sku": "BB7E-A48A-0879" + }, + "us-west2": { + "price": 0.00074244, + "sku": "29C9-F7BA-EA1F" + }, + "us-west3": { + "price": 0.00074244, + "sku": "3343-1813-F7C7" + }, + "us-west4": { + "price": 0.000658563, + "sku": "0A84-E9CF-5229" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "f1": { + "cpu": { + "description": "micro instance", + "on_demand": { + "asia-east1": { + "price": 0.009, + "sku": "E3EE-02EB-33B4" + }, + "asia-east2": { + "price": 0.0106, + "sku": "5B27-7C3B-BD40" + }, + "asia-northeast1": { + "price": 0.0092, + "sku": "9E0C-B73D-E7DF" + }, + "asia-northeast2": { + "price": 0.0092, + "sku": "2218-6824-F7A6" + }, + "asia-northeast3": { + "price": 0.0092, + "sku": "B268-F734-C372" + }, + "asia-south1": { + "price": 0.0091, + "sku": "A929-7679-DC50" + }, + "asia-southeast1": { + "price": 0.0092, + "sku": "21D7-4648-AED4" + }, + "asia-southeast2": { + "price": 0.010028, + "sku": "14E2-D496-E290" + }, + "australia-southeast1": { + "price": 0.0106, + "sku": "C42F-D794-5133" + }, + "europe-north1": { + "price": 0.0084, + "sku": "1228-0F9A-097E" + }, + "europe-west1": { + "price": 0.0086, + "sku": "5619-DD14-5F41" + }, + "europe-west2": { + "price": 0.0096, + "sku": "389D-815E-FE97" + }, + "europe-west3": { + "price": 0.0096, + "sku": "91C1-5F17-3531" + }, + "europe-west4": { + "price": 0.0084, + "sku": "F412-9959-3D98" + }, + "europe-west6": { + "price": 0.0106, + "sku": "6863-F40A-3E86" + }, + "northamerica-northeast1": { + "price": 0.0084, + "sku": "4B61-2549-9309" + }, + "southamerica-east1": { + "price": 0.0118, + "sku": "B67B-E4F8-5950" + }, + "us-central1": { + "price": 0.0076, + "sku": "5CE5-087B-6C3C" + }, + "us-east4": { + "price": 0.0086, + "sku": "9938-D7EE-FCAC" + }, + "us-west2": { + "price": 0.0091, + "sku": "C4BD-9ECC-F4BA" + }, + "us-west3": { + "price": 0.0091, + "sku": "54E4-6B72-6E7E" + }, + "us-west4": { + "price": 0.0086, + "sku": "BD92-3AC2-EFF7" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.0039, + "sku": "E83E-CFD3-F94F" + }, + "asia-east2": { + "price": 0.0049, + "sku": "A2DC-B9A1-2BC6" + }, + "asia-northeast1": { + "price": 0.005, + "sku": "A02B-ACB1-E1D1" + }, + "asia-northeast2": { + "price": 0.005, + "sku": "0406-771F-73F2" + }, + "asia-northeast3": { + "price": 0.005, + "sku": "85EA-C437-9174" + }, + "asia-south1": { + "price": 0.0042, + "sku": "6704-25CB-6EB7" + }, + "asia-southeast1": { + "price": 0.004, + "sku": "53E3-9D00-C5EF" + }, + "asia-southeast2": { + "price": 0.00436, + "sku": "12CB-E343-4938" + }, + "australia-southeast1": { + "price": 0.0046, + "sku": "45E3-B103-BC9A" + }, + "europe-north1": { + "price": 0.0039, + "sku": "6900-6A9D-64AC" + }, + "europe-west1": { + "price": 0.0039, + "sku": "00D4-D26B-0176" + }, + "europe-west2": { + "price": 0.0042, + "sku": "9698-9F00-B154" + }, + "europe-west3": { + "price": 0.0042, + "sku": "330A-BDFD-96A1" + }, + "europe-west4": { + "price": 0.0039, + "sku": "848B-5B07-23B2" + }, + "europe-west6": { + "price": 0.0049, + "sku": "179F-D685-8993" + }, + "northamerica-northeast1": { + "price": 0.0039, + "sku": "F568-0296-93C9" + }, + "southamerica-east1": { + "price": 0.0052, + "sku": "69B0-F5A2-C2B9" + }, + "us-central1": { + "price": 0.0035, + "sku": "D04B-B3CA-49CB" + }, + "us-east4": { + "price": 0.00375, + "sku": "E23E-3488-1D27" + }, + "us-west2": { + "price": 0.0042, + "sku": "6083-E615-99BE" + }, + "us-west3": { + "price": 0.0042, + "sku": "5875-7C5F-96BF" + }, + "us-west4": { + "price": 0.00375, + "sku": "3637-6C2D-1CD7" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "g1": { + "cpu": { + "description": "small instance", + "on_demand": { + "asia-east1": { + "price": 0.03, + "sku": "1195-456B-30CB" + }, + "asia-east2": { + "price": 0.0359, + "sku": "45FF-A00E-2272" + }, + "asia-northeast1": { + "price": 0.0322, + "sku": "07E8-C8A3-A331" + }, + "asia-northeast2": { + "price": 0.0322, + "sku": "0341-0ADC-3AA8" + }, + "asia-northeast3": { + "price": 0.0322, + "sku": "0623-BE6D-3CEC" + }, + "asia-south1": { + "price": 0.0308, + "sku": "7F4C-6834-45E0" + }, + "asia-southeast1": { + "price": 0.0311, + "sku": "F8F4-3E2C-A4B2" + }, + "asia-southeast2": { + "price": 0.033899, + "sku": "127F-3618-DB61" + }, + "australia-southeast1": { + "price": 0.0357, + "sku": "FBCF-0A11-DCA0" + }, + "europe-north1": { + "price": 0.0283, + "sku": "B2A4-8867-D246" + }, + "europe-west1": { + "price": 0.0285, + "sku": "0DA7-1812-F2F5" + }, + "europe-west2": { + "price": 0.0324, + "sku": "6D07-090C-335C" + }, + "europe-west3": { + "price": 0.0324, + "sku": "7BDC-D342-257A" + }, + "europe-west4": { + "price": 0.0283, + "sku": "8054-75A6-85C3" + }, + "europe-west6": { + "price": 0.0359, + "sku": "EAFF-C2C8-0B73" + }, + "northamerica-northeast1": { + "price": 0.0283, + "sku": "86E6-573F-448F" + }, + "southamerica-east1": { + "price": 0.04, + "sku": "2A24-2BF1-650C" + }, + "us-central1": { + "price": 0.0257, + "sku": "82AF-89FC-240D" + }, + "us-east4": { + "price": 0.0289, + "sku": "B736-1B84-BD10" + }, + "us-west2": { + "price": 0.0308, + "sku": "9DCB-8EF5-064E" + }, + "us-west3": { + "price": 0.0308, + "sku": "E27F-2A30-ACED" + }, + "us-west4": { + "price": 0.0289, + "sku": "A12E-2B48-A58C" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.0077, + "sku": "E86C-92AA-38A2" + }, + "asia-east2": { + "price": 0.0098, + "sku": "D840-3224-A793" + }, + "asia-northeast1": { + "price": 0.01, + "sku": "080C-ACFD-8580" + }, + "asia-northeast2": { + "price": 0.01, + "sku": "1A89-D766-E0BC" + }, + "asia-northeast3": { + "price": 0.01, + "sku": "52AF-4FB2-F046" + }, + "asia-south1": { + "price": 0.0084, + "sku": "BCCA-BA30-5966" + }, + "asia-southeast1": { + "price": 0.0081, + "sku": "7FF7-C03E-4487" + }, + "asia-southeast2": { + "price": 0.008829, + "sku": "17C6-C2D3-02E8" + }, + "australia-southeast1": { + "price": 0.0093, + "sku": "39B7-E56A-0E54" + }, + "europe-north1": { + "price": 0.0077, + "sku": "5E75-F4E9-6CA5" + }, + "europe-west1": { + "price": 0.0077, + "sku": "1D5D-C070-F429" + }, + "europe-west2": { + "price": 0.0084, + "sku": "B4F6-C1D4-59CD" + }, + "europe-west3": { + "price": 0.0084, + "sku": "2ECA-B17F-09E9" + }, + "europe-west4": { + "price": 0.0077, + "sku": "C451-C9AA-50C4" + }, + "europe-west6": { + "price": 0.0098, + "sku": "E85D-5386-0C80" + }, + "northamerica-northeast1": { + "price": 0.0077, + "sku": "C770-61BC-9512" + }, + "southamerica-east1": { + "price": 0.0104, + "sku": "304B-CFBA-A0A0" + }, + "us-central1": { + "price": 0.007, + "sku": "CFA2-8CBE-B7E7" + }, + "us-east4": { + "price": 0.00749, + "sku": "A5E0-363B-BB35" + }, + "us-west2": { + "price": 0.0084, + "sku": "7707-ADB6-FD3E" + }, + "us-west3": { + "price": 0.0084, + "sku": "0299-2D76-E6CB" + }, + "us-west4": { + "price": 0.00749, + "sku": "B962-CF97-055A" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "m1": { + "cpu": { + "description": "memory-optimized instance core", + "on_demand": { + "asia-east1": { + "price": 0.0403305, + "sku": "368F-A091-4474" + }, + "asia-east2": { + "price": 0.04872, + "sku": "EAB6-6DF7-0B44" + }, + "asia-northeast1": { + "price": 0.0426489, + "sku": "255E-0C41-3813" + }, + "asia-northeast2": { + "price": 0.0426489, + "sku": "B386-201E-15BC" + }, + "asia-northeast3": { + "price": 0.0426489, + "sku": "22C9-A969-59CD" + }, + "asia-south1": { + "price": 0.03986, + "sku": "3FC5-50D3-F70B" + }, + "asia-southeast1": { + "price": 0.0409, + "sku": "B428-ABC6-FFED" + }, + "asia-southeast2": { + "price": 0.044630922, + "sku": "EC69-8D9F-B6F8" + }, + "australia-southeast1": { + "price": 0.047124, + "sku": "DDC6-8AE6-ECF6" + }, + "europe-north1": { + "price": 0.036542, + "sku": "B26C-33C9-659D" + }, + "europe-west1": { + "price": 0.03831345, + "sku": "8756-8763-C679" + }, + "europe-west2": { + "price": 0.0427266, + "sku": "FBD3-5D63-8863" + }, + "europe-west3": { + "price": 0.0427266, + "sku": "61F7-427C-1CD4" + }, + "europe-west4": { + "price": 0.036542, + "sku": "932F-6530-0191" + }, + "europe-west6": { + "price": 0.04872, + "sku": "F9CE-88E7-95F7" + }, + "northamerica-northeast1": { + "price": 0.0365421, + "sku": "22FE-C374-7975" + }, + "southamerica-east1": { + "price": 0.0527, + "sku": "7EAC-C91A-83B4" + }, + "us-central1": { + "price": 0.0348, + "sku": "AE53-03EE-A981" + }, + "us-east4": { + "price": 0.0392322, + "sku": "C208-228E-1A82" + }, + "us-west2": { + "price": 0.039869, + "sku": "520C-E3E0-82F8" + }, + "us-west3": { + "price": 0.039869, + "sku": "A5BD-7970-24DB" + }, + "us-west4": { + "price": 0.0392322, + "sku": "0B8E-FF88-28DE" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.00806, + "sku": "F79A-D7CD-66F3" + }, + "asia-east2": { + "price": 0.00928, + "sku": "3FCF-3DF9-D9C8" + }, + "asia-northeast1": { + "price": 0.0093, + "sku": "9458-4F8B-0AEC" + }, + "asia-northeast2": { + "price": 0.0093, + "sku": "0C72-D230-9E14" + }, + "asia-northeast3": { + "price": 0.0093, + "sku": "E0BF-A729-9588" + }, + "asia-south1": { + "price": 0.008, + "sku": "1485-8B90-F068" + }, + "asia-southeast1": { + "price": 0.00819, + "sku": "D92B-7B2B-F4CB" + }, + "asia-southeast2": { + "price": 0.0089271, + "sku": "3364-3614-66EE" + }, + "australia-southeast1": { + "price": 0.00943, + "sku": "399D-16DA-DD88" + }, + "europe-north1": { + "price": 0.0073, + "sku": "379E-87AB-8932" + }, + "europe-west1": { + "price": 0.00806, + "sku": "6337-4002-15AA" + }, + "europe-west2": { + "price": 0.00856, + "sku": "DD2B-2958-70C1" + }, + "europe-west3": { + "price": 0.00856, + "sku": "EF22-BD86-116D" + }, + "europe-west4": { + "price": 0.0073, + "sku": "3AA3-97C7-B374" + }, + "europe-west6": { + "price": 0.00928, + "sku": "9DBF-7674-0A55" + }, + "northamerica-northeast1": { + "price": 0.0076965, + "sku": "B274-B306-F010" + }, + "southamerica-east1": { + "price": 0.0105, + "sku": "AA28-20FF-AC4A" + }, + "us-central1": { + "price": 0.00733, + "sku": "6062-55FB-81C1" + }, + "us-east4": { + "price": 0.0078, + "sku": "F75F-5F15-2C99" + }, + "us-west2": { + "price": 0.008, + "sku": "F45A-2852-4D9E" + }, + "us-west3": { + "price": 0.008, + "sku": "145A-2360-4793" + }, + "us-west4": { + "price": 0.00784, + "sku": "F30A-C4F1-2291" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + }, + "ram": { + "description": "memory-optimized instance ram", + "on_demand": { + "asia-east1": { + "price": 0.0059225, + "sku": "4549-962B-5169" + }, + "asia-east2": { + "price": 0.00714, + "sku": "F11D-CB9F-801C" + }, + "asia-northeast1": { + "price": 0.0062307, + "sku": "757F-6F9E-CCEC" + }, + "asia-northeast2": { + "price": 0.0062307, + "sku": "DF16-B759-DA06" + }, + "asia-northeast3": { + "price": 0.0062307, + "sku": "C235-7637-B9CC" + }, + "asia-south1": { + "price": 0.0058512, + "sku": "1EB9-E952-4664" + }, + "asia-southeast1": { + "price": 0.0060099, + "sku": "C18E-DD54-9DD1" + }, + "asia-southeast2": { + "price": 0.006550791, + "sku": "4406-4684-A0CE" + }, + "australia-southeast1": { + "price": 0.0069115, + "sku": "3ED9-BF4D-E2BC" + }, + "europe-north1": { + "price": 0.005364, + "sku": "BB08-FB96-AEC3" + }, + "europe-west1": { + "price": 0.0056258, + "sku": "A187-AA4A-8383" + }, + "europe-west2": { + "price": 0.00627095, + "sku": "D5BC-B267-D021" + }, + "europe-west3": { + "price": 0.00627095, + "sku": "E0B1-8FC0-EFC3" + }, + "europe-west4": { + "price": 0.005364, + "sku": "24D0-8D63-21AA" + }, + "europe-west6": { + "price": 0.00714, + "sku": "F410-ABCD-B49C" + }, + "northamerica-northeast1": { + "price": 0.0053636, + "sku": "21DD-50C0-34A1" + }, + "southamerica-east1": { + "price": 0.0077, + "sku": "6545-FD2E-F55F" + }, + "us-central1": { + "price": 0.0051, + "sku": "9DFC-84DE-A1D6" + }, + "us-east4": { + "price": 0.0057592, + "sku": "A09C-017D-4EEB" + }, + "us-west2": { + "price": 0.005852, + "sku": "3861-1526-7A78" + }, + "us-west3": { + "price": 0.005852, + "sku": "57A3-FC48-F966" + }, + "us-west4": { + "price": 0.0057592, + "sku": "6478-11AD-0696" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.00118, + "sku": "D529-5FED-06B8" + }, + "asia-east2": { + "price": 0.00136, + "sku": "5523-88CC-1809" + }, + "asia-northeast1": { + "price": 0.00135, + "sku": "7CDE-C4C3-FE63" + }, + "asia-southeast1": { + "price": 0.0012, + "sku": "5D8A-E226-4611" + }, + "australia-southeast1": { + "price": 0.00138, + "sku": "0D6B-4D92-83C4" + }, + "europe-north1": { + "price": 0.0011, + "sku": "6902-4A1A-6F6D" + }, + "europe-west1": { + "price": 0.00118, + "sku": "FA7E-F17D-E893" + }, + "europe-west2": { + "price": 0.00125, + "sku": "918D-9494-17C2" + }, + "europe-west3": { + "price": 0.00125, + "sku": "7A03-4376-076C" + }, + "europe-west4": { + "price": 0.0011, + "sku": "4B14-E521-D470" + }, + "europe-west6": { + "price": 0.00136, + "sku": "20FD-6672-55FB" + }, + "northamerica-northeast1": { + "price": 0.001134, + "sku": "B6F0-51EA-221B" + }, + "us-central1": { + "price": 0.00108, + "sku": "0EC7-39FC-0E4D" + }, + "us-east4": { + "price": 0.00116, + "sku": "14DF-B98D-A81B" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "n1": { + "cpu": { + "description": "n1 predefined instance core", + "on_demand": { + "asia-east1": { + "price": 0.036602, + "sku": "4842-5B9D-3916" + }, + "asia-east2": { + "price": 0.044231, + "sku": "3916-2122-654D" + }, + "asia-northeast1": { + "price": 0.040618, + "sku": "9050-A990-A974" + }, + "asia-northeast2": { + "price": 0.040618, + "sku": "86F0-A9F2-C89D" + }, + "asia-northeast3": { + "price": 0.040618, + "sku": "1C6C-CD98-D14F" + }, + "asia-south1": { + "price": 0.03797, + "sku": "75BE-4FB0-E4E8" + }, + "asia-southeast1": { + "price": 0.038999, + "sku": "7ED6-57D6-C844" + }, + "asia-southeast2": { + "price": 0.04250891, + "sku": "E495-6D54-813B" + }, + "australia-southeast1": { + "price": 0.044856, + "sku": "EC56-26CB-F016" + }, + "europe-north1": { + "price": 0.034806, + "sku": "C39A-7330-9248" + }, + "europe-west1": { + "price": 0.034773, + "sku": "9431-52B1-2C4F" + }, + "europe-west2": { + "price": 0.04073, + "sku": "E3BF-72A4-1954" + }, + "europe-west3": { + "price": 0.04073, + "sku": "A9C0-BADB-1C34" + }, + "europe-west4": { + "price": 0.034802, + "sku": "62A6-21EE-5C6A" + }, + "europe-west6": { + "price": 0.044231, + "sku": "718A-81BA-2CBB" + }, + "northamerica-northeast1": { + "price": 0.034802, + "sku": "12C8-4A10-BA76" + }, + "southamerica-east1": { + "price": 0.05018, + "sku": "E8F8-A4B0-C91F" + }, + "us-central1": { + "price": 0.031611, + "sku": "2E27-4F75-95CD" + }, + "us-east4": { + "price": 0.035605, + "sku": "2026-872A-3AB3" + }, + "us-west2": { + "price": 0.03797, + "sku": "ADC5-CFA0-B149" + }, + "us-west3": { + "price": 0.03797, + "sku": "87B9-CB23-ACF7" + }, + "us-west4": { + "price": 0.035605, + "sku": "E088-3290-2E7A" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.00732, + "sku": "A394-399A-D2D0" + }, + "asia-east2": { + "price": 0.009309, + "sku": "34C1-1BCA-2841" + }, + "asia-northeast1": { + "price": 0.00883, + "sku": "B849-D3C1-0755" + }, + "asia-northeast2": { + "price": 0.00883, + "sku": "E895-FE84-D802" + }, + "asia-northeast3": { + "price": 0.00883, + "sku": "954F-86D1-53D3" + }, + "asia-south1": { + "price": 0.006655, + "sku": "0F2B-3CF5-9946" + }, + "asia-southeast1": { + "price": 0.0078, + "sku": "9194-0E67-85BC" + }, + "asia-southeast2": { + "price": 0.008502, + "sku": "56A1-D7A6-3812" + }, + "australia-southeast1": { + "price": 0.00898, + "sku": "1BE3-7C1B-4E3E" + }, + "europe-north1": { + "price": 0.00732, + "sku": "BA5F-E81B-C55F" + }, + "europe-west1": { + "price": 0.007321, + "sku": "04D9-CEFB-F0AA" + }, + "europe-west2": { + "price": 0.00815, + "sku": "5E35-3492-165F" + }, + "europe-west3": { + "price": 0.00815, + "sku": "9932-86F9-C0C7" + }, + "europe-west4": { + "price": 0.007325, + "sku": "9188-48E6-B63D" + }, + "europe-west6": { + "price": 0.009309, + "sku": "C8EA-44D0-FFA5" + }, + "northamerica-northeast1": { + "price": 0.007325, + "sku": "DECB-16BA-C5EA" + }, + "southamerica-east1": { + "price": 0.010038, + "sku": "5623-1122-9C43" + }, + "us-central1": { + "price": 0.006655, + "sku": "D498-1ECA-87C1" + }, + "us-east4": { + "price": 0.00712085, + "sku": "023F-CB27-DC68" + }, + "us-west2": { + "price": 0.007986, + "sku": "F7B3-698A-A352" + }, + "us-west3": { + "price": 0.007986, + "sku": "6510-2C5E-DEEC" + }, + "us-west4": { + "price": 0.00712085, + "sku": "7A0C-31DE-0CD6" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + }, + "ram": { + "description": "n1 predefined instance ram", + "on_demand": { + "asia-east1": { + "price": 0.004906, + "sku": "C274-DFF1-D882" + }, + "asia-east2": { + "price": 0.005928, + "sku": "0CFE-58D2-2D8D" + }, + "asia-northeast1": { + "price": 0.005419, + "sku": "A444-A355-F28C" + }, + "asia-northeast2": { + "price": 0.005419, + "sku": "B407-487E-1CB5" + }, + "asia-northeast3": { + "price": 0.005419, + "sku": "6B10-CEC7-0965" + }, + "asia-south1": { + "price": 0.005088, + "sku": "5736-3E10-2B21" + }, + "asia-southeast1": { + "price": 0.005226, + "sku": "0143-7EA7-329F" + }, + "asia-southeast2": { + "price": 0.00569634, + "sku": "CDA7-F08D-9E3B" + }, + "australia-southeast1": { + "price": 0.006011, + "sku": "F2CE-80F1-A345" + }, + "europe-north1": { + "price": 0.004664, + "sku": "924B-F033-FB24" + }, + "europe-west1": { + "price": 0.004661, + "sku": "39F4-0112-6F39" + }, + "europe-west2": { + "price": 0.005458, + "sku": "FCA7-22FF-B1CC" + }, + "europe-west3": { + "price": 0.005458, + "sku": "5C8C-3C2D-B331" + }, + "europe-west4": { + "price": 0.004664, + "sku": "7919-4540-EDB2" + }, + "europe-west6": { + "price": 0.005928, + "sku": "000F-E31B-1D6F" + }, + "northamerica-northeast1": { + "price": 0.004664, + "sku": "E131-9E4D-4A38" + }, + "southamerica-east1": { + "price": 0.006725, + "sku": "E128-228B-EA2A" + }, + "us-central1": { + "price": 0.004237, + "sku": "6C71-E844-38BC" + }, + "us-east4": { + "price": 0.004771, + "sku": "6E2A-DCD9-87ED" + }, + "us-west2": { + "price": 0.005089, + "sku": "3500-0487-459B" + }, + "us-west3": { + "price": 0.005089, + "sku": "F21A-1162-D59D" + }, + "us-west4": { + "price": 0.004771, + "sku": "5A9F-8B65-5A3D" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.000981, + "sku": "75FE-5894-4D64" + }, + "asia-east2": { + "price": 0.001254, + "sku": "4F89-2441-367E" + }, + "asia-northeast1": { + "price": 0.001178, + "sku": "44F6-78B0-2A27" + }, + "asia-northeast2": { + "price": 0.001178, + "sku": "D4C1-CA8D-BFFE" + }, + "asia-northeast3": { + "price": 0.001178, + "sku": "AE77-3838-E0A9" + }, + "asia-south1": { + "price": 0.000892, + "sku": "4C6A-7A38-6859" + }, + "asia-southeast1": { + "price": 0.00105, + "sku": "8569-AA08-54BE" + }, + "asia-southeast2": { + "price": 0.0011445, + "sku": "23F4-3089-DC48" + }, + "australia-southeast1": { + "price": 0.0012, + "sku": "2E28-1B91-432D" + }, + "europe-north1": { + "price": 0.000981, + "sku": "876D-124E-0B56" + }, + "europe-west1": { + "price": 0.000981, + "sku": "10A0-7F67-697B" + }, + "europe-west2": { + "price": 0.00109, + "sku": "BCAF-CC85-AEB8" + }, + "europe-west3": { + "price": 0.00109, + "sku": "610C-22A1-AC4F" + }, + "europe-west4": { + "price": 0.000987, + "sku": "B5CD-75E5-0CC1" + }, + "europe-west6": { + "price": 0.001254, + "sku": "9BC9-5D6C-0964" + }, + "northamerica-northeast1": { + "price": 0.000987, + "sku": "37A0-19CB-8F90" + }, + "southamerica-east1": { + "price": 0.001346, + "sku": "9F1D-02E1-5052" + }, + "us-central1": { + "price": 0.000892, + "sku": "5451-0A15-0123" + }, + "us-east4": { + "price": 0.00095444, + "sku": "6BBE-FBC0-9924" + }, + "us-west2": { + "price": 0.001076, + "sku": "9C13-3C3C-28B3" + }, + "us-west3": { + "price": 0.001076, + "sku": "E2C2-F9AF-55A5" + }, + "us-west4": { + "price": 0.00095444, + "sku": "F824-3DD5-2F37" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "n1_custom": { + "cpu": { + "description": "custom instance core", + "on_demand": { + "asia-east1": { + "price": 0.031844, + "sku": "AE97-3760-ECCC" + }, + "asia-east2": { + "price": 0.038481, + "sku": "9669-248F-CE45" + }, + "asia-northeast1": { + "price": 0.040618, + "sku": "DEA0-DBFB-BAB4" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "E891-CC68-96D1" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "6F2A-8ADB-88C3" + }, + "asia-south1": { + "price": 0.037966, + "sku": "FC69-4A67-C34D" + }, + "asia-southeast1": { + "price": 0.033929, + "sku": "FDBB-84BE-0AF7" + }, + "asia-southeast2": { + "price": 0.04250564, + "sku": "F296-7177-913D" + }, + "australia-southeast1": { + "price": 0.04488, + "sku": "CACB-AC79-18A4" + }, + "europe-north1": { + "price": 0.030281, + "sku": "AD11-3DC6-E076" + }, + "europe-west1": { + "price": 0.030253, + "sku": "6672-F702-DDC4" + }, + "europe-west2": { + "price": 0.035435, + "sku": "CB66-DAAE-8837" + }, + "europe-west3": { + "price": 0.040692, + "sku": "C836-3D4C-F874" + }, + "europe-west4": { + "price": 0.034802, + "sku": "F052-0029-BECD" + }, + "europe-west6": { + "price": 0.0, + "sku": "9C19-672A-2011" + }, + "northamerica-northeast1": { + "price": 0.034802, + "sku": "B4CA-178A-4909" + }, + "southamerica-east1": { + "price": 0.05019, + "sku": "E4B6-CD20-6438" + }, + "us-central1": { + "price": 0.033174, + "sku": "ACBC-6999-A1C4" + }, + "us-east4": { + "price": 0.037364, + "sku": "5B11-C3DF-56CB" + }, + "us-west2": { + "price": 0.03797, + "sku": "39D2-E298-5C3E" + }, + "us-west3": { + "price": 0.033034, + "sku": "C87C-9C22-51BE" + }, + "us-west4": { + "price": 0.030976, + "sku": "8ACA-B986-2E54" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.00768, + "sku": "FF44-A271-4CEC" + }, + "asia-east2": { + "price": 0.009309, + "sku": "D5D4-354F-19BB" + }, + "asia-northeast1": { + "price": 0.00883, + "sku": "ABD1-936E-D011" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "BF7C-9CE0-56E1" + }, + "asia-northeast3": { + "price": 0.00883, + "sku": "C40D-144A-93D0" + }, + "asia-south1": { + "price": 0.007992, + "sku": "F501-BCB0-058C" + }, + "asia-southeast1": { + "price": 0.0078, + "sku": "7AB3-E65E-6A09" + }, + "asia-southeast2": { + "price": 0.008502, + "sku": "F5A2-5011-227E" + }, + "australia-southeast1": { + "price": 0.00898, + "sku": "AA06-041C-B2E0" + }, + "europe-north1": { + "price": 0.00842, + "sku": "DD27-F551-D767" + }, + "europe-west1": { + "price": 0.008828, + "sku": "EB45-91A7-F2E5" + }, + "europe-west2": { + "price": 0.009368, + "sku": "FC19-F2A6-31EC" + }, + "europe-west3": { + "price": 0.009368, + "sku": "C50B-D7ED-1324" + }, + "europe-west4": { + "price": 0.007325, + "sku": "79E4-DAFD-A17D" + }, + "europe-west6": { + "price": 0.0, + "sku": "D3FD-8C01-5400" + }, + "northamerica-northeast1": { + "price": 0.007325, + "sku": "DBC1-6722-F33A" + }, + "southamerica-east1": { + "price": 0.010038, + "sku": "140D-96A8-930A" + }, + "us-central1": { + "price": 0.008023, + "sku": "75F9-48A9-60C5" + }, + "us-east4": { + "price": 0.007469, + "sku": "6B41-F7B8-2477" + }, + "us-west2": { + "price": 0.009179, + "sku": "F6A5-D0C2-7D24" + }, + "us-west3": { + "price": 0.009179, + "sku": "EA15-EAE2-3514" + }, + "us-west4": { + "price": 0.008585, + "sku": "9086-9A1E-5408" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + }, + "ram": { + "description": "custom instance ram", + "on_demand": { + "asia-east1": { + "price": 0.00515, + "sku": "ACE4-4FE6-641C" + }, + "asia-east2": { + "price": 0.005928, + "sku": "D93C-AF72-8A40" + }, + "asia-northeast1": { + "price": 0.005418, + "sku": "F68A-05BC-1EE9" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "F787-522B-80EB" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "3860-1A51-6AC0" + }, + "asia-south1": { + "price": 0.005088, + "sku": "88AC-E248-BFC6" + }, + "asia-southeast1": { + "price": 0.005226, + "sku": "7A71-9CF7-E88F" + }, + "asia-southeast2": { + "price": 0.00569634, + "sku": "8128-3483-7333" + }, + "australia-southeast1": { + "price": 0.00523, + "sku": "3F85-10A4-440C" + }, + "europe-north1": { + "price": 0.004058, + "sku": "E958-DC4F-A16B" + }, + "europe-west1": { + "price": 0.004892, + "sku": "CA5F-A13B-29EA" + }, + "europe-west2": { + "price": 0.004748, + "sku": "B1CB-59AC-0785" + }, + "europe-west3": { + "price": 0.004748, + "sku": "89BC-9DB5-3AB6" + }, + "europe-west4": { + "price": 0.004664, + "sku": "C1AD-7471-F6C1" + }, + "europe-west6": { + "price": 0.0, + "sku": "A43B-CA38-009A" + }, + "northamerica-northeast1": { + "price": 0.004664, + "sku": "FAD2-8331-1006" + }, + "southamerica-east1": { + "price": 0.006729, + "sku": "C76B-0D36-2457" + }, + "us-central1": { + "price": 0.003686, + "sku": "CED4-7119-A546" + }, + "us-east4": { + "price": 0.005008, + "sku": "A996-8018-FA18" + }, + "us-west2": { + "price": 0.005089, + "sku": "B371-4493-0816" + }, + "us-west3": { + "price": 0.004427, + "sku": "EE37-2679-BDEA" + }, + "us-west4": { + "price": 0.004151, + "sku": "BAB5-46F3-C9B8" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.001184, + "sku": "C7E0-422B-62D3" + }, + "asia-east2": { + "price": 0.001441, + "sku": "F46B-1AB0-23A6" + }, + "asia-northeast1": { + "price": 0.001178, + "sku": "91CC-B1CB-67BF" + }, + "asia-northeast2": { + "price": 0.001178, + "sku": "F1BB-FF04-7211" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "B2EA-B321-C461" + }, + "asia-south1": { + "price": 0.001076, + "sku": "BDE8-8BDC-9B78" + }, + "asia-southeast1": { + "price": 0.001045, + "sku": "B35B-6893-9B34" + }, + "asia-southeast2": { + "price": 0.00113905, + "sku": "B992-E9B8-882E" + }, + "australia-southeast1": { + "price": 0.0012, + "sku": "AAC6-4C4E-9182" + }, + "europe-north1": { + "price": 0.000981, + "sku": "FB19-D4A5-7CB2" + }, + "europe-west1": { + "price": 0.00103, + "sku": "B30F-1A46-C1FA" + }, + "europe-west2": { + "price": 0.00109, + "sku": "F5B4-9598-AE08" + }, + "europe-west3": { + "price": 0.00109, + "sku": "A24F-D81B-FE54" + }, + "europe-west4": { + "price": 0.000987, + "sku": "C40E-5666-9BB0" + }, + "europe-west6": { + "price": 0.0, + "sku": "AF15-FFC2-B709" + }, + "northamerica-northeast1": { + "price": 0.000987, + "sku": "CE02-33FE-B41A" + }, + "southamerica-east1": { + "price": 0.001346, + "sku": "5EB7-C122-50F2" + }, + "us-central1": { + "price": 0.00108, + "sku": "BCE4-4AB0-B7F2" + }, + "us-east4": { + "price": 0.001006, + "sku": "DE9E-4265-DD95" + }, + "us-west2": { + "price": 0.001237, + "sku": "A88B-FA56-9864" + }, + "us-west3": { + "price": 0.001076, + "sku": "9D42-E6F5-C317" + }, + "us-west4": { + "price": 0.001006, + "sku": "E8EA-5218-087B" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "n1_custom_extended": { + "cpu": {}, + "ram": { + "description": "custom extended instance ram", + "on_demand": { + "asia-east1": { + "price": 0.011059, + "sku": "725E-B154-E759" + }, + "asia-east2": { + "price": 0.0127328, + "sku": "914B-3C9E-6C47" + }, + "asia-northeast1": { + "price": 0.011667, + "sku": "EAA8-2755-8551" + }, + "asia-northeast2": { + "price": 0.011667, + "sku": "F91C-7514-9896" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "3663-7764-1304" + }, + "asia-south1": { + "price": 0.010929, + "sku": "3C1F-0B09-F3E8" + }, + "asia-southeast1": { + "price": 0.011225, + "sku": "E97F-57F5-F341" + }, + "asia-southeast2": { + "price": 0.01223525, + "sku": "1854-0F1D-CA02" + }, + "australia-southeast1": { + "price": 0.01291, + "sku": "4B13-D85C-B34B" + }, + "europe-north1": { + "price": 0.010018, + "sku": "D5DF-A49F-8441" + }, + "europe-west1": { + "price": 0.010506, + "sku": "6E4E-1FAC-3BA5" + }, + "europe-west2": { + "price": 0.01171, + "sku": "E2F1-104D-AE7B" + }, + "europe-west3": { + "price": 0.01171, + "sku": "4816-A0E6-FF7E" + }, + "europe-west4": { + "price": 0.010018, + "sku": "C5A2-E156-F885" + }, + "europe-west6": { + "price": 0.0, + "sku": "A260-4B3D-F56A" + }, + "northamerica-northeast1": { + "price": 0.0100182, + "sku": "5665-F102-CEB4" + }, + "southamerica-east1": { + "price": 0.01445, + "sku": "611C-42A7-DC0D" + }, + "us-central1": { + "price": 0.00955, + "sku": "E8A6-06D8-F69C" + }, + "us-east4": { + "price": 0.010756, + "sku": "4649-0BEC-F3AD" + }, + "us-west2": { + "price": 0.010931, + "sku": "472A-2C0D-17F3" + }, + "us-west3": { + "price": 0.010931, + "sku": "B577-8556-86B0" + }, + "us-west4": { + "price": 0.010756, + "sku": "DEAA-CEB1-1AB2" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.002212, + "sku": "AD3E-21B0-2E19" + }, + "asia-east2": { + "price": 0.002686, + "sku": "D42D-6AF6-E1E8" + }, + "asia-northeast1": { + "price": 0.002915, + "sku": "BF22-AA2D-C6EF" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "DE6F-1914-7935" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "5A54-8149-17D5" + }, + "asia-south1": { + "price": 0.002014, + "sku": "FAE0-6792-F080" + }, + "asia-southeast1": { + "price": 0.002245, + "sku": "FE8F-FAED-73CD" + }, + "asia-southeast2": { + "price": 0.0028122, + "sku": "FEF2-DAC9-0EB4" + }, + "australia-southeast1": { + "price": 0.002966, + "sku": "AE50-BD85-57CA" + }, + "europe-north1": { + "price": 0.002114, + "sku": "F7E9-247E-958F" + }, + "europe-west1": { + "price": 0.002212, + "sku": "D7CC-99F9-9B2C" + }, + "europe-west2": { + "price": 0.00235, + "sku": "DFE1-710A-DEAD" + }, + "europe-west3": { + "price": 0.00235, + "sku": "E7AC-FC40-BC83" + }, + "europe-west4": { + "price": 0.002114, + "sku": "99DC-5643-C190" + }, + "europe-west6": { + "price": 0.0, + "sku": "F824-DC48-0AD1" + }, + "northamerica-northeast1": { + "price": 0.0021139, + "sku": "EBD6-FA6A-27A4" + }, + "southamerica-east1": { + "price": 0.00289, + "sku": "B26D-4ED9-4284" + }, + "us-central1": { + "price": 0.002014, + "sku": "C1E6-3CA5-CE59" + }, + "us-east4": { + "price": 0.002155, + "sku": "CA5A-F753-AA22" + }, + "us-west2": { + "price": 0.002305, + "sku": "E967-BDB5-51FB" + }, + "us-west3": { + "price": 0.002649, + "sku": "B576-75D3-D129" + }, + "us-west4": { + "price": 0.002155, + "sku": "C02B-F870-40DC" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "n2": { + "cpu": { + "description": "n2 instance core", + "on_demand": { + "asia-east1": { + "price": 0.036602, + "sku": "1B8C-264F-447E" + }, + "asia-east2": { + "price": 0.044231, + "sku": "68CB-4CDF-D6C2" + }, + "asia-northeast1": { + "price": 0.040618, + "sku": "E137-7DDF-1143" + }, + "asia-northeast2": { + "price": 0.040618, + "sku": "C4D8-6E4C-3BF9" + }, + "asia-northeast3": { + "price": 0.040618, + "sku": "D71C-9B8F-0ED9" + }, + "asia-south1": { + "price": 0.03797, + "sku": "3A1A-7CFC-5747" + }, + "asia-southeast1": { + "price": 0.038999, + "sku": "2514-CA24-299A" + }, + "asia-southeast2": { + "price": 0.04250891, + "sku": "1E79-A719-6653" + }, + "australia-southeast1": { + "price": 0.044856, + "sku": "0382-1327-146D" + }, + "europe-north1": { + "price": 0.034806, + "sku": "59FD-DA88-2A13" + }, + "europe-west1": { + "price": 0.034773, + "sku": "9F61-45D7-D4FB" + }, + "europe-west2": { + "price": 0.04073, + "sku": "6EA2-F2F1-BBB4" + }, + "europe-west3": { + "price": 0.04073, + "sku": "53BB-FF1B-0C91" + }, + "europe-west4": { + "price": 0.034802, + "sku": "B46B-6090-FA88" + }, + "europe-west6": { + "price": 0.0, + "sku": "6320-5E2C-96C1" + }, + "northamerica-northeast1": { + "price": 0.034802, + "sku": "CBC9-2071-267A" + }, + "southamerica-east1": { + "price": 0.05018, + "sku": "8F60-4F60-EE56" + }, + "us-central1": { + "price": 0.031611, + "sku": "BB77-5FDA-69D9" + }, + "us-east4": { + "price": 0.035605, + "sku": "5571-8F21-9137" + }, + "us-west2": { + "price": 0.03797, + "sku": "A118-C0E0-D091" + }, + "us-west3": { + "price": 0.03797, + "sku": "662F-0A9B-36DE" + }, + "us-west4": { + "price": 0.04073, + "sku": "5467-593D-DD72" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.008414, + "sku": "A005-73BB-9999" + }, + "asia-east2": { + "price": 0.0107, + "sku": "1C57-4C34-568E" + }, + "asia-northeast1": { + "price": 0.010149, + "sku": "5EEC-F73F-6155" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "E1FC-447C-17A8" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "158A-D7D1-4D82" + }, + "asia-south1": { + "price": 0.007649, + "sku": "F124-C5C5-4AD7" + }, + "asia-southeast1": { + "price": 0.008966, + "sku": "E39F-1632-3D75" + }, + "asia-southeast2": { + "price": 0.00977294, + "sku": "E2BB-4261-4FEC" + }, + "australia-southeast1": { + "price": 0.010322, + "sku": "79FD-8E01-E25F" + }, + "europe-north1": { + "price": 0.008414, + "sku": "D299-DEEF-46A8" + }, + "europe-west1": { + "price": 0.008415, + "sku": "6462-90BF-DCBB" + }, + "europe-west2": { + "price": 0.009368, + "sku": "E3D4-24DE-7357" + }, + "europe-west3": { + "price": 0.009368, + "sku": "E823-4290-3A39" + }, + "europe-west4": { + "price": 0.00842, + "sku": "718B-71AE-95DE" + }, + "europe-west6": { + "price": 0.0, + "sku": "611F-89D8-DB39" + }, + "northamerica-northeast1": { + "price": 0.00842, + "sku": "3067-77CF-9D3A" + }, + "southamerica-east1": { + "price": 0.011538, + "sku": "F9CE-292B-5725" + }, + "us-central1": { + "price": 0.007649, + "sku": "2856-91B1-406A" + }, + "us-east4": { + "price": 0.008184, + "sku": "7040-8039-966F" + }, + "us-west2": { + "price": 0.009179, + "sku": "CB27-D09B-F7FE" + }, + "us-west3": { + "price": 0.009179, + "sku": "333F-8B96-7AC3" + }, + "us-west4": { + "price": 0.008184, + "sku": "B107-2794-FD90" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + }, + "ram": { + "description": "n2 instance ram", + "on_demand": { + "asia-east1": { + "price": 0.004906, + "sku": "2297-D3C7-1085" + }, + "asia-east2": { + "price": 0.005928, + "sku": "2C8B-C962-467D" + }, + "asia-northeast1": { + "price": 0.005419, + "sku": "CFB3-624B-6A52" + }, + "asia-northeast2": { + "price": 0.005419, + "sku": "AB68-2A46-1E54" + }, + "asia-northeast3": { + "price": 0.005419, + "sku": "A9FC-4BD1-8E21" + }, + "asia-south1": { + "price": 0.005088, + "sku": "23FA-BF9A-7C7A" + }, + "asia-southeast1": { + "price": 0.005226, + "sku": "C84B-1AD4-8EAE" + }, + "asia-southeast2": { + "price": 0.00569634, + "sku": "852E-0449-B664" + }, + "australia-southeast1": { + "price": 0.006011, + "sku": "FC62-C94D-BE38" + }, + "europe-north1": { + "price": 0.004664, + "sku": "C458-9509-E762" + }, + "europe-west1": { + "price": 0.004661, + "sku": "A109-54C1-7CB0" + }, + "europe-west2": { + "price": 0.005458, + "sku": "A557-29AB-E13A" + }, + "europe-west3": { + "price": 0.005458, + "sku": "A5A6-3EDC-7F3C" + }, + "europe-west4": { + "price": 0.004664, + "sku": "EFCB-2D7A-52B6" + }, + "europe-west6": { + "price": 0.0, + "sku": "A7C6-F754-76FF" + }, + "northamerica-northeast1": { + "price": 0.004664, + "sku": "45C7-42BE-4253" + }, + "southamerica-east1": { + "price": 0.006725, + "sku": "6487-C110-BE19" + }, + "us-central1": { + "price": 0.004237, + "sku": "5B01-D157-A097" + }, + "us-east4": { + "price": 0.004771, + "sku": "A96B-6699-99E0" + }, + "us-west2": { + "price": 0.005089, + "sku": "28C0-92D5-8DE5" + }, + "us-west3": { + "price": 0.005089, + "sku": "CCE4-BB91-51FE" + }, + "us-west4": { + "price": 0.004771, + "sku": "FA34-B408-E0FF" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.001128, + "sku": "741E-C653-D52D" + }, + "asia-east2": { + "price": 0.001441, + "sku": "9F71-E8AD-516B" + }, + "asia-northeast1": { + "price": 0.001354, + "sku": "7801-5BA3-D5D8" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "23AC-7307-B1C4" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "712D-2A30-C25B" + }, + "asia-south1": { + "price": 0.001231, + "sku": "B6CA-B325-25EB" + }, + "asia-southeast1": { + "price": 0.001207, + "sku": "4885-BC4B-BADD" + }, + "asia-southeast2": { + "price": 0.00131563, + "sku": "28DF-D929-F6EB" + }, + "australia-southeast1": { + "price": 0.001379, + "sku": "D600-4E02-36B2" + }, + "europe-north1": { + "price": 0.001128, + "sku": "1FAA-6A5D-8D30" + }, + "europe-west1": { + "price": 0.001128, + "sku": "C702-28A4-2E92" + }, + "europe-west2": { + "price": 0.001253, + "sku": "1DE5-1E67-B39A" + }, + "europe-west3": { + "price": 0.001253, + "sku": "D340-4B39-9388" + }, + "europe-west4": { + "price": 0.001134, + "sku": "F1DF-3CB6-78E8" + }, + "europe-west6": { + "price": 0.0, + "sku": "3FA9-672F-401F" + }, + "northamerica-northeast1": { + "price": 0.001134, + "sku": "C27C-7513-597B" + }, + "southamerica-east1": { + "price": 0.001547, + "sku": "1821-AD41-53D4" + }, + "us-central1": { + "price": 0.001025, + "sku": "6276-ABCE-E764" + }, + "us-east4": { + "price": 0.001097, + "sku": "A531-0979-C36C" + }, + "us-west2": { + "price": 0.001237, + "sku": "A859-25F8-320D" + }, + "us-west3": { + "price": 0.001237, + "sku": "5F15-51AC-945D" + }, + "us-west4": { + "price": 0.001097, + "sku": "987D-EDD1-337A" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "n2_custom": { + "cpu": { + "description": "n2 custom instance core", + "on_demand": { + "asia-east1": { + "price": 0.03841, + "sku": "A48D-90EC-00EC" + }, + "asia-east2": { + "price": 0.044231, + "sku": "5B72-95CA-B29A" + }, + "asia-northeast1": { + "price": 0.040618, + "sku": "3C79-46FF-0C0A" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "E891-CC68-96D1" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "6F2A-8ADB-88C3" + }, + "asia-south1": { + "price": 0.037966, + "sku": "FC69-4A67-C34D" + }, + "asia-southeast1": { + "price": 0.038996, + "sku": "D432-F64C-0F60" + }, + "asia-southeast2": { + "price": 0.04250564, + "sku": "2EB0-5403-B893" + }, + "australia-southeast1": { + "price": 0.04488, + "sku": "CACB-AC79-18A4" + }, + "europe-north1": { + "price": 0.034802, + "sku": "038E-428B-6479" + }, + "europe-west1": { + "price": 0.036489, + "sku": "0976-7487-062C" + }, + "europe-west2": { + "price": 0.04069, + "sku": "6924-2ADC-063A" + }, + "europe-west3": { + "price": 0.040692, + "sku": "C836-3D4C-F874" + }, + "europe-west4": { + "price": 0.034802, + "sku": "DA9A-6614-3548" + }, + "europe-west6": { + "price": 0.0, + "sku": "9C19-672A-2011" + }, + "northamerica-northeast1": { + "price": 0.034802, + "sku": "B4CA-178A-4909" + }, + "southamerica-east1": { + "price": 0.05019, + "sku": "391C-E3D4-4D3A" + }, + "us-central1": { + "price": 0.033174, + "sku": "3E94-1AB5-33F5" + }, + "us-east4": { + "price": 0.037364, + "sku": "0B2D-BDE1-6668" + }, + "us-west2": { + "price": 0.03797, + "sku": "39D2-E298-5C3E" + }, + "us-west3": { + "price": 0.03797, + "sku": "2F7D-94FD-735C" + }, + "us-west4": { + "price": 0.037364, + "sku": "880D-C64E-B27A" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.008828, + "sku": "B87F-4B27-5B39" + }, + "asia-east2": { + "price": 0.0107, + "sku": "A73A-AAAC-5D2D" + }, + "asia-northeast1": { + "price": 0.010149, + "sku": "7EEB-20DE-2DEA" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "BF7C-9CE0-56E1" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "9EEC-C97B-8FC6" + }, + "asia-south1": { + "price": 0.009186, + "sku": "CE26-1772-D994" + }, + "asia-southeast1": { + "price": 0.008967, + "sku": "46F8-7AC0-9FD5" + }, + "asia-southeast2": { + "price": 0.00977403, + "sku": "45E2-0E11-C37E" + }, + "australia-southeast1": { + "price": 0.00842, + "sku": "8FB1-8C4D-B724" + }, + "europe-north1": { + "price": 0.00842, + "sku": "DD27-F551-D767" + }, + "europe-west1": { + "price": 0.008828, + "sku": "EB45-91A7-F2E5" + }, + "europe-west2": { + "price": 0.009368, + "sku": "FC19-F2A6-31EC" + }, + "europe-west3": { + "price": 0.009368, + "sku": "C50B-D7ED-1324" + }, + "europe-west4": { + "price": 0.00842, + "sku": "6705-BF1E-D959" + }, + "europe-west6": { + "price": 0.0, + "sku": "821B-E696-717D" + }, + "northamerica-northeast1": { + "price": 0.00842, + "sku": "2B66-FD18-DA0D" + }, + "southamerica-east1": { + "price": 0.011538, + "sku": "0048-21CE-74C3" + }, + "us-central1": { + "price": 0.008023, + "sku": "75F9-48A9-60C5" + }, + "us-east4": { + "price": 0.008585, + "sku": "118B-DAED-01F7" + }, + "us-west2": { + "price": 0.009179, + "sku": "F6A5-D0C2-7D24" + }, + "us-west3": { + "price": 0.009179, + "sku": "EA15-EAE2-3514" + }, + "us-west4": { + "price": 0.008585, + "sku": "9086-9A1E-5408" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + }, + "ram": { + "description": "n2 custom instance ram", + "on_demand": { + "asia-east1": { + "price": 0.00515, + "sku": "ACE4-4FE6-641C" + }, + "asia-east2": { + "price": 0.005928, + "sku": "159F-AB01-4F9C" + }, + "asia-northeast1": { + "price": 0.005418, + "sku": "F68A-05BC-1EE9" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "F6A3-5FF6-F21E" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "2CCC-E20A-06DE" + }, + "asia-south1": { + "price": 0.005088, + "sku": "88AC-E248-BFC6" + }, + "asia-southeast1": { + "price": 0.005226, + "sku": "1F19-9175-5B89" + }, + "asia-southeast2": { + "price": 0.00569634, + "sku": "8128-3483-7333" + }, + "australia-southeast1": { + "price": 0.00601, + "sku": "12C4-F201-DA07" + }, + "europe-north1": { + "price": 0.004664, + "sku": "595E-74E5-DABD" + }, + "europe-west1": { + "price": 0.004892, + "sku": "CA5F-A13B-29EA" + }, + "europe-west2": { + "price": 0.00545, + "sku": "3A49-05F0-7CF0" + }, + "europe-west3": { + "price": 0.005453, + "sku": "837D-1134-9F72" + }, + "europe-west4": { + "price": 0.004664, + "sku": "C1AD-7471-F6C1" + }, + "europe-west6": { + "price": 0.0, + "sku": "A43B-CA38-009A" + }, + "northamerica-northeast1": { + "price": 0.004664, + "sku": "FAD2-8331-1006" + }, + "southamerica-east1": { + "price": 0.006729, + "sku": "C76B-0D36-2457" + }, + "us-central1": { + "price": 0.004446, + "sku": "5304-5146-9088" + }, + "us-east4": { + "price": 0.005008, + "sku": "A996-8018-FA18" + }, + "us-west2": { + "price": 0.005089, + "sku": "70E7-9889-C9EC" + }, + "us-west3": { + "price": 0.005089, + "sku": "B909-FCCF-B2F9" + }, + "us-west4": { + "price": 0.005008, + "sku": "7691-78AA-E288" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.001184, + "sku": "C7E0-422B-62D3" + }, + "asia-east2": { + "price": 0.001441, + "sku": "F46B-1AB0-23A6" + }, + "asia-northeast1": { + "price": 0.001354, + "sku": "2AE6-08AE-3E72" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "E33D-54C4-33CD" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "1121-776E-7F87" + }, + "asia-south1": { + "price": 0.001237, + "sku": "AEE8-D673-DB9A" + }, + "asia-southeast1": { + "price": 0.001201, + "sku": "87D7-CC21-6642" + }, + "asia-southeast2": { + "price": 0.00130909, + "sku": "5989-5188-EFEE" + }, + "australia-southeast1": { + "price": 0.001379, + "sku": "71E2-F21A-2896" + }, + "europe-north1": { + "price": 0.001134, + "sku": "358D-4E56-D608" + }, + "europe-west1": { + "price": 0.001184, + "sku": "052B-A569-574F" + }, + "europe-west2": { + "price": 0.001253, + "sku": "023C-2845-395C" + }, + "europe-west3": { + "price": 0.001253, + "sku": "2A9D-7CA9-3AD9" + }, + "europe-west4": { + "price": 0.001134, + "sku": "216F-660A-50AE" + }, + "europe-west6": { + "price": 0.0, + "sku": "7348-4952-0814" + }, + "northamerica-northeast1": { + "price": 0.001134, + "sku": "5E5B-2E7B-61C0" + }, + "southamerica-east1": { + "price": 0.001547, + "sku": "4A8B-C95D-1C51" + }, + "us-central1": { + "price": 0.00108, + "sku": "BCE4-4AB0-B7F2" + }, + "us-east4": { + "price": 0.001156, + "sku": "D0A5-0C86-A1AD" + }, + "us-west2": { + "price": 0.001237, + "sku": "A88B-FA56-9864" + }, + "us-west3": { + "price": 0.001237, + "sku": "1422-9F0C-16FD" + }, + "us-west4": { + "price": 0.001156, + "sku": "C405-22A4-2A79" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "n2_custom_extended": { + "cpu": {}, + "ram": { + "description": "n2 custom extended instance ram", + "on_demand": { + "asia-east1": { + "price": 0.011059, + "sku": "725E-B154-E759" + }, + "asia-east2": { + "price": 0.012732, + "sku": "4E0C-ACF7-FC86" + }, + "asia-northeast1": { + "price": 0.011667, + "sku": "DFBC-35ED-C31F" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "53FC-0398-CA27" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "3663-7764-1304" + }, + "asia-south1": { + "price": 0.010929, + "sku": "3C1F-0B09-F3E8" + }, + "asia-southeast1": { + "price": 0.011225, + "sku": "E97F-57F5-F341" + }, + "asia-southeast2": { + "price": 0.01223525, + "sku": "15C6-E5BC-2A2A" + }, + "australia-southeast1": { + "price": 0.01291, + "sku": "0FA3-772E-09BB" + }, + "europe-north1": { + "price": 0.010018, + "sku": "D5DF-A49F-8441" + }, + "europe-west1": { + "price": 0.010506, + "sku": "6E4E-1FAC-3BA5" + }, + "europe-west2": { + "price": 0.01171, + "sku": "E2F1-104D-AE7B" + }, + "europe-west3": { + "price": 0.01171, + "sku": "2965-7160-04A2" + }, + "europe-west4": { + "price": 0.010018, + "sku": "C5A2-E156-F885" + }, + "europe-west6": { + "price": 0.0, + "sku": "A260-4B3D-F56A" + }, + "northamerica-northeast1": { + "price": 0.010018, + "sku": "45AE-0DD2-E4D9" + }, + "southamerica-east1": { + "price": 0.01445, + "sku": "46FD-5CA2-0007" + }, + "us-central1": { + "price": 0.00955, + "sku": "E8A6-06D8-F69C" + }, + "us-east4": { + "price": 0.010756, + "sku": "4649-0BEC-F3AD" + }, + "us-west2": { + "price": 0.010931, + "sku": "14FA-1848-4CAA" + }, + "us-west3": { + "price": 0.010931, + "sku": "8762-1BBD-3265" + }, + "us-west4": { + "price": 0.010756, + "sku": "DEAA-CEB1-1AB2" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.002543, + "sku": "9E84-BD94-2FA2" + }, + "asia-east2": { + "price": 0.003087, + "sku": "A210-7E80-7049" + }, + "asia-northeast1": { + "price": 0.002915, + "sku": "BF22-AA2D-C6EF" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "DE6F-1914-7935" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "5A54-8149-17D5" + }, + "asia-south1": { + "price": 0.002644, + "sku": "7623-C32A-4E1E" + }, + "asia-southeast1": { + "price": 0.00258, + "sku": "DFD7-D20D-D05A" + }, + "asia-southeast2": { + "price": 0.0028122, + "sku": "FEF2-DAC9-0EB4" + }, + "australia-southeast1": { + "price": 0.002966, + "sku": "AE50-BD85-57CA" + }, + "europe-north1": { + "price": 0.00243, + "sku": "BC21-B905-0B1B" + }, + "europe-west1": { + "price": 0.002543, + "sku": "6BEB-D8D9-EFC4" + }, + "europe-west2": { + "price": 0.002701, + "sku": "0449-D578-6BF2" + }, + "europe-west3": { + "price": 0.002701, + "sku": "2EAB-F481-A091" + }, + "europe-west4": { + "price": 0.00243, + "sku": "9214-5D40-014E" + }, + "europe-west6": { + "price": 0.0, + "sku": "F824-DC48-0AD1" + }, + "northamerica-northeast1": { + "price": 0.002429, + "sku": "322C-953A-3238" + }, + "southamerica-east1": { + "price": 0.003322, + "sku": "8E57-CF40-D3EC" + }, + "us-central1": { + "price": 0.002315, + "sku": "02A8-4680-9F4C" + }, + "us-east4": { + "price": 0.002477, + "sku": "7935-8A23-C7BC" + }, + "us-west2": { + "price": 0.002649, + "sku": "225A-0448-5D61" + }, + "us-west3": { + "price": 0.002649, + "sku": "B576-75D3-D129" + }, + "us-west4": { + "price": 0.002477, + "sku": "01DC-5831-0B40" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "n2d": { + "cpu": { + "description": "n2d amd instance core", + "on_demand": { + "asia-east1": { + "price": 0.031844, + "sku": "EF6C-66BA-C9C6" + }, + "asia-east2": { + "price": 0.038481, + "sku": "A640-62BC-0C6C" + }, + "asia-northeast1": { + "price": 0.035338, + "sku": "E3DA-E73C-3FCD" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "CDA5-479A-D53F" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "9F49-AF93-20A7" + }, + "asia-south1": { + "price": 0.033034, + "sku": "0DAC-F520-B2D1" + }, + "asia-southeast1": { + "price": 0.033929, + "sku": "8B4E-B458-AD51" + }, + "asia-southeast2": { + "price": 0.03698261, + "sku": "9653-E8D4-C871" + }, + "australia-southeast1": { + "price": 0.039025, + "sku": "2F62-931F-7C45" + }, + "europe-north1": { + "price": 0.030281, + "sku": "4791-064D-3189" + }, + "europe-west1": { + "price": 0.030253, + "sku": "9201-F0D0-15DA" + }, + "europe-west2": { + "price": 0.035435, + "sku": "1B12-3BA5-80A4" + }, + "europe-west3": { + "price": 0.035435, + "sku": "18D3-E0E1-C1A1" + }, + "europe-west4": { + "price": 0.030278, + "sku": "0450-45CE-C078" + }, + "europe-west6": { + "price": 0.0, + "sku": "4192-5050-2178" + }, + "northamerica-northeast1": { + "price": 0.030278, + "sku": "13DD-415F-AF29" + }, + "southamerica-east1": { + "price": 0.043657, + "sku": "EC8A-8CC8-A8F0" + }, + "us-central1": { + "price": 0.027502, + "sku": "A03E-E620-7389" + }, + "us-east4": { + "price": 0.030976, + "sku": "809C-1E3B-306E" + }, + "us-west2": { + "price": 0.033034, + "sku": "2540-FD54-92D3" + }, + "us-west3": { + "price": 0.033034, + "sku": "011F-F649-4A0D" + }, + "us-west4": { + "price": 0.030976, + "sku": "0E8D-9FEF-852D" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.00732, + "sku": "6B4A-3961-E53F" + }, + "asia-east2": { + "price": 0.009309, + "sku": "7B34-6F0F-A857" + }, + "asia-northeast1": { + "price": 0.00883, + "sku": "3B4D-DF04-EE90" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "E883-496C-FE2D" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "47FB-EE92-0BE6" + }, + "asia-south1": { + "price": 0.007992, + "sku": "78BE-9EA7-95F1" + }, + "asia-southeast1": { + "price": 0.0078, + "sku": "48EB-F1F3-223B" + }, + "asia-southeast2": { + "price": 0.008502, + "sku": "2B97-58E0-E07F" + }, + "australia-southeast1": { + "price": 0.00898, + "sku": "ED8F-A752-BA07" + }, + "europe-north1": { + "price": 0.00732, + "sku": "C16D-152B-3942" + }, + "europe-west1": { + "price": 0.007321, + "sku": "1F58-9664-EE67" + }, + "europe-west2": { + "price": 0.00815, + "sku": "390C-2E90-94EA" + }, + "europe-west3": { + "price": 0.00815, + "sku": "E58E-BBDF-1B8A" + }, + "europe-west4": { + "price": 0.007325, + "sku": "B168-A220-18EE" + }, + "europe-west6": { + "price": 0.0, + "sku": "17AD-8806-219E" + }, + "northamerica-northeast1": { + "price": 0.007325, + "sku": "7FD2-3762-27D1" + }, + "southamerica-east1": { + "price": 0.010038, + "sku": "9F1D-128D-ADEB" + }, + "us-central1": { + "price": 0.006655, + "sku": "0434-AD25-7163" + }, + "us-east4": { + "price": 0.00712, + "sku": "A1E2-BFF2-18A3" + }, + "us-west2": { + "price": 0.007986, + "sku": "B07E-8B43-5335" + }, + "us-west3": { + "price": 0.007986, + "sku": "93A5-5568-F3ED" + }, + "us-west4": { + "price": 0.00712, + "sku": "0586-DB99-41A8" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + }, + "ram": { + "description": "n2d amd instance ram", + "on_demand": { + "asia-east1": { + "price": 0.004268, + "sku": "FFF7-7A42-F2E8" + }, + "asia-east2": { + "price": 0.005157, + "sku": "95C6-3CAC-175A" + }, + "asia-northeast1": { + "price": 0.004715, + "sku": "4DE7-0DB1-1ECB" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "7DD8-7C56-8F10" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "7609-A4B6-9218" + }, + "asia-south1": { + "price": 0.004427, + "sku": "E021-0FE4-1AC3" + }, + "asia-southeast1": { + "price": 0.004547, + "sku": "92EB-71EA-DA74" + }, + "asia-southeast2": { + "price": 0.00495623, + "sku": "F50A-B110-CF48" + }, + "australia-southeast1": { + "price": 0.00523, + "sku": "95C7-D6E0-3BF6" + }, + "europe-north1": { + "price": 0.004058, + "sku": "F579-1568-AEED" + }, + "europe-west1": { + "price": 0.004055, + "sku": "0A3A-4D14-E11B" + }, + "europe-west2": { + "price": 0.004748, + "sku": "462E-70CF-C7AF" + }, + "europe-west3": { + "price": 0.004748, + "sku": "A57E-8491-5C53" + }, + "europe-west4": { + "price": 0.004058, + "sku": "D484-E83B-5FD6" + }, + "europe-west6": { + "price": 0.0, + "sku": "5F90-8155-6576" + }, + "northamerica-northeast1": { + "price": 0.004058, + "sku": "5929-5298-664A" + }, + "southamerica-east1": { + "price": 0.005851, + "sku": "F92D-0A8D-649F" + }, + "us-central1": { + "price": 0.003686, + "sku": "5535-6D2D-4B50" + }, + "us-east4": { + "price": 0.004151, + "sku": "D293-6255-369A" + }, + "us-west2": { + "price": 0.004427, + "sku": "1FEE-CE8E-2D35" + }, + "us-west3": { + "price": 0.004427, + "sku": "98E9-BA44-DDD2" + }, + "us-west4": { + "price": 0.004151, + "sku": "ABD2-309F-B86A" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.000981, + "sku": "672C-2EB5-278B" + }, + "asia-east2": { + "price": 0.001254, + "sku": "14B6-07DE-0BDC" + }, + "asia-northeast1": { + "price": 0.001178, + "sku": "2199-6608-5E84" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "9384-DC89-0F6C" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "A167-5B24-B80D" + }, + "asia-south1": { + "price": 0.001076, + "sku": "2EE2-37AD-E0CC" + }, + "asia-southeast1": { + "price": 0.001045, + "sku": "47EB-17A0-C7B4" + }, + "asia-southeast2": { + "price": 0.00113905, + "sku": "1704-2722-4749" + }, + "australia-southeast1": { + "price": 0.0012, + "sku": "B4C1-DCEE-FA68" + }, + "europe-north1": { + "price": 0.000981, + "sku": "096F-8339-256F" + }, + "europe-west1": { + "price": 0.000981, + "sku": "A5A6-F3B0-4706" + }, + "europe-west2": { + "price": 0.00109, + "sku": "C76B-F86A-06E2" + }, + "europe-west3": { + "price": 0.00109, + "sku": "15CC-4937-BA0A" + }, + "europe-west4": { + "price": 0.000987, + "sku": "BB89-ECA3-75E8" + }, + "europe-west6": { + "price": 0.0, + "sku": "5776-7811-D82F" + }, + "northamerica-northeast1": { + "price": 0.000987, + "sku": "B6EC-0D8F-0BA8" + }, + "southamerica-east1": { + "price": 0.001346, + "sku": "F38E-E0F1-1BCF" + }, + "us-central1": { + "price": 0.000892, + "sku": "AFA5-CB36-99F6" + }, + "us-east4": { + "price": 0.000954, + "sku": "2DC5-9F0F-7E28" + }, + "us-west2": { + "price": 0.001076, + "sku": "624A-0F8D-7034" + }, + "us-west3": { + "price": 0.001076, + "sku": "410D-7FE3-C183" + }, + "us-west4": { + "price": 0.000954, + "sku": "4280-873C-E4DA" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "n2d_custom": { + "cpu": { + "description": "n2d amd custom instance core", + "on_demand": { + "asia-east1": { + "price": 0.031844, + "sku": "AE97-3760-ECCC" + }, + "asia-east2": { + "price": 0.038481, + "sku": "9669-248F-CE45" + }, + "asia-northeast1": { + "price": 0.035338, + "sku": "6C99-977D-2500" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "8B64-9CD1-2EA7" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "275F-34D4-FDFD" + }, + "asia-south1": { + "price": 0.033034, + "sku": "665E-E4CD-1D74" + }, + "asia-southeast1": { + "price": 0.033929, + "sku": "FDBB-84BE-0AF7" + }, + "asia-southeast2": { + "price": 0.03698261, + "sku": "2F99-211F-C567" + }, + "australia-southeast1": { + "price": 0.039025, + "sku": "8556-A774-DEC2" + }, + "europe-north1": { + "price": 0.030281, + "sku": "AD11-3DC6-E076" + }, + "europe-west1": { + "price": 0.030253, + "sku": "6672-F702-DDC4" + }, + "europe-west2": { + "price": 0.035435, + "sku": "CB66-DAAE-8837" + }, + "europe-west3": { + "price": 0.035435, + "sku": "4BD7-1A01-048A" + }, + "europe-west4": { + "price": 0.030278, + "sku": "675D-892B-446A" + }, + "europe-west6": { + "price": 0.0, + "sku": "8FDA-012F-7B65" + }, + "northamerica-northeast1": { + "price": 0.030278, + "sku": "5108-9DAD-44E9" + }, + "southamerica-east1": { + "price": 0.043657, + "sku": "BA32-D484-6243" + }, + "us-central1": { + "price": 0.027502, + "sku": "55FE-5117-DF8B" + }, + "us-east4": { + "price": 0.030976, + "sku": "115C-7108-8B9E" + }, + "us-west2": { + "price": 0.033034, + "sku": "01FE-1823-247B" + }, + "us-west3": { + "price": 0.033034, + "sku": "C87C-9C22-51BE" + }, + "us-west4": { + "price": 0.030976, + "sku": "8ACA-B986-2E54" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.00768, + "sku": "FF44-A271-4CEC" + }, + "asia-east2": { + "price": 0.009309, + "sku": "D5D4-354F-19BB" + }, + "asia-northeast1": { + "price": 0.00883, + "sku": "9277-C0FD-B662" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "B9D7-E5E3-17E2" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "6D2D-57BF-4CE3" + }, + "asia-south1": { + "price": 0.007992, + "sku": "BE8B-65DB-02EC" + }, + "asia-southeast1": { + "price": 0.0078, + "sku": "7AB3-E65E-6A09" + }, + "asia-southeast2": { + "price": 0.008502, + "sku": "F5A2-5011-227E" + }, + "australia-southeast1": { + "price": 0.00898, + "sku": "AA06-041C-B2E0" + }, + "europe-north1": { + "price": 0.007325, + "sku": "06F9-BDAF-E51C" + }, + "europe-west1": { + "price": 0.00768, + "sku": "1BF1-596A-3028" + }, + "europe-west2": { + "price": 0.00815, + "sku": "EA62-7A62-6D9E" + }, + "europe-west3": { + "price": 0.00815, + "sku": "72BE-1F1F-40E8" + }, + "europe-west4": { + "price": 0.007325, + "sku": "79E4-DAFD-A17D" + }, + "europe-west6": { + "price": 0.0, + "sku": "D3FD-8C01-5400" + }, + "northamerica-northeast1": { + "price": 0.007325, + "sku": "D963-10CD-7CBD" + }, + "southamerica-east1": { + "price": 0.010038, + "sku": "129A-E233-CA47" + }, + "us-central1": { + "price": 0.00698, + "sku": "024D-A256-0327" + }, + "us-east4": { + "price": 0.007469, + "sku": "179B-CE81-F0B3" + }, + "us-west2": { + "price": 0.007986, + "sku": "DDA3-3B2F-D429" + }, + "us-west3": { + "price": 0.007986, + "sku": "595D-B7C1-1683" + }, + "us-west4": { + "price": 0.007469, + "sku": "70B3-B000-8CC3" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + }, + "ram": { + "description": "n2d amd custom instance ram", + "on_demand": { + "asia-east1": { + "price": 0.004268, + "sku": "65A9-01F9-3FB2" + }, + "asia-east2": { + "price": 0.005157, + "sku": "4E3E-640F-F228" + }, + "asia-northeast1": { + "price": 0.004715, + "sku": "D484-8C81-94CA" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "F787-522B-80EB" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "3860-1A51-6AC0" + }, + "asia-south1": { + "price": 0.004427, + "sku": "60E6-333B-57BE" + }, + "asia-southeast1": { + "price": 0.004547, + "sku": "4CBB-9DAF-2D6E" + }, + "asia-southeast2": { + "price": 0.00495623, + "sku": "374F-4D56-58C0" + }, + "australia-southeast1": { + "price": 0.00523, + "sku": "3F85-10A4-440C" + }, + "europe-north1": { + "price": 0.004058, + "sku": "E958-DC4F-A16B" + }, + "europe-west1": { + "price": 0.004055, + "sku": "3914-87EF-A9CA" + }, + "europe-west2": { + "price": 0.004748, + "sku": "B1CB-59AC-0785" + }, + "europe-west3": { + "price": 0.004748, + "sku": "89BC-9DB5-3AB6" + }, + "europe-west4": { + "price": 0.004058, + "sku": "377F-267F-8F7F" + }, + "europe-west6": { + "price": 0.0, + "sku": "07C7-3B6C-C92A" + }, + "northamerica-northeast1": { + "price": 0.004058, + "sku": "BFDA-E726-2761" + }, + "southamerica-east1": { + "price": 0.005851, + "sku": "1C2E-D456-0B92" + }, + "us-central1": { + "price": 0.003686, + "sku": "CED4-7119-A546" + }, + "us-east4": { + "price": 0.004151, + "sku": "5719-5C5A-9EAB" + }, + "us-west2": { + "price": 0.004427, + "sku": "1781-1A20-1DD7" + }, + "us-west3": { + "price": 0.004427, + "sku": "EE37-2679-BDEA" + }, + "us-west4": { + "price": 0.004151, + "sku": "BAB5-46F3-C9B8" + } + }, + "preemptible": { + "asia-east1": { + "price": 0.00103, + "sku": "8C3B-9318-7E12" + }, + "asia-east2": { + "price": 0.001254, + "sku": "C0AA-1864-1D68" + }, + "asia-northeast1": { + "price": 0.001178, + "sku": "91CC-B1CB-67BF" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "DAD4-F10F-5171" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "B2EA-B321-C461" + }, + "asia-south1": { + "price": 0.001076, + "sku": "9BCE-4230-F38F" + }, + "asia-southeast1": { + "price": 0.001045, + "sku": "4F99-7036-2278" + }, + "asia-southeast2": { + "price": 0.00113905, + "sku": "B992-E9B8-882E" + }, + "australia-southeast1": { + "price": 0.0012, + "sku": "538F-739E-6C0B" + }, + "europe-north1": { + "price": 0.000981, + "sku": "FB19-D4A5-7CB2" + }, + "europe-west1": { + "price": 0.00103, + "sku": "6C56-AA83-58E2" + }, + "europe-west2": { + "price": 0.00109, + "sku": "D388-59D4-7F58" + }, + "europe-west3": { + "price": 0.00109, + "sku": "5659-9940-82B6" + }, + "europe-west4": { + "price": 0.000987, + "sku": "C40E-5666-9BB0" + }, + "europe-west6": { + "price": 0.0, + "sku": "AF15-FFC2-B709" + }, + "northamerica-northeast1": { + "price": 0.000987, + "sku": "CE02-33FE-B41A" + }, + "southamerica-east1": { + "price": 0.001346, + "sku": "53EA-346A-2073" + }, + "us-central1": { + "price": 0.00094, + "sku": "693A-E38D-D63E" + }, + "us-east4": { + "price": 0.001006, + "sku": "B3D3-DF93-B7C4" + }, + "us-west2": { + "price": 0.001076, + "sku": "27B6-CDC5-9F7F" + }, + "us-west3": { + "price": 0.001076, + "sku": "9D42-E6F5-C317" + }, + "us-west4": { + "price": 0.001006, + "sku": "2F63-9007-39AD" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + }, + "n2d_custom_extended": { + "cpu": {}, + "ram": { + "description": "n2d amd custom extended instance ram", + "on_demand": {}, + "preemptible": { + "asia-east1": { + "price": 0.002212, + "sku": "AD3E-21B0-2E19" + }, + "asia-east2": { + "price": 0.002686, + "sku": "D42D-6AF6-E1E8" + }, + "asia-northeast1": { + "price": 0.002536, + "sku": "6A22-FDFD-CE32" + }, + "asia-northeast2": { + "price": 0.0, + "sku": "4BDC-9D0C-CFFC" + }, + "asia-northeast3": { + "price": 0.0, + "sku": "0198-0001-98B1" + }, + "asia-south1": { + "price": 0.002311, + "sku": "436D-D79E-AD29" + }, + "asia-southeast1": { + "price": 0.002245, + "sku": "D2F0-4D79-BCED" + }, + "asia-southeast2": { + "price": 0.00244705, + "sku": "CD26-38B8-702D" + }, + "australia-southeast1": { + "price": 0.00258, + "sku": "3360-C398-DEDC" + }, + "europe-north1": { + "price": 0.002114, + "sku": "D01A-5273-1B4F" + }, + "europe-west1": { + "price": 0.002212, + "sku": "D7CC-99F9-9B2C" + }, + "europe-west2": { + "price": 0.00235, + "sku": "101A-854B-7040" + }, + "europe-west3": { + "price": 0.00235, + "sku": "8EBD-B6C9-3F2A" + }, + "europe-west4": { + "price": 0.002114, + "sku": "99DC-5643-C190" + }, + "europe-west6": { + "price": 0.0, + "sku": "6EA1-9BB0-56C6" + }, + "northamerica-northeast1": { + "price": 0.002113, + "sku": "1AAA-9030-28D7" + }, + "southamerica-east1": { + "price": 0.00289, + "sku": "B26D-4ED9-4284" + }, + "us-central1": { + "price": 0.002014, + "sku": "72D8-081D-66A9" + }, + "us-east4": { + "price": 0.002155, + "sku": "CA5A-F753-AA22" + }, + "us-west2": { + "price": 0.002305, + "sku": "13D8-09B4-9EB7" + }, + "us-west3": { + "price": 0.002305, + "sku": "28F4-E27F-100F" + }, + "us-west4": { + "price": 0.002155, + "sku": "C02B-F870-40DC" + } + }, + "1yr_commitment": {}, + "3yr_commitment": {} + } + } }, "gogrid": { - "16GB": 3.04, "1GB": 0.19, - "24GB": 4.56, "2GB": 0.38, "4GB": 0.76, - "512MB": 0.095, - "8GB": 1.52 + "8GB": 1.52, + "16GB": 3.04, + "24GB": 4.56, + "512MB": 0.095 }, "nephoscale": { "1": 0.6, + "3": 0.063, + "5": 0.031, + "7": 0.125, + "9": 0.188, "11": 0.35, "27": 0.0, - "3": 0.063, "46": 0.1, "48": 0.15, - "5": 0.031, "50": 0.28, "52": 0.48, "54": 0.938, - "56": 0.75, - "7": 0.125, - "9": 0.188 + "56": 0.75 }, "nimbus": { - "m1.large": 0.0, "m1.small": 0.0, + "m1.large": 0.0, "m1.xlarge": 0.0 }, "osc_inc_eu_west_1": { @@ -501,18 +121587,40 @@ "cc1.4xlarge": "1.300", "cc2.8xlarge": "2.400", "cr1.8xlarge": "3.500", - "m1.large": "0.360", - "m1.medium": "0.120", "m1.small": "0.090", + "m1.medium": "0.120", + "m1.large": "0.360", "m1.xlarge": "0.730", + "m2.xlarge": "0.410", "m2.2xlarge": "0.820", "m2.4xlarge": "1.640", - "m2.xlarge": "0.410", - "m3.2xlarge": "1.560", "m3.xlarge": "0.780", - "nv1.large": "5.490", + "m3.2xlarge": "1.560", + "nv1.small": "5.220", "nv1.medium": "5.250", + "nv1.large": "5.490", + "nv1.xlarge": "5.610", + "os1.8xlarge": "4.310", + "t1.micro": "0.040" + }, + "osc_inc_eu_west_2": { + "c1.medium": "0.230", + "c1.xlarge": "0.900", + "cc1.4xlarge": "1.300", + "cc2.8xlarge": "2.400", + "cr1.8xlarge": "3.500", + "m1.small": "0.090", + "m1.medium": "0.120", + "m1.large": "0.360", + "m1.xlarge": "0.730", + "m2.xlarge": "0.410", + "m2.2xlarge": "0.820", + "m2.4xlarge": "1.640", + "m3.xlarge": "0.780", + "m3.2xlarge": "1.560", "nv1.small": "5.220", + "nv1.medium": "5.250", + "nv1.large": "5.490", "nv1.xlarge": "5.610", "os1.8xlarge": "4.310", "t1.micro": "0.040" @@ -523,18 +121631,18 @@ "cc1.4xlarge": "1.300", "cc2.8xlarge": "2.400", "cr1.8xlarge": "3.500", - "m1.large": "0.360", - "m1.medium": "0.120", "m1.small": "0.090", + "m1.medium": "0.120", + "m1.large": "0.360", "m1.xlarge": "0.730", + "m2.xlarge": "0.410", "m2.2xlarge": "0.820", "m2.4xlarge": "1.640", - "m2.xlarge": "0.410", - "m3.2xlarge": "1.560", "m3.xlarge": "0.780", - "nv1.large": "5.490", - "nv1.medium": "5.250", + "m3.2xlarge": "1.560", "nv1.small": "5.220", + "nv1.medium": "5.250", + "nv1.large": "5.490", "nv1.xlarge": "5.610", "os1.8xlarge": "4.310", "t1.micro": "0.040" @@ -545,18 +121653,40 @@ "cc1.4xlarge": "1.610", "cc2.8xlarge": "2.400", "cr1.8xlarge": "3.500", - "m1.large": "0.240", - "m1.medium": "0.180", "m1.small": "0.060", + "m1.medium": "0.180", + "m1.large": "0.240", "m1.xlarge": "0.730", + "m2.xlarge": "0.410", "m2.2xlarge": "1.020", "m2.4xlarge": "2.040", - "m2.xlarge": "0.410", - "m3.2xlarge": "1.560", "m3.xlarge": "0.500", - "nv1.large": "5.490", + "m3.2xlarge": "1.560", + "nv1.small": "5.190", "nv1.medium": "5.250", + "nv1.large": "5.490", + "nv1.xlarge": "5.610", + "os1.8xlarge": "6.400", + "t1.micro": "0.020" + }, + "osc_inc_us_east_2": { + "c1.medium": "0.150", + "c1.xlarge": "0.580", + "cc1.4xlarge": "1.610", + "cc2.8xlarge": "2.400", + "cr1.8xlarge": "3.500", + "m1.small": "0.060", + "m1.medium": "0.180", + "m1.large": "0.240", + "m1.xlarge": "0.730", + "m2.xlarge": "0.410", + "m2.2xlarge": "1.020", + "m2.4xlarge": "2.040", + "m3.xlarge": "0.500", + "m3.2xlarge": "1.560", "nv1.small": "5.190", + "nv1.medium": "5.250", + "nv1.large": "5.490", "nv1.xlarge": "5.610", "os1.8xlarge": "6.400", "t1.micro": "0.020" @@ -567,18 +121697,40 @@ "cc1.4xlarge": "1.460", "cc2.8xlarge": "2.700", "cr1.8xlarge": "3.750", - "m1.large": "0.360", - "m1.medium": "0.130", "m1.small": "0.090", + "m1.medium": "0.130", + "m1.large": "0.360", "m1.xlarge": "0.730", + "m2.xlarge": "0.460", "m2.2xlarge": "0.920", "m2.4xlarge": "1.840", - "m2.xlarge": "0.460", - "m3.2xlarge": "1.560", "m3.xlarge": "0.780", - "nv1.large": "5.490", + "m3.2xlarge": "1.560", + "nv1.small": "5.220", "nv1.medium": "5.310", + "nv1.large": "5.490", + "nv1.xlarge": "5.860", + "os1.8xlarge": "6.400", + "t1.micro": "0.040" + }, + "osc_sas_eu_west_2": { + "c1.medium": "0.230", + "c1.xlarge": "0.900", + "cc1.4xlarge": "1.460", + "cc2.8xlarge": "2.700", + "cr1.8xlarge": "3.750", + "m1.small": "0.090", + "m1.medium": "0.130", + "m1.large": "0.360", + "m1.xlarge": "0.730", + "m2.xlarge": "0.460", + "m2.2xlarge": "0.920", + "m2.4xlarge": "1.840", + "m3.xlarge": "0.780", + "m3.2xlarge": "1.560", "nv1.small": "5.220", + "nv1.medium": "5.310", + "nv1.large": "5.490", "nv1.xlarge": "5.860", "os1.8xlarge": "6.400", "t1.micro": "0.040" @@ -589,18 +121741,18 @@ "cc1.4xlarge": "1.460", "cc2.8xlarge": "2.700", "cr1.8xlarge": "3.750", - "m1.large": "0.360", - "m1.medium": "0.130", "m1.small": "0.090", + "m1.medium": "0.130", + "m1.large": "0.360", "m1.xlarge": "0.730", + "m2.xlarge": "0.460", "m2.2xlarge": "0.920", "m2.4xlarge": "1.840", - "m2.xlarge": "0.460", - "m3.2xlarge": "1.560", "m3.xlarge": "0.780", - "nv1.large": "5.490", - "nv1.medium": "5.310", + "m3.2xlarge": "1.560", "nv1.small": "5.220", + "nv1.medium": "5.310", + "nv1.large": "5.490", "nv1.xlarge": "5.860", "os1.8xlarge": "6.400", "t1.micro": "0.040" @@ -611,23 +121763,62 @@ "cc1.4xlarge": "1.610", "cc2.8xlarge": "2.700", "cr1.8xlarge": "3.750", - "m1.large": "0.260", - "m1.medium": "0.180", "m1.small": "0.070", + "m1.medium": "0.180", + "m1.large": "0.260", "m1.xlarge": "0.730", + "m2.xlarge": "0.460", "m2.2xlarge": "1.020", "m2.4xlarge": "2.040", - "m2.xlarge": "0.460", - "m3.2xlarge": "1.560", "m3.xlarge": "0.550", - "nv1.large": "5.490", + "m3.2xlarge": "1.560", + "nv1.small": "5.220", "nv1.medium": "5.310", + "nv1.large": "5.490", + "nv1.xlarge": "5.860", + "os1.8xlarge": "6.400", + "t1.micro": "0.020" + }, + "osc_sas_us_east_2": { + "c1.medium": "0.170", + "c1.xlarge": "0.660", + "cc1.4xlarge": "1.610", + "cc2.8xlarge": "2.700", + "cr1.8xlarge": "3.750", + "m1.small": "0.070", + "m1.medium": "0.180", + "m1.large": "0.260", + "m1.xlarge": "0.730", + "m2.xlarge": "0.460", + "m2.2xlarge": "1.020", + "m2.4xlarge": "2.040", + "m3.xlarge": "0.550", + "m3.2xlarge": "1.560", "nv1.small": "5.220", + "nv1.medium": "5.310", + "nv1.large": "5.490", "nv1.xlarge": "5.860", "os1.8xlarge": "6.400", "t1.micro": "0.020" }, + "packet": { + "Type S": 1.5, + "Type 0": 0.05, + "Type 1": 0.4, + "Type 2": 1.25, + "Type 2A": 0.5, + "Type 3": 1.75 + }, "rackspace": { + "performance1-1": 0.04, + "performance1-2": 0.08, + "performance1-4": 0.16, + "performance1-8": 0.32, + "performance2-15": 0.68, + "performance2-30": 1.36, + "performance2-60": 2.72, + "performance2-90": 4.08, + "performance2-120": 5.44, "1": 0.015, "2": 0.03, "3": 0.06, @@ -635,91 +121826,97 @@ "5": 0.24, "6": 0.48, "7": 0.96, - "8": 1.8, + "8": 1.8 + }, + "rackspacenovalon": { "performance1-1": 0.04, "performance1-2": 0.08, "performance1-4": 0.16, "performance1-8": 0.32, - "performance2-120": 5.44, "performance2-15": 0.68, "performance2-30": 1.36, "performance2-60": 2.72, - "performance2-90": 4.08 - }, - "rackspacenovalon": { + "performance2-90": 4.08, + "performance2-120": 5.44, "2": 0.032, "3": 0.064, "4": 0.129, "5": 0.258, "6": 0.516, "7": 0.967, - "8": 1.612, + "8": 1.612 + }, + "rackspacenovasyd": { "performance1-1": 0.04, "performance1-2": 0.08, "performance1-4": 0.16, "performance1-8": 0.32, - "performance2-120": 5.44, "performance2-15": 0.68, "performance2-30": 1.36, "performance2-60": 2.72, - "performance2-90": 4.08 - }, - "rackspacenovasyd": { + "performance2-90": 4.08, + "performance2-120": 5.44, "2": 0.026, "3": 0.072, "4": 0.144, "5": 0.288, "6": 0.576, "7": 1.08, - "8": 1.44, + "8": 1.44 + }, + "rackspacenovaus": { "performance1-1": 0.04, "performance1-2": 0.08, "performance1-4": 0.16, "performance1-8": 0.32, - "performance2-120": 5.44, "performance2-15": 0.68, "performance2-30": 1.36, "performance2-60": 2.72, - "performance2-90": 4.08 - }, - "rackspacenovaus": { + "performance2-90": 4.08, + "performance2-120": 5.44, "2": 0.022, "3": 0.06, "4": 0.12, "5": 0.24, "6": 0.48, "7": 0.96, - "8": 1.2, - "performance1-1": 0.04, - "performance1-2": 0.08, - "performance1-4": 0.16, - "performance1-8": 0.32, - "performance2-120": 5.44, - "performance2-15": 0.68, - "performance2-30": 1.36, - "performance2-60": 2.72, - "performance2-90": 4.08 + "8": 1.2 }, "serverlove": { + "small": 0.161, + "medium": 0.404, + "large": 0.534, "extra-large": 0.615, "high-cpu-extra-large": 0.776, - "high-cpu-medium": 0.291, - "large": 0.534, - "medium": 0.404, - "small": 0.161 + "high-cpu-medium": 0.291 }, "skalicloud": { + "small": 0.136, + "medium": 0.301, + "large": 0.505, "extra-large": 0.654, "high-cpu-extra-large": 0.936, - "high-cpu-medium": 0.249, - "large": 0.505, - "medium": 0.301, - "small": 0.136 + "high-cpu-medium": 0.249 + }, + "softlayer": { + "0": 0.023, + "1": 0.024, + "2": 0.024, + "3": 0.026, + "4": 0.045, + "5": 0.045, + "6": 0.045, + "7": 0.09, + "8": 0.09, + "9": 0.09, + "10": 0.09, + "11": 0.205, + "12": 0.205 }, "vps_net": { "1": 0.416 } }, "storage": {}, - "updated": 1427829652 + "updated": 1740936978 } \ No newline at end of file diff --git a/libcloud/dns/base.py b/libcloud/dns/base.py index f09ccc1a4d..1f376f668c 100644 --- a/libcloud/dns/base.py +++ b/libcloud/dns/base.py @@ -13,27 +13,31 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement import datetime +from typing import Any, Dict, List, Type, Union, Iterator, Optional from libcloud import __version__ -from libcloud.common.base import ConnectionUserAndKey, BaseDriver from libcloud.dns.types import RecordType +from libcloud.common.base import BaseDriver, Connection, ConnectionUserAndKey -__all__ = [ - 'Zone', - 'Record', - 'DNSDriver' -] +__all__ = ["Zone", "Record", "DNSDriver"] -class Zone(object): +class Zone: """ DNS zone. """ - def __init__(self, id, domain, type, ttl, driver, extra=None): + def __init__( + self, + id, # type: str + domain, # type: str + type, # type: str + ttl, # type: int + driver, # type: DNSDriver + extra=None, # type: Optional[dict] + ): """ :param id: Zone id. :type id: ``str`` @@ -61,37 +65,60 @@ def __init__(self, id, domain, type, ttl, driver, extra=None): self.extra = extra or {} def list_records(self): + # type: () -> List[Record] return self.driver.list_records(zone=self) def create_record(self, name, type, data, extra=None): - return self.driver.create_record(name=name, zone=self, type=type, - data=data, extra=extra) - - def update(self, domain=None, type=None, ttl=None, extra=None): - return self.driver.update_zone(zone=self, domain=domain, type=type, - ttl=ttl, extra=extra) + # type: (str, RecordType, str, Optional[dict]) -> Record + return self.driver.create_record(name=name, zone=self, type=type, data=data, extra=extra) + + def update( + self, + domain=None, # type: Optional[str] + type=None, # type: Optional[str] + ttl=None, # type: Optional[int] + extra=None, # type: Optional[dict] + ): + # type: (...) -> Zone + return self.driver.update_zone(zone=self, domain=domain, type=type, ttl=ttl, extra=extra) def delete(self): + # type: () -> bool return self.driver.delete_zone(zone=self) def export_to_bind_format(self): + # type: () -> str return self.driver.export_zone_to_bind_format(zone=self) def export_to_bind_zone_file(self, file_path): - self.driver.export_zone_to_bind_zone_file(zone=self, - file_path=file_path) + # type: (str) -> None + self.driver.export_zone_to_bind_zone_file(zone=self, file_path=file_path) def __repr__(self): - return ('' % - (self.domain, self.ttl, self.driver.name)) + # type: () -> str + return "".format( + self.domain, + self.ttl, + self.driver.name, + ) -class Record(object): +class Record: """ Zone record / resource. """ - def __init__(self, id, name, type, data, zone, driver, extra=None): + def __init__( + self, + id, # type: str + name, # type: str + type, # type: RecordType + data, # type: str + zone, # type: Zone + driver, # type: DNSDriver + ttl=None, # type: Optional[int] + extra=None, # type: Optional[dict] + ): """ :param id: Record id :type id: ``str`` @@ -111,6 +138,9 @@ def __init__(self, id, name, type, data, zone, driver, extra=None): :param driver: DNSDriver instance. :type driver: :class:`DNSDriver` + :param ttl: Record TTL. + :type ttl: ``int`` + :param extra: (optional) Extra attributes (driver specific). :type extra: ``dict`` """ @@ -120,28 +150,53 @@ def __init__(self, id, name, type, data, zone, driver, extra=None): self.data = data self.zone = zone self.driver = driver + self.ttl = ttl self.extra = extra or {} - def update(self, name=None, type=None, data=None, extra=None): - return self.driver.update_record(record=self, name=name, type=type, - data=data, extra=extra) + def update( + self, + name=None, # type: Optional[str] + type=None, # type: Optional[RecordType] + data=None, # type: Optional[str] + extra=None, # type: Optional[dict] + ): + # type: (...) -> Record + return self.driver.update_record(record=self, name=name, type=type, data=data, extra=extra) def delete(self): + # type: () -> bool return self.driver.delete_record(record=self) def _get_numeric_id(self): + # type: () -> Union[int, str] + """ + Return numeric ID for the provided record if the ID is a digit. + + This method is used for sorting the values when exporting Zone to a + BIND format. + """ record_id = self.id + if record_id is None: + return "" + if record_id.isdigit(): - record_id = int(record_id) + record_id_int = int(record_id) + return record_id_int return record_id def __repr__(self): - return ('' % - (self.zone.id, self.name, self.type, self.data, - self.driver.name)) + # type: () -> str + zone = self.zone.domain if self.zone.domain else self.zone.id + return "" % ( + zone, + self.name, + self.type, + self.data, + self.driver.name, + self.ttl, + ) class DNSDriver(BaseDriver): @@ -150,15 +205,24 @@ class DNSDriver(BaseDriver): This class is always subclassed by a specific driver. """ - connectionCls = ConnectionUserAndKey - name = None - website = None - # Map libcloud record type enum to provider record type name - RECORD_TYPE_MAP = {} + connectionCls = ConnectionUserAndKey # type: Type[Connection] + name = None # type: str + website = None # type: str - def __init__(self, key, secret=None, secure=True, host=None, port=None, - **kwargs): + # Map libcloud record type enum to provider record type name + RECORD_TYPE_MAP = {} # type: Dict[RecordType, str] + + def __init__( + self, + key, # type: str + secret=None, # type: Optional[str] + secure=True, # type: bool + host=None, # type: Optional[str] + port=None, # type: Optional[int] + **kwargs, # type: Optional[Any] + ): + # type: (...) -> None """ :param key: API key or username to used (required) :type key: ``str`` @@ -166,7 +230,7 @@ def __init__(self, key, secret=None, secure=True, host=None, port=None, :param secret: Secret password to be used (required) :type secret: ``str`` - :param secure: Weither to use HTTPS or HTTP. Note: Some providers + :param secure: Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default. :type secure: ``bool`` @@ -178,10 +242,10 @@ def __init__(self, key, secret=None, secure=True, host=None, port=None, :return: ``None`` """ - super(DNSDriver, self).__init__(key=key, secret=secret, secure=secure, - host=host, port=port, **kwargs) + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port, **kwargs) def list_record_types(self): + # type: () -> List[RecordType] """ Return a list of RecordType objects supported by the provider. @@ -190,15 +254,16 @@ def list_record_types(self): return list(self.RECORD_TYPE_MAP.keys()) def iterate_zones(self): + # type: () -> Iterator[Zone] """ Return a generator to iterate over available zones. :rtype: ``generator`` of :class:`Zone` """ - raise NotImplementedError( - 'iterate_zones not implemented for this driver') + raise NotImplementedError("iterate_zones not implemented for this driver") def list_zones(self): + # type: () -> List[Zone] """ Return a list of zones. @@ -207,6 +272,7 @@ def list_zones(self): return list(self.iterate_zones()) def iterate_records(self, zone): + # type: (Zone) -> Iterator[Record] """ Return a generator to iterate over records for the provided zone. @@ -215,10 +281,10 @@ def iterate_records(self, zone): :rtype: ``generator`` of :class:`Record` """ - raise NotImplementedError( - 'iterate_records not implemented for this driver') + raise NotImplementedError("iterate_records not implemented for this driver") def list_records(self, zone): + # type: (Zone) -> List[Record] """ Return a list of records for the provided zone. @@ -230,6 +296,7 @@ def list_records(self, zone): return list(self.iterate_records(zone)) def get_zone(self, zone_id): + # type: (str) -> Zone """ Return a Zone instance. @@ -238,10 +305,10 @@ def get_zone(self, zone_id): :rtype: :class:`Zone` """ - raise NotImplementedError( - 'get_zone not implemented for this driver') + raise NotImplementedError("get_zone not implemented for this driver") def get_record(self, zone_id, record_id): + # type: (str, str) -> Record """ Return a Record instance. @@ -253,10 +320,10 @@ def get_record(self, zone_id, record_id): :rtype: :class:`Record` """ - raise NotImplementedError( - 'get_record not implemented for this driver') + raise NotImplementedError("get_record not implemented for this driver") - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type="master", ttl=None, extra=None): + # type: (str, str, Optional[int], Optional[dict]) -> Zone """ Create a new zone. @@ -274,12 +341,19 @@ def create_zone(self, domain, type='master', ttl=None, extra=None): :rtype: :class:`Zone` """ - raise NotImplementedError( - 'create_zone not implemented for this driver') + raise NotImplementedError("create_zone not implemented for this driver") - def update_zone(self, zone, domain, type='master', ttl=None, extra=None): + def update_zone( + self, + zone, # type: Zone + domain, # type: Optional[str] + type="master", # type: Optional[str] + ttl=None, # type: Optional[int] + extra=None, # type: Optional[dict] + ): + # type: (...) -> Zone """ - Update en existing zone. + Update an existing zone. :param zone: Zone to update. :type zone: :class:`Zone` @@ -298,10 +372,10 @@ def update_zone(self, zone, domain, type='master', ttl=None, extra=None): :rtype: :class:`Zone` """ - raise NotImplementedError( - 'update_zone not implemented for this driver') + raise NotImplementedError("update_zone not implemented for this driver") def create_record(self, name, zone, type, data, extra=None): + # type: (str, Zone, RecordType, str, Optional[dict]) -> Record """ Create a new record. @@ -325,10 +399,16 @@ def create_record(self, name, zone, type, data, extra=None): :rtype: :class:`Record` """ - raise NotImplementedError( - 'create_record not implemented for this driver') + raise NotImplementedError("create_record not implemented for this driver") - def update_record(self, record, name, type, data, extra): + def update_record( + self, + record, # type: Record + name, # type: Optional[str] + type, # type: Optional[RecordType] + data, # type: Optional[str] + extra=None, # type: Optional[dict] + ): """ Update an existing record. @@ -352,10 +432,10 @@ def update_record(self, record, name, type, data, extra): :rtype: :class:`Record` """ - raise NotImplementedError( - 'update_record not implemented for this driver') + raise NotImplementedError("update_record not implemented for this driver") def delete_zone(self, zone): + # type: (Zone) -> bool """ Delete a zone. @@ -366,10 +446,10 @@ def delete_zone(self, zone): :rtype: ``bool`` """ - raise NotImplementedError( - 'delete_zone not implemented for this driver') + raise NotImplementedError("delete_zone not implemented for this driver") def delete_record(self, record): + # type: (Record) -> bool """ Delete a record. @@ -378,10 +458,10 @@ def delete_record(self, record): :rtype: ``bool`` """ - raise NotImplementedError( - 'delete_record not implemented for this driver') + raise NotImplementedError("delete_record not implemented for this driver") def export_zone_to_bind_format(self, zone): + # type: (Zone) -> str """ Export Zone object to the BIND compatible format. @@ -391,8 +471,8 @@ def export_zone_to_bind_format(self, zone): :return: Zone data in BIND compatible format. :rtype: ``str`` """ - if zone.type != 'master': - raise ValueError('You can only generate BIND out for master zones') + if zone.type != "master": + raise ValueError("You can only generate BIND out for master zones") lines = [] @@ -400,22 +480,26 @@ def export_zone_to_bind_format(self, zone): records = zone.list_records() records = sorted(records, key=Record._get_numeric_id) - date = datetime.datetime.now().strftime('%Y-%m-%d %H:%m:%S') - values = {'version': __version__, 'date': date} + date = ( + datetime.datetime.now(datetime.timezone.utc) + .replace(tzinfo=None) + .strftime("%Y-%m-%d %H:%M:%S") + ) + values = {"version": __version__, "date": date} - lines.append('; Generated by Libcloud v%(version)s on %(date)s' % - values) - lines.append('$ORIGIN %(domain)s.' % {'domain': zone.domain}) - lines.append('$TTL %(domain_ttl)s\n' % {'domain_ttl': zone.ttl}) + lines.append("; Generated by Libcloud v%(version)s on %(date)s UTC" % values) + lines.append("$ORIGIN {domain}.".format(domain=zone.domain)) + lines.append("$TTL {domain_ttl}\n".format(domain_ttl=zone.ttl)) for record in records: line = self._get_bind_record_line(record=record) lines.append(line) - output = '\n'.join(lines) + output = "\n".join(lines) return output def export_zone_to_bind_zone_file(self, zone, file_path): + # type: (Zone, str) -> None """ Export Zone object to the BIND compatible format and write result to a file. @@ -428,10 +512,11 @@ def export_zone_to_bind_zone_file(self, zone, file_path): """ result = self.export_zone_to_bind_format(zone=zone) - with open(file_path, 'w') as fp: + with open(file_path, "w") as fp: fp.write(result) def _get_bind_record_line(self, record): + # type: (Record) -> str """ Generate BIND record line for the provided record. @@ -441,27 +526,34 @@ def _get_bind_record_line(self, record): :return: Bind compatible record line. :rtype: ``str`` """ - parts = [] + parts = [] # type: List[Any] if record.name: - name = '%(name)s.%(domain)s' % {'name': record.name, - 'domain': record.zone.domain} + name = "{name}.{domain}".format( + name=record.name, + domain=record.zone.domain, + ) else: name = record.zone.domain - name += '.' + name += "." - ttl = record.extra['ttl'] if 'ttl' in record.extra else record.zone.ttl + ttl = record.extra["ttl"] if "ttl" in record.extra else record.zone.ttl ttl = str(ttl) data = record.data - if record.type in [RecordType.CNAME, RecordType.DNAME, RecordType.MX, - RecordType.PTR, RecordType.SRV]: + if record.type in [ + RecordType.CNAME, + RecordType.DNAME, + RecordType.MX, + RecordType.PTR, + RecordType.SRV, + ]: # Make sure trailing dot is present - if data[len(data) - 1] != '.': - data += '.' + if data[len(data) - 1] != ".": + data += "." - if record.type in [RecordType.TXT, RecordType.SPF] and ' ' in data: + if record.type in [RecordType.TXT, RecordType.SPF] and " " in data: # Escape the quotes data = data.replace('"', '\\"') @@ -469,15 +561,16 @@ def _get_bind_record_line(self, record): data = '"%s"' % (data) if record.type in [RecordType.MX, RecordType.SRV]: - priority = str(record.extra['priority']) - parts = [name, ttl, 'IN', record.type, priority, data] + priority = str(record.extra["priority"]) + parts = [name, ttl, "IN", str(record.type), priority, data] else: - parts = [name, ttl, 'IN', record.type, data] + parts = [name, ttl, "IN", str(record.type), data] - line = '\t'.join(parts) + line = "\t".join(parts) return line def _string_to_record_type(self, string): + # type: (str) -> RecordType """ Return a string representation of a DNS record type to a libcloud RecordType ENUM. diff --git a/libcloud/dns/drivers/auroradns.py b/libcloud/dns/drivers/auroradns.py new file mode 100644 index 0000000000..97764212a2 --- /dev/null +++ b/libcloud/dns/drivers/auroradns.py @@ -0,0 +1,667 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +AuroraDNS DNS Driver +""" + +import hmac +import json +import base64 +import datetime +from hashlib import sha256 + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import ( + RecordType, + ZoneDoesNotExistError, + ZoneAlreadyExistsError, + RecordDoesNotExistError, +) +from libcloud.utils.py3 import b, httplib +from libcloud.common.base import JsonResponse, ConnectionUserAndKey +from libcloud.common.types import LibcloudError, ProviderError, InvalidCredsError + +API_HOST = "api.auroradns.eu" + +# Default TTL required by libcloud, but doesn't do anything in AuroraDNS +DEFAULT_ZONE_TTL = 3600 +DEFAULT_ZONE_TYPE = "master" + +VALID_RECORD_PARAMS_EXTRA = ["ttl", "prio", "health_check_id", "disabled"] + + +class AuroraDNSHealthCheckType: + """ + Healthcheck type. + """ + + HTTP = "HTTP" + HTTPS = "HTTPS" + TCP = "TCP" + + +class HealthCheckError(LibcloudError): + error_type = "HealthCheckError" + + def __init__(self, value, driver, health_check_id): + self.health_check_id = health_check_id + super().__init__(value=value, driver=driver) + + def __str__(self): + return self.__repr__() + + def __repr__(self): + return "<{} in {}, health_check_id={}, value={}>".format( + self.error_type, + repr(self.driver), + self.health_check_id, + self.value, + ) + + +class HealthCheckDoesNotExistError(HealthCheckError): + error_type = "HealthCheckDoesNotExistError" + + +class AuroraDNSHealthCheck: + """ + AuroraDNS Healthcheck resource. + """ + + def __init__( + self, + id, + type, + hostname, + ipaddress, + port, + interval, + path, + threshold, + health, + enabled, + zone, + driver, + extra=None, + ): + """ + :param id: Healthcheck id + :type id: ``str`` + + :param hostname: Hostname or FQDN of the target + :type hostname: ``str`` + + :param ipaddress: IPv4 or IPv6 address of the target + :type ipaddress: ``str`` + + :param port: The port on the target to monitor + :type port: ``int`` + + :param interval: The interval of the health check + :type interval: ``int`` + + :param path: The path to monitor on the target + :type path: ``str`` + + :param threshold: The threshold of before marking a check as failed + :type threshold: ``int`` + + :param health: The current health of the health check + :type health: ``bool`` + + :param enabled: If the health check is currently enabled + :type enabled: ``bool`` + + :param zone: Zone instance. + :type zone: :class:`Zone` + + :param driver: DNSDriver instance. + :type driver: :class:`DNSDriver` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + """ + self.id = str(id) if id else None + self.type = type + self.hostname = hostname + self.ipaddress = ipaddress + self.port = int(port) if port else None + self.interval = int(interval) + self.path = path + self.threshold = int(threshold) + self.health = bool(health) + self.enabled = bool(enabled) + self.zone = zone + self.driver = driver + self.extra = extra or {} + + def update( + self, + type=None, + hostname=None, + ipaddress=None, + port=None, + interval=None, + path=None, + threshold=None, + enabled=None, + extra=None, + ): + return self.driver.ex_update_healthcheck( + healthcheck=self, + type=type, + hostname=hostname, + ipaddress=ipaddress, + port=port, + path=path, + interval=interval, + threshold=threshold, + enabled=enabled, + extra=extra, + ) + + def delete(self): + return self.driver.ex_delete_healthcheck(healthcheck=self) + + def __repr__(self): + return ( + "" + % ( + self.zone.id, + self.id, + self.type, + self.hostname, + self.ipaddress, + self.port, + self.interval, + self.health, + self.driver.name, + ) + ) + + +class AuroraDNSResponse(JsonResponse): + def success(self): + return self.status in [httplib.OK, httplib.CREATED, httplib.ACCEPTED] + + def parse_error(self): + status = int(self.status) + error = {"driver": self, "value": ""} + + if status == httplib.UNAUTHORIZED: + error["value"] = "Authentication failed" + raise InvalidCredsError(**error) + elif status == httplib.FORBIDDEN: + error["value"] = "Authorization failed" + error["http_code"] = status + raise ProviderError(**error) + elif status == httplib.NOT_FOUND: + context = self.connection.context + if context["resource"] == "zone": + error["zone_id"] = context["id"] + raise ZoneDoesNotExistError(**error) + elif context["resource"] == "record": + error["record_id"] = context["id"] + raise RecordDoesNotExistError(**error) + elif context["resource"] == "healthcheck": + error["health_check_id"] = context["id"] + raise HealthCheckDoesNotExistError(**error) + elif status == httplib.CONFLICT: + context = self.connection.context + if context["resource"] == "zone": + error["zone_id"] = context["id"] + raise ZoneAlreadyExistsError(**error) + elif status == httplib.BAD_REQUEST: + context = self.connection.context + body = self.parse_body() + raise ProviderError(value=body["errormsg"], http_code=status, driver=self) + + +class AuroraDNSConnection(ConnectionUserAndKey): + host = API_HOST + responseCls = AuroraDNSResponse + + def calculate_auth_signature(self, secret_key, method, url, timestamp): + b64_hmac = base64.b64encode( + hmac.new(b(secret_key), b(method) + b(url) + b(timestamp), digestmod=sha256).digest() + ) + + return b64_hmac.decode("utf-8") + + def gen_auth_header(self, api_key, secret_key, method, url, timestamp): + signature = self.calculate_auth_signature(secret_key, method, url, timestamp) + + auth_b64 = base64.b64encode(b("{}:{}".format(api_key, signature))) + return "AuroraDNSv1 %s" % (auth_b64.decode("utf-8")) + + def request(self, action, params=None, data="", headers=None, method="GET"): + if not headers: + headers = {} + if not params: + params = {} + + if method in ("POST", "PUT"): + headers = {"Content-Type": "application/json; charset=UTF-8"} + + t = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None) + timestamp = t.strftime("%Y%m%dT%H%M%SZ") + + headers["X-AuroraDNS-Date"] = timestamp + headers["Authorization"] = self.gen_auth_header( + self.user_id, self.key, method, action, timestamp + ) + + return super().request( + action=action, params=params, data=data, method=method, headers=headers + ) + + +class AuroraDNSDriver(DNSDriver): + name = "AuroraDNS" + website = "https://www.pcextreme.nl/en/aurora/dns" + connectionCls = AuroraDNSConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.SOA: "SOA", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + RecordType.DS: "DS", + RecordType.PTR: "PTR", + RecordType.SSHFP: "SSHFP", + RecordType.TLSA: "TLSA", + } + + HEALTHCHECK_TYPE_MAP = { + AuroraDNSHealthCheckType.HTTP: "HTTP", + AuroraDNSHealthCheckType.HTTPS: "HTTPS", + AuroraDNSHealthCheckType.TCP: "TCP", + } + + def iterate_zones(self): + res = self.connection.request("/zones") + for zone in res.parse_body(): + yield self.__res_to_zone(zone) + + def iterate_records(self, zone): + self.connection.set_context({"resource": "zone", "id": zone.id}) + res = self.connection.request("/zones/%s/records" % zone.id) + + for record in res.parse_body(): + yield self.__res_to_record(zone, record) + + def get_zone(self, zone_id): + self.connection.set_context({"resource": "zone", "id": zone_id}) + res = self.connection.request("/zones/%s" % zone_id) + zone = res.parse_body() + return self.__res_to_zone(zone) + + def get_record(self, zone_id, record_id): + self.connection.set_context({"resource": "record", "id": record_id}) + res = self.connection.request("/zones/{}/records/{}".format(zone_id, record_id)) + record = res.parse_body() + + zone = self.get_zone(zone_id) + + return self.__res_to_record(zone, record) + + def create_zone(self, domain, type="master", ttl=None, extra=None): + self.connection.set_context({"resource": "zone", "id": domain}) + res = self.connection.request("/zones", method="POST", data=json.dumps({"name": domain})) + zone = res.parse_body() + return self.__res_to_zone(zone) + + def create_record(self, name, zone, type, data, extra=None): + if name is None: + name = "" + + rdata = {"name": name, "type": self.RECORD_TYPE_MAP[type], "content": data} + + rdata = self.__merge_extra_data(rdata, extra) + + if "ttl" not in rdata: + rdata["ttl"] = DEFAULT_ZONE_TTL + + self.connection.set_context({"resource": "zone", "id": zone.id}) + res = self.connection.request( + "/zones/%s/records" % zone.id, method="POST", data=json.dumps(rdata) + ) + + record = res.parse_body() + return self.__res_to_record(zone, record) + + def delete_zone(self, zone): + self.connection.set_context({"resource": "zone", "id": zone.id}) + self.connection.request("/zones/%s" % zone.id, method="DELETE") + return True + + def delete_record(self, record): + self.connection.set_context({"resource": "record", "id": record.id}) + self.connection.request( + "/zones/{}/records/{}".format(record.zone.id, record.id), method="DELETE" + ) + return True + + def list_record_types(self): + types = [] + for record_type in self.RECORD_TYPE_MAP.keys(): + types.append(record_type) + + return types + + def update_record(self, record, name, type, data, extra=None): + rdata = {} + + if name is not None: + rdata["name"] = name + + if type is not None: + rdata["type"] = self.RECORD_TYPE_MAP[type] + + if data is not None: + rdata["content"] = data + + rdata = self.__merge_extra_data(rdata, extra) + + self.connection.set_context({"resource": "record", "id": record.id}) + self.connection.request( + "/zones/{}/records/{}".format(record.zone.id, record.id), + method="PUT", + data=json.dumps(rdata), + ) + + return self.get_record(record.zone.id, record.id) + + def ex_list_healthchecks(self, zone): + """ + List all Health Checks in a zone. + + :param zone: Zone to list health checks for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`AuroraDNSHealthCheck` + """ + healthchecks = [] + self.connection.set_context({"resource": "zone", "id": zone.id}) + res = self.connection.request("/zones/%s/health_checks" % zone.id) + + for healthcheck in res.parse_body(): + healthchecks.append(self.__res_to_healthcheck(zone, healthcheck)) + + return healthchecks + + def ex_get_healthcheck(self, zone, health_check_id): + """ + Get a single Health Check from a zone + + :param zone: Zone in which the health check is + :type zone: :class:`Zone` + + :param health_check_id: ID of the required health check + :type health_check_id: ``str`` + + :return: :class:`AuroraDNSHealthCheck` + """ + self.connection.set_context({"resource": "healthcheck", "id": health_check_id}) + res = self.connection.request("/zones/{}/health_checks/{}".format(zone.id, health_check_id)) + check = res.parse_body() + + return self.__res_to_healthcheck(zone, check) + + def ex_create_healthcheck( + self, + zone, + type, + hostname, + port, + path, + interval, + threshold, + ipaddress=None, + enabled=True, + extra=None, + ): + """ + Create a new Health Check in a zone + + :param zone: Zone in which the health check should be created + :type zone: :class:`Zone` + + :param type: The type of health check to be created + :type type: :class:`AuroraDNSHealthCheckType` + + :param hostname: The hostname of the target to monitor + :type hostname: ``str`` + + :param port: The port of the target to monitor. E.g. 80 for HTTP + :type port: ``int`` + + :param path: The path of the target to monitor. Only used by HTTP + at this moment. Usually this is simple /. + :type path: ``str`` + + :param interval: The interval of checks. 10, 30 or 60 seconds. + :type interval: ``int`` + + :param threshold: The threshold of failures before the healthcheck is + marked as failed. + :type threshold: ``int`` + + :param ipaddress: (optional) The IP Address of the target to monitor. + You can pass a empty string if this is not required. + :type ipaddress: ``str`` + + :param enabled: (optional) If this healthcheck is enabled to run + :type enabled: ``bool`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :return: :class:`AuroraDNSHealthCheck` + """ + cdata = { + "type": self.HEALTHCHECK_TYPE_MAP[type], + "hostname": hostname, + "ipaddress": ipaddress, + "port": int(port), + "interval": int(interval), + "path": path, + "threshold": int(threshold), + "enabled": enabled, + } + + self.connection.set_context({"resource": "zone", "id": zone.id}) + res = self.connection.request( + "/zones/%s/health_checks" % zone.id, method="POST", data=json.dumps(cdata) + ) + + healthcheck = res.parse_body() + return self.__res_to_healthcheck(zone, healthcheck) + + def ex_update_healthcheck( + self, + healthcheck, + type=None, + hostname=None, + ipaddress=None, + port=None, + path=None, + interval=None, + threshold=None, + enabled=None, + extra=None, + ): + """ + Update an existing Health Check + + :param zone: The healthcheck which has to be updated + :type zone: :class:`AuroraDNSHealthCheck` + + :param type: (optional) The type of health check to be created + :type type: :class:`AuroraDNSHealthCheckType` + + :param hostname: (optional) The hostname of the target to monitor + :type hostname: ``str`` + + :param ipaddress: (optional) The IP Address of the target to monitor. + You can pass a empty string if this is not required. + :type ipaddress: ``str`` + + :param port: (optional) The port of the target to monitor. E.g. 80 + for HTTP + :type port: ``int`` + + :param path: (optional) The path of the target to monitor. + Only used by HTTP at this moment. Usually just '/'. + :type path: ``str`` + + :param interval: (optional) The interval of checks. + 10, 30 or 60 seconds. + :type interval: ``int`` + + :param threshold: (optional) The threshold of failures before the + healthcheck is marked as failed. + :type threshold: ``int`` + + :param enabled: (optional) If this healthcheck is enabled to run + :type enabled: ``bool`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :return: :class:`AuroraDNSHealthCheck` + """ + cdata = {} + + if type is not None: + cdata["type"] = self.HEALTHCHECK_TYPE_MAP[type] + + if hostname is not None: + cdata["hostname"] = hostname + + if ipaddress is not None: + if len(ipaddress) == 0: + cdata["ipaddress"] = None + else: + cdata["ipaddress"] = ipaddress + + if port is not None: + cdata["port"] = int(port) + + if path is not None: + cdata["path"] = path + + if interval is not None: + cdata["interval"] = int(interval) + + if threshold is not None: + cdata["threshold"] = threshold + + if enabled is not None: + cdata["enabled"] = bool(enabled) + + self.connection.set_context({"resource": "healthcheck", "id": healthcheck.id}) + + self.connection.request( + "/zones/{}/health_checks/{}".format(healthcheck.zone.id, healthcheck.id), + method="PUT", + data=json.dumps(cdata), + ) + + return self.ex_get_healthcheck(healthcheck.zone, healthcheck.id) + + def ex_delete_healthcheck(self, healthcheck): + """ + Remove an existing Health Check + + :param zone: The healthcheck which has to be removed + :type zone: :class:`AuroraDNSHealthCheck` + """ + self.connection.set_context({"resource": "healthcheck", "id": healthcheck.id}) + + self.connection.request( + "/zones/{}/health_checks/{}".format(healthcheck.zone.id, healthcheck.id), + method="DELETE", + ) + return True + + def __res_to_record(self, zone, record): + if len(record["name"]) == 0: + name = None + else: + name = record["name"] + + extra = {} + extra["created"] = record["created"] + extra["modified"] = record["modified"] + extra["disabled"] = record["disabled"] + extra["ttl"] = record["ttl"] + extra["priority"] = record["prio"] + + return Record( + id=record["id"], + name=name, + type=record["type"], + data=record["content"], + zone=zone, + driver=self.connection.driver, + ttl=record["ttl"], + extra=extra, + ) + + def __res_to_zone(self, zone): + return Zone( + id=zone["id"], + domain=zone["name"], + type=DEFAULT_ZONE_TYPE, + ttl=DEFAULT_ZONE_TTL, + driver=self.connection.driver, + extra={ + "created": zone["created"], + "servers": zone["servers"], + "account_id": zone["account_id"], + "cluster_id": zone["cluster_id"], + }, + ) + + def __res_to_healthcheck(self, zone, healthcheck): + return AuroraDNSHealthCheck( + id=healthcheck["id"], + type=healthcheck["type"], + hostname=healthcheck["hostname"], + ipaddress=healthcheck["ipaddress"], + health=healthcheck["health"], + threshold=healthcheck["threshold"], + path=healthcheck["path"], + interval=healthcheck["interval"], + port=healthcheck["port"], + enabled=healthcheck["enabled"], + zone=zone, + driver=self.connection.driver, + ) + + def __merge_extra_data(self, rdata, extra): + if extra is not None: + for param in VALID_RECORD_PARAMS_EXTRA: + if param in extra: + rdata[param] = extra[param] + + return rdata diff --git a/libcloud/dns/drivers/buddyns.py b/libcloud/dns/drivers/buddyns.py new file mode 100644 index 0000000000..11a18f6776 --- /dev/null +++ b/libcloud/dns/drivers/buddyns.py @@ -0,0 +1,148 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +BuddyNS DNS Driver +""" + +try: + import simplejson as json +except ImportError: + import json + +from libcloud.dns.base import Zone, DNSDriver +from libcloud.dns.types import Provider, ZoneDoesNotExistError, ZoneAlreadyExistsError +from libcloud.common.buddyns import BuddyNSResponse, BuddyNSException, BuddyNSConnection + +__all__ = ["BuddyNSDNSDriver"] + + +class BuddyNSDNSResponse(BuddyNSResponse): + pass + + +class BuddyNSDNSConnection(BuddyNSConnection): + responseCls = BuddyNSDNSResponse + + +class BuddyNSDNSDriver(DNSDriver): + name = "BuddyNS DNS" + website = "https://www.buddyns.com" + type = Provider.BUDDYNS + connectionCls = BuddyNSDNSConnection + + def list_zones(self): + action = "/api/v2/zone/" + response = self.connection.request(action=action, method="GET") + zones = self._to_zones(items=response.parse_body()) + + return zones + + def get_zone(self, zone_id): + """ + :param zone_id: Zone domain name (e.g. example.com) + :return: :class:`Zone` + """ + action = "/api/v2/zone/%s" % zone_id + try: + response = self.connection.request(action=action, method="GET") + except BuddyNSException as e: + if e.message == "Not found": + raise ZoneDoesNotExistError(value=e.message, driver=self, zone_id=zone_id) + else: + raise e + zone = self._to_zone(response.parse_body()) + + return zone + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type (This is not really used. See API docs for \ + extra parameters) + :type type: ``str`` + + :param ttl: TTL for new records (This is used through the extra param) + :type ttl: ``int`` + + :param extra: Extra attributes that are specific to the driver + such as ttl. + :type extra: ``dict`` + + :rtype: :class:`Zone` + Do not forget to pass the master in extra, + extra = {'master':'65.55.37.62'} for example. + """ + action = "/api/v2/zone/" + data = {"name": domain} + if extra is not None: + data.update(extra) + post_data = json.dumps(data) + try: + response = self.connection.request(action=action, method="POST", data=post_data) + except BuddyNSException as e: + if e.message == "Invalid zone submitted for addition.": + raise ZoneAlreadyExistsError(value=e.message, driver=self, zone_id=domain) + else: + raise e + + zone = self._to_zone(response.parse_body()) + + return zone + + def delete_zone(self, zone): + """ + :param zone: Zone to be deleted. + :type zone: :class:`Zone` + + :return: Boolean + """ + action = "/api/v2/zone/%s" % zone.domain + try: + self.connection.request(action=action, method="DELETE") + except BuddyNSException as e: + if e.message == "Not found": + raise ZoneDoesNotExistError(value=e.message, driver=self, zone_id=zone.id) + else: + raise e + + return True + + def _to_zone(self, item): + common_keys = [ + "name", + ] + extra = {} + for key in item: + if key not in common_keys: + extra[key] = item.get(key) + zone = Zone( + domain=item["name"], + id=item["name"], + type=None, + extra=extra, + ttl=None, + driver=self, + ) + + return zone + + def _to_zones(self, items): + zones = [] + for item in items: + zones.append(self._to_zone(item)) + + return zones diff --git a/libcloud/dns/drivers/cloudflare.py b/libcloud/dns/drivers/cloudflare.py new file mode 100644 index 0000000000..e9fac1c985 --- /dev/null +++ b/libcloud/dns/drivers/cloudflare.py @@ -0,0 +1,560 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__all__ = ["CloudFlareDNSDriver"] + +import json +import itertools + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import ( + Provider, + RecordType, + ZoneDoesNotExistError, + ZoneAlreadyExistsError, + RecordDoesNotExistError, + RecordAlreadyExistsError, +) +from libcloud.utils.misc import reverse_dict, merge_valid_keys +from libcloud.common.base import JsonResponse, ConnectionKey, ConnectionUserAndKey +from libcloud.common.types import LibcloudError, InvalidCredsError + +API_HOST = "api.cloudflare.com" +API_BASE = "/client/v4" + +CLOUDFLARE_TO_LIBCLOUD_ZONE_TYPE = { + "full": "master", + "partial": "slave", +} + +LIBCLOUD_TO_CLOUDFLARE_ZONE_TYPE = reverse_dict(CLOUDFLARE_TO_LIBCLOUD_ZONE_TYPE) + +ZONE_EXTRA_ATTRIBUTES = { + "development_mode", + "original_name_servers", + "original_registrar", + "original_dnshost", + "created_on", + "modified_on", + "activated_on", + "owner", + "account", + "permissions", + "plan", + "plan_pending", + "status", + "paused", + "name_servers", +} + +ZONE_UPDATE_ATTRIBUTES = { + "paused", + "vanity_name_servers", + "plan", +} + +ZONE_CREATE_ATTRIBUTES = { + "jump_start", +} + +RECORD_EXTRA_ATTRIBUTES = { + "proxiable", + "proxied", + "locked", + "created_on", + "modified_on", + "data", + "priority", +} + +RECORD_CREATE_ATTRIBUTES = { + "ttl", + "priority", + "proxied", +} + +RECORD_UPDATE_ATTRIBUTES = { + "ttl", + "proxied", +} + + +class CloudFlareDNSResponse(JsonResponse): + exceptions = { + 9103: (InvalidCredsError, []), + 1001: (ZoneDoesNotExistError, ["zone_id"]), + 1061: (ZoneAlreadyExistsError, ["zone_id"]), + 1002: (RecordDoesNotExistError, ["record_id"]), + 81053: (RecordAlreadyExistsError, ["record_id"]), + # 81057: The record already exists. + 81057: (RecordAlreadyExistsError, []), + # 81058: A record with those settings already exists. + 81058: (RecordAlreadyExistsError, ["record_id"]), + } + + def success(self): + body = self.parse_body() + + is_success = body.get("success", False) + + return is_success + + def parse_error(self): + body = self.parse_body() + + errors = body.get("errors", []) + + for error in errors: + error_chain = error.get("error_chain", []) + + error_chain_errors = [] + for chain_error in error_chain: + error_chain_errors.append( + "%s: %s" + % ( + chain_error.get("code", "unknown"), + chain_error.get("message", ""), + ) + ) + + try: + exception_class, context = self.exceptions[error["code"]] + except KeyError: + exception_class, context = LibcloudError, [] + + kwargs = { + "value": "{}: {} (error chain: {})".format( + error["code"], error["message"], ", ".join(error_chain_errors) + ), + "driver": self.connection.driver, + } + + if error["code"] == 81057: + # Record id is not available when creating a record and not + # updating it + kwargs["record_id"] = "unknown" + + merge_valid_keys(kwargs, context, self.connection.context) + + raise exception_class(**kwargs) + + +class BaseDNSConnection: + host = API_HOST + secure = True + responseCls = CloudFlareDNSResponse + + def encode_data(self, data): + return json.dumps(data) + + +class GlobalAPIKeyDNSConnection(BaseDNSConnection, ConnectionUserAndKey): + def add_default_headers(self, headers): + headers["Content-Type"] = "application/json" + headers["X-Auth-Email"] = self.user_id + headers["X-Auth-Key"] = self.key + + return headers + + +class TokenDNSConnection(BaseDNSConnection, ConnectionKey): + def add_default_headers(self, headers): + headers["Content-Type"] = "application/json" + headers["Authorization"] = "Bearer %s" % self.key + + return headers + + +class CloudFlareDNSDriver(DNSDriver): + type = Provider.CLOUDFLARE + name = "CloudFlare DNS" + website = "https://www.cloudflare.com" + connectionCls = GlobalAPIKeyDNSConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.TXT: "TXT", + RecordType.SPF: "SPF", + RecordType.NS: "NS", + RecordType.SRV: "SRV", + RecordType.LOC: "LOC", + } + + ZONES_PAGE_SIZE = 50 + RECORDS_PAGE_SIZE = 100 + MEMBERSHIPS_PAGE_SIZE = 50 + + def __init__(self, key, secret=None, secure=True, host=None, port=None, **kwargs): + if secret is None: + self.connectionCls = TokenDNSConnection + + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port, **kwargs) + + def iterate_zones(self): + def _iterate_zones(params): + url = "{}/zones".format(API_BASE) + + response = self.connection.request(url, params=params) + + items = response.object["result"] + zones = [self._to_zone(item) for item in items] + + return response, zones + + return self._paginate(_iterate_zones, self.ZONES_PAGE_SIZE) + + def iterate_records(self, zone): + def _iterate_records(params): + url = "{}/zones/{}/dns_records".format(API_BASE, zone.id) + + self.connection.set_context({"zone_id": zone.id}) + response = self.connection.request(url, params=params) + + items = response.object["result"] + records = [self._to_record(zone, item) for item in items] + + return response, records + + return self._paginate(_iterate_records, self.RECORDS_PAGE_SIZE) + + def get_zone(self, zone_id): + url = "{}/zones/{}".format(API_BASE, zone_id) + + self.connection.set_context({"zone_id": zone_id}) + response = self.connection.request(url) + + item = response.object["result"] + zone = self._to_zone(item) + + return zone + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + @inherits: :class:`DNSDriver.create_zone` + + Note that for users who have more than one account membership, + the id of the account in which to create the zone must be + specified via the ``extra`` key ``account``. + + Note that for ``extra`` zone properties, only the ones specified in + ``ZONE_CREATE_ATTRIBUTES`` can be set at creation time. Additionally, + setting the ``ttl` property is not supported. + """ + extra = extra or {} + + account = extra.get("account") + if account is None: + memberships = self.ex_get_user_account_memberships() + memberships = list(itertools.islice(memberships, 2)) + + if len(memberships) != 1: + raise ValueError("must specify account for zone") + + account = memberships[0]["account"]["id"] + + url = "{}/zones".format(API_BASE) + + body = { + "name": domain, + "account": {"id": account}, + "type": LIBCLOUD_TO_CLOUDFLARE_ZONE_TYPE[type], + } + + merge_valid_keys(body, ZONE_CREATE_ATTRIBUTES, extra) + + response = self.connection.request(url, data=body, method="POST") + + item = response.object["result"] + zone = self._to_zone(item) + + return zone + + def update_zone(self, zone, domain, type="master", ttl=None, extra=None): + """ + @inherits: :class:`DNSDriver.update_zone` + + Note that the ``zone``, ``type`` and ``ttl`` properties can't be + updated. The only updatable properties are the ``extra`` zone + properties specified in ``ZONE_UPDATE_ATTRIBUTES``. Only one property + may be updated at a time. Any non-updatable properties are ignored. + """ + body = merge_valid_keys({}, ZONE_UPDATE_ATTRIBUTES, extra) + if len(body) != 1: + return zone + + url = "{}/zones/{}".format(API_BASE, zone.id) + + self.connection.set_context({"zone_id": zone.id}) + response = self.connection.request(url, data=body, method="PATCH") + + item = response.object["result"] + zone = self._to_zone(item) + + return zone + + def delete_zone(self, zone): + url = "{}/zones/{}".format(API_BASE, zone.id) + + self.connection.set_context({"zone_id": zone.id}) + response = self.connection.request(url, method="DELETE") + + item = response.object.get("result", {}).get("id") + is_deleted = item == zone.id + + return is_deleted + + def get_record(self, zone_id, record_id): + zone = self.get_zone(zone_id) + + url = "{}/zones/{}/dns_records/{}".format(API_BASE, zone.id, record_id) + + self.connection.set_context({"record_id": record_id}) + response = self.connection.request(url) + + item = response.object["result"] + record = self._to_record(zone, item) + + return record + + def create_record(self, name, zone, type, data, extra=None): + """ + @inherits: :class:`DNSDriver.create_record` + + Note that for ``extra`` record properties, only the ones specified in + ``RECORD_CREATE_ATTRIBUTES`` can be set at creation time. Any + non-settable properties are ignored. + + NOTE: For CAA RecordType, data needs to be in the following format: + where the tag can be issue, issuewild + or iodef. + + For example: 0 issue test.caa.com + + NOTE: For SSHFP RecordType, data need to be in the format: + + """ + url = "{}/zones/{}/dns_records".format(API_BASE, zone.id) + + content, data = self._normalize_record_data_for_api(type=type, data=data) + body = {"type": type, "name": name, "content": content} + + if data: + body["data"] = data + + merge_valid_keys(body, RECORD_CREATE_ATTRIBUTES, extra) + + self.connection.set_context({"zone_id": zone.id}) + response = self.connection.request(url, data=body, method="POST") + + item = response.object["result"] + record = self._to_record(zone, item) + + return record + + def update_record(self, record, name=None, type=None, data=None, extra=None): + """ + @inherits: :class:`DNSDriver.update_record` + + Note that for ``extra`` record properties, only the ones specified in + ``RECORD_UPDATE_ATTRIBUTES`` can be updated. Any non-updatable + properties are ignored. + """ + url = "{}/zones/{}/dns_records/{}".format(API_BASE, record.zone.id, record.id) + + content, data = self._normalize_record_data_for_api(type=type, data=data) + body = { + "type": record.type if type is None else type, + "name": record.name if name is None else name, + "content": content, + "extra": record.extra or {}, + } + + if data: + body["data"] = data + + merge_valid_keys(body["extra"], RECORD_UPDATE_ATTRIBUTES, extra) + + self.connection.set_context({"record_id": record.id}) + response = self.connection.request(url, data=body, method="PUT") + + item = response.object["result"] + record = self._to_record(record.zone, item) + + return record + + def delete_record(self, record): + url = "{}/zones/{}/dns_records/{}".format(API_BASE, record.zone.id, record.id) + + self.connection.set_context({"record_id": record.id}) + response = self.connection.request(url, method="DELETE") + + item = response.object.get("result", {}).get("id") + is_deleted = item == record.id + + return is_deleted + + def ex_get_user_account_memberships(self): + def _ex_get_user_account_memberships(params): + url = "{}/memberships".format(API_BASE) + + response = self.connection.request(url, params=params) + return response, response.object["result"] + + return self._paginate(_ex_get_user_account_memberships, self.MEMBERSHIPS_PAGE_SIZE) + + def ex_get_zone_stats(self, zone, interval=30): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_zone_check(self, zones): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_get_ip_threat_score(self, ip): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_get_zone_settings(self, zone): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_set_zone_security_level(self, zone, level): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_set_zone_cache_level(self, zone, level): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_enable_development_mode(self, zone): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_disable_development_mode(self, zone): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_purge_cached_files(self, zone): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_purge_cached_file(self, zone, url): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_whitelist_ip(self, zone, ip): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_blacklist_ip(self, zone, ip): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_unlist_ip(self, zone, ip): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_enable_ipv6_support(self, zone): + raise NotImplementedError("not yet implemented in v4 driver") + + def ex_disable_ipv6_support(self, zone): + raise NotImplementedError("not yet implemented in v4 driver") + + def _normalize_record_data_for_api(self, type, data): + """ + Normalize record data for "special" records such as CAA and SSHFP + so it can be used with the CloudFlare API. + + Keep ind mind that value for SSHFP record type onluy needs to be + normalized for the create / update operations. + + On list operation (aka response), actual value is returned + normally in the "content" attribute. + """ + cf_data = {} + if not data: + return data, cf_data + + if type == RecordType.CAA: + # Replace whitespace with \t character which CloudFlare API + # expects + data = data.replace(" ", "\t") + + elif type == RecordType.SSHFP: + _fp = data.split(" ") + cf_data = {"algorithm": _fp[0], "type": _fp[1], "fingerprint": _fp[2]} + data = None + + return data, cf_data + + def _normalize_record_data_from_api(self, type, data): + """ + Normalize record data for special records so it's consistent with + the Libcloud API. + """ + if not data: + return data + + if type == RecordType.CAA: + # CloudFlare uses \t but we normalize it to whitespace so it's + # consistent across all the drivers. + data = data.replace("\t", " ") + + return data + + def _to_zone(self, item): + return Zone( + id=item["id"], + domain=item["name"], + type=CLOUDFLARE_TO_LIBCLOUD_ZONE_TYPE[item["type"]], + ttl=None, + driver=self, + extra={key: item.get(key) for key in ZONE_EXTRA_ATTRIBUTES}, + ) + + def _to_record(self, zone, item): + name = item["name"] + name = name or None + + ttl = item.get("ttl") + if ttl is not None: + ttl = int(ttl) + + data = self._normalize_record_data_from_api(item["type"], item["content"]) + + return Record( + id=item["id"], + name=name, + type=item["type"], + data=data, + zone=zone, + driver=self, + ttl=ttl, + extra={key: item.get(key) for key in RECORD_EXTRA_ATTRIBUTES}, + ) + + def _paginate(self, get_page, page_size): + for page in itertools.count(start=1): + params = {"page": page, "per_page": page_size} + + response, items = get_page(params) + + yield from items + + if self._is_last_page(response): + break + + if len(items) < page_size: + break + + def _is_last_page(self, response): + try: + result_info = response.object["result_info"] + last_page = result_info["total_pages"] + current_page = result_info["page"] + except KeyError: + return False + + return current_page == last_page diff --git a/libcloud/dns/drivers/digitalocean.py b/libcloud/dns/drivers/digitalocean.py new file mode 100644 index 0000000000..b8dc743baf --- /dev/null +++ b/libcloud/dns/drivers/digitalocean.py @@ -0,0 +1,319 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Digital Ocean DNS Driver +""" + +__all__ = ["DigitalOceanDNSDriver"] + +import json + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import Provider, RecordType +from libcloud.utils.py3 import httplib +from libcloud.common.digitalocean import DigitalOcean_v2_BaseDriver, DigitalOcean_v2_Connection + + +class DigitalOceanDNSDriver(DigitalOcean_v2_BaseDriver, DNSDriver): + connectionCls = DigitalOcean_v2_Connection + type = Provider.DIGITAL_OCEAN + name = "DigitalOcean" + website = "https://www.digitalocean.com" + + RECORD_TYPE_MAP = { + RecordType.NS: "NS", + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.TXT: "TXT", + RecordType.SRV: "SRV", + } + + def list_zones(self): + """ + Return a list of zones. + + :return: ``list`` of :class:`Zone` + """ + data = self._paginated_request("/v2/domains", "domains") + return list(map(self._to_zone, data)) + + def list_records(self, zone): + """ + Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + data = self._paginated_request("/v2/domains/%s/records" % (zone.id), "domain_records") + # TODO: Not use list comprehension to add zone to record for proper data map + # functionality? This passes a reference to zone for each data currently + # to _to_record which returns a Record. map() does not take keywords + return list(map(self._to_record, data, [zone for z in data])) + + def get_zone(self, zone_id): + """ + Return a Zone instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + data = self.connection.request("/v2/domains/%s" % (zone_id)).object["domain"] + + return self._to_zone(data) + + def get_record(self, zone_id, record_id): + """ + Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + data = self.connection.request( + "/v2/domains/{}/records/{}".format(zone_id, record_id) + ).object["domain_record"] + + # TODO: Any way of not using get_zone which polls the API again + # without breaking the DNSDriver.get_record parameters? + return self._to_record(data, self.get_zone(zone_id)) + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + Create a new zone. + + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type (master / slave) (does nothing). + :type type: ``str`` + + :param ttl: TTL for new records. (does nothing) + :type ttl: ``int`` + + :param extra: Extra attributes (to set ip). (optional) + Note: This can be used to set the default A record with + {"ip" : "IP.AD.DR.ESS"} otherwise 127.0.0.1 is used + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + params = {"name": domain} + try: + params["ip_address"] = extra["ip"] + except Exception: + params["ip_address"] = "127.0.0.1" + + res = self.connection.request("/v2/domains", data=json.dumps(params), method="POST") + + return Zone( + id=res.object["domain"]["name"], + domain=res.object["domain"]["name"], + type="master", + ttl=1800, + driver=self, + extra={}, + ) + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a new record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone where the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: Extra attributes for MX and SRV. (Depends on record) + {"priority" : 0, "port" : 443, "weight" : 100} + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + params = {"type": self.RECORD_TYPE_MAP[type], "name": name, "data": data} + if extra: + try: + params["priority"] = extra["priority"] + except KeyError: + params["priority"] = None + try: + params["port"] = extra["port"] + except KeyError: + params["port"] = None + try: + params["weight"] = extra["weight"] + except KeyError: + params["weight"] = None + + if "ttl" in extra: + params["ttl"] = extra["ttl"] + + res = self.connection.request( + "/v2/domains/%s/records" % zone.id, data=json.dumps(params), method="POST" + ) + + return Record( + id=res.object["domain_record"]["id"], + name=res.object["domain_record"]["name"], + type=type, + data=data, + zone=zone, + ttl=res.object["domain_record"].get("ttl", None), + driver=self, + extra=extra, + ) + + def update_record(self, record, name=None, type=None, data=None, extra=None): + """ + Update an existing record. + + :param record: Record to update. + :type record: :class:`Record` + + :param name: Record name without the domain name (e.g. www). (Ignored) + Note: The value is pulled from the record being updated + :type name: ``str`` + + :param type: DNS record type (A, AAAA, ...). (Ignored) + Note: Updating records does not support changing type + so this value is ignored + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + params = {"type": record.type, "name": record.name, "data": data} + if data is None: + params["data"] = record.data + if extra: + try: + params["priority"] = extra["priority"] + except KeyError: + params["priority"] = None + try: + params["port"] = extra["port"] + except KeyError: + params["port"] = None + try: + params["weight"] = extra["weight"] + except KeyError: + params["weight"] = None + + if "ttl" in extra: + params["ttl"] = extra["ttl"] + + res = self.connection.request( + "/v2/domains/{}/records/{}".format(record.zone.id, record.id), + data=json.dumps(params), + method="PUT", + ) + + return Record( + id=res.object["domain_record"]["id"], + name=res.object["domain_record"]["name"], + type=record.type, + data=data, + zone=record.zone, + ttl=res.object["domain_record"].get("ttl", None), + driver=self, + extra=extra, + ) + + def delete_zone(self, zone): + """ + Delete a zone. + + Note: This will delete all the records belonging to this zone. + + :param zone: Zone to delete. + :type zone: :class:`Zone` + + :rtype: ``bool`` + """ + params = {} + + res = self.connection.request("/v2/domains/%s" % zone.id, params=params, method="DELETE") + + return res.status == httplib.NO_CONTENT + + def delete_record(self, record): + """ + Delete a record. + + :param record: Record to delete. + :type record: :class:`Record` + + :rtype: ``bool`` + """ + params = {} + + res = self.connection.request( + "/v2/domains/{}/records/{}".format(record.zone.id, record.id), + params=params, + method="DELETE", + ) + return res.status == httplib.NO_CONTENT + + def _to_record(self, data, zone=None): + extra = { + "port": data["port"], + "priority": data["priority"], + "weight": data["weight"], + } + return Record( + id=data["id"], + name=data["name"], + type=self._string_to_record_type(data["type"]), + data=data["data"], + zone=zone, + ttl=data.get("ttl", None), + driver=self, + extra=extra, + ) + + def _to_zone(self, data): + extra = {"zone_file": data["zone_file"]} + return Zone( + id=data["name"], + domain=data["name"], + type="master", + ttl=data["ttl"], + driver=self, + extra=extra, + ) diff --git a/libcloud/dns/drivers/dnsimple.py b/libcloud/dns/drivers/dnsimple.py new file mode 100644 index 0000000000..11bb5d5848 --- /dev/null +++ b/libcloud/dns/drivers/dnsimple.py @@ -0,0 +1,311 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +DNSimple DNS Driver +""" + +__all__ = ["DNSimpleDNSDriver"] + +try: + import simplejson as json +except ImportError: + import json + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import Provider, RecordType +from libcloud.common.dnsimple import DNSimpleDNSConnection + +DEFAULT_ZONE_TTL = 3600 + + +class DNSimpleDNSDriver(DNSDriver): + type = Provider.DNSIMPLE + name = "DNSimple" + website = "https://dnsimple.com/" + connectionCls = DNSimpleDNSConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.ALIAS: "ALIAS", + RecordType.CNAME: "CNAME", + RecordType.HINFO: "HINFO", + RecordType.MX: "MX", + RecordType.NAPTR: "NAPTR", + RecordType.NS: "NS", + "POOL": "POOL", + RecordType.SOA: "SOA", + RecordType.SPF: "SPF", + RecordType.SRV: "SRV", + RecordType.SSHFP: "SSHFP", + RecordType.TXT: "TXT", + RecordType.URL: "URL", + } + + def list_zones(self): + """ + Return a list of zones. + + :return: ``list`` of :class:`Zone` + """ + response = self.connection.request("/v1/domains") + + zones = self._to_zones(response.object) + return zones + + def list_records(self, zone): + """ + Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + response = self.connection.request("/v1/domains/%s/records" % zone.id) + records = self._to_records(response.object, zone) + return records + + def get_zone(self, zone_id): + """ + Return a Zone instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + response = self.connection.request("/v1/domains/%s" % zone_id) + zone = self._to_zone(response.object) + return zone + + def get_record(self, zone_id, record_id): + """ + Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + response = self.connection.request("/v1/domains/{}/records/{}".format(zone_id, record_id)) + record = self._to_record(response.object, zone_id=zone_id) + return record + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + Create a new zone. + + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type (All zones are master by design). + :type type: ``str`` + + :param ttl: TTL for new records. (This is not really used) + :type ttl: ``int`` + + :param extra: Extra attributes (driver specific). (optional) + :type extra: ``dict`` + + :rtype: :class:`Zone` + + For more info, please see: + http://developer.dnsimple.com/v1/domains/ + """ + r_json = {"name": domain} + if extra is not None: + r_json.update(extra) + r_data = json.dumps({"domain": r_json}) + response = self.connection.request("/v1/domains", method="POST", data=r_data) + zone = self._to_zone(response.object) + return zone + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a new record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone where the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: Extra attributes (driver specific). (optional) + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + r_json = {"name": name, "record_type": type, "content": data} + if extra is not None: + r_json.update(extra) + r_data = json.dumps({"record": r_json}) + response = self.connection.request( + "/v1/domains/%s/records" % zone.id, method="POST", data=r_data + ) + record = self._to_record(response.object, zone=zone) + return record + + def update_record(self, record, name, type, data, extra=None): + """ + Update an existing record. + + :param record: Record to update. + :type record: :class:`Record` + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + zone = record.zone + r_json = {"name": name, "content": data} + if extra is not None: + r_json.update(extra) + r_data = json.dumps({"record": r_json}) + response = self.connection.request( + "/v1/domains/{}/records/{}".format(zone.id, record.id), + method="PUT", + data=r_data, + ) + record = self._to_record(response.object, zone=zone) + return record + + def delete_zone(self, zone): + """ + Delete a zone. + + Note: This will delete all the records belonging to this zone. + + :param zone: Zone to delete. + :type zone: :class:`Zone` + + :rtype: ``bool`` + """ + self.connection.request("/v1/domains/%s" % zone.id, method="DELETE") + return True + + def delete_record(self, record): + """ + Delete a record. + + :param record: Record to delete. + :type record: :class:`Record` + + :rtype: ``bool`` + """ + zone_id = record.zone.id + self.connection.request( + "/v1/domains/{}/records/{}".format(zone_id, record.id), method="DELETE" + ) + return True + + def _to_zones(self, data): + zones = [] + for zone in data: + _zone = self._to_zone(zone) + zones.append(_zone) + + return zones + + def _to_zone(self, data): + domain = data.get("domain") + id = domain.get("id") + name = domain.get("name") + extra = { + "registrant_id": domain.get("registrant_id"), + "user_id": domain.get("user_id"), + "unicode_name": domain.get("unicode_name"), + "token": domain.get("token"), + "state": domain.get("state"), + "language": domain.get("language"), + "lockable": domain.get("lockable"), + "auto_renew": domain.get("auto_renew"), + "whois_protected": domain.get("whois_protected"), + "record_count": domain.get("record_count"), + "service_count": domain.get("service_count"), + "expires_on": domain.get("expires_on"), + "created_at": domain.get("created_at"), + "updated_at": domain.get("updated_at"), + } + + # All zones are primary by design + type = "master" + + return Zone( + id=id, + domain=name, + type=type, + ttl=DEFAULT_ZONE_TTL, + driver=self, + extra=extra, + ) + + def _to_records(self, data, zone): + records = [] + for item in data: + record = self._to_record(item, zone=zone) + records.append(record) + return records + + def _to_record(self, data, zone_id=None, zone=None): + if not zone: # We need zone_id or zone + zone = self.get_zone(zone_id) + record = data.get("record") + id = record.get("id") + name = record.get("name") + type = record.get("record_type") + data = record.get("content") + extra = { + "ttl": record.get("ttl"), + "created_at": record.get("created_at"), + "updated_at": record.get("updated_at"), + "domain_id": record.get("domain_id"), + "priority": record.get("prio"), + } + return Record( + id=id, + name=name, + type=type, + data=data, + zone=zone, + driver=self, + ttl=record.get("ttl", None), + extra=extra, + ) diff --git a/libcloud/dns/drivers/dnspod.py b/libcloud/dns/drivers/dnspod.py new file mode 100644 index 0000000000..770fafbf3a --- /dev/null +++ b/libcloud/dns/drivers/dnspod.py @@ -0,0 +1,334 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.dns.base import Zone, Record, DNSDriver, RecordType +from libcloud.dns.types import ( + Provider, + ZoneDoesNotExistError, + ZoneAlreadyExistsError, + RecordDoesNotExistError, + RecordAlreadyExistsError, +) +from libcloud.utils.py3 import urlencode +from libcloud.common.dnspod import DNSPodResponse, DNSPodException, DNSPodConnection + +__all__ = ["DNSPodDNSDriver"] + +ZONE_ALREADY_EXISTS_ERROR_MSGS = [ + "Domain is exists", + "Domain already exists as " "an alias of another domain", +] +ZONE_DOES_NOT_EXIST_ERROR_MSGS = [ + "Domain not under you or your user", + "Domain id invalid", +] + +RECORD_DOES_NOT_EXIST_ERRORS_MSGS = ["Record id invalid"] + + +class DNSPodDNSResponse(DNSPodResponse): + pass + + +class DNSPodDNSConnection(DNSPodConnection): + responseCls = DNSPodDNSResponse + + +class DNSPodDNSDriver(DNSDriver): + name = "DNSPod" + website = "https://dnspod.com" + type = Provider.DNSPOD + connectionCls = DNSPodDNSConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.PTR: "PTR", + RecordType.SOA: "SOA", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + } + + def _make_request(self, action, method, data=None): + data = data or {} + if not data.get("user_token"): + data["user_token"] = self.key + if not data.get("format"): + data["format"] = "json" + data = urlencode(data) + r = self.connection.request(action=action, method=method, data=data) + return r + + def list_zones(self): + action = "/Domain.List" + try: + response = self._make_request(action=action, method="POST") + except DNSPodException as e: + if e.message == "No domains": + return [] + zones = self._to_zones(items=response.object["domains"]) + + return zones + + def delete_zone(self, zone): + """ + :param zone: Zone to be deleted. + :type zone: :class:`Zone` + + :return: Boolean + """ + action = "/Domain.Remove" + data = {"domain_id": zone.id} + try: + self._make_request(action=action, method="POST", data=data) + except DNSPodException as e: + if e.message in ZONE_DOES_NOT_EXIST_ERROR_MSGS: + raise ZoneDoesNotExistError(value=e.message, driver=self, zone_id=zone.id) + else: + raise e + + return True + + def get_zone(self, zone_id): + """ + :param zone_id: Zone domain name (e.g. example.com) + :return: :class:`Zone` + """ + action = "/Domain.Info" + data = {"domain_id": zone_id} + try: + response = self._make_request(action=action, method="POST", data=data) + except DNSPodException as e: + if e.message in ZONE_DOES_NOT_EXIST_ERROR_MSGS: + raise ZoneDoesNotExistError(value=e.message, driver=self, zone_id=zone_id) + else: + raise e + zone = self._to_zone(response.object["domain"]) + + return zone + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type (This is not really used. See API docs for extra + parameters) + :type type: ``str`` + + :param ttl: TTL for new records (This is used through the extra param) + :type ttl: ``int`` + + :param extra: Extra attributes that are specific to the driver + such as ttl. + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + action = "/Domain.Create" + data = {"domain": domain} + if extra is not None: + data.update(extra) + try: + response = self._make_request(action=action, method="POST", data=data) + except DNSPodException as e: + if e.message in ZONE_ALREADY_EXISTS_ERROR_MSGS: + raise ZoneAlreadyExistsError(value=e.message, driver=self, zone_id=domain) + else: + raise e + + zone = self._to_zone(response.object["domain"]) + + return zone + + def list_records(self, zone): + """ + Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + action = "/Record.List" + data = {"domain_id": zone.id} + try: + response = self._make_request(action=action, data=data, method="POST") + except DNSPodException as e: + if e.message in ZONE_DOES_NOT_EXIST_ERROR_MSGS: + raise ZoneDoesNotExistError(value="", driver=self, zone_id=zone.id) + else: + raise e + records = self._to_records(response.object["records"], zone=zone) + + return records + + def delete_record(self, record): + """ + Delete a record. + + :param record: Record to delete. + :type record: :class:`Record` + + :rtype: ``bool`` + """ + action = "/Record.Remove" + data = {"domain_id": record.zone.id, "record_id": record.id} + try: + self._make_request(action=action, method="POST", data=data) + except DNSPodException as e: + if e.message in RECORD_DOES_NOT_EXIST_ERRORS_MSGS: + raise RecordDoesNotExistError(record_id=record.id, driver=self, value="") + elif e.message in ZONE_DOES_NOT_EXIST_ERROR_MSGS: + raise ZoneDoesNotExistError(zone_id=record.zone.id, driver=self, value="") + else: + raise e + + return True + + def get_record(self, zone_id, record_id): + """ + Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + zone = self.get_zone(zone_id=zone_id) + action = "/Record.Info" + data = {"domain_id": zone_id, "record_id": record_id} + try: + response = self._make_request(action=action, method="POST", data=data) + except DNSPodException as e: + if e.message in RECORD_DOES_NOT_EXIST_ERRORS_MSGS: + raise RecordDoesNotExistError(record_id=record_id, driver=self, value="") + elif e.message in ZONE_DOES_NOT_EXIST_ERROR_MSGS: + raise ZoneDoesNotExistError(zone_id=zone_id, driver=self, value="") + else: + raise e + + record = self._to_record(response.object["record"], zone=zone) + + return record + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone which the records will be created for. + :type zone: :class:`Zone` + + :param type: DNS record type ( 'A', 'AAAA', 'CNAME', 'MX', 'NS', + 'PTR', 'SOA', 'SRV', 'TXT'). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: (optional) Extra attributes ('prio', 'ttl'). + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + action = "/Record.Create" + data = { + "sub_domain": name, + "value": data, + "record_type": type, + "domain_id": zone.id, + } + # ttl is optional + # pass it through extra like this: extra={'ttl':ttl} + # record_line is a required parameter + # pass it through extra like this: extra={'record_line':'default'} + # when creating MX records you need to pass mx through extra + # mx ranges from 1 to 20 + # extra = {'ttl': '13', 'record_line': default, 'mx': 1} + if extra is not None: + data.update(extra) + try: + response = self._make_request(action=action, method="POST", data=data) + except DNSPodException as e: + if e.message == ("Record impacted, same record exists " "or CNAME/URL impacted"): + raise RecordAlreadyExistsError(record_id="", driver=self, value=name) + raise e + + record_id = response.object["record"].get("id") + record = self.get_record(zone_id=zone.id, record_id=record_id) + + return record + + def _to_zone(self, item): + common_attr = ["name", "id", "ttl"] + extra = {} + for key in item.keys(): + if key not in common_attr: + extra[key] = item.get(key) + + zone = Zone( + domain=item.get("name") or item.get("domain"), + id=item.get("id"), + type=None, + extra=extra, + ttl=item.get("ttl"), + driver=self, + ) + + return zone + + def _to_zones(self, items): + zones = [] + for item in items: + zones.append(self._to_zone(item)) + + return zones + + def _to_record(self, item, zone): + common_attr = ["id", "value", "name", "type"] + extra = {} + for key in item: + if key not in common_attr: + extra[key] = item.get(key) + record = Record( + id=item.get("id"), + name=item.get("name") or item.get("sub_domain"), + type=item.get("type") or item.get("record_type"), + data=item.get("value"), + zone=zone, + driver=self, + extra=extra, + ) + + return record + + def _to_records(self, items, zone): + records = [] + for item in items: + records.append(self._to_record(item, zone)) + + return records diff --git a/libcloud/dns/drivers/dummy.py b/libcloud/dns/drivers/dummy.py index 04da354a61..23961ed053 100644 --- a/libcloud/dns/drivers/dummy.py +++ b/libcloud/dns/drivers/dummy.py @@ -13,11 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from libcloud.dns.base import DNSDriver, Zone, Record -from libcloud.dns.types import RecordType -from libcloud.dns.types import ZoneDoesNotExistError, ZoneAlreadyExistsError -from libcloud.dns.types import RecordDoesNotExistError -from libcloud.dns.types import RecordAlreadyExistsError +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import ( + RecordType, + ZoneDoesNotExistError, + ZoneAlreadyExistsError, + RecordDoesNotExistError, + RecordAlreadyExistsError, +) class DummyDNSDriver(DNSDriver): @@ -30,8 +33,8 @@ class DummyDNSDriver(DNSDriver): 'Dummy DNS Provider' """ - name = 'Dummy DNS Provider' - website = 'http://example.com' + name = "Dummy DNS Provider" + website = "http://example.com" def __init__(self, api_key, api_secret): """ @@ -64,7 +67,7 @@ def list_zones(self): @inherits: :class:`DNSDriver.list_zones` """ - return [zone['zone'] for zone in list(self._zones.values())] + return [zone["zone"] for zone in list(self._zones.values())] def list_records(self, zone): """ @@ -76,9 +79,9 @@ def list_records(self, zone): >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') >>> list(zone.list_records()) #doctest: +ELLIPSIS - [] + [] """ - return self._zones[zone.id]['records'].values() + return self._zones[zone.id]["records"].values() def get_zone(self, zone_id): """ @@ -92,10 +95,9 @@ def get_zone(self, zone_id): """ if zone_id not in self._zones: - raise ZoneDoesNotExistError(driver=self, value=None, - zone_id=zone_id) + raise ZoneDoesNotExistError(driver=self, value=None, zone_id=zone_id) - return self._zones[zone_id]['zone'] + return self._zones[zone_id]["zone"] def get_record(self, zone_id, record_id): """ @@ -109,15 +111,14 @@ def get_record(self, zone_id, record_id): """ self.get_zone(zone_id=zone_id) - zone_records = self._zones[zone_id]['records'] + zone_records = self._zones[zone_id]["records"] if record_id not in zone_records: - raise RecordDoesNotExistError(record_id=record_id, value=None, - driver=self) + raise RecordDoesNotExistError(record_id=record_id, value=None, driver=self) return zone_records[record_id] - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type="master", ttl=None, extra=None): """ >>> driver = DummyDNSDriver('key', 'secret') >>> zone = driver.create_zone(domain='apache.org', type='master', @@ -133,15 +134,13 @@ def create_zone(self, domain, type='master', ttl=None, extra=None): @inherits: :class:`DNSDriver.create_zone` """ - id = 'id-%s' % (domain) + id = "id-%s" % (domain) if id in self._zones: raise ZoneAlreadyExistsError(zone_id=id, value=None, driver=self) - zone = Zone(id=id, domain=domain, type=type, ttl=ttl, extra={}, - driver=self) - self._zones[id] = {'zone': zone, - 'records': {}} + zone = Zone(id=id, domain=domain, type=type, ttl=ttl, extra={}, driver=self) + self._zones[id] = {"zone": zone, "records": {}} return zone def create_record(self, name, zone, type, data, extra=None): @@ -152,7 +151,7 @@ def create_record(self, name, zone, type, data, extra=None): >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') >>> record #doctest: +ELLIPSIS - + >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') ... #doctest: +IGNORE_EXCEPTION_DETAIL @@ -161,17 +160,15 @@ def create_record(self, name, zone, type, data, extra=None): @inherits: :class:`DNSDriver.create_record` """ - id = 'id-%s' % (name) + id = "id-%s" % (name) zone = self.get_zone(zone_id=zone.id) - if id in self._zones[zone.id]['records']: - raise RecordAlreadyExistsError(record_id=id, value=None, - driver=self) + if id in self._zones[zone.id]["records"]: + raise RecordAlreadyExistsError(record_id=id, value=None, driver=self) - record = Record(id=id, name=name, type=type, data=data, extra=extra, - zone=zone, driver=self) - self._zones[zone.id]['records'][id] = record + record = Record(id=id, name=name, type=type, data=data, extra=extra, zone=zone, driver=self) + self._zones[zone.id]["records"][id] = record return record def delete_zone(self, zone): @@ -209,10 +206,11 @@ def delete_record(self, record): """ self.get_record(zone_id=record.zone.id, record_id=record.id) - del self._zones[record.zone.id]['records'][record.id] + del self._zones[record.zone.id]["records"][record.id] return True if __name__ == "__main__": import doctest + doctest.testmod() diff --git a/libcloud/dns/drivers/durabledns.py b/libcloud/dns/drivers/durabledns.py new file mode 100644 index 0000000000..9b1486d930 --- /dev/null +++ b/libcloud/dns/drivers/durabledns.py @@ -0,0 +1,732 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +DurableDNS Driver +""" + +from xml.etree.ElementTree import tostring + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import ( + Provider, + RecordType, + ZoneDoesNotExistError, + ZoneAlreadyExistsError, + RecordDoesNotExistError, +) +from libcloud.utils.py3 import httplib, ensure_string +from libcloud.common.durabledns import ( + SCHEMA_BUILDER_MAP, + DurableResponse, + DurableConnection, + DurableDNSException, +) +from libcloud.common.durabledns import _schema_builder as api_schema_builder + +__all__ = [ + "ZONE_EXTRA_PARAMS_DEFAULT_VALUES", + "RECORD_EXTRA_PARAMS_DEFAULT_VALUES", + "DEFAULT_TTL", + "DurableDNSResponse", + "DurableDNSConnection", + "DurableDNSDriver", +] + +# This will be the default values for each extra attributes when are not +# specified in the 'extra' parameter +ZONE_EXTRA_PARAMS_DEFAULT_VALUES = { + "ns": "ns1.durabledns.com.", + "mbox": "support.durabledns.com", + "refresh": "28800", + "retry": 7200, + "expire": 604800, + "minimum": 82000, + "xfer": "", + "update_acl": "", +} + +RECORD_EXTRA_PARAMS_DEFAULT_VALUES = {"aux": 0, "ttl": 3600} + +DEFAULT_TTL = 3600 + + +class DurableDNSResponse(DurableResponse): + pass + + +class DurableDNSConnection(DurableConnection): + responseCls = DurableDNSResponse + + +class DurableDNSDriver(DNSDriver): + type = Provider.DURABLEDNS + name = "DurableDNS" + website = "https://durabledns.com" + connectionCls = DurableDNSConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.HINFO: "HINFO", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.PTR: "PTR", + RecordType.RP: "RP", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + } + + def list_zones(self): + """ + Return a list of zones. + + :return: ``list`` of :class:`Zone` + """ + schema_params = SCHEMA_BUILDER_MAP.get("list_zones") + attributes = schema_params.get("attributes") + schema = api_schema_builder( + schema_params.get("urn_nid"), schema_params.get("method"), attributes + ) + params = {"apiuser": self.key, "apikey": self.secret} + urn = list(schema)[0] + for child in urn: + key = child.tag.split(":")[2] + if key in attributes: + child.text = str(params.get(key)) + req_data = tostring(schema) + action = "/services/dns/listZones.php" + params = {} + headers = {"SOAPAction": "urn:listZoneswsdl#listZones"} + response = self.connection.request( + action=action, params=params, data=req_data, method="POST", headers=headers + ) + # listZones method doesn't return full data in zones as getZone + # method does. + zones = [] + for data in response.objects: + zone = self.get_zone(data.get("id")) + zones.append(zone) + return zones + + def list_records(self, zone): + """ + Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + schema_params = SCHEMA_BUILDER_MAP.get("list_records") + attributes = schema_params.get("attributes") + schema = api_schema_builder( + schema_params.get("urn_nid"), schema_params.get("method"), attributes + ) + params = {"apiuser": self.key, "apikey": self.secret, "zonename": zone.id} + urn = list(schema)[0] + for child in urn: + key = child.tag.split(":")[2] + if key in attributes: + child.text = str(params.get(key)) + req_data = tostring(schema) + action = "/services/dns/listRecords.php?" + params = {} + headers = {"SOAPAction": "urn:listRecordswsdl#listRecords"} + try: + response = self.connection.request( + action=action, + params=params, + data=req_data, + method="POST", + headers=headers, + ) + except DurableDNSException as e: + if "Zone does not exist" in e.message: + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + raise e + + # listRecords method doesn't return full data in records as getRecord + # method does. + records = [] + for data in response.objects: + record = self.get_record(zone.id, data.get("id")) + records.append(record) + + return records + + def get_zone(self, zone_id): + """ + Return a Zone instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + schema_params = SCHEMA_BUILDER_MAP.get("get_zone") + attributes = schema_params.get("attributes") + schema = api_schema_builder( + schema_params.get("urn_nid"), schema_params.get("method"), attributes + ) + params = {"apiuser": self.key, "apikey": self.secret, "zonename": zone_id} + urn = list(schema)[0] + for child in urn: + key = child.tag.split(":")[2] + if key in attributes: + child.text = str(params.get(key)) + req_data = tostring(schema) + action = "/services/dns/getZone.php?" + params = {} + headers = {"SOAPAction": "urn:getZonewsdl#getZone"} + try: + response = self.connection.request( + action=action, + params=params, + data=req_data, + method="POST", + headers=headers, + ) + except DurableDNSException as e: + if "Zone does not exist" in e.message: + raise ZoneDoesNotExistError(zone_id=zone_id, driver=self, value=e.message) + raise e + + zones = self._to_zones(response.objects) + + return zones[0] + + def get_record(self, zone_id, record_id): + """ + Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + schema_params = SCHEMA_BUILDER_MAP.get("get_record") + attributes = schema_params.get("attributes") + schema = api_schema_builder( + schema_params.get("urn_nid"), schema_params.get("method"), attributes + ) + params = { + "apiuser": self.key, + "apikey": self.secret, + "zonename": zone_id, + "recordid": record_id, + } + urn = list(schema)[0] + for child in urn: + key = child.tag.split(":")[2] + if key in attributes: + child.text = str(params.get(key)) + req_data = tostring(schema) + action = "/services/dns/getRecord.php?" + params = {} + headers = {"SOAPAction": "urn:getRecordwsdl#getRecord"} + try: + response = self.connection.request( + action=action, + params=params, + data=req_data, + method="POST", + headers=headers, + ) + except DurableDNSException as e: + if "Zone does not exist" in e.message: + raise ZoneDoesNotExistError(zone_id=zone_id, driver=self, value=e.message) + if "Record does not exist" in e.message: + raise RecordDoesNotExistError(record_id=record_id, driver=self, value=e.message) + raise e + + zone = self.get_zone(zone_id) + record = self._to_record(response.objects[0], zone) + return record + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + Create a new zone. + + :param domain: Name of zone, followed by a dot (.) (e.g. example.com.) + :type domain: ``str`` + + :param type: Zone type (Only master available). (optional) + :type type: ``str`` + + :param ttl: TTL for new records. (optional) + :type ttl: ``int`` + + :param extra: Extra attributes ('mbox', 'ns', 'minimum', 'refresh', + 'expire', 'update_acl', 'xfer'). + (optional) + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + if extra is None: + extra = ZONE_EXTRA_PARAMS_DEFAULT_VALUES + else: + extra_fields = ZONE_EXTRA_PARAMS_DEFAULT_VALUES.keys() + missing = set(extra_fields).difference(set(extra.keys())) + for field in missing: + extra[field] = ZONE_EXTRA_PARAMS_DEFAULT_VALUES.get(field) + schema_params = SCHEMA_BUILDER_MAP.get("create_zone") + attributes = schema_params.get("attributes") + schema = api_schema_builder( + schema_params.get("urn_nid"), schema_params.get("method"), attributes + ) + params = { + "apiuser": self.key, + "apikey": self.secret, + "zonename": domain, + "ttl": ttl or DEFAULT_TTL, + } + params.update(extra) + urn = list(schema)[0] + for child in urn: + key = child.tag.split(":")[2] + if key in attributes: + if isinstance(params.get(key), int): + child.text = "%d" + else: + child.text = "%s" + # We can't insert values directly in child.text because API raises + # and exception for values that need to be integers. And tostring + # method from ElementTree can't handle int values. + skel = ensure_string(tostring(schema)) # Deal with PY3 + req_data = skel % ( + self.key, + self.secret, + domain, + extra.get("ns"), + extra.get("mbox"), + extra.get("refresh"), + extra.get("retry"), + extra.get("expire"), + extra.get("minimum"), + ttl or DEFAULT_TTL, + extra.get("xfer"), + extra.get("update_acl"), + ) + action = "/services/dns/createZone.php?" + params = {} + headers = {"SOAPAction": "urn:createZonewsdl#createZone"} + try: + self.connection.request( + action=action, + params=params, + data=req_data, + method="POST", + headers=headers, + ) + except DurableDNSException as e: + if "Zone Already Exist" in e.message: + raise ZoneAlreadyExistsError(zone_id=domain, driver=self, value=e.message) + raise e + + zone = self.get_zone(domain) + return zone + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a new record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone where the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: Extra attributes (e.g. 'aux', 'ttl'). (optional) + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + if extra is None: + extra = RECORD_EXTRA_PARAMS_DEFAULT_VALUES + else: + if "aux" not in extra: + extra["aux"] = RECORD_EXTRA_PARAMS_DEFAULT_VALUES.get("aux") + if "ttl" not in extra: + extra["ttl"] = RECORD_EXTRA_PARAMS_DEFAULT_VALUES.get("ttl") + extra["ddns_enabled"] = "N" + schema_params = SCHEMA_BUILDER_MAP.get("create_record") + attributes = schema_params.get("attributes") + schema = api_schema_builder( + schema_params.get("urn_nid"), schema_params.get("method"), attributes + ) + params = { + "apiuser": self.key, + "apikey": self.secret, + "zonename": zone.id, + "name": name, + "type": type, + "data": data, + } + params.update(extra) + urn = list(schema)[0] + for child in urn: + key = child.tag.split(":")[2] + if key in attributes: + if isinstance(params.get(key), int): + child.text = "%d" + else: + child.text = "%s" + # We can't insert values directly in child.text because API raises + # and exception for values that need to be integers. And tostring + # method from ElementTree can't handle int values. + skel = ensure_string(tostring(schema)) # Deal with PY3 + req_data = skel % ( + self.key, + self.secret, + zone.id, + name, + type, + data, + extra.get("aux"), + extra.get("ttl"), + extra.get("ddns_enabled"), + ) + action = "/services/dns/createRecord.php?" + headers = {"SOAPAction": "urn:createRecordwsdl#createRecord"} + try: + response = self.connection.request( + action=action, data=req_data, method="POST", headers=headers + ) + objects = response.objects + except DurableDNSException as e: + # In DurableDNS is possible to create records with same data. + # Their ID's will be different but the API does not implement + # the RecordAlreadyExist exception. Only ZoneDoesNotExist will + # be handled. + if "Zone does not exist" in e.message: + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + raise e + + record_item = objects[0] + record_item["name"] = name + record_item["type"] = type + record_item["data"] = data + record_item["ttl"] = extra.get("ttl") + record_item["aux"] = extra.get("aux") + + record = self._to_record(record_item, zone) + return record + + def update_zone(self, zone, domain, type="master", ttl=None, extra=None): + """ + Update an existing zone. + + :param zone: Zone to update. + :type zone: :class:`Zone` + + :param domain: Name of zone, followed by a dot (.) (e.g. example.com.) + :type domain: ``str`` + + :param type: Zone type (master / slave). + :type type: ``str`` + + :param ttl: TTL for new records. (optional) + :type ttl: ``int`` + + :param extra: Extra attributes ('ns', 'mbox', 'refresh', 'retry', + 'expire', 'minimum', 'xfer', 'update_acl'). (optional) + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + if ttl is None: + ttl = zone.ttl + if extra is None: + extra = zone.extra + else: + extra_fields = ZONE_EXTRA_PARAMS_DEFAULT_VALUES.keys() + missing = set(extra_fields).difference(set(extra.keys())) + for field in missing: + extra[field] = zone.extra.get(field) + schema_params = SCHEMA_BUILDER_MAP.get("update_zone") + attributes = schema_params.get("attributes") + schema = api_schema_builder( + schema_params.get("urn_nid"), schema_params.get("method"), attributes + ) + params = { + "apiuser": self.key, + "apikey": self.secret, + "zonename": domain, + "ttl": ttl, + } + params.update(extra) + urn = list(schema)[0] + for child in urn: + key = child.tag.split(":")[2] + if key in attributes: + if isinstance(params.get(key), int): + child.text = "%d" + else: + child.text = "%s" + # We can't insert values directly in child.text because API raises + # and exception for values that need to be integers. And tostring + # method from ElementTree can't handle int values. + skel = ensure_string(tostring(schema)) # Deal with PY3 + req_data = skel % ( + self.key, + self.secret, + domain, + extra["ns"], + extra["mbox"], + extra["refresh"], + extra["retry"], + extra["expire"], + extra["minimum"], + ttl, + extra["xfer"], + extra["update_acl"], + ) + action = "/services/dns/updateZone.php?" + headers = {"SOAPAction": "urn:updateZonewsdl#updateZone"} + try: + self.connection.request(action=action, data=req_data, method="POST", headers=headers) + except DurableDNSException as e: + if "Zone does not exist" in e.message: + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + raise e + + # After update the zone, serial number change. In order to have it + # updated, we need to get again the zone data. + zone = self.get_zone(zone.id) + return zone + + def update_record(self, record, name, type, data, extra=None): + """ + Update an existing record. + + :param record: Record to update. + :type record: :class:`Record` + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + zone = record.zone + if extra is None: + extra = record.extra + else: + extra_fields = ["aux", "ttl"] + missing = set(extra_fields).difference(set(extra.keys())) + for field in missing: + extra[field] = record.extra.get(field) + extra["ddns_enabled"] = "N" + schema_params = SCHEMA_BUILDER_MAP.get("update_record") + attributes = schema_params.get("attributes") + schema = api_schema_builder( + schema_params.get("urn_nid"), schema_params.get("method"), attributes + ) + params = { + "apiuser": self.key, + "apikey": self.secret, + "zonename": zone.id, + "id": record.id, + "name": name, + "data": data, + } + params.update(extra) + urn = list(schema)[0] + for child in urn: + key = child.tag.split(":")[2] + if key in attributes: + if isinstance(params.get(key), int): + child.text = "%d" + else: + child.text = "%s" + # We can't insert values directly in child.text because API raises + # and exception for values that need to be integers. And tostring + # method from ElementTree can't handle int values. + skel = ensure_string(tostring(schema)) # Deal with PY3 + req_data = skel % ( + self.key, + self.secret, + zone.id, + record.id, + name, + extra.get("aux"), + data, + extra.get("ttl"), + extra.get("ddns_enabled"), + ) + action = "/services/dns/updateRecord.php?" + headers = {"SOAPAction": "urn:updateRecordwsdl#updateRecord"} + try: + self.connection.request(action=action, data=req_data, method="POST", headers=headers) + except DurableDNSException as e: + if "Zone does not exist" in e.message: + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + raise e + + record_item = {} + record_item["id"] = record.id + record_item["name"] = name + record_item["type"] = type + record_item["data"] = data + record_item["ttl"] = extra.get("ttl") + record_item["aux"] = extra.get("aux") + record = self._to_record(record_item, zone) + return record + + def delete_zone(self, zone): + """ + Delete a zone. + + Note: This will delete all the records belonging to this zone. + + :param zone: Zone to delete. + :type zone: :class:`Zone` + + :rtype: ``bool`` + """ + schema_params = SCHEMA_BUILDER_MAP.get("delete_zone") + attributes = schema_params.get("attributes") + schema = api_schema_builder( + schema_params.get("urn_nid"), schema_params.get("method"), attributes + ) + params = {"apiuser": self.key, "apikey": self.secret, "zonename": zone.id} + urn = list(schema)[0] + for child in urn: + key = child.tag.split(":")[2] + if key in attributes: + child.text = str(params.get(key)) + req_data = tostring(schema) + action = "/services/dns/deleteZone.php?" + headers = {"SOAPAction": "urn:deleteZonewsdl#deleteZone"} + try: + response = self.connection.request( + action=action, data=req_data, method="POST", headers=headers + ) + except DurableDNSException as e: + if "Zone does not exist" in e.message: + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + raise e + + return response.status in [httplib.OK] + + def delete_record(self, record): + """ + Delete a record. + + :param record: Record to delete. + :type record: :class:`Record` + + :rtype: ``bool`` + """ + schema_params = SCHEMA_BUILDER_MAP.get("delete_record") + attributes = schema_params.get("attributes") + schema = api_schema_builder( + schema_params.get("urn_nid"), schema_params.get("method"), attributes + ) + params = { + "apiuser": self.key, + "apikey": self.secret, + "zonename": record.zone.id, + "id": record.id, + } + urn = list(schema)[0] + for child in urn: + key = child.tag.split(":")[2] + if key in attributes: + child.text = str(params.get(key)) + req_data = tostring(schema) + action = "/services/dns/deleteRecord.php?" + headers = {"SOAPAction": "urn:deleteRecordwsdl#deleteRecord"} + try: + response = self.connection.request( + action=action, data=req_data, headers=headers, method="POST" + ) + except DurableDNSException as e: + if "Record does not exists" in e.message: + raise RecordDoesNotExistError(record_id=record.id, driver=self, value=e.message) + if "Zone does not exist" in e.message: + raise ZoneDoesNotExistError(zone_id=record.zone.id, driver=self, value=e.message) + raise e + + return response.status in [httplib.OK] + + def _to_zone(self, item): + extra = item.get("extra") + # DurableDNS does not return information about zone type. This will be + # set as master by default. + zone = Zone( + id=item.get("id"), + type="master", + domain=item.get("id"), + ttl=item.get("ttl"), + driver=self, + extra=extra, + ) + + return zone + + def _to_zones(self, items): + zones = [] + for item in items: + zones.append(self._to_zone(item)) + + return zones + + def _to_record(self, item, zone=None): + extra = {"aux": int(item.get("aux")), "ttl": int(item.get("ttl"))} + record = Record( + id=item.get("id"), + type=item.get("type"), + zone=zone, + name=item.get("name"), + data=item.get("data"), + driver=self, + ttl=item.get("ttl", None), + extra=extra, + ) + + return record + + def _to_records(self, items, zone=None): + records = [] + for item in items: + records.append(self._to_record(item, zone)) + + return records diff --git a/libcloud/dns/drivers/gandi.py b/libcloud/dns/drivers/gandi.py index 792110da40..675bec0858 100644 --- a/libcloud/dns/drivers/gandi.py +++ b/libcloud/dns/drivers/gandi.py @@ -13,25 +13,25 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement -__all__ = [ - 'GandiDNSDriver' -] +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import ( + Provider, + RecordType, + RecordError, + ZoneDoesNotExistError, + RecordDoesNotExistError, +) +from libcloud.common.gandi import GandiResponse, BaseGandiDriver, GandiConnection -from libcloud.common.gandi import BaseGandiDriver, GandiConnection -from libcloud.common.gandi import GandiResponse -from libcloud.dns.types import Provider, RecordType -from libcloud.dns.types import RecordError -from libcloud.dns.types import ZoneDoesNotExistError, RecordDoesNotExistError -from libcloud.dns.base import DNSDriver, Zone, Record +__all__ = ["GandiDNSDriver"] TTL_MIN = 30 TTL_MAX = 2592000 # 30 days -class NewZoneVersion(object): +class NewZoneVersion: """ Changes to a zone in the Gandi DNS service need to be wrapped in a new version object. The changes are made to the new version, then that @@ -51,8 +51,8 @@ def __init__(self, driver, zone): def __enter__(self): zid = int(self.zone.id) - self.connection.set_context({'zone_id': self.zone.id}) - vid = self.connection.request('domain.zone.version.new', zid).object + self.connection.set_context({"zone_id": self.zone.id}) + vid = self.connection.request("domain.zone.version.new", zid).object self.vid = vid return vid @@ -60,8 +60,8 @@ def __exit__(self, type, value, traceback): if not traceback: zid = int(self.zone.id) con = self.connection - con.set_context({'zone_id': self.zone.id}) - con.request('domain.zone.version.set', zid, self.vid).object + con.set_context({"zone_id": self.zone.id}) + con.request("domain.zone.version.set", zid, self.vid).object class GandiDNSResponse(GandiResponse): @@ -82,32 +82,32 @@ class GandiDNSDriver(BaseGandiDriver, DNSDriver): """ type = Provider.GANDI - name = 'Gandi DNS' - website = 'http://www.gandi.net/domain' + name = "Gandi DNS" + website = "http://www.gandi.net/domain" connectionCls = GandiDNSConnection RECORD_TYPE_MAP = { - RecordType.A: 'A', - RecordType.AAAA: 'AAAA', - RecordType.CNAME: 'CNAME', - RecordType.LOC: 'LOC', - RecordType.MX: 'MX', - RecordType.NS: 'NS', - RecordType.SPF: 'SPF', - RecordType.SRV: 'SRV', - RecordType.TXT: 'TXT', - RecordType.WKS: 'WKS', + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.LOC: "LOC", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.SPF: "SPF", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + RecordType.WKS: "WKS", } def _to_zone(self, zone): return Zone( - id=str(zone['id']), - domain=zone['name'], - type='master', + id=str(zone["id"]), + domain=zone["name"], + type="master", ttl=0, driver=self, - extra={} + extra={}, ) def _to_zones(self, zones): @@ -117,44 +117,54 @@ def _to_zones(self, zones): return ret def list_zones(self): - zones = self.connection.request('domain.zone.list') + zones = self.connection.request("domain.zone.list") return self._to_zones(zones.object) def get_zone(self, zone_id): zid = int(zone_id) - self.connection.set_context({'zone_id': zone_id}) - zone = self.connection.request('domain.zone.info', zid) + self.connection.set_context({"zone_id": zone_id}) + zone = self.connection.request("domain.zone.info", zid) return self._to_zone(zone.object) - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type="master", ttl=None, extra=None): params = { - 'name': domain, + "name": domain, } - info = self.connection.request('domain.zone.create', params) + info = self.connection.request("domain.zone.create", params) return self._to_zone(info.object) def update_zone(self, zone, domain=None, type=None, ttl=None, extra=None): zid = int(zone.id) - params = {'name': domain} - self.connection.set_context({'zone_id': zone.id}) - zone = self.connection.request('domain.zone.update', zid, params) + params = {"name": domain} + self.connection.set_context({"zone_id": zone.id}) + zone = self.connection.request("domain.zone.update", zid, params) return self._to_zone(zone.object) def delete_zone(self, zone): zid = int(zone.id) - self.connection.set_context({'zone_id': zone.id}) - res = self.connection.request('domain.zone.delete', zid) + self.connection.set_context({"zone_id": zone.id}) + res = self.connection.request("domain.zone.delete", zid) return res.object def _to_record(self, record, zone): + extra = {"ttl": int(record["ttl"])} + value = record["value"] + if record["type"] == "MX": + # Record is in the following form: + # + # e.g. 15 aspmx.l.google.com + split = record["value"].split(" ") + extra["priority"] = int(split[0]) + value = split[1] return Record( - id='%s:%s' % (record['type'], record['name']), - name=record['name'], - type=self._string_to_record_type(record['type']), - data=record['value'], + id="{}:{}".format(record["type"], record["name"]), + name=record["name"], + type=self._string_to_record_type(record["type"]), + data=value, zone=zone, driver=self, - extra={'ttl': record['ttl']} + ttl=record["ttl"], + extra=extra, ) def _to_records(self, records, zone): @@ -165,106 +175,85 @@ def _to_records(self, records, zone): def list_records(self, zone): zid = int(zone.id) - self.connection.set_context({'zone_id': zone.id}) - records = self.connection.request('domain.zone.record.list', zid, 0) + self.connection.set_context({"zone_id": zone.id}) + records = self.connection.request("domain.zone.record.list", zid, 0) return self._to_records(records.object, zone) def get_record(self, zone_id, record_id): zid = int(zone_id) - record_type, name = record_id.split(':', 1) - filter_opts = { - 'name': name, - 'type': record_type - } - self.connection.set_context({'zone_id': zone_id}) - records = self.connection.request('domain.zone.record.list', - zid, 0, filter_opts).object + record_type, name = record_id.split(":", 1) + filter_opts = {"name": name, "type": record_type} + self.connection.set_context({"zone_id": zone_id}) + records = self.connection.request("domain.zone.record.list", zid, 0, filter_opts).object if len(records) == 0: - raise RecordDoesNotExistError(value='', driver=self, - record_id=record_id) + raise RecordDoesNotExistError(value="", driver=self, record_id=record_id) return self._to_record(records[0], self.get_zone(zone_id)) def _validate_record(self, record_id, name, record_type, data, extra): if len(data) > 1024: - raise RecordError('Record data must be <= 1024 characters', - driver=self, record_id=record_id) - if extra and 'ttl' in extra: - if extra['ttl'] < TTL_MIN: - raise RecordError('TTL must be at least 30 seconds', - driver=self, record_id=record_id) - if extra['ttl'] > TTL_MAX: - raise RecordError('TTL must not excdeed 30 days', - driver=self, record_id=record_id) + raise RecordError( + "Record data must be <= 1024 characters", + driver=self, + record_id=record_id, + ) + if extra and "ttl" in extra: + if extra["ttl"] < TTL_MIN: + raise RecordError( + "TTL must be at least 30 seconds", driver=self, record_id=record_id + ) + if extra["ttl"] > TTL_MAX: + raise RecordError("TTL must not excdeed 30 days", driver=self, record_id=record_id) def create_record(self, name, zone, type, data, extra=None): self._validate_record(None, name, type, data, extra) zid = int(zone.id) - create = { - 'name': name, - 'type': self.RECORD_TYPE_MAP[type], - 'value': data - } + create = {"name": name, "type": self.RECORD_TYPE_MAP[type], "value": data} - if 'ttl' in extra: - create['ttl'] = extra['ttl'] + if "ttl" in extra: + create["ttl"] = extra["ttl"] with NewZoneVersion(self, zone) as vid: con = self.connection - con.set_context({'zone_id': zone.id}) - rec = con.request('domain.zone.record.add', - zid, vid, create).object + con.set_context({"zone_id": zone.id}) + rec = con.request("domain.zone.record.add", zid, vid, create).object return self._to_record(rec, zone) def update_record(self, record, name, type, data, extra): self._validate_record(record.id, name, type, data, extra) - filter_opts = { - 'name': record.name, - 'type': self.RECORD_TYPE_MAP[record.type] - } + filter_opts = {"name": record.name, "type": self.RECORD_TYPE_MAP[record.type]} - update = { - 'name': name, - 'type': self.RECORD_TYPE_MAP[type], - 'value': data - } + update = {"name": name, "type": self.RECORD_TYPE_MAP[type], "value": data} - if 'ttl' in extra: - update['ttl'] = extra['ttl'] + if "ttl" in extra: + update["ttl"] = extra["ttl"] zid = int(record.zone.id) with NewZoneVersion(self, record.zone) as vid: con = self.connection - con.set_context({'zone_id': record.zone.id}) - con.request('domain.zone.record.delete', - zid, vid, filter_opts) - res = con.request('domain.zone.record.add', - zid, vid, update).object + con.set_context({"zone_id": record.zone.id}) + con.request("domain.zone.record.delete", zid, vid, filter_opts) + res = con.request("domain.zone.record.add", zid, vid, update).object return self._to_record(res, record.zone) def delete_record(self, record): zid = int(record.zone.id) - filter_opts = { - 'name': record.name, - 'type': self.RECORD_TYPE_MAP[record.type] - } + filter_opts = {"name": record.name, "type": self.RECORD_TYPE_MAP[record.type]} with NewZoneVersion(self, record.zone) as vid: con = self.connection - con.set_context({'zone_id': record.zone.id}) - count = con.request('domain.zone.record.delete', - zid, vid, filter_opts).object + con.set_context({"zone_id": record.zone.id}) + count = con.request("domain.zone.record.delete", zid, vid, filter_opts).object if count == 1: return True - raise RecordDoesNotExistError(value='No such record', driver=self, - record_id=record.id) + raise RecordDoesNotExistError(value="No such record", driver=self, record_id=record.id) diff --git a/libcloud/dns/drivers/gandi_live.py b/libcloud/dns/drivers/gandi_live.py new file mode 100644 index 0000000000..09df141a5d --- /dev/null +++ b/libcloud/dns/drivers/gandi_live.py @@ -0,0 +1,491 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import copy + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import ( + Provider, + RecordType, + RecordError, + ZoneDoesNotExistError, + ZoneAlreadyExistsError, + RecordDoesNotExistError, + RecordAlreadyExistsError, +) +from libcloud.common.gandi_live import ( + GandiLiveResponse, + BaseGandiLiveDriver, + GandiLiveConnection, + ResourceConflictError, + ResourceNotFoundError, +) + +__all__ = [ + "GandiLiveDNSDriver", +] + + +TTL_MIN = 300 +TTL_MAX = 2592000 # 30 days +API_BASE = "/api/v5" + + +class GandiLiveDNSResponse(GandiLiveResponse): + pass + + +class GandiLiveDNSConnection(GandiLiveConnection): + responseCls = GandiLiveDNSResponse + + +class GandiLiveDNSDriver(BaseGandiLiveDriver, DNSDriver): + """ + API reference can be found at: + + https://doc.livedns.gandi.net/ + + Please note that the Libcloud paradigm of one zone per domain does not + match exactly with Gandi LiveDNS. For Gandi, a "zone" can apply to + multiple domains. This driver behaves as if the domain is a zone, but be + warned that modifying a domain means modifying the zone. If you have a + zone associated with multiple domains, all of those domains will be + modified as well. + """ + + type = Provider.GANDI + name = "Gandi LiveDNS" + website = "http://www.gandi.net/domain" + + connectionCls = GandiLiveDNSConnection + + # also supports CAA, CDS + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.ALIAS: "ALIAS", + RecordType.CNAME: "CNAME", + RecordType.DNAME: "DNAME", + RecordType.DS: "DS", + RecordType.KEY: "KEY", + RecordType.LOC: "LOC", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.PTR: "PTR", + RecordType.SPF: "SPF", + RecordType.SRV: "SRV", + RecordType.SSHFP: "SSHFP", + RecordType.TLSA: "TLSA", + RecordType.TXT: "TXT", + RecordType.WKS: "WKS", + RecordType.CAA: "CAA", + } + + def list_zones(self): + zones = self.connection.request(action="%s/domains" % API_BASE, method="GET") + return self._to_zones(zones.object) + + def get_zone(self, zone_id): + action = "{}/domains/{}".format(API_BASE, zone_id) + try: + zone = self.connection.request(action=action, method="GET") + except ResourceNotFoundError: + raise ZoneDoesNotExistError(value="", driver=self.connection.driver, zone_id=zone_id) + return self._to_zone(zone.object) + + """ + :param extra: (optional) Extra attribute ('name'); if not provided, name + is based on domain. + + :return: :class:`Zone` with attribute zone_uuid set in extra ``dict`` + """ + + def create_zone(self, domain, type="master", ttl=None, extra=None): + if extra and "name" in extra: + zone_name = extra["name"] + else: + zone_name = "%s zone" % domain + zone_data = { + "name": zone_name, + } + + try: + new_zone = self.connection.request( + action="%s/zones" % API_BASE, method="POST", data=zone_data + ) + except ResourceConflictError: + raise ZoneAlreadyExistsError(value="", driver=self.connection.driver, zone_id=zone_name) + new_zone_uuid = new_zone.headers["location"].split("/")[-1] + + self.ex_switch_domain_gandi_zone(domain, new_zone_uuid) + + return self._to_zone({"fqdn": domain, "zone_uuid": new_zone_uuid}) + + def list_records(self, zone): + action = "{}/domains/{}/records".format(API_BASE, zone.id) + records = self.connection.request(action=action, method="GET") + return self._to_records(records.object, zone) + + """ + :return: :class:`Record` with the extra ``dict`` containing attribute + other_values ``list`` of ``str`` for other values; the first + value is returned through Record.data. + """ + + def get_record(self, zone_id, record_id): + record_type, name = record_id.split(":", 1) + action = "{}/domains/{}/records/{}/{}".format(API_BASE, zone_id, name, record_type) + try: + record = self.connection.request(action=action, method="GET") + except ResourceNotFoundError: + raise RecordDoesNotExistError( + value="", driver=self.connection.driver, record_id=record_id + ) + return self._to_record(record.object, self.get_zone(zone_id))[0] + + def create_record(self, name, zone, type, data, extra=None): + self._validate_record(None, name, type, data, extra) + + action = "{}/domains/{}/records".format(API_BASE, zone.id) + + if type == "MX": + data = "{} {}".format(extra["priority"], data) + + record_data = { + "rrset_name": name, + "rrset_type": self.RECORD_TYPE_MAP[type], + "rrset_values": [data], + } + + if extra is not None and "ttl" in extra: + record_data["rrset_ttl"] = extra["ttl"] + + try: + self.connection.request(action=action, method="POST", data=record_data) + except ResourceConflictError: + raise RecordAlreadyExistsError( + value="", + driver=self.connection.driver, + record_id="{}:{}".format(self.RECORD_TYPE_MAP[type], name), + ) + + return self._to_record_sub(record_data, zone, data) + + """ + Ignores name and type, not allowed in an update call to the service. + + The Gandi service requires all values for a record when doing an update. + Not providing all values during an update means the service will interpret + it as replacing all values with the one data value. The easiest way to + accomplish this is to make sure the value of a get_record is used as the + value of the record parameter. + + This method will change the value when only one exists. When more than + one exists, it will combine the data parameter value with the extra dict + values contained in the list extra['_other_records']. This method should + only be used to make single value updates. + + To change the number of values in the value set or to change several at + once, delete and recreate, potentially using ex_create_multi_value_record. + """ + + def update_record(self, record, name, type, data, extra): + self._validate_record(record.id, record.name, record.type, data, extra) + + action = "{}/domains/{}/records/{}/{}".format( + API_BASE, + record.zone.id, + record.name, + self.RECORD_TYPE_MAP[record.type], + ) + + multiple_value_record = record.extra.get("_multi_value", False) + other_records = record.extra.get("_other_records", []) + + if record.type == RecordType.MX: + data = "{} {}".format(extra["priority"], data) + + if multiple_value_record and len(other_records) > 0: + rvalue = [data] + for other_record in other_records: + if record.type == RecordType.MX: + rvalue.append( + "{} {}".format(other_record["extra"]["priority"], other_record["data"]) + ) + else: + rvalue.append(other_record["data"]) + else: + rvalue = [data] + + record_data = {"rrset_values": rvalue} + + if extra is not None and "ttl" in extra: + record_data["rrset_ttl"] = extra["ttl"] + + try: + self.connection.request(action=action, method="PUT", data=record_data) + except ResourceNotFoundError: + raise RecordDoesNotExistError( + value="", driver=self.connection.driver, record_id=record.id + ) + + record_data["rrset_name"] = record.name + record_data["rrset_type"] = self.RECORD_TYPE_MAP[record.type] + return self._to_record(record_data, record.zone)[0] + + """ + The Gandi service considers all values for a name-type combination to be + one record. Deleting that name-type record means deleting all values for + it. + """ + + def delete_record(self, record): + action = "{}/domains/{}/records/{}/{}".format( + API_BASE, + record.zone.id, + record.name, + self.RECORD_TYPE_MAP[record.type], + ) + try: + self.connection.request(action=action, method="DELETE") + except ResourceNotFoundError: + raise RecordDoesNotExistError( + value="", driver=self.connection.driver, record_id=record.id + ) + # Originally checked for success here, but it should never reach + # this point with anything other than HTTP 200 + return True + + def export_zone_to_bind_format(self, zone): + action = "{}/domains/{}/records".format(API_BASE, zone.id) + headers = {"Accept": "text/plain"} + resp = self.connection.request(action=action, method="GET", headers=headers, raw=True) + return resp.body + + # There is nothing you can update about a domain; you can update zones' + # names and which zone a domain is associated with, but the domain itself + # is basically immutable. Instead, some ex_ methods for dealing with + # Gandi zones. + + """ + Update the name of a Gandi zone. + + Note that a Gandi zone is not the same as a Libcloud zone. A Gandi zone + is a separate object type from a Gandi domain; a Gandi zone can be reused + by multiple Gandi domains, and the actual records are associated with the + zone directly. This is mostly masked in this driver to make it look like + records are associated with domains. If you need to step out of that + masking, use these extension methods. + + :param zone_uuid: Identifier for the Gandi zone. + :type zone_uuid: ``str`` + + :param name: New name for the Gandi zone. + :type name: ``str`` + + :return: ``bool`` + """ + + def ex_update_gandi_zone_name(self, zone_uuid, name): + action = "{}/zones/{}".format(API_BASE, zone_uuid) + data = { + "name": name, + } + self.connection.request(action=action, method="PATCH", data=data) + return True + + # There is no concept of deleting domains in this API, not even to + # disassociate a domain from a zone. You can delete a zone, though. + """ + Delete a Gandi zone. This may raise a ResourceConflictError if you + try to delete a zone that has domains still using it. + + :param zone_uuid: Identifier for the Gandi zone + :type zone_uuid: ``str`` + + :return: ``bool`` + """ + + def ex_delete_gandi_zone(self, zone_uuid): + self.connection.request(action="{}/zones/{}".format(API_BASE, zone_uuid), method="DELETE") + return True + + """ + Change the Gandi zone a domain is associated with. + + :param domain: Domain name to switch zones. + :type domain: ``str`` + + :param zone_uuid: Identifier for the new Gandi zone to switch to. + :type zone_uuid: ``str`` + + :return: ``bool`` + """ + + def ex_switch_domain_gandi_zone(self, domain, zone_uuid): + domain_data = { + "zone_uuid": zone_uuid, + } + self.connection.request( + action="{}/domains/{}".format(API_BASE, domain), + method="PATCH", + data=domain_data, + ) + return True + + """ + Create a new record with multiple values. + + :param data: Record values (depends on the record type) + :type data: ``list`` (of ``str``) + + :return: ``list`` of :class:`Record`s + """ + + def ex_create_multi_value_record(self, name, zone, type, data, extra=None): + self._validate_record(None, name, type, data, extra) + + action = "{}/domains/{}/records".format(API_BASE, zone.id) + + record_data = { + "rrset_name": name, + "rrset_type": self.RECORD_TYPE_MAP[type], + "rrset_values": data, + } + + if extra is not None and "ttl" in extra: + record_data["rrset_ttl"] = extra["ttl"] + + try: + self.connection.request(action=action, method="POST", data=record_data) + except ResourceConflictError: + raise RecordAlreadyExistsError( + value="", + driver=self.connection.driver, + record_id="{}:{}".format(self.RECORD_TYPE_MAP[type], name), + ) + return self._to_record(record_data, zone) + + def _to_record(self, data, zone): + records = [] + rrset_values = data["rrset_values"] + multiple_value_record = len(rrset_values) > 1 + + for index, rrset_value in enumerate(rrset_values): + record = self._to_record_sub(data, zone, rrset_value) + record.extra["_multi_value"] = multiple_value_record + if multiple_value_record: + record.extra["_other_records"] = [] + records.append(record) + + if multiple_value_record: + for index in range(0, len(records)): + record = records[index] + for other_index, other_record in enumerate(records): + if index == other_index: + continue + + extra = copy.deepcopy(other_record.extra) + extra.pop("_multi_value") + extra.pop("_other_records") + + item = { + "name": other_record.name, + "data": other_record.data, + "type": other_record.type, + "extra": extra, + } + record.extra["_other_records"].append(item) + return records + + def _to_record_sub(self, data, zone, value): + extra = {} + ttl = data.get("rrset_ttl", None) + if ttl is not None: + extra["ttl"] = int(ttl) + if data["rrset_type"] == "MX": + priority, value = value.split() + extra["priority"] = priority + return Record( + id="{}:{}".format(data["rrset_type"], data["rrset_name"]), + name=data["rrset_name"], + type=self._string_to_record_type(data["rrset_type"]), + data=value, + zone=zone, + driver=self, + ttl=ttl, + extra=extra, + ) + + def _to_records(self, data, zone): + records = [] + for r in data: + records += self._to_record(r, zone) + return records + + def _to_zone(self, zone): + extra = {} + if "zone_uuid" in zone: + extra = {"zone_uuid": zone["zone_uuid"]} + return Zone( + id=str(zone["fqdn"]), + domain=zone["fqdn"], + type="master", + ttl=0, + driver=self, + extra=extra, + ) + + def _to_zones(self, zones): + ret = [] + for z in zones: + ret.append(self._to_zone(z)) + return ret + + def _validate_record(self, record_id, name, record_type, data, extra): + if len(data) > 1024: + raise RecordError( + "Record data must be <= 1024 characters", + driver=self, + record_id=record_id, + ) + if type == "MX" or type == RecordType.MX: + if extra is None or "priority" not in extra: + raise RecordError( + "MX record must have a priority", driver=self, record_id=record_id + ) + if extra is not None and "_other_records" in extra: + for other_value in extra.get("_other_records", []): + if len(other_value["data"]) > 1024: + raise RecordError( + "Record data must be <= 1024 characters", + driver=self, + record_id=record_id, + ) + if type == "MX" or type == RecordType.MX: + if other_value["extra"] is None or "priority" not in other_value["extra"]: + raise RecordError( + "MX record must have a priority", + driver=self, + record_id=record_id, + ) + if extra is not None and "ttl" in extra: + if extra["ttl"] < TTL_MIN: + raise RecordError( + "TTL must be at least 300 seconds", driver=self, record_id=record_id + ) + if extra["ttl"] > TTL_MAX: + raise RecordError("TTL must not exceed 30 days", driver=self, record_id=record_id) diff --git a/libcloud/dns/drivers/godaddy.py b/libcloud/dns/drivers/godaddy.py new file mode 100644 index 0000000000..f4ac280bf5 --- /dev/null +++ b/libcloud/dns/drivers/godaddy.py @@ -0,0 +1,524 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License.You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__all__ = ["GoDaddyDNSDriver"] + +try: + import simplejson as json +except Exception: + import json + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import Provider, RecordType, RecordDoesNotExistError +from libcloud.utils.py3 import httplib +from libcloud.common.base import JsonResponse, ConnectionKey +from libcloud.common.types import LibcloudError + +API_HOST = "api.godaddy.com" +VALID_RECORD_EXTRA_PARAMS = ["prio", "ttl"] + + +class GoDaddyDNSException(LibcloudError): + def __init__(self, code, message): + self.code = code + self.message = message + self.args = (code, message) + + def __str__(self): + return self.__repr__() + + def __repr__(self): + return "".format(self.code, self.message) + + +class GoDaddyDNSResponse(JsonResponse): + valid_response_codes = [ + httplib.OK, + httplib.ACCEPTED, + httplib.CREATED, + httplib.NO_CONTENT, + ] + + def parse_body(self): + if not self.body: + return None + # json.loads doesn't like the regex expressions used in godaddy schema + self.body = self.body.replace("\\.", "\\\\.") + + data = json.loads(self.body) + return data + + def parse_error(self): + data = self.parse_body() + raise GoDaddyDNSException(code=data["code"], message=data["message"]) + + def success(self): + return self.status in self.valid_response_codes + + +class GoDaddyDNSConnection(ConnectionKey): + responseCls = GoDaddyDNSResponse + host = API_HOST + + allow_insecure = False + + def __init__( + self, + key, + secret, + secure=True, + shopper_id=None, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + backoff=None, + retry_delay=None, + ): + super().__init__( + key, + secure=secure, + host=host, + port=port, + url=url, + timeout=timeout, + proxy_url=proxy_url, + backoff=backoff, + retry_delay=retry_delay, + ) + self.key = key + self.secret = secret + self.shopper_id = shopper_id + + def add_default_headers(self, headers): + if self.shopper_id is not None: + headers["X-Shopper-Id"] = self.shopper_id + headers["Content-type"] = "application/json" + headers["Authorization"] = "sso-key {}:{}".format(self.key, self.secret) + return headers + + +class GoDaddyDNSDriver(DNSDriver): + """ + A driver for GoDaddy DNS. + + This is for customers of GoDaddy + who wish to purchase, update existing domains + and manage records for DNS zones owned by GoDaddy NS servers. + """ + + type = Provider.GODADDY + name = "GoDaddy DNS" + website = "https://www.godaddy.com/" + connectionCls = GoDaddyDNSConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.NS: "SPF", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + } + + def __init__(self, shopper_id, key, secret, secure=True, host=None, port=None): + """ + Instantiate a new `GoDaddyDNSDriver` + + :param shopper_id: Your customer ID or shopper ID with GoDaddy + :type shopper_id: ``str`` + + :param key: Your access key from developer.godaddy.com + :type key: ``str`` + + :param secret: Your access key secret + :type secret: ``str`` + """ + self.shopper_id = shopper_id + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + shopper_id=str(shopper_id), + ) + + def list_zones(self): + """ + Return a list of zones (purchased domains) + + :return: ``list`` of :class:`Zone` + """ + result = self.connection.request("/v1/domains/").object + zones = self._to_zones(result) + return zones + + def list_records(self, zone): + """ + Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + result = self.connection.request("/v1/domains/%s/records" % (zone.domain)).object + records = self._to_records(items=result, zone=zone) + return records + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a new record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone where the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: Extra attributes (driver specific). (optional) + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + new_record = self._format_record(name, type, data, extra) + self.connection.request( + "/v1/domains/%s/records" % (zone.domain), + method="PATCH", + data=json.dumps([new_record]), + ) + id = self._get_id_of_record(name, type) + return Record( + id=id, + name=name, + type=type, + data=data, + zone=zone, + driver=self, + ttl=new_record["ttl"], + extra=extra, + ) + + def update_record(self, record, name, type, data, extra=None): + """ + Update an existing record. + + :param record: Record to update. + :type record: :class:`Record` + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + new_record = self._format_record(name, type, data, extra) + self.connection.request( + "/v1/domains/{}/records/{}/{}".format(record.zone.domain, record.type, record.name), + method="PUT", + data=json.dumps([new_record]), + ) + id = self._get_id_of_record(name, type) + return Record( + id=id, + name=name, + type=type, + data=data, + zone=record.zone, + driver=self, + ttl=new_record["ttl"], + extra=extra, + ) + + def get_record(self, zone_id, record_id): + """ + Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + parts = record_id.split(":") + result = self.connection.request( + "/v1/domains/{}/records/{}/{}".format(zone_id, parts[1], parts[0]) + ).object + if len(result) == 0: + raise RecordDoesNotExistError(record_id, driver=self, record_id=record_id) + return self._to_record(result[0], self.get_zone(zone_id)) + + def get_zone(self, zone_id): + """ + Get a zone (by domain) + + :param zone_id: The domain, not the ID + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + result = self.connection.request("/v1/domains/%s/" % zone_id).object + zone = self._to_zone(result) + return zone + + def delete_zone(self, zone): + """ + Delete a zone. + + Note: This will CANCEL a purchased domain + + :param zone: Zone to delete. + :type zone: :class:`Zone` + + :rtype: ``bool`` + """ + self.connection.request("/v1/domains/%s" % (zone.domain), method="DELETE") + # no error means ok + return True + + def ex_check_availability(self, domain, for_transfer=False): + """ + Check the availability of the domain + + :param domain: the domain name e.g. wazzlewobbleflooble.com + :type domain: ``str`` + + :param for_transfer: Check if domain is available for transfer + :type for_transfer: ``bool`` + + :rtype: `list` of :class:`GoDaddyAvailability` + """ + result = self.connection.request( + "/v1/domains/available", + method="GET", + params={"domain": domain, "forTransfer": str(for_transfer)}, + ).object + return GoDaddyAvailability( + domain=result["domain"], + available=result["available"], + price=result["price"], + currency=result["currency"], + period=result["period"], + ) + + def ex_list_tlds(self): + """ + List available TLDs for sale + + :rtype: ``list`` of :class:`GoDaddyTLD` + """ + result = self.connection.request("/v1/domains/tlds", method="GET").object + return self._to_tlds(result) + + def ex_get_purchase_schema(self, tld): + """ + Get the schema that needs completing to purchase a new domain + Use this in conjunction with ex_purchase_domain + + :param tld: The top level domain e.g com, eu, uk + :type tld: ``str`` + + :rtype: `dict` the JSON Schema + """ + result = self.connection.request( + "/v1/domains/purchase/schema/%s" % tld, method="GET" + ).object + return result + + def ex_get_agreements(self, tld, privacy=True): + """ + Get the legal agreements for a tld + Use this in conjunction with ex_purchase_domain + + :param tld: The top level domain e.g com, eu, uk + :type tld: ``str`` + + :rtype: `dict` the JSON Schema + """ + result = self.connection.request( + "/v1/domains/agreements", + params={"tlds": tld, "privacy": str(privacy)}, + method="GET", + ).object + agreements = [] + for item in result: + agreements.append( + GoDaddyLegalAgreement( + agreement_key=item["agreementKey"], + title=item["title"], + url=item["url"], + content=item["content"], + ) + ) + return agreements + + def ex_purchase_domain(self, purchase_request): + """ + Purchase a domain with GoDaddy + + :param purchase_request: The completed document + from ex_get_purchase_schema + :type purchase_request: ``dict`` + + :rtype: :class:`GoDaddyDomainPurchaseResponse` Your order + """ + result = self.connection.request( + "/v1/domains/purchase", data=purchase_request, method="POST" + ).object + return GoDaddyDomainPurchaseResponse( + order_id=result["orderId"], + item_count=result["itemCount"], + total=result["total"], + currency=result["currency"], + ) + + def _format_record(self, name, type, data, extra): + if extra is None: + extra = {} + new_record = {} + if type == RecordType.SRV: + new_record = { + "type": type, + "name": name, + "data": data, + "priority": 1, + "ttl": extra.get("ttl", 5), + "service": extra.get("service", ""), + "protocol": extra.get("protocol", ""), + "port": extra.get("port", ""), + "weight": extra.get("weight", "1"), + } + else: + new_record = { + "type": type, + "name": name, + "data": data, + "ttl": extra.get("ttl", 5), + } + if type == RecordType.MX: + new_record["priority"] = 1 + return new_record + + def _to_zones(self, items): + zones = [] + for item in items: + zones.append(self._to_zone(item)) + return zones + + def _to_zone(self, item): + extra = {"expires": item.get("expires", None)} + zone = Zone( + id=item["domainId"], + domain=item["domain"], + type="master", + ttl=None, + driver=self, + extra=extra, + ) + return zone + + def _to_records(self, items, zone=None): + records = [] + + for item in items: + records.append(self._to_record(item=item, zone=zone)) + return records + + def _to_record(self, item, zone=None): + ttl = item["ttl"] + type = self._string_to_record_type(item["type"]) + name = item["name"] + id = self._get_id_of_record(name, type) + record = Record( + id=id, + name=name, + type=type, + data=item["data"], + zone=zone, + driver=self, + ttl=ttl, + ) + return record + + def _to_tlds(self, items): + tlds = [] + for item in items: + tlds.append(self._to_tld(item)) + return tlds + + def _to_tld(self, item): + return GoDaddyTLD(name=item["name"], tld_type=item["type"]) + + def _get_id_of_record(self, name, type): + return "{}:{}".format(name, type) + + def _ex_connection_class_kwargs(self): + return {"shopper_id": self.shopper_id} + + +class GoDaddyAvailability: + def __init__(self, domain, available, price, currency, period): + self.domain = domain + self.available = bool(available) + # currency comes in micro-units, convert to dollars. + self.price = float(price) / 1000000 + self.currency = currency + self.period = int(period) + + +class GoDaddyTLD: + def __init__(self, name, tld_type): + self.name = name + self.type = tld_type + + +class GoDaddyDomainPurchaseResponse: + def __init__(self, order_id, item_count, total, currency): + self.order_id = order_id + self.item_count = item_count + self.total = total + self.current = currency + + +class GoDaddyLegalAgreement: + def __init__(self, agreement_key, title, url, content): + self.agreement_key = agreement_key + self.title = title + self.url = url + self.content = content diff --git a/libcloud/dns/drivers/google.py b/libcloud/dns/drivers/google.py index 93fee58c08..c0ee2e8b27 100644 --- a/libcloud/dns/drivers/google.py +++ b/libcloud/dns/drivers/google.py @@ -13,19 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -__all__ = [ - 'GoogleDNSDriver' -] +__all__ = ["GoogleDNSDriver"] -# API docs: https://cloud.google.com/dns/api/v1beta1 -API_VERSION = 'v1beta1' +# API docs: https://cloud.google.com/dns/api/v1 +API_VERSION = "v1" import re -from libcloud.common.google import GoogleResponse, GoogleBaseConnection -from libcloud.common.google import ResourceNotFoundError -from libcloud.dns.types import Provider, RecordType -from libcloud.dns.types import ZoneDoesNotExistError, RecordDoesNotExistError -from libcloud.dns.base import DNSDriver, Zone, Record + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import Provider, RecordType, ZoneDoesNotExistError, RecordDoesNotExistError +from libcloud.common.google import GoogleResponse, GoogleBaseConnection, ResourceNotFoundError class GoogleDNSResponse(GoogleResponse): @@ -36,42 +33,55 @@ class GoogleDNSConnection(GoogleBaseConnection): host = "www.googleapis.com" responseCls = GoogleDNSResponse - def __init__(self, user_id, key, secure, auth_type=None, - credential_file=None, project=None, **kwargs): - super(GoogleDNSConnection, self).\ - __init__(user_id, key, secure=secure, auth_type=auth_type, - credential_file=credential_file, **kwargs) - self.request_path = '/dns/%s/projects/%s' % (API_VERSION, project) + def __init__( + self, + user_id, + key, + secure, + auth_type=None, + credential_file=None, + project=None, + **kwargs, + ): + super().__init__( + user_id, + key, + secure=secure, + auth_type=auth_type, + credential_file=credential_file, + **kwargs, + ) + self.request_path = "/dns/{}/projects/{}".format(API_VERSION, project) class GoogleDNSDriver(DNSDriver): type = Provider.GOOGLE - name = 'Google DNS' + name = "Google DNS" connectionCls = GoogleDNSConnection - website = 'https://cloud.google.com/' + website = "https://cloud.google.com/" RECORD_TYPE_MAP = { - RecordType.A: 'A', - RecordType.AAAA: 'AAAA', - RecordType.CNAME: 'CNAME', - RecordType.MX: 'MX', - RecordType.NS: 'NS', - RecordType.PTR: 'PTR', - RecordType.SOA: 'SOA', - RecordType.SPF: 'SPF', - RecordType.SRV: 'SRV', - RecordType.TXT: 'TXT', + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.PTR: "PTR", + RecordType.SOA: "SOA", + RecordType.SPF: "SPF", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + RecordType.CAA: "CAA", } - def __init__(self, user_id, key, project=None, auth_type=None, scopes=None, - **kwargs): + def __init__(self, user_id, key, project=None, auth_type=None, scopes=None, **kwargs): self.auth_type = auth_type self.project = project self.scopes = scopes + if not self.project: - raise ValueError('Project name must be specified using ' - '"project" keyword.') - super(GoogleDNSDriver, self).__init__(user_id, key, **kwargs) + raise ValueError("Project name must be specified using " '"project" keyword.') + super().__init__(user_id, key, **kwargs) def iterate_zones(self): """ @@ -79,7 +89,8 @@ def iterate_zones(self): :rtype: ``generator`` of :class:`Zone` """ - return self._get_more('zones') + + return self._get_more("zones") def iterate_records(self, zone): """ @@ -90,7 +101,8 @@ def iterate_records(self, zone): :rtype: ``generator`` of :class:`Record` """ - return self._get_more('records', zone=zone) + + return self._get_more("records", zone=zone) def get_zone(self, zone_id): """ @@ -101,14 +113,12 @@ def get_zone(self, zone_id): :rtype: :class:`Zone` """ - request = '/managedZones/%s' % (zone_id) + request = "/managedZones/%s" % (zone_id) try: - response = self.connection.request(request, method='GET').object + response = self.connection.request(request, method="GET").object except ResourceNotFoundError: - raise ZoneDoesNotExistError(value='', - driver=self.connection.driver, - zone_id=zone_id) + raise ZoneDoesNotExistError(value="", driver=self.connection.driver, zone_id=zone_id) return self._to_zone(response) @@ -124,31 +134,28 @@ def get_record(self, zone_id, record_id): :rtype: :class:`Record` """ - (record_type, record_name) = record_id.split(':', 1) + record_type, record_name = record_id.split(":", 1) params = { - 'name': record_name, - 'type': record_type, + "name": record_name, + "type": record_type, } - request = '/managedZones/%s/rrsets' % (zone_id) + request = "/managedZones/%s/rrsets" % (zone_id) try: - response = self.connection.request(request, method='GET', - params=params).object + response = self.connection.request(request, method="GET", params=params).object except ResourceNotFoundError: - raise ZoneDoesNotExistError(value='', - driver=self.connection.driver, - zone_id=zone_id) + raise ZoneDoesNotExistError(value="", driver=self.connection.driver, zone_id=zone_id) - if len(response['rrsets']) > 0: + if len(response["rrsets"]) > 0: zone = self.get_zone(zone_id) - return self._to_record(response['rrsets'][0], zone) - raise RecordDoesNotExistError(value='', driver=self.connection.driver, - record_id=record_id) + return self._to_record(response["rrsets"][0], zone) + + raise RecordDoesNotExistError(value="", driver=self.connection.driver, record_id=record_id) - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type="master", ttl=None, extra=None): """ Create a new zone. @@ -168,24 +175,24 @@ def create_zone(self, domain, type='master', ttl=None, extra=None): :rtype: :class:`Zone` """ name = None - description = '' + description = "" if extra: - description = extra.get('description') - name = extra.get('name') + description = extra.get("description") + name = extra.get("name") if name is None: name = self._cleanup_domain(domain) data = { - 'dnsName': domain, - 'name': name, - 'description': description, + "dnsName": domain, + "name": name, + "description": description, } - request = '/managedZones' - response = self.connection.request(request, method='POST', - data=data).object + request = "/managedZones" + response = self.connection.request(request, method="POST", data=data).object + return self._to_zone(response) def create_record(self, name, zone, type, data, extra=None): @@ -209,23 +216,14 @@ def create_record(self, name, zone, type, data, extra=None): :rtype: :class:`Record` """ - ttl = data.get('ttl', 0) - rrdatas = data.get('rrdatas', []) + ttl = data.get("ttl", 0) + rrdatas = data.get("rrdatas", []) - data = { - 'additions': [ - { - 'name': name, - 'type': type, - 'ttl': int(ttl), - 'rrdatas': rrdatas, - } - ] - } - request = '/managedZones/%s/changes' % (zone.id) - response = self.connection.request(request, method='POST', - data=data).object - return self._to_record(response['additions'][0], zone) + data = {"additions": [{"name": name, "type": type, "ttl": int(ttl), "rrdatas": rrdatas}]} + request = "/managedZones/%s/changes" % (zone.id) + response = self.connection.request(request, method="POST", data=data).object + + return self._to_record(response["additions"][0], zone) def delete_zone(self, zone): """ @@ -238,8 +236,9 @@ def delete_zone(self, zone): :rtype: ``bool`` """ - request = '/managedZones/%s' % (zone.id) - response = self.connection.request(request, method='DELETE') + request = "/managedZones/%s" % (zone.id) + response = self.connection.request(request, method="DELETE") + return response.success() def delete_record(self, record): @@ -252,95 +251,161 @@ def delete_record(self, record): :rtype: ``bool`` """ data = { - 'deletions': [ + "deletions": [ { - 'name': record.name, - 'type': record.type, - 'rrdatas': record.data['rrdatas'], - 'ttl': record.data['ttl'] + "name": record.name, + "type": record.type, + "rrdatas": record.data["rrdatas"], + "ttl": record.data["ttl"], } ] } - request = '/managedZones/%s/changes' % (record.zone.id) - response = self.connection.request(request, method='POST', - data=data) + request = "/managedZones/%s/changes" % (record.zone.id) + response = self.connection.request(request, method="POST", data=data) + return response.success() + def ex_bulk_record_changes(self, zone, records): + """ + Bulk add and delete records. + + :param zone: Zone where the requested record changes are done. + :type zone: :class:`Zone` + + :param records: Dictionary of additions list or deletions list, or both + of resourceRecordSets. For example: + + .. code-block:: python + + {'additions': [{'rrdatas': ['127.0.0.1'], + 'kind': 'dns#resourceRecordSet', + 'type': 'A', + 'name': 'www.example.com.', + 'ttl': '300'}], + 'deletions': [{'rrdatas': ['127.0.0.1'], + 'kind': 'dns#resourceRecordSet', + 'type': 'A', + 'name': 'www2.example.com.', + 'ttl': '300'}]} + :type records: ``dict`` + + :return: A dictionary of Record additions and deletions. + :rtype: ``dict`` of additions and deletions of :class:`Record` + """ + + request = "/managedZones/%s/changes" % (zone.id) + response = self.connection.request(request, method="POST", data=records).object + response = response or {} + + response_data = { + "additions": self._to_records(response.get("additions", []), zone), + "deletions": self._to_records(response.get("deletions", []), zone), + } + + return response_data + def _get_more(self, rtype, **kwargs): last_key = None exhausted = False + while not exhausted: - items, last_key, exhausted = self._get_data(rtype, last_key, - **kwargs) - for item in items: - yield item + items, last_key, exhausted = self._get_data(rtype, last_key, **kwargs) + yield from items def _get_data(self, rtype, last_key, **kwargs): params = {} if last_key: - params['pageToken'] = last_key + params["pageToken"] = last_key - if rtype == 'zones': - request = '/managedZones' + if rtype == "zones": + request = "/managedZones" transform_func = self._to_zones - r_key = 'managedZones' - elif rtype == 'records': - zone = kwargs['zone'] - request = '/managedZones/%s/rrsets' % (zone.id) + r_key = "managedZones" + elif rtype == "records": + zone = kwargs["zone"] + request = "/managedZones/%s/rrsets" % (zone.id) transform_func = self._to_records - r_key = 'rrsets' + r_key = "rrsets" + else: + raise ValueError(f"Unsupported rtype: {rtype}") - response = self.connection.request(request, method='GET', - params=params,) + response = self.connection.request( + request, + method="GET", + params=params, + ) if response.success(): - nextpage = response.object.get('nextPageToken', None) + nextpage = response.object.get("nextPageToken", None) items = transform_func(response.object.get(r_key), **kwargs) exhausted = False if nextpage is not None else True + return items, nextpage, exhausted else: return [], None, True def _ex_connection_class_kwargs(self): - return {'auth_type': self.auth_type, - 'project': self.project, - 'scopes': self.scopes} + return { + "auth_type": self.auth_type, + "project": self.project, + "scopes": self.scopes, + } def _to_zones(self, response): zones = [] + for r in response: zones.append(self._to_zone(r)) + return zones def _to_zone(self, r): extra = {} - if 'description' in r: - extra['description'] = r.get('description') + if "description" in r: + extra["description"] = r.get("description") - extra['creationTime'] = r.get('creationTime') - extra['nameServers'] = r.get('nameServers') - extra['id'] = r.get('id') + extra["creationTime"] = r.get("creationTime") + extra["nameServers"] = r.get("nameServers") + extra["id"] = r.get("id") - return Zone(id=r['name'], domain=r['dnsName'], - type='master', ttl=0, driver=self, extra=extra) + return Zone( + id=r["name"], + domain=r["dnsName"], + type="master", + ttl=0, + driver=self, + extra=extra, + ) def _to_records(self, response, zone): records = [] + for r in response: records.append(self._to_record(r, zone)) + return records def _to_record(self, r, zone): - record_id = '%s:%s' % (r['type'], r['name']) - return Record(id=record_id, name=r['name'], - type=r['type'], data=r, zone=zone, - driver=self, extra={}) + record_id = "{}:{}".format(r["type"], r["name"]) + + return Record( + id=record_id, + name=r["name"], + type=r["type"], + data=r, + zone=zone, + driver=self, + ttl=r.get("ttl", None), + extra={}, + ) def _cleanup_domain(self, domain): # name can only contain lower case alphanumeric characters and hyphens - domain = re.sub(r'[^a-zA-Z0-9-]', '-', domain) - if domain[-1] == '-': + domain = re.sub(r"[^a-zA-Z0-9-]", "-", domain) + + if domain[-1] == "-": domain = domain[:-1] + return domain diff --git a/libcloud/dns/drivers/hostvirtual.py b/libcloud/dns/drivers/hostvirtual.py deleted file mode 100644 index 4d98df52db..0000000000 --- a/libcloud/dns/drivers/hostvirtual.py +++ /dev/null @@ -1,254 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License.You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -__all__ = [ - 'HostVirtualDNSDriver' -] - -import sys - -try: - import simplejson as json -except: - import json - -from libcloud.utils.py3 import httplib -from libcloud.utils.misc import merge_valid_keys, get_new_obj -from libcloud.common.hostvirtual import HostVirtualResponse -from libcloud.common.hostvirtual import HostVirtualConnection -from libcloud.compute.drivers.hostvirtual import API_ROOT -from libcloud.dns.types import Provider, RecordType -from libcloud.dns.types import ZoneDoesNotExistError, RecordDoesNotExistError -from libcloud.dns.base import DNSDriver, Zone, Record - -VALID_RECORD_EXTRA_PARAMS = ['prio', 'ttl'] - - -class HostVirtualDNSResponse(HostVirtualResponse): - def parse_error(self): - context = self.connection.context - status = int(self.status) - - if status == httplib.NOT_FOUND: - if context['resource'] == 'zone': - raise ZoneDoesNotExistError( - value=self.parse_body()['error']['message'], - driver=self, zone_id=context['id']) - elif context['resource'] == 'record': - raise RecordDoesNotExistError( - value=self.parse_body()['error']['message'], - driver=self, record_id=context['id']) - - super(HostVirtualDNSResponse, self).parse_error() - return self.body - - -class HostVirtualDNSConnection(HostVirtualConnection): - responseCls = HostVirtualDNSResponse - - -class HostVirtualDNSDriver(DNSDriver): - type = Provider.HOSTVIRTUAL - name = 'Host Virtual DNS' - website = 'https://www.hostvirtual.com/' - connectionCls = HostVirtualDNSConnection - - RECORD_TYPE_MAP = { - RecordType.A: 'A', - RecordType.AAAA: 'AAAA', - RecordType.CNAME: 'CNAME', - RecordType.MX: 'MX', - RecordType.NS: 'SPF', - RecordType.SRV: 'SRV', - RecordType.TXT: 'TXT', - } - - def __init__(self, key, secure=True, host=None, port=None): - super(HostVirtualDNSDriver, self).__init__(key=key, secure=secure, - host=host, port=port) - - def _to_zones(self, items): - zones = [] - for item in items: - zones.append(self._to_zone(item)) - return zones - - def _to_zone(self, item): - extra = {} - if 'records' in item: - extra['records'] = item['records'] - if item['type'] == 'NATIVE': - item['type'] = 'master' - zone = Zone(id=item['id'], domain=item['name'], - type=item['type'], ttl=item['ttl'], - driver=self, extra=extra) - return zone - - def _to_records(self, items, zone=None): - records = [] - - for item in items: - records.append(self._to_record(item=item, zone=zone)) - return records - - def _to_record(self, item, zone=None): - extra = {'ttl': item['ttl']} - type = self._string_to_record_type(item['type']) - name = item['name'][:-len(zone.domain) - 1] - record = Record(id=item['id'], name=name, - type=type, data=item['content'], - zone=zone, driver=self, extra=extra) - return record - - def list_zones(self): - result = self.connection.request( - API_ROOT + '/dns/zones/').object - zones = self._to_zones(result) - return zones - - def list_records(self, zone): - params = {'id': zone.id} - self.connection.set_context({'resource': 'zone', 'id': zone.id}) - try: - result = self.connection.request( - API_ROOT + '/dns/records/', params=params).object - except ZoneDoesNotExistError: - e = sys.exc_info()[1] - if 'Not Found: No Records Found' in e.value: - return [] - raise e - records = self._to_records(items=result, zone=zone) - return records - - def get_zone(self, zone_id): - params = {'id': zone_id} - self.connection.set_context({'resource': 'zone', 'id': zone_id}) - result = self.connection.request( - API_ROOT + '/dns/zone/', params=params).object - if 'id' not in result: - raise ZoneDoesNotExistError(value='', driver=self, zone_id=zone_id) - zone = self._to_zone(result) - return zone - - def get_record(self, zone_id, record_id): - zone = self.get_zone(zone_id=zone_id) - params = {'id': record_id} - self.connection.set_context({'resource': 'record', 'id': record_id}) - result = self.connection.request( - API_ROOT + '/dns/record/', params=params).object - if 'id' not in result: - raise RecordDoesNotExistError(value='', - driver=self, record_id=record_id) - record = self._to_record(item=result, zone=zone) - return record - - def delete_zone(self, zone): - params = {'id': zone.id} - self.connection.set_context({'resource': 'zone', 'id': zone.id}) - result = self.connection.request( - API_ROOT + '/dns/zone/', params=params, method='DELETE').object - return bool(result) - - def delete_record(self, record): - params = {'id': record.id} - self.connection.set_context({'resource': 'record', 'id': record.id}) - result = self.connection.request( - API_ROOT + '/dns/record/', params=params, method='DELETE').object - - return bool(result) - - def create_zone(self, domain, type='NATIVE', ttl=None, extra=None): - if type == 'master': - type = 'NATIVE' - elif type == 'slave': - type = 'SLAVE' - params = {'name': domain, 'type': type, 'ttl': ttl} - result = self.connection.request( - API_ROOT + '/dns/zone/', - data=json.dumps(params), method='POST').object - extra = { - 'soa': result['soa'], - 'ns': result['ns'] - } - zone = Zone(id=result['id'], domain=domain, - type=type, ttl=ttl, extra=extra, driver=self) - return zone - - def update_zone(self, zone, domain=None, type=None, ttl=None, extra=None): - params = {'id': zone.id} - if domain: - params['name'] = domain - if type: - params['type'] = type - self.connection.set_context({'resource': 'zone', 'id': zone.id}) - self.connection.request(API_ROOT + '/dns/zone/', - data=json.dumps(params), method='PUT').object - updated_zone = get_new_obj( - obj=zone, klass=Zone, - attributes={ - 'domain': domain, - 'type': type, - 'ttl': ttl, - 'extra': extra - }) - return updated_zone - - def create_record(self, name, zone, type, data, extra=None): - params = { - 'name': name, - 'type': self.RECORD_TYPE_MAP[type], - 'domain_id': zone.id, - 'content': data - } - merged = merge_valid_keys( - params=params, - valid_keys=VALID_RECORD_EXTRA_PARAMS, - extra=extra - ) - self.connection.set_context({'resource': 'zone', 'id': zone.id}) - result = self.connection.request( - API_ROOT + '/dns/record/', - data=json.dumps(params), method='POST').object - record = Record(id=result['id'], name=name, - type=type, data=data, - extra=merged, zone=zone, driver=self) - return record - - def update_record(self, record, name=None, type=None, - data=None, extra=None): - params = { - 'domain_id': record.zone.id, - 'record_id': record.id - } - if name: - params['name'] = name - if data: - params['content'] = data - if type is not None: - params['type'] = self.RECORD_TYPE_MAP[type] - merged = merge_valid_keys( - params=params, - valid_keys=VALID_RECORD_EXTRA_PARAMS, - extra=extra - ) - self.connection.set_context({'resource': 'record', 'id': record.id}) - self.connection.request(API_ROOT + '/dns/record/', - data=json.dumps(params), method='PUT').object - updated_record = get_new_obj( - obj=record, klass=Record, attributes={ - 'name': name, 'data': data, - 'type': type, - 'extra': merged - }) - return updated_record diff --git a/libcloud/dns/drivers/linode.py b/libcloud/dns/drivers/linode.py index f0fdbdc756..46429fac90 100644 --- a/libcloud/dns/drivers/linode.py +++ b/libcloud/dns/drivers/linode.py @@ -13,260 +13,439 @@ # See the License for the specific language governing permissions and # limitations under the License. -__all__ = [ - 'LinodeDNSDriver' -] +__all__ = ["LinodeDNSDriver"] -from libcloud.utils.misc import merge_valid_keys, get_new_obj -from libcloud.common.linode import (API_ROOT, LinodeException, - LinodeConnection, LinodeResponse) -from libcloud.dns.types import Provider, RecordType -from libcloud.dns.types import ZoneDoesNotExistError, RecordDoesNotExistError -from libcloud.dns.base import DNSDriver, Zone, Record +from datetime import datetime +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import Provider, RecordType +from libcloud.utils.py3 import httplib +from libcloud.utils.misc import merge_valid_keys +from libcloud.common.linode import ( + DEFAULT_API_VERSION, + LinodeResponseV4, + LinodeExceptionV4, + LinodeConnectionV4, +) + +try: + import simplejson as json +except ImportError: + import json + + +VALID_ZONE_EXTRA_PARAMS_V4 = [ + "axfr_ips", + "description", + "expire_sec", + "master_ips", + "refresh_sec", + "retry_sec", + "soa_email", + "status", + "tags", +] -VALID_ZONE_EXTRA_PARAMS = ['SOA_Email', 'Refresh_sec', 'Retry_sec', - 'Expire_sec', 'status', 'master_ips'] +VALID_RECORD_EXTRA_PARAMS_V4 = [ + "port", + "priority", + "protocol", + "service", + "tag", + "ttl_sec", + "target", + "weight", +] -VALID_RECORD_EXTRA_PARAMS = ['Priority', 'Weight', 'Port', 'Protocol', - 'TTL_sec'] +class LinodeDNSDriver(DNSDriver): + type = Provider.LINODE + name = "Linode DNS" + website = "http://www.linode.com/" -class LinodeDNSResponse(LinodeResponse): - def _make_excp(self, error): - result = super(LinodeDNSResponse, self)._make_excp(error) - if isinstance(result, LinodeException) and result.code == 5: - context = self.connection.context + def __new__( + cls, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=DEFAULT_API_VERSION, + **kwargs, + ): + if cls is LinodeDNSDriver: + if api_version == "4.0": + cls = LinodeDNSDriverV4 + else: + raise NotImplementedError( + "No Linode driver found for API version: %s" % (api_version) + ) + return super().__new__(cls) - if context['resource'] == 'zone': - result = ZoneDoesNotExistError(value='', - driver=self.connection.driver, - zone_id=context['id']) - elif context['resource'] == 'record': - result = RecordDoesNotExistError(value='', - driver=self.connection.driver, - record_id=context['id']) - return result +class LinodeDNSResponseV4(LinodeResponseV4): + pass -class LinodeDNSConnection(LinodeConnection): - responseCls = LinodeDNSResponse +class LinodeDNSConnectionV4(LinodeConnectionV4): + responseCls = LinodeDNSResponseV4 -class LinodeDNSDriver(DNSDriver): - type = Provider.LINODE - name = 'Linode DNS' - website = 'http://www.linode.com/' - connectionCls = LinodeDNSConnection +class LinodeDNSDriverV4(LinodeDNSDriver): + connectionCls = LinodeDNSConnectionV4 RECORD_TYPE_MAP = { - RecordType.NS: 'NS', - RecordType.MX: 'MX', - RecordType.A: 'A', - RecordType.AAAA: 'AAAA', - RecordType.CNAME: 'CNAME', - RecordType.TXT: 'TXT', - RecordType.SRV: 'SRV', + RecordType.SOA: "SOA", + RecordType.NS: "NS", + RecordType.MX: "MX", + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.PTR: "PTR", + RecordType.TXT: "TXT", + RecordType.SRV: "SRV", + RecordType.CAA: "CAA", } def list_zones(self): - params = {'api_action': 'domain.list'} - data = self.connection.request(API_ROOT, params=params).objects[0] - zones = self._to_zones(data) - return zones + """ + Return a list of zones. + + :return: ``list`` of :class:`Zone` + """ + data = self._paginated_request("/v4/domains", "data") + return [self._to_zone(zone) for zone in data] def list_records(self, zone): - params = {'api_action': 'domain.resource.list', 'DOMAINID': zone.id} + """ + Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + if not isinstance(zone, Zone): + raise LinodeExceptionV4("Invalid zone instance") + + data = self._paginated_request("/v4/domains/%s/records" % zone.id, "data") - self.connection.set_context(context={'resource': 'zone', - 'id': zone.id}) - data = self.connection.request(API_ROOT, params=params).objects[0] - records = self._to_records(items=data, zone=zone) - return records + return [self._to_record(record, zone=zone) for record in data] def get_zone(self, zone_id): - params = {'api_action': 'domain.list', 'DomainID': zone_id} - self.connection.set_context(context={'resource': 'zone', - 'id': zone_id}) - data = self.connection.request(API_ROOT, params=params).objects[0] - zones = self._to_zones(data) + """ + Return a Zone instance. - if len(zones) != 1: - raise ZoneDoesNotExistError(value='', driver=self, zone_id=zone_id) + :param zone_id: ID of the zone to get + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + data = self.connection.request("/v4/domains/%s" % zone_id).object - return zones[0] + return self._to_zone(data) def get_record(self, zone_id, record_id): - zone = self.get_zone(zone_id=zone_id) - params = {'api_action': 'domain.resource.list', 'DomainID': zone_id, - 'ResourceID': record_id} - self.connection.set_context(context={'resource': 'record', - 'id': record_id}) - data = self.connection.request(API_ROOT, params=params).objects[0] - records = self._to_records(items=data, zone=zone) + """ + Return a record instance. - if len(records) != 1: - raise RecordDoesNotExistError(value='', driver=self, - record_id=record_id) + :param zone_id: ID of the record's zone + :type zone_id: ``str`` - return records[0] + :param record_id: ID of the record to get + :type record_id: ``str`` - def create_zone(self, domain, type='master', ttl=None, extra=None): + :rtype: :class:`Record` """ - Create a new zone. + data = self.connection.request( + "/v4/domains/{}/records/{}".format(zone_id, record_id) + ).object + + return self._to_record(data, self.get_zone(zone_id)) - API docs: http://www.linode.com/api/dns/domain.create + def create_zone(self, domain, type="master", ttl=None, extra=None): """ - params = {'api_action': 'domain.create', 'Type': type, - 'Domain': domain} - - if ttl: - params['TTL_sec'] = ttl - - merged = merge_valid_keys(params=params, - valid_keys=VALID_ZONE_EXTRA_PARAMS, - extra=extra) - data = self.connection.request(API_ROOT, params=params).objects[0] - zone = Zone(id=data['DomainID'], domain=domain, type=type, ttl=ttl, - extra=merged, driver=self) - return zone + Create a new zone. - def update_zone(self, zone, domain=None, type=None, ttl=None, extra=None): + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :keyword type: Zone type (master / slave). + :type type: ``str`` + + :keyword ttl: TTL for new records. (optional) + :type ttl: ``int`` + + :keyword extra: Extra attributes.('axfr_ips', 'description', 'expire_sec', \ + 'master_ips','refresh_sec', 'retry_sec', 'soa_email',\ + 'status', 'tags'). 'soa_email' required for master zones + :type extra: ``dict`` + + :rtype: :class:`Zone` """ - Update an existing zone. - API docs: http://www.linode.com/api/dns/domain.update + attr = { + "domain": domain, + "type": type, + } + if ttl is not None: + attr["ttl_sec"] = ttl + + merge_valid_keys(params=attr, valid_keys=VALID_ZONE_EXTRA_PARAMS_V4, extra=extra) + data = self.connection.request("/v4/domains", data=json.dumps(attr), method="POST").object + + return self._to_zone(data) + + def create_record(self, name, zone, type, data, extra=None): """ - params = {'api_action': 'domain.update', 'DomainID': zone.id} + Create a record. - if type: - params['Type'] = type + :param name: The name of this Record.For A records\ + this is the subdomain being associated with an IP address. + :type name: ``str`` - if domain: - params['Domain'] = domain + :param zone: Zone which the records will be created for. + :type zone: :class:`Zone` - if ttl: - params['TTL_sec'] = ttl + :param type: DNS record type. + :type type: :class:`RecordType` - merged = merge_valid_keys(params=params, - valid_keys=VALID_ZONE_EXTRA_PARAMS, - extra=extra) - self.connection.request(API_ROOT, params=params).objects[0] - updated_zone = get_new_obj(obj=zone, klass=Zone, - attributes={'domain': domain, - 'type': type, 'ttl': ttl, - 'extra': merged}) - return updated_zone + :param data: Data for the record (depends on the record type).\ + For A records, this is the address the domain should resolve to. + :type data: ``str`` - def create_record(self, name, zone, type, data, extra=None): + :param extra: Extra attributes.('port', 'priority', \ + 'protocol', 'service', 'tag', 'ttl_sec', 'target', 'weight') + :type extra: ``dict`` + + :rtype: :class:`Record` """ - Create a new record. + if not isinstance(zone, Zone): + raise LinodeExceptionV4("Invalid zone instance") + + attr = { + "type": self.RECORD_TYPE_MAP[type], + "name": name, + "target": data, + } + + merge_valid_keys(params=attr, valid_keys=VALID_RECORD_EXTRA_PARAMS_V4, extra=extra) + data = self.connection.request( + "/v4/domains/%s/records" % zone.id, data=json.dumps(attr), method="POST" + ).object + + return self._to_record(data, zone=zone) - API docs: http://www.linode.com/api/dns/domain.resource.create + def update_zone(self, zone, domain, type="master", ttl=None, extra=None): """ - params = {'api_action': 'domain.resource.create', 'DomainID': zone.id, - 'Name': name, 'Target': data, - 'Type': self.RECORD_TYPE_MAP[type]} - merged = merge_valid_keys(params=params, - valid_keys=VALID_RECORD_EXTRA_PARAMS, - extra=extra) - - result = self.connection.request(API_ROOT, params=params).objects[0] - record = Record(id=result['ResourceID'], name=name, type=type, - data=data, extra=merged, zone=zone, driver=self) - return record + Update an existing zone. + + :param zone: Zone to update. + :type zone: :class:`Zone` + + :param domain: Name of zone + :type domain: ``str`` + + :param type: Zone type (master / slave). + :type type: ``str`` - def update_record(self, record, name=None, type=None, data=None, - extra=None): + :param ttl: TTL for new records. (optional) + :type ttl: ``int`` + + :param extra: Extra attributes ('axfr_ips', 'description', 'expire_sec', \ + 'master_ips','refresh_sec', 'retry_sec', 'soa_email','status', 'tags') + + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + if not isinstance(zone, Zone): + raise LinodeExceptionV4("Invalid zone instance") + + attr = { + "domain": domain, + "type": type, + } + + if ttl is not None: + attr["ttl_sec"] = ttl + + merge_valid_keys(params=attr, valid_keys=VALID_ZONE_EXTRA_PARAMS_V4, extra=extra) + + data = self.connection.request( + "/v4/domains/%s" % zone.id, data=json.dumps(attr), method="PUT" + ).object + + return self._to_zone(data) + + def update_record(self, record, name=None, type=None, data=None, extra=None): """ Update an existing record. - API docs: http://www.linode.com/api/dns/domain.resource.update + :param record: Record to update. + :type record: :class:`Record` + + :param name: Record name.This field's actual usage\ + depends on the type of record this represents. + :type name: ``str`` + + :param type: DNS record type + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: Extra attributes.('port', 'priority', \ + 'protocol', 'service', 'tag', 'ttl_sec', 'target', 'weight') + :type extra: ``dict`` + + :rtype: :class:`Record` """ - params = {'api_action': 'domain.resource.update', - 'ResourceID': record.id, 'DomainID': record.zone.id} + if not isinstance(record, Record): + raise LinodeExceptionV4("Invalid zone instance") - if name: - params['Name'] = name + zone = record.zone + attr = {} - if data: - params['Target'] = data + if name is not None: + attr["name"] = name if type is not None: - params['Type'] = self.RECORD_TYPE_MAP[type] + attr["type"] = self.RECORD_TYPE_MAP[type] - merged = merge_valid_keys(params=params, - valid_keys=VALID_RECORD_EXTRA_PARAMS, - extra=extra) + if data is not None: + attr["target"] = data - self.connection.request(API_ROOT, params=params).objects[0] - updated_record = get_new_obj(obj=record, klass=Record, - attributes={'name': name, 'data': data, - 'type': type, - 'extra': merged}) - return updated_record + merge_valid_keys(params=attr, valid_keys=VALID_RECORD_EXTRA_PARAMS_V4, extra=extra) - def delete_zone(self, zone): - params = {'api_action': 'domain.delete', 'DomainID': zone.id} + data = self.connection.request( + "/v4/domains/{}/records/{}".format(zone.id, record.id), + data=json.dumps(attr), + method="PUT", + ).object - self.connection.set_context(context={'resource': 'zone', - 'id': zone.id}) - data = self.connection.request(API_ROOT, params=params).objects[0] + return self._to_record(data, zone=zone) - return 'DomainID' in data + def delete_zone(self, zone): + """ + Delete a zone. - def delete_record(self, record): - params = {'api_action': 'domain.resource.delete', - 'DomainID': record.zone.id, 'ResourceID': record.id} + This will delete all the records belonging to this zone. - self.connection.set_context(context={'resource': 'record', - 'id': record.id}) - data = self.connection.request(API_ROOT, params=params).objects[0] + :param zone: Zone to delete. + :type zone: :class:`Zone` - return 'ResourceID' in data + :rtype: ``bool`` + """ + if not isinstance(zone, Zone): + raise LinodeExceptionV4("Invalid zone instance") + + response = self.connection.request("/v4/domains/%s" % zone.id, method="DELETE") + return response.status == httplib.OK - def _to_zones(self, items): + def delete_record(self, record): """ - Convert a list of items to the Zone objects. + Delete a record. + + :param record: Record to delete. + :type record: :class:`Record` + + :rtype: ``bool`` """ - zones = [] + if not isinstance(record, Record): + raise LinodeExceptionV4("Invalid record instance") - for item in items: - zones.append(self._to_zone(item)) + zone = record.zone - return zones + response = self.connection.request( + "/v4/domains/{}/records/{}".format(zone.id, record.id), method="DELETE" + ) + return response.status == httplib.OK + + def _to_record(self, item, zone=None): + extra = { + "port": item["port"], + "weight": item["weight"], + "priority": item["priority"], + "service": item["service"], + "protocol": item["protocol"], + "tag": item["tag"], + "created": self._to_datetime(item["created"]), + "updated": self._to_datetime(item["updated"]), + } + type = self._string_to_record_type(item["type"]) + record = Record( + id=item["id"], + name=item["name"], + type=type, + data=item["target"], + zone=zone, + driver=self, + ttl=item["ttl_sec"], + extra=extra, + ) + return record def _to_zone(self, item): """ Build an Zone object from the item dictionary. """ - extra = {'SOA_Email': item['SOA_EMAIL'], 'status': item['STATUS'], - 'description': item['DESCRIPTION']} - zone = Zone(id=item['DOMAINID'], domain=item['DOMAIN'], - type=item['TYPE'], ttl=item['TTL_SEC'], driver=self, - extra=extra) + extra = { + "soa_email": item["soa_email"], + "status": item["status"], + "description": item["description"], + "tags": item["tags"], + "retry_sec": item["retry_sec"], + "master_ips": item["master_ips"], + "axfr_ips": item["axfr_ips"], + "expire_sec": item["expire_sec"], + "refresh_sec": item["refresh_sec"], + "created": self._to_datetime(item["created"]), + "updated": self._to_datetime(item["updated"]), + } + zone = Zone( + id=item["id"], + domain=item["domain"], + type=item["type"], + ttl=item["ttl_sec"], + driver=self, + extra=extra, + ) return zone - def _to_records(self, items, zone=None): - """ - Convert a list of items to the Record objects. + def _to_datetime(self, strtime): + return datetime.strptime(strtime, "%Y-%m-%dT%H:%M:%S") + + def _paginated_request(self, url, obj, params=None): """ - records = [] + Perform multiple calls in order to have a full list of elements when + the API responses are paginated. - for item in items: - records.append(self._to_record(item=item, zone=zone)) + :param url: API endpoint + :type url: ``str`` - return records + :param obj: Result object key + :type obj: ``str`` - def _to_record(self, item, zone=None): - """ - Build a Record object from the item dictionary. + :param params: Request parameters + :type params: ``dict`` + + :return: ``list`` of API response objects + :rtype: ``list`` """ - extra = {'protocol': item['PROTOCOL'], 'ttl_sec': item['TTL_SEC'], - 'port': item['PORT'], 'weight': item['WEIGHT']} - type = self._string_to_record_type(item['TYPE']) - record = Record(id=item['RESOURCEID'], name=item['NAME'], type=type, - data=item['TARGET'], zone=zone, driver=self, - extra=extra) - return record + objects = [] + params = params if params is not None else {} + + ret = self.connection.request(url, params=params).object + + data = list(ret.get(obj, [])) + current_page = int(ret.get("page", 1)) + num_of_pages = int(ret.get("pages", 1)) + objects.extend(data) + for page in range(current_page + 1, num_of_pages + 1): + # add param to request next page + params["page"] = page + ret = self.connection.request(url, params=params).object + data = list(ret.get(obj, [])) + objects.extend(data) + return objects diff --git a/libcloud/dns/drivers/liquidweb.py b/libcloud/dns/drivers/liquidweb.py new file mode 100644 index 0000000000..325ab05254 --- /dev/null +++ b/libcloud/dns/drivers/liquidweb.py @@ -0,0 +1,366 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Liquid Web DNS Driver +""" + +try: + import simplejson as json +except ImportError: + import json + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import ( + Provider, + RecordType, + ZoneDoesNotExistError, + ZoneAlreadyExistsError, + RecordDoesNotExistError, + RecordAlreadyExistsError, +) +from libcloud.common.liquidweb import APIException, LiquidWebResponse, LiquidWebConnection + +__all__ = ["LiquidWebDNSDriver"] + + +class LiquidWebDNSResponse(LiquidWebResponse): + pass + + +class LiquidWebDNSConnection(LiquidWebConnection): + responseCls = LiquidWebDNSResponse + + +class LiquidWebDNSDriver(DNSDriver): + type = Provider.LIQUIDWEB + name = "Liquidweb DNS" + website = "https://www.liquidweb.com" + connectionCls = LiquidWebDNSConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.PTR: "PTR", + RecordType.SOA: "SOA", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + } + + def list_zones(self): + """ + Return a list of zones. + + :return: ``list`` of :class:`Zone` + """ + action = "/v1/Network/DNS/Zone/list" + response = self.connection.request(action=action, method="POST") + + zones = self._to_zones(response.objects[0]) + + return zones + + def list_records(self, zone): + """ + Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + action = "/v1/Network/DNS/Record/list" + data = json.dumps({"params": {"zone_id": zone.id}}) + response = self.connection.request(action=action, method="POST", data=data) + + records = self._to_records(response.objects[0], zone=zone) + + return records + + def get_zone(self, zone_id): + """ + Return a Zone instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + action = "/v1/Network/DNS/Zone/details" + data = json.dumps({"params": {"id": zone_id}}) + try: + response = self.connection.request(action=action, method="POST", data=data) + except APIException as e: + if e.error_class == "LW::Exception::RecordNotFound": + raise ZoneDoesNotExistError(zone_id=zone_id, value=e.value, driver=self) + else: + raise e + + zone = self._to_zone(response.objects[0]) + return zone + + def get_record(self, zone_id, record_id): + """ + Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + zone = self.get_zone(zone_id=zone_id) + action = "/v1/Network/DNS/Record/details" + data = json.dumps({"params": {"id": record_id}}) + try: + response = self.connection.request(action=action, method="POST", data=data) + except APIException as e: + if e.error_class == "LW::Exception::RecordNotFound": + raise RecordDoesNotExistError(record_id=record_id, driver=self, value=e.value) + else: + raise e + + record = self._to_record(response.objects[0], zone=zone) + return record + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + Create a new zone. + + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type (This is not really used. See API docs for extra + parameters). + :type type: ``str`` + + :param ttl: TTL for new records. (This is not really used) + :type ttl: ``int`` + + :param extra: Extra attributes (driver specific). ('region_support', + 'zone_data') + :type extra: ``dict`` + + :rtype: :class:`Zone` + + For more info, please see: + https://www.liquidweb.com/storm/api/docs/v1/Network/DNS/Zone.html + """ + action = "/v1/Network/DNS/Zone/create" + data = {"params": {"name": domain}} + + if extra is not None: + data["params"].update(extra) + try: + data = json.dumps(data) + response = self.connection.request(action=action, method="POST", data=data) + except APIException as e: + if e.error_class == "LW::Exception::DuplicateRecord": + raise ZoneAlreadyExistsError(zone_id=domain, value=e.value, driver=self) + else: + raise e + + zone = self._to_zone(response.objects[0]) + + return zone + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone which the records will be created for. + :type zone: :class:`Zone` + + :param type: DNS record type ( 'A', 'AAAA', 'CNAME', 'MX', 'NS', + 'PTR', 'SOA', 'SRV', 'TXT'). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: (optional) Extra attributes ('prio', 'ttl'). + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + action = "/v1/Network/DNS/Record/create" + to_post = { + "params": { + "name": name, + "rdata": data, + "type": type, + "zone": zone.domain, + "zone_id": zone.id, + } + } + if extra is not None: + to_post["params"].update(extra) + data = json.dumps(to_post) + try: + response = self.connection.request(action=action, method="POST", data=data) + except APIException as e: + if e.error_class == "LW::Exception::DuplicateRecord": + raise RecordAlreadyExistsError(record_id=name, value=e.value, driver=self) + else: + raise e + + record = self._to_record(response.objects[0], zone=zone) + return record + + def update_record(self, record, name, type, data, extra=None): + """ + Update an existing record. + + :param record: Record to update. + :type record: :class:`Record` + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param type: DNS record type ( 'A', 'AAAA', 'CNAME', 'MX', 'NS', + 'PTR', 'SOA', 'SRV', 'TXT'). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: (optional) Extra attributes ('name', 'rdata', 'prio', + 'ttl'). + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + zone = record.zone + action = "/v1/Network/DNS/Record/update" + to_post = {"params": {"id": int(record.id), "name": name, "rdata": data}} + if extra is not None: + to_post["params"].update(extra) + j_data = json.dumps(to_post) + try: + response = self.connection.request(action=action, method="PUT", data=j_data) + except APIException as e: + if e.error_class == "LW::Exception::RecordNotFound": + raise RecordDoesNotExistError(record_id=record.id, driver=self, value=e.value) + else: + raise e + + record = self._to_record(response.objects[0], zone=zone) + return record + + def delete_zone(self, zone): + """ + Delete a zone. + + Note: This will delete all the records belonging to this zone. + + :param zone: Zone to delete. + :type zone: :class:`Zone` + + :rtype: ``bool`` + """ + action = "/v1/Network/DNS/Zone/delete" + data = json.dumps({"params": {"id": zone.id}}) + try: + response = self.connection.request(action=action, method="POST", data=data) + except APIException as e: + if e.error_class == "LW::Exception::RecordNotFound": + raise ZoneDoesNotExistError(zone_id=zone.id, value=e.value, driver=self) + else: + raise e + + return zone.domain in response.objects + + def delete_record(self, record): + """ + Delete a record. + + :param record: Record to delete. + :type record: :class:`Record` + + :rtype: ``bool`` + """ + action = "/v1/Network/DNS/Record/delete" + data = json.dumps({"params": {"id": record.id}}) + try: + response = self.connection.request(action=action, method="POST", data=data) + except APIException as e: + if e.error_class == "LW::Exception::RecordNotFound": + raise RecordDoesNotExistError(record_id=record.id, driver=self, value=e.value) + else: + raise e + + return record.id in response.objects + + def _to_zone(self, item): + common_attr = ["id", "name", "type"] + extra = {} + for key in item: + if key not in common_attr: + extra[key] = item.get(key) + zone = Zone( + domain=item["name"], + id=item["id"], + type=item["type"], + ttl=None, + driver=self, + extra=extra, + ) + + return zone + + def _to_zones(self, items): + zones = [] + for item in items: + zones.append(self._to_zone(item)) + + return zones + + def _to_record(self, item, zone): + common_attr = ["id", "rdata", "name", "type"] + extra = {} + for key in item: + if key not in common_attr: + extra[key] = item.get(key) + record = Record( + id=item["id"], + name=item["name"], + type=item["type"], + data=item["rdata"], + zone=zone, + driver=self, + extra=extra, + ) + + return record + + def _to_records(self, items, zone): + records = [] + for item in items: + records.append(self._to_record(item, zone)) + + return records diff --git a/libcloud/dns/drivers/luadns.py b/libcloud/dns/drivers/luadns.py new file mode 100644 index 0000000000..ccb1cdfb58 --- /dev/null +++ b/libcloud/dns/drivers/luadns.py @@ -0,0 +1,298 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import simplejson as json +except ImportError: + import json + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import ( + Provider, + RecordType, + ZoneDoesNotExistError, + ZoneAlreadyExistsError, + RecordDoesNotExistError, +) +from libcloud.common.luadns import LuadnsResponse, LuadnsException, LuadnsConnection + +__all__ = ["LuadnsDNSDriver"] + + +class LuadnsDNSResponse(LuadnsResponse): + pass + + +class LuadnsDNSConnection(LuadnsConnection): + responseCls = LuadnsDNSResponse + + +class LuadnsDNSDriver(DNSDriver): + type = Provider.LUADNS + name = "Luadns" + website = "https://www.luadns.com" + connectionCls = LuadnsDNSConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.PTR: "PTR", + RecordType.SOA: "SOA", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + } + + def list_zones(self): + """ + Return a list of zones. + + :return: ``list`` of :class:`Zone` + """ + action = "/v1/zones" + response = self.connection.request(action=action, method="GET") + zones = self._to_zones(response.parse_body()) + + return zones + + def get_zone(self, zone_id): + """ + Return a Zone instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + action = "/v1/zones/%s" % zone_id + try: + response = self.connection.request(action=action) + except LuadnsException as e: + if e.message in ["Zone not found.", "Resource not found."]: + raise ZoneDoesNotExistError(zone_id=zone_id, value="", driver=self) + else: + raise e + + zone = self._to_zone(response.parse_body()) + + return zone + + def delete_zone(self, zone): + """ + Delete a zone. + + Note: This will delete all the records belonging to this zone. + + :param zone: Zone to delete. + :type zone: :class:`Zone` + + :rtype: ``bool`` + """ + action = "/v1/zones/%s" % zone.id + try: + response = self.connection.request(action=action, method="DELETE") + except LuadnsException as e: + if e.message in ["Resource not found.", "Zone not found."]: + raise ZoneDoesNotExistError(zone_id=zone.id, value="", driver=self) + else: + raise e + + return response.status == 200 + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + Create a new zone. + + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type (This is not really used. See API docs for extra + parameters). + :type type: ``str`` + + :param ttl: TTL for new records. (This is not really used) + :type ttl: ``int`` + + :param extra: Extra attributes (driver specific). ('region_support', + 'zone_data') + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + action = "/v1/zones" + data = json.dumps({"name": domain}) + try: + response = self.connection.request(action=action, method="POST", data=data) + except LuadnsException as e: + if e.message == "Zone '%s' is taken already." % domain: + raise ZoneAlreadyExistsError(zone_id=domain, value="", driver=self) + else: + raise e + zone = self._to_zone(response.parse_body()) + + return zone + + def list_records(self, zone): + """ + Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + action = "/v1/zones/%s/records" % zone.id + response = self.connection.request(action=action) + records = self._to_records(response.parse_body(), zone=zone) + + return records + + def get_record(self, zone_id, record_id): + """ + Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + zone = self.get_zone(zone_id=zone_id) + action = "/v1/zones/{}/records/{}".format(zone_id, record_id) + try: + response = self.connection.request(action=action) + except LuadnsException as e: + if e.message == "Record not found.": + raise RecordDoesNotExistError(record_id=record_id, driver=self, value="") + else: + raise e + + record = self._to_record(response.parse_body(), zone=zone) + + return record + + def delete_record(self, record): + """ + Delete a record. + + :param record: Record to delete. + :type record: :class:`Record` + + :rtype: ``bool`` + """ + action = "/v1/zones/{}/records/{}".format(record.zone.id, record.id) + try: + response = self.connection.request(action=action, method="DELETE") + except LuadnsException as e: + if e.message == "Record not found.": + raise RecordDoesNotExistError(record_id=record.id, driver=self, value="") + else: + raise e + + return response.status == 200 + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone which the records will be created for. + :type zone: :class:`Zone` + + :param type: DNS record type ( 'A', 'AAAA', 'CNAME', 'MX', 'NS', + 'PTR', 'SOA', 'SRV', 'TXT'). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: (optional) Extra attributes ('prio', 'ttl'). + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + action = "/v1/zones/%s/records" % zone.id + to_post = {"name": name, "content": data, "type": type, "zone_id": int(zone.id)} + # ttl is required to create a record for luadns + # pass it through extra like this: extra={'ttl':ttl} + if extra is not None: + to_post.update(extra) + data = json.dumps(to_post) + try: + response = self.connection.request(action=action, method="POST", data=data) + except LuadnsException as e: + raise e + + record = self._to_record(response.parse_body(), zone=zone) + + return record + + def _to_zone(self, item): + common_attr = ["id", "name"] + extra = {} + for key in item: + if key not in common_attr: + extra[key] = item.get(key) + zone = Zone( + domain=item["name"], + id=item["id"], + type=None, + ttl=None, + driver=self, + extra=extra, + ) + + return zone + + def _to_zones(self, items): + zones = [] + for item in items: + zones.append(self._to_zone(item)) + + return zones + + def _to_record(self, item, zone): + common_attr = ["id", "content", "name", "type"] + extra = {} + for key in item: + if key not in common_attr: + extra[key] = item.get(key) + record = Record( + id=item["id"], + name=item["name"], + type=item["type"], + data=item["content"], + zone=zone, + driver=self, + extra=extra, + ) + + return record + + def _to_records(self, items, zone): + records = [] + for item in items: + records.append(self._to_record(item, zone)) + + return records diff --git a/libcloud/dns/drivers/nfsn.py b/libcloud/dns/drivers/nfsn.py new file mode 100644 index 0000000000..4864113c90 --- /dev/null +++ b/libcloud/dns/drivers/nfsn.py @@ -0,0 +1,199 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License.You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +NFSN DNS Driver +""" + +import re + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import ( + Provider, + RecordType, + ZoneDoesNotExistError, + RecordDoesNotExistError, + RecordAlreadyExistsError, +) +from libcloud.utils.py3 import httplib +from libcloud.common.nfsn import NFSNConnection +from libcloud.common.exceptions import BaseHTTPError + +__all__ = [ + "NFSNDNSDriver", +] + +# The NFSN API does not return any internal "ID" strings for any DNS records. +# This means that we must set all returned Record objects' id properties to +# None. It also means that we cannot implement libcloud APIs that rely on +# record_id, such as get_record(). Instead, the NFSN-specific +# ex_get_records_by() method will return the desired Record objects. +# +# Additionally, the NFSN API does not provide ways to create, delete, or list +# all zones, so create_zone(), delete_zone(), and list_zones() are not +# implemented. + + +class NFSNDNSDriver(DNSDriver): + type = Provider.NFSN + name = "NFSN DNS" + website = "https://www.nearlyfreespeech.net" + connectionCls = NFSNConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + RecordType.PTR: "PTR", + } + + def list_records(self, zone): + """ + Return a list of all records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + # Just use ex_get_records_by() with no name or type filters. + return self.ex_get_records_by(zone) + + def get_zone(self, zone_id): + """ + Return a Zone instance. + + :param zone_id: name of the required zone, for example "example.com". + :type zone_id: ``str`` + + :rtype: :class:`Zone` + :raises: ZoneDoesNotExistError: If no zone could be found. + """ + # We will check if there is a serial property for this zone. If so, + # then the zone exists. + try: + self.connection.request(action="/dns/%s/serial" % zone_id) + except BaseHTTPError as e: + if e.code == httplib.NOT_FOUND: + raise ZoneDoesNotExistError(zone_id=None, driver=self, value=e.message) + raise e + return Zone(id=None, domain=zone_id, type="master", ttl=3600, driver=self) + + def ex_get_records_by(self, zone, name=None, type=None): + """ + Return a list of records for the provided zone, filtered by name and/or + type. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :param zone: Zone where the requested records are found. + :type zone: :class:`Zone` + + :param name: name of the records, for example "www". (optional) + :type name: ``str`` + + :param type: DNS record type (A, MX, TXT). (optional) + :type type: :class:`RecordType` + + :return: ``list`` of :class:`Record` + """ + payload = {} + if name is not None: + payload["name"] = name + if type is not None: + payload["type"] = type + + action = "/dns/%s/listRRs" % zone.domain + response = self.connection.request(action=action, data=payload, method="POST") + return self._to_records(response, zone) + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a new record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone where the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS record type (A, MX, TXT). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: Extra attributes (driver specific, e.g. 'ttl'). + (optional) + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + action = "/dns/%s/addRR" % zone.domain + payload = {"name": name, "data": data, "type": type} + if extra is not None and extra.get("ttl", None) is not None: + payload["ttl"] = extra["ttl"] + try: + self.connection.request(action=action, data=payload, method="POST") + except BaseHTTPError as e: + exists_re = re.compile(r"That RR already exists on the domain") + if e.code == httplib.BAD_REQUEST and re.search(exists_re, e.message) is not None: + value = '"{}" already exists in {}'.format(name, zone.domain) + raise RecordAlreadyExistsError(value=value, driver=self, record_id=None) + raise e + return self.ex_get_records_by(zone=zone, name=name, type=type)[0] + + def delete_record(self, record): + """ + Use this method to delete a record. + + :param record: record to delete + :type record: `Record` + + :rtype: Bool + """ + action = "/dns/%s/removeRR" % record.zone.domain + payload = {"name": record.name, "data": record.data, "type": record.type} + try: + self.connection.request(action=action, data=payload, method="POST") + except BaseHTTPError as e: + if e.code == httplib.NOT_FOUND: + raise RecordDoesNotExistError(value=e.message, driver=self, record_id=None) + raise e + return True + + def _to_record(self, item, zone): + ttl = int(item["ttl"]) + return Record( + id=None, + name=item["name"], + data=item["data"], + type=item["type"], + zone=zone, + driver=self, + ttl=ttl, + ) + + def _to_records(self, items, zone): + records = [] + for item in items.object: + records.append(self._to_record(item, zone)) + return records diff --git a/libcloud/dns/drivers/nsone.py b/libcloud/dns/drivers/nsone.py new file mode 100644 index 0000000000..58c012197d --- /dev/null +++ b/libcloud/dns/drivers/nsone.py @@ -0,0 +1,348 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: + import simplejson as json +except ImportError: + import json + +from libcloud.dns.base import Zone, Record, DNSDriver, RecordType +from libcloud.dns.types import ( + Provider, + ZoneDoesNotExistError, + ZoneAlreadyExistsError, + RecordDoesNotExistError, + RecordAlreadyExistsError, +) +from libcloud.utils.py3 import httplib +from libcloud.common.nsone import NsOneResponse, NsOneException, NsOneConnection + +__all__ = ["NsOneDNSDriver"] + + +class NsOneDNSResponse(NsOneResponse): + pass + + +class NsOneDNSConnection(NsOneConnection): + responseCls = NsOneDNSResponse + + +class NsOneDNSDriver(DNSDriver): + name = "NS1 DNS" + website = "https://ns1.com" + type = Provider.NSONE + connectionCls = NsOneDNSConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.PTR: "PTR", + RecordType.SOA: "SOA", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + } + + def list_zones(self): + action = "/v1/zones" + response = self.connection.request(action=action, method="GET") + zones = self._to_zones(items=response.parse_body()) + + return zones + + def get_zone(self, zone_id): + """ + :param zone_id: Zone domain name (e.g. example.com) + :return: :class:`Zone` + """ + action = "/v1/zones/%s" % zone_id + try: + response = self.connection.request(action=action, method="GET") + except NsOneException as e: + if e.message == "zone not found": + raise ZoneDoesNotExistError(value=e.message, driver=self, zone_id=zone_id) + else: + raise e + zone = self._to_zone(response.objects[0]) + + return zone + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type (This is not really used. See API docs for extra + parameters) + :type type: ``str`` + + :param ttl: TTL for new records (This is used through the extra param) + :type ttl: ``int`` + + :param extra: Extra attributes that are specific to the driver + such as ttl. + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + action = "/v1/zones/%s" % domain + raw_data = {"zone": domain} + if extra is not None: + raw_data.update(extra) + post_data = json.dumps(raw_data) + try: + response = self.connection.request(action=action, method="PUT", data=post_data) + except NsOneException as e: + if e.message == "zone already exists": + raise ZoneAlreadyExistsError(value=e.message, driver=self, zone_id=domain) + else: + raise e + + zone = self._to_zone(response.object) + + return zone + + def delete_zone(self, zone): + """ + :param zone: Zone to be deleted. + :type zone: :class:`Zone` + + :return: Boolean + """ + action = "/v1/zones/%s" % zone.domain + """zones_list = self.list_zones() + if not self.ex_zone_exists(zone_id=zone.id, zones_list=zones_list): + raise ZoneDoesNotExistError(value='', driver=self, zone_id=zone.id) + """ + try: + response = self.connection.request(action=action, method="DELETE") + except NsOneException as e: + if e.message == "zone not found": + raise ZoneDoesNotExistError(value=e.message, driver=self, zone_id=zone.id) + else: + raise e + + return response.status == httplib.OK + + def list_records(self, zone): + """ + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + action = "/v1/zones/%s" % zone.domain + try: + response = self.connection.request(action=action, method="GET") + except NsOneException as e: + if e.message == "zone not found": + raise ZoneDoesNotExistError(value=e.message, driver=self, zone_id=zone.id) + else: + raise e + records = self._to_records(items=response.parse_body()["records"], zone=zone) + + return records + + def get_record(self, zone_id, record_id): + """ + :param zone_id: The id of the zone where to search for + the record (e.g. example.com) + :type zone_id: ``str`` + :param record_id: The type of record to search for + (e.g. A, AAA, MX etc) + + :return: :class:`Record` + """ + action = "/v1/zones/{}/{}/{}".format(zone_id, zone_id, record_id) + try: + response = self.connection.request(action=action, method="GET") + except NsOneException as e: + if e.message == "record not found": + raise RecordDoesNotExistError(value=e.message, driver=self, record_id=record_id) + else: + raise e + zone = self.get_zone(zone_id=zone_id) + record = self._to_record(item=response.parse_body(), zone=zone) + + return record + + def delete_record(self, record): + """ + :param record: Record to delete. + :type record: :class:`Record` + + :return: Boolean + """ + action = "/v1/zones/{}/{}/{}".format(record.zone.domain, record.name, record.type) + try: + response = self.connection.request(action=action, method="DELETE") + except NsOneException as e: + if e.message == "record not found": + raise RecordDoesNotExistError(value=e.message, driver=self, record_id=record.id) + else: + raise e + + return response.status == httplib.OK + + def create_record(self, name, zone, type, data, extra=None): + """ + :param name: Name of the record to create (e.g. foo). + :type name: ``str`` + :param zone: Zone where the record should be created. + :type zone: :class:`Zone` + :param type: Type of record (e.g. A, MX etc) + :type type: ``str`` + :param data: Data of the record (e.g. 127.0.0.1 for the A record) + :type data: ``str`` + :param extra: Extra data needed to create different types of records + :type extra: ``dict`` + :return: :class:`Record` + """ + record_name = "{}.{}".format(name, zone.domain) if name != "" else zone.domain # noqa + + action = "/v1/zones/{}/{}/{}".format(zone.domain, record_name, type) + if type == RecordType.MX: + answer = [extra.get("priority", 10), data] + else: + answer = [data] + + raw_data = { + "answers": [{"answer": answer}], + "type": type, + "domain": record_name, + "zone": zone.domain, + } + if extra is not None and extra.get("answers"): + raw_data["answers"] = extra.get("answers") + post_data = json.dumps(raw_data) + try: + response = self.connection.request(action=action, method="PUT", data=post_data) + except NsOneException as e: + if e.message == "record already exists": + raise RecordAlreadyExistsError(value=e.message, driver=self, record_id="") + else: + raise e + record = self._to_record(item=response.parse_body(), zone=zone) + + return record + + def update_record(self, record, name, type, data, extra=None): + """ + :param record: Record to update + :type record: :class:`Record` + :param name: Name of the record to update (e.g. foo). + :type name: ``str`` + :param type: Type of record (e.g. A, MX etc) + :type type: ``str`` + :param data: Data of the record (e.g. 127.0.0.1 for the A record) + :type data: ``str`` + :param extra: Extra data needed to create different types of records + :type extra: ``dict`` + :return: :class:`Record` + """ + zone = record.zone + action = "/v1/zones/{}/{}/{}".format( + zone.domain, + "{}.{}".format(name, zone.domain), + type, + ) + raw_data = {"answers": [{"answer": [data]}]} + if extra is not None and extra.get("answers"): + raw_data["answers"] = extra.get("answers") + post_data = json.dumps(raw_data) + try: + response = self.connection.request(action=action, data=post_data, method="POST") + except NsOneException as e: + if e.message == "record does not exist": + raise RecordDoesNotExistError(value=e.message, driver=self, record_id=record.id) + else: + raise e + record = self._to_record(item=response.parse_body(), zone=zone) + + return record + + def ex_zone_exists(self, zone_id, zones_list): + """ + Function to check if a `Zone` object exists. + :param zone_id: ID of the `Zone` object. + :type zone_id: ``str`` + + :param zones_list: A list containing `Zone` objects. + :type zones_list: ``list``. + + :rtype: Returns `True` or `False`. + """ + zone_ids = [] + for zone in zones_list: + zone_ids.append(zone.id) + + return zone_id in zone_ids + + def _to_zone(self, item): + common_attr = ["zone", "id", "type"] + extra = {} + for key in item.keys(): + if key not in common_attr: + extra[key] = item.get(key) + + zone = Zone( + domain=item["zone"], + id=item["id"], + type=item.get("type"), + extra=extra, + ttl=extra.get("ttl"), + driver=self, + ) + + return zone + + def _to_zones(self, items): + zones = [] + for item in items: + zones.append(self._to_zone(item)) + + return zones + + def _to_record(self, item, zone): + common_attr = ["id", "short_answers", "answers", "domain", "type"] + extra = {} + for key in item.keys(): + if key not in common_attr: + extra[key] = item.get(key) + if item.get("answers") is not None: + data = item.get("answers")[0]["answer"] + else: + data = item.get("short_answers") + record = Record( + id=item["id"], + name=item["domain"], + type=item["type"], + data=data, + zone=zone, + driver=self, + extra=extra, + ) + + return record + + def _to_records(self, items, zone): + records = [] + for item in items: + records.append(self._to_record(item, zone)) + + return records diff --git a/libcloud/dns/drivers/onapp.py b/libcloud/dns/drivers/onapp.py new file mode 100644 index 0000000000..322e812b3c --- /dev/null +++ b/libcloud/dns/drivers/onapp.py @@ -0,0 +1,366 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +OnApp DNS Driver +""" + +__all__ = ["OnAppDNSDriver"] + +import json + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import Provider, RecordType +from libcloud.common.onapp import OnAppConnection + +DEFAULT_ZONE_TTL = 1200 + + +class OnAppDNSDriver(DNSDriver): + type = Provider.ONAPP + name = "OnApp" + website = "http://onapp.com/" + connectionCls = OnAppConnection + + RECORD_TYPE_MAP = { + RecordType.SOA: "SOA", + RecordType.NS: "NS", + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.TXT: "TXT", + RecordType.SRV: "SRV", + } + + def list_zones(self): + """ + Return a list of zones. + + :return: ``list`` of :class:`Zone` + """ + response = self.connection.request("/dns_zones.json") + + zones = self._to_zones(response.object) + + return zones + + def get_zone(self, zone_id): + """ + Return a Zone instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + response = self.connection.request("/dns_zones/%s.json" % zone_id) + zone = self._to_zone(response.object) + + return zone + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + Create a new zone. + + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type (All zones are master by design). + :type type: ``str`` + + :param ttl: TTL for new records. (This is not really used) + :type ttl: ``int`` + + :param extra: Extra attributes (set auto_populate: 0 if you + don't want to auto populate with existing DNS records). (optional) + :type extra: ``dict`` + + :rtype: :class:`Zone` + + For more info, please see: + https://docs.onapp.com/display/52API/Add+DNS+Zone + """ + dns_zone = {"name": domain} + + if extra is not None: + dns_zone.update(extra) + dns_zone_data = json.dumps({"dns_zone": dns_zone}) + response = self.connection.request( + "/dns_zones.json", + method="POST", + headers={"Content-type": "application/json"}, + data=dns_zone_data, + ) + zone = self._to_zone(response.object) + + return zone + + def delete_zone(self, zone): + """ + Delete a zone. + + Note: This will also delete all the records belonging to this zone. + + :param zone: Zone to delete. + :type zone: :class:`Zone` + + :rtype: ``bool`` + """ + self.connection.request("/dns_zones/%s.json" % zone.id, method="DELETE") + + return True + + def list_records(self, zone): + """ + Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + response = self.connection.request("/dns_zones/%s/records.json" % zone.id) + dns_records = response.object["dns_zone"]["records"] + records = self._to_records(dns_records, zone) + + return records + + def get_record(self, zone_id, record_id): + """ + Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + response = self.connection.request( + "/dns_zones/{}/records/{}.json".format(zone_id, record_id) + ) + record = self._to_record(response.object, zone_id=zone_id) + + return record + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a new record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone where the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + Used only for A and AAAA record types. + :type data: ``str`` + + :param extra: Extra attributes (driver specific). (optional) + :type extra: ``dict`` + + :rtype: :class:`Record` + + For more info, please see: + https://docs.onapp.com/display/52API/Add+DNS+Record + """ + dns_record = self._format_record(name, type, data, extra) + dns_record_data = json.dumps({"dns_record": dns_record}) + response = self.connection.request( + "/dns_zones/%s/records.json" % zone.id, + method="POST", + headers={"Content-type": "application/json"}, + data=dns_record_data, + ) + record = self._to_record(response.object, zone=zone) + + return record + + def update_record(self, record, name, type, data, extra=None): + """ + Update an existing record. + + :param record: Record to update. + :type record: :class:`Record` + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + Used only for A and AAAA record types. + :type data: ``str`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: :class:`Record` + + For more info, please see: + https://docs.onapp.com/display/52API/Edit+DNS+Records + """ + zone = record.zone + dns_record = self._format_record(name, type, data, extra) + dns_record_data = json.dumps({"dns_record": dns_record}) + self.connection.request( + "/dns_zones/{}/records/{}.json".format(zone.id, record.id), + method="PUT", + headers={"Content-type": "application/json"}, + data=dns_record_data, + ) + record = self.get_record(zone.id, record.id) + + return record + + def delete_record(self, record): + """ + Delete a record. + + :param record: Record to delete. + :type record: :class:`Record` + + :rtype: ``bool`` + + For more info, please see: + https://docs.onapp.com/display/52API/Delete+DNS+Record + """ + zone_id = record.zone.id + self.connection.request( + "/dns_zones/{}/records/{}.json".format(zone_id, record.id), method="DELETE" + ) + + return True + + # + # Helper methods + # + + def _format_record(self, name, type, data, extra): + if name == "": + name = "@" + + if extra is None: + extra = {} + record_type = self.RECORD_TYPE_MAP[type] + new_record = { + "name": name, + "ttl": extra.get("ttl", DEFAULT_ZONE_TTL), + "type": record_type, + } + + if type == RecordType.MX: + additions = { + "priority": extra.get("priority", 1), + "hostname": extra.get("hostname"), + } + elif type == RecordType.SRV: + additions = { + "port": extra.get("port"), + "weight": extra.get("weight", 1), + "priority": extra.get("priority", 1), + "hostname": extra.get("hostname"), + } + elif type == RecordType.A: + additions = {"ip": data} + elif type == RecordType.CNAME: + additions = {"hostname": extra.get("hostname")} + elif type == RecordType.AAAA: + additions = {"ip": data} + elif type == RecordType.TXT: + additions = {"txt": extra.get("txt")} + elif type == RecordType.NS: + additions = {"hostname": extra.get("hostname")} + else: + additions = {} + + new_record.update(additions) + + return new_record + + def _to_zones(self, data): + zones = [] + + for zone in data: + _zone = self._to_zone(zone) + zones.append(_zone) + + return zones + + def _to_zone(self, data): + dns_zone = data.get("dns_zone") + id = dns_zone.get("id") + name = dns_zone.get("name") + extra = { + "user_id": dns_zone.get("user_id"), + "cdn_reference": dns_zone.get("cdn_reference"), + "created_at": dns_zone.get("created_at"), + "updated_at": dns_zone.get("updated_at"), + } + + type = "master" + + return Zone( + id=id, + domain=name, + type=type, + ttl=DEFAULT_ZONE_TTL, + driver=self, + extra=extra, + ) + + def _to_records(self, data, zone): + records = [] + data = data.values() + + for data_type in data: + for item in data_type: + record = self._to_record(item, zone=zone) + records.append(record) + records.sort(key=lambda x: x.id, reverse=False) + + return records + + def _to_record(self, data, zone_id=None, zone=None): + if not zone: # We need zone_id or zone + zone = self.get_zone(zone_id) + record = data.get("dns_record") + id = record.get("id") + name = record.get("name") + type = record.get("type") + ttl = record.get("ttl", None) + + return Record( + id=id, + name=name, + type=type, + data=record, + zone=zone, + driver=self, + ttl=ttl, + extra={}, + ) diff --git a/libcloud/dns/drivers/pointdns.py b/libcloud/dns/drivers/pointdns.py new file mode 100644 index 0000000000..98dbfb8aa5 --- /dev/null +++ b/libcloud/dns/drivers/pointdns.py @@ -0,0 +1,778 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Point DNS Driver +""" + +__all__ = ["PointDNSException", "Redirect", "MailRedirect", "PointDNSDriver"] + +try: + import simplejson as json +except ImportError: + import json + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import Provider, RecordType, ZoneDoesNotExistError, RecordDoesNotExistError +from libcloud.utils.py3 import httplib +from libcloud.common.types import ProviderError, MalformedResponseError +from libcloud.common.pointdns import PointDNSConnection +from libcloud.common.exceptions import BaseHTTPError + + +class PointDNSException(ProviderError): + def __init__(self, value, http_code, driver=None): + super().__init__(value=value, http_code=http_code, driver=driver) + self.args = (http_code, value) + + +class Redirect: + """ + Point DNS redirect. + """ + + def __init__(self, id, name, data, type, driver, zone, iframe=None, query=False): + """ + :param id: Redirect id. + :type id: ``str`` + + :param name: The FQDN for the record. + :type name: ``str`` + + :param data: The data field. (redirect_to) + :type data: ``str`` + + :param type: The type of redirects 301, 302 or 0 for iframes. + :type type: ``str`` + + :param driver: DNSDriver instance. + :type driver: :class:`DNSDriver` + + :param zone: Zone where redirect belongs. + :type zone: :class:`Zone` + + :param iframe: Title of iframe (optional). + :type iframe: ``str`` + + :param query: boolean Information about including query string when + redirecting. (optional). + :type query: ``bool`` + """ + self.id = str(id) if id else None + self.name = name + self.data = data + self.type = str(type) if type else None + self.driver = driver + self.zone = zone + self.iframe = iframe + self.query = query + + def update(self, data, name=None, type=None, iframe=None, query=None): + return self.driver.ex_update_redirect( + redirect=self, name=name, data=data, type=type, iframe=iframe, query=query + ) + + def delete(self): + return self.driver.ex_delete_redirect(redirect=self) + + def __repr__(self): + return "".format( + self.name, + self.data, + self.type, + ) + + +class MailRedirect: + """ + Point DNS mail redirect. + """ + + def __init__(self, id, source, destination, zone, driver): + """ + :param id: MailRedirect id. + :type id: ``str`` + + :param source: The source address of mail redirect. + :type source: ``str`` + + :param destination: The destination address of mail redirect. + :type destination: ``str`` + + :param zone: Zone where mail redirect belongs. + :type zone: :class:`Zone` + + :param driver: DNSDriver instance. + :type driver: :class:`DNSDriver` + """ + self.id = str(id) if id else None + self.source = source + self.destination = destination + self.zone = zone + self.driver = driver + + def update(self, destination, source=None): + return self.driver.ex_update_mail_redirect( + mail_r=self, destination=destination, source=None + ) + + def delete(self): + return self.driver.ex_delete_mail_redirect(mail_r=self) + + def __repr__(self): + return "".format( + self.source, + self.destination, + self.zone.id, + ) + + +class PointDNSDriver(DNSDriver): + type = Provider.POINTDNS + name = "Point DNS" + website = "https://pointhq.com/" + connectionCls = PointDNSConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.ALIAS: "ALIAS", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.PTR: "PTR", + RecordType.SRV: "SRV", + RecordType.SSHFP: "SSHFP", + RecordType.TXT: "TXT", + } + + def list_zones(self): + """ + Return a list of zones. + + :return: ``list`` of :class:`Zone` + """ + response = self.connection.request("/zones") + zones = self._to_zones(response.object) + return zones + + def list_records(self, zone): + """ + Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + response = self.connection.request("/zones/%s/records" % zone.id) + records = self._to_records(response.object, zone) + return records + + def get_zone(self, zone_id): + """ + Return a Zone instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + try: + response = self.connection.request("/zones/%s" % zone_id) + except MalformedResponseError as e: + if e.body == "Not found": + raise ZoneDoesNotExistError( + driver=self, value="The zone doesn't exists", zone_id=zone_id + ) + raise e + + zone = self._to_zone(response.object) + return zone + + def get_record(self, zone_id, record_id): + """ + Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + try: + response = self.connection.request("/zones/{}/records/{}".format(zone_id, record_id)) + except MalformedResponseError as e: + if e.body == "Not found": + raise RecordDoesNotExistError( + value="Record doesn't exists", driver=self, record_id=record_id + ) + raise e + + record = self._to_record(response.object, zone_id=zone_id) + return record + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + Create a new zone. + + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type (All zones are master by design). + :type type: ``str`` + + :param ttl: TTL for new records. (optional) + :type ttl: ``int`` + + :param extra: Extra attributes (driver specific). (optional) + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + r_json = {"name": domain} + if ttl is not None: + r_json["ttl"] = ttl + if extra is not None: + r_json.update(extra) + r_data = json.dumps({"zone": r_json}) + try: + response = self.connection.request("/zones", method="POST", data=r_data) + except BaseHTTPError as e: + raise PointDNSException(value=e.message, http_code=e.code, driver=self) + zone = self._to_zone(response.object) + return zone + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a new record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone where the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: Extra attributes (driver specific). (optional) + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + r_json = {"name": name, "data": data, "record_type": type} + if extra is not None: + r_json.update(extra) + r_data = json.dumps({"zone_record": r_json}) + try: + response = self.connection.request( + "/zones/%s/records" % zone.id, method="POST", data=r_data + ) + except BaseHTTPError as e: + raise PointDNSException(value=e.message, http_code=e.code, driver=self) + record = self._to_record(response.object, zone=zone) + return record + + def update_zone(self, zone, domain, type="master", ttl=None, extra=None): + """ + Update an existing zone. + + :param zone: Zone to update. + :type zone: :class:`Zone` + + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type (All zones are master by design). + :type type: ``str`` + + :param ttl: TTL for new records. (optional) + :type ttl: ``int`` + + :param extra: Extra attributes (group, user-id). (optional) + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + r_json = {"name": domain} + if extra is not None: + r_json.update(extra) + r_data = json.dumps({"zone": r_json}) + try: + response = self.connection.request("/zones/%s" % zone.id, method="PUT", data=r_data) + except (BaseHTTPError, MalformedResponseError) as e: + if isinstance(e, MalformedResponseError) and e.body == "Not found": + raise ZoneDoesNotExistError( + value="Zone doesn't exists", driver=self, zone_id=zone.id + ) + raise PointDNSException(value=e.message, http_code=e.code, driver=self) + zone = self._to_zone(response.object) + return zone + + def update_record(self, record, name, type, data, extra=None): + """ + Update an existing record. + + :param record: Record to update. + :type record: :class:`Record` + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + zone = record.zone + r_json = {"name": name, "data": data, "record_type": type} + if extra is not None: + r_json.update(extra) + r_data = json.dumps({"zone_record": r_json}) + try: + response = self.connection.request( + "/zones/{}/records/{}".format(zone.id, record.id), method="PUT", data=r_data + ) + except (BaseHTTPError, MalformedResponseError) as e: + if isinstance(e, MalformedResponseError) and e.body == "Not found": + raise RecordDoesNotExistError( + value="Record doesn't exists", driver=self, record_id=record.id + ) + raise PointDNSException(value=e.message, http_code=e.code, driver=self) + record = self._to_record(response.object, zone=zone) + return record + + def delete_zone(self, zone): + """ + Delete a zone. + + Note: This will delete all the records belonging to this zone. + + :param zone: Zone to delete. + :type zone: :class:`Zone` + + :rtype: ``bool`` + """ + try: + self.connection.request("/zones/%s" % zone.id, method="DELETE") + except MalformedResponseError as e: + if e.body == "Not found": + raise ZoneDoesNotExistError( + driver=self, value="The zone doesn't exists", zone_id=zone.id + ) + raise e + return True + + def delete_record(self, record): + """ + Delete a record. + + :param record: Record to delete. + :type record: :class:`Record` + + :rtype: ``bool`` + """ + zone_id = record.zone.id + record_id = record.id + try: + self.connection.request( + "/zones/{}/records/{}".format(zone_id, record_id), method="DELETE" + ) + except MalformedResponseError as e: + if e.body == "Not found": + raise RecordDoesNotExistError( + value="Record doesn't exists", driver=self, record_id=record_id + ) + raise e + return True + + def ex_list_redirects(self, zone): + """ + :param zone: Zone to list redirects for. + :type zone: :class:`Zone` + + :rtype: ``list`` of :class:`Record` + """ + response = self.connection.request("/zones/%s/redirects" % zone.id) + redirects = self._to_redirects(response.object, zone) + return redirects + + def ex_list_mail_redirects(self, zone): + """ + :param zone: Zone to list redirects for. + :type zone: :class:`Zone` + + :rtype: ``list`` of :class:`MailRedirect` + """ + response = self.connection.request("/zones/%s/mail_redirects" % zone.id) + mail_redirects = self._to_mail_redirects(response.object, zone) + return mail_redirects + + def ex_create_redirect(self, redirect_to, name, type, zone, iframe=None, query=None): + """ + :param redirect_to: The data field. (redirect_to) + :type redirect_to: ``str`` + + :param name: The FQDN for the record. + :type name: ``str`` + + :param type: The type of redirects 301, 302 or 0 for iframes. + :type type: ``str`` + + :param zone: Zone to list redirects for. + :type zone: :class:`Zone` + + :param iframe: Title of iframe (optional). + :type iframe: ``str`` + + :param query: boolean Information about including query string when + redirecting. (optional). + :type query: ``bool`` + + :rtype: :class:`Record` + """ + r_json = {"name": name, "redirect_to": redirect_to} + if type is not None: + r_json["redirect_type"] = type + if iframe is not None: + r_json["iframe_title"] = iframe + if query is not None: + r_json["redirect_query_string"] = query + r_data = json.dumps({"zone_redirect": r_json}) + try: + response = self.connection.request( + "/zones/%s/redirects" % zone.id, method="POST", data=r_data + ) + except (BaseHTTPError, MalformedResponseError) as e: + raise PointDNSException(value=e.message, http_code=e.code, driver=self) + redirect = self._to_redirect(response.object, zone=zone) + return redirect + + def ex_create_mail_redirect(self, destination, source, zone): + """ + :param destination: The destination address of mail redirect. + :type destination: ``str`` + + :param source: The source address of mail redirect. + :type source: ``str`` + + :param zone: Zone to list redirects for. + :type zone: :class:`Zone` + + :rtype: ``list`` of :class:`MailRedirect` + """ + r_json = {"destination_address": destination, "source_address": source} + r_data = json.dumps({"zone_mail_redirect": r_json}) + try: + response = self.connection.request( + "/zones/%s/mail_redirects" % zone.id, method="POST", data=r_data + ) + except (BaseHTTPError, MalformedResponseError) as e: + raise PointDNSException(value=e.message, http_code=e.code, driver=self) + mail_redirect = self._to_mail_redirect(response.object, zone=zone) + return mail_redirect + + def ex_get_redirect(self, zone_id, redirect_id): + """ + :param zone: Zone to list redirects for. + :type zone: :class:`Zone` + + :param redirect_id: Redirect id. + :type redirect_id: ``str`` + + :rtype: ``list`` of :class:`Redirect` + """ + try: + response = self.connection.request( + "/zones/{}/redirects/{}".format(zone_id, redirect_id) + ) + except (BaseHTTPError, MalformedResponseError) as e: + if isinstance(e, MalformedResponseError) and e.body == "Not found": + raise PointDNSException( + value="Couldn't found redirect", + http_code=httplib.NOT_FOUND, + driver=self, + ) + raise PointDNSException(value=e.message, http_code=e.code, driver=self) + redirect = self._to_redirect(response.object, zone_id=zone_id) + return redirect + + def ex_get_mail_redirects(self, zone_id, mail_r_id): + """ + :param zone: Zone to list redirects for. + :type zone: :class:`Zone` + + :param mail_r_id: Mail redirect id. + :type mail_r_id: ``str`` + + :rtype: ``list`` of :class:`MailRedirect` + """ + try: + response = self.connection.request( + "/zones/{}/mail_redirects/{}".format(zone_id, mail_r_id) + ) + except (BaseHTTPError, MalformedResponseError) as e: + if isinstance(e, MalformedResponseError) and e.body == "Not found": + raise PointDNSException( + value="Couldn't found mail redirect", + http_code=httplib.NOT_FOUND, + driver=self, + ) + raise PointDNSException(value=e.message, http_code=e.code, driver=self) + mail_redirect = self._to_mail_redirect(response.object, zone_id=zone_id) + return mail_redirect + + def ex_update_redirect( + self, redirect, redirect_to=None, name=None, type=None, iframe=None, query=None + ): + """ + :param redirect: Record to update + :type id: :class:`Redirect` + + :param redirect_to: The data field. (optional). + :type redirect_to: ``str`` + + :param name: The FQDN for the record. + :type name: ``str`` + + :param type: The type of redirects 301, 302 or 0 for iframes. + (optional). + :type type: ``str`` + + :param iframe: Title of iframe (optional). + :type iframe: ``str`` + + :param query: boolean Information about including query string when + redirecting. (optional). + :type query: ``bool`` + + :rtype: ``list`` of :class:`Redirect` + """ + zone_id = redirect.zone.id + r_json = {} + if redirect_to is not None: + r_json["redirect_to"] = redirect_to + if name is not None: + r_json["name"] = name + if type is not None: + r_json["record_type"] = type + if iframe is not None: + r_json["iframe_title"] = iframe + if query is not None: + r_json["redirect_query_string"] = query + r_data = json.dumps({"zone_redirect": r_json}) + try: + response = self.connection.request( + "/zones/{}/redirects/{}".format(zone_id, redirect.id), + method="PUT", + data=r_data, + ) + except (BaseHTTPError, MalformedResponseError) as e: + if isinstance(e, MalformedResponseError) and e.body == "Not found": + raise PointDNSException( + value="Couldn't found redirect", + http_code=httplib.NOT_FOUND, + driver=self, + ) + raise PointDNSException(value=e.message, http_code=e.code, driver=self) + redirect = self._to_redirect(response.object, zone=redirect.zone) + return redirect + + def ex_update_mail_redirect(self, mail_r, destination, source=None): + """ + :param mail_r: Mail redirect to update + :type mail_r: :class:`MailRedirect` + + :param destination: The destination address of mail redirect. + :type destination: ``str`` + + :param source: The source address of mail redirect. (optional) + :type source: ``str`` + + :rtype: ``list`` of :class:`MailRedirect` + """ + zone_id = mail_r.zone.id + r_json = {"destination_address": destination} + if source is not None: + r_json["source_address"] = source + r_data = json.dumps({"zone_redirect": r_json}) + try: + response = self.connection.request( + "/zones/{}/mail_redirects/{}".format(zone_id, mail_r.id), + method="PUT", + data=r_data, + ) + except (BaseHTTPError, MalformedResponseError) as e: + if isinstance(e, MalformedResponseError) and e.body == "Not found": + raise PointDNSException( + value="Couldn't found mail redirect", + http_code=httplib.NOT_FOUND, + driver=self, + ) + raise PointDNSException(value=e.message, http_code=e.code, driver=self) + mail_redirect = self._to_mail_redirect(response.object, zone=mail_r.zone) + return mail_redirect + + def ex_delete_redirect(self, redirect): + """ + :param mail_r: Redirect to delete + :type mail_r: :class:`Redirect` + + :rtype: ``bool`` + """ + zone_id = redirect.zone.id + redirect_id = redirect.id + try: + self.connection.request( + "/zones/{}/redirects/{}".format(zone_id, redirect_id), method="DELETE" + ) + except (BaseHTTPError, MalformedResponseError) as e: + if isinstance(e, MalformedResponseError) and e.body == "Not found": + raise PointDNSException( + value="Couldn't found redirect", + http_code=httplib.NOT_FOUND, + driver=self, + ) + raise PointDNSException(value=e.message, http_code=e.code, driver=self) + return True + + def ex_delete_mail_redirect(self, mail_r): + """ + :param mail_r: Mail redirect to update + :type mail_r: :class:`MailRedirect` + + :rtype: ``bool`` + """ + zone_id = mail_r.zone.id + mail_r_id = mail_r.id + try: + self.connection.request( + "/zones/{}/mail_redirects/{}".format(zone_id, mail_r_id), method="DELETE" + ) + except (BaseHTTPError, MalformedResponseError) as e: + if isinstance(e, MalformedResponseError) and e.body == "Not found": + raise PointDNSException( + value="Couldn't found mail redirect", + http_code=httplib.NOT_FOUND, + driver=self, + ) + raise PointDNSException(value=e.message, http_code=e.code, driver=self) + return True + + def _to_zones(self, data): + zones = [] + for zone in data: + _zone = self._to_zone(zone) + zones.append(_zone) + + return zones + + def _to_zone(self, data): + zone = data.get("zone") + id = zone.get("id") + name = zone.get("name") + ttl = zone.get("ttl") + extra = {"group": zone.get("group"), "user-id": zone.get("user-id")} + + # All zones are a primary ones by design, so they + # assume that are the master source of info about the + # zone, which is the case when domain DNS records + # points to PointDNS nameservers. + type = "master" + + return Zone(id=id, domain=name, type=type, ttl=ttl, driver=self, extra=extra) + + def _to_records(self, data, zone): + records = [] + for item in data: + record = self._to_record(item, zone=zone) + records.append(record) + return records + + def _to_record(self, data, zone_id=None, zone=None): + if not zone: # We need zone_id or zone + zone = self.get_zone(zone_id) + record = data.get("zone_record") + id = record.get("id") + name = record.get("name") + type = record.get("record_type") + data = record.get("data") + extra = { + "ttl": record.get("ttl"), + "zone_id": record.get("zone_id"), + "aux": record.get("aux"), + } + return Record( + id=id, + name=name, + type=type, + data=data, + zone=zone, + driver=self, + ttl=record.get("ttl", None), + extra=extra, + ) + + def _to_redirects(self, data, zone): + redirects = [] + for item in data: + redirect = self._to_redirect(item, zone=zone) + redirects.append(redirect) + return redirects + + def _to_redirect(self, data, zone_id=None, zone=None): + if not zone: # We need zone_id or zone + zone = self.get_zone(zone_id) + record = data.get("zone_redirect") + id = record.get("id") + name = record.get("name") + redirect_to = record.get("redirect_to") + type = record.get("redirect_type") + iframe = record.get("iframe_title") + query = record.get("redirect_query_string") + return Redirect(id, name, redirect_to, type, self, zone, iframe=iframe, query=query) + + def _to_mail_redirects(self, data, zone): + mail_redirects = [] + for item in data: + mail_redirect = self._to_mail_redirect(item, zone=zone) + mail_redirects.append(mail_redirect) + return mail_redirects + + def _to_mail_redirect(self, data, zone_id=None, zone=None): + if not zone: # We need zone_id or zone + zone = self.get_zone(zone_id) + record = data.get("zone_mail_redirect") + id = record.get("id") + destination = record.get("destination_address") + source = record.get("source_address") + return MailRedirect(id, source, destination, zone, self) diff --git a/libcloud/dns/drivers/powerdns.py b/libcloud/dns/drivers/powerdns.py new file mode 100644 index 0000000000..4268087e55 --- /dev/null +++ b/libcloud/dns/drivers/powerdns.py @@ -0,0 +1,553 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License.You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +PowerDNS Driver +""" + +import json + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import Provider, RecordType, ZoneDoesNotExistError, ZoneAlreadyExistsError +from libcloud.utils.py3 import httplib +from libcloud.common.base import JsonResponse, ConnectionKey +from libcloud.common.types import InvalidCredsError, MalformedResponseError +from libcloud.common.exceptions import BaseHTTPError + +__all__ = [ + "PowerDNSDriver", +] + + +class PowerDNSResponse(JsonResponse): + def success(self): + i = int(self.status) + return 200 <= i <= 299 + + def parse_error(self): + if self.status == httplib.UNAUTHORIZED: + raise InvalidCredsError("Invalid provider credentials") + + try: + body = self.parse_body() + except MalformedResponseError as e: + body = "{}: {}".format(e.value, e.body) + try: + errors = [body["error"]] + except TypeError: + # parse_body() gave us a simple string, not a dict. + return "%s (HTTP Code: %d)" % (body, self.status) + try: + errors.append(body["errors"]) + except KeyError: + # The PowerDNS API does not return the "errors" list all the time. + pass + + return "%s (HTTP Code: %d)" % (" ".join(errors), self.status) + + +class PowerDNSConnection(ConnectionKey): + responseCls = PowerDNSResponse + + def add_default_headers(self, headers): + headers["X-API-Key"] = self.key + return headers + + +class PowerDNSDriver(DNSDriver): + type = Provider.POWERDNS + name = "PowerDNS" + website = "https://www.powerdns.com/" + connectionCls = PowerDNSConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.AFSDB: "AFSDB", + RecordType.CERT: "CERT", + RecordType.CNAME: "CNAME", + RecordType.DNSKEY: "DNSKEY", + RecordType.DS: "DS", + RecordType.HINFO: "HINFO", + RecordType.KEY: "KEY", + RecordType.LOC: "LOC", + RecordType.MX: "MX", + RecordType.NAPTR: "NAPTR", + RecordType.NS: "NS", + RecordType.NSEC: "NSEC", + RecordType.OPENPGPKEY: "OPENPGPKEY", + RecordType.PTR: "PTR", + RecordType.RP: "RP", + RecordType.RRSIG: "RRSIG", + RecordType.SOA: "SOA", + RecordType.SPF: "SPF", + RecordType.SSHFP: "SSHFP", + RecordType.SRV: "SRV", + RecordType.TLSA: "TLSA", + RecordType.TXT: "TXT", + } + + def __init__( + self, + key, + secret=None, + secure=False, + host=None, + port=None, + api_version="experimental", + **kwargs, + ): + """ + PowerDNS Driver defaulting to using PowerDNS 3.x API (ie + "experimental"). + + :param key: API key or username to used (required) + :type key: ``str`` + + :param secure: Whether to use HTTPS or HTTP. Note: Off by default + for PowerDNS. + :type secure: ``bool`` + + :param host: Hostname used for connections. + :type host: ``str`` + + :param port: Port used for connections. + :type port: ``int`` + + :param api_version: Specifies the API version to use. + ``experimental`` and ``v1`` are the only valid + options. Defaults to using ``experimental`` + (optional) + :type api_version: ``str`` + + :return: ``None`` + """ + # libcloud doesn't really have a concept of "servers". We'll just use + # localhost for now. + self.ex_server = "localhost" + + if api_version == "experimental": + # PowerDNS 3.x has no API root prefix. + self.api_root = "" + elif api_version == "v1": + # PowerDNS 4.x has an '/api/v1' root prefix. + self.api_root = "/api/v1" + else: + raise NotImplementedError("Unsupported API version: %s" % api_version) + + super().__init__(key=key, secure=secure, host=host, port=port, **kwargs) + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a new record. + + There are two PowerDNS-specific quirks here. Firstly, this method will + silently clobber any pre-existing records that might already exist. For + example, if PowerDNS already contains a "test.example.com" A record, + and you create that record using this function, then the old A record + will be replaced with your new one. + + Secondly, PowerDNS requires that you provide a ttl for all new records. + In other words, the "extra" parameter must be ``{'ttl': + }`` at a minimum. + + :param name: FQDN of the new record, for example "www.example.com". + :type name: ``str`` + + :param zone: Zone where the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: Extra attributes (driver specific, e.g. 'ttl'). + Note that PowerDNS *requires* a ttl value for every + record. + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + extra = extra or {} + + action = "{}/servers/{}/zones/{}".format(self.api_root, self.ex_server, zone.id) + if extra is None or extra.get("ttl", None) is None: + raise ValueError("PowerDNS requires a ttl value for every record") + + if self._pdns_version() == 3: + record = { + "content": data, + "disabled": False, + "name": name, + "ttl": extra["ttl"], + "type": type, + } + payload = { + "rrsets": [ + { + "name": name, + "type": type, + "changetype": "REPLACE", + "records": [record], + } + ] + } + elif self._pdns_version() == 4: + record = { + "content": data, + "disabled": extra.get("disabled", False), + "set-ptr": False, + } + payload = { + "rrsets": [ + { + "name": name, + "type": type, + "changetype": "REPLACE", + "ttl": extra["ttl"], + "records": [record], + } + ] + } + + if "comment" in extra: + payload["rrsets"][0]["comments"] = extra["comment"] + + try: + self.connection.request(action=action, data=json.dumps(payload), method="PATCH") + except BaseHTTPError as e: + if e.code == httplib.UNPROCESSABLE_ENTITY and e.message.startswith( + "Could not find domain" + ): + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + raise e + return Record( + id=None, + name=name, + data=data, + type=type, + zone=zone, + driver=self, + ttl=extra["ttl"], + ) + + def create_zone(self, domain, type=None, ttl=None, extra={}): + """ + Create a new zone. + + There are two PowerDNS-specific quirks here. Firstly, the "type" and + "ttl" parameters are ignored (no-ops). The "type" parameter is simply + not implemented, and PowerDNS does not have an ability to set a + zone-wide default TTL. (TTLs must be set per-record.) + + Secondly, PowerDNS requires that you provide a list of nameservers for + the zone upon creation. In other words, the "extra" parameter must be + ``{'nameservers': ['ns1.example.org']}`` at a minimum. + + :param name: Zone domain name (e.g. example.com) + :type name: ``str`` + + :param domain: Zone type (master / slave). (optional). Note that the + PowerDNS driver does nothing with this parameter. + :type domain: :class:`Zone` + + :param ttl: TTL for new records. (optional). Note that the PowerDNS + driver does nothing with this parameter. + :type ttl: ``int`` + + :param extra: Extra attributes (driver specific). + For example, specify + ``extra={'nameservers': ['ns1.example.org']}`` to set + a list of nameservers for this new zone. + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + action = "{}/servers/{}/zones".format(self.api_root, self.ex_server) + if extra is None or extra.get("nameservers", None) is None: + msg = "PowerDNS requires a list of nameservers for every new zone" + raise ValueError(msg) + payload = {"name": domain, "kind": "Native"} + payload.update(extra) + zone_id = domain + "." + try: + self.connection.request(action=action, data=json.dumps(payload), method="POST") + except BaseHTTPError as e: + if e.code == httplib.UNPROCESSABLE_ENTITY and e.message.startswith( + "Domain '%s' already exists" % domain + ): + raise ZoneAlreadyExistsError(zone_id=zone_id, driver=self, value=e.message) + raise e + return Zone(id=zone_id, domain=domain, type=None, ttl=None, driver=self, extra=extra) + + def delete_record(self, record): + """ + Use this method to delete a record. + + :param record: record to delete + :type record: `Record` + + :rtype: ``bool`` + """ + action = "{}/servers/{}/zones/{}".format( + self.api_root, + self.ex_server, + record.zone.id, + ) + payload = {"rrsets": [{"name": record.name, "type": record.type, "changetype": "DELETE"}]} + try: + self.connection.request(action=action, data=json.dumps(payload), method="PATCH") + except BaseHTTPError: + # I'm not sure if we should raise a ZoneDoesNotExistError here. The + # base DNS API only specifies that we should return a bool. So, + # let's ignore this code for now. + # if e.code == httplib.UNPROCESSABLE_ENTITY and \ + # e.message.startswith('Could not find domain'): + # raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, + # value=e.message) + # raise e + return False + return True + + def delete_zone(self, zone): + """ + Use this method to delete a zone. + + :param zone: zone to delete + :type zone: `Zone` + + :rtype: ``bool`` + """ + action = "{}/servers/{}/zones/{}".format(self.api_root, self.ex_server, zone.id) + try: + self.connection.request(action=action, method="DELETE") + except BaseHTTPError: + # I'm not sure if we should raise a ZoneDoesNotExistError here. The + # base DNS API only specifies that we should return a bool. So, + # let's ignore this code for now. + # if e.code == httplib.UNPROCESSABLE_ENTITY and \ + # e.message.startswith('Could not find domain'): + # raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, + # value=e.message) + # raise e + return False + return True + + def get_zone(self, zone_id): + """ + Return a Zone instance. + + (Note that PowerDNS does not support per-zone TTL defaults, so all Zone + objects will have ``ttl=None``.) + + :param zone_id: name of the required zone with the trailing period, for + example "example.com.". + :type zone_id: ``str`` + + :rtype: :class:`Zone` + :raises: ZoneDoesNotExistError: If no zone could be found. + """ + action = "{}/servers/{}/zones/{}".format(self.api_root, self.ex_server, zone_id) + try: + response = self.connection.request(action=action, method="GET") + except BaseHTTPError as e: + if e.code == httplib.UNPROCESSABLE_ENTITY: + raise ZoneDoesNotExistError(zone_id=zone_id, driver=self, value=e.message) + raise e + return self._to_zone(response.object) + + def list_records(self, zone): + """ + Return a list of all records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + action = "{}/servers/{}/zones/{}".format(self.api_root, self.ex_server, zone.id) + try: + response = self.connection.request(action=action, method="GET") + except BaseHTTPError as e: + if e.code == httplib.UNPROCESSABLE_ENTITY and e.message.startswith( + "Could not find domain" + ): + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + raise e + return self._to_records(response, zone) + + def list_zones(self): + """ + Return a list of zones. + + :return: ``list`` of :class:`Zone` + """ + action = "{}/servers/{}/zones".format(self.api_root, self.ex_server) + response = self.connection.request(action=action, method="GET") + return self._to_zones(response) + + def update_record(self, record, name, type, data, extra=None): + """ + Update an existing record. + + :param record: Record to update. + :type record: :class:`Record` + + :param name: FQDN of the new record, for example "www.example.com". + :type name: ``str`` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: (optional) Extra attributes (driver specific). + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + action = "{}/servers/{}/zones/{}".format( + self.api_root, + self.ex_server, + record.zone.id, + ) + if extra is None or extra.get("ttl", None) is None: + raise ValueError("PowerDNS requires a ttl value for every record") + + if self._pdns_version() == 3: + updated_record = { + "content": data, + "disabled": False, + "name": name, + "ttl": extra["ttl"], + "type": type, + } + payload = { + "rrsets": [ + {"name": record.name, "type": record.type, "changetype": "DELETE"}, + { + "name": name, + "type": type, + "changetype": "REPLACE", + "records": [updated_record], + }, + ] + } + elif self._pdns_version() == 4: + disabled = False + if "disabled" in extra: + disabled = extra["disabled"] + updated_record = { + "content": data, + "disabled": disabled, + "set-ptr": False, + } + payload = { + "rrsets": [ + { + "name": name, + "type": type, + "changetype": "REPLACE", + "ttl": extra["ttl"], + "records": [updated_record], + } + ] + } + + if "comment" in extra: + payload["rrsets"][0]["comments"] = extra["comment"] + + try: + self.connection.request(action=action, data=json.dumps(payload), method="PATCH") + except BaseHTTPError as e: + if e.code == httplib.UNPROCESSABLE_ENTITY and e.message.startswith( + "Could not find domain" + ): + raise ZoneDoesNotExistError(zone_id=record.zone.id, driver=self, value=e.message) + raise e + return Record( + id=None, + name=name, + data=data, + type=type, + zone=record.zone, + driver=self, + ttl=extra["ttl"], + ) + + def _to_zone(self, item): + extra = {} + for e in [ + "kind", + "dnssec", + "account", + "masters", + "serial", + "notified_serial", + "last_check", + ]: + extra[e] = item[e] + # XXX: we have to hard-code "ttl" to "None" here because PowerDNS does + # not support per-zone ttl defaults. However, I don't know what "type" + # should be; probably not None. + return Zone( + id=item["id"], + domain=item["name"], + type=None, + ttl=None, + driver=self, + extra=extra, + ) + + def _to_zones(self, items): + zones = [] + for item in items.object: + zones.append(self._to_zone(item)) + return zones + + def _to_record(self, item, zone, record=None): + if record is None: + data = item["content"] + else: + data = record["content"] + return Record( + id=None, + name=item["name"], + data=data, + type=item["type"], + zone=zone, + driver=self, + ttl=item["ttl"], + ) + + def _to_records(self, items, zone): + records = [] + if self._pdns_version() == 3: + for item in items.object["records"]: + records.append(self._to_record(item, zone)) + elif self._pdns_version() == 4: + for item in items.object["rrsets"]: + for record in item["records"]: + records.append(self._to_record(item, zone, record)) + return records + + def _pdns_version(self): + if self.api_root == "": + return 3 + elif self.api_root == "/api/v1": + return 4 + + raise ValueError("PowerDNS version has not been declared") diff --git a/libcloud/dns/drivers/rackspace.py b/libcloud/dns/drivers/rackspace.py index abdb273362..e0edd9c53d 100644 --- a/libcloud/dns/drivers/rackspace.py +++ b/libcloud/dns/drivers/rackspace.py @@ -12,29 +12,23 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from libcloud.common.openstack import OpenStackDriverMixin - -__all__ = [ - 'RackspaceUSDNSDriver', - 'RackspaceUKDNSDriver' -] - -from libcloud.utils.py3 import httplib import copy +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import Provider, RecordType, ZoneDoesNotExistError, RecordDoesNotExistError +from libcloud.utils.py3 import httplib +from libcloud.utils.misc import get_new_obj, merge_valid_keys from libcloud.common.base import PollingConnection from libcloud.common.types import LibcloudError -from libcloud.utils.misc import merge_valid_keys, get_new_obj +from libcloud.common.openstack import OpenStackDriverMixin from libcloud.common.rackspace import AUTH_URL -from libcloud.compute.drivers.openstack import OpenStack_1_1_Connection -from libcloud.compute.drivers.openstack import OpenStack_1_1_Response +from libcloud.common.exceptions import BaseHTTPError +from libcloud.compute.drivers.openstack import OpenStack_1_1_Response, OpenStack_1_1_Connection -from libcloud.dns.types import Provider, RecordType -from libcloud.dns.types import ZoneDoesNotExistError, RecordDoesNotExistError -from libcloud.dns.base import DNSDriver, Zone, Record +__all__ = ["RackspaceDNSResponse", "RackspaceDNSConnection"] -VALID_ZONE_EXTRA_PARAMS = ['email', 'comment', 'ns1'] -VALID_RECORD_EXTRA_PARAMS = ['ttl', 'comment', 'priority'] +VALID_ZONE_EXTRA_PARAMS = ["email", "comment", "ns1"] +VALID_RECORD_EXTRA_PARAMS = ["ttl", "comment", "priority", "created", "updated"] class RackspaceDNSResponse(OpenStack_1_1_Response): @@ -48,23 +42,20 @@ def parse_error(self): body = self.parse_body() if status == httplib.NOT_FOUND: - if context['resource'] == 'zone': - raise ZoneDoesNotExistError(value='', driver=self, - zone_id=context['id']) - elif context['resource'] == 'record': - raise RecordDoesNotExistError(value='', driver=self, - record_id=context['id']) + if context["resource"] == "zone": + raise ZoneDoesNotExistError(value="", driver=self, zone_id=context["id"]) + elif context["resource"] == "record": + raise RecordDoesNotExistError(value="", driver=self, record_id=context["id"]) if body: - if 'code' and 'message' in body: - err = '%s - %s (%s)' % (body['code'], body['message'], - body['details']) + if "code" and "message" in body: + err = "{} - {} ({})".format(body["code"], body["message"], body["details"]) return err - elif 'validationErrors' in body: - errors = [m for m in body['validationErrors']['messages']] - err = 'Validation errors: %s' % ', '.join(errors) + elif "validationErrors" in body: + errors = [m for m in body["validationErrors"]["messages"]] + err = "Validation errors: %s" % ", ".join(errors) return err - raise LibcloudError('Unexpected status code: %s' % (status)) + raise LibcloudError("Unexpected status code: %s" % (status)) class RackspaceDNSConnection(OpenStack_1_1_Connection, PollingConnection): @@ -78,97 +69,120 @@ class RackspaceDNSConnection(OpenStack_1_1_Connection, PollingConnection): timeout = 30 auth_url = AUTH_URL - _auth_version = '2.0' + _auth_version = "2.0" def __init__(self, *args, **kwargs): - self.region = kwargs.pop('region', None) - super(RackspaceDNSConnection, self).__init__(*args, **kwargs) + self.region = kwargs.pop("region", None) + super().__init__(*args, **kwargs) def get_poll_request_kwargs(self, response, context, request_kwargs): - job_id = response.object['jobId'] - kwargs = {'action': '/status/%s' % (job_id), - 'params': {'showDetails': True}} + job_id = response.object["jobId"] + kwargs = {"action": "/status/%s" % (job_id), "params": {"showDetails": True}} return kwargs def has_completed(self, response): - status = response.object['status'] - if status == 'ERROR': - data = response.object['error'] - - if 'code' and 'message' in data: - message = '%s - %s (%s)' % (data['code'], data['message'], - data['details']) + status = response.object["status"] + if status == "ERROR": + data = response.object["error"] + + if "code" and "message" in data: + message = "{} - {} ({})".format( + data["code"], + data["message"], + data["details"], + ) else: - message = data['message'] + message = data["message"] - raise LibcloudError(message, - driver=self.driver) + raise LibcloudError(message, driver=self.driver) - return status == 'COMPLETED' + return status == "COMPLETED" def get_endpoint(self): - if '2.0' in self._auth_version: - ep = self.service_catalog.get_endpoint(name='cloudDNS', - service_type='rax:dns', - region=None) + if "2.0" in self._auth_version: + ep = self.service_catalog.get_endpoint( + name="cloudDNS", service_type="rax:dns", region=None + ) else: - raise LibcloudError("Auth version %s not supported" % - (self._auth_version)) + raise LibcloudError("Auth version %s not supported" % (self._auth_version)) public_url = ep.url # This is a nasty hack, but because of how global auth and old accounts # work, there is no way around it. - if self.region == 'us': + if self.region == "us": # Old UK account, which only has us endpoint in the catalog - public_url = public_url.replace('https://lon.dns.api', - 'https://dns.api') - if self.region == 'uk': + public_url = public_url.replace("https://lon.dns.api", "https://dns.api") + if self.region == "uk": # Old US account, which only has uk endpoint in the catalog - public_url = public_url.replace('https://dns.api', - 'https://lon.dns.api') + public_url = public_url.replace("https://dns.api", "https://lon.dns.api") return public_url +class RackspacePTRRecord: + def __init__(self, id, ip, domain, driver, extra=None): + self.id = str(id) if id else None + self.ip = ip + self.type = RecordType.PTR + self.domain = domain + self.driver = driver + self.extra = extra or {} + + def update(self, domain, extra=None): + return self.driver.ex_update_ptr_record(record=self, domain=domain, extra=extra) + + def delete(self): + return self.driver.ex_delete_ptr_record(record=self) + + def __repr__(self): + return "<{}: ip={}, domain={}, provider={} ...>".format( + self.__class__.__name__, + self.ip, + self.domain, + self.driver.name, + ) + + class RackspaceDNSDriver(DNSDriver, OpenStackDriverMixin): - name = 'Rackspace DNS' - website = 'http://www.rackspace.com/' + name = "Rackspace DNS" + website = "http://www.rackspace.com/" type = Provider.RACKSPACE connectionCls = RackspaceDNSConnection - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region='us', **kwargs): - if region not in ['us', 'uk']: - raise ValueError('Invalid region: %s' % (region)) + def __init__(self, key, secret=None, secure=True, host=None, port=None, region="us", **kwargs): + valid_regions = self.list_regions() + if region not in valid_regions: + raise ValueError("Invalid region: %s" % (region)) OpenStackDriverMixin.__init__(self, **kwargs) - super(RackspaceDNSDriver, self).__init__(key=key, secret=secret, - host=host, port=port, - region=region) + super().__init__(key=key, secret=secret, host=host, port=port, region=region) RECORD_TYPE_MAP = { - RecordType.A: 'A', - RecordType.AAAA: 'AAAA', - RecordType.CNAME: 'CNAME', - RecordType.MX: 'MX', - RecordType.NS: 'NS', - RecordType.PTR: 'PTR', - RecordType.SRV: 'SRV', - RecordType.TXT: 'TXT', + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.PTR: "PTR", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", } + @classmethod + def list_regions(cls): + return ["us", "uk"] + def iterate_zones(self): offset = 0 limit = 100 while True: params = { - 'limit': limit, - 'offset': offset, + "limit": limit, + "offset": offset, } - response = self.connection.request( - action='/domains', params=params).object - zones_list = response['domains'] + response = self.connection.request(action="/domains", params=params).object + zones_list = response["domains"] for item in zones_list: yield self._to_zone(item) @@ -178,19 +192,20 @@ def iterate_zones(self): break def iterate_records(self, zone): - self.connection.set_context({'resource': 'zone', 'id': zone.id}) + self.connection.set_context({"resource": "zone", "id": zone.id}) offset = 0 limit = 100 while True: params = { - 'showRecord': True, - 'limit': limit, - 'offset': offset, + "showRecord": True, + "limit": limit, + "offset": offset, } response = self.connection.request( - action='/domains/%s' % (zone.id), params=params).object - records_list = response['recordsList'] - records = records_list['records'] + action="/domains/%s" % (zone.id), params=params + ).object + records_list = response["recordsList"] + records = records_list["records"] for item in records: record = self._to_record(data=item, zone=zone) yield record @@ -201,39 +216,42 @@ def iterate_records(self, zone): break def get_zone(self, zone_id): - self.connection.set_context({'resource': 'zone', 'id': zone_id}) - response = self.connection.request(action='/domains/%s' % (zone_id)) + self.connection.set_context({"resource": "zone", "id": zone_id}) + response = self.connection.request(action="/domains/%s" % (zone_id)) zone = self._to_zone(data=response.object) return zone def get_record(self, zone_id, record_id): zone = self.get_zone(zone_id=zone_id) - self.connection.set_context({'resource': 'record', 'id': record_id}) - response = self.connection.request(action='/domains/%s/records/%s' % - (zone_id, record_id)).object + self.connection.set_context({"resource": "record", "id": record_id}) + response = self.connection.request( + action="/domains/{}/records/{}".format(zone_id, record_id) + ).object record = self._to_record(data=response, zone=zone) return record - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type="master", ttl=None, extra=None): extra = extra if extra else {} # Email address is required - if 'email' not in extra: + if "email" not in extra: raise ValueError('"email" key must be present in extra dictionary') - payload = {'name': domain, 'emailAddress': extra['email'], - 'recordsList': {'records': []}} + payload = { + "name": domain, + "emailAddress": extra["email"], + "recordsList": {"records": []}, + } if ttl: - payload['ttl'] = ttl + payload["ttl"] = ttl - if 'comment' in extra: - payload['comment'] = extra['comment'] + if "comment" in extra: + payload["comment"] = extra["comment"] - data = {'domains': [payload]} - response = self.connection.async_request(action='/domains', - method='POST', data=data) - zone = self._to_zone(data=response.object['response']['domains'][0]) + data = {"domains": [payload]} + response = self.connection.async_request(action="/domains", method="POST", data=data) + zone = self._to_zone(data=response.object["response"]["domains"][0]) return zone def update_zone(self, zone, domain=None, type=None, ttl=None, extra=None): @@ -241,32 +259,32 @@ def update_zone(self, zone, domain=None, type=None, ttl=None, extra=None): extra = extra if extra else {} if domain: - raise LibcloudError('Domain cannot be changed', driver=self) + raise LibcloudError("Domain cannot be changed", driver=self) data = {} if ttl: - data['ttl'] = int(ttl) + data["ttl"] = int(ttl) - if 'email' in extra: - data['emailAddress'] = extra['email'] + if "email" in extra: + data["emailAddress"] = extra["email"] - if 'comment' in extra: - data['comment'] = extra['comment'] + if "comment" in extra: + data["comment"] = extra["comment"] type = type if type else zone.type ttl = ttl if ttl else zone.ttl - self.connection.set_context({'resource': 'zone', 'id': zone.id}) - self.connection.async_request(action='/domains/%s' % (zone.id), - method='PUT', data=data) - merged = merge_valid_keys(params=copy.deepcopy(zone.extra), - valid_keys=VALID_ZONE_EXTRA_PARAMS, - extra=extra) - updated_zone = get_new_obj(obj=zone, klass=Zone, - attributes={'type': type, - 'ttl': ttl, - 'extra': merged}) + self.connection.set_context({"resource": "zone", "id": zone.id}) + self.connection.async_request(action="/domains/%s" % (zone.id), method="PUT", data=data) + merged = merge_valid_keys( + params=copy.deepcopy(zone.extra), + valid_keys=VALID_ZONE_EXTRA_PARAMS, + extra=extra, + ) + updated_zone = get_new_obj( + obj=zone, klass=Zone, attributes={"type": type, "ttl": ttl, "extra": merged} + ) return updated_zone def create_record(self, name, zone, type, data, extra=None): @@ -275,105 +293,297 @@ def create_record(self, name, zone, type, data, extra=None): extra = extra if extra else {} name = self._to_full_record_name(domain=zone.domain, name=name) - data = {'name': name, 'type': self.RECORD_TYPE_MAP[type], - 'data': data} - - if 'ttl' in extra: - data['ttl'] = int(extra['ttl']) - - if 'priority' in extra: - data['priority'] = int(extra['priority']) - - payload = {'records': [data]} - self.connection.set_context({'resource': 'zone', 'id': zone.id}) - response = self.connection.async_request(action='/domains/%s/records' - % (zone.id), data=payload, - method='POST').object - record = self._to_record(data=response['response']['records'][0], - zone=zone) + data = {"name": name, "type": self.RECORD_TYPE_MAP[type], "data": data} + + if "ttl" in extra: + data["ttl"] = int(extra["ttl"]) + + if "priority" in extra: + data["priority"] = int(extra["priority"]) + + payload = {"records": [data]} + self.connection.set_context({"resource": "zone", "id": zone.id}) + response = self.connection.async_request( + action="/domains/%s/records" % (zone.id), data=payload, method="POST" + ).object + record = self._to_record(data=response["response"]["records"][0], zone=zone) return record - def update_record(self, record, name=None, type=None, data=None, - extra=None): + def update_record(self, record, name=None, type=None, data=None, extra=None): # Only data, ttl, and comment attributes can be modified, but name # attribute must always be present. extra = extra if extra else {} - name = self._to_full_record_name(domain=record.zone.domain, - name=record.name) - payload = {'name': name} + name = self._to_full_record_name(domain=record.zone.domain, name=record.name) + payload = {"name": name} if data: - payload['data'] = data + payload["data"] = data - if 'ttl' in extra: - payload['ttl'] = extra['ttl'] + if "ttl" in extra: + payload["ttl"] = extra["ttl"] - if 'comment' in extra: - payload['comment'] = extra['comment'] + if "comment" in extra: + payload["comment"] = extra["comment"] type = type if type is not None else record.type data = data if data else record.data - self.connection.set_context({'resource': 'record', 'id': record.id}) - self.connection.async_request(action='/domains/%s/records/%s' % - (record.zone.id, record.id), - method='PUT', data=payload) - - merged = merge_valid_keys(params=copy.deepcopy(record.extra), - valid_keys=VALID_RECORD_EXTRA_PARAMS, - extra=extra) - updated_record = get_new_obj(obj=record, klass=Record, - attributes={'type': type, - 'data': data, - 'driver': self, - 'extra': merged}) + self.connection.set_context({"resource": "record", "id": record.id}) + self.connection.async_request( + action="/domains/{}/records/{}".format(record.zone.id, record.id), + method="PUT", + data=payload, + ) + + merged = merge_valid_keys( + params=copy.deepcopy(record.extra), + valid_keys=VALID_RECORD_EXTRA_PARAMS, + extra=extra, + ) + updated_record = get_new_obj( + obj=record, + klass=Record, + attributes={"type": type, "data": data, "driver": self, "extra": merged}, + ) return updated_record def delete_zone(self, zone): - self.connection.set_context({'resource': 'zone', 'id': zone.id}) - self.connection.async_request(action='/domains/%s' % (zone.id), - method='DELETE') + self.connection.set_context({"resource": "zone", "id": zone.id}) + self.connection.async_request(action="/domains/%s" % (zone.id), method="DELETE") return True def delete_record(self, record): - self.connection.set_context({'resource': 'record', 'id': record.id}) - self.connection.async_request(action='/domains/%s/records/%s' % - (record.zone.id, record.id), - method='DELETE') + self.connection.set_context({"resource": "record", "id": record.id}) + self.connection.async_request( + action="/domains/{}/records/{}".format(record.zone.id, record.id), + method="DELETE", + ) + return True + + def ex_iterate_ptr_records(self, device): + """ + Return a generator to iterate over existing PTR Records. + + The ``device`` should be an instance of one of these: + :class:`libcloud.compute.base.Node` + :class:`libcloud.loadbalancer.base.LoadBalancer` + + And it needs to have the following ``extra`` fields set: + service_name - the service catalog name for the device + uri - the URI pointing to the GET endpoint for the device + + Those are automatically set for you if you got the device from + the Rackspace driver for that service. + + For example: + server = rs_compute.ex_get_node_details(id) + ptr_iter = rs_dns.ex_list_ptr_records(server) + + loadbalancer = rs_lbs.get_balancer(id) + ptr_iter = rs_dns.ex_list_ptr_records(loadbalancer) + + Note: the Rackspace DNS API docs indicate that the device 'href' is + optional, but testing does not bear this out. It throws a + 400 Bad Request error if you do not pass in the 'href' from + the server or loadbalancer. So ``device`` is required. + + :param device: the device that owns the IP + :rtype: ``generator`` of :class:`RackspacePTRRecord` + """ + _check_ptr_extra_fields(device) + params = {"href": device.extra["uri"]} + + service_name = device.extra["service_name"] + + # without a valid context, the 404 on empty list will blow up + # in the error-handling code + self.connection.set_context({"resource": "ptr_records"}) + try: + response = self.connection.request( + action="/rdns/%s" % (service_name), params=params + ).object + records = response["records"] + link = dict(rel=service_name, **params) + for item in records: + record = self._to_ptr_record(data=item, link=link) + yield record + except BaseHTTPError as exc: + # 404 just means empty list + if exc.code == 404: + return + raise + + def ex_get_ptr_record(self, service_name, record_id): + """ + Get a specific PTR record by id. + + :param service_name: the service catalog name of the linked device(s) + i.e. cloudLoadBalancers or cloudServersOpenStack + :param record_id: the id (i.e. PTR-12345) of the PTR record + :rtype: instance of :class:`RackspacePTRRecord` + """ + self.connection.set_context({"resource": "record", "id": record_id}) + response = self.connection.request( + action="/rdns/{}/{}".format(service_name, record_id) + ).object + item = next(iter(response["recordsList"]["records"])) + return self._to_ptr_record(data=item, link=response["link"]) + + def ex_create_ptr_record(self, device, ip, domain, extra=None): + """ + Create a PTR record for a specific IP on a specific device. + + The ``device`` should be an instance of one of these: + :class:`libcloud.compute.base.Node` + :class:`libcloud.loadbalancer.base.LoadBalancer` + + And it needs to have the following ``extra`` fields set: + service_name - the service catalog name for the device + uri - the URI pointing to the GET endpoint for the device + + Those are automatically set for you if you got the device from + the Rackspace driver for that service. + + For example: + server = rs_compute.ex_get_node_details(id) + rs_dns.create_ptr_record(server, ip, domain) + + loadbalancer = rs_lbs.get_balancer(id) + rs_dns.create_ptr_record(loadbalancer, ip, domain) + + :param device: the device that owns the IP + :param ip: the IP for which you want to set reverse DNS + :param domain: the fqdn you want that IP to represent + :param extra: a ``dict`` with optional extra values: + ttl - the time-to-live of the PTR record + :rtype: instance of :class:`RackspacePTRRecord` + """ + _check_ptr_extra_fields(device) + + if extra is None: + extra = {} + + # the RDNS API reverse the name and data fields for PTRs + # the record name *should* be the ip and the data the fqdn + data = {"name": domain, "type": RecordType.PTR, "data": ip} + + if "ttl" in extra: + data["ttl"] = extra["ttl"] + + payload = { + "recordsList": {"records": [data]}, + "link": { + "content": "", + "href": device.extra["uri"], + "rel": device.extra["service_name"], + }, + } + response = self.connection.async_request(action="/rdns", method="POST", data=payload).object + item = next(iter(response["response"]["records"])) + return self._to_ptr_record(data=item, link=payload["link"]) + + def ex_update_ptr_record(self, record, domain=None, extra=None): + """ + Update a PTR record for a specific IP on a specific device. + + If you need to change the domain or ttl, use this API to + update the record by deleting the old one and creating a new one. + + :param record: the original :class:`RackspacePTRRecord` + :param domain: the fqdn you want that IP to represent + :param extra: a ``dict`` with optional extra values: + ttl - the time-to-live of the PTR record + :rtype: instance of :class:`RackspacePTRRecord` + """ + if domain is not None and domain == record.domain: + domain = None + + if extra is not None: + extra = dict(extra) + for key in extra: + if key in record.extra and record.extra[key] == extra[key]: + del extra[key] + + if domain is None and not extra: + # nothing to do, it already matches + return record + + _check_ptr_extra_fields(record) + ip = record.ip + + self.ex_delete_ptr_record(record) + # records have the same metadata in 'extra' as the original device + # so you can pass the original record object in instead + return self.ex_create_ptr_record(record, ip, domain, extra=extra) + + def ex_delete_ptr_record(self, record): + """ + Delete an existing PTR Record + + :param record: the original :class:`RackspacePTRRecord` + :rtype: ``bool`` + """ + _check_ptr_extra_fields(record) + self.connection.set_context({"resource": "record", "id": record.id}) + self.connection.async_request( + action="/rdns/%s" % (record.extra["service_name"]), + method="DELETE", + params={"href": record.extra["uri"], "ip": record.ip}, + ) return True def _to_zone(self, data): - id = data['id'] - domain = data['name'] - type = 'master' - ttl = data.get('ttl', 0) + id = data["id"] + domain = data["name"] + type = "master" + ttl = data.get("ttl", 0) extra = {} - if 'emailAddress' in data: - extra['email'] = data['emailAddress'] + if "emailAddress" in data: + extra["email"] = data["emailAddress"] - if 'comment' in data: - extra['comment'] = data['comment'] + if "comment" in data: + extra["comment"] = data["comment"] - zone = Zone(id=str(id), domain=domain, type=type, ttl=int(ttl), - driver=self, extra=extra) + zone = Zone(id=str(id), domain=domain, type=type, ttl=int(ttl), driver=self, extra=extra) return zone def _to_record(self, data, zone): - id = data['id'] - fqdn = data['name'] + id = data["id"] + fqdn = data["name"] name = self._to_partial_record_name(domain=zone.domain, name=fqdn) - type = self._string_to_record_type(data['type']) - record_data = data['data'] - extra = {'fqdn': fqdn} + type = self._string_to_record_type(data["type"]) + record_data = data["data"] + extra = {"fqdn": fqdn} for key in VALID_RECORD_EXTRA_PARAMS: if key in data: extra[key] = data[key] - record = Record(id=str(id), name=name, type=type, data=record_data, - zone=zone, driver=self, extra=extra) + record = Record( + id=str(id), + name=name, + type=type, + data=record_data, + zone=zone, + driver=self, + ttl=extra.get("ttl", None), + extra=extra, + ) + return record + + def _to_ptr_record(self, data, link): + id = data["id"] + ip = data["data"] + domain = data["name"] + extra = {"uri": link["href"], "service_name": link["rel"]} + + for key in VALID_RECORD_EXTRA_PARAMS: + if key in data: + extra[key] = data[key] + + record = RackspacePTRRecord(id=str(id), ip=ip, domain=domain, driver=self, extra=extra) return record def _to_full_record_name(self, domain, name): @@ -387,7 +597,7 @@ def _to_full_record_name(self, domain, name): :type name: ``str`` """ if name: - name = '%s.%s' % (name, domain) + name = "{}.{}".format(name, domain) else: name = domain @@ -409,33 +619,15 @@ def _to_partial_record_name(self, domain, name): return None # Strip domain portion - name = name.replace('.%s' % (domain), '') + name = name.replace(".%s" % (domain), "") return name def _ex_connection_class_kwargs(self): kwargs = self.openstack_connection_kwargs() - kwargs['region'] = self.region + kwargs["region"] = self.region return kwargs -class RackspaceUSDNSDriver(RackspaceDNSDriver): - name = 'Rackspace DNS (US)' - type = Provider.RACKSPACE_US - - def __init__(self, *args, **kwargs): - kwargs['region'] = 'us' - super(RackspaceUSDNSDriver, self).__init__(*args, **kwargs) - - -class RackspaceUKDNSDriver(RackspaceDNSDriver): - name = 'Rackspace DNS (UK)' - type = Provider.RACKSPACE_UK - - def __init__(self, *args, **kwargs): - kwargs['region'] = 'uk' - super(RackspaceUKDNSDriver, self).__init__(*args, **kwargs) - - def _rackspace_result_has_more(response, result_length, limit): # If rackspace returns less than the limit, then we've reached the end of # the result set. @@ -444,7 +636,21 @@ def _rackspace_result_has_more(response, result_length, limit): # Paginated results return links to the previous and next sets of data, but # 'next' only exists when there is more to get. - for item in response.get('links', ()): - if item['rel'] == 'next': + for item in response.get("links", ()): + if item["rel"] == "next": return True return False + + +def _check_ptr_extra_fields(device_or_record): + if not ( + hasattr(device_or_record, "extra") + and isinstance(device_or_record.extra, dict) + and device_or_record.extra.get("uri") is not None + and device_or_record.extra.get("service_name") is not None + ): + raise LibcloudError( + "Can't create PTR Record for %s because it " + "doesn't have a 'uri' and 'service_name' in " + "'extra'" % device_or_record + ) diff --git a/libcloud/dns/drivers/rcodezero.py b/libcloud/dns/drivers/rcodezero.py new file mode 100644 index 0000000000..90abaa1859 --- /dev/null +++ b/libcloud/dns/drivers/rcodezero.py @@ -0,0 +1,584 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License.You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +RcodeZero DNS Driver +""" + +import re +import json +import hashlib + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import Provider, RecordType, ZoneDoesNotExistError, ZoneAlreadyExistsError +from libcloud.utils.py3 import httplib +from libcloud.common.base import JsonResponse, ConnectionKey +from libcloud.common.types import InvalidCredsError, MalformedResponseError +from libcloud.common.exceptions import BaseHTTPError + +API_HOST = "my.rcodezero.at" + +__all__ = [ + "RcodeZeroDNSDriver", +] + + +class RcodeZeroResponse(JsonResponse): + def success(self): + i = int(self.status) + + return 200 <= i <= 299 + + def parse_error(self): + if self.status == httplib.UNAUTHORIZED: + raise InvalidCredsError("Invalid API key. Check https://my.rcodezero.at/enableapi") + + errors = [] + try: + body = self.parse_body() + except MalformedResponseError as e: + body = "{}: {}".format(e.value, e.body) + try: + errors = [body["message"]] + except TypeError: + return "%s (HTTP Code: %d)" % (body, self.status) + except KeyError: + pass + + return "%s (HTTP Code: %d)" % (" ".join(errors), self.status) + + +class RcodeZeroConnection(ConnectionKey): + responseCls = RcodeZeroResponse + + host = API_HOST + + def add_default_headers(self, headers): + headers["Authorization"] = "Bearer " + self.key + headers["Accept"] = "application/json" + + return headers + + +class RcodeZeroDNSDriver(DNSDriver): + type = Provider.RCODEZERO + name = "RcodeZero DNS" + website = "https://www.rcodezero.at/" + connectionCls = RcodeZeroConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.AFSDB: "AFSDB", + RecordType.ALIAS: "ALIAS", + RecordType.CERT: "CERT", + RecordType.CNAME: "CNAME", + RecordType.DNAME: "DNAME", + RecordType.DNSKEY: "DNSKEY", + RecordType.DS: "DS", + RecordType.HINFO: "HINFO", + RecordType.KEY: "KEY", + RecordType.LOC: "LOC", + RecordType.MX: "MX", + RecordType.NAPTR: "NAPTR", + RecordType.NS: "NS", + RecordType.NSEC: "NSEC", + RecordType.OPENPGPKEY: "OPENPGPKEY", + RecordType.PTR: "PTR", + RecordType.RP: "RP", + RecordType.RRSIG: "RRSIG", + RecordType.SOA: "SOA", + RecordType.SPF: "SPF", + RecordType.SRV: "SRV", + RecordType.SSHFP: "SSHFP", + RecordType.SRV: "SRV", + RecordType.TLSA: "TLSA", + RecordType.TXT: "TXT", + } + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version="v2", + **kwargs, + ): + """ + :param key: API token to be used (required) + :type key: ``str`` + + :param secret: Password to be used, ignored by RcodeZero + :type key: ``str`` + + :param secure: Whether to use HTTPS (default) or HTTP. + :type secure: ``bool`` + + :param host: Hostname used for connections. + :type host: ``str`` + + :param port: Port used for connections. + :type port: ``int`` + + :param api_version: Specifies the API version to use. + ``v1`` is currently the only valid + option (and default) + :type api_version: ``str`` + + :return: ``None`` + """ + + if api_version == "v1": + self.api_root = "/api/v1" + elif api_version == "v2": + self.api_root = "/api/v2" + else: + raise NotImplementedError("Unsupported API version: %s" % api_version) + + super().__init__(key=key, secure=secure, host=host, port=port, **kwargs) + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a new record in a given, existing zone. + + :param name: name of the new record without the domain name, + for example "www". + :type name: ``str`` + + :param zone: Zone in which the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS resource record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depending on the record type). + :type data: ``str`` + + :param extra: Extra attributes: 'ttl', 'disabled' + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + action = "{}/zones/{}/rrsets".format(self.api_root, zone.id) + + payload = self._to_patchrequest(zone.id, None, name, type, data, extra, "add") + + try: + self.connection.request(action=action, data=json.dumps(payload), method="PATCH") + except BaseHTTPError as e: + if e.code == httplib.UNPROCESSABLE_ENTITY and e.message.startswith( + "Could not find domain" + ): + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + raise e + + if extra is not None and extra.get("ttl", None) is not None: + ttl = extra["ttl"] + else: + ttl = None + + return Record(id=None, name=name, data=data, type=type, zone=zone, ttl=ttl, driver=self) + + def create_zone(self, domain, type="master", ttl=None, extra={}): + """ + Create a new zone. + + :param name: Zone domain name (e.g. example.com) + :type name: ``str`` + + :param domain: Zone type ('master' / 'slave'). (required). + :type domain: :class:`Zone` + + :param ttl: TTL for new records. (optional). Ignored by RcodeZero. + RcodeZero uses record specific TTLs. + :type ttl: ``int`` + + :param extra: Extra attributes: 'masters' (for type=slave): + ``extra={'masters': ['193.0.2.2','2001:db8::2']}`` + sets the Master nameservers for a type=slave zone. + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + action = "%s/zones" % (self.api_root) + + if type.lower() == "slave" and (extra is None or extra.get("masters", None) is None): + msg = "Master IPs required for slave zones" + raise ValueError(msg) + payload = {"domain": domain.lower(), "type": type.lower()} + payload.update(extra) + zone_id = domain + "." + try: + self.connection.request(action=action, data=json.dumps(payload), method="POST") + except BaseHTTPError as e: + if e.code == httplib.UNPROCESSABLE_ENTITY and e.message.find( + "Zone '%s' already configured for your account" % domain + ): + raise ZoneAlreadyExistsError(zone_id=zone_id, driver=self, value=e.message) + raise e + + return Zone( + id=zone_id, + domain=domain, + type=type.lower(), + ttl=None, + driver=self, + extra=extra, + ) + + def update_zone(self, zone, domain, type=None, ttl=None, extra=None): + """ + Update an existing zone. + + :param zone: Zone to update. + :type zone: :class:`Zone` + + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type ('master' / 'slave'). + :type type: ``str`` + + :param ttl: not supported. RcodeZero uses RRSet-specific TTLs + :type ttl: ``int`` + + :param extra: Extra attributes: 'masters' (for type=slave) + ``extra={'masters': ['193.0.2.2','2001:db8::2']}`` + sets the Master nameserver addresses for a type=slave zone + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + action = "{}/zones/{}".format(self.api_root, domain) + + if type is None: + type = zone.type + + if type.lower() == "slave" and (extra is None or extra.get("masters", None) is None): + msg = "Master IPs required for slave zones" + raise ValueError(msg) + payload = {"domain": domain.lower(), "type": type.lower()} + + if extra is not None: + payload.update(extra) + try: + self.connection.request(action=action, data=json.dumps(payload), method="PUT") + except BaseHTTPError as e: + if e.code == httplib.UNPROCESSABLE_ENTITY and e.message.startswith( + "Domain '%s' update failed" % domain + ): + raise ZoneAlreadyExistsError(zone_id=zone.id, driver=self, value=e.message) + raise e + + return Zone(id=zone.id, domain=domain, type=type, ttl=None, driver=self, extra=extra) + + def delete_record(self, record): + """ + Delete a record in a given zone. + + :param record: record to delete (record object) + :type record: `Record` + + :rtype: ``bool`` + """ + + action = "{}/zones/{}/rrsets".format(self.api_root, record.zone.id) + + payload = self._to_patchrequest( + record.zone.id, + None, + record.name, + record.type, + record.data, + record.extra, + "delete", + ) + + try: + self.connection.request(action=action, data=json.dumps(payload), method="PATCH") + + except BaseHTTPError as e: + if e.code == httplib.UNPROCESSABLE_ENTITY and e.message.startswith( + "Could not find domain" + ): + raise ZoneDoesNotExistError(zone_id=record.zone.id, driver=self, value=e.message) + raise e + + return True + + def delete_zone(self, zone): + """ + Delete a zone and all its records. + + :param zone: zone to delete + :type zone: `Zone` + + :rtype: ``bool`` + """ + action = "{}/zones/{}".format(self.api_root, zone.id) + try: + self.connection.request(action=action, method="DELETE") + except BaseHTTPError: + return False + + return True + + def get_zone(self, zone_id): + """ + Get a Zone object. + + :param zone_id: name of the zone, for + example "example.com". + :type zone_id: ``str`` + + :rtype: :class:`Zone` + :raises: ZoneDoesNotExistError: if zone could not be found. + """ + action = "{}/zones/{}".format(self.api_root, zone_id) + try: + response = self.connection.request(action=action, method="GET") + except BaseHTTPError as e: + if e.code == httplib.NOT_FOUND: + raise ZoneDoesNotExistError(zone_id=zone_id, driver=self, value=e.message) + raise e + + return self._to_zone(response.object) + + def get_record(self, zone_id, record_id): + """ + Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + records = self.list_records( + Zone(id=zone_id, domain=zone_id, type=None, ttl=None, driver=self, extra=None) + ) + + foundrecords = list(filter(lambda x: x.id == record_id, records)) + + if len(foundrecords) > 0: + return foundrecords[0] + else: + return None + + def list_records(self, zone): + """ + Return a list of all record objects for the given zone. + + :param zone: Zone object to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + action = "{}/zones/{}/rrsets?page_size=-1".format(self.api_root, zone.id) + try: + response = self.connection.request(action=action, method="GET") + except BaseHTTPError as e: + if e.code == httplib.UNPROCESSABLE_ENTITY and e.message.startswith( + "Could not find domain" + ): + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + raise e + + return self._to_records(response.object["data"], zone) + + def list_zones(self): + """ + Return a list of zone objects for this account. + + :return: ``list`` of :class:`Zone` + """ + action = "%s/zones?page_size=-1" % (self.api_root) + response = self.connection.request(action=action, method="GET") + + return self._to_zones(response.object["data"]) + + def update_record(self, record, name, type, data, extra=None): + """ + Update an existing record. + + :param record: Record object to update. + :type record: :class:`Record` + + :param name: name of the new record, for example "www". + :type name: ``str`` + + :param type: DNS resource record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depending on the record type). + :type data: ``str`` + + :param extra: Extra attributes: 'ttl','disabled' (optional) + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + + action = "{}/zones/{}/rrsets".format(self.api_root, record.zone.id) + + payload = self._to_patchrequest( + record.zone.id, record, name, type, data, record.extra, "update" + ) + + try: + self.connection.request(action=action, data=json.dumps(payload), method="PATCH") + + except BaseHTTPError as e: + if e.code == httplib.UNPROCESSABLE_ENTITY and e.message.startswith( + "Could not find domain" + ): + raise ZoneDoesNotExistError(zone_id=record.zone.id, driver=self, value=e.message) + raise e + + if not (extra is None or extra.get("ttl", None) is None): + ttl = extra["ttl"] + else: + ttl = record.ttl + + return Record( + id=hashlib.md5(str(name + " " + data).encode("utf-8")).hexdigest(), # nosec + name=name, + data=data, + type=type, + zone=record.zone, + driver=self, + ttl=ttl, + extra=extra, + ) + + def _to_zone(self, item): + extra = {} + + for e in [ + "dnssec_status", + "dnssec_status_detail", + "dnssec_ksk_status", + "dnssec_ksk_status_detail", + "dnssec_ds", + "dnssec_dnskey", + "dnssec_safe_to_unsign", + "dnssec", + "masters", + "serial", + "created", + "last_check", + ]: + if e in item: + extra[e] = item[e] + + return Zone( + id=item["domain"], + domain=item["domain"], + type=item["type"].lower(), + ttl=None, + driver=self, + extra=extra, + ) + + def _to_zones(self, items): + zones = [] + + for item in items: + zones.append(self._to_zone(item)) + + return zones + + def _to_records(self, items, zone): + records = [] + + for item in items: + for record in item["records"]: + extra = {} + extra["disabled"] = record["disabled"] + # strip domain and trailing dot from recordname + recordname = re.sub("." + zone.id + "$", "", item["name"][:-1]) + records.append( + Record( + id=hashlib.md5( # nosec + str(recordname + " " + record["content"]).encode("utf-8") + ).hexdigest(), + name=recordname, + data=record["content"], + type=item["type"], + zone=zone, + driver=self, + ttl=item["ttl"], + extra=extra, + ) + ) + + return records + + # rcodezero supports only rrset, so we must create rrsets from the given + # record + def _to_patchrequest(self, zone, record, name, type, data, extra, action): + rrset = {} + + cur_records = self.list_records( + Zone(id=zone, domain=None, type=None, ttl=None, driver=self) + ) + + if name != "": + rrset["name"] = name + "." + zone + "." + else: + rrset["name"] = zone + "." + + rrset["type"] = type + rrset["changetype"] = action + rrset["records"] = [] + + if not (extra is None or extra.get("ttl", None) is None): + rrset["ttl"] = extra["ttl"] + + content = {} + + if not action == "delete": + content["content"] = data + + if not (extra is None or extra.get("disabled", None) is None): + content["disabled"] = extra["disabled"] + rrset["records"].append(content) + id = hashlib.md5(str(name + " " + data).encode("utf-8")).hexdigest() # nosec + # check if rrset contains more than one record. if yes we need to create an + # update request + + for r in cur_records: + if action == "update" and r.id == record.id: + # do not include records which should be updated in the update + # request + + continue + + if name == r.name and type == r.type and r.id != id: + # we have other records with the same name and type so make an update + # request + rrset["changetype"] = "update" + content = {} + content["content"] = r.data + + if not (r.extra is None or r.extra.get("disabled", None) is None): + content["disabled"] = r.extra["disabled"] + rrset["records"].append(content) + request = list() + request.append(rrset) + + return request diff --git a/libcloud/dns/drivers/route53.py b/libcloud/dns/drivers/route53.py index fe27f2e1fc..8645710497 100644 --- a/libcloud/dns/drivers/route53.py +++ b/libcloud/dns/drivers/route53.py @@ -13,40 +13,28 @@ # See the License for the specific language governing permissions and # limitations under the License. -__all__ = [ - 'Route53DNSDriver' -] +__all__ = ["Route53DNSDriver"] -import base64 +import copy import hmac -import datetime import uuid -import copy -from libcloud.utils.py3 import httplib - +import base64 +import datetime from hashlib import sha1 -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - -from libcloud.utils.py3 import b, urlencode - -from libcloud.utils.xml import findtext, findall, fixxpath -from libcloud.dns.types import Provider, RecordType -from libcloud.dns.types import ZoneDoesNotExistError, RecordDoesNotExistError -from libcloud.dns.base import DNSDriver, Zone, Record -from libcloud.common.types import LibcloudError -from libcloud.common.aws import AWSGenericResponse +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import Provider, RecordType, ZoneDoesNotExistError, RecordDoesNotExistError +from libcloud.utils.py3 import ET, b, httplib, urlencode +from libcloud.utils.xml import findall, findtext, fixxpath +from libcloud.common.aws import AWSGenericResponse, AWSTokenConnection from libcloud.common.base import ConnectionUserAndKey +from libcloud.common.types import LibcloudError +API_VERSION = "2012-02-29" +API_HOST = "route53.amazonaws.com" +API_ROOT = "/%s/" % (API_VERSION) -API_VERSION = '2012-02-29' -API_HOST = 'route53.amazonaws.com' -API_ROOT = '/%s/' % (API_VERSION) - -NAMESPACE = 'https://%s/doc%s' % (API_HOST, API_ROOT) +NAMESPACE = "https://{}/doc{}".format(API_HOST, API_ROOT) class InvalidChangeBatch(LibcloudError): @@ -59,32 +47,38 @@ class Route53DNSResponse(AWSGenericResponse): """ namespace = NAMESPACE - xpath = 'Error' + xpath = "Error" exceptions = { - 'NoSuchHostedZone': ZoneDoesNotExistError, - 'InvalidChangeBatch': InvalidChangeBatch, + "NoSuchHostedZone": ZoneDoesNotExistError, + "InvalidChangeBatch": InvalidChangeBatch, } -class Route53Connection(ConnectionUserAndKey): +class BaseRoute53Connection(ConnectionUserAndKey): host = API_HOST responseCls = Route53DNSResponse def pre_connect_hook(self, params, headers): - time_string = datetime.datetime.utcnow() \ - .strftime('%a, %d %b %Y %H:%M:%S GMT') - headers['Date'] = time_string + time_string = ( + datetime.datetime.now(datetime.timezone.utc) + .replace(tzinfo=None) + .strftime("%a, %d %b %Y %H:%M:%S GMT") + ) + headers["Date"] = time_string tmp = [] signature = self._get_aws_auth_b64(self.key, time_string) - auth = {'AWSAccessKeyId': self.user_id, 'Signature': signature, - 'Algorithm': 'HmacSHA1'} + auth = { + "AWSAccessKeyId": self.user_id, + "Signature": signature, + "Algorithm": "HmacSHA1", + } for k, v in auth.items(): - tmp.append('%s=%s' % (k, v)) + tmp.append("{}={}".format(k, v)) - headers['X-Amzn-Authorization'] = 'AWS3-HTTPS ' + ','.join(tmp) + headers["X-Amzn-Authorization"] = "AWS3-HTTPS " + ",".join(tmp) return params, headers @@ -93,56 +87,61 @@ def _get_aws_auth_b64(self, secret_key, time_string): hmac.new(b(secret_key), b(time_string), digestmod=sha1).digest() ) - return b64_hmac.decode('utf-8') + return b64_hmac.decode("utf-8") + + +class Route53Connection(AWSTokenConnection, BaseRoute53Connection): + pass class Route53DNSDriver(DNSDriver): type = Provider.ROUTE53 - name = 'Route53 DNS' - website = 'http://aws.amazon.com/route53/' + name = "Route53 DNS" + website = "http://aws.amazon.com/route53/" connectionCls = Route53Connection RECORD_TYPE_MAP = { - RecordType.A: 'A', - RecordType.AAAA: 'AAAA', - RecordType.CNAME: 'CNAME', - RecordType.MX: 'MX', - RecordType.NS: 'NS', - RecordType.PTR: 'PTR', - RecordType.SOA: 'SOA', - RecordType.SPF: 'SPF', - RecordType.SRV: 'SRV', - RecordType.TXT: 'TXT', + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.PTR: "PTR", + RecordType.SOA: "SOA", + RecordType.SPF: "SPF", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", } + def __init__(self, *args, **kwargs): + self.token = kwargs.pop("token", None) + super().__init__(*args, **kwargs) + def iterate_zones(self): - return self._get_more('zones') + return self._get_more("zones") def iterate_records(self, zone): - return self._get_more('records', zone=zone) + return self._get_more("records", zone=zone) def get_zone(self, zone_id): - self.connection.set_context({'zone_id': zone_id}) - uri = API_ROOT + 'hostedzone/' + zone_id + self.connection.set_context({"zone_id": zone_id}) + uri = API_ROOT + "hostedzone/" + zone_id data = self.connection.request(uri).object - elem = findall(element=data, xpath='HostedZone', - namespace=NAMESPACE)[0] + elem = findall(element=data, xpath="HostedZone", namespace=NAMESPACE)[0] + return self._to_zone(elem) def get_record(self, zone_id, record_id): zone = self.get_zone(zone_id=zone_id) - record_type, name = record_id.split(':', 1) + record_type, name = record_id.split(":", 1) + if name: full_name = ".".join((name, zone.domain)) else: full_name = zone.domain - self.connection.set_context({'zone_id': zone_id}) - params = urlencode({ - 'name': full_name, - 'type': record_type, - 'maxitems': '1' - }) - uri = API_ROOT + 'hostedzone/' + zone_id + '/rrset?' + params + self.connection.set_context({"zone_id": zone_id}) + params = urlencode({"name": full_name, "type": record_type, "maxitems": "1"}) + uri = API_ROOT + "hostedzone/" + zone_id + "/rrset?" + params data = self.connection.request(uri).object record = self._to_records(data=data, zone=zone)[0] @@ -151,48 +150,89 @@ def get_record(self, zone_id, record_id): # hints than filters!! # So will return a result even if its not what you asked for. record_type_num = self._string_to_record_type(record_type) + if record.name != name or record.type != record_type_num: - raise RecordDoesNotExistError(value='', driver=self, - record_id=record_id) + raise RecordDoesNotExistError(value="", driver=self, record_id=record_id) return record - def create_zone(self, domain, type='master', ttl=None, extra=None): - zone = ET.Element('CreateHostedZoneRequest', {'xmlns': NAMESPACE}) - ET.SubElement(zone, 'Name').text = domain - ET.SubElement(zone, 'CallerReference').text = str(uuid.uuid4()) + def create_zone(self, domain, type="master", ttl=None, extra=None): + zone = ET.Element("CreateHostedZoneRequest", {"xmlns": NAMESPACE}) + ET.SubElement(zone, "Name").text = domain + ET.SubElement(zone, "CallerReference").text = str(uuid.uuid4()) - if extra and 'Comment' in extra: - hzg = ET.SubElement(zone, 'HostedZoneConfig') - ET.SubElement(hzg, 'Comment').text = extra['Comment'] + if extra and "Comment" in extra: + hzg = ET.SubElement(zone, "HostedZoneConfig") + ET.SubElement(hzg, "Comment").text = extra["Comment"] - uri = API_ROOT + 'hostedzone' + uri = API_ROOT + "hostedzone" data = ET.tostring(zone) - rsp = self.connection.request(uri, method='POST', data=data).object + rsp = self.connection.request(uri, method="POST", data=data).object + + elem = findall(element=rsp, xpath="HostedZone", namespace=NAMESPACE)[0] - elem = findall(element=rsp, xpath='HostedZone', namespace=NAMESPACE)[0] return self._to_zone(elem=elem) def delete_zone(self, zone, ex_delete_records=False): - self.connection.set_context({'zone_id': zone.id}) + self.connection.set_context({"zone_id": zone.id}) if ex_delete_records: self.ex_delete_all_records(zone=zone) - uri = API_ROOT + 'hostedzone/%s' % (zone.id) - response = self.connection.request(uri, method='DELETE') + uri = API_ROOT + "hostedzone/%s" % (zone.id) + response = self.connection.request(uri, method="DELETE") + return response.status in [httplib.OK] def create_record(self, name, zone, type, data, extra=None): + if type in (RecordType.TXT, RecordType.SPF): + data = self._quote_data(data) extra = extra or {} - batch = [('CREATE', name, type, data, extra)] + batch = [("CREATE", name, type, data, extra)] self._post_changeset(zone, batch) - id = ':'.join((self.RECORD_TYPE_MAP[type], name)) - return Record(id=id, name=name, type=type, data=data, zone=zone, - driver=self, extra=extra) + id = ":".join((self.RECORD_TYPE_MAP[type], name)) + + return Record( + id=id, + name=name, + type=type, + data=data, + zone=zone, + driver=self, + ttl=extra.get("ttl", None), + extra=extra, + ) + + def _with_record_set_metadata(self, record): + # ``_multi_value`` / ``_other_records`` are attached by ``_to_records``, + # so records which did not come from ``list_records`` / ``get_record`` + # (e.g. the ones returned by ``create_record`` or + # ``ex_create_multi_value_record``, or user constructed ones) carry no + # information about the rest of their record set. Re-fetch the record + # set in that case so multi value updates and deletes work regardless + # of how the record was obtained. + + if "_multi_value" in record.extra: + return record + + fetched = self.list_records(zone=record.zone) + + for candidate in fetched: + if ( + candidate.name == record.name + and candidate.type == record.type + and candidate.data == record.data + ): + extra = copy.deepcopy(candidate.extra) + extra.update({k: v for k, v in record.extra.items() if not k.startswith("_")}) + record.extra = extra + + break + + return record - def update_record(self, record, name=None, type=None, data=None, - extra=None): + def update_record(self, record, name=None, type=None, data=None, extra=None): + record = self._with_record_set_metadata(record) name = name or record.name type = type or record.type extra = extra or record.extra @@ -202,32 +242,98 @@ def update_record(self, record, name=None, type=None, data=None, # Multiple value records need to be handled specially - we need to # pass values for other records as well - multiple_value_record = record.extra.get('_multi_value', False) - other_records = record.extra.get('_other_records', []) + multiple_value_record = record.extra.get("_multi_value", False) + other_records = record.extra.get("_other_records", []) if multiple_value_record and other_records: - self._update_multi_value_record(record=record, name=name, - type=type, data=data, - extra=extra) + self._update_multi_value_record( + record=record, name=name, type=type, data=data, extra=extra + ) else: - self._update_single_value_record(record=record, name=name, - type=type, data=data, - extra=extra) - - id = ':'.join((self.RECORD_TYPE_MAP[type], name)) - return Record(id=id, name=name, type=type, data=data, zone=record.zone, - driver=self, extra=extra) + self._update_single_value_record( + record=record, name=name, type=type, data=data, extra=extra + ) + + id = ":".join((self.RECORD_TYPE_MAP[type], name)) + + return Record( + id=id, + name=name, + type=type, + data=data, + zone=record.zone, + driver=self, + ttl=extra.get("ttl", None), + extra=extra, + ) def delete_record(self, record): + r = self._with_record_set_metadata(record) try: - r = record - batch = [('DELETE', r.name, r.type, r.data, r.extra)] - self._post_changeset(record.zone, batch) + # Multiple value records need to be handled specially - Route53 + # only accepts a DELETE for a record set which lists every value + # in that set, so values for the other records need to be sent + # as well. + + if r.extra.get("_multi_value", False) and r.extra.get("_other_records", []): + self._delete_multi_value_record(record=r) + else: + batch = [("DELETE", r.name, r.type, r.data, r.extra)] + self._post_changeset(record.zone, batch) except InvalidChangeBatch: - raise RecordDoesNotExistError(value='', driver=self, - record_id=r.id) + raise RecordDoesNotExistError(value="", driver=self, record_id=r.id) + return True + def _delete_multi_value_record(self, record): + other_records = record.extra.get("_other_records", []) + + attrs = {"xmlns": NAMESPACE} + changeset = ET.Element("ChangeResourceRecordSetsRequest", attrs) + batch = ET.SubElement(changeset, "ChangeBatch") + changes = ET.SubElement(batch, "Changes") + + change = ET.SubElement(changes, "Change") + ET.SubElement(change, "Action").text = "DELETE" + + rrs = ET.SubElement(change, "ResourceRecordSet") + + if record.name: + record_name = record.name + "." + record.zone.domain + else: + record_name = record.zone.domain + + ET.SubElement(rrs, "Name").text = record_name + ET.SubElement(rrs, "Type").text = self.RECORD_TYPE_MAP[record.type] + ET.SubElement(rrs, "TTL").text = str(record.extra.get("ttl", "0")) + + rrecs = ET.SubElement(rrs, "ResourceRecords") + + rrec = ET.SubElement(rrecs, "ResourceRecord") + ET.SubElement(rrec, "Value").text = self._to_record_value(record.data, record.extra) + + for other_record in other_records: + rrec = ET.SubElement(rrecs, "ResourceRecord") + ET.SubElement(rrec, "Value").text = self._to_record_value( + other_record["data"], other_record.get("extra", {}) + ) + + uri = API_ROOT + "hostedzone/" + record.zone.id + "/rrset" + data = ET.tostring(changeset) + self.connection.set_context({"zone_id": record.zone.id}) + response = self.connection.request(uri, method="POST", data=data) + + return response.status == httplib.OK + + def _to_record_value(self, data, extra): + # "priority" is parsed out of the value by _to_record, so it needs to + # be put back to reconstruct the value Route53 stores. + + if extra and "priority" in extra: + return "{} {}".format(extra["priority"], data) + + return data + def ex_create_multi_value_record(self, name, zone, type, data, extra=None): """ Create a record with multiple values with a single call. @@ -237,40 +343,48 @@ def ex_create_multi_value_record(self, name, zone, type, data, extra=None): """ extra = extra or {} - attrs = {'xmlns': NAMESPACE} - changeset = ET.Element('ChangeResourceRecordSetsRequest', attrs) - batch = ET.SubElement(changeset, 'ChangeBatch') - changes = ET.SubElement(batch, 'Changes') + attrs = {"xmlns": NAMESPACE} + changeset = ET.Element("ChangeResourceRecordSetsRequest", attrs) + batch = ET.SubElement(changeset, "ChangeBatch") + changes = ET.SubElement(batch, "Changes") - change = ET.SubElement(changes, 'Change') - ET.SubElement(change, 'Action').text = 'CREATE' + change = ET.SubElement(changes, "Change") + ET.SubElement(change, "Action").text = "CREATE" - rrs = ET.SubElement(change, 'ResourceRecordSet') - ET.SubElement(rrs, 'Name').text = name + '.' + zone.domain - ET.SubElement(rrs, 'Type').text = self.RECORD_TYPE_MAP[type] - ET.SubElement(rrs, 'TTL').text = str(extra.get('ttl', '0')) + rrs = ET.SubElement(change, "ResourceRecordSet") + ET.SubElement(rrs, "Name").text = name + "." + zone.domain + ET.SubElement(rrs, "Type").text = self.RECORD_TYPE_MAP[type] + ET.SubElement(rrs, "TTL").text = str(extra.get("ttl", "0")) - rrecs = ET.SubElement(rrs, 'ResourceRecords') + rrecs = ET.SubElement(rrs, "ResourceRecords") # Value is provided as a multi line string - values = [value.strip() for value in data.split('\n') if - value.strip()] + values = [value.strip() for value in data.split("\n") if value.strip()] for value in values: - rrec = ET.SubElement(rrecs, 'ResourceRecord') - ET.SubElement(rrec, 'Value').text = value + rrec = ET.SubElement(rrecs, "ResourceRecord") + ET.SubElement(rrec, "Value").text = value - uri = API_ROOT + 'hostedzone/' + zone.id + '/rrset' + uri = API_ROOT + "hostedzone/" + zone.id + "/rrset" data = ET.tostring(changeset) - self.connection.set_context({'zone_id': zone.id}) - self.connection.request(uri, method='POST', data=data) + self.connection.set_context({"zone_id": zone.id}) + self.connection.request(uri, method="POST", data=data) - id = ':'.join((self.RECORD_TYPE_MAP[type], name)) + id = ":".join((self.RECORD_TYPE_MAP[type], name)) records = [] + for value in values: - record = Record(id=id, name=name, type=type, data=value, zone=zone, - driver=self, extra=extra) + record = Record( + id=id, + name=name, + type=type, + data=value, + zone=zone, + driver=self, + ttl=extra.get("ttl", None), + extra=extra, + ) records.append(record) return records @@ -283,157 +397,155 @@ def ex_delete_all_records(self, zone): :type zone: :class:`Zone` """ deletions = [] + for r in zone.list_records(): if r.type in (RecordType.NS, RecordType.SOA): continue - deletions.append(('DELETE', r.name, r.type, r.data, r.extra)) + deletions.append(("DELETE", r.name, r.type, r.data, r.extra)) if deletions: self._post_changeset(zone, deletions) - def _update_single_value_record(self, record, name=None, type=None, - data=None, extra=None): + def _update_single_value_record(self, record, name=None, type=None, data=None, extra=None): batch = [ - ('DELETE', record.name, record.type, record.data, record.extra), - ('CREATE', name, type, data, extra) + ("DELETE", record.name, record.type, record.data, record.extra), + ("CREATE", name, type, data, extra), ] return self._post_changeset(record.zone, batch) - def _update_multi_value_record(self, record, name=None, type=None, - data=None, extra=None): - other_records = record.extra.get('_other_records', []) + def _update_multi_value_record(self, record, name=None, type=None, data=None, extra=None): + other_records = record.extra.get("_other_records", []) - attrs = {'xmlns': NAMESPACE} - changeset = ET.Element('ChangeResourceRecordSetsRequest', attrs) - batch = ET.SubElement(changeset, 'ChangeBatch') - changes = ET.SubElement(batch, 'Changes') + attrs = {"xmlns": NAMESPACE} + changeset = ET.Element("ChangeResourceRecordSetsRequest", attrs) + batch = ET.SubElement(changeset, "ChangeBatch") + changes = ET.SubElement(batch, "Changes") # Delete existing records - change = ET.SubElement(changes, 'Change') - ET.SubElement(change, 'Action').text = 'DELETE' + change = ET.SubElement(changes, "Change") + ET.SubElement(change, "Action").text = "DELETE" - rrs = ET.SubElement(change, 'ResourceRecordSet') + rrs = ET.SubElement(change, "ResourceRecordSet") if record.name: - record_name = record.name + '.' + record.zone.domain + record_name = record.name + "." + record.zone.domain else: record_name = record.zone.domain - ET.SubElement(rrs, 'Name').text = record_name - ET.SubElement(rrs, 'Type').text = self.RECORD_TYPE_MAP[record.type] - ET.SubElement(rrs, 'TTL').text = str(record.extra.get('ttl', '0')) + ET.SubElement(rrs, "Name").text = record_name + ET.SubElement(rrs, "Type").text = self.RECORD_TYPE_MAP[record.type] + ET.SubElement(rrs, "TTL").text = str(record.extra.get("ttl", "0")) - rrecs = ET.SubElement(rrs, 'ResourceRecords') + rrecs = ET.SubElement(rrs, "ResourceRecords") - rrec = ET.SubElement(rrecs, 'ResourceRecord') - ET.SubElement(rrec, 'Value').text = record.data + rrec = ET.SubElement(rrecs, "ResourceRecord") + ET.SubElement(rrec, "Value").text = record.data for other_record in other_records: - rrec = ET.SubElement(rrecs, 'ResourceRecord') - ET.SubElement(rrec, 'Value').text = other_record['data'] + rrec = ET.SubElement(rrecs, "ResourceRecord") + ET.SubElement(rrec, "Value").text = other_record["data"] # Re-create new (updated) records. Since we are updating a multi value # record, only a single record is updated and others are left as is. - change = ET.SubElement(changes, 'Change') - ET.SubElement(change, 'Action').text = 'CREATE' + change = ET.SubElement(changes, "Change") + ET.SubElement(change, "Action").text = "CREATE" - rrs = ET.SubElement(change, 'ResourceRecordSet') + rrs = ET.SubElement(change, "ResourceRecordSet") if name: - record_name = name + '.' + record.zone.domain + record_name = name + "." + record.zone.domain else: record_name = record.zone.domain - ET.SubElement(rrs, 'Name').text = record_name - ET.SubElement(rrs, 'Type').text = self.RECORD_TYPE_MAP[type] - ET.SubElement(rrs, 'TTL').text = str(extra.get('ttl', '0')) + ET.SubElement(rrs, "Name").text = record_name + ET.SubElement(rrs, "Type").text = self.RECORD_TYPE_MAP[type] + ET.SubElement(rrs, "TTL").text = str(extra.get("ttl", "0")) - rrecs = ET.SubElement(rrs, 'ResourceRecords') + rrecs = ET.SubElement(rrs, "ResourceRecords") - rrec = ET.SubElement(rrecs, 'ResourceRecord') - ET.SubElement(rrec, 'Value').text = data + rrec = ET.SubElement(rrecs, "ResourceRecord") + ET.SubElement(rrec, "Value").text = data for other_record in other_records: - rrec = ET.SubElement(rrecs, 'ResourceRecord') - ET.SubElement(rrec, 'Value').text = other_record['data'] - uri = API_ROOT + 'hostedzone/' + record.zone.id + '/rrset' + rrec = ET.SubElement(rrecs, "ResourceRecord") + ET.SubElement(rrec, "Value").text = other_record["data"] + uri = API_ROOT + "hostedzone/" + record.zone.id + "/rrset" data = ET.tostring(changeset) - self.connection.set_context({'zone_id': record.zone.id}) - response = self.connection.request(uri, method='POST', data=data) + self.connection.set_context({"zone_id": record.zone.id}) + response = self.connection.request(uri, method="POST", data=data) return response.status == httplib.OK def _post_changeset(self, zone, changes_list): - attrs = {'xmlns': NAMESPACE} - changeset = ET.Element('ChangeResourceRecordSetsRequest', attrs) - batch = ET.SubElement(changeset, 'ChangeBatch') - changes = ET.SubElement(batch, 'Changes') + attrs = {"xmlns": NAMESPACE} + changeset = ET.Element("ChangeResourceRecordSetsRequest", attrs) + batch = ET.SubElement(changeset, "ChangeBatch") + changes = ET.SubElement(batch, "Changes") for action, name, type_, data, extra in changes_list: - change = ET.SubElement(changes, 'Change') - ET.SubElement(change, 'Action').text = action + change = ET.SubElement(changes, "Change") + ET.SubElement(change, "Action").text = action - rrs = ET.SubElement(change, 'ResourceRecordSet') + rrs = ET.SubElement(change, "ResourceRecordSet") if name: - record_name = name + '.' + zone.domain + record_name = name + "." + zone.domain else: record_name = zone.domain - ET.SubElement(rrs, 'Name').text = record_name - ET.SubElement(rrs, 'Type').text = self.RECORD_TYPE_MAP[type_] - ET.SubElement(rrs, 'TTL').text = str(extra.get('ttl', '0')) + ET.SubElement(rrs, "Name").text = record_name + ET.SubElement(rrs, "Type").text = self.RECORD_TYPE_MAP[type_] + ET.SubElement(rrs, "TTL").text = str(extra.get("ttl", "0")) - rrecs = ET.SubElement(rrs, 'ResourceRecords') - rrec = ET.SubElement(rrecs, 'ResourceRecord') - if 'priority' in extra: - data = '%s %s' % (extra['priority'], data) - ET.SubElement(rrec, 'Value').text = data + rrecs = ET.SubElement(rrs, "ResourceRecords") + rrec = ET.SubElement(rrecs, "ResourceRecord") - uri = API_ROOT + 'hostedzone/' + zone.id + '/rrset' + if "priority" in extra: + data = "{} {}".format(extra["priority"], data) + ET.SubElement(rrec, "Value").text = data + + uri = API_ROOT + "hostedzone/" + zone.id + "/rrset" data = ET.tostring(changeset) - self.connection.set_context({'zone_id': zone.id}) - response = self.connection.request(uri, method='POST', data=data) + self.connection.set_context({"zone_id": zone.id}) + response = self.connection.request(uri, method="POST", data=data) return response.status == httplib.OK def _to_zones(self, data): zones = [] - for element in data.findall(fixxpath(xpath='HostedZones/HostedZone', - namespace=NAMESPACE)): + + for element in data.findall(fixxpath(xpath="HostedZones/HostedZone", namespace=NAMESPACE)): zones.append(self._to_zone(element)) return zones def _to_zone(self, elem): - name = findtext(element=elem, xpath='Name', namespace=NAMESPACE) - id = findtext(element=elem, xpath='Id', - namespace=NAMESPACE).replace('/hostedzone/', '') - comment = findtext(element=elem, xpath='Config/Comment', - namespace=NAMESPACE) - resource_record_count = int(findtext(element=elem, - xpath='ResourceRecordSetCount', - namespace=NAMESPACE)) - - extra = {'Comment': comment, 'ResourceRecordSetCount': - resource_record_count} - - zone = Zone(id=id, domain=name, type='master', ttl=0, driver=self, - extra=extra) + name = findtext(element=elem, xpath="Name", namespace=NAMESPACE) + id = findtext(element=elem, xpath="Id", namespace=NAMESPACE).replace("/hostedzone/", "") + comment = findtext(element=elem, xpath="Config/Comment", namespace=NAMESPACE) + resource_record_count = int( + findtext(element=elem, xpath="ResourceRecordSetCount", namespace=NAMESPACE) + ) + + extra = {"Comment": comment, "ResourceRecordSetCount": resource_record_count} + + zone = Zone(id=id, domain=name, type="master", ttl=0, driver=self, extra=extra) + return zone def _to_records(self, data, zone): records = [] elems = data.findall( - fixxpath(xpath='ResourceRecordSets/ResourceRecordSet', - namespace=NAMESPACE)) + fixxpath(xpath="ResourceRecordSets/ResourceRecordSet", namespace=NAMESPACE) + ) + for elem in elems: - record_set = elem.findall(fixxpath( - xpath='ResourceRecords/ResourceRecord', - namespace=NAMESPACE)) + record_set = elem.findall( + fixxpath(xpath="ResourceRecords/ResourceRecord", namespace=NAMESPACE) + ) record_count = len(record_set) - multiple_value_record = (record_count > 1) + multiple_value_record = record_count > 1 record_set_records = [] @@ -441,105 +553,134 @@ def _to_records(self, data, zone): # Need to special handling for records with multiple values for # update to work correctly record = self._to_record(elem=elem, zone=zone, index=index) - record.extra['_multi_value'] = multiple_value_record + record.extra["_multi_value"] = multiple_value_record if multiple_value_record: - record.extra['_other_records'] = [] + record.extra["_other_records"] = [] record_set_records.append(record) # Store reference to other records so update works correctly + if multiple_value_record: for index in range(0, len(record_set_records)): record = record_set_records[index] - for other_index, other_record in \ - enumerate(record_set_records): + for other_index, other_record in enumerate(record_set_records): if index == other_index: # Skip current record + continue extra = copy.deepcopy(other_record.extra) - extra.pop('_multi_value') - extra.pop('_other_records') + extra.pop("_multi_value") + extra.pop("_other_records") - item = {'name': other_record.name, - 'data': other_record.data, - 'type': other_record.type, - 'extra': extra} - record.extra['_other_records'].append(item) + item = { + "name": other_record.name, + "data": other_record.data, + "type": other_record.type, + "extra": extra, + } + record.extra["_other_records"].append(item) records.extend(record_set_records) return records def _to_record(self, elem, zone, index=0): - name = findtext(element=elem, xpath='Name', - namespace=NAMESPACE) - name = name[:-len(zone.domain) - 1] + name = findtext(element=elem, xpath="Name", namespace=NAMESPACE) + name = name[: -len(zone.domain) - 1] + + type = self._string_to_record_type( + findtext(element=elem, xpath="Type", namespace=NAMESPACE) + ) + ttl = findtext(element=elem, xpath="TTL", namespace=NAMESPACE) - type = self._string_to_record_type(findtext(element=elem, xpath='Type', - namespace=NAMESPACE)) - ttl = int(findtext(element=elem, xpath='TTL', namespace=NAMESPACE)) + if ttl is not None: + ttl = int(ttl) value_elem = elem.findall( - fixxpath(xpath='ResourceRecords/ResourceRecord', - namespace=NAMESPACE))[index] - data = findtext(element=(value_elem), xpath='Value', - namespace=NAMESPACE) + fixxpath(xpath="ResourceRecords/ResourceRecord", namespace=NAMESPACE) + )[index] + data = findtext(element=(value_elem), xpath="Value", namespace=NAMESPACE) - extra = {'ttl': ttl} + extra = {"ttl": ttl} - if type == 'MX': + if type == "MX": split = data.split() priority, data = split - extra['priority'] = int(priority) - elif type == 'SRV': + extra["priority"] = int(priority) + elif type == "SRV": split = data.split() priority, weight, port, data = split - extra['priority'] = int(priority) - extra['weight'] = int(weight) - extra['port'] = int(port) + extra["priority"] = int(priority) + extra["weight"] = int(weight) + extra["port"] = int(port) + + id = ":".join((self.RECORD_TYPE_MAP[type], name)) + record = Record( + id=id, + name=name, + type=type, + data=data, + zone=zone, + driver=self, + ttl=extra.get("ttl", None), + extra=extra, + ) - id = ':'.join((self.RECORD_TYPE_MAP[type], name)) - record = Record(id=id, name=name, type=type, data=data, zone=zone, - driver=self, extra=extra) return record def _get_more(self, rtype, **kwargs): exhausted = False last_key = None + while not exhausted: - items, last_key, exhausted = self._get_data(rtype, last_key, - **kwargs) - for item in items: - yield item + items, last_key, exhausted = self._get_data(rtype, last_key, **kwargs) + yield from items def _get_data(self, rtype, last_key, **kwargs): params = {} + if last_key: - params['name'] = last_key - path = API_ROOT + 'hostedzone' + params["name"] = last_key + path = API_ROOT + "hostedzone" - if rtype == 'zones': + if rtype == "zones": response = self.connection.request(path, params=params) transform_func = self._to_zones - elif rtype == 'records': - zone = kwargs['zone'] - path += '/%s/rrset' % (zone.id) - self.connection.set_context({'zone_id': zone.id}) + elif rtype == "records": + zone = kwargs["zone"] + path += "/%s/rrset" % (zone.id) + self.connection.set_context({"zone_id": zone.id}) response = self.connection.request(path, params=params) transform_func = self._to_records + else: + raise ValueError(f"Unsupported rtype: {rtype}") if response.status == httplib.OK: - is_truncated = findtext(element=response.object, - xpath='IsTruncated', - namespace=NAMESPACE) - exhausted = is_truncated != 'true' - last_key = findtext(element=response.object, - xpath='NextRecordName', - namespace=NAMESPACE) + is_truncated = findtext( + element=response.object, xpath="IsTruncated", namespace=NAMESPACE + ) + exhausted = is_truncated != "true" + last_key = findtext( + element=response.object, xpath="NextRecordName", namespace=NAMESPACE + ) items = transform_func(data=response.object, **kwargs) + return items, last_key, exhausted else: return [], None, True + + def _ex_connection_class_kwargs(self): + kwargs = super()._ex_connection_class_kwargs() + kwargs["token"] = self.token + + return kwargs + + def _quote_data(self, data): + if data[0] == '"' and data[-1] == '"': + return data + + return '"{}"'.format(data.replace('"', '"')) diff --git a/libcloud/dns/drivers/softlayer.py b/libcloud/dns/drivers/softlayer.py deleted file mode 100644 index 04b4a8c244..0000000000 --- a/libcloud/dns/drivers/softlayer.py +++ /dev/null @@ -1,213 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License.You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -__all__ = [ - 'SoftLayerDNSDriver' -] - - -from libcloud.common.softlayer import SoftLayerConnection -from libcloud.common.softlayer import SoftLayerObjectDoesntExist -from libcloud.dns.types import Provider, RecordType -from libcloud.dns.types import ZoneDoesNotExistError, RecordDoesNotExistError -from libcloud.dns.base import DNSDriver, Zone, Record - - -VALID_RECORD_EXTRA_PARAMS = ['priority', 'ttl'] - - -class SoftLayerDNSDriver(DNSDriver): - type = Provider.SOFTLAYER - name = 'Softlayer DNS' - website = 'https://www.softlayer.com' - connectionCls = SoftLayerConnection - - RECORD_TYPE_MAP = { - RecordType.A: 'a', - RecordType.AAAA: 'aaaa', - RecordType.CNAME: 'cname', - RecordType.MX: 'mx', - RecordType.NS: 'ns', - RecordType.PTR: 'ptr', - RecordType.SOA: 'soa', - RecordType.SPF: 'spf', - RecordType.SRV: 'srv', - RecordType.TXT: 'txt', - } - - def create_zone(self, domain, ttl=None, extra=None): - self.connection.set_context({'resource': 'zone', 'id': domain}) - data = { - 'name': domain, - 'resourceRecords': [] - } - response = self.connection.request( - 'SoftLayer_Dns_Domain', 'createObject', data - ).object - zone = Zone(id=response['id'], domain=domain, - type='master', ttl=3600, driver=self) - return zone - - def get_zone(self, zone_id): - self.connection.set_context({'resource': 'zone', 'id': zone_id}) - try: - response = self.connection.request( - 'SoftLayer_Dns_Domain', 'getObject', id=zone_id - ).object - except SoftLayerObjectDoesntExist: - raise ZoneDoesNotExistError(value='', driver=self, - zone_id=zone_id) - return self._to_zone(response) - - def delete_zone(self, zone): - self.connection.set_context({'resource': 'zone', 'id': zone.id}) - try: - self.connection.request( - 'SoftLayer_Dns_Domain', 'deleteObject', id=zone.id - ).object - except SoftLayerObjectDoesntExist: - raise ZoneDoesNotExistError(value='', driver=self, - zone_id=zone.id) - else: - return True - - def iterate_zones(self): - zones_list = self.connection.request( - 'SoftLayer_Dns_Domain', 'getByDomainName', '.' - ).object - for item in zones_list: - yield self._to_zone(item) - - def iterate_records(self, zone): - self.connection.set_context({'resource': 'zone', 'id': zone.id}) - records_list = self.connection.request( - 'SoftLayer_Dns_Domain', 'getResourceRecords', id=zone.id - ).object - for item in records_list: - yield self._to_record(item, zone=zone) - - def get_record(self, zone_id, record_id): - try: - record = self.connection.request( - 'SoftLayer_Dns_Domain_ResourceRecord', - 'getObject', - id=record_id - ).object - return self._to_record(record, zone=self.get_zone(zone_id)) - except SoftLayerObjectDoesntExist: - raise RecordDoesNotExistError(value='', driver=self, - record_id=record_id) - - def delete_record(self, record): - try: - self.connection.request( - 'SoftLayer_Dns_Domain_ResourceRecord', - 'deleteObject', - id=record.id - ).object - except SoftLayerObjectDoesntExist: - raise RecordDoesNotExistError(value='', driver=self, - record_id=record.id) - else: - return True - - def create_record(self, name, zone, type, data, extra=None): - params = { - 'domainId': zone.id, - 'type': self.RECORD_TYPE_MAP[type], - 'host': name, - 'data': data - } - if extra: - if extra.get('ttl'): - params['ttl'] = extra['ttl'] - if extra.get('refresh'): - params['refresh'] = extra['refresh'] - if extra.get('retry'): - params['retry'] = extra['retry'] - if extra.get('expire'): - params['expire'] = extra['expire'] - if extra.get('priority'): - params['mxPriority'] = extra['priority'] - response = self.connection.request( - 'SoftLayer_Dns_Domain_ResourceRecord', - 'createObject', - params - ).object - - return self._to_record(response, zone=zone) - - def update_record( - self, record, name=None, type=None, data=None, extra=None): - params = {} - if type: - params['type'] = self.RECORD_TYPE_MAP[type] - if name: - params['host'] = name - if data: - params['data'] = data - - if extra: - if extra.get('ttl'): - params['ttl'] = extra['ttl'] - if extra.get('refresh'): - params['refresh'] = extra['refresh'] - if extra.get('retry'): - params['retry'] = extra['retry'] - if extra.get('expire'): - params['expire'] = extra['expire'] - if extra.get('priority'): - params['mxPriority'] = extra['priority'] - - response = self.connection.request( - 'SoftLayer_Dns_Domain_ResourceRecord', - 'editObject', - params, - id=record.id, - ).object - - if response: - changed_record = self.connection.request( - 'SoftLayer_Dns_Domain_ResourceRecord', - 'getObject', - id=record.id, - ).object - return self._to_record(changed_record, zone=record.zone) - else: - return False - - def _to_zone(self, item): - ttl = item.get('ttl', 3600) - zone = Zone(id=item['id'], domain=item['name'], - type='master', ttl=ttl, driver=self) - return zone - - def _to_record(self, item, zone=None): - extra = { - 'ttl': item['ttl'], - 'expire': item['expire'], - 'mxPriority': item['mxPriority'], - 'refresh': item['refresh'], - 'retry': item['retry'], - } - record = Record( - id=item['id'], - name=item['host'], - type=self._string_to_record_type(item['type']), - data=item['data'], - zone=zone, - driver=self, - extra=extra - ) - return record diff --git a/libcloud/dns/drivers/vultr.py b/libcloud/dns/drivers/vultr.py new file mode 100644 index 0000000000..c9cbb4818e --- /dev/null +++ b/libcloud/dns/drivers/vultr.py @@ -0,0 +1,762 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Vultr DNS Driver +""" + +import json +from typing import Any, Dict, List, Optional + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import ( + Provider, + RecordType, + ZoneDoesNotExistError, + ZoneAlreadyExistsError, + RecordDoesNotExistError, + RecordAlreadyExistsError, +) +from libcloud.utils.py3 import urlencode +from libcloud.common.vultr import ( + DEFAULT_API_VERSION, + VultrResponse, + VultrConnection, + VultrResponseV2, + VultrConnectionV2, +) + +__all__ = [ + "ZoneRequiredException", + "VultrDNSResponse", + "VultrDNSConnection", + "VultrDNSDriver", +] + + +class ZoneRequiredException(Exception): + pass + + +class VultrDNSResponse(VultrResponse): + pass + + +class VultrDNSConnection(VultrConnection): + responseCls = VultrDNSResponse + + +class VultrDNSResponseV2(VultrResponseV2): + pass + + +class VultrDNSConnectionV2(VultrConnectionV2): + responseCls = VultrDNSResponseV2 + + +class VultrDNSDriver(DNSDriver): + type = Provider.VULTR + name = "Vultr DNS" + website = "https://www.vultr.com" + + def __new__( + cls, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=DEFAULT_API_VERSION, + region=None, + **kwargs, + ): + if cls is VultrDNSDriver: + if api_version == "1": + cls = VultrDNSDriverV1 + elif api_version == "2": + cls = VultrDNSDriverV2 + else: + raise NotImplementedError( + "No Vultr driver found for API version: %s" % (api_version) + ) + + return super().__new__(cls) + + +class VultrDNSDriverV1(VultrDNSDriver): + connectionCls = VultrDNSConnection + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.TXT: "TXT", + RecordType.CNAME: "CNAME", + RecordType.MX: "MX", + RecordType.NS: "NS", + RecordType.SRV: "SRV", + } + + def list_zones(self): + """ + Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + action = "/v1/dns/list" + params = {"api_key": self.key} + response = self.connection.request(action=action, params=params) + zones = self._to_zones(response.objects[0]) + + return zones + + def list_records(self, zone): + """ + Returns a list of records for the provided zone. + + :param zone: zone to list records for + :type zone: `Zone` + + :rtype: list of :class: `Record` + """ + + if not isinstance(zone, Zone): + raise ZoneRequiredException("zone should be of type Zone") + + zones = self.list_zones() + + if not self.ex_zone_exists(zone.domain, zones): + raise ZoneDoesNotExistError(value="", driver=self, zone_id=zone.domain) + + action = "/v1/dns/records" + params = {"domain": zone.domain} + response = self.connection.request(action=action, params=params) + records = self._to_records(response.objects[0], zone=zone) + + return records + + def get_zone(self, zone_id): + """ + Returns a `Zone` instance. + + :param zone_id: name of the zone user wants to get. + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + ret_zone = None + + action = "/v1/dns/list" + params = {"api_key": self.key} + response = self.connection.request(action=action, params=params) + zones = self._to_zones(response.objects[0]) + + if not self.ex_zone_exists(zone_id, zones): + raise ZoneDoesNotExistError(value=None, zone_id=zone_id, driver=self) + + for zone in zones: + if zone_id == zone.domain: + ret_zone = zone + + return ret_zone + + def get_record(self, zone_id, record_id): + """ + Returns a Record instance. + + :param zone_id: name of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class: `Record` + """ + ret_record = None + zone = self.get_zone(zone_id=zone_id) + records = self.list_records(zone=zone) + + if not self.ex_record_exists(record_id, records): + raise RecordDoesNotExistError(value="", driver=self, record_id=record_id) + + for record in records: + if record_id == record.id: + ret_record = record + + return ret_record + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + Returns a `Zone` object. + + :param domain: Zone domain name, (e.g. example.com). + :type domain: ``str`` + + :param type: Zone type (master / slave). + :type type: ``str`` + + :param ttl: TTL for new records. (optional) + :type ttl: ``int`` + + :param extra: (optional) Extra attributes (driver specific). + (e.g. {'serverip':'127.0.0.1'}) + """ + extra = extra or {} + + if extra and extra.get("serverip"): + serverip = extra["serverip"] + else: + raise ValueError("Missing servertip key in extra") + + params = {"api_key": self.key} + data = urlencode({"domain": domain, "serverip": serverip}) + action = "/v1/dns/create_domain" + zones = self.list_zones() + + if self.ex_zone_exists(domain, zones): + raise ZoneAlreadyExistsError(value="", driver=self, zone_id=domain) + + self.connection.request(params=params, action=action, data=data, method="POST") + zone = Zone(id=domain, domain=domain, type=type, ttl=ttl, driver=self, extra=extra) + + return zone + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a new record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone where the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: Extra attributes (driver specific). (optional) + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + extra = extra or {} + + ret_record = None + old_records_list = self.list_records(zone=zone) + # check if record already exists + # if exists raise RecordAlreadyExistsError + + for record in old_records_list: + if record.name == name and record.data == data: + raise RecordAlreadyExistsError(value="", driver=self, record_id=record.id) + + MX = self.RECORD_TYPE_MAP.get("MX") + SRV = self.RECORD_TYPE_MAP.get("SRV") + + if extra and extra.get("priority"): + priority = int(extra["priority"]) + else: + priority = None + + post_data = { + "domain": zone.domain, + "name": name, + "type": self.RECORD_TYPE_MAP.get(type), + "data": data, + } + + if type == MX or type == SRV: + if priority is None: + raise ValueError("Missing priority argument for MX record type") + post_data["priority"] = priority + + encoded_data = urlencode(post_data) + params = {"api_key": self.key} + action = "/v1/dns/create_record" + + self.connection.request(action=action, params=params, data=encoded_data, method="POST") + updated_zone_records = zone.list_records() + + for record in updated_zone_records: + if record.name == name and record.data == data: + ret_record = record + + return ret_record + + def delete_zone(self, zone): + """ + Delete a zone. + + Note: This will delete all the records belonging to this zone. + + :param zone: Zone to delete. + :type zone: :class:`Zone` + + :rtype: ``bool`` + """ + action = "/v1/dns/delete_domain" + params = {"api_key": self.key} + data = urlencode({"domain": zone.domain}) + zones = self.list_zones() + + if not self.ex_zone_exists(zone.domain, zones): + raise ZoneDoesNotExistError(value="", driver=self, zone_id=zone.domain) + + response = self.connection.request(params=params, action=action, data=data, method="POST") + + return response.status == 200 + + def delete_record(self, record): + """ + Delete a record. + + :param record: Record to delete. + :type record: :class:`Record` + + :rtype: ``bool`` + """ + action = "/v1/dns/delete_record" + params = {"api_key": self.key} + data = urlencode({"RECORDID": record.id, "domain": record.zone.domain}) + + zone_records = self.list_records(record.zone) + + if not self.ex_record_exists(record.id, zone_records): + raise RecordDoesNotExistError(value="", driver=self, record_id=record.id) + + response = self.connection.request(action=action, params=params, data=data, method="POST") + + return response.status == 200 + + def ex_zone_exists(self, zone_id, zones_list): + """ + Function to check if a `Zone` object exists. + + :param zone_id: Name of the `Zone` object. + :type zone_id: ``str`` + + :param zones_list: A list containing `Zone` objects + :type zones_list: ``list`` + + :rtype: Returns `True` or `False` + """ + + zone_ids = [] + + for zone in zones_list: + zone_ids.append(zone.domain) + + return zone_id in zone_ids + + def ex_record_exists(self, record_id, records_list): + """ + :param record_id: Name of the `Record` object. + :type record_id: ``str`` + + :param records_list: A list containing `Record` objects + :type records_list: ``list`` + + :rtype: ``bool`` + """ + record_ids = [] + + for record in records_list: + record_ids.append(record.id) + + return record_id in record_ids + + def _to_zone(self, item): + """ + Build an object `Zone` from the item dictionary + + :param item: item to build the zone from + :type item: `dictionary` + + :rtype: :instance: `Zone` + """ + type = "master" + extra = {"date_created": item["date_created"]} + + zone = Zone( + id=item["domain"], + domain=item["domain"], + driver=self, + type=type, + ttl=None, + extra=extra, + ) + + return zone + + def _to_zones(self, items): + """ + Returns a list of `Zone` objects. + + :param: items: a list that contains dictionary objects to be passed + to the _to_zone function. + :type items: ``list`` + """ + zones = [] + + for item in items: + zones.append(self._to_zone(item)) + + return zones + + def _to_record(self, item, zone): + extra = {} + + if item.get("priority"): + extra["priority"] = item["priority"] + + type = self._string_to_record_type(item["type"]) + record = Record( + id=item["RECORDID"], + name=item["name"], + type=type, + data=item["data"], + zone=zone, + driver=self, + extra=extra, + ) + + return record + + def _to_records(self, items, zone): + records = [] + + for item in items: + records.append(self._to_record(item, zone=zone)) + + return records + + +class VultrDNSDriverV2(VultrDNSDriver): + connectionCls = VultrDNSConnectionV2 + + RECORD_TYPE_MAP = { + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.NS: "NS", + RecordType.MX: "MX", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + RecordType.CAA: "CAA", + RecordType.SSHFP: "SSHFP", + } + + def list_zones(self) -> List[Zone]: + """Return a list of zones. + + :return: ``list`` of :class:`Zone` + """ + data = self._paginated_request("/v2/domains", "domains") + + return [self._to_zone(item) for item in data] + + def get_zone(self, zone_id: str) -> Zone: + """Return a Zone instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + resp = self.connection.request("/v2/domains/%s" % zone_id) + + return self._to_zone(resp.object["domain"]) + + def create_zone( + self, + domain: str, + type: str = "master", + ttl: Optional[int] = None, + extra: Optional[Dict[str, Any]] = None, + ) -> Zone: + """Create a new zone. + + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type. Only 'master' value is supported. + :type type: ``str`` + + :param ttl: TTL for new records. (unused) + :type ttl: ``int`` + + :param extra: Extra attributes 'ip': ``str`` IP for a default A record + 'dns_sec': ``bool`` Enable DSNSEC. + :type extra: ``dict`` + + :rtype: :class:`Zone` + """ + + data = { + "domain": domain, + } + + extra = extra or {} + + if "ip" in extra: + data["ip"] = extra["ip"] + + if "dns_sec" in extra: + data["dns_sec"] = "enabled" if extra["dns_sec"] is True else "disabled" + + resp = self.connection.request("/v2/domains", data=json.dumps(data), method="POST") + + return self._to_zone(resp.object["domain"]) + + def delete_zone(self, zone: Zone) -> bool: + """Delete a zone. + + Note: This will delete all the records belonging to this zone. + + :param zone: Zone to delete. + :type zone: :class:`Zone` + + :rtype: ``bool`` + """ + resp = self.connection.request("/v2/domains/%s" % zone.domain, method="DELETE") + + return resp.success() + + def list_records(self, zone: Zone) -> List[Record]: + """Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + data = self._paginated_request("/v2/domains/%s/records" % zone.domain, "records") + + return [self._to_record(item, zone) for item in data] + + def get_record(self, zone_id: str, record_id: str) -> Record: + """Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + resp = self.connection.request("/v2/domains/{}/records/{}".format(zone_id, record_id)) + + # Avoid making an extra API call, as zone_id is enough for + # standard fields + zone = Zone(id=zone_id, domain=zone_id, type="master", ttl=None, driver=self) + + return self._to_record(resp.object["record"], zone) + + def create_record( + self, + name: str, + zone: Zone, + type: RecordType, + data: str, + extra: Optional[Dict[str, Any]] = None, + ) -> Record: + """Create a new record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone where the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS record type (A, AAAA, ...). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :keyword extra: Extra attributes 'ttl': Time to live in seconds + 'priority': DNS priority. Only + required for MX and SRV + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + data = { + "name": name, + "type": self.RECORD_TYPE_MAP[type], + "data": data, + } + extra = extra or {} + + if "ttl" in extra: + data["ttl"] = int(extra["ttl"]) + + if "priority" in extra: + data["priority"] = int(extra["priority"]) + + resp = self.connection.request( + "/v2/domains/%s/records" % zone.domain, data=json.dumps(data), method="POST" + ) + + return self._to_record(resp.object["record"], zone) + + def update_record( + self, + record: Record, + name: Optional[str] = None, + type: Optional[RecordType] = None, + data: Optional[str] = None, + extra: Optional[Dict[str, Any]] = None, + ) -> bool: + """Update an existing record. + + :param record: Record to update. + :type record: :class:`Record` + + :keyword name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :keyword type: DNS record type. (Unused) + :type type: :class:`RecordType` + + :keyword data: Data for the record (depends on the record type). + :type data: ``str`` + + :keyword extra: Extra attributes 'ttl': Time to live in seconds + 'priority': DNS priority. Only + required for MX and SRV + :type extra: ``dict`` + + :rtype: ``bool`` + """ + body = {} + + if name: + body["name"] = name + + if data: + body["data"] = data + + extra = extra or {} + + if "ttl" in extra: + body["ttl"] = int(extra["ttl"]) + + if "priority" in extra: + body["priority"] = int(extra["priority"]) + + resp = self.connection.request( + "/v2/domains/{}/records/{}".format(record.zone.domain, record.id), + data=json.dumps(body), + method="PATCH", + ) + + return resp.success() + + def delete_record(self, record: Record) -> bool: + """Delete a record. + + :param record: Record to delete. + :type record: :class:`Record` + + :rtype: ``bool`` + """ + resp = self.connection.request( + "/v2/domains/{}/records/{}".format(record.zone.domain, record.id), + method="DELETE", + ) + + return resp.success() + + def _to_zone(self, data: Dict[str, Any]) -> Zone: + type_ = "master" + domain = data["domain"] + extra = { + "date_created": data["date_created"], + } + + return Zone(id=domain, domain=domain, driver=self, type=type_, ttl=None, extra=extra) + + def _to_record(self, data: Dict[str, Any], zone: Zone) -> Record: + id_ = data["id"] + name = data["name"] + type_ = self._string_to_record_type(data["type"]) + data_ = data["data"] + ttl = data["ttl"] + extra = { + "priority": data["priority"], + } + + return Record( + id=id_, + name=name, + type=type_, + data=data_, + ttl=ttl, + driver=self, + zone=zone, + extra=extra, + ) + + def _paginated_request( + self, + url: str, + key: str, + params: Optional[Dict[str, Any]] = None, + ) -> List[Any]: + """Perform multiple calls to get the full list of items when + the API responses are paginated. + + :param url: API endpoint + :type url: ``str`` + + :param key: Result object key + :type key: ``str`` + + :param params: Request parameters + :type params: ``dict`` + + :return: ``list`` of API response objects + :rtype: ``list`` + """ + params = params if params is not None else {} + resp = self.connection.request(url, params=params).object + data = list(resp.get(key, [])) + objects = data + + while True: + next_page = resp["meta"]["links"]["next"] + + if next_page: + params["cursor"] = next_page + resp = self.connection.request(url, params=params).object + data = list(resp.get(key, [])) + objects.extend(data) + else: + return objects diff --git a/libcloud/dns/drivers/worldwidedns.py b/libcloud/dns/drivers/worldwidedns.py new file mode 100644 index 0000000000..80593b499c --- /dev/null +++ b/libcloud/dns/drivers/worldwidedns.py @@ -0,0 +1,582 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +World Wide DNS Driver +""" + +__all__ = ["WorldWideDNSDriver"] + +import re + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import ( + Provider, + RecordType, + RecordError, + ZoneDoesNotExistError, + RecordDoesNotExistError, +) +from libcloud.common.types import LibcloudError +from libcloud.common.worldwidedns import WorldWideDNSConnection + +MAX_RECORD_ENTRIES = 40 # Maximum record entries for zone + + +class WorldWideDNSError(LibcloudError): + def __repr__(self): + return "" + + +class WorldWideDNSDriver(DNSDriver): + type = Provider.WORLDWIDEDNS + name = "World Wide DNS" + website = "https://www.worldwidedns.net/" + connectionCls = WorldWideDNSConnection + + RECORD_TYPE_MAP = { + RecordType.MX: "MX", + RecordType.CNAME: "CNAME", + RecordType.A: "A", + RecordType.NS: "NS", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + } + + def __init__( + self, + key, + secret=None, + reseller_id=None, + secure=True, + host=None, + port=None, + **kwargs, + ): + """ + :param key: API key or username to used (required) + :type key: ``str`` + + :param secret: Secret password to be used (required) + :type secret: ``str`` + + :param reseller_id: Reseller ID for reseller accounts + :type reseller_id: ``str`` + + :param secure: Whether to use HTTPS or HTTP. Note: Some providers + only support HTTPS, and it is on by default. + :type secure: ``bool`` + + :param host: Override hostname used for connections. + :type host: ``str`` + + :param port: Override port used for connections. + :type port: ``int`` + + :return: ``None`` + """ + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port, **kwargs) + self.reseller_id = reseller_id + + def list_zones(self): + """ + Return a list of zones. + + :return: ``list`` of :class:`Zone` + + For more info, please see: + https://www.worldwidedns.net/dns_api_protocol_list.asp + or + https://www.worldwidedns.net/dns_api_protocol_list_reseller.asp + """ + action = "/api_dns_list.asp" + + if self.reseller_id is not None: + action = "/api_dns_list_reseller.asp" + zones = self.connection.request(action) + + if len(zones.body) == 0: + return [] + else: + return self._to_zones(zones.body) + + def iterate_records(self, zone): + """ + Return a generator to iterate over records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :rtype: ``generator`` of :class:`Record` + """ + records = self._to_records(zone) + yield from records + + def get_zone(self, zone_id): + """ + Return a Zone instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + zones = self.list_zones() + zone = [zone for zone in zones if zone.id == zone_id] + + if len(zone) == 0: + raise ZoneDoesNotExistError( + driver=self, value="The zone doesn't exists", zone_id=zone_id + ) + + return zone[0] + + def get_record(self, zone_id, record_id): + """ + Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID number of the required record. + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + zone = self.get_zone(zone_id) + try: + if int(record_id) not in range(1, MAX_RECORD_ENTRIES + 1): + raise RecordDoesNotExistError( + value="Record doesn't exists", + driver=zone.driver, + record_id=record_id, + ) + except ValueError: + raise WorldWideDNSError(value="Record id should be a string number", driver=self) + subdomain = zone.extra.get("S%s" % record_id) + type = zone.extra.get("T%s" % record_id) + data = zone.extra.get("D%s" % record_id) + record = self._to_record(record_id, subdomain, type, data, zone) + + return record + + def update_zone(self, zone, domain, type="master", ttl=None, extra=None, ex_raw=False): + """ + Update an existing zone. + + :param zone: Zone to update. + :type zone: :class:`Zone` + + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type (master / slave). + :type type: ``str`` + + :param ttl: TTL for new records. (optional) + :type ttl: ``int`` + + :param extra: Extra attributes (driver specific) (optional). Values not + specified such as *SECURE*, *IP*, *FOLDER*, *HOSTMASTER*, + *REFRESH*, *RETRY* and *EXPIRE* will be kept as already + is. The same will be for *S(1 to 40)*, *T(1 to 40)* and + *D(1 to 40)* if not in raw mode and for *ZONENS* and + *ZONEDATA* if it is. + :type extra: ``dict`` + + :param ex_raw: Mode we use to do the update using zone file or not. + :type ex_raw: ``bool`` + + :rtype: :class:`Zone` + + For more info, please see + https://www.worldwidedns.net/dns_api_protocol_list_domain.asp + or + https://www.worldwidedns.net/dns_api_protocol_list_domain_raw.asp + or + https://www.worldwidedns.net/dns_api_protocol_list_domain_reseller.asp + or + https://www.worldwidedns.net/dns_api_protocol_list_domain_raw_reseller.asp + """ + + if extra is not None: + not_specified = [key for key in zone.extra.keys() if key not in extra.keys()] + else: + not_specified = zone.extra.keys() + + if ttl is None: + ttl = zone.ttl + + params = {"DOMAIN": domain, "TTL": ttl} + + for key in not_specified: + params[key] = zone.extra[key] + + if extra is not None: + params.update(extra) + + if ex_raw: + action = "/api_dns_modify_raw.asp" + + if self.reseller_id is not None: + action = "/api_dns_modify_raw_reseller.asp" + method = "POST" + else: + action = "/api_dns_modify.asp" + + if self.reseller_id is not None: + action = "/api_dns_modify_reseller.asp" + method = "GET" + response = self.connection.request(action, params=params, method=method) # noqa + zone = self.get_zone(zone.id) + + return zone + + def update_record(self, record, name, type, data, extra=None): + """ + Update an existing record. + + :param record: Record to update. + :type record: :class:`Record` + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param type: DNS record type (MX, CNAME, A, NS, SRV, TXT). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: Contains 'entry' Entry position (1 thru 40) + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + + if (extra is None) or ("entry" not in extra): + raise WorldWideDNSError(value="You must enter 'entry' parameter", driver=self) + record_id = extra.get("entry") + + if name == "": + name = "@" + + if type not in self.RECORD_TYPE_MAP: + raise RecordError( + value="Record type is not allowed", + driver=record.zone.driver, + record_id=name, + ) + zone = record.zone + extra = { + "S%s" % record_id: name, + "T%s" % record_id: type, + "D%s" % record_id: data, + } + zone = self.update_zone(zone, zone.domain, extra=extra) + record = self.get_record(zone.id, record_id) + + return record + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + Create a new zone. + + :param domain: Zone domain name (e.g. example.com) + :type domain: ``str`` + + :param type: Zone type (master / slave). + :type type: ``str`` + + :param ttl: TTL for new records. (optional) + :type ttl: ``int`` + + :param extra: Extra attributes (driver specific). (optional). Possible + parameter in here should be *DYN* which values should be + 1 for standard and 2 for dynamic. Default is 1. + :type extra: ``dict`` + + :rtype: :class:`Zone` + + For more info, please see + https://www.worldwidedns.net/dns_api_protocol_new_domain.asp + or + https://www.worldwidedns.net/dns_api_protocol_new_domain_reseller.asp + """ + + if type == "master": + _type = 0 + elif type == "slave": + _type = 1 + else: + raise ValueError(f"Unsupported type: {type}") + + if extra: + dyn = extra.get("DYN") or 1 + else: + dyn = 1 + params = {"DOMAIN": domain, "TYPE": _type} + action = "/api_dns_new_domain.asp" + + if self.reseller_id is not None: + params["DYN"] = dyn + action = "/api_dns_new_domain_reseller.asp" + self.connection.request(action, params=params) + zone = self.get_zone(domain) + + if ttl is not None: + zone = self.update_zone(zone, zone.domain, ttl=ttl) + + return zone + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a new record. + + We can create 40 record per domain. If all slots are full, we can + replace one of them by choosing a specific entry in ``extra`` argument. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone where the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS record type (MX, CNAME, A, NS, SRV, TXT). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: Contains 'entry' Entry position (1 thru 40) + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + + if (extra is None) or ("entry" not in extra): + # If no entry is specified, we look for an available one. If all + # are full, raise error. + record_id = self._get_available_record_entry(zone) + + if not record_id: + raise WorldWideDNSError(value="All record entries are full", driver=zone.driver) + else: + record_id = extra.get("entry") + + if name == "": + name = "@" + + if type not in self.RECORD_TYPE_MAP: + raise RecordError( + value="Record type is not allowed", + driver=zone.driver, + record_id=record_id, + ) + extra = { + "S%s" % record_id: name, + "T%s" % record_id: type, + "D%s" % record_id: data, + } + zone = self.update_zone(zone, zone.domain, extra=extra) + record = self.get_record(zone.id, record_id) + + return record + + def delete_zone(self, zone): + """ + Delete a zone. + + Note: This will delete all the records belonging to this zone. + + :param zone: Zone to delete. + :type zone: :class:`Zone` + + :rtype: ``bool`` + + For more information, please see + https://www.worldwidedns.net/dns_api_protocol_delete_domain.asp + or + https://www.worldwidedns.net/dns_api_protocol_delete_domain_reseller.asp + """ + params = {"DOMAIN": zone.domain} + action = "/api_dns_delete_domain.asp" + + if self.reseller_id is not None: + action = "/api_dns_delete_domain_reseller.asp" + response = self.connection.request(action, params=params) + + return response.success() + + def delete_record(self, record): + """ + Delete a record. + + :param record: Record to delete. + :type record: :class:`Record` + + :rtype: ``bool`` + """ + zone = record.zone + + for index in range(MAX_RECORD_ENTRIES): + if record.name == zone.extra["S%s" % (index + 1)]: + entry = index + 1 + + break + extra = {"S%s" % entry: "", "T%s" % entry: "NONE", "D%s" % entry: ""} + self.update_zone(zone, zone.domain, extra=extra) + + return True + + def ex_view_zone(self, domain, name_server): + """ + View zone file from a name server + + :param domain: Domain name. + :type domain: ``str`` + + :param name_server: Name server to check. (1, 2 or 3) + :type name_server: ``int`` + + :rtype: ``str`` + + For more info, please see: + https://www.worldwidedns.net/dns_api_protocol_viewzone.asp + or + https://www.worldwidedns.net/dns_api_protocol_viewzone_reseller.asp + """ + params = {"DOMAIN": domain, "NS": name_server} + action = "/api_dns_viewzone.asp" + + if self.reseller_id is not None: + action = "/api_dns_viewzone_reseller.asp" + response = self.connection.request(action, params=params) + + return response.object + + def ex_transfer_domain(self, domain, user_id): + """ + This command will allow you, if you are a reseller, to change the + userid on a domain name to another userid in your account ONLY if that + new userid is already created. + + :param domain: Domain name. + :type domain: ``str`` + + :param user_id: The new userid to connect to the domain name. + :type user_id: ``str`` + + :rtype: ``bool`` + + For more info, please see: + https://www.worldwidedns.net/dns_api_protocol_transfer.asp + """ + + if self.reseller_id is None: + raise WorldWideDNSError("This is not a reseller account", driver=self) + params = {"DOMAIN": domain, "NEW_ID": user_id} + response = self.connection.request("/api_dns_transfer.asp", params=params) + + return response.success() + + def _get_available_record_entry(self, zone): + """Return an available entry to store a record.""" + entries = zone.extra + + for entry in range(1, MAX_RECORD_ENTRIES + 1): + subdomain = entries.get("S%s" % entry) + _type = entries.get("T%s" % entry) + data = entries.get("D%s" % entry) + + if not any([subdomain, _type, data]): + return entry + + return None + + def _to_zones(self, data): + domain_list = re.split("\r?\n", data) + zones = [] + + for line in domain_list: + zone = self._to_zone(line) + zones.append(zone) + + return zones + + def _to_zone(self, line): + data = line.split("\x1f") + name = data[0] + + if data[1] == "P": + type = "master" + domain_data = self._get_domain_data(name) + resp_lines = re.split("\r?\n", domain_data.body) + soa_block = resp_lines[:6] + zone_data = resp_lines[6:] + extra = { + "HOSTMASTER": soa_block[0], + "REFRESH": soa_block[1], + "RETRY": soa_block[2], + "EXPIRE": soa_block[3], + "SECURE": soa_block[5], + } + ttl = soa_block[4] + + for line in range(MAX_RECORD_ENTRIES): + line_data = zone_data[line].split("\x1f") + extra["S%s" % (line + 1)] = line_data[0] + _type = line_data[1] + extra["T%s" % (line + 1)] = _type if _type != "NONE" else "" + try: + extra["D%s" % (line + 1)] = line_data[2] + except IndexError: + extra["D%s" % (line + 1)] = "" + elif data[1] == "S": + type = "slave" + extra = {} + ttl = 0 + else: + ttl = 0 + + return Zone(id=name, domain=name, type=type, ttl=ttl, driver=self, extra=extra) + + def _get_domain_data(self, name): + params = {"DOMAIN": name} + data = self.connection.request("/api_dns_list_domain.asp", params=params) + + return data + + def _to_records(self, zone): + records = [] + + for record_id in range(1, MAX_RECORD_ENTRIES + 1): + subdomain = zone.extra["S%s" % (record_id)] + type = zone.extra["T%s" % (record_id)] + data = zone.extra["D%s" % (record_id)] + + if subdomain and type and data: + record = self._to_record(record_id, subdomain, type, data, zone) + records.append(record) + + return records + + def _to_record(self, _id, subdomain, type, data, zone): + return Record(id=_id, name=subdomain, type=type, data=data, zone=zone, driver=zone.driver) diff --git a/libcloud/dns/drivers/zerigo.py b/libcloud/dns/drivers/zerigo.py index 0af7a9f453..0f37e0f357 100644 --- a/libcloud/dns/drivers/zerigo.py +++ b/libcloud/dns/drivers/zerigo.py @@ -13,37 +13,26 @@ # See the License for the specific language governing permissions and # limitations under the License. -__all__ = [ - 'ZerigoDNSDriver' -] +__all__ = ["ZerigoDNSDriver"] import copy import base64 -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import b - -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - -from libcloud.utils.misc import merge_valid_keys, get_new_obj -from libcloud.utils.xml import findtext, findall +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import Provider, RecordType, ZoneDoesNotExistError, RecordDoesNotExistError +from libcloud.utils.py3 import ET, b, httplib +from libcloud.utils.xml import findall, findtext +from libcloud.utils.misc import get_new_obj, merge_valid_keys from libcloud.common.base import XmlResponse, ConnectionUserAndKey -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.common.types import MalformedResponseError -from libcloud.dns.types import Provider, RecordType -from libcloud.dns.types import ZoneDoesNotExistError, RecordDoesNotExistError -from libcloud.dns.base import DNSDriver, Zone, Record +from libcloud.common.types import LibcloudError, InvalidCredsError, MalformedResponseError -API_HOST = 'ns.zerigo.com' -API_VERSION = '1.1' -API_ROOT = '/api/%s/' % (API_VERSION) +API_HOST = "ns.zerigo.com" +API_VERSION = "1.1" +API_ROOT = "/api/%s/" % (API_VERSION) -VALID_ZONE_EXTRA_PARAMS = ['notes', 'tag-list', 'ns1', 'slave-nameservers'] -VALID_RECORD_EXTRA_PARAMS = ['notes', 'ttl', 'priority'] +VALID_ZONE_EXTRA_PARAMS = ["notes", "tag-list", "ns1", "slave-nameservers"] +VALID_RECORD_EXTRA_PARAMS = ["notes", "ttl", "priority"] # Number of items per page (maximum limit is 1000) ITEMS_PER_PAGE = 100 @@ -55,11 +44,13 @@ def __init__(self, code, errors): self.errors = errors or [] def __str__(self): - return 'Errors: %s' % (', '.join(self.errors)) + return "Errors: %s" % (", ".join(self.errors)) def __repr__(self): - return ('' % ( - self.code, len(self.errors))) + return "".format( + self.code, + len(self.errors), + ) class ZerigoDNSResponse(XmlResponse): @@ -71,26 +62,25 @@ def parse_error(self): if status == 401: if not self.body: - raise InvalidCredsError(str(self.status) + ': ' + self.error) + raise InvalidCredsError(str(self.status) + ": " + self.error) else: raise InvalidCredsError(self.body) elif status == 404: context = self.connection.context - if context['resource'] == 'zone': - raise ZoneDoesNotExistError(value='', driver=self, - zone_id=context['id']) - elif context['resource'] == 'record': - raise RecordDoesNotExistError(value='', driver=self, - record_id=context['id']) + + if context["resource"] == "zone": + raise ZoneDoesNotExistError(value="", driver=self, zone_id=context["id"]) + elif context["resource"] == "record": + raise RecordDoesNotExistError(value="", driver=self, record_id=context["id"]) elif status != 503: try: body = ET.XML(self.body) - except: - raise MalformedResponseError('Failed to parse XML', - body=self.body) + except Exception: + raise MalformedResponseError("Failed to parse XML", body=self.body) errors = [] - for error in findall(element=body, xpath='error'): + + for error in findall(element=body, xpath="error"): errors.append(error.text) raise ZerigoError(code=status, errors=errors) @@ -104,70 +94,72 @@ class ZerigoDNSConnection(ConnectionUserAndKey): responseCls = ZerigoDNSResponse def add_default_headers(self, headers): - auth_b64 = base64.b64encode(b('%s:%s' % (self.user_id, self.key))) - headers['Authorization'] = 'Basic %s' % (auth_b64.decode('utf-8')) + auth_b64 = base64.b64encode(b("{}:{}".format(self.user_id, self.key))) + headers["Authorization"] = "Basic %s" % (auth_b64.decode("utf-8")) + return headers - def request(self, action, params=None, data='', headers=None, - method='GET'): + def request(self, action, params=None, data="", headers=None, method="GET"): if not headers: headers = {} + if not params: params = {} if method in ("POST", "PUT"): - headers = {'Content-Type': 'application/xml; charset=UTF-8'} - return super(ZerigoDNSConnection, self).request(action=action, - params=params, - data=data, - method=method, - headers=headers) + headers = {"Content-Type": "application/xml; charset=UTF-8"} + + return super().request( + action=action, params=params, data=data, method=method, headers=headers + ) class ZerigoDNSDriver(DNSDriver): type = Provider.ZERIGO - name = 'Zerigo DNS' - website = 'http://www.zerigo.com/' + name = "Zerigo DNS" + website = "http://www.zerigo.com/" connectionCls = ZerigoDNSConnection RECORD_TYPE_MAP = { - RecordType.A: 'A', - RecordType.AAAA: 'AAAA', - RecordType.CNAME: 'CNAME', - RecordType.GEO: 'GEO', - RecordType.MX: 'MX', - RecordType.NAPTR: 'NAPTR', - RecordType.NS: 'NS', - RecordType.PTR: 'PTR', - RecordType.REDIRECT: 'REDIRECT', - RecordType.SPF: 'SPF', - RecordType.SRV: 'SRV', - RecordType.TXT: 'TXT', - RecordType.URL: 'URL', + RecordType.A: "A", + RecordType.AAAA: "AAAA", + RecordType.CNAME: "CNAME", + RecordType.GEO: "GEO", + RecordType.MX: "MX", + RecordType.NAPTR: "NAPTR", + RecordType.NS: "NS", + RecordType.PTR: "PTR", + RecordType.REDIRECT: "REDIRECT", + RecordType.SPF: "SPF", + RecordType.SRV: "SRV", + RecordType.TXT: "TXT", + RecordType.URL: "URL", } def iterate_zones(self): - return self._get_more('zones') + return self._get_more("zones") def iterate_records(self, zone): - return self._get_more('records', zone=zone) + return self._get_more("records", zone=zone) def get_zone(self, zone_id): - path = API_ROOT + 'zones/%s.xml' % (zone_id) - self.connection.set_context({'resource': 'zone', 'id': zone_id}) + path = API_ROOT + "zones/%s.xml" % (zone_id) + self.connection.set_context({"resource": "zone", "id": zone_id}) data = self.connection.request(path).object zone = self._to_zone(elem=data) + return zone def get_record(self, zone_id, record_id): zone = self.get_zone(zone_id=zone_id) - self.connection.set_context({'resource': 'record', 'id': record_id}) - path = API_ROOT + 'hosts/%s.xml' % (record_id) + self.connection.set_context({"resource": "record", "id": record_id}) + path = API_ROOT + "hosts/%s.xml" % (record_id) data = self.connection.request(path).object record = self._to_record(elem=data, zone=zone) + return record - def create_zone(self, domain, type='master', ttl=None, extra=None): + def create_zone(self, domain, type="master", ttl=None, extra=None): """ Create a new zone. @@ -176,13 +168,13 @@ def create_zone(self, domain, type='master', ttl=None, extra=None): @inherits: :class:`DNSDriver.create_zone` """ - path = API_ROOT + 'zones.xml' - zone_elem = self._to_zone_elem(domain=domain, type=type, ttl=ttl, - extra=extra) - data = self.connection.request(action=path, - data=ET.tostring(zone_elem), - method='POST').object + path = API_ROOT + "zones.xml" + zone_elem = self._to_zone_elem(domain=domain, type=type, ttl=ttl, extra=extra) + data = self.connection.request( + action=path, data=ET.tostring(zone_elem), method="POST" + ).object zone = self._to_zone(elem=data) + return zone def update_zone(self, zone, domain=None, type=None, ttl=None, extra=None): @@ -194,24 +186,24 @@ def update_zone(self, zone, domain=None, type=None, ttl=None, extra=None): @inherits: :class:`DNSDriver.update_zone` """ + if domain: - raise LibcloudError('Domain cannot be changed', driver=self) - - path = API_ROOT + 'zones/%s.xml' % (zone.id) - zone_elem = self._to_zone_elem(domain=domain, type=type, ttl=ttl, - extra=extra) - response = self.connection.request(action=path, - data=ET.tostring(zone_elem), - method='PUT') + raise LibcloudError("Domain cannot be changed", driver=self) + + path = API_ROOT + "zones/%s.xml" % (zone.id) + zone_elem = self._to_zone_elem(domain=domain, type=type, ttl=ttl, extra=extra) + response = self.connection.request(action=path, data=ET.tostring(zone_elem), method="PUT") assert response.status == httplib.OK - merged = merge_valid_keys(params=copy.deepcopy(zone.extra), - valid_keys=VALID_ZONE_EXTRA_PARAMS, - extra=extra) - updated_zone = get_new_obj(obj=zone, klass=Zone, - attributes={'type': type, - 'ttl': ttl, - 'extra': merged}) + merged = merge_valid_keys( + params=copy.deepcopy(zone.extra), + valid_keys=VALID_ZONE_EXTRA_PARAMS, + extra=extra, + ) + updated_zone = get_new_obj( + obj=zone, klass=Zone, attributes={"type": type, "ttl": ttl, "extra": merged} + ) + return updated_zone def create_record(self, name, zone, type, data, extra=None): @@ -223,45 +215,47 @@ def create_record(self, name, zone, type, data, extra=None): @inherits: :class:`DNSDriver.create_record` """ - path = API_ROOT + 'zones/%s/hosts.xml' % (zone.id) - record_elem = self._to_record_elem(name=name, type=type, data=data, - extra=extra) - response = self.connection.request(action=path, - data=ET.tostring(record_elem), - method='POST') + path = API_ROOT + "zones/%s/hosts.xml" % (zone.id) + record_elem = self._to_record_elem(name=name, type=type, data=data, extra=extra) + response = self.connection.request( + action=path, data=ET.tostring(record_elem), method="POST" + ) assert response.status == httplib.CREATED record = self._to_record(elem=response.object, zone=zone) + return record - def update_record(self, record, name=None, type=None, data=None, - extra=None): - path = API_ROOT + 'hosts/%s.xml' % (record.id) - record_elem = self._to_record_elem(name=name, type=type, data=data, - extra=extra) - response = self.connection.request(action=path, - data=ET.tostring(record_elem), - method='PUT') + def update_record(self, record, name=None, type=None, data=None, extra=None): + path = API_ROOT + "hosts/%s.xml" % (record.id) + record_elem = self._to_record_elem(name=name, type=type, data=data, extra=extra) + response = self.connection.request(action=path, data=ET.tostring(record_elem), method="PUT") assert response.status == httplib.OK - merged = merge_valid_keys(params=copy.deepcopy(record.extra), - valid_keys=VALID_RECORD_EXTRA_PARAMS, - extra=extra) - updated_record = get_new_obj(obj=record, klass=Record, - attributes={'type': type, - 'data': data, - 'extra': merged}) + merged = merge_valid_keys( + params=copy.deepcopy(record.extra), + valid_keys=VALID_RECORD_EXTRA_PARAMS, + extra=extra, + ) + updated_record = get_new_obj( + obj=record, + klass=Record, + attributes={"type": type, "data": data, "extra": merged}, + ) + return updated_record def delete_zone(self, zone): - path = API_ROOT + 'zones/%s.xml' % (zone.id) - self.connection.set_context({'resource': 'zone', 'id': zone.id}) - response = self.connection.request(action=path, method='DELETE') + path = API_ROOT + "zones/%s.xml" % (zone.id) + self.connection.set_context({"resource": "zone", "id": zone.id}) + response = self.connection.request(action=path, method="DELETE") + return response.status == httplib.OK def delete_record(self, record): - path = API_ROOT + 'hosts/%s.xml' % (record.id) - self.connection.set_context({'resource': 'record', 'id': record.id}) - response = self.connection.request(action=path, method='DELETE') + path = API_ROOT + "hosts/%s.xml" % (record.id) + self.connection.set_context({"resource": "record", "id": record.id}) + response = self.connection.request(action=path, method="DELETE") + return response.status == httplib.OK def ex_get_zone_by_domain(self, domain): @@ -273,10 +267,11 @@ def ex_get_zone_by_domain(self, domain): :rtype: :class:`Zone` """ - path = API_ROOT + 'zones/%s.xml' % (domain) - self.connection.set_context({'resource': 'zone', 'id': domain}) + path = API_ROOT + "zones/%s.xml" % (domain) + self.connection.set_context({"resource": "zone", "id": domain}) data = self.connection.request(path).object zone = self._to_zone(elem=data) + return zone def ex_force_slave_axfr(self, zone): @@ -288,145 +283,154 @@ def ex_force_slave_axfr(self, zone): :rtype: :class:`Zone` """ - path = API_ROOT + 'zones/%s/force_slave_axfr.xml' % (zone.id) - self.connection.set_context({'resource': 'zone', 'id': zone.id}) - response = self.connection.request(path, method='POST') + path = API_ROOT + "zones/%s/force_slave_axfr.xml" % (zone.id) + self.connection.set_context({"resource": "zone", "id": zone.id}) + response = self.connection.request(path, method="POST") assert response.status == httplib.ACCEPTED + return zone def _to_zone_elem(self, domain=None, type=None, ttl=None, extra=None): - zone_elem = ET.Element('zone', {}) + zone_elem = ET.Element("zone", {}) if domain: - domain_elem = ET.SubElement(zone_elem, 'domain') + domain_elem = ET.SubElement(zone_elem, "domain") domain_elem.text = domain if type: - ns_type_elem = ET.SubElement(zone_elem, 'ns-type') - - if type == 'master': - ns_type_elem.text = 'pri_sec' - elif type == 'slave': - if not extra or 'ns1' not in extra: - raise LibcloudError('ns1 extra attribute is required ' + - 'when zone type is slave', driver=self) - - ns_type_elem.text = 'sec' - ns1_elem = ET.SubElement(zone_elem, 'ns1') - ns1_elem.text = extra['ns1'] - elif type == 'std_master': + ns_type_elem = ET.SubElement(zone_elem, "ns-type") + + if type == "master": + ns_type_elem.text = "pri_sec" + elif type == "slave": + if not extra or "ns1" not in extra: + raise LibcloudError( + "ns1 extra attribute is required " + "when zone type is slave", + driver=self, + ) + + ns_type_elem.text = "sec" + ns1_elem = ET.SubElement(zone_elem, "ns1") + ns1_elem.text = extra["ns1"] + elif type == "std_master": # TODO: Each driver should provide supported zone types # Slave name servers are elsewhere - if not extra or 'slave-nameservers' not in extra: - raise LibcloudError('slave-nameservers extra ' + - 'attribute is required whenzone ' + - 'type is std_master', driver=self) - ns_type_elem.text = 'pri' - slave_nameservers_elem = ET.SubElement(zone_elem, - 'slave-nameservers') - slave_nameservers_elem.text = extra['slave-nameservers'] + if not extra or "slave-nameservers" not in extra: + raise LibcloudError( + "slave-nameservers extra " + + "attribute is required whenzone " + + "type is std_master", + driver=self, + ) + + ns_type_elem.text = "pri" + slave_nameservers_elem = ET.SubElement(zone_elem, "slave-nameservers") + slave_nameservers_elem.text = extra["slave-nameservers"] if ttl: - default_ttl_elem = ET.SubElement(zone_elem, 'default-ttl') + default_ttl_elem = ET.SubElement(zone_elem, "default-ttl") default_ttl_elem.text = str(ttl) - if extra and 'tag-list' in extra: - tags = extra['tag-list'] + if extra and "tag-list" in extra: + tags = extra["tag-list"] - tags_elem = ET.SubElement(zone_elem, 'tag-list') - tags_elem.text = ' '.join(tags) + tags_elem = ET.SubElement(zone_elem, "tag-list") + tags_elem.text = " ".join(tags) return zone_elem def _to_record_elem(self, name=None, type=None, data=None, extra=None): - record_elem = ET.Element('host', {}) + record_elem = ET.Element("host", {}) if name: - name_elem = ET.SubElement(record_elem, 'hostname') + name_elem = ET.SubElement(record_elem, "hostname") name_elem.text = name if type is not None: - type_elem = ET.SubElement(record_elem, 'host-type') + type_elem = ET.SubElement(record_elem, "host-type") type_elem.text = self.RECORD_TYPE_MAP[type] if data: - data_elem = ET.SubElement(record_elem, 'data') + data_elem = ET.SubElement(record_elem, "data") data_elem.text = data if extra: - if 'ttl' in extra: - ttl_elem = ET.SubElement(record_elem, 'ttl', - {'type': 'integer'}) - ttl_elem.text = str(extra['ttl']) + if "ttl" in extra: + ttl_elem = ET.SubElement(record_elem, "ttl", {"type": "integer"}) + ttl_elem.text = str(extra["ttl"]) - if 'priority' in extra: + if "priority" in extra: # Only MX and SRV records support priority - priority_elem = ET.SubElement(record_elem, 'priority', - {'type': 'integer'}) + priority_elem = ET.SubElement(record_elem, "priority", {"type": "integer"}) - priority_elem.text = str(extra['priority']) + priority_elem.text = str(extra["priority"]) - if 'notes' in extra: - notes_elem = ET.SubElement(record_elem, 'notes') - notes_elem.text = extra['notes'] + if "notes" in extra: + notes_elem = ET.SubElement(record_elem, "notes") + notes_elem.text = extra["notes"] return record_elem def _to_zones(self, elem): zones = [] - for item in findall(element=elem, xpath='zone'): + for item in findall(element=elem, xpath="zone"): zone = self._to_zone(elem=item) zones.append(zone) return zones def _to_zone(self, elem): - id = findtext(element=elem, xpath='id') - domain = findtext(element=elem, xpath='domain') - type = findtext(element=elem, xpath='ns-type') - type = 'master' if type.find('pri') == 0 else 'slave' - ttl = findtext(element=elem, xpath='default-ttl') - - hostmaster = findtext(element=elem, xpath='hostmaster') - custom_ns = findtext(element=elem, xpath='custom-ns') - custom_nameservers = findtext(element=elem, xpath='custom-nameservers') - notes = findtext(element=elem, xpath='notes') - nx_ttl = findtext(element=elem, xpath='nx-ttl') - slave_nameservers = findtext(element=elem, xpath='slave-nameservers') - tags = findtext(element=elem, xpath='tag-list') - tags = tags.split(' ') if tags else [] - - extra = {'hostmaster': hostmaster, 'custom-ns': custom_ns, - 'custom-nameservers': custom_nameservers, 'notes': notes, - 'nx-ttl': nx_ttl, 'slave-nameservers': slave_nameservers, - 'tags': tags} - zone = Zone(id=str(id), domain=domain, type=type, ttl=int(ttl), - driver=self, extra=extra) + id = findtext(element=elem, xpath="id") + domain = findtext(element=elem, xpath="domain") + type = findtext(element=elem, xpath="ns-type") + type = "master" if type.find("pri") == 0 else "slave" + ttl = findtext(element=elem, xpath="default-ttl") + + hostmaster = findtext(element=elem, xpath="hostmaster") + custom_ns = findtext(element=elem, xpath="custom-ns") + custom_nameservers = findtext(element=elem, xpath="custom-nameservers") + notes = findtext(element=elem, xpath="notes") + nx_ttl = findtext(element=elem, xpath="nx-ttl") + slave_nameservers = findtext(element=elem, xpath="slave-nameservers") + tags = findtext(element=elem, xpath="tag-list") + tags = tags.split(" ") if tags else [] + + extra = { + "hostmaster": hostmaster, + "custom-ns": custom_ns, + "custom-nameservers": custom_nameservers, + "notes": notes, + "nx-ttl": nx_ttl, + "slave-nameservers": slave_nameservers, + "tags": tags, + } + zone = Zone(id=str(id), domain=domain, type=type, ttl=int(ttl), driver=self, extra=extra) + return zone def _to_records(self, elem, zone): records = [] - for item in findall(element=elem, xpath='host'): + for item in findall(element=elem, xpath="host"): record = self._to_record(elem=item, zone=zone) records.append(record) return records def _to_record(self, elem, zone): - id = findtext(element=elem, xpath='id') - name = findtext(element=elem, xpath='hostname') - type = findtext(element=elem, xpath='host-type') + id = findtext(element=elem, xpath="id") + name = findtext(element=elem, xpath="hostname") + type = findtext(element=elem, xpath="host-type") type = self._string_to_record_type(type) - data = findtext(element=elem, xpath='data') + data = findtext(element=elem, xpath="data") - notes = findtext(element=elem, xpath='notes', no_text_value=None) - state = findtext(element=elem, xpath='state', no_text_value=None) - fqdn = findtext(element=elem, xpath='fqdn', no_text_value=None) - priority = findtext(element=elem, xpath='priority', no_text_value=None) - ttl = findtext(element=elem, xpath='ttl', no_text_value=None) + notes = findtext(element=elem, xpath="notes", no_text_value=None) + state = findtext(element=elem, xpath="state", no_text_value=None) + fqdn = findtext(element=elem, xpath="fqdn", no_text_value=None) + priority = findtext(element=elem, xpath="priority", no_text_value=None) + ttl = findtext(element=elem, xpath="ttl", no_text_value=None) if not name: name = None @@ -434,11 +438,25 @@ def _to_record(self, elem, zone): if ttl: ttl = int(ttl) - extra = {'notes': notes, 'state': state, 'fqdn': fqdn, - 'priority': priority, 'ttl': ttl} + extra = { + "notes": notes, + "state": state, + "fqdn": fqdn, + "priority": priority, + "ttl": ttl, + } + + record = Record( + id=id, + name=name, + type=type, + data=data, + zone=zone, + driver=self, + ttl=ttl, + extra=extra, + ) - record = Record(id=id, name=name, type=type, data=data, - zone=zone, driver=self, extra=extra) return record def _get_more(self, rtype, **kwargs): @@ -446,39 +464,40 @@ def _get_more(self, rtype, **kwargs): last_key = None while not exhausted: - items, last_key, exhausted = self._get_data(rtype, last_key, - **kwargs) + items, last_key, exhausted = self._get_data(rtype, last_key, **kwargs) - for item in items: - yield item + yield from items def _get_data(self, rtype, last_key, **kwargs): # Note: last_key in this case really is a "last_page". # TODO: Update base driver and change last_key to something more # generic - e.g. marker params = {} - params['per_page'] = ITEMS_PER_PAGE - params['page'] = last_key + 1 if last_key else 1 + params["per_page"] = ITEMS_PER_PAGE + params["page"] = last_key + 1 if last_key else 1 - if rtype == 'zones': - path = API_ROOT + 'zones.xml' + if rtype == "zones": + path = API_ROOT + "zones.xml" response = self.connection.request(path) transform_func = self._to_zones - elif rtype == 'records': - zone = kwargs['zone'] - path = API_ROOT + 'zones/%s/hosts.xml' % (zone.id) - self.connection.set_context({'resource': 'zone', 'id': zone.id}) + elif rtype == "records": + zone = kwargs["zone"] + path = API_ROOT + "zones/%s/hosts.xml" % (zone.id) + self.connection.set_context({"resource": "zone", "id": zone.id}) response = self.connection.request(path, params=params) transform_func = self._to_records + else: + raise ValueError(f"Unsupported rtype: {rtype}") exhausted = False - result_count = int(response.headers.get('x-query-count', 0)) + result_count = int(response.headers.get("x-query-count", 0)) - if (params['page'] * ITEMS_PER_PAGE) >= result_count: + if (params["page"] * ITEMS_PER_PAGE) >= result_count: exhausted = True if response.status == httplib.OK: items = transform_func(elem=response.object, **kwargs) - return items, params['page'], exhausted + + return items, params["page"], exhausted else: return [], None, True diff --git a/libcloud/dns/drivers/zonomi.py b/libcloud/dns/drivers/zonomi.py new file mode 100644 index 0000000000..ca347367fe --- /dev/null +++ b/libcloud/dns/drivers/zonomi.py @@ -0,0 +1,341 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License.You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Zonomi DNS Driver +""" + +from libcloud.dns.base import Zone, Record, DNSDriver +from libcloud.dns.types import ( + Provider, + RecordType, + ZoneDoesNotExistError, + ZoneAlreadyExistsError, + RecordDoesNotExistError, + RecordAlreadyExistsError, +) +from libcloud.common.zonomi import ZonomiResponse, ZonomiException, ZonomiConnection + +__all__ = [ + "ZonomiDNSDriver", +] + + +class ZonomiDNSResponse(ZonomiResponse): + pass + + +class ZonomiDNSConnection(ZonomiConnection): + responseCls = ZonomiDNSResponse + + +class ZonomiDNSDriver(DNSDriver): + type = Provider.ZONOMI + name = "Zonomi DNS" + website = "https://zonomi.com" + connectionCls = ZonomiDNSConnection + + RECORD_TYPE_MAP = {RecordType.A: "A", RecordType.MX: "MX", RecordType.TXT: "TXT"} + + def list_zones(self): + """ + Return a list of zones. + + :return: ``list`` of :class:`Zone` + """ + action = "/app/dns/dyndns.jsp?" + params = {"action": "QUERYZONES", "api_key": self.key} + + response = self.connection.request(action=action, params=params) + zones = self._to_zones(response.objects) + + return zones + + def list_records(self, zone): + """ + Return a list of records for the provided zone. + + :param zone: Zone to list records for. + :type zone: :class:`Zone` + + :return: ``list`` of :class:`Record` + """ + action = "/app/dns/dyndns.jsp?" + params = {"action": "QUERY", "name": "**." + zone.id} + try: + response = self.connection.request(action=action, params=params) + except ZonomiException as e: + if e.code == "404": + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + raise e + + records = self._to_records(response.objects, zone) + + return records + + def get_zone(self, zone_id): + """ + Return a Zone instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + zone = None + zones = self.list_zones() + for z in zones: + if z.id == zone_id: + zone = z + + if zone is None: + raise ZoneDoesNotExistError(zone_id=zone_id, driver=self, value="") + + return zone + + def get_record(self, zone_id, record_id): + """ + Return a Record instance. + + :param zone_id: ID of the required zone + :type zone_id: ``str`` + + :param record_id: ID of the required record + :type record_id: ``str`` + + :rtype: :class:`Record` + """ + record = None + zone = self.get_zone(zone_id=zone_id) + records = self.list_records(zone=zone) + + for r in records: + if r.id == record_id: + record = r + + if record is None: + raise RecordDoesNotExistError(record_id=record_id, driver=self, value="") + + return record + + def create_zone(self, domain, type="master", ttl=None, extra=None): + """ + Create a new zone. + + :param zone_id: Zone domain name (e.g. example.com) + :type zone_id: ``str`` + + :rtype: :class:`Zone` + """ + action = "/app/dns/addzone.jsp?" + params = {"name": domain} + try: + self.connection.request(action=action, params=params) + except ZonomiException as e: + if e.message == "ERROR: This zone is already in your zone list.": + raise ZoneAlreadyExistsError(zone_id=domain, driver=self, value=e.message) + raise e + + zone = Zone(id=domain, domain=domain, type="master", ttl=ttl, driver=self, extra=extra) + return zone + + def create_record(self, name, zone, type, data, extra=None): + """ + Create a new record. + + :param name: Record name without the domain name (e.g. www). + Note: If you want to create a record for a base domain + name, you should specify empty string ('') for this + argument. + :type name: ``str`` + + :param zone: Zone where the requested record is created. + :type zone: :class:`Zone` + + :param type: DNS record type (A, MX, TXT). + :type type: :class:`RecordType` + + :param data: Data for the record (depends on the record type). + :type data: ``str`` + + :param extra: Extra attributes (driver specific, e.g. 'prio' or 'ttl'). + (optional) + :type extra: ``dict`` + + :rtype: :class:`Record` + """ + action = "/app/dns/dyndns.jsp?" + if name: + record_name = name + "." + zone.domain + else: + record_name = zone.domain + params = {"action": "SET", "name": record_name, "value": data, "type": type} + + if type == "MX" and extra is not None: + params["prio"] = extra.get("prio") + try: + response = self.connection.request(action=action, params=params) + except ZonomiException as e: + if ("ERROR: No zone found for %s" % record_name) in e.message: + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + raise e + + # we determine if an A or MX record already exists + # by looking at the response.If the key 'skipped' is present in the + # response, it means record already exists. If this is True, + # then raise RecordAlreadyExistsError + if len(response.objects) != 0 and response.objects[0].get("skipped") == "unchanged": + raise RecordAlreadyExistsError(record_id=name, driver=self, value="") + + if "DELETED" in response.objects: + for el in response.objects[:2]: + if el.get("content") == data: + response.objects = [el] + records = self._to_records(response.objects, zone=zone) + return records[0] + + def delete_zone(self, zone): + """ + Delete a zone. + + Note: This will delete all the records belonging to this zone. + + :param zone: Zone to delete. + :type zone: :class:`Zone` + + :rtype: ``bool`` + """ + action = "/app/dns/dyndns.jsp?" + params = {"action": "DELETEZONE", "name": zone.id} + try: + response = self.connection.request(action=action, params=params) + except ZonomiException as e: + if e.code == "404": + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + raise e + + return "DELETED" in response.objects + + def delete_record(self, record): + """ + Use this method to delete a record. + + :param record: record to delete + :type record: `Record` + + :rtype: Bool + """ + action = "/app/dns/dyndns.jsp?" + params = {"action": "DELETE", "name": record.name, "type": record.type} + try: + response = self.connection.request(action=action, params=params) + except ZonomiException as e: + if e.message == "Record not deleted.": + raise RecordDoesNotExistError(record_id=record.id, driver=self, value=e.message) + raise e + + return "DELETED" in response.objects + + def ex_convert_to_secondary(self, zone, master): + """ + Convert existent zone to slave. + + :param zone: Zone to convert. + :type zone: :class:`Zone` + + :param master: the specified master name server IP address. + :type master: ``str`` + + :rtype: Bool + """ + action = "/app/dns/converttosecondary.jsp?" + params = {"name": zone.domain, "master": master} + try: + self.connection.request(action=action, params=params) + except ZonomiException as e: + if "ERROR: Could not find" in e.message: + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + return True + + def ex_convert_to_master(self, zone): + """ + Convert existent zone to master. + + :param zone: Zone to convert. + :type zone: :class:`Zone` + + :rtype: Bool + """ + action = "/app/dns/converttomaster.jsp?" + params = {"name": zone.domain} + try: + self.connection.request(action=action, params=params) + except ZonomiException as e: + if "ERROR: Could not find" in e.message: + raise ZoneDoesNotExistError(zone_id=zone.id, driver=self, value=e.message) + return True + + def _to_zone(self, item): + if item["type"] == "NATIVE": + type = "master" + elif item["type"] == "SLAVE": + type = "slave" + zone = Zone( + id=item["name"], + domain=item["name"], + type=type, + driver=self, + extra={}, + ttl=None, + ) + + return zone + + def _to_zones(self, items): + zones = [] + for item in items: + zones.append(self._to_zone(item)) + + return zones + + def _to_record(self, item, zone): + if len(item.get("ttl")) > 0: + ttl = item.get("ttl").split(" ")[0] + else: + ttl = None + extra = {"ttl": ttl, "prio": item.get("prio")} + if len(item["name"]) > len(zone.domain): + full_domain = item["name"] + index = full_domain.index("." + zone.domain) + record_name = full_domain[:index] + else: + record_name = zone.domain + record = Record( + id=record_name, + name=record_name, + data=item["content"], + type=item["type"], + zone=zone, + driver=self, + ttl=ttl, + extra=extra, + ) + + return record + + def _to_records(self, items, zone): + records = [] + for item in items: + records.append(self._to_record(item, zone)) + + return records diff --git a/libcloud/dns/providers.py b/libcloud/dns/providers.py index dc8046027b..7469275897 100644 --- a/libcloud/dns/providers.py +++ b/libcloud/dns/providers.py @@ -13,39 +13,64 @@ # See the License for the specific language governing permissions and # limitations under the License. -from libcloud.utils.misc import get_driver as get_provider_driver -from libcloud.utils.misc import set_driver as set_provider_driver -from libcloud.dns.types import Provider +from types import ModuleType +from typing import TYPE_CHECKING, Type, Union + +from libcloud.dns.types import OLD_CONSTANT_TO_NEW_MAPPING, Provider +from libcloud.common.providers import get_driver as _get_provider_driver +from libcloud.common.providers import set_driver as _set_provider_driver + +if TYPE_CHECKING: + # NOTE: This is needed to avoid having setup.py depend on requests + from libcloud.dns.base import DNSDriver + + +__all__ = ["DRIVERS", "get_driver", "set_driver"] DRIVERS = { - Provider.DUMMY: - ('libcloud.dns.drivers.dummy', 'DummyDNSDriver'), - Provider.LINODE: - ('libcloud.dns.drivers.linode', 'LinodeDNSDriver'), - Provider.ZERIGO: - ('libcloud.dns.drivers.zerigo', 'ZerigoDNSDriver'), - Provider.RACKSPACE: - ('libcloud.dns.drivers.rackspace', 'RackspaceDNSDriver'), - Provider.HOSTVIRTUAL: - ('libcloud.dns.drivers.hostvirtual', 'HostVirtualDNSDriver'), - Provider.ROUTE53: - ('libcloud.dns.drivers.route53', 'Route53DNSDriver'), - Provider.GANDI: - ('libcloud.dns.drivers.gandi', 'GandiDNSDriver'), - Provider.GOOGLE: ('libcloud.dns.drivers.google', 'GoogleDNSDriver'), - Provider.SOFTLAYER: - ('libcloud.dns.drivers.softlayer', 'SoftLayerDNSDriver'), + Provider.DUMMY: ("libcloud.dns.drivers.dummy", "DummyDNSDriver"), + Provider.LINODE: ("libcloud.dns.drivers.linode", "LinodeDNSDriver"), + Provider.ZERIGO: ("libcloud.dns.drivers.zerigo", "ZerigoDNSDriver"), + Provider.RACKSPACE: ("libcloud.dns.drivers.rackspace", "RackspaceDNSDriver"), + Provider.ROUTE53: ("libcloud.dns.drivers.route53", "Route53DNSDriver"), + Provider.GANDI: ("libcloud.dns.drivers.gandi", "GandiDNSDriver"), + Provider.GANDI_LIVE: ("libcloud.dns.drivers.gandi_live", "GandiLiveDNSDriver"), + Provider.GOOGLE: ("libcloud.dns.drivers.google", "GoogleDNSDriver"), + Provider.DIGITAL_OCEAN: ( + "libcloud.dns.drivers.digitalocean", + "DigitalOceanDNSDriver", + ), + Provider.WORLDWIDEDNS: ("libcloud.dns.drivers.worldwidedns", "WorldWideDNSDriver"), + Provider.DNSIMPLE: ("libcloud.dns.drivers.dnsimple", "DNSimpleDNSDriver"), + Provider.POINTDNS: ("libcloud.dns.drivers.pointdns", "PointDNSDriver"), + Provider.VULTR: ("libcloud.dns.drivers.vultr", "VultrDNSDriver"), + Provider.LIQUIDWEB: ("libcloud.dns.drivers.liquidweb", "LiquidWebDNSDriver"), + Provider.ZONOMI: ("libcloud.dns.drivers.zonomi", "ZonomiDNSDriver"), + Provider.DURABLEDNS: ("libcloud.dns.drivers.durabledns", "DurableDNSDriver"), + Provider.AURORADNS: ("libcloud.dns.drivers.auroradns", "AuroraDNSDriver"), + Provider.GODADDY: ("libcloud.dns.drivers.godaddy", "GoDaddyDNSDriver"), + Provider.CLOUDFLARE: ("libcloud.dns.drivers.cloudflare", "CloudFlareDNSDriver"), + Provider.NFSN: ("libcloud.dns.drivers.nfsn", "NFSNDNSDriver"), + Provider.NSONE: ("libcloud.dns.drivers.nsone", "NsOneDNSDriver"), + Provider.LUADNS: ("libcloud.dns.drivers.luadns", "LuadnsDNSDriver"), + Provider.BUDDYNS: ("libcloud.dns.drivers.buddyns", "BuddyNSDNSDriver"), + Provider.POWERDNS: ("libcloud.dns.drivers.powerdns", "PowerDNSDriver"), + Provider.ONAPP: ("libcloud.dns.drivers.onapp", "OnAppDNSDriver"), + Provider.RCODEZERO: ("libcloud.dns.drivers.rcodezero", "RcodeZeroDNSDriver"), # Deprecated - Provider.RACKSPACE_US: - ('libcloud.dns.drivers.rackspace', 'RackspaceUSDNSDriver'), - Provider.RACKSPACE_UK: - ('libcloud.dns.drivers.rackspace', 'RackspaceUKDNSDriver') + Provider.RACKSPACE_US: ("libcloud.dns.drivers.rackspace", "RackspaceUSDNSDriver"), + Provider.RACKSPACE_UK: ("libcloud.dns.drivers.rackspace", "RackspaceUKDNSDriver"), } def get_driver(provider): - return get_provider_driver(DRIVERS, provider) + # type: (Union[Provider, str]) -> Type[DNSDriver] + deprecated_constants = OLD_CONSTANT_TO_NEW_MAPPING + return _get_provider_driver( + drivers=DRIVERS, provider=provider, deprecated_constants=deprecated_constants + ) def set_driver(provider, module, klass): - return set_provider_driver(DRIVERS, provider, module, klass) + # type: (Union[Provider, str], ModuleType, type) -> Type[DNSDriver] + return _set_provider_driver(drivers=DRIVERS, provider=provider, module=module, klass=klass) diff --git a/libcloud/dns/types.py b/libcloud/dns/types.py index 32bceb5ea1..ec2cb7b45f 100644 --- a/libcloud/dns/types.py +++ b/libcloud/dns/types.py @@ -16,101 +16,152 @@ from libcloud.common.types import LibcloudError __all__ = [ - 'Provider', - 'RecordType', - 'ZoneError', - 'ZoneDoesNotExistError', - 'ZoneAlreadyExistsError', - 'RecordError', - 'RecordDoesNotExistError', - 'RecordAlreadyExistsError' + "Provider", + "RecordType", + "ZoneError", + "ZoneDoesNotExistError", + "ZoneAlreadyExistsError", + "RecordError", + "RecordDoesNotExistError", + "RecordAlreadyExistsError", + "OLD_CONSTANT_TO_NEW_MAPPING", ] -class Provider(object): - DUMMY = 'dummy' - LINODE = 'linode' - RACKSPACE = 'rackspace' - ZERIGO = 'zerigo' - ROUTE53 = 'route53' - HOSTVIRTUAL = 'hostvirtual' - GANDI = 'gandi' - GOOGLE = 'google' - SOFTLAYER = 'softlayer' +class Provider: + """ + Defines for each of the supported providers + + Non-Dummy drivers are sorted in alphabetical order. Please preserve this + ordering when adding new drivers. + """ + DUMMY = "dummy" + AURORADNS = "auroradns" + BUDDYNS = "buddyns" + CLOUDFLARE = "cloudflare" + DIGITAL_OCEAN = "digitalocean" + DNSIMPLE = "dnsimple" + DURABLEDNS = "durabledns" + GANDI = "gandi" + GANDI_LIVE = "gandi_live" + GODADDY = "godaddy" + GOOGLE = "google" + LINODE = "linode" + LIQUIDWEB = "liquidweb" + LUADNS = "luadns" + NFSN = "nfsn" + NSONE = "nsone" + ONAPP = "onapp" + POINTDNS = "pointdns" + POWERDNS = "powerdns" + RACKSPACE = "rackspace" + RCODEZERO = "rcodezero" + ROUTE53 = "route53" + VULTR = "vultr" + WORLDWIDEDNS = "worldwidedns" + ZERIGO = "zerigo" + ZONOMI = "zonomi" + DNSPOD = "dnspod" # Deprecated - RACKSPACE_US = 'rackspace_us' - RACKSPACE_UK = 'rackspace_uk' + RACKSPACE_US = "rackspace_us" + RACKSPACE_UK = "rackspace_uk" + + +OLD_CONSTANT_TO_NEW_MAPPING = { + Provider.RACKSPACE_US: Provider.RACKSPACE, + Provider.RACKSPACE_UK: Provider.RACKSPACE, +} -class RecordType(object): +class RecordType: + # TODO: Fix all the affected code and tests and use base Type class here """ DNS record type. """ - A = 'A' - AAAA = 'AAAA' - MX = 'MX' - NS = 'NS' - CNAME = 'CNAME' - DNAME = 'DNAME' - TXT = 'TXT' - PTR = 'PTR' - SOA = 'SOA' - SPF = 'SPF' - SRV = 'SRV' - PTR = 'PTR' - NAPTR = 'NAPTR' - REDIRECT = 'REDIRECT' - GEO = 'GEO' - URL = 'URL' - WKS = 'WKS' - LOC = 'LOC' + A = "A" + AAAA = "AAAA" + AFSDB = "A" + ALIAS = "ALIAS" + CERT = "CERT" + CNAME = "CNAME" + DNAME = "DNAME" + DNSKEY = "DNSKEY" + DS = "DS" + GEO = "GEO" + HINFO = "HINFO" + KEY = "KEY" + LOC = "LOC" + MX = "MX" + NAPTR = "NAPTR" + NS = "NS" + NSEC = "NSEC" + OPENPGPKEY = "OPENPGPKEY" + PTR = "PTR" + REDIRECT = "REDIRECT" + RP = "RP" + RRSIG = "RRSIG" + SOA = "SOA" + SPF = "SPF" + SRV = "SRV" + SSHFP = "SSHFP" + TLSA = "TLSA" + TXT = "TXT" + URL = "URL" + WKS = "WKS" + CAA = "CAA" class ZoneError(LibcloudError): - error_type = 'ZoneError' - kwargs = ('zone_id', ) + error_type = "ZoneError" + kwargs = ("zone_id",) def __init__(self, value, driver, zone_id): self.zone_id = zone_id - super(ZoneError, self).__init__(value=value, driver=driver) + super().__init__(value=value, driver=driver) def __str__(self): return self.__repr__() def __repr__(self): - return ('<%s in %s, zone_id=%s, value=%s>' % - (self.error_type, repr(self.driver), - self.zone_id, self.value)) + return "<{} in {}, zone_id={}, value={}>".format( + self.error_type, + repr(self.driver), + self.zone_id, + self.value, + ) class ZoneDoesNotExistError(ZoneError): - error_type = 'ZoneDoesNotExistError' + error_type = "ZoneDoesNotExistError" class ZoneAlreadyExistsError(ZoneError): - error_type = 'ZoneAlreadyExistsError' + error_type = "ZoneAlreadyExistsError" class RecordError(LibcloudError): - error_type = 'RecordError' + error_type = "RecordError" def __init__(self, value, driver, record_id): self.record_id = record_id - super(RecordError, self).__init__(value=value, driver=driver) + super().__init__(value=value, driver=driver) def __str__(self): return self.__repr__() def __repr__(self): - return ('<%s in %s, record_id=%s, value=%s>' % - (self.error_type, repr(self.driver), - self.record_id, self.value)) + return "<{} in {}, record_id={}, value={}>".format( + self.error_type, + repr(self.driver), + self.record_id, + self.value, + ) class RecordDoesNotExistError(RecordError): - error_type = 'RecordDoesNotExistError' + error_type = "RecordDoesNotExistError" class RecordAlreadyExistsError(RecordError): - error_type = 'RecordAlreadyExistsError' + error_type = "RecordAlreadyExistsError" diff --git a/libcloud/http.py b/libcloud/http.py new file mode 100644 index 0000000000..f6dc59fd0c --- /dev/null +++ b/libcloud/http.py @@ -0,0 +1,361 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Subclass for httplib.HTTPSConnection with optional certificate name +verification, depending on libcloud.security settings. +""" + +import warnings + +import requests +from requests.utils import should_bypass_proxies +from requests.adapters import HTTPAdapter + +try: + # requests no longer vendors urllib3 in newer versions + # https://github.com/python/typeshed/issues/6893#issuecomment-1012511758 + from urllib3.poolmanager import PoolManager +except ImportError: + from requests.packages.urllib3.poolmanager import PoolManager # type: ignore + +import libcloud.security +from libcloud.utils.py3 import urlparse + +__all__ = ["LibcloudBaseConnection", "LibcloudConnection"] + +ALLOW_REDIRECTS = 1 + +# Default timeout for HTTP requests in seconds +DEFAULT_REQUEST_TIMEOUT = 60 + + +class SignedHTTPSAdapter(HTTPAdapter): + def __init__(self, cert_file, key_file): + self.cert_file = cert_file + self.key_file = key_file + super().__init__() + + def init_poolmanager(self, connections, maxsize, block=False): + self.poolmanager = PoolManager( + num_pools=connections, + maxsize=maxsize, + block=block, + cert_file=self.cert_file, + key_file=self.key_file, + ) + + +class LibcloudBaseConnection: + """ + Base connection class to inherit from. + + Note: This class should not be instantiated directly. + """ + + session = None + + proxy_scheme = None + proxy_host = None + proxy_port = None + + proxy_username = None + proxy_password = None + + http_proxy_used = False + + ca_cert = None + + def __init__(self): + self.session = requests.Session() + + def set_http_proxy(self, proxy_url): + """ + Set a HTTP proxy which will be used with this connection. + This will override any proxy environment variables. + + :param proxy_url: Proxy URL (e.g. http://: without + authentication and + http://:@: for + basic auth authentication information. + :type proxy_url: ``str`` + """ + result = self._parse_proxy_url(proxy_url=proxy_url) + + scheme = result[0] + host = result[1] + port = result[2] + username = result[3] + password = result[4] + + self.proxy_scheme = scheme + self.proxy_host = host + self.proxy_port = port + self.proxy_username = username + self.proxy_password = password + self.http_proxy_used = True + + self.session.proxies = { + "http": proxy_url, + "https": proxy_url, + } + + def _proxies_for_url(self, url): + """ + Return the proxy mapping to use for ``url``. + + An explicitly configured proxy is skipped when the target host matches + the ``no_proxy`` / ``NO_PROXY`` environment variable, so libcloud + behaves consistently with other HTTP clients. + + :param url: Absolute request URL. + :type url: ``str`` + + :rtype: ``dict`` or ``None`` + """ + if not self.session.proxies: + return None + + if should_bypass_proxies(url, no_proxy=None): + # Explicitly disable the configured schemes. Returning {} is not + # enough: requests merges per-request proxies with the session + # proxies, so the session-level proxy would be merged back in. + # ``None`` values are stripped by requests' merge, leaving an + # empty effective mapping. + return {"http": None, "https": None} + + return None + + def _parse_proxy_url(self, proxy_url): + """ + Parse and validate a proxy URL. + + :param proxy_url: Proxy URL (e.g. http://hostname:3128) + :type proxy_url: ``str`` + + :rtype: ``tuple`` (``scheme``, ``hostname``, ``port``) + """ + parsed = urlparse.urlparse(proxy_url) + + if parsed.scheme not in ("http", "https"): + raise ValueError("Only http and https proxies are supported") + + if not parsed.hostname or not parsed.port: + raise ValueError( + "proxy_url must be in the following format: " "://:" + ) + + proxy_scheme = parsed.scheme + proxy_host, proxy_port = parsed.hostname, parsed.port + + netloc = parsed.netloc + + if "@" in netloc: + username_password = netloc.split("@", 1)[0] + split = username_password.split(":", 1) + + if len(split) < 2: + raise ValueError("URL is in an invalid format") + + proxy_username, proxy_password = split[0], split[1] + else: + proxy_username = None + proxy_password = None + + return (proxy_scheme, proxy_host, proxy_port, proxy_username, proxy_password) + + def _setup_verify(self): + self.verify = libcloud.security.VERIFY_SSL_CERT + + def _setup_ca_cert(self, **kwargs): + # simulating keyword-only argument in Python 2 + ca_certs_path = kwargs.get("ca_cert", libcloud.security.CA_CERTS_PATH) + + if self.verify is False: + pass + else: + if isinstance(ca_certs_path, list): + msg = ( + "Providing a list of CA trusts is no longer supported " + "since libcloud 2.0. Using the first element in the list. " + "See http://libcloud.readthedocs.io/en/latest/other/" + "changes_in_2_0.html#providing-a-list-of-ca-trusts-is-no-" + "longer-supported" + ) + warnings.warn(msg, DeprecationWarning) + self.ca_cert = ca_certs_path[0] + else: + self.ca_cert = ca_certs_path + + def _setup_signing(self, cert_file=None, key_file=None): + """ + Setup request signing by mounting a signing + adapter to the session + """ + self.session.mount("https://", SignedHTTPSAdapter(cert_file, key_file)) + + +class LibcloudConnection(LibcloudBaseConnection): + timeout = None + host = None + response = None + + def __init__(self, host, port, secure=None, **kwargs): + scheme = "https" if secure is not None and secure else "http" + self.host = "{}://{}{}".format( + "https" if port == 443 else scheme, + host, + ":{}".format(port) if port not in (80, 443) else "", + ) + + # Connection argument has precedence over environment variables, which are handled downstream + proxy_url = kwargs.pop("proxy_url", None) + + self._setup_verify() + self._setup_ca_cert() + + LibcloudBaseConnection.__init__(self) + + self.session.timeout = kwargs.pop("timeout", DEFAULT_REQUEST_TIMEOUT) + + if "cert_file" in kwargs or "key_file" in kwargs: + self._setup_signing(**kwargs) + + if proxy_url: + self.set_http_proxy(proxy_url=proxy_url) + + @property + def verification(self): + """ + The option for SSL verification given to underlying requests + """ + return self.ca_cert if self.ca_cert is not None else self.verify + + def request(self, method, url, body=None, headers=None, raw=False, stream=False, hooks=None): + url = urlparse.urljoin(self.host, url) + headers = self._normalize_headers(headers=headers) + + self.response = self.session.request( + method=method.lower(), + url=url, + data=body, + headers=headers, + allow_redirects=ALLOW_REDIRECTS, + stream=stream, + verify=self.verification, + timeout=self.session.timeout, + hooks=hooks, + proxies=self._proxies_for_url(url), + ) + + def prepared_request(self, method, url, body=None, headers=None, raw=False, stream=False): + headers = self._normalize_headers(headers=headers) + + req = requests.Request(method, "".join([self.host, url]), data=body, headers=headers) + + prepped = self.session.prepare_request(req) + + self.response = self.session.send( + prepped, + stream=stream, + verify=self.ca_cert if self.ca_cert is not None else self.verify, + ) + + def getresponse(self): + return self.response + + def getheaders(self): + # urlib decoded response body, libcloud has a bug + # and will not check if content is gzipped, so let's + # remove headers indicating compressed content. + if "content-encoding" in self.response.headers: + del self.response.headers["content-encoding"] + return self.response.headers + + @property + def status(self): + return self.response.status_code + + @property + def reason(self): + return None if self.response.status_code > 400 else self.response.text + + def connect(self): # pragma: no cover + pass + + def read(self): + return self.response.content + + def close(self): # pragma: no cover + # return connection back to pool + self.response.close() + + def _normalize_headers(self, headers): + headers = headers or {} + + # all headers should be strings + for key, value in headers.items(): + if isinstance(value, (int, float)): + headers[key] = str(value) + + return headers + + +class HttpLibResponseProxy: + """ + Provides a proxy pattern around the :class:`requests.Response` + object to a :class:`httplib.HTTPResponse` object + """ + + def __init__(self, response): + self._response = response + + def read(self, amt=None): + return self._response.text + + def getheader(self, name, default=None): + """ + Get the contents of the header name, or default + if there is no matching header. + """ + if name in self._response.headers.keys(): + return self._response.headers[name] + else: + return default + + def getheaders(self): + """ + Return a list of (header, value) tuples. + """ + return list(self._response.headers.items()) + + @property + def status(self): + return self._response.status_code + + @property + def reason(self): + return self._response.reason + + @property + def version(self): + # requests doesn't expose this + return "11" + + @property + def body(self): + # NOTE: We use property to avoid saving whole response body into RAM + # See https://github.com/apache/libcloud/pull/1132 for details + return self._response.content diff --git a/libcloud/httplib_ssl.py b/libcloud/httplib_ssl.py deleted file mode 100644 index cac4098b49..0000000000 --- a/libcloud/httplib_ssl.py +++ /dev/null @@ -1,286 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Subclass for httplib.HTTPSConnection with optional certificate name -verification, depending on libcloud.security settings. -""" -import os -import sys -import socket -import ssl -import base64 -import warnings - -import libcloud.security -from libcloud.utils.py3 import b -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlparse -from libcloud.utils.py3 import urlunquote -from libcloud.utils.py3 import match_hostname -from libcloud.utils.py3 import CertificateError - - -__all__ = [ - 'LibcloudBaseConnection', - 'LibcloudHTTPConnection', - 'LibcloudHTTPSConnection' -] - -HTTP_PROXY_ENV_VARIABLE_NAME = 'http_proxy' - - -class LibcloudBaseConnection(object): - """ - Base connection class to inherit from. - - Note: This class should not be instantiated directly. - """ - - proxy_scheme = None - proxy_host = None - proxy_port = None - - proxy_username = None - proxy_password = None - - http_proxy_used = False - - def set_http_proxy(self, proxy_url): - """ - Set a HTTP proxy which will be used with this connection. - - :param proxy_url: Proxy URL (e.g. http://: without - authentication and - http://:@: for - basic auth authentication information. - :type proxy_url: ``str`` - """ - result = self._parse_proxy_url(proxy_url=proxy_url) - scheme = result[0] - host = result[1] - port = result[2] - username = result[3] - password = result[4] - - self.proxy_scheme = scheme - self.proxy_host = host - self.proxy_port = port - self.proxy_username = username - self.proxy_password = password - self.http_proxy_used = True - - self._setup_http_proxy() - - def _parse_proxy_url(self, proxy_url): - """ - Parse and validate a proxy URL. - - :param proxy_url: Proxy URL (e.g. http://hostname:3128) - :type proxy_url: ``str`` - - :rtype: ``tuple`` (``scheme``, ``hostname``, ``port``) - """ - parsed = urlparse.urlparse(proxy_url) - - if parsed.scheme != 'http': - raise ValueError('Only http proxies are supported') - - if not parsed.hostname or not parsed.port: - raise ValueError('proxy_url must be in the following format: ' - 'http://:') - - proxy_scheme = parsed.scheme - proxy_host, proxy_port = parsed.hostname, parsed.port - - netloc = parsed.netloc - - if '@' in netloc: - username_password = netloc.split('@', 1)[0] - split = username_password.split(':', 1) - - if len(split) < 2: - raise ValueError('URL is in an invalid format') - - proxy_username, proxy_password = split[0], split[1] - else: - proxy_username = None - proxy_password = None - - return (proxy_scheme, proxy_host, proxy_port, proxy_username, - proxy_password) - - def _setup_http_proxy(self): - """ - Set up HTTP proxy. - - :param proxy_url: Proxy URL (e.g. http://:3128) - :type proxy_url: ``str`` - """ - headers = {} - - if self.proxy_username and self.proxy_password: - # Include authentication header - user_pass = '%s:%s' % (self.proxy_username, self.proxy_password) - encoded = base64.encodestring(b(urlunquote(user_pass))).strip() - auth_header = 'Basic %s' % (encoded.decode('utf-8')) - headers['Proxy-Authorization'] = auth_header - - if hasattr(self, 'set_tunnel'): - # Python 2.7 and higher - # pylint: disable=no-member - self.set_tunnel(host=self.host, port=self.port, headers=headers) - elif hasattr(self, '_set_tunnel'): - # Python 2.6 - # pylint: disable=no-member - self._set_tunnel(host=self.host, port=self.port, headers=headers) - else: - raise ValueError('Unsupported Python version') - - self._set_hostport(host=self.proxy_host, port=self.proxy_port) - - def _activate_http_proxy(self, sock): - self.sock = sock - self._tunnel() # pylint: disable=no-member - - def _set_hostport(self, host, port): - """ - Backported from Python stdlib so Proxy support also works with - Python 3.4. - """ - if port is None: - i = host.rfind(':') - j = host.rfind(']') # ipv6 addresses have [...] - if i > j: - try: - port = int(host[i + 1:]) - except ValueError: - msg = "nonnumeric port: '%s'" % (host[i + 1:]) - raise httplib.InvalidURL(msg) - host = host[:i] - else: - port = self.default_port # pylint: disable=no-member - if host and host[0] == '[' and host[-1] == ']': - host = host[1:-1] - self.host = host - self.port = port - - -class LibcloudHTTPConnection(httplib.HTTPConnection, LibcloudBaseConnection): - def __init__(self, *args, **kwargs): - # Support for HTTP proxy - proxy_url_env = os.environ.get(HTTP_PROXY_ENV_VARIABLE_NAME, None) - proxy_url = kwargs.pop('proxy_url', proxy_url_env) - - super(LibcloudHTTPConnection, self).__init__(*args, **kwargs) - - if proxy_url: - self.set_http_proxy(proxy_url=proxy_url) - - -class LibcloudHTTPSConnection(httplib.HTTPSConnection, LibcloudBaseConnection): - """ - LibcloudHTTPSConnection - - Subclass of HTTPSConnection which verifies certificate names - if and only if CA certificates are available. - """ - verify = True # verify by default - ca_cert = None # no default CA Certificate - - def __init__(self, *args, **kwargs): - """ - Constructor - """ - self._setup_verify() - # Support for HTTP proxy - proxy_url_env = os.environ.get(HTTP_PROXY_ENV_VARIABLE_NAME, None) - proxy_url = kwargs.pop('proxy_url', proxy_url_env) - - super(LibcloudHTTPSConnection, self).__init__(*args, **kwargs) - - if proxy_url: - self.set_http_proxy(proxy_url=proxy_url) - - def _setup_verify(self): - """ - Setup Verify SSL or not - - Reads security module's VERIFY_SSL_CERT and toggles whether - the class overrides the connect() class method or runs the - inherited httplib.HTTPSConnection connect() - """ - self.verify = libcloud.security.VERIFY_SSL_CERT - - if self.verify: - self._setup_ca_cert() - else: - warnings.warn(libcloud.security.VERIFY_SSL_DISABLED_MSG) - - def _setup_ca_cert(self): - """ - Setup CA Certs - - Search in CA_CERTS_PATH for valid candidates and - return first match. Otherwise, complain about certs - not being available. - """ - if not self.verify: - return - - ca_certs_available = [cert - for cert in libcloud.security.CA_CERTS_PATH - if os.path.exists(cert) and os.path.isfile(cert)] - if ca_certs_available: - # use first available certificate - self.ca_cert = ca_certs_available[0] - else: - raise RuntimeError( - libcloud.security.CA_CERTS_UNAVAILABLE_ERROR_MSG) - - def connect(self): - """ - Connect - - Checks if verification is toggled; if not, just call - httplib.HTTPSConnection's connect - """ - if not self.verify: - return httplib.HTTPSConnection.connect(self) - - # otherwise, create a connection and verify the hostname - # use socket.create_connection (in 2.6+) if possible - if getattr(socket, 'create_connection', None): - sock = socket.create_connection((self.host, self.port), - self.timeout) - else: - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sock.connect((self.host, self.port)) - - # Activate the HTTP proxy - if self.http_proxy_used: - self._activate_http_proxy(sock=sock) - - self.sock = ssl.wrap_socket(sock, - self.key_file, - self.cert_file, - cert_reqs=ssl.CERT_REQUIRED, - ca_certs=self.ca_cert, - ssl_version=libcloud.security.SSL_VERSION) - cert = self.sock.getpeercert() - try: - match_hostname(cert, self.host) - except CertificateError: - e = sys.exc_info()[1] - raise ssl.SSLError('Failed to verify hostname: %s' % (str(e))) diff --git a/libcloud/loadbalancer/__init__.py b/libcloud/loadbalancer/__init__.py index 70891776ff..ec6c80c612 100644 --- a/libcloud/loadbalancer/__init__.py +++ b/libcloud/loadbalancer/__init__.py @@ -17,9 +17,4 @@ Module for working with Load Balancers """ -__all__ = [ - 'base', - 'providers', - 'types', - 'drivers' -] +__all__ = ["base", "providers", "types", "drivers"] diff --git a/libcloud/loadbalancer/base.py b/libcloud/loadbalancer/base.py index 3c65e5ea74..3d178e9c2a 100644 --- a/libcloud/loadbalancer/base.py +++ b/libcloud/loadbalancer/base.py @@ -13,19 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from libcloud.common.base import ConnectionKey, BaseDriver +from libcloud.common.base import BaseDriver, ConnectionKey from libcloud.common.types import LibcloudError -__all__ = [ - 'Member', - 'LoadBalancer', - 'Algorithm', - 'Driver', - 'DEFAULT_ALGORITHM' -] +__all__ = ["Member", "LoadBalancer", "Algorithm", "Driver", "DEFAULT_ALGORITHM"] -class Member(object): +class Member: """ Represents a load balancer member. """ @@ -54,11 +48,10 @@ def __init__(self, id, ip, port, balancer=None, extra=None): self.extra = extra or {} def __repr__(self): - return ('' % (self.id, - self.ip, self.port)) + return "".format(self.id, self.ip, self.port) -class LoadBalancer(object): +class LoadBalancer: """ Provide a common interface for handling Load Balancers. """ @@ -83,7 +76,7 @@ def __init__(self, id, name, state, ip, port, driver, extra=None): :param driver: Driver this loadbalancer belongs to. :type driver: :class:`.Driver` - :param extra: Provier specific attributes. (optional) + :param extra: Provider specific attributes. (optional) :type extra: ``dict`` """ self.id = str(id) if id else None @@ -95,16 +88,13 @@ def __init__(self, id, name, state, ip, port, driver, extra=None): self.extra = extra or {} def attach_compute_node(self, node): - return self.driver.balancer_attach_compute_node(balancer=self, - node=node) + return self.driver.balancer_attach_compute_node(balancer=self, node=node) def attach_member(self, member): - return self.driver.balancer_attach_member(balancer=self, - member=member) + return self.driver.balancer_attach_member(balancer=self, member=member) def detach_member(self, member): - return self.driver.balancer_detach_member(balancer=self, - member=member) + return self.driver.balancer_detach_member(balancer=self, member=member) def list_members(self): return self.driver.balancer_list_members(balancer=self) @@ -113,12 +103,16 @@ def destroy(self): return self.driver.destroy_balancer(balancer=self) def __repr__(self): - return ('' % (self.id, self.name, self.state, self.ip, - self.port)) + return "" % ( + self.id, + self.name, + self.state, + self.ip, + self.port, + ) -class Algorithm(object): +class Algorithm: """ Represents a load balancing algorithm. """ @@ -130,6 +124,13 @@ class Algorithm(object): WEIGHTED_LEAST_CONNECTIONS = 4 SHORTEST_RESPONSE = 5 PERSISTENT_IP = 6 + LEAST_CONNECTIONS_MEMBER = 7 + LEAST_CONNECTIONS_NODE = 8 + OBSERVED_MEMBER = 9 + OBSERVED_NODE = 10 + PREDICTIVE_MEMBER = 11 + PREDICTIVE_NODE = 12 + DEFAULT_ALGORITHM = Algorithm.ROUND_ROBIN @@ -148,10 +149,8 @@ class Driver(BaseDriver): _ALGORITHM_TO_VALUE_MAP = {} _VALUE_TO_ALGORITHM_MAP = {} - def __init__(self, key, secret=None, secure=True, host=None, - port=None, **kwargs): - super(Driver, self).__init__(key=key, secret=secret, secure=secure, - host=host, port=port, **kwargs) + def __init__(self, key, secret=None, secure=True, host=None, port=None, **kwargs): + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port, **kwargs) def list_protocols(self): """ @@ -159,8 +158,7 @@ def list_protocols(self): :rtype: ``list`` of ``str`` """ - raise NotImplementedError( - 'list_protocols not implemented for this driver') + raise NotImplementedError("list_protocols not implemented for this driver") def list_balancers(self): """ @@ -168,8 +166,7 @@ def list_balancers(self): :rtype: ``list`` of :class:`LoadBalancer` """ - raise NotImplementedError( - 'list_balancers not implemented for this driver') + raise NotImplementedError("list_balancers not implemented for this driver") def create_balancer(self, name, port, protocol, algorithm, members): """ @@ -192,8 +189,7 @@ def create_balancer(self, name, port, protocol, algorithm, members): :rtype: :class:`LoadBalancer` """ - raise NotImplementedError( - 'create_balancer not implemented for this driver') + raise NotImplementedError("create_balancer not implemented for this driver") def destroy_balancer(self, balancer): """ @@ -206,8 +202,7 @@ def destroy_balancer(self, balancer): :rtype: ``bool`` """ - raise NotImplementedError( - 'destroy_balancer not implemented for this driver') + raise NotImplementedError("destroy_balancer not implemented for this driver") def get_balancer(self, balancer_id): """ @@ -219,8 +214,7 @@ def get_balancer(self, balancer_id): :rtype: :class:`LoadBalancer` """ - raise NotImplementedError( - 'get_balancer not implemented for this driver') + raise NotImplementedError("get_balancer not implemented for this driver") def update_balancer(self, balancer, **kwargs): """ @@ -243,8 +237,7 @@ def update_balancer(self, balancer, **kwargs): :rtype: :class:`LoadBalancer` """ - raise NotImplementedError( - 'update_balancer not implemented for this driver') + raise NotImplementedError("update_balancer not implemented for this driver") def balancer_attach_compute_node(self, balancer, node): """ @@ -277,8 +270,7 @@ def balancer_attach_member(self, balancer, member): :rtype: :class:`Member` """ - raise NotImplementedError( - 'balancer_attach_member not implemented for this driver') + raise NotImplementedError("balancer_attach_member not implemented for this driver") def balancer_detach_member(self, balancer, member): """ @@ -294,8 +286,7 @@ def balancer_detach_member(self, balancer, member): :rtype: ``bool`` """ - raise NotImplementedError( - 'balancer_detach_member not implemented for this driver') + raise NotImplementedError("balancer_detach_member not implemented for this driver") def balancer_list_members(self, balancer): """ @@ -307,8 +298,7 @@ def balancer_list_members(self, balancer): :rtype: ``list`` of :class:`Member` """ - raise NotImplementedError( - 'balancer_list_members not implemented for this driver') + raise NotImplementedError("balancer_list_members not implemented for this driver") def list_supported_algorithms(self): """ @@ -330,8 +320,7 @@ def _value_to_algorithm(self, value): try: return self._VALUE_TO_ALGORITHM_MAP[value] except KeyError: - raise LibcloudError(value='Invalid value: %s' % (value), - driver=self) + raise LibcloudError(value="Invalid value: %s" % (value), driver=self) def _algorithm_to_value(self, algorithm): """ @@ -345,5 +334,4 @@ def _algorithm_to_value(self, algorithm): try: return self._ALGORITHM_TO_VALUE_MAP[algorithm] except KeyError: - raise LibcloudError(value='Invalid algorithm: %s' % (algorithm), - driver=self) + raise LibcloudError(value="Invalid algorithm: %s" % (algorithm), driver=self) diff --git a/libcloud/loadbalancer/drivers/__init__.py b/libcloud/loadbalancer/drivers/__init__.py index f4fdb8666a..d53998c895 100644 --- a/libcloud/loadbalancer/drivers/__init__.py +++ b/libcloud/loadbalancer/drivers/__init__.py @@ -13,7 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__all__ = [ - 'rackspace', - 'gogrid' -] +__all__ = ["rackspace", "nttcis"] diff --git a/libcloud/loadbalancer/drivers/alb.py b/libcloud/loadbalancer/drivers/alb.py new file mode 100644 index 0000000000..747ae8e590 --- /dev/null +++ b/libcloud/loadbalancer/drivers/alb.py @@ -0,0 +1,1064 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__all__ = ["ApplicationLBDriver"] + +from libcloud.utils.xml import findall, findtext +from libcloud.common.aws import AWSGenericResponse, SignedAWSConnection +from libcloud.loadbalancer.base import Driver, Member, LoadBalancer +from libcloud.loadbalancer.types import State + +VERSION = "2015-12-01" +HOST = "elasticloadbalancing.%s.amazonaws.com" +ROOT = "/%s/" % (VERSION) +NS = "http://elasticloadbalancing.amazonaws.com/doc/{}/".format(VERSION) + + +class ALBResponse(AWSGenericResponse): + """ + Amazon ALB response class. + """ + + namespace = NS + exceptions = {} + xpath = "Error" + + +class ALBConnection(SignedAWSConnection): + version = VERSION + host = HOST + responseCls = ALBResponse + service_name = "elasticloadbalancing" + + +class ALBTargetGroup: + """ + AWS ALB target group class + http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html + """ + + def __init__( + self, + target_group_id, + name, + protocol, + port, + vpc, + driver, + health_check_timeout=5, + health_check_port="traffic-port", + health_check_path="/", + health_check_proto="HTTP", + health_check_matcher="200", + health_check_interval=30, + healthy_threshold=5, + unhealthy_threshold=2, + balancers=[], + members=[], + ): + self.id = target_group_id + self.name = name + self.protocol = protocol + self.port = port + self.vpc = vpc + self.health_check_timeout = health_check_timeout + self.health_check_port = health_check_port + self.health_check_path = health_check_path + self.health_check_proto = health_check_proto + self.health_check_matcher = health_check_matcher + self.health_check_interval = health_check_interval + self.healthy_threshold = healthy_threshold + self.unhealthy_threshold = unhealthy_threshold + + self._balancers = balancers + self._balancers_arns = [lb.id for lb in balancers] if balancers else [] + self._members = members + self._members_ids = [mb.id for mb in members] if members else [] + self._driver = driver + + @property + def balancers(self): + if not self._balancers and self._balancers_arns: + self._balancers = [] + for balancer_arn in self._balancers_arns: + self._balancers.append(self._driver.get_balancer(balancer_arn)) + return self._balancers + + @balancers.setter + def balancers(self, val): + self._balancers = val + self._balancers_arns = [lb.id for lb in val] if val else [] + + @property + def members(self): + if not self._members: + mbrs = self._driver._ex_get_target_group_members(self) + self._members = mbrs + self._members_ids = [mb.id for mb in mbrs] if mbrs else [] + + return self._members + + @members.setter + def members(self, val): + self._members = val + self._members_ids = [mb.id for mb in val] if val else [] + + +class ALBListener: + """ + AWS ALB listener class + http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html + """ + + def __init__( + self, + listener_id, + protocol, + port, + balancer, + driver, + action="", + ssl_policy="", + ssl_certificate="", + rules=[], + ): + self.id = listener_id + self.protocol = protocol + self.port = port + self.action = action + self.ssl_policy = ssl_policy + self.ssl_certificate = ssl_certificate + + self._balancer = balancer + self._balancer_arn = balancer.id if balancer else None + self._rules = rules + self._driver = driver + + @property + def balancer(self): + if not self._balancer and self._balancer_arn: + self._balancer = self._driver.get_balancer(self._balancer_arn) + return self._balancer + + @balancer.setter + def balancer(self, val): + self._balancer = val + self._balancer_arn = val.id + + @property + def rules(self): + if not self._rules: + self._rules = self._driver._ex_get_rules_for_listener(self) + return self._rules + + @rules.setter + def rules(self, val): + self._rules = val + + +class ALBRule: + """ + AWS ALB listener rule class + http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#listener-rules + """ + + def __init__( + self, + rule_id, + is_default, + priority, + target_group, + driver, + conditions={}, + listener=None, + ): + self.id = rule_id + self.is_default = is_default + self.priority = priority + self.conditions = conditions + + self._listener = listener + self._listener_arn = listener.id if listener else None + self._target_group = target_group + self._target_group_arn = target_group.id if target_group else None + self._driver = driver + + @property + def target_group(self): + if not self._target_group and self._target_group_arn: + self._target_group = self._driver.ex_get_target_group(self._target_group_arn) + return self._target_group + + @target_group.setter + def target_group(self, val): + self._target_group = val + self._target_group_arn = val.id + + @property + def listener(self): + if not self._listener and self._listener_arn: + self._listener = self.driver.ex_get_listener(self._listener_arn) + return self._listener + + @listener.setter + def listener(self, val): + self._listener = val + self._listener_arn = val.id + + +class ApplicationLBDriver(Driver): + name = "Amazon Application Load Balancing" + website = "http://aws.amazon.com/elasticloadbalancing/" + connectionCls = ALBConnection + signature_version = "4" + + def __init__(self, access_id, secret, region, token=None): + self.token = token + self.region = region + self.region_name = region + super().__init__(access_id, secret, token=token, host=HOST % region, region=region) + + def list_protocols(self): + """ + Return list of protocols supported by driver + + :rtype: ``list`` of ``strings`` + """ + return ["http", "https"] + + def list_balancers(self): + """ + List all load balancers + + :rtype: ``list`` of :class:`LoadBalancer` + """ + params = {"Action": "DescribeLoadBalancers"} + data = self.connection.request(ROOT, params=params).object + return self._to_balancers(data) + + def get_balancer(self, balancer_id): + """ + Get a load balancer object by ARN + + :param balancer_id: ARN of load balancer you wish to fetch. + :type balancer_id: ``str`` + + :rtype: :class:`LoadBalancer` + """ + params = { + "Action": "DescribeLoadBalancers", + "LoadBalancerArns.member.1": balancer_id, + } + data = self.connection.request(ROOT, params=params).object + return self._to_balancers(data)[0] + + def create_balancer( + self, + name, + port, + protocol, + algorithm, + members, + ex_scheme=None, + ex_security_groups=None, + ex_subnets=None, + ex_tags=None, + ex_ssl_cert_arn=None, + ): + """ + Create a new load balancer instance. + + AWS ALB balancer creation consists of 5 steps: + http://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/Welcome.html + + create_balancer() is a standard API method so, it's made as a wrapper + here to preserve compatibility with other drivers where LB creation + is one-step process. It calls respective ALB methods to assemble + ready-to-use load balancer. + + :param name: Name of the new load balancer + :type name: ``str`` + + :param port: Port number to setup load balancer listener + :type port: ``int`` + + :param protocol: Load balancer protocol, should be 'HTTP' or 'HTTPS'. + :type protocol: ``str`` + + :param algorithm: Load balancing algorithm. Ignored for AWS ALB. + :type algorithm: :class:`Algorithm` or ``None`` + + :param members: List of Members to attach to the balancer. If 'port' + attribute is set for the member - load balancer will + send traffic there. Otherwise - load balancer port is + used on the memeber's side. 'ip' attribute is ignored. + :type members: ``list`` of :class:`Member` + + :param ex_scheme: Scheme of load balancer. Can be 'internet-facing' or + 'internal'. + :type ex_scheme: ``str`` + + :param ex_security_groups: List of load balancer security group ids. + :type ex_security_groups: ``list`` of ``str`` + + :param ex_subnets: List of load balancer subnet ids. + :type ex_subnets: ``list`` of ``str`` + + :param ex_tags: Tags to assign to the load balancer. + :type ex_tags: ``dict`` + + :param ex_ssl_cert_arn: SSL certificate ARN to use when load balancer + protocol is 'HTTPS'. + :type ex_ssl_cert_arn: ``str`` + + :return: LoadBalancer object + :rtype: :class:`LoadBalancer` + """ + + ex_scheme = ex_scheme or "" + ex_security_groups = ex_security_groups or [] + ex_subnets = ex_subnets or [] + ex_tags = ex_tags or {} + ex_ssl_cert_arn = ex_ssl_cert_arn or "" + + balancer = self.ex_create_balancer( + name, + scheme=ex_scheme, + security_groups=ex_security_groups, + subnets=ex_subnets, + tags=ex_tags, + ) + + target_group = self.ex_create_target_group( + name + "-tg", + port, + protocol, + balancer.extra.get("vpc"), + health_check_proto=protocol, + ) + self.ex_register_targets(target_group, members) + listener = self.ex_create_listener( + balancer, port, protocol, target_group, ssl_cert_arn=ex_ssl_cert_arn + ) + + balancer.extra["listener"] = listener + + return balancer + + def ex_create_balancer( + self, + name, + addr_type="ipv4", + scheme="internet-facing", + security_groups=None, + subnets=None, + tags=None, + ): + """ + AWS-specific method to create a new load balancer. Since ALB is a + composite object (load balancer, target group, listener etc) - extra + methods must be called to assemble ready-to-use balancer. + + :param name: Name of the new load balancer + :type name: ``str`` + + :param addr_type: Load balancer address type. Can be 'ipv4' or 'ipv6'. + :type addr_type: ``str`` + + :param scheme: Scheme of load balancer. Can be 'internet-facing' or + 'internal'. + :type scheme: ``str`` + + :param security_groups: List of load balancer security group ids. + :type security_groups: ``list`` of ``str`` + + :param subnets: List of load balancer subnet ids. + :type subnets: ``list`` of ``str`` + + :param tags: Tags to assign to the load balancer. + :type tags: ``dict`` + + :return: LoadBalancer object + :rtype: :class:`LoadBalancer` + """ + + security_groups = security_groups or [] + subnets = subnets or [] + tags = tags or {} + + # mandatory params + params = {"Action": "CreateLoadBalancer", "Name": name} + + idx = 0 + for subnet in subnets: + idx += 1 + params["Subnets.member." + str(idx)] = subnet + + # optional params + params.update( + { + "IpAddressType": addr_type, # Valid Values: ipv4 | dualstack + "Scheme": scheme, # Valid Values: internet-facing | internal + } + ) + + idx = 0 + for sg in security_groups: + idx += 1 + params["SecurityGroups.member." + str(idx)] = sg + + idx = 0 + for k, v in tags.items(): + idx += 1 + params["Tags.member." + str(idx) + ".Key"] = k + params["Tags.member." + str(idx) + ".Value"] = v + + data = self.connection.request(ROOT, params=params).object + + xpath = "CreateLoadBalancerResult/LoadBalancers/member" + for el in findall(element=data, xpath=xpath, namespace=NS): + balancer = self._to_balancer(el) + + return balancer + + def ex_create_target_group( + self, + name, + port, + proto, + vpc, + health_check_interval=30, + health_check_path="/", + health_check_port="traffic-port", + health_check_proto="HTTP", + health_check_timeout=5, + health_check_matcher="200", + healthy_threshold=5, + unhealthy_threshold=2, + ): + """ + Create a target group for AWS ALB load balancer. + + :param name: Name of target group + :type name: ``str`` + + :param port: The port on which the targets receive traffic. + This port is used unless you specify a port override when + registering the target. + :type port: ``int`` + + :param proto: The protocol to use for routing traffic to the targets. + Can be 'HTTP' or 'HTTPS'. + :type proto: ``str`` + + :param vpc: The identifier of the virtual private cloud (VPC). + :type vpc: ``str`` + + :param health_check_interval: The approximate amount of time, in + seconds, between health checks of an + individual target. The default is + 30 seconds. + :type health_check_interval: ``int`` + + :param health_check_path: The ping path that is the destination on + the targets for health checks. The default is / + :type health_check_path: ``str`` + + :param health_check_port: The port the load balancer uses when + performing health checks on targets. + The default is traffic-port, which indicates + the port on which each target receives traffic + from the load balancer. + :type health_check_port: ``str`` + + :param health_check_proto: The protocol the load balancer uses when + performing health checks on targets. + Can be 'HTTP' (default) or 'HTTPS'. + :type health_check_proto: ``str`` + + :param health_check_timeout: The amount of time, in seconds, during + which no response from a target means + a failed health check. The default is 5s. + :type health_check_timeout: ``int`` + + :param health_check_matcher: The HTTP codes to use when checking for + a successful response from a target. + Valid values: "200", "200,202", "200-299". + :type health_check_matcher: ``str`` + + :param healthy_threshold: The number of consecutive health checks + successes required before considering + an unhealthy target healthy. The default is 5 + :type healthy_threshold: ``int`` + + :param unhealthy_threshold: The number of consecutive health check + failures required before considering + a target unhealthy. The default is 2. + :type unhealthy_threshold: ``int`` + + :return: Target group object. + :rtype: :class:`ALBTargetGroup` + """ + + # mandatory params + params = { + "Action": "CreateTargetGroup", + "Name": name, + "Protocol": proto, + "Port": port, + "VpcId": vpc, + } + + # optional params + params.update( + { + # Valid Values: Min value of 5. Max value of 300. + "HealthCheckIntervalSeconds": health_check_interval, + "HealthCheckPath": health_check_path, + "HealthCheckPort": health_check_port, + # Valid Values: HTTP | HTTPS + "HealthCheckProtocol": health_check_proto, + # Valid Range: Min value of 2. Max value of 60. + "HealthCheckTimeoutSeconds": health_check_timeout, + # Valid Range: Minimum value of 2. Maximum value of 10. + "HealthyThresholdCount": healthy_threshold, + # Valid Range: Minimum value of 2. Maximum value of 10. + "UnhealthyThresholdCount": unhealthy_threshold, + # Valid values: "200", "200,202", "200-299" + "Matcher.HttpCode": health_check_matcher, + } + ) + + data = self.connection.request(ROOT, params=params).object + + xpath = "CreateTargetGroupResult/TargetGroups/member" + for el in findall(element=data, xpath=xpath, namespace=NS): + target_group = self._to_target_group(el) + + return target_group + + def ex_register_targets(self, target_group, members=None): + """ + Register members as targets at target group + + :param target_group: Target group dict where register members. + :type target_group: ``dict`` + + :param members: List of Members to attach to the balancer. If 'port' + attribute is set for the member - load balancer will + send traffic there. Otherwise - load balancer port is + used on the memeber's side. 'ip' attribute is ignored. + :type members: ``list`` of :class:`Member` + + :return: True on success, False if no members provided. + :rtype: ``bool`` + """ + + members = members or [] + + # mandatory params + params = {"Action": "RegisterTargets", "TargetGroupArn": target_group.id} + + if not members: + return False + + idx = 0 + for member in members: + idx += 1 + params["Targets.member." + str(idx) + ".Id"] = member.id + if member.port: + params["Targets.member." + str(idx) + ".Port"] = member.port + + # RegisterTargets doesn't return any useful data + self.connection.request(ROOT, params=params) + + target_group.members = members + + return True + + def ex_create_listener( + self, + balancer, + port, + proto, + target_group, + action="forward", + ssl_cert_arn=None, + ssl_policy=None, + ): + """ + Create a listener for application load balancer + + :param balancer: LoadBalancer to create listener for + :type balancer: :class:`LoadBalancer` + + :param port: Port number to setup load balancer listener + :type port: ``int`` + + :param proto: Load balancer protocol, should be 'HTTP' or 'HTTPS'. + :type proto: ``str`` + + :param target_group: Target group associated with the listener. + :type target_group: :class:`ALBTargetGroup` + + :param action: Default action for the listener, + valid value is 'forward' + :type action: ``str`` + + :param ssl_cert_arn: SSL certificate ARN to use when listener protocol + is 'HTTPS'. + :type ssl_cert_arn: ``str`` + + :param ssl_policy: The security policy that defines which ciphers and + protocols are supported. The default is the current + predefined security policy. + Example: 'ELBSecurityPolicy-2016-08' + :type ssl_policy: ``str`` + + :return: Listener object + :rtype: :class:`ALBListener` + """ + + ssl_cert_arn = ssl_cert_arn or "" + ssl_policy = ssl_policy or "" + + # mandatory params + params = { + "Action": "CreateListener", + "LoadBalancerArn": balancer.id, + "Protocol": proto, # Valid Values: HTTP | HTTPS + "Port": port, # Valid Range: Min value of 1. Max value of 65535. + "DefaultActions.member.1.Type": action, + "DefaultActions.member.1.TargetGroupArn": target_group.id, + } + + # optional params + if proto == "HTTPS": + params["Certificates.member.1.CertificateArn"] = ssl_cert_arn + if ssl_policy: + params["SslPolicy"] = ssl_policy + + data = self.connection.request(ROOT, params=params).object + + xpath = "CreateListenerResult/Listeners/member" + for el in findall(element=data, xpath=xpath, namespace=NS): + listener = self._to_listener(el) + listener.balancer = balancer + + return listener + + def ex_create_listener_rule( + self, + listener, + priority, + target_group, + action="forward", + condition_field=None, + condition_value=None, + ): + """ + Create a rule for listener. + + :param listener: Listener object where to create rule + :type listener: :class:`ALBListener` + + :param priority: The priority for the rule. A listener can't have + multiple rules with the same priority. + :type priority: ``str`` + + :param target_group: Target group object to associate with rule + :type target_group: :class:`ALBTargetGroup` + + :param action: Action for the rule, valid value is 'forward' + :type action: ``str`` + + :param condition_field: Rule condition field name. The possible values + are 'host-header' and 'path-pattern'. + :type condition_field: ``str`` + + :param condition_value: Value to match. Wildcards are supported, for + example: '/img/*' + + :return: Rule object + :rtype: :class:`ALBRule` + """ + + condition_field = condition_field or "" + condition_value = condition_value or "" + + # mandatory params + params = { + "Action": "CreateRule", + "ListenerArn": listener.id, + "Priority": priority, # Valid Range: Min value of 1. Max: 99999. + "Actions.member.1.Type": action, + "Actions.member.1.TargetGroupArn": target_group.id, + # Valid values are host-header and path-pattern. + "Conditions.member.1.Field": condition_field, + "Conditions.member.1.Values.member.1": condition_value, + } + + data = self.connection.request(ROOT, params=params).object + + xpath = "CreateRuleResult/Rules/member" + for el in findall(element=data, xpath=xpath, namespace=NS): + rule = self._to_rule(el) + rule.listener = listener + + return rule + + def ex_get_target_group(self, target_group_id): + """ + Get target group object by ARN + + :param target_group_id: ARN of target group + :type target_group_id: ``str`` + + :return: Target group object + :rtype: :class:`ALBTargetGroup` + """ + + # mandatory params + params = { + "Action": "DescribeTargetGroups", + "TargetGroupArns.member.1": target_group_id, + } + + data = self.connection.request(ROOT, params=params).object + + return self._to_target_groups(data)[0] + + def ex_get_listener(self, listener_id): + """ + Get listener object by ARN + + :param listener_id: ARN of listener object to get + :type listener_id: ``str`` + + :return: Listener object + :rtype: :class:`ALBListener` + """ + + # mandatory params + params = {"Action": "DescribeListeners", "ListenerArns.member.1": listener_id} + + data = self.connection.request(ROOT, params=params).object + return self._to_listeners(data)[0] + + def ex_get_rule(self, rule_id): + """ + Get rule by ARN. + + :param rule_id: ARN of rule + :type rule_id: ``str`` + + :return: Rule object + :rtype: :class:`ALBRule` + """ + + params = {"Action": "DescribeRules", "RuleArns.member.1": rule_id} + + data = self.connection.request(ROOT, params=params).object + return self._to_rules(data)[0] + + def _to_listeners(self, data): + xpath = "DescribeListenersResult/Listeners/member" + return [self._to_listener(el) for el in findall(element=data, xpath=xpath, namespace=NS)] + + def _to_listener(self, el): + listener = ALBListener( + listener_id=findtext(element=el, xpath="ListenerArn", namespace=NS), + protocol=findtext(element=el, xpath="Protocol", namespace=NS), + port=int(findtext(element=el, xpath="Port", namespace=NS)), + balancer=None, + driver=self.connection.driver, + action=findtext(element=el, xpath="DefaultActions/member/Type", namespace=NS), + ssl_policy=findtext(element=el, xpath="SslPolicy", namespace=NS), + ssl_certificate=findtext( + element=el, xpath="Certificates/member/CertificateArn", namespace=NS + ), + ) + + listener._balancer_arn = findtext(element=el, xpath="LoadBalancerArn", namespace=NS) + + return listener + + def _to_balancer(self, el): + balancer = LoadBalancer( + id=findtext(element=el, xpath="LoadBalancerArn", namespace=NS), + name=findtext(element=el, xpath="LoadBalancerName", namespace=NS), + state=State.UNKNOWN, + ip=findtext(el, xpath="DNSName", namespace=NS), + port=None, + driver=self.connection.driver, + ) + + balancer.extra = { + "listeners": self._ex_get_balancer_listeners(balancer), + "tags": self._ex_get_balancer_tags(balancer), + "vpc": findtext(el, xpath="VpcId", namespace=NS), + } + + if len(balancer.extra["listeners"]) > 0: + balancer.port = balancer.extra["listeners"][0].port + else: + balancer.port = None + + return balancer + + def _to_balancers(self, data): + xpath = "DescribeLoadBalancersResult/LoadBalancers/member" + return [self._to_balancer(el) for el in findall(element=data, xpath=xpath, namespace=NS)] + + def _to_tags(self, data): + """ + return tags dict + """ + tags = {} + xpath = "DescribeTagsResult/TagDescriptions/member/Tags/member" + + for el in findall(element=data, xpath=xpath, namespace=NS): + key = findtext(element=el, xpath="Key", namespace=NS) + value = findtext(element=el, xpath="Value", namespace=NS) + if key: + tags[key] = value + + return tags + + def _to_rule(self, el): + def __to_bool__(val): + return val.lower() in ("yes", "true", "t", "1") + + conditions = {} + cond_members = findall(element=el, xpath="Conditions/member", namespace=NS) + for cond_member in cond_members: + field = findtext(element=cond_member, xpath="Field", namespace=NS) + conditions[field] = [] + value_members = findall(element=cond_member, xpath="Values/member", namespace=NS) + for value_member in value_members: + conditions[field].append(value_member.text) + + rule = ALBRule( + rule_id=findtext(element=el, xpath="RuleArn", namespace=NS), + is_default=__to_bool__(findtext(element=el, xpath="IsDefault", namespace=NS)), + # CreateRule API method accepts only int for priority, however + # DescribeRules method returns 'default' string for default + # listener rule. So leaving it as string. + priority=findtext(element=el, xpath="Priority", namespace=NS), + target_group=None, + driver=self.connection.driver, + conditions=conditions, + ) + + rule._target_group_arn = findtext( + element=el, xpath="Actions/member/TargetGroupArn", namespace=NS + ) + + return rule + + def _to_rules(self, data): + xpath = "DescribeRulesResult/Rules/member" + return [self._to_rule(el) for el in findall(element=data, xpath=xpath, namespace=NS)] + + def _to_target_groups(self, data): + xpath = "DescribeTargetGroupsResult/TargetGroups/member" + return [ + self._to_target_group(el) for el in findall(element=data, xpath=xpath, namespace=NS) + ] + + def _to_target_group(self, el): + target_group = ALBTargetGroup( + target_group_id=findtext(element=el, xpath="TargetGroupArn", namespace=NS), + name=findtext(element=el, xpath="TargetGroupName", namespace=NS), + protocol=findtext(element=el, xpath="Protocol", namespace=NS), + port=int(findtext(element=el, xpath="Port", namespace=NS)), + vpc=findtext(element=el, xpath="VpcId", namespace=NS), + driver=self.connection.driver, + health_check_timeout=int( + findtext(element=el, xpath="HealthCheckTimeoutSeconds", namespace=NS) + ), + health_check_port=findtext(element=el, xpath="HealthCheckPort", namespace=NS), + health_check_path=findtext(element=el, xpath="HealthCheckPath", namespace=NS), + health_check_proto=findtext(element=el, xpath="HealthCheckProtocol", namespace=NS), + health_check_interval=int( + findtext(element=el, xpath="HealthCheckIntervalSeconds", namespace=NS) + ), + healthy_threshold=int( + findtext(element=el, xpath="HealthyThresholdCount", namespace=NS) + ), + unhealthy_threshold=int( + findtext(element=el, xpath="UnhealthyThresholdCount", namespace=NS) + ), + health_check_matcher=findtext(element=el, xpath="Matcher/HttpCode", namespace=NS), + ) + + lbs = findall(element=el, xpath="LoadBalancerArns/member", namespace=NS) + target_group._balancers_arns = [lb_arn.text for lb_arn in lbs] + + return target_group + + def _to_target_group_members(self, data): + xpath = "DescribeTargetHealthResult/TargetHealthDescriptions/member" + return [ + self._to_target_group_member(el) + for el in findall(element=data, xpath=xpath, namespace=NS) + ] + + def _to_target_group_member(self, el): + member = Member( + id=findtext(element=el, xpath="Target/Id", namespace=NS), + ip=None, + port=findtext(element=el, xpath="Target/Port", namespace=NS), + balancer=None, + extra={"health": findtext(element=el, xpath="TargetHealth/State", namespace=NS)}, + ) + return member + + def _ex_get_target_group_members(self, target_group): + """ + Return a list of target group member dicts. + + :param target_group: target group to fetch members for + :type target_group: :class:`ALBTargetGroup` + + :return: list of target group members + :rtype: ``list`` of :class:`Member` + """ + + params = {"Action": "DescribeTargetHealth", "TargetGroupArn": target_group.id} + + data = self.connection.request(ROOT, params=params).object + target_group_members = [] + for tg_member in self._to_target_group_members(data): + tg_member.extra["target_group"] = target_group + target_group_members.append(tg_member) + + return target_group_members + + def _ex_get_balancer_listeners(self, balancer): + """ + Return a list of listeners associated with load balancer. + + :param balancer: Load balancer to fetch listeners for + :type balancer: :class:`LoadBalancer` + + :return: list of listener objects + :rtype: ``list`` of :class:`ALBListener` + """ + params = {"Action": "DescribeListeners", "LoadBalancerArn": balancer.id} + + data = self.connection.request(ROOT, params=params).object + + return self._to_listeners(data) + + def _ex_get_rules_for_listener(self, listener): + """ + Get list of rules associated with listener. + + :param listener: Listener object to fetch rules for + :type listener: :class:`ALBListener` + + :return: List of rules + :rtype: ``list`` of :class:`ALBListener` + """ + + params = {"Action": "DescribeRules", "ListenerArn": listener.id} + + data = self.connection.request(ROOT, params=params).object + rules = self._to_rules(data) + for rule in rules: + rule.listener = listener + + return rules + + def _ex_get_balancer_tags(self, balancer): + """ + Get a dict of load balancer tags. + + :param balancer: Load balancer to fetch tags for + :type balancer: :class:`LoadBalancer` + + :return: Dictionary of tags (name/value) for load balancer + :rtype: ``dict`` + """ + params = {"Action": "DescribeTags", "ResourceArns.member.1": balancer.id} + data = self.connection.request(ROOT, params=params).object + return self._to_tags(data) + + def _ex_connection_class_kwargs(self): + pdriver = super() + kwargs = pdriver._ex_connection_class_kwargs() + if hasattr(self, "token") and self.token is not None: + kwargs["token"] = self.token + kwargs["signature_version"] = "4" + else: + kwargs["signature_version"] = self.signature_version + + return kwargs + + +# Commented out to avoid confusion. In AWS ALB relation between load balancer +# and target group/members is indirect. So it's better to go through full chain +# to obtain required object(s). +# Chain is: balancer->listener->rule->target group->member +# +# def balancer_list_members(self, balancer): +# """ +# List members of load balancer +# +# :param balancer: LoadBalancer to list members for +# :type balancer: :class:`LoadBalancer` +# +# :rtype: ``list`` of :class:`Member` +# """ +# return balancer.extra.get('members', []) +# +# def _ex_get_balancer_members(self, balancer): +# """ +# Fetch members across all listeners/rules/target groups +# +# :param balancer: load balancer to fetch members for +# :type balancer: :class:`LoadBalancer` +# +# :return: list of load balancer members across all target groups +# :rtype: ``list`` of :class:`Member` +# """ +# balancer_members = [] +# for listener in balancer.extra.get('listeners', []): +# for rule in listener.rules: +# for tg_member in rule.target_group.members: +# tg_member.balancer = balancer +# tg_member.extra['target_group'] = rule.target_group +# balancer_members.append(tg_member) +# +# return balancer_members +# +# def _ex_get_balancer_target_groups(self, balancer): +# """ +# Return a list of load balancer target groups. +# +# :param balancer: load balancer to fetch target groups for +# :type balancer: :class:`LoadBalancer` +# +# :rtype: ``list`` of :class:`ALBTargetGroup` +# """ +# params = { +# 'Action': 'DescribeTargetGroups', +# 'LoadBalancerArn': balancer.id +# } +# +# data = self.connection.request(ROOT, params=params).object +# +# return self._to_target_groups(data) diff --git a/libcloud/loadbalancer/drivers/brightbox.py b/libcloud/loadbalancer/drivers/brightbox.py index 9788a1e364..53faac081a 100644 --- a/libcloud/loadbalancer/drivers/brightbox.py +++ b/libcloud/loadbalancer/drivers/brightbox.py @@ -15,123 +15,122 @@ from libcloud.utils.py3 import httplib +from libcloud.utils.misc import reverse_dict from libcloud.common.brightbox import BrightboxConnection -from libcloud.loadbalancer.base import Driver, Algorithm, Member -from libcloud.loadbalancer.base import LoadBalancer +from libcloud.loadbalancer.base import Driver, Member, Algorithm, LoadBalancer from libcloud.loadbalancer.types import State -from libcloud.utils.misc import reverse_dict -API_VERSION = '1.0' +API_VERSION = "1.0" class BrightboxLBDriver(Driver): connectionCls = BrightboxConnection - name = 'Brightbox' - website = 'http://www.brightbox.co.uk/' + name = "Brightbox" + website = "http://www.brightbox.co.uk/" LB_STATE_MAP = { - 'creating': State.PENDING, - 'active': State.RUNNING, - 'deleting': State.UNKNOWN, - 'deleted': State.UNKNOWN, - 'failing': State.UNKNOWN, - 'failed': State.UNKNOWN, + "creating": State.PENDING, + "active": State.RUNNING, + "deleting": State.UNKNOWN, + "deleted": State.UNKNOWN, + "failing": State.UNKNOWN, + "failed": State.UNKNOWN, } _VALUE_TO_ALGORITHM_MAP = { - 'round-robin': Algorithm.ROUND_ROBIN, - 'least-connections': Algorithm.LEAST_CONNECTIONS + "round-robin": Algorithm.ROUND_ROBIN, + "least-connections": Algorithm.LEAST_CONNECTIONS, } _ALGORITHM_TO_VALUE_MAP = reverse_dict(_VALUE_TO_ALGORITHM_MAP) def list_protocols(self): - return ['tcp', 'http'] + return ["tcp", "http"] def list_balancers(self): - data = self.connection.request('/%s/load_balancers' % API_VERSION) \ - .object + data = self.connection.request("/%s/load_balancers" % API_VERSION).object return list(map(self._to_balancer, data)) def create_balancer(self, name, port, protocol, algorithm, members): response = self._post( - '/%s/load_balancers' % API_VERSION, - {'name': name, - 'nodes': list(map(self._member_to_node, members)), - 'policy': self._algorithm_to_value(algorithm), - 'listeners': [{'in': port, 'out': port, 'protocol': protocol}], - 'healthcheck': {'type': protocol, 'port': port}} + "/%s/load_balancers" % API_VERSION, + { + "name": name, + "nodes": list(map(self._member_to_node, members)), + "policy": self._algorithm_to_value(algorithm), + "listeners": [{"in": port, "out": port, "protocol": protocol}], + "healthcheck": {"type": protocol, "port": port}, + }, ) return self._to_balancer(response.object) def destroy_balancer(self, balancer): - response = self.connection.request('/%s/load_balancers/%s' % - (API_VERSION, balancer.id), - method='DELETE') + response = self.connection.request( + "/{}/load_balancers/{}".format(API_VERSION, balancer.id), method="DELETE" + ) return response.status == httplib.ACCEPTED def get_balancer(self, balancer_id): data = self.connection.request( - '/%s/load_balancers/%s' % (API_VERSION, balancer_id)).object + "/{}/load_balancers/{}".format(API_VERSION, balancer_id) + ).object return self._to_balancer(data) def balancer_attach_compute_node(self, balancer, node): return self.balancer_attach_member(balancer, node) def balancer_attach_member(self, balancer, member): - path = '/%s/load_balancers/%s/add_nodes' % (API_VERSION, balancer.id) + path = "/{}/load_balancers/{}/add_nodes".format(API_VERSION, balancer.id) - self._post(path, {'nodes': [self._member_to_node(member)]}) + self._post(path, {"nodes": [self._member_to_node(member)]}) return member def balancer_detach_member(self, balancer, member): - path = '/%s/load_balancers/%s/remove_nodes' % (API_VERSION, - balancer.id) + path = "/{}/load_balancers/{}/remove_nodes".format(API_VERSION, balancer.id) - response = self._post(path, {'nodes': [self._member_to_node(member)]}) + response = self._post(path, {"nodes": [self._member_to_node(member)]}) return response.status == httplib.ACCEPTED def balancer_list_members(self, balancer): - path = '/%s/load_balancers/%s' % (API_VERSION, balancer.id) + path = "/{}/load_balancers/{}".format(API_VERSION, balancer.id) data = self.connection.request(path).object def func(data): return self._node_to_member(data, balancer) - return list(map(func, data['nodes'])) + return list(map(func, data["nodes"])) def _post(self, path, data={}): - headers = {'Content-Type': 'application/json'} + headers = {"Content-Type": "application/json"} - return self.connection.request(path, data=data, headers=headers, - method='POST') + return self.connection.request(path, data=data, headers=headers, method="POST") def _to_balancer(self, data): return LoadBalancer( - id=data['id'], - name=data['name'], - state=self.LB_STATE_MAP.get(data['status'], State.UNKNOWN), + id=data["id"], + name=data["name"], + state=self.LB_STATE_MAP.get(data["status"], State.UNKNOWN), ip=self._public_ip(data), - port=data['listeners'][0]['in'], - driver=self.connection.driver + port=data["listeners"][0]["in"], + driver=self.connection.driver, ) def _member_to_node(self, member): - return {'node': member.id} + return {"node": member.id} def _node_to_member(self, data, balancer): - return Member(id=data['id'], ip=None, port=None, balancer=balancer) + return Member(id=data["id"], ip=None, port=None, balancer=balancer) def _public_ip(self, data): - if len(data['cloud_ips']) > 0: - ip = data['cloud_ips'][0]['public_ip'] + if len(data["cloud_ips"]) > 0: + ip = data["cloud_ips"][0]["public_ip"] else: ip = None diff --git a/libcloud/loadbalancer/drivers/cloudstack.py b/libcloud/loadbalancer/drivers/cloudstack.py index a8d5485eb2..05b88b78c5 100644 --- a/libcloud/loadbalancer/drivers/cloudstack.py +++ b/libcloud/loadbalancer/drivers/cloudstack.py @@ -13,34 +13,41 @@ # See the License for the specific language governing permissions and # limitations under the License. -from libcloud.common.cloudstack import CloudStackDriverMixIn -from libcloud.loadbalancer.base import LoadBalancer, Member, Driver, Algorithm -from libcloud.loadbalancer.base import DEFAULT_ALGORITHM -from libcloud.loadbalancer.types import Provider -from libcloud.loadbalancer.types import State from libcloud.utils.misc import reverse_dict +from libcloud.common.cloudstack import CloudStackDriverMixIn +from libcloud.loadbalancer.base import DEFAULT_ALGORITHM, Driver, Member, Algorithm, LoadBalancer +from libcloud.loadbalancer.types import State, Provider class CloudStackLBDriver(CloudStackDriverMixIn, Driver): """Driver for CloudStack load balancers.""" - api_name = 'cloudstack_lb' - name = 'CloudStack' - website = 'http://cloudstack.org/' + api_name = "cloudstack_lb" + name = "CloudStack" + website = "http://cloudstack.org/" type = Provider.CLOUDSTACK _VALUE_TO_ALGORITHM_MAP = { - 'roundrobin': Algorithm.ROUND_ROBIN, - 'leastconn': Algorithm.LEAST_CONNECTIONS + "roundrobin": Algorithm.ROUND_ROBIN, + "leastconn": Algorithm.LEAST_CONNECTIONS, } _ALGORITHM_TO_VALUE_MAP = reverse_dict(_VALUE_TO_ALGORITHM_MAP) LB_STATE_MAP = { - 'Active': State.RUNNING, + "Active": State.RUNNING, } - def __init__(self, key, secret=None, secure=True, host=None, - path=None, port=None, *args, **kwargs): + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + path=None, + port=None, + *args, + **kwargs, + ): """ @inherits: :class:`Driver.__init__` """ @@ -54,12 +61,12 @@ def __init__(self, key, secret=None, secure=True, host=None, self.host = host if (self.type == Provider.CLOUDSTACK) and (not host or not path): - raise Exception('When instantiating CloudStack driver directly ' + - 'you also need to provide host and path argument') + raise Exception( + "When instantiating CloudStack driver directly " + + "you also need to provide host and path argument" + ) - super(CloudStackLBDriver, self).__init__(key=key, secret=secret, - secure=secure, - host=host, port=port) + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port) def list_protocols(self): """ @@ -67,26 +74,34 @@ def list_protocols(self): :rtype: ``list`` of ``str`` """ - return ['tcp'] + return ["tcp"] def list_balancers(self): - balancers = self._sync_request(command='listLoadBalancerRules', - method='GET') - balancers = balancers.get('loadbalancerrule', []) + balancers = self._sync_request(command="listLoadBalancerRules", method="GET") + balancers = balancers.get("loadbalancerrule", []) return [self._to_balancer(balancer) for balancer in balancers] def get_balancer(self, balancer_id): - balancer = self._sync_request(command='listLoadBalancerRules', - params={'id': balancer_id}, - method='GET') - balancer = balancer.get('loadbalancerrule', []) + balancer = self._sync_request( + command="listLoadBalancerRules", params={"id": balancer_id}, method="GET" + ) + balancer = balancer.get("loadbalancerrule", []) if not balancer: raise Exception("no such load balancer: " + str(balancer_id)) return self._to_balancer(balancer[0]) - def create_balancer(self, name, members, protocol='http', port=80, - algorithm=DEFAULT_ALGORITHM, location=None, - private_port=None, network_id=None, vpc_id=None): + def create_balancer( + self, + name, + members, + protocol="http", + port=80, + algorithm=DEFAULT_ALGORITHM, + location=None, + private_port=None, + network_id=None, + vpc_id=None, + ): """ @inherits: :class:`Driver.create_balancer` @@ -104,47 +119,44 @@ def create_balancer(self, name, members, protocol='http', port=80, ip_args = {} if location is None: - locations = self._sync_request(command='listZones', method='GET') - location = locations['zone'][0]['id'] + locations = self._sync_request(command="listZones", method="GET") + location = locations["zone"][0]["id"] else: location = location.id if private_port is None: private_port = port if network_id is not None: - args['networkid'] = network_id - ip_args['networkid'] = network_id + args["networkid"] = network_id + ip_args["networkid"] = network_id if vpc_id is not None: - ip_args['vpcid'] = vpc_id + ip_args["vpcid"] = vpc_id - ip_args.update({'zoneid': location, - 'networkid': network_id, - 'vpc_id': vpc_id}) + ip_args.update({"zoneid": location, "networkid": network_id, "vpc_id": vpc_id}) - result = self._async_request(command='associateIpAddress', - params=ip_args, - method='GET') - public_ip = result['ipaddress'] + result = self._async_request(command="associateIpAddress", params=ip_args, method="GET") + public_ip = result["ipaddress"] - args.update({'algorithm': self._ALGORITHM_TO_VALUE_MAP[algorithm], - 'name': name, - 'privateport': private_port, - 'publicport': port, - 'publicipid': public_ip['id']}) + args.update( + { + "algorithm": self._ALGORITHM_TO_VALUE_MAP[algorithm], + "name": name, + "privateport": private_port, + "publicport": port, + "publicipid": public_ip["id"], + } + ) - result = self._sync_request( - command='createLoadBalancerRule', - params=args, - method='GET') + result = self._sync_request(command="createLoadBalancerRule", params=args, method="GET") listbalancers = self._sync_request( - command='listLoadBalancerRules', - params=args, - method='GET') + command="listLoadBalancerRules", params=args, method="GET" + ) - listbalancers = [rule for rule in listbalancers['loadbalancerrule'] if - rule['id'] == result['id']] + listbalancers = [ + rule for rule in listbalancers["loadbalancerrule"] if rule["id"] == result["id"] + ] if len(listbalancers) != 1: return None @@ -156,54 +168,53 @@ def create_balancer(self, name, members, protocol='http', port=80, return balancer def destroy_balancer(self, balancer): - self._async_request(command='deleteLoadBalancerRule', - params={'id': balancer.id}, - - method='GET') - self._async_request(command='disassociateIpAddress', - params={'id': balancer.ex_public_ip_id}, - method='GET') + self._async_request( + command="deleteLoadBalancerRule", params={"id": balancer.id}, method="GET" + ) + self._async_request( + command="disassociateIpAddress", + params={"id": balancer.ex_public_ip_id}, + method="GET", + ) def balancer_attach_member(self, balancer, member): member.port = balancer.ex_private_port - self._async_request(command='assignToLoadBalancerRule', - params={'id': balancer.id, - 'virtualmachineids': member.id}, - method='GET') + self._async_request( + command="assignToLoadBalancerRule", + params={"id": balancer.id, "virtualmachineids": member.id}, + method="GET", + ) return True def balancer_detach_member(self, balancer, member): - self._async_request(command='removeFromLoadBalancerRule', - params={'id': balancer.id, - 'virtualmachineids': member.id}, - method='GET') + self._async_request( + command="removeFromLoadBalancerRule", + params={"id": balancer.id, "virtualmachineids": member.id}, + method="GET", + ) return True def balancer_list_members(self, balancer): - members = self._sync_request(command='listLoadBalancerRuleInstances', - params={'id': balancer.id}, - method='GET') - members = members['loadbalancerruleinstance'] - return [self._to_member(m, balancer.ex_private_port, balancer) - for m in members] + members = self._sync_request( + command="listLoadBalancerRuleInstances", + params={"id": balancer.id}, + method="GET", + ) + members = members["loadbalancerruleinstance"] + return [self._to_member(m, balancer.ex_private_port, balancer) for m in members] def _to_balancer(self, obj): balancer = LoadBalancer( - id=obj['id'], - name=obj['name'], - state=self.LB_STATE_MAP.get(obj['state'], State.UNKNOWN), - ip=obj['publicip'], - port=obj['publicport'], - driver=self.connection.driver + id=obj["id"], + name=obj["name"], + state=self.LB_STATE_MAP.get(obj["state"], State.UNKNOWN), + ip=obj["publicip"], + port=obj["publicport"], + driver=self.connection.driver, ) - balancer.ex_private_port = obj['privateport'] - balancer.ex_public_ip_id = obj['publicipid'] + balancer.ex_private_port = obj["privateport"] + balancer.ex_public_ip_id = obj["publicipid"] return balancer def _to_member(self, obj, port, balancer): - return Member( - id=obj['id'], - ip=obj['nic'][0]['ipaddress'], - port=port, - balancer=balancer - ) + return Member(id=obj["id"], ip=obj["nic"][0]["ipaddress"], port=port, balancer=balancer) diff --git a/libcloud/loadbalancer/drivers/dimensiondata.py b/libcloud/loadbalancer/drivers/dimensiondata.py new file mode 100644 index 0000000000..997ffb4b9e --- /dev/null +++ b/libcloud/loadbalancer/drivers/dimensiondata.py @@ -0,0 +1,1143 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance withv +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.utils.py3 import ET +from libcloud.utils.xml import findall, findtext, fixxpath +from libcloud.utils.misc import reverse_dict +from libcloud.loadbalancer.base import Driver, Member, Algorithm, LoadBalancer +from libcloud.loadbalancer.types import State, Provider +from libcloud.common.dimensiondata import ( + TYPES_URN, + API_ENDPOINTS, + DEFAULT_REGION, + DimensionDataPool, + DimensionDataVIPNode, + DimensionDataConnection, + DimensionDataPoolMember, + DimensionDataDefaultiRule, + DimensionDataVirtualListener, + DimensionDataPersistenceProfile, + DimensionDataDefaultHealthMonitor, + DimensionDataVirtualListenerCompatibility, +) + + +class DimensionDataLBDriver(Driver): + """ + DimensionData node driver. + """ + + selected_region = None + connectionCls = DimensionDataConnection + name = "Dimension Data Load Balancer" + website = "https://cloud.dimensiondata.com/" + type = Provider.DIMENSIONDATA + api_version = 1.0 + + network_domain_id = None + + _VALUE_TO_ALGORITHM_MAP = { + "ROUND_ROBIN": Algorithm.ROUND_ROBIN, + "LEAST_CONNECTIONS": Algorithm.LEAST_CONNECTIONS, + "SHORTEST_RESPONSE": Algorithm.SHORTEST_RESPONSE, + "PERSISTENT_IP": Algorithm.PERSISTENT_IP, + } + _ALGORITHM_TO_VALUE_MAP = reverse_dict(_VALUE_TO_ALGORITHM_MAP) + + _VALUE_TO_STATE_MAP = { + "NORMAL": State.RUNNING, + "PENDING_ADD": State.PENDING, + "PENDING_CHANGE": State.PENDING, + "PENDING_DELETE": State.PENDING, + "FAILED_ADD": State.ERROR, + "FAILED_CHANGE": State.ERROR, + "FAILED_DELETE": State.ERROR, + "REQUIRES_SUPPORT": State.ERROR, + } + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=DEFAULT_REGION, + **kwargs, + ): + if region not in API_ENDPOINTS and host is None: + raise ValueError("Invalid region: %s, no host specified" % (region)) + if region is not None: + self.selected_region = API_ENDPOINTS[region] + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + api_version=api_version, + region=region, + **kwargs, + ) + + def _ex_connection_class_kwargs(self): + """ + Add the region to the kwargs before the connection is instantiated + """ + + kwargs = super()._ex_connection_class_kwargs() + kwargs["region"] = self.selected_region + return kwargs + + def create_balancer( + self, + name, + port=None, + protocol=None, + algorithm=None, + members=None, + ex_listener_ip_address=None, + ): + """ + Create a new load balancer instance + + :param name: Name of the new load balancer (required) + :type name: ``str`` + + :param port: An integer in the range of 1-65535. If not supplied, + it will be taken to mean 'Any Port' + :type port: ``int`` + + :param protocol: Loadbalancer protocol, defaults to http. + :type protocol: ``str`` + + :param members: list of Members to attach to balancer (optional) + :type members: ``list`` of :class:`Member` + + :param algorithm: Load balancing algorithm, defaults to ROUND_ROBIN. + :type algorithm: :class:`.Algorithm` + + :param ex_listener_ip_address: Must be a valid IPv4 in dot-decimal + notation (x.x.x.x). + :type ex_listener_ip_address: ``str`` + + :rtype: :class:`LoadBalancer` + """ + network_domain_id = self.network_domain_id + if protocol is None: + protocol = "http" + if algorithm is None: + algorithm = Algorithm.ROUND_ROBIN + + # Create a pool first + pool = self.ex_create_pool( + network_domain_id=network_domain_id, + name=name, + ex_description=None, + balancer_method=self._ALGORITHM_TO_VALUE_MAP[algorithm], + ) + + # Attach the members to the pool as nodes + if members is not None: + for member in members: + node = self.ex_create_node( + network_domain_id=network_domain_id, + name=member.ip, + ip=member.ip, + ex_description=None, + ) + self.ex_create_pool_member(pool=pool, node=node, port=port) + + # Create the virtual listener (balancer) + listener = self.ex_create_virtual_listener( + network_domain_id=network_domain_id, + name=name, + ex_description=name, + port=port, + pool=pool, + listener_ip_address=ex_listener_ip_address, + ) + + return LoadBalancer( + id=listener.id, + name=listener.name, + state=State.RUNNING, + ip=listener.ip, + port=port, + driver=self, + extra={ + "pool_id": pool.id, + "network_domain_id": network_domain_id, + "listener_ip_address": ex_listener_ip_address, + }, + ) + + def list_balancers(self, ex_network_domain_id=None): + """ + List all loadbalancers inside a geography or in given network. + + In Dimension Data terminology these are known as virtual listeners + + :param ex_network_domain_id: UUID of Network Domain + if not None returns only balancers in the given network + if None then returns all pools for the organization + :type ex_network_domain_id: ``str`` + + :rtype: ``list`` of :class:`LoadBalancer` + """ + params = None + if ex_network_domain_id is not None: + params = {"networkDomainId": ex_network_domain_id} + + return self._to_balancers( + self.connection.request_with_orgId_api_2( + "networkDomainVip/virtualListener", params=params + ).object + ) + + def get_balancer(self, balancer_id): + """ + Return a :class:`LoadBalancer` object. + + :param balancer_id: id of a load balancer you want to fetch + :type balancer_id: ``str`` + + :rtype: :class:`LoadBalancer` + """ + + bal = self.connection.request_with_orgId_api_2( + "networkDomainVip/virtualListener/%s" % balancer_id + ).object + return self._to_balancer(bal) + + def list_protocols(self): + """ + Return a list of supported protocols. + + Since all protocols are support by Dimension Data, this is a list + of common protocols. + + :rtype: ``list`` of ``str`` + """ + return ["http", "https", "tcp", "udp", "ftp", "smtp"] + + def balancer_list_members(self, balancer): + """ + Return list of members attached to balancer. + + In Dimension Data terminology these are the members of the pools + within a virtual listener. + + :param balancer: LoadBalancer which should be used + :type balancer: :class:`LoadBalancer` + + :rtype: ``list`` of :class:`Member` + """ + pool_members = self.ex_get_pool_members(balancer.extra["pool_id"]) + members = [] + for pool_member in pool_members: + members.append( + Member( + id=pool_member.id, + ip=pool_member.ip, + port=pool_member.port, + balancer=balancer, + extra=None, + ) + ) + return members + + def balancer_attach_member(self, balancer, member): + """ + Attach a member to balancer + + :param balancer: LoadBalancer which should be used + :type balancer: :class:`LoadBalancer` + + :param member: Member to join to the balancer + :type member: :class:`Member` + + :return: Member after joining the balancer. + :rtype: :class:`Member` + """ + node = self.ex_create_node( + network_domain_id=balancer.extra["network_domain_id"], + name="Member." + member.ip, + ip=member.ip, + ex_description="", + ) + if node is False: + return False + pool = self.ex_get_pool(balancer.extra["pool_id"]) + pool_member = self.ex_create_pool_member(pool=pool, node=node, port=member.port) + member.id = pool_member.id + return member + + def balancer_detach_member(self, balancer, member): + """ + Detach member from balancer + + :param balancer: LoadBalancer which should be used + :type balancer: :class:`LoadBalancer` + + :param member: Member which should be used + :type member: :class:`Member` + + :return: ``True`` if member detach was successful, otherwise ``False``. + :rtype: ``bool`` + """ + create_pool_m = ET.Element("removePoolMember", {"xmlns": TYPES_URN, "id": member.id}) + + result = self.connection.request_with_orgId_api_2( + "networkDomainVip/removePoolMember", + method="POST", + data=ET.tostring(create_pool_m), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def destroy_balancer(self, balancer): + """ + Destroy a load balancer (virtual listener) + + :param balancer: LoadBalancer which should be used + :type balancer: :class:`LoadBalancer` + + :return: ``True`` if the destroy was successful, otherwise ``False``. + :rtype: ``bool`` + """ + delete_listener = ET.Element( + "deleteVirtualListener", {"xmlns": TYPES_URN, "id": balancer.id} + ) + + result = self.connection.request_with_orgId_api_2( + "networkDomainVip/deleteVirtualListener", + method="POST", + data=ET.tostring(delete_listener), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_set_current_network_domain(self, network_domain_id): + """ + Set the network domain (part of the network) of the driver + + :param network_domain_id: ID of the pool (required) + :type network_domain_id: ``str`` + """ + self.network_domain_id = network_domain_id + + def ex_get_current_network_domain(self): + """ + Get the current network domain ID of the driver. + + :return: ID of the network domain + :rtype: ``str`` + """ + return self.network_domain_id + + def ex_create_pool_member(self, pool, node, port=None): + """ + Create a new member in an existing pool from an existing node + + :param pool: Instance of ``DimensionDataPool`` (required) + :type pool: ``DimensionDataPool`` + + :param node: Instance of ``DimensionDataVIPNode`` (required) + :type node: ``DimensionDataVIPNode`` + + :param port: Port the the service will listen on + :type port: ``str`` + + :return: The node member, instance of ``DimensionDataPoolMember`` + :rtype: ``DimensionDataPoolMember`` + """ + create_pool_m = ET.Element("addPoolMember", {"xmlns": TYPES_URN}) + ET.SubElement(create_pool_m, "poolId").text = pool.id + ET.SubElement(create_pool_m, "nodeId").text = node.id + if port is not None: + ET.SubElement(create_pool_m, "port").text = str(port) + ET.SubElement(create_pool_m, "status").text = "ENABLED" + + response = self.connection.request_with_orgId_api_2( + "networkDomainVip/addPoolMember", + method="POST", + data=ET.tostring(create_pool_m), + ).object + + member_id = None + node_name = None + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "poolMemberId": + member_id = info.get("value") + if info.get("name") == "nodeName": + node_name = info.get("value") + + return DimensionDataPoolMember( + id=member_id, + name=node_name, + status=State.RUNNING, + ip=node.ip, + port=port, + node_id=node.id, + ) + + def ex_create_node( + self, + network_domain_id, + name, + ip, + ex_description, + connection_limit=25000, + connection_rate_limit=2000, + ): + """ + Create a new node + + :param network_domain_id: Network Domain ID (required) + :type name: ``str`` + + :param name: name of the node (required) + :type name: ``str`` + + :param ip: IPv4 address of the node (required) + :type ip: ``str`` + + :param ex_description: Description of the node (required) + :type ex_description: ``str`` + + :param connection_limit: Maximum number + of concurrent connections per sec + :type connection_limit: ``int`` + + :param connection_rate_limit: Maximum number of concurrent sessions + :type connection_rate_limit: ``int`` + + :return: Instance of ``DimensionDataVIPNode`` + :rtype: ``DimensionDataVIPNode`` + """ + create_node_elm = ET.Element("createNode", {"xmlns": TYPES_URN}) + ET.SubElement(create_node_elm, "networkDomainId").text = network_domain_id + ET.SubElement(create_node_elm, "name").text = name + ET.SubElement(create_node_elm, "description").text = str(ex_description) + ET.SubElement(create_node_elm, "ipv4Address").text = ip + ET.SubElement(create_node_elm, "status").text = "ENABLED" + ET.SubElement(create_node_elm, "connectionLimit").text = str(connection_limit) + ET.SubElement(create_node_elm, "connectionRateLimit").text = str(connection_rate_limit) + + response = self.connection.request_with_orgId_api_2( + action="networkDomainVip/createNode", + method="POST", + data=ET.tostring(create_node_elm), + ).object + + node_id = None + node_name = None + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "nodeId": + node_id = info.get("value") + if info.get("name") == "name": + node_name = info.get("value") + return DimensionDataVIPNode(id=node_id, name=node_name, status=State.RUNNING, ip=ip) + + def ex_update_node(self, node): + """ + Update the properties of a node + + :param pool: The instance of ``DimensionDataNode`` to update + :type pool: ``DimensionDataNode`` + + :return: The instance of ``DimensionDataNode`` + :rtype: ``DimensionDataNode`` + """ + create_node_elm = ET.Element("editNode", {"xmlns": TYPES_URN}) + ET.SubElement(create_node_elm, "connectionLimit").text = str(node.connection_limit) + ET.SubElement(create_node_elm, "connectionRateLimit").text = str(node.connection_rate_limit) + + self.connection.request_with_orgId_api_2( + action="networkDomainVip/createNode", + method="POST", + data=ET.tostring(create_node_elm), + ).object + return node + + def ex_set_node_state(self, node, enabled): + """ + Change the state of a node (enable/disable) + + :param pool: The instance of ``DimensionDataNode`` to update + :type pool: ``DimensionDataNode`` + + :param enabled: The target state of the node + :type enabled: ``bool`` + + :return: The instance of ``DimensionDataNode`` + :rtype: ``DimensionDataNode`` + """ + create_node_elm = ET.Element("editNode", {"xmlns": TYPES_URN}) + ET.SubElement(create_node_elm, "status").text = "ENABLED" if enabled is True else "DISABLED" + + self.connection.request_with_orgId_api_2( + action="networkDomainVip/editNode", + method="POST", + data=ET.tostring(create_node_elm), + ).object + return node + + def ex_create_pool( + self, + network_domain_id, + name, + balancer_method, + ex_description, + health_monitors=None, + service_down_action="NONE", + slow_ramp_time=30, + ): + """ + Create a new pool + + :param network_domain_id: Network Domain ID (required) + :type name: ``str`` + + :param name: name of the node (required) + :type name: ``str`` + + :param balancer_method: The load balancer algorithm (required) + :type balancer_method: ``str`` + + :param ex_description: Description of the node (required) + :type ex_description: ``str`` + + :param health_monitors: A list of health monitors to use for the pool. + :type health_monitors: ``list`` of + :class:`DimensionDataDefaultHealthMonitor` + + :param service_down_action: What to do when node + is unavailable NONE, DROP or RESELECT + :type service_down_action: ``str`` + + :param slow_ramp_time: Number of seconds to stagger ramp up of nodes + :type slow_ramp_time: ``int`` + + :return: Instance of ``DimensionDataPool`` + :rtype: ``DimensionDataPool`` + """ + # Names cannot contain spaces. + name.replace(" ", "_") + create_node_elm = ET.Element("createPool", {"xmlns": TYPES_URN}) + ET.SubElement(create_node_elm, "networkDomainId").text = network_domain_id + ET.SubElement(create_node_elm, "name").text = name + ET.SubElement(create_node_elm, "description").text = str(ex_description) + ET.SubElement(create_node_elm, "loadBalanceMethod").text = str(balancer_method) + + if health_monitors is not None: + for monitor in health_monitors: + ET.SubElement(create_node_elm, "healthMonitorId").text = str(monitor.id) + + ET.SubElement(create_node_elm, "serviceDownAction").text = service_down_action + ET.SubElement(create_node_elm, "slowRampTime").text = str(slow_ramp_time) + + response = self.connection.request_with_orgId_api_2( + action="networkDomainVip/createPool", + method="POST", + data=ET.tostring(create_node_elm), + ).object + + pool_id = None + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "poolId": + pool_id = info.get("value") + + return DimensionDataPool( + id=pool_id, + name=name, + description=ex_description, + status=State.RUNNING, + load_balance_method=str(balancer_method), + health_monitor_id=None, + service_down_action=service_down_action, + slow_ramp_time=str(slow_ramp_time), + ) + + def ex_create_virtual_listener( + self, + network_domain_id, + name, + ex_description, + port=None, + pool=None, + listener_ip_address=None, + persistence_profile=None, + fallback_persistence_profile=None, + irule=None, + protocol="TCP", + connection_limit=25000, + connection_rate_limit=2000, + source_port_preservation="PRESERVE", + ): + """ + Create a new virtual listener (load balancer) + + :param network_domain_id: Network Domain ID (required) + :type name: ``str`` + + :param name: name of the listener (required) + :type name: ``str`` + + :param ex_description: Description of the node (required) + :type ex_description: ``str`` + + :param port: An integer in the range of 1-65535. If not supplied, + it will be taken to mean 'Any Port' + :type port: ``int`` + + :param pool: The pool to use for the listener + :type pool: :class:`DimensionDataPool` + + :param listener_ip_address: The IPv4 Address of the virtual listener + :type listener_ip_address: ``str`` + + :param persistence_profile: Persistence profile + :type persistence_profile: :class:`DimensionDataPersistenceProfile` + + :param fallback_persistence_profile: Fallback persistence profile + :type fallback_persistence_profile: + :class:`DimensionDataPersistenceProfile` + + :param irule: The iRule to apply + :type irule: :class:`DimensionDataDefaultiRule` + + :param protocol: For STANDARD type, ANY, TCP or UDP + for PERFORMANCE_LAYER_4 choice of ANY, TCP, UDP, HTTP + :type protocol: ``str`` + + :param connection_limit: Maximum number + of concurrent connections per sec + :type connection_limit: ``int`` + + :param connection_rate_limit: Maximum number of concurrent sessions + :type connection_rate_limit: ``int`` + + :param source_port_preservation: Choice of PRESERVE, + PRESERVE_STRICT or CHANGE + :type source_port_preservation: ``str`` + + :return: Instance of the listener + :rtype: ``DimensionDataVirtualListener`` + """ + if (port == 80) or (port == 443): + listener_type = "PERFORMANCE_LAYER_4" + else: + listener_type = "STANDARD" + + create_node_elm = ET.Element("createVirtualListener", {"xmlns": TYPES_URN}) + ET.SubElement(create_node_elm, "networkDomainId").text = network_domain_id + ET.SubElement(create_node_elm, "name").text = name + ET.SubElement(create_node_elm, "description").text = str(ex_description) + ET.SubElement(create_node_elm, "type").text = listener_type + ET.SubElement(create_node_elm, "protocol").text = protocol + if listener_ip_address is not None: + ET.SubElement(create_node_elm, "listenerIpAddress").text = str(listener_ip_address) + if port is not None: + ET.SubElement(create_node_elm, "port").text = str(port) + ET.SubElement(create_node_elm, "enabled").text = "true" + ET.SubElement(create_node_elm, "connectionLimit").text = str(connection_limit) + ET.SubElement(create_node_elm, "connectionRateLimit").text = str(connection_rate_limit) + ET.SubElement(create_node_elm, "sourcePortPreservation").text = source_port_preservation + if pool is not None: + ET.SubElement(create_node_elm, "poolId").text = pool.id + if persistence_profile is not None: + ET.SubElement(create_node_elm, "persistenceProfileId").text = persistence_profile.id + if fallback_persistence_profile is not None: + ET.SubElement(create_node_elm, "fallbackPersistenceProfileId").text = ( + fallback_persistence_profile.id + ) + if irule is not None: + ET.SubElement(create_node_elm, "iruleId").text = irule.id + + response = self.connection.request_with_orgId_api_2( + action="networkDomainVip/createVirtualListener", + method="POST", + data=ET.tostring(create_node_elm), + ).object + + virtual_listener_id = None + virtual_listener_ip = None + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "virtualListenerId": + virtual_listener_id = info.get("value") + if info.get("name") == "listenerIpAddress": + virtual_listener_ip = info.get("value") + + return DimensionDataVirtualListener( + id=virtual_listener_id, + name=name, + ip=virtual_listener_ip, + status=State.RUNNING, + ) + + def ex_get_pools(self, ex_network_domain_id=None): + """ + Get all of the pools inside the current geography or + in given network. + + :param ex_network_domain_id: UUID of Network Domain + if not None returns only balancers in the given network + if None then returns all pools for the organization + :type ex_network_domain_id: ``str`` + + :return: Returns a ``list`` of type ``DimensionDataPool`` + :rtype: ``list`` of ``DimensionDataPool`` + """ + params = None + + if ex_network_domain_id is not None: + params = {"networkDomainId": ex_network_domain_id} + + pools = self.connection.request_with_orgId_api_2( + "networkDomainVip/pool", params=params + ).object + + return self._to_pools(pools) + + def ex_get_pool(self, pool_id): + """ + Get a specific pool inside the current geography + + :param pool_id: The identifier of the pool + :type pool_id: ``str`` + + :return: Returns an instance of ``DimensionDataPool`` + :rtype: ``DimensionDataPool`` + """ + pool = self.connection.request_with_orgId_api_2("networkDomainVip/pool/%s" % pool_id).object + return self._to_pool(pool) + + def ex_update_pool(self, pool): + """ + Update the properties of an existing pool + only method, serviceDownAction and slowRampTime are updated + + :param pool: The instance of ``DimensionDataPool`` to update + :type pool: ``DimensionDataPool`` + + :return: ``True`` for success, ``False`` for failure + :rtype: ``bool`` + """ + create_node_elm = ET.Element("editPool", {"xmlns": TYPES_URN}) + + ET.SubElement(create_node_elm, "loadBalanceMethod").text = str(pool.load_balance_method) + ET.SubElement(create_node_elm, "serviceDownAction").text = pool.service_down_action + ET.SubElement(create_node_elm, "slowRampTime").text = str(pool.slow_ramp_time) + + response = self.connection.request_with_orgId_api_2( + action="networkDomainVip/editPool", + method="POST", + data=ET.tostring(create_node_elm), + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_destroy_pool(self, pool): + """ + Destroy an existing pool + + :param pool: The instance of ``DimensionDataPool`` to destroy + :type pool: ``DimensionDataPool`` + + :return: ``True`` for success, ``False`` for failure + :rtype: ``bool`` + """ + destroy_request = ET.Element("deletePool", {"xmlns": TYPES_URN, "id": pool.id}) + + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/deletePool", + method="POST", + data=ET.tostring(destroy_request), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_get_pool_members(self, pool_id): + """ + Get the members of a pool + + :param pool: The instance of a pool + :type pool: ``DimensionDataPool`` + + :return: Returns an ``list`` of ``DimensionDataPoolMember`` + :rtype: ``list`` of ``DimensionDataPoolMember`` + """ + members = self.connection.request_with_orgId_api_2( + "networkDomainVip/poolMember?poolId=%s" % pool_id + ).object + return self._to_members(members) + + def ex_get_pool_member(self, pool_member_id): + """ + Get a specific member of a pool + + :param pool: The id of a pool member + :type pool: ``str`` + + :return: Returns an instance of ``DimensionDataPoolMember`` + :rtype: ``DimensionDataPoolMember`` + """ + member = self.connection.request_with_orgId_api_2( + "networkDomainVip/poolMember/%s" % pool_member_id + ).object + return self._to_member(member) + + def ex_set_pool_member_state(self, member, enabled=True): + request = ET.Element("editPoolMember", {"xmlns": TYPES_URN, "id": member.id}) + state = "ENABLED" if enabled is True else "DISABLED" + ET.SubElement(request, "status").text = state + + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/editPoolMember", + method="POST", + data=ET.tostring(request), + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_destroy_pool_member(self, member, destroy_node=False): + """ + Destroy a specific member of a pool + + :param pool: The instance of a pool member + :type pool: ``DimensionDataPoolMember`` + + :param destroy_node: Also destroy the associated node + :type destroy_node: ``bool`` + + :return: ``True`` for success, ``False`` for failure + :rtype: ``bool`` + """ + # remove the pool member + destroy_request = ET.Element("removePoolMember", {"xmlns": TYPES_URN, "id": member.id}) + + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/removePoolMember", + method="POST", + data=ET.tostring(destroy_request), + ).object + + if member.node_id is not None and destroy_node is True: + return self.ex_destroy_node(member.node_id) + else: + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_get_nodes(self, ex_network_domain_id=None): + """ + Get the nodes within this geography or in given network. + + :param ex_network_domain_id: UUID of Network Domain + if not None returns only balancers in the given network + if None then returns all pools for the organization + :type ex_network_domain_id: ``str`` + + :return: Returns an ``list`` of ``DimensionDataVIPNode`` + :rtype: ``list`` of ``DimensionDataVIPNode`` + """ + params = None + if ex_network_domain_id is not None: + params = {"networkDomainId": ex_network_domain_id} + + nodes = self.connection.request_with_orgId_api_2( + "networkDomainVip/node", params=params + ).object + return self._to_nodes(nodes) + + def ex_get_node(self, node_id): + """ + Get the node specified by node_id + + :return: Returns an instance of ``DimensionDataVIPNode`` + :rtype: Instance of ``DimensionDataVIPNode`` + """ + nodes = self.connection.request_with_orgId_api_2( + "networkDomainVip/node/%s" % node_id + ).object + return self._to_node(nodes) + + def ex_destroy_node(self, node_id): + """ + Destroy a specific node + + :param node_id: The ID of of a ``DimensionDataVIPNode`` + :type node_id: ``str`` + + :return: ``True`` for success, ``False`` for failure + :rtype: ``bool`` + """ + # Destroy the node + destroy_request = ET.Element("deleteNode", {"xmlns": TYPES_URN, "id": node_id}) + + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/deleteNode", + method="POST", + data=ET.tostring(destroy_request), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_wait_for_state(self, state, func, poll_interval=2, timeout=60, *args, **kwargs): + """ + Wait for the function which returns a instance + with field status to match + + Keep polling func until one of the desired states is matched + + :param state: Either the desired state (`str`) or a `list` of states + :type state: ``str`` or ``list`` + + :param func: The function to call, e.g. ex_get_vlan + :type func: ``function`` + + :param poll_interval: The number of seconds to wait between checks + :type poll_interval: `int` + + :param timeout: The total number of seconds to wait to reach a state + :type timeout: `int` + + :param args: The arguments for func + :type args: Positional arguments + + :param kwargs: The arguments for func + :type kwargs: Keyword arguments + """ + return self.connection.wait_for_state(state, func, poll_interval, timeout, *args, **kwargs) + + def ex_get_default_health_monitors(self, network_domain_id): + """ + Get the default health monitors available for a network domain + + :param network_domain_id: The ID of of a ``DimensionDataNetworkDomain`` + :type network_domain_id: ``str`` + + :rtype: `list` of :class:`DimensionDataDefaultHealthMonitor` + """ + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/defaultHealthMonitor", + params={"networkDomainId": network_domain_id}, + method="GET", + ).object + return self._to_health_monitors(result) + + def ex_get_default_persistence_profiles(self, network_domain_id): + """ + Get the default persistence profiles available for a network domain + + :param network_domain_id: The ID of of a ``DimensionDataNetworkDomain`` + :type network_domain_id: ``str`` + + :rtype: `list` of :class:`DimensionDataPersistenceProfile` + """ + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/defaultPersistenceProfile", + params={"networkDomainId": network_domain_id}, + method="GET", + ).object + return self._to_persistence_profiles(result) + + def ex_get_default_irules(self, network_domain_id): + """ + Get the default iRules available for a network domain + + :param network_domain_id: The ID of of a ``DimensionDataNetworkDomain`` + :type network_domain_id: ``str`` + + :rtype: `list` of :class:`DimensionDataDefaultiRule` + """ + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/defaultIrule", + params={"networkDomainId": network_domain_id}, + method="GET", + ).object + return self._to_irules(result) + + def _to_irules(self, object): + irules = [] + matches = object.findall(fixxpath("defaultIrule", TYPES_URN)) + for element in matches: + irules.append(self._to_irule(element)) + return irules + + def _to_irule(self, element): + compatible = [] + matches = element.findall(fixxpath("virtualListenerCompatibility", TYPES_URN)) + for match_element in matches: + compatible.append( + DimensionDataVirtualListenerCompatibility( + type=match_element.get("type"), + protocol=match_element.get("protocol", None), + ) + ) + irule_element = element.find(fixxpath("irule", TYPES_URN)) + return DimensionDataDefaultiRule( + id=irule_element.get("id"), + name=irule_element.get("name"), + compatible_listeners=compatible, + ) + + def _to_persistence_profiles(self, object): + profiles = [] + matches = object.findall(fixxpath("defaultPersistenceProfile", TYPES_URN)) + for element in matches: + profiles.append(self._to_persistence_profile(element)) + return profiles + + def _to_persistence_profile(self, element): + compatible = [] + matches = element.findall(fixxpath("virtualListenerCompatibility", TYPES_URN)) + for match_element in matches: + compatible.append( + DimensionDataVirtualListenerCompatibility( + type=match_element.get("type"), + protocol=match_element.get("protocol", None), + ) + ) + + return DimensionDataPersistenceProfile( + id=element.get("id"), + fallback_compatible=bool(element.get("fallbackCompatible") == "true"), + name=findtext(element, "name", TYPES_URN), + compatible_listeners=compatible, + ) + + def _to_health_monitors(self, object): + monitors = [] + matches = object.findall(fixxpath("defaultHealthMonitor", TYPES_URN)) + for element in matches: + monitors.append(self._to_health_monitor(element)) + return monitors + + def _to_health_monitor(self, element): + return DimensionDataDefaultHealthMonitor( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + node_compatible=bool(findtext(element, "nodeCompatible", TYPES_URN) == "true"), + pool_compatible=bool(findtext(element, "poolCompatible", TYPES_URN) == "true"), + ) + + def _to_nodes(self, object): + nodes = [] + for element in object.findall(fixxpath("node", TYPES_URN)): + nodes.append(self._to_node(element)) + + return nodes + + def _to_node(self, element): + ipaddress = findtext(element, "ipv4Address", TYPES_URN) + if ipaddress is None: + ipaddress = findtext(element, "ipv6Address", TYPES_URN) + + name = findtext(element, "name", TYPES_URN) + + node = DimensionDataVIPNode( + id=element.get("id"), + name=name, + status=self._VALUE_TO_STATE_MAP.get( + findtext(element, "state", TYPES_URN), State.UNKNOWN + ), + connection_rate_limit=findtext(element, "connectionRateLimit", TYPES_URN), + connection_limit=findtext(element, "connectionLimit", TYPES_URN), + ip=ipaddress, + ) + + return node + + def _to_balancers(self, object): + loadbalancers = [] + for element in object.findall(fixxpath("virtualListener", TYPES_URN)): + loadbalancers.append(self._to_balancer(element)) + + return loadbalancers + + def _to_balancer(self, element): + ipaddress = findtext(element, "listenerIpAddress", TYPES_URN) + name = findtext(element, "name", TYPES_URN) + port = findtext(element, "port", TYPES_URN) + extra = {} + + pool_element = element.find(fixxpath("pool", TYPES_URN)) + if pool_element is None: + extra["pool_id"] = None + + else: + extra["pool_id"] = pool_element.get("id") + + extra["network_domain_id"] = findtext(element, "networkDomainId", TYPES_URN) + + balancer = LoadBalancer( + id=element.get("id"), + name=name, + state=self._VALUE_TO_STATE_MAP.get( + findtext(element, "state", TYPES_URN), State.UNKNOWN + ), + ip=ipaddress, + port=port, + driver=self.connection.driver, + extra=extra, + ) + + return balancer + + def _to_members(self, object): + members = [] + for element in object.findall(fixxpath("poolMember", TYPES_URN)): + members.append(self._to_member(element)) + + return members + + def _to_member(self, element): + port = findtext(element, "port", TYPES_URN) + if port is not None: + port = int(port) + pool_member = DimensionDataPoolMember( + id=element.get("id"), + name=element.find(fixxpath("node", TYPES_URN)).get("name"), + status=findtext(element, "state", TYPES_URN), + node_id=element.find(fixxpath("node", TYPES_URN)).get("id"), + ip=element.find(fixxpath("node", TYPES_URN)).get("ipAddress"), + port=port, + ) + return pool_member + + def _to_pools(self, object): + pools = [] + for element in object.findall(fixxpath("pool", TYPES_URN)): + pools.append(self._to_pool(element)) + + return pools + + def _to_pool(self, element): + pool = DimensionDataPool( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + status=findtext(element, "state", TYPES_URN), + description=findtext(element, "description", TYPES_URN), + load_balance_method=findtext(element, "loadBalanceMethod", TYPES_URN), + health_monitor_id=findtext(element, "healthMonitorId", TYPES_URN), + service_down_action=findtext(element, "serviceDownAction", TYPES_URN), + slow_ramp_time=findtext(element, "slowRampTime", TYPES_URN), + ) + return pool diff --git a/libcloud/loadbalancer/drivers/elb.py b/libcloud/loadbalancer/drivers/elb.py index f67a5228d3..39c6a8c6c4 100644 --- a/libcloud/loadbalancer/drivers/elb.py +++ b/libcloud/loadbalancer/drivers/elb.py @@ -13,75 +13,88 @@ # See the License for the specific language governing permissions and # limitations under the License. -__all__ = [ - 'ElasticLBDriver' -] +__all__ = ["ElasticLBDriver"] from libcloud.utils.py3 import httplib -from libcloud.utils.xml import findtext, findall -from libcloud.loadbalancer.types import State -from libcloud.loadbalancer.base import Driver, LoadBalancer, Member +from libcloud.utils.xml import findall, findtext from libcloud.common.aws import AWSGenericResponse, SignedAWSConnection +from libcloud.loadbalancer.base import Driver, Member, LoadBalancer +from libcloud.loadbalancer.types import State - -VERSION = '2012-06-01' -HOST = 'elasticloadbalancing.%s.amazonaws.com' -ROOT = '/%s/' % (VERSION) -NS = 'http://elasticloadbalancing.amazonaws.com/doc/%s/' % (VERSION, ) +VERSION = "2012-06-01" +HOST = "elasticloadbalancing.%s.amazonaws.com" +ROOT = "/%s/" % (VERSION) +NS = "http://elasticloadbalancing.amazonaws.com/doc/{}/".format(VERSION) class ELBResponse(AWSGenericResponse): """ Amazon ELB response class. """ + namespace = NS exceptions = {} - xpath = 'Error' + xpath = "Error" class ELBConnection(SignedAWSConnection): version = VERSION host = HOST responseCls = ELBResponse - service_name = 'elb' + service_name = "elasticloadbalancing" class ElasticLBDriver(Driver): - name = 'Amazon Elastic Load Balancing' - website = 'http://aws.amazon.com/elasticloadbalancing/' + name = "Amazon Elastic Load Balancing" + website = "http://aws.amazon.com/elasticloadbalancing/" connectionCls = ELBConnection + signature_version = "4" - def __init__(self, access_id, secret, region): - super(ElasticLBDriver, self).__init__(access_id, secret) + def __init__(self, access_id, secret, region, token=None): + self.token = token self.region = region - self.connection.host = HOST % (region) + self.region_name = region + super().__init__(access_id, secret, token=token, host=HOST % region, region=region) def list_protocols(self): - return ['tcp', 'ssl', 'http', 'https'] + return ["tcp", "ssl", "http", "https"] - def list_balancers(self): - params = {'Action': 'DescribeLoadBalancers'} + def list_balancers(self, ex_fetch_tags=False): + params = {"Action": "DescribeLoadBalancers"} data = self.connection.request(ROOT, params=params).object - return self._to_balancers(data) - - def create_balancer(self, name, port, protocol, algorithm, members, - ex_members_availability_zones=None): + balancers = self._to_balancers(data) + + if ex_fetch_tags: + for balancer in balancers: + self._ex_populate_balancer_tags(balancer) + + return balancers + + def create_balancer( + self, + name, + port, + protocol, + algorithm, + members, + ex_members_availability_zones=None, + ): if ex_members_availability_zones is None: - ex_members_availability_zones = ['a'] + ex_members_availability_zones = ["a"] params = { - 'Action': 'CreateLoadBalancer', - 'LoadBalancerName': name, - 'Listeners.member.1.InstancePort': str(port), - 'Listeners.member.1.InstanceProtocol': protocol.upper(), - 'Listeners.member.1.LoadBalancerPort': str(port), - 'Listeners.member.1.Protocol': protocol.upper(), + "Action": "CreateLoadBalancer", + "LoadBalancerName": name, + "Listeners.member.1.InstancePort": str(port), + "Listeners.member.1.InstanceProtocol": protocol.upper(), + "Listeners.member.1.LoadBalancerPort": str(port), + "Listeners.member.1.Protocol": protocol.upper(), } for i, z in enumerate(ex_members_availability_zones): - zone = ''.join((self.region, z)) - params['AvailabilityZones.member.%d' % (i + 1)] = zone + zone = "".join((self.region, z)) + params["AvailabilityZones.member.%d" % (i + 1)] = zone data = self.connection.request(ROOT, params=params).object @@ -89,43 +102,45 @@ def create_balancer(self, name, port, protocol, algorithm, members, id=name, name=name, state=State.PENDING, - ip=findtext(element=data, xpath='DNSName', namespace=NS), + ip=findtext(element=data, xpath="DNSName", namespace=NS), port=port, - driver=self.connection.driver + driver=self.connection.driver, ) balancer._members = [] return balancer def destroy_balancer(self, balancer): - params = { - 'Action': 'DeleteLoadBalancer', - 'LoadBalancerName': balancer.id - } + params = {"Action": "DeleteLoadBalancer", "LoadBalancerName": balancer.id} self.connection.request(ROOT, params=params) return True - def get_balancer(self, balancer_id): + def get_balancer(self, balancer_id, ex_fetch_tags=False): params = { - 'Action': 'DescribeLoadBalancers', - 'LoadBalancerNames.member.1': balancer_id + "Action": "DescribeLoadBalancers", + "LoadBalancerNames.member.1": balancer_id, } data = self.connection.request(ROOT, params=params).object - return self._to_balancers(data)[0] + balancer = self._to_balancers(data)[0] + + if ex_fetch_tags: + balancer = self._ex_populate_balancer_tags(balancer) + + return balancer def balancer_attach_compute_node(self, balancer, node): params = { - 'Action': 'RegisterInstancesWithLoadBalancer', - 'LoadBalancerName': balancer.id, - 'Instances.member.1.InstanceId': node.id + "Action": "RegisterInstancesWithLoadBalancer", + "LoadBalancerName": balancer.id, + "Instances.member.1.InstanceId": node.id, } self.connection.request(ROOT, params=params) balancer._members.append(Member(node.id, None, None, balancer=self)) def balancer_detach_member(self, balancer, member): params = { - 'Action': 'DeregisterInstancesFromLoadBalancer', - 'LoadBalancerName': balancer.id, - 'Instances.member.1.InstanceId': member.id + "Action": "DeregisterInstancesFromLoadBalancer", + "LoadBalancerName": balancer.id, + "Instances.member.1.InstanceId": member.id, } self.connection.request(ROOT, params=params) balancer._members = [m for m in balancer._members if m.id != member.id] @@ -141,8 +156,8 @@ def ex_list_balancer_policies(self, balancer): :rtype: ``list`` of ``str`` """ params = { - 'Action': 'DescribeLoadBalancerPolicies', - 'LoadBalancerName': balancer.id + "Action": "DescribeLoadBalancerPolicies", + "LoadBalancerName": balancer.id, } data = self.connection.request(ROOT, params=params).object @@ -154,13 +169,12 @@ def ex_list_balancer_policy_types(self): :rtype: ``list`` of ``str`` """ - params = {'Action': 'DescribeLoadBalancerPolicyTypes'} + params = {"Action": "DescribeLoadBalancerPolicyTypes"} data = self.connection.request(ROOT, params=params).object return self._to_policy_types(data) - def ex_create_balancer_policy(self, name, policy_name, policy_type, - policy_attributes=None): + def ex_create_balancer_policy(self, name, policy_name, policy_type, policy_attributes=None): """ Create a new load balancer policy @@ -178,19 +192,18 @@ def ex_create_balancer_policy(self, name, policy_name, policy_type, :type policy_attributes: ``PolicyAttribute list`` """ params = { - 'Action': 'CreateLoadBalancerPolicy', - 'LoadBalancerName': name, - 'PolicyName': policy_name, - 'PolicyTypeName': policy_type + "Action": "CreateLoadBalancerPolicy", + "LoadBalancerName": name, + "PolicyName": policy_name, + "PolicyTypeName": policy_type, } if policy_attributes is not None: - for index, (name, value) in enumerate( - policy_attributes.iteritems(), 1): - params['PolicyAttributes.member.%d. \ - AttributeName' % (index)] = name - params['PolicyAttributes.member.%d. \ - AttributeValue' % (index)] = value + for index, (name, value) in enumerate(policy_attributes.iteritems(), 1): + params["PolicyAttributes.member.%d. \ + AttributeName" % (index)] = name + params["PolicyAttributes.member.%d. \ + AttributeValue" % (index)] = value response = self.connection.request(ROOT, params=params) return response.status == httplib.OK @@ -206,9 +219,9 @@ def ex_delete_balancer_policy(self, name, policy_name): :type policy_name: ``str`` """ params = { - 'Action': 'DeleteLoadBalancerPolicy', - 'LoadBalancerName': name, - 'PolicyName': policy_name + "Action": "DeleteLoadBalancerPolicy", + "LoadBalancerName": name, + "PolicyName": policy_name, } response = self.connection.request(ROOT, params=params) @@ -229,20 +242,18 @@ def ex_set_balancer_policies_listener(self, name, port, policies): :type policies: ``string list`` """ params = { - 'Action': 'SetLoadBalancerPoliciesOfListener', - 'LoadBalancerName': name, - 'LoadBalancerPort': str(port) + "Action": "SetLoadBalancerPoliciesOfListener", + "LoadBalancerName": name, + "LoadBalancerPort": str(port), } if policies: - params = self._create_list_params(params, policies, - 'PolicyNames.member.%d') + params = self._create_list_params(params, policies, "PolicyNames.member.%d") response = self.connection.request(ROOT, params=params) return response.status == httplib.OK - def ex_set_balancer_policies_backend_server(self, name, instance_port, - policies): + def ex_set_balancer_policies_backend_server(self, name, instance_port, policies): """ Replaces the current set of policies associated with a port on which the back-end server is listening with a new set of policies @@ -257,14 +268,13 @@ def ex_set_balancer_policies_backend_server(self, name, instance_port, :type policies: ``string list` """ params = { - 'Action': 'SetLoadBalancerPoliciesForBackendServer', - 'LoadBalancerName': name, - 'InstancePort': str(instance_port) + "Action": "SetLoadBalancerPoliciesForBackendServer", + "LoadBalancerName": name, + "InstancePort": str(instance_port), } if policies: - params = self._create_list_params(params, policies, - 'PolicyNames.member.%d') + params = self._create_list_params(params, policies, "PolicyNames.member.%d") response = self.connection.request(ROOT, params=params) return response.status == httplib.OK @@ -280,20 +290,17 @@ def ex_create_balancer_listeners(self, name, listeners=None): InstancePortNumber, Protocol,[SSLCertificateId]) :type listeners: ``list of tuple` """ - params = { - 'Action': 'CreateLoadBalancerListeners', - 'LoadBalancerName': name - } + params = {"Action": "CreateLoadBalancerListeners", "LoadBalancerName": name} for index, listener in enumerate(listeners): i = index + 1 protocol = listener[2].upper() - params['Listeners.member.%d.LoadBalancerPort' % i] = listener[0] - params['Listeners.member.%d.InstancePort' % i] = listener[1] - params['Listeners.member.%d.Protocol' % i] = listener[2] - if protocol == 'HTTPS' or protocol == 'SSL': - params['Listeners.member.%d. \ - SSLCertificateId' % i] = listener[3] + params["Listeners.member.%d.LoadBalancerPort" % i] = listener[0] + params["Listeners.member.%d.InstancePort" % i] = listener[1] + params["Listeners.member.%d.Protocol" % i] = listener[2] + if protocol == "HTTPS" or protocol == "SSL": + params["Listeners.member.%d. \ + SSLCertificateId" % i] = listener[3] else: return False @@ -301,25 +308,28 @@ def ex_create_balancer_listeners(self, name, listeners=None): return response.status == httplib.OK def _to_policies(self, data): - xpath = 'DescribeLoadBalancerPoliciesResult/PolicyDescriptions/member' - return [findtext(element=el, xpath='PolicyName', namespace=NS) - for el in findall(element=data, xpath=xpath, namespace=NS)] + xpath = "DescribeLoadBalancerPoliciesResult/PolicyDescriptions/member" + return [ + findtext(element=el, xpath="PolicyName", namespace=NS) + for el in findall(element=data, xpath=xpath, namespace=NS) + ] def _to_policy_types(self, data): - xpath = 'DescribeLoadBalancerPolicyTypesResult/' - xpath += 'PolicyTypeDescriptions/member' - return [findtext(element=el, xpath='PolicyTypeName', namespace=NS) - for el in findall(element=data, xpath=xpath, namespace=NS)] + xpath = "DescribeLoadBalancerPolicyTypesResult/" + xpath += "PolicyTypeDescriptions/member" + return [ + findtext(element=el, xpath="PolicyTypeName", namespace=NS) + for el in findall(element=data, xpath=xpath, namespace=NS) + ] def _to_balancers(self, data): - xpath = 'DescribeLoadBalancersResult/LoadBalancerDescriptions/member' - return [self._to_balancer(el) - for el in findall(element=data, xpath=xpath, namespace=NS)] + xpath = "DescribeLoadBalancersResult/LoadBalancerDescriptions/member" + return [self._to_balancer(el) for el in findall(element=data, xpath=xpath, namespace=NS)] def _to_balancer(self, el): - name = findtext(element=el, xpath='LoadBalancerName', namespace=NS) - dns_name = findtext(el, xpath='DNSName', namespace=NS) - port = findtext(el, xpath='LoadBalancerPort', namespace=NS) + name = findtext(element=el, xpath="LoadBalancerName", namespace=NS) + dns_name = findtext(el, xpath="DNSName", namespace=NS) + port = findtext(el, xpath="LoadBalancerPort", namespace=NS) balancer = LoadBalancer( id=name, @@ -327,19 +337,32 @@ def _to_balancer(self, el): state=State.UNKNOWN, ip=dns_name, port=port, - driver=self.connection.driver + driver=self.connection.driver, ) - xpath = 'Instances/member/InstanceId' + xpath = "Instances/member/InstanceId" members = findall(element=el, xpath=xpath, namespace=NS) balancer._members = [] for m in members: - balancer._members.append(Member(m.text, None, None, - balancer=balancer)) + balancer._members.append(Member(m.text, None, None, balancer=balancer)) return balancer + def _to_tags(self, data): + """ + return tags dict + """ + tags = {} + xpath = "DescribeTagsResult/TagDescriptions/member/Tags/member" + for el in findall(element=data, xpath=xpath, namespace=NS): + key = findtext(element=el, xpath="Key", namespace=NS) + value = findtext(element=el, xpath="Value", namespace=NS) + if key: + tags[key] = value + + return tags + def _create_list_params(self, params, items, label): """ return parameter list @@ -349,3 +372,26 @@ def _create_list_params(self, params, items, label): for index, item in enumerate(items): params[label % (index + 1)] = item return params + + def _ex_connection_class_kwargs(self): + kwargs = super()._ex_connection_class_kwargs() + if hasattr(self, "token") and self.token is not None: + kwargs["token"] = self.token + kwargs["signature_version"] = "4" + else: + kwargs["signature_version"] = self.signature_version + + return kwargs + + def _ex_list_balancer_tags(self, balancer_id): + params = {"Action": "DescribeTags", "LoadBalancerNames.member.1": balancer_id} + data = self.connection.request(ROOT, params=params).object + return self._to_tags(data) + + def _ex_populate_balancer_tags(self, balancer): + tags = balancer.extra.get("tags", {}) + tags.update(self._ex_list_balancer_tags(balancer.id)) + if tags: + balancer.extra["tags"] = tags + + return balancer diff --git a/libcloud/loadbalancer/drivers/gce.py b/libcloud/loadbalancer/drivers/gce.py index c754221004..9fa5eecc84 100644 --- a/libcloud/loadbalancer/drivers/gce.py +++ b/libcloud/loadbalancer/drivers/gce.py @@ -18,7 +18,7 @@ except ImportError: import json # NOQA -from libcloud.loadbalancer.base import LoadBalancer, Member, Driver, Algorithm +from libcloud.loadbalancer.base import Driver, Member, Algorithm, LoadBalancer from libcloud.compute.drivers.gce import GCEConnection, GCENodeDriver # GCE doesn't actually give you an algorithm choice, but this is here simply as @@ -29,18 +29,15 @@ class GCELBDriver(Driver): connectionCls = GCEConnection - apiname = 'googleapis' - name = 'Google Compute Engine Load Balancer' - website = 'https://cloud.google.com/' + apiname = "googleapis" + name = "Google Compute Engine Load Balancer" + website = "https://cloud.google.com/" - _VALUE_TO_ALGORITHM_MAP = { - 'RANDOM': Algorithm.RANDOM - } + _VALUE_TO_ALGORITHM_MAP = {"RANDOM": Algorithm.RANDOM} def __init__(self, *args, **kwargs): - - if kwargs.get('gce_driver'): - self.gce = kwargs['gce_driver'] + if kwargs.get("gce_driver"): + self.gce = kwargs["gce_driver"] else: self.gce = GCENodeDriver(*args, **kwargs) @@ -56,7 +53,7 @@ def _get_node_from_ip(self, ip): :return: Node object that has the given IP, or None if not found. :rtype: :class:`Node` or None """ - all_nodes = self.gce.list_nodes(ex_zone='all') + all_nodes = self.gce.list_nodes(ex_zone="all") for node in all_nodes: if ip in node.public_ips: return node @@ -70,7 +67,7 @@ def list_protocols(self): :rtype: ``list`` of ``str`` """ - return ['TCP', 'UDP'] + return ["TCP", "UDP"] def list_balancers(self, ex_region=None): """ @@ -88,9 +85,18 @@ def list_balancers(self, ex_region=None): balancers.append(self._forwarding_rule_to_loadbalancer(fwr)) return balancers - def create_balancer(self, name, port, protocol, algorithm, members, - ex_region=None, ex_healthchecks=None, ex_address=None, - ex_session_affinity=None): + def create_balancer( + self, + name, + port, + protocol, + algorithm, + members, + ex_region=None, + ex_healthchecks=None, + ex_address=None, + ex_session_affinity=None, + ): """ Create a new load balancer instance. @@ -145,30 +151,39 @@ def create_balancer(self, name, port, protocol, algorithm, members, node_list = [] for member in members: # Member object - if hasattr(member, 'ip'): - if member.extra.get('node'): - node_list.append(member.extra['node']) + if hasattr(member, "ip"): + if member.extra.get("node"): + node_list.append(member.extra["node"]) else: node_list.append(self._get_node_from_ip(member.ip)) # Node object - elif hasattr(member, 'name'): + elif hasattr(member, "name"): node_list.append(member) # Assume it's a node name otherwise else: - node_list.append(self.gce.ex_get_node(member, 'all')) + node_list.append(self.gce.ex_get_node(member, "all")) # Create Target Pool - tp_name = '%s-tp' % name + tp_name = "%s-tp" % name targetpool = self.gce.ex_create_targetpool( - tp_name, region=ex_region, healthchecks=ex_healthchecks, - nodes=node_list, session_affinity=ex_session_affinity) + tp_name, + region=ex_region, + healthchecks=ex_healthchecks, + nodes=node_list, + session_affinity=ex_session_affinity, + ) # Create the Forwarding rule, but if it fails, delete the target pool. try: forwarding_rule = self.gce.ex_create_forwarding_rule( - name, targetpool, region=ex_region, protocol=protocol, - port_range=port, address=ex_address) - except: + name, + targetpool, + region=ex_region, + protocol=protocol, + port_range=port, + address=ex_address, + ) + except Exception: targetpool.destroy() raise @@ -188,9 +203,9 @@ def destroy_balancer(self, balancer): :return: True if successful :rtype: ``bool`` """ - destroy = balancer.extra['forwarding_rule'].destroy() + destroy = balancer.extra["forwarding_rule"].destroy() if destroy: - tp_destroy = balancer.extra['targetpool'].destroy() + tp_destroy = balancer.extra["targetpool"].destroy() return tp_destroy else: return destroy @@ -222,7 +237,7 @@ def balancer_attach_compute_node(self, balancer, node): :return: Member after joining the balancer. :rtype: :class:`Member` """ - add_node = balancer.extra['targetpool'].add_node(node) + add_node = balancer.extra["targetpool"].add_node(node) if add_node: return self._node_to_member(node, balancer) @@ -239,8 +254,8 @@ def balancer_attach_member(self, balancer, member): :return: Member after joining the balancer. :rtype: :class:`Member` """ - node = member.extra.get('node') or self._get_node_from_ip(member.ip) - add_node = balancer.extra['targetpool'].add_node(node) + node = member.extra.get("node") or self._get_node_from_ip(member.ip) + add_node = balancer.extra["targetpool"].add_node(node) if add_node: return self._node_to_member(node, balancer) @@ -257,8 +272,8 @@ def balancer_detach_member(self, balancer, member): :return: True if member detach was successful, otherwise False :rtype: ``bool`` """ - node = member.extra.get('node') or self._get_node_from_ip(member.ip) - remove_node = balancer.extra['targetpool'].remove_node(node) + node = member.extra.get("node") or self._get_node_from_ip(member.ip) + remove_node = balancer.extra["targetpool"].remove_node(node) return remove_node def balancer_list_members(self, balancer): @@ -270,8 +285,7 @@ def balancer_list_members(self, balancer): :rtype: ``list`` of :class:`Member` """ - return [self._node_to_member(n, balancer) for n in - balancer.extra['targetpool'].nodes] + return [self._node_to_member(n, balancer) for n in balancer.extra["targetpool"].nodes] def ex_create_healthcheck(self, *args, **kwargs): return self.gce.ex_create_healthcheck(*args, **kwargs) @@ -292,7 +306,7 @@ def ex_balancer_attach_healthcheck(self, balancer, healthcheck): :return: True if successful :rtype: ``bool`` """ - return balancer.extra['targetpool'].add_healthcheck(healthcheck) + return balancer.extra["targetpool"].add_healthcheck(healthcheck) def ex_balancer_detach_healthcheck(self, balancer, healthcheck): """ @@ -307,7 +321,7 @@ def ex_balancer_detach_healthcheck(self, balancer, healthcheck): :return: True if successful :rtype: ``bool`` """ - return balancer.extra['targetpool'].remove_healthcheck(healthcheck) + return balancer.extra["targetpool"].remove_healthcheck(healthcheck) def ex_balancer_list_healthchecks(self, balancer): """ @@ -318,7 +332,7 @@ def ex_balancer_list_healthchecks(self, balancer): :rtype: ``list`` of :class:`HealthChecks` """ - return balancer.extra['healthchecks'] + return balancer.extra["healthchecks"] def _node_to_member(self, node, balancer): """ @@ -336,16 +350,24 @@ def _node_to_member(self, node, balancer): # A balancer can have a node as a member, even if the node doesn't # exist. In this case, 'node' is simply a string to where the resource # would be found if it was there. - if hasattr(node, 'name'): + if hasattr(node, "name"): member_id = node.name - member_ip = node.public_ips[0] else: member_id = node + + if hasattr(node, "public_ips") and len(node.public_ips) > 0: + member_ip = node.public_ips[0] + else: member_ip = None - extra = {'node': node} - return Member(id=member_id, ip=member_ip, port=balancer.port, - balancer=balancer, extra=extra) + extra = {"node": node} + return Member( + id=member_id, + ip=member_ip, + port=balancer.port, + balancer=balancer, + extra=extra, + ) def _forwarding_rule_to_loadbalancer(self, forwarding_rule): """ @@ -358,12 +380,16 @@ def _forwarding_rule_to_loadbalancer(self, forwarding_rule): :rtype: :class:`LoadBalancer` """ extra = {} - extra['forwarding_rule'] = forwarding_rule - extra['targetpool'] = forwarding_rule.targetpool - extra['healthchecks'] = forwarding_rule.targetpool.healthchecks - - return LoadBalancer(id=forwarding_rule.id, - name=forwarding_rule.name, state=None, - ip=forwarding_rule.address, - port=forwarding_rule.extra['portRange'], - driver=self, extra=extra) + extra["forwarding_rule"] = forwarding_rule + extra["targetpool"] = forwarding_rule.targetpool + extra["healthchecks"] = forwarding_rule.targetpool.healthchecks + + return LoadBalancer( + id=forwarding_rule.id, + name=forwarding_rule.name, + state=None, + ip=forwarding_rule.address, + port=forwarding_rule.extra["portRange"], + driver=self, + extra=extra, + ) diff --git a/libcloud/loadbalancer/drivers/gogrid.py b/libcloud/loadbalancer/drivers/gogrid.py deleted file mode 100644 index 201ad03125..0000000000 --- a/libcloud/loadbalancer/drivers/gogrid.py +++ /dev/null @@ -1,239 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import sys -import time - -from libcloud.utils.py3 import httplib - -try: - import simplejson as json -except ImportError: - import json - -from libcloud.utils.misc import reverse_dict -from libcloud.common.types import LibcloudError -from libcloud.common.gogrid import GoGridConnection, GoGridResponse,\ - BaseGoGridDriver -from libcloud.loadbalancer.base import LoadBalancer, Member, Driver, Algorithm -from libcloud.loadbalancer.base import DEFAULT_ALGORITHM -from libcloud.loadbalancer.types import State, LibcloudLBImmutableError - - -class GoGridLBResponse(GoGridResponse): - def success(self): - if self.status == httplib.INTERNAL_SERVER_ERROR: - # Hack, but at least this error message is more useful than - # "unexpected server error" - body = json.loads(self.body) - if body['method'] == '/grid/loadbalancer/add' and \ - len(body['list']) >= 1 and \ - body['list'][0]['message'].find( - 'unexpected server error') != -1: - raise LibcloudError( - value='You mostly likely tried to add a member with an IP' - ' address not assigned to your account', driver=self) - return super(GoGridLBResponse, self).success() - - -class GoGridLBConnection(GoGridConnection): - """ - Connection class for the GoGrid load-balancer driver. - """ - responseCls = GoGridLBResponse - - -class GoGridLBDriver(BaseGoGridDriver, Driver): - connectionCls = GoGridLBConnection - api_name = 'gogrid_lb' - name = 'GoGrid LB' - website = 'http://www.gogrid.com/' - - LB_STATE_MAP = {'On': State.RUNNING, - 'Unknown': State.UNKNOWN} - _VALUE_TO_ALGORITHM_MAP = { - 'round robin': Algorithm.ROUND_ROBIN, - 'least connect': Algorithm.LEAST_CONNECTIONS - } - _ALGORITHM_TO_VALUE_MAP = reverse_dict(_VALUE_TO_ALGORITHM_MAP) - - def __init__(self, *args, **kwargs): - """ - @inherits: :class:`Driver.__init__` - """ - super(GoGridLBDriver, self).__init__(*args, **kwargs) - - def list_protocols(self): - # GoGrid only supports http - return ['http'] - - def list_balancers(self): - return self._to_balancers( - self.connection.request('/api/grid/loadbalancer/list').object) - - def ex_create_balancer_nowait(self, name, members, protocol='http', - port=80, algorithm=DEFAULT_ALGORITHM): - """ - @inherits: :class:`Driver.create_balancer` - """ - algorithm = self._algorithm_to_value(algorithm) - - params = {'name': name, - 'loadbalancer.type': algorithm, - 'virtualip.ip': self._get_first_ip(), - 'virtualip.port': port} - params.update(self._members_to_params(members)) - - resp = self.connection.request('/api/grid/loadbalancer/add', - method='GET', - params=params) - return self._to_balancers(resp.object)[0] - - def create_balancer(self, name, members, protocol='http', port=80, - algorithm=DEFAULT_ALGORITHM): - balancer = self.ex_create_balancer_nowait(name, members, protocol, - port, algorithm) - - timeout = 60 * 20 - waittime = 0 - interval = 2 * 15 - - if balancer.id is not None: - return balancer - else: - while waittime < timeout: - balancers = self.list_balancers() - - for i in balancers: - if i.name == balancer.name and i.id is not None: - return i - - waittime += interval - time.sleep(interval) - - raise Exception('Failed to get id') - - def destroy_balancer(self, balancer): - try: - resp = self.connection.request( - '/api/grid/loadbalancer/delete', method='POST', - params={'id': balancer.id}) - except Exception: - e = sys.exc_info()[1] - if "Update request for LoadBalancer" in str(e): - raise LibcloudLBImmutableError( - "Cannot delete immutable object", GoGridLBDriver) - else: - raise - - return resp.status == 200 - - def get_balancer(self, **kwargs): - params = {} - - try: - params['name'] = kwargs['ex_balancer_name'] - except KeyError: - balancer_id = kwargs['balancer_id'] - params['id'] = balancer_id - - resp = self.connection.request('/api/grid/loadbalancer/get', - params=params) - - return self._to_balancers(resp.object)[0] - - def balancer_attach_member(self, balancer, member): - members = self.balancer_list_members(balancer) - members.append(member) - - params = {"id": balancer.id} - - params.update(self._members_to_params(members)) - - resp = self._update_balancer(params) - return [m for m in - self._to_members(resp.object["list"][0]["realiplist"], - balancer) - if m.ip == member.ip][0] - - def balancer_detach_member(self, balancer, member): - members = self.balancer_list_members(balancer) - - remaining_members = [n for n in members if n.id != member.id] - - params = {"id": balancer.id} - params.update(self._members_to_params(remaining_members)) - - resp = self._update_balancer(params) - - return resp.status == 200 - - def balancer_list_members(self, balancer): - resp = self.connection.request('/api/grid/loadbalancer/get', - params={'id': balancer.id}) - return self._to_members(resp.object["list"][0]["realiplist"], balancer) - - def _update_balancer(self, params): - try: - return self.connection.request('/api/grid/loadbalancer/edit', - method='POST', - params=params) - except Exception: - e = sys.exc_info()[1] - if "Update already pending" in str(e): - raise LibcloudLBImmutableError( - "Balancer is immutable", GoGridLBDriver) - - raise LibcloudError(value='Exception: %s' % str(e), driver=self) - - def _members_to_params(self, members): - """ - Helper method to convert list of :class:`Member` objects - to GET params. - - """ - - params = {} - - i = 0 - for member in members: - params["realiplist.%s.ip" % i] = member.ip - params["realiplist.%s.port" % i] = member.port - i += 1 - - return params - - def _to_balancers(self, object): - return [self._to_balancer(el) for el in object["list"]] - - def _to_balancer(self, el): - lb = LoadBalancer(id=el.get("id"), - name=el["name"], - state=self.LB_STATE_MAP.get( - el["state"]["name"], State.UNKNOWN), - ip=el["virtualip"]["ip"]["ip"], - port=el["virtualip"]["port"], - driver=self.connection.driver) - return lb - - def _to_members(self, object, balancer=None): - return [self._to_member(el, balancer) for el in object] - - def _to_member(self, el, balancer=None): - member = Member(id=el["ip"]["id"], - ip=el["ip"]["ip"], - port=el["port"], - balancer=balancer) - return member diff --git a/libcloud/loadbalancer/drivers/ninefold.py b/libcloud/loadbalancer/drivers/ninefold.py index cb28f6c6cc..2c6fd2bbc6 100644 --- a/libcloud/loadbalancer/drivers/ninefold.py +++ b/libcloud/loadbalancer/drivers/ninefold.py @@ -14,16 +14,15 @@ # limitations under the License. from libcloud.loadbalancer.providers import Provider - from libcloud.loadbalancer.drivers.cloudstack import CloudStackLBDriver class NinefoldLBDriver(CloudStackLBDriver): - "Driver for load balancers on Ninefold's Compute platform." + """Driver for load balancers on Ninefold's Compute platform.""" - host = 'api.ninefold.com' - path = '/compute/v1.0/' + host = "api.ninefold.com" + path = "/compute/v1.0/" type = Provider.NINEFOLD - name = 'Ninefold LB' - website = 'http://ninefold.com/' + name = "Ninefold LB" + website = "http://ninefold.com/" diff --git a/libcloud/loadbalancer/drivers/nttcis.py b/libcloud/loadbalancer/drivers/nttcis.py new file mode 100644 index 0000000000..f55d5d2002 --- /dev/null +++ b/libcloud/loadbalancer/drivers/nttcis.py @@ -0,0 +1,1594 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance withv +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.utils.py3 import ET +from libcloud.utils.xml import findall, findtext, fixxpath +from libcloud.utils.misc import reverse_dict +from libcloud.common.nttcis import ( + TYPES_URN, + API_ENDPOINTS, + DEFAULT_REGION, + NttCisPool, + NttCisVIPNode, + NttCisConnection, + NttCisPoolMember, + NttCisDefaultiRule, + NttCisVirtualListener, + NttCisPersistenceProfile, + NttCisDefaultHealthMonitor, + NttCisVirtualListenerCompatibility, + get_params, + process_xml, +) +from libcloud.loadbalancer.base import DEFAULT_ALGORITHM, Driver, Member, Algorithm, LoadBalancer +from libcloud.loadbalancer.types import State, Provider + + +class NttCisLBDriver(Driver): + """ + NttCis LB driver. + """ + + selected_region = None + connectionCls = NttCisConnection + name = "NTTC-CIS Load Balancer" + website = "https://cloud.nttcis.com/" + type = Provider.NTTCIS + api_version = 1.0 + + _VALUE_TO_ALGORITHM_MAP = { + "ROUND_ROBIN": Algorithm.ROUND_ROBIN, + "LEAST_CONNECTIONS_MEMBER": Algorithm.LEAST_CONNECTIONS_MEMBER, + "LEAST_CONNECTIONS_NODE": Algorithm.LEAST_CONNECTIONS_NODE, + "OBSERVED_MEMBER": Algorithm.OBSERVED_MEMBER, + "OBSERVED_NODE": Algorithm.OBSERVED_NODE, + "PREDICTIVE_MEMBER": Algorithm.PREDICTIVE_MEMBER, + "PREDICTIVE_NODE": Algorithm.PREDICTIVE_NODE, + } + _ALGORITHM_TO_VALUE_MAP = reverse_dict(_VALUE_TO_ALGORITHM_MAP) + + _VALUE_TO_STATE_MAP = { + "NORMAL": State.RUNNING, + "PENDING_ADD": State.PENDING, + "PENDING_CHANGE": State.PENDING, + "PENDING_DELETE": State.PENDING, + "FAILED_ADD": State.ERROR, + "FAILED_CHANGE": State.ERROR, + "FAILED_DELETE": State.ERROR, + "REQUIRES_SUPPORT": State.ERROR, + } + + def __init__( + self, + key, + network_domain_id, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=DEFAULT_REGION, + **kwargs, + ): + self.network_domain_id = network_domain_id + + if region not in API_ENDPOINTS and host is None: + raise ValueError("Invalid region: %s, no host specified" % (region)) + if region is not None: + self.selected_region = API_ENDPOINTS[region] + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + api_version=api_version, + region=region, + **kwargs, + ) + + def _ex_connection_class_kwargs(self): + """ + Add the region to the kwargs before the connection is instantiated + """ + + kwargs = super()._ex_connection_class_kwargs() + kwargs["region"] = self.selected_region + return kwargs + + def create_balancer( + self, + name, + listener_port=None, + port=None, + protocol=None, + algorithm=None, + members=None, + optimization_profile="TCP", + ex_listener_ip_address=None, + ): + """ + + Create a new load balancer instance + + :param name: Name of the new load balancer (required) + :type name: ``str`` + + :param listener_port: An integer in the range of 1-65535. + If not supplied, it will be taken to + mean 'Any Port' + :type port: ``int + + :param port: An integer in the range of 1-65535. If not supplied, + it will be taken to mean 'Any Port' Assumed that + node ports will different from listener port. + :type port: ``int`` + + :param protocol: Loadbalancer protocol, defaults to http. + :type protocol: ``str`` + + :param members: list of Members to attach to balancer (optional) + :type members: ``list`` of :class:`Member` + + :param algorithm: Load balancing algorithm, defaults to ROUND_ROBIN. + :type algorithm: :class:`.Algorithm` + + :param optimization_profile: For STANDARD type and protocol TCP + an optimization type of TCP, LAN_OPT, + WAN_OPT, MOBILE_OPT, or TCP_LEGACY is + required. Default is TCP + :type protocol: ``str`` + + :param ex_listener_ip_address: Must be a valid IPv4 in dot-decimal + notation (x.x.x.x). + :type ex_listener_ip_address: ``str`` + + :rtype: :class:`LoadBalancer` + """ + + network_domain_id = self.network_domain_id + if protocol is None: + protocol = "http" + if algorithm is None: + algorithm = DEFAULT_ALGORITHM + + # Create a pool first + + pool = self.ex_create_pool( + network_domain_id=network_domain_id, + name=name, + ex_description=None, + balancer_method=self._ALGORITHM_TO_VALUE_MAP[algorithm], + ) + + # Attach the members to the pool as nodes + if members is not None: + for member in members: + if not isinstance(member, Member): + member = self.ex_create_node( + network_domain_id=network_domain_id, + name=member.name, + ip=member.private_ips[0], + ex_description=None, + ) + self.ex_create_pool_member(pool=pool, node=member, port=port) + + # Create the virtual listener (balancer) + listener = self.ex_create_virtual_listener( + network_domain_id=network_domain_id, + name=name, + ex_description=name, + port=listener_port, + pool=pool, + protocol=protocol, + optimization_profile=optimization_profile, + listener_ip_address=ex_listener_ip_address, + ) + + return LoadBalancer( + id=listener.id, + name=listener.name, + state=State.RUNNING, + ip=listener.ip, + port=port, + driver=self, + extra={ + "pool_id": pool.id, + "network_domain_id": network_domain_id, + "listener_ip_address": ex_listener_ip_address, + }, + ) + + def ex_update_listener(self, virtual_listener, **kwargs): + """ + Update a current virtual listener. + :param virtual_listener: The listener to be updated + :return: The edited version of the listener + """ + edit_listener_elm = ET.Element( + "editVirtualListener", + { + "xmlns": TYPES_URN, + "id": virtual_listener.id, + "xmlns:xsi": "http://www.w3.org/2001/" "XMLSchema-instance", + }, + ) + for k, v in kwargs.items(): + if v is None: + ET.SubElement(edit_listener_elm, k, {"xsi:nil": "true"}) + else: + ET.SubElement(edit_listener_elm, k).text = v + + result = self.connection.request_with_orgId_api_2( + "networkDomainVip/editVirtualListener", + method="POST", + data=ET.tostring(edit_listener_elm), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def list_balancers(self, ex_network_domain_id=None): + """ + List all loadbalancers inside a geography or in given network. + + In NTTC-CIS terminology these are known as virtual listeners + + :param ex_network_domain_id: UUID of Network Domain + if not None returns only balancers in the given network + if None then returns all pools for the organization + :type ex_network_domain_id: ``str`` + + :rtype: ``list`` of :class:`LoadBalancer` + """ + params = None + if ex_network_domain_id is not None: + params = {"networkDomainId": ex_network_domain_id} + + return self._to_balancers( + self.connection.request_with_orgId_api_2( + "networkDomainVip/virtualListener", params=params + ).object + ) + + def get_balancer(self, balancer_id): + """ + Return a :class:`LoadBalancer` object. + + :param balancer_id: id of a load balancer you want to fetch + :type balancer_id: ``str`` + + :rtype: :class:`LoadBalancer` + """ + + bal = self.connection.request_with_orgId_api_2( + "networkDomainVip/virtualListener/%s" % balancer_id + ).object + return self._to_balancer(bal) + + def list_protocols(self): + """ + Return a list of supported protocols. + + Since all protocols are support by NTTC-CIS, this is a list + of common protocols. + + :rtype: ``list`` of ``str`` + """ + return ["http", "https", "tcp", "udp", "ftp", "smtp"] + + def balancer_list_members(self, balancer): + """ + Return list of members attached to balancer. + + In NTTC-CIS terminology these are the members of the pools + within a virtual listener. + + :param balancer: LoadBalancer which should be used + :type balancer: :class:`LoadBalancer` + + :rtype: ``list`` of :class:`Member` + """ + pool_members = self.ex_get_pool_members(balancer.extra["pool_id"]) + members = [] + for pool_member in pool_members: + members.append( + Member( + id=pool_member.id, + ip=pool_member.ip, + port=pool_member.port, + balancer=balancer, + extra=None, + ) + ) + return members + + def balancer_attach_member(self, balancer, member): + """ + Attach a member to balancer + + :param balancer: LoadBalancer which should be used + :type balancer: :class:`LoadBalancer` + + :param member: Member to join to the balancer + :type member: :class:`Member` + + :return: Member after joining the balancer. + :rtype: :class:`Member` + """ + node = self.ex_create_node( + network_domain_id=balancer.extra["network_domain_id"], + name="Member." + member.ip, + ip=member.ip, + ex_description="", + ) + if node is False: + return False + pool = self.ex_get_pool(balancer.extra["pool_id"]) + pool_member = self.ex_create_pool_member(pool=pool, node=node, port=member.port) + member.id = pool_member.id + return member + + def balancer_detach_member(self, balancer, member): + """ + Detach member from balancer + + :param balancer: LoadBalancer which should be used + :type balancer: :class:`LoadBalancer` + + :param member: Member which should be used + :type member: :class:`Member` + + :return: ``True`` if member detach was successful, otherwise ``False``. + :rtype: ``bool`` + """ + create_pool_m = ET.Element("removePoolMember", {"xmlns": TYPES_URN, "id": member.id}) + + result = self.connection.request_with_orgId_api_2( + "networkDomainVip/removePoolMember", + method="POST", + data=ET.tostring(create_pool_m), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def destroy_balancer(self, balancer): + """ + Destroy a load balancer (virtual listener) + + :param balancer: LoadBalancer which should be used + :type balancer: :class:`LoadBalancer` + + :return: ``True`` if the destroy was successful, otherwise ``False``. + :rtype: ``bool`` + """ + delete_listener = ET.Element( + "deleteVirtualListener", {"xmlns": TYPES_URN, "id": balancer.id} + ) + + result = self.connection.request_with_orgId_api_2( + "networkDomainVip/deleteVirtualListener", + method="POST", + data=ET.tostring(delete_listener), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_set_current_network_domain(self, network_domain_id): + """ + Set the network domain (part of the network) of the driver + + :param network_domain_id: ID of the pool (required) + :type network_domain_id: ``str`` + """ + self.network_domain_id = network_domain_id + + def ex_get_current_network_domain(self): + """ + Get the current network domain ID of the driver. + + :return: ID of the network domain + :rtype: ``str`` + """ + return self.network_domain_id + + def ex_create_pool_member(self, pool, node, port=None): + """ + Create a new member in an existing pool from an existing node + + :param pool: Instance of ``NttCisPool`` (required) + :type pool: ``NttCisPool`` + + :param node: Instance of ``NttCisVIPNode`` (required) + :type node: ``NttCisVIPNode`` + + :param port: Port the the service will listen on + :type port: ``str`` + + :return: The node member, instance of ``NttCisPoolMember`` + :rtype: ``NttCisPoolMember`` + """ + create_pool_m = ET.Element("addPoolMember", {"xmlns": TYPES_URN}) + ET.SubElement(create_pool_m, "poolId").text = pool.id + ET.SubElement(create_pool_m, "nodeId").text = node.id + if port is not None: + ET.SubElement(create_pool_m, "port").text = str(port) + ET.SubElement(create_pool_m, "status").text = "ENABLED" + response = self.connection.request_with_orgId_api_2( + "networkDomainVip/addPoolMember", + method="POST", + data=ET.tostring(create_pool_m), + ).object + + member_id = None + node_name = None + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "poolMemberId": + member_id = info.get("value") + if info.get("name") == "nodeName": + node_name = info.get("value") + + return NttCisPoolMember( + id=member_id, + name=node_name, + status=State.RUNNING, + ip=node.ip, + port=port, + node_id=node.id, + ) + + def ex_create_node( + self, + network_domain_id, + name, + ip, + ex_description=None, + connection_limit=25000, + connection_rate_limit=2000, + ): + """ + Create a new node + + :param network_domain_id: Network Domain ID (required) + :type name: ``str`` + + :param name: name of the node (required) + :type name: ``str`` + + :param ip: IPv4 address of the node (required) + :type ip: ``str`` + + :param ex_description: Description of the node (required) + :type ex_description: ``str`` + + :param connection_limit: Maximum number + of concurrent connections per sec + :type connection_limit: ``int`` + + :param connection_rate_limit: Maximum number of concurrent sessions + :type connection_rate_limit: ``int`` + + :return: Instance of ``NttCisVIPNode`` + :rtype: ``NttCisVIPNode`` + """ + create_node_elm = ET.Element("createNode", {"xmlns": TYPES_URN}) + ET.SubElement(create_node_elm, "networkDomainId").text = network_domain_id + ET.SubElement(create_node_elm, "name").text = name + if ex_description is not None: + ET.SubElement(create_node_elm, "description").text = str(ex_description) + ET.SubElement(create_node_elm, "ipv4Address").text = ip + ET.SubElement(create_node_elm, "status").text = "ENABLED" + ET.SubElement(create_node_elm, "connectionLimit").text = str(connection_limit) + ET.SubElement(create_node_elm, "connectionRateLimit").text = str(connection_rate_limit) + + response = self.connection.request_with_orgId_api_2( + action="networkDomainVip/createNode", + method="POST", + data=ET.tostring(create_node_elm), + ).object + + node_id = None + node_name = None + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "nodeId": + node_id = info.get("value") + if info.get("name") == "name": + node_name = info.get("value") + return NttCisVIPNode(id=node_id, name=node_name, status=State.RUNNING, ip=ip) + + def ex_update_node(self, node): + """ + Update the properties of a node + + :param pool: The instance of ``NttCisNode`` to update + :type pool: ``NttCisNode`` + + :return: The instance of ``NttCisNode`` + :rtype: ``NttCisNode`` + """ + create_node_elm = ET.Element("editNode", {"xmlns": TYPES_URN}) + create_node_elm.set("id", node.id) + ET.SubElement(create_node_elm, "healthMonitorId").text = node.health_monitor_id + ET.SubElement(create_node_elm, "connectionLimit").text = str(node.connection_limit) + ET.SubElement(create_node_elm, "connectionRateLimit").text = str(node.connection_rate_limit) + + self.connection.request_with_orgId_api_2( + action="networkDomainVip/editNode", + method="POST", + data=ET.tostring(create_node_elm), + ).object + return node + + def ex_set_node_state(self, node, enabled): + """ + Change the state of a node (enable/disable) + + :param pool: The instance of ``NttCisNode`` to update + :type pool: ``NttCisNode`` + + :param enabled: The target state of the node + :type enabled: ``bool`` + + :return: The instance of ``NttCisNode`` + :rtype: ``NttCisNode`` + """ + create_node_elm = ET.Element("editNode", {"xmlns": TYPES_URN}) + ET.SubElement(create_node_elm, "status").text = "ENABLED" if enabled is True else "DISABLED" + + self.connection.request_with_orgId_api_2( + action="networkDomainVip/editNode", + method="POST", + data=ET.tostring(create_node_elm), + ).object + return node + + def ex_create_pool( + self, + network_domain_id, + name, + balancer_method, + ex_description, + health_monitors=None, + service_down_action="NONE", + slow_ramp_time=30, + ): + """ + Create a new pool + + :param network_domain_id: Network Domain ID (required) + :type name: ``str`` + + :param name: name of the node (required) + :type name: ``str`` + + :param balancer_method: The load balancer algorithm (required) + :type balancer_method: ``str`` + + :param ex_description: Description of the node (required) + :type ex_description: ``str`` + + :param health_monitors: A list of health monitors to use for the pool. + :type health_monitors: ``list`` of + :class:`NttCisDefaultHealthMonitor` + + :param service_down_action: What to do when node + is unavailable NONE, DROP or RESELECT + :type service_down_action: ``str`` + + :param slow_ramp_time: Number of seconds to stagger ramp up of nodes + :type slow_ramp_time: ``int`` + + :return: Instance of ``NttCisPool`` + :rtype: ``NttCisPool`` + """ + # Names cannot contain spaces. + name.replace(" ", "_") + create_node_elm = ET.Element("createPool", {"xmlns": TYPES_URN}) + ET.SubElement(create_node_elm, "networkDomainId").text = network_domain_id + ET.SubElement(create_node_elm, "name").text = name + ET.SubElement(create_node_elm, "description").text = str(ex_description) + ET.SubElement(create_node_elm, "loadBalanceMethod").text = str(balancer_method) + + if health_monitors is not None: + for monitor in health_monitors: + ET.SubElement(create_node_elm, "healthMonitorId").text = str(monitor.id) + + ET.SubElement(create_node_elm, "serviceDownAction").text = service_down_action + ET.SubElement(create_node_elm, "slowRampTime").text = str(slow_ramp_time) + + response = self.connection.request_with_orgId_api_2( + action="networkDomainVip/createPool", + method="POST", + data=ET.tostring(create_node_elm), + ).object + + pool_id = None + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "poolId": + pool_id = info.get("value") + + return NttCisPool( + id=pool_id, + name=name, + description=ex_description, + status=State.RUNNING, + load_balance_method=str(balancer_method), + health_monitor_id=None, + service_down_action=service_down_action, + slow_ramp_time=str(slow_ramp_time), + ) + + def ex_create_virtual_listener( + self, + network_domain_id, + name, + ex_description, + port=None, + pool=None, + listener_ip_address=None, + persistence_profile=None, + fallback_persistence_profile=None, + irule=None, + protocol="TCP", + optimization_profile="TCP", + connection_limit=25000, + connection_rate_limit=2000, + source_port_preservation="PRESERVE", + ): + """ + Create a new virtual listener (load balancer) + + :param network_domain_id: Network Domain ID (required) + :type name: ``str`` + + :param name: name of the listener (required) + :type name: ``str`` + + :param ex_description: Description of the node (required) + :type ex_description: ``str`` + + :param port: An integer in the range of 1-65535. If not supplied, + it will be taken to mean 'Any Port' + :type port: ``int`` + + :param pool: The pool to use for the listener + :type pool: :class:`NttCisPool` + + :param listener_ip_address: The IPv4 Address of the virtual listener + :type listener_ip_address: ``str`` + + :param persistence_profile: Persistence profile + :type persistence_profile: :class:`NttCisPersistenceProfile` + + :param fallback_persistence_profile: Fallback persistence profile + :type fallback_persistence_profile: + :class:`NttCisPersistenceProfile` + + :param irule: The iRule to apply + :type irule: :class:`NttCisDefaultiRule` + + :param protocol: For STANDARD type, ANY, TCP or UDP + for PERFORMANCE_LAYER_4 choice of ANY, TCP, UDP, HTTP + :type protocol: ``str`` + + :param optimization_profile: For STANDARD type and protocol + TCP an optimization type of TCP, + LAN_OPT, WAN_OPT, MOBILE_OPT, + or TCP_LEGACY is required. + Default is 'TCP'. + :type protocol: ``str`` + + :param connection_limit: Maximum number + of concurrent connections per sec + :type connection_limit: ``int`` + + :param connection_rate_limit: Maximum number of concurrent sessions + :type connection_rate_limit: ``int`` + + :param source_port_preservation: Choice of PRESERVE, + PRESERVE_STRICT or CHANGE + :type source_port_preservation: ``str`` + + :return: Instance of the listener + :rtype: ``NttCisVirtualListener`` + """ + if (port == 80) or (port == 443): + listener_type = "PERFORMANCE_LAYER_4" + else: + listener_type = "STANDARD" + + if listener_type == "STANDARD" and optimization_profile is None: + raise ValueError( + " CONFIGURATION_NOT_SUPPORTED: optimizationProfile is" + " required for type STANDARD and protocol TCP" + ) + + create_node_elm = ET.Element("createVirtualListener", {"xmlns": TYPES_URN}) + ET.SubElement(create_node_elm, "networkDomainId").text = network_domain_id + ET.SubElement(create_node_elm, "name").text = name + ET.SubElement(create_node_elm, "description").text = str(ex_description) + ET.SubElement(create_node_elm, "type").text = listener_type + ET.SubElement(create_node_elm, "protocol").text = protocol + if listener_ip_address is not None: + ET.SubElement(create_node_elm, "listenerIpAddress").text = str(listener_ip_address) + if port is not None: + ET.SubElement(create_node_elm, "port").text = str(port) + ET.SubElement(create_node_elm, "enabled").text = "true" + ET.SubElement(create_node_elm, "connectionLimit").text = str(connection_limit) + ET.SubElement(create_node_elm, "connectionRateLimit").text = str(connection_rate_limit) + ET.SubElement(create_node_elm, "sourcePortPreservation").text = source_port_preservation + if pool is not None: + ET.SubElement(create_node_elm, "poolId").text = pool.id + if persistence_profile is not None: + ET.SubElement(create_node_elm, "persistenceProfileId").text = persistence_profile.id + if optimization_profile is not None: + ET.SubElement(create_node_elm, "optimizationProfile").text = optimization_profile + if fallback_persistence_profile is not None: + ET.SubElement(create_node_elm, "fallbackPersistenceProfileId").text = ( + fallback_persistence_profile.id + ) + if irule is not None: + ET.SubElement(create_node_elm, "iruleId").text = irule.id + + response = self.connection.request_with_orgId_api_2( + action="networkDomainVip/createVirtualListener", + method="POST", + data=ET.tostring(create_node_elm), + ).object + + virtual_listener_id = None + virtual_listener_ip = None + for info in findall(response, "info", TYPES_URN): + if info.get("name") == "virtualListenerId": + virtual_listener_id = info.get("value") + if info.get("name") == "listenerIpAddress": + virtual_listener_ip = info.get("value") + + return NttCisVirtualListener( + id=virtual_listener_id, + name=name, + ip=virtual_listener_ip, + status=State.RUNNING, + ) + + def ex_import_ssl_domain_certificate( + self, network_domain_id, name, crt_file, key_file, description=None + ): + """ + Import an ssl cert for ssl offloading onto the the load balancer + + :param network_domain_id: The Network Domain's Id. + :type network_domain_id: ``str`` + :param name: The name of the ssl certificate + :type name: ``str`` + :param crt_file: The complete path to the certificate file + :type crt_file: ``str`` + :param key_file: The complete pathy to the key file + :type key_file: ``str`` + :param description: (Optional) A description of the certificate + :type `description: `str`` + :return: ``bool`` + """ + try: + import OpenSSL + except ImportError: + raise ImportError( + 'Missing "OpenSSL" dependency. You can install ' + "it using pip - pip install pyopenssl" + ) + + with open(crt_file) as fp: + c = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, fp.read()) + + cert = OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_PEM, c).decode( + encoding="utf-8" + ) + + with open(key_file) as fp: + k = OpenSSL.crypto.load_privatekey(OpenSSL.crypto.FILETYPE_PEM, fp.read()) + + key = OpenSSL.crypto.dump_privatekey(OpenSSL.crypto.FILETYPE_PEM, k).decode( + encoding="utf-8" + ) + cert_elem = ET.Element("importSslDomainCertificate", {"xmlns": TYPES_URN}) + ET.SubElement(cert_elem, "networkDomainId").text = network_domain_id + ET.SubElement(cert_elem, "name").text = name + if description is not None: + ET.SubElement(cert_elem, "description").text = description + ET.SubElement(cert_elem, "key").text = key + ET.SubElement(cert_elem, "certificate").text = cert + result = self.connection.request_with_orgId_api_2( + "networkDomainVip/importSslDomainCertificate", + method="POST", + data=ET.tostring(cert_elem), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_delete_ssl_domain_certificate(self, dom_cert_id): + """ + Deletes an SSL domain certificate + + :param dom_cert_id: Id of certificate to delete + :type dom_cert_id: ``str`` + :return: ``bool`` + """ + del_dom_cert_elem = ET.Element( + "deleteSslDomainCertificate", {"id": dom_cert_id, "xmlns": TYPES_URN} + ) + result = self.connection.request_with_orgId_api_2( + "networkDomainVip/deleteSslDomainCertificate", + method="POST", + data=ET.tostring(del_dom_cert_elem), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_import_ssl_cert_chain(self, network_domain_id, name, chain_crt_file, description=None): + """ + Import an ssl certificate chain for ssl offloading onto + the the load balancer + + :param network_domain_id: The Network Domain's Id. + :type network_domain_id: ``str`` + :param name: The name of the ssl certificate chain + :type name: ``str`` + :param chain_crt_file: The complete path to the certificate chain file + :type chain_crt_file: ``str`` + :param description: (Optional) A description of the certificate chain + :type description: ``str`` + :return: ``bool`` + """ + try: + import OpenSSL + from OpenSSL import crypto + except ImportError: + raise ImportError( + 'Missing "OpenSSL" dependency. You can install ' + "it using pip - pip install pyopenssl" + ) + + c = crypto.load_certificate(crypto.FILETYPE_PEM, open(chain_crt_file).read()) + cert = OpenSSL.crypto.dump_certificate(crypto.FILETYPE_PEM, c).decode(encoding="utf-8") + cert_chain_elem = ET.Element("importSslCertificateChain", {"xmlns": TYPES_URN}) + ET.SubElement(cert_chain_elem, "networkDomainId").text = network_domain_id + ET.SubElement(cert_chain_elem, "name").text = name + if description is not None: + ET.SubElement(cert_chain_elem, "description").text = description + ET.SubElement(cert_chain_elem, "certificateChain").text = cert + result = self.connection.request_with_orgId_api_2( + "networkDomainVip/importSslCertificateChain", + method="POST", + data=ET.tostring(cert_chain_elem), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_delete_ssl_certificate_chain(self, cert_chain_id): + """ + Deletes a certificate chain + + :param cert_chain_id: Id of certificate chain to delete + :type cert_chain_id: ``str`` + :return ``bool`` + """ + del_cert_chain_elem = ET.Element( + "deleteSslCertificateChain", {"id": cert_chain_id, "xmlns": TYPES_URN} + ) + result = self.connection.request_with_orgId_api_2( + "networkDomainVip/deleteSslCertificateChain", + method="POST", + data=ET.tostring(del_cert_chain_elem), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_create_ssl_offload_profile( + self, + netowrk_domain_id, + name, + ssl_domain_cert_id, + description=None, + ciphers=None, + ssl_cert_chain_id=None, + ): + """ + Creates an SSL Offload profile + + :param network_domain_id: The network domain's Id + :type netowrk_domain_id: ``str`` + :param name: Offload profile's name + :type name: ``str`` + :param ssl_domain_cert_id: Certificate's Id + :type ssl_domain_cert_id: ``str`` + :param description: (Optional) Profile's description + :type description: ``str`` + :param ciphers: (Optional) The default cipher string is: + "MEDIUM:HIGH:!EXPORT:!ADH:!MD5:!RC4:!SSLv2:!SSLv3: + !ECDHE+AES-GCM:!ECDHE+AES:!ECDHE+3DES:!ECDHE_ECDSA: + !ECDH_RSA:!ECDH_ECDSA:@SPEED" It is possible to choose just a subset + of this string + :type ciphers: ``str`` + :param ssl_cert_chain_id: (Optional) Bind the certificate + chain to the profile. + :type ssl_cert_chain_id: `str`` + :returns: ``bool`` + """ + ssl_offload_elem = ET.Element("createSslOffloadProfile", {"xmlns": TYPES_URN}) + ET.SubElement(ssl_offload_elem, "networkDomainId").text = netowrk_domain_id + ET.SubElement(ssl_offload_elem, "name").text = name + if description is not None: + ET.SubElement(ssl_offload_elem, "description").text = description + if ciphers is not None: + ET.SubElement(ssl_offload_elem, "ciphers").text = ciphers + ET.SubElement(ssl_offload_elem, "sslDomainCertificateId").text = ssl_domain_cert_id + if ssl_cert_chain_id is not None: + ET.SubElement(ssl_offload_elem, "sslCertificateChainId").text = ssl_cert_chain_id + result = self.connection.request_with_orgId_api_2( + "networkDomainVip/createSslOffloadProfile", + method="POST", + data=ET.tostring(ssl_offload_elem), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_edit_ssl_offload_profile( + self, + profile_id, + name, + ssl_domain_cert_id, + description=None, + ciphers=None, + ssl_cert_chain_id=None, + ): + """ + The function edits the ssl offload profile + + :param profil_id: The id of the profile to be edited + :type profile_id: ``str`` + :param name: The name of the profile, new name or previous name + :type name: ``str`` + :param ssl_domain_cert_id: The certificate id to use, new or current + :type ssl_domain_cert_id: ``str`` + :param description: (Optional) Profile's description + :type description: ``str`` + :param ciphers: (Optional) String of acceptable ciphers to use + :type ciphers: ``str`` + :param ssl_cert_chain_id: If using a certificate chain + or changing to a new one + :type: ssl_cert_chain_id: ``str`` + :returns: ``bool`` + """ + ssl_offload_elem = ET.Element( + "editSslOffloadProfile", {"xmlns": TYPES_URN, "id": profile_id} + ) + ET.SubElement(ssl_offload_elem, "name").text = name + if description is not None: + ET.SubElement(ssl_offload_elem, "description").text = description + if ciphers is not None: + ET.SubElement(ssl_offload_elem, "ciphers").text = ciphers + ET.SubElement(ssl_offload_elem, "sslDomainCertificateId").text = ssl_domain_cert_id + if ssl_cert_chain_id is not None: + ET.SubElement(ssl_offload_elem, "sslCertificateChainId").text = ssl_cert_chain_id + result = self.connection.request_with_orgId_api_2( + "networkDomainVip/editSslOffloadProfile", + method="POST", + data=ET.tostring(ssl_offload_elem), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_delete_ssl_offload_profile(self, profile_id): + """ + Delete an offload profile + + :param profile_id: Id of profile to be deleted + :type profile_id: ``str`` + :returns: ``bool`` + """ + del_profile_elem = ET.Element( + "deleteSslOffloadProfile", {"id": profile_id, "xmlns": TYPES_URN} + ) + result = self.connection.request_with_orgId_api_2( + "networkDomainVip/deleteSslOffloadProfile", + method="POST", + data=ET.tostring(del_profile_elem), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_get_pools(self, ex_network_domain_id=None): + """ + Get all of the pools inside the current geography or + in given network. + + :param ex_network_domain_id: UUID of Network Domain + if not None returns only balancers in the given network + if None then returns all pools for the organization + :type ex_network_domain_id: ``str`` + + :return: Returns a ``list`` of type ``NttCisPool`` + :rtype: ``list`` of ``NttCisPool`` + """ + params = None + + if ex_network_domain_id is not None: + params = {"networkDomainId": ex_network_domain_id} + + pools = self.connection.request_with_orgId_api_2( + "networkDomainVip/pool", params=params + ).object + + return self._to_pools(pools) + + def ex_get_pool(self, pool_id): + """ + Get a specific pool inside the current geography + + :param pool_id: The identifier of the pool + :type pool_id: ``str`` + + :return: Returns an instance of ``NttCisPool`` + :rtype: ``NttCisPool`` + """ + pool = self.connection.request_with_orgId_api_2("networkDomainVip/pool/%s" % pool_id).object + return self._to_pool(pool) + + def ex_update_pool(self, pool): + """ + Update the properties of an existing pool + only method, serviceDownAction and slowRampTime are updated + + :param pool: The instance of ``NttCisPool`` to update + :type pool: ``NttCisPool`` + + :return: ``True`` for success, ``False`` for failure + :rtype: ``bool`` + """ + create_node_elm = ET.Element("editPool", {"xmlns": TYPES_URN}) + create_node_elm.set("id", pool.id) + ET.SubElement(create_node_elm, "loadBalanceMethod").text = str(pool.load_balance_method) + ET.SubElement(create_node_elm, "healthMonitorId").text = pool.health_monitor_id + ET.SubElement(create_node_elm, "serviceDownAction").text = pool.service_down_action + ET.SubElement(create_node_elm, "slowRampTime").text = str(pool.slow_ramp_time) + + response = self.connection.request_with_orgId_api_2( + action="networkDomainVip/editPool", + method="POST", + data=ET.tostring(create_node_elm), + ).object + response_code = findtext(response, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_destroy_pool(self, pool): + """ + Destroy an existing pool + + :param pool: The instance of ``NttCisPool`` to destroy + :type pool: ``NttCisPool`` + + :return: ``True`` for success, ``False`` for failure + :rtype: ``bool`` + """ + destroy_request = ET.Element("deletePool", {"xmlns": TYPES_URN, "id": pool.id}) + + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/deletePool", + method="POST", + data=ET.tostring(destroy_request), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_get_pool_members(self, pool_id): + """ + Get the members of a pool + + :param pool: The instance of a pool + :type pool: ``NttCisPool`` + + :returns: Returns an ``list`` of ``NttCisPoolMember`` + :rtype: ``list`` of ``NttCisPoolMember`` + """ + members = self.connection.request_with_orgId_api_2( + "networkDomainVip/poolMember?poolId=%s" % pool_id + ).object + return self._to_members(members) + + def ex_get_pool_member(self, pool_member_id): + """ + Get a specific member of a pool + + :param pool: The id of a pool member + :type pool: ``str`` + + :return: Returns an instance of ``NttCisPoolMember`` + :rtype: ``NttCisPoolMember`` + """ + member = self.connection.request_with_orgId_api_2( + "networkDomainVip/poolMember/%s" % pool_member_id + ).object + return self._to_member(member) + + def ex_set_pool_member_state(self, member, enabled=True): + request = ET.Element("editPoolMember", {"xmlns": TYPES_URN, "id": member.id}) + state = "ENABLED" if enabled is True else "DISABLED" + ET.SubElement(request, "status").text = state + + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/editPoolMember", + method="POST", + data=ET.tostring(request), + ).object + + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_destroy_pool_member(self, member, destroy_node=False): + """ + Destroy a specific member of a pool + + :param pool: The instance of a pool member + :type pool: ``NttCisPoolMember`` + + :param destroy_node: Also destroy the associated node + :type destroy_node: ``bool`` + + :return: ``True`` for success, ``False`` for failure + :rtype: ``bool`` + """ + # remove the pool member + destroy_request = ET.Element("removePoolMember", {"xmlns": TYPES_URN, "id": member.id}) + + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/removePoolMember", + method="POST", + data=ET.tostring(destroy_request), + ).object + + if member.node_id is not None and destroy_node is True: + return self.ex_destroy_node(member.node_id) + else: + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_get_nodes(self, ex_network_domain_id=None): + """ + Get the nodes within this geography or in given network. + + :param ex_network_domain_id: UUID of Network Domain + if not None returns only balancers in the given network + if None then returns all pools for the organization + :type ex_network_domain_id: ``str`` + + :return: Returns an ``list`` of ``NttCisVIPNode`` + :rtype: ``list`` of ``NttCisVIPNode`` + """ + params = None + if ex_network_domain_id is not None: + params = {"networkDomainId": ex_network_domain_id} + + nodes = self.connection.request_with_orgId_api_2( + "networkDomainVip/node", params=params + ).object + return self._to_nodes(nodes) + + def ex_get_node(self, node_id): + """ + Get the node specified by node_id + + :return: Returns an instance of ``NttCisVIPNode`` + :rtype: Instance of ``NttCisVIPNode`` + """ + nodes = self.connection.request_with_orgId_api_2( + "networkDomainVip/node/%s" % node_id + ).object + return self._to_node(nodes) + + def ex_destroy_node(self, node_id): + """ + Destroy a specific node + + :param node_id: The ID of of a ``NttCisVIPNode`` + :type node_id: ``str`` + + :return: ``True`` for success, ``False`` for failure + :rtype: ``bool`` + """ + # Destroy the node + destroy_request = ET.Element("deleteNode", {"xmlns": TYPES_URN, "id": node_id}) + + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/deleteNode", + method="POST", + data=ET.tostring(destroy_request), + ).object + response_code = findtext(result, "responseCode", TYPES_URN) + return response_code in ["IN_PROGRESS", "OK"] + + def ex_wait_for_state(self, state, func, poll_interval=2, timeout=60, *args, **kwargs): + """ + Wait for the function which returns a instance + with field status to match + + Keep polling func until one of the desired states is matched + + :param state: Either the desired state (`str`) or a `list` of states + :type state: ``str`` or ``list`` + + :param func: The function to call, e.g. ex_get_vlan + :type func: ``function`` + + :param poll_interval: The number of seconds to wait between checks + :type poll_interval: `int` + + :param timeout: The total number of seconds to wait to reach a state + :type timeout: `int` + + :param args: The arguments for func + :type args: Positional arguments + + :param kwargs: The arguments for func + :type kwargs: Keyword arguments + """ + return self.connection.wait_for_state(state, func, poll_interval, timeout, *args, **kwargs) + + def ex_get_default_health_monitors(self, network_domain): + """ + Get the default health monitors available for a network domain + + :param network_domain_id: The ID of of a ``NttCisNetworkDomain`` + :type network_domain_id: ``str`` + + :rtype: `list` of :class:`NttCisDefaultHealthMonitor` + """ + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/defaultHealthMonitor", + params={"networkDomainId": network_domain}, + method="GET", + ).object + return self._to_health_monitors(result) + + def ex_get_default_persistence_profiles(self, network_domain_id): + """ + Get the default persistence profiles available for a network domain + + :param network_domain_id: The ID of of a ``NttCisNetworkDomain`` + :type network_domain_id: ``str`` + + :rtype: `list` of :class:`NttCisPersistenceProfile` + """ + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/defaultPersistenceProfile", + params={"networkDomainId": network_domain_id}, + method="GET", + ).object + return self._to_persistence_profiles(result) + + def ex_get_default_irules(self, network_domain_id): + """ + Get the default iRules available for a network domain + + :param network_domain_id: The ID of of a ``NttCisNetworkDomain`` + :type network_domain_id: ``str`` + + :rtype: `list` of :class:`NttCisDefaultiRule` + """ + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/defaultIrule", + params={"networkDomainId": network_domain_id}, + method="GET", + ).object + return self._to_irules(result) + + @get_params + def ex_list_ssl_domain_certs(self, params={}): + """ + Functions takes a named parameter that can be one or none of the + following + + :param params: A sequence of comma separated keyword arguments + and a value + * id= + * network_domain_id= + * name= + * state= + * create_time= + * expiry_time= + :returns: `list` of :class: `NttCisDomaincertificate` + """ + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/sslDomainCertificate", params=params, method="GET" + ).object + return self._to_certs(result) + + def ex_get_ssl_domain_cert(self, cert_id): + """ + Function gets the cert by id. Use this if only if the id + is already known + + :param cert_id: The id of the specific cert + :type cert_id: ``str`` + :returns: :class: `NttCisdomaincertificate + """ + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/sslDomainCertificate/%s" % cert_id, method="GET" + ).object + return self._to_cert(result) + + @get_params + def ex_list_ssl_certificate_chains(self, params={}): + """ + Functions takes a named parameter that can be one or none of the + following to filter returned items + + :param params: A sequence of comma separated keyword arguments + and a value + * id= + * network_domain_id= + * name= + * state= + * create_time= + * expiry_time= + :return: `list` of :class: `NttCissslcertficiatechain` + """ + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/sslCertificateChain", params=params, method="GET" + ).object + return self._to_certificate_chains(result) + + def ex_get_ssl_certificate_chain(self, chain_id): + """ + Function gets the certificate chain by id. Use this if only if the id + is already known + :param cert_id: The id of the specific cert + :return: :class: `NttCiscertificatechain + """ + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/sslCertificateChain/%s" % chain_id, method="GET" + ).object + return self._to_certificate_chain(result) + + @get_params + def ex_list_ssl_offload_profiles(self, params={}): + """ + Functions takes a named parameter that can be one or none of the + following to filter returned items + + :param params: A sequence of comma separated keyword arguments + and a value + * id= + * network_domain_id= + * datacenter_id= + * name= + * state= + * ssl_domain_certificate_id= + * ssl_domain_certificate_name= + * ssl_certificate_chain_id= + * ssl_certificate_chain_name= + * create_time= + :return: `list` of :class: `NttCisSslssloffloadprofile` + """ + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/sslOffloadProfile", params=params, method="GET" + ).object + return self._to_ssl_profiles(result) + + def ex_get_ssl_offload_profile(self, profile_id): + result = self.connection.request_with_orgId_api_2( + action="networkDomainVip/sslOffloadProfile/%s" % profile_id, method="GET" + ).object + return self._to_ssl_profile(result) + + def _to_irules(self, object): + irules = [] + matches = object.findall(fixxpath("defaultIrule", TYPES_URN)) + for element in matches: + irules.append(self._to_irule(element)) + return irules + + def _to_irule(self, element): + compatible = [] + matches = element.findall(fixxpath("virtualListenerCompatibility", TYPES_URN)) + for match_element in matches: + compatible.append( + NttCisVirtualListenerCompatibility( + type=match_element.get("type"), + protocol=match_element.get("protocol", None), + ) + ) + irule_element = element.find(fixxpath("irule", TYPES_URN)) + return NttCisDefaultiRule( + id=irule_element.get("id"), + name=irule_element.get("name"), + compatible_listeners=compatible, + ) + + def _to_persistence_profiles(self, object): + profiles = [] + matches = object.findall(fixxpath("defaultPersistenceProfile", TYPES_URN)) + for element in matches: + profiles.append(self._to_persistence_profile(element)) + return profiles + + def _to_persistence_profile(self, element): + compatible = [] + matches = element.findall(fixxpath("virtualListenerCompatibility", TYPES_URN)) + for match_element in matches: + compatible.append( + NttCisVirtualListenerCompatibility( + type=match_element.get("type"), + protocol=match_element.get("protocol", None), + ) + ) + + return NttCisPersistenceProfile( + id=element.get("id"), + fallback_compatible=bool(element.get("fallbackCompatible") == "true"), + name=findtext(element, "name", TYPES_URN), + compatible_listeners=compatible, + ) + + def _to_health_monitors(self, object): + monitors = [] + matches = object.findall(fixxpath("defaultHealthMonitor", TYPES_URN)) + for element in matches: + monitors.append(self._to_health_monitor(element)) + return monitors + + def _to_health_monitor(self, element): + return NttCisDefaultHealthMonitor( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + node_compatible=bool(findtext(element, "nodeCompatible", TYPES_URN) == "true"), + pool_compatible=bool(findtext(element, "poolCompatible", TYPES_URN) == "true"), + ) + + def _to_nodes(self, object): + nodes = [] + for element in object.findall(fixxpath("node", TYPES_URN)): + nodes.append(self._to_node(element)) + + return nodes + + def _to_node(self, element): + ipaddress = findtext(element, "ipv4Address", TYPES_URN) + if ipaddress is None: + ipaddress = findtext(element, "ipv6Address", TYPES_URN) + + name = findtext(element, "name", TYPES_URN) + + try: + hm = element.find(fixxpath("healthMonitor", TYPES_URN)).get("id") + except AttributeError: + hm = None + + node = NttCisVIPNode( + id=element.get("id"), + name=name, + status=self._VALUE_TO_STATE_MAP.get( + findtext(element, "state", TYPES_URN), State.UNKNOWN + ), + health_monitor=hm, + connection_rate_limit=findtext(element, "connectionRateLimit", TYPES_URN), + connection_limit=findtext(element, "connectionLimit", TYPES_URN), + ip=ipaddress, + ) + + return node + + def _to_balancers(self, object): + loadbalancers = [] + for element in object.findall(fixxpath("virtualListener", TYPES_URN)): + loadbalancers.append(self._to_balancer(element)) + + return loadbalancers + + def _to_balancer(self, element): + ipaddress = findtext(element, "listenerIpAddress", TYPES_URN) + name = findtext(element, "name", TYPES_URN) + port = findtext(element, "port", TYPES_URN) + extra = {} + + pool_element = element.find(fixxpath("pool", TYPES_URN)) + if pool_element is None: + extra["pool_id"] = None + + else: + extra["pool_id"] = pool_element.get("id") + + extra["network_domain_id"] = findtext(element, "networkDomainId", TYPES_URN) + + balancer = LoadBalancer( + id=element.get("id"), + name=name, + state=self._VALUE_TO_STATE_MAP.get( + findtext(element, "state", TYPES_URN), State.UNKNOWN + ), + ip=ipaddress, + port=port, + driver=self.connection.driver, + extra=extra, + ) + + return balancer + + def _to_members(self, object): + members = [] + for element in object.findall(fixxpath("poolMember", TYPES_URN)): + members.append(self._to_member(element)) + + return members + + def _to_member(self, element): + port = findtext(element, "port", TYPES_URN) + if port is not None: + port = int(port) + pool_member = NttCisPoolMember( + id=element.get("id"), + name=element.find(fixxpath("node", TYPES_URN)).get("name"), + status=findtext(element, "state", TYPES_URN), + node_id=element.find(fixxpath("node", TYPES_URN)).get("id"), + ip=element.find(fixxpath("node", TYPES_URN)).get("ipAddress"), + port=port, + ) + return pool_member + + def _to_pools(self, object): + pools = [] + for element in object.findall(fixxpath("pool", TYPES_URN)): + pools.append(self._to_pool(element)) + + return pools + + def _to_pool(self, element): + pool = NttCisPool( + id=element.get("id"), + name=findtext(element, "name", TYPES_URN), + status=findtext(element, "state", TYPES_URN), + description=findtext(element, "description", TYPES_URN), + load_balance_method=findtext(element, "loadBalanceMethod", TYPES_URN), + health_monitor_id=findtext(element, "healthMonitorId", TYPES_URN), + service_down_action=findtext(element, "serviceDownAction", TYPES_URN), + slow_ramp_time=findtext(element, "slowRampTime", TYPES_URN), + ) + return pool + + def _to_certs(self, object): + certs = [] + for element in object.findall(fixxpath("sslDomainCertificate", TYPES_URN)): + certs.append(self._to_cert(element)) + return certs + + def _to_cert(self, el): + return process_xml(ET.tostring(el)) + + def _to_certificate_chains(self, object): + cert_chains = [] + for element in object.findall(fixxpath("sslCertificateChain", TYPES_URN)): + cert_chains.append(self._to_certificate_chain(element)) + return cert_chains + + def _to_certificate_chain(self, el): + return process_xml(ET.tostring(el)) + + def _to_ssl_profiles(self, object): + profiles = [] + for element in object.findall(fixxpath("sslOffloadProfile", TYPES_URN)): + profiles.append(self._to_ssl_profile(element)) + return profiles + + def _to_ssl_profile(self, el): + return process_xml(ET.tostring(el)) diff --git a/libcloud/loadbalancer/drivers/rackspace.py b/libcloud/loadbalancer/drivers/rackspace.py index bf2a13c617..fd5094a90f 100644 --- a/libcloud/loadbalancer/drivers/rackspace.py +++ b/libcloud/loadbalancer/drivers/rackspace.py @@ -15,42 +15,53 @@ from datetime import datetime -try: - import simplejson as json -except ImportError: - import json - from libcloud.utils.py3 import httplib from libcloud.utils.misc import reverse_dict -from libcloud.loadbalancer.base import LoadBalancer, Member, Driver, Algorithm -from libcloud.loadbalancer.base import DEFAULT_ALGORITHM -from libcloud.compute.drivers.rackspace import RackspaceConnection -from libcloud.common.types import LibcloudError from libcloud.common.base import JsonResponse, PollingConnection -from libcloud.loadbalancer.types import State, MemberCondition +from libcloud.common.types import LibcloudError from libcloud.common.openstack import OpenStackDriverMixin from libcloud.common.rackspace import AUTH_URL +from libcloud.loadbalancer.base import DEFAULT_ALGORITHM, Driver, Member, Algorithm, LoadBalancer +from libcloud.loadbalancer.types import State, MemberCondition +from libcloud.compute.drivers.rackspace import RackspaceConnection + +try: + import simplejson as json +except ImportError: + import json -ENDPOINT_ARGS_MAP = { - 'dfw': {'service_type': 'rax:load-balancer', - 'name': 'cloudLoadBalancers', - 'region': 'DFW'}, - 'ord': {'service_type': 'rax:load-balancer', - 'name': 'cloudLoadBalancers', - 'region': 'ORD'}, - 'iad': {'service_type': 'rax:load-balancer', - 'name': 'cloudLoadBalancers', - 'region': 'IAD'}, - 'lon': {'service_type': 'rax:load-balancer', - 'name': 'cloudLoadBalancers', - 'region': 'LON'}, - 'syd': {'service_type': 'rax:load-balancer', - 'name': 'cloudLoadBalancers', - 'region': 'SYD'}, - 'hkg': {'service_type': 'rax:load-balancer', - 'name': 'cloudLoadBalancers', - 'region': 'HKG'}, +ENDPOINT_ARGS_MAP = { + "dfw": { + "service_type": "rax:load-balancer", + "name": "cloudLoadBalancers", + "region": "DFW", + }, + "ord": { + "service_type": "rax:load-balancer", + "name": "cloudLoadBalancers", + "region": "ORD", + }, + "iad": { + "service_type": "rax:load-balancer", + "name": "cloudLoadBalancers", + "region": "IAD", + }, + "lon": { + "service_type": "rax:load-balancer", + "name": "cloudLoadBalancers", + "region": "LON", + }, + "syd": { + "service_type": "rax:load-balancer", + "name": "cloudLoadBalancers", + "region": "SYD", + }, + "hkg": { + "service_type": "rax:load-balancer", + "name": "cloudLoadBalancers", + "region": "HKG", + }, } @@ -58,13 +69,13 @@ class RackspaceResponse(JsonResponse): def parse_body(self): if not self.body: return None - return super(RackspaceResponse, self).parse_body() + return super().parse_body() def success(self): return 200 <= int(self.status) <= 299 -class RackspaceHealthMonitor(object): +class RackspaceHealthMonitor: """ :param type: type of load balancer. currently CONNECT (connection monitoring), HTTP, HTTPS (connection and HTTP @@ -94,17 +105,18 @@ def __init__(self, type, delay, timeout, attempts_before_deactivation): self.attempts_before_deactivation = attempts_before_deactivation def __repr__(self): - return ('' % - (self.type, self.delay, self.timeout, - self.attempts_before_deactivation)) + return ( + "" + % (self.type, self.delay, self.timeout, self.attempts_before_deactivation) + ) def _to_dict(self): return { - 'type': self.type, - 'delay': self.delay, - 'timeout': self.timeout, - 'attemptsBeforeDeactivation': self.attempts_before_deactivation + "type": self.type, + "delay": self.delay, + "timeout": self.timeout, + "attemptsBeforeDeactivation": self.attempts_before_deactivation, } @@ -124,34 +136,49 @@ class RackspaceHTTPHealthMonitor(RackspaceHealthMonitor): :type status_regex: ``str`` """ - def __init__(self, type, delay, timeout, attempts_before_deactivation, - path, body_regex, status_regex): - super(RackspaceHTTPHealthMonitor, self).__init__( - type, delay, timeout, attempts_before_deactivation) + def __init__( + self, + type, + delay, + timeout, + attempts_before_deactivation, + path, + body_regex, + status_regex, + ): + super().__init__(type, delay, timeout, attempts_before_deactivation) self.path = path self.body_regex = body_regex self.status_regex = status_regex def __repr__(self): - return ('' % - (self.type, self.delay, self.timeout, - self.attempts_before_deactivation, self.path, self.body_regex, - self.status_regex)) + return ( + "" + % ( + self.type, + self.delay, + self.timeout, + self.attempts_before_deactivation, + self.path, + self.body_regex, + self.status_regex, + ) + ) def _to_dict(self): - super_dict = super(RackspaceHTTPHealthMonitor, self)._to_dict() - super_dict['path'] = self.path - super_dict['statusRegex'] = self.status_regex + super_dict = super()._to_dict() + super_dict["path"] = self.path + super_dict["statusRegex"] = self.status_regex if self.body_regex: - super_dict['bodyRegex'] = self.body_regex + super_dict["bodyRegex"] = self.body_regex return super_dict -class RackspaceConnectionThrottle(object): +class RackspaceConnectionThrottle: """ :param min_connections: Minimum number of connections per IP address before applying throttling. @@ -175,40 +202,48 @@ class RackspaceConnectionThrottle(object): :type rate_interval_seconds: ``int`` """ - def __init__(self, min_connections, max_connections, - max_connection_rate, rate_interval_seconds): + def __init__( + self, + min_connections, + max_connections, + max_connection_rate, + rate_interval_seconds, + ): self.min_connections = min_connections self.max_connections = max_connections self.max_connection_rate = max_connection_rate self.rate_interval_seconds = rate_interval_seconds def __repr__(self): - return ('' % - (self.min_connections, self.max_connections, - self.max_connection_rate, self.rate_interval_seconds)) + return ( + "" + % ( + self.min_connections, + self.max_connections, + self.max_connection_rate, + self.rate_interval_seconds, + ) + ) def _to_dict(self): return { - 'maxConnections': self.max_connections, - 'minConnections': self.min_connections, - 'maxConnectionRate': self.max_connection_rate, - 'rateInterval': self.rate_interval_seconds + "maxConnections": self.max_connections, + "minConnections": self.min_connections, + "maxConnectionRate": self.max_connection_rate, + "rateInterval": self.rate_interval_seconds, } -class RackspaceAccessRuleType(object): +class RackspaceAccessRuleType: ALLOW = 0 DENY = 1 - _RULE_TYPE_STRING_MAP = { - ALLOW: 'ALLOW', - DENY: 'DENY' - } + _RULE_TYPE_STRING_MAP = {ALLOW: "ALLOW", DENY: "DENY"} -class RackspaceAccessRule(object): +class RackspaceAccessRule: """ An access rule allows or denies traffic to a Load Balancer based on the incoming IPs. @@ -230,16 +265,12 @@ def __init__(self, id=None, rule_type=None, address=None): self.address = address def _to_dict(self): - type_string =\ - RackspaceAccessRuleType._RULE_TYPE_STRING_MAP[self.rule_type] + type_string = RackspaceAccessRuleType._RULE_TYPE_STRING_MAP[self.rule_type] - as_dict = { - 'type': type_string, - 'address': self.address - } + as_dict = {"type": type_string, "address": self.address} if self.id is not None: - as_dict['id'] = self.id + as_dict["id"] = self.id return as_dict @@ -251,31 +282,28 @@ class RackspaceConnection(RackspaceConnection, PollingConnection): timeout = 80 cache_busting = True - def request(self, action, params=None, data='', headers=None, - method='GET'): + def request(self, action, params=None, data="", headers=None, method="GET"): if not headers: headers = {} if not params: params = {} - if method in ('POST', 'PUT'): - headers['Content-Type'] = 'application/json' + if method in ("POST", "PUT"): + headers["Content-Type"] = "application/json" - return super(RackspaceConnection, self).request( - action=action, params=params, - data=data, method=method, headers=headers) + return super().request( + action=action, params=params, data=data, method=method, headers=headers + ) def get_poll_request_kwargs(self, response, context, request_kwargs): - return {'action': request_kwargs['action'], - 'method': 'GET'} + return {"action": request_kwargs["action"], "method": "GET"} def has_completed(self, response): - state = response.object['loadBalancer']['status'] - if state == 'ERROR': - raise LibcloudError("Load balancer entered an ERROR state.", - driver=self.driver) + state = response.object["loadBalancer"]["status"] + if state == "ERROR": + raise LibcloudError("Load balancer entered an ERROR state.", driver=self.driver) - return state == 'ACTIVE' + return state == "ACTIVE" def encode_data(self, data): return data @@ -283,57 +311,66 @@ def encode_data(self, data): class RackspaceLBDriver(Driver, OpenStackDriverMixin): connectionCls = RackspaceConnection - api_name = 'rackspace_lb' - name = 'Rackspace LB' - website = 'http://www.rackspace.com/' + api_name = "rackspace_lb" + name = "Rackspace LB" + website = "http://www.rackspace.com/" LB_STATE_MAP = { - 'ACTIVE': State.RUNNING, - 'BUILD': State.PENDING, - 'ERROR': State.ERROR, - 'DELETED': State.DELETED, - 'PENDING_UPDATE': State.PENDING, - 'PENDING_DELETE': State.PENDING + "ACTIVE": State.RUNNING, + "BUILD": State.PENDING, + "ERROR": State.ERROR, + "DELETED": State.DELETED, + "PENDING_UPDATE": State.PENDING, + "PENDING_DELETE": State.PENDING, } LB_MEMBER_CONDITION_MAP = { - 'ENABLED': MemberCondition.ENABLED, - 'DISABLED': MemberCondition.DISABLED, - 'DRAINING': MemberCondition.DRAINING + "ENABLED": MemberCondition.ENABLED, + "DISABLED": MemberCondition.DISABLED, + "DRAINING": MemberCondition.DRAINING, } CONDITION_LB_MEMBER_MAP = reverse_dict(LB_MEMBER_CONDITION_MAP) _VALUE_TO_ALGORITHM_MAP = { - 'RANDOM': Algorithm.RANDOM, - 'ROUND_ROBIN': Algorithm.ROUND_ROBIN, - 'LEAST_CONNECTIONS': Algorithm.LEAST_CONNECTIONS, - 'WEIGHTED_ROUND_ROBIN': Algorithm.WEIGHTED_ROUND_ROBIN, - 'WEIGHTED_LEAST_CONNECTIONS': Algorithm.WEIGHTED_LEAST_CONNECTIONS + "RANDOM": Algorithm.RANDOM, + "ROUND_ROBIN": Algorithm.ROUND_ROBIN, + "LEAST_CONNECTIONS": Algorithm.LEAST_CONNECTIONS, + "WEIGHTED_ROUND_ROBIN": Algorithm.WEIGHTED_ROUND_ROBIN, + "WEIGHTED_LEAST_CONNECTIONS": Algorithm.WEIGHTED_LEAST_CONNECTIONS, } _ALGORITHM_TO_VALUE_MAP = reverse_dict(_VALUE_TO_ALGORITHM_MAP) - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region='ord', **kwargs): - ex_force_region = kwargs.pop('ex_force_region', None) + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + region="ord", + **kwargs, + ): + ex_force_region = kwargs.pop("ex_force_region", None) if ex_force_region: # For backward compatibility region = ex_force_region OpenStackDriverMixin.__init__(self, **kwargs) - super(RackspaceLBDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, region=region) + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port, region=region) + + @classmethod + def list_regions(cls): + return ENDPOINT_ARGS_MAP.keys() def _ex_connection_class_kwargs(self): endpoint_args = ENDPOINT_ARGS_MAP[self.region] kwargs = self.openstack_connection_kwargs() - kwargs['get_endpoint_args'] = endpoint_args + kwargs["get_endpoint_args"] = endpoint_args return kwargs def list_protocols(self): - return self._to_protocols( - self.connection.request('/loadbalancers/protocols').object) + return self._to_protocols(self.connection.request("/loadbalancers/protocols").object) def ex_list_protocols_with_default_ports(self): """ @@ -343,9 +380,16 @@ def ex_list_protocols_with_default_ports(self): :return: A list of protocols with default ports included. """ return self._to_protocols_with_default_ports( - self.connection.request('/loadbalancers/protocols').object) + self.connection.request("/loadbalancers/protocols").object + ) - def list_balancers(self, ex_member_address=None): + def list_balancers( + self, + ex_member_address=None, + ex_status=None, + ex_changes_since=None, + ex_params={}, + ): """ @inherits: :class:`Driver.list_balancers` @@ -353,22 +397,47 @@ def list_balancers(self, ex_member_address=None): If provided, only the load balancers which have this member attached will be returned. :type ex_member_address: ``str`` + + :param ex_status: Optional. Filter balancers by status + :type ex_status: ``str`` + + :param ex_changes_since: Optional. List all load balancers that have + changed since the specified date/time + :type ex_changes_since: ``str`` + + :param ex_params: Optional. Set parameters to be submitted to the API + in the query string + :type ex_params: ``dict`` """ + params = {} if ex_member_address: - params['nodeaddress'] = ex_member_address + params["nodeaddress"] = ex_member_address + + if ex_status: + params["status"] = ex_status + + if ex_changes_since: + params["changes-since"] = ex_changes_since + + for key, value in ex_params.items(): + params[key] = value - return self._to_balancers( - self.connection.request('/loadbalancers', params=params).object) + return self._to_balancers(self.connection.request("/loadbalancers", params=params).object) - def create_balancer(self, name, members, protocol='http', - port=80, algorithm=DEFAULT_ALGORITHM): - return self.ex_create_balancer(name, members, protocol, port, - algorithm) + def create_balancer(self, name, members, protocol="http", port=80, algorithm=DEFAULT_ALGORITHM): + return self.ex_create_balancer(name, members, protocol, port, algorithm) - def ex_create_balancer(self, name, members, protocol='http', - port=80, algorithm=DEFAULT_ALGORITHM, vip='PUBLIC'): + def ex_create_balancer( + self, + name, + members, + protocol="http", + port=80, + algorithm=DEFAULT_ALGORITHM, + vip="PUBLIC", + ): """ Creates a new load balancer instance @@ -395,41 +464,33 @@ def ex_create_balancer(self, name, members, protocol='http', :rtype: :class:`LoadBalancer` """ balancer_attrs = self._kwargs_to_mutable_attrs( - name=name, - protocol=protocol, - port=port, - algorithm=algorithm, - vip=vip) + name=name, protocol=protocol, port=port, algorithm=algorithm, vip=vip + ) - balancer_attrs.update({ - 'nodes': [self._member_attributes(member) for member in members], - }) + balancer_attrs.update({"nodes": [self._member_attributes(member) for member in members]}) # balancer_attrs['nodes'] = ['fu'] balancer_object = {"loadBalancer": balancer_attrs} - resp = self.connection.request('/loadbalancers', - method='POST', - data=json.dumps(balancer_object)) - return self._to_balancer(resp.object['loadBalancer']) + resp = self.connection.request( + "/loadbalancers", method="POST", data=json.dumps(balancer_object) + ) + return self._to_balancer(resp.object["loadBalancer"]) def _member_attributes(self, member): - member_attributes = {'address': member.ip, - 'port': member.port} + member_attributes = {"address": member.ip, "port": member.port} - member_attributes.update(self._kwargs_to_mutable_member_attrs( - **member.extra)) + member_attributes.update(self._kwargs_to_mutable_member_attrs(**member.extra)) # If the condition is not specified on the member, then it should be # set to ENABLED by default - if 'condition' not in member_attributes: - member_attributes['condition'] =\ - self.CONDITION_LB_MEMBER_MAP[MemberCondition.ENABLED] + if "condition" not in member_attributes: + member_attributes["condition"] = self.CONDITION_LB_MEMBER_MAP[MemberCondition.ENABLED] return member_attributes def destroy_balancer(self, balancer): - uri = '/loadbalancers/%s' % (balancer.id) - resp = self.connection.request(uri, method='DELETE') + uri = "/loadbalancers/%s" % (balancer.id) + resp = self.connection.request(uri, method="DELETE") return resp.status == httplib.ACCEPTED @@ -443,15 +504,13 @@ def ex_destroy_balancers(self, balancers): :return: Returns whether the destroy request was accepted. :rtype: ``bool`` """ - ids = [('id', balancer.id) for balancer in balancers] - resp = self.connection.request('/loadbalancers', - method='DELETE', - params=ids) + ids = [("id", balancer.id) for balancer in balancers] + resp = self.connection.request("/loadbalancers", method="DELETE", params=ids) return resp.status == httplib.ACCEPTED def get_balancer(self, balancer_id): - uri = '/loadbalancers/%s' % (balancer_id) + uri = "/loadbalancers/%s" % (balancer_id) resp = self.connection.request(uri) return self._to_balancer(resp.object["loadBalancer"]) @@ -459,9 +518,8 @@ def get_balancer(self, balancer_id): def balancer_attach_member(self, balancer, member): member_object = {"nodes": [self._member_attributes(member)]} - uri = '/loadbalancers/%s/nodes' % (balancer.id) - resp = self.connection.request(uri, method='POST', - data=json.dumps(member_object)) + uri = "/loadbalancers/%s/nodes" % (balancer.id) + resp = self.connection.request(uri, method="POST", data=json.dumps(member_object)) return self._to_members(resp.object, balancer)[0] def ex_balancer_attach_members(self, balancer, members): @@ -476,20 +534,18 @@ def ex_balancer_attach_members(self, balancer, members): :rtype: ``list`` of :class:`Member` """ - member_objects = {"nodes": [self._member_attributes(member) for member - in members]} + member_objects = {"nodes": [self._member_attributes(member) for member in members]} - uri = '/loadbalancers/%s/nodes' % (balancer.id) - resp = self.connection.request(uri, method='POST', - data=json.dumps(member_objects)) + uri = "/loadbalancers/%s/nodes" % (balancer.id) + resp = self.connection.request(uri, method="POST", data=json.dumps(member_objects)) return self._to_members(resp.object, balancer) def balancer_detach_member(self, balancer, member): # Loadbalancer always needs to have at least 1 member. # Last member cannot be detached. You can only disable it or destroy # the balancer. - uri = '/loadbalancers/%s/nodes/%s' % (balancer.id, member.id) - resp = self.connection.request(uri, method='DELETE') + uri = "/loadbalancers/{}/nodes/{}".format(balancer.id, member.id) + resp = self.connection.request(uri, method="DELETE") return resp.status == httplib.ACCEPTED @@ -511,7 +567,7 @@ def ex_balancer_detach_members(self, balancer, members): accepted = self.ex_balancer_detach_members_no_poll(balancer, members) if not accepted: - msg = 'Detach members request was not accepted' + msg = "Detach members request was not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) @@ -530,23 +586,24 @@ def ex_balancer_detach_members_no_poll(self, balancer, members): :return: Returns whether the detach request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/nodes' % (balancer.id) - ids = [('id', member.id) for member in members] - resp = self.connection.request(uri, method='DELETE', params=ids) + uri = "/loadbalancers/%s/nodes" % (balancer.id) + ids = [("id", member.id) for member in members] + resp = self.connection.request(uri, method="DELETE", params=ids) return resp.status == httplib.ACCEPTED def balancer_list_members(self, balancer): - uri = '/loadbalancers/%s/nodes' % (balancer.id) + uri = "/loadbalancers/%s/nodes" % (balancer.id) data = self.connection.request(uri).object return self._to_members(data, balancer) def update_balancer(self, balancer, **kwargs): attrs = self._kwargs_to_mutable_attrs(**kwargs) resp = self.connection.async_request( - action='/loadbalancers/%s' % balancer.id, - method='PUT', - data=json.dumps(attrs)) + action="/loadbalancers/%s" % balancer.id, + method="PUT", + data=json.dumps(attrs), + ) return self._to_balancer(resp.object["loadBalancer"]) def ex_update_balancer_no_poll(self, balancer, **kwargs): @@ -557,9 +614,10 @@ def ex_update_balancer_no_poll(self, balancer, **kwargs): """ attrs = self._kwargs_to_mutable_attrs(**kwargs) resp = self.connection.request( - action='/loadbalancers/%s' % balancer.id, - method='PUT', - data=json.dumps(attrs)) + action="/loadbalancers/%s" % balancer.id, + method="PUT", + data=json.dumps(attrs), + ) return resp.status == httplib.ACCEPTED def ex_balancer_update_member(self, balancer, member, **kwargs): @@ -585,20 +643,19 @@ def ex_balancer_update_member(self, balancer, member, **kwargs): :return: Updated Member. :rtype: :class:`Member` """ - accepted = self.ex_balancer_update_member_no_poll( - balancer, member, **kwargs) + accepted = self.ex_balancer_update_member_no_poll(balancer, member, **kwargs) if not accepted: - msg = 'Update member attributes was not accepted' + msg = "Update member attributes was not accepted" raise LibcloudError(msg, driver=self) balancer = self._get_updated_balancer(balancer) - members = balancer.extra['members'] + members = balancer.extra["members"] updated_members = [m for m in members if m.id == member.id] if not updated_members: - raise LibcloudError('Could not find updated member') + raise LibcloudError("Could not find updated member") return updated_members[0] @@ -624,9 +681,9 @@ def ex_balancer_update_member_no_poll(self, balancer, member, **kwargs): :rtype: ``bool`` """ resp = self.connection.request( - action='/loadbalancers/%s/nodes/%s' % (balancer.id, member.id), - method='PUT', - data=json.dumps(self._kwargs_to_mutable_member_attrs(**kwargs)) + action="/loadbalancers/{}/nodes/{}".format(balancer.id, member.id), + method="PUT", + data=json.dumps(self._kwargs_to_mutable_member_attrs(**kwargs)), ) return resp.status == httplib.ACCEPTED @@ -638,7 +695,7 @@ def ex_list_algorithm_names(self): :rtype: ``list`` of ``str`` """ - response = self.connection.request('/loadbalancers/algorithms') + response = self.connection.request("/loadbalancers/algorithms") return [a["name"].upper() for a in response.object["algorithms"]] def ex_get_balancer_error_page(self, balancer): @@ -650,7 +707,7 @@ def ex_get_balancer_error_page(self, balancer): :rtype: ``str`` """ - uri = '/loadbalancers/%s/errorpage' % (balancer.id) + uri = "/loadbalancers/%s/errorpage" % (balancer.id) resp = self.connection.request(uri) return resp.object["errorpage"]["content"] @@ -664,7 +721,7 @@ def ex_balancer_access_list(self, balancer): :rtype: ``list`` of :class:`RackspaceAccessRule` """ - uri = '/loadbalancers/%s/accesslist' % (balancer.id) + uri = "/loadbalancers/%s/accesslist" % (balancer.id) resp = self.connection.request(uri) return [self._to_access_rule(el) for el in resp.object["accessList"]] @@ -676,11 +733,9 @@ def _get_updated_balancer(self, balancer): back in 'ACTIVE' status and then return the individual balancer details call. """ - resp = self.connection.async_request( - action='/loadbalancers/%s' % balancer.id, - method='GET') + resp = self.connection.async_request(action="/loadbalancers/%s" % balancer.id, method="GET") - return self._to_balancer(resp.object['loadBalancer']) + return self._to_balancer(resp.object["loadBalancer"]) def ex_update_balancer_health_monitor(self, balancer, health_monitor): """ @@ -697,16 +752,14 @@ def ex_update_balancer_health_monitor(self, balancer, health_monitor): :return: Updated Balancer. :rtype: :class:`LoadBalancer` """ - accepted = self.ex_update_balancer_health_monitor_no_poll( - balancer, health_monitor) + accepted = self.ex_update_balancer_health_monitor_no_poll(balancer, health_monitor) if not accepted: - msg = 'Update health monitor request not accepted' + msg = "Update health monitor request not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) - def ex_update_balancer_health_monitor_no_poll(self, balancer, - health_monitor): + def ex_update_balancer_health_monitor_no_poll(self, balancer, health_monitor): """ Sets a Balancer's health monitor. This method returns immediately. @@ -719,10 +772,11 @@ def ex_update_balancer_health_monitor_no_poll(self, balancer, :return: Returns whether the update request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/healthmonitor' % (balancer.id) + uri = "/loadbalancers/%s/healthmonitor" % (balancer.id) resp = self.connection.request( - uri, method='PUT', data=json.dumps(health_monitor._to_dict())) + uri, method="PUT", data=json.dumps(health_monitor._to_dict()) + ) return resp.status == httplib.ACCEPTED @@ -739,7 +793,7 @@ def ex_disable_balancer_health_monitor(self, balancer): :rtype: :class:`LoadBalancer` """ if not self.ex_disable_balancer_health_monitor_no_poll(balancer): - msg = 'Disable health monitor request not accepted' + msg = "Disable health monitor request not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) @@ -755,15 +809,13 @@ def ex_disable_balancer_health_monitor_no_poll(self, balancer): :return: Returns whether the disable request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/healthmonitor' % (balancer.id) + uri = "/loadbalancers/%s/healthmonitor" % (balancer.id) - resp = self.connection.request(uri, - method='DELETE') + resp = self.connection.request(uri, method="DELETE") return resp.status == httplib.ACCEPTED - def ex_update_balancer_connection_throttle(self, balancer, - connection_throttle): + def ex_update_balancer_connection_throttle(self, balancer, connection_throttle): """ Updates a Balancer's connection throttle. This method blocks until the update request has been processed and the balancer is in a @@ -779,16 +831,16 @@ def ex_update_balancer_connection_throttle(self, balancer, :rtype: :class:`LoadBalancer` """ accepted = self.ex_update_balancer_connection_throttle_no_poll( - balancer, connection_throttle) + balancer, connection_throttle + ) if not accepted: - msg = 'Update connection throttle request not accepted' + msg = "Update connection throttle request not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) - def ex_update_balancer_connection_throttle_no_poll(self, balancer, - connection_throttle): + def ex_update_balancer_connection_throttle_no_poll(self, balancer, connection_throttle): """ Sets a Balancer's connection throttle. This method returns immediately. @@ -802,10 +854,10 @@ def ex_update_balancer_connection_throttle_no_poll(self, balancer, :return: Returns whether the update request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/connectionthrottle' % (balancer.id) + uri = "/loadbalancers/%s/connectionthrottle" % (balancer.id) resp = self.connection.request( - uri, method='PUT', - data=json.dumps(connection_throttle._to_dict())) + uri, method="PUT", data=json.dumps(connection_throttle._to_dict()) + ) return resp.status == httplib.ACCEPTED @@ -822,7 +874,7 @@ def ex_disable_balancer_connection_throttle(self, balancer): :rtype: :class:`LoadBalancer` """ if not self.ex_disable_balancer_connection_throttle_no_poll(balancer): - msg = 'Disable connection throttle request not accepted' + msg = "Disable connection throttle request not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) @@ -838,8 +890,8 @@ def ex_disable_balancer_connection_throttle_no_poll(self, balancer): :return: Returns whether the disable request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/connectionthrottle' % (balancer.id) - resp = self.connection.request(uri, method='DELETE') + uri = "/loadbalancers/%s/connectionthrottle" % (balancer.id) + resp = self.connection.request(uri, method="DELETE") return resp.status == httplib.ACCEPTED @@ -856,7 +908,7 @@ def ex_enable_balancer_connection_logging(self, balancer): :rtype: :class:`LoadBalancer` """ if not self.ex_enable_balancer_connection_logging_no_poll(balancer): - msg = 'Enable connection logging request not accepted' + msg = "Enable connection logging request not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) @@ -872,11 +924,10 @@ def ex_enable_balancer_connection_logging_no_poll(self, balancer): :return: Returns whether the enable request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/connectionlogging' % (balancer.id) + uri = "/loadbalancers/%s/connectionlogging" % (balancer.id) resp = self.connection.request( - uri, method='PUT', - data=json.dumps({'connectionLogging': {'enabled': True}}) + uri, method="PUT", data=json.dumps({"connectionLogging": {"enabled": True}}) ) return resp.status == httplib.ACCEPTED @@ -894,7 +945,7 @@ def ex_disable_balancer_connection_logging(self, balancer): :rtype: :class:`LoadBalancer` """ if not self.ex_disable_balancer_connection_logging_no_poll(balancer): - msg = 'Disable connection logging request not accepted' + msg = "Disable connection logging request not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) @@ -910,10 +961,11 @@ def ex_disable_balancer_connection_logging_no_poll(self, balancer): :return: Returns whether the disable request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/connectionlogging' % (balancer.id) + uri = "/loadbalancers/%s/connectionlogging" % (balancer.id) resp = self.connection.request( - uri, method='PUT', - data=json.dumps({'connectionLogging': {'enabled': False}}) + uri, + method="PUT", + data=json.dumps({"connectionLogging": {"enabled": False}}), ) return resp.status == httplib.ACCEPTED @@ -931,7 +983,7 @@ def ex_enable_balancer_session_persistence(self, balancer): :rtype: :class:`LoadBalancer` """ if not self.ex_enable_balancer_session_persistence_no_poll(balancer): - msg = 'Enable session persistence request not accepted' + msg = "Enable session persistence request not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) @@ -947,11 +999,11 @@ def ex_enable_balancer_session_persistence_no_poll(self, balancer): :return: Returns whether the enable request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/sessionpersistence' % (balancer.id) + uri = "/loadbalancers/%s/sessionpersistence" % (balancer.id) resp = self.connection.request( - uri, method='PUT', - data=json.dumps( - {'sessionPersistence': {'persistenceType': 'HTTP_COOKIE'}}) + uri, + method="PUT", + data=json.dumps({"sessionPersistence": {"persistenceType": "HTTP_COOKIE"}}), ) return resp.status == httplib.ACCEPTED @@ -969,7 +1021,7 @@ def ex_disable_balancer_session_persistence(self, balancer): :rtype: :class:`LoadBalancer` """ if not self.ex_disable_balancer_session_persistence_no_poll(balancer): - msg = 'Disable session persistence request not accepted' + msg = "Disable session persistence request not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) @@ -985,8 +1037,8 @@ def ex_disable_balancer_session_persistence_no_poll(self, balancer): :return: Returns whether the disable request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/sessionpersistence' % (balancer.id) - resp = self.connection.request(uri, method='DELETE') + uri = "/loadbalancers/%s/sessionpersistence" % (balancer.id) + resp = self.connection.request(uri, method="DELETE") return resp.status == httplib.ACCEPTED @@ -1005,10 +1057,9 @@ def ex_update_balancer_error_page(self, balancer, page_content): :return: Updated Balancer. :rtype: :class:`LoadBalancer` """ - accepted = self.ex_update_balancer_error_page_no_poll(balancer, - page_content) + accepted = self.ex_update_balancer_error_page_no_poll(balancer, page_content) if not accepted: - msg = 'Update error page request not accepted' + msg = "Update error page request not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) @@ -1027,10 +1078,9 @@ def ex_update_balancer_error_page_no_poll(self, balancer, page_content): :return: Returns whether the update request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/errorpage' % (balancer.id) + uri = "/loadbalancers/%s/errorpage" % (balancer.id) resp = self.connection.request( - uri, method='PUT', - data=json.dumps({'errorpage': {'content': page_content}}) + uri, method="PUT", data=json.dumps({"errorpage": {"content": page_content}}) ) return resp.status == httplib.ACCEPTED @@ -1049,7 +1099,7 @@ def ex_disable_balancer_custom_error_page(self, balancer): :rtype: :class:`LoadBalancer` """ if not self.ex_disable_balancer_custom_error_page_no_poll(balancer): - msg = 'Disable custom error page request not accepted' + msg = "Disable custom error page request not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) @@ -1065,8 +1115,8 @@ def ex_disable_balancer_custom_error_page_no_poll(self, balancer): :return: Returns whether the disable request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/errorpage' % (balancer.id) - resp = self.connection.request(uri, method='DELETE') + uri = "/loadbalancers/%s/errorpage" % (balancer.id) + resp = self.connection.request(uri, method="DELETE") # Load Balancer API currently returns 200 OK on custom error page # delete. @@ -1089,16 +1139,16 @@ def ex_create_balancer_access_rule(self, balancer, rule): """ accepted = self.ex_create_balancer_access_rule_no_poll(balancer, rule) if not accepted: - msg = 'Create access rule not accepted' + msg = "Create access rule not accepted" raise LibcloudError(msg, driver=self) balancer = self._get_updated_balancer(balancer) - access_list = balancer.extra['accessList'] + access_list = balancer.extra["accessList"] created_rule = self._find_matching_rule(rule, access_list) if not created_rule: - raise LibcloudError('Could not find created rule') + raise LibcloudError("Could not find created rule") return created_rule @@ -1116,10 +1166,9 @@ def ex_create_balancer_access_rule_no_poll(self, balancer, rule): :return: Returns whether the create request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/accesslist' % (balancer.id) + uri = "/loadbalancers/%s/accesslist" % (balancer.id) resp = self.connection.request( - uri, method='POST', - data=json.dumps({'networkItem': rule._to_dict()}) + uri, method="POST", data=json.dumps({"networkItem": rule._to_dict()}) ) return resp.status == httplib.ACCEPTED @@ -1140,14 +1189,13 @@ def ex_create_balancer_access_rules(self, balancer, rules): :return: The created access rules. :rtype: :class:`RackspaceAccessRule` """ - accepted = self.ex_create_balancer_access_rules_no_poll(balancer, - rules) + accepted = self.ex_create_balancer_access_rules_no_poll(balancer, rules) if not accepted: - msg = 'Create access rules not accepted' + msg = "Create access rules not accepted" raise LibcloudError(msg, driver=self) balancer = self._get_updated_balancer(balancer) - access_list = balancer.extra['accessList'] + access_list = balancer.extra["accessList"] created_rules = [] for r in rules: @@ -1156,7 +1204,7 @@ def ex_create_balancer_access_rules(self, balancer, rules): created_rules.append(matched_rule) if len(created_rules) != len(rules): - raise LibcloudError('Could not find all created rules') + raise LibcloudError("Could not find all created rules") return created_rules @@ -1168,8 +1216,7 @@ def _find_matching_rule(self, rule_to_find, access_list): enforces rule type and address uniqueness. """ for r in access_list: - if rule_to_find.rule_type == r.rule_type and\ - rule_to_find.address == r.address: + if rule_to_find.rule_type == r.rule_type and rule_to_find.address == r.address: return r return None @@ -1189,11 +1236,11 @@ def ex_create_balancer_access_rules_no_poll(self, balancer, rules): :return: Returns whether the create request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/accesslist' % (balancer.id) + uri = "/loadbalancers/%s/accesslist" % (balancer.id) resp = self.connection.request( - uri, method='POST', - data=json.dumps({'accessList': - [rule._to_dict() for rule in rules]}) + uri, + method="POST", + data=json.dumps({"accessList": [rule._to_dict() for rule in rules]}), ) return resp.status == httplib.ACCEPTED @@ -1215,7 +1262,7 @@ def ex_destroy_balancer_access_rule(self, balancer, rule): """ accepted = self.ex_destroy_balancer_access_rule_no_poll(balancer, rule) if not accepted: - msg = 'Delete access rule not accepted' + msg = "Delete access rule not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) @@ -1234,8 +1281,8 @@ def ex_destroy_balancer_access_rule_no_poll(self, balancer, rule): :return: Returns whether the destroy request was accepted. :rtype: ``bool`` """ - uri = '/loadbalancers/%s/accesslist/%s' % (balancer.id, rule.id) - resp = self.connection.request(uri, method='DELETE') + uri = "/loadbalancers/{}/accesslist/{}".format(balancer.id, rule.id) + resp = self.connection.request(uri, method="DELETE") return resp.status == httplib.ACCEPTED @@ -1255,11 +1302,10 @@ def ex_destroy_balancer_access_rules(self, balancer, rules): :return: Updated Balancer. :rtype: :class:`LoadBalancer` """ - accepted = self.ex_destroy_balancer_access_rules_no_poll( - balancer, rules) + accepted = self.ex_destroy_balancer_access_rules_no_poll(balancer, rules) if not accepted: - msg = 'Destroy access rules request not accepted' + msg = "Destroy access rules request not accepted" raise LibcloudError(msg, driver=self) return self._get_updated_balancer(balancer) @@ -1279,12 +1325,10 @@ def ex_destroy_balancer_access_rules_no_poll(self, balancer, rules): :return: Returns whether the destroy request was accepted. :rtype: ``bool`` """ - ids = [('id', rule.id) for rule in rules] - uri = '/loadbalancers/%s/accesslist' % balancer.id + ids = [("id", rule.id) for rule in rules] + uri = "/loadbalancers/%s/accesslist" % balancer.id - resp = self.connection.request(uri, - method='DELETE', - params=ids) + resp = self.connection.request(uri, method="DELETE", params=ids) return resp.status == httplib.ACCEPTED @@ -1298,22 +1342,22 @@ def ex_list_current_usage(self, balancer): :return: Raw load balancer usage object. :rtype: ``dict`` """ - uri = '/loadbalancers/%s/usage/current' % (balancer.id) - resp = self.connection.request(uri, method='GET') + uri = "/loadbalancers/%s/usage/current" % (balancer.id) + resp = self.connection.request(uri, method="GET") return resp.object def _to_protocols(self, object): protocols = [] for item in object["protocols"]: - protocols.append(item['name'].lower()) + protocols.append(item["name"].lower()) return protocols def _to_protocols_with_default_ports(self, object): protocols = [] for item in object["protocols"]: - name = item['name'].lower() - port = int(item['port']) + name = item["name"].lower() + port = int(item["port"]) protocols.append((name, port)) return protocols @@ -1326,94 +1370,98 @@ def _to_balancer(self, el): port = None sourceAddresses = {} - if 'port' in el: + if "port" in el: port = el["port"] - if 'sourceAddresses' in el: - sourceAddresses = el['sourceAddresses'] + if "sourceAddresses" in el: + sourceAddresses = el["sourceAddresses"] extra = { "ipv6PublicSource": sourceAddresses.get("ipv6Public"), "ipv4PublicSource": sourceAddresses.get("ipv4Public"), "ipv4PrivateSource": sourceAddresses.get("ipv4Servicenet"), + "service_name": self.connection.get_service_name(), + "uri": "https://%s%s/loadbalancers/%s" + % (self.connection.host, self.connection.request_path, el["id"]), } - if 'virtualIps' in el: - ip = el['virtualIps'][0]['address'] - extra['virtualIps'] = el['virtualIps'] + if "virtualIps" in el: + ip = el["virtualIps"][0]["address"] + extra["virtualIps"] = el["virtualIps"] - if 'protocol' in el: - extra['protocol'] = el['protocol'] + if "protocol" in el: + extra["protocol"] = el["protocol"] - if 'algorithm' in el and \ - el["algorithm"] in self._VALUE_TO_ALGORITHM_MAP: + if "algorithm" in el and el["algorithm"] in self._VALUE_TO_ALGORITHM_MAP: extra["algorithm"] = self._value_to_algorithm(el["algorithm"]) - if 'healthMonitor' in el: + if "healthMonitor" in el: health_monitor = self._to_health_monitor(el) if health_monitor: extra["healthMonitor"] = health_monitor - if 'connectionThrottle' in el: + if "connectionThrottle" in el: extra["connectionThrottle"] = self._to_connection_throttle(el) - if 'sessionPersistence' in el: + if "sessionPersistence" in el: persistence = el["sessionPersistence"] - extra["sessionPersistenceType"] =\ - persistence.get("persistenceType") + extra["sessionPersistenceType"] = persistence.get("persistenceType") - if 'connectionLogging' in el: + if "connectionLogging" in el: logging = el["connectionLogging"] extra["connectionLoggingEnabled"] = logging.get("enabled") - if 'nodes' in el: - extra['members'] = self._to_members(el) + if "nodes" in el: + extra["members"] = self._to_members(el) - if 'created' in el: - extra['created'] = self._iso_to_datetime(el['created']['time']) + if "created" in el: + extra["created"] = self._iso_to_datetime(el["created"]["time"]) - if 'updated' in el: - extra['updated'] = self._iso_to_datetime(el['updated']['time']) + if "updated" in el: + extra["updated"] = self._iso_to_datetime(el["updated"]["time"]) - if 'accessList' in el: - extra['accessList'] = [self._to_access_rule(rule) - for rule in el['accessList']] + if "accessList" in el: + extra["accessList"] = [self._to_access_rule(rule) for rule in el["accessList"]] - return LoadBalancer(id=el["id"], - name=el["name"], - state=self.LB_STATE_MAP.get( - el["status"], State.UNKNOWN), - ip=ip, - port=port, - driver=self.connection.driver, - extra=extra) + return LoadBalancer( + id=el["id"], + name=el["name"], + state=self.LB_STATE_MAP.get(el["status"], State.UNKNOWN), + ip=ip, + port=port, + driver=self.connection.driver, + extra=extra, + ) def _to_members(self, object, balancer=None): return [self._to_member(el, balancer) for el in object["nodes"]] def _to_member(self, el, balancer=None): extra = {} - if 'weight' in el: - extra['weight'] = el["weight"] - - if 'condition' in el and\ - el['condition'] in self.LB_MEMBER_CONDITION_MAP: - extra['condition'] =\ - self.LB_MEMBER_CONDITION_MAP.get(el["condition"]) - - if 'status' in el: - extra['status'] = el["status"] - - lbmember = Member(id=el["id"], - ip=el["address"], - port=el["port"], - balancer=balancer, - extra=extra) + if "weight" in el: + extra["weight"] = el["weight"] + + if "condition" in el and el["condition"] in self.LB_MEMBER_CONDITION_MAP: + extra["condition"] = self.LB_MEMBER_CONDITION_MAP.get(el["condition"]) + + if "status" in el: + extra["status"] = el["status"] + + lbmember = Member( + id=el["id"], + ip=el["address"], + port=el["port"], + balancer=balancer, + extra=extra, + ) return lbmember def _protocol_to_value(self, protocol): - non_standard_protocols = {'imapv2': 'IMAPv2', 'imapv3': 'IMAPv3', - 'imapv4': 'IMAPv4'} + non_standard_protocols = { + "imapv2": "IMAPv2", + "imapv3": "IMAPv3", + "imapv4": "IMAPv4", + } protocol_name = protocol.lower() if protocol_name in non_standard_protocols: @@ -1426,35 +1474,33 @@ def _protocol_to_value(self, protocol): def _kwargs_to_mutable_attrs(self, **attrs): update_attrs = {} if "name" in attrs: - update_attrs['name'] = attrs['name'] + update_attrs["name"] = attrs["name"] if "algorithm" in attrs: - algorithm_value = self._algorithm_to_value(attrs['algorithm']) - update_attrs['algorithm'] = algorithm_value + algorithm_value = self._algorithm_to_value(attrs["algorithm"]) + update_attrs["algorithm"] = algorithm_value if "protocol" in attrs: - update_attrs['protocol'] =\ - self._protocol_to_value(attrs['protocol']) + update_attrs["protocol"] = self._protocol_to_value(attrs["protocol"]) if "port" in attrs: - update_attrs['port'] = int(attrs['port']) + update_attrs["port"] = int(attrs["port"]) if "vip" in attrs: - if attrs['vip'] == 'PUBLIC' or attrs['vip'] == 'SERVICENET': - update_attrs['virtualIps'] = [{'type': attrs['vip']}] + if attrs["vip"] == "PUBLIC" or attrs["vip"] == "SERVICENET": + update_attrs["virtualIps"] = [{"type": attrs["vip"]}] else: - update_attrs['virtualIps'] = [{'id': attrs['vip']}] + update_attrs["virtualIps"] = [{"id": attrs["vip"]}] return update_attrs def _kwargs_to_mutable_member_attrs(self, **attrs): update_attrs = {} - if 'condition' in attrs: - update_attrs['condition'] =\ - self.CONDITION_LB_MEMBER_MAP.get(attrs['condition']) + if "condition" in attrs: + update_attrs["condition"] = self.CONDITION_LB_MEMBER_MAP.get(attrs["condition"]) - if 'weight' in attrs: - update_attrs['weight'] = attrs['weight'] + if "weight" in attrs: + update_attrs["weight"] = attrs["weight"] return update_attrs @@ -1464,21 +1510,26 @@ def _to_health_monitor(self, el): type = health_monitor_data.get("type") delay = health_monitor_data.get("delay") timeout = health_monitor_data.get("timeout") - attempts_before_deactivation =\ - health_monitor_data.get("attemptsBeforeDeactivation") + attempts_before_deactivation = health_monitor_data.get("attemptsBeforeDeactivation") if type == "CONNECT": return RackspaceHealthMonitor( - type=type, delay=delay, timeout=timeout, - attempts_before_deactivation=attempts_before_deactivation) + type=type, + delay=delay, + timeout=timeout, + attempts_before_deactivation=attempts_before_deactivation, + ) if type == "HTTP" or type == "HTTPS": return RackspaceHTTPHealthMonitor( - type=type, delay=delay, timeout=timeout, + type=type, + delay=delay, + timeout=timeout, attempts_before_deactivation=attempts_before_deactivation, path=health_monitor_data.get("path"), status_regex=health_monitor_data.get("statusRegex"), - body_regex=health_monitor_data.get("bodyRegex", '')) + body_regex=health_monitor_data.get("bodyRegex", ""), + ) return None @@ -1494,13 +1545,15 @@ def _to_connection_throttle(self, el): min_connections=min_connections, max_connections=max_connections, max_connection_rate=max_connection_rate, - rate_interval_seconds=rate_interval) + rate_interval_seconds=rate_interval, + ) def _to_access_rule(self, el): return RackspaceAccessRule( id=el.get("id"), rule_type=self._to_access_rule_type(el.get("type")), - address=el.get("address")) + address=el.get("address"), + ) def _to_access_rule_type(self, type): if type == "ALLOW": @@ -1509,7 +1562,7 @@ def _to_access_rule_type(self, type): return RackspaceAccessRuleType.DENY def _iso_to_datetime(self, isodate): - date_formats = ('%Y-%m-%dT%H:%M:%SZ', '%Y-%m-%dT%H:%M:%S%z') + date_formats = ("%Y-%m-%dT%H:%M:%SZ", "%Y-%m-%dT%H:%M:%S%z") date = None for date_format in date_formats: @@ -1522,9 +1575,3 @@ def _iso_to_datetime(self, isodate): break return date - - -class RackspaceUKLBDriver(RackspaceLBDriver): - def __init__(self, *args, **kwargs): - kwargs['region'] = 'lon' - super(RackspaceUKLBDriver, self).__init__(*args, **kwargs) diff --git a/libcloud/loadbalancer/drivers/slb.py b/libcloud/loadbalancer/drivers/slb.py new file mode 100644 index 0000000000..32b1cec471 --- /dev/null +++ b/libcloud/loadbalancer/drivers/slb.py @@ -0,0 +1,885 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__all__ = ["SLB_API_VERSION", "SLBDriver"] + +try: + import simplejson as json +except ImportError: + import json + +from libcloud.utils.py3 import u +from libcloud.utils.xml import findall, findattr, findtext +from libcloud.utils.misc import ReprMixin +from libcloud.common.types import LibcloudError +from libcloud.common.aliyun import AliyunXmlResponse, SignedAliyunConnection +from libcloud.loadbalancer.base import Driver, Member, Algorithm, LoadBalancer +from libcloud.loadbalancer.types import State + +SLB_API_VERSION = "2014-05-15" +SLB_API_HOST = "slb.aliyuncs.com" +DEFAULT_SIGNATURE_VERSION = "1.0" + + +STATE_MAPPINGS = { + "inactive": State.UNKNOWN, + "active": State.RUNNING, + "locked": State.PENDING, +} + + +RESOURCE_EXTRA_ATTRIBUTES_MAP = { + "balancer": { + "create_timestamp": {"xpath": "CreateTimeStamp", "transform_func": int}, + "address_type": {"xpath": "AddressType", "transform_func": u}, + "region_id": {"xpath": "RegionId", "transform_func": u}, + "region_id_alias": {"xpath": "RegionIdAlias", "transform_func": u}, + "create_time": {"xpath": "CreateTime", "transform_func": u}, + "master_zone_id": {"xpath": "MasterZoneId", "transform_func": u}, + "slave_zone_id": {"xpath": "SlaveZoneId", "transform_func": u}, + "network_type": {"xpath": "NetworkType", "transform_func": u}, + } +} + + +SLB_SCHEDULER_TO_ALGORITHM = { + "wrr": Algorithm.WEIGHTED_ROUND_ROBIN, + "wlc": Algorithm.WEIGHTED_LEAST_CONNECTIONS, +} + + +ALGORITHM_TO_SLB_SCHEDULER = { + Algorithm.WEIGHTED_ROUND_ROBIN: "wrr", + Algorithm.WEIGHTED_LEAST_CONNECTIONS: "wlc", +} + + +class SLBConnection(SignedAliyunConnection): + api_version = SLB_API_VERSION + host = SLB_API_HOST + responseCls = AliyunXmlResponse + service_name = "slb" + + +class SLBLoadBalancerAttribute: + """ + This class used to get listeners and backend servers related to a balancer + listeners is a ``list`` of ``dict``, each element contains + 'ListenerPort' and 'ListenerProtocol' keys. + backend_servers is a ``list`` of ``dict``, each element contains + 'ServerId' and 'Weight' keys. + """ + + def __init__(self, balancer, listeners, backend_servers, extra=None): + self.balancer = balancer + self.listeners = listeners or [] + self.backend_servers = backend_servers or [] + self.extra = extra or {} + + def is_listening(self, port): + for listener in self.listeners: + if listener.get("ListenerPort") == port: + return True + return False + + def is_attached(self, member): + for server in self.backend_servers: + if server.get("Serverid") == member.id: + return True + return False + + def __repr__(self): + return "".format( + self.balancer.id, + self.listeners, + self.backend_servers, + ) + + +class SLBLoadBalancerListener(ReprMixin): + """ + Base SLB load balancer listener class + """ + + _repr_attributes = ["port", "backend_port", "scheduler", "bandwidth"] + action = None + option_keys = [] + + def __init__(self, port, backend_port, algorithm, bandwidth, extra=None): + self.port = port + self.backend_port = backend_port + self.scheduler = ALGORITHM_TO_SLB_SCHEDULER.get(algorithm, "wrr") + self.bandwidth = bandwidth + self.extra = extra or {} + + @classmethod + def create(cls, port, backend_port, algorithm, bandwidth, extra=None): + return cls(port, backend_port, algorithm, bandwidth, extra=extra) + + def get_create_params(self): + params = self.get_required_params() + options = self.get_optional_params() + options.update(params) + return options + + def get_required_params(self): + params = { + "Action": self.action, + "ListenerPort": self.port, + "BackendServerPort": self.backend_port, + "Scheduler": self.scheduler, + "Bandwidth": self.bandwidth, + } + return params + + def get_optional_params(self): + options = {} + for option in self.option_keys: + if self.extra and option in self.extra: + options[option] = self.extra[option] + return options + + +class SLBLoadBalancerHttpListener(SLBLoadBalancerListener): + """ + This class represents a rule to route http request to the backends. + """ + + action = "CreateLoadBalancerHTTPListener" + option_keys = [ + "XForwardedFor", + "StickySessionType", + "CookieTimeout", + "Cookie", + "HealthCheckDomain", + "HealthCheckURI", + "HealthCheckConnectPort", + "HealthyThreshold", + "UnhealthyThreshold", + "HealthCheckTimeout", + "HealthCheckInterval", + "HealthCheckHttpCode", + ] + + def __init__( + self, + port, + backend_port, + algorithm, + bandwidth, + sticky_session, + health_check, + extra=None, + ): + super().__init__(port, backend_port, algorithm, bandwidth, extra=extra) + self.sticky_session = sticky_session + self.health_check = health_check + + def get_required_params(self): + params = super().get_required_params() + params["StickySession"] = self.sticky_session + params["HealthCheck"] = self.health_check + return params + + @classmethod + def create(cls, port, backend_port, algorithm, bandwidth, extra={}): + if "StickySession" not in extra: + raise AttributeError("StickySession is required") + if "HealthCheck" not in extra: + raise AttributeError("HealthCheck is required") + sticky_session = extra["StickySession"] + health_check = extra["HealthCheck"] + return cls( + port, + backend_port, + algorithm, + bandwidth, + sticky_session, + health_check, + extra=extra, + ) + + +class SLBLoadBalancerHttpsListener(SLBLoadBalancerListener): + """ + This class represents a rule to route https request to the backends. + """ + + action = "CreateLoadBalancerHTTPSListener" + option_keys = [ + "XForwardedFor", + "StickySessionType", + "CookieTimeout", + "Cookie", + "HealthCheckDomain", + "HealthCheckURI", + "HealthCheckConnectPort", + "HealthyThreshold", + "UnhealthyThreshold", + "HealthCheckTimeout", + "HealthCheckInterval", + "HealthCheckHttpCode", + ] + + def __init__( + self, + port, + backend_port, + algorithm, + bandwidth, + sticky_session, + health_check, + certificate_id, + extra=None, + ): + super().__init__(port, backend_port, algorithm, bandwidth, extra=extra) + self.sticky_session = sticky_session + self.health_check = health_check + self.certificate_id = certificate_id + + def get_required_params(self): + params = super().get_required_params() + params["StickySession"] = self.sticky_session + params["HealthCheck"] = self.health_check + params["ServerCertificateId"] = self.certificate_id + return params + + @classmethod + def create(cls, port, backend_port, algorithm, bandwidth, extra={}): + if "StickySession" not in extra: + raise AttributeError("StickySession is required") + if "HealthCheck" not in extra: + raise AttributeError("HealthCheck is required") + if "ServerCertificateId" not in extra: + raise AttributeError("ServerCertificateId is required") + sticky_session = extra["StickySession"] + health_check = extra["HealthCheck"] + certificate_id = extra["ServerCertificateId"] + return cls( + port, + backend_port, + algorithm, + bandwidth, + sticky_session, + health_check, + certificate_id, + extra=extra, + ) + + +class SLBLoadBalancerTcpListener(SLBLoadBalancerListener): + """ + This class represents a rule to route tcp request to the backends. + """ + + action = "CreateLoadBalancerTCPListener" + option_keys = [ + "PersistenceTimeout", + "HealthCheckType", + "HealthCheckDomain", + "HealthCheckURI", + "HealthCheckConnectPort", + "HealthyThreshold", + "UnhealthyThreshold", + "HealthCheckConnectTimeout", + "HealthCheckInterval", + "HealthCheckHttpCode", + ] + + +class SLBLoadBalancerUdpListener(SLBLoadBalancerTcpListener): + """ + This class represents a rule to route udp request to the backends. + """ + + action = "CreateLoadBalancerUDPListener" + option_keys = [ + "PersistenceTimeout", + "HealthCheckConnectPort", + "HealthyThreshold", + "UnhealthyThreshold", + "HealthCheckConnectTimeout", + "HealthCheckInterval", + ] + + +class SLBServerCertificate(ReprMixin): + _repr_attributes = ["id", "name", "fingerprint"] + + def __init__(self, id, name, fingerprint): + self.id = id + self.name = name + self.fingerprint = fingerprint + + +PROTOCOL_TO_LISTENER_MAP = { + "http": SLBLoadBalancerHttpListener, + "https": SLBLoadBalancerHttpsListener, + "tcp": SLBLoadBalancerTcpListener, + "udp": SLBLoadBalancerUdpListener, +} + + +class SLBDriver(Driver): + """ + Aliyun SLB load balancer driver. + """ + + name = "Aliyun Server Load Balancer" + website = "https://www.aliyun.com/product/slb" + connectionCls = SLBConnection + path = "/" + namespace = None + + _VALUE_TO_ALGORITHM_MAP = SLB_SCHEDULER_TO_ALGORITHM + + _ALGORITHM_TO_VALUE_MAP = ALGORITHM_TO_SLB_SCHEDULER + + def __init__(self, access_id, secret, region): + super().__init__(access_id, secret) + self.region = region + + def list_protocols(self): + return list(PROTOCOL_TO_LISTENER_MAP.keys()) + + def list_balancers(self, ex_balancer_ids=None, ex_filters=None): + """ + List all loadbalancers + + @inherits :class:`Driver.list_balancers` + + :keyword ex_balancer_ids: a list of balancer ids to filter results + Only balancers which's id in this list + will be returned + :type ex_balancer_ids: ``list`` of ``str`` + + :keyword ex_filters: attributes to filter results. Only balancers + which have all the desired attributes + and values will be returned + :type ex_filters: ``dict`` + """ + + params = {"Action": "DescribeLoadBalancers", "RegionId": self.region} + if ex_balancer_ids and isinstance(ex_balancer_ids, list): + params["LoadBalancerId"] = ",".join(ex_balancer_ids) + + if ex_filters and isinstance(ex_filters, dict): + ex_filters.update(params) + params = ex_filters + resp_body = self.connection.request(self.path, params=params).object + return self._to_balancers(resp_body) + + def create_balancer( + self, + name, + port, + protocol, + algorithm, + members, + ex_bandwidth=None, + ex_internet_charge_type=None, + ex_address_type=None, + ex_vswitch_id=None, + ex_master_zone_id=None, + ex_slave_zone_id=None, + ex_client_token=None, + **kwargs, + ): + """ + Create a new load balancer instance + + @inherits: :class:`Driver.create_balancer` + + :keyword ex_bandwidth: The max bandwidth limit for `paybybandwidth` + internet charge type, in Mbps unit + :type ex_bandwidth: ``int`` in range [1, 1000] + + :keyword ex_internet_charge_type: The internet charge type + :type ex_internet_charge_type: a ``str`` of `paybybandwidth` + or `paybytraffic` + + :keyword ex_address_type: The listening IP address type + :type ex_address_type: a ``str`` of `internet` or `intranet` + + :keyword ex_vswitch_id: The vswitch id in a VPC network + :type ex_vswitch_id: ``str`` + + :keyword ex_master_zone_id: The id of the master availability zone + :type ex_master_zone_id: ``str`` + + :keyword ex_slave_zone_id: The id of the slave availability zone + :type ex_slave_zone_id: ``str`` + + :keyword ex_client_token: The token generated by client to + identify requests + :type ex_client_token: ``str`` + """ + + # 1.Create load balancer + params = {"Action": "CreateLoadBalancer", "RegionId": self.region} + if name: + params["LoadBalancerName"] = name + if not port: + raise AttributeError("port is required") + if not protocol: + # NOTE(samsong8610): Use http listener as default + protocol = "http" + if protocol not in PROTOCOL_TO_LISTENER_MAP: + raise AttributeError("unsupported protocol %s" % protocol) + + # Bandwidth in range [1, 1000] Mbps + bandwidth = -1 + if ex_bandwidth: + try: + bandwidth = int(ex_bandwidth) + except ValueError: + raise AttributeError("ex_bandwidth should be a integer in " "range [1, 1000].") + params["Bandwidth"] = bandwidth + + if ex_internet_charge_type: + if ex_internet_charge_type.lower() == "paybybandwidth": + if bandwidth == -1: + raise AttributeError( + "PayByBandwidth internet charge type" " need ex_bandwidth be set" + ) + params["InternetChargeType"] = ex_internet_charge_type + + if ex_address_type: + if ex_address_type.lower() not in ("internet", "intranet"): + raise AttributeError('ex_address_type should be "internet" ' 'or "intranet"') + params["AddressType"] = ex_address_type + + if ex_vswitch_id: + params["VSwitchId"] = ex_vswitch_id + + if ex_master_zone_id: + params["MasterZoneId"] = ex_master_zone_id + if ex_slave_zone_id: + params["SlaveZoneId"] = ex_slave_zone_id + + if ex_client_token: + params["ClientToken"] = ex_client_token + + if members and isinstance(members, list): + backend_ports = [member.port for member in members] + if len(set(backend_ports)) != 1: + raise AttributeError("the ports of members should be unique") + # NOTE(samsong8610): If members do not provide backend port, + # default to listening port + backend_port = backend_ports[0] or port + else: + backend_port = port + + balancer = None + try: + resp_body = self.connection.request(self.path, params).object + balancer = self._to_balancer(resp_body) + balancer.port = port + + # 2.Add backend servers + if members is None: + members = [] + for member in members: + self.balancer_attach_member(balancer, member) + # 3.Create listener + # NOTE(samsong8610): Assume only create a listener which uses all + # the bandwidth. + self.ex_create_listener( + balancer, backend_port, protocol, algorithm, bandwidth, **kwargs + ) + self.ex_start_listener(balancer, port) + return balancer + except Exception as e: + if balancer is not None: + try: + self.destroy_balancer(balancer) + except Exception: + pass + raise e + + def destroy_balancer(self, balancer): + params = {"Action": "DeleteLoadBalancer", "LoadBalancerId": balancer.id} + resp = self.connection.request(self.path, params) + return resp.success() + + def get_balancer(self, balancer_id): + balancers = self.list_balancers(ex_balancer_ids=[balancer_id]) + if len(balancers) != 1: + raise LibcloudError("could not find load balancer with id %s" % balancer_id) + return balancers[0] + + def balancer_attach_compute_node(self, balancer, node): + if len(node.public_ips) > 0: + ip = node.public_ips[0] + else: + ip = node.private_ips[0] + member = Member(id=node.id, ip=ip, port=balancer.port) + return self.balancer_attach_member(balancer, member) + + def balancer_attach_member(self, balancer, member): + params = {"Action": "AddBackendServers", "LoadBalancerId": balancer.id} + if member and isinstance(member, Member): + params["BackendServers"] = self._to_servers_json([member]) + self.connection.request(self.path, params) + return member + + def balancer_detach_member(self, balancer, member): + params = {"Action": "RemoveBackendServers", "LoadBalancerId": balancer.id} + if member and isinstance(member, Member): + params["BackendServers"] = self._list_to_json([member.id]) + self.connection.request(self.path, params) + return member + + def balancer_list_members(self, balancer): + attribute = self.ex_get_balancer_attribute(balancer) + members = [ + Member( + server["ServerId"], + None, + None, + balancer=balancer, + extra={"Weight": server["Weight"]}, + ) + for server in attribute.backend_servers + ] + return members + + def ex_get_balancer_attribute(self, balancer): + """ + Get balancer attribute + + :param balancer: the balancer to get attribute + :type balancer: ``LoadBalancer`` + + :return: the balancer attribute + :rtype: ``SLBLoadBalancerAttribute`` + """ + + params = { + "Action": "DescribeLoadBalancerAttribute", + "LoadBalancerId": balancer.id, + } + resp_body = self.connection.request(self.path, params).object + attribute = self._to_balancer_attribute(resp_body) + return attribute + + def ex_list_listeners(self, balancer): + """ + Get all listener related to the given balancer + + :param balancer: the balancer to list listeners + :type balancer: ``LoadBalancer`` + + :return: a list of listeners + :rtype: ``list`` of ``SLBLoadBalancerListener`` + """ + + attribute = self.ex_get_balancer_attribute(balancer) + listeners = [ + SLBLoadBalancerListener(each["ListenerPort"], None, None, None) + for each in attribute.listeners + ] + return listeners + + def ex_create_listener(self, balancer, backend_port, protocol, algorithm, bandwidth, **kwargs): + """ + Create load balancer listening rule. + + :param balancer: the balancer which the rule belongs to. + The listener created will listen on the port of the + the balancer as default. 'ListenerPort' in kwargs + will *OVERRIDE* it. + :type balancer: ``LoadBalancer`` + + :param backend_port: the backend server port + :type backend_port: ``int`` + + :param protocol: the balancer protocol, default to http + :type protocol: ``str`` + + :param algorithm: the balancer routing algorithm + :type algorithm: ``Algorithm`` + + :param bandwidth: the listener bandwidth limits + :type bandwidth: ``str`` + + :return: the created listener + :rtype: ``SLBLoadBalancerListener`` + """ + + cls = PROTOCOL_TO_LISTENER_MAP.get(protocol, SLBLoadBalancerHttpListener) + if "ListenerPort" in kwargs: + port = kwargs["ListenerPort"] + else: + port = balancer.port + listener = cls.create(port, backend_port, algorithm, bandwidth, extra=kwargs) + params = listener.get_create_params() + params["LoadBalancerId"] = balancer.id + params["RegionId"] = self.region + resp = self.connection.request(self.path, params) + return resp.success() + + def ex_start_listener(self, balancer, port): + """ + Start balancer's listener listening the given port. + + :param balancer: a load balancer + :type balancer: ``LoadBalancer`` + + :param port: listening port + :type port: ``int`` + + :return: whether operation is success + :rtype: ``bool`` + """ + + params = { + "Action": "StartLoadBalancerListener", + "LoadBalancerId": balancer.id, + "ListenerPort": port, + } + resp = self.connection.request(self.path, params) + return resp.success() + + def ex_stop_listener(self, balancer, port): + """ + Stop balancer's listener listening the given port. + + :param balancer: a load balancer + :type balancer: ``LoadBalancer`` + + :param port: listening port + :type port: ``int`` + + :return: whether operation is success + :rtype: ``bool`` + """ + + params = { + "Action": "StopLoadBalancerListener", + "LoadBalancerId": balancer.id, + "ListenerPort": port, + } + resp = self.connection.request(self.path, params) + return resp.success() + + def ex_upload_certificate(self, name, server_certificate, private_key): + """ + Upload certificate and private key for https load balancer listener + + :param name: the certificate name + :type name: ``str`` + + :param server_certificate: the content of the certificate to upload + in PEM format + :type server_certificate: ``str`` + + :param private_key: the content of the private key to upload + in PEM format + :type private_key: ``str`` + + :return: new created certificate info + :rtype: ``SLBServerCertificate`` + """ + + params = { + "Action": "UploadServerCertificate", + "RegionId": self.region, + "ServerCertificate": server_certificate, + "PrivateKey": private_key, + } + if name: + params["ServerCertificateName"] = name + resp_body = self.connection.request(self.path, params).object + return self._to_server_certificate(resp_body) + + def ex_list_certificates(self, certificate_ids=[]): + """ + List all server certificates + + :param certificate_ids: certificate ids to filter results + :type certificate_ids: ``str`` + + :return: certificates + :rtype: ``SLBServerCertificate`` + """ + + params = {"Action": "DescribeServerCertificates", "RegionId": self.region} + if certificate_ids and isinstance(certificate_ids, list): + params["ServerCertificateId"] = ",".join(certificate_ids) + + resp_body = self.connection.request(self.path, params).object + cert_elements = findall( + resp_body, "ServerCertificates/ServerCertificate", namespace=self.namespace + ) + certificates = [self._to_server_certificate(el) for el in cert_elements] + return certificates + + def ex_delete_certificate(self, certificate_id): + """ + Delete the given server certificate + + :param certificate_id: the id of the certificate to delete + :type certificate_id: ``str`` + + :return: whether process is success + :rtype: ``bool`` + """ + + params = { + "Action": "DeleteServerCertificate", + "RegionId": self.region, + "ServerCertificateId": certificate_id, + } + resp = self.connection.request(self.path, params) + return resp.success() + + def ex_set_certificate_name(self, certificate_id, name): + """ + Set server certificate name. + + :param certificate_id: the id of the server certificate to update + :type certificate_id: ``str`` + + :param name: the new name + :type name: ``str`` + + :return: whether updating is success + :rtype: ``bool`` + """ + + params = { + "Action": "SetServerCertificateName", + "RegionId": self.region, + "ServerCertificateId": certificate_id, + "ServerCertificateName": name, + } + resp = self.connection.request(self.path, params) + return resp.success() + + def _to_balancers(self, element): + xpath = "LoadBalancers/LoadBalancer" + return [ + self._to_balancer(el) + for el in findall(element=element, xpath=xpath, namespace=self.namespace) + ] + + def _to_balancer(self, el): + _id = findtext(element=el, xpath="LoadBalancerId", namespace=self.namespace) + name = findtext(element=el, xpath="LoadBalancerName", namespace=self.namespace) + status = findtext(element=el, xpath="LoadBalancerStatus", namespace=self.namespace) + state = STATE_MAPPINGS.get(status, State.UNKNOWN) + address = findtext(element=el, xpath="Address", namespace=self.namespace) + extra = self._get_extra_dict(el, RESOURCE_EXTRA_ATTRIBUTES_MAP["balancer"]) + + balancer = LoadBalancer( + id=_id, + name=name, + state=state, + ip=address, + port=None, + driver=self, + extra=extra, + ) + return balancer + + def _create_list_params(self, params, items, label): + """ + return parameter list + """ + if isinstance(items, str): + items = [items] + for index, item in enumerate(items): + params[label % (index + 1)] = item + return params + + def _get_extra_dict(self, element, mapping): + """ + Extract attributes from the element based on rules provided in the + mapping dictionary. + + :param element: Element to parse the values from. + :type element: xml.etree.ElementTree.Element. + + :param mapping: Dictionary with the extra layout + :type node: :class:`Node` + + :rtype: ``dict`` + """ + extra = {} + for attribute, values in mapping.items(): + transform_func = values["transform_func"] + value = findattr(element=element, xpath=values["xpath"], namespace=self.namespace) + if value: + try: + extra[attribute] = transform_func(value) + except Exception: + extra[attribute] = None + else: + extra[attribute] = value + + return extra + + def _to_servers_json(self, members): + servers = [] + for each in members: + server = {"ServerId": each.id, "Weight": "100"} + if "Weight" in each.extra: + server["Weight"] = each.extra["Weight"] + servers.append(server) + try: + return json.dumps(servers) + except Exception: + raise AttributeError("could not convert member to backend server") + + def _to_balancer_attribute(self, element): + balancer = self._to_balancer(element) + port_proto_elements = findall( + element, + "ListenerPortsAndProtocol/ListenerPortAndProtocol", + namespace=self.namespace, + ) + if len(port_proto_elements) > 0: + listeners = [self._to_port_and_protocol(el) for el in port_proto_elements] + else: + port_elements = findall(element, "ListenerPorts/ListenerPort", namespace=self.namespace) + listeners = [ + {"ListenerPort": el.text, "ListenerProtocol": "http"} for el in port_elements + ] + server_elements = findall(element, "BackendServers/BackendServer", namespace=self.namespace) + backend_servers = [self._to_server_and_weight(el) for el in server_elements] + return SLBLoadBalancerAttribute(balancer, listeners, backend_servers) + + def _to_port_and_protocol(self, el): + port = findtext(el, "ListenerPort", namespace=self.namespace) + protocol = findtext(el, "ListenerProtocol", namespace=self.namespace) + return {"ListenerPort": port, "ListenerProtocol": protocol} + + def _to_server_and_weight(self, el): + server_id = findtext(el, "ServerId", namespace=self.namespace) + weight = findtext(el, "Weight", namespace=self.namespace) + return {"ServerId": server_id, "Weight": weight} + + def _to_server_certificate(self, el): + _id = findtext(el, "ServerCertificateId", namespace=self.namespace) + name = findtext(el, "ServerCertificateName", namespace=self.namespace) + fingerprint = findtext(el, "Fingerprint", namespace=self.namespace) + return SLBServerCertificate(id=_id, name=name, fingerprint=fingerprint) + + def _list_to_json(self, value): + try: + return json.dumps(value) + except Exception: + return "[]" diff --git a/libcloud/loadbalancer/drivers/softlayer.py b/libcloud/loadbalancer/drivers/softlayer.py deleted file mode 100644 index 556e4fbf30..0000000000 --- a/libcloud/loadbalancer/drivers/softlayer.py +++ /dev/null @@ -1,435 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance withv -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -__all__ = [ - 'SoftlayerLBDriver' -] - -from libcloud.common.types import LibcloudError -from libcloud.common.softlayer import SoftLayerConnection -from libcloud.utils.misc import find, reverse_dict -from libcloud.loadbalancer.types import State -from libcloud.loadbalancer.base import Algorithm, Driver, LoadBalancer -from libcloud.loadbalancer.base import DEFAULT_ALGORITHM, Member - -lb_service = 'SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_'\ - 'VirtualIpAddress' - - -class LBPackage(object): - - """ - Defines a single Softlayer package to be used when placing orders ( - e.g. via ex_place_balancer_order method). - - :param id: Package id. - :type id: ``int`` - - :param name: Package name. - :type name: ``str`` - - :param description: Package short description. - :type description: ``str`` - - :param price_id: Id of the price for this package. - :type price_id: ``int`` - - :param capacity: Provides a numerical representation of the capacity given - in the description of this package. - :type capacity: ``int`` - - """ - - def __init__(self, id, name, description, price_id, capacity): - self.id = id - self.name = name - self.description = description - self.price_id = price_id - self.capacity = capacity - - def __repr__(self): - return ( - '' % (self.id, self.name, self.description, - self.price_id, self.capacity)) - - -class SoftlayerLBDriver(Driver): - name = 'Softlayer Load Balancing' - website = 'http://www.softlayer.com/' - connectionCls = SoftLayerConnection - - _VALUE_TO_ALGORITHM_MAP = { - 'ROUND_ROBIN': Algorithm.ROUND_ROBIN, - 'LEAST_CONNECTIONS': Algorithm.LEAST_CONNECTIONS, - 'SHORTEST_RESPONSE': Algorithm.SHORTEST_RESPONSE, - 'PERSISTENT_IP': Algorithm.PERSISTENT_IP - } - - _ALGORITHM_TO_VALUE_MAP = reverse_dict(_VALUE_TO_ALGORITHM_MAP) - - def list_balancers(self): - mask = { - 'adcLoadBalancers': { - 'ipAddress': '', - 'loadBalancerHardware': { - 'datacenter': '' - }, - 'virtualServers': { - 'serviceGroups': { - 'routingMethod': '', - 'routingType': '', - 'services': { - 'ipAddress': '' - } - } - } - } - } - - res = self.connection.request( - 'SoftLayer_Account', 'getAdcLoadBalancers', - object_mask=mask).object - - return [self._to_balancer(lb) for lb in res] - - def get_balancer(self, balancer_id): - balancers = self.list_balancers() - balancer = find(balancers, lambda b: b.id == balancer_id) - if not balancer: - raise LibcloudError(value='No balancer found for id: %s' % - balancer_id, driver=self) - return balancer - - def list_protocols(self): - """ - Return a list of supported protocols. - - :rtype: ``list`` of ``str`` - """ - return ['dns', 'ftp', 'http', 'https', 'tcp', 'udp'] - - def balancer_list_members(self, balancer): - lb = self._get_balancer_model(balancer.id) - members = [] - vs = self._locate_service_group(lb, balancer.port) - if vs: - if vs['serviceGroups']: - srvgrp = vs['serviceGroups'][0] - members = [self._to_member(srv, balancer) for - srv in srvgrp['services']] - - return members - - def balancer_attach_member(self, balancer, member): - lb = self._get_balancer_model(balancer.id) - vs = self._locate_service_group(lb, balancer.port) - if not vs: - raise LibcloudError(value='No service_group found for balancer ' - 'port: %s' % balancer.port, driver=self) - - if vs['serviceGroups']: - services = vs['serviceGroups'][0]['services'] - services.append(self._to_service_template(member.ip, - member.port)) - - self.connection.request(lb_service, 'editObject', lb, id=balancer.id) - - return [m for m in balancer.list_members() if m.ip == member.ip][0] - - def balancer_detach_member(self, balancer, member): - svc_lbsrv = 'SoftLayer_Network_Application_Delivery_Controller_'\ - 'LoadBalancer_Service' - - self.connection.request(svc_lbsrv, 'deleteObject', id=member.id) - return True - - def destroy_balancer(self, balancer): - res_billing = self.connection.request(lb_service, 'getBillingItem', - id=balancer.id).object - - self.connection.request('SoftLayer_Billing_Item', 'cancelService', - id=res_billing['id']) - return True - - def ex_list_balancer_packages(self): - """ - Retrieves the available local load balancer packages. - - :rtype: ``list`` of :class:`LBPackage` - """ - mask = { - 'prices': '' - } - res = self.connection.request('SoftLayer_Product_Package', 'getItems', - id=0, object_mask=mask).object - - res_lb_pkgs = [r for r in res if r['description'].find - ('Load Balancer') != -1] - res_lb_pkgs = [r for r in res_lb_pkgs if not r['description']. - startswith('Global')] - - return [self._to_lb_package(r) for r in res_lb_pkgs] - - def ex_place_balancer_order(self, package, location): - """ - Places an order for a local loadbalancer in the specified - location. - - :param package: The package to create the loadbalancer from. - :type package: :class:`LBPackage` - - :param string location: The location (datacenter) to create the - loadbalancer. - :type location: :class:`NodeLocation` - - :return: ``True`` if ex_place_balancer_order was successful. - :rtype: ``bool`` - """ - data = { - 'complexType': 'SoftLayer_Container_Product_Order_Network_' - 'LoadBalancer', - 'quantity': 1, - 'packageId': 0, - 'location': self._get_location(location.id), - 'prices': [{'id': package.price_id}] - } - - self.connection.request('SoftLayer_Product_Order', 'placeOrder', - data) - return True - - def ex_configure_load_balancer(self, balancer, port=80, - protocol='http', - algorithm=DEFAULT_ALGORITHM, - ex_allocation=100): - """ - Configure the loadbalancer by adding it with a front-end port (aka - a service group in the Softlayer loadbalancer model). - - Softlayer loadbalancer may be defined with multiple service - groups (front-end ports) each defined with a unique port number. - - :param balancer: The loadbalancer. - :type balancer: :class:`LoadBalancer` - - :param port: Port of the service group, defaults to 80. - :type port: ``int`` - - :param protocol: Loadbalancer protocol, defaults to http. - :type protocol: ``str`` - - :param algorithm: Load balancing algorithm, defaults to - Algorithm.ROUND_ROBIN - :type algorithm: :class:`Algorithm` - - :param ex_allocation: The percentage of the total connection - allocations to allocate for this group. - :type ex_allocation: ``int`` - - :return: ``True`` if ex_add_service_group was successful. - :rtype: ``bool`` - """ - _types = self._get_routing_types() - _methods = self._get_routing_methods() - - rt = find(_types, lambda t: t['keyname'] == protocol.upper()) - if not rt: - raise LibcloudError(value='Invalid protocol %s' % protocol, - driver=self) - - value = self._algorithm_to_value(algorithm) - meth = find(_methods, lambda m: m['keyname'] == value) - if not meth: - raise LibcloudError(value='Invalid algorithm %s' % algorithm, - driver=self) - - service_group_template = { - 'port': port, - 'allocation': ex_allocation, - 'serviceGroups': [{ - 'routingTypeId': rt['id'], - 'routingMethodId': meth['id'] - }] - } - - lb = self._get_balancer_model(balancer.id) - if len(lb['virtualServers']) > 0: - port = lb['virtualServers'][0]['port'] - raise LibcloudError(value='Loadbalancer already configured with ' - 'a service group (front-end port)' % port, - driver=self) - - lb['virtualServers'].append(service_group_template) - self.connection.request(lb_service, 'editObject', lb, id=balancer.id) - return True - - def _get_balancer_model(self, balancer_id): - """ - Retrieve Softlayer loadbalancer model. - """ - lb_mask = { - 'virtualServers': { - 'serviceGroups': { - 'services': { - 'ipAddress': '', - 'groupReferences': '', - } - } - } - } - - lb_res = self.connection.request(lb_service, 'getObject', - object_mask=lb_mask, id=balancer_id).\ - object - return lb_res - - def _locate_service_group(self, lb, port): - """ - Locate service group with given port. - - Return virtualServers (vs) entry whose port matches the - supplied parameter port. For a negative port, just return - the first vs entry. - None is returned if no match found. - - :param lb: Softlayer loadbalancer model. - :type lb: ``dict`` - - :param port: loadbalancer front-end port. - :type port: ``int`` - - :return: Matched entry in the virtualServers array of the supplied - model. - :rtype: ``dict`` - """ - vs = None - if port < 0: - vs = lb['virtualServers'][0] if lb['virtualServers']\ - else None - else: - vs = find(lb['virtualServers'], lambda v: v['port'] == port) - - return vs - - def _get_routing_types(self): - svc_rtype = 'SoftLayer_Network_Application_Delivery_Controller_'\ - 'LoadBalancer_Routing_Type' - - return self.connection.request(svc_rtype, 'getAllObjects').object - - def _get_routing_methods(self): - svc_rmeth = 'SoftLayer_Network_Application_Delivery_Controller_'\ - 'LoadBalancer_Routing_Method' - - return self.connection.request(svc_rmeth, 'getAllObjects').object - - def _get_location(self, location_id): - res = self.connection.request('SoftLayer_Location_Datacenter', - 'getDatacenters').object - - dcenter = find(res, lambda d: d['name'] == location_id) - if not dcenter: - raise LibcloudError(value='Invalid value %s' % location_id, - driver=self) - return dcenter['id'] - - def _get_ipaddress(self, ip): - svc_ipaddress = 'SoftLayer_Network_Subnet_IpAddress' - - return self.connection.request(svc_ipaddress, 'getByIpAddress', - ip).object - - def _to_lb_package(self, pkg): - try: - price_id = pkg['prices'][0]['id'] - except: - price_id = -1 - - capacity = int(pkg.get('capacity', 0)) - return LBPackage(id=pkg['id'], name=pkg['keyName'], - description=pkg['description'], - price_id=price_id, capacity=capacity) - - def _to_service_template(self, ip, port): - """ - Builds single member entry in Softlayer loadbalancer model - """ - template = { - 'enabled': 1, # enable the service - 'port': port, # back-end port - 'ipAddressId': self._get_ipaddress(ip)['id'], - 'healthChecks': [{ - 'healthCheckTypeId': 21 # default health check - }], - 'groupReferences': [{ - 'weight': 1 - }] - } - - return template - - def _to_balancer(self, lb): - ipaddress = lb['ipAddress']['ipAddress'] - - extra = {} - extra['connection_limit'] = lb['connectionLimit'] - extra['ssl_active'] = lb['sslActiveFlag'] - extra['ssl_enabled'] = lb['sslEnabledFlag'] - extra['ha'] = lb['highAvailabilityFlag'] - extra['datacenter'] = \ - lb['loadBalancerHardware'][0]['datacenter']['name'] - - # In Softlayer, there could be multiple group of members (aka service - # groups), so retrieve the first one - vs = self._locate_service_group(lb, -1) - if vs: - port = vs['port'] - if vs['serviceGroups']: - srvgrp = vs['serviceGroups'][0] - routing_method = srvgrp['routingMethod']['keyname'] - routing_type = srvgrp['routingType']['keyname'] - try: - extra['algorithm'] = self.\ - _value_to_algorithm(routing_method) - except: - pass - extra['protocol'] = routing_type.lower() - - if not vs: - port = -1 - - balancer = LoadBalancer( - id=lb['id'], - name='', - state=State.UNKNOWN, - ip=ipaddress, - port=port, - driver=self.connection.driver, - extra=extra - ) - - return balancer - - def _to_member(self, srv, balancer=None): - svc_id = srv['id'] - ip = srv['ipAddress']['ipAddress'] - port = srv['port'] - - extra = {} - extra['status'] = srv['status'] - extra['enabled'] = srv['enabled'] - return Member(id=svc_id, ip=ip, port=port, balancer=balancer, - extra=extra) diff --git a/libcloud/loadbalancer/providers.py b/libcloud/loadbalancer/providers.py index 5a65402172..c88f59c5e8 100644 --- a/libcloud/loadbalancer/providers.py +++ b/libcloud/loadbalancer/providers.py @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from libcloud.utils.misc import get_driver as get_provider_driver -from libcloud.utils.misc import set_driver as set_provider_driver -from libcloud.loadbalancer.types import Provider +from libcloud.common.providers import get_driver as _get_provider_driver +from libcloud.common.providers import set_driver as _set_provider_driver +from libcloud.loadbalancer.types import OLD_CONSTANT_TO_NEW_MAPPING, Provider __all__ = [ "Provider", @@ -24,34 +24,37 @@ ] DRIVERS = { - Provider.RACKSPACE: - ('libcloud.loadbalancer.drivers.rackspace', 'RackspaceLBDriver'), - Provider.GOGRID: - ('libcloud.loadbalancer.drivers.gogrid', 'GoGridLBDriver'), - Provider.NINEFOLD: - ('libcloud.loadbalancer.drivers.ninefold', 'NinefoldLBDriver'), - Provider.BRIGHTBOX: - ('libcloud.loadbalancer.drivers.brightbox', 'BrightboxLBDriver'), - Provider.ELB: - ('libcloud.loadbalancer.drivers.elb', 'ElasticLBDriver'), - Provider.CLOUDSTACK: - ('libcloud.loadbalancer.drivers.cloudstack', 'CloudStackLBDriver'), - Provider.GCE: - ('libcloud.loadbalancer.drivers.gce', 'GCELBDriver'), - Provider.SOFTLAYER: - ('libcloud.loadbalancer.drivers.softlayer', 'SoftlayerLBDriver'), - - # Deprecated - Provider.RACKSPACE_US: - ('libcloud.loadbalancer.drivers.rackspace', 'RackspaceLBDriver'), - Provider.RACKSPACE_UK: - ('libcloud.loadbalancer.drivers.rackspace', 'RackspaceUKLBDriver'), + Provider.RACKSPACE: ( + "libcloud.loadbalancer.drivers.rackspace", + "RackspaceLBDriver", + ), + Provider.NINEFOLD: ("libcloud.loadbalancer.drivers.ninefold", "NinefoldLBDriver"), + Provider.BRIGHTBOX: ( + "libcloud.loadbalancer.drivers.brightbox", + "BrightboxLBDriver", + ), + Provider.ELB: ("libcloud.loadbalancer.drivers.elb", "ElasticLBDriver"), + Provider.ALB: ("libcloud.loadbalancer.drivers.alb", "ApplicationLBDriver"), + Provider.CLOUDSTACK: ( + "libcloud.loadbalancer.drivers.cloudstack", + "CloudStackLBDriver", + ), + Provider.GCE: ("libcloud.loadbalancer.drivers.gce", "GCELBDriver"), + Provider.DIMENSIONDATA: ( + "libcloud.loadbalancer.drivers.dimensiondata", + "DimensionDataLBDriver", + ), + Provider.ALIYUN_SLB: ("libcloud.loadbalancer.drivers.slb", "SLBDriver"), + Provider.NTTCIS: ("libcloud.loadbalancer.drivers.nttcis", "NttCisLBDriver"), } def get_driver(provider): - return get_provider_driver(DRIVERS, provider) + deprecated_constants = OLD_CONSTANT_TO_NEW_MAPPING + return _get_provider_driver( + drivers=DRIVERS, provider=provider, deprecated_constants=deprecated_constants + ) def set_driver(provider, module, klass): - return set_provider_driver(DRIVERS, provider, module, klass) + return _set_provider_driver(drivers=DRIVERS, provider=provider, module=module, klass=klass) diff --git a/libcloud/loadbalancer/types.py b/libcloud/loadbalancer/types.py index 8ae82e92b9..e8b46b2720 100644 --- a/libcloud/loadbalancer/types.py +++ b/libcloud/loadbalancer/types.py @@ -18,6 +18,7 @@ "State", "LibcloudLBError", "LibcloudLBImmutableError", + "OLD_CONSTANT_TO_NEW_MAPPING", ] from libcloud.common.types import LibcloudError @@ -31,22 +32,39 @@ class LibcloudLBImmutableError(LibcloudLBError): pass -class Provider(object): - RACKSPACE = 'rackspace' - GOGRID = 'gogrid' - NINEFOLD = 'ninefold' - BRIGHTBOX = 'brightbox' - ELB = 'elb' - CLOUDSTACK = 'cloudstack' - GCE = 'gce' - SOFTLAYER = 'softlayer' +class Provider: + """ + Defines for each of the supported providers + + Non-Dummy drivers are sorted in alphabetical order. Please preserve this + ordering when adding new drivers. + + :cvar ALIYUN_SLB: Aliyun SLB loadbalancer driver + """ + + ALB = "alb" + ALIYUN_SLB = "aliyun_slb" + BRIGHTBOX = "brightbox" + CLOUDSTACK = "cloudstack" + DIMENSIONDATA = "dimensiondata" + ELB = "elb" + GCE = "gce" + NINEFOLD = "ninefold" + NTTCIS = "nttcis" + RACKSPACE = "rackspace" # Deprecated - RACKSPACE_US = 'rackspace_us' - RACKSPACE_UK = 'rackspace_uk' + RACKSPACE_US = "rackspace_us" + RACKSPACE_UK = "rackspace_uk" + +OLD_CONSTANT_TO_NEW_MAPPING = { + Provider.RACKSPACE_US: Provider.RACKSPACE, + Provider.RACKSPACE_UK: Provider.RACKSPACE, +} -class State(object): + +class State: """ Standard states for a loadbalancer @@ -61,11 +79,12 @@ class State(object): DELETED = 4 -class MemberCondition(object): +class MemberCondition: """ Each member of a load balancer can have an associated condition which determines its role within the load balancer. """ + ENABLED = 0 DISABLED = 1 DRAINING = 2 diff --git a/libcloud/pricing.py b/libcloud/pricing.py index cc2506f133..abc464cc1f 100644 --- a/libcloud/pricing.py +++ b/libcloud/pricing.py @@ -12,61 +12,78 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement """ A class which handles loading the pricing files. """ +import re import os.path +from typing import Dict, Union, Optional from os.path import join as pjoin try: import simplejson as json - JSONDecodeError = json.JSONDecodeError + + try: + JSONDecodeError = json.JSONDecodeError + except AttributeError: + # simplejson < 2.1.0 does not have the JSONDecodeError exception class + JSONDecodeError = ValueError # type: ignore except ImportError: - import json - JSONDecodeError = ValueError + import json # type: ignore -from libcloud.utils.connection import get_response_object + JSONDecodeError = ValueError # type: ignore __all__ = [ - 'get_pricing', - 'get_size_price', - 'set_pricing', - 'clear_pricing_data', - 'download_pricing_file' + "get_pricing", + "get_size_price", + "get_image_price", + "set_pricing", + "clear_pricing_data", + "download_pricing_file", ] -# Default URL to the pricing file -DEFAULT_FILE_URL = 'https://git-wip-us.apache.org/repos/asf?p=libcloud.git;a=blob_plain;f=libcloud/data/pricing.json' # NOQA +# Default URL to the pricing file in a git repo +DEFAULT_FILE_URL_GIT = "https://git.apache.org/repos/asf?p=libcloud.git;a=blob_plain;f=libcloud/data/pricing.json" # NOQA + +DEFAULT_FILE_URL_S3_BUCKET = "https://libcloud-pricing-data.s3.amazonaws.com/pricing.json" # NOQA CURRENT_DIRECTORY = os.path.dirname(os.path.abspath(__file__)) -DEFAULT_PRICING_FILE_PATH = pjoin(CURRENT_DIRECTORY, 'data/pricing.json') -CUSTOM_PRICING_FILE_PATH = os.path.expanduser('~/.libcloud/pricing.json') +DEFAULT_PRICING_FILE_PATH = pjoin(CURRENT_DIRECTORY, "data/pricing.json") +CUSTOM_PRICING_FILE_PATH = os.path.expanduser("~/.libcloud/pricing.json") # Pricing data cache -PRICING_DATA = { - 'compute': {}, - 'storage': {} -} +PRICING_DATA = {"compute": {}, "storage": {}} # type: Dict[str, Dict] + +VALID_PRICING_DRIVER_TYPES = ["compute", "storage"] -VALID_PRICING_DRIVER_TYPES = ['compute', 'storage'] +# Set this to True to cache all the pricing data in memory instead of just the +# one for the drivers which are used +CACHE_ALL_PRICING_DATA = False def get_pricing_file_path(file_path=None): - if os.path.exists(CUSTOM_PRICING_FILE_PATH) and \ - os.path.isfile(CUSTOM_PRICING_FILE_PATH): + # type: (Optional[str]) -> str + if os.path.exists(CUSTOM_PRICING_FILE_PATH) and os.path.isfile(CUSTOM_PRICING_FILE_PATH): # Custom pricing file is available, use it return CUSTOM_PRICING_FILE_PATH return DEFAULT_PRICING_FILE_PATH -def get_pricing(driver_type, driver_name, pricing_file_path=None): +def get_pricing(driver_type, driver_name, pricing_file_path=None, cache_all=False): + # type: (str, str, Optional[str], bool) -> Optional[dict] """ Return pricing for the provided driver. + NOTE: This method will also cache data for the requested driver + memory. + + We intentionally only cache data for the requested driver and not all the + pricing data since the whole pricing data is quite large (~2 MB). This + way we avoid unnecessary memory overhead. + :type driver_type: ``str`` :param driver_type: Driver type ('compute' or 'storage') @@ -77,12 +94,18 @@ def get_pricing(driver_type, driver_name, pricing_file_path=None): :param pricing_file_path: Custom path to a price file. If not provided it uses a default path. + :type cache_all: ``bool`` + :param cache_all: True to cache pricing data in memory for all the drivers + and not just for the requested one. + :rtype: ``dict`` :return: Dictionary with pricing where a key name is size ID and the value is a price. """ + cache_all = cache_all or CACHE_ALL_PRICING_DATA + if driver_type not in VALID_PRICING_DRIVER_TYPES: - raise AttributeError('Invalid driver type: %s', driver_type) + raise AttributeError("Invalid driver type: %s", driver_type) if driver_name in PRICING_DATA[driver_type]: return PRICING_DATA[driver_type][driver_name] @@ -94,18 +117,29 @@ def get_pricing(driver_type, driver_name, pricing_file_path=None): content = fp.read() pricing_data = json.loads(content) - size_pricing = pricing_data[driver_type][driver_name] + driver_pricing = pricing_data[driver_type][driver_name] + + # NOTE: We only cache prices in memory for the the requested drivers. + # This way we avoid storing massive pricing data for all the drivers in + # memory + + if cache_all: + for driver_type in VALID_PRICING_DRIVER_TYPES: + # pylint: disable=maybe-no-member + pricing = pricing_data.get(driver_type, None) + + if not pricing: + continue - for driver_type in VALID_PRICING_DRIVER_TYPES: - # pylint: disable=maybe-no-member - pricing = pricing_data.get(driver_type, None) - if pricing: PRICING_DATA[driver_type] = pricing + else: + set_pricing(driver_type=driver_type, driver_name=driver_name, pricing=driver_pricing) - return size_pricing + return driver_pricing def set_pricing(driver_type, driver_name, pricing): + # type: (str, str, dict) -> None """ Populate the driver pricing dictionary. @@ -122,7 +156,8 @@ def set_pricing(driver_type, driver_name, pricing): PRICING_DATA[driver_type][driver_name] = pricing -def get_size_price(driver_type, driver_name, size_id): +def get_size_price(driver_type, driver_name, size_id, region=None): + # type: (str, str, Union[str,int], Optional[str]) -> Optional[float] """ Return price for the provided size. @@ -140,19 +175,125 @@ def get_size_price(driver_type, driver_name, size_id): :return: Size price. """ pricing = get_pricing(driver_type=driver_type, driver_name=driver_name) - price = float(pricing[size_id]) + assert pricing is not None + + price = None # Type: Optional[float] + + try: + if region is None: + price = float(pricing[size_id]) + else: + price = float(pricing[size_id][region]) + except KeyError: + # Price not available + price = None + return price +def get_image_price(driver_name, image_name, size_name=None, cores=1): + # for now only images of GCE have pricing data + if driver_name == "gce_images": + return _get_gce_image_price(image_name=image_name, size_name=size_name, cores=cores) + + return 0 + + +def _get_gce_image_price(image_name, size_name, cores=1): + """ + Return price per hour for an gce image. + Price depends on the size of the VM. + + :type image_name: ``str`` + :param image_name: GCE image full name. + Can be found from GCENodeImage.name + + :type size_name: ``str`` + :param size_name: Size name of the machine running the image. + Can be found from GCENodeSize.name + + :type cores: ``int`` + :param cores: The number of the CPUs the machine running the image has. + Can be found from GCENodeSize.extra['guestCpus'] + + :rtype: ``float`` + :return: Image price + """ + + # helper function to get image family for gce images + def _get_gce_image_family(image_name): + image_family = None + + # Decide if the image is a premium image + if "sql" in image_name: + image_family = "SQL Server" + elif "windows" in image_name: + image_family = "Windows Server" + elif "rhel" in image_name and "sap" in image_name: + image_family = "RHEL with Update Services" + elif "sles" in image_name and "sap" in image_name: + image_family = "SLES for SAP" + elif "rhel" in image_name: + image_family = "RHEL" + elif "sles" in image_name: + image_family = "SLES" + return image_family + + image_family = _get_gce_image_family(image_name) + # if there is no premium image return 0 + if not image_family: + return 0 + + pricing = get_pricing(driver_type="compute", driver_name="gce_images") + try: + price_dict = pricing[image_family] + except KeyError: + # Price not available + return 0 + + size_type = "any" + if "f1" in size_name: + size_type = "f1" + elif "g1" in size_name: + size_type = "g1" + + price_dict_keys = price_dict.keys() + + # search keys to find the one we want + for key in price_dict_keys: + if key == "description": + continue + # eg. 4vcpu or less + if re.search(".{1}vcpu or less", key) and cores <= int(key[0]): + return float(price_dict[key]["price"]) + # eg. 1-2vcpu + if re.search(".{1}-.{1}vcpu", key) and str(cores) in key: + return float(price_dict[key]["price"]) + # eg 6vcpu or more + if re.search(".{1}vcpu or more", key) and cores >= int(key[0]): + return float(price_dict[key]["price"]) + if key in {"standard", "enterprise", "web"} and key in image_name: + return float(price_dict[key]["price"]) + if key in {"f1", "g1"} and size_type == key: + return float(price_dict[key]["price"]) + elif key == "any": + price = float(price_dict[key]["price"]) + return price * cores if "sles" not in image_name else price + # fallback + return 0 + + def invalidate_pricing_cache(): + # type: () -> None """ Invalidate pricing cache for all the drivers. """ - PRICING_DATA['compute'] = {} - PRICING_DATA['storage'] = {} + PRICING_DATA["compute"] = {} + PRICING_DATA["storage"] = {} def clear_pricing_data(): + # type: () -> None """ Invalidate pricing cache for all the drivers. @@ -163,6 +304,7 @@ def clear_pricing_data(): def invalidate_module_pricing_cache(driver_type, driver_name): + # type: (str, str) -> None """ Invalidate the cache for the specified driver. @@ -176,8 +318,8 @@ def invalidate_module_pricing_cache(driver_type, driver_name): del PRICING_DATA[driver_type][driver_name] -def download_pricing_file(file_url=DEFAULT_FILE_URL, - file_path=CUSTOM_PRICING_FILE_PATH): +def download_pricing_file(file_url=DEFAULT_FILE_URL_S3_BUCKET, file_path=CUSTOM_PRICING_FILE_PATH): + # type: (str, str) -> None """ Download pricing file from the file_url and save it to file_path. @@ -187,17 +329,17 @@ def download_pricing_file(file_url=DEFAULT_FILE_URL, :type file_path: ``str`` :param file_path: Path where a download pricing file will be saved. """ + from libcloud.utils.connection import get_response_object + dir_name = os.path.dirname(file_path) if not os.path.exists(dir_name): # Verify a valid path is provided - msg = ('Can\'t write to %s, directory %s, doesn\'t exist' % - (file_path, dir_name)) + msg = "Can't write to {}, directory {}, doesn't exist".format(file_path, dir_name) raise ValueError(msg) if os.path.exists(file_path) and os.path.isdir(file_path): - msg = ('Can\'t write to %s file path because it\'s a' - ' directory' % (file_path)) + msg = "Can't write to %s file path because it's a" " directory" % (file_path) raise ValueError(msg) response = get_response_object(file_url) @@ -207,14 +349,14 @@ def download_pricing_file(file_url=DEFAULT_FILE_URL, try: data = json.loads(body) except JSONDecodeError: - msg = 'Provided URL doesn\'t contain valid pricing data' + msg = "Provided URL doesn't contain valid pricing data" raise Exception(msg) # pylint: disable=maybe-no-member - if not data.get('updated', None): - msg = 'Provided URL doesn\'t contain valid pricing data' + if not data.get("updated", None): + msg = "Provided URL doesn't contain valid pricing data" raise Exception(msg) # No need to stream it since file is small - with open(file_path, 'w') as file_handle: + with open(file_path, "w") as file_handle: file_handle.write(body) diff --git a/libcloud/py.typed b/libcloud/py.typed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/security.py b/libcloud/security.py index 4d024db58a..cf812f3884 100644 --- a/libcloud/security.py +++ b/libcloud/security.py @@ -20,70 +20,61 @@ libcloud.security.VERIFY_SSL_CERT = True # Optional. - libcloud.security.CA_CERTS_PATH.append('/path/to/cacert.txt') + libcloud.security.CA_CERTS_PATH = '/path/to/certfile' """ import os -import ssl -__all__ = [ - 'VERIFY_SSL_CERT', - 'SSL_VERSION', - 'CA_CERTS_PATH' -] +__all__ = ["VERIFY_SSL_CERT", "CA_CERTS_PATH"] VERIFY_SSL_CERT = True -SSL_VERSION = ssl.PROTOCOL_TLSv1 +# True to use certifi CA bundle path when certifi library is available +USE_CERTIFI = os.environ.get("LIBCLOUD_SSL_USE_CERTIFI", True) +USE_CERTIFI = str(USE_CERTIFI).lower() in ["true", "1"] # File containing one or more PEM-encoded CA certificates # concatenated together. -CA_CERTS_PATH = [ - # centos/fedora: openssl - '/etc/pki/tls/certs/ca-bundle.crt', +CA_CERTS_PATH = None - # debian/ubuntu/arch/gentoo: ca-certificates - '/etc/ssl/certs/ca-certificates.crt', +# Insert certifi CA bundle path to the front of Libcloud CA bundle search +# path if certifi is available +try: + import certifi +except ImportError: + has_certifi = False +else: + has_certifi = True - # freebsd: ca_root_nss - '/usr/local/share/certs/ca-root-nss.crt', - - # macports: curl-ca-bundle - '/opt/local/share/curl/curl-ca-bundle.crt', - - # homebrew: openssl - '/usr/local/etc/openssl/cert.pem', - - # homebrew: curl-ca-bundle (backward compatibility) - '/usr/local/opt/curl-ca-bundle/share/ca-bundle.crt', -] +if has_certifi and USE_CERTIFI: + certifi_ca_bundle_path = certifi.where() + CA_CERTS_PATH = certifi_ca_bundle_path # Allow user to explicitly specify which CA bundle to use, using an environment # variable -environment_cert_file = os.getenv('SSL_CERT_FILE', None) +environment_cert_file = os.getenv("SSL_CERT_FILE", None) if environment_cert_file is not None: # Make sure the file exists if not os.path.exists(environment_cert_file): - raise ValueError('Certificate file %s doesn\'t exist' % - (environment_cert_file)) + raise ValueError("Certificate file %s doesn't exist" % (environment_cert_file)) if not os.path.isfile(environment_cert_file): - raise ValueError('Certificate file can\'t be a directory') + raise ValueError("Certificate file can't be a directory") # If a provided file exists we ignore other common paths because we # don't want to fall-back to a potentially less restrictive bundle - CA_CERTS_PATH = [environment_cert_file] + CA_CERTS_PATH = environment_cert_file CA_CERTS_UNAVAILABLE_ERROR_MSG = ( - 'No CA Certificates were found in CA_CERTS_PATH. For information on ' - 'how to get required certificate files, please visit ' - 'https://libcloud.readthedocs.org/en/latest/other/' - 'ssl-certificate-validation.html' + "No CA Certificates were found in CA_CERTS_PATH. For information on " + "how to get required certificate files, please visit " + "https://libcloud.readthedocs.org/en/latest/other/" + "ssl-certificate-validation.html" ) VERIFY_SSL_DISABLED_MSG = ( - 'SSL certificate verification is disabled, this can pose a ' - 'security risk. For more information how to enable the SSL ' - 'certificate verification, please visit the libcloud ' - 'documentation.' + "SSL certificate verification is disabled, this can pose a " + "security risk. For more information how to enable the SSL " + "certificate verification, please visit the libcloud " + "documentation." ) diff --git a/libcloud/storage/__init__.py b/libcloud/storage/__init__.py index f73ddf07a7..c612ebf319 100644 --- a/libcloud/storage/__init__.py +++ b/libcloud/storage/__init__.py @@ -1,3 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Module for working with Storage """ diff --git a/libcloud/storage/base.py b/libcloud/storage/base.py index ead1545ae3..0c872bb830 100644 --- a/libcloud/storage/base.py +++ b/libcloud/storage/base.py @@ -18,44 +18,44 @@ """ # Backward compatibility for Python 2.5 -from __future__ import with_statement -import os.path # pylint: disable-msg=W0404 +import errno import hashlib +import os.path # pylint: disable-msg=W0404 +import warnings +from typing import Dict, List, Type, Iterator, Optional from os.path import join as pjoin -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import next -from libcloud.utils.py3 import b - import libcloud.utils.files +from libcloud.utils.py3 import b, httplib +from libcloud.common.base import BaseDriver, Connection, ConnectionUserAndKey from libcloud.common.types import LibcloudError -from libcloud.common.base import ConnectionUserAndKey, BaseDriver from libcloud.storage.types import ObjectDoesNotExistError -__all__ = [ - 'Object', - 'Container', - 'StorageDriver', - - 'CHUNK_SIZE', - 'DEFAULT_CONTENT_TYPE' -] +__all__ = ["Object", "Container", "StorageDriver", "CHUNK_SIZE", "DEFAULT_CONTENT_TYPE"] CHUNK_SIZE = 8096 # Default Content-Type which is sent when uploading an object if one is not # supplied and can't be detected when using non-strict mode. -DEFAULT_CONTENT_TYPE = 'application/octet-stream' +DEFAULT_CONTENT_TYPE = "application/octet-stream" -class Object(object): +class Object: """ Represents an object (BLOB). """ - def __init__(self, name, size, hash, extra, meta_data, container, - driver): + def __init__( + self, + name, # type: str + size, # type: int + hash, # type: str + extra, # type: dict + meta_data, # type: dict + container, # type: Container + driver, # type: StorageDriver + ): """ :param name: Object name (must be unique per container). :type name: ``str`` @@ -67,7 +67,7 @@ def __init__(self, name, size, hash, extra, meta_data, container, :type hash: ``str`` :param container: Object container. - :type container: :class:`Container` + :type container: :class:`libcloud.storage.base.Container` :param extra: Extra attributes. :type extra: ``dict`` @@ -76,7 +76,7 @@ def __init__(self, name, size, hash, extra, meta_data, container, :type meta_data: ``dict`` :param driver: StorageDriver instance. - :type driver: :class:`StorageDriver` + :type driver: :class:`libcloud.storage.base.StorageDriver` """ self.name = name @@ -88,34 +88,77 @@ def __init__(self, name, size, hash, extra, meta_data, container, self.driver = driver def get_cdn_url(self): + # type: () -> str return self.driver.get_object_cdn_url(obj=self) - def enable_cdn(self, **kwargs): - return self.driver.enable_object_cdn(obj=self, **kwargs) + def enable_cdn(self): + # type: () -> bool + return self.driver.enable_object_cdn(obj=self) - def download(self, destination_path, overwrite_existing=False, - delete_on_failure=True): - return self.driver.download_object(self, destination_path, - overwrite_existing, - delete_on_failure) + def download(self, destination_path, overwrite_existing=False, delete_on_failure=True): + # type: (str, bool, bool) -> bool + return self.driver.download_object( + obj=self, + destination_path=destination_path, + overwrite_existing=overwrite_existing, + delete_on_failure=delete_on_failure, + ) def as_stream(self, chunk_size=None): - return self.driver.download_object_as_stream(self, chunk_size) + # type: (Optional[int]) -> Iterator[bytes] + return self.driver.download_object_as_stream(obj=self, chunk_size=chunk_size) + + def download_range( + self, + destination_path, + start_bytes, + end_bytes=None, + overwrite_existing=False, + delete_on_failure=True, + ): + # type: (str, int, Optional[int], bool, bool) -> bool + return self.driver.download_object_range( + obj=self, + destination_path=destination_path, + start_bytes=start_bytes, + end_bytes=end_bytes, + overwrite_existing=overwrite_existing, + delete_on_failure=delete_on_failure, + ) + + def range_as_stream(self, start_bytes, end_bytes=None, chunk_size=None): + # type: (int, Optional[int], Optional[int]) -> Iterator[bytes] + return self.driver.download_object_range_as_stream( + obj=self, + start_bytes=start_bytes, + end_bytes=end_bytes, + chunk_size=chunk_size, + ) def delete(self): + # type: () -> bool return self.driver.delete_object(self) def __repr__(self): - return ('' % - (self.name, self.size, self.hash, self.driver.name)) + return "".format( + self.name, + self.size, + self.hash, + self.driver.name, + ) -class Container(object): +class Container: """ Represents a container (bucket) which can hold multiple objects. """ - def __init__(self, name, extra, driver): + def __init__( + self, + name, # type: str + extra, # type: dict + driver, # type: StorageDriver + ): """ :param name: Container name (must be unique). :type name: ``str`` @@ -124,56 +167,104 @@ def __init__(self, name, extra, driver): :type extra: ``dict`` :param driver: StorageDriver instance. - :type driver: :class:`StorageDriver` + :type driver: :class:`libcloud.storage.base.StorageDriver` """ self.name = name self.extra = extra or {} self.driver = driver - def iterate_objects(self): - return self.driver.iterate_container_objects(container=self) + def iterate_objects(self, prefix=None, ex_prefix=None): + # type: (Optional[str], Optional[str]) -> Iterator[Object] + return self.driver.iterate_container_objects( + container=self, prefix=prefix, ex_prefix=ex_prefix + ) - def list_objects(self): - return self.driver.list_container_objects(container=self) + def list_objects(self, prefix=None, ex_prefix=None): + # type: (Optional[str], Optional[str]) -> List[Object] + return self.driver.list_container_objects( + container=self, prefix=prefix, ex_prefix=ex_prefix + ) def get_cdn_url(self): + # type: () -> str return self.driver.get_container_cdn_url(container=self) - def enable_cdn(self, **kwargs): - return self.driver.enable_container_cdn(container=self, **kwargs) + def enable_cdn(self): + # type: () -> bool + return self.driver.enable_container_cdn(container=self) def get_object(self, object_name): - return self.driver.get_object(container_name=self.name, - object_name=object_name) + # type: (str) -> Object + return self.driver.get_object(container_name=self.name, object_name=object_name) - def upload_object(self, file_path, object_name, extra=None, **kwargs): + def upload_object(self, file_path, object_name, extra=None, verify_hash=True, headers=None): + # type: (str, str, Optional[dict], bool, Optional[Dict[str, str]]) -> Object # noqa: E501 return self.driver.upload_object( - file_path, self, object_name, extra=extra, **kwargs) - - def upload_object_via_stream(self, iterator, object_name, extra=None, - **kwargs): + file_path, + self, + object_name, + extra=extra, + verify_hash=verify_hash, + headers=headers, + ) + + def upload_object_via_stream(self, iterator, object_name, extra=None, headers=None): + # type: (Iterator[bytes], str, Optional[dict], Optional[Dict[str, str]]) -> Object # noqa: E501 return self.driver.upload_object_via_stream( - iterator, self, object_name, extra=extra, **kwargs) + iterator, self, object_name, extra=extra, headers=headers + ) - def download_object(self, obj, destination_path, overwrite_existing=False, - delete_on_failure=True): + def download_object( + self, obj, destination_path, overwrite_existing=False, delete_on_failure=True + ): + # type: (Object, str, bool, bool) -> bool return self.driver.download_object( - obj, destination_path, overwrite_existing=overwrite_existing, - delete_on_failure=delete_on_failure) + obj, + destination_path, + overwrite_existing=overwrite_existing, + delete_on_failure=delete_on_failure, + ) def download_object_as_stream(self, obj, chunk_size=None): + # type: (Object, Optional[int]) -> Iterator[bytes] return self.driver.download_object_as_stream(obj, chunk_size) + def download_object_range( + self, + obj, + destination_path, + start_bytes, + end_bytes=None, + overwrite_existing=False, + delete_on_failure=True, + ): + # type: (Object, str, int, Optional[int], bool, bool) -> bool + return self.driver.download_object_range( + obj=obj, + destination_path=destination_path, + start_bytes=start_bytes, + end_bytes=end_bytes, + overwrite_existing=overwrite_existing, + delete_on_failure=delete_on_failure, + ) + + def download_object_range_as_stream(self, obj, start_bytes, end_bytes=None, chunk_size=None): + # type: (Object, int, Optional[int], Optional[int]) -> Iterator[bytes] + return self.driver.download_object_range_as_stream( + obj=obj, start_bytes=start_bytes, end_bytes=end_bytes, chunk_size=chunk_size + ) + def delete_object(self, obj): + # type: (Object) -> bool return self.driver.delete_object(obj) def delete(self): + # type: () -> bool return self.driver.delete_container(self) def __repr__(self): - return ('' - % (self.name, self.driver.name)) + return "".format(self.name, self.driver.name) class StorageDriver(BaseDriver): @@ -181,32 +272,27 @@ class StorageDriver(BaseDriver): A base StorageDriver to derive from. """ - connectionCls = ConnectionUserAndKey - name = None - hash_type = 'md5' - supports_chunked_encoding = False + connectionCls = ConnectionUserAndKey # type: Type[Connection] + name = None # type: str + hash_type = "md5" # type: str + supports_chunked_encoding = False # type: bool # When strict mode is used, exception will be thrown if no content type is # provided and none can be detected when uploading an object - strict_mode = False - - def __init__(self, key, secret=None, secure=True, host=None, port=None, - **kwargs): - super(StorageDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, **kwargs) + strict_mode = False # type: bool def iterate_containers(self): + # type: () -> Iterator[Container] """ - Return a generator of containers for the given account + Return a iterator of containers for the given account - :return: A generator of Container instances. - :rtype: ``generator`` of :class:`Container` + :return: A iterator of Container instances. + :rtype: ``iterator`` of :class:`libcloud.storage.base.Container` """ - raise NotImplementedError( - 'iterate_containers not implemented for this driver') + raise NotImplementedError("iterate_containers not implemented for this driver") def list_containers(self): + # type: () -> List[Container] """ Return a list of containers. @@ -215,32 +301,69 @@ def list_containers(self): """ return list(self.iterate_containers()) - def iterate_container_objects(self, container): + def iterate_container_objects(self, container, prefix=None, ex_prefix=None): + # type: (Container, Optional[str], Optional[str]) -> Iterator[Object] """ - Return a generator of objects for the given container. + Return a iterator of objects for the given container. :param container: Container instance - :type container: :class:`Container` + :type container: :class:`libcloud.storage.base.Container` + + :param prefix: Filter objects starting with a prefix. + :type prefix: ``str`` + + :param ex_prefix: (Deprecated.) Filter objects starting with a prefix. + :type ex_prefix: ``str`` - :return: A generator of Object instances. - :rtype: ``generator`` of :class:`Object` + :return: A iterator of Object instances. + :rtype: ``iterator`` of :class:`libcloud.storage.base.Object` """ - raise NotImplementedError( - 'iterate_container_objects not implemented for this driver') + raise NotImplementedError("iterate_container_objects not implemented for this driver") - def list_container_objects(self, container): + def list_container_objects(self, container, prefix=None, ex_prefix=None): + # type: (Container, Optional[str], Optional[str]) -> List[Object] """ Return a list of objects for the given container. :param container: Container instance. - :type container: :class:`Container` + :type container: :class:`libcloud.storage.base.Container` + + :param prefix: Filter objects starting with a prefix. + :type prefix: ``str`` + + :param ex_prefix: (Deprecated.) Filter objects starting with a prefix. + :type ex_prefix: ``str`` :return: A list of Object instances. - :rtype: ``list`` of :class:`Object` + :rtype: ``list`` of :class:`libcloud.storage.base.Object` """ - return list(self.iterate_container_objects(container)) + return list(self.iterate_container_objects(container, prefix=prefix, ex_prefix=ex_prefix)) + + def _normalize_prefix_argument(self, prefix, ex_prefix): + if ex_prefix: + warnings.warn( + "The ``ex_prefix`` argument is deprecated - " + "please update code to use ``prefix``", + DeprecationWarning, + ) + return ex_prefix + + return prefix + + def _filter_listed_container_objects(self, objects, prefix): + if prefix is not None: + warnings.warn( + "Driver %s does not implement native object " + "filtering; falling back to filtering the full " + "object stream." % self.__class__.__name__ + ) + + for obj in objects: + if prefix is None or obj.name.startswith(prefix): + yield obj def get_container(self, container_name): + # type: (str) -> Container """ Return a container instance. @@ -248,25 +371,25 @@ def get_container(self, container_name): :type container_name: ``str`` :return: :class:`Container` instance. - :rtype: :class:`Container` + :rtype: :class:`libcloud.storage.base.Container` """ - raise NotImplementedError( - 'get_object not implemented for this driver') + raise NotImplementedError("get_object not implemented for this driver") def get_container_cdn_url(self, container): + # type: (Container) -> str """ Return a container CDN URL. :param container: Container instance - :type container: :class:`Container` + :type container: :class:`libcloud.storage.base.Container` :return: A CDN URL for this container. :rtype: ``str`` """ - raise NotImplementedError( - 'get_container_cdn_url not implemented for this driver') + raise NotImplementedError("get_container_cdn_url not implemented for this driver") def get_object(self, container_name, object_name): + # type: (str, str) -> Object """ Return an object instance. @@ -277,55 +400,56 @@ def get_object(self, container_name, object_name): :type object_name: ``str`` :return: :class:`Object` instance. - :rtype: :class:`Object` + :rtype: :class:`libcloud.storage.base.Object` """ - raise NotImplementedError( - 'get_object not implemented for this driver') + raise NotImplementedError("get_object not implemented for this driver") def get_object_cdn_url(self, obj): + # type: (Object) -> str """ Return an object CDN URL. :param obj: Object instance - :type obj: :class:`Object` + :type obj: :class:`libcloud.storage.base.Object` :return: A CDN URL for this object. :rtype: ``str`` """ - raise NotImplementedError( - 'get_object_cdn_url not implemented for this driver') + raise NotImplementedError("get_object_cdn_url not implemented for this driver") def enable_container_cdn(self, container): + # type: (Container) -> bool """ Enable container CDN. :param container: Container instance - :type container: :class:`Container` + :type container: :class:`libcloud.storage.base.Container` :rtype: ``bool`` """ - raise NotImplementedError( - 'enable_container_cdn not implemented for this driver') + raise NotImplementedError("enable_container_cdn not implemented for this driver") def enable_object_cdn(self, obj): + # type: (Object) -> bool """ Enable object CDN. :param obj: Object instance - :type obj: :class:`Object` + :type obj: :class:`libcloud.storage.base.Object` :rtype: ``bool`` """ - raise NotImplementedError( - 'enable_object_cdn not implemented for this driver') + raise NotImplementedError("enable_object_cdn not implemented for this driver") - def download_object(self, obj, destination_path, overwrite_existing=False, - delete_on_failure=True): + def download_object( + self, obj, destination_path, overwrite_existing=False, delete_on_failure=True + ): + # type: (Object, str, bool, bool) -> bool """ Download an object to the specified destination path. :param obj: Object instance. - :type obj: :class:`Object` + :type obj: :class:`libcloud.storage.base.Object` :param destination_path: Full path to a file or a directory where the incoming file will be saved. @@ -344,24 +468,104 @@ def download_object(self, obj, destination_path, overwrite_existing=False, otherwise. :rtype: ``bool`` """ - raise NotImplementedError( - 'download_object not implemented for this driver') + raise NotImplementedError("download_object not implemented for this driver") def download_object_as_stream(self, obj, chunk_size=None): + # type: (Object, Optional[int]) -> Iterator[bytes] """ - Return a generator which yields object data. + Return a iterator which yields object data. :param obj: Object instance - :type obj: :class:`Object` + :type obj: :class:`libcloud.storage.base.Object` + + :param chunk_size: Optional chunk size (in bytes). + :type chunk_size: ``int`` + + :rtype: ``iterator`` of ``bytes`` + """ + raise NotImplementedError("download_object_as_stream not implemented for this driver") + + def download_object_range( + self, + obj, + destination_path, + start_bytes, + end_bytes=None, + overwrite_existing=False, + delete_on_failure=True, + ): + # type: (Object, str, int, Optional[int], bool, bool) -> bool + """ + Download part of an object. + + :param obj: Object instance. + :type obj: :class:`libcloud.storage.base.Object` + + :param destination_path: Full path to a file or a directory where the + incoming file will be saved. + :type destination_path: ``str`` + + :param start_bytes: Start byte offset (inclusive) for the range + download. Offset is 0 index based so the first + byte in file file is "0". + :type start_bytes: ``int`` + + :param end_bytes: End byte offset (non-inclusive) for the range + download. If not provided, it will default to the + end of the file. + :type end_bytes: ``int`` + + :param overwrite_existing: True to overwrite an existing file, + defaults to False. + :type overwrite_existing: ``bool`` + + :param delete_on_failure: True to delete a partially downloaded file if + the download was not successful (hash + mismatch / file size). + :type delete_on_failure: ``bool`` + + :return: True if an object has been successfully downloaded, False + otherwise. + :rtype: ``bool`` + + """ + raise NotImplementedError("download_object_range not implemented for this driver") + + def download_object_range_as_stream(self, obj, start_bytes, end_bytes=None, chunk_size=None): + # type: (Object, int, Optional[int], Optional[int]) -> Iterator[bytes] + """ + Return a iterator which yields range / part of the object data. + + :param obj: Object instance + :type obj: :class:`libcloud.storage.base.Object` + + :param start_bytes: Start byte offset (inclusive) for the range + download. Offset is 0 index based so the first + byte in file file is "0". + :type start_bytes: ``int`` + + :param end_bytes: End byte offset (non-inclusive) for the range + download. If not provided, it will default to the + end of the file. + :type end_bytes: ``int`` :param chunk_size: Optional chunk size (in bytes). :type chunk_size: ``int`` + + :rtype: ``iterator`` of ``bytes`` """ - raise NotImplementedError( - 'download_object_as_stream not implemented for this driver') + raise NotImplementedError("download_object_range_as_stream not implemented for this driver") - def upload_object(self, file_path, container, object_name, extra=None, - verify_hash=True, headers=None): + def upload_object( + self, + file_path, + container, + object_name, + extra=None, + verify_hash=True, + headers=None, + ): + # type: (str, Container, str, Optional[dict], bool, Optional[Dict[str, str]]) -> Object # noqa: E501 """ Upload an object currently located on a disk. @@ -369,7 +573,7 @@ def upload_object(self, file_path, container, object_name, extra=None, :type file_path: ``str`` :param container: Destination container. - :type container: :class:`Container` + :type container: :class:`libcloud.storage.base.Container` :param object_name: Object name. :type object_name: ``str`` @@ -385,15 +589,12 @@ def upload_object(self, file_path, container, object_name, extra=None, headers = {'Access-Control-Allow-Origin': 'http://mozilla.com'} :type headers: ``dict`` - :rtype: :class:`Object` + :rtype: :class:`libcloud.storage.base.Object` """ - raise NotImplementedError( - 'upload_object not implemented for this driver') + raise NotImplementedError("upload_object not implemented for this driver") - def upload_object_via_stream(self, iterator, container, - object_name, - extra=None, - headers=None): + def upload_object_via_stream(self, iterator, container, object_name, extra=None, headers=None): + # type: (Iterator[bytes], Container, str, Optional[dict], Optional[Dict[str, str]]) -> Object # noqa: E501 """ Upload an object using an iterator. @@ -415,7 +616,7 @@ def upload_object_via_stream(self, iterator, container, :type iterator: :class:`object` :param container: Destination container. - :type container: :class:`Container` + :type container: :class:`libcloud.storage.base.Container` :param object_name: Object name. :type object_name: ``str`` @@ -430,25 +631,25 @@ def upload_object_via_stream(self, iterator, container, headers = {'Access-Control-Allow-Origin': 'http://mozilla.com'} :type headers: ``dict`` - :rtype: ``object`` + :rtype: ``libcloud.storage.base.Object`` """ - raise NotImplementedError( - 'upload_object_via_stream not implemented for this driver') + raise NotImplementedError("upload_object_via_stream not implemented for this driver") def delete_object(self, obj): + # type: (Object) -> bool """ Delete an object. :param obj: Object instance. - :type obj: :class:`Object` + :type obj: :class:`libcloud.storage.base.Object` :return: ``bool`` True on success. :rtype: ``bool`` """ - raise NotImplementedError( - 'delete_object not implemented for this driver') + raise NotImplementedError("delete_object not implemented for this driver") def create_container(self, container_name): + # type: (str) -> Container """ Create a new container. @@ -456,26 +657,24 @@ def create_container(self, container_name): :type container_name: ``str`` :return: Container instance on success. - :rtype: :class:`Container` + :rtype: :class:`libcloud.storage.base.Container` """ - raise NotImplementedError( - 'create_container not implemented for this driver') + raise NotImplementedError("create_container not implemented for this driver") def delete_container(self, container): + # type: (Container) -> bool """ Delete a container. :param container: Container instance - :type container: :class:`Container` + :type container: :class:`libcloud.storage.base.Container` :return: ``True`` on success, ``False`` otherwise. :rtype: ``bool`` """ - raise NotImplementedError( - 'delete_container not implemented for this driver') + raise NotImplementedError("delete_container not implemented for this driver") - def _get_object(self, obj, callback, callback_kwargs, response, - success_status_code=None): + def _get_object(self, obj, callback, callback_kwargs, response, success_status_code=None): """ Call passed callback and start transfer of the object' @@ -502,19 +701,28 @@ def _get_object(self, obj, callback, callback_kwargs, response, """ success_status_code = success_status_code or httplib.OK - if response.status == success_status_code: + if not isinstance(success_status_code, (list, tuple)): + success_status_codes = [success_status_code] + else: + success_status_codes = success_status_code + + if response.status in success_status_codes: return callback(**callback_kwargs) elif response.status == httplib.NOT_FOUND: - raise ObjectDoesNotExistError(object_name=obj.name, - value='', driver=self) + raise ObjectDoesNotExistError(object_name=obj.name, value="", driver=self) - raise LibcloudError(value='Unexpected status code: %s' % - (response.status), - driver=self) + raise LibcloudError(value="Unexpected status code: %s" % (response.status), driver=self) - def _save_object(self, response, obj, destination_path, - overwrite_existing=False, delete_on_failure=True, - chunk_size=None): + def _save_object( + self, + response, + obj, + destination_path, + overwrite_existing=False, + delete_on_failure=True, + chunk_size=None, + partial_download=False, + ): """ Save object to the provided path. @@ -539,6 +747,10 @@ def _save_object(self, response, obj, destination_path, (defaults to ``libcloud.storage.base.CHUNK_SIZE``, 8kb) :type chunk_size: ``int`` + :param partial_download: True if this is a range (partial) save, + False otherwise. + :type partial_download: ``bool`` + :return: ``True`` on success, ``False`` otherwise. :rtype: ``bool`` """ @@ -548,43 +760,30 @@ def _save_object(self, response, obj, destination_path, base_name = os.path.basename(destination_path) if not base_name and not os.path.exists(destination_path): - raise LibcloudError( - value='Path %s does not exist' % (destination_path), - driver=self) + raise LibcloudError(value="Path %s does not exist" % (destination_path), driver=self) if not base_name: - file_path = pjoin(destination_path, obj.name) + file_path = pjoin(destination_path, os.path.basename(obj.name)) else: file_path = destination_path if os.path.exists(file_path) and not overwrite_existing: raise LibcloudError( - value='File %s already exists, but ' % (file_path) + - 'overwrite_existing=False', - driver=self) - - stream = libcloud.utils.files.read_in_chunks(response, chunk_size) - - try: - data_read = next(stream) - except StopIteration: - # Empty response? - return False + value="File %s already exists, but " % (file_path) + "overwrite_existing=False", + driver=self, + ) bytes_transferred = 0 - with open(file_path, 'wb') as file_handle: - while len(data_read) > 0: - file_handle.write(b(data_read)) - bytes_transferred += len(data_read) - - try: - data_read = next(stream) - except StopIteration: - data_read = '' + with open(file_path, "wb") as file_handle: + for chunk in response._response.iter_content(chunk_size): + file_handle.write(b(chunk)) + bytes_transferred += len(chunk) - if int(obj.size) != int(bytes_transferred): + if not partial_download and int(obj.size) != int(bytes_transferred): # Transfer failed, support retry? + # NOTE: We only perform this check if this is a regular and not a + # partial / range download if delete_on_failure: try: os.unlink(file_path) @@ -595,9 +794,18 @@ def _save_object(self, response, obj, destination_path, return True - def _upload_object(self, object_name, content_type, upload_func, - upload_func_kwargs, request_path, request_method='PUT', - headers=None, file_path=None, iterator=None): + def _upload_object( + self, + object_name, + content_type, + request_path, + request_method="PUT", + headers=None, + file_path=None, + stream=None, + chunked=False, + multipart=False, + ): """ Helper function for setting common request headers and calling the passed in callback which uploads an object. @@ -605,233 +813,161 @@ def _upload_object(self, object_name, content_type, upload_func, headers = headers or {} if file_path and not os.path.exists(file_path): - raise OSError('File %s does not exist' % (file_path)) - - if iterator is not None and not hasattr(iterator, 'next') and not \ - hasattr(iterator, '__next__'): - raise AttributeError('iterator object must implement next() ' + - 'method.') - - if not content_type: - if file_path: - name = file_path - else: - name = object_name - content_type, _ = libcloud.utils.files.guess_file_mime_type(name) - - if not content_type: - if self.strict_mode: - raise AttributeError('File content-type could not be ' - 'guessed and no content_type value ' - 'is provided') - else: - # Fallback to a content-type - content_type = DEFAULT_CONTENT_TYPE - - file_size = None - - if iterator: - if self.supports_chunked_encoding: - headers['Transfer-Encoding'] = 'chunked' - upload_func_kwargs['chunked'] = True - else: - # Chunked transfer encoding is not supported. Need to buffer - # all the data in memory so we can determine file size. - iterator = libcloud.utils.files.read_in_chunks( - iterator=iterator) - data = libcloud.utils.files.exhaust_iterator(iterator=iterator) - - file_size = len(data) - upload_func_kwargs['data'] = data + raise OSError("File %s does not exist" % (file_path)) + + if stream is not None and not hasattr(stream, "next") and not hasattr(stream, "__next__"): + raise AttributeError("iterator object must implement next() " + "method.") + + headers["Content-Type"] = self._determine_content_type( + content_type, object_name, file_path=file_path + ) + + if stream: + response = self.connection.request( + request_path, + method=request_method, + data=stream, + headers=headers, + raw=True, + ) + stream_hash, stream_length = self._hash_buffered_stream( + stream, self._get_hash_function() + ) else: - file_size = os.path.getsize(file_path) - upload_func_kwargs['chunked'] = False - - if file_size is not None and 'Content-Length' not in headers: - headers['Content-Length'] = file_size - - headers['Content-Type'] = content_type - response = self.connection.request(request_path, - method=request_method, data=None, - headers=headers, raw=True) - - upload_func_kwargs['response'] = response - success, data_hash, bytes_transferred = upload_func( - **upload_func_kwargs) - - if not success: - raise LibcloudError( - value='Object upload failed, Perhaps a timeout?', driver=self) - - result_dict = {'response': response, 'data_hash': data_hash, - 'bytes_transferred': bytes_transferred} - return result_dict + with open(file_path, "rb") as file_stream: + response = self.connection.request( + request_path, + method=request_method, + data=file_stream, + headers=headers, + raw=True, + ) + with open(file_path, "rb") as file_stream: + stream_hash, stream_length = self._hash_buffered_stream( + file_stream, self._get_hash_function() + ) + + return { + "response": response, + "bytes_transferred": stream_length, + "data_hash": stream_hash, + } + + def _determine_content_type(self, content_type, object_name, file_path=None): + if content_type: + return content_type + + name = file_path or object_name + content_type, _ = libcloud.utils.files.guess_file_mime_type(name) + + if self.strict_mode and not content_type: + raise AttributeError( + "File content-type could not be guessed for " + '"%s" and no content_type value is provided' % name + ) + + return content_type or DEFAULT_CONTENT_TYPE + + def _hash_buffered_stream(self, stream, hasher, blocksize=65536): + total_len = 0 + + if hasattr(stream, "__next__") or hasattr(stream, "next"): + # Ensure we start from the beginning of a stream in case stream is + # not at the beginning + if hasattr(stream, "seek"): + try: + stream.seek(0) + except OSError as e: + if e.errno != errno.ESPIPE: + # This represents "OSError: [Errno 29] Illegal seek" + # error. This could either mean that the underlying + # handle doesn't support seek operation (e.g. pipe) or + # that the invalid seek position is provided. Sadly + # there is no good robust way to distinghuish that so + # we simply ignore all the "Illeal seek" errors so + # this function works correctly with pipes. + # See https://github.com/apache/libcloud/pull/1427 for + # details + raise e + + for chunk in libcloud.utils.files.read_in_chunks(iterator=stream): + hasher.update(b(chunk)) + total_len += len(chunk) + + return (hasher.hexdigest(), total_len) + + if not hasattr(stream, "__exit__"): + for s in stream: + hasher.update(s) + total_len = total_len + len(s) + return (hasher.hexdigest(), total_len) + + with stream: + buf = stream.read(blocksize) + while len(buf) > 0: + total_len = total_len + len(buf) + hasher.update(buf) + buf = stream.read(blocksize) + + return (hasher.hexdigest(), total_len) - def _upload_data(self, response, data, calculate_hash=True): + def _get_hash_function(self): """ - Upload data stored in a string. - - :param response: RawResponse object. - :type response: :class:`RawResponse` - - :param data: Data to upload. - :type data: ``str`` - - :param calculate_hash: True to calculate hash of the transferred data. - (defaults to True). - :type calculate_hash: ``bool`` - - :return: First item is a boolean indicator of success, second - one is the uploaded data MD5 hash and the third one - is the number of transferred bytes. - :rtype: ``tuple`` + Return instantiated hash function for the hash type supported by + the provider. """ - bytes_transferred = 0 - data_hash = None - - if calculate_hash: - data_hash = self._get_hash_function() - data_hash.update(b(data)) - try: - response.connection.connection.send(b(data)) - except Exception: - # TODO: let this exception propagate - # Timeout, etc. - return False, None, bytes_transferred - - bytes_transferred = len(data) - - if calculate_hash: - data_hash = data_hash.hexdigest() + func = getattr(hashlib, self.hash_type)() + except AttributeError: + raise RuntimeError("Invalid or unsupported hash type: %s" % (self.hash_type)) - return True, data_hash, bytes_transferred + return func - def _stream_data(self, response, iterator, chunked=False, - calculate_hash=True, chunk_size=None, data=None): + def _validate_start_and_end_bytes(self, start_bytes, end_bytes=None): + # type: (int, Optional[int]) -> bool """ - Stream a data over an http connection. - - :param response: RawResponse object. - :type response: :class:`RawResponse` - - :param response: An object which implements an iterator interface - or a File like object with read method. - :type iterator: :class:`object` - - :param chunked: True if the chunked transfer encoding should be used - (defauls to False). - :type chunked: ``bool`` - - :param calculate_hash: True to calculate hash of the transferred data. - (defauls to True). - :type calculate_hash: ``bool`` - - :param chunk_size: Optional chunk size (defaults to ``CHUNK_SIZE``) - :type chunk_size: ``int`` - - :rtype: ``tuple`` - :return: First item is a boolean indicator of success, second - one is the uploaded data MD5 hash and the third one - is the number of transferred bytes. + Method which validates that start_bytes and end_bytes arguments contain + valid values. """ + if start_bytes < 0: + raise ValueError("start_bytes must be greater than 0") - chunk_size = chunk_size or CHUNK_SIZE - - data_hash = None - if calculate_hash: - data_hash = self._get_hash_function() - - generator = libcloud.utils.files.read_in_chunks(iterator, chunk_size, - fill_size=True) - - bytes_transferred = 0 - try: - chunk = next(generator) - except StopIteration: - # Special case when StopIteration is thrown on the first iteration - # create a 0-byte long object - chunk = '' - if chunked: - response.connection.connection.send(b('%X\r\n' % - (len(chunk)))) - response.connection.connection.send(chunk) - response.connection.connection.send(b('\r\n')) - response.connection.connection.send(b('0\r\n\r\n')) - else: - response.connection.connection.send(chunk) - return True, data_hash.hexdigest(), bytes_transferred - - while len(chunk) > 0: - try: - if chunked: - response.connection.connection.send(b('%X\r\n' % - (len(chunk)))) - response.connection.connection.send(b(chunk)) - response.connection.connection.send(b('\r\n')) - else: - response.connection.connection.send(b(chunk)) - except Exception: - # TODO: let this exception propagate - # Timeout, etc. - return False, None, bytes_transferred - - bytes_transferred += len(chunk) - if calculate_hash: - data_hash.update(b(chunk)) - - try: - chunk = next(generator) - except StopIteration: - chunk = '' - - if chunked: - response.connection.connection.send(b('0\r\n\r\n')) - - if calculate_hash: - data_hash = data_hash.hexdigest() + if end_bytes is not None: + if start_bytes > end_bytes: + raise ValueError("start_bytes must be smaller than end_bytes") + elif start_bytes == end_bytes: + raise ValueError( + "start_bytes and end_bytes can't be the " "same. end_bytes is non-inclusive" + ) - return True, data_hash, bytes_transferred + return True - def _upload_file(self, response, file_path, chunked=False, - calculate_hash=True): + def _get_standard_range_str(self, start_bytes, end_bytes=None, end_bytes_inclusive=False): + # type: (int, Optional[int], bool) -> str """ - Upload a file to the server. + Return range string which is used as a Range header value for range + requests for drivers which follow standard Range header notation - :type response: :class:`RawResponse` - :param response: RawResponse object. + This returns range string in the following format: + bytes=-. - :type file_path: ``str`` - :param file_path: Path to a local file. + For example: - :type iterator: :class:`object` - :param response: An object which implements an iterator interface (File - object, etc.) + bytes=1-10 + bytes=0-2 + bytes=5- + bytes=100-5000 - :rtype: ``tuple`` - :return: First item is a boolean indicator of success, second - one is the uploaded data MD5 hash and the third one - is the number of transferred bytes. + :param end_bytes_inclusive: True if "end_bytes" offset should be + inclusive (aka opposite from the Python indexing behavior where the end + index is not inclusive). """ - with open(file_path, 'rb') as file_handle: - success, data_hash, bytes_transferred = ( - self._stream_data( - response=response, - iterator=iter(file_handle), - chunked=chunked, - calculate_hash=calculate_hash)) + range_str = "bytes=%s-" % (start_bytes) - return success, data_hash, bytes_transferred - - def _get_hash_function(self): - """ - Return instantiated hash function for the hash type supported by - the provider. - """ - try: - func = getattr(hashlib, self.hash_type)() - except AttributeError: - raise RuntimeError('Invalid or unsupported hash type: %s' % - (self.hash_type)) + if end_bytes is not None: + if end_bytes_inclusive: + range_str += str(end_bytes) + else: + range_str += str(end_bytes - 1) - return func + return range_str diff --git a/libcloud/storage/drivers/__init__.py b/libcloud/storage/drivers/__init__.py index fe8b04f388..ad67709f43 100644 --- a/libcloud/storage/drivers/__init__.py +++ b/libcloud/storage/drivers/__init__.py @@ -17,7 +17,4 @@ Drivers for working with different providers """ -__all__ = [ - 'dummy', - 'cloudfiles' -] +__all__ = ["dummy", "cloudfiles"] diff --git a/libcloud/storage/drivers/atmos.py b/libcloud/storage/drivers/atmos.py index c52be0341b..90a83b0164 100644 --- a/libcloud/storage/drivers/atmos.py +++ b/libcloud/storage/drivers/atmos.py @@ -13,48 +13,43 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys -import base64 -import hashlib import hmac import time +import base64 +import hashlib +from io import FileIO as file -from libcloud.utils.py3 import PY3 -from libcloud.utils.py3 import b -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import next -from libcloud.utils.py3 import urlparse -from libcloud.utils.py3 import urlencode -from libcloud.utils.py3 import urlquote -from libcloud.utils.py3 import urlunquote - -if PY3: - from io import FileIO as file - -from libcloud.utils.files import read_in_chunks, guess_file_mime_type -from libcloud.common.base import ConnectionUserAndKey, XmlResponse +from libcloud.utils.py3 import b, next, httplib, urlparse, urlquote, urlencode, urlunquote +from libcloud.common.base import XmlResponse, ConnectionUserAndKey +from libcloud.utils.files import read_in_chunks from libcloud.common.types import LibcloudError - -from libcloud.storage.base import Object, Container, StorageDriver, CHUNK_SIZE -from libcloud.storage.types import ContainerAlreadyExistsError, \ - ContainerDoesNotExistError, ContainerIsNotEmptyError, \ - ObjectDoesNotExistError +from libcloud.storage.base import CHUNK_SIZE, Object, Container, StorageDriver +from libcloud.storage.types import ( + ObjectDoesNotExistError, + ContainerIsNotEmptyError, + ContainerDoesNotExistError, + ContainerAlreadyExistsError, +) def collapse(s): - return ' '.join([x for x in s.split(' ') if x]) + return " ".join([x for x in s.split(" ") if x]) class AtmosError(LibcloudError): def __init__(self, code, message, driver=None): - super(AtmosError, self).__init__(value=message, driver=driver) + super().__init__(value=message, driver=driver) self.code = code class AtmosResponse(XmlResponse): def success(self): - return self.status in (httplib.OK, httplib.CREATED, httplib.NO_CONTENT, - httplib.PARTIAL_CONTENT) + return self.status in ( + httplib.OK, + httplib.CREATED, + httplib.NO_CONTENT, + httplib.PARTIAL_CONTENT, + ) def parse_error(self): tree = self.parse_body() @@ -62,324 +57,339 @@ def parse_error(self): if tree is None: return None - code = int(tree.find('Code').text) - message = tree.find('Message').text - raise AtmosError(code=code, message=message, - driver=self.connection.driver) + code = int(tree.find("Code").text) + message = tree.find("Message").text + raise AtmosError(code=code, message=message, driver=self.connection.driver) class AtmosConnection(ConnectionUserAndKey): responseCls = AtmosResponse def add_default_headers(self, headers): - headers['x-emc-uid'] = self.user_id - headers['Date'] = time.strftime('%a, %d %b %Y %H:%M:%S GMT', - time.gmtime()) - headers['x-emc-date'] = headers['Date'] + headers["x-emc-uid"] = self.user_id + headers["Date"] = time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime()) + headers["x-emc-date"] = headers["Date"] + + if "Content-Type" not in headers: + headers["Content-Type"] = "application/octet-stream" - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/octet-stream' - if 'Accept' not in headers: - headers['Accept'] = '*/*' + if "Accept" not in headers: + headers["Accept"] = "*/*" return headers def pre_connect_hook(self, params, headers): - headers['x-emc-signature'] = self._calculate_signature(params, headers) + headers["x-emc-signature"] = self._calculate_signature(params, headers) return params, headers def _calculate_signature(self, params, headers): pathstring = urlunquote(self.action) - if pathstring.startswith(self.driver.path): - pathstring = pathstring[len(self.driver.path):] + driver_path = self.driver.path # pylint: disable=no-member + + if pathstring.startswith(driver_path): + pathstring = pathstring[len(driver_path) :] + if params: if type(params) is dict: params = list(params.items()) - pathstring += '?' + urlencode(params) + pathstring += "?" + urlencode(params) pathstring = pathstring.lower() - xhdrs = [(k, v) for k, v in list(headers.items()) if - k.startswith('x-emc-')] + xhdrs = [(k, v) for k, v in list(headers.items()) if k.startswith("x-emc-")] xhdrs.sort(key=lambda x: x[0]) signature = [ self.method, - headers.get('Content-Type', ''), - headers.get('Range', ''), - headers.get('Date', ''), + headers.get("Content-Type", ""), + headers.get("Range", ""), + headers.get("Date", ""), pathstring, ] - signature.extend([k + ':' + collapse(v) for k, v in xhdrs]) - signature = '\n'.join(signature) + signature.extend([k + ":" + collapse(v) for k, v in xhdrs]) + signature = "\n".join(signature) key = base64.b64decode(self.key) + # The Atmos REST authentication protocol mandates HMAC-SHA1. Using a + # different digest would produce signatures the service cannot verify. + # codeql[py/weak-sensitive-data-hashing] signature = hmac.new(b(key), b(signature), hashlib.sha1).digest() - return base64.b64encode(b(signature)).decode('utf-8') + + return base64.b64encode(b(signature)).decode("utf-8") class AtmosDriver(StorageDriver): connectionCls = AtmosConnection - host = None - path = None - api_name = 'atmos' + host = None # type: str + path = None # type: str + api_name = "atmos" supports_chunked_encoding = True - website = 'http://atmosonline.com/' - name = 'atmos' + website = "http://atmosonline.com/" + name = "atmos" DEFAULT_CDN_TTL = 60 * 60 * 24 * 7 # 1 week def __init__(self, key, secret=None, secure=True, host=None, port=None): host = host or self.host - super(AtmosDriver, self).__init__(key, secret, secure, host, port) + super().__init__(key, secret, secure, host, port) def iterate_containers(self): - result = self.connection.request(self._namespace_path('')) - entries = self._list_objects(result.object, object_type='directory') + result = self.connection.request(self._namespace_path("")) + entries = self._list_objects(result.object, object_type="directory") + for entry in entries: - extra = { - 'object_id': entry['id'] - } - yield Container(entry['name'], extra, self) + extra = {"object_id": entry["id"]} + yield Container(entry["name"], extra, self) def get_container(self, container_name): - path = self._namespace_path(container_name) + '/?metadata/system' + path = self._namespace_path(container_name) + "/?metadata/system" try: result = self.connection.request(path) - except AtmosError: - e = sys.exc_info()[1] + except AtmosError as e: if e.code != 1003: raise raise ContainerDoesNotExistError(e, self, container_name) meta = self._emc_meta(result) - extra = { - 'object_id': meta['objectid'] - } + extra = {"object_id": meta["objectid"]} + return Container(container_name, extra, self) def create_container(self, container_name): - path = self._namespace_path(container_name) + '/' + path = self._namespace_path(container_name) + "/" try: - self.connection.request(path, method='POST') - except AtmosError: - e = sys.exc_info()[1] + self.connection.request(path, method="POST") + except AtmosError as e: if e.code != 1016: raise raise ContainerAlreadyExistsError(e, self, container_name) + return self.get_container(container_name) def delete_container(self, container): try: - self.connection.request(self._namespace_path(container.name) + '/', - method='DELETE') - except AtmosError: - e = sys.exc_info()[1] + self.connection.request(self._namespace_path(container.name) + "/", method="DELETE") + except AtmosError as e: if e.code == 1003: raise ContainerDoesNotExistError(e, self, container.name) elif e.code == 1023: raise ContainerIsNotEmptyError(e, self, container.name) + return True def get_object(self, container_name, object_name): container = self.get_container(container_name) object_name_cleaned = self._clean_object_name(object_name) - path = self._namespace_path(container_name) + '/' + object_name_cleaned + path = self._namespace_path(container_name) + "/" + object_name_cleaned try: - result = self.connection.request(path + '?metadata/system') + result = self.connection.request(path + "?metadata/system") system_meta = self._emc_meta(result) - result = self.connection.request(path + '?metadata/user') + result = self.connection.request(path + "?metadata/user") user_meta = self._emc_meta(result) - except AtmosError: - e = sys.exc_info()[1] + except AtmosError as e: if e.code != 1003: raise raise ObjectDoesNotExistError(e, self, object_name) - last_modified = time.strptime(system_meta['mtime'], - '%Y-%m-%dT%H:%M:%SZ') - last_modified = time.strftime('%a, %d %b %Y %H:%M:%S GMT', - last_modified) - extra = { - 'object_id': system_meta['objectid'], - 'last_modified': last_modified - } - data_hash = user_meta.pop('md5', '') - return Object(object_name, int(system_meta['size']), data_hash, extra, - user_meta, container, self) - - def upload_object(self, file_path, container, object_name, extra=None, - verify_hash=True): - upload_func = self._upload_file - upload_func_kwargs = {'file_path': file_path} - method = 'PUT' + last_modified = time.strptime(system_meta["mtime"], "%Y-%m-%dT%H:%M:%SZ") + last_modified = time.strftime("%a, %d %b %Y %H:%M:%S GMT", last_modified) + extra = {"object_id": system_meta["objectid"], "last_modified": last_modified} + data_hash = user_meta.pop("md5", "") + + return Object( + object_name, + int(system_meta["size"]), + data_hash, + extra, + user_meta, + container, + self, + ) + + def upload_object( + self, + file_path, + container, + object_name, + extra=None, + verify_hash=True, + headers=None, + ): + method = "PUT" extra = extra or {} object_name_cleaned = self._clean_object_name(object_name) - request_path = self._namespace_path(container.name) + '/' +\ - object_name_cleaned - content_type = extra.get('content_type', None) + request_path = self._namespace_path(container.name) + "/" + object_name_cleaned + content_type = extra.get("content_type", None) try: - self.connection.request(request_path + '?metadata/system') - except AtmosError: - e = sys.exc_info()[1] + self.connection.request(request_path + "?metadata/system") + except AtmosError as e: if e.code != 1003: raise - method = 'POST' + method = "POST" result_dict = self._upload_object( object_name=object_name, content_type=content_type, - upload_func=upload_func, - upload_func_kwargs=upload_func_kwargs, request_path=request_path, request_method=method, - headers={}, file_path=file_path) + headers={}, + file_path=file_path, + ) - bytes_transferred = result_dict['bytes_transferred'] + bytes_transferred = result_dict["bytes_transferred"] if extra is None: meta_data = {} else: - meta_data = extra.get('meta_data', {}) - meta_data['md5'] = result_dict['data_hash'] - user_meta = ', '.join([k + '=' + str(v) for k, v in - list(meta_data.items())]) - self.connection.request(request_path + '?metadata/user', method='POST', - headers={'x-emc-meta': user_meta}) - result = self.connection.request(request_path + '?metadata/system') + meta_data = extra.get("meta_data", {}) + meta_data["md5"] = result_dict["data_hash"] + user_meta = ", ".join([k + "=" + str(v) for k, v in list(meta_data.items())]) + self.connection.request( + request_path + "?metadata/user", + method="POST", + headers={"x-emc-meta": user_meta}, + ) + result = self.connection.request(request_path + "?metadata/system") meta = self._emc_meta(result) - del meta_data['md5'] + del meta_data["md5"] extra = { - 'object_id': meta['objectid'], - 'meta_data': meta_data, + "object_id": meta["objectid"], + "meta_data": meta_data, } - return Object(object_name, bytes_transferred, result_dict['data_hash'], - extra, meta_data, container, self) - - def upload_object_via_stream(self, iterator, container, object_name, - extra=None): + return Object( + object_name, + bytes_transferred, + result_dict["data_hash"], + extra, + meta_data, + container, + self, + ) + + def upload_object_via_stream(self, iterator, container, object_name, extra=None, headers=None): if isinstance(iterator, file): iterator = iter(iterator) - data_hash = hashlib.md5() + extra_headers = headers or {} + data_hash = hashlib.md5() # nosec generator = read_in_chunks(iterator, CHUNK_SIZE, True) bytes_transferred = 0 try: chunk = next(generator) except StopIteration: - chunk = '' + chunk = "" - path = self._namespace_path(container.name + '/' + object_name) - method = 'PUT' + path = self._namespace_path(container.name + "/" + object_name) + method = "PUT" if extra is not None: - content_type = extra.get('content_type', None) + content_type = extra.get("content_type", None) else: content_type = None - if not content_type: - content_type, _ = guess_file_mime_type(object_name) - if not content_type: - raise AttributeError( - 'File content-type could not be guessed and' + - ' no content_type value provided') + content_type = self._determine_content_type(content_type, object_name) try: - self.connection.request(path + '?metadata/system') - except AtmosError: - e = sys.exc_info()[1] + self.connection.request(path + "?metadata/system") + except AtmosError as e: if e.code != 1003: raise - method = 'POST' + method = "POST" while True: end = bytes_transferred + len(chunk) - 1 data_hash.update(b(chunk)) - headers = { - 'x-emc-meta': 'md5=' + data_hash.hexdigest(), - 'Content-Type': content_type, - } + headers = dict(extra_headers) + + headers.update( + { + "x-emc-meta": "md5=" + data_hash.hexdigest(), # nosec + "Content-Type": content_type, + } + ) if len(chunk) > 0 and bytes_transferred > 0: - headers['Range'] = 'Bytes=%d-%d' % (bytes_transferred, end) - method = 'PUT' + headers["Range"] = "Bytes=%d-%d" % (bytes_transferred, end) + method = "PUT" - result = self.connection.request(path, method=method, data=chunk, - headers=headers) + result = self.connection.request(path, method=method, data=chunk, headers=headers) bytes_transferred += len(chunk) try: chunk = next(generator) except StopIteration: break + if len(chunk) == 0: break - data_hash = data_hash.hexdigest() + data_hash = data_hash.hexdigest() # nosec if extra is None: meta_data = {} else: - meta_data = extra.get('meta_data', {}) - meta_data['md5'] = data_hash - user_meta = ', '.join([k + '=' + str(v) for k, v in - list(meta_data.items())]) - self.connection.request(path + '?metadata/user', method='POST', - headers={'x-emc-meta': user_meta}) + meta_data = extra.get("meta_data", {}) + meta_data["md5"] = data_hash + user_meta = ", ".join([k + "=" + str(v) for k, v in list(meta_data.items())]) + self.connection.request( + path + "?metadata/user", method="POST", headers={"x-emc-meta": user_meta} + ) - result = self.connection.request(path + '?metadata/system') + result = self.connection.request(path + "?metadata/system") meta = self._emc_meta(result) extra = { - 'object_id': meta['objectid'], - 'meta_data': meta_data, + "object_id": meta["objectid"], + "meta_data": meta_data, } - return Object(object_name, bytes_transferred, data_hash, extra, - meta_data, container, self) - - def download_object(self, obj, destination_path, overwrite_existing=False, - delete_on_failure=True): - path = self._namespace_path(obj.container.name + '/' + obj.name) - response = self.connection.request(path, method='GET', raw=True) - - return self._get_object(obj=obj, callback=self._save_object, - response=response, - callback_kwargs={ - 'obj': obj, - 'response': response.response, - 'destination_path': destination_path, - 'overwrite_existing': overwrite_existing, - 'delete_on_failure': delete_on_failure - }, - success_status_code=httplib.OK) + return Object(object_name, bytes_transferred, data_hash, extra, meta_data, container, self) + + def download_object( + self, obj, destination_path, overwrite_existing=False, delete_on_failure=True + ): + path = self._namespace_path(obj.container.name + "/" + obj.name) + response = self.connection.request(path, method="GET", raw=True) + + return self._get_object( + obj=obj, + callback=self._save_object, + response=response, + callback_kwargs={ + "obj": obj, + "response": response.response, + "destination_path": destination_path, + "overwrite_existing": overwrite_existing, + "delete_on_failure": delete_on_failure, + }, + success_status_code=httplib.OK, + ) def download_object_as_stream(self, obj, chunk_size=None): - path = self._namespace_path(obj.container.name + '/' + obj.name) - response = self.connection.request(path, method='GET', raw=True) + path = self._namespace_path(obj.container.name + "/" + obj.name) + response = self.connection.request(path, method="GET", raw=True) - return self._get_object(obj=obj, callback=read_in_chunks, - response=response, - callback_kwargs={ - 'iterator': response.response, - 'chunk_size': chunk_size - }, - success_status_code=httplib.OK) + return self._get_object( + obj=obj, + callback=read_in_chunks, + response=response, + callback_kwargs={"iterator": response.response, "chunk_size": chunk_size}, + success_status_code=httplib.OK, + ) def delete_object(self, obj): - path = self._namespace_path(obj.container.name) + '/' +\ - self._clean_object_name(obj.name) + path = self._namespace_path(obj.container.name) + "/" + self._clean_object_name(obj.name) try: - self.connection.request(path, method='DELETE') - except AtmosError: - e = sys.exc_info()[1] + self.connection.request(path, method="DELETE") + except AtmosError as e: if e.code != 1003: raise raise ObjectDoesNotExistError(e, self, obj.name) + return True def enable_object_cdn(self, obj): @@ -400,73 +410,106 @@ def get_object_cdn_url(self, obj, expiry=None, use_object=False): :rtype: ``str`` """ + if use_object: - path = '/rest/objects' + obj.meta_data['object_id'] + path = "/rest/objects" + obj.meta_data["object_id"] else: - path = '/rest/namespace/' + obj.container.name + '/' + obj.name + path = "/rest/namespace/" + obj.container.name + "/" + obj.name if self.secure: - protocol = 'https' + protocol = "https" else: - protocol = 'http' + protocol = "http" expiry = str(expiry or int(time.time()) + self.DEFAULT_CDN_TTL) params = [ - ('uid', self.key), - ('expires', expiry), + ("uid", self.key), + ("expires", expiry), ] - params.append(('signature', self._cdn_signature(path, params, expiry))) + params.append(("signature", self._cdn_signature(path, params, expiry))) params = urlencode(params) path = self.path + path - return urlparse.urlunparse((protocol, self.host, path, '', params, '')) + + return urlparse.urlunparse((protocol, self.host, path, "", params, "")) def _cdn_signature(self, path, params, expiry): key = base64.b64decode(self.secret) - signature = '\n'.join(['GET', path.lower(), self.key, expiry]) + signature = "\n".join(["GET", path.lower(), self.key, expiry]) signature = hmac.new(key, signature, hashlib.sha1).digest() return base64.b64encode(signature) def _list_objects(self, tree, object_type=None): - listing = tree.find(self._emc_tag('DirectoryList')) + listing = tree.find(self._emc_tag("DirectoryList")) entries = [] - for entry in listing.findall(self._emc_tag('DirectoryEntry')): - file_type = entry.find(self._emc_tag('FileType')).text + + for entry in listing.findall(self._emc_tag("DirectoryEntry")): + file_type = entry.find(self._emc_tag("FileType")).text + if object_type is not None and object_type != file_type: continue - entries.append({ - 'id': entry.find(self._emc_tag('ObjectID')).text, - 'type': file_type, - 'name': entry.find(self._emc_tag('Filename')).text - }) + entries.append( + { + "id": entry.find(self._emc_tag("ObjectID")).text, + "type": file_type, + "name": entry.find(self._emc_tag("Filename")).text, + } + ) + return entries def _clean_object_name(self, name): - return urlquote(name.encode('ascii')) + return urlquote(name.encode("ascii")) def _namespace_path(self, path): - return self.path + '/rest/namespace/' + urlquote(path.encode('ascii')) + return self.path + "/rest/namespace/" + urlquote(path.encode("ascii")) def _object_path(self, object_id): - return self.path + '/rest/objects/' + object_id.encode('ascii') + return self.path + "/rest/objects/" + object_id.encode("ascii") @staticmethod def _emc_tag(tag): - return '{http://www.emc.com/cos/}' + tag + return "{http://www.emc.com/cos/}" + tag def _emc_meta(self, response): - meta = response.headers.get('x-emc-meta', '') + meta = response.headers.get("x-emc-meta", "") + if len(meta) == 0: return {} - meta = meta.split(', ') - return dict([x.split('=', 1) for x in meta]) + meta = meta.split(", ") - def iterate_container_objects(self, container): - headers = {'x-emc-include-meta': '1'} - path = self._namespace_path(container.name) + '/' - result = self.connection.request(path, headers=headers) - entries = self._list_objects(result.object, object_type='regular') + return dict([x.split("=", 1) for x in meta]) + + def _entries_to_objects(self, container, entries): for entry in entries: - metadata = {'object_id': entry['id']} - yield Object(entry['name'], 0, '', {}, metadata, container, self) + metadata = {"object_id": entry["id"]} + yield Object(entry["name"], 0, "", {}, metadata, container, self) + + def iterate_container_objects(self, container, prefix=None, ex_prefix=None): + """ + Return a generator of objects for the given container. + + :param container: Container instance + :type container: :class:`Container` + + :param prefix: Filter objects starting with a prefix. + Filtering is performed client-side. + :type prefix: ``str`` + + :param ex_prefix: (Deprecated.) Filter objects starting with a prefix. + Filtering is performed client-side. + :type ex_prefix: ``str`` + + :return: A generator of Object instances. + :rtype: ``generator`` of :class:`Object` + """ + prefix = self._normalize_prefix_argument(prefix, ex_prefix) + + headers = {"x-emc-include-meta": "1"} + path = self._namespace_path(container.name) + "/" + result = self.connection.request(path, headers=headers) + entries = self._list_objects(result.object, object_type="regular") + objects = self._entries_to_objects(container, entries) + + return self._filter_listed_container_objects(objects, prefix) diff --git a/libcloud/storage/drivers/auroraobjects.py b/libcloud/storage/drivers/auroraobjects.py new file mode 100644 index 0000000000..ad128117f8 --- /dev/null +++ b/libcloud/storage/drivers/auroraobjects.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.common.types import LibcloudError +from libcloud.storage.providers import Provider +from libcloud.storage.drivers.s3 import BaseS3Connection, BaseS3StorageDriver + +__all__ = ["AuroraObjectsStorageDriver"] + +AURORA_OBJECTS_EU_HOST = "o.auroraobjects.eu" + +NO_CDN_SUPPORT_ERROR = "CDN is not supported by AuroraObjects" + + +class BaseAuroraObjectsConnection(BaseS3Connection): + host = AURORA_OBJECTS_EU_HOST + + +class BaseAuroraObjectsStorageDriver(BaseS3StorageDriver): + type = Provider.AURORAOBJECTS + name = "PCextreme AuroraObjects" + website = "https://www.pcextreme.com/aurora/objects" + + +class AuroraObjectsStorageDriver(BaseAuroraObjectsStorageDriver): + connectionCls = BaseAuroraObjectsConnection + + def enable_container_cdn(self, *argv): + raise LibcloudError(NO_CDN_SUPPORT_ERROR, driver=self) + + def enable_object_cdn(self, *argv): + raise LibcloudError(NO_CDN_SUPPORT_ERROR, driver=self) + + def get_container_cdn_url(self, *argv): + raise LibcloudError(NO_CDN_SUPPORT_ERROR, driver=self) + + def get_object_cdn_url(self, *argv): + raise LibcloudError(NO_CDN_SUPPORT_ERROR, driver=self) diff --git a/libcloud/storage/drivers/azure_blobs.py b/libcloud/storage/drivers/azure_blobs.py index 13d42f64db..981064375e 100644 --- a/libcloud/storage/drivers/azure_blobs.py +++ b/libcloud/storage/drivers/azure_blobs.py @@ -13,71 +13,76 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement -import base64 import os +import hmac +import base64 +import hashlib import binascii +from typing import Literal +from datetime import datetime, timezone, timedelta -from xml.etree.ElementTree import Element, SubElement - -from libcloud.utils.py3 import PY3 -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlquote -from libcloud.utils.py3 import tostring -from libcloud.utils.py3 import b - +from libcloud.utils.py3 import ET, b, httplib, tostring, urlquote, urlencode, urlunquote from libcloud.utils.xml import fixxpath from libcloud.utils.files import read_in_chunks +from libcloud.common.azure import AzureConnection, AzureActiveDirectoryConnection from libcloud.common.types import LibcloudError -from libcloud.common.azure import AzureConnection - from libcloud.storage.base import Object, Container, StorageDriver -from libcloud.storage.types import ContainerIsNotEmptyError -from libcloud.storage.types import ContainerAlreadyExistsError -from libcloud.storage.types import InvalidContainerNameError -from libcloud.storage.types import ContainerDoesNotExistError -from libcloud.storage.types import ObjectDoesNotExistError -from libcloud.storage.types import ObjectHashMismatchError - -if PY3: - from io import FileIO as file +from libcloud.storage.types import ( + ObjectDoesNotExistError, + ObjectHashMismatchError, + ContainerIsNotEmptyError, + InvalidContainerNameError, + ContainerDoesNotExistError, + ContainerAlreadyExistsError, +) # Desired number of items in each response inside a paginated request RESPONSES_PER_REQUEST = 100 -# As per the Azure documentation, if the upload file size is less than -# 64MB, we can upload it in a single request. However, in real life azure -# servers seem to disconnect randomly after around 5 MB or 200s of upload. -# So, it is better that for file sizes greater than 4MB, we upload it in -# chunks. -# Also, with large sizes, if we use a lease, the lease will timeout after -# 60 seconds, but the upload might still be in progress. This can be -# handled in code, but if we use chunked uploads, the lease renewal will -# happen automatically. -AZURE_BLOCK_MAX_SIZE = 4 * 1024 * 1024 - -# Azure block blocks must be maximum 4MB -# Azure page blobs must be aligned in 512 byte boundaries (4MB fits that) -AZURE_CHUNK_SIZE = 4 * 1024 * 1024 +# According to the Azure Docs: +# > The block must be less than or equal to 100 MB in size for version +# > 2016-05-31 and later (4 MB for older versions). +# However for performance reasons, using a lower upload chunk size +# usually leads to fewer dropped requests and retries. +AZURE_UPLOAD_CHUNK_SIZE = int(os.getenv("LIBCLOUD_AZURE_UPLOAD_CHUNK_SIZE_MB", "4")) * 1024 * 1024 -# Azure page blob must be aligned in 512 byte boundaries -AZURE_PAGE_CHUNK_SIZE = 512 +AZURE_DOWNLOAD_CHUNK_SIZE = ( + int(os.getenv("LIBCLOUD_AZURE_DOWNLOAD_CHUNK_SIZE_MB", "4")) * 1024 * 1024 +) # The time period (in seconds) for which a lease must be obtained. # If set as -1, we get an infinite lease, but that is a bad idea. If # after getting an infinite lease, there was an issue in releasing the # lease, the object will remain 'locked' forever, unless the lease is # released using the lease_id (which is not exposed to the user) -AZURE_LEASE_PERIOD = 60 +AZURE_LEASE_PERIOD = int(os.getenv("LIBCLOUD_AZURE_LEASE_PERIOD_SECONDS", "60")) + +AZURE_STORAGE_HOST_SUFFIX = "blob.core.windows.net" +AZURE_STORAGE_HOST_SUFFIX_CHINA = "blob.core.chinacloudapi.cn" +AZURE_STORAGE_HOST_SUFFIX_GOVERNMENT = "blob.core.usgovcloudapi.net" +AZURE_STORAGE_HOST_SUFFIX_PRIVATELINK = "privatelink.blob.core.windows.net" + +AZURE_STORAGE_CDN_URL_DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ" -AZURE_STORAGE_HOST_SUFFIX = 'blob.core.windows.net' +AZURE_STORAGE_CDN_URL_START_MINUTES = float( + os.getenv("LIBCLOUD_AZURE_STORAGE_CDN_URL_START_MINUTES", "5") +) +AZURE_STORAGE_CDN_URL_EXPIRY_HOURS = float( + os.getenv("LIBCLOUD_AZURE_STORAGE_CDN_URL_EXPIRY_HOURS", "24") +) -class AzureBlobLease(object): + +class AuthType: + AZURE_AD = "azureAD" + + +class AzureBlobLease: """ A class to help in leasing an azure blob and renewing the lease """ + def __init__(self, driver, object_path, use_lease): """ :param driver: The Azure storage driver that is being used @@ -93,7 +98,7 @@ def __init__(self, driver, object_path, use_lease): self.driver = driver self.use_lease = use_lease self.lease_id = None - self.params = {'comp': 'lease'} + self.params = {"comp": "lease"} def renew(self): """ @@ -102,94 +107,209 @@ def renew(self): if self.lease_id is None: return - headers = {'x-ms-lease-action': 'renew', - 'x-ms-lease-id': self.lease_id, - 'x-ms-lease-duration': '60'} + headers = { + "x-ms-lease-action": "renew", + "x-ms-lease-id": self.lease_id, + "x-ms-lease-duration": "60", + } - response = self.driver.connection.request(self.object_path, - headers=headers, - params=self.params, - method='PUT') + response = self.driver.connection.request( + self.object_path, headers=headers, params=self.params, method="PUT" + ) if response.status != httplib.OK: - raise LibcloudError('Unable to obtain lease', driver=self) + raise LibcloudError("Unable to obtain lease", driver=self) def update_headers(self, headers): """ Update the lease id in the headers """ if self.lease_id: - headers['x-ms-lease-id'] = self.lease_id + headers["x-ms-lease-id"] = self.lease_id def __enter__(self): if not self.use_lease: return self - headers = {'x-ms-lease-action': 'acquire', - 'x-ms-lease-duration': '60'} + headers = {"x-ms-lease-action": "acquire", "x-ms-lease-duration": "60"} - response = self.driver.connection.request(self.object_path, - headers=headers, - params=self.params, - method='PUT') + response = self.driver.connection.request( + self.object_path, headers=headers, params=self.params, method="PUT" + ) if response.status == httplib.NOT_FOUND: return self elif response.status != httplib.CREATED: - raise LibcloudError('Unable to obtain lease', driver=self) + raise LibcloudError("Unable to obtain lease", driver=self) - self.lease_id = response.headers['x-ms-lease-id'] + self.lease_id = response.headers["x-ms-lease-id"] return self def __exit__(self, type, value, traceback): if self.lease_id is None: return - headers = {'x-ms-lease-action': 'release', - 'x-ms-lease-id': self.lease_id} - response = self.driver.connection.request(self.object_path, - headers=headers, - params=self.params, - method='PUT') + headers = {"x-ms-lease-action": "release", "x-ms-lease-id": self.lease_id} + response = self.driver.connection.request( + self.object_path, headers=headers, params=self.params, method="PUT" + ) if response.status != httplib.OK: - raise LibcloudError('Unable to release lease', driver=self) + raise LibcloudError("Unable to release lease", driver=self) class AzureBlobsConnection(AzureConnection): """ - Represents a single connection to Azure Blobs + Represents a single connection to Azure Blobs. + + The main Azure Blob Storage service uses a prefix in the hostname to + distinguish between accounts, e.g. ``theaccount.blob.core.windows.net``. + However, some custom deployments of the service, such as the Azurite + emulator, instead use a URL prefix such as ``/theaccount``. To support + these deployments, the parameter ``account_prefix`` must be set on the + connection. This is done by instantiating the driver with arguments such + as ``host='somewhere.tld'`` and ``key='theaccount'``. To specify a custom + host without an account prefix, e.g. to connect to Azure Government or + Azure China, the driver can be instantiated with the appropriate storage + endpoint suffix, e.g. ``host='blob.core.usgovcloudapi.net'`` and + ``key='theaccount'``. + + :param account_prefix: Optional prefix identifying the storage account. + Used when connecting to a custom deployment of the + storage service like Azurite or IoT Edge Storage. + :type account_prefix: ``str`` """ + def __init__(self, *args, **kwargs): + self.account_prefix = kwargs.pop("account_prefix", None) + super().__init__(*args, **kwargs) + + def morph_action_hook(self, action): + action = super().morph_action_hook(action) + + if self.account_prefix is not None: + action = "/{}{}".format(self.account_prefix, action) + + return action + + API_VERSION = "2018-11-09" + + +class AzureBlobsActiveDirectoryConnection(AzureActiveDirectoryConnection): + """ + Represents a single connection to Azure Blobs. + + The main Azure Blob Storage service uses a prefix in the hostname to + distinguish between accounts, e.g. ``theaccount.blob.core.windows.net``. + However, some custom deployments of the service, such as the Azurite + emulator, instead use a URL prefix such as ``/theaccount``. To support + these deployments, the parameter ``account_prefix`` must be set on the + connection. This is done by instantiating the driver with arguments such + as ``host='somewhere.tld'`` and ``key='theaccount'``. To specify a custom + host without an account prefix, e.g. to connect to Azure Government or + Azure China, the driver can be instantiated with the appropriate storage + endpoint suffix, e.g. ``host='blob.core.usgovcloudapi.net'`` and + ``key='theaccount'``. + + This connection is similar to AzureBlobsConnection, but uses Azure Active + Directory to authenticate + + :param account_prefix: Optional prefix identifying the storage account. + Used when connecting to a custom deployment of the + storage service like Azurite or IoT Edge Storage. + :type account_prefix: ``str`` + """ + + def __init__(self, *args, **kwargs): + self.account_prefix = kwargs.pop("account_prefix", None) + super().__init__(*args, **kwargs) + + def morph_action_hook(self, action): + action = super().morph_action_hook(action) + + if self.account_prefix is not None: + action = "/{}{}".format(self.account_prefix, action) + + return action + + API_VERSION = "2018-11-09" + class AzureBlobsStorageDriver(StorageDriver): - name = 'Microsoft Azure (blobs)' - website = 'http://windows.azure.com/' + name = "Microsoft Azure (blobs)" + website = "http://windows.azure.com/" connectionCls = AzureBlobsConnection - hash_type = 'md5' + hash_type = "md5" supports_chunked_encoding = False - ex_blob_type = 'BlockBlob' - - def __init__(self, key, secret=None, secure=True, host=None, port=None, - **kwargs): - self._host_argument_set = bool(host) - # B64decode() this key and keep it, so that we don't have to do - # so for every request. Minor performance improvement - secret = base64.b64decode(b(secret)) + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + tenant_id=None, + identity=None, + auth_type=None, + cloud_environment="default", + **kwargs, + ): + self._host = host + self._tenant_id = tenant_id + self._identity = identity + self._cloud_environment = cloud_environment + self._auth_type = auth_type + + if self._auth_type == "azureAd": + self.connectionCls = AzureBlobsActiveDirectoryConnection + else: + # B64decode() this key and keep it, so that we don't have to do + # so for every request. Minor performance improvement + secret = base64.b64decode(b(secret)) - super(AzureBlobsStorageDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, **kwargs) + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port, **kwargs) def _ex_connection_class_kwargs(self): - result = {} + kwargs = {} + # add tenant_id and identity if using azureAd auth + if self._auth_type == "azureAd": + kwargs["tenant_id"] = self._tenant_id + kwargs["identity"] = self._identity + kwargs["cloud_environment"] = self._cloud_environment + + # if the user didn't provide a custom host value, assume we're + # targeting the default Azure Storage endpoints + if self._host is None: + kwargs["host"] = "{}.{}".format(self.key, AZURE_STORAGE_HOST_SUFFIX) + return kwargs + + # connecting to a special storage region like Azure Government or + # Azure China requires setting a custom storage endpoint but we + # still use the same scheme to identify a specific account as for + # the standard storage endpoint + try: + host_suffix = next( + host_suffix + for host_suffix in ( + AZURE_STORAGE_HOST_SUFFIX_CHINA, + AZURE_STORAGE_HOST_SUFFIX_GOVERNMENT, + AZURE_STORAGE_HOST_SUFFIX_PRIVATELINK, + ) + if self._host.endswith(host_suffix) + ) + except StopIteration: + pass + else: + kwargs["host"] = "{}.{}".format(self.key, host_suffix) + return kwargs - # host argument has precedence - if not self._host_argument_set: - result['host'] = '%s.%s' % (self.key, AZURE_STORAGE_HOST_SUFFIX) + # if the host isn't targeting one of the special storage regions, it + # must be pointing to Azurite or IoT Edge Storage so switch to prefix + # identification + kwargs["account_prefix"] = self.key - return result + return kwargs def _xml_to_container(self, node): """ @@ -202,24 +322,30 @@ def _xml_to_container(self, node): :rtype: :class:`Container` """ - name = node.findtext(fixxpath(xpath='Name')) - props = node.find(fixxpath(xpath='Properties')) - metadata = node.find(fixxpath(xpath='Metadata')) + name = node.findtext(fixxpath(xpath="Name")) + props = node.find(fixxpath(xpath="Properties")) + metadata = node.find(fixxpath(xpath="Metadata")) extra = { - 'url': node.findtext(fixxpath(xpath='Url')), - 'last_modified': node.findtext(fixxpath(xpath='Last-Modified')), - 'etag': props.findtext(fixxpath(xpath='Etag')), - 'lease': { - 'status': props.findtext(fixxpath(xpath='LeaseStatus')), - 'state': props.findtext(fixxpath(xpath='LeaseState')), - 'duration': props.findtext(fixxpath(xpath='LeaseDuration')), + "url": node.findtext(fixxpath(xpath="Url")), + "last_modified": node.findtext(fixxpath(xpath="Last-Modified")), + "etag": props.findtext(fixxpath(xpath="Etag")), + "lease": { + "status": props.findtext(fixxpath(xpath="LeaseStatus")), + "state": props.findtext(fixxpath(xpath="LeaseState")), + "duration": props.findtext(fixxpath(xpath="LeaseDuration")), }, - 'meta_data': {} + "meta_data": {}, } - for meta in metadata.getchildren(): - extra['meta_data'][meta.tag] = meta.text + if extra["etag"]: + # Remove redundant double quotes around etag value + # "0x8CFBAB7B5B82D8E" -> 0x8CFBAB7B5B82D8E + extra["etag"] = extra["etag"].replace('"', "") + + if metadata is not None: + for meta in list(metadata): + extra["meta_data"][meta.tag] = meta.text return Container(name=name, extra=extra, driver=self) @@ -238,23 +364,24 @@ def _response_to_container(self, container_name, response): """ headers = response.headers + scheme = "https" if self.secure else "http" + extra = { - 'url': 'http://%s%s' % (response.connection.host, - response.connection.action), - 'etag': headers['etag'], - 'last_modified': headers['last-modified'], - 'lease': { - 'status': headers.get('x-ms-lease-status', None), - 'state': headers.get('x-ms-lease-state', None), - 'duration': headers.get('x-ms-lease-duration', None), + "url": "{}://{}{}".format(scheme, response.connection.host, response.connection.action), + "etag": headers["etag"], + "last_modified": headers["last-modified"], + "lease": { + "status": headers.get("x-ms-lease-status", None), + "state": headers.get("x-ms-lease-state", None), + "duration": headers.get("x-ms-lease-duration", None), }, - 'meta_data': {} + "meta_data": {}, } for key, value in response.headers.items(): - if key.startswith('x-ms-meta-'): - key = key.split('x-ms-meta-')[1] - extra['meta_data'][key] = value + if key.startswith("x-ms-meta-"): + key = key.split("x-ms-meta-")[1] + extra["meta_data"][key] = value return Container(name=container_name, extra=extra, driver=self) @@ -272,42 +399,48 @@ def _xml_to_object(self, container, blob): :rtype: :class:`Object` """ - name = blob.findtext(fixxpath(xpath='Name')) - props = blob.find(fixxpath(xpath='Properties')) - metadata = blob.find(fixxpath(xpath='Metadata')) - etag = props.findtext(fixxpath(xpath='Etag')) - size = int(props.findtext(fixxpath(xpath='Content-Length'))) + name = blob.findtext(fixxpath(xpath="Name")) + props = blob.find(fixxpath(xpath="Properties")) + metadata = blob.find(fixxpath(xpath="Metadata")) + etag = props.findtext(fixxpath(xpath="Etag")) + size = int(props.findtext(fixxpath(xpath="Content-Length"))) extra = { - 'content_type': props.findtext(fixxpath(xpath='Content-Type')), - 'etag': etag, - 'md5_hash': props.findtext(fixxpath(xpath='Content-MD5')), - 'last_modified': props.findtext(fixxpath(xpath='Last-Modified')), - 'url': blob.findtext(fixxpath(xpath='Url')), - 'hash': props.findtext(fixxpath(xpath='Etag')), - 'lease': { - 'status': props.findtext(fixxpath(xpath='LeaseStatus')), - 'state': props.findtext(fixxpath(xpath='LeaseState')), - 'duration': props.findtext(fixxpath(xpath='LeaseDuration')), + "content_type": props.findtext(fixxpath(xpath="Content-Type")), + "etag": etag, + "md5_hash": props.findtext(fixxpath(xpath="Content-MD5")), + "last_modified": props.findtext(fixxpath(xpath="Last-Modified")), + "url": blob.findtext(fixxpath(xpath="Url")), + "hash": props.findtext(fixxpath(xpath="Etag")), + "lease": { + "status": props.findtext(fixxpath(xpath="LeaseStatus")), + "state": props.findtext(fixxpath(xpath="LeaseState")), + "duration": props.findtext(fixxpath(xpath="LeaseDuration")), }, - 'content_encoding': props.findtext(fixxpath( - xpath='Content-Encoding')), - 'content_language': props.findtext(fixxpath( - xpath='Content-Language')), - 'blob_type': props.findtext(fixxpath(xpath='BlobType')) + "content_encoding": props.findtext(fixxpath(xpath="Content-Encoding")), + "content_language": props.findtext(fixxpath(xpath="Content-Language")), + "blob_type": props.findtext(fixxpath(xpath="BlobType")), } - if extra['md5_hash']: - value = binascii.hexlify(base64.b64decode(b(extra['md5_hash']))) - value = value.decode('ascii') - extra['md5_hash'] = value + if extra["md5_hash"]: + value = binascii.hexlify(base64.b64decode(b(extra["md5_hash"]))) + value = value.decode("ascii") + extra["md5_hash"] = value meta_data = {} - for meta in metadata.getchildren(): - meta_data[meta.tag] = meta.text - - return Object(name=name, size=size, hash=etag, meta_data=meta_data, - extra=extra, container=container, driver=self) + if metadata is not None: + for meta in list(metadata): + meta_data[meta.tag] = meta.text + + return Object( + name=name, + size=size, + hash=etag, + meta_data=meta_data, + extra=extra, + container=container, + driver=self, + ) def _response_to_object(self, object_name, container, response): """ @@ -327,118 +460,131 @@ def _response_to_object(self, object_name, container, response): """ headers = response.headers - size = int(headers['content-length']) - etag = headers['etag'] + size = int(headers["content-length"]) + etag = headers["etag"] + scheme = "https" if self.secure else "http" extra = { - 'url': 'http://%s%s' % (response.connection.host, - response.connection.action), - 'etag': etag, - 'md5_hash': headers.get('content-md5', None), - 'content_type': headers.get('content-type', None), - 'content_language': headers.get('content-language', None), - 'content_encoding': headers.get('content-encoding', None), - 'last_modified': headers['last-modified'], - 'lease': { - 'status': headers.get('x-ms-lease-status', None), - 'state': headers.get('x-ms-lease-state', None), - 'duration': headers.get('x-ms-lease-duration', None), + "url": "{}://{}{}".format(scheme, response.connection.host, response.connection.action), + "etag": etag, + "md5_hash": headers.get("content-md5", None), + "content_type": headers.get("content-type", None), + "content_language": headers.get("content-language", None), + "content_encoding": headers.get("content-encoding", None), + "last_modified": headers["last-modified"], + "lease": { + "status": headers.get("x-ms-lease-status", None), + "state": headers.get("x-ms-lease-state", None), + "duration": headers.get("x-ms-lease-duration", None), }, - 'blob_type': headers['x-ms-blob-type'] + "blob_type": headers["x-ms-blob-type"], } - if extra['md5_hash']: - value = binascii.hexlify(base64.b64decode(b(extra['md5_hash']))) - value = value.decode('ascii') - extra['md5_hash'] = value + if extra["md5_hash"]: + value = binascii.hexlify(base64.b64decode(b(extra["md5_hash"]))) + value = value.decode("ascii") + extra["md5_hash"] = value meta_data = {} for key, value in response.headers.items(): - if key.startswith('x-ms-meta-'): - key = key.split('x-ms-meta-')[1] + if key.startswith("x-ms-meta-"): + key = key.split("x-ms-meta-")[1] meta_data[key] = value - return Object(name=object_name, size=size, hash=etag, extra=extra, - meta_data=meta_data, container=container, driver=self) + return Object( + name=object_name, + size=size, + hash=etag, + extra=extra, + meta_data=meta_data, + container=container, + driver=self, + ) def iterate_containers(self): """ @inherits: :class:`StorageDriver.iterate_containers` """ - params = {'comp': 'list', - 'maxresults': RESPONSES_PER_REQUEST, - 'include': 'metadata'} + params = { + "comp": "list", + "maxresults": RESPONSES_PER_REQUEST, + "include": "metadata", + } while True: - response = self.connection.request('/', params) + response = self.connection.request("/", params) if response.status != httplib.OK: - raise LibcloudError('Unexpected status code: %s' % - (response.status), driver=self) + raise LibcloudError("Unexpected status code: %s" % (response.status), driver=self) body = response.parse_body() - containers = body.find(fixxpath(xpath='Containers')) - containers = containers.findall(fixxpath(xpath='Container')) + containers = body.find(fixxpath(xpath="Containers")) + containers = containers.findall(fixxpath(xpath="Container")) for container in containers: yield self._xml_to_container(container) - params['marker'] = body.findtext('NextMarker') - if not params['marker']: + params["marker"] = body.findtext("NextMarker") + if not params["marker"]: break - def iterate_container_objects(self, container): + def iterate_container_objects(self, container, prefix=None, ex_prefix=None): """ @inherits: :class:`StorageDriver.iterate_container_objects` """ - params = {'restype': 'container', - 'comp': 'list', - 'maxresults': RESPONSES_PER_REQUEST, - 'include': 'metadata'} + prefix = self._normalize_prefix_argument(prefix, ex_prefix) + + params = { + "restype": "container", + "comp": "list", + "maxresults": RESPONSES_PER_REQUEST, + "include": "metadata", + } + + if prefix: + params["prefix"] = prefix container_path = self._get_container_path(container) while True: - response = self.connection.request(container_path, - params=params) + response = self.connection.request(container_path, params=params) if response.status == httplib.NOT_FOUND: - raise ContainerDoesNotExistError(value=None, - driver=self, - container_name=container.name) + raise ContainerDoesNotExistError( + value=None, driver=self, container_name=container.name + ) elif response.status != httplib.OK: - raise LibcloudError('Unexpected status code: %s' % - (response.status), driver=self) + raise LibcloudError("Unexpected status code: %s" % (response.status), driver=self) body = response.parse_body() - blobs = body.find(fixxpath(xpath='Blobs')) - blobs = blobs.findall(fixxpath(xpath='Blob')) + blobs = body.find(fixxpath(xpath="Blobs")) + blobs = blobs.findall(fixxpath(xpath="Blob")) for blob in blobs: yield self._xml_to_object(container, blob) - params['marker'] = body.findtext('NextMarker') - if not params['marker']: + params["marker"] = body.findtext("NextMarker") + if not params["marker"]: break def get_container(self, container_name): """ @inherits: :class:`StorageDriver.get_container` """ - params = {'restype': 'container'} + params = {"restype": "container"} - container_path = '/%s' % (container_name) + container_path = "/%s" % (container_name) - response = self.connection.request(container_path, params=params, - method='HEAD') + response = self.connection.request(container_path, params=params, method="HEAD") if response.status == httplib.NOT_FOUND: - raise ContainerDoesNotExistError('Container %s does not exist' % - (container_name), driver=self, - container_name=container_name) + raise ContainerDoesNotExistError( + "Container %s does not exist" % (container_name), + driver=self, + container_name=container_name, + ) elif response.status != httplib.OK: - raise LibcloudError('Unexpected status code: %s' % - (response.status), driver=self) + raise LibcloudError("Unexpected status code: %s" % (response.status), driver=self) return self._response_to_container(container_name, response) @@ -450,14 +596,90 @@ def get_object(self, container_name, object_name): container = self.get_container(container_name=container_name) object_path = self._get_object_path(container, object_name) - response = self.connection.request(object_path, method='HEAD') + response = self.connection.request(object_path, method="HEAD") if response.status == httplib.OK: obj = self._response_to_object(object_name, container, response) return obj - raise ObjectDoesNotExistError(value=None, driver=self, - object_name=object_name) + raise ObjectDoesNotExistError(value=None, driver=self, object_name=object_name) + + def get_object_cdn_url( + self, + obj, + ex_expiry=AZURE_STORAGE_CDN_URL_EXPIRY_HOURS, + ex_method: Literal["GET", "PUT", "DELETE"] = "GET", + ): + """ + Return a SAS URL that enables reading the given object. + + :param obj: Object instance. + :type obj: :class:`Object` + + :param ex_expiry: The number of hours after which the URL expires. + Defaults to 24 hours. + :type ex_expiry: ``float`` + + :param ex_method: The HTTP method for which the URL is valid. + Defaults to "GET". + :type ex_method: ``str`` + + :return: A SAS URL for the object. + :rtype: ``str`` + """ + object_path = self._get_object_path(obj.container, obj.name) + + now = datetime.now(timezone.utc).replace(tzinfo=None) + start = now - timedelta(minutes=AZURE_STORAGE_CDN_URL_START_MINUTES) + expiry = now + timedelta(hours=ex_expiry) + + if ex_method == "PUT": + sp = "wc" + elif ex_method == "DELETE": + sp = "d" + else: + sp = "r" + + params = { + "st": start.strftime(AZURE_STORAGE_CDN_URL_DATE_FORMAT), + "se": expiry.strftime(AZURE_STORAGE_CDN_URL_DATE_FORMAT), + "sp": sp, + "spr": "https" if self.secure else "http,https", + "sv": self.connectionCls.API_VERSION, + "sr": "b", + } + + string_to_sign = "\n".join( + ( + params["sp"], + params["st"], + params["se"], + "/blob/{}{}".format(self.key, urlunquote(object_path)), + "", # signedIdentifier + "", # signedIP + params["spr"], + params["sv"], + params["sr"], + "", # snapshot + "", # rscc + "", # rscd + "", # rsce + "", # rscl + "", # rsct + ) + ) + + params["sig"] = base64.b64encode( + hmac.new(self.secret, string_to_sign.encode("utf-8"), hashlib.sha256).digest() + ).decode("utf-8") + + return "{scheme}://{host}:{port}{action}?{sas_token}".format( + scheme="https" if self.secure else "http", + host=self.connection.host, + port=self.connection.port, + action=self.connection.morph_action_hook(object_path), + sas_token=urlencode(params), + ) def _get_container_path(self, container): """ @@ -469,7 +691,7 @@ def _get_container_path(self, container): :return: A path for this container. :rtype: ``str`` """ - return '/%s' % (container.name) + return "/%s" % (container.name) def _get_object_path(self, container, object_name): """ @@ -486,34 +708,35 @@ def _get_object_path(self, container, object_name): """ container_url = self._get_container_path(container) object_name_cleaned = urlquote(object_name) - object_path = '%s/%s' % (container_url, object_name_cleaned) + object_path = "{}/{}".format(container_url, object_name_cleaned) return object_path def create_container(self, container_name): """ @inherits: :class:`StorageDriver.create_container` """ - params = {'restype': 'container'} + params = {"restype": "container"} - container_path = '/%s' % (container_name) - response = self.connection.request(container_path, params=params, - method='PUT') + container_path = "/%s" % (container_name) + response = self.connection.request(container_path, params=params, method="PUT") if response.status == httplib.CREATED: return self._response_to_container(container_name, response) elif response.status == httplib.CONFLICT: raise ContainerAlreadyExistsError( - value='Container with this name already exists. The name must ' - 'be unique among all the containers in the system', - container_name=container_name, driver=self) + value="Container with this name already exists. The name must " + "be unique among all the containers in the system", + container_name=container_name, + driver=self, + ) elif response.status == httplib.BAD_REQUEST: - raise InvalidContainerNameError(value='Container name contains ' + - 'invalid characters.', - container_name=container_name, - driver=self) + raise InvalidContainerNameError( + value="Container name contains " + "invalid characters.", + container_name=container_name, + driver=self, + ) - raise LibcloudError('Unexpected status code: %s' % (response.status), - driver=self) + raise LibcloudError("Unexpected status code: %s" % (response.status), driver=self) def delete_container(self, container): """ @@ -523,444 +746,514 @@ def delete_container(self, container): # a check to ensure that the behaviour is similar to other drivers for obj in container.iterate_objects(): raise ContainerIsNotEmptyError( - value='Container must be empty before it can be deleted.', - container_name=container.name, driver=self) + value="Container must be empty before it can be deleted.", + container_name=container.name, + driver=self, + ) - params = {'restype': 'container'} + params = {"restype": "container"} container_path = self._get_container_path(container) # Note: All the objects in the container must be deleted first - response = self.connection.request(container_path, params=params, - method='DELETE') + response = self.connection.request(container_path, params=params, method="DELETE") if response.status == httplib.ACCEPTED: return True elif response.status == httplib.NOT_FOUND: - raise ContainerDoesNotExistError(value=None, - driver=self, - container_name=container.name) + raise ContainerDoesNotExistError(value=None, driver=self, container_name=container.name) return False - def download_object(self, obj, destination_path, overwrite_existing=False, - delete_on_failure=True): + def download_object( + self, obj, destination_path, overwrite_existing=False, delete_on_failure=True + ): """ @inherits: :class:`StorageDriver.download_object` """ obj_path = self._get_object_path(obj.container, obj.name) response = self.connection.request(obj_path, raw=True, data=None) - return self._get_object(obj=obj, callback=self._save_object, - response=response, - callback_kwargs={ - 'obj': obj, - 'response': response.response, - 'destination_path': destination_path, - 'overwrite_existing': overwrite_existing, - 'delete_on_failure': delete_on_failure}, - success_status_code=httplib.OK) + return self._get_object( + obj=obj, + callback=self._save_object, + response=response, + callback_kwargs={ + "obj": obj, + "response": response.response, + "destination_path": destination_path, + "overwrite_existing": overwrite_existing, + "delete_on_failure": delete_on_failure, + }, + success_status_code=httplib.OK, + ) def download_object_as_stream(self, obj, chunk_size=None): """ @inherits: :class:`StorageDriver.download_object_as_stream` """ obj_path = self._get_object_path(obj.container, obj.name) - response = self.connection.request(obj_path, raw=True, data=None) - - return self._get_object(obj=obj, callback=read_in_chunks, - response=response, - callback_kwargs={'iterator': response.response, - 'chunk_size': chunk_size}, - success_status_code=httplib.OK) - - def _upload_in_chunks(self, response, data, iterator, object_path, - blob_type, lease, calculate_hash=True): - """ - Uploads data from an interator in fixed sized chunks to S3 + response = self.connection.request(obj_path, method="GET", stream=True, raw=True) + iterator = response.iter_content(chunk_size or AZURE_DOWNLOAD_CHUNK_SIZE) + + return self._get_object( + obj=obj, + callback=read_in_chunks, + response=response, + callback_kwargs={"iterator": iterator, "chunk_size": chunk_size}, + success_status_code=httplib.OK, + ) + + def download_object_range( + self, + obj, + destination_path, + start_bytes, + end_bytes=None, + overwrite_existing=False, + delete_on_failure=True, + ): + self._validate_start_and_end_bytes(start_bytes=start_bytes, end_bytes=end_bytes) - :param response: Response object from the initial POST request - :type response: :class:`RawResponse` - - :param data: Any data from the initial POST request - :type data: ``str`` - - :param iterator: The generator for fetching the upload data - :type iterator: ``generator`` - - :param object_path: The path of the object to which we are uploading - :type object_name: ``str`` - - :param blob_type: The blob type being uploaded - :type blob_type: ``str`` + obj_path = self._get_object_path(obj.container, obj.name) + headers = {"x-ms-range": self._get_standard_range_str(start_bytes, end_bytes)} + response = self.connection.request(obj_path, headers=headers, raw=True, data=None) + + # NOTE: Some Azure Blobs implementation return 200 instead of 206 + # status code, see + # https://github.com/c-w/libcloud-tests/pull/2#issuecomment-592765323 + # for details. + success_status_codes = [httplib.OK, httplib.PARTIAL_CONTENT] + + return self._get_object( + obj=obj, + callback=self._save_object, + response=response, + callback_kwargs={ + "obj": obj, + "response": response.response, + "destination_path": destination_path, + "overwrite_existing": overwrite_existing, + "delete_on_failure": delete_on_failure, + "partial_download": True, + }, + success_status_code=success_status_codes, + ) - :param lease: The lease object to be used for renewal - :type lease: :class:`AzureBlobLease` + def download_object_range_as_stream(self, obj, start_bytes, end_bytes=None, chunk_size=None): + self._validate_start_and_end_bytes(start_bytes=start_bytes, end_bytes=end_bytes) - :keyword calculate_hash: Indicates if we must calculate the data hash - :type calculate_hash: ``bool`` + obj_path = self._get_object_path(obj.container, obj.name) - :return: A tuple of (status, checksum, bytes transferred) - :rtype: ``tuple`` + headers = {"x-ms-range": self._get_standard_range_str(start_bytes, end_bytes)} + response = self.connection.request( + obj_path, method="GET", headers=headers, stream=True, raw=True + ) + iterator = response.iter_content(chunk_size or AZURE_DOWNLOAD_CHUNK_SIZE) + success_status_codes = [httplib.OK, httplib.PARTIAL_CONTENT] + + return self._get_object( + obj=obj, + callback=read_in_chunks, + response=response, + callback_kwargs={"iterator": iterator, "chunk_size": chunk_size}, + success_status_code=success_status_codes, + ) + + def _upload_in_chunks( + self, + stream, + object_path, + lease, + meta_data, + content_type, + object_name, + file_path, + verify_hash, + headers, + ): + """ + Uploads data from an iterator in fixed sized chunks to Azure Storage """ - - # Get the upload id from the response xml - if response.status != httplib.CREATED: - raise LibcloudError('Error initializing upload. Code: %d' % - (response.status), driver=self) data_hash = None - if calculate_hash: + if verify_hash: data_hash = self._get_hash_function() bytes_transferred = 0 count = 1 chunks = [] - headers = {} + headers = headers or {} lease.update_headers(headers) - if blob_type == 'BlockBlob': - params = {'comp': 'block'} - else: - params = {'comp': 'page'} + params = {"comp": "block"} - # Read the input data in chunk sizes suitable for AWS - for data in read_in_chunks(iterator, AZURE_CHUNK_SIZE): + # Read the input data in chunk sizes suitable for Azure + for data in read_in_chunks(stream, AZURE_UPLOAD_CHUNK_SIZE, fill_size=True): data = b(data) content_length = len(data) - offset = bytes_transferred bytes_transferred += content_length - if calculate_hash: + if verify_hash: data_hash.update(data) chunk_hash = self._get_hash_function() chunk_hash.update(data) chunk_hash = base64.b64encode(b(chunk_hash.digest())) - headers['Content-MD5'] = chunk_hash.decode('utf-8') - headers['Content-Length'] = content_length + headers["Content-MD5"] = chunk_hash.decode("utf-8") + headers["Content-Length"] = str(content_length) - if blob_type == 'BlockBlob': - # Block id can be any unique string that is base64 encoded - # A 10 digit number can hold the max value of 50000 blocks - # that are allowed for azure - block_id = base64.b64encode(b('%10d' % (count))) - block_id = block_id.decode('utf-8') - params['blockid'] = block_id + # Block id can be any unique string that is base64 encoded + # A 10 digit number can hold the max value of 50000 blocks + # that are allowed for azure + block_id = base64.b64encode(b("%10d" % (count))) + block_id = block_id.decode("utf-8") + params["blockid"] = block_id - # Keep this data for a later commit - chunks.append(block_id) - else: - headers['x-ms-page-write'] = 'update' - headers['x-ms-range'] = 'bytes=%d-%d' % \ - (offset, (bytes_transferred - 1)) + # Keep this data for a later commit + chunks.append(block_id) # Renew lease before updating lease.renew() - resp = self.connection.request(object_path, method='PUT', - data=data, headers=headers, - params=params) + resp = self.connection.request( + object_path, method="PUT", data=data, headers=headers, params=params + ) if resp.status != httplib.CREATED: resp.parse_error() - raise LibcloudError('Error uploading chunk %d. Code: %d' % - (count, resp.status), driver=self) + raise LibcloudError( + "Error uploading chunk %d. Code: %d" % (count, resp.status), + driver=self, + ) count += 1 - if calculate_hash: - data_hash = data_hash.hexdigest() - - if blob_type == 'BlockBlob': - self._commit_blocks(object_path, chunks, lease) - - # The Azure service does not return a hash immediately for - # chunked uploads. It takes some time for the data to get synced - response.headers['content-md5'] = None - - return (True, data_hash, bytes_transferred) + if verify_hash: + data_hash = base64.b64encode(b(data_hash.digest())) + data_hash = data_hash.decode("utf-8") + + response = self._commit_blocks( + object_path=object_path, + chunks=chunks, + lease=lease, + headers=headers, + meta_data=meta_data, + content_type=content_type, + data_hash=data_hash, + object_name=object_name, + file_path=file_path, + ) + + # According to the Azure docs: + # > This header refers to the content of the request, meaning, in this + # > case, the list of blocks, and not the content of the blob itself. + # However, the validation code assumes that the content-md5 in the + # server response refers to the object so we must discard the value + response.headers["content-md5"] = None + + return { + "response": response, + "data_hash": data_hash, + "bytes_transferred": bytes_transferred, + } - def _commit_blocks(self, object_path, chunks, lease): + def _commit_blocks( + self, + object_path, + chunks, + lease, + headers, + meta_data, + content_type, + data_hash, + object_name, + file_path, + ): """ Makes a final commit of the data. - - :param object_path: Server side object path. - :type object_path: ``str`` - - :param upload_id: A list of (chunk_number, chunk_hash) tuples. - :type upload_id: ``list`` """ - root = Element('BlockList') + root = ET.Element("BlockList") for block_id in chunks: - part = SubElement(root, 'Uncommitted') + part = ET.SubElement(root, "Uncommitted") part.text = str(block_id) data = tostring(root) - params = {'comp': 'blocklist'} - headers = {} + params = {"comp": "blocklist"} + headers = headers or {} lease.update_headers(headers) lease.renew() - response = self.connection.request(object_path, data=data, - params=params, headers=headers, - method='PUT') + headers["x-ms-blob-content-type"] = self._determine_content_type( + content_type, object_name, file_path + ) - if response.status != httplib.CREATED: - raise LibcloudError('Error in blocklist commit', driver=self) + if data_hash is not None: + headers["x-ms-blob-content-md5"] = data_hash - def _check_values(self, blob_type, object_size): - """ - Checks if extension arguments are valid + self._update_metadata(headers, meta_data) - :param blob_type: The blob type that is being uploaded - :type blob_type: ``str`` + data_hash = self._get_hash_function() + data_hash.update(data.encode("utf-8")) + data_hash = base64.b64encode(b(data_hash.digest())) + headers["Content-MD5"] = data_hash.decode("utf-8") - :param object_size: The (max) size of the object being uploaded - :type object_size: ``int`` - """ + headers["Content-Length"] = len(data) - if blob_type not in ['BlockBlob', 'PageBlob']: - raise LibcloudError('Invalid blob type', driver=self) + headers = self._fix_headers(headers) - if blob_type == 'PageBlob': - if not object_size: - raise LibcloudError('Max blob size is mandatory for page blob', - driver=self) + response = self.connection.request( + object_path, data=data, params=params, headers=headers, method="PUT" + ) - if object_size % AZURE_PAGE_CHUNK_SIZE: - raise LibcloudError('Max blob size is not aligned to ' - 'page boundary', driver=self) - - def upload_object(self, file_path, container, object_name, extra=None, - verify_hash=True, ex_blob_type=None, ex_use_lease=False): + if response.status != httplib.CREATED: + raise LibcloudError("Error in blocklist commit", driver=self) + + return response + + def upload_object( + self, + file_path, + container, + object_name, + verify_hash=True, + extra=None, + headers=None, + ex_use_lease=False, + **deprecated_kwargs, + ): """ Upload an object currently located on a disk. @inherits: :class:`StorageDriver.upload_object` - :param ex_blob_type: Storage class - :type ex_blob_type: ``str`` - :param ex_use_lease: Indicates if we must take a lease before upload :type ex_use_lease: ``bool`` """ - - if ex_blob_type is None: - ex_blob_type = self.ex_blob_type - - # Get the size of the file - file_size = os.stat(file_path).st_size - - # The presumed size of the object - object_size = file_size - - self._check_values(ex_blob_type, file_size) - - with file(file_path, 'rb') as file_handle: - iterator = iter(file_handle) - - # If size is greater than 64MB or type is Page, upload in chunks - if ex_blob_type == 'PageBlob' or file_size > AZURE_BLOCK_MAX_SIZE: - # For chunked upload of block blobs, the initial size must - # be 0. - if ex_blob_type == 'BlockBlob': - object_size = None - - object_path = self._get_object_path(container, object_name) - - upload_func = self._upload_in_chunks - upload_func_kwargs = {'iterator': iterator, - 'object_path': object_path, - 'blob_type': ex_blob_type, - 'lease': None} - else: - upload_func = self._stream_data - upload_func_kwargs = {'iterator': iterator, - 'chunked': False, - 'calculate_hash': verify_hash} - - return self._put_object(container=container, - object_name=object_name, - object_size=object_size, - upload_func=upload_func, - upload_func_kwargs=upload_func_kwargs, - file_path=file_path, extra=extra, - verify_hash=verify_hash, - blob_type=ex_blob_type, - use_lease=ex_use_lease) - - def upload_object_via_stream(self, iterator, container, object_name, - verify_hash=False, extra=None, - ex_use_lease=False, ex_blob_type=None, - ex_page_blob_size=None): + if deprecated_kwargs: + raise ValueError( + "Support for arguments was removed: %s" % ", ".join(deprecated_kwargs.keys()) + ) + + blob_size = os.stat(file_path).st_size + + with open(file_path, "rb") as fobj: + return self._put_object( + container=container, + object_name=object_name, + extra=extra, + verify_hash=verify_hash, + use_lease=ex_use_lease, + headers=headers, + blob_size=blob_size, + file_path=file_path, + stream=fobj, + ) + + def upload_object_via_stream( + self, + iterator, + container, + object_name, + verify_hash=True, + extra=None, + headers=None, + ex_use_lease=False, + **deprecated_kwargs, + ): """ @inherits: :class:`StorageDriver.upload_object_via_stream` - :param ex_blob_type: Storage class - :type ex_blob_type: ``str`` - - :param ex_page_blob_size: The maximum size to which the - page blob can grow to - :type ex_page_blob_size: ``int`` - :param ex_use_lease: Indicates if we must take a lease before upload :type ex_use_lease: ``bool`` """ - - if ex_blob_type is None: - ex_blob_type = self.ex_blob_type - - self._check_values(ex_blob_type, ex_page_blob_size) - - object_path = self._get_object_path(container, object_name) - - upload_func = self._upload_in_chunks - upload_func_kwargs = {'iterator': iterator, - 'object_path': object_path, - 'blob_type': ex_blob_type, - 'lease': None} - - return self._put_object(container=container, - object_name=object_name, - object_size=ex_page_blob_size, - upload_func=upload_func, - upload_func_kwargs=upload_func_kwargs, - extra=extra, verify_hash=verify_hash, - blob_type=ex_blob_type, - use_lease=ex_use_lease) + if deprecated_kwargs: + raise ValueError( + "Support for arguments was removed: %s" % ", ".join(deprecated_kwargs.keys()) + ) + + return self._put_object( + container=container, + object_name=object_name, + extra=extra, + verify_hash=verify_hash, + use_lease=ex_use_lease, + headers=headers, + blob_size=None, + stream=iterator, + ) def delete_object(self, obj): """ @inherits: :class:`StorageDriver.delete_object` """ object_path = self._get_object_path(obj.container, obj.name) - response = self.connection.request(object_path, method='DELETE') + response = self.connection.request(object_path, method="DELETE") if response.status == httplib.ACCEPTED: return True elif response.status == httplib.NOT_FOUND: - raise ObjectDoesNotExistError(value=None, driver=self, - object_name=obj.name) + raise ObjectDoesNotExistError(value=None, driver=self, object_name=obj.name) return False - def _update_metadata(self, headers, meta_data): + def _fix_headers(self, headers): """ - Update the given metadata in the headers + Update common HTTP headers to their equivalent in Azure Storage :param headers: The headers dictionary to be updated :type headers: ``dict`` - - :param meta_data: Metadata key value pairs - :type meta_data: ``dict`` """ - for key, value in list(meta_data.items()): - key = 'x-ms-meta-%s' % (key) - headers[key] = value + to_fix = ( + "cache-control", + "content-encoding", + "content-language", + ) - def _prepare_upload_headers(self, object_name, object_size, - extra, meta_data, blob_type): - """ - Prepare headers for uploading an object - - :param object_name: The full name of the object being updated - :type object_name: ``str`` + fixed = {} - :param object_size: The size of the object. In case of PageBlobs, - this indicates the maximum size the blob can grow to - :type object_size: ``int`` + for key, value in headers.items(): + key_lower = key.lower() - :param extra: Extra control data for the upload - :type extra: ``dict`` + if key_lower in to_fix: + fixed["x-ms-blob-%s" % key_lower] = value + else: + fixed[key] = value - :param meta_data: Metadata key value pairs - :type meta_data: ``dict`` + return fixed - :param blob_type: Page or Block blob type - :type blob_type: ``str`` + def _update_metadata(self, headers, meta_data): """ - headers = {} - - if blob_type is None: - blob_type = self.ex_blob_type - - headers['x-ms-blob-type'] = blob_type - - self._update_metadata(headers, meta_data) - - if object_size is not None: - headers['Content-Length'] = object_size + Update the given metadata in the headers - if blob_type == 'PageBlob': - headers['Content-Length'] = 0 - headers['x-ms-blob-content-length'] = object_size + :param headers: The headers dictionary to be updated + :type headers: ``dict`` - return headers + :param meta_data: Metadata key value pairs + :type meta_data: ``dict`` + """ + for key, value in list(meta_data.items()): + key = "x-ms-meta-%s" % (key) + headers[key] = value - def _put_object(self, container, object_name, object_size, upload_func, - upload_func_kwargs, file_path=None, extra=None, - verify_hash=True, blob_type=None, use_lease=False): + def _put_object( + self, + container, + object_name, + stream, + extra=None, + verify_hash=True, + headers=None, + blob_size=None, + file_path=None, + use_lease=False, + ): """ Control function that does the real job of uploading data to a blob """ extra = extra or {} - meta_data = extra.get('meta_data', {}) - content_type = extra.get('content_type', None) - - headers = self._prepare_upload_headers(object_name, object_size, - extra, meta_data, blob_type) + content_type = extra.get("content_type", None) + meta_data = extra.get("meta_data", {}) object_path = self._get_object_path(container, object_name) # Get a lease if required and do the operations with AzureBlobLease(self, object_path, use_lease) as lease: - if 'lease' in upload_func_kwargs: - upload_func_kwargs['lease'] = lease - - lease.update_headers(headers) - - iterator = iter('') - result_dict = self._upload_object(object_name, content_type, - upload_func, upload_func_kwargs, - object_path, headers=headers, - file_path=file_path, - iterator=iterator) - - response = result_dict['response'] - bytes_transferred = result_dict['bytes_transferred'] - data_hash = result_dict['data_hash'] + if blob_size is not None and blob_size <= AZURE_UPLOAD_CHUNK_SIZE: + result_dict = self._upload_directly( + stream=stream, + object_path=object_path, + lease=lease, + blob_size=blob_size, + meta_data=meta_data, + headers=headers, + content_type=content_type, + object_name=object_name, + file_path=file_path, + ) + else: + result_dict = self._upload_in_chunks( + stream=stream, + object_path=object_path, + lease=lease, + meta_data=meta_data, + headers=headers, + content_type=content_type, + object_name=object_name, + file_path=file_path, + verify_hash=verify_hash, + ) + + response = result_dict["response"] + bytes_transferred = result_dict["bytes_transferred"] + data_hash = result_dict["data_hash"] headers = response.headers - response = response.response if response.status != httplib.CREATED: raise LibcloudError( - 'Unexpected status code, status_code=%s' % (response.status), - driver=self) + "Unexpected status code, status_code=%s" % (response.status), + driver=self, + ) - server_hash = headers['content-md5'] + server_hash = headers.get("content-md5") if server_hash: server_hash = binascii.hexlify(base64.b64decode(b(server_hash))) - server_hash = server_hash.decode('utf-8') + server_hash = server_hash.decode("utf-8") else: # TODO: HACK - We could poll the object for a while and get # the hash pass - if (verify_hash and server_hash and data_hash != server_hash): + if verify_hash and server_hash and data_hash != server_hash: raise ObjectHashMismatchError( - value='MD5 hash checksum does not match', - object_name=object_name, driver=self) + value="MD5 hash checksum does not match", + object_name=object_name, + driver=self, + ) + + return Object( + name=object_name, + size=bytes_transferred, + hash=headers["etag"], + extra=None, + meta_data=meta_data, + container=container, + driver=self, + ) + + def _upload_directly( + self, + stream, + object_path, + lease, + blob_size, + meta_data, + content_type, + object_name, + file_path, + headers, + ): + headers = headers or {} + lease.update_headers(headers) + + self._update_metadata(headers, meta_data) + + headers["Content-Length"] = str(blob_size) + headers["x-ms-blob-type"] = "BlockBlob" - return Object(name=object_name, size=bytes_transferred, - hash=headers['etag'], extra=None, - meta_data=meta_data, container=container, - driver=self) + return self._upload_object( + object_name=object_name, + file_path=file_path, + content_type=content_type, + request_path=object_path, + stream=stream, + headers=headers, + ) def ex_set_object_metadata(self, obj, meta_data): """ @@ -973,14 +1266,15 @@ def ex_set_object_metadata(self, obj, meta_data): :type meta_data: ``dict`` """ object_path = self._get_object_path(obj.container, obj.name) - params = {'comp': 'metadata'} + params = {"comp": "metadata"} headers = {} self._update_metadata(headers, meta_data) - response = self.connection.request(object_path, method='PUT', - params=params, - headers=headers) + response = self.connection.request( + object_path, method="PUT", params=params, headers=headers + ) if response.status != httplib.OK: - response.parse_error('Setting metadata') + # pylint: disable=too-many-function-args + response.parse_error("Setting metadata") diff --git a/libcloud/storage/drivers/backblaze_b2.py b/libcloud/storage/drivers/backblaze_b2.py new file mode 100644 index 0000000000..37ee54336a --- /dev/null +++ b/libcloud/storage/drivers/backblaze_b2.py @@ -0,0 +1,632 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Driver for Backblaze B2 service. +""" + +import base64 +import hashlib + +from libcloud.utils.py3 import b, next, httplib, urlparse +from libcloud.common.base import JsonResponse, ConnectionUserAndKey +from libcloud.utils.files import read_in_chunks, exhaust_iterator +from libcloud.common.types import LibcloudError, InvalidCredsError +from libcloud.storage.base import Object, Container, StorageDriver +from libcloud.utils.escape import sanitize_object_name +from libcloud.storage.types import ObjectDoesNotExistError, ContainerDoesNotExistError +from libcloud.storage.providers import Provider + +try: + import simplejson as json +except ImportError: + import json # type: ignore + + +__all__ = [ + "BackblazeB2StorageDriver", + "BackblazeB2Connection", + "BackblazeB2AuthConnection", +] + +AUTH_API_HOST = "api.backblaze.com" +API_PATH = "/b2api/v1/" + + +class BackblazeB2Response(JsonResponse): + def success(self): + return self.status in [httplib.OK, httplib.CREATED, httplib.ACCEPTED] + + def parse_error(self): + status = int(self.status) + body = self.parse_body() + + if status == httplib.UNAUTHORIZED: + raise InvalidCredsError(body["message"]) + + return self.body + + +class BackblazeB2AuthConnection(ConnectionUserAndKey): + host = AUTH_API_HOST + secure = True + responseCls = BackblazeB2Response + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + # Those attributes are populated after authentication + self.account_id = None + self.api_url = None + self.api_host = None + self.download_url = None + self.download_host = None + self.auth_token = None + + def authenticate(self, force=False): + """ + :param force: Force authentication if if we have already obtained the + token. + :type force: ``bool`` + """ + + if not self._is_authentication_needed(force=force): + return self + + headers = {} + action = "b2_authorize_account" + auth_b64 = base64.b64encode(b("{}:{}".format(self.user_id, self.key))) + headers["Authorization"] = "Basic %s" % (auth_b64.decode("utf-8")) + + action = API_PATH + "b2_authorize_account" + resp = self.request(action=action, headers=headers, method="GET") + + if resp.status == httplib.OK: + self._parse_and_set_auth_info(data=resp.object) + else: + raise Exception("Failed to authenticate: %s" % (str(resp.object))) + + return self + + def _parse_and_set_auth_info(self, data): + result = {} + self.account_id = data["accountId"] + self.api_url = data["apiUrl"] + self.download_url = data["downloadUrl"] + self.auth_token = data["authorizationToken"] + + parsed_api_url = urlparse.urlparse(self.api_url) + self.api_host = parsed_api_url.netloc + + parsed_download_url = urlparse.urlparse(self.download_url) + self.download_host = parsed_download_url.netloc + + return result + + def _is_authentication_needed(self, force=False): + if not self.auth_token or force: + return True + + return False + + +class BackblazeB2Connection(ConnectionUserAndKey): + host = None # type: ignore # Note: host is set after authentication + secure = True + responseCls = BackblazeB2Response + authCls = BackblazeB2AuthConnection + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + # Stores info retrieved after authentication (auth token, api url, + # download url). + self._auth_conn = self.authCls(*args, **kwargs) + + def download_request(self, action, params=None): + # Lazily perform authentication + auth_conn = self._auth_conn.authenticate() + + # Set host to the download server + self._set_host(auth_conn.download_host) + + action = "/file/" + action + method = "GET" + raw = True + response = self._request( + auth_conn=auth_conn, action=action, params=params, method=method, raw=raw + ) + + return response + + def upload_request(self, action, headers, upload_host, auth_token, data): + # Lazily perform authentication + auth_conn = self._auth_conn.authenticate() + + # Upload host is dynamically retrieved for each upload request + self._set_host(host=upload_host) + + method = "POST" + raw = False + response = self._request( + auth_conn=auth_conn, + action=action, + params=None, + data=data, + headers=headers, + method=method, + raw=raw, + auth_token=auth_token, + ) + + return response + + def request( + self, + action, + params=None, + data=None, + headers=None, + method="GET", + raw=False, + include_account_id=False, + ): + params = params or {} + headers = headers or {} + + # Lazily perform authentication + auth_conn = self._auth_conn.authenticate() + + # Set host + self._set_host(host=auth_conn.api_host) + + # Include Content-Type + + if not raw and data: + headers["Content-Type"] = "application/json" + + # Include account id + + if include_account_id: + if method == "GET": + params["accountId"] = auth_conn.account_id + elif method == "POST": + data = data or {} + data["accountId"] = auth_conn.account_id + + action = API_PATH + action + + if data: + data = json.dumps(data) + + response = self._request( + auth_conn=self._auth_conn, + action=action, + params=params, + data=data, + method=method, + headers=headers, + raw=raw, + ) + + return response + + def _request( + self, + auth_conn, + action, + params=None, + data=None, + headers=None, + method="GET", + raw=False, + auth_token=None, + ): + params = params or {} + headers = headers or {} + + if not auth_token: + # If auth token is not explicitly provided, use the default one + auth_token = self._auth_conn.auth_token + + # Include auth token + headers["Authorization"] = "%s" % (auth_token) + response = super().request( + action=action, + params=params, + data=data, + method=method, + headers=headers, + raw=raw, + ) + + return response + + def _set_host(self, host): + """ + Dynamically set host which will be used for the following HTTP + requests. + + NOTE: This is needed because Backblaze uses different hosts for API, + download and upload requests. + """ + self.host = host + self.connection.host = "https://%s" % (host) + + +class BackblazeB2StorageDriver(StorageDriver): + connectionCls = BackblazeB2Connection + name = "Backblaze B2" + website = "https://www.backblaze.com/b2/" + type = Provider.BACKBLAZE_B2 + hash_type = "sha1" + supports_chunked_encoding = False + + def iterate_containers(self): + # pylint: disable=unexpected-keyword-arg + resp = self.connection.request( + action="b2_list_buckets", method="GET", include_account_id=True + ) + containers = self._to_containers(data=resp.object) + + return containers + + def iterate_container_objects(self, container, prefix=None, ex_prefix=None): + """ + Return a generator of objects for the given container. + + :param container: Container instance + :type container: :class:`Container` + + :param prefix: Filter objects starting with a prefix. + Filtering is performed client-side. + :type prefix: ``str`` + + :param ex_prefix: (Deprecated.) Filter objects starting with a prefix. + Filtering is performed client-side. + :type ex_prefix: ``str`` + + :return: A generator of Object instances. + :rtype: ``generator`` of :class:`Object` + """ + prefix = self._normalize_prefix_argument(prefix, ex_prefix) + + # TODO: Support pagination + params = {"bucketId": container.extra["id"]} + resp = self.connection.request(action="b2_list_file_names", method="GET", params=params) + objects = self._to_objects(data=resp.object, container=container) + + return self._filter_listed_container_objects(objects, prefix) + + def get_container(self, container_name): + containers = self.iterate_containers() + container = next((c for c in containers if c.name == container_name), None) + + if container: + return container + else: + raise ContainerDoesNotExistError(value=None, driver=self, container_name=container_name) + + def get_object(self, container_name, object_name): + container = self.get_container(container_name=container_name) + objects = self.iterate_container_objects(container=container) + + obj = next((obj for obj in objects if obj.name == object_name), None) + + if obj is not None: + return obj + else: + raise ObjectDoesNotExistError(value=None, driver=self, object_name=object_name) + + def create_container(self, container_name, ex_type="allPrivate"): + data = {} + data["bucketName"] = container_name + data["bucketType"] = ex_type + # pylint: disable=unexpected-keyword-arg + resp = self.connection.request( + action="b2_create_bucket", data=data, method="POST", include_account_id=True + ) + container = self._to_container(item=resp.object) + + return container + + def delete_container(self, container): + data = {} + data["bucketId"] = container.extra["id"] + # pylint: disable=unexpected-keyword-arg + resp = self.connection.request( + action="b2_delete_bucket", data=data, method="POST", include_account_id=True + ) + + return resp.status == httplib.OK + + def download_object( + self, obj, destination_path, overwrite_existing=False, delete_on_failure=True + ): + action = self._get_object_download_path(container=obj.container, obj=obj) + # pylint: disable=no-member + response = self.connection.download_request(action=action) + + # TODO: Include metadata from response headers + + return self._get_object( + obj=obj, + callback=self._save_object, + response=response, + callback_kwargs={ + "obj": obj, + "response": response.response, + "destination_path": destination_path, + "overwrite_existing": overwrite_existing, + "delete_on_failure": delete_on_failure, + }, + success_status_code=httplib.OK, + ) + + def download_object_as_stream(self, obj, chunk_size=None): + action = self._get_object_download_path(container=obj.container, obj=obj) + # pylint: disable=no-member + response = self.connection.download_request(action=action) + + return self._get_object( + obj=obj, + callback=read_in_chunks, + response=response, + callback_kwargs={ + "iterator": response.iter_content(chunk_size), + "chunk_size": chunk_size, + }, + success_status_code=httplib.OK, + ) + + def upload_object( + self, + file_path, + container, + object_name, + extra=None, + verify_hash=True, + headers=None, + ): + """ + Upload an object. + + Note: This will override file with a same name if it already exists. + """ + # Note: We don't use any of the base driver functions since Backblaze + # API requires you to provide SHA1 has upfront and the base methods + # don't support that + + with open(file_path, "rb") as fp: + iterator = iter(fp) + iterator = read_in_chunks(iterator=iterator) + data = exhaust_iterator(iterator=iterator) + + obj = self._perform_upload( + data=data, + container=container, + object_name=object_name, + extra=extra, + verify_hash=verify_hash, + headers=headers, + ) + + return obj + + def upload_object_via_stream(self, iterator, container, object_name, extra=None, headers=None): + """ + Upload an object. + + Note: Backblaze does not yet support uploading via stream, + so this calls upload_object internally requiring the object data + to be loaded into memory at once + """ + + iterator = read_in_chunks(iterator=iterator) + data = exhaust_iterator(iterator=iterator) + + obj = self._perform_upload( + data=data, + container=container, + object_name=object_name, + extra=extra, + headers=headers, + ) + + return obj + + def delete_object(self, obj): + data = {} + data["fileName"] = obj.name + data["fileId"] = obj.extra["fileId"] + resp = self.connection.request(action="b2_delete_file_version", data=data, method="POST") + + return resp.status == httplib.OK + + def ex_get_object(self, object_id): + params = {} + params["fileId"] = object_id + resp = self.connection.request(action="b2_get_file_info", method="GET", params=params) + obj = self._to_object(item=resp.object, container=None) + + return obj + + def ex_hide_object(self, container_id, object_name): + data = {} + data["bucketId"] = container_id + data["fileName"] = object_name + resp = self.connection.request(action="b2_hide_file", data=data, method="POST") + obj = self._to_object(item=resp.object, container=None) + + return obj + + def ex_list_object_versions( + self, + container_id, + ex_start_file_name=None, + ex_start_file_id=None, + ex_max_file_count=None, + ): + params = {} + params["bucketId"] = container_id + + if ex_start_file_name: + params["startFileName"] = ex_start_file_name + + if ex_start_file_id: + params["startFileId"] = ex_start_file_id + + if ex_max_file_count: + params["maxFileCount"] = ex_max_file_count + + resp = self.connection.request(action="b2_list_file_versions", params=params, method="GET") + objects = self._to_objects(data=resp.object, container=None) + + return objects + + def ex_get_upload_data(self, container_id): + """ + Retrieve information used for uploading files (upload url, auth token, + etc). + + :rype: ``dict`` + """ + # TODO: This is static (AFAIK) so it could be cached + params = {} + params["bucketId"] = container_id + response = self.connection.request(action="b2_get_upload_url", method="GET", params=params) + + return response.object + + def ex_get_upload_url(self, container_id): + """ + Retrieve URL used for file uploads. + + :rtype: ``str`` + """ + result = self.ex_get_upload_data(container_id=container_id) + upload_url = result["uploadUrl"] + + return upload_url + + def _to_containers(self, data): + result = [] + + for item in data["buckets"]: + container = self._to_container(item=item) + result.append(container) + + return result + + def _to_container(self, item): + extra = {} + extra["id"] = item["bucketId"] + extra["bucketType"] = item["bucketType"] + container = Container(name=item["bucketName"], extra=extra, driver=self) + + return container + + def _to_objects(self, data, container): + result = [] + + for item in data["files"]: + obj = self._to_object(item=item, container=container) + result.append(obj) + + return result + + def _to_object(self, item, container=None): + extra = {} + extra["fileId"] = item["fileId"] + extra["uploadTimestamp"] = item.get("uploadTimestamp", None) + size = item.get("size", item.get("contentLength", None)) + hash = item.get("contentSha1", None) + meta_data = item.get("fileInfo", {}) + obj = Object( + name=item["fileName"], + size=size, + hash=hash, + extra=extra, + meta_data=meta_data, + container=container, + driver=self, + ) + + return obj + + def _get_object_download_path(self, container, obj): + """ + Return a path used in the download requests. + + :rtype: ``str`` + """ + path = container.name + "/" + obj.name + + return path + + def _perform_upload( + self, data, container, object_name, extra=None, verify_hash=True, headers=None + ): + if isinstance(data, str): + data = bytearray(data) + + object_name = sanitize_object_name(object_name) + + extra = extra or {} + content_type = extra.get("content_type", "b2/x-auto") + meta_data = extra.get("meta_data", {}) + + # Note: Backblaze API doesn't support chunked encoding and we need to + # provide Content-Length up front (this is one inside _upload_object):/ + headers = headers or {} + headers["X-Bz-File-Name"] = object_name + headers["Content-Type"] = content_type + + sha1 = hashlib.sha1() # nosec + sha1.update(b(data)) + headers["X-Bz-Content-Sha1"] = sha1.hexdigest() + + # Include optional meta-data (up to 10 items) + + for key, value in meta_data.items(): + # TODO: Encode / escape key + headers["X-Bz-Info-%s" % (key)] = value + + upload_data = self.ex_get_upload_data(container_id=container.extra["id"]) + upload_token = upload_data["authorizationToken"] + parsed_url = urlparse.urlparse(upload_data["uploadUrl"]) + + upload_host = parsed_url.netloc + request_path = parsed_url.path + + # pylint: disable=no-member + response = self.connection.upload_request( + action=request_path, + headers=headers, + upload_host=upload_host, + auth_token=upload_token, + data=data, + ) + + if response.status == httplib.OK: + obj = self._to_object(item=response.object, container=container) + + return obj + else: + body = response.response.read() + raise LibcloudError( + "Upload failed. status_code={}, body={}".format(response.status, body), + driver=self, + ) diff --git a/libcloud/storage/drivers/cloudfiles.py b/libcloud/storage/drivers/cloudfiles.py index ef854fc9f8..61e1c562fb 100644 --- a/libcloud/storage/drivers/cloudfiles.py +++ b/libcloud/storage/drivers/cloudfiles.py @@ -13,49 +13,42 @@ # See the License for the specific language governing permissions and # limitations under the License. -from hashlib import sha1 -import hmac import os +import hmac +import atexit from time import time +from hashlib import sha1 -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlencode +from libcloud.utils.py3 import b, httplib, urlquote, urlencode +from libcloud.common.base import Response, RawResponse +from libcloud.utils.files import read_in_chunks +from libcloud.common.types import LibcloudError, MalformedResponseError +from libcloud.storage.base import Object, Container, StorageDriver +from libcloud.storage.types import ( + ObjectDoesNotExistError, + ObjectHashMismatchError, + ContainerIsNotEmptyError, + InvalidContainerNameError, + ContainerDoesNotExistError, + ContainerAlreadyExistsError, +) +from libcloud.common.openstack import OpenStackDriverMixin, OpenStackBaseConnection +from libcloud.common.rackspace import AUTH_URL +from libcloud.storage.providers import Provider try: import simplejson as json except ImportError: - import json + import json # type: ignore -from libcloud.utils.py3 import PY3 -from libcloud.utils.py3 import b -from libcloud.utils.py3 import urlquote +from io import FileIO as file -if PY3: - from io import FileIO as file - -from libcloud.utils.files import read_in_chunks -from libcloud.common.types import MalformedResponseError, LibcloudError -from libcloud.common.base import Response, RawResponse - -from libcloud.storage.providers import Provider -from libcloud.storage.base import Object, Container, StorageDriver -from libcloud.storage.types import ContainerAlreadyExistsError -from libcloud.storage.types import ContainerDoesNotExistError -from libcloud.storage.types import ContainerIsNotEmptyError -from libcloud.storage.types import ObjectDoesNotExistError -from libcloud.storage.types import ObjectHashMismatchError -from libcloud.storage.types import InvalidContainerNameError -from libcloud.common.openstack import OpenStackBaseConnection -from libcloud.common.openstack import OpenStackDriverMixin - -from libcloud.common.rackspace import AUTH_URL - -CDN_HOST = 'cdn.clouddrive.com' -API_VERSION = 'v1.0' +CDN_HOST = "cdn.clouddrive.com" +API_VERSION = "v1.0" # Keys which are used to select a correct endpoint from the service catalog. -INTERNAL_ENDPOINT_KEY = 'internalURL' -PUBLIC_ENDPOINT_KEY = 'publicURL' +INTERNAL_ENDPOINT_KEY = "internalURL" +PUBLIC_ENDPOINT_KEY = "publicURL" class CloudFilesResponse(Response): @@ -63,31 +56,33 @@ class CloudFilesResponse(Response): def success(self): i = int(self.status) - return i >= 200 and i <= 299 or i in self.valid_response_codes + return 200 <= i <= 299 or i in self.valid_response_codes def parse_body(self): if not self.body: return None - if 'content-type' in self.headers: - key = 'content-type' - elif 'Content-Type' in self.headers: - key = 'Content-Type' + if "content-type" in self.headers: + key = "content-type" + elif "Content-Type" in self.headers: + key = "Content-Type" else: - raise LibcloudError('Missing content-type header') + raise LibcloudError("Missing content-type header") content_type = self.headers[key] - if content_type.find(';') != -1: - content_type = content_type.split(';')[0] + if content_type.find(";") != -1: + content_type = content_type.split(";")[0] - if content_type == 'application/json': + if content_type == "application/json": try: data = json.loads(self.body) - except: - raise MalformedResponseError('Failed to parse JSON', - body=self.body, - driver=CloudFilesStorageDriver) - elif content_type == 'text/plain': + except Exception: + raise MalformedResponseError( + "Failed to parse JSON", + body=self.body, + driver=CloudFilesStorageDriver, + ) + elif content_type == "text/plain": data = self.body else: data = self.body @@ -108,20 +103,18 @@ class OpenStackSwiftConnection(OpenStackBaseConnection): rawResponseCls = CloudFilesRawResponse auth_url = AUTH_URL - _auth_version = '1.0' + _auth_version = "1.0" # TODO: Reverse the relationship - Swift -> CloudFiles def __init__(self, user_id, key, secure=True, **kwargs): # Ignore this for now - kwargs.pop('use_internal_url', None) - super(OpenStackSwiftConnection, self).__init__(user_id, key, - secure=secure, - **kwargs) + kwargs.pop("use_internal_url", None) + super().__init__(user_id, key, secure=secure, **kwargs) self.api_version = API_VERSION - self.accept_format = 'application/json' + self.accept_format = "application/json" - self._service_type = self._ex_force_service_type or 'object-store' - self._service_name = self._ex_force_service_name or 'swift' + self._service_type = self._ex_force_service_type or "object-store" + self._service_name = self._ex_force_service_name or "swift" if self._ex_force_service_region: self._service_region = self._ex_force_service_region @@ -129,38 +122,53 @@ def __init__(self, user_id, key, secure=True, **kwargs): self._service_region = None def get_endpoint(self, *args, **kwargs): - if '2.0' in self._auth_version: + if ("2.0" in self._auth_version) or ("3.x" in self._auth_version): endpoint = self.service_catalog.get_endpoint( service_type=self._service_type, name=self._service_name, - region=self._service_region) - elif ('1.1' in self._auth_version) or ('1.0' in self._auth_version): + region=self._service_region, + ) + elif ("1.1" in self._auth_version) or ("1.0" in self._auth_version): endpoint = self.service_catalog.get_endpoint( - name=self._service_name, region=self._service_region) + name=self._service_name, region=self._service_region + ) + else: + endpoint = None if endpoint: return endpoint.url else: - raise LibcloudError('Could not find specified endpoint') - - def request(self, action, params=None, data='', headers=None, method='GET', - raw=False, cdn_request=False): + raise LibcloudError("Could not find specified endpoint") + + def request( + self, + action, + params=None, + data="", + headers=None, + method="GET", + raw=False, + cdn_request=False, + ): if not headers: headers = {} if not params: params = {} self.cdn_request = cdn_request - params['format'] = 'json' + params["format"] = "json" - if method in ['POST', 'PUT'] and 'Content-Type' not in headers: - headers.update({'Content-Type': 'application/json; charset=UTF-8'}) + if method in ["POST", "PUT"] and "Content-Type" not in headers: + headers.update({"Content-Type": "application/json; charset=UTF-8"}) - return super(OpenStackSwiftConnection, self).request( + return super().request( action=action, - params=params, data=data, - method=method, headers=headers, - raw=raw) + params=params, + data=data, + method=method, + headers=headers, + raw=raw, + ) class CloudFilesConnection(OpenStackSwiftConnection): @@ -172,160 +180,184 @@ class CloudFilesConnection(OpenStackSwiftConnection): rawResponseCls = CloudFilesRawResponse auth_url = AUTH_URL - _auth_version = '2.0' + _auth_version = "2.0" - def __init__(self, user_id, key, secure=True, - use_internal_url=False, **kwargs): - super(CloudFilesConnection, self).__init__(user_id, key, secure=secure, - **kwargs) + def __init__(self, user_id, key, secure=True, use_internal_url=False, **kwargs): + super().__init__(user_id, key, secure=secure, **kwargs) self.api_version = API_VERSION - self.accept_format = 'application/json' + self.accept_format = "application/json" self.cdn_request = False self.use_internal_url = use_internal_url def get_endpoint(self): region = self._ex_force_service_region.upper() - if self.use_internal_url: - endpoint_type = 'internal' - else: - endpoint_type = 'external' - - if '2.0' in self._auth_version: + if "2.0" in self._auth_version: ep = self.service_catalog.get_endpoint( - service_type='object-store', - name='cloudFiles', + service_type="object-store", + name="cloudFiles", region=region, - endpoint_type=endpoint_type) + endpoint_type="internal" if self.use_internal_url else "external", + ) cdn_ep = self.service_catalog.get_endpoint( - service_type='rax:object-cdn', - name='cloudFilesCDN', + service_type="rax:object-cdn", + name="cloudFilesCDN", region=region, - endpoint_type=endpoint_type) + # Cloud Files has no concept of an "internal" CDN. + endpoint_type="external", + ) else: - raise LibcloudError( - 'Auth version "%s" not supported' % (self._auth_version)) + raise LibcloudError('Auth version "%s" not supported' % (self._auth_version)) # if this is a CDN request, return the cdn url instead if self.cdn_request: ep = cdn_ep if not ep or not ep.url: - raise LibcloudError('Could not find specified endpoint') + raise LibcloudError("Could not find specified endpoint") return ep.url - def request(self, action, params=None, data='', headers=None, method='GET', - raw=False, cdn_request=False): + def request( + self, + action, + params=None, + data="", + headers=None, + method="GET", + raw=False, + cdn_request=False, + ): if not headers: headers = {} if not params: params = {} self.cdn_request = cdn_request - params['format'] = 'json' + params["format"] = "json" - if method in ['POST', 'PUT'] and 'Content-Type' not in headers: - headers.update({'Content-Type': 'application/json; charset=UTF-8'}) + if method in ["POST", "PUT"] and "Content-Type" not in headers: + headers.update({"Content-Type": "application/json; charset=UTF-8"}) - return super(CloudFilesConnection, self).request( + return super().request( action=action, - params=params, data=data, - method=method, headers=headers, - raw=raw, cdn_request=cdn_request) + params=params, + data=data, + method=method, + headers=headers, + raw=raw, + cdn_request=cdn_request, + ) class CloudFilesStorageDriver(StorageDriver, OpenStackDriverMixin): """ CloudFiles driver. """ - name = 'CloudFiles' - website = 'http://www.rackspace.com/' + + name = "CloudFiles" + website = "http://www.rackspace.com/" connectionCls = CloudFilesConnection - hash_type = 'md5' + hash_type = "md5" supports_chunked_encoding = True - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region='ord', use_internal_url=False, **kwargs): + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + region="ord", + use_internal_url=False, + **kwargs, + ): """ @inherits: :class:`StorageDriver.__init__` :param region: ID of the region which should be used. :type region: ``str`` """ - # This is here for backard compatibility - if 'ex_force_service_region' in kwargs: - region = kwargs['ex_force_service_region'] + # This is here for backward compatibility + if "ex_force_service_region" in kwargs: + region = kwargs["ex_force_service_region"] self.use_internal_url = use_internal_url - OpenStackDriverMixin.__init__(self, (), **kwargs) - super(CloudFilesStorageDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, region=region, - **kwargs) + OpenStackDriverMixin.__init__(self, **kwargs) + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + region=region, + **kwargs, + ) + + @classmethod + def list_regions(cls): + return ["ord", "dfw", "iad", "lon", "hkg", "syd"] def iterate_containers(self): - response = self.connection.request('') + response = self.connection.request("") if response.status == httplib.NO_CONTENT: return [] elif response.status == httplib.OK: return self._to_container_list(json.loads(response.body)) - raise LibcloudError('Unexpected status code: %s' % (response.status)) + raise LibcloudError("Unexpected status code: %s" % (response.status)) def get_container(self, container_name): container_name_encoded = self._encode_container_name(container_name) - response = self.connection.request('/%s' % (container_name_encoded), - method='HEAD') + response = self.connection.request("/%s" % (container_name_encoded), method="HEAD") if response.status == httplib.NO_CONTENT: - container = self._headers_to_container( - container_name, response.headers) + container = self._headers_to_container(container_name, response.headers) return container elif response.status == httplib.NOT_FOUND: raise ContainerDoesNotExistError(None, self, container_name) - raise LibcloudError('Unexpected status code: %s' % (response.status)) + raise LibcloudError("Unexpected status code: %s" % (response.status)) def get_object(self, container_name, object_name): container = self.get_container(container_name) container_name_encoded = self._encode_container_name(container_name) object_name_encoded = self._encode_object_name(object_name) - response = self.connection.request('/%s/%s' % (container_name_encoded, - object_name_encoded), - method='HEAD') + response = self.connection.request( + "/{}/{}".format(container_name_encoded, object_name_encoded), method="HEAD" + ) if response.status in [httplib.OK, httplib.NO_CONTENT]: - obj = self._headers_to_object( - object_name, container, response.headers) + obj = self._headers_to_object(object_name, container, response.headers) return obj elif response.status == httplib.NOT_FOUND: raise ObjectDoesNotExistError(None, self, object_name) - raise LibcloudError('Unexpected status code: %s' % (response.status)) + raise LibcloudError("Unexpected status code: %s" % (response.status)) - def get_container_cdn_url(self, container): + def get_container_cdn_url(self, container, ex_ssl_uri=False): # pylint: disable=unexpected-keyword-arg container_name_encoded = self._encode_container_name(container.name) - response = self.connection.request('/%s' % (container_name_encoded), - method='HEAD', - cdn_request=True) + response = self.connection.request( + "/%s" % (container_name_encoded), method="HEAD", cdn_request=True + ) if response.status == httplib.NO_CONTENT: - cdn_url = response.headers['x-cdn-uri'] + if ex_ssl_uri: + cdn_url = response.headers["x-cdn-ssl-uri"] + else: + cdn_url = response.headers["x-cdn-uri"] return cdn_url elif response.status == httplib.NOT_FOUND: - raise ContainerDoesNotExistError(value='', - container_name=container.name, - driver=self) + raise ContainerDoesNotExistError(value="", container_name=container.name, driver=self) - raise LibcloudError('Unexpected status code: %s' % (response.status)) + raise LibcloudError("Unexpected status code: %s" % (response.status)) def get_object_cdn_url(self, obj): container_cdn_url = self.get_container_cdn_url(container=obj.container) - return '%s/%s' % (container_cdn_url, obj.name) + return "{}/{}".format(container_cdn_url, obj.name) def enable_container_cdn(self, container, ex_ttl=None): """ @@ -335,129 +367,199 @@ def enable_container_cdn(self, container, ex_ttl=None): :type ex_ttl: ``int`` """ container_name = self._encode_container_name(container.name) - headers = {'X-CDN-Enabled': 'True'} + headers = {"X-CDN-Enabled": "True"} if ex_ttl: - headers['X-TTL'] = ex_ttl + headers["X-TTL"] = ex_ttl # pylint: disable=unexpected-keyword-arg - response = self.connection.request('/%s' % (container_name), - method='PUT', - headers=headers, - cdn_request=True) + response = self.connection.request( + "/%s" % (container_name), method="PUT", headers=headers, cdn_request=True + ) return response.status in [httplib.CREATED, httplib.ACCEPTED] def create_container(self, container_name): container_name_encoded = self._encode_container_name(container_name) - response = self.connection.request( - '/%s' % (container_name_encoded), method='PUT') + response = self.connection.request("/%s" % (container_name_encoded), method="PUT") if response.status == httplib.CREATED: # Accepted mean that container is not yet created but it will be # eventually - extra = {'object_count': 0} - container = Container(name=container_name, - extra=extra, driver=self) + extra = {"object_count": 0} + container = Container(name=container_name, extra=extra, driver=self) return container elif response.status == httplib.ACCEPTED: error = ContainerAlreadyExistsError(None, self, container_name) raise error - raise LibcloudError('Unexpected status code: %s' % (response.status)) + raise LibcloudError("Unexpected status code: %s" % (response.status)) def delete_container(self, container): name = self._encode_container_name(container.name) # Only empty container can be deleted - response = self.connection.request('/%s' % (name), method='DELETE') + response = self.connection.request("/%s" % (name), method="DELETE") if response.status == httplib.NO_CONTENT: return True elif response.status == httplib.NOT_FOUND: - raise ContainerDoesNotExistError(value='', - container_name=name, driver=self) + raise ContainerDoesNotExistError(value="", container_name=name, driver=self) elif response.status == httplib.CONFLICT: # @TODO: Add "delete_all_objects" parameter? - raise ContainerIsNotEmptyError(value='', - container_name=name, driver=self) + raise ContainerIsNotEmptyError(value="", container_name=name, driver=self) - def download_object(self, obj, destination_path, overwrite_existing=False, - delete_on_failure=True): + def download_object( + self, obj, destination_path, overwrite_existing=False, delete_on_failure=True + ): container_name = obj.container.name object_name = obj.name - response = self.connection.request('/%s/%s' % (container_name, - object_name), - method='GET', raw=True) + response = self.connection.request( + "/{}/{}".format(container_name, object_name), method="GET", raw=True + ) return self._get_object( - obj=obj, callback=self._save_object, response=response, - callback_kwargs={'obj': obj, - 'response': response.response, - 'destination_path': destination_path, - 'overwrite_existing': overwrite_existing, - 'delete_on_failure': delete_on_failure}, - success_status_code=httplib.OK) + obj=obj, + callback=self._save_object, + response=response, + callback_kwargs={ + "obj": obj, + "response": response.response, + "destination_path": destination_path, + "overwrite_existing": overwrite_existing, + "delete_on_failure": delete_on_failure, + }, + success_status_code=httplib.OK, + ) def download_object_as_stream(self, obj, chunk_size=None): container_name = obj.container.name object_name = obj.name - response = self.connection.request('/%s/%s' % (container_name, - object_name), - method='GET', raw=True) - - return self._get_object(obj=obj, callback=read_in_chunks, - response=response, - callback_kwargs={'iterator': response.response, - 'chunk_size': chunk_size}, - success_status_code=httplib.OK) - - def upload_object(self, file_path, container, object_name, extra=None, - verify_hash=True, headers=None): + response = self.connection.request( + "/{}/{}".format(container_name, object_name), method="GET", raw=True + ) + + return self._get_object( + obj=obj, + callback=read_in_chunks, + response=response, + callback_kwargs={ + "iterator": response.iter_content(chunk_size), + "chunk_size": chunk_size, + }, + success_status_code=httplib.OK, + ) + + def download_object_range( + self, + obj, + destination_path, + start_bytes, + end_bytes=None, + overwrite_existing=False, + delete_on_failure=True, + ): + self._validate_start_and_end_bytes(start_bytes=start_bytes, end_bytes=end_bytes) + + container_name = obj.container.name + object_name = obj.name + headers = {"Range": self._get_standard_range_str(start_bytes, end_bytes)} + response = self.connection.request( + "/{}/{}".format(container_name, object_name), + method="GET", + headers=headers, + raw=True, + ) + + return self._get_object( + obj=obj, + callback=self._save_object, + response=response, + callback_kwargs={ + "obj": obj, + "response": response.response, + "destination_path": destination_path, + "overwrite_existing": overwrite_existing, + "delete_on_failure": delete_on_failure, + "partial_download": True, + }, + success_status_code=httplib.PARTIAL_CONTENT, + ) + + def download_object_range_as_stream(self, obj, start_bytes, end_bytes=None, chunk_size=None): + self._validate_start_and_end_bytes(start_bytes=start_bytes, end_bytes=end_bytes) + container_name = obj.container.name + object_name = obj.name + headers = {"Range": self._get_standard_range_str(start_bytes, end_bytes)} + response = self.connection.request( + "/{}/{}".format(container_name, object_name), + headers=headers, + method="GET", + raw=True, + ) + + return self._get_object( + obj=obj, + callback=read_in_chunks, + response=response, + callback_kwargs={ + "iterator": response.iter_content(chunk_size), + "chunk_size": chunk_size, + }, + success_status_code=httplib.PARTIAL_CONTENT, + ) + + def upload_object( + self, + file_path, + container, + object_name, + extra=None, + verify_hash=True, + headers=None, + ): """ Upload an object. Note: This will override file with a same name if it already exists. """ - upload_func = self._upload_file - upload_func_kwargs = {'file_path': file_path} - - return self._put_object(container=container, object_name=object_name, - upload_func=upload_func, - upload_func_kwargs=upload_func_kwargs, - extra=extra, file_path=file_path, - verify_hash=verify_hash, headers=headers) - - def upload_object_via_stream(self, iterator, - container, object_name, extra=None, - headers=None): + + return self._put_object( + container=container, + object_name=object_name, + extra=extra, + file_path=file_path, + verify_hash=verify_hash, + headers=headers, + ) + + def upload_object_via_stream(self, iterator, container, object_name, extra=None, headers=None): if isinstance(iterator, file): iterator = iter(iterator) - upload_func = self._stream_data - upload_func_kwargs = {'iterator': iterator} - - return self._put_object(container=container, object_name=object_name, - upload_func=upload_func, - upload_func_kwargs=upload_func_kwargs, - extra=extra, iterator=iterator, - headers=headers) + return self._put_object( + container=container, + object_name=object_name, + extra=extra, + stream=iterator, + headers=headers, + ) def delete_object(self, obj): container_name = self._encode_container_name(obj.container.name) object_name = self._encode_object_name(obj.name) response = self.connection.request( - '/%s/%s' % (container_name, object_name), method='DELETE') + "/{}/{}".format(container_name, object_name), method="DELETE" + ) if response.status == httplib.NO_CONTENT: return True elif response.status == httplib.NOT_FOUND: - raise ObjectDoesNotExistError(value='', object_name=object_name, - driver=self) + raise ObjectDoesNotExistError(value="", object_name=object_name, driver=self) - raise LibcloudError('Unexpected status code: %s' % (response.status)) + raise LibcloudError("Unexpected status code: %s" % (response.status)) def ex_purge_object_from_cdn(self, obj, email=None): """ @@ -469,14 +571,15 @@ def ex_purge_object_from_cdn(self, obj, email=None): """ container_name = self._encode_container_name(obj.container.name) object_name = self._encode_object_name(obj.name) - headers = {'X-Purge-Email': email} if email else {} + headers = {"X-Purge-Email": email} if email else {} # pylint: disable=unexpected-keyword-arg - response = self.connection.request('/%s/%s' % (container_name, - object_name), - method='DELETE', - headers=headers, - cdn_request=True) + response = self.connection.request( + "/{}/{}".format(container_name, object_name), + method="DELETE", + headers=headers, + cdn_request=True, + ) return response.status == httplib.NO_CONTENT @@ -486,48 +589,57 @@ def ex_get_meta_data(self): :rtype: ``dict`` """ - response = self.connection.request('', method='HEAD') + response = self.connection.request("", method="HEAD") if response.status == httplib.NO_CONTENT: - container_count = response.headers.get( - 'x-account-container-count', 'unknown') - object_count = response.headers.get( - 'x-account-object-count', 'unknown') - bytes_used = response.headers.get( - 'x-account-bytes-used', 'unknown') - temp_url_key = response.headers.get( - 'x-account-meta-temp-url-key', None) - - return {'container_count': int(container_count), - 'object_count': int(object_count), - 'bytes_used': int(bytes_used), - 'temp_url_key': temp_url_key} - - raise LibcloudError('Unexpected status code: %s' % (response.status)) - - def ex_multipart_upload_object(self, file_path, container, object_name, - chunk_size=33554432, extra=None, - verify_hash=True): + container_count = response.headers.get("x-account-container-count", "unknown") + object_count = response.headers.get("x-account-object-count", "unknown") + bytes_used = response.headers.get("x-account-bytes-used", "unknown") + temp_url_key = response.headers.get("x-account-meta-temp-url-key", None) + + return { + "container_count": int(container_count), + "object_count": int(object_count), + "bytes_used": int(bytes_used), + "temp_url_key": temp_url_key, + } + + raise LibcloudError("Unexpected status code: %s" % (response.status)) + + def ex_multipart_upload_object( + self, + file_path, + container, + object_name, + chunk_size=33554432, + extra=None, + verify_hash=True, + ): object_size = os.path.getsize(file_path) if object_size < chunk_size: - return self.upload_object(file_path, container, object_name, - extra=extra, verify_hash=verify_hash) + return self.upload_object( + file_path, container, object_name, extra=extra, verify_hash=verify_hash + ) iter_chunk_reader = FileChunkReader(file_path, chunk_size) for index, iterator in enumerate(iter_chunk_reader): - self._upload_object_part(container=container, - object_name=object_name, - part_number=index, - iterator=iterator, - verify_hash=verify_hash) - - return self._upload_object_manifest(container=container, - object_name=object_name, - extra=extra, - verify_hash=verify_hash) - - def ex_enable_static_website(self, container, index_file='index.html'): + self._upload_object_part( + container=container, + object_name=object_name, + part_number=index, + iterator=iterator, + verify_hash=verify_hash, + ) + + return self._upload_object_manifest( + container=container, + object_name=object_name, + extra=extra, + verify_hash=verify_hash, + ) + + def ex_enable_static_website(self, container, index_file="index.html"): """ Enable serving a static website. @@ -541,17 +653,16 @@ def ex_enable_static_website(self, container, index_file='index.html'): :rtype: ``bool`` """ container_name = container.name - headers = {'X-Container-Meta-Web-Index': index_file} + headers = {"X-Container-Meta-Web-Index": index_file} # pylint: disable=unexpected-keyword-arg - response = self.connection.request('/%s' % (container_name), - method='POST', - headers=headers, - cdn_request=False) + response = self.connection.request( + "/%s" % (container_name), method="POST", headers=headers, cdn_request=False + ) return response.status in [httplib.CREATED, httplib.ACCEPTED] - def ex_set_error_page(self, container, file_name='error.html'): + def ex_set_error_page(self, container, file_name="error.html"): """ Set a custom error page which is displayed if file is not found and serving of a static website is enabled. @@ -565,13 +676,12 @@ def ex_set_error_page(self, container, file_name='error.html'): :rtype: ``bool`` """ container_name = container.name - headers = {'X-Container-Meta-Web-Error': file_name} + headers = {"X-Container-Meta-Web-Error": file_name} # pylint: disable=unexpected-keyword-arg - response = self.connection.request('/%s' % (container_name), - method='POST', - headers=headers, - cdn_request=False) + response = self.connection.request( + "/%s" % (container_name), method="POST", headers=headers, cdn_request=False + ) return response.status in [httplib.CREATED, httplib.ACCEPTED] @@ -585,18 +695,19 @@ def ex_set_account_metadata_temp_url_key(self, key): :rtype: ``bool`` """ - headers = {'X-Account-Meta-Temp-URL-Key': key} + headers = {"X-Account-Meta-Temp-URL-Key": key} # pylint: disable=unexpected-keyword-arg - response = self.connection.request('', - method='POST', - headers=headers, - cdn_request=False) + response = self.connection.request("", method="POST", headers=headers, cdn_request=False) - return response.status in [httplib.OK, httplib.NO_CONTENT, - httplib.CREATED, httplib.ACCEPTED] + return response.status in [ + httplib.OK, + httplib.NO_CONTENT, + httplib.CREATED, + httplib.ACCEPTED, + ] - def ex_get_object_temp_url(self, obj, method='GET', timeout=60): + def ex_get_object_temp_url(self, obj, method="GET", timeout=60): """ Create a temporary URL to allow others to retrieve or put objects in your Cloud Files account for as long or as short a time as you @@ -618,61 +729,61 @@ def ex_get_object_temp_url(self, obj, method='GET', timeout=60): # pylint: disable=no-member self.connection._populate_hosts_and_request_paths() expires = int(time() + timeout) - path = '%s/%s/%s' % (self.connection.request_path, - obj.container.name, obj.name) + path = "{}/{}/{}".format(self.connection.request_path, obj.container.name, obj.name) try: - key = self.ex_get_meta_data()['temp_url_key'] + key = self.ex_get_meta_data()["temp_url_key"] assert key is not None except Exception: - raise KeyError('You must first set the ' + - 'X-Account-Meta-Temp-URL-Key header on your ' + - 'Cloud Files account using ' + - 'ex_set_account_metadata_temp_url_key before ' + - 'you can use this method.') - hmac_body = '%s\n%s\n%s' % (method, expires, path) + raise KeyError( + "You must first set the " + + "X-Account-Meta-Temp-URL-Key header on your " + + "Cloud Files account using " + + "ex_set_account_metadata_temp_url_key before " + + "you can use this method." + ) + hmac_body = "{}\n{}\n{}".format(method, expires, path) sig = hmac.new(b(key), b(hmac_body), sha1).hexdigest() - params = urlencode({'temp_url_sig': sig, - 'temp_url_expires': expires}) + params = urlencode({"temp_url_sig": sig, "temp_url_expires": expires}) - temp_url = 'https://%s/%s/%s?%s' %\ - (self.connection.host + self.connection.request_path, - obj.container.name, obj.name, params) + temp_url = "https://{}/{}/{}?{}".format( + self.connection.host + self.connection.request_path, + obj.container.name, + obj.name, + params, + ) return temp_url - def _upload_object_part(self, container, object_name, part_number, - iterator, verify_hash=True): - upload_func = self._stream_data - upload_func_kwargs = {'iterator': iterator} - part_name = object_name + '/%08d' % part_number - extra = {'content_type': 'application/octet-stream'} - - self._put_object(container=container, - object_name=part_name, - upload_func=upload_func, - upload_func_kwargs=upload_func_kwargs, - extra=extra, iterator=iterator, - verify_hash=verify_hash) - - def _upload_object_manifest(self, container, object_name, extra=None, - verify_hash=True): + def _upload_object_part(self, container, object_name, part_number, iterator, verify_hash=True): + part_name = object_name + "/%08d" % part_number + extra = {"content_type": "application/octet-stream"} + + self._put_object( + container=container, + object_name=part_name, + extra=extra, + stream=iterator, + verify_hash=verify_hash, + ) + + def _upload_object_manifest(self, container, object_name, extra=None, verify_hash=True): extra = extra or {} - meta_data = extra.get('meta_data') + meta_data = extra.get("meta_data") container_name_encoded = self._encode_container_name(container.name) object_name_encoded = self._encode_object_name(object_name) - request_path = '/%s/%s' % (container_name_encoded, object_name_encoded) + request_path = "/{}/{}".format(container_name_encoded, object_name_encoded) # pylint: disable=no-member - headers = {'X-Auth-Token': self.connection.auth_token, - 'X-Object-Manifest': '%s/%s/' % - (container_name_encoded, - object_name_encoded)} + headers = { + "X-Auth-Token": self.connection.auth_token, + "X-Object-Manifest": "{}/{}/".format(container_name_encoded, object_name_encoded), + } - data = '' - response = self.connection.request(request_path, - method='PUT', data=data, - headers=headers, raw=True) + data = "" + response = self.connection.request( + request_path, method="PUT", data=data, headers=headers, raw=True + ) object_hash = None @@ -680,148 +791,161 @@ def _upload_object_manifest(self, container, object_name, extra=None, hash_function = self._get_hash_function() hash_function.update(b(data)) data_hash = hash_function.hexdigest() - object_hash = response.headers.get('etag') + object_hash = response.headers.get("etag") if object_hash != data_hash: raise ObjectHashMismatchError( - value=('MD5 hash checksum does not match (expected=%s, ' + - 'actual=%s)') % - (data_hash, object_hash), - object_name=object_name, driver=self) - - obj = Object(name=object_name, size=0, hash=object_hash, extra=None, - meta_data=meta_data, container=container, driver=self) + value=("MD5 hash checksum does not match (expected=%s, " + "actual=%s)") + % (data_hash, object_hash), + object_name=object_name, + driver=self, + ) + + obj = Object( + name=object_name, + size=0, + hash=object_hash, + extra=None, + meta_data=meta_data, + container=container, + driver=self, + ) return obj - def list_container_objects(self, container, ex_prefix=None): - """ - Return a list of objects for the given container. - - :param container: Container instance. - :type container: :class:`Container` - - :param ex_prefix: Only get objects with names starting with ex_prefix - :type ex_prefix: ``str`` - - :return: A list of Object instances. - :rtype: ``list`` of :class:`Object` - """ - return list(self.iterate_container_objects(container, - ex_prefix=ex_prefix)) - - def iterate_container_objects(self, container, ex_prefix=None): + def iterate_container_objects(self, container, prefix=None, ex_prefix=None): """ Return a generator of objects for the given container. :param container: Container instance :type container: :class:`Container` - :param ex_prefix: Only get objects with names starting with ex_prefix + :param prefix: Only get objects with names starting with prefix + :type prefix: ``str`` + + :param ex_prefix: (Deprecated.) Only get objects with names starting + with ex_prefix :type ex_prefix: ``str`` :return: A generator of Object instances. :rtype: ``generator`` of :class:`Object` """ + prefix = self._normalize_prefix_argument(prefix, ex_prefix) + params = {} - if ex_prefix: - params['prefix'] = ex_prefix + + if prefix: + params["prefix"] = prefix while True: - container_name_encoded = \ - self._encode_container_name(container.name) - response = self.connection.request('/%s' % - (container_name_encoded), - params=params) + container_name_encoded = self._encode_container_name(container.name) + response = self.connection.request("/%s" % (container_name_encoded), params=params) if response.status == httplib.NO_CONTENT: # Empty or non-existent container break elif response.status == httplib.OK: - objects = self._to_object_list(json.loads(response.body), - container) + objects = self._to_object_list(json.loads(response.body), container) if len(objects) == 0: break for obj in objects: yield obj - params['marker'] = obj.name + params["marker"] = obj.name else: - raise LibcloudError('Unexpected status code: %s' % - (response.status)) - - def _put_object(self, container, object_name, upload_func, - upload_func_kwargs, extra=None, file_path=None, - iterator=None, verify_hash=True, headers=None): + raise LibcloudError("Unexpected status code: %s" % (response.status)) + + def _put_object( + self, + container, + object_name, + extra=None, + file_path=None, + stream=None, + verify_hash=True, + headers=None, + ): extra = extra or {} container_name_encoded = self._encode_container_name(container.name) object_name_encoded = self._encode_object_name(object_name) - content_type = extra.get('content_type', None) - meta_data = extra.get('meta_data', None) - content_disposition = extra.get('content_disposition', None) + content_type = extra.get("content_type", None) + meta_data = extra.get("meta_data", None) + content_disposition = extra.get("content_disposition", None) headers = headers or {} if meta_data: for key, value in list(meta_data.items()): - key = 'X-Object-Meta-%s' % (key) + key = "X-Object-Meta-%s" % (key) headers[key] = value if content_disposition is not None: - headers['Content-Disposition'] = content_disposition + headers["Content-Disposition"] = content_disposition - request_path = '/%s/%s' % (container_name_encoded, object_name_encoded) + request_path = "/{}/{}".format(container_name_encoded, object_name_encoded) result_dict = self._upload_object( - object_name=object_name, content_type=content_type, - upload_func=upload_func, upload_func_kwargs=upload_func_kwargs, - request_path=request_path, request_method='PUT', - headers=headers, file_path=file_path, iterator=iterator) - - response = result_dict['response'].response - bytes_transferred = result_dict['bytes_transferred'] - server_hash = result_dict['response'].headers.get('etag', None) + object_name=object_name, + content_type=content_type, + request_path=request_path, + request_method="PUT", + headers=headers, + file_path=file_path, + stream=stream, + ) + + response = result_dict["response"] + bytes_transferred = result_dict["bytes_transferred"] + server_hash = result_dict["response"].headers.get("etag", None) if response.status == httplib.EXPECTATION_FAILED: - raise LibcloudError(value='Missing content-type header', - driver=self) + raise LibcloudError(value="Missing content-type header", driver=self) elif verify_hash and not server_hash: - raise LibcloudError(value='Server didn\'t return etag', - driver=self) - elif (verify_hash and result_dict['data_hash'] != server_hash): + raise LibcloudError(value="Server didn't return etag", driver=self) + elif verify_hash and result_dict["data_hash"] != server_hash: raise ObjectHashMismatchError( - value=('MD5 hash checksum does not match (expected=%s, ' + - 'actual=%s)') % (result_dict['data_hash'], server_hash), - object_name=object_name, driver=self) + value=("MD5 hash checksum does not match (expected=%s, " + "actual=%s)") + % (result_dict["data_hash"], server_hash), + object_name=object_name, + driver=self, + ) elif response.status == httplib.CREATED: obj = Object( - name=object_name, size=bytes_transferred, hash=server_hash, - extra=None, meta_data=meta_data, container=container, - driver=self) + name=object_name, + size=bytes_transferred, + hash=server_hash, + extra=None, + meta_data=meta_data, + container=container, + driver=self, + ) return obj else: # @TODO: Add test case for this condition (probably 411) - raise LibcloudError('status_code=%s' % (response.status), - driver=self) + raise LibcloudError("status_code=%s" % (response.status), driver=self) def _encode_container_name(self, name): """ Encode container name so it can be used as part of the HTTP request. """ - if name.startswith('/'): + if name.startswith("/"): name = name[1:] name = urlquote(name) - if name.find('/') != -1: - raise InvalidContainerNameError(value='Container name cannot' - ' contain slashes', - container_name=name, driver=self) + if name.find("/") != -1: + raise InvalidContainerNameError( + value="Container name cannot" " contain slashes", + container_name=name, + driver=self, + ) if len(name) > 256: raise InvalidContainerNameError( - value='Container name cannot be longer than 256 bytes', - container_name=name, driver=self) + value="Container name cannot be longer than 256 bytes", + container_name=name, + driver=self, + ) return name @@ -832,107 +956,101 @@ def _encode_object_name(self, name): def _to_container_list(self, response): # @TODO: Handle more than 10k containers - use "lazy list"? for container in response: - extra = {'object_count': int(container['count']), - 'size': int(container['bytes'])} - yield Container(name=container['name'], extra=extra, driver=self) + extra = { + "object_count": int(container["count"]), + "size": int(container["bytes"]), + } + yield Container(name=container["name"], extra=extra, driver=self) def _to_object_list(self, response, container): objects = [] for obj in response: - name = obj['name'] - size = int(obj['bytes']) - hash = obj['hash'] - extra = {'content_type': obj['content_type'], - 'last_modified': obj['last_modified']} - objects.append(Object( - name=name, size=size, hash=hash, extra=extra, - meta_data=None, container=container, driver=self)) + name = obj["name"] + size = int(obj["bytes"]) + hash = obj["hash"] + extra = { + "content_type": obj["content_type"], + "last_modified": obj["last_modified"], + } + objects.append( + Object( + name=name, + size=size, + hash=hash, + extra=extra, + meta_data=None, + container=container, + driver=self, + ) + ) return objects def _headers_to_container(self, name, headers): - size = int(headers.get('x-container-bytes-used', 0)) - object_count = int(headers.get('x-container-object-count', 0)) + size = int(headers.get("x-container-bytes-used", 0)) + object_count = int(headers.get("x-container-object-count", 0)) - extra = {'object_count': object_count, - 'size': size} + extra = {"object_count": object_count, "size": size} container = Container(name=name, extra=extra, driver=self) return container def _headers_to_object(self, name, container, headers): - size = int(headers.pop('content-length', 0)) - last_modified = headers.pop('last-modified', None) - etag = headers.pop('etag', None) - content_type = headers.pop('content-type', None) + size = int(headers.pop("content-length", 0)) + last_modified = headers.pop("last-modified", None) + etag = headers.pop("etag", None) + content_type = headers.pop("content-type", None) meta_data = {} for key, value in list(headers.items()): - if key.find('x-object-meta-') != -1: - key = key.replace('x-object-meta-', '') + if key.find("x-object-meta-") != -1: + key = key.replace("x-object-meta-", "") meta_data[key] = value - extra = {'content_type': content_type, 'last_modified': last_modified} - - obj = Object(name=name, size=size, hash=etag, extra=extra, - meta_data=meta_data, container=container, driver=self) + extra = {"content_type": content_type, "last_modified": last_modified} + + obj = Object( + name=name, + size=size, + hash=etag, + extra=extra, + meta_data=meta_data, + container=container, + driver=self, + ) return obj def _ex_connection_class_kwargs(self): kwargs = self.openstack_connection_kwargs() - kwargs['ex_force_service_region'] = self.region - kwargs['use_internal_url'] = self.use_internal_url + kwargs["ex_force_service_region"] = self.region + kwargs["use_internal_url"] = self.use_internal_url return kwargs -class CloudFilesUSStorageDriver(CloudFilesStorageDriver): - """ - Cloudfiles storage driver for the US endpoint. - """ - - type = Provider.CLOUDFILES_US - name = 'CloudFiles (US)' - - def __init__(self, *args, **kwargs): - kwargs['region'] = 'ord' - super(CloudFilesUSStorageDriver, self).__init__(*args, **kwargs) - - class OpenStackSwiftStorageDriver(CloudFilesStorageDriver): """ Storage driver for the OpenStack Swift. """ + type = Provider.CLOUDFILES_SWIFT - name = 'OpenStack Swift' + name = "OpenStack Swift" connectionCls = OpenStackSwiftConnection # TODO: Reverse the relationship - Swift -> CloudFiles - def __init__(self, key, secret=None, secure=True, host=None, port=None, - region=None, **kwargs): - super(OpenStackSwiftStorageDriver, self).__init__(key=key, - secret=secret, - secure=secure, - host=host, - port=port, - region=region, - **kwargs) - - -class CloudFilesUKStorageDriver(CloudFilesStorageDriver): - """ - Cloudfiles storage driver for the UK endpoint. - """ - - type = Provider.CLOUDFILES_UK - name = 'CloudFiles (UK)' - - def __init__(self, *args, **kwargs): - kwargs['region'] = 'lon' - super(CloudFilesUKStorageDriver, self).__init__(*args, **kwargs) + def __init__(self, key, secret=None, secure=True, host=None, port=None, region=None, **kwargs): + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + region=region, + **kwargs, + ) -class FileChunkReader(object): +class FileChunkReader: def __init__(self, file_path, chunk_size): self.file_path = file_path self.total = os.path.getsize(file_path) @@ -953,18 +1071,20 @@ def next(self): end_block = self.total self.stop_iteration = True self.bytes_read += end_block - start_block - return ChunkStreamReader(file_path=self.file_path, - start_block=start_block, - end_block=end_block, - chunk_size=8192) + return ChunkStreamReader( + file_path=self.file_path, + start_block=start_block, + end_block=end_block, + chunk_size=8192, + ) def __next__(self): return self.next() -class ChunkStreamReader(object): +class ChunkStreamReader: def __init__(self, file_path, start_block, end_block, chunk_size): - self.fd = open(file_path, 'rb') + self.fd = open(file_path, "rb") self.fd.seek(start_block) self.start_block = start_block self.end_block = end_block @@ -972,6 +1092,16 @@ def __init__(self, file_path, start_block, end_block, chunk_size): self.bytes_read = 0 self.stop_iteration = False + # Work around to make sure file description is closed even if the + # iterator is never read from or if it's not fully exhausted + def close_file(fd): + try: + fd.close() + except Exception: + pass + + atexit.register(close_file, self.fd) + def __iter__(self): return self @@ -981,8 +1111,7 @@ def next(self): raise StopIteration block_size = self.chunk_size - if self.bytes_read + block_size > \ - self.end_block - self.start_block: + if self.bytes_read + block_size > self.end_block - self.start_block: block_size = self.end_block - self.start_block - self.bytes_read self.stop_iteration = True diff --git a/libcloud/storage/drivers/digitalocean_spaces.py b/libcloud/storage/drivers/digitalocean_spaces.py new file mode 100644 index 0000000000..5e0bc7bae6 --- /dev/null +++ b/libcloud/storage/drivers/digitalocean_spaces.py @@ -0,0 +1,138 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.common.aws import SignedAWSConnection +from libcloud.common.types import LibcloudError +from libcloud.storage.drivers.s3 import S3Connection, BaseS3Connection, BaseS3StorageDriver + +__all__ = ["DigitalOceanSpacesStorageDriver"] + +DO_SPACES_HOSTS_BY_REGION = { + "nyc3": "nyc3.digitaloceanspaces.com", + "ams3": "ams3.digitaloceanspaces.com", + "sfo2": "sfo2.digitaloceanspaces.com", + "sgp1": "sgp1.digitaloceanspaces.com", +} +DO_SPACES_DEFAULT_REGION = "nyc3" +DEFAULT_SIGNATURE_VERSION = "2" +S3_API_VERSION = "2006-03-01" + + +class DOSpacesConnectionAWS4(SignedAWSConnection, BaseS3Connection): + service_name = "s3" + version = S3_API_VERSION + + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + token=None, + retry_delay=None, + backoff=None, + **kwargs, + ): + super().__init__( + user_id, + key, + secure, + host, + port, + url, + timeout, + proxy_url, + token, + retry_delay, + backoff, + signature_version=4, + ) + + +class DOSpacesConnectionAWS2(S3Connection): + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + token=None, + retry_delay=None, + backoff=None, + **kwargs, + ): + super().__init__( + user_id, + key, + secure, + host, + port, + url, + timeout, + proxy_url, + token, + retry_delay, + backoff, + ) + + +class DigitalOceanSpacesStorageDriver(BaseS3StorageDriver): + name = "DigitalOcean Spaces" + website = "https://www.digitalocean.com/products/object-storage/" + supports_chunked_encoding = False + supports_s3_multipart_upload = True + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=DO_SPACES_DEFAULT_REGION, + **kwargs, + ): + if region not in DO_SPACES_HOSTS_BY_REGION: + raise LibcloudError("Unknown region (%s)" % (region), driver=self) + + host = DO_SPACES_HOSTS_BY_REGION[region] + self.name = "DigitalOcean Spaces (%s)" % (region) + + self.region_name = region + self.signature_version = str(kwargs.pop("signature_version", DEFAULT_SIGNATURE_VERSION)) + + if self.signature_version == "2": + self.connectionCls = DOSpacesConnectionAWS2 + elif self.signature_version == "4": + self.connectionCls = DOSpacesConnectionAWS4 + else: + raise ValueError("Invalid signature_version: %s" % (self.signature_version)) + self.connectionCls.host = host + + super().__init__(key, secret, secure, host, port, api_version, region, **kwargs) + + def _ex_connection_class_kwargs(self): + kwargs = {} + kwargs["signature_version"] = self.signature_version + return kwargs diff --git a/libcloud/storage/drivers/dummy.py b/libcloud/storage/drivers/dummy.py index affd265538..34ecb08a25 100644 --- a/libcloud/storage/drivers/dummy.py +++ b/libcloud/storage/drivers/dummy.py @@ -13,23 +13,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os.path import random import hashlib +import os.path +from io import FileIO as file -from libcloud.utils.py3 import PY3 from libcloud.utils.py3 import b - -if PY3: - from io import FileIO as file - from libcloud.common.types import LibcloudError - from libcloud.storage.base import Object, Container, StorageDriver -from libcloud.storage.types import ContainerAlreadyExistsError -from libcloud.storage.types import ContainerDoesNotExistError -from libcloud.storage.types import ContainerIsNotEmptyError -from libcloud.storage.types import ObjectDoesNotExistError +from libcloud.storage.types import ( + ObjectDoesNotExistError, + ContainerIsNotEmptyError, + ContainerDoesNotExistError, + ContainerAlreadyExistsError, +) class DummyFileObject(file): @@ -44,24 +41,23 @@ def read(self, size): yield self._get_chunk(self._chunk_len) i += 1 - raise StopIteration - def _get_chunk(self, chunk_len): chunk = [str(x) for x in random.randint(97, 120)] + return chunk def __len__(self): return self._yield_count * self._chunk_len -class DummyIterator(object): +class DummyIterator: def __init__(self, data=None): - self.hash = hashlib.md5() + self.hash = hashlib.md5() # nosec self._data = data or [] self._current_item = 0 def get_md5_hash(self): - return self.hash.hexdigest() + return self.hash.hexdigest() # nosec def next(self): if self._current_item == len(self._data): @@ -70,11 +66,18 @@ def next(self): value = self._data[self._current_item] self.hash.update(b(value)) self._current_item += 1 + return value def __next__(self): return self.next() + def __enter__(self): + pass + + def __exit__(self, type, value, traceback): + pass + class DummyStorageDriver(StorageDriver): """ @@ -91,8 +94,8 @@ class DummyStorageDriver(StorageDriver): 0 """ - name = 'Dummy Storage Provider' - website = 'http://example.com' + name = "Dummy Storage Provider" + website = "http://example.com" def __init__(self, api_key, api_secret): """ @@ -131,18 +134,23 @@ def get_meta_data(self): """ container_count = len(self._containers) - object_count = sum([len(self._containers[container]['objects']) for - container in self._containers]) + object_count = sum( + len(self._containers[container]["objects"]) for container in self._containers + ) bytes_used = 0 + for container in self._containers: - objects = self._containers[container]['objects'] + objects = self._containers[container]["objects"] + for _, obj in objects.items(): bytes_used += obj.size - return {'container_count': int(container_count), - 'object_count': int(object_count), - 'bytes_used': int(bytes_used)} + return { + "container_count": int(container_count), + "object_count": int(object_count), + "bytes_used": int(bytes_used), + } def iterate_containers(self): """ @@ -172,12 +180,15 @@ def iterate_containers(self): """ for container in list(self._containers.values()): - yield container['container'] + yield container["container"] + + def iterate_container_objects(self, container, prefix=None, ex_prefix=None): + prefix = self._normalize_prefix_argument(prefix, ex_prefix) - def list_container_objects(self, container): container = self.get_container(container.name) + objects = self._containers[container.name]["objects"].values() - return container.objects + return self._filter_listed_container_objects(objects, prefix) def get_container(self, container_name): """ @@ -198,10 +209,9 @@ def get_container(self, container_name): """ if container_name not in self._containers: - raise ContainerDoesNotExistError(driver=self, value=None, - container_name=container_name) + raise ContainerDoesNotExistError(driver=self, value=None, container_name=container_name) - return self._containers[container_name]['container'] + return self._containers[container_name]["container"] def get_container_cdn_url(self, container): """ @@ -222,10 +232,9 @@ def get_container_cdn_url(self, container): """ if container.name not in self._containers: - raise ContainerDoesNotExistError(driver=self, value=None, - container_name=container.name) + raise ContainerDoesNotExistError(driver=self, value=None, container_name=container.name) - return self._containers[container.name]['cdn_url'] + return self._containers[container.name]["cdn_url"] def get_object(self, container_name, object_name): """ @@ -253,10 +262,10 @@ def get_object(self, container_name, object_name): """ self.get_container(container_name) - container_objects = self._containers[container_name]['objects'] + container_objects = self._containers[container_name]["objects"] + if object_name not in container_objects: - raise ObjectDoesNotExistError(object_name=object_name, value=None, - driver=self) + raise ObjectDoesNotExistError(object_name=object_name, value=None, driver=self) return container_objects[object_name] @@ -279,12 +288,12 @@ def get_object_cdn_url(self, obj): """ container_name = obj.container.name - container_objects = self._containers[container_name]['objects'] + container_objects = self._containers[container_name]["objects"] + if obj.name not in container_objects: - raise ObjectDoesNotExistError(object_name=obj.name, value=None, - driver=self) + raise ObjectDoesNotExistError(object_name=obj.name, value=None, driver=self) - return container_objects[obj.name].meta_data['cdn_url'] + return container_objects[obj.name].meta_data["cdn_url"] def create_container(self, container_name): """ @@ -303,19 +312,19 @@ def create_container(self, container_name): """ if container_name in self._containers: - raise ContainerAlreadyExistsError(container_name=container_name, - value=None, driver=self) + raise ContainerAlreadyExistsError( + container_name=container_name, value=None, driver=self + ) - extra = {'object_count': 0} + extra = {"object_count": 0} container = Container(name=container_name, extra=extra, driver=self) - self._containers[container_name] = {'container': container, - 'objects': {}, - 'cdn_url': - 'http://www.test.com/container/%s' - % - (container_name.replace(' ', '_')) - } + self._containers[container_name] = { + "container": container, + "objects": {}, + "cdn_url": "http://www.test.com/container/%s" % (container_name.replace(" ", "_")), + } + return container def delete_container(self, container): @@ -351,25 +360,29 @@ def delete_container(self, container): """ container_name = container.name + if container_name not in self._containers: - raise ContainerDoesNotExistError(container_name=container_name, - value=None, driver=self) + raise ContainerDoesNotExistError(container_name=container_name, value=None, driver=self) container = self._containers[container_name] - if len(container['objects']) > 0: - raise ContainerIsNotEmptyError(container_name=container_name, - value=None, driver=self) + + if len(container["objects"]) > 0: + raise ContainerIsNotEmptyError(container_name=container_name, value=None, driver=self) del self._containers[container_name] + return True - def download_object(self, obj, destination_path, overwrite_existing=False, - delete_on_failure=True): - kwargs_dict = {'obj': obj, - 'response': DummyFileObject(), - 'destination_path': destination_path, - 'overwrite_existing': overwrite_existing, - 'delete_on_failure': delete_on_failure} + def download_object( + self, obj, destination_path, overwrite_existing=False, delete_on_failure=True + ): + kwargs_dict = { + "obj": obj, + "response": DummyFileObject(), + "destination_path": destination_path, + "overwrite_existing": overwrite_existing, + "delete_on_failure": delete_on_failure, + } return self._save_object(**kwargs_dict) @@ -390,8 +403,15 @@ def download_object_as_stream(self, obj, chunk_size=None): return DummyFileObject() - def upload_object(self, file_path, container, object_name, extra=None, - file_hash=None): + def upload_object( + self, + file_path, + container, + object_name, + extra=None, + verify_hash=True, + headers=None, + ): """ >>> driver = DummyStorageDriver('key', 'secret') >>> container_name = 'test container 1' @@ -410,20 +430,18 @@ def upload_object(self, file_path, container, object_name, extra=None, True @inherits: :class:`StorageDriver.upload_object` - :param file_hash: File hash - :type file_hash: ``str`` """ if not os.path.exists(file_path): - raise LibcloudError(value='File %s does not exist' % (file_path), - driver=self) + raise LibcloudError(value="File %s does not exist" % (file_path), driver=self) size = os.path.getsize(file_path) - return self._add_object(container=container, object_name=object_name, - size=size, extra=extra) - def upload_object_via_stream(self, iterator, container, - object_name, extra=None): + return self._add_object( + container=container, object_name=object_name, size=size, extra=extra + ) + + def upload_object_via_stream(self, iterator, container, object_name, extra=None, headers=None): """ >>> driver = DummyStorageDriver('key', 'secret') >>> container = driver.create_container( @@ -439,8 +457,10 @@ def upload_object_via_stream(self, iterator, container, """ size = len(iterator) - return self._add_object(container=container, object_name=object_name, - size=size, extra=extra) + + return self._add_object( + container=container, object_name=object_name, size=size, extra=extra + ) def delete_object(self, obj): """ @@ -466,25 +486,36 @@ def delete_object(self, obj): container_name = obj.container.name object_name = obj.name - obj = self.get_object(container_name=container_name, - object_name=object_name) + obj = self.get_object(container_name=container_name, object_name=object_name) + + del self._containers[container_name]["objects"][object_name] - del self._containers[container_name]['objects'][object_name] return True def _add_object(self, container, object_name, size, extra=None): container = self.get_container(container.name) extra = extra or {} - meta_data = extra.get('meta_data', {}) - meta_data.update({'cdn_url': 'http://www.test.com/object/%s' % - (object_name.replace(' ', '_'))}) - obj = Object(name=object_name, size=size, extra=extra, hash=None, - meta_data=meta_data, container=container, driver=self) + meta_data = extra.get("meta_data", {}) + meta_data.update( + {"cdn_url": "http://www.test.com/object/%s" % (object_name.replace(" ", "_"))} + ) + obj = Object( + name=object_name, + size=size, + extra=extra, + hash=None, + meta_data=meta_data, + container=container, + driver=self, + ) + + self._containers[container.name]["objects"][object_name] = obj - self._containers[container.name]['objects'][object_name] = obj return obj + if __name__ == "__main__": import doctest + doctest.testmod() diff --git a/libcloud/storage/drivers/google_storage.py b/libcloud/storage/drivers/google_storage.py index 0bc9583148..1ee7e94ee9 100644 --- a/libcloud/storage/drivers/google_storage.py +++ b/libcloud/storage/drivers/google_storage.py @@ -13,125 +13,409 @@ # See the License for the specific language governing permissions and # limitations under the License. -import base64 import copy -import hmac +import json +import email.utils +from typing import Dict, Optional -from email.utils import formatdate -from hashlib import sha1 +from libcloud.utils.py3 import httplib, urlquote +from libcloud.common.base import ConnectionUserAndKey +from libcloud.common.types import ProviderError +from libcloud.common.google import GoogleAuthType, GoogleResponse, GoogleOAuth2Credential +from libcloud.storage.drivers.s3 import ( + S3Response, + S3RawResponse, + BaseS3Connection, + BaseS3StorageDriver, +) -from libcloud.utils.py3 import b +# Docs are a lie. Actual namespace returned is different that the one listed +# in the docs. +SIGNATURE_IDENTIFIER = "GOOG1" +API_VERSION = "2006-03-01" +NAMESPACE = "http://doc.s3.amazonaws.com/%s" % (API_VERSION) -from libcloud.common.base import ConnectionUserAndKey -from libcloud.storage.drivers.s3 import BaseS3StorageDriver, S3Response -from libcloud.storage.drivers.s3 import S3RawResponse +def _clean_object_name(name): + """ + Return the URL encoded name. name=None returns None. Useful for input + checking without having to check for None first. + + :param name: The object name + :type name: ``str`` or ``None`` + + :return: The url-encoded object name or None if name=None. + :rtype ``str`` or ``None`` + """ + return urlquote(name, safe="") if name else None -SIGNATURE_IDENTIFIER = 'GOOG1' -# Docs are a lie. Actual namespace returned is different that the one listed in -# the docs. -AUTH_HOST = 'commondatastorage.googleapis.com' -API_VERSION = '2006-03-01' -NAMESPACE = 'http://doc.s3.amazonaws.com/%s' % (API_VERSION) +class ContainerPermissions: + values = ["NONE", "READER", "WRITER", "OWNER"] + NONE = 0 + READER = 1 + WRITER = 2 + OWNER = 3 + + +class ObjectPermissions: + values = ["NONE", "READER", "OWNER"] + NONE = 0 + READER = 1 + OWNER = 2 class GoogleStorageConnection(ConnectionUserAndKey): """ - Repersents a single connection to the Google storage API endpoint. + Represents a single connection to the Google storage API endpoint. + + This can either authenticate via the Google OAuth2 methods or via + the S3 HMAC interoperability method. """ - host = AUTH_HOST + host = "storage.googleapis.com" responseCls = S3Response rawResponseCls = S3RawResponse + PROJECT_ID_HEADER = "x-goog-project-id" + + def __init__(self, user_id, key, *args, auth_type=None, credential_file=None, **kwargs): + self.auth_type = auth_type or GoogleAuthType.guess_type(user_id) + if GoogleAuthType.is_oauth2(self.auth_type): + self.oauth2_credential = GoogleOAuth2Credential( + user_id, key, self.auth_type, credential_file, **kwargs + ) + else: + self.oauth2_credential = None + super().__init__(user_id, key, *args, **kwargs) def add_default_headers(self, headers): - date = formatdate(usegmt=True) - headers['Date'] = date + date = email.utils.formatdate(usegmt=True) + headers["Date"] = date + project = self.get_project() + if project: + headers[self.PROJECT_ID_HEADER] = project return headers + def get_project(self): + return getattr(self.driver, "project", None) + def pre_connect_hook(self, params, headers): - signature = self._get_aws_auth_param(method=self.method, - headers=headers, - params=params, - expires=None, - secret_key=self.key, - path=self.action) - headers['Authorization'] = '%s %s:%s' % (SIGNATURE_IDENTIFIER, - self.user_id, signature) + if self.auth_type == GoogleAuthType.GCS_S3: + signature = self._get_s3_auth_signature(params, headers) + headers["Authorization"] = "{} {}:{}".format( + SIGNATURE_IDENTIFIER, + self.user_id, + signature, + ) + else: + headers["Authorization"] = "Bearer " + self.oauth2_credential.access_token return params, headers - def _get_aws_auth_param(self, method, headers, params, expires, - secret_key, path='/'): - # TODO: Refactor and re-use in S3 driver - """ - Signature = URL-Encode( Base64( HMAC-SHA1( YourSecretAccessKeyID, - UTF-8-Encoding-Of( StringToSign ) ) ) ); - - StringToSign = HTTP-VERB + "\n" + - Content-MD5 + "\n" + - Content-Type + "\n" + - Date + "\n" + - CanonicalizedHeaders + - CanonicalizedResource; - """ - special_header_keys = ['content-md5', 'content-type', 'date'] - special_header_values = {} - extension_header_values = {} - - headers_copy = copy.deepcopy(headers) - for key, value in list(headers_copy.items()): - if key.lower() in special_header_keys: - if key.lower() == 'date': - value = value.strip() - else: - value = value.lower().strip() - special_header_values[key.lower()] = value - elif key.lower().startswith('x-goog-'): - extension_header_values[key.lower()] = value.strip() - - if 'content-md5' not in special_header_values: - special_header_values['content-md5'] = '' - - if 'content-type' not in special_header_values: - special_header_values['content-type'] = '' - - keys_sorted = list(special_header_values.keys()) - keys_sorted.sort() - - buf = [method] - for key in keys_sorted: - value = special_header_values[key] - buf.append(value) - string_to_sign = '\n'.join(buf) - - keys_sorted = list(extension_header_values.keys()) - keys_sorted.sort() - - extension_header_string = [] - for key in keys_sorted: - value = extension_header_values[key] - extension_header_string.append('%s:%s' % (key, value)) - extension_header_string = '\n'.join(extension_header_string) - - values_to_sign = [] - for value in [string_to_sign, extension_header_string, path]: - if value: - values_to_sign.append(value) - - string_to_sign = '\n'.join(values_to_sign) - b64_hmac = base64.b64encode( - hmac.new(b(secret_key), b(string_to_sign), digestmod=sha1).digest() + def _get_s3_auth_signature(self, params, headers): + """Hacky wrapper to work with S3's get_auth_signature.""" + headers_copy = {} + params_copy = copy.deepcopy(params) + + # Lowercase all headers except 'date' and Google header values + for k, v in headers.items(): + k_lower = k.lower() + # NOTE: It's important that the value of Content-Type header is + # left as is and not lowercased + if ( + k_lower in ["date", "content-type"] + or k_lower.startswith(GoogleStorageDriver.http_vendor_prefix) + or not isinstance(v, str) + ): + headers_copy[k_lower] = v + else: + headers_copy[k_lower] = v.lower() + + return BaseS3Connection.get_auth_signature( + method=self.method, + headers=headers_copy, + params=params_copy, + expires=None, + secret_key=self.key, + path=self.action, + vendor_prefix=GoogleStorageDriver.http_vendor_prefix, ) - return b64_hmac.decode('utf-8') + + +class GCSResponse(GoogleResponse): + pass + + +class GoogleStorageJSONConnection(GoogleStorageConnection): + """ + Represents a single connection to the Google storage JSON API endpoint. + + This can either authenticate via the Google OAuth2 methods or via + the S3 HMAC interoperability method. + """ + + host = "www.googleapis.com" + responseCls = GCSResponse + rawResponseCls = None + + def add_default_headers(self, headers): + headers = super().add_default_headers(headers) + headers["Content-Type"] = "application/json" + return headers class GoogleStorageDriver(BaseS3StorageDriver): - name = 'Google Storage' - website = 'http://cloud.google.com/' + """ + Driver for Google Cloud Storage. + + Can authenticate via standard Google Cloud methods (Service Accounts, + Installed App credentials, and GCE instance service accounts) + + Examples: + + Service Accounts:: + + driver = GoogleStorageDriver(key=client_email, secret=private_key, ...) + + Installed Application:: + + driver = GoogleStorageDriver(key=client_id, secret=client_secret, ...) + + From GCE instance:: + + driver = GoogleStorageDriver(key=foo, secret=bar, ...) + + Can also authenticate via Google Cloud Storage's S3 HMAC interoperability + API. S3 user keys are 20 alphanumeric characters, starting with GOOG. + + Example:: + + driver = GoogleStorageDriver(key='GOOG0123456789ABCXYZ', + secret=key_secret) + """ + + name = "Google Cloud Storage" + website = "http://cloud.google.com/storage" connectionCls = GoogleStorageConnection - hash_type = 'md5' + jsonConnectionCls = GoogleStorageJSONConnection + hash_type = "md5" namespace = NAMESPACE supports_chunked_encoding = False supports_s3_multipart_upload = False - http_vendor_prefix = 'x-goog' + http_vendor_prefix = "x-goog" + + def __init__(self, key, secret=None, project=None, **kwargs): + super().__init__(key, secret, **kwargs) + self.project = project + + self.json_connection = GoogleStorageJSONConnection(key, secret, **kwargs) + + def _get_container_permissions(self, container_name): + """ + Return the container permissions for the current authenticated user. + + :param container_name: The container name. + :param container_name: ``str`` + + :return: The permissions on the container. + :rtype: ``int`` from ContainerPermissions + """ + # Try OWNER permissions first: try listing the bucket ACL. + # FORBIDDEN -> exists, but not an OWNER. + # NOT_FOUND -> bucket DONE, return NONE. + try: + self.json_connection.request("/storage/v1/b/%s/acl" % container_name) + return ContainerPermissions.OWNER + except ProviderError as e: + if e.http_code == httplib.FORBIDDEN: + pass + elif e.http_code == httplib.NOT_FOUND: + return ContainerPermissions.NONE + else: + raise + + # Try WRITER permissions with a noop request: try delete with an + # impossible precondition. Authorization is checked before file + # existence or preconditions. So, if we get a NOT_FOUND or a + # PRECONDITION_FAILED, then we must be authorized. + try: + self.json_connection.request( + "/storage/v1/b/%s/o/writecheck" % container_name, + headers={"x-goog-if-generation-match": "0"}, + method="DELETE", + ) + except ProviderError as e: + if e.http_code in [httplib.NOT_FOUND, httplib.PRECONDITION_FAILED]: + return ContainerPermissions.WRITER + elif e.http_code != httplib.FORBIDDEN: + raise + + # Last, try READER permissions: try getting container metadata. + try: + self.json_connection.request("/storage/v1/b/%s" % container_name) + return ContainerPermissions.READER + except ProviderError as e: + if e.http_code not in [httplib.FORBIDDEN, httplib.NOT_FOUND]: + raise + + return ContainerPermissions.NONE + + def _get_user(self): + """Gets this drivers' authenticated user, if any.""" + oauth2_creds = getattr(self.connection, "oauth2_credential") + if oauth2_creds: + return oauth2_creds.user_id + else: + return None + + def _get_object_permissions(self, container_name, object_name): + """ + Return the object permissions for the current authenticated user. + If the object does not exist, or no object_name is given, return the + default object permissions. + + :param container_name: The container name. + :type container_name: ``str`` + + :param object_name: The object name. + :type object_name: ``str`` + + :return: The permissions on the object or default object permissions. + :rtype: ``int`` from ObjectPermissions + """ + # Try OWNER permissions first: try listing the object ACL. + try: + self.json_connection.request( + "/storage/v1/b/{}/o/{}/acl".format(container_name, object_name) + ) + return ObjectPermissions.OWNER + except ProviderError as e: + if e.http_code not in [httplib.FORBIDDEN, httplib.NOT_FOUND]: + raise + + # Try READER permissions: try getting the object. + try: + self.json_connection.request( + "/storage/v1/b/{}/o/{}".format(container_name, object_name) + ) + return ObjectPermissions.READER + except ProviderError as e: + if e.http_code not in [httplib.FORBIDDEN, httplib.NOT_FOUND]: + raise + + return ObjectPermissions.NONE + + def ex_delete_permissions(self, container_name, object_name=None, entity=None): + """ + Delete permissions for an ACL entity on a container or object. + + :param container_name: The container name. + :type container_name: ``str`` + + :param object_name: The object name. Optional. Not providing an object + will delete a container permission. + :type object_name: ``str`` + + :param entity: The entity to whose permission will be deleted. + Optional. If not provided, the role will be applied to the + authenticated user, if using an OAuth2 authentication scheme. + :type entity: ``str`` or ``None`` + """ + object_name = _clean_object_name(object_name) + if not entity: + user_id = self._get_user() + if not user_id: + raise ValueError( + "Must provide an entity. Driver is not using an " "authenticated user." + ) + else: + entity = "user-%s" % user_id + + if object_name: + url = "/storage/v1/b/{}/o/{}/acl/{}".format(container_name, object_name, entity) + else: + url = "/storage/v1/b/{}/acl/{}".format(container_name, entity) + + self.json_connection.request(url, method="DELETE") + + def ex_get_permissions(self, container_name, object_name=None): + """ + Return the permissions for the currently authenticated user. + + :param container_name: The container name. + :type container_name: ``str`` + + :param object_name: The object name. Optional. Not providing an object + will return only container permissions. + :type object_name: ``str`` or ``None`` + + :return: A tuple of container and object permissions. + :rtype: ``tuple`` of (``int``, ``int`` or ``None``) from + ContainerPermissions and ObjectPermissions, respectively. + """ + object_name = _clean_object_name(object_name) + obj_perms = ( + self._get_object_permissions(container_name, object_name) if object_name else None + ) + return self._get_container_permissions(container_name), obj_perms + + def ex_set_permissions(self, container_name, object_name=None, entity=None, role=None): + """ + Set the permissions for an ACL entity on a container or an object. + + :param container_name: The container name. + :type container_name: ``str`` + + :param object_name: The object name. Optional. Not providing an object + will apply the acl to the container. + :type object_name: ``str`` + + :param entity: The entity to which apply the role. Optional. If not + provided, the role will be applied to the authenticated user, if + using an OAuth2 authentication scheme. + :type entity: ``str`` + + :param role: The permission/role to set on the entity. + :type role: ``int`` from ContainerPermissions or ObjectPermissions + or ``str``. + + :raises ValueError: If no entity was given, but was required. Or if + the role isn't valid for the bucket or object. + """ + object_name = _clean_object_name(object_name) + if isinstance(role, int): + perms = ObjectPermissions if object_name else ContainerPermissions + try: + role = perms.values[role] + except IndexError: + raise ValueError( + "%s is not a valid role level for container=%s object=%s" + % (role, container_name, object_name) + ) + elif not isinstance(role, str): + raise ValueError("%s is not a valid permission." % role) + + if not entity: + user_id = self._get_user() + if not user_id: + raise ValueError( + "Must provide an entity. Driver is not using an " "authenticated user." + ) + else: + entity = "user-%s" % user_id + + if object_name: + url = "/storage/v1/b/{}/o/{}/acl".format(container_name, object_name) + else: + url = "/storage/v1/b/%s/acl" % container_name + + self.json_connection.request( + url, method="POST", data=json.dumps({"role": role, "entity": entity}) + ) + + def _get_content_length_from_headers(self, headers: Dict[str, str]) -> Optional[int]: + # We need to override this since Google storage doesn't always return + # Content-Length header. + # See https://github.com/apache/libcloud/issues/1544 for details. + x_goog_content_length = headers.get("x-goog-stored-content-length", None) + content_length = headers.get("content-length", x_goog_content_length) + return content_length diff --git a/libcloud/storage/drivers/ktucloud.py b/libcloud/storage/drivers/ktucloud.py index 385d445fee..d4b097e9a7 100644 --- a/libcloud/storage/drivers/ktucloud.py +++ b/libcloud/storage/drivers/ktucloud.py @@ -15,9 +15,7 @@ from libcloud.common.types import LibcloudError from libcloud.storage.providers import Provider - -from libcloud.storage.drivers.cloudfiles import CloudFilesConnection -from libcloud.storage.drivers.cloudfiles import CloudFilesStorageDriver +from libcloud.storage.drivers.cloudfiles import CloudFilesConnection, CloudFilesStorageDriver KTUCLOUDSTORAGE_AUTH_URL = "https://ssproxy.ucloudbiz.olleh.com/auth/v1.0" KTUCLOUDSTORAGE_API_VERSION = "1.0" @@ -32,16 +30,16 @@ class KTUCloudStorageConnection(CloudFilesConnection): _auth_version = KTUCLOUDSTORAGE_API_VERSION def get_endpoint(self): - eps = self.service_catalog.get_endpoints(name='cloudFiles') + eps = self.service_catalog.get_endpoints(name="cloudFiles") if len(eps) == 0: - raise LibcloudError('Could not find specified endpoint') + raise LibcloudError("Could not find specified endpoint") ep = eps[0] public_url = ep.url if not public_url: - raise LibcloudError('Could not find specified endpoint') + raise LibcloudError("Could not find specified endpoint") return public_url @@ -52,5 +50,5 @@ class KTUCloudStorageDriver(CloudFilesStorageDriver): """ type = Provider.KTUCLOUD - name = 'KTUCloud Storage' + name = "KTUCloud Storage" connectionCls = KTUCloudStorageConnection diff --git a/libcloud/storage/drivers/local.py b/libcloud/storage/drivers/local.py index 60de8ce326..b1c5ecfe49 100644 --- a/libcloud/storage/drivers/local.py +++ b/libcloud/storage/drivers/local.py @@ -17,53 +17,109 @@ Provides storage driver for working with local filesystem """ -from __future__ import with_statement - -import errno import os +import time +import errno import shutil -import sys +import tempfile +import threading +from hashlib import sha256 + +from libcloud.utils.py3 import u, relpath +from libcloud.common.base import Connection +from libcloud.utils.files import read_in_chunks +from libcloud.common.types import LibcloudError +from libcloud.storage.base import CHUNK_SIZE, Object, Container, StorageDriver +from libcloud.storage.types import ( + ObjectError, + ObjectDoesNotExistError, + ContainerIsNotEmptyError, + InvalidContainerNameError, + ContainerDoesNotExistError, + ContainerAlreadyExistsError, +) try: - import lockfile - from lockfile import LockTimeout, mkdirlockfile + import fasteners except ImportError: - raise ImportError('Missing lockfile dependency, you can install it ' - 'using pip: pip install lockfile') + raise ImportError( + "Missing fasteners dependency, you can install it " "using pip: pip install fasteners" + ) -from libcloud.utils.files import read_in_chunks -from libcloud.utils.py3 import relpath -from libcloud.utils.py3 import u -from libcloud.common.base import Connection -from libcloud.storage.base import Object, Container, StorageDriver -from libcloud.common.types import LibcloudError -from libcloud.storage.types import ContainerAlreadyExistsError -from libcloud.storage.types import ContainerDoesNotExistError -from libcloud.storage.types import ContainerIsNotEmptyError -from libcloud.storage.types import ObjectError -from libcloud.storage.types import ObjectDoesNotExistError -from libcloud.storage.types import InvalidContainerNameError -IGNORE_FOLDERS = ['.lock', '.hash'] +IGNORE_FOLDERS = [".lock", ".hash"] + +class NoOpLockLocalStorage: + def __init__(self, path, timeout=5): + self.path = path + self.lock_acquire_timeout = timeout -class LockLocalStorage(object): + def __enter__(self): + return True + + def __exit__(self, type, value, traceback): + return False + + +class LockLocalStorage: """ - A class to help in locking a local path before being updated + A class which locks a local path which is being updated. To correctly handle all the scenarios + use a thread based and IPC based lock. """ - def __init__(self, path): + + def __init__(self, path, timeout=5): self.path = path - self.lock = mkdirlockfile.MkdirLockFile(self.path, threaded=True) + self.lock_acquire_timeout = timeout + + self.ipc_lock_path = os.path.join( + tempfile.gettempdir(), + "%s.lock" % (sha256(path.encode("utf-8")).hexdigest()), + ) + + # NOTE: fasteners.InterProcess lock has no guarantees regards usage by + # multiple threads in a single process which means we also need to + # use threading.lock for that purpose + self.thread_lock = threading.Lock() + self.ipc_lock = fasteners.InterProcessLock(self.ipc_lock_path) def __enter__(self): + lock_acquire_timeout = self.lock_acquire_timeout + start_time = int(time.time()) + end_time = start_time + lock_acquire_timeout + + while int(time.time()) < end_time: + # pylint: disable=assignment-from-no-return + success = self.thread_lock.acquire(blocking=False) + # enable: disable=assignment-from-no-return + + if success: + break + + if not success: + raise LibcloudError( + "Failed to acquire thread lock for path %s " + "in %s seconds" % (self.path, lock_acquire_timeout) + ) + try: - self.lock.acquire(timeout=0.1) - except LockTimeout: - raise LibcloudError('Lock timeout') + success = self.ipc_lock.acquire(blocking=True, timeout=lock_acquire_timeout) + + if not success: + raise LibcloudError( + "Failed to acquire IPC lock (%s) for path %s " + "in %s seconds" % (self.ipc_lock_path, self.path, lock_acquire_timeout) + ) + except BaseException: + self.thread_lock.release() + raise def __exit__(self, type, value, traceback): - if self.lock.is_locked(): - self.lock.release() + if self.thread_lock.locked(): + self.thread_lock.release() + + if self.ipc_lock.exists(): + self.ipc_lock.release() if value is not None: raise value @@ -77,22 +133,41 @@ class LocalStorageDriver(StorageDriver): """ connectionCls = Connection - name = 'Local Storage' - website = 'http://example.com' - hash_type = 'md5' - - def __init__(self, key, secret=None, secure=True, host=None, port=None, - **kwargs): + name = "Local Storage" + website = "http://example.com" + hash_type = "md5" + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + ex_use_locking=True, + **kwargs, + ): + """ + :param ex_use_locking: True if locking should be used when working with files. This value + should almost always be left as-is and only changed to False when + there is a specific need for it (e.g. for specific tests and micro + benchmarks). + """ # Use the key as the path to the storage self.base_path = key if not os.path.isdir(self.base_path): - raise LibcloudError('The base path is not a directory') + raise LibcloudError("The base path is not a directory") + + self._ex_use_locking = ex_use_locking - super(LocalStorageDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, **kwargs) + if self._ex_use_locking: + self._lock_cls = LockLocalStorage + else: + self._lock_cls = NoOpLockLocalStorage + + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port, **kwargs) def _make_path(self, path, ignore_existing=True): """ @@ -101,8 +176,7 @@ def _make_path(self, path, ignore_existing=True): try: os.makedirs(path) - except OSError: - exp = sys.exc_info()[1] + except OSError as exp: if exp.errno == errno.EEXIST and not ignore_existing: raise exp @@ -114,9 +188,8 @@ def _check_container_name(self, container_name): :type container_name: ``str`` """ - if '/' in container_name or '\\' in container_name: - raise InvalidContainerNameError(value=None, driver=self, - container_name=container_name) + if "/" in container_name or "\\" in container_name: + raise InvalidContainerNameError(value=None, driver=self, container_name=container_name) def _make_container(self, container_name): """ @@ -136,15 +209,14 @@ def _make_container(self, container_name): try: stat = os.stat(full_path) if not os.path.isdir(full_path): - raise OSError('Target path is not a directory') + raise OSError("Target path is not a directory") except OSError: - raise ContainerDoesNotExistError(value=None, driver=self, - container_name=container_name) + raise ContainerDoesNotExistError(value=None, driver=self, container_name=container_name) extra = {} - extra['creation_time'] = stat.st_ctime - extra['access_time'] = stat.st_atime - extra['modify_time'] = stat.st_mtime + extra["creation_time"] = stat.st_ctime + extra["access_time"] = stat.st_atime + extra["modify_time"] = stat.st_mtime return Container(name=container_name, extra=extra, driver=self) @@ -170,24 +242,29 @@ def _make_object(self, container, object_name): try: stat = os.stat(full_path) except Exception: - raise ObjectDoesNotExistError(value=None, driver=self, - object_name=object_name) + raise ObjectDoesNotExistError(value=None, driver=self, object_name=object_name) # Make a hash for the file based on the metadata. We can safely # use only the mtime attribute here. If the file contents change, # the underlying file-system will change mtime data_hash = self._get_hash_function() - data_hash.update(u(stat.st_mtime).encode('ascii')) + data_hash.update(u(stat.st_mtime).encode("ascii")) data_hash = data_hash.hexdigest() extra = {} - extra['creation_time'] = stat.st_ctime - extra['access_time'] = stat.st_atime - extra['modify_time'] = stat.st_mtime - - return Object(name=object_name, size=stat.st_size, extra=extra, - driver=self, container=container, hash=data_hash, - meta_data=None) + extra["creation_time"] = stat.st_ctime + extra["access_time"] = stat.st_atime + extra["modify_time"] = stat.st_mtime + + return Object( + name=object_name, + size=stat.st_size, + extra=extra, + driver=self, + container=container, + hash=data_hash, + meta_data=None, + ) def iterate_containers(self): """ @@ -221,18 +298,28 @@ def _get_objects(self, container): object_name = relpath(full_path, start=cpath) yield self._make_object(container, object_name) - def iterate_container_objects(self, container): + def iterate_container_objects(self, container, prefix=None, ex_prefix=None): """ Returns a generator of objects for the given container. :param container: Container instance :type container: :class:`Container` + :param prefix: Filter objects starting with a prefix. + :type prefix: ``str`` + + :param ex_prefix: (Deprecated.) Filter objects starting with a prefix. + :type ex_prefix: ``str`` + :return: A generator of Object instances. :rtype: ``generator`` of :class:`Object` """ + prefix = self._normalize_prefix_argument(prefix, ex_prefix) - return self._get_objects(container) + objects = self._get_objects(container) + objects = sorted(objects, key=lambda o: o.name) + + return self._filter_listed_container_objects(objects, prefix) def get_container(self, container_name): """ @@ -262,8 +349,7 @@ def get_container_cdn_url(self, container, check=False): path = os.path.join(self.base_path, container.name) if check and not os.path.isdir(path): - raise ContainerDoesNotExistError(value=None, driver=self, - container_name=container.name) + raise ContainerDoesNotExistError(value=None, driver=self, container_name=container.name) return path @@ -306,9 +392,8 @@ def enable_container_cdn(self, container): """ path = self.get_container_cdn_url(container) - lockfile.MkdirFileLock(path, threaded=True) - with LockLocalStorage(path): + with self._lock_cls(path): self._make_path(path) return True @@ -324,19 +409,20 @@ def enable_object_cdn(self, obj): """ path = self.get_object_cdn_url(obj) - with LockLocalStorage(path): + with self._lock_cls(path): if os.path.exists(path): return False try: - obj_file = open(path, 'w') + obj_file = open(path, "w") obj_file.close() - except: + except Exception: return False return True - def download_object(self, obj, destination_path, overwrite_existing=False, - delete_on_failure=True): + def download_object( + self, obj, destination_path, overwrite_existing=False, delete_on_failure=True + ): """ Download an object to the specified destination path. @@ -359,29 +445,19 @@ def download_object(self, obj, destination_path, overwrite_existing=False, otherwise. :rtype: ``bool`` """ - obj_path = self.get_object_cdn_url(obj) - base_name = os.path.basename(destination_path) - if not base_name and not os.path.exists(destination_path): - raise LibcloudError( - value='Path %s does not exist' % (destination_path), - driver=self) - - if not base_name: - file_path = os.path.join(destination_path, obj.name) - else: - file_path = destination_path - - if os.path.exists(file_path) and not overwrite_existing: - raise LibcloudError( - value='File %s already exists, but ' % (file_path) + - 'overwrite_existing=False', - driver=self) + file_path = self._get_obj_file_path( + obj=obj, + destination_path=destination_path, + overwrite_existing=overwrite_existing, + ) try: shutil.copy(obj_path, file_path) - except IOError: + except shutil.SameFileError: + return False + except OSError: if delete_on_failure: try: os.unlink(file_path) @@ -401,17 +477,85 @@ def download_object_as_stream(self, obj, chunk_size=None): :param chunk_size: Optional chunk size (in bytes). :type chunk_size: ``int`` + :return: A stream of binary chunks of data. :rtype: ``object`` """ + path = self.get_object_cdn_url(obj) + with open(path, "rb") as obj_file: + yield from read_in_chunks(obj_file, chunk_size=chunk_size) + + def download_object_range( + self, + obj, + destination_path, + start_bytes, + end_bytes=None, + overwrite_existing=False, + delete_on_failure=True, + ): + self._validate_start_and_end_bytes(start_bytes=start_bytes, end_bytes=end_bytes) + + file_path = self._get_obj_file_path( + obj=obj, + destination_path=destination_path, + overwrite_existing=overwrite_existing, + ) + + iterator = self.download_object_range_as_stream( + obj=obj, start_bytes=start_bytes, end_bytes=end_bytes + ) + + try: + with open(file_path, "wb") as fp: + for chunk in iterator: + fp.write(chunk) + except Exception: + if delete_on_failure and os.path.exists(file_path): + try: + os.remove(file_path) + except OSError: + # Don't let a failure to clean up the partially + # written file mask the original download exception. + pass + raise + + return True + + def download_object_range_as_stream(self, obj, start_bytes, end_bytes=None, chunk_size=None): + self._validate_start_and_end_bytes(start_bytes=start_bytes, end_bytes=end_bytes) + chunk_size = chunk_size or CHUNK_SIZE + if chunk_size < 0: + raise ValueError("chunk_size must be greater than 0") path = self.get_object_cdn_url(obj) + with open(path, "rb") as obj_file: + file_size = os.fstat(obj_file.fileno()).st_size + + if end_bytes and end_bytes > file_size: + raise ValueError("end_bytes is larger than file size") - with open(path) as obj_file: - for data in read_in_chunks(obj_file, chunk_size=chunk_size): + if end_bytes is None: + read_bytes = file_size - start_bytes + else: + read_bytes = end_bytes - start_bytes + + obj_file.seek(start_bytes) + while read_bytes > 0: + data = obj_file.read(min(chunk_size, read_bytes)) + if not data: + break + read_bytes -= len(data) yield data - def upload_object(self, file_path, container, object_name, extra=None, - verify_hash=True): + def upload_object( + self, + file_path, + container, + object_name, + extra=None, + verify_hash=True, + headers=None, + ): """ Upload an object currently located on a disk. @@ -430,6 +574,9 @@ def upload_object(self, file_path, container, object_name, extra=None, :param extra: (optional) Extra attributes (driver specific). :type extra: ``dict`` + :param headers: (optional) Headers (driver specific). + :type headers: ``dict`` + :rtype: ``object`` """ @@ -439,16 +586,14 @@ def upload_object(self, file_path, container, object_name, extra=None, self._make_path(base_path) - with LockLocalStorage(obj_path): + with self._lock_cls(obj_path): shutil.copy(file_path, obj_path) - os.chmod(obj_path, int('664', 8)) + os.chmod(obj_path, int("664", 8)) return self._make_object(container, object_name) - def upload_object_via_stream(self, iterator, container, - object_name, - extra=None): + def upload_object_via_stream(self, iterator, container, object_name, extra=None, headers=None): """ Upload an object using an iterator. @@ -467,7 +612,8 @@ def upload_object_via_stream(self, iterator, container, doesn't need to buffer whole object in the memory. :type iterator: ``object`` - :param iterator: An object which implements the iterator interface. + :param iterator: An object which implements the iterator + interface and yields binary chunks of data. :type container: :class:`Container` :param container: Destination container. @@ -480,24 +626,19 @@ def upload_object_via_stream(self, iterator, container, This dictionary must contain a 'content_type' key which represents a content type of the stored object. + :param headers: (optional) Headers (driver specific). + :type headers: ``dict`` + :rtype: ``object`` """ - path = self.get_container_cdn_url(container, check=True) obj_path = os.path.join(path, object_name) base_path = os.path.dirname(obj_path) - self._make_path(base_path) - - with LockLocalStorage(obj_path): - obj_file = open(obj_path, 'w') + with self._lock_cls(obj_path), open(obj_path, "wb") as obj_file: for data in iterator: obj_file.write(data) - - obj_file.close() - - os.chmod(obj_path, int('664', 8)) - + os.chmod(obj_path, int("664", 8)) return self._make_object(container, object_name) def delete_object(self, obj): @@ -513,7 +654,7 @@ def delete_object(self, obj): path = self.get_object_cdn_url(obj) - with LockLocalStorage(path): + with self._lock_cls(path): try: os.unlink(path) except Exception: @@ -527,8 +668,7 @@ def delete_object(self, obj): while path != container_url: try: os.rmdir(path) - except OSError: - exp = sys.exc_info()[1] + except OSError as exp: if exp.errno == errno.ENOTEMPTY: break raise exp @@ -554,21 +694,19 @@ def create_container(self, container_name): try: self._make_path(path, ignore_existing=False) - except OSError: - exp = sys.exc_info()[1] + except OSError as exp: if exp.errno == errno.EEXIST: raise ContainerAlreadyExistsError( - value='Container with this name already exists. The name ' - 'must be unique among all the containers in the ' - 'system', - container_name=container_name, driver=self) + value="Container with this name already exists. The name " + "must be unique among all the containers in the " + "system", + container_name=container_name, + driver=self, + ) else: - raise LibcloudError( - 'Error creating container %s' % container_name, - driver=self) + raise LibcloudError("Error creating container %s" % container_name, driver=self) except Exception: - raise LibcloudError( - 'Error creating container %s' % container_name, driver=self) + raise LibcloudError("Error creating container %s" % container_name, driver=self) return self._make_container(container_name) @@ -585,16 +723,38 @@ def delete_container(self, container): # Check if there are any objects inside this for obj in self._get_objects(container): - raise ContainerIsNotEmptyError(value='Container is not empty', - container_name=container.name, - driver=self) + raise ContainerIsNotEmptyError( + value="Container is not empty", + container_name=container.name, + driver=self, + ) path = self.get_container_cdn_url(container, check=True) - with LockLocalStorage(path): + with self._lock_cls(path): try: shutil.rmtree(path) except Exception: return False return True + + def _get_obj_file_path(self, obj, destination_path, overwrite_existing=False): + # type: (Object, str, bool) -> str + base_name = os.path.basename(destination_path) + + if not base_name and not os.path.exists(destination_path): + raise LibcloudError(value="Path %s does not exist" % (destination_path), driver=self) + + if not base_name: + file_path = os.path.join(destination_path, obj.name) + else: + file_path = destination_path + + if os.path.exists(file_path) and not overwrite_existing: + raise LibcloudError( + value="File %s already exists, but " % (file_path) + "overwrite_existing=False", + driver=self, + ) + + return file_path diff --git a/libcloud/storage/drivers/minio.py b/libcloud/storage/drivers/minio.py new file mode 100644 index 0000000000..a1bafdd21a --- /dev/null +++ b/libcloud/storage/drivers/minio.py @@ -0,0 +1,70 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.common.aws import SignedAWSConnection +from libcloud.common.types import LibcloudError +from libcloud.storage.drivers.s3 import API_VERSION, BaseS3Connection, BaseS3StorageDriver + +__all__ = ["MinIOStorageDriver"] + + +class MinIOConnectionAWS4(SignedAWSConnection, BaseS3Connection): + service_name = "s3" + version = API_VERSION + + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + token=None, + retry_delay=None, + backoff=None, + **kwargs, + ): + super().__init__( + user_id, + key, + secure, + host, + port, + url, + timeout, + proxy_url, + token, + retry_delay, + backoff, + 4, + ) # force aws4 + + +class MinIOStorageDriver(BaseS3StorageDriver): + name = "MinIO Storage Driver" + website = "https://min.io/" + connectionCls = MinIOConnectionAWS4 + region_name = "" + + def __init__(self, key, secret=None, secure=True, host=None, port=None): + if host is None: + raise LibcloudError("host argument is required", driver=self) + + self.connectionCls.host = host + + super().__init__(key=key, secret=secret, secure=secure, host=host, port=port) diff --git a/libcloud/storage/drivers/nimbus.py b/libcloud/storage/drivers/nimbus.py index 583aefbb10..d379a221a9 100644 --- a/libcloud/storage/drivers/nimbus.py +++ b/libcloud/storage/drivers/nimbus.py @@ -13,26 +13,28 @@ # See the License for the specific language governing permissions and # limitations under the License. +import hmac import time import hashlib -import hmac + +from libcloud.utils.py3 import httplib, urlencode +from libcloud.common.base import JsonResponse, ConnectionUserAndKey +from libcloud.common.types import LibcloudError, InvalidCredsError +from libcloud.storage.base import Container, StorageDriver try: import simplejson as json except ImportError: - import json # NOQA - -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlencode - -from libcloud.common.base import ConnectionUserAndKey, JsonResponse -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.storage.base import Container, StorageDriver + import json # type: ignore # noqa: F401 class NimbusResponse(JsonResponse): - valid_response_codes = [httplib.OK, httplib.NOT_FOUND, httplib.CONFLICT, - httplib.BAD_REQUEST] + valid_response_codes = [ + httplib.OK, + httplib.NOT_FOUND, + httplib.CONFLICT, + httplib.BAD_REQUEST, + ] def success(self): return self.status in self.valid_response_codes @@ -40,64 +42,65 @@ def success(self): def parse_error(self): if self.status in [httplib.UNAUTHORIZED]: raise InvalidCredsError(self.body) - raise LibcloudError('Unknown error. Status code: %d' % (self.status), - driver=self.connection.driver) + raise LibcloudError( + "Unknown error. Status code: %d" % (self.status), + driver=self.connection.driver, + ) class NimbusConnection(ConnectionUserAndKey): - host = 'nimbus.io' + host = "nimbus.io" responseCls = NimbusResponse def __init__(self, *args, **kwargs): - self.id = kwargs.pop('id') - super(NimbusConnection, self).__init__(*args, **kwargs) + self.id = kwargs.pop("id") + super().__init__(*args, **kwargs) def pre_connect_hook(self, params, headers): timestamp = str(int(time.time())) - signature = self._calculate_signature(user_id=self.user_id, - method=self.method, - params=params, - path=self.action, - timestamp=timestamp, - key=self.key) - headers['X-NIMBUS-IO-Timestamp'] = timestamp - headers['Authorization'] = 'NIMBUS.IO %s:%s' % (self.id, signature) + signature = self._calculate_signature( + user_id=self.user_id, + method=self.method, + params=params, + path=self.action, + timestamp=timestamp, + key=self.key, + ) + headers["X-NIMBUS-IO-Timestamp"] = timestamp + headers["Authorization"] = "NIMBUS.IO {}:{}".format(self.id, signature) return params, headers - def _calculate_signature(self, user_id, method, params, path, timestamp, - key): + def _calculate_signature(self, user_id, method, params, path, timestamp, key): if params: - uri_path = path + '?' + urlencode(params) + uri_path = path + "?" + urlencode(params) else: uri_path = path string_to_sign = [user_id, method, str(timestamp), uri_path] - string_to_sign = '\n'.join(string_to_sign) + string_to_sign = "\n".join(string_to_sign) hmac_value = hmac.new(key, string_to_sign, hashlib.sha256) return hmac_value.hexdigest() class NimbusStorageDriver(StorageDriver): - name = 'Nimbus.io' - website = 'https://nimbus.io/' + name = "Nimbus.io" + website = "https://nimbus.io/" connectionCls = NimbusConnection def __init__(self, *args, **kwargs): - self.user_id = kwargs['user_id'] - super(NimbusStorageDriver, self).__init__(*args, **kwargs) + self.user_id = kwargs["user_id"] + super().__init__(*args, **kwargs) def iterate_containers(self): - response = self.connection.request('/customers/%s/collections' % - (self.user_id)) + response = self.connection.request("/customers/%s/collections" % (self.user_id)) return self._to_containers(response.object) def create_container(self, container_name): - params = {'action': 'create', 'name': container_name} - response = self.connection.request('/customers/%s/collections' % - (self.user_id), - params=params, - method='POST') + params = {"action": "create", "name": container_name} + response = self.connection.request( + "/customers/%s/collections" % (self.user_id), params=params, method="POST" + ) return self._to_container(response.object) def _to_containers(self, data): @@ -106,9 +109,9 @@ def _to_containers(self, data): def _to_container(self, data): name = data[0] - extra = {'date_created': data[2]} + extra = {"date_created": data[2]} return Container(name=name, extra=extra, driver=self) def _ex_connection_class_kwargs(self): - result = {'id': self.user_id} + result = {"id": self.user_id} return result diff --git a/libcloud/storage/drivers/ninefold.py b/libcloud/storage/drivers/ninefold.py index fbdf567842..df7a9314b6 100644 --- a/libcloud/storage/drivers/ninefold.py +++ b/libcloud/storage/drivers/ninefold.py @@ -18,9 +18,9 @@ class NinefoldStorageDriver(AtmosDriver): - host = 'api.ninefold.com' - path = '/storage/v1.0' + host = "api.ninefold.com" + path = "/storage/v1.0" type = Provider.NINEFOLD - name = 'Ninefold' - website = 'http://ninefold.com/' + name = "Ninefold" + website = "http://ninefold.com/" diff --git a/libcloud/storage/drivers/oss.py b/libcloud/storage/drivers/oss.py new file mode 100644 index 0000000000..f582886afb --- /dev/null +++ b/libcloud/storage/drivers/oss.py @@ -0,0 +1,1059 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=unexpected-keyword-arg + +import os +import hmac +import time +import base64 +import codecs +from hashlib import sha1 + +from libcloud.utils.py3 import ET, b, httplib, tostring, urlquote, urlencode +from libcloud.utils.xml import findtext, fixxpath +from libcloud.common.base import RawResponse, XmlResponse, ConnectionUserAndKey +from libcloud.utils.files import read_in_chunks +from libcloud.common.types import LibcloudError, InvalidCredsError, MalformedResponseError +from libcloud.storage.base import Object, Container, StorageDriver +from libcloud.storage.types import ( + ContainerError, + ObjectDoesNotExistError, + ObjectHashMismatchError, + ContainerIsNotEmptyError, + InvalidContainerNameError, + ContainerDoesNotExistError, +) + +try: + from lxml.etree import Element, SubElement +except ImportError: + from xml.etree.ElementTree import Element, SubElement + + +__all__ = [ + "OSSStorageDriver", + "OSSMultipartUpload", + "EXPIRATION_SECONDS", + "CHUNK_SIZE", + "MAX_UPLOADS_PER_RESPONSE", +] + +GMT_TIME_FORMAT = "%a, %d %b %Y %H:%M:%S GMT" +EXPIRATION_SECONDS = 15 * 60 + +# OSS multi-part chunks must be great than 100KB except the last one +CHUNK_SIZE = 100 * 1024 + +# Desired number of items in each response inside a paginated request in +# ex_iterate_multipart_uploads. +MAX_UPLOADS_PER_RESPONSE = 1000 + + +class OSSResponse(XmlResponse): + namespace = None + valid_response_codes = [httplib.NOT_FOUND, httplib.CONFLICT, httplib.BAD_REQUEST] + + def success(self): + i = int(self.status) + return 200 <= i <= 299 or i in self.valid_response_codes + + def parse_body(self): + """ + OSSResponse body is in utf-8 encoding. + """ + if len(self.body) == 0 and not self.parse_zero_length_body: + return self.body + + try: + parser = ET.XMLParser(encoding="utf-8") + body = ET.XML(self.body.encode("utf-8"), parser=parser) + except Exception: + raise MalformedResponseError( + "Failed to parse XML", body=self.body, driver=self.connection.driver + ) + return body + + def parse_error(self): + if self.status in [httplib.UNAUTHORIZED, httplib.FORBIDDEN]: + raise InvalidCredsError(self.body) + elif self.status == httplib.MOVED_PERMANENTLY: + raise LibcloudError( + "This bucket is located in a different " + "region. Please use the correct driver.", + driver=OSSStorageDriver, + ) + elif self.status == httplib.METHOD_NOT_ALLOWED: + raise LibcloudError( + "The method is not allowed. Status code: %d, " + "headers: %s" % (self.status, self.headers) + ) + raise LibcloudError( + "Unknown error. Status code: %d, body: %s" % (self.status, self.body), + driver=OSSStorageDriver, + ) + + +class OSSRawResponse(OSSResponse, RawResponse): + pass + + +class OSSConnection(ConnectionUserAndKey): + """ + Represents a single connection to the Aliyun OSS Endpoint + """ + + _domain = "aliyuncs.com" + _default_location = "oss" + responseCls = OSSResponse + rawResponseCls = OSSRawResponse + + @staticmethod + def _get_auth_signature(method, headers, params, expires, secret_key, path, vendor_prefix): + """ + Signature = base64(hmac-sha1(AccessKeySecret, + VERB + "\n" + + CONTENT-MD5 + "\n" + + CONTENT-TYPE + "\n" + + EXPIRES + "\n" + + CanonicalizedOSSHeaders + + CanonicalizedResource)) + """ + special_headers = {"content-md5": "", "content-type": "", "expires": ""} + vendor_headers = {} + + for key, value in list(headers.items()): + key_lower = key.lower() + if key_lower in special_headers: + special_headers[key_lower] = value.strip() + elif key_lower.startswith(vendor_prefix): + vendor_headers[key_lower] = value.strip() + + if expires: + special_headers["expires"] = str(expires) + + buf = [method] + for _, value in sorted(special_headers.items()): + buf.append(value) + string_to_sign = "\n".join(buf) + + buf = [] + for key, value in sorted(vendor_headers.items()): + buf.append("{}:{}".format(key, value)) + header_string = "\n".join(buf) + + values_to_sign = [] + for value in [string_to_sign, header_string, path]: + if value: + values_to_sign.append(value) + + string_to_sign = "\n".join(values_to_sign) + b64_hmac = base64.b64encode( + hmac.new(b(secret_key), b(string_to_sign), digestmod=sha1).digest() + ) + return b64_hmac + + @staticmethod + def _get_expires(params): + """ + Get expires timeout seconds from parameters. + """ + expires = None + if "expires" in params: + expires = params["expires"] + elif "Expires" in params: + expires = params["Expires"] + if expires: + try: + return int(expires) + except Exception: + pass + return int(time.time()) + EXPIRATION_SECONDS + + def add_default_params(self, params): + expires_at = self._get_expires(params) + expires = str(expires_at) + params["OSSAccessKeyId"] = self.user_id + params["Expires"] = expires + return params + + def add_default_headers(self, headers): + headers["Date"] = time.strftime(GMT_TIME_FORMAT, time.gmtime()) + return headers + + def pre_connect_hook(self, params, headers): + if self._container: + path = "/{}{}".format(self._container.name, self.action) + else: + path = self.action + + # pylint: disable=no-member + params["Signature"] = self._get_auth_signature( + method=self.method, + headers=headers, + params=params, + expires=params["Expires"], + secret_key=self.key, + path=path, + vendor_prefix=self.driver.http_vendor_prefix, + ) + return params, headers + + def request( + self, + action, + params=None, + data=None, + headers=None, + method="GET", + raw=False, + container=None, + ): + self.host = "{}.{}".format(self._default_location, self._domain) + self._container = container + if container and container.name: + if "location" in container.extra: + self.host = "{}.{}.{}".format( + container.name, + container.extra["location"], + self._domain, + ) + else: + self.host = "{}.{}".format(container.name, self.host) + return super().request( + action=action, + params=params, + data=data, + headers=headers, + method=method, + raw=raw, + ) + + +class OSSMultipartUpload: + """ + Class representing an Aliyun OSS multipart upload + """ + + def __init__(self, key, id, initiated): + """ + Class representing an Aliyun OSS multipart upload + + :param key: The object/key that was being uploaded + :type key: ``str`` + + :param id: The upload id assigned by Aliyun + :type id: ``str`` + + :param initiated: The date/time at which the upload was started + :type created_at: ``str`` + """ + self.key = key + self.id = id + self.initiated = initiated + + def __repr__(self): + return "" % (self.key) + + +class OSSStorageDriver(StorageDriver): + name = "Aliyun OSS" + website = "http://www.aliyun.com/product/oss" + connectionCls = OSSConnection + hash_type = "md5" + supports_chunked_encoding = False + supports_multipart_upload = True + namespace = None + http_vendor_prefix = "x-oss-" + + def iterate_containers(self): + response = self.connection.request("/") + if response.status == httplib.OK: + containers = self._to_containers(obj=response.object, xpath="Buckets/Bucket") + return containers + + raise LibcloudError("Unexpected status code: %s" % (response.status), driver=self) + + def iterate_container_objects(self, container, prefix=None, ex_prefix=None): + """ + Return a generator of objects for the given container. + + :param container: Container instance + :type container: :class:`Container` + + :keyword prefix: Only return objects starting with prefix + :type prefix: ``str`` + + :keyword ex_prefix: (Deprecated.) Only return objects starting with + ex_prefix + :type ex_prefix: ``str`` + + :return: A generator of Object instances. + :rtype: ``generator`` of :class:`Object` + """ + prefix = self._normalize_prefix_argument(prefix, ex_prefix) + + params = {} + + if prefix: + params["prefix"] = prefix + + last_key = None + exhausted = False + + while not exhausted: + if last_key: + params["marker"] = last_key + + response = self.connection.request("/", params=params, container=container) + + if response.status != httplib.OK: + raise LibcloudError("Unexpected status code: %s" % (response.status), driver=self) + + objects = self._to_objs(obj=response.object, xpath="Contents", container=container) + is_truncated = response.object.findtext( + fixxpath(xpath="IsTruncated", namespace=self.namespace) + ).lower() + exhausted = is_truncated == "false" + + last_key = None + for obj in objects: + last_key = obj.name + yield obj + + def get_container(self, container_name): + for container in self.iterate_containers(): + if container.name == container_name: + return container + raise ContainerDoesNotExistError(value=None, driver=self, container_name=container_name) + + def get_object(self, container_name, object_name): + container = self.get_container(container_name=container_name) + object_path = self._get_object_path(container, object_name) + response = self.connection.request(object_path, method="HEAD", container=container) + + if response.status == httplib.OK: + obj = self._headers_to_object( + object_name=object_name, container=container, headers=response.headers + ) + return obj + + raise ObjectDoesNotExistError(value=None, driver=self, object_name=object_name) + + def create_container(self, container_name, ex_location=None): + """ + @inherits :class:`StorageDriver.create_container` + + :keyword ex_location: The desired location where to create container + :type keyword: ``str`` + """ + extra = None + if ex_location: + root = Element("CreateBucketConfiguration") + child = SubElement(root, "LocationConstraint") + child.text = ex_location + + data = tostring(root) + extra = {"location": ex_location} + else: + data = "" + + container = Container(name=container_name, extra=extra, driver=self) + response = self.connection.request("/", data=data, method="PUT", container=container) + + if response.status == httplib.OK: + return container + elif response.status == httplib.CONFLICT: + raise InvalidContainerNameError( + value="Container with this name already exists. The name must " + "be unique among all the containers in the system", + container_name=container_name, + driver=self, + ) + elif response.status == httplib.BAD_REQUEST: + raise ContainerError( + value="Bad request when creating container: %s" % response.body, + container_name=container_name, + driver=self, + ) + + raise LibcloudError("Unexpected status code: %s" % (response.status), driver=self) + + def delete_container(self, container): + # Note: All the objects in the container must be deleted first + response = self.connection.request("/", method="DELETE", container=container) + if response.status == httplib.NO_CONTENT: + return True + elif response.status == httplib.CONFLICT: + raise ContainerIsNotEmptyError( + value="Container must be empty before it can be deleted.", + container_name=container.name, + driver=self, + ) + elif response.status == httplib.NOT_FOUND: + raise ContainerDoesNotExistError(value=None, driver=self, container_name=container.name) + + return False + + def download_object( + self, obj, destination_path, overwrite_existing=False, delete_on_failure=True + ): + obj_path = self._get_object_path(obj.container, obj.name) + + response = self.connection.request( + obj_path, method="GET", raw=True, container=obj.container + ) + + return self._get_object( + obj=obj, + callback=self._save_object, + response=response, + callback_kwargs={ + "obj": obj, + "response": response.response, + "destination_path": destination_path, + "overwrite_existing": overwrite_existing, + "delete_on_failure": delete_on_failure, + }, + success_status_code=httplib.OK, + ) + + def download_object_as_stream(self, obj, chunk_size=None): + obj_path = self._get_object_path(obj.container, obj.name) + response = self.connection.request( + obj_path, method="GET", raw=True, container=obj.container + ) + + return self._get_object( + obj=obj, + callback=read_in_chunks, + response=response, + callback_kwargs={"iterator": response.response, "chunk_size": chunk_size}, + success_status_code=httplib.OK, + ) + + def upload_object( + self, + file_path, + container, + object_name, + extra=None, + verify_hash=True, + headers=None, + ): + return self._put_object( + container=container, + object_name=object_name, + extra=extra, + file_path=file_path, + verify_hash=verify_hash, + ) + + def upload_object_via_stream(self, iterator, container, object_name, extra=None, headers=None): + method = "PUT" + params = None + + if self.supports_multipart_upload: + # @TODO: This needs implementing again from scratch. + pass + return self._put_object( + container=container, + object_name=object_name, + extra=extra, + method=method, + query_args=params, + stream=iterator, + verify_hash=False, + headers=headers, + ) + + def delete_object(self, obj): + object_path = self._get_object_path(obj.container, obj.name) + response = self.connection.request(object_path, method="DELETE", container=obj.container) + if response.status == httplib.NO_CONTENT: + return True + elif response.status == httplib.NOT_FOUND: + raise ObjectDoesNotExistError(value=None, driver=self, object_name=obj.name) + + return False + + def ex_iterate_multipart_uploads( + self, + container, + prefix=None, + delimiter=None, + max_uploads=MAX_UPLOADS_PER_RESPONSE, + ): + """ + Extension method for listing all in-progress OSS multipart uploads. + + Each multipart upload which has not been committed or aborted is + considered in-progress. + + :param container: The container holding the uploads + :type container: :class:`Container` + + :keyword prefix: Print only uploads of objects with this prefix + :type prefix: ``str`` + + :keyword delimiter: The object/key names are grouped based on + being split by this delimiter + :type delimiter: ``str`` + + :keyword max_uploads: The max upload items returned for one request + :type max_uploads: ``int`` + + :return: A generator of OSSMultipartUpload instances. + :rtype: ``generator`` of :class:`OSSMultipartUpload` + """ + + if not self.supports_multipart_upload: + raise LibcloudError("Feature not supported", driver=self) + + request_path = "/?uploads" + params = {"max-uploads": max_uploads} + + if prefix: + params["prefix"] = prefix + + if delimiter: + params["delimiter"] = delimiter + + def finder(node, text): + return node.findtext(fixxpath(xpath=text, namespace=self.namespace)) + + while True: + response = self.connection.request(request_path, params=params, container=container) + + if response.status != httplib.OK: + raise LibcloudError( + "Error fetching multipart uploads. " "Got code: %s" % response.status, + driver=self, + ) + + body = response.parse_body() + # pylint: disable=maybe-no-member + for node in body.findall(fixxpath(xpath="Upload", namespace=self.namespace)): + key = finder(node, "Key") + upload_id = finder(node, "UploadId") + initiated = finder(node, "Initiated") + + yield OSSMultipartUpload(key, upload_id, initiated) + + # Check if this is the last entry in the listing + # pylint: disable=maybe-no-member + is_truncated = body.findtext(fixxpath(xpath="IsTruncated", namespace=self.namespace)) + + if is_truncated.lower() == "false": + break + + # Provide params for the next request + upload_marker = body.findtext( + fixxpath(xpath="NextUploadIdMarker", namespace=self.namespace) + ) + key_marker = body.findtext(fixxpath(xpath="NextKeyMarker", namespace=self.namespace)) + + params["key-marker"] = key_marker + params["upload-id-marker"] = upload_marker + + def ex_abort_all_multipart_uploads(self, container, prefix=None): + """ + Extension method for removing all partially completed OSS multipart + uploads. + + :param container: The container holding the uploads + :type container: :class:`Container` + + :keyword prefix: Delete only uploads of objects with this prefix + :type prefix: ``str`` + """ + + # Iterate through the container and delete the upload ids + for upload in self.ex_iterate_multipart_uploads(container, prefix, delimiter=None): + object_path = self._get_object_path(container, upload.key) + self._abort_multipart(object_path, upload.id, container=container) + + def _clean_object_name(self, name): + name = urlquote(name) + return name + + def _upload_object( + self, + object_name, + content_type, + request_path, + request_method="PUT", + headers=None, + file_path=None, + stream=None, + chunked=False, + multipart=False, + container=None, + ): + """ + Helper function for setting common request headers and calling the + passed in callback which uploads an object. + """ + headers = headers or {} + + if file_path and not os.path.exists(file_path): + raise OSError("File %s does not exist" % (file_path)) + + if stream is not None and not hasattr(stream, "next") and not hasattr(stream, "__next__"): + raise AttributeError("iterator object must implement next() " + "method.") + + headers["Content-Type"] = self._determine_content_type( + content_type, object_name, file_path=file_path + ) + + if stream: + response = self.connection.request( + request_path, + method=request_method, + data=stream, + headers=headers, + raw=True, + container=container, + ) + stream_hash, stream_length = self._hash_buffered_stream( + stream, self._get_hash_function() + ) + else: + with open(file_path, "rb") as file_stream: + response = self.connection.request( + request_path, + method=request_method, + data=file_stream, + headers=headers, + raw=True, + container=container, + ) + with open(file_path, "rb") as file_stream: + stream_hash, stream_length = self._hash_buffered_stream( + file_stream, self._get_hash_function() + ) + + return { + "response": response, + "bytes_transferred": stream_length, + "data_hash": stream_hash, + } + + def _put_object( + self, + container, + object_name, + method="PUT", + query_args=None, + extra=None, + file_path=None, + stream=None, + verify_hash=False, + headers=None, + ): + """ + Create an object and upload data using the given function. + """ + headers = headers or {} + extra = extra or {} + + content_type = extra.get("content_type", None) + meta_data = extra.get("meta_data", None) + acl = extra.get("acl", None) + + if meta_data: + for key, value in list(meta_data.items()): + key = self.http_vendor_prefix + "meta-%s" % (key) + headers[key] = value + + if acl: + if acl not in ["public-read", "private", "public-read-write"]: + raise AttributeError("invalid acl value: %s" % acl) + headers[self.http_vendor_prefix + "object-acl"] = acl + + request_path = self._get_object_path(container, object_name) + + if query_args: + request_path = "?".join((request_path, query_args)) + + result_dict = self._upload_object( + object_name=object_name, + content_type=content_type, + request_path=request_path, + request_method=method, + headers=headers, + file_path=file_path, + stream=stream, + container=container, + ) + + response = result_dict["response"] + bytes_transferred = result_dict["bytes_transferred"] + headers = response.headers + + server_hash = headers["etag"].replace('"', "") + + if verify_hash and result_dict["data_hash"].upper() != server_hash.upper(): + raise ObjectHashMismatchError( + value="MD5 hash {} checksum does not match {}".format( + server_hash, result_dict["data_hash"] + ), + object_name=object_name, + driver=self, + ) + elif response.status == httplib.OK: + obj = Object( + name=object_name, + size=bytes_transferred, + hash=server_hash, + extra={"acl": acl}, + meta_data=meta_data, + container=container, + driver=self, + ) + + return obj + else: + raise LibcloudError( + "Unexpected status code, status_code=%s" % (response.status), + driver=self, + ) + + def _upload_multipart( + self, response, data, iterator, container, object_name, calculate_hash=True + ): + """ + Callback invoked for uploading data to OSS using Aliyun's + multipart upload mechanism + + :param response: Response object from the initial POST request + :type response: :class:`OSSRawResponse` + + :param data: Any data from the initial POST request + :type data: ``str`` + + :param iterator: The generator for fetching the upload data + :type iterator: ``generator`` + + :param container: The container owning the object to which data is + being uploaded + :type container: :class:`Container` + + :param object_name: The name of the object to which we are uploading + :type object_name: ``str`` + + :keyword calculate_hash: Indicates if we must calculate the data hash + :type calculate_hash: ``bool`` + + :return: A tuple of (status, checksum, bytes transferred) + :rtype: ``tuple`` + """ + + object_path = self._get_object_path(container, object_name) + + # Get the upload id from the response xml + response.body = response.response.read() + body = response.parse_body() + upload_id = body.find(fixxpath(xpath="UploadId", namespace=self.namespace)).text + + try: + # Upload the data through the iterator + result = self._upload_from_iterator( + iterator, object_path, upload_id, calculate_hash, container=container + ) + chunks, data_hash, bytes_transferred = result + + # Commit the chunk info and complete the upload + etag = self._commit_multipart(object_path, upload_id, chunks, container=container) + except Exception as e: + # Amazon provides a mechanism for aborting an upload. + self._abort_multipart(object_path, upload_id, container=container) + raise e + + # Modify the response header of the first request. This is used + # by other functions once the callback is done + response.headers["etag"] = etag + + return (True, data_hash, bytes_transferred) + + def _upload_from_iterator( + self, iterator, object_path, upload_id, calculate_hash=True, container=None + ): + """ + Uploads data from an iterator in fixed sized chunks to OSS + + :param iterator: The generator for fetching the upload data + :type iterator: ``generator`` + + :param object_path: The path of the object to which we are uploading + :type object_name: ``str`` + + :param upload_id: The upload id allocated for this multipart upload + :type upload_id: ``str`` + + :keyword calculate_hash: Indicates if we must calculate the data hash + :type calculate_hash: ``bool`` + + :keyword container: the container object to upload object to + :type container: :class:`Container` + + :return: A tuple of (chunk info, checksum, bytes transferred) + :rtype: ``tuple`` + """ + + data_hash = None + if calculate_hash: + data_hash = self._get_hash_function() + + bytes_transferred = 0 + count = 1 + chunks = [] + params = {"uploadId": upload_id} + + # Read the input data in chunk sizes suitable for AWS + for data in read_in_chunks( + iterator, chunk_size=CHUNK_SIZE, fill_size=True, yield_empty=True + ): + bytes_transferred += len(data) + + if calculate_hash: + data_hash.update(data) + + chunk_hash = self._get_hash_function() + chunk_hash.update(data) + chunk_hash = base64.b64encode(chunk_hash.digest()).decode("utf-8") + + # OSS will calculate hash of the uploaded data and + # check this header. + headers = {"Content-MD5": chunk_hash} + params["partNumber"] = count + + request_path = "?".join((object_path, urlencode(params))) + + resp = self.connection.request( + request_path, + method="PUT", + data=data, + headers=headers, + container=container, + ) + + if resp.status != httplib.OK: + raise LibcloudError("Error uploading chunk", driver=self) + + server_hash = resp.headers["etag"] + + # Keep this data for a later commit + chunks.append((count, server_hash)) + count += 1 + + if calculate_hash: + data_hash = data_hash.hexdigest() + + return (chunks, data_hash, bytes_transferred) + + def _commit_multipart(self, object_path, upload_id, chunks, container=None): + """ + Makes a final commit of the data. + + :param object_path: Server side object path. + :type object_path: ``str`` + + :param upload_id: ID of the multipart upload. + :type upload_id: ``str`` + + :param upload_id: A list of (chunk_number, chunk_hash) tuples. + :type upload_id: ``list`` + + :keyword container: The container owning the object to which data is + being uploaded + :type container: :class:`Container` + """ + + root = Element("CompleteMultipartUpload") + + for count, etag in chunks: + part = SubElement(root, "Part") + part_no = SubElement(part, "PartNumber") + part_no.text = str(count) + + etag_id = SubElement(part, "ETag") + etag_id.text = str(etag) + + data = tostring(root) + + params = {"uploadId": upload_id} + request_path = "?".join((object_path, urlencode(params))) + response = self.connection.request( + request_path, data=data, method="POST", container=container + ) + + if response.status != httplib.OK: + element = response.object + # pylint: disable=maybe-no-member + code, message = response._parse_error_details(element=element) + msg = "Error in multipart commit: {} ({})".format(message, code) + raise LibcloudError(msg, driver=self) + + # Get the server's etag to be passed back to the caller + body = response.parse_body() + server_hash = body.find(fixxpath(xpath="ETag", namespace=self.namespace)).text + return server_hash + + def _abort_multipart(self, object_path, upload_id, container=None): + """ + Aborts an already initiated multipart upload + + :param object_path: Server side object path. + :type object_path: ``str`` + + :param upload_id: ID of the multipart upload. + :type upload_id: ``str`` + + :keyword container: The container owning the object to which data is + being uploaded + :type container: :class:`Container` + """ + + params = {"uploadId": upload_id} + request_path = "?".join((object_path, urlencode(params))) + resp = self.connection.request(request_path, method="DELETE", container=container) + + if resp.status != httplib.NO_CONTENT: + raise LibcloudError( + "Error in multipart abort. status_code=%d" % (resp.status), driver=self + ) + + def _to_containers(self, obj, xpath): + for element in obj.findall(fixxpath(xpath=xpath, namespace=self.namespace)): + yield self._to_container(element) + + def _to_container(self, element): + extra = { + "creation_date": findtext( + element=element, xpath="CreationDate", namespace=self.namespace + ), + "location": findtext(element=element, xpath="Location", namespace=self.namespace), + } + + container = Container( + name=findtext(element=element, xpath="Name", namespace=self.namespace), + extra=extra, + driver=self, + ) + + return container + + def _to_objs(self, obj, xpath, container): + return [ + self._to_obj(element, container) + for element in obj.findall(fixxpath(xpath=xpath, namespace=self.namespace)) + ] + + def _to_obj(self, element, container): + owner_id = findtext(element=element, xpath="Owner/ID", namespace=self.namespace) + owner_display_name = findtext( + element=element, xpath="Owner/DisplayName", namespace=self.namespace + ) + meta_data = { + "owner": { + "id": owner_id, + "display_name": self._safe_decode(owner_display_name), + } + } + last_modified = findtext(element=element, xpath="LastModified", namespace=self.namespace) + extra = {"last_modified": last_modified} + + name = self._safe_decode(findtext(element=element, xpath="Key", namespace=self.namespace)) + obj = Object( + name=name, + size=int(findtext(element=element, xpath="Size", namespace=self.namespace)), + hash=findtext(element=element, xpath="ETag", namespace=self.namespace).replace('"', ""), + extra=extra, + meta_data=meta_data, + container=container, + driver=self, + ) + + return obj + + def _safe_decode(self, encoded): + """ + Decode it as an escaped string and then treat the content as + UTF-8 encoded. + """ + try: + if encoded: + unescaped, _ign = codecs.escape_decode(encoded) + return unescaped.decode("utf-8") + return encoded + except Exception: + return encoded + + def _get_container_path(self, container): + """ + Return a container path + + :param container: Container instance + :type container: :class:`Container` + + :return: A path for this container. + :rtype: ``str`` + """ + return "/%s" % (container.name) + + def _get_object_path(self, container, object_name): + """ + Return an object's path. + Aliyun OSS api puts the container name in the host, + so ignore container here. + + :param container: Container instance + :type container: :class:`Container` + + :param object_name: Object name + :type object_name: :class:`str` + + :return: A path for this object. + :rtype: ``str`` + """ + object_name_cleaned = self._clean_object_name(object_name) + object_path = "/%s" % object_name_cleaned + return object_path + + def _headers_to_object(self, object_name, container, headers): + hash = headers["etag"].replace('"', "") + extra = {"content_type": headers["content-type"], "etag": headers["etag"]} + meta_data = {} + + if "last-modified" in headers: + extra["last_modified"] = headers["last-modified"] + + for key, value in headers.items(): + if not key.lower().startswith(self.http_vendor_prefix + "meta-"): + continue + + key = key.replace(self.http_vendor_prefix + "meta-", "") + meta_data[key] = value + + obj = Object( + name=object_name, + size=int(headers["content-length"]), + hash=hash, + extra=extra, + meta_data=meta_data, + container=container, + driver=self, + ) + return obj diff --git a/libcloud/storage/drivers/ovh.py b/libcloud/storage/drivers/ovh.py new file mode 100644 index 0000000000..f8b46a6882 --- /dev/null +++ b/libcloud/storage/drivers/ovh.py @@ -0,0 +1,116 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from typing import Literal + +from libcloud.storage.drivers.s3 import ( + S3_CDN_URL_EXPIRY_HOURS, + S3StorageDriver, + BaseS3StorageDriver, + S3SignatureV4Connection, +) + +__all__ = ["OvhStorageDriver"] + +OVH_FR_SBG_HOST = "s3.sbg.perf.cloud.ovh.net" +OVH_FR_GRA_HOST = "s3.gra.perf.cloud.ovh.net" + +# Maps OVH region name to connection hostname +REGION_TO_HOST_MAP = { + "sbg": OVH_FR_SBG_HOST, + "gra": OVH_FR_GRA_HOST, +} + +NO_CDN_SUPPORT_ERROR = "CDN feature not implemented" + + +class OvhStorageDriver(BaseS3StorageDriver): + name = "Ovh Storage Driver" + website = "https://www.ovhcloud.com/en/public-cloud/object-storage/" + connectionCls = S3SignatureV4Connection + region_name = "sbg" + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + region="sbg", + url=None, + **kwargs, + ): + # Here for backward compatibility for old and deprecated driver class + # per region approach + if hasattr(self, "region_name") and not region: + region = self.region_name # pylint: disable=no-member + + self.region_name = region + + if region and region not in REGION_TO_HOST_MAP.keys(): + raise ValueError("Invalid or unsupported region: %s" % (region)) + + self.name = "Ovh Object Storage (%s)" % (region) + + if host is None: + self.connectionCls.host = REGION_TO_HOST_MAP[region] + else: + self.connectionCls.host = host + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + region=region, + url=url, + **kwargs, + ) + + @classmethod + def list_regions(self): + return REGION_TO_HOST_MAP.keys() + + def get_object_cdn_url( + self, + obj, + ex_expiry=S3_CDN_URL_EXPIRY_HOURS, + ex_method: Literal["GET", "PUT", "DELETE"] = "GET", + ): + """ + Return a "presigned URL" for read-only access to object + + :param obj: Object instance. + :type obj: :class:`Object` + + :param ex_expiry: The number of hours after which the URL expires. + Defaults to 24 hours or the value of the environment + variable "LIBCLOUD_S3_STORAGE_CDN_URL_EXPIRY_HOURS", + if set. + :type ex_expiry: ``float`` + + :param ex_method: The HTTP method for which the URL is valid. + Defaults to "GET". + :type ex_method: ``str`` + + :return: Presigned URL for the object. + :rtype: ``str`` + """ + # In order to download (private) objects we need to be able to generate a valid CDN URL, + # hence shamefully just use the working code from the S3StorageDriver. + return S3StorageDriver.get_object_cdn_url( + self, obj, ex_expiry=ex_expiry, ex_method=ex_method + ) diff --git a/libcloud/storage/drivers/rgw.py b/libcloud/storage/drivers/rgw.py new file mode 100644 index 0000000000..ba8caede16 --- /dev/null +++ b/libcloud/storage/drivers/rgw.py @@ -0,0 +1,168 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.common.aws import DEFAULT_SIGNATURE_VERSION, SignedAWSConnection +from libcloud.common.types import LibcloudError +from libcloud.storage.drivers.s3 import ( + API_VERSION, + S3Connection, + BaseS3Connection, + BaseS3StorageDriver, +) + +__all__ = ["S3RGWStorageDriver", "S3RGWOutscaleStorageDriver"] + +S3_RGW_DEFAULT_REGION = "default" + +S3_RGW_OUTSCALE_HOSTS_BY_REGION = { + "eu-west-1": "osu.eu-west-1.outscale.com", + "eu-west-2": "osu.eu-west-2.outscale.com", + "us-west-1": "osu.us-west-1.outscale.com", + "us-east-2": "osu.us-east-2.outscale.com", + "cn-southeast-1": "osu.cn-southeast-1.outscale.hk", +} + +S3_RGW_OUTSCALE_DEFAULT_REGION = "eu-west-2" + + +class S3RGWConnectionAWS4(SignedAWSConnection, BaseS3Connection): + service_name = "s3" + version = API_VERSION + + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + token=None, + retry_delay=None, + backoff=None, + **kwargs, + ): + super().__init__( + user_id, + key, + secure, + host, + port, + url, + timeout, + proxy_url, + token, + retry_delay, + backoff, + 4, + ) # force aws4 + + +class S3RGWConnectionAWS2(S3Connection): + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + token=None, + retry_delay=None, + backoff=None, + **kwargs, + ): + super().__init__( + user_id, + key, + secure, + host, + port, + url, + timeout, + proxy_url, + token, + retry_delay, + backoff, + ) + + +class S3RGWStorageDriver(BaseS3StorageDriver): + name = "Ceph RGW" + website = "http://ceph.com/" + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=S3_RGW_DEFAULT_REGION, + **kwargs, + ): + if host is None: + raise LibcloudError("host required", driver=self) + + self.name = kwargs.pop("name", None) + if self.name is None: + self.name = "Ceph RGW S3 (%s)" % (region) + + self.ex_location_name = region + self.region_name = region + self.signature_version = str(kwargs.pop("signature_version", DEFAULT_SIGNATURE_VERSION)) + + if self.signature_version not in ["2", "4"]: + raise ValueError("Invalid signature_version: %s" % (self.signature_version)) + + if self.signature_version == "2": + self.connectionCls = S3RGWConnectionAWS2 + elif self.signature_version == "4": + self.connectionCls = S3RGWConnectionAWS4 + self.connectionCls.host = host + + super().__init__(key, secret, secure, host, port, api_version, region, **kwargs) + + def _ex_connection_class_kwargs(self): + kwargs = {} + kwargs["signature_version"] = self.signature_version + return kwargs + + +class S3RGWOutscaleStorageDriver(S3RGWStorageDriver): + name = "RGW Outscale" + website = "https://en.outscale.com/" + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + api_version=None, + region=S3_RGW_OUTSCALE_DEFAULT_REGION, + **kwargs, + ): + if region not in S3_RGW_OUTSCALE_HOSTS_BY_REGION: + raise LibcloudError("Unknown region (%s)" % (region), driver=self) + host = S3_RGW_OUTSCALE_HOSTS_BY_REGION[region] + kwargs["name"] = "OUTSCALE Ceph RGW S3 (%s)" % region + super().__init__(key, secret, secure, host, port, api_version, region, **kwargs) diff --git a/libcloud/storage/drivers/s3.py b/libcloud/storage/drivers/s3.py index eca2910609..42934a2c89 100644 --- a/libcloud/storage/drivers/s3.py +++ b/libcloud/storage/drivers/s3.py @@ -13,51 +13,107 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os +import hmac import time -import copy import base64 -import hmac -import sys - +from typing import Dict, Literal, Optional from hashlib import sha1 +from datetime import datetime, timezone + +import libcloud.utils.py3 +from libcloud.utils.py3 import b, httplib, tostring, urlquote, urlencode +from libcloud.utils.xml import findtext, fixxpath +from libcloud.common.aws import ( + AWSDriver, + AWSBaseResponse, + AWSTokenConnection, + SignedAWSConnection, + UnsignedPayloadSentinel, +) +from libcloud.common.base import RawResponse, ConnectionUserAndKey +from libcloud.utils.files import read_in_chunks +from libcloud.common.types import LibcloudError, InvalidCredsError +from libcloud.storage.base import Object, Container, StorageDriver +from libcloud.storage.types import ( + ContainerError, + ObjectDoesNotExistError, + ObjectHashMismatchError, + ContainerIsNotEmptyError, + InvalidContainerNameError, + ContainerDoesNotExistError, + ContainerAlreadyExistsError, +) try: - from lxml.etree import Element, SubElement + if libcloud.utils.py3.DEFAULT_LXML: + from lxml.etree import Element, SubElement + else: + from xml.etree.ElementTree import Element, SubElement except ImportError: from xml.etree.ElementTree import Element, SubElement -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlquote -from libcloud.utils.py3 import urlencode -from libcloud.utils.py3 import b -from libcloud.utils.py3 import tostring - -from libcloud.utils.xml import fixxpath, findtext -from libcloud.utils.files import read_in_chunks -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.common.base import ConnectionUserAndKey, RawResponse -from libcloud.common.aws import AWSBaseResponse, AWSDriver, AWSTokenConnection - -from libcloud.storage.base import Object, Container, StorageDriver -from libcloud.storage.types import ContainerIsNotEmptyError -from libcloud.storage.types import InvalidContainerNameError -from libcloud.storage.types import ContainerDoesNotExistError -from libcloud.storage.types import ObjectDoesNotExistError -from libcloud.storage.types import ObjectHashMismatchError - # How long before the token expires EXPIRATION_SECONDS = 15 * 60 -S3_US_STANDARD_HOST = 's3.amazonaws.com' -S3_US_WEST_HOST = 's3-us-west-1.amazonaws.com' -S3_US_WEST_OREGON_HOST = 's3-us-west-2.amazonaws.com' -S3_EU_WEST_HOST = 's3-eu-west-1.amazonaws.com' -S3_AP_SOUTHEAST_HOST = 's3-ap-southeast-1.amazonaws.com' -S3_AP_NORTHEAST_HOST = 's3-ap-northeast-1.amazonaws.com' - -API_VERSION = '2006-03-01' -NAMESPACE = 'http://s3.amazonaws.com/doc/%s/' % (API_VERSION) +S3_US_STANDARD_HOST = "s3.amazonaws.com" +S3_US_EAST2_HOST = "s3-us-east-2.amazonaws.com" +S3_US_WEST_HOST = "s3-us-west-1.amazonaws.com" +S3_US_WEST_OREGON_HOST = "s3-us-west-2.amazonaws.com" +S3_US_GOV_EAST_HOST = "s3-us-gov-east-1.amazonaws.com" +S3_US_GOV_WEST_HOST = "s3-us-gov-west-1.amazonaws.com" +S3_CN_NORTH_HOST = "s3.cn-north-1.amazonaws.com.cn" +S3_CN_NORTHWEST_HOST = "s3.cn-northwest-1.amazonaws.com.cn" +S3_EU_WEST_HOST = "s3-eu-west-1.amazonaws.com" +S3_EU_WEST2_HOST = "s3-eu-west-2.amazonaws.com" +S3_EU_WEST3_HOST = "s3-eu-west-3.amazonaws.com" +S3_EU_CENTRAL_HOST = "s3-eu-central-1.amazonaws.com" +S3_EU_NORTH1_HOST = "s3-eu-north-1.amazonaws.com" +S3_EU_SOUTH1_HOST = "s3-eu-south-1.amazonaws.com" +S3_AP_SOUTH_HOST = "s3-ap-south-1.amazonaws.com" +S3_AP_SOUTHEAST_HOST = "s3-ap-southeast-1.amazonaws.com" +S3_AP_SOUTHEAST2_HOST = "s3-ap-southeast-2.amazonaws.com" +S3_AP_NORTHEAST1_HOST = "s3-ap-northeast-1.amazonaws.com" +S3_AP_NORTHEAST2_HOST = "s3-ap-northeast-2.amazonaws.com" +S3_AP_NORTHEAST_HOST = S3_AP_NORTHEAST1_HOST +S3_SA_EAST_HOST = "s3-sa-east-1.amazonaws.com" +S3_SA_SOUTHEAST2_HOST = "s3-sa-east-2.amazonaws.com" +S3_CA_CENTRAL_HOST = "s3-ca-central-1.amazonaws.com" +S3_AF_SOUTH1_HOST = "s3.af-south-1.amazonaws.com" + +# Maps AWS region name to connection hostname +REGION_TO_HOST_MAP = { + "us-east-1": S3_US_STANDARD_HOST, + "us-east-2": S3_US_EAST2_HOST, + "us-west-1": S3_US_WEST_HOST, + "us-west-2": S3_US_WEST_OREGON_HOST, + "us-gov-east-1": S3_US_GOV_EAST_HOST, + "us-gov-west-1": S3_US_GOV_WEST_HOST, + "cn-north-1": S3_CN_NORTH_HOST, + "cn-northwest-1": S3_CN_NORTHWEST_HOST, + "eu-west-1": S3_EU_WEST_HOST, + "eu-west-2": S3_EU_WEST2_HOST, + "eu-west-3": S3_EU_WEST3_HOST, + "eu-north-1": "s3.eu-north-1.amazonaws.com", + "eu-south-1": "s3.eu-south-1.amazonaws.com", + "eu-central-1": S3_EU_CENTRAL_HOST, + "ap-south-1": S3_AP_SOUTH_HOST, + "ap-southeast-1": S3_AP_SOUTHEAST_HOST, + "ap-southeast-2": S3_AP_SOUTHEAST2_HOST, + "ap-northeast-1": S3_AP_NORTHEAST1_HOST, + "ap-northeast-2": S3_AP_NORTHEAST2_HOST, + "ap-northeast-3": "s3.ap-northeast-3.amazonaws.com", + "sa-east-1": S3_SA_EAST_HOST, + "sa-east-2": S3_SA_SOUTHEAST2_HOST, + "ca-central-1": S3_CA_CENTRAL_HOST, + "me-south-1": "s3.me-south-1.amazonaws.com", + "af-south-1": S3_AF_SOUTH1_HOST, + "me-central-1": "s3.me-central-1.amazonaws.com", +} + +API_VERSION = "2006-03-01" +NAMESPACE = "http://s3.amazonaws.com/doc/%s/" % (API_VERSION) # AWS multi-part chunks must be minimum 5MB CHUNK_SIZE = 5 * 1024 * 1024 @@ -66,25 +122,39 @@ # ex_iterate_multipart_uploads. RESPONSES_PER_REQUEST = 100 +S3_CDN_URL_DATETIME_FORMAT = "%Y%m%dT%H%M%SZ" +S3_CDN_URL_DATE_FORMAT = "%Y%m%d" +S3_CDN_URL_EXPIRY_HOURS = float(os.getenv("LIBCLOUD_S3_CDN_URL_EXPIRY_HOURS", "24")) + class S3Response(AWSBaseResponse): namespace = None - valid_response_codes = [httplib.NOT_FOUND, httplib.CONFLICT, - httplib.BAD_REQUEST] + valid_response_codes = [ + httplib.NOT_FOUND, + httplib.CONFLICT, + httplib.BAD_REQUEST, + httplib.PARTIAL_CONTENT, + ] def success(self): i = int(self.status) - return i >= 200 and i <= 299 or i in self.valid_response_codes + return 200 <= i <= 299 or i in self.valid_response_codes def parse_error(self): if self.status in [httplib.UNAUTHORIZED, httplib.FORBIDDEN]: raise InvalidCredsError(self.body) elif self.status == httplib.MOVED_PERMANENTLY: - raise LibcloudError('This bucket is located in a different ' + - 'region. Please use the correct driver.', - driver=S3StorageDriver) - raise LibcloudError('Unknown error. Status code: %d' % (self.status), - driver=S3StorageDriver) + bucket_region = self.headers.get("x-amz-bucket-region", None) + used_region = self.connection.driver.region + raise LibcloudError( + "This bucket is located in a different " + "region. Please use the correct driver. " + 'Bucket region "%s", used region "%s".' % (bucket_region, used_region), + driver=S3StorageDriver, + ) + raise LibcloudError( + "Unknown error. Status code: %d" % (self.status), driver=S3StorageDriver + ) class S3RawResponse(S3Response, RawResponse): @@ -96,24 +166,12 @@ class BaseS3Connection(ConnectionUserAndKey): Represents a single connection to the S3 Endpoint """ - host = 's3.amazonaws.com' + host = "s3.amazonaws.com" responseCls = S3Response rawResponseCls = S3RawResponse - def add_default_params(self, params): - expires = str(int(time.time()) + EXPIRATION_SECONDS) - params['AWSAccessKeyId'] = self.user_id - params['Expires'] = expires - return params - - def pre_connect_hook(self, params, headers): - params['Signature'] = self._get_aws_auth_param( - method=self.method, headers=headers, params=params, - expires=params['Expires'], secret_key=self.key, path=self.action) - return params, headers - - def _get_aws_auth_param(self, method, headers, params, expires, - secret_key, path='/'): + @staticmethod + def get_auth_signature(method, headers, params, expires, secret_key, path, vendor_prefix): """ Signature = URL-Encode( Base64( HMAC-SHA1( YourSecretAccessKeyID, UTF-8-Encoding-Of( StringToSign ) ) ) ); @@ -122,58 +180,61 @@ def _get_aws_auth_param(self, method, headers, params, expires, Content-MD5 + "\n" + Content-Type + "\n" + Expires + "\n" + - CanonicalizedAmzHeaders + + CanonicalizedVendorHeaders + CanonicalizedResource; """ - special_header_keys = ['content-md5', 'content-type', 'date'] - special_header_values = {'date': ''} - amz_header_values = {} + special_headers = {"content-md5": "", "content-type": "", "date": ""} + vendor_headers = {} - headers_copy = copy.deepcopy(headers) - for key, value in list(headers_copy.items()): + for key, value in list(headers.items()): key_lower = key.lower() - if key_lower in special_header_keys: - special_header_values[key_lower] = value.strip() - elif key_lower.startswith('x-amz-'): - amz_header_values[key.lower()] = value.strip() - - if 'content-md5' not in special_header_values: - special_header_values['content-md5'] = '' - - if 'content-type' not in special_header_values: - special_header_values['content-type'] = '' + if key_lower in special_headers: + special_headers[key_lower] = value.strip() + elif key_lower.startswith(vendor_prefix): + vendor_headers[key_lower] = value.strip() if expires: - special_header_values['date'] = str(expires) - - keys_sorted = list(special_header_values.keys()) - keys_sorted.sort() + special_headers["date"] = str(expires) buf = [method] - for key in keys_sorted: - value = special_header_values[key] + for _, value in sorted(special_headers.items()): buf.append(value) - string_to_sign = '\n'.join(buf) + string_to_sign = "\n".join(buf) - keys_sorted = list(amz_header_values.keys()) - keys_sorted.sort() - - amz_header_string = [] - for key in keys_sorted: - value = amz_header_values[key] - amz_header_string.append('%s:%s' % (key, value)) - amz_header_string = '\n'.join(amz_header_string) + buf = [] + for key, value in sorted(vendor_headers.items()): + buf.append("{}:{}".format(key, value)) + header_string = "\n".join(buf) values_to_sign = [] - for value in [string_to_sign, amz_header_string, path]: + for value in [string_to_sign, header_string, path]: if value: values_to_sign.append(value) - string_to_sign = '\n'.join(values_to_sign) + string_to_sign = "\n".join(values_to_sign) b64_hmac = base64.b64encode( hmac.new(b(secret_key), b(string_to_sign), digestmod=sha1).digest() ) - return b64_hmac.decode('utf-8') + return b64_hmac.decode("utf-8") + + def add_default_params(self, params): + expires = str(int(time.time()) + EXPIRATION_SECONDS) + params["AWSAccessKeyId"] = self.user_id + params["Expires"] = expires + return params + + def pre_connect_hook(self, params, headers): + # pylint: disable=no-member + params["Signature"] = self.get_auth_signature( + method=self.method, + headers=headers, + params=params, + expires=params["Expires"], + secret_key=self.key, + path=self.action, + vendor_prefix=self.driver.http_vendor_prefix, + ) + return params, headers class S3Connection(AWSTokenConnection, BaseS3Connection): @@ -181,10 +242,51 @@ class S3Connection(AWSTokenConnection, BaseS3Connection): Represents a single connection to the S3 endpoint, with AWS-specific features. """ + pass -class S3MultipartUpload(object): +class S3SignatureV4Connection(SignedAWSConnection, BaseS3Connection): + service_name = "s3" + version = API_VERSION + + def morph_action_hook(self, action: str) -> str: + """Preserve object key slashes when enabled for this S3 driver.""" + if getattr(self.driver, "ex_allow_path_double_slashes", False): + return self.request_path + action + return super().morph_action_hook(action) + + def __init__( + self, + user_id, + key, + secure=True, + host=None, + port=None, + url=None, + timeout=None, + proxy_url=None, + token=None, + retry_delay=None, + backoff=None, + ): + super().__init__( + user_id, + key, + secure, + host, + port, + url, + timeout, + proxy_url, + token, + retry_delay, + backoff, + 4, + ) # force version 4 + + +class S3MultipartUpload: """ Class representing an amazon s3 multipart upload """ @@ -215,62 +317,50 @@ def __init__(self, key, id, created_at, initiator, owner): self.owner = owner def __repr__(self): - return ('' % (self.key)) + return "" % (self.key) class BaseS3StorageDriver(StorageDriver): - name = 'Amazon S3 (standard)' - website = 'http://aws.amazon.com/s3/' + name = "Amazon S3 (standard)" + website = "http://aws.amazon.com/s3/" connectionCls = BaseS3Connection - hash_type = 'md5' + hash_type = "md5" supports_chunked_encoding = False supports_s3_multipart_upload = True - ex_location_name = '' + ex_location_name = "" namespace = NAMESPACE - http_vendor_prefix = 'x-amz' + http_vendor_prefix = "x-amz" def iterate_containers(self): - response = self.connection.request('/') + response = self.connection.request("/") if response.status == httplib.OK: - containers = self._to_containers(obj=response.object, - xpath='Buckets/Bucket') + containers = self._to_containers(obj=response.object, xpath="Buckets/Bucket") return containers - raise LibcloudError('Unexpected status code: %s' % (response.status), - driver=self) - - def list_container_objects(self, container, ex_prefix=None): - """ - Return a list of objects for the given container. - - :param container: Container instance. - :type container: :class:`Container` - - :param ex_prefix: Only return objects starting with ex_prefix - :type ex_prefix: ``str`` - - :return: A list of Object instances. - :rtype: ``list`` of :class:`Object` - """ - return list(self.iterate_container_objects(container, - ex_prefix=ex_prefix)) + raise LibcloudError("Unexpected status code: %s" % (response.status), driver=self) - def iterate_container_objects(self, container, ex_prefix=None): + def iterate_container_objects(self, container, prefix=None, ex_prefix=None): """ Return a generator of objects for the given container. :param container: Container instance :type container: :class:`Container` + :param prefix: Only return objects starting with prefix + :type prefix: ``str`` + :param ex_prefix: Only return objects starting with ex_prefix :type ex_prefix: ``str`` :return: A generator of Object instances. :rtype: ``generator`` of :class:`Object` """ + prefix = self._normalize_prefix_argument(prefix, ex_prefix) + params = {} - if ex_prefix: - params['prefix'] = ex_prefix + + if prefix: + params["prefix"] = prefix last_key = None exhausted = False @@ -278,20 +368,18 @@ def iterate_container_objects(self, container, ex_prefix=None): while not exhausted: if last_key: - params['marker'] = last_key + params["marker"] = last_key - response = self.connection.request(container_path, - params=params) + response = self.connection.request(container_path, params=params) if response.status != httplib.OK: - raise LibcloudError('Unexpected status code: %s' % - (response.status), driver=self) + raise LibcloudError("Unexpected status code: %s" % (response.status), driver=self) - objects = self._to_objs(obj=response.object, - xpath='Contents', container=container) - is_truncated = response.object.findtext(fixxpath( - xpath='IsTruncated', namespace=self.namespace)).lower() - exhausted = (is_truncated == 'false') + objects = self._to_objs(obj=response.object, xpath="Contents", container=container) + is_truncated = response.object.findtext( + fixxpath(xpath="IsTruncated", namespace=self.namespace) + ).lower() + exhausted = is_truncated == "false" last_key = None for obj in objects: @@ -300,11 +388,11 @@ def iterate_container_objects(self, container, ex_prefix=None): def get_container(self, container_name): try: - response = self.connection.request('/%s' % container_name, - method='HEAD') + response = self.connection.request("/%s" % container_name, method="HEAD") if response.status == httplib.NOT_FOUND: - raise ContainerDoesNotExistError(value=None, driver=self, - container_name=container_name) + raise ContainerDoesNotExistError( + value=None, driver=self, container_name=container_name + ) except InvalidCredsError: # This just means the user doesn't have IAM permissions to do a # HEAD request but other requests might work. @@ -314,16 +402,15 @@ def get_container(self, container_name): def get_object(self, container_name, object_name): container = self.get_container(container_name=container_name) object_path = self._get_object_path(container, object_name) - response = self.connection.request(object_path, method='HEAD') + response = self.connection.request(object_path, method="HEAD") if response.status == httplib.OK: - obj = self._headers_to_object(object_name=object_name, - container=container, - headers=response.headers) + obj = self._headers_to_object( + object_name=object_name, container=container, headers=response.headers + ) return obj - raise ObjectDoesNotExistError(value=None, driver=self, - object_name=object_name) + raise ObjectDoesNotExistError(value=None, driver=self, object_name=object_name) def _get_container_path(self, container): """ @@ -335,7 +422,7 @@ def _get_container_path(self, container): :return: A path for this container. :rtype: ``str`` """ - return '/%s' % (container.name) + return "/%s" % (container.name) def _get_object_path(self, container, object_name): """ @@ -352,179 +439,232 @@ def _get_object_path(self, container, object_name): """ container_url = self._get_container_path(container) object_name_cleaned = self._clean_object_name(object_name) - object_path = '%s/%s' % (container_url, object_name_cleaned) + object_path = "{}/{}".format(container_url, object_name_cleaned) return object_path def create_container(self, container_name): if self.ex_location_name: - root = Element('CreateBucketConfiguration') - child = SubElement(root, 'LocationConstraint') + root = Element("CreateBucketConfiguration") + child = SubElement(root, "LocationConstraint") child.text = self.ex_location_name data = tostring(root) else: - data = '' + data = "" - response = self.connection.request('/%s' % (container_name), - data=data, - method='PUT') + response = self.connection.request("/%s" % (container_name), data=data, method="PUT") if response.status == httplib.OK: container = Container(name=container_name, extra=None, driver=self) return container elif response.status == httplib.CONFLICT: + if "BucketAlreadyOwnedByYou" in response.body: + raise ContainerAlreadyExistsError( + value="Container with this name already exists. The name " + "be unique among all the containers in the system.", + container_name=container_name, + driver=self, + ) + raise InvalidContainerNameError( - value='Container with this name already exists. The name must ' - 'be unique among all the containers in the system', - container_name=container_name, driver=self) + value="Container with this name already exists. The name must " + "be unique among all the containers in the system.", + container_name=container_name, + driver=self, + ) elif response.status == httplib.BAD_REQUEST: - raise InvalidContainerNameError(value='Container name contains ' + - 'invalid characters.', - container_name=container_name, - driver=self) + raise ContainerError( + value="Bad request when creating container: %s" % response.body, + container_name=container_name, + driver=self, + ) - raise LibcloudError('Unexpected status code: %s' % (response.status), - driver=self) + raise LibcloudError("Unexpected status code: %s" % (response.status), driver=self) def delete_container(self, container): # Note: All the objects in the container must be deleted first - response = self.connection.request('/%s' % (container.name), - method='DELETE') + response = self.connection.request("/%s" % (container.name), method="DELETE") if response.status == httplib.NO_CONTENT: return True elif response.status == httplib.CONFLICT: raise ContainerIsNotEmptyError( - value='Container must be empty before it can be deleted.', - container_name=container.name, driver=self) + value="Container must be empty before it can be deleted.", + container_name=container.name, + driver=self, + ) elif response.status == httplib.NOT_FOUND: - raise ContainerDoesNotExistError(value=None, - driver=self, - container_name=container.name) + raise ContainerDoesNotExistError(value=None, driver=self, container_name=container.name) return False - def download_object(self, obj, destination_path, overwrite_existing=False, - delete_on_failure=True): + def download_object( + self, obj, destination_path, overwrite_existing=False, delete_on_failure=True + ): obj_path = self._get_object_path(obj.container, obj.name) - response = self.connection.request(obj_path, method='GET', raw=True) - - return self._get_object(obj=obj, callback=self._save_object, - response=response, - callback_kwargs={ - 'obj': obj, - 'response': response.response, - 'destination_path': destination_path, - 'overwrite_existing': overwrite_existing, - 'delete_on_failure': delete_on_failure}, - success_status_code=httplib.OK) + response = self.connection.request(obj_path, method="GET", raw=True) + + return self._get_object( + obj=obj, + callback=self._save_object, + response=response, + callback_kwargs={ + "obj": obj, + "response": response.response, + "destination_path": destination_path, + "overwrite_existing": overwrite_existing, + "delete_on_failure": delete_on_failure, + }, + success_status_code=httplib.OK, + ) def download_object_as_stream(self, obj, chunk_size=None): obj_path = self._get_object_path(obj.container, obj.name) - response = self.connection.request(obj_path, method='GET', raw=True) + response = self.connection.request(obj_path, method="GET", stream=True, raw=True) + + return self._get_object( + obj=obj, + callback=read_in_chunks, + response=response, + callback_kwargs={ + "iterator": response.iter_content(chunk_size or CHUNK_SIZE), + "chunk_size": chunk_size, + }, + success_status_code=httplib.OK, + ) + + def download_object_range( + self, + obj, + destination_path, + start_bytes, + end_bytes=None, + overwrite_existing=False, + delete_on_failure=True, + ): + self._validate_start_and_end_bytes(start_bytes=start_bytes, end_bytes=end_bytes) - return self._get_object(obj=obj, callback=read_in_chunks, - response=response, - callback_kwargs={'iterator': response.response, - 'chunk_size': chunk_size}, - success_status_code=httplib.OK) + obj_path = self._get_object_path(obj.container, obj.name) - def upload_object(self, file_path, container, object_name, extra=None, - verify_hash=True, ex_storage_class=None): + headers = {"Range": self._get_standard_range_str(start_bytes, end_bytes)} + response = self.connection.request(obj_path, method="GET", headers=headers, raw=True) + + return self._get_object( + obj=obj, + callback=self._save_object, + response=response, + callback_kwargs={ + "obj": obj, + "response": response.response, + "destination_path": destination_path, + "overwrite_existing": overwrite_existing, + "delete_on_failure": delete_on_failure, + "partial_download": True, + }, + success_status_code=httplib.PARTIAL_CONTENT, + ) + + def download_object_range_as_stream(self, obj, start_bytes, end_bytes=None, chunk_size=None): + self._validate_start_and_end_bytes(start_bytes=start_bytes, end_bytes=end_bytes) + + obj_path = self._get_object_path(obj.container, obj.name) + + headers = {"Range": self._get_standard_range_str(start_bytes, end_bytes)} + response = self.connection.request( + obj_path, method="GET", headers=headers, stream=True, raw=True + ) + + return self._get_object( + obj=obj, + callback=read_in_chunks, + response=response, + callback_kwargs={ + "iterator": response.iter_content(chunk_size or CHUNK_SIZE), + "chunk_size": chunk_size, + }, + success_status_code=httplib.PARTIAL_CONTENT, + ) + + def upload_object( + self, + file_path, + container, + object_name, + extra=None, + verify_hash=True, + headers=None, + ex_storage_class=None, + ): """ @inherits: :class:`StorageDriver.upload_object` :param ex_storage_class: Storage class :type ex_storage_class: ``str`` """ - upload_func = self._upload_file - upload_func_kwargs = {'file_path': file_path} - - return self._put_object(container=container, object_name=object_name, - upload_func=upload_func, - upload_func_kwargs=upload_func_kwargs, - extra=extra, file_path=file_path, - verify_hash=verify_hash, - storage_class=ex_storage_class) + return self._put_object( + container=container, + object_name=object_name, + extra=extra, + file_path=file_path, + verify_hash=verify_hash, + headers=headers, + storage_class=ex_storage_class, + ) - def _upload_multipart(self, response, data, iterator, container, - object_name, calculate_hash=True): + def _initiate_multipart(self, container, object_name, headers=None): """ - Callback invoked for uploading data to S3 using Amazon's - multipart upload mechanism - - :param response: Response object from the initial POST request - :type response: :class:`S3RawResponse` + Initiates a multipart upload to S3 - :param data: Any data from the initial POST request - :type data: ``str`` - - :param iterator: The generator for fetching the upload data - :type iterator: ``generator`` - - :param container: The container owning the object to which data is - being uploaded + :param container: The destination container :type container: :class:`Container` - :param object_name: The name of the object to which we are uploading + :param object_name: The name of the object which we are uploading :type object_name: ``str`` - :keyword calculate_hash: Indicates if we must calculate the data hash - :type calculate_hash: ``bool`` + :keyword headers: Additional headers to send with the request + :type headers: ``dict`` - :return: A tuple of (status, checksum, bytes transferred) - :rtype: ``tuple`` + :return: The id of the newly created multipart upload + :rtype: ``str`` """ + headers = headers or {} - object_path = self._get_object_path(container, object_name) - - # Get the upload id from the response xml - response.body = response.response.read() - body = response.parse_body() - upload_id = body.find(fixxpath(xpath='UploadId', - namespace=self.namespace)).text - - try: - # Upload the data through the iterator - result = self._upload_from_iterator(iterator, object_path, - upload_id, calculate_hash) - (chunks, data_hash, bytes_transferred) = result + request_path = self._get_object_path(container, object_name) + params = {"uploads": ""} - # Commit the chunk info and complete the upload - etag = self._commit_multipart(object_path, upload_id, chunks) - except Exception: - exc = sys.exc_info()[1] - # Amazon provides a mechanism for aborting an upload. - self._abort_multipart(object_path, upload_id) - raise exc + response = self.connection.request( + request_path, method="POST", headers=headers, params=params + ) - # Modify the response header of the first request. This is used - # by other functions once the callback is done - response.headers['etag'] = etag + if response.status != httplib.OK: + raise LibcloudError("Error initiating multipart upload", driver=self) - return (True, data_hash, bytes_transferred) + return findtext(element=response.object, xpath="UploadId", namespace=self.namespace) - def _upload_from_iterator(self, iterator, object_path, upload_id, - calculate_hash=True): + def _upload_multipart_chunks( + self, container, object_name, upload_id, stream, calculate_hash=True + ): """ - Uploads data from an interator in fixed sized chunks to S3 + Uploads data from an iterator in fixed sized chunks to S3 - :param iterator: The generator for fetching the upload data - :type iterator: ``generator`` + :param container: The destination container + :type container: :class:`Container` - :param object_path: The path of the object to which we are uploading + :param object_name: The name of the object which we are uploading :type object_name: ``str`` :param upload_id: The upload id allocated for this multipart upload :type upload_id: ``str`` + :param stream: The generator for fetching the upload data + :type stream: ``generator`` + :keyword calculate_hash: Indicates if we must calculate the data hash :type calculate_hash: ``bool`` :return: A tuple of (chunk info, checksum, bytes transferred) :rtype: ``tuple`` """ - data_hash = None if calculate_hash: data_hash = self._get_hash_function() @@ -532,11 +672,12 @@ def _upload_from_iterator(self, iterator, object_path, upload_id, bytes_transferred = 0 count = 1 chunks = [] - params = {'uploadId': upload_id} + params = {"uploadId": upload_id} + + request_path = self._get_object_path(container, object_name) # Read the input data in chunk sizes suitable for AWS - for data in read_in_chunks(iterator, chunk_size=CHUNK_SIZE, - fill_size=True, yield_empty=True): + for data in read_in_chunks(stream, chunk_size=CHUNK_SIZE, fill_size=True, yield_empty=True): bytes_transferred += len(data) if calculate_hash: @@ -544,22 +685,25 @@ def _upload_from_iterator(self, iterator, object_path, upload_id, chunk_hash = self._get_hash_function() chunk_hash.update(data) - chunk_hash = base64.b64encode(chunk_hash.digest()).decode('utf-8') + chunk_hash = base64.b64encode(chunk_hash.digest()).decode("utf-8") - # This provides an extra level of data check and is recommended - # by amazon - headers = {'Content-MD5': chunk_hash} - params['partNumber'] = count + # The Content-MD5 header provides an extra level of data check and + # is recommended by amazon + headers = { + "Content-Length": len(data), + "Content-MD5": chunk_hash, + } - request_path = '?'.join((object_path, urlencode(params))) + params["partNumber"] = count - resp = self.connection.request(request_path, method='PUT', - data=data, headers=headers) + resp = self.connection.request( + request_path, method="PUT", data=data, headers=headers, params=params + ) if resp.status != httplib.OK: - raise LibcloudError('Error uploading chunk', driver=self) + raise LibcloudError("Error uploading chunk", driver=self) - server_hash = resp.headers['etag'] + server_hash = resp.headers["etag"].replace('"', "") # Keep this data for a later commit chunks.append((count, server_hash)) @@ -570,71 +714,89 @@ def _upload_from_iterator(self, iterator, object_path, upload_id, return (chunks, data_hash, bytes_transferred) - def _commit_multipart(self, object_path, upload_id, chunks): + def _commit_multipart(self, container, object_name, upload_id, chunks): """ Makes a final commit of the data. - :param object_path: Server side object path. - :type object_path: ``str`` + :param container: The destination container + :type container: :class:`Container` - :param upload_id: ID of the multipart upload. + :param object_name: The name of the object which we are uploading + :type object_name: ``str`` + + :param upload_id: The upload id allocated for this multipart upload :type upload_id: ``str`` - :param upload_id: A list of (chunk_number, chunk_hash) tuples. - :type upload_id: ``list`` - """ + :param chunks: A list of (chunk_number, chunk_hash) tuples. + :type chunks: ``list`` - root = Element('CompleteMultipartUpload') + :return: The server side hash of the uploaded data + :rtype: ``str`` + """ + root = Element("CompleteMultipartUpload") - for (count, etag) in chunks: - part = SubElement(root, 'Part') - part_no = SubElement(part, 'PartNumber') + for count, etag in chunks: + part = SubElement(root, "Part") + part_no = SubElement(part, "PartNumber") part_no.text = str(count) - etag_id = SubElement(part, 'ETag') + etag_id = SubElement(part, "ETag") etag_id.text = str(etag) data = tostring(root) - params = {'uploadId': upload_id} - request_path = '?'.join((object_path, urlencode(params))) - response = self.connection.request(request_path, data=data, - method='POST') + headers = {"Content-Length": len(data)} + params = {"uploadId": upload_id} + request_path = self._get_object_path(container, object_name) + response = self.connection.request( + request_path, headers=headers, params=params, data=data, method="POST" + ) if response.status != httplib.OK: element = response.object # pylint: disable=maybe-no-member code, message = response._parse_error_details(element=element) - msg = 'Error in multipart commit: %s (%s)' % (message, code) + msg = "Error in multipart commit: {} ({})".format(message, code) raise LibcloudError(msg, driver=self) # Get the server's etag to be passed back to the caller body = response.parse_body() - server_hash = body.find(fixxpath(xpath='ETag', - namespace=self.namespace)).text + server_hash = body.find(fixxpath(xpath="ETag", namespace=self.namespace)).text return server_hash - def _abort_multipart(self, object_path, upload_id): + def _abort_multipart(self, container, object_name, upload_id): """ Aborts an already initiated multipart upload - :param object_path: Server side object path. - :type object_path: ``str`` + :param container: The destination container + :type container: :class:`Container` + + :param object_name: The name of the object which we are uploading + :type object_name: ``str`` - :param upload_id: ID of the multipart upload. + :param upload_id: The upload id allocated for this multipart upload :type upload_id: ``str`` """ - params = {'uploadId': upload_id} - request_path = '?'.join((object_path, urlencode(params))) - resp = self.connection.request(request_path, method='DELETE') + params = {"uploadId": upload_id} + request_path = self._get_object_path(container, object_name) - if resp.status != httplib.NO_CONTENT: - raise LibcloudError('Error in multipart abort. status_code=%d' % - (resp.status), driver=self) + resp = self.connection.request(request_path, method="DELETE", params=params) - def upload_object_via_stream(self, iterator, container, object_name, - extra=None, ex_storage_class=None): + if resp.status != httplib.NO_CONTENT: + raise LibcloudError( + "Error in multipart abort. status_code=%d" % (resp.status), driver=self + ) + + def upload_object_via_stream( + self, + iterator, + container, + object_name, + extra=None, + headers=None, + ex_storage_class=None, + ): """ @inherits: :class:`StorageDriver.upload_object_via_stream` @@ -642,51 +804,45 @@ def upload_object_via_stream(self, iterator, container, object_name, :type ex_storage_class: ``str`` """ - method = 'PUT' + method = "PUT" params = None # This driver is used by other S3 API compatible drivers also. # Amazon provides a different (complex?) mechanism to do multipart # uploads if self.supports_s3_multipart_upload: - # Initiate the multipart request and get an upload id - upload_func = self._upload_multipart - upload_func_kwargs = {'iterator': iterator, - 'container': container, - 'object_name': object_name} - method = 'POST' - iterator = iter('') - params = 'uploads' - - elif self.supports_chunked_encoding: - upload_func = self._stream_data - upload_func_kwargs = {'iterator': iterator} - else: - # In this case, we have to load the entire object to - # memory and send it as normal data - upload_func = self._upload_data - upload_func_kwargs = {} - - return self._put_object(container=container, object_name=object_name, - upload_func=upload_func, - upload_func_kwargs=upload_func_kwargs, - extra=extra, method=method, query_args=params, - iterator=iterator, verify_hash=False, - storage_class=ex_storage_class) + return self._put_object_multipart( + container=container, + object_name=object_name, + extra=extra, + stream=iterator, + verify_hash=False, + headers=headers, + storage_class=ex_storage_class, + ) + return self._put_object( + container=container, + object_name=object_name, + extra=extra, + method=method, + query_args=params, + stream=iterator, + verify_hash=False, + headers=headers, + storage_class=ex_storage_class, + ) def delete_object(self, obj): object_path = self._get_object_path(obj.container, obj.name) - response = self.connection.request(object_path, method='DELETE') + response = self.connection.request(object_path, method="DELETE") if response.status == httplib.NO_CONTENT: return True elif response.status == httplib.NOT_FOUND: - raise ObjectDoesNotExistError(value=None, driver=self, - object_name=obj.name) + raise ObjectDoesNotExistError(value=None, driver=self, object_name=obj.name) return False - def ex_iterate_multipart_uploads(self, container, prefix=None, - delimiter=None): + def ex_iterate_multipart_uploads(self, container, prefix=None, delimiter=None): """ Extension method for listing all in-progress S3 multipart uploads. @@ -708,65 +864,59 @@ def ex_iterate_multipart_uploads(self, container, prefix=None, """ if not self.supports_s3_multipart_upload: - raise LibcloudError('Feature not supported', driver=self) + raise LibcloudError("Feature not supported", driver=self) # Get the data for a specific container - request_path = '%s/?uploads' % (self._get_container_path(container)) - params = {'max-uploads': RESPONSES_PER_REQUEST} + request_path = self._get_container_path(container) + params = {"max-uploads": RESPONSES_PER_REQUEST, "uploads": ""} if prefix: - params['prefix'] = prefix + params["prefix"] = prefix if delimiter: - params['delimiter'] = delimiter + params["delimiter"] = delimiter def finder(node, text): - return node.findtext(fixxpath(xpath=text, - namespace=self.namespace)) + return node.findtext(fixxpath(xpath=text, namespace=self.namespace)) while True: response = self.connection.request(request_path, params=params) if response.status != httplib.OK: - raise LibcloudError('Error fetching multipart uploads. ' - 'Got code: %s' % response.status, - driver=self) + raise LibcloudError( + "Error fetching multipart uploads. " "Got code: %s" % response.status, + driver=self, + ) body = response.parse_body() # pylint: disable=maybe-no-member - for node in body.findall(fixxpath(xpath='Upload', - namespace=self.namespace)): - - initiator = node.find(fixxpath(xpath='Initiator', - namespace=self.namespace)) - owner = node.find(fixxpath(xpath='Owner', - namespace=self.namespace)) + for node in body.findall(fixxpath(xpath="Upload", namespace=self.namespace)): + initiator = node.find(fixxpath(xpath="Initiator", namespace=self.namespace)) + owner = node.find(fixxpath(xpath="Owner", namespace=self.namespace)) - key = finder(node, 'Key') - upload_id = finder(node, 'UploadId') - created_at = finder(node, 'Initiated') - initiator = finder(initiator, 'DisplayName') - owner = finder(owner, 'DisplayName') + key = finder(node, "Key") + upload_id = finder(node, "UploadId") + created_at = finder(node, "Initiated") + initiator = finder(initiator, "DisplayName") + owner = finder(owner, "DisplayName") - yield S3MultipartUpload(key, upload_id, created_at, - initiator, owner) + yield S3MultipartUpload(key, upload_id, created_at, initiator, owner) # Check if this is the last entry in the listing # pylint: disable=maybe-no-member - is_truncated = body.findtext(fixxpath(xpath='IsTruncated', - namespace=self.namespace)) + is_truncated = body.findtext(fixxpath(xpath="IsTruncated", namespace=self.namespace)) - if is_truncated.lower() == 'false': + if is_truncated.lower() == "false": break # Provide params for the next request - upload_marker = body.findtext(fixxpath(xpath='NextUploadIdMarker', - namespace=self.namespace)) - key_marker = body.findtext(fixxpath(xpath='NextKeyMarker', - namespace=self.namespace)) + upload_marker = body.findtext( + fixxpath(xpath="NextUploadIdMarker", namespace=self.namespace) + ) + key_marker = body.findtext(fixxpath(xpath="NextKeyMarker", namespace=self.namespace)) - params['key-marker'] = key_marker - params['upload-id-marker'] = upload_marker + params["key-marker"] = key_marker + params["upload-id-marker"] = upload_marker def ex_cleanup_all_multipart_uploads(self, container, prefix=None): """ @@ -781,201 +931,643 @@ def ex_cleanup_all_multipart_uploads(self, container, prefix=None): """ # Iterate through the container and delete the upload ids - for upload in self.ex_iterate_multipart_uploads(container, prefix, - delimiter=None): - object_path = '/%s/%s' % (container.name, upload.key) - self._abort_multipart(object_path, upload.id) + for upload in self.ex_iterate_multipart_uploads(container, prefix, delimiter=None): + self._abort_multipart(container, upload.key, upload.id) def _clean_object_name(self, name): - name = urlquote(name) + name = urlquote(name, safe="/~") return name - def _put_object(self, container, object_name, upload_func, - upload_func_kwargs, method='PUT', query_args=None, - extra=None, file_path=None, iterator=None, - verify_hash=True, storage_class=None): - headers = {} + def _put_object( + self, + container, + object_name, + method="PUT", + query_args=None, + extra=None, + file_path=None, + stream=None, + verify_hash=True, + storage_class=None, + headers=None, + ): + headers = headers or {} extra = extra or {} - storage_class = storage_class or 'standard' - if storage_class not in ['standard', 'reduced_redundancy']: - raise ValueError( - 'Invalid storage class value: %s' % (storage_class)) - key = self.http_vendor_prefix + '-storage-class' - headers[key] = storage_class.upper() + headers.update(self._to_storage_class_headers(storage_class)) - content_type = extra.get('content_type', None) - meta_data = extra.get('meta_data', None) - acl = extra.get('acl', None) + content_type = extra.get("content_type", None) + meta_data = extra.get("meta_data", None) + acl = extra.get("acl", None) if meta_data: for key, value in list(meta_data.items()): - key = self.http_vendor_prefix + '-meta-%s' % (key) + key = self.http_vendor_prefix + "-meta-%s" % (key) headers[key] = value if acl: - headers[self.http_vendor_prefix + '-acl'] = acl + headers[self.http_vendor_prefix + "-acl"] = acl request_path = self._get_object_path(container, object_name) if query_args: - request_path = '?'.join((request_path, query_args)) + request_path = "?".join((request_path, query_args)) - # TODO: Let the underlying exceptions bubble up and capture the SIGPIPE - # here. - # SIGPIPE is thrown if the provided container does not exist or the - # user does not have correct permission result_dict = self._upload_object( - object_name=object_name, content_type=content_type, - upload_func=upload_func, upload_func_kwargs=upload_func_kwargs, - request_path=request_path, request_method=method, - headers=headers, file_path=file_path, iterator=iterator) + object_name=object_name, + content_type=content_type, + request_path=request_path, + request_method=method, + headers=headers, + file_path=file_path, + stream=stream, + ) - response = result_dict['response'] - bytes_transferred = result_dict['bytes_transferred'] + response = result_dict["response"] + bytes_transferred = result_dict["bytes_transferred"] headers = response.headers - response = response.response - server_hash = headers['etag'].replace('"', '') - - if (verify_hash and result_dict['data_hash'] != server_hash): + response = response + server_hash = headers.get("etag", "").replace('"', "") + server_side_encryption = headers.get("x-amz-server-side-encryption", None) + aws_kms_encryption = server_side_encryption == "aws:kms" + hash_matches = result_dict["data_hash"] == server_hash + + # NOTE: If AWS KMS server side encryption is enabled, ETag won't + # contain object MD5 digest so we skip the checksum check + # See https://docs.aws.amazon.com/AmazonS3/latest/API + # /RESTCommonResponseHeaders.html + # and https://github.com/apache/libcloud/issues/1401 + # for details + if verify_hash and not aws_kms_encryption and not hash_matches: raise ObjectHashMismatchError( - value='MD5 hash checksum does not match', - object_name=object_name, driver=self) + value="MD5 hash {} checksum does not match {}".format( + server_hash, result_dict["data_hash"] + ), + object_name=object_name, + driver=self, + ) elif response.status == httplib.OK: obj = Object( - name=object_name, size=bytes_transferred, hash=server_hash, - extra={'acl': acl}, meta_data=meta_data, container=container, - driver=self) + name=object_name, + size=bytes_transferred, + hash=server_hash, + extra={"acl": acl}, + meta_data=meta_data, + container=container, + driver=self, + ) return obj else: raise LibcloudError( - 'Unexpected status code, status_code=%s' % (response.status), - driver=self) + "Unexpected status code, status_code=%s" % (response.status), + driver=self, + ) + + def _put_object_multipart( + self, + container, + object_name, + stream, + extra=None, + verify_hash=False, + headers=None, + storage_class=None, + ): + """ + Uploads an object using the S3 multipart algorithm. + + :param container: The destination container + :type container: :class:`Container` + + :param object_name: The name of the object which we are uploading + :type object_name: ``str`` + + :param stream: The generator for fetching the upload data + :type stream: ``generator`` + + :keyword verify_hash: Indicates if we must calculate the data hash + :type verify_hash: ``bool`` + + :keyword extra: Additional options + :type extra: ``dict`` + + :keyword headers: Additional headers + :type headers: ``dict`` + + :keyword storage_class: The name of the S3 object's storage class + :type extra: ``str`` + + :return: The uploaded object + :rtype: :class:`Object` + """ + headers = headers or {} + extra = extra or {} + + headers.update(self._to_storage_class_headers(storage_class)) + + content_type = extra.get("content_type", None) + meta_data = extra.get("meta_data", None) + acl = extra.get("acl", None) + + headers["Content-Type"] = self._determine_content_type(content_type, object_name) + + if meta_data: + for key, value in list(meta_data.items()): + key = self.http_vendor_prefix + "-meta-%s" % (key) + headers[key] = value + + if acl: + headers[self.http_vendor_prefix + "-acl"] = acl + + upload_id = self._initiate_multipart(container, object_name, headers=headers) + + try: + result = self._upload_multipart_chunks( + container, object_name, upload_id, stream, calculate_hash=verify_hash + ) + chunks, data_hash, bytes_transferred = result + + # Commit the chunk info and complete the upload + etag = self._commit_multipart(container, object_name, upload_id, chunks) + except Exception: + # Amazon provides a mechanism for aborting an upload. + self._abort_multipart(container, object_name, upload_id) + raise + + return Object( + name=object_name, + size=bytes_transferred, + hash=etag, + extra={"acl": acl}, + meta_data=meta_data, + container=container, + driver=self, + ) + + def _to_storage_class_headers(self, storage_class): + """ + Generates request headers given a storage class name. + + :keyword storage_class: The name of the S3 object's storage class + :type extra: ``str`` + + :return: Headers to include in a request + :rtype: :dict: + """ + headers = {} + storage_class = storage_class or "standard" + if storage_class not in [ + "standard", + "reduced_redundancy", + "standard_ia", + "onezone_ia", + "intelligent_tiering", + "glacier", + "deep_archive", + "glacier_ir", + ]: + raise ValueError("Invalid storage class value: %s" % (storage_class)) + + key = self.http_vendor_prefix + "-storage-class" + headers[key] = storage_class.upper() + return headers def _to_containers(self, obj, xpath): - for element in obj.findall(fixxpath(xpath=xpath, - namespace=self.namespace)): + for element in obj.findall(fixxpath(xpath=xpath, namespace=self.namespace)): yield self._to_container(element) def _to_objs(self, obj, xpath, container): - return [self._to_obj(element, container) for element in - obj.findall(fixxpath(xpath=xpath, namespace=self.namespace))] + return [ + self._to_obj(element, container) + for element in obj.findall(fixxpath(xpath=xpath, namespace=self.namespace)) + ] def _to_container(self, element): extra = { - 'creation_date': findtext(element=element, xpath='CreationDate', - namespace=self.namespace) + "creation_date": findtext( + element=element, xpath="CreationDate", namespace=self.namespace + ) } - container = Container(name=findtext(element=element, xpath='Name', - namespace=self.namespace), - extra=extra, - driver=self - ) + container = Container( + name=findtext(element=element, xpath="Name", namespace=self.namespace), + extra=extra, + driver=self, + ) return container + def _get_content_length_from_headers(self, headers: Dict[str, str]) -> Optional[int]: + """ + Prase object size from the provided response headers. + """ + content_length = headers.get("content-length", None) + return content_length + def _headers_to_object(self, object_name, container, headers): - hash = headers['etag'].replace('"', '') - extra = {'content_type': headers['content-type'], - 'etag': headers['etag']} + hash = headers.get("etag", "").replace('"', "") + + extra = {} + + # Not all the S3 compatible implementations return this header, see + # https://github.com/apache/libcloud/pull/1695 for details + if "content-type" in headers: + extra["content_type"] = headers["content-type"] + + # Google Storage S3 compatible API doesn't return this header under + # some scenarios https://github.com/apache/libcloud/issues/1682 + if "etag" in headers: + extra["etag"] = headers["etag"] + meta_data = {} - if 'last-modified' in headers: - extra['last_modified'] = headers['last-modified'] + if "content-encoding" in headers: + extra["content_encoding"] = headers["content-encoding"] + + if "last-modified" in headers: + extra["last_modified"] = headers["last-modified"] for key, value in headers.items(): - if not key.lower().startswith(self.http_vendor_prefix + '-meta-'): + if not key.lower().startswith(self.http_vendor_prefix + "-meta-"): continue - key = key.replace(self.http_vendor_prefix + '-meta-', '') + key = key.replace(self.http_vendor_prefix + "-meta-", "") meta_data[key] = value - obj = Object(name=object_name, size=headers['content-length'], - hash=hash, extra=extra, - meta_data=meta_data, - container=container, - driver=self) + content_length = self._get_content_length_from_headers(headers=headers) + + if content_length is None: + raise KeyError( + "Can not deduce object size from headers for " "object %s" % (object_name) + ) + + obj = Object( + name=object_name, + size=int(content_length), + hash=hash or None, + extra=extra, + meta_data=meta_data, + container=container, + driver=self, + ) return obj def _to_obj(self, element, container): - owner_id = findtext(element=element, xpath='Owner/ID', - namespace=self.namespace) - owner_display_name = findtext(element=element, - xpath='Owner/DisplayName', - namespace=self.namespace) - meta_data = {'owner': {'id': owner_id, - 'display_name': owner_display_name}} - last_modified = findtext(element=element, - xpath='LastModified', - namespace=self.namespace) - extra = {'last_modified': last_modified} - - obj = Object(name=findtext(element=element, xpath='Key', - namespace=self.namespace), - size=int(findtext(element=element, xpath='Size', - namespace=self.namespace)), - hash=findtext(element=element, xpath='ETag', - namespace=self.namespace).replace('"', ''), - extra=extra, - meta_data=meta_data, - container=container, - driver=self - ) + owner_id = findtext(element=element, xpath="Owner/ID", namespace=self.namespace) + owner_display_name = findtext( + element=element, xpath="Owner/DisplayName", namespace=self.namespace + ) + meta_data = {"owner": {"id": owner_id, "display_name": owner_display_name}} + last_modified = findtext(element=element, xpath="LastModified", namespace=self.namespace) + extra = {"last_modified": last_modified} + + obj = Object( + name=findtext(element=element, xpath="Key", namespace=self.namespace), + size=int(findtext(element=element, xpath="Size", namespace=self.namespace)), + hash=findtext(element=element, xpath="ETag", namespace=self.namespace).replace('"', ""), + extra=extra, + meta_data=meta_data, + container=container, + driver=self, + ) return obj class S3StorageDriver(AWSDriver, BaseS3StorageDriver): - connectionCls = S3Connection + name = "Amazon S3" + connectionCls = S3SignatureV4Connection + region_name = "us-east-1" + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + region=None, + token=None, + ex_allow_path_double_slashes: bool = False, + **kwargs, + ): + """ + :param ex_allow_path_double_slashes: Preserve repeated slashes in object + request paths for this driver. When False, use the existing global + ``ALLOW_PATH_DOUBLE_SLASHES`` setting. + :type ex_allow_path_double_slashes: ``bool`` + """ + self.ex_allow_path_double_slashes = ex_allow_path_double_slashes + + # Here for backward compatibility for old and deprecated driver class + # per region approach + if hasattr(self, "region_name") and not region: + region = self.region_name # pylint: disable=no-member + + self.region_name = region + + if region and region not in REGION_TO_HOST_MAP.keys(): + raise ValueError("Invalid or unsupported region: %s" % (region)) + + self.name = "Amazon S3 (%s)" % (region) + + if host is None: + host = REGION_TO_HOST_MAP[region] + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + region=region, + token=token, + **kwargs, + ) + + @classmethod + def list_regions(self): + return REGION_TO_HOST_MAP.keys() + + def get_object_cdn_url( + self, + obj, + ex_expiry=S3_CDN_URL_EXPIRY_HOURS, + ex_method: Literal["GET", "PUT", "DELETE"] = "GET", + ): + """ + Return a "presigned URL" for read-only access to object + + AWS only - requires AWS signature V4 authentication. + + :param obj: Object instance. + :type obj: :class:`Object` + + :param ex_expiry: The number of hours after which the URL expires. + Defaults to 24 hours or the value of the environment + variable "LIBCLOUD_S3_STORAGE_CDN_URL_EXPIRY_HOURS", + if set. + :type ex_expiry: ``float`` + + :param ex_method: The HTTP method for which the URL is valid. + Defaults to "GET". + :type ex_method: ``str`` + + :return: Presigned URL for the object. + :rtype: ``str`` + """ + + # assemble data for the request we want to pre-sign + # see: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html # noqa + object_path = self._get_object_path(obj.container, obj.name) + now = datetime.now(timezone.utc).replace(tzinfo=None) + duration_seconds = int(ex_expiry * 3600) + credparts = ( + self.key, + now.strftime(S3_CDN_URL_DATE_FORMAT), + self.region, + "s3", + "aws4_request", + ) + params_to_sign = { + "X-Amz-Algorithm": "AWS4-HMAC-SHA256", + "X-Amz-Credential": "/".join(credparts), + "X-Amz-Date": now.strftime(S3_CDN_URL_DATETIME_FORMAT), + "X-Amz-Expires": duration_seconds, + "X-Amz-SignedHeaders": "host", + } + if (self.secure and self.connection.port == 443) or ( + not self.secure and self.connection.port == 80 + ): + headers_to_sign = {"host": self.connection.host} + else: + headers_to_sign = { + "host": "{host}:{port}".format(host=self.connection.host, port=self.connection.port) + } + + # generate signature for the pre-signed request + signature = self.connection.signer._get_signature( + params=params_to_sign, + headers=headers_to_sign, + dt=now, + method=ex_method, + path=object_path, + data=UnsignedPayloadSentinel, + ) + + # Create final params for pre-signed URL + params = params_to_sign.copy() + params["X-Amz-Signature"] = signature + + return "{scheme}://{host}:{port}{path}?{params}".format( + scheme="https" if self.secure else "http", + host=self.connection.host, + port=self.connection.port, + path=object_path, + params=urlencode(params), + ) + + +class S3USEast2Connection(S3SignatureV4Connection): + host = S3_US_EAST2_HOST + +class S3USEast2StorageDriver(S3StorageDriver): + name = "Amazon S3 (us-east-2)" + connectionCls = S3USEast2Connection + ex_location_name = "us-east-2" + region_name = "us-east-2" -class S3USWestConnection(S3Connection): + +class S3USWestConnection(S3SignatureV4Connection): host = S3_US_WEST_HOST class S3USWestStorageDriver(S3StorageDriver): - name = 'Amazon S3 (us-west-1)' + name = "Amazon S3 (us-west-1)" connectionCls = S3USWestConnection - ex_location_name = 'us-west-1' + ex_location_name = "us-west-1" + region_name = "us-west-1" -class S3USWestOregonConnection(S3Connection): +class S3USWestOregonConnection(S3SignatureV4Connection): host = S3_US_WEST_OREGON_HOST class S3USWestOregonStorageDriver(S3StorageDriver): - name = 'Amazon S3 (us-west-2)' + name = "Amazon S3 (us-west-2)" connectionCls = S3USWestOregonConnection - ex_location_name = 'us-west-2' + ex_location_name = "us-west-2" + region_name = "us-west-2" + + +class S3USGovEastConnection(S3SignatureV4Connection): + host = S3_US_GOV_EAST_HOST + + +class S3USGovEastStorageDriver(S3StorageDriver): + name = "Amazon S3 (us-gov-east-1)" + connectionCls = S3USGovEastConnection + ex_location_name = "us-gov-east-1" + region_name = "us-gov-east-1" + + +class S3USGovWestConnection(S3SignatureV4Connection): + host = S3_US_GOV_WEST_HOST + +class S3USGovWestStorageDriver(S3StorageDriver): + name = "Amazon S3 (us-gov-west-1)" + connectionCls = S3USGovWestConnection + ex_location_name = "us-gov-west-1" + region_name = "us-gov-west-1" -class S3EUWestConnection(S3Connection): + +class S3CNNorthWestConnection(S3SignatureV4Connection): + host = S3_CN_NORTHWEST_HOST + + +class S3CNNorthWestStorageDriver(S3StorageDriver): + name = "Amazon S3 (cn-northwest-1)" + connectionCls = S3CNNorthWestConnection + ex_location_name = "cn-northwest-1" + region_name = "cn-northwest-1" + + +class S3CNNorthConnection(S3SignatureV4Connection): + host = S3_CN_NORTH_HOST + + +class S3CNNorthStorageDriver(S3StorageDriver): + name = "Amazon S3 (cn-north-1)" + connectionCls = S3CNNorthConnection + ex_location_name = "cn-north-1" + region_name = "cn-north-1" + + +class S3EUWestConnection(S3SignatureV4Connection): host = S3_EU_WEST_HOST class S3EUWestStorageDriver(S3StorageDriver): - name = 'Amazon S3 (eu-west-1)' + name = "Amazon S3 (eu-west-1)" connectionCls = S3EUWestConnection - ex_location_name = 'EU' + ex_location_name = "EU" + region_name = "eu-west-1" + + +class S3EUWest2Connection(S3SignatureV4Connection): + host = S3_EU_WEST2_HOST + + +class S3EUWest2StorageDriver(S3StorageDriver): + name = "Amazon S3 (eu-west-2)" + connectionCls = S3EUWest2Connection + ex_location_name = "eu-west-2" + region_name = "eu-west-2" + + +class S3EUCentralConnection(S3SignatureV4Connection): + host = S3_EU_CENTRAL_HOST -class S3APSEConnection(S3Connection): +class S3EUCentralStorageDriver(S3StorageDriver): + name = "Amazon S3 (eu-central-1)" + connectionCls = S3EUCentralConnection + ex_location_name = "eu-central-1" + region_name = "eu-central-1" + + +class S3APSEConnection(S3SignatureV4Connection): host = S3_AP_SOUTHEAST_HOST +class S3EUNorth1Connection(S3SignatureV4Connection): + host = S3_EU_NORTH1_HOST + + +class S3EUNorth1StorageDriver(S3StorageDriver): + name = "Amazon S3 (eu-north-1)" + connectionCls = S3EUNorth1Connection + ex_location_name = "eu-north-1" + region_name = "eu-north-1" + + class S3APSEStorageDriver(S3StorageDriver): - name = 'Amazon S3 (ap-southeast-1)' + name = "Amazon S3 (ap-southeast-1)" connectionCls = S3APSEConnection - ex_location_name = 'ap-southeast-1' + ex_location_name = "ap-southeast-1" + region_name = "ap-southeast-1" + + +class S3APSE2Connection(S3SignatureV4Connection): + host = S3_AP_SOUTHEAST2_HOST -class S3APNEConnection(S3Connection): - host = S3_AP_NORTHEAST_HOST +class S3APSE2StorageDriver(S3StorageDriver): + name = "Amazon S3 (ap-southeast-2)" + connectionCls = S3APSE2Connection + ex_location_name = "ap-southeast-2" + region_name = "ap-southeast-2" -class S3APNEStorageDriver(S3StorageDriver): - name = 'Amazon S3 (ap-northeast-1)' +class S3APNE1Connection(S3SignatureV4Connection): + host = S3_AP_NORTHEAST1_HOST + + +S3APNEConnection = S3APNE1Connection + + +class S3APNE1StorageDriver(S3StorageDriver): + name = "Amazon S3 (ap-northeast-1)" connectionCls = S3APNEConnection - ex_location_name = 'ap-northeast-1' + ex_location_name = "ap-northeast-1" + region_name = "ap-northeast-1" + + +S3APNEStorageDriver = S3APNE1StorageDriver + + +class S3APNE2Connection(S3SignatureV4Connection): + host = S3_AP_NORTHEAST2_HOST + + +class S3APNE2StorageDriver(S3StorageDriver): + name = "Amazon S3 (ap-northeast-2)" + connectionCls = S3APNE2Connection + ex_location_name = "ap-northeast-2" + region_name = "ap-northeast-2" + + +class S3APSouthConnection(S3SignatureV4Connection): + host = S3_AP_SOUTH_HOST + + +class S3APSouthStorageDriver(S3StorageDriver): + name = "Amazon S3 (ap-south-1)" + connectionCls = S3APSouthConnection + ex_location_name = "ap-south-1" + region_name = "ap-south-1" + + +class S3SAEastConnection(S3SignatureV4Connection): + host = S3_SA_EAST_HOST + + +class S3SAEastStorageDriver(S3StorageDriver): + name = "Amazon S3 (sa-east-1)" + connectionCls = S3SAEastConnection + ex_location_name = "sa-east-1" + region_name = "sa-east-1" + + +class S3CACentralConnection(S3SignatureV4Connection): + host = S3_CA_CENTRAL_HOST + + +class S3CACentralStorageDriver(S3StorageDriver): + name = "Amazon S3 (ca-central-1)" + connectionCls = S3CACentralConnection + ex_location_name = "ca-central-1" + region_name = "ca-central-1" diff --git a/libcloud/storage/drivers/scaleway.py b/libcloud/storage/drivers/scaleway.py new file mode 100644 index 0000000000..ac1abceb5e --- /dev/null +++ b/libcloud/storage/drivers/scaleway.py @@ -0,0 +1,119 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Literal + +from libcloud.storage.drivers.s3 import ( + S3_CDN_URL_EXPIRY_HOURS, + S3StorageDriver, + BaseS3StorageDriver, + S3SignatureV4Connection, +) + +__all__ = ["ScalewayStorageDriver"] + +SCW_FR_PAR_STANDARD_HOST = "s3.fr-par.scw.cloud" +SCW_NL_AMS_HOST = "s3.nl-ams.scw.cloud" +SCW_PL_WAR_HOST = "s3.pl-waw.scw.cloud" + +# Maps SCW region name to connection hostname +REGION_TO_HOST_MAP = { + "fr-par": SCW_FR_PAR_STANDARD_HOST, + "nl-ams": SCW_NL_AMS_HOST, + "pl-waw": SCW_PL_WAR_HOST, +} + +NO_CDN_SUPPORT_ERROR = "CDN feature not implemented" + + +class ScalewayStorageDriver(BaseS3StorageDriver): + name = "Scaleway Storage Driver" + website = "https://www.scaleway.com/en/object-storage/" + connectionCls = S3SignatureV4Connection + region_name = "fr-par" + + def __init__( + self, + key, + secret=None, + secure=True, + host=None, + port=None, + region="fr-par", + url=None, + **kwargs, + ): + # Here for backward compatibility for old and deprecated driver class + # per region approach + if hasattr(self, "region_name") and not region: + region = self.region_name # pylint: disable=no-member + + self.region_name = region + + if region and region not in REGION_TO_HOST_MAP.keys(): + raise ValueError("Invalid or unsupported region: %s" % (region)) + + self.name = "Scaleway Object Storage (%s)" % (region) + + if host is None: + self.connectionCls.host = REGION_TO_HOST_MAP[region] + else: + self.connectionCls.host = host + + super().__init__( + key=key, + secret=secret, + secure=secure, + host=host, + port=port, + region=region, + url=url, + **kwargs, + ) + + @classmethod + def list_regions(self): + return REGION_TO_HOST_MAP.keys() + + def get_object_cdn_url( + self, + obj, + ex_expiry=S3_CDN_URL_EXPIRY_HOURS, + ex_method: Literal["GET", "PUT", "DELETE"] = "GET", + ): + """ + Return a "presigned URL" for read-only access to object + + :param obj: Object instance. + :type obj: :class:`Object` + + :param ex_expiry: The number of hours after which the URL expires. + Defaults to 24 hours or the value of the environment + variable "LIBCLOUD_S3_STORAGE_CDN_URL_EXPIRY_HOURS", + if set. + :type ex_expiry: ``float`` + + :param ex_method: The HTTP method for which the URL is valid. + Defaults to "GET". + :type ex_method: ``str`` + + :return: Presigned URL for the object. + :rtype: ``str`` + """ + # In order to download (private) objects we need to be able to generate a valid CDN URL, + # hence shamefully just use the working code from the S3StorageDriver. + return S3StorageDriver.get_object_cdn_url( + self, obj, ex_expiry=ex_expiry, ex_method=ex_method + ) diff --git a/libcloud/storage/providers.py b/libcloud/storage/providers.py index 1be212e15b..2bd1db4c68 100644 --- a/libcloud/storage/providers.py +++ b/libcloud/storage/providers.py @@ -13,55 +13,98 @@ # See the License for the specific language governing permissions and # limitations under the License. -from libcloud.utils.misc import get_driver as get_provider_driver -from libcloud.utils.misc import set_driver as set_provider_driver -from libcloud.storage.types import Provider +from types import ModuleType +from typing import TYPE_CHECKING, Type, Union -DRIVERS = { - Provider.DUMMY: - ('libcloud.storage.drivers.dummy', 'DummyStorageDriver'), - Provider.CLOUDFILES: - ('libcloud.storage.drivers.cloudfiles', 'CloudFilesStorageDriver'), - Provider.OPENSTACK_SWIFT: - ('libcloud.storage.drivers.cloudfiles', 'OpenStackSwiftStorageDriver'), - Provider.S3: - ('libcloud.storage.drivers.s3', 'S3StorageDriver'), - Provider.S3_US_WEST: - ('libcloud.storage.drivers.s3', 'S3USWestStorageDriver'), - Provider.S3_US_WEST_OREGON: - ('libcloud.storage.drivers.s3', 'S3USWestOregonStorageDriver'), - Provider.S3_EU_WEST: - ('libcloud.storage.drivers.s3', 'S3EUWestStorageDriver'), - Provider.S3_AP_SOUTHEAST: - ('libcloud.storage.drivers.s3', 'S3APSEStorageDriver'), - Provider.S3_AP_NORTHEAST: - ('libcloud.storage.drivers.s3', 'S3APNEStorageDriver'), - Provider.NINEFOLD: - ('libcloud.storage.drivers.ninefold', 'NinefoldStorageDriver'), - Provider.GOOGLE_STORAGE: - ('libcloud.storage.drivers.google_storage', 'GoogleStorageDriver'), - Provider.NIMBUS: - ('libcloud.storage.drivers.nimbus', 'NimbusStorageDriver'), - Provider.LOCAL: - ('libcloud.storage.drivers.local', 'LocalStorageDriver'), - Provider.AZURE_BLOBS: - ('libcloud.storage.drivers.azure_blobs', 'AzureBlobsStorageDriver'), - Provider.KTUCLOUD: - ('libcloud.storage.drivers.ktucloud', 'KTUCloudStorageDriver'), +from libcloud.storage.types import OLD_CONSTANT_TO_NEW_MAPPING, Provider +from libcloud.common.providers import get_driver as _get_provider_driver +from libcloud.common.providers import set_driver as _set_provider_driver + +if TYPE_CHECKING: + from libcloud.storage.base import StorageDriver - # Deprecated - Provider.CLOUDFILES_US: - ('libcloud.storage.drivers.cloudfiles', 'CloudFilesUSStorageDriver'), - Provider.CLOUDFILES_UK: - ('libcloud.storage.drivers.cloudfiles', 'CloudFilesUKStorageDriver'), - Provider.CLOUDFILES_SWIFT: - ('libcloud.storage.drivers.cloudfiles', 'OpenStackSwiftStorageDriver') +DRIVERS = { + Provider.DUMMY: ("libcloud.storage.drivers.dummy", "DummyStorageDriver"), + Provider.CLOUDFILES: ( + "libcloud.storage.drivers.cloudfiles", + "CloudFilesStorageDriver", + ), + Provider.OPENSTACK_SWIFT: ( + "libcloud.storage.drivers.cloudfiles", + "OpenStackSwiftStorageDriver", + ), + Provider.S3: ("libcloud.storage.drivers.s3", "S3StorageDriver"), + Provider.S3_US_EAST2: ("libcloud.storage.drivers.s3", "S3USEast2StorageDriver"), + Provider.S3_US_WEST: ("libcloud.storage.drivers.s3", "S3USWestStorageDriver"), + Provider.S3_US_WEST_OREGON: ( + "libcloud.storage.drivers.s3", + "S3USWestOregonStorageDriver", + ), + Provider.S3_US_GOV_WEST: ( + "libcloud.storage.drivers.s3", + "S3USGovWestStorageDriver", + ), + Provider.S3_CN_NORTH: ("libcloud.storage.drivers.s3", "S3CNNorthStorageDriver"), + Provider.S3_CN_NORTHWEST: ( + "libcloud.storage.drivers.s3", + "S3CNNorthWestStorageDriver", + ), + Provider.S3_EU_WEST: ("libcloud.storage.drivers.s3", "S3EUWestStorageDriver"), + Provider.S3_EU_WEST2: ("libcloud.storage.drivers.s3", "S3EUWest2StorageDriver"), + Provider.S3_EU_CENTRAL: ("libcloud.storage.drivers.s3", "S3EUCentralStorageDriver"), + Provider.S3_EU_NORTH1: ("libcloud.storage.drivers.s3", "S3EUNorth1StorageDriver"), + Provider.S3_AP_SOUTH: ("libcloud.storage.drivers.s3", "S3APSouthStorageDriver"), + Provider.S3_AP_SOUTHEAST: ("libcloud.storage.drivers.s3", "S3APSEStorageDriver"), + Provider.S3_AP_SOUTHEAST2: ("libcloud.storage.drivers.s3", "S3APSE2StorageDriver"), + Provider.S3_AP_NORTHEAST: ("libcloud.storage.drivers.s3", "S3APNE1StorageDriver"), + Provider.S3_AP_NORTHEAST1: ("libcloud.storage.drivers.s3", "S3APNE1StorageDriver"), + Provider.S3_AP_NORTHEAST2: ("libcloud.storage.drivers.s3", "S3APNE2StorageDriver"), + Provider.S3_SA_EAST: ("libcloud.storage.drivers.s3", "S3SAEastStorageDriver"), + Provider.S3_CA_CENTRAL: ("libcloud.storage.drivers.s3", "S3CACentralStorageDriver"), + Provider.S3_RGW: ("libcloud.storage.drivers.rgw", "S3RGWStorageDriver"), + Provider.S3_RGW_OUTSCALE: ( + "libcloud.storage.drivers.rgw", + "S3RGWOutscaleStorageDriver", + ), + Provider.NINEFOLD: ("libcloud.storage.drivers.ninefold", "NinefoldStorageDriver"), + Provider.GOOGLE_STORAGE: ( + "libcloud.storage.drivers.google_storage", + "GoogleStorageDriver", + ), + Provider.NIMBUS: ("libcloud.storage.drivers.nimbus", "NimbusStorageDriver"), + Provider.LOCAL: ("libcloud.storage.drivers.local", "LocalStorageDriver"), + Provider.AZURE_BLOBS: ( + "libcloud.storage.drivers.azure_blobs", + "AzureBlobsStorageDriver", + ), + Provider.KTUCLOUD: ("libcloud.storage.drivers.ktucloud", "KTUCloudStorageDriver"), + Provider.AURORAOBJECTS: ( + "libcloud.storage.drivers.auroraobjects", + "AuroraObjectsStorageDriver", + ), + Provider.BACKBLAZE_B2: ( + "libcloud.storage.drivers.backblaze_b2", + "BackblazeB2StorageDriver", + ), + Provider.ALIYUN_OSS: ("libcloud.storage.drivers.oss", "OSSStorageDriver"), + Provider.DIGITALOCEAN_SPACES: ( + "libcloud.storage.drivers.digitalocean_spaces", + "DigitalOceanSpacesStorageDriver", + ), + Provider.MINIO: ("libcloud.storage.drivers.minio", "MinIOStorageDriver"), + Provider.SCALEWAY: ("libcloud.storage.drivers.scaleway", "ScalewayStorageDriver"), + Provider.OVH: ("libcloud.storage.drivers.ovh", "OvhStorageDriver"), } def get_driver(provider): - return get_provider_driver(DRIVERS, provider) + # type: (Union[Provider, str]) -> Type[StorageDriver] + deprecated_constants = OLD_CONSTANT_TO_NEW_MAPPING + return _get_provider_driver( + drivers=DRIVERS, provider=provider, deprecated_constants=deprecated_constants + ) def set_driver(provider, module, klass): - return set_provider_driver(DRIVERS, provider, module, klass) + # type: (Union[Provider, str], ModuleType, type) -> Type[StorageDriver] + return _set_provider_driver(drivers=DRIVERS, provider=provider, module=module, klass=klass) diff --git a/libcloud/storage/types.py b/libcloud/storage/types.py index ddc80351a0..41d524f99d 100644 --- a/libcloud/storage/types.py +++ b/libcloud/storage/types.py @@ -15,105 +15,170 @@ from libcloud.common.types import LibcloudError -__all__ = ['Provider', - 'ContainerError', - 'ObjectError', - 'ContainerAlreadyExistsError', - 'ContainerDoesNotExistError', - 'ContainerIsNotEmptyError', - 'ObjectDoesNotExistError', - 'ObjectHashMismatchError', - 'InvalidContainerNameError'] - - -class Provider(object): +__all__ = [ + "Provider", + "ContainerError", + "ObjectError", + "ContainerAlreadyExistsError", + "ContainerDoesNotExistError", + "ContainerIsNotEmptyError", + "ObjectDoesNotExistError", + "ObjectHashMismatchError", + "InvalidContainerNameError", + "OLD_CONSTANT_TO_NEW_MAPPING", +] + + +class Provider: """ Defines for each of the supported providers + Non-Dummy drivers are sorted in alphabetical order. Please preserve this + ordering when adding new drivers. + :cvar DUMMY: Example provider + :cvar ALIYUN_OSS: Aliyun OSS storage driver + :cvar AURORAOBJECTS: AuroraObjects storage driver + :cvar AZURE_BLOBS: Azure Blob Storage driver + :cvar BACKBLAZE_B2: Backblaze B2 Cloud Storage driver :cvar CLOUDFILES: CloudFiles + :cvar DIGITALOCEAN_SPACES: Digital Ocean Spaces driver + :cvar GOOGLE_STORAGE Google Storage + :cvar KTUCLOUD: KT UCloud Storage driver + :cvar LOCAL: Local storage driver + :cvar NIMBUS: Nimbus.io driver + :cvar NINEFOLD: Ninefold + :cvar OPENSTACK_SWIFT: OpenStack Swift driver :cvar S3: Amazon S3 US - :cvar S3_US_WEST: Amazon S3 US West (Northern California) + :cvar S3_AP_NORTHEAST: Amazon S3 Asia North East (Tokyo) + :cvar S3_AP_NORTHEAST1: Amazon S3 Asia North East (Tokyo) + :cvar S3_AP_NORTHEAST2: Amazon S3 Asia North East (Seoul) + :cvar S3_AP_SOUTH: Amazon S3 Asia South (Mumbai) + :cvar S3_AP_SOUTHEAST: Amazon S3 Asia South East (Singapore) + :cvar S3_AP_SOUTHEAST2: Amazon S3 Asia South East 2 (Sydney) + :cvar S3_CA_CENTRAL: Amazon S3 Canada (Central) + :cvar S3_CN_NORTH: Amazon S3 CN North (Beijing) :cvar S3_EU_WEST: Amazon S3 EU West (Ireland) - :cvar S3_AP_SOUTHEAST_HOST: Amazon S3 Asia South East (Singapore) - :cvar S3_AP_NORTHEAST_HOST: Amazon S3 Asia South East (Tokyo) - :cvar NINEFOLD: Ninefold - :cvar GOOGLE_STORAGE Google Storage + :cvar S3_EU_WEST2: Amazon S3 EU West 2 (London) + :cvar S3_EU_WEST3: Amazon S3 EU West 3 (Paris) + :cvar S3_EU_CENTRAL: Amazon S3 EU Central (Frankfurt) + :cvar S3_EU_NORTH1: Amazon S3 EU North 1 (Stockholm) + :cvar S3_SA_EAST: Amazon S3 South America East (Sao Paulo) + :cvar S3_US_EAST2: Amazon S3 US East 2 (Ohio) + :cvar S3_US_WEST: Amazon S3 US West (Northern California) :cvar S3_US_WEST_OREGON: Amazon S3 US West 2 (Oregon) - :cvar NIMBUS: Nimbus.io driver - :cvar LOCAL: Local storage driver + :cvar S3_US_GOV_WEST: Amazon S3 GovCloud (US) + :cvar S3_RGW: S3 RGW + :cvar S3_RGW_OUTSCALE: OUTSCALE S3 RGW """ - DUMMY = 'dummy' - S3 = 's3' - S3_US_WEST = 's3_us_west' - S3_EU_WEST = 's3_eu_west' - S3_AP_SOUTHEAST = 's3_ap_southeast' - S3_AP_NORTHEAST = 's3_ap_northeast' - NINEFOLD = 'ninefold' - GOOGLE_STORAGE = 'google_storage' - S3_US_WEST_OREGON = 's3_us_west_oregon' - NIMBUS = 'nimbus' - LOCAL = 'local' - OPENSTACK_SWIFT = 'openstack_swift' - CLOUDFILES = 'cloudfiles' - AZURE_BLOBS = 'azure_blobs' - KTUCLOUD = 'ktucloud' - - # Deperecated - CLOUDFILES_US = 'cloudfiles_us' - CLOUDFILES_UK = 'cloudfiles_uk' - CLOUDFILES_SWIFT = 'cloudfiles_swift' + + DUMMY = "dummy" + ALIYUN_OSS = "aliyun_oss" + AURORAOBJECTS = "auroraobjects" + AZURE_BLOBS = "azure_blobs" + BACKBLAZE_B2 = "backblaze_b2" + CLOUDFILES = "cloudfiles" + DIGITALOCEAN_SPACES = "digitalocean_spaces" + GOOGLE_STORAGE = "google_storage" + KTUCLOUD = "ktucloud" + LOCAL = "local" + NIMBUS = "nimbus" + NINEFOLD = "ninefold" + OPENSTACK_SWIFT = "openstack_swift" + S3 = "s3" + S3_AP_NORTHEAST = "s3_ap_northeast" + S3_AP_NORTHEAST1 = "s3_ap_northeast_1" + S3_AP_NORTHEAST2 = "s3_ap_northeast_2" + S3_AP_SOUTH = "s3_ap_south" + S3_AP_SOUTHEAST = "s3_ap_southeast" + S3_AP_SOUTHEAST2 = "s3_ap_southeast2" + S3_CA_CENTRAL = "s3_ca_central" + S3_CN_NORTH = "s3_cn_north" + S3_CN_NORTHWEST = "s3_cn_northwest" + S3_EU_WEST = "s3_eu_west" + S3_EU_WEST2 = "s3_eu_west_2" + S3_EU_WEST3 = "s3_eu_west_3" + S3_EU_CENTRAL = "s3_eu_central" + S3_EU_NORTH1 = "s3_eu_north_1" + S3_SA_EAST = "s3_sa_east" + S3_US_EAST2 = "s3_us_east_2" + S3_US_WEST = "s3_us_west" + S3_US_WEST_OREGON = "s3_us_west_oregon" + S3_US_GOV_WEST = "s3_us_gov_west" + S3_RGW = "s3_rgw" + S3_RGW_OUTSCALE = "s3_rgw_outscale" + MINIO = "minio" + SCALEWAY = "scaleway" + OVH = "ovh" + + # Deprecated + CLOUDFILES_US = "cloudfiles_us" + CLOUDFILES_UK = "cloudfiles_uk" + CLOUDFILES_SWIFT = "cloudfiles_swift" + + +OLD_CONSTANT_TO_NEW_MAPPING = { + # CloudFiles + Provider.CLOUDFILES_US: Provider.CLOUDFILES, + Provider.CLOUDFILES_UK: Provider.CLOUDFILES_UK, + Provider.CLOUDFILES_SWIFT: Provider.OPENSTACK_SWIFT, +} class ContainerError(LibcloudError): - error_type = 'ContainerError' + error_type = "ContainerError" def __init__(self, value, driver, container_name): self.container_name = container_name - super(ContainerError, self).__init__(value=value, driver=driver) + super().__init__(value=value, driver=driver) def __str__(self): - return ('<%s in %s, container=%s, value=%s>' % - (self.error_type, repr(self.driver), - self.container_name, self.value)) + return "<{} in {}, container={}, value={}>".format( + self.error_type, + repr(self.driver), + self.container_name, + self.value, + ) class ObjectError(LibcloudError): - error_type = 'ContainerError' + error_type = "ContainerError" def __init__(self, value, driver, object_name): self.object_name = object_name - super(ObjectError, self).__init__(value=value, driver=driver) + super().__init__(value=value, driver=driver) def __str__(self): return self.__repr__() def __repr__(self): - return '<%s in %s, value=%s, object = %s>' % (self.error_type, - repr(self.driver), - self.value, - self.object_name) + return "<{} in {}, value={}, object = {}>".format( + self.error_type, + repr(self.driver), + self.value, + self.object_name, + ) class ContainerAlreadyExistsError(ContainerError): - error_type = 'ContainerAlreadyExistsError' + error_type = "ContainerAlreadyExistsError" class ContainerDoesNotExistError(ContainerError): - error_type = 'ContainerDoesNotExistError' + error_type = "ContainerDoesNotExistError" class ContainerIsNotEmptyError(ContainerError): - error_type = 'ContainerIsNotEmptyError' + error_type = "ContainerIsNotEmptyError" class ObjectDoesNotExistError(ObjectError): - error_type = 'ObjectDoesNotExistError' + error_type = "ObjectDoesNotExistError" class ObjectHashMismatchError(ObjectError): - error_type = 'ObjectHashMismatchError' + error_type = "ObjectHashMismatchError" class InvalidContainerNameError(ContainerError): - error_type = 'InvalidContainerNameError' + error_type = "InvalidContainerNameError" diff --git a/libcloud/test/__init__.py b/libcloud/test/__init__.py index 3a701cdb67..1cc595f685 100644 --- a/libcloud/test/__init__.py +++ b/libcloud/test/__init__.py @@ -13,31 +13,31 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys +import os import random +import unittest -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import StringIO -from libcloud.utils.py3 import urlparse -from libcloud.utils.py3 import parse_qs -from libcloud.utils.py3 import parse_qsl -from libcloud.utils.py3 import u -from libcloud.utils.py3 import unittest2_required +import requests +import requests_mock -if unittest2_required: - import unittest2 as unittest +from libcloud.http import LibcloudConnection +from libcloud.utils.py3 import PY2, httplib, parse_qs, urlparse, urlquote, parse_qsl +from libcloud.common.base import Response + +if PY2: + from StringIO import StringIO else: - import unittest + from io import StringIO -XML_HEADERS = {'content-type': 'application/xml'} +XML_HEADERS = {"content-type": "application/xml"} class LibcloudTestCase(unittest.TestCase): def __init__(self, *args, **kwargs): self._visited_urls = [] self._executed_mock_methods = [] - super(LibcloudTestCase, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) def setUp(self): self._visited_urls = [] @@ -51,15 +51,18 @@ def _add_executed_mock_method(self, method_name): def assertExecutedMethodCount(self, expected): actual = len(self._executed_mock_methods) - self.assertEqual(actual, expected, - 'expected %d, but %d mock methods were executed' - % (expected, actual)) + self.assertEqual( + actual, + expected, + "expected %d, but %d mock methods were executed" % (expected, actual), + ) -class multipleresponse(object): +class multipleresponse: """ A decorator that allows MockHttp objects to return multi responses """ + count = 0 func = None @@ -73,60 +76,18 @@ def __call__(self, *args, **kwargs): return response -class MockResponse(object): - """ - A mock HTTPResponse - """ - headers = {} - body = StringIO() - status = 0 - reason = '' - version = 11 - - def __init__(self, status, body=None, headers=None, reason=None): - self.status = status - self.body = StringIO(u(body)) if body else StringIO() - self.headers = headers or self.headers - self.reason = reason or self.reason - - def read(self, *args, **kwargs): - return self.body.read(*args, **kwargs) - - def next(self): - if sys.version_info >= (2, 5) and sys.version_info <= (2, 6): - return self.body.next() - else: - return next(self.body) - - def __next__(self): - return self.next() - - def getheader(self, name, *args, **kwargs): - return self.headers.get(name, *args, **kwargs) - - def getheaders(self): - return list(self.headers.items()) - - def msg(self): - raise NotImplemented - +class BodyStream(StringIO): + def next(self, chunk_size=None): + return StringIO.next(self) -class BaseMockHttpObject(object): - def _get_method_name(self, type, use_param, qs, path): - path = path.split('?')[0] - meth_name = path.replace('/', '_').replace('.', '_').replace('-', '_') - - if type: - meth_name = '%s_%s' % (meth_name, self.type) - - if use_param and use_param in qs: - param = qs[use_param][0].replace('.', '_').replace('-', '_') - meth_name = '%s_%s' % (meth_name, param) + def __next__(self, chunk_size=None): + return StringIO.__next__(self) - return meth_name + def read(self, chunk_size=None): + return StringIO.read(self) -class MockHttp(BaseMockHttpObject): +class MockHttp(LibcloudConnection, unittest.TestCase): """ A mock HTTP client/server suitable for testing purposes. This replaces `HTTPConnection` by implementing its API and returning a mock response. @@ -135,96 +96,129 @@ class MockHttp(BaseMockHttpObject): Each of these mock methods should return a tuple of: (int status, str body, dict headers, str reason) - - >>> mock = MockHttp('localhost', 8080) - >>> mock.request('GET', '/example/') - >>> response = mock.getresponse() - >>> response.body.read() - 'Hello World!' - >>> response.status - 200 - >>> response.getheaders() - [('X-Foo', 'libcloud')] - >>> MockHttp.type = 'fail' - >>> mock.request('GET', '/example/') - >>> response = mock.getresponse() - >>> response.body.read() - 'Oh Noes!' - >>> response.status - 403 - >>> response.getheaders() - [('X-Foo', 'fail')] - """ - responseCls = MockResponse - host = None - port = None - response = None type = None use_param = None # will use this param to namespace the request function - test = None # TestCase instance which is using this mock + proxy_url = None - def __init__(self, host, port, *args, **kwargs): - self.host = host - self.port = port - - def request(self, method, url, body=None, headers=None, raw=False): + def __init__(self, *args, **kwargs): + # Load assertion methods into the class, in case people want to assert + # within a response + if isinstance(self, unittest.TestCase): + unittest.TestCase.__init__(self, "__init__") + # When this class is collected, it is instantiated with no arguments, + # which breaks any superclasses that expect arguments, so only + # do so if we were passed any keyword arguments. + if kwargs: + super().__init__(*args, **kwargs) + + def _get_request(self, method, url, body=None, headers=None): # Find a method we can use for this request parsed = urlparse.urlparse(url) - scheme, netloc, path, params, query, fragment = parsed + _, _, path, _, query, _ = parsed qs = parse_qs(query) - if path.endswith('/'): + if path.endswith("/"): path = path[:-1] - meth_name = self._get_method_name(type=self.type, - use_param=self.use_param, - qs=qs, path=path) - meth = getattr(self, meth_name.replace('%', '_')) + meth_name = self._get_method_name( + type=self.type, use_param=self.use_param, qs=qs, path=path + ) + meth = getattr(self, meth_name.replace("%", "_")) if self.test and isinstance(self.test, LibcloudTestCase): self.test._add_visited_url(url=url) self.test._add_executed_mock_method(method_name=meth_name) - - status, body, headers, reason = meth(method, url, body, headers) - self.response = self.responseCls(status, body, headers, reason) - - def getresponse(self): - return self.response - - def connect(self): - """ - Can't think of anything to mock here. - """ - pass - - def close(self): - pass + return meth(method, url, body, headers) + + def request(self, method, url, body=None, headers=None, raw=False, stream=False): + headers = self._normalize_headers(headers=headers) + r_status, r_body, r_headers, r_reason = self._get_request(method, url, body, headers) + if r_body is None: + r_body = "" + # this is to catch any special chars e.g. ~ in the request. URL + url = urlquote(url) + + with requests_mock.mock() as m: + m.register_uri( + method, + url, + text=r_body, + reason=r_reason, + headers=r_headers, + status_code=r_status, + ) + try: + super().request( + method=method, + url=url, + body=body, + headers=headers, + raw=raw, + stream=stream, + ) + except requests_mock.exceptions.NoMockAddress as nma: + raise AttributeError("Failed to mock out URL {} - {}".format(url, nma.request.url)) + + def prepared_request(self, method, url, body=None, headers=None, raw=False, stream=False): + headers = self._normalize_headers(headers=headers) + r_status, r_body, r_headers, r_reason = self._get_request(method, url, body, headers) + + with requests_mock.mock() as m: + m.register_uri( + method, + url, + text=r_body, + reason=r_reason, + headers=r_headers, + status_code=r_status, + ) + super().prepared_request( + method=method, + url=url, + body=body, + headers=headers, + raw=raw, + stream=stream, + ) # Mock request/response example def _example(self, method, url, body, headers): """ Return a simple message and header, regardless of input. """ - return (httplib.OK, 'Hello World!', {'X-Foo': 'libcloud'}, - httplib.responses[httplib.OK]) + return ( + httplib.OK, + "Hello World!", + {"X-Foo": "libcloud"}, + httplib.responses[httplib.OK], + ) def _example_fail(self, method, url, body, headers): - return (httplib.FORBIDDEN, 'Oh Noes!', {'X-Foo': 'fail'}, - httplib.responses[httplib.FORBIDDEN]) + return ( + httplib.FORBIDDEN, + "Oh No!", + {"X-Foo": "fail"}, + httplib.responses[httplib.FORBIDDEN], + ) + def _get_method_name(self, type, use_param, qs, path): + path = path.split("?")[0] + meth_name = ( + path.replace("/", "_").replace(".", "_").replace("-", "_").replace("~", "%7E") + ) # Python 3.7 no longer quotes ~ -class MockHttpTestCase(MockHttp, unittest.TestCase): - # Same as the MockHttp class, but you can also use assertions in the - # classes which inherit from this one. - def __init__(self, *args, **kwargs): - unittest.TestCase.__init__(self) + if type: + meth_name = "{}_{}".format(meth_name, type) - if kwargs.get('host', None) and kwargs.get('port', None): - MockHttp.__init__(self, *args, **kwargs) + if use_param and use_param in qs: + param = qs[use_param][0].replace(".", "_").replace("-", "_") + meth_name = "{}_{}".format(meth_name, param) + + if meth_name == "": + meth_name = "root" - def runTest(self): - pass + return meth_name def assertUrlContainsQueryParams(self, url, expected_params, strict=False): """ @@ -240,106 +234,63 @@ def assertUrlContainsQueryParams(self, url, expected_params, strict=False): (defaults to ``False``) :type strict: ``bool`` """ - question_mark_index = url.find('?') + question_mark_index = url.find("?") if question_mark_index != -1: - url = url[question_mark_index + 1:] + url = url[question_mark_index + 1 :] params = dict(parse_qsl(url)) if strict: - self.assertDictEqual(params, expected_params) + assert params == expected_params else: for key, value in expected_params.items(): - self.assertEqual(params[key], value) + assert key in params + assert params[key] == value + + +class MockConnection: + def __init__(self, action): + self.action = action -class StorageMockHttp(MockHttp): - def putrequest(self, method, action): - pass +StorageMockHttp = MockHttp - def putheader(self, key, value): - pass - def endheaders(self): - pass +def make_response(status=200, headers={}, connection=None): + response = requests.Response() + response.status_code = status + response.headers = headers + return Response(response, connection) - def send(self, data): - pass +def generate_random_data(size): + data = "" + current_size = 0 + while current_size < size: + value = str(random.randint(0, 9)) + value_size = len(value) + data += value + current_size += value_size + return data -class MockRawResponse(BaseMockHttpObject): + +def no_network(): + """Return true if the NO_NETWORK environment variable is set. + Can be used to skip relevant tests. """ - Mock RawResponse object suitable for testing. + return "NO_NETWORK" in os.environ + + +def no_internet(): + """Return true if the NO_INTERNET or the NO_NETWORK environment variable + is set. + Can be used to skip relevant tests. """ + return "NO_INTERNET" in os.environ or no_network() - type = None - responseCls = MockResponse - - def __init__(self, connection): - super(MockRawResponse, self).__init__() - self._data = [] - self._current_item = 0 - - self._status = None - self._response = None - self._headers = None - self._reason = None - self.connection = connection - - def next(self): - if self._current_item == len(self._data): - raise StopIteration - - value = self._data[self._current_item] - self._current_item += 1 - return value - - def __next__(self): - return self.next() - - def _generate_random_data(self, size): - data = '' - current_size = 0 - while current_size < size: - value = str(random.randint(0, 9)) - value_size = len(value) - data += value - current_size += value_size - - return data - - @property - def response(self): - return self._get_response_if_not_availale() - - @property - def status(self): - self._get_response_if_not_availale() - return self._status - - @property - def headers(self): - self._get_response_if_not_availale() - return self._headers - - @property - def reason(self): - self._get_response_if_not_availale() - return self._reason - - def _get_response_if_not_availale(self): - if not self._response: - meth_name = self._get_method_name(type=self.type, - use_param=False, qs=None, - path=self.connection.action) - meth = getattr(self, meth_name.replace('%', '_')) - result = meth(self.connection.method, None, None, None) - self._status, self._body, self._headers, self._reason = result - self._response = self.responseCls(self._status, self._body, - self._headers, self._reason) - return self._response if __name__ == "__main__": import doctest + doctest.testmod() diff --git a/libcloud/test/backup/__init__.py b/libcloud/test/backup/__init__.py new file mode 100644 index 0000000000..cc482bfb77 --- /dev/null +++ b/libcloud/test/backup/__init__.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.backup.base import BackupTarget, BackupTargetType + + +class TestCaseMixin: + def get_supported_target_types(self): + targets = self.driver.get_supported_target_types() + self.assertTrue(isinstance(targets, list)) + for target in targets: + self.assertTrue(isinstance(target, BackupTargetType)) + + def test_list_targets_response(self): + targets = self.driver.list_targets() + self.assertTrue(isinstance(targets, list)) + for target in targets: + self.assertTrue(isinstance(target, BackupTarget)) + + +if __name__ == "__main__": + import doctest + + doctest.testmod() diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_DISABLE.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_DISABLE.xml new file mode 100644 index 0000000000..520574ec7f --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_DISABLE.xml @@ -0,0 +1,7 @@ + + + Disable Backup for Server + SUCCESS + Backup disabled for Server + REASON_0 + diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_ENABLE.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_ENABLE.xml new file mode 100644 index 0000000000..6974377b3f --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_ENABLE.xml @@ -0,0 +1,18 @@ + + + Enable Backup for Server + SUCCESS + Backup enabled for Server - see additional Information for Asset ID + REASON_0 + + ee7c4b64-f7af-4a4f-8384-be362273530f + + \ No newline at end of file diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_EXISTS.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_EXISTS.xml new file mode 100644 index 0000000000..a6892de96b --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_EXISTS.xml @@ -0,0 +1,7 @@ + + + Enable Backup for Server + ERROR + Cloud backup for this server is already enabled or being enabled (state: NORMAL). + REASON_550 + diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_INFO.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_INFO.xml new file mode 100644 index 0000000000..750d8158d6 --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_INFO.xml @@ -0,0 +1,16 @@ + + + + Linux File Agent + 12AM - 6AM + 14 Day Storage Policy + + fake_email@example.com + fake_email2@example.com + + + 0 + https://backups-na.cloud-vpn.net/PCS/BackupClientInstallerDownload/cbb8a8c607ca4144e8828814edfc1634c8dd8782 + + + diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_INFO_DISABLED.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_INFO_DISABLED.xml new file mode 100644 index 0000000000..763fad6e8f --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_INFO_DISABLED.xml @@ -0,0 +1,7 @@ + + + Get Backup Details + ERROR + Server e75ead52-692f-4314-8725-c8a4f4d13a87 has not been provisioned for backup + REASON_543 + diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_INFO_NOCLIENT.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_INFO_NOCLIENT.xml new file mode 100644 index 0000000000..540f3cc47a --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_INFO_NOCLIENT.xml @@ -0,0 +1,2 @@ + + diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_INFO_NOJOB.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_INFO_NOJOB.xml new file mode 100644 index 0000000000..6323db7b68 --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_INFO_NOJOB.xml @@ -0,0 +1,11 @@ + + + + Linux File Agent + 12AM - 6AM + 14 Day Storage Policy + + 0 + https://backups-na.cloud-vpn.net/PCS/BackupClientInstallerDownload/cbb8a8c607ca4144e8828814edfc1634c8dd8782 + + diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8_cancelJob.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8_cancelJob.xml new file mode 100644 index 0000000000..500e1ca1b6 --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8_cancelJob.xml @@ -0,0 +1,7 @@ + + + Cancel Backup Job + SUCCESS + Backup Job Canceled + REASON_0 + diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8_cancelJob_FAIL.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8_cancelJob_FAIL.xml new file mode 100644 index 0000000000..7f7845fa20 --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8_cancelJob_FAIL.xml @@ -0,0 +1,7 @@ + + + Cancel Backup Job + ERROR + No backup job currently running on client + REASON_547 + diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_client_SUCCESS_PUT.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_client_SUCCESS_PUT.xml new file mode 100644 index 0000000000..a9105123fd --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_client_SUCCESS_PUT.xml @@ -0,0 +1,13 @@ + + + Add Backup Client + SUCCESS + Backup Client added + REASON_0 + + a26cead0-6bab-4446-9a16-c227e6ab201f + + + https://backups-na.cloud-vpn.net/PCS/BackupClientInstallerDownload/4b3f35815b848ce7270186b52e5817fa5de0fe42 + + diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_client_schedulePolicy.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_client_schedulePolicy.xml new file mode 100644 index 0000000000..159f0e31bd --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_client_schedulePolicy.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_client_storagePolicy.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_client_storagePolicy.xml new file mode 100644 index 0000000000..22cf7fedc7 --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_client_storagePolicy.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_client_type.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_client_type.xml new file mode 100644 index 0000000000..f3e1fbc65a --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_client_type.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/libcloud/test/backup/fixtures/dimensiondata/_backup_modify.xml b/libcloud/test/backup/fixtures/dimensiondata/_backup_modify.xml new file mode 100644 index 0000000000..eb7a344369 --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_backup_modify.xml @@ -0,0 +1,7 @@ + + + Change Backup Service Plan + SUCCESS + Backup Service Plan changed + REASON_0 + diff --git a/libcloud/test/backup/fixtures/dimensiondata/_remove_backup_client.xml b/libcloud/test/backup/fixtures/dimensiondata/_remove_backup_client.xml new file mode 100644 index 0000000000..4ce51c6a2e --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_remove_backup_client.xml @@ -0,0 +1,7 @@ + + + Disable Backup Client + SUCCESS + Backup Client disabled + REASON_0 + diff --git a/libcloud/test/backup/fixtures/dimensiondata/_remove_backup_client_FAIL.xml b/libcloud/test/backup/fixtures/dimensiondata/_remove_backup_client_FAIL.xml new file mode 100644 index 0000000000..6c2db63161 --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/_remove_backup_client_FAIL.xml @@ -0,0 +1,7 @@ + + + Disable Backup Client + ERROR + DISABLE_BACKUP_CLIENT 'didata-backup-test6[172-16-1-14]' - failed - Unexpected error occurred with NA9 Backup system at 2016-02-12 00:03:50.952, TransactionId: (9d483a7a-1cc9-441b-920c-e11fb0e94ba6), PCSOperation: DeprovisionBackupClient, Backup Client is currently performing another operation: Backup client is currently busy + REASON_547 + diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_myaccount.xml b/libcloud/test/backup/fixtures/dimensiondata/oec_0_9_myaccount.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_myaccount.xml rename to libcloud/test/backup/fixtures/dimensiondata/oec_0_9_myaccount.xml diff --git a/libcloud/test/backup/fixtures/dimensiondata/server_server.xml b/libcloud/test/backup/fixtures/dimensiondata/server_server.xml new file mode 100644 index 0000000000..c3d607fca6 --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/server_server.xml @@ -0,0 +1,49 @@ + + + + + Production Web Server MCP 1 + nopassword0 + + + 2 + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + NORMAL + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + diff --git a/libcloud/test/backup/fixtures/dimensiondata/server_server_NOBACKUP.xml b/libcloud/test/backup/fixtures/dimensiondata/server_server_NOBACKUP.xml new file mode 100644 index 0000000000..6f76aba06f --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/server_server_NOBACKUP.xml @@ -0,0 +1,29 @@ + + + + Production Web Server MCP 2 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + diff --git a/libcloud/test/backup/fixtures/dimensiondata/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml b/libcloud/test/backup/fixtures/dimensiondata/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml new file mode 100644 index 0000000000..07b131987f --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml @@ -0,0 +1,27 @@ + + + Production Web Server + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + DEPLOY_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + diff --git a/libcloud/test/backup/fixtures/dimensiondata/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT.xml b/libcloud/test/backup/fixtures/dimensiondata/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT.xml new file mode 100644 index 0000000000..c64c530da7 --- /dev/null +++ b/libcloud/test/backup/fixtures/dimensiondata/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT.xml @@ -0,0 +1,27 @@ + + + Production Web Server + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + DEPLOY_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + diff --git a/libcloud/test/backup/test_dimensiondata_v2_3.py b/libcloud/test/backup/test_dimensiondata_v2_3.py new file mode 100644 index 0000000000..46110ed7d7 --- /dev/null +++ b/libcloud/test/backup/test_dimensiondata_v2_3.py @@ -0,0 +1,530 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import ET, httplib +from libcloud.backup.base import BackupTargetJob +from libcloud.common.types import InvalidCredsError +from libcloud.test.secrets import DIMENSIONDATA_PARAMS +from libcloud.test.file_fixtures import BackupFileFixtures +from libcloud.common.dimensiondata import DimensionDataAPIException +from libcloud.backup.drivers.dimensiondata import DEFAULT_BACKUP_PLAN +from libcloud.backup.drivers.dimensiondata import DimensionDataBackupDriver as DimensionData + + +class DimensionData_v2_3_Tests(unittest.TestCase): + def setUp(self): + DimensionData.connectionCls.active_api_version = "2.3" + DimensionData.connectionCls.conn_class = DimensionDataMockHttp + DimensionDataMockHttp.type = None + self.driver = DimensionData(*DIMENSIONDATA_PARAMS) + + def test_invalid_region(self): + with self.assertRaises(ValueError): + self.driver = DimensionData(*DIMENSIONDATA_PARAMS, region="blah") + + def test_invalid_creds(self): + DimensionDataMockHttp.type = "UNAUTHORIZED" + with self.assertRaises(InvalidCredsError): + self.driver.list_targets() + + def test_list_targets(self): + targets = self.driver.list_targets() + self.assertEqual(len(targets), 2) + self.assertEqual(targets[0].id, "5579f3a7-4c32-4cf5-8a7e-b45c36a35c10") + self.assertEqual(targets[0].address, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(targets[0].extra["servicePlan"], "Enterprise") + + def test_create_target(self): + target = self.driver.create_target( + "name", + "e75ead52-692f-4314-8725-c8a4f4d13a87", + extra={"servicePlan": "Enterprise"}, + ) + self.assertEqual(target.id, "ee7c4b64-f7af-4a4f-8384-be362273530f") + self.assertEqual(target.address, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(target.extra["servicePlan"], "Enterprise") + + def test_create_target_DEFAULT(self): + DimensionDataMockHttp.type = "DEFAULT" + target = self.driver.create_target("name", "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(target.id, "ee7c4b64-f7af-4a4f-8384-be362273530f") + self.assertEqual(target.address, "e75ead52-692f-4314-8725-c8a4f4d13a87") + + def test_create_target_EXISTS(self): + DimensionDataMockHttp.type = "EXISTS" + with self.assertRaises(DimensionDataAPIException) as context: + self.driver.create_target( + "name", + "e75ead52-692f-4314-8725-c8a4f4d13a87", + extra={"servicePlan": "Enterprise"}, + ) + self.assertEqual(context.exception.code, "ERROR") + self.assertEqual( + context.exception.msg, + "Cloud backup for this server is already enabled or being enabled (state: NORMAL).", + ) + + def test_update_target(self): + target = self.driver.list_targets()[0] + extra = {"servicePlan": "Essentials"} + new_target = self.driver.update_target(target, extra=extra) + self.assertEqual(new_target.extra["servicePlan"], "Essentials") + + def test_update_target_DEFAULT(self): + DimensionDataMockHttp.type = "DEFAULT" + target = "e75ead52-692f-4314-8725-c8a4f4d13a87" + self.driver.update_target(target) + + def test_update_target_STR(self): + target = "e75ead52-692f-4314-8725-c8a4f4d13a87" + extra = {"servicePlan": "Essentials"} + new_target = self.driver.update_target(target, extra=extra) + self.assertEqual(new_target.extra["servicePlan"], "Essentials") + + def test_delete_target(self): + target = self.driver.list_targets()[0] + self.assertTrue(self.driver.delete_target(target)) + + def test_ex_add_client_to_target(self): + target = self.driver.list_targets()[0] + client = self.driver.ex_list_available_client_types(target)[0] + storage_policy = self.driver.ex_list_available_storage_policies(target)[0] + schedule_policy = self.driver.ex_list_available_schedule_policies(target)[0] + self.assertTrue( + self.driver.ex_add_client_to_target( + target, + client, + storage_policy, + schedule_policy, + "ON_FAILURE", + "nobody@example.com", + ) + ) + + def test_ex_add_client_to_target_STR(self): + self.assertTrue( + self.driver.ex_add_client_to_target( + "e75ead52-692f-4314-8725-c8a4f4d13a87", + "FA.Linux", + "14 Day Storage Policy", + "12AM - 6AM", + "ON_FAILURE", + "nobody@example.com", + ) + ) + + def test_ex_get_backup_details_for_target(self): + target = self.driver.list_targets()[0] + response = self.driver.ex_get_backup_details_for_target(target) + self.assertEqual(response.service_plan, "Enterprise") + client = response.clients[0] + self.assertEqual(client.id, "30b1ff76-c76d-4d7c-b39d-3b72be0384c8") + self.assertEqual(client.type.type, "FA.Linux") + self.assertEqual(client.running_job.progress, 5) + self.assertTrue(isinstance(client.running_job, BackupTargetJob)) + self.assertEqual(len(client.alert.notify_list), 2) + self.assertTrue(isinstance(client.alert.notify_list, list)) + + def test_ex_get_backup_details_for_target_NOBACKUP(self): + target = self.driver.list_targets()[0].address + DimensionDataMockHttp.type = "NOBACKUP" + response = self.driver.ex_get_backup_details_for_target(target) + self.assertTrue(response is None) + + def test_ex_cancel_target_job(self): + target = self.driver.list_targets()[0] + response = self.driver.ex_get_backup_details_for_target(target) + client = response.clients[0] + self.assertTrue(isinstance(client.running_job, BackupTargetJob)) + success = client.running_job.cancel() + self.assertTrue(success) + + def test_ex_cancel_target_job_with_extras(self): + success = self.driver.cancel_target_job( + None, + ex_client="30b1ff76_c76d_4d7c_b39d_3b72be0384c8", + ex_target="e75ead52_692f_4314_8725_c8a4f4d13a87", + ) + self.assertTrue(success) + + def test_ex_cancel_target_job_FAIL(self): + DimensionDataMockHttp.type = "FAIL" + with self.assertRaises(DimensionDataAPIException) as context: + self.driver.cancel_target_job( + None, + ex_client="30b1ff76_c76d_4d7c_b39d_3b72be0384c8", + ex_target="e75ead52_692f_4314_8725_c8a4f4d13a87", + ) + self.assertEqual(context.exception.code, "ERROR") + + """Test a backup info for a target that does not have a client""" + + def test_ex_get_backup_details_for_target_NO_CLIENT(self): + DimensionDataMockHttp.type = "NOCLIENT" + response = self.driver.ex_get_backup_details_for_target( + "e75ead52-692f-4314-8725-c8a4f4d13a87" + ) + self.assertEqual(response.service_plan, "Essentials") + self.assertEqual(len(response.clients), 0) + + """Test a backup details that has a client, but no alerting or running jobs""" + + def test_ex_get_backup_details_for_target_NO_JOB_OR_ALERT(self): + DimensionDataMockHttp.type = "NOJOB" + response = self.driver.ex_get_backup_details_for_target( + "e75ead52-692f-4314_8725-c8a4f4d13a87" + ) + self.assertEqual(response.service_plan, "Enterprise") + self.assertTrue(isinstance(response.clients, list)) + self.assertEqual(len(response.clients), 1) + client = response.clients[0] + self.assertEqual(client.id, "30b1ff76-c76d-4d7c-b39d-3b72be0384c8") + self.assertEqual(client.type.type, "FA.Linux") + self.assertIsNone(client.running_job) + self.assertIsNone(client.alert) + + """Test getting backup info for a server that doesn't exist""" + + def test_ex_get_backup_details_for_target_DISABLED(self): + DimensionDataMockHttp.type = "DISABLED" + with self.assertRaises(DimensionDataAPIException) as context: + self.driver.ex_get_backup_details_for_target("e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(context.exception.code, "ERROR") + self.assertEqual( + context.exception.msg, + "Server e75ead52-692f-4314-8725-c8a4f4d13a87 has not been provisioned for backup", + ) + + def test_ex_list_available_client_types(self): + target = self.driver.list_targets()[0] + answer = self.driver.ex_list_available_client_types(target) + self.assertEqual(len(answer), 1) + self.assertEqual(answer[0].type, "FA.Linux") + self.assertEqual(answer[0].is_file_system, True) + self.assertEqual(answer[0].description, "Linux File system") + + def test_ex_list_available_storage_policies(self): + target = self.driver.list_targets()[0] + answer = self.driver.ex_list_available_storage_policies(target) + self.assertEqual(len(answer), 1) + self.assertEqual(answer[0].name, "30 Day Storage Policy + Secondary Copy") + self.assertEqual(answer[0].retention_period, 30) + self.assertEqual(answer[0].secondary_location, "Primary") + + def test_ex_list_available_schedule_policies(self): + target = self.driver.list_targets()[0] + answer = self.driver.ex_list_available_schedule_policies(target) + self.assertEqual(len(answer), 1) + self.assertEqual(answer[0].name, "12AM - 6AM") + self.assertEqual(answer[0].description, "Daily backup will start between 12AM - 6AM") + + def test_ex_remove_client_from_target(self): + target = self.driver.list_targets()[0] + client = self.driver.ex_get_backup_details_for_target( + "e75ead52-692f-4314-8725-c8a4f4d13a87" + ).clients[0] + self.assertTrue(self.driver.ex_remove_client_from_target(target, client)) + + def test_ex_remove_client_from_target_STR(self): + self.assertTrue( + self.driver.ex_remove_client_from_target( + "e75ead52-692f-4314-8725-c8a4f4d13a87", + "30b1ff76-c76d-4d7c-b39d-3b72be0384c8", + ) + ) + + def test_ex_remove_client_from_target_FAIL(self): + DimensionDataMockHttp.type = "FAIL" + with self.assertRaises(DimensionDataAPIException) as context: + self.driver.ex_remove_client_from_target( + "e75ead52-692f-4314-8725-c8a4f4d13a87", + "30b1ff76-c76d-4d7c-b39d-3b72be0384c8", + ) + self.assertEqual(context.exception.code, "ERROR") + self.assertTrue( + "Backup Client is currently performing another operation" in context.exception.msg + ) + + def test_priv_target_to_target_address(self): + target = self.driver.list_targets()[0] + self.assertEqual( + self.driver._target_to_target_address(target), + "e75ead52-692f-4314-8725-c8a4f4d13a87", + ) + + def test_priv_target_to_target_address_STR(self): + self.assertEqual( + self.driver._target_to_target_address("e75ead52-692f-4314-8725-c8a4f4d13a87"), + "e75ead52-692f-4314-8725-c8a4f4d13a87", + ) + + def test_priv_target_to_target_address_TYPEERROR(self): + with self.assertRaises(TypeError): + self.driver._target_to_target_address([1, 2, 3]) + + def test_priv_client_to_client_id(self): + client = self.driver.ex_get_backup_details_for_target( + "e75ead52-692f-4314-8725-c8a4f4d13a87" + ).clients[0] + self.assertEqual( + self.driver._client_to_client_id(client), + "30b1ff76-c76d-4d7c-b39d-3b72be0384c8", + ) + + def test_priv_client_to_client_id_STR(self): + self.assertEqual( + self.driver._client_to_client_id("30b1ff76-c76d-4d7c-b39d-3b72be0384c8"), + "30b1ff76-c76d-4d7c-b39d-3b72be0384c8", + ) + + def test_priv_client_to_client_id_TYPEERROR(self): + with self.assertRaises(TypeError): + self.driver._client_to_client_id([1, 2, 3]) + + +class InvalidRequestError(Exception): + def __init__(self, tag): + super().__init__("Invalid Request - %s" % tag) + + +class DimensionDataMockHttp(MockHttp): + fixtures = BackupFileFixtures("dimensiondata") + + def _oec_0_9_myaccount_UNAUTHORIZED(self, method, url, body, headers): + return (httplib.UNAUTHORIZED, "", {}, httplib.responses[httplib.UNAUTHORIZED]) + + def _oec_0_9_myaccount(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_EXISTS(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_DEFAULT(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_INPROGRESS(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_FAIL(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_NOCLIENT(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_DISABLED(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_NOJOB(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_NOCLIENT( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_NOJOB( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DISABLED( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_type( + self, method, url, body, headers + ): + body = self.fixtures.load("_backup_client_type.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_storagePolicy( + self, method, url, body, headers + ): + body = self.fixtures.load("_backup_client_storagePolicy.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_schedulePolicy( + self, method, url, body, headers + ): + body = self.fixtures.load("_backup_client_schedulePolicy.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client( + self, method, url, body, headers + ): + if method == "POST": + body = self.fixtures.load("_backup_client_SUCCESS_PUT.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + raise ValueError("Unknown Method {}".format(method)) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_NOCLIENT( + self, method, url, body, headers + ): + # only gets here are implemented + # If we get any other method something has gone wrong + assert method == "GET" + body = self.fixtures.load("_backup_INFO_NOCLIENT.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_DISABLED( + self, method, url, body, headers + ): + # only gets here are implemented + # If we get any other method something has gone wrong + assert method == "GET" + body = self.fixtures.load("_backup_INFO_DISABLED.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_NOJOB( + self, method, url, body, headers + ): + # only gets here are implemented + # If we get any other method something has gone wrong + assert method == "GET" + body = self.fixtures.load("_backup_INFO_NOJOB.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_DEFAULT( + self, method, url, body, headers + ): + if method != "POST": + raise InvalidRequestError("Only POST is accepted for this test") + request = ET.fromstring(body) + service_plan = request.get("servicePlan") + if service_plan != DEFAULT_BACKUP_PLAN: + raise InvalidRequestError( + "The default plan %s should have been passed in. Not %s" + % (DEFAULT_BACKUP_PLAN, service_plan) + ) + body = self.fixtures.load("_backup_ENABLE.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup( + self, method, url, body, headers + ): + if method == "POST": + body = self.fixtures.load("_backup_ENABLE.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "GET": + if url.endswith("disable"): + body = self.fixtures.load("_backup_DISABLE.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + body = self.fixtures.load("_backup_INFO.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + else: + raise ValueError("Unknown Method {}".format(method)) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_NOBACKUP( + self, method, url, body, headers + ): + assert method == "GET" + body = self.fixtures.load("server_server_NOBACKUP.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_EXISTS( + self, method, url, body, headers + ): + # only POSTs are implemented + # If we get any other method something has gone wrong + assert method == "POST" + body = self.fixtures.load("_backup_EXISTS.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_modify( + self, method, url, body, headers + ): + request = ET.fromstring(body) + service_plan = request.get("servicePlan") + if service_plan != "Essentials": + raise InvalidRequestError("Expected Essentials backup plan in request") + body = self.fixtures.load("_backup_modify.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_modify_DEFAULT( + self, method, url, body, headers + ): + request = ET.fromstring(body) + service_plan = request.get("servicePlan") + if service_plan != DEFAULT_BACKUP_PLAN: + raise InvalidRequestError("Expected %s backup plan in test" % DEFAULT_BACKUP_PLAN) + body = self.fixtures.load("_backup_modify.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8( + self, method, url, body, headers + ): + if url.endswith("disable"): + body = self.fixtures.load("_remove_backup_client.xml") + elif url.endswith("cancelJob"): + body = self.fixtures.load( + "" "_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8_cancelJob.xml" + ) + else: + raise ValueError("Unknown URL: %s" % url) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8_FAIL( + self, method, url, body, headers + ): + if url.endswith("disable"): + body = self.fixtures.load("_remove_backup_client_FAIL.xml") + elif url.endswith("cancelJob"): + body = self.fixtures.load( + "" "_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8_cancelJob_FAIL.xml" + ) + else: + raise ValueError("Unknown URL: %s" % url) + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/backup/test_dimensiondata_v2_4.py b/libcloud/test/backup/test_dimensiondata_v2_4.py new file mode 100644 index 0000000000..2156c423a5 --- /dev/null +++ b/libcloud/test/backup/test_dimensiondata_v2_4.py @@ -0,0 +1,530 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import ET, httplib +from libcloud.backup.base import BackupTargetJob +from libcloud.common.types import InvalidCredsError +from libcloud.test.secrets import DIMENSIONDATA_PARAMS +from libcloud.test.file_fixtures import BackupFileFixtures +from libcloud.common.dimensiondata import DimensionDataAPIException +from libcloud.backup.drivers.dimensiondata import DEFAULT_BACKUP_PLAN +from libcloud.backup.drivers.dimensiondata import DimensionDataBackupDriver as DimensionData + + +class DimensionData_v2_4_Tests(unittest.TestCase): + def setUp(self): + DimensionData.connectionCls.active_api_version = "2.4" + DimensionData.connectionCls.conn_class = DimensionDataMockHttp + DimensionDataMockHttp.type = None + self.driver = DimensionData(*DIMENSIONDATA_PARAMS) + + def test_invalid_region(self): + with self.assertRaises(ValueError): + self.driver = DimensionData(*DIMENSIONDATA_PARAMS, region="blah") + + def test_invalid_creds(self): + DimensionDataMockHttp.type = "UNAUTHORIZED" + with self.assertRaises(InvalidCredsError): + self.driver.list_targets() + + def test_list_targets(self): + targets = self.driver.list_targets() + self.assertEqual(len(targets), 2) + self.assertEqual(targets[0].id, "5579f3a7-4c32-4cf5-8a7e-b45c36a35c10") + self.assertEqual(targets[0].address, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(targets[0].extra["servicePlan"], "Enterprise") + + def test_create_target(self): + target = self.driver.create_target( + "name", + "e75ead52-692f-4314-8725-c8a4f4d13a87", + extra={"servicePlan": "Enterprise"}, + ) + self.assertEqual(target.id, "ee7c4b64-f7af-4a4f-8384-be362273530f") + self.assertEqual(target.address, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(target.extra["servicePlan"], "Enterprise") + + def test_create_target_DEFAULT(self): + DimensionDataMockHttp.type = "DEFAULT" + target = self.driver.create_target("name", "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(target.id, "ee7c4b64-f7af-4a4f-8384-be362273530f") + self.assertEqual(target.address, "e75ead52-692f-4314-8725-c8a4f4d13a87") + + def test_create_target_EXISTS(self): + DimensionDataMockHttp.type = "EXISTS" + with self.assertRaises(DimensionDataAPIException) as context: + self.driver.create_target( + "name", + "e75ead52-692f-4314-8725-c8a4f4d13a87", + extra={"servicePlan": "Enterprise"}, + ) + self.assertEqual(context.exception.code, "ERROR") + self.assertEqual( + context.exception.msg, + "Cloud backup for this server is already enabled or being enabled (state: NORMAL).", + ) + + def test_update_target(self): + target = self.driver.list_targets()[0] + extra = {"servicePlan": "Essentials"} + new_target = self.driver.update_target(target, extra=extra) + self.assertEqual(new_target.extra["servicePlan"], "Essentials") + + def test_update_target_DEFAULT(self): + DimensionDataMockHttp.type = "DEFAULT" + target = "e75ead52-692f-4314-8725-c8a4f4d13a87" + self.driver.update_target(target) + + def test_update_target_STR(self): + target = "e75ead52-692f-4314-8725-c8a4f4d13a87" + extra = {"servicePlan": "Essentials"} + new_target = self.driver.update_target(target, extra=extra) + self.assertEqual(new_target.extra["servicePlan"], "Essentials") + + def test_delete_target(self): + target = self.driver.list_targets()[0] + self.assertTrue(self.driver.delete_target(target)) + + def test_ex_add_client_to_target(self): + target = self.driver.list_targets()[0] + client = self.driver.ex_list_available_client_types(target)[0] + storage_policy = self.driver.ex_list_available_storage_policies(target)[0] + schedule_policy = self.driver.ex_list_available_schedule_policies(target)[0] + self.assertTrue( + self.driver.ex_add_client_to_target( + target, + client, + storage_policy, + schedule_policy, + "ON_FAILURE", + "nobody@example.com", + ) + ) + + def test_ex_add_client_to_target_STR(self): + self.assertTrue( + self.driver.ex_add_client_to_target( + "e75ead52-692f-4314-8725-c8a4f4d13a87", + "FA.Linux", + "14 Day Storage Policy", + "12AM - 6AM", + "ON_FAILURE", + "nobody@example.com", + ) + ) + + def test_ex_get_backup_details_for_target(self): + target = self.driver.list_targets()[0] + response = self.driver.ex_get_backup_details_for_target(target) + self.assertEqual(response.service_plan, "Enterprise") + client = response.clients[0] + self.assertEqual(client.id, "30b1ff76-c76d-4d7c-b39d-3b72be0384c8") + self.assertEqual(client.type.type, "FA.Linux") + self.assertEqual(client.running_job.progress, 5) + self.assertTrue(isinstance(client.running_job, BackupTargetJob)) + self.assertEqual(len(client.alert.notify_list), 2) + self.assertTrue(isinstance(client.alert.notify_list, list)) + + def test_ex_get_backup_details_for_target_NOBACKUP(self): + target = self.driver.list_targets()[0].address + DimensionDataMockHttp.type = "NOBACKUP" + response = self.driver.ex_get_backup_details_for_target(target) + self.assertTrue(response is None) + + def test_ex_cancel_target_job(self): + target = self.driver.list_targets()[0] + response = self.driver.ex_get_backup_details_for_target(target) + client = response.clients[0] + self.assertTrue(isinstance(client.running_job, BackupTargetJob)) + success = client.running_job.cancel() + self.assertTrue(success) + + def test_ex_cancel_target_job_with_extras(self): + success = self.driver.cancel_target_job( + None, + ex_client="30b1ff76_c76d_4d7c_b39d_3b72be0384c8", + ex_target="e75ead52_692f_4314_8725_c8a4f4d13a87", + ) + self.assertTrue(success) + + def test_ex_cancel_target_job_FAIL(self): + DimensionDataMockHttp.type = "FAIL" + with self.assertRaises(DimensionDataAPIException) as context: + self.driver.cancel_target_job( + None, + ex_client="30b1ff76_c76d_4d7c_b39d_3b72be0384c8", + ex_target="e75ead52_692f_4314_8725_c8a4f4d13a87", + ) + self.assertEqual(context.exception.code, "ERROR") + + """Test a backup info for a target that does not have a client""" + + def test_ex_get_backup_details_for_target_NO_CLIENT(self): + DimensionDataMockHttp.type = "NOCLIENT" + response = self.driver.ex_get_backup_details_for_target( + "e75ead52-692f-4314-8725-c8a4f4d13a87" + ) + self.assertEqual(response.service_plan, "Essentials") + self.assertEqual(len(response.clients), 0) + + """Test a backup details that has a client, but no alerting or running jobs""" + + def test_ex_get_backup_details_for_target_NO_JOB_OR_ALERT(self): + DimensionDataMockHttp.type = "NOJOB" + response = self.driver.ex_get_backup_details_for_target( + "e75ead52-692f-4314_8725-c8a4f4d13a87" + ) + self.assertEqual(response.service_plan, "Enterprise") + self.assertTrue(isinstance(response.clients, list)) + self.assertEqual(len(response.clients), 1) + client = response.clients[0] + self.assertEqual(client.id, "30b1ff76-c76d-4d7c-b39d-3b72be0384c8") + self.assertEqual(client.type.type, "FA.Linux") + self.assertIsNone(client.running_job) + self.assertIsNone(client.alert) + + """Test getting backup info for a server that doesn't exist""" + + def test_ex_get_backup_details_for_target_DISABLED(self): + DimensionDataMockHttp.type = "DISABLED" + with self.assertRaises(DimensionDataAPIException) as context: + self.driver.ex_get_backup_details_for_target("e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(context.exception.code, "ERROR") + self.assertEqual( + context.exception.msg, + "Server e75ead52-692f-4314-8725-c8a4f4d13a87 has not been provisioned for backup", + ) + + def test_ex_list_available_client_types(self): + target = self.driver.list_targets()[0] + answer = self.driver.ex_list_available_client_types(target) + self.assertEqual(len(answer), 1) + self.assertEqual(answer[0].type, "FA.Linux") + self.assertEqual(answer[0].is_file_system, True) + self.assertEqual(answer[0].description, "Linux File system") + + def test_ex_list_available_storage_policies(self): + target = self.driver.list_targets()[0] + answer = self.driver.ex_list_available_storage_policies(target) + self.assertEqual(len(answer), 1) + self.assertEqual(answer[0].name, "30 Day Storage Policy + Secondary Copy") + self.assertEqual(answer[0].retention_period, 30) + self.assertEqual(answer[0].secondary_location, "Primary") + + def test_ex_list_available_schedule_policies(self): + target = self.driver.list_targets()[0] + answer = self.driver.ex_list_available_schedule_policies(target) + self.assertEqual(len(answer), 1) + self.assertEqual(answer[0].name, "12AM - 6AM") + self.assertEqual(answer[0].description, "Daily backup will start between 12AM - 6AM") + + def test_ex_remove_client_from_target(self): + target = self.driver.list_targets()[0] + client = self.driver.ex_get_backup_details_for_target( + "e75ead52-692f-4314-8725-c8a4f4d13a87" + ).clients[0] + self.assertTrue(self.driver.ex_remove_client_from_target(target, client)) + + def test_ex_remove_client_from_target_STR(self): + self.assertTrue( + self.driver.ex_remove_client_from_target( + "e75ead52-692f-4314-8725-c8a4f4d13a87", + "30b1ff76-c76d-4d7c-b39d-3b72be0384c8", + ) + ) + + def test_ex_remove_client_from_target_FAIL(self): + DimensionDataMockHttp.type = "FAIL" + with self.assertRaises(DimensionDataAPIException) as context: + self.driver.ex_remove_client_from_target( + "e75ead52-692f-4314-8725-c8a4f4d13a87", + "30b1ff76-c76d-4d7c-b39d-3b72be0384c8", + ) + self.assertEqual(context.exception.code, "ERROR") + self.assertTrue( + "Backup Client is currently performing another operation" in context.exception.msg + ) + + def test_priv_target_to_target_address(self): + target = self.driver.list_targets()[0] + self.assertEqual( + self.driver._target_to_target_address(target), + "e75ead52-692f-4314-8725-c8a4f4d13a87", + ) + + def test_priv_target_to_target_address_STR(self): + self.assertEqual( + self.driver._target_to_target_address("e75ead52-692f-4314-8725-c8a4f4d13a87"), + "e75ead52-692f-4314-8725-c8a4f4d13a87", + ) + + def test_priv_target_to_target_address_TYPEERROR(self): + with self.assertRaises(TypeError): + self.driver._target_to_target_address([1, 2, 3]) + + def test_priv_client_to_client_id(self): + client = self.driver.ex_get_backup_details_for_target( + "e75ead52-692f-4314-8725-c8a4f4d13a87" + ).clients[0] + self.assertEqual( + self.driver._client_to_client_id(client), + "30b1ff76-c76d-4d7c-b39d-3b72be0384c8", + ) + + def test_priv_client_to_client_id_STR(self): + self.assertEqual( + self.driver._client_to_client_id("30b1ff76-c76d-4d7c-b39d-3b72be0384c8"), + "30b1ff76-c76d-4d7c-b39d-3b72be0384c8", + ) + + def test_priv_client_to_client_id_TYPEERROR(self): + with self.assertRaises(TypeError): + self.driver._client_to_client_id([1, 2, 3]) + + +class InvalidRequestError(Exception): + def __init__(self, tag): + super().__init__("Invalid Request - %s" % tag) + + +class DimensionDataMockHttp(MockHttp): + fixtures = BackupFileFixtures("dimensiondata") + + def _oec_0_9_myaccount_UNAUTHORIZED(self, method, url, body, headers): + return (httplib.UNAUTHORIZED, "", {}, httplib.responses[httplib.UNAUTHORIZED]) + + def _oec_0_9_myaccount(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_EXISTS(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_DEFAULT(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_INPROGRESS(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_FAIL(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_NOCLIENT(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_DISABLED(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_NOJOB(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_NOCLIENT( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_NOJOB( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DISABLED( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_DEFAULT.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_type( + self, method, url, body, headers + ): + body = self.fixtures.load("_backup_client_type.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_storagePolicy( + self, method, url, body, headers + ): + body = self.fixtures.load("_backup_client_storagePolicy.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_schedulePolicy( + self, method, url, body, headers + ): + body = self.fixtures.load("_backup_client_schedulePolicy.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client( + self, method, url, body, headers + ): + if method == "POST": + body = self.fixtures.load("_backup_client_SUCCESS_PUT.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + raise ValueError("Unknown Method {}".format(method)) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_NOCLIENT( + self, method, url, body, headers + ): + # only gets here are implemented + # If we get any other method something has gone wrong + assert method == "GET" + body = self.fixtures.load("_backup_INFO_NOCLIENT.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_DISABLED( + self, method, url, body, headers + ): + # only gets here are implemented + # If we get any other method something has gone wrong + assert method == "GET" + body = self.fixtures.load("_backup_INFO_DISABLED.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_NOJOB( + self, method, url, body, headers + ): + # only gets here are implemented + # If we get any other method something has gone wrong + assert method == "GET" + body = self.fixtures.load("_backup_INFO_NOJOB.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_DEFAULT( + self, method, url, body, headers + ): + if method != "POST": + raise InvalidRequestError("Only POST is accepted for this test") + request = ET.fromstring(body) + service_plan = request.get("servicePlan") + if service_plan != DEFAULT_BACKUP_PLAN: + raise InvalidRequestError( + "The default plan %s should have been passed in. Not %s" + % (DEFAULT_BACKUP_PLAN, service_plan) + ) + body = self.fixtures.load("_backup_ENABLE.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup( + self, method, url, body, headers + ): + if method == "POST": + body = self.fixtures.load("_backup_ENABLE.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "GET": + if url.endswith("disable"): + body = self.fixtures.load("_backup_DISABLE.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + body = self.fixtures.load("_backup_INFO.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + else: + raise ValueError("Unknown Method {}".format(method)) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87_NOBACKUP( + self, method, url, body, headers + ): + assert method == "GET" + body = self.fixtures.load("server_server_NOBACKUP.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_EXISTS( + self, method, url, body, headers + ): + # only POSTs are implemented + # If we get any other method something has gone wrong + assert method == "POST" + body = self.fixtures.load("_backup_EXISTS.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_modify( + self, method, url, body, headers + ): + request = ET.fromstring(body) + service_plan = request.get("servicePlan") + if service_plan != "Essentials": + raise InvalidRequestError("Expected Essentials backup plan in request") + body = self.fixtures.load("_backup_modify.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_modify_DEFAULT( + self, method, url, body, headers + ): + request = ET.fromstring(body) + service_plan = request.get("servicePlan") + if service_plan != DEFAULT_BACKUP_PLAN: + raise InvalidRequestError("Expected %s backup plan in test" % DEFAULT_BACKUP_PLAN) + body = self.fixtures.load("_backup_modify.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8( + self, method, url, body, headers + ): + if url.endswith("disable"): + body = self.fixtures.load("_remove_backup_client.xml") + elif url.endswith("cancelJob"): + body = self.fixtures.load( + "" "_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8_cancelJob.xml" + ) + else: + raise ValueError("Unknown URL: %s" % url) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8_FAIL( + self, method, url, body, headers + ): + if url.endswith("disable"): + body = self.fixtures.load("_remove_backup_client_FAIL.xml") + elif url.endswith("cancelJob"): + body = self.fixtures.load( + "" "_backup_client_30b1ff76_c76d_4d7c_b39d_3b72be0384c8_cancelJob_FAIL.xml" + ) + else: + raise ValueError("Unknown URL: %s" % url) + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/benchmarks/test_list_objects_filtering_performance.py b/libcloud/test/benchmarks/test_list_objects_filtering_performance.py new file mode 100644 index 0000000000..9425cb43e8 --- /dev/null +++ b/libcloud/test/benchmarks/test_list_objects_filtering_performance.py @@ -0,0 +1,121 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import glob +import atexit +import random +import shutil +import string +import tempfile +from unittest import mock + +import pytest + +from libcloud.storage.drivers.local import LocalStorageDriver + + +def make_tmp_file(content=None): + content = content or b"1" + + fd, path = tempfile.mkstemp() + + with os.fdopen(fd, "wb") as fp: + fp.write(content) + + return path + + +def clean_up_lock_files(): + for file_path in glob.glob("/tmp/*.lock"): + os.remove(file_path) + + +# fmt: off +@pytest.mark.parametrize( + "object_count", + [ + 100, + 1000, + 10000, + 10000, + 100000, + ], + ids=[ + "100", + "1000", + "10k", + "100k", + "1mil", + ], +) +@pytest.mark.parametrize( + "sort_objects", + [ + True, + False, + ], + ids=[ + "sort_objects", + "no_sort", + ], +) +# fmt: on +def test_list_objects_with_filtering(benchmark, object_count, sort_objects): + """ + Micro benchmark which measures how long list_container_objects takes with a lot of objects. + + NOTE: To avoid issues with tons of lock files laying around we don't use locking for this + benchmark since we are not woried about race conditions and we don't benchmark locking + scenario. + """ + base_path = tempfile.mkdtemp() + + def clean_up_base_path(): + if os.path.exists(base_path): + shutil.rmtree(base_path) + + atexit.register(clean_up_base_path) + atexit.register(clean_up_lock_files) + + driver = LocalStorageDriver(base_path, ex_use_locking=False) + + def run_benchmark(): + objects = driver.list_container_objects(container=container) + assert len(objects) == object_count + return objects + + # 1. Create mock objects + container = driver.create_container("test_container_1") + tmppath = make_tmp_file() + + for index in range(0, object_count): + # To actually exercise overhead of sorting we use random objects name and not sequential + # pre-sorted object names + name = "".join(random.choices(string.ascii_uppercase + string.digits, k=10)) + obj = container.upload_object(tmppath, name) + assert obj.name == name + + # 2. Run the actual benchmark + try: + if sort_objects: + result = benchmark(run_benchmark) + else: + with mock.patch("libcloud.storage.drivers.local.sorted", lambda values, key: values): + result = benchmark(run_benchmark) + assert len(result) == object_count + finally: + clean_up_base_path() + clean_up_lock_files() diff --git a/libcloud/test/benchmarks/test_read_in_chunks.py b/libcloud/test/benchmarks/test_read_in_chunks.py new file mode 100644 index 0000000000..694e9fbb7b --- /dev/null +++ b/libcloud/test/benchmarks/test_read_in_chunks.py @@ -0,0 +1,153 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Tuple, Callable + +import pytest + +from libcloud.utils.py3 import b, next +from libcloud.utils.files import CHUNK_SIZE, read_in_chunks + + +def _old_read_in_chunks(iterator, chunk_size=None, fill_size=False, yield_empty=False): + """ + Old implementation of read_in_chunks without performance optimizations from #1847. + + It's only here so we can directly measure compare performance of old and the new version. + """ + chunk_size = chunk_size or CHUNK_SIZE + + try: + get_data = iterator.read + args = (chunk_size,) + except AttributeError: + get_data = next + args = (iterator,) + + data = b("") + empty = False + + while not empty or len(data) > 0: + if not empty: + try: + chunk = b(get_data(*args)) + if len(chunk) > 0: + data += chunk + else: + empty = True + except StopIteration: + empty = True + + if len(data) == 0: + if empty and yield_empty: + yield b("") + + return + + if fill_size: + if empty or len(data) >= chunk_size: + yield data[:chunk_size] + data = data[chunk_size:] + else: + yield data + data = b("") + + +# fmt: off +@pytest.mark.parametrize( + "data_chunk_size_tuple", + [ + (b"c" * (40 * 1024 * 1024), 1 * 1024 * 1024), + (b"c" * (40 * 1024 * 1024), 5 * 1024 * 1024), + (b"c" * (80 * 1024 * 1024), 1 * 1024 * 1024), + ], + ids=[ + "40mb_data_1mb_chunk_size", + "40mb_data_5mb_chunk_size", + "80mb_data_1mb_chunk_size", + ], +) +@pytest.mark.parametrize( + "read_in_chunks_func", + [ + _old_read_in_chunks, + read_in_chunks, + ], + ids=[ + "old", + "new", + ], +) +# fmt: on +def test_scenario_1( + benchmark, data_chunk_size_tuple: Tuple[bytes, int], read_in_chunks_func: Callable +): + # similar to calling _upload_multipart_chunks with one large array of bytes + data, chunk_size = data_chunk_size_tuple + + def run_benchmark(): + for _ in read_in_chunks_func(iter([data]), chunk_size=chunk_size, fill_size=True): + pass + + benchmark(run_benchmark) + + +# fmt: off +# NOTE: Because the old implementation is very slow when there is a chunk size mismatch, we need to +# use smaller total objects size to prevent this benchmark from running for a very long time. +@pytest.mark.parametrize( + "data_chunk_size_tuple", + [ + (b"c" * (10 * 1024 * 1024), 8 * 1024), + (b"c" * (20 * 1024 * 1024), 1 * 1024 * 1024), + (b"c" * (30 * 1024 * 1024), 1 * 1024 * 1024), + ], + ids=[ + "10mb_data_8k_chunk_size", + "20mb_data_1mb_chunk_size", + "30mb_data_1mb_chunk_size", + ], +) +@pytest.mark.parametrize( + "read_in_chunks_func", + [ + _old_read_in_chunks, + read_in_chunks, + ], + ids=[ + "old", + "new", + ], +) +# fmt: on +def test_scenario_2( + benchmark, data_chunk_size_tuple: Tuple[bytes, int], read_in_chunks_func: Callable +): + # similar to calling _upload_multipart_chunks with one large array of bytes + data, chunk_size = data_chunk_size_tuple + response_chunk = 5 * 1024 * 1024 + + # NOTE: It would be nice if we could also assert that data has been correctly add, but this + # would add additional overhead (since we would also measure accumulating this data) so we have + # those checks done separately in the unit tests. + def run_benchmark(): + for a in read_in_chunks_func( + iter([data[i : i + response_chunk] for i in range(0, len(data), response_chunk)]), + chunk_size=chunk_size, + fill_size=True, + ): + pass + + benchmark(run_benchmark) diff --git a/libcloud/test/common/fixtures/digitalocean/_v1_events_12345670.json b/libcloud/test/common/fixtures/digitalocean/_v1_events_12345670.json new file mode 100644 index 0000000000..6ff04b58c6 --- /dev/null +++ b/libcloud/test/common/fixtures/digitalocean/_v1_events_12345670.json @@ -0,0 +1 @@ +{"status":"OK","event":{"id":12345670,"event_type_id":1,"percentage":"100","droplet_id":1234560,"action_status":"done"}} diff --git a/libcloud/test/common/fixtures/digitalocean/_v1_events_12345670_UNAUTHORIZED.json b/libcloud/test/common/fixtures/digitalocean/_v1_events_12345670_UNAUTHORIZED.json new file mode 100644 index 0000000000..0994c93aa1 --- /dev/null +++ b/libcloud/test/common/fixtures/digitalocean/_v1_events_12345670_UNAUTHORIZED.json @@ -0,0 +1 @@ +{"status":"ERROR","error_message":"Access Denied","message":"Access Denied"} diff --git a/libcloud/test/common/fixtures/digitalocean/_v2_account.json b/libcloud/test/common/fixtures/digitalocean/_v2_account.json new file mode 100644 index 0000000000..37083cf30f --- /dev/null +++ b/libcloud/test/common/fixtures/digitalocean/_v2_account.json @@ -0,0 +1 @@ +{"account":{"droplet_limit":10,"email":"user@domain.tld","uuid":"a1234567890b1234567890c1234567890d12345","email_verified":true}} diff --git a/libcloud/test/common/fixtures/digitalocean/_v2_account_UNAUTHORIZED.json b/libcloud/test/common/fixtures/digitalocean/_v2_account_UNAUTHORIZED.json new file mode 100644 index 0000000000..415d9ef049 --- /dev/null +++ b/libcloud/test/common/fixtures/digitalocean/_v2_account_UNAUTHORIZED.json @@ -0,0 +1 @@ +{"id":"unauthorized","message":"Unable to authenticate you."} diff --git a/libcloud/test/common/fixtures/digitalocean/_v2_actions.json b/libcloud/test/common/fixtures/digitalocean/_v2_actions.json new file mode 100644 index 0000000000..3c36117488 --- /dev/null +++ b/libcloud/test/common/fixtures/digitalocean/_v2_actions.json @@ -0,0 +1 @@ +{"actions":[],"links":{},"meta":{"total":0}} diff --git a/libcloud/test/common/fixtures/digitalocean/_v2_actions_12345670.json b/libcloud/test/common/fixtures/digitalocean/_v2_actions_12345670.json new file mode 100644 index 0000000000..9631675f66 --- /dev/null +++ b/libcloud/test/common/fixtures/digitalocean/_v2_actions_12345670.json @@ -0,0 +1 @@ +{"action":{"id":12345670,"status":"completed","type":"power_on","started_at":"2015-03-28T10:57:40Z","completed_at":"2015-03-28T10:57:42Z","resource_id":1234560,"resource_type":"droplet","region":{"name":"New York 3","slug":"nyc3","sizes":["512mb","1gb","2gb","4gb","8gb","16gb","32gb","48gb","64gb"],"features":["virtio","private_networking","backups","ipv6","metadata"],"available":true},"region_slug":"nyc3"}} diff --git a/libcloud/test/common/fixtures/digitalocean/_v2_actions_page_1.json b/libcloud/test/common/fixtures/digitalocean/_v2_actions_page_1.json new file mode 100644 index 0000000000..b9ebd616cf --- /dev/null +++ b/libcloud/test/common/fixtures/digitalocean/_v2_actions_page_1.json @@ -0,0 +1 @@ +{"actions":[{"id":12345671,"status":"completed","type":"create","started_at":"2015-04-10T14:09:37Z","completed_at":"2015-04-10T14:10:03Z","resource_id":1234561,"resource_type":"droplet","region":{"name":"Frankfurt 1","slug":"fra1","sizes":["512mb","1gb","2gb","4gb","8gb","16gb","32gb","48gb","64gb"],"features":["virtio","private_networking","backups","ipv6","metadata"],"available":true},"region_slug":"fra1"}],"links":{"pages":{"last":"https://api.digitalocean.com/v2/actions/?page=2","next":"https://api.digitalocean.com/v2/actions/?page=2"}},"meta":{"total":2}} diff --git a/libcloud/test/common/fixtures/digitalocean/_v2_actions_page_2.json b/libcloud/test/common/fixtures/digitalocean/_v2_actions_page_2.json new file mode 100644 index 0000000000..3ddfad2527 --- /dev/null +++ b/libcloud/test/common/fixtures/digitalocean/_v2_actions_page_2.json @@ -0,0 +1 @@ +{"actions":[{"id":12345670,"status":"completed","type":"create","started_at":"2015-04-10T14:09:12Z","completed_at":"2015-04-10T14:09:38Z","resource_id":1234560,"resource_type":"droplet","region":{"name":"Frankfurt 1","slug":"fra1","sizes":["512mb","1gb","2gb","4gb","8gb","16gb","32gb","48gb","64gb"],"features":["virtio","private_networking","backups","ipv6","metadata"],"available":true},"region_slug":"fra1"}],"links":{"pages":{"first":"https://api.digitalocean.com/v2/actions/?page=1","prev":"https://api.digitalocean.com/v2/actions/?page=1"}},"meta":{"total":2}} diff --git a/libcloud/test/common/fixtures/google/pkey.json b/libcloud/test/common/fixtures/google/pkey.json index b3338ca1b1..330e6451ee 100644 --- a/libcloud/test/common/fixtures/google/pkey.json +++ b/libcloud/test/common/fixtures/google/pkey.json @@ -1,6 +1,6 @@ { "private_key_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "private_key": "-----BEGIN PRIVATE KEY-----\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxx\n-----END PRIVATE KEY-----\n", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALskegl+DrI3Msw5\nZ63xnj1rgoPR0KykwBi+jZgAwHv/B0TJyhy6NuEnaf+x442L7lepOqoWQzlUGXyu\naSQU9mT/vHTGZ2xM8QJJaccr4eGho0MU9HePyNCFWjWVrGKpwSEAd6CLlzC0Wiy4\nkC9IoAUoS/IPjeyLTQNCddatgcARAgMBAAECgYAA/LlKJgeJUStTcpHgGD6mXjHv\nnAwWJELQKDP5+tA8VAQGwBX1G5qzJDGrPGtHQ7DSqdwF4YFZtgTpZmGq1wsAjz3l\nv6L4XiVsHiIPtP1B4gMxX9ogxcDzVQ7hyezXPioMAcp7Isus9Csn8HhftcL56BRa\nbn6GvWqbIAy6zJcgEQJBAMlZnymKW5/jKth+wkCfqEXlPhGNPO1uq87QZUbYxwdj\ntSM09J9+HMfH+WXR9ARCOL46DJ0IJfyjcdmuDDlh9IkCQQDt76up1Tmc7lkb/89I\nRBu2MudGJPMEf96VCG11nmcXulyk1OLiTXfO62YpxZbgYrvlrNxEYlSG7WQMztBg\nA51JAkBU2RhyJ+S+drsaaigvlVgSxCyotszi/Q0XZMgY18bfPUwanvkqsLkuEv3s\nw1HB7an9t3aTQdjIIpQad/acw8OJAkEAjvmnCK21KgTbjQShtQYgNNLPwImxcjG4\nOYvP4o6l2k9FHlNCZsQwSymOwWkXKYyK5g+CaKFBs7ZwmXWpJxjk6QJBAInqbm1w\n3yVfGD9I2mMQi/6oDJQP3pdWU4mU4h4sdDyRgTQLpkD4yypgjOACt4mTzxifSVT9\nfT+a79SkT8FFmZE=\n-----END PRIVATE KEY-----\n", "client_email": "foo@developer.gserviceaccount.com", "client_id": "foo.apps.googleusercontent.com", "type": "service_account" diff --git a/libcloud/test/common/fixtures/google/pkey.pem b/libcloud/test/common/fixtures/google/pkey.pem index 6e424862de..92357a86ec 100644 --- a/libcloud/test/common/fixtures/google/pkey.pem +++ b/libcloud/test/common/fixtures/google/pkey.pem @@ -1,15 +1,16 @@ ------BEGIN RSA PRIVATE KEY----- -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ------END RSA PRIVATE KEY----- +-----BEGIN PRIVATE KEY----- +MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALskegl+DrI3Msw5 +Z63xnj1rgoPR0KykwBi+jZgAwHv/B0TJyhy6NuEnaf+x442L7lepOqoWQzlUGXyu +aSQU9mT/vHTGZ2xM8QJJaccr4eGho0MU9HePyNCFWjWVrGKpwSEAd6CLlzC0Wiy4 +kC9IoAUoS/IPjeyLTQNCddatgcARAgMBAAECgYAA/LlKJgeJUStTcpHgGD6mXjHv +nAwWJELQKDP5+tA8VAQGwBX1G5qzJDGrPGtHQ7DSqdwF4YFZtgTpZmGq1wsAjz3l +v6L4XiVsHiIPtP1B4gMxX9ogxcDzVQ7hyezXPioMAcp7Isus9Csn8HhftcL56BRa +bn6GvWqbIAy6zJcgEQJBAMlZnymKW5/jKth+wkCfqEXlPhGNPO1uq87QZUbYxwdj +tSM09J9+HMfH+WXR9ARCOL46DJ0IJfyjcdmuDDlh9IkCQQDt76up1Tmc7lkb/89I +RBu2MudGJPMEf96VCG11nmcXulyk1OLiTXfO62YpxZbgYrvlrNxEYlSG7WQMztBg +A51JAkBU2RhyJ+S+drsaaigvlVgSxCyotszi/Q0XZMgY18bfPUwanvkqsLkuEv3s +w1HB7an9t3aTQdjIIpQad/acw8OJAkEAjvmnCK21KgTbjQShtQYgNNLPwImxcjG4 +OYvP4o6l2k9FHlNCZsQwSymOwWkXKYyK5g+CaKFBs7ZwmXWpJxjk6QJBAInqbm1w +3yVfGD9I2mMQi/6oDJQP3pdWU4mU4h4sdDyRgTQLpkD4yypgjOACt4mTzxifSVT9 +fT+a79SkT8FFmZE= +-----END PRIVATE KEY----- diff --git a/libcloud/test/common/fixtures/google/pkey_invalid.json b/libcloud/test/common/fixtures/google/pkey_invalid.json new file mode 100644 index 0000000000..79f0529da0 --- /dev/null +++ b/libcloud/test/common/fixtures/google/pkey_invalid.json @@ -0,0 +1,7 @@ +{ + "private_key_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "private_key": "-----BEGIN PRIVATE KEY-----\nMxxIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALskegl+DrI3Msw5\nZ63xnj1rgoPR0KykwBi+jZgAwHv/B0TJyhy6NuEnaf+x442L7lepOqoWQzlUGXyu\naSQU9mT/vHTGZ2xM8QJJaccr4eGho0MU9HePyNCFWjWVrGKpwSEAd6CLlzC0Wiy4\nkC9IoAUoS/IPjeyLTQNCddatgcARAgMBAAECgYAA/LlKJgeJUStTcpHgGD6mXjHv\nnAwWJELQKDP5+tA8VAQGwBX1G5qzJDGrPGtHQ7DSqdwF4YFZtgTpZmGq1wsAjz3l\nv6L4XiVsHiIPtP1B4gMxX9ogxcDzVQ7hyezXPioMAcp7Isus9Csn8HhftcL56BRa\nbn6GvWqbIAy6zJcgEQJBAMlZnymKW5/jKth+wkCfqEXlPhGNPO1uq87QZUbYxwdj\ntSM09J9+HMfH+WXR9ARCOL46DJ0IJfyjcdmuDDlh9IkCQQDt76up1Tmc7lkb/89I\nRBu2MudGJPMEf96VCG11nmcXulyk1OLiTXfO62YpxZbgYrvlrNxEYlSG7WQMztBg\nA51JAkBU2RhyJ+S+drsaaigvlVgSxCyotszi/Q0XZMgY18bfPUwanvkqsLkuEv3s\nw1HB7an9t3aTQdjIIpQad/acw8OJAkEAjvmnCK21KgTbjQShtQYgNNLPwImxcjG4\nOYvP4o6l2k9FHlNCZsQwSymOwWkXKYyK5g+CaKFBs7ZwmXWpJxjk6QJBAInqbm1w\n3yVfGD9I2mMQi/6oDJQP3pdWU4mU4h4sdDyRgTQLpkD4yypgjOACt4mTzxifSVT9\nfT+a79SE=\n-----END PRIVATE KEY-----\n", + "client_email": "foo@developer.gserviceaccount.com", + "client_id": "foo.apps.googleusercontent.com", + "type": "service_account" +} diff --git a/libcloud/test/common/fixtures/google/pkey_invalid.pem b/libcloud/test/common/fixtures/google/pkey_invalid.pem new file mode 100644 index 0000000000..44c3cba6f8 --- /dev/null +++ b/libcloud/test/common/fixtures/google/pkey_invalid.pem @@ -0,0 +1,16 @@ +-----BEGIN PRIVATE KEY----- +MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALskegl+DrI3Msw5 +Z63xnj1rgoPR0KykwBi+jZgAwHv/B0TJyhy6NuEnaf+x442L7lepOqoWQzlUGXyu +aSQU9mT/vHTGZ2xM8QJJaccr4eGho0MU9HePyNCFWjWVrGKpwSEAd6CLlzC0Wiy4 +kC9IoAUoS/IPjeyLTQNCddatgcARAgMBAAECgYAA/LlKJgeJUStTcpHgGD6mXjHv +nAwWJELQKDP5+tA8VAQGwBX1G5qzJDGrPGtHQ7DSqdwF4YFZtgTpZmGq1wsAjz3l +v6L4XiVsHiIPtP1B4gMxX9ogxcDzVQ7hyezXPioMAcp7Isus9Csn8HhftcL56BRa +bn6GvWqbIAy6zJcgEQJBAMlZnymKW5/jKth+wkCfqEXlPhGNPO1uq87QZUbYxwdj +tSM09J9+HMfH+WXR9ARCOL46DJ0IJfyjcdmuDDlh9IkCQQDt76up1Tmc7lkb/89I +RBu2MudGJPMEf96VCG11nmcXulyk1OLiTXfO62YpxZbgYrvlrNxEYlSG7WQMztBg +A51JAkBU2RhyJ+S+drsaaigvlVgSxCyotszi/Q0XZMgY18bfPUwanvkqsLkuEv3s +w1HB7an9t3aTQdjIIpQad/acw8OJAkEAjvmnCK21KgTbjQShtQYgNNLPwImxcjG4 +OYvP4o6l2k9FHlNCZsQwSymOwWkXKYyK5g+CaKFBs7ZwmXWpJxjk6QJBAInqbm1w +3yVfGD9I2mMQi/6oDJQP3pdWU4mU4h4sdDyRgTQLpkD4yypgjOACt4mTzxifSVT9 +fT+a79SkT8Fxxx +-----END PRIVATE KEY----- diff --git a/libcloud/test/common/test_aliyun.py b/libcloud/test/common/test_aliyun.py new file mode 100644 index 0000000000..a010ea681e --- /dev/null +++ b/libcloud/test/common/test_aliyun.py @@ -0,0 +1,55 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest + +from libcloud.test import LibcloudTestCase +from libcloud.common import aliyun +from libcloud.common.aliyun import AliyunRequestSignerAlgorithmV1_0 + + +class AliyunRequestSignerAlgorithmV1_0TestCase(LibcloudTestCase): + def setUp(self): + self.signer = AliyunRequestSignerAlgorithmV1_0("testid", "testsecret", "1.0") + + def test_sign_request(self): + params = { + "TimeStamp": "2012-12-26T10:33:56Z", + "Format": "XML", + "AccessKeyId": "testid", + "Action": "DescribeRegions", + "SignatureMethod": "HMAC-SHA1", + "RegionId": "region1", + "SignatureNonce": "NwDAxvLU6tFE0DVb", + "Version": "2014-05-26", + "SignatureVersion": "1.0", + } + method = "GET" + path = "/" + + expected = "K9fCVP6Jrklpd3rLYKh1pfrrFNo=" + self.assertEqual(expected, self.signer._sign_request(params, method, path)) + + +class AliyunCommonTestCase(LibcloudTestCase): + def test_percent_encode(self): + data = {"abc": "abc", " *~": "%20%2A~"} + for key in data: + self.assertEqual(data[key], aliyun._percent_encode(key)) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/common/test_aws.py b/libcloud/test/common/test_aws.py index 6661f7d71c..df3f18d400 100644 --- a/libcloud/test/common/test_aws.py +++ b/libcloud/test/common/test_aws.py @@ -1,177 +1,205 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import sys import unittest from datetime import datetime +from unittest import mock -import mock - -from libcloud.common.aws import SignedAWSConnection -from libcloud.common.aws import AWSRequestSignerAlgorithmV4 from libcloud.test import LibcloudTestCase +from libcloud.common.aws import UNSIGNED_PAYLOAD, SignedAWSConnection, AWSRequestSignerAlgorithmV4 -class EC2MockDriver(object): - region_name = 'my_region' +class EC2MockDriver: + region_name = "my_region" class AWSRequestSignerAlgorithmV4TestCase(LibcloudTestCase): - def setUp(self): SignedAWSConnection.driver = EC2MockDriver() - SignedAWSConnection.service_name = 'my_service' - SignedAWSConnection.version = '2013-10-15' - self.connection = SignedAWSConnection('my_key', 'my_secret') - - self.signer = AWSRequestSignerAlgorithmV4(access_key='my_key', - access_secret='my_secret', - version='2013-10-15', - connection=self.connection) + SignedAWSConnection.service_name = "my_service" + SignedAWSConnection.version = "2013-10-15" + self.connection = SignedAWSConnection("my_key", "my_secret") + + self.signer = AWSRequestSignerAlgorithmV4( + access_key="my_key", + access_secret="my_secret", + version="2013-10-15", + connection=self.connection, + ) - SignedAWSConnection.action = '/my_action/' + SignedAWSConnection.action = "/my_action/" SignedAWSConnection.driver = EC2MockDriver() self.now = datetime(2015, 3, 4, hour=17, minute=34, second=52) def test_v4_signature(self): - params = { - 'Action': 'DescribeInstances', - 'Version': '2013-10-15' - } + params = {"Action": "DescribeInstances", "Version": "2013-10-15"} headers = { - 'Host': 'ec2.eu-west-1.amazonaws.com', - 'Accept-Encoding': 'gzip,deflate', - 'X-AMZ-Date': '20150304T173452Z', - 'User-Agent': 'libcloud/0.17.0 (Amazon EC2 (eu-central-1)) ' + "Host": "ec2.eu-west-1.amazonaws.com", + "Accept-Encoding": "gzip,deflate", + "X-AMZ-Date": "20150304T173452Z", + "User-Agent": "libcloud/0.17.0 (Amazon EC2 (eu-central-1)) ", } dt = self.now - sig = self.signer._get_authorization_v4_header(params=params, - headers=headers, - dt=dt, - method='GET', - path='/my_action/') - self.assertEqual(sig, 'AWS4-HMAC-SHA256 ' - 'Credential=my_key/20150304/my_region/my_service/aws4_request, ' - 'SignedHeaders=accept-encoding;host;user-agent;x-amz-date, ' - 'Signature=f9868f8414b3c3f856c7955019cc1691265541f5162b9b772d26044280d39bd3') - - def test_v4_signature_raises_error_if_request_method_not_GET(self): - with self.assertRaises(Exception): - self.signer._get_authorization_v4_header(params={}, headers={}, - dt=self.now, method='POST') + sig = self.signer._get_authorization_v4_header( + params=params, headers=headers, dt=dt, method="GET", path="/my_action/" + ) + self.assertEqual( + sig, + "AWS4-HMAC-SHA256 " + "Credential=my_key/20150304/my_region/my_service/aws4_request, " + "SignedHeaders=accept-encoding;host;user-agent;x-amz-date, " + "Signature=f9868f8414b3c3f856c7955019cc1691265541f5162b9b772d26044280d39bd3", + ) def test_v4_signature_contains_user_id(self): - sig = self.signer._get_authorization_v4_header(params={}, headers={}, - dt=self.now) - self.assertIn('Credential=my_key/', sig) + sig = self.signer._get_authorization_v4_header(params={}, headers={}, dt=self.now) + self.assertIn("Credential=my_key/", sig) def test_v4_signature_contains_credential_scope(self): - with mock.patch('libcloud.common.aws.AWSRequestSignerAlgorithmV4._get_credential_scope') as mock_get_creds: - mock_get_creds.return_value = 'my_credential_scope' + with mock.patch( + "libcloud.common.aws.AWSRequestSignerAlgorithmV4._get_credential_scope" + ) as mock_get_creds: + mock_get_creds.return_value = "my_credential_scope" sig = self.signer._get_authorization_v4_header(params={}, headers={}, dt=self.now) - self.assertIn('Credential=my_key/my_credential_scope, ', sig) + self.assertIn("Credential=my_key/my_credential_scope, ", sig) def test_v4_signature_contains_signed_headers(self): - with mock.patch('libcloud.common.aws.AWSRequestSignerAlgorithmV4._get_signed_headers') as mock_get_headers: - mock_get_headers.return_value = 'my_signed_headers' - sig = self.signer._get_authorization_v4_header({}, {}, self.now, - method='GET', - path='/') - self.assertIn('SignedHeaders=my_signed_headers, ', sig) + with mock.patch( + "libcloud.common.aws.AWSRequestSignerAlgorithmV4._get_signed_headers" + ) as mock_get_headers: + mock_get_headers.return_value = "my_signed_headers" + sig = self.signer._get_authorization_v4_header({}, {}, self.now, method="GET", path="/") + self.assertIn("SignedHeaders=my_signed_headers, ", sig) def test_v4_signature_contains_signature(self): - with mock.patch('libcloud.common.aws.AWSRequestSignerAlgorithmV4._get_signature') as mock_get_signature: - mock_get_signature.return_value = 'my_signature' + with mock.patch( + "libcloud.common.aws.AWSRequestSignerAlgorithmV4._get_signature" + ) as mock_get_signature: + mock_get_signature.return_value = "my_signature" sig = self.signer._get_authorization_v4_header({}, {}, self.now) - self.assertIn('Signature=my_signature', sig) + self.assertIn("Signature=my_signature", sig) def test_get_signature_(self): def _sign(key, msg, hex=False): if hex: - return 'H|%s|%s' % (key, msg) + return "H|{}|{}".format(key, msg) else: - return '%s|%s' % (key, msg) - - with mock.patch('libcloud.common.aws.AWSRequestSignerAlgorithmV4._get_key_to_sign_with') as mock_get_key: - with mock.patch('libcloud.common.aws.AWSRequestSignerAlgorithmV4._get_string_to_sign') as mock_get_string: - with mock.patch('libcloud.common.aws._sign', new=_sign): - mock_get_key.return_value = 'my_signing_key' - mock_get_string.return_value = 'my_string_to_sign' - sig = self.signer._get_signature({}, {}, self.now, - method='GET', path='/') - - self.assertEqual(sig, 'H|my_signing_key|my_string_to_sign') + return "{}|{}".format(key, msg) + + with mock.patch( + "libcloud.common.aws.AWSRequestSignerAlgorithmV4._get_key_to_sign_with" + ) as mock_get_key: + with mock.patch( + "libcloud.common.aws.AWSRequestSignerAlgorithmV4._get_string_to_sign" + ) as mock_get_string: + with mock.patch("libcloud.common.aws._sign", new=_sign): + mock_get_key.return_value = "my_signing_key" + mock_get_string.return_value = "my_string_to_sign" + sig = self.signer._get_signature( + {}, {}, self.now, method="GET", path="/", data=None + ) + + self.assertEqual(sig, "H|my_signing_key|my_string_to_sign") def test_get_string_to_sign(self): - with mock.patch('hashlib.sha256') as mock_sha256: - mock_sha256.return_value.hexdigest.return_value = 'chksum_of_canonical_request' - to_sign = self.signer._get_string_to_sign({}, {}, self.now, - method='GET', path='/') - - self.assertEqual(to_sign, - 'AWS4-HMAC-SHA256\n' - '20150304T173452Z\n' - '20150304/my_region/my_service/aws4_request\n' - 'chksum_of_canonical_request') + with mock.patch("hashlib.sha256") as mock_sha256: + mock_sha256.return_value.hexdigest.return_value = "chksum_of_canonical_request" + to_sign = self.signer._get_string_to_sign( + {}, {}, self.now, method="GET", path="/", data=None + ) + + self.assertEqual( + to_sign, + "AWS4-HMAC-SHA256\n" + "20150304T173452Z\n" + "20150304/my_region/my_service/aws4_request\n" + "chksum_of_canonical_request", + ) def test_get_key_to_sign_with(self): def _sign(key, msg, hex=False): - return '%s|%s' % (key, msg) + return "{}|{}".format(key, msg) - with mock.patch('libcloud.common.aws._sign', new=_sign): + with mock.patch("libcloud.common.aws._sign", new=_sign): key = self.signer._get_key_to_sign_with(self.now) - self.assertEqual(key, 'AWS4my_secret|20150304|my_region|my_service|aws4_request') + self.assertEqual(key, "AWS4my_secret|20150304|my_region|my_service|aws4_request") def test_get_signed_headers_contains_all_headers_lowercased(self): - headers = {'Content-Type': 'text/plain', 'Host': 'my_host', 'X-Special-Header': ''} + headers = { + "Content-Type": "text/plain", + "Host": "my_host", + "X-Special-Header": "", + } signed_headers = self.signer._get_signed_headers(headers) - self.assertIn('content-type', signed_headers) - self.assertIn('host', signed_headers) - self.assertIn('x-special-header', signed_headers) + self.assertIn("content-type", signed_headers) + self.assertIn("host", signed_headers) + self.assertIn("x-special-header", signed_headers) def test_get_signed_headers_concats_headers_sorted_lexically(self): - headers = {'Host': 'my_host', 'X-Special-Header': '', '1St-Header': '2', 'Content-Type': 'text/plain'} + headers = { + "Host": "my_host", + "X-Special-Header": "", + "1St-Header": "2", + "Content-Type": "text/plain", + } signed_headers = self.signer._get_signed_headers(headers) - self.assertEqual(signed_headers, '1st-header;content-type;host;x-special-header') + self.assertEqual(signed_headers, "1st-header;content-type;host;x-special-header") def test_get_credential_scope(self): scope = self.signer._get_credential_scope(self.now) - self.assertEqual(scope, '20150304/my_region/my_service/aws4_request') + self.assertEqual(scope, "20150304/my_region/my_service/aws4_request") def test_get_canonical_headers_joins_all_headers(self): headers = { - 'accept-encoding': 'gzip,deflate', - 'host': 'my_host', + "accept-encoding": "gzip,deflate", + "host": "my_host", } - self.assertEqual(self.signer._get_canonical_headers(headers), - 'accept-encoding:gzip,deflate\n' - 'host:my_host\n') + self.assertEqual( + self.signer._get_canonical_headers(headers), + "accept-encoding:gzip,deflate\n" "host:my_host\n", + ) def test_get_canonical_headers_sorts_headers_lexically(self): headers = { - 'accept-encoding': 'gzip,deflate', - 'host': 'my_host', - '1st-header': '2', - 'x-amz-date': '20150304T173452Z', - 'user-agent': 'my-ua' + "accept-encoding": "gzip,deflate", + "host": "my_host", + "1st-header": "2", + "x-amz-date": "20150304T173452Z", + "user-agent": "my-ua", } - self.assertEqual(self.signer._get_canonical_headers(headers), - '1st-header:2\n' - 'accept-encoding:gzip,deflate\n' - 'host:my_host\n' - 'user-agent:my-ua\n' - 'x-amz-date:20150304T173452Z\n') + self.assertEqual( + self.signer._get_canonical_headers(headers), + "1st-header:2\n" + "accept-encoding:gzip,deflate\n" + "host:my_host\n" + "user-agent:my-ua\n" + "x-amz-date:20150304T173452Z\n", + ) def test_get_canonical_headers_lowercases_headers_names(self): - headers = { - 'Accept-Encoding': 'GZIP,DEFLATE', - 'User-Agent': 'My-UA' - } - self.assertEqual(self.signer._get_canonical_headers(headers), - 'accept-encoding:GZIP,DEFLATE\n' - 'user-agent:My-UA\n') + headers = {"Accept-Encoding": "GZIP,DEFLATE", "User-Agent": "My-UA"} + self.assertEqual( + self.signer._get_canonical_headers(headers), + "accept-encoding:GZIP,DEFLATE\n" "user-agent:My-UA\n", + ) def test_get_canonical_headers_trims_header_values(self): # TODO: according to AWS spec (and RFC 2616 Section 4.2.) excess whitespace @@ -179,61 +207,119 @@ def test_get_canonical_headers_trims_header_values(self): # start and end of the string. See # http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html headers = { - 'accept-encoding': ' gzip,deflate', - 'user-agent': 'libcloud/0.17.0 ' + "accept-encoding": " gzip,deflate", + "user-agent": "libcloud/0.17.0 ", } - self.assertEqual(self.signer._get_canonical_headers(headers), - 'accept-encoding:gzip,deflate\n' - 'user-agent:libcloud/0.17.0\n') + self.assertEqual( + self.signer._get_canonical_headers(headers), + "accept-encoding:gzip,deflate\n" "user-agent:libcloud/0.17.0\n", + ) def test_get_request_params_joins_params_sorted_lexically(self): - self.assertEqual(self.signer._get_request_params({ - 'Action': 'DescribeInstances', - 'Filter.1.Name': 'state', - 'Version': '2013-10-15' - }), - 'Action=DescribeInstances&Filter.1.Name=state&Version=2013-10-15') + self.assertEqual( + self.signer._get_request_params( + { + "Action": "DescribeInstances", + "Filter.1.Name": "state", + "Version": "2013-10-15", + } + ), + "Action=DescribeInstances&Filter.1.Name=state&Version=2013-10-15", + ) + + def test_get_canonical_headers_allow_numeric_header_value(self): + headers = {"Accept-Encoding": "gzip,deflate", "Content-Length": 314} + self.assertEqual( + self.signer._get_canonical_headers(headers), + "accept-encoding:gzip,deflate\n" "content-length:314\n", + ) def test_get_request_params_allows_integers_as_value(self): - self.assertEqual(self.signer._get_request_params({'Action': 'DescribeInstances', 'Port': 22}), - 'Action=DescribeInstances&Port=22') + self.assertEqual( + self.signer._get_request_params({"Action": "DescribeInstances", "Port": 22}), + "Action=DescribeInstances&Port=22", + ) def test_get_request_params_urlquotes_params_keys(self): - self.assertEqual(self.signer._get_request_params({'Action+Reaction': 'DescribeInstances'}), - 'Action%2BReaction=DescribeInstances') + self.assertEqual( + self.signer._get_request_params({"Action+Reaction": "DescribeInstances"}), + "Action%2BReaction=DescribeInstances", + ) def test_get_request_params_urlquotes_params_values(self): - self.assertEqual(self.signer._get_request_params({ - 'Action': 'DescribeInstances&Addresses', - 'Port-Range': '2000 3000' - }), - 'Action=DescribeInstances%26Addresses&Port-Range=2000%203000') + self.assertEqual( + self.signer._get_request_params( + {"Action": "DescribeInstances&Addresses", "Port-Range": "2000 3000"} + ), + "Action=DescribeInstances%26Addresses&Port-Range=2000%203000", + ) - def test_get_request_params_urlquotes_params_values_allows_safe_chars_in_value(self): + def test_get_request_params_urlquotes_params_values_allows_safe_chars_in_value( + self, + ): # http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html - self.assertEqual('Action=a~b.c_d-e', - self.signer._get_request_params({'Action': 'a~b.c_d-e'})) + self.assertEqual( + "Action=a~b.c_d-e", self.signer._get_request_params({"Action": "a~b.c_d-e"}) + ) def test_get_payload_hash_returns_digest_of_empty_string_for_GET_requests(self): - SignedAWSConnection.method = 'GET' - self.assertEqual(self.signer._get_payload_hash(), - 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855') + SignedAWSConnection.method = "GET" + self.assertEqual( + self.signer._get_payload_hash(method="GET"), + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + ) + + def test_get_payload_hash_with_data_for_PUT_requests(self): + SignedAWSConnection.method = "PUT" + self.assertEqual( + self.signer._get_payload_hash(method="PUT", data="DUMMY"), + "ceec12762e66397b56dad64fd270bb3d694c78fb9cd665354383c0626dbab013", + ) + + def test_get_payload_hash_with_empty_data_for_POST_requests(self): + SignedAWSConnection.method = "POST" + self.assertEqual(self.signer._get_payload_hash(method="POST"), UNSIGNED_PAYLOAD) def test_get_canonical_request(self): req = self.signer._get_canonical_request( - {'Action': 'DescribeInstances', 'Version': '2013-10-15'}, - {'Accept-Encoding': 'gzip,deflate', 'User-Agent': 'My-UA'}, - method='GET', - path='/my_action/' - ) - self.assertEqual(req, 'GET\n' - '/my_action/\n' - 'Action=DescribeInstances&Version=2013-10-15\n' - 'accept-encoding:gzip,deflate\n' - 'user-agent:My-UA\n' - '\n' - 'accept-encoding;user-agent\n' - 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855') - -if __name__ == '__main__': + {"Action": "DescribeInstances", "Version": "2013-10-15"}, + {"Accept-Encoding": "gzip,deflate", "User-Agent": "My-UA"}, + method="GET", + path="/my_action/", + data=None, + ) + self.assertEqual( + req, + "GET\n" + "/my_action/\n" + "Action=DescribeInstances&Version=2013-10-15\n" + "accept-encoding:gzip,deflate\n" + "user-agent:My-UA\n" + "\n" + "accept-encoding;user-agent\n" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + ) + + def test_post_canonical_request(self): + req = self.signer._get_canonical_request( + {"Action": "DescribeInstances", "Version": "2013-10-15"}, + {"Accept-Encoding": "gzip,deflate", "User-Agent": "My-UA"}, + method="POST", + path="/my_action/", + data="{}", + ) + self.assertEqual( + req, + "POST\n" + "/my_action/\n" + "Action=DescribeInstances&Version=2013-10-15\n" + "accept-encoding:gzip,deflate\n" + "user-agent:My-UA\n" + "\n" + "accept-encoding;user-agent\n" + "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a", + ) + + +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/common/test_azure.py b/libcloud/test/common/test_azure.py new file mode 100644 index 0000000000..9f7b3c0400 --- /dev/null +++ b/libcloud/test/common/test_azure.py @@ -0,0 +1,64 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest + +from libcloud.test import LibcloudTestCase +from libcloud.common.azure import AzureConnection + + +class AzureConnectionTestCase(LibcloudTestCase): + def setUp(self): + self.conn = AzureConnection("user", "key") + + def test_content_length_is_used_if_set(self): + headers = {"content-length": "123"} + method = "PUT" + + values = self.conn._format_special_header_values(headers, method) + + self.assertEqual(values[2], "123") + + def test_content_length_is_blank_if_new_api_version(self): + headers = {} + method = "PUT" + self.conn.API_VERSION = "2018-11-09" + + values = self.conn._format_special_header_values(headers, method) + + self.assertEqual(values[2], "") + + def test_content_length_is_zero_if_write_and_old_api_version(self): + headers = {} + method = "PUT" + self.conn.API_VERSION = "2011-08-18" + + values = self.conn._format_special_header_values(headers, method) + + self.assertEqual(values[2], "0") + + def test_content_length_is_blank_if_read_and_old_api_version(self): + headers = {} + method = "GET" + self.conn.API_VERSION = "2011-08-18" + + values = self.conn._format_special_header_values(headers, method) + + self.assertEqual(values[2], "") + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/common/test_base.py b/libcloud/test/common/test_base.py new file mode 100644 index 0000000000..5dd7dcb63c --- /dev/null +++ b/libcloud/test/common/test_base.py @@ -0,0 +1,107 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest +from unittest import mock + +from libcloud.test import LibcloudTestCase +from libcloud.common.base import Response, LazyObject +from libcloud.common.exceptions import BaseHTTPError, RateLimitReachedError + + +class LazyObjectTest(LibcloudTestCase): + class A(LazyObject): + def __init__(self, x, y=None): + self.x = x + self.y = y + + def test_lazy_init(self): + # Test normal init + a = self.A(1, y=2) + self.assertTrue(isinstance(a, self.A)) + + # Test lazy init + with mock.patch.object(self.A, "__init__", return_value=None) as mock_init: + a = self.A.lazy(3, y=4) + self.assertTrue(isinstance(a, self.A)) # Proxy is a subclass of A + mock_init.assert_not_called() + + # Since we have a mock init, an A object doesn't actually get + # created. But, we can still call __dict__ on the proxy, which will + # init the lazy object. + self.assertEqual(a.__dict__, {}) + mock_init.assert_called_once_with(3, y=4) + + def test_setattr(self): + a = self.A.lazy("foo", y="bar") + a.z = "baz" + wrapped_lazy_obj = object.__getattribute__(a, "_lazy_obj") + self.assertEqual(a.z, "baz") + self.assertEqual(wrapped_lazy_obj.z, "baz") + + +class ErrorResponseTest(LibcloudTestCase): + def mock_response(self, code, headers={}): + m = mock.MagicMock() + m.request = mock.Mock() + m.headers = headers + m.status_code = code + m.text = None + return m + + def test_rate_limit_response(self): + resp_mock = self.mock_response(429, {"Retry-After": "120"}) + try: + Response(resp_mock, mock.MagicMock()) + except RateLimitReachedError as e: + self.assertEqual(e.retry_after, 120) + except Exception: + # We should have got a RateLimitReachedError + self.fail("Caught exception should have been RateLimitReachedError") + else: + # We should have got an exception + self.fail("HTTP Status 429 response didn't raised an exception") + + def test_error_with_retry_after(self): + # 503 Service Unavailable may include Retry-After header + resp_mock = self.mock_response(503, {"Retry-After": "300"}) + try: + Response(resp_mock, mock.MagicMock()) + except BaseHTTPError as e: + self.assertIn("retry-after", e.headers) + self.assertEqual(e.headers["retry-after"], "300") + else: + # We should have got an exception + self.fail("HTTP Status 503 response didn't raised an exception") + + @mock.patch("time.time", return_value=1231006505) + def test_error_with_retry_after_http_date_format(self, time_mock): + retry_after = "Sat, 03 Jan 2009 18:20:05 -0000" + # 503 Service Unavailable may include Retry-After header + resp_mock = self.mock_response(503, {"Retry-After": retry_after}) + try: + Response(resp_mock, mock.MagicMock()) + except BaseHTTPError as e: + self.assertIn("retry-after", e.headers) + # HTTP-date got translated to delay-secs + self.assertEqual(e.headers["retry-after"], "300") + else: + # We should have got an exception + self.fail("HTTP Status 503 response didn't raised an exception") + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/common/test_base_driver.py b/libcloud/test/common/test_base_driver.py new file mode 100644 index 0000000000..86c26a2352 --- /dev/null +++ b/libcloud/test/common/test_base_driver.py @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +from unittest.mock import Mock + +from libcloud.test import unittest +from libcloud.common.base import BaseDriver + + +class BaseDriverTestCase(unittest.TestCase): + def test_timeout_argument_propagation_and_preservation(self): + class DummyDriver1(BaseDriver): + pass + + # 1. No timeout provided + DummyDriver1.connectionCls = Mock() + DummyDriver1(key="foo") + call_kwargs = DummyDriver1.connectionCls.call_args[1] + self.assertIsNone(call_kwargs["timeout"]) + self.assertIsNone(call_kwargs["retry_delay"]) + + # 2. Timeout provided as constructor argument + class DummyDriver1(BaseDriver): + pass + + DummyDriver1.connectionCls = Mock() + DummyDriver1(key="foo", timeout=12) + call_kwargs = DummyDriver1.connectionCls.call_args[1] + self.assertEqual(call_kwargs["timeout"], 12) + self.assertIsNone(call_kwargs["retry_delay"]) + + # 3. timeout provided via "_ex_connection_class_kwargs" method + class DummyDriver2(BaseDriver): + def _ex_connection_class_kwargs(self): + result = {} + result["timeout"] = 13 + return result + + DummyDriver2.connectionCls = Mock() + DummyDriver2(key="foo") + call_kwargs = DummyDriver2.connectionCls.call_args[1] + + # 4. Value provided via "_ex_connection_class_kwargs" and constructor, + # constructor should win + DummyDriver2.connectionCls = Mock() + DummyDriver2(key="foo", timeout=14, retry_delay=10) + call_kwargs = DummyDriver2.connectionCls.call_args[1] + self.assertEqual(call_kwargs["timeout"], 14) + self.assertEqual(call_kwargs["retry_delay"], 10) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/common/test_cloudstack.py b/libcloud/test/common/test_cloudstack.py index 2412d5cd92..ad49df9076 100644 --- a/libcloud/test/common/test_cloudstack.py +++ b/libcloud/test/common/test_cloudstack.py @@ -16,195 +16,180 @@ import sys import unittest +from libcloud.test import MockHttp +from libcloud.utils.py3 import b, httplib, urlparse, parse_qsl +from libcloud.common.types import MalformedResponseError +from libcloud.common.cloudstack import CloudStackConnection + try: import simplejson as json except ImportError: import json -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlparse -from libcloud.utils.py3 import b -from libcloud.utils.py3 import parse_qsl - -from libcloud.common.cloudstack import CloudStackConnection -from libcloud.common.types import MalformedResponseError - -from libcloud.test import MockHttpTestCase - async_delay = 0 -class CloudStackMockDriver(object): - host = 'nonexistent.' - path = '/path' +class CloudStackMockDriver: + host = "nonexistent." + path = "/path" async_poll_frequency = 0 - name = 'fake' + name = "fake" async_delay = 0 class CloudStackCommonTest(unittest.TestCase): def setUp(self): - CloudStackConnection.conn_classes = (None, CloudStackMockHttp) - self.connection = CloudStackConnection('apikey', 'secret', - host=CloudStackMockDriver.host) + CloudStackConnection.conn_class = CloudStackMockHttp + self.connection = CloudStackConnection("apikey", "secret", host=CloudStackMockDriver.host) self.connection.poll_interval = 0.0 self.driver = self.connection.driver = CloudStackMockDriver() def test_sync_request_bad_response(self): - self.driver.path = '/bad/response' + self.driver.path = "/bad/response" try: - self.connection._sync_request('fake') - except Exception: - e = sys.exc_info()[1] + self.connection._sync_request("fake") + except Exception as e: self.assertTrue(isinstance(e, MalformedResponseError)) return self.assertTrue(False) def test_sync_request(self): - self.driver.path = '/sync' - self.connection._sync_request('fake') + self.driver.path = "/sync" + self.connection._sync_request("fake") def test_async_request_successful(self): - self.driver.path = '/async/success' - result = self.connection._async_request('fake') - self.assertEqual(result, {'fake': 'result'}) + self.driver.path = "/async/success" + result = self.connection._async_request("fake") + self.assertEqual(result, {"fake": "result"}) def test_async_request_unsuccessful(self): - self.driver.path = '/async/fail' + self.driver.path = "/async/fail" try: - self.connection._async_request('fake') - except Exception: - e = sys.exc_info()[1] + self.connection._async_request("fake") + except Exception as e: self.assertEqual(CloudStackMockHttp.ERROR_TEXT, str(e)) return self.assertFalse(True) def test_async_request_delayed(self): global async_delay - self.driver.path = '/async/delayed' + self.driver.path = "/async/delayed" async_delay = 2 - self.connection._async_request('fake') + self.connection._async_request("fake") self.assertEqual(async_delay, 0) def test_signature_algorithm(self): cases = [ + ({"command": "listVirtualMachines"}, "z/a9Y7J52u48VpqIgiwaGUMCso0="), ( { - 'command': 'listVirtualMachines' - }, 'z/a9Y7J52u48VpqIgiwaGUMCso0=' - ), ( - { - 'command': 'deployVirtualMachine', - 'name': 'fred', - 'displayname': 'George', - 'serviceofferingid': 5, - 'templateid': 17, - 'zoneid': 23, - 'networkids': 42 - }, 'gHTo7mYmadZ+zluKHzlEKb1i/QU=' - ), ( + "command": "deployVirtualMachine", + "name": "fred", + "displayname": "George", + "serviceofferingid": 5, + "templateid": 17, + "zoneid": 23, + "networkids": 42, + }, + "gHTo7mYmadZ+zluKHzlEKb1i/QU=", + ), + ( { - 'command': 'deployVirtualMachine', - 'name': 'fred', - 'displayname': 'George+Ringo', - 'serviceofferingid': 5, - 'templateid': 17, - 'zoneid': 23, - 'networkids': 42 - }, 'tAgfrreI1ZvWlWLClD3gu4+aKv4=' - ) + "command": "deployVirtualMachine", + "name": "fred", + "displayname": "George+Ringo", + "serviceofferingid": 5, + "templateid": 17, + "zoneid": 23, + "networkids": 42, + }, + "tAgfrreI1ZvWlWLClD3gu4+aKv4=", + ), ] - connection = CloudStackConnection('fnord', 'abracadabra') + connection = CloudStackConnection("fnord", "abracadabra") for case in cases: params = connection.add_default_params(case[0]) self.assertEqual(connection._make_signature(params), b(case[1])) -class CloudStackMockHttp(MockHttpTestCase): - - ERROR_TEXT = 'ERROR TEXT' +class CloudStackMockHttp(MockHttp, unittest.TestCase): + ERROR_TEXT = "ERROR TEXT" def _response(self, status, result, response): - return (status, json.dumps(result), result, response) + return (status, json.dumps(result), {}, response) def _check_request(self, url): url = urlparse.urlparse(url) query = dict(parse_qsl(url.query)) - self.assertTrue('apiKey' in query) - self.assertTrue('command' in query) - self.assertTrue('response' in query) - self.assertTrue('signature' in query) + self.assertTrue("apiKey" in query) + self.assertTrue("command" in query) + self.assertTrue("response" in query) + self.assertTrue("signature" in query) - self.assertTrue(query['response'] == 'json') + self.assertTrue(query["response"] == "json") return query def _bad_response(self, method, url, body, headers): self._check_request(url) - result = {'success': True} + result = {"success": True} return self._response(httplib.OK, result, httplib.responses[httplib.OK]) def _sync(self, method, url, body, headers): query = self._check_request(url) - result = {query['command'].lower() + 'response': {}} + result = {query["command"].lower() + "response": {}} return self._response(httplib.OK, result, httplib.responses[httplib.OK]) def _async_success(self, method, url, body, headers): query = self._check_request(url) - if query['command'].lower() == 'queryasyncjobresult': - self.assertEqual(query['jobid'], '42') + if query["command"].lower() == "queryasyncjobresult": + self.assertEqual(query["jobid"], "42") result = { - query['command'].lower() + 'response': { - 'jobstatus': 1, - 'jobresult': {'fake': 'result'} - } + query["command"].lower() + + "response": {"jobstatus": 1, "jobresult": {"fake": "result"}} } else: - result = {query['command'].lower() + 'response': {'jobid': '42'}} + result = {query["command"].lower() + "response": {"jobid": "42"}} return self._response(httplib.OK, result, httplib.responses[httplib.OK]) def _async_fail(self, method, url, body, headers): query = self._check_request(url) - if query['command'].lower() == 'queryasyncjobresult': - self.assertEqual(query['jobid'], '42') + if query["command"].lower() == "queryasyncjobresult": + self.assertEqual(query["jobid"], "42") result = { - query['command'].lower() + 'response': { - 'jobstatus': 2, - 'jobresult': {'errortext': self.ERROR_TEXT} + query["command"].lower() + + "response": { + "jobstatus": 2, + "jobresult": {"errortext": self.ERROR_TEXT}, } } else: - result = {query['command'].lower() + 'response': {'jobid': '42'}} + result = {query["command"].lower() + "response": {"jobid": "42"}} return self._response(httplib.OK, result, httplib.responses[httplib.OK]) def _async_delayed(self, method, url, body, headers): global async_delay query = self._check_request(url) - if query['command'].lower() == 'queryasyncjobresult': - self.assertEqual(query['jobid'], '42') + if query["command"].lower() == "queryasyncjobresult": + self.assertEqual(query["jobid"], "42") if async_delay == 0: result = { - query['command'].lower() + 'response': { - 'jobstatus': 1, - 'jobresult': {'fake': 'result'} - } + query["command"].lower() + + "response": {"jobstatus": 1, "jobresult": {"fake": "result"}} } else: - result = { - query['command'].lower() + 'response': { - 'jobstatus': 0, - } - } + result = {query["command"].lower() + "response": {"jobstatus": 0}} async_delay -= 1 else: - result = {query['command'].lower() + 'response': {'jobid': '42'}} + result = {query["command"].lower() + "response": {"jobid": "42"}} return self._response(httplib.OK, result, httplib.responses[httplib.OK]) -if __name__ == '__main__': + +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/common/test_digitalocean_v2.py b/libcloud/test/common/test_digitalocean_v2.py new file mode 100644 index 0000000000..957f7a66bc --- /dev/null +++ b/libcloud/test/common/test_digitalocean_v2.py @@ -0,0 +1,121 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and + +import sys +import unittest + +from libcloud.http import LibcloudConnection +from libcloud.test import MockHttp, LibcloudTestCase +from libcloud.utils.py3 import httplib +from libcloud.common.types import InvalidCredsError +from libcloud.test.secrets import DIGITALOCEAN_v2_PARAMS +from libcloud.test.file_fixtures import FileFixtures +from libcloud.common.digitalocean import DigitalOceanBaseDriver, DigitalOcean_v2_BaseDriver + + +class DigitalOceanTests(LibcloudTestCase): + def setUp(self): + DigitalOceanBaseDriver.connectionCls.conn_class = DigitalOceanCommonMockHttp + DigitalOcean_v2_BaseDriver.connectionCls.conn_class = DigitalOceanCommonMockHttp + DigitalOceanCommonMockHttp.type = None + self.driver = DigitalOceanBaseDriver(*DIGITALOCEAN_v2_PARAMS) + + def tearDown(self): + LibcloudConnection.type = None + DigitalOceanCommonMockHttp.type = None + + def test_authentication(self): + DigitalOceanCommonMockHttp.type = "UNAUTHORIZED" + self.assertRaises(InvalidCredsError, self.driver.ex_account_info) + + def test_ex_account_info(self): + account_info = self.driver.ex_account_info() + self.assertEqual(account_info["uuid"], "a1234567890b1234567890c1234567890d12345") + self.assertTrue(account_info["email_verified"]) + self.assertEqual(account_info["email"], "user@domain.tld") + self.assertEqual(account_info["droplet_limit"], 10) + + def test_ex_list_events(self): + events = self.driver.ex_list_events() + self.assertEqual(events, []) + + def test_ex_get_event(self): + action = self.driver.ex_get_event("12345670") + self.assertEqual(action["id"], 12345670) + self.assertEqual(action["status"], "completed") + self.assertEqual(action["type"], "power_on") + + def test__paginated_request(self): + DigitalOceanCommonMockHttp.type = "page_1" + actions = self.driver._paginated_request("/v2/actions", "actions") + self.assertEqual(actions[0]["id"], 12345671) + self.assertEqual(actions[0]["status"], "completed") + + +class DigitalOceanCommonMockHttp(MockHttp): + fixtures = FileFixtures("common", "digitalocean") + + response = { + None: httplib.OK, + "CREATE": httplib.CREATED, + "DELETE": httplib.NO_CONTENT, + "EMPTY": httplib.OK, + "NOT_FOUND": httplib.NOT_FOUND, + "UNAUTHORIZED": httplib.UNAUTHORIZED, + "UPDATE": httplib.OK, + } + + def _v2_account(self, method, url, body, headers): + body = self.fixtures.load("_v2_account.json") + return ( + self.response[self.type], + body, + {}, + httplib.responses[self.response[self.type]], + ) + + def _v2_account_UNAUTHORIZED(self, method, url, body, headers): + body = self.fixtures.load("_v2_account_UNAUTHORIZED.json") + return ( + self.response[self.type], + body, + {}, + httplib.responses[self.response[self.type]], + ) + + def _v2_actions(self, method, url, body, headers): + body = self.fixtures.load("_v2_actions.json") + return ( + self.response[self.type], + body, + {}, + httplib.responses[self.response[self.type]], + ) + + def _v2_actions_12345670(self, method, url, body, headers): + body = self.fixtures.load("_v2_actions_12345670.json") + return ( + self.response[self.type], + body, + {}, + httplib.responses[self.response[self.type]], + ) + + def _v2_actions_page_1(self, method, url, body, headers): + body = self.fixtures.load("_v2_actions_page_1.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/common/test_gandi.py b/libcloud/test/common/test_gandi.py index d0dfc9dd8e..15a768cb7f 100644 --- a/libcloud/test/common/test_gandi.py +++ b/libcloud/test/common/test_gandi.py @@ -13,18 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -from libcloud.utils.py3 import xmlrpclib from libcloud.test import MockHttp +from libcloud.utils.py3 import xmlrpclib class BaseGandiMockHttp(MockHttp): - def _get_method_name(self, type, use_param, qs, path): return "_xmlrpc" def _xmlrpc(self, method, url, body, headers): params, methodName = xmlrpclib.loads(body) - meth_name = '_xmlrpc__' + methodName.replace('.', '_') + meth_name = "_xmlrpc__" + methodName.replace(".", "_") if self.type: - meth_name = '%s_%s' % (meth_name, self.type) + meth_name = "{}_{}".format(meth_name, self.type) return getattr(self, meth_name)(method, url, body, headers) diff --git a/libcloud/test/common/test_gandi_live.py b/libcloud/test/common/test_gandi_live.py new file mode 100644 index 0000000000..5e532ecd91 --- /dev/null +++ b/libcloud/test/common/test_gandi_live.py @@ -0,0 +1,29 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import re + +from libcloud.test import MockHttp + +FORMAT_URL = re.compile(r"[./?=-]") + + +class BaseGandiLiveMockHttp(MockHttp): + def _get_method_name(self, type, use_param, qs, path): + return "_json" + + def _json(self, method, url, body, headers): + meth_name = "_json{}_{}".format(FORMAT_URL.sub("_", url), method.lower()) + return getattr(self, meth_name)(method, url, body, headers) diff --git a/libcloud/test/common/test_google.py b/libcloud/test/common/test_google.py index 1f1f2ef6af..101487568b 100644 --- a/libcloud/test/common/test_google.py +++ b/libcloud/test/common/test_google.py @@ -15,30 +15,43 @@ """ Tests for Google Connection classes. """ -import datetime + +import os import sys +import time +import random +import urllib +import datetime import unittest -import os +import threading +from unittest import mock + +import requests + +from libcloud.test import MockHttp, LibcloudTestCase +from libcloud.utils.py3 import httplib +from libcloud.common.google import ( + GoogleAuthType, + GoogleAuthError, + GoogleBaseConnection, + GoogleOAuth2Credential, + GoogleBaseAuthConnection, + GoogleServiceAcctAuthConnection, + GoogleInstalledAppAuthConnection, + GoogleGCEServiceAcctAuthConnection, + _utcnow, + _utc_timestamp, +) try: import simplejson as json except ImportError: import json -from libcloud.utils.py3 import httplib - -from libcloud.test import MockHttp, LibcloudTestCase -from libcloud.common.google import (GoogleAuthError, - GoogleBaseAuthConnection, - GoogleInstalledAppAuthConnection, - GoogleServiceAcctAuthConnection, - GoogleGCEServiceAcctAuthConnection, - GoogleBaseConnection) - -# Skip some tests if PyCrypto is unavailable +# Skip some tests if cryptography is unavailable try: - from Crypto.Hash import SHA256 + from cryptography.hazmat.primitives.hashes import SHA256 except ImportError: SHA256 = None @@ -46,200 +59,493 @@ SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__)) PEM_KEY = os.path.join(SCRIPT_PATH, "fixtures", "google", "pkey.pem") JSON_KEY = os.path.join(SCRIPT_PATH, "fixtures", "google", "pkey.json") -with open(JSON_KEY, 'r') as f: - KEY_STR = json.loads(f.read())['private_key'] +JSON_KEY_INVALID = os.path.join(SCRIPT_PATH, "fixtures", "google", "pkey_invalid.json") +with open(JSON_KEY) as f: + KEY_STR = json.loads(f.read())["private_key"] + + +GCE_PARAMS = ("email@developer.gserviceaccount.com", "key") +GCE_PARAMS_PEM_KEY = ("email@developer.gserviceaccount.com", PEM_KEY) +GCE_PARAMS_JSON_KEY = ("email@developer.gserviceaccount.com", JSON_KEY) +GCE_PARAMS_KEY = ("email@developer.gserviceaccount.com", KEY_STR) +GCE_PARAMS_IA = ("client_id", "client_secret") +GCE_PARAMS_IA_2 = ("client_id@test.apps.googleusercontent.com", "client_secret") +GCE_PARAMS_GCE = ("foo", "bar") +# GOOG + 16 alphanumeric chars +GCS_S3_PARAMS_20 = ( + "GOOG0123456789ABCXYZ", + # 40 base64 chars + "0102030405060708091011121314151617181920", +) +# GOOG + 20 alphanumeric chars +GCS_S3_PARAMS_24 = ( + "GOOGDF5OVRRGU4APFNSTVCXI", + # 40 base64 chars + "0102030405060708091011121314151617181920", +) +# GOOG + 57 alphanumeric chars +GCS_S3_PARAMS_61 = ( + "GOOGDF5OVRRGU4APFNSTVCXIRRGU4AP56789ABCX56789ABCXRRGU4APFNSTV", + # 40 base64 chars + "0102030405060708091011121314151617181920", +) +PEM_KEY_FILE = os.path.join(SCRIPT_PATH, "fixtures", "google", "pkey.pem") +PEM_KEY_FILE_INVALID = os.path.join(SCRIPT_PATH, "fixtures", "google", "pkey_invalid.pem") + +JSON_KEY_FILE = os.path.join(SCRIPT_PATH, "fixtures", "google", "pkey.json") + +with open(JSON_KEY_FILE) as f: + PEM_KEY_STR = json.loads(f.read())["private_key"] + +with open(JSON_KEY_FILE) as f: + JSON_KEY_STR = f.read() + JSON_KEY = json.loads(JSON_KEY_STR) + + +GCE_USERID_EMAIL = "email@developer.gserviceaccount.com" +GCE_PARAMS = (GCE_USERID_EMAIL, "key") +GCE_PARAMS_PEM_KEY_FILE = (GCE_USERID_EMAIL, PEM_KEY_FILE) +GCE_PARAMS_PEM_KEY_FILE_INVALID = (GCE_USERID_EMAIL, PEM_KEY_FILE_INVALID) +GCE_PARAMS_PEM_KEY = (GCE_USERID_EMAIL, PEM_KEY_STR) +GCE_PARAMS_JSON_KEY_FILE = (GCE_USERID_EMAIL, JSON_KEY_FILE) +GCE_PARAMS_JSON_KEY = (GCE_USERID_EMAIL, JSON_KEY) +GCE_PARAMS_JSON_KEY_INVALID = (GCE_USERID_EMAIL, JSON_KEY_INVALID) +GCE_PARAMS_JSON_KEY_STR = (GCE_USERID_EMAIL, JSON_KEY_STR) +GCE_PARAMS_IA = ("client_id", "client_secret") +GCE_PARAMS_GCE = ("foo", "bar") +GCS_S3_PARAMS_20 = ( + "GOOG0123456789ABCXYZ", # GOOG + 16 alphanumeric chars + "0102030405060708091011121314151617181920", +) # 40 base64 chars +GCS_S3_PARAMS_24 = ( + "GOOGDF5OVRRGU4APFNSTVCXI", # GOOG + 20 alphanumeric chars + "0102030405060708091011121314151617181920", +) # 40 base64 chars + +STUB_UTCNOW = _utcnow() + +STUB_TOKEN = {"access_token": "tokentoken", "token_type": "Bearer", "expires_in": 3600} + +STUB_IA_TOKEN = { + "access_token": "installedapp", + "token_type": "Bearer", + "expires_in": 3600, + "refresh_token": "refreshrefresh", +} + +STUB_REFRESH_TOKEN = { + "access_token": "refreshrefresh", + "token_type": "Bearer", + "expires_in": 3600, +} + +STUB_TOKEN_FROM_FILE = { + "access_token": "token_from_file", + "token_type": "Bearer", + "expire_time": _utc_timestamp(STUB_UTCNOW + datetime.timedelta(seconds=3600)), + "expires_in": 3600, +} + + +class MockJsonResponse: + def __init__(self, body): + self.object = body -GCE_PARAMS = ('email@developer.gserviceaccount.com', 'key') -GCE_PARAMS_PEM_KEY = ('email@developer.gserviceaccount.com', PEM_KEY) -GCE_PARAMS_JSON_KEY = ('email@developer.gserviceaccount.com', JSON_KEY) -GCE_PARAMS_KEY = ('email@developer.gserviceaccount.com', KEY_STR) -GCE_PARAMS_IA = ('client_id', 'client_secret') -GCE_PARAMS_GCE = ('foo', 'bar') +class GoogleTestCase(LibcloudTestCase): + """ + Assists in making Google tests hermetic and deterministic. + Add anything that needs to be mocked here. Create a patcher with the + suffix '_patcher'. -class MockJsonResponse(object): - def __init__(self, body): - self.object = body + e.g. + _foo_patcher = mock.patch('module.submodule.class.foo', ...) + Patchers are started at setUpClass and stopped at tearDownClass. -class GoogleBaseAuthConnectionTest(LibcloudTestCase): + Ideally, you should make a note in the thing being mocked, for clarity. + """ + + PATCHER_SUFFIX = "_patcher" + + _utcnow_patcher = mock.patch("libcloud.common.google._utcnow", return_value=STUB_UTCNOW) + + _authtype_is_gce_patcher = mock.patch( + "libcloud.common.google.GoogleAuthType._is_gce", return_value=False + ) + + _read_token_file_patcher = mock.patch( + "libcloud.common.google.GoogleOAuth2Credential._get_token_from_file", + return_value=STUB_TOKEN_FROM_FILE, + ) + + _write_token_file_patcher = mock.patch( + "libcloud.common.google.GoogleOAuth2Credential._write_token_to_file" + ) + + @classmethod + def setUpClass(cls): + super().setUpClass() + + for patcher in [a for a in dir(cls) if a.endswith(cls.PATCHER_SUFFIX)]: + getattr(cls, patcher).start() + + @classmethod + def tearDownClass(cls): + super().tearDownClass() + + for patcher in [a for a in dir(cls) if a.endswith(cls.PATCHER_SUFFIX)]: + getattr(cls, patcher).stop() + + +class GoogleBaseAuthConnectionTest(GoogleTestCase): """ Tests for GoogleBaseAuthConnection """ - GoogleBaseAuthConnection._now = lambda x: datetime.datetime(2013, 6, 26, - 19, 0, 0) def setUp(self): - GoogleBaseAuthConnection.conn_classes = (GoogleAuthMockHttp, - GoogleAuthMockHttp) - self.mock_scopes = ['foo', 'bar'] - kwargs = {'scopes': self.mock_scopes} - self.conn = GoogleInstalledAppAuthConnection(*GCE_PARAMS, - **kwargs) + GoogleBaseAuthConnection.conn_class = GoogleAuthMockHttp + self.mock_scopes = ["foo", "bar"] + kwargs = {"scopes": self.mock_scopes} + self.conn = GoogleInstalledAppAuthConnection(*GCE_PARAMS, **kwargs) def test_scopes(self): - self.assertEqual(self.conn.scopes, 'foo bar') + self.assertEqual(self.conn.scopes, "foo bar") def test_add_default_headers(self): old_headers = {} expected_headers = { - 'Content-Type': 'application/x-www-form-urlencoded', - 'Host': 'accounts.google.com'} + "Content-Type": "application/x-www-form-urlencoded", + "Host": "accounts.google.com", + } new_headers = self.conn.add_default_headers(old_headers) self.assertEqual(new_headers, expected_headers) def test_token_request(self): - request_body = {'code': 'asdf', 'client_id': self.conn.user_id, - 'client_secret': self.conn.key, - 'redirect_uri': self.conn.redirect_uri, - 'grant_type': 'authorization_code'} + request_body = { + "code": "asdf", + "client_id": self.conn.user_id, + "client_secret": self.conn.key, + "redirect_uri": self.conn.redirect_uri, + "grant_type": "authorization_code", + } new_token = self.conn._token_request(request_body) - self.assertEqual(new_token['access_token'], 'installedapp') - self.assertEqual(new_token['expire_time'], '2013-06-26T20:00:00Z') + self.assertEqual(new_token["access_token"], STUB_IA_TOKEN["access_token"]) + exp = STUB_UTCNOW + datetime.timedelta(seconds=STUB_IA_TOKEN["expires_in"]) + self.assertEqual(new_token["expire_time"], _utc_timestamp(exp)) -class GoogleInstalledAppAuthConnectionTest(LibcloudTestCase): +class GoogleInstalledAppAuthConnectionTest(GoogleTestCase): """ Tests for GoogleInstalledAppAuthConnection """ - GoogleInstalledAppAuthConnection.get_code = lambda x: '1234' + + _ia_get_code_patcher = mock.patch( + "libcloud.common.google.GoogleInstalledAppAuthConnection.get_code", + return_value=1234, + ) def setUp(self): - GoogleInstalledAppAuthConnection.conn_classes = (GoogleAuthMockHttp, - GoogleAuthMockHttp) - self.mock_scopes = ['https://www.googleapis.com/auth/foo'] - kwargs = {'scopes': self.mock_scopes} - self.conn = GoogleInstalledAppAuthConnection(*GCE_PARAMS, - **kwargs) + GoogleInstalledAppAuthConnection.conn_class = GoogleAuthMockHttp + self.mock_scopes = ["https://www.googleapis.com/auth/foo"] + kwargs = {"scopes": self.mock_scopes} + self.conn = GoogleInstalledAppAuthConnection(*GCE_PARAMS, **kwargs) def test_refresh_token(self): # This token info doesn't have a refresh token, so a new token will be # requested - token_info1 = {'access_token': 'tokentoken', 'token_type': 'Bearer', - 'expires_in': 3600} + token_info1 = { + "access_token": "tokentoken", + "token_type": "Bearer", + "expires_in": 3600, + } new_token1 = self.conn.refresh_token(token_info1) - self.assertEqual(new_token1['access_token'], 'installedapp') + self.assertEqual(new_token1["access_token"], STUB_IA_TOKEN["access_token"]) # This token info has a refresh token, so it will be able to be # refreshed. - token_info2 = {'access_token': 'tokentoken', 'token_type': 'Bearer', - 'expires_in': 3600, 'refresh_token': 'refreshrefresh'} + token_info2 = { + "access_token": "tokentoken", + "token_type": "Bearer", + "expires_in": 3600, + "refresh_token": "refreshrefresh", + } new_token2 = self.conn.refresh_token(token_info2) - self.assertEqual(new_token2['access_token'], 'refreshrefresh') + self.assertEqual(new_token2["access_token"], STUB_REFRESH_TOKEN["access_token"]) # Both sets should have refresh info - self.assertTrue('refresh_token' in new_token1) - self.assertTrue('refresh_token' in new_token2) + self.assertTrue("refresh_token" in new_token1) + self.assertTrue("refresh_token" in new_token2) -class GoogleBaseConnectionTest(LibcloudTestCase): +class GoogleInstalledAppAuthConnectionFirstLoginTest(LibcloudTestCase): + def setUp(self): + GoogleInstalledAppAuthConnection.conn_class = GoogleAuthMockHttp + self.mock_scopes = ["https://www.googleapis.com/auth/foo"] + kwargs = {"scopes": self.mock_scopes} + self.conn = GoogleInstalledAppAuthConnection(*GCE_PARAMS, **kwargs) + # We select random port on which HTTP server binds to, to avoid race conditions when + # running multiple tests in parallel + self.conn.redirect_uri_port = random.randint(5000, 20000) + + def test_it_receives_the_code_that_google_sends_via_local_loopback(self): + expected_code = "1234ABC" + received_code = self._do_first_sign_in(expected_code=expected_code, state=self.conn._state) + self.assertEqual(received_code, expected_code) + + def test_it_aborts_if_state_is_suspicious(self): + received_code = self._do_first_sign_in( + expected_code="1234ABC", state=self.conn._state + "very suspicious" + ) + self.assertEqual(received_code, None) + + def _do_first_sign_in(self, expected_code, state): + """ + :param expected_code: The code that the fake Google sign-in local GET request will have in its query. + :type expected_code: `str` + :param state: The state that the fake Google sign-in local GET request will have in its query. + :type state: `str` + :return: The code that was extracted through local loopback. + :rtype: `Optional[str]` + """ + received_code = None + + def _get_code(): + nonlocal received_code + received_code = self.conn.get_code() + + def _send_code(): + target_url = self.conn._redirect_uri_with_port + params = {"state": state, "code": expected_code} + params = urllib.parse.urlencode(params, quote_via=urllib.parse.quote) + requests.get(url=target_url, params=params) + + fake_sign_in_thread = threading.Thread(target=_get_code) + fake_google_response = threading.Thread(target=_send_code) + + fake_sign_in_thread.start() + # TODO: Do a proper fix for race condition and only start get_code once _send_code + # is initialized and up and running + time.sleep(0.2) + fake_google_response.start() + fake_google_response.join() + fake_sign_in_thread.join() + + return received_code + + +class GoogleAuthTypeTest(GoogleTestCase): + def test_guess(self): + self.assertEqual(GoogleAuthType.guess_type(GCE_PARAMS_IA[0]), GoogleAuthType.IA) + with mock.patch.object(GoogleAuthType, "_is_gce", return_value=True): + # Since _is_gce currently depends on the environment, not on + # parameters, other auths should override GCE. It does not make + # sense for IA auth to happen on GCE, which is why it's left out. + self.assertEqual(GoogleAuthType.guess_type(GCE_PARAMS[0]), GoogleAuthType.SA) + self.assertEqual(GoogleAuthType.guess_type(GCS_S3_PARAMS_20[0]), GoogleAuthType.GCS_S3) + self.assertEqual(GoogleAuthType.guess_type(GCS_S3_PARAMS_24[0]), GoogleAuthType.GCS_S3) + self.assertEqual(GoogleAuthType.guess_type(GCS_S3_PARAMS_61[0]), GoogleAuthType.GCS_S3) + self.assertEqual(GoogleAuthType.guess_type(GCE_PARAMS_GCE[0]), GoogleAuthType.GCE) + + def test_guess_gce_metadata_server_not_called_for_ia(self): + # Verify that we don't try to contact GCE metadata server in case IA + # credentials are used + with mock.patch.object(GoogleAuthType, "_is_gce", return_value=False): + self.assertEqual(GoogleAuthType._is_gce.call_count, 0) + self.assertEqual(GoogleAuthType.guess_type(GCE_PARAMS_IA_2[0]), GoogleAuthType.IA) + self.assertEqual(GoogleAuthType._is_gce.call_count, 0) + + +class GoogleOAuth2CredentialTest(GoogleTestCase): + _ia_get_code_patcher = mock.patch( + "libcloud.common.google.GoogleInstalledAppAuthConnection.get_code", + return_value=1234, + ) + + def test_init_oauth2(self): + kwargs = {"auth_type": GoogleAuthType.IA} + cred = GoogleOAuth2Credential(*GCE_PARAMS, **kwargs) + + # If there is a viable token file, this gets used first + self.assertEqual(cred.token, STUB_TOKEN_FROM_FILE) + + # No token file, get a new token. Check that it gets written to file. + with mock.patch.object(GoogleOAuth2Credential, "_get_token_from_file", return_value=None): + cred = GoogleOAuth2Credential(*GCE_PARAMS, **kwargs) + expected = STUB_IA_TOKEN + expected["expire_time"] = cred.token["expire_time"] + self.assertEqual(cred.token, expected) + cred._write_token_to_file.assert_called_once_with() + + def test_refresh(self): + args = list(GCE_PARAMS) + [GoogleAuthType.GCE] + cred = GoogleOAuth2Credential(*args) + cred._refresh_token = mock.Mock() + + # Test getting an unexpired access token. + tomorrow = datetime.datetime.now() + datetime.timedelta(days=1) + cred.token = { + "access_token": "Access Token!", + "expire_time": _utc_timestamp(tomorrow), + } + cred.access_token + self.assertFalse(cred._refresh_token.called) + + # Test getting an expired access token. + yesterday = datetime.datetime.now() - datetime.timedelta(days=1) + cred.token = { + "access_token": "Access Token!", + "expire_time": _utc_timestamp(yesterday), + } + cred.access_token + self.assertTrue(cred._refresh_token.called) + + def test_auth_connection(self): + # Test a bogus auth type + self.assertRaises( + GoogleAuthError, GoogleOAuth2Credential, *GCE_PARAMS, **{"auth_type": "XX"} + ) + # Try to create an OAuth2 credential when dealing with a GCS S3 + # interoperability auth type. + self.assertRaises( + GoogleAuthError, + GoogleOAuth2Credential, + *GCE_PARAMS, + **{"auth_type": GoogleAuthType.GCS_S3}, + ) + + kwargs = {} + + if SHA256: + kwargs["auth_type"] = GoogleAuthType.SA + cred1 = GoogleOAuth2Credential(*GCE_PARAMS_PEM_KEY_FILE, **kwargs) + self.assertTrue(isinstance(cred1.oauth2_conn, GoogleServiceAcctAuthConnection)) + + cred1 = GoogleOAuth2Credential(*GCE_PARAMS_JSON_KEY_FILE, **kwargs) + self.assertTrue(isinstance(cred1.oauth2_conn, GoogleServiceAcctAuthConnection)) + + cred1 = GoogleOAuth2Credential(*GCE_PARAMS_PEM_KEY, **kwargs) + self.assertTrue(isinstance(cred1.oauth2_conn, GoogleServiceAcctAuthConnection)) + + cred1 = GoogleOAuth2Credential(*GCE_PARAMS_JSON_KEY, **kwargs) + self.assertTrue(isinstance(cred1.oauth2_conn, GoogleServiceAcctAuthConnection)) + + cred1 = GoogleOAuth2Credential(*GCE_PARAMS_KEY, **kwargs) + self.assertTrue(isinstance(cred1.oauth2_conn, GoogleServiceAcctAuthConnection)) + + kwargs["auth_type"] = GoogleAuthType.SA + cred1 = GoogleOAuth2Credential(*GCE_PARAMS_JSON_KEY_STR, **kwargs) + self.assertTrue(isinstance(cred1.oauth2_conn, GoogleServiceAcctAuthConnection)) + + self.assertRaises(GoogleAuthError, GoogleOAuth2Credential, *GCE_PARAMS, **kwargs) + + # Invalid pem key + kwargs["auth_type"] = GoogleAuthType.SA + expected_msg = "Unable to decode provided PEM key:" + self.assertRaisesRegex( + GoogleAuthError, + expected_msg, + GoogleOAuth2Credential, + *GCE_PARAMS_PEM_KEY_FILE_INVALID, + **kwargs, + ) + + kwargs["auth_type"] = GoogleAuthType.SA + expected_msg = "Unable to decode provided PEM key:" + self.assertRaisesRegex( + GoogleAuthError, + expected_msg, + GoogleOAuth2Credential, + *GCE_PARAMS_JSON_KEY_INVALID, + **kwargs, + ) + + kwargs["auth_type"] = GoogleAuthType.IA + cred2 = GoogleOAuth2Credential(*GCE_PARAMS_IA, **kwargs) + self.assertTrue(isinstance(cred2.oauth2_conn, GoogleInstalledAppAuthConnection)) + + kwargs["auth_type"] = GoogleAuthType.GCE + cred3 = GoogleOAuth2Credential(*GCE_PARAMS_GCE, **kwargs) + self.assertTrue(isinstance(cred3.oauth2_conn, GoogleGCEServiceAcctAuthConnection)) + + +class GoogleBaseConnectionTest(GoogleTestCase): """ Tests for GoogleBaseConnection """ - GoogleBaseConnection._get_token_info_from_file = lambda x: None - GoogleBaseConnection._write_token_info_to_file = lambda x: None - GoogleInstalledAppAuthConnection.get_code = lambda x: '1234' - GoogleServiceAcctAuthConnection.get_new_token = \ - lambda x: x._token_request({}) - GoogleGCEServiceAcctAuthConnection.get_new_token = \ - lambda x: x._token_request({}) - GoogleBaseConnection._now = lambda x: datetime.datetime(2013, 6, 26, - 19, 0, 0) def setUp(self): - GoogleBaseAuthConnection.conn_classes = (GoogleAuthMockHttp, - GoogleAuthMockHttp) - self.mock_scopes = ['https://www.googleapis.com/auth/foo'] - kwargs = {'scopes': self.mock_scopes, 'auth_type': 'IA'} + GoogleBaseAuthConnection.conn_class = GoogleAuthMockHttp + self.mock_scopes = ["https://www.googleapis.com/auth/foo"] + kwargs = {"scopes": self.mock_scopes, "auth_type": GoogleAuthType.IA} self.conn = GoogleBaseConnection(*GCE_PARAMS, **kwargs) - def test_auth_type(self): - self.assertRaises(GoogleAuthError, GoogleBaseConnection, *GCE_PARAMS, - **{'auth_type': 'XX'}) - - kwargs = {'scopes': self.mock_scopes} - - if SHA256: - kwargs['auth_type'] = 'SA' - conn1 = GoogleBaseConnection(*GCE_PARAMS_PEM_KEY, **kwargs) - self.assertTrue(isinstance(conn1.auth_conn, - GoogleServiceAcctAuthConnection)) - - conn1 = GoogleBaseConnection(*GCE_PARAMS_JSON_KEY, **kwargs) - self.assertTrue(isinstance(conn1.auth_conn, - GoogleServiceAcctAuthConnection)) - - conn1 = GoogleBaseConnection(*GCE_PARAMS_KEY, **kwargs) - self.assertTrue(isinstance(conn1.auth_conn, - GoogleServiceAcctAuthConnection)) - - kwargs['auth_type'] = 'IA' - conn2 = GoogleBaseConnection(*GCE_PARAMS_IA, **kwargs) - self.assertTrue(isinstance(conn2.auth_conn, - GoogleInstalledAppAuthConnection)) - - kwargs['auth_type'] = 'GCE' - conn3 = GoogleBaseConnection(*GCE_PARAMS_GCE, **kwargs) - self.assertTrue(isinstance(conn3.auth_conn, - GoogleGCEServiceAcctAuthConnection)) - def test_add_default_headers(self): old_headers = {} - new_expected_headers = {'Content-Type': 'application/json', - 'Host': 'www.googleapis.com'} + new_expected_headers = { + "Content-Type": "application/json", + "Host": "www.googleapis.com", + } new_headers = self.conn.add_default_headers(old_headers) self.assertEqual(new_headers, new_expected_headers) def test_pre_connect_hook(self): old_params = {} old_headers = {} + auth_str = "{} {}".format( + STUB_TOKEN_FROM_FILE["token_type"], + STUB_TOKEN_FROM_FILE["access_token"], + ) new_expected_params = {} - new_expected_headers = {'Authorization': 'Bearer installedapp'} - new_params, new_headers = self.conn.pre_connect_hook(old_params, - old_headers) + new_expected_headers = {"Authorization": auth_str} + new_params, new_headers = self.conn.pre_connect_hook(old_params, old_headers) self.assertEqual(new_params, new_expected_params) self.assertEqual(new_headers, new_expected_headers) def test_encode_data(self): - data = {'key': 'value'} + data = {"key": "value"} json_data = '{"key": "value"}' encoded_data = self.conn.encode_data(data) self.assertEqual(encoded_data, json_data) def test_has_completed(self): - body1 = {"endTime": "2013-06-26T10:05:07.630-07:00", - "id": "3681664092089171723", - "kind": "compute#operation", - "status": "DONE", - "targetId": "16211908079305042870"} - body2 = {"endTime": "2013-06-26T10:05:07.630-07:00", - "id": "3681664092089171723", - "kind": "compute#operation", - "status": "RUNNING", - "targetId": "16211908079305042870"} + body1 = { + "endTime": "2013-06-26T10:05:07.630-07:00", + "id": "3681664092089171723", + "kind": "compute#operation", + "status": "DONE", + "targetId": "16211908079305042870", + } + body2 = { + "endTime": "2013-06-26T10:05:07.630-07:00", + "id": "3681664092089171723", + "kind": "compute#operation", + "status": "RUNNING", + "targetId": "16211908079305042870", + } response1 = MockJsonResponse(body1) response2 = MockJsonResponse(body2) self.assertTrue(self.conn.has_completed(response1)) self.assertFalse(self.conn.has_completed(response2)) def test_get_poll_request_kwargs(self): - body = {"endTime": "2013-06-26T10:05:07.630-07:00", - "id": "3681664092089171723", - "kind": "compute#operation", - "selfLink": "https://www.googleapis.com/operations-test"} + body = { + "endTime": "2013-06-26T10:05:07.630-07:00", + "id": "3681664092089171723", + "kind": "compute#operation", + "selfLink": "https://www.googleapis.com/operations-test", + } response = MockJsonResponse(body) - expected_kwargs = {'action': - 'https://www.googleapis.com/operations-test'} + expected_kwargs = {"action": "https://www.googleapis.com/operations-test"} kwargs = self.conn.get_poll_request_kwargs(response, None, {}) self.assertEqual(kwargs, expected_kwargs) def test_morph_action_hook(self): - self.conn.request_path = '/compute/apiver/project/project-name' - action1 = ('https://www.googleapis.com/compute/apiver/project' - '/project-name/instances') - action2 = '/instances' - expected_request = '/compute/apiver/project/project-name/instances' + self.conn.request_path = "/compute/apiver/project/project-name" + action1 = "https://www.googleapis.com/compute/apiver/project" "/project-name/instances" + action2 = "/instances" + expected_request = "/compute/apiver/project/project-name/instances" request1 = self.conn.morph_action_hook(action1) request2 = self.conn.morph_action_hook(action2) self.assertEqual(request1, expected_request) @@ -250,27 +556,18 @@ class GoogleAuthMockHttp(MockHttp): """ Mock HTTP Class for Google Auth Connections. """ - json_hdr = {'content-type': 'application/json; charset=UTF-8'} + + json_hdr = {"content-type": "application/json; charset=UTF-8"} def _o_oauth2_token(self, method, url, body, headers): - token_info = {'access_token': 'tokentoken', - 'token_type': 'Bearer', - 'expires_in': 3600} - refresh_token = {'access_token': 'refreshrefresh', - 'token_type': 'Bearer', - 'expires_in': 3600} - ia_token = {'access_token': 'installedapp', - 'token_type': 'Bearer', - 'expires_in': 3600, - 'refresh_token': 'refreshrefresh'} - if 'code' in body: - body = json.dumps(ia_token) - elif 'refresh_token' in body: - body = json.dumps(refresh_token) + if "code" in body: + body = json.dumps(STUB_IA_TOKEN) + elif "refresh_token" in body: + body = json.dumps(STUB_REFRESH_TOKEN) else: - body = json.dumps(token_info) + body = json.dumps(STUB_TOKEN) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/common/test_kubernetes.py b/libcloud/test/common/test_kubernetes.py new file mode 100644 index 0000000000..1cef1ba737 --- /dev/null +++ b/libcloud/test/common/test_kubernetes.py @@ -0,0 +1,118 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +__all__ = ["KubernetesAuthTestCaseMixin"] + +import os +import base64 + +from libcloud.utils.py3 import b +from libcloud.common.kubernetes import ( + KubernetesTLSAuthConnection, + KubernetesBasicAuthConnection, + KubernetesTokenAuthConnection, +) + +KEY_FILE = os.path.abspath( + os.path.join(os.path.dirname(__file__), "../compute/fixtures/azure/libcloud.pem") +) +CERT_FILE = os.path.abspath( + os.path.join(os.path.dirname(__file__), "../loadbalancer/fixtures/nttcis/denis.crt") +) +CA_CERT_FILE = os.path.abspath( + os.path.join(os.path.dirname(__file__), "../loadbalancer/fixtures/nttcis/chain.crt") +) + + +class KubernetesAuthTestCaseMixin: + """ + Test class mixin which tests different type of Kubernetes authentication + mechanisms (client cert, token, basic auth). + + It's to be used with all the drivers which inherit from KubernetesDriverMixin. + """ + + def test_http_basic_auth(self): + driver = self.driver_cls(key="username", secret="password") + self.assertEqual(driver.connectionCls, KubernetesBasicAuthConnection) + self.assertEqual(driver.connection.user_id, "username") + self.assertEqual(driver.connection.key, "password") + + auth_string = base64.b64encode(b("{}:{}".format("username", "password"))).decode("utf-8") + + headers = driver.connection.add_default_headers({}) + self.assertEqual(headers["Content-Type"], "application/json") + self.assertEqual(headers["Authorization"], "Basic %s" % (auth_string)) + + def test_cert_auth(self): + # key_file provided, but not cert_file + expected_msg = "Both key and certificate files are needed" + self.assertRaisesRegex( + ValueError, + expected_msg, + self.driver_cls, + key_file=KEY_FILE, + ca_cert=CA_CERT_FILE, + ) + + # cert_file provided, but not key_file + expected_msg = "Both key and certificate files are needed" + self.assertRaisesRegex( + ValueError, + expected_msg, + self.driver_cls, + cert_file=CERT_FILE, + ca_cert=CA_CERT_FILE, + ) + + # ca_cert argument specified + driver = self.driver_cls(key_file=KEY_FILE, cert_file=CERT_FILE, ca_cert=CA_CERT_FILE) + self.assertEqual(driver.connectionCls, KubernetesTLSAuthConnection) + self.assertEqual(driver.connection.key_file, KEY_FILE) + self.assertEqual(driver.connection.cert_file, CERT_FILE) + self.assertEqual(driver.connection.connection.ca_cert, CA_CERT_FILE) + + headers = driver.connection.add_default_headers({}) + self.assertEqual(headers["Content-Type"], "application/json") + + # ca_cert argument not specified + driver = self.driver_cls(key_file=KEY_FILE, cert_file=CERT_FILE, ca_cert=None) + self.assertEqual(driver.connectionCls, KubernetesTLSAuthConnection) + self.assertEqual(driver.connection.key_file, KEY_FILE) + self.assertEqual(driver.connection.cert_file, CERT_FILE) + self.assertEqual(driver.connection.connection.ca_cert, False) + + headers = driver.connection.add_default_headers({}) + self.assertEqual(headers["Content-Type"], "application/json") + + def test_bearer_token_auth(self): + driver = self.driver_cls(ex_token_bearer_auth=True, key="foobar") + self.assertEqual(driver.connectionCls, KubernetesTokenAuthConnection) + self.assertEqual(driver.connection.key, "foobar") + + headers = driver.connection.add_default_headers({}) + self.assertEqual(headers["Content-Type"], "application/json") + self.assertEqual(headers["Authorization"], "Bearer %s" % ("foobar")) + + def test_host_sanitization(self): + driver = self.driver_cls(host="example.com") + self.assertEqual(driver.connection.host, "example.com") + + driver = self.driver_cls(host="http://example.com") + self.assertEqual(driver.connection.host, "example.com") + + driver = self.driver_cls(host="https://example.com") + self.assertEqual(driver.connection.host, "example.com") diff --git a/libcloud/test/common/test_nfsn.py b/libcloud/test/common/test_nfsn.py new file mode 100644 index 0000000000..ab88775443 --- /dev/null +++ b/libcloud/test/common/test_nfsn.py @@ -0,0 +1,81 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import string +import unittest +from unittest.mock import Mock, patch + +from libcloud.test import MockHttp, LibcloudTestCase +from libcloud.utils.py3 import httplib +from libcloud.common.nfsn import NFSNConnection + +mock_time = Mock() +mock_time.return_value = 1000000 + +mock_salt = Mock() +mock_salt.return_value = "yumsalty1234" + +mock_header = "testid;1000000;yumsalty1234;66dfb282a9532e5b8e6a9517764d5fbc001a4a2e" + + +class NFSNConnectionTestCase(LibcloudTestCase): + def setUp(self): + NFSNConnection.conn_class = NFSNMockHttp + NFSNMockHttp.type = None + self.driver = NFSNConnection("testid", "testsecret") + + def test_salt_length(self): + self.assertEqual(16, len(self.driver._salt())) + + def test_salt_is_unique(self): + s1 = self.driver._salt() + s2 = self.driver._salt() + self.assertNotEqual(s1, s2) + + def test_salt_characters(self): + """salt must be alphanumeric""" + salt_characters = string.ascii_letters + string.digits + for c in self.driver._salt(): + self.assertIn(c, salt_characters) + + @patch("time.time", mock_time) + def test_timestamp(self): + """Check that timestamp uses time.time""" + self.assertEqual("1000000", self.driver._timestamp()) + + @patch("time.time", mock_time) + @patch("libcloud.common.nfsn.NFSNConnection._salt", mock_salt) + def test_auth_header(self): + """Check that X-NFSN-Authentication is set""" + response = self.driver.request(action="/testing") + self.assertEqual(httplib.OK, response.status) + + +class NFSNMockHttp(MockHttp): + def _testing(self, method, url, body, headers): + if headers["X-NFSN-Authentication"] == mock_header: + return (httplib.OK, "", {}, httplib.responses[httplib.OK]) + else: + return ( + httplib.UNAUTHORIZED, + "", + {}, + httplib.responses[httplib.UNAUTHORIZED], + ) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/common/test_openstack.py b/libcloud/test/common/test_openstack.py index 79ec58379d..18d6eef28c 100644 --- a/libcloud/test/common/test_openstack.py +++ b/libcloud/test/common/test_openstack.py @@ -15,34 +15,180 @@ import sys import unittest +from unittest.mock import Mock, patch -from mock import Mock - +from libcloud.common.base import LibcloudConnection from libcloud.common.openstack import OpenStackBaseConnection -from libcloud.utils.py3 import PY25 class OpenStackBaseConnectionTest(unittest.TestCase): def setUp(self): self.timeout = 10 - OpenStackBaseConnection.conn_classes = (None, Mock()) - self.connection = OpenStackBaseConnection('foo', 'bar', - timeout=self.timeout, - ex_force_auth_url='https://127.0.0.1') + OpenStackBaseConnection.conn_class = Mock() + self.connection = OpenStackBaseConnection( + "foo", "bar", timeout=self.timeout, ex_force_auth_url="https://127.0.0.1" + ) self.connection.driver = Mock() - self.connection.driver.name = 'OpenStackDriver' + self.connection.driver.name = "OpenStackDriver" + + def tearDown(self): + OpenStackBaseConnection.conn_class = LibcloudConnection def test_base_connection_timeout(self): self.connection.connect() self.assertEqual(self.connection.timeout, self.timeout) - if PY25: - self.connection.conn_classes[1].assert_called_with(host='127.0.0.1', - port=443) - else: - self.connection.conn_classes[1].assert_called_with(host='127.0.0.1', - port=443, - timeout=10) + self.connection.conn_class.assert_called_with( + host="127.0.0.1", secure=1, port=443, timeout=10 + ) + + def test_set_microversion(self): + self.connection.service_type = "compute" + self.connection._ex_force_microversion = "2.67" + headers = self.connection.add_default_headers({}) + self.assertEqual(headers["OpenStack-API-Version"], "compute 2.67") + + self.connection.service_type = "compute" + self.connection._ex_force_microversion = "volume 2.67" + headers = self.connection.add_default_headers({}) + self.assertNotIn("OpenStack-API-Version", headers) + + self.connection.service_type = "volume" + self.connection._ex_force_microversion = "volume 2.67" + headers = self.connection.add_default_headers({}) + self.assertEqual(headers["OpenStack-API-Version"], "volume 2.67") + + def test_get_endpoint_does_not_filter_by_default_service_name(self): + self.connection.service_catalog = Mock() + self.connection.service_catalog.get_endpoint.return_value.url = ( + "https://compute.example.com" + ) + self.connection.service_type = "compute" + self.connection.service_name = "nova" + self.connection.service_region = "RegionOne" + + endpoint = self.connection.get_endpoint() + + self.assertEqual(endpoint, "https://compute.example.com") + self.connection.service_catalog.get_endpoint.assert_called_once_with( + service_type="compute", name=None, region="RegionOne" + ) + + def test_get_endpoint_filters_by_explicit_service_name(self): + self.connection.service_catalog = Mock() + self.connection.service_catalog.get_endpoint.return_value.url = ( + "https://compute.example.com" + ) + self.connection.service_type = "compute" + self.connection.service_name = "nova" + self.connection.service_region = "RegionOne" + self.connection._ex_force_service_name = "custom-nova" + + endpoint = self.connection.get_endpoint() + + self.assertEqual(endpoint, "https://compute.example.com") + self.connection.service_catalog.get_endpoint.assert_called_once_with( + service_type="compute", name="custom-nova", region="RegionOne" + ) + + def test_get_endpoint_uses_default_service_name_to_resolve_ambiguity(self): + self.connection.service_catalog = Mock() + endpoint = Mock(url="https://compute.example.com") + self.connection.service_catalog.get_endpoint.side_effect = [ + ValueError("Found more than 1 matching endpoint"), + endpoint, + ] + self.connection.service_type = "compute" + self.connection.service_name = "nova" + self.connection.service_region = "RegionOne" + + result = self.connection.get_endpoint() + + self.assertEqual(result, "https://compute.example.com") + self.assertEqual( + self.connection.service_catalog.get_endpoint.call_args_list, + [ + unittest.mock.call(service_type="compute", name=None, region="RegionOne"), + unittest.mock.call(service_type="compute", name="nova", region="RegionOne"), + ], + ) + + def test_get_endpoint_does_not_fallback_from_explicit_service_name(self): + self.connection.service_catalog = Mock() + self.connection.service_catalog.get_endpoint.side_effect = ValueError( + "Found more than 1 matching endpoint" + ) + self.connection.service_type = "compute" + self.connection.service_name = "nova" + self.connection.service_region = "RegionOne" + self.connection._ex_force_service_name = "custom-nova" + + with self.assertRaisesRegex(ValueError, "more than 1"): + self.connection.get_endpoint() + + self.connection.service_catalog.get_endpoint.assert_called_once_with( + service_type="compute", name="custom-nova", region="RegionOne" + ) + + @patch("libcloud.common.base.ConnectionUserAndKey.request") + def test_request(self, mock_request): + OpenStackBaseConnection.conn_class._raw_data = "" + OpenStackBaseConnection.default_content_type = "application/json" + expected_response = Mock() + mock_request.return_value = expected_response + response = self.connection.request( + "/path", data="somedata", headers={"h1": "v1"}, method="POST" + ) + self.assertEqual(response, expected_response) + mock_request.assert_called_with( + action="/path", + params={}, + data="somedata", + method="POST", + headers={"h1": "v1", "Content-Type": "application/json"}, + raw=False, + ) + + @patch("libcloud.test.common.test_openstack.OpenStackBaseConnection.connect", Mock()) + def test_connection_is_reused_when_details_dont_change(self): + url = "https://example.com" + + self.connection._set_up_connection_info(url=url) + self.assertEqual(self.connection.connect.call_count, 1) + + for index in range(0, 10): + self.connection._set_up_connection_info(url=url) + self.assertEqual(self.connection.connect.call_count, 1) + + @patch("libcloud.test.common.test_openstack.OpenStackBaseConnection.connect", Mock()) + def test_connection_is_not_reused_when_details_change(self): + url = "https://example.com" + self.connection._set_up_connection_info(url=url) + self.assertEqual(self.connection.connect.call_count, 1) + + url = "https://example.com" + self.connection._set_up_connection_info(url=url) + self.assertEqual(self.connection.connect.call_count, 1) + + url = "https://example.com:80" + self.connection._set_up_connection_info(url=url) + self.assertEqual(self.connection.connect.call_count, 2) + + url = "http://example.com:80" + self.connection._set_up_connection_info(url=url) + self.assertEqual(self.connection.connect.call_count, 3) + + url = "http://exxample.com:80" + self.connection._set_up_connection_info(url=url) + self.assertEqual(self.connection.connect.call_count, 4) + + url = "http://exxample.com:81" + self.connection._set_up_connection_info(url=url) + self.assertEqual(self.connection.connect.call_count, 5) + + url = "http://exxample.com:81" + self.connection._set_up_connection_info(url=url) + self.assertEqual(self.connection.connect.call_count, 5) -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/common/test_openstack_identity.py b/libcloud/test/common/test_openstack_identity.py index 7c57cf1020..9e74970c96 100644 --- a/libcloud/test/common/test_openstack_identity.py +++ b/libcloud/test/common/test_openstack_identity.py @@ -15,124 +15,196 @@ import sys import datetime +from unittest.mock import Mock + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import httplib, assertRaisesRegex +from libcloud.test.secrets import OPENSTACK_PARAMS +from libcloud.common.openstack import OpenStackBaseConnection +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.common.openstack_identity import ( + AUTH_TOKEN_EXPIRES_GRACE_SECONDS, + OpenStackIdentityUser, + OpenStackServiceCatalog, + OpenStackIdentity_2_0_Connection, + OpenStackIdentity_3_0_Connection, + OpenStackIdentity_2_0_Connection_VOMS, + OpenStackIdentity_3_0_Connection_AppCred, + OpenStackIdentity_3_0_Connection_OIDC_access_token, + get_class_for_auth_version, +) +from libcloud.compute.drivers.openstack import OpenStack_1_0_NodeDriver +from libcloud.test.compute.test_openstack import ( + OpenStackMockHttp, + OpenStack_2_0_MockHttp, + OpenStackMockAuthCache, +) try: import simplejson as json except ImportError: import json -from mock import Mock - -from libcloud.utils.py3 import httplib -from libcloud.common.openstack import OpenStackBaseConnection -from libcloud.common.openstack_identity import AUTH_TOKEN_EXPIRES_GRACE_SECONDS -from libcloud.common.openstack_identity import get_class_for_auth_version -from libcloud.common.openstack_identity import OpenStackServiceCatalog -from libcloud.common.openstack_identity import OpenStackIdentity_2_0_Connection -from libcloud.common.openstack_identity import OpenStackIdentity_3_0_Connection -from libcloud.common.openstack_identity import OpenStackIdentityUser -from libcloud.compute.drivers.openstack import OpenStack_1_0_NodeDriver -from libcloud.test import unittest -from libcloud.test import MockHttp -from libcloud.test.secrets import OPENSTACK_PARAMS -from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.test.compute.test_openstack import OpenStackMockHttp -from libcloud.test.compute.test_openstack import OpenStack_2_0_MockHttp +TOMORROW = datetime.datetime.today() + datetime.timedelta(1) +YESTERDAY = datetime.datetime.today() - datetime.timedelta(1) class OpenStackIdentityConnectionTestCase(unittest.TestCase): def setUp(self): OpenStackBaseConnection.auth_url = None - OpenStackBaseConnection.conn_classes = (OpenStackMockHttp, - OpenStackMockHttp) + OpenStackBaseConnection.conn_class = OpenStackMockHttp + OpenStack_2_0_MockHttp.type = None + OpenStackIdentity_3_0_MockHttp.type = None def test_auth_url_is_correctly_assembled(self): tuples = [ - ('1.0', OpenStackMockHttp), - ('1.1', OpenStackMockHttp), - ('2.0', OpenStack_2_0_MockHttp), - ('2.0_apikey', OpenStack_2_0_MockHttp), - ('2.0_password', OpenStack_2_0_MockHttp) + ("1.0", OpenStackMockHttp, {}), + ("1.1", OpenStackMockHttp, {}), + ("2.0", OpenStack_2_0_MockHttp, {}), + ("2.0_apikey", OpenStack_2_0_MockHttp, {}), + ("2.0_password", OpenStack_2_0_MockHttp, {}), + ( + "3.x_password", + OpenStackIdentity_3_0_MockHttp, + {"tenant_name": "tenant-name"}, + ), + ("3.x_appcred", OpenStackIdentity_3_0_MockHttp, {}), + ( + "3.x_oidc_access_token", + OpenStackIdentity_3_0_MockHttp, + {"tenant_name": "tenant-name"}, + ), ] - APPEND = 0 - NOTAPPEND = 1 - auth_urls = [ - ('https://auth.api.example.com', APPEND, ''), - ('https://auth.api.example.com/', NOTAPPEND, '/'), - ('https://auth.api.example.com/foo/bar', NOTAPPEND, '/foo/bar'), - ('https://auth.api.example.com/foo/bar/', NOTAPPEND, '/foo/bar/') + ("https://auth.api.example.com", ""), + ("https://auth.api.example.com/", "/"), + ("https://auth.api.example.com/foo/bar", "/foo/bar"), + ("https://auth.api.example.com/foo/bar/", "/foo/bar/"), ] actions = { - '1.0': '/v1.0', - '1.1': '/v1.1/auth', - '2.0': '/v2.0/tokens', - '2.0_apikey': '/v2.0/tokens', - '2.0_password': '/v2.0/tokens' + "1.0": "{url_path}/v1.0", + "1.1": "{url_path}/v1.1/auth", + "2.0": "{url_path}/v2.0/tokens", + "2.0_apikey": "{url_path}/v2.0/tokens", + "2.0_password": "{url_path}/v2.0/tokens", + "3.x_password": "{url_path}/v3/auth/tokens", + "3.x_appcred": "{url_path}/v3/auth/tokens", + "3.x_oidc_access_token": "{url_path}/v3/OS-FEDERATION/identity_providers/user_name/protocols/tenant-name/auth", } user_id = OPENSTACK_PARAMS[0] key = OPENSTACK_PARAMS[1] - for (auth_version, mock_http_class) in tuples: - for (url, should_append_default_path, expected_path) in auth_urls: - connection = \ - self._get_mock_connection(mock_http_class=mock_http_class, - auth_url=url) + for auth_version, mock_http_class, kwargs in tuples: + for url, url_path in auth_urls: + connection = self._get_mock_connection( + mock_http_class=mock_http_class, auth_url=url + ) auth_url = connection.auth_url cls = get_class_for_auth_version(auth_version=auth_version) - osa = cls(auth_url=auth_url, - user_id=user_id, - key=key, - parent_conn=connection) + osa = cls( + auth_url=auth_url, + user_id=user_id, + key=key, + parent_conn=connection, + **kwargs, + ) try: osa = osa.authenticate() - except: + except Exception: pass - if (should_append_default_path == APPEND): - expected_path = actions[auth_version] + expected_path = actions[auth_version].format(url_path=url_path).replace("//", "/") - self.assertEqual(osa.action, expected_path) + self.assertEqual( + osa.action, + expected_path, + ) def test_basic_authentication(self): tuples = [ - ('1.0', OpenStackMockHttp), - ('1.1', OpenStackMockHttp), - ('2.0', OpenStack_2_0_MockHttp), - ('2.0_apikey', OpenStack_2_0_MockHttp), - ('2.0_password', OpenStack_2_0_MockHttp) + ("1.0", OpenStackMockHttp, {}), + ("1.1", OpenStackMockHttp, {}), + ("2.0", OpenStack_2_0_MockHttp, {}), + ("2.0_apikey", OpenStack_2_0_MockHttp, {}), + ("2.0_password", OpenStack_2_0_MockHttp, {}), + ( + "3.x_password", + OpenStackIdentity_3_0_MockHttp, + { + "user_id": "test_user_id", + "key": "test_key", + "token_scope": "project", + "tenant_name": "test_tenant", + "tenant_domain_id": "test_tenant_domain_id", + "domain_name": "test_domain", + }, + ), + ( + "3.x_appcred", + OpenStackIdentity_3_0_MockHttp, + {"user_id": "appcred_id", "key": "appcred_secret"}, + ), + ( + "3.x_oidc_access_token", + OpenStackIdentity_3_0_MockHttp, + { + "user_id": "test_user_id", + "key": "test_key", + "token_scope": "domain", + "tenant_name": "test_tenant", + "tenant_domain_id": "test_tenant_domain_id", + "domain_name": "test_domain", + }, + ), ] user_id = OPENSTACK_PARAMS[0] key = OPENSTACK_PARAMS[1] - for (auth_version, mock_http_class) in tuples: - connection = \ - self._get_mock_connection(mock_http_class=mock_http_class) + for auth_version, mock_http_class, kwargs in tuples: + connection = self._get_mock_connection(mock_http_class=mock_http_class) auth_url = connection.auth_url + if not kwargs: + kwargs["user_id"] = user_id + kwargs["key"] = key + cls = get_class_for_auth_version(auth_version=auth_version) - osa = cls(auth_url=auth_url, user_id=user_id, key=key, - parent_conn=connection) + osa = cls(auth_url=auth_url, parent_conn=connection, **kwargs) self.assertEqual(osa.urls, {}) - self.assertEqual(osa.auth_token, None) - self.assertEqual(osa.auth_user_info, None) + self.assertIsNone(osa.auth_token) + self.assertIsNone(osa.auth_user_info) osa = osa.authenticate() self.assertTrue(len(osa.urls) >= 1) self.assertTrue(osa.auth_token is not None) - if auth_version in ['1.1', '2.0', '2.0_apikey', '2.0_password']: + if auth_version in [ + "1.1", + "2.0", + "2.0_apikey", + "2.0_password", + "3.x_password", + "3.x_appcred", + "3.x_oidc_access_token", + ]: self.assertTrue(osa.auth_token_expires is not None) - if auth_version in ['2.0', '2.0_apikey', '2.0_password']: + if auth_version in [ + "2.0", + "2.0_apikey", + "2.0_password", + "3.x_password", + "3.x_appcred", + "3.x_oidc_access_token", + ]: self.assertTrue(osa.auth_user_info is not None) def test_token_expiration_and_force_reauthentication(self): @@ -142,20 +214,16 @@ def test_token_expiration_and_force_reauthentication(self): connection = self._get_mock_connection(OpenStack_2_0_MockHttp) auth_url = connection.auth_url - yesterday = datetime.datetime.today() - datetime.timedelta(1) - tomorrow = datetime.datetime.today() + datetime.timedelta(1) - - osa = OpenStackIdentity_2_0_Connection(auth_url=auth_url, - user_id=user_id, - key=key, - parent_conn=connection) + osa = OpenStackIdentity_2_0_Connection( + auth_url=auth_url, user_id=user_id, key=key, parent_conn=connection + ) mocked_auth_method = Mock(wraps=osa._authenticate_2_0_with_body) osa._authenticate_2_0_with_body = mocked_auth_method # Force re-auth, expired token osa.auth_token = None - osa.auth_token_expires = yesterday + osa.auth_token_expires = YESTERDAY count = 5 for i in range(0, count): @@ -165,9 +233,9 @@ def test_token_expiration_and_force_reauthentication(self): # No force reauth, expired token osa.auth_token = None - osa.auth_token_expires = yesterday + osa.auth_token_expires = YESTERDAY - mocked_auth_method.call_count = 0 + mocked_auth_method.reset_mock() self.assertEqual(mocked_auth_method.call_count, 0) for i in range(0, count): @@ -178,24 +246,25 @@ def test_token_expiration_and_force_reauthentication(self): # No force reauth, valid / non-expired token osa.auth_token = None - mocked_auth_method.call_count = 0 + mocked_auth_method.reset_mock() self.assertEqual(mocked_auth_method.call_count, 0) for i in range(0, count): osa.authenticate(force=False) if i == 0: - osa.auth_token_expires = tomorrow + osa.auth_token_expires = TOMORROW self.assertEqual(mocked_auth_method.call_count, 1) # No force reauth, valid / non-expired token which is about to expire in # less than AUTH_TOKEN_EXPIRES_GRACE_SECONDS - soon = datetime.datetime.utcnow() + \ - datetime.timedelta(seconds=AUTH_TOKEN_EXPIRES_GRACE_SECONDS - 1) + soon = datetime.datetime.utcnow() + datetime.timedelta( + seconds=AUTH_TOKEN_EXPIRES_GRACE_SECONDS - 1 + ) osa.auth_token = None - mocked_auth_method.call_count = 0 + mocked_auth_method.reset_mock() self.assertEqual(mocked_auth_method.call_count, 0) for i in range(0, count): @@ -206,9 +275,127 @@ def test_token_expiration_and_force_reauthentication(self): self.assertEqual(mocked_auth_method.call_count, 1) + def test_authentication_cache(self): + tuples = [ + # 1.0 does not provide token expiration, so it always + # re-authenticates and never uses the cache. + # ('1.0', OpenStackMockHttp, {}), + ("1.1", OpenStackMockHttp, {}), + ("2.0", OpenStack_2_0_MockHttp, {}), + ("2.0_apikey", OpenStack_2_0_MockHttp, {}), + ("2.0_password", OpenStack_2_0_MockHttp, {}), + ( + "3.x_password", + OpenStackIdentity_3_0_MockHttp, + { + "user_id": "test_user_id", + "key": "test_key", + "token_scope": "project", + "tenant_name": "test_tenant", + "tenant_domain_id": "test_tenant_domain_id", + "domain_name": "test_domain", + }, + ), + ( + "3.x_oidc_access_token", + OpenStackIdentity_3_0_MockHttp, + { + "user_id": "test_user_id", + "key": "test_key", + "token_scope": "domain", + "tenant_name": "test_tenant", + "tenant_domain_id": "test_tenant_domain_id", + "domain_name": "test_domain", + }, + ), + ] + + user_id = OPENSTACK_PARAMS[0] + key = OPENSTACK_PARAMS[1] + + for auth_version, mock_http_class, kwargs in tuples: + mock_http_class.type = None + connection = self._get_mock_connection(mock_http_class=mock_http_class) + auth_url = connection.auth_url + + if not kwargs: + kwargs["user_id"] = user_id + kwargs["key"] = key + + auth_cache = OpenStackMockAuthCache() + self.assertEqual(len(auth_cache), 0) + kwargs["auth_cache"] = auth_cache + + cls = get_class_for_auth_version(auth_version=auth_version) + osa = cls(auth_url=auth_url, parent_conn=connection, **kwargs) + osa = osa.authenticate() + + # Token is cached + self.assertEqual(len(auth_cache), 1) + + # New client, token from cache is reused + osa = cls(auth_url=auth_url, parent_conn=connection, **kwargs) + osa.request = Mock(wraps=osa.request) + osa = osa.authenticate() + + # No auth API call + if auth_version in ("1.1", "2.0", "2.0_apikey", "2.0_password"): + self.assertEqual(osa.request.call_count, 0) + elif auth_version in ("3.x_password", "3.x_oidc_access_token"): + # v3 only caches token and expiration; service catalog URLs + # and the rest of the auth context are fetched from Keystone + osa.request.assert_called_once_with( + action="/v3/auth/tokens", + params=None, + data=None, + headers={ + "X-Subject-Token": "00000000000000000000000000000000", + "X-Auth-Token": "00000000000000000000000000000000", + }, + method="GET", + raw=False, + ) + + # Cache size unchanged + self.assertEqual(len(auth_cache), 1) + + # Authenticates if cached token expired + cache_key = list(auth_cache.store.keys())[0] + auth_context = auth_cache.get(cache_key) + auth_context.expiration = YESTERDAY + auth_cache.put(cache_key, auth_context) + + osa = cls(auth_url=auth_url, parent_conn=connection, **kwargs) + osa.request = Mock(wraps=osa.request) + osa._get_unscoped_token_from_oidc_token = Mock(return_value="000") + OpenStackIdentity_3_0_MockHttp.type = "GET_UNAUTHORIZED_POST_OK" + osa = osa.authenticate() + + if auth_version in ("1.1", "2.0", "2.0_apikey", "2.0_password"): + self.assertEqual(osa.request.call_count, 1) + self.assertTrue(osa.request.call_args[1]["method"], "POST") + elif auth_version in ("3.x_password", "3.x_oidc_access_token"): + self.assertTrue(osa.request.call_args[0][0], "/v3/auth/tokens") + self.assertTrue(osa.request.call_args[1]["method"], "POST") + + # Token evicted from cache if 401 received on another call + if hasattr(osa, "list_projects"): + mock_http_class.type = None + auth_cache.reset() + + osa = cls(auth_url=auth_url, parent_conn=connection, **kwargs) + osa.request = Mock(wraps=osa.request) + osa = osa.authenticate() + self.assertEqual(len(auth_cache), 1) + mock_http_class.type = "UNAUTHORIZED" + try: + osa.list_projects() + except: # These methods don't handle 401s + pass + self.assertEqual(len(auth_cache), 0) + def _get_mock_connection(self, mock_http_class, auth_url=None): - OpenStackBaseConnection.conn_classes = (mock_http_class, - mock_http_class) + OpenStackBaseConnection.conn_class = mock_http_class if auth_url is None: auth_url = "https://auth.api.example.com" @@ -226,20 +413,25 @@ class OpenStackIdentity_2_0_ConnectionTests(unittest.TestCase): def setUp(self): mock_cls = OpenStackIdentity_2_0_MockHttp mock_cls.type = None - OpenStackIdentity_2_0_Connection.conn_classes = (mock_cls, mock_cls) - - self.auth_instance = OpenStackIdentity_2_0_Connection(auth_url='http://none', - user_id='test', - key='test', - tenant_name='test') - self.auth_instance.auth_token = 'mock' + OpenStackIdentity_2_0_Connection.conn_class = mock_cls + + self.auth_instance = OpenStackIdentity_2_0_Connection( + auth_url="http://none", + user_id="test", + key="test", + tenant_name="test", + proxy_url="http://proxy:8080", + timeout=10, + ) + self.auth_instance.auth_token = "mock" + self.assertEqual(self.auth_instance.proxy_url, "http://proxy:8080") def test_list_projects(self): result = self.auth_instance.list_projects() self.assertEqual(len(result), 2) - self.assertEqual(result[0].id, 'a') - self.assertEqual(result[0].name, 'test') - self.assertEqual(result[0].description, 'test project') + self.assertEqual(result[0].id, "a") + self.assertEqual(result[0].name, "test") + self.assertEqual(result[0].description, "test project") self.assertTrue(result[0].enabled) @@ -247,98 +439,132 @@ class OpenStackIdentity_3_0_ConnectionTests(unittest.TestCase): def setUp(self): mock_cls = OpenStackIdentity_3_0_MockHttp mock_cls.type = None - OpenStackIdentity_3_0_Connection.conn_classes = (mock_cls, mock_cls) - - self.auth_instance = OpenStackIdentity_3_0_Connection(auth_url='http://none', - user_id='test', - key='test', - tenant_name='test') - self.auth_instance.auth_token = 'mock' + OpenStackIdentity_3_0_Connection.conn_class = mock_cls + + self.auth_instance = OpenStackIdentity_3_0_Connection( + auth_url="http://none", + user_id="test", + key="test", + tenant_name="test", + proxy_url="http://proxy:8080", + timeout=10, + ) + self.auth_instance.auth_token = "mock" + self.assertEqual(self.auth_instance.proxy_url, "http://proxy:8080") def test_token_scope_argument(self): # Invalid token_scope value expected_msg = 'Invalid value for "token_scope" argument: foo' - self.assertRaisesRegexp(ValueError, expected_msg, - OpenStackIdentity_3_0_Connection, - auth_url='http://none', - user_id='test', - key='test', - token_scope='foo') + assertRaisesRegex( + self, + ValueError, + expected_msg, + OpenStackIdentity_3_0_Connection, + auth_url="http://none", + user_id="test", + key="test", + token_scope="foo", + ) # Missing tenant_name - expected_msg = 'Must provide tenant_name and domain_name argument' - self.assertRaisesRegexp(ValueError, expected_msg, - OpenStackIdentity_3_0_Connection, - auth_url='http://none', - user_id='test', - key='test', - token_scope='project') + expected_msg = "Must provide tenant_name and domain_name argument" + assertRaisesRegex( + self, + ValueError, + expected_msg, + OpenStackIdentity_3_0_Connection, + auth_url="http://none", + user_id="test", + key="test", + token_scope="project", + ) # Missing domain_name - expected_msg = 'Must provide domain_name argument' - self.assertRaisesRegexp(ValueError, expected_msg, - OpenStackIdentity_3_0_Connection, - auth_url='http://none', - user_id='test', - key='test', - token_scope='domain', - domain_name=None) + expected_msg = "Must provide domain_name argument" + assertRaisesRegex( + self, + ValueError, + expected_msg, + OpenStackIdentity_3_0_Connection, + auth_url="http://none", + user_id="test", + key="test", + token_scope="domain", + domain_name=None, + ) # Scope to project all ok - OpenStackIdentity_3_0_Connection(auth_url='http://none', - user_id='test', - key='test', - token_scope='project', - tenant_name='test', - domain_name='Default') + OpenStackIdentity_3_0_Connection( + auth_url="http://none", + user_id="test", + key="test", + token_scope="project", + tenant_name="test", + domain_name="Default", + ) # Scope to domain - OpenStackIdentity_3_0_Connection(auth_url='http://none', - user_id='test', - key='test', - token_scope='domain', - tenant_name=None, - domain_name='Default') + OpenStackIdentity_3_0_Connection( + auth_url="http://none", + user_id="test", + key="test", + token_scope="domain", + tenant_name=None, + domain_name="Default", + ) + + def test_authenticate(self): + auth = OpenStackIdentity_3_0_Connection( + auth_url="http://none", + user_id="test_user_id", + key="test_key", + token_scope="project", + tenant_name="test_tenant", + tenant_domain_id="test_tenant_domain_id", + domain_name="test_domain", + proxy_url="http://proxy:8080", + timeout=10, + ) + auth.authenticate() + self.assertEqual(auth.proxy_url, "http://proxy:8080") def test_list_supported_versions(self): - OpenStackIdentity_3_0_MockHttp.type = 'v3' + OpenStackIdentity_3_0_MockHttp.type = "v3" versions = self.auth_instance.list_supported_versions() self.assertEqual(len(versions), 2) - self.assertEqual(versions[0].version, 'v2.0') - self.assertEqual(versions[0].url, - 'http://192.168.18.100:5000/v2.0/') - self.assertEqual(versions[1].version, 'v3.0') - self.assertEqual(versions[1].url, - 'http://192.168.18.100:5000/v3/') + self.assertEqual(versions[0].version, "v2.0") + self.assertEqual(versions[0].url, "http://192.168.18.100:5000/v2.0/") + self.assertEqual(versions[1].version, "v3.0") + self.assertEqual(versions[1].url, "http://192.168.18.100:5000/v3/") def test_list_domains(self): domains = self.auth_instance.list_domains() self.assertEqual(len(domains), 1) - self.assertEqual(domains[0].id, 'default') - self.assertEqual(domains[0].name, 'Default') + self.assertEqual(domains[0].id, "default") + self.assertEqual(domains[0].name, "Default") self.assertTrue(domains[0].enabled) def test_list_projects(self): projects = self.auth_instance.list_projects() self.assertEqual(len(projects), 4) - self.assertEqual(projects[0].id, 'a') - self.assertEqual(projects[0].domain_id, 'default') + self.assertEqual(projects[0].id, "a") + self.assertEqual(projects[0].domain_id, "default") self.assertTrue(projects[0].enabled) - self.assertEqual(projects[0].description, 'Test project') + self.assertEqual(projects[0].description, "Test project") def test_list_users(self): users = self.auth_instance.list_users() self.assertEqual(len(users), 12) - self.assertEqual(users[0].id, 'a') - self.assertEqual(users[0].domain_id, 'default') + self.assertEqual(users[0].id, "a") + self.assertEqual(users[0].domain_id, "default") self.assertEqual(users[0].enabled, True) - self.assertEqual(users[0].email, 'openstack-test@localhost') + self.assertEqual(users[0].email, "openstack-test@localhost") def test_list_roles(self): roles = self.auth_instance.list_roles() self.assertEqual(len(roles), 2) - self.assertEqual(roles[1].id, 'b') - self.assertEqual(roles[1].name, 'admin') + self.assertEqual(roles[1].id, "b") + self.assertEqual(roles[1].name, "admin") def test_list_user_projects(self): user = self.auth_instance.list_users()[0] @@ -348,21 +574,40 @@ def test_list_user_projects(self): def test_list_user_domain_roles(self): user = self.auth_instance.list_users()[0] domain = self.auth_instance.list_domains()[0] - roles = self.auth_instance.list_user_domain_roles(domain=domain, - user=user) + roles = self.auth_instance.list_user_domain_roles(domain=domain, user=user) self.assertEqual(len(roles), 1) - self.assertEqual(roles[0].name, 'admin') + self.assertEqual(roles[0].name, "admin") def test_get_domain(self): - domain = self.auth_instance.get_domain(domain_id='default') - self.assertEqual(domain.name, 'Default') + domain = self.auth_instance.get_domain(domain_id="default") + self.assertEqual(domain.name, "Default") + + def test_get_user(self): + user = self.auth_instance.get_user(user_id="a") + self.assertEqual(user.id, "a") + self.assertEqual(user.domain_id, "default") + self.assertEqual(user.enabled, True) + self.assertEqual(user.email, "openstack-test@localhost") + + def test_get_user_without_email(self): + user = self.auth_instance.get_user(user_id="b") + self.assertEqual(user.id, "b") + self.assertEqual(user.name, "userwithoutemail") + self.assertIsNone(user.email) + + def test_get_user_without_enabled(self): + user = self.auth_instance.get_user(user_id="c") + self.assertEqual(user.id, "c") + self.assertEqual(user.name, "userwithoutenabled") + self.assertIsNone(user.enabled) def test_create_user(self): - user = self.auth_instance.create_user(email='test2@localhost', password='test1', - name='test2', domain_id='default') + user = self.auth_instance.create_user( + email="test2@localhost", password="test1", name="test2", domain_id="default" + ) - self.assertEqual(user.id, 'c') - self.assertEqual(user.name, 'test2') + self.assertEqual(user.id, "c") + self.assertEqual(user.name, "test2") def test_enable_user(self): user = self.auth_instance.list_users()[0] @@ -379,9 +624,7 @@ def test_grant_domain_role_to_user(self): role = self.auth_instance.list_roles()[0] user = self.auth_instance.list_users()[0] - result = self.auth_instance.grant_domain_role_to_user(domain=domain, - role=role, - user=user) + result = self.auth_instance.grant_domain_role_to_user(domain=domain, role=role, user=user) self.assertTrue(result) def test_revoke_domain_role_from_user(self): @@ -389,9 +632,9 @@ def test_revoke_domain_role_from_user(self): role = self.auth_instance.list_roles()[0] user = self.auth_instance.list_users()[0] - result = self.auth_instance.revoke_domain_role_from_user(domain=domain, - role=role, - user=user) + result = self.auth_instance.revoke_domain_role_from_user( + domain=domain, role=role, user=user + ) self.assertTrue(result) def test_grant_project_role_to_user(self): @@ -399,9 +642,9 @@ def test_grant_project_role_to_user(self): role = self.auth_instance.list_roles()[0] user = self.auth_instance.list_users()[0] - result = self.auth_instance.grant_project_role_to_user(project=project, - role=role, - user=user) + result = self.auth_instance.grant_project_role_to_user( + project=project, role=role, user=user + ) self.assertTrue(result) def test_revoke_project_role_from_user(self): @@ -409,243 +652,708 @@ def test_revoke_project_role_from_user(self): role = self.auth_instance.list_roles()[0] user = self.auth_instance.list_users()[0] - result = self.auth_instance.revoke_project_role_from_user(project=project, - role=role, - user=user) + result = self.auth_instance.revoke_project_role_from_user( + project=project, role=role, user=user + ) self.assertTrue(result) +class OpenStackIdentity_3_0_Connection_AppCredTests(unittest.TestCase): + def setUp(self): + mock_cls = OpenStackIdentity_3_0_AppCred_MockHttp + mock_cls.type = None + OpenStackIdentity_3_0_Connection_AppCred.conn_class = mock_cls + + self.auth_instance = OpenStackIdentity_3_0_Connection_AppCred( + auth_url="http://none", + user_id="appcred_id", + key="appcred_secret", + proxy_url="http://proxy:8080", + timeout=10, + ) + self.auth_instance.auth_token = "mock" + + def test_authenticate(self): + auth = OpenStackIdentity_3_0_Connection_AppCred( + auth_url="http://none", + user_id="appcred_id", + key="appcred_secret", + proxy_url="http://proxy:8080", + timeout=10, + ) + auth.authenticate() + + +class OpenStackIdentity_3_0_Connection_OIDC_access_token_federation_projectsTests( + unittest.TestCase +): + def setUp(self): + mock_cls = OpenStackIdentity_3_0_federation_projects_MockHttp + mock_cls.type = None + OpenStackIdentity_3_0_Connection_OIDC_access_token.conn_class = mock_cls + + self.auth_instance = OpenStackIdentity_3_0_Connection_OIDC_access_token( + auth_url="http://none", + user_id="idp", + key="token", + tenant_name="oidc", + proxy_url="http://proxy:8080", + timeout=10, + ) + self.auth_instance.auth_token = "mock" + + def test_authenticate(self): + auth = OpenStackIdentity_3_0_Connection_OIDC_access_token( + auth_url="http://none", + user_id="idp", + key="token", + token_scope="project", + tenant_name="oidc", + proxy_url="http://proxy:8080", + timeout=10, + ) + auth.authenticate() + + +class OpenStackIdentity_3_0_Connection_OIDC_access_tokenTests(unittest.TestCase): + def setUp(self): + mock_cls = OpenStackIdentity_3_0_MockHttp + mock_cls.type = None + OpenStackIdentity_3_0_Connection_OIDC_access_token.conn_class = mock_cls + + self.auth_instance = OpenStackIdentity_3_0_Connection_OIDC_access_token( + auth_url="http://none", + user_id="idp", + key="token", + tenant_name="oidc", + domain_name="project_name2", + ) + self.auth_instance.auth_token = "mock" + + def test_authenticate(self): + auth = OpenStackIdentity_3_0_Connection_OIDC_access_token( + auth_url="http://none", + user_id="idp", + key="token", + token_scope="project", + tenant_name="oidc", + domain_name="project_name2", + ) + auth.authenticate() + + +class OpenStackIdentity_3_0_Connection_OIDC_access_token_project_idTests(unittest.TestCase): + def setUp(self): + mock_cls = OpenStackIdentity_3_0_MockHttp + mock_cls.type = None + OpenStackIdentity_3_0_Connection_OIDC_access_token.conn_class = mock_cls + + self.auth_instance = OpenStackIdentity_3_0_Connection_OIDC_access_token( + auth_url="http://none", + user_id="idp", + key="token", + tenant_name="oidc", + domain_name="project_id2", + ) + self.auth_instance.auth_token = "mock" + + def test_authenticate_valid_project_id(self): + auth = OpenStackIdentity_3_0_Connection_OIDC_access_token( + auth_url="http://none", + user_id="idp", + key="token", + token_scope="project", + tenant_name="oidc", + domain_name="project_id2", + ) + auth.authenticate() + + def test_authenticate_invalid_project_id(self): + auth = OpenStackIdentity_3_0_Connection_OIDC_access_token( + auth_url="http://none", + user_id="idp", + key="token", + token_scope="project", + tenant_name="oidc", + domain_name="project_id100", + ) + + expected_msg = "Project project_id100 not found" + self.assertRaisesRegex(ValueError, expected_msg, auth.authenticate) + + +class OpenStackIdentity_2_0_Connection_VOMSTests(unittest.TestCase): + def setUp(self): + mock_cls = OpenStackIdentity_2_0_Connection_VOMSMockHttp + mock_cls.type = None + OpenStackIdentity_2_0_Connection_VOMS.conn_class = mock_cls + + self.auth_instance = OpenStackIdentity_2_0_Connection_VOMS( + auth_url="http://none", user_id=None, key="/tmp/proxy.pem", tenant_name="VO" + ) + self.auth_instance.auth_token = "mock" + + def test_authenticate(self): + auth = OpenStackIdentity_2_0_Connection_VOMS( + auth_url="http://none", + user_id=None, + key="/tmp/proxy.pem", + token_scope="test", + tenant_name="VO", + ) + auth.authenticate() + + class OpenStackServiceCatalogTestCase(unittest.TestCase): - fixtures = ComputeFileFixtures('openstack') + fixtures = ComputeFileFixtures("openstack") def test_parsing_auth_v1_1(self): - data = self.fixtures.load('_v1_1__auth.json') + data = self.fixtures.load("_v1_1__auth.json") data = json.loads(data) - service_catalog = data['auth']['serviceCatalog'] + service_catalog = data["auth"]["serviceCatalog"] - catalog = OpenStackServiceCatalog(service_catalog=service_catalog, - auth_version='1.0') + catalog = OpenStackServiceCatalog(service_catalog=service_catalog, auth_version="1.0") entries = catalog.get_entries() self.assertEqual(len(entries), 3) - entry = [e for e in entries if e.service_type == 'cloudFilesCDN'][0] - self.assertEqual(entry.service_type, 'cloudFilesCDN') - self.assertEqual(entry.service_name, None) + entry = [e for e in entries if e.service_type == "cloudFilesCDN"][0] + self.assertEqual(entry.service_type, "cloudFilesCDN") + self.assertIsNone(entry.service_name) self.assertEqual(len(entry.endpoints), 2) - self.assertEqual(entry.endpoints[0].region, 'ORD') - self.assertEqual(entry.endpoints[0].url, - 'https://cdn2.clouddrive.com/v1/MossoCloudFS') - self.assertEqual(entry.endpoints[0].endpoint_type, 'external') - self.assertEqual(entry.endpoints[1].region, 'LON') - self.assertEqual(entry.endpoints[1].endpoint_type, 'external') + self.assertEqual(entry.endpoints[0].region, "ORD") + self.assertEqual(entry.endpoints[0].url, "https://cdn2.clouddrive.com/v1/MossoCloudFS") + self.assertEqual(entry.endpoints[0].endpoint_type, "external") + self.assertEqual(entry.endpoints[1].region, "LON") + self.assertEqual(entry.endpoints[1].endpoint_type, "external") def test_parsing_auth_v2(self): - data = self.fixtures.load('_v2_0__auth.json') + data = self.fixtures.load("_v2_0__auth.json") data = json.loads(data) - service_catalog = data['access']['serviceCatalog'] + service_catalog = data["access"]["serviceCatalog"] - catalog = OpenStackServiceCatalog(service_catalog=service_catalog, - auth_version='2.0') + catalog = OpenStackServiceCatalog(service_catalog=service_catalog, auth_version="2.0") entries = catalog.get_entries() - self.assertEqual(len(entries), 6) + self.assertEqual(len(entries), 11) - entry = [e for e in entries if e.service_name == 'cloudServers'][0] - self.assertEqual(entry.service_type, 'compute') - self.assertEqual(entry.service_name, 'cloudServers') + entry = [e for e in entries if e.service_name == "cloudServers"][0] + self.assertEqual(entry.service_type, "compute") + self.assertEqual(entry.service_name, "cloudServers") self.assertEqual(len(entry.endpoints), 1) - self.assertEqual(entry.endpoints[0].region, None) - self.assertEqual(entry.endpoints[0].url, - 'https://servers.api.rackspacecloud.com/v1.0/1337') - self.assertEqual(entry.endpoints[0].endpoint_type, 'external') + self.assertIsNone(entry.endpoints[0].region) + self.assertEqual(entry.endpoints[0].url, "https://servers.api.rackspacecloud.com/v1.0/1337") + self.assertEqual(entry.endpoints[0].endpoint_type, "external") def test_parsing_auth_v3(self): - data = self.fixtures.load('_v3__auth.json') + data = self.fixtures.load("_v3__auth.json") data = json.loads(data) - service_catalog = data['token']['catalog'] + service_catalog = data["token"]["catalog"] - catalog = OpenStackServiceCatalog(service_catalog=service_catalog, - auth_version='3.x') + catalog = OpenStackServiceCatalog(service_catalog=service_catalog, auth_version="3.x") entries = catalog.get_entries() self.assertEqual(len(entries), 6) - entry = [e for e in entries if e.service_type == 'volume'][0] - self.assertEqual(entry.service_type, 'volume') - self.assertEqual(entry.service_name, None) + entry = [e for e in entries if e.service_type == "volume"][0] + self.assertEqual(entry.service_type, "volume") + self.assertIsNone(entry.service_name) self.assertEqual(len(entry.endpoints), 3) - self.assertEqual(entry.endpoints[0].region, 'regionOne') - self.assertEqual(entry.endpoints[0].endpoint_type, 'external') - self.assertEqual(entry.endpoints[1].region, 'regionOne') - self.assertEqual(entry.endpoints[1].endpoint_type, 'admin') - self.assertEqual(entry.endpoints[2].region, 'regionOne') - self.assertEqual(entry.endpoints[2].endpoint_type, 'internal') + self.assertEqual(entry.endpoints[0].region, "regionOne") + self.assertEqual(entry.endpoints[0].endpoint_type, "external") + self.assertEqual(entry.endpoints[1].region, "regionOne") + self.assertEqual(entry.endpoints[1].endpoint_type, "admin") + self.assertEqual(entry.endpoints[2].region, "regionOne") + self.assertEqual(entry.endpoints[2].endpoint_type, "internal") def test_get_public_urls(self): - data = self.fixtures.load('_v2_0__auth.json') + data = self.fixtures.load("_v2_0__auth.json") data = json.loads(data) - service_catalog = data['access']['serviceCatalog'] + service_catalog = data["access"]["serviceCatalog"] - catalog = OpenStackServiceCatalog(service_catalog=service_catalog, - auth_version='2.0') + catalog = OpenStackServiceCatalog(service_catalog=service_catalog, auth_version="2.0") - public_urls = catalog.get_public_urls(service_type='object-store') - expected_urls = ['https://storage101.lon1.clouddrive.com/v1/MossoCloudFS_11111-111111111-1111111111-1111111', - 'https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_11111-111111111-1111111111-1111111'] + public_urls = catalog.get_public_urls(service_type="object-store") + expected_urls = [ + "https://storage101.lon1.clouddrive.com/v1/MossoCloudFS_11111-111111111-1111111111-1111111", + "https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_11111-111111111-1111111111-1111111", + ] self.assertEqual(public_urls, expected_urls) def test_get_regions(self): - data = self.fixtures.load('_v2_0__auth.json') + data = self.fixtures.load("_v2_0__auth.json") data = json.loads(data) - service_catalog = data['access']['serviceCatalog'] + service_catalog = data["access"]["serviceCatalog"] - catalog = OpenStackServiceCatalog(service_catalog=service_catalog, - auth_version='2.0') + catalog = OpenStackServiceCatalog(service_catalog=service_catalog, auth_version="2.0") - regions = catalog.get_regions(service_type='object-store') - self.assertEqual(regions, ['LON', 'ORD']) + regions = catalog.get_regions(service_type="object-store") + self.assertEqual(regions, ["LON", "ORD"]) - regions = catalog.get_regions(service_type='invalid') + regions = catalog.get_regions(service_type="invalid") self.assertEqual(regions, []) def test_get_service_types(self): - data = self.fixtures.load('_v2_0__auth.json') + data = self.fixtures.load("_v2_0__auth.json") data = json.loads(data) - service_catalog = data['access']['serviceCatalog'] + service_catalog = data["access"]["serviceCatalog"] - catalog = OpenStackServiceCatalog(service_catalog=service_catalog, - auth_version='2.0') + catalog = OpenStackServiceCatalog(service_catalog=service_catalog, auth_version="2.0") service_types = catalog.get_service_types() - self.assertEqual(service_types, ['compute', 'object-store', - 'rax:object-cdn']) - - service_types = catalog.get_service_types(region='ORD') - self.assertEqual(service_types, ['rax:object-cdn']) + self.assertEqual( + service_types, + [ + "compute", + "image", + "network", + "object-store", + "rax:object-cdn", + "reservation", + "volumev2", + "volumev3", + ], + ) + + service_types = catalog.get_service_types(region="ORD") + self.assertEqual(service_types, ["rax:object-cdn"]) def test_get_service_names(self): - data = self.fixtures.load('_v2_0__auth.json') + data = self.fixtures.load("_v2_0__auth.json") data = json.loads(data) - service_catalog = data['access']['serviceCatalog'] + service_catalog = data["access"]["serviceCatalog"] - catalog = OpenStackServiceCatalog(service_catalog=service_catalog, - auth_version='2.0') + catalog = OpenStackServiceCatalog(service_catalog=service_catalog, auth_version="2.0") service_names = catalog.get_service_names() - self.assertEqual(service_names, ['cloudFiles', 'cloudFilesCDN', - 'cloudServers', - 'cloudServersOpenStack', - 'cloudServersPreprod', - 'nova']) - - service_names = catalog.get_service_names(service_type='compute') - self.assertEqual(service_names, ['cloudServers', - 'cloudServersOpenStack', - 'cloudServersPreprod', - 'nova']) + self.assertEqual( + service_names, + [ + "blazar", + "cinderv2", + "cinderv3", + "cloudFiles", + "cloudFilesCDN", + "cloudServers", + "cloudServersOpenStack", + "cloudServersPreprod", + "glance", + "neutron", + "nova", + ], + ) + + service_names = catalog.get_service_names(service_type="compute") + self.assertEqual( + service_names, + ["cloudServers", "cloudServersOpenStack", "cloudServersPreprod", "nova"], + ) class OpenStackIdentity_2_0_MockHttp(MockHttp): - fixtures = ComputeFileFixtures('openstack_identity/v2') - json_content_headers = {'content-type': 'application/json; charset=UTF-8'} + fixtures = ComputeFileFixtures("openstack_identity/v2") + json_content_headers = {"content-type": "application/json; charset=UTF-8"} def _v2_0_tenants(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('v2_0_tenants.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + if method == "GET": + body = self.fixtures.load("v2_0_tenants.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) raise NotImplementedError() class OpenStackIdentity_3_0_MockHttp(MockHttp): - fixtures = ComputeFileFixtures('openstack_identity/v3') - json_content_headers = {'content-type': 'application/json; charset=UTF-8'} + fixtures = ComputeFileFixtures("openstack_identity/v3") + json_content_headers = {"content-type": "application/json; charset=UTF-8"} def _v3(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('v3_versions.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + if method == "GET": + body = self.fixtures.load("v3_versions.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) raise NotImplementedError() def _v3_domains(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('v3_domains.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + if method == "GET": + body = self.fixtures.load("v3_domains.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) raise NotImplementedError() def _v3_projects(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('v3_projects.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + if method == "GET": + body = self.fixtures.load("v3_projects.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + raise NotImplementedError() + + def _v3_projects_UNAUTHORIZED(self, method, url, body, headers): + if method == "GET": + body = ComputeFileFixtures("openstack").load("_v3__auth.json") + return ( + httplib.UNAUTHORIZED, + body, + self.json_content_headers, + httplib.responses[httplib.UNAUTHORIZED], + ) + raise NotImplementedError() + + def _v3_OS_FEDERATION_identity_providers_test_user_id_protocols_test_tenant_auth( + self, method, url, body, headers + ): + if method == "GET": + if "Authorization" not in headers: + return ( + httplib.UNAUTHORIZED, + "", + headers, + httplib.responses[httplib.OK], + ) + + if headers["Authorization"] == "Bearer test_key": + response_body = ComputeFileFixtures("openstack").load("_v3__auth.json") + response_headers = { + "Content-Type": "application/json", + "x-subject-token": "foo-bar", + } + return ( + httplib.OK, + response_body, + response_headers, + httplib.responses[httplib.OK], + ) + + return (httplib.UNAUTHORIZED, "{}", headers, httplib.responses[httplib.OK]) + raise NotImplementedError() + + def _v3_auth_tokens(self, method, url, body, headers): + if method == "GET": + body = json.loads(ComputeFileFixtures("openstack").load("_v3__auth.json")) + body["token"]["expires_at"] = TOMORROW.isoformat() + headers = self.json_content_headers.copy() + headers["x-subject-token"] = "00000000000000000000000000000000" + return ( + httplib.OK, + json.dumps(body), + headers, + httplib.responses[httplib.OK], + ) + if method == "POST": + status = httplib.OK + data = json.loads(body) + if "password" in data["auth"]["identity"]: + if ( + data["auth"]["identity"]["password"]["user"]["domain"]["name"] != "test_domain" + or data["auth"]["scope"]["project"]["domain"]["id"] != "test_tenant_domain_id" + ): + status = httplib.UNAUTHORIZED + + body = ComputeFileFixtures("openstack").load("_v3__auth.json") + headers = self.json_content_headers.copy() + headers["x-subject-token"] = "00000000000000000000000000000000" + return (status, body, headers, httplib.responses[httplib.OK]) + raise NotImplementedError() + + def _v3_auth_tokens_GET_UNAUTHORIZED_POST_OK(self, method, url, body, headers): + if method == "GET": + body = ComputeFileFixtures("openstack").load("_v3__auth_unauthorized.json") + return ( + httplib.UNAUTHORIZED, + body, + self.json_content_headers, + httplib.responses[httplib.UNAUTHORIZED], + ) + if method == "POST": + return self._v3_auth_tokens(method, url, body, headers) raise NotImplementedError() def _v3_users(self, method, url, body, headers): - if method == 'GET': + if method == "GET": # list users - body = self.fixtures.load('v3_users.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) - elif method == 'POST': + body = self.fixtures.load("v3_users.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + elif method == "POST": # create user - body = self.fixtures.load('v3_create_user.json') - return (httplib.CREATED, body, self.json_content_headers, - httplib.responses[httplib.CREATED]) + body = self.fixtures.load("v3_create_user.json") + return ( + httplib.CREATED, + body, + self.json_content_headers, + httplib.responses[httplib.CREATED], + ) raise NotImplementedError() def _v3_users_a(self, method, url, body, headers): - if method == 'PATCH': + if method == "GET": + # look up a user + body = self.fixtures.load("v3_users_a.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + if method == "PATCH": # enable / disable user - body = self.fixtures.load('v3_users_a.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("v3_users_a.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + raise NotImplementedError() + + def _v3_users_b(self, method, url, body, headers): + if method == "GET": + # look up a user + body = self.fixtures.load("v3_users_b.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + raise NotImplementedError() + + def _v3_users_c(self, method, url, body, headers): + if method == "GET": + # look up a user + body = self.fixtures.load("v3_users_c.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) raise NotImplementedError() def _v3_roles(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('v3_roles.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + if method == "GET": + body = self.fixtures.load("v3_roles.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) raise NotImplementedError() def _v3_domains_default_users_a_roles_a(self, method, url, body, headers): - if method == 'PUT': + if method == "PUT": # grant domain role - body = '' - return (httplib.NO_CONTENT, body, self.json_content_headers, - httplib.responses[httplib.NO_CONTENT]) - elif method == 'DELETE': + body = "" + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.NO_CONTENT], + ) + elif method == "DELETE": # revoke domain role - body = '' - return (httplib.NO_CONTENT, body, self.json_content_headers, - httplib.responses[httplib.NO_CONTENT]) + body = "" + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.NO_CONTENT], + ) raise NotImplementedError() def _v3_projects_a_users_a_roles_a(self, method, url, body, headers): - if method == 'PUT': + if method == "PUT": # grant project role - body = '' - return (httplib.NO_CONTENT, body, self.json_content_headers, - httplib.responses[httplib.NO_CONTENT]) - elif method == 'DELETE': + body = "" + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.NO_CONTENT], + ) + elif method == "DELETE": # revoke project role - body = '' - return (httplib.NO_CONTENT, body, self.json_content_headers, - httplib.responses[httplib.NO_CONTENT]) + body = "" + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.NO_CONTENT], + ) raise NotImplementedError() def _v3_domains_default(self, method, url, body, headers): - if method == 'GET': + if method == "GET": # get domain - body = self.fixtures.load('v3_domains_default.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("v3_domains_default.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) raise NotImplementedError() def _v3_users_a_projects(self, method, url, body, headers): - if method == 'GET': + if method == "GET": # get user projects - body = self.fixtures.load('v3_users_a_projects.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("v3_users_a_projects.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) raise NotImplementedError() def _v3_domains_default_users_a_roles(self, method, url, body, headers): - if method == 'GET': + if method == "GET": # get user domain roles - body = self.fixtures.load('v3_domains_default_users_a_roles.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("v3_domains_default_users_a_roles.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + raise NotImplementedError() + + def _v3_OS_FEDERATION_identity_providers_idp_protocols_oidc_auth( + self, method, url, body, headers + ): + if method == "GET": + headers = self.json_content_headers.copy() + headers["x-subject-token"] = "00000000000000000000000000000000" + return (httplib.OK, body, headers, httplib.responses[httplib.OK]) + raise NotImplementedError() + + def _v3_OS_FEDERATION_projects(self, method, url, body, headers): + if method == "GET": + # get user projects + body = json.dumps( + { + "projects": [ + {"id": "project_id", "name": "project_name"}, + {"id": "project_id2", "name": "project_name2"}, + ] + } + ) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + raise NotImplementedError() + + def _v3_auth_projects(self, method, url, body, headers): + if method == "GET": + # get user projects + body = json.dumps( + { + "projects": [ + {"id": "project_id", "name": "project_name"}, + {"id": "project_id2", "name": "project_name2"}, + ] + } + ) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + raise NotImplementedError() + + +class OpenStackIdentity_3_0_AppCred_MockHttp(OpenStackIdentity_3_0_MockHttp): + def _v3_auth_tokens(self, method, url, body, headers): + if method == "POST": + status = httplib.OK + data = json.loads(body) + if "application_credential" not in data["auth"]["identity"]["methods"]: + status = httplib.UNAUTHORIZED + else: + appcred = data["auth"]["identity"]["application_credential"] + if appcred["id"] != "appcred_id" or appcred["secret"] != "appcred_secret": + status = httplib.UNAUTHORIZED + + body = ComputeFileFixtures("openstack").load("_v3__auth.json") + headers = self.json_content_headers.copy() + headers["x-subject-token"] = "00000000000000000000000000000000" + return (status, body, headers, httplib.responses[httplib.OK]) + raise NotImplementedError() + + +class OpenStackIdentity_3_0_federation_projects_MockHttp(OpenStackIdentity_3_0_MockHttp): + fixtures = ComputeFileFixtures("openstack_identity/v3") + json_content_headers = {"content-type": "application/json; charset=UTF-8"} + + def _v3_OS_FEDERATION_projects(self, method, url, body, headers): + if method == "GET": + # get user projects + body = json.dumps({"projects": [{"id": "project_id"}]}) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + raise NotImplementedError() + + def _v3_auth_projects(self, method, url, body, headers): + return ( + httplib.INTERNAL_SERVER_ERROR, + body, + self.json_content_headers, + httplib.responses[httplib.INTERNAL_SERVER_ERROR], + ) + + +class OpenStackIdentity_2_0_Connection_VOMSMockHttp(MockHttp): + fixtures = ComputeFileFixtures("openstack_identity/v2") + json_content_headers = {"content-type": "application/json; charset=UTF-8"} + + def _v2_0_tokens(self, method, url, body, headers): + if method == "POST": + status = httplib.UNAUTHORIZED + data = json.loads(body) + if "voms" in data["auth"] and data["auth"]["voms"] is True: + status = httplib.OK + + body = ComputeFileFixtures("openstack").load("_v2_0__auth.json") + headers = self.json_content_headers.copy() + headers["x-subject-token"] = "00000000000000000000000000000000" + return (status, body, headers, httplib.responses[httplib.OK]) + raise NotImplementedError() + + def _v2_0_tenants(self, method, url, body, headers): + if method == "GET": + # get user projects + body = json.dumps({"tenant": [{"name": "tenant_name"}]}) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) raise NotImplementedError() -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/common/test_osc.py b/libcloud/test/common/test_osc.py new file mode 100644 index 0000000000..351c340fad --- /dev/null +++ b/libcloud/test/common/test_osc.py @@ -0,0 +1,139 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import unittest +from datetime import datetime + +from libcloud.test import LibcloudTestCase +from libcloud.common.osc import OSCRequestSignerAlgorithmV4 +from libcloud.compute.providers import Provider, get_driver + + +class OSCRequestSignerAlgorithmV4TestCase(LibcloudTestCase): + def setUp(self): + cls = get_driver(Provider.OUTSCALE) + self.driver = cls( + key="my_key", secret="my_secret", region="my_region", service="my_service" + ) + self.now = datetime(2015, 3, 4, hour=17, minute=34, second=52) + self.version = "latest" + self.signer = OSCRequestSignerAlgorithmV4( + access_key=self.driver.key, + access_secret=self.driver.secret, + version=self.version, + connection=self.driver.connection, + ) + + def test_v4_signature_contains_user_id(self): + action = "ReadImages" + headers = self.signer.get_request_headers( + action=action, + data="{}", + service_name=self.driver.service_name, + region=self.driver.region, + ) + self.assertIn("Credential=my_key/", headers["Authorization"]) + + def test_v4_signature_contains_credential_scope(self): + action = "ReadImages" + headers = self.signer.get_request_headers( + action=action, + data="{}", + service_name=self.driver.service_name, + region=self.driver.region, + ) + self.assertIn( + "Credential=my_key/{}/my_region/my_service/osc4_request".format( + datetime.utcnow().strftime("%Y%m%d") + ), + headers["Authorization"], + ) + + def test_v4_signature_contains_signed_headers(self): + action = "ReadImages" + headers = self.signer.get_request_headers( + action=action, + data="{}", + service_name=self.driver.service_name, + region=self.driver.region, + ) + self.assertIn("SignedHeaders=content-type;host;x-osc-date", headers["Authorization"]) + + def test_get_signed_headers_contains_all_headers_lowercased(self): + path = "my_region/my_service/outscale.com" + headers = { + "Content-Type": "application/json; charset=utf-8", + "X-Osc-Date": self.now, + "Host": path, + } + signed_headers = self.signer._get_signed_headers(headers) + self.assertIn("content-type", signed_headers) + self.assertIn("host", signed_headers) + self.assertIn("x-osc-date", signed_headers) + + def test_get_signed_headers_concats_headers_sorted_lexically(self): + path = "my_region/my_service/outscale.com" + headers = { + "Content-Type": "application/json; charset=utf-8", + "X-Osc-Date": self.now, + "Host": path, + } + signed_headers = self.signer._get_signed_headers(headers) + self.assertEqual(signed_headers, "content-type;host;x-osc-date") + + def test_get_credential_scope(self): + scope = self.signer._get_credential_scope(self.now) + self.assertEqual(scope, "20150304/my_region/my_service/osc4_request") + + def test_get_canonical_headers_joins_all_headers(self): + headers = { + "Content-Type": "application/json; charset=utf-8", + "X-Osc-Date": self.now, + "Host": "my_region/my_service/outscale.com", + } + self.assertEqual( + self.signer._get_canonical_headers(headers), + "content-type:application/json; charset=utf-8\n" + "host:my_region/my_service/outscale.com\n" + "x-osc-date:2015-03-04 17:34:52\n", + ) + + def test_get_canonical_headers_sorts_headers_lexically(self): + headers = { + "accept-encoding": "gzip,deflate", + "host": "my_host", + "1st-header": "2", + "x-osc-date": "20150304T173452Z", + "user-agent": "my-ua", + } + self.assertEqual( + self.signer._get_canonical_headers(headers), + "1st-header:2\n" + "accept-encoding:gzip,deflate\n" + "host:my_host\n" + "user-agent:my-ua\n" + "x-osc-date:20150304T173452Z\n", + ) + + def test_get_canonical_headers_lowercases_headers_names(self): + headers = {"Accept-Encoding": "GZIP,DEFLATE", "User-Agent": "My-UA"} + self.assertEqual( + self.signer._get_canonical_headers(headers), + "accept-encoding:GZIP,DEFLATE\n" "user-agent:My-UA\n", + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/libcloud/test/common/test_ovh.py b/libcloud/test/common/test_ovh.py new file mode 100644 index 0000000000..157da0cdf0 --- /dev/null +++ b/libcloud/test/common/test_ovh.py @@ -0,0 +1,32 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import re + +from libcloud.test import MockHttp + +FORMAT_URL = re.compile(r"[./?=&-]") + + +class BaseOvhMockHttp(MockHttp): + def _get_method_name(self, type, use_param, qs, path): + if type: + meth_name = "_json{}_{}_{}".format(FORMAT_URL.sub("_", path), "get", type) + return meth_name + return "_json" + + def _json(self, method, url, body, headers): + meth_name = "_json{}_{}".format(FORMAT_URL.sub("_", url), method.lower()) + return getattr(self, meth_name)(method, url, body, headers) diff --git a/libcloud/test/common/test_retry_limit.py b/libcloud/test/common/test_retry_limit.py new file mode 100644 index 0000000000..935a8040fd --- /dev/null +++ b/libcloud/test/common/test_retry_limit.py @@ -0,0 +1,61 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import ssl +import socket +from unittest.mock import Mock, MagicMock, patch + +from libcloud.test import unittest +from libcloud.common.base import Connection +from libcloud.utils.retry import TRANSIENT_SSL_ERROR + +CONFLICT_RESPONSE_STATUS = [ + ("status", "429"), + ("reason", "CONFLICT"), + ("retry_after", "3"), + ("content-type", "application/json"), +] +SIMPLE_RESPONSE_STATUS = ("HTTP/1.1", 429, "CONFLICT") + + +@patch("os.environ", {"LIBCLOUD_RETRY_FAILED_HTTP_REQUESTS": True}) +class FailedRequestRetryTestCase(unittest.TestCase): + def test_retry_connection(self): + con = Connection(timeout=0.2, retry_delay=0.1) + con.connection = Mock() + connect_method = "libcloud.common.base.Connection.request" + + with patch(connect_method) as mock_connect: + try: + mock_connect.side_effect = socket.gaierror("") + con.request("/") + except socket.gaierror: + pass + + def test_retry_connection_ssl_error(self): + conn = Connection(timeout=0.2, retry_delay=0.1) + + with patch.object(conn, "connect", Mock()): + with patch.object(conn, "connection") as connection: + connection.request = MagicMock( + __name__="request", side_effect=ssl.SSLError(TRANSIENT_SSL_ERROR) + ) + + self.assertRaises(ssl.SSLError, conn.request, "/") + self.assertGreater(connection.request.call_count, 1) + + +if __name__ == "__main__": + unittest.main() diff --git a/libcloud/test/common/test_types.py b/libcloud/test/common/test_types.py new file mode 100644 index 0000000000..339df341c1 --- /dev/null +++ b/libcloud/test/common/test_types.py @@ -0,0 +1,32 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import unittest + +from libcloud.common.types import Type +from libcloud.compute.types import NodeState + + +class TypeTest(unittest.TestCase): + def test_Type(self): + class TestType(Type): + TESTING = "testing" + + self.assertEqual(hash(TestType.TESTING), hash("testing")) + self.assertIn(TestType.TESTING, {"testing"}) + + def test_NodeState(self): + self.assertEqual(hash(NodeState.RUNNING), hash("running")) + self.assertIn(NodeState.RUNNING, {"running"}) diff --git a/libcloud/test/common/test_upcloud.py b/libcloud/test/common/test_upcloud.py new file mode 100644 index 0000000000..9400bbe3f5 --- /dev/null +++ b/libcloud/test/common/test_upcloud.py @@ -0,0 +1,356 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import sys +import json +from unittest.mock import Mock, call + +from libcloud.test import unittest +from libcloud.compute.base import NodeSize, NodeImage, NodeLocation, NodeAuthSSHKey +from libcloud.common.upcloud import ( + PlanPrice, + UpcloudNodeDestroyer, + UpcloudNodeOperations, + UpcloudTimeoutException, + UpcloudCreateNodeRequestBody, + _StorageDevice, +) + + +class TestUpcloudCreateNodeRequestBody(unittest.TestCase): + def setUp(self): + self.image = NodeImage( + id="01000000-0000-4000-8000-000030060200", + name="Ubuntu Server 16.04 LTS (Xenial Xerus)", + driver="", + extra={"type": "template"}, + ) + self.location = NodeLocation(id="fi-hel1", name="Helsinki #1", country="FI", driver="") + self.size = NodeSize( + id="1xCPU-1GB", + name="1xCPU-1GB", + ram=1024, + disk=30, + bandwidth=2048, + extra={"core_number": 1, "storage_tier": "maxiops"}, + price=None, + driver="", + ) + + def test_creating_node_from_template_image(self): + body = UpcloudCreateNodeRequestBody( + name="ts", image=self.image, location=self.location, size=self.size + ) + json_body = body.to_json() + dict_body = json.loads(json_body) + expected_body = { + "server": { + "title": "ts", + "hostname": "localhost", + "plan": "1xCPU-1GB", + "zone": "fi-hel1", + "login_user": {"username": "root", "create_password": "yes"}, + "storage_devices": { + "storage_device": [ + { + "action": "clone", + "title": "Ubuntu Server 16.04 LTS (Xenial Xerus)", + "storage": "01000000-0000-4000-8000-000030060200", + "size": 30, + "tier": "maxiops", + } + ] + }, + } + } + self.assertDictEqual(expected_body, dict_body) + + def test_creating_node_from_cdrom_image(self): + image = NodeImage( + id="01000000-0000-4000-8000-000030060200", + name="Ubuntu Server 16.04 LTS (Xenial Xerus)", + driver="", + extra={"type": "cdrom"}, + ) + body = UpcloudCreateNodeRequestBody( + name="ts", image=image, location=self.location, size=self.size + ) + json_body = body.to_json() + dict_body = json.loads(json_body) + expected_body = { + "server": { + "title": "ts", + "hostname": "localhost", + "plan": "1xCPU-1GB", + "zone": "fi-hel1", + "login_user": {"username": "root", "create_password": "yes"}, + "storage_devices": { + "storage_device": [ + { + "action": "create", + "size": 30, + "tier": "maxiops", + "title": "Ubuntu Server 16.04 LTS (Xenial Xerus)", + }, + { + "action": "attach", + "storage": "01000000-0000-4000-8000-000030060200", + "type": "cdrom", + }, + ] + }, + } + } + self.assertDictEqual(expected_body, dict_body) + + def test_creating_node_using_ssh_keys(self): + auth = NodeAuthSSHKey("sshkey") + + body = UpcloudCreateNodeRequestBody( + name="ts", + image=self.image, + location=self.location, + size=self.size, + auth=auth, + ) + json_body = body.to_json() + dict_body = json.loads(json_body) + expected_body = { + "server": { + "title": "ts", + "hostname": "localhost", + "plan": "1xCPU-1GB", + "zone": "fi-hel1", + "login_user": { + "username": "root", + "ssh_keys": {"ssh_key": ["sshkey"]}, + }, + "storage_devices": { + "storage_device": [ + { + "action": "clone", + "size": 30, + "title": "Ubuntu Server 16.04 LTS (Xenial Xerus)", + "tier": "maxiops", + "storage": "01000000-0000-4000-8000-000030060200", + } + ] + }, + } + } + self.assertDictEqual(expected_body, dict_body) + + def test_creating_node_using_hostname(self): + body = UpcloudCreateNodeRequestBody( + name="ts", + image=self.image, + location=self.location, + size=self.size, + ex_hostname="myhost.upcloud.com", + ) + json_body = body.to_json() + dict_body = json.loads(json_body) + expected_body = { + "server": { + "title": "ts", + "hostname": "myhost.upcloud.com", + "plan": "1xCPU-1GB", + "zone": "fi-hel1", + "login_user": {"username": "root", "create_password": "yes"}, + "storage_devices": { + "storage_device": [ + { + "action": "clone", + "title": "Ubuntu Server 16.04 LTS (Xenial Xerus)", + "storage": "01000000-0000-4000-8000-000030060200", + "tier": "maxiops", + "size": 30, + } + ] + }, + } + } + self.assertDictEqual(expected_body, dict_body) + + def test_creating_node_with_non_default_username(self): + body = UpcloudCreateNodeRequestBody( + name="ts", + image=self.image, + location=self.location, + size=self.size, + ex_username="someone", + ) + json_body = body.to_json() + dict_body = json.loads(json_body) + + login_user = dict_body["server"]["login_user"] + self.assertDictEqual({"username": "someone", "create_password": "yes"}, login_user) + + def test_creating_node_with_metadata_enabled(self): + body = UpcloudCreateNodeRequestBody( + name="ts", + image=self.image, + location=self.location, + size=self.size, + ex_metadata="yes", + ) + json_body = body.to_json() + dict_body = json.loads(json_body) + + self.assertEqual(dict_body["server"]["metadata"], "yes") + + +class TestStorageDevice(unittest.TestCase): + def setUp(self): + self.image = NodeImage( + id="01000000-0000-4000-8000-000030060200", + name="Ubuntu Server 16.04 LTS (Xenial Xerus)", + driver="", + extra={"type": "template"}, + ) + self.size = NodeSize( + id="1xCPU-1GB", + name="1xCPU-1GB", + ram=1024, + disk=30, + bandwidth=2048, + extra={"core_number": 1}, + price=None, + driver="", + ) + + def test_storage_tier_default_value(self): + storagedevice = _StorageDevice(self.image, self.size) + d = storagedevice.to_dict() + + self.assertEqual(d["storage_device"][0]["tier"], "maxiops") + + def test_storage_tier_given(self): + self.size.extra["storage_tier"] = "hdd" + storagedevice = _StorageDevice(self.image, self.size) + d = storagedevice.to_dict() + + self.assertEqual(d["storage_device"][0]["tier"], "hdd") + + +class TestUpcloudNodeDestroyer(unittest.TestCase): + def setUp(self): + self.mock_sleep = Mock() + self.mock_operations = Mock(spec=UpcloudNodeOperations) + self.destroyer = UpcloudNodeDestroyer(self.mock_operations, sleep_func=self.mock_sleep) + + def test_node_already_in_stopped_state(self): + self.mock_operations.get_node_state.side_effect = ["stopped"] + + self.assertTrue(self.destroyer.destroy_node(1)) + + self.assertTrue(self.mock_operations.stop_node.call_count == 0) + self.mock_operations.destroy_node.assert_called_once_with(1) + + def test_node_in_error_state(self): + self.mock_operations.get_node_state.side_effect = ["error"] + + self.assertFalse(self.destroyer.destroy_node(1)) + + self.assertTrue(self.mock_operations.stop_node.call_count == 0) + self.assertTrue(self.mock_operations.destroy_node.call_count == 0) + + def test_node_in_started_state(self): + self.mock_operations.get_node_state.side_effect = ["started", "stopped"] + + self.assertTrue(self.destroyer.destroy_node(1)) + + self.mock_operations.stop_node.assert_called_once_with(1) + self.mock_operations.destroy_node.assert_called_once_with(1) + + def test_node_in_maintenace_state(self): + self.mock_operations.get_node_state.side_effect = [ + "maintenance", + "maintenance", + None, + ] + + self.assertTrue(self.destroyer.destroy_node(1)) + + self.mock_sleep.assert_has_calls( + [call(self.destroyer.WAIT_AMOUNT), call(self.destroyer.WAIT_AMOUNT)] + ) + + self.assertTrue(self.mock_operations.stop_node.call_count == 0) + self.assertTrue(self.mock_operations.destroy_node.call_count == 0) + + def test_node_statys_in_started_state_for_awhile(self): + self.mock_operations.get_node_state.side_effect = [ + "started", + "started", + "stopped", + ] + + self.assertTrue(self.destroyer.destroy_node(1)) + + # Only one all for stop should be done + self.mock_operations.stop_node.assert_called_once_with(1) + self.mock_sleep.assert_has_calls([call(self.destroyer.WAIT_AMOUNT)]) + self.mock_operations.destroy_node.assert_called_once_with(1) + + def test_reuse(self): + """Verify that internal flag self.destroyer._stop_node is handled properly""" + self.mock_operations.get_node_state.side_effect = [ + "started", + "stopped", + "started", + "stopped", + ] + self.assertTrue(self.destroyer.destroy_node(1)) + self.assertTrue(self.destroyer.destroy_node(1)) + + self.assertEqual(self.mock_sleep.call_count, 0) + self.assertEqual(self.mock_operations.stop_node.call_count, 2) + + def test_timeout(self): + self.mock_operations.get_node_state.side_effect = ["maintenance"] * 50 + + self.assertRaises(UpcloudTimeoutException, self.destroyer.destroy_node, 1) + + def test_timeout_reuse(self): + """Verify sleep count is handled properly""" + self.mock_operations.get_node_state.side_effect = ["maintenance"] * 50 + self.assertRaises(UpcloudTimeoutException, self.destroyer.destroy_node, 1) + + self.mock_operations.get_node_state.side_effect = ["maintenance", None] + self.assertTrue(self.destroyer.destroy_node(1)) + + +class TestPlanPrice(unittest.TestCase): + def setUp(self): + prices = [ + {"name": "uk-lon1", "server_plan_1xCPU-1GB": {"amount": 1, "price": 1.488}}, + {"name": "fi-hel1", "server_plan_1xCPU-1GB": {"amount": 1, "price": 1.588}}, + ] + self.pp = PlanPrice(prices) + + def test_zone_prices(self): + location = NodeLocation(id="fi-hel1", name="Helsinki #1", country="FI", driver=None) + self.assertEqual(self.pp.get_price("1xCPU-1GB", location), 1.588) + + def test_plan_not_found_in_zone(self): + location = NodeLocation(id="no_such_location", name="", country="", driver=None) + self.assertIsNone(self.pp.get_price("1xCPU-1GB", location)) + + def test_no_location_given(self): + self.assertIsNone(self.pp.get_price("1xCPU-1GB")) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/__init__.py b/libcloud/test/compute/__init__.py index 1db7b2d115..3274d75149 100644 --- a/libcloud/test/compute/__init__.py +++ b/libcloud/test/compute/__init__.py @@ -13,11 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from libcloud.compute.base import Node, NodeImage, NodeLocation, StorageVolume from libcloud.pricing import get_pricing +from libcloud.compute.base import Node, NodeImage, NodeLocation, StorageVolume -class TestCaseMixin(object): +class TestCaseMixin: should_list_locations = True should_have_pricing = False should_list_volumes = False @@ -35,12 +35,11 @@ def test_list_sizes_response(self): # Check that size values are ints or None self.assertTrue(size.ram is None or isinstance(size.ram, int)) self.assertTrue(size.disk is None or isinstance(size.disk, int)) - self.assertTrue(size.bandwidth is None or - isinstance(size.bandwidth, int)) + self.assertTrue(size.bandwidth is None or isinstance(size.bandwidth, int)) # Check that price values are ints, floats, or None. - self.assertTrue(size.price is None or - isinstance(size.price, float) or - isinstance(size.price, int)) + self.assertTrue( + size.price is None or isinstance(size.price, float) or isinstance(size.price, int) + ) def test_list_images_response(self): images = self.driver.list_images() @@ -70,9 +69,7 @@ def test_create_node_response(self): # should return a node object size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] - node = self.driver.create_node(name='node-name', - image=image, - size=size) + node = self.driver.create_node(name="node-name", image=image, size=size) self.assertTrue(isinstance(node, Node)) def test_destroy_node_response(self): @@ -91,16 +88,19 @@ def test_get_pricing_success(self): if not self.should_have_pricing: return None - driver_type = 'compute' + driver_type = "compute" try: - get_pricing(driver_type=driver_type, - driver_name=self.driver.api_name) + get_pricing(driver_type=driver_type, driver_name=self.driver.api_name) except KeyError: - self.fail("No {driver_type!r} pricing info for {driver}.".format( - driver=self.driver.__class__.__name__, - driver_type=driver_type, - )) + self.fail( + "No {driver_type!r} pricing info for {driver}.".format( + driver=self.driver.__class__.__name__, + driver_type=driver_type, + ) + ) + if __name__ == "__main__": import doctest + doctest.testmod() diff --git a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_5_vm_3_not_allocated.xml b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_5_vm_3_not_allocated.xml index dc28342acf..5511ee7521 100644 --- a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_5_vm_3_not_allocated.xml +++ b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_5_vm_3_not_allocated.xml @@ -21,7 +21,6 @@ 1 - 27262976 0 3 1 diff --git a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_5_vms.xml b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_5_vms.xml index ecb7303c70..a1ee8e9c1c 100644 --- a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_5_vms.xml +++ b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_5_vms.xml @@ -19,5 +19,5 @@ - 1272629760311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128NOT_ALLOCATED914f8125-33d3-4fe3-a162-5d6f5bf326140300 + 10311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128NOT_ALLOCATED914f8125-33d3-4fe3-a162-5d6f5bf326140300 diff --git a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_3.xml b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_3.xml index 75b1e68f54..5e7dd6e4ee 100644 --- a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_3.xml +++ b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_3.xml @@ -19,4 +19,4 @@ - 1272629760311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128NOT_ALLOCATED914f8125-33d3-4fe3-a162-5d6f5bf32614590130080.12.23.43 + 10311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128NOT_ALLOCATED914f8125-33d3-4fe3-a162-5d6f5bf32614590130080.12.23.43 diff --git a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_3_allocated.xml b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_3_allocated.xml index 4c8d4d6d70..254544fd86 100644 --- a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_3_allocated.xml +++ b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_3_allocated.xml @@ -19,4 +19,4 @@ - 1272629760311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128ALLOCATED914f8125-33d3-4fe3-a162-5d6f5bf32614590130080.12.23.43 + 10311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128ALLOCATED914f8125-33d3-4fe3-a162-5d6f5bf32614590130080.12.23.43 diff --git a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_3_deployed.xml b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_3_deployed.xml index fb94d0c726..2efd32cbf2 100644 --- a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_3_deployed.xml +++ b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_3_deployed.xml @@ -19,4 +19,4 @@ - 1272629760311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128ON914f8125-33d3-4fe3-a162-5d6f5bf32614590130080.12.23.43 + 10311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128ON914f8125-33d3-4fe3-a162-5d6f5bf32614590130080.12.23.43 diff --git a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_creation_ok.xml b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_creation_ok.xml index 3bc9f0b2b8..068026ef83 100644 --- a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_creation_ok.xml +++ b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vm_creation_ok.xml @@ -17,4 +17,4 @@ -1272629760311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128NOT_ALLOCATED914f8125-33d3-4fe3-a162-5d6f5bf326140 +10311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128NOT_ALLOCATED914f8125-33d3-4fe3-a162-5d6f5bf326140 diff --git a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vms.xml b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vms.xml index ecb7303c70..a1ee8e9c1c 100644 --- a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vms.xml +++ b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vms.xml @@ -19,5 +19,5 @@ - 1272629760311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128NOT_ALLOCATED914f8125-33d3-4fe3-a162-5d6f5bf326140300 + 10311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128NOT_ALLOCATED914f8125-33d3-4fe3-a162-5d6f5bf326140300 diff --git a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vms_allocated.xml b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vms_allocated.xml index c5d958962f..ce8b8ed491 100644 --- a/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vms_allocated.xml +++ b/libcloud/test/compute/fixtures/abiquo/vdc_4_vapp_6_vms_allocated.xml @@ -19,5 +19,5 @@ - 1272629760311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128ALLOCATED914f8125-33d3-4fe3-a162-5d6f5bf326140300 + 10311ABQ_914f8125-33d3-4fe3-a162-5d6f5bf32614128ALLOCATED914f8125-33d3-4fe3-a162-5d6f5bf326140300 diff --git a/libcloud/test/compute/fixtures/azure/_3761b98b_673d_526c_8d55_fee918758e6e_services_images.xml b/libcloud/test/compute/fixtures/azure/_3761b98b_673d_526c_8d55_fee918758e6e_services_images.xml index 5d31d5ef23..3817915327 100644 --- a/libcloud/test/compute/fixtures/azure/_3761b98b_673d_526c_8d55_fee918758e6e_services_images.xml +++ b/libcloud/test/compute/fixtures/azure/_3761b98b_673d_526c_8d55_fee918758e6e_services_images.xml @@ -1 +1 @@ -PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.2-x64-v5.8.8.1Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.3 with RightLink 5.8.RightScale Linux v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.3-x64-v5.8.8Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.2 with RightLink 5.8.RightScale Linux v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.3-x64-v5.8.8.5Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.3 with RightLink 5.8.RightScale Linux v13false2012-10-12T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.3-x64-v5.8.8.6Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.3 with RightLink 5.8.RightScale Linux v13false2012-11-12T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.3-x64-v5.8.8.7Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.3 with RightLink 5.8.RightScale Linux v13false2012-01-15T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.3-x64-v5.8.8.8Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.3 with RightLink 5.8.RightScale Linux v13false2012-01-25T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.3-x64-v5.8.8.9Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.3 with RightLink 5.8.RightScale Linux v13false2013-03-01T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.4-x64-v13.4Linuxfalse2013-04-19T00:00:00ZfalseRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.4-x64-v13.5.0.1Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.4 with RightLink 5.8.RightScale Linux v13false2013-07-11T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.4-x64-v13.5.0.2Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.4 with RightLink 5.8.RightScale Linux v13false2013-07-22T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.5-x64-v13.5.2Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.5 with RightLink 5.8.RightScale Linux v13false2013-12-26T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.5-x64-v13.5.3Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.5 with RightLink 5.8.RightScale Linux v13false2014-04-17T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v13.4Linuxfalse2013-04-19T00:00:00ZfalseRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v13.5.0.1Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2013-07-11T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v13.5.2Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2013-12-26T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v13.5.3Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2014-04-17T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v5.8.8Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v5.8.8.5Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2012-10-12T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v5.8.8.7Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2013-01-15T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v5.8.8.8Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2013-01-25T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__JDK-1.6.0_71-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321312[Java Platform|http://www.oracle.com/java|_blank], Standard Edition 6 (update 71) enables development of secure, portable, high-performance applications and includes a Java Development Kit (JDK), Java Runtime Environment (JRE), and tools for developing, debugging, and monitoring Java applications. WARNING: These older versions of the JRE and JDK are provided to help developers debug issues in older systems. They are not recommended for use in production. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-java-run-tomcat-application-server/|_blank]JDK 6 on Windows Server 20122014-05-01T07:00:00ZtrueJava6_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321694SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386544Java6_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321310[Java Platform|http://www.oracle.com/java|_blank], Standard Edition 7 (update 51) enables development of secure, portable, high-performance applications and includes a Java Development Kit (JDK), Java Runtime Environment (JRE), and tools for developing, debugging, and monitoring Java applications. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-java-run-tomcat-application-server|_blank]JDK 7 on Windows Server 20122014-05-01T07:00:00ZtrueJava7_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321701SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkID=386543Java7_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__JDK-1.8.0-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321310[Java Platform|http://www.oracle.com/java|_blank], Standard Edition 8 enables development of secure, portable, high-performance applications and includes a Java Development Kit (JDK), Java Runtime Environment (JRE), and tools for developing, debugging, and monitoring Java applications. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank].JDK 8 on Windows Server 2012 R22014-05-01T07:00:00ZtrueJava7_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321701SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkID=386543Java7_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-11.2.0.4.0-EE-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321683[Oracle Database|http://www.oracle.com/database|_blank] 11g R2 Enterprise Edition (11.2.0.4.0) provides comprehensive features to easily manage the most demanding transaction processing, business intelligence, and content management applications. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank].Oracle Database 11g R2 Enterprise Edition on Windows Server 2008 R22014-05-01T07:00:00ZtrueOracleDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321692SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386538OracleDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-11.2.0.4.0-EE-WebLogic-10.3.6-EE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321684[Oracle Database|http://www.oracle.com/database|_blank] 11g R2 Enterprise Edition (11.2.0.4.0) provides comprehensive features to easily manage the most demanding transaction processing, business intelligence, and content management applications. [Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 11g Enterprise Edition (10.3.6) is a leading Java application server for modern data centers. It takes full advantage of the latest hardware architectures including 64-bit addressable memory, multi-core computing systems and high-speed networks. Minimum recommended virtual machine size for this image is [Medium|http://go.microsoft.com/fwlink/?LinkID=309169|_blank].Oracle Database 11g R2 and WebLogic Server 11g Enterprise Edition on Windows Server 2008 R22014-05-01T07:00:00ZtrueOracleWeblogicDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321691MediumMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386541OracleWeblogicDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-11.2.0.4.0-SE-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321686[Oracle Database|http://www.oracle.com/database|_blank] 11g R2 Standard Edition (11.2.0.4.0) is an affordable, full-featured data management solution that is ideal for midsize companies. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank].Oracle Database 11g R2 Standard Edition on Windows Server 2008 R22014-05-01T07:00:00ZtrueOracleDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321689SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386537OracleDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-11.2.0.4.0-SE-WebLogic-10.3.6-SE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321687[Oracle Database|http://www.oracle.com/database|_blank] 11g R2 Standard Edition (11.2.0.4.0) is an affordable, full-featured data management solution that is ideal for midsize companies. [Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 11g Standard Edition (10.3.6) is a leading Java application server for enterprises of all sizes, providing developers with the tools and technologies to write enterprise applications and services quickly and operations teams with the administration capabilities to keep them up and running. Minimum recommended virtual machine size for this image is [Medium|http://go.microsoft.com/fwlink/?LinkID=309169|_blank].Oracle Database 11g R2 and WebLogic Server 11g Standard Edition on Windows Server 2008 R22014-05-01T07:00:00ZtrueOracleWeblogicDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321688MediumMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386542OracleWeblogicDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-12.1.0.1.0-0514-EE-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321314[Oracle Database|http://www.oracle.com/database|_blank] 12c Enterprise Edition (12.1.0.1.0) is a next-generation database designed for the cloud, providing a new multitenant architecture on top of a fast, scalable, reliable, and secure database platform. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn439775.aspx|_blank]Oracle Database 12c Enterprise Edition on Windows Server 20122014-05-01T07:00:00ZtrueOracleDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321699SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386538OracleDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-12.1.0.1.0-0514-SE-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321317[Oracle Database|http://www.oracle.com/database|_blank] 12c Standard Edition (12.1.0.1.0) is an affordable, full-featured data management solution that is ideal for midsize companies. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn439775.aspx|_blank]Oracle Database 12c Standard Edition on Windows Server 20122014-05-01T07:00:00ZtrueOracleDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321696SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386537OracleDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-12.1.0.1.0-EE-WebLogic-12.1.2.0-EE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321315[Oracle Database|http://www.oracle.com/database|_blank] 12c Enterprise Edition (12.1.0.1.0) is a next-generation database designed for the cloud, providing a new multitenant architecture on top of a fast, scalable, reliable, and secure database platform. [Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 12c Enterprise Edition (12.1.2.0) is a leading Java EE application server. Minimum recommended virtual machine size for this image is [Medium|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn466427.aspx|_blank]Oracle Database 12c and WebLogic Server 12c Enterprise Edition on Windows Server 20122014-05-01T07:00:00ZtrueOracleWeblogicDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321698MediumMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386541OracleWeblogicDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-12.1.0.1.0-SE-WebLogic-12.1.2.0-SE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321318[Oracle Database|http://www.oracle.com/database|_blank] 12c Standard Edition (12.1.0.1.0) is an affordable, full-featured data management solution that is ideal for midsize companies. [Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 12c Standard Edition (12.1.2.0) is a leading Java EE application server. Minimum recommended virtual machine size for this image is [Medium|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn466427.aspx|_blank]Oracle Database 12c and WebLogic Server 12c Standard Edition on Windows Server 20122014-05-01T07:00:00ZtrueOracleWeblogicDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321695MediumMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386542OracleWeblogicDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__WebLogic-12.1.2.0-EE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321313[Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 12c Enterprise Edition (12.1.2.0) is a leading Java EE application server, delivering next-generation applications on a mission-critical cloud platform, with native cloud management, and integrated tools. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn439774.aspx|_blank]Oracle WebLogic Server 12c Enterprise Edition on Windows Server 20122014-05-01T07:00:00ZtrueOracleWeblogic12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321700SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386540OracleWeblogic12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__WebLogic-12.1.2.0-SE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321316[Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 12c Standard Edition (12.1.2.0) is a leading Java EE application server, delivering next-generation applications on a mission-critical cloud platform, with native cloud management, and integrated tools. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn439774.aspx|_blank]Oracle WebLogic Server 12c Standard Edition on Windows Server 20122014-05-01T07:00:00ZtrueOracleWeblogic12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321697SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386539OracleWeblogic12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Weblogic-10.3.6-EE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkID=321682[Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 11g Enterprise Edition (10.3.6) is a leading Java application server for modern data centers. It takes full advantage of the latest hardware architectures including 64-bit addressable memory, multi-core computing systems and high-speed networks. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn466428.aspx|_blank]Oracle WebLogic Server 11g Enterprise Edition on Windows Server 2008 R22014-05-01T07:00:00ZtrueOracleWeblogic11_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321693SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386540OracleWeblogic11_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Weblogic-10.3.6-SE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321685[Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 11g Standard Edition (10.3.6) is a leading Java application server for enterprises of all sizes, providing developers with the tools and technologies to write enterprise applications and services quickly and operations teams with the administration capabilities to keep them up and running. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn466428.aspx|_blank]Oracle WebLogic Server 11g Standard Edition on Windows Server 2008 R22014-05-01T07:00:00ZtrueOracleWeblogic11_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321690SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386539OracleWeblogic11_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1272cdc6229df6344129ee553dd3499f0d3__BizTalk-Server-2013-EnterpriseWindowshttp://go.microsoft.com/fwlink/?LinkID=296354;http://go.microsoft.com/fwlink/?LinkID=131004This image contains the Enterprise edition of BizTalk Server 2013. Some BizTalk Server components like accelerators require additional setup before use. Medium is the recommended size for this image.trueBizTalkServer2013_100.pnghttp://go.microsoft.com/fwlink/?LinkID=131004MediumMicrosoft BizTalk Server Grouphttp://go.microsoft.com/fwlink/?LinkID=280328BizTalkServer2013_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1272cdc6229df6344129ee553dd3499f0d3__BizTalk-Server-2013-StandardWindowshttp://go.microsoft.com/fwlink/?LinkID=296355;http://go.microsoft.com/fwlink/?LinkID=131004This image contains the Standard edition of BizTalk Server 2013. Some BizTalk Server components like accelerators require additional setup before use. Medium is the recommended size for this image.trueBizTalkServer2013_100.pnghttp://go.microsoft.com/fwlink/?LinkID=131004MediumMicrosoft BizTalk Server Grouphttp://go.microsoft.com/fwlink/?LinkID=280327BizTalkServer2013_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1273a50f22b388a4ff7ab41029918570fa6__Windows-Server-2012-Essentials-20131018-enusWindowsThis image contains the Windows Server 2012 R2 Datacenter operating system with the Windows Server Essentials Experience role installed. The new Windows Server Essentials Experience server role on Windows Server 2012 R2 Datacenter includes features, such as Remote Web Access, that were previously available only in Windows Server Essentials. Before creating a virtual machine, you must configure a valid virtual network to use VPN connections. For more information about how to set up Windows Server Essentials Experience, see [here|http://go.microsoft.com/fwlink/?LinkId=322143].Windows Server Essentials Experience on Windows Server 2012 R22013-10-18T00:00:00ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Essentials GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1273a50f22b388a4ff7ab41029918570fa6__Windows-Server-2012-Essentials-20131127-enusWindowsThis image contains the Windows Server 2012 R2 Datacenter operating system with the Windows Server Essentials Experience role installed. The new Windows Server Essentials Experience server role on Windows Server 2012 R2 Datacenter includes features, such as Remote Web Access, that were previously available only in Windows Server Essentials. Before creating a virtual machine, you must configure a valid virtual network to use VPN connections. For more information about how to set up Windows Server Essentials Experience, see [here|http://go.microsoft.com/fwlink/?LinkId=322143].Windows Server Essentials Experience on Windows Server 2012 R22013-11-29T00:00:00ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Essentials GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1273a50f22b388a4ff7ab41029918570fa6__Windows-Server-2012-Essentials-20131217-enusWindowsThis image contains the Windows Server 2012 R2 Datacenter operating system with the Windows Server Essentials Experience role installed. The new Windows Server Essentials Experience server role on Windows Server 2012 R2 Datacenter includes features, such as Remote Web Access, that were previously available only in Windows Server Essentials. Before creating a virtual machine, you must configure a valid virtual network to use VPN connections. For more information about how to set up Windows Server Essentials Experience, see [here|http://go.microsoft.com/fwlink/?LinkId=322143].Windows Server Essentials Experience on Windows Server 2012 R22013-12-23T00:00:00ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Essentials GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1273a50f22b388a4ff7ab41029918570fa6__Windows-Server-2012-Essentials-20140213-enusWindowsThis image contains the Windows Server 2012 R2 Datacenter operating system with the Windows Server Essentials Experience role installed. The new Windows Server Essentials Experience server role on Windows Server 2012 R2 Datacenter includes features, such as Remote Web Access, that were previously available only in Windows Server Essentials. Before creating a virtual machine, you must configure a valid virtual network to use VPN connections. For more information about how to set up Windows Server Essentials Experience, see [here|http://go.microsoft.com/fwlink/?LinkId=322143].Windows Server Essentials Experience on Windows Server 2012 R22014-01-23T00:00:00ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Essentials GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1273a50f22b388a4ff7ab41029918570fa6__Windows-Server-2012-Essentials-20140306-enusWindowsThis image contains the Windows Server 2012 R2 Datacenter operating system with the Windows Server Essentials Experience role installed. The new Windows Server Essentials Experience server role on Windows Server 2012 R2 Datacenter includes features, such as Remote Web Access, that were previously available only in Windows Server Essentials. Before creating a virtual machine, you must configure a valid virtual network to use VPN connections. For more information about how to set up Windows Server Essentials Experience, see [here|http://go.microsoft.com/fwlink/?LinkId=322143].Windows Server Essentials Experience on Windows Server 2012 R22014-03-05T16:00:00ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Essentials GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1273a50f22b388a4ff7ab41029918570fa6__Windows-Server-2012-Essentials-20140327-enusWindowsThis image contains the Windows Server 2012 R2 Datacenter operating system with the Windows Server Essentials Experience role installed. The new Windows Server Essentials Experience server role on Windows Server 2012 R2 Datacenter includes features, such as Remote Web Access, that were previously available only in Windows Server Essentials. Before creating a virtual machine, you must configure a valid virtual network to use VPN connections. For more information about how to set up Windows Server Essentials Experience, see [here|http://go.microsoft.com/fwlink/?LinkId=322143].Windows Server Essentials Experience on Windows Server 2012 R22014-03-26T16:00:00ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Essentials GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US305112500ae3b842c8b9c604889f8753c3__OpenLogic-CentOS-65-20140415Linuxhttp://www.openlogic.com/azure/service-agreement/This distribution of Linux is based on CentOS version 6.5 and is provided by OpenLogic. It contains an installation of the Basic Server packages.2014-04-15T00:00:00ZfalseCentOS6_100.pngOpenLogicCentOS6_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128a699494373c04fc0bc8f2bb1389d6106__Win2K8R2SP1-Datacenter-201403.01-en.us-127GB.vhdWindowsWindows Server 2008 R2 is a multi-purpose server designed to increase the reliability and flexibility of your server or private cloud infrastructure, helping you to save time and reduce costs. It provides you with powerful tools to react to business needs with greater control and confidence.Windows Server 2008 R2 SP12014-03-17T00:00:00ZfalseWindowsServer2008R2_100.pngMicrosoft Windows Server GroupWindowsServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128a699494373c04fc0bc8f2bb1389d6106__Win2K8R2SP1-Datacenter-201404.01-en.us-127GB.vhdWindowsWindows Server 2008 R2 is a multi-purpose server designed to increase the reliability and flexibility of your server or private cloud infrastructure, helping you to save time and reduce costs. It provides you with powerful tools to react to business needs with greater control and confidence.Windows Server 2008 R2 SP12014-04-17T00:00:00ZfalseWindowsServer2008R2_100.pngMicrosoft Windows Server GroupWindowsServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-Datacenter-201403.01-en.us-127GB.vhdWindowsWindows Server 2012 incorporates Microsoft's experience building and operating public clouds, resulting in a dynamic, highly available server platform. It offers a scalable, dynamic and multi-tenant-aware infrastructure that helps securely connect across premises.Windows Server 2012 Datacenter2014-03-17T00:00:00ZfalseWindowsServer2012_100.pngMicrosoft Windows Server GroupWindowsServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-Datacenter-201404.01-en.us-127GB.vhdWindowsWindows Server 2012 incorporates Microsoft's experience building and operating public clouds, resulting in a dynamic, highly available server platform. It offers a scalable, dynamic and multi-tenant-aware infrastructure that helps securely connect across premises.Windows Server 2012 Datacenter2014-04-17T00:00:00ZfalseWindowsServer2012_100.pngMicrosoft Windows Server GroupWindowsServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201403.01-en.us-127GB.vhdWindowsAt the heart of the Microsoft Cloud OS vision, Windows Server 2012 R2 brings Microsoft's experience delivering global-scale cloud services into your infrastructure. It offers enterprise-class performance, flexibility for your applications and excellent economics for your datacenter and hybrid cloud environment.Windows Server 2012 R2 Datacenter2014-03-17T00:00:00ZfalseWindowsServer2012R2_100.pngMicrosoft Windows Server GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201404.01-en.us-127GB.vhdWindowsAt the heart of the Microsoft Cloud OS vision, Windows Server 2012 R2 brings Microsoft's experience delivering global-scale cloud services into your infrastructure. It offers enterprise-class performance, flexibility for your applications and excellent economics for your datacenter and hybrid cloud environment. This image includes Windows Server 2012 R2 Update.Windows Server 2012 R2 Datacenter2014-04-17T00:00:00ZfalseWindowsServer2012R2_100.pngMicrosoft Windows Server GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127ad072bd3082149369c449ba5832401ae__RdshOnWindowsServer2012R2.20140305.127GB.vhdWindowsThis image contains the Windows Server 2012 R2 operating system with the Remote Desktop Session Host (RD Session Host) role installed. This image has been pre-configured for Windows Azure. RD Session Host enables a server to host RemoteApp programs or session-based desktops.Windows Server Remote Desktop Session Host on Windows Server 2012 R2false2014-03-05T23:38:03.7394082ZfalseWindowsServer2012R2_100.pngLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-RDSHwO13P-on-Windows-Server-2012-R2-20140421-1748WindowsThis image can be used by authorized Microsoft Service Providers only.Windows Server RDSHwO13P on Windows Server 2012 R2false2014-04-21T19:09:55.3775121ZfalseWindowsServer2012R2_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statementLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-RDSHwO13P-on-Windows-Server-2012-R2-20140502-1817WindowsThis image can be used by authorized Microsoft Service Providers only.Windows Server RDSHwO13P on Windows Server 2012 R2false2014-05-02T19:00:47.4740507ZfalseWindowsServer2012R2_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statementLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-RDSHwO13P-on-Windows-Server-2012-R2-20140509-1817WindowsThis image can be used by authorized Microsoft Service Providers only.Windows Server RDSHwO13P on Windows Server 2012 R2false2014-05-09T19:06:56.874678ZfalseWindowsServer2012R2_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statementLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-RDSHwO13P-on-Windows-Server-2012-R2-20140512-2037WindowsThis image can be used by authorized Microsoft Service Providers only.Windows Server RDSHwO13P on Windows Server 2012 R2false2014-05-12T21:28:12.4214603ZfalseWindowsServer2012R2_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statementLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-RDSHwO13P-on-Windows-Server-2012-R2-20140514-1702WindowsThis image can be used by authorized Microsoft Service Providers only.Windows Server RDSHwO13P on Windows Server 2012 R2false2014-05-14T17:59:34.290158ZfalseWindowsServer2012R2_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statementLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128ad072bd3082149369c449ba5832401ae__Windows-Server-Remote-Desktop-Session-Host-on-Windows-Server-2012-R2-20140514-1852WindowsThis image contains the Windows Server 2012 R2 operating system with the Remote Desktop Session Host (RD Session Host) role installed. This image has been pre-configured for Windows Azure. RD Session Host enables a server to host RemoteApp programs or session-based desktops.Windows Server Remote Desktop Session Host on Windows Server 2012 R2false2014-05-14T19:33:36.5822032ZfalseWindowsServer2012R2_100.pngLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20121218-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.10 (amd64 20121218) for Windows Azure. This image is DEPRECATED and was reached its END OF LIFE on 2014-04-18. This image is provided for archival purposes only. Please see [Ubuntu Release Wiki|https://wiki.ubuntu.com/Releases|_blank] for information about successor releases and the Ubuntu life-cycle.Ubuntu Server 12.10false2012-12-18T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130225-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130225) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-02-25T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130325-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130325) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTSfalse2013-03-25T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130415-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130415) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTSfalse2013-04-15T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130516-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130516) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-05-17T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130527-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130527) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-05-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130603-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130603) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-06-03T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130624-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130624) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-06-24T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20130827-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130827) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-08-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20130909-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130909) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-09-09T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20130916.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130916.1) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-09-16T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20131003-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20131003) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-10-03T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20131024-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20131024) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-10-24T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20131111-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20131111) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2013-11-11T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20131114-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20131114) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2013-11-14T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20131205-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20131205) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2013-12-05T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20140127-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20140127) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2014-01-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20140130-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20140130) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2014-01-30T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_4-LTS-amd64-server-20140227-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.4 LTS (amd64 20140227) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.4 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2014-02-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_4-LTS-amd64-server-20140408-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.4 LTS (amd64 20140408) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.4 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2014-04-08T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_4-LTS-amd64-server-20140428-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.4 LTS (amd64 20140428) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.4 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2014-04-28T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_4-LTS-amd64-server-20140514-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.4 LTS (amd64 20140514) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.4 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2014-05-15T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20130808-alpha3-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20130808) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 13.10false2013-08-08T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20130905-beta1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20130905) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 13.10false2013-09-05T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20130925-beta2-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20130925) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 13.10false2013-09-26T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20131015-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20131015) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 13.10true2013-10-15T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20131113-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20131113) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2013-11-13T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20131204-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20131204) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2013-12-04T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20131215-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20131215) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2013-12-15T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140108-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140108) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-01-08T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140112-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140112) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-01-12T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140119-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140119) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-01-19T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140129-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140129) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-01-29T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140202-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140202) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-02-02T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140212-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140212) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-02-12T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140226-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140226) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-02-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140409.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140409.1) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-04-10T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140427-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140427) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-04-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140507-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140507) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-05-07T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140122.1-alpha2-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyMILESTONE RELEASE: This is a milestone release and is considered experimental. This build is unsupported and is for development and preview reference only. Ubuntu Server 14.04 LTS (amd64 20140122.1) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 14.04 LTS will be available until 2019-04-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 14.04 LTStrue2014-01-23T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140226.1-beta1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyMILESTONE RELEASE: This is a milestone release and is considered experimental. This build is unsupported and is for development and preview reference only. Ubuntu Server 14.04 LTS (amd64 20140226.1) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 14.04 LTS will be available until 2019-04-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 14.04 LTStrue2014-02-28T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140326-beta2-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyMILESTONE RELEASE: This is a milestone release and is considered experimental. This build is unsupported and is for development and preview reference only. Ubuntu Server 14.04 LTS (amd64 20140326) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 14.04 LTS will be available until 2019-04-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 14.04 LTSfalse2014-03-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140414-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 14.04 LTS (amd64 20140414) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 14.04 LTS will be available until 2019-04-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 14.04 LTStrue2014-04-14T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140416.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 14.04 LTS (amd64 20140416.1) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 14.04 LTS will be available until 2019-04-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 14.04 LTStrue2014-04-17T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_3-LTS-amd64-server-20131125-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20131125 of Ubuntu Server 12.04.3 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 12.04 LTS DAILYfalse2013-11-25T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_4-LTS-amd64-server-20140514-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140514 of Ubuntu Server 12.04.4 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 12.04 LTS DAILYfalse2014-05-15T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_4-LTS-amd64-server-20140515-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140515 of Ubuntu Server 12.04.4 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 12.04 LTS DAILYfalse2014-05-15T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_4-LTS-amd64-server-20140519-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140519 of Ubuntu Server 12.04.4 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 12.04 LTS DAILYfalse2014-05-19T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_4-LTS-amd64-server-20140526-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140526 of Ubuntu Server 12.04.4 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 12.04 LTS DAILYfalse2014-05-26T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-saucy-13_10-amd64-server-20140507-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140507 of Ubuntu Server 13.10 DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 13.10 DAILYfalse2014-05-07T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-saucy-13_10-amd64-server-20140511-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140511 of Ubuntu Server 13.10 DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 13.10 DAILYfalse2014-05-11T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-saucy-13_10-amd64-server-20140514-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140514 of Ubuntu Server 13.10 DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 13.10 DAILYfalse2014-05-14T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-saucy-13_10-amd64-server-20140518-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140518 of Ubuntu Server 13.10 DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 13.10 DAILYfalse2014-05-18T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-saucy-13_10-amd64-server-20140521-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140521 of Ubuntu Server 13.10 DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 13.10 DAILYfalse2014-05-21T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-trusty-14_04-LTS-amd64-server-20140517.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140517.1 of Ubuntu Server 14.04 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 14.04 LTS DAILYfalse2014-05-17T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-trusty-14_04-LTS-amd64-server-20140519.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140519.1 of Ubuntu Server 14.04 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 14.04 LTS DAILYfalse2014-05-19T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-trusty-14_04-LTS-amd64-server-20140521.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140521.1 of Ubuntu Server 14.04 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 14.04 LTS DAILYfalse2014-05-21T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-trusty-14_04-LTS-amd64-server-20140524.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140524.1 of Ubuntu Server 14.04 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 14.04 LTS DAILYfalse2014-05-24T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-utopic-14_10-amd64-server-20140521-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140521 of Ubuntu Server 14.10 DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 14.10 DAILYfalse2014-05-21T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b4590d9e3ed742e4a1d46e5424aa335e__SUSE-Linux-Enterprise-Server-11-SP3-Prio-v202Linuxhttp://www.novell.com/licensing/eula/SUSE Linux Enterprise Server Premium Image with PRIORITY Support: SUSE Linux Enterprise Server is a highly reliable, scalable and secure server operating system, built to power physical, virtual and cloud-based mission-critical workloads. With this affordable, interoperable and manageable open source foundation, enterprises can cost-effectively deliver core business services, enable secure networks and easily manage their heterogeneous IT resources, maximizing efficiency and value.  Customization of images can be done at [http://susestudio.com|http://susestudio.com]. The Premium Image with PRIORITY support includes updates, patches, and support through 24x7 web, email, chat and phone from SUSE. VMs created from this image incur per-hour support fees, in addition to Azure platform fees. An Azure support plan is required (developer or above). Support incidents are initiated through Azure.SUSE Linux Enterprise Server 11 SP3 (Premium Image)2014-05-08T00:00:00ZtrueSuse11_100.pngSUSEhttp://go.microsoft.com/fwlink/?LinkId=299677Suse11_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b4590d9e3ed742e4a1d46e5424aa335e__SUSE-Linux-Enterprise-Server-11-SP3-SAP-CAL-v101Linuxhttp://www.novell.com/licensing/eula/The SUSE Linux Enterprise Server 11 SP3 for SAP Cloud Appliance Library image is the base image for SAP's Cloud Appliance Library. It will be used automatically when deploying an SAP Cloud Appliance Library instance and has the same features as the native SLES image, however customized to fit SAP's CAL needs. For further description and usage guide lines please refer to the description of the SUSE Linux Enterprise image.  Customization of images can be done at [http://susestudio.com|http://susestudio.com].SUSE Linux Enterprise Server 11 SP3 for SAP Cloud Appliance Library2014-05-14T00:00:00ZfalseSuse11_100.pngSUSESuse11_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b4590d9e3ed742e4a1d46e5424aa335e__SUSE-Linux-Enterprise-Server-11-SP3-v202Linuxhttp://www.novell.com/licensing/eula/SUSE Linux Enterprise Server is a highly reliable, scalable and secure server operating system, built to power physical, virtual and cloud-based mission-critical workloads. With this affordable, interoperable and manageable open source foundation, enterprises can cost-effectively deliver core business services, enable secure networks and easily manage their heterogeneous IT resources, maximizing efficiency and value.   Customization of images can be done at [http://susestudio.com|http://susestudio.com].SUSE Linux Enterprise Server 11 SP32014-01-16T00:00:00ZfalseSuse11_100.pngSUSESuse11_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b4590d9e3ed742e4a1d46e5424aa335e__openSUSE-13.1-v101LinuxopenSUSE 13.1 brings updated desktop environments and software, lot of polishing, a brand new KDE theme, complete systemd integration and many other features. Customization of these images can be done at http://susestudio.comopenSUSE 13.12014-04-15T00:00:00ZfalseOpenSuse12_100.pngSUSEOpenSuse12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-iis75-v5.8.8Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with IIS 7.5 and RightLink 5.8.RightScale Windows v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-iis75-v5.8.8.11Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with IIS 7.5 and RightLink 5.8.RightScale Windows v13false2012-12-07T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-sqlsvr2012-v5.8.8Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with MS SQL Server 2012 Standard and RightLink 5.8.RightScale Windows v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-sqlsvr2012-v5.8.8.1Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with MS SQL Server 2012 Standard and RightLink 5.8.RightScale Windows v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-sqlsvr2012-v5.8.8.12Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with MS SQL Server 2012 Standard and RightLink 5.8.RightScale Windows v13false2012-12-12T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-sqlsvr2012-v5.8.8.15Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with MS SQL Server 2012 Standard and RightLink 5.8.RightScale Windows v13false2013-01-05T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-v5.8.8Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.8.RightScale Windows v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-v5.8.8.11Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.8.RightScale Windows v13false2012-12-07T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US31bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-iis7.5-v13.4.12.2Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with IIS 7.5 and RightLink 5.8RightScale Windows v13false2013-05-30T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-iis7.5-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with IIS 7.5 and RightLink v5.8RightScale Windows v13false2013-08-16T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-iis7.5-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2012-v13.4.3.1Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with MS SQL Server 2012 Standard and RightLink v5.8RightScale Windows v13false2013-06-06T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2012-v13.5.1Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with MS SQL Server 2012 Standard and RightLink v5.8RightScale Windows v13false2013-08-19T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2012-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2012ent-v13.4.3.1Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with MS SQL Server 2012 Enterprise and RightLink v5.8RightScale Windows v13false2013-06-06T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2012ent-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with MS SQL Server 2012 Enterprise and RightLink v5.8RightScale Windows v13false2013-08-16T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2012ent-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2k8r2-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with MS SQL Server 2008R2 and RightLink v5.8RightScale Windows v13false2013-08-16T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2k8r2-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2k8r2ent-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with MS SQL Server 2008R2 Enterprise and RightLink v5.8RightScale Windows v13false2013-08-15T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2k8r2ent-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US31bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-v13.4.12.2Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.8RightScale Windows v13false2013-05-30T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink v5.8RightScale Windows v13false2013-08-15T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US31bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-iis8-v13.4.12.2Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with IIS 8 and RightLink 5.8RightScale Windows v13false2013-05-30T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-iis8-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with IIS 8 and RightLink v5.8RightScale Windows v13false2013-08-15T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-iis8-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-iis8-v5.8.8.12Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with IIS 8 and RightLink 5.8.RightScale Windows v13false2012-12-12T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-sqlsvr2012-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with MS SQL Server 2012 Standard and RightLink v5.8RightScale Windows v13false2013-08-15T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-sqlsvr2012-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-sqlsvr2012ent-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with MS SQL Server 2012 Enterprise and RightLink v5.8RightScale Windows v13false2013-08-15T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-sqlsvr2012ent-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US31bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-v13.4.12.2Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.8RightScale Windows v13false2013-05-30T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink v5.8RightScale Windows v13false2013-08-15T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-v5.8.8.12Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.8.RightScale Windows v13false2012-12-12T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US40c290a6b031d841e09f2da759bbabe71f__Oracle-Database-121010.v1-EE-LnxLinuxhttp://www.oracle.com/technetwork/licenses/oracle-license-2016066.htmlOracle Database 12c Enterprise Edition is a next-generation database designed for the cloud, providing a new multitenant architecture on top of a fast, scalable, reliable, and secure database platform. [Learn more|http://www.oracle.com/database|_blank]Oracle DatabasefalseOracleDatabase12_100.pnghttp://www.oracle.com/us/legal/privacy/privacy-policy-078584.htmlOracleOracleDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US40c290a6b031d841e09f2da759bbabe71f__Oracle-Database-121010.v3-SE-LnxLinuxhttp://www.oracle.com/technetwork/licenses/oracle-license-2016066.htmlOracle Database 12c Standard Edition is an affordable, full-featured data management solution that is ideal for midsize companies. [Learn more|http://www.oracle.com/database|_blank]Oracle Database StandardfalseOracleDatabase12_100.pnghttp://www.oracle.com/us/legal/privacy/privacy-policy-078584.htmlOracleOracleDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US10c290a6b031d841e09f2da759bbabe71f__Oracle-Linux-6Linuxhttp://www.oracle.com/technetwork/licenses/oracle-license-2016066.htmlOracle Linux 6 brings the latest Linux innovations to market, delivering extreme performance, advanced scalability, and reliability for enterprise applications and systems. [Learn more|http://www.oracle.com/linux|_blank]Oracle LinuxfalseOracleLinux6_100.pnghttp://www.oracle.com/us/legal/privacy/privacy-policy-078584.htmlOracleOracleLinux6_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30c290a6b031d841e09f2da759bbabe71f__WebLogic-Server-12c.v1-LnxLinuxhttp://www.oracle.com/technetwork/licenses/oracle-license-2016066.htmlOracle WebLogic Server 12c Enterprise Edition is a leading Java EE application server, delivering next-generation applications on a mission-critical cloud platform, with native cloud management, and integrated tools. [Learn more|http://www.oracle.com/weblogicserver|_blank]Oracle WeblogicfalseOracleWeblogic12_100.pnghttp://www.oracle.com/us/legal/privacy/privacy-policy-078584.htmlOracleOracleWeblogic12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128c6e0f177abd8496e934234bd27f46c5d__SharePoint-2013-Trial-1-7-2014Windowshttp://www.microsoft.com/en-us/download/details.aspx?id=38417Microsoft SharePoint Server 2013 Trial on Windows Server 2012 Datacenter. Virtual Machines created with this trial image will expire on July 6, 2014. This image includes a complete installation of SharePoint Server 2013. Some SharePoint Server 2013 components require additional setup and configuration. You can set-up Active Directory and SQL Server required for your SharePoint farm by provisioning additional virtual machines. Minimum recommended virtual machine size for this image is Large. To evaluate the advanced capabilities of SharePoint Server 2013, we recommend that you use a virtual machine size of Extra Large.SharePoint Server 2013 Trial2014-01-07T00:00:00ZfalseSharePoint2013_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statement/ExtraLargeMicrosoft SharePoint GroupSharePoint2013_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30de89c2ed05c748f5aded3ddc75fdcce4__PuppetEnterpriseMaster-3_2_1-amd64-server-20140408-en-us-30GBLinuxhttp://puppetlabs.com/solutions/microsoft#EulaThis image includes a pre-configured Puppet Master with the Ubuntu Linux distribution for easy deployment of Puppet Enterprise. The evaluation will end on May 31, 2014 per Puppet Labs' End User License Agreement (EULA). To set up a Puppet Enterprise environment, please refer to the Getting Started Guide for Deploying a Puppet Master with Windows Azure at http://puppetlabs.com/solutions/microsoftPuppet Enterprise 3.22014-04-10T17:33:44.796315ZfalsePuppetLabs_100x100.pnghttp://puppetlabs.com/solutions/microsoftMediumPuppet LabsPuppetLabs_45x45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30de89c2ed05c748f5aded3ddc75fdcce4__PuppetEnterpriseMaster-3_2_2-amd64-server-20140408-en-us-30GBLinuxhttp://puppetlabs.com/solutions/microsoft#EulaThis image includes a pre-configured Puppet Master with the Ubuntu Linux distribution for easy deployment of Puppet Enterprise. The evaluation will end on May 31, 2014 per Puppet Labs' End User License Agreement (EULA). To set up a Puppet Enterprise environment, please refer to the Getting Started Guide for Deploying a Puppet Master with Windows Azure at http://puppetlabs.com/solutions/microsoftPuppet Enterprise 3.22014-04-16T20:41:05.3700261ZfalsePuppetLabs_100x100.pnghttp://puppetlabs.com/solutions/microsoftMediumPuppet LabsPuppetLabs_45x45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2008R2SP2-Enterprise-CY13SU04-SQL2008-SP2-10.50.4021.0Windowshttp://go.microsoft.com/fwlink/?LinkID=285681This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2008 R2 SP2 Enterprise on Windows Server 2008 R22013-04-16T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxLargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2008R2SP2-Standard-CY13SU04-SQL2008-SP2-10.50.4021.0Windowshttp://go.microsoft.com/fwlink/?LinkID=285685This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2008 R2 SP2 Standard on Windows Server 2008 R22013-04-16T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxMediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-CU4-11.0.3368.0-Enterprise-ENU-Win2012Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 20122013-06-26T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-CU4-11.0.3368.0-Enterprise-ENU-Win2K8R2Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 2008 R22013-07-10T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-CU4-11.0.3368.0-Standard-ENU-Win2012Windowshttp://go.microsoft.com/fwlink/?LinkID=285691Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Standard on Windows Server 20122013-07-15T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-Enterprise-CY13SU04-SQL11-SP1-CU3-11.0.3350.0-BWindowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server 2012 components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 2008 R22013-04-16T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-Enterprise-CY13SU04-SQL2012-SP1-11.0.3350.0-Win2012Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 20122013-04-16T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-Standard-CY13SU04-SQL11-SP1-CU3-11.0.3350.0-BWindowshttp://go.microsoft.com/fwlink/?LinkID=285691Some SQL Server 2012 components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Standard on Windows Server 2008 R22013-04-16T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-Standard-CY13SU04-SQL2012-SP1-11.0.3350.0-Win2012Windowshttp://go.microsoft.com/fwlink/?LinkID=285685Some SQL Server 2012 components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Standard on Windows Server 20122013-04-16T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-Web-CY13SU04-SQL11-SP1-CU3-11.0.3350.0Windowshttp://go.microsoft.com/fwlink/?LinkID=286424Some SQL Server 2012 components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Web on Windows Server 2008 R22013-04-16T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Enterprise-ENU-Win2K8R2-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285681This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2008 R2 SP2 Enterprise on Windows Server 2008 R22013-10-22T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxLargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Enterprise-ENU-Win2K8R2-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285681We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2008 R2 SP2 Enterprise on Windows Server 2008 R22013-12-23T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxLargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Enterprise-ENU-Win2K8R2-CY14SU02Windowshttp://go.microsoft.com/fwlink/?LinkID=285681We recommend that you use a virtual machine size of A3 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2008 R2 SP2 Enterprise on Windows Server 2008 R22014-02-21T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxA3Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Standard-ENU-Win2K8R2-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285685Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2008 R2 SP2 Standard on Windows Server 2008 R22013-10-22T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxMediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Standard-ENU-Win2K8R2-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285685We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2008 R2 SP2 Standard on Windows Server 2008 R22013-12-23T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxMediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Standard-ENU-Win2K8R2-CY14SU02Windowshttp://go.microsoft.com/fwlink/?LinkID=285685We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2008 R2 SP2 Standard on Windows Server 2008 R22014-02-21T00:00:00ZtrueSqlserver2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxA2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Web-ENU-Win2K8R2Windowshttp://go.microsoft.com/fwlink/?LinkID=285686Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2008 R2 SP2 Web on Windows Server 2008 R22013-07-29T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxMediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Web-ENU-Win2K8R2-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285686Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2008 R2 SP2 Web on Windows Server 2008 R22013-10-22T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxMediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Web-ENU-Win2K8R2-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285686We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2008 R2 SP2 Web on Windows Server 2008 R22013-12-23T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxMediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Web-ENU-Win2K8R2-CY14SU02Windowshttp://go.microsoft.com/fwlink/?LinkID=285686We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2008 R2 SP2 Web on Windows Server 2008 R22014-02-21T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxA2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-DataWarehousing-ENU-WS2012Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This Enterprise Edition image uses Fast Track optimization rated for 400 GB data warehousing workloads. After the portal deployment completes, you need to attach the disks. To do this, connect to the VM and then follow the on-screen instructions. Before using the VM, review the recommendations at http://go.microsoft.com/fwlink/p/?LinkId=320441. For best performance, we recommend the A6 VM size. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 for Data Warehousing on Windows Server 20122013-09-30T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A6Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-DataWarehousing-ENU-WS2012-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This Enterprise Edition image uses Fast Track optimization rated for 400 GB data warehousing workloads. After the portal deployment completes, you need to attach the disks. To do this, connect to the VM and then follow the on-screen instructions. Before using the VM, review the recommendations [here|http://go.microsoft.com/fwlink/p/?LinkId=320441|_blank]. For best performance, we recommend the A6 VM size. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 for Data Warehousing on Windows Server 20122013-12-23T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A6Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-DataWarehousing-ENU-WS2012-CY14SU02Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This Enterprise Edition image uses Fast Track optimization rated for 400 GB data warehousing workloads. After the portal deployment completes, you need to attach the disks. To do this, connect to the VM and then follow the on-screen instructions. Before using the VM, review the recommendations [here|http://go.microsoft.com/fwlink/p/?LinkId=320441|_blank]. For best performance, we recommend the A6 VM size. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 for Data Warehousing on Windows Server 20122014-02-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A6Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Enterprise-ENU-WS2008R2-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 2008 R22013-10-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Enterprise-ENU-Win2012Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 20122013-08-06T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Enterprise-ENU-Win2012-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 20122013-10-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Enterprise-ENU-Win2012-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of A3 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Enterprise on Windows Server 20122013-12-23T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A3Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Enterprise-ENU-Win2K8R2-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image will be removed on 5/30/2014. We recommend that you use a virtual machine size of A3 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Enterprise on Windows Server 2008 R22013-12-23T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A3Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Standard-ENU-WS2008R2Windowshttp://go.microsoft.com/fwlink/?LinkID=285687Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Standard on Windows Server 2008 R22013-09-04T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Standard-ENU-Win2012-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285691Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Standard on Windows Server 20122013-10-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Standard-ENU-Win2012-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285691Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Standard on Windows Server 20122013-12-23T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Standard-ENU-Win2K8R2-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285691Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Standard on Windows Server 2008 R22013-10-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Standard-ENU-Win2K8R2-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285691We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Standard on Windows Server 2008 R22013-12-23T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Standard-ENU-Win2K8R2-CY14SU02Windowshttp://go.microsoft.com/fwlink/?LinkID=285691This image will be removed on 5/30/2014. We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Standard on Windows Server 2008 R22014-02-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Web-ENU-WS2008R2Windowshttp://go.microsoft.com/fwlink/?LinkID=286424Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Web on Windows Server 2008 R22013-09-04T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Web-ENU-WS2008R2-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=286424Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Web on Windows Server 2008 R22013-10-24T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Web-ENU-Win2K8R2-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=286424Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Web on Windows Server 2008 R22013-12-23T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Web-ENU-Win2K8R2-CY14SU02Windowshttp://go.microsoft.com/fwlink/?LinkID=286424This image will be removed on 5/30/2014. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Web on Windows Server 2008 R22014-02-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2014RTM-12.0.2000.8-DataWarehousing-ENU-WS2012R2-AprilGAWindowshttp://go.microsoft.com/fwlink/?LinkID=298186This image is optimized for data warehousing workloads with data sizes up to 1TB using clustered columnstore indexes. After the portal deployment completes, you need to attach disks to the virtual machine. To do this, connect to the VM and follow the on-screen instructions. Before using the VM, review the recommendations [here|http://msdn.microsoft.com/library/dn387396.aspx|_blank]. For best performance, we recommend using a VM size of A7. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2014 RTM DataWarehousing on Windows Server 2012 R22014-04-01T07:00:00ZtrueSQLServer2014_100.pnghttp://go.microsoft.com/fwlink/?LinkID=282418A7Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2014_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2014RTM-12.0.2000.8-ENTCORE-ENU-WS2012R2-AprilGAWindowshttp://go.microsoft.com/fwlink/?LinkID=298186This image contains the full version of SQL Server. We recommend that you use a virtual machine size of A3 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2014 RTM Enterprise on Windows Server 2012 R22014-04-01T07:00:00ZtrueSqlServer2014_100.pnghttp://go.microsoft.com/fwlink/?LinkID=282418A3Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2014_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2014RTM-12.0.2000.8-Standard-ENU-WS2012R2-AprilGAWindowshttp://go.microsoft.com/fwlink/?LinkID=298186This image contains the full version of SQL Server. We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2014 RTM Standard on Windows Server 2012 R22014-04-01T07:00:00ZtrueSqlServer2014_100.pnghttp://go.microsoft.com/fwlink/?LinkID=282418A2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2014_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2014RTM-12.0.2000.8-Web-ENU-WS2012R2-AprilGAWindowshttp://go.microsoft.com/fwlink/?LinkID=298186This image contains the full version of SQL Server. We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2014 RTM Web on Windows Server 2012 R22014-04-01T07:00:00ZtrueSqlServer2014_100.pnghttp://go.microsoft.com/fwlink/?LinkID=282418A2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2014_45.pngPublicEast US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-RDSHwO13P-on-Windows-Server-2012-R2-20140417-1824WindowsThis image can be used by authorized Microsoft Service Providers only.Windows Server RDSHwO13P on Windows Server 2012 R2false2014-04-17T19:21:27.3838648ZfalseWindowsServer2012R2_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statementLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-Remote-Desktop-Session-Host-on-Windows-Server-2012-R2-20140403-2126WindowsThis image contains the Windows Server 2012 R2 operating system with the Remote Desktop Session Host (RD Session Host) role installed. This image has been pre-configured for Windows Azure. RD Session Host enables a server to host RemoteApp programs or session-based desktops.Windows Server Remote Desktop Session Host on Windows Server 2012 R2false2014-04-03T22:17:28.0548753ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngUserNorth Europe30http://mtlytics.blob.core.windows.net/vhds/eqowwq2s.a51201312281344410973.vhdambaribaseLinuxThe base Ambari InstancefalseUserNorth Europe30http://mtlytics.blob.core.windows.net/communityimages/community-271-bcee18c0-e6f5-4595-a9ae-b64ebb9cb8a9-2.vhdAzure-Data-AnalysisLinuxhttp://spark.elastacloud.com{"description":"Includes R, openmpi and loads of packages. Include Spark 0.8, Shark 0.7 and Storm and Kafka. Also includes iPython notebook + a whole heap of libraries.","publisherUrl":"https://vmdepot.msopentech.com/User/Show?user=271","publisher":"elastacloud","imageUrl":"https://vmdepot.msopentech.com/Vhd/Show?VhdID=8689&version=10769","icons":{"Small":"https://vmdepotwestus.blob.core.windows.net/images/271/6c415744-cfed-4ed5-8493-361f47716623_45x45.png","Large":"https://vmdepotwestus.blob.core.windows.net/images/271/6c415744-cfed-4ed5-8493-361f47716623_100x100.png","ExtraLarge":"https://vmdepotwestus.blob.core.windows.net/images/271/6c415744-cfed-4ed5-8493-361f47716623_215x215.png"}}CommunityfalseUserNorth Europe30https://neelasta5191b16a673d426c.blob.core.windows.net/elastaimage/elastaspark0.vhdelastaspark0Linux2014-04-14T13:40:06ZfalseGeneralizedUserNorth Europe30https://neelasta5191b16a673d426c.blob.core.windows.net/elastaimage/neelastaspark0.vhdneelastaspark0Linux2014-05-27T12:10:18ZfalseGeneralizedUserNorth Europe30https://neelasta5191b16a673d426c.blob.core.windows.net/elastaimage/neelastaspark1.vhdneelastaspark1Linux2014-05-27T11:24:59ZfalseGeneralizedUserWest Europe30https://portalvhdsj5170kkqq0ftq.blob.core.windows.net/elastaimage/sparkius1.vhdsparkius1Linux2014-02-04T11:36:22ZfalseUserNorth Europe30http://mtlytics.blob.core.windows.net/vhds/m15pycz2.ync201403171254370011.vhdstorm.elactacloud.baseLinuxfalseUserNorth Europe30http://portalvhds3c3c6cj9bpgwh.blob.core.windows.net/vhds/hqbn1y3e.gya201404221049490886.vhdzk-drill-src-0LinuxfalseGeneralized \ No newline at end of file +PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.2-x64-v5.8.8.1Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.3 with RightLink 5.8.RightScale Linux v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.3-x64-v5.8.8Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.2 with RightLink 5.8.RightScale Linux v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.3-x64-v5.8.8.5Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.3 with RightLink 5.8.RightScale Linux v13false2012-10-12T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.3-x64-v5.8.8.6Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.3 with RightLink 5.8.RightScale Linux v13false2012-11-12T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.3-x64-v5.8.8.7Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.3 with RightLink 5.8.RightScale Linux v13false2012-01-15T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.3-x64-v5.8.8.8Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.3 with RightLink 5.8.RightScale Linux v13false2012-01-25T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.3-x64-v5.8.8.9Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.3 with RightLink 5.8.RightScale Linux v13false2013-03-01T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.4-x64-v13.4Linuxfalse2013-04-19T00:00:00ZfalseRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.4-x64-v13.5.0.1Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.4 with RightLink 5.8.RightScale Linux v13false2013-07-11T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.4-x64-v13.5.0.2Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.4 with RightLink 5.8.RightScale Linux v13false2013-07-22T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.5-x64-v13.5.2Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.5 with RightLink 5.8.RightScale Linux v13false2013-12-26T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US100b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.5-x64-v13.5.3Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementCentOS 6.5 with RightLink 5.8.RightScale Linux v13false2014-04-17T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v13.4Linuxfalse2013-04-19T00:00:00ZfalseRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v13.5.0.1Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2013-07-11T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v13.5.2Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2013-12-26T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v13.5.3Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2014-04-17T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v5.8.8Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v5.8.8.5Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2012-10-12T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v5.8.8.7Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2013-01-15T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US100b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v5.8.8.8Linuxhttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementUbuntu 12.04 with RightLink 5.8.RightScale Linux v13false2013-01-25T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with LinuxPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__JDK-1.6.0_71-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321312[Java Platform|http://www.oracle.com/java|_blank], Standard Edition 6 (update 71) enables development of secure, portable, high-performance applications and includes a Java Development Kit (JDK), Java Runtime Environment (JRE), and tools for developing, debugging, and monitoring Java applications. WARNING: These older versions of the JRE and JDK are provided to help developers debug issues in older systems. They are not recommended for use in production. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-java-run-tomcat-application-server/|_blank]JDK 6 on Windows Server 20122014-05-01T07:00:00ZtrueJava6_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321694SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386544Java6_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321310[Java Platform|http://www.oracle.com/java|_blank], Standard Edition 7 (update 51) enables development of secure, portable, high-performance applications and includes a Java Development Kit (JDK), Java Runtime Environment (JRE), and tools for developing, debugging, and monitoring Java applications. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-java-run-tomcat-application-server|_blank]JDK 7 on Windows Server 20122014-05-01T07:00:00ZtrueJava7_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321701SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkID=386543Java7_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__JDK-1.8.0-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321310[Java Platform|http://www.oracle.com/java|_blank], Standard Edition 8 enables development of secure, portable, high-performance applications and includes a Java Development Kit (JDK), Java Runtime Environment (JRE), and tools for developing, debugging, and monitoring Java applications. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank].JDK 8 on Windows Server 2012 R22014-05-01T07:00:00ZtrueJava7_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321701SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkID=386543Java7_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-11.2.0.4.0-EE-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321683[Oracle Database|http://www.oracle.com/database|_blank] 11g R2 Enterprise Edition (11.2.0.4.0) provides comprehensive features to easily manage the most demanding transaction processing, business intelligence, and content management applications. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank].Oracle Database 11g R2 Enterprise Edition on Windows Server 2008 R22014-05-01T07:00:00ZtrueOracleDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321692SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386538OracleDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-11.2.0.4.0-EE-WebLogic-10.3.6-EE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321684[Oracle Database|http://www.oracle.com/database|_blank] 11g R2 Enterprise Edition (11.2.0.4.0) provides comprehensive features to easily manage the most demanding transaction processing, business intelligence, and content management applications. [Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 11g Enterprise Edition (10.3.6) is a leading Java application server for modern data centers. It takes full advantage of the latest hardware architectures including 64-bit addressable memory, multi-core computing systems and high-speed networks. Minimum recommended virtual machine size for this image is [Medium|http://go.microsoft.com/fwlink/?LinkID=309169|_blank].Oracle Database 11g R2 and WebLogic Server 11g Enterprise Edition on Windows Server 2008 R22014-05-01T07:00:00ZtrueOracleWeblogicDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321691MediumMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386541OracleWeblogicDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-11.2.0.4.0-SE-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321686[Oracle Database|http://www.oracle.com/database|_blank] 11g R2 Standard Edition (11.2.0.4.0) is an affordable, full-featured data management solution that is ideal for midsize companies. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank].Oracle Database 11g R2 Standard Edition on Windows Server 2008 R22014-05-01T07:00:00ZtrueOracleDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321689SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386537OracleDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-11.2.0.4.0-SE-WebLogic-10.3.6-SE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321687[Oracle Database|http://www.oracle.com/database|_blank] 11g R2 Standard Edition (11.2.0.4.0) is an affordable, full-featured data management solution that is ideal for midsize companies. [Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 11g Standard Edition (10.3.6) is a leading Java application server for enterprises of all sizes, providing developers with the tools and technologies to write enterprise applications and services quickly and operations teams with the administration capabilities to keep them up and running. Minimum recommended virtual machine size for this image is [Medium|http://go.microsoft.com/fwlink/?LinkID=309169|_blank].Oracle Database 11g R2 and WebLogic Server 11g Standard Edition on Windows Server 2008 R22014-05-01T07:00:00ZtrueOracleWeblogicDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321688MediumMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386542OracleWeblogicDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-12.1.0.1.0-0514-EE-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321314[Oracle Database|http://www.oracle.com/database|_blank] 12c Enterprise Edition (12.1.0.1.0) is a next-generation database designed for the cloud, providing a new multitenant architecture on top of a fast, scalable, reliable, and secure database platform. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn439775.aspx|_blank]Oracle Database 12c Enterprise Edition on Windows Server 20122014-05-01T07:00:00ZtrueOracleDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321699SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386538OracleDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-12.1.0.1.0-0514-SE-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321317[Oracle Database|http://www.oracle.com/database|_blank] 12c Standard Edition (12.1.0.1.0) is an affordable, full-featured data management solution that is ideal for midsize companies. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn439775.aspx|_blank]Oracle Database 12c Standard Edition on Windows Server 20122014-05-01T07:00:00ZtrueOracleDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321696SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386537OracleDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-12.1.0.1.0-EE-WebLogic-12.1.2.0-EE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321315[Oracle Database|http://www.oracle.com/database|_blank] 12c Enterprise Edition (12.1.0.1.0) is a next-generation database designed for the cloud, providing a new multitenant architecture on top of a fast, scalable, reliable, and secure database platform. [Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 12c Enterprise Edition (12.1.2.0) is a leading Java EE application server. Minimum recommended virtual machine size for this image is [Medium|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn466427.aspx|_blank]Oracle Database 12c and WebLogic Server 12c Enterprise Edition on Windows Server 20122014-05-01T07:00:00ZtrueOracleWeblogicDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321698MediumMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386541OracleWeblogicDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Oracle-Database-12.1.0.1.0-SE-WebLogic-12.1.2.0-SE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321318[Oracle Database|http://www.oracle.com/database|_blank] 12c Standard Edition (12.1.0.1.0) is an affordable, full-featured data management solution that is ideal for midsize companies. [Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 12c Standard Edition (12.1.2.0) is a leading Java EE application server. Minimum recommended virtual machine size for this image is [Medium|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn466427.aspx|_blank]Oracle Database 12c and WebLogic Server 12c Standard Edition on Windows Server 20122014-05-01T07:00:00ZtrueOracleWeblogicDatabase12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321695MediumMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386542OracleWeblogicDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__WebLogic-12.1.2.0-EE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321313[Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 12c Enterprise Edition (12.1.2.0) is a leading Java EE application server, delivering next-generation applications on a mission-critical cloud platform, with native cloud management, and integrated tools. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn439774.aspx|_blank]Oracle WebLogic Server 12c Enterprise Edition on Windows Server 20122014-05-01T07:00:00ZtrueOracleWeblogic12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321700SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386540OracleWeblogic12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__WebLogic-12.1.2.0-SE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321316[Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 12c Standard Edition (12.1.2.0) is a leading Java EE application server, delivering next-generation applications on a mission-critical cloud platform, with native cloud management, and integrated tools. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn439774.aspx|_blank]Oracle WebLogic Server 12c Standard Edition on Windows Server 20122014-05-01T07:00:00ZtrueOracleWeblogic12_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321697SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386539OracleWeblogic12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Weblogic-10.3.6-EE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkID=321682[Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 11g Enterprise Edition (10.3.6) is a leading Java application server for modern data centers. It takes full advantage of the latest hardware architectures including 64-bit addressable memory, multi-core computing systems and high-speed networks. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn466428.aspx|_blank]Oracle WebLogic Server 11g Enterprise Edition on Windows Server 2008 R22014-05-01T07:00:00ZtrueOracleWeblogic11_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321693SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386540OracleWeblogic11_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1280c0083a6d9a24f2d91800e52cad83950__Weblogic-10.3.6-SE-JDK-1.7.0_51-0514-Win-GAWindowshttp://go.microsoft.com/fwlink/?LinkId=321685[Oracle WebLogic Server|http://www.oracle.com/weblogicserver|_blank] 11g Standard Edition (10.3.6) is a leading Java application server for enterprises of all sizes, providing developers with the tools and technologies to write enterprise applications and services quickly and operations teams with the administration capabilities to keep them up and running. Minimum recommended virtual machine size for this image is [Small|http://go.microsoft.com/fwlink/?LinkID=309169|_blank]. [Learn More|http://msdn.microsoft.com/en-us/library/dn466428.aspx|_blank]Oracle WebLogic Server 11g Standard Edition on Windows Server 2008 R22014-05-01T07:00:00ZtrueOracleWeblogic11_100.pnghttp://go.microsoft.com/fwlink/?LinkId=321690SmallMicrosoft Open Technologies, Inc.http://go.microsoft.com/fwlink/?LinkId=386539OracleWeblogic11_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1272cdc6229df6344129ee553dd3499f0d3__BizTalk-Server-2013-EnterpriseWindowshttp://go.microsoft.com/fwlink/?LinkID=296354;http://go.microsoft.com/fwlink/?LinkID=131004This image contains the Enterprise edition of BizTalk Server 2013. Some BizTalk Server components like accelerators require additional setup before use. Medium is the recommended size for this image.trueBizTalkServer2013_100.pnghttp://go.microsoft.com/fwlink/?LinkID=131004MediumMicrosoft BizTalk Server Grouphttp://go.microsoft.com/fwlink/?LinkID=280328BizTalkServer2013_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1272cdc6229df6344129ee553dd3499f0d3__BizTalk-Server-2013-StandardWindowshttp://go.microsoft.com/fwlink/?LinkID=296355;http://go.microsoft.com/fwlink/?LinkID=131004This image contains the Standard edition of BizTalk Server 2013. Some BizTalk Server components like accelerators require additional setup before use. Medium is the recommended size for this image.trueBizTalkServer2013_100.pnghttp://go.microsoft.com/fwlink/?LinkID=131004MediumMicrosoft BizTalk Server Grouphttp://go.microsoft.com/fwlink/?LinkID=280327BizTalkServer2013_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1273a50f22b388a4ff7ab41029918570fa6__Windows-Server-2012-Essentials-20131018-enusWindowsThis image contains the Windows Server 2012 R2 Datacenter operating system with the Windows Server Essentials Experience role installed. The new Windows Server Essentials Experience server role on Windows Server 2012 R2 Datacenter includes features, such as Remote Web Access, that were previously available only in Windows Server Essentials. Before creating a virtual machine, you must configure a valid virtual network to use VPN connections. For more information about how to set up Windows Server Essentials Experience, see [here|http://go.microsoft.com/fwlink/?LinkId=322143].Windows Server Essentials Experience on Windows Server 2012 R22013-10-18T00:00:00ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Essentials GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1273a50f22b388a4ff7ab41029918570fa6__Windows-Server-2012-Essentials-20131127-enusWindowsThis image contains the Windows Server 2012 R2 Datacenter operating system with the Windows Server Essentials Experience role installed. The new Windows Server Essentials Experience server role on Windows Server 2012 R2 Datacenter includes features, such as Remote Web Access, that were previously available only in Windows Server Essentials. Before creating a virtual machine, you must configure a valid virtual network to use VPN connections. For more information about how to set up Windows Server Essentials Experience, see [here|http://go.microsoft.com/fwlink/?LinkId=322143].Windows Server Essentials Experience on Windows Server 2012 R22013-11-29T00:00:00ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Essentials GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1273a50f22b388a4ff7ab41029918570fa6__Windows-Server-2012-Essentials-20131217-enusWindowsThis image contains the Windows Server 2012 R2 Datacenter operating system with the Windows Server Essentials Experience role installed. The new Windows Server Essentials Experience server role on Windows Server 2012 R2 Datacenter includes features, such as Remote Web Access, that were previously available only in Windows Server Essentials. Before creating a virtual machine, you must configure a valid virtual network to use VPN connections. For more information about how to set up Windows Server Essentials Experience, see [here|http://go.microsoft.com/fwlink/?LinkId=322143].Windows Server Essentials Experience on Windows Server 2012 R22013-12-23T00:00:00ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Essentials GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1273a50f22b388a4ff7ab41029918570fa6__Windows-Server-2012-Essentials-20140213-enusWindowsThis image contains the Windows Server 2012 R2 Datacenter operating system with the Windows Server Essentials Experience role installed. The new Windows Server Essentials Experience server role on Windows Server 2012 R2 Datacenter includes features, such as Remote Web Access, that were previously available only in Windows Server Essentials. Before creating a virtual machine, you must configure a valid virtual network to use VPN connections. For more information about how to set up Windows Server Essentials Experience, see [here|http://go.microsoft.com/fwlink/?LinkId=322143].Windows Server Essentials Experience on Windows Server 2012 R22014-01-23T00:00:00ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Essentials GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1273a50f22b388a4ff7ab41029918570fa6__Windows-Server-2012-Essentials-20140306-enusWindowsThis image contains the Windows Server 2012 R2 Datacenter operating system with the Windows Server Essentials Experience role installed. The new Windows Server Essentials Experience server role on Windows Server 2012 R2 Datacenter includes features, such as Remote Web Access, that were previously available only in Windows Server Essentials. Before creating a virtual machine, you must configure a valid virtual network to use VPN connections. For more information about how to set up Windows Server Essentials Experience, see [here|http://go.microsoft.com/fwlink/?LinkId=322143].Windows Server Essentials Experience on Windows Server 2012 R22014-03-05T16:00:00ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Essentials GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US1273a50f22b388a4ff7ab41029918570fa6__Windows-Server-2012-Essentials-20140327-enusWindowsThis image contains the Windows Server 2012 R2 Datacenter operating system with the Windows Server Essentials Experience role installed. The new Windows Server Essentials Experience server role on Windows Server 2012 R2 Datacenter includes features, such as Remote Web Access, that were previously available only in Windows Server Essentials. Before creating a virtual machine, you must configure a valid virtual network to use VPN connections. For more information about how to set up Windows Server Essentials Experience, see [here|http://go.microsoft.com/fwlink/?LinkId=322143].Windows Server Essentials Experience on Windows Server 2012 R22014-03-26T16:00:00ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Essentials GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US305112500ae3b842c8b9c604889f8753c3__OpenLogic-CentOS-65-20140415Linuxhttp://www.openlogic.com/azure/service-agreement/This distribution of Linux is based on CentOS version 6.5 and is provided by OpenLogic. It contains an installation of the Basic Server packages.2014-04-15T00:00:00ZfalseCentOS6_100.pngOpenLogicCentOS6_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128a699494373c04fc0bc8f2bb1389d6106__Win2K8R2SP1-Datacenter-201403.01-en.us-127GB.vhdWindowsWindows Server 2008 R2 is a multi-purpose server designed to increase the reliability and flexibility of your server or private cloud infrastructure, helping you to save time and reduce costs. It provides you with powerful tools to react to business needs with greater control and confidence.Windows Server 2008 R2 SP12014-03-17T00:00:00ZfalseWindowsServer2008R2_100.pngMicrosoft Windows Server GroupWindowsServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128a699494373c04fc0bc8f2bb1389d6106__Win2K8R2SP1-Datacenter-201404.01-en.us-127GB.vhdWindowsWindows Server 2008 R2 is a multi-purpose server designed to increase the reliability and flexibility of your server or private cloud infrastructure, helping you to save time and reduce costs. It provides you with powerful tools to react to business needs with greater control and confidence.Windows Server 2008 R2 SP12014-04-17T00:00:00ZfalseWindowsServer2008R2_100.pngMicrosoft Windows Server GroupWindowsServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-Datacenter-201403.01-en.us-127GB.vhdWindowsWindows Server 2012 incorporates Microsoft's experience building and operating public clouds, resulting in a dynamic, highly available server platform. It offers a scalable, dynamic and multi-tenant-aware infrastructure that helps securely connect across premises.Windows Server 2012 Datacenter2014-03-17T00:00:00ZfalseWindowsServer2012_100.pngMicrosoft Windows Server GroupWindowsServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-Datacenter-201404.01-en.us-127GB.vhdWindowsWindows Server 2012 incorporates Microsoft's experience building and operating public clouds, resulting in a dynamic, highly available server platform. It offers a scalable, dynamic and multi-tenant-aware infrastructure that helps securely connect across premises.Windows Server 2012 Datacenter2014-04-17T00:00:00ZfalseWindowsServer2012_100.pngMicrosoft Windows Server GroupWindowsServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201403.01-en.us-127GB.vhdWindowsAt the heart of the Microsoft Cloud OS vision, Windows Server 2012 R2 brings Microsoft's experience delivering global-scale cloud services into your infrastructure. It offers enterprise-class performance, flexibility for your applications and excellent economics for your datacenter and hybrid cloud environment.Windows Server 2012 R2 Datacenter2014-03-17T00:00:00ZfalseWindowsServer2012R2_100.pngMicrosoft Windows Server GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201404.01-en.us-127GB.vhdWindowsAt the heart of the Microsoft Cloud OS vision, Windows Server 2012 R2 brings Microsoft's experience delivering global-scale cloud services into your infrastructure. It offers enterprise-class performance, flexibility for your applications and excellent economics for your datacenter and hybrid cloud environment. This image includes Windows Server 2012 R2 Update.Windows Server 2012 R2 Datacenter2014-04-17T00:00:00ZfalseWindowsServer2012R2_100.pngMicrosoft Windows Server GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127ad072bd3082149369c449ba5832401ae__RdshOnWindowsServer2012R2.20140305.127GB.vhdWindowsThis image contains the Windows Server 2012 R2 operating system with the Remote Desktop Session Host (RD Session Host) role installed. This image has been pre-configured for Windows Azure. RD Session Host enables a server to host RemoteApp programs or session-based desktops.Windows Server Remote Desktop Session Host on Windows Server 2012 R2false2014-03-05T23:38:03.7394082ZfalseWindowsServer2012R2_100.pngLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-RDSHwO13P-on-Windows-Server-2012-R2-20140421-1748WindowsThis image can be used by authorized Microsoft Service Providers only.Windows Server RDSHwO13P on Windows Server 2012 R2false2014-04-21T19:09:55.3775121ZfalseWindowsServer2012R2_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statementLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-RDSHwO13P-on-Windows-Server-2012-R2-20140502-1817WindowsThis image can be used by authorized Microsoft Service Providers only.Windows Server RDSHwO13P on Windows Server 2012 R2false2014-05-02T19:00:47.4740507ZfalseWindowsServer2012R2_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statementLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-RDSHwO13P-on-Windows-Server-2012-R2-20140509-1817WindowsThis image can be used by authorized Microsoft Service Providers only.Windows Server RDSHwO13P on Windows Server 2012 R2false2014-05-09T19:06:56.874678ZfalseWindowsServer2012R2_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statementLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-RDSHwO13P-on-Windows-Server-2012-R2-20140512-2037WindowsThis image can be used by authorized Microsoft Service Providers only.Windows Server RDSHwO13P on Windows Server 2012 R2false2014-05-12T21:28:12.4214603ZfalseWindowsServer2012R2_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statementLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-RDSHwO13P-on-Windows-Server-2012-R2-20140514-1702WindowsThis image can be used by authorized Microsoft Service Providers only.Windows Server RDSHwO13P on Windows Server 2012 R2false2014-05-14T17:59:34.290158ZfalseWindowsServer2012R2_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statementLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128ad072bd3082149369c449ba5832401ae__Windows-Server-Remote-Desktop-Session-Host-on-Windows-Server-2012-R2-20140514-1852WindowsThis image contains the Windows Server 2012 R2 operating system with the Remote Desktop Session Host (RD Session Host) role installed. This image has been pre-configured for Windows Azure. RD Session Host enables a server to host RemoteApp programs or session-based desktops.Windows Server Remote Desktop Session Host on Windows Server 2012 R2false2014-05-14T19:33:36.5822032ZfalseWindowsServer2012R2_100.pngLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20121218-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.10 (amd64 20121218) for Windows Azure. This image is DEPRECATED and was reached its END OF LIFE on 2014-04-18. This image is provided for archival purposes only. Please see [Ubuntu Release Wiki|https://wiki.ubuntu.com/Releases|_blank] for information about successor releases and the Ubuntu life-cycle.Ubuntu Server 12.10false2012-12-18T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130225-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130225) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-02-25T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130325-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130325) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTSfalse2013-03-25T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130415-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130415) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTSfalse2013-04-15T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130516-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130516) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-05-17T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130527-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130527) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-05-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130603-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130603) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-06-03T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130624-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130624) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-06-24T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20130827-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130827) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-08-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20130909-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130909) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-09-09T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20130916.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20130916.1) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-09-16T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20131003-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20131003) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-10-03T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20131024-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20131024) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 12.04 LTStrue2013-10-24T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20131111-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20131111) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2013-11-11T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20131114-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20131114) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2013-11-14T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20131205-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20131205) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2013-12-05T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20140127-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20140127) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2014-01-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_3-LTS-amd64-server-20140130-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.3 LTS (amd64 20140130) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.3 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2014-01-30T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_4-LTS-amd64-server-20140227-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.4 LTS (amd64 20140227) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.4 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2014-02-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_4-LTS-amd64-server-20140408-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.4 LTS (amd64 20140408) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.4 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2014-04-08T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_4-LTS-amd64-server-20140428-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.4 LTS (amd64 20140428) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.4 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2014-04-28T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_4-LTS-amd64-server-20140514-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 12.04.4 LTS (amd64 20140514) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.4 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 12.04 LTStrue2014-05-15T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20130808-alpha3-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20130808) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 13.10false2013-08-08T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20130905-beta1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20130905) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 13.10false2013-09-05T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20130925-beta2-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20130925) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 13.10false2013-09-26T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20131015-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20131015) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see http://www.ubuntu.com/cloud and http://juju.ubuntu.com.Ubuntu Server 13.10true2013-10-15T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20131113-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20131113) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2013-11-13T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20131204-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20131204) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2013-12-04T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20131215-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20131215) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2013-12-15T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140108-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140108) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-01-08T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140112-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140112) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-01-12T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140119-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140119) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-01-19T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140129-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140129) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-01-29T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140202-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140202) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-02-02T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140212-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140212) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-02-12T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140226-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140226) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-02-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140409.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140409.1) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-04-10T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140427-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140427) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-04-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20140507-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 13.10 (amd64 20140507) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 13.10 will be available until 2014-07-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 13.10true2014-05-07T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140122.1-alpha2-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyMILESTONE RELEASE: This is a milestone release and is considered experimental. This build is unsupported and is for development and preview reference only. Ubuntu Server 14.04 LTS (amd64 20140122.1) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 14.04 LTS will be available until 2019-04-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 14.04 LTStrue2014-01-23T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140226.1-beta1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyMILESTONE RELEASE: This is a milestone release and is considered experimental. This build is unsupported and is for development and preview reference only. Ubuntu Server 14.04 LTS (amd64 20140226.1) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 14.04 LTS will be available until 2019-04-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 14.04 LTStrue2014-02-28T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140326-beta2-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyMILESTONE RELEASE: This is a milestone release and is considered experimental. This build is unsupported and is for development and preview reference only. Ubuntu Server 14.04 LTS (amd64 20140326) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 14.04 LTS will be available until 2019-04-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 14.04 LTSfalse2014-03-27T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140414-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 14.04 LTS (amd64 20140414) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 14.04 LTS will be available until 2019-04-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 14.04 LTStrue2014-04-14T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140416.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyUbuntu Server 14.04 LTS (amd64 20140416.1) for Windows Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 14.04 LTS will be available until 2019-04-17. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank].Ubuntu Server 14.04 LTStrue2014-04-17T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_3-LTS-amd64-server-20131125-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20131125 of Ubuntu Server 12.04.3 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 12.04 LTS DAILYfalse2013-11-25T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_4-LTS-amd64-server-20140514-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140514 of Ubuntu Server 12.04.4 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 12.04 LTS DAILYfalse2014-05-15T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_4-LTS-amd64-server-20140515-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140515 of Ubuntu Server 12.04.4 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 12.04 LTS DAILYfalse2014-05-15T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_4-LTS-amd64-server-20140519-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140519 of Ubuntu Server 12.04.4 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 12.04 LTS DAILYfalse2014-05-19T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_4-LTS-amd64-server-20140526-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140526 of Ubuntu Server 12.04.4 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 12.04 LTS DAILYfalse2014-05-26T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-saucy-13_10-amd64-server-20140507-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140507 of Ubuntu Server 13.10 DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 13.10 DAILYfalse2014-05-07T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-saucy-13_10-amd64-server-20140511-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140511 of Ubuntu Server 13.10 DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 13.10 DAILYfalse2014-05-11T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-saucy-13_10-amd64-server-20140514-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140514 of Ubuntu Server 13.10 DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 13.10 DAILYfalse2014-05-14T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-saucy-13_10-amd64-server-20140518-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140518 of Ubuntu Server 13.10 DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 13.10 DAILYfalse2014-05-18T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-saucy-13_10-amd64-server-20140521-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140521 of Ubuntu Server 13.10 DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 13.10 DAILYfalse2014-05-21T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-trusty-14_04-LTS-amd64-server-20140517.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140517.1 of Ubuntu Server 14.04 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 14.04 LTS DAILYfalse2014-05-17T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-trusty-14_04-LTS-amd64-server-20140519.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140519.1 of Ubuntu Server 14.04 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 14.04 LTS DAILYfalse2014-05-19T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-trusty-14_04-LTS-amd64-server-20140521.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140521.1 of Ubuntu Server 14.04 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 14.04 LTS DAILYfalse2014-05-21T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-trusty-14_04-LTS-amd64-server-20140524.1-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140524.1 of Ubuntu Server 14.04 LTS DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 14.04 LTS DAILYfalse2014-05-24T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-utopic-14_10-amd64-server-20140521-en-us-30GBLinuxhttp://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicyDAILY BUILD 20140521 of Ubuntu Server 14.10 DAILY (amd64) for Windows Azure. Daily builds are up-to-date builds of the regular release images for Ubuntu Server. While every effort is made to make sure that these are production quality, these images come with no warranty. In the event of a support issue, you may be asked to update to an official released build. For more information see [Ubuntu Cloud|http://www.ubuntu.com/cloud|_blank] and [using Juju to deploy your workloads|http://juju.ubuntu.com|_blank]. Ubuntu Server 14.10 DAILYfalse2014-05-21T00:00:00ZfalseUbuntu-cof-100.pnghttp://www.ubuntu.com/aboutus/privacypolicyCanonicalUbuntu-cof-45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b4590d9e3ed742e4a1d46e5424aa335e__SUSE-Linux-Enterprise-Server-11-SP3-Prio-v202Linuxhttp://www.novell.com/licensing/eula/SUSE Linux Enterprise Server Premium Image with PRIORITY Support: SUSE Linux Enterprise Server is a highly reliable, scalable and secure server operating system, built to power physical, virtual and cloud-based mission-critical workloads. With this affordable, interoperable and manageable open source foundation, enterprises can cost-effectively deliver core business services, enable secure networks and easily manage their heterogeneous IT resources, maximizing efficiency and value. Customization of images can be done at [http://susestudio.com|http://susestudio.com]. The Premium Image with PRIORITY support includes updates, patches, and support through 24x7 web, email, chat and phone from SUSE. VMs created from this image incur per-hour support fees, in addition to Azure platform fees. An Azure support plan is required (developer or above). Support incidents are initiated through Azure.SUSE Linux Enterprise Server 11 SP3 (Premium Image)2014-05-08T00:00:00ZtrueSuse11_100.pngSUSEhttp://go.microsoft.com/fwlink/?LinkId=299677Suse11_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b4590d9e3ed742e4a1d46e5424aa335e__SUSE-Linux-Enterprise-Server-11-SP3-SAP-CAL-v101Linuxhttp://www.novell.com/licensing/eula/The SUSE Linux Enterprise Server 11 SP3 for SAP Cloud Appliance Library image is the base image for SAP's Cloud Appliance Library. It will be used automatically when deploying an SAP Cloud Appliance Library instance and has the same features as the native SLES image, however customized to fit SAP's CAL needs. For further description and usage guide lines please refer to the description of the SUSE Linux Enterprise image. Customization of images can be done at [http://susestudio.com|http://susestudio.com].SUSE Linux Enterprise Server 11 SP3 for SAP Cloud Appliance Library2014-05-14T00:00:00ZfalseSuse11_100.pngSUSESuse11_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b4590d9e3ed742e4a1d46e5424aa335e__SUSE-Linux-Enterprise-Server-11-SP3-v202Linuxhttp://www.novell.com/licensing/eula/SUSE Linux Enterprise Server is a highly reliable, scalable and secure server operating system, built to power physical, virtual and cloud-based mission-critical workloads. With this affordable, interoperable and manageable open source foundation, enterprises can cost-effectively deliver core business services, enable secure networks and easily manage their heterogeneous IT resources, maximizing efficiency and value. Customization of images can be done at [http://susestudio.com|http://susestudio.com].SUSE Linux Enterprise Server 11 SP32014-01-16T00:00:00ZfalseSuse11_100.pngSUSESuse11_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30b4590d9e3ed742e4a1d46e5424aa335e__openSUSE-13.1-v101LinuxopenSUSE 13.1 brings updated desktop environments and software, lot of polishing, a brand new KDE theme, complete systemd integration and many other features. Customization of these images can be done at http://susestudio.comopenSUSE 13.12014-04-15T00:00:00ZfalseOpenSuse12_100.pngSUSEOpenSuse12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-iis75-v5.8.8Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with IIS 7.5 and RightLink 5.8.RightScale Windows v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-iis75-v5.8.8.11Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with IIS 7.5 and RightLink 5.8.RightScale Windows v13false2012-12-07T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-sqlsvr2012-v5.8.8Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with MS SQL Server 2012 Standard and RightLink 5.8.RightScale Windows v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-sqlsvr2012-v5.8.8.1Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with MS SQL Server 2012 Standard and RightLink 5.8.RightScale Windows v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-sqlsvr2012-v5.8.8.12Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with MS SQL Server 2012 Standard and RightLink 5.8.RightScale Windows v13false2012-12-12T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-sqlsvr2012-v5.8.8.15Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with MS SQL Server 2012 Standard and RightLink 5.8.RightScale Windows v13false2013-01-05T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-v5.8.8Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.8.RightScale Windows v13false2012-08-28T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-SP1-x64-v5.8.8.11Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.8.RightScale Windows v13false2012-12-07T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US31bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-iis7.5-v13.4.12.2Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with IIS 7.5 and RightLink 5.8RightScale Windows v13false2013-05-30T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-iis7.5-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with IIS 7.5 and RightLink v5.8RightScale Windows v13false2013-08-16T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-iis7.5-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2012-v13.4.3.1Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with MS SQL Server 2012 Standard and RightLink v5.8RightScale Windows v13false2013-06-06T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2012-v13.5.1Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with MS SQL Server 2012 Standard and RightLink v5.8RightScale Windows v13false2013-08-19T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2012-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2012ent-v13.4.3.1Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with MS SQL Server 2012 Enterprise and RightLink v5.8RightScale Windows v13false2013-06-06T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2012ent-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with MS SQL Server 2012 Enterprise and RightLink v5.8RightScale Windows v13false2013-08-16T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2012ent-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2k8r2-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with MS SQL Server 2008R2 and RightLink v5.8RightScale Windows v13false2013-08-16T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2k8r2-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2k8r2ent-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with MS SQL Server 2008R2 Enterprise and RightLink v5.8RightScale Windows v13false2013-08-15T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-sqlsvr2k8r2ent-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US31bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-v13.4.12.2Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.8RightScale Windows v13false2013-05-30T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink v5.8RightScale Windows v13false2013-08-15T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2008R2-x64-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2008R2 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US31bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-iis8-v13.4.12.2Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with IIS 8 and RightLink 5.8RightScale Windows v13false2013-05-30T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-iis8-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with IIS 8 and RightLink v5.8RightScale Windows v13false2013-08-15T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-iis8-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-iis8-v5.8.8.12Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with IIS 8 and RightLink 5.8.RightScale Windows v13false2012-12-12T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-sqlsvr2012-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with MS SQL Server 2012 Standard and RightLink v5.8RightScale Windows v13false2013-08-15T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-sqlsvr2012-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271257PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-sqlsvr2012ent-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with MS SQL Server 2012 Enterprise and RightLink v5.8RightScale Windows v13false2013-08-15T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-sqlsvr2012ent-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Ztruehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows Serverhttp://go.microsoft.com/fwlink/?LinkId=271259PublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US31bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-v13.4.12.2Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.8RightScale Windows v13false2013-05-30T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-v13.5Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink v5.8RightScale Windows v13false2013-08-15T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-v14Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.9RightScale Windows v14false2014-03-24T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-v5.8.8.12Windowshttp://support.rightscale.com/12-Guides/RightLink/RightLink_End_User_License_AgreeementWindows 2012 with RightLink 5.8.RightScale Windows v13false2012-12-12T00:00:00Zfalsehttp://www.rightscale.com/privacy_policy.phpRightScale with Windows ServerPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US40c290a6b031d841e09f2da759bbabe71f__Oracle-Database-121010.v1-EE-LnxLinuxhttp://www.oracle.com/technetwork/licenses/oracle-license-2016066.htmlOracle Database 12c Enterprise Edition is a next-generation database designed for the cloud, providing a new multitenant architecture on top of a fast, scalable, reliable, and secure database platform. [Learn more|http://www.oracle.com/database|_blank]Oracle DatabasefalseOracleDatabase12_100.pnghttp://www.oracle.com/us/legal/privacy/privacy-policy-078584.htmlOracleOracleDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US40c290a6b031d841e09f2da759bbabe71f__Oracle-Database-121010.v3-SE-LnxLinuxhttp://www.oracle.com/technetwork/licenses/oracle-license-2016066.htmlOracle Database 12c Standard Edition is an affordable, full-featured data management solution that is ideal for midsize companies. [Learn more|http://www.oracle.com/database|_blank]Oracle Database StandardfalseOracleDatabase12_100.pnghttp://www.oracle.com/us/legal/privacy/privacy-policy-078584.htmlOracleOracleDatabase12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US10c290a6b031d841e09f2da759bbabe71f__Oracle-Linux-6Linuxhttp://www.oracle.com/technetwork/licenses/oracle-license-2016066.htmlOracle Linux 6 brings the latest Linux innovations to market, delivering extreme performance, advanced scalability, and reliability for enterprise applications and systems. [Learn more|http://www.oracle.com/linux|_blank]Oracle LinuxfalseOracleLinux6_100.pnghttp://www.oracle.com/us/legal/privacy/privacy-policy-078584.htmlOracleOracleLinux6_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30c290a6b031d841e09f2da759bbabe71f__WebLogic-Server-12c.v1-LnxLinuxhttp://www.oracle.com/technetwork/licenses/oracle-license-2016066.htmlOracle WebLogic Server 12c Enterprise Edition is a leading Java EE application server, delivering next-generation applications on a mission-critical cloud platform, with native cloud management, and integrated tools. [Learn more|http://www.oracle.com/weblogicserver|_blank]Oracle WeblogicfalseOracleWeblogic12_100.pnghttp://www.oracle.com/us/legal/privacy/privacy-policy-078584.htmlOracleOracleWeblogic12_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US128c6e0f177abd8496e934234bd27f46c5d__SharePoint-2013-Trial-1-7-2014Windowshttp://www.microsoft.com/en-us/download/details.aspx?id=38417Microsoft SharePoint Server 2013 Trial on Windows Server 2012 Datacenter. Virtual Machines created with this trial image will expire on July 6, 2014. This image includes a complete installation of SharePoint Server 2013. Some SharePoint Server 2013 components require additional setup and configuration. You can set-up Active Directory and SQL Server required for your SharePoint farm by provisioning additional virtual machines. Minimum recommended virtual machine size for this image is Large. To evaluate the advanced capabilities of SharePoint Server 2013, we recommend that you use a virtual machine size of Extra Large.SharePoint Server 2013 Trial2014-01-07T00:00:00ZfalseSharePoint2013_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statement/ExtraLargeMicrosoft SharePoint GroupSharePoint2013_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;West US30de89c2ed05c748f5aded3ddc75fdcce4__PuppetEnterpriseMaster-3_2_1-amd64-server-20140408-en-us-30GBLinuxhttp://puppetlabs.com/solutions/microsoft#EulaThis image includes a pre-configured Puppet Master with the Ubuntu Linux distribution for easy deployment of Puppet Enterprise. The evaluation will end on May 31, 2014 per Puppet Labs' End User License Agreement (EULA). To set up a Puppet Enterprise environment, please refer to the Getting Started Guide for Deploying a Puppet Master with Windows Azure at http://puppetlabs.com/solutions/microsoftPuppet Enterprise 3.22014-04-10T17:33:44.796315ZfalsePuppetLabs_100x100.pnghttp://puppetlabs.com/solutions/microsoftMediumPuppet LabsPuppetLabs_45x45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US30de89c2ed05c748f5aded3ddc75fdcce4__PuppetEnterpriseMaster-3_2_2-amd64-server-20140408-en-us-30GBLinuxhttp://puppetlabs.com/solutions/microsoft#EulaThis image includes a pre-configured Puppet Master with the Ubuntu Linux distribution for easy deployment of Puppet Enterprise. The evaluation will end on May 31, 2014 per Puppet Labs' End User License Agreement (EULA). To set up a Puppet Enterprise environment, please refer to the Getting Started Guide for Deploying a Puppet Master with Windows Azure at http://puppetlabs.com/solutions/microsoftPuppet Enterprise 3.22014-04-16T20:41:05.3700261ZfalsePuppetLabs_100x100.pnghttp://puppetlabs.com/solutions/microsoftMediumPuppet LabsPuppetLabs_45x45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2008R2SP2-Enterprise-CY13SU04-SQL2008-SP2-10.50.4021.0Windowshttp://go.microsoft.com/fwlink/?LinkID=285681This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2008 R2 SP2 Enterprise on Windows Server 2008 R22013-04-16T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxLargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2008R2SP2-Standard-CY13SU04-SQL2008-SP2-10.50.4021.0Windowshttp://go.microsoft.com/fwlink/?LinkID=285685This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2008 R2 SP2 Standard on Windows Server 2008 R22013-04-16T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxMediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-CU4-11.0.3368.0-Enterprise-ENU-Win2012Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 20122013-06-26T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-CU4-11.0.3368.0-Enterprise-ENU-Win2K8R2Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 2008 R22013-07-10T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-CU4-11.0.3368.0-Standard-ENU-Win2012Windowshttp://go.microsoft.com/fwlink/?LinkID=285691Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Standard on Windows Server 20122013-07-15T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-Enterprise-CY13SU04-SQL11-SP1-CU3-11.0.3350.0-BWindowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server 2012 components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 2008 R22013-04-16T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-Enterprise-CY13SU04-SQL2012-SP1-11.0.3350.0-Win2012Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 20122013-04-16T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-Standard-CY13SU04-SQL11-SP1-CU3-11.0.3350.0-BWindowshttp://go.microsoft.com/fwlink/?LinkID=285691Some SQL Server 2012 components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Standard on Windows Server 2008 R22013-04-16T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-Standard-CY13SU04-SQL2012-SP1-11.0.3350.0-Win2012Windowshttp://go.microsoft.com/fwlink/?LinkID=285685Some SQL Server 2012 components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Standard on Windows Server 20122013-04-16T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-Web-CY13SU04-SQL11-SP1-CU3-11.0.3350.0Windowshttp://go.microsoft.com/fwlink/?LinkID=286424Some SQL Server 2012 components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Web on Windows Server 2008 R22013-04-16T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Enterprise-ENU-Win2K8R2-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285681This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2008 R2 SP2 Enterprise on Windows Server 2008 R22013-10-22T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxLargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Enterprise-ENU-Win2K8R2-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285681We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2008 R2 SP2 Enterprise on Windows Server 2008 R22013-12-23T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxLargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Enterprise-ENU-Win2K8R2-CY14SU02Windowshttp://go.microsoft.com/fwlink/?LinkID=285681We recommend that you use a virtual machine size of A3 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2008 R2 SP2 Enterprise on Windows Server 2008 R22014-02-21T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxA3Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Standard-ENU-Win2K8R2-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285685Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2008 R2 SP2 Standard on Windows Server 2008 R22013-10-22T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxMediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Standard-ENU-Win2K8R2-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285685We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2008 R2 SP2 Standard on Windows Server 2008 R22013-12-23T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxMediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Standard-ENU-Win2K8R2-CY14SU02Windowshttp://go.microsoft.com/fwlink/?LinkID=285685We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2008 R2 SP2 Standard on Windows Server 2008 R22014-02-21T00:00:00ZtrueSqlserver2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxA2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Web-ENU-Win2K8R2Windowshttp://go.microsoft.com/fwlink/?LinkID=285686Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2008 R2 SP2 Web on Windows Server 2008 R22013-07-29T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxMediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Web-ENU-Win2K8R2-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285686Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2008 R2 SP2 Web on Windows Server 2008 R22013-10-22T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxMediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Web-ENU-Win2K8R2-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285686We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2008 R2 SP2 Web on Windows Server 2008 R22013-12-23T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxMediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2008R2SP2-GDR-10.50.4021.0-Web-ENU-Win2K8R2-CY14SU02Windowshttp://go.microsoft.com/fwlink/?LinkID=285686We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2008 R2 SP2 Web on Windows Server 2008 R22014-02-21T00:00:00ZtrueSqlServer2008R2_100.pnghttp://msdn.microsoft.com/library/ms143384(v=sql.105).aspxA2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2008R2_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-DataWarehousing-ENU-WS2012Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This Enterprise Edition image uses Fast Track optimization rated for 400 GB data warehousing workloads. After the portal deployment completes, you need to attach the disks. To do this, connect to the VM and then follow the on-screen instructions. Before using the VM, review the recommendations at http://go.microsoft.com/fwlink/p/?LinkId=320441. For best performance, we recommend the A6 VM size. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 for Data Warehousing on Windows Server 20122013-09-30T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A6Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-DataWarehousing-ENU-WS2012-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This Enterprise Edition image uses Fast Track optimization rated for 400 GB data warehousing workloads. After the portal deployment completes, you need to attach the disks. To do this, connect to the VM and then follow the on-screen instructions. Before using the VM, review the recommendations [here|http://go.microsoft.com/fwlink/p/?LinkId=320441|_blank]. For best performance, we recommend the A6 VM size. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 for Data Warehousing on Windows Server 20122013-12-23T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A6Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-DataWarehousing-ENU-WS2012-CY14SU02Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This Enterprise Edition image uses Fast Track optimization rated for 400 GB data warehousing workloads. After the portal deployment completes, you need to attach the disks. To do this, connect to the VM and then follow the on-screen instructions. Before using the VM, review the recommendations [here|http://go.microsoft.com/fwlink/p/?LinkId=320441|_blank]. For best performance, we recommend the A6 VM size. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 for Data Warehousing on Windows Server 20122014-02-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A6Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Enterprise-ENU-WS2008R2-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 2008 R22013-10-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Enterprise-ENU-Win2012Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 20122013-08-06T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Enterprise-ENU-Win2012-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of large or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Enterprise on Windows Server 20122013-10-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067LargeMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Enterprise-ENU-Win2012-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image contains the full version of SQL Server. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of A3 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Enterprise on Windows Server 20122013-12-23T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A3Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Enterprise-ENU-Win2K8R2-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285687This image will be removed on 5/30/2014. We recommend that you use a virtual machine size of A3 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Enterprise on Windows Server 2008 R22013-12-23T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A3Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Standard-ENU-WS2008R2Windowshttp://go.microsoft.com/fwlink/?LinkID=285687Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Standard on Windows Server 2008 R22013-09-04T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Standard-ENU-Win2012-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285691Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Standard on Windows Server 20122013-10-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Standard-ENU-Win2012-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285691Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Standard on Windows Server 20122013-12-23T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Standard-ENU-Win2K8R2-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=285691Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Standard on Windows Server 2008 R22013-10-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Standard-ENU-Win2K8R2-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=285691We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Standard on Windows Server 2008 R22013-12-23T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Standard-ENU-Win2K8R2-CY14SU02Windowshttp://go.microsoft.com/fwlink/?LinkID=285691This image will be removed on 5/30/2014. We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Standard on Windows Server 2008 R22014-02-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Web-ENU-WS2008R2Windowshttp://go.microsoft.com/fwlink/?LinkID=286424Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Web on Windows Server 2008 R22013-09-04T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Web-ENU-WS2008R2-CY13SU10Windowshttp://go.microsoft.com/fwlink/?LinkID=286424Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database.SQL Server 2012 SP1 Web on Windows Server 2008 R22013-10-24T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Web-ENU-Win2K8R2-CY13SU12Windowshttp://go.microsoft.com/fwlink/?LinkID=286424Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of medium or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Web on Windows Server 2008 R22013-12-23T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067MediumMicrosoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2012SP1-CU5-11.0.3373.0-Web-ENU-Win2K8R2-CY14SU02Windowshttp://go.microsoft.com/fwlink/?LinkID=286424This image will be removed on 5/30/2014. Some SQL Server components require additional setup and configuration before use. We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2012 SP1 Web on Windows Server 2008 R22014-02-21T00:00:00ZtrueSqlServer2012_100.pnghttp://www.microsoft.com/en-us/download/details.aspx?id=29067A2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2012_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2014RTM-12.0.2000.8-DataWarehousing-ENU-WS2012R2-AprilGAWindowshttp://go.microsoft.com/fwlink/?LinkID=298186This image is optimized for data warehousing workloads with data sizes up to 1TB using clustered columnstore indexes. After the portal deployment completes, you need to attach disks to the virtual machine. To do this, connect to the VM and follow the on-screen instructions. Before using the VM, review the recommendations [here|http://msdn.microsoft.com/library/dn387396.aspx|_blank]. For best performance, we recommend using a VM size of A7. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2014 RTM DataWarehousing on Windows Server 2012 R22014-04-01T07:00:00ZtrueSQLServer2014_100.pnghttp://go.microsoft.com/fwlink/?LinkID=282418A7Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2014_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2014RTM-12.0.2000.8-ENTCORE-ENU-WS2012R2-AprilGAWindowshttp://go.microsoft.com/fwlink/?LinkID=298186This image contains the full version of SQL Server. We recommend that you use a virtual machine size of A3 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2014 RTM Enterprise on Windows Server 2012 R22014-04-01T07:00:00ZtrueSqlServer2014_100.pnghttp://go.microsoft.com/fwlink/?LinkID=282418A3Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271259SqlServer2014_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2014RTM-12.0.2000.8-Standard-ENU-WS2012R2-AprilGAWindowshttp://go.microsoft.com/fwlink/?LinkID=298186This image contains the full version of SQL Server. We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2014 RTM Standard on Windows Server 2012 R22014-04-01T07:00:00ZtrueSqlServer2014_100.pnghttp://go.microsoft.com/fwlink/?LinkID=282418A2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271257SqlServer2014_45.pngPublicEast Asia;Southeast Asia;North Europe;West Europe;East US;North Central US;West US127fb83b3509582419d99629ce476bcb5c8__SQL-Server-2014RTM-12.0.2000.8-Web-ENU-WS2012R2-AprilGAWindowshttp://go.microsoft.com/fwlink/?LinkID=298186This image contains the full version of SQL Server. We recommend that you use a virtual machine size of A2 or higher. This image has been pre-configured for Windows Azure, including enabling CEIP which can be disabled, for more info see [here|http://msdn.microsoft.com/en-us/library/windowsazure/dn133151.aspx#database|_blank].SQL Server 2014 RTM Web on Windows Server 2012 R22014-04-01T07:00:00ZtrueSqlServer2014_100.pnghttp://go.microsoft.com/fwlink/?LinkID=282418A2Microsoft SQL Server Grouphttp://go.microsoft.com/fwlink/?LinkId=271258SqlServer2014_45.pngPublicEast US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-RDSHwO13P-on-Windows-Server-2012-R2-20140417-1824WindowsThis image can be used by authorized Microsoft Service Providers only.Windows Server RDSHwO13P on Windows Server 2012 R2false2014-04-17T19:21:27.3838648ZfalseWindowsServer2012R2_100.pnghttp://www.windowsazure.com/en-us/support/legal/privacy-statementLargeMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngPublicEast US;West US127ad072bd3082149369c449ba5832401ae__Windows-Server-Remote-Desktop-Session-Host-on-Windows-Server-2012-R2-20140403-2126WindowsThis image contains the Windows Server 2012 R2 operating system with the Remote Desktop Session Host (RD Session Host) role installed. This image has been pre-configured for Windows Azure. RD Session Host enables a server to host RemoteApp programs or session-based desktops.Windows Server Remote Desktop Session Host on Windows Server 2012 R2false2014-04-03T22:17:28.0548753ZfalseWindowsServer2012R2_100.pngMediumMicrosoft Windows Server Remote Desktop GroupWindowsServer2012R2_45.pngUserNorth Europe30http://mtlytics.blob.core.windows.net/vhds/eqowwq2s.a51201312281344410973.vhdambaribaseLinuxThe base Ambari InstancefalseUserNorth Europe30http://mtlytics.blob.core.windows.net/communityimages/community-271-bcee18c0-e6f5-4595-a9ae-b64ebb9cb8a9-2.vhdAzure-Data-AnalysisLinuxhttp://spark.elastacloud.com{"description":"Includes R, openmpi and loads of packages. Include Spark 0.8, Shark 0.7 and Storm and Kafka. Also includes iPython notebook + a whole heap of libraries.","publisherUrl":"https://vmdepot.msopentech.com/User/Show?user=271","publisher":"elastacloud","imageUrl":"https://vmdepot.msopentech.com/Vhd/Show?VhdID=8689&version=10769","icons":{"Small":"https://vmdepotwestus.blob.core.windows.net/images/271/6c415744-cfed-4ed5-8493-361f47716623_45x45.png","Large":"https://vmdepotwestus.blob.core.windows.net/images/271/6c415744-cfed-4ed5-8493-361f47716623_100x100.png","ExtraLarge":"https://vmdepotwestus.blob.core.windows.net/images/271/6c415744-cfed-4ed5-8493-361f47716623_215x215.png"}}CommunityfalseUserNorth Europe30https://neelasta5191b16a673d426c.blob.core.windows.net/elastaimage/elastaspark0.vhdelastaspark0Linux2014-04-14T13:40:06ZfalseGeneralizedUserNorth Europe30https://neelasta5191b16a673d426c.blob.core.windows.net/elastaimage/neelastaspark0.vhdneelastaspark0Linux2014-05-27T12:10:18ZfalseGeneralizedUserNorth Europe30https://neelasta5191b16a673d426c.blob.core.windows.net/elastaimage/neelastaspark1.vhdneelastaspark1Linux2014-05-27T11:24:59ZfalseGeneralizedUserWest Europe30https://portalvhdsj5170kkqq0ftq.blob.core.windows.net/elastaimage/sparkius1.vhdsparkius1Linux2014-02-04T11:36:22ZfalseUserNorth Europe30http://mtlytics.blob.core.windows.net/vhds/m15pycz2.ync201403171254370011.vhdstorm.elactacloud.baseLinuxfalseUserNorth Europe30http://portalvhds3c3c6cj9bpgwh.blob.core.windows.net/vhds/hqbn1y3e.gya201404221049490886.vhdzk-drill-src-0LinuxfalseGeneralized \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure/_3761b98b_673d_526c_8d55_fee918758e6e_services_storageservices_dss123.xml b/libcloud/test/compute/fixtures/azure/_3761b98b_673d_526c_8d55_fee918758e6e_services_storageservices_dss123.xml new file mode 100644 index 0000000000..88207060e1 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure/_3761b98b_673d_526c_8d55_fee918758e6e_services_storageservices_dss123.xml @@ -0,0 +1 @@ +ResourceNotFoundThe storage account \'dss123\' was not found. \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_77777777_7777_7777_7777_777777777777_oauth2_token.json b/libcloud/test/compute/fixtures/azure_arm/_77777777_7777_7777_7777_777777777777_oauth2_token.json new file mode 100644 index 0000000000..b9702f2a89 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_77777777_7777_7777_7777_777777777777_oauth2_token.json @@ -0,0 +1 @@ +{"expires_in":"3600","token_type":"Bearer","expires_on":"1111111111","not_before":"1111111111","resource":"https://management.core.windows.net/","access_token":"3333333333333333333333333333333333333333333333333333333"} diff --git a/libcloud/test/compute/fixtures/azure_arm/_77777777_7777_7777_7777_777777777777_oauth2_token_PAGINATION_INFINITE_LOOP.json b/libcloud/test/compute/fixtures/azure_arm/_77777777_7777_7777_7777_777777777777_oauth2_token_PAGINATION_INFINITE_LOOP.json new file mode 100644 index 0000000000..b9702f2a89 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_77777777_7777_7777_7777_777777777777_oauth2_token_PAGINATION_INFINITE_LOOP.json @@ -0,0 +1 @@ +{"expires_in":"3600","token_type":"Bearer","expires_on":"1111111111","not_before":"1111111111","resource":"https://management.core.windows.net/","access_token":"3333333333333333333333333333333333333333333333333333333"} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Commerce_RateCard.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Commerce_RateCard.json new file mode 100644 index 0000000000..547b80e99e --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Commerce_RateCard.json @@ -0,0 +1,84270 @@ +{ + "Currency": "USD", + "IsTaxIncluded": false, + "Locale": "en-US", + "Meters": [ + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "9a6cb708-ad98-4a61-bdc7-16360e3b50ad", + "MeterName": "Unlimited Data - 1 Gbps", + "MeterRates": { + "0": 8700.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "02ef3dbe-1b98-4ee0-81bb-6133f5b3ad51", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "67d2ce10-48c6-4834-a7a1-c7b4a19803c4", + "MeterName": "Data Transfer In (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "42093d75-9418-4b6c-9c29-fa8bb83ef0cf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.062 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "892c73e6-4782-408c-aee2-e88c3cd6fb9c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.245 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "417cd99a-dd90-4e0f-8df5-532f17c1c4f6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e687a2a0-483d-4641-906f-500dbe35febf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 7.782 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0becd1d4-71e7-4395-a785-47ff2db3d6d4", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.142 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "5f77822d-d647-45ca-b985-2186b0810c89", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f6fa3fdf-cbec-442b-b98d-4fc132be16eb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1b6197e5-7112-4b20-b569-ab2b30df61fe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.65 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "31ca06b2-a234-478b-82af-e33f8ddaf21d", + "MeterName": "MSFT Peering Unlimited Data 5 Gbps", + "MeterRates": { + "0": 41000.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "339544eb-d636-48dc-b1b6-2a45228ce8ad", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.262 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "aa905571-5d7f-4b6d-a1e6-406a281250a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.974 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "28cea04e-3479-41d5-bcec-97c3f51d356b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.983 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8fcd80c1-24cf-46c7-a7c6-511f275b6a39", + "MeterName": "Premium P11 Secondary Active Geo Database Days", + "MeterRates": { + "0": 250.0 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a118854d-af9d-470a-9441-a50253580cb4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.815 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7cb2e14f-ff57-436b-b155-3d3787649979", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.121 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d57528b4-2110-4cc5-8750-b2d730fd3166", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.263 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0e416802-fb06-4e3a-813c-b0ed4c202850", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.192 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Web (24 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6ae899af-3ee2-4213-82d3-9d91c233cc9c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.904 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "365a457f-78b3-4c98-8199-2c0459ed3e39", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4cd39a06-0803-4f70-a970-02bdf31124e3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.730125 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "846cf1cb-4cf6-4f04-9e69-8b5493c3dc19", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "61c94f93-033b-4b1e-843e-87a3bde1ec16", + "MeterName": "Premium P15 Database Days", + "MeterRates": { + "0": 516.128 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c35c15df-4d8c-4992-b970-8903e537a4b8", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "16c5f661-64d1-4a81-8279-0164bb823597", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.462 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e819f9d8-4ce1-4c33-b793-78011e7348c9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.707 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "228d22b2-c814-473a-acfc-3f8644c950ff", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.04 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a58368b4-e6cd-436b-bfab-a85ae0e25301", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 8.102 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ea94e351-beb5-421a-92f9-84b1d4d41235", + "MeterName": "Standard S1 Search Hour", + "MeterRates": { + "0": 0.444 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f65c4174-b990-4bc2-beca-052741dda5be", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.051 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ad0cb59e-47aa-42b0-9f4a-451c9f9af4c9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.664 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4817d00a-40ed-44c1-9963-d70e32499efb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "14494683-5d41-4dbf-a960-e10b204b10b2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "6f69f6b3-34c2-4a40-8bcb-bb5aa8268553", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 73.22 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "27d7c4a2-5743-4d71-9741-9a8bb074cd34", + "MeterName": "MSFT Peering Metered Data 10 Gbps", + "MeterRates": { + "0": 5000.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-05-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "3dfa2dd0-43d8-4445-90a9-3803eaf10ed2", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "761abab8-259d-4206-a6ae-707ed03fc540", + "MeterName": "Standard IO - File Read Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.0015 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "80aed687-40ca-4467-8a4f-99b9c446456a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.759 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "04bf8db0-4f5d-45cb-8c5a-d8d8116c29d4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.143 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "b90f8b65-6c3e-43fc-9149-bdfc73b6a5b9", + "MeterName": "Paid Data per App", + "MeterRates": { + "0": 2.3 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Application Insights", + "MeterTags": [], + "Unit": "1 GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dc8fac33-6774-4005-a3db-efc784cfa66c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.246 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f598ae38-36f3-47a5-8fe4-1f655c9e8ac8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.88 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2e0c0f5f-d41d-45ec-b1ce-1fc2434c1aca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.13 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A10 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0fdede62-7f19-4b2a-941b-468037da8f9d", + "MeterName": "Premium P4 Database Days", + "MeterRates": { + "0": 66.43 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "27749c62-4f47-4cf6-8e94-7be023958baa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.6 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV6 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a59a85a3-d040-4dd4-8dbf-b0f64717e019", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "95250052-9980-4739-951e-60acbad79507", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4bfdf677-7be2-4a9e-8533-6513c69a151c", + "MeterName": "Premium P4 Secondary Geo Database Days", + "MeterRates": { + "0": 51.48 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f35b599d-b770-4341-9e52-eee2510f3d8a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.92 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d888ed83-b181-4f95-92ed-1bf6991cef5d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.632 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "58adcdac-6704-4871-a583-30f0426e98e5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.556 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4a64934a-3f91-4202-b920-e14cc88a5b5d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.042 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "e753e8a5-24de-40e1-9c0f-4438951bd077", + "MeterName": "Standard CDN Data Transfer - S2 (GB)", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "Zone 5", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "fda30072-8627-4b14-a283-69cd00bfc880", + "MeterName": "Premium P2 Secondary Geo Database Days", + "MeterRates": { + "0": 25.42 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "0f2d27dc-6004-4e1c-84c3-1b229913e5c1", + "MeterName": "Face Storage Included (in 1,000s)", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1K Faces" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c15c48c4-1c1f-4945-9be5-08224d795402", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b5f839bb-aba7-489b-9e8c-25c480c264bb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9d81c74d-7a64-4601-b45c-0008a1054cd3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "ca22ba8e-b675-4388-8b67-b2e3ebde6d73", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "7e4cc87b-7937-4939-b4b2-12fe83fe092c", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3584 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "bd4a9ff3-f831-4b3d-a7da-8ea4112ff213", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b91f630e-7dcf-4871-aed0-df6c00fd3784", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "84030b12-74d4-4695-86fb-e371784d3bfd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "72aaf753-f9bc-448f-9612-c85dc956e6d6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.146 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "62f20455-d83a-45d1-a0f6-e0adf240c024", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.0963 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8375a86c-cc34-458a-aaf1-c8e2caf3ea71", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "62ec4bf2-15b9-4c37-a753-872978bc0dee", + "MeterName": "Standard Elastic DTU Pack", + "MeterRates": { + "0": 0.1661 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "56b248d8-543e-4290-ae47-fd8674f5c97f", + "MeterName": "Standard S3 Database Days", + "MeterRates": { + "0": 5.3569 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "982ff28e-09d8-40f3-8379-f2bab7488ea6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.385 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "45026268-b020-40a7-b840-06a9c720c1be", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c57b2ab1-8a46-4746-bbd0-df1d79c957f8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.402 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "de8b5688-21a0-4bb2-812f-8962b0f63e12", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "RemoteApp", + "MeterId": "0ad45537-5207-4535-9f21-3b8e80e73b7d", + "MeterName": "Basic Users", + "MeterRates": { + "0": 10.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Named User", + "MeterTags": [], + "Unit": "Users" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1e85030c-67b9-4302-b5eb-85be0c021eaa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.336 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC24 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "33f52b64-9b91-4e51-a087-a41ab5818b6f", + "MeterName": "Premium P11 Secondary Geo Database Days", + "MeterRates": { + "0": 205.82 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "86fe555a-88fc-4f0f-8c4a-0d414519b701", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "705ac022-f360-4a96-9f32-a2a982d7b70e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6a8123f0-241c-45fc-aa2c-614fa24b08d1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.066 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d0d60c11-d96e-4fae-a3df-1e39f822d2a9", + "MeterName": "Premium P6 Secondary Geo Database Days", + "MeterRates": { + "0": 102.96 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "aeeee065-765c-4ce3-8c74-21861409c30d", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.142 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cortana Intelligence", + "MeterId": "9e8f4c7c-3482-4e98-953d-186f3e1172c8", + "MeterName": "Basic (Daily Unit)", + "MeterRates": { + "0": 8.064516 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Customer Insights", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7968aef1-8e33-4597-8917-6eb4dbb57979", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.481 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a54f6f40-6ef5-46c7-99e5-33124bfcf2b1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.815 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "af4334e4-7547-49da-9017-6f710540309d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.062 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "6a6a7719-7350-4178-8f96-e1033895b6a5", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "83175033-13ee-4c95-835d-5087c5eb5423", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "80562bbc-3761-40ea-bed9-de87c154ebd5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9263a2e8-a7c0-4765-ab07-f2b267a841ef", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "2f4ac5a8-7f72-4878-a22b-50749e033fc8", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "S Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d0ae028c-44d0-4689-a24f-e729cad573c6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.058 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ef18c0af-c644-465a-9a76-9cf1e3cf54f5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.766 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "31281e3f-641c-4d4d-9b70-3a27437a9aa9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.644 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "83944f00-e218-4cca-974a-c0d01dafd2bf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.617 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "06ee940c-273f-447f-9ca0-ba54218a9722", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 23.848 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "fd826c3d-0cda-4969-b028-b3afcd2991cc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.329 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "500de1f7-1bea-4481-89ba-cf400bf13abf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.332 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e40a96fa-4939-4857-a296-7118e0ca74dc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.88 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "7cbfdd49-706c-43d8-9ff2-251f08cd9c36", + "MeterName": "Standard S1 Overage (in 1,000s)", + "MeterRates": { + "0": 1.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Analytics", + "MeterTags": [], + "Unit": "1,000 Transactions" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "af4c7b6e-9fa1-4207-ae06-6625f30994ae", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.0083 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "14238d16-80ad-42a4-9656-b7e1261fbccb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a97bb631-35bd-47a7-ac4e-0c1ea52f1719", + "MeterName": "Basic Database Days", + "MeterRates": { + "0": 0.201 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "187e023f-9a0c-4615-8212-3ccd964aa745", + "MeterName": "MSFT Peering Metered Data 200 Mbps", + "MeterRates": { + "0": 145.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b766ad35-2929-48dc-81aa-e1f5a2d5bfd5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.84 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "dcc0c382-24d4-4bf3-9b32-2d727b072d65", + "MeterName": "Premium P4 Secondary Geo Database Days", + "MeterRates": { + "0": 49.5 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ac1c269f-595a-4936-92b2-a40b936bab7e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.86 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "33462701-5dda-4102-b1f8-e1eca737ff6e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.071 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b0400d79-68d7-48a4-8f39-5c867d108ebd", + "MeterName": "Standard Elastic DTU Pack", + "MeterRates": { + "0": 0.0805 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "95f391bf-dd5a-47eb-8f08-d17ccb9ed370", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.246 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "XL OpenLogic", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f89269ee-ef2b-4269-9aba-9308de89cb68", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "e06dd150-870d-4fd8-a78a-a811b0d22b37", + "MeterName": "Standard Overage (in 100,000s)", + "MeterRates": { + "0": 50.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Speller API", + "MeterTags": [], + "Unit": "100K Transactions" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "12a23053-8007-4387-b1b5-720140dfa00e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0f0157d1-ff48-49ba-9653-eba004a1a10d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Recovery Services", + "MeterId": "6c1ae29e-ea4c-43f3-a25d-55c78b8db13e", + "MeterName": "VM replicated to System Center", + "MeterRates": { + "0": 16.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Site Recovery", + "MeterTags": [], + "Unit": "VM" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "c01a1eed-b19a-4aad-bb83-8d62cdc29778", + "MeterName": "Standard IO - Page Blob Write Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c4de179c-c9ed-4e2e-b77c-392655fc62b5", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.1252 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "e869673a-1901-4af5-8788-58b668f7a8b6", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "885308fc-3438-4ea1-a9f0-356ac1806722", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.169 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0e61c836-8150-406a-bab5-4242c6914f97", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.04 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c0b02555-e025-4b46-813d-9fc9c59f4838", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.954 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1e96d878-3362-4400-8488-e4b200098e1a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.098 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "620c9c91-4e48-4f35-8085-8e6b620e2154", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.131 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "5d4be54d-908b-4a00-bf85-83644882619f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "96a067eb-479a-487b-9fbe-f64199af0205", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.04 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5dc94800-2d4b-4f71-9a72-e867bae0876f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.121 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1dc72c6d-2ca8-404b-b5f3-dd64eca27ce2", + "MeterName": "Premium P4 Secondary Active Geo Database Days", + "MeterRates": { + "0": 72.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "146f3877-a621-4b5a-80bb-ecc2279ae2ff", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4bdf6b62-85a8-4241-9b92-ce226b2c5f23", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "50bbe40a-7656-40c5-b799-591fd6ee4227", + "MeterName": "Standard S0 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.5855 + }, + "MeterRegion": "BR South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "ff7c3059-02f0-437d-a6b8-a16f1a37a101", + "MeterName": "Standard S4 Overage (in 1,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Recommendations", + "MeterTags": [], + "Unit": "1,000 Transactions" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1127b2c7-502e-4e6c-88b8-61a94b4f423b", + "MeterName": "Premium Elastic DTU Pack", + "MeterRates": { + "0": 0.1993 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "66260cb7-608e-40a1-bb09-34e9645b2c53", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6f49b921-b7b3-4fe9-aa4b-0699944bbdb7", + "MeterName": "Standard S1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 1.21 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "854ec580-2f31-4916-9851-accdbde5194a", + "MeterName": "Premium P18 Secondary Active Geo Database Days", + "MeterRates": { + "0": 499.982 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "b7eccac8-e584-47d9-9368-90bc9782f562", + "MeterName": "S3 (Units)", + "MeterRates": { + "0": 10000.0 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c596b592-e7d1-4f7a-8d11-9aac6048f87d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.315 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "96b4003d-adb9-453c-b024-a810ffddc21d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.148 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "acc81779-f782-4e9b-b837-90e9538a091d", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0055 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c24f70bc-1665-4d57-96dd-6e56038e2e00", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e407bc64-9bf3-4ee1-b6d6-145a590703a6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.147 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "4f1fa8fe-ffed-48fa-9969-26a150775b60", + "MeterName": "Basic Medium App Service Hours", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 5.0, + "MeterCategory": "Business Analytics", + "MeterId": "1d35a882-0e55-447a-8482-3e49221b18bd", + "MeterName": "Low Frequency Cloud Activity", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Factory", + "MeterTags": [], + "Unit": "Activities" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7cafdacd-f6b7-4991-ade6-cca146bea157", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.143 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a4f190ad-91b9-42a5-a9e7-858e84d0956c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.37 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "75f53448-65fd-4333-b0d4-ae2dda1db5f5", + "MeterName": "Metered Data - 10 Gbps", + "MeterRates": { + "0": 5000.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a4407cfc-ba27-47c6-b53b-2c8cac94f316", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.352 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7bb27309-e491-4288-b180-d6e7112edc34", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.186 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "96812953-bc3b-4b96-bdf5-051d8c4a534f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "12029fdf-d31a-4d82-81b5-bac12e9f3649", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.047 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3f7390fa-1879-4310-871a-95a0a0c26ec2", + "MeterName": "Standard S3 Database Days", + "MeterRates": { + "0": 6.048 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "77f439fd-d80d-49c0-9ce1-262a5211d0eb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.059 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "8dc92ab8-91b0-407c-a5cd-f484e3653db7", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.0044 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "b40291f6-f450-429b-a21f-0bc6711787ac", + "MeterName": "Build and Release Hosted Pipelines", + "MeterRates": { + "0": 40.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Team Services", + "MeterTags": [], + "Unit": "Pipeline" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "245bfc87-0f93-4ae2-b7bc-3f567b10e520", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.458 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "6b3b540c-c0b2-4d98-9abc-aa26087f38e9", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c6aef3cf-44df-4155-947c-64f444e3dc5c", + "MeterName": "Premium P6 Secondary Geo Database Days", + "MeterRates": { + "0": 101.71 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "8fc71fea-8c59-4c40-b16e-d8946d7cc130", + "MeterName": "Free Apps", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Application Insights", + "MeterTags": [], + "Unit": "Apps" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "327be05e-b61d-4e57-aba3-5b9e1a767213", + "MeterName": "MSFT Peering Unlimited Data 100 Mbps", + "MeterRates": { + "0": 1300.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9af22c27-8e81-40a0-8973-f442ba923911", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9d57c036-8bb9-4ef3-b81e-c90c0727b08d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "47655184-5a06-4122-a7db-a0ae297e3a6c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "510bac5f-4aa6-4c16-82e7-8cf12f2e6adb", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.656 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A8 OpenLogic", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "05f39632-0947-4cda-8833-2172163d0134", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "132e16fb-665a-4ed8-a9b4-1995e8fa73c6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.937 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b14a5b7f-417c-4b16-b719-5f4b057d560b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.54 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "07b2433f-f09e-45a3-834a-a7743d60bd28", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.127 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e4ce293f-b27e-407a-a20b-b3498718006b", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 19.71 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "14d7b1f9-2825-495f-bd8f-eac5943a57f8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.152 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "cdd01af8-9c0b-4952-ab2b-ddbeb16e1ac1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.13 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A10 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0f99ffe3-9c01-4093-9f43-e5542cde52c2", + "MeterName": "Standard S0 Secondary Database Days", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "576fc19c-9ed8-4e74-9164-86ffc1ccb429", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.092 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "30f61715-f06d-4f84-969d-e63087d22472", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "ca610afb-d685-4cb9-acbf-2278a934112f", + "MeterName": "Standard CDN Data Transfer - S2 (GB)", + "MeterRates": { + "0": 0.138 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f741839d-9c12-4b40-8985-c397bfd1e4d5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.808 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "46b7049d-2f0a-4153-96b9-78fea3f83029", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.0048 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "68a31453-4e2b-4410-962c-14fe90fb3252", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.227 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "275b0d22-68f3-4196-bf3b-702247d9f6bb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.385 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6b95aaaa-e6e4-41a3-a2a6-90dea894c272", + "MeterName": "Premium Elastic DTU Pack", + "MeterRates": { + "0": 0.225 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "450c65cd-de2a-4639-affd-fc9e85105bbb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "2ef71e5b-5da5-4a4d-b492-5277f79b30ea", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Identity", + "MeterId": "945bbf0f-0272-4ccb-ad3a-23798e584380", + "MeterName": "Users", + "MeterRates": { + "0": 1.4 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Multi-Factor Authentication", + "MeterTags": [], + "Unit": "Users" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0c1492a2-8db8-44c6-b0ed-cc6188c72b34", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1a002948-ff5d-4047-8fce-d284852ae52b", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.145 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4320563a-74fd-4fa2-a3e7-e163c0189719", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.191 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "9d9c75c7-6002-4a16-9258-c909a9565e9a", + "MeterName": "Standard Medium Azure App Service Hours", + "MeterRates": { + "0": 0.22 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c089fd5b-4dc8-4422-be54-7103c08e21ba", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.773 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0a29368a-01ba-48d8-b033-7f40b551d443", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.172 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8m VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0b26ac36-5ac3-450d-a942-0fd60e4192c8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.624 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "b137c303-c66a-4b0e-84e6-1f92f444d91e", + "MeterName": "Basic Small App Service Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "36055b6a-ccb4-40ff-b2b8-34b855fb4aaf", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.2825 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "aa1d3b6c-a906-4731-af7a-a3299b0a8c34", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "079430b3-16fc-4f1c-89da-080cdc2bf35f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f1249c5d-dca1-45e8-b42b-726dc9da0b94", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 122.88 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cb5fb216-7c56-4f37-a553-a448e7e53ff7", + "MeterName": "Standard S2 Database Days", + "MeterRates": { + "0": 2.904 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f3c5ed3-a187-4fb8-9d8b-02e36641e27b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 11.339 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ad1be467-1a36-4e0b-b3de-e7b0cb0f6f9e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.202 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4e1cf28e-c997-43ef-93be-5f3febc60f40", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.883 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "07821c60-1222-41db-b35f-59d169cd2c49", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.168 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5435d17e-896a-4d1f-aabc-8b74183f6e9e", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.034 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "299db139-4526-4af9-86e8-53240278b2b1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 7.076 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2d636ecf-35a5-4c5e-8a87-6ee81d71bd81", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.992 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7008e60c-6d9c-400a-8d4b-6b050aa28e29", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.079 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "976544bb-a6c1-4a04-879b-2d95dec07732", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.203 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8e9af6db-7104-4f1a-830e-93eabb955444", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.032 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Web (up to 4 cores)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c9ed8e37-ac21-4027-a060-3eb0eb5e8a0c", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 155.44 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a821a90b-2a56-4c1c-812d-0446190249fe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.064 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bcc8a6d2-f176-4e6a-b033-f5bc8cebb68e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.378 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "02ee2eec-2705-421e-ac2c-cdebf2e537d9", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a10d37fa-4928-426f-9ebe-e2d8ce3cca06", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.738 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cd3d7d79-e60b-457e-aa9e-3adad73fb10b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "feb04742-34f8-4ad9-b883-d912810b39cd", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.1045 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3c44e152-1ea5-415e-99c4-e73c00eac715", + "MeterName": "Premium P11 Database Days", + "MeterRates": { + "0": 250.0 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "39efd5e7-cc49-4425-bb58-a7b78f56333c", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0375 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c9846bec-80e3-4900-9e38-5060835d44d4", + "MeterName": "Premium P6 Secondary Geo Database Days", + "MeterRates": { + "0": 99.0 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "5c935199-99d3-490d-9342-703ceebe392c", + "MeterName": "Metered Data - 100 Mbps", + "MeterRates": { + "0": 100.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "197eeb00-f40e-4d31-bf6d-8ef8d54ff342", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "944f6253-f198-4f72-ba6f-d3b8ee4d4768", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "132d57f9-3761-4035-9a0e-a087c44cba20", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "af68cdc4-8795-4b3d-a360-5fdde7241f05", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.22 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "26828661-e674-4f0d-8e1b-6ad70e1615c4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7873159d-ebeb-47cf-9bbb-b2933bee9f2a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.265 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d9701908-80f2-42c3-baf2-b7972e43a2c4", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 148.68 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "73292260-ef3f-4583-8fef-199625b783ae", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d92b8278-b72c-4b6a-8b57-606806ec1d23", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 34.05 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "e733dc13-8522-4050-8987-8db7125856b6", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "cc143740-dafd-4586-b1cf-f07c5665a1be", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "99762400-c6ee-4f87-91ba-0508f1638e21", + "MeterName": "Standard Data Analyzed (GB)", + "MeterRates": { + "0": 2.3 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Log Analytics", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7af6950b-29e5-45a9-8584-5d3bd8f0a618", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.43 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a6a35bd0-b360-46cd-9433-3f6cee8551eb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.52 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "1b962c90-79f4-4c53-96a4-d69db802e0a2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.243 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b285dada-cd22-4275-b73a-f559579fffe4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.959 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ff2a610d-bb62-4440-90d5-02266ff4ffb0", + "MeterName": "Standard S2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 2.68 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "d5034e45-00c1-48c6-8c00-c866f788e033", + "MeterName": "Base Unit", + "MeterRates": { + "0": 10.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard Messaging", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "40f0e9b6-6760-431b-9a48-0693ec372d44", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.662 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a135fea2-6c76-44e2-ad54-3b6313f0844f", + "MeterName": "Standard S2 Search Hour", + "MeterRates": { + "0": 1.613 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2abb385b-e987-4155-ba96-23a34f3bb7df", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.67 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "G1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "89c117f6-6100-485c-b0b2-c33c8b63e18a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a84406ff-d8dc-43cb-be4c-286e8266bc29", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d9f1c506-6e89-475c-a74b-bfdc39fec60d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.521 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "e8862232-6131-4dbe-bde4-e2ae383afc6f", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SLES (6 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ae557946-5cd9-4047-843e-cb33489feed2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.292 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c72a3185-ea40-4d10-aaa5-d99405c74cf8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.894 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "60477f1e-08ae-4588-8c69-e7775816132e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.026 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a362614a-506d-4c5b-82f3-b408efc4fd8a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.888 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "61f839aa-bbd5-4270-821b-07904e18cfa0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "5b1f1e2d-5c19-43ea-bbfb-d5378301858e", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.011 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10K Operations" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7a2639ce-ae47-4413-9837-6b4f4b78be3d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.158 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "632d368f-6336-47eb-a1ee-b063ec39eb1f", + "MeterName": "Standard S1 Database Days", + "MeterRates": { + "0": 1.0645 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7a8dd9ff-0e5f-4ce9-92f8-0bfbb1091e42", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.313 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "e5d08ee7-4d8a-49dc-8e46-f818d0499298", + "MeterName": "Unlimited Data - 500 Mbps", + "MeterRates": { + "0": 2750.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "584a0f53-5caa-4dde-9586-d62ab46d388f", + "MeterName": "Standard Elastic DTU Pack", + "MeterRates": { + "0": 0.151 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "fe8170f4-b698-4d4d-ba84-d6ee6ff74c97", + "MeterName": "Standard Live Encoder Input Hours", + "MeterRates": { + "0": 5.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8e56f69a-3211-4cb6-b73f-f629cfeeb34e", + "MeterName": "Premium P2 Database Days", + "MeterRates": { + "0": 33.0 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b8b227a6-d291-423a-8dbf-423c9dd94a94", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.044 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0f254a75-3036-4ae6-af7d-eb9cd4b7167a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "b74c1bd6-c0ea-4248-b00a-dfe2afce7af0", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6bd28d13-48d9-442d-8501-a1f59507b135", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.22 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "ea6dc3b9-a9ee-4d30-a059-8edf46dfc478", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ec97b317-5e42-46ee-81ee-0dc4396aa2f4", + "MeterName": "Standard S3 Overage API Transactions (in 1,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "1,000s" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f3fa81b2-281d-4750-ab7d-f91fa7ede967", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.368 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0b64d111-1850-4091-b27f-763e35f67215", + "MeterName": "Standard S0 Database Days", + "MeterRates": { + "0": 0.5468 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "54c40026-ffc2-4da4-888d-481a0ef44704", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.026 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "07e398a1-409c-42a2-bbfc-390f6d099709", + "MeterName": "MSFT Peering Unlimited Data 50 Mbps", + "MeterRates": { + "0": 610.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fbbd1796-402b-46b1-b7cb-5a729a6e1c69", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.291 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b5e31c9d-98f4-47c6-af4d-e22a4be844ea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.706 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5d16be88-bfc0-4f33-bb0a-826eb941c13f", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.017 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "bb8a035f-5ff5-44bf-aeb6-77b2fc1de144", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.134 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "f622d0e3-d20d-4fa4-85f3-5e8010b3d421", + "MeterName": "Basic C5 (Hours)", + "MeterRates": { + "0": 0.42 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d33be181-a577-4f8e-9e3a-6d650e620b02", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.513 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "21b293cd-60dc-418f-9b98-2b452ed0de09", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.059 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10K Operations" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f438a8b0-a0a8-4633-8cb1-21daba7270a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 7.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Enterprise (20 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "97a052f2-dbc4-4271-8f00-dbfa0a37e079", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.56 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c33ad113-990e-4e2f-bb6c-54d61ff4f8fa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "701c1cfc-bae6-4655-85a1-4949d634c7aa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1289d3d9-2c7a-491b-ab7f-c3c5cf6dd7e7", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.067 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9f98bcd9-2523-4212-b153-315e6aee3c20", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 80.54 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2dd2239e-ed74-49ad-8077-500d8a6653cf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.62 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8b767c7b-3c71-42d2-821b-b6b072e181c3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.482 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "83961fe3-e796-4275-8699-e0f13ea9185d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "41804069-17cf-45dc-9bf8-a672686ccc51", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.475 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b2433c8a-f094-4e89-84b2-123d6ee29ca3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.036 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "20b2cac7-36fa-4c48-bf67-c4d43d7a9f40", + "MeterName": "Premium P4 (Hours)", + "MeterRates": { + "0": 5.772 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "67d2bbb3-964e-446b-888b-0e8f0c586f21", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "42df9574-8a63-476d-bcb7-acf476d3a2fd", + "MeterName": "Standard S3 Database Days", + "MeterRates": { + "0": 5.8064 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a6e82a0a-80c9-4d64-a816-212e27c97b10", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.133 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "554675b5-d546-4f54-8828-c10c03d38a9a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.333 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2e6e6d84-12e9-4ddd-a33b-301d391df510", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.854 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "433f8899-8f34-4120-a266-39649d1ef24e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "03994b5a-a7ce-4d12-9d61-0f6cf58d6778", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.273 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "9fff85ca-d247-4c0c-b841-9e8dc6dbaad3", + "MeterName": "S1 Media Reserved Units", + "MeterRates": { + "0": 69.0 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d793e346-94f3-4e3b-ae43-666913a4b7da", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7a11aa0a-27ba-4ab8-be1b-1906db4b2efb", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 19.71 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dfac5a0f-6f3a-45b5-bbd5-b28336d57cc2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.496 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bf8eeccc-0b61-4645-98fd-bf20411f2d6d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.508 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "4a70b10f-0790-4026-8a75-d8363d5f83f8", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.032 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "c6119456-9b69-4ffb-9dfd-9e1cea4d0621", + "MeterName": "Basic C5 (Hours)", + "MeterRates": { + "0": 0.525 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f10a94cc-a898-4d73-9411-821009720c15", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "00a95b36-8625-4555-bea6-5288c7ce8f50", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.588 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "712c80a9-91af-452a-b3d9-de0361c8de7e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "82cef088-c0ae-41c7-a7e3-93c83254a24e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.264 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "82194f40-08e3-4d64-9b08-11fb9934ffdb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.021 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4801f383-ed00-4597-a879-da967f7739f3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.39 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "437025b7-d995-4efe-8b98-b48d0875d72e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.155 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "a6b58cdd-8455-4ff0-9c09-4a81f6c5df90", + "MeterName": "MSFT Peering Metered Data 50 Mbps", + "MeterRates": { + "0": 55.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0a82aed6-2937-4cc0-a1f6-71fc3a9e4f7c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.624 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4148a391-4010-4d8f-aba4-e4e4d5599899", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.064 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6d6122d8-47dc-42cb-a910-1d6726abc07f", + "MeterName": "Premium P2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 34.32 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0caea3e3-b9d1-4219-a3ec-fc4cf8142a6b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "079eda81-1004-4bd3-aba3-4a970cb6bbd8", + "MeterName": "Standard S1 Database Days", + "MeterRates": { + "0": 1.0935 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "3d7aa86c-0e9d-4139-b59f-cc5bad92b873", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "57e8f0ea-b5ea-4bc8-9bd0-a9ddce256025", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "26c98145-3131-4e0a-8c2b-bed1246c8adc", + "MeterName": "Encoding Data Processed (GB)", + "MeterRates": { + "0": 1.39 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ba80c965-1c31-4f45-a7cd-22c78ced9e86", + "MeterName": "Metered Data - 10 Gbps", + "MeterRates": { + "0": 4350.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e0d57bc5-e150-4955-b95c-fb2fadab34d9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.316 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "330cfeab-55fc-4c95-a422-f0f09428ef53", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "757e2aa1-9d5a-447e-be83-64d99dc51f2f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.291 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "069007d7-2cd2-4779-88c6-b43d264b498b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7b1a43ea-b0e8-4ee6-a4c8-219433bda935", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.296 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "716cfdf0-dbcf-4c84-bdc3-43130dde78e5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.051 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "80177185-c995-432e-bd37-09a3faed72fe", + "MeterName": "Standard S3 Search Hour", + "MeterRates": { + "0": 3.552 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f4e6a4cc-2e80-452c-853c-71bf9b8a6d12", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.297 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d83fa551-8030-416a-b443-306aef06a5d2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "27d42441-b91e-4491-89fd-388c48477246", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0c66bea2-94be-4740-9a4e-006919770975", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.65 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e59e3380-bea3-4f6f-90ef-0846822dbf36", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.68 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "G3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "fef1105b-7705-4f29-890c-2e1cc9cfa9a4", + "MeterName": "Premium Extra Large App Service Hours", + "MeterRates": { + "0": 2.4 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f88737c3-4061-458c-87e3-619ccacd6913", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.516 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5261a49e-27cc-4b42-b264-15e332882525", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.153 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "32c3ebec-1646-49e3-8127-2cafbd3a04d8", + "MeterName": "Data Transfer In (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "c647ba7a-af71-451d-9971-c7d7e611f622", + "MeterName": "Premium P1 (Hours)", + "MeterRates": { + "0": 0.722 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "495caadd-0d44-43b2-b25b-46e922f2f806", + "MeterName": "Standard S3 Secondary Active Geo Database Days", + "MeterRates": { + "0": 4.8387 + }, + "MeterRegion": "JA West", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ceec0284-39ba-4ec8-98ed-09630ba1b1e2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 8.602 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f0550a41-a422-4a7a-adb3-538e35514db8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "f8c187bb-5a47-46ae-b874-f186d207fff4", + "MeterName": "Standard IO - Block Blob List Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "0287df59-e0c6-40a9-b91a-68a2f16bc215", + "MeterName": "Speaker Identification APIs (in 1,000s)", + "MeterRates": { + "0": 10.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1,000 APIs" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "a6123fe9-eef6-40b3-907b-ea1ba52684cb", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6512d69f-3960-4574-bb3b-f5732e130459", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.176 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5ca8088c-26ba-41c6-a704-f7557fe0fc50", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5d97dd1f-b0f2-4387-b9cf-da849209d530", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.34 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "eeada8b8-8ce8-402b-b4a1-554f7ebc8e96", + "MeterName": "Standard S3 (Units)", + "MeterRates": { + "0": 80.65 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Recommendations", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "baf90f4b-64ee-49aa-b386-0b712ef78234", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.156 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "22e690b0-183e-4266-bbeb-0c8ccf98f160", + "MeterName": "DWU", + "MeterRates": { + "0": 1.5121 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "b45771fd-b60a-443d-9be7-2ec851484000", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "173e1c1b-b46e-4e95-acf6-01eb80033084", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.154 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "26fb83ae-317e-49ab-8ebe-4a986e4a47eb", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "3d22f164-f13b-48c1-9c5a-e528bd62213f", + "MeterName": "Metered Data - 1 Gbps", + "MeterRates": { + "0": 436.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7d04ca17-6ace-45b2-bf21-4edf16445747", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.034 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "dea7a453-5935-40f1-886f-55f6e9966d21", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0fb61242-a7bb-47a5-916f-f4e55b1f6bf1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "84801b67-0e31-47c3-8730-7c73b304406e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.016 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0ad39c38-f2c3-43cc-a26d-d26bdd69b3e5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.156 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1039fc03-7378-4357-94c6-f83a1d9e42c7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "28bd4017-f91c-4023-a580-2279ec2b7f5a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.941 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8a89df43-bc6b-407b-beae-8fa839ce0eb8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.294 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4d6302b1-a3cd-49c7-96bb-09bc268b59ee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.759 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5884da61-d1d1-4ae7-8114-f1f86da79259", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 135.17 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d7f3e9ce-c9a8-4f35-b3b9-de8f77a1ae72", + "MeterName": "MSFT Peering Unlimited Data 200 Mbps", + "MeterRates": { + "0": 2300.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d513de91-7c61-4933-9af0-616ac638a464", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "572f570a-de2f-4407-aef6-f6c8a5e992b3", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.2875 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1859ba35-77e1-449e-b1f3-e490781d9988", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.383 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e30738b9-0928-42f5-ba74-949bcac756fd", + "MeterName": "Free Database (Hours)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MySQL Database on Azure", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "41f6335d-be86-4c70-8f05-57adc898cb24", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.337 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "3789a039-9a1e-43c7-a228-8df0e6b648d9", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e7d6c5fc-84f2-4fa0-8111-e8da312db6d7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c8f6b01f-78b9-40b0-bad8-80f0641f5a02", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "36fcf8a0-48d7-4037-99b0-9839138a1cd4", + "MeterName": "Standard C1 (Hours)", + "MeterRates": { + "0": 0.173 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1cd3b30f-7ba4-4181-bcd1-e41063749146", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6f73be4c-f475-4698-b673-80e0daf18e90", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.5625 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "30c0ff35-bdc0-4eb8-84c6-57dabf875c41", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.673 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f256212b-6c29-413d-b7e1-4d2eaf898ebe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.208 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "28bbcbe2-049c-4f6e-b5d8-f6639672fdbc", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.1045 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a8ec343f-bb99-4489-83e9-3e3e3a8212a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.56 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7fbb6997-1165-4148-b611-82e89f28a401", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c63de514-dabd-4a85-a414-2b7094627d78", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c4dacb04-bcd1-4726-8062-cb9c7ba0b4f6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.58 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6d2b483e-8fce-453c-8d9e-6ad67b93175c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "011d5795-7609-4c28-8084-cd26374a1d0e", + "MeterName": "Standard Small App Service Hours", + "MeterRates": { + "0": 0.122 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4c35e681-ab07-4484-8a18-1df63da194ab", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2c584c76-714c-490f-949d-9d85a0e0669a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.895 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5d281697-2039-4cfc-9a83-c8a67af384d3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.323 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d554ea87-a187-418f-a591-b951c5e09c04", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.016 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b6ce5147-8a54-43b2-b17f-1188cb63cf5c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.203 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6393c4ce-a679-4158-a99d-beca6a1c9776", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.32 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d6eb6e09-ee00-4672-aa66-ed1219c1113d", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "20905866-28a8-451c-836b-3b75a3f90971", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c4899873-0de9-4783-88f9-62968847f0e7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "5e539fca-af70-4f32-a45a-9a277e0a82fa", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A8 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f06a5bb7-a75c-47f0-9203-1177f5d407ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Web (6 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "db489e69-ca33-4dc8-98bf-4285b24b9ca5", + "MeterName": "Premium P1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 17.16 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c466cf23-472d-40b7-a468-e909db972adf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.857 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "be6bd2fc-0be3-4dcf-b054-a518c4c1fc82", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f3e04e3e-3793-4659-9ebc-2d95394dc1fd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c1c70ef4-920c-4f3b-b370-1c4e99767543", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.296 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f96d035-3bac-46d6-b2bc-c6daa0938536", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Red Hat Enterprise Linux (1 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0963ca7a-d6bf-405b-bbfe-bb7fc7820dd4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.42 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6fe32f7d-0f47-468a-9822-b7031a87d181", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "65249eea-64ec-45b7-b79e-e587786ead80", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.975 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "04a96859-eb95-4f16-a6fa-4b6805a709ed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.064 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "f7ff655f-c6b7-4e23-88a0-34adb1f4d72e", + "MeterName": "Basic C6 (Hours)", + "MeterRates": { + "0": 1.05 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "6f29f045-f330-49fc-bb92-aacd0186f819", + "MeterName": "Standard CDN Data Transfer - S2 (GB)", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "Zone 4", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cb2b1bb7-1ed1-421d-bb81-7f8b5e872710", + "MeterName": "Standard S4 Secondary Database Days", + "MeterRates": { + "0": 8.2155 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "11f88600-1818-4539-ada5-0bd306a13dfa", + "MeterName": "Premium CDN Data Transfer - S1 (GB)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7669960c-6891-4f31-8fa0-73ab6240b00c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "15b74273-453f-47d0-8b63-a4a7fa4e8d9c", + "MeterName": "Premium P15 Database Days", + "MeterRates": { + "0": 571.408 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "b11c3146-9d8d-42b6-ad94-1d0234bbde8a", + "MeterName": "Premium Unlimited Data - 100 Mbps", + "MeterRates": { + "0": 675.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8a481051-9bc9-486e-aeb0-8dbd0a1d89a4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.197 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "724638cb-e35a-4b8d-9ca6-6cd62c1ef85a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.624 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "309ff4b5-4810-4bca-a4e3-5767e2e344fa", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "7fadaaec-3afd-4afb-89a7-cdb1e3cb702b", + "MeterName": "Standard Large App Service Hours", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "bf5b0de6-a5f1-45d6-aaab-d4f0b74dfe77", + "MeterName": "Standard IO - Disk List Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c7e1cc89-b081-4af0-a4ad-0a24ea844b30", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.625 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4bf8a987-48e0-49b2-908e-7b0255a0e608", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5b4df5ce-0604-4779-aca3-f09e6a623526", + "MeterName": "Basic Search Hour", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "1cde2c10-a3ab-496d-b881-0fa56034bcb6", + "MeterName": "Premium Medium App Service Hours", + "MeterRates": { + "0": 0.636 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7b1da18d-2412-401f-ab90-8f92d4bd5a98", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.95 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a9f475c6-54e5-4a54-9d5e-1e538bbf0881", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f1b96c2-2fa6-4f77-91ae-a3adf5dd3cd2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard (1 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "ab1b55bd-4dcd-4c21-8648-faa589d929b2", + "MeterName": "Standard C1 (Hours)", + "MeterRates": { + "0": 0.173 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1e451c33-1810-4a8b-b78e-047341ca84bb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "129ace17-bf34-4a1c-bc64-06a68bf18247", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.17 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "678ddeab-b53d-4987-a8e2-94aa245399df", + "MeterName": "Standard S2 Overage (in 1,000s)", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Recommendations", + "MeterTags": [], + "Unit": "1,000 Transactions" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "45c7b5bb-d542-4341-84be-db69b4cda513", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.222 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0de24925-fea5-4424-af40-e91b866f974c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "6f9f59dc-58dd-4553-be88-22792ecc13ee", + "MeterName": "Bing Speech Long Form APIs (Mins)", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Content Minutes" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b4d6b97c-0802-41b0-a0a8-57a2b9bab531", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.036 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8601bc01-ce91-4283-b445-d91084bdb86f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.075 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "41e8048a-2cf8-4ae0-abe9-df16b2d8643f", + "MeterName": "Standard S1 Database Days", + "MeterRates": { + "0": 1.0645 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0a7ac46a-f068-4da0-b497-d551898515e3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.36 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "G4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "774941f3-ee15-4ce2-b8f2-fd6ed2760e14", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.88 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "ec96198d-ac23-488d-811f-47bcc1440e24", + "MeterName": "Standard CDN Data Transfer - S1 (GB)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7b88068a-a50e-4420-a661-1d0de1381069", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.646 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d86bdc3f-486d-48e2-8bb8-6d0697656ebf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.356 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "545b66e2-8d15-46b2-8bb5-0fa3bb73cee5", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0275 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "30242e11-c74f-4af3-a972-d5ba472bd1f2", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0288 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "9eef0166-d2d6-4dd8-ae46-df8691b63b64", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "RemoteApp", + "MeterId": "9a049cee-7b9c-48ff-9bea-3f7eb0f39374", + "MeterName": "Basic Overage Session Hours", + "MeterRates": { + "0": 0.175 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Named User", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "173429b7-e66b-4ccb-96c9-97a6650df06f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.611 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "11e08152-731b-4eb3-b580-680a6b6a60b8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.44 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a09d8362-a45a-40df-b4f2-fa9ecfa230f9", + "MeterName": "Premium P15 Secondary Geo Database Days", + "MeterRates": { + "0": 483.88 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "f4fdacd6-0159-4efa-9a71-5cfbcfaaefc1", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "495c9a53-cafe-4b01-b17e-d7ee2abc3379", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.101 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "817948c5-969f-4529-a58e-55ba7f06813f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.488 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a1d3d1f4-2d2d-42e0-8514-37df19cd9f8d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1b33abd0-f6e2-43dd-9810-51c0dd9df087", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.61 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "da46314c-5be6-4d7f-919e-4a33b7467c21", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "716242bb-9c68-4140-ab19-21a468ddbb74", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.038 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7f483922-d12a-4723-a457-1d93ada4da1a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.351 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6baa8ec4-a588-4e40-a516-67f6914a3a17", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.096 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "52cb44d4-f0ae-400a-9bca-1745f14f3ece", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.74 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "7214c3f4-aa3d-4ade-b075-be92533ed9a8", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "06fe658c-e98e-472e-bda4-ba962dcafbd8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.315 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "19985828-412c-4eff-8714-9c242b214dc9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.106 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "94600900-14cc-4eaa-b478-f5729db4faf2", + "MeterName": "Standard S2 Database Days", + "MeterRates": { + "0": 2.68 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eb25747d-ddd3-4a0b-aae5-52ee0deb4ccf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.115 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "4a4646f2-60c6-413e-a489-559627683c49", + "MeterName": "Premium Metered Data - 5 Gbps", + "MeterRates": { + "0": 5180.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "6ecded8f-3f77-48d7-9fbe-001df000546f", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 135.17 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b8a7cac3-260d-4a23-a913-bb0c3d010621", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Weblogic Server Enterprise (16 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "3d506f0c-344a-4e3f-a7bb-a9f5b71d2aed", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.063 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9fdf4e62-d5b3-40c4-a653-87b600555d36", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.154 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "a4d4f647-f54e-400b-a11a-dcf256afa091", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8ab06071-5c92-4d9d-a5bb-bd438c6c39f3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.894 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "afa3348f-504d-406d-8331-6bcda01a8698", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.166 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "52a3bcd4-2abc-47e5-8361-7d03b71deadc", + "MeterName": "Premium P6 Secondary Active Geo Database Days", + "MeterRates": { + "0": 150.0 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7723a342-2802-4415-b9bd-07ccd123e94e", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a5c72a95-7226-401c-bc1b-d9a50c5afb64", + "MeterName": "Premium P1 Database Days", + "MeterRates": { + "0": 16.95 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "55a41eda-5924-486f-9e9d-2f8aae4cc812", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.208 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "30106574-06d9-4c74-a112-0aed422b7133", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.95 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "85016b5d-4693-492f-b2af-cdb3a56e8a24", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "632836ce-f431-4f04-a290-4cb47f2f19e3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "65bf40a1-9471-4b05-acc3-d4aa9e419cc2", + "MeterName": "Standard S2 Database Days", + "MeterRates": { + "0": 3.025 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "552764bc-e985-44b8-a15c-82d2cf280ef1", + "MeterName": "Basic Database Days", + "MeterRates": { + "0": 0.1948 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "36a471d0-6947-4766-8fcf-bcc5bbc98076", + "MeterName": "Premium P15 Database Days", + "MeterRates": { + "0": 645.16 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5806ac75-4d74-4d81-b90f-81a434a09917", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0671 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "cdd937d6-47df-41f7-87ce-d55f7fa4a208", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3502ec6e-9d34-4770-8e20-b702ea9a59cc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a63a874c-01c4-4596-b12a-4979045f1a2e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.592 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a575220c-735c-463b-83c9-8b6c6b340691", + "MeterName": "Standard S1 Secondary Database Days", + "MeterRates": { + "0": 0.88 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3ce83be4-1d7f-4f30-afc4-b35d3797db8e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.081 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c5bea5ff-8d40-4a98-831d-7d0aefc471bb", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 23.848 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "10164352-daf6-4c7a-abf0-1e02c7f9e026", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.411 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "455f5f4b-ec0f-44e3-8108-71104622b1f0", + "MeterName": "Standard Elastic DTU Pack", + "MeterRates": { + "0": 0.091 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cc09ac2c-be1f-4e35-827a-96dcd05b90ad", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.917 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "496f6a33-2a05-4598-9b9b-3ee7ecc9b75f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "052a9e03-6b5f-452e-92f5-3eddef816ca0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "04bf956c-6f30-4b04-8b1b-8618253e7ba2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.318 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5200cf98-a3b2-4db9-b548-2282819b9f2e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.553 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A8 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7deb8496-2550-4037-842a-6481140f32ad", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 10.1568 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f30fe3a2-a2de-40a5-aec4-fe17ef06aac2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "825bdd8a-9501-4f95-ada0-0e4948420152", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.482 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "0affea74-afb7-48a1-951d-ae7e33baaf17", + "MeterName": "Inter VNET Data Transfer Out (GB)", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "Virtual Network", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "39960ae8-4e8c-4721-a256-5613bfeb209c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.264 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "84d6454d-0608-424f-aaaa-2bb3ef8c5729", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.398 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "4d555982-7f9a-4884-a128-780030263ab5", + "MeterName": "Premium CDN Data Transfer - S1 (GB)", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "612d7338-3940-442b-bcf3-97cfef3d8719", + "MeterName": "S4 (Daily Units)", + "MeterRates": { + "0": 1129.032258 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Speech Translation API", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2c92d701-9775-4be6-b5be-73f4fedb337b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.814 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8dd19c05-21f6-4a09-99ca-c82fc6faa225", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6c1463e2-dd5c-4e14-8f74-da3eac607c01", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.059 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d2da929c-6b2c-4313-8ef3-65319f885e9a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cbda89dc-3b80-4757-b045-f26f7d157342", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0ac27380-2479-4928-8cb4-26b745b00579", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.204 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "70145075-bf82-49f2-a3b5-11760c0f4bcb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.04 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "64a57c24-8cb9-4ddf-a953-c1872a37ef7c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.75 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3a59540c-88f4-4ea3-aced-5a476baa3836", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.616 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "b4db8aa1-a229-425a-b682-a7a33d9f316f", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.1287 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9092305a-5da2-49b4-8726-3230bf59487d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.536 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3a53642e-10c1-402a-a499-fede1744b5ae", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.66375 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f58bb04-d4fe-4afc-9086-97846ba0daff", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.947 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1f2df07f-6cee-41bf-bdaf-ba2e65f30f8a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.55 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f7aa4a89-a94b-4521-863e-4a328ccd4735", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "14fc9a21-4919-4cb1-b495-5666966556bc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.146 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7caeb614-05c2-4546-b069-6228f1d1b49f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.191 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "63bb6bad-6b13-4765-8960-1443f27edd99", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.192 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "becfbc59-4b04-422b-9308-0062f1e236b0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.786 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "88300ab6-0e31-45bd-af34-50fd487cb801", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "eb556891-ba58-46dc-906a-f0019d90b752", + "MeterName": "Standard S4 Secondary Database Days", + "MeterRates": { + "0": 8.0355 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "84a4ea60-17b4-4590-86d7-d89a1b92c7e8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "508aa363-1ca3-495a-a261-33cef5178438", + "MeterName": "Standard Large App Service Hours", + "MeterRates": { + "0": 0.44 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "61aa7dea-7160-43f4-a389-80f1ec35aa89", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A10 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "61be8307-999a-4933-abc3-42f3acd50dd0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.094 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ddd6acf9-0d0b-4b82-af5b-f54840a4271d", + "MeterName": "Premium Unlimited Data - 50 Mbps", + "MeterRates": { + "0": 710.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "edd7ca3e-21e6-47e4-8112-8186d3e3dc04", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.505 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "8494083f-ed4b-4903-b253-ef80454860b4", + "MeterName": "Premium Large App Service Hours", + "MeterRates": { + "0": 1.44 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b48383d6-630e-4ac5-b6dd-aed7d9b1f9bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.646 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5e1befca-128b-4ea4-9337-94c32fbf1775", + "MeterName": "Standard S3 Secondary Database Days", + "MeterRates": { + "0": 4.3548 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "03c4e3ff-4852-4eb9-bdb4-d753e579b779", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.822 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "905664b1-fb2f-4d36-9503-a3239e01c732", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "L Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c31edca2-bc00-417c-a08f-60874859075d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.505 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9487dd3a-1550-4fcd-9f9f-b458470d2dd9", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 19.71 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 5.0, + "MeterCategory": "Networking", + "MeterId": "9995d93a-7d35-4d3f-9c69-7a7fea447ef4", + "MeterName": "Data Transfer Out (GB)", + "MeterRates": { + "0": 0.087 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d32b5169-e4ab-48c1-b424-633c106d4a62", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise and Weblogic Server Enterprise (4 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1c42f6a7-82a6-470f-b205-dc61a5d667aa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.125 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "4f6d2505-e8b5-4d98-a89f-605ce3b5382d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.342 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "34c47e1d-7a41-409b-8e9c-5ff475f69b57", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.696 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ba185525-e728-4310-b40d-69ce2adb6a5d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "607fba6a-151a-4fec-b008-86475a70eed9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.917 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d310c7b1-6cf0-4dc8-8e1a-406bebc6d50b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "3107feb4-cfd2-4be9-ad64-f555a522c460", + "MeterName": "10TB Commitment Tier", + "MeterRates": { + "0": 10.33 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Store", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c4160b2c-d66b-4b5a-9b6b-0e21b7d6c90a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 10.54 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bba78a10-6f7f-4971-92f4-352e0ffb4d9c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.135 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "G3 SQL Server DW VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "9ea2b61d-0bea-4416-a533-3741a833c2ed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.875 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0e9d0c9b-ab6d-4312-9c7e-3794e22af9c4", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "de3b79d6-f52a-49e7-9fd3-4acf364484a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.372 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7399033d-a82f-4c50-af92-d369ab38e5fe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "24daa89f-2d98-4349-ba5a-8a80589eddba", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.78 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3a042e19-44c7-4943-aca4-c9c198e4cc0e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Weblogic Server Standard (2 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4ec733e8-c70b-45ec-9cba-471a9439d08b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e8572e17-4f5f-45b2-8f77-f1d0ba856790", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.365 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "179ac5fc-99bb-454f-a1f7-80eaf7259a84", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "04d45c09-006c-4222-81ef-0dfbac3f798a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.192 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "38d1a005-1f82-458c-a63b-499a01fc8fb1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1598bb07-82b6-4d80-82e4-145913675ad9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.379 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "724c09d9-8982-45d7-8141-416541713a0c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "02de2ad3-57a5-4700-87b1-29c845b1333a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.264 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "824ba5d0-a4d8-44c3-b589-01a9064f1017", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 66.56 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "1921bf17-aa45-49ee-84e8-95c6381ad0fc", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0784 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "17dc5e9c-c71e-46f8-9e9b-895adf6e779d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.322 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "06574cbd-a711-4eee-a835-2b92a501f2f1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.891 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2ce6f075-d216-4f1e-a698-d34dccf0012f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.114 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ce92577e-4209-4248-a16c-ecc92abff1d3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.77 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC24r VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "a56e7e95-3e76-4730-bbde-3bcba7f59b92", + "MeterName": "Premium Overage Data Points (1M)", + "MeterRates": { + "0": 2.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Application Insights", + "MeterTags": [], + "Unit": "1M Data Points" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d99b5c72-4cdd-4898-b093-f089c5eaed46", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.323 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b5d2552e-2184-4a9d-acbf-ecec7cb13631", + "MeterName": "Premium P11 Database Days", + "MeterRates": { + "0": 234.84 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3c6a0492-2004-4e59-9dcf-d60c681a9b60", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 10.8 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5a766580-08a5-4e24-8177-851660e45c16", + "MeterName": "Premium P18 Secondary Geo Database Days", + "MeterRates": { + "0": 374.99 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "baf8991c-b7a2-42f5-b058-5f6d3eae2652", + "MeterName": "Data Transfer In (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ff705a8d-5eb0-4327-9d2f-6df6a097dcea", + "MeterName": "Premium Unlimited Data - 200 Mbps", + "MeterRates": { + "0": 1300.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "92567832-8613-47c4-9e8a-b2b9461a4875", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8bd8c303-7ff0-429f-afc7-7baef7134cbf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.2 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7b32f9cc-adea-4a5b-9543-af9bc424db96", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.405 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "af2b2778-848c-4402-9363-e673ef62aa25", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.079 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "f3870da0-d9f7-4afc-9fc1-322ca46fb308", + "MeterName": "Standard Small App Service Hours", + "MeterRates": { + "0": 0.118 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a0288c3e-6174-4520-b867-c57df0068db9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Enterprise (upto 4c)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "42abbc74-9dcd-46f9-a9ad-6d1883adebf9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.348 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c376e76f-1886-4c5c-86ed-d70467cdfeb9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.54 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "a46b01ea-f43f-4c41-af8c-e8b0a81d05c6", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6cf115f0-8f01-4064-9c0f-e9cd8a13c210", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.238 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "aed1b84c-9d7b-4dda-8af3-41effd68944c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "d394a1c6-43bb-43e8-a5dc-9fcf98bf82c6", + "MeterName": "Standard CDN Data Transfer - S1 (GB)", + "MeterRates": { + "0": 0.087 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "2c51ccb1-5e73-40b0-b491-5917eb35413c", + "MeterName": "Premium P1 (Hours)", + "MeterRates": { + "0": 0.666 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "464fea94-ddd6-4ce7-9523-e32113a366ba", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ebf88dfe-e397-4979-82f4-34ec95b1e3ef", + "MeterName": "Standard S4 Database Days", + "MeterRates": { + "0": 9.6774 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dca9ea38-177d-42c3-8aa3-43875743b549", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.168 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f6fce07e-0b4a-42d8-af6d-169b25e2369e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "964c283a-83a3-4dd4-8baf-59511998fe8b", + "MeterName": "Storage Transactions (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f6d02be-a7f9-4918-96d1-c291793047e6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Enterprise (16 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b8b9adcd-ab9d-4a0a-af03-8c24150dd027", + "MeterName": "DWU", + "MeterRates": { + "0": 1.2097 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "02bdbbe3-fe07-46fc-a6dd-2528064f028a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.76 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7180c163-b174-4312-bafd-98af0b0f4c6b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A10 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "1ad36bbb-89d3-45fb-b158-2c63187c1514", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "fce5434d-919d-448e-9bac-334f6224da59", + "MeterName": "Premium P11 Secondary Active Geo Database Days", + "MeterRates": { + "0": 234.84 + }, + "MeterRegion": "IN South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8ff981a1-40b8-4292-aa18-c1af57836008", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.169 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "62fceb21-b01c-497e-bcdb-1e9c442c5549", + "MeterName": "Premium P2 Database Days", + "MeterRates": { + "0": 31.2 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "01fd67ab-085a-4902-a7d4-bc77a17e6f5b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard and Weblogic Server Standard (16 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1609ec1a-662e-4038-975f-33f9d3561fe9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.646 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "365445cc-94a2-4b1c-ac2e-5a1c3819d026", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.35 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A8 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "587413c5-b379-44ca-9d7f-bdf1f7761f7c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "45a39d7f-67b0-47e3-984b-31f016d17efd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "508422d7-d4c4-48bd-8299-976be7567c17", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "57d3a18f-ce3b-42c8-870d-9171cb2b3eba", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.346 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "dc466506-c5d1-4342-8fe8-e2f6dcc44963", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "12f33a96-529d-4d37-9d63-f1c3ca7b7ff8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.0024 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "4b83a4b7-cfd2-4695-9553-4613eb548028", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 73.22 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "1a32f82a-9df2-4a6c-a80a-a5c50d973e36", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.808 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "700973cb-edf8-4ff1-abc1-03a40938bf79", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.466 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f89fad18-7dc5-46aa-9f05-7167ae5b8b2b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7ccc62c9-ad67-40a8-8f53-086670077511", + "MeterName": "Standard Elastic Database Existence", + "MeterRates": { + "0": 0.0967 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b586fc31-dc5e-488e-bbc9-85c73a945eb4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.24 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e3600abc-da0a-45bb-8ae5-b101d6b29680", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.053 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "772b97d7-d0db-4c7c-ac8d-38d803b5d5cf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.322 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d5d9555e-fdc8-4f16-a51e-a9bcafc7d178", + "MeterName": "Premium P4 Secondary Active Geo Database Days", + "MeterRates": { + "0": 68.64 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "53c64fd5-9d6d-4ac8-9daa-cffaf391a88a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.079 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d3ae7dc5-be77-4daf-813c-87d7eaccb869", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.152 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d5709be3-2b12-44b9-acc7-a124a08f5291", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a0df826d-744f-4f97-9fa9-98e9f8139444", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.029 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "23dbb0e2-3f3b-48c3-85dd-d25732f5c17c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.025 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6b2631b5-c9a4-41e5-aac6-415b558555c1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.84 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2e9d1961-f4d3-4abc-ae40-9589d6160e6c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.037 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ebef8043-7ee9-4c4e-aa01-eedd271d4f8b", + "MeterName": "Inter VNET Data Transfer Out (GB)", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "Virtual Network", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "00b540ce-1a81-4462-9a6a-f76f8aaba69b", + "MeterName": "Premium Small App Service Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9546a336-9961-44f6-af0c-ea2dda4be24c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.46 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "21c04ef6-9fa3-42ad-898c-0dd240dca24c", + "MeterName": "Unlimited Data - 2 Gbps", + "MeterRates": { + "0": 17400.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8482b9d1-8fe9-4daa-9296-e5c93a9c0da6", + "MeterName": "DWU", + "MeterRates": { + "0": 1.5121 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ebd14d28-564a-49c3-b914-380d86dac592", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.402 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A10 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c7108a85-74e0-47a4-bd95-e5a65ffd3fd8", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "653c8017-f340-4c18-8b58-6a14ee202e80", + "MeterName": "Unlimited Data - 200 Mbps", + "MeterRates": { + "0": 2300.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "807a90ec-f1bc-4212-af64-76aede95a646", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A9 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "cd1bc846-87c1-4ddb-ac31-79336f425990", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.192 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "09aa689d-f5d0-42b4-9d42-699d33614d4d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.492 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2ec92c06-a8b9-4999-9dba-d6db2a71c9f9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.292 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a3d2bf71-0a63-4b93-90a3-8e2acd001363", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.601 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16m VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "145e0950-caa8-476f-a917-53c5a28d30dd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.154 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b35e4827-5326-45a4-a778-30ecc6de4394", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.568 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b321b90f-70b3-4a9a-b2cc-2190853a8894", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.52 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d5a8971b-009f-4adb-8c79-071c501c1234", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c3b5ed45-bebd-480f-b19a-6e37a0ce9e05", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 122.88 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "538e08d3-d404-4ae1-9ed7-f6349d11d4e8", + "MeterName": "Basic Medium App Service Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7bce5d0e-07d2-4c2f-bcf3-43d695673d90", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.044 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "67cce584-456c-46cd-99c1-c50ad01efbe5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e186a616-4bcf-4719-a255-bea710b8af96", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.466 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A8 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5defb250-5ee7-46d9-81ce-b45d72fe02d0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.105 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9341ff9a-3bc3-46fc-9d4b-b43bcd46e80f", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7323fb19-0bd2-43ae-832e-51704271c8b4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.111 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "6691a6aa-73bf-4d66-91fb-356bf4b894ed", + "MeterName": "Basic Medium App Service Hours", + "MeterRates": { + "0": 0.183 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "8771fb57-295b-4766-9d6f-b729c922af17", + "MeterName": "Streaming Units (Hours)", + "MeterRates": { + "0": 0.031 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Stream Analytics", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "b4c9ee83-616e-4a6e-9de2-800db3d5778a", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.143 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "964d267d-40cd-49fc-806e-5504d43e6567", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0671 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "fa17bf92-ddfb-40fe-910d-5c42e5a8ce61", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.35 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A8 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b6243603-b03b-4f0d-95cb-e511e67fd730", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.224 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "8839858f-ba33-470f-a1a4-f742bdb63342", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0304 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0cba612e-f9d6-46f5-b4ea-4f4cb0b3ef96", + "MeterName": "Standard S3 Database Days", + "MeterRates": { + "0": 5.477 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "221a60b9-c27b-4522-ab9d-1f0d9ff18faf", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "242ead45-9acf-4745-992e-6c7bc804a5e8", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "45ff39f6-c7a6-40fb-a124-cf5b280ba092", + "MeterName": "Standard IO - Block Blob Write Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "272492b3-1c92-4a5f-bee9-52a8e10ca514", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "a543af92-d76e-4d22-83fd-dd775ea4ab08", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0784 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c7e6773b-4d5f-4d63-b22b-bf7db01afcb1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.232 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "061710cf-1114-4164-8f6d-54b1b4a52eb5", + "MeterName": "DWU", + "MeterRates": { + "0": 1.5121 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bd70e961-d2be-44c8-9768-291c82c6b6d4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.208 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8a63da00-62a2-4db2-bad3-989dc1de6773", + "MeterName": "Basic Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.201 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3c948bb6-3345-49a8-9f91-88d2d63279af", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.75 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0703a687-2907-45a1-bfaf-d59c91497313", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.42 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f0876270-a519-4c34-b8d6-12cf8cb86fea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "817e731d-c1f0-454d-ae5e-c243c498d9d5", + "MeterName": "Premium P15 Secondary Geo Database Days", + "MeterRates": { + "0": 425.8144 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7fb8c093-812f-4319-afc6-2b307755e7d0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3fb8d49e-54ba-447b-a860-c03bebe5b27a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.68 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "02f4525d-e44e-433d-b8ac-bc0c4e4048fa", + "MeterName": "Free Automation Minutes", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Automation", + "MeterTags": [], + "Unit": "Minutes" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f41287d7-e9ae-458e-8701-5708529b1b25", + "MeterName": "Premium P2 Secondary Geo Database Days", + "MeterRates": { + "0": 28.125 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "5cab3a1d-f211-42ff-925b-108c935b39a5", + "MeterName": "Premium Small App Service Hours", + "MeterRates": { + "0": 0.378 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dec9098e-cece-4148-a376-166b4d0ea1bf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "98875161-56c4-400f-888c-57ea8d5c9200", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.447 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "70879643-c28c-4317-8b9f-ffacd10d6f65", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.141 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d9ba0e2a-2c8d-4191-a17f-6c3adba33b49", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 7.782 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5d54d315-63da-47e3-aaba-7c386025b2a6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.343 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16m VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fbd0e8e2-a150-43c7-b34b-2352c0daa4d2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.186 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "c9e287dc-2557-494e-9be3-40de4e85ae82", + "MeterName": "Live Channel Hours", + "MeterRates": { + "0": 0.99 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cb850c5b-e213-440b-a074-315ea34e6cb4", + "MeterName": "API Service Prediction Hours", + "MeterRates": { + "0": 0.75 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "4607eff7-1a97-4080-a705-67d0a7525864", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SLES (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "92b9e427-1ca5-4464-9dc6-85dbb7ac7e86", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8e88ecd8-08be-4a61-a58d-6740db64eb31", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.596 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9c26b409-f661-49ed-8f9a-661e56751e12", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f431c85b-7443-48a1-97d9-6932e1c050c4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.185 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b3348f9d-20e1-45e3-a20b-aab4f275505a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.528 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "5abbc7c0-6e12-4950-94ec-41f50f4544a8", + "MeterName": "MSFT Peering Unlimited Data 50 Mbps", + "MeterRates": { + "0": 300.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e71287b7-5b9e-4291-9715-7d209bdc39a7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.784 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6676f64e-ad33-4c27-b7f5-2086a3de0a28", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.418 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "d4b33bc0-adc7-46e0-9d88-6e2099604b52", + "MeterName": "Premium CDN Data Transfer - S1 (GB)", + "MeterRates": { + "0": 0.34 + }, + "MeterRegion": "Zone 5", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "50966b82-429e-4fb6-9075-8ff1908fbc71", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.159 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "463a9c40-ba9f-4cba-b238-1353af4486b7", + "MeterName": "Unlimited Data - 50 Mbps", + "MeterRates": { + "0": 872.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cc83e0ac-437b-44f9-ad5b-9982c3241899", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2696 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "8778022c-ce89-4ebf-8f3a-646bff3faf28", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "c53a5ff2-fc5a-4e37-a087-271a5ada2554", + "MeterName": "Unlimited Data - 1 Gbps", + "MeterRates": { + "0": 5700.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8ced5a85-695d-473b-b0fa-e71cfc6860da", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.43 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4e449232-725e-47c4-ab33-158751518423", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.748 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9d6eed9b-b42d-421b-974c-2802edb6db90", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.916 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "385a6b7c-bf3c-4787-a9b0-f97c0180537a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.254 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "59a70c09-d509-48e2-8789-fb410ecd9dab", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "67710900-e9c1-421e-8aa8-32de76f1b91d", + "MeterName": "Standard CDN Data Transfer - S2 (GB)", + "MeterRates": { + "0": 0.087 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "8fc68c4c-2c37-4079-8493-fea12df31298", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "82b0f0f1-bc4d-4be6-a829-2963661454af", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4fd98994-9320-40e6-9aed-303abf506bb7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.343 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9c6a0e21-61fe-42db-80be-a05863ceb840", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.178 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "58152f9a-64ae-436d-99a9-94bd9846c9e4", + "MeterName": "Standard Small Azure App Service Hours", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "41f7de4c-9efd-4b91-8538-549ee2bb4f3c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.632 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0008ac09-705a-431e-b9c7-026746cb920a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.112 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d2c80cb7-431e-4022-bd1f-3e7e8e0ffbb5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bb244f0b-a749-40ce-a97a-28ab7f4ffd03", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.509 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7701caf0-43b4-4e12-beae-b90236128c46", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0e08de02-4dcb-49ba-81b7-3456af4377cf", + "MeterName": "Premium P1 Secondary Geo Database Days", + "MeterRates": { + "0": 12.71 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "283363fa-24b6-4384-8390-81ff35d26cc2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.32 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8481cae4-6889-4bd7-8124-11a462a15a9a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.043 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "56b10f1b-64ad-4278-a67f-50e6973ca379", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "0a30477e-9b02-4768-9163-ff663b5fa669", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "M Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "18a8a0d6-1d4a-4405-b431-31e7f899fb19", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.31 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0fa5e8c0-96ef-4dff-8b02-1c99485fec2f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.513 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "620bde26-937a-411b-b835-4b2a95d735eb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.349 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f2a76ff8-c25d-4136-a931-a7071392c5c2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "08443a97-e0d0-4e23-80e9-f7fea7ea871f", + "MeterName": "Premium P15 Secondary Active Geo Database Days", + "MeterRates": { + "0": 627.264 + }, + "MeterRegion": "BR South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "777906a6-44a3-48ed-8dae-fccce59b59bc", + "MeterName": "Standard S1 Database Days", + "MeterRates": { + "0": 1.0935 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "a12520d4-4bdb-4561-9e8a-a5d9fda5b5c7", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3ea8aeb7-58ab-4ee0-a16b-69853ce7202c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.25 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Enterprise (6 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d6842e1b-34e2-409f-b6ee-0e45f7d912d0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.202 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6f07483a-ff01-40b1-baac-ce7768104392", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.968 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "65a00353-376c-49f9-920c-f36712acb3c5", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "29a89311-86f0-4cb0-8865-9eab7a989e71", + "MeterName": "Standard S2 Database Days", + "MeterRates": { + "0": 2.68 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8837935d-68e4-45b9-986e-4f737d283b6e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.742 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16mr VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-01-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "f14abb17-cb70-4fc0-8a22-a985b9c4eb8d", + "MeterName": "Enterprise Integration Pack", + "MeterRates": { + "0": 999.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Packs" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bbed5eb4-5f11-4a2a-bb02-9c3f1b2d2ac2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.44 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "6514601e-b368-455c-830a-4188486815ed", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "83bf8b50-01cc-45f5-9589-d64b0cf66317", + "MeterName": "Standard S2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 2.68 + }, + "MeterRegion": "AU East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cd779ac8-48fa-4fe5-a90c-18ad2cfe7e08", + "MeterName": "Overage Storage (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MySQL Database on Azure", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a9e2e628-8f76-4c81-8292-3b7203ca8a76", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.091 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d1e043cd-4b29-4546-b5e2-5a1ab0ba301b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.81 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Gen 4 Compute (24 cores)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "63749803-1cbe-4c1c-babe-31f9685822c1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.798 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e4ad1fd5-6d02-4120-995e-54f773cff8f8", + "MeterName": "Standard Elastic Database Existence", + "MeterRates": { + "0": 0.049 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8776da1f-f73e-4c5d-a766-8ccbc365330f", + "MeterName": "Standard S3 Secondary Database Days", + "MeterRates": { + "0": 3.7742 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "33aed8dc-e2e7-4bdd-bc22-ac8a21bb9950", + "MeterName": "Basic C4 (Hours)", + "MeterRates": { + "0": 0.263 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f5fbff1d-6ffa-4130-8638-a2636acfdfd4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.098 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e698786f-a423-49c0-8e60-6756a19d2527", + "MeterName": "500-AU-hours Commitment Tier", + "MeterRates": { + "0": 14.52 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Analytics", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "818ff3c6-6655-4180-8da7-c0c79aa00c79", + "MeterName": "Standard Elastic Database Existence", + "MeterRates": { + "0": 0.0445 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "15bbf8a2-3ed0-49e2-8e09-65063d9ed14e", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "M Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d619a803-dff1-4e17-917d-f2e68137356e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.633 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5114dbae-3c14-4b73-8b6b-2633ea0bc343", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a373e2eb-e1f9-4f93-895b-e31d547ff8ed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.281 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2d222980-4bc4-437f-9cc4-f66891810cc9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "24c6cbe2-7202-4167-b882-ad2c400eb399", + "MeterName": "Premium P2 Database Days", + "MeterRates": { + "0": 37.5 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "458fb98f-9987-417f-8c95-5ffe6101c0ad", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0238 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6c56768f-ee88-4b44-b40e-6c97f9982260", + "MeterName": "Standard S1 Database Days", + "MeterRates": { + "0": 1.171 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b7635939-ec60-4bf1-89d1-e0a0c9a119e8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.52 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ceb8e318-0ef5-4b92-9431-ab5f48363646", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.163 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9a8fcc65-d42a-4a8b-b6e7-13c88cc80344", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.064 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7f017af4-4d79-4351-8168-e388096a7d13", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bfa84f91-4d88-4ca7-bb5e-56eaf7035f66", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.46 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8cc7429a-3b60-4cee-af6f-6f0823aa739b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.093 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e52330dc-6af8-4607-a779-fedaa080032b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.946 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ea9d7922-1bb3-4aaf-912b-a28fd2ae328d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.43 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "95ac54ed-4c19-4d0d-8922-48de0ac92a9d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise (2 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ece75ef1-5152-4df5-90c7-1b0b574c560a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.218 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "68688293-afb1-4e64-9d81-c178af2d3556", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard (2 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "cb5e3343-3f87-467c-abff-eaffe4aeac70", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.766 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "561564c7-48fd-4fa5-b25f-d61a4131fbac", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3fd455c8-e35b-4a2c-95a1-a0afd782a77c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.662 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bd21e1fe-b418-4295-bae6-df0c773237c0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.966 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eb7f2382-4eb3-4711-9e5f-7f29f9174187", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.88 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Standard (24 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "55382455-ba6b-4f92-9c65-92b9194f3ef3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "14e83449-bb46-45f0-b4d9-644fdd5575dc", + "MeterName": "Metered Data - 500 Mbps", + "MeterRates": { + "0": 290.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ad86bfd6-3f66-4201-b0c5-9ffc077af445", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.596 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9b1fb262-0ef5-4fda-9f72-77d8858f6ab8", + "MeterName": "Standard S3 Secondary Active Geo Database Days", + "MeterRates": { + "0": 5.3569 + }, + "MeterRegion": "AU East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "eed642ff-ddaf-49f6-9b8e-d734308a77fb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.644 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b17ee794-9c81-499f-9a76-789152fa3f39", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.149 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "daf52501-330a-4a7a-a88a-cf85ed40988f", + "MeterName": "Users", + "MeterRates": { + "0": 6.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Team Services", + "MeterTags": [], + "Unit": "Users" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "02362ee4-a7d1-41af-8ddd-c72d8791a67e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.169 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9abab23a-5b84-4beb-8cae-cd1d782da641", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.191 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "fd2bf4f6-fc0e-4083-8ddf-e0227ce8adf5", + "MeterName": "Standard S3 Secondary Active Geo Database Days", + "MeterRates": { + "0": 5.3569 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8ea2c421-4813-433a-926f-b9ead5f8b54a", + "MeterName": "Premium P15 Database Days", + "MeterRates": { + "0": 590.4457 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "c7a0c9f2-b08a-4f54-955f-c2ba8c7b0837", + "MeterName": "DNS Queries (1M)", + "MeterRates": { + "0": 0.54 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Traffic Manager", + "MeterTags": [], + "Unit": "1M Queries" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3e8f4449-337c-4aaf-b574-1ff7d82edcf4", + "MeterName": "Standard S4 Database Days", + "MeterRates": { + "0": 10.7139 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "92e2eef3-ee88-40ff-a961-29de352857ba", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.505 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2c2188b1-f379-45b9-9e9c-5cbc0e564f58", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.69 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "f86ca981-9678-4601-9a36-608519eab106", + "MeterName": "Premium P3 (Hours)", + "MeterRates": { + "0": 2.885 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0f190e0f-7121-49ca-b4e0-5198dbc6bb20", + "MeterName": "Standard Managed Disk/S20 (Units)", + "MeterRates": { + "0": 11.968 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a9be7552-6ff5-4957-a4eb-c9b0fbcedd41", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "63efeb72-d133-4dbb-b245-03920d0cdf38", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.482 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "b9ec9d15-e4b3-4e4b-9403-54a13394c367", + "MeterName": "Premium P1 (Hours)", + "MeterRates": { + "0": 0.666 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "aaacf121-9c4c-4d64-a8c9-a9b4a71f650f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.62 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b0ea14fc-7462-48d3-9a69-00d612e14c3c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9d9cbb89-b1a5-41d8-b998-72c750a05de8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.342 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7558d537-4fbd-40e6-ad58-dea0dc0fd45a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4bd1a54c-a1ad-4de1-a5f6-7f700f6d04fa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.3 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Enterprise (12 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "08f25d5b-967e-4c02-b178-b82e98612470", + "MeterName": "Premium P15 Secondary Active Geo Database Days", + "MeterRates": { + "0": 619.3536 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "33be92a3-8f1d-4078-a0a9-d4691e6d3da6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 11.59 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "12699064-6912-437d-8cf7-9a50364cfb1d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Enterprise (up to 4c)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "c26b4887-a3ec-4ae1-a449-881e0ba32bab", + "MeterName": "Data Transfer Out - to China (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "35f3c7e7-10ab-49db-ac73-44d936470ca5", + "MeterName": "Standard S2 Database Days", + "MeterRates": { + "0": 3.025 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "47cee240-ba75-4389-958d-3db0c26d202e", + "MeterName": "Standard S4 (Units)", + "MeterRates": { + "0": 80.65 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Analytics", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "86dc9c21-8721-4084-9586-2953507e3fd5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "2073b0aa-c836-4642-9d97-0635f52e3520", + "MeterName": "Free Data Analyzed (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Log Analytics", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "707e2bd6-063a-4ba7-a245-d25ac9935c3d", + "MeterName": "Inactive Pipelines", + "MeterRates": { + "0": 0.8 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Factory", + "MeterTags": [], + "Unit": "Pipelines" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "773b6822-15e5-4cd1-bd56-205319f97a76", + "MeterName": "Unlimited Data - 5 Gbps", + "MeterRates": { + "0": 41000.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "afb5c1d0-10c6-4580-a6a3-5da2b7cf41d8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.192 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6881ea97-3bc8-435d-8e4a-d798ed9374f6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.42 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c5e3505f-1cc6-4253-a275-ad5a2a6a2264", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.797 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "aa7039ea-f973-4adf-a642-898fb6fcf81a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.402 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "33d27e51-c8d9-4f82-b897-5cfa23d6923e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.897 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "178c6e36-9b57-4074-88ee-be5d47816f0d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 8.14 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "c46eb634-c020-454e-9073-b381ecc04d02", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b625b9bc-3082-465b-bc81-25fd89cd24f8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.698 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2073dab8-6491-429a-bb8b-32fd566c0b4a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.776 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Automation and Control", + "MeterId": "ffb38d30-ebbb-4d2d-bfc0-adeb056db796", + "MeterName": "Included per Node (Minute)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "OMS Automation and Control", + "MeterTags": [], + "Unit": "1 Minute" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "27485d03-df4e-42b8-9651-c0a0b436cc19", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "96328029-e3da-49d7-bba1-48ef64f13ff1", + "MeterName": "Standard S2 Overage API Transactions (in 1,000s)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "1,000s" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cfa45c60-93c6-468d-944e-b5b633191c77", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.292 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "19779bfa-01e0-4e38-9ea2-6a697d78434f", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "b6207704-0157-45cb-a101-e4ce9dc22442", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.0047 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10K Operations" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "309f895a-26d2-46c8-a46b-c2e9db459ece", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "945b8bdc-4942-45f4-bb2d-65b849304aff", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "99c83182-0ebc-4eba-99a6-80e0c0fa572b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.622 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8c2fa0c0-5c8d-477f-9e8b-7fc0c88fe974", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bdf5b6e5-6d0d-4b87-b82f-2ebd3a1beeaf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.549 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e129d70a-be93-44d0-a4e7-b5e157f2e429", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.104 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4afcdfe0-4c53-47ed-b966-815b7e8f0e3e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.86 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "29cec9c7-cbe1-4b5d-ae75-d5ee7b2f4061", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "aa21c415-c101-4554-8919-e309853e9f1e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.336 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5dd7adaf-6c8a-4f08-99aa-09a13cb20fa0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "390ffa62-8fef-426d-9812-bb515d27934a", + "MeterName": "Premium P2 Secondary Geo Database Days", + "MeterRates": { + "0": 28.125 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cdce56fa-76eb-43c2-b613-160095b4aa13", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.112 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1bb2f28b-9b13-4a5f-85d6-cf6211c8c668", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5c54154b-efc5-44d3-b55c-51cd4b08d710", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.225 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "96967cf3-a8ae-4189-9e81-8cc329c9b704", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cea84742-b76f-47e8-b854-02aa86fc275f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.789 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "cc7a7284-897d-49e3-b737-af53983ebadc", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "05649c84-73d2-440e-8cf9-6b13639bd019", + "MeterName": "Basic Emotion APIs (in 1,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f9c724c0-117a-4574-94c2-57d410deb181", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MSFT R Server for Linux (up to 4 c)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "83acc60c-599a-4df3-af7e-53a2c9af9073", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.345 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "40bf9efc-dc8d-4f11-8afb-3e37b45bd581", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "564ac91a-61ac-4f2a-a530-35612b37ced2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2054a513-86e0-4ff2-869e-58747bc5180b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0f4978b4-2620-4624-9793-b39e97e6777a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4c94eb30-7c88-40d4-b439-9f1afd8a8a27", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7a772e60-7449-4b3b-ba34-db60e8316a0e", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0028 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2aec6f70-b1fe-42a6-8142-b879c955603d", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ab7b25a5-88da-40f8-9634-3a2b2bddecd9", + "MeterName": "Standard S2 Search Hour", + "MeterRates": { + "0": 1.597 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "55a35243-c285-43ed-801e-2c9b7becb616", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.52 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "b79e0928-54a8-4744-91c1-4ede04bcbfc4", + "MeterName": "Premium P3 (Hours)", + "MeterRates": { + "0": 2.774 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d7ebd709-2374-4152-8839-6c39d70e74c2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.82 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "16b1d653-1719-4f3f-8a23-4d232a4b8cf7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "9cc63cf8-6593-410a-b0e7-26a4ef71e8b3", + "MeterName": "Standard IO - Disk Delete Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "647d3d48-03b8-4942-98da-5cac31483ae5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.95 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "b1b1c400-243d-4449-a1d1-db76519eb2ab", + "MeterName": "Standard S2 (Units)", + "MeterRates": { + "0": 16.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Analytics", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "002b5895-34c1-47ee-9828-b8a8312de15b", + "MeterName": "MSFT Peering Unlimited Data 10 Gbps", + "MeterRates": { + "0": 82000.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "65bed0bc-772d-4674-8c59-fb2408c05d22", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.191 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7f4afbf4-59ed-43d3-9884-9b4f5893ae76", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.008 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2032cff5-03dd-4363-9ff5-a149d59bed3a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.82 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "635ebce7-ba7e-489d-97f3-3b555b75e0d6", + "MeterName": "Shared App Service Hours", + "MeterRates": { + "0": 0.0163 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "316feed9-2528-478b-bc4b-0383bb429422", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.222 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "6d631ddb-1e2a-43fb-b466-7f7d70f7e532", + "MeterName": "Premium Large App Service Hours", + "MeterRates": { + "0": 1.5 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "46a4598f-bd08-4614-b2a3-75b147499c7d", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.034 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Analysis Services", + "MeterId": "fa22ebb4-a4dd-4407-a476-8ba85b72688f", + "MeterName": "Standard S1 (Hours)", + "MeterRates": { + "0": 1.015 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Tabular", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "85a398f0-b6ad-4d2d-bb05-1d95337a5255", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.52 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9247b5d2-8660-4d3d-adbf-084b329effec", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.232 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2f7e6be6-c801-4b28-bfbf-148f7a61bffc", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 76.54 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2013-12-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "a6eebb9d-d376-4864-9abb-023b81026acc", + "MeterName": "S3 Media Reserved Units", + "MeterRates": { + "0": 399.0 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a646be2d-e3ec-460e-895b-3ab467bff38d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a4103861-18b7-4eab-b66f-d39c911743ad", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.255 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "14bd8294-0eb7-4eba-a383-39bf8d000caa", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1fd0df97-f57c-458c-8fb6-59a425b8c615", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.261 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d6775764-05f3-4ab6-9424-088f1934cda3", + "MeterName": "Unlimited Data - 200 Mbps", + "MeterRates": { + "0": 1150.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d138e4f8-ef93-4387-af83-8296a1f4a226", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cae64797-9ecf-4906-b517-6238c80c045f", + "MeterName": "Basic Database Days", + "MeterRates": { + "0": 0.161 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9772b374-943a-476c-8039-ca451f1cfae1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.185 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "G4 SQL Server DW VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "43636e6b-432f-4fa6-81c2-570325eceaf2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ae650aa5-7740-4159-a443-e1f33349d3ea", + "MeterName": "Premium P15 Secondary Geo Database Days", + "MeterRates": { + "0": 438.176 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a4b8ea37-87dc-45c2-9fc2-b7e56dc8239d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5e4f7678-cdd0-4ddc-b367-0db324fe2688", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0138eeb5-295f-4de2-972b-439f08dcf964", + "MeterName": "Throughput Unit Hours", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Store", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "59f4215a-8925-4ae2-b8ff-3633b818cc35", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9e05d9c8-8936-48ef-b98e-f019e9d64978", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0671 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2168d000-4a4f-4479-8a88-3a832e658ec5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.308 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b86e86ea-ec87-4ae8-9022-17c5825fcb09", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.498 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "62472b82-91e2-47c0-9650-9835b5259fe3", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "405cd96b-f74e-4089-b564-1bacf8867e4d", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.656 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A7 OpenLogic", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d0ab06d5-71d6-4b8b-8507-41b72af59f4b", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "5eb93b2d-565b-4a8d-adfe-a9af9e0d6ade", + "MeterName": "Unit Hours", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Analytics", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "303e8e3b-649f-42f5-ad47-44bf47e4da1e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.54 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "bbdcc7cb-8933-4655-8111-a0f519b6c717", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.161 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "13b6f9ac-0250-4024-9b45-dff0ac955e0c", + "MeterName": "Data Movement On Premises", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Factory", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 10.0, + "MeterCategory": "Notification Hubs", + "MeterId": "5d392d84-c8d6-45d4-a758-790ed34f49c7", + "MeterName": "Pushes (in 1,000,000s)", + "MeterRates": { + "0": 10.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard Notification Hubs", + "MeterTags": [], + "Unit": "1,000,000s" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a55dee14-c633-4b4b-b2e0-51182b7720a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8fc8af7f-3909-4aae-9682-43f76a019101", + "MeterName": "Standard S3 Database Days", + "MeterRates": { + "0": 5.3569 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "951409c3-50d2-4a9d-aeb2-eca9b89e8e5b", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d9b4e644-fd53-4132-9563-64c07b5e4f4e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cc3b405f-1778-49f9-86c9-54779c8cd45b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.36 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "45d50770-f8f9-4225-a392-5c675296e095", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "100e40ce-2ab9-47e6-bf59-500d17602826", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "393252bb-c4a3-46e2-b7b1-ddd53e4af57a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.087 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1e8f6d9f-8b40-4c97-80cc-cff87a290a93", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.674 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4f2b28da-0425-47eb-9b14-7c121ad16b6c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c5d206b6-b977-438a-a4f7-6ae12482323b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.349 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cee722d6-ac16-4ec7-8810-1a5f715d08e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.624 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e2c5e3dc-180e-42fe-aea0-7949eb0f40c6", + "MeterName": "Basic Elastic DTU Pack", + "MeterRates": { + "0": 0.1108 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8920a12c-c242-4fec-93c9-97ffd4797e96", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.064 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2202b900-92d8-4d6d-bbef-1f2118894b06", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.615 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9d1d6262-6d0d-4b4f-bfeb-54d80e611efb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.24 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d25fc970-d2ca-403f-9d42-1a6ebf8f3d94", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.22 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "04234260-6e2d-41ca-a84e-d177d2e6d026", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.036 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Zone Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "bedf6c71-d8d8-4564-a569-4f68fdfc5477", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "0b33c255-383a-4fe3-b42f-f20672895345", + "MeterName": "Shared App Service Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5965f6d3-2ac7-499e-9498-744177a02998", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.147 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1a8ebeb4-98d1-4568-833e-6924033ec224", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0475 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "5717909a-0a40-49d5-8459-9d9dce6353d7", + "MeterName": "Private Agents - Azure", + "MeterRates": { + "0": 10.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Build and Deployment", + "MeterTags": [], + "Unit": "Agents" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "b2756b34-6dfe-4952-9ed8-24de5d06e8eb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "faaaf232-94e4-4068-ae01-b854c46b94c2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.793 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "6368dbf8-dafb-46df-948a-58c3df992ba1", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5dae9203-a8b1-455e-b81d-9f3cbbb091e7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "49a3e78b-fa72-4d46-beeb-3bb9032ea524", + "MeterName": "Premium Unlimited Data - 500 Mbps", + "MeterRates": { + "0": 3150.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ce369276-0a11-4712-b1ec-28d9eaa07515", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.43 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6182e588-176b-433d-a131-b13820c7ee26", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "73c297a4-0244-4e14-9097-3986331ab667", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.191 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3c7d0253-8add-4d1c-93bb-3a64165d2468", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.444 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e4768566-1551-4e61-ae41-3ea37746eb1a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.336 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8690a7d9-dc11-42c9-b9fe-4de90efdf6d4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.814 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6efd0914-c5c7-4c12-935b-a1b1d1858478", + "MeterName": "Standard S1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 1.171 + }, + "MeterRegion": "BR South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "5b0fc766-2ba8-4947-8d27-5f2988a24ef1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.64 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A10 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "cb78426a-53d6-4033-b6f6-c59a04c66903", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "XS OpenLogic", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "db82e20c-830a-44d4-a1e4-c86a54b75b89", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A6 OpenLogic", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "4ceae6f9-ec3f-46ed-8587-f27a65eb9edf", + "MeterName": "Standard CDN Data Transfer - S1 (GB)", + "MeterRates": { + "0": 0.138 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9425e4b3-8cfe-4fec-8193-a8b4cf706bfd", + "MeterName": "Premium P11 Secondary Geo Database Days", + "MeterRates": { + "0": 191.7 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "14f8a4b5-8926-48b2-9972-78feab72c978", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.125 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c9c9186d-b393-406f-a14f-fe04641eed01", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.853 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "145a6173-898f-4b98-be19-51f693f0c15b", + "MeterName": "Premium Elastic Database Existence", + "MeterRates": { + "0": 0.2016 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "4e38119e-b416-4bc5-992c-95120a689104", + "MeterName": "Standard C4 (Hours)", + "MeterRates": { + "0": 0.525 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "fa3849ff-c59b-4098-83ce-19d2b7951cbe", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "e1517b3a-f462-4937-87b7-2ee7f7cc143b", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "0bc4d87d-34ce-48dd-befd-78e789a154e7", + "MeterName": "Premium P4 (Hours)", + "MeterRates": { + "0": 5.328 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7ec34f4c-ee1e-4395-9090-ff818baadf30", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b76ab750-b3ae-48c0-91cf-b1253df59c40", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.232 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "365c9dda-c9f6-4213-b87b-0cfa21158af9", + "MeterName": "Metered Data - 100 Mbps", + "MeterRates": { + "0": 110.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cfc25816-35ce-411e-9b62-a181b3f84653", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.444 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "68c289e1-85e6-462a-bd59-aa359fe314f8", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "f3ffc04c-ba8d-45d0-aaf1-6baab8669279", + "MeterName": "Metered Data - 200 Mbps", + "MeterRates": { + "0": 145.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5c94fa93-eb86-4951-a960-6525398ba98c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "19c6b5e3-4162-4be1-9911-fba6f27991c8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "531ba0bc-b317-4b20-ad74-a86f323cf8d2", + "MeterName": "Premium P4 (Hours)", + "MeterRates": { + "0": 5.55 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a103733a-0fc9-4c8c-b49c-5024f2441d8e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.75 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cd40e526-ccd9-4ec5-a96c-7995b77b21c4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.366 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5f23989a-ceff-45f6-9fb3-d8e306cf531d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "bf8870a0-ab78-4b28-be9e-cb142df24f44", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 88.594 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c721b73c-fdba-4dac-8b07-b3f47cdd7a09", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.371 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "dd5fcf13-7031-48b0-b736-8ca7da3a6a92", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "24d04c62-6a53-4da1-ac64-8d71a4a8b8f8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.464 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d5a81ebd-6435-4b0f-9ab1-6c0d0dd6eed0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "fcd9fc54-3503-49f1-b40c-d3f8587badc3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.665 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "878bced4-6856-46c1-a3df-15641b31057a", + "MeterName": "SNI SSL", + "MeterRates": { + "0": 9.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Sites" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2d6af38f-0f68-4004-9014-1e3213172915", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "476d2ca6-250d-43bd-81df-d0c8776dc343", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.299 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16mr VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "32a184d1-b0fa-4e6f-bcf5-273e806c298a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.34 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "G2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b6d46ef1-b7ec-4c83-bcdc-cc80c3770aa3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.537 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "505283ff-c0ef-44f1-b16e-6d826d8a9e0e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.064 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bcf06b41-75d0-4c10-8dee-c8eca7a99e8f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.54 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16r VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b07baa29-b855-414a-8532-fc85e9cf5e80", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.616 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0d21c63f-67c2-4e58-a68b-3157271b7e1a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.84 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7a0e53d7-8d30-4b3d-b9c3-5369543d7367", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.88 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "7245f503-495e-4e21-9009-901f562bd21b", + "MeterName": "S1 (Units)", + "MeterRates": { + "0": 80.0 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "708bb9ce-e2d0-4851-91e7-956fea11381a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.357 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2a42f457-d6a6-4418-b986-364b6641ef3b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4f662f3d-3e36-469b-9b05-d58edb773d6a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "94819513-7e2a-4a19-af01-ca7af9ea11cf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.097 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6fea4f21-ab0f-4fcd-a1c6-30498bc6f3c4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.677 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4c35170a-4731-4072-841d-c20793007168", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "4ce4e22f-fab9-44e3-8373-4aec088195fc", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.1252 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c95d3e05-b0cb-4ff7-bf07-57f89f9331ee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.467 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e5134ccb-47b0-470a-9267-bbd4333e68c2", + "MeterName": "Standard S4 Secondary Database Days", + "MeterRates": { + "0": 8.2155 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "953fe2ae-f932-4f3d-b34d-b5d1f950fa25", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "fc9243a0-f593-4d7d-877c-7fec64b647ce", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.032 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "79fe2eab-cd87-43bb-9e51-3e30e40c8f6e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "48310a23-bc87-46c0-af2d-30bb7c6cb293", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.354 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c5ace7f6-f89d-4975-897c-f105a92c54db", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.85 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7fadae88-cf47-4565-ad69-1e923511d070", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.594 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f69b71b2-4d12-406d-82f7-11903f972e6c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.473 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ab6bc6cf-8911-4155-b4ef-f218adbf7dc3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.292 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d4337f7a-5463-42e8-b28f-5da34915a48c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "908741b0-34e3-4946-bdd5-8b36a5ae278a", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8d0901c1-87c3-43ab-80af-bdbaedd77838", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f6aeea19-4ead-4a3d-b3a8-030aca2f65de", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.584 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e91c1a32-29da-4b4c-969e-3fa3ec93d86e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.059 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c1635534-1c1d-4fc4-b090-88fc2672ef87", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "eec9ca61-da82-4336-a1de-a0684da9ccbd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.567 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "39706f5b-224c-4dda-a804-fa6e733b15b6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.662 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b91d1bf5-26bd-405c-abcb-639780bf1b0f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.357 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "831bc3d3-78d6-4713-8262-4415317dfb43", + "MeterName": "DWU", + "MeterRates": { + "0": 1.6936 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4063a9cc-77ed-4ffe-ac92-a4b6178dca3a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.39 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d79fa9df-f2bf-48f9-90ef-9e04a442cff7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "02b4d5e6-b772-4bd3-964b-7f5798fa9628", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.373 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "2c23b2c1-8094-4a07-a7d2-39ad6204e792", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "45259a84-3419-4d3b-835e-78e1ecfebaf6", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5745cdaf-9afb-4771-ab1e-ac407b7c9777", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.252 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "b38a9048-adc6-4b0e-b3a1-a05737d2f34e", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SLES (20 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bda9aae0-a721-4e5e-879d-c52beb0cfd52", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.366 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "32c5021d-a34c-4bcb-b993-9b822e17ced9", + "MeterName": "Basic Small App Service Hours", + "MeterRates": { + "0": 0.083 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-01-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "103e4fe8-3efe-4046-b713-13bad55a29bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM Low Priority (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dbc2f35e-e9fb-4e31-88ef-04863e7a34c4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "382fd7ca-1517-4bc7-b22e-bf01be17eecc", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "b9c339dd-811b-4960-8f8e-ab67c0a3a14c", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.084 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ea0c73f1-eb11-4ebe-865f-e0197987b8ec", + "MeterName": "Standard S1 Search Hour", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "daa010ef-6dfd-4e1f-b6b1-145d71268c5d", + "MeterName": "MSFT Peering Unlimited Data 5 Gbps", + "MeterRates": { + "0": 41000.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c3d11efb-d78a-453d-bd69-1e2811aa5edf", + "MeterName": "Premium P4 Database Days", + "MeterRates": { + "0": 66.0 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0c6206c1-0315-42b5-9dfe-5a97cc653f9a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e3f81bab-5147-49fc-a7e5-f61f069bfc33", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.583 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a3be2846-7569-4352-95d9-38c7a14bed05", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.349 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "db2ae25a-4469-4fa3-9c27-63ac21da6b30", + "MeterName": "Premium Small App Service Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "19018383-8b5b-45cf-8bca-d4146b124786", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A5 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "56a12414-9659-4186-bf38-02cdfdf4dc63", + "MeterName": "Unlimited Data - 100 Mbps", + "MeterRates": { + "0": 1230.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a178a1c1-7245-4296-abc5-4adc4e09528f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.308 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "a5afd00d-d3ef-4bcd-8b42-f158b2799782", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SLES (12 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3d292628-2790-481e-9435-cf62ff10331d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "fa6ff965-8782-439d-920b-81bd3fb7c877", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6b355dbb-33b9-402e-bd6c-e54c14684fe9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.642 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "72cbc933-fe63-4de0-a60d-f37c66dc7d4f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.611 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6acd3da4-3a69-44b4-90b1-cbded1f3729a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ee58c1ec-2358-4208-bd89-842083fa832b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.31152 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "658e7924-b9c8-48dd-bf72-ee7fa989dec3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.185 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "daa2596f-4d24-47e4-a7c2-d5ab5128b17b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.68 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6ec21e9f-fc68-4f94-a02e-a6f5c66bb50e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.781 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2b5a7bf3-e866-4eae-8a5b-4cafec12a59f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.65 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3a55145e-62f0-4bb4-8159-e41443f56b9c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.08 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "b076df03-5463-45f2-a4ed-179377663e5f", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0756 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "837830bd-b8f1-454d-a085-c5c6bdcc4bf9", + "MeterName": "Premium P11 Secondary Active Geo Database Days", + "MeterRates": { + "0": 282.263 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "412d6928-652a-44ec-8bbb-d1dea652b7a6", + "MeterName": "Standard S1 Search Hour", + "MeterRates": { + "0": 0.336 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d8617238-d7b7-4eb3-ab46-8ea14cf88c6b", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.1136 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "0aa0e0e9-3f58-4dcf-9bb0-9db7ae1d5954", + "MeterName": "Multi-step Web Test", + "MeterRates": { + "0": 10.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Application Insights", + "MeterTags": [], + "Unit": "1 Test" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4fae75c3-3a6a-4803-bf68-84315c2222fd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.481 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "de906888-5097-4b18-80e0-56d8aba038b1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.584 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4c3ddd68-400d-4f2a-94be-b62aa44091cc", + "MeterName": "Premium P1 Database Days", + "MeterRates": { + "0": 16.5 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "b6e36faf-e19d-44e5-81ca-3d0d6e81d653", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.309 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e35b8f7f-eaa2-42b1-be4b-e54f41ddfb14", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Enterprise (12 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "23c97f6a-0554-42d1-a754-02618756c9ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.589 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e4b34039-5e6d-4be8-ae2e-4a63cd935af8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.664 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2f448a94-8147-4294-881b-84d616ba6119", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.159 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "1937c943-e424-4b28-a84e-4e8f916a0ec5", + "MeterName": "Metered Data - 100 Mbps", + "MeterRates": { + "0": 100.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "62577447-ac4f-4f37-a303-cfae8be6aa5d", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c12cae93-ac6a-4295-8c74-88f4342b8e6b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "4a7c53f0-7521-4f5b-9fe8-7d37ca58835c", + "MeterName": "Premium Medium App Service Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e4da13cd-e9ec-4e45-9518-1d2bd04ddac2", + "MeterName": "Premium P2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 37.5 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3da168a6-d35d-46c1-8eb6-0ba6c4affec9", + "MeterName": "Premium P11 Secondary Active Geo Database Days", + "MeterRates": { + "0": 270.97 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "babfda65-9bc3-4415-8223-16d4ce761328", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.129 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "817457f7-0ab7-445b-ad6a-9d682b457ade", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A8 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "45bb30fc-e60f-4d61-8a92-f30c26fb633e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.61 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a6f4e40d-4dc4-4415-a93c-9dfcf913f7ed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.34 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b194ea06-90ab-4406-aa81-293cbfe2aece", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.214 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "f5fdbf6d-ce2d-4026-97cc-250e1b3d3460", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2a429862-8f20-4e1b-befe-152aee05d626", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.282 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5b4c9731-0db5-421e-b5f4-fc82d81c4290", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.177 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e6ea4199-b8f8-43a0-8328-b7501db904cd", + "MeterName": "Standard S3 Database Days", + "MeterRates": { + "0": 5.5354 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "237deb5e-619a-45b6-af87-1a12990dccb1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.375 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "0fce87c2-1eb6-4f6c-90bf-60aa0e40576b", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0486f41c-e942-40ab-940b-07b059d312ed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.191 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "f822b803-6235-451c-9c89-28b2247b0dac", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "S Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "3e74682b-d8d1-4e69-9077-79fefb279365", + "MeterName": "S3 Overage (Hours)", + "MeterRates": { + "0": 7.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Speech Translation API", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "967317b3-e56a-43e8-a6c0-94e9cc3132fc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "154d76a9-c8cc-466e-b8a1-4bfb0a7b0cb2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.288 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f5be9354-8006-4643-bb6c-6ab91b182043", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.698 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "68e4f398-381b-4fd1-a77f-02d238d1c8e4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.999 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a81c334b-927e-479e-acec-71b1987439e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.056 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "579ee866-7f95-4e13-8cd0-333e83e78fdb", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "ec5cddbb-fbb1-4baa-8219-f19ef8cf7786", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "99ce0a26-4339-426b-9f80-10d697f0f191", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "66eb8ea0-fcad-4c64-8a00-2d82e130562a", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f5e981aa-4b62-4c26-8d7a-7eccb04546bb", + "MeterName": "Monthly Fee", + "MeterRates": { + "0": 9.99 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "Seats" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "2a87c94a-471c-46e5-931a-f7310f143322", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "a7dacaba-81f7-4e7a-a54d-71424e600227", + "MeterName": "Basic C4 (Hours)", + "MeterRates": { + "0": 0.263 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "048f06b9-9d71-4d2b-940e-bd4b32d55d0b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.704 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "046e62a7-0e90-4564-b269-0b993ec6226f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.025 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3ffa649c-d4c4-4686-abf2-30b4b965eaf9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.248 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "1c851764-16fd-4a27-b542-5f6bc931fae9", + "MeterName": "Standard S4 (Units)", + "MeterRates": { + "0": 161.29 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Recommendations", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "61448f94-e6e2-4acf-a179-0a37484c599a", + "MeterName": "Premium P15 Secondary Geo Database Days", + "MeterRates": { + "0": 464.5248 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "efb98702-34fc-4acb-80bd-dce84208c00f", + "MeterName": "Basic Small Azure App Service Hours", + "MeterRates": { + "0": 0.083 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8595db1e-afcb-4ac6-8175-166dcd17f5fc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.786 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a438d19c-6aab-4fc0-b0d1-35b49a12317e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.342 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "76bbe46a-19f4-4c9f-bf3b-dc6618416b65", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.204 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1092c5f4-51bc-49be-9773-34cc253c6f1d", + "MeterName": "Premium Storage - Page Blob/P6 (Units)", + "MeterRates": { + "0": 11.1361 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c3601923-b8db-4243-9600-5a746d39961d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "81c518cc-715a-4867-942f-2f0453f26045", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.836 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "131b3a0e-fd33-4213-94dd-1d1171ce4385", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.752 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16r Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b1979b96-5a24-46e7-9c60-d78cf81beee5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.975 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "84c854ea-5a9a-4af1-965d-ed87d16eda92", + "MeterName": "Standard S1 Secondary Database Days", + "MeterRates": { + "0": 0.8 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Security Center", + "MeterId": "dcd983ef-db32-4340-bf23-13f7e9f5f48a", + "MeterName": "Standard Nodes", + "MeterRates": { + "0": 15.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Nodes" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "e43ed5d2-fb13-41f7-90e0-668e105987b1", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "XL Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 10.0, + "MeterCategory": "Notification Hubs", + "MeterId": "2be0cde9-a26f-41ec-8682-b0b9c3c37012", + "MeterName": "Pushes (in 1,000,000s)", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Notification Hubs", + "MeterTags": [], + "Unit": "1,000,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6b5c9582-a8fd-4dc8-a494-f7ef82317065", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.594 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "5d2ce9e0-3e31-4726-93fe-9f7ce4d04d99", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "72cb2719-ced3-4a98-b4e9-51d8b0869fb8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3f3ca9cb-3ccd-4e0e-a619-c796c1b9edff", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "88e0794e-588c-4cdf-9603-ae69bfaffc8e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.644 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "c01dd06c-7dc9-4534-934c-dff44042aeb0", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "e3ba6ef4-8da7-4781-b3f9-34c966e06ce0", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7de65d21-12d3-4904-8632-cbe9c481efac", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.367 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "2a5336a7-5168-4959-994c-f56df612d151", + "MeterName": "Standard S4 Overage (in 1,000s)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Analytics", + "MeterTags": [], + "Unit": "1,000 Transactions" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4cfb867b-2167-49dd-b89a-024719061a09", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.111 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3999d18d-3a2f-4230-948a-52296b7f378a", + "MeterName": "Standard S3 Secondary Active Geo Database Days", + "MeterRates": { + "0": 5.8806 + }, + "MeterRegion": "BR South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "5ebb1769-35d6-481a-b69a-3207e48f1e5f", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7657247b-86ab-4ed1-a170-185f360138d8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.542 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a9f53a13-21fc-45c6-aade-c42e2accf259", + "MeterName": "DWU", + "MeterRates": { + "0": 1.5121 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a7aa8fcb-42f3-4311-9c3b-4ec6647f46e0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.234 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7a8f591d-b01b-4c42-bcb7-3ef8c7d6ca1c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.86 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "54e4a052-cd51-475c-b7df-d4772343fb3d", + "MeterName": "Standard Medium App Service Hours", + "MeterRates": { + "0": 0.252 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9426e695-7bb4-4bc7-9899-a51b5bdbe3f7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.504 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "295f29b5-64ff-42fc-b942-d5f2ea2a0cf7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.577 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16mr VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "de2a4d92-c50f-47cc-9eda-9fcd1e7361de", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.897 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7f258707-ef67-41bd-9469-9ffc2b61a932", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.145 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "025cc6ab-6db3-492d-8a66-ed3e8c10144b", + "MeterName": "Basic C3 (Hours)", + "MeterRates": { + "0": 0.225 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0ca118e2-2601-4829-a2f3-33f9ab7d051a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.528 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b80056b5-6af6-443c-9ce5-fe2e577d1521", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.639 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8a18372f-182c-45ef-bdc5-b89965bfc92c", + "MeterName": "Premium P15 Secondary Active Geo Database Days", + "MeterRates": { + "0": 584.208 + }, + "MeterRegion": "JA West", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "278c095f-cd23-48ae-9081-8cdf49767428", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "acf575e3-9a0e-4471-9ddb-48ae53ea80d3", + "MeterName": "Basic Medium Azure App Service Hours", + "MeterRates": { + "0": 0.165 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a55b03b5-3098-4141-ae72-d6f5643c6171", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.008 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ab463704-d90b-491c-9587-59a998835ef5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.402 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ab81f8f5-dd6a-4e9e-b2ae-fceb79c58f2f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "95383be9-bc60-4903-948c-e33437dafda1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.278 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4afe8ef6-63c8-4741-8a8d-b06234b67ad9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c366aead-ff21-4e26-bb1b-e01b2d04199f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "750d52f8-b415-48de-b41d-56199cc4ca91", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ea107df3-ed81-43a4-93ca-85dc6734ad54", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.65 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "86ef543d-fef7-4d10-bb82-49840b1c3355", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0f901b9d-6fa9-426a-9590-d2924413c8e5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.24 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1f666157-d311-4ea5-96b4-b7d4b9311704", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.594 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7963fa2c-11ef-45c8-b003-aca4d1e4961b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.46 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3a88905e-84ba-4cdc-8f84-be4b0f4ffd89", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.904 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f11f905e-ea54-4f25-8547-46e0e8cd9575", + "MeterName": "Standard S1 Secondary Database Days", + "MeterRates": { + "0": 0.913 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0350c6c6-6c31-4eed-aa53-a35993f89f36", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.35 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1f7726f2-0ab5-4a46-b4bf-24d0b0bd6c8a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.684 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "ee6736cf-57fd-443b-9a89-9b9810953c65", + "MeterName": "Build and Release Private Pipelines", + "MeterRates": { + "0": 15.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Team Services", + "MeterTags": [], + "Unit": "Pipeline" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "47fea96d-d300-43d0-ab31-e6ff39c1f440", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MSFT R Server for Linux (24 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "732e96a2-d15f-44fa-a205-a5b7396630c3", + "MeterName": "DWU", + "MeterRates": { + "0": 1.2097 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "aaa99b30-673d-45e3-b860-f0624f371d5e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.44 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "658a22b4-f07e-46d5-93fa-ba67f56c3377", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.698 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d4a1726f-2b95-4355-9907-b6b2123f8a37", + "MeterName": "Standard S1 Secondary Database Days", + "MeterRates": { + "0": 0.73 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b2f312fa-a3de-4a4a-96c7-0c1cf4fde580", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.158 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "51aa477a-14ab-41f3-8721-1af6d5d9f1e6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.187 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2416f288-46fa-49f3-944d-bef5d19b0d3f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "893f0c95-434d-4f9b-8c26-5f88cd3aa703", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "72c52807-1e01-4905-b609-42df4c90d935", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.592 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "53a0922e-fb31-452c-937f-eddb28332602", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3f35ddf8-022e-4f88-ac8d-97adf188b12b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 7.076 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "47b01664-7b82-4abc-b160-df2a38793258", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.064 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a0c8e7ce-7ed6-4acc-a1c7-9dfeb7a62ce9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.041 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4e3d4f06-9cf5-4cb0-bb82-10c1013c0413", + "MeterName": "Standard S0 Database Days", + "MeterRates": { + "0": 0.5807 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e4fa4193-078d-4720-b328-aeadf1703dd9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "bfca4552-5529-4b01-98f9-b7a42ca4d69f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "47c3ea37-8f9e-4d0f-a3e4-c1351de4408b", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "3f5c6b82-f791-4f30-a506-2570de10e79c", + "MeterName": "BGP Routes Add-on Units", + "MeterRates": { + "0": 3000.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0a6c7eb6-0290-4e92-a112-4de73442b6ae", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.035 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "20d81067-af7c-48d9-acf7-d17d2e5ffe31", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0652 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "1bf80982-509f-4353-811a-b50357600ec1", + "MeterName": "Shared App Service Hours", + "MeterRates": { + "0": 0.0158 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c2682b49-0379-463f-822c-9e486104ef9a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.4 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "14b8095c-55d1-40ff-a790-396657206a77", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c02481f5-526c-4869-8237-bbfcacaa9c14", + "MeterName": "Premium P4 Database Days", + "MeterRates": { + "0": 60.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4c43072f-2450-4665-848d-3ae403c3bba6", + "MeterName": "Standard S3 Secondary Active Geo Database Days", + "MeterRates": { + "0": 4.8387 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a1abdf0f-f5ac-45d9-bb59-a54c58f4c600", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "233f28a1-ea62-46da-98a9-85ee0bd8e2e2", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 67.58 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c846e0be-b1ca-4201-b033-f532273ab35b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.056 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0c0f42d3-b620-46ab-9e09-f440e4e773cb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.39 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c59e5174-b0f7-4b9d-84f6-901b6777f387", + "MeterName": "Premium P4 Secondary Geo Database Days", + "MeterRates": { + "0": 46.8 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1760dd42-1206-4da9-832b-b4f47819c578", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.144 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "14f7d3f0-55fd-41ca-b92b-1543332f8347", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "eb51b970-e014-4faf-b436-4224b1e6aa73", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.309 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9ea14385-0aa1-47cc-afc0-f2ae4a024f41", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.617 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9bc6bbcb-216a-4333-a143-e08103c337b5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "58231248-9370-44ce-9d83-9a99ad12b7d1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.292 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6285fb92-a11c-431d-8705-36239afcba6d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4d84bf3c-6f6c-4b5c-9c7b-bd34148ecdc5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.22 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "G1 SQL Server DW VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Insight and Analytics", + "MeterId": "f76d1cf2-a577-409d-bb78-5e83f64bbd6f", + "MeterName": "Data Retention (GB)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Log Analytics", + "MeterTags": [], + "Unit": "1 GB" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "aa3a7f58-99a3-4760-8fe5-6184b0a4e14e", + "MeterName": "API Service Predictions (in 1000s)", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "1000s" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f7d55f0c-b49e-408b-a91f-66ccfd311d1a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.804 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8e7cfcf2-abee-46f3-80fb-9fa21de35d1e", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.163 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7a1b179b-c49f-4e9a-b130-acad40ed82b0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.5392 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c625d8ad-26cc-46c1-891d-0aba828a4f25", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.35 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e490b7ca-7d10-4b35-8b4d-81336dd54bfe", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "24062590-f2b5-4dd3-8073-e07dd42fa4e6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.567 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2c25e126-bca1-44a7-bd50-1a9fb70d58fb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5ad08c62-8af3-4458-868a-d3faa2518049", + "MeterName": "Premium P15 Secondary Geo Database Days", + "MeterRates": { + "0": 483.88 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6d0dfe87-dd20-4c48-87a2-8e3f4f2b3650", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.147 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "46cce6a1-234c-40a6-862c-ec372b7803a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.292 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d1b60c4a-516d-444f-8519-2cd3d27147bc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.16 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "687f0c7a-8a70-4575-9084-ab94abb22831", + "MeterName": "Premium P15 Secondary Active Geo Database Days", + "MeterRates": { + "0": 645.16 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "63836cf4-f142-4702-875d-0423839defb4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a48f58e1-fa30-44ff-8312-d3af67e18f32", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.243 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "66394b4e-5393-4ab9-aa3c-f15965cb2a6c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.568 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "728f3206-5e3c-4f02-ba31-669d04054659", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "4d10df20-7dd5-4f8a-8ff9-2bb0a2b252fc", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "96c86a67-1c24-4dc7-bac7-925f97a5f83e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.593 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cbd9afac-80a8-442c-afcb-8c3c64b410a1", + "MeterName": "Premium P6 Secondary Geo Database Days", + "MeterRates": { + "0": 108.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "50545028-8a65-4a48-b7e2-1883331450a8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.642 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "413bd863-a535-4e68-b041-1ee74bb62452", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4a5e21b1-9fba-45ac-b374-f3c5ce690b41", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.904 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7d154811-9adf-410f-a44f-264b2c0bb928", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.134 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e9549cbe-02d9-4213-b4be-22d6dfe8a3af", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 19.71 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "0784154a-97be-40b5-80d9-7d60f73735d5", + "MeterName": "MSFT Peering Unlimited Data 500 Mbps", + "MeterRates": { + "0": 5200.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b28ec8f7-c86f-48c8-95cf-0b147a25c41f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.497 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2f968df1-9a17-4398-bcfb-ad8bf7922321", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0264 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "66866def-3e1c-4db2-a0ee-075bad42dee2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.126 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b126a96f-6045-4fb6-9ef8-483b34c1a47b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.04 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8a72cc18-f690-438e-b77d-51195de7a551", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.04 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "287d9432-4499-4a9a-a53a-274fbb259dd6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.059 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4be10750-f3ba-4314-a572-c93f6d03b541", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.096 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cfc45eb6-a396-4e89-b97f-48a417c64af5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.062 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "ef9a7eca-060b-446c-8870-99716edd5912", + "MeterName": "Standard Large Azure App Service Hours", + "MeterRates": { + "0": 0.44 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "702248f2-87a3-41fd-bb1b-996d11587a54", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.311 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16m VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "65e1a547-ca1f-42a8-b9dd-e290c579976e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.786 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3b31b19d-61ed-4016-9e96-641a30f29004", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.78 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9dfd9e6e-652b-4630-994e-cf521e7754fd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.122 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7908e336-4148-4888-acde-854d853e1b81", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.103 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 100.0, + "MeterCategory": "Networking", + "MeterId": "b1e1e5b4-4bde-428c-a22e-9e94faeec6d2", + "MeterName": "Remaps", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Reserved IP", + "MeterTags": [], + "Unit": "Remaps" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "e5773d67-c426-498e-a991-8ed469df9bc0", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "83e8b916-0a6c-452c-9c1b-85836f5a133f", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.168 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "L OpenLogic", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0aaf975b-8e33-404b-93f7-de7d69774ca1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2c619e80-c14d-4051-be0f-e87163be7078", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.888 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "99645d6f-b5d9-43ae-9004-554b501796eb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "6633d915-7f8d-4ac9-a7b3-a0d52037340d", + "MeterName": "MSFT Peering Metered Data 100 Mbps", + "MeterRates": { + "0": 100.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "af4fbe86-4f1e-40b1-9b18-b6bd21d52a73", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.176 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "58f7423c-4bf9-465f-93e1-9c0006297c2d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.284 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "40a3b3c1-a48a-4a66-a7e7-b300cffac4ab", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2ccb656a-df40-46fe-871b-4f2f9c4e7ea5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "50366d4a-43ad-4712-bf16-b0e2ab06d08e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.568 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f9985551-0928-4da0-a9b9-62972f05fe72", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6ab4b21f-3ee9-4229-85a5-9bdba2b1319b", + "MeterName": "Premium P4 Secondary Geo Database Days", + "MeterRates": { + "0": 45.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b6ee373a-9179-4a09-ac0e-35709d8cf1a7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.122 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ef82fb76-d2bd-4470-b0fc-0c7fea2d7b2b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.111 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "87594d41-d07d-4257-be17-d4d2ee0d0132", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "df6c2e25-b152-446f-bbac-358f7f6efabf", + "MeterName": "Premium CDN Data Transfer - S1 (GB)", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e081f4fe-7d9b-4040-ba73-e9dfde930291", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.171 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "0dc6943f-8742-4a62-8db2-44b61c7fe953", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9ffb9408-91da-478d-9a81-1dafff95d33b", + "MeterName": "Premium P4 Secondary Geo Database Days", + "MeterRates": { + "0": 54.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "aae08c34-04ec-4746-9749-36b58cfa2eb8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.698 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "94e721d9-5399-4094-843f-c84eb4e2e3fd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.973 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "63710d1d-64bf-48ed-aa9f-ac07c7f6c6f6", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a2638a90-563d-472e-9d34-98fcfb71939f", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 135.17 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "1b90c524-7e82-4db4-8c41-406874dc197f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "01d844d6-e61e-4a12-8587-18c3a457db83", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.378 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "50c25df0-bf26-4462-8805-ce39bdcf4475", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.568 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "80bfd6ca-6975-4cf4-8388-8f5b0b63704d", + "MeterName": "Premium Metered Data - 50 Mbps", + "MeterRates": { + "0": 155.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "832190c8-deeb-4fdb-9784-5d72fc63e037", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.41 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "848c6294-7343-41c8-a7d2-79d81a11da0a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.611 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f0185c96-1902-44c9-b4b5-9bf534862606", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.064 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Web (8 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "1d997029-efe2-4491-a927-69ad45e143f2", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9fe4d0cb-6731-49ad-9358-2d8587660e91", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.385 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "bf9d319e-b320-41b2-925b-c53ffedaa69e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2a490ae7-a782-482a-99cd-55429d580ad5", + "MeterName": "Premium P15 Secondary Geo Database Days", + "MeterRates": { + "0": 442.8343 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1664dedf-c176-413e-813c-c5489d027272", + "MeterName": "Premium P4 Secondary Active Geo Database Days", + "MeterRates": { + "0": 72.92 + }, + "MeterRegion": "BR South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "75325450-e25c-4b9b-a132-8fa43ea4cf1a", + "MeterName": "Basic Large App Service Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "b4f199c4-1262-45f0-9e00-f7e060cac98f", + "MeterName": "Premium Metered Data - 1 Gbps", + "MeterRates": { + "0": 1886.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "c30490b2-3656-408a-8dbc-234d5de91597", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.059 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10K Operations" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "63664cec-1472-4c04-8b7d-497141eff456", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.307 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "719ad254-6b3a-4345-9508-21c1243231b6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.293 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "521ece12-5133-4e99-b661-7c5761586174", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.246 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b62c8e16-705f-4de9-86ab-b96b59845b00", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.639 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b1a0557b-7cb3-4822-95e5-9b3494cc4323", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.845 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "055313c3-6b3e-450e-8399-52bdef767120", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "76850cbe-33a1-46d4-988d-430ac234cdf5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e27e181e-9c68-4723-a831-0038fa22443f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.567 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7c925565-7add-4747-a320-f6f7c9a12914", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.244 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "71af610c-e39d-4910-88fe-40814469f50f", + "MeterName": "MSFT Peering Unlimited Data 1 Gbps", + "MeterRates": { + "0": 8700.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e4a85194-81e3-47fd-ada2-fe1467b57bfe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.534 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC24r VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0384c995-fc14-42d1-9e2a-c51964c2d737", + "MeterName": "Standard S2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 2.662 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "468dad9b-a8c6-4c02-a340-d3b1a7e801e2", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "21538a6f-ea3c-4bd3-8b4a-945dc9b516d3", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.0389 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2bc489d8-90c9-4f3d-b8ef-d6e49b38d9e2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.34 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3d659c2a-bd20-4574-b305-2bfd864cf816", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "c4624541-6316-4fa3-8569-d8ba09eb61c3", + "MeterName": "Standard IO - Block Blob Write Operation Units - Free (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cfd04c8c-986d-45ee-9330-28124fe7c460", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.54 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1c268ee1-0168-4fc3-bcc0-6e0edf013d4d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.616 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d67b3fc7-7f2f-4b81-a6b9-c04c830883a8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.029 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "090284c8-ffe2-4c62-9f70-e16cf79a7c8c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.345 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "14cb6eff-4841-4256-9af5-ef93ed8fb334", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "02778402-fe73-44ca-87a9-11d90554d9bf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "29d42ce5-1adb-4767-a204-009e12b27666", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "af454842-91c2-406f-87a3-d719ea7ee1e0", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0326 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-05-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "bb65d6d7-6e76-4271-a92b-9afbed775d27", + "MeterName": "Build Minutes", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Team Services", + "MeterTags": [], + "Unit": "Minutes" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "1b207df7-7922-468d-aba9-2906ef34a65d", + "MeterName": "Enterprise", + "MeterRates": { + "0": 250.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Subscriptions" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "2a1ad802-139b-43b8-a0b5-caf8a562d6e4", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A7 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "76dfe260-5cbf-4df7-a887-3197b1c1d94c", + "MeterName": "Premium P11 Secondary Active Geo Database Days", + "MeterRates": { + "0": 225.81 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-05-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "8330ee7e-073d-45b3-912a-6a6332a541fa", + "MeterName": "Professional", + "MeterRates": { + "0": 45.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Subscriptions" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "04509603-57ef-4919-860c-d88ea7cfbf40", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "971f0ca3-60aa-4cc8-bb98-ffad6f8c59d7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "940e92c1-bdae-44b5-807c-c1ab2d3a05b7", + "MeterName": "Premium P1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 15.0 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "aa2f6135-a5b4-425c-b03f-dd82a19671b3", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 73.22 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e48918e6-299d-46f5-a5ae-5c6e528307fb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.016 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3815994a-7305-4dc5-8304-7bcf289ff86c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.294 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f3051f41-8827-47c0-af02-391f346bf821", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.337 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "55461174-8b10-424a-af38-a7c6656ec64c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.142 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "24a55859-5294-4797-af80-820874aa6125", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.168 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ed6c0830-1096-4bd8-967d-bdb50148e9bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2137cc71-7875-4d85-bd56-70c27cfbe16e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.646 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "1d65f3a0-7f88-4edb-991b-ebfc48016816", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 74.34 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "063f26fe-362d-4183-9ef7-78d1263fc0f4", + "MeterName": "Premium P2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 36.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "8498e170-ccdf-483d-b90a-578f41b05364", + "MeterName": "S3 (Daily Units)", + "MeterRates": { + "0": 225.806452 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Speech Translation API", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "dcc0cff2-c425-42bd-98e2-b0d71ddc56ed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.793 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f8460d15-4945-4c49-b343-b2f308f88d05", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.059 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "6eadcddc-ec2f-4c98-a9a2-16ab1b33211e", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4c68b6b5-a4cf-469b-ae80-67736eff408e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bb41c7d1-ea55-4bb2-a076-1ad8713be7f3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.319 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d73422d8-e396-473c-820d-5ae98fedb5e7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ab16d6c9-b9a7-43b6-81bc-2f406a903605", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.659 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "569ffb9d-fa22-440a-9233-3625a5a8699e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.447 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "edd2d43c-473b-4b80-b11e-c044fcb0255d", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.0044 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c13c1b49-b0ab-44f3-b56e-8521c0e42517", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "0c3885bd-351d-4c28-830a-446d7bb4295c", + "MeterName": "Shared App Service Hours", + "MeterRates": { + "0": 0.013 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a779b4ae-e3ee-44cf-ad4b-c2be12f11947", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9ccde83d-b9d7-4523-bbe0-06f8e2b0984f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "af610e69-10c6-417b-9537-37944c47a686", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.4 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "aef827c1-ed32-4e82-b851-b917d1851ff6", + "MeterName": "S2 (Units)", + "MeterRates": { + "0": 1000.0 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "aedf8420-cf6e-4d02-bea6-9470d4d35d86", + "MeterName": "Premium P18 Secondary Active Geo Database Days", + "MeterRates": { + "0": 451.612 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "11e70888-7dba-4ed6-94ca-5207bc3e9767", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.147 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "89d7ba29-09df-4ba0-9c78-5aa7ee2cffa2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.31 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4230fad1-d459-432b-ad6f-51dd39dda4ff", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "a79ff50e-8ce0-4944-8abd-dba53e60178a", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "75aa8f43-7743-4cb7-accf-18d6899502a8", + "MeterName": "Studio Experiment Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "69a9f821-ee9e-490a-a42f-404ba5c19819", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.275 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "573d2331-2858-473d-b19a-3b0e33a9b826", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.61 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a3ab71e8-069e-4b75-afa6-f1455adad232", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "fea0de99-4dcb-4387-82b9-fc3348238b27", + "MeterName": "Basic C1 (Hours)", + "MeterRates": { + "0": 0.055 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0d121d82-9614-44d1-9eec-66c8e0b43930", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.21 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A10 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "912f9c7b-beec-42fb-a1f4-36f029343488", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "30568429-55cf-43ba-ba8f-a0c525e49f9e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.101 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "75f0db6b-5d86-4c8e-ada6-f7125a52cd3c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.22 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2e74d96f-3567-47c0-ad9a-9d58fae3a58d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 12.731 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "19f22d59-7b1f-438a-a627-87469e71323f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.76 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "2cda0b49-7d4e-46a9-9d7f-2e8446749092", + "MeterName": "MSFT Peering Unlimited Data 2 Gbps", + "MeterRates": { + "0": 17400.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "79af76be-b139-423d-8ddf-7b3fe8937740", + "MeterName": "Standard Redactor Minutes", + "MeterRates": { + "0": 0.145833 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "Content Minutes" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "efee451b-13f7-44e9-969c-8ee08289759b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.89 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A10 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "02e6613a-5ecb-455a-93c4-70169a699a7a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "16a7af50-d069-4426-a988-02bdf74476a1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.074 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "fe876f27-eb80-4c61-bdde-39b72f5bb182", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cdbcfac1-aab0-4e3d-9dc8-8231a91c7f5e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.822 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d1166c9d-9d2d-4fb4-96c3-198e41fd358d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.177 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "12d79ab0-39f4-4db8-92dd-72eae17c295c", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d2eb6a66-5243-49a8-8eff-61d09328a429", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "89ed8923-7cdb-4766-b02e-90863458fe9b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.596 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "14191e8e-4823-4535-b8cf-2379934be0d6", + "MeterName": "Data Transfer Out - Metered Data (GB)", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "17b9a033-f758-4e92-b900-ad71efe48ff4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.663 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "93d53c01-f180-44d6-a5ae-00fd565bd256", + "MeterName": "Free Database Days", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5d8d233d-16c9-4551-bfab-7a8a29b80635", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3eca36ab-db90-42d3-b454-a1fff0e36385", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.61 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "51c361ff-a826-490f-a1b3-dd41d4798ac3", + "MeterName": "Standard S4 Database Days", + "MeterRates": { + "0": 10.7139 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f930ef5e-c409-4015-95e1-463c83a5a63c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.135 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "14854f12-8d37-4299-842a-b0f2df82a305", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b641077b-1ee1-4745-8103-4366ee2543fe", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.009 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8bf84600-37ce-42ab-a6d7-0c322aed8182", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e96ba86c-f49a-4a5a-ba06-8ed6cb6b2563", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.242 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6255f1e0-9143-4bf6-9302-6cbef1b06819", + "MeterName": "Standard S1 Search Hour", + "MeterRates": { + "0": 0.444 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "39a71e7a-f800-44da-a654-531a0838ad25", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.481 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Mobile Services", + "MeterId": "c8e0bab1-3e3c-4814-bb8b-9df53501d690", + "MeterName": "Basic Mobile Services Units", + "MeterRates": { + "0": 14.99 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8279dca8-8a70-4c65-adac-9d0a080f21a1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6cb69b1e-dc15-4380-8134-323c26bbf4d1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8c627e43-83f7-4980-8e30-b0955f529057", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.016 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "2d4d409d-9821-4057-b8b4-12499b3eec7f", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eb3b45c8-7428-4181-8a37-d563d7aa2130", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.713 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c29d8624-351f-46f6-812a-b40b7bbb3853", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.422 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9df7e2a9-22e1-4f5c-b3e2-63d979a59692", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.784 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "50579338-2886-45f1-a8bb-7c4afdbebaba", + "MeterName": "Basic Elastic DTU Pack", + "MeterRates": { + "0": 0.0532 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4c951c96-be04-46dd-962c-5ab4f8f96a64", + "MeterName": "Premium P1 Secondary Geo Database Days", + "MeterRates": { + "0": 11.7 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fac55353-c604-4165-957a-9806be61d53a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.363 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7feeaffa-2443-4f99-ac66-a0464e8a19aa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.218 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a3404573-3e32-4362-9315-1d9a72e0fc6f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.681 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "9a56b4f4-1d78-416e-a19b-815490ad7910", + "MeterName": "Standard IO - Table Scan Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "da67782b-514b-4b3c-a7c5-103a56e6bc55", + "MeterName": "Premium P1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 18.75 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "52a3285a-5924-4a3e-8f1d-af99d3454ffc", + "MeterName": "5PB Commitment Tier", + "MeterRates": { + "0": 4096.78 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Store", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "fab075bb-b179-48e5-8715-38be9f196f27", + "MeterName": "Basic Medium App Service Hours", + "MeterRates": { + "0": 0.177 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7dba37cc-5c5b-4ad1-8062-4d27ca4b8b59", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bee8d2d4-ec15-4a8e-9582-f146a86c19d4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.307 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a711dd41-475d-42c1-b8b8-2311f0318580", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.159 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "e6a69a3c-288b-4171-af54-744b271ea65a", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "cfa24dd7-3f0e-4e00-a167-2e1f0f4830ea", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "54477364-0250-4d1d-a341-382ab5f88a75", + "MeterName": "Standard Large App Service Hours", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "192f2e47-92f7-40f9-a10c-c936bc4831b8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a72205d4-2c64-4ccc-89a9-7804b8a8422a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "95b38082-a0db-474c-9fca-5650c639fb9b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "181926d5-204b-464a-b9e6-4d80ea4ef552", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.1252 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d03dc942-e4bc-410f-9da4-8b6425202589", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.139 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5ba3f3a9-b8e5-4cc5-b2a7-9a2ab3cba406", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.401 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "99991cc8-be03-443a-83de-4d9ede021782", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5facea72-fd89-4710-a261-10ab63daeb07", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.464 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3208d7aa-8222-49f3-b363-07b68837f30c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.372 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "937d7721-8ccb-46ef-814a-dfa23d9d2b57", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.797 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2da459c7-3025-4ea4-9b46-23d0efa58cb1", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "424aa64e-dc25-49c4-8565-b86222279260", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.034 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "6d8e5801-3e49-446f-958f-5c79bc1416ff", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10K Operations" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2b794af0-a7ea-4290-988c-3eb887e3dbdd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "550f587d-ac2e-43dd-90de-1fab41f5ba39", + "MeterName": "Premium P11 Secondary Active Geo Database Days", + "MeterRates": { + "0": 274.43 + }, + "MeterRegion": "BR South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "93351a86-99c1-4b24-aedb-bfce45224608", + "MeterName": "Premium P3 (Hours)", + "MeterRates": { + "0": 2.774 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2e956b65-407a-4637-8b4a-905a4756af22", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.646 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f0cfd84c-f382-4bf0-9f7b-a3a0aa980efb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle WebLogic Server Standard (1 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e932f3dc-b35f-42f0-b59c-d05defad0a78", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.342 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "a7130fc0-3bc4-4e01-a47a-a7441fdec6df", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.384 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "77609be6-c110-4e07-962b-6238efbfd0d1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 100000.0, + "MeterCategory": "Functions", + "MeterId": "4e5cd9e2-c20f-4d7f-acbe-58931b8b49ef", + "MeterName": "Compute Requests (in 10s)", + "MeterRates": { + "0": 1e-06 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10 Requests" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9c0e03b3-585e-406d-97a6-f4ef3fe40c7b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.463 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16r VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9081fe14-ac6f-45ca-a4d9-2b8756c500ee", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d5ca9979-e9bf-4c05-a5d7-c72682d386d9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.966 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d5592e36-915f-4839-aa41-295dc82a9203", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.074 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1b67dde1-5444-4c43-9472-a94ceae8f33e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.246 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a464e4b5-404e-4be9-b016-480bf779ac73", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6d70c68f-9ef2-46ba-b077-484465f471ec", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.315 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "fcfe6f2e-4f7d-4d98-bf21-f167604ebdb2", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 135.17 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "27b3efd7-371a-4262-bb80-ff8a63109699", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "743df7ce-2318-440e-879c-fd0215669eaa", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5069aa0b-a93a-481e-9856-616a5e5575ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.079 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b16e83df-bad2-4a20-bfc5-9ad0d9d169b4", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.2875 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "589e46fe-4583-49ac-a10f-81e12267a127", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.592 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b17e33a3-6742-4e47-a50a-06b870574e65", + "MeterName": "Premium P6 Database Days", + "MeterRates": { + "0": 145.2 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "462cd632-ec6b-4663-b79f-39715f4e8b38", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "XS SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "12c6b384-7420-4809-8dea-22c75586d06e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "b7b6ab06-2a5f-49a2-81b1-d8e76f012c6f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.854 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2a57b047-d1d6-4a70-a19b-4862972f10f3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.016 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c785253a-41e5-4b5c-98f5-41d74e2ed6d9", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.285 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ff3e9b1b-7728-47e6-aa7e-01b852ab5cc3", + "MeterName": "5,000-AU-hours Commitment Tier", + "MeterRates": { + "0": 116.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Analytics", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "923978e1-fd3f-4bd5-a798-f4b533057e46", + "MeterName": "Standard IO - Block Blob Delete Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e685d428-927b-4fb1-a225-681565dec84f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2cb0396a-d3d3-4050-af45-f4c3d6f3ed32", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.95 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "525a1fc8-fe0b-4073-acec-4e2746d26c0c", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "57242d01-f8ce-451d-86ba-42cb6420a568", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "acc5a3fa-45f9-472b-942d-532b36f70624", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.768 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f830cae7-d1bd-4f19-b7af-4b2751654bd5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.293 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "15e3c6ce-261c-4db3-a8bc-f4d1de3ec183", + "MeterName": "Standard Elastic Database Existence", + "MeterRates": { + "0": 0.101 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5d64cf92-2ca5-41a0-b5b4-537160d8b09f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4f9f1112-491c-4d37-8e06-54a1b9cbc38c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2714a45c-f880-4854-b41d-8598127d12be", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "459904b3-4992-46e2-bdf1-e74810c21445", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.88 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "97e9da9d-caaa-4595-a6d5-66f7484142c7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.343 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a8049401-f714-419e-865a-824817f9dae1", + "MeterName": "Premium P15 Secondary Active Geo Database Days", + "MeterRates": { + "0": 571.408 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "22b100c0-8365-41be-a39d-b5cb405e9ae7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7625ba50-fbcb-4e6a-9e25-4c8354088790", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "1ad497d6-14c7-465a-9cdb-5c1a3f87ff09", + "MeterName": "Premium Medium App Service Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b4e55536-5a69-4246-897a-2e7982be5197", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.279 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2012-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "SQL Reporting", + "MeterId": "d4d985c9-b5fb-420b-950d-458d4c2cdb72", + "MeterName": "SQL Reporting Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "37c7e193-26a7-4e2d-bf8d-f30588fbc6f8", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "432d1757-4a53-4f3b-8d0c-1643ebac6fce", + "MeterName": "Standard S0 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.5323 + }, + "MeterRegion": "AU East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "39b3a775-ff94-4920-ab1f-61d5dadc80c4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.674 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "aaa41709-bc47-4c3f-aff7-1f8a0b228a89", + "MeterName": "Standard Elastic Database Existence", + "MeterRates": { + "0": 0.0922 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a75daa1d-ccd7-41a0-a47b-c767d0da22c7", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.163 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "339fc49d-f3cc-4c6d-83f9-44cf9c0c9d38", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.6 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Standard (16 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "7ce53686-7c67-470b-ae6f-3996cbb02fbb", + "MeterName": "Basic Large App Service Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bfc659da-ec05-4bfd-8065-78cd212bca35", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.124 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "39ef1714-a0c2-45b7-bf51-1fd8b90aba26", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.337 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d6ea4650-6167-4db7-b1c6-1d06df4a7885", + "MeterName": "Standard S2 Secondary Database Days", + "MeterRates": { + "0": 2.263 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fb0e3314-7fa1-4ad2-8238-9c3fe64224a9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b6a1a7b1-147d-4969-b511-7b0925528a0a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.194 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "adee0345-8378-4d7e-a702-5784c368ea81", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.177 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e28f9980-0a1f-4006-be38-da8eec7818fa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.624 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "c139fb93-8cf6-4493-8b73-894d4d282e46", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Canonical (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6d19b51a-47d8-494c-9b51-dd507ad54e99", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.531 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "83ecc636-598e-449b-bf69-58583c0d449b", + "MeterName": "Standard S3 Secondary Database Days", + "MeterRates": { + "0": 4.4104 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d434c294-d7e6-433e-9f3a-2c6d6438d534", + "MeterName": "Standard S3 Database Days", + "MeterRates": { + "0": 5.3226 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "cf13eaf2-1f43-40a8-a5d1-f7657b5461a1", + "MeterName": "Shared App Service Hours", + "MeterRates": { + "0": 0.0153 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d8889acd-5998-4f29-9be7-d6d9236810e4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.466 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "f114cb19-ea64-40b5-bcd7-aee474b62853", + "MeterName": "IP Address Hours", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Public IP Addresses", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7648e95e-b1c1-408f-9ab9-569fdba2b127", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.149 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "843d5166-3839-437d-9ebc-f82a6b2a6216", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.1394 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "356ceb86-6186-4d3c-89a8-7de605da48ce", + "MeterName": "Standard Medium App Service Hours", + "MeterRates": { + "0": 0.22 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fd2b562b-812a-4cc2-b6b2-b20283d5c59f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.639 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4e2031cd-635d-4d54-b9df-380fdcf63c07", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.029 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "60cabd47-3352-46a9-8e8b-196927217132", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.1045 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "983d5164-7944-441c-8599-a516f50cf56a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.798 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0f4ff56d-127f-42d2-8c35-d6f98d1578d7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.854 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d77769e8-fd22-4a77-8dfb-4aadabb25c61", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "7fd385bc-796c-45c8-b0bc-278bb675b15e", + "MeterName": "Developer API Management Units", + "MeterRates": { + "0": 49.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "API Management", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "75320b13-bb2d-4527-9a06-8b8ffccf5237", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.814 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "76316769-34d9-4b32-a6ec-c89677ddad8f", + "MeterName": "Premium Metered Data - 200 Mbps", + "MeterRates": { + "0": 445.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "c2ec93b6-fffd-473f-b03b-99ec0f014230", + "MeterName": "Free Notification Hub Units", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Notification Hub", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "209fb2f9-c45c-4e6c-bf9d-954686fd3c2c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.272 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d68fab12-4fd6-4b7f-8518-b402cb9b418f", + "MeterName": "Standard S2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 2.5168 + }, + "MeterRegion": "IN South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-03-12T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "57105f32-0637-432e-ab45-76aa1956acfb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Java Development Environment (1 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1b86bf3f-9539-44e9-86cb-9961e173243a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.542 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "72051996-8d8e-4921-a2da-2244d8460816", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.535 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "47e8ed49-fc56-41d8-a459-fbef14c92c84", + "MeterName": "Premium Small App Service Hours", + "MeterRates": { + "0": 0.318 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7668bf28-d39a-480d-b0cd-a432d162b20f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.916 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "26ce34b7-67b3-480d-9d1b-54a7fb80f67a", + "MeterName": "IP Address Hours", + "MeterRates": { + "0": 0.0036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Reserved IP", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "cf857e09-a066-46e9-9f52-b6f73e70692c", + "MeterName": "Standard Managed Disk/Snapshots (GB)", + "MeterRates": { + "0": 0.0528 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "b9e5e77c-a0b3-4a2c-9b8b-57fa54f31c52", + "MeterName": "Standard IO - Table Batch Write Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "603ce07f-d881-4a8a-acb1-82bf3272fde4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a38caaf8-a8e5-4aa6-8cc9-5b5dd910d51f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.125 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "de330655-17ee-423c-8dde-a1a7ecbd7ee5", + "MeterName": "Premium Elastic Database Existence", + "MeterRates": { + "0": 0.504 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Mobile Services", + "MeterId": "090fea11-ad13-4c72-b002-c857cb161191", + "MeterName": "Standard Mobile Services Units", + "MeterRates": { + "0": 139.99 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b704e435-6af4-4a5d-9bc3-06e4b0554f02", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.516 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b8e5143e-bf4e-4cc1-834e-40b25a49a5b9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 8.4 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Enterprise (16 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "7c7b7558-7607-456d-9d8c-faf4149cb3cf", + "MeterName": "Standard C4 (Hours)", + "MeterRates": { + "0": 0.656 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "fe8719b6-301d-4f96-a11d-d0eb11d790d0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.329 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "02e9eadc-810a-4abe-9ebb-b3e80009752f", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "29f6e51a-6138-4f2e-a8fe-d8df7869416d", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.143 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c0db510b-a7e8-4cb6-804d-3b965992ca1d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.04 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "222f32c5-a319-4787-b934-5fb95105b2c8", + "MeterName": "Advanced APM", + "MeterRates": { + "0": 15.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Application Insights", + "MeterTags": [], + "Unit": "1 Node" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "075cb6fe-fd6d-40c5-989a-40042396130d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.04 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "3399fb93-fd47-4ea3-bf1a-6ded279aab72", + "MeterName": "Standard Managed Disk/S10 (Units)", + "MeterRates": { + "0": 3.238 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e587153e-8126-4711-8d86-7e57e7148488", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.163 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9df35c95-f93e-4896-9a3b-5dee09059098", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e75b5ce6-8220-4efd-bf7f-e099de2efca0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.387 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ac0bc029-66c4-4fe8-9dcc-140dfa46f9da", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3942 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "c1055a89-680a-4190-a2db-543e1fa71b2b", + "MeterName": "Standard S2 (Units)", + "MeterRates": { + "0": 16.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Recommendations", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6531567e-5972-4c52-b5c6-0fa0fae93340", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.374 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4b7af575-3c99-4ab3-84c4-b61dbfc6732d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.496 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "fbcb5c45-d849-4807-901c-da253442d477", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.797 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "80edf852-7701-45cf-aa74-67e900c190dd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.845 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "b29eac16-9986-42cd-890d-404a414cae83", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.0963 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "052267a2-58cb-4b75-9644-39e67df214e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.954 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "48eb1124-3c78-4278-9bc1-85d9120fab17", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.163 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "efb0eaa4-52c4-4850-b419-abfe35a1c96e", + "MeterName": "Metered Data - 5 Gbps", + "MeterRates": { + "0": 2180.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7ba059a6-09f5-4081-b01b-915a2a3911bf", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "880be4a2-e038-4d1f-ad41-81864e7b278d", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "bbe2e768-80fd-44f3-b76c-dc4a13bb4e64", + "MeterName": "VNET Peering Regional Egress (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Virtual Network", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "094852c3-b5da-42c0-b6c3-6c320e5301eb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.37 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4f743466-7a76-422d-976b-20f2560408c8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 8.102 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7633fab9-bc1c-4a5e-ae40-2aa80b8f15d8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.447 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b8e46e8c-181b-4f65-9936-9ed95b967609", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.374 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "5a5494fe-a8ec-4c94-9d89-a18b3ea3df19", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A11 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6f6b87a3-554e-47f5-b1d7-a0e8d5311716", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.626 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d8eb314f-b85e-4b3a-8956-19cf69bb8c42", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.055 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "afc5f08d-34be-47b5-b394-a3211a810d5a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.9 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d53819e2-6e9f-424b-ac19-a4014676dd70", + "MeterName": "Standard S1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 1.0645 + }, + "MeterRegion": "AU East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "109063c3-f812-46be-a3e4-a62e06171fc6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6459d072-f256-49a9-ae8a-a2bc42cd5929", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.118 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8b698c7a-47f1-4cba-8ae1-9853d5ad562d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Red Hat Enterprise Linux (24 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "606c4b3b-454e-4cdb-8033-bcac5f6b3895", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "37b7c64a-e1af-4ba0-b3a6-2f48503c14ec", + "MeterName": "Standard Small Azure App Service Hours", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ab66c53e-9e98-4ad9-9044-d30942eda64d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "123acba2-e093-4be4-bc64-508eca246fad", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.035 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "db25cdfd-ecd9-4893-a9af-f8858924defd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.086 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "787a3dff-ac97-4b19-95d8-3e3598368d61", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a1931f21-80fc-4ba8-91d0-102d31321153", + "MeterName": "Standard S1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 1.1612 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ccebc82a-8a1e-4e68-b226-72b4d8ef3c7a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.133 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "56044820-cfaf-462e-b198-ac435357be7d", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "56b74cb6-b4b5-4f7d-a142-392e69277781", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.452 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0af09a2b-acb6-4946-ac1c-9236fe1a38d4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.493 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "22780443-af18-4356-8bee-9fa42dbfdaa8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "171fa11a-8ad0-4436-b758-7dcbbfec4b8c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.28 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9141ef15-470d-4392-8633-e5fcf796ceff", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.32 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7790e1b7-6fea-4ec3-8303-dffe9dad8579", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dbe2d2b7-0d35-41b4-93e0-8e5cae6b0418", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.123 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "95d0215c-b10e-4352-925a-c9885411996d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c6ee120c-ba2b-42d6-bb3b-08d0b7c5727d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2ecf3c7b-45de-487e-b7b6-4eff641a11b4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f055c9c6-a03b-41c2-b291-e60a90f36c28", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8590f1c9-8997-4cb1-b526-a5c6534f7a46", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e1712dd6-f8d8-49e6-8448-4467a70a8f7a", + "MeterName": "Premium P4 Secondary Active Geo Database Days", + "MeterRates": { + "0": 75.0 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "d2e2622a-0a31-40cf-9e8b-bb2eb164614b", + "MeterName": "Standard Medium App Service Hours", + "MeterRates": { + "0": 0.236 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f679b7f5-ead6-4474-9829-769dc819f3e2", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fb22a586-24e1-4cba-96dd-02050af5490d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.405 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "923dd535-29fa-41b9-a505-2eccc1e54d07", + "MeterName": "Standard C5 (Hours)", + "MeterRates": { + "0": 1.05 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a5b0e14c-73ad-417b-9432-0d369a24667e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.255 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "babdfb96-4eb3-47e5-9add-30a06b65a7c8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.163 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3a1d137f-f61a-430c-bd49-0bc1cd7f6954", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.238 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "473a1dd1-c687-4e65-b886-f3d7332f3aa0", + "MeterName": "Premium P13 Database Days", + "MeterRates": { + "0": 354.84 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "66ce8e33-adda-4e04-a0cb-0f1ce31849b6", + "MeterName": "Standard IO - Table List Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2781f1d6-dbe4-4dbf-97c9-af5ccfd8a31b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "a9275d5a-d3da-47fb-938a-69c994e810e1", + "MeterName": "O365 on ER Add-On Unit", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bae7b5a8-3b51-42a9-8626-161f773b5461", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.096 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "eeb65ec9-9b0f-4586-a280-c1f30eae935e", + "MeterName": "Premium P11 Database Days", + "MeterRates": { + "0": 248.39 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ce655864-59d7-4ddf-9fd2-b683d467ee64", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.396 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "ba501f8b-0892-4e26-9abe-1f3d6e1bbe2f", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0028 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c4721d3f-e7d3-4b5c-8f86-c5b533b8936b", + "MeterName": "Premium P2 Database Days", + "MeterRates": { + "0": 33.9 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7478abb1-2639-4530-8d20-4de16c10b22b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.691 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "79cd9ab4-6623-4245-ad35-96337eafa05d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.357 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "58448cde-9a5d-44e9-9379-eb46c209649c", + "MeterName": "Standard S2 Search Hour", + "MeterRates": { + "0": 1.774 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "963858e4-b3ba-46bd-90cc-b509518302d5", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Stretch Database", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8b585da3-4286-4870-9af7-c6f627789344", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.206 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "91ca2643-d874-4da6-a684-bbc95c756bc8", + "MeterName": "Standard Encoder (Output GB)", + "MeterRates": { + "0": 1.99 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "01778ecd-15f6-434a-96c2-07fd540d312d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.486 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1b8ee1c5-63ee-4235-b273-74d94fbc561c", + "MeterName": "Standard S3 Secondary Database Days", + "MeterRates": { + "0": 4.1077 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "32f0a970-4107-40a9-9cae-f529a3622c90", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.276 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c106c992-da17-4880-b2af-93691cb1ee2e", + "MeterName": "Basic Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.1932 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "0108f28e-6117-49c0-91cc-d446196a369e", + "MeterName": "Premium P1 (Hours)", + "MeterRates": { + "0": 0.722 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3dc1a5ab-164e-4d57-bd3e-10d6164ecfce", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.127 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4005571d-fc07-48d3-98f5-86e27a41808e", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.375 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "309791ed-430a-4013-9b05-8e8854ec0e01", + "MeterName": "Premium P13 Secondary Active Geo Database Days", + "MeterRates": { + "0": 369.03 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "15adff7b-0dab-4c00-889d-caa6d4fb31bb", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.054 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6a1bd106-333c-4dfa-a71f-2722fdf518e0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bd3fb07a-872c-4e22-b154-7ca4ead5f9b8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.312 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "00bce34f-cde7-4bd5-8f14-b0b7d6b21e40", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.176 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a3206138-e211-4bff-9f16-fed7f6ea9db3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.25 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "45778e44-99e9-4a44-96cf-a8f629094ec1", + "MeterName": "Premium P2 Secondary Geo Database Days", + "MeterRates": { + "0": 25.42 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "8be55a12-6a8c-47b8-a3d8-6dec90290312", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.383 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "91e3e03f-973f-4594-8a5d-b2a26d712a7c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "4eea396d-b680-47c7-a1f5-3d9f5cd4d998", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "390384db-82bc-48a6-a5ab-25323805a0fe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.418 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "12f622c3-619b-4b39-955d-2bce51cefe61", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "105f1ebd-5829-468a-98b1-36019e2670e4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "40a11b2c-ce1b-43c1-8da6-b3ff083ce540", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 126.46 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "65f8af30-924d-4dab-8aad-94168563caec", + "MeterName": "Premium Large App Service Hours", + "MeterRates": { + "0": 1.32 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "91dabf9e-0400-47cb-9c9d-08903b1d9e3a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.175 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "db694303-aa9d-44d0-b059-1bb26ab4abd3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.156 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8m Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b05cb24b-e950-4f32-93fc-bc4381ba05af", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.466 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A8 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cae13303-88d7-4113-be86-6e1aaaa4c4e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d848378a-fb17-425c-8126-0f22525ccbed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.699 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "fb7392a3-f693-4e3c-9de0-01ba98ddb948", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "38529ded-5b8e-4b49-b078-ce81794a3543", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.008 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "696e01fd-b4de-4584-a321-ba40f0af038a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "b939c7c4-6cd5-4c4b-95a9-ebb04712363c", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0741ca2d-09c7-4c55-94a2-c0b6c0d30bff", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 233.47 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "23e1ac7a-73e3-48fe-80d4-27e129d74e5d", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "e315c24e-2f54-4668-95ae-5aef18f93125", + "MeterName": "Data Transfer In (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4dd4e1de-c11d-4208-a892-b4d7fe4aa6c1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.175 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "661029d0-f3d1-41a4-8f27-f85785363906", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "360b544c-fa6b-4a07-a5a8-48a1ca2cb074", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 67.59 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dadc6f05-6975-4db1-8dae-cf6d802ce15e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.083 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b57c4278-68bf-45a0-a4ab-1586eaf63904", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.237 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "47df7bbe-4be6-4409-bab9-2ddf50fc690c", + "MeterName": "Standard IO - Disk Read Operation Units - Free (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7005237e-58cc-4800-9432-5cbaf104d124", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c0edfd79-e322-4833-bff8-778e609c26ec", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.379 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "36010ef7-9201-422c-b3e2-033ffeb8b28d", + "MeterName": "Premium P6 Database Days", + "MeterRates": { + "0": 132.0 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "7d169ef9-f902-456d-994a-747929e8f497", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5071d41d-d567-4b8c-b8a4-f185692c299c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.312 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fe0c1675-39b5-4d4e-95c9-1b3b9d0e654b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.032 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "72a91179-cc9e-4a79-98ef-2708a9a8b2a6", + "MeterName": "Premium Video Face Detection APIs (Minutes)", + "MeterRates": { + "0": 0.1667 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Content Minutes" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "bbdee837-3c2c-4da9-bad8-3f4dd2df45ea", + "MeterName": "Premium P13 Database Days", + "MeterRates": { + "0": 335.48 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3db40165-e9f2-457c-955f-c159c58302f2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.916 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "40af2e4f-b9c2-4484-b034-a1064c6f82c3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a35c5774-1850-41f2-8368-e388e7f106b3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.194 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4ee3e365-90f9-4630-b38f-ed6986135acd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.218 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "3f2b1e1c-c886-4ec6-ad6f-dd0ef38819c9", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "5841b9c4-4195-4e6a-8088-4fd40062813d", + "MeterName": "Premium Large App Service Hours", + "MeterRates": { + "0": 1.5 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7d879c93-49bb-47b5-9a5a-e978129e7ff8", + "MeterName": "Premium P6 Secondary Geo Database Days", + "MeterRates": { + "0": 99.0 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "89ec5da9-baa5-44c1-8622-085e52553989", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 77.72 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "42d79216-1330-48fe-b1c8-b07445df2e45", + "MeterName": "Basic Medium App Service Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ccde4ff5-1516-4120-a220-9e982301b810", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.316 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7b0c2c83-f956-4c5f-b822-93bb157ad5db", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 61.44 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "37bb912c-9d9c-485b-8e88-f0e57dc367cd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.192 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4f47ebee-5501-4e95-be52-0e923987ed83", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "97e620a4-f295-48ef-b3aa-834378a8cf9f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "20b08e25-1f62-4d96-9c4e-7ba404db36f7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.936 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "72bb7aa1-e3a0-4363-a4af-953b80d220ac", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0264 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d340fdcf-27c6-4389-8e22-51c9a83adaf2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "64d48263-32ab-4359-b05b-8626b0974e17", + "MeterName": "Standard Medium App Service Hours", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1601ff38-6a99-42ba-b3bb-1eb132081dae", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.098 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "b9ef3036-86bd-4682-9a13-1cc3e80b3d58", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.171 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b20317e6-d6be-48ad-b7b8-86714f5debd0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.43 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7e20a7ed-96c3-4774-a333-bac48bf0de6d", + "MeterName": "Premium P4 Secondary Active Geo Database Days", + "MeterRates": { + "0": 62.4 + }, + "MeterRegion": "IN South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d422f5f7-2394-4171-ba60-27e90e182c51", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.168 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4eca9863-1928-4f14-8770-56332a7b8dae", + "MeterName": "Premium P15 Secondary Active Geo Database Days", + "MeterRates": { + "0": 571.408 + }, + "MeterRegion": "AU East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c71c2203-0303-422d-b362-fe5145fc4bee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e2d0a93f-8d8e-4de8-a457-c86351239e52", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.38 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "39f65a7d-ccca-4eb5-9718-2f8d3712323e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.9 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "e8ded5da-820f-4012-b68a-a0ebc82f7045", + "MeterName": "Standard S3 Overage (in 1,000s)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Recommendations", + "MeterTags": [], + "Unit": "1,000 Transactions" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6e6fcacb-5f0d-4d19-afdc-9ff9931a6c40", + "MeterName": "Premium P2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 30.0 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "eb1a5a41-fddf-4744-b23f-ca4f905a3422", + "MeterName": "Premium P4 Secondary Active Geo Database Days", + "MeterRates": { + "0": 66.43 + }, + "MeterRegion": "AU East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e53c5205-28aa-4750-ac82-4e7e6039786c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.271 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "1a2bbbcf-4313-43fb-95c7-11d95b45cd24", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "978ec393-2954-41ad-bd64-1aec2566b910", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "2f252a64-b5b9-4af7-be23-736debec89d5", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.22 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10K Operations" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "a43cd070-5629-4b2e-a742-67755ce6b962", + "MeterName": "Premium Medium App Service Hours", + "MeterRates": { + "0": 0.756 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "9c1e1960-41f1-43c0-b98e-c4ad9cc72fa5", + "MeterName": "Standard C6 (Hours)", + "MeterRates": { + "0": 2.625 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cf9be5f2-0ca0-4bcb-8773-93ce0448640a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "223c2a69-e19f-4dc1-a7c5-8118b16c5dca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.038 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "12c113f6-61d5-4f4f-8e05-d51e85221d7d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.616 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8b51cc3f-cf27-4249-af00-cdea5f8e45bf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.352 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7a40bdff-6f45-4172-b974-6b0ff58329df", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.205 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "27ea9e39-5e13-4d2b-9a16-ea6a269c6e62", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5060c012-6a58-4cdd-87b8-653dde025599", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.308 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b5d831b5-bec6-4361-924a-5e9a6d9d8e49", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c0d0014c-8ebe-4838-829c-efec05dd79a7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.232 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "328e19f9-37e5-4fee-8b98-d896a49a0d33", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.087 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Recovery Services", + "MeterId": "82a2e983-9683-4842-82b4-bb634c60c8be", + "MeterName": "VM replicated to Azure", + "MeterRates": { + "0": 25.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Site Recovery", + "MeterTags": [], + "Unit": "1 VM" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ee15eae5-95b1-420f-a06b-86a2069baf67", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.21 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c49be935-2bef-464d-a39d-e91a1dbc66a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.464 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "22eff9c9-8b81-4c26-87fc-0301d0ace3f4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.121 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "74e45d17-1efa-4520-93b6-ab248adceb07", + "MeterName": "Standard C3 (Hours)", + "MeterRates": { + "0": 0.563 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "758b46f1-1579-4490-a54a-9829ff267c51", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.026 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e40c606b-e16c-4803-aac4-1e47666f4609", + "MeterName": "DWU", + "MeterRates": { + "0": 1.5121 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "99694622-7772-4b82-b9cc-733fea3bb1c6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "572914d6-90b7-4bcb-ab74-37a940185788", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.46 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "00f4a440-7d4d-4f36-8069-86bd74df79c0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.893 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "74f3cc80-52e6-4f9c-a7e4-44c29e838f04", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.351 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cac456f9-3814-47c9-98bf-bcc73f824acf", + "MeterName": "Standard S3 Secondary Database Days", + "MeterRates": { + "0": 4.0177 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6ae71335-b4fa-4612-b67f-0e5091192d9f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "81d4cb7f-5f28-4c6f-84f9-1c422ca73adc", + "MeterName": "MSFT Peering Unlimited Data 5 Gbps", + "MeterRates": { + "0": 25650.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c08f7d89-a982-4b80-bfe9-40ccb9e6ee6c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.542 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ac6020cc-3e03-45c6-8cc7-0c3cab0a9c62", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.371 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b7e8ddcf-8bb6-4df1-9302-37573c1cac22", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "06fb8bad-0653-4cd7-bfb0-8fcd3ac50371", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "94a9b997-b0ca-4055-b05f-4be3148d3ce7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a4ed88a7-6d48-4f78-aada-01bb6ec88769", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.817 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5039bfe7-5674-466e-bb68-fe08933c62d2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.248 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "23fbf784-511f-4590-a64c-80a2a673e4a9", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "23584662-b932-47bf-b35d-9bafd4a32cbb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.5012 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "33fdfc79-05fc-4154-89e0-c3072a57f6bf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "daee1d0b-ddb4-48ea-a32f-9342d391d07d", + "MeterName": "Premium P18 Database Days", + "MeterRates": { + "0": 511.182 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "53b75ff4-0860-4072-946f-7e9583dca53e", + "MeterName": "Premium P2 (Hours)", + "MeterRates": { + "0": 1.332 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "8d2a775a-6ddf-4580-8624-454d3f0202af", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.349 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "71bc9bd2-f3ea-4000-a2ff-376882679d7f", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0528 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "13fe87e4-d8cc-4784-9d9e-e8118c4226a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.111 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "448910ee-8225-4229-9a8a-05dde0a6fca0", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0604 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "23d122e2-0644-48f8-a70e-f71b7b98edd0", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "41ec770f-e876-49a0-93c3-36e40a3dd5ee", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7da0841b-f922-47df-acaa-679e3a39e76c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.655 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cbcd1e79-2692-4583-846c-cdcaa6aa6434", + "MeterName": "Standard S1 Search Hour", + "MeterRates": { + "0": 0.37 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0f3b5c30-6a4b-4191-b458-d190d469e300", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "905ceb23-e257-4874-892d-ec1c838b700e", + "MeterName": "Standard CDN Data Transfer - S1 (GB)", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "Zone 5", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d9ccd463-483e-4015-83a1-e1d8c95ffb49", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.056 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "949ec34e-ecc2-4beb-b5a7-389f8bac1676", + "MeterName": "Premium Extra Large App Service Hours", + "MeterRates": { + "0": 2.64 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "84e893c3-2017-4670-8318-6306c51a80b5", + "MeterName": "Basic Database Days", + "MeterRates": { + "0": 0.1771 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "180c25fa-cb5b-457f-b36e-39c836d34041", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.045 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "545d87c2-378e-4e0d-9d41-ea1658989e8c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "01941ad2-4d1e-4220-b442-6e505439d6e6", + "MeterName": "Standard S0 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.605 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "106c81fb-cdb8-47b6-a86f-a0aacb54a4a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.62 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6ae0a9ee-4296-4dad-accd-0d1ec728e647", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.885 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0eba5887-4f6c-4cb8-a8e1-49414b39bf10", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.348 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8a8a2353-a930-4fe3-908d-281460de46c7", + "MeterName": "Premium P1 Secondary Geo Database Days", + "MeterRates": { + "0": 12.39 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a2ee536f-15fb-44e0-b715-d10daa6ddd1c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.054 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f1e53737-9692-4964-a7a4-a6e26e54b799", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 67.59 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6e01d62a-da88-40f5-ade0-23ef4499943a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.043 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1f08ea90-9f5c-41bc-802f-c29345e0117e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "df0df156-acdc-47e3-8d79-929d220af5d6", + "MeterName": "Premium P18 Secondary Geo Database Days", + "MeterRates": { + "0": 406.4592 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d02d2dc6-1570-419a-afa6-5e612aa482b3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.157 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "fb272fe6-d4bb-480a-9a88-ee04982015ad", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.017 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "df5c25c6-f90a-4552-bd77-0c75efd2b33e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "03d0ab9f-b3d2-42ca-bb70-26deadd2abef", + "MeterName": "Standard S1 (Units)", + "MeterRates": { + "0": 5.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Speller APIs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "66e8e541-b48d-4c60-b99a-8df6249bb82c", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "fdff7af4-ec1b-4a52-b993-8753bfe93fbf", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7b758715-7f61-48d9-9fe0-1e31c9246dd6", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "33c6746a-bb9f-4e4e-8bc2-5d9f3a56c2e5", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0955908f-5ef7-4834-81c6-7469200c5bf3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.833 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "678c97d2-8190-4709-9e1d-bd86c09609c7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.188 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5c571185-1fdd-42b3-8822-de52ae6dfc06", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.237 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f2a80d60-1f36-48ec-8273-9c157db056a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.701 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a3b1fdb9-141f-4931-87d6-1554b679f744", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "44dceff8-e4f8-479d-8856-e11f9ec935f5", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8b8e7b7d-a97f-4c8d-9b6e-4116d26ff8be", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.144 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1663075d-941d-40c3-a4e8-fcc5c598d76a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "b5a7ec03-749d-4a89-9828-b3bba5952106", + "MeterName": "S4 (Daily Units)", + "MeterRates": { + "0": 1451.612903 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Translation API", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c03e3bb9-5ac8-4dbe-bcd4-83f3872e1d89", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.112 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "38b060a8-faeb-421b-a0a8-4d36bd92c247", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.447 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "becb4c57-49ea-4296-8ac8-06ff09b74d68", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "706c1963-8782-41da-8812-d78c161f5691", + "MeterName": "Standard S1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 1.0064 + }, + "MeterRegion": "IN South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9b9cf84c-d8d4-4762-9282-8215c6883c1c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.168 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "62915977-0761-4d93-8499-039b03fac17d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.156 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "f7a376ca-7efe-4275-b51a-782e6513a78c", + "MeterName": "Basic C2 (Hours)", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ea4cfeeb-bb25-4814-91cb-5861450b4aaf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.567 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e10b7f57-6739-474e-9638-c926a5feb482", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c44e509d-63cf-4ee5-8ba2-ad5a6bd6061d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Web (20 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "b0b01749-c39b-4275-b283-6a92aabc3347", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5c7a80d0-80f2-45f7-9135-4b4ac42adf49", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0264 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "3b233522-9380-4c78-9c83-8235bb7cde91", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.352 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "770f4652-d1f5-4e4d-9ef1-1ec3e32e0764", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.464 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a10d3e6e-5b1b-4327-82ee-cb26e31baa46", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise and WebLogic Server Enterprise (1 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "633164c3-12c3-45a0-9444-529b57290c2f", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d37cd98b-3c44-41a2-9d44-a67f6a39916d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "211e620c-ebcf-4db5-a7fd-996abebe9546", + "MeterName": "Standard IO - Block Blob Write Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2493e198-3750-445c-8e83-d9de68e8029d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "bb3e836e-34e2-443d-8b86-57da6711bf6a", + "MeterName": "Premium P2 Database Days", + "MeterRates": { + "0": 33.0 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b7afc61e-dca5-4508-bf1c-06ddad90d4c5", + "MeterName": "Premium Elastic DTU Pack", + "MeterRates": { + "0": 0.216 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "5cbd5848-f3d9-428c-bdab-7c5898f9747e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "90d0cd4c-9b2d-4a3c-9724-17a9c8abecc1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.091 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "29d6e070-8e5a-41e4-b28c-6f07a6517c29", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0784 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "53f2de3e-7e5f-4ebd-a3ee-f27e6840820b", + "MeterName": "Premium Metered Data - 200 Mbps", + "MeterRates": { + "0": 295.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "19f8f99b-4b46-4ddd-9170-1799c7d98fc1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "14c79d86-8286-44db-be28-c9700663ae76", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.46 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0b7fac43-29b2-42d9-8f3f-7c2e90fe4cb1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.285 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8m VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "022f5d24-dd0d-4c36-bcfe-a84b47b3c624", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3227f584-efdf-4a26-9986-11abb2a697ea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7ffe03d1-f85e-4f30-9e70-31fa54867e9f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.674 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1ff2fada-4377-4b90-9e82-e0965834ba86", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ede94c8d-9206-4723-b5f5-f009180e76b8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Mobile Services", + "MeterId": "6a279f31-1940-461c-aa66-3fdc5ff5a7ab", + "MeterName": "Free Mobile Services Units", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7c4f3ede-7154-42d5-8c7e-dfd28438c5fd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9837aab8-8100-4899-8d06-a2b0351e7e09", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.159 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "d8f22317-5495-4365-898d-96ca9e69f54d", + "MeterName": "Standard C6 (Hours)", + "MeterRates": { + "0": 2.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "32bf0f8b-bde6-4dae-9dbb-3c465021ddbd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.7 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d52d1cd4-2e3b-4d1f-931a-268b78b3efe0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.337 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "489f0880-9116-47eb-a277-92415b62c745", + "MeterName": "1TB Commitment Tier", + "MeterRates": { + "0": 1.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Store", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "57ad7cc0-c01c-41a2-bfe7-ea719d486504", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "75f1a53d-f12c-4736-9929-0085905ea0a7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.04 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f9c45122-2ec1-432c-92d3-32d7bb5de82a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.043 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c7cf66fb-bcc3-4ee2-b81b-160bcf6c6a14", + "MeterName": "Production API Transactions (in 1000s)", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "1,000s" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5900b0ef-6505-4fe8-95cb-d88b11faa212", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "615e360d-a02a-4fc2-af18-ee807025ed92", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.665 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "82c30cad-c273-4a07-873a-1445748bc461", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.546 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9be55b2d-be4f-4b0c-aaa4-30643ba62343", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3dc20704-fab8-428f-98a4-2c4bb6277cdb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.154 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c65bba28-567f-4734-94bc-6dca4657dc6a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.193 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "f31037d2-678a-4472-9f84-d084817f69f4", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.0044 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "31169b2e-0754-4a9a-9c21-7eefa5d26587", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e87225c1-1a84-444b-a91e-6da20e0575e7", + "MeterName": "Standard Elastic DTU Pack", + "MeterRates": { + "0": 0.082 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-01-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3aab774e-ef99-4094-a954-29705e79ee3c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM Low Priority (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "783a4bf8-d1f8-4097-b593-5d69d8ad37e8", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.0963 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b8fb85a2-4961-4827-98b2-890c56be88d1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.84 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3a9af19a-1b5f-40e4-8a8c-068bbe89d2be", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.313 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "306cb42f-e8d5-4411-8c31-426f93b957ce", + "MeterName": "Free (Hours)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Speech Translation API", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2f7a7471-72e9-4eca-81c9-5160b6656887", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0297 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Zone Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "034905f6-497d-4848-9c6b-3ade284c8228", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.798 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "19c6c2cc-5c6d-437b-a30b-261ab98c3496", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.46 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5c1464be-1950-4c5e-af62-b8295618e9a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.469 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "464963b4-1859-4392-a8f3-ce94308dc123", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.743 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "98f47183-0440-4ff2-8f36-0b938980ce5d", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 73.216 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cf76581f-7183-44e7-9a6b-7bc960c8db59", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "675fb310-859d-48e8-b55d-4eb0574603da", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.029 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e47edceb-cd50-47c1-934a-e45eeed1154a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.125 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3afc164f-5d1d-48b8-9a14-ce809bb6273d", + "MeterName": "Premium P18 Secondary Geo Database Days", + "MeterRates": { + "0": 383.404 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "941aafd7-7c87-486a-98fd-d07a560912ab", + "MeterName": "Basic Small Azure App Service Hours", + "MeterRates": { + "0": 0.075 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7b627a0c-1db2-495c-b673-94b0d4c5724b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.399 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "f815204e-3dcf-4981-925f-5d4be32d937d", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e5549196-b976-4655-91d9-4877960536b4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f8dec6b-293f-44b6-ab6c-c6fad81904a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c4a9fffc-3a1b-46db-839b-d6827a1132fe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "45f7e6f2-9dac-4065-a6b7-808c8bdcdf4a", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "36328267-ede6-44b1-89ed-ff5b8b617e9f", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.153 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eb72028d-4adc-46f5-97aa-0f9b69c7444d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "528724dd-b8b5-44a8-9afe-5bfd499817ee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "bc2a0d0b-7dc9-44fa-86b7-5d537278b58a", + "MeterName": "Standard S1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 1.21 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "36621ddf-4735-4e55-8e5f-4aff4bc4c5da", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "68767751-9341-457d-bc07-5ea592845630", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "829db521-5386-4636-8c73-3a201f3d2caa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.68 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ad68bd08-de63-4661-9bb3-e0a97659e0eb", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "cd62efa3-2376-475e-bd53-2b5a3b6a1f86", + "MeterName": "Basic Large App Service Hours", + "MeterRates": { + "0": 0.376 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "986ad515-d734-4f1a-8d26-609e702b21b3", + "MeterName": "Standard C2 (Hours)", + "MeterRates": { + "0": 0.281 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "875ad816-ee36-4d5c-93f2-0fc491f77f65", + "MeterName": "Premium Small App Service Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "22abbd77-2f3c-4f5a-ab10-6a6e10d5aa77", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.292 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "0a1aabbe-5b75-4b5f-8e78-546f81ecbe02", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2a8f5aeb-d518-4417-a262-f168e3204a84", + "MeterName": "Premium P6 Database Days", + "MeterRates": { + "0": 120.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dd0806e8-f939-4d62-ba85-d96af76c70eb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f6522325-5263-4a7f-a8c3-0c0d127da4dd", + "MeterName": "DWU", + "MeterRates": { + "0": 2.0565 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ac2eff34-302a-446c-95b1-e10b5ea3eb16", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.22 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ba492db8-6622-4b63-bfeb-2538f3118115", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d125d1b4-389b-4787-af60-ce24321c994e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.912 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "877caf6c-9e1b-4e84-ba14-b379c7ababa3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.068 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4446d13c-a367-4d53-9297-b6000bb40d34", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "854ead60-2964-42d7-ba40-03248e21fcb8", + "MeterName": "Standard IO - Page Blob Write Operation Units - Free (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0bbff7cd-6ca0-4961-aff5-53a7cb57841a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.097 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "e3c2436b-90a4-4c13-846e-031e650ca09a", + "MeterName": "Standard S4 (Units)", + "MeterRates": { + "0": 2700.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Search APIs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6a756189-bcca-4675-b175-7a1e5ed1a951", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "1328d5dd-6f02-4c37-a972-dc4232340f53", + "MeterName": "Standard C4 (Hours)", + "MeterRates": { + "0": 0.656 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9ad17ce8-836c-4c58-99d0-f0b599aea449", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.052 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "8b9422d3-7c2d-4a16-8732-91eb7d1abdd7", + "MeterName": "Premium P3 (Hours)", + "MeterRates": { + "0": 2.219 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5a75190a-483c-4740-a439-8ed28839e11e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.663 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e326f0f7-e9c7-4ece-8fb1-c85cd05021eb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "16c0c4dc-bc13-43b4-a965-686543a0bb06", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "565e447d-3702-4ffa-b080-77140138b8e4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "41e1b0d2-1634-4e90-a79f-7faef1774ee9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.073 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Batch", + "MeterId": "0870cd14-62d2-4763-8c44-6667ee8b6251", + "MeterName": "General Purpose Batch Instance Compute Hours", + "MeterRates": { + "0": 0.0075 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Batch", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "af1945e6-29e7-4ce3-98ca-199c00ae71b8", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.161 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c294fc29-5f06-4c9b-8d61-f81c6de58279", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.408 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "689c2a0f-63a3-49e8-b8d5-e7bfac1fc877", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b2745f89-eb16-4c4f-808e-6c9d273b76ca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.646 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4b1c71bf-a2aa-4113-8eb7-bcf182f3eae3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.52 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b2bed43e-c448-4cd6-91fc-6b020db334f8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.399 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "35247363-1056-467d-ab3f-be92ae05cdae", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.68 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1571549f-953a-4e7d-9ff1-ef5de63be9d3", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.017 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ce89cb38-e808-4965-b0fd-44a4a0b40edb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.029 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bcada5c7-4787-4fc3-b5c7-66e5822749d0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4edd8991-1e58-4854-ae70-0825bd0eda49", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.353 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "63918874-b2ec-4926-8f8c-4c404d384703", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.741 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "16ba31dd-3374-41ee-97af-6b525090a41e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Security Center", + "MeterId": "3fb05390-ab59-4f14-a55f-2408834816bf", + "MeterName": "Free Nodes", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Nodes" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5de9a315-9f6d-4b43-8cbe-4f6c569ddacf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard and Weblogic Server Standard (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6d4f77ad-9332-447f-a378-ba55830b0cb8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.276 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "243756a4-8935-4ed5-b7e2-9d3e84fc5f5d", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c504a18a-223c-4b53-a7db-a1e6ed43a5ac", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard and Weblogic Server Standard (20 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "69f20fda-55c3-4dfd-8dc9-7a2491df14ec", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.352 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "aa057281-ad43-433b-ad5e-1c64f49f2305", + "MeterName": "Premium P1 Database Days", + "MeterRates": { + "0": 15.6 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e9661e43-c9ad-424c-a71f-a67c5723d072", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.61 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "37efc94d-87bb-4441-a90c-018de5a4adce", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.312 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "19f49805-f47d-4591-bf60-5c36e7aa6fef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.296 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9d9f8202-39ba-45ac-bd74-fd6f190e88c2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.611 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1da67640-b1b5-4870-90f6-2edc97713d61", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 135.17 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "6e31686e-caea-4b84-8f76-c121282ee710", + "MeterName": "Premium Medium App Service Hours", + "MeterRates": { + "0": 0.708 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "691b7ea6-cb5d-4a1d-ac05-769d92c7b3ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.86 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "50a17455-380d-445e-b41e-483995164998", + "MeterName": "10,000-AU-hours Commitment Tier", + "MeterRates": { + "0": 209.68 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Analytics", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2d5e0769-0c30-471d-a7fd-1031dd8beac5", + "MeterName": "Premium P1 Secondary Geo Database Days", + "MeterRates": { + "0": 12.375 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "67d6a019-8ef6-4aaf-95f6-bc722c3a264d", + "MeterName": "Standard Medium App Service Hours", + "MeterRates": { + "0": 0.252 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "24c5cf90-d3e1-472e-a2f5-1d731a764d49", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.21 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "165847e6-ea7c-44d9-a5b5-49f0dd8517c0", + "MeterName": "Premium P18 Secondary Geo Database Days", + "MeterRates": { + "0": 374.99 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8e44e311-c7b1-41cd-a4be-33b6b267ceb3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.374 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "78e135cc-7730-4601-90e4-3b3a1d0cdb42", + "MeterName": "Standard S2 Database Days", + "MeterRates": { + "0": 2.74 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a698923a-8fb0-4d81-b0d6-1a132960d773", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 80.54 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "308f1f90-6cda-4052-be7c-edf767865911", + "MeterName": "Standard S4 Secondary Database Days", + "MeterRates": { + "0": 8.821 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cecffc94-889f-4475-b62f-9ec980c406f7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.385 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6904fce2-285e-4954-8304-267679241611", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f2fe5009-4559-48d8-884a-0e1e6383d445", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.707 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3e9f7c8f-83a3-4d25-b76c-ce5e8050e2e6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.509 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "c9624bc0-64c0-4161-83da-d19aeb612193", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.288 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "OpenLogic (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f6030dbd-ecf8-4535-a6dd-bdcd32719b01", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.374 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b48f5fa0-bf89-484f-85d9-2f24af7f0a16", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.894 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ca5639dc-abfa-4d39-b44c-060115dad0dc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "39bb4c69-c2a8-401d-93a3-d84820c64d1b", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2c0f1caf-9489-42f4-b06b-589a573b99ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8d8927b5-227d-4c9c-a866-79263328300c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.099 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "51cccd3e-d8da-4ce8-bc9d-79c8d5b74a26", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.22 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "69f4316b-dce1-4e6e-9fda-424f3fdb442e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.168 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "54929499-594e-464d-ae7a-620f1460c1bf", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5268c28f-bd7a-4c14-95c3-23508e887e08", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.42 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b571e7bd-d995-4c11-a953-b7bc14a00838", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.928 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1015c7e1-903e-49e0-84e8-fdac8d661272", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "52cda397-f889-4dad-a069-0d8be331a3ba", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "45e4c563-10e3-43b4-a904-4c4f6334bc14", + "MeterName": "MSFT Peering Metered Data 200 Mbps", + "MeterRates": { + "0": 145.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8e889735-ed7b-4237-83f9-af2fdfec4207", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.43 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b9de203c-1a3c-4221-ac18-81a0406dd5b6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.442 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a92705f3-7503-4019-b01c-7faf74660231", + "MeterName": "Premium P2 Database Days", + "MeterRates": { + "0": 34.32 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7e8fffd5-6f1e-470f-bcf2-67f4e9782a20", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e2281ce8-9d24-4c66-bbc5-23691e23739e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.292 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7527f53d-bb6b-4f9a-81f1-04f4859b93e7", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "78ce6262-3e65-4a91-a221-69ce6f81258e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.133 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "de368bc8-e087-4656-b5e1-080d8e209efb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f42006e0-2f30-455a-961e-b675370c8be4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "10a91d0b-4e71-447e-9426-9de0791dc36c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.271 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f8579873-2b77-4558-bd16-fff6e17df977", + "MeterName": "Premium P6 Secondary Active Geo Database Days", + "MeterRates": { + "0": 135.61 + }, + "MeterRegion": "JA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7e266189-fb95-4615-af5b-126a00e78714", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Weblogic Server Standard (16 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ef1ca3ad-d5b5-4953-a1f1-fa94a0d150f9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.185 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4cfddfa1-0272-45f1-a206-85eefd9e2524", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.034 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-03-12T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e22e4189-b955-473e-809b-466b82aa2296", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.28 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Java Development Environment (16 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f3aa3d64-d8e2-47ae-a6de-e527ac26d856", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.646 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "33b7e428-9425-4c48-904c-893c3c53d7f4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5a559e39-54f3-4d68-bb80-376cc16e8153", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.43 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d283d23b-5487-4376-8ff0-fa1c11e8d81b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.912 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "54e35db8-e5c4-479e-98e4-78733b5156cb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.81 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "8d6ce3f1-3782-4ba4-b128-4b10654b345d", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0784 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "af8fb567-03c7-40c2-a169-d59256341eff", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.026 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "edc0c2dd-4576-4278-8782-a4babcbeab89", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.937 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b4eea7a7-fb21-4ebf-bec2-a294a98bbf5a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.087 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3f826cbc-f4c8-4cf6-9094-6c00964552c5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.749 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "981a12bc-2bbd-421d-bfe0-23661de69956", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.713 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "de1f6405-aa90-4728-bce3-86db59c25e69", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.875 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "21aee331-33c9-4b08-ae23-1f1dc2512296", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.163 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "02cdef9d-9289-40b3-aca8-15c7ffa905d4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.61 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4f48803a-f781-4d04-b644-a272ff8d68de", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.196 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a04a48b2-1abc-455f-afa1-aa337b1f215a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c929623c-629e-46e0-94fe-94852b021477", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.159 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2212a17c-20de-4e7a-8544-a91e80961231", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.056 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "46bdf0f3-5a8d-47c5-89c0-45defaa6248c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.474 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b5655643-0b84-4f0f-a813-0873d9a889e6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Xbox LIVE Game Services", + "MeterId": "875c1038-f568-446c-8e44-a7a60dc4deb3", + "MeterName": "Data Transfer Out (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "872e99f3-75c3-464f-b307-7a0f2e163758", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7773e37e-6883-47ab-acf3-33cfad7cb56b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.226 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "86b5b0b4-3c19-4720-82e9-874f8c58b48e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Red Hat Enterprise Linux (16 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ca4422fb-2d41-4004-81ce-6ecc99f75a18", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b8e5192e-e4a3-4933-913d-ba45913af932", + "MeterName": "Premium P13 Secondary Active Geo Database Days", + "MeterRates": { + "0": 335.48 + }, + "MeterRegion": "IN South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "5c33b840-166c-4ef2-a2d9-49fa9f9d456f", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A10 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Automation and Control", + "MeterId": "6d63a798-4f02-45b7-9a47-6b4c2ff43585", + "MeterName": "Paid Nodes (Node)", + "MeterRates": { + "0": 10.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "OMS Automation and Control", + "MeterTags": [], + "Unit": "1 Node" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 5.0, + "MeterCategory": "Service Bus", + "MeterId": "0d6714cd-bc0a-4511-9f39-37c5e91004bf", + "MeterName": "Data Transfer", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Hybrid Connections", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dc9f027c-f62d-4dd1-8241-068bd095dadb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "51261d37-962a-4519-98da-5d83f5e7ef34", + "MeterName": "Premium Unlimited Data - 10 Gbps", + "MeterRates": { + "0": 85000.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d0b97e12-383c-42a5-8250-8ba7b82815c3", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "f180ce13-b916-435a-b4c9-eb4388c43326", + "MeterName": "Basic Medium App Service Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e42c7901-ffbc-4c71-b5aa-e1244f6c12ec", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.097 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "49cc01ae-30f5-4ae1-8744-8bf8a854826d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.038 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4ebbc07c-5da8-401e-b8e1-6e26480ff76e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.138 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "09592c73-5c6f-44cd-b9be-c51f0e0271ac", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "02adc04a-ffe6-47be-96da-a572cbaa7eed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2a689b43-a7b6-4a65-8656-8e3c6c4420a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.091 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "37c72241-b376-41b8-9272-a4247e09e9c6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5bfa21e1-78d2-4965-b290-f76c652b0709", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "238b96fb-076b-4706-a7d1-d4d95928fb06", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.145 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "9f1d9ff8-fff6-428d-9762-22d61aaa4bce", + "MeterName": "Standard IO - Page Blob Write Operation Units - Free (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "df71375a-2306-4c01-9469-2a15a2c69619", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.357 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "2e60d458-756e-41a6-8747-8b3f7eff2c62", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "134ac923-dbb1-47dd-9609-7c2a72013248", + "MeterName": "S3 (Units)", + "MeterRates": { + "0": 8000.0 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3184ad7a-bed8-4f16-8a69-3a7d27bddbe2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.748 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "61ed2dd3-1337-44d5-a6bc-4d28fda02374", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.073 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "593d1a2a-2304-495d-b16a-d9e3ed0d01ea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3e4d46c5-a424-408f-a0f0-179d99f47ab6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle WebLogic Server Enterprise (1 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cac16264-cc98-4298-ad94-1627a4d4e937", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.169 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7295c70f-0ce0-4b8e-8c2c-3a459bcd6078", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fb10b00e-2d64-465c-a6c1-91bad8ba7a45", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.639 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "6a99015c-d33f-4f46-ae59-2e4d14091aa8", + "MeterName": "Standard IO - File Protocol Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.0015 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "adae4dad-1bcb-4bab-b3c5-902835c189ee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.106 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "b35b5025-28c3-483b-b2e4-66c604cf65b9", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "affdd639-678e-40b8-8b49-496596db82d9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5b78f2d3-3c78-4333-b6a8-7e2233433a0b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d129fa86-7cb2-403b-97e5-33cd4756ddd2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.42 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "89d865e9-61c5-4106-8b61-5043a370fe7f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dc038b0d-fe0c-4f37-830e-124f7dd098c9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b9d5bd75-bbbb-44a8-bb5f-27253a42c04b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.242 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3292ab2d-0267-4e48-8941-6b8a8ba70fb6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.65 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "1433d549-c4c3-4870-80f7-be531cca57a9", + "MeterName": "Overage Unit Hours", + "MeterRates": { + "0": 1.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Analytics", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dcea4d56-21fa-4d36-841c-ce3ad281986d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 11.1 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7b98b4fb-c447-40ec-bf3f-bf2413724dd1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "870bcbb1-48c9-49ec-9afb-5bc7ebc8cbcb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.4 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Standard (24 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2b6e2b70-6282-4faa-8e96-8318e157c7e7", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.0088 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "548022e1-db63-4868-a666-a201e0101e52", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 50000.0, + "MeterCategory": "Identity", + "MeterId": "9bc249d6-7af9-4237-bd4d-251c324f9e51", + "MeterName": "Basic Authentications", + "MeterRates": { + "0": 0.0028 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Active Directory B2C", + "MeterTags": [], + "Unit": "Authentications" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e2650bb4-bcfb-4a70-a956-d8e060e3810f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "694c093f-6d19-478e-bbf8-f216b85cff32", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.75 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "21d8965b-6c10-4f7b-b091-87509f1ab7ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e880f6b6-82de-479c-a51a-29fbe9b1b906", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.808 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "740bac0f-0db5-4b89-b8af-270bacc2c8da", + "MeterName": "Inter VNET Data Transfer Out (GB)", + "MeterRates": { + "0": 0.035 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "Virtual Network", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "5aa1a995-b25f-43f7-8b28-3d6fc75676b3", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3b70e521-317b-47a1-a42e-86f9561773d1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "ef5d838f-bed0-4e72-8fb2-ec32d6a715f1", + "MeterName": "Premium Large App Service Hours", + "MeterRates": { + "0": 1.2 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "831d2949-4078-4ea9-addc-713e2b19229e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.246 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2672a5f1-fcc3-4449-9d56-5ec7453312bb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.488 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0f27f4a9-457b-4c6b-acf7-6df344baa25f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.133 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ee78da9c-8d8f-4cba-a0ab-c80c01112439", + "MeterName": "Basic Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.201 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c90b8f68-2874-44d0-b237-bae9dc89c4a6", + "MeterName": "Standard Managed Disk/S4 (Units)", + "MeterRates": { + "0": 0.845 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0d41ec57-1343-4db7-a767-8fbf10732e0d", + "MeterName": "Premium P11 Secondary Active Geo Database Days", + "MeterRates": { + "0": 282.263 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d16382c4-5224-4902-ba23-285406f4f86a", + "MeterName": "Standard S2 Secondary Database Days", + "MeterRates": { + "0": 2.0 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "da36fb87-578c-4452-b575-af4aa66cca50", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.091 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6ad6e8e9-d9e1-4a76-b6b1-de3f67f4055d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.126 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "52805b9b-5d2d-46e3-a8f9-36ca8191d4bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "577590c2-9ff2-4226-95e1-3cfbe3bb876c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.705 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c1c33d95-5343-4aa1-bddb-cda66850d07a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.112 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "80d2459f-0e26-46c7-9d9a-28f65543951a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.752 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "03da3a30-7d9b-4a97-a2cd-bdd130811d16", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.547 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "a8e5826f-0b33-4241-8ceb-6e94e10994bf", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a95d15d5-c22c-4aa4-b576-db9219511f55", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.926 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1b8ca1b2-f159-484a-af5a-a2c40b7f8e87", + "MeterName": "Standard S1 Database Days", + "MeterRates": { + "0": 1.0645 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "09b8662f-bc53-480a-827f-2ae6a9f637a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.593 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "048b1881-e3ab-4325-9e2b-b754401c2636", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.933 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1dd33da8-e927-4f68-bdaf-3aac8c2be2af", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.246 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0316ed20-88c9-4ca5-8168-4f4050f00995", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e9335837-382b-41ef-8f40-e5453c6923e9", + "MeterName": "Premium P6 Database Days", + "MeterRates": { + "0": 135.6 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "736d4e73-38cd-44dc-8208-d7de20671a12", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MSFT R Server for Linux (16 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6460fee7-8d53-4faa-89fb-4b3838edf3c3", + "MeterName": "Standard Elastic DTU Pack", + "MeterRates": { + "0": 0.082 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f95ee4fd-f655-42b1-9e24-a465a67fd1c8", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "64c30011-6bf8-4e07-9baa-17b63bb28eeb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.444 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "10b97fb2-5db4-4ad2-a4e0-69b858d6b52d", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b03000d4-bc4c-41e8-ba67-76ddf8628e53", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.25 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "G1 SQL Server DW VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f8119c58-2895-438a-96fd-cdbea940d4d4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.147 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9a54f10d-e244-4dfd-b582-41d3f400eb31", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "eccaf38d-9f1c-43b7-97b6-2d91b2ea70e2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "27a1a289-da6a-42b5-88e1-814b002f8f19", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.99 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "23590be0-0f19-48f8-93f7-7090bd160f50", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.794 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3e41f77f-2d9e-4c49-bede-43c0fec13dba", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.749 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6153d9f9-4fdc-4234-8add-459c8b05ba84", + "MeterName": "Standard S1 Search Hour", + "MeterRates": { + "0": 0.444 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "72ce177b-8b79-4bc6-82a4-c914e7de18ca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.65 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "48284f63-9f0a-4eb5-aeb1-7e4c3594e366", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "23a287ff-d9c2-47b9-bbe9-16919a975c19", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7e419ac4-8d7b-468a-9f14-4da5289d7770", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "be4ec9be-31bb-4de4-acc0-599e89eef9b9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "64a56cb6-0da6-48e0-849e-934c45fdde83", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "913f67d4-3439-4de9-8016-bcb4ecf399b7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.692 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a3993af2-fbc8-4106-a255-8e61cf37c106", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5f0c87bb-98c1-4660-983f-7fa94f81a20a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.563 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cdb7f481-a416-412c-870c-eec3869f60c4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.133 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "295de551-a288-4246-accf-713c452b97cf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.104 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9be411a9-d884-4ee7-92b5-2e6a177b47c7", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e872122a-c8e4-40c9-bb60-1a862ada23a8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.114 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1f31ccc7-9360-47ec-983b-f4c7e8787aaf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "e5b4772e-90c2-44e5-b2cc-85e4cf890f75", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "39f6bb2f-c05d-486d-85c2-7235c902aa68", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.394 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7d7bff9c-fee9-47e6-82e4-544eaf328034", + "MeterName": "Premium P4 Secondary Geo Database Days", + "MeterRates": { + "0": 50.94 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e9af043a-39d8-4d66-8d04-f4071430fd7d", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.134 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "bd868b15-d9b5-454e-9d4c-63ec3e409f1a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "ed336fb3-a538-43c0-bb46-cefa2ad53b8e", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.032 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "906f5413-d2cd-4035-b54d-6f2622d5a0be", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "97ecb465-b05a-49b3-8c72-b0455788b7ca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.658 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "bb5b2483-4a4c-46df-a145-b1a4b13fb74c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A10 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f03ee233-e99b-4f12-be9a-b35636be9b41", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.592 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5698535c-5b69-4896-ba4c-32eb98733f7f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.129 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "bb1e4357-53f2-4a98-9f16-38b08759c3a6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.822 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3da3a020-24fd-409a-a2c9-1a87bedfc2d7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9c0616f2-f092-420c-acbe-75b6bc890c44", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.062 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "002c6284-d241-46ab-8f7e-b4c4a1b91622", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.134 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4abb5b37-7a0a-43cc-98e1-85440f44beb9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0d505678-5a12-46fb-88cd-d37f76c6b63a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.186 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "143ad8b8-6d8b-433d-9cf2-7dc7b5c90c71", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.646 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fb4fd05e-9a05-4288-ba9e-23b4438548de", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0c09b186-a40f-4f4e-846a-da0b8b1b3802", + "MeterName": "Premium P15 Secondary Active Geo Database Days", + "MeterRates": { + "0": 567.7408 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4ef05524-d3be-4819-b1c0-14b58cc74760", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.625 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "18340836-d5ad-46ff-8474-024af00cfecd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.983 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "96788af6-5916-4792-9a5d-9186ec2556bf", + "MeterName": "AES Keys (in 100s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "100 Keys" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "846a8779-1ec8-48bb-acaa-d75d065d985a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8846dcaf-15c3-45cb-ad42-77542ca68b50", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.973 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8663c2cb-f022-4a88-8c54-559ecbbfc6e9", + "MeterName": "Premium P4 Secondary Active Geo Database Days", + "MeterRates": { + "0": 75.0 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3e470f60-a266-40e2-b9ec-26df83a15b28", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a5ae723f-71ad-4eed-a5b7-935361657e9d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6fab8858-5671-40ce-ab97-260c6ad9b994", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a5cf8844-b8f9-489a-b6df-983a4bab1086", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "21d907f2-ec6c-453a-a323-fae5c59fa48b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.759 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "5f20fd9a-0f9c-45ad-b70d-9b768ad6134d", + "MeterName": "Premium Extra Large App Service Hours", + "MeterRates": { + "0": 2.832 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "085f851d-315a-484b-b960-00a177f25c8e", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "a297e6d5-2ab7-4ed6-ae88-401af0d46918", + "MeterName": "Widevine Licenses (in 100s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "100 Licenses" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9965db18-3744-430d-817d-28b9ff3f7b47", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.975 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "94580fa9-720a-4c3b-8c86-8a3cd4ad4719", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.311 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "538045a5-7281-477c-b20d-112f92954a07", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "014a710e-54b6-44a9-b0b7-184f825e3544", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c5d14af5-ec9d-466c-b6a6-0e0a33ececf7", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.033 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "84e34020-353a-4723-85bb-8b2404107eef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.337 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4cb019c8-a86f-4212-8c16-a034faeb2934", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.255 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1e773d6e-1761-469b-a600-259c32d0f51d", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.0792 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fa2317a8-0dcf-483a-867c-85deea7032a7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.672 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9b075707-7e5a-4450-b506-30e0af826555", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.144 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "dff42d4a-951b-411e-8e53-a84cf76709f8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.781 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "524af1ac-c01d-483f-aa42-01263bdd19ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.292 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6f659498-ae97-46d8-b7c9-cc09a65747ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.483 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "dc1a0775-d032-4115-bfb2-289fd833949c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.175 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "50861a83-2ad2-4e0d-9871-41d712cebb37", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "174204f5-c929-422a-a36f-e82a07399940", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "05d8cdf9-3a31-49a1-aa63-fe4d01c686dd", + "MeterName": "Basic Elastic DTU Pack", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "63058f66-9e9d-4c24-9d4f-3fb6078c734b", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.1045 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "b222e90d-2ab5-49a8-a74e-5d505474dc8e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.77 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "383eaccc-acd9-49c5-b78d-47aa1ddfe114", + "MeterName": "Standard S0 Secondary Database Days", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "a25b9738-c7eb-4208-a8d9-91753f40bcdf", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3584 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8ddc1c2b-9d6b-4dba-b486-ddb2939b9887", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.121 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "21552936-235a-4ad8-979b-69f6412e2843", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.76 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fdbd06df-4e9f-4ddd-8611-46d12e773525", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.112 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "60eacc21-c03e-4501-bc2a-bcdf228f60b1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.42 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "efdb48e1-6e65-4d8a-ba65-f7b6a04d05ee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.128 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "2027a817-1028-4985-b30e-1f3a04930416", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d01174fe-3968-46a4-b62a-572550530e33", + "MeterName": "DWU", + "MeterRates": { + "0": 1.6633 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7672c3e1-4e2a-415a-a316-44697ba494af", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.259 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "adc4e0b6-6550-4fc7-a589-6515af9c59a4", + "MeterName": "Premium P11 Secondary Geo Database Days", + "MeterRates": { + "0": 211.7 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2ecc7597-9a40-4311-a91e-1930499aa6c6", + "MeterName": "Basic Elastic DTU Pack", + "MeterRates": { + "0": 0.0548 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "c222aaad-992b-41a6-bb37-237606580565", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "40aeba39-7196-4aab-aaa2-343f077fdb56", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "08e97539-3734-498f-8e1f-e6c00ad4f227", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.674 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1596304b-01c1-48d5-866d-b1e67d5244c8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d18954a2-31b7-4582-ba7b-fd469a9e9817", + "MeterName": "Premium P1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 16.52 + }, + "MeterRegion": "AU East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a1bfe8eb-1e3e-48d1-bc14-5ecdf0c54d86", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.091 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "358f3f9b-bb36-471e-987f-27147df67fc1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0fb708ff-6638-4d65-a800-9f26a96e3752", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0832 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b1f3c5d7-5a7e-4494-ba42-99956c93a282", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.376 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c897153d-45d0-41f7-956b-e16d8a04ab57", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.32 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "33427e34-0748-4bde-9328-23bf3338af87", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.228 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "14e91b79-e419-4a30-9eed-daedf7b5b35c", + "MeterName": "Premium P18 Database Days", + "MeterRates": { + "0": 496.7732 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e019d2d7-395f-489f-944d-75297c8eaf22", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.067 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "97fa1a94-4e78-4580-9e27-f9878c4b7c83", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.067 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "3c5657c6-28c7-49f0-9456-9a165161954d", + "MeterName": "Operations (in 1,000,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Messaging", + "MeterTags": [], + "Unit": "1,000,000s" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "198586a6-04e3-4da8-ac62-f9b84fa99939", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.741 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "83d33c69-c5d3-4f47-97e1-d8ce13a17c07", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.138 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "61bf355f-0d08-480b-afcf-2d6e81777e15", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "91d88291-dc9a-46a3-80fd-2bec367aaaeb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.78 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "121219c8-4963-475a-b861-2cfe6667b9c2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.306 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "117e8907-889c-4ccd-b1f8-b708a3070b39", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.063 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "88deeec2-3f99-482b-b75c-6b6b445ed886", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.114 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "2a402785-cf3c-4911-aba4-1e280a892d96", + "MeterName": "Metered Data - 2 Gbps", + "MeterRates": { + "0": 872.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b92dc7a2-b467-4b5c-b880-6776416d7a4b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.258 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b72c99cc-65a6-4e96-9ade-88af0d90fec9", + "MeterName": "Premium P15 Secondary Active Geo Database Days", + "MeterRates": { + "0": 516.128 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8d8a60e9-c822-4356-bc42-018d1dc6c893", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.73 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV12 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "66f5ed1b-089b-446f-ac52-2c165223b0e3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.6 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Java Development Environment (20 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d495dd96-e6f1-4c88-948b-75ed69280435", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.013 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f7499985-5b63-483a-87c1-e9659afc1727", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.384 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2d4e4a27-738b-4f18-a7e3-cff7f4320aa1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "308cc02a-5f6f-46cf-837e-a91c35cac45e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.853 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "642ae1de-9bbb-4519-800f-5c59776d7c88", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c5a6ddb8-eb3f-4e42-883e-d2f48880ca14", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b167c343-39bf-43ec-90a6-e4e1b294c173", + "MeterName": "Standard S3 Secondary Database Days", + "MeterRates": { + "0": 4.0177 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "0cec7211-b92c-4bb6-9006-970f578871fe", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.084 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a8083fe0-a4b7-472f-a622-1b6abb1d7dd5", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 67.59 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0b8d746a-034b-42bc-affa-4cc1cf11bed1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.098 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "15e65e45-c594-44d2-8e6b-daceac905e80", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.405 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c7d94231-9fb9-4958-9ec1-b37b2849cd62", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.698 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e9573bfe-82a6-4e23-b5f9-f1f8d7c715cf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.103 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1cc42fd4-699b-4ae6-841f-c7d3501465cd", + "MeterName": "Standard S2 Database Days", + "MeterRates": { + "0": 2.74 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3e510eca-ac9b-4d5c-a470-e6ac215a4252", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.222 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "bcd933e5-a830-4eb2-8b16-17f996003680", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "acca85ae-a728-4db8-bdf5-713548957bf2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.262 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2dc65bfe-ea3a-4783-b51a-a6503c7a9559", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.673 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2be0c8a0-cecb-4601-bf05-5bad3b63d132", + "MeterName": "Standard S3 Search Hour", + "MeterRates": { + "0": 3.2 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "15b7ec1e-eae4-414c-bf11-a9f1dc094fd0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.886 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c2d0eb2a-4dce-4a55-abc5-1222c87f8e35", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.106 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "d23b222d-e065-4aa9-8d5e-8c3990b4b0f7", + "MeterName": "Standard C0 (Hours)", + "MeterRates": { + "0": 0.055 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "4e8eeba2-1991-4d33-b101-b5cb1a18673e", + "MeterName": "Premium Small App Service Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e41c0dc6-9337-49a0-88a8-68df68c0b6b5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "01caecf8-c1e4-4885-8c13-3292721482fe", + "MeterName": "Basic Small App Service Hours", + "MeterRates": { + "0": 0.0915 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a07aea46-15ab-4d22-86b4-0f4e31417117", + "MeterName": "Premium P4 Secondary Geo Database Days", + "MeterRates": { + "0": 56.25 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1dd5c10b-82db-4ea7-9000-3385738203dd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2696 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-05-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "6fe6a770-9d2b-45ba-b76d-1b18c4b6eebf", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e2760555-159e-4844-8e0b-2a8128a0b612", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.496 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "434308ca-da80-4c33-be2f-df5973a85f91", + "MeterName": "Basic Small App Service Hours", + "MeterRates": { + "0": 0.094 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "84a3863f-955f-410f-8f0a-eee53a49143b", + "MeterName": "Standard S0 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.5033 + }, + "MeterRegion": "IN South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "ea4a8814-d834-4c27-8962-e515d6a14bfd", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c3f95eed-a26b-4411-86a7-48e3c1b9133c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.75 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "0734f87d-a262-4386-b4b0-e3bf1e5637ed", + "MeterName": "Premium Metered Data - 100 Mbps", + "MeterRates": { + "0": 275.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "fc0cbc14-ecd8-4f56-9483-5c15eeb54599", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.191 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "72d57d4e-5857-4844-9ecd-b55f0cbceb3e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.242 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8d15c793-e4d4-4d94-a3e5-a51356c8cdb5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.226 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5706c62a-a842-422c-ae83-ade4cb723f3c", + "MeterName": "Standard S4 Secondary Database Days", + "MeterRates": { + "0": 7.9839 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "be6da937-39de-4de2-a735-d6b63d5d64b8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.312 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ff39f4c3-d935-460c-a1a4-a4937d202bb3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.645 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "7e32ad83-9839-46c5-9d90-19399bbab832", + "MeterName": "Premium Unlimited Data - 1 Gbps", + "MeterRates": { + "0": 6450.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "65bd8e92-a37b-4f4b-8541-a2d8d60d3463", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "96c7a88b-71a2-4617-9824-9344fc9864d3", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.129 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1630dbad-d46a-448f-93e4-99e6c011b603", + "MeterName": "Premium P2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 36.29 + }, + "MeterRegion": "BR South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "a902daa7-3449-49d0-8299-1f28c6476ea6", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "c0f5cb45-6fb1-41c9-8545-72ad400d9da4", + "MeterName": "Free App Service", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Apps" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d100befb-3816-47b2-9685-748deaa8cf9b", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "168dc3e1-2c1a-40c6-85b7-a0473ad5801a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a4daffb4-96f4-4fc5-b1e6-fd3a2cf3595e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Red Hat Enterprise Linux (12 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "5221381a-b229-41f9-98c0-11021a3227b0", + "MeterName": "Premium Extra Large App Service Hours", + "MeterRates": { + "0": 2.544 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f4e24103-a699-428a-9292-e0ec5e5954a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.043 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "ffda6d02-d461-4844-85a8-c621f7cdeed2", + "MeterName": "Basic Large App Service Hours", + "MeterRates": { + "0": 0.375 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "41149d9f-a473-4349-94f5-3af6b2aba106", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.034 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2c69eb35-4958-4c6b-b4cc-00e32199ac13", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.5 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8m VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b2482850-4201-4948-a0b6-c60a0cb5ea6b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.182 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "555f9d0b-d8ee-495a-8095-d849adfb9185", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.236 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "239dcfa7-e1e8-4ee4-bbd7-d91febf6fb9e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.78 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "9e48e5f3-a682-40fc-8d8b-dea08257d3df", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A7 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "a281365b-db97-4025-aa0f-380b14d98384", + "MeterName": "Standard Medium Azure App Service Hours", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1a5fcde5-b828-423d-b1f1-1ce5f358d119", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.648 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5b056dd5-4e11-4b04-8f7c-c8f0534823bc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "be54b003-d5e2-42ed-b929-df343b52a725", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.835 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a4744286-09f0-412f-8f7a-003cd4ed1d65", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.376 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "96257250-5558-41bc-8eba-66a40939d305", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.77 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "3e44fa2a-dd0e-4e61-86a3-ba9a36e19b46", + "MeterName": "MSFT Peering Metered Data 500 Mbps", + "MeterRates": { + "0": 290.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "28c5033d-2d97-4349-8d32-c24d40c764c2", + "MeterName": "100-AU-hours Commitment Tier", + "MeterRates": { + "0": 3.23 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Analytics", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f761c02f-1767-4b3c-b1d2-accf33c0c332", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.36 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "G4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "c12cb4fa-c6cf-4972-98c0-eb65115d669d", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c90d9636-9fe2-415a-abe1-4456bbbc84fb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7733ea4d-4f23-4211-87b2-54eccc99bb78", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.308 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "05c21a8b-3f84-4579-b799-f9fc9d23d6d8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.242 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "be895fd9-7157-4093-b027-14505c1d23ae", + "MeterName": "Standard C5 (Hours)", + "MeterRates": { + "0": 1.313 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ea929c1a-ac3a-428a-be0a-b1eb8bef107d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.063 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2d7c9447-657f-4d93-8c0e-216b04860f70", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.218 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "134280bc-d982-423a-9061-bc3c289c5d6d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.459 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "34b1ff9d-ff18-4e62-af3f-9c63b26a4978", + "MeterName": "Premium Elastic DTU Pack", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "b4984cd1-6af5-414d-825e-73950591bf9e", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.972 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A11 OpenLogic", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "077a07bb-20f8-4bc6-b596-ab7211a1e247", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Red Hat Enterprise Linux (2 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "15e0681c-188b-4c94-af53-1edfd1eae0e1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "0984b7ed-975f-4dd1-8ba1-db05b74796d1", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "159d10d0-844e-470c-906d-3b4a394f1049", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.168 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9743abf5-55ee-432f-8799-60d975d11121", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9c85e76a-3fd7-41b2-af8e-7b1586822481", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.156 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2b5301db-cace-4548-89e2-321c35a3f796", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.229 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f0076a96-54c4-4254-9a42-a56fa2c086f5", + "MeterName": "Premium P2 Secondary Geo Database Days", + "MeterRates": { + "0": 22.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "af3fdf26-861d-46c2-aab5-c9c5c05dc4de", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8f80e861-a0df-4ab9-8218-876cedc26e48", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d2bf5530-dfa6-4ea1-bfd7-0c889b9ba21d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8d5c083a-5e43-44e2-80a8-6856e81ff10e", + "MeterName": "Standard Managed Disk/S6 (Units)", + "MeterRates": { + "0": 1.654 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7fee4018-c73d-4765-9c46-98b2b9b57b16", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "69dc9346-92fd-4e55-9a0b-a1139cc02b36", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e5d42d36-8381-46bf-8889-e98c2d385ceb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "9fded82f-7574-47b6-bd46-36f4e55056f8", + "MeterName": "Metered Data - 2 Gbps", + "MeterRates": { + "0": 872.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7bb740ef-1460-4ff7-b26e-57e98218dbe9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.31 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1ad63626-a5cb-4a61-8bb6-d80c6876a9fa", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 79.872 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1b13e0e9-cb9a-4e48-8974-afc03809b962", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.47 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e937e543-36e1-4de5-ab64-b13d76e327a2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "741080b5-e0d6-4058-b620-1f103917aa97", + "MeterName": "Premium P2 (Hours)", + "MeterRates": { + "0": 1.443 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "61dca758-9105-47c8-8050-bc2ea5c3fcfd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "569cb4a6-dde3-404a-9804-4f2db0e14efb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.367 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "ae64446c-5ad8-45da-9a2e-703b0e9abc79", + "MeterName": "Standard IO - Block Blob Read Operation Units - Free (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "06f0e2d5-bf8c-42a1-986b-4d189002b46f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.983 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "768ff130-a8a1-49c1-9506-fe3fe5b29051", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.133 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3389f896-417e-4b75-888f-c5717b16b243", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "78d803eb-52b2-49d2-8534-c83303d4c453", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.44 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2796765e-d53f-48b6-8063-6f24447691a4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.411 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "574e8c3f-fa18-48b8-86fd-50a9fcdf4b7c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.054 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9aade493-c427-498b-80f5-0724884166d5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.033 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "95cd9c70-2d61-44f3-8009-b8b103fd6ee0", + "MeterName": "Standard S0 Secondary Database Days", + "MeterRates": { + "0": 0.4015 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c2a5715f-92e4-497b-82be-b0d33637120c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "c9a3f676-a75f-4a65-8012-e18768039266", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d9ea495b-75bb-4b2a-9b75-c7072dffb6ad", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3584 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "583846fb-f6ea-4ed0-9601-48dd7bdce01f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.472 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "47c22427-4176-4a1f-834e-1e062eade4f7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.124 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "27e1d670-07ab-4014-991a-3bb50adb6d16", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 67.59 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ca2f5a23-f9d4-4a12-999a-0dd86fad57e3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.274 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f5f7cd8f-cfc5-40ee-9970-a9515f652425", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.814 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "323823a5-e988-4bc7-bc02-825f6233e436", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a738f35b-9373-4cee-91bb-3764a8201379", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 73.22 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "59cf60a0-cb53-48da-b6f7-d3cb4ed87779", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7dafb37e-6cf2-4481-8eb9-468e9e1840aa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "734ac188-22a2-4c03-a35f-2ebc69b61280", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.039 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "de2d6833-d369-49f6-a263-2adcbe2549ef", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c06c1695-162f-4b0e-a950-b56b7a1ff6f9", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.138 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "43ce52fb-323c-443c-bda1-ca24113c3b87", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.68 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "0e7f9c94-e2de-437a-a374-3ad985215387", + "MeterName": "Data Transfer Out - Unlimited Data (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2e89da8d-729f-41ff-b28d-abe561d747aa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.78 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "11a97f50-b7c6-4c2e-a617-853d0b594647", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.658 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "5cf34f06-1790-410d-a40d-1586dca9f1e1", + "MeterName": "100TB Commitment Tier", + "MeterRates": { + "0": 93.55 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Store", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8be390a3-b121-4937-bc0c-67776102ae5d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7a266977-c0fd-4f65-b138-2375d3231248", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.316 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "a0e7e224-c315-436c-a320-b862cf9641fa", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0b128542-39e8-4f73-ac2a-6c1d6e69625f", + "MeterName": "Standard Elastic DTU Pack", + "MeterRates": { + "0": 0.0805 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d89ce0e0-2209-4c6f-a952-0f3015606cec", + "MeterName": "500TB Commitment Tier", + "MeterRates": { + "0": 429.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Store", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7b64c567-6767-41cc-b347-fb9f85343ee2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7aa45772-2ce3-4dd7-8f2f-55cde9ac8480", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.31 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8fa458b8-de14-45a5-bc69-e556412015ea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.696 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "767660fa-525b-436f-a375-6da3e26f09b2", + "MeterName": "Standard IO - File Delete Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "459cc554-f5f1-4d51-b810-f506bcd35748", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 73.22 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "f0692ab1-0969-4614-90af-14c91e4d9705", + "MeterName": "Basic C6 (Hours)", + "MeterRates": { + "0": 1.05 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "639b92f4-c4ea-4035-8e67-ecf6870e978d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.496 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9473e672-e6f2-4497-b457-93896fd1102e", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "b20c6a61-1eac-4ff5-a34f-50ba04d641a1", + "MeterName": "Standard S2 (Units)", + "MeterRates": { + "0": 30.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Search APIs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6df0c453-cd7d-409a-92d1-6545c6718a34", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.933 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fcb7241e-f62f-4386-9a24-08ac0023fc26", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "49d4804e-2cc3-47c9-bf9e-4094875708b5", + "MeterName": "Standard S1 Secondary Database Days", + "MeterRates": { + "0": 0.82 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e30c1c9a-5d8e-4990-a8f4-83643df9244f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.99 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC24r VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6ebf8342-920e-45aa-9565-ba15ffd14593", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bcdeb9dc-975a-4cba-9921-f542c87d76c7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.178 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "e3c4a934-9ce7-40a6-9a6b-4e1e8ca6bd98", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3eb5171c-9adb-4ae3-9ef8-b52c410afff3", + "MeterName": "Standard Elastic Database Existence", + "MeterRates": { + "0": 0.0455 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7befd184-6789-4a2b-aa79-644ba65c3a19", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.079 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "eb0aaca4-70df-40c0-a1d6-ceddd8acb215", + "MeterName": "Premium P2 Database Days", + "MeterRates": { + "0": 33.9 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4bc56657-fc3b-4194-bb8e-d23e26b81d7d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.176 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4848a06a-fff1-4e43-b803-e19e16af6698", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.435 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f6e37af5-c02f-4db4-a45c-937a00a576dd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "5e94f338-64d3-499c-b11a-9e184f6cb2e3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.77 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a1a0f3fb-b281-41a4-b3f9-d559aab9ab8b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.224 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "cda4ba2e-083c-4239-a302-d1833f4cfe74", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.781 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "6ab280cf-e313-4402-8d8f-7e44dd948df3", + "MeterName": "Standard C0 (Hours)", + "MeterRates": { + "0": 0.069 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d5030a85-27ae-4c5b-afef-10cbcacb15ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.404 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2478ad4d-37cf-400e-a3d2-857871312862", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.013 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4d224456-c469-4d5b-991f-7c000eec1de6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.297 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a0a14f71-37e9-44ac-b019-035b23d75a3a", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0326 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9faf8788-bc62-4afd-93b6-5fafcfb29cf2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.666 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6cb34eff-ee22-491d-9c0c-d7b2aebad064", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.16 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d11f3e4e-1850-4e1a-8376-a924bf3b4763", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.012 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "bc27b1c2-ca9f-410c-9748-f43796a61654", + "MeterName": "Standard S2 (Units)", + "MeterRates": { + "0": 30.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Autosuggest APIs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6b3a9225-8c08-4454-975d-d8a5abba5a8d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.681 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "567e0eb9-6c26-42d2-8537-9f75c6a42ec4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "82b96a53-df81-46cd-be8d-df9969e89cbe", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.0963 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "291e48a8-43c0-433e-8902-ab7e947b7e21", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.018 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "bf7a4cff-05c6-4964-bedd-0775e18cc28d", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0862 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a901e8f6-0e44-485e-9f81-b915e9504ff5", + "MeterName": "Premium P1 Database Days", + "MeterRates": { + "0": 18.15 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "80e9cb6c-2b69-4b8a-a336-6fa1a5d4403b", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d35bf6c7-d3f3-4c24-a141-6e8fde18c639", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.301 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "28b5d272-b66e-4727-8f75-7f43f3e01c01", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.47 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "20c9f072-995c-46fe-97c5-35c7b20edbf2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.54 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16r Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f559ee16-4644-473c-9979-e8c6a79c9277", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.466 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A8 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "fe975e77-c265-423c-b9d9-8f8799f6a3d7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.288 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c2a96e47-52de-4166-b1ff-dca540c6b3b0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.498 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ff8c29bd-5dc2-4bed-be62-48a3587fece4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.0784 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e847e487-74c1-48c7-a0e1-05bc7243ccd0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.88 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "30c12030-ba2a-466b-9630-cee4dd32413e", + "MeterName": "Premium P11 Secondary Active Geo Database Days", + "MeterRates": { + "0": 250.0 + }, + "MeterRegion": "AU East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0d9ace5a-ca46-4ea2-8c16-404ab1764e8a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "c59d8a28-a6f6-4bc1-97b2-76de32ef8943", + "MeterName": "Premium Metered Data - 200 Mbps", + "MeterRates": { + "0": 445.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2c514e07-f3ba-4dec-aa9b-209aa4230e74", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "77860eb6-e2bc-4d06-8efe-491d840adaf5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.518 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "157da470-2c7c-42fb-8b1e-f52f45f35525", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.098 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "3450de1f-262a-4b42-9ca5-18ca802648e3", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0375 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "03e7dc8f-2673-4ada-8880-fe1c67b22437", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.191 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d607a843-f530-41a1-83f7-98735f27f4e0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.735 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c3e1bf4c-ac07-4d63-a599-dfaf0637fa18", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.466 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "02302486-8064-4349-ad71-481cec3225fe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.218 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "39b9be75-1947-4e14-b6dc-1bd865c05be6", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0375 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cbb21f5a-b453-4101-b240-21772070da0b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.133 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "0187b977-d63a-402b-8b11-106c54af6aff", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0055 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "238b0711-0f76-445d-ab54-885555bbc34e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.081 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "286bf7e1-9b61-4739-9f6b-4583e64da0e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.146 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "618c2709-f53d-45fe-9bb3-3cacb9306593", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.904 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5f0ea997-e73a-4111-805e-199ded74020c", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 17.739 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f58e3424-4376-4cad-b653-38438f873b21", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d40f83f4-edac-4f27-bdee-163dd3c522fc", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.038 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Zone Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c91b8d40-52be-4cce-a47c-045a2d1aaf22", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.308 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "3000577a-6739-4aba-93f3-773e6cedd7ab", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "1819735c-d31b-4a60-890e-e91a3ea516ef", + "MeterName": "Premium Streaming Units", + "MeterRates": { + "0": 139.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "51d156bc-f191-4fcf-8baa-af606a472ad8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "079e188f-4fce-4be6-bd40-7d3ac989ce96", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.5392 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "bdb75818-345e-4312-a841-ec111bf62c5a", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.067 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "957eaa9b-7c60-46a2-b833-00c9c5413c21", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.046 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3b9240b0-4e45-4aec-a7d2-b87dfda3d0b0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.741 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cb901e02-76a8-4476-86a4-12d7c183a79b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d0092912-446e-4335-ac3b-d215e072d5ad", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8eb2ec78-415b-4822-9d46-e99e6797e346", + "MeterName": "Standard S3 Secondary Database Days", + "MeterRates": { + "0": 4.1077 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d27637cf-8638-40eb-befb-2a9c487c2090", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.094 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "dee2f91a-233f-4509-8275-d7b7ff834fd7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.632 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5aba95bf-b053-4a9f-b019-c3c599a13819", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.1256 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "33dcf51a-a44e-468e-a4f5-24041b8875d5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.101 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "fde476f7-0102-4372-b7cf-38d1ebaba1a1", + "MeterName": "Premium P4 (Hours)", + "MeterRates": { + "0": 5.772 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d7db5d72-8dc9-487b-a663-f846969bd55c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.741 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4c89295c-9f5d-45eb-96db-f6d799a9c1a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.869 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b56570c8-874c-4b26-b0b3-f07e013dd2d7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "925a20b0-36af-480d-b740-418c9d987742", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "42e2a22f-fabf-41ea-a21e-e86bb3ff5799", + "MeterName": "Standard IO - Disk Read Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "466c389c-75d5-4c25-8351-78992ce2dff7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8981294b-c2fa-4f36-85f7-7ade62e90136", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4c15da54-19c6-40e1-b910-70f35f8aaf84", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.368 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "04b7b9ed-df96-4e2f-a6fa-dbcbeffaf616", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.168 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0dfadad2-6e4f-4078-85e1-90c230d4d482", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 21.68 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cef36e28-977b-481a-9b8a-41b6a4c4d52b", + "MeterName": "Standard S1 Search Hour", + "MeterRates": { + "0": 0.444 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c5ea8e2f-e913-41c9-a57c-11bb1359c0dd", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 60.83 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "96021e96-fece-4efa-b97c-10c33ac77534", + "MeterName": "Basic Elastic Database Existence", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "059357b5-2f0f-437f-997f-9054f44520fa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b32411be-dd01-4dd9-b174-2b25eff202f1", + "MeterName": "Standard S4 Database Days", + "MeterRates": { + "0": 11.7613 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "42059891-1d2a-4425-9293-f503f48e13df", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Batch", + "MeterId": "cc838a29-3cd0-480c-a0e6-416434fa3136", + "MeterName": "Compute Intensive Batch Instance Compute Hours", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Batch", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8125b3ec-157f-4cfa-96a2-0f7a8fb05e38", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.95 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c0b5ac6f-733f-45e2-9c69-da7fbbc97d47", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.069 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a645c7c4-78b4-4c15-9a57-051d672e25d4", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0671 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "ba2e6c04-d521-4fb5-929b-5eaf7bd62db7", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "11aaad05-cf0e-4d33-ad13-ce376bd4c1f5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "b1c0f383-eba7-4a5a-beff-a7337bd2dc31", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.886 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2f352354-1b50-4758-85b0-357bfec2762d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.89 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A10 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eef460a9-fb57-4544-9d64-2589f6278953", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.274 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "438279c7-b2d7-4aa0-b9d3-8372e8408e17", + "MeterName": "S4 Overage (1 Million Characters)", + "MeterRates": { + "0": 4.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Translation API", + "MeterTags": [], + "Unit": "1M Characters" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e380ec57-7763-4e0b-a8a6-18ec5ebbfe50", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 135.17 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f9a25a17-711e-4adf-98a7-4f2b4851e69b", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0671 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c69aed70-4d1e-4d58-8594-e275b2f7ea19", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.054 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7fdeb1d1-db22-4df8-95de-9a1072882f79", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.396 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6ef074d8-e588-4978-bea3-6900887a152c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.792 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d02ca60b-c5ee-4bb2-af44-8d0ed8ff8b61", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.101 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5a69132e-5627-42e7-b733-03e0cd8a9052", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "31d26cf4-bd62-4eb1-9ab0-0c09b613ab43", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Weblogic Server Standard (8 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1e2ef9a9-b011-49de-9097-e20558abd997", + "MeterName": "DWU", + "MeterRates": { + "0": 1.6633 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "309fa474-1d68-4040-8576-fa886a0d0764", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.484 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "61226b2c-f21b-4a8a-b39d-5f619442169e", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0576 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eee0c5a6-370d-4b65-b095-f916c24fe093", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.371 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "e62cad52-77ae-4ad2-983f-f376a3a55cc3", + "MeterName": "Standard Medium App Service Hours", + "MeterRates": { + "0": 0.212 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5867cf7e-d31a-4d38-9369-1b88c65942fa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.376 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8c26e7de-f781-42ba-8fc9-3a249b99da5b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.134 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "c9c24ccb-1b28-4923-8616-77ffaabd5c45", + "MeterName": "Basic C0 (Hours)", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "3dbdef33-aca9-4dfc-95ab-93a4c5cadf2a", + "MeterName": "Premium Small App Service Hours", + "MeterRates": { + "0": 0.375 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5641ebf4-f440-4029-a7f6-d48e92b556b8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "696220f2-91da-4ca5-920b-151e51a6d103", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2bb397de-da27-438d-8e11-d57a5d871f00", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.383 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "eb263b79-5d77-4a6b-85fd-0c458b3bf8c1", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3584 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "6876ecb6-f509-472c-83d5-2f1d7971d338", + "MeterName": "Basic C6 (Hours)", + "MeterRates": { + "0": 0.84 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a206857d-3d4a-4d41-bb8d-9167c60573e1", + "MeterName": "Standard S3 Secondary Database Days", + "MeterRates": { + "0": 4.1516 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6bafdc11-b964-4895-9d4e-a0e548db1b2b", + "MeterName": "Standard S3 Database Days", + "MeterRates": { + "0": 4.8387 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bb89a866-4e0b-472f-91bf-66511c6f79e7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.497 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1b86a761-5284-439a-aa3f-247643a45ed0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.062 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "415d5d90-3599-4c7d-977a-7c60f23cde4c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.768 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "967ac796-7cba-4429-8cfe-7f2739d4929b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.743 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "898849c4-1365-4efb-aa8e-bf0205ce4d94", + "MeterName": "Premium P1 Database Days", + "MeterRates": { + "0": 16.5 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "30e21f89-7f2a-4359-bef9-4eed5134c498", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.053 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "05145407-d741-4e4c-aa74-141a3610e059", + "MeterName": "Standard S0 Secondary Database Days", + "MeterRates": { + "0": 0.3796 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "603fae4d-a396-4918-a735-ccf9e0f554ad", + "MeterName": "Standard S2 Database Days", + "MeterRates": { + "0": 2.662 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0d1f3a43-810a-4ce4-a15c-59cc4e49389d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.373 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "95e9dcdd-4a5a-46b8-ac41-593121295732", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.76 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2edb893c-d301-4315-be8f-a4220d63a551", + "MeterName": "Premium P15 Secondary Geo Database Days", + "MeterRates": { + "0": 509.2629 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f05afa1b-7685-4e1d-bc06-06ee03689b57", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 10.536 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "df42b215-29f6-4882-995b-3a975ff893b9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.348 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f19f43f3-3e39-45b8-b3ae-1c907389224c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0056d2a6-4f43-4e2f-9cd0-0bf3cd49e45d", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0528 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c85e939b-7fd0-401b-8aab-47224fd725e3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ef41e258-9080-4d81-9f5f-493b6a8849cc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.336 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f8bef3d3-dad8-4a4f-866a-e8d47ada2509", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f6d8cdbe-efbb-42f0-bac0-91e5435137b9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1478c14c-1568-4a67-8a1e-3ae50f4284c1", + "MeterName": "Basic Elastic DTU Pack", + "MeterRates": { + "0": 0.0548 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bbdf37a0-775d-4b88-915e-957767b07342", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.37 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "b416267e-7623-4b26-a283-21f98bbc67a6", + "MeterName": "Premium Unlimited Data - 2 Gbps", + "MeterRates": { + "0": 19650.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4bd52b17-d56b-43ad-82ea-37171a8505b8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.583 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "eabee600-a8c0-4631-b410-d7bff4022008", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0784 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "3fdffac6-75e4-4828-b454-1447bcb4324b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.171 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1f4a272b-d9ac-400b-9b2c-767376072eb2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.742 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3aadb034-eb61-4a64-bd4f-ec2f8586825a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.219 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f4144fa0-cdfa-4119-896d-84c48808d419", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.153 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "11401df8-e39e-47f9-bfe8-6d0ae757a180", + "MeterName": "Premium P11 Database Days", + "MeterRates": { + "0": 225.81 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "5a362b42-a880-43e8-82e6-3c8a67964fd4", + "MeterName": "Unlimited Data - 100 Mbps", + "MeterRates": { + "0": 1300.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "115f6238-828d-48ce-97ae-c4312fae9c66", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.37 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV6 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 50000.0, + "MeterCategory": "Identity", + "MeterId": "fca3d249-4c6f-4a3b-b8ba-ee93943fe3e4", + "MeterName": "Basic Users", + "MeterRates": { + "0": 0.0011 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Active Directory B2C", + "MeterTags": [], + "Unit": "Users" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0dc2fd3e-fe0b-4172-8c53-297851a3d2d1", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "2d4b5ae6-b580-4c6b-9d08-30289d910b24", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "f94c4ebe-069a-4c53-8fc1-76365caaa9b0", + "MeterName": "Premium P1 (Hours)", + "MeterRates": { + "0": 0.694 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d2eaa8a2-4653-452a-b783-3e7e49065efc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.091 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "74aa12f8-d483-4452-8a45-ce0681c608ba", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "8028c95b-adcc-43b7-8d4e-be65ef8ddce0", + "MeterName": "Premium Extra Large App Service Hours", + "MeterRates": { + "0": 2.88 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "57c0000e-9352-4bcb-8b3b-b2852dec9415", + "MeterName": "Premium P2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 33.9 + }, + "MeterRegion": "JA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "59d6b669-a27f-43b8-b1d4-beb384a9103a", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "XL SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d6338131-4b38-496d-b847-1e6bcba1c4af", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.111 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "deafcd05-71a2-4a0b-82de-a06b60b4083d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.874 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ec4b0893-9afd-43f7-af7e-609027099243", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9d3208da-7aec-477f-bad6-48b9dde57abe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.156 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cdfab75e-a15e-4326-a99a-527bccef8f80", + "MeterName": "Premium P18 Secondary Active Geo Database Days", + "MeterRates": { + "0": 548.856 + }, + "MeterRegion": "BR South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9e29f04a-55d1-46d3-bc71-3c73016961e5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.166 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "96019ff4-d889-4443-b8c8-2edf0d3fd81d", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.144 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c79010e0-54fd-43b9-9265-67f6a8f5293f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "608d3507-d03f-4235-a89e-260deb2f306b", + "MeterName": "Premium Elastic DTU Pack", + "MeterRates": { + "0": 0.2038 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "fb9c6230-31a4-47db-9755-81b1f088f6e2", + "MeterName": "Standard C2 (Hours)", + "MeterRates": { + "0": 0.281 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a1ae9dde-e6bc-4a25-ac86-ea560eabb420", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.252 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "007b274b-ac6f-4c94-96ba-87a7452c2460", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.238 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "RemoteApp", + "MeterId": "84add202-6535-4afe-a62e-ce30f181b6cd", + "MeterName": "Standard Overage Session Hours", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Named User", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "70ced248-63cc-48c4-be4b-c82f5ec572e6", + "MeterName": "MSFT Peering Unlimited Data 50 Mbps", + "MeterRates": { + "0": 872.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6bd4c67e-ec09-4766-918d-49bdfd273204", + "MeterName": "Premium P6 Database Days", + "MeterRates": { + "0": 150.0 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5a5965bc-25bb-4614-a6c8-dd7b0acbe068", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.343 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dc64386b-b3a0-4d49-9ffa-0f79229b1766", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.524 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e99c025f-0eba-4886-80dc-0397ea0ad0f5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c47a9952-8952-4c87-af10-15a3d28353fa", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cf7ea5d5-a508-4364-870f-30d10b6f7337", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7b362907-1d27-4f3c-985a-99d2562fcedb", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0264 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "7f854932-e265-46af-b2fc-0936ecce0708", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "M SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "039fef54-22b4-49c2-9da9-53c87cf170ff", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.794 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Notification Hubs", + "MeterId": "5d75ae84-1488-4711-80a1-831f1e8bf851", + "MeterName": "Base Unit", + "MeterRates": { + "0": 200.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard Notification Hubs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8912906e-abec-4934-943a-2ab3042056a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.042 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2242dced-d6c2-48be-a940-d8096871d831", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5d1be127-45e8-4698-8211-ac7de4ee9911", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.38 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV24 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7c7c0034-2a00-4164-9454-546b2b20b026", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "3013a362-af6c-4849-ac70-eb605823602b", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "28713411-97ea-4a36-8fb3-82ff0d600fec", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard and Weblogic Server Standard (8 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5299df59-f8c8-48d6-bc8f-7a6d38e6fcf7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.231 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "4d6396e8-f52e-4505-986f-dde9e1bbb62a", + "MeterName": "Standard Large App Service Hours", + "MeterRates": { + "0": 0.488 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a22c3519-1734-4cb7-8e8c-60684ae5a1bc", + "MeterName": "Premium P4 Database Days", + "MeterRates": { + "0": 66.43 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ca052728-507e-43c4-a9db-9fa115ac4a5e", + "MeterName": "Standard S0 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.5807 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f6eeff7c-d9e2-478e-b25d-670e485511cd", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 19.71 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "fa7ee529-9c03-4b0a-9007-f7671e15bbd3", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c48226bb-dbdd-4571-86b3-7819155301ee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-03-12T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "799827a0-dc0e-40b8-bb4e-ec6628d71371", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Java Development Environment (8 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b386db9f-770f-4ebd-a18e-de244427af94", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.62 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "88082622-24c3-4ef4-9111-09703b472ce4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.288 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f671d38e-9134-4482-8e7d-c9c242289d23", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d5c6e865-3c64-4b54-87f7-68847ef91631", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.954 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "53ef88d2-4e29-4b8a-a574-16288e717fe3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Standard (up to 4c)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "60e48883-adbd-4f15-90af-7cf28225eee7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.691 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "e33e8741-d234-45cd-ae9e-c978e7d1d2dc", + "MeterName": "Standard S3 (Units)", + "MeterRates": { + "0": 300.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Search APIs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7795898b-6d7a-40fe-a12c-2d950d773e5a", + "MeterName": "Storage Transactions (in 10,000s)", + "MeterRates": { + "0": 0.00045 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10K Transactions" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2b1cc296-982e-4eba-bebe-c78b1f3732af", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 135.17 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6b92f820-d605-472f-a905-6cd970202ba5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.19 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV12 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "2e7e68c6-6ee8-4c78-bb27-551240cf729b", + "MeterName": "Premium P4 (Hours)", + "MeterRates": { + "0": 4.44 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "34211276-e358-48a9-9107-563aad651600", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3226 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "96a51c45-febf-467a-a35a-d9dff3bfe97f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "80bd213a-6a95-46df-b323-c9700c92dea2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 8.78 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "9fa6d7bd-40a7-4178-b323-a3f509b28f2f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.594 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "196cf194-679a-4c18-9aab-16daec24426c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e596f669-89c2-4b64-8d55-ff43f91ec709", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.275 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "14624711-b4f4-492a-8fe3-3bd06089194e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "ecff4b9d-5d93-456c-a0d0-16439bf99e65", + "MeterName": "Standard (in 1,000s)", + "MeterRates": { + "0": 1.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Face API", + "MeterTags": [], + "Unit": "1K Transactions" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "706de8fe-67fa-42d3-90fd-7d01f4f2e735", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d6a5e999-fa77-4dd9-ac49-8589fa05c400", + "MeterName": "Premium P4 Database Days", + "MeterRates": { + "0": 68.64 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "11214343-48e4-4b8a-8fb7-f2ed23716f2e", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "06895379-8977-403d-bcb8-8a012515bd30", + "MeterName": "High Frequency On Premises Activity", + "MeterRates": { + "0": 2.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Factory", + "MeterTags": [], + "Unit": "Activities" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6c87c094-296e-4056-854a-6f1e5556ca91", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.528 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0c4f782e-7513-4b1f-af28-63db5fe816c7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.275 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b1f35ec2-0308-4b4f-9f19-96545df76cf7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.185 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "48c5e1c5-2278-40ec-858f-d94c3d01f2af", + "MeterName": "Premium Metered Data - 500 Mbps", + "MeterRates": { + "0": 690.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b13ef59b-e50e-473d-a970-d78dee33cdea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.585 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "0c622ef2-cd52-4909-b2b2-3f6e8f940cc2", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "782591e9-abf5-4c5b-b764-aaf746e71e85", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "185be269-2b9b-432f-8cc0-5ec4d6c5e6df", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0528 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c7b6df52-90ca-4b07-aede-b27954b2ca06", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.8 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "1b0fd2b5-5164-44c7-942d-02aac243b8c7", + "MeterName": "HSM-key", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Key Vault", + "MeterTags": [], + "Unit": "Key Use" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d3e157bd-dc46-44eb-9eed-8c257601e800", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.467 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f370c0a2-57ce-45bf-a0f5-aab6c0a005bc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.394 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "901477a2-298a-4850-bca2-56909368deca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.371 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "526017ae-c2fa-45d5-b516-a641e34ae829", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.354 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "dff6ed03-1385-4a67-a854-d40aecaf7957", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5d8bff32-972c-4feb-ba56-a1c9bfb9091e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard (20 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4ce3cc34-ecc3-4f21-b01f-67ac0564811d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4e1afbb0-df00-41e0-b6e0-4cb1836d1625", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.81 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Gen 4 Compute (24 cores)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f3e51a26-ab89-422b-96ec-be8b158bd93b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard and Weblogic Server Standard (4 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "174deba4-f676-4e38-8d31-c35b68683b7b", + "MeterName": "Premium P13 Secondary Geo Database Days", + "MeterRates": { + "0": 290.33 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d54686f0-77ff-43f3-9e7c-2099030d32a7", + "MeterName": "DNS Queries (1M)", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "DNS", + "MeterTags": [], + "Unit": "1M Queries" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bf1e2e3c-eadc-4f19-9a96-8a4de7a14345", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.714 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2508709b-ceef-4a6a-9284-d6fe6bbf48a1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.218 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4b68ed41-45bd-4a1c-adca-924de4c9ca72", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "f5f3fdcc-9d65-4817-a35c-f201589a530c", + "MeterName": "Metered Data - 500 Mbps", + "MeterRates": { + "0": 290.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cd4dde62-93d3-4c88-a041-7b392216c326", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.308 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "357c606e-1868-4f8c-9ebb-42c164290fa8", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2819fade-548b-48e4-b59e-7b00a4c7a4b9", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.275 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "35cf86f6-7923-4cb6-9867-4fe57ff87ed3", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.972 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A9 OpenLogic", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1b443379-3edd-4b29-b0be-5dbd554c498a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "35623590-cb70-4f76-937c-040aec39ba55", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "f59b982c-6454-4e53-ba74-5f10786b67a8", + "MeterName": "Premium Unlimited Data - 200 Mbps", + "MeterRates": { + "0": 3520.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4a777324-6223-422b-b1c6-3b1cc102389e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.102 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "35e37c6f-fb7d-43ce-a97d-01f8c25f575e", + "MeterName": "Premium Large App Service Hours", + "MeterRates": { + "0": 1.416 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "3deba93c-29c1-43c3-a775-ed343fe0375b", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ccdc31bd-f411-4c90-9293-8bbdfc6e3111", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.528 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a6b4f30c-ffc9-4758-9206-fa7ac2c6af14", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.879 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "095a0e8e-090f-43c4-b319-b207603db22c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.879 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "33501d1d-cc39-4216-96df-f5e8794d0e72", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.538 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e2b960d6-e14e-4f00-9e69-6a253015cc5d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "83271eb6-c541-4bc4-b61b-9f08e8142e21", + "MeterName": "Premium P15 Database Days", + "MeterRates": { + "0": 645.16 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eb11dc7f-2f3f-4624-87a7-a776c9101e5f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.384 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "28867e2f-f6e7-4de5-8fe4-b65cf76cfcc0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2c061509-27e5-43d7-bf06-43fedc7bddd3", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.015 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "77d66fde-7530-445f-9416-76a368acf22e", + "MeterName": "Premium Extra Large App Service Hours", + "MeterRates": { + "0": 2.64 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "39f422dc-abf6-41cc-aafa-03276cde242a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.31 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ec641281-7efc-48f2-8d1f-88ae77dc3f7e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.954 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "69c838a1-25aa-4ea4-94ce-851459ce64a1", + "MeterName": "Video Motion Detection APIs (Minutes)", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Content Minutes" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "03d8b4ca-d966-401c-8f3a-99e58e02f652", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.625 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "03479309-ca46-458a-b040-d7124c20c927", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.804 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a3dd3839-f638-493d-a529-e1e1427a5b78", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "33e0e9a4-f3c7-4085-9c61-116c18aeea46", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "f4e889a2-6224-46c8-ac42-40a209df8c12", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2200287e-a71d-487c-b3bd-75362ff9784a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.137 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ff697d73-39e0-43e0-bf67-79648ce16355", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.134 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "787db389-df81-4d1d-ae40-6ce34bdfb9b1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.045 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5b843ebc-c10e-4177-b57f-9dcacd1f768b", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "231ab41a-e3c8-4f7c-9eb7-eb52200bb47a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.532 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8fc2ae27-7eea-43ff-95d7-497e08a4c219", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.243 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bd9d3bf9-714d-4b09-8980-68dcfef157ff", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.102 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a2b5bb2d-f4c6-4e96-8e61-bfdcae9166c0", + "MeterName": "Premium P6 Database Days", + "MeterRates": { + "0": 132.0 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "445730ae-7795-4a85-b2e5-b6e3f6f90ff6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.483 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "ac2b8d90-044d-4ae9-adaa-127945a3614e", + "MeterName": "Premium Medium App Service Hours", + "MeterRates": { + "0": 0.732 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "207635cc-9a76-46e4-92b5-a3bb0b565892", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9f8ad506-5f00-4fff-b699-46e14cf30fa9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.081 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ffad071b-76f1-46a5-9eb7-f99462fd2c06", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.098 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "72d4a40c-5355-484c-b1bc-6f746466bfdf", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3584 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "e3a600a6-5a85-4679-9721-1c0d192ed142", + "MeterName": "Standard IO - Table Delete Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d480fb06-a438-464b-a88e-6148bf7926e0", + "MeterName": "MSFT Peering Unlimited Data 100 Mbps", + "MeterRates": { + "0": 1230.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "658d854c-925a-4347-aeef-c3a5c4f55842", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.872 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2c7f8a5d-fb5b-4673-b20a-ad0197a6e445", + "MeterName": "Premium P15 Database Days", + "MeterRates": { + "0": 567.7408 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "8f084fd5-4df9-42a2-ad81-e9602a919489", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 61.44 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "14235ff7-5ce7-4aef-bb2a-a6d47ce48655", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.008 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ae6a7452-2e45-4343-8fbb-b8cb674dcabb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.472 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "522db746-72f3-4f9b-8442-013b5dce385a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.533 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7c536b60-a3b5-4f77-ae3c-4912e3e174e4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c2df1505-864f-4eaf-9a07-76254ba6cacb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.833 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6316109e-0e71-422e-a8f7-b744a37d1960", + "MeterName": "Standard S3 Database Days", + "MeterRates": { + "0": 5.0322 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "6446d2f5-66c8-4491-8ec4-595435d86c4d", + "MeterName": "Data Transfer Out - Metered Data (GB)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ec09df9b-7108-4ec1-b041-834c6a16375a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "0a0fe57d-728a-46c8-b1a7-6e188ae50992", + "MeterName": "Standard S1 (Units)", + "MeterRates": { + "0": 3.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Autosuggest APIs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8da6b1a9-767c-482b-aa42-56d16040659d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.46 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV24 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4910515d-fa3a-4e5c-baae-42b64d429f1c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.65 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2c353e88-5c44-41ff-a545-8673e70b2240", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.051 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3f623114-640e-4f6a-b325-347b7ed51841", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.08 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "041c9b25-6556-42c1-8efc-bc3750c55ddd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.447 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f2a46495-36d9-4dcc-98ab-52155e374fc1", + "MeterName": "Premium P4 Secondary Active Geo Database Days", + "MeterRates": { + "0": 66.0 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "ac680768-a3ec-49f6-9f04-35245ed69dd0", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "514d2095-d1d3-4c1d-a136-c38886a08ae5", + "MeterName": "Basic Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.161 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f52b5e4e-2c1b-4394-b256-355adb5ac70c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d1e046dd-bca5-4325-aba8-3d9eabeb0566", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.798 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a3180a65-53ef-4162-a9cb-187cba43f633", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.396 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7dc6af9f-7a28-4bf6-a3ef-91d3473d19a6", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "101b5675-98bb-47c4-888b-beebd7dbc3bc", + "MeterName": "Standard Small App Service Hours", + "MeterRates": { + "0": 0.125 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b1251d25-5792-433b-af2f-cd7bdf7c70da", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.19 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7b396c4d-5016-45dd-87f5-a49291de9775", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7061d805-de24-4d8e-883d-2cd6136fcb1d", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.129 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "a2fa0e1f-a4ab-4db2-9945-67d07df22591", + "MeterName": "S1 (Units)", + "MeterRates": { + "0": 100.0 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8347857f-83b1-42b0-9e28-190e839bf069", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cd7b6e87-0802-44cc-a83d-50abf17b92a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.758 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ebc3ef62-78fc-4eea-a9b4-17b7ad783b79", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.459 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f2d0e4d6-cc5f-44cd-bce0-2198d7b00225", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6ab58869-fe7d-472d-bd57-1b1f812b4e1b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.366 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5e2c99fe-dff1-468e-a5f9-3a2f6fec0dd9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.176 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "8f5f73d5-08fc-419e-9e6d-40d64ff9fec8", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1006f953-47df-4c92-9f09-6ec3834d4e0c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c1cfd724-39d0-4030-ad64-30fb29b08221", + "MeterName": "Standard Managed Disk/S20 (Units)", + "MeterRates": { + "0": 11.968 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4f2b36c6-e6d8-479a-9789-546adeb43c43", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.31 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2005544f-659d-49c9-9094-8e0aea1be3a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e8f03dca-a621-4c3a-bfde-0acc3ed8b072", + "MeterName": "Premium P2 Secondary Geo Database Days", + "MeterRates": { + "0": 25.74 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8fe45687-5272-4a3e-8d4a-acc1141c5464", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.713 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "601a1a89-81d2-4277-8e41-4256c85fa3ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d9244109-c69a-4d18-a808-f666fc7b4be4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.46025 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "e36c98f8-8de4-4323-a576-7a41898e87b3", + "MeterName": "Standard C3 (Hours)", + "MeterRates": { + "0": 0.45 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1ed339be-dbf6-40b1-a9e3-344a893c8ab2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.595 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a97262bb-334c-47dd-9074-7c1012519d00", + "MeterName": "Standard S0 Secondary Database Days", + "MeterRates": { + "0": 0.4176 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ce0bcc66-446b-47f3-b0ac-094c3738dc21", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "8ae60c37-2b1a-4798-9c19-dd0f4ec6b878", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.368 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "1b174502-a775-4055-b885-49631396b81a", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "9f770265-4d53-4a51-973d-ead318642ff6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.875 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bd18f5bc-0409-4e7b-bcd8-f613082ceceb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.043 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "d0a685ee-f093-4c5c-ba76-3ec342a75de7", + "MeterName": "Ingress Events (in 1,000,000s)", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard Event Hubs", + "MeterTags": [], + "Unit": "1,000,000s" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e266a9b3-59a2-4e98-8a00-d55fadf5a5c7", + "MeterName": "Premium Elastic Database Existence", + "MeterRates": { + "0": 0.4612 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0bb1b5d9-f07b-42b2-83c0-302125cffa43", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.713 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "94ae4f63-5c28-4119-b2af-6474c2079336", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "20ae4ba2-14cb-4f1f-8b25-1d730ecace14", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.149 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "91913e43-6e39-4924-9d87-eaf75fbbc858", + "MeterName": "Standard Elastic Database Existence", + "MeterRates": { + "0": 0.0445 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "3ebe2f42-28b7-40a0-9f93-99295632b80f", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.114 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c7929966-0a48-4f73-a86b-30f4e39d1995", + "MeterName": "Data at Rest (GB)", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Store", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "abf75093-8aad-4b0e-a6b4-b560fe04f43e", + "MeterName": "Basic Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.1674 + }, + "MeterRegion": "IN South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "6474ab1c-32da-451b-af09-347c43b5b3a9", + "MeterName": "Bing Speech Short Form API (1,000s)", + "MeterRates": { + "0": 4.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "73fa7e44-d523-42fa-9755-21f13bb17862", + "MeterName": "Premium Unlimited Data - 500 Mbps", + "MeterRates": { + "0": 6000.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7ba85e3b-1ad1-4d97-9379-23d23bb79d23", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.348 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "a287a48c-8d94-49e5-a745-b46c130521b5", + "MeterName": "Storage Transactions (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "fc4e32da-ee4d-4c08-9123-58b49f16bf07", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.193 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c759cc13-babe-401d-a6c6-470abaf16baa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.225 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8c0088a5-c620-426d-9f62-90835ccfdc52", + "MeterName": "Basic Database Days", + "MeterRates": { + "0": 0.1819 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fe776f52-193e-488e-a411-c68ca5982410", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.131 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "fed263f7-bf07-4463-9976-58b1657efa02", + "MeterName": "Standard Large App Service Hours", + "MeterRates": { + "0": 0.424 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "369f2370-629f-4221-b776-bf7ca03e492a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.062 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0f240f9b-0271-4777-8153-57ea7fe23389", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.371 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f45b4061-88cd-49c9-a214-c144d30ccfe3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.2196 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "03ac6ab9-fdc9-4bae-9c19-70013c387633", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.202 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f3f2fa69-a413-45a0-9d2e-fce71ebfd053", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0475 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e819a254-9fe9-451d-b2df-a1c878828652", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.686 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "600d1d78-c335-40ed-8888-ff6c5c91c850", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.2 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Enterprise (8 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b4e18f39-951a-464c-9203-81ea93b6694f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 11.88 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "G5 SQL Server DW VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d200b0b7-dee1-4c70-bc27-0be36a1b5a6a", + "MeterName": "Premium Metered Data - 500 Mbps", + "MeterRates": { + "0": 1090.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "506baf95-496d-4ea7-a5c0-454b25f8a1d9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.713 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b6561f0f-da1c-4ffa-bef4-fa6a25586363", + "MeterName": "Standard S3 Secondary Active Geo Database Days", + "MeterRates": { + "0": 4.8387 + }, + "MeterRegion": "JA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d8771d5f-8360-4935-8687-9dd153ef427e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.274 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9646327a-a170-4388-ae5f-b4d00add700f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5b58638e-0b79-4774-bddf-d8debdcc44f1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.324 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "30a5e31d-277d-4e45-9917-4236d0e54a18", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "10a04b1f-1cf2-45ce-a1da-9cd91abfccfc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.312 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "4390078b-dd67-4707-87e9-e6d5e38a6d0c", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f0ccfec9-02f5-48ff-8ee6-a3177984dc34", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 12.731 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6700be67-405d-4d60-a823-943f85b5e6af", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "49dd9dcd-b341-4710-b8b3-d14ff83e651f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "fa014ea4-28f2-49aa-8ed7-957df89d42da", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.356 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Automation and Control", + "MeterId": "3845957f-7838-429c-b826-c091edb6fe16", + "MeterName": "Overage per Node (Minute)", + "MeterRates": { + "0": 0.002 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "OMS Automation and Control", + "MeterTags": [], + "Unit": "1 Minute" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "5ca0eab8-4072-4404-8c8d-666d96674095", + "MeterName": "MSFT Peering Unlimited Data 10 Gbps", + "MeterRates": { + "0": 82000.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b7a09aba-ed46-4739-ac54-4d99aa211195", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "771dd126-34e4-4dc0-8c91-8faa34e34e52", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "74361c94-a459-4564-b3d2-dd8dfd79e704", + "MeterName": "Metered Data - 1 Gbps", + "MeterRates": { + "0": 436.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "78c9ed18-2cc5-45bc-a403-59aef71fe88b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.034 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "dd7fabe6-1049-40e1-aeee-f81e3651fe7c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "8efcaf75-6476-4413-be34-f75c42fd0926", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.67 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "G1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ca04735b-6054-42e7-9080-f3a27f368f4f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.405 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9a1a397d-b91e-4446-83ac-922c8c5ca8b5", + "MeterName": "Basic Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.161 + }, + "MeterRegion": "JA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "29d77a31-e360-483b-a3b3-3b4f3f05bc38", + "MeterName": "Premium P1 Secondary Geo Database Days", + "MeterRates": { + "0": 11.25 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "18868a19-db6a-411e-9810-d337d44c66bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.872 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "981a258b-c47a-49e4-8e7f-a3d92afb5c22", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.046 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8d29f707-7e0d-4e09-b376-9535fed9863f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.68 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "721ab441-088d-4bbe-bc58-da66fc6d8b31", + "MeterName": "Unlimited Data - 500 Mbps", + "MeterRates": { + "0": 5200.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4a5a4b83-6216-47c5-b3db-fe430fa6e2c3", + "MeterName": "Standard S1 API Plan (Units)", + "MeterRates": { + "0": 3.23 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8bb48c82-7b3e-448d-b506-9db7c1278102", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.67 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "ebd37945-6bf1-43ab-a925-2f67235e51ba", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 163.548 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d3824379-dc7e-472b-9e67-3f4a7eadc05b", + "MeterName": "Standard IO - Page Blob Read Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "8dca9a1d-0589-496d-85b4-f93c5e22fb33", + "MeterName": "Premium Apps", + "MeterRates": { + "0": 99.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Application Insights", + "MeterTags": [], + "Unit": "Apps" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5983e870-e59d-443a-829d-13530a2ee1c2", + "MeterName": "Premium P4 Secondary Active Geo Database Days", + "MeterRates": { + "0": 60.0 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "819d3dde-ccbe-45f7-9bc3-66cd68af3d10", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.759 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b6bc798b-dadd-42a6-9848-ac13e9c71309", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.786 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "2c2efcf3-50fb-43a0-b253-75f3bdd09afe", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10K Operations" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7a249e2b-a31d-4c54-b0fa-6f7f45927fef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services Low Priority", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4ac600d0-3006-40c7-bef8-5881c6d7ca50", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "71677ff1-e604-470f-95cc-16a626aed59b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.996 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "12f2dcbb-b14a-4c0d-90a5-5221356b06e5", + "MeterName": "Standard Managed Disk/S6 (Units)", + "MeterRates": { + "0": 1.654 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4b8b8092-a2d7-4785-9b9f-76104f4c7269", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise (16 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "4223937e-516f-4ff1-9dfc-0e2ff39ec8aa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5e7a80e5-0273-44b8-a179-e4f62ea6ec9f", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "eb6bdde2-506c-4b1c-b5f4-259403ff0dd2", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.1188 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "4142ced1-3ecf-4e76-bac7-c4875eb10e99", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.77 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "23c8e98f-5028-4330-9cfc-777e2a207f83", + "MeterName": "Standard S2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 2.94 + }, + "MeterRegion": "BR South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "21510b9c-69a8-4a84-902e-8d6b735c5ff4", + "MeterName": "Standard S0 Secondary Database Days", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0c08e14e-5687-4be8-8f6b-99f1f9160acc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.446 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7aed6dca-0b30-4409-8f3a-b68eff473afb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "be88bcf3-1a6d-40a9-b006-ac29857c9377", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.31 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d7d527f5-3312-4052-be4f-fbbdde8ab1bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.096 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Web (12 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fbb6c1d5-3488-47d4-aca7-3d986eca81c8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard (8 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8b37732d-dd06-4cd5-b09d-cb829fecb879", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.296 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7e9ec9bd-045f-4540-b918-bd5f848fa88f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.352 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "285f29f0-cc2d-4ad7-8585-8f27bf6c874f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.858 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a7eb5d95-d003-4e4e-bcc5-381781b050d0", + "MeterName": "DWU", + "MeterRates": { + "0": 1.6936 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a5e92164-161d-4352-a7fb-9b5782e58a48", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.262 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9bd33e8f-aa87-42c6-aba6-fd3ccf1fdf06", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1d9f1d7d-54d8-46e7-9e90-cfe4806d819e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.45 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "bfeea04b-3747-4ab2-9ce8-beda9033e7ef", + "MeterName": "Package Management Users", + "MeterRates": { + "0": 4.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Team Services", + "MeterTags": [], + "Unit": "Users" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "42a3e6c7-d50e-4cc5-8c15-82f59a84c009", + "MeterName": "Basic Medium Azure App Service Hours", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "4d56f98b-dceb-4c50-a197-0a8e36614656", + "MeterName": "Standard SSL Certificate - 2 Year", + "MeterRates": { + "0": 125.98 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Certificates" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cb6296b3-56f6-4af3-931d-5ed6eefec223", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0dd27cb3-dc33-4ca1-a601-482ff4917012", + "MeterName": "Premium P18 Secondary Geo Database Days", + "MeterRates": { + "0": 372.5876 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "09a0f91c-3ccb-4a6e-a7bc-61c0781eb6d2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.417 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5467c7cb-951a-4218-8bb1-f656115176cb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "c9a05f12-4910-4527-a9ec-1db4e4dba60e", + "MeterName": "Core Features", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Application Insights", + "MeterTags": [], + "Unit": "1 App" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d71f5e12-ff4e-40bf-90fa-5a23efc54784", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.713 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "72746220-2fb7-4100-a6f4-4cd31b54b93a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "7104ebd5-45c7-4f96-8847-332a9630a291", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3584 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "b8cc594c-522d-4b13-bfe9-0bdade2e94d2", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.055 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6591d320-03de-4f7b-a954-5ae2a562bb61", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.932 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0c10119f-55be-430b-b189-a37492b2b0fa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.3275 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9b1933c2-76eb-4cd6-83eb-6b7ea4ff7aca", + "MeterName": "Premium P2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 33.9 + }, + "MeterRegion": "JA West", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9faaaee9-161a-404e-83af-5ff317d66375", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0c11d1cd-655e-4369-b0fc-4cccf9a39816", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.134 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c5a93026-0905-44a9-8b52-06928b77cb3a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.924 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c0db10bc-0d57-4ddd-8104-93ce2756c654", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.926 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0dfd69d2-e486-40b1-bdda-2ab5e6f043cf", + "MeterName": "Premium P4 Secondary Geo Database Days", + "MeterRates": { + "0": 49.82 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "af4ce32c-ec5c-497f-a92c-19e5ea580c21", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.486 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7f96c6fd-405c-4fd0-8773-1c1173bdcf5c", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 73.73 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f084eedf-a23f-46d2-bc24-b913ab919c95", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.316 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "c54ccb61-434e-4cef-b85e-6847a47a142d", + "MeterName": "Basic C1 (Hours)", + "MeterRates": { + "0": 0.069 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "401cfa59-dac4-49f0-ad87-f75c5c7d07d9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a0005480-a936-4a70-80ec-d3e8f5b27519", + "MeterName": "Premium P15 Secondary Geo Database Days", + "MeterRates": { + "0": 428.56 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "47feaf27-c51d-4000-a98f-da029244d84f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.109 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f4f8600c-19fe-406f-8d22-b55c43456835", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.342 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "5b14481a-dec5-4a46-9847-330d75701ee3", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d0b24cd4-63e1-4549-bb16-f6e7aea4b412", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.041 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2448dee3-09c1-4242-8a6f-14ce82cc2b49", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d333fd89-e3d0-45a0-871e-e4a4061ae0ee", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "82faf9a1-6171-47c4-9919-f317717be4d8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.567 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4fe80b67-66f2-4fec-b281-22019bd6a8f2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.78 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "14963917-dee3-41a7-a37e-6ca27dad4cfe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "05ef7219-1ceb-451e-b1d8-27bf373addd6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.442 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cdb250c1-4706-49e0-93f4-941a627bde51", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.872 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e0e613e6-6659-4ddc-bc52-aba87401b461", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.111 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "29419ca9-a71a-464b-b80d-a35854227b40", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f2c1805d-d937-46a2-aee6-66e441144021", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "15fb14e6-ece4-4981-a179-2bc796d0b65b", + "MeterName": "Production API Compute Hours", + "MeterRates": { + "0": 2.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8dbc6497-3d3a-47d6-9de4-dd42072fad66", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8023b34d-cdae-4f78-a786-14aee78c327c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.097 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "42dbe3d7-0a86-4173-a4f9-185e7944ee29", + "MeterName": "Shared App Service Hours", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7397766a-fec3-4707-915d-d7ccd44ad8a0", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0528 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f5a999a1-da04-48d7-bd38-d8015cc81cb7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d0704cec-9302-4ffa-bdf5-2f296e19ef1f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "33dcb7a3-de1c-4add-8347-76064099f695", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.85 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "db78af8b-956b-4828-bf01-0489d6da903b", + "MeterName": "MSFT Peering Unlimited Data 1 Gbps", + "MeterRates": { + "0": 8700.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "73ccc743-2385-4f35-a2ee-97b0f0f9864e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.5392 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "57063526-33ad-47fb-b2bc-a0c0a07e2928", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.142 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "9dbadd95-5f52-454f-9002-c666a8aff87d", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a8387712-c345-4137-9488-78ac0e0b9a8c", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0238 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "48888350-0dec-4aad-a3db-a5eb185275a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.294 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e9e6a774-4e00-4f33-91df-06eae1e584c2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ad9fb5a9-673e-45d4-8b42-997c024bbdae", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.254 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "02124380-8638-4b50-a284-bc93cc236d93", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "b065882b-982f-43ba-bba1-1308221cf860", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a808d9f0-4c85-45d1-a72d-dec03c281a34", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.056 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Integration", + "MeterId": "0b98ee24-305e-40c9-853f-7e97e5ba7819", + "MeterName": "Standard BizTalk Units", + "MeterRates": { + "0": 2.93 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Services", + "MeterTags": [], + "Unit": "Unit Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2b1dac7a-b200-424a-8ba6-698b4553dcdb", + "MeterName": "Basic Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.1771 + }, + "MeterRegion": "AU East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9e7a4990-9d41-420e-8d39-4400f813af9e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.374 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "40f2bbb5-1ca8-4ac5-afd6-b1e47f16314b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.246 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "058535f3-e927-4143-9b39-4e9ec2bcc825", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "00efea30-9dc7-476a-9597-ea7834555df3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.068 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4fc3d1e4-fd5e-43ac-b513-0be15f419422", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.549 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ba02ee99-0e56-4a65-a96d-9510cf31781b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.159 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e9617b6e-9905-40f9-bb14-f766f2626606", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.169 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "98903c93-47eb-4bb2-9784-cbb960ae94ca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3ea60328-178d-496f-aca0-70bcf192ea80", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.793 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d15cb650-ed16-4a9c-8dcc-08a9f8cf862b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4e7337c6-6316-4a5a-a2fe-3828e1e4ce6f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.481 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f61769f0-6f93-4181-b335-61fc6f70e891", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "18ada5c4-7206-43da-8066-7baf232d97c9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8cd2172b-a05b-451f-ac39-0b485ef652db", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "87dcff9d-fd2a-467c-8f6a-5e7f452bbdca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.158 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "08823a7e-28ed-41f4-bccf-31db018890f2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.528 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5cd2167b-a6ad-4fda-9073-c70427a89a58", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.513 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b66176d3-cbc3-46ee-ab4d-068903b8d283", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.087 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a4bca5bd-4831-404f-992d-15196e612862", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "40dc23d9-437b-42fe-af9a-8ba9914cbac2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "37dff8e1-5245-43b4-a2d0-dfcc1145759d", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6dcc6da1-1a99-4279-b8c0-ac29adab9ae1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.39 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e8cd62d9-a575-48bf-a094-ca9ba9332648", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "e2f3c6d9-8189-492f-b4e9-570d1b6b2ef8", + "MeterName": "Premium Large App Service Hours", + "MeterRates": { + "0": 1.464 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9420a7cb-52b6-4450-8805-6e1775721111", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.064 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Analysis Services", + "MeterId": "8e338e85-4baa-4d2b-b688-9b9ef57414d8", + "MeterName": "Developer (Hours)", + "MeterRates": { + "0": 0.066 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Tabular", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "c9711c6c-2fb5-4ff1-ad23-17e9beab62ba", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cde95cc6-ef30-4b41-96e0-90def531e381", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.68 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fd90cfda-a664-48f9-a4e8-1064566faea9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.598 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "4d0f8458-89c7-4ac4-a7f7-14c39f4dda0d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0975 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9c7985a2-b936-41ce-84eb-3b156ecf0100", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.185 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "8b4daf38-f4d8-41a9-b500-270a563b1169", + "MeterName": "Basic Medium App Service Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "caa99e81-fbba-459b-a269-36d39b4a7472", + "MeterName": "Messages (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "9ae0f39a-5453-4109-85b1-7a5d0e14c451", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d8d65195-870b-4a99-8798-e784d210e615", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.258 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "577e4b75-2b87-4de4-9e68-0075692545df", + "MeterName": "Standard S1 (Units)", + "MeterRates": { + "0": 2.42 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Recommendations", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "a435c5fc-1ab7-4be4-8cf4-223a670cae26", + "MeterName": "Free (Units)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7eb49223-0e75-4ac0-9531-aff5d3e29c05", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.43 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c46a6b69-0318-4237-81ca-2f59d6cd40ce", + "MeterName": "Premium P6 Secondary Geo Database Days", + "MeterRates": { + "0": 112.5 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "767e96b8-656b-4d0a-b275-92ec00b9d08a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.24 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e5c6983e-1748-4a89-8f6d-8a28a3db7f64", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.884 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "6413bc9f-b929-4d93-b0c6-f37fc0e7bad2", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cc6389e3-71bb-4c49-ba9a-ff54199ea600", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 12.315 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "G5 SQL Server DW VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5933e7cb-40ef-40d7-b835-924fb7b9f114", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.785 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "378ae26e-4328-424a-a19b-d7f9cf39610e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0ce1a04a-27bd-45f8-9def-affe0231b7ee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.387 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "80ab921a-b92c-4d26-ac96-944bb3c932a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.44 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b6acd199-645f-438b-88a3-490963d9379e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4d56d61f-ea3c-4f8e-a7cd-92e547efd4b0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.749 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6bb99524-6633-4cf1-9a39-712256b833e8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.159 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5ac72f6d-067d-4910-bd39-2b5d8de39b6f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.639 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "c90286c8-adf0-438e-a257-4468387df385", + "MeterName": "Basic Gateway Hours", + "MeterRates": { + "0": 0.036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Virtual Network", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bd7cbe16-51d8-4a11-81e6-aa2960683d33", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.475 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV24 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9230da20-e882-439d-bd40-14f5f65d97f1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8af30efd-d700-4bda-aa15-605683060c83", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "876d852a-fc2e-45f5-8c18-31a2158b6555", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.129 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d9c3a20e-e4af-4989-ba38-38e5f263d673", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.037 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "739bd0c7-f91d-4770-89d3-2d32ecc27573", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.267 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "22e34bb4-7687-49ad-8a3f-a317de55ff19", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0655 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a8fcd27d-ff1b-44d2-a9d6-cf6773a60aee", + "MeterName": "Premium P18 Database Days", + "MeterRates": { + "0": 548.856 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "83b369ee-aa29-4b3a-9421-b8e7ffa27fbe", + "MeterName": "Premium P1 Database Days", + "MeterRates": { + "0": 18.75 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "74b37d80-0208-4505-b6de-01c0aa7e7ccb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 10.1568 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "48f97703-133e-47e8-acd2-0e6fcbfc82bb", + "MeterName": "Premium P18 Secondary Geo Database Days", + "MeterRates": { + "0": 411.656 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "fa9dc70f-f562-44af-b965-b4576aefed95", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6b381d19-e434-4bd1-8ddb-6bd522f3d298", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ab5b4394-b77a-4139-9457-ce65a0032ac9", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0706 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d52bfc75-dbab-4e07-a660-eb1693aa8d11", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0528 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "aa57abaf-ec18-4387-9348-07b177eab8db", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "bd46a1a7-70fe-488c-bdab-8bc27b9a07bd", + "MeterName": "Standard S3 (Units)", + "MeterRates": { + "0": 270.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Autosuggest APIs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b907ef15-160d-4e7b-886b-53fb9bce4378", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0df258fe-cce3-421a-9ff4-4e50143e7eb5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.435 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "e8f8c147-48fb-470b-ba4f-42d2778901f9", + "MeterName": "Premium Unlimited Data - 100 Mbps", + "MeterRates": { + "0": 1475.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "33287f2a-0956-486c-b582-7a52b7c958b1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 12.6 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Enterprise (24 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "254cf0a1-1016-4f1d-81a5-2ec1551c6138", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.222 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "17b1cd54-1d43-4eb0-9920-b52c92a72b1e", + "MeterName": "S2 Overage (1 Million Characters)", + "MeterRates": { + "0": 8.22 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Translation API", + "MeterTags": [], + "Unit": "1M Characters" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "007b1c5e-cffc-4d20-b973-bb500d3a48ea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.224 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d3103db5-2146-405b-9e46-342ba37f3c30", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f3217962-eb27-4458-b0bf-4590d734e4bc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.808 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8c244100-15f8-44bf-a154-889edac41c7c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.34 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2fd570c1-302d-4f6e-ba43-99bdb401a4ec", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "76b1d83a-bc99-47c5-8d61-220e46cbe29d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "f1b450b4-7ad0-4b8a-9a10-96395fe8b67d", + "MeterName": "Basic Large App Service Hours", + "MeterRates": { + "0": 0.366 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d3be2491-c484-4e6b-a945-5ab2a16c1ba3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.192 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cd5ce06c-9ea1-4057-9ead-ca3e1074ada3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.34 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8489f14d-a5fb-432c-813e-173e65af4534", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.22 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ed5ea410-f2d6-45fa-9fcc-5ff1621c874d", + "MeterName": "Basic Elastic DTU Pack", + "MeterRates": { + "0": 0.0484 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "91499451-bdef-4245-a396-391186f0c32d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.292 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fee0384b-8a42-41f0-a57a-154df6aa58bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.356 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d97ccd1e-c3f8-410a-9eb0-477cfc09332b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1d1812b0-6fd1-4f65-92c8-ee34be0cfb2e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.447 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9438a523-ecc8-4d27-96e0-fb2fb560a3a0", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "499cc0c4-cd9e-4d5f-bece-04b5562b2453", + "MeterName": "MSFT Peering Metered Data 2 Gbps", + "MeterRates": { + "0": 872.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1990d677-c7a6-4535-aaa4-ff285544e837", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.015 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "10e6da54-063a-43a5-90c8-f44e452eda5a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.56 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9f3f7e8c-f456-4832-b83b-d67d9f3f8bb2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.191 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4d87714d-b231-4f85-8d20-247325b0e8ea", + "MeterName": "Standard S3 Search Hour", + "MeterRates": { + "0": 3.552 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "09204cf8-756a-4a41-baee-44b97084a0fd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.08 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4ef99f5c-eac5-4de2-8002-33b1bd67594d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.264 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cd6819db-f81f-4128-8fa1-83e77d4426bb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.236 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "1d67db70-49a7-43bc-9e9b-f0d220770167", + "MeterName": "Shared App Service Hours", + "MeterRates": { + "0": 0.01496 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f16c5954-aa3e-44b3-b21d-28bdde7780ff", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.068 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "bb1f930d-9a60-4d43-8120-383fa2095a7f", + "MeterName": "MSFT Peering Metered Data 50 Mbps", + "MeterRates": { + "0": 55.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5b84dfc9-3ec3-401b-bf7c-a28baf971309", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.646 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "171e55bc-69b4-4321-9bc4-badf6be18d12", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.441 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ab491206-a35e-4494-ba88-6eae8cab5fc4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.254 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4c646104-bbff-4be4-80e9-eb3b46e66dc3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.457 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2bb72616-fe42-493b-acc8-a7e469c1d10b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.25 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC24 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "6dae61c9-d6c7-4a79-b4d5-08dc2772365a", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "9299c6aa-2ffd-4c43-8651-d8fdc7b605e5", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "54e8283a-8b9d-4811-89a7-d278869e234c", + "MeterName": "Metered Data - 5 Gbps", + "MeterRates": { + "0": 2180.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Integration", + "MeterId": "7f58d3b3-5084-4cc1-b67b-6811aa90e0fe", + "MeterName": "Developer BizTalk Units", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Services", + "MeterTags": [], + "Unit": "Unit Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "37951661-14a9-4902-b792-fe93c06db5f5", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0bb04aa4-6d14-4a5a-98e6-1a08cd41e304", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.551 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f4798806-f76e-4a79-bb4a-4106f95ac4a2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.084 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC6 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2c38f6f1-08ae-4f71-be2a-90c399f6678d", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.156 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d00976a4-627e-4d90-aac4-c3a48a545baa", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "91fa5b91-a5c5-4e72-af7c-461c8e0aaaf1", + "MeterName": "Premium Elastic Database Existence", + "MeterRates": { + "0": 0.4435 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "4c821f32-3dfc-4d0d-8993-9d29213cfa0a", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1673181d-64fd-4161-8d99-32f0fd6216b8", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.163 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "196c25b8-32a8-4de5-934f-b9596864d163", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.853 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6c6af78e-38c8-4d77-a369-089ec8684db1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.588 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "32a71824-3409-4f98-a230-206a9e2c7276", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4742b266-e4d5-41f8-a0db-2729b86b6a7d", + "MeterName": "Premium P15 Secondary Geo Database Days", + "MeterRates": { + "0": 438.176 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "62c64b6c-4033-4e20-ab33-9e81271ac12a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "8f967c58-b144-4bd7-8882-8bf02767c839", + "MeterName": "Zones", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "DNS", + "MeterTags": [], + "Unit": "DNS Zones" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "99f7b160-15e4-42c3-ac14-f8fec9161286", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.147 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c6cfc1de-0f0e-4801-bccc-8b96d4985e0e", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 88.594 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "616c2a83-75fa-4dda-b521-f0d823db9171", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.19 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "01ea797c-dda2-42cb-85bd-8aca8726752a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.312 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "713a9945-7322-4c6f-aff4-5f40a494d046", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.78 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b0e46a05-2eb1-41a3-bffe-fd8c117373a7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise (4 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "39f5d203-ea5d-47aa-8d8d-f218979237b3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.752 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A8 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "9e34aff8-7cd8-4462-8672-8a8611458f3d", + "MeterName": "Standard Medium App Service Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6ecfdba6-a686-4325-9381-cbab8f45ddea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c2ecbbbe-3acf-47a6-947e-5993860a45cf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.888 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "ed8a651a-e0a3-4de6-a8ae-3b4ce8cb72cf", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "10f9c657-5ede-47f6-a8e5-337a4a7d7b1e", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9e436e9c-9852-470a-9baf-2d79d5f4fa65", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.484 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 100.0, + "MeterCategory": "App Services", + "MeterId": "e0d5dad9-c5ce-433d-bea3-2b4c699c3d5e", + "MeterName": "Active Users", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Mobile Engagement", + "MeterTags": [], + "Unit": "Users" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7c3e70b9-0447-45b1-8814-f895758bb050", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.73 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV12 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b79ddebf-0377-428e-8ecf-830f49e963c6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 12.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Enterprise (32 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "92bd3fb5-8753-4b26-9df3-e3d4150c0d82", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.73 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d6a436c9-342b-4a01-80bb-28cff2f170ac", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "06cd85e2-e7d6-49a3-bc94-2c31c8f7d433", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2735169c-ee53-4857-b649-911871cf1a40", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.575 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "87503d88-4da3-474a-85e6-480d8bf131f6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.57 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16m Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b5120ce1-6521-489c-8654-b3d86894b3e3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.111 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "812a4cb1-2073-4798-9b85-12403bf0e10a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.452 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cedd8f26-0ac5-4701-bf1c-c3db8ca4ae9d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.607 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e5960556-fee3-41d8-9329-ae68f9aee68e", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9058f27f-aaa8-4147-98e9-bf8910101455", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.33 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "172469b8-5df4-4d98-a122-d0b5b85db747", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e2e9a516-56f0-42b8-b5ae-46f3c8031a89", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.098 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "c6b26e5e-174d-43b9-a4f6-177495eaff75", + "MeterName": "Premium CDN Data Transfer - S2 (GB)", + "MeterRates": { + "0": 0.34 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c40beff6-983d-4dc7-9be6-16d19a9fad7a", + "MeterName": "Premium P6 Secondary Geo Database Days", + "MeterRates": { + "0": 112.5 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "200aa0bb-a796-4a56-8fc9-8923633e8ca3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.28 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "747b7ae2-1334-4818-8b89-071fd47e2b95", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "L SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "dae16e20-14b4-4e7a-b92d-888fc0dbe3b3", + "MeterName": "Wildcard SAN (Units)", + "MeterRates": { + "0": 1950.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "S2 HTTPS Certificates", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "761e0657-8fec-4840-a7be-b7099817f573", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5b69bef7-ee70-4b02-89b8-3b3dd5ddcc00", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "19713ebb-dcd4-49c0-aab7-f94d918abf42", + "MeterName": "Standard S3 Search Hour", + "MeterRates": { + "0": 3.552 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "690e36d5-35b1-4f48-8388-af55eee973b2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.327 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "dd364a43-b62b-488e-b4cc-f32eb80ef3e9", + "MeterName": "Basic Elastic Database Existence", + "MeterRates": { + "0": 0.0193 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "b716ab59-2f38-4f5e-89a6-e8803311a749", + "MeterName": "Basic Large App Service Hours", + "MeterRates": { + "0": 0.375 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7a65b178-2133-400b-8e4c-7b8eeda86d81", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.091 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c68c2804-7ee9-41e9-a4c7-1082df6b4b7e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2375 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ddfbd821-4670-40b9-bee6-408fec422e7a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.443 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "40bdb3b2-5577-4448-8614-398b4b63b7ac", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "59f510fd-2158-4a48-aae5-c75b7527b6a8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.446 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "46b89bd8-182a-4418-8feb-8242b1c97461", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b73c4c98-f0b9-4671-972f-6973689cbd98", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d0b04ace-4151-4dc3-94fb-89346c04b8e2", + "MeterName": "Premium P1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 18.75 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c028d478-c49d-4e5b-9c82-116d4b30fe9b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1894e023-9852-4e33-8d0b-8c8fa480c7d8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.447 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e284fd51-37b0-47c8-9219-76edfac28734", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "70ccc326-3eb4-4111-bb1d-d035865bf993", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "36b77e87-4987-4d19-9c49-319e9d55c296", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.0784 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e7056c15-dc2d-4913-8b0e-06fd876a88ea", + "MeterName": "Standard Managed Disk/S4 (Units)", + "MeterRates": { + "0": 0.845 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a27a89b0-76d1-4b4f-a39d-76f469f01b70", + "MeterName": "Standard S3 Secondary Active Geo Database Days", + "MeterRates": { + "0": 6.048 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9952ec9f-916b-46f6-816f-4a1fef973327", + "MeterName": "Premium P18 Secondary Active Geo Database Days", + "MeterRates": { + "0": 499.982 + }, + "MeterRegion": "AU East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "81cdc11f-5653-4c41-ba45-7fb2d7db5f01", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "31997d1b-4106-4d0f-961d-782c9667ba6a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.675 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "65bc97c8-cdaa-4c17-acff-7d80c9f6dfac", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.586 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1b0dc313-f85f-46e4-aef1-3ef953281047", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.978 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e13adbc5-3ece-44fb-b579-1aaf67171eae", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 148.68 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "25a8afab-267f-4272-8bf1-12be387604be", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0413 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "26af5afe-468e-4c09-b45f-cded010f0ef4", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.145 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c361d09e-c625-483b-88f5-79ae9026c68b", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.039 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "af5d6bd0-7880-47f7-b79d-0d4cacb3b9e7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.575 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ed642548-1aea-41af-8416-200d47c7d39e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.25 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MSFT R Server for Linux (6 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "794dcb90-0793-43e6-9909-70d29974e56d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Red Hat Enterprise Linux (6 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "fe7a13af-d09a-4dc9-87f5-4360b9e3e84e", + "MeterName": "DWU", + "MeterRates": { + "0": 1.3307 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1af1ffa0-3398-4d72-ad92-41de56d854cd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08184 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c7f09e46-ad79-4984-89f4-77ebebe828e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.4392 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "57d93ed9-2467-4203-8daf-8c80c4aa98c4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.932 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "50d55675-fcb8-4354-a4fe-eb8c97a5f8b1", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.288 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A5 OpenLogic", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "60a4601f-93c7-462d-88a6-f4affb5f3d79", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.075 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f0a26d6-1731-417c-929e-c39b74c07219", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.61875 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ede0a17e-2710-42e3-9dec-52b599246828", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard and Weblogic Server Standard (1 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "72a281ba-5a01-41bb-9a4b-2660ce110dc2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.071 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a2614b07-eb8f-443c-8f4e-1b3be07eab51", + "MeterName": "Standard S2 Secondary Database Days", + "MeterRates": { + "0": 2.06 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d45c2320-4bf0-4c06-92f7-86ff495bfe9c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.248 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2f98d9e0-efbf-4043-ab55-9d5c9fc8de76", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8af4705b-fbeb-4086-8a40-ce9288bb9a0e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.351 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "7f02c835-8cdd-42c3-b3d6-676aa3b99a8e", + "MeterName": "Standard C6 (Hours)", + "MeterRates": { + "0": 2.625 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5ea68dc3-5789-4f1f-875b-44ed4198255b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.356 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7ed5641a-0077-4aef-8878-a8bae9ed6e2b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3c261d7d-f303-4cee-83ed-d8b7bd606b1d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "81e3c8e4-c529-4a9b-b060-dd4181dcb4ee", + "MeterName": "Basic Large App Service Hours", + "MeterRates": { + "0": 0.376 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7f18b739-dc2d-439c-9062-ae5a9ee42205", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.37 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d96f1e8f-b4cb-4a24-8ab7-b20f4327ac1b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Standard (6 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "930caaca-5f12-4ecb-a82b-984fee8af988", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.242 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "57929354-a1fa-4827-af2f-952156021612", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.741 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "47ce0488-328e-4f4c-b03d-422842d6e3a1", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "314ac17c-0b11-4513-8be2-363b9fe40e77", + "MeterName": "Premium P1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 16.5 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "30cf8266-ff5a-4f43-aa52-fa4d080ee691", + "MeterName": "Standard S0 Database Days", + "MeterRates": { + "0": 0.605 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b8946416-b0e7-4a8f-b89c-66f49d7742d3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.536 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f2437caf-0a07-40ad-ab87-f7282fedf031", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.313 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dc03c0ba-c517-48b8-9253-2b7e7b6b7633", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.323 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "44b17efc-018c-4da5-8696-98922dd0ff76", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.793 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8609a286-12c1-47b1-a299-e30cd9ba01d1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "41b9853e-a81e-4a11-a548-77473a656a73", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.032 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c59f00bc-78a3-44d1-80de-38d289063522", + "MeterName": "Premium Elastic DTU Pack", + "MeterRates": { + "0": 0.2038 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "edc74778-714f-4c0a-bea8-c9298f96b447", + "MeterName": "Premium Unlimited Data - 10 Gbps", + "MeterRates": { + "0": 54300.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "1256f12f-8cb3-40a0-88be-fa1bf3be3fbb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.551 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "cd87d046-4b62-4f01-b50c-0f350da7c574", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a132330d-b04f-41c7-8de3-4c17db14294a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.804 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c2a1fffe-383e-4f1e-b08d-48074117d1af", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.032 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "42a5d99e-5f77-4f56-98c2-08b2db5b7f95", + "MeterName": "Unlimited Data - 100 Mbps", + "MeterRates": { + "0": 575.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cc84f2f5-c33f-41c9-ba16-a616f9f9cadd", + "MeterName": "Premium P4 Database Days", + "MeterRates": { + "0": 72.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "358f1f1e-6d6c-4373-b8ed-908d5fdc8c68", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.129 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "f2dee52c-2ead-4685-b743-d2cac3073ded", + "MeterName": "Standard Automation Unit", + "MeterRates": { + "0": 20.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Automation", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3ce92048-3f40-4096-8be1-f396e3dc23f7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.672 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2a93ebad-7aeb-4ae2-9ff5-99e5f10f70ed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.233 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e17e579f-adb6-4068-a2a2-6fcd9d6723ce", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.177 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "11a9e87f-258d-4092-8108-0bbc3af4b012", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ca1abbca-7110-4bd1-ae63-fcbe038fde4a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "60bd8863-c921-488a-bb52-24f9bccb436d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.043 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d09e639b-288f-4571-abbc-e1f42f934138", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0264 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a97168b1-7066-4da9-a035-cd5b4fec4e68", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8c8504dc-d1e2-4586-bd49-306cc22246a7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.19 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4cb1dfe9-fcce-4260-9586-f504be3cb1c5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.062 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0e3a3c0c-b919-46d0-af96-c53285007dd2", + "MeterName": "Standard S3 Secondary Active Geo Database Days", + "MeterRates": { + "0": 5.3226 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d35bf47c-2785-430f-906a-da02524ba0d1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.645 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "358db962-a2e1-4904-b09f-dc1b070b322d", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8d10dad3-0383-433b-8fbd-2dbd510a3d7d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.093 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0c39ace3-f009-4f3e-b0ff-ed336bbe658b", + "MeterName": "Basic Elastic Database Existence", + "MeterRates": { + "0": 0.0184 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d6f15c7c-326e-4fdd-99a2-b962ee65399a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.065 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1be90034-f439-4135-b9b8-6329123ca867", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.19 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c2ca408c-9707-4b1e-ac8a-b2c4989ca405", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.1136 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "99354be6-a7d8-4647-a20a-d2f300a9a9fa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "264a4a65-0528-41ba-a814-eb8d94f6ed14", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.055 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5eb50509-d65c-4f73-90a3-c6ee7d170e51", + "MeterName": "Standard S3 Secondary Active Geo Database Days", + "MeterRates": { + "0": 6.048 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cfb41775-3fdf-4fd7-93ff-de384d1bf014", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.351 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c82d4ba0-9629-45ff-9f73-a9e64afef5f4", + "MeterName": "Premium P1 Secondary Geo Database Days", + "MeterRates": { + "0": 13.5 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ad8b9e62-5b73-4de3-84ca-081df0a58adf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.585 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "90abe154-a008-4926-8400-58ad762a5e1d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "863d4bfe-32b4-48be-818e-d04b3ea6ff3b", + "MeterName": "Premium P11 Secondary Geo Database Days", + "MeterRates": { + "0": 193.74 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4511d5dc-c429-4271-b631-f5c3a6fe92f1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.396 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "89b769d0-4522-4dbd-9395-c67e4dee596e", + "MeterName": "Data Processed (GB)", + "MeterRates": { + "0": 0.001 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Stream Analytics", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "845635b1-577e-4fc4-87d9-55dbf4b284e7", + "MeterName": "MSFT Peering Unlimited Data 500 Mbps", + "MeterRates": { + "0": 5200.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8737ce3e-df4e-402d-8328-03cf1d544ee5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.057 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "426bc81e-8a78-4bf3-a8a8-c862324e2fb7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.249 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e452c905-a88b-4b71-9711-4e13c3f38098", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b37c324b-e6d9-4854-ba4e-4038b2208aae", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.52 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ee872742-aec8-4cbe-b674-e4773401df36", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.278 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7befeed2-59c7-4292-a6dc-50e6fcddce5d", + "MeterName": "Standard S2 Database Days", + "MeterRates": { + "0": 2.7685 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "3244138c-76e9-4c90-9aab-954fde2ba7e7", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "cbd5bdb0-9cd0-4a36-b39b-4620a16116f2", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.033 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Zone Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5002af8a-185b-4711-b1fe-95dd014d70e1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.256 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Web (32 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 1000.0, + "MeterCategory": "Service Bus", + "MeterId": "85f84482-123e-44a9-a2d5-cb53f2abe0f8", + "MeterName": "Connections", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard Messaging", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9e250639-2880-47d3-be00-6e2e538c6361", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.9 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC6 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b27247ee-a18d-4dd2-8b76-2e41bd30403f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.47 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "892fa864-ffca-4ab8-b3c9-2bb97f3fcc53", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.223 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "431ad86c-330b-49e5-a867-4cb68ef7e1bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "fdad599c-0589-42c4-8f8b-011e214baffa", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4562b9fd-4e8d-4391-8956-4ee862303a92", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.127 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7f5d9ed6-3ee7-453c-85a7-8aa5212a949f", + "MeterName": "Standard S3 Database Days", + "MeterRates": { + "0": 5.477 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "bbef7984-0aad-47fd-87ae-ca432abca906", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 19.71 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "80d5d1d6-2147-4649-ae35-3c1f21156168", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.553 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "9d5aa7b5-5fd6-4784-b0ed-578f4468ad34", + "MeterName": "Basic C3 (Hours)", + "MeterRates": { + "0": 0.225 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "19a0de76-1995-4ea8-8cd1-7c8a6931e3c1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.292 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "429a3742-bf40-4a16-868a-4a476c43caf0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "238bc0f8-d9a0-4260-86d1-04deeef23538", + "MeterName": "Listener Units", + "MeterRates": { + "0": 0.00672 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Hybrid Connections", + "MeterTags": [], + "Unit": "Hourly Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "19eabdcf-9aa8-4211-b1c0-053a4c448705", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.129 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c29bdbe6-a8d1-4001-8b41-7c93b98a011f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 11.59 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7b8ac714-fe76-4b43-820c-7a95720d4deb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.478 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dfa19b87-291a-4ded-9cd6-70e2ae924cde", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.61 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "06a1fe56-789f-4270-9889-355d487ef8cc", + "MeterName": "Standard Large App Service Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "01fb268f-b2ac-4f77-be63-80ce85a109c0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.646 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0500c456-c308-414e-83ab-a2950e3e019e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Weblogic Server Enterprise (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "8fbcd0b0-01a3-4601-87f0-7e653955a56f", + "MeterName": "Standard Large App Service Hours", + "MeterRates": { + "0": 0.504 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "55361ac4-efc7-45d1-902f-0a5fe0810483", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5c2b734d-9779-461f-8281-a6c89c7eadf0", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cd16b940-42b4-4c0c-a68a-1cee7d98c278", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.196 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f39242de-ab79-4dd9-98b0-9d5de6f0ea74", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.239 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "05c20f9f-5274-4468-9f77-055569de29e6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a835327f-c6fb-4d1a-a501-803dcb41e304", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.186 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Scheduler", + "MeterId": "b6b48f3c-29e9-4ca3-94e6-2a34c9246dbc", + "MeterName": "P10 Premium Scheduler Units", + "MeterRates": { + "0": 139.99 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1 Unit" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "68eafe48-33d4-45c0-9560-de4c644dd1a7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.404 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "bc07e09f-e3b5-45f5-8b8e-cd1ed044a8fb", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.009 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "52c400e7-7180-481b-8aa7-5c021661d031", + "MeterName": "Standard S2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 2.42 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1e2cb6ad-9fb4-4387-bbf6-ca1d01bf471f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.284 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a9d77256-44b5-444a-a619-9b201d0fc250", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.4 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "11f46405-b184-4c05-a057-c9a9393b475e", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "9f511a75-8eac-415a-8f9c-f14a1e389534", + "MeterName": "Premium Unlimited Data - 10 Gbps", + "MeterRates": { + "0": 85000.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "39b82011-38f2-4cae-9c0d-91064387e8a9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A10 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "62d94a65-9300-48a6-8c15-0e70fc41eb44", + "MeterName": "Throughput Units (Hours)", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard Event Hubs", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c3507fa9-88fe-442a-a984-c3278345f51e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.159 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "bb26636e-2a51-4a05-bb07-fbabf122ad5a", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3886 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e829dd7e-41f0-46d4-bc84-1cc13791e254", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 19.71 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "28ffa039-bcad-4cbb-964e-fa8bd19aab5c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.678 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a0a1729d-abe9-4ab3-9934-fa48acebb542", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0425 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f262096a-bbd5-4a02-8c80-a802580a6955", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.248 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "79f04bb5-2872-4b4e-84c5-c6b6006b4503", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "6cc3fdfd-45fb-430d-846d-f9ba872b2342", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.0044 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f36a9a42-8b31-47ed-9359-2c59f30679e2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.323 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "36dd022a-c4b2-4f41-b568-4097435f21fb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a2e2d172-7807-4356-999b-3a68c77e336b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.872 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "26794da9-d7d7-4a2e-a445-920bb5fd274e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4f46e575-3dae-405c-9b96-473bb08f22a9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.288 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "b24b3aa0-f4ff-4546-9bbd-562b193f9924", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.012 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "82d05a20-6c8a-44bf-9f69-063eb6bc4708", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.062 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3ad586f4-1945-46f8-9a96-db723f5432a2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "42b49a56-132d-4182-8061-aec164a8a5a8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.371 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1d0eaa49-0140-4f00-8b6d-2aacfd087e78", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.256 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c1f13300-3206-4021-99b9-ccbe72f0aa1a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.742 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16mr Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e622c817-bae1-49eb-880f-63b0b362de8b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.68 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "G3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0c1a39f2-b65a-4f4d-b3be-687d7492cb27", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.371 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "72f848e8-95a6-4852-8269-f631faa9e526", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.114 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b7012b7d-8eb6-44a4-aa78-0c62926fb867", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.297 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c1ca5d61-2679-4721-91b5-d5d46e3e879a", + "MeterName": "Premium P1 Secondary Geo Database Days", + "MeterRates": { + "0": 12.71 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "2b0abe88-ac18-40b3-9d4d-6c44fbd020e9", + "MeterName": "Premium Medium App Service Hours", + "MeterRates": { + "0": 0.756 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0ad0f511-be51-4fcb-89cf-10708ad27346", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.193 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a62b8222-14da-4bc3-ac21-c1fe1f033c64", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7f3e1d2c-74d6-4f47-b1f5-f929290ece86", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Enterprise (8 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eb81f807-54b5-415c-b040-3b6fd796dd46", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.9205 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV24 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d04f9494-9489-4ccd-88e4-a58f94862ab2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.572 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "faa5e005-c170-489a-b16f-0ab1a26f7ee9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.36 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV24 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e454e560-982c-45a9-973c-6c770b900b51", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.23 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Analysis Services", + "MeterId": "13a77aea-c723-4d48-b479-56d36fa53e62", + "MeterName": "Standard S4 (Hours)", + "MeterRates": { + "0": 4.055 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Tabular", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "de9a824e-53fe-4a07-b5a6-d8c4e4e7131b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.382 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "55b377e5-ccb8-45bb-b5ab-fbbb968ea549", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.191 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "234146dc-aa5d-4869-a6e9-8bba3469518a", + "MeterName": "Premium P11 Database Days", + "MeterRates": { + "0": 255.6 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "030ca10f-6965-4498-9708-2bf551da5d0a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.672 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2003e5cd-be8f-4579-87f5-13c871736c73", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.713 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3b888881-ffcd-4e72-b297-d4908a9ab208", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.016 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "aa0cc21a-0c1f-4d46-a094-dbbc115583fc", + "MeterName": "MSFT Peering Metered Data 100 Mbps", + "MeterRates": { + "0": 100.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4285e88e-f4b0-47ea-aac3-2c59a3dbff96", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.73 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "580ad661-e826-4429-9cc3-f71625c675c5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.32 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ecd2f1b6-d122-4ee5-8ae4-94241da0f433", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "546766c8-64f6-41ba-9131-5fac73e1339f", + "MeterName": "DWU", + "MeterRates": { + "0": 1.2097 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b4b48b24-be05-4416-81d3-87de01a7c264", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.75 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "88b82ac7-2d90-40ef-bcee-0ea460b2dd20", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.105 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "99d5147d-a59a-4ae0-85fd-34cb380bb1e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.9 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "b6a278bc-4495-4a3d-b04e-c2fefdc81211", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.42 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "87d8c898-ebcf-4d50-b38d-b6f22a402168", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.315 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "274d03d5-3adb-417c-b3ce-926183c65736", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.532 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d767dfd0-59c2-4fd7-9cac-27c071c705aa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.732 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "16a2ce07-c52e-45ec-9e6e-4098373d79da", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.376 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "34b50850-816f-4e69-95a8-b51f7323f162", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "26a235b5-5510-41e8-88be-40255a42fe2d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.349 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7c7d0d87-ac55-438a-b6f3-e966d249ef85", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4c8c3c48-e326-483b-ad9d-77f111c281ba", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.106 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e3538ce6-2940-4c6d-b344-3cab43f70c2a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ec4fd5c7-b1d2-4e32-a9eb-051225a5bca2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.567 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "4e177781-3d01-4e17-8cc9-5c45cdc8f286", + "MeterName": "Standard S3 (Units)", + "MeterRates": { + "0": 40.33 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Analytics", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e30fa569-1169-4da8-976a-210293a26450", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "b1257e43-ccd7-4204-b012-27b569aec51b", + "MeterName": "Content Moderator API (in 1000s)", + "MeterRates": { + "0": 0.8 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1K Transactions" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "484f644d-7ac8-42fd-a69b-73bf8fdf4707", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.374 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "5331cf2d-64e2-4b55-9275-96d5f2219bee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.76 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6d5ccf45-e791-4988-83f5-13f1e72bdc6f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.346 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "bdba065d-516d-41f0-a765-d5d1f58f94bf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.962 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "55541c08-cd2b-4178-8542-cf4ffd395fd7", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "50869abf-e114-4b42-bbe3-65ee0ddbd03d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Java Development Environment (6 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "5e946cfc-acc9-4a96-895b-92386fa63c9c", + "MeterName": "Standard IO - Queue Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "30338b16-1cc3-4500-9f22-142da3f4c4e8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.18 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "45082891-53c2-487a-989f-60cfca62080e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise (1 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e6ee62e8-23fb-4f93-aa38-d77328ccc311", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0e600eec-b55f-4f9d-8c3a-1cc44ba59d5c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.139 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "ca78bb15-7891-4974-83d9-52f48dfca598", + "MeterName": "Wildcard SSL Certificate - 2 Year", + "MeterRates": { + "0": 539.98 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Certificates" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5e57c3f4-0d75-46c2-9447-0fe12c780959", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "afa891c0-2cf2-4c3d-b6ba-37b485ec529d", + "MeterName": "Unlimited Data - 10 Gbps", + "MeterRates": { + "0": 82000.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0f5b7a97-87a7-43e0-9085-6b6250f0243b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a0a0ccfb-be28-4c4c-b790-b1d2c0bf9efc", + "MeterName": "Premium P2 Secondary Geo Database Days", + "MeterRates": { + "0": 24.74 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7ca908b9-ecfc-410f-b8e5-f24421fa6dc6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9de7a7e9-d20b-4ba0-8dc0-53bbaddb39cb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.468 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "844aaf9e-c927-4a9f-8a43-0f13e0cc9c07", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.184 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4d67ea2b-68a0-4ac5-9007-f4c0e6e8da74", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3a9e19c9-d012-4ba6-bdeb-a34e02f79681", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.598 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "59aa598e-f397-4465-a4ed-203d3ef63a40", + "MeterName": "Premium P15 Secondary Active Geo Database Days", + "MeterRates": { + "0": 679.0171 + }, + "MeterRegion": "IN South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e4b5c66d-cbc1-4885-b05b-c14c3ffeef64", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "1ad2312d-b4a1-428e-972f-01d5b511c7f5", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "645b4218-8e32-48a9-9077-4041a2da7e19", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A8 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2d95e452-196f-4918-9d23-a2208e62dca9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.089 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f1cba056-ef57-4ce1-831b-b67168724adb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "48261267-71d7-4f04-ba3a-2836753ee159", + "MeterName": "Premium Metered Data - 2 Gbps", + "MeterRates": { + "0": 3122.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2cf60c40-2347-4e28-8ac9-a8eba2c6c6f9", + "MeterName": "Premium P11 Secondary Geo Database Days", + "MeterRates": { + "0": 169.36 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "be63f96a-ef4b-42c1-9365-f9fa0e7431d0", + "MeterName": "Standard IO - File List Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.015 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8909ae3a-eccc-42a2-8979-aa43f8409053", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "95c1ad0e-1b45-4425-86de-85df061728ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.42 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "ef7de424-8c0a-43b9-9863-d82fe5e9443c", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.055 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "61ba1651-3fb8-4899-b7e6-858c5fd9c7df", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "35c93aa0-9c89-458b-8b7d-0ada03106576", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2712f78d-e46a-4917-b631-0b25463b7e69", + "MeterName": "Basic Elastic Database Existence", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9854f879-aaf7-4ee5-bfb2-773778935894", + "MeterName": "Premium P4 Secondary Geo Database Days", + "MeterRates": { + "0": 54.69 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "53cf4291-a786-4eac-b1e0-30cb12af74db", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.893 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "84a87019-a487-4fe4-acc5-980c744d4c44", + "MeterName": "Standard S4 Database Days", + "MeterRates": { + "0": 10.6451 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9fc25025-8706-4aa1-8a43-ba50c742b240", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.025 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ff7b2f74-2259-49ab-84dc-f6b0b1882729", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.437 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "8d8533bf-5142-40f7-a670-cbb5abb21c12", + "MeterName": "Premium P4 (Hours)", + "MeterRates": { + "0": 5.55 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "5d6f9d93-4839-483f-ab6e-89621ef315fd", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "f5b2bd35-220c-4dca-8541-d7e32e5b9de4", + "MeterName": "Standard Medium App Service Hours", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "af7c3f78-e523-474c-917f-7d7100b09399", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.528 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0b98d3db-29ff-43fe-992c-c77e6b402900", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.312 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "dfacce61-cae1-44de-9c39-1ada59995bda", + "MeterName": "DWU", + "MeterRates": { + "0": 1.3912 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "06ece668-51e3-4103-9959-21e38c5ff40e", + "MeterName": "Premium Unlimited Data - 50 Mbps", + "MeterRates": { + "0": 972.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8f551411-842b-4a4e-b184-21d11d6ccb53", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.191 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "722fc083-df70-41ab-99e4-c33d72a1eee4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "74c05f9e-ef82-46b4-82bd-022f1c6c4310", + "MeterName": "Premium Unlimited Data - 1 Gbps", + "MeterRates": { + "0": 10150.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "434a43e4-0028-423e-877b-c6cd0d99b98e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "42d19c92-8376-4965-939e-1c147656adb2", + "MeterName": "Premium Metered Data - 1 Gbps", + "MeterRates": { + "0": 1886.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "34a8c52d-943d-46c2-8168-4af851e02b87", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.505 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d4a51af5-1df1-4751-8177-2ab5801a92a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.701 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c70ef5d8-8452-4ce0-90db-c88dd28e4d83", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.156 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8m VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "36c961e5-3c53-4481-b339-a10c6fe0f491", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.0043 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "42a99550-efdd-4a25-be57-4653acec19a9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.068 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8b44130d-9689-441a-88a9-0ee61aa53f33", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 135.17 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e058c6a6-1ec0-4f26-8eeb-0280e746374b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.304 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e2febc1d-cdda-483f-8349-519bf84457ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.264 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "dbfc8837-f8dc-4008-ae39-13e81052cb67", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.375 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ca31f7d5-3c61-4c9b-beca-54b5bbb4eca4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.64 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A10 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e39c3838-26f3-48cc-943e-59847da39886", + "MeterName": "Standard S2 Secondary Database Days", + "MeterRates": { + "0": 2.19 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9d12b1b2-80f8-488e-9a1c-18951a684bb0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.185 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d688b491-e031-4aa2-bb87-be3f346e2b8f", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0e03afd6-cb40-4a1b-9938-0bf4aaca3879", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "e6236d80-a06e-4aa1-a0af-f1d566b27093", + "MeterName": "Standard API Management Units", + "MeterRates": { + "0": 699.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "API Management", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f42c8e3f-f071-417b-9ca1-b61e258dd898", + "MeterName": "Premium P4 Secondary Geo Database Days", + "MeterRates": { + "0": 49.82 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "c3c75f61-3ad2-4c65-adfb-ea824f22ac2d", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "063f5816-fb30-49ac-b8f2-918422c5c9de", + "MeterName": "MSFT Peering Metered Data 500 Mbps", + "MeterRates": { + "0": 290.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "98ec2a99-7b0f-46e4-9f53-f2b026367235", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "9fcfb086-65c6-4393-9086-f788cd7c1f95", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.385 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "995600f2-fffe-475f-b81a-58b0204ac1ab", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6336 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "4f372b18-055d-476f-bc60-a3122322a91f", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1b7b55a7-769b-4926-8175-8d62227090a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "93a70ba2-693c-4b44-bbbf-fe6fc1d1dcea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.363 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "ebc7183b-3c67-4bb5-aab9-8e7c6f9c493e", + "MeterName": "Premium Medium App Service Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "bb138fb6-f26d-484c-bc6d-3310f7eb29f8", + "MeterName": "Premium P18 Secondary Active Geo Database Days", + "MeterRates": { + "0": 496.7732 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "da3b2fcb-7438-4f14-ab45-e0d20a4eca50", + "MeterName": "Standard Elastic Database Existence", + "MeterRates": { + "0": 0.0887 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4e9ac498-5cae-47c4-a56e-81bf98dc47b9", + "MeterName": "Premium P6 Database Days", + "MeterRates": { + "0": 144.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a411b52a-ff69-4fc6-a1af-10bd4d87c794", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.285 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8m Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "8555280b-a4b1-46fc-9678-b69953eb6b75", + "MeterName": "S1 (1 Million Characters)", + "MeterRates": { + "0": 10.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Translation API", + "MeterTags": [], + "Unit": "1M Characters" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "90616ca2-ad11-4399-ac22-538d2b55ff5e", + "MeterName": "Standard S2 Secondary Database Days", + "MeterRates": { + "0": 2.0706 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "369314c0-2374-43a3-972b-c4ff2c225d90", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b215c4fe-e9db-438c-9f3c-8293ab7700a0", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.1533 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "524d6c11-79ad-4ace-ba3a-7c23a4823aaf", + "MeterName": "Premium P4 Database Days", + "MeterRates": { + "0": 75.0 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9b21f9a8-2a79-4ff8-b86a-499b2e7a30e6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f1283491-f2b8-4b2c-a22b-27cdaf0d563d", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5229ef8a-9100-4374-b92b-9062612fb6d2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.396 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a251032a-48b2-400c-8ebd-3c53f513cd77", + "MeterName": "Premium P11 Secondary Active Geo Database Days", + "MeterRates": { + "0": 258.32 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b5f52b18-a942-407a-bc94-215fa27bfaeb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "85552f02-d42b-4eae-9078-a7c3df9b06bb", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d856e8e9-da35-4258-81f9-8833747ab079", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.76 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e5d88e13-47d7-4a38-85c7-6a6d24f6b525", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.378 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b7c8a680-223c-4672-a75d-b48e932305c7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "55fb12e5-df8c-4f46-92fc-a33632a9d273", + "MeterName": "MSFT Peering Metered Data 200 Mbps", + "MeterRates": { + "0": 145.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dd62571a-6493-4254-9876-fcd5f78de617", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.223 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1995377d-4b3a-4d40-bf55-cc6084aa291f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.343 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "42bb05e1-6f42-4de1-a6ba-7ffb976cb560", + "MeterName": "Data Transfer In (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "9fba7d18-ce24-4e1c-b0be-b9b1f84ee772", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.283 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "a5ae1d7c-12ed-495a-82b5-5eef7d45c442", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "234e1e79-d850-472f-a433-75c88dd208ae", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "806f0a00-7fbb-4f67-a61c-26adc81327a5", + "MeterName": "Studio Experiment Compute Hours", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4dd36e14-61a8-4f6b-8c9f-98933e487d7a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "73dd3c48-d078-4725-9621-1f517fce8601", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.168 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC12 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "845cd1d2-a94a-4064-949e-ba9d18fd6227", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c41ce691-40c6-4d0c-afc9-bc1debfc2590", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.802 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "678d0e8a-df5c-481c-b180-aaa17471b1e4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.04 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ed15abb6-887b-478d-930d-08a4ea2bb796", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "eceaeb07-3247-4e79-8999-7b2d83b4ca02", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.034 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "dadee234-c5ef-47e0-bdea-5c3ba14f0a49", + "MeterName": "Premium P6 Secondary Active Geo Database Days", + "MeterRates": { + "0": 124.8 + }, + "MeterRegion": "IN South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "12f463c6-c70c-4bdd-be76-c187f1f9ddc1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.488 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b268871d-3d5f-4763-a841-2c96e71ebcfc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.86 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "13692c86-fc9f-45c8-8156-cdec45e44e01", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.473 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e3e8ad1e-318a-4438-8a9d-2d7a03d09294", + "MeterName": "Premium P4 Database Days", + "MeterRates": { + "0": 67.91 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8cd914f7-c15c-48c6-ae4b-32a244e4250a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.267 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c61d4186-f542-4ddc-af12-68e97afef4b1", + "MeterName": "Standard Elastic DTU Pack", + "MeterRates": { + "0": 0.0725 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "66b4c631-0299-49aa-a466-e6c5056ab88c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.229 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7182cc47-b654-42be-bb55-b882b04cf83c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "fc203689-76e7-4fbe-86b9-968d73231c00", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "391dd9ba-465c-41e8-8ac0-5c0d5c05e67b", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.22 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10K Operations" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ee476978-129a-4676-bdc7-28119eb6fcd6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.316 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "65397054-e00d-421d-a130-a616d314f981", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.904 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "0f824807-2376-435c-95c9-f992b67a07b0", + "MeterName": "Operations (in 10,000s)", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Key Vault", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6cf8e60f-65ff-4b3b-b0cb-a97173dc969f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "488e50ea-7a2d-42db-990a-2df9463c5731", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.188 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "87b3ed97-63d0-4fda-8f6e-02dddfada17e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.742 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16mr VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5c40bc3c-dac7-48f7-a80f-dae6ab91cba9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.198 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "753539b0-595e-4c15-bf48-76726398e42b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.056 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "387d3aed-a393-4ea0-9f6e-5fa4f4ed0484", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.125 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "57bd5019-bcfb-4876-927b-f1e95248e08e", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0528 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Batch", + "MeterId": "93fae6e3-3d5e-46c6-970d-0b51abe0ce04", + "MeterName": "SSD Based Instance Compute Hours", + "MeterRates": { + "0": 0.0175 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Batch", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9c72c2b0-fcbf-48f5-b633-32676663a2dc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.064 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c5f0cf71-ff36-4731-ba91-444ccf0590e8", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5a1638f0-dd4a-4aa2-9fb6-3592b781a8c8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.43 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "b40c3368-de55-4653-b7fd-5d3faca0b1df", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fc6283ae-2f1b-4ec4-9347-ed21c271f1dc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.741 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9995cfdb-2107-4bb8-8045-9bddd1773493", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.75 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "759260fa-ca1e-42df-b715-c28ce325161d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.5 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f7b6aea-8b66-498f-84f5-5426daf851c7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "d49c9908-5da0-4a31-baa3-9b7872fc3d09", + "MeterName": "Premium Small App Service Hours", + "MeterRates": { + "0": 0.366 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "26511691-774c-474a-bb32-7b7b6c87d5f4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.976 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "802c6139-c535-4751-aee6-87f01ab0ef63", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.786 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "6fe7781e-b466-423a-98e8-e0e4eeb82443", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 73.22 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c2eeb134-301e-469f-b9dd-d52aef79f3bf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.215 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "ee5e203e-6b6a-4ba2-961a-683698d03a02", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f3a71ea-5bd1-4da8-aade-12a0f85146d8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dd70200c-38d2-464d-9302-7e2d76d50665", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.156 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8m VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "47882bde-5989-4bd3-abba-1f58a9d4d756", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.16 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "345ad7b8-47cf-4fbc-9817-7863abd2af4c", + "MeterName": "Premium P6 Secondary Geo Database Days", + "MeterRates": { + "0": 90.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "85a742f5-4a8f-4a11-8d48-1c6559889d0c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.29 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "14453a9b-31de-47d1-bb87-45c907cd50a8", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "S SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "78593a17-7836-4f5e-b5fd-bbea0ba5cc7c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "fb4b3d8f-c59c-42c7-84f7-94b6e39f2606", + "MeterName": "Automation DSC - Free", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Automation", + "MeterTags": [], + "Unit": "VM" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9ee47aa8-3dd6-40a2-8c6c-24205a413c7f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.96 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Java Development Environment (12 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d9b8457f-9fd0-431f-b4e6-beb0315888a1", + "MeterName": "Premium Unlimited Data - 2 Gbps", + "MeterRates": { + "0": 12900.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "acd02e3d-72dd-40c7-9060-81c097e2af06", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.336 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "81081980-07ad-4f03-a8f6-351cabe34d39", + "MeterName": "Standard S2 Secondary Database Days", + "MeterRates": { + "0": 2.263 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "49338a46-b1dd-414a-9eb3-a1092502853c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.205 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "911f7f64-6ce5-4154-886d-755fb62826c9", + "MeterName": "Premium Elastic Database Existence", + "MeterRates": { + "0": 0.504 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "3663b628-2bfa-4c14-8892-4c115e61192f", + "MeterName": "Speaker Verification APIs (in 1,000s)", + "MeterRates": { + "0": 5.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1,000 APIs" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "981293da-2827-4c3e-8b2d-d7718b6c7368", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "dfae0fde-5e29-4474-8d6f-0544d28a8677", + "MeterName": "MSFT Peering Unlimited Data 2 Gbps", + "MeterRates": { + "0": 17400.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "671037e8-34d3-4057-a80f-3c6aad6f5903", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.504 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "36128a91-1e63-40bb-9674-6c61e999b0ad", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.596 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e1cbf0a5-d4f8-410b-90fb-981da262be39", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.08 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "59e9a26d-4876-4692-b3b5-a92a47df92be", + "MeterName": "MSFT Peering Unlimited Data 10 Gbps", + "MeterRates": { + "0": 51300.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9290be13-07f8-4691-80ca-1c1bfbc8ffe0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.311 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16m VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "243a7ede-007c-474d-ae93-3a629da977e0", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "000e0d7d-c353-4741-9ffc-e9fcdaebf8f7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.424 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "d75614e9-9c15-4553-ba4b-fc22b16ebcf9", + "MeterName": "Standard Overage (in 100,000s)", + "MeterRates": { + "0": 30.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Autosuggest API", + "MeterTags": [], + "Unit": "100K Transactions" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6d11920c-3c98-4b9a-90ba-95822d443400", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.084 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "82974b02-9f02-48c8-81d8-7abed5e0366a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.248 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1e32f8fb-14ef-4e37-8127-e56c9b71ce75", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1db8b679-c9a0-474d-b102-fee48a5684f5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.833 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "499a38b7-b11a-4b32-9ecd-bdcbc1a0748f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7d6f0f15-3c5e-4d6f-8283-d98b3d9ed347", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.741 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "6c76daf0-aeb1-4238-b8b4-18820c91eeef", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e09f47c9-bc89-4ad3-a7b5-294a647c889b", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "35ad9fdc-5b71-4dc6-a9b7-7aaec976adca", + "MeterName": "Standard S3 Overage API Compute Hours", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "30cec371-2b13-44fd-8eac-521676e0bab5", + "MeterName": "Basic Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.161 + }, + "MeterRegion": "JA West", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c2d3b4e8-a992-4bdf-b8f6-f1abe98b7a9d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8ba99860-6393-4364-af24-81793bb614af", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.795 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7286acf5-4659-44cf-8117-81687e89d598", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0ff2ef7e-ac54-4c59-9b1e-48d77e578d06", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4435cfb2-f4da-4070-86b6-2da0e9b2069b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a19ceba5-a164-4881-abbe-d9482ac8ac01", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.102 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5d2130d8-3ae1-4438-91c4-ee4f90b80c37", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.516 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "5ce1c654-7050-4663-b629-bcd12eb12287", + "MeterName": "Wildcard SSL Certificate - 1 Year", + "MeterRates": { + "0": 299.99 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Certificates" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5f08fa38-ace4-4e75-b13f-ff37a34e0541", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "adaa00f8-749f-4ec5-a9c0-36141e8cc010", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "21b60375-5db5-4536-9623-1e94dd8c82ba", + "MeterName": "S3 Overage (1 Million Characters)", + "MeterRates": { + "0": 6.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Translation API", + "MeterTags": [], + "Unit": "1M Characters" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c02d68cf-36b2-476b-8854-66fcf7c4a921", + "MeterName": "DWU", + "MeterRates": { + "0": 1.8146 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7caf87c6-82d3-4862-9d94-a05a41bf180f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d5907b69-eb24-4a45-babf-1e34b86ad723", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 16.8 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Enterprise (32 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2388a15b-1c42-4e8d-8ae8-69868b94455e", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.163 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8c2fec08-2cf4-4c5e-ad66-28d2621141ea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ce4a0abf-9245-44e2-9cbf-137f04491938", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.154 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f4c4b11f-ca34-4165-b75e-629b3572aadd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.128 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0b7bee3d-3ed5-43a0-9798-08f694bb8c84", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "776a858f-25d6-428d-808a-aa4f2a954dac", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.1 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "b2b7a89d-3208-4450-ab5e-a857ce780715", + "MeterName": "Premium P2 (Hours)", + "MeterRates": { + "0": 1.388 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4f6ae82d-1e88-4cb4-b4e7-93dae4083f97", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.0784 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4a3343ce-a1ab-46da-befe-8cb8e64396c7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.027 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16mr VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "fa70198c-dfa3-40c3-835b-e2677dce2d91", + "MeterName": "Standard S1 Database Days", + "MeterRates": { + "0": 1.107 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b2cffe2c-fa49-41e5-bdf8-59f74b3cb770", + "MeterName": "Premium P1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 16.52 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d9ee7acd-f50e-4620-a895-52f23002d789", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 67.59 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f0f393c7-b999-46bb-a6a9-fadc085f45ab", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.92 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Standard (16 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "aeb193e4-4c43-4255-8f0c-c7d7ce898316", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ba50fd90-a437-4a4f-bcdf-70eaf6751eef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.408 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Integration", + "MeterId": "7485e33f-6be5-4a5c-aacf-08c2aec688f8", + "MeterName": "Basic BizTalk Units", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Services", + "MeterTags": [], + "Unit": "Unit Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1e555ae2-05fd-493f-90cb-a8aaf83eeb93", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2a00fd31-1c03-49e3-ad32-928479d7a925", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.65 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "G5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "1fc19824-44b4-4247-b0c5-0137f98bfe7a", + "MeterName": "S1 (Hours)", + "MeterRates": { + "0": 12.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Speech Translation API", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "43c47123-353a-4b1e-8f4b-a15be1cc7ba6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.043 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fbe13d3c-0ac7-4f07-8f22-c70c9b41a83b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.367 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a4ec27b4-c834-47d0-9195-35143f8bc182", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.143 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ecf34d9e-0d4c-4051-be2a-138d4d83fb67", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a0915495-9565-4569-9179-cf2703f5d160", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.88 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "01e8eaee-ba76-4b8e-928b-0ca5a0d4358c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.094 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "54a377aa-8820-4916-a5ac-3b160c73d249", + "MeterName": "Basic Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.1948 + }, + "MeterRegion": "BR South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5d3b65a9-3e55-43f2-bb10-09144daf94a9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.53 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "924bee71-5eb8-424f-83ed-a58823c33908", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "M SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2bfb3801-1ec2-4f66-8a7b-be2f01ae3b7a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.092 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ff4f37d3-8a5c-49dd-9303-a9547f7d598f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bb5b077e-cadc-4a88-afbb-86151fe028bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a57441cd-6513-4e57-9a6f-bcac09315f4e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.975 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "152d2bf5-73db-43a0-8674-af33507558ea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.065 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5fa93943-9970-49c1-b2ac-d3f3fb8e7818", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.327 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "0ee6fc6b-9705-427a-ab32-17598ededbea", + "MeterName": "Indexer Input Minutes", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "Content Minutes" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "60bf2422-274b-43c5-97af-ce6cae691bc3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.65 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "97b39017-2e66-4b67-9f7d-8ec4dbf375de", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.188 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c4126ec0-f26e-4222-9774-bd40d36d46bc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.192 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9660d899-da2d-46e2-89fd-9bc046630414", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.293 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "795bbf88-99c1-46e4-8db7-4b27ce527c9d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.21 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6fed54e7-d7cb-4163-8a72-f1e324377146", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "de41ce76-7859-4333-b291-bf2cc454b955", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.348 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "965eb40d-f596-4240-aba1-b7ba8cc7e558", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "9dadd0dd-20c6-4898-be95-19a4089b678a", + "MeterName": "Premium Metered Data - 50 Mbps", + "MeterRates": { + "0": 155.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "a7d3bf42-bc5c-479b-be12-78a6de16f85a", + "MeterName": "Premium P3 (Hours)", + "MeterRates": { + "0": 2.885 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "56f176bc-7bbb-41de-b043-148ba6fb07ad", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.84 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a7cabf63-e8ad-4b56-bb1c-f8b9abce4448", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "41f467b0-5780-4c34-89ef-cbc454778514", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f7e7a2fc-3980-4718-be11-66edcec3bffd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7f627a53-5868-48d7-b4e5-7140894deede", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "df20461d-8344-4524-935c-2ed1094d4fef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.378 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "74c92629-8d27-4701-a6fd-c9966147e4bf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.323 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5f0abf97-90bc-4614-b49e-5f3806729b9d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.504 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "4e9518b1-3f80-4e8c-be0e-ff53c44a243b", + "MeterName": "Azure Endpoints", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Traffic Manager", + "MeterTags": [], + "Unit": "Azure Endpoints" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9d45f844-b959-4370-a73d-8922f30c41be", + "MeterName": "Standard S3 Search Hour", + "MeterRates": { + "0": 3.552 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "052b396c-1cad-4cb7-a60d-e6fe13b0f312", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.924 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16r VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "08bdde57-7811-467c-b4f7-ccc2e367eee7", + "MeterName": "S2 Media Reserved Units", + "MeterRates": { + "0": 139.0 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c13850a7-fad1-4ae3-8d3b-8d2a55899548", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.77 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "69736010-807b-43e6-b519-a413cb864ca6", + "MeterName": "Standard S1 Secondary Database Days", + "MeterRates": { + "0": 0.876 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7a91ea88-4a32-4a59-92fa-351908fd0268", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.226 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "69d491a1-faad-43a9-b3aa-e3d2885b6efd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.018 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e28527aa-ff33-49fa-aa98-6b2c5046a9d9", + "MeterName": "Standard S3 Search Hour", + "MeterRates": { + "0": 3.226 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Logic Apps", + "MeterId": "155afecf-5804-4ca4-ae3d-2cff595ab8d4", + "MeterName": "Actions", + "MeterRates": { + "0": 0.0008 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Logic Apps Actions", + "MeterTags": [], + "Unit": "Actions" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c40bd04e-b8e5-4d4a-a523-daeae986ef68", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.28 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "369ad022-e4e5-4239-9021-e4acce780b86", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.222 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e25bb519-8586-4cc6-81f5-ba9256351ded", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.294 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c32a4d92-6167-40f5-bda2-7017383f43e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.23 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "018981ea-a504-4144-9ef4-bb4283d081c5", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.0767 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e7b71d28-8da5-4c96-9e56-28a23af25618", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.292 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "35e2af9d-6f9a-4427-9813-33d617fb2858", + "MeterName": "Premium P2 Database Days", + "MeterRates": { + "0": 36.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "02b92ee0-5564-43d0-b768-9d92ee0b211d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.584 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8dbf7cd3-d2fe-4080-8ddc-8f0578e2355b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b6b0549a-b11b-456d-a870-264cf7eea1c8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7c8450b5-5d9f-4f4c-a9eb-5faf8aa4bd85", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "33ccb5ca-8fa8-4278-8aa2-006dc33d4c4f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.357 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9ee077eb-c902-46ef-b7f9-2caeade852e0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Insight and Analytics", + "MeterId": "6a11eb4c-01de-4438-88e0-e95b41869197", + "MeterName": "Included per Node (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "OMS Insight and Security Data", + "MeterTags": [], + "Unit": "1 GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f8dd8c8f-4ac6-49f1-ba01-38376b8347ae", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "048c136a-6670-4285-87c0-3f1b33a6be13", + "MeterName": "Basic Medium App Service Hours", + "MeterRates": { + "0": 0.165 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3220582c-b918-4276-89ca-7a8c2c43c3aa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.266 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7a151b8e-94a0-4df4-9c1a-18c24eaf41cc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.2 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Standard (32 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9c6406a5-7e50-4b14-ba0f-be602156c53e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.916 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7d468e0f-a7f5-4eb8-8b55-7604c2eedd8b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.357 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "a36d229a-595c-44ad-a66c-1287be4bf433", + "MeterName": "S2 (Units)", + "MeterRates": { + "0": 500.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "86883060-6341-42fb-a4e9-00ee722214ea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.175 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "34afb9b7-0917-4acd-a105-2fe2c0cf951d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.532 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ad4d0278-4c8f-4298-a99b-1952ec4440b9", + "MeterName": "Standard S0 Database Days", + "MeterRates": { + "0": 0.5536 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "27f013da-7932-46ea-bebc-a11854dfa6b9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.73 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "cc2a802e-6a8d-47d8-a6aa-cecef8c6b0ec", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0784 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b8704ae8-1b74-413e-9981-85179098e61c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.327 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6fee079b-45cd-4bd7-810a-3903ea962ebf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "de0d1714-0abe-4e75-bfdf-161b0d17656f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services Low Priority", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "93754c8b-f7c3-4a68-b6dd-42d760c338d4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.326 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "839e838f-8288-49b2-a11d-7a6f076371db", + "MeterName": "Basic C3 (Hours)", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "432cdeee-4034-4ddf-9ba4-9250a19b0d5f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Red Hat Enterprise Linux (8 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c983130f-7497-4000-b12d-a884296a76b6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "4ad28e15-4add-4f85-8472-365c30a7cf40", + "MeterName": "Premium Metered Data - 5 Gbps", + "MeterRates": { + "0": 5180.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "802a9d10-e933-4e23-8728-8f7e3f71630c", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9efc0c87-afb5-40a4-80c5-1c647948083e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.124 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "a96e18a1-a1de-4a72-a5be-b8ccfcc03b1b", + "MeterName": "Bing Speech Text to Speech (1,000s)", + "MeterRates": { + "0": 4.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1,000s" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "26586f97-b6fd-4bb5-9d05-1e11493cf746", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.324 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "188d6aac-56a9-49ef-ad33-eb55a09f62c8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.625 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4b14a253-cdca-47a2-be9e-d082116f5e2d", + "MeterName": "Premium P18 Database Days", + "MeterRates": { + "0": 499.982 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fc7c7c1e-10b2-45e1-8aa8-a5734d5c88c4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.238 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "50938df9-5452-4888-b712-64df5f66b386", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.32 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2d9e7c8f-0c58-46da-bb47-55a28e7ce605", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ab5b133b-d9da-4c2d-be66-0c3d70a8e69c", + "MeterName": "Free Search Hour", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "287a6e61-483a-41f0-81db-807561e8d11b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.396 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "453633de-18ab-4057-acfb-3779dd691d5c", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0f0c5e45-2657-4afb-b27c-4526c9890705", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.25 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9caecc04-e579-4fd2-ab2c-0fd624e3487d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.033 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9cdb0b20-13e0-483c-a343-effdd69c7fdb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.306 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "448e43c9-416f-4b53-be61-258f8197e4f1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.918 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 5.0, + "MeterCategory": "Networking", + "MeterId": "c089a13a-9dd0-44b5-aa9e-44a77bbd6788", + "MeterName": "Data Transfer Out (GB)", + "MeterRates": { + "0": 0.181 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "fbbde0ca-b8dd-4d55-99ba-00b28f18e442", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.192 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-06-12T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "297d6b49-87be-4b70-97fe-0fc31ec85287", + "MeterName": "Device Handling (per device)", + "MeterRates": { + "0": 80.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Import/Export", + "MeterTags": [], + "Unit": "Devices" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "67706dc5-2a9e-4626-82f5-817a54343cf0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "50b5bb3a-bb93-42d7-8496-551f8c410dad", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.333 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "51b394a1-a487-4d04-883b-a38c04b1d9eb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.229 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fdb1c7d9-6d00-407e-91fd-05133995489d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.387 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "37b7e74f-0401-47c1-93c3-dc767cb7d88a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "9052c099-4bbf-4f2a-82bd-11528aa590aa", + "MeterName": "Basic C2 (Hours)", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d1ab384d-6dfb-4928-b52c-f88711c513ca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.22 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "19814557-03dc-4347-bcb0-30a80c380264", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.62 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "43044ba5-b76c-4245-a512-aa310edeab17", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.744 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "02f80beb-65da-4fde-8fbb-484f460aa817", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "eae9321f-81e2-49be-8506-24a8334f735b", + "MeterName": "Standard S1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.9677 + }, + "MeterRegion": "JA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c492e654-0316-49dc-acfc-e8e8b2627679", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0604 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f2c23bda-95ea-4d1b-a3d3-0848a73824f3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.516 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0e8e172f-a937-4a03-a5cb-654cf32a4214", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.655 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC24 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "462fb824-3bc1-4a25-800a-bf35ed4a62ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.336 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "2aeb42d2-e5ac-460c-ba22-353e39e145e0", + "MeterName": "Unlimited Data - 10 Gbps", + "MeterRates": { + "0": 82000.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4195bfe4-7809-467a-ad60-06cbe32f4df2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Xbox LIVE Game Services", + "MeterId": "73d283ca-dee8-4d5c-b158-97092e970514", + "MeterName": "Session Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4b6019d7-c01a-4a2e-ae61-866b3cc4626f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.759 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "896f4f68-ec9d-4536-be0c-d9f11e9817e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.372 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "88f17724-e3bb-40da-a64a-0d434c262b5d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9336a078-360c-4369-9af8-64c54fde50d1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.073 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "753b814e-f51e-4a40-89b9-64326323bb22", + "MeterName": "Premium P1 Database Days", + "MeterRates": { + "0": 16.95 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "818def1d-898e-488e-9271-800928934f34", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.064 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6a03b082-449f-45dc-bc35-831c79d63a48", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.044 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6072b4dc-4fc0-4049-9ba6-8b3071f08e7b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.933 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b5ccee19-ffe6-428e-8d30-90d06ed29b5c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.137 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "dd6cbd58-9b16-40e3-98e2-fe593cbe9f65", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "963edd42-e771-439f-b55a-0fad4bd529f0", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d3084fe4-630d-43a2-94e8-56f0178628f9", + "MeterName": "Standard IO - Block Blob Write Operation Units - Free (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1d16b784-10fd-4f5b-ab50-ad4208aa67b8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ce7867f9-3fb8-45b4-8eb4-914c7962dad5", + "MeterName": "Premium P11 Database Days", + "MeterRates": { + "0": 282.263 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "b4444c45-98d0-4a04-b816-b688a17b844f", + "MeterName": "S2 Overage (Hours)", + "MeterRates": { + "0": 10.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Speech Translation API", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fe20832a-252a-43af-9269-07e72982e6cc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "27fda617-6c9c-46f6-aa20-04cb4c172e45", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "76d38362-04a4-48f9-8fde-4d02595d51d2", + "MeterName": "Standard S0 Database Days", + "MeterRates": { + "0": 0.605 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1a4a664f-4878-4b7e-9722-2a3217a0af55", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a8fccba6-1070-483d-a82b-88bbabcb409f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c9a03571-1c92-4c4e-bcb2-05884a8b4682", + "MeterName": "Standard S1 Database Days", + "MeterRates": { + "0": 1.1612 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6d149115-d739-4a2d-a346-9412d3c93d32", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.462 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "20ec0aa5-d438-44e5-9298-c5bb719f97bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.371 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d88c5275-5b4a-488f-bad6-feb13d9012cf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.671 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1c2b2552-514d-4522-a273-abe2257600b3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.292 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7580bd03-fedb-4309-9427-32e6051cfa64", + "MeterName": "Basic Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.1841 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d6e10a1e-f202-4ae1-bf9c-55c02fc3994a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b0834e3c-5dc4-4ed8-9835-05696a895dce", + "MeterName": "Premium P6 Database Days", + "MeterRates": { + "0": 150.0 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "02a82cf5-c939-4cb1-9c37-5f58e3d1306f", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7af4c14d-6288-43d8-bfc7-bfbbab841c06", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "88d46227-e484-469e-a06a-6a31a14dc022", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0975 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Scheduler", + "MeterId": "2d7eeaf7-2c4b-4229-a6a1-b6de0153f5d3", + "MeterName": "Standard Scheduler Units", + "MeterRates": { + "0": 13.99 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1 Unit" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "003afa77-88c3-4da1-9464-69f643721f8b", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4667920a-730c-4ba1-9c51-f378d3d01e8e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.07 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d5687907-6698-4a18-9bde-2439048b9d25", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.316 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3af92420-ca25-4fbf-80e8-81c78658f18d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.135 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dddd59fb-03b9-494d-868a-11c2a079a777", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.44 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "be55d4e5-a0df-464f-bf7d-fb25088f83ed", + "MeterName": "S3 (Units)", + "MeterRates": { + "0": 8000.0 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ed4deaec-a388-45a0-9874-9a3a785115f4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e819fae8-4d0a-47f0-9ee6-3d1635f22ca6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.219 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "953e7a10-9a6d-496f-ae0f-c6033373ea29", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.106 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "96642a69-8e14-42ac-a2d1-74643d08e05c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.162 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3a58844d-1516-403e-894d-951c57ec8a57", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a88fea88-bd2c-435e-a518-567213e92a15", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.015 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "baa3b29d-c50b-410e-8ce1-7674202ec46f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "043f9146-0dfe-4bfd-8040-07c7bdef37ab", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.038 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "ffbfdc29-bba7-4d67-858a-8125be34e183", + "MeterName": "S4 Overage (Hours)", + "MeterRates": { + "0": 3.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Speech Translation API", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cd7b802a-4007-464e-aef9-c3689a3b62a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.631 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e68b650b-fc82-4294-be36-c37dbb05f706", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.396 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f4cac486-eec8-46e0-9f17-a5d996a5c1c6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.995 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "433d1ed7-7014-400f-8165-c58c06a04adb", + "MeterName": "Premium P13 Database Days", + "MeterRates": { + "0": 369.03 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "26374bd8-72b9-42d3-9df6-d1af0c282e16", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "94f054a9-fd89-44b1-aa6b-704f68debb89", + "MeterName": "Premium P4 Secondary Geo Database Days", + "MeterRates": { + "0": 50.94 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "918bbeef-3e9a-4e71-b262-d2c2dc4437dd", + "MeterName": "MSFT Peering Metered Data 10 Gbps", + "MeterRates": { + "0": 5000.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "aa8010ed-4a97-4811-bc68-8e8f702faa5f", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A10 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6faa9139-4844-46cc-b961-d7b9a7750182", + "MeterName": "Premium P1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 18.16 + }, + "MeterRegion": "BR South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e3aa4ebf-c1ab-4dc4-a587-4ab49cb54e0e", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1df60a0b-f88f-417a-86f7-ccc2b9659e7a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.681 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b113152b-5b7b-46f9-a7aa-e04841c3b420", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.242 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A10 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "4016f50b-3a8d-4c37-929e-70871df54d82", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.944 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d9ca461c-ff9f-4b76-b1a0-61030f3f830d", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8ed862bd-4de2-4759-82e3-413992166752", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.018 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0fb8dbaf-54ee-4dd3-815b-80d7a073c909", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.158 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8fb53c97-faa6-49f8-8081-2a440b1b621c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.156 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e6c2f613-5014-4f7e-808f-78643434dc63", + "MeterName": "Basic Search Hour", + "MeterRates": { + "0": 0.133 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "2b44acb5-fe98-4276-acd7-f86587760133", + "MeterName": "Basic Medium App Service Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cbcb7604-78d6-41e0-bdfe-f6676bff8829", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "eeb8053c-41a8-45a7-9e45-356cd5b172a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.404 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1535aa76-5517-4687-8a32-61dcd5a82f53", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.261 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6bf604a5-353c-441b-bee2-334e85f55aaa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5f2591e0-5697-477b-afb5-8f7d28f4155a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "5a28a0dc-06ef-48ac-97d1-5787cc12d68e", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.055 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d1ff5194-e3d1-4d04-83f4-1b1fc80487fb", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7f125834-30d2-4be1-99d2-f1ea3cd24a6f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.0024 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6bbddf59-3fce-4600-90bd-d8f1e565ebe9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.106 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c799ccdd-765e-432b-a4e9-db2d6b422ad8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.267 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fab8b169-dc06-4675-86ef-0aed348f154e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "1fc5550f-2090-48d4-a564-5623eb4874c9", + "MeterName": "Metered Data - 50 Mbps", + "MeterRates": { + "0": 55.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "290567e7-f130-4113-925a-1665a8b87edd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.698 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "93688123-e719-4e37-a654-e9c709bbeb57", + "MeterName": "Standard S3 API Plan (Units)", + "MeterRates": { + "0": 322.58 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ca71cb21-0ba8-45d1-b746-3b9763de6414", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Weblogic Server Enterprise (2 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e328e392-c7b5-4fea-b8ed-0a3ed5be87a1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.142 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "ffb4ec45-369e-4e1a-b48a-94d7c220f7ff", + "MeterName": "Basic C5 (Hours)", + "MeterRates": { + "0": 0.525 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "40ec5381-a01d-4bc0-bfc1-257378fa8da9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.065 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2d6f5341-c2ae-4d34-afca-94391ff66d8b", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.039 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "893c116c-f39b-4568-9c85-52cf02bff44b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.18 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV12 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "daec6c53-0399-4985-a370-1f7f2c361492", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.033 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Zone Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "fe6db92c-824e-4334-a7d1-6b2adcbf7a65", + "MeterName": "Standard S1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 1.0645 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "10077071-cceb-410e-88b0-8ba90d5bbcd6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.099 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "494931a8-9f6c-4ad3-80b3-b1686cf0e64e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.44 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "03d1a259-9237-4c00-8de3-9e6c73f58f59", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.225 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6ac925ed-5127-47bf-853f-f1883069cc11", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.95 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A11 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "122f793e-02e7-442c-a2bf-247ef0ce1342", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.947 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c069fd89-c3ce-4caa-b018-0bc26dd0a6a9", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 20.61 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ea80992b-9870-487e-b9c8-0d0e33b6867e", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.153 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fbe6007e-9bf8-4d51-89f9-6c15354bc9a4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.308 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "e21b5b90-24d8-4c45-aa19-6278838de1ca", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "a4784e8f-3e5c-431f-9818-c8017ec735bd", + "MeterName": "Advanced Analytics", + "MeterRates": { + "0": 99.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Application Insights", + "MeterTags": [], + "Unit": "1 App" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "132ade99-fcb8-48d8-a971-23e81cbfc90a", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "3d656db2-de1e-43a3-a987-5d2cda5d63ff", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e6153c90-a3c6-494c-98c7-c564f4f75ba2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.21 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A10 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "4efdf688-bbb0-4891-a548-603f335543c8", + "MeterName": "S2 (Daily Units)", + "MeterRates": { + "0": 66.290323 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Translation API", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5f045ba8-1314-4b6c-adcb-58e180c5a7b5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.56 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Java Development Environment (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "806ac19b-c75f-4815-8b67-e116472b85da", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "8a968a09-9805-4e74-9bc6-ab617cf292b0", + "MeterName": "Metered Data - 200 Mbps", + "MeterRates": { + "0": 145.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fae11530-0266-4c53-9300-f6dd65a2bd53", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.696 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "db412d6a-6c34-47e0-a657-c42c0fff28cf", + "MeterName": "Standard S1 (Units)", + "MeterRates": { + "0": 4.84 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Analytics", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b9f11db4-043b-4510-b6ba-1d758497b271", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.563 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e52303cd-3fad-457e-b2e4-14220ed42218", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.54 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d01e0c9c-66fc-45a0-91e0-43598bd91f8f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.886 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ed53f3ea-0e3c-47b3-9b98-c77adcbe2f86", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.305 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "fd157900-03ef-4680-89aa-a24e299bf982", + "MeterName": "1PB Commitment Tier", + "MeterRates": { + "0": 838.71 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Store", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b8961563-0af6-4c1e-a84c-7383c51c3b2b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.323 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b39cc42b-6545-439e-b77b-7f557f974b36", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "4035ac14-a53f-4539-bef4-7b0b4b7f553a", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.143 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "36427a6f-ece6-4146-8f68-816e6f755ae9", + "MeterName": "Metered Data - 50 Mbps", + "MeterRates": { + "0": 55.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f999926a-6006-4930-9570-51baeda16d80", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.875 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8873f8cb-95a1-49c4-ab72-b4936448d9ee", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a723b12a-d3e1-4572-ba2f-a0bda169d2ee", + "MeterName": "Premium P11 Secondary Geo Database Days", + "MeterRates": { + "0": 203.23 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "619643d8-d44c-4176-8acb-01b705f9e870", + "MeterName": "Standard S0 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.5536 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "95ae23db-8670-485c-8cf7-eb316214b491", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.61 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "af1215fe-210e-430c-93ca-cdbd568ff09b", + "MeterName": "Premium P6 Secondary Active Geo Database Days", + "MeterRates": { + "0": 144.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "edc2da3b-3251-4f39-a114-f9792c29f288", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.933 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d006360b-cc81-4726-99e7-dd205004b9e7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.066 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "24fa7ce6-c64b-42c8-a9e4-619bb4d0f277", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.297 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "adc752ab-1cd8-4e30-957b-fc7d0321fa03", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0e56214f-e5f8-4a8d-8a16-487376556597", + "MeterName": "Premium P2 Secondary Geo Database Days", + "MeterRates": { + "0": 24.75 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ff59d3f4-f926-4c4e-a7d4-354ee5d24972", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.043 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "37e24472-a65b-435b-91bd-7c9c02e9085d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.478 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2ddbf6d8-cc61-40e4-b848-0bbdf3fbc76c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.464 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1bac8c6e-3f6d-4514-9d57-022478c5a5da", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0732 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "cf47dddf-23f0-4f64-9a9b-617e3a192bdd", + "MeterName": "Academic Knowledge API (in 1,000s)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1,000 APIs" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "e931f717-a078-48f6-b4c2-e88da25c4e44", + "MeterName": "Premium Live Encoder Input Hours", + "MeterRates": { + "0": 34.99 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "15bdc4fa-9389-4249-9e72-2bdf6586b156", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.31 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a9d73689-c3d8-4b76-be02-a972287443e9", + "MeterName": "Premium P18 Database Days", + "MeterRates": { + "0": 541.9344 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "fe72f2b5-30f6-4fd5-966c-5cda70a7f8a4", + "MeterName": "Premium P6 Secondary Active Geo Database Days", + "MeterRates": { + "0": 132.0 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "2d8562b6-beb9-4185-af16-aea3c1b4d434", + "MeterName": "S3 (Daily Units)", + "MeterRates": { + "0": 193.548387 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Translation API", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "039ecc8a-25ab-4aa7-b578-5c8fa4c015a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.538 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "07135832-4a64-40b6-a093-30af0d2b6f54", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e6784273-54d0-4261-8734-1ef0bed373eb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f5c756b2-15b2-46cd-97b9-df8953afedd1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.025 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ee33f71b-4168-40b9-abcd-5c8f24a3331c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.0784 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2236370b-4365-4a26-88d3-6913c6540d86", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a6c4068a-cbc2-4ce6-b8c5-910b6b7352c5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.999 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16m VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "81438903-630b-41a2-a5cf-7ac65b61bd37", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.481 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b106c5ca-d9c4-4bee-9f5d-0b83fd7dbdd7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.482 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "36085934-4216-4d15-a257-9670b5eb12dc", + "MeterName": "Archive (Hours)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard Event Hubs", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8d5b2043-d7dc-4112-9d7a-16441dab7905", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.776 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fc2f46b2-91c1-4983-831c-796e6d88b640", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.482 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a83bd049-0f0b-4164-a69a-f7ba8eb11f02", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.73 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b7bfe936-caad-4bb7-98c9-7b6a11379c00", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.356 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3d1e5eb8-8f78-428f-8c8f-f4bd4814c693", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.712 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6b25367f-5d8d-4f41-a995-481757aec6db", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4031e931-56e8-440a-8c08-a45cef6d4314", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.244 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3c36498c-c413-47ec-bc0a-ea684f678873", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.232 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "aeac4340-ca22-4e2c-9dde-552bc0a0fb05", + "MeterName": "Premium P3 (Hours)", + "MeterRates": { + "0": 2.663 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "335462ac-c880-4a7f-b6bb-94a968754d76", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.158 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f18caa33-54d7-4337-b909-1a0f268d9df6", + "MeterName": "Premium P1 Secondary Geo Database Days", + "MeterRates": { + "0": 14.063 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ab3787a5-e154-448a-9169-6176f807883b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.137 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "538201b5-1e82-43c3-9043-9a19f9ce16f0", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3456cf7c-a131-47e5-83b4-177c3ab49a4c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.16 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "91a8eceb-98e5-4683-acf1-8752b130ae20", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.349 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2686e417-3d61-4e02-b25a-8ecc224d7ef4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Weblogic Server Standard (4 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6f57a920-4e4b-4422-a013-6ce0c20ebd13", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.576 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c9456f44-976f-4265-9c3f-1ab410e35f65", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.043 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7cdcb3ea-9229-497f-b84e-a6dd06e74d36", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.34 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "330a6e17-bfe2-4cfb-9049-78054e806f11", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.016 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4f2ae6d4-3dcf-4092-a333-fbf152ef2bf6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.153 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7d5266aa-8a8d-4ca0-a388-40e467b4803d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.24 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "b55d6482-4726-4fab-b4a5-ed8f3b39b5f7", + "MeterName": "Standard S1 Overage (in 1,000s)", + "MeterRates": { + "0": 0.75 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Recommendations", + "MeterTags": [], + "Unit": "1,000 Transactions" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "43235116-3f85-49f7-a20c-63636a0631eb", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f91b13ab-62d7-408a-aeb3-b93d4374d6a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.291 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e14bcbe5-c79e-467d-b3ea-e12d5e4403ba", + "MeterName": "Basic Elastic DTU Pack", + "MeterRates": { + "0": 0.1007 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "27ea8cae-1ce1-4cd7-ac57-8b7c341e9243", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.312 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "62b3e65c-6247-4656-ac55-07145f13a42d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.744 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1800bd5a-4452-44be-a6a6-1aa30b4c9a21", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.9 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "904fd065-e9f4-4b4c-9faf-5c8bb7b90d4e", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.134 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cd14d934-d909-4610-b8bd-48e52d0bac1b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.62 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c906e161-98b8-41b1-81e2-b59e0b263740", + "MeterName": "Standard S1 Overage API Transactions (in 1,000s)", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "1,000s" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "26bf6711-daba-40e4-8ff2-f0417328866e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.177 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "39586e1c-2e57-4dc6-8fcd-b8591274a3fb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.086 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "34eb4ae7-9997-40f5-9fac-2fa718879f5a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.31 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "adc54be1-0921-481b-90c3-2d7938e4c5ff", + "MeterName": "Standard S0 Secondary Database Days", + "MeterRates": { + "0": 0.365 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1c648c7d-694b-490c-a9dc-ae978cf936fb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.639 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0146deaf-f348-4c60-a0f9-6fbcc1843b75", + "MeterName": "Premium P11 Secondary Active Geo Database Days", + "MeterRates": { + "0": 255.6 + }, + "MeterRegion": "JA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "802e2b7e-9334-4ce7-8077-cde958483715", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f03e0e4d-6077-40f7-b61e-bda0c51a1113", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f0003a8b-a639-4b28-89e9-025cdcd629c9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.639 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "565086f2-5d3f-41ab-a1b5-07a713d56f69", + "MeterName": "Standard Small App Service Hours", + "MeterRates": { + "0": 0.126 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "318657e7-f19e-44b0-9ecc-f5b711f00b59", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.264 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4ecfe7d8-6622-45c2-9745-974c7c7dce2a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bcf83d75-144f-4295-9a50-64349060de00", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.343 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4c00ee14-e9b8-45f8-973f-285ce53941c9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a479ac51-7504-492e-b703-378eda58cedf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.752 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "84347b15-0694-4b7b-952b-865bb238b196", + "MeterName": "Standard S2 Secondary Database Days", + "MeterRates": { + "0": 1.8824 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0c3624ee-228f-4363-9a44-bdc7dbd875c6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.19 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "82a33bcc-18b6-40bf-b364-51ebea7c8dac", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "c7c86eef-7094-47d5-83e7-c3c9be5af0bf", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.656 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A10 OpenLogic", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5aaad335-46c8-4ebe-ac35-13100376378d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.098 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9908ed0a-dba7-407f-b611-fc390325d48a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ad6b5c49-6f02-4531-95a8-8cafe447d203", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "8377fc32-8a1a-44af-942f-0a1af85dc4d0", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3e8b6de8-56b3-41d5-bbb9-724882f0710a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "3a9f22cb-107b-4d4b-878c-2f9125c7abc7", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 116.74 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Batch", + "MeterId": "e8db11cc-89b9-4061-b94e-eb7c18707e52", + "MeterName": "Memory Intensive Batch Instance Compute Hours", + "MeterRates": { + "0": 0.0175 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Batch", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "b3841bec-a610-4e54-b8af-6d54feafa6dc", + "MeterName": "Premium Extra Large App Service Hours", + "MeterRates": { + "0": 2.928 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "f786602e-05dc-4157-8b85-c4b587d0aaf7", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a7fa021d-1f90-4ffc-988b-0bdb8d46bf2e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.82 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "dc5d40f7-474d-482a-b47e-ebb934547535", + "MeterName": "Standard Emotion APIs (in 1,000s)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1,000s" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "64cabb4c-1cdc-45a7-b682-8c5e0febbb51", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.69 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "464b3492-72cc-4c70-8ac6-8d0319d39623", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "755e3dd7-1fa5-4923-8186-441b7f73a274", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e2f73349-0c42-46de-a33a-bb4547ac4f04", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.038 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Zone Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "924b9bcb-9cb4-431c-ad2a-eefd5c74c894", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.349 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8e7ca98f-0214-4f5b-9b2e-10fe4596798e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "86fbf081-4a0f-4992-9336-6159391c28c0", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7419dc08-5eac-4502-b454-a1712417ddaa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.659 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a6a95131-bdea-462c-aeb1-13772339f36b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "96257598-6119-4dad-94d7-06f026fa9f1f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.268 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a3d5409f-cb28-42a2-975d-a9e715e9d330", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ec04e0fa-6825-4077-8d2f-27aac12ea927", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.221 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5e87a460-80ae-4eb4-81f3-4344896797f3", + "MeterName": "Standard S2 Database Days", + "MeterRates": { + "0": 2.94 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "45201f28-fbf8-4037-a51a-df777d40930d", + "MeterName": "Standard Small App Service Hours", + "MeterRates": { + "0": 0.125 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9e4e879d-c0f2-4623-8051-b0fb279b4425", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0264 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "066748db-57be-4f94-9a5b-f7b82a96c7ab", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.146 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5f6887c1-100f-48b5-93a2-c0b0498ed356", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.425 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Scheduler", + "MeterId": "be2eb73c-cc40-4a0b-9511-af1c5a247fbc", + "MeterName": "Free Scheduler Units", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1 Unit" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "1cd23e91-a422-4dc3-acbc-feafc509f19c", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7277b7c5-2c80-4ea8-bd6d-a2e0d11aedee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.48 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dec0a68c-f66f-45d0-8361-e13c4492a4f2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "544d011e-8ed2-4e78-a99e-d87c0f5d5f19", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "98683f53-70aa-4d9c-9715-70f6a5b6f85a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5d8bc616-4348-4245-b74e-bea9125bc891", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9e3b7351-2718-4545-9d8c-43fa053cf98a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 7.46 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV24 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3a520096-32a8-494a-b58b-885de9e5ad4c", + "MeterName": "Standard S2 Search Hour", + "MeterRates": { + "0": 1.478 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "47eaf23f-7713-4b0c-9c1b-fe064ef77c9e", + "MeterName": "Standard S2 Secondary Database Days", + "MeterRates": { + "0": 2.0 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ff669cec-98a6-403c-ab6a-8642e2b249e6", + "MeterName": "Premium P15 Database Days", + "MeterRates": { + "0": 627.264 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Analysis Services", + "MeterId": "9901af91-2b08-4f58-8aa1-d54ab42054fe", + "MeterName": "Standard S2 (Hours)", + "MeterRates": { + "0": 2.03 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Tabular", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "382401f1-e439-48ac-842c-bb0933e2da38", + "MeterName": "Basic Elastic DTU Pack", + "MeterRates": { + "0": 0.0536 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "27fa1d2f-b93e-4f2b-8dd9-9f257c1f51f4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "91905b98-178f-473d-b701-7ceba4c5017c", + "MeterName": "Standard S1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.9677 + }, + "MeterRegion": "JA West", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6f303b87-fccd-46c7-9789-ccf8fea267d9", + "MeterName": "Standard S2 Secondary Database Days", + "MeterRates": { + "0": 2.06 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4c7c276e-a394-49db-ab0b-69dc00eb9f38", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.248 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d618ab9b-6d75-454a-9bbd-3a3bc01c927a", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "76b67d78-4b91-41f2-93c8-fb3d9de7a704", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.953 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4072057f-b2b2-4c2e-ad12-716181e57e64", + "MeterName": "Standard S0 Database Days", + "MeterRates": { + "0": 0.5033 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "30106156-d005-4b27-abd3-1b9fbeb12c25", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9543b36a-cf96-4b48-b0b4-a7258977e706", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "51bdafdb-ac85-40c4-b783-032fbcea84f7", + "MeterName": "Video Stabilization APIs (Minutes)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Content Minutes" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c87db1ab-3fdb-4749-88e7-782b114db747", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.852 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "85285026-59c5-4029-9272-88d85040ce9d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.161 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "bd69546d-19b0-4776-865f-8753b800883b", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2dc242ef-0443-457f-8e45-2d535735f983", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.895 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "99fc0555-094e-4c25-bcdf-ca0199ab4290", + "MeterName": "Shared App Service Hours", + "MeterRates": { + "0": 0.0151 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fd2abd54-414d-406c-ac77-753eb420003f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.281 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8b8c895b-bca0-4f0e-9fbb-16c13512b8d0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4fd45738-9a0e-4a95-b4d1-b81809af9f1e", + "MeterName": "Premium Elastic DTU Pack", + "MeterRates": { + "0": 0.225 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "4225a259-3557-464c-a76c-6f3e0672735a", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a73fdaba-6b94-4934-896b-b43759867987", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4ac7ee83-215b-4da8-a309-fa833827734b", + "MeterName": "Premium P2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 33.0 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c27635f1-38af-4eb9-b440-faf198237f18", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1d4a40f5-9661-4c3c-bee5-2c48c9e8371c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.298 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "65d33994-62be-46ce-9e4d-c154f959cd8b", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "8028f3e9-1946-4785-8c83-07cf4440d9de", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 67.59 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "10dac30e-20bc-484b-b94b-9853fde83b15", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "297878d1-5f55-4392-9755-b78ee5be1a33", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0862 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "585de8d6-61a9-4ef4-a528-35be2500a359", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.86 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6711cb05-7c2b-4f8c-885a-f45b35136e3a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a77d8574-a69f-4150-9b06-26f43fe075d9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.856 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "517d05c5-989f-4b37-8462-e857145e7228", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Standard (12 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ef6fe897-dbe0-40c2-bcc9-134c75b61fda", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "f5eaac8f-b96b-4aa4-a9e9-76cf04fd9d82", + "MeterName": "Data Transfer Out - Unlimited Data (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "df908fa2-21e0-4890-9ad9-2df392d45122", + "MeterName": "Premium P4 Database Days", + "MeterRates": { + "0": 72.92 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8869dd8a-f05d-4a07-9bf4-b1ef9a9bffec", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.752 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16r VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "74821000-4eb0-4106-9992-5574ef750c15", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c35103ee-0f05-4b68-a236-280a4e4b56d5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "baf0f0b4-ce1f-4d7b-81e6-b131b708858d", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "44cbd36b-f261-4e8a-97a9-74b11cdd74c7", + "MeterName": "Standard Medium App Service Hours", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d9d22589-3e0c-433e-8561-6a07454e2d3f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.32 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "4bf8396c-beb3-4de0-9471-48ce8c906091", + "MeterName": "S2 (Units)", + "MeterRates": { + "0": 800.0 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1269a8c6-499f-4b63-8709-19e70eb09643", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.069 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2265feee-a1a2-4aad-83aa-a4b35824f677", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.366 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "4d97520d-90d9-48fa-93d7-ebf44b3c9924", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fd9c4dfb-c43b-402d-abc5-4545323415a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.374 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c61984c9-3733-4818-84a9-5dc881ef47c4", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0375 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "acc1a1cf-e786-4ee7-86c4-9f827cac71c0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.478 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "25f947e3-026c-4416-84cb-e8c366e7da8e", + "MeterName": "Standard Managed Disk/S30 (Units)", + "MeterRates": { + "0": 22.528 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "045aa6f5-e9f4-4ff7-b377-f9baa1d986ce", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fee1c571-5e0d-47ef-b031-3ba67f6a67c2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Identity", + "MeterId": "6d7548b2-bf39-40b7-8df8-d3354a17668e", + "MeterName": "External Identity Authentications", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Multi-Factor Authentication", + "MeterTags": [], + "Unit": "Authentications" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6da415ef-d1b6-4b9c-b72c-457c4dcc3aa3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise and Weblogic Server Enterprise (8 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "56f07b6a-c7d9-490f-a196-a7ee08e28712", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "795420fb-100a-4a39-bff2-9f45d4aee1b8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9ae12c16-c7d7-4cf2-8e61-af58ad102afd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1c833e7a-2490-4f89-ba38-b98637e848fa", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f8eeb06d-e9b1-4792-9562-184213b97d03", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "64819db7-40ae-4288-8f30-25dcc45de6e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6970b587-0491-46be-a15c-f7e7a4429ae6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.516 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "589566a1-649d-4e26-9272-fc16d61b3dc4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "517fe269-c5b1-4572-b89e-6b4053bbc61d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.481 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f8b8852d-f482-4563-80c2-fe347291644b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e549b039-3816-45ec-8be6-60ef2d2cc8a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3168 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eb31bf05-ed22-46f8-a604-c963353264d0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.84 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c51e22e4-edad-45a1-8721-f7f3c2de512d", + "MeterName": "Premium P1 Secondary Geo Database Days", + "MeterRates": { + "0": 12.39 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8ff6cb38-2fd3-460e-b99b-76042d798a98", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d6cf437a-0992-436b-9147-4c57b7415b9c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.178 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "dde2e971-287a-4b1e-a0b5-b11297fab73d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.54 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "209f4cd2-ad49-467c-b1c0-68e0731ddc86", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "22122ec6-250a-44b9-a031-3058f2acc104", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.632 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "c2854a76-748a-493d-8ca0-0e7640b17aa0", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "67bcb0f1-d856-4bf8-b6cf-ccc932f4a9a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.268 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e25f4479-3084-4e1c-b89c-2b0bae2b79e7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "13553d04-5057-4557-872b-cafaf85e256a", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "75a71915-a991-4eff-a4b7-72ec860e4e15", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.178 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7d86696e-c986-446b-8af6-be767c35775e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.264 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "459af3c2-cf85-468d-ae77-c096858dfef5", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "688cd530-3034-41b6-b429-02856500a9a8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.572 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "dab7bc99-944d-408b-80f9-320c0e55f42d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.059 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "8765ef09-db5f-4a66-90ae-3ade3c8a2783", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.352 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "11b1515c-7490-49a8-b32f-aae0cfa9c021", + "MeterName": "Premium P6 Secondary Geo Database Days", + "MeterRates": { + "0": 108.9 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "61405941-cb44-4382-9949-9acf4779b186", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.222 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "12f637bb-97b1-43b4-9c56-5370b344d768", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b64cacb6-afef-4e5b-88ff-58f63099bd05", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.22 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "66aacf77-57c2-4a1b-a3a4-064273d8aa58", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 22.67 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d57d08d3-32d1-4631-af7a-fff018f4d09b", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d15fac4d-36f6-4583-964a-e7ec20bd193c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.035 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1cf14d7c-7cb6-46db-ab44-793ca6506f7a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.765 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6efda682-f82b-4ef0-9324-a358f3b64f00", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "31a62457-ff05-4084-ad52-c47d8f51f154", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 61.44 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "78b73662-ca16-4736-a23d-d44704860efb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.357 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b9b795de-d63f-478d-a111-5bf05bdceb87", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.542 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "39c25c2e-dd6f-47a6-b39b-779c9a4257ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.147 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "9ca789a4-04dd-40c8-84d4-19cd7cb21078", + "MeterName": "Premium CDN Data Transfer - S2 (GB)", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "27e99b56-4e56-41f8-bd5c-3c07ab4393cf", + "MeterName": "Premium P2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 37.5 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "a5965539-c524-4112-b4c5-091680938b3d", + "MeterName": "Standard IO - Disk Write Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "329bae5f-a339-487c-ac90-d1ef93c73731", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.852 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0168b9e9-d153-4754-81a4-3e03473c13e8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cd89bb1c-026c-4823-ab36-d40b27d87c7c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.312 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ad2e895f-a4a6-4e7e-ac97-4d9b8edeb547", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "670a674b-152c-46cc-8f44-c682f3b660bf", + "MeterName": "Standard Elastic DTU Pack", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "78aab249-4dc3-476f-b673-27f177e8ff41", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0735aae7-8bd5-43ad-a131-7c3886591c2c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.187 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "bea268fd-3894-418e-9a24-8800e3e869f5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.225 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "12e1237d-a0b1-4630-93d7-5090224dc30f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.296 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "24768197-32d7-41f3-9129-81ab6913bb54", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "20db517b-cf48-4111-b894-2a4e207fd27a", + "MeterName": "Basic Redactor Minutes", + "MeterRates": { + "0": 0.045833 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "Content Minutes" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "be138253-d904-4529-b83f-b0a6f1c906a1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.467 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4c196433-36e6-4e28-a31d-e70b6a7c0d7f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.549 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "a438d0ea-c92e-445e-bade-158f22680dd4", + "MeterName": "Premium Unlimited Data - 5 Gbps", + "MeterRates": { + "0": 44000.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2801bf73-919d-40a8-a9ac-a1abc9a945a2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.346 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "148c0a3c-40e8-431d-8870-ae0c0c2ac63d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 10.536 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9ba37508-fbab-4f2a-86f5-4861f19db872", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c28ac367-7449-4cb9-9324-81b657bc5a6a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.345 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "78f10ecd-833b-49d9-a405-778c5fb85b5e", + "MeterName": "Standard Managed Disk/Snapshots (GB)", + "MeterRates": { + "0": 0.0528 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8e7ddd98-7ec3-402e-b996-af088997d72e", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5694395c-4eff-4325-87d8-19920377a16a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.115 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f3668cce-b518-451d-a402-aed7a6aeee45", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.672 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Recovery Services", + "MeterId": "0b1fbb84-8967-4cb4-9288-c3cf8ca3090d", + "MeterName": "Additional storage for VM replicated to Azure", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Site Recovery", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ceb6e85c-a477-4787-8942-24d1abd76ea3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a149966f-73b4-4e1d-b335-d2a572b1e6bd", + "MeterName": "Standard S0 Database Days", + "MeterRates": { + "0": 0.4839 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "d898ec8a-0795-4066-9199-effdb181a288", + "MeterName": "Premium CDN Data Transfer - S1 (GB)", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "Zone 4", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bed86b46-f90f-49ac-b60b-35413bed8cf1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.191 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7ef144e8-61b2-4575-bed9-aa1f153f9bdf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.136 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16r VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "29187de1-b4a1-4503-a6f6-078271b3fc9d", + "MeterName": "Included Quantity API Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "96de8d2f-46c1-4249-90a7-532f7824eb1d", + "MeterName": "Standard Large App Service Hours", + "MeterRates": { + "0": 0.504 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "7bcaed13-b9c9-408c-a66f-a357e3dba257", + "MeterName": "External Endpoints", + "MeterRates": { + "0": 0.54 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Traffic Manager", + "MeterTags": [], + "Unit": "External Endpoints" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1b648a0b-3296-4e12-91f1-de12e972933d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eb97da0c-a6b2-451b-a174-93b444fe8853", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.735 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f4b6c5b2-dc9b-4a66-abfa-3f77887d27a1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "fda24285-b1d0-4f58-b957-e1685125aff7", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "4c58289c-1fd1-4651-a34b-30e165c57df4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.659 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "25f34193-df0c-4477-a736-6e9180355d9b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.933 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ad924267-2ddc-4836-9158-4e25bb38e5f3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9e227951-45cd-43ee-a92f-cd7b59304f81", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.128 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9872ca9d-24b6-4cb7-a5fd-5c91ac7e7388", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.097 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d3102795-4058-4a12-97fe-76603e1c4290", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.16 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6b209087-dd46-4379-bcee-b873fddc0e1b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.891 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e0a9ccb5-6e4c-484f-bb82-8ee5577726e6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.212 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fd6d7628-b2b6-4102-b5d5-a2fc9c6d0726", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.976 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "addc715e-5a96-4b81-9029-f7900979fd1a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "80fed039-68d7-4025-8c7e-7eaed3e0bad8", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A11 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "537706bf-b05f-4cff-bf15-35773c13e8d0", + "MeterName": "Standard S3 Secondary Active Geo Database Days", + "MeterRates": { + "0": 5.0322 + }, + "MeterRegion": "IN South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c1d03ac1-bd3f-4b1e-b17f-064a4f92914d", + "MeterName": "Standard S4 Database Days", + "MeterRates": { + "0": 11.071 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cba56cbf-040b-4bf0-ae5c-729b318cab65", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.057 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f0fb10d7-942c-4e16-8955-8c9237c451e2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.209 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dfb0e6b9-e53d-4b2e-a5dd-f6b8f5f2066e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.058 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b47020d7-ff24-4cfd-8d80-df58bdd2ddda", + "MeterName": "Premium P11 Database Days", + "MeterRates": { + "0": 282.263 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "744cc0f3-1253-4509-96c5-b70d9b674523", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.332 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "05d1841b-e0d4-47e7-a023-a77b8c5c2672", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "dd75c4ed-be82-4c52-9e65-f63f0b544941", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "S SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cc35bac9-b6be-4367-acf5-2ddfd2facecc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.348 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f48659e-7381-4c95-8a57-4819881f54f3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2d8bae6b-ad6b-4149-8fbb-f52a71a73502", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.131 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "546d77ff-f05c-4c0d-8eaf-46260027a4de", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MSFT R Server for Linux (12 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "e63d425d-5148-4a02-abf0-f5d801ba2a89", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A11 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "099ec3ac-ce52-4964-a5dc-809c7c91f4f1", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "23c32d2b-b75e-46fd-b0ee-80bd8327d834", + "MeterName": "Standard MS1 Database (Hours)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MySQL Database on Azure", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "af803a77-8a45-426a-909a-4169c4ba4bf0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.428 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0a0ea38e-b04c-4323-ab35-842deea3a45d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.311 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16m Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "98c5eecd-32d3-4616-a3ea-b3642c00f607", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "XS Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "bc10a8d7-d4d8-49be-a182-20f5a7a88814", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "XL Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ca107cbb-49dd-4567-bf73-09ae02574474", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.067 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "92eb9e1d-b0e1-4a31-ad2d-497c2580e902", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "735ba9e2-5328-46b5-95cc-5c40d1e1e473", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.249 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b8f8bc0f-e4dd-452b-b9e1-23eefc8895b7", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6d3c01bc-8791-49c7-b986-10fc34514ade", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.996 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bb800ecf-abcf-46d2-8fc8-4d8cea4abcf7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.556 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "85f538f3-5160-4e57-8a99-37c100d3a3b3", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ca29e46d-955a-40e8-80d5-287471165c96", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.197 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0f727a51-58cf-4a0b-b76b-0a2ee0403460", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.402 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1d2d3288-3b01-4d55-a642-73f07cd3f477", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.702 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fae2d2b2-b6ee-4aa5-b64e-2ee5b0a940e1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.518 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "45763c9c-9eb2-40b1-bfde-0ba052f51a2b", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5d9759a8-2e3a-4f77-99ae-e82ab6c0ca43", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "842f92f7-a46b-4522-ac62-8134271dc591", + "MeterName": "Standard S1 Overage API Compute Hours", + "MeterRates": { + "0": 2.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a96d5442-6664-48d5-b61d-f819f9a887fa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise and Weblogic Server Enterprise (20 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8ed9141a-9814-4700-824f-352cd1952f61", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2bd4b50f-a11a-45a9-b28f-d2e7e248d7c9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.337 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "55474677-9809-457f-b8f9-dd912b063772", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.033 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "23fe334d-c9c9-4bc1-abb5-e6d398787ad4", + "MeterName": "MSFT Peering Metered Data 5 Gbps", + "MeterRates": { + "0": 2180.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ce1e156d-8253-42f4-bb9e-409708366fea", + "MeterName": "Premium P1 Database Days", + "MeterRates": { + "0": 15.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "040bce04-82d6-4337-a7dd-50a8971c4e79", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.544 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b50bf2e2-ce4f-48d3-ba9a-27b433f90fa4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.389 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "ad22fac8-9da5-4577-8683-56ae94d39e42", + "MeterName": "Standard IO - Table Write Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f18ee3e1-a8a2-4b57-92e4-440257cb49e8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.374 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6a6a5344-8478-4803-b1c3-229d08c10383", + "MeterName": "Standard S0 Database Days", + "MeterRates": { + "0": 0.5855 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "bcca2d1b-9cfe-434c-86b4-7b27d2b77810", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.156 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8m Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "eb573bb3-d2ef-4df9-91e4-8f25b2be1c45", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0408 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Zone Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "12306611-b02a-4739-99ce-3d8bd3d8f713", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.393 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0fa7bd26-4603-4171-ae1b-889d7f532f65", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.105 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ae11fbae-49aa-4713-aec7-372109c9931f", + "MeterName": "Premium P2 Database Days", + "MeterRates": { + "0": 33.0 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d9fdb5b1-11f7-477e-a9d3-5ee50dd7ee62", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "01a1aa40-44c1-4a90-9419-d596d8fbbe06", + "MeterName": "Standard Elastic Database Existence", + "MeterRates": { + "0": 0.0403 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 10240.0, + "MeterCategory": "Networking", + "MeterId": "c31b2562-1c9f-4a13-9c0b-f00848068558", + "MeterName": "Data Processed (GB)", + "MeterRates": { + "0": 0.007 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "c4d6fa88-0df9-4680-867a-b13c960a875f", + "MeterName": "Load Testing VUser Minutes", + "MeterRates": { + "0": 0.0004 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Team Services", + "MeterTags": [], + "Unit": "Virtual User Minutes" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3a749b90-5da3-4f41-94c3-9caa315e7eea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.297 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "9de7adab-6b51-4fed-82e5-dd8846025da9", + "MeterName": "Shared App Service Hours", + "MeterRates": { + "0": 0.016 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6e6509e1-6f27-4422-adc8-0cfee6f0f9e6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.36 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2d2494e5-f100-45da-9bbc-a191723650c1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.704 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7bd38858-97bb-4e1b-903b-33d8d319a00b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4ac0b0bc-7537-40bf-8a97-33dbac709c59", + "MeterName": "Standard S4 Database Days", + "MeterRates": { + "0": 10.9539 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "14c84391-c585-46ee-bc26-78920acb34fe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "1f222a62-fd30-4285-80f0-d5442be33081", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1b4d8861-8cbc-40c8-88f9-e1b78509c3be", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "8adf9e3c-41d6-473c-ae9d-7b42c4eba895", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5b25df92-8bf0-497f-a4df-e279e6dadb01", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "52865987-78c6-46c1-ac7f-79203006467c", + "MeterName": "Managed Capacity (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "StorSimple", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0d14ab9b-679c-4482-a935-4cbaebbd5af1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f5bcb3fd-89e0-46a1-9f1a-c1f417806237", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.131 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "35cee2d8-2542-4b63-898d-0a1a9ef3dbc8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.176 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "95ea396b-5a94-4e31-bf52-d065c3ec8769", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.068 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f646fbfb-3a49-47c4-b3dd-f5a927fad89a", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3252c8bf-be2c-4c36-a1d8-791b3278999f", + "MeterName": "Standard S4 Secondary Database Days", + "MeterRates": { + "0": 7.2581 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e5921380-3088-471a-ae87-a47cc97e98dc", + "MeterName": "Standard S2 Overage API Compute Hours", + "MeterRates": { + "0": 1.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "556704ad-c004-4017-9e2c-d7f451ec0dee", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e7e4d225-c521-4771-ada0-94c787ace59f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "4246e9f3-c6c9-4a52-bdc1-d83279f90315", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.684 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d7ef8df1-8f44-4b15-9d54-3cfe5119c153", + "MeterName": "Premium P15 Database Days", + "MeterRates": { + "0": 584.208 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0242cdc7-456a-4024-a1d5-f00b54f37b76", + "MeterName": "Standard S2 API Plan (Units)", + "MeterRates": { + "0": 32.26 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "035c0bf1-402e-424f-8850-7315ac39a3fe", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.0697 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "0204158c-944a-4a56-ade0-9cf6e06d7512", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "S OpenLogic", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "62315887-a65c-4cd5-89e7-b393e22487a4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bc2ced7c-f98e-46af-bc4b-18f081a9d829", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4d9dcbbe-af9e-4dc3-83f2-fb054e015c14", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.43 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "f14382b0-1838-48e9-9314-c7b6eababc81", + "MeterName": "Standard IO - Page Blob Delete Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0e3167d0-f738-4026-aafe-3897f5e18abc", + "MeterName": "Premium P11 Secondary Geo Database Days", + "MeterRates": { + "0": 187.5 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0cc0b81f-e04d-4bde-8a61-954ae4d6d471", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5b68d4d5-41cf-40a0-9edf-841283f73eea", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c6bd24de-da5e-4651-a7bd-5f76b9c04f82", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.746 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "37482b95-29e9-4d2b-b035-8e9178807c36", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "674d03d7-82b1-47d3-a4d7-f98cf35c3ef9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.65 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "992c13b9-9aa1-4675-8e60-9d3337392215", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.129 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a35e79b9-c4f9-4efb-ad2c-594221352dd8", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ff79cd83-8a39-47cb-b459-0977e3e89e77", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.853 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7e4c4c72-a61b-428e-9e3c-7a79d89dd9b1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.52 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e8f65007-bf26-47ab-9500-d611cde8e191", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.299 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "c82dbd27-c978-43a7-ad41-525a90d8962b", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A11 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7399da09-25ea-469f-886d-e592603daa18", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 66.56 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "74dddeed-eab9-41bb-b4e1-08695751c738", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "49369c7a-bf7b-4ad6-978b-952fc99b54a7", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10K Operations" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9e374059-62d3-4e66-84bc-3b4046ab7476", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d5b0c2c3-9ce3-48ab-a8c8-706e53790875", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.152 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "54d268c7-7734-4b69-bece-ebbf202cce90", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.625 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "12da282f-7e96-49e2-983a-9a65da2a4866", + "MeterName": "Standard IO - Table Read Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "c212cac3-156f-4b68-81c0-ababa07ba911", + "MeterName": "Basic C2 (Hours)", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "56a39682-a27c-4c5e-8e99-da2823a49e05", + "MeterName": "Standard S0 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.605 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3cd66222-4d2e-4d68-b6bf-5f80f58c4a85", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.827 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d2bc9901-976e-4fe1-acf2-68e3044cfe82", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.817 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "fabb6ca8-ac26-4948-b3dc-6d70873b53f2", + "MeterName": "MSFT Peering Unlimited Data 200 Mbps", + "MeterRates": { + "0": 1150.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "27618e6e-6e8d-4e91-adea-d8aed1302c76", + "MeterName": "MSFT Peering Unlimited Data 100 Mbps", + "MeterRates": { + "0": 575.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "57398c05-f43e-4f1c-8f37-6a16c9a507c3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.045 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a9df2950-9bdb-46e9-a73c-b4f1e7307a8d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.236 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4a6ab383-ec62-47a1-bf83-249fe1d887ca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ece72ad4-0639-4687-a28d-c6597cc14fb6", + "MeterName": "Standard S2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 2.7685 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "9958dcdb-4161-4941-b46e-33aeb72ec9a3", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "adb55c65-7f0d-4ffe-9e0e-a37d5ce6fd60", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.96 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC24r VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d204e666-c47f-419f-a6f3-9d23ae5c8cbc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.352 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "ec1cd117-3f47-477f-8ee2-b94b803649ae", + "MeterName": "Basic Small App Service Hours", + "MeterRates": { + "0": 0.094 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "35d1d9ed-ef1a-4d42-8ce7-644981a88aef", + "MeterName": "Premium P18 Secondary Active Geo Database Days", + "MeterRates": { + "0": 511.182 + }, + "MeterRegion": "JA West", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "28988efd-fc1e-4981-8bd8-c576981cf77d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "21fcab3e-6854-4e4c-b58a-9ca7ac974a2e", + "MeterName": "Premium P2 Secondary Geo Database Days", + "MeterRates": { + "0": 23.4 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4e67d1d2-4b88-4b52-8664-4c5757ed3283", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.491 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c5c59c07-827b-4bb9-9f01-6421d84752a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.374 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "7c8f5b20-386c-4078-85de-14d64b3e059d", + "MeterName": "Standard C2 (Hours)", + "MeterRates": { + "0": 0.225 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e31a6c11-cd68-4639-8bb1-bc218a9537dc", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "032065d3-7112-4150-bd43-4ef521488557", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "fbd8a891-35f2-428a-b57e-d0522586a044", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "a292bb0d-72e7-4fe0-afa3-d83a5ed8b37e", + "MeterName": "MSFT Peering Unlimited Data 1 Gbps", + "MeterRates": { + "0": 5700.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eb7b86bd-7fbf-4e37-872b-dcf1728dfb63", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f6440c00-2acd-4b5e-857d-4753b5725b1c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.411 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8dd340a5-b9d8-4731-9c82-039f0d45bee4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.44 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Standard (12 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fe82dacb-c546-4797-86e8-6fc3fb5f1f19", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BYOS Red Hat Enterprise Linux (1 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "45c7c113-397d-44b3-9808-b0c7128753dd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.158 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8ce2780e-f219-4d9f-87aa-330a39b70b2f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.732 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f9bd2d0-496e-4fb2-a9ce-0ff10e190832", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.089 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "989ca342-61cf-4ed3-a3b1-7d50f490c46a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1c0cfb69-d818-42e1-8a2e-eae014e59158", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.84 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "7f59b5b2-1fff-4426-b43a-3ed8141548fb", + "MeterName": "Premium Small App Service Hours", + "MeterRates": { + "0": 0.375 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4c3bd520-1098-4e72-9a28-7e49df37d934", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5efb5036-06ff-4a8d-bd99-0f569fc5ba12", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.61 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "35c7a5fd-ae46-405c-ad6a-8081526d090d", + "MeterName": "MSFT Peering Metered Data 2 Gbps", + "MeterRates": { + "0": 872.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7d497e63-48d8-4497-90ad-265412de9e25", + "MeterName": "DWU", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b8b044f0-b0ea-4844-a35f-1863850968aa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.912 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "90598c0c-0402-4295-b5ef-2ffdbf5426a8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.15 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Enterprise (6 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "d18f523b-a7c8-45f9-82cf-4bfb4b8dbee6", + "MeterName": "Premium Large App Service Hours", + "MeterRates": { + "0": 1.32 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f51e1c6-077a-4a0a-b461-1ecb368670ee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.491 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "07501d86-23ee-4838-9a35-09e078fb151e", + "MeterName": "Premium P2 Database Days", + "MeterRates": { + "0": 36.3 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "18eaa967-b5a8-4fab-9753-dd9f6356a886", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ace6791a-8564-493d-b0c4-849a9e240610", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0784 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "12f2b340-1c2a-4790-a67e-b70f178e1d01", + "MeterName": "Premium P4 (Hours)", + "MeterRates": { + "0": 5.328 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4c26ff60-d1bb-4427-952f-cfd65ff75e4e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.486 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f944287f-b55b-4e88-8c17-a13a31521f35", + "MeterName": "Standard MS4 Database (Hours)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MySQL Database on Azure", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5166f630-3883-470b-81ef-9d77b25b964f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Scheduler", + "MeterId": "02e3908e-c446-48df-97c2-be94bab1951f", + "MeterName": "P20 Premium Scheduler Units", + "MeterRates": { + "0": 1399.99 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1 Unit" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "558f3e41-b808-45e3-98a9-ab4206ddd016", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7cde3bdb-9afe-4b7a-b657-57f84f25662e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.146 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c81ea2bb-4ed7-4e86-b963-19bd7a2bfdee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.856 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b73bd808-47ad-4b8d-aa8e-728c6667cbc3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.446 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-01-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "d3dc1d24-38a3-4932-865d-778f06b38eee", + "MeterName": "Business XXL", + "MeterRates": { + "0": 500.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "HockeyApp", + "MeterTags": [], + "Unit": "Plans" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "85212205-1ce7-4249-ad85-6183348e3dbb", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 73.22 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3cc2f7d5-59cb-4879-9974-d403be1f9331", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b223fc4b-0e48-454b-b1d5-61441b3ca632", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.084 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9988e02f-5ef1-4fe1-b855-2835cd2bd1db", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.516 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "664574fa-2c39-4caf-8b94-57bf5d0e1a62", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.169 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "375020be-5146-4cb5-907b-3b0aa1c4acd4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.681 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5f2f47e6-bcf4-462e-b22d-ea76ba528369", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "df180dc6-14c1-40af-b94d-ccaaf0afb6ce", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.021 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Integration", + "MeterId": "558debd2-68bd-42c9-9303-2c7b2a281031", + "MeterName": "Premium BizTalk Units", + "MeterRates": { + "0": 5.86 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Services", + "MeterTags": [], + "Unit": "Unit Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "47ae2469-9fd8-4f1e-9a05-5900b470d8b4", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "37a224be-47e1-42bd-b2aa-f08060e965ee", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "2885a6b2-5013-4fa9-8f3b-fc3ead8d136d", + "MeterName": "S1 (Units)", + "MeterRates": { + "0": 50.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "fccd24ea-f6e6-436c-ae40-853d0f38b9e7", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "1ef7d3bf-4224-456a-9b06-aec74f48cdbb", + "MeterName": "S2 Overage", + "MeterRates": { + "0": 30.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Search APIs", + "MeterTags": [], + "Unit": "10K Transactions" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "415cf463-a8df-4065-a0b8-c0fe3719da50", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0375 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c3e83e79-5fd1-4902-8f09-319d7caf23dd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.383 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "4b32b9e3-09be-41bb-b643-897568d9c0b9", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "99347b75-034c-442f-97c2-8e58559d0b17", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.536 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2bd52869-3e3f-409e-a092-dc4d0c854122", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.5392 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "66d3680e-f733-4710-997f-463a73a885b1", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0528 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f6ea544c-9ce1-4f5d-a1e6-929f9b175e59", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.208 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "212c584d-7738-44c4-9323-85720de0a8d1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.498 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0b18980d-6dcc-4f45-915d-7cb2b36737db", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.704 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "fb059566-63d3-406b-bfd7-a3a6cbbdb66d", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.153 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "d6bf4b6e-1c0b-43cd-8bb9-edd93991cefa", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "92b23694-ecdb-49ea-8f63-bea87dbba044", + "MeterName": "Shared App Service Hours", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a7dbe155-d28f-47f0-b926-1edb31c80147", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.82 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2d00018a-eac5-4532-979d-147f89762a67", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.283 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c15147af-e2cf-40c8-9e92-e9f6b33b4435", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.238 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f7f05aaf-c250-4fa1-b883-4682ddff86e4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cdd52a05-9159-4cb9-8440-dc58f8a5f9a2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.236 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "344dd460-e2bc-4c41-9f27-5c4fbdb1022c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.259 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4068a61c-e6e4-449e-88c8-d715e95e2937", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "693094b6-03ee-42ee-89f9-964904e636dd", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.109 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4f99337e-7987-4814-92fe-77c6e0cda1ca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.149 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a1945374-05df-45d3-8f69-1aaf85d30101", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "ddd423d8-fdf4-4909-8bf5-798d02146c16", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.1045 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dc75d256-94d4-4706-9e0a-953412f2f40a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7e584588-160a-410e-a65a-ec3510ea935f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.352 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "32e2d715-b6dd-4ad3-9a3b-93085c8622e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.146 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "53bbfe19-c977-42c8-911a-d7817319ec44", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "36293e8f-ac3c-45cf-bd4e-dc2542bdba03", + "MeterName": "Premium Data Analyzed (GB)", + "MeterRates": { + "0": 3.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Log Analytics", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "923e90a1-f27e-42b9-b572-0fd1fba05c00", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "43414975-13e4-47f6-9770-663d938c8236", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Weblogic Server Standard (20 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "55d6913c-a5af-4e8c-8e9a-855c536f5166", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7d817d0a-603b-44a8-88c4-1ccdb91ab3ca", + "MeterName": "Premium P1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 18.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d4b7f209-f44c-40ba-a7b2-fe6a99efdb1e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.144 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9f3b11dc-38e0-4449-9ef8-eb884224fa9f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.794 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "aace4d2f-175a-43e5-8e28-ce76139c6c76", + "MeterName": "Messaging Unit", + "MeterRates": { + "0": 22.26 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Premium Messaging", + "MeterTags": [], + "Unit": "Messaging Unit" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1ad2a734-9682-4741-a93e-adbed7ea38ab", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.08 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "85867f1c-2678-4ded-8fce-cb1a7cc3401d", + "MeterName": "Standard SSL Certificate - 3 Year", + "MeterRates": { + "0": 167.97 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Certificates" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6c6af233-53ed-4718-940a-3c1999d25490", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.713 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "59c75e42-762e-47e1-94a0-aa1d82d1f23d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.549 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e2909253-87cb-4fb6-8097-0f8a8c74821c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.64 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "511fb4b1-8a6a-4633-9889-076918f28004", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard (4 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "4b471c53-cfaa-4c1d-8325-4ebabac62212", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2cacc6e9-9715-4542-a7f8-68f68bfb9d78", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.464 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "c0d5b2bf-4083-4fbe-8939-c7d0a35ce6c3", + "MeterName": "S2 (Units)", + "MeterRates": { + "0": 800.0 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c27dd007-950b-436c-96b3-276ebff63c74", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.066 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "540ace59-9c1d-4418-8ee1-07d857d7b7fd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "c5248cf8-ecba-4807-9304-6a8f14b5805a", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "51c8e114-ad37-4046-8b1a-21d2e9cd679a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.885 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6452c91d-eae0-4262-8b8d-1822c144efe1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ff9d6adb-e1db-447b-ad38-63eb7cff2909", + "MeterName": "Standard Elastic Database Existence", + "MeterRates": { + "0": 0.101 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "a697336a-8ef0-43f3-9e07-1f1e66cebd52", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.0056 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3489054e-9396-4ea1-87e0-2f8eec691d48", + "MeterName": "Premium P11 Database Days", + "MeterRates": { + "0": 258.32 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a21777e6-cedd-4086-9990-2718569c8c44", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.939 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6b5ae2c8-b3b1-43ab-a897-15750fd974a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.202 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2416f530-b190-43d7-9fec-239e1a57ea66", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.396 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f5a1c44e-f6cb-4223-8954-db0650c7b1cc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "5257180f-3f05-40eb-8364-aa21d997b2dc", + "MeterName": "Basic Large Azure App Service Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6a1449af-6a8a-4fa4-a106-f74d5aae0edd", + "MeterName": "Standard S3 Secondary Database Days", + "MeterRates": { + "0": 4.536 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "51e81064-e0fb-4db3-84e1-9fca0dbf9a94", + "MeterName": "Standard S4 Database Days", + "MeterRates": { + "0": 10.9539 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1c9ee768-8e9b-434d-9de2-4a7b67c844d9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.624 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9e6a219e-f10b-4035-ba32-8856f48742a3", + "MeterName": "Standard S1 Database Days", + "MeterRates": { + "0": 1.0064 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8520df01-1358-4b00-91ec-2b491d44bc5b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "42fb7fdb-e89f-49d4-854b-aad60b7e8c93", + "MeterName": "Premium P2 (Hours)", + "MeterRates": { + "0": 1.11 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2b0c7480-6afb-4d8d-a112-7ee2f020680f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bb6adb50-fe05-4897-88bc-0af2b2430b83", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.206 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7394f56f-e03c-44da-a29e-7958f8999d95", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.091 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "74a9795f-28bf-4bff-87ae-bb8bd87dc2fa", + "MeterName": "Standard Large App Service Hours", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2bcfd0e1-e812-48f8-908c-4e24c4fcd0ca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.39 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "93a18a5f-d98a-41c9-aafa-1e1e6f58c7cf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.143 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "207dcebc-f6bd-48eb-9ec4-ec1efafe4e1f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.202 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "66a10a5e-b332-424f-8d85-b6f2aa8400f4", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0252 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "feaf29ce-96bd-4895-bc6a-7b368b6af1e3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.168 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "1f0b8904-817c-48c6-9886-c9ce8bec6cf1", + "MeterName": "Basic Small App Service Hours", + "MeterRates": { + "0": 0.094 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "599d8114-9825-4572-a41e-6f6540eda937", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "662d05c5-854d-4b41-a124-8ff89cfe8ad8", + "MeterName": "Premium P4 Database Days", + "MeterRates": { + "0": 75.0 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1b37f488-f844-4545-a9bf-e24c728f42da", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.081 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "53d2c5b7-7766-4252-a72f-d5a5a92bf206", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.492 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "31fadbe3-05d8-4a3a-9881-9b2661e26500", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "b1c3135c-e5b0-4d3c-b945-7fff5a62942c", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.011 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "b6caee93-d882-4081-986a-7a9604eca996", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "67a2faac-4879-45e6-8cc7-20f181b1425e", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0528 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "799d23fa-6848-4c65-a3c4-064f1b897107", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.071 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "64a11e57-33f8-43a5-8057-bad197432639", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.644 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "633da1bc-9294-4330-be48-e1d9d135a7cb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.21 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "6a476bc7-b392-4bf4-b1a8-591ae0acf335", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4faa1e00-12cb-43d9-bfe0-e84a2c5103b1", + "MeterName": "Standard S1 Search Hour", + "MeterRates": { + "0": 0.444 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ad92d711-0a96-408d-9ceb-d2c83f1f8531", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.836 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d1c9abda-ba4b-4dbd-a240-bee3a9c6ecbf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.066 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d0bfd1e0-05e8-4ef9-8648-9b91fd3a109f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.44 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "76bbfa2e-d64f-4479-bc5f-8ded27d193bc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.227 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "8a98f16f-fa8a-4670-9995-e535357a30e7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "99e96e8b-46a6-4666-b4d2-c55778d92367", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.059 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "4b836326-7e19-46e6-8bce-1b19bb6cd91e", + "MeterName": "Unlimited Data - 1 Gbps", + "MeterRates": { + "0": 8700.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4912d84a-709c-46bf-948a-f2f1672e38dc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.064 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5a3e7c3d-bf8a-4b6e-842e-110b8524eb6c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.193 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0d56e2ba-6a08-4722-82a8-00b5c1445609", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.069 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f77e0007-79bb-4084-ad1d-e032332ca0de", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6e933ffa-3472-4ce6-ac6d-225932565273", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.771 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a021fa38-430e-4d72-8e85-c48c4e17871b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.89 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A10 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "35a6c73a-1f03-4c29-819d-9ebba158c4b2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.874 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "38d1f914-6fc4-4eeb-841f-9e293b66a8a2", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "0b3bf1de-bace-4fa2-819c-36d0a68dc87c", + "MeterName": "Premium Metered Data - 500 Mbps", + "MeterRates": { + "0": 1090.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "f6a8c17e-81aa-4749-a5be-d718b13b6116", + "MeterName": "Premium CDN Data Transfer - S2 (GB)", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "Zone 4", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5dc1ff3b-83bc-4bba-ab2a-5cb3aadbc68d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d75fb159-1a02-44b5-bb5c-fc204f93e846", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.099 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d1548cd3-4157-4354-9b4b-1c3945ca600b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.176 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "850e32c0-2e70-477f-80c8-a687cf90cbed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "131624b8-267e-4598-a413-406dacac7f90", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.19 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "0a06f0bc-935b-48cc-b186-6c0fc958af57", + "MeterName": "Standard Large App Service Hours", + "MeterRates": { + "0": 0.472 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d34378b9-7e62-4059-9455-cc7c3d893ad7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.516 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a6d448d1-9628-4cd4-8861-f83781b38e9e", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.144 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "08751b2a-9d63-44d6-9097-bbebbb220c3e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3d4a8a87-4a21-42aa-8acf-e49c56cef148", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ea6f7056-06b0-4fac-babb-bf63e9df78d3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.546 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2ca64efa-a6d8-482d-bd68-58809f238498", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.242 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "41f2c58c-cd3b-4ca8-bb2e-8df3ebef92c9", + "MeterName": "Basic Elastic DTU Pack", + "MeterRates": { + "0": 0.0536 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4e84bc5b-2f95-4f8a-a104-0a8ab42d8690", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.486 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "adb811b9-536d-4d77-bbf7-08d52c5013e0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8944b556-1ecd-4af5-ba4e-21d6eef87a81", + "MeterName": "Standard S4 Database Days", + "MeterRates": { + "0": 10.0645 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5de48299-d812-4dbd-b1e2-99714e5bf7ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.147 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "22c53c77-198b-4357-b1f8-59b9fb790b5a", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "86c35ec3-0a48-426a-9625-22d80e6ea55b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Red Hat Enterprise Linux (64 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5bdd6b41-bcff-42c1-ac50-1589366d2657", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.417 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "7152c7d8-e834-41f9-a957-07d28a914039", + "MeterName": "Web Language Model API (in 1,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1,000 Transactions" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "e5bfaf00-3fb5-4eba-9e82-d88c836f05eb", + "MeterName": "Standard S5 (Units)", + "MeterRates": { + "0": 8100.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Search APIs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "59d1ce45-9e3e-44b2-85c5-4677230ecc88", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c0d070a1-109a-4680-882d-ffd690a650fa", + "MeterName": "Basic Database Days", + "MeterRates": { + "0": 0.1771 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2012-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "46c02a5f-778a-4feb-85bf-de4148636090", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database Premium", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "191ad589-61e5-4594-9210-fa95d558d9fe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.068 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "99f4dbeb-2b87-4ed3-8d60-2e53cc8c42a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.405 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "75985cb6-97f7-419f-b9c0-b474c0ca917e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.498 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d2fdb608-8d44-41b5-a3a3-65ad2aefbfd7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.098 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f4a02d15-0363-47aa-b0f9-eba6352e2b89", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.55 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9b64a312-f905-47dc-b2c7-df55b98d8787", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.992 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "07f2cec5-9b8a-4e61-908c-b595b9751668", + "MeterName": "Premium Elastic DTU Pack", + "MeterRates": { + "0": 0.4118 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d10f3a9d-6938-49ce-9131-f0045260163e", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9a17738c-a44d-4b21-9933-a0d9f641bd79", + "MeterName": "Standard S2 Secondary Database Days", + "MeterRates": { + "0": 2.172 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2c9aad52-7ba7-4091-97a2-9921beb53694", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.35 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "577ebb1e-e1c6-4574-94e5-fdf42c26cd95", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.24 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6b288fb0-8311-4dd2-9b80-049267aabc89", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.292 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "67cf08ec-f742-4d89-ba10-60ff525dd71f", + "MeterName": "Premium Extra Large App Service Hours", + "MeterRates": { + "0": 2.4 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "57c3fc29-f201-4b57-81cc-1f1d7370ee54", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.292 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7fc61108-5209-4f54-a47d-c3b0420067c4", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.1045 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "4eea7f36-94f2-4063-bde7-6bcf3597a368", + "MeterName": "Storage Transactions (in 10,000s)", + "MeterRates": { + "0": 0.00045 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10K Transactions" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "96b76006-b409-4d24-b20b-0e464b89bf23", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.044 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "acc6e3ce-2e13-4b31-8c10-6cbea9cdcea8", + "MeterName": "Premium Elastic DTU Pack", + "MeterRates": { + "0": 0.2188 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bc7b6c39-9972-42cd-97e2-f6dfdace5026", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0fa1f4d8-0759-4388-96f0-d81c8693482a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.038 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dc6018da-b9d5-4e88-8394-5ab24c3ff8a1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.183 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b07b3e32-66b0-4e76-a5d0-34a3c469bccd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.449 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2638e2d5-1b48-4d70-babb-b3532f83033b", + "MeterName": "Standard S0 Database Days", + "MeterRates": { + "0": 0.5323 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "187814b2-8d92-4177-ab9d-f750a58e1280", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "9af05e34-bf29-4ff3-897a-400d5458fedd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.384 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "863ca6b1-00d3-44b4-87e9-5aad9fa0ece2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.996 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d6013ce8-da29-454d-a946-dbf30b75b81a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.34 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0ca2c2b3-effb-4204-8c9e-a79f62e47893", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.204 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2ceac40b-a2e1-44e4-9263-336b54e5cca0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.248 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "574b4779-7c85-4019-96b2-6df26fb7c95f", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "116ea09d-799d-4f5f-b6f2-fb657dadd785", + "MeterName": "Premium Metered Data - 10 Gbps", + "MeterRates": { + "0": 8000.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Xbox LIVE Game Services", + "MeterId": "edab46fa-fe89-4a59-a10f-34d0f15c7d71", + "MeterName": "Data Transfer Out (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2fee86b7-7c49-46ac-851f-95094c188ef6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c1bf2374-cc2e-4d2b-9e34-8182cfc6e908", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.459 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3407ac53-95e8-4162-9c94-f22d9d766202", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6342d833-86aa-4984-9659-dbb69e79e64d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "8d85f56f-03bd-4f1f-b5cc-06c4db133f63", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.5 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "663397f3-4446-4ec4-a00c-ff7c8046d565", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "04f74f93-7f74-47e0-8309-37c7ec2f5cca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f3d2ca12-995e-4314-8054-1dd48319df09", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8b620e2d-6f16-4301-abfa-74ddefd908e9", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 121.653 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "03a406f1-fcdd-4662-932c-91652842e835", + "MeterName": "Basic Elastic Database Existence", + "MeterRates": { + "0": 0.0177 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2384a7ee-120a-44f4-a6dd-497eab2195e4", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.032 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "fc4bbee0-9ba0-433a-8731-66fdab16a591", + "MeterName": "Standard Elastic DTU Pack", + "MeterRates": { + "0": 0.091 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0c50be21-2aa3-455b-92ee-a50aaeecbd7f", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0beefb4a-8f54-4f9a-acfa-3707b3e7aa13", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.582 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6769d71b-8499-4168-bfcf-c84219e6654d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.466 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "3f5a1f85-0a6f-40f3-b81f-8f440c1300d8", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "65d3e0d5-c88d-462f-a3e2-f954e6c60361", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.98 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f4bb3c38-588a-4856-88d1-d6880ba5e256", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.54 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16r VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "4e62a388-c558-44dd-be07-b7dce949efcd", + "MeterName": "Enterprise (Annual)", + "MeterRates": { + "0": 2999.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Annual subscriptions" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "95eca2c1-9519-4c55-baa1-9a0e0b201e25", + "MeterName": "Basic Automation Minutes", + "MeterRates": { + "0": 0.002 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Automation", + "MeterTags": [], + "Unit": "Minutes" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "29b0f50f-478b-4b18-a0a3-0f2b2bc52231", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.099 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "da55f3c8-c8dc-4f65-8f99-9d6f201b1ea7", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "76e51cba-3292-4d9d-a556-b268d61b0f0c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.435 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6a58cfd3-f46a-4634-9202-b0d962003a79", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.4 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c761fd09-4df5-4e41-ad54-ca093f8840a2", + "MeterName": "Premium P13 Secondary Geo Database Days", + "MeterRates": { + "0": 266.13 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "dbedc6e2-5aca-41e0-8481-7203e4d7718c", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "c80a3636-2edb-4248-bcb1-04ef818a75ac", + "MeterName": "Standard IO - Disk Write Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7793f433-c5bc-4f3f-b240-c10ffe8cc53b", + "MeterName": "Standard S1 Secondary Database Days", + "MeterRates": { + "0": 0.803 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "5b50a2ef-bad3-4614-b502-17465754854a", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e11d4e94-59a2-4542-a5d8-a485288cc1e7", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 73.22 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "17a7522f-1e03-4a46-8400-53066aad0cfc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.051 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0a255378-40f2-4fb4-a88f-bf739c4878ed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.662 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f89726f3-c447-4fe8-9614-0ea94259c815", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.067 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b0673c88-aa75-44d9-9823-00bdc14523de", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7a97e8d2-1eea-4313-b762-8fde2944667b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.452 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4c4ff08f-7a50-4872-b64b-28817a7e99e2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.047 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "83901175-ffc6-4efa-8e32-4fe3278d38d0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.76 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "49a64606-30d8-4387-9d7e-759248ad7b23", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.633 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7dd4443a-eee7-47a3-8f7e-40dd40e95b26", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.833 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "46859d3d-1681-4417-a55d-ad6bedf5745a", + "MeterName": "Standard S0 Database Days", + "MeterRates": { + "0": 0.5468 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5e415bc9-7936-445b-9215-306205de24d3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2a4a93e1-73e7-4f6e-b8e6-40b8b00d0074", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "76f9882b-7d4a-4356-804f-99a392b50bed", + "MeterName": "Premium P6 Secondary Geo Database Days", + "MeterRates": { + "0": 93.6 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "18ec36e4-d126-40b6-b06a-53e8bf18309d", + "MeterName": "Premium P15 Database Days", + "MeterRates": { + "0": 584.208 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "27722013-7a53-4a35-8272-9ae43b946965", + "MeterName": "Premium P11 Secondary Geo Database Days", + "MeterRates": { + "0": 211.7 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2197fb0e-f9a0-4d1c-99ab-f158e6228e91", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.736 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ce200878-26dd-4083-8a39-8166f81997ac", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.016 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4d58644f-2a15-4ba7-9df2-c2dc92e7576a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.166 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "79f8bb51-1197-4222-adc5-65ad5d4e2516", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "22b47bde-0361-4f0d-b7b5-9a093cf67c98", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e0dc5a61-7529-4641-93e9-3253f83d1944", + "MeterName": "Premium Elastic DTU Pack", + "MeterRates": { + "0": 0.3744 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ab4cd6f2-99fc-4f56-b3c8-3e01aecf3f38", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.907 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1a5eabae-3ecb-4762-a84f-937fc6cef037", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "702e9999-b340-44aa-b466-ada5552b8f85", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.576 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c9157d13-bf43-41ad-b270-f5d6dbf336ea", + "MeterName": "Premium Elastic DTU Pack", + "MeterRates": { + "0": 0.1993 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "efbf19a3-cd04-4d22-870d-d6838497d618", + "MeterName": "Premium P11 Database Days", + "MeterRates": { + "0": 255.6 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6c29d974-16dd-462e-b117-393749e90f1d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.081 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a504eaab-0932-41b8-9297-53613397aa8f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard and Weblogic Server Standard (2 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "817e52af-0065-43a3-b2eb-2ab33482bbf3", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a19cefd2-e440-4983-b03a-f861f4312f60", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.166 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "3ec1aea7-28a6-4c59-b645-446836260939", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e46739a2-f90d-4c77-8120-b76d7a839949", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.101 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "ba66f4c5-bf33-4548-adac-d32652c8ae23", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d9e2713a-d51f-450a-a38c-4ec5f41cf630", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "47ff3834-1ed6-4610-b089-9a33be58fe3a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.853 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "72f659e7-5880-47ce-981d-ddc828ce89e6", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d3515188-f20d-4dd6-9ef0-61c0f0b792bc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.5012 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d817c09e-b8b9-4d2c-8de0-5c34d5148bf3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.098 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ae141c30-f6a6-41ff-997d-48c1521a9224", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.551 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "87ff49bc-9c61-4494-8127-12ab834236b6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "8fde27a4-f37c-4af2-ab00-f53eac8f1925", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6bf0fbd7-9dd3-4cfd-97e7-e9a6403df152", + "MeterName": "Standard S3 Secondary Active Geo Database Days", + "MeterRates": { + "0": 5.5354 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "848e5302-c41a-4431-8b57-1ebd3603c7d8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "70653a90-aede-4e59-a122-265a80801f27", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Enterprise (24 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "df8ad0fb-dcb6-4749-a52c-3aeaf69435ac", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.336 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "93f05093-c98c-49f0-832c-9ac7020050f9", + "MeterName": "MSFT Peering Unlimited Data 500 Mbps", + "MeterRates": { + "0": 2750.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "9670348a-c726-4402-b54b-f931ffb56b1e", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d2aa85ad-233d-4e55-a30f-36cb6a2e0166", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.659 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "626d5968-01bb-46f1-8f26-97aa6fd64c23", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.376 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "10155e99-5e40-4dc4-84bf-d5ab7c7cf012", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.093 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2012-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "47146c02-c177-4c1b-afd5-06780c8472e6", + "MeterName": "Database Hours", + "MeterRates": { + "0": 0.625 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database Premium", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3efe89dc-d410-4dac-8b3c-1429a46b6888", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.085 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "fff068af-d2b2-4ffc-895e-d2be686d9b39", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0425 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "12fcc5d0-2596-4266-8ff9-25f547ad1385", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "bbf64453-c36c-4156-adc9-1cc53c9139f0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.741 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "481d417e-9f85-4b8d-8210-2bd93983f04e", + "MeterName": "Premium Medium App Service Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d1e2abca-d7b7-43f6-92b7-41cf38a2d7ab", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.185 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "68b92e75-54c9-4b37-a0c7-35b38f639c97", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.484 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "0831c2bb-a6cc-4625-af33-f1ace5842337", + "MeterName": "Basic C4 (Hours)", + "MeterRates": { + "0": 0.21 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0fb551ea-6cde-4c19-ae7e-7f851b142062", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-01-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0a0504db-881c-4e74-a111-0ae9b1036025", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services Low Priority", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "69c70c12-70bc-4a98-8268-7443a8ceec15", + "MeterName": "Standard DocumentDB Days", + "MeterRates": { + "0": 0.73 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7da9ad8e-f3e8-4d91-87b8-9746e0dd7a50", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.771 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "40551b4c-e8be-48ed-b70b-f8d25c7de724", + "MeterName": "Standard IO - Block Blob Read Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2626cdeb-73d2-4fbd-ae22-5e0c6066c41b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.758 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a6995e08-df5a-4617-b712-9ff0767a706b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.294 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "3b81b7ee-cf08-4625-9ba5-d3aa0b424d6c", + "MeterName": "Premium Extra Large App Service Hours", + "MeterRates": { + "0": 3.0 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e6e1d991-8e82-4f8e-85d6-7ba85b67fcd9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "13c3eaaa-d5bc-4ff1-8df4-3c5347fc3fb5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.617 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "a11726b3-27b7-4012-9630-b8434d9ca8f8", + "MeterName": "Wildcard SSL Certificate - 3 Year", + "MeterRates": { + "0": 809.97 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Certificates" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f03a2649-c2b8-49c9-a63a-02b31884dfc5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.491 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d2651b1e-e0a7-460e-ac74-0147971ba7b0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise (20 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "88dfea34-b63f-460b-82cc-22750f689c86", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "0ff80052-eeaf-49d1-aa95-f2f6b0eb8ce2", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.011 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10K Operations" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "81d1cc1a-fb59-4b84-b6b2-1ec654985a8e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.87 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "bad80588-600e-4e40-9dc1-af46266235e7", + "MeterName": "Premium Extra Large App Service Hours", + "MeterRates": { + "0": 3.024 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2423b132-5a85-4143-a023-3841f808ba15", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.325 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3fb6903d-106b-487e-8bc3-46efe8e541ce", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.224 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "aff46940-a2c6-46c0-9dd8-2a18816c8415", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.531 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b1d08d37-71a0-4c19-9072-d07296a8e767", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.952 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1febd7b1-0981-4f31-970c-114eee7f8fd4", + "MeterName": "Premium Elastic Database Existence", + "MeterRates": { + "0": 0.4193 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "7b399fdb-dcd7-49b6-a02a-d42354934a4c", + "MeterName": "Premium P2 (Hours)", + "MeterRates": { + "0": 1.443 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0edeac0b-bd6c-47fb-9325-45e4f7adee3a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.035 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8d29e058-214a-4ec5-a52a-df7d76ce1683", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.191 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5df0b68a-14df-4e53-b4d7-80a5d839a07e", + "MeterName": "Premium P6 Secondary Active Geo Database Days", + "MeterRates": { + "0": 120.0 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "96d7e0e7-ec9c-444e-a09f-11120a7ae253", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.256 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e70070ba-91e3-48b8-a2c6-6060704cb7a7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.68 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7836a3b9-6e89-4630-8370-ec9f5427d9fc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "90a20b8b-de68-4f1e-9f08-1bc70aa170e1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9769b669-1e76-45f8-99fa-a779c5598226", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.92 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Java Development Environment (24 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a017bece-ced2-4a16-9939-993d40b086fd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.486 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "b1d1445b-213f-499a-bb19-070a2d50248a", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.055 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d19f36ed-e606-4cf0-b5de-d38e484a348e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.651 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "ba5ea988-bc12-4945-a8ab-1d20074f9a98", + "MeterName": "Basic Medium App Service Hours", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a3834edc-199f-447b-bc92-1d73c1d13e64", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0671 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0d8672e9-c981-4980-a8b2-92a91fd0d983", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a8e1572a-f70b-4651-ba7f-10b5883a1a7e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.267 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "779c78a3-ce9d-475a-9830-1e7f1759cf16", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.786 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d3b2ba19-019b-4d6c-a451-c790c4d361cd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.52 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "290d414c-c892-4e22-bd94-fdba8a30798a", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "0df63342-0a5d-4d17-a618-141acf35b84b", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3bdf5d3e-fe86-4d3b-ad42-86309b3063ea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.584 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ed004e7f-32cf-476d-96e7-2666d175acfa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.346 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2eaa171a-68e4-489d-a914-54489cb2ab9f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "703cabb2-a30d-44e2-be47-cc8fd1ec25fc", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.015 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d661e656-93ca-48c3-87ac-5c57d5a336d9", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "812dd3b7-5bb0-4f0c-9761-cfb449185e77", + "MeterName": "Premium Small App Service Hours", + "MeterRates": { + "0": 0.354 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "63c7062e-7bdd-4cc4-bd18-dad930113649", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.87 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "aaca138e-b0b4-4210-995c-0403935f30f8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.78 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 12.5, + "MeterCategory": "Service Bus", + "MeterId": "2a9992f8-e914-490b-a7a6-6d21ba55acda", + "MeterName": "Operations (in 1,000,000s)", + "MeterRates": { + "0": 0.8 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard Messaging", + "MeterTags": [], + "Unit": "1,000,000s" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a2e54082-24f3-4aca-abea-c055d5e781bc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.81 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c3a1efb2-3186-4d07-89ed-fe27eb037e12", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.099 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2d19b1c3-fbdd-4afe-b626-5ecd85572af2", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0264 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9d5a76cd-a00f-4049-9ee5-e5b259dd6039", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.168 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "56432ae2-acd2-4a72-bee4-87c0190fa02d", + "MeterName": "Premium Unlimited Data - 200 Mbps", + "MeterRates": { + "0": 2600.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "11361e68-c109-4d89-b206-090b98a9bdad", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.753 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ff6337ba-f0af-43b1-971f-5a100bed5a99", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.408 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cb276b0a-ea08-4a83-b6d5-45d89f048dc5", + "MeterName": "Premium P11 Database Days", + "MeterRates": { + "0": 274.43 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "94f06d38-6599-4642-a40e-092f05bdc423", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "de8fff51-3f4b-416b-9833-58f93db65d14", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e95f0563-89c1-4fc1-a047-9f9fe4d317ea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "15289f97-4295-4187-8880-7824fff7bb29", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e314e832-45b6-48b7-9e81-f3c9cc00abeb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "84af43ae-2cff-46f6-96e1-f03d27dfeb55", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.026 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c880c666-747a-49bd-9ae9-80058a40cbd3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.178 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 5.0, + "MeterCategory": "Recovery Services", + "MeterId": "fbadd0ef-6666-4d56-a827-fe1bd8769d15", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Backup", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c118d699-ac19-4fbf-a15b-058be21e29a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.242 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "64a0ff57-b773-4f5d-b372-3f55b368bbad", + "MeterName": "Premium P6 Secondary Geo Database Days", + "MeterRates": { + "0": 99.0 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "36d6dff9-7b8b-41ec-970f-ddedac86d1a6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "ba302f7a-078b-4141-a636-a76315ba44ce", + "MeterName": "Basic Small App Service Hours", + "MeterRates": { + "0": 0.075 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ee91827c-0eeb-45bc-bfef-bdabaf8b21dd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.794 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9af5b606-965b-4c39-915a-a7e81ab1a9c3", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.067 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c9dee6c3-b377-4125-ab03-34187dca32c0", + "MeterName": "Job Units", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Analytics", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "5b2d57c7-c637-4224-9e46-59c821440dea", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "c2c93259-bcaf-42cf-b11e-15b37ca598f0", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0e7b0b55-5f1d-4617-a87d-7956d51eef49", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c9fe92a8-fbbb-4ab2-bbc8-6e2ab7638470", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.323 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cc18e51b-0840-4519-820c-f12e41ed62fc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.29 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0787e845-dc3e-40c2-a093-868205c57706", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.234 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8dde8b2e-acd0-4835-8804-539beace387d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "acc82e43-c1c8-4fe8-84c4-bc2f6335353c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d56287c9-d109-45a7-b3e6-eb93f1e0a70f", + "MeterName": "Standard S2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 2.904 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "85fb2294-8995-4b39-a0f1-e453f5df4ebb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Security Center", + "MeterId": "15e6182d-2afe-4c9e-8c23-4062bd80b3d4", + "MeterName": "Standard Trial Nodes", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Nodes" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "baba89e7-bf49-4814-8e99-0873b7a6e592", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.411 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fb847935-9c23-47dc-a7ed-f0f8de600307", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.524 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "29d80157-6618-412b-8b53-41a09b811adc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.704 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "739d4f95-af86-4065-bcad-454a12e030f8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.386 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "516d1f4c-5f09-43c2-af5d-3325d984de55", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.176 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8d487cfe-50fa-4a5a-8f6b-b5033de5e3e6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.584 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "41e0b729-b549-4a82-b6b9-a40024c571ce", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.125 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a78db867-be55-4621-8a40-a7d452605ea1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0171 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "51607b3c-9707-43e1-a608-27f5d42f0696", + "MeterName": "Premium P6 Database Days", + "MeterRates": { + "0": 124.8 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a50a04b5-2c4a-44ba-bc55-ec0025fb661b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d963fcb5-ca86-46dd-ac1a-95a52ab154b6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.513 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "72f3794f-05db-4ff8-a92d-20d7c4f8d09c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.78 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "65f64746-ab4b-4236-b2b5-1ff0b0ed82da", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b4175747-cca9-49df-9c4b-4f74be74d376", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.477 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ec512cda-5778-4fb9-b9f8-cac82ff35b17", + "MeterName": "Compute DSU (Hours)", + "MeterRates": { + "0": 2.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Stretch Database", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "fafdf2d7-f2ff-45aa-ad19-e576978c9174", + "MeterName": "Premium P2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 31.2 + }, + "MeterRegion": "IN South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "84bffee5-ab4e-457e-ae0a-0747f53e04fc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.238 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3e96e963-2fc1-4163-ae72-d742707c54db", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d3881530-461d-4736-b8ca-a02a9d94adc0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.385 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2a3fdbe6-adaf-4590-b938-8b96b6a60893", + "MeterName": "Standard S1 Secondary Database Days", + "MeterRates": { + "0": 0.8351 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a7e87e9a-a6a9-4495-9dc3-261774b93704", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "94b67630-61f2-465b-a0bd-c2fb8bdd1136", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.322 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "a84e42c4-d199-4cce-b2e8-9fefe6fa2ee2", + "MeterName": "Shared App Service Hours", + "MeterRates": { + "0": 0.0138 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f3485115-5e7f-4add-94ff-ec5bb77b8bf0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.035 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3d03000b-d983-437c-8be2-18708795d648", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.034 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "bf20e6b9-2040-493c-aaf3-a61ceb7de3b9", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.055 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8d67bddb-b6df-43f4-ada6-24222268beed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.392 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d5fd3c5c-e51b-41be-b8ab-34399ed389c3", + "MeterName": "Premium Unlimited Data - 500 Mbps", + "MeterRates": { + "0": 6000.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9dd9d29c-710f-43d5-ad66-6eafe95ed48a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.835 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7f863132-b367-4b10-91b4-e87401aad714", + "MeterName": "Users (in 100s)", + "MeterRates": { + "0": 50.0 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "Azure Data Catalog", + "MeterTags": [], + "Unit": "100 Users" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "748d0c9d-f81d-44ac-9c18-1bcd1cc20a68", + "MeterName": "Unlimited Data - 10 Gbps", + "MeterRates": { + "0": 51300.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6bf946f8-fbbd-4d45-88b8-3184a7dad257", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.986 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "938fc20c-a31d-4594-a651-03c4d1a68f90", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.0963 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cca0599b-a1f0-4731-8e1c-73867b093ff8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.148 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "5833c72e-4737-416d-816f-7ed7b2e892ac", + "MeterName": "Premium P2 (Hours)", + "MeterRates": { + "0": 1.332 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d3945604-5bb6-4d9c-8266-8233648d9d5b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.225 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5e2c8dd2-7899-4cb4-a9e3-0f08c3f90022", + "MeterName": "Premium Storage - Page Blob/P4 (Units)", + "MeterRates": { + "0": 5.2801 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9ec1557d-a16b-4acc-aaa2-926a22541a53", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0d825caf-c52e-4778-9703-c05a14ebe506", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.059 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "56c39162-0826-4651-9f21-b5e62119c5a6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.5 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A11 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d1ee12bf-83ce-4be7-b0d6-3ec88afd784c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.094 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "97257700-ef12-4785-9a97-306393acac14", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ec9c3c03-f0c9-4bbd-95af-1c141ba033e4", + "MeterName": "Premium P18 Secondary Geo Database Days", + "MeterRates": { + "0": 338.716 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2e3c2132-1398-43d2-ad45-1d77f6574933", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6d22785e-55f5-406a-b053-39346d79eee3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.04 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f387ec7-12a0-46a1-a94a-4d5d2878177c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.323 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "3724ca9f-7356-4114-96db-dd63fa2ded59", + "MeterName": "MSFT Peering Metered Data 5 Gbps", + "MeterRates": { + "0": 2180.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "57adc0dd-e490-4db5-a420-a586dd1d5f62", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.848 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "326f855c-2e02-46c0-a34f-2051cef5dd61", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.992 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "39cbf8ac-08cb-4b39-9cfe-50ed2374c8d9", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "102173ef-b7bd-4729-a3f3-8231b84688b5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.069 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4da9deaa-6718-460c-a61a-278433741340", + "MeterName": "Premium P1 Database Days", + "MeterRates": { + "0": 18.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "26d8935d-84e1-4207-a0e5-cb2728227840", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "b4a5be5e-7d2d-416b-bb54-8355ac8fd46d", + "MeterName": "Premium Unlimited Data - 100 Mbps", + "MeterRates": { + "0": 1405.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3ea89d54-25fa-409e-9b68-ccd73dc45ac2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.88 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "70dcc916-5f58-47ab-8fc5-c72a31ab144d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "ff92c14c-af83-412e-9144-a2542dfe0b4f", + "MeterName": "Certificate Renewal Request", + "MeterRates": { + "0": 3.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Key Vault", + "MeterTags": [], + "Unit": "1 Unit" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "623ece87-17fd-488b-a642-b70be13c26ba", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "72e7622d-8c26-4c80-8000-f31cb6b125c5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.159 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "177ee643-5434-4c04-ae11-9e01672ed87e", + "MeterName": "Throughput Units (Hours)", + "MeterRates": { + "0": 0.015 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Event Hubs", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "03629172-8caf-40cf-847b-93b12f93b5f7", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "60b3ae9d-e77a-46b2-9cdf-92fa87407969", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "L SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "aaa7d6b9-acc0-49f6-bb2e-d41b45980650", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.128 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "68628f65-110b-40ed-9ded-1c724de31696", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.71 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1c995ee7-e5a5-4cea-bc7b-473d436a6f7b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "dfddbb55-b36b-42ce-902a-5622584e548c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9ac8c8b4-69c5-4103-9f43-5c86ef1986b8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.464 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b925488d-a109-4294-9d73-6f359f61ba5b", + "MeterName": "Standard S2 Secondary Database Days", + "MeterRates": { + "0": 1.81 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "149e175b-7ec7-4c7d-8ddd-68f0240e1884", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.706 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a1d12714-8dce-4a5a-b3f5-4c62036d2b74", + "MeterName": "Premium P2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 33.0 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1faac307-99a5-4baf-9af2-b073292ac89f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.632 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fbfb1ce7-4723-4e98-9d6f-68400d9d5611", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.129 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "82146033-26e1-4269-a393-7d1fb1e3dfb6", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A10 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0f8dbe2a-21a3-42fa-8ae5-fb51ba7f4a6c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "9ed09a51-dc57-40e3-8951-d63327295380", + "MeterName": "MSFT Peering Metered Data 500 Mbps", + "MeterRates": { + "0": 290.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2ba244a7-727d-4287-85a4-d38b704c8114", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.52 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f7c90308-4da6-4bd6-84da-0228b485bfe2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.89 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A10 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4dc09ffb-fa71-4223-98f7-03b2461d569e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.125 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 5.0, + "MeterCategory": "Networking", + "MeterId": "fe167397-a38d-43c3-9bb3-8e2907e56a41", + "MeterName": "Data Transfer Out (GB)", + "MeterRates": { + "0": 0.138 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "634389ad-e60d-4d4d-a9ca-38cd74f69f26", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "631dcf36-ec32-4309-9b2b-8874c991dd94", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.297 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "6196d4b3-8056-4d9c-bf78-3793461a8fbb", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.0047 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10K Operations" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9d9b2196-19eb-4d4c-a260-9fb424c026a8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.122 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "180c1a0a-b0a5-4de3-a032-f92925a4bf90", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SLES (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "4fc327d2-f962-4beb-9f21-ab3234509a54", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.011 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "243ff232-d876-4ab5-b953-ba59f171ccc8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.163 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d83b9e75-6108-44c6-a7aa-1536af74a720", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.891 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c8ed793e-8dd7-4c18-9d4b-d1398dbec48a", + "MeterName": "Standard S3 Search Hour", + "MeterRates": { + "0": 2.956 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "11278850-f161-4a6e-86ef-d650a29fb62f", + "MeterName": "Standard IO - Page Blob Write Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "10192ffe-382f-4695-bbd5-fa4024be43e4", + "MeterName": "Premium P4 Database Days", + "MeterRates": { + "0": 62.4 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6fe73cf3-5ef3-435a-b3be-82e7d9983499", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4bdbdfd4-7163-4e7f-be56-d0a3cbe4eb96", + "MeterName": "Premium P15 Secondary Active Geo Database Days", + "MeterRates": { + "0": 645.16 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "764121ff-8cb2-4278-8a57-1d6ed8ac3e23", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.198 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2a3f83a3-5505-4647-876c-ccce4628ed7c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "bfda4742-c304-46d5-a6e1-248cc10767bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.768 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "b2cc5210-7ffa-41f0-9525-bdd47947ece2", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "04988c17-fbbf-4aec-afd0-29b020e7cea4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.386 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ec877d02-e97e-41ca-ac02-56d733eac098", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.65 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "G5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b24017a6-c177-4280-8306-0d4e320b8a78", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.276 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "32b320b0-eb93-4487-a81e-2f885bc2391a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.615 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "78304818-717c-476f-8e29-bcc6b9a43273", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "37bb729e-2ae2-4195-b13a-275a5131b197", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise and Weblogic Server Enterprise (2 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "e560f389-ee78-4704-b336-39a19f46c2a2", + "MeterName": "Premium Unlimited Data - 1 Gbps", + "MeterRates": { + "0": 10150.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "1f68c2e0-76e5-4d27-a12e-99a5be9a9aaa", + "MeterName": "Basic Large App Service Hours", + "MeterRates": { + "0": 0.34 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b963aed7-0fbe-46f2-9e6c-24bd975b6bc0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "392dcf2a-b424-4ccb-a0a6-5da6843e4152", + "MeterName": "Basic Large App Service Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "66fe442d-3ec3-4bf3-89d5-943124d4aeb3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "382d35d5-27f9-41f4-83dd-c8057387f31f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.158 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4b3dee13-e854-400e-bf8b-d85215487c41", + "MeterName": "Standard S0 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.5323 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b26e25f3-b970-4e68-aa8e-cca97a646005", + "MeterName": "Standard Elastic DTU Pack", + "MeterRates": { + "0": 0.087 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cf53500c-dc47-4772-a8f4-faf69566f6f3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.32 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4549f2e0-b433-4f94-b73a-3cfa77d950a0", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.134 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "fe7f12a1-1945-4132-b339-b8c03336753a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.202 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "07273c13-0b43-4aff-8f6d-9c35b5ab84c7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d1e40041-22fd-4815-86e2-f067dace7a59", + "MeterName": "Standard IO - Page Blob Read Operation Units - Free (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f4b954d8-bbd7-4f99-ad62-f14f106bae4b", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "db34174d-62aa-456a-b7c3-d3872aaa389c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "54c6bbf3-322b-406d-8411-101bc4b9443a", + "MeterName": "Standard S1 Database Days", + "MeterRates": { + "0": 0.9677 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0073dcb5-c9d8-416c-aea6-919a52badac4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e84b8971-c5cf-4da9-be6b-ad923445afb5", + "MeterName": "Core Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight R-Server Surcharge", + "MeterTags": [], + "Unit": "Core Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "10e5ee74-8fd6-4972-909f-65a83f92f0ce", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "c1fa2cdf-a2fb-4801-9224-67840621eeeb", + "MeterName": "HP1 Gateway Hours", + "MeterRates": { + "0": 0.49 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Virtual Network", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9445fceb-3ac5-4ab8-9fb4-4dca5f2f058c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.816 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ba3ef55d-e757-440e-b83f-7a8493c13ee7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.798 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "80a8965b-d659-4c4c-9514-a5963386e26b", + "MeterName": "Standard Small App Service Hours", + "MeterRates": { + "0": 0.106 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "943e338a-003d-408e-838a-1998caf3f163", + "MeterName": "Premium Unlimited Data - 5 Gbps", + "MeterRates": { + "0": 28650.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0aa4df8e-0496-497a-b1b1-6bf1c17324a4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.292 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "0ba80ebc-df6b-485b-9c12-131969e84524", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3456 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "333f45c9-207a-471c-ba6f-4200ae8214a9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "54ef6a12-60c1-4248-878f-1d3d9da46833", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.041 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ebf7cc26-6b9a-41d3-8768-d890fe566e00", + "MeterName": "Premium P1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 16.94 + }, + "MeterRegion": "JA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7587fb8a-4434-4700-aaea-f51b24991de7", + "MeterName": "Premium P2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 33.0 + }, + "MeterRegion": "AU East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "48dc3acf-ab2d-4360-8405-1717c6916108", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9611d0a7-e5d6-49d7-8800-77472ef4a492", + "MeterName": "Standard S3 Secondary Database Days", + "MeterRates": { + "0": 4.536 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a18b058f-def2-4920-a23f-d39488e402fe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "dc9208fc-ebf9-4845-a862-172cca61c010", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "XS Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "3e3585a6-bb6d-401f-b9bf-973ca29607ac", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d4758477-e269-4d29-9098-9b121ea6bb3e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.192 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "166119a4-ca96-47b4-add8-3fe0963b8518", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.142 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Insight and Analytics", + "MeterId": "a4e29a95-5b4c-408b-80e3-113f9410566e", + "MeterName": "Paid Nodes (Node)", + "MeterRates": { + "0": 15.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "OMS Insight and Analytics", + "MeterTags": [], + "Unit": "1 Node" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ab3049b4-0a43-46e3-9b2c-a37ac14785d8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.559 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c0b9bcd8-8dcf-47e7-8f49-78e1a4052efa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.147 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "08b5a298-725e-4857-8693-db6e76bcfef5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 10.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Enterprise (20 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f303a21a-05f1-4563-b2ad-7523eebc4058", + "MeterName": "Standard S2 Database Days", + "MeterRates": { + "0": 2.42 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cf79d57f-a665-44a7-a759-00e2938a1e7a", + "MeterName": "Standard S4 Secondary Database Days", + "MeterRates": { + "0": 7.5484 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "28722468-eae4-4c36-9459-5453244362c1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.665 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "aa23554d-5637-40df-99ba-6199badd1ff7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.486 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "8b6d2696-456c-41e1-a09e-73efeb109a63", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7b3fd390-3a9d-419e-b19d-a75199b7c9d7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.255 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "G3 SQL Server DW VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5e02b0bc-21e5-410c-ac8f-e7c37e12e98d", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.22 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "9b25ee17-78ef-44dc-9d0e-43ee6f3ca17c", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "13274838-f91b-449d-9d55-6a9a6b5b92ad", + "MeterName": "Metered Data - 5 Gbps", + "MeterRates": { + "0": 2180.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "6b03850c-ae44-4ad4-b942-1cc856f278a7", + "MeterName": "Basic Large Azure App Service Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "42923449-6550-4ebb-b79c-98785cf55b0a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.134 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e400bd85-62c1-4008-8447-7d217dbf31a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.313 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "757d2cbf-578c-4560-8d2b-5ddb262e179f", + "MeterName": "Premium P11 Database Days", + "MeterRates": { + "0": 250.0 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "d388d280-f5f3-4af6-b945-b84b2c8eee53", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8ab419c9-b30c-4dff-8f6b-a28e18dbd14e", + "MeterName": "Basic Database Days", + "MeterRates": { + "0": 0.1674 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "5c2aad26-7d6a-4422-b399-c56d8530c923", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8788528e-5f5d-44c0-9838-a912dd3cfa64", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0671 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "1fb98075-ab1b-4aaf-a70f-030c435f2cef", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f8cc8e26-97d3-468e-a156-ee9f80e395c0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8de34d2b-d93c-4a10-9c21-5e9308001143", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Zone Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1891cbcb-3061-46c5-b831-7dfc0b5ae5b4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.996 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "1e15b985-52dc-4c4f-b2b3-49a1f850adf5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.385 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3f353f1e-e470-4a17-8cb5-63c336fafa46", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.281 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e7c714d8-1575-4442-b476-5a3bfb7a95a2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.258 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9387a505-a130-4481-a688-7323ac34cf28", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.191 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f96bf734-0afa-4777-b64c-a8bdf33524d4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.176 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "03146d09-fc2a-43b7-8488-c8bc60967619", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise (8 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3a6a3048-9ac0-4069-9ff9-f1c2056c8194", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.2512 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0c850c89-8632-4c4d-a81a-306185a1f54f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f3e734c0-bd1a-46cc-bcb2-8b25fb6464ed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.78 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a9d1a21f-b52e-42c8-8e07-082d2931fbaf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.062 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "219c2d13-b9e3-4f5f-b042-0c0cf8fbee4b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.44 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f941300d-785f-42a3-9ab6-b33da842ad53", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "015c573c-865b-45e2-96b1-05ecfee8946b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.191 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f0ff652b-892b-458f-b945-c252377a33d0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.742 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16mr Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b3a9cd8b-f48b-4c83-83c7-85c830abd94a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "RemoteApp", + "MeterId": "14db424e-e05d-48a5-a2aa-2e39230c6fd4", + "MeterName": "Standard Users", + "MeterRates": { + "0": 15.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Named User", + "MeterTags": [], + "Unit": "Users" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e1422cce-8e82-44f7-8a10-78a04d55f158", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.74 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "dc766448-422a-43cf-9fd6-00e5e9007159", + "MeterName": "Basic Elastic DTU Pack", + "MeterRates": { + "0": 0.0581 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "015d491e-bfb1-481d-8fc4-bfaf9ce737f1", + "MeterName": "Unlimited Data - 50 Mbps", + "MeterRates": { + "0": 610.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a3ce4838-6f58-435e-bb04-8f9bf8e79d03", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.425 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "G4 SQL Server DW VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c5647410-2402-4109-b178-7d0f56207b71", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "20f1b323-0950-4527-b4f3-d77e2b7aca16", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A8 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "56ac24bc-5a56-4331-84b5-2297354ca41c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.264 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "0bd3e772-c3ce-4d0b-a6db-210190c18a4f", + "MeterName": "Metered Data - 10 Gbps", + "MeterRates": { + "0": 5000.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a79da633-6978-4e1b-9f32-c99581129746", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.55 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "db394620-d69c-4ba6-b402-88108a27a4ae", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "2c1f4f60-f147-4b64-942c-dab273f98e80", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A10 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "ef7c4307-326e-4905-af37-6e694c1574b3", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5da710e0-516b-4a5d-9be1-1c56c7897c78", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.52 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "abc3680a-1dfa-4397-83d7-6120fa044a62", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "09b83c38-1b21-4a90-bf0c-141ea61ad31e", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "30cd0f6d-9e46-47ee-a67e-84fa3e6db9cd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "966ffa85-0757-44eb-b198-04281e317525", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.183 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3073fb71-c919-4f50-ba21-43df907d0606", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.673 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0883795a-0ef6-40a1-bbe6-a201246ee4e5", + "MeterName": "Basic Database Days", + "MeterRates": { + "0": 0.1841 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "15e3cdab-e44d-4758-8429-95d06d2dd108", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f8e0cd6f-76e3-4364-80d7-1723b4b090b7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.352 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "45c9240e-43e1-4abb-8b6c-f37296c36687", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.107 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "8303edd8-7a66-4bc6-aef2-89f46925316c", + "MeterName": "Standard IO - Disk Write Operation Units - Free (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "9d796645-ffe8-4778-b384-cbd5ebd48222", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.1252 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "a05f8b31-228c-4826-862c-6cdb578784a3", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "362e5fdf-eb3c-46b7-89c7-32bbf3828f60", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.408 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "b7aeadbf-3cd2-4dfc-ac6d-afc44a8524a7", + "MeterName": "Standard S2 (Units)", + "MeterRates": { + "0": 50.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Speller APIs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Insight and Analytics", + "MeterId": "df358314-e5e3-4230-9258-86b5850ef495", + "MeterName": "Overage per Node (GB)", + "MeterRates": { + "0": 2.3 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "OMS Insight and Security Data", + "MeterTags": [], + "Unit": "1 GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f74a555b-a7fd-43f8-bfd9-e9b03106a5a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.068 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "20c9c6ca-43e5-4487-b43c-9e06b302461b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.187 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3671905c-0d8a-43fe-934e-5111bb3f2354", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b741411f-b23b-49ee-aac6-5ada452af6cc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a3cbc206-a0a6-4d02-94b3-5b41cd9ab200", + "MeterName": "Basic Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.1771 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "75e74d58-f259-4821-85e6-d5861f663a10", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 163.548 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0377be69-4b0d-40a5-b3b7-4a67f0ef62e4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.233 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "84969491-ca1a-4413-82c6-8b35ee5852b6", + "MeterName": "Standard S0 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.4839 + }, + "MeterRegion": "JA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "50088234-abcb-41a1-aa2c-9ec7a49d7adc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.897 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c2c57b4b-3b6d-4219-b3d9-6ac445d2eae0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.69 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "e9230107-4ab6-4141-b4ff-0dc8eed70178", + "MeterName": "MSFT Peering Metered Data 2 Gbps", + "MeterRates": { + "0": 872.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1a14ea5b-c4ea-4de2-a663-74e55e3f7818", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.56 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "db86ac86-db22-48a4-8385-cad776727575", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.081 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7af2bc0b-9b64-41e9-92c9-a6f7f921873c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.75 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "G2 SQL Server DW VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "25cd7f37-50c4-4c7a-8db7-f5ddcadfe240", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.185 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "251dff4d-3a98-4147-a6e4-503c4164b8d2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.404 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "04f46858-e485-41a4-84a8-dbcb4f80f8c6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.52 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5521fd84-3230-47f3-8247-4e7b8ea00faf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a39864f6-3e0d-4637-86bb-1e53251ecef9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.067 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "391d4fb3-98bd-45c1-a81e-13d17fb0587a", + "MeterName": "Data Transfer Out - Metered Data (GB)", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "de59f888-758c-4bf2-9e5f-d8c254a7d16a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.7 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "9c651cab-7d79-44ca-a7ed-2774beaa555a", + "MeterName": "Free", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Analytics", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ec40c4c2-c5db-4c7c-991f-41d31d8f2bf9", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b3da8307-0d4c-4935-9b3a-1cb48d9fc43a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.059 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "13268250-7429-4443-9e83-cb802bf8e136", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.043 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0aae2541-5b38-4b15-9334-f9cbd11f0912", + "MeterName": "Premium Storage - Page Blob/P6 (Units)", + "MeterRates": { + "0": 10.2081 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f104144a-498f-49e4-a431-06fbbc2019f8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.19 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "698457d6-f367-4cb7-8d67-0529485048a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.129 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "722926b4-ea0c-40d3-837b-12d8a2d49930", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.58 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "85a9c337-9ef1-4885-b343-947e942ca0fc", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "ae184e1f-aa21-4387-a46f-3d1cce8dad57", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "471e3bd7-d8e0-452c-821f-107ad7c13bbb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c8a25804-f50c-4cac-908e-d6783eac4617", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.1045 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "d4b029f8-2352-4670-ac8e-ec078103a244", + "MeterName": "Standard S3 (Units)", + "MeterRates": { + "0": 450.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Speller APIs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6b23937f-c9b5-409e-9324-7b4b6aeafba9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.771 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "82d4564e-133d-4699-b0b9-81f82a8f27ec", + "MeterName": "Language Understanding APIs (in 1,000s)", + "MeterRates": { + "0": 0.75 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1,000s" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5f9d4381-d6b7-47cd-be01-309ba68275c4", + "MeterName": "Standard S3 Search Hour", + "MeterRates": { + "0": 3.552 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "fb2898b2-6ce6-46e3-9ede-4e82ba465fb8", + "MeterName": "Free", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Recommendations", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "681813ea-a3a4-44fa-82a4-902588427fd8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9cf4c8c6-a1d8-42cc-956c-86cd71eca089", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "991b1e89-77fd-48a4-a6d6-b8484b9f5a6b", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "420fa5a1-99a9-4d8d-87db-2d6663f96343", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.343 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c6067198-1a09-4382-8607-a750ad29560f", + "MeterName": "DWU", + "MeterRates": { + "0": 1.8146 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "562d12a5-08f8-4199-adbd-39ee82375333", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.047 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1e5de507-c021-4bec-abd2-ac68060929c6", + "MeterName": "Premium P6 Secondary Active Geo Database Days", + "MeterRates": { + "0": 132.0 + }, + "MeterRegion": "AU East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "fd0c4484-f366-48f3-8ae0-7b338b1cc278", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ef8d62df-264f-48d8-aad5-8640497152b6", + "MeterName": "Standard S1 Search Hour", + "MeterRates": { + "0": 0.444 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d888363b-b962-4d9a-a948-32b849f316b6", + "MeterName": "Premium Metered Data - 2 Gbps", + "MeterRates": { + "0": 3122.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "afe173cb-c4ea-46bd-81c5-d856d11993ae", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.306 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8e5e00c9-82cb-4e20-b7f7-fbebb4b6dfbb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.342 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c3a82c70-2ad9-4901-9492-d82ec03cf21d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.551 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "da9743df-c38c-448b-928a-0596503926c5", + "MeterName": "MSFT Peering Metered Data 100 Mbps", + "MeterRates": { + "0": 110.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "357eb6d1-d528-44fb-bcc2-ec2281db1db9", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0e02ab98-dbe9-45f6-987f-b8283aafaa30", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "9a8df657-2b2b-4326-b9e0-00af990b0141", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.708 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "b00ea85f-530d-40c9-8ce5-847dabe777a4", + "MeterName": "Premium P2 (Hours)", + "MeterRates": { + "0": 1.388 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "8ff01f8c-c2ce-4c2a-bf43-201a13d22945", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.34 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3e7fc27f-95cc-452f-a3f7-4d182019eefd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "b1e41f68-4bfb-4a85-8e55-bb509aa07791", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f9cd05ec-dccb-4c1f-b8bc-65d1e71ac77c", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "74a43f0f-34d7-4341-9a38-4b814feac136", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.047 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "9377beba-f5b6-4baa-a085-0297220dec00", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.692 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "32b21f42-4d6f-4e88-acb0-1657cabc51c3", + "MeterName": "Spell Check APIs (in 1,000s)", + "MeterRates": { + "0": 0.8 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1,000s" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "b4d1c760-640f-45ca-8815-5201f6e1a70d", + "MeterName": "Shared App Service Hours", + "MeterRates": { + "0": 0.0136 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f8e62c07-a49b-4789-ba6f-84fdd5904491", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.206 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "20994b3b-bc8f-4dd9-a30c-bec3b71516fe", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a4726471-1b49-42f6-aa13-c69fe7e605ea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "40db34c2-6817-457a-b33b-3fb2b5a2d4bc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.367 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bb2ceb60-7694-47ca-8297-ddfbf9f98e05", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.117 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "481eb91e-ddea-421a-81f5-ad3d99798232", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.242 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2bbe2140-2764-45af-ba6a-7c34824b6182", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.971 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "77c7367d-d710-45f3-a4a2-729fcd66e3be", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 10.1568 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a71fb7b5-ef9d-41a6-9032-d1d7e95bbc40", + "MeterName": "Standard S4 Database Days", + "MeterRates": { + "0": 11.6129 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "533dc2ae-140e-42df-8d8c-785057716db2", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.125 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "629194b4-db61-4a55-ad90-c65894f69715", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0ca65088-b8e3-43e2-b89c-344c2e9d4c0a", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "863a361a-ae37-4cc7-a111-fc3ac23c9ccc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "fbd377b9-eb02-4b4e-9da4-302fac870ebd", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.031 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "68637dc8-25d6-4a9f-ad61-0e6233b9ad24", + "MeterName": "Basic Elastic DTU Pack", + "MeterRates": { + "0": 0.0588 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6f6f549d-5a0a-45d2-b122-530967cfa73c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "438ea1b4-f661-4132-b857-90f10d9ab8b4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.684 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "019046e3-1be3-4b63-b8da-ca3987127c38", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.917 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c9c6cf62-8b9e-4c77-b31c-1cf9236609c5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.5 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "94f38974-9279-49f2-992a-f05176ffc1c8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.058 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "a68b7c67-c7da-4f84-9a5d-52568d253684", + "MeterName": "Standard Computer Vision API (1000s)", + "MeterRates": { + "0": 1.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "1K Transactions" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ce32fcc5-66f2-483f-8b9c-816395f63ba1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.802 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4d590ea2-c98b-4f55-8282-76333a5303d4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.495 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8878d5d2-6b98-435c-b91b-7e079c649123", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.542 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "30ab1dae-8172-4b24-aa5b-3666d3f0fde1", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "db38ea22-8395-4dbd-96af-4ea6d0330128", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f21bc78c-3ad6-4cce-a34c-1845a8e7d9a5", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 84.2 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a329232f-c89b-433f-abba-2fc810762aaf", + "MeterName": "Standard S3 Search Hour", + "MeterRates": { + "0": 2.688 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "03bd7742-b66a-47ce-bde4-2b0c37334ca4", + "MeterName": "Premium P15 Secondary Geo Database Days", + "MeterRates": { + "0": 470.464 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c0fa7610-3405-42da-93df-c34c8e350be8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f45bb57d-d696-4148-9727-02bdf14ee397", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.025 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d5fdad69-c9d0-49f0-8db8-b51f68595b24", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.056 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "71164b2b-6eb4-4ce9-af84-9f5b9067f66c", + "MeterName": "Standard S3 Database Days", + "MeterRates": { + "0": 5.8806 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "89832013-beee-46c8-bec0-0ade009afd4d", + "MeterName": "Premium P1 Secondary Geo Database Days", + "MeterRates": { + "0": 13.61 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2a31de90-0d6c-4ee1-bdaf-65398e98bf1c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6d3cfada-a09a-482c-a927-5f2b21edd2f3", + "MeterName": "Transactions (in 1,000,000s)", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Store", + "MeterTags": [], + "Unit": "1,000,000s" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9d5e072d-3a9c-4e42-a38f-2ab1091636db", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.926 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "93dbc90a-fa3d-4128-8950-0b28437be121", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.191 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "08caf470-a419-4e61-a379-48d684559bf3", + "MeterName": "Standard S0 Secondary Database Days", + "MeterRates": { + "0": 0.44 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e0ec387b-5c15-420f-ab57-5556ecc8a319", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.016 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "05e50686-36c1-41ea-8537-75d4da79067c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.861 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16mr VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c93b3016-1dfe-4347-a67c-1bc6a1ffcd36", + "MeterName": "Standard S1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.9677 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "e496f65a-d0a4-4ff9-b5ae-e89170d61a01", + "MeterName": "Premium Unlimited Data - 50 Mbps", + "MeterRates": { + "0": 375.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "1b841068-c475-4486-bb3e-c0151722d6aa", + "MeterName": "Standard SSL Certificate - 1 Year", + "MeterRates": { + "0": 69.99 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Certificates" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "12263426-0c92-4d0d-8368-69cbc669c7e4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.398 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "951b2a0e-1a0b-488c-b20a-b4254edba928", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "1444f89b-6017-465b-a5a9-4e54b4155a00", + "MeterName": "IO Unit Hours", + "MeterRates": { + "0": 0.0075 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Store", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "627355f7-5c0b-40d0-8620-fc4e81f9f64b", + "MeterName": "Standard S4 Secondary Database Days", + "MeterRates": { + "0": 8.3032 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "58424b4e-d306-49d3-9938-607e93d001cb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.584 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e91454fa-ef4b-4360-9382-7b8f96001f30", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.744 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d4240cf8-c48e-401a-be29-65e4f195fdd9", + "MeterName": "Premium P11 Secondary Geo Database Days", + "MeterRates": { + "0": 176.13 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f6aafe92-51ae-4e3b-af93-7aa0eeca7e1a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.178 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "963c3ab9-5ff4-4e09-937d-b5b1e06df793", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.52 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "82e580a0-f4ea-46b9-bffa-afba2681923a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.954 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "36216e45-b7d8-42f2-9a52-241e8eb1129d", + "MeterName": "Premium P2 Secondary Geo Database Days", + "MeterRates": { + "0": 24.74 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "515c0fd0-e2e9-4865-acbc-e13bac953ef2", + "MeterName": "Premium P2 Secondary Geo Database Days", + "MeterRates": { + "0": 27.0 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "b6f6c71e-4321-47ff-bcf2-dda2a8dc2654", + "MeterName": "Metered Data - 500 Mbps", + "MeterRates": { + "0": 290.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9e670c6c-5846-4b24-837a-59cc363ba607", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.592 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5d41af6c-f137-4f8e-9a2d-d1d715aff55e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.222 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c4e200af-c022-48cd-8164-3e9b7693565b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 7.82 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "54da788c-4da6-413c-9ed6-c6e472a8610b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.96 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Standard (8 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3ab1147b-1075-4566-8f01-6f7001bddc7d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.371 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f531c06a-c2aa-4d9a-87e4-b0ee5219128c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6c906e01-c692-4cd5-9bf3-bd2fab31b3ab", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.075 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5ff4bee9-762a-4613-a25c-bc45685e1701", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6decd9c0-f04d-47ab-bdf5-57ea8e352d62", + "MeterName": "Premium P2 Secondary Geo Database Days", + "MeterRates": { + "0": 27.23 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "72fb063c-631e-4256-8543-7fa0bde227d9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.31 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "23b7514c-47a4-4271-abca-2fd9e4fd9405", + "MeterName": "Premium P1 (Hours)", + "MeterRates": { + "0": 0.694 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8e2b9efd-6226-4b17-9325-97788b5fa0bb", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.0671 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4478cc63-ca72-4ff7-907d-6a2b47962e75", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "d4af2942-f317-4584-8b2b-b2717f8f6579", + "MeterName": "Premium P3 (Hours)", + "MeterRates": { + "0": 2.663 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c6936549-1eeb-4b49-ace5-d00f3b517135", + "MeterName": "Premium P11 Database Days", + "MeterRates": { + "0": 270.97 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a88483d9-22a1-4957-ba20-45286b69ef2b", + "MeterName": "Standard S0 Secondary Database Days", + "MeterRates": { + "0": 0.456 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "6eace005-7b3c-4846-aeef-84f21b5ca32e", + "MeterName": "Metered Data - 200 Mbps", + "MeterRates": { + "0": 145.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6e9d5775-c707-403e-9027-1ddd34eeaeb6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "6b5329c6-86e7-45cd-b49f-c34239697bb8", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3ba1d4e6-64f5-44b8-bc83-98adfb729524", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.773 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "89c1b157-7ea3-475d-867f-f04e498a5620", + "MeterName": "Metered Data - 1 Gbps", + "MeterRates": { + "0": 436.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7056fbc8-1b29-4036-bf00-17a2c7d20e57", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10K Operations" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "28a25776-3295-4ede-a0a0-c60026589b46", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.159 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8f89de2d-5e65-4560-8d94-208ad84b4881", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Standard (20 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "60ef9d65-2ae9-4e25-b08a-5eaa7fd924d5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.76 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "55040bb3-35ab-4f8d-b85c-85fe84e5001c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.258 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "f93e0c84-948e-4eb7-8b2f-54593ab43964", + "MeterName": "Standard Medium App Service Hours", + "MeterRates": { + "0": 0.244 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a501ea5a-1873-439e-8a37-82e5429ee4e0", + "MeterName": "Standard S3 Secondary Active Geo Database Days", + "MeterRates": { + "0": 5.8064 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0518417e-e62c-4d34-9634-9ac7c0580f4b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e4ae82a2-f743-48a2-8315-adcdbb18eee6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.64 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "dd4f6bb8-03ff-4c57-95e7-e4859c888c80", + "MeterName": "Premium Extra Large App Service Hours", + "MeterRates": { + "0": 3.024 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "fc72e5cd-54e0-44c7-bf6e-85d6cf55bc50", + "MeterName": "MSFT Peering Metered Data 5 Gbps", + "MeterRates": { + "0": 2180.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "edd11046-ec5b-456a-81c3-7bfc6d9b5f4f", + "MeterName": "Premium Elastic Database Existence", + "MeterRates": { + "0": 0.4838 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "fe214bd3-e0b5-498f-85e0-f2f75b096fc0", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.031 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6df2fe2e-469d-4fb5-b925-fd0284993999", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.437 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "dbb918c6-1fa9-4f27-a5ef-8f65c59ca333", + "MeterName": "Relay Hours (in 100s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "100s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a634fbaf-539e-41e8-b961-4286a20d0aea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0c09fcd6-88ce-4ccf-8297-36b5ba060854", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.81 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "87266122-5059-4244-bc57-f1a17d25227f", + "MeterName": "Premium Small App Service Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "11dc0654-64fc-462b-ac12-54a2b6d2cd71", + "MeterName": "DWU", + "MeterRates": { + "0": 1.8146 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "81e9a0ba-2f06-4933-97aa-d8700c70d98f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.69 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "G2 SQL Server DW VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "60183ce5-4327-47ae-ae0f-3590c2920039", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "016284cd-2b47-4ba4-9f41-2b3b26ee7d6e", + "MeterName": "DWU", + "MeterRates": { + "0": 1.2097 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "fc4409fd-52ed-4ada-93b9-bf1bc3db67f0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "19a35a32-daa5-4f03-8feb-0151ed734a17", + "MeterName": "DWU", + "MeterRates": { + "0": 1.8146 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 400000.0, + "MeterCategory": "Functions", + "MeterId": "2a384075-01d7-4f66-a84a-0eed3ca58876", + "MeterName": "Compute Duration (in GB Seconds)", + "MeterRates": { + "0": 8e-06 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB Seconds" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "734b802a-0a4e-490c-98dd-a4ca285d835b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.8 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Standard (8 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8d2a1442-ebeb-42b2-b250-db4ef542a0fa", + "MeterName": "Premium P1 Database Days", + "MeterRates": { + "0": 18.75 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "cc7c7a41-fea2-42c6-83e9-3870205634f6", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.034 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1086cc44-ab49-4943-8525-b7a3c6392925", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bccfc944-5fe0-4427-ae26-ab8c2de410f8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.073 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8376d911-1e62-4896-a324-5290c8ce2f7c", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.034 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8405dbf3-ffda-4d3c-85e8-716ec6bd2fbf", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.015 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "57fdf439-b2b0-4eaa-9f8a-31a70ccdbf3f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.43 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "372ad328-1f3d-4f6e-a4c8-bb068ce7b900", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.0092 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fc074bcd-c679-4ae5-a7fd-2668ba169509", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.605 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d72ca4ba-8925-4d30-bbd9-ebbe0c917841", + "MeterName": "Basic Database Days", + "MeterRates": { + "0": 0.201 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "9cb0bde8-bc0d-468c-8423-a25fe06779d3", + "MeterName": "Standard IO - Table Write Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "98d93f1c-7f95-4620-a44d-5e851006452f", + "MeterName": "Premium P6 Secondary Active Geo Database Days", + "MeterRates": { + "0": 145.19 + }, + "MeterRegion": "BR South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1b426790-a4fd-462c-af92-8796ca8c419f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.228 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "56ae806b-665c-41c4-9773-f82d2b2c98ce", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 19.71 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "61f622cb-f30e-4ca0-aeff-41462944e704", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.743 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0d824549-9a8d-4204-a69f-833b9c587181", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.368 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "caa454d7-e42f-47c4-9e28-773bf7b739fb", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "291b2cbc-6c34-4e2b-a4e4-1ff8c106f672", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Red Hat Enterprise Linux (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "23581df3-94d7-4621-8507-b1c7cb4b6d27", + "MeterName": "Standard S3 Database Days", + "MeterRates": { + "0": 6.048 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "fed0286c-5505-4f37-b1ef-89edf04239ee", + "MeterName": "Standard S0 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.4839 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d223dd64-e471-418a-beca-eb63185da795", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.44 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f6d44310-cb84-4578-bef0-642ee0c75016", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.115 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e44fde77-75b3-40d4-9dd0-f14220b963ee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a4bfab03-a19d-4f19-b067-cb7411384d8c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0a4628b2-cf77-4f0a-b29e-9cfae4f71f6f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.306 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "55169dff-26e2-48e5-a57c-85104d82ca58", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.123 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3ae5288a-02b1-4d17-a73f-de110df5992b", + "MeterName": "Premium P1 Database Days", + "MeterRates": { + "0": 17.16 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "312ec9d2-3c50-4a0e-818d-9f5eafb1c7cb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.451 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "681920dd-a782-4ad1-9d44-1e37533d4081", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.402 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "456a33ee-39d0-4bea-adbc-707440398e67", + "MeterName": "Standard IO - Disk Write Operation Units - Free (in 10,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c08405d3-05f7-456d-a92f-19e23cc8ef95", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.067 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "31717765-af35-4dd3-8cb5-42071cc1ba8e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c98cd699-0e17-4174-989f-eccc7333ab77", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.59 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV6 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f03d38d8-8041-4410-828f-5d85b5a5ad36", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "26b919e5-59f1-4c90-937f-5d329fdeec84", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0732 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4a6a2258-2b7c-421f-a87a-1c9da19eac5d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.268 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2f86264f-ed38-41fe-be0e-bc42f8e5bd41", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.36 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "dec787a1-5d84-4432-b9db-e08a6657e9e8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.027 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16mr Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "ed45ae8d-a734-4d21-bc88-e5b54f9e903e", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.004 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ce3b9051-6362-4593-baca-0f5baef50983", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.699 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b2d3ed0d-64b0-4a41-8c5a-cb49dfbb84f9", + "MeterName": "Premium P2 Database Days", + "MeterRates": { + "0": 30.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e258c52c-75c7-464c-8674-66340a29d297", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b25416bb-76e8-43cd-9579-f29f09887ce2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.392 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "bdd780ef-52c8-42ce-9995-05637b030062", + "MeterName": "Premium P4 Secondary Active Geo Database Days", + "MeterRates": { + "0": 67.91 + }, + "MeterRegion": "JA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "003c2bb8-70a7-4e81-9ade-2fb8b5ba0487", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4d0833ba-44fb-4b4e-823d-403828abc33b", + "MeterName": "Premium P6 Secondary Geo Database Days", + "MeterRates": { + "0": 101.71 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "dcdfe574-d2d2-4b8b-8546-284f90c6cc3d", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0784 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "0ed56b26-586c-4679-ae45-119ff855fa0f", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A6 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e389df43-a2d4-421f-8791-7e59c5419a57", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 9.064 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8e8799f4-c494-4141-9308-e8f012a7b2c4", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 17.92 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "96c50999-57d3-47e2-b28b-63d758f84d22", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "4b2389e1-6ff5-4b14-a810-d29d722c0719", + "MeterName": "Standard Video Face Detection APIs (Minutes)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Content Minutes" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "39df9b84-10b8-47da-b32a-0095e17b224e", + "MeterName": "Premium P15 Secondary Geo Database Days", + "MeterRates": { + "0": 387.104 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6fdb58f8-2bdf-4468-b72f-771be1862539", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.467 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "69472fd2-67c1-471f-9324-6f4961cd392e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.57 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16m VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "93a5b34a-1146-40eb-b4cf-c9132d7fc31b", + "MeterName": "Standard S2 Overage (in 1,000s)", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Analytics", + "MeterTags": [], + "Unit": "1,000 Transactions" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4018a121-f1c4-4405-aa40-a59df52080ab", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.48 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "fbd4e133-ec4f-478f-bf52-f04c6e0d7195", + "MeterName": "Basic C1 (Hours)", + "MeterRates": { + "0": 0.069 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6308d3fc-bf11-433e-804a-76494245714a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.054 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "47cd02af-fcf7-4007-a773-fef174ceee77", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.743 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dd274564-0f9e-49a7-964b-31dca4919115", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.524 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "81f02e66-386e-4877-bd67-40b66aa53580", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "eb07634d-10a5-4f2c-8e88-46303321465a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.933 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4dca4ee9-9223-4a93-aa7a-b8d63c4cce91", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.323 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "e5908969-8f7f-489d-8e1c-44dabfdd0d7c", + "MeterName": "Unlimited Data - 2 Gbps", + "MeterRates": { + "0": 17400.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "1e25650b-c0ce-4143-ab65-bba733dce381", + "MeterName": "Standard Small App Service Hours", + "MeterRates": { + "0": 0.126 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ae37db55-3cd6-419e-b490-225015348ef3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c1c58d57-f4eb-46aa-832d-e24c0d712d0d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.624 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "abf7d235-6045-4f02-802a-acbad7418578", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a564b5f6-3d29-48fc-a13d-da081e506714", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "20b839f3-ccb3-40e2-8e31-4264a4068560", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.549 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "31cecc81-9662-4beb-a81e-2b72a712d1c8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.226 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f45dc700-e58d-4b6f-aa2f-35f77d9180d3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.415 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "78de3d06-0948-4d71-8a80-447b010e4dd8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "1ff8223e-a66e-4d66-9a57-f6c5b84c8828", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8dda06af-95ac-4ecf-a7ce-d9ffe046a518", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.928 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8adbecba-6230-4c52-b6cd-b843211af131", + "MeterName": "Premium P1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 16.94 + }, + "MeterRegion": "JA West", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f5552671-e2c3-468f-8801-d7f1d2041aed", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.47 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "add38ca4-3402-4f5f-af24-fb2ef31fe6fc", + "MeterName": "Standard S1 Secondary Database Days", + "MeterRates": { + "0": 0.913 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0dbf9156-f6ad-4935-97bb-f9ea9b52d171", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.393 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c60db0cb-11f8-432b-b410-3902cc8d8536", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "b4412aec-427e-43d1-a7e4-a3b42a688750", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "572eeca7-16b5-4b8e-89b9-7b012ca0beeb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "aaa1f4d6-28c0-43f1-a499-3dd4e4c3eb46", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.567 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "0c873ca2-4113-4997-8cf6-ad5df5775599", + "MeterName": "Basic Search Hour", + "MeterRates": { + "0": 0.101 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "3bec1178-9944-4e69-a543-72ebb78f38c3", + "MeterName": "Unlimited Data - 50 Mbps", + "MeterRates": { + "0": 300.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "064d1cc9-01af-46ff-a382-6ff1520b78a2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.064 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7211f3f7-931d-489a-bfa7-a8cdf8954f3a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.17 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "1703498d-2b7b-48bf-84e6-d47462f5c21b", + "MeterName": "Standard S3 Search Hour", + "MeterRates": { + "0": 3.552 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f62fafc1-3b22-4d08-9765-15bd45bab87d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1dd468b5-cac3-4d96-9b28-701adf1853dc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.84 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Standard (32 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "ace30b39-5349-4478-a583-24001b1d38ea", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e0ab81ca-9767-4c18-a338-2f982b1637cd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.675 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9bb81ad6-5ef5-4ad6-a9cd-1dada0d53702", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.402 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "bfd75a78-3acb-422b-a4c6-17a0503aee14", + "MeterName": "Standard S1 (Units)", + "MeterRates": { + "0": 3.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Bing Search APIs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3678953a-ef42-4b8f-8687-8de1c4225c0b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.197 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "14efde27-264a-44d2-a15c-8bd2cdb73481", + "MeterName": "Basic Database Days", + "MeterRates": { + "0": 0.1771 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b3922ce6-b68c-4956-a29e-4f1b2209db09", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.402 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4ca5e77d-c176-4a37-b3a4-6f4046518c7b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.7 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f00ea971-6ace-4974-b79d-fe1bb7bf2314", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 135.168 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "f90f81d2-238a-49d0-9f1b-9df13a859843", + "MeterName": "Standard IO - File Write Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.015 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0cccb09d-c7fd-4614-9f96-d4544f58ba42", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 66.56 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2ae2f461-4d59-4639-bec3-e464cbe59e7e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.146 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "39b0ec90-10a0-4fe1-a52b-d9d04dd9d38c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.768 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "66f96a20-4f85-41fb-9c70-74ece7663b39", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "49523413-e2be-4a74-9d79-6b28fe89d5da", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.854 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "6fea3a48-e38e-4857-bf37-40d4b70621f5", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3584 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "e3bf3e5b-d9bc-4148-b735-51ae4375c06c", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d5137365-8535-434f-83a2-4af109e91e60", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dd9b61fc-5d11-434b-a9fa-e245b2351d33", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "89f20818-e778-4bab-ba31-b7e3e7f196fa", + "MeterName": "Standard S1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 1.0645 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "580821c7-79b7-48d0-b44f-3f5398418af2", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.025 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "145e6045-1c39-4a55-bc44-325b20bf8e65", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.966 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d8eabad1-acdd-4b64-b593-8ffc9751017a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.21 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ba5d362f-a5f4-44bd-8842-7467c263ba1b", + "MeterName": "Premium P11 Secondary Active Geo Database Days", + "MeterRates": { + "0": 248.39 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b492a3c1-fa75-4eba-a34d-a9f4c9e7b1ba", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.744 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "160ec60c-d0f9-4baa-a663-b70ab6b832fd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 8.69 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2cc7d467-9f2f-4654-a9b2-29d3aeb64e2b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "494e1103-2c70-46a9-906c-080715e95299", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f8e353d0-10ff-4b12-9df4-fa53d7c7ca69", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.902 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "1ae54f83-7a36-4104-8c29-f4054900a96e", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "5bbb9ba2-e2fc-43e5-aa23-d225cddb338d", + "MeterName": "Standard Small App Service Hours", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "b2048190-2afb-43a5-b5f4-af7a885396c1", + "MeterName": "Standard IO - File Write Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8335ab4d-e225-4509-9990-ee6bfd893e63", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.741 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "f556bec2-a286-4171-bbf5-4fddaaafef99", + "MeterName": "Premium Metered Data - 5 Gbps", + "MeterRates": { + "0": 5180.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "21676e32-89e7-44e5-a4ce-43eb4caea6b8", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.016 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "4ba8a96a-24b1-431b-b16f-374f983c08ca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.684 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dbafbdfb-9e61-4cdc-afa7-90fc6e296ecd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.187 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "d4f972f8-636c-4fa4-96dd-67d78ec1ff18", + "MeterName": "Premium P13 Secondary Geo Database Days", + "MeterRates": { + "0": 276.78 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6eaf9150-cee9-4835-9c85-b1f9094ee397", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.486 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "2cf4341c-5363-4026-8ed4-d1ddaa0a8276", + "MeterName": "Standard IO - Hot Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.0044 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dd6ed7ae-3dd7-4e12-b9c3-10507b8d7e91", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.15576 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "eb990e94-da32-4e43-8907-37e8108279b5", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 135.17 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a44644a2-a649-4bbe-b6b8-fd7cfb7eacf9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0f521674-5ebd-4679-bd97-8bc2ac4a9040", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c2827b48-09b6-4490-a2c3-190a3197e453", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3579e013-6f8f-447e-bd2f-4b4cecef5917", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-23T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Notification Hubs", + "MeterId": "f6bdc96f-65a3-41c7-913b-34b518bff0ff", + "MeterName": "Base Unit", + "MeterRates": { + "0": 10.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Notification Hubs", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1852ff0f-fd73-4683-8a94-a205d1f64e97", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "87f6d477-c1b0-4dc5-abcf-d03b4b33ab88", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.17 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "aed66f98-ea48-44e9-a316-47c404301c86", + "MeterName": "Premium P13 Secondary Active Geo Database Days", + "MeterRates": { + "0": 387.1 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8254ec81-3aee-4198-86b1-0637419eef4c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.176 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d8f0abe0-ebe9-4181-9239-6b6f9d516e8d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.128 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Web (16 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "627916dd-3eb1-4b1d-bd1c-9f19593f6d25", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0288 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "e9437e62-afa8-4a78-9025-c886c04a8d1e", + "MeterName": "Standard Large Azure App Service Hours", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "3139e6c8-7ccc-429d-8968-9ccd8b796835", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 65.898 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cb94a3cc-bc75-4343-b102-4a871ae5ff3d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "beac8d1d-9571-4d9a-8414-4ed63ca2ec01", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.032 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ceba7f47-6ed6-4942-9909-7e2ddcaee83c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0c259952-f0d7-4c48-892b-5fd329583456", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.54 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "78a15035-8e38-47a4-bf17-bed40e6235b2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.648 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eb591a1e-3aa2-45c5-85bd-491965382973", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0cbe80c3-663b-466e-a93d-e448cf81abc2", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.099 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-03-12T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "53cc0061-0fe2-4249-bf62-e1008c811f5c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Java Development Environment (4 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "06e16816-5010-4281-b15f-6e921c98de6e", + "MeterName": "Premium Metered Data - 10 Gbps", + "MeterRates": { + "0": 8000.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "3372c087-75e2-443b-b4eb-e4e9d449a533", + "MeterName": "Unlimited Data - 5 Gbps", + "MeterRates": { + "0": 41000.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "23c4fe6a-7072-4454-b253-f37197ce79de", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ea950d97-8415-4b9b-80d0-536e51ba41f3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.059 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "203385a9-b52b-4a98-b8c3-2cb90652fb64", + "MeterName": "MSFT Peering Metered Data 1 Gbps", + "MeterRates": { + "0": 436.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "075e92be-f685-4d8d-8ee3-e75b11c42e3c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.632 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e86ccf31-0baf-4233-9418-a1e9ebf78945", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.684 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d28bad6f-033b-429c-81cc-a6d9324a70eb", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "462c0174-6967-4e09-a765-24fa53e0c582", + "MeterName": "Standard S3 Secondary Database Days", + "MeterRates": { + "0": 3.9919 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "235b1e01-d3b9-42b9-948c-cbf8bfbada6e", + "MeterName": "High Frequency Cloud Activity", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Factory", + "MeterTags": [], + "Unit": "Activities" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dac67eef-852f-45b8-9fcf-adc4a6a51ef5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.827 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7ded2c93-5742-4baf-8390-7649f77f57b4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Weblogic Server Enterprise (8 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "324e7e3f-2a83-4580-a1a7-3fcbf0219efc", + "MeterName": "Basic C0 (Hours)", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "76744481-9534-4c91-82ae-d3847ea29982", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.346 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d2814d47-36d4-4e71-b2be-9140c3d09f28", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.311 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9a721778-24e6-40c4-a4e5-02014fd8f6ee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8aaffdfe-1709-420e-b847-017242cf7a5d", + "MeterName": "Standard S2 Database Days", + "MeterRates": { + "0": 2.5168 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "833595f5-a519-4b33-af7d-f4fda9495198", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.735 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3f69ee96-a423-4e7b-b370-ce4bf98ce1db", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.327 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1f6bef0f-ed22-4d62-8999-73dd61e5756a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.581 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "7aae1507-5b61-4125-ac2a-66ea118b150e", + "MeterName": "Standard Managed Disk/S10 (Units)", + "MeterRates": { + "0": 3.238 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "57b0ca21-389e-40ea-84c3-79a2724e8308", + "MeterName": "Basic Elastic Database Existence", + "MeterRates": { + "0": 0.0081 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "375abf1e-e407-46e0-a3de-35a9180d6289", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.065 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "108a63a0-143f-4aea-b1a0-6a931d5d8bb9", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9db3576d-f80a-41fa-93c4-f16e87e13e47", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.9 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "58addb81-4c03-4db1-adbd-bbde0b43fdce", + "MeterName": "Premium Metered Data - 100 Mbps", + "MeterRates": { + "0": 200.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5f98a9df-ebf6-4b36-9a63-e806780afc6c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.776 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "83d9848f-562f-4941-b79e-93228e36bb44", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 8.78 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "617091c0-d92a-4d18-89dc-ec0ed8d93342", + "MeterName": "Premium Large App Service Hours", + "MeterRates": { + "0": 1.2 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "5d7995b3-7053-4c16-9a87-fe7537ecde07", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.148 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1ebe219d-f620-47a3-8086-fb605dbb5cc3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.058 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d92a5514-2bf7-4bb1-8a72-0ac7b7f2023d", + "MeterName": "Premium Unlimited Data - 5 Gbps", + "MeterRates": { + "0": 44000.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "79a801ca-db77-4e40-8236-7cbe8dac8051", + "MeterName": "Standard S0 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.5323 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "178593fe-7927-40e3-9096-38baeb7d33b4", + "MeterName": "Premium P13 Database Days", + "MeterRates": { + "0": 387.1 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d23a5753-ff85-4ddf-af28-8cc5cf2d3882", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "238957b1-62b7-40fa-8f95-b3b36c4d031c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.959 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "84c69252-6c42-400f-8bc1-56df43201707", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.07 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "32dbc775-b0e1-4c2b-bb3e-3a930b5dcc3e", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.033 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Zone Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "414e7527-91f1-4e86-8353-5b1b41bb6f25", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.466 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "5431c933-cb1e-400d-ab8d-ef18b5297dc4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.34 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "G2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7218abc7-60c9-4020-bd35-2cb44f4a42c6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Insight and Analytics", + "MeterId": "8c945adb-3f9a-40d1-a661-efc36fa4a3e0", + "MeterName": "Log Analytics Data (GB)", + "MeterRates": { + "0": 2.3 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Log Analytics", + "MeterTags": [], + "Unit": "1 GB" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "95b16456-5dab-46c9-9afa-943acb9bfaf8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.6 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d4181f74-4046-401b-9168-e3211167445b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4825cff2-a186-4a49-9f55-8cfed4c02778", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.112 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5bac21dd-31ea-4af4-9f9b-9c53472db61f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Standard (6 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "709fb951-cbf8-425e-9baa-cf504880d6b5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.154 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "bf9ab6b6-ba11-44de-825f-754c800c077d", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dd98b0e6-e7bd-46c2-af5b-ad1baef749a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "06cdadf9-e6f8-4bf9-b00c-4ba96b291263", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 17.92 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c65c1816-ed83-42f1-a07e-e37e667a1c01", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.474 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "abf68ce2-a95e-449b-9f4e-c5e9096b7a4f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.276 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "c18d79b3-f3c9-480b-9f4c-7ed410ea3313", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.027 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "fac079bd-39e8-40d8-a9df-06d2b1cb4dd4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "39df68e7-3504-41e8-aaff-046e3250556a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a51ac8a1-8bfe-4979-9488-658ede49f108", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.074 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "91967101-dd9d-4c5f-aece-b32e77a15544", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.504 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "aa165f78-f022-454f-abe5-8c8086f36d9a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.769 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ba7a1dfb-f2de-4363-a6b5-75b4f8f6b8ab", + "MeterName": "Premium P18 Secondary Active Geo Database Days", + "MeterRates": { + "0": 541.9344 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d8387905-8ec6-4da4-b23a-3d9d77807088", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.663 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a07423fc-6af2-4af9-87e9-b1260b2a5abb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "5a52f29c-0b10-47c6-9eb6-7f668ab6635c", + "MeterName": "Premium Encoder (Output GB)", + "MeterRates": { + "0": 3.99 + }, + "MeterRegion": "", + "MeterStatus": "Deprecated", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "e56de096-6d48-48c1-becc-5b43cd9f1a14", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "95861166-e640-457a-a6e9-bfeacdd0ca2c", + "MeterName": "Unlimited Data - 2 Gbps", + "MeterRates": { + "0": 11400.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "5a209209-b372-4dab-9d56-0c2fefae16c1", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.096 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "10056506-dc72-4b6e-96c7-c39b0d908b9e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "6213bf32-4e36-4c00-8240-747bdac2db55", + "MeterName": "Premium Large App Service Hours", + "MeterRates": { + "0": 1.272 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "87f3affb-3314-46a5-a56a-569355dcefaf", + "MeterName": "Premium P18 Database Days", + "MeterRates": { + "0": 451.612 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "444db22b-1d6e-4116-b199-a8d137e84ef8", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.1252 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f6bbf355-3406-40dc-8983-3fa94a466c0a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.624 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "835b1880-0c95-4d4a-a849-0f951ed6cc2d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.188 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "7a42eff4-681c-49b6-829d-4f6d38b25086", + "MeterName": "Premium Medium App Service Hours", + "MeterRates": { + "0": 0.75 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f59263c9-84d8-4704-b376-266b60887823", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.75 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8adec5fc-02a0-46ac-9ac1-b15d358fceb2", + "MeterName": "Standard Elastic Database Existence", + "MeterRates": { + "0": 0.0838 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3ab7e5ec-71c8-4505-aa09-000a5645dab2", + "MeterName": "Premium P15 Secondary Geo Database Days", + "MeterRates": { + "0": 428.56 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bd877939-4a15-4f1a-a69f-0fb33417c47a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.143 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c9209a46-64d0-4d1b-a01e-229c0fe3e7b7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.401 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F8 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 1.0, + "MeterCategory": "Power BI", + "MeterId": "924c0a27-3db9-4413-8d1d-40d94c7987eb", + "MeterName": "Sessions (in 100s)", + "MeterRates": { + "0": 5.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Embedded", + "MeterTags": [], + "Unit": "100 Sessions" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "186a16bf-2c6e-42ce-bed8-059db2f57486", + "MeterName": "Standard S1 Search Hour", + "MeterRates": { + "0": 0.444 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "161a0e9a-c2e1-4162-9077-6416d02844a2", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.0756 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Medium)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f7ac1c02-9ca7-4e5f-a2c4-edc3435734d4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Weblogic Server Enterprise (4 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "22d85d60-c41c-4542-bedf-1a3bac96937b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.18 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "470d9aa5-21f8-4dff-a880-d6d72b3f59c7", + "MeterName": "Data Transfer Out - Unlimited Data (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1ccfedef-65f7-46d6-89cc-3658db2d14ac", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.129 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "09edff4b-66d0-49c4-ad6e-9c5765103f67", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.074 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f5c28252-7d44-446e-adfe-e097fb87f340", + "MeterName": "Premium P15 Database Days", + "MeterRates": { + "0": 571.408 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6f8ee651-a6ab-48e1-b292-77aefb27f645", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.2825 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "aa0a44ba-fdec-4c16-9b16-44a99b5b473c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.462 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "b43ff1c3-31f9-4b19-8f3b-5557ffb8f157", + "MeterName": "Standard IO - Block Blob (GB)", + "MeterRates": { + "0": 0.033 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Zone Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c97e16c4-2789-4afb-9371-f109dc4e2217", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "43ebcd16-a388-4d6d-84b1-ef953baa7f61", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ace09fbe-4629-4da8-8723-a06b4bb5115a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "74b451a1-6b3e-4e0a-9f8a-d5ee7fcd9fa3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.094 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e7d4f4ca-0abf-4f2f-9c32-0d608668db67", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e6584a84-4190-47aa-ab57-f44fcfda5f8e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.222 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8ae013c5-03d7-48bf-b190-0227b00a6b93", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8297cba8-cbd1-49e5-8404-8a85013c008e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "64443c94-8202-4c8f-bdb3-9d00e7148dc6", + "MeterName": "DWU", + "MeterRates": { + "0": 1.4516 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a02d767d-d301-4890-944c-2d1201fed9db", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.447 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "469a7d8f-36f1-4a99-a884-6eb97643be2c", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "7d00b59f-3460-40ff-a89c-324c644f77a1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.102 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dfabe369-3ccd-47d0-a26c-afc744bdc10c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.211 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e96a821c-4cb1-4254-a2ab-a0c579d51f83", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.433 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5e81d0b1-4c37-44c7-addb-59bc8aba8035", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "dc0f7040-7861-4e1b-b9f4-07bbf009c117", + "MeterName": "Standard S2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 2.42 + }, + "MeterRegion": "JA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6a7bf979-bbdb-4336-97b4-01d50f48ad16", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.292 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "b8ed6239-58d6-449b-b1da-34d0b4eff476", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0413 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "32d2a614-7fe4-4517-9054-747974227b48", + "MeterName": "Unlimited Data - 200 Mbps", + "MeterRates": { + "0": 3220.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c89d2470-38e5-4f78-9531-d505c2e178fd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.322 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5ba9e46a-2456-44bd-9eed-decfa41819c7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.296 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4831a7b4-bdd4-48a2-8e95-18d053971ede", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Red Hat Enterprise Linux (4 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "02cb2c4e-8548-42a2-b044-540da3343557", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2e29319e-ffa1-434e-b6ff-77a30d0e6683", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "814a4328-d48f-4a94-a3ef-cf9fb9955dd1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.516 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "ea8e044b-900e-4137-b26f-7e41eecef1b6", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Identity", + "MeterId": "7ccceb80-e77e-4b06-9bed-c1f80eb8ff02", + "MeterName": "Authentications (in 10s)", + "MeterRates": { + "0": 1.4 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Multi-Factor Authentication", + "MeterTags": [], + "Unit": "Authentications (10s)" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9a4aa17c-cdea-4948-bc62-4a22d1299b25", + "MeterName": "Premium P18 Database Days", + "MeterRates": { + "0": 499.982 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9ff9206a-5a63-4c25-886a-f4fd19c89fa7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.54 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16r Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "016c50fc-0267-4002-8e23-31776e77b3e7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.769 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9e4032dc-9f37-4f9a-882b-4c004b1c896a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.769 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "45cd4bfc-20a2-48c3-9f03-2816edb5c5ad", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3456 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c9840930-3d15-4b1f-b1f4-5cb5e0b8980d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.256 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "eaf96dc7-97d7-43d4-b69c-be223f9cea0f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.496 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "884a7710-279d-4ad3-82ef-4d2e592e0e89", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.76 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e320974d-3fb9-41f2-80d6-e8bd289b37a0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.146 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8440c7c9-5522-4f6f-8c8d-42cb8ecf523a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.23 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e4879456-0fe3-401a-8ffe-1317dbee9287", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.039 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "31997b13-d049-43f5-8bf7-cee61fbb6d54", + "MeterName": "Premium Metered Data - 2 Gbps", + "MeterRates": { + "0": 2372.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "dc0bb519-a6d0-46ca-9e19-9e034b445eed", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 122.88 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "00c7e75c-8710-4941-a917-449cfabd79ea", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "04363242-b094-4c7c-ad25-c0c451ab2d1d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.222 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7b5efd2a-b249-4a6a-a522-bab7ccdfb74f", + "MeterName": "Premium P1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 15.6 + }, + "MeterRegion": "IN South", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c90f4d88-01c1-48e9-ba9d-cb9c6ccaedd3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.073 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "f2b896ed-0fb5-48a5-a687-70c2f63e137b", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.108 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "92808e25-462d-44ae-af54-1a5b7f7c9a9e", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bb4d7e6b-4bec-45b4-8c6e-03fb74c646ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.8 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC12 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8c7ff689-1ce2-49f9-be24-abf82b79a736", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.021 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "8e224de0-27c5-41e5-b890-565a7e2a6a82", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "acf26b15-ee92-440d-9973-9a72d77641aa", + "MeterName": "Free Data per App", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Application Insights", + "MeterTags": [], + "Unit": "1 GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "00e47962-832f-4e9b-94dc-ab7e637ea92d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.291 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "168736ab-5930-4325-95d5-35bcd09457fc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "719fc63b-9049-45b7-89f3-746513707f5b", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 66.56 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "951e0599-a983-448d-8f72-cb366fa7596a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8f412096-89b2-4a4d-80b1-72da6f557a67", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.452 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6d2a2461-578d-450e-8d5f-0a03220e74f2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "098eaacf-acd2-46ac-8b17-d8b66371b710", + "MeterName": "S1 DocumentDB Hours", + "MeterRates": { + "0": 0.0354 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f2f36fff-5302-426f-a51f-8a82acd1eac7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.62 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "26000933-55ee-46b1-829a-126876898eff", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.137 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "df14d9be-1b23-4e6d-bf70-4a4f0071025d", + "MeterName": "Premium P6 Secondary Active Geo Database Days", + "MeterRates": { + "0": 135.61 + }, + "MeterRegion": "JA West", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "5c2baada-d524-4027-94cb-43c225469a15", + "MeterName": "Premium API Management", + "MeterRates": { + "0": 2849.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "API Management", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "801366bf-804b-4b1f-9078-517f203e4aa3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.418 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2c4db260-4bc7-4388-a42f-b0c709255ae8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.64 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "14acfcc6-9368-402d-9fb4-dbced00798ab", + "MeterName": "Standard CDN Data Transfer - S2 (GB)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a6dcb69a-9f5e-4c8a-9e39-0adc138b1278", + "MeterName": "Standard S1 Secondary Database Days", + "MeterRates": { + "0": 0.7592 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5aae31e6-f8f6-4d66-8a2e-2adcd540699b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.433 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a0244804-7057-43fb-9741-c2c6bda7b1c2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.063 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "bf20ce29-80d6-4b39-8966-187bd0519f21", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bc15d35e-40c3-4f79-82fb-278d0bee5faf", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.411 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "96b59323-b38e-453c-bbc6-01cbffe2fe3f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.593 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "65d4ded2-41ae-43a8-bb68-3c200e1ba864", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.008 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "abbd81a0-cc95-476d-9b16-b5aab77e39fc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "25e78bdc-41af-43e0-ac56-aeba945f6ba7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.368 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8521220d-807f-4f58-9b1e-bf6ae83ca011", + "MeterName": "Premium P11 Secondary Geo Database Days", + "MeterRates": { + "0": 191.7 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "98e31dfb-389f-4e25-8b50-f38e29e84274", + "MeterName": "Standard C3 (Hours)", + "MeterRates": { + "0": 0.563 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "beffb77f-1238-4149-a78a-bfc782c0b68f", + "MeterName": "Premium Metered Data - 1 Gbps", + "MeterRates": { + "0": 1186.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "505db374-df8a-44df-9d8c-13c14b61dee1", + "MeterName": "Standard Small App Service Hours", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b7f80c20-f4a5-476c-8237-f3baaa671255", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7cb727f1-3834-45d4-92f5-d49e62641089", + "MeterName": "Premium Elastic DTU Pack", + "MeterRates": { + "0": 0.198 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7614df31-630d-466a-b2cd-b73fc23931e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.384 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4c2d1c48-6c1c-4f37-ac7e-b38e86008036", + "MeterName": "Premium P15 Database Days", + "MeterRates": { + "0": 679.0171 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "300132ca-146c-48d0-8216-c86998f60db6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 7.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MSFT R Server for Linux (20 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "e11331a8-fd32-4e71-b60e-4de2a818c67a", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "XL SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "792894ed-5b32-452e-ac70-0463d027d90b", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Canonical (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e3a07909-e1a1-4e0f-af7a-cea8a49f50e1", + "MeterName": "Standard IO - Table (GB)", + "MeterRates": { + "0": 0.077 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "86279f50-4cda-418e-8dc2-bc1770d59915", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.183 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8bb670ad-5d59-4723-99d9-1e040a6c5b13", + "MeterName": "Standard S2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 3.025 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a8082c50-37ee-4195-b614-d4d408b615d0", + "MeterName": "Standard S2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 2.42 + }, + "MeterRegion": "JA West", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "App Services", + "MeterId": "da02f8be-997c-44a8-bb21-deb811177a5a", + "MeterName": "Automation DSC", + "MeterRates": { + "0": 6.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Automation", + "MeterTags": [], + "Unit": "VM" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "3900f89a-8667-4a76-8984-504d4bf0ddf9", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 74.34 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c68cda95-e1f3-4e54-a85c-32ed5b900edd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.185 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "15b2ed74-d530-4521-a813-a32d069e4bf3", + "MeterName": "FairPlay Licenses (in 100s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "100 Licenses" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a5d9f3be-c88f-4393-8302-de6af76dad80", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 12.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MSFT R Server for Linux (32 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b553abf1-9582-4795-a786-feeabed98f46", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-03-12T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c92a7ec3-d054-4c9d-98c1-ef708e97a201", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Java Development Environment (2 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "77d94e56-0590-47e7-953b-17feb313be82", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8c78a0f1-97b3-4df7-b87b-783874d4848c", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.017 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ec2457ae-8775-48bf-8bdc-f1c94e96eb56", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "d1f893a4-6aa7-431b-984a-04414c453819", + "MeterName": "Basic Small App Service Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "3315f5d6-a492-4f66-baf4-c81a47ec3fd1", + "MeterName": "MSFT Peering Metered Data 1 Gbps", + "MeterRates": { + "0": 436.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "97e03f3c-0892-4ea2-87c6-f60c06d4710c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.139 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b56a540f-d226-408a-ac76-6e6ec85bdb96", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.496 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7b5c8556-24e2-42bc-8f46-da45ac53aee4", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8547d777-4230-4ef7-ac27-0b2e63f33587", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.04 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "4a68c477-2ad5-4b7e-bb39-61886883f101", + "MeterName": "MSFT Peering Metered Data 50 Mbps", + "MeterRates": { + "0": 55.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "404de555-ea2a-4a14-8a76-8955438216e1", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8c934b0a-290f-4e40-ba60-eb56f767f5c3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.464 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ba181a95-5112-433c-ae9e-551146b5f1f6", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3942 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "5f688460-13f4-43e4-93b8-0086c0d28efc", + "MeterName": "Professional (Annual)", + "MeterRates": { + "0": 539.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Annual subscriptions" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "806ec6e9-9c5e-438b-8802-2ea4daa35f12", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.229 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "67ea9764-1433-4e4f-a761-2d74741369da", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise and Weblogic Server Enterprise (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "41bb4a09-0f02-4dac-ab73-e2c8f31963d5", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0208 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a2d3232c-e4d6-4535-bcaf-350491f11884", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.25 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "636a5df9-bdfe-4fef-a29f-88566b6ce93c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.932 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c7d16067-dc2b-4a82-b970-1cf55190b54a", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.0963 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a65783ec-b3c0-4235-b5ff-d5d4a13b92a8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "042c2ad3-a656-46e3-a339-0e228b6c201b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "17c078d9-61d2-4984-9ff2-c147df5826ac", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.447 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "05790f64-156c-44b8-87b9-9ada20c86640", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.275 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d6dcc45d-cefa-4bcb-8c8b-1f47b4bb8f58", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.129 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "24b4ac5e-65f8-4136-b48d-15dbf86cb054", + "MeterName": "Premium P1 Secondary Geo Database Days", + "MeterRates": { + "0": 12.87 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "d4816704-ab6b-49be-8958-62d3581ac1bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.274 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "152ccd59-845b-44d7-9a05-5b0af2d501a6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.124 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "c2b9b3e7-a1a2-4b8b-8f38-81a50ce18821", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.011 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "af32d3ed-94a1-40ee-a20d-975356b21d28", + "MeterName": "Premium P6 Secondary Active Geo Database Days", + "MeterRates": { + "0": 150.0 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "3c95dd0f-555c-4caa-9d03-958a6778df30", + "MeterName": "Ingress Events (in 1,000,000s)", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Event Hubs", + "MeterTags": [], + "Unit": "1,000,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3c159e90-2794-479f-a63b-8794328a4986", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.372 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c2036e92-a7fc-4315-9043-8269373b3345", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.43 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "695f605c-f3d7-43aa-a0eb-15c8290cd704", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8a7d7499-7ec3-46dc-8697-355ac2fc14bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.036 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "52670bdc-1da8-43ad-bc26-d1b2e064ef3f", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 21.504 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "bb1dde0a-4473-4457-9ddb-d55d4aca3b93", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "b33b1ec8-9cf7-4d2f-8f25-7b2581ad0b0c", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.1045 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7ee5cf19-c864-4038-b4ad-bcfc8e63c508", + "MeterName": "Standard S3 Secondary Database Days", + "MeterRates": { + "0": 3.629 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "4e435593-08e3-4159-9c2f-374618fd11f0", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "b4a70377-5177-4367-ade0-7f47af3e7c52", + "MeterName": "MSFT Peering Metered Data 1 Gbps", + "MeterRates": { + "0": 436.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8f4a412e-3b8e-4e4c-85c2-46a96d851ada", + "MeterName": "Basic Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.1771 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "251ae557-c741-45e1-a91d-10d98f925083", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "092a9b85-fd4f-4925-b241-72745aae80f2", + "MeterName": "S2 (Daily Units)", + "MeterRates": { + "0": 32.258065 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Speech Translation API", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "43d8ab6b-6aed-4019-b83d-fe4d0c449ce2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0171 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3ad6ad1c-3c84-4e00-afe4-9818c2a08ed3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.124 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1e585364-9fa3-4720-b24e-e681845bfd63", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "87296176-55e9-40de-91e8-816669a46f3b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.567 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5f75c8da-e2ff-4e2e-a939-f372463b6b4b", + "MeterName": "Storage (GB)", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b77aa88d-50a4-4936-9277-babc8774dda7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.463 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "296a5c51-33ca-49af-8ca3-de6661d09771", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "4cfe3a23-13ea-4218-8e17-7bff8fce1b88", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.195 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "585e9440-27b2-4fc7-a22d-fe53e028affa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.199 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "de5d84ea-63ee-430c-a456-ad68029b89bd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "244c1fb7-cbe9-49d9-8c4b-3c1fe31ec2a9", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "108c3046-32fe-472f-9a7b-ccf35874892c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.076 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "15cd325a-c594-438e-8e0b-9598de1ad57a", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.3584 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d7488c0c-1f72-4887-9adf-e11419b28bc2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.333 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2d340261-41db-4be1-9426-dc9784f29e48", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.146 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0900568c-28c5-4cda-a43e-88671e36fa39", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.226 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d18c8c36-0471-44d2-bc16-c3ea3ccedc60", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a20f0805-7d55-4674-899f-10907b9bbe7c", + "MeterName": "Surcharge", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Premium", + "MeterTags": [], + "Unit": "Core Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "caeb31bc-8c7f-4ccb-b62b-b99b93d62b1b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.732 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c3867359-7044-4ef7-9049-01ef23565e7b", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.024 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a0d60409-83d6-4026-9122-a1b103311ccc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.467 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "955c7d3a-efd8-49f7-a4bd-e71cde2aa138", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "c240c688-f075-4691-99f2-7cdaef88e4b1", + "MeterName": "Test Manager Users", + "MeterRates": { + "0": 52.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Team Services", + "MeterTags": [], + "Unit": "Users" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c6a07dcf-f269-456c-85da-ef574ffab7e2", + "MeterName": "Premium P4 Secondary Geo Database Days", + "MeterRates": { + "0": 56.25 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2ab30cde-f481-4976-b511-6fcd3b477bae", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "470cc61d-890b-4b11-8b18-123f1ad37f91", + "MeterName": "Standard Small App Service Hours", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "3a8f4481-d93e-4064-80d2-d128bd9ea742", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "c8e955ae-f19b-47a9-bc1c-846382d6daa0", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "753763fd-7c2e-4c10-8ea2-10be34d4e36d", + "MeterName": "Premium P2 Database Days", + "MeterRates": { + "0": 37.5 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "404b8578-546e-49bf-bcf4-a47b5097bc67", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.018 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ab99bd15-c0d1-43c1-8e09-9e83f9fa5b5f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.2512 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "01a2828d-f337-4387-bdb8-217fc47877c6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.227 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e63bcbe4-2a9b-41cf-922c-3b5444bd0eca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.87 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NV6 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c7bc816c-6c79-4cf2-b6cf-b36c5dfaf5b2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.58 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "605bbfc8-6a48-401d-a5ca-f53ce90069f3", + "MeterName": "Premium Storage - Page Blob/P20 (Units)", + "MeterRates": { + "0": 73.22 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "6417d428-fe3b-4270-951d-5a67e6411a8f", + "MeterName": "Standard IO - Page Blob List Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e51f6a34-91af-479e-ad0e-4ebac30031a1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.204 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "12f548fc-5b9a-4664-a9ea-4d3a9b68d7fd", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 67.59 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1cc5131c-4d1f-4e2c-8ea1-65b640416829", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.405 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "219ecd20-6cc1-478d-81ba-a1a967d6a0db", + "MeterName": "Basic Small App Service Hours", + "MeterRates": { + "0": 0.094 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6bb41d64-700b-4094-b299-07fbd021ea5a", + "MeterName": "Standard S1 Search Hour", + "MeterRates": { + "0": 0.444 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "e9faa2d8-24d4-417a-a20a-e80106325bbd", + "MeterName": "Data Transfer In - from China (GB)", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8e700f3a-08bf-4e24-89e2-e6faaf4f2379", + "MeterName": "Premium P15 Database Days", + "MeterRates": { + "0": 619.3536 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "094f91f9-f1f8-4050-9c10-f621e50f1005", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2938dd7b-29d6-4a9e-97f8-4eb2c74f72ec", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.352 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "948d4975-d782-4e2f-8f72-ccc8efce10ab", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "c6f239e3-3e2a-4ede-8112-1ee2a0dd140b", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 61.44 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e90a84ba-b3b3-436e-af1b-24824261c7f9", + "MeterName": "Premium P11 Secondary Geo Database Days", + "MeterRates": { + "0": 187.5 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-01-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "59e53aad-6b76-49ca-b647-9a44c39cad90", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services Low Priority", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "767a249c-98a9-458e-9567-367120c60a08", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.456 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ea47b72c-a90e-453f-9de8-8fd121cdbd0b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.296 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fb2f07e7-20be-43de-a5d7-73aef550c22e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.232 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "283f166f-fa2b-4466-aaca-e77b730e70c5", + "MeterName": "Premium P1 (Hours)", + "MeterRates": { + "0": 0.555 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "622ce29b-9869-4726-a45e-772e6ae9a219", + "MeterName": "Standard S1 Search Hour", + "MeterRates": { + "0": 0.403 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "0c4d13cb-7134-4be8-a6fa-a52fdcb87e4c", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b08cec03-dbfd-4cef-b793-1d02dbb4b4ca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.21 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "50cd4076-72de-4f42-a240-63d75f45df02", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.301 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8m VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bca046ea-ac28-4a17-bdbf-59acc88a6089", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.983 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c0ce0553-b825-4810-9b3c-f062301d523a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.532 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f7160398-9710-4663-bed9-238d3534711b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.389 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3ee653f7-3319-4d9d-898c-dfe48f5092f5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.291 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b29222d7-79f4-4662-9270-b59f7a48ee59", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.36 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "03bf9426-2cb0-40d2-8c27-38e3bff2f1ba", + "MeterName": "MSFT Peering Unlimited Data 200 Mbps", + "MeterRates": { + "0": 3220.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ba94eb13-49d7-42db-aa50-c1c45a7adb1e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e890fc6f-c1c6-4365-8031-d57b7d034e9f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.158 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d5bace6f-c712-4b30-b473-28eb8ad129e0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.639 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "52ed4b36-b910-4ce7-be41-e08b60cf2c31", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A6 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3f6360a7-756c-4a5e-b464-069a28d53d36", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.246 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f7a83bd0-b47c-4e8d-ac62-da11325848a3", + "MeterName": "Standard IO - Table/ Queue (GB)", + "MeterRates": { + "0": 0.1252 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e8bbd55c-3700-4d4d-9940-1a785f5b3a2c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "82b34d1e-456f-4483-9015-bf96bb282749", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.399 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "539935b7-c891-4c8c-af68-eeb71de37de9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.9 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "1ee4c93c-c068-4d6b-b4cc-5145ef2f26b5", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A11 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c31ba90d-da1e-4665-85a1-f80f1810dc05", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8d9089bd-c8ea-4b98-b246-8d016fd2c20b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.227 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ec122893-1646-4e2b-b9f8-3bad09490d1b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3f3da0fa-5694-462a-b013-ef7b59556fb7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.305 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0b789296-ba17-451f-9dd0-5cb514b096b0", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 19.712 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "fd05ccc8-ea8c-4985-8a31-5fd897475bdc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.385 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D2 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "20f70c29-cf95-4a6c-884f-83475ea9e28e", + "MeterName": "Standard S4 Secondary Database Days", + "MeterRates": { + "0": 8.0355 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "19853b60-be75-4aa3-b462-98188219952e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.07 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a9e85b51-6dcd-4b1e-9079-7394410fa021", + "MeterName": "Premium P18 Database Days", + "MeterRates": { + "0": 511.182 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cfac34fb-c029-4c92-815e-a4a3c963af6b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.161 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e214be74-25c4-4fa3-8366-f710a94c063d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.219 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4c14fdf2-2e55-45c0-95e4-16eca3f49046", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.585 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "98d75907-4688-464d-9ef2-ae7692872151", + "MeterName": "Overage Data at Rest (GB)", + "MeterRates": { + "0": 0.039 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Store", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "68c797b7-f215-4c3b-ae9c-aaa1b94f6457", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.66 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a8ba8fe4-285d-494d-90d8-5339b112ea40", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.24 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "562a0a36-b282-4c60-b636-c137ff56e83f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ffcf5d7a-99c4-4030-8699-c9423edcbb20", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.136 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b25e6dd4-75d3-480e-960e-649e0f7b945c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "d0cb76ad-7474-4083-ba41-fe75266d9341", + "MeterName": "Basic VM Support Hours", + "MeterRates": { + "0": 0.03 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "XS SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b8b11c98-f0ee-460b-9626-3bdd0cd62fa5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.08 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "d1c3128a-d1e4-423e-a917-394b7294f435", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1a2c181b-8445-49c9-8b8d-1a9ceb7bdf99", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Weblogic Server Enterprise (20 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "00f88d73-6fbd-4955-9c6d-57ce7ec6ea10", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.016 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a9a2a4b0-4a1f-46dd-b2e6-b2bed0c2cad0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.38 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "95c1589b-4a62-4fff-aeb0-bb17d0098c9e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.458 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f5af6951-80ba-4e4a-8c51-7b6c6ecffb59", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.202 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b5f4a5af-9641-4fb0-a4cc-77d032abbc20", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.44 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4de4ab44-1e88-480c-b560-f091f5e54f5a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.518 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "153f1e57-2a58-4e97-94e9-1beea575e196", + "MeterName": "Data Processed (GB)", + "MeterRates": { + "0": 0.008 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5370392a-4fef-4d26-85c1-cb2cd5a1f541", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.546 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "dd183633-4455-44e5-9258-bad3854c17b9", + "MeterName": "Premium P4 Database Days", + "MeterRates": { + "0": 67.91 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "bed0aa77-9920-4a56-ac95-a0912a338e91", + "MeterName": "Standard S0 Secondary Database Days", + "MeterRates": { + "0": 0.438 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "be1ac0e7-2e70-45d6-90f4-4684c68927a3", + "MeterName": "Unlimited Data - 500 Mbps", + "MeterRates": { + "0": 5200.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "05212985-faad-4b6c-8ddb-c08cc8e37f79", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 19.71 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "952aabf4-6502-43d9-936c-19f6b5b692a6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b1d7eff6-5b66-4b3d-98e4-6a7911725399", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.156 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "44acc2ec-252b-48ea-a086-e14ed78c5e27", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.027 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "45e7b24d-c367-454c-b136-b2ae4e665ecf", + "MeterName": "Premium Storage - Page Blob/P4 (Units)", + "MeterRates": { + "0": 5.7601 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f0949791-7f08-46d9-ac54-92d5099d994c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.198 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "28c11fc3-0e9d-4cbf-81d7-48ae8cea70f6", + "MeterName": "Premium Storage - Snapshots (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "aa753d9e-909a-452c-813f-477a16754810", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b9e91eae-a5be-4bbf-8cf2-0fe526737bae", + "MeterName": "Standard S4 Secondary Database Days", + "MeterRates": { + "0": 8.7097 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cf287676-717e-4e97-9606-300d57d0614e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.24 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f6a8b881-4c7e-4ca0-ae42-f0e9f35a43eb", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 17.92 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ae037cc8-2326-4d3e-bee7-b674651d84f5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.311 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H16m Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a642c6cd-544d-4aaa-807b-397b43720f03", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.134 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a8999dbf-0a4f-4336-82db-72f644502475", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b1b93a0c-a928-4d20-a54c-e220b271b09f", + "MeterName": "Basic Elastic DTU Pack", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b5c35d52-c111-44c7-b47f-b86944270eb2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.197 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "893280e7-0a64-4535-922b-82b0a0da5ea0", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a7d1f653-4382-406e-a99b-cfa924d17f8a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0623400b-f198-453e-b090-f09555b18e6a", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "193a0217-0a7e-4e03-b141-3f28419da168", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.1 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A11 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "124b916f-7a0b-49fe-a83e-ad00333847df", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.081 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6a168742-d7bc-4315-8d68-3eafc1ee0150", + "MeterName": "Standard Elastic Database Existence", + "MeterRates": { + "0": 0.0455 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dd92c0ee-4577-4a49-bc32-88d1a919e07c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.35 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A8 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "7784341b-7b0a-46c9-99cd-44e397ff75ca", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4a29ad11-b248-47f3-b4cc-745dea04598b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.054 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ebff4fe1-5153-47ea-97c0-ed330493fd4a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.16 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "f0e0687a-1ea3-44e7-abb9-80498915b66f", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A5 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cb761e8e-ac81-4efe-86ee-f7a21fc57256", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.159 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2f29032f-38e6-4b02-b11f-af4d02e5d2da", + "MeterName": "Standard S0 Database Days", + "MeterRates": { + "0": 0.5323 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "dc264c7d-52b6-43c1-8edd-7e1ce6da677c", + "MeterName": "Free (1 Million Characters)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Translation API", + "MeterTags": [], + "Unit": "1M Characters" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a63ab405-5854-426e-ae2f-35d495646af1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.336 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b16005af-86c3-4d5a-aeb4-5dab885b3b32", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 4.88 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-10T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "557495ef-6150-4699-91f4-cf0e62cf16dd", + "MeterName": "Custom Domain Resale (Domains)", + "MeterRates": { + "0": 11.99 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Annual Domains" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f525f30c-c344-42f3-8aa1-f971b93338b0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "450e3d99-4ba5-40d6-99f3-b3f779e61de2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.521 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d4d9e93c-83f0-4380-ad49-303469bef64a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.346 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "8795ab57-9cf7-482f-ab5e-f549536af7cd", + "MeterName": "Standard MS2 Database (Hours)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MySQL Database on Azure", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "94db869d-b0ed-486a-8995-ddff0eba7412", + "MeterName": "IP SSL", + "MeterRates": { + "0": 39.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Sites" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3f0f3397-5a9e-4590-8bb4-c4469f634e10", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.671 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f9762b14-5e33-4846-8282-7e04a2a65723", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.286 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "bc234a3d-532e-4117-b6f6-a16dc199cfd6", + "MeterName": "Ultra-Performance Gateway Hours", + "MeterRates": { + "0": 1.87 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Virtual Network", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4948d0ec-8435-4f5d-9dca-f253e03d1676", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.616 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "3f2a709d-5add-4461-9daf-ce44586676f1", + "MeterName": "Premium P6 Database Days", + "MeterRates": { + "0": 137.28 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "e81fb376-3130-4866-a237-6bcd68e905d9", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "a99d0577-66c4-4bc7-8858-737da568e1fa", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "7b1c4383-af05-4b36-9eeb-a507ab6c91ba", + "MeterName": "S1 (Units)", + "MeterRates": { + "0": 80.0 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "714be93d-955c-4ca5-947b-285ccc69040e", + "MeterName": "Standard IO - Page Blob/Disk (GB)", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bcf0cd59-1293-4451-af4d-2988e253ce89", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.588 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d30fdaf3-0eef-4bd3-b557-8781746e22d6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.568 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "fabeaa41-a09a-4fe8-abfc-39e66dd66dee", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0832 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ce622662-60c4-4a4a-9723-9af0921c5ecd", + "MeterName": "S3 DocumentDB Hours", + "MeterRates": { + "0": 0.147 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5d8cd12c-3288-44a3-b6a9-75bd52b919aa", + "MeterName": "Premium P1 Secondary Geo Database Days", + "MeterRates": { + "0": 14.063 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7a6c4c40-b914-4d0b-8594-a022308181f7", + "MeterName": "Premium P11 Secondary Active Geo Database Days", + "MeterRates": { + "0": 255.6 + }, + "MeterRegion": "JA West", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "46f7694b-0985-4757-8af0-a65f3b425e34", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 21.68 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d07849bc-0cd7-4caa-b2f1-39ee0ecb6765", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.096 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c48425d9-b8d3-433c-9830-e9cb9d220162", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "aa773dd2-51ff-41b0-a06e-7f49a68c8699", + "MeterName": "Premium P4 Secondary Active Geo Database Days", + "MeterRates": { + "0": 67.91 + }, + "MeterRegion": "JA West", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b755407a-f95a-4cba-9f38-15ebee34f3d8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.501 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "77abbc7b-ab09-463d-b97a-fa10bdbe4f80", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "ed8b40eb-7183-429a-a52e-bf960dbbd929", + "MeterName": "Premium Extra Large App Service Hours", + "MeterRates": { + "0": 3.0 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b8933f5e-59c6-434d-a2bf-c391b914ea10", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.219 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "25e4b7d6-0d1c-4855-bdb2-250d26c5c0fb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.348 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8b3ed95b-c4cc-492b-8f8f-cbfa8946c0f3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5a14a7c1-b19c-40bc-be85-710204d067d9", + "MeterName": "Standard S3 Search Hour", + "MeterRates": { + "0": 3.552 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8a073f8d-bc48-49ea-8bc1-7fc5af07483b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.411 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9f3b839f-4463-4749-a7dd-4ebf8d378142", + "MeterName": "Standard S0 Secondary Database Days", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "75d01b20-ab5e-4cba-9df7-88a0ffc00b9d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.672 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "ff4b3c7a-60b4-4701-a7a9-53afabd9b397", + "MeterName": "MSFT Peering Metered Data 10 Gbps", + "MeterRates": { + "0": 4350.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "90eb72e9-4c2f-4012-82c7-aa4f68a0c9d7", + "MeterName": "Premium CDN Data Transfer - S2 (GB)", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c0798977-f486-4a4a-aea7-06c9c6155506", + "MeterName": "Standard S1 Secondary Database Days", + "MeterRates": { + "0": 0.82 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2c106181-356f-418b-ab7a-856d5cfbb320", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.29 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6b44a2ed-1103-41f3-90fe-8aaf147c3e41", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Server Standard (up to 4 cores)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "38df4981-0ab9-4ba0-87ab-f2012e35851a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "aff3dd6b-bc53-4573-b814-c7de690b2b59", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.31 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2bbbb0c7-0281-416b-84d7-03ea1155a1d1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.318 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ba620efe-2691-47eb-8056-42524499fb84", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 6.82 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "c7107dc5-43b9-4d42-9ba8-161345a976a3", + "MeterName": "Basic C0 (Hours)", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "59a69bac-2338-4521-8b15-1708093b7615", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.075 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "0e59ad56-03e5-4c3d-90d4-6670874d7e29", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.029 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "77a1a55d-2e77-418d-a313-ac8ba17a59bc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.09 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3fc6cc9f-c924-40d1-a0a7-3fb0c96c8762", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.29 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "3f86ed36-f23c-41fd-8197-949bb4db4524", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.45 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e67fe802-d939-4c01-8d67-310db9115456", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.167 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "d3aa0e4b-fa3c-45dd-9c37-e8cfcd740cc7", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 67.59 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5565996f-6719-4a62-b2eb-f6c3b28d388e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.623 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "c2e58b2e-18a6-47ca-bb17-c64326404300", + "MeterName": "Metered Data - 2 Gbps", + "MeterRates": { + "0": 872.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "608d24cf-8db8-4aa8-bb93-c0a281555c9f", + "MeterName": "Premium Metered Data - 10 Gbps", + "MeterRates": { + "0": 8000.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f734df52-f7fd-47cf-a279-9b718d15c0b9", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "91d1ae38-82b5-4d2c-a109-66d2818b3e66", + "MeterName": "Standard Managed Disk/S30 (Units)", + "MeterRates": { + "0": 22.528 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "b7ecc630-9105-4be3-b944-1ba2b0107d63", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "L Canonical", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "6232586a-5a0e-4162-9776-010ed4bb000d", + "MeterName": "Standard S2 Secondary Active Geo Database Days", + "MeterRates": { + "0": 3.025 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "ad62198b-dcff-4cf5-8804-9d70d34191b2", + "MeterName": "Standard VM Support Hours", + "MeterRates": { + "0": 0.108 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "M OpenLogic", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "d38af928-fdf2-47aa-bfc6-f2df5278207b", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.084 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "b699d0d7-798e-48e1-96aa-6c85d1fde13d", + "MeterName": "Basic Large App Service Hours", + "MeterRates": { + "0": 0.354 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e7cc5499-e93e-4f4f-b311-7ff2de78858b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.248 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ab49d92d-3edd-4f98-a67a-f9d6c59b0288", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.363 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Service Bus", + "MeterId": "04ab1ff5-7967-4d6f-b29e-3ffcab9e05b3", + "MeterName": "Capacity Unit", + "MeterRates": { + "0": 733.129 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Event Hubs", + "MeterTags": [], + "Unit": "Daily Units" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e66dbe6c-85cf-40a1-9351-063c5bf6a7be", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.567 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2f9a6072-fc32-4e75-8909-ac91a16febe8", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.133 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "37c8dbd7-412b-4892-a31a-915b96a66885", + "MeterName": "Standard C1 (Hours)", + "MeterRates": { + "0": 0.138 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "21d14890-136e-4ae0-b402-ee7818908a79", + "MeterName": "Standard S0 Secondary Database Days", + "MeterRates": { + "0": 0.456 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "bb20dfda-6d18-4bb1-b7fc-86a05d9cfb8d", + "MeterName": "Standard IO - Table Write Batch Operation Units (in 10,000s)", + "MeterRates": { + "0": 0.00036 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "96105def-6396-4a25-8696-732db318c750", + "MeterName": "Standard S1 Secondary Database Days", + "MeterRates": { + "0": 0.8 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "3dc510c6-0868-4fbc-98cb-2cd8db95060b", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f62b84ae-fc24-4482-9f70-9a88211dd5db", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.044 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "28685d12-2ba2-4c00-9cad-ce08f1c0068f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.12 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "CDN", + "MeterId": "6b88ada0-cbc0-4874-be0e-23004f8b4de7", + "MeterName": "Standard CDN Data Transfer - S1 (GB)", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "Zone 4", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "690adf25-1673-40d7-8117-07391d8b1b20", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.21 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f52acb67-19ab-4162-82c7-4022917c33e7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.22 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1848dff2-1a52-4723-b4c3-484f668e44cc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.425 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6cbf6bf0-2443-4a9f-9ed1-d63bef845d28", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.161 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "97059b34-33a0-45f2-977a-2c78608ba3a2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "6cb4da42-7563-489e-ab51-a65858347a61", + "MeterName": "50,000-AU-hours Commitment Tier", + "MeterRates": { + "0": 935.49 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Analytics", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "c5228804-1de6-4bd4-a61c-501d9003acc8", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SLES (20 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "993126ae-d47b-465c-8ca1-f68b2a0d2046", + "MeterName": "Unlimited Data - 5 Gbps", + "MeterRates": { + "0": 25650.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "16f78242-0606-433e-b7aa-ad08bf1f9eea", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 5.584 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A9 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "7a3b7628-9449-49fb-8c64-30a875e81254", + "MeterName": "100,000-AU-hours Commitment Tier", + "MeterRates": { + "0": 1677.42 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Analytics", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "be244c54-8aae-4fd4-a5d1-0dbda93f2772", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "2150bedf-fb47-4146-aafa-57c042744431", + "MeterName": "Standard S1 Database Days", + "MeterRates": { + "0": 1.21 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3d22ec82-227e-4c62-b083-ec96b68e1de6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.175 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "a3c8dc9a-5dde-49e3-bff4-5444dd197cfc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.059 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ebfc2fe4-eab3-4685-898b-122fc86ccf18", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.33 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "07107e05-2dbf-44d9-aedd-d7310bce1317", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.44 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "86ad736d-989d-48a4-a498-4a87626b275a", + "MeterName": "Premium P13 Secondary Geo Database Days", + "MeterRates": { + "0": 251.62 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ce906012-c444-445a-ba6f-5af4e8267a3b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.111 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a7000de2-db97-40cb-bccd-a63c76600dc1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.269 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "eee1feb4-3655-405f-9354-356c41a627cc", + "MeterName": "500,000-AU-hours Commitment Tier", + "MeterRates": { + "0": 7548.39 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Analytics", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "96558206-8bf3-43fb-9474-6d0ce733482a", + "MeterName": "Premium P4 Secondary Active Geo Database Days", + "MeterRates": { + "0": 66.43 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "97239e8b-d288-46a5-901c-3bb4556f3b2f", + "MeterName": "Premium P6 Secondary Active Geo Database Days", + "MeterRates": { + "0": 137.28 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "df9dd79b-1729-42aa-aef8-6d9f26ce5d9f", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.067 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "73b28345-781a-46a0-86cd-822df3ad6190", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4e7f9a04-6566-4216-bd0c-b35ebf0dbcee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.234 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e7f01606-3c2b-4fc0-ad9b-5228a914e289", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.088 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1bf9b643-a2f4-4a03-a0e5-2086fecfa5ca", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.944 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2ff87c86-3c0d-42e3-9b52-c89b23f98c99", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.853 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "22d87c50-5bb3-4502-a8ce-9c30daf45f7d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.459 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4a828d79-23d5-4143-9681-5ade8aa7e21a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.78 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A10 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "98fc2852-0ad8-4a09-9799-865c144578db", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.155 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D1 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "9af22389-7a72-4c7f-8295-ed0c1a370ca9", + "MeterName": "Standard C0 (Hours)", + "MeterRates": { + "0": 0.069 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "ff472be8-4a43-436e-9a80-f8c4af8700ef", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.594 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "6c248e49-2c88-40a4-80ab-d469e72b1a46", + "MeterName": "Premium Storage - Page Blob/P10 (Units)", + "MeterRates": { + "0": 17.92 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b65a815f-330a-42a9-aca9-71def78a0435", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "8a781e83-61af-4fa4-90ad-3a3067553ba7", + "MeterName": "MSFT Peering Unlimited Data 2 Gbps", + "MeterRates": { + "0": 11400.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "b4c4f6e0-5321-4feb-8c65-b054ec023c06", + "MeterName": "Basic Database Days", + "MeterRates": { + "0": 0.1819 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "15381d5f-c3ad-43c9-824b-9463db008a67", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.187 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c5eb81dd-b9a3-48be-953f-627577b6a033", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.306 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "34013683-6f3f-4b90-b235-aa579b1f2881", + "MeterName": "Standard IO - Cool Block Blob Data Retrieval (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "88aab413-fad2-42d6-b205-c881ef9c43c1", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.0576 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3aa4f34c-6290-4ccd-bbe2-4f6b0a5c9783", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e84a9ce7-0696-45e7-a826-080aefb8e985", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.081 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "0e640d75-28b9-4d06-bb9a-ec794eb17842", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.0416 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "59bc01e3-9d3e-4b9f-baef-35e696aad6c4", + "MeterName": "VNET Peering Regional Ingress (GB)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Virtual Network", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "fc7c9c41-3aa9-48fe-96a4-86457c7c9cfc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.288 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b305836a-0df4-46b3-839f-423292ca40e6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.025 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F16 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "452de456-2197-463a-b434-8d8b3cf77670", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "d65dfe7e-956d-4b2b-ac8b-da546738da01", + "MeterName": "Premium Metered Data - 100 Mbps", + "MeterRates": { + "0": 275.0 + }, + "MeterRegion": "Zone 2", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "f02890c5-0a60-4cf3-b1d5-b6b5f2a96a99", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.17 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A2 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "f246df93-e03d-4e52-ae97-a43e8f3d542c", + "MeterName": "Standard Gateway Hours", + "MeterRates": { + "0": 0.19 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Virtual Network", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "f7870069-8483-47ba-8fc6-050af76c8a85", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.061 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1bd1dec6-11ca-4e45-9160-d30d4f028011", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.671 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Recovery Services", + "MeterId": "6551548b-7e61-4f51-896e-eb907d256b95", + "MeterName": "Protected Instances", + "MeterRates": { + "0": 10.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Backup", + "MeterTags": [], + "Unit": "Instances" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "bb17ae0d-e26f-4bdc-875a-9cb6406a3ea7", + "MeterName": "Standard Apps", + "MeterRates": { + "0": 24.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Application Insights", + "MeterTags": [], + "Unit": "Apps" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "3674cb21-5cac-4e21-8a6f-dc17181a0cf8", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8f433e69-804c-4037-a1e6-462c319d0147", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.639 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "49fb871c-2c87-46a7-9127-f375831917b4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.918 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ab365613-251f-4202-8c09-8a8ffa26323e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.616 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "078d8ace-8c31-40aa-acf1-136e1bf3030d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Standard (16 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e084c594-0403-4a6c-bc3c-48322c4acac2", + "MeterName": "Basic Database Days", + "MeterRates": { + "0": 0.1932 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8ba53379-2d64-4ef7-9a39-48a71212d293", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "1e75383d-869e-41ed-9e27-a869ee3970c4", + "MeterName": "Premium Unlimited Data - 2 Gbps", + "MeterRates": { + "0": 19650.0 + }, + "MeterRegion": "Zone 3", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "47305f4d-28a4-47a9-b6d0-4d07c9b5ba90", + "MeterName": "Standard S3 Search Hour", + "MeterRates": { + "0": 3.552 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Search", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "31409cfe-275a-4e00-8a23-ecdcba10c268", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.946 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L8 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e2cedf98-2946-464b-af11-c8e9b4cce4f6", + "MeterName": "Standard IO - Cool Block Blob (GB)", + "MeterRates": { + "0": 0.04 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3f4dbc45-47d0-428d-9a9a-468ce55a0d07", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2eeb1af9-0c41-4fcb-81cb-d7130675cc6a", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 135.17 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "0245ef75-e0d0-4bdd-91d7-8d3dc3ba5dba", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "303743b6-4cd0-44df-8ec2-a93c8f14943b", + "MeterName": "Included Quantity API Transactions (in 1,000s)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Machine Learning", + "MeterTags": [], + "Unit": "1,000s" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "34b6728d-e233-4b0f-add4-e69d7f7f4005", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.043 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b5382a12-9c04-4756-9cc0-ab78acd76f2b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.156 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7c7d6a94-b6b6-4e36-adb3-1f673c7e7129", + "MeterName": "Premium P15 Secondary Active Geo Database Days", + "MeterRates": { + "0": 584.208 + }, + "MeterRegion": "JA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "ccd398f9-39d1-4b36-bfa2-fcb90bd859d6", + "MeterName": "Premium P18 Secondary Active Geo Database Days", + "MeterRates": { + "0": 511.182 + }, + "MeterRegion": "JA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "456820b1-42df-4c28-9fb9-b60f4eb234e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.256 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "57250bbd-6640-449a-82bf-4f990f98e6be", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.7 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "40f52f75-97ad-44f9-a842-239a2baf096b", + "MeterName": "Standard S0 Database Days", + "MeterRates": { + "0": 0.5323 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "684b3148-ec75-4010-90b6-8af7ebf2a1ee", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.452 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8d998c26-3749-4d5c-bc7e-cbd9e15b91d7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.616 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "12ce51cb-c2ed-43e1-8ce0-9a9cd5fdeda3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "60e04289-f16f-468f-82f8-fc5b03661f69", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.282 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "2b916213-fe52-45bb-aab5-b31027fe35ad", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 122.88 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b22e5c15-4330-4a92-805a-b9dde5e60930", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "904e7109-d9b8-4021-9827-0529957d57a7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.781 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A6 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d0b7af45-3d37-4c6d-8978-2a4f42f3fb5e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.39 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "99f0c54e-8bf7-40d5-9c2e-7ec5300c4fd8", + "MeterName": "Premium Metered Data - 50 Mbps", + "MeterRates": { + "0": 130.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7415685f-1f86-495b-b67e-72339d4d7878", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.488 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "a17966d7-bd06-489a-b50f-ee6aec448502", + "MeterName": "Premium P6 Database Days", + "MeterRates": { + "0": 132.0 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1d4ad16e-cfcd-4d5a-a170-507649bf6254", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.7 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "A9 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a1640807-64aa-4156-9f65-60ce1debb10a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.39 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "05fe7510-61d7-44fe-a925-adb8c8615688", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.939 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c3cba63e-4c34-4fed-9a89-34333b5c6800", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.0096 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "096748f0-e075-4be4-a5d8-1190e67fdd29", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.552 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d6d25058-9815-4214-af04-68ff97b0c9fa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.22 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "905b9188-6417-4097-81f9-a4381dd1550b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.92 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "4965021d-2599-4bd4-84d5-6cf2996826bd", + "MeterName": "Standard S1 Secondary Active Geo Database Days", + "MeterRates": { + "0": 1.107 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cda73cca-973a-4b06-8b47-8aaf63759965", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.0091 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "8742cbe9-6b7e-42fc-b35d-b8b4ee447de1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.6 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_NC24 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f3801402-49c4-4fda-97fa-b85eb7d8d4b6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.05 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "da6c4d55-5c6a-4fd2-960c-d604769542b7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.61 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_H8 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "32407022-8eb1-44f9-8a92-4b934ada0764", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2696 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ebc92ae4-5845-45c3-a08c-ef0aeb80067c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.19 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "f67c233d-9c4c-4bf9-948c-d116bb5eed1e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9ae3d375-b492-4ce9-b67f-1985b8f09a68", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.581 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "1c0f0b94-5be9-486b-98fa-d942bc9ecdad", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.443 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e6921fa7-82ca-4cee-a3c8-5f21627e9879", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "e20f4ed0-67d3-431d-a4c8-6e0d878a81a1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.533 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "b9fd285b-fa40-4954-ab77-56b6a1c4eeea", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.0025 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "8b3daac0-33bd-4989-98bf-dfb96839840b", + "MeterName": "Premium Large App Service Hours", + "MeterRates": { + "0": 1.512 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "63172e00-4760-4ba9-babf-2c3618368139", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "e80b9379-508f-4856-851a-45851532059a", + "MeterName": "Standard IO - Cool Block Blob Data Write (GB)", + "MeterRates": { + "0": 0.005 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d80d13ad-7410-4d23-b0e7-2dd24c589ace", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.366 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "fba86e55-b774-478a-aca9-f156cf2f3e71", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.357 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a68f49a8-9e88-48cd-ab70-a50b2a3e3c9c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "499bf0ad-ec99-49d4-8214-553645f4f28d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.345 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2152edcd-a901-4759-ad65-8728589937c4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.275 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "945fa653-08e4-48e4-bfc5-872424ea629c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.3 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "bc4fc736-2274-4796-979b-8e63807425c2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.56 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "ef010b9a-4b5e-42af-bd11-1b7960dfbc29", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.248 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7ad5d268-d6b1-4dec-ab20-79eada91d6f9", + "MeterName": "Basic Elastic Database Existence", + "MeterRates": { + "0": 0.0167 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "e8299206-0fbe-477a-b3e5-a88bce95d152", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.276 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f2dfc7a6-d31d-43c3-9dc4-27365cde7b0e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 8.14 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f1aa70d9-1880-43d3-8eef-a66921c5a0ec", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.447 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "db5cd96a-4852-4e0b-94e5-5c915d9c1879", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.173 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A10 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ec91e985-a405-45ec-9032-bb4429484b8c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.133 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f32a896b-2d51-45c7-b75c-b8558e39be32", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.617 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "585a4f17-51ed-4304-8a1e-ac7355815cd8", + "MeterName": "Premium P15 Secondary Active Geo Database Days", + "MeterRates": { + "0": 590.4457 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f2ef9574-2073-43e9-9264-840ec46532a2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.457 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "61ffdc30-4ff5-4bc5-941d-c09b5048ae48", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.159 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "03e1ae28-ea98-4c53-aa7e-0f47c6e2e7be", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.0092 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "16336d11-4cef-4d26-a3f5-43b7ffa896d8", + "MeterName": "Metered Data - 50 Mbps", + "MeterRates": { + "0": 55.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "Connections" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "e2613a8a-62a3-4bb2-9558-c51db8294b0f", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "98638d0f-6448-4aff-9228-118a0f6c1fa3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.665 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "5a5be520-1a9f-4f13-8e0d-bc4aad63d41f", + "MeterName": "Users", + "MeterRates": { + "0": 1.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Data Catalog", + "MeterTags": [], + "Unit": "1 User" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3f69a91d-5169-4657-9a63-60ae3269ac46", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.099 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2cc19612-cf8a-4c19-90f7-390512f2b378", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.188 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0e77ab82-88a5-4351-a87a-c196e46fb84b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.41 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A7 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "6773b871-0d96-4d04-9932-073d74096a14", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.298 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "0ef7d1ea-e461-4881-9b57-c6e29384d711", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dd1b1b44-7155-468f-8677-31bc1f39b1f9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.146 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 5.0, + "MeterCategory": "Business Analytics", + "MeterId": "2acc87fb-e9e1-42a6-a8ec-4d92598b7367", + "MeterName": "Low Frequency On Premises Activity", + "MeterRates": { + "0": 1.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Factory", + "MeterTags": [], + "Unit": "Activities" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "4082fa20-19d0-4388-b91e-a8150bc6ad4d", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-08-02T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cache", + "MeterId": "5fb13099-4de0-419d-9fb8-4aef0cf575b1", + "MeterName": "Standard C5 (Hours)", + "MeterRates": { + "0": 1.313 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "Azure Redis Cache", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5cc745aa-756c-4d5f-a45c-d80ae3d24bdd", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 8.78 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "067023b9-5c2b-428e-a4f7-f13e655f5e10", + "MeterName": "Data Transfer In (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "Zone 1", + "MeterStatus": "Active", + "MeterSubCategory": "ExpressRoute", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7f283d9e-e6e0-439a-aa11-7629ca78cae4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.995 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6bba4748-99f7-46d9-9b18-a41275c0d97c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.891 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L16 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c323c94a-ccd3-4dc5-82a7-c1e18dd1913a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.322 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "65dda5ab-c6a3-4e8d-8dad-1bdd67947927", + "MeterName": "Standard IO - Cool Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Visual Studio", + "MeterId": "378eb4e8-8d82-46ee-aacb-460e00002b4f", + "MeterName": "Standard Overage Data Points (1M)", + "MeterRates": { + "0": 1.75 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Application Insights", + "MeterTags": [], + "Unit": "1M Data Points" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Identity", + "MeterId": "5ebd8165-26c0-4d5e-8444-155121adc72b", + "MeterName": "S1 Domain Services (Hours)", + "MeterRates": { + "0": 0.15 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Active Directory Domain Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ef52f6ad-a301-4dba-a43e-48e8e45f176a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.2696 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM (Windows)", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "60596994-ce9c-470c-a8ee-853b694a3037", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.222 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c0536b57-709b-4f22-9250-6b7e57523e19", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.078 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "204dae38-a8b9-4c6a-91ba-9d4d4472295d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2415f8f4-90a8-409f-bdcf-23c0a2969717", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.449 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A4 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "57e6ef6c-9915-4a73-ba80-b19491aed497", + "MeterName": "Standard S0 Secondary Active Geo Database Days", + "MeterRates": { + "0": 0.4839 + }, + "MeterRegion": "JA West", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cc48b523-5c6d-4ed9-a56b-21b1c9209e4b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.584 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "8cda1ae6-8888-4024-b1f4-bcdb0af88739", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.144 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "5500ea5d-925f-4aca-a6f5-6055ef5ef662", + "MeterName": "Premium Large App Service Hours", + "MeterRates": { + "0": 1.512 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 40960.0, + "MeterCategory": "Networking", + "MeterId": "acac7492-1c40-4088-bf01-40d582b85b63", + "MeterName": "Data Processed (GB)", + "MeterRates": { + "0": 0.0035 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Large)", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a7ecea5a-5bff-4861-9c2b-8f6f6888c6e0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.27 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "ca2d160f-694a-4ff4-bb15-bffaad99af9e", + "MeterName": "Geo-Replicated Data Transfer (GB)", + "MeterRates": { + "0": 0.02 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4186f61c-b5c0-4c1b-9820-56250933b9f0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.255 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2m_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "38e85549-aba3-494a-9829-9b5309a2ab16", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "35664b4e-f7a5-457b-b60e-eff0015f2cdb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A0 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "a4b3fde1-3fa6-476d-ac12-36af7cf416d2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.622 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d6885952-e050-4907-b240-8b1b3dd2a52c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "4140440b-610d-4d33-9530-9462155b920f", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.028 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "fb38caa1-2aa6-4a4c-8c0d-b04ff1bb0669", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.323 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "7adc6db5-d01d-4400-b10b-156a95de4738", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.794 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "A11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9f0edb03-a2ad-4d5a-a211-d2fccb638ded", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.34 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_G2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "76480596-7ad0-4efc-afac-f95e1bbc0e30", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Database Enterprise and Weblogic Server Enterprise (16 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "085dc9ee-005d-4075-ac11-822ccde9e8f6", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.48 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "SLES (24 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "eb71a1ca-a317-41bf-b8c8-15b9fad365ad", + "MeterName": "Premium Medium App Service Hours", + "MeterRates": { + "0": 0.75 + }, + "MeterRegion": "UK West", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6b974c36-56fa-41ab-b3ed-b8ca3d3ea33a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.133 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "160cd7d1-5e79-48f6-938a-8daca7717323", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.536 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "22a3461c-d980-48ba-ad80-9e16761ec7a5", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.995 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "f7caafcd-8df6-46d1-98c7-77d962316fe7", + "MeterName": "Data transfer - Geo-Replication (GB)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "4eb56078-50d1-4fa2-9867-c4b7c6173d20", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.1256 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L4 VM", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "75eb68fb-f31d-440b-b1b7-72beee9f709c", + "MeterName": "Premium P6 Secondary Active Geo Database Days", + "MeterRates": { + "0": 132.0 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "560c52dc-c267-4416-a290-a89289d58490", + "MeterName": "Premium P13 Secondary Active Geo Database Days", + "MeterRates": { + "0": 354.84 + }, + "MeterRegion": "CA East", + "MeterStatus": "Deprecated", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fc680266-4c2a-49b7-bfe4-901e496bf68a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.12 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8858a39b-007c-4ef7-aff1-53a36ba6dca2", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.41 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "7a3b96e3-1c68-4506-86d8-224b89b3347f", + "MeterName": "Premium Medium App Service Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "c3f976e0-7f7d-4ecd-b858-96c16c0169fa", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.23 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "bd1097ad-f37c-43a9-9774-a61c1d4d8711", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.746 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D3 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "fb8386fc-29c3-4203-973b-8a7bd78b0a05", + "MeterName": "Standard IO - Files (GB)", + "MeterRates": { + "0": 0.11 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2c6d0271-97a7-4945-8847-0aab5f73ab3e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.075 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D15_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-02-11T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "48994c38-10f8-4861-90e2-743bf7121c37", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.018 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c8556bb9-c013-498b-95f0-5740bef731ba", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.08 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "336457ad-03aa-4405-9a96-f1dde25e5cfb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.355 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "16e8b048-23d3-48c3-bd9d-4953466cd84d", + "MeterName": "Standard IO - Hot Block Blob (GB)", + "MeterRates": { + "0": 0.048 + }, + "MeterRegion": "US West Central", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "efae3eca-ee16-4095-800d-e712456bc886", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.702 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "62e5583c-5b2c-4032-8ff1-0b31c8d53023", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.456 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "D11 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "29085ce9-61ec-4e9e-a13d-10bba4ae03d7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.14 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "9e4ccbd2-f157-4a20-8ba6-be70e33eb488", + "MeterName": "Standard S2 Secondary Database Days", + "MeterRates": { + "0": 1.991 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "f63c87f9-6ff4-4aee-bbfd-39b337729cdc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.137 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5ccba2b7-0734-4693-8cd1-2bcc8ae1110c", + "MeterName": "Standard S1 Database Days", + "MeterRates": { + "0": 1.21 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d09f877e-03b4-48b2-b11a-782b965cff19", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.13 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Red Hat Enterprise Linux (20 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0688e907-64a4-45c5-9c42-4a3224219a03", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.708 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "741a12b4-7c9e-4362-9a7c-f826f7427054", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.441 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A4m_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "248ab64b-28be-401b-b4bb-ae02cda1c810", + "MeterName": "Basic Small App Service Hours", + "MeterRates": { + "0": 0.0885 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bd3cb0fa-3e81-4e5d-a517-a7f0c67de5d7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.72 + }, + "MeterRegion": "AP East", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Linux Support", + "MeterId": "bb21066f-fe46-46d3-8006-b326b1663e52", + "MeterName": "Premium VM Support Hours", + "MeterRates": { + "0": 0.32 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "A9 SLES", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Networking", + "MeterId": "56501055-e134-4cf2-baa5-19f3703d0b2a", + "MeterName": "Application Gateway Hours", + "MeterRates": { + "0": 0.027 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "Basic Application Gateway (Small)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bbee8f6b-f17d-405b-8269-d7214d3acb21", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.575 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "8eac41f4-00e2-4bf6-b605-5adfe00dc28a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.575 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ddfd2072-6a5a-41bf-bdc6-f2be3ab6a283", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.433 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Identity", + "MeterId": "d148a09e-07a5-4e98-89b3-a10fe304be30", + "MeterName": "S2 Domain Services (Hours)", + "MeterRates": { + "0": 0.4 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Active Directory Domain Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "7a1f4266-4be6-4b5d-bc69-dac76f15fa55", + "MeterName": "Premium P11 Secondary Geo Database Days", + "MeterRates": { + "0": 186.3 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "74c51fe2-14af-471c-9589-10074198ae4c", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 67.59 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "6446f0b9-46ca-445b-8ee6-a1f925bccb5e", + "MeterName": "Standard IO - Cool Block Blob Read Operations (in 10,000s)", + "MeterRates": { + "0": 0.01 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1edf624d-028f-4945-a3ea-244e65afd0b7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.19 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "9f491c66-b113-4aa3-8847-a02daae3f6f4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.659 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D14 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "c0394e55-83aa-4bc6-9bb8-0df26714d2e9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.113 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-06-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure IoT Hub", + "MeterId": "b42f9a44-d1d2-4792-bc98-fdaa614bdeac", + "MeterName": "S3 (Units)", + "MeterRates": { + "0": 5000.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "aa269bda-859a-470f-ab46-3554f72a6287", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.478 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "D13 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "028f1bb2-4b88-4a92-937b-0721ccbab1a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.33 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6d2100f0-e28a-4f20-a5a5-ebb7b8521477", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.374 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A5 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "cef301fd-47c0-4d4e-b6cf-3eecf67ed8bb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.21 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D11 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "e80bd6e2-731d-4e39-92cf-06482af38e4a", + "MeterName": "S2 DocumentDB Hours", + "MeterRates": { + "0": 0.067 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "2e988a1e-9fbf-4406-be8a-4029925adcb0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.095 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "58d279ea-4aa3-49d8-b458-a4e2a8ad466c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.221 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Media", + "MeterId": "b0d6a4e5-da22-44a4-94bd-3648fb427e13", + "MeterName": "PlayReady Licenses (in 100s)", + "MeterRates": { + "0": 0.2 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Media Services", + "MeterTags": [], + "Unit": "100 Licenses" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "fb32496d-55e3-439c-bb9b-6ad853342d54", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.299 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "d4c29129-7523-447e-be06-ae1a1835bbd4", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.68 + }, + "MeterRegion": "AP Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "36b36c0f-f834-413e-a801-3a724659b49f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.101 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "A1 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cognitive Services", + "MeterId": "8d892860-f58e-4ee4-b54e-902928c9da5c", + "MeterName": "Standard S3 Overage (in 1,000s)", + "MeterRates": { + "0": 0.5 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Text Analytics", + "MeterTags": [], + "Unit": "1,000 Transactions" + }, + { + "EffectiveDate": "2016-03-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "be5fd77f-e2dc-424f-bb67-0b5363a1f8b3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.08 + }, + "MeterRegion": "US West 2", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D5_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "3cb550c8-1f2b-4912-b765-544c2754a90a", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.065 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "5bef5b01-8fc6-444e-ad53-fc6f04eadc6b", + "MeterName": "100 Request Units (Hours)", + "MeterRates": { + "0": 0.008 + }, + "MeterRegion": "EU North", + "MeterStatus": "Active", + "MeterSubCategory": "DocumentDB", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "cfc04eb4-da44-457c-89e9-6547186c2408", + "MeterName": "DWU", + "MeterRates": { + "0": 1.6936 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-30T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bb4decef-9eba-40b8-90ea-ee6de30a7b6b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Oracle Weblogic Server Standard (32 core)", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "ad1bd262-83bc-41aa-a7c9-8a5fbe3b626a", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.119 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "2a9b748d-198a-4bce-8802-0888060ec9f1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.54 + }, + "MeterRegion": "AU Southeast", + "MeterStatus": "Active", + "MeterSubCategory": "D4 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e19f265b-d4ee-4a59-826d-99a5a0d6e72c", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.164 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "A7 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f3f8d7ca-ff5e-4291-b96e-31824105973a", + "MeterName": "Premium P1 Database Days", + "MeterRates": { + "0": 16.5 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "cc6f7131-74ac-4feb-ac28-f514b32abd40", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.398 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "153c9c37-2689-4299-be94-56a542698dc9", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 10.1568 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_L32 Cloud Services", + "MeterTags": [], + "Unit": "1 Hour" + }, + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "980b4362-5f37-4932-a3e3-a3ff8ee308f1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.176 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "BASIC.A3 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "dc2f8c69-3f2c-4001-8ce4-e6534bab9085", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D13_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "bdce8a99-d717-43f0-b77e-8e70da8abb8f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.4 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "BizTalk Server Standard (20 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2014-04-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c7c7fad9-875d-472e-afe6-90a776e93273", + "MeterName": "Premium P6 Database Days", + "MeterRates": { + "0": 135.6 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "395e9151-35ad-4920-9b7e-d23b1fb29ddb", + "MeterName": "1,000-AU-hours Commitment Tier", + "MeterRates": { + "0": 25.81 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Lake Analytics", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1ee544b4-d008-4f33-992f-4158003126c0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.176 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "2b9e6ef0-6519-4fe6-9ec1-5fddc4e038a3", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.35 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "fcdb50f8-69e6-4461-9ca6-bd7cfc7bb919", + "MeterName": "Premium Storage - Page Blob/P30 (Units)", + "MeterRates": { + "0": 147.456 + }, + "MeterRegion": "CA Central", + "MeterStatus": "Active", + "MeterSubCategory": "Locally Redundant", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Management", + "MeterId": "830aab6c-b809-4ce2-8556-2adc72b0ddd5", + "MeterName": "Standard IO - Hot Block Blob Write Operations (in 10,000s)", + "MeterRates": { + "0": 0.1 + }, + "MeterRegion": "US East 2", + "MeterStatus": "Active", + "MeterSubCategory": "Geo Redundant", + "MeterTags": [], + "Unit": "10,000s" + }, + { + "EffectiveDate": "2013-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "e65abadc-5a30-4aba-b014-f1ee54bf4bf6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.06 + }, + "MeterRegion": "US East", + "MeterStatus": "Active", + "MeterSubCategory": "A1 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "03e1858a-3870-4604-b596-5b9770c3688e", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.443 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A5 HDInsight", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "62c66f65-0bc1-4e66-b98f-b2df055a45d1", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 2.447 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D14_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "9c5e4df1-6e31-448c-8470-08f7cdd08d4f", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.459 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_F4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-22T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "a896844e-46ea-4f97-a782-34db7f307e18", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 3.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MSFT R Server for Linux (8 core)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "1fd67ea9-ba92-4f3c-a3eb-2b7a0d151c07", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.022 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A0 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "f7654217-eaf6-4563-800a-ba3c03be1f94", + "MeterName": "Standard Elastic DTU Pack", + "MeterRates": { + "0": 0.0798 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2014-05-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "5f5ce76f-fced-40b5-9f30-b9a8acdd99e0", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.562 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "b5c4a1dc-aa2d-47b9-bde4-a0552a9303b7", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "0222c4ce-52e6-486e-a370-9b615a0e4361", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.822 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "D12 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "774a37b6-5e00-455c-b4bc-fe4d738bfeba", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.6 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A8_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-08-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "b4a51469-59bc-4c18-8257-b19b842e4150", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.379 + }, + "MeterRegion": "IN South", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "074c3623-419a-48c0-9453-7430ade501b6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.839 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4_v2 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "0001-01-01T00:00:00", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "c63c9359-a1a9-40d4-a878-5190485648b3", + "MeterName": "Standard MS3 Database (Hours)", + "MeterRates": { + "0": 0.0 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "MySQL Database on Azure", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-05-04T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "50b2951b-45e8-4aae-8aa8-daba9d4ff0c6", + "MeterName": "Premium P18 Secondary Geo Database Days", + "MeterRates": { + "0": 383.404 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Database", + "MeterTags": [], + "Unit": "Days" + }, + { + "EffectiveDate": "2015-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "844e6b74-425f-4e72-a98c-7a424bd7d41d", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.944 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "A6 HDInsight (Non-Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "32749b8d-4029-43d7-9027-d917b1680607", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.28 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "85373a0c-6ece-41bd-8d07-34477114df1b", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.449 + }, + "MeterRegion": "EU West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12 VM", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Azure App Service", + "MeterId": "098d5dab-fbc6-44bf-ace3-3bb399658cee", + "MeterName": "Premium Small App Service Hours", + "MeterRates": { + "0": 0.378 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2013-12-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "fe6418a1-ea5e-48b6-8728-63fa1e156695", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.594 + }, + "MeterRegion": "JA West", + "MeterStatus": "Active", + "MeterSubCategory": "A7 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-03-25T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Storage", + "MeterId": "e2479b74-a48f-43f9-b1ce-f176d5900aad", + "MeterName": "Standard IO - Queue (GB)", + "MeterRates": { + "0": 0.132 + }, + "MeterRegion": "CA East", + "MeterStatus": "Active", + "MeterSubCategory": "Read-Access Geo Redundant", + "MeterTags": [], + "Unit": "GB" + }, + { + "EffectiveDate": "2016-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Data Services", + "MeterId": "46a9341f-64e4-4601-a22c-33669b243676", + "MeterName": "DWU", + "MeterRates": { + "0": 2.4194 + }, + "MeterRegion": "BR South", + "MeterStatus": "Active", + "MeterSubCategory": "SQL Data Warehouse", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "9c757631-cc2a-4087-a522-ce951fffbe49", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.26 + }, + "MeterRegion": "US South Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D2_v2 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-10-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Cloud Services", + "MeterId": "cfc14ce6-3709-4415-bc3a-e80560a1c4d6", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 1.248 + }, + "MeterRegion": "AU East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D4 Cloud Services", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-09-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "041b9704-e167-440e-98d6-fdc6fafc8493", + "MeterName": "Premium Managed Disk/P30 (Units)", + "MeterRates": { + "0": 67.59 + }, + "MeterRegion": "IN Central", + "MeterStatus": "Active", + "MeterSubCategory": "HDInsight Storage", + "MeterTags": [], + "Unit": "Units" + }, + { + "EffectiveDate": "2016-09-07T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "ed50efb6-6057-4d51-9a12-55c6d77aafbc", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.792 + }, + "MeterRegion": "UK South", + "MeterStatus": "Active", + "MeterSubCategory": "A4 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "15edb42b-9b5f-44e9-bf0c-1d19b1eb8cec", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.652 + }, + "MeterRegion": "US North Central", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D12_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-02-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "14f1872f-2861-4df2-a649-42bd849935cb", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.168 + }, + "MeterRegion": "JA East", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_D1_v2 VM (Windows)", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2015-07-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Business Analytics", + "MeterId": "564fa413-2705-4df8-bff8-128084de21b6", + "MeterName": "Data Movement Cloud", + "MeterRates": { + "0": 0.25 + }, + "MeterRegion": "", + "MeterStatus": "Active", + "MeterSubCategory": "Data Factory", + "MeterTags": [], + "Unit": "Hours" + }, + { + "EffectiveDate": "2016-11-01T00:00:00Z", + "IncludedQuantity": 0.0, + "MeterCategory": "Virtual Machines", + "MeterId": "6b660c58-a5f3-434a-8fe4-c9981b178c35", + "MeterName": "Compute Hours", + "MeterRates": { + "0": 0.091 + }, + "MeterRegion": "US West", + "MeterStatus": "Active", + "MeterSubCategory": "Standard_A2_v2 VM", + "MeterTags": [], + "Unit": "Hours" + } + ], + "OfferTerms": [ + { + "EffectiveDate": "2015-01-01T00:00:00Z", + "ExcludedMeterIds": [], + "Name": "Monetary Commitment", + "TieredDiscount": { + "6000": 0.05 + } + } + ] +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute.json new file mode 100644 index 0000000000..f0bbae5f34 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute.json @@ -0,0 +1,200 @@ +{ + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/providers/Microsoft.Compute", + "namespace": "Microsoft.Compute", + "resourceTypes": [ + { + "resourceType": "availabilitySets", + "locations": [ + "East US", + "East US 2", + "West US", + "Central US", + "South Central US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West" + ], + "apiVersions": [ + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ] + }, + { + "resourceType": "virtualMachines", + "locations": [ + "East US", + "East US 2", + "West US", + "Central US", + "South Central US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West" + ], + "apiVersions": [ + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ] + }, + { + "resourceType": "virtualMachines/extensions", + "locations": [ + "East US", + "East US 2", + "West US", + "Central US", + "South Central US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West" + ], + "apiVersions": [ + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ] + }, + { + "resourceType": "virtualMachines/diagnosticSettings", + "locations": [ + "East US", + "East US 2", + "West US", + "Central US", + "South Central US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West" + ], + "apiVersions": [ + "2014-04-01" + ] + }, + { + "resourceType": "virtualMachines/metricDefinitions", + "locations": [ + "East US", + "East US 2", + "West US", + "Central US", + "South Central US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West" + ], + "apiVersions": [ + "2014-04-01" + ] + }, + { + "resourceType": "locations", + "locations": [], + "apiVersions": [ + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ] + }, + { + "resourceType": "locations/operations", + "locations": [ + "East US", + "East US 2", + "West US", + "Central US", + "South Central US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West" + ], + "apiVersions": [ + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ] + }, + { + "resourceType": "locations/vmSizes", + "locations": [ + "East US", + "East US 2", + "West US", + "Central US", + "South Central US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West" + ], + "apiVersions": [ + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ] + }, + { + "resourceType": "locations/usages", + "locations": [ + "East US", + "East US 2", + "West US", + "Central US", + "South Central US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West" + ], + "apiVersions": [ + "2015-06-15", + "2015-05-01-preview", + "2014-12-01-preview" + ] + }, + { + "resourceType": "locations/publishers", + "locations": [ + "East US", + "East US 2", + "West US", + "Central US", + "South Central US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West" + ], + "apiVersions": [ + "2015-06-15", + "2015-05-01-preview" + ] + } + ], + "registrationState": "Registered" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_disks.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_disks.json new file mode 100644 index 0000000000..c2466f2e9d --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_disks.json @@ -0,0 +1,78 @@ +{ + "value": [ + { + "properties": { + "osType": "Linux", + "creationData": { + "createOption": "FromImage", + "imageReference": { + "id": "/Subscriptions/99999999-9999-9999-9999-999999999999/Providers/Microsoft.Compute/Locations/eastus/Publishers/OpenLogic/ArtifactTypes/VMImage/Offers/CentOS/Skus/7.3/Versions/latest" + } + }, + "diskSizeGB": 31, + "timeCreated": "2017-03-09T10:12:37.0256203+00:00", + "ownerId": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/REVIZOR/providers/Microsoft.Compute/virtualMachines/test-vm-1", + "provisioningState": "Succeeded", + "diskState": "Attached" + }, + "sku": { + "name": "Standard_LRS", + "tier": "Standard" + }, + "type": "Microsoft.Compute/disks", + "location": "eastus", + "tags": {}, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/test-disk-1", + "name": "test-disk-1", + "zones": ["1", "2", "3"] + }, + { + "properties": { + "osType": "Linux", + "creationData": { + "createOption": "FromImage", + "imageReference": { + "id": "/Subscriptions/99999999-9999-9999-9999-999999999999/Providers/Microsoft.Compute/Locations/eastus/Publishers/OpenLogic/ArtifactTypes/VMImage/Offers/CentOS/Skus/7.3/Versions/latest" + } + }, + "diskSizeGB": 31, + "timeCreated": "2017-03-09T11:40:37.092158+00:00", + "provisioningState": "Updating", + "diskState": "Unattached" + }, + "sku": { + "name": "Standard_LRS", + "tier": "Standard" + }, + "type": "Microsoft.Compute/disks", + "location": "eastus", + "tags": {}, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/test-disk-2", + "name": "test-disk-2", + "zones": ["1", "2", "3"] + }, + { + "properties": { + "osType": "Linux", + "creationData": { + "createOption": "Empty" + }, + "diskSizeGB": 10, + "timeCreated": "2017-03-09T10:08:42.6418313+00:00", + "provisioningState": "Succeeded", + "diskState": "Unattached" + }, + "sku": { + "name": "Standard_LRS", + "tier": "Standard" + }, + "type": "Microsoft.Compute/disks", + "location": "eastus", + "tags": {}, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/111111/providers/Microsoft.Compute/disks/test-disk-3", + "name": "test-disk-3", + "zones": ["1", "2", "3"] + } + ], + "nextLink": "https://management.azure.com:443/subscriptions/99999999-9999-9999-9999-999999999999/providers/Microsoft.Compute/disks?api-version=2018-06-01&$skiptoken=1!/Subscriptions/99999999-9999-9999-9999-999999999999/ResourceGroups/000000/Disks/test-disk-4" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_disks_1.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_disks_1.json new file mode 100644 index 0000000000..abe8380f8e --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_disks_1.json @@ -0,0 +1,30 @@ +{ + "value": [ + { + "properties": { + "osType": "Linux", + "creationData": { + "createOption": "FromImage", + "imageReference": { + "id": "/Subscriptions/99999999-9999-9999-9999-999999999999/Providers/Microsoft.Compute/Locations/eastus/Publishers/OpenLogic/ArtifactTypes/VMImage/Offers/CentOS/Skus/7.3/Versions/latest" + } + }, + "diskSizeGB": 1500, + "timeCreated": "2017-03-09T10:12:37.0256203+00:00", + "ownerId": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/REVIZOR/providers/Microsoft.Compute/virtualMachines/test-vm-2", + "provisioningState": "Succeeded", + "diskState": "Attached" + }, + "sku": { + "name": "Standard_LRS", + "tier": "Standard" + }, + "type": "Microsoft.Compute/disks", + "location": "eastus", + "tags": {}, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/test-disk-4", + "name": "test-disk-4", + "zones": ["1", "2", "3"] + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_disks_PAGINATION_INFINITE_LOOP.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_disks_PAGINATION_INFINITE_LOOP.json new file mode 100644 index 0000000000..7e1833d98e --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_disks_PAGINATION_INFINITE_LOOP.json @@ -0,0 +1,31 @@ +{ + "value": [ + { + "properties": { + "osType": "Linux", + "creationData": { + "createOption": "FromImage", + "imageReference": { + "id": "/Subscriptions/99999999-9999-9999-9999-999999999999/Providers/Microsoft.Compute/Locations/eastus/Publishers/OpenLogic/ArtifactTypes/VMImage/Offers/CentOS/Skus/7.3/Versions/latest" + } + }, + "diskSizeGB": 1500, + "timeCreated": "2017-03-09T10:12:37.0256203+00:00", + "ownerId": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/REVIZOR/providers/Microsoft.Compute/virtualMachines/test-vm-2", + "provisioningState": "Succeeded", + "diskState": "Attached" + }, + "sku": { + "name": "Standard_LRS", + "tier": "Standard" + }, + "type": "Microsoft.Compute/disks", + "location": "eastus", + "tags": {}, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/test-disk-4", + "name": "test-disk-4", + "zones": ["1", "2", "3"] + } + ], + "nextLink": "https://management.azure.com:443/subscriptions/99999999-9999-9999-9999-999999999999/providers/Microsoft.Compute/disks?api-version=2021-11-01&$skiptoken=1!/Subscriptions/99999999-9999-9999-9999-999999999999/ResourceGroups/000000/VMs/DDFEBF64-E92B-4A50-9949-6E44BFC61D4G" +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_locations_eastus_vmSizes.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_locations_eastus_vmSizes.json new file mode 100644 index 0000000000..4d5a2576d3 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_locations_eastus_vmSizes.json @@ -0,0 +1,28 @@ +{ + "value": [ + { + "name": "Standard_A0", + "numberOfCores": 1, + "osDiskSizeInMB": 1047552, + "resourceDiskSizeInMB": 20480, + "memoryInMB": 768, + "maxDataDiskCount": 1 + }, + { + "name": "Standard_A1", + "numberOfCores": 1, + "osDiskSizeInMB": 1047552, + "resourceDiskSizeInMB": 71680, + "memoryInMB": 1792, + "maxDataDiskCount": 2 + }, + { + "name": "Standard_A2", + "numberOfCores": 2, + "osDiskSizeInMB": 1047552, + "resourceDiskSizeInMB": 138240, + "memoryInMB": 3584, + "maxDataDiskCount": 4 + } + ] +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_snapshots.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_snapshots.json new file mode 100644 index 0000000000..8fe42b283a --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_snapshots.json @@ -0,0 +1,75 @@ +{ + "value": [ + { + "properties": { + "accountType": "Standard_LRS", + "creationData": { + "createOption": "Copy", + "sourceUri": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/test-disk-1" + }, + "diskSizeGB": 1, + "timeCreated": "2017-03-09T14:28:27.8655868+00:00", + "provisioningState": "Creating", + "diskState": "Unattached" + }, + "type": "Microsoft.Compute/snapshots", + "location": "eastus", + "tags": { + "test_snap": "test" + }, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/snapshots/test-snap-1", + "name": "test-snap-1" + }, + { + "properties": { + "accountType": "Standard_LRS", + "creationData": { + "createOption": "Copy", + "sourceUri": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/test-disk-2" + }, + "diskSizeGB": 2, + "timeCreated": "2017-02-02T17:52:40.2213321+00:00", + "provisioningState": "Updating", + "diskState": "Unattached" + }, + "type": "Microsoft.Compute/snapshots", + "location": "eastus", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/snapshots/test-snap-2", + "name": "test-snap-2" + }, + { + "properties": { + "accountType": "Standard_LRS", + "creationData": { + "createOption": "Copy", + "sourceUri": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/111111/providers/Microsoft.Compute/disks/test-disk-3" + }, + "diskSizeGB": 2, + "timeCreated": "2017-02-02T17:52:44.4557501+00:00", + "provisioningState": "Failed", + "diskState": "Unattached" + }, + "type": "Microsoft.Compute/snapshots", + "location": "eastus", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/111111/providers/Microsoft.Compute/snapshots/test-snap-3", + "name": "test-snap-3" + }, + { + "properties": { + "accountType": "Standard_LRS", + "creationData": { + "createOption": "Copy", + "sourceUri": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/111111/providers/Microsoft.Compute/disks/test-disk-4" + }, + "diskSizeGB": 2, + "timeCreated": "2017-02-02T17:52:50.0027361+00:00", + "provisioningState": "Failed", + "diskState": "Unattached" + }, + "type": "Microsoft.Compute/snapshots", + "location": "eastus", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/111111/providers/Microsoft.Compute/snapshots/test-snap-4", + "name": "test-snap-4" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_virtualMachines.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_virtualMachines.json new file mode 100644 index 0000000000..4c40f57cd6 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_virtualMachines.json @@ -0,0 +1,57 @@ +{ + "value": [ + { + "properties": { + "vmId": "CCEEBF63-E92B-4A50-9949-6E44BFC61D3F", + "additionalCapabilities": { + "ultraSSDEnabled": "False", + "hibernationEnabled": "False" + }, + "hardwareProfile": { + "vmSize": "Standard_A1" + }, + "storageProfile": { + "imageReference": { + "publisher": "OpenLogic", + "offer": "CentOS", + "sku": "7.3", + "version": "latest" + }, + "osDisk": { + "osType": "Linux", + "name": "test-node-disk-1", + "createOption": "FromImage", + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "Standard_LRS", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/test-node-disk-1" + } + }, + "dataDisks": [] + }, + "osProfile": { + "computerName": "test-node-1", + "adminUsername": "user", + "linuxConfiguration": { + "disablePasswordAuthentication": false + }, + "secrets": [] + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Network/networkInterfaces/test-node-1-nic" + } + ] + }, + "provisioningState": "Running" + }, + "type": "Microsoft.Compute/virtualMachines", + "location": "eastus", + "tags": {}, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/virtualMachines/test-node-1", + "name": "test-node-1" + } + ], + "nextLink": "https://management.azure.com:443/subscriptions/99999999-9999-9999-9999-999999999999/providers/Microsoft.Compute/virtualMachines?api-version=2021-11-01&$skiptoken=1!/Subscriptions/99999999-9999-9999-9999-999999999999/ResourceGroups/000000/VMs/DDFEBF64-E92B-4A50-9949-6E44BFC61D4G" +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_virtualMachines_1.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_virtualMachines_1.json new file mode 100644 index 0000000000..1b63cd9525 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_virtualMachines_1.json @@ -0,0 +1,56 @@ +{ + "value": [ + { + "properties": { + "vmId": "DDFEBF64-E92B-4A50-9949-6E44BFC61D4G", + "additionalCapabilities": { + "ultraSSDEnabled": "False", + "hibernationEnabled": "False" + }, + "hardwareProfile": { + "vmSize": "Standard_A1" + }, + "storageProfile": { + "imageReference": { + "publisher": "OpenLogic", + "offer": "CentOS", + "sku": "7.3", + "version": "latest" + }, + "osDisk": { + "osType": "Linux", + "name": "test-node-disk-1", + "createOption": "FromImage", + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "Standard_LRS", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/test-node-disk-2" + } + }, + "dataDisks": [] + }, + "osProfile": { + "computerName": "test-node-2", + "adminUsername": "user", + "linuxConfiguration": { + "disablePasswordAuthentication": false + }, + "secrets": [] + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Network/networkInterfaces/test-node-2-nic" + } + ] + }, + "provisioningState": "Running" + }, + "type": "Microsoft.Compute/virtualMachines", + "location": "eastus", + "tags": {}, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/virtualMachines/test-node-2", + "name": "test-node-2" + } + ] +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_virtualMachines_PAGINATION_INFINITE_LOOP.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_virtualMachines_PAGINATION_INFINITE_LOOP.json new file mode 100644 index 0000000000..8c9e9135d8 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Compute_virtualMachines_PAGINATION_INFINITE_LOOP.json @@ -0,0 +1,53 @@ +{ + "value": [ + { + "properties": { + "vmId": "CCEEBF63-E92B-4A50-9949-6E44BFC61D3F", + "additionalCapabilities": { + "ultraSSDEnabled": "False", + "hibernationEnabled": "False" + }, + "hardwareProfile": { + "vmSize": "Standard_A1" + }, + "storageProfile": { + "imageReference": { + "publisher": "OpenLogic", + "offer": "CentOS", + "sku": "7.3", + "version": "latest" + }, + "osDisk": { + "osType": "Linux", + "name": "test-node-disk-1", + "createOption": "FromImage", + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "Standard_LRS", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/test-node-disk-1" + } + }, + "dataDisks": [] + }, + "osProfile": { + "computerName": "test-node-1", + "adminUsername": "user", + "linuxConfiguration": { + "disablePasswordAuthentication": false + }, + "secrets": [] + }, + "networkProfile": { + "networkInterfaces": [] + }, + "provisioningState": "Running" + }, + "type": "Microsoft.Compute/virtualMachines", + "location": "eastus", + "tags": {}, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/virtualMachines/test-node-1", + "name": "test-node-1" + } + ], + "nextLink": "https://management.azure.com:443/subscriptions/99999999-9999-9999-9999-999999999999/providers/Microsoft.Compute/virtualMachines?api-version=2021-11-01&$skiptoken=1!/Subscriptions/99999999-9999-9999-9999-999999999999/ResourceGroups/000000/VMs/DDFEBF64-E92B-4A50-9949-6E44BFC61D4G" +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Network_networkInterfaces.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Network_networkInterfaces.json new file mode 100644 index 0000000000..308411c8fd --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Network_networkInterfaces.json @@ -0,0 +1,56 @@ +{ + "value": [ + { + "name": "test-nic", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/REVIZOR/providers/Microsoft.Network/networkInterfaces/test-nic", + "etag": "Z/\"99999999-9999-9999-9999-999999999999\"", + "location": "eastus", + "tags": { + "tag_key1": "tag_val1" + }, + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "99999999-9999-9999-9999-999999999999", + "ipConfigurations": [ + { + "name": "ipconfig1", + "id": "/subscriptions/subid/resourceGroups/REVIZOR/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1", + "etag": "Z/\"99999999-9999-9999-9999-999999999999\"", + "type": "Microsoft.Network/networkInterfaces/ipConfigurations", + "properties": { + "provisioningState": "Succeeded", + "privateIPAddress": "172.20.2.4", + "privateIPAllocationMethod": "Dynamic", + "publicIPAddress": { + "id": "/subscriptions/subid/resourceGroups/REVIZOR/providers/Microsoft.Network/publicIPAddresses/test-ip" + }, + "subnet": { + "id": "/subscriptions/subid/resourceGroups/REVIZOR/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default" + }, + "primary": false, + "privateIPAddressVersion": "IPv4", + "isInUseWithService": false + } + } + ], + "dnsSettings": { + "dnsServers": [ + + ], + "appliedDnsServers": [ + + ], + "internalDomainNameSuffix": "test.bx.internal.cloudapp.net" + }, + "macAddress": "00-0D-3A-1B-C7-21", + "enableAcceleratedNetworking": false, + "enableIPForwarding": false, + "primary": true, + "virtualMachine": { + "id": "/subscriptions/subid/resourceGroups/REVIZOR/providers/Microsoft.Compute/virtualMachines/test-vm-1" + } + }, + "type": "Microsoft.Network/networkInterfaces" + } + ] +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Network_virtualnetworks.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Network_virtualnetworks.json new file mode 100644 index 0000000000..e2296f010d --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_providers_Microsoft_Network_virtualnetworks.json @@ -0,0 +1,56 @@ +{ + "value": [ + { + "name": "test_network", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/REVIZOR/providers/Microsoft.Network/virtualNetworks/test_network", + "etag": "W/\"99999999-9999-9999-9999-999999999999\"", + "type": "Microsoft.Network/virtualNetworks", + "location": "westus2", + "tags": { + "tag_key1": "tag_val1" + }, + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "99999999-9999-9999-9999-999999999999", + "addressSpace": { + "addressPrefixes": [ + "10.39.0.0/16" + ] + }, + "dhcpOptions": { + "dnsServers": [ + "172.11.111.11", + "172.11.111.12", + "8.8.8.8", + "8.8.4.4" + ] + }, + "subnets": [ + { + "name": "Azure_VPC_Subnet", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/REVIZOR/providers/Microsoft.Network/virtualNetworks/test_network/subnets/Azure_VPC_Subnet", + "etag": "W/\"99999999-9999-9999-9999-999999999990\"", + "properties": { + "provisioningState": "Succeeded", + "addressPrefix": "10.17.26.0/19", + "ipConfigurations": [ + { + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/REVIZOR/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1" + } + ], + "delegations": [ + + ] + }, + "type": "Microsoft.Network/virtualNetworks/subnets" + } + ], + "virtualNetworkPeerings": [ + + ], + "enableDdosProtection": false, + "enableVmProtection": false + } + } + ] +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_disks_test_disk_1.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_disks_test_disk_1.json new file mode 100644 index 0000000000..09cbfa3efe --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_disks_test_disk_1.json @@ -0,0 +1,26 @@ +{ + "properties": { + "accountType": "Standard_LRS", + "osType": "Linux", + "creationData": { + "createOption": "FromImage", + "imageReference": { + "id": "/Subscriptions/99999999-9999-9999-9999-999999999999/Providers/Microsoft.Compute/Locations/eastus/Publishers/OpenLogic/ArtifactTypes/VMImage/Offers/CentOS/Skus/7.3/Versions/latest" + } + }, + "diskSizeGB": 31, + "timeCreated": "2017-03-09T10:12:37.0256203+00:00", + "ownerId": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/REVIZOR/providers/Microsoft.Compute/virtualMachines/test-vm-1", + "provisioningState": "Succeeded", + "diskState": "Attached" + }, + "sku": { + "name": "Standard_LRS", + "tier": "Standard" + }, + "type": "Microsoft.Compute/disks", + "location": "eastus", + "tags": {}, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/test-disk-1", + "name": "test-disk-1" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_disks_test_node_disk_1.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_disks_test_node_disk_1.json new file mode 100644 index 0000000000..985c0d3aa1 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_disks_test_node_disk_1.json @@ -0,0 +1,51 @@ +{ + "properties": { + "vmId": "99999999-9999-9999-9999-999999999999", + "hardwareProfile": { + "vmSize": "Standard_A1" + }, + "storageProfile": { + "osDisk": { + "osType": "Linux", + "name": "test-disk-1", + "createOption": "FromImage", + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "Standard_LRS", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/test-disk-1" + } + }, + "dataDisks": [ + { + "lun": 0, + "name": "DD0-9999", + "createOption": "Attach", + "caching": "None", + "managedDisk": { + "storageAccountType": "Standard_LRS", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/DD0-9999" + }, + "diskSizeGB": 8 + } + ] + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/0000/providers/Microsoft.Network/networkInterfaces/test-nic", + "properties": { + "primary": true + } + } + ] + }, + "provisioningState": "Succeeded" + }, + "type": "Microsoft.Compute/virtualMachines", + "location": "eastus", + "tags": { + "tag_key1": "tag_val1" + }, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/0000/providers/Microsoft.Compute/virtualMachines/test_vm", + "name": "test_vm" +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_snapshots_test_snap_1.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_snapshots_test_snap_1.json new file mode 100644 index 0000000000..f83c70d8ee --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_snapshots_test_snap_1.json @@ -0,0 +1,20 @@ +{ + "properties": { + "accountType": "Standard_LRS", + "creationData": { + "createOption": "Copy", + "sourceUri": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/test-disk-1" + }, + "diskSizeGB": 1, + "timeCreated": "2017-03-09T14:28:27.8655868+00:00", + "provisioningState": "Creating", + "diskState": "Unattached" + }, + "type": "Microsoft.Compute/snapshots", + "location": "eastus", + "tags": { + "test_snap": "test" + }, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/snapshots/test-snap-1", + "name": "test-snap-1" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_virtualMachines_test_node_1.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_virtualMachines_test_node_1.json new file mode 100644 index 0000000000..9cbc7c1d6c --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_virtualMachines_test_node_1.json @@ -0,0 +1,51 @@ +{ + "properties": { + "vmId": "99999999-9999-9999-9999-999999999999", + "hardwareProfile": { + "vmSize": "Standard_A1" + }, + "storageProfile": { + "osDisk": { + "osType": "Linux", + "name": "OSD-9999", + "createOption": "Attach", + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "Standard_LRS", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/OSD-9999" + } + }, + "dataDisks": [ + { + "lun": 0, + "name": "DD0-9999", + "createOption": "Attach", + "caching": "None", + "managedDisk": { + "storageAccountType": "Standard_LRS", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/DD0-9999" + }, + "diskSizeGB": 8 + } + ] + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/0000/providers/Microsoft.Network/networkInterfaces/test-nic", + "properties": { + "primary": true + } + } + ] + }, + "provisioningState": "Succeeded" + }, + "type": "Microsoft.Compute/virtualMachines", + "location": "eastus", + "tags": { + "tag_key1": "tag_val1" + }, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/0000/providers/Microsoft.Compute/virtualMachines/test_vm", + "name": "test_vm" +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_virtualMachines_test_node_1_InstanceView.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_virtualMachines_test_node_1_InstanceView.json new file mode 100644 index 0000000000..0ac000f292 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_virtualMachines_test_node_1_InstanceView.json @@ -0,0 +1,27 @@ +{ + "vmAgent": { + "vmAgentVersion": "2.2.5", + "statuses": [ + { + "code": "ProvisioningState/succeeded", + "level": "Info", + "displayStatus": "Ready", + "message": "Guest Agent is running", + "time": "2017-03-09T15:11:03+00:00" + } + ], + "extensionHandlers": [] + }, + "statuses": [ + { + "code": "ProvisioningState/updating", + "level": "Info", + "displayStatus": "Updating" + }, + { + "code": "PowerState/running", + "level": "Info", + "displayStatus": "VM running" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_virtualMachines_test_node_1_resize.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_virtualMachines_test_node_1_resize.json new file mode 100644 index 0000000000..9cbc7c1d6c --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_virtualMachines_test_node_1_resize.json @@ -0,0 +1,51 @@ +{ + "properties": { + "vmId": "99999999-9999-9999-9999-999999999999", + "hardwareProfile": { + "vmSize": "Standard_A1" + }, + "storageProfile": { + "osDisk": { + "osType": "Linux", + "name": "OSD-9999", + "createOption": "Attach", + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "Standard_LRS", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/OSD-9999" + } + }, + "dataDisks": [ + { + "lun": 0, + "name": "DD0-9999", + "createOption": "Attach", + "caching": "None", + "managedDisk": { + "storageAccountType": "Standard_LRS", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/disks/DD0-9999" + }, + "diskSizeGB": 8 + } + ] + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/0000/providers/Microsoft.Network/networkInterfaces/test-nic", + "properties": { + "primary": true + } + } + ] + }, + "provisioningState": "Succeeded" + }, + "type": "Microsoft.Compute/virtualMachines", + "location": "eastus", + "tags": { + "tag_key1": "tag_val1" + }, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/0000/providers/Microsoft.Compute/virtualMachines/test_vm", + "name": "test_vm" +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_virtualMachines_test_node_2_InstanceView.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_virtualMachines_test_node_2_InstanceView.json new file mode 100644 index 0000000000..0ac000f292 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Compute_virtualMachines_test_node_2_InstanceView.json @@ -0,0 +1,27 @@ +{ + "vmAgent": { + "vmAgentVersion": "2.2.5", + "statuses": [ + { + "code": "ProvisioningState/succeeded", + "level": "Info", + "displayStatus": "Ready", + "message": "Guest Agent is running", + "time": "2017-03-09T15:11:03+00:00" + } + ], + "extensionHandlers": [] + }, + "statuses": [ + { + "code": "ProvisioningState/updating", + "level": "Info", + "displayStatus": "Updating" + }, + { + "code": "PowerState/running", + "level": "Info", + "displayStatus": "VM running" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Network_networkInterfaces_test_node_1_nic.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Network_networkInterfaces_test_node_1_nic.json new file mode 100644 index 0000000000..c9cfb05c48 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Network_networkInterfaces_test_node_1_nic.json @@ -0,0 +1,38 @@ +{ + "name": "test-node-1-nic", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Network/networkInterfaces/test-node-1-nic", + "etag": "W/\"5E19562E-8E84-493D-A29E-A84F5AC21D76\"", + "location": "eastus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "AD512C3D-9A7B-4012-8C5D-227A9EA5E6F4", + "ipConfigurations": [ + { + "name": "myip1", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Network/networkInterfaces/test-node-1-nic/ipConfigurations/myip1", + "etag": "W/\"5E19562E-8E84-493D-A29E-A84F5AC21D76\"", + "properties": { + "provisioningState": "Succeeded", + "privateIPAddress": "10.0.0.1", + "privateIPAllocationMethod": "Dynamic", + "subnet": { + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Network/virtualNetworks/000000/subnets/000000" + }, + "primary": true + } + } + ], + "dnsSettings": { + "dnsServers": [], + "appliedDnsServers": [] + }, + "macAddress": "11-11-11-11-11-11", + "enableIPForwarding": false, + "primary": true, + "virtualMachine": { + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/virtualMachines/test-node-1" + } + }, + "type": "Microsoft.Network/networkInterfaces" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Network_networkInterfaces_test_node_2_nic.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Network_networkInterfaces_test_node_2_nic.json new file mode 100644 index 0000000000..868bb53dbe --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_000000_providers_Microsoft_Network_networkInterfaces_test_node_2_nic.json @@ -0,0 +1,38 @@ +{ + "name": "test-node-2-nic", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Network/networkInterfaces/test-node-2-nic", + "etag": "W/\"5E19562E-8E84-493D-A29E-A84F5AC21D77\"", + "location": "eastus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "AD512C3D-9A7B-4012-8C5D-227A9EA5E6F5", + "ipConfigurations": [ + { + "name": "myip1", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Network/networkInterfaces/test-node-2-nic/ipConfigurations/myip2", + "etag": "W/\"5E19562E-8E84-493D-A29E-A84F5AC21D77\"", + "properties": { + "provisioningState": "Succeeded", + "privateIPAddress": "10.0.0.2", + "privateIPAllocationMethod": "Dynamic", + "subnet": { + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Network/virtualNetworks/000000/subnets/000000" + }, + "primary": true + } + } + ], + "dnsSettings": { + "dnsServers": [], + "appliedDnsServers": [] + }, + "macAddress": "11-11-11-11-11-11", + "enableIPForwarding": false, + "primary": true, + "virtualMachine": { + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/000000/providers/Microsoft.Compute/virtualMachines/test-node-2" + } + }, + "type": "Microsoft.Network/networkInterfaces" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_111111_providers_Microsoft_Compute_disks.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_111111_providers_Microsoft_Compute_disks.json new file mode 100644 index 0000000000..bd2de1ff61 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_111111_providers_Microsoft_Compute_disks.json @@ -0,0 +1,22 @@ +{ + "value": [ + { + "properties": { + "accountType": "Standard_LRS", + "osType": "Linux", + "creationData": { + "createOption": "Empty" + }, + "diskSizeGB": 10, + "timeCreated": "2017-03-09T10:08:42.6418313+00:00", + "provisioningState": "Succeeded", + "diskState": "Unattached" + }, + "type": "Microsoft.Compute/disks", + "location": "eastus", + "tags": {}, + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/111111/providers/Microsoft.Compute/disks/test-disk-3", + "name": "test-disk-3" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_111111_providers_Microsoft_Compute_snapshots.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_111111_providers_Microsoft_Compute_snapshots.json new file mode 100644 index 0000000000..b6add161a9 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_111111_providers_Microsoft_Compute_snapshots.json @@ -0,0 +1,38 @@ +{ + "value": [ + { + "properties": { + "accountType": "Standard_LRS", + "creationData": { + "createOption": "Copy", + "sourceUri": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/111111/providers/Microsoft.Compute/disks/test-disk-3" + }, + "diskSizeGB": 2, + "timeCreated": "2017-02-02T17:52:44.4557501+00:00", + "provisioningState": "Failed", + "diskState": "Unattached" + }, + "type": "Microsoft.Compute/snapshots", + "location": "eastus", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/111111/providers/Microsoft.Compute/snapshots/test-snap-3", + "name": "test-snap-3" + }, + { + "properties": { + "accountType": "Standard_LRS", + "creationData": { + "createOption": "Copy", + "sourceUri": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/111111/providers/Microsoft.Compute/disks/test-disk-4" + }, + "diskSizeGB": 2, + "timeCreated": "2017-02-02T17:52:50.0027361+00:00", + "provisioningState": "Failed", + "diskState": "Unattached" + }, + "type": "Microsoft.Compute/snapshots", + "location": "eastus", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/111111/providers/Microsoft.Compute/snapshots/test-snap-4", + "name": "test-snap-4" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_REVIZOR_providers_Microsoft_Network_networkInterfaces_test_nic.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_REVIZOR_providers_Microsoft_Network_networkInterfaces_test_nic.json new file mode 100644 index 0000000000..e4fbb9e943 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_REVIZOR_providers_Microsoft_Network_networkInterfaces_test_nic.json @@ -0,0 +1,52 @@ +{ + "name": "test-nic", + "id": "/subscriptions/99999999-9999-9999-9999-999999999999/resourceGroups/REVIZOR/providers/Microsoft.Network/networkInterfaces/test-nic", + "etag": "Z/\"99999999-9999-9999-9999-999999999999\"", + "location": "eastus", + "tags": { + "tag_key1": "tag_val1" + }, + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "99999999-9999-9999-9999-999999999999", + "ipConfigurations": [ + { + "name": "ipconfig1", + "id": "/subscriptions/subid/resourceGroups/REVIZOR/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1", + "etag": "Z/\"99999999-9999-9999-9999-999999999999\"", + "type": "Microsoft.Network/networkInterfaces/ipConfigurations", + "properties": { + "provisioningState": "Succeeded", + "privateIPAddress": "172.20.2.4", + "privateIPAllocationMethod": "Dynamic", + "publicIPAddress": { + "id": "/subscriptions/subid/resourceGroups/REVIZOR/providers/Microsoft.Network/publicIPAddresses/test-ip" + }, + "subnet": { + "id": "/subscriptions/subid/resourceGroups/REVIZOR/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default" + }, + "primary": true, + "privateIPAddressVersion": "IPv4", + "isInUseWithService": false + } + } + ], + "dnsSettings": { + "dnsServers": [ + + ], + "appliedDnsServers": [ + + ], + "internalDomainNameSuffix": "test.bx.internal.cloudapp.net" + }, + "macAddress": "00-0D-3A-1B-C7-21", + "enableAcceleratedNetworking": false, + "enableIPForwarding": false, + "primary": true, + "virtualMachine": { + "id": "/subscriptions/subid/resourceGroups/REVIZOR/providers/Microsoft.Compute/virtualMachines/test-vm-1" + } + }, + "type": "Microsoft.Network/networkInterfaces" +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_REVIZOR_providers_Microsoft_Network_publicIPAddresses_test_public_ip.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_REVIZOR_providers_Microsoft_Network_publicIPAddresses_test_public_ip.json new file mode 100644 index 0000000000..c6b642c310 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_REVIZOR_providers_Microsoft_Network_publicIPAddresses_test_public_ip.json @@ -0,0 +1,21 @@ +{ + "name": "testDNS-ip", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip", + "location": "westus", + "zones": [ + "1" + ], + "properties": { + "provisioningState": "Succeeded", + "publicIPAddressVersion": "IPv4", + "publicIPAllocationMethod": "Static", + "idleTimeoutInMinutes": 10, + "ipConfiguration": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1" + } + }, + "sku": { + "name": "Standard" + }, + "type": "Microsoft.Network/publicIPAddresses" +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_REVIZOR_providers_Microsoft_Network_virtualNetworks_test_network_CheckIPAddressAvailability.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_REVIZOR_providers_Microsoft_Network_virtualNetworks_test_network_CheckIPAddressAvailability.json new file mode 100644 index 0000000000..c13e0938d1 --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_99999999_resourceGroups_REVIZOR_providers_Microsoft_Network_virtualNetworks_test_network_CheckIPAddressAvailability.json @@ -0,0 +1,10 @@ +{ + "available": false, + "availableIPAddresses": [ + "10.32.36.102", + "10.32.36.103", + "10.32.36.104", + "10.32.36.105", + "10.32.36.106" + ] +} diff --git a/libcloud/test/compute/fixtures/azure_arm/_subscriptions_subid_resourceGroups_rg1_providers_Microsoft_Network_publicIPAddresses_test_ip.json b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_subid_resourceGroups_rg1_providers_Microsoft_Network_publicIPAddresses_test_ip.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/libcloud/test/compute/fixtures/azure_arm/_subscriptions_subid_resourceGroups_rg1_providers_Microsoft_Network_publicIPAddresses_test_ip.json @@ -0,0 +1 @@ +{} diff --git a/libcloud/test/compute/fixtures/bluebox/api_block_products_json.json b/libcloud/test/compute/fixtures/bluebox/api_block_products_json.json deleted file mode 100644 index b3baa12d5b..0000000000 --- a/libcloud/test/compute/fixtures/bluebox/api_block_products_json.json +++ /dev/null @@ -1 +0,0 @@ -[{"cost": 0.15, "id": "94fd37a7-2606-47f7-84d5-9000deda52ae", "description": "Block 1GB Virtual Server"}, {"cost": 0.25, "id": "b412f354-5056-4bf0-a42f-6ddd998aa092", "description": "Block 2GB Virtual Server"}, {"cost": 0.35, "id": "0cd183d3-0287-4b1a-8288-b3ea8302ed58", "description": "Block 4GB Virtual Server"}, {"cost": 0.45, "id": "b9b87a5b-2885-4a2e-b434-44a163ca6251", "description": "Block 8GB Virtual Server"}] diff --git a/libcloud/test/compute/fixtures/bluebox/api_block_templates_json.json b/libcloud/test/compute/fixtures/bluebox/api_block_templates_json.json deleted file mode 100644 index 2ea7cb620a..0000000000 --- a/libcloud/test/compute/fixtures/bluebox/api_block_templates_json.json +++ /dev/null @@ -1 +0,0 @@ -[{"public": true, "id": "c66b8145-f768-45ef-9878-395bf8b1b7ff", "description": "CentOS 5 (Latest Release)", "created": "2009/04/20 15:46:34 -0700"}, {"public": true, "id": "1fc24f51-6d7d-4fa9-9a6e-0d6f36b692e2", "description": "Ubuntu 8.10 64bit", "created": "2009/04/20 15:46:34 -0700"}, {"public": true, "id": "b6f152db-988c-4194-b292-d6dd2aa2dbab", "description": "Debian 5.0 64bit", "created": "2009/04/20 15:46:34 -0700"}, {"public": true, "id": "4b697e48-282b-4140-8cf8-142e2a2711ee", "description": "Ubuntu 8.04 LTS 64bit", "created": "2009/07/31 15:58:20 -0700"}, {"public": true, "id": "a6a141bf-592a-4fa6-b130-4c14f69e82d0", "description": "Ubuntu 8.04 LTS 32Bit", "created": "2009/04/20 15:46:34 -0700"}, {"public": true, "id": "b181033f-aea7-4e6c-8bb4-11169775c0f8", "description": "Ubuntu 9.04 64bit", "created": "2010/01/26 11:31:19 -0800"}, {"public": true, "id": "b5371c5a-9da2-43ee-a745-99a4723f624c", "description": "ArchLinux 2009.08 64bit", "created": "2010/02/13 18:07:01 -0800"}, {"public": true, "id": "a00baa8f-b5d0-4815-8238-b471c4c4bf72", "description": "Ubuntu 9.10 64bit", "created": "2010/02/17 22:06:21 -0800"}, {"public": true, "id": "03807e08-a13d-44e4-b011-ebec7ef2c928", "description": "Ubuntu 10.04 LTS 64bit", "created": "2010/05/04 14:43:30 -0700"}, {"public": true, "id": "8b60e6de-7cbc-4c8e-b7df-5e2f9c4ffd6b", "description": "Ubuntu 10.04 LTS 32bit", "created": "2010/05/04 14:43:30 -0700"}] diff --git a/libcloud/test/compute/fixtures/bluebox/api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_json.json b/libcloud/test/compute/fixtures/bluebox/api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_json.json deleted file mode 100644 index 9db716d7d1..0000000000 --- a/libcloud/test/compute/fixtures/bluebox/api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_json.json +++ /dev/null @@ -1 +0,0 @@ -{"ips": [{"address": "67.214.214.212"}], "memory": 1073741824, "template": "centos", "id": "99df878c-6e5c-4945-a635-d94da9fd3146", "storage": 21474836480, "hostname": "apitest.c44905.c44905.blueboxgrid.com", "description": "1 GB RAM + 20 GB Disk", "cpu": 0.5, "status": "running", "product": {"cost": 0.15, "id": "94fd37a7-2606-47f7-84d5-9000deda52ae", "description": "Block 1GB Virtual Server"}} diff --git a/libcloud/test/compute/fixtures/bluebox/api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_json_delete.json b/libcloud/test/compute/fixtures/bluebox/api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_json_delete.json deleted file mode 100644 index 934a00f420..0000000000 --- a/libcloud/test/compute/fixtures/bluebox/api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_json_delete.json +++ /dev/null @@ -1 +0,0 @@ -{"text":"Block destroyed."} diff --git a/libcloud/test/compute/fixtures/bluebox/api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_reboot_json.json b/libcloud/test/compute/fixtures/bluebox/api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_reboot_json.json deleted file mode 100644 index 2ea54d2232..0000000000 --- a/libcloud/test/compute/fixtures/bluebox/api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_reboot_json.json +++ /dev/null @@ -1 +0,0 @@ -{ "status": "ok", "text": "Reboot initiated." } diff --git a/libcloud/test/compute/fixtures/bluebox/api_blocks_json.json b/libcloud/test/compute/fixtures/bluebox/api_blocks_json.json deleted file mode 100644 index eb7d35ff6e..0000000000 --- a/libcloud/test/compute/fixtures/bluebox/api_blocks_json.json +++ /dev/null @@ -1 +0,0 @@ -[{"ips":[{"address":"67.214.214.212"}],"memory":1073741824,"id":"99df878c-6e5c-4945-a635-d94da9fd3146","storage":21474836480,"hostname":"foo.apitest.blueboxgrid.com","description":"1 GB RAM + 20 GB Disk","cpu":0.5,"status":"running"}] diff --git a/libcloud/test/compute/fixtures/bluebox/api_blocks_json_post.json b/libcloud/test/compute/fixtures/bluebox/api_blocks_json_post.json deleted file mode 100644 index 4452f7185b..0000000000 --- a/libcloud/test/compute/fixtures/bluebox/api_blocks_json_post.json +++ /dev/null @@ -1 +0,0 @@ -{"ips":[{"address":"67.214.214.212"}],"memory":1073741824,"id":"99df878c-6e5c-4945-a635-d94da9fd3146","storage":21474836480,"hostname":"foo.apitest.blueboxgrid.com","description":"1 GB RAM + 20 GB Disk","cpu":0.5,"status":"queued", "product": {"cost": 0.15, "id": "94fd37a7-2606-47f7-84d5-9000deda52ae", "description": "Block 1GB Virtual Server"}} diff --git a/libcloud/test/compute/fixtures/cloudframes/_cloudspace_find.xml b/libcloud/test/compute/fixtures/cloudframes/_cloudspace_find.xml deleted file mode 100644 index a42bd690b4..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_cloudspace_find.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -jobguid - - -result - -3e4f8bd5-718c-457e-86f4-024c560d7c28 - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_lan_find.xml b/libcloud/test/compute/fixtures/cloudframes/_lan_find.xml deleted file mode 100644 index 163a656c49..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_lan_find.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -jobguid - - -result - -8d6a8b91-22fc-4be4-863b-11dc4456b315 - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_createFromTemplate.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_createFromTemplate.xml deleted file mode 100644 index fc4c138500..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_createFromTemplate.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -jobguid -e7b75dd9-f4b0-4c11-8b3f-748306964ad7 - - -result -96b2af78-88a0-48a6-a5bd-258e1d00c0b9 - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_delete.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_delete.xml deleted file mode 100644 index 17e48384aa..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_delete.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -jobguid -ac93fbb6-6b5d-4248-a627-efba9f4d76c7 - - -result -1 - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_find_physical.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_find_physical.xml deleted file mode 100644 index 002804a126..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_find_physical.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -jobguid - - -result - -2aea45ee-3ea5-4b4f-88f0-7d4d48bed643 - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_find_templates.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_find_templates.xml deleted file mode 100644 index f557ca1e90..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_find_templates.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -jobguid - - -result - -0c4da918-9f88-4049-a09c-8ab69142736a - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_find_virtualdesktop.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_find_virtualdesktop.xml deleted file mode 100644 index 009a395970..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_find_virtualdesktop.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -jobguid - - -result - - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_find_virtualserver.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_find_virtualserver.xml deleted file mode 100644 index 09b6ca0a52..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_find_virtualserver.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - -jobguid - - -result - -dea11e50-1b53-4046-8589-cf52eb7b0d25 -c52e4a42-72fe-4f34-bb80-c57d237fcbf9 -64f325ef-28ac-4907-bd37-572a13178edd -9a6b3101-b4ac-4ecb-b114-67d89994ac9b -1dd57d0d-0e23-471d-9f34-b673c7c18bc3 -d3c98151-f064-45fc-a90a-23c481723895 -01dedf71-0c37-441e-9687-085f8bb116ea - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_listSnapshots.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_listSnapshots.xml deleted file mode 100644 index 231a4cd42b..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_listSnapshots.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - -jobguid - - -result - - - -description - - -backuplabel -somelabel - - -timestamp -2013-07-25 13:20:52.093959 - - -consistent -t - - -name -node-name-2013-07-25 13:20:52.093931 - - -snapshottype -PAUSED - - -guid -4685d9b5-80e8-44d8-a094-f6f799f90954 - - -parentmachineguid -26348bf8-2e2f-41e8-83c3-11fb5d14c9d2 - - - - -description - - -backuplabel - - -timestamp -2013-07-25 13:19:39.437168 - - -consistent -t - - -name -node-name-2013-07-25 13:19:39.437142 - - -snapshottype -PAUSED - - -guid -5c00bd9e-6c18-4bee-83bf-5ff14426868a - - -parentmachineguid -96b2af78-88a0-48a6-a5bd-258e1d00c0b9 - - - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_01dedf71-0c37-441e-9687-085f8bb116ea.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_01dedf71-0c37-441e-9687-085f8bb116ea.xml deleted file mode 100644 index 8039aaa0e4..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_01dedf71-0c37-441e-9687-085f8bb116ea.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - -jobguid - - -result - - - -backup -0 - - -replicationstatus - - -machinerole - - -isbackup -0 - - -guid -01dedf71-0c37-441e-9687-085f8bb116ea - - -machinetype -VIRTUALSERVER - - -hostname - - -vmachinemanagerid - - -system -0 - - -template -0 - - -memory -512 - - -agentguid - - -status -CONFIGURED - - -nrcpu -1 - - -bootstatus -FROMDISK - - -description -AUTOTEST_94a50c23-715d-4fbc-8cdf-c3f436e04ec0 - - -importancefactor -5 - - -replicationrole - - -parentmachineguid -2aea45ee-3ea5-4b4f-88f0-7d4d48bed643 - - -name -AUTOTEST_94a50c23-715d-4fbc-8cdf-c3f436e04ec0 - - -hypervisor -VMWARE_ESX - - -replicationtype - - -os -ubuntu1010 - - - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_0c4da918-9f88-4049-a09c-8ab69142736a.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_0c4da918-9f88-4049-a09c-8ab69142736a.xml deleted file mode 100644 index 6f4af84758..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_0c4da918-9f88-4049-a09c-8ab69142736a.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - -jobguid - - -result - - - -backup -0 - - -replicationstatus - - -machinerole - - -isbackup -0 - - -guid -0c4da918-9f88-4049-a09c-8ab69142736a - - -machinetype -VIRTUALSERVER - - -hostname - - -vmachinemanagerid -2 - - -system -0 - - -template -1 - - -memory -512 - - -agentguid - - -status -IMAGEONLY - - -nrcpu -1 - - -bootstatus -FROMDISK - - -description -template_ubuntu_esx - - -importancefactor -5 - - -replicationrole - - -parentmachineguid -411f22e3-2e04-431b-adc7-2a952d2cadc6 - - -name -ubuntu_esx - - -hypervisor -VMWARE_ESX - - -replicationtype - - -os -ubuntu1010 - - - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_1dd57d0d-0e23-471d-9f34-b673c7c18bc3.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_1dd57d0d-0e23-471d-9f34-b673c7c18bc3.xml deleted file mode 100644 index 1fcc91ac89..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_1dd57d0d-0e23-471d-9f34-b673c7c18bc3.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - -jobguid - - -result - - - -backup -1 - - -replicationstatus - - -machinerole - - -isbackup -0 - - -guid -1dd57d0d-0e23-471d-9f34-b673c7c18bc3 - - -machinetype -VIRTUALSERVER - - -hostname - - -vmachinemanagerid -3 - - -system -0 - - -template -0 - - -memory -512 - - -agentguid - - -status -RUNNING - - -nrcpu -1 - - -bootstatus -FROMDISK - - -description - - -importancefactor -5 - - -replicationrole - - -parentmachineguid -2aea45ee-3ea5-4b4f-88f0-7d4d48bed643 - - -name -testvm_running - - -hypervisor -VMWARE_ESX - - -replicationtype - - -os -ubuntu1010 - - - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_2aea45ee-3ea5-4b4f-88f0-7d4d48bed643.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_2aea45ee-3ea5-4b4f-88f0-7d4d48bed643.xml deleted file mode 100644 index c5fb1347f4..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_2aea45ee-3ea5-4b4f-88f0-7d4d48bed643.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - -jobguid - - -result - - - -backup -0 - - -replicationstatus - - -machinerole -COMPUTENODE - - -isbackup -0 - - -guid -2aea45ee-3ea5-4b4f-88f0-7d4d48bed643 - - -machinetype -PHYSICAL - - -hostname -VMWARE-ESX-10-101-163-1 - - -vmachinemanagerid - - -system -0 - - -template -0 - - -memory -262111 - - -agentguid - - -status -RUNNING - - -nrcpu -24 - - -bootstatus -FROMDISK - - -description - - -importancefactor -5 - - -replicationrole - - -parentmachineguid - - -name -VMWARE-ESX-10-101-163-1 - - -hypervisor -VMWARE_ESX - - -replicationtype - - -os -esxi5 - - - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_64f325ef-28ac-4907-bd37-572a13178edd.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_64f325ef-28ac-4907-bd37-572a13178edd.xml deleted file mode 100644 index 230ba4520c..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_64f325ef-28ac-4907-bd37-572a13178edd.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - -jobguid - - -result - - - -backup -0 - - -replicationstatus - - -machinerole - - -isbackup -0 - - -guid -64f325ef-28ac-4907-bd37-572a13178edd - - -machinetype -VIRTUALSERVER - - -hostname - - -vmachinemanagerid -9 - - -system -0 - - -template -0 - - -memory -512 - - -agentguid - - -status -RUNNING - - -nrcpu -1 - - -bootstatus -FROMDISK - - -description - - -importancefactor -5 - - -replicationrole - - -parentmachineguid -2aea45ee-3ea5-4b4f-88f0-7d4d48bed643 - - -name -testvm_clone - - -hypervisor -VMWARE_ESX - - -replicationtype - - -os -ubuntu1010 - - - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_96b2af78-88a0-48a6-a5bd-258e1d00c0b9.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_96b2af78-88a0-48a6-a5bd-258e1d00c0b9.xml deleted file mode 100644 index ed038e6edb..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_96b2af78-88a0-48a6-a5bd-258e1d00c0b9.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - -jobguid - - -result - - - -backup -0 - - -replicationstatus - - -machinerole - - -isbackup -0 - - -guid -96b2af78-88a0-48a6-a5bd-258e1d00c0b9 - - -machinetype -VIRTUALSERVER - - -hostname - - -vmachinemanagerid - - -system -0 - - -template -0 - - -memory -512 - - -agentguid - - -status -CREATED - - -nrcpu -1 - - -bootstatus -FROMDISK - - -description -node-name - - -importancefactor -5 - - -replicationrole - - -parentmachineguid -2aea45ee-3ea5-4b4f-88f0-7d4d48bed643 - - -name -node-name - - -hypervisor -VMWARE_ESX - - -replicationtype - - -os -ubuntu1010 - - - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_9a6b3101-b4ac-4ecb-b114-67d89994ac9b.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_9a6b3101-b4ac-4ecb-b114-67d89994ac9b.xml deleted file mode 100644 index 13afbd2bed..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_9a6b3101-b4ac-4ecb-b114-67d89994ac9b.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - -jobguid - - -result - - - -backup -1 - - -replicationstatus - - -machinerole - - -isbackup -0 - - -guid -9a6b3101-b4ac-4ecb-b114-67d89994ac9b - - -machinetype -VIRTUALSERVER - - -hostname - - -vmachinemanagerid -7 - - -system -0 - - -template -0 - - -memory -512 - - -agentguid - - -status -STOPPING - - -nrcpu -1 - - -bootstatus -FROMDISK - - -description - - -importancefactor -5 - - -replicationrole - - -parentmachineguid -2aea45ee-3ea5-4b4f-88f0-7d4d48bed643 - - -name -testvm_stopped - - -hypervisor -VMWARE_ESX - - -replicationtype - - -os -ubuntu1010 - - - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_c52e4a42-72fe-4f34-bb80-c57d237fcbf9.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_c52e4a42-72fe-4f34-bb80-c57d237fcbf9.xml deleted file mode 100644 index 7db19fbcdf..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_c52e4a42-72fe-4f34-bb80-c57d237fcbf9.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - -jobguid - - -result - - - -backup -1 - - -replicationstatus - - -machinerole - - -isbackup -0 - - -guid -c52e4a42-72fe-4f34-bb80-c57d237fcbf9 - - -machinetype -VIRTUALSERVER - - -hostname - - -vmachinemanagerid - - -system -0 - - -template -0 - - -memory -512 - - -agentguid - - -status -CREATED - - -nrcpu -1 - - -bootstatus -FROMDISK - - -description - - -importancefactor -5 - - -replicationrole - - -parentmachineguid -2aea45ee-3ea5-4b4f-88f0-7d4d48bed643 - - -name -testvm_created - - -hypervisor -VMWARE_ESX - - -replicationtype - - -os -ubuntu1010 - - - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_d3c98151-f064-45fc-a90a-23c481723895.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_d3c98151-f064-45fc-a90a-23c481723895.xml deleted file mode 100644 index d95bc44e9d..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_d3c98151-f064-45fc-a90a-23c481723895.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - -jobguid - - -result - - - -backup -0 - - -replicationstatus - - -machinerole - - -isbackup -0 - - -guid -d3c98151-f064-45fc-a90a-23c481723895 - - -machinetype -VIRTUALSERVER - - -hostname - - -vmachinemanagerid - - -system -0 - - -template -0 - - -memory -512 - - -agentguid - - -status -CONFIGURED - - -nrcpu -1 - - -bootstatus -FROMDISK - - -description -AUTOTEST_ec71742b-bd74-4908-8327-717c349e0d79 - - -importancefactor -5 - - -replicationrole - - -parentmachineguid -2aea45ee-3ea5-4b4f-88f0-7d4d48bed643 - - -name -AUTOTEST_ec71742b-bd74-4908-8327-717c349e0d79 - - -hypervisor -VMWARE_ESX - - -replicationtype - - -os -ubuntu1010 - - - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_dea11e50-1b53-4046-8589-cf52eb7b0d25.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_dea11e50-1b53-4046-8589-cf52eb7b0d25.xml deleted file mode 100644 index bd7575f5ed..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_list_machineguid_dea11e50-1b53-4046-8589-cf52eb7b0d25.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - -jobguid - - -result - - - -backup -1 - - -replicationstatus - - -machinerole - - -isbackup -0 - - -guid -dea11e50-1b53-4046-8589-cf52eb7b0d25 - - -machinetype -VIRTUALSERVER - - -hostname - - -vmachinemanagerid -5 - - -system -0 - - -template -0 - - -memory -512 - - -agentguid - - -status -PAUSED - - -nrcpu -1 - - -bootstatus -FROMDISK - - -description - - -importancefactor -5 - - -replicationrole - - -parentmachineguid -2aea45ee-3ea5-4b4f-88f0-7d4d48bed643 - - -name -testvm_paused - - -hypervisor -VMWARE_ESX - - -replicationtype - - -os -ubuntu1010 - - - - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_reboot.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_reboot.xml deleted file mode 100644 index e8780a3d74..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_reboot.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -jobguid -ab93fcb6-6b5d-4248-a627-efba9f4d76c7 - - -result -1 - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_rollback.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_rollback.xml deleted file mode 100644 index d104a0e3ee..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_rollback.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -jobguid -ababacb6-7a5d-4248-a627-efba9f4d76c7 - - -result -1 - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_snapshot.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_snapshot.xml deleted file mode 100644 index e417d546b6..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_snapshot.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -jobguid -16556e13-a2f9-492c-b094-dc62bc7d2cc9 - - -result -5c00bd9e-6c18-4bee-83bf-5ff14426868a - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_start.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_start.xml deleted file mode 100644 index a9b50ed78b..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_start.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -jobguid -ab93fcb6-7a5d-4248-a627-efba9f4d76c7 - - -result -1 - - - - - diff --git a/libcloud/test/compute/fixtures/cloudframes/_machine_stop.xml b/libcloud/test/compute/fixtures/cloudframes/_machine_stop.xml deleted file mode 100644 index a9b50ed78b..0000000000 --- a/libcloud/test/compute/fixtures/cloudframes/_machine_stop.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -jobguid -ab93fcb6-7a5d-4248-a627-efba9f4d76c7 - - -result -1 - - - - - diff --git a/libcloud/test/compute/fixtures/cloudscale/create_node.json b/libcloud/test/compute/fixtures/cloudscale/create_node.json new file mode 100644 index 0000000000..a40e80cd8f --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudscale/create_node.json @@ -0,0 +1,46 @@ +{ + "href": "https://api.cloudscale.ch/v1/servers/47cec963-fcd2-482f-bdb6-24461b2d47b1", + "uuid": "47cec963-fcd2-482f-bdb6-24461b2d47b1", + "name": "db-master", + "status": "changing", + "flavor": { + "slug": "flex-4", + "name": "Flex-4", + "vcpu_count": 2, + "memory_gb": 4 + }, + "image": { + "slug": "debian-8", + "name": "Debian 8 (2016-10-20)", + "operating_system": "Debian" + }, + "volumes": [ + { + "type": "ssd", + "device_path": "", + "size_gb": 50 + } + ], + "interfaces": [ + { + "type": "public", + "addresses": [ + { + "version": 4, + "address": "185.98.122.176", + "prefix_length": 24, + "gateway": "185.98.122.1", + "reverse_ptr": "185-98-122-176.cust.cloudscale.ch" + }, + { + "version": 6, + "address": "2a06:c01:1:1902::7ab0:176", + "prefix_length": 64, + "gateway": "fe80::1", + "reverse_ptr": "185-98-122-176.cust.cloudscale.ch" + } + ] + } + ], + "anti_affinity_with": [] +} diff --git a/libcloud/test/compute/fixtures/cloudscale/list_images.json b/libcloud/test/compute/fixtures/cloudscale/list_images.json new file mode 100644 index 0000000000..785886a9a1 --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudscale/list_images.json @@ -0,0 +1 @@ +[{"slug":"ubuntu-16.10","name":"Ubuntu 16.10 (2016-10-17)","operating_system":"Ubuntu"}] diff --git a/libcloud/test/compute/fixtures/cloudscale/list_nodes.json b/libcloud/test/compute/fixtures/cloudscale/list_nodes.json new file mode 100644 index 0000000000..95f861ce8a --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudscale/list_nodes.json @@ -0,0 +1,48 @@ +[ + { + "href": "https://api.cloudscale.ch/v1/servers/47cec963-fcd2-482f-bdb6-24461b2d47b1", + "uuid": "47cec963-fcd2-482f-bdb6-24461b2d47b1", + "name": "db-master", + "status": "running", + "flavor": { + "slug": "flex-4", + "name": "Flex-4", + "vcpu_count": 2, + "memory_gb": 4 + }, + "image": { + "slug": "debian-8", + "name": "Debian 8 (2016-10-20)", + "operating_system": "Debian" + }, + "volumes": [ + { + "type": "ssd", + "device_path": "/dev/vda", + "size_gb": 50 + } + ], + "interfaces": [ + { + "type": "public", + "addresses": [ + { + "version": 4, + "address": "185.98.122.176", + "prefix_length": 24, + "gateway": "185.98.122.1", + "reverse_ptr": "185-98-122-176.cust.cloudscale.ch" + }, + { + "version": 6, + "address": "2a06:c01:1:1902::7ab0:176", + "prefix_length": 64, + "gateway": "fe80::1", + "reverse_ptr": "185-98-122-176.cust.cloudscale.ch" + } + ] + } + ], + "anti_affinity_with": [] + } +] diff --git a/libcloud/test/compute/fixtures/cloudscale/list_sizes.json b/libcloud/test/compute/fixtures/cloudscale/list_sizes.json new file mode 100644 index 0000000000..8952a5e8c5 --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudscale/list_sizes.json @@ -0,0 +1,2 @@ +[{"slug":"flex-2","name":"Flex-2","vcpu_count":1,"memory_gb":2}, + {"slug":"flex-4","name":"Flex-4","vcpu_count":2,"memory_gb": 4}] diff --git a/libcloud/test/compute/fixtures/cloudsigma_2_0/drives_resize.json b/libcloud/test/compute/fixtures/cloudsigma_2_0/drives_resize.json index b3f45e092e..5d1312f265 100644 --- a/libcloud/test/compute/fixtures/cloudsigma_2_0/drives_resize.json +++ b/libcloud/test/compute/fixtures/cloudsigma_2_0/drives_resize.json @@ -18,7 +18,7 @@ "snapshots_allocated_size": 0, "storage_type": null }, - "size": 1164967936, + "size": 10737418240, "snapshots": [], "status": "creating", "storage_type": null, diff --git a/libcloud/test/compute/fixtures/cloudsigma_2_0/keypairs_get.json b/libcloud/test/compute/fixtures/cloudsigma_2_0/keypairs_get.json new file mode 100644 index 0000000000..f942aa05cd --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudsigma_2_0/keypairs_get.json @@ -0,0 +1,12 @@ +{ + "fingerprint": "8c:71:a2:f0:bc:a4:45:66:a8:59:77:6d:80:d5:a0:89", + "grantees": [], + "meta": {}, + "name": "ala", + "permissions": [], + "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEqQIBAAKCAQEAvROcpJ/0T5iZUzfRydsJI4zCbuQAfGH3Bl/biggPY1atLqzf\niz6lctY8wsz2sYts9OQomtCB/xtMPfUjHZpLg1EP4/hfP1NCWtsIbIiDYKrzNEFg\nApSO1AkqBZ8tVL2gpPUuSdaK5P3lPjkbt43dgnThIyMvNoi0g7ngC6L6s960JvBq\nuamOvd8wVaW/VpbyZrKqRwvmsMH1pGErhSAeErImOdwM8wtCddLS3O4nxfts06py\nEcGhupvH8lph9q+jKJxpg7whUkOJyZoMN1XgDvtRFbz9PvlxqP0SOecEHP+4yCOg\nDcJa69LSFFxmlSog9BitCv5qRFwrvKGsMYcesQIDAQABAoIBAQCYBufhend/dIx7\n3BsDuemMOwavEQbO/BoadwLX5okw76WKLRgFJxby0g3C9/i3Ywr1kWqQqGyOCY3x\nF2TnzYNAD/K985vqF/D3irwoQE+ab3njn1kqWfbJyKCQKp/RTjOXz0gruKSvYPJt\naI+/tALSfVX04bp5l8vFSrQ5xw7bhiiFifATuDStVLSzzmEli6Pbne4mcKIXiReu\nK1OlSKPF9SbCxCcEvEhUhQqs7U/N+sEYmUSQ/q8rNdolWQD0c/EGn2RF0siNolxp\nylo5c7E/LvwgTW6DLYaEZDgORnYHEwiaG7YxJAuFFPoQNFIjoGEF5wKOGL/kKtVr\npyriY/k9AoIAgQDRKEf+B+SLO/P/rPP7CCCIh4tR9uXl6hbnEp40sx5AomZmIwfy\nZGRp+iIN3YhM2XQ96fb47Lgc4AsDUHKt+9ASqJWWn0f06sbaaVsTfKpxVuI1kPsh\nGVpuOqwQCnXFyTvvirrdTlAw32hOzl1VVL0bL57MsAkpmjHnqsEqYTpIhwKCAIEA\n52wIL3RMT6bGjfx/PMsyTOa9AFSLzsjvoOt1HjyC0v7fhZ3vGfwJSnEQXf7R31um\njA0yoSjyX7uyXYRvUlL8aibqoKw19U0WmwAKj9VCOdf7IFnd6WqcisZACq4IjcZU\nTE6ev3MqxAbdmz4dVPvz4GvqseQ39bktmIHEVkH3hQcCggCAKOx/wZWbwx507GbT\nyh9Z9jzHJr9vViAKYSYEbH1LgwwDiyJ5kJTSDOZTOXFKFPdLRj38A9KVZ5jyrrBT\n7/TgTnZL5o+9zY8OX3fTySlQVCLS2fZHHL/QMNcsCWtyhcONBZ6YV2rWR+m+iATa\nwDJ3WdVkddpPwKMZ9qEzcG5bsAsCggCBANUJBDf7DUy9sEaAy/iA7ZsRRaeKLPF8\n0+sFFdlxxtTJP6bXDoaTF1Jp5rFApJ7C1fxTIeptsUEjnjysb3YPYsGtdYvXPAzG\nnCqvzQk/PinVgx3y3G/FbrnpaobqUoGAs5VTQpvnPtUZpOMGOSZEkepkLbb46fLQ\nNwMPYlgtfdf9AoIAgEEbKzsfgWN72TIdSO7ZsYCdpy4vq9EqNMIYyplY4ue1Ogn+\nGlN6UM60S/+MF0uu+KKa3KBjFD+kZCyM90IESw9rshzRceaXtEetk8Z5kOIKGznt\noyCsfrxJbKn3qbH+zM0HDVEfGCiMmIpB2l/DShQjCRGyPAL7OG0GEDw9uQI6\n-----END RSA PRIVATE KEY-----\n", + "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9E5ykn/RPmJlTN9HJ2wkjjMJu5AB8YfcGX9uKCA9jVq0urN+LPqVy1jzCzPaxi2z05Cia0IH/G0w99SMdmkuDUQ/j+F8/U0Ja2whsiINgqvM0QWAClI7UCSoFny1UvaCk9S5J1ork/eU+ORu3jd2CdOEjIy82iLSDueALovqz3rQm8Gq5qY693zBVpb9WlvJmsqpHC+awwfWkYSuFIB4SsiY53AzzC0J10tLc7ifF+2zTqnIRwaG6m8fyWmH2r6MonGmDvCFSQ4nJmgw3VeAO+1EVvP0++XGo/RI55wQc/7jII6ANwlrr0tIUXGaVKiD0GK0K/mpEXCu8oawxhx6x", + "resource_uri": "/api/2.0/keypairs/186106ac-afb5-40e5-a0de-6f0feba5a3d5/", + "tags": [], + "uuid": "186106ac-afb5-40e5-a0de-6f0feba5a3d5" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/cloudsigma_2_0/keypairs_import.json b/libcloud/test/compute/fixtures/cloudsigma_2_0/keypairs_import.json new file mode 100644 index 0000000000..4d32fb299e --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudsigma_2_0/keypairs_import.json @@ -0,0 +1,16 @@ +{ + "objects": [ + { + "fingerprint": "e8:ee:43:72:38:09:6d:1e:8e:46:9e:76:80:a3:0a:01", + "grantees": [], + "meta": {}, + "name": "test_key", + "permissions": [], + "private_key": null, + "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9E5ykn/RPmJlTN9HJ2wkjjMJu5AB8YfcGX9uKCA9jVq0urN+LPqVy1jzCzPaxi2z05Cia0IH/G0w99SMdmkuDUQ/j+F8/U0Ja2whsiINgqvM0QWAClI7UCSoFny1UvaCk9S5J1ork/eU+ORu3jd2CdOEjIy82iLSDueALovqz3rQm8Gq5qY693zBVpb9WlvJmsqpHC+awwfWkYSuFIB4SsiY53AzzC0J10tLc7ifF+2zTqnIRwaG6m8fyWmH2r6MonGmDvCFSQ4nJmgw3VeAO+1EVvP0++XGo/RI55wQc/7jII6ANwlrr0tIUXGaVKiD0GK0K/mpEXCu8oawxhx6x", + "resource_uri": "/api/2.0/keypairs/6d7db550-d1c5-4e3b-9c0a-e83f6a2b8244/", + "tags": [], + "uuid": "6d7db550-d1c5-4e3b-9c0a-e83f6a2b8244" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/cloudsigma_2_0/keypairs_list.json b/libcloud/test/compute/fixtures/cloudsigma_2_0/keypairs_list.json new file mode 100644 index 0000000000..446642abc3 --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudsigma_2_0/keypairs_list.json @@ -0,0 +1,33 @@ +{ + "meta": { + "limit": 0, + "offset": 0, + "total_count": 2 + }, + "objects": [ + { + "fingerprint": "8c:71:a2:f0:bc:a4:45:66:a8:59:77:6d:80:d5:a0:89", + "grantees": [], + "meta": {}, + "name": "ala", + "permissions": [], + "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEqQIBAAKCAQEAvROcpJ/0T5iZUzfRydsJI4zCbuQAfGH3Bl/biggPY1atLqzf\niz6lctY8wsz2sYts9OQomtCB/xtMPfUjHZpLg1EP4/hfP1NCWtsIbIiDYKrzNEFg\nApSO1AkqBZ8tVL2gpPUuSdaK5P3lPjkbt43dgnThIyMvNoi0g7ngC6L6s960JvBq\nuamOvd8wVaW/VpbyZrKqRwvmsMH1pGErhSAeErImOdwM8wtCddLS3O4nxfts06py\nEcGhupvH8lph9q+jKJxpg7whUkOJyZoMN1XgDvtRFbz9PvlxqP0SOecEHP+4yCOg\nDcJa69LSFFxmlSog9BitCv5qRFwrvKGsMYcesQIDAQABAoIBAQCYBufhend/dIx7\n3BsDuemMOwavEQbO/BoadwLX5okw76WKLRgFJxby0g3C9/i3Ywr1kWqQqGyOCY3x\nF2TnzYNAD/K985vqF/D3irwoQE+ab3njn1kqWfbJyKCQKp/RTjOXz0gruKSvYPJt\naI+/tALSfVX04bp5l8vFSrQ5xw7bhiiFifATuDStVLSzzmEli6Pbne4mcKIXiReu\nK1OlSKPF9SbCxCcEvEhUhQqs7U/N+sEYmUSQ/q8rNdolWQD0c/EGn2RF0siNolxp\nylo5c7E/LvwgTW6DLYaEZDgORnYHEwiaG7YxJAuFFPoQNFIjoGEF5wKOGL/kKtVr\npyriY/k9AoIAgQDRKEf+B+SLO/P/rPP7CCCIh4tR9uXl6hbnEp40sx5AomZmIwfy\nZGRp+iIN3YhM2XQ96fb47Lgc4AsDUHKt+9ASqJWWn0f06sbaaVsTfKpxVuI1kPsh\nGVpuOqwQCnXFyTvvirrdTlAw32hOzl1VVL0bL57MsAkpmjHnqsEqYTpIhwKCAIEA\n52wIL3RMT6bGjfx/PMsyTOa9AFSLzsjvoOt1HjyC0v7fhZ3vGfwJSnEQXf7R31um\njA0yoSjyX7uyXYRvUlL8aibqoKw19U0WmwAKj9VCOdf7IFnd6WqcisZACq4IjcZU\nTE6ev3MqxAbdmz4dVPvz4GvqseQ39bktmIHEVkH3hQcCggCAKOx/wZWbwx507GbT\nyh9Z9jzHJr9vViAKYSYEbH1LgwwDiyJ5kJTSDOZTOXFKFPdLRj38A9KVZ5jyrrBT\n7/TgTnZL5o+9zY8OX3fTySlQVCLS2fZHHL/QMNcsCWtyhcONBZ6YV2rWR+m+iATa\nwDJ3WdVkddpPwKMZ9qEzcG5bsAsCggCBANUJBDf7DUy9sEaAy/iA7ZsRRaeKLPF8\n0+sFFdlxxtTJP6bXDoaTF1Jp5rFApJ7C1fxTIeptsUEjnjysb3YPYsGtdYvXPAzG\nnCqvzQk/PinVgx3y3G/FbrnpaobqUoGAs5VTQpvnPtUZpOMGOSZEkepkLbb46fLQ\nNwMPYlgtfdf9AoIAgEEbKzsfgWN72TIdSO7ZsYCdpy4vq9EqNMIYyplY4ue1Ogn+\nGlN6UM60S/+MF0uu+KKa3KBjFD+kZCyM90IESw9rshzRceaXtEetk8Z5kOIKGznt\noyCsfrxJbKn3qbH+zM0HDVEfGCiMmIpB2l/DShQjCRGyPAL7OG0GEDw9uQI6\n-----END RSA PRIVATE KEY-----\n", + "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9E5ykn/RPmJlTN9HJ2wkjjMJu5AB8YfcGX9uKCA9jVq0urN+LPqVy1jzCzPaxi2z05Cia0IH/G0w99SMdmkuDUQ/j+F8/U0Ja2whsiINgqvM0QWAClI7UCSoFny1UvaCk9S5J1ork/eU+ORu3jd2CdOEjIy82iLSDueALovqz3rQm8Gq5qY693zBVpb9WlvJmsqpHC+awwfWkYSuFIB4SsiY53AzzC0J10tLc7ifF+2zTqnIRwaG6m8fyWmH2r6MonGmDvCFSQ4nJmgw3VeAO+1EVvP0++XGo/RI55wQc/7jII6ANwlrr0tIUXGaVKiD0GK0K/mpEXCu8oawxhx6x", + "resource_uri": "/api/2.0/keypairs/186106ac-afb5-40e5-a0de-6f0feba5a3d5/", + "tags": [], + "uuid": "186106ac-afb5-40e5-a0de-6f0feba5a3d5" + }, + { + "fingerprint": "99:1e:71:ea:d1:43:80:55:14:ca:27:5c:64:69:3b:10", + "grantees": [], + "meta": {}, + "name": "test_name", + "permissions": [], + "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpwIBAAKCAQEAs4068mFSGTm025oanVSpityZji/2S3A0jRJW1ku47cd+pRBl\nj9k2c2zC4zPBL2EeY8RNMrN/RqLIBU0LsH9LZ6m7QeFVwg2H0SWdh4joFzzcLRkk\n8shvx54l26Ahac1Owh8yERnyum1mbo4VIpJjBUx2Xd6HukXDIvBbW/fxe3KO7rML\nNStkxACSuRmGX+UptMc1M0B3wdpHmGEsLiJn7Rs1CM8gQS6iI88Eywf+usdaHMzf\n8w2sjC7wmlKfYNKUwnQoUCMhwo646JCdE672584OXdmG+aqO9rNcxhbtiViojLrk\ncbLtsHIdn4lUvU5dOx/iUL+H5vRvdHwTpHZaYwIDAQABAoIBAAadFyTCbPG87GqC\nXKSa77vLsGRKY/oXYfgoSsaN93vas1GFLxiDWbwar3sK9vy1yRbHrkhF0FRbvp5j\nXiDcL3zcBafBkxUYxn3vssPBSTtB5KJMoM3IkEV8D8ztMw3goBwKZh+3Ive2++Tq\nmuCxH7CcRmfiwIEd/LgWvma+1UhEuisw2y9F+m9Xl4TRwt34utyyVcjKDPH146W9\ne2ZyFwAcvDOTA8oI+txgA57m284QqHo04YHZdbPN3ovPBNwpfKCpNjneab91fTXX\nX48RY7O1MpDdvbE4l3ELptJq/E74xRsmsZziwRVAV0X6Eb6B2s/0xvKG2/+eDZz7\n1c/gG/ECggCBAMx6111Xtptw93dNZpYBHGNoulh+jn9p8RLIrbpOCncZ0v7EMdV1\n8TYgEDQ0n5TuUx501jWKTNbvoXyTUsAUkvA7VyyH2o8UTtqPgRi8ShB+DePZmRt8\nCwHzjUo86N4BnD6rcfFlFvQMzHRcAmvLrkMtkImgQHFHHh/JjMDjweYdAoIAgQDg\nyn8qWgueIPphlLW6vP9oL+01dHKU3oDlhtUME6/cOwZtzex4tRmx3NbIN/lpfRS7\ndVczIjwcGwHbWi/yeS0bSTK8QEMZYBEi7Qqzzdr0uCF9OjKTDPhZTKFQdeZLjtU4\neFGQeBpjQzRYojEKZNYL3NJF4v7tNw5i28aEM6tafwKCAIB17RJvfrqNguT1JOpY\n8GMS4b82ciZ0TQD/OEUZAREAByCsVTH4TYDDGlK+COtP1PKSygcP8abG/oQ/eCdt\nJ3Bmo5Ju2BqwEaI4YjKttUlxoYEZOtEWDL+8bF27xsz13C/j5LRd51MJhKgVI0sy\nJ9FkZM7K0GTZ743r/yzxwWh98QKCAIBTQKv4M4E5/1y75yenEXhGTfm8YnRNTlrO\npzEgV+o51mJ7KFj8G5Z4mSGy5Ygp2XlkNAEnnvZEMnxtkOlRFC/wexufPO2c6Edw\nd/oOvZ7qI4fDqVoxvAv+hrL36bJxKWUulOEgcFrViH5KlUc0YkQkAJSf7YIcuNdL\nJbpQHBLKYQKCAIBj9rEmDdnGqoseRMLZPXduUHdv6bXhmsw9jVIlB088sg19ZSW/\nng4UvesHB3vSylZIEYhEdnIBqlc84XeXEMRSYVZ9x+RMDP5jJ44Uq52iGYarIhwg\nW8m4q0JmhnPM0M3fRQxbIXOaUQvDgjGuLlzDCY9JjiEfyTgMJATNKK2O4Q==\n-----END RSA PRIVATE KEY-----\n", + "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzjTryYVIZObTbmhqdVKmK3JmOL/ZLcDSNElbWS7jtx36lEGWP2TZzbMLjM8EvYR5jxE0ys39GosgFTQuwf0tnqbtB4VXCDYfRJZ2HiOgXPNwtGSTyyG/HniXboCFpzU7CHzIRGfK6bWZujhUikmMFTHZd3oe6RcMi8Ftb9/F7co7usws1K2TEAJK5GYZf5Sm0xzUzQHfB2keYYSwuImftGzUIzyBBLqIjzwTLB/66x1oczN/zDayMLvCaUp9g0pTCdChQIyHCjrjokJ0Trvbnzg5d2Yb5qo72s1zGFu2JWKiMuuRxsu2wch2fiVS9Tl07H+JQv4fm9G90fBOkdlpj", + "resource_uri": "/api/2.0/keypairs/b4fa47cf-f929-4dde-b77a-ea1d326862bd/", + "tags": [], + "uuid": "b4fa47cf-f929-4dde-b77a-ea1d326862bd" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/cloudsigma_2_0/libdrives.json b/libcloud/test/compute/fixtures/cloudsigma_2_0/libdrives.json index c55e9a5f6d..2c4eb296cc 100644 --- a/libcloud/test/compute/fixtures/cloudsigma_2_0/libdrives.json +++ b/libcloud/test/compute/fixtures/cloudsigma_2_0/libdrives.json @@ -26,7 +26,7 @@ "owner": null, "paid": false, "resource_uri": "/api/2.0/libdrives/6eca8d96-44bc-4637-af97-77ccd7ba4144/", - "size": 1000000000, + "size": 1073741824, "status": "unmounted", "storage_type": null, "tags": [], diff --git a/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_clone.json b/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_clone.json index 44b03c64d1..6b88c8e607 100644 --- a/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_clone.json +++ b/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_clone.json @@ -9,8 +9,8 @@ "dev_channel": "0:0", "device": "ide", "drive": { - "resource_uri": "/api/2.0/drives/f1e42abe-f7db-4dcc-b37e-e53aca7a3ba9/", - "uuid": "f1e42abe-f7db-4dcc-b37e-e53aca7a3ba9" + "resource_uri": "/api/2.0/drives/b02311e2-a83c-4c12-af10-b30d51c86913/", + "uuid": "b02311e2-a83c-4c12-af10-b30d51c86913" } } ], diff --git a/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_create_with_vlan.json b/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_create_with_vlan.json index ee1b2d7820..114f839bb9 100644 --- a/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_create_with_vlan.json +++ b/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_create_with_vlan.json @@ -11,8 +11,8 @@ "dev_channel": "0:0", "device": "ide", "drive": { - "resource_uri": "/api/2.0/drives/7c0efbb2-b1e8-4e77-9d72-9f9f9d75ae7b/", - "uuid": "7c0efbb2-b1e8-4e77-9d72-9f9f9d75ae7b" + "resource_uri": "/api/2.0/drives/b02311e2-a83c-4c12-af10-b30d51c86913/", + "uuid": "b02311e2-a83c-4c12-af10-b30d51c86913" }, "runtime": null } diff --git a/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_detail_mixed_state.json b/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_detail_mixed_state.json index b89ec2b86e..919aef5adc 100644 --- a/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_detail_mixed_state.json +++ b/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_detail_mixed_state.json @@ -117,8 +117,8 @@ "dev_channel": "0:0", "device": "ide", "drive": { - "resource_uri": "/api/2.0/drives/3f74acec-ba3c-4efd-ab9e-5d95a4c5fca9/", - "uuid": "3f74acec-ba3c-4efd-ab9e-5d95a4c5fca9" + "resource_uri": "/api/2.0/drives/b02311e2-a83c-4c12-af10-b30d51c86913/", + "uuid": "b02311e2-a83c-4c12-af10-b30d51c86913" } } ], diff --git a/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_get.json b/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_get.json new file mode 100644 index 0000000000..b414433555 --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudsigma_2_0/servers_get.json @@ -0,0 +1,108 @@ +{ + "allocation_pool": null, + "auto_start": false, + "context": true, + "cpu": 1000, + "cpu_model": null, + "cpu_type": "intel", + "cpus_instead_of_cores": true, + "drives": [ + { + "boot_order": 1, + "dev_channel": "0:0", + "device": "virtio", + "drive": { + "resource_uri": "/api/2.0/drives/9d1d2cf3-08c1-462f-8485-f4b073560809/", + "uuid": "9d1d2cf3-08c1-462f-8485-f4b073560809" + }, + "runtime": null + } + ], + "enable_numa": true, + "grantees": [], + "hv_relaxed": false, + "hv_tsc": false, + "hypervisor": "kvm", + "jobs": [], + "mem": 536870912, + "meta": { + "description": "", + "optimize_for": "linux_vm", + "ssh_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9E5ykn/RPmJlTN9HJ2wkjjMJu5AB8YfcGX9uKCA9jVq0urN+LPqVy1jzCzPaxi2z05Cia0IH/G0w99SMdmkuDUQ/j+F8/U0Ja2whsiINgqvM0QWAClI7UCSoFny1UvaCk9S5J1ork/eU+ORu3jd2CdOEjIy82iLSDueALovqz3rQm8Gq5qY693zBVpb9WlvJmsqpHC+awwfWkYSuFIB4SsiY53AzzC0J10tLc7ifF+2zTqnIRwaG6m8fyWmH2r6MonGmDvCFSQ4nJmgw3VeAO+1EVvP0++XGo/RI55wQc/7jII6ANwlrr0tIUXGaVKiD0GK0K/mpEXCu8oawxhx6x" + }, + "name": "test_server", + "nics": [ + { + "boot_order": null, + "firewall_policy": null, + "ip_v4_conf": { + "conf": "dhcp", + "ip": null + }, + "ip_v6_conf": null, + "mac": "22:61:ce:67:cd:09", + "model": "virtio", + "runtime": { + "interface_type": "public", + "io": { + "bytes_recv": 0, + "bytes_sent": 0, + "packets_recv": 0, + "packets_sent": 0 + }, + "ip_v4": { + "resource_uri": "/api/2.0/ips/162.213.38.202/", + "uuid": "162.213.38.202" + }, + "ip_v6": null, + "rx_foreign": 0, + "rx_local": 0, + "tx_foreign": 0, + "tx_local": 0 + }, + "vlan": null + } + ], + "owner": { + "resource_uri": "/api/2.0/user/69fcfc03-d635-4f99-a8b3-e1b73637cb5d/", + "uuid": "69fcfc03-d635-4f99-a8b3-e1b73637cb5d" + }, + "permissions": [], + "pubkeys": [ + { + "resource_uri": "/api/2.0/pubkeys/186106ac-afb5-40e5-a0de-6f0feba5a3d5/", + "uuid": "186106ac-afb5-40e5-a0de-6f0feba5a3d5" + } + ], + "requirements": [], + "resource_uri": "/api/2.0/servers/3df825cb-9c1b-470d-acbd-03e1a966c046/", + "runtime": { + "active_since": "2021-03-01T11:14:30+00:00", + "nics": [ + { + "interface_type": "public", + "io": { + "bytes_recv": 0, + "bytes_sent": 0, + "packets_recv": 0, + "packets_sent": 0 + }, + "ip_v4": { + "resource_uri": "/api/2.0/ips/162.213.38.202/", + "uuid": "162.213.38.202" + }, + "ip_v6": null, + "mac": "22:61:ce:67:cd:09", + "rx_foreign": 0, + "rx_local": 0, + "tx_foreign": 0, + "tx_local": 0 + } + ] + }, + "smp": 1, + "status": "running", + "tags": [], + "uuid": "3df825cb-9c1b-470d-acbd-03e1a966c046", + "vnc_password": "vnc_password" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/cloudsigma_2_0/subscriptions.json b/libcloud/test/compute/fixtures/cloudsigma_2_0/subscriptions.json index f57b6efe2b..be57306838 100644 --- a/libcloud/test/compute/fixtures/cloudsigma_2_0/subscriptions.json +++ b/libcloud/test/compute/fixtures/cloudsigma_2_0/subscriptions.json @@ -99,6 +99,25 @@ "status": "active", "subscribed_object": null, "uuid": "8965ff95-4924-40a9-b923-a58615149732" + }, + { + "amount": "32212254720", + "auto_renew": true, + "descendants": [], + "discount_amount": null, + "discount_percent": null, + "end_time": "", + "id": "5555", + "last_notification": null, + "period": "365 days, 0:00:00", + "price": "0E-20", + "remaining": "32212254720", + "resource": "dssd", + "resource_uri": "/api/2.0/subscriptions/3987/", + "start_time": null, + "status": "active", + "subscribed_object": null, + "uuid": "8965ff95-4924-40a9-b923-a58615149732" } ], "price": "0E-20" diff --git a/libcloud/test/compute/fixtures/cloudstack/createVolume_withvolumetype.json b/libcloud/test/compute/fixtures/cloudstack/createVolume_withvolumetype.json new file mode 100644 index 0000000000..dc51b35ef7 --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudstack/createVolume_withvolumetype.json @@ -0,0 +1 @@ +{ "createvolumeresponse" : {"id":"60338035-92fb-4d27-98d4-b60ad4b38b87","jobid":"createvolumejob"} } diff --git a/libcloud/test/compute/fixtures/cloudstack/listDiskOfferings_withvolumetype.json b/libcloud/test/compute/fixtures/cloudstack/listDiskOfferings_withvolumetype.json new file mode 100644 index 0000000000..f279b95536 --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudstack/listDiskOfferings_withvolumetype.json @@ -0,0 +1 @@ +{ "listdiskofferingsresponse" : { "count":1 ,"diskoffering" : [ {"id":"6345e3b7-227e-4209-8f8c-1f94219696e6","name":"Disk offer 1","displaytext":"Disk offer 1 display name","disksize":10,"created":"2012-04-24T16:35:55+0200","iscustomized":false} ] } } diff --git a/libcloud/test/compute/fixtures/cloudstack/listProjects_default.json b/libcloud/test/compute/fixtures/cloudstack/listProjects_default.json index b100edf756..39e2f2a529 100644 --- a/libcloud/test/compute/fixtures/cloudstack/listProjects_default.json +++ b/libcloud/test/compute/fixtures/cloudstack/listProjects_default.json @@ -18,7 +18,7 @@ "memorylimit": 128000, "memorytotal": 56000, "networkavailable": 0, - "networklimit": 0, + "networklimit": "Unlimited", "networktotal": 0, "primarystorageavailable": 1204, "primarystoragelimit": 1600, @@ -46,4 +46,4 @@ "vpctotal": 0 } ] -} } \ No newline at end of file +} } diff --git a/libcloud/test/compute/fixtures/cloudstack/listVirtualMachines_default.json b/libcloud/test/compute/fixtures/cloudstack/listVirtualMachines_default.json index d55c436b2e..38a5817e8e 100644 --- a/libcloud/test/compute/fixtures/cloudstack/listVirtualMachines_default.json +++ b/libcloud/test/compute/fixtures/cloudstack/listVirtualMachines_default.json @@ -1 +1 @@ -{ "listvirtualmachinesresponse" : { "virtualmachine" : [ {"id":2600,"name":"test","displayname":"test","account":"fakeaccount","domainid":801,"domain":"AA000062-libcloud-dev","created":"2011-06-23T05:06:42+0000","state":"Running","haenable":false,"zoneid":1,"zonename":"Sydney","templateid":421,"templatename":"XEN Basic Ubuntu 10.04 Server x64 PV r2.0","templatedisplaytext":"XEN Basic Ubuntu 10.04 Server x64 PV r2.0","passwordenabled":false,"serviceofferingid":105,"serviceofferingname":"Compute Micro PRD","cpunumber":1,"cpuspeed":1200,"memory":384,"cpuused":"1.78%","networkkbsread":2,"networkkbswrite":2,"guestosid":12,"rootdeviceid":0,"rootdevicetype":"IscsiLUN","securitygroup":[],"nic":[{"id":3891,"networkid":860,"netmask":"255.255.240.0","gateway":"1.1.2.1","ipaddress":"1.1.1.116","traffictype":"Guest","type":"Virtual","isdefault":true}],"hypervisor":"XenServer"}, {"id":2601,"name":"test","displayname":"test","account":"fakeaccount","domainid":801,"domain":"AA000062-libcloud-dev","created":"2011-06-23T05:09:44+0000","state":"Starting","haenable":false,"zoneid":1,"zonename":"Sydney","templateid":421,"templatename":"XEN Basic Ubuntu 10.04 Server x64 PV r2.0","templatedisplaytext":"XEN Basic Ubuntu 10.04 Server x64 PV r2.0","passwordenabled":false,"serviceofferingid":105,"serviceofferingname":"Compute Micro PRD","cpunumber":1,"cpuspeed":1200,"memory":384,"guestosid":12,"rootdeviceid":0,"rootdevicetype":"IscsiLUN","securitygroup":[],"jobid":17147,"jobstatus":0,"nic":[{"id":3892,"networkid":860,"netmask":"255.255.240.0","gateway":"1.1.2.1","ipaddress":"1.1.1.203","traffictype":"Guest","type":"Virtual","isdefault":true}],"hypervisor":"XenServer"} ] } } +{ "listvirtualmachinesresponse" : { "virtualmachine" : [ {"id":2600,"name":"test","displayname":"test","account":"fakeaccount","domainid":801,"domain":"AA000062-libcloud-dev","created":"2011-06-23T05:06:42+0000","state":"Running","haenable":false,"zoneid":1,"zonename":"Sydney","templateid":421,"templatename":"XEN Basic Ubuntu 10.04 Server x64 PV r2.0","templatedisplaytext":"XEN Basic Ubuntu 10.04 Server x64 PV r2.0","passwordenabled":false,"serviceofferingid":105,"serviceofferingname":"Compute Micro PRD","cpunumber":1,"cpuspeed":1200,"memory":384,"cpuused":"1.78%","networkkbsread":2,"networkkbswrite":2,"guestosid":12,"rootdeviceid":0,"rootdevicetype":"IscsiLUN","securitygroup":[],"nic":[{"id":3891,"networkid":860,"netmask":"255.255.240.0","gateway":"1.1.2.1","ipaddress":"1.1.1.116","traffictype":"Guest","type":"Virtual","isdefault":true}],"hypervisor":"XenServer", "tags": [{"key": "testkey", "value": "testvalue"}, {"key": "foo", "value": "bar"}]}, {"id":2601,"name":"test","displayname":"test","account":"fakeaccount","domainid":801,"domain":"AA000062-libcloud-dev","created":"2011-06-23T05:09:44+0000","state":"Starting","haenable":false,"zoneid":1,"zonename":"Sydney","templateid":421,"templatename":"XEN Basic Ubuntu 10.04 Server x64 PV r2.0","templatedisplaytext":"XEN Basic Ubuntu 10.04 Server x64 PV r2.0","passwordenabled":false,"serviceofferingid":105,"serviceofferingname":"Compute Micro PRD","cpunumber":1,"cpuspeed":1200,"memory":384,"guestosid":12,"rootdeviceid":0,"rootdevicetype":"IscsiLUN","securitygroup":[],"jobid":17147,"jobstatus":0,"nic":[{"id":3892,"networkid":860,"netmask":"255.255.240.0","gateway":"1.1.2.1","ipaddress":"1.1.1.203","traffictype":"Guest","type":"Virtual","isdefault":true}],"hypervisor":"XenServer"} ] } } diff --git a/libcloud/test/compute/fixtures/cloudstack/listVirtualMachines_noipaddress.json b/libcloud/test/compute/fixtures/cloudstack/listVirtualMachines_noipaddress.json new file mode 100644 index 0000000000..ede3a23c2f --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudstack/listVirtualMachines_noipaddress.json @@ -0,0 +1,98 @@ +{ + "listvirtualmachinesresponse" : { + "virtualmachine" : [ + { + "id":2600, + "name":"test", + "displayname":"test", + "account":"fakeaccount", + "domainid":801, + "domain":"AA000062-libcloud-dev", + "created":"2011-06-23T05:06:42+0000", + "state":"Running", + "haenable":false, + "zoneid":1, + "zonename":"Sydney", + "templateid":421, + "templatename":"XEN Basic Ubuntu 10.04 Server x64 PV r2.0", + "templatedisplaytext":"XEN Basic Ubuntu 10.04 Server x64 PV r2.0", + "passwordenabled":false, + "serviceofferingid":105, + "serviceofferingname":"Compute Micro PRD", + "cpunumber":1, + "cpuspeed":1200, + "memory":384, + "cpuused":"1.78%", + "networkkbsread":2, + "networkkbswrite":2, + "guestosid":12, + "rootdeviceid":0, + "rootdevicetype":"IscsiLUN", + "securitygroup":[], + "nic":[ + { + "id":3891, + "networkid":860, + "netmask":"255.255.240.0", + "gateway":"1.1.2.1", + "ipaddress":"1.1.1.116", + "traffictype":"Guest", + "type":"Virtual", + "isdefault":true + }, + { + "id":3892, + "networkid":861, + "type":"Virtual", + "isdefault":false + } + ], + "hypervisor":"XenServer", + "tags": [ + {"key": "testkey", "value": "testvalue"}, + {"key": "foo", "value": "bar"}] + }, + { + "id":2601, + "name":"test", + "displayname":"test", + "account":"fakeaccount", + "domainid":801, + "domain":"AA000062-libcloud-dev", + "created":"2011-06-23T05:09:44+0000", + "state":"Starting", + "haenable":false, + "zoneid":1, + "zonename":"Sydney", + "templateid":421, + "templatename":"XEN Basic Ubuntu 10.04 Server x64 PV r2.0", + "templatedisplaytext":"XEN Basic Ubuntu 10.04 Server x64 PV r2.0", + "passwordenabled":false, + "serviceofferingid":105, + "serviceofferingname": "Compute Micro PRD", + "cpunumber":1, + "cpuspeed":1200, + "memory":384, + "guestosid":12, + "rootdeviceid":0, + "rootdevicetype":"IscsiLUN", + "securitygroup":[], + "jobid":17147, + "jobstatus":0, + "nic":[ + { + "id":3892, + "networkid":860, + "netmask":"255.255.240.0", + "gateway":"1.1.2.1", + "ipaddress":"1.1.1.203", + "traffictype":"Guest", + "type":"Virtual", + "isdefault":true + } + ], + "hypervisor":"XenServer" + } + ] + } +} diff --git a/libcloud/test/compute/fixtures/cloudstack/listZones_withvolumetype.json b/libcloud/test/compute/fixtures/cloudstack/listZones_withvolumetype.json new file mode 100644 index 0000000000..0316936e45 --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudstack/listZones_withvolumetype.json @@ -0,0 +1 @@ +{ "listzonesresponse" : { "zone" : [ {"id":1,"name":"Sydney","networktype":"Advanced","securitygroupsenabled":false} ] } } diff --git a/libcloud/test/compute/fixtures/cloudstack/queryAsyncJobResult_17200.json b/libcloud/test/compute/fixtures/cloudstack/queryAsyncJobResult_17200.json index d028ab4949..61645f9c42 100644 --- a/libcloud/test/compute/fixtures/cloudstack/queryAsyncJobResult_17200.json +++ b/libcloud/test/compute/fixtures/cloudstack/queryAsyncJobResult_17200.json @@ -1 +1 @@ -{"queryasyncjobresultresponse":{"jobid":17200,"jobstatus":1,"jobprocstatus":0,"jobresultcode":0,"jobresulttype":"object","jobresult":{"securitygroup":[{"egressrule":[],"account":"runseb@gmail.com","domainid":"ab53d864-6f78-4993-bb28-9b8667b535a1","name":"MySG","domain":"runseb@gmail.com","ingressrule":[{"startport":22,"cidr":"0.0.0.0/0","protocol":"tcp","endport":22,"ruleid":"7df1edc8-6e56-48d7-b816-39377506d787"}],"id":"fa334c44-21c6-4809-ad7d-287bbb23c29b"}]}}} +{ "queryasyncjobresultresponse" : {"accountid":"00000000-0000-0000-0000-000000000000","userid":"111111-1111-1111-1111-111111111111","cmd":"org.apache.cloudstack.api.command.user.securitygroup.AuthorizeSecurityGroupIngressCmd","jobstatus":1,"jobprocstatus":0,"jobresultcode":0,"jobresulttype":"object","jobresult":{"securitygroup":{"id":"222222-2222-2222-2222-222222222222","name":"test_sg","description":"Test security group","account":"smith@example.com","domainid":"333333-3333-3333-3333-333333333333","domain":"smith@example.com","ingressrule":[{"ruleid":"444444-4444-4444-4444-444444444444","protocol":"udp","startport":0,"endport":65535,"cidr":"0.0.0.0/0"}],"egressrule":[],"tags":[]}},"created":"2015-09-15T15:00:00+0200","jobid":"17200"} } diff --git a/libcloud/test/compute/fixtures/cloudstack/queryAsyncJobResult_88776.json b/libcloud/test/compute/fixtures/cloudstack/queryAsyncJobResult_88776.json new file mode 100644 index 0000000000..a01c3a36e7 --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudstack/queryAsyncJobResult_88776.json @@ -0,0 +1 @@ +{ "queryasyncjobresultresponse": {"jobprocstatus": 0, "jobstatus": 1, "jobresult": {"virtualmachine": {"serviceofferingid": "eee-fff-ggg-hhh"}}}} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/cloudstack/queryAsyncJobResult_88777.json b/libcloud/test/compute/fixtures/cloudstack/queryAsyncJobResult_88777.json new file mode 100644 index 0000000000..8e0685eba8 --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudstack/queryAsyncJobResult_88777.json @@ -0,0 +1 @@ +{ "queryasyncjobresultresponse": {"jobprocstatus": 0, "jobstatus": 1, "jobresult": {"virtualmachine": {"templateid": "aaa-bbb-ccc-ddd"}}}} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/cloudstack/restoreVirtualMachine_default.json b/libcloud/test/compute/fixtures/cloudstack/restoreVirtualMachine_default.json new file mode 100644 index 0000000000..058680957d --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudstack/restoreVirtualMachine_default.json @@ -0,0 +1 @@ +{ "restorevirtualmachineresponse" : { "jobid" : 88777} } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/cloudstack/scaleVirtualMachine_default.json b/libcloud/test/compute/fixtures/cloudstack/scaleVirtualMachine_default.json new file mode 100644 index 0000000000..bdab77bc43 --- /dev/null +++ b/libcloud/test/compute/fixtures/cloudstack/scaleVirtualMachine_default.json @@ -0,0 +1 @@ +{ "scalevirtualmachineresponse" : { "jobid" : 88776} } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/create_node.json b/libcloud/test/compute/fixtures/digitalocean_v1/create_node.json deleted file mode 100644 index acddc0800b..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/create_node.json +++ /dev/null @@ -1 +0,0 @@ -{"status":"OK","droplet":{"id":119461,"name":"test-2","image_id":1601,"size_id":66,"event_id":919341}} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/destroy_node.json b/libcloud/test/compute/fixtures/digitalocean_v1/destroy_node.json deleted file mode 100644 index bae818d035..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/destroy_node.json +++ /dev/null @@ -1 +0,0 @@ -{"status":"OK","event_id":918910} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/error.txt b/libcloud/test/compute/fixtures/digitalocean_v1/error.txt deleted file mode 100644 index 0e90e519ee..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/error.txt +++ /dev/null @@ -1 +0,0 @@ -You are being redirected. diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/error_invalid_image.json b/libcloud/test/compute/fixtures/digitalocean_v1/error_invalid_image.json deleted file mode 100644 index e1ccb4f939..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/error_invalid_image.json +++ /dev/null @@ -1 +0,0 @@ -{"status":"ERROR","error_message":"You specified an invalid image for Droplet creation.","message":"You specified an invalid image for Droplet creation."} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/ex_create_ssh_key.json b/libcloud/test/compute/fixtures/digitalocean_v1/ex_create_ssh_key.json deleted file mode 100644 index 029cab266e..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/ex_create_ssh_key.json +++ /dev/null @@ -1 +0,0 @@ -{"status":"OK","ssh_key":{"id":7717,"name":"test1","ssh_pub_key":"aaq"}} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/ex_destroy_ssh_key.json b/libcloud/test/compute/fixtures/digitalocean_v1/ex_destroy_ssh_key.json deleted file mode 100644 index 12d1b5927d..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/ex_destroy_ssh_key.json +++ /dev/null @@ -1 +0,0 @@ -{"status":"OK"} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/ex_list_ssh_keys.json b/libcloud/test/compute/fixtures/digitalocean_v1/ex_list_ssh_keys.json deleted file mode 100644 index 11119763b2..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/ex_list_ssh_keys.json +++ /dev/null @@ -1 +0,0 @@ -{"status":"OK","ssh_keys":[{"id":7717,"name":"test1"}]} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/ex_rename_node.json b/libcloud/test/compute/fixtures/digitalocean_v1/ex_rename_node.json deleted file mode 100644 index bae818d035..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/ex_rename_node.json +++ /dev/null @@ -1 +0,0 @@ -{"status":"OK","event_id":918910} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/list_images.json b/libcloud/test/compute/fixtures/digitalocean_v1/list_images.json deleted file mode 100644 index 007a57d73b..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/list_images.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "status": "OK", - "images": [ - { - "id": 1601, - "name": "CentOS 5.8 x64", - "distribution": "CentOS" - }, - { - "id": 1602, - "name": "CentOS 5.8 x32", - "distribution": "CentOS" - }, - { - "id": 1605, - "name": "CentOS 6.0 x32", - "distribution": "CentOS" - }, - { - "id": 1606, - "name": "Fedora 15 x64", - "distribution": "Fedora" - }, - { - "id": 1609, - "name": "Ubuntu 11.10 x32 Server", - "distribution": "Ubuntu" - }, - { - "id": 1611, - "name": "CentOS 6.2 x64", - "distribution": "CentOS" - }, - { - "id": 1615, - "name": "Fedora 16 x64 Server", - "distribution": "Fedora" - }, - { - "id": 1618, - "name": "Fedora 16 x64 Desktop", - "distribution": "Fedora" - }, - { - "id": 2676, - "name": "Ubuntu 12.04 x64 Server", - "distribution": "Ubuntu" - }, - { - "id": 12573, - "name": "Debian 6.0 x64", - "distribution": "Debian" - }, - { - "id": 12574, - "name": "CentOS 6.3 x64", - "distribution": "CentOS" - }, - { - "id": 12575, - "name": "Debian 6.0 x32", - "distribution": "Debian" - }, - { - "id": 12578, - "name": "CentOS 6.3 x32", - "distribution": "CentOS" - }, - { - "id": 14097, - "name": "Ubuntu 10.04 x64 Server", - "distribution": "Ubuntu" - }, - { - "id": 14098, - "name": "Ubuntu 10.04 x32 Server", - "distribution": "Ubuntu" - }, - { - "id": 14218, - "name": "Ubuntu 12.04 x64 Desktop", - "distribution": "Ubuntu" - }, - { - "id": 25306, - "name": "Ubuntu 12.10 x32 Server", - "distribution": "Ubuntu" - }, - { - "id": 25485, - "name": "Ubuntu 12.10 x32 Desktop", - "distribution": "Ubuntu" - }, - { - "id": 25489, - "name": "Ubuntu 12.10 x64 Server", - "distribution": "Ubuntu" - }, - { - "id": 25493, - "name": "Ubuntu 12.10 x64 Desktop", - "distribution": "Ubuntu" - }, - { - "id": 32387, - "name": "Fedora 17 x32 Server", - "distribution": "Fedora" - }, - { - "id": 32399, - "name": "Fedora 17 x32 Desktop", - "distribution": "Fedora" - }, - { - "id": 32419, - "name": "Fedora 17 x64 Desktop", - "distribution": "Fedora" - }, - { - "id": 32428, - "name": "Fedora 17 x64 Server", - "distribution": "Fedora" - }, - { - "id": 42735, - "name": "Ubuntu 12.04 x32 Server", - "distribution": "Ubuntu" - }, - { - "id": 43458, - "name": "Ubuntu 11.04x64 Server", - "distribution": "Ubuntu" - }, - { - "id": 43462, - "name": "Ubuntu 11.04x32 Desktop", - "distribution": "Ubuntu" - }, - { - "id": 46964, - "name": "LAMP on Ubuntu 12.04", - "distribution": "Ubuntu" - } - ] -} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/list_locations.json b/libcloud/test/compute/fixtures/digitalocean_v1/list_locations.json deleted file mode 100644 index a87b38f2cd..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/list_locations.json +++ /dev/null @@ -1 +0,0 @@ -{"status":"OK","regions":[{"id":1,"name":"New York 1"},{"id":2,"name":"Amsterdam 1"}]} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/list_nodes.json b/libcloud/test/compute/fixtures/digitalocean_v1/list_nodes.json deleted file mode 100644 index 5fe59491ac..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/list_nodes.json +++ /dev/null @@ -1 +0,0 @@ -{"status":"OK","droplets":[{"id":119461,"name":"test-2","image_id":1601,"size_id":66,"region_id":1,"backups_active":null,"ip_address":null,"status":"new"}]} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/list_nodes_empty.json b/libcloud/test/compute/fixtures/digitalocean_v1/list_nodes_empty.json deleted file mode 100644 index bc62108c5a..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/list_nodes_empty.json +++ /dev/null @@ -1 +0,0 @@ -{"status":"OK","droplets":[]} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/list_nodes_page_2.json b/libcloud/test/compute/fixtures/digitalocean_v1/list_nodes_page_2.json deleted file mode 100644 index e6b89ba830..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/list_nodes_page_2.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "droplets": [ - { - "id": 3164445, - "name": "example1.com", - "memory": 512, - "vcpus": 1, - "disk": 20, - "locked": false, - "status": "active", - "kernel": { - "id": 2233, - "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic", - "version": "3.13.0-37-generic" - }, - "created_at": "2014-11-14T16:29:21Z", - "features": [ - "backups", - "ipv6", - "virtio" - ], - "backup_ids": [ - 7938002 - ], - "snapshot_ids": [ - - ], - "image": { - "id": 6918990, - "name": "14.04 x64", - "distribution": "Ubuntu", - "slug": "ubuntu-14-04-x64", - "public": true, - "regions": [ - "nyc1", - "ams1", - "sfo1", - "nyc2", - "ams2", - "sgp1", - "lon1", - "nyc3", - "ams3", - "nyc3" - ], - "created_at": "2014-10-17T20:24:33Z", - "min_disk_size": 20 - }, - "size_slug": "512mb", - "networks": { - "v4": [ - { - "ip_address": "104.236.32.182", - "netmask": "255.255.192.0", - "gateway": "104.236.0.1", - "type": "public" - } - ], - "v6": [ - { - "ip_address": "2604:A880:0800:0010:0000:0000:02DD:4001", - "netmask": 64, - "gateway": "2604:A880:0800:0010:0000:0000:0000:0001", - "type": "public" - } - ] - }, - "region": { - "name": "New York 3", - "slug": "nyc3", - "sizes": [ - - ], - "features": [ - "virtio", - "private_networking", - "backups", - "ipv6", - "metadata" - ], - "available": null - } - } - ], - "links": { - "pages": - { - "first":"https://api.digitalocean.com/v2/droplets?page=1", - "prev":"https://api.digitalocean.com/v2/droplets?page=1" - } - }, - "meta": { - "total":2 - } -} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/list_sizes.json b/libcloud/test/compute/fixtures/digitalocean_v1/list_sizes.json deleted file mode 100644 index 99acc575c6..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/list_sizes.json +++ /dev/null @@ -1 +0,0 @@ -{"status":"OK","sizes":[{"id":66,"name":"512MB"},{"id":63,"name":"1GB"},{"id":62,"name":"2GB"},{"id":64,"name":"4GB"},{"id":65,"name":"8GB"},{"id":61,"name":"16GB"},{"id":60,"name":"32GB"},{"id":70,"name":"48GB"},{"id":69,"name":"64GB"},{"id":68,"name":"96GB"}]} diff --git a/libcloud/test/compute/fixtures/digitalocean_v1/reboot_node.json b/libcloud/test/compute/fixtures/digitalocean_v1/reboot_node.json deleted file mode 100644 index bae818d035..0000000000 --- a/libcloud/test/compute/fixtures/digitalocean_v1/reboot_node.json +++ /dev/null @@ -1 +0,0 @@ -{"status":"OK","event_id":918910} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/attach_floating_ip.json b/libcloud/test/compute/fixtures/digitalocean_v2/attach_floating_ip.json new file mode 100644 index 0000000000..c5773f0adf --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/attach_floating_ip.json @@ -0,0 +1 @@ +{"action":{"id":397123123,"status":"in-progress","type":"assign_ip","started_at":"2018-03-19T14:16:04Z","completed_at":null,"resource_id":1812306133,"resource_type":"floating_ip","region":{"name":"Amsterdam 3","slug":"ams3","sizes":["512mb","1gb","2gb","4gb","8gb","c-16","s-1vcpu-3gb","c-2","c-4","c-8","m-1vcpu-8gb","m-16gb","m-32gb","m-64gb","m-128gb","m-224gb","s-1vcpu-1gb","s-3vcpu-1gb","s-1vcpu-2gb","s-2vcpu-2gb","s-2vcpu-4gb","s-4vcpu-8gb","s-6vcpu-16gb","16gb","s-8vcpu-32gb","32gb","s-12vcpu-48gb","48gb","s-16vcpu-64gb","64gb","s-20vcpu-96gb"],"features":["private_networking","backups","ipv6","metadata","install_agent","storage"],"available":true},"region_slug":"ams3"}} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/attach_volume.json b/libcloud/test/compute/fixtures/digitalocean_v2/attach_volume.json new file mode 100644 index 0000000000..398bca0004 --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/attach_volume.json @@ -0,0 +1,34 @@ +{ + "action": { + "region_slug": "nyc1", + "region": { + "available": true, + "features": [ + "private_networking", + "backups", + "ipv6", + "metadata" + ], + "sizes": [ + "512mb", + "1gb", + "2gb", + "4gb", + "8gb", + "16gb", + "32gb", + "48gb", + "64gb" + ], + "slug": "nyc1", + "name": "New York 1" + }, + "resource_type": "backend", + "resource_id": null, + "completed_at": null, + "started_at": "2016-06-06T21:01:30Z", + "type": "attach_volume", + "status": "in-progress", + "id": 110956293 + } +} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/create_floating_ip.json b/libcloud/test/compute/fixtures/digitalocean_v2/create_floating_ip.json new file mode 100644 index 0000000000..dbacd74a38 --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/create_floating_ip.json @@ -0,0 +1 @@ +{"floating_ip":{"ip":"167.138.123.111","droplet":null,"region":{"name":"New York 1","slug":"nyc1","sizes":["64gb","512mb","1gb","2gb","4gb","8gb","16gb","32gb","48gb","c-16","s-1vcpu-3gb","c-2","c-4","c-8","m-1vcpu-8gb","m-16gb","m-32gb","m-64gb","m-128gb","m-224gb","s-1vcpu-1gb","s-3vcpu-1gb","s-1vcpu-2gb","s-2vcpu-2gb","s-2vcpu-4gb","s-4vcpu-8gb","s-6vcpu-16gb","s-8vcpu-32gb","s-12vcpu-48gb","s-16vcpu-64gb","s-20vcpu-96gb","s-24vcpu-128gb"],"features":["private_networking","backups","ipv6","metadata","install_agent","storage"],"available":true},"locked":false},"links":{}} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/create_volume.json b/libcloud/test/compute/fixtures/digitalocean_v2/create_volume.json new file mode 100644 index 0000000000..dd336aaeca --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/create_volume.json @@ -0,0 +1,32 @@ +{ + "volume": { + "created_at": "2016-06-06T20:51:04Z", + "size_gigabytes": 4, + "description": "Block store for examples", + "name": "example", + "droplet_ids": [], + "region": { + "available": true, + "features": [ + "private_networking", + "backups", + "ipv6", + "metadata" + ], + "sizes": [ + "512mb", + "1gb", + "2gb", + "4gb", + "8gb", + "16gb", + "32gb", + "48gb", + "64gb" + ], + "slug": "nyc1", + "name": "New York 1" + }, + "id": "62766883-2c28-11e6-b8e6-000f53306ae1" + } +} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/create_volume_snapshot.json b/libcloud/test/compute/fixtures/digitalocean_v2/create_volume_snapshot.json new file mode 100644 index 0000000000..ce4a6915c6 --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/create_volume_snapshot.json @@ -0,0 +1,14 @@ +{ + "snapshot": { + "id": "c0def940-9324-11e6-9a56-000f533176b1", + "name": "test-snapshot", + "regions": [ + "nyc1" + ], + "created_at": "2016-10-15T22:14:34Z", + "resource_id": "8371d4fe-92b0-11e6-9a56-000f533176b1", + "resource_type": "volume", + "min_disk_size": 1, + "size_gigabytes": 0 + } +} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/detach_floating_ip.json b/libcloud/test/compute/fixtures/digitalocean_v2/detach_floating_ip.json new file mode 100644 index 0000000000..eecb8fb3b1 --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/detach_floating_ip.json @@ -0,0 +1 @@ +{"action":{"id":397123123,"status":"in-progress","type":"unassign_ip","started_at":"2018-03-19T14:19:33Z","completed_at":null,"resource_id":9946493837,"resource_type":"floating_ip","region":{"name":"Amsterdam 3","slug":"ams3","sizes":["512mb","1gb","2gb","4gb","8gb","c-16","s-1vcpu-3gb","c-2","c-4","c-8","m-1vcpu-8gb","m-16gb","m-32gb","m-64gb","m-128gb","m-224gb","s-1vcpu-1gb","s-3vcpu-1gb","s-1vcpu-2gb","s-2vcpu-2gb","s-2vcpu-4gb","s-4vcpu-8gb","s-6vcpu-16gb","16gb","s-8vcpu-32gb","32gb","s-12vcpu-48gb","48gb","s-16vcpu-64gb","64gb","s-20vcpu-96gb"],"features":["private_networking","backups","ipv6","metadata","install_agent","storage"],"available":true},"region_slug":"ams3"}} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/detach_volume.json b/libcloud/test/compute/fixtures/digitalocean_v2/detach_volume.json new file mode 100644 index 0000000000..9ef1c3348d --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/detach_volume.json @@ -0,0 +1,34 @@ +{ + "action": { + "region_slug": "nyc1", + "region": { + "available": true, + "features": [ + "private_networking", + "backups", + "ipv6", + "metadata" + ], + "sizes": [ + "512mb", + "1gb", + "2gb", + "4gb", + "8gb", + "16gb", + "32gb", + "48gb", + "64gb" + ], + "slug": "nyc1", + "name": "New York 1" + }, + "resource_type": "backend", + "resource_id": null, + "completed_at": null, + "started_at": "2016-06-06T21:02:20Z", + "type": "detach_volume", + "status": "in-progress", + "id": 110956599 + } +} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/ex_change_kernel.json b/libcloud/test/compute/fixtures/digitalocean_v2/ex_change_kernel.json new file mode 100644 index 0000000000..561101ffad --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/ex_change_kernel.json @@ -0,0 +1,12 @@ +{ + "action": { + "id": 36077295, + "status": "in-progress", + "type": "kernel_change", + "started_at": "2014-11-04T17:08:03Z", + "completed_at": null, + "resource_id": 3067650, + "resource_type": "droplet", + "region": "ams2" + } +} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/ex_enable_ipv6.json b/libcloud/test/compute/fixtures/digitalocean_v2/ex_enable_ipv6.json new file mode 100644 index 0000000000..9386b97e0c --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/ex_enable_ipv6.json @@ -0,0 +1,13 @@ +{ + "action": { + "id": 36804954, + "status": "in-progress", + "type": "enable_ipv6", + "started_at": "2014-11-14T16:34:24Z", + "completed_at": null, + "resource_id": 3164450, + "resource_type": "droplet", + "region": "ams2", + "region_slug": "ams2" + } +} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/ex_hard_reboot.json b/libcloud/test/compute/fixtures/digitalocean_v2/ex_hard_reboot.json new file mode 100644 index 0000000000..891b32e682 --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/ex_hard_reboot.json @@ -0,0 +1,12 @@ +{ + "action": { + "id": 36077294, + "status": "in-progress", + "type": "power_cycle", + "started_at": "2014-11-04T17:08:03Z", + "completed_at": null, + "resource_id": 3067651, + "resource_type": "droplet", + "region": "ams3" + } +} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/ex_rebuild_node.json b/libcloud/test/compute/fixtures/digitalocean_v2/ex_rebuild_node.json new file mode 100644 index 0000000000..154ddce329 --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/ex_rebuild_node.json @@ -0,0 +1,12 @@ +{ + "action": { + "id": 36804758, + "status": "in-progress", + "type": "rebuild", + "started_at": "2014-11-14T16:31:19Z", + "completed_at": null, + "resource_id": 3164450, + "resource_type": "droplet", + "region_slug": "nyc3" + } +} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/ex_resize_node.json b/libcloud/test/compute/fixtures/digitalocean_v2/ex_resize_node.json new file mode 100644 index 0000000000..94f5f0cdd3 --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/ex_resize_node.json @@ -0,0 +1,12 @@ +{ + "action": { + "id": 36804758, + "status": "in-progress", + "type": "resize", + "started_at": "2014-11-14T16:31:19Z", + "completed_at": null, + "resource_id": 3164450, + "resource_type": "droplet", + "region_slug": "nyc3" + } +} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/list_floating_ips.json b/libcloud/test/compute/fixtures/digitalocean_v2/list_floating_ips.json new file mode 100644 index 0000000000..2960989980 --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/list_floating_ips.json @@ -0,0 +1,2 @@ +{"floating_ips":[{"ip":"133.166.122.204","droplet":{"status":"active","kernel": null,"volume_ids": [],"locked": false,"name":"vdloo-magweb","backup_ids": [],"created_at":"2018-03-01T10:15:06Z","snapshot_ids": [],"size_slug":"2gb","id": 84155775,"next_backup_window": null,"vcpus": 2,"features": [],"image": {"regions": ["ams3"],"min_disk_size": 80,"public": false,"name":"hypernode","distribution":"Ubuntu","created_at":"2018-05-23T14:16:34Z","size_gigabytes": 1.02,"type":"snapshot","slug": null,"id": 12367123},"memory": 4096,"region": {"available": true,"slug":"ams3","features": ["private_networking","backups","ipv6","metadata","install_agent","storage"],"name":"Amsterdam 3","sizes": ["64gb","512mb","1gb","2gb","4gb","8gb","16gb","32gb","36gb","c-16","s-1vcpu-3gb","c-2","c-4","c-8","m-1vcpu-8gb","m-16gb","m-32gb","m-64gb","m-128gb","m-224gb","s-1vcpu-1gb","s-3vcpu-1gb","s-1vcpu-2gb","s-2vcpu-2gb","s-2vcpu-4gb","s-4vcpu-8gb","s-6vcpu-16gb","s-8vcpu-32gb","s-12vcpu-36gb","s-16vcpu-64gb","s-20vcpu-96gb","s-24vcpu-128gb"]},"disk": 80,"networks": {"v4": [{"ip_address":"145.65.193.36","netmask":"255.255.280.0","type":"public","gateway":"145.65.192.1"}],"v6": []},"tags": [],"size": {"price_monthly": 20.0,"available": true,"vcpus": 2,"regions": ["ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sgp1","tor1"],"memory": 4096,"transfer": 3.0,"disk": 80,"price_hourly": 0.02976,"slug":"2gb"}},"region":{"name":"Amsterdam 3","slug":"ams3","sizes":["64gb","512mb","1gb","2gb","4gb","8gb","16gb","32gb","36gb","c-16","s-1vcpu-3gb","c-2","c-4","c-8","m-1vcpu-8gb","m-16gb","m-32gb","m-64gb","m-128gb","m-224gb","s-1vcpu-1gb","s-3vcpu-1gb","s-1vcpu-2gb","s-2vcpu-2gb","s-2vcpu-4gb","s-4vcpu-8gb","s-6vcpu-16gb","s-8vcpu-32gb","s-12vcpu-36gb","s-16vcpu-64gb","s-20vcpu-96gb","s-24vcpu-128gb"],"features":["private_networking","backups","ipv6","metadata","install_agent","storage"],"available":true},"locked":false},{"ip":"154.138.103.175","droplet":null,"region":{"name":"Amsterdam 3","slug":"ams3","sizes":["64gb","512mb","1gb","2gb","4gb","8gb","16gb","32gb","36gb","c-16","s-1vcpu-3gb","c-2","c-4","c-8","m-1vcpu-8gb","m-16gb","m-32gb","m-64gb","m-128gb","m-224gb","s-1vcpu-1gb","s-3vcpu-1gb","s-1vcpu-2gb","s-2vcpu-2gb","s-2vcpu-4gb","s-4vcpu-8gb","s-6vcpu-16gb","s-8vcpu-32gb","s-12vcpu-36gb","s-16vcpu-64gb","s-20vcpu-96gb","s-24vcpu-128gb"],"features":["private_networking","backups","ipv6","metadata","install_agent","storage"],"available":true},"locked":false}],"links":{},"meta":{"total":2}} + diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/list_locations.json b/libcloud/test/compute/fixtures/digitalocean_v2/list_locations.json index 50a483109c..afd255502a 100644 --- a/libcloud/test/compute/fixtures/digitalocean_v2/list_locations.json +++ b/libcloud/test/compute/fixtures/digitalocean_v2/list_locations.json @@ -7,7 +7,7 @@ "1gb", "512mb" ], - "available": false, + "available": true, "features": [ "virtio", "private_networking", @@ -35,7 +35,7 @@ "1gb", "512mb" ], - "available": true, + "available": false, "features": [ "virtio", "backups" diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/list_node.json b/libcloud/test/compute/fixtures/digitalocean_v2/list_node.json new file mode 100644 index 0000000000..33c571f454 --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/list_node.json @@ -0,0 +1,112 @@ +{ + "droplet": { + "status": "active", + "kernel": { + "version": "3.13.0-57-generic", + "id": 5175, + "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-57-generic" + }, + "volume_ids": [], + "locked": false, + "name": "example.com", + "backup_ids": [], + "created_at": "2015-11-10T11:01:41Z", + "snapshot_ids": [], + "size_slug": "8gb", + "networks": { + "v4": [ + { + "type": "public", + "netmask": "255.255.255.0", + "ip_address": "36.123.0.123", + "gateway": "36.123.0.1" + } + ], + "v6": [] + }, + "next_backup_window": null, + "vcpus": 4, + "size": { + "price_monthly": 80.0, + "available": true, + "transfer": 5.0, + "price_hourly": 0.11905, + "regions": [ + "ams2", + "ams3", + "blr1", + "fra1", + "lon1", + "nyc1", + "nyc2", + "nyc3", + "sfo1", + "sfo2", + "sgp1", + "tor1" + ], + "vcpus": 4, + "memory": 8192, + "disk": 80, + "slug": "8gb" + }, + "image": { + "min_disk_size": 20, + "slug": null, + "name": "14.04 x64", + "created_at": "2014-13-13T20:20:20Z", + "id": 12089443, + "regions": [ + "ams2", + "nyc3" + ], + "distribution": "Ubuntu", + "type": "snapshot", + "public": false, + "size_gigabytes": 1.76 + }, + "memory": 8192, + "region": { + "available": true, + "sizes": [ + "32gb", + "16gb", + "2gb", + "1gb", + "4gb", + "8gb", + "512mb", + "48gb", + "s-1vcpu-3gb", + "m-1vcpu-8gb", + "m-16gb", + "m-32gb", + "s-1vcpu-1gb", + "s-1vcpu-2gb", + "s-2vcpu-2gb", + "s-3vcpu-1gb", + "s-2vcpu-4gb", + "s-4vcpu-8gb", + "s-6vcpu-16gb", + "s-8vcpu-32gb", + "s-12vcpu-48gb" + ], + "features": [ + "private_networking", + "backups", + "ipv6", + "metadata", + "install_agent", + "image_transfer" + ], + "name": "Amsterdam 2", + "slug": "ams2" + }, + "disk": 40, + "id": 3164444, + "tags": ["mytag1", "mytag2"], + "features": [ + "virtio" + ] + } +} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/list_nodes.json b/libcloud/test/compute/fixtures/digitalocean_v2/list_nodes.json index b14ae88030..31f01b80f6 100644 --- a/libcloud/test/compute/fixtures/digitalocean_v2/list_nodes.json +++ b/libcloud/test/compute/fixtures/digitalocean_v2/list_nodes.json @@ -2,88 +2,190 @@ "droplets": [ { "id": 3164444, - "name": "example.com", - "memory": 512, + "name": "ubuntu-s-1vcpu-1gb-sfo3-01", + "memory": 1024, "vcpus": 1, - "disk": 20, + "disk": 25, "locked": false, "status": "active", - "kernel": { - "id": 2233, - "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic", - "version": "3.13.0-37-generic" - }, - "created_at": "2014-11-14T16:29:21Z", + "kernel": null, + "created_at": "2020-10-15T13:58:22Z", "features": [ - "backups", - "ipv6", - "virtio" - ], - "backup_ids": [ - 7938002 - ], - "snapshot_ids": [ - + "private_networking", + "ipv6" ], + "backup_ids": [], + "next_backup_window": null, + "snapshot_ids": [], "image": { - "id": 6918990, - "name": "14.04 x64", + "id": 69463186, + "name": "20.04 (LTS) x64", "distribution": "Ubuntu", - "slug": "ubuntu-14-04-x64", + "slug": "ubuntu-20-04-x64", "public": true, "regions": [ + "nyc3", "nyc1", - "ams1", "sfo1", "nyc2", "ams2", "sgp1", "lon1", - "nyc3", "ams3", - "nyc3" + "fra1", + "tor1", + "sfo2", + "blr1", + "sfo3" + ], + "created_at": "2020-09-03T02:05:57Z", + "min_disk_size": 15, + "type": "base", + "size_gigabytes": 2.36, + "description": "Ubuntu 20.04 x86", + "tags": [], + "status": "available" + }, + "volume_ids": [], + "size": { + "slug": "s-1vcpu-1gb", + "memory": 1024, + "vcpus": 1, + "disk": 25, + "transfer": 1, + "price_monthly": 5, + "price_hourly": 0.00744, + "regions": [ + "ams2", + "ams3", + "blr1", + "fra1", + "lon1", + "nyc1", + "nyc2", + "nyc3", + "sfo1", + "sfo2", + "sfo3", + "sgp1", + "tor1" ], - "created_at": "2014-10-17T20:24:33Z", - "min_disk_size": 20 + "available": true }, - "size_slug": "512mb", + "size_slug": "s-1vcpu-1gb", "networks": { "v4": [ { - "ip_address": "104.236.32.182", - "netmask": "255.255.192.0", - "gateway": "104.236.0.1", + "ip_address": "10.124.0.2", + "netmask": "255.255.240.0", + "gateway": "", + "type": "private" + }, + { + "ip_address": "128.199.13.158", + "netmask": "255.255.240.0", + "gateway": "128.199.0.1", "type": "public" } ], "v6": [ { - "ip_address": "2604:A880:0800:0010:0000:0000:02DD:4001", + "ip_address": "2604:a880:4:1d0::142:9000", "netmask": 64, - "gateway": "2604:A880:0800:0010:0000:0000:0000:0001", + "gateway": "2604:a880:4:1d0::1", "type": "public" } ] }, "region": { - "name": "New York 3", - "slug": "nyc3", - "sizes": [ - - ], + "name": "San Francisco 3", + "slug": "sfo3", "features": [ - "virtio", "private_networking", "backups", "ipv6", - "metadata" + "metadata", + "install_agent", + "storage", + "image_transfer" ], - "available": null - } + "available": true, + "sizes": [ + "s-1vcpu-1gb", + "512mb", + "s-1vcpu-2gb", + "1gb", + "s-3vcpu-1gb", + "s-2vcpu-2gb", + "s-1vcpu-3gb", + "s-2vcpu-4gb", + "2gb", + "s-4vcpu-8gb", + "m-1vcpu-8gb", + "c-2", + "4gb", + "c2-2vcpu-4gb", + "g-2vcpu-8gb", + "gd-2vcpu-8gb", + "m-16gb", + "s-8vcpu-16gb", + "s-6vcpu-16gb", + "c-4", + "8gb", + "c2-4vpcu-8gb", + "m-2vcpu-16gb", + "m3-2vcpu-16gb", + "g-4vcpu-16gb", + "gd-4vcpu-16gb", + "m6-2vcpu-16gb", + "m-32gb", + "s-8vcpu-32gb", + "c-8", + "16gb", + "c2-8vpcu-16gb", + "m-4vcpu-32gb", + "m3-4vcpu-32gb", + "g-8vcpu-32gb", + "s-12vcpu-48gb", + "gd-8vcpu-32gb", + "m6-4vcpu-32gb", + "m-64gb", + "s-16vcpu-64gb", + "c-16", + "32gb", + "c2-16vcpu-32gb", + "m-8vcpu-64gb", + "m3-8vcpu-64gb", + "g-16vcpu-64gb", + "s-20vcpu-96gb", + "48gb", + "gd-16vcpu-64gb", + "m6-8vcpu-64gb", + "m-128gb", + "s-24vcpu-128gb", + "c-32", + "64gb", + "c2-32vpcu-64gb", + "m-16vcpu-128gb", + "m3-16vcpu-128gb", + "g-32vcpu-128gb", + "s-32vcpu-192gb", + "gd-32vcpu-128gb", + "m-24vcpu-192gb", + "m-224gb", + "m6-16vcpu-128gb", + "m3-24vcpu-192gb", + "m6-24vcpu-192gb", + "m3-32vcpu-256gb", + "m6-32vcpu-256gb" + ] + }, + "tags": [], + "vpc_uuid": "11e7ec07-6abf-4a06-86fd-3eedb53d7458" } ], "links": {}, "meta": { "total": 1 } -} +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/list_nodes_page_1.json b/libcloud/test/compute/fixtures/digitalocean_v2/list_nodes_page_1.json index fb6fb08107..6f0c0302d3 100644 --- a/libcloud/test/compute/fixtures/digitalocean_v2/list_nodes_page_1.json +++ b/libcloud/test/compute/fixtures/digitalocean_v2/list_nodes_page_1.json @@ -79,7 +79,11 @@ "metadata" ], "available": null - } + }, + "tags": [ + "environment:prod", + "database" + ] } ], "links": { diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/list_volume_snapshots.json b/libcloud/test/compute/fixtures/digitalocean_v2/list_volume_snapshots.json new file mode 100644 index 0000000000..21ede3a65a --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/list_volume_snapshots.json @@ -0,0 +1,44 @@ +{ + "snapshots": [ + { + "id": "c0def940-9324-11e6-9a56-000f533176b1", + "name": "test-snapshot", + "regions": [ + "nyc1" + ], + "created_at": "2016-10-15T22:14:34Z", + "resource_id": "8371d4fe-92b0-11e6-9a56-000f533176b1", + "resource_type": "volume", + "min_disk_size": 1, + "size_gigabytes": 0 + }, + { + "id": "c2036724-9343-11e6-aef4-000f53315a41", + "name": "test-snapshot-2", + "regions": [ + "nyc1" + ], + "created_at": "2016-10-16T01:56:30Z", + "resource_id": "8371d4fe-92b0-11e6-9a56-000f533176b1", + "resource_type": "volume", + "min_disk_size": 1, + "size_gigabytes": 0 + }, + { + "id": "d347e033-9343-11e6-9a56-000f533176b1", + "name": "test-snapshot-3", + "regions": [ + "nyc1" + ], + "created_at": "2016-10-16T01:56:59Z", + "resource_id": "8371d4fe-92b0-11e6-9a56-000f533176b1", + "resource_type": "volume", + "min_disk_size": 1, + "size_gigabytes": 0 + } + ], + "links": {}, + "meta": { + "total": 3 + } +} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/list_volumes.json b/libcloud/test/compute/fixtures/digitalocean_v2/list_volumes.json new file mode 100644 index 0000000000..7ab3da8fed --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/list_volumes.json @@ -0,0 +1,38 @@ +{ + "volumes": [ + { + "size_gigabytes": 4, + "region": { + "slug": "nyc1", + "sizes": [ + "512mb", + "1gb", + "2gb", + "4gb", + "8gb", + "16gb", + "32gb", + "48gb", + "64gb" + ], + "name": "New York 1", + "features": [ + "private_networking", + "backups", + "ipv6", + "metadata" + ], + "available": true + }, + "name": "example", + "id": "62766883-2c28-11e6-b8e6-000f53306ae1", + "droplet_ids": [], + "description": "Block store for examples", + "created_at": "2016-06-06T20:51:04Z" + } + ], + "links": {}, + "meta": { + "total": 1 + } +} diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/list_volumes_empty.json b/libcloud/test/compute/fixtures/digitalocean_v2/list_volumes_empty.json new file mode 100644 index 0000000000..f05e66fa4e --- /dev/null +++ b/libcloud/test/compute/fixtures/digitalocean_v2/list_volumes_empty.json @@ -0,0 +1,7 @@ +{ + "volumes": [], + "links": {}, + "meta": { + "total": 0 + } +} diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/change_nic_networkadapter_response.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/change_nic_networkadapter_response.xml new file mode 100644 index 0000000000..40b60a5558 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/change_nic_networkadapter_response.xml @@ -0,0 +1,7 @@ + + CHANGE_NETWORK_ADAPTER + IN_PROGRESS + Request to Change Network Adapter for NIC with Id has been +accepted and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/deploy_customised_server.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/deploy_customised_server.xml new file mode 100644 index 0000000000..d84949420b --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/deploy_customised_server.xml @@ -0,0 +1,7 @@ + + + DEPLOY_UNCUSTOMIZED_SERVER + IN_PROGRESS + Request to deploy uncustomized Server 'Production Server' has been accepted and is being processed. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/exchange_nic_vlans_response.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/exchange_nic_vlans_response.xml new file mode 100644 index 0000000000..d0e8315aa5 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/exchange_nic_vlans_response.xml @@ -0,0 +1,8 @@ + + EXCHANGE_NIC_VLANS + OK + Request to exchange VLANs for Server with Id +'1cec8cfb-69e7-4de9-8404-debf116f5242' has been accepted and is being +processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/image_customerImage.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/image_customerImage.xml new file mode 100644 index 0000000000..16e679e8ac --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/image_customerImage.xml @@ -0,0 +1,57 @@ + + + + ImportedCustomerImage + + + + + + + 2 + + 2015-11-19T14:29:02.000Z + + + + + NORMAL + + + + + CustomerImageWithPricedSoftwareLabels + + + + + + + 1 + + MSSQL2008R2S + 2015-11-03T15:25:34.000Z + + + + NORMAL + + + + CopiedCustomerImage + + + + + + + 2 + + 2015-11-11T17:17:00.000Z + + + + NORMAL + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c.xml new file mode 100644 index 0000000000..9ca90f8e73 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c.xml @@ -0,0 +1,19 @@ + + + CustomerImageWithPricedSoftwareLabels + + + + + + + 1 + + MSSQL2008R2S + 2015-11-03T15:25:34.000Z + + + + NORMAL + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d.xml new file mode 100644 index 0000000000..e604436c03 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d.xml @@ -0,0 +1,19 @@ + + + ImportedCustomerImage + + + + + + + 2 + + 2015-11-19T14:29:02.000Z + + + + + NORMAL + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/image_osImage.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/image_osImage.xml new file mode 100644 index 0000000000..b31b42f48e --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/image_osImage.xml @@ -0,0 +1,40 @@ + + + + RedHat 6 64-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 4 + + 2015-09-17T11:23:48.000Z + T-RHEL-6-64-2-4-10 + + + + + + Win2012 DC 2 CPU + Windows 2012 Datacenter + + 4 + + 2015-09-17T11:44:43.000Z + T-WIN-2012-DATACTR-64-2-4-50 + + + + + + Win2008 Std 32-bit 2 CPU + Windows 2008 Enterprise R2 32-bit installed with Microsoft SQL Server 2012 Standard Edition + + 4 + + MSSQL2008R2S + 2014-11-20T12:54:22.000Z + T-WIN-2008-ENT-32-2-4-50 + + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a.xml new file mode 100644 index 0000000000..75e2f93d62 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a.xml @@ -0,0 +1,13 @@ + + + Win2012 DC 2 CPU + Windows 2012 Datacenter + + 4 + + 2015-09-17T11:44:43.000Z + T-WIN-2012-DATACTR-64-2-4-50 + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c.xml new file mode 100644 index 0000000000..87d47f5615 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c.xml @@ -0,0 +1,14 @@ + + + RedHat 6 64-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 4 + + 2015-09-17T11:23:48.000Z + T-RHEL-6-64-2-4-10 + + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/import_image_response.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/import_image_response.xml new file mode 100644 index 0000000000..b51b0bfe7c --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/import_image_response.xml @@ -0,0 +1,8 @@ + + IMPORT_IMAGE + IN_PROGRESS + Request to import image has been accepted and is being +processed. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/server_GetServer.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_GetServer.xml new file mode 100644 index 0000000000..1103422653 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_GetServer.xml @@ -0,0 +1,42 @@ + + + Production Web Server + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + stopped + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + + **OR** + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/server_cleanServer.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_cleanServer.xml new file mode 100644 index 0000000000..011dfd4085 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_cleanServer.xml @@ -0,0 +1,9 @@ + + +CLEAN_SERVER +IN_PROGRESS +The request to clean a failed Server deployment for Server +e75ead52-692f-4314-8725-c8a4f4d13a87 has been accepted and is being processed. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/server_clone_response.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_clone_response.xml new file mode 100644 index 0000000000..8f7c191d19 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_clone_response.xml @@ -0,0 +1,9 @@ + + CLONE_SERVER + IN_PROGRESS + Request to Clone Server '9ed47330-5561-11e5-8c14-b8ca3a5d9ef8' has been +accepted and is being processed. + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/server_server.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_server.xml new file mode 100644 index 0000000000..be9760a75e --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_server.xml @@ -0,0 +1,192 @@ + + + + + Production Web Server MCP 1 + nopassword0 + + + + + + 2 + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + NORMAL + + + + + Production Web Server MCP 1 + nopassword0 + + + + + + 2 + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + PENDING_ADD + + DEPLOY_SERVER_WITH_DISK_SPEED + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + RECONFIGURE_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + UNKNOWN + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + Production Web Server MCP 21 + Server to host our main web application. + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + false + UNKNOWN + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + false + NORMAL + + + + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/server_server_NA3.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_server_NA3.xml new file mode 100644 index 0000000000..56e4492d76 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_server_NA3.xml @@ -0,0 +1,56 @@ + + + + + Production Web Server MCP 1 + nopassword0 + + + 2 + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + NORMAL + + + + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml new file mode 100644 index 0000000000..c933f29a3a --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml @@ -0,0 +1,30 @@ + + + Production Web Server + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + DEPLOY_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/2_4/server_server_paginated.xml b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_server_paginated.xml new file mode 100644 index 0000000000..575d245955 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/2_4/server_server_paginated.xml @@ -0,0 +1,58 @@ + + + + + Production Web Server MCP 1 + nopassword0 + + + 2 + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + NORMAL + + + + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + + + diff --git a/libcloud/test/compute/fixtures/opsource/_oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server.xml b/libcloud/test/compute/fixtures/dimensiondata/_oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/_oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server.xml rename to libcloud/test/compute/fixtures/dimensiondata/_oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server.xml diff --git a/libcloud/test/compute/fixtures/dimensiondata/audit_log.csv b/libcloud/test/compute/fixtures/dimensiondata/audit_log.csv new file mode 100644 index 0000000000..6410373de6 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/audit_log.csv @@ -0,0 +1,25 @@ +UUID,Time,Create User,Department,Customer Defined 1,Customer Defined 2,Type,Name,Action,Details,Response Code +af779880-0531-45d3-be56-df41c459aa09,2016-09-11 23:59:37,ashaw_plat,,,,SERVER,ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7],Deploy Server,ATTEMPT: DEPLOY_SERVER 'ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7]', +d127748c-948f-41f0-b6a7-c0b5a2438bd6,2016-09-12 00:06:00,OEC_SYSTEM,,,,SERVER,ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7],Deploy Server,DEPLOY_SERVER 'ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7]',OK +85f978b2-0e2a-4ba3-a6ce-7567e329e842,2016-09-12 00:22:48,ashaw_plat,,,,SERVER,ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7],Start Server,ATTEMPT: START_SERVER 'ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7]', +afc67c82-381a-4ba1-b25e-2285a916d513,2016-09-12 00:23:00,OEC_SYSTEM,,,,SERVER,ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7],Start Server,START_SERVER 'ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7]',OK +7378b530-9d37-4339-88d5-19428431fe07,2016-09-12 05:10:47,ashaw_plat,,,,IP_BLOCK,168.128.37.196,Add IP Block,ATTEMPT: ADD_PUBLIC_IP_BLOCK '168.128.37.196', +f978f690-13e8-4d7d-8ce3-1ca7e232df69,2016-09-12 05:10:48,ashaw_plat,,,,IP_BLOCK,168.128.37.196,Add IP Block,ADD_PUBLIC_IP_BLOCK '168.128.37.196',OK +822b7483-bb59-4659-9ab1-7a1ad25bacd7,2016-09-12 05:10:58,ashaw_plat,,,,NAT_RULE,10.0.0.5,Create NAT Rule,ATTEMPT: CREATE_NAT_RULE '10.0.0.5'(requestId:au_20160912T151058137+1000_07422779-ec2a-448e-81f4-87a333b79f3c), +2f29ebd2-2ee0-463f-9a46-2e62f09fcc74,2016-09-12 05:10:59,ashaw_plat,,,,NAT_RULE,10.0.0.5,Create NAT Rule,CREATE_NAT_RULE '10.0.0.5'(requestId:au_20160912T151058137+1000_07422779-ec2a-448e-81f4-87a333b79f3c),OK +503aa140-6da9-4fbe-b94e-b118fc5a473a,2016-09-13 04:08:55,mgreenwood_plat,,,,NAT_RULE,10.208.136.11,Add NAT Rule,ATTEMPT: ADD_NAT_RULE '10.208.136.11', +bb73bb95-a20c-46f8-9962-3862496793ff,2016-09-13 04:09:00,OEC_SYSTEM,,,,NAT_RULE,10.208.136.11,Add NAT Rule,ADD_NAT_RULE '10.208.136.11',OK +276ab194-ffb3-4516-920d-96cc068dfcfa,2016-09-13 04:11:54,mgreenwood_plat,,,,NAT_RULE,10.208.136.11,Delete NAT Rule,ATTEMPT: DELETE_NAT_RULE '10.208.136.11', +3bb0e6ad-48e1-4268-9423-4cd680edc404,2016-09-13 04:11:57,OEC_SYSTEM,,,,NAT_RULE,10.208.136.11,Delete NAT Rule,DELETE_NAT_RULE '10.208.136.11',OK +f9f2684a-796c-4f28-9448-949900f8f4fb,2016-09-13 04:16:22,mgreenwood_plat,,,,NAT_RULE,10.208.136.11,Add NAT Rule,ATTEMPT: ADD_NAT_RULE '10.208.136.11', +0bfbe81f-35fc-445e-a33e-f12a46c25115,2016-09-13 04:16:27,OEC_SYSTEM,,,,NAT_RULE,10.208.136.11,Add NAT Rule,ADD_NAT_RULE '10.208.136.11',OK +629da5f4-7fdc-4bc6-a408-66ab96f539c0,2016-09-13 04:27:19,mgreenwood_plat,,,,ACL_RULE,AD LDAP Port - For Testing,Add Acl Rule,ATTEMPT: Add Acl Rule AD LDAP Port - For Testing to network Aperture, +ecee1409-ce7d-496d-a41b-67662d884598,2016-09-13 04:27:22,mgreenwood_plat,,,,ACL_RULE,AD LDAP Port - For Testing,Add Acl Rule,Add Acl Rule AD LDAP Port - For Testing to network Aperture,OK +f6e84763-b911-4189-bf69-138e9a23de7a,2016-09-14 03:05:15,aakbar_plat,,,,SERVER,CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62]',OK +ef43056e-1cd0-48bf-80f6-12a4cad8e1c6,2016-09-14 03:05:24,aakbar_plat,,,,SERVER,CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62]',OK +13f38aa4-a86c-45c2-909f-2a6b96c0c761,2016-09-14 03:13:21,aakbar_plat,,,,SERVER,CaaS-CI[10-209-120-16_ce81b50b-70d4-44ae-94d8-c2af8c22b244],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-CI[10-209-120-16_ce81b50b-70d4-44ae-94d8-c2af8c22b244]',OK +22aa854c-17a2-4f48-82a1-c10a052dd932,2016-09-14 05:42:04,mkumar_plat,,,,SERVER,CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62]',OK +6c7f3847-e2e8-47c8-8fd0-8c444015ad19,2016-09-14 05:51:58,mkumar_plat,,,,SERVER,CaaS-CI[10-209-120-16_ce81b50b-70d4-44ae-94d8-c2af8c22b244],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-CI[10-209-120-16_ce81b50b-70d4-44ae-94d8-c2af8c22b244]',OK +69ddc5a5-b815-439b-9d32-a1d60345355b,2016-09-14 06:02:50,mkumar_plat,,,,SERVER,CaaS-CI[10-209-120-16_ce81b50b-70d4-44ae-94d8-c2af8c22b244],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-CI[10-209-120-16_ce81b50b-70d4-44ae-94d8-c2af8c22b244]',OK +4ffa5524-926b-4747-9924-581c316b6a60,2016-09-14 06:05:49,mkumar_plat,,,,SERVER,CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62]',OK +599718fe-f58c-439b-87ae-86fb1347708e,2016-09-14 06:06:21,mkumar_plat,,,,SERVER,CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62]',OK diff --git a/libcloud/test/compute/fixtures/dimensiondata/detailed_usage_report.csv b/libcloud/test/compute/fixtures/dimensiondata/detailed_usage_report.csv new file mode 100644 index 0000000000..e746b476bf --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/detailed_usage_report.csv @@ -0,0 +1,42 @@ +Name,Type,Location,Private IP +Address,Status,"user:ATag","user:BTag","user:CTag",Start Time,End +Time,Duration (Hours),CPU Type,CPU Count, RAM (GB), Storage (GB),Economy +Storage (GB),CPU Hours,High Performance CPU Hours,RAM Hours,Storage +Hours,Economy Storage Hours,Bandwidth-In (GB),Bandwidth-Out (GB),Subadmin +Hours,Network Hours,Essentials Network Domain Hours,Advanced Network Domain +Hours,VLAN Hours,Public IP Hours,Cloud Files Account Hours,Cloud Storage (GB) +Server A,Server,NA1,10.162.12.16,Running,Bob,IT,,19/06/2014 04:16,19/06/2014 +11:17,7.03,Standard,1,2,10,0,7.03,0,14.05,70.27,0,0,0,0,0,0,0,0,0,0,0 +Server A,Server,NA1,10.162.12.16,Running,Bob,IT,,19/06/2014 11:17,20/06/2014 +00:00,12.71,High Performance,1,2,10,0,0,12.71,0,127.06,0,0,0,0,0,0,0,0,0,0,0 +Server B,Server,NA1,10.162.12.13,Running,Mary,IT,,19/06/2014 03:42,19/06/2014 +11:18,7.61,Essentials,1,2,10,0,0,0,15.22,76.1,0,0,0,0,0,0,0,0,0,0,0 +Server B,Server,NA1,10.162.12.13,Stopped,Mary,IT,,19/06/2014 11:18,19/06/2014 +23:18,12,Essentials,1,2,10,0,0,0,0,120,0,0,0,0,0,0,0,0,0,0,0 +Server B,Server,NA1,10.162.12.13,Stopped,Bob,IT,,19/06/2014 23:18,20/06/2014 +00:00,0.689722222,Essentials,1,2,10,0,0,0,0,6.897222223,0,0,0,0,0,0,0,0,0,0,0 +Customer Image A,Image,NA1,,Running,Bob,IT,,19/06/2014 03:30,20/06/2014 +00:00,20.5,,0,0,10,0,0,0,0,205,0,0,0,0,0,0,0,0,0,0,0 +Customer Image B,Image,NA1,,Running,Bob,IT,,19/06/2014 03:10,19/06/2014 +03:12,0.04,,0,0,10,0,0,0,0,0.44,0,0,0,0,0,0,0,0,0,0,0 +Joseph_F,Sub-Administrator,,,Running,Bob,IT,,19/06/2014 00:00,20/06/2014 +00:00,24,,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0 +Lguy,Sub-Administrator,,,Running,Mary,IT,,19/06/2014 00:00,20/06/2014 +00:00,24,,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0 +a network,Network,NA1,,Running,,IT,,19/06/2014 01:39,20/06/2014 +00:00,22.34,,0,0,0,0,0,0,0,0,0,0,0.9,0,22.34,0,0,0,0,0,0 +b network,Network,NA1,,Running,,IT,,19/06/2014 01:49,20/06/2014 +00:00,22.18,,0,0,0,0,0,0,0,0,0,0,7.1,0,22.18,0,0,0,0,0,0 +Rick's Network Domain,Network Domain,NA9,,Running,Bob,IT,,19/06/2014 +04:19,20/06/2014 00:00,19.68,,0,0,0,0,0,0,0,0,0,0,7.1,0,22.18,19.68,0,0,0,0,0 +Rick's VLAN,VLAN,NA9,,Running,Bob,IT,,19/06/2014 04:22,20/06/2014 +00:00,19.63,,0,0,0,0,0,0,0,0,0,0,0,0,22.18,0,0,19.63,0,0,0 +files1_koala,Cloud Files,,,Running,,IT,,19/06/2014 00:00,20/06/2014 +00:00,24,,0,0,0,0,0,0,0,0,0,0,0.5,0,0,0,0,0,0,24,52 +testbed,Cloud Files,,,Running,,IT,,19/06/2014 00:00,20/06/2014 +00:00,24,,0,0,0,0,0,0,0,0,0,0,0.01,0,0,0,0,0,0,24,100 +Network: b network IP Block: +168.143.92.136(4),IpBlock,NA1,,Reserved,Mary,IT,,19/06/2014 11:47,20/06/2014 +00:00,12.2,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48.82,0,0 +TOTAL for 19/06/14,,,,,,,,19/06/2014 00:00,20/06/2014 +00:00,24,,0,0,0,0,8,13,30,606,0,3,23,48,89,20,0,20,49,48,152 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/image_customerImage.xml b/libcloud/test/compute/fixtures/dimensiondata/image_customerImage.xml new file mode 100644 index 0000000000..4e59e1816a --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/image_customerImage.xml @@ -0,0 +1,50 @@ + + + + ImportedCustomerImage + + + + 2 + + 2015-11-19T14:29:02.000Z + + + + + NORMAL + + + + + CustomerImageWithPricedSoftwareLabels + + + + 1 + + MSSQL2008R2S + 2015-11-03T15:25:34.000Z + + + + NORMAL + + + + + CopiedCustomerImage + + + + 2 + + 2015-11-11T17:17:00.000Z + + + + NORMAL + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c.xml b/libcloud/test/compute/fixtures/dimensiondata/image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c.xml new file mode 100644 index 0000000000..bff6183fba --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c.xml @@ -0,0 +1,17 @@ + + + CustomerImageWithPricedSoftwareLabels + + + + 1 + + MSSQL2008R2S + 2015-11-03T15:25:34.000Z + + + + NORMAL + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d.xml b/libcloud/test/compute/fixtures/dimensiondata/image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d.xml new file mode 100644 index 0000000000..db5302d273 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d.xml @@ -0,0 +1,17 @@ + + + ImportedCustomerImage + + + + 2 + + 2015-11-19T14:29:02.000Z + + + + + NORMAL + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/image_customerImage_BAD_REQUEST.xml b/libcloud/test/compute/fixtures/dimensiondata/image_customerImage_BAD_REQUEST.xml new file mode 100644 index 0000000000..2579b63d39 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/image_customerImage_BAD_REQUEST.xml @@ -0,0 +1,6 @@ + + + GET_CUSTOMER_IMAGE + RESOURCE_NOT_FOUND + Server Image 2ffa36c8-1848-49eb-b4fa-9d908775f68c not found. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/image_osImage.xml b/libcloud/test/compute/fixtures/dimensiondata/image_osImage.xml new file mode 100644 index 0000000000..1f884a9197 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/image_osImage.xml @@ -0,0 +1,34 @@ + + + + RedHat 6 64-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + + 4 + + 2015-09-17T11:23:48.000Z + T-RHEL-6-64-2-4-10 + + + Win2012 DC 2 CPU + Windows 2012 Datacenter + + + 4 + + 2015-09-17T11:44:43.000Z + T-WIN-2012-DATACTR-64-2-4-50 + + + Win2008 Std 32-bit 2 CPU + Windows 2008 Enterprise R2 32-bit installed with Microsoft SQL Server 2012 Standard Edition + + + 4 + + MSSQL2008R2S + 2014-11-20T12:54:22.000Z + T-WIN-2008-ENT-32-2-4-50 + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a.xml b/libcloud/test/compute/fixtures/dimensiondata/image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a.xml new file mode 100644 index 0000000000..1631137c32 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a.xml @@ -0,0 +1,11 @@ + + + Win2012 DC 2 CPU + Windows 2012 Datacenter + + + 4 + + 2015-09-17T11:44:43.000Z + T-WIN-2012-DATACTR-64-2-4-50 + diff --git a/libcloud/test/compute/fixtures/dimensiondata/image_osImage_BAD_REQUEST.xml b/libcloud/test/compute/fixtures/dimensiondata/image_osImage_BAD_REQUEST.xml new file mode 100644 index 0000000000..009164843b --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/image_osImage_BAD_REQUEST.xml @@ -0,0 +1,6 @@ + + + GET_OS_IMAGE + RESOURCE_NOT_FOUND + Server Image 2ffa36c8-1848-49eb-b4fa-9d908775f68c not found. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c.xml b/libcloud/test/compute/fixtures/dimensiondata/image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c.xml new file mode 100644 index 0000000000..27d6c25a87 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c.xml @@ -0,0 +1,12 @@ + + + RedHat 6 64-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + + 4 + + 2015-09-17T11:23:48.000Z + T-RHEL-6-64-2-4-10 + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/infrastructure_datacenter.xml b/libcloud/test/compute/fixtures/dimensiondata/infrastructure_datacenter.xml new file mode 100644 index 0000000000..422060064c --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/infrastructure_datacenter.xml @@ -0,0 +1,188 @@ + + + + US - West + Santa Clara + California + US + https://na3.cloud-vpn.net + ftps-na.cloud-vpn.net + + + + + + High Performance + HPF + Faster than Standard. Uses 15000 RPM disk with Fast Cache. + + + Standard + STD + Standard Disk Speed + + + Economy + ECN + Slower than Standard. Uses 7200 RPM disk without Fast Cache. + + + + + + + + + + + + + + + US - East + Ashburn + Virginia + US + https://na1.cloud-vpn.net + ftps-na.cloud-vpn.net + + + + + + Standard + STD + Standard Disk Speed + + + + + + + + + + + + + + + US - East 2 + Ashburn + Virginia + US + https://na5.cloud-vpn.net + ftps-na.cloud-vpn.net + + + + + + High Performance + HPF + Faster than Standard. Uses 15000 RPM disk with Fast Cache. + + + Standard + STD + Standard Disk Speed + + + Economy + ECN + Slower than Standard. Uses 7200 RPM disk without Fast Cache. + + + + + + + + + + + + + + + US - East 3 - MCP 2.0 + Ashburn + Virginia + US + https://na9.cloud-vpn.net + ftps-na.cloud-vpn.net + + + + + + + + + Standard + STD + Standard Disk Speed + + + High Performance + HPF + Faster than Standard. Uses 15000 RPM disk with Fast Cache. + + + Economy + ECN + Slower than Standard. Uses 7200 RPM disk without Fast Cache. + + + + + + + + + + + + + + + US - West - MCP 2.0 + Santa Clara + California + US + https://na12.cloud-vpn.net + ftps-na.cloud-vpn.net + + + + + + + + + Standard + STD + Standard Disk Speed + + + High Performance + HPF + Faster than Standard. Uses 15000 RPM disk with Fast Cache. + + + Economy + ECN + Slower than Standard. Uses 7200 RPM disk without Fast Cache. + + + + + + + + + + + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/infrastructure_datacenter_NA9.xml b/libcloud/test/compute/fixtures/dimensiondata/infrastructure_datacenter_NA9.xml new file mode 100644 index 0000000000..396ad1016a --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/infrastructure_datacenter_NA9.xml @@ -0,0 +1,54 @@ + + + + US - East 3 - MCP 2.0 + Ashburn + Virginia + US + https://na9.cloud-vpn.net + ftps-na.cloud-vpn.net + + + + + + + + + Standard + STD + Standard Disk Speed + + + High Performance + HPF + Faster than Standard. Uses 15000 RPM disk with Fast Cache. + + + Economy + ECN + Slower than Standard. Uses 7200 RPM disk without Fast Cache. + + + Standard + Standard CPU Speed + + + High Performance + Faster and more consistent than Standard. Suitable for applications that are more CPU intensive. + + + + + + + + + + + + + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/ip_address_list_create.xml b/libcloud/test/compute/fixtures/dimensiondata/ip_address_list_create.xml new file mode 100644 index 0000000000..09317ef89c --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/ip_address_list_create.xml @@ -0,0 +1,9 @@ + + + CREATE_IP_ADDRESS_LIST + OK + IP Address List 'myAddressList' has been created. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/ip_address_list_delete.xml b/libcloud/test/compute/fixtures/dimensiondata/ip_address_list_delete.xml new file mode 100644 index 0000000000..13f323ac5c --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/ip_address_list_delete.xml @@ -0,0 +1,10 @@ + + + DELETE_IP_ADDRESS_LIST + OK + IP Address List with Id 84e34850-595d-436e-a885-7cd37edb24a4 has + been deleted. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/ip_address_list_edit.xml b/libcloud/test/compute/fixtures/dimensiondata/ip_address_list_edit.xml new file mode 100644 index 0000000000..3462afac89 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/ip_address_list_edit.xml @@ -0,0 +1,10 @@ + + + EDIT_IP_ADDRESS_LIST + OK + IP Address List 'MyIpAddressList' has been edited + successfully. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/ip_address_lists.xml b/libcloud/test/compute/fixtures/dimensiondata/ip_address_lists.xml new file mode 100644 index 0000000000..708c882a90 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/ip_address_lists.xml @@ -0,0 +1,46 @@ + + + + TestIPList2 + Test web server IP addresses list + IPV4 + + + + + NORMAL + 2016-09-01T01:19:53.000Z + + + TestIPList_sub_2 + Test web server IP addresses list + IPV4 + + + + + + NORMAL + 2016-09-01T01:20:56.000Z + + + Test_IP_Address_List_2 + Test Description + IPV4 + + + NORMAL + 2016-09-05T05:37:56.000Z + + + Test_IP_Address_List_3 + Test Description + IPV4 + + + + + NORMAL + 2016-09-05T05:57:53.000Z + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/ip_address_lists_FILTERBYNAME.xml b/libcloud/test/compute/fixtures/dimensiondata/ip_address_lists_FILTERBYNAME.xml new file mode 100644 index 0000000000..301a10644d --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/ip_address_lists_FILTERBYNAME.xml @@ -0,0 +1,14 @@ + + + + Test_IP_Address_List_3 + Test Description + IPV4 + + + + + NORMAL + 2016-09-05T05:57:53.000Z + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_addPublicIpBlock.xml b/libcloud/test/compute/fixtures/dimensiondata/network_addPublicIpBlock.xml new file mode 100644 index 0000000000..5555132110 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_addPublicIpBlock.xml @@ -0,0 +1,7 @@ + + + ADD_PUBLIC_IP_BLOCK + OK + Public IPv4 Address Block has been added successfully to Network Domain d3320077-c2ce-4523-8c65-d417e766077b. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_createFirewallRule.xml b/libcloud/test/compute/fixtures/dimensiondata/network_createFirewallRule.xml new file mode 100644 index 0000000000..ac3162ec75 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_createFirewallRule.xml @@ -0,0 +1,8 @@ + + +CREATE_FIREWALL_RULE +OK +Request create Firewall Rule 'My.Rule.2' successful + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_createNatRule.xml b/libcloud/test/compute/fixtures/dimensiondata/network_createNatRule.xml new file mode 100644 index 0000000000..ff652a4b8c --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_createNatRule.xml @@ -0,0 +1,9 @@ + + +CREATE_NAT_RULE +OK +NAT Rule with Id d31c2db0-be6b-4d50-8744-9a7a534b5fba has been +created. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_deleteFirewallRule.xml b/libcloud/test/compute/fixtures/dimensiondata/network_deleteFirewallRule.xml new file mode 100644 index 0000000000..3016297aa0 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_deleteFirewallRule.xml @@ -0,0 +1,8 @@ + + +DELETE_FIREWALL_RULE +OK +Firewall Rule (Id:84e34850-595d-436e-a885-7cd37edb24a4) has been +deleted + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_deleteNatRule.xml b/libcloud/test/compute/fixtures/dimensiondata/network_deleteNatRule.xml new file mode 100644 index 0000000000..2d2cebce24 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_deleteNatRule.xml @@ -0,0 +1,8 @@ + + +DELETE_NAT_RULE +OK +NAT Rule with Id 2187a636-7ebb-49a1-a2ff-5d617f496dce has been +deleted. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_deleteNetworkDomain.xml b/libcloud/test/compute/fixtures/dimensiondata/network_deleteNetworkDomain.xml new file mode 100644 index 0000000000..a3cca2ed2a --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_deleteNetworkDomain.xml @@ -0,0 +1,8 @@ + + +DELETE_NETWORK_DOMAIN +IN_PROGRESS +Request to Delete Network Domain (Id: 8cdfd607-f429-4df6-9352- +162cfc0891be) has been accepted and is being processed + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_deleteVlan.xml b/libcloud/test/compute/fixtures/dimensiondata/network_deleteVlan.xml new file mode 100644 index 0000000000..9eae809721 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_deleteVlan.xml @@ -0,0 +1,8 @@ + + +DELETE_VLAN +IN_PROGRESS +Request to Delete VLAN (Id:0e56433f-d808-4669-821d-812769517ff8) +has been accepted and is being processed + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_deployNetworkDomain.xml b/libcloud/test/compute/fixtures/dimensiondata/network_deployNetworkDomain.xml new file mode 100644 index 0000000000..4269840867 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_deployNetworkDomain.xml @@ -0,0 +1,8 @@ + + +DEPLOY_NETWORK_DOMAIN +IN_PROGRESS +Request to Deploy Network Domain 'A Network Domain' has been +accepted and is being processed + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_deployVlan.xml b/libcloud/test/compute/fixtures/dimensiondata/network_deployVlan.xml new file mode 100644 index 0000000000..946a505acc --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_deployVlan.xml @@ -0,0 +1,9 @@ + + +DEPLOY_VLAN +IN_PROGRESS +Request to deploy VLAN 'Production VLAN' has been accepted and is +being processed. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_editFirewallRule.xml b/libcloud/test/compute/fixtures/dimensiondata/network_editFirewallRule.xml new file mode 100644 index 0000000000..eff18c4864 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_editFirewallRule.xml @@ -0,0 +1,8 @@ + + +EDIT_FIREWALL_RULE +OK +Firewall Rule with id 1aa3d0ce-d95d-4296-8338-9717e0d37ff9 has +been edited + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_editNetworkDomain.xml b/libcloud/test/compute/fixtures/dimensiondata/network_editNetworkDomain.xml new file mode 100644 index 0000000000..07d55e5689 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_editNetworkDomain.xml @@ -0,0 +1,7 @@ + + +EDIT_NETWORK_DOMAIN +OK +Network Domain 'Development Network Domain' was edited +successfully. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_editVlan.xml b/libcloud/test/compute/fixtures/dimensiondata/network_editVlan.xml new file mode 100644 index 0000000000..10d0010ca9 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_editVlan.xml @@ -0,0 +1,7 @@ + + +EDIT_VLAN +OK +VLAN 'test' was edited successfully + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_expandVlan.xml b/libcloud/test/compute/fixtures/dimensiondata/network_expandVlan.xml new file mode 100644 index 0000000000..03f91125df --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_expandVlan.xml @@ -0,0 +1,8 @@ + + +EXPAND_VLAN +IN_PROGRESS +Request to expand VLAN 'Production VLAN' has been accepted and is +being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_firewallRule.xml b/libcloud/test/compute/fixtures/dimensiondata/network_firewallRule.xml new file mode 100644 index 0000000000..50812cab61 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_firewallRule.xml @@ -0,0 +1,35 @@ + + + + b30c224c-c95b-4cd9-bb8b-bfdfb5486abf + CCDEFAULT.BlockOutboundMailIPv4 + DROP + IPV4 + TCP + + + + + + + + true + NORMAL + + + b30c224c-c95b-4cd9-bb8b-bfdfb5486abf + SpecificSourceIP + DROP + IPV4 + TCP + + + + + + + + true + NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c.xml b/libcloud/test/compute/fixtures/dimensiondata/network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c.xml new file mode 100644 index 0000000000..876f37d744 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c.xml @@ -0,0 +1,18 @@ + + +8cdfd607-f429-4df6-9352-162cfc0891be +CCDEFAULT.BlockOutboundMailIPv4 +DROP +IPV4 +TCP + + + + + + + +true +NORMAL + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_natRule.xml b/libcloud/test/compute/fixtures/dimensiondata/network_natRule.xml new file mode 100644 index 0000000000..7478df6b43 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_natRule.xml @@ -0,0 +1,21 @@ + + + +484174a2-ae74-4658-9e56- +50fc90e086cf +10.0.0.15 +165.180.12.18 +2015-03-06T13:43:45.000Z +NORMAL + + +484174a2-ae74-4658-9e56- +50fc90e086cf +10.0.0.16 +165.180.12.19 +2015-03-06T13:45:10.000Z +NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce.xml b/libcloud/test/compute/fixtures/dimensiondata/network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce.xml new file mode 100644 index 0000000000..6bf447d7e3 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce.xml @@ -0,0 +1,9 @@ + + +484174a2-ae74-4658-9e56-50fc90e086cf +10.0.0.16 +165.180.12.19 +2015-03-06T13:45:10.000Z +NORMAL + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_networkDomain.xml b/libcloud/test/compute/fixtures/dimensiondata/network_networkDomain.xml new file mode 100644 index 0000000000..cb7a078f93 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_networkDomain.xml @@ -0,0 +1,43 @@ + + + + Aurora + Project Aurora Demo Environments + ADVANCED + 168.128.2.136 + 2015-07-13T03:52:16.000Z + NORMAL + + + Test net domain + description of my network + ESSENTIALS + 168.128.26.20 + 2015-07-15T03:36:00.000Z + NORMAL + + + another networkj + net network netowkrm + ESSENTIALS + 168.128.26.22 + 2015-07-15T03:40:09.000Z + NORMAL + + + Imports + Imported servers + ADVANCED + 168.128.2.69 + 2015-08-18T03:53:02.000Z + NORMAL + + + Platform R2.0 Lab (MCP 2.0) + This is the R2.0 lab for Platform on MCP 2.0 + ESSENTIALS + 168.128.2.149 + 2015-08-25T01:39:22.000Z + NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be.xml b/libcloud/test/compute/fixtures/dimensiondata/network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be.xml new file mode 100644 index 0000000000..bdd1c6b42f --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be.xml @@ -0,0 +1,9 @@ + + + test + test2 + ESSENTIALS + 168.128.26.20 + 2015-07-15T03:36:00.000Z + NORMAL + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_publicIpBlock.xml b/libcloud/test/compute/fixtures/dimensiondata/network_publicIpBlock.xml new file mode 100644 index 0000000000..3a1c1b381d --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_publicIpBlock.xml @@ -0,0 +1,10 @@ + + + + 8cdfd607-f429-4df6-9352-162cfc0891be + 168.128.4.18 + 2 + 2015-07-13T04:07:37.000Z + NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba.xml b/libcloud/test/compute/fixtures/dimensiondata/network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba.xml new file mode 100644 index 0000000000..dc8814b47c --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba.xml @@ -0,0 +1,8 @@ + + + 8cdfd607-f429-4df6-9352-162cfc0891be + 168.128.4.18 + 2 + 2015-07-13T04:07:37.000Z + NORMAL + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8.xml b/libcloud/test/compute/fixtures/dimensiondata/network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8.xml new file mode 100644 index 0000000000..dc8814b47c --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8.xml @@ -0,0 +1,8 @@ + + + 8cdfd607-f429-4df6-9352-162cfc0891be + 168.128.4.18 + 2 + 2015-07-13T04:07:37.000Z + NORMAL + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_removePublicIpBlock.xml b/libcloud/test/compute/fixtures/dimensiondata/network_removePublicIpBlock.xml new file mode 100644 index 0000000000..8b6fe34e2a --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_removePublicIpBlock.xml @@ -0,0 +1,8 @@ + + +REMOVE_PUBLIC_IP_BLOCK +OK +Public Ip Block bef4334a-844b-11e4-a91c-0030487e0302 has been +removed successfully + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_vlan.xml b/libcloud/test/compute/fixtures/dimensiondata/network_vlan.xml new file mode 100644 index 0000000000..4575d8393e --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_vlan.xml @@ -0,0 +1,25 @@ + + + + + Primary + + + 10.0.0.1 + + 2607:f480:111:1336:0:0:0:1 + 2015-07-13T03:52:45.000Z + NORMAL + + + + Wi-Fi + Wi-Fi + + 10.230.98.1 + + 2607:f480:111:1199:0:0:0:1 + 2015-08-18T23:47:04.000Z + NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_vlan_0e56433f_d808_4669_821d_812769517ff8.xml b/libcloud/test/compute/fixtures/dimensiondata/network_vlan_0e56433f_d808_4669_821d_812769517ff8.xml new file mode 100644 index 0000000000..7dcd5ccf64 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/network_vlan_0e56433f_d808_4669_821d_812769517ff8.xml @@ -0,0 +1,14 @@ + + + +Production VLAN +test2 + +10.0.3.1 + +2607:f480:1111:1153:0:0:0:1 +2015-02-13T10:56:44.000Z +NORMAL + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_create.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_create.xml new file mode 100644 index 0000000000..993b85d6f3 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_create.xml @@ -0,0 +1,11 @@ + + + Create Anti Affinity Rule + SUCCESS + Request to create Server Anti-Affinity Rule between 'rhel-ansible-full-test' and 'rhel-ansible-full-test' on 'Deloitte Test' has been accepted and is being processed. + REASON_0 + + 5e10b1ab-68f2-4a8b-a49c-d88d623db665 + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_create_FAIL.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_create_FAIL.xml new file mode 100644 index 0000000000..eecc69d9c1 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_create_FAIL.xml @@ -0,0 +1,7 @@ + + + Create Anti Affinity Rule + ERROR + Server 'ansible-test-image-rhel6' (id 22f3544a-c874-4930-a31c-e9e513e51114) is already used in another Anti-Affinity Rule (id 07e3621a-a920-4a9a-943c-d8021f27f418). + REASON_692 + diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_delete.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_delete.xml new file mode 100644 index 0000000000..0d73a1306c --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_delete.xml @@ -0,0 +1,7 @@ + + + Delete Anti Affinity Rule + SUCCESS + Request to delete Server Anti-Affinity Rule between 'ansible-test-image-rhel6' and 'ansible-custom-image-test-UAT' on 'Deloitte Test' has been accepted and is being processed. + REASON_0 + diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_delete_FAIL.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_delete_FAIL.xml new file mode 100644 index 0000000000..187f482aa7 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_delete_FAIL.xml @@ -0,0 +1,7 @@ + + + Delete Anti Affinity Rule + ERROR + Could not find Anti Affinity Rule with Id 07e3621a-a920-4a9a-943c-d8021f27f418 + REASON_693 + diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter.xml similarity index 76% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter.xml index 4870ee1c1f..f7fa850cd0 100644 --- a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter.xml +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter.xml @@ -9,4 +9,13 @@ https://opsource-na1.cloud-vpn.net/ true + + NA10 + US - East3 + Ashburn + Virginia + US + https://opsource-na1.cloud-vpn.net/ + true + diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation.xml new file mode 100644 index 0000000000..227def20e2 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation.xml @@ -0,0 +1,19 @@ + + + + 4bba37be-506f-11e3-b29c-001517c4643e + test-net1 + Test Network. + NA5 + 10.192.176.0 + false + + + 208e3a8e-9d2f-11e2-b29c-001517c4643e + Test Network + Network description + NA9 + 10.172.74.0 + false + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_4bba37be_506f_11e3_b29c_001517c4643e.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_4bba37be_506f_11e3_b29c_001517c4643e.xml new file mode 100644 index 0000000000..1e28e0dd92 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_4bba37be_506f_11e3_b29c_001517c4643e.xml @@ -0,0 +1,16 @@ + + + Add Network + SUCCESS + Network created successfully (Network ID: 9eb15060-e2f7-11e1-9153-001b21cfdbe0) + REASON_0 + diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete.xml diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete_INPROGRESS.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete_INPROGRESS.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete_INPROGRESS.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete_INPROGRESS.xml diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff.xml diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff_INPROGRESS.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff_INPROGRESS.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff_INPROGRESS.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff_INPROGRESS.xml diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart.xml diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart_INPROGRESS.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart_INPROGRESS.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart_INPROGRESS.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart_INPROGRESS.xml diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown.xml diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown_INPROGRESS.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown_INPROGRESS.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown_INPROGRESS.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown_INPROGRESS.xml diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start.xml diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start_INPROGRESS.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start_INPROGRESS.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start_INPROGRESS.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start_INPROGRESS.xml diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployed.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployed.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployed.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployed.xml diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml new file mode 100644 index 0000000000..f9a0c9c972 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml @@ -0,0 +1,21 @@ + + + Add Local Storage + SUCCESS + 100 GB of STANDARD local storage is being added to server "abc" on SCSI ID 1 + REASON_0 + diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_POST.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_POST.xml new file mode 100644 index 0000000000..abbbadb97b --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_POST.xml @@ -0,0 +1,7 @@ + + + Edit Server + SUCCESS +Server edited +REASON_0 + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1.xml new file mode 100644 index 0000000000..7214eb76ec --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1.xml @@ -0,0 +1,7 @@ + + + Delete Local Storage + SUCCESS + Server "Disk Delete" issued + REASON_0 + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSize.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSize.xml new file mode 100644 index 0000000000..7c6258d85e --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSize.xml @@ -0,0 +1,7 @@ + + + Change Server Disk Size + SUCCESS + Server "Change Server Disk Size" issued + REASON_0 + diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSpeed.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSpeed.xml new file mode 100644 index 0000000000..e525df171f --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSpeed.xml @@ -0,0 +1,7 @@ + + + Change Server Disk Speed + SUCCESS + Server "Change Server Disk Speed" issued + REASON_0 + diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_pendingDeploy.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_pendingDeploy.xml similarity index 100% rename from libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_pendingDeploy.xml rename to libcloud/test/compute/fixtures/dimensiondata/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_pendingDeploy.xml diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_base_image.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_base_image.xml new file mode 100644 index 0000000000..d758343885 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_base_image.xml @@ -0,0 +1,227 @@ + + + + 52ed8b72-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed8b72-ebea-11df-bdc1-001517c46384 + RedHat 5.5 64-bit 1 CPU + RedHat 5.5 Enterprise (Tikanga), 64-bit + + UNIX + REDHAT5/64 + + NA10 + 1 + 2048 + 10 + 0 + 1970-01-01T00:00:02.010Z + + + 52ed8dca-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed8dca-ebea-11df-bdc1-001517c46384 + RedHat 5.5 64-bit 2 CPU + RedHat 5.5 Enterprise (Tikanga), 64-bit + + UNIX + REDHAT5/64 + + NA10 + 2 + 4096 + 10 + 0 + 1970-01-01T00:00:02.010Z + + + 52ed8ed8-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed8ed8-ebea-11df-bdc1-001517c46384 + RedHat 5.5 64-bit 4 CPU + RedHat 5.5 Enterprise (Tikanga), 64-bit + + UNIX + REDHAT5/64 + + NA10 + 4 + 6144 + 10 + 0 + 1970-01-01T00:00:02.010Z + + + 6fc040ae-3605-11e0-bfb5-001517c46384 + /oec/base/image/6fc040ae-3605-11e0-bfb5-001517c46384 + RedHat 5.5 32-bit 1 CPU + RedHat 5.5 Enterprise (Tikanga), 32-bit + + UNIX + REDHAT5/32 + + NA10 + 1 + 2048 + 10 + 0 + 2011-02-11T17:36:19.000Z + + + 52ed92d4-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed92d4-ebea-11df-bdc1-001517c46384 + Ubuntu 8.04.4 2 CPU + Ubuntu 8.04.4 LTS, 64-bit + + UNIX + UBUNTU8/64 + + NA10 + 2 + 4096 + 10 + 0 + 1970-01-01T00:00:02.010Z + + + 52ed876c-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed876c-ebea-11df-bdc1-001517c46384 + Win2008 Ent 64-bit R2 2 CPU + Windows 2008 Enterprise R2 64-bit + + WINDOWS + WIN2008R2E/64 + + NA10 + 2 + 4096 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + 52ed8a5a-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed8a5a-ebea-11df-bdc1-001517c46384 + Win2008 Ent 64-bit R2 4 CPU + Windows 2008 Enterprise R2 64-bit + + WINDOWS + WIN2008R2E/64 + + NA10 + 4 + 8192 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + 52ed865e-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed865e-ebea-11df-bdc1-001517c46384 + Win2008 Std 64-bit R2 2 CPU + Windows 2008 Standard R2 64-bit + + WINDOWS + WIN2008R2S/64 + + NA10 + 2 + 4096 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + 52ed7b96-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed7b96-ebea-11df-bdc1-001517c46384 + Win2008 Std 32-bit 1 CPU + Windows 2008 Standard SP2 32-bit + + WINDOWS + WIN2008S/32 + + NA10 + 1 + 2048 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + 52ed7cb8-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed7cb8-ebea-11df-bdc1-001517c46384 + Win2008 Std 32-bit 2 CPU + Windows 2008 Standard SP2 32-bit + + WINDOWS + WIN2008S/32 + + NA10 + 2 + 4096 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + 52ed7da8-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed7da8-ebea-11df-bdc1-001517c46384 + Win2008 Std 32-bit 4 CPU + Windows 2008 Standard SP2 32-bit + + WINDOWS + WIN2008S/32 + + NA10 + 4 + 4096 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + 52ed7ea2-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed7ea2-ebea-11df-bdc1-001517c46384 + Win2008 Ent 32-bit 2 CPU + Windows 2008 Enterprise SP2 32-bit + + WINDOWS + WIN2008E/32 + + NA10 + 2 + 4096 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + 52ed8fd2-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed8fd2-ebea-11df-bdc1-001517c46384 + Red Hat 4.8 32-bit 1 CPU + Red Hat ES 4.8 (Nahant), 32-bit + + UNIX + REDHAT4/32 + + NA10 + 1 + 2048 + 10 + 0 + 1970-01-01T00:00:02.010Z + + + 52ed90cc-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed90cc-ebea-11df-bdc1-001517c46384 + CentOS 5.5 32-bit 1 CPU + CentOS release 5.5, 32-bit + + UNIX + CENTOS5/32 + + NA10 + 1 + 2048 + 10 + 0 + 1970-01-01T00:00:02.010Z + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_base_imageWithDiskSpeed.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_base_imageWithDiskSpeed.xml new file mode 100644 index 0000000000..d4d0fb3b71 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_base_imageWithDiskSpeed.xml @@ -0,0 +1,2475 @@ + + + + RedHat 6 64-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 2 + 4096 + + + 2015-05-13T07:11:34.000Z + NORMAL + + + RedHat 6 64-bit 4 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 4 + 8192 + + + 2015-05-13T07:11:36.000Z + NORMAL + + + RedHat 6 32-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 32-bit + + 2 + 4096 + + + 2015-05-13T07:11:32.000Z + NORMAL + + + RedHat 5 64-bit 2 CPU + RedHat 5.11 Enterprise (Tikanga) 64-bit + + 2 + 4096 + + + 2015-05-13T07:11:30.000Z + NORMAL + + + RedHat 5 32-bit 2 CPU + RedHat 5.11 Enterprise (Tikanga) 32-bit + + 2 + 4096 + + + 2015-05-13T07:11:28.000Z + NORMAL + + + CentOS 6 64-bit 2 CPU + CentOS Release 6.6 64-bit + + 2 + 4096 + + + 2015-05-13T07:11:42.000Z + NORMAL + + + CentOS 5 64-bit 2 CPU + CentOS Release 5.11 64-bit + + 2 + 4096 + + + 2015-05-13T07:11:40.000Z + NORMAL + + + CentOS 5 32-bit 2 CPU + CentOS Release 5.11 32-bit + + 2 + 4096 + + + 2015-05-13T07:11:38.000Z + NORMAL + + + Ubuntu 14.04 2 CPU + Ubuntu 14.04.2 LTS 64-bit + + 2 + 4096 + + + 2015-05-13T07:11:50.000Z + NORMAL + + + Ubuntu 12.04 2 CPU + Ubuntu 12.04.5 LTS 64-bit + + 2 + 4096 + + + 2015-05-13T07:11:48.000Z + NORMAL + + + SuSE Linux Ent 64-bit 2 CPU + SuSE Linux Enterprise Server 11 SP3 + + 2 + 4096 + + + 2015-05-13T07:11:44.000Z + NORMAL + + + Win2012 R2 Std 2 CPU + Windows 2012 R2 Update Standard + + 2 + 4096 + + + 2015-05-13T07:12:48.000Z + NORMAL + + + Win2012 R2 DC 2 CPU + Windows 2012 R2 Update Datacenter + + 2 + 4096 + + + 2015-05-13T07:12:46.000Z + NORMAL + + + Win2012 Std 2 CPU + Windows 2012 Standard + + 2 + 4096 + + + 2015-05-13T07:12:44.000Z + NORMAL + + + Win2012 DC 2 CPU + Windows 2012 Datacenter + + 2 + 4096 + + + 2015-05-13T07:12:33.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2014 Std + Windows 2012 R2 Datacenter 64-bit installed with SQL 2014 Standard + + 4 + 8192 + + MSSQL2014S + + 2015-05-13T07:12:57.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2014 Ent + Windows 2012 R2 Datacenter 64-bit installed with SQL 2014 Enterprise + + 4 + 8192 + + MSSQL2014E + + 2015-05-13T07:12:55.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2012 Std + Windows 2012 R2 Datacenter 64-bit installed with SQL 2012 Standard + + 4 + 8192 + + MSSQL2012R2S + + 2015-05-13T07:12:54.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2012 Ent + Windows 2012 R2 Datacenter 64-bit installed with SQL 2012 Enterprise + + 4 + 8192 + + MSSQL2012R2E + + 2015-05-13T07:12:52.000Z + NORMAL + + + Win2012 DC with MS SQL 2014 Std + Windows 2012 Datacenter 64-bit installed with SQL 2014 Standard + + 4 + 8192 + + MSSQL2014S + + 2015-05-13T07:12:41.000Z + NORMAL + + + Win2012 DC with MS SQL 2014 Ent + Windows 2012 Datacenter 64-bit installed with SQL 2014 Enterprise + + 4 + 8192 + + MSSQL2014E + + 2015-05-13T07:12:40.000Z + NORMAL + + + Win2012 DC with MS SQL 2012 Std + Windows 2012 Datacenter 64-bit installed with SQL 2012 Standard SP2 + + 4 + 8192 + + MSSQL2012R2S + + 2015-05-13T07:12:37.000Z + NORMAL + + + Win2012 DC with MS SQL 2012 Ent + Windows 2012 Datacenter 64-bit installed with SQL 2012 Enterprise SP2 + + 4 + 8192 + + MSSQL2012R2E + + 2015-05-13T07:12:35.000Z + NORMAL + + + Win2008 R2 Std 2 CPU + Windows 2008 R2 Standard SP1 + + 2 + 4096 + + + 2015-05-13T07:12:31.000Z + NORMAL + + + Win2008 R2 Ent 2 CPU + Windows 2008 R2 Enterprise SP1 + + 2 + 4096 + + + 2015-05-13T07:12:19.000Z + NORMAL + + + Win2008 R2 DC 64-bit 2 CPU + Windows 2008 R2 Datacenter SP1 + + 2 + 4096 + + + 2015-05-13T07:12:17.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2012 Std + Windows 2008 R2 Enterprise SP3 installed with SQL Server 2012 Standard SP2 + + 4 + 8192 + + MSSQL2012R2S + + 2015-05-13T07:12:25.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2012 Ent + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2012 Enterprise SP2 + + 4 + 8192 + + MSSQL2012R2E + + 2015-05-13T07:12:23.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2008 R2 Std + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2008 R2 Standard SP3 + + 4 + 8192 + + MSSQL2008R2S + + 2015-05-13T07:12:29.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2008 R2 Ent + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2008 R2 Enterprise SP3 + + 4 + 8192 + + MSSQL2008R2E + + 2015-05-13T07:12:27.000Z + NORMAL + + + Win2008 R2 Ent 64-Bit with MS SP Fnd + Windows 2008 R2 Enterprise installed with SQL Express & SharePoint Foundation 2010 + + 4 + 8192 + + MSSPFND2010 + + 2015-05-13T07:12:21.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Small DD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapsml00. SID=DD0 NR=00 + + 2 + 8192 + + + + + SAPACCEL + + 2015-05-13T07:12:07.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Small DD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapsml01. SID=DD1 NR=00 + + 2 + 8192 + + + + + SAPACCEL + + 2015-05-13T07:12:05.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Medium TD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapmed00. SID=TD0 NR=00 + + 4 + 10240 + + + + + SAPACCEL + + 2015-05-13T07:12:01.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Medium TD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapmed01. SID=TD1 NR=00 + + 4 + 10240 + + + + + SAPACCEL + + 2015-05-13T07:12:03.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Large PD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=saplrg00. SID=PD0 NR=00 + + 8 + 20480 + + + + + + SAPACCEL + + 2015-05-13T07:11:58.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Large PD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=saplrg01. SID=PD1 NR=00 + + 8 + 20480 + + + + + + SAPACCEL + + 2015-05-13T07:11:59.000Z + NORMAL + + + Win2008 Std 64-bit 2 CPU + Windows 2008 Standard SP2 64-bit + + 2 + 4096 + + + 2015-05-13T07:12:15.000Z + NORMAL + + + Win2008 Ent 64-bit 2 CPU + Windows 2008 Enterprise SP2 64-bit + + 2 + 4096 + + + 2015-05-13T07:12:11.000Z + NORMAL + + + Win2008 Std 32-bit 2 CPU + Windows 2008 Standard SP2 32-bit + + 2 + 4096 + + + 2015-05-13T07:12:13.000Z + NORMAL + + + Win2008 Ent 32-bit 2 CPU + Windows 2008 Enterprise SP2 32-bit + + 2 + 4096 + + + 2015-05-13T07:12:09.000Z + NORMAL + + + CSfM SharePoint 2013 Trial + Windows 2012 R2 Standard 64-bit installed with SharePoint 2013 and Visual Studio 2013 Pro (Trial Version) + + 4 + 12288 + + + 2015-03-19T18:28:32.000Z + NORMAL + + + RedHat 6 64-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 2 + 4096 + + + 2015-06-19T06:03:01.000Z + NORMAL + + + RedHat 6 64-bit 4 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 4 + 8192 + + + 2015-06-19T06:03:30.000Z + NORMAL + + + RedHat 6 32-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 32-bit + + 2 + 4096 + + + 2015-06-19T06:03:25.000Z + NORMAL + + + RedHat 5 64-bit 2 CPU + RedHat 5.11 Enterprise (Tikanga) 64-bit + + 2 + 4096 + + + 2015-06-19T06:02:48.000Z + NORMAL + + + RedHat 5 32-bit 2 CPU + RedHat 5.11 Enterprise (Tikanga) 32-bit + + 2 + 4096 + + + 2015-06-19T06:03:44.000Z + NORMAL + + + CentOS 6 64-bit 2 CPU + CentOS Release 6.6 64-bit + + 2 + 4096 + + + 2015-06-19T06:03:28.000Z + NORMAL + + + CentOS 5 64-bit 2 CPU + CentOS Release 5.11 64-bit + + 2 + 4096 + + + 2015-06-19T06:02:53.000Z + NORMAL + + + CentOS 5 32-bit 2 CPU + CentOS Release 5.11 32-bit + + 2 + 4096 + + + 2015-06-19T06:03:17.000Z + NORMAL + + + Ubuntu 14.04 2 CPU + Ubuntu 14.04.2 LTS 64-bit + + 2 + 4096 + + + 2015-06-19T06:02:34.000Z + NORMAL + + + Ubuntu 12.04 2 CPU + Ubuntu 12.04.5 LTS 64-bit + + 2 + 4096 + + + 2015-06-19T06:03:32.000Z + NORMAL + + + SuSE Linux Ent 64-bit 2 CPU + SuSE Linux Enterprise Server 11 SP3 + + 2 + 4096 + + + 2015-06-19T06:03:04.000Z + NORMAL + + + Win2012 R2 Std 2 CPU + Windows 2012 R2 Update Standard + + 2 + 4096 + + + 2015-06-19T06:02:40.000Z + NORMAL + + + Win2012 R2 Std 4 CPU + Windows 2012 R2 Update Standard + + 4 + 8192 + + + 2015-06-19T06:03:16.000Z + NORMAL + + + Win2012 R2 DC 2 CPU + Windows 2012 R2 Update Datacenter + + 2 + 4096 + + + 2015-06-19T06:03:41.000Z + NORMAL + + + Win2012 Std 2 CPU + Windows 2012 Standard + + 2 + 4096 + + + 2015-06-19T06:02:33.000Z + NORMAL + + + Win2012 DC 2 CPU + Windows 2012 Datacenter + + 2 + 4096 + + + 2015-06-19T06:03:19.000Z + NORMAL + + + Win2012 DC with MS SQL 2014 Std + Windows 2012 Datacenter 64-bit installed with SQL 2014 Standard + + 4 + 8192 + + MSSQL2014S + + 2015-06-19T06:02:46.000Z + NORMAL + + + Win2012 DC with MS SQL 2014 Ent + Windows 2012 Datacenter 64-bit installed with SQL 2014 Enterprise + + 4 + 8192 + + MSSQL2014E + + 2015-06-19T06:03:06.000Z + NORMAL + + + Win2012 DC with MS SQL 2012 Std + Windows 2012 Datacenter 64-bit installed with SQL 2012 Standard SP2 + + 4 + 8192 + + MSSQL2012R2S + + 2015-06-19T06:02:50.000Z + NORMAL + + + Win2012 DC with MS SQL 2012 Ent + Windows 2012 Datacenter 64-bit installed with SQL 2012 Enterprise SP2 + + 4 + 8192 + + MSSQL2012R2E + + 2015-06-19T06:03:37.000Z + NORMAL + + + Win2008 R2 Std 2 CPU + Windows 2008 R2 Standard SP1 + + 2 + 4096 + + + 2015-06-19T06:03:35.000Z + NORMAL + + + Win2008 R2 Ent 2 CPU + Windows 2008 R2 Enterprise SP1 + + 2 + 4096 + + + 2015-06-19T06:02:59.000Z + NORMAL + + + Win2008 R2 DC 64-bit 2 CPU + Windows 2008 R2 Datacenter SP1 + + 2 + 4096 + + + 2015-06-19T06:03:23.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2012 Std + Windows 2008 R2 Enterprise SP3 installed with SQL Server 2012 Standard SP2 + + 4 + 8192 + + MSSQL2012R2S + + 2015-06-19T06:03:21.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2012 Ent + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2012 Enterprise SP2 + + 4 + 8192 + + MSSQL2012R2E + + 2015-06-19T06:02:36.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2008 R2 Std + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2008 R2 Standard SP3 + + 4 + 8192 + + MSSQL2008R2S + + 2015-06-19T06:03:46.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2008 R2 Ent + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2008 R2 Enterprise SP3 + + 4 + 8192 + + MSSQL2008R2E + + 2015-06-19T06:03:39.000Z + NORMAL + + + Win2008 R2 Ent 64-Bit with MS SP Fnd + Windows 2008 R2 Enterprise installed with SQL Express & SharePoint Foundation 2010 + + 4 + 8192 + + MSSPFND2010 + + 2015-06-19T06:03:02.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Small DD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapsml00. SID=DD0 NR=00 + + 2 + 8192 + + + + + SAPACCEL + + 2015-06-19T06:02:44.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Small DD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapsml01. SID=DD1 NR=00 + + 2 + 8192 + + + + + SAPACCEL + + 2015-06-19T06:03:27.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Medium TD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapmed00. SID=TD0 NR=00 + + 4 + 10240 + + + + + SAPACCEL + + 2015-06-19T06:02:51.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Medium TD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapmed01. SID=TD1 NR=00 + + 4 + 10240 + + + + + SAPACCEL + + 2015-06-19T06:03:12.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Large PD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=saplrg00. SID=PD0 NR=00 + + 8 + 20480 + + + + + + SAPACCEL + + 2015-06-19T06:03:10.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Large PD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=saplrg01. SID=PD1 NR=00 + + 8 + 20480 + + + + + + SAPACCEL + + 2015-06-19T06:03:08.000Z + NORMAL + + + Win2008 Std 64-bit 2 CPU + Windows 2008 Standard SP2 64-bit + + 2 + 4096 + + + 2015-06-19T06:03:33.000Z + NORMAL + + + Win2008 Ent 64-bit 2 CPU + Windows 2008 Enterprise SP2 64-bit + + 2 + 4096 + + + 2015-06-19T06:02:38.000Z + NORMAL + + + Win2008 Std 32-bit 2 CPU + Windows 2008 Standard SP2 32-bit + + 2 + 4096 + + + 2015-06-19T06:03:43.000Z + NORMAL + + + Win2008 Ent 32-bit 2 CPU + Windows 2008 Enterprise SP2 32-bit + + 2 + 4096 + + + 2015-06-19T06:02:55.000Z + NORMAL + + + RedHat 6 64-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 2 + 4096 + + + 2015-05-15T08:34:51.000Z + NORMAL + + + RedHat 6 64-bit 4 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 4 + 8192 + + + 2015-05-15T08:34:52.000Z + NORMAL + + + RedHat 6 32-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 32-bit + + 2 + 4096 + + + 2015-05-15T08:34:49.000Z + NORMAL + + + RedHat 5 64-bit 2 CPU + RedHat 5.11 Enterprise (Tikanga) 64-bit + + 2 + 4096 + + + 2015-05-15T08:34:47.000Z + NORMAL + + + RedHat 5 32-bit 2 CPU + RedHat 5.11 Enterprise (Tikanga) 32-bit + + 2 + 4096 + + + 2015-05-15T08:34:45.000Z + NORMAL + + + CentOS 6 64-bit 2 CPU + CentOS Release 6.6 64-bit + + 2 + 4096 + + + 2015-05-15T08:34:58.000Z + NORMAL + + + CentOS 5 64-bit 2 CPU + CentOS Release 5.11 64-bit + + 2 + 4096 + + + 2015-05-15T08:34:56.000Z + NORMAL + + + CentOS 5 32-bit 2 CPU + CentOS Release 5.11 32-bit + + 2 + 4096 + + + 2015-05-15T08:34:54.000Z + NORMAL + + + Ubuntu 14.04 2 CPU + Ubuntu 14.04.2 LTS 64-bit + + 2 + 4096 + + + 2015-05-15T08:35:06.000Z + NORMAL + + + Ubuntu 12.04 2 CPU + Ubuntu 12.04.5 LTS 64-bit + + 2 + 4096 + + + 2015-05-15T08:35:04.000Z + NORMAL + + + SuSE Linux Ent 64-bit 2 CPU + SuSE Linux Enterprise Server 11 SP3 + + 2 + 4096 + + + 2015-05-15T08:35:00.000Z + NORMAL + + + Win2012 R2 Std 2 CPU + Windows 2012 R2 Update Standard + + 2 + 4096 + + + 2015-05-15T08:35:50.000Z + NORMAL + + + Win2012 R2 DC 2 CPU + Windows 2012 R2 Update Datacenter + + 2 + 4096 + + + 2015-05-15T08:35:46.000Z + NORMAL + + + Win2012 Std 2 CPU + Windows 2012 Standard + + 2 + 4096 + + + 2015-05-15T08:35:52.000Z + NORMAL + + + Win2012 DC 2 CPU + Windows 2012 Datacenter + + 2 + 4096 + + + 2015-05-15T08:35:36.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2014 Std + Windows 2012 R2 Datacenter 64-bit installed with SQL 2014 Standard + + 4 + 8192 + + MSSQL2014S + + 2015-05-15T08:36:14.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2014 Ent + Windows 2012 R2 Datacenter 64-bit installed with SQL 2014 Enterprise + + 4 + 8192 + + MSSQL2014E + + 2015-05-15T08:36:12.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2012 Std + Windows 2012 R2 Datacenter 64-bit installed with SQL 2012 Standard + + 4 + 8192 + + MSSQL2012R2S + + 2015-05-15T08:36:10.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2012 Ent + Windows 2012 R2 Datacenter 64-bit installed with SQL 2012 Enterprise + + 4 + 8192 + + MSSQL2012R2E + + 2015-05-15T08:36:08.000Z + NORMAL + + + Win2012 DC with MS SQL 2014 Std + Windows 2012 Datacenter 64-bit installed with SQL 2014 Standard + + 4 + 8192 + + MSSQL2014S + + 2015-05-15T08:35:48.000Z + NORMAL + + + Win2012 DC with MS SQL 2014 Ent + Windows 2012 Datacenter 64-bit installed with SQL 2014 Enterprise + + 4 + 8192 + + MSSQL2014E + + 2015-05-15T08:35:40.000Z + NORMAL + + + Win2012 DC with MS SQL 2012 Std + Windows 2012 Datacenter 64-bit installed with SQL 2012 Standard SP2 + + 4 + 8192 + + MSSQL2012R2S + + 2015-05-15T08:35:38.000Z + NORMAL + + + Win2012 DC with MS SQL 2012 Ent + Windows 2012 Datacenter 64-bit installed with SQL 2012 Enterprise SP2 + + 4 + 8192 + + MSSQL2012R2E + + 2015-05-15T08:35:42.000Z + NORMAL + + + Win2008 R2 Std 2 CPU + Windows 2008 R2 Standard SP1 + + 2 + 4096 + + + 2015-05-15T08:35:24.000Z + NORMAL + + + Win2008 R2 Ent 2 CPU + Windows 2008 R2 Enterprise SP1 + + 2 + 4096 + + + 2015-05-15T08:35:26.000Z + NORMAL + + + Win2008 R2 DC 64-bit 2 CPU + Windows 2008 R2 Datacenter SP1 + + 2 + 4096 + + + 2015-05-15T08:35:34.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2012 Std + Windows 2008 R2 Enterprise SP3 installed with SQL Server 2012 Standard SP2 + + 4 + 8192 + + MSSQL2012R2S + + 2015-05-15T08:35:18.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2012 Ent + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2012 Enterprise SP2 + + 4 + 8192 + + MSSQL2012R2E + + 2015-05-15T08:35:30.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2008 R2 Std + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2008 R2 Standard SP3 + + 4 + 8192 + + MSSQL2008R2S + + 2015-05-15T08:35:28.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2008 R2 Ent + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2008 R2 Enterprise SP3 + + 4 + 8192 + + MSSQL2008R2E + + 2015-05-15T08:35:22.000Z + NORMAL + + + Win2008 R2 Ent 64-Bit with MS SP Fnd + Windows 2008 R2 Enterprise installed with SQL Express & SharePoint Foundation 2010 + + 4 + 8192 + + MSSPFND2010 + + 2015-05-15T08:35:32.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Small DD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapsml00. SID=DD0 NR=00 + + 2 + 8192 + + + + + SAPACCEL + + 2015-05-15T08:35:58.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Small DD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapsml01. SID=DD1 NR=00 + + 2 + 8192 + + + + + SAPACCEL + + 2015-05-15T08:36:06.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Medium TD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapmed00. SID=TD0 NR=00 + + 4 + 10240 + + + + + SAPACCEL + + 2015-05-15T08:36:04.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Medium TD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapmed01. SID=TD1 NR=00 + + 4 + 10240 + + + + + SAPACCEL + + 2015-05-15T08:35:56.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Large PD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=saplrg00. SID=PD0 NR=00 + + 8 + 20480 + + + + + + SAPACCEL + + 2015-05-15T08:35:54.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Large PD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=saplrg01. SID=PD1 NR=00 + + 8 + 20480 + + + + + + SAPACCEL + + 2015-05-15T08:36:02.000Z + NORMAL + + + Win2008 Std 64-bit 2 CPU + Windows 2008 Standard SP2 64-bit + + 2 + 4096 + + + 2015-05-15T08:36:00.000Z + NORMAL + + + Win2008 Ent 64-bit 2 CPU + Windows 2008 Enterprise SP2 64-bit + + 2 + 4096 + + + 2015-05-15T08:35:16.000Z + NORMAL + + + Win2008 Std 32-bit 2 CPU + Windows 2008 Standard SP2 32-bit + + 2 + 4096 + + + 2015-05-15T08:35:20.000Z + NORMAL + + + Win2008 Ent 32-bit 2 CPU + Windows 2008 Enterprise SP2 32-bit + + 2 + 4096 + + + 2015-05-15T08:35:14.000Z + NORMAL + + + CSfM SharePoint 2013 Trial + Windows 2012 R2 Standard 64-bit installed with SharePoint 2013 and Visual Studio 2013 Pro (Trial Version) + + 4 + 12288 + + + 2015-03-19T18:30:39.000Z + NORMAL + + + RedHat 6 64-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 2 + 4096 + + + 2015-05-15T08:30:51.000Z + NORMAL + + + RedHat 6 64-bit 4 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 4 + 8192 + + + 2015-05-15T08:30:53.000Z + NORMAL + + + RedHat 6 32-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 32-bit + + 2 + 4096 + + + 2015-05-15T08:30:49.000Z + NORMAL + + + RedHat 5 64-bit 2 CPU + RedHat 5.11 Enterprise (Tikanga) 64-bit + + 2 + 4096 + + + 2015-05-15T08:30:47.000Z + NORMAL + + + RedHat 5 32-bit 2 CPU + RedHat 5.11 Enterprise (Tikanga) 32-bit + + 2 + 4096 + + + 2015-05-15T08:30:46.000Z + NORMAL + + + CentOS 6 64-bit 2 CPU + CentOS Release 6.6 64-bit + + 2 + 4096 + + + 2015-05-15T08:30:58.000Z + NORMAL + + + CentOS 5 64-bit 2 CPU + CentOS Release 5.11 64-bit + + 2 + 4096 + + + 2015-05-15T08:30:56.000Z + NORMAL + + + CentOS 5 32-bit 2 CPU + CentOS Release 5.11 32-bit + + 2 + 4096 + + + 2015-05-15T08:30:54.000Z + NORMAL + + + Ubuntu 14.04 2 CPU + Ubuntu 14.04.2 LTS 64-bit + + 2 + 4096 + + + 2015-05-15T08:31:05.000Z + NORMAL + + + Ubuntu 12.04 2 CPU + Ubuntu 12.04.5 LTS 64-bit + + 2 + 4096 + + + 2015-05-15T08:31:03.000Z + NORMAL + + + SuSE Linux Ent 64-bit 2 CPU + SuSE Linux Enterprise Server 11 SP3 + + 2 + 4096 + + + 2015-05-15T08:31:00.000Z + NORMAL + + + Win2012 R2 Std 2 CPU + Windows 2012 R2 Update Standard + + 2 + 4096 + + + 2015-05-15T08:31:54.000Z + NORMAL + + + Win2012 R2 DC 2 CPU + Windows 2012 R2 Update Datacenter + + 2 + 4096 + + + 2015-05-15T08:31:53.000Z + NORMAL + + + Win2012 Std 2 CPU + Windows 2012 Standard + + 2 + 4096 + + + 2015-05-15T08:31:51.000Z + NORMAL + + + Win2012 DC 2 CPU + Windows 2012 Datacenter + + 2 + 4096 + + + 2015-05-15T08:31:42.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2014 Std + Windows 2012 R2 Datacenter 64-bit installed with SQL 2014 Standard + + 4 + 8192 + + MSSQL2014S + + 2015-05-15T08:32:03.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2014 Ent + Windows 2012 R2 Datacenter 64-bit installed with SQL 2014 Enterprise + + 4 + 8192 + + MSSQL2014E + + 2015-05-15T08:32:01.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2012 Std + Windows 2012 R2 Datacenter 64-bit installed with SQL 2012 Standard + + 4 + 8192 + + MSSQL2012R2S + + 2015-05-15T08:31:59.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2012 Ent + Windows 2012 R2 Datacenter 64-bit installed with SQL 2012 Enterprise + + 4 + 8192 + + MSSQL2012R2E + + 2015-05-15T08:31:58.000Z + NORMAL + + + Win2012 DC with MS SQL 2014 Std + Windows 2012 Datacenter 64-bit installed with SQL 2014 Standard + + 4 + 8192 + + MSSQL2014S + + 2015-05-15T08:31:49.000Z + NORMAL + + + Win2012 DC with MS SQL 2014 Ent + Windows 2012 Datacenter 64-bit installed with SQL 2014 Enterprise + + 4 + 8192 + + MSSQL2014E + + 2015-05-15T08:31:47.000Z + NORMAL + + + Win2012 DC with MS SQL 2012 Std + Windows 2012 Datacenter 64-bit installed with SQL 2012 Standard SP2 + + 4 + 8192 + + MSSQL2012R2S + + 2015-05-15T08:31:46.000Z + NORMAL + + + Win2012 DC with MS SQL 2012 Ent + Windows 2012 Datacenter 64-bit installed with SQL 2012 Enterprise SP2 + + 4 + 8192 + + MSSQL2012R2E + + 2015-05-15T08:31:44.000Z + NORMAL + + + Win2008 R2 Std 2 CPU + Windows 2008 R2 Standard SP1 + + 2 + 4096 + + + 2015-05-15T08:31:41.000Z + NORMAL + + + Win2008 R2 Ent 2 CPU + Windows 2008 R2 Enterprise SP1 + + 2 + 4096 + + + 2015-05-15T08:31:29.000Z + NORMAL + + + Win2008 R2 DC 64-bit 2 CPU + Windows 2008 R2 Datacenter SP1 + + 2 + 4096 + + + 2015-05-15T08:31:27.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2012 Std + Windows 2008 R2 Enterprise SP3 installed with SQL Server 2012 Standard SP2 + + 4 + 8192 + + MSSQL2012R2S + + 2015-05-15T08:31:35.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2012 Ent + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2012 Enterprise SP2 + + 4 + 8192 + + MSSQL2012R2E + + 2015-05-15T08:31:34.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2008 R2 Std + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2008 R2 Standard SP3 + + 4 + 8192 + + MSSQL2008R2S + + 2015-05-15T08:31:39.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2008 R2 Ent + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2008 R2 Enterprise SP3 + + 4 + 8192 + + MSSQL2008R2E + + 2015-05-15T08:31:37.000Z + NORMAL + + + Win2008 R2 Ent 64-Bit with MS SP Fnd + Windows 2008 R2 Enterprise installed with SQL Express & SharePoint Foundation 2010 + + 4 + 8192 + + MSSPFND2010 + + 2015-05-15T08:31:32.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Small DD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapsml00. SID=DD0 NR=00 + + 2 + 8192 + + + + + SAPACCEL + + 2015-05-15T08:31:17.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Small DD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapsml01. SID=DD1 NR=00 + + 2 + 8192 + + + + + SAPACCEL + + 2015-05-15T08:31:19.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Medium TD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapmed00. SID=TD0 NR=00 + + 4 + 10240 + + + + + SAPACCEL + + 2015-05-15T08:31:20.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Medium TD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapmed01. SID=TD1 NR=00 + + 4 + 10240 + + + + + SAPACCEL + + 2015-05-15T08:31:15.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Large PD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=saplrg00. SID=PD0 NR=00 + + 8 + 20480 + + + + + + SAPACCEL + + 2015-05-15T08:31:12.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Large PD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=saplrg01. SID=PD1 NR=00 + + 8 + 20480 + + + + + + SAPACCEL + + 2015-05-15T08:31:14.000Z + NORMAL + + + Win2008 Std 64-bit 2 CPU + Windows 2008 Standard SP2 64-bit + + 2 + 4096 + + + 2015-05-15T08:31:31.000Z + NORMAL + + + Win2008 Ent 64-bit 2 CPU + Windows 2008 Enterprise SP2 64-bit + + 2 + 4096 + + + 2015-05-15T08:31:24.000Z + NORMAL + + + Win2008 Std 32-bit 2 CPU + Windows 2008 Standard SP2 32-bit + + 2 + 4096 + + + 2015-05-15T08:31:25.000Z + NORMAL + + + Win2008 Ent 32-bit 2 CPU + Windows 2008 Enterprise SP2 32-bit + + 2 + 4096 + + + 2015-05-15T08:31:22.000Z + NORMAL + + + CSfM SharePoint 2013 Trial + Windows 2012 R2 Standard 64-bit installed with SharePoint 2013 and Visual Studio 2013 Pro (Trial Version) + + 4 + 12288 + + + 2015-03-19T18:31:00.000Z + NORMAL + + + RedHat 6 64-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 2 + 4096 + + + 2015-03-04T10:10:53.000Z + NORMAL + + + RedHat 6 64-bit 4 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 4 + 8192 + + + 2015-03-03T16:05:54.000Z + NORMAL + + + RedHat 6 32-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 32-bit + + 2 + 4096 + + + 2015-03-03T16:06:04.000Z + NORMAL + + + RedHat 5 64-bit 2 CPU + RedHat 5.11 Enterprise (Tikanga) 64-bit + + 2 + 4096 + + + 2015-03-03T16:06:15.000Z + NORMAL + + + RedHat 5 32-bit 2 CPU + RedHat 5.11 Enterprise (Tikanga) 32-bit + + 2 + 4096 + + + 2015-03-03T16:06:26.000Z + NORMAL + + + CentOS 6 64-bit 2 CPU + CentOS Release 6.6 64-bit + + 2 + 4096 + + + 2015-03-03T16:06:37.000Z + NORMAL + + + CentOS 5 64-bit 2 CPU + CentOS Release 5.11 64-bit + + 2 + 4096 + + + 2015-06-30T11:27:51.000Z + NORMAL + + + CentOS 5 32-bit 2 CPU + CentOS Release 5.11 32-bit + + 2 + 4096 + + + 2015-06-30T11:25:24.000Z + NORMAL + + + Ubuntu 14.04 2 CPU + Ubuntu 14.04.2 LTS 64-bit + + 2 + 4096 + + + 2015-03-18T12:22:57.000Z + NORMAL + + + Ubuntu 12.04 2 CPU + Ubuntu 12.04.5 LTS 64-bit + + 2 + 4096 + + + 2015-03-03T16:07:07.000Z + NORMAL + + + Ubuntu 10.04 2 CPU + Ubuntu 10.04.4 LTS 64-bit + + 2 + 4096 + + + 2015-03-03T16:07:17.000Z + NORMAL + + + SuSE Linux Ent 64-bit 2 CPU + SuSE Linux Enterprise Server 11 SP3 + + 2 + 4096 + + + 2015-03-03T16:07:27.000Z + NORMAL + + + Win2012 R2 Std 2 CPU + Windows 2012 R2 Update Standard + + 2 + 4096 + + + 2015-03-03T17:02:31.000Z + NORMAL + + + Win2012 R2 Std 4 CPU + Windows 2012 R2 Update Standard + + 4 + 8192 + + + 2015-03-03T17:02:41.000Z + NORMAL + + + Win2012 R2 DC 2 CPU + Windows 2012 R2 Update Datacenter + + 2 + 4096 + + + 2015-03-03T17:03:11.000Z + NORMAL + + + Win2008 Std 64-bit 2 CPU + Windows 2008 Standard SP2 64-bit + + 2 + 4096 + + + 2015-03-03T16:19:46.000Z + NORMAL + + + Win2012 Std 2 CPU + Windows 2012 Standard + + 2 + 4096 + + + 2015-03-03T16:19:03.000Z + NORMAL + + + Win2012 DC 2 CPU + Windows 2012 Datacenter + + 2 + 4096 + + + 2015-03-03T16:19:11.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2014 Std + Windows 2012 R2 Datacenter 64-bit installed with SQL 2014 Standard + + 4 + 8192 + + MSSQL2014S + + 2015-05-04T08:29:07.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2014 Ent + Windows 2012 R2 Datacenter 64-bit installed with SQL 2014 Enterprise + + 4 + 8192 + + MSSQL2014E + + 2015-05-04T08:31:44.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2012 Std + Windows 2012 R2 Datacenter 64-bit installed with SQL 2012 Standard + + 4 + 8192 + + MSSQL2012R2S + + 2015-05-04T08:34:45.000Z + NORMAL + + + Win2012 R2 Datacenter 64-bit MS SQL 2012 Ent + Windows 2012 R2 Datacenter 64-bit installed with SQL 2012 Enterprise + + 4 + 8192 + + MSSQL2012R2E + + 2015-05-04T08:36:36.000Z + NORMAL + + + Win2012 DC with MS SQL 2014 Std + Windows 2012 Datacenter 64-bit installed with SQL 2014 Standard + + 4 + 8192 + + MSSQL2014S + + 2015-03-03T16:10:49.000Z + NORMAL + + + Win2012 DC with MS SQL 2014 Ent + Windows 2012 Datacenter 64-bit installed with SQL 2014 Enterprise + + 4 + 8192 + + MSSQL2014E + + 2015-03-03T16:10:59.000Z + NORMAL + + + Win2012 DC with MS SQL 2012 Std + Windows 2012 Datacenter 64-bit installed with SQL 2012 Standard SP2 + + 4 + 8192 + + + 2015-03-03T16:28:40.000Z + NORMAL + + + Win2012 DC with MS SQL 2012 Ent + Windows 2012 Datacenter 64-bit installed with SQL 2012 Enterprise SP2 + + 4 + 8192 + + + 2015-03-03T16:28:51.000Z + NORMAL + + + Win2008 R2 Std 2 CPU + Windows 2008 R2 Standard SP1 + + 2 + 4096 + + + 2015-03-03T16:19:20.000Z + NORMAL + + + Win2008 R2 Ent 2 CPU + Windows 2008 R2 Enterprise SP1 + + 2 + 4096 + + + 2015-03-03T16:19:29.000Z + NORMAL + + + Win2008 R2 DC 64-bit 2 CPU + Windows 2008 R2 Datacenter SP1 + + 2 + 4096 + + + 2015-03-03T16:19:37.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2012 Std + Windows 2008 R2 Enterprise SP3 installed with SQL Server 2012 Standard SP2 + + 4 + 8192 + + + 2015-03-03T16:29:02.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2012 Ent + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2012 Enterprise SP2 + + 4 + 8192 + + + 2015-03-03T16:29:11.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2008 R2 Std + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2008 R2 Standard SP3 + + 4 + 8192 + + + 2015-03-03T16:29:20.000Z + NORMAL + + + Win2008 R2 Ent with MS SQL 2008 R2 Ent + Windows 2008 R2 Enterprise 64-bit installed with SQL Server 2008 R2 Enterprise SP3 + + 4 + 8192 + + + 2015-03-03T16:29:29.000Z + NORMAL + + + Win2008 R2 Ent 64-Bit with MS SP Fnd + Windows 2008 R2 Enterprise installed with SQL Express & SharePoint Foundation 2010 + + 4 + 8192 + + + 2015-03-03T16:35:11.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Small DD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapsml00. SID=DD0 NR=00 + + 2 + 8192 + + + + + SAPACCEL + + 2015-03-17T11:45:48.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Small DD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapsml01. SID=DD1 NR=00 + + 2 + 8192 + + + + + SAPACCEL + + 2015-03-17T11:56:07.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Medium TD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapmed00. SID=TD0 NR=00 + + 4 + 10240 + + + + + SAPACCEL + + 2015-03-17T18:05:03.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Medium TD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=sapmed01. SID=TD1 NR=00 + + 4 + 10240 + + + + + SAPACCEL + + 2015-03-17T18:05:13.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Large PD0 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=saplrg00. SID=PD0 NR=00 + + 8 + 20480 + + + + + + SAPACCEL + + 2015-03-17T12:03:15.000Z + NORMAL + + + Win2008 R2 Ent 64-bit with SAP Large PD1 + MSSQL 2012 and SAP ECC6_EHP7 (no licensing). Hostname=saplrg01. SID=PD1 NR=00 + + 8 + 20480 + + + + + + SAPACCEL + + 2015-03-17T12:05:04.000Z + NORMAL + + + Win2008 Ent 64-bit 2 CPU + Windows 2008 Enterprise SP2 64-bit + + 2 + 4096 + + + 2015-03-03T16:20:00.000Z + NORMAL + + + Win2008 Std 32-bit 2 CPU + Windows 2008 Standard SP2 32-bit + + 2 + 4096 + + + 2015-03-03T16:20:09.000Z + NORMAL + + + Win2008 Ent 32-bit 2 CPU + Windows 2008 Enterprise SP2 32-bit + + 2 + 4096 + + + 2015-03-03T16:20:18.000Z + NORMAL + + + CSfM SharePoint 2013 Trial + Windows 2012 R2 Standard 64-bit installed with SharePoint 2013 and Visual Studio 2013 Pro (Trial Version) + + 4 + 12288 + + + 2015-05-21T15:29:21.000Z + NORMAL + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_myaccount.xml b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_myaccount.xml new file mode 100644 index 0000000000..4f3b132879 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/oec_0_9_myaccount.xml @@ -0,0 +1,26 @@ + + + testuser + Test User + Test + User + test@example.com + 8a8f6abc-2745-4d8a-9cbc-8dabe5a7d0e4 + + + create image + + + reports + + + server + + + primary administrator + + + network + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/port_list_create.xml b/libcloud/test/compute/fixtures/dimensiondata/port_list_create.xml new file mode 100644 index 0000000000..eb1ba7ebe3 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/port_list_create.xml @@ -0,0 +1,9 @@ + + + CREATE_PORT_LIST + OK + Port List 'MyPortList' has been created. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/port_list_delete.xml b/libcloud/test/compute/fixtures/dimensiondata/port_list_delete.xml new file mode 100644 index 0000000000..6414c2615b --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/port_list_delete.xml @@ -0,0 +1,10 @@ + + + DELETE_PORT_LIST + OK + Port List with Id 84e34850-595d-436e-a885-7cd37edb24a4 has been + deleted. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/port_list_edit.xml b/libcloud/test/compute/fixtures/dimensiondata/port_list_edit.xml new file mode 100644 index 0000000000..fe95f5706c --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/port_list_edit.xml @@ -0,0 +1,8 @@ + + + EDIT_PORT_LIST + OK + Port List 'MyPortList' has been edited successfully. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/port_list_get.xml b/libcloud/test/compute/fixtures/dimensiondata/port_list_get.xml new file mode 100644 index 0000000000..815a48b41b --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/port_list_get.xml @@ -0,0 +1,15 @@ + + + MyPortList + Production Servers + + + + + + NORMAL + 2015-06-21T18:54:42.000Z + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/port_list_lists.xml b/libcloud/test/compute/fixtures/dimensiondata/port_list_lists.xml new file mode 100644 index 0000000000..e42bd47cad --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/port_list_lists.xml @@ -0,0 +1,38 @@ + + + + + MyPortList + Production Servers + + + + + + NORMAL + 2015-06-21T18:54:42.000Z + + + MyPortList2 + Core functions + + + + + NORMAL + 2016-09-01T01:36:49.000Z + + + Test_Port_List_1 + Test Description + + + + NORMAL + 2016-09-06T02:32:29.000Z + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/report_usageMonitoring.xml b/libcloud/test/compute/fixtures/dimensiondata/report_usageMonitoring.xml new file mode 100644 index 0000000000..dc32d95556 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/report_usageMonitoring.xml @@ -0,0 +1,8 @@ +Date,Location,Server,Server ID,Essentials Monitoring Hours,Advanced Monitoring +Hours +2/24/15,NA5,Server A,5a2378ba-11de-11e5-ad2a-ca9798323470,14.25,0 +2/24/15,NA5,Server B,6330a644-11de-11e5-ad2a-ca9798323470,0,8.64 +2/25/15,NA5,Server A,5a2378ba-11de-11e5-ad2a-ca9798323470,24,0 +2/25/15,NA5,Server B,6330a644-11de-11e5-ad2a-ca9798323470,0,24 +2/26/15,NA5,Server A,5a2378ba-11de-11e5-ad2a-ca9798323470,17.59,6.41 +2/26/15,NA5,Server B,6330a644-11de-11e5-ad2a-ca9798323470,2.11,21.89 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_GetServer.xml b/libcloud/test/compute/fixtures/dimensiondata/server_GetServer.xml new file mode 100644 index 0000000000..fc71562a55 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_GetServer.xml @@ -0,0 +1,39 @@ + + + Production Web Server + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + stopped + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + **OR** + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_addDisk.xml b/libcloud/test/compute/fixtures/dimensiondata/server_addDisk.xml new file mode 100644 index 0000000000..4e49bd5f4f --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_addDisk.xml @@ -0,0 +1,9 @@ + + + ADD_DISK + IN_PROGRESS + The request to add a 20 GB Standard Speed Disk on Server 'SERVER-1' has been accepted and is being processed. + + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_addNic.xml b/libcloud/test/compute/fixtures/dimensiondata/server_addNic.xml new file mode 100644 index 0000000000..56eeb024b2 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_addNic.xml @@ -0,0 +1,9 @@ + + +ADD_NIC +IN_PROGRESS +The request to add NIC for VLAN 'Subsystem VLAN' on Server +'Production Mail Server' has been accepted and is being processed.. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_antiAffinityRule_list.xml b/libcloud/test/compute/fixtures/dimensiondata/server_antiAffinityRule_list.xml new file mode 100644 index 0000000000..290b7e4010 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_antiAffinityRule_list.xml @@ -0,0 +1,42 @@ + + + + + ansible-test-image-rhel6 + my new node + + + + + + + ansible-custom-image-test-UAT + my new node + + + + + + + + + + rhel-ansible-full-test + RHEL Ansible Test + + + + + + + + rhel-ansible-full-test + RHEL Ansible Test + + + + + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_antiAffinityRule_list_PAGINATED.xml b/libcloud/test/compute/fixtures/dimensiondata/server_antiAffinityRule_list_PAGINATED.xml new file mode 100644 index 0000000000..fdd5e01e12 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_antiAffinityRule_list_PAGINATED.xml @@ -0,0 +1,42 @@ + + + + + ansible-test-image-rhel6 + my new node + + + + + + + ansible-custom-image-test-UAT + my new node + + + + + + + + + + rhel-ansible-full-test + RHEL Ansible Test + + + + + + + + rhel-ansible-full-test + RHEL Ansible Test + + + + + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_changeServerMonitoringPlan.xml b/libcloud/test/compute/fixtures/dimensiondata/server_changeServerMonitoringPlan.xml new file mode 100644 index 0000000000..654097d6af --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_changeServerMonitoringPlan.xml @@ -0,0 +1,8 @@ + + +CHANGE_SERVER_MONITORING_PLAN +OK +Monitoring on Server 'Production Server' has been changed to +Service Plan 'ADVANCED'. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_cleanServer.xml b/libcloud/test/compute/fixtures/dimensiondata/server_cleanServer.xml new file mode 100644 index 0000000000..011dfd4085 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_cleanServer.xml @@ -0,0 +1,9 @@ + + +CLEAN_SERVER +IN_PROGRESS +The request to clean a failed Server deployment for Server +e75ead52-692f-4314-8725-c8a4f4d13a87 has been accepted and is being processed. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_deleteServer.xml b/libcloud/test/compute/fixtures/dimensiondata/server_deleteServer.xml new file mode 100644 index 0000000000..c8e70dad6e --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_deleteServer.xml @@ -0,0 +1,9 @@ + + +DELETE_SERVER +IN_PROGRESS +Request to Delete Server (Id:d577a691-e116-4913-a440- +022d2729fc84) has been accepted and is being processed + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_deleteServer_RESOURCEBUSY.xml b/libcloud/test/compute/fixtures/dimensiondata/server_deleteServer_RESOURCEBUSY.xml new file mode 100644 index 0000000000..2df9e07c3b --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_deleteServer_RESOURCEBUSY.xml @@ -0,0 +1,8 @@ + + +DELETE_SERVER +RESOURCE_BUSY +Server is already busy + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_deployServer.xml b/libcloud/test/compute/fixtures/dimensiondata/server_deployServer.xml new file mode 100644 index 0000000000..05108c5ec5 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_deployServer.xml @@ -0,0 +1,8 @@ + + +DEPLOY +IN_PROGRESS +Request to deploy Server 'Production FTPS Server' has been +accepted and is being processed. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_disableServerMonitoring.xml b/libcloud/test/compute/fixtures/dimensiondata/server_disableServerMonitoring.xml new file mode 100644 index 0000000000..63609de1a7 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_disableServerMonitoring.xml @@ -0,0 +1,8 @@ + + +DISABLE_SERVER_MONITORING +OK +Monitoring on Server 5783e93f-5370-44fc-a772-cd3c29a2ecaa has +been disabled. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_enableServerMonitoring.xml b/libcloud/test/compute/fixtures/dimensiondata/server_enableServerMonitoring.xml new file mode 100644 index 0000000000..9b1b555412 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_enableServerMonitoring.xml @@ -0,0 +1,8 @@ + + +ENABLE_SERVER_MONITORING +OK +Monitoring on Server 'Production Server' has been +enabled. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_powerOffServer.xml b/libcloud/test/compute/fixtures/dimensiondata/server_powerOffServer.xml new file mode 100644 index 0000000000..549ea79832 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_powerOffServer.xml @@ -0,0 +1,8 @@ + + +POWER_OFF_SERVER +IN_PROGRESS +Request to power off Server 'Production Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_powerOffServer_INPROGRESS.xml b/libcloud/test/compute/fixtures/dimensiondata/server_powerOffServer_INPROGRESS.xml new file mode 100644 index 0000000000..8ddcca918e --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_powerOffServer_INPROGRESS.xml @@ -0,0 +1,8 @@ + + +POWER_OFF_SERVER +RESOURCE_BUSY +Request to power off Server 'Production Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_rebootServer.xml b/libcloud/test/compute/fixtures/dimensiondata/server_rebootServer.xml new file mode 100644 index 0000000000..38f098a08c --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_rebootServer.xml @@ -0,0 +1,8 @@ + + +REBOOT_SERVER +IN_PROGRESS +Request to reboot Server 'Production Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_rebootServer_RESOURCEBUSY.xml b/libcloud/test/compute/fixtures/dimensiondata/server_rebootServer_RESOURCEBUSY.xml new file mode 100644 index 0000000000..3defba48a2 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_rebootServer_RESOURCEBUSY.xml @@ -0,0 +1,7 @@ + + +REBOOT_SERVER +RESOURCE_BUSY +Request to reboot Server 'Production Server' did not work, server is busy. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_reconfigureServer.xml b/libcloud/test/compute/fixtures/dimensiondata/server_reconfigureServer.xml new file mode 100644 index 0000000000..e28e8d75fc --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_reconfigureServer.xml @@ -0,0 +1,5 @@ + + RECONFIGURE_SERVER + OK + Request to reconfigure Server 'Production Server' has been accepted and is being processed. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_removeDisk.xml b/libcloud/test/compute/fixtures/dimensiondata/server_removeDisk.xml new file mode 100644 index 0000000000..8b2d17f038 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_removeDisk.xml @@ -0,0 +1,6 @@ + + + REMOVE_DISK + IN_PROGRESS + Request to Remove disk '540c4d86-4d84-11e4-a91c-0030487e0302' from Server 'Server 1' has been accepted and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_removeNic.xml b/libcloud/test/compute/fixtures/dimensiondata/server_removeNic.xml new file mode 100644 index 0000000000..61be4e32f1 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_removeNic.xml @@ -0,0 +1,9 @@ + + +REMOVE_NIC +IN_PROGRESS +Request to Remove NIC 5999db1d-725c-46ba-9d4e-d33991e61ab1 for +VLAN 'Subsystem VLAN' from Server 'Production Mail Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_resetServer.xml b/libcloud/test/compute/fixtures/dimensiondata/server_resetServer.xml new file mode 100644 index 0000000000..ece1a8bb41 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_resetServer.xml @@ -0,0 +1,8 @@ + + +RESET_SERVER +IN_PROGRESS +Request to reset Server 'Production Server' has been accepted and +is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_server.xml b/libcloud/test/compute/fixtures/dimensiondata/server_server.xml new file mode 100644 index 0000000000..f1348222c6 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_server.xml @@ -0,0 +1,176 @@ + + + + + Production Web Server MCP 1 + nopassword0 + + + 2 + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + NORMAL + + + + + + Production Web Server MCP 1 + nopassword0 + + + 2 + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + PENDING_ADD + + DEPLOY_SERVER_WITH_DISK_SPEED + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + RECONFIGURE_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + UNKNOWN + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + Production Web Server MCP 21 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + false + UNKNOWN + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + false + NORMAL + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_server_NA3.xml b/libcloud/test/compute/fixtures/dimensiondata/server_server_NA3.xml new file mode 100644 index 0000000000..80b62739b6 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_server_NA3.xml @@ -0,0 +1,50 @@ + + + + + Production Web Server MCP 1 + nopassword0 + + + 2 + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + NORMAL + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml b/libcloud/test/compute/fixtures/dimensiondata/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml new file mode 100644 index 0000000000..813c43fad8 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml @@ -0,0 +1,27 @@ + + + Production Web Server + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + DEPLOY_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_server_paginated.xml b/libcloud/test/compute/fixtures/dimensiondata/server_server_paginated.xml new file mode 100644 index 0000000000..027c9c0205 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_server_paginated.xml @@ -0,0 +1,50 @@ + + + + + Production Web Server MCP 1 + nopassword0 + + + 2 + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + NORMAL + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_server_paginated_empty.xml b/libcloud/test/compute/fixtures/dimensiondata/server_server_paginated_empty.xml new file mode 100644 index 0000000000..31f4c55d43 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_server_paginated_empty.xml @@ -0,0 +1 @@ + diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_shutdownServer.xml b/libcloud/test/compute/fixtures/dimensiondata/server_shutdownServer.xml new file mode 100644 index 0000000000..937cb0d563 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_shutdownServer.xml @@ -0,0 +1,8 @@ + + +SHUTDOWN_SERVER +IN_PROGRESS +Request to shutdown Server 'Production Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_shutdownServer_INPROGRESS.xml b/libcloud/test/compute/fixtures/dimensiondata/server_shutdownServer_INPROGRESS.xml new file mode 100644 index 0000000000..386489cdc9 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_shutdownServer_INPROGRESS.xml @@ -0,0 +1,8 @@ + + +SHUTDOWN_SERVER +RESOURCE_BUSY +Request to shutdown Server 'Production Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_startServer.xml b/libcloud/test/compute/fixtures/dimensiondata/server_startServer.xml new file mode 100644 index 0000000000..4fb4589bb5 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_startServer.xml @@ -0,0 +1,8 @@ + + +START_SERVER +IN_PROGRESS +Request to start Server 'Production Server' has been accepted and +is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_startServer_INPROGRESS.xml b/libcloud/test/compute/fixtures/dimensiondata/server_startServer_INPROGRESS.xml new file mode 100644 index 0000000000..f5c30708b6 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_startServer_INPROGRESS.xml @@ -0,0 +1,8 @@ + + +START_SERVER +RESOURCE_BUSY +Request to start Server 'Production Server' has been accepted and +is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_updateVmwareTools.xml b/libcloud/test/compute/fixtures/dimensiondata/server_updateVmwareTools.xml new file mode 100644 index 0000000000..549ea79832 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/server_updateVmwareTools.xml @@ -0,0 +1,8 @@ + + +POWER_OFF_SERVER +IN_PROGRESS +Request to power off Server 'Production Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/summary_usage_report.csv b/libcloud/test/compute/fixtures/dimensiondata/summary_usage_report.csv new file mode 100644 index 0000000000..e4b78e03fb --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/summary_usage_report.csv @@ -0,0 +1,13 @@ +DAY,Location,CPU Hours,RAM Hours,Storage Hours,Performance Storage +Hours,Bandwidth In,Bandwidth Out,Sub-Admin Hours,Network Hours,Public IP +Hours,Cloud Files Account Hours,Cloud Files (GB Days),Software +Units,Essentials Client Days,Advanced Client Days,Enterprise Client +Days,Essentials Backups (GB),Advanced Backups (GB),Enterprise Backups (GB) +01/01/2013,NA1,144,288,3360,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +02/01/2013,NA1,144,288,3360,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +03/01/2013,NA1,144,288,3360,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +04/01/2013,NA1,144,288,3360,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +05/01/2013,NA1,144,288,3360,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +06/01/2013,NA1,172,344,3958,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +07/01/2013,NA1,205,410,4783,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +08/01/2013,NA1,216,432,5136,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_applyTags.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_applyTags.xml new file mode 100644 index 0000000000..91114bb38e --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_applyTags.xml @@ -0,0 +1,6 @@ + + + APPLY_TAGS + OK + Tag(s) successfully applied. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_applyTags_BADREQUEST.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_applyTags_BADREQUEST.xml new file mode 100644 index 0000000000..dec66ad77b --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_applyTags_BADREQUEST.xml @@ -0,0 +1,6 @@ + + + APPLY_TAGS + RESOURCE_NOT_FOUND + Tag Key(s) (ChangeNameTes) not found. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_createTagKey.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_createTagKey.xml new file mode 100644 index 0000000000..927812dc26 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_createTagKey.xml @@ -0,0 +1,7 @@ + + + CREATE_TAG_KEY + OK + Tag Key 'MyTestKey' has been created. + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_createTagKey_BADREQUEST.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_createTagKey_BADREQUEST.xml new file mode 100644 index 0000000000..eaa73abd55 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_createTagKey_BADREQUEST.xml @@ -0,0 +1,6 @@ + + + CREATE_TAG_KEY + NAME_NOT_UNIQUE + Another Tag Key named 'MyTestKey' already exists. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_deleteTagKey.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_deleteTagKey.xml new file mode 100644 index 0000000000..9fa8b5925b --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_deleteTagKey.xml @@ -0,0 +1,6 @@ + + + DELETE_TAG_KEY + OK + Tag Key (Id:4f921962-402d-438d-aa37-6f6a0392a1a9) has been deleted. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_deleteTagKey_BADREQUEST.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_deleteTagKey_BADREQUEST.xml new file mode 100644 index 0000000000..357f2d8e24 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_deleteTagKey_BADREQUEST.xml @@ -0,0 +1,6 @@ + + + DELETE_TAG_KEY + RESOURCE_NOT_FOUND + Tag Key fdafdsa not found. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_editTagKey.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_editTagKey.xml new file mode 100644 index 0000000000..f5e4d771ac --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_editTagKey.xml @@ -0,0 +1,6 @@ + + + EDIT_TAG_KEY + OK + Tag Key 'ChangeNameTest' has been edited. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_editTagKey_BADREQUEST.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_editTagKey_BADREQUEST.xml new file mode 100644 index 0000000000..cb0c706f2f --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_editTagKey_BADREQUEST.xml @@ -0,0 +1,6 @@ + + + EDIT_TAG_KEY + NO_CHANGE + At least one of name, description, valueRequired or displayOnReport must be changed from its current value. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_removeTag.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_removeTag.xml new file mode 100644 index 0000000000..1d3c9a3303 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_removeTag.xml @@ -0,0 +1,6 @@ + + + REMOVE_TAGS + OK + Tag(s) successfully removed. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_removeTag_BADREQUEST.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_removeTag_BADREQUEST.xml new file mode 100644 index 0000000000..c686a20fad --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_removeTag_BADREQUEST.xml @@ -0,0 +1,6 @@ + + + REMOVE_TAGS + RESOURCE_NOT_FOUND + Tag Key(s) (AaronTestModified) not applied to Server eb222a4a-fffd-4e4a-8346-1279ef621ab0. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54.xml new file mode 100644 index 0000000000..6d1aa13583 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54.xml @@ -0,0 +1,6 @@ + + + LibcloudTest + true + true + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54_BADREQUEST.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54_BADREQUEST.xml new file mode 100644 index 0000000000..d585d5a2b4 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54_BADREQUEST.xml @@ -0,0 +1,6 @@ + + + GET_TAG_KEY + RESOURCE_NOT_FOUND + Tag Key 5ab77f5f-5aa9-426f-8459-4eab34e03d5 not found. + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_tagKey_list.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_tagKey_list.xml new file mode 100644 index 0000000000..a75b8c5746 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_tagKey_list.xml @@ -0,0 +1,19 @@ + + + + AaronTestModified + Testing for VMWare + true + true + + + LibcloudTest + true + true + + + MyTestKey + true + true + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_tagKey_list_SINGLE.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_tagKey_list_SINGLE.xml new file mode 100644 index 0000000000..8deaa969a9 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_tagKey_list_SINGLE.xml @@ -0,0 +1,8 @@ + + + + LibcloudTest + true + true + + diff --git a/libcloud/test/compute/fixtures/dimensiondata/tag_tag_list.xml b/libcloud/test/compute/fixtures/dimensiondata/tag_tag_list.xml new file mode 100644 index 0000000000..d79b648bd8 --- /dev/null +++ b/libcloud/test/compute/fixtures/dimensiondata/tag_tag_list.xml @@ -0,0 +1,36 @@ + + + + SERVER + 09242b55-3bc8-4cb7-b30c-4158267f58e6 + App server + NA9 + 5ab77f5f-5aa9-426f-8459-4eab34e03d54 + ChangeNameTest + No way! + true + true + + + NETWORK_DOMAIN + 1a16bf5e-583b-42c9-af94-a92d9ee1607f + An Ho1a Demo + NA9 + d047c609-93d7-4bc5-8fc9-732c85840075 + AaronTestModified + Success + true + true + + + SERVER + 77da591d-b58e-43ef-8bc2-ddde3f732893 + Test 1 + NA9 + d047c609-93d7-4bc5-8fc9-732c85840075 + AaronTestModified + Test VMware + true + true + + diff --git a/libcloud/test/compute/fixtures/ec2/allocate_address.xml b/libcloud/test/compute/fixtures/ec2/allocate_address.xml index 94587b6430..c400896456 100644 --- a/libcloud/test/compute/fixtures/ec2/allocate_address.xml +++ b/libcloud/test/compute/fixtures/ec2/allocate_address.xml @@ -1,4 +1,4 @@ - + 56926e0e-5fa3-41f3-927c-17212def59df 192.0.2.1 standard diff --git a/libcloud/test/compute/fixtures/ec2/allocate_vpc_address.xml b/libcloud/test/compute/fixtures/ec2/allocate_vpc_address.xml index 9029d677a9..85699fb615 100644 --- a/libcloud/test/compute/fixtures/ec2/allocate_vpc_address.xml +++ b/libcloud/test/compute/fixtures/ec2/allocate_vpc_address.xml @@ -1,4 +1,4 @@ - + eb920193-37a9-401a-8fff-089783b2c153 192.0.2.2 vpc diff --git a/libcloud/test/compute/fixtures/ec2/associate_address.xml b/libcloud/test/compute/fixtures/ec2/associate_address.xml index 39c29bbffe..3b212732e6 100644 --- a/libcloud/test/compute/fixtures/ec2/associate_address.xml +++ b/libcloud/test/compute/fixtures/ec2/associate_address.xml @@ -1,4 +1,4 @@ - + 1a470be4-b44d-4423-a80c-44ef2070b8be true diff --git a/libcloud/test/compute/fixtures/ec2/associate_vpc_address.xml b/libcloud/test/compute/fixtures/ec2/associate_vpc_address.xml index 21348edcdc..9e8c18cbb0 100644 --- a/libcloud/test/compute/fixtures/ec2/associate_vpc_address.xml +++ b/libcloud/test/compute/fixtures/ec2/associate_vpc_address.xml @@ -1,4 +1,4 @@ - + s132fsz2-6cdg-4ox3-a148-lpqnvdc98c2a true eipassoc-167a8073 diff --git a/libcloud/test/compute/fixtures/ec2/attach_internet_gateway.xml b/libcloud/test/compute/fixtures/ec2/attach_internet_gateway.xml index 852ec39e9b..a8dc36cb73 100644 --- a/libcloud/test/compute/fixtures/ec2/attach_internet_gateway.xml +++ b/libcloud/test/compute/fixtures/ec2/attach_internet_gateway.xml @@ -1,4 +1,4 @@ - + 1eb45fd7-d4f6-4b63-a52f-54fc0c82617e true \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/attach_network_interface.xml b/libcloud/test/compute/fixtures/ec2/attach_network_interface.xml index 7b6baa8123..aed3d097e1 100644 --- a/libcloud/test/compute/fixtures/ec2/attach_network_interface.xml +++ b/libcloud/test/compute/fixtures/ec2/attach_network_interface.xml @@ -1,4 +1,4 @@ - + e46c7abc-8b14-4315-99cb-773a0f95d833 eni-attach-2b588b47 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/attach_volume.xml b/libcloud/test/compute/fixtures/ec2/attach_volume.xml index b0df438ac8..3058d2d081 100644 --- a/libcloud/test/compute/fixtures/ec2/attach_volume.xml +++ b/libcloud/test/compute/fixtures/ec2/attach_volume.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE vol-4d826724 i-6058a509 diff --git a/libcloud/test/compute/fixtures/ec2/authorize_security_group_egress.xml b/libcloud/test/compute/fixtures/ec2/authorize_security_group_egress.xml index 41e7e463b3..b78786fda9 100644 --- a/libcloud/test/compute/fixtures/ec2/authorize_security_group_egress.xml +++ b/libcloud/test/compute/fixtures/ec2/authorize_security_group_egress.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE true diff --git a/libcloud/test/compute/fixtures/ec2/authorize_security_group_ingress.xml b/libcloud/test/compute/fixtures/ec2/authorize_security_group_ingress.xml index 18b02ac9bc..a088b21edb 100644 --- a/libcloud/test/compute/fixtures/ec2/authorize_security_group_ingress.xml +++ b/libcloud/test/compute/fixtures/ec2/authorize_security_group_ingress.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE true diff --git a/libcloud/test/compute/fixtures/ec2/copy_image.xml b/libcloud/test/compute/fixtures/ec2/copy_image.xml index f2e76b0f1d..d9f80c9377 100644 --- a/libcloud/test/compute/fixtures/ec2/copy_image.xml +++ b/libcloud/test/compute/fixtures/ec2/copy_image.xml @@ -1,4 +1,4 @@ - + 7b7d87d5-c045-4c2c-a2c4-b538debe14b2 ami-4db38224 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/create_encrypted_volume.xml b/libcloud/test/compute/fixtures/ec2/create_encrypted_volume.xml new file mode 100644 index 0000000000..bd22e89975 --- /dev/null +++ b/libcloud/test/compute/fixtures/ec2/create_encrypted_volume.xml @@ -0,0 +1,11 @@ + + 59dbff89-35bd-4eac-99ed-be587EXAMPLE + vol-4d826724 + 10 + + us-east-1a + creating + 2008-05-07T11:51:50.000Z + standard + true + diff --git a/libcloud/test/compute/fixtures/ec2/create_image.xml b/libcloud/test/compute/fixtures/ec2/create_image.xml index 1213f0a21c..fc58d2cff4 100644 --- a/libcloud/test/compute/fixtures/ec2/create_image.xml +++ b/libcloud/test/compute/fixtures/ec2/create_image.xml @@ -1,4 +1,4 @@ - + 3629ec66-c1f8-4b66-aac5-a8ad1cdf6c15 ami-e9b38280 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/create_internet_gateway.xml b/libcloud/test/compute/fixtures/ec2/create_internet_gateway.xml index 0891423c85..1cdaf8fbf7 100644 --- a/libcloud/test/compute/fixtures/ec2/create_internet_gateway.xml +++ b/libcloud/test/compute/fixtures/ec2/create_internet_gateway.xml @@ -1,4 +1,4 @@ - + 437b9824-8143-4583-98f7-0937d53aea83 igw-13ac2b36 diff --git a/libcloud/test/compute/fixtures/ec2/create_key_pair.xml b/libcloud/test/compute/fixtures/ec2/create_key_pair.xml index 2404991938..09efa87b69 100644 --- a/libcloud/test/compute/fixtures/ec2/create_key_pair.xml +++ b/libcloud/test/compute/fixtures/ec2/create_key_pair.xml @@ -1,4 +1,4 @@ - + my-key-pair 1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f diff --git a/libcloud/test/compute/fixtures/ec2/create_network_interface.xml b/libcloud/test/compute/fixtures/ec2/create_network_interface.xml index 416477ed05..91e64b8758 100644 --- a/libcloud/test/compute/fixtures/ec2/create_network_interface.xml +++ b/libcloud/test/compute/fixtures/ec2/create_network_interface.xml @@ -1,4 +1,4 @@ - + ca764ebe-8abc-4d37-9995-b9e88c086fa8 eni-2b36086d diff --git a/libcloud/test/compute/fixtures/ec2/create_placement_groups.xml b/libcloud/test/compute/fixtures/ec2/create_placement_groups.xml index ca83b7fdcb..da2848ac52 100644 --- a/libcloud/test/compute/fixtures/ec2/create_placement_groups.xml +++ b/libcloud/test/compute/fixtures/ec2/create_placement_groups.xml @@ -1,4 +1,4 @@ - + d4904fd9-82c2-4ea5-adfe-a9cc3EXAMPLE true diff --git a/libcloud/test/compute/fixtures/ec2/create_security_group.xml b/libcloud/test/compute/fixtures/ec2/create_security_group.xml index f714eb676f..7f2fcfb6fe 100644 --- a/libcloud/test/compute/fixtures/ec2/create_security_group.xml +++ b/libcloud/test/compute/fixtures/ec2/create_security_group.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE true sg-52e2f530 diff --git a/libcloud/test/compute/fixtures/ec2/create_snapshot.xml b/libcloud/test/compute/fixtures/ec2/create_snapshot.xml index 046778b669..8056d045b5 100644 --- a/libcloud/test/compute/fixtures/ec2/create_snapshot.xml +++ b/libcloud/test/compute/fixtures/ec2/create_snapshot.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587 snap-a7cb2hd9 vol-4282672b diff --git a/libcloud/test/compute/fixtures/ec2/create_subnet.xml b/libcloud/test/compute/fixtures/ec2/create_subnet.xml index b04a69e896..24b555f4b3 100644 --- a/libcloud/test/compute/fixtures/ec2/create_subnet.xml +++ b/libcloud/test/compute/fixtures/ec2/create_subnet.xml @@ -1,4 +1,4 @@ - + e94b315e-6424-4536-b48d-0dfb47732c72 subnet-ce0e7ce6 diff --git a/libcloud/test/compute/fixtures/ec2/create_tags.xml b/libcloud/test/compute/fixtures/ec2/create_tags.xml index 87aef51a27..47a97c48dd 100644 --- a/libcloud/test/compute/fixtures/ec2/create_tags.xml +++ b/libcloud/test/compute/fixtures/ec2/create_tags.xml @@ -1,4 +1,4 @@ - + b001068a-ca0d-4f05-b622-28fe984f44be true diff --git a/libcloud/test/compute/fixtures/ec2/create_volume.xml b/libcloud/test/compute/fixtures/ec2/create_volume.xml index a80cd427a4..40dd556951 100644 --- a/libcloud/test/compute/fixtures/ec2/create_volume.xml +++ b/libcloud/test/compute/fixtures/ec2/create_volume.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE vol-4d826724 10 @@ -6,4 +6,6 @@ us-east-1a creating 2008-05-07T11:51:50.000Z + standard + false diff --git a/libcloud/test/compute/fixtures/ec2/create_vpc.xml b/libcloud/test/compute/fixtures/ec2/create_vpc.xml index 70bff318c8..0ddb9637ca 100644 --- a/libcloud/test/compute/fixtures/ec2/create_vpc.xml +++ b/libcloud/test/compute/fixtures/ec2/create_vpc.xml @@ -1,4 +1,4 @@ - + 7a662fe5-1f34-4e17-9ee9-69a28a8ac0be vpc-ad3527cf diff --git a/libcloud/test/compute/fixtures/ec2/delete_internet_gateway.xml b/libcloud/test/compute/fixtures/ec2/delete_internet_gateway.xml index 619ab540b6..6e57b61693 100644 --- a/libcloud/test/compute/fixtures/ec2/delete_internet_gateway.xml +++ b/libcloud/test/compute/fixtures/ec2/delete_internet_gateway.xml @@ -1,4 +1,4 @@ - + b1a5c8c9-91c7-43f3-8234-c162db89a2df true \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/delete_key_pair.xml b/libcloud/test/compute/fixtures/ec2/delete_key_pair.xml index 3e605b0b75..cbbee1467f 100644 --- a/libcloud/test/compute/fixtures/ec2/delete_key_pair.xml +++ b/libcloud/test/compute/fixtures/ec2/delete_key_pair.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587 true \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/delete_network_interface.xml b/libcloud/test/compute/fixtures/ec2/delete_network_interface.xml index 07bc619c50..7f0ea657a5 100644 --- a/libcloud/test/compute/fixtures/ec2/delete_network_interface.xml +++ b/libcloud/test/compute/fixtures/ec2/delete_network_interface.xml @@ -1,4 +1,4 @@ - + c0bc0036-e328-47c6-bd6d-318b007f66ee true \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/delete_placement_groups.xml b/libcloud/test/compute/fixtures/ec2/delete_placement_groups.xml index 69091a37e5..278169a532 100644 --- a/libcloud/test/compute/fixtures/ec2/delete_placement_groups.xml +++ b/libcloud/test/compute/fixtures/ec2/delete_placement_groups.xml @@ -1,4 +1,4 @@ - + d4904fd9-82c2-4ea5-adfe-a9cc3EXAMPLE true diff --git a/libcloud/test/compute/fixtures/ec2/delete_security_group.xml b/libcloud/test/compute/fixtures/ec2/delete_security_group.xml index 2dc4eec71d..66b110547d 100644 --- a/libcloud/test/compute/fixtures/ec2/delete_security_group.xml +++ b/libcloud/test/compute/fixtures/ec2/delete_security_group.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE true \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/delete_snapshot.xml b/libcloud/test/compute/fixtures/ec2/delete_snapshot.xml index fb24a7033f..fd7ebe0bed 100644 --- a/libcloud/test/compute/fixtures/ec2/delete_snapshot.xml +++ b/libcloud/test/compute/fixtures/ec2/delete_snapshot.xml @@ -1,4 +1,4 @@ - + 5cd6fa89-35bd-4aac-99ed-na8af7 true \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/delete_subnet.xml b/libcloud/test/compute/fixtures/ec2/delete_subnet.xml index dd5ed645fc..a4c69d79b3 100644 --- a/libcloud/test/compute/fixtures/ec2/delete_subnet.xml +++ b/libcloud/test/compute/fixtures/ec2/delete_subnet.xml @@ -1,4 +1,4 @@ - + 5cd6fa89-35bd-4aac-99ed-na8af7 true \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/delete_tags.xml b/libcloud/test/compute/fixtures/ec2/delete_tags.xml index bcc2ffd4b5..a400ff9c6b 100644 --- a/libcloud/test/compute/fixtures/ec2/delete_tags.xml +++ b/libcloud/test/compute/fixtures/ec2/delete_tags.xml @@ -1,4 +1,4 @@ - + 7a297da7-3ecb-4156-8bcb-3be73896cc14 true diff --git a/libcloud/test/compute/fixtures/ec2/delete_volume.xml b/libcloud/test/compute/fixtures/ec2/delete_volume.xml index c6065bcb63..5ae5ed3682 100644 --- a/libcloud/test/compute/fixtures/ec2/delete_volume.xml +++ b/libcloud/test/compute/fixtures/ec2/delete_volume.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE true diff --git a/libcloud/test/compute/fixtures/ec2/delete_vpc.xml b/libcloud/test/compute/fixtures/ec2/delete_vpc.xml index e402a502fe..b6e907102f 100644 --- a/libcloud/test/compute/fixtures/ec2/delete_vpc.xml +++ b/libcloud/test/compute/fixtures/ec2/delete_vpc.xml @@ -1,4 +1,4 @@ - + 85793fa6-2ece-480c-855f-0f82c3257e50 true \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/deregister_image.xml b/libcloud/test/compute/fixtures/ec2/deregister_image.xml index 63ecce932f..b1d7e2601d 100644 --- a/libcloud/test/compute/fixtures/ec2/deregister_image.xml +++ b/libcloud/test/compute/fixtures/ec2/deregister_image.xml @@ -1,4 +1,4 @@ - + d06f248d-444e-475d-a8f8-1ebb4ac39842 true \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/describe_account_attributes.xml b/libcloud/test/compute/fixtures/ec2/describe_account_attributes.xml index bca2e42139..2c2343fff7 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_account_attributes.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_account_attributes.xml @@ -1,5 +1,5 @@ - + a00adaf6-f86c-48eb-85f8-7ac470ae993d diff --git a/libcloud/test/compute/fixtures/ec2/describe_addresses.xml b/libcloud/test/compute/fixtures/ec2/describe_addresses.xml index e6147c5ddf..7a85915130 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_addresses.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_addresses.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE diff --git a/libcloud/test/compute/fixtures/ec2/describe_addresses_all.xml b/libcloud/test/compute/fixtures/ec2/describe_addresses_all.xml index 2803dce135..6d0a5885e8 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_addresses_all.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_addresses_all.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE diff --git a/libcloud/test/compute/fixtures/ec2/describe_addresses_multi.xml b/libcloud/test/compute/fixtures/ec2/describe_addresses_multi.xml index 09cc217ccc..b8aa093099 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_addresses_multi.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_addresses_multi.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE diff --git a/libcloud/test/compute/fixtures/ec2/describe_addresses_single.xml b/libcloud/test/compute/fixtures/ec2/describe_addresses_single.xml index d8b1c2975e..28b452baff 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_addresses_single.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_addresses_single.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE diff --git a/libcloud/test/compute/fixtures/ec2/describe_availability_zones.xml b/libcloud/test/compute/fixtures/ec2/describe_availability_zones.xml index 37ab047067..fb898a0d96 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_availability_zones.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_availability_zones.xml @@ -1,4 +1,4 @@ - + cc0dfb29-efef-451c-974f-341b3edfb28f diff --git a/libcloud/test/compute/fixtures/ec2/describe_images.xml b/libcloud/test/compute/fixtures/ec2/describe_images.xml index 03594e9e4c..806bcffa92 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_images.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_images.xml @@ -1,4 +1,4 @@ - + 73fac9c5-f6d2-4b45-846f-47adf1e82d6c @@ -14,6 +14,11 @@ Testing Stuff ebs /dev/sda1 + + + ab-5dh78019 + + /dev/sda1 @@ -31,6 +36,7 @@ paravirtual xen + 2021-01-10T18:24:00.000Z ami-85b2a8ae @@ -44,6 +50,43 @@ Test Image 2 ebs /dev/sda1 + + + as-6dr90319 + + + + + /dev/sda1 + + snap-c0bfbbdb + 20 + false + standard + + + + paravirtual + xen + + + + ami-85b2a8ac + 123456788908/Test Image 3 + available + 123456788908 + false + x86_64 + machine + aki-88aa75e1 + Test Image 3 + ebs + /dev/sda1 + + + as-6dr90319 + + /dev/sda1 @@ -59,4 +102,4 @@ xen - \ No newline at end of file + diff --git a/libcloud/test/compute/fixtures/ec2/describe_images_ex_imageids.xml b/libcloud/test/compute/fixtures/ec2/describe_images_ex_imageids.xml index 47f2be0d19..f16092de49 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_images_ex_imageids.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_images_ex_imageids.xml @@ -1,4 +1,4 @@ - + 73fac9c5-f6d2-4b45-846f-47adf1e82d6c @@ -14,6 +14,11 @@ Testing Stuff ebs /dev/sda1 + + + ab-5dh78019 + + /dev/sda1 @@ -33,4 +38,4 @@ xen - \ No newline at end of file + diff --git a/libcloud/test/compute/fixtures/ec2/describe_import_snapshot_tasks.xml b/libcloud/test/compute/fixtures/ec2/describe_import_snapshot_tasks.xml new file mode 100644 index 0000000000..86ae6791b0 --- /dev/null +++ b/libcloud/test/compute/fixtures/ec2/describe_import_snapshot_tasks.xml @@ -0,0 +1,18 @@ + + a8c44ac4-8e63-46e9-b8b2-8c72ce3d9b18 + + + import-snap-fh7y6i6w + + snap-0ea83e8a87e138f39 + RAW + 1.073741824E10 + + dummy-bucket + dummy-key + + completed + + + + diff --git a/libcloud/test/compute/fixtures/ec2/describe_import_snapshot_tasks_active.xml b/libcloud/test/compute/fixtures/ec2/describe_import_snapshot_tasks_active.xml new file mode 100644 index 0000000000..edb00cd9b3 --- /dev/null +++ b/libcloud/test/compute/fixtures/ec2/describe_import_snapshot_tasks_active.xml @@ -0,0 +1,17 @@ + + a8c44ac4-8e63-46e9-b8b2-8c72ce3d9b18 + + + import-snap-fh7y6i6w + + RAW + 1.073741824E10 + + dummy-bucket + dummy-key + + active + + + + diff --git a/libcloud/test/compute/fixtures/ec2/describe_instances.xml b/libcloud/test/compute/fixtures/ec2/describe_instances.xml index 1c3233ef4a..ef85a4cf8a 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_instances.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_instances.xml @@ -1,4 +1,4 @@ - + ec0d2a7d-5080-4f4b-9b02-cb0d5d2d4274 diff --git a/libcloud/test/compute/fixtures/ec2/describe_internet_gateways.xml b/libcloud/test/compute/fixtures/ec2/describe_internet_gateways.xml index 44c7185248..683e0efa61 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_internet_gateways.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_internet_gateways.xml @@ -1,4 +1,4 @@ - + 843ff26c-f1ac-48f5-93a6-fa28f8abd9dd diff --git a/libcloud/test/compute/fixtures/ec2/describe_key_pairs.xml b/libcloud/test/compute/fixtures/ec2/describe_key_pairs.xml index e386eedafa..5e5cd31c82 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_key_pairs.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_key_pairs.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE diff --git a/libcloud/test/compute/fixtures/ec2/describe_network_interfaces.xml b/libcloud/test/compute/fixtures/ec2/describe_network_interfaces.xml index f5208778db..f76981fd50 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_network_interfaces.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_network_interfaces.xml @@ -1,4 +1,4 @@ - + e8fc6c0b-d6f8-4b85-aa29-e6a097eb4631 diff --git a/libcloud/test/compute/fixtures/ec2/describe_placement_groups.xml b/libcloud/test/compute/fixtures/ec2/describe_placement_groups.xml index 787eb67962..e237cb0184 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_placement_groups.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_placement_groups.xml @@ -1,4 +1,4 @@ - + d4904fd9-82c2-4ea5-adfe-a9cc3EXAMPLE diff --git a/libcloud/test/compute/fixtures/ec2/describe_reserved_instances.xml b/libcloud/test/compute/fixtures/ec2/describe_reserved_instances.xml index 15e14e3e70..6c5ac71e7b 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_reserved_instances.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_reserved_instances.xml @@ -1,4 +1,4 @@ - + 56d0fffa-8819-4658-bdd7-548f143a86d2 @@ -6,6 +6,7 @@ t1.micro us-east-1b 2013-06-18T12:07:53.161Z + 2014-06-18T12:07:53.161Z 31536000 23.0 0.012 diff --git a/libcloud/test/compute/fixtures/ec2/describe_security_groups.xml b/libcloud/test/compute/fixtures/ec2/describe_security_groups.xml index a292970315..38a9dae096 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_security_groups.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_security_groups.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE diff --git a/libcloud/test/compute/fixtures/ec2/describe_snapshots.xml b/libcloud/test/compute/fixtures/ec2/describe_snapshots.xml index 2faf38ff6e..3b8b1f9ae2 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_snapshots.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_snapshots.xml @@ -1,4 +1,4 @@ - + and4xcasi-35bd-4e3c-89ab-cb183 @@ -22,7 +22,7 @@ snap-18349159 vol-b5a2c1v9 - pending + completed 2013-09-15T16:00:30.000Z 30% 1938218230 diff --git a/libcloud/test/compute/fixtures/ec2/describe_subnets.xml b/libcloud/test/compute/fixtures/ec2/describe_subnets.xml index 3d14d504b6..1c3241cd19 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_subnets.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_subnets.xml @@ -1,4 +1,4 @@ - + 67bba371-8044-45a7-b4a3-d72fef8b96d8 diff --git a/libcloud/test/compute/fixtures/ec2/describe_tags.xml b/libcloud/test/compute/fixtures/ec2/describe_tags.xml index 988b3e19b8..70bc3dfb63 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_tags.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_tags.xml @@ -1,4 +1,4 @@ - + fa7e0e44-df5e-49a0-98d7-5d4d19a29f95 diff --git a/libcloud/test/compute/fixtures/ec2/describe_volumes.xml b/libcloud/test/compute/fixtures/ec2/describe_volumes.xml index f3ab60326f..5c2889c095 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_volumes.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_volumes.xml @@ -1,4 +1,4 @@ - + 766b978a-f574-4c8d-a974-57547a8c304e diff --git a/libcloud/test/compute/fixtures/ec2/describe_volumes_modifications.xml b/libcloud/test/compute/fixtures/ec2/describe_volumes_modifications.xml new file mode 100644 index 0000000000..b376f43d6a --- /dev/null +++ b/libcloud/test/compute/fixtures/ec2/describe_volumes_modifications.xml @@ -0,0 +1,30 @@ + + 35fdf8d3-6ffa-46dc-8f8e-62fe70bc31a2 + + + 10000 + 100 + optimizing + 2000 + io1 + vol-06397e7a0eEXAMPLE + 3 + 2017-02-10T23:40:57.612Z + 10 + gp2 + + + 10000 + 100 + completed + 200 + io1 + vol-bEXAMPLE + 100 + 2017-02-10T22:50:52.207Z + 2017-02-10T22:56:04.823Z + 8 + gp2 + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/describe_vpcs.xml b/libcloud/test/compute/fixtures/ec2/describe_vpcs.xml index 0341edb04a..a5870462b2 100644 --- a/libcloud/test/compute/fixtures/ec2/describe_vpcs.xml +++ b/libcloud/test/compute/fixtures/ec2/describe_vpcs.xml @@ -1,4 +1,4 @@ - + be8cfa34-0710-4895-941f-961c5738f8f8 diff --git a/libcloud/test/compute/fixtures/ec2/detach_internet_gateway.xml b/libcloud/test/compute/fixtures/ec2/detach_internet_gateway.xml index 8fa1e50030..2edac08fe2 100644 --- a/libcloud/test/compute/fixtures/ec2/detach_internet_gateway.xml +++ b/libcloud/test/compute/fixtures/ec2/detach_internet_gateway.xml @@ -1,4 +1,4 @@ - + 7098cc6d-a984-4d34-a5ed-6ae1a645c0b6 true \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/detach_network_interface.xml b/libcloud/test/compute/fixtures/ec2/detach_network_interface.xml index 0f95a8bcca..1062dedb6a 100644 --- a/libcloud/test/compute/fixtures/ec2/detach_network_interface.xml +++ b/libcloud/test/compute/fixtures/ec2/detach_network_interface.xml @@ -1,4 +1,4 @@ - + 1a683cd6-58ea-4b93-a6e9-a23b56afddf0 true \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/detach_volume.xml b/libcloud/test/compute/fixtures/ec2/detach_volume.xml index c49817696d..14429acc07 100644 --- a/libcloud/test/compute/fixtures/ec2/detach_volume.xml +++ b/libcloud/test/compute/fixtures/ec2/detach_volume.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE vol-4d826724 i-6058a509 diff --git a/libcloud/test/compute/fixtures/ec2/disassociate_address.xml b/libcloud/test/compute/fixtures/ec2/disassociate_address.xml index 99d81023af..6c956eaade 100644 --- a/libcloud/test/compute/fixtures/ec2/disassociate_address.xml +++ b/libcloud/test/compute/fixtures/ec2/disassociate_address.xml @@ -1,4 +1,4 @@ - + dfb841f8-cc26-4f45-a3ac-dc08589eec1d true diff --git a/libcloud/test/compute/fixtures/ec2/get_console_output.xml b/libcloud/test/compute/fixtures/ec2/get_console_output.xml index 5d74cd6303..4b35a85eb0 100644 --- a/libcloud/test/compute/fixtures/ec2/get_console_output.xml +++ b/libcloud/test/compute/fixtures/ec2/get_console_output.xml @@ -1,4 +1,4 @@ - + f0ffb5ce-8d62-4ab9-add7-67a0f99c9811 i-40128925 2013-12-02T12:31:38.000Z diff --git a/libcloud/test/compute/fixtures/ec2/import_key_pair.xml b/libcloud/test/compute/fixtures/ec2/import_key_pair.xml index 09479f1675..737be15790 100644 --- a/libcloud/test/compute/fixtures/ec2/import_key_pair.xml +++ b/libcloud/test/compute/fixtures/ec2/import_key_pair.xml @@ -1,4 +1,4 @@ - + 7a62c49f-347e-4fc4-9331-6e8eEXAMPLE keypair 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 diff --git a/libcloud/test/compute/fixtures/ec2/import_snapshot.xml b/libcloud/test/compute/fixtures/ec2/import_snapshot.xml new file mode 100644 index 0000000000..e2d51de7aa --- /dev/null +++ b/libcloud/test/compute/fixtures/ec2/import_snapshot.xml @@ -0,0 +1,16 @@ + + 0d490bf6-19cf-4456-9c71-31d097faf46d + import-snap-fgsddbhv + + RAW + 3 + 0.0 + pending + + dummy-bucket + dummy-key + + active + + + diff --git a/libcloud/test/compute/fixtures/ec2/modify_image_attribute.xml b/libcloud/test/compute/fixtures/ec2/modify_image_attribute.xml index 200cb6a041..74667cb3e3 100644 --- a/libcloud/test/compute/fixtures/ec2/modify_image_attribute.xml +++ b/libcloud/test/compute/fixtures/ec2/modify_image_attribute.xml @@ -1,3 +1,3 @@ - + true \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/modify_instance_attribute.xml b/libcloud/test/compute/fixtures/ec2/modify_instance_attribute.xml index 2ff14e96b0..5aa050b936 100644 --- a/libcloud/test/compute/fixtures/ec2/modify_instance_attribute.xml +++ b/libcloud/test/compute/fixtures/ec2/modify_instance_attribute.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE true diff --git a/libcloud/test/compute/fixtures/ec2/modify_snapshot_attribute.xml b/libcloud/test/compute/fixtures/ec2/modify_snapshot_attribute.xml new file mode 100644 index 0000000000..53ae5517b3 --- /dev/null +++ b/libcloud/test/compute/fixtures/ec2/modify_snapshot_attribute.xml @@ -0,0 +1,4 @@ + + 59dbff89-35bd-4eac-99ed-be587EXAMPLE + true + diff --git a/libcloud/test/compute/fixtures/ec2/modify_subnet_attribute.xml b/libcloud/test/compute/fixtures/ec2/modify_subnet_attribute.xml new file mode 100644 index 0000000000..42bbbf4840 --- /dev/null +++ b/libcloud/test/compute/fixtures/ec2/modify_subnet_attribute.xml @@ -0,0 +1,4 @@ + + 59dbff89-35bd-4eac-99ed-be587EXAMPLE + true + diff --git a/libcloud/test/compute/fixtures/ec2/modify_volume.xml b/libcloud/test/compute/fixtures/ec2/modify_volume.xml new file mode 100644 index 0000000000..44db5c0763 --- /dev/null +++ b/libcloud/test/compute/fixtures/ec2/modify_volume.xml @@ -0,0 +1,15 @@ + + 5jkdf074-37ed-4004-8671-a78ee82bf1cbEXAMPLE + + 1000 + 300 + modifying + 2 + io1 + vol-10ae5e2b + 0 + 2017-01-19T23:58:04.922Z + 1 + gp2 + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/reboot_instances.xml b/libcloud/test/compute/fixtures/ec2/reboot_instances.xml index df7aa31a6d..823efcc1db 100644 --- a/libcloud/test/compute/fixtures/ec2/reboot_instances.xml +++ b/libcloud/test/compute/fixtures/ec2/reboot_instances.xml @@ -1,4 +1,4 @@ - + 76dabb7a-fb39-4ed1-b5e0-31a4a0fdf5c0 true diff --git a/libcloud/test/compute/fixtures/ec2/register_image.xml b/libcloud/test/compute/fixtures/ec2/register_image.xml index ebaeb08206..6ecd95b83c 100644 --- a/libcloud/test/compute/fixtures/ec2/register_image.xml +++ b/libcloud/test/compute/fixtures/ec2/register_image.xml @@ -1,4 +1,4 @@ - + 6d858ea7-053e-4751-9fae-b891019fc8d2 ami-57c2fb3e \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ec2/release_address.xml b/libcloud/test/compute/fixtures/ec2/release_address.xml index 67ccf4e8e5..28100e470f 100644 --- a/libcloud/test/compute/fixtures/ec2/release_address.xml +++ b/libcloud/test/compute/fixtures/ec2/release_address.xml @@ -1,4 +1,4 @@ - + 23ec1390-8c1d-4a3e-8042-b1ad84933f57 true diff --git a/libcloud/test/compute/fixtures/ec2/revoke_security_group_egress.xml b/libcloud/test/compute/fixtures/ec2/revoke_security_group_egress.xml index 248fbb79de..b21958a3fc 100644 --- a/libcloud/test/compute/fixtures/ec2/revoke_security_group_egress.xml +++ b/libcloud/test/compute/fixtures/ec2/revoke_security_group_egress.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE true diff --git a/libcloud/test/compute/fixtures/ec2/revoke_security_group_ingress.xml b/libcloud/test/compute/fixtures/ec2/revoke_security_group_ingress.xml index 26708dae9a..e416e85411 100644 --- a/libcloud/test/compute/fixtures/ec2/revoke_security_group_ingress.xml +++ b/libcloud/test/compute/fixtures/ec2/revoke_security_group_ingress.xml @@ -1,4 +1,4 @@ - + 59dbff89-35bd-4eac-99ed-be587EXAMPLE true diff --git a/libcloud/test/compute/fixtures/ec2/run_instances.xml b/libcloud/test/compute/fixtures/ec2/run_instances.xml index dd0852ee27..a6332aad63 100644 --- a/libcloud/test/compute/fixtures/ec2/run_instances.xml +++ b/libcloud/test/compute/fixtures/ec2/run_instances.xml @@ -1,4 +1,4 @@ - + r-47a5402e AIDADH4IGTRXXKCD diff --git a/libcloud/test/compute/fixtures/ec2/run_instances_iam_profile.xml b/libcloud/test/compute/fixtures/ec2/run_instances_iam_profile.xml index b61d8358e8..579ef0a8d4 100644 --- a/libcloud/test/compute/fixtures/ec2/run_instances_iam_profile.xml +++ b/libcloud/test/compute/fixtures/ec2/run_instances_iam_profile.xml @@ -1,4 +1,4 @@ - + r-47a5403e AIDADH4IGTRXXKCD diff --git a/libcloud/test/compute/fixtures/ec2/run_instances_idem.xml b/libcloud/test/compute/fixtures/ec2/run_instances_idem.xml index 30824ff889..7c1945f533 100644 --- a/libcloud/test/compute/fixtures/ec2/run_instances_idem.xml +++ b/libcloud/test/compute/fixtures/ec2/run_instances_idem.xml @@ -1,4 +1,4 @@ - + r-47a5402e AIDADH4IGTRXXKCD diff --git a/libcloud/test/compute/fixtures/ec2/run_instances_spot.xml b/libcloud/test/compute/fixtures/ec2/run_instances_spot.xml new file mode 100644 index 0000000000..0d2107cc1c --- /dev/null +++ b/libcloud/test/compute/fixtures/ec2/run_instances_spot.xml @@ -0,0 +1,32 @@ + + r-47a5402e + AIDADH4IGTRXXKCD + + + default + + + + + i-2ba64344 + spot + ami-be3adfd7 + + 0 + pending + + + + example-key-name + 0 + m1.small + 2007-08-07T11:51:50.000Z + + us-east-1b + + + true + + + + diff --git a/libcloud/test/compute/fixtures/ec2/run_instances_with_subnet_and_security_group.xml b/libcloud/test/compute/fixtures/ec2/run_instances_with_subnet_and_security_group.xml new file mode 100644 index 0000000000..ca5559ecaa --- /dev/null +++ b/libcloud/test/compute/fixtures/ec2/run_instances_with_subnet_and_security_group.xml @@ -0,0 +1,87 @@ + + + ebfcb9e2-fe5f-4afd-ac91-6a9946305e32 + r-11111111 + 111111111111 + + + + i-11111111 + ami-11111111 + + 0 + pending + + ip-192-0-2-5.us-east-1.compute.internal + + + 0 + + m3.medium + 2015-09-30T14:37:59.000Z + + us-east-1a + + default + + aki-111111111 + + disabled + + subnet-11111111 + vpc-11111111 + 192.0.2.5 + true + + + sg-11111111 + test-security-group + + + + pending + pending + + x86_64 + ebs + /dev/sda + + paravirtual + + xen + + + eni-11111111 + subnet-11111111 + vpc-11111111 + + 111111111111 + in-use + 06:ea:24:17:f7:77 + 192.0.2.5 + true + + + sg-11111111 + test-security-group + + + + eni-attach-11111111 + 0 + attaching + 2015-09-30T14:37:59.000Z + true + + + + 192.0.2.5 + true + + + + + false + + + diff --git a/libcloud/test/compute/fixtures/ec2/start_instances.xml b/libcloud/test/compute/fixtures/ec2/start_instances.xml index cd793ec2b2..34aa9e04ff 100644 --- a/libcloud/test/compute/fixtures/ec2/start_instances.xml +++ b/libcloud/test/compute/fixtures/ec2/start_instances.xml @@ -1,4 +1,4 @@ - + 322f78ee-967b-40c9-aecd-8d442022da20 diff --git a/libcloud/test/compute/fixtures/ec2/stop_instances.xml b/libcloud/test/compute/fixtures/ec2/stop_instances.xml index 79bc6fe0bb..49cefacbe2 100644 --- a/libcloud/test/compute/fixtures/ec2/stop_instances.xml +++ b/libcloud/test/compute/fixtures/ec2/stop_instances.xml @@ -1,4 +1,4 @@ - + 4ace6850-c876-4971-af0b-67a4278c36a1 diff --git a/libcloud/test/compute/fixtures/ec2/terminate_instances.xml b/libcloud/test/compute/fixtures/ec2/terminate_instances.xml index de314de642..ab1ff20036 100644 --- a/libcloud/test/compute/fixtures/ec2/terminate_instances.xml +++ b/libcloud/test/compute/fixtures/ec2/terminate_instances.xml @@ -1,4 +1,4 @@ - + fa63083d-e0f7-4933-b31a-f266643bdee8 diff --git a/libcloud/test/compute/fixtures/ecs/attach_disk.xml b/libcloud/test/compute/fixtures/ecs/attach_disk.xml new file mode 100644 index 0000000000..cfce115d3c --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/attach_disk.xml @@ -0,0 +1,4 @@ + + + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/copy_image.xml b/libcloud/test/compute/fixtures/ecs/copy_image.xml new file mode 100644 index 0000000000..a25cba5953 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/copy_image.xml @@ -0,0 +1,5 @@ + + + i-28n7dkvov + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/create_disk.xml b/libcloud/test/compute/fixtures/ecs/create_disk.xml new file mode 100644 index 0000000000..9ba554e353 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/create_disk.xml @@ -0,0 +1,5 @@ + + + i-28n7dkvov + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/create_image.xml b/libcloud/test/compute/fixtures/ecs/create_image.xml new file mode 100644 index 0000000000..f25bc693be --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/create_image.xml @@ -0,0 +1,5 @@ + + + i-28n7dkvov + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/create_instance.xml b/libcloud/test/compute/fixtures/ecs/create_instance.xml new file mode 100644 index 0000000000..b9699bd422 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/create_instance.xml @@ -0,0 +1,5 @@ + + + i-28n7dkvov + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/create_node_describe_instances.xml b/libcloud/test/compute/fixtures/ecs/create_node_describe_instances.xml new file mode 100644 index 0000000000..24eae7ed1f --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/create_node_describe_instances.xml @@ -0,0 +1,56 @@ + + + 1 + 1 + 10 + CA75EE06-D5F7-433C-870B-5042EED6C1DC + + + ubuntu1404_64_20G_aliaegis_20150325.vhd + + 10.163.197.74 + + ecs.t1 + + i-28n7dkvov + + + + + + -1 + cn-qingdao-b + PayByTraffic + ca0122d9-374d-4fce-9fc0-71f7c3eaf1c3 + false + 1024 + 1 + + + + + + + 1 + true + + sg-28ou0f3xa + + iZ28n7dkvovZ + + classic + + 114.215.124.73 + + iZ28n7dkvovZ + ecs.t1.small + 2015-12-27T07:35Z + Running + + cn-qingdao + + PostPaid + 2999-09-08T16:00Z + + + diff --git a/libcloud/test/compute/fixtures/ecs/create_public_ip.xml b/libcloud/test/compute/fixtures/ecs/create_public_ip.xml new file mode 100644 index 0000000000..e723d7fff9 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/create_public_ip.xml @@ -0,0 +1,6 @@ + + + F2EF6A3B-E345-46B9-931E-0EA094818567 + 10.1.149.159 + + diff --git a/libcloud/test/compute/fixtures/ecs/create_security_group.xml b/libcloud/test/compute/fixtures/ecs/create_security_group.xml new file mode 100644 index 0000000000..27d3a78c82 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/create_security_group.xml @@ -0,0 +1,5 @@ + + +CEF72CEB-54B6-4AE8-B225-F876FF7BA984 + sg-F876FF7BA + diff --git a/libcloud/test/compute/fixtures/ecs/create_snapshot.xml b/libcloud/test/compute/fixtures/ecs/create_snapshot.xml new file mode 100644 index 0000000000..54793b1a3a --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/create_snapshot.xml @@ -0,0 +1,5 @@ + + + i-28n7dkvov + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/create_volume_describe_disks.xml b/libcloud/test/compute/fixtures/ecs/create_volume_describe_disks.xml new file mode 100644 index 0000000000..d25c9a1a99 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/create_volume_describe_disks.xml @@ -0,0 +1,36 @@ + + + + + PostPaid + true + true + true + cloud + Description + ubuntu1404sys + 5 + system + i-28whl2nj2 + 2014-07-23T02:44:06Z + ubuntu1404_64_20G_aliaegis_20150325.vhd + cn-qingdao-b + 2016-01-04T15:02:17Z + + /dev/xvda + + false + + cn-qingdao + d-28zfrmo13 + + In_use + + 2999-09-08T16:00Z + + + 1 + 10 + 1 + ED5CF6DD-71CA-462C-9C94-A61A78A01479 + diff --git a/libcloud/test/compute/fixtures/ecs/delete_disk.xml b/libcloud/test/compute/fixtures/ecs/delete_disk.xml new file mode 100644 index 0000000000..d83b677d6d --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/delete_disk.xml @@ -0,0 +1,4 @@ + + + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/delete_image.xml b/libcloud/test/compute/fixtures/ecs/delete_image.xml new file mode 100644 index 0000000000..9c0382f7fe --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/delete_image.xml @@ -0,0 +1,4 @@ + + + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/delete_instance.xml b/libcloud/test/compute/fixtures/ecs/delete_instance.xml new file mode 100644 index 0000000000..b1f017ccd9 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/delete_instance.xml @@ -0,0 +1,4 @@ + + + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/delete_security_group_by_id.xml b/libcloud/test/compute/fixtures/ecs/delete_security_group_by_id.xml new file mode 100644 index 0000000000..bba024e531 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/delete_security_group_by_id.xml @@ -0,0 +1,4 @@ + + + CEF72CEB-54B6-4AE8-B225-F876FF7BA984 + diff --git a/libcloud/test/compute/fixtures/ecs/delete_snapshot.xml b/libcloud/test/compute/fixtures/ecs/delete_snapshot.xml new file mode 100644 index 0000000000..7fac47bfa7 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/delete_snapshot.xml @@ -0,0 +1,4 @@ + + + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/describe_disks.xml b/libcloud/test/compute/fixtures/ecs/describe_disks.xml new file mode 100644 index 0000000000..87e1846e58 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/describe_disks.xml @@ -0,0 +1,62 @@ + + + + + PostPaid + true + false + false + cloud + + + 5 + data + + 2014-07-23T02:44:07Z + + cn-qingdao-b + 2014-07-23T07:47:35Z + 2014-07-23T08:28:48Z + + + true + + cn-qingdao + d-28m5zbua0 + + Available + + + + PostPaid + true + true + true + cloud + Description + ubuntu1404sys + 5 + system + i-28whl2nj2 + 2014-07-23T02:44:06Z + ubuntu1404_64_20G_aliaegis_20150325.vhd + cn-qingdao-b + 2016-01-04T15:02:17Z + + /dev/xvda + + false + + cn-qingdao + d-28zfrmo13 + + In_use + + 2999-09-08T16:00Z + + + 1 + 10 + 2 + ED5CF6DD-71CA-462C-9C94-A61A78A01479 + diff --git a/libcloud/test/compute/fixtures/ecs/describe_images.xml b/libcloud/test/compute/fixtures/ecs/describe_images.xml new file mode 100644 index 0000000000..80b1a31eee --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/describe_images.xml @@ -0,0 +1,41 @@ + + + 1 + 1 + 10 + cn-qingdao + FAD4D9B9-D75F-4A9E-BC13-991C0F06F50F + + + freebsd1001_64_20G_aliaegis_20150527.vhd + freebsd1001_64_20G_aliaegis_20150527.vhd + + linux + x86_64 + FreeBSD 10.1 64位 + + + + + /dev/xvda + + + 20 + + + system + 100% + instance + 2015-06-19T07:25:42Z + + 1.0.0 + Available + freebsd1001_64_20G_aliaegis_20150527.vhd + + false + false + Freebsd + 20 + + + diff --git a/libcloud/test/compute/fixtures/ecs/describe_instance_types.xml b/libcloud/test/compute/fixtures/ecs/describe_instance_types.xml new file mode 100644 index 0000000000..600956439e --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/describe_instance_types.xml @@ -0,0 +1,18 @@ + + + 1651FBB6-4FBF-49FF-A9F5-DF5D696C7EC6 + + + ecs.t1.xsmall + 1 + 0.5 + ecs.t1 + + + ecs.s2.small + 2 + 1.0 + ecs.s2 + + + diff --git a/libcloud/test/compute/fixtures/ecs/describe_instances.xml b/libcloud/test/compute/fixtures/ecs/describe_instances.xml new file mode 100644 index 0000000000..5bef7a46f8 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/describe_instances.xml @@ -0,0 +1,101 @@ + + + 1 + 1 + 10 + CA75EE06-D5F7-433C-870B-5042EED6C1DC + + + ubuntu1404_64_20G_aliaegis_20150325.vhd + + 10.163.197.74 + + ecs.t1 + + i-28n7dkvov + + + + + + -1 + cn-qingdao-b + PayByTraffic + ca0122d9-374d-4fce-9fc0-71f7c3eaf1c3 + false + 1024 + 1 + + + + + + + 1 + true + + sg-28ou0f3xa + + iZ28n7dkvovZ + + classic + + 114.215.124.73 + + iZ28n7dkvovZ + ecs.t1.small + 2015-12-27T07:35Z + Starting + + cn-qingdao + + PostPaid + 2999-09-08T16:00Z + + + ubuntu1404_64_20G_aliaegis_20150325.vhd + + ecs.t1 + + i-28n7dkvov + + 114.215.124.73 + + + + -1 + cn-qingdao-b + PayByTraffic + ca0122d9-374d-4fce-9fc0-71f7c3eaf1c3 + false + 1024 + 1 + + + + 10.163.197.74 + + + + + 1 + true + + sg-28ou0f3xa + + iZ28n7dkvovZ + + classic + + iZ28n7dkvovZ + ecs.t1.small + 2015-12-27T07:35Z + Starting + + cn-qingdao + + PostPaid + 2999-09-08T16:00Z + + + diff --git a/libcloud/test/compute/fixtures/ecs/describe_regions.xml b/libcloud/test/compute/fixtures/ecs/describe_regions.xml new file mode 100644 index 0000000000..d77729d3e3 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/describe_regions.xml @@ -0,0 +1,42 @@ + + + FD28A957-20B2-447E-8A5A-952F50C4EDF0 + + + ap-southeast-1 + 亚太(新加坡) + + + cn-shenzhen + 深圳 + + + cn-qingdao + 青岛 + + + cn-beijing + 北京 + + + cn-shanghai + 上海 + + + us-east-1 + 美东弗吉尼亚 + + + cn-hongkong + 香港 + + + cn-hangzhou + 杭州 + + + us-west-1 + 美国硅谷 + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ecs/describe_security_group_attributes.xml b/libcloud/test/compute/fixtures/ecs/describe_security_group_attributes.xml new file mode 100644 index 0000000000..04f9dc00c9 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/describe_security_group_attributes.xml @@ -0,0 +1,30 @@ + + + sg-m5e5vyj2j0atm2gewww4 + Accept + sg-m5e5vyj2j0atm2gewww4 + System created security group. + cn-qingdao + 8A3E0262-EEA1-4961-A403-3D6E69F3539C + + + 121.43.18.0/24 + + + internet + + -1/-1 + + ingress + 1 + ALL + + Accept + 2017-07-08T06:20:39Z + + + + + + + diff --git a/libcloud/test/compute/fixtures/ecs/describe_security_groups.xml b/libcloud/test/compute/fixtures/ecs/describe_security_groups.xml new file mode 100644 index 0000000000..24be5c3a4f --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/describe_security_groups.xml @@ -0,0 +1,18 @@ + + + 1 + 1 + 10 + cn-qingdao + 7F154B0C-2594-416D-B546-75021185A6DA + + + 2015-06-26T08:35:30Z + + sg-28ou0f3xa + sg-28ou0f3xa + System created security group. + + + + diff --git a/libcloud/test/compute/fixtures/ecs/describe_snapshots.xml b/libcloud/test/compute/fixtures/ecs/describe_snapshots.xml new file mode 100644 index 0000000000..d30afb4638 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/describe_snapshots.xml @@ -0,0 +1,25 @@ + + + 1 + 1 + 10 + 09CAE6FF-B864-4104-BBF4-FE1EF08066A6 + + + 2016-01-05T11:12:42Z + + progressing + + + + + sys-snapshot-20160108 + system + d-28x069z28 + s-28n9lltbf + 20 + 0% + none + + + diff --git a/libcloud/test/compute/fixtures/ecs/describe_zones.xml b/libcloud/test/compute/fixtures/ecs/describe_zones.xml new file mode 100644 index 0000000000..29be7f09b4 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/describe_zones.xml @@ -0,0 +1,42 @@ + + + CE75D5FB-C343-47DB-882D-E0709D95D61E + + + + IoOptimized + Instance + Disk + + + ecs.m2.medium + ecs.m1.medium + ecs.s2.xlarge + ecs.t1.xsmall + ecs.s2.large + ecs.s2.2xlarge + ecs.s3.medium + ecs.m1.xlarge + ecs.s1.small + ecs.s1.large + ecs.c2.xlarge + ecs.c2.large + ecs.s3.large + ecs.c1.small + ecs.m2.xlarge + ecs.c2.medium + ecs.t1.small + ecs.c1.large + ecs.s2.small + ecs.s1.medium + + cn-qingdao-b + 青岛可用区B + + cloud_ssd + ephemeral + cloud + + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ecs/destroy_node_describe_instances.xml b/libcloud/test/compute/fixtures/ecs/destroy_node_describe_instances.xml new file mode 100644 index 0000000000..329bb79287 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/destroy_node_describe_instances.xml @@ -0,0 +1,56 @@ + + + 1 + 1 + 10 + CA75EE06-D5F7-433C-870B-5042EED6C1DC + + + ubuntu1404_64_20G_aliaegis_20150325.vhd + + 10.163.197.74 + + ecs.t1 + + i-28n7dkvov + + + + + + -1 + cn-qingdao-b + PayByTraffic + ca0122d9-374d-4fce-9fc0-71f7c3eaf1c3 + false + 1024 + 1 + + + + + + + 1 + true + + sg-28ou0f3xa + + iZ28n7dkvovZ + + classic + + 114.215.124.73 + + iZ28n7dkvovZ + ecs.t1.small + 2015-12-27T07:35Z + Stopped + + cn-qingdao + + PostPaid + 2999-09-08T16:00Z + + + diff --git a/libcloud/test/compute/fixtures/ecs/destroy_volume_describe_disks.xml b/libcloud/test/compute/fixtures/ecs/destroy_volume_describe_disks.xml new file mode 100644 index 0000000000..5b045e6fca --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/destroy_volume_describe_disks.xml @@ -0,0 +1,36 @@ + + + + + PostPaid + true + true + true + cloud + Description + ubuntu1404sys + 5 + system + i-28whl2nj2 + 2014-07-23T02:44:06Z + ubuntu1404_64_20G_aliaegis_20150325.vhd + cn-qingdao-b + 2016-01-04T15:02:17Z + + /dev/xvda + + false + + cn-qingdao + d-28zfrmo13 + + Available + + 2999-09-08T16:00Z + + + 1 + 10 + 1 + ED5CF6DD-71CA-462C-9C94-A61A78A01479 + diff --git a/libcloud/test/compute/fixtures/ecs/detach_disk.xml b/libcloud/test/compute/fixtures/ecs/detach_disk.xml new file mode 100644 index 0000000000..cc2d357a72 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/detach_disk.xml @@ -0,0 +1,4 @@ + + + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/detach_volume_describe_disks.xml b/libcloud/test/compute/fixtures/ecs/detach_volume_describe_disks.xml new file mode 100644 index 0000000000..d25c9a1a99 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/detach_volume_describe_disks.xml @@ -0,0 +1,36 @@ + + + + + PostPaid + true + true + true + cloud + Description + ubuntu1404sys + 5 + system + i-28whl2nj2 + 2014-07-23T02:44:06Z + ubuntu1404_64_20G_aliaegis_20150325.vhd + cn-qingdao-b + 2016-01-04T15:02:17Z + + /dev/xvda + + false + + cn-qingdao + d-28zfrmo13 + + In_use + + 2999-09-08T16:00Z + + + 1 + 10 + 1 + ED5CF6DD-71CA-462C-9C94-A61A78A01479 + diff --git a/libcloud/test/compute/fixtures/ecs/get_image_describe_images.xml b/libcloud/test/compute/fixtures/ecs/get_image_describe_images.xml new file mode 100644 index 0000000000..e1b0d6519a --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/get_image_describe_images.xml @@ -0,0 +1,10 @@ + + + 0 + 0 + 10 + cn-qingdao + FAD4D9B9-D75F-4A9E-BC13-991C0F06F50F + + + diff --git a/libcloud/test/compute/fixtures/ecs/join_security_group_by_id.xml b/libcloud/test/compute/fixtures/ecs/join_security_group_by_id.xml new file mode 100644 index 0000000000..ad8f493617 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/join_security_group_by_id.xml @@ -0,0 +1,4 @@ + + + 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E + diff --git a/libcloud/test/compute/fixtures/ecs/leave_security_group_by_id.xml b/libcloud/test/compute/fixtures/ecs/leave_security_group_by_id.xml new file mode 100644 index 0000000000..c6c00f958e --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/leave_security_group_by_id.xml @@ -0,0 +1,4 @@ + + + 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E + diff --git a/libcloud/test/compute/fixtures/ecs/modify_security_group_by_id.xml b/libcloud/test/compute/fixtures/ecs/modify_security_group_by_id.xml new file mode 100644 index 0000000000..12fe1ce261 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/modify_security_group_by_id.xml @@ -0,0 +1,4 @@ + + + CEF72CEB-54B6-4AE8-B225-F876FF7BA984 + diff --git a/libcloud/test/compute/fixtures/ecs/pages_describe_images.xml b/libcloud/test/compute/fixtures/ecs/pages_describe_images.xml new file mode 100644 index 0000000000..0190f87772 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/pages_describe_images.xml @@ -0,0 +1,41 @@ + + + 1 + 2 + 1 + cn-qingdao + FAD4D9B9-D75F-4A9E-BC13-991C0F06F50F + + + freebsd1001_64_20G_aliaegis_20150527.vhd + freebsd1001_64_20G_aliaegis_20150527.vhd + + linux + x86_64 + FreeBSD 10.1 64位 + + + + + /dev/xvda + + + 20 + + + system + 100% + instance + 2015-06-19T07:25:42Z + + 1.0.0 + Available + freebsd1001_64_20G_aliaegis_20150527.vhd + + false + false + Freebsd + 20 + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ecs/pages_describe_images_page2.xml b/libcloud/test/compute/fixtures/ecs/pages_describe_images_page2.xml new file mode 100644 index 0000000000..615e152bdf --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/pages_describe_images_page2.xml @@ -0,0 +1,41 @@ + + + 2 + 2 + 1 + cn-qingdao + FAD4D9B9-D75F-4A9E-BC13-991C0F06F50F + + + freebsd1001_64_20G_aliaegis_20150527.vhd + freebsd1001_64_20G_aliaegis_20150527.vhd + + linux + x86_64 + FreeBSD 10.1 64位 + + + + + /dev/xvda + + + 20 + + + system + 100% + instance + 2015-06-19T07:25:42Z + + 1.0.0 + Available + freebsd1001_64_20G_aliaegis_20150527.vhd + + false + false + Freebsd + 20 + + + diff --git a/libcloud/test/compute/fixtures/ecs/reboot_instance.xml b/libcloud/test/compute/fixtures/ecs/reboot_instance.xml new file mode 100644 index 0000000000..5fc39aaba4 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/reboot_instance.xml @@ -0,0 +1,4 @@ + + + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/reboot_node_describe_instances.xml b/libcloud/test/compute/fixtures/ecs/reboot_node_describe_instances.xml new file mode 100644 index 0000000000..24eae7ed1f --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/reboot_node_describe_instances.xml @@ -0,0 +1,56 @@ + + + 1 + 1 + 10 + CA75EE06-D5F7-433C-870B-5042EED6C1DC + + + ubuntu1404_64_20G_aliaegis_20150325.vhd + + 10.163.197.74 + + ecs.t1 + + i-28n7dkvov + + + + + + -1 + cn-qingdao-b + PayByTraffic + ca0122d9-374d-4fce-9fc0-71f7c3eaf1c3 + false + 1024 + 1 + + + + + + + 1 + true + + sg-28ou0f3xa + + iZ28n7dkvovZ + + classic + + 114.215.124.73 + + iZ28n7dkvovZ + ecs.t1.small + 2015-12-27T07:35Z + Running + + cn-qingdao + + PostPaid + 2999-09-08T16:00Z + + + diff --git a/libcloud/test/compute/fixtures/ecs/start_instance.xml b/libcloud/test/compute/fixtures/ecs/start_instance.xml new file mode 100644 index 0000000000..f7e87e0e6c --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/start_instance.xml @@ -0,0 +1,4 @@ + + + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/stop_instance.xml b/libcloud/test/compute/fixtures/ecs/stop_instance.xml new file mode 100644 index 0000000000..156b113113 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/stop_instance.xml @@ -0,0 +1,4 @@ + + + DA38B11A-9D6D-420B-942F-95D68606C4FC + diff --git a/libcloud/test/compute/fixtures/ecs/stop_node_describe_instances.xml b/libcloud/test/compute/fixtures/ecs/stop_node_describe_instances.xml new file mode 100644 index 0000000000..329bb79287 --- /dev/null +++ b/libcloud/test/compute/fixtures/ecs/stop_node_describe_instances.xml @@ -0,0 +1,56 @@ + + + 1 + 1 + 10 + CA75EE06-D5F7-433C-870B-5042EED6C1DC + + + ubuntu1404_64_20G_aliaegis_20150325.vhd + + 10.163.197.74 + + ecs.t1 + + i-28n7dkvov + + + + + + -1 + cn-qingdao-b + PayByTraffic + ca0122d9-374d-4fce-9fc0-71f7c3eaf1c3 + false + 1024 + 1 + + + + + + + 1 + true + + sg-28ou0f3xa + + iZ28n7dkvovZ + + classic + + 114.215.124.73 + + iZ28n7dkvovZ + ecs.t1.small + 2015-12-27T07:35Z + Stopped + + cn-qingdao + + PostPaid + 2999-09-08T16:00Z + + + diff --git a/libcloud/test/compute/fixtures/equinixmetal/associate_ip.json b/libcloud/test/compute/fixtures/equinixmetal/associate_ip.json new file mode 100644 index 0000000000..02139bfd22 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/associate_ip.json @@ -0,0 +1,36 @@ +{ + "id": "aea4ee0c-675f-4b77-8337-8e13b868dd9c", + "address_family": 4, + "netmask": "255.255.255.255", + "created_at": "2019-04-09T15:58:58Z", + "details": null, + "public": true, + "cidr": 32, + "management": false, + "manageable": true, + "enabled": true, + "global_ip": true, + "customdata": {}, + "project": {}, + "project_lite": {}, + "facility": { + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL", + "code": "ams1", + "features": ["baremetal", "storage", "global_ipv4", "backend_transfer", "layer_2"], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "ip_ranges": ["2604:1380:2000::/36", "147.75.204.0/23", "147.75.100.0/22", "147.75.80.0/22", "147.75.32.0/23"] + }, + "assigned_to": { + "href": "/devices/756db520-fa13-4a8c-858c-b3ceb60ce95f" + }, + "interface": { + "href": "/ports/15506112-efa2-4467-9e03-4d038a1db2e2" + }, + "network": "147.75.40.2", + "address": "147.75.40.2", + "gateway": "147.75.40.2", + "href": "/ips/aea4ee0c-675f-4b77-8337-8e13b868dd9c" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/attach_volume.json b/libcloud/test/compute/fixtures/equinixmetal/attach_volume.json new file mode 100644 index 0000000000..fac184f131 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/attach_volume.json @@ -0,0 +1,11 @@ +{ + "id": "f2909129-6445-4f7f-8fdf-65c9a1c342e9", + "created_at": "2019-04-20T16:53:59Z", + "volume": { + "href": "/storage/a08aaf76-e0ce-43aa-b9cd-cce0d4ae4f4c" + }, + "device": { + "href": "/devices/756db520-fa13-4a8c-858c-b3ceb60ce95f" + }, + "href": "/storage/attachments/f2909129-6445-4f7f-8fdf-65c9a1c342e9" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/bgp_config_project_1.json b/libcloud/test/compute/fixtures/equinixmetal/bgp_config_project_1.json new file mode 100644 index 0000000000..8e63c804ff --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/bgp_config_project_1.json @@ -0,0 +1,17 @@ +{ + "id": "02dde1ca-a360-4bc5-9c08-897bbd22536a", + "status": "enabled", + "deployment_type": "local", + "asn": 65000, + "md5": null, + "route_object": null, + "max_prefix": 10, + "created_at": "2019-03-08T12:03:01Z", + "requested_at": "2019-03-08T12:03:01Z", + "project": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "sessions": [], + "ranges": [], + "href": "/bgp-configs/02dde1ca-a360-4bc5-9c08-897bbd22536a" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/bgp_config_project_2.json b/libcloud/test/compute/fixtures/equinixmetal/bgp_config_project_2.json new file mode 100644 index 0000000000..0a1a6397d5 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/bgp_config_project_2.json @@ -0,0 +1,17 @@ +{ + "id": "6e3a1b3b-f8de-4d3c-9b4c-be097af6e199", + "status": "requested", + "deployment_type": "global", + "asn": 65000, + "md5": null, + "route_object": null, + "max_prefix": 10, + "created_at": "2019-03-08T12:03:47Z", + "requested_at": "2019-03-08T12:03:47Z", + "project": { + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df" + }, + "sessions": [], + "ranges": [], + "href": "/bgp-configs/6e3a1b3b-f8de-4d3c-9b4c-be097af6e199" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/bgp_config_project_3.json b/libcloud/test/compute/fixtures/equinixmetal/bgp_config_project_3.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/bgp_config_project_3.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/bgp_session_create.json b/libcloud/test/compute/fixtures/equinixmetal/bgp_session_create.json new file mode 100644 index 0000000000..e975aff51c --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/bgp_session_create.json @@ -0,0 +1,14 @@ +{ + "id": "08f6b756-758b-4f1f-bfaf-b9b5479822d7", + "status": "unknown", + "learned_routes": [], + "switch_name": "esr1.r04b01.ams1.packet.net", + "default_route": null, + "created_at": "2019-03-21T17:24:59Z", + "updated_at": "2019-03-21T17:24:59Z", + "device": { + "href": "/devices/905037a4-967c-4e81-b364-3a0603aa071b" + }, + "address_family": "ipv4", + "href": "/bgp/sessions/08f6b756-758b-4f1f-bfaf-b9b5479822d7" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/bgp_session_get.json b/libcloud/test/compute/fixtures/equinixmetal/bgp_session_get.json new file mode 100644 index 0000000000..396ca113f3 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/bgp_session_get.json @@ -0,0 +1,14 @@ +{ + "id": "08f6b756-758b-4f1f-bfaf-b9b5479822d7", + "status": "down", + "learned_routes": [], + "switch_name": "esr1.r04b01.ams1.packet.net", + "default_route": null, + "created_at": "2019-03-21T17:24:59Z", + "updated_at": "2019-03-21T17:25:10Z", + "device": { + "href": "/devices/905037a4-967c-4e81-b364-3a0603aa071b" + }, + "address_family": "ipv4", + "href": "/bgp/sessions/08f6b756-758b-4f1f-bfaf-b9b5479822d7" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/bgp_sessions.json b/libcloud/test/compute/fixtures/equinixmetal/bgp_sessions.json new file mode 100644 index 0000000000..316b676f64 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/bgp_sessions.json @@ -0,0 +1,16 @@ +{ + "bgp_sessions": [{ + "id": "08f6b756-758b-4f1f-bfaf-b9b5479822d7", + "status": "down", + "learned_routes": [], + "switch_name": "esr1.r04b01.ams1.packet.net", + "default_route": null, + "created_at": "2019-03-21T17:24:59Z", + "updated_at": "2019-03-21T17:25:10Z", + "device": { + "href": "/devices/905037a4-967c-4e81-b364-3a0603aa071b" + }, + "address_family": "ipv4", + "href": "/bgp/sessions/08f6b756-758b-4f1f-bfaf-b9b5479822d7" + }] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/create_volume.json b/libcloud/test/compute/fixtures/equinixmetal/create_volume.json new file mode 100644 index 0000000000..45033b97ad --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/create_volume.json @@ -0,0 +1,38 @@ +{ + "id": "a08aaf76-e0ce-43aa-b9cd-cce0d4ae4f4c", + "name": "volume-a08aaf76", + "description": "test volume", + "size": 10, + "locked": false, + "billing_cycle": "hourly", + "state": "queued", + "customdata": {}, + "access": {}, + "created_at": "2019-04-20T16:16:44Z", + "updated_at": "2019-04-20T16:16:44Z", + "project": { + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df" + }, + "facility": { + "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975" + }, + "snapshot_policies": [], + "attachments": [], + "snapshots": [], + "plan": { + "id": "87728148-3155-4992-a730-8d1e6aca8a32", + "slug": "storage_1", + "name": "Standard", + "description": "TBD", + "line": "storage", + "specs": {}, + "legacy": true, + "deployment_types": [], + "available_in": [], + "class": "storage_1", + "pricing": { + "hour": 0.000104 + } + }, + "href": "/storage/a08aaf76-e0ce-43aa-b9cd-cce0d4ae4f4c" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/device_create.json b/libcloud/test/compute/fixtures/equinixmetal/device_create.json new file mode 100644 index 0000000000..2f5b12ca27 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/device_create.json @@ -0,0 +1,74 @@ +{ + "userdata": null, + "operating_system": + { + "distro": "coreos", + "slug": "coreos_stable", + "version": "stable", + "name": "CoreOS (stable)" + }, + "locked": false, + "tags": [], + "href": "/devices/9f7eafab-CCCC-DDDD-EEEE-c2a686367791", + "created_at": "2015-05-22T17:59:43Z", + "hostname": "9f7eafab.packethost.net", + "updated_at": "2015-05-22T17:59:43.972Z", + "project": { "href": "/projects/746ea6dd-CCCC-DDDD-EEEE-728784671fbf" }, + "provisioning_percentage": 0.0, + "state": "queued", + "billing_cycle": "hourly", + "user": "core", + "ip_addresses": [], + "facility": { "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09" }, + "id": "9f7eafab-6f6b-4ae4-988d-c2a686367791", + "provisioning_events": [ + { + "body": "Provisioning started", + "relationships": [], + "interpolated": "Provisioning started", + "created_at": null, + "type": "provisioning.101", + "id": null + }, + { + "body": "Network configured", + "relationships": [], + "interpolated": "Network configured", + "created_at": null, + "type": "provisioning.102", + "id": null + }, + { + "body": "Configuration written, restarting device", + "relationships": [], + "interpolated": "Configuration written, restarting device", + "created_at": null, + "type": "provisioning.103", + "id": null + }, + { + "body": "Device phoned home and is ready to go", + "relationships": [], + "interpolated": "Device phoned home and is ready to go", + "created_at": null, + "type": "provisioning.110", + "id": null + }], + "plan": + { + "slug": "baremetal_1", + "description": "Our Type 1 configuration is a zippy general use server", + "id": "6d1f1ffa-7912-4b78-b50d-88cc7c8ab40f", + "pricing": { "hourly": 0.4 }, + "line": "baremetal", + "specs": + { + "nics": [{"count": 2, "type": "gigabit"}], + "drives": [{"count": 2, "type": "SSD", "size": "120GB"}], + "features": {"txt": true, "raid": true}, + "cpus": [{"count": 1, "type": "Intel E3-1240 v3"}], + "memory": {"total": "16GB"} + }, + "name": "Type 1" + } +} diff --git a/libcloud/test/compute/fixtures/equinixmetal/device_events.json b/libcloud/test/compute/fixtures/equinixmetal/device_events.json new file mode 100644 index 0000000000..2e56be08b8 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/device_events.json @@ -0,0 +1,202 @@ +{ + "events": [ + { + "id": "31256dd5-9e4c-4dbb-9989-bbc13da01958", + "type": "power.200", + "body": "Reboot operation queued", + "state": null, + "created_at": "2019-03-21T15:34:25Z", + "relationships": [ + { + "href": "#e1fb1cd1-c507-4119-bff6-789ee11d8418" + } + ], + "ip": "157.52.105.28", + "modified_by": { + "id": "bd4f24f3-33f0-46a6-9528-4e31e2ba6074", + "full_name": "Dimitris Moraitis", + "avatar_url": "https://www.gravatar.com/avatar/702119decab6288093449009ab5af843?d=mm", + "avatar_thumb_url": "https://www.gravatar.com/avatar/702119decab6288093449009ab5af843?d=mm" + }, + "interpolated": "Reboot operation queued", + "href": "/events/31256dd5-9e4c-4dbb-9989-bbc13da01958" + }, + { + "id": "c1b136d1-6d55-45c8-b2b3-fb993e6fb55e", + "type": "power.203", + "body": "Device rebooted", + "state": null, + "created_at": "2019-03-21T15:34:25Z", + "relationships": [ + { + "href": "#65ffb1c3-7123-4ac3-9768-3bd1789f6380" + } + ], + "ip": null, + "modified_by": null, + "interpolated": "Device rebooted", + "href": "/events/c1b136d1-6d55-45c8-b2b3-fb993e6fb55e" + }, + { + "id": "580a5b8b-ac04-45b7-a16d-a8bcf199c6fa", + "type": "power.204", + "body": "Device powered on", + "state": null, + "created_at": "2019-03-05T18:21:50Z", + "relationships": [ + { + "href": "#c38eccc8-2b1b-4eee-8a56-c2059530d35b" + } + ], + "ip": null, + "modified_by": null, + "interpolated": "Device powered on", + "href": "/events/580a5b8b-ac04-45b7-a16d-a8bcf199c6fa" + }, + { + "id": "e4944204-9f09-49ce-aff3-4b2e64b5c9d2", + "type": "power.201", + "body": "Power operation started", + "state": null, + "created_at": "2019-03-05T18:21:39Z", + "relationships": [ + { + "href": "#a042e3ba-b1cb-436a-b98d-d59d8d6fedde" + } + ], + "ip": null, + "modified_by": null, + "interpolated": "Power operation started", + "href": "/events/e4944204-9f09-49ce-aff3-4b2e64b5c9d2" + }, + { + "id": "a072109c-5957-4b7e-9c98-0a6a90310cfd", + "type": "power.200", + "body": "Power on operation queued", + "state": null, + "created_at": "2019-03-05T18:21:39Z", + "relationships": [ + { + "href": "#a0a02f25-461c-41d9-812f-4c17a08ece86" + } + ], + "ip": "104.156.95.42", + "modified_by": { + "id": "446476b8-a835-414a-8e9c-84925cc72705", + "full_name": "Markos Gogoulos", + "avatar_url": "https://www.gravatar.com/avatar/fafa2cd3f9d378981e87a993661859b4?d=mm", + "avatar_thumb_url": "https://www.gravatar.com/avatar/fafa2cd3f9d378981e87a993661859b4?d=mm" + }, + "interpolated": "Power on operation queued", + "href": "/events/a072109c-5957-4b7e-9c98-0a6a90310cfd" + }, + { + "id": "eb1a5f74-a48b-4632-a5b6-e20b1a3589ee", + "type": "power.202", + "body": "Device powered off", + "state": null, + "created_at": "2019-03-05T18:19:42Z", + "relationships": [ + { + "href": "#e1ad01ed-deda-42f0-9c01-6262d54f66b4" + } + ], + "ip": null, + "modified_by": null, + "interpolated": "Device powered off", + "href": "/events/eb1a5f74-a48b-4632-a5b6-e20b1a3589ee" + }, + { + "id": "71b9e370-4e15-4307-8c10-27d3585088eb", + "type": "power.200", + "body": "Power off operation queued", + "state": null, + "created_at": "2019-03-05T18:19:02Z", + "relationships": [ + { + "href": "#090422c3-cc6e-4a83-947a-591016a21b2e" + } + ], + "ip": "104.156.95.48", + "modified_by": { + "id": "446476b8-a835-414a-8e9c-84925cc72705", + "full_name": "Markos Gogoulos", + "avatar_url": "https://www.gravatar.com/avatar/fafa2cd3f9d378981e87a993661859b4?d=mm", + "avatar_thumb_url": "https://www.gravatar.com/avatar/fafa2cd3f9d378981e87a993661859b4?d=mm" + }, + "interpolated": "Power off operation queued", + "href": "/events/71b9e370-4e15-4307-8c10-27d3585088eb" + }, + { + "id": "8d871c11-c59b-41bc-849c-8853b9f29252", + "type": "power.201", + "body": "Power operation started", + "state": null, + "created_at": "2019-03-05T18:19:02Z", + "relationships": [ + { + "href": "#68469965-4801-4dde-831e-ca2cc27dda59" + } + ], + "ip": null, + "modified_by": null, + "interpolated": "Power operation started", + "href": "/events/8d871c11-c59b-41bc-849c-8853b9f29252" + }, + { + "id": "13c330d5-5cc6-4a2d-8ada-b2c239171f50", + "type": "power.200", + "body": "Reboot operation queued", + "state": null, + "created_at": "2019-02-28T20:10:12Z", + "relationships": [ + { + "href": "#7b95e08b-84d9-4e83-869e-ea98e7c052fd" + } + ], + "ip": "104.156.95.25", + "modified_by": { + "id": "446476b8-a835-414a-8e9c-84925cc72705", + "full_name": "Markos Gogoulos", + "avatar_url": "https://www.gravatar.com/avatar/fafa2cd3f9d378981e87a993661859b4?d=mm", + "avatar_thumb_url": "https://www.gravatar.com/avatar/fafa2cd3f9d378981e87a993661859b4?d=mm" + }, + "interpolated": "Reboot operation queued", + "href": "/events/13c330d5-5cc6-4a2d-8ada-b2c239171f50" + }, + { + "id": "68eab1cc-a9a0-4f23-8274-1d71043ed3e1", + "type": "power.203", + "body": "Device rebooted", + "state": null, + "created_at": "2019-02-28T20:10:12Z", + "relationships": [ + { + "href": "#6b5506b9-d4c9-4467-9ec8-5e887f2f8ae8" + } + ], + "ip": null, + "modified_by": null, + "interpolated": "Device rebooted", + "href": "/events/68eab1cc-a9a0-4f23-8274-1d71043ed3e1" + } + ], + "meta": { + "first": { + "href": "/devices/905037a4-967c-4e81-b364-3a0603aa071b/events?page=1" + }, + "previous": null, + "self": { + "href": "/devices/905037a4-967c-4e81-b364-3a0603aa071b/events?page=1" + }, + "next": { + "href": "/devices/905037a4-967c-4e81-b364-3a0603aa071b/events?page=2" + }, + "last": { + "href": "/devices/905037a4-967c-4e81-b364-3a0603aa071b/events?page=5" + }, + "current_page": 1, + "last_page": 5, + "total": 49 + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/devices.json b/libcloud/test/compute/fixtures/equinixmetal/devices.json new file mode 100644 index 0000000000..c35fd5e36a --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/devices.json @@ -0,0 +1,57 @@ +{ + "devices": [ + { + "id": "1e52437e-bbbb-cccc-dddd-74a9dfd3d3bb", + "hostname": "test-node", + "state": "active", + "tags": [], + "billing_cycle": "hourly", + "user": "root", + "userdata": "", + "locked": false, + "created_at": "2015-05-03T15:50:49Z", + "updated_at": "2015-05-03T16:00:08Z", + "operating_system": + { + "slug": "ubuntu_14_04", + "name": "Ubuntu 14.04 LTS", + "distro": "ubuntu", + "version": "14.04" + }, + "project": { "href": "/projects/project-id" }, + "facility": { "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09" }, + "plan": + { + "id": "6d1f1ffa-7912-4b78-b50d-88cc7c8ab40f", + "slug": "baremetal_1", + "name": "Type 1", + "description": "Our Type 1 configuration is a zippy general use server", + "line": "baremetal", + "specs": + { + "cpus": [{"count":1,"type":"Intel E3-1240 v3"}], + "memory": {"total":"16GB" }, + "drives": [{"count":2,"size":"120GB","type":"SSD"}], + "nics": [{"count":2,"type":"gigabit"}], + "features": {"raid":true, "txt":true} + }, + "pricing": { "hour":0.4 } + }, + "ip_addresses": [ + { "address_family": 4,"netmask":"255.255.255.255","cidr":32,"address":"147.75.255.255","gateway":"147.75.255.255","public":true }, + { "address_family": 6,"netmask":"ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe","cidr":32,"address":"2604:EEEE::EE","gateway":"2604:1380::EE","public":true }, + { "address_family": 4,"netmask":"255.255.255.255","cidr":32,"address":"10.0.0.255","gateway":"10.0.0.255","public":false } + ], + "href": "/devices/1e52437e-bbbb-cccc-dddd-74a9dfd3d3bb" + } + ], + "meta": + { + "first": { "href":"/projects/project-id/devices?page=1" }, + "previous":null, + "self": { "href":"/projects/project-id/devices?page=1" }, + "next": null, + "last": { "href":"/projects/project-id/devices?page=1" }, + "total": 1 + } +} diff --git a/libcloud/test/compute/fixtures/equinixmetal/devices_for_project.json b/libcloud/test/compute/fixtures/equinixmetal/devices_for_project.json new file mode 100644 index 0000000000..e10ace1673 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/devices_for_project.json @@ -0,0 +1,440 @@ +{ + "devices": [ + { + "id": "905037a4-967c-4e81-b364-3a0603aa071b", + "short_id": "905037a4", + "hostname": "mistopenstack", + "description": null, + "state": "active", + "tags": [], + "image_url": null, + "billing_cycle": "hourly", + "user": "root", + "iqn": "iqn.2018-04.net.packet:device.905037a4", + "locked": false, + "bonding_mode": 4, + "created_at": "2018-04-02T18:02:39Z", + "updated_at": "2019-03-21T15:35:18Z", + "ipxe_script_url": null, + "always_pxe": false, + "storage": {}, + "customdata": {}, + "operating_system": { + "id": "68bad60d-f5a7-45c2-ad09-573edaad3a3c", + "slug": "centos_7", + "name": "CentOS 7", + "distro": "centos", + "version": "7", + "provisionable_on": [ + "c1.large.arm", + "baremetal_2a", + "c1.small.x86", + "baremetal_1", + "c1.xlarge.x86", + "baremetal_3", + "c2.medium.x86", + "d1f.optane.x86", + "d1p.optane.x86", + "g2.large.x86", + "m1.xlarge.x86", + "baremetal_2", + "m2.xlarge.x86", + "s1.large.x86", + "baremetal_s", + "t1.small.x86", + "baremetal_0", + "x1.small.x86", + "baremetal_1e" + ], + "preinstallable": true, + "pricing": {}, + "licensed": false + }, + "facility": { + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL", + "code": "ams1", + "features": [ + "baremetal", + "storage", + "global_ipv4", + "backend_transfer", + "layer_2" + ], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "ip_ranges": [ + "2604:1380:2000::/36", + "147.75.204.0/23", + "147.75.100.0/22", + "147.75.80.0/22", + "147.75.32.0/23" + ] + }, + "project": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "ssh_keys": [ + { + "href": "/ssh-keys/54b6c270-b37f-4740-a06f-8287d7c7375a" + }, + { + "href": "/ssh-keys/6a641836-f622-40a3-9156-a88112ee2e03" + }, + { + "href": "/ssh-keys/7b982d07-0ea3-415e-a35c-3dfb6b358267" + }, + { + "href": "/ssh-keys/23640808-0983-4b5c-b251-2f7715f5450a" + }, + { + "href": "/ssh-keys/410f8090-8d2d-4bce-8855-43142503f3a4" + }, + { + "href": "/ssh-keys/d8c9bfc1-0201-4e18-b70d-67333847f804" + }, + { + "href": "/ssh-keys/2b361661-efaa-429e-8d22-30e64853efe4" + }, + { + "href": "/ssh-keys/94a4d3d4-672a-4670-948b-feda8127758c" + }, + { + "href": "/ssh-keys/632d69f1-52f4-435b-9424-3b1e8c725812" + }, + { + "href": "/ssh-keys/733852c6-8cd0-41c3-bf2e-6aac7c7a7a35" + }, + { + "href": "/ssh-keys/bfc69d73-c8c7-4027-8aed-7c6bd88eb278" + }, + { + "href": "/ssh-keys/2b38c95c-02dc-4ce8-961c-9d2ce8763647" + }, + { + "href": "/ssh-keys/97898a92-7df8-4e1f-8f87-9631f7de4a81" + }, + { + "href": "/ssh-keys/22f9fd4c-ab3d-47f5-92ac-7d5703084d3d" + }, + { + "href": "/ssh-keys/4dcb7264-25d2-42db-b25f-d5ebaa8b6410" + }, + { + "href": "/ssh-keys/944bb692-3aa8-449e-9d29-3b4e1028b148" + }, + { + "href": "/ssh-keys/cf8abbdd-a484-43c3-ba62-627a16594594" + }, + { + "href": "/ssh-keys/2af51313-c514-4145-907f-f7445ca2e5ad" + }, + { + "href": "/ssh-keys/e0af33d3-0e2c-456a-a4d6-206558de66d6" + }, + { + "href": "/ssh-keys/502178f5-b985-466b-980e-f01ba028e5fc" + }, + { + "href": "/ssh-keys/a46796e6-ee03-4aa5-bf71-f54344a1d1f9" + }, + { + "href": "/ssh-keys/9af94154-e38f-4a77-8cd2-8e6455fc8129" + }, + { + "href": "/ssh-keys/56b9d292-8ed8-43c5-8687-a436979d1ac0" + }, + { + "href": "/ssh-keys/1fd6e5a9-966d-4937-89b2-e269ff1d447a" + } + ], + "project_lite": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "volumes": [], + "ip_addresses": [ + { + "id": "f73172c4-4955-4376-8089-aad2daaf16eb", + "address_family": 4, + "netmask": "255.255.255.254", + "created_at": "2018-04-02T18:02:40Z", + "details": null, + "public": true, + "cidr": 31, + "management": true, + "manageable": true, + "enabled": true, + "global_ip": null, + "customdata": {}, + "project": {}, + "project_lite": {}, + "facility": { + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL", + "code": "ams1", + "features": [ + "baremetal", + "storage", + "global_ipv4", + "backend_transfer", + "layer_2" + ], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "ip_ranges": [ + "2604:1380:2000::/36", + "147.75.204.0/23", + "147.75.100.0/22", + "147.75.80.0/22", + "147.75.32.0/23" + ] + }, + "assigned_to": { + "href": "/devices/905037a4-967c-4e81-b364-3a0603aa071b" + }, + "interface": { + "href": "/ports/115bb6c2-325d-4a70-ad07-c81f4d094000" + }, + "network": "147.75.102.192", + "address": "147.75.102.193", + "gateway": "147.75.102.192", + "href": "/ips/f73172c4-4955-4376-8089-aad2daaf16eb" + }, + { + "id": "366abb1f-3f79-42d7-8b0b-fab4950eca57", + "address_family": 6, + "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe", + "created_at": "2018-04-02T18:02:40Z", + "details": null, + "public": true, + "cidr": 127, + "management": true, + "manageable": true, + "enabled": true, + "global_ip": null, + "customdata": {}, + "project": {}, + "project_lite": {}, + "facility": { + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL", + "code": "ams1", + "features": [ + "baremetal", + "storage", + "global_ipv4", + "backend_transfer", + "layer_2" + ], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "ip_ranges": [ + "2604:1380:2000::/36", + "147.75.204.0/23", + "147.75.100.0/22", + "147.75.80.0/22", + "147.75.32.0/23" + ] + }, + "assigned_to": { + "href": "/devices/905037a4-967c-4e81-b364-3a0603aa071b" + }, + "interface": { + "href": "/ports/115bb6c2-325d-4a70-ad07-c81f4d094000" + }, + "network": "2604:1380:2000:c100::2", + "address": "2604:1380:2000:c100::3", + "gateway": "2604:1380:2000:c100::2", + "href": "/ips/366abb1f-3f79-42d7-8b0b-fab4950eca57" + }, + { + "id": "9addbf38-5c0c-47d6-b485-f8364b5b37c0", + "address_family": 4, + "netmask": "255.255.255.254", + "created_at": "2018-04-02T18:02:40Z", + "details": null, + "public": false, + "cidr": 31, + "management": true, + "manageable": true, + "enabled": true, + "global_ip": null, + "customdata": {}, + "project": {}, + "project_lite": {}, + "facility": { + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL", + "code": "ams1", + "features": [ + "baremetal", + "storage", + "global_ipv4", + "backend_transfer", + "layer_2" + ], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "ip_ranges": [ + "2604:1380:2000::/36", + "147.75.204.0/23", + "147.75.100.0/22", + "147.75.80.0/22", + "147.75.32.0/23" + ] + }, + "assigned_to": { + "href": "/devices/905037a4-967c-4e81-b364-3a0603aa071b" + }, + "interface": { + "href": "/ports/115bb6c2-325d-4a70-ad07-c81f4d094000" + }, + "network": "10.80.144.130", + "address": "10.80.144.131", + "gateway": "10.80.144.130", + "href": "/ips/9addbf38-5c0c-47d6-b485-f8364b5b37c0" + } + ], + "plan": { + "id": "6d1f1ffa-7912-4b78-b50d-88cc7c8ab40f", + "slug": "baremetal_1", + "name": "c1.small.x86", + "description": "Our Type 1 configuration is a zippy general use server, with an Intel E3-1240 v3 processor and 32GB of RAM.", + "line": "baremetal", + "specs": { + "cpus": [ + { + "count": 1, + "type": "Intel E3-1240 v3" + } + ], + "memory": { + "total": "32GB" + }, + "drives": [ + { + "count": 2, + "size": "120GB", + "type": "SSD" + } + ], + "nics": [ + { + "count": 2, + "type": "1Gbps" + } + ], + "features": { + "raid": true, + "txt": true + } + }, + "legacy": false, + "deployment_types": [ + "on_demand", + "spot_market" + ], + "available_in": [ + { + "href": "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd" + }, + { + "href": "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed" + }, + { + "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975" + } + ], + "class": "c1.small.x86", + "pricing": { + "hour": 0.4 + } + }, + "userdata": "", + "switch_uuid": "d67ca07f", + "network_ports": [ + { + "id": "115bb6c2-325d-4a70-ad07-c81f4d094000", + "type": "NetworkBondPort", + "name": "bond0", + "data": { + "bonded": true + }, + "network_type": "layer3", + "native_virtual_network": null, + "hardware": { + "href": "/hardware/137a9e9b-3173-4372-b13c-e61b710adfeb" + }, + "virtual_networks": [], + "connected_port": null, + "href": "/ports/115bb6c2-325d-4a70-ad07-c81f4d094000" + }, + { + "id": "458e6773-408e-4697-a289-11c19bd7e4cb", + "type": "NetworkPort", + "name": "eth0", + "data": { + "mac": "0c:c4:7a:b2:11:78", + "bonded": true + }, + "bond": { + "id": "115bb6c2-325d-4a70-ad07-c81f4d094000", + "name": "bond0" + }, + "native_virtual_network": null, + "hardware": { + "href": "/hardware/137a9e9b-3173-4372-b13c-e61b710adfeb" + }, + "virtual_networks": [], + "connected_port": { + "href": "/ports/486ce54d-61ba-491e-b772-8e521060d802" + }, + "href": "/ports/458e6773-408e-4697-a289-11c19bd7e4cb" + }, + { + "id": "ed4090dc-a08c-4f3d-8d4b-03c46cf84ef0", + "type": "NetworkPort", + "name": "eth1", + "data": { + "mac": "0c:c4:7a:b2:11:79", + "bonded": true + }, + "bond": { + "id": "115bb6c2-325d-4a70-ad07-c81f4d094000", + "name": "bond0" + }, + "native_virtual_network": null, + "hardware": { + "href": "/hardware/137a9e9b-3173-4372-b13c-e61b710adfeb" + }, + "virtual_networks": [], + "connected_port": { + "href": "/ports/0b4e5127-7536-41d1-887f-6ec797204ed8" + }, + "href": "/ports/ed4090dc-a08c-4f3d-8d4b-03c46cf84ef0" + } + ], + "href": "/devices/905037a4-967c-4e81-b364-3a0603aa071b" + } + ], + "meta": { + "first": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5/devices?page=1" + }, + "previous": null, + "self": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5/devices?page=1" + }, + "next": null, + "last": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5/devices?page=1" + }, + "current_page": 1, + "last_page": 1, + "total": 1 + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/ip_address.json b/libcloud/test/compute/fixtures/equinixmetal/ip_address.json new file mode 100644 index 0000000000..f35c9cb054 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/ip_address.json @@ -0,0 +1,38 @@ +{ + "facility": { + "code": "ams1", + "features": ["baremetal", "storage", "global_ipv4", "backend_transfer", "layer_2"], + "ip_ranges": ["2604:1380:2000::/36", "147.75.204.0/23", "147.75.100.0/22", "147.75.80.0/22", "147.75.32.0/23"], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL" + }, + "href": "/ips/01c184f5-1413-4b0b-9f6d-ac993f6c9241", + "id": "01c184f5-1413-4b0b-9f6d-ac993f6c9241", + "management": false, + "address_family": 4, + "customdata": {}, + "gateway": "147.75.33.33", + "details": null, + "addon": true, + "public": true, + "available": "/ips/01c184f5-1413-4b0b-9f6d-ac993f6c9241/available", + "project_lite": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "netmask": "255.255.255.240", + "address": "147.75.33.34", + "cidr": 28, + "manageable": true, + "network": "147.75.33.32", + "created_at": "2017-12-29T10:59:59Z", + "bill": true, + "enabled": true, + "project": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "assignments": [], + "global_ip": false +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/ip_assignments.json b/libcloud/test/compute/fixtures/equinixmetal/ip_assignments.json new file mode 100644 index 0000000000..032cc54594 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/ip_assignments.json @@ -0,0 +1,178 @@ +{ + "ip_addresses": [{ + "id": "ccf66471-c139-4204-927c-e005aac20308", + "address_family": 4, + "netmask": "255.255.255.248", + "created_at": "2019-04-06T16:13:48Z", + "details": null, + "public": true, + "cidr": 29, + "management": true, + "manageable": true, + "enabled": true, + "global_ip": null, + "customdata": {}, + "project": {}, + "project_lite": {}, + "facility": { + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL", + "code": "ams1", + "features": ["baremetal", "storage", "global_ipv4", "backend_transfer", "layer_2"], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "ip_ranges": ["2604:1380:2000::/36", "147.75.204.0/23", "147.75.100.0/22", "147.75.80.0/22", "147.75.32.0/23"] + }, + "assigned_to": { + "href": "/devices/756db520-fa13-4a8c-858c-b3ceb60ce95f" + }, + "interface": { + "href": "/ports/15506112-efa2-4467-9e03-4d038a1db2e2" + }, + "network": "147.75.204.216", + "address": "147.75.204.218", + "gateway": "147.75.204.217", + "href": "/ips/ccf66471-c139-4204-927c-e005aac20308" + }, { + "id": "aea4ee0c-675f-4b77-8337-8e13b868dd9c", + "address_family": 4, + "netmask": "255.255.255.255", + "created_at": "2019-04-09T15:58:58Z", + "details": null, + "public": true, + "cidr": 32, + "management": false, + "manageable": true, + "enabled": true, + "global_ip": true, + "customdata": {}, + "project": {}, + "project_lite": {}, + "facility": { + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL", + "code": "ams1", + "features": ["baremetal", "storage", "global_ipv4", "backend_transfer", "layer_2"], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "ip_ranges": ["2604:1380:2000::/36", "147.75.204.0/23", "147.75.100.0/22", "147.75.80.0/22", "147.75.32.0/23"] + }, + "assigned_to": { + "href": "/devices/756db520-fa13-4a8c-858c-b3ceb60ce95f" + }, + "interface": { + "href": "/ports/15506112-efa2-4467-9e03-4d038a1db2e2" + }, + "network": "147.75.40.2", + "address": "147.75.40.2", + "gateway": "147.75.40.2", + "href": "/ips/aea4ee0c-675f-4b77-8337-8e13b868dd9c" + }, { + "id": "60f6b4ba-3468-4aa2-8639-37c208c1b018", + "address_family": 4, + "netmask": "255.255.255.254", + "created_at": "2019-04-08T10:49:22Z", + "details": null, + "public": true, + "cidr": 31, + "management": false, + "manageable": true, + "enabled": true, + "global_ip": false, + "customdata": {}, + "project": {}, + "project_lite": {}, + "facility": { + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL", + "code": "ams1", + "features": ["baremetal", "storage", "global_ipv4", "backend_transfer", "layer_2"], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "ip_ranges": ["2604:1380:2000::/36", "147.75.204.0/23", "147.75.100.0/22", "147.75.80.0/22", "147.75.32.0/23"] + }, + "assigned_to": { + "href": "/devices/756db520-fa13-4a8c-858c-b3ceb60ce95f" + }, + "interface": { + "href": "/ports/15506112-efa2-4467-9e03-4d038a1db2e2" + }, + "network": "147.75.100.12", + "address": "147.75.100.13", + "gateway": "147.75.100.12", + "href": "/ips/60f6b4ba-3468-4aa2-8639-37c208c1b018" + }, { + "id": "56cb4e97-508b-4869-b3e9-0a5b9454e75c", + "address_family": 6, + "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe", + "created_at": "2019-04-06T16:13:48Z", + "details": null, + "public": true, + "cidr": 127, + "management": true, + "manageable": true, + "enabled": true, + "global_ip": null, + "customdata": {}, + "project": {}, + "project_lite": {}, + "facility": { + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL", + "code": "ams1", + "features": ["baremetal", "storage", "global_ipv4", "backend_transfer", "layer_2"], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "ip_ranges": ["2604:1380:2000::/36", "147.75.204.0/23", "147.75.100.0/22", "147.75.80.0/22", "147.75.32.0/23"] + }, + "assigned_to": { + "href": "/devices/756db520-fa13-4a8c-858c-b3ceb60ce95f" + }, + "interface": { + "href": "/ports/15506112-efa2-4467-9e03-4d038a1db2e2" + }, + "network": "2604:1380:2000:5a00::", + "address": "2604:1380:2000:5a00::1", + "gateway": "2604:1380:2000:5a00::", + "href": "/ips/56cb4e97-508b-4869-b3e9-0a5b9454e75c" + }, { + "id": "9e63854a-fa56-4f05-bf4a-28e54ee8d0d3", + "address_family": 4, + "netmask": "255.255.255.248", + "created_at": "2019-04-06T16:13:48Z", + "details": null, + "public": false, + "cidr": 29, + "management": true, + "manageable": true, + "enabled": true, + "global_ip": null, + "customdata": {}, + "project": {}, + "project_lite": {}, + "facility": { + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL", + "code": "ams1", + "features": ["baremetal", "storage", "global_ipv4", "backend_transfer", "layer_2"], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "ip_ranges": ["2604:1380:2000::/36", "147.75.204.0/23", "147.75.100.0/22", "147.75.80.0/22", "147.75.32.0/23"] + }, + "assigned_to": { + "href": "/devices/756db520-fa13-4a8c-858c-b3ceb60ce95f" + }, + "interface": { + "href": "/ports/15506112-efa2-4467-9e03-4d038a1db2e2" + }, + "network": "10.80.58.0", + "address": "10.80.58.2", + "gateway": "10.80.58.1", + "href": "/ips/9e63854a-fa56-4f05-bf4a-28e54ee8d0d3" + }] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/metros.json b/libcloud/test/compute/fixtures/equinixmetal/metros.json new file mode 100644 index 0000000000..a2fa6c804d --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/metros.json @@ -0,0 +1,10 @@ +{ + "metros": [ + { + "id": "d3d6b29f-042d-43b7-b3ce-0bf53d5754ca", + "name": "Dallas", + "code": "da", + "country": "US" + } + ] +} diff --git a/libcloud/test/compute/fixtures/equinixmetal/node_bandwidth.json b/libcloud/test/compute/fixtures/equinixmetal/node_bandwidth.json new file mode 100644 index 0000000000..3d11f06e38 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/node_bandwidth.json @@ -0,0 +1,139 @@ +{ + "bandwidth": [{ + "datapoints": [ + [1052.032698, 1553194500], + [1055.92461, 1553194560], + [1050.016926, 1553194620], + [1245.116514, 1553194680], + [1034.070997, 1553194740], + [1010.820992, 1553194800], + [951.920896, 1553194860], + [1148.937385, 1553194920], + [1065.573677, 1553194980], + [1094.001969, 1553195040], + [1072.862652, 1553195100], + [1034.897575, 1553195160], + [1185.426244, 1553195220], + [1042.176035, 1553195280], + [997.822217, 1553195340], + [1152.909521, 1553195400], + [922.635817, 1553195460], + [1105.585486, 1553195520], + [1047.65336, 1553195580], + [881.732485, 1553195640], + [1110.465301, 1553195700], + [916.823838, 1553195760], + [1096.549182, 1553195820], + [976.962368, 1553195880], + [1025.246754, 1553195940], + [1091.528324, 1553196000], + [996.620406, 1553196060], + [1246.460364, 1553196120], + [1053.393289, 1553196180], + [1142.337976, 1553196240], + [1086.332225, 1553196300], + [1024.480602, 1553196360], + [1234.467001, 1553196420], + [1082.616506, 1553196480], + [1086.723205, 1553196540], + [1112.280105, 1553196600], + [965.456206, 1553196660], + [1250.384913, 1553196720], + [1086.283225, 1553196780], + [951.436363, 1553196840], + [1131.955347, 1553196900], + [1150.404805, 1553196960], + [1286.614545, 1553197020], + [1154.660863, 1553197080], + [1137.028738, 1553197140], + [1117.174178, 1553197200], + [1066.04981, 1553197260], + [1029.530732, 1553197320], + [1041.113197, 1553197380], + [1111.102835, 1553197440], + [1127.673851, 1553197500], + [1215.903109, 1553197560], + [1210.630661, 1553197620], + [1252.226899, 1553197680], + [1170.912932, 1553197740], + [null, 1553197800], + [1170.437927, 1553197860], + [1172.572302, 1553197920], + [1211.585068, 1553197980], + [1233.890989, 1553198040] + ], + "target": "inbound", + "tags": { + "aggregatedBy": "sum", + "name": "sumSeries(port_graphs.ams1.r04b01.esr1.snmp.if_octets.137a9e9b-3173-4372-b13c-e61b710adfeb.*.tx)" + } + }, { + "datapoints": [ + [67156.831912, 1553194500], + [57623.730489, 1553194560], + [67405.892198, 1553194620], + [78231.821897, 1553194680], + [66846.849647, 1553194740], + [67790.149327, 1553194800], + [57886.094865, 1553194860], + [76756.910925, 1553194920], + [67434.035079, 1553194980], + [67356.660892, 1553195040], + [67328.09619, 1553195100], + [58194.381384, 1553195160], + [77639.00637900001, 1553195220], + [67131.05764300001, 1553195280], + [67067.391321, 1553195340], + [67966.786864, 1553195400], + [57542.517921, 1553195460], + [77412.270766, 1553195520], + [67840.39929, 1553195580], + [56609.998671, 1553195640], + [77860.693942, 1553195700], + [57295.253973000006, 1553195760], + [77519.583025, 1553195820], + [67373.184895, 1553195880], + [67382.167208, 1553195940], + [66387.07162999999, 1553196000], + [59419.339432, 1553196060], + [74900.485453, 1553196120], + [67401.84082900001, 1553196180], + [67144.668065, 1553196240], + [68322.09083199999, 1553196300], + [59302.568578, 1553196360], + [75509.93379499999, 1553196420], + [67320.626162, 1553196480], + [67081.068903, 1553196540], + [69223.298241, 1553196600], + [58405.435035, 1553196660], + [77068.310851, 1553196720], + [65697.986408, 1553196780], + [59492.110587, 1553196840], + [67563.536622, 1553196900], + [68411.859222, 1553196960], + [74990.79763, 1553197020], + [70011.950444, 1553197080], + [66047.779855, 1553197140], + [68602.36716299999, 1553197200], + [58428.295839, 1553197260], + [65968.97434, 1553197320], + [67252.11346, 1553197380], + [67783.156785, 1553197440], + [69352.705059, 1553197500], + [68064.90661600001, 1553197560], + [67756.92176, 1553197620], + [67751.32907299999, 1553197680], + [67313.458015, 1553197740], + [null, 1553197800], + [68523.033516, 1553197860], + [67122.56114399999, 1553197920], + [68034.312268, 1553197980], + [66906.68454, 1553198040] + ], + "target": "outbound", + "tags": { + "aggregatedBy": "sum", + "name": "sumSeries(port_graphs.ams1.r04b01.esr1.snmp.if_octets.137a9e9b-3173-4372-b13c-e61b710adfeb.*.rx)" + } + }] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/operatingsystems.json b/libcloud/test/compute/fixtures/equinixmetal/operatingsystems.json new file mode 100644 index 0000000000..5c0bc8ff7b --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/operatingsystems.json @@ -0,0 +1,28 @@ +{ + "operating_systems": [ + { + "slug": "centos_7", + "name": "CentOS 7", + "distro": "centos", + "version": "7" + }, + { + "slug": "coreos_stable", + "name": "CoreOS (stable)", + "distro": "coreos", + "version": "stable" + }, + { + "slug": "ubuntu_14_04", + "name": "Ubuntu 14.04 LTS", + "distro": "ubuntu", + "version": "14.04" + }, + { + "slug": "debian_7", + "name": "Debian 7", + "distro": "debian", + "version": "7" + } + ] +} diff --git a/libcloud/test/compute/fixtures/equinixmetal/plans.json b/libcloud/test/compute/fixtures/equinixmetal/plans.json new file mode 100644 index 0000000000..5dc8122769 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/plans.json @@ -0,0 +1,38 @@ +{ + "plans": [ + { + "id": "6d1f1ffa-7912-4b78-b50d-88cc7c8ab40f", + "slug": "baremetal_1", + "name": "Type 1", + "description": "Our Type 1 configuration is a zippy general use server", + "line": "baremetal", + "specs": { + "cpus":[{"count":1,"type":"Intel E3-1240 v3"}], + "memory":{"total":"16GB"}, + "drives":[{"count":2,"size":"120GB","type":"SSD"}], + "nics":[{"count":2,"type":"gigabit"}], + "features":{"raid":true,"txt":true} + }, + "pricing": { + "hourly":0.4,"monthly":250.0 + } + }, + { + "id": "6d1f1ffa-7912-4b78-b50d-88cc7c8ab40e", + "slug": "baremetal_2", + "name": "Type 2", + "description": "Our Type 2 configuration is a zippy general use server", + "line": "baremetal", + "specs": { + "cpus":[{"count":2,"type":"Intel E3-1240 v3"}], + "memory":{"total":"2TB"}, + "drives":[{"count":2,"size":"120GB","type":"SSD"}], + "nics":[{"count":2,"type":"gigabit"}], + "features":{"raid":true,"txt":true} + }, + "pricing": { + "hourly":0.4,"monthly":250.0 + } + } + ] +} diff --git a/libcloud/test/compute/fixtures/equinixmetal/project_events.json b/libcloud/test/compute/fixtures/equinixmetal/project_events.json new file mode 100644 index 0000000000..d4c43c629f --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/project_events.json @@ -0,0 +1,95 @@ +{ + "events": [ + { + "id": "6e91f6a7-b01b-479f-b5bb-1791e3a7840c", + "type": "virtual_network.assigned", + "body": "Dimitris assigned the VNID 1011 to \"%project%\" in ams1.", + "state": null, + "created_at": "2019-03-21T15:31:42Z", + "relationships": [ + { + "href": "#0911cfa1-f089-46c1-80bd-e1c83ae57ba0" + }, + { + "href": "#384585e9-7655-4c4b-b816-061a72fd256c" + } + ], + "ip": "157.52.105.28", + "modified_by": { + "id": "bd4f24f3-33f0-46a6-9528-4e31e2ba6074", + "full_name": "Dimitris Moraitis", + "avatar_url": "https://www.gravatar.com/avatar/702119decab6288093449009ab5af843?d=mm", + "avatar_thumb_url": "https://www.gravatar.com/avatar/702119decab6288093449009ab5af843?d=mm" + }, + "interpolated": "Dimitris assigned the VNID 1011 to \"Packet Integration Testing [Sponsored]\" in ams1.", + "href": "/events/6e91f6a7-b01b-479f-b5bb-1791e3a7840c" + }, + { + "id": "c4016ce2-9c53-4616-a087-029755292919", + "type": "ip_reservation.assigned", + "body": "Dimitris requested an IP range of /31 be added to \"%project%\" in ams1 and got assigned 147.75.100.12/31.", + "state": null, + "created_at": "2019-03-21T15:31:28Z", + "relationships": [ + { + "href": "#495145fb-61ec-4483-80ef-cf6989b836cc" + }, + { + "href": "#a38801d1-56db-4744-96f7-54a3bf4e9c8a" + }, + { + "href": "#37d36535-e983-48d0-831a-5fc9d4143412" + } + ], + "ip": "157.52.105.28", + "modified_by": { + "id": "bd4f24f3-33f0-46a6-9528-4e31e2ba6074", + "full_name": "Dimitris Moraitis", + "avatar_url": "https://www.gravatar.com/avatar/702119decab6288093449009ab5af843?d=mm", + "avatar_thumb_url": "https://www.gravatar.com/avatar/702119decab6288093449009ab5af843?d=mm" + }, + "interpolated": "Dimitris requested an IP range of /31 be added to \"Packet Integration Testing [Sponsored]\" in ams1 and got assigned 147.75.100.12/31.", + "href": "/events/c4016ce2-9c53-4616-a087-029755292919" + }, + { + "id": "af57627a-4e41-4d50-8e1b-c80fee4f2284", + "type": "bgp_config.requested", + "body": "Global BGP was requested to be enabled on project \"%project%\"", + "state": null, + "created_at": "2019-03-08T12:03:47Z", + "relationships": [ + { + "href": "#6935e72e-7822-485e-b87a-238a56282731" + }, + { + "href": "#d6297ecd-f294-46b1-98c2-647bf55e31c8" + } + ], + "ip": "157.52.92.50", + "modified_by": { + "id": "bd4f24f3-33f0-46a6-9528-4e31e2ba6074", + "full_name": "Dimitris Moraitis", + "avatar_url": "https://www.gravatar.com/avatar/702119decab6288093449009ab5af843?d=mm", + "avatar_thumb_url": "https://www.gravatar.com/avatar/702119decab6288093449009ab5af843?d=mm" + }, + "interpolated": "Global BGP was requested to be enabled on project \"Packet Integration Testing [Sponsored]\"", + "href": "/events/af57627a-4e41-4d50-8e1b-c80fee4f2284" + } + ], + "meta": { + "first": { + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df/events?page=1" + }, + "previous": null, + "self": { + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df/events?page=1" + }, + "next": null, + "last": { + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df/events?page=1" + }, + "current_page": 1, + "last_page": 1, + "total": 3 + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/project_ips.json b/libcloud/test/compute/fixtures/equinixmetal/project_ips.json new file mode 100644 index 0000000000..ab90cff7da --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/project_ips.json @@ -0,0 +1,191 @@ +{ + "ip_addresses": [ + { + "facility": { + "code": "ams1", + "features": ["baremetal", "storage", "global_ipv4", "backend_transfer", "layer_2"], + "ip_ranges": ["2604:1380:2000::/36", "147.75.204.0/23", "147.75.100.0/22", "147.75.80.0/22", "147.75.32.0/23"], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL" + }, + "href": "/ips/01c184f5-1413-4b0b-9f6d-ac993f6c9241", + "id": "01c184f5-1413-4b0b-9f6d-ac993f6c9241", + "management": false, + "address_family": 4, + "customdata": {}, + "gateway": "147.75.33.33", + "details": null, + "addon": true, + "public": true, + "available": "/ips/01c184f5-1413-4b0b-9f6d-ac993f6c9241/available", + "project_lite": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "netmask": "255.255.255.240", + "address": "147.75.33.34", + "cidr": 28, + "manageable": true, + "network": "147.75.33.32", + "created_at": "2017-12-29T10:59:59Z", + "bill": true, + "enabled": true, + "project": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "assignments": [], + "global_ip": false + }, { + "facility": { + "code": "ewr1", + "features": ["baremetal", "storage", "backend_transfer", "layer_2", "global_ipv4"], + "ip_ranges": ["2604:1380::/36", "147.75.192.0/21", "147.75.64.0/22", "147.75.72.0/22", "147.75.76.0/22", "147.75.104.0/22", "147.75.96.0/20"], + "address": null, + "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09", + "name": "Parsippany, NJ" + }, + "href": "/ips/612f75c1-9563-46bd-8532-e118e16f8b69", + "id": "612f75c1-9563-46bd-8532-e118e16f8b69", + "management": false, + "address_family": 4, + "customdata": {}, + "gateway": "147.75.194.213", + "details": null, + "addon": true, + "public": true, + "available": "/ips/612f75c1-9563-46bd-8532-e118e16f8b69/available", + "project_lite": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "netmask": "255.255.255.252", + "address": "147.75.194.214", + "cidr": 30, + "manageable": true, + "network": "147.75.194.212", + "created_at": "2015-11-23T17:19:28Z", + "bill": true, + "enabled": true, + "project": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "assignments": [], + "global_ip": false + }, { + "facility": { + "code": "ams1", + "features": ["baremetal", "storage", "global_ipv4", "backend_transfer", "layer_2"], + "ip_ranges": ["2604:1380:2000::/36", "147.75.204.0/23", "147.75.100.0/22", "147.75.80.0/22", "147.75.32.0/23"], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL" + }, + "href": "/ips/bad31403-3b39-4877-aa7e-a88109c4bd83", + "id": "bad31403-3b39-4877-aa7e-a88109c4bd83", + "management": false, + "address_family": 4, + "customdata": {}, + "gateway": "147.75.205.225", + "details": null, + "addon": true, + "public": true, + "available": "/ips/bad31403-3b39-4877-aa7e-a88109c4bd83/available", + "project_lite": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "netmask": "255.255.255.240", + "address": "147.75.205.226", + "cidr": 28, + "manageable": true, + "network": "147.75.205.224", + "created_at": "2016-05-30T18:03:15Z", + "bill": true, + "enabled": true, + "project": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "assignments": [], + "global_ip": false + }, { + "facility": { + "code": "ams1", + "features": ["baremetal", "storage", "global_ipv4", "backend_transfer", "layer_2"], + "ip_ranges": ["2604:1380:2000::/36", "147.75.204.0/23", "147.75.100.0/22", "147.75.80.0/22", "147.75.32.0/23"], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL" + }, + "href": "/ips/6a308ab2-84b6-4bac-80f7-89396c7a8323", + "id": "6a308ab2-84b6-4bac-80f7-89396c7a8323", + "management": false, + "address_family": 6, + "customdata": {}, + "gateway": "2604:1380:2000:c100::1", + "details": null, + "addon": false, + "public": true, + "available": "/ips/6a308ab2-84b6-4bac-80f7-89396c7a8323/available", + "project_lite": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "netmask": "ffff:ffff:ffff:ff00:0000:0000:0000:0000", + "address": "2604:1380:2000:c100::2", + "cidr": 56, + "manageable": true, + "network": "2604:1380:2000:c100::", + "created_at": "2017-12-29T11:11:39Z", + "bill": false, + "enabled": true, + "project": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "assignments": [{ + "href": "/ips/366abb1f-3f79-42d7-8b0b-fab4950eca57" + }], + "global_ip": null + }, { + "facility": { + "code": "ams1", + "features": ["baremetal", "storage", "global_ipv4", "backend_transfer", "layer_2"], + "ip_ranges": ["2604:1380:2000::/36", "147.75.204.0/23", "147.75.100.0/22", "147.75.80.0/22", "147.75.32.0/23"], + "address": { + "href": "#0688e909-647e-4b21-bdf2-fc056d993fc5" + }, + "id": "8e6470b3-b75e-47d1-bb93-45b225750975", + "name": "Amsterdam, NL" + }, + "href": "/ips/022114e7-d405-4fd6-839e-fdc67f28cc18", + "id": "022114e7-d405-4fd6-839e-fdc67f28cc18", + "management": false, + "address_family": 4, + "customdata": {}, + "gateway": "10.80.144.129", + "details": null, + "addon": false, + "public": false, + "available": "/ips/022114e7-d405-4fd6-839e-fdc67f28cc18/available", + "project_lite": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "netmask": "255.255.255.128", + "address": "10.80.144.130", + "cidr": 25, + "manageable": true, + "network": "10.80.144.128", + "created_at": "2017-12-29T11:11:39Z", + "bill": false, + "enabled": true, + "project": { + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + }, + "assignments": [{ + "href": "/ips/9addbf38-5c0c-47d6-b485-f8364b5b37c0" + }], + "global_ip": null + }] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/projects.json b/libcloud/test/compute/fixtures/equinixmetal/projects.json new file mode 100644 index 0000000000..853edc7ac3 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/projects.json @@ -0,0 +1,125 @@ +{ + "projects": [ + { + "id": "3d27fd13-0466-4878-be22-9a4b5595a3df", + "name": "Packet Integration Testing [Sponsored]", + "created_at": "2019-02-07T17:33:22Z", + "updated_at": "2019-02-07T17:33:51Z", + "backend_transfer_enabled": false, + "customdata": {}, + "event_alert_configuration": null, + "memberships": [], + "invitations": [], + "devices": [], + "ssh_keys": [], + "volumes": [], + "members": [ + { + "href": "/users/446476b8-a835-414a-8e9c-84925cc72705" + }, + { + "href": "/users/4b36e749-9218-4bf2-a64d-b47e0170e2ec" + }, + { + "href": "/users/bd4f24f3-33f0-46a6-9528-4e31e2ba6074" + } + ], + "transfers": [], + "organization": { + "href": "/organizations/1432653f-f993-47c5-949e-af3c0de48d70" + }, + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df" + }, + { + "id": "4a4bce6b-d2ef-41f8-95cf-0e2f32996440", + "name": "Docker Cloud", + "created_at": "2016-03-07T14:34:05Z", + "updated_at": "2019-02-07T14:25:46Z", + "backend_transfer_enabled": false, + "customdata": {}, + "event_alert_configuration": { + "href": "#5bfd51ac-a8f3-4c96-af56-4d952e53f204" + }, + "memberships": [], + "invitations": [], + "devices": [], + "ssh_keys": [], + "volumes": [], + "members": [ + { + "href": "/users/446476b8-a835-414a-8e9c-84925cc72705" + }, + { + "href": "/users/4b36e749-9218-4bf2-a64d-b47e0170e2ec" + }, + { + "href": "/users/bd4f24f3-33f0-46a6-9528-4e31e2ba6074" + } + ], + "transfers": [], + "organization": { + "href": "/organizations/1432653f-f993-47c5-949e-af3c0de48d70" + }, + "href": "/projects/4a4bce6b-d2ef-41f8-95cf-0e2f32996440" + }, + { + "id": "4b653fce-6405-4300-9f7d-c587b7888fe5", + "name": "mist.io Integration [Sponsored]", + "created_at": "2015-11-10T14:53:29Z", + "updated_at": "2019-02-07T17:34:26Z", + "backend_transfer_enabled": false, + "customdata": {}, + "event_alert_configuration": { + "href": "#04a29153-a740-423f-a129-7134468797b9" + }, + "memberships": [], + "invitations": [], + "devices": [ + { + "href": "/devices/905037a4-967c-4e81-b364-3a0603aa071b" + } + ], + "ssh_keys": [ + { + "href": "/ssh-keys/4dcb7264-25d2-42db-b25f-d5ebaa8b6410" + }, + { + "href": "/ssh-keys/944bb692-3aa8-449e-9d29-3b4e1028b148" + } + ], + "volumes": [], + "members": [ + { + "href": "/users/446476b8-a835-414a-8e9c-84925cc72705" + }, + { + "href": "/users/4b36e749-9218-4bf2-a64d-b47e0170e2ec" + }, + { + "href": "/users/bd4f24f3-33f0-46a6-9528-4e31e2ba6074" + } + ], + "transfers": [], + "organization": { + "href": "/organizations/1432653f-f993-47c5-949e-af3c0de48d70" + }, + "href": "/projects/4b653fce-6405-4300-9f7d-c587b7888fe5" + } + ], + "meta": { + "first": { + "href": "/projects?page=1" + }, + "previous": null, + "self": { + "href": "/projects?page=1" + }, + "next": null, + "last": { + "href": "/projects?page=1" + }, + "current_page": 1, + "last_page": 1, + "total": 3 + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/reserve_ip.json b/libcloud/test/compute/fixtures/equinixmetal/reserve_ip.json new file mode 100644 index 0000000000..7db282fdc3 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/reserve_ip.json @@ -0,0 +1,29 @@ +{ + "id": "31ae66fe-ee00-4f50-be25-60eeca8718ff", + "address_family": 4, + "netmask": "255.255.255.255", + "created_at": "2019-04-06T23:05:17Z", + "details": null, + "public": true, + "cidr": 32, + "management": false, + "manageable": true, + "enabled": true, + "global_ip": true, + "customdata": {}, + "addon": true, + "bill": true, + "project": { + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df" + }, + "project_lite": { + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df" + }, + "assignments": [], + "facility": null, + "network": "147.75.40.2", + "address": "147.75.40.2", + "gateway": "147.75.40.2", + "available": "/ips/31ae66fe-ee00-4f50-be25-60eeca8718ff/available", + "href": "/ips/31ae66fe-ee00-4f50-be25-60eeca8718ff" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/equinixmetal/sshkey_create.json b/libcloud/test/compute/fixtures/equinixmetal/sshkey_create.json new file mode 100644 index 0000000000..8e11fdf1b4 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/sshkey_create.json @@ -0,0 +1,10 @@ +{ + "id": "2c1a7f23-1dc6-4a37-948e-d9857d9f607c", + "label": "ubuntu1404-201505221415a4c7757e-5198-4f49-82d4-35eb2d06eb27", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDI4pIqzpb5g3992h+yr527VRcaB68KE4vPjWPPoiQws49KIs2NMcOzS9QE4641uW1u5ML2HgQdfYKMF/YFGnI1Y6xV637DjhDyZYV9LasUH49npSSJjsBcsk9JGfUpNAOdcgpFzK8V90eiOrOC5YncxdwwG8pwjFI9nNVPCl4hYEu1iXdyysHvkFfS2fklsNjLWrzfafPlaen+qcBxygCA0sFdW/7er50aJeghdBHnE2WhIKLUkJxnKadznfAge7oEe+3LLAPfP+3yHyvp2+H0IzmVfYvAjnzliYetqQ8pg5ZW2BiJzvqz5PebGS70y/ySCNW1qQmJURK/Wc1bt9en root@libcloud.local.lan\n", + "fingerprint": "aa:49:46:57:2a:07:64:56:33:07:ef:76:1d:54:a3:41", + "created_at": "2015-05-22T18:15:04Z", + "updated_at":"2015-05-22T18:15:04Z", + "user": { "href":"/users/userid" }, + "href": "/ssh-keys/2c1a7f23-1dc6-4a37-948e-d9857d9f607c" +} diff --git a/libcloud/test/compute/fixtures/equinixmetal/sshkeys.json b/libcloud/test/compute/fixtures/equinixmetal/sshkeys.json new file mode 100644 index 0000000000..9152195f74 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/sshkeys.json @@ -0,0 +1,34 @@ +{ + "ssh_keys":[ + { + "id": "2c1a7f23-1dc6-4a37-948e-d9857d9f607c", + "label": "ubuntu1404-201505221415a4c7757e-5198-4f49-82d4-35eb2d06eb27", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDI4pIqzpb5g3992h+yr527VRcaB68KE4vPjWPPoiQws49KIs2NMcOzS9QE4641uW1u5ML2HgQdfYKMF/YFGnI1Y6xV637DjhDyZYV9LasUH49npSSJjsBcsk9JGfUpNAOdcgpFzK8V90eiOrOC5YncxdwwG8pwjFI9nNVPCl4hYEu1iXdyysHvkFfS2fklsNjLWrzfafPlaen+qcBxygCA0sFdW/7er50aJeghdBHnE2WhIKLUkJxnKadznfAge7oEe+3LLAPfP+3yHyvp2+H0IzmVfYvAjnzliYetqQ8pg5ZW2BiJzvqz5PebGS70y/ySCNW1qQmJURK/Wc1bt9en root@libcloud.local.lan\n", + "fingerprint": "aa:49:46:57:2a:07:64:56:33:07:ef:76:1d:54:a3:41", + "created_at": "2015-05-22T18:15:04Z", + "updated_at":"2015-05-22T18:15:04Z", + "user": { "href":"/users/userid" }, + "href": "/ssh-keys/2c1a7f23-1dc6-4a37-948e-d9857d9f607c" + }, + { + "id": "e5ee91f4-ecf7-4a68-9a4e-6443cf2d7eb0", + "label": "ubuntu1404-201505212115f8161afd-7034-498f-aa04-a8d5562d3455", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDc7qwbxJetidi4PnM0hxBLXfW+u/h2boNJZdEd5Bky2CRwIlMwPFqw3zEHrZyh05Ypw3wchvhxLVAC++5XbB7dbKPs7WAtQaZWiqJXVfacaIywyiuNgmdGv7V7gJLOZwLF1sFVisTjAtSLkroidzwX3Btxba+NcGlCVt2Zg2fPbHSUV4tnvzWpQsUBejoJ4pWxP84ty7GPymrRwnjm+qAztCy3RVGtrAAYp04Q/UeIZfi2TBrjZ8y39T8hx8RaQjA1H/+47IEDe+U7rJpxNR9tcZdEryhpH7YP5XFoHo8Y8IiLOKJo6gN0tK1zajoXw7/2oXdGE0Qqx2/VIvivdu6J root@libcloud.local.lan\n", + "fingerprint": "83:b8:0a:30:08:5e:27:50:db:25:d7:a7:ff:ab:aa:0a", + "created_at": "2015-05-22T01:15:04Z", + "updated_at": "2015-05-22T01:15:04Z", + "user": { "href":"/users/userid" }, + "href": "/ssh-keys/e5ee91f4-ecf7-4a68-9a4e-6443cf2d7eb0" + }, + { + "id": "561b54e7-4a2b-4832-a165-567ebb8c8bfb", + "label": "ubuntu1404-201505211245623a7e97-0826-4f62-b337-e7fc592b748a", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCd+HRs6t4/n3LRnvzObeph2ggNNu7P+U8xMJNVE2qfjbrdJP26D4ELDVFbaSCBetYoU6G0IOlUnggZ4g7MPB6eicB5RZEOvAh58pIEgUqnWdZgDbLLY+ZGRwuaFAk6aof3bWDDqd3PUn+HtzNz3EK6Ow09vuYe1RFXLyUcDdb/LJG1bSUw/W+bEjBi/gMIcvomkSz5px40zJL4Bulqy3XPvJyxPweZbsT6LsQkBSstqTNkPH+IYWpUrOVoWy4+etVQ0OOWUXbgMyPtM5qh8JovhkQe5wn1bEV+Fw1LAJ5MF8UKr45k7hZrWfjuyCK1EA3o2Ptn+LpZW4CbCfKuFDg3 root@libcloud.local.lan\n", + "fingerprint": "ed:17:56:d0:03:66:39:f6:3c:03:c5:e6:ec:ac:c4:32", + "created_at": "2015-05-21T16:45:03Z", + "updated_at": "2015-05-21T16:45:03Z", + "user": { "href":"/users/userid" }, + "href": "/ssh-keys/561b54e7-4a2b-4832-a165-567ebb8c8bfb" + } + ] +} diff --git a/libcloud/test/compute/fixtures/equinixmetal/volumes.json b/libcloud/test/compute/fixtures/equinixmetal/volumes.json new file mode 100644 index 0000000000..2a87e4ae22 --- /dev/null +++ b/libcloud/test/compute/fixtures/equinixmetal/volumes.json @@ -0,0 +1,122 @@ +{ + "volumes": [ + { + "id": "a08aaf76-e0ce-43aa-b9cd-cce0d4ae4f4c", + "name": "volume-a08aaf76", + "description": "test volume", + "size": 10, + "locked": false, + "billing_cycle": "hourly", + "state": "active", + "customdata": {}, + "access": { + "ips": [ + "10.144.136.81", + "10.144.140.205" + ], + "iqn": "iqn.2013-05.com.daterainc:tc:01:sn:a0fe42b1c3d239bc" + }, + "created_at": "2019-04-20T16:16:44Z", + "updated_at": "2019-04-20T17:00:35Z", + "project": { + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df" + }, + "facility": { + "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975" + }, + "snapshot_policies": [], + "attachments": [], + "snapshots": [], + "plan": { + "id": "87728148-3155-4992-a730-8d1e6aca8a32", + "slug": "storage_1", + "name": "Standard", + "description": "TBD", + "line": "storage", + "specs": {}, + "legacy": true, + "deployment_types": [], + "available_in": [], + "class": "storage_1", + "pricing": { + "hour": 0.000104 + } + }, + "href": "/storage/a08aaf76-e0ce-43aa-b9cd-cce0d4ae4f4c" + }, + { + "id": "74f11291-fde8-4abf-8150-e51cda7308c3", + "name": "volume-74f11291", + "description": null, + "size": 10, + "locked": false, + "billing_cycle": "hourly", + "state": "active", + "customdata": {}, + "access": { + "ips": [ + "10.144.136.49", + "10.144.140.22" + ], + "iqn": "iqn.2013-05.com.daterainc:tc:01:sn:aeb3ffc6a28aa5a8" + }, + "created_at": "2019-04-12T16:11:49Z", + "updated_at": "2019-04-20T17:23:51Z", + "project": { + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df" + }, + "facility": { + "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975" + }, + "snapshot_policies": [], + "attachments": [ + { + "href": "/storage/attachments/2c16a96f-bb4f-471b-8e2e-b5820b9e1603" + } + ], + "snapshots": [ + { + "href": "#07e762ee-9441-4bce-aad1-400572396ef0" + }, + { + "href": "#b3e5bad7-a219-46d8-8835-b332e9aa4cd9" + }, + { + "href": "#a6176d93-03d1-4a53-a2f3-58f01f48ee95" + } + ], + "plan": { + "id": "87728148-3155-4992-a730-8d1e6aca8a32", + "slug": "storage_1", + "name": "Standard", + "description": "TBD", + "line": "storage", + "specs": {}, + "legacy": true, + "deployment_types": [], + "available_in": [], + "class": "storage_1", + "pricing": { + "hour": 0.000104 + } + }, + "href": "/storage/74f11291-fde8-4abf-8150-e51cda7308c3" + } + ], + "meta": { + "first": { + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df/storage?page=1" + }, + "previous": null, + "self": { + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df/storage?page=1" + }, + "next": null, + "last": { + "href": "/projects/3d27fd13-0466-4878-be22-9a4b5595a3df/storage?page=1" + }, + "current_page": 1, + "last_page": 1, + "total": 2 + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/fcu/ex_describe_instance_types.xml b/libcloud/test/compute/fixtures/fcu/ex_describe_instance_types.xml new file mode 100644 index 0000000000..c66f030bab --- /dev/null +++ b/libcloud/test/compute/fixtures/fcu/ex_describe_instance_types.xml @@ -0,0 +1,33 @@ + + 0556395e-4fe3-4cc1-80cb-c98b9f44ca4b + + + og4.4xlarge + 24 + 193273528320 + 412316860416 + 1 + 30 + true + + + m3.large + 2 + 8050966528 + 34359738368 + 1 + 10 + false + + + oc2.8xlarge + 15 + 68718428160 + 901943132160 + 4 + 30 + false + + + diff --git a/libcloud/test/compute/fixtures/fcu/ex_describe_product_types.xml b/libcloud/test/compute/fixtures/fcu/ex_describe_product_types.xml new file mode 100644 index 0000000000..5901a63bb2 --- /dev/null +++ b/libcloud/test/compute/fixtures/fcu/ex_describe_product_types.xml @@ -0,0 +1,18 @@ + + 6f5287ac-2833-43d5-8675-b1ffd7b658d3 + + + 0001 + Linux/UNIX + + + 0002 + Windows + + + 0003 + MapR + + + diff --git a/libcloud/test/compute/fixtures/fcu/ex_describe_quotas.xml b/libcloud/test/compute/fixtures/fcu/ex_describe_quotas.xml new file mode 100644 index 0000000000..a3d2941f9b --- /dev/null +++ b/libcloud/test/compute/fixtures/fcu/ex_describe_quotas.xml @@ -0,0 +1,53 @@ + + 31ef7689-2521-445f-b634-2a5e3e66f699 + true + + + global + + + 366866344682 + vm_limit + VM Limit + Maximum number of VM this user can own + Compute + 20 + 1 + + + 366866344682 + core_limit + Core Limit + Maximum number of total cores (virtual core) + Compute + 800 + 2 + + + 366866344682 + memory_limit + Memory Limit + Maximum number of total memory (GiB) + Compute + 4880 + 7 + + + + + vpc-00000000 + + + 366866344682 + sg_limit + Security Groups Limit + Maximum number of security groups + Security Groups + 100 + 2 + + + + + diff --git a/libcloud/test/compute/fixtures/fcu/ex_get_product_type.xml b/libcloud/test/compute/fixtures/fcu/ex_get_product_type.xml new file mode 100644 index 0000000000..e5ea50c3b3 --- /dev/null +++ b/libcloud/test/compute/fixtures/fcu/ex_get_product_type.xml @@ -0,0 +1,6 @@ + + e37f7876-8379-4505-8c3c-73c500e34257 + 0002 + Windows + diff --git a/libcloud/test/compute/fixtures/fcu/ex_modify_instance_keypair.xml b/libcloud/test/compute/fixtures/fcu/ex_modify_instance_keypair.xml new file mode 100644 index 0000000000..bb11a1753f --- /dev/null +++ b/libcloud/test/compute/fixtures/fcu/ex_modify_instance_keypair.xml @@ -0,0 +1,5 @@ + + 9be5a40b-5f0a-4761-89fb-770eada0c865 + true + diff --git a/libcloud/test/compute/fixtures/gandi/datacenter_list.xml b/libcloud/test/compute/fixtures/gandi/datacenter_list.xml index 9d8cc688af..09135a4d20 100644 --- a/libcloud/test/compute/fixtures/gandi/datacenter_list.xml +++ b/libcloud/test/compute/fixtures/gandi/datacenter_list.xml @@ -19,6 +19,10 @@ id 1 + + dc_code + FR-SD2 + name Equinix Paris @@ -35,6 +39,10 @@ iso US + + dc_code + US-BA1 + id 2 @@ -50,4 +58,4 @@ - \ No newline at end of file + diff --git a/libcloud/test/compute/fixtures/gandi/ssh_delete.xml b/libcloud/test/compute/fixtures/gandi/ssh_delete.xml new file mode 100644 index 0000000000..6dbecc1b31 --- /dev/null +++ b/libcloud/test/compute/fixtures/gandi/ssh_delete.xml @@ -0,0 +1,8 @@ + + + + +1 + + + diff --git a/libcloud/test/compute/fixtures/gandi/ssh_info.xml b/libcloud/test/compute/fixtures/gandi/ssh_info.xml new file mode 100644 index 0000000000..b48bace703 --- /dev/null +++ b/libcloud/test/compute/fixtures/gandi/ssh_info.xml @@ -0,0 +1,25 @@ + + + + + + +fingerprint +a6:1f:b8:b4:19:91:99:d8:af:ab:d6:17:72:8b:d1:6c + + +name +testkey + + +value +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaCXFxl0cPZa+PkXSaux/9Sfn4J81eNJ4f/ZkjdIlmLJVYFUKbpC16eEwXYEfw/QBAZFPODCDQOFAZdgajO572y9scp09F7L7Rhwrw7DYu8STMIBz0XBIO8eOUyu5hVRpxaZGDih9B99e1hITTGFg+BveAmrdB8CPtygKo/fUmaamrocZBrD1betaLTC0i6/DVz7YAbR0CleZLlaBogqVhqmS0TB4J67aG2vvq1MjyOixQY5Ab4aXo4Dz1jd7oqCGCKCO9oKAG0ok94foxkfnCmfRrnfWzOA7SFWjUs65SOrGYZghspDcbJ9vA4ZkUuWJXPPvLVgsI8aHwkezJPD8Th root@testhost + + +id +10 + + + + + diff --git a/libcloud/test/compute/fixtures/gandi/ssh_list.xml b/libcloud/test/compute/fixtures/gandi/ssh_list.xml new file mode 100644 index 0000000000..003e54619f --- /dev/null +++ b/libcloud/test/compute/fixtures/gandi/ssh_list.xml @@ -0,0 +1,23 @@ + + + + + + + +fingerprint +a6:1f:b8:b4:19:91:99:d8:af:ab:d6:17:72:8b:d1:6c + + +id +10 + + +name +testkey + + + + + + diff --git a/libcloud/test/compute/fixtures/gce/_zones_us_central1_a_instanceGroupManagers_myinstancegroup_listManagedInstances.json b/libcloud/test/compute/fixtures/gce/_zones_us_central1_a_instanceGroupManagers_myinstancegroup_listManagedInstances.json new file mode 100644 index 0000000000..141e5d6e26 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/_zones_us_central1_a_instanceGroupManagers_myinstancegroup_listManagedInstances.json @@ -0,0 +1,24 @@ +{ + "managedInstances": [ + { + "currentAction": "NONE", + "instance": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/base-foo-2vld", + "instanceStatus": "RUNNING" + }, + { + "currentAction": "NONE", + "instance": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/base-foo-il30", + "instanceStatus": "RUNNING" + }, + { + "currentAction": "NONE", + "instance": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/base-foo-lnnr", + "instanceStatus": "RUNNING" + }, + { + "currentAction": "NONE", + "instance": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/base-foo-s41w", + "instanceStatus": "RUNNING" + } + ] +} diff --git a/libcloud/test/compute/fixtures/gce/aggregated_autoscalers.json b/libcloud/test/compute/fixtures/gce/aggregated_autoscalers.json new file mode 100644 index 0000000000..ea7edcfb67 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/aggregated_autoscalers.json @@ -0,0 +1,255 @@ +{ + "items": { + "regions/asia-east1": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "regions/asia-east1" + } + ], + "message": "There are no results for scope 'regions/asia-east1' on this page." + } + }, + "regions/europe-west1": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "regions/europe-west1" + } + ], + "message": "There are no results for scope 'regions/europe-west1' on this page." + } + }, + "regions/us-central1": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "regions/us-central1" + } + ], + "message": "There are no results for scope 'regions/us-central1' on this page." + } + }, + "regions/us-east1": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "regions/us-east1" + } + ], + "message": "There are no results for scope 'regions/us-east1' on this page." + } + }, + "regions/us-west1": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "regions/us-west1" + } + ], + "message": "There are no results for scope 'regions/us-west1' on this page." + } + }, + "zones/asia-east1-a": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/asia-east1-a" + } + ], + "message": "There are no results for scope 'zones/asia-east1-a' on this page." + } + }, + "zones/asia-east1-b": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/asia-east1-b" + } + ], + "message": "There are no results for scope 'zones/asia-east1-b' on this page." + } + }, + "zones/asia-east1-c": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/asia-east1-c" + } + ], + "message": "There are no results for scope 'zones/asia-east1-c' on this page." + } + }, + "zones/europe-west1-b": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/europe-west1-b" + } + ], + "message": "There are no results for scope 'zones/europe-west1-b' on this page." + } + }, + "zones/europe-west1-c": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/europe-west1-c" + } + ], + "message": "There are no results for scope 'zones/europe-west1-c' on this page." + } + }, + "zones/europe-west1-d": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/europe-west1-d" + } + ], + "message": "There are no results for scope 'zones/europe-west1-d' on this page." + } + }, + "zones/us-central1-a": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/us-central1-a" + } + ], + "message": "There are no results for scope 'zones/us-central1-a' on this page." + } + }, + "zones/us-central1-b": { + "autoscalers": [ + { + "autoscalingPolicy": { + "coolDownPeriodSec": 60, + "cpuUtilization": { + "utilizationTarget": 0.6 + }, + "maxNumReplicas": 10, + "minNumReplicas": 2 + }, + "creationTimestamp": "2016-07-20T10:29:22.850-07:00", + "id": "7161434716533557789", + "kind": "compute#autoscaler", + "name": "my-autoscaler", + "selfLink": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/autoscalers/my-autoscaler", + "target": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/instanceGroupManagers/myinstancegroup", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b" + } + ] + }, + "zones/us-central1-c": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/us-central1-c" + } + ], + "message": "There are no results for scope 'zones/us-central1-c' on this page." + } + }, + "zones/us-central1-f": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/us-central1-f" + } + ], + "message": "There are no results for scope 'zones/us-central1-f' on this page." + } + }, + "zones/us-east1-b": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/us-east1-b" + } + ], + "message": "There are no results for scope 'zones/us-east1-b' on this page." + } + }, + "zones/us-east1-c": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/us-east1-c" + } + ], + "message": "There are no results for scope 'zones/us-east1-c' on this page." + } + }, + "zones/us-east1-d": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/us-east1-d" + } + ], + "message": "There are no results for scope 'zones/us-east1-d' on this page." + } + }, + "zones/us-west1-a": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/us-west1-a" + } + ], + "message": "There are no results for scope 'zones/us-west1-a' on this page." + } + }, + "zones/us-west1-b": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "data": [ + { + "key": "scope", + "value": "zones/us-west1-b" + } + ], + "message": "There are no results for scope 'zones/us-west1-b' on this page." + } + } + }, + "kind": "compute#autoscalerAggregatedList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/aggregated/autoscalers" +} diff --git a/libcloud/test/compute/fixtures/gce/aggregated_disks.json b/libcloud/test/compute/fixtures/gce/aggregated_disks.json index 9133041802..243bbb07fb 100644 --- a/libcloud/test/compute/fixtures/gce/aggregated_disks.json +++ b/libcloud/test/compute/fixtures/gce/aggregated_disks.json @@ -67,16 +67,70 @@ } }, "zones/us-central1-a": { - "warning": { - "code": "NO_RESULTS_ON_PAGE", - "data": [ - { - "key": "scope", - "value": "zones/us-central1-a" - } - ], - "message": "There are no results for scope 'zones/us-central1-a' on this page." - } + "disks": [ + { + "creationTimestamp": "2013-12-13T10:45:20.308-08:00", + "description": "Image: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "id": "0265567475385851075", + "kind": "compute#disk", + "name": "node-name", + "type": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/diskTypes/pd-standard", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/node-name", + "sizeGb": "25", + "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "sourceImageId": "17312518942796567788", + "status": "READY", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a" + }, + { + "creationTimestamp": "2013-12-13T10:45:42.139-08:00", + "description": "Image: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "id": "08045379695757218000", + "kind": "compute#disk", + "name": "lcdisk", + "type": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/diskTypes/pd-ssd", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/lcdisk", + "labelFingerprint": "42WmSpB8rSM=", + "labels": { + "one": "1", + "two": "2", + "three": "3" + }, + "sizeGb": "10", + "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "sourceImageId": "17312518942796567789", + "status": "READY", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a" + }, + { + "creationTimestamp": "2013-12-13T10:54:07.687-08:00", + "description": "Image: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "id": "08045379695757218002", + "kind": "compute#disk", + "name": "lcnode-000", + "type": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/diskTypes/pd-standard", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/lcnode-000", + "sizeGb": "25", + "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "sourceImageId": "17312518942796567789", + "status": "READY", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a" + }, + { + "creationTimestamp": "2013-12-13T10:54:07.687-08:00", + "description": "Image: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "id": "08045379695757218000", + "kind": "compute#disk", + "name": "lcnode-001", + "type": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/diskTypes/pd-standard", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/lcnode-001", + "sizeGb": "25", + "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "sourceImageId": "17312518942796567791", + "status": "READY", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a" + } + ] }, "zones/us-central1-b": { "disks": [ @@ -90,6 +144,34 @@ "sizeGb": "10", "status": "READY", "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b" + }, + { + "creationTimestamp": "2013-12-13T10:54:07.687-08:00", + "description": "Image: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "id": "08045379695757218001", + "kind": "compute#disk", + "name": "libcloud-lb-demo-www-000", + "type": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/diskTypes/pd-standard", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/disks/libcloud-lb-demo-www-000", + "sizeGb": "10", + "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "sourceImageId": "17312518942796567791", + "status": "READY", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b" + }, + { + "creationTimestamp": "2013-12-13T10:54:07.687-08:00", + "description": "Image: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "id": "08045379695757218001", + "kind": "compute#disk", + "name": "libcloud-lb-demo-www-001", + "type": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/diskTypes/pd-standard", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/disks/libcloud-lb-demo-www-001", + "sizeGb": "10", + "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "sourceImageId": "17312518942796567791", + "status": "READY", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b" } ] }, @@ -156,6 +238,20 @@ "sourceImageId": "17312518942796567788", "status": "READY", "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central2-a" + }, + { + "creationTimestamp": "2013-12-13T10:45:42.139-08:00", + "description": "Image: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "id": "08045379695757218000", + "kind": "compute#disk", + "name": "lcdisk", + "type": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central2-a/diskTypes/pd-ssd", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central2-a/disks/lcdisk", + "sizeGb": "10", + "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120", + "sourceImageId": "17312518942796567789", + "status": "READY", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central2-a" } ] } diff --git a/libcloud/test/compute/fixtures/gce/aggregated_instanceGroupManagers.json b/libcloud/test/compute/fixtures/gce/aggregated_instanceGroupManagers.json new file mode 100644 index 0000000000..0f42511d29 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/aggregated_instanceGroupManagers.json @@ -0,0 +1,277 @@ +{ + "kind": "compute#instanceGroupManagerAggregatedList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/aggregated/instanceGroupManagers", + "items": { + "regions/us-central1": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'regions/us-central1' on this page.", + "data": [ + { + "key": "scope", + "value": "regions/us-central1" + } + ] + } + }, + "regions/europe-west1": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'regions/europe-west1' on this page.", + "data": [ + { + "key": "scope", + "value": "regions/europe-west1" + } + ] + } + }, + "regions/us-west1": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'regions/us-west1' on this page.", + "data": [ + { + "key": "scope", + "value": "regions/us-west1" + } + ] + } + }, + "regions/asia-east1": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'regions/asia-east1' on this page.", + "data": [ + { + "key": "scope", + "value": "regions/asia-east1" + } + ] + } + }, + "regions/us-east1": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'regions/us-east1' on this page.", + "data": [ + { + "key": "scope", + "value": "regions/us-east1" + } + ] + } + }, + "zones/us-central1-a": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/us-central1-a' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/us-central1-a" + } + ] + } + }, + "zones/us-central1-b": { + "instanceGroupManagers": [ + { + + "kind": "compute#instanceGroupManager", + "id": "8604381270851510464", + "creationTimestamp": "2016-07-18T15:54:39.153-07:00", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b", + "name": "myinstancegroup", + "description": "my description for myinstancegroup", + "instanceTemplate": "https://content.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates/my-instance-template1", + "instanceGroup": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/instanceGroups/myinstancegroup", + "baseInstanceName": "base-foo", + "fingerprint": "Q21hYveq9do=", + "currentActions": { + "none": 4, + "creating": 0, + "recreating": 0, + "deleting": 0, + "abandoning": 0, + "restarting": 0, + "refreshing": 0 + }, + "targetSize": 4, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/instanceGroupManagers/myinstancegroup" + } + ] + }, + "zones/us-central1-c": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/us-central1-c' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/us-central1-c" + } + ] + } + }, + "zones/us-central1-f": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/us-central1-f' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/us-central1-f" + } + ] + } + }, + "zones/europe-west1-b": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/europe-west1-b' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/europe-west1-b" + } + ] + } + }, + "zones/europe-west1-c": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/europe-west1-c' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/europe-west1-c" + } + ] + } + }, + "zones/europe-west1-d": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/europe-west1-d' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/europe-west1-d" + } + ] + } + }, + "zones/us-west1-a": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/us-west1-a' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/us-west1-a" + } + ] + } + }, + "zones/us-west1-b": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/us-west1-b' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/us-west1-b" + } + ] + } + }, + "zones/asia-east1-a": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/asia-east1-a' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/asia-east1-a" + } + ] + } + }, + "zones/asia-east1-b": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/asia-east1-b' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/asia-east1-b" + } + ] + } + }, + "zones/asia-east1-c": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/asia-east1-c' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/asia-east1-c" + } + ] + } + }, + "zones/us-east1-b": { + "instanceGroupManagers": [ + { + + "kind": "compute#instanceGroupManager", + "id": "8588434319274454491", + "creationTimestamp": "2016-07-18T10:34:44.679-07:00", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-east1-b", + "name": "myinstancegroup", + "instanceTemplate": "https://content.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates/my-instance-template1", + "instanceGroup": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-east1-b/instanceGroups/myinstancegroup", + "baseInstanceName": "myinstancegroup", + "fingerprint": "5bKcxzAnGOg=", + "currentActions": { + "none": 2, + "creating": 0, + "recreating": 0, + "deleting": 0, + "abandoning": 0, + "restarting": 0, + "refreshing": 0 + }, + "targetSize": 2, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-east1-b/instanceGroupManagers/myinstancegroup" + } + ] + }, + "zones/us-east1-c": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/us-east1-c' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/us-east1-c" + } + ] + } + }, + "zones/us-east1-d": { + "warning": { + "code": "NO_RESULTS_ON_PAGE", + "message": "There are no results for scope 'zones/us-east1-d' on this page.", + "data": [ + { + "key": "scope", + "value": "zones/us-east1-d" + } + ] + } + } + } +} diff --git a/libcloud/test/compute/fixtures/gce/aggregated_instances.json b/libcloud/test/compute/fixtures/gce/aggregated_instances.json index 3624fd0c82..dae2037cff 100644 --- a/libcloud/test/compute/fixtures/gce/aggregated_instances.json +++ b/libcloud/test/compute/fixtures/gce/aggregated_instances.json @@ -449,7 +449,7 @@ "onHostMaintenance": "MIGRATE" }, "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central2-a/instances/libcloud-demo-multiple-nodes-001", - "status": "RUNNING", + "status": "SUSPENDED", "tags": { "fingerprint": "W7t6ZyTyIrc=", "items": [ @@ -463,4 +463,4 @@ }, "kind": "compute#instanceAggregatedList", "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/aggregated/instances" -} \ No newline at end of file +} diff --git a/libcloud/test/compute/fixtures/gce/aggregated_subnetworks.json b/libcloud/test/compute/fixtures/gce/aggregated_subnetworks.json new file mode 100644 index 0000000000..6b4adb60da --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/aggregated_subnetworks.json @@ -0,0 +1,66 @@ +{ + "kind": "compute#subnetworkAggregatedList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/aggregated/subnetworks", + "items": { + "regions/us-central1": { + "subnetworks": [ + { + "kind": "compute#subnetwork", + "id": "4297043163355844284", + "creationTimestamp": "2016-03-25T05:34:27.209-07:00", + "gatewayAddress": "10.128.0.1", + "name": "cf-972cf02e6ad49112", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/cf", + "ipCidrRange": "10.128.0.0/20", + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112" + } + ] + }, + "regions/europe-west1": { + "subnetworks": [ + { + "kind": "compute#subnetwork", + "id": "447043451408125628", + "creationTimestamp": "2016-03-25T05:34:27.272-07:00", + "gatewayAddress": "10.132.0.1", + "name": "cf-df1837b06a6f927b", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/cf", + "ipCidrRange": "10.132.0.0/20", + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/europe-west1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/europe-west1/subnetworks/cf-df1837b06a6f927b" + } + ] + }, + "regions/asia-east1": { + "subnetworks": [ + { + "kind": "compute#subnetwork", + "id": "1240429769038270140", + "creationTimestamp": "2016-03-25T05:34:27.413-07:00", + "gatewayAddress": "10.140.0.1", + "name": "cf-4c2da366a0381eb9", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/cf", + "ipCidrRange": "10.140.0.0/20", + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/asia-east1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/asia-east1/subnetworks/cf-4c2da366a0381eb9" + } + ] + }, + "regions/us-east1": { + "subnetworks": [ + { + "kind": "compute#subnetwork", + "id": "648244394139881148", + "creationTimestamp": "2016-03-25T05:34:27.475-07:00", + "gatewayAddress": "10.142.0.1", + "name": "cf-daf1e2124a902a47", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/cf", + "ipCidrRange": "10.142.0.0/20", + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-east1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-east1/subnetworks/cf-daf1e2124a902a47" + } + ] + } + } +} diff --git a/libcloud/test/compute/fixtures/gce/global_backendServices_web_service.json b/libcloud/test/compute/fixtures/gce/global_backendServices_web_service.json index e9af3b4776..4e0e5b1b61 100644 --- a/libcloud/test/compute/fixtures/gce/global_backendServices_web_service.json +++ b/libcloud/test/compute/fixtures/gce/global_backendServices_web_service.json @@ -7,14 +7,14 @@ "backends": [ { "description": "", - "group": "https://www.googleapis.com/resourceviews/v1beta1/projects/project_name/zones/us-central1-b/resourceViews/us-resources", + "group": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myinstancegroup", "balancingMode": "RATE", "maxRate": 100, "capacityScaler": 1.0 }, { "description": "", - "group": "https://www.googleapis.com/resourceviews/v1beta1/projects/project_name/zones/europe-west1-b/resourceViews/eu-resources", + "group": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myinstancegroup", "balancingMode": "RATE", "maxRate": 150, "capacityScaler": 1.0 diff --git a/libcloud/test/compute/fixtures/gce/global_custom_image_setLabels_post.json b/libcloud/test/compute/fixtures/gce/global_custom_image_setLabels_post.json new file mode 100644 index 0000000000..14ee486206 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_custom_image_setLabels_post.json @@ -0,0 +1,15 @@ +{ + "endTime": "2013-06-26T10:05:07.630-07:00", + "id": "3681664092089171723", + "insertTime": "2013-06-26T10:05:03.271-07:00", + "kind": "compute#operation", + "name": "operation-setImageLabelspost", + "operationType": "insert", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/operations/operation-setImageLabels_post", + "startTime": "2013-06-26T10:05:03.315-07:00", + "status": "PENDING", + "targetId": "16211908079305042870", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/images/custom-image/setLabels", + "user": "foo@developer.gserviceaccount.com" +} diff --git a/libcloud/test/compute/fixtures/gce/global_firewalls_lcfirewall-deny.json b/libcloud/test/compute/fixtures/gce/global_firewalls_lcfirewall-deny.json new file mode 100644 index 0000000000..2d12e957b7 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_firewalls_lcfirewall-deny.json @@ -0,0 +1,25 @@ +{ + "denied": [ + { + "IPProtocol": "tcp", + "ports": [ + "4567" + ] + } + ], + "creationTimestamp": "2013-06-26T10:04:43.773-09:00", + "description": "Libcloud Deny Firewall", + "direction": "INGRESS", + "id": "0565629596395414123", + "kind": "compute#firewall", + "name": "lcfirewall-deny", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/default", + "priority": 900, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/firewalls/lcfirewall-deny", + "sourceRanges": [ + "10.240.100.0/24" + ], + "sourceTags": [ + "libcloud" + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/global_firewalls_lcfirewall-egress.json b/libcloud/test/compute/fixtures/gce/global_firewalls_lcfirewall-egress.json new file mode 100644 index 0000000000..e4a0c5a106 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_firewalls_lcfirewall-egress.json @@ -0,0 +1,25 @@ +{ + "allowed": [ + { + "IPProtocol": "tcp", + "ports": [ + "4567" + ] + } + ], + "creationTimestamp": "2013-06-26T10:05:43.773-07:00", + "description": "Libcloud Egress Firewall", + "direction": "EGRESS", + "id": "0565629596395414122", + "kind": "compute#firewall", + "name": "lcfirewall-egress", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/default", + "priority": 900, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/firewalls/lcfirewall-egress", + "targetServiceAccounts": [ + "lctarget@gserviceaccount.com" + ], + "destinationRanges": [ + "8.8.8.8/32" + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/global_firewalls_lcfirewall.json b/libcloud/test/compute/fixtures/gce/global_firewalls_lcfirewall.json index 51f1d914d6..db42d2c1dc 100644 --- a/libcloud/test/compute/fixtures/gce/global_firewalls_lcfirewall.json +++ b/libcloud/test/compute/fixtures/gce/global_firewalls_lcfirewall.json @@ -8,12 +8,18 @@ } ], "creationTimestamp": "2013-06-26T10:04:43.773-07:00", + "description": "Libcloud Test Firewall", + "direction": "INGRESS", "id": "0565629596395414121", "kind": "compute#firewall", "name": "lcfirewall", "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/default", + "priority": 900, "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/firewalls/lcfirewall", - "sourceTags": [ + "sourceServiceAccounts": [ + "lcsource@gserviceaccount.com" + ], + "targetTags": [ "libcloud" ] } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/global_images.json b/libcloud/test/compute/fixtures/gce/global_images.json index 82f1ee2499..1d9a048573 100644 --- a/libcloud/test/compute/fixtures/gce/global_images.json +++ b/libcloud/test/compute/fixtures/gce/global_images.json @@ -4,12 +4,36 @@ "id": "projects/project_name/global/images", "items": [ { - + "kind": "compute#image", + "id": "7094983038334682865", + "creationTimestamp": "2017-10-26T07:58:38.442-07:00", + "name": "custom-image", + "description": "a custom image", + "sourceType": "RAW", + "status": "READY", + "archiveSizeBytes": "1314375168", + "diskSizeGb": "10", + "sourceDisk": "projects/project_name/zones/us-central1-b/disks/custom-instance", + "sourceDiskId": "3436116182804197834", + "family": "custom", + "selfLink": "projects/project_name/global/images/custom-image", + "labelFingerprint": "42WmSpB8rSM=", + "labels": { + "foo": "bar", + "one": "1", + "two": "two" + }, + "getResourceId": {}, + "getDisplayName": {}, + "getResourceType": {}, + "getFullResourcePath": {} + }, + { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/images/aws-ubuntu", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/images/custom-image", "id": "15632509721401584263", "creationTimestamp": "2014-12-09T09:26:27.234-08:00", - "name": "aws-ubuntu", + "name": "custom-image", "sourceType": "RAW", "rawDisk": { "source": "", diff --git a/libcloud/test/compute/fixtures/gce/global_images_family_notfound.json b/libcloud/test/compute/fixtures/gce/global_images_family_notfound.json new file mode 100644 index 0000000000..0309a635f9 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_images_family_notfound.json @@ -0,0 +1,13 @@ +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "The resource 'projects/project-name/global/images/family/coreos-stable' was not found", + "reason": "notFound" + } + ], + "message": "The resource 'projects/project-name/global/images/family/coreos-stable' was not found" + } +} diff --git a/libcloud/test/compute/fixtures/gce/global_images_paged.json b/libcloud/test/compute/fixtures/gce/global_images_paged.json new file mode 100644 index 0000000000..f9c52d71e4 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_images_paged.json @@ -0,0 +1,48 @@ +{ + "kind": "compute#imageList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/images", + "id": "projects/project_name/global/images", + "nextPageToken" : "token", + "items": [ + { + "kind": "compute#image1", + "id": "7094983038334682861", + "creationTimestamp": "2017-10-26T07:58:38.442-07:00", + "name": "custom-image1", + "description": "a custom image 1", + "sourceType": "RAW", + "status": "READY", + "archiveSizeBytes": "1314375168", + "diskSizeGb": "10", + "sourceDisk": "projects/project_name/zones/us-central1-b/disks/custom-instance1", + "sourceDiskId": "3436116182804197834", + "family": "custom", + "selfLink": "projects/project_name/global/images/custom-image1", + "labelFingerprint": "42WmSpB8rSM=", + "labels": { + "foo": "bar", + "one": "1", + "two": "two" + }, + "getResourceId": {}, + "getDisplayName": {}, + "getResourceType": {}, + "getFullResourcePath": {} + }, + { + "kind": "compute#image2", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/images/custom-image", + "id": "15632509721401584262", + "creationTimestamp": "2014-12-09T09:26:27.234-08:00", + "name": "custom-image2", + "sourceType": "RAW", + "rawDisk": { + "source": "", + "containerType": "TAR" + }, + "status": "READY", + "archiveSizeBytes": "243720274", + "diskSizeGb": "10" + } + ] +} diff --git a/libcloud/test/compute/fixtures/gce/global_instanceTemplates.json b/libcloud/test/compute/fixtures/gce/global_instanceTemplates.json new file mode 100644 index 0000000000..1614824f12 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_instanceTemplates.json @@ -0,0 +1,67 @@ +{ + "id": "projects/project_name/global/instanceTemplates", + "items": [ + { + "creationTimestamp": "2016-07-18T09:53:22.323-07:00", + "description": "", + "id": "8161922600535111533", + "kind": "compute#instanceTemplate", + "name": "my-instance-template1", + "properties": { + "canIpForward": false, + "disks": [ + { + "autoDelete": true, + "boot": true, + "deviceName": "my-instance-template1", + "initializeParams": { + "diskSizeGb": "10", + "diskType": "pd-standard", + "sourceImage": "projects/project_name/global/images/my-new-image1" + }, + "kind": "compute#attachedDisk", + "mode": "READ_WRITE", + "type": "PERSISTENT" + } + ], + "machineType": "n1-standard-1", + "metadata": { + "fingerprint": "Jt9ALJ07B8Q=", + "kind": "compute#metadata" + }, + "networkInterfaces": [ + { + "accessConfigs": [ + { + "kind": "compute#accessConfig", + "name": "External NAT", + "type": "ONE_TO_ONE_NAT" + } + ], + "network": "https://content.googleapis.com/compute/v1/projects/project_name/global/networks/default" + } + ], + "scheduling": { + "automaticRestart": true, + "onHostMaintenance": "MIGRATE", + "preemptible": false + }, + "serviceAccounts": [ + { + "email": "default", + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/logging.write", + "https://www.googleapis.com/auth/monitoring.write", + "https://www.googleapis.com/auth/servicecontrol", + "https://www.googleapis.com/auth/service.management" + ] + } + ] + }, + "selfLink": "https://content.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates/my-instance-template1" + } + ], + "kind": "compute#instanceTemplateList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates" +} diff --git a/libcloud/test/compute/fixtures/gce/global_instanceTemplates_insert.json b/libcloud/test/compute/fixtures/gce/global_instanceTemplates_insert.json new file mode 100644 index 0000000000..fe35dcb787 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_instanceTemplates_insert.json @@ -0,0 +1,12 @@ +{ + "status": "PENDING", + "kind": "compute#operation", + "name": "my_instance_template1", + "insertTime": "2016-09-02T09:31:52.285-07:00", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates/my_instance_template1", + "operationType": "compute.instanceTemplates.insert", + "progress": 50, + "id": 123456, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/operations/operation-global_instanceTemplates_my_instance_template1_insert", + "user": "1264195755357-compute@developer.gserviceaccount.com" +} diff --git a/libcloud/test/compute/fixtures/gce/global_instanceTemplates_my_instance_template1.json b/libcloud/test/compute/fixtures/gce/global_instanceTemplates_my_instance_template1.json new file mode 100644 index 0000000000..bbb81ea32b --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_instanceTemplates_my_instance_template1.json @@ -0,0 +1,60 @@ +{ + "creationTimestamp": "2016-07-18T09:53:22.323-07:00", + "description": "", + "id": "8161922600535111533", + "kind": "compute#instanceTemplate", + "name": "my-instance-template1", + "properties": { + "canIpForward": false, + "disks": [ + { + "autoDelete": true, + "boot": true, + "deviceName": "my-instance-template1", + "initializeParams": { + "diskSizeGb": "10", + "diskType": "pd-standard", + "sourceImage": "projects/project_name/global/images/my-new-image1" + }, + "kind": "compute#attachedDisk", + "mode": "READ_WRITE", + "type": "PERSISTENT" + } + ], + "machineType": "n1-standard-1", + "metadata": { + "fingerprint": "Jt9ALJ07B8Q=", + "kind": "compute#metadata" + }, + "networkInterfaces": [ + { + "accessConfigs": [ + { + "kind": "compute#accessConfig", + "name": "External NAT", + "type": "ONE_TO_ONE_NAT" + } + ], + "network": "https://content.googleapis.com/compute/v1/projects/project_name/global/networks/default" + } + ], + "scheduling": { + "automaticRestart": true, + "onHostMaintenance": "MIGRATE", + "preemptible": false + }, + "serviceAccounts": [ + { + "email": "default", + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/logging.write", + "https://www.googleapis.com/auth/monitoring.write", + "https://www.googleapis.com/auth/servicecontrol", + "https://www.googleapis.com/auth/service.management" + ] + } + ] + }, + "selfLink": "https://content.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates/my-instance-template1" +} diff --git a/libcloud/test/compute/fixtures/gce/global_instanceTemplates_my_instance_template_shared_network.json b/libcloud/test/compute/fixtures/gce/global_instanceTemplates_my_instance_template_shared_network.json new file mode 100644 index 0000000000..679599883c --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_instanceTemplates_my_instance_template_shared_network.json @@ -0,0 +1,61 @@ +{ + "creationTimestamp": "2016-07-18T09:53:22.323-07:00", + "description": "", + "id": "8161922600535111533", + "kind": "compute#instanceTemplate", + "name": "my-instance-template_shared_network", + "properties": { + "canIpForward": false, + "disks": [ + { + "autoDelete": true, + "boot": true, + "deviceName": "my-instance-template_shared_network", + "initializeParams": { + "diskSizeGb": "10", + "diskType": "pd-standard", + "sourceImage": "projects/project_name/global/images/my-new-image1" + }, + "kind": "compute#attachedDisk", + "mode": "READ_WRITE", + "type": "PERSISTENT" + } + ], + "machineType": "n1-standard-1", + "metadata": { + "fingerprint": "Jt9ALJ07B8Q=", + "kind": "compute#metadata" + }, + "networkInterfaces": [ + { + "accessConfigs": [ + { + "kind": "compute#accessConfig", + "name": "External NAT", + "type": "ONE_TO_ONE_NAT" + } + ], + "network": "https://www.googleapis.com/compute/v1/projects/other_name/global/networks/shared_network_for_mig", + "subnetwork": "https://www.googleapis.com/compute/v1/projects/other_name/regions/us-central1/subnetworks/shared_subnetwork_for_mig" + } + ], + "scheduling": { + "automaticRestart": true, + "onHostMaintenance": "MIGRATE", + "preemptible": false + }, + "serviceAccounts": [ + { + "email": "default", + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/logging.write", + "https://www.googleapis.com/auth/monitoring.write", + "https://www.googleapis.com/auth/servicecontrol", + "https://www.googleapis.com/auth/service.management" + ] + } + ] + }, + "selfLink": "https://content.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates/my-instance-template_shared_network" +} diff --git a/libcloud/test/compute/fixtures/gce/global_networks.json b/libcloud/test/compute/fixtures/gce/global_networks.json index dc7ca55d26..1e041f42c5 100644 --- a/libcloud/test/compute/fixtures/gce/global_networks.json +++ b/libcloud/test/compute/fixtures/gce/global_networks.json @@ -1,34 +1,43 @@ { - "id": "projects/project_name/global/networks", - "items": [ - { - "IPv4Range": "10.240.0.0/16", - "creationTimestamp": "2013-06-19T12:37:13.233-07:00", - "gatewayIPv4": "10.240.0.1", - "id": "08257021638942464470", - "kind": "compute#network", - "name": "default", - "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/default" - }, - { - "IPv4Range": "10.10.0.0/16", - "creationTimestamp": "2013-06-26T09:51:34.018-07:00", - "gatewayIPv4": "10.10.0.1", - "id": "13254259054875092094", - "kind": "compute#network", - "name": "libcloud-demo-europe-network", - "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/libcloud-demo-europe-network" - }, - { - "IPv4Range": "10.10.0.0/16", - "creationTimestamp": "2013-06-26T09:48:15.703-07:00", - "gatewayIPv4": "10.10.0.1", - "id": "17172579178188075621", - "kind": "compute#network", - "name": "libcloud-demo-network", - "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/libcloud-demo-network" - } - ], - "kind": "compute#networkList", - "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks" -} \ No newline at end of file + "kind": "compute#networkList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks", + "id": "projects/project_name/global/networks", + "items": [ + { + "kind": "compute#network", + "id": "5125152985904090792", + "creationTimestamp": "2016-03-25T05:34:15.077-07:00", + "name": "cf", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/cf", + "autoCreateSubnetworks": true, + "subnetworks": [ + "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112", + "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-east1/subnetworks/cf-daf1e2124a902a47", + "https://www.googleapis.com/compute/v1/projects/project_name/regions/asia-east1/subnetworks/cf-4c2da366a0381eb9", + "https://www.googleapis.com/compute/v1/projects/project_name/regions/europe-west1/subnetworks/cf-df1837b06a6f927b" + ] + }, + { + "kind": "compute#network", + "id": "7887441312352916157", + "creationTimestamp": "2016-04-30T10:33:06.252-07:00", + "name": "custom", + "description": "Custom network", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/custom", + "autoCreateSubnetworks": false, + "subnetworks": [ + "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/subnet1" + ] + }, + { + "kind": "compute#network", + "id": "2672023774255449680", + "creationTimestamp": "2014-01-21T10:30:55.392-08:00", + "name": "default", + "description": "Default network for the project", + "IPv4Range": "10.240.0.0/16", + "gatewayIPv4": "10.240.0.1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/default" + } + ] +} diff --git a/libcloud/test/compute/fixtures/gce/global_networks_cf.json b/libcloud/test/compute/fixtures/gce/global_networks_cf.json new file mode 100644 index 0000000000..410b4d3068 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_networks_cf.json @@ -0,0 +1,14 @@ +{ + "kind": "compute#network", + "id": "5125152985904090792", + "creationTimestamp": "2016-03-25T05:34:15.077-07:00", + "name": "cf", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/cf", + "autoCreateSubnetworks": true, + "subnetworks": [ + "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112", + "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-east1/subnetworks/cf-daf1e2124a902a47", + "https://www.googleapis.com/compute/v1/projects/project_name/regions/asia-east1/subnetworks/cf-4c2da366a0381eb9", + "https://www.googleapis.com/compute/v1/projects/project_name/regions/europe-west1/subnetworks/cf-df1837b06a6f927b" + ] +} diff --git a/libcloud/test/compute/fixtures/gce/global_networks_custom_network.json b/libcloud/test/compute/fixtures/gce/global_networks_custom_network.json new file mode 100644 index 0000000000..9ac4a165b7 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_networks_custom_network.json @@ -0,0 +1,14 @@ +{ + "kind": "compute#network", + "id": "5125152985904090792", + "creationTimestamp": "2016-03-25T05:34:15.077-07:00", + "name": "custom-network", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/custom-network", + "autoCreateSubnetworks": false, + "subnetworks": [ + "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112", + "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-east1/subnetworks/cf-daf1e2124a902a47", + "https://www.googleapis.com/compute/v1/projects/project_name/regions/asia-east1/subnetworks/cf-4c2da366a0381eb9", + "https://www.googleapis.com/compute/v1/projects/project_name/regions/europe-west1/subnetworks/cf-df1837b06a6f927b" + ] +} diff --git a/libcloud/test/compute/fixtures/gce/global_networks_lcnetwork.json b/libcloud/test/compute/fixtures/gce/global_networks_lcnetwork.json index 8e2da6c6c2..76a26a2bc3 100644 --- a/libcloud/test/compute/fixtures/gce/global_networks_lcnetwork.json +++ b/libcloud/test/compute/fixtures/gce/global_networks_lcnetwork.json @@ -6,5 +6,8 @@ "id": "16211908079305042870", "kind": "compute#network", "name": "lcnetwork", + "routingConfig": { + "routingMode": "REGIONAL" + }, "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/lcnetwork" } diff --git a/libcloud/test/compute/fixtures/gce/global_operations_operation_setImageLabels_post.json b/libcloud/test/compute/fixtures/gce/global_operations_operation_setImageLabels_post.json new file mode 100644 index 0000000000..326e959297 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_operations_operation_setImageLabels_post.json @@ -0,0 +1,15 @@ +{ + "endTime": "2013-06-26T10:05:07.630-07:00", + "id": "3681664092089171723", + "insertTime": "2013-06-26T10:05:03.271-07:00", + "kind": "compute#operation", + "name": "operation-setImageLabelspost", + "operationType": "insert", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/operations/operation-setImageLabels_post", + "startTime": "2013-06-26T10:05:03.315-07:00", + "status": "DONE", + "targetId": "16211908079305042870", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/images/custom-image/setLabels", + "user": "foo@developer.gserviceaccount.com" +} diff --git a/libcloud/test/compute/fixtures/gce/global_sslcertificates.json b/libcloud/test/compute/fixtures/gce/global_sslcertificates.json new file mode 100644 index 0000000000..170c1cbbfa --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_sslcertificates.json @@ -0,0 +1,16 @@ +{ + "kind": "compute#sslCertificateList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/sslCertificates", + "id": "projects/project_name/global/sslCertificates", + "items": [ + { + "kind": "compute#sslCertificate", + "id": "2064539516762881220", + "creationTimestamp": "2016-08-30T10:28:11.926-07:00", + "name": "example", + "description": "my example ssl cert.", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/sslCertificates/example-cert", + "certificate": "-----BEGIN CERTIFICATE-----\nfoobar==\n-----END CERTIFICATE-----\n" + } + ] +} diff --git a/libcloud/test/compute/fixtures/gce/global_sslcertificates_example.json b/libcloud/test/compute/fixtures/gce/global_sslcertificates_example.json new file mode 100644 index 0000000000..c6a2985e47 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_sslcertificates_example.json @@ -0,0 +1,10 @@ +{ + "kind": "compute#sslCertificate", + "id": "2064539516762881220", + "creationTimestamp": "2016-08-30T10:28:11.926-07:00", + "name": "example", + "description": "my example ssl cert.", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/sslCertificates/example", + "certificate": "-----BEGIN CERTIFICATE-----\nfoobar==\n-----END CERTIFICATE-----\n" + +} diff --git a/libcloud/test/compute/fixtures/gce/global_sslcertificates_post.json b/libcloud/test/compute/fixtures/gce/global_sslcertificates_post.json new file mode 100644 index 0000000000..23a9542461 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/global_sslcertificates_post.json @@ -0,0 +1,13 @@ +{ + "kind": "compute#operation", + "id": "5564862567931215044", + "name": "operation-1472578091714-53b4d4e0f85d1-cf587a68-9d7a9200", + "operationType": "insert", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/sslCertificates/example", + "targetId": "2064539516762881220", + "status": "PENDING", + "user": "1294195755358-compute@developer.gserviceaccount.com", + "progress": 0, + "insertTime": "2016-08-30T10:28:11.948-07:00", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/operations/operation_global_sslcertificates_post" +} diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_global_instanceTemplates_insert.json b/libcloud/test/compute/fixtures/gce/operations_operation_global_instanceTemplates_insert.json new file mode 100644 index 0000000000..274cc4f496 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/operations_operation_global_instanceTemplates_insert.json @@ -0,0 +1,12 @@ +{ + "status": "DONE", + "kind": "compute#operation", + "name": "my_instance_template1", + "insertTime": "2016-09-02T09:31:52.285-07:00", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates/my_instance_template1", + "operationType": "compute.instanceTemplates.insert", + "progress": 100, + "id": 123456, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/operations/operation-global_instanceTemplates_my_instance_template1_insert", + "user": "1264195755357-compute@developer.gserviceaccount.com" +} diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_global_sslcertificates_post.json b/libcloud/test/compute/fixtures/gce/operations_operation_global_sslcertificates_post.json new file mode 100644 index 0000000000..73e5fbd3b3 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/operations_operation_global_sslcertificates_post.json @@ -0,0 +1,13 @@ +{ + "kind": "compute#operation", + "id": "5564862567931215044", + "name": "operation-1472578091714-53b4d4e0f85d1-cf587a68-9d7a9200", + "operationType": "insert", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/sslCertificates/example", + "targetId": "2064539516762881220", + "status": "DONE", + "user": "1294195755358-compute@developer.gserviceaccount.com", + "progress": 100, + "insertTime": "2016-08-30T10:28:11.948-07:00", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/operations/operation_global_sslcertificates_post" +} diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_regions_us-central1_subnetworks_post.json b/libcloud/test/compute/fixtures/gce/operations_operation_regions_us-central1_subnetworks_post.json new file mode 100644 index 0000000000..f11725309f --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/operations_operation_regions_us-central1_subnetworks_post.json @@ -0,0 +1,15 @@ +{ + "id": "16064059851942653139", + "insertTime": "2013-06-26T12:21:40.299-07:00", + "kind": "compute#operation", + "name": "operation-regions_us-central1_subnetworks_post", + "operationType": "insert", + "progress": 100, + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/operations/operation-regions_us-central1_subnetworks_post", + "startTime": "2013-06-26T12:21:40.358-07:00", + "status": "DONE", + "targetId": "01531551729918243104", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112", + "user": "897001307951@developer.gserviceaccount.com" +} diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_zones_us-central1-a_disks_lcdisk_resize_post.json b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us-central1-a_disks_lcdisk_resize_post.json new file mode 100644 index 0000000000..5c17a7852d --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us-central1-a_disks_lcdisk_resize_post.json @@ -0,0 +1,16 @@ +{ + "kind": "compute#operation", + "id": "4992266504414588438", + "name": "operation-1562104056794-58cb9b1684c7e-8109138e-848683f7", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "operationType": "resizeDisk", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/904434546113910404", + "targetId": "904434546113910404", + "status": "DONE", + "user": "487551519631-t6qvu2na6p4u9ptm46bsdujf0ohbdro7@developer.gserviceaccount.com", + "progress": 100, + "insertTime": "2019-07-02T14:47:37.095-07:00", + "startTime": "2019-07-02T14:47:37.111-07:00", + "endTime": "2019-07-02T14:47:41.991-07:00", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-1562104056794-58cb9b1684c7e-8109138e-848683f7" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_zones_us-central1-a_disks_lcdisk_setLabels_post.json b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us-central1-a_disks_lcdisk_setLabels_post.json new file mode 100644 index 0000000000..5c5c665c50 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us-central1-a_disks_lcdisk_setLabels_post.json @@ -0,0 +1,16 @@ +{ + "kind": "compute#operation", + "id": "4992266504414588438", + "name": "operation-zones_us-central1-a_disks_lcdisk_setLabels_post", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "operationType": "setLabels", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/904434546113910404", + "targetId": "904434546113910404", + "status": "DONE", + "user": "487551519631-t6qvu2na6p4u9ptm46bsdujf0ohbdro7@developer.gserviceaccount.com", + "progress": 100, + "insertTime": "2019-07-02T14:47:37.095-07:00", + "startTime": "2019-07-02T14:47:37.111-07:00", + "endTime": "2019-07-02T14:47:41.991-07:00", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us-central1-a_disks_lcdisk_setLabels_post" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_insert.json b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_insert.json new file mode 100644 index 0000000000..2b6c12f85f --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_insert.json @@ -0,0 +1,13 @@ +{ + "status": "DONE", + "kind": "compute#operation", + "name": "myname", + "zone": "us-central1-a", + "insertTime": "2016-09-02T09:31:52.285-07:00", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones_us_central1_a/instanceGroups/myname", + "operationType": "compute.instanceGroups.insert", + "progress": 100, + "id": 123456, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us_central1_a_instanceGroups_myname_insert", + "user": "1264195755357-compute@developer.gserviceaccount.com" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_myname_addInstances.json b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_myname_addInstances.json new file mode 100644 index 0000000000..9e21253b3a --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_myname_addInstances.json @@ -0,0 +1,13 @@ +{ + "status": "DONE", + "kind": "compute#operation", + "name": "myname", + "zone": "us-central1-a", + "insertTime": "2016-09-02T09:31:52.285-07:00", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname", + "operationType": "compute.instanceGroups.addInstances", + "progress": 100, + "id": 123456, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us_central1_a_instanceGroups_myname_addInstances", + "user": "1264195755357-compute@developer.gserviceaccount.com" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_myname_delete.json b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_myname_delete.json new file mode 100644 index 0000000000..e13d01791a --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_myname_delete.json @@ -0,0 +1,13 @@ +{ + "status": "DONE", + "kind": "compute#operation", + "name": "myname", + "zone": "us-central1-a", + "insertTime": "2016-09-02T09:31:52.285-07:00", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname", + "operationType": "compute.instanceGroups.delete", + "progress": 100, + "id": 123456, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us_central1_a_instanceGroups_myname_delete", + "user": "1264195755357-compute@developer.gserviceaccount.com" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_myname_removeInstances.json b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_myname_removeInstances.json new file mode 100644 index 0000000000..a994784255 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_myname_removeInstances.json @@ -0,0 +1,13 @@ +{ + "status": "DONE", + "kind": "compute#operation", + "name": "myname", + "zone": "us-central1-a", + "insertTime": "2016-09-02T09:31:52.285-07:00", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname", + "operationType": "compute.instanceGroups.removeInstances", + "progress": 100, + "id": 123456, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us_central1_a_instanceGroups_myname_removeInstances", + "user": "1264195755357-compute@developer.gserviceaccount.com" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_myname_setNamedPorts.json b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_myname_setNamedPorts.json new file mode 100644 index 0000000000..e7b869e0a7 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_instanceGroups_myname_setNamedPorts.json @@ -0,0 +1,13 @@ +{ + "status": "DONE", + "kind": "compute#operation", + "name": "myname", + "zone": "us-central1-a", + "insertTime": "2016-09-02T09:31:52.285-07:00", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname", + "operationType": "compute.instanceGroups.setNamedPorts", + "progress": 100, + "id": 123456, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us_central1_a_instanceGroups_myname_setNamedPorts", + "user": "1264195755357-compute@developer.gserviceaccount.com" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_node_name_setLabels_post.json b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_node_name_setLabels_post.json new file mode 100644 index 0000000000..f72e383868 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/operations_operation_zones_us_central1_a_node_name_setLabels_post.json @@ -0,0 +1,15 @@ +{ + "endTime": "2013-06-26T10:05:07.630-07:00", + "id": "3681664092089171723", + "insertTime": "2013-06-26T10:05:03.271-07:00", + "kind": "compute#operation", + "name": "operation-setLabels_post", + "operationType": "insert", + "progress": 100, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-setLabels_post", + "startTime": "2013-06-26T10:05:03.315-07:00", + "status": "DONE", + "targetId": "16211908079305042870", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/node-name/setLabels", + "user": "foo@developer.gserviceaccount.com" +} diff --git a/libcloud/test/compute/fixtures/gce/project.json b/libcloud/test/compute/fixtures/gce/project.json index b50e40f710..b6a603fc44 100644 --- a/libcloud/test/compute/fixtures/gce/project.json +++ b/libcloud/test/compute/fixtures/gce/project.json @@ -15,7 +15,7 @@ }, { "key": "startup-script", - "value": "#!/bin/bash\n\nAUTO_SCRIPT=$(curl -s http://metadata/computeMetadata/v1/instance/attributes/my-auto-script -H \"Metadata-Flavor: Google\")\nCHECK=${AUTO_SCRIPT:-disabled}\n\nif [ \"${CHECK}\" = \"enabled\" -a -f /etc/debian_version ]; then\n export DEBIAN_FRONTEND=noninteractive\n apt-get -q -y update\n apt-get -q -y install git vim tmux\n fi\nexit 0\n" + "value": "#!/bin/bash\n\nAUTO_SCRIPT=$(curl -s http://metadata.google.internal/computeMetadata/v1/instance/attributes/my-auto-script -H \"Metadata-Flavor: Google\")\nCHECK=${AUTO_SCRIPT:-disabled}\n\nif [ \"${CHECK}\" = \"enabled\" -a -f /etc/debian_version ]; then\n export DEBIAN_FRONTEND=noninteractive\n apt-get -q -y update\n apt-get -q -y install git vim tmux\n fi\nexit 0\n" } ] }, diff --git a/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images.json b/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images.json index f61d03d915..434061e3ca 100644 --- a/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images.json +++ b/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images.json @@ -1,15 +1,36 @@ { "kind": "compute#imageList", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images", "id": "projects/coreos-cloud/global/images", "items": [ { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-282-0-0-v20140410", - "id": "4545075671331449642", - "creationTimestamp": "2014-04-10T13:37:09.105-07:00", - "name": "coreos-alpha-282-0-0-v20140410", - "description": "CoreOS (alpha)", + "id": "4695747588770162260", + "creationTimestamp": "2017-05-25T15:20:43.546-07:00", + "name": "coreos-alpha-1122-0-0-v20160727", + "description": "CoreOS, CoreOS alpha, 1122.0.0, amd64-usr published on 2016-07-27", + "sourceType": "RAW", + "rawDisk": { + "source": "", + "containerType": "TAR" + }, + "deprecated": { + "state": "DEPRECATED" + }, + "status": "READY", + "archiveSizeBytes": "317622899", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1122-0-0-v20160727", + "labelFingerprint": "42WmSpB8rSM=" + }, + { + "kind": "compute#image", + "id": "3107955306779855492", + "creationTimestamp": "2017-03-16T13:24:11.491-07:00", + "name": "coreos-alpha-1353-0-0-v20170316", + "description": "CoreOS, CoreOS alpha, 1353.0.0, amd64-usr published on 2017-03-16", "sourceType": "RAW", "rawDisk": { "source": "", @@ -17,19 +38,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1353-1-0-v20170317" }, "status": "READY", - "archiveSizeBytes": "191704931", - "diskSizeGb": "6" + "archiveSizeBytes": "375484650", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1353-0-0-v20170316", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-298-0-0-v20140425", - "id": "13394839002167516366", - "creationTimestamp": "2014-04-25T16:05:41.718-07:00", - "name": "coreos-alpha-298-0-0-v20140425", - "description": "CoreOS alpha 298.0.0", + "id": "8793447092679971460", + "creationTimestamp": "2017-03-17T11:35:23.424-07:00", + "name": "coreos-alpha-1353-1-0-v20170317", + "description": "CoreOS, CoreOS alpha, 1353.1.0, amd64-usr published on 2017-03-17", "sourceType": "RAW", "rawDisk": { "source": "", @@ -37,19 +63,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1367-5-0-v20170401" }, "status": "READY", - "archiveSizeBytes": "194267903", - "diskSizeGb": "6" + "archiveSizeBytes": "376139501", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1353-1-0-v20170317", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-310-1-0-v20140508", - "id": "11111206691445863910", - "creationTimestamp": "2014-05-07T17:20:35.575-07:00", - "name": "coreos-alpha-310-1-0-v20140508", - "description": "CoreOS alpha 310.1.0", + "id": "7867764550994707028", + "creationTimestamp": "2017-03-31T18:04:59.295-07:00", + "name": "coreos-alpha-1367-5-0-v20170401", + "description": "CoreOS, CoreOS alpha, 1367.5.0, amd64-usr published on 2017-04-01", "sourceType": "RAW", "rawDisk": { "source": "", @@ -57,19 +88,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1381-0-0-v20170413" }, "status": "READY", - "archiveSizeBytes": "196010234", - "diskSizeGb": "6" + "archiveSizeBytes": "376276205", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1367-5-0-v20170401", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-315-0-0-v20140512", - "id": "16022942869504160", - "creationTimestamp": "2014-05-12T16:24:23.130-07:00", - "name": "coreos-alpha-315-0-0-v20140512", - "description": "CoreOS alpha 315.0.0", + "id": "3951901945058146963", + "creationTimestamp": "2017-04-13T16:06:36.674-07:00", + "name": "coreos-alpha-1381-0-0-v20170413", + "description": "CoreOS, CoreOS alpha, 1381.0.0, amd64-usr published on 2017-04-13", "sourceType": "RAW", "rawDisk": { "source": "", @@ -77,19 +113,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1395-0-0-v20170427" }, "status": "READY", - "archiveSizeBytes": "195832144", - "diskSizeGb": "6" + "archiveSizeBytes": "375076474", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1381-0-0-v20170413", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-317-0-0-v20140515", - "id": "11739259381666430485", - "creationTimestamp": "2014-05-15T10:42:51.748-07:00", - "name": "coreos-alpha-317-0-0-v20140515", - "description": "CoreOS alpha 317.0.0", + "id": "6955051234309932588", + "creationTimestamp": "2017-04-27T11:30:27.356-07:00", + "name": "coreos-alpha-1395-0-0-v20170427", + "description": "CoreOS, CoreOS alpha, 1395.0.0, amd64-usr published on 2017-04-27", "sourceType": "RAW", "rawDisk": { "source": "", @@ -97,19 +138,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1409-0-0-v20170511" }, "status": "READY", - "archiveSizeBytes": "195591890", - "diskSizeGb": "6" + "archiveSizeBytes": "374705530", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1395-0-0-v20170427", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-324-1-0-v20140522", - "id": "3998011925663216170", - "creationTimestamp": "2014-05-22T11:10:59.683-07:00", - "name": "coreos-alpha-324-1-0-v20140522", - "description": "CoreOS alpha 324.1.0", + "id": "3877520232569995102", + "creationTimestamp": "2017-05-11T12:55:29.282-07:00", + "name": "coreos-alpha-1409-0-0-v20170511", + "description": "CoreOS, CoreOS alpha, 1409.0.0, amd64-usr published on 2017-05-11", "sourceType": "RAW", "rawDisk": { "source": "", @@ -117,19 +163,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1423-0-0-v20170525" }, "status": "READY", - "archiveSizeBytes": "198854961", - "diskSizeGb": "6" + "archiveSizeBytes": "383589509", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1409-0-0-v20170511", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-324-2-0-v20140528", - "id": "6833110226481787934", - "creationTimestamp": "2014-05-28T12:04:45.280-07:00", - "name": "coreos-alpha-324-2-0-v20140528", - "description": "CoreOS alpha 324.2.0", + "id": "7859070867191014126", + "creationTimestamp": "2017-05-25T11:01:37.468-07:00", + "name": "coreos-alpha-1423-0-0-v20170525", + "description": "CoreOS, CoreOS alpha, 1423.0.0, amd64-usr published on 2017-05-25", "sourceType": "RAW", "rawDisk": { "source": "", @@ -137,19 +193,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1430-0-0-v20170531" }, "status": "READY", - "archiveSizeBytes": "198872299", - "diskSizeGb": "6" + "archiveSizeBytes": "387676297", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1423-0-0-v20170525", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-324-3-0-v20140530", - "id": "2096033640183904088", - "creationTimestamp": "2014-05-30T10:10:54.644-07:00", - "name": "coreos-alpha-324-3-0-v20140530", - "description": "CoreOS alpha 324.3.0", + "id": "3849476475535420699", + "creationTimestamp": "2017-05-31T16:38:28.911-07:00", + "name": "coreos-alpha-1430-0-0-v20170531", + "description": "CoreOS, CoreOS alpha, 1430.0.0, amd64-usr published on 2017-05-31", "sourceType": "RAW", "rawDisk": { "source": "", @@ -157,19 +223,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1437-0-0-v20170608" }, "status": "READY", - "archiveSizeBytes": "198897147", - "diskSizeGb": "6" + "archiveSizeBytes": "387963522", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1430-0-0-v20170531", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-324-4-0-v20140607", - "id": "13657407932096700402", - "creationTimestamp": "2014-06-06T17:48:24.952-07:00", - "name": "coreos-alpha-324-4-0-v20140607", - "description": "CoreOS alpha 324.4.0", + "id": "3834637015636521853", + "creationTimestamp": "2017-06-08T10:46:58.678-07:00", + "name": "coreos-alpha-1437-0-0-v20170608", + "description": "CoreOS, CoreOS alpha, 1437.0.0, amd64-usr published on 2017-06-08", "sourceType": "RAW", "rawDisk": { "source": "", @@ -177,19 +253,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1451-2-0-v20170623" }, "status": "READY", - "archiveSizeBytes": "198687188", - "diskSizeGb": "6" + "archiveSizeBytes": "388495781", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1437-0-0-v20170608", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-324-5-0-v20140607", - "id": "2289397358548509631", - "creationTimestamp": "2014-06-07T15:11:14.415-07:00", - "name": "coreos-alpha-324-5-0-v20140607", - "description": "CoreOS alpha 324.5.0", + "id": "6565444485921229965", + "creationTimestamp": "2017-06-22T18:44:02.977-07:00", + "name": "coreos-alpha-1451-2-0-v20170623", + "description": "CoreOS, CoreOS alpha, 1451.2.0, amd64-usr published on 2017-06-23", "sourceType": "RAW", "rawDisk": { "source": "", @@ -197,19 +283,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1465-0-0-v20170706" }, "status": "READY", - "archiveSizeBytes": "198701072", - "diskSizeGb": "6" + "archiveSizeBytes": "390296986", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1451-2-0-v20170623", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-338-0-0-v20140604", - "id": "6110535785379416957", - "creationTimestamp": "2014-06-04T15:57:45.096-07:00", - "name": "coreos-alpha-338-0-0-v20140604", - "description": "CoreOS alpha 338.0.0", + "id": "4165632660333607425", + "creationTimestamp": "2017-07-06T11:43:58.814-07:00", + "name": "coreos-alpha-1465-0-0-v20170706", + "description": "CoreOS, CoreOS alpha, 1465.0.0, amd64-usr published on 2017-07-06", "sourceType": "RAW", "rawDisk": { "source": "", @@ -217,19 +313,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1478-0-0-v20170719" }, "status": "READY", - "archiveSizeBytes": "204832142", - "diskSizeGb": "9" + "archiveSizeBytes": "395186083", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1465-0-0-v20170706", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-342-0-0-v20140608", - "id": "14338602172513809268", - "creationTimestamp": "2014-06-08T10:50:15.283-07:00", - "name": "coreos-alpha-342-0-0-v20140608", - "description": "CoreOS alpha 342.0.0", + "id": "2094793880548547038", + "creationTimestamp": "2017-07-19T11:38:41.271-07:00", + "name": "coreos-alpha-1478-0-0-v20170719", + "description": "CoreOS, CoreOS alpha, 1478.0.0, amd64-usr published on 2017-07-19", "sourceType": "RAW", "rawDisk": { "source": "", @@ -237,19 +343,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1492-0-0-v20170802" }, "status": "READY", - "archiveSizeBytes": "204558347", - "diskSizeGb": "9" + "archiveSizeBytes": "394661543", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1478-0-0-v20170719", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-342-1-0-v20140608", - "id": "13330227154553534732", - "creationTimestamp": "2014-06-08T14:57:01.770-07:00", - "name": "coreos-alpha-342-1-0-v20140608", - "description": "CoreOS alpha 342.1.0", + "id": "8005091676415346513", + "creationTimestamp": "2017-08-02T09:11:42.466-07:00", + "name": "coreos-alpha-1492-0-0-v20170802", + "description": "CoreOS, CoreOS alpha, 1492.0.0, amd64-usr published on 2017-08-02", "sourceType": "RAW", "rawDisk": { "source": "", @@ -257,19 +373,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1492-1-0-v20170803" }, "status": "READY", - "archiveSizeBytes": "204688415", - "diskSizeGb": "9" + "archiveSizeBytes": "416683693", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1492-0-0-v20170802", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-343-0-0-v20140609", - "id": "1988715371441632844", - "creationTimestamp": "2014-06-09T14:29:28.178-07:00", - "name": "coreos-alpha-343-0-0-v20140609", - "description": "CoreOS alpha 343.0.0", + "id": "951618730468562683", + "creationTimestamp": "2017-08-02T17:02:28.640-07:00", + "name": "coreos-alpha-1492-1-0-v20170803", + "description": "CoreOS, CoreOS alpha, 1492.1.0, amd64-usr published on 2017-08-03", "sourceType": "RAW", "rawDisk": { "source": "", @@ -277,19 +403,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1492-3-0-v20170810" }, "status": "READY", - "archiveSizeBytes": "204553796", - "diskSizeGb": "9" + "archiveSizeBytes": "422836642", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1492-1-0-v20170803", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-349-0-0-v20140616", - "id": "16583233600096079991", - "creationTimestamp": "2014-06-16T15:42:37.127-07:00", - "name": "coreos-alpha-349-0-0-v20140616", - "description": "CoreOS alpha 349.0.0", + "id": "6999557570912412720", + "creationTimestamp": "2017-08-10T15:14:55.316-07:00", + "name": "coreos-alpha-1492-3-0-v20170810", + "description": "CoreOS, CoreOS alpha, 1492.3.0, amd64-usr published on 2017-08-10", "sourceType": "RAW", "rawDisk": { "source": "", @@ -297,19 +433,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1492-4-0-v20170814" }, "status": "READY", - "archiveSizeBytes": "204556764", - "diskSizeGb": "9" + "archiveSizeBytes": "422501298", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1492-3-0-v20170810", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-353-0-0-v20140621", - "id": "6651180993237136697", - "creationTimestamp": "2014-06-20T17:12:53.636-07:00", - "name": "coreos-alpha-353-0-0-v20140621", - "description": "CoreOS alpha 353.0.0", + "id": "1605407439769812676", + "creationTimestamp": "2017-08-14T12:55:23.836-07:00", + "name": "coreos-alpha-1492-4-0-v20170814", + "description": "CoreOS, CoreOS alpha, 1492.4.0, amd64-usr published on 2017-08-14", "sourceType": "RAW", "rawDisk": { "source": "", @@ -317,19 +463,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1506-0-0-v20170817" }, "status": "READY", - "archiveSizeBytes": "204893692", - "diskSizeGb": "9" + "archiveSizeBytes": "421956009", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1492-4-0-v20170814", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-361-0-0-v20140627", - "id": "16595596722360750984", - "creationTimestamp": "2014-06-27T11:18:42.680-07:00", - "name": "coreos-alpha-361-0-0-v20140627", - "description": "CoreOS alpha 361.0.0", + "id": "2770527991526613100", + "creationTimestamp": "2017-08-17T11:20:51.127-07:00", + "name": "coreos-alpha-1506-0-0-v20170817", + "description": "CoreOS, CoreOS alpha, 1506.0.0, amd64-usr published on 2017-08-17", "sourceType": "RAW", "rawDisk": { "source": "", @@ -337,19 +493,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1520-0-0-v20170830" }, "status": "READY", - "archiveSizeBytes": "204875098", - "diskSizeGb": "9" + "archiveSizeBytes": "423172275", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1506-0-0-v20170817", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-367-0-0-v20140703", - "id": "14830409198434884170", - "creationTimestamp": "2014-07-03T15:13:10.342-07:00", - "name": "coreos-alpha-367-0-0-v20140703", - "description": "CoreOS alpha 367.0.0", + "id": "100760484785641629", + "creationTimestamp": "2017-08-30T09:23:14.513-07:00", + "name": "coreos-alpha-1520-0-0-v20170830", + "description": "CoreOS, CoreOS alpha, 1520.0.0, amd64-usr published on 2017-08-30", "sourceType": "RAW", "rawDisk": { "source": "", @@ -357,19 +523,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1520-1-0-v20170906" }, "status": "READY", - "archiveSizeBytes": "202900963", - "diskSizeGb": "9" + "archiveSizeBytes": "427216805", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1520-0-0-v20170830", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-367-1-0-v20140713", - "id": "4506608247976466482", - "creationTimestamp": "2014-07-12T19:19:03.327-07:00", - "name": "coreos-alpha-367-1-0-v20140713", - "description": "CoreOS alpha 367.1.0", + "id": "8321248140378079276", + "creationTimestamp": "2017-09-06T11:30:27.324-07:00", + "name": "coreos-alpha-1520-1-0-v20170906", + "description": "CoreOS, CoreOS alpha, 1520.1.0, amd64-usr published on 2017-09-06", "sourceType": "RAW", "rawDisk": { "source": "", @@ -377,19 +553,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1535-0-0-v20170914" }, "status": "READY", - "archiveSizeBytes": "202819993", - "diskSizeGb": "9" + "archiveSizeBytes": "427229568", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1520-1-0-v20170906", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-379-2-0-v20140715", - "id": "10214880843477717813", - "creationTimestamp": "2014-07-15T16:26:03.323-07:00", - "name": "coreos-alpha-379-2-0-v20140715", - "description": "CoreOS alpha 379.2.0", + "id": "4476739239175215301", + "creationTimestamp": "2017-09-14T13:27:22.146-07:00", + "name": "coreos-alpha-1535-0-0-v20170914", + "description": "CoreOS, CoreOS alpha, 1535.0.0, amd64-usr published on 2017-09-14", "sourceType": "RAW", "rawDisk": { "source": "", @@ -397,19 +583,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1535-1-0-v20170916" }, "status": "READY", - "archiveSizeBytes": "204225959", - "diskSizeGb": "9" + "archiveSizeBytes": "428319104", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1535-0-0-v20170914", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-379-3-0-v20140716", - "id": "9717320542649493270", - "creationTimestamp": "2014-07-16T10:06:14.830-07:00", - "name": "coreos-alpha-379-3-0-v20140716", - "description": "CoreOS alpha 379.3.0", + "id": "1635790407785894373", + "creationTimestamp": "2017-09-15T17:23:38.970-07:00", + "name": "coreos-alpha-1535-1-0-v20170916", + "description": "CoreOS, CoreOS alpha, 1535.1.0, amd64-usr published on 2017-09-16", "sourceType": "RAW", "rawDisk": { "source": "", @@ -417,19 +613,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1535-2-0-v20170921" }, "status": "READY", - "archiveSizeBytes": "204475873", - "diskSizeGb": "9" + "archiveSizeBytes": "427828352", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1535-1-0-v20170916", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-386-1-0-v20140723", - "id": "8762908517570017855", - "creationTimestamp": "2014-07-23T13:21:42.787-07:00", - "name": "coreos-alpha-386-1-0-v20140723", - "description": "CoreOS alpha 386.1.0", + "id": "1972836437337207295", + "creationTimestamp": "2017-09-21T07:39:12.787-07:00", + "name": "coreos-alpha-1535-2-0-v20170921", + "description": "CoreOS, CoreOS alpha, 1535.2.0, amd64-usr published on 2017-09-21", "sourceType": "RAW", "rawDisk": { "source": "", @@ -437,19 +643,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1548-0-0-v20170927" }, "status": "READY", - "archiveSizeBytes": "214809962", - "diskSizeGb": "9" + "archiveSizeBytes": "422514304", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1535-2-0-v20170921", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-394-0-0-v20140801", - "id": "13449834147524152564", - "creationTimestamp": "2014-08-01T11:20:09.394-07:00", - "name": "coreos-alpha-394-0-0-v20140801", - "description": "CoreOS alpha 394.0.0", + "id": "6105978479544006724", + "creationTimestamp": "2017-09-27T08:41:31.739-07:00", + "name": "coreos-alpha-1548-0-0-v20170927", + "description": "CoreOS, CoreOS alpha, 1548.0.0, amd64-usr published on 2017-09-27", "sourceType": "RAW", "rawDisk": { "source": "", @@ -457,19 +673,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1562-0-0-v20171011" }, "status": "READY", - "archiveSizeBytes": "215030100", - "diskSizeGb": "9" + "archiveSizeBytes": "451743360", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1548-0-0-v20170927", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-399-0-0-v20140806", - "id": "9424565426493971034", - "creationTimestamp": "2014-08-05T17:45:57.966-07:00", - "name": "coreos-alpha-399-0-0-v20140806", - "description": "CoreOS alpha 399.0.0", + "id": "3179613202588892810", + "creationTimestamp": "2017-10-11T09:01:42.129-07:00", + "name": "coreos-alpha-1562-0-0-v20171011", + "description": "CoreOS, CoreOS alpha, 1562.0.0, amd64-usr published on 2017-10-11", "sourceType": "RAW", "rawDisk": { "source": "", @@ -477,19 +703,55 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1562-1-0-v20171012" }, "status": "READY", - "archiveSizeBytes": "218427609", - "diskSizeGb": "9" + "archiveSizeBytes": "453697920", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1562-0-0-v20171011", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-402-2-0-v20140807", - "id": "17172174175513198150", - "creationTimestamp": "2014-08-07T16:54:36.859-07:00", - "name": "coreos-alpha-402-2-0-v20140807", - "description": "CoreOS alpha 402.2.0", + "id": "3232831081496605863", + "creationTimestamp": "2017-10-12T13:02:16.316-07:00", + "name": "coreos-alpha-1562-1-0-v20171012", + "description": "CoreOS, CoreOS alpha, 1562.1.0, amd64-usr published on 2017-10-12", + "sourceType": "RAW", + "rawDisk": { + "source": "", + "containerType": "TAR" + }, + "status": "READY", + "archiveSizeBytes": "453563008", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-alpha" + ], + "family": "coreos-alpha", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-alpha-1562-1-0-v20171012", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] + }, + { + "kind": "compute#image", + "id": "109679624318003812", + "creationTimestamp": "2016-11-30T10:03:55.344-08:00", + "name": "coreos-beta-1235-1-0-v20161130", + "description": "CoreOS, CoreOS beta, 1235.1.0, amd64-usr published on 2016-11-30", "sourceType": "RAW", "rawDisk": { "source": "", @@ -497,19 +759,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1235-2-0-v20161207" }, "status": "READY", - "archiveSizeBytes": "218464656", - "diskSizeGb": "9" + "archiveSizeBytes": "370231261", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1235-1-0-v20161130", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-410-0-0-v20140818", - "id": "5447152525517666471", - "creationTimestamp": "2014-08-18T11:28:12.278-07:00", - "name": "coreos-alpha-410-0-0-v20140818", - "description": "CoreOS alpha 410.0.0", + "id": "444908478975541914", + "creationTimestamp": "2016-12-07T08:44:37.130-08:00", + "name": "coreos-beta-1235-2-0-v20161207", + "description": "CoreOS, CoreOS beta, 1235.2.0, amd64-usr published on 2016-12-07", "sourceType": "RAW", "rawDisk": { "source": "", @@ -517,19 +784,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1248-2-0-v20170104" }, "status": "READY", - "archiveSizeBytes": "218443034", - "diskSizeGb": "9" + "archiveSizeBytes": "370990814", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1235-2-0-v20161207", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-423-0-0-v20140828", - "id": "3564803995591182122", - "creationTimestamp": "2014-08-28T15:39:30.525-07:00", - "name": "coreos-alpha-423-0-0-v20140828", - "description": "CoreOS alpha 423.0.0", + "id": "6785527900163599752", + "creationTimestamp": "2017-01-04T11:56:23.879-08:00", + "name": "coreos-beta-1248-2-0-v20170104", + "description": "CoreOS, CoreOS beta, 1248.2.0, amd64-usr published on 2017-01-04", "sourceType": "RAW", "rawDisk": { "source": "", @@ -537,19 +809,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1248-3-0-v20170109" }, "status": "READY", - "archiveSizeBytes": "210763062", - "diskSizeGb": "9" + "archiveSizeBytes": "374908131", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1248-2-0-v20170104", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-431-0-0-v20140905", - "id": "2005848009016889709", - "creationTimestamp": "2014-09-05T13:53:53.863-07:00", - "name": "coreos-alpha-431-0-0-v20140905", - "description": "CoreOS alpha 431.0.0", + "id": "2413509264537512823", + "creationTimestamp": "2017-01-08T16:13:12.107-08:00", + "name": "coreos-beta-1248-3-0-v20170109", + "description": "CoreOS, CoreOS beta, 1248.3.0, amd64-usr published on 2017-01-09", "sourceType": "RAW", "rawDisk": { "source": "", @@ -557,19 +834,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1248-4-0-v20170111" }, "status": "READY", - "archiveSizeBytes": "208605209", - "diskSizeGb": "9" + "archiveSizeBytes": "374932193", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1248-3-0-v20170109", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-435-0-0-v20140910", - "id": "13332314615344703276", - "creationTimestamp": "2014-09-10T11:54:21.707-07:00", - "name": "coreos-alpha-435-0-0-v20140910", - "description": "CoreOS alpha 435.0.0", + "id": "3028522721326148042", + "creationTimestamp": "2017-01-10T18:23:33.739-08:00", + "name": "coreos-beta-1248-4-0-v20170111", + "description": "CoreOS, CoreOS beta, 1248.4.0, amd64-usr published on 2017-01-11", "sourceType": "RAW", "rawDisk": { "source": "", @@ -577,19 +859,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1298-3-0-v20170202" }, "status": "READY", - "archiveSizeBytes": "210142911", - "diskSizeGb": "9" + "archiveSizeBytes": "374389985", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1248-4-0-v20170111", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-438-0-0-v20140913", - "id": "5230953556156640067", - "creationTimestamp": "2014-09-13T12:12:44.675-07:00", - "name": "coreos-alpha-438-0-0-v20140913", - "description": "CoreOS alpha 438.0.0", + "id": "74870675315017693", + "creationTimestamp": "2017-02-02T10:23:47.021-08:00", + "name": "coreos-beta-1298-3-0-v20170202", + "description": "CoreOS, CoreOS beta, 1298.3.0, amd64-usr published on 2017-02-02", "sourceType": "RAW", "rawDisk": { "source": "", @@ -597,19 +884,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1298-4-0-v20170223" }, "status": "READY", - "archiveSizeBytes": "210475454", - "diskSizeGb": "9" + "archiveSizeBytes": "364330700", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1298-3-0-v20170202", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-440-0-0-v20140915", - "id": "5334314307925303424", - "creationTimestamp": "2014-09-15T15:21:20.116-07:00", - "name": "coreos-alpha-440-0-0-v20140915", - "description": "CoreOS alpha 440.0.0", + "id": "5517176404980217691", + "creationTimestamp": "2017-02-22T23:05:24.839-08:00", + "name": "coreos-beta-1298-4-0-v20170223", + "description": "CoreOS, CoreOS beta, 1298.4.0, amd64-usr published on 2017-02-23", "sourceType": "RAW", "rawDisk": { "source": "", @@ -617,19 +909,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1325-2-0-v20170301" }, "status": "READY", - "archiveSizeBytes": "210345834", - "diskSizeGb": "9" + "archiveSizeBytes": "370154475", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1298-4-0-v20170223", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-444-0-0-v20140919", - "id": "13961453531244096097", - "creationTimestamp": "2014-09-19T13:43:08.003-07:00", - "name": "coreos-alpha-444-0-0-v20140919", - "description": "CoreOS alpha 444.0.0", + "id": "1295998296394470025", + "creationTimestamp": "2017-03-01T12:17:42.964-08:00", + "name": "coreos-beta-1325-2-0-v20170301", + "description": "CoreOS, CoreOS beta, 1325.2.0, amd64-usr published on 2017-03-01", "sourceType": "RAW", "rawDisk": { "source": "", @@ -637,19 +934,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1353-2-0-v20170329" }, "status": "READY", - "archiveSizeBytes": "210601371", - "diskSizeGb": "9" + "archiveSizeBytes": "370906342", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1325-2-0-v20170301", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-452-0-0-v20140926", - "id": "15205532858154654172", - "creationTimestamp": "2014-09-26T13:13:30.539-07:00", - "name": "coreos-alpha-452-0-0-v20140926", - "description": "CoreOS alpha 452.0.0", + "id": "6427063981104544818", + "creationTimestamp": "2017-03-29T11:54:22.005-07:00", + "name": "coreos-beta-1353-2-0-v20170329", + "description": "CoreOS, CoreOS beta, 1353.2.0, amd64-usr published on 2017-03-29", "sourceType": "RAW", "rawDisk": { "source": "", @@ -657,19 +959,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1353-4-0-v20170401" }, "status": "READY", - "archiveSizeBytes": "211112758", - "diskSizeGb": "9" + "archiveSizeBytes": "377249029", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1353-2-0-v20170329", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-457-0-0-v20141002", - "id": "9789565658376148526", - "creationTimestamp": "2014-10-01T18:49:01.683-07:00", - "name": "coreos-alpha-457-0-0-v20141002", - "description": "CoreOS alpha 457.0.0", + "id": "4791136252595487547", + "creationTimestamp": "2017-03-31T18:09:40.095-07:00", + "name": "coreos-beta-1353-4-0-v20170401", + "description": "CoreOS, CoreOS beta, 1353.4.0, amd64-usr published on 2017-04-01", "sourceType": "RAW", "rawDisk": { "source": "", @@ -677,19 +984,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1381-1-0-v20170426" }, "status": "READY", - "archiveSizeBytes": "211116656", - "diskSizeGb": "9" + "archiveSizeBytes": "376690157", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1353-4-0-v20170401", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-459-0-0-v20141003", - "id": "12778368443622282257", - "creationTimestamp": "2014-10-03T15:37:32.621-07:00", - "name": "coreos-alpha-459-0-0-v20141003", - "description": "CoreOS alpha 459.0.0", + "id": "3603530705250638540", + "creationTimestamp": "2017-04-26T11:17:07.941-07:00", + "name": "coreos-beta-1381-1-0-v20170426", + "description": "CoreOS, CoreOS beta, 1381.1.0, amd64-usr published on 2017-04-26", "sourceType": "RAW", "rawDisk": { "source": "", @@ -697,19 +1009,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1409-1-0-v20170524" }, "status": "READY", - "archiveSizeBytes": "211079895", - "diskSizeGb": "9" + "archiveSizeBytes": "377222784", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1381-1-0-v20170426", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-471-1-0-v20141016", - "id": "5868321226342539344", - "creationTimestamp": "2014-10-15T17:58:49.120-07:00", - "name": "coreos-alpha-471-1-0-v20141016", - "description": "CoreOS alpha 471.1.0", + "id": "2548796104397845319", + "creationTimestamp": "2017-05-24T11:15:04.201-07:00", + "name": "coreos-beta-1409-1-0-v20170524", + "description": "CoreOS, CoreOS beta, 1409.1.0, amd64-usr published on 2017-05-24", "sourceType": "RAW", "rawDisk": { "source": "", @@ -717,19 +1034,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1437-1-0-v20170621" }, "status": "READY", - "archiveSizeBytes": "212426664", - "diskSizeGb": "9" + "archiveSizeBytes": "381190276", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1409-1-0-v20170524", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-472-0-0-v20141017", - "id": "4576009004678324232", - "creationTimestamp": "2014-10-17T13:25:52.653-07:00", - "name": "coreos-alpha-472-0-0-v20141017", - "description": "CoreOS alpha 472.0.0", + "id": "5762706482594776145", + "creationTimestamp": "2017-06-21T11:28:14.781-07:00", + "name": "coreos-beta-1437-1-0-v20170621", + "description": "CoreOS, CoreOS beta, 1437.1.0, amd64-usr published on 2017-06-21", "sourceType": "RAW", "rawDisk": { "source": "", @@ -737,19 +1064,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1437-2-0-v20170622" }, "status": "READY", - "archiveSizeBytes": "209948512", - "diskSizeGb": "9" + "archiveSizeBytes": "385733790", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1437-1-0-v20170621", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-490-0-0-v20141104", - "id": "13920393620518010014", - "creationTimestamp": "2014-11-04T14:22:35.647-08:00", - "name": "coreos-alpha-490-0-0-v20141104", - "description": "CoreOS alpha 490.0.0", + "id": "4809130752545492791", + "creationTimestamp": "2017-06-22T14:08:40.251-07:00", + "name": "coreos-beta-1437-2-0-v20170622", + "description": "CoreOS, CoreOS beta, 1437.2.0, amd64-usr published on 2017-06-22", "sourceType": "RAW", "rawDisk": { "source": "", @@ -757,19 +1094,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1437-3-0-v20170630" }, "status": "READY", - "archiveSizeBytes": "214899846", - "diskSizeGb": "9" + "archiveSizeBytes": "386975895", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1437-2-0-v20170622", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-493-0-0-v20141107", - "id": "6901289773390612149", - "creationTimestamp": "2014-11-06T17:07:25.804-08:00", - "name": "coreos-alpha-493-0-0-v20141107", - "description": "CoreOS alpha 493.0.0", + "id": "3180906060768308478", + "creationTimestamp": "2017-06-30T15:34:57.701-07:00", + "name": "coreos-beta-1437-3-0-v20170630", + "description": "CoreOS, CoreOS beta, 1437.3.0, amd64-usr published on 2017-06-30", "sourceType": "RAW", "rawDisk": { "source": "", @@ -777,19 +1124,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1465-2-0-v20170719" }, "status": "READY", - "archiveSizeBytes": "214900059", - "diskSizeGb": "9" + "archiveSizeBytes": "385996189", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1437-3-0-v20170630", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-494-0-0-v20141108", - "id": "16984733952836989634", - "creationTimestamp": "2014-11-08T08:14:39.763-08:00", - "name": "coreos-alpha-494-0-0-v20141108", - "description": "CoreOS alpha 494.0.0", + "id": "2740598821171107469", + "creationTimestamp": "2017-07-19T11:43:46.931-07:00", + "name": "coreos-beta-1465-2-0-v20170719", + "description": "CoreOS, CoreOS beta, 1465.2.0, amd64-usr published on 2017-07-19", "sourceType": "RAW", "rawDisk": { "source": "", @@ -797,19 +1154,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1465-3-0-v20170802" }, "status": "READY", - "archiveSizeBytes": "217341810", - "diskSizeGb": "9" + "archiveSizeBytes": "393477793", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1465-2-0-v20170719", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-505-1-0-v20141119", - "id": "6377208203517836508", - "creationTimestamp": "2014-11-19T11:58:34.839-08:00", - "name": "coreos-alpha-505-1-0-v20141119", - "description": "CoreOS alpha 505.1.0", + "id": "7766808750554105481", + "creationTimestamp": "2017-08-02T09:05:58.670-07:00", + "name": "coreos-beta-1465-3-0-v20170802", + "description": "CoreOS, CoreOS beta, 1465.3.0, amd64-usr published on 2017-08-02", "sourceType": "RAW", "rawDisk": { "source": "", @@ -817,19 +1184,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1465-4-0-v20170810" }, "status": "READY", - "archiveSizeBytes": "220202141", - "diskSizeGb": "9" + "archiveSizeBytes": "392527258", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1465-3-0-v20170802", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-507-0-0-v20141121", - "id": "2812520923267400303", - "creationTimestamp": "2014-11-20T16:53:33.724-08:00", - "name": "coreos-alpha-507-0-0-v20141121", - "description": "CoreOS alpha 507.0.0", + "id": "3908238070589253137", + "creationTimestamp": "2017-08-10T15:06:54.850-07:00", + "name": "coreos-beta-1465-4-0-v20170810", + "description": "CoreOS, CoreOS beta, 1465.4.0, amd64-usr published on 2017-08-10", "sourceType": "RAW", "rawDisk": { "source": "", @@ -837,19 +1214,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1465-5-0-v20170814" }, "status": "READY", - "archiveSizeBytes": "220243128", - "diskSizeGb": "9" + "archiveSizeBytes": "392992922", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1465-4-0-v20170810", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-509-0-0-v20141122", - "id": "17634437931750438301", - "creationTimestamp": "2014-11-22T12:07:41.631-08:00", - "name": "coreos-alpha-509-0-0-v20141122", - "description": "CoreOS alpha 509.0.0", + "id": "8936475241727410374", + "creationTimestamp": "2017-08-14T12:46:49.798-07:00", + "name": "coreos-beta-1465-5-0-v20170814", + "description": "CoreOS, CoreOS beta, 1465.5.0, amd64-usr published on 2017-08-14", "sourceType": "RAW", "rawDisk": { "source": "", @@ -857,19 +1244,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1492-5-0-v20170817" }, "status": "READY", - "archiveSizeBytes": "215896616", - "diskSizeGb": "9" + "archiveSizeBytes": "393997471", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1465-5-0-v20170814", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-509-1-0-v20141124", - "id": "15997978649119901106", - "creationTimestamp": "2014-11-24T13:54:40.347-08:00", - "name": "coreos-alpha-509-1-0-v20141124", - "description": "CoreOS alpha 509.1.0", + "id": "5759478647156658938", + "creationTimestamp": "2017-08-17T12:18:45.273-07:00", + "name": "coreos-beta-1492-5-0-v20170817", + "description": "CoreOS, CoreOS beta, 1492.5.0, amd64-usr published on 2017-08-17", "sourceType": "RAW", "rawDisk": { "source": "", @@ -877,19 +1274,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1492-6-0-v20170906" }, "status": "READY", - "archiveSizeBytes": "220158301", - "diskSizeGb": "9" + "archiveSizeBytes": "420365736", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1492-5-0-v20170817", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-522-0-0-v20141205", - "id": "3688346254254255171", - "creationTimestamp": "2014-12-05T11:12:11.016-08:00", - "name": "coreos-alpha-522-0-0-v20141205", - "description": "CoreOS alpha 522.0.0", + "id": "5148360541019700052", + "creationTimestamp": "2017-09-06T12:00:12.009-07:00", + "name": "coreos-beta-1492-6-0-v20170906", + "description": "CoreOS, CoreOS beta, 1492.6.0, amd64-usr published on 2017-09-06", "sourceType": "RAW", "rawDisk": { "source": "", @@ -897,19 +1304,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1520-2-0-v20170914" }, "status": "READY", - "archiveSizeBytes": "220671632", - "diskSizeGb": "9" + "archiveSizeBytes": "419903872", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1492-6-0-v20170906", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-522-1-0-v20141211", - "id": "17994276440547647719", - "creationTimestamp": "2014-12-11T12:59:25.259-08:00", - "name": "coreos-alpha-522-1-0-v20141211", - "description": "CoreOS alpha 522.1.0", + "id": "2985095052869986620", + "creationTimestamp": "2017-09-14T12:26:11.266-07:00", + "name": "coreos-beta-1520-2-0-v20170914", + "description": "CoreOS, CoreOS beta, 1520.2.0, amd64-usr published on 2017-09-14", "sourceType": "RAW", "rawDisk": { "source": "", @@ -917,19 +1334,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1520-3-0-v20170916" }, "status": "READY", - "archiveSizeBytes": "220746106", - "diskSizeGb": "9" + "archiveSizeBytes": "417439360", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1520-2-0-v20170914", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-522-2-0-v20141217", - "id": "14750233033823203541", - "creationTimestamp": "2014-12-17T11:07:40.413-08:00", - "name": "coreos-alpha-522-2-0-v20141217", - "description": "CoreOS alpha 522.2.0", + "id": "4047503918464357695", + "creationTimestamp": "2017-09-15T17:09:52.641-07:00", + "name": "coreos-beta-1520-3-0-v20170916", + "description": "CoreOS, CoreOS beta, 1520.3.0, amd64-usr published on 2017-09-16", "sourceType": "RAW", "rawDisk": { "source": "", @@ -937,19 +1364,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1520-4-0-v20170921" }, "status": "READY", - "archiveSizeBytes": "220706464", - "diskSizeGb": "9" + "archiveSizeBytes": "423404160", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1520-3-0-v20170916", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-534-1-0-v20141219", - "id": "9382201742109997553", - "creationTimestamp": "2014-12-18T16:02:57.257-08:00", - "name": "coreos-alpha-534-1-0-v20141219", - "description": "CoreOS alpha 534.1.0", + "id": "2671230722763550742", + "creationTimestamp": "2017-09-21T07:38:49.339-07:00", + "name": "coreos-beta-1520-4-0-v20170921", + "description": "CoreOS, CoreOS beta, 1520.4.0, amd64-usr published on 2017-09-21", "sourceType": "RAW", "rawDisk": { "source": "", @@ -957,19 +1394,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-536-0-0-v20141220" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1548-1-0-v20171011" }, "status": "READY", - "archiveSizeBytes": "150760714", - "diskSizeGb": "9" + "archiveSizeBytes": "422685824", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1520-4-0-v20170921", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-536-0-0-v20141220", - "id": "17499586025310826725", - "creationTimestamp": "2014-12-20T13:19:46.596-08:00", - "name": "coreos-alpha-536-0-0-v20141220", - "description": "CoreOS alpha 536.0.0", + "id": "2918441957920603826", + "creationTimestamp": "2017-10-11T09:01:33.540-07:00", + "name": "coreos-beta-1548-1-0-v20171011", + "description": "CoreOS, CoreOS beta, 1548.1.0, amd64-usr published on 2017-10-11", "sourceType": "RAW", "rawDisk": { "source": "", @@ -977,35 +1424,55 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-540-0-0-v20141223" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1548-2-0-v20171012" }, "status": "READY", - "archiveSizeBytes": "150727446", - "diskSizeGb": "9" + "archiveSizeBytes": "451512448", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1548-1-0-v20171011", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-540-0-0-v20141223", - "id": "2686834707529846588", - "creationTimestamp": "2014-12-23T13:10:58.507-08:00", - "name": "coreos-alpha-540-0-0-v20141223", - "description": "CoreOS alpha 540.0.0", + "id": "3594322033371149421", + "creationTimestamp": "2017-10-12T13:03:14.220-07:00", + "name": "coreos-beta-1548-2-0-v20171012", + "description": "CoreOS, CoreOS beta, 1548.2.0, amd64-usr published on 2017-10-12", "sourceType": "RAW", "rawDisk": { "source": "", "containerType": "TAR" }, "status": "READY", - "archiveSizeBytes": "147379024", - "diskSizeGb": "9" + "archiveSizeBytes": "451914112", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-beta" + ], + "family": "coreos-beta", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-beta-1548-2-0-v20171012", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-310-1-0-v20140508", - "id": "2504761896178375059", - "creationTimestamp": "2014-05-08T16:21:25.030-07:00", - "name": "coreos-beta-310-1-0-v20140508", - "description": "CoreOS beta 310.1.0", + "id": "5382223799496530918", + "creationTimestamp": "2016-10-20T17:44:57.346-07:00", + "name": "coreos-stable-1122-3-0-v20161021", + "description": "CoreOS, CoreOS stable, 1122.3.0, amd64-usr published on 2016-10-21", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1013,19 +1480,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1185-3-0-v20161101" }, "status": "READY", - "archiveSizeBytes": "196007489", - "diskSizeGb": "6" + "archiveSizeBytes": "303330504", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1122-3-0-v20161021", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-324-3-0-v20140602", - "id": "5956689618368737465", - "creationTimestamp": "2014-06-02T13:23:43.465-07:00", - "name": "coreos-beta-324-3-0-v20140602", - "description": "CoreOS beta 324.3.0", + "id": "1527572715277741875", + "creationTimestamp": "2016-11-01T10:33:16.258-07:00", + "name": "coreos-stable-1185-3-0-v20161101", + "description": "CoreOS, CoreOS stable, 1185.3.0, amd64-usr published on 2016-11-01", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1033,19 +1505,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1185-5-0-v20161207" }, "status": "READY", - "archiveSizeBytes": "198895988", - "diskSizeGb": "6" + "archiveSizeBytes": "302681552", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1185-3-0-v20161101", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-324-5-0-v20140609", - "id": "11953277661482892448", - "creationTimestamp": "2014-06-09T09:49:34.235-07:00", - "name": "coreos-beta-324-5-0-v20140609", - "description": "CoreOS beta 324.5.0", + "id": "379200328364819444", + "creationTimestamp": "2016-12-07T08:47:23.487-08:00", + "name": "coreos-stable-1185-5-0-v20161207", + "description": "CoreOS, CoreOS stable, 1185.5.0, amd64-usr published on 2016-12-07", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1053,19 +1530,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1235-4-0-v20170104" }, "status": "READY", - "archiveSizeBytes": "198718133", - "diskSizeGb": "6" + "archiveSizeBytes": "302934727", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1185-5-0-v20161207", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-353-0-0-v20140625", - "id": "11516237452648076812", - "creationTimestamp": "2014-06-25T13:29:04.367-07:00", - "name": "coreos-beta-353-0-0-v20140625", - "description": "CoreOS beta 353.0.0", + "id": "649072115903051317", + "creationTimestamp": "2017-02-22T23:01:47.036-08:00", + "name": "coreos-stable-1235-12-0-v20170223", + "description": "CoreOS, CoreOS stable, 1235.12.0, amd64-usr published on 2017-02-23", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1073,19 +1555,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1298-5-0-v20170228" }, "status": "READY", - "archiveSizeBytes": "204844190", - "diskSizeGb": "9" + "archiveSizeBytes": "369691368", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1235-12-0-v20170223", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-367-1-0-v20140715", - "id": "12967199568595368851", - "creationTimestamp": "2014-07-15T16:24:00.178-07:00", - "name": "coreos-beta-367-1-0-v20140715", - "description": "CoreOS beta 367.1.0", + "id": "5692980712181919496", + "creationTimestamp": "2017-01-04T11:49:59.326-08:00", + "name": "coreos-stable-1235-4-0-v20170104", + "description": "CoreOS, CoreOS stable, 1235.4.0, amd64-usr published on 2017-01-04", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1093,19 +1580,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1235-5-0-v20170109" }, "status": "READY", - "archiveSizeBytes": "202795742", - "diskSizeGb": "9" + "archiveSizeBytes": "369674730", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1235-4-0-v20170104", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-410-0-0-v20140825", - "id": "5879404002456449175", - "creationTimestamp": "2014-08-25T12:43:37.337-07:00", - "name": "coreos-beta-410-0-0-v20140825", - "description": "CoreOS beta 410.0.0", + "id": "509682010342517217", + "creationTimestamp": "2017-01-08T16:19:27.053-08:00", + "name": "coreos-stable-1235-5-0-v20170109", + "description": "CoreOS, CoreOS stable, 1235.5.0, amd64-usr published on 2017-01-09", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1113,19 +1605,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1235-6-0-v20170111" }, "status": "READY", - "archiveSizeBytes": "218397098", - "diskSizeGb": "9" + "archiveSizeBytes": "369898205", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1235-5-0-v20170109", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-440-0-0-v20140918", - "id": "16470992918251712233", - "creationTimestamp": "2014-09-18T15:25:30.677-07:00", - "name": "coreos-beta-440-0-0-v20140918", - "description": "CoreOS beta 440.0.0", + "id": "4429072154521774226", + "creationTimestamp": "2017-01-10T18:20:45.476-08:00", + "name": "coreos-stable-1235-6-0-v20170111", + "description": "CoreOS, CoreOS stable, 1235.6.0, amd64-usr published on 2017-01-11", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1133,19 +1630,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1235-8-0-v20170131" }, "status": "READY", - "archiveSizeBytes": "210355603", - "diskSizeGb": "9" + "archiveSizeBytes": "369501149", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1235-6-0-v20170111", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-444-2-0-v20140926", - "id": "12871847181887001345", - "creationTimestamp": "2014-09-26T08:59:23.897-07:00", - "name": "coreos-beta-444-2-0-v20140926", - "description": "CoreOS beta 444.2.0", + "id": "6463382104296962964", + "creationTimestamp": "2017-01-31T13:45:31.492-08:00", + "name": "coreos-stable-1235-8-0-v20170131", + "description": "CoreOS, CoreOS stable, 1235.8.0, amd64-usr published on 2017-01-31", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1153,19 +1655,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1235-9-0-v20170202" }, "status": "READY", - "archiveSizeBytes": "210521891", - "diskSizeGb": "9" + "archiveSizeBytes": "368565480", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1235-8-0-v20170131", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-444-3-0-v20141002", - "id": "7978986993043599036", - "creationTimestamp": "2014-10-01T18:58:31.452-07:00", - "name": "coreos-beta-444-3-0-v20141002", - "description": "CoreOS beta 444.3.0", + "id": "7185758735485033030", + "creationTimestamp": "2017-02-02T08:56:09.452-08:00", + "name": "coreos-stable-1235-9-0-v20170202", + "description": "CoreOS, CoreOS stable, 1235.9.0, amd64-usr published on 2017-02-02", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1173,19 +1680,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1235-12-0-v20170223" }, "status": "READY", - "archiveSizeBytes": "210748822", - "diskSizeGb": "9" + "archiveSizeBytes": "370081515", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1235-9-0-v20170202", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-444-4-0-v20141007", - "id": "3564014796395385926", - "creationTimestamp": "2014-10-07T15:07:46.523-07:00", - "name": "coreos-beta-444-4-0-v20141007", - "description": "CoreOS beta 444.4.0", + "id": "6607481358041768333", + "creationTimestamp": "2017-02-28T12:36:50.692-08:00", + "name": "coreos-stable-1298-5-0-v20170228", + "description": "CoreOS, CoreOS stable, 1298.5.0, amd64-usr published on 2017-02-28", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1193,19 +1705,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1298-6-0-v20170315" }, "status": "READY", - "archiveSizeBytes": "210707776", - "diskSizeGb": "9" + "archiveSizeBytes": "370570987", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1298-5-0-v20170228", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-444-5-0-v20141016", - "id": "13297038239143916423", - "creationTimestamp": "2014-10-15T19:47:19.726-07:00", - "name": "coreos-beta-444-5-0-v20141016", - "description": "CoreOS beta 444.5.0", + "id": "6464305049821786041", + "creationTimestamp": "2017-03-15T12:09:10.664-07:00", + "name": "coreos-stable-1298-6-0-v20170315", + "description": "CoreOS, CoreOS stable, 1298.6.0, amd64-usr published on 2017-03-15", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1213,19 +1730,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1298-7-0-v20170401" }, "status": "READY", - "archiveSizeBytes": "210865263", - "diskSizeGb": "9" + "archiveSizeBytes": "370942193", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1298-6-0-v20170315", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-0-0-v20141117", - "id": "8506154037185657987", - "creationTimestamp": "2014-11-17T10:16:15.255-08:00", - "name": "coreos-beta-494-0-0-v20141117", - "description": "CoreOS beta 494.0.0", + "id": "6014865507167191078", + "creationTimestamp": "2017-03-31T18:13:45.043-07:00", + "name": "coreos-stable-1298-7-0-v20170401", + "description": "CoreOS, CoreOS stable, 1298.7.0, amd64-usr published on 2017-04-01", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1233,19 +1755,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1353-6-0-v20170425" }, "status": "READY", - "archiveSizeBytes": "217341172", - "diskSizeGb": "9" + "archiveSizeBytes": "365081311", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1298-7-0-v20170401", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-1-0-v20141124", - "id": "2468958217438571789", - "creationTimestamp": "2014-11-24T14:02:13.599-08:00", - "name": "coreos-beta-494-1-0-v20141124", - "description": "CoreOS beta 494.1.0", + "id": "3827656126096345475", + "creationTimestamp": "2017-04-25T13:54:05.060-07:00", + "name": "coreos-stable-1353-6-0-v20170425", + "description": "CoreOS, CoreOS stable, 1353.6.0, amd64-usr published on 2017-04-25", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1253,19 +1780,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1353-7-0-v20170427" }, "status": "READY", - "archiveSizeBytes": "217657127", - "diskSizeGb": "9" + "archiveSizeBytes": "374909574", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1353-6-0-v20170425", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-4-0-v20141204", - "id": "3901953085416533827", - "creationTimestamp": "2014-12-04T15:52:43.520-08:00", - "name": "coreos-beta-494-4-0-v20141204", - "description": "CoreOS beta 494.4.0", + "id": "8122013459453638362", + "creationTimestamp": "2017-04-26T18:24:05.794-07:00", + "name": "coreos-stable-1353-7-0-v20170427", + "description": "CoreOS, CoreOS stable, 1353.7.0, amd64-usr published on 2017-04-27", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1273,19 +1805,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1353-8-0-v20170531" }, "status": "READY", - "archiveSizeBytes": "217129760", - "diskSizeGb": "9" + "archiveSizeBytes": "374887805", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1353-7-0-v20170427", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-494-5-0-v20141211", - "id": "11721688361939601432", - "creationTimestamp": "2014-12-11T13:07:37.057-08:00", - "name": "coreos-beta-494-5-0-v20141211", - "description": "CoreOS beta 494.5.0", + "id": "3555354078563511800", + "creationTimestamp": "2017-05-30T17:49:27.320-07:00", + "name": "coreos-stable-1353-8-0-v20170531", + "description": "CoreOS, CoreOS stable, 1353.8.0, amd64-usr published on 2017-05-31", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1293,19 +1830,24 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-522-2-0-v20141218" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1409-2-0-v20170620" }, "status": "READY", - "archiveSizeBytes": "217091382", - "diskSizeGb": "9" + "archiveSizeBytes": "374924926", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1353-8-0-v20170531", + "labelFingerprint": "42WmSpB8rSM=" }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-522-2-0-v20141218", - "id": "18164147672853893958", - "creationTimestamp": "2014-12-18T13:29:11.177-08:00", - "name": "coreos-beta-522-2-0-v20141218", - "description": "CoreOS beta 522.2.0", + "id": "3615899944778780014", + "creationTimestamp": "2017-06-20T12:12:02.025-07:00", + "name": "coreos-stable-1409-2-0-v20170620", + "description": "CoreOS, CoreOS stable, 1409.2.0, amd64-usr published on 2017-06-20", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1313,35 +1855,59 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-522-3-0-v20141226" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1409-5-0-v20170623" }, "status": "READY", - "archiveSizeBytes": "220704959", - "diskSizeGb": "9" + "archiveSizeBytes": "381081255", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1409-2-0-v20170620", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-522-3-0-v20141226", - "id": "14171939663085407486", - "creationTimestamp": "2014-12-26T15:04:01.237-08:00", - "name": "coreos-beta-522-3-0-v20141226", - "description": "CoreOS beta 522.3.0", + "id": "5675333718078771517", + "creationTimestamp": "2017-06-22T18:33:06.951-07:00", + "name": "coreos-stable-1409-5-0-v20170623", + "description": "CoreOS, CoreOS stable, 1409.5.0, amd64-usr published on 2017-06-23", "sourceType": "RAW", "rawDisk": { "source": "", "containerType": "TAR" }, + "deprecated": { + "state": "DEPRECATED", + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1409-6-0-v20170706" + }, "status": "READY", - "archiveSizeBytes": "220932284", - "diskSizeGb": "9" + "archiveSizeBytes": "382278050", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1409-5-0-v20170623", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-367-1-0-v20140724", - "id": "2599882482782401961", - "creationTimestamp": "2014-07-24T09:50:20.940-07:00", - "name": "coreos-stable-367-1-0-v20140724", - "description": "CoreOS stable 367.1.0", + "id": "2558058712479776125", + "creationTimestamp": "2017-07-06T11:38:10.081-07:00", + "name": "coreos-stable-1409-6-0-v20170706", + "description": "CoreOS, CoreOS stable, 1409.6.0, amd64-usr published on 2017-07-06", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1349,19 +1915,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-444-5-0-v20141016" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1409-7-0-v20170719" }, "status": "READY", - "archiveSizeBytes": "202820713", - "diskSizeGb": "9" + "archiveSizeBytes": "381072802", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1409-6-0-v20170706", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-410-0-0-v20140902", - "id": "5505931863348151915", - "creationTimestamp": "2014-09-02T09:51:46.932-07:00", - "name": "coreos-stable-410-0-0-v20140902", - "description": "CoreOS stable 410.0.0", + "id": "1650233566770107587", + "creationTimestamp": "2017-07-19T11:51:24.316-07:00", + "name": "coreos-stable-1409-7-0-v20170719", + "description": "CoreOS, CoreOS stable, 1409.7.0, amd64-usr published on 2017-07-19", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1369,19 +1945,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-444-5-0-v20141016" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1409-8-0-v20170810" }, "status": "READY", - "archiveSizeBytes": "218443267", - "diskSizeGb": "9" + "archiveSizeBytes": "381212066", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1409-7-0-v20170719", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-410-1-0-v20140926", - "id": "8454778862121230636", - "creationTimestamp": "2014-09-26T09:02:19.616-07:00", - "name": "coreos-stable-410-1-0-v20140926", - "description": "CoreOS stable 410.1.0", + "id": "5125114056300125467", + "creationTimestamp": "2017-08-10T15:53:40.530-07:00", + "name": "coreos-stable-1409-8-0-v20170810", + "description": "CoreOS, CoreOS stable, 1409.8.0, amd64-usr published on 2017-08-10", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1389,19 +1975,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-444-5-0-v20141016" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1409-9-0-v20170814" }, "status": "READY", - "archiveSizeBytes": "218502022", - "diskSizeGb": "9" + "archiveSizeBytes": "381134504", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1409-8-0-v20170810", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-410-2-0-v20141002", - "id": "1371462217027433294", - "creationTimestamp": "2014-10-01T21:02:17.237-07:00", - "name": "coreos-stable-410-2-0-v20141002", - "description": "CoreOS stable 410.2.0", + "id": "4439862469585552288", + "creationTimestamp": "2017-08-14T12:43:11.593-07:00", + "name": "coreos-stable-1409-9-0-v20170814", + "description": "CoreOS, CoreOS stable, 1409.9.0, amd64-usr published on 2017-08-14", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1409,19 +2005,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-444-5-0-v20141016" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1465-6-0-v20170817" }, "status": "READY", - "archiveSizeBytes": "218492705", - "diskSizeGb": "9" + "archiveSizeBytes": "377216673", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1409-9-0-v20170814", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-444-4-0-v20141010", - "id": "12833596236536500344", - "creationTimestamp": "2014-10-10T12:03:27.815-07:00", - "name": "coreos-stable-444-4-0-v20141010", - "description": "CoreOS stable 444.4.0", + "id": "5563715618352948145", + "creationTimestamp": "2017-08-17T11:15:58.673-07:00", + "name": "coreos-stable-1465-6-0-v20170817", + "description": "CoreOS, CoreOS stable, 1465.6.0, amd64-usr published on 2017-08-17", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1429,19 +2035,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-444-5-0-v20141016" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1465-7-0-v20170906" }, "status": "READY", - "archiveSizeBytes": "210658089", - "diskSizeGb": "9" + "archiveSizeBytes": "392304041", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1465-6-0-v20170817", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-444-5-0-v20141016", - "id": "10607414105577455345", - "creationTimestamp": "2014-10-16T13:19:45.855-07:00", - "name": "coreos-stable-444-5-0-v20141016", - "description": "CoreOS stable 444.5.0", + "id": "1127922138626259762", + "creationTimestamp": "2017-09-06T12:00:46.001-07:00", + "name": "coreos-stable-1465-7-0-v20170906", + "description": "CoreOS, CoreOS stable, 1465.7.0, amd64-usr published on 2017-09-06", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1449,19 +2065,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-494-3-0-v20141203" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1465-8-0-v20170921" }, "status": "READY", - "archiveSizeBytes": "210821109", - "diskSizeGb": "9" + "archiveSizeBytes": "393191296", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1465-7-0-v20170906", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-494-3-0-v20141203", - "id": "15950760641457393522", - "creationTimestamp": "2014-12-03T10:58:23.402-08:00", - "name": "coreos-stable-494-3-0-v20141203", - "description": "CoreOS stable 494.3.0", + "id": "6610501905484247127", + "creationTimestamp": "2017-09-21T07:37:44.728-07:00", + "name": "coreos-stable-1465-8-0-v20170921", + "description": "CoreOS, CoreOS stable, 1465.8.0, amd64-usr published on 2017-09-21", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1469,19 +2095,29 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-494-4-0-v20141204" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1520-5-0-v20171011" }, "status": "READY", - "archiveSizeBytes": "216979469", - "diskSizeGb": "9" + "archiveSizeBytes": "393742208", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1465-8-0-v20170921", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-494-4-0-v20141204", - "id": "15925813888167964156", - "creationTimestamp": "2014-12-04T12:34:55.496-08:00", - "name": "coreos-stable-494-4-0-v20141204", - "description": "CoreOS stable 494.4.0", + "id": "9017650089265725093", + "creationTimestamp": "2017-10-11T09:01:14.919-07:00", + "name": "coreos-stable-1520-5-0-v20171011", + "description": "CoreOS, CoreOS stable, 1520.5.0, amd64-usr published on 2017-10-11", "sourceType": "RAW", "rawDisk": { "source": "", @@ -1489,27 +2125,49 @@ }, "deprecated": { "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-494-5-0-v20141215" + "replacement": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1520-6-0-v20171012" }, "status": "READY", - "archiveSizeBytes": "217085384", - "diskSizeGb": "9" + "archiveSizeBytes": "450138752", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1520-5-0-v20171011", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] }, { "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-494-5-0-v20141215", - "id": "8254035885037496682", - "creationTimestamp": "2014-12-15T11:57:55.509-08:00", - "name": "coreos-stable-494-5-0-v20141215", - "description": "CoreOS stable 494.5.0", + "id": "5454100008489088098", + "creationTimestamp": "2017-10-12T13:03:25.293-07:00", + "name": "coreos-stable-1520-6-0-v20171012", + "description": "CoreOS, CoreOS stable, 1520.6.0, amd64-usr published on 2017-10-12", "sourceType": "RAW", "rawDisk": { "source": "", "containerType": "TAR" }, "status": "READY", - "archiveSizeBytes": "217069504", - "diskSizeGb": "9" + "archiveSizeBytes": "445453184", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1520-6-0-v20171012", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] } - ] + ], + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images" } diff --git a/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images_family_coreos_beta.json b/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images_family_coreos_beta.json new file mode 100644 index 0000000000..d76cdf4baa --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images_family_coreos_beta.json @@ -0,0 +1,17 @@ +{ + "kind": "compute#image", + "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-beta-522-3-0-v20141226", + "id": "14171939663085407486", + "creationTimestamp": "2014-12-26T15:04:01.237-08:00", + "name": "coreos-beta-522-3-0-v20141226", + "description": "CoreOS beta 522.3.0", + "family": "coreos-beta", + "sourceType": "RAW", + "rawDisk": { + "source": "", + "containerType": "TAR" + }, + "status": "READY", + "archiveSizeBytes": "220932284", + "diskSizeGb": "9" +} diff --git a/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images_family_coreos_stable.json b/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images_family_coreos_stable.json new file mode 100644 index 0000000000..cf55104f16 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images_family_coreos_stable.json @@ -0,0 +1,26 @@ +{ + "kind": "compute#image", + "id": "5454100008489088098", + "creationTimestamp": "2017-10-12T13:03:25.293-07:00", + "name": "coreos-stable-1520-6-0-v20171012", + "description": "CoreOS, CoreOS stable, 1520.6.0, amd64-usr published on 2017-10-12", + "sourceType": "RAW", + "rawDisk": { + "source": "", + "containerType": "TAR" + }, + "status": "READY", + "archiveSizeBytes": "445453184", + "diskSizeGb": "9", + "licenses": [ + "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/licenses/coreos-stable" + ], + "family": "coreos-stable", + "selfLink": "https://www.googleapis.com/compute/beta/projects/coreos-cloud/global/images/coreos-stable-1520-6-0-v20171012", + "labelFingerprint": "42WmSpB8rSM=", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + } + ] + } diff --git a/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_licenses_coreos_stable.json b/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_licenses_coreos_stable.json new file mode 100644 index 0000000000..b4dd005b2b --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_licenses_coreos_stable.json @@ -0,0 +1,6 @@ +{ + "kind": "compute#license", + "selfLink": "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/licenses/coreos-stable", + "name": "coreos-stable", + "chargesUseFee": true +} diff --git a/libcloud/test/compute/fixtures/gce/projects_cos-cloud_global_images.json b/libcloud/test/compute/fixtures/gce/projects_cos-cloud_global_images.json new file mode 100644 index 0000000000..2c2780abe5 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_cos-cloud_global_images.json @@ -0,0 +1,90 @@ +{ + "kind": "compute#imageList", + "id": "projects/cos-cloud/global/images", + "items": [ + { + "archiveSizeBytes": "2781566400", + "creationTimestamp": "2018-03-16T11:58:21.963-07:00", + "description": "Google, Container-Optimized OS, 65-10323.55.0 beta, Kernel: ChromiumOS-4.4.111 Kubernetes: 1.8.7 Docker: 17.03.2", + "diskSizeGb": "10", + "family": "cos-beta", + "id": "7977998760666049826", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/cos-cloud/global/licenses/cos" + ], + "name": "cos-beta-65-10323-55-0", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/cos-cloud/global/images/cos-beta-65-10323-55-0", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "2904964800", + "creationTimestamp": "2018-03-16T11:46:19.959-07:00", + "description": "Google, Container-Optimized OS, 66-10452.13.0 dev, Kernel: ChromiumOS-4.14.22 Kubernetes: 1.9.3 Docker: 17.03.2", + "diskSizeGb": "10", + "family": "cos-dev", + "id": "5462067189945314836", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/cos-cloud/global/licenses/cos" + ], + "name": "cos-dev-66-10452-13-0", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/cos-cloud/global/images/cos-dev-66-10452-13-0", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "2862244800", + "creationTimestamp": "2018-01-19T10:59:30.098-08:00", + "description": "Google, Container-Optimized OS, 63-10032.88.0 stable, Kernel: ChromiumOS-4.4.86 Kubernetes: 1.7.8 Docker: 17.03.2", + "diskSizeGb": "10", + "family": "cos-stable", + "id": "9037695461801066238", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/cos-cloud/global/licenses/cos" + ], + "name": "cos-stable-63-10032-88-0", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/cos-cloud/global/images/cos-stable-63-10032-88-0", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "2776416960", + "creationTimestamp": "2018-02-02T15:15:12.894-08:00", + "description": "Google, Container-Optimized OS, 64-10176.62.0 stable, Kernel: ChromiumOS-4.4.96 Kubernetes: 1.8.7 Docker: 17.03.2", + "diskSizeGb": "10", + "family": "cos-stable", + "id": "5241841702474960879", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/cos-cloud/global/licenses/cos" + ], + "name": "cos-stable-64-10176-62-0", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/cos-cloud/global/images/cos-stable-64-10176-62-0", + "sourceType": "RAW", + "status": "READY" + } + ] +} diff --git a/libcloud/test/compute/fixtures/gce/projects_gce-nvme_global_images.json b/libcloud/test/compute/fixtures/gce/projects_gce-nvme_global_images.json deleted file mode 100644 index e80287832c..0000000000 --- a/libcloud/test/compute/fixtures/gce/projects_gce-nvme_global_images.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "kind": "compute#imageList", - "selfLink": "https://www.googleapis.com/compute/v1/projects/gce-nvme/global/images", - "id": "projects/gce-nvme/global/images", - "items": [ - { - "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/gce-nvme/global/images/nvme-backports-debian-7-wheezy-v20140904", - "id": "11933993573261788709", - "creationTimestamp": "2014-11-05T20:09:29.302-08:00", - "name": "nvme-backports-debian-7-wheezy-v20140904", - "description": "NVMe optimized Debian GNU/Linux 7.6 (wheezy) amd64 with backports kernel and SSH packages built on 2014-09-04", - "sourceType": "RAW", - "rawDisk": { - "source": "", - "containerType": "TAR" - }, - "status": "READY", - "archiveSizeBytes": "158683343", - "diskSizeGb": "10" - }, - { - "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/gce-nvme/global/images/nvme-backports-debian-7-wheezy-v20140926", - "id": "16689990597272015714", - "creationTimestamp": "2014-10-20T22:01:24.039-07:00", - "name": "nvme-backports-debian-7-wheezy-v20140926", - "description": "NVMe optimized Debian GNU/Linux 7.6 (wheezy) amd64 with backports kernel and SSH packages built on 2014-09-26", - "sourceType": "RAW", - "rawDisk": { - "source": "", - "containerType": "TAR" - }, - "status": "READY", - "archiveSizeBytes": "221456136", - "diskSizeGb": "10" - }, - { - "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/gce-nvme/global/images/nvme-backports-debian-7-wheezy-v20141108", - "id": "9219956677399420856", - "creationTimestamp": "2014-11-14T10:55:03.809-08:00", - "name": "nvme-backports-debian-7-wheezy-v20141108", - "description": "NVMe optimized Debian GNU/Linux 7.6 (wheezy) amd64 with backports kernel and SSH packages built on 2014-11-08", - "sourceType": "RAW", - "rawDisk": { - "source": "", - "containerType": "TAR" - }, - "status": "READY", - "archiveSizeBytes": "162245079", - "diskSizeGb": "10" - } - ] -} diff --git a/libcloud/test/compute/fixtures/gce/projects_google-containers_global_images.json b/libcloud/test/compute/fixtures/gce/projects_google-containers_global_images.json deleted file mode 100644 index 08c6cf59e9..0000000000 --- a/libcloud/test/compute/fixtures/gce/projects_google-containers_global_images.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "kind": "compute#imageList", - "selfLink": "https://www.googleapis.com/compute/v1/projects/google-containers/global/images", - "id": "projects/google-containers/global/images", - "items": [ - { - "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140522", - "id": "12928746743513706688", - "creationTimestamp": "2014-05-21T15:30:01.045-07:00", - "name": "container-vm-v20140522", - "description": "Google container VM image, GlueCon 2014 release", - "sourceType": "RAW", - "rawDisk": { - "source": "", - "containerType": "TAR" - }, - "deprecated": { - "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140522" - }, - "status": "READY", - "archiveSizeBytes": "396961200", - "diskSizeGb": "10" - }, - { - "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140624", - "id": "17637324906060386740", - "creationTimestamp": "2014-06-24T17:59:38.240-07:00", - "name": "container-vm-v20140624", - "description": "Google container VM image, Google I/O 2014 release", - "sourceType": "RAW", - "rawDisk": { - "source": "", - "containerType": "TAR" - }, - "deprecated": { - "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140624" - }, - "status": "READY", - "archiveSizeBytes": "391233093", - "diskSizeGb": "10" - }, - { - "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140710", - "id": "17658123443453052547", - "creationTimestamp": "2014-07-15T17:29:02.737-07:00", - "name": "container-vm-v20140710", - "description": "Google container VM image", - "sourceType": "RAW", - "rawDisk": { - "source": "", - "containerType": "TAR" - }, - "deprecated": { - "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140710" - }, - "status": "READY", - "archiveSizeBytes": "428253862", - "diskSizeGb": "10" - }, - { - "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140731", - "id": "7675862044791361451", - "creationTimestamp": "2014-08-01T09:41:06.107-07:00", - "name": "container-vm-v20140731", - "description": "Google container VM image", - "sourceType": "RAW", - "rawDisk": { - "source": "", - "containerType": "TAR" - }, - "deprecated": { - "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140731" - }, - "status": "READY", - "archiveSizeBytes": "403951165", - "diskSizeGb": "10" - }, - { - "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140826", - "id": "5337588031210316441", - "creationTimestamp": "2014-08-26T16:19:17.533-07:00", - "name": "container-vm-v20140826", - "description": "Google container VM image", - "sourceType": "RAW", - "rawDisk": { - "source": "", - "containerType": "TAR" - }, - "deprecated": { - "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140826" - }, - "status": "READY", - "archiveSizeBytes": "420545090", - "diskSizeGb": "10" - }, - { - "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140925", - "id": "7326458020538492469", - "creationTimestamp": "2014-09-25T14:23:38.865-07:00", - "name": "container-vm-v20140925", - "description": "Google container VM image", - "sourceType": "RAW", - "rawDisk": { - "source": "", - "containerType": "TAR" - }, - "deprecated": { - "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140925" - }, - "status": "READY", - "archiveSizeBytes": "432272421", - "diskSizeGb": "10" - }, - { - "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140929", - "id": "17245742661521590081", - "creationTimestamp": "2014-09-29T13:49:23.330-07:00", - "name": "container-vm-v20140929", - "description": "Google container VM image", - "sourceType": "RAW", - "rawDisk": { - "source": "", - "containerType": "TAR" - }, - "deprecated": { - "state": "DEPRECATED", - "replacement": "https://content.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20140929" - }, - "status": "READY", - "archiveSizeBytes": "422162733", - "diskSizeGb": "10" - }, - { - "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20141016", - "id": "857872787891330870", - "creationTimestamp": "2014-10-22T13:40:01.068-07:00", - "name": "container-vm-v20141016", - "description": "Google container VM image", - "sourceType": "RAW", - "rawDisk": { - "source": "", - "containerType": "TAR" - }, - "status": "READY", - "archiveSizeBytes": "432768815", - "diskSizeGb": "10" - }, - { - "kind": "compute#image", - "selfLink": "https://www.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20141208", - "id": "8037634834499556312", - "creationTimestamp": "2014-12-09T15:57:34.413-08:00", - "name": "container-vm-v20141208", - "description": "Google container VM image", - "sourceType": "RAW", - "rawDisk": { - "source": "", - "containerType": "TAR" - }, - "status": "READY", - "archiveSizeBytes": "413371239", - "diskSizeGb": "10" - } - ] -} diff --git a/libcloud/test/compute/fixtures/gce/projects_other_name_global_networks_cf.json b/libcloud/test/compute/fixtures/gce/projects_other_name_global_networks_cf.json new file mode 100644 index 0000000000..63e99d354b --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_other_name_global_networks_cf.json @@ -0,0 +1,11 @@ +{ + "kind": "compute#network", + "id": "5125152985904090792", + "creationTimestamp": "2016-03-25T05:34:15.077-07:00", + "name": "cf", + "selfLink": "https://www.googleapis.com/compute/v1/projects/other_name/global/networks/cf", + "autoCreateSubnetworks": true, + "subnetworks": [ + "https://www.googleapis.com/compute/v1/projects/other_name/regions/us-central1/subnetworks/cf-972cf02e6ad49114" + ] +} diff --git a/libcloud/test/compute/fixtures/gce/projects_other_name_global_networks_lcnetwork.json b/libcloud/test/compute/fixtures/gce/projects_other_name_global_networks_lcnetwork.json new file mode 100644 index 0000000000..e48ab3414d --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_other_name_global_networks_lcnetwork.json @@ -0,0 +1,10 @@ +{ + "IPv4Range": "10.11.0.0/16", + "creationTimestamp": "2013-06-26T10:05:03.500-07:00", + "gatewayIPv4": "10.11.0.1", + "description": "A custom network", + "id": "16211908079305042870", + "kind": "compute#network", + "name": "lcnetwork", + "selfLink": "https://www.googleapis.com/compute/v1/projects/other_name/global/networks/lcnetwork" +} diff --git a/libcloud/test/compute/fixtures/gce/projects_other_name_global_networks_shared_network_for_mig.json b/libcloud/test/compute/fixtures/gce/projects_other_name_global_networks_shared_network_for_mig.json new file mode 100644 index 0000000000..ca8c68cda2 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_other_name_global_networks_shared_network_for_mig.json @@ -0,0 +1,11 @@ +{ + "kind": "compute#network", + "id": "5125152985904090796", + "creationTimestamp": "2016-03-25T05:34:15.077-07:00", + "name": "shared_network_for_mig", + "selfLink": "https://www.googleapis.com/compute/v1/projects/other_name/global/networks/shared_network_for_mig", + "autoCreateSubnetworks": true, + "subnetworks": [ + "https://www.googleapis.com/compute/v1/projects/other_name/regions/us-central1/subnetworks/shared_subnetwork_for_mig" + ] +} diff --git a/libcloud/test/compute/fixtures/gce/projects_other_name_regions_us-central1.json b/libcloud/test/compute/fixtures/gce/projects_other_name_regions_us-central1.json new file mode 100644 index 0000000000..1e41eb0500 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_other_name_regions_us-central1.json @@ -0,0 +1,65 @@ +{ + "kind": "compute#region", + "id": "1000", + "creationTimestamp": "2014-05-30T18:35:16.413-07:00", + "name": "us-central1", + "description": "us-central1", + "status": "UP", + "zones": [ + "https://www.googleapis.com/compute/v1/projects/other_name/zones/us-central1-a", + "https://www.googleapis.com/compute/v1/projects/other_name/zones/us-central1-b" + ], + "quotas": [ + { + "metric": "CPUS", + "limit": 1050.0, + "usage": 30.0 + }, + { + "metric": "DISKS_TOTAL_GB", + "limit": 20000.0, + "usage": 344.0 + }, + { + "metric": "STATIC_ADDRESSES", + "limit": 10.0, + "usage": 2.0 + }, + { + "metric": "IN_USE_ADDRESSES", + "limit": 1050.0, + "usage": 11.0 + }, + { + "metric": "SSD_TOTAL_GB", + "limit": 2048.0, + "usage": 500.0 + }, + { + "metric": "LOCAL_SSD_TOTAL_GB", + "limit": 10240.0, + "usage": 0.0 + }, + { + "metric": "INSTANCE_GROUPS", + "limit": 100.0, + "usage": 0.0 + }, + { + "metric": "INSTANCE_GROUP_MANAGERS", + "limit": 50.0, + "usage": 0.0 + }, + { + "metric": "INSTANCES", + "limit": 10500.0, + "usage": 11.0 + }, + { + "metric": "AUTOSCALERS", + "limit": 50.0, + "usage": 0.0 + } + ], + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1" +} diff --git a/libcloud/test/compute/fixtures/gce/projects_other_name_regions_us-central1_subnetworks_cf_972cf02e6ad49114.json b/libcloud/test/compute/fixtures/gce/projects_other_name_regions_us-central1_subnetworks_cf_972cf02e6ad49114.json new file mode 100644 index 0000000000..56c8e7d165 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_other_name_regions_us-central1_subnetworks_cf_972cf02e6ad49114.json @@ -0,0 +1,12 @@ +{ + "status": "DONE", + "kind": "compute#subnetwork", + "id": "4297043163355844285", + "creationTimestamp": "2016-03-25T05:34:27.209-07:00", + "gatewayAddress": "10.128.0.1", + "name": "cf-972cf02e6ad49114", + "network": "https://www.googleapis.com/compute/v1/projects/other_name/global/networks/cf", + "ipCidrRange": "10.128.0.0/20", + "region": "https://www.googleapis.com/compute/v1/projects/other_name/regions/us-central1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/other_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112" +} diff --git a/libcloud/test/compute/fixtures/gce/projects_other_name_regions_us-central1_subnetworks_shared_subnetwork_for_mig.json b/libcloud/test/compute/fixtures/gce/projects_other_name_regions_us-central1_subnetworks_shared_subnetwork_for_mig.json new file mode 100644 index 0000000000..d7ec3baac6 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_other_name_regions_us-central1_subnetworks_shared_subnetwork_for_mig.json @@ -0,0 +1,12 @@ +{ + "status": "DONE", + "kind": "compute#subnetwork", + "id": "4297043163355844289", + "creationTimestamp": "2016-03-25T05:34:27.209-07:00", + "gatewayAddress": "10.128.0.1", + "name": "shared_subnetwork_for_mig", + "network": "https://www.googleapis.com/compute/v1/projects/other_name/global/networks/shared_network_for_mig", + "ipCidrRange": "10.128.0.0/20", + "region": "https://www.googleapis.com/compute/v1/projects/other_name/regions/us-central1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/other_name/regions/us-central1/subnetworks/shared_subnetwork_for_mig" +} diff --git a/libcloud/test/compute/fixtures/gce/projects_suse-byos-cloud_global_images.json b/libcloud/test/compute/fixtures/gce/projects_suse-byos-cloud_global_images.json new file mode 100644 index 0000000000..e4cc17034e --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_suse-byos-cloud_global_images.json @@ -0,0 +1,150 @@ +{ + "kind": "compute#imageList", + "id": "projects/suse-byos-cloud/global/images", + "items": [ + { + "archiveSizeBytes": "4903362048", + "creationTimestamp": "2018-01-04T15:38:28.707-08:00", + "description": "SUSE, SUSE Linux Enterprise Server 11 SP4 BYOS configuration, x86_64, built on 2018-01-04", + "diskSizeGb": "10", + "family": "sles-11-byos", + "id": "2387143735879336987", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "name": "sles-11-sp4-byos-v20180104", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/images/sles-11-sp4-byos-v20180104", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "3656075520", + "creationTimestamp": "2017-05-15T13:07:01.943-07:00", + "description": "SUSE, SUSE Linux Enterprise Server 12 SP2, x86_64, built on 2017-05-15", + "diskSizeGb": "10", + "family": "sles-12-byos", + "id": "3705265501102388362", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/licenses/sles-12-byos" + ], + "name": "sles-12-sp2-byos-v20170515", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/images/sles-12-sp2-byos-v20170515", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "10602881280", + "creationTimestamp": "2018-02-14T12:21:27.529-08:00", + "description": "SUSE, SUSE Linux Enterprise Server 12 SP2 For SAP BYOS configuration, x86_64, built on 2018-02-14", + "diskSizeGb": "10", + "family": "sles-12-sp2-sap-byos", + "id": "6191777507858523304", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/licenses/sles-sap-12-byos" + ], + "name": "sles-12-sp2-sap-byos-v20180214", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/images/sles-12-sp2-sap-byos-v20180214", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "6914937600", + "creationTimestamp": "2018-02-14T09:40:30.237-08:00", + "description": "SUSE, SUSE Linux Enterprise Server 12 SP3, x86_64, built on 2018-02-14", + "diskSizeGb": "10", + "family": "sles-12-byos", + "id": "1750160000940624482", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/licenses/sles-12-byos" + ], + "name": "sles-12-sp3-byos-v20180214", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/images/sles-12-sp3-byos-v20180214", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "10740059520", + "creationTimestamp": "2018-02-14T10:20:54.913-08:00", + "description": "SUSE, SUSE Linux Enterprise Server 12 SP3 For SAP BYOS configuration, x86_64, built on 2018-02-14", + "diskSizeGb": "10", + "family": "sles-12-sp3-sap-byos", + "id": "2521622434670035177", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/licenses/sles-sap-12-byos" + ], + "name": "sles-12-sp3-sap-byos-v20180214", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/images/sles-12-sp3-sap-byos-v20180214", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "8562081600", + "creationTimestamp": "2018-02-14T13:03:08.443-08:00", + "description": "SUSE, SUSE Manager 3.1 Proxy BYOS, x86_64 built on 2018-02-14, Based on SLES 12 SP2", + "diskSizeGb": "10", + "family": "suse-manager-proxy-byos", + "id": "3455542315608251107", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/licenses/suma-proxy-byos" + ], + "name": "suse-manager-3-1-proxy-byos-v20180214", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/images/suse-manager-3-1-proxy-byos-v20180214", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "15142568640", + "creationTimestamp": "2018-02-14T12:42:11.295-08:00", + "description": "SUSE, SUSE Manager 3.1 Server BYOS, x86_64 built on 2018-02-14, Based on SLES 12 SP2", + "diskSizeGb": "10", + "family": "suse-manager-server-byos", + "id": "5720192942026072525", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/licenses/suma-server-byos" + ], + "name": "suse-manager-3-1-server-byos-v20180214", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/suse-byos-cloud/global/images/suse-manager-3-1-server-byos-v20180214", + "sourceType": "RAW", + "status": "READY" + } + ] +} diff --git a/libcloud/test/compute/fixtures/gce/projects_suse-sap-cloud_global_images.json b/libcloud/test/compute/fixtures/gce/projects_suse-sap-cloud_global_images.json new file mode 100644 index 0000000000..3df484b812 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_suse-sap-cloud_global_images.json @@ -0,0 +1,48 @@ +{ + "kind": "compute#imageList", + "id": "projects/suse-sap-cloud/global/images", + "items": [ + { + "archiveSizeBytes": "10610274240", + "creationTimestamp": "2018-02-14T11:36:42.181-08:00", + "description": "SUSE, SUSE Linux Enterprise Server 12 SP2 For SAP, x86_64, built on 2018-02-14", + "diskSizeGb": "10", + "family": "sles-12-sp2-sap", + "id": "1678965261537456422", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/suse-sap-cloud/global/licenses/sles-sap-12" + ], + "name": "sles-12-sp2-sap-v20180214", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/suse-sap-cloud/global/images/sles-12-sp2-sap-v20180214", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "10651082880", + "creationTimestamp": "2018-02-14T09:25:13.871-08:00", + "description": "SUSE, SUSE Linux Enterprise Server 12 SP3 For SAP, x86_64, built on 2018-02-14", + "diskSizeGb": "10", + "family": "sles-12-sp3-sap", + "id": "1354274246585077270", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/suse-sap-cloud/global/licenses/sles-sap-12" + ], + "name": "sles-12-sp3-sap-v20180214", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/suse-sap-cloud/global/images/sles-12-sp3-sap-v20180214", + "sourceType": "RAW", + "status": "READY" + } + ] +} diff --git a/libcloud/test/compute/fixtures/gce/projects_windows-sql-cloud_global_images.json b/libcloud/test/compute/fixtures/gce/projects_windows-sql-cloud_global_images.json new file mode 100644 index 0000000000..7e915bbede --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/projects_windows-sql-cloud_global_images.json @@ -0,0 +1,600 @@ +{ + "kind": "compute#imageList", + "id": "projects/windows-sql-cloud/global/images", + "items": [ + { + "archiveSizeBytes": "292570851840", + "creationTimestamp": "2018-03-16T12:56:34.051-07:00", + "description": "Microsoft, SQL Server 2012 Enterprise, on Windows Server 2012 R2 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-ent-2012-win-2012-r2", + "guestOsFeatures": [ + { + "type": "WINDOWS" + }, + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "691184437710397342", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2012-enterprise", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2012-r2-dc" + ], + "name": "sql-2012-enterprise-windows-2012-r2-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2012-enterprise-windows-2012-r2-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "289458120960", + "creationTimestamp": "2018-03-16T12:56:34.100-07:00", + "description": "Microsoft, SQL Server 2012 Standard, on Windows Server 2012 R2 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-std-2012-win-2012-r2", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "WINDOWS" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "7039869042978561950", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2012-standard", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2012-r2-dc" + ], + "name": "sql-2012-standard-windows-2012-r2-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2012-standard-windows-2012-r2-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "281538677760", + "creationTimestamp": "2018-03-16T12:56:33.984-07:00", + "description": "Microsoft, SQL Server 2012 Web, on Windows Server 2012 R2 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-web-2012-win-2012-r2", + "guestOsFeatures": [ + { + "type": "WINDOWS" + }, + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "8315170259090907038", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2012-web", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2012-r2-dc" + ], + "name": "sql-2012-web-windows-2012-r2-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2012-web-windows-2012-r2-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "241746543360", + "creationTimestamp": "2018-03-16T12:56:31.079-07:00", + "description": "Microsoft, SQL Server 2012 Enterprise, on Windows Server 2012 R2 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-ent-2014-win-2012-r2", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "WINDOWS" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "6850934007153139585", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2014-enterprise", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2012-r2-dc" + ], + "name": "sql-2014-enterprise-windows-2012-r2-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2014-enterprise-windows-2012-r2-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "215371714560", + "creationTimestamp": "2018-03-16T12:56:34.317-07:00", + "description": "Microsoft, SQL Server 2012 Enterprise, on Windows Server 2016 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-ent-2014-win-2016", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "WINDOWS" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "8779506358941753246", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2014-enterprise", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2016-dc" + ], + "name": "sql-2014-enterprise-windows-2016-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2014-enterprise-windows-2016-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "241815690240", + "creationTimestamp": "2018-03-16T12:56:34.015-07:00", + "description": "Microsoft, SQL Server 2014 Standard, on Windows Server 2012 R2 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-std-2014-win-2012-r2", + "guestOsFeatures": [ + { + "type": "WINDOWS" + }, + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "2727026445279928222", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2014-standard", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2012-r2-dc" + ], + "name": "sql-2014-standard-windows-2012-r2-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2014-standard-windows-2012-r2-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "235978583040", + "creationTimestamp": "2018-03-16T12:56:34.136-07:00", + "description": "Microsoft, SQL Server 2014 Web, on Windows Server 2012 R2 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-web-2014-win-2012-r2", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "WINDOWS" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "8854164671641526174", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2014-web", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2012-r2-dc" + ], + "name": "sql-2014-web-windows-2012-r2-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2014-web-windows-2012-r2-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "275054722560", + "creationTimestamp": "2018-03-16T12:56:34.145-07:00", + "description": "Microsoft, SQL Server 2016 Enterprise, on Windows Server 2012 R2 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-ent-2016-win-2012-r2", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "WINDOWS" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "7568452089731456926", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2016-enterprise", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2012-r2-dc" + ], + "name": "sql-2016-enterprise-windows-2012-r2-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2016-enterprise-windows-2012-r2-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "217748267520", + "creationTimestamp": "2018-03-16T12:56:34.162-07:00", + "description": "Microsoft, SQL Server 2016 Enterprise, on Windows Server 2016 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-ent-2016-win-2016", + "guestOsFeatures": [ + { + "type": "WINDOWS" + }, + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "8158037467522506654", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2016-enterprise", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2016-dc" + ], + "name": "sql-2016-enterprise-windows-2016-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2016-enterprise-windows-2016-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "275475156480", + "creationTimestamp": "2018-03-16T12:56:34.135-07:00", + "description": "Microsoft, SQL Server 2016 Standard, on Windows Server 2012 R2 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-std-2016-win-2012-r2", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "WINDOWS" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "7321671631204622238", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2016-standard", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2012-r2-dc" + ], + "name": "sql-2016-standard-windows-2012-r2-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2016-standard-windows-2012-r2-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "216044855040", + "creationTimestamp": "2018-03-16T12:56:34.139-07:00", + "description": "Microsoft, SQL Server 2016 Standard, on Windows Server 2016 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-std-2016-win-2016", + "guestOsFeatures": [ + { + "type": "WINDOWS" + }, + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "7345241359458082718", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2016-standard", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2016-dc" + ], + "name": "sql-2016-standard-windows-2016-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2016-standard-windows-2016-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "257308473600", + "creationTimestamp": "2018-03-16T12:56:34.090-07:00", + "description": "Microsoft, SQL Server 2016 Web, on Windows Server 2012 R2 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-web-2016-win-2012-r2", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "WINDOWS" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "5306288240788086686", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2016-web", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2012-r2-dc" + ], + "name": "sql-2016-web-windows-2012-r2-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2016-web-windows-2012-r2-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "206679609600", + "creationTimestamp": "2018-03-16T12:56:34.116-07:00", + "description": "Microsoft, SQL Server 2016 Web, on Windows Server 2016 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-web-2016-win-2016", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "WINDOWS" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "3442119052452011934", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2016-web", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2016-dc" + ], + "name": "sql-2016-web-windows-2016-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2016-web-windows-2016-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "180692828160", + "creationTimestamp": "2018-03-16T12:56:33.957-07:00", + "description": "Microsoft, SQL Server 2017 Enterprise, on Windows Server 2016 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-ent-2017-win-2016", + "guestOsFeatures": [ + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "WINDOWS" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "5009147572728733598", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2017-enterprise", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2016-dc" + ], + "name": "sql-2017-enterprise-windows-2016-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2017-enterprise-windows-2016-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "186363325440", + "creationTimestamp": "2018-03-16T12:56:33.978-07:00", + "description": "Microsoft, SQL Server 2017 Express, on Windows Server 2012 R2 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-exp-2017-win-2012-r2", + "guestOsFeatures": [ + { + "type": "WINDOWS" + }, + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "5306872833081712542", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2017-express", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2012-r2-dc" + ], + "name": "sql-2017-express-windows-2012-r2-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2017-express-windows-2012-r2-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "161739521280", + "creationTimestamp": "2018-03-16T12:56:33.964-07:00", + "description": "Microsoft, SQL Server 2017 Express, on Windows Server 2016 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-exp-2017-win-2016", + "guestOsFeatures": [ + { + "type": "WINDOWS" + }, + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "2606423252507139998", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2017-express", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2016-dc" + ], + "name": "sql-2017-express-windows-2016-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2017-express-windows-2016-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "180530031360", + "creationTimestamp": "2018-03-16T12:56:33.960-07:00", + "description": "Microsoft, SQL Server 2017 Standard, on Windows Server 2016 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-std-2017-win-2016", + "guestOsFeatures": [ + { + "type": "WINDOWS" + }, + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "7610921752851488670", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2017-standard", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2016-dc" + ], + "name": "sql-2017-standard-windows-2016-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2017-standard-windows-2016-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + }, + { + "archiveSizeBytes": "176303884800", + "creationTimestamp": "2018-03-16T12:56:34.055-07:00", + "description": "Microsoft, SQL Server 2017 Web, on Windows Server 2016 Datacenter, x64 built on 20180313", + "diskSizeGb": "50", + "family": "sql-web-2017-win-2016", + "guestOsFeatures": [ + { + "type": "WINDOWS" + }, + { + "type": "VIRTIO_SCSI_MULTIQUEUE" + }, + { + "type": "MULTI_IP_SUBNET" + } + ], + "id": "8377634188974727070", + "kind": "compute#image", + "labelFingerprint": "42WmSpB8rSM=", + "licenses": [ + "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2017-web", + "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2016-dc" + ], + "name": "sql-2017-web-windows-2016-dc-v20180313", + "rawDisk": { + "containerType": "TAR", + "source": "" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/images/sql-2017-web-windows-2016-dc-v20180313", + "sourceType": "RAW", + "status": "READY" + } + ] +} diff --git a/libcloud/test/compute/fixtures/gce/regions-paged-1.json b/libcloud/test/compute/fixtures/gce/regions-paged-1.json new file mode 100644 index 0000000000..790f31ba03 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions-paged-1.json @@ -0,0 +1,97 @@ +{ + "kind": "compute#regionList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions", + "id": "projects/project_name/regions", + "items": [ + { + "kind": "compute#region", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/asia-east1", + "id": "1220", + "creationTimestamp": "2014-04-11T13:47:12.495-07:00", + "name": "asia-east1", + "description": "asia-east1", + "status": "UP", + "zones": [ + "https://www.googleapis.com/compute/v1/projects/project_name/zones/asia-east1-a" + ], + "quotas": [ + { + "metric": "CPUS", + "limit": 24.0, + "usage": 0.0 + }, + { + "metric": "DISKS_TOTAL_GB", + "limit": 5120.0, + "usage": 0.0 + }, + { + "metric": "STATIC_ADDRESSES", + "limit": 7.0, + "usage": 0.0 + }, + { + "metric": "IN_USE_ADDRESSES", + "limit": 23.0, + "usage": 0.0 + }, + { + "metric": "SSD_TOTAL_GB", + "limit": 1024.0, + "usage": 0.0 + }, + { + "metric": "LOCAL_SSD_TOTAL_GB", + "limit": 1500.0, + "usage": 0.0 + } + ] + }, + { + "kind": "compute#region", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/europe-west1", + "id": "1100", + "creationTimestamp": "2014-04-11T13:47:12.495-07:00", + "name": "europe-west1", + "description": "europe-west1", + "status": "UP", + "zones": [ + "https://www.googleapis.com/compute/v1/projects/project_name/zones/europe-west1-a", + "https://www.googleapis.com/compute/v1/projects/project_name/zones/europe-west1-b" + ], + "quotas": [ + { + "metric": "CPUS", + "limit": 24.0, + "usage": 0.0 + }, + { + "metric": "DISKS_TOTAL_GB", + "limit": 5120.0, + "usage": 0.0 + }, + { + "metric": "STATIC_ADDRESSES", + "limit": 7.0, + "usage": 0.0 + }, + { + "metric": "IN_USE_ADDRESSES", + "limit": 23.0, + "usage": 0.0 + }, + { + "metric": "SSD_TOTAL_GB", + "limit": 1024.0, + "usage": 0.0 + }, + { + "metric": "LOCAL_SSD_TOTAL_GB", + "limit": 1500.0, + "usage": 0.0 + } + ] + } + ], + "nextPageToken": "CjQIz5W-w6HRxAI6KQoCGAEKAiAACgIYAQoCIAAKAhgTCg4qDGV1cm9wZS13ZXN0MQoDIMwI" +} diff --git a/libcloud/test/compute/fixtures/gce/regions-paged-2.json b/libcloud/test/compute/fixtures/gce/regions-paged-2.json new file mode 100644 index 0000000000..d99ea6d341 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions-paged-2.json @@ -0,0 +1,52 @@ +{ + "kind": "compute#regionList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions", + "id": "projects/project_name/regions", + "items": [ + { + "kind": "compute#region", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1", + "id": "1000", + "creationTimestamp": "2014-04-11T13:47:12.495-07:00", + "name": "us-central1", + "description": "us-central1", + "status": "UP", + "zones": [ + "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b" + ], + "quotas": [ + { + "metric": "CPUS", + "limit": 24.0, + "usage": 1.0 + }, + { + "metric": "DISKS_TOTAL_GB", + "limit": 5120.0, + "usage": 60.0 + }, + { + "metric": "STATIC_ADDRESSES", + "limit": 7.0, + "usage": 1.0 + }, + { + "metric": "IN_USE_ADDRESSES", + "limit": 23.0, + "usage": 1.0 + }, + { + "metric": "SSD_TOTAL_GB", + "limit": 1024.0, + "usage": 0.0 + }, + { + "metric": "LOCAL_SSD_TOTAL_GB", + "limit": 1500.0, + "usage": 0.0 + } + ] + } + ] +} diff --git a/libcloud/test/compute/fixtures/gce/regions_asia-east1.json b/libcloud/test/compute/fixtures/gce/regions_asia-east1.json new file mode 100644 index 0000000000..adc4569a6d --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions_asia-east1.json @@ -0,0 +1,65 @@ +{ + "kind": "compute#region", + "id": "1220", + "creationTimestamp": "2014-05-30T18:35:16.514-07:00", + "name": "asia-east1", + "description": "asia-east1", + "status": "UP", + "zones": [ + "https://www.googleapis.com/compute/v1/projects/project_name/zones/asia-east1-a", + "https://www.googleapis.com/compute/v1/projects/project_name/zones/asia-east1-b" + ], + "quotas": [ + { + "metric": "CPUS", + "limit": 24.0, + "usage": 0.0 + }, + { + "metric": "DISKS_TOTAL_GB", + "limit": 10240.0, + "usage": 0.0 + }, + { + "metric": "STATIC_ADDRESSES", + "limit": 7.0, + "usage": 0.0 + }, + { + "metric": "IN_USE_ADDRESSES", + "limit": 23.0, + "usage": 0.0 + }, + { + "metric": "SSD_TOTAL_GB", + "limit": 2048.0, + "usage": 0.0 + }, + { + "metric": "LOCAL_SSD_TOTAL_GB", + "limit": 10240.0, + "usage": 0.0 + }, + { + "metric": "INSTANCE_GROUPS", + "limit": 100.0, + "usage": 0.0 + }, + { + "metric": "INSTANCE_GROUP_MANAGERS", + "limit": 50.0, + "usage": 0.0 + }, + { + "metric": "INSTANCES", + "limit": 240.0, + "usage": 0.0 + }, + { + "metric": "AUTOSCALERS", + "limit": 50.0, + "usage": 0.0 + } + ], + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/asia-east1" +} diff --git a/libcloud/test/compute/fixtures/gce/regions_europe-west1.json b/libcloud/test/compute/fixtures/gce/regions_europe-west1.json new file mode 100644 index 0000000000..59d174dc6c --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions_europe-west1.json @@ -0,0 +1,64 @@ +{ + "kind": "compute#region", + "id": "1100", + "creationTimestamp": "2014-05-30T18:35:16.413-07:00", + "name": "europe-west1", + "description": "europe-west1", + "status": "UP", + "zones": [ + "https://www.googleapis.com/compute/v1/projects/project_name/zones/europe-west1-b" + ], + "quotas": [ + { + "metric": "CPUS", + "limit": 24.0, + "usage": 0.0 + }, + { + "metric": "DISKS_TOTAL_GB", + "limit": 10240.0, + "usage": 0.0 + }, + { + "metric": "STATIC_ADDRESSES", + "limit": 7.0, + "usage": 0.0 + }, + { + "metric": "IN_USE_ADDRESSES", + "limit": 23.0, + "usage": 0.0 + }, + { + "metric": "SSD_TOTAL_GB", + "limit": 2048.0, + "usage": 0.0 + }, + { + "metric": "LOCAL_SSD_TOTAL_GB", + "limit": 10240.0, + "usage": 0.0 + }, + { + "metric": "INSTANCE_GROUPS", + "limit": 100.0, + "usage": 0.0 + }, + { + "metric": "INSTANCE_GROUP_MANAGERS", + "limit": 50.0, + "usage": 0.0 + }, + { + "metric": "INSTANCES", + "limit": 240.0, + "usage": 0.0 + }, + { + "metric": "AUTOSCALERS", + "limit": 50.0, + "usage": 0.0 + } + ], + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/europe-west1" +} diff --git a/libcloud/test/compute/fixtures/gce/regions_us-central1.json b/libcloud/test/compute/fixtures/gce/regions_us-central1.json new file mode 100644 index 0000000000..a070fbce58 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions_us-central1.json @@ -0,0 +1,65 @@ +{ + "kind": "compute#region", + "id": "1000", + "creationTimestamp": "2014-05-30T18:35:16.413-07:00", + "name": "us-central1", + "description": "us-central1", + "status": "UP", + "zones": [ + "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b" + ], + "quotas": [ + { + "metric": "CPUS", + "limit": 1050.0, + "usage": 30.0 + }, + { + "metric": "DISKS_TOTAL_GB", + "limit": 20000.0, + "usage": 344.0 + }, + { + "metric": "STATIC_ADDRESSES", + "limit": 10.0, + "usage": 2.0 + }, + { + "metric": "IN_USE_ADDRESSES", + "limit": 1050.0, + "usage": 11.0 + }, + { + "metric": "SSD_TOTAL_GB", + "limit": 2048.0, + "usage": 500.0 + }, + { + "metric": "LOCAL_SSD_TOTAL_GB", + "limit": 10240.0, + "usage": 0.0 + }, + { + "metric": "INSTANCE_GROUPS", + "limit": 100.0, + "usage": 0.0 + }, + { + "metric": "INSTANCE_GROUP_MANAGERS", + "limit": 50.0, + "usage": 0.0 + }, + { + "metric": "INSTANCES", + "limit": 10500.0, + "usage": 11.0 + }, + { + "metric": "AUTOSCALERS", + "limit": 50.0, + "usage": 0.0 + } + ], + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1" +} diff --git a/libcloud/test/compute/fixtures/gce/regions_us-central1_addresses_lcaddressinternal.json b/libcloud/test/compute/fixtures/gce/regions_us-central1_addresses_lcaddressinternal.json new file mode 100644 index 0000000000..749779a984 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions_us-central1_addresses_lcaddressinternal.json @@ -0,0 +1,12 @@ +{ + "address": "10.128.0.12", + "creationTimestamp": "2013-06-26T12:21:40.625-07:00", + "description": "", + "id": "01531551729918243104", + "kind": "compute#address", + "name": "lcaddressinternal", + "addressType": "INTERNAL", + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/addresses/lcaddressinternal", + "status": "RESERVED" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/regions_us-central1_addresses_testaddress.json b/libcloud/test/compute/fixtures/gce/regions_us-central1_addresses_testaddress.json new file mode 100644 index 0000000000..d52a59dc99 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions_us-central1_addresses_testaddress.json @@ -0,0 +1,11 @@ +{ + "address": "173.255.114.104", + "creationTimestamp": "2013-06-04T16:28:43.764-07:00", + "description": "", + "id": "11879548153827627972", + "kind": "compute#address", + "name": "testaddress", + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/addresses/testaddress", + "status": "RESERVED" +} diff --git a/libcloud/test/compute/fixtures/gce/regions_us-central1_subnetworks.json b/libcloud/test/compute/fixtures/gce/regions_us-central1_subnetworks.json new file mode 100644 index 0000000000..902ce2595d --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions_us-central1_subnetworks.json @@ -0,0 +1,18 @@ +{ + "kind": "compute#subnetworkList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks", + "id": "projects/project_name/regions/us-central1/subnetworks", + "items": [ + { + "kind": "compute#subnetwork", + "id": "4297043163355844284", + "creationTimestamp": "2016-03-25T05:34:27.209-07:00", + "gatewayAddress": "10.128.0.1", + "name": "cf-972cf02e6ad49112", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/cf", + "ipCidrRange": "10.128.0.0/20", + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112" + } + ] +} diff --git a/libcloud/test/compute/fixtures/gce/regions_us-central1_subnetworks_cf_972cf02e6ad49112.json b/libcloud/test/compute/fixtures/gce/regions_us-central1_subnetworks_cf_972cf02e6ad49112.json new file mode 100644 index 0000000000..ddaa8de881 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions_us-central1_subnetworks_cf_972cf02e6ad49112.json @@ -0,0 +1,20 @@ +{ + "status": "DONE", + "kind": "compute#subnetwork", + "id": "4297043163355844284", + "creationTimestamp": "2016-03-25T05:34:27.209-07:00", + "description": "LCTestSubnet", + "gatewayAddress": "10.128.0.1", + "name": "cf-972cf02e6ad49112", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/cf", + "ipCidrRange": "10.128.0.0/20", + "privateIpGoogleAccess": true, + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1", + "secondaryIpRanges": [ + { + "ipCidrRange": "192.168.168.0/24", + "rangeName": "secondary" + } + ], + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112" +} diff --git a/libcloud/test/compute/fixtures/gce/regions_us-central1_subnetworks_post.json b/libcloud/test/compute/fixtures/gce/regions_us-central1_subnetworks_post.json new file mode 100644 index 0000000000..57a540f128 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions_us-central1_subnetworks_post.json @@ -0,0 +1,14 @@ +{ + "id": "16064059851942653139", + "insertTime": "2013-06-26T12:21:40.299-07:00", + "kind": "compute#operation", + "name": "operation-regions_us-central1_subnetworks_post", + "operationType": "insert", + "progress": 0, + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/operations/operation-regions_us-central1_subnetworks_post", + "startTime": "2013-06-26T12:21:40.358-07:00", + "status": "PENDING", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112", + "user": "897001307951@developer.gserviceaccount.com" +} diff --git a/libcloud/test/compute/fixtures/gce/regions_us-central1_subnetworks_subnet_1.json b/libcloud/test/compute/fixtures/gce/regions_us-central1_subnetworks_subnet_1.json new file mode 100644 index 0000000000..1ce30ae93f --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions_us-central1_subnetworks_subnet_1.json @@ -0,0 +1,11 @@ +{ + "kind": "compute#subnetwork", + "id": "4297043163355844286", + "creationTimestamp": "2016-10-01T05:34:27.209-07:00", + "gatewayAddress": "10.128.0.1", + "name": "subnet_1", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/cf", + "ipCidrRange": "10.128.0.0/16", + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/subnet_1" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/regions_us-east1.json b/libcloud/test/compute/fixtures/gce/regions_us-east1.json new file mode 100644 index 0000000000..071bb40cb1 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions_us-east1.json @@ -0,0 +1,64 @@ +{ + "kind": "compute#region", + "id": "1230", + "creationTimestamp": "2014-09-03T16:13:49.013-07:00", + "name": "us-east1", + "description": "us-east1", + "status": "UP", + "zones": [ + "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-east1-b" + ], + "quotas": [ + { + "metric": "CPUS", + "limit": 24.0, + "usage": 0.0 + }, + { + "metric": "DISKS_TOTAL_GB", + "limit": 10240.0, + "usage": 0.0 + }, + { + "metric": "STATIC_ADDRESSES", + "limit": 7.0, + "usage": 0.0 + }, + { + "metric": "IN_USE_ADDRESSES", + "limit": 23.0, + "usage": 0.0 + }, + { + "metric": "SSD_TOTAL_GB", + "limit": 2048.0, + "usage": 0.0 + }, + { + "metric": "LOCAL_SSD_TOTAL_GB", + "limit": 10240.0, + "usage": 0.0 + }, + { + "metric": "INSTANCE_GROUPS", + "limit": 100.0, + "usage": 0.0 + }, + { + "metric": "INSTANCE_GROUP_MANAGERS", + "limit": 50.0, + "usage": 0.0 + }, + { + "metric": "INSTANCES", + "limit": 240.0, + "usage": 0.0 + }, + { + "metric": "AUTOSCALERS", + "limit": 50.0, + "usage": 0.0 + } + ], + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-east1" +} diff --git a/libcloud/test/compute/fixtures/gce/regions_us-east1_subnetworks_cf_972cf02e6ad49113.json b/libcloud/test/compute/fixtures/gce/regions_us-east1_subnetworks_cf_972cf02e6ad49113.json new file mode 100644 index 0000000000..79ac9e4138 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/regions_us-east1_subnetworks_cf_972cf02e6ad49113.json @@ -0,0 +1,11 @@ +{ + "kind": "compute#subnetwork", + "id": "4297043163355844284", + "creationTimestamp": "2016-10-01T05:34:27.209-07:00", + "gatewayAddress": "10.128.0.1", + "name": "cf-972cf02e6ad49113", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/cf", + "ipCidrRange": "10.128.0.0/20", + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-east1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49113" +} diff --git a/libcloud/test/compute/fixtures/gce/zones.json b/libcloud/test/compute/fixtures/gce/zones.json index 0d564e7bbb..1ecf5ace15 100644 --- a/libcloud/test/compute/fixtures/gce/zones.json +++ b/libcloud/test/compute/fixtures/gce/zones.json @@ -1,6 +1,16 @@ { "id": "projects/project_name/zones", "items": [ + { + "kind": "compute#zone", + "selfLink": "https://www.googleapis.com/compute/v1/projects/verb-test/zones/asia-east1-a", + "id": "2220", + "creationTimestamp": "2014-05-30T18:35:16.575-07:00", + "name": "asia-east1-a", + "description": "asia-east1-a", + "status": "UP", + "region": "https://www.googleapis.com/compute/v1/projects/verb-test/regions/asia-east1" + }, { "creationTimestamp": "2013-02-05T16:19:23.254-08:00", "description": "europe-west1-a", @@ -82,4 +92,4 @@ ], "kind": "compute#zoneList", "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones" -} \ No newline at end of file +} diff --git a/libcloud/test/compute/fixtures/gce/zones_asia-east1-b.json b/libcloud/test/compute/fixtures/gce/zones_asia-east1-b.json new file mode 100644 index 0000000000..1c3ac1bff0 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_asia-east1-b.json @@ -0,0 +1,10 @@ +{ + "kind": "compute#zone", + "id": "2220", + "creationTimestamp": "2014-05-30T18:35:16.575-07:00", + "name": "asia-east1-a", + "description": "asia-east1-a", + "status": "UP", + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/asia-east1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/asia-east1-a" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks.json index fc39c99c58..6d609bef0f 100644 --- a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks.json +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks.json @@ -19,7 +19,6 @@ "id": "0265567475385851075", "kind": "compute#disk", "name": "node-name", - "description": "I'm a happy little disk", "type": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/diskTypes/pd-standard", "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/node-name", "sizeGb": "10", diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks_lcdisk_resize_post.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks_lcdisk_resize_post.json new file mode 100644 index 0000000000..dd7e869ae2 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks_lcdisk_resize_post.json @@ -0,0 +1,15 @@ +{ + "id": "4992266504414588438", + "insertTime": "2019-07-02T14:47:37.095-07:00", + "kind": "compute#operation", + "name": "operation-zones_us-central1-a_disks_lcdisk_resize_post", + "operationType": "resizeDisk", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us-central1-a_disks_lcdisk_resize_post", + "startTime": "2019-07-02T14:47:37.111-07:00", + "status": "PENDING", + "targetId": "904434546113910404", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/lcdisk", + "user": "487551519631-t6qvu2na6p4u9ptm46bsdujf0ohbdro7@developer.gserviceaccount.com", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks_lcdisk_setLabel_post.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks_lcdisk_setLabel_post.json new file mode 100644 index 0000000000..aa5a532c7f --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_disks_lcdisk_setLabel_post.json @@ -0,0 +1,16 @@ +{ + "id": "0158330665043557584", + "name": "operation-zones_us-central1-a_disks_lcdisk_setLabels_post", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "operationType": "setLabels", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/lcdisk", + "targetId": "6142245483972904501", + "status": "DONE", + "user": "487551519631-t6qvu2na6p4u9ptm46bsdujf0ohbdro7@developer.gserviceaccount.com", + "progress": 100, + "insertTime": "2019-11-27T05:23:41.870-08:00", + "startTime": "2019-11-27T05:23:41.873-08:00", + "endTime": "2019-11-27T05:23:41.873-08:00", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us-central1-a_disks_lcdisk_setLabels_post", + "kind": "compute#operation" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroupManagers.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroupManagers.json new file mode 100644 index 0000000000..c451bd6500 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroupManagers.json @@ -0,0 +1,30 @@ +{ + "kind": "compute#instanceGroupManagerList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroupManagers", + "id": "projects/project_name/zones/us-central1-a/instanceGroupManagers", + "items": [ + { + + "kind": "compute#instanceGroupManager", + "id": "8588434319274454491", + "creationTimestamp": "2016-07-18T10:34:44.679-07:00", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "name": "myinstancegroup", + "instanceTemplate": "https://content.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates/my-instance-template1", + "instanceGroup": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myinstancegroup", + "baseInstanceName": "myinstancegroup", + "fingerprint": "5bKcxzAnGOg=", + "currentActions": { + "none": 2, + "creating": 0, + "recreating": 0, + "deleting": 0, + "abandoning": 0, + "restarting": 0, + "refreshing": 0 + }, + "targetSize": 2, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroupManagers/myinstancegroup" + } + ] +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroupManagers_insert.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroupManagers_insert.json new file mode 100644 index 0000000000..457ac2610c --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroupManagers_insert.json @@ -0,0 +1,16 @@ +{ + "kind": "compute#operation", + "id": "5029726187056811377", + "name": "operation-zones_us-central1-a_instanceGroupManagers_insert_post", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "operationType": "compute.instanceGroupManagers.insert", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroupManagers/managed-instance-group-1", + "targetId": "1549031063416753526", + "status": "PENDING", + "user": "999999-compute@developer.gserviceaccount.com", + "progress": 90, + "insertTime": "2016-08-12T09:04:46.114-07:00", + "startTime": "2016-08-12T09:04:46.117-07:00", + "endTime": "2016-08-12T09:04:46.117-07:00", + "selfLink" : "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us-central1-a_instanceGroupManagers_insert_post" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroupManagers_myinstancegroup.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroupManagers_myinstancegroup.json new file mode 100644 index 0000000000..823b5b38c2 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroupManagers_myinstancegroup.json @@ -0,0 +1,24 @@ +{ + + "kind": "compute#instanceGroupManager", + "id": "8604381270851510464", + "creationTimestamp": "2016-07-18T15:54:39.153-07:00", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "name": "myinstancegroup", + "description": "my description for myinstancegroup", + "instanceTemplate": "https://content.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates/my-instance-template1", + "instanceGroup": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myinstancegroup", + "baseInstanceName": "base-foo", + "fingerprint": "Q21hYveq9do=", + "currentActions": { + "none": 4, + "creating": 0, + "recreating": 0, + "deleting": 0, + "abandoning": 0, + "restarting": 0, + "refreshing": 0 + }, + "targetSize": 4, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroupManagers/myinstancegroup" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroupManagers_myinstancegroup_shared_network.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroupManagers_myinstancegroup_shared_network.json new file mode 100644 index 0000000000..61ec675367 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroupManagers_myinstancegroup_shared_network.json @@ -0,0 +1,24 @@ +{ + + "kind": "compute#instanceGroupManager", + "id": "8604381270851510465", + "creationTimestamp": "2016-07-18T15:54:39.153-07:00", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "name": "myinstancegroup-shared-network", + "description": "my description for myinstancegroup", + "instanceTemplate": "https://content.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates/my-instance-template-shared-network", + "instanceGroup": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myinstancegroup-shared-network", + "baseInstanceName": "base-foo", + "fingerprint": "Q21hYveq9do=", + "currentActions": { + "none": 4, + "creating": 0, + "recreating": 0, + "deleting": 0, + "abandoning": 0, + "restarting": 0, + "refreshing": 0 + }, + "targetSize": 4, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroupManagers/myinstancegroup-shared-network" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroup_myinstancegroup.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroup_myinstancegroup.json new file mode 100644 index 0000000000..68f06e6fe0 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroup_myinstancegroup.json @@ -0,0 +1,14 @@ +{ + + "kind": "compute#instanceGroup", + "id": "1968709502073089769", + "creationTimestamp": "2016-08-11T16:53:42.413-07:00", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "name": "myinstancegroup", + "description": "This instance group is controlled by Instance Group Manager 'myinstancegroup'. To modify instances in this group, use the Instance Group Manager API: https://cloud.google.com/compute/docs/reference/latest/instanceGroupManagers", + "network": "https://content.googleapis.com/compute/v1/projects/project_name/global/networks/default", + "fingerprint": "42WmSpB8rSM=", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myinstancegroup", + "size": 4, + "subnetwork": "https://content.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroup_myinstancegroup2.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroup_myinstancegroup2.json new file mode 100644 index 0000000000..f853bb778f --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroup_myinstancegroup2.json @@ -0,0 +1,14 @@ +{ + + "kind": "compute#instanceGroup", + "id": "1968709502073089768", + "creationTimestamp": "2016-08-26T16:53:42.413-07:00", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "name": "myinstancegroup2", + "description": "myinstancegroup2", + "network": "https://content.googleapis.com/compute/v1/projects/project_name/global/networks/default", + "fingerprint": "42WmSpB8rSN=", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myinstancegroup2", + "size": 4, + "subnetwork": "https://content.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroup_myinstancegroup_shared_network.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroup_myinstancegroup_shared_network.json new file mode 100644 index 0000000000..1a0592f4e1 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instanceGroup_myinstancegroup_shared_network.json @@ -0,0 +1,14 @@ +{ + + "kind": "compute#instanceGroup", + "id": "1968709502073089770", + "creationTimestamp": "2016-08-11T16:53:42.413-07:00", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "name": "myinstancegroup_shared_network", + "description": "This instance group is controlled by Instance Group Manager 'myinstancegroup'. To modify instances in this group, use the Instance Group Manager API: https://cloud.google.com/compute/docs/reference/latest/instanceGroupManagers", + "network": "https://www.googleapis.com/compute/v1/projects/other_name/global/networks/shared_network_for_mig", + "subnetwork": "https://www.googleapis.com/compute/v1/projects/other_name/regions/us-central1/subnetworks/shared_subnetwork_for_mig", + "fingerprint": "42WmSpB8rSM=", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myinstancegroup_shared_network", + "size": 4 +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instances.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instances.json index 9fccb06efc..6f89843a1d 100644 --- a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instances.json +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instances.json @@ -44,6 +44,8 @@ }, "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/node-name", "status": "RUNNING", + "cpuPlatform": "Intel Skylake", + "minCpuPlatform": "Intel Skylake", "tags": { "fingerprint": "42WmSpB8rSM=" }, @@ -52,4 +54,4 @@ ], "kind": "compute#instanceList", "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances" -} \ No newline at end of file +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instances_sn-node-name.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instances_sn-node-name.json new file mode 100644 index 0000000000..302e85ae88 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_instances_sn-node-name.json @@ -0,0 +1,49 @@ +{ + "canIpForward": false, + "creationTimestamp": "2013-12-13T10:45:23.351-08:00", + "disks": [ + { + "boot": true, + "deviceName": "persistent-disk-0", + "index": 0, + "kind": "compute#attachedDisk", + "mode": "READ_WRITE", + "source": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/node-name", + "type": "PERSISTENT" + } + ], + "id": "4006034190819017667", + "kind": "compute#instance", + "machineType": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/machineTypes/n1-standard-1", + "metadata": { + "fingerprint": "42WmSpB8rSM=", + "kind": "compute#metadata" + }, + "name": "sn-node-name", + "networkInterfaces": [ + { + "accessConfigs": [ + { + "kind": "compute#accessConfig", + "name": "External NAT", + "natIP": "23.236.58.15", + "type": "ONE_TO_ONE_NAT" + } + ], + "name": "nic0", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/default", + "subnetwork": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112", + "networkIP": "10.240.72.75" + } + ], + "scheduling": { + "automaticRestart": true, + "onHostMaintenance": "MIGRATE" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/sn-node-name", + "status": "RUNNING", + "tags": { + "fingerprint": "42WmSpB8rSM=" + }, + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_machineTypes.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_machineTypes.json index 7cbae6f077..14a77a596a 100644 --- a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_machineTypes.json +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_machineTypes.json @@ -15,6 +15,26 @@ "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/machineTypes/f1-micro", "zone": "us-central1-a" }, + { + "creationTimestamp": "2016-04-25T13:32:49.088-07:00", + "description": "12 vCPU and 85 GB RAM", + "guestCpus": 12, + "id": "1133568312750571514", + "imageSpaceGb": 10, + "kind": "compute#machineType", + "maximumPersistentDisks": 16, + "maximumPersistentDisksSizeGb": "10240", + "memoryMb": 87040, + "name": "a2-highgpu-1g", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/europe-west1-a/machineTypes/a2-highgpu-1g", + "accelerators": [ + { + "guestAcceleratorType": "nvidia-tesla-v100", + "guestAcceleratorCount": 1 + } + ], + "zone": "europe-west1-a" + }, { "creationTimestamp": "2013-04-25T13:32:45.550-07:00", "description": "1 vCPU (shared physical core) and 1.7 GB RAM", diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-a_operations_operation_zones_us-central1-a_instanceGroupManagers_insert_post.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_operations_operation_zones_us-central1-a_instanceGroupManagers_insert_post.json new file mode 100644 index 0000000000..8f68b9a6a9 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-a_operations_operation_zones_us-central1-a_instanceGroupManagers_insert_post.json @@ -0,0 +1,16 @@ +{ + "kind": "compute#operation", + "id": "5029726187056811377", + "name": "operation-zones_us-central1-a_instanceGroupManagers_insert_post", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "operationType": "compute.instanceGroupManagers.insert", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroupManagers/managed-instance-group-1", + "targetId": "1549031063416753526", + "status": "DONE", + "user": "999999-compute@developer.gserviceaccount.com", + "progress": 100, + "insertTime": "2016-08-12T09:04:46.114-07:00", + "startTime": "2016-08-12T09:04:46.117-07:00", + "endTime": "2016-08-12T09:04:46.117-07:00", + "selfLink" : "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us-central1-a_instanceGroupManagers_insert_post" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-b_instanceGroupManagers_myinstancegroup.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-b_instanceGroupManagers_myinstancegroup.json new file mode 100644 index 0000000000..863f664afc --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-b_instanceGroupManagers_myinstancegroup.json @@ -0,0 +1,24 @@ +{ + + "kind": "compute#instanceGroupManager", + "id": "8604381270851510464", + "creationTimestamp": "2016-07-18T15:54:39.153-07:00", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b", + "name": "myinstancegroup", + "description": "my description for myinstancegroup", + "instanceTemplate": "https://content.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates/my-instance-template1", + "instanceGroup": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/instanceGroups/myinstancegroup", + "baseInstanceName": "base-foo", + "fingerprint": "Q21hYveq9do=", + "currentActions": { + "none": 4, + "creating": 0, + "recreating": 0, + "deleting": 0, + "abandoning": 0, + "restarting": 0, + "refreshing": 0 + }, + "targetSize": 4, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/instanceGroupManagers/myinstancegroup" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-b_instanceGroup_myinstancegroup.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-b_instanceGroup_myinstancegroup.json new file mode 100644 index 0000000000..94815c4daa --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-b_instanceGroup_myinstancegroup.json @@ -0,0 +1,14 @@ +{ + + "kind": "compute#instanceGroup", + "id": "1968709502073089769", + "creationTimestamp": "2016-08-11T16:53:42.413-07:00", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b", + "name": "managed-instance-group-1", + "description": "This instance group is controlled by Instance Group Manager 'myinstancegroup'. To modify instances in this group, use the Instance Group Manager API: https://cloud.google.com/compute/docs/reference/latest/instanceGroupManagers", + "network": "https://content.googleapis.com/compute/v1/projects/project_name/global/networks/default", + "fingerprint": "42WmSpB8rSM=", + "selfLink": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/instanceGroups/myinstancegroup", + "size": 4, + "subnetwork": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-central1-b_instances_libcloud-lb-nopubip-001.json b/libcloud/test/compute/fixtures/gce/zones_us-central1-b_instances_libcloud-lb-nopubip-001.json new file mode 100644 index 0000000000..0ec17099ca --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-central1-b_instances_libcloud-lb-nopubip-001.json @@ -0,0 +1,49 @@ +{ + "canIpForward": false, + "creationTimestamp": "2013-12-13T10:51:25.165-08:00", + "disks": [ + { + "boot": true, + "deviceName": "libcloud-lb-demo-www-001", + "index": 0, + "kind": "compute#attachedDisk", + "mode": "READ_WRITE", + "source": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/disks/libcloud-lb-demo-www-001", + "type": "PERSISTENT" + } + ], + "id": "11523404878663997348", + "kind": "compute#instance", + "machineType": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/machineTypes/n1-standard-1", + "metadata": { + "fingerprint": "09vSzO6KXcw=", + "items": [ + { + "key": "startup-script", + "value": "apt-get -y update && apt-get -y install apache2 && hostname > /var/www/index.html" + } + ], + "kind": "compute#metadata" + }, + "name": "libcloud-lb-nopubip-001", + "networkInterfaces": [ + { + "name": "nic0", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/default", + "networkIP": "10.240.94.66" + } + ], + "scheduling": { + "automaticRestart": true, + "onHostMaintenance": "MIGRATE" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b/instances/libcloud-lb-nopubip-001", + "status": "RUNNING", + "tags": { + "fingerprint": "XI0he92M8l8=", + "items": [ + "libcloud-lb-demo-www" + ] + }, + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-b" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-east1-b.json b/libcloud/test/compute/fixtures/gce/zones_us-east1-b.json new file mode 100644 index 0000000000..1460ee2b17 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-east1-b.json @@ -0,0 +1,10 @@ +{ + "kind": "compute#zone", + "id": "2231", + "creationTimestamp": "2015-09-08T16:57:06.746-07:00", + "name": "us-east1-b", + "description": "us-east1-b", + "status": "UP", + "region": "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-east1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-east1-b" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-east1-b_instanceGroupManagers.json b/libcloud/test/compute/fixtures/gce/zones_us-east1-b_instanceGroupManagers.json new file mode 100644 index 0000000000..1ac5d9f650 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-east1-b_instanceGroupManagers.json @@ -0,0 +1,30 @@ +{ + "kind": "compute#instanceGroupManagerList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-east1-b/instanceGroupManagers", + "id": "projects/project_name/zones/us-east1-b/instanceGroupManagers", + "items": [ + { + + "kind": "compute#instanceGroupManager", + "id": "8588434319274454491", + "creationTimestamp": "2016-07-18T10:34:44.679-07:00", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-east1-b", + "name": "myinstancegroup", + "instanceTemplate": "https://content.googleapis.com/compute/v1/projects/project_name/global/instanceTemplates/my-instance-template1", + "instanceGroup": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-east1-b/instanceGroups/myinstancegroup", + "baseInstanceName": "myinstancegroup", + "fingerprint": "5bKcxzAnGOg=", + "currentActions": { + "none": 2, + "creating": 0, + "recreating": 0, + "deleting": 0, + "abandoning": 0, + "restarting": 0, + "refreshing": 0 + }, + "targetSize": 2, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-east1-b/instanceGroupManagers/myinstancegroup" + } + ] +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us-east1-b_instanceGroup_myinstancegroup.json b/libcloud/test/compute/fixtures/gce/zones_us-east1-b_instanceGroup_myinstancegroup.json new file mode 100644 index 0000000000..55e9ff53fd --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us-east1-b_instanceGroup_myinstancegroup.json @@ -0,0 +1,14 @@ +{ + + "kind": "compute#instanceGroup", + "id": "1968709502073089769", + "creationTimestamp": "2016-08-11T16:53:42.413-07:00", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-east1-b", + "name": "managed-instance-group-1", + "description": "This instance group is controlled by Instance Group Manager 'myinstancegroup'. To modify instances in this group, use the Instance Group Manager API: https://cloud.google.com/compute/docs/reference/latest/instanceGroupManagers", + "network": "https://content.googleapis.com/compute/v1/projects/project_name/global/networks/default", + "fingerprint": "42WmSpB8rSM=", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-east1-b/instanceGroups/myinstancegroup", + "size": 4, + "subnetwork": "https://content.googleapis.com/compute/v1/projects/project_name/regions/us-east1/subnetworks/cf-972cf02e6ad49113" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_acceleratorTypes_nvidia_tesla_k80.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_acceleratorTypes_nvidia_tesla_k80.json new file mode 100644 index 0000000000..e4225ca27a --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_acceleratorTypes_nvidia_tesla_k80.json @@ -0,0 +1,10 @@ +{ + "kind": "compute#acceleratorType", + "description": "NVIDIA Tesla K80", + "creationTimestamp": "1969-12-31T16:00:00.000-08:00", + "maximumCardsPerInstance": 8, + "name": "nvidia-tesla-k80", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/acceleratorTypes/nvidia-tesla-k80", + "id": "10002" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups.json new file mode 100644 index 0000000000..33a837babd --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups.json @@ -0,0 +1,29 @@ +{ + "id": "projects/project_name/zones/us-central1-a/instanceGroups", + "items": [ + { + "creationTimestamp": "2016-09-09T13:48:39.700-07:00", + "description": "", + "fingerprint": "42WmSpB8rSM=", + "id": "5837905299775594184", + "kind": "compute#instanceGroup", + "name": "myname", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname", + "size": 0, + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a" + }, + { + "creationTimestamp": "2016-09-09T13:54:30.857-07:00", + "description": "", + "fingerprint": "42WmSpB8rSM=", + "id": "6825641674983513961", + "kind": "compute#instanceGroup", + "name": "myname2", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname2", + "size": 0, + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a" + } + ], + "kind": "compute#instanceGroupList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_insert.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_insert.json new file mode 100644 index 0000000000..2b6c12f85f --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_insert.json @@ -0,0 +1,13 @@ +{ + "status": "DONE", + "kind": "compute#operation", + "name": "myname", + "zone": "us-central1-a", + "insertTime": "2016-09-02T09:31:52.285-07:00", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones_us_central1_a/instanceGroups/myname", + "operationType": "compute.instanceGroups.insert", + "progress": 100, + "id": 123456, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us_central1_a_instanceGroups_myname_insert", + "user": "1264195755357-compute@developer.gserviceaccount.com" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname.json new file mode 100644 index 0000000000..7114faca30 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname.json @@ -0,0 +1,12 @@ +{ + + "kind": "compute#instanceGroup", + "id": "5837905299775594184", + "creationTimestamp": "2016-09-09T13:48:39.700-07:00", + "name": "myname", + "description": "", + "fingerprint": "42WmSpB8rSM=", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname", + "size": 0 +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_addInstances.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_addInstances.json new file mode 100644 index 0000000000..9e21253b3a --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_addInstances.json @@ -0,0 +1,13 @@ +{ + "status": "DONE", + "kind": "compute#operation", + "name": "myname", + "zone": "us-central1-a", + "insertTime": "2016-09-02T09:31:52.285-07:00", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname", + "operationType": "compute.instanceGroups.addInstances", + "progress": 100, + "id": 123456, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us_central1_a_instanceGroups_myname_addInstances", + "user": "1264195755357-compute@developer.gserviceaccount.com" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_delete.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_delete.json new file mode 100644 index 0000000000..e13d01791a --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_delete.json @@ -0,0 +1,13 @@ +{ + "status": "DONE", + "kind": "compute#operation", + "name": "myname", + "zone": "us-central1-a", + "insertTime": "2016-09-02T09:31:52.285-07:00", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname", + "operationType": "compute.instanceGroups.delete", + "progress": 100, + "id": 123456, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us_central1_a_instanceGroups_myname_delete", + "user": "1264195755357-compute@developer.gserviceaccount.com" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_listInstances.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_listInstances.json new file mode 100644 index 0000000000..94c6cbff3b --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_listInstances.json @@ -0,0 +1,15 @@ +{ + "id": "projects/project_name/zones/us-central1-a/instanceGroups/myname/listInstances", + "items": [ + { + "instance": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/node-name", + "status": "RUNNING" + }, + { + "instance": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/lcnode-001", + "status": "RUNNING" + } + ], + "kind": "compute#instanceGroupsListInstances", + "selfLink": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname/listInstances" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_removeInstances.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_removeInstances.json new file mode 100644 index 0000000000..a994784255 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_removeInstances.json @@ -0,0 +1,13 @@ +{ + "status": "DONE", + "kind": "compute#operation", + "name": "myname", + "zone": "us-central1-a", + "insertTime": "2016-09-02T09:31:52.285-07:00", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname", + "operationType": "compute.instanceGroups.removeInstances", + "progress": 100, + "id": 123456, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us_central1_a_instanceGroups_myname_removeInstances", + "user": "1264195755357-compute@developer.gserviceaccount.com" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_setNamedPorts.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_setNamedPorts.json new file mode 100644 index 0000000000..e7b869e0a7 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_myname_setNamedPorts.json @@ -0,0 +1,13 @@ +{ + "status": "DONE", + "kind": "compute#operation", + "name": "myname", + "zone": "us-central1-a", + "insertTime": "2016-09-02T09:31:52.285-07:00", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname", + "operationType": "compute.instanceGroups.setNamedPorts", + "progress": 100, + "id": 123456, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-zones_us_central1_a_instanceGroups_myname_setNamedPorts", + "user": "1264195755357-compute@developer.gserviceaccount.com" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_zone_attribute_not_present.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_zone_attribute_not_present.json new file mode 100644 index 0000000000..39c0a80b37 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_zone_attribute_not_present.json @@ -0,0 +1,27 @@ +{ + "id": "projects/project_name/zones/us-central1-a/instanceGroups", + "items": [ + { + "creationTimestamp": "2016-09-09T13:48:39.700-07:00", + "description": "", + "fingerprint": "42WmSpB8rSM=", + "id": "5837905299775594184", + "kind": "compute#instanceGroup", + "name": "myname", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname", + "size": 0 + }, + { + "creationTimestamp": "2016-09-09T13:54:30.857-07:00", + "description": "", + "fingerprint": "42WmSpB8rSM=", + "id": "6825641674983513961", + "kind": "compute#instanceGroup", + "name": "myname2", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname2", + "size": 0 + } + ], + "kind": "compute#instanceGroupList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instances_custom_node.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instances_custom_node.json new file mode 100644 index 0000000000..bb0153dc13 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instances_custom_node.json @@ -0,0 +1,48 @@ +{ + "canIpForward": false, + "creationTimestamp": "2013-12-13T10:45:23.351-08:00", + "disks": [ + { + "boot": true, + "deviceName": "persistent-disk-0", + "index": 0, + "kind": "compute#attachedDisk", + "mode": "READ_WRITE", + "source": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/lcdisk", + "type": "PERSISTENT" + } + ], + "id": "4006034190819017667", + "kind": "compute#instance", + "machineType": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/machineTypes/n1-standard-1", + "metadata": { + "fingerprint": "42WmSpB8rSM=", + "kind": "compute#metadata" + }, + "name": "custom-node", + "networkInterfaces": [ + { + "accessConfigs": [ + { + "kind": "compute#accessConfig", + "name": "External NAT", + "natIP": "23.236.58.15", + "type": "ONE_TO_ONE_NAT" + } + ], + "name": "nic0", + "network": "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/default", + "networkIP": "10.240.72.75" + } + ], + "scheduling": { + "automaticRestart": true, + "onHostMaintenance": "MIGRATE" + }, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/custom-node", + "status": "TERMINATED", + "tags": { + "fingerprint": "42WmSpB8rSM=" + }, + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instances_node_name_setLabels_post.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instances_node_name_setLabels_post.json new file mode 100644 index 0000000000..e698a3c0e7 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instances_node_name_setLabels_post.json @@ -0,0 +1,15 @@ +{ + "endTime": "2013-06-26T10:05:07.630-07:00", + "id": "3681664092089171723", + "insertTime": "2013-06-26T10:05:03.271-07:00", + "kind": "compute#operation", + "name": "operation-setLabelspost", + "operationType": "insert", + "progress": 0, + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-setLabels_post", + "startTime": "2013-06-26T10:05:03.315-07:00", + "status": "PENDING", + "targetId": "16211908079305042870", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/node-name/setLabels", + "user": "foo@developer.gserviceaccount.com" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instances_node_name_setMachineType.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instances_node_name_setMachineType.json new file mode 100644 index 0000000000..2d1b397e7a --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instances_node_name_setMachineType.json @@ -0,0 +1,15 @@ +{ + "kind": "compute#operation", + "id": "18431811683007150988", + "name": "operation-setMachineType-notstopped", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "operationType": "setMachineType", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/node-name", + "targetId": "12335588484913203363", + "status": "PENDING", + "user": "erjohnso@google.com", + "progress": 0, + "insertTime": "2015-01-30T06:55:11.503-08:00", + "startTime": "2015-01-30T06:55:11.847-08:00", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-setMachineType-notstopped" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instances_stopped_node_setMachineType.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instances_stopped_node_setMachineType.json new file mode 100644 index 0000000000..c1e0622254 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instances_stopped_node_setMachineType.json @@ -0,0 +1,15 @@ +{ + "kind": "compute#operation", + "id": "18431811683007150988", + "name": "operation-setMachineType", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "operationType": "setMachineType", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/stopped-node", + "targetId": "12335588484913203363", + "status": "PENDING", + "user": "erjohnso@google.com", + "progress": 0, + "insertTime": "2015-01-30T06:55:11.503-08:00", + "startTime": "2015-01-30T06:55:11.847-08:00", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-setMachineType" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_operations_operation_setMachineType.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_operations_operation_setMachineType.json new file mode 100644 index 0000000000..fcea41276a --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_operations_operation_setMachineType.json @@ -0,0 +1,15 @@ +{ + "kind": "compute#operation", + "id": "18431811683007150988", + "name": "operation-setMachineType", + "zone": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "operationType": "setMachineType", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/stopped-node", + "targetId": "12335588484913203363", + "status": "DONE", + "user": "erjohnso@google.com", + "progress": 100, + "insertTime": "2015-01-30T06:55:11.503-08:00", + "startTime": "2015-01-30T06:55:11.847-08:00", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-setMachineType" +} diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_operations_operation_setMachineType_notstopped.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_operations_operation_setMachineType_notstopped.json new file mode 100644 index 0000000000..234e272b72 --- /dev/null +++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_operations_operation_setMachineType_notstopped.json @@ -0,0 +1,26 @@ +{ + "kind": "compute#operation", + "id": "1122640775725896976", + "name": "operation-setMachineType-notstopped", + "zone": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a", + "operationType": "setMachineType", + "targetLink": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instances/node-name", + "targetId": "10940055899777330894", + "status": "DONE", + "user": "erjohnso@google.com", + "progress": 100, + "insertTime": "2016-03-07T08:09:34.445-08:00", + "startTime": "2016-03-07T08:09:34.679-08:00", + "endTime": "2016-03-07T08:09:35.161-08:00", + "error": { + "errors": [ + { + "code": "RESOURCE_NOT_READY", + "message": "The resource 'projects/project_name/zones/us-central1-a/instances/node-name' is not ready" + } + ] + }, + "httpErrorStatusCode": 400, + "httpErrorMessage": "BAD REQUEST", + "selfLink": "https://content.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/operations/operation-setMachineType-notstopped" +} diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_cloudspaces_create.json b/libcloud/test/compute/fixtures/gig_g8/POST_cloudspaces_create.json new file mode 100644 index 0000000000..b4de394767 --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_cloudspaces_create.json @@ -0,0 +1 @@ +11 diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_cloudspaces_delete.json b/libcloud/test/compute/fixtures/gig_g8/POST_cloudspaces_delete.json new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_cloudspaces_delete.json @@ -0,0 +1 @@ +true diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_cloudspaces_get.json b/libcloud/test/compute/fixtures/gig_g8/POST_cloudspaces_get.json new file mode 100644 index 0000000000..8df05386a7 --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_cloudspaces_get.json @@ -0,0 +1 @@ +{"status": "PAUSED", "updateTime": 1583231625, "externalnetworkip": "10.101.107.111", "accountId": 12, "description": "", "creationTime": 1581547109, "acl": [{"status": "CONFIRMED", "type": "U", "right": "ACDRUX", "canBeDeleted": false, "userGroupId": "admin"}], "secret": "481a39b2-80b0-43ab-af09-e2540d694fd5", "gid": 107, "location": "be-g8-3", "publicipaddress": "10.101.107.111", "id": 11, "mode": "public", "privatenetwork": "192.168.103.0/24", "type": "vgw", "resourceLimits": {"CU_M": -1.0, "CU_D": -1, "CU_NP": -1, "CU_I": -1, "CU_C": -1}, "name": "be-g8-3"} diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_cloudspaces_list.json b/libcloud/test/compute/fixtures/gig_g8/POST_cloudspaces_list.json new file mode 100644 index 0000000000..bcbfeed11b --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_cloudspaces_list.json @@ -0,0 +1 @@ +[{"status": "PAUSED", "updateTime": 1582702071, "externalnetworkip": "172.17.1.100", "name": "devsetup", "descr": "", "creationTime": 1575281041, "location": "devsetup", "accountName": "test_deployment", "gid": 66, "mode": "public", "publicipaddress": "172.17.1.100", "id": 1, "acl": [{"status": "CONFIRMED", "type": "U", "right": "ACDRUX", "canBeDeleted": false, "userGroupId": "admin"}, {"status": "CONFIRMED", "type": "U", "right": "ACDRUX", "canBeDeleted": false, "userGroupId": "deboeckj@itsyouonline"}], "type": "vgw", "accountAcl": {"status": "CONFIRMED", "right": "CXDRAU", "explicit": true, "userGroupId": "admin", "guid": "", "type": "U"}, "accountId": 1}] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_disks_create.json b/libcloud/test/compute/fixtures/gig_g8/POST_disks_create.json new file mode 100644 index 0000000000..b4de394767 --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_disks_create.json @@ -0,0 +1 @@ +11 diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_disks_delete.json b/libcloud/test/compute/fixtures/gig_g8/POST_disks_delete.json new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_disks_delete.json @@ -0,0 +1 @@ +true diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_disks_get.json b/libcloud/test/compute/fixtures/gig_g8/POST_disks_get.json new file mode 100644 index 0000000000..c60ca9565a --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_disks_get.json @@ -0,0 +1 @@ +{"exposed": false, "diskPath": "", "images": [], "pci_slot": null, "port": 26203, "accountId": null, "exposingMachineId": -1, "guid": 328, "sizeUsed": 0, "deletionTime": 0, "descr": "", "id": 328, "gid": 107, "role": "", "params": "", "type": "C", "status": "CREATED", "realityDeviceNumber": 0, "passwd": "", "lastAttemptedDestroy": 0, "host": "10.107.3.41", "iotune": {}, "path": "rescuedisk/disk_328", "sizeMax": 1, "name": "dce69.test038.delete.cdrom.1.yes", "acl": {}, "iqn": "", "bootPartition": 0, "login": "", "pci_bus": null, "order": 0} diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_disks_list.json b/libcloud/test/compute/fixtures/gig_g8/POST_disks_list.json new file mode 100644 index 0000000000..76bfcd8651 --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_disks_list.json @@ -0,0 +1 @@ +[{"exposed": false, "diskPath": "", "images": [], "guid": 328, "port": 26203, "accountId": null, "exposingMachineId": -1, "sizeUsed": 0, "deletionTime": 0, "descr": "", "id": 328, "gid": 107, "role": "", "params": "", "type": "C", "status": "CREATED", "realityDeviceNumber": 0, "passwd": "", "lastAttemptedDestroy": 0, "host": "10.107.3.41", "iotune": {}, "path": "rescuedisk/disk_328", "sizeMax": 1, "name": "dce69.test038.delete.cdrom.1.yes", "machineId": null, "acl": {}, "iqn": "", "bootPartition": 0, "login": "", "order": 0}, {"exposed": false, "diskPath": "", "images": [], "guid": 334, "port": 26203, "accountId": null, "exposingMachineId": -1, "sizeUsed": 0, "deletionTime": 0, "descr": "", "id": 334, "gid": 107, "role": "", "params": "", "type": "C", "status": "CREATED", "realityDeviceNumber": 0, "passwd": "", "lastAttemptedDestroy": 0, "host": "10.107.3.41", "iotune": {}, "path": "rescuedisk/disk_334", "sizeMax": 1, "name": "2edc4.test043.destroy.used.cdrom.used.1", "machineId": null, "acl": {}, "iqn": "", "bootPartition": 0, "login": "", "order": 0}, {"exposed": false, "diskPath": "", "images": [], "guid": 358, "port": 26203, "accountId": null, "exposingMachineId": -1, "sizeUsed": 0, "deletionTime": 0, "descr": "", "id": 358, "gid": 107, "role": "", "params": "", "type": "C", "status": "CREATED", "realityDeviceNumber": 0, "passwd": "", "lastAttemptedDestroy": 0, "host": "10.107.3.42", "iotune": {}, "path": "rescuedisk/disk_358", "sizeMax": 1, "name": "c7d57.test043.destroy.used.cdrom.used.0", "machineId": null, "acl": {}, "iqn": "", "bootPartition": 0, "login": "", "order": 0}, {"exposed": false, "diskPath": "", "images": [], "guid": 712, "port": 26203, "accountId": null, "exposingMachineId": -1, "sizeUsed": 0, "deletionTime": 0, "descr": "", "id": 712, "gid": 107, "role": "", "params": "", "type": "C", "status": "CREATED", "realityDeviceNumber": 0, "passwd": "", "lastAttemptedDestroy": 0, "host": "10.107.3.41", "iotune": {}, "path": "rescuedisk/disk_712", "sizeMax": 1, "name": "30189.test043.destroy.used.cdrom.used.0", "machineId": null, "acl": {}, "iqn": "", "bootPartition": 0, "login": "", "order": 0}, {"exposed": false, "diskPath": "", "images": [], "guid": 894, "port": 26203, "accountId": null, "exposingMachineId": -1, "sizeUsed": 0, "deletionTime": 0, "descr": "", "id": 894, "gid": 107, "role": "", "params": "", "type": "C", "status": "CREATED", "realityDeviceNumber": 0, "passwd": "", "lastAttemptedDestroy": 0, "host": "10.107.3.41", "iotune": {}, "path": "rescuedisk/disk_894", "sizeMax": 1, "name": "fd538.test038.delete.cdrom.0.no", "machineId": null, "acl": {}, "iqn": "", "bootPartition": 0, "login": "", "order": 0}, {"exposed": false, "diskPath": "", "images": [], "guid": 1001, "port": 26203, "accountId": null, "exposingMachineId": -1, "sizeUsed": 0, "deletionTime": 0, "descr": "", "id": 1001, "gid": 107, "role": "", "params": "", "type": "C", "status": "CREATED", "realityDeviceNumber": 0, "passwd": "", "lastAttemptedDestroy": 0, "host": "10.107.3.42", "iotune": {}, "path": "rescuedisk/disk_1001", "sizeMax": 1, "name": "e690e.test043.destroy.used.cdrom.used.0", "machineId": null, "acl": {}, "iqn": "", "bootPartition": 0, "login": "", "order": 0}] diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_images_list.json b/libcloud/test/compute/fixtures/gig_g8/POST_images_list.json new file mode 100644 index 0000000000..bae87a12ac --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_images_list.json @@ -0,0 +1 @@ +[{"username": null, "status": "CREATED", "name": "Ubuntu 16.04 x64", "tags": null, "bootDiskSize": 3, "description": "", "memory": 512, "accountId": 0, "type": "Linux", "id": 4, "size": 3}, {"username": "cloudscalers", "status": "CREATED", "name": "Windows", "tags": null, "bootDiskSize": 50, "description": "", "memory": 2048, "accountId": 0, "type": "Windows", "id": 3, "size": 20}] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_locations_list.json b/libcloud/test/compute/fixtures/gig_g8/POST_locations_list.json new file mode 100644 index 0000000000..6934d3fabd --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_locations_list.json @@ -0,0 +1 @@ +[{"flag": "black", "gid": 66, "name": "devsetup", "locationCode": "devsetup", "id": 1}] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_machines_attachDisk.json b/libcloud/test/compute/fixtures/gig_g8/POST_machines_attachDisk.json new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_machines_attachDisk.json @@ -0,0 +1 @@ +true diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_machines_create.json b/libcloud/test/compute/fixtures/gig_g8/POST_machines_create.json new file mode 100644 index 0000000000..7ed6ff82de --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_machines_create.json @@ -0,0 +1 @@ +5 diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_machines_delete.json b/libcloud/test/compute/fixtures/gig_g8/POST_machines_delete.json new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_machines_delete.json @@ -0,0 +1 @@ +true diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_machines_detachDisk.json b/libcloud/test/compute/fixtures/gig_g8/POST_machines_detachDisk.json new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_machines_detachDisk.json @@ -0,0 +1 @@ +true diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_machines_get.json b/libcloud/test/compute/fixtures/gig_g8/POST_machines_get.json new file mode 100644 index 0000000000..91649bdc3f --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_machines_get.json @@ -0,0 +1 @@ +{"cloudspaceid": 11, "status": "RUNNING", "updateTime": 1583205761, "disks": [{"status": "ASSIGNED", "sizeMax": 10, "name": "Boot Disk", "descr": "Boot Disk", "exposed": false, "type": "B", "acl": {}, "order": 0, "path": "vm-7801/bootdisk-vm-7801", "pci_slot": 4, "pci_bus": 0, "id": 10474}, {"status": "ASSIGNED", "sizeMax": 10, "name": "Disk nr 1", "descr": "Disk nr 1", "exposed": false, "type": "D", "acl": {}, "order": 1, "path": "volumes/volume_10475", "pci_slot": 6, "pci_bus": 0, "id": 10475}], "locked": false, "name": "Tue Mar 3 03:22:00 2020 on cpu-03", "storage": 20, "sizeid": 1, "hostname": "", "creationTime": 1583205729, "osImage": "Ubuntu 16.04 x64", "acl": [{"status": "CONFIRMED", "type": "U", "right": "ACDRUX", "canBeDeleted": false, "userGroupId": "admin"}], "vcpus": 1, "accounts": [{"password": "ch8aUA7qS", "login": "user", "guid": ""}], "stackId": 2, "memory": 512, "id": 7801, "impactAlertHook": "", "imageid": 5, "interfaces": [{"status": "", "macAddress": "52:54:00:00:1e:e5", "referenceId": "", "deviceName": "v1e79-10001", "type": "bridge", "params": "", "networkId": 65537, "guid": "", "ipAddress": "192.168.103.253"}], "description": null} diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_machines_list.json b/libcloud/test/compute/fixtures/gig_g8/POST_machines_list.json new file mode 100644 index 0000000000..21957026bd --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_machines_list.json @@ -0,0 +1 @@ +[{"status": "RUNNING", "stackId": 1, "updateTime": 1582794164, "referenceId": "03af8e26-3cb0-48a2-a495-a22970f58034", "name": "mijnvm", "nics": [{"status": "", "macAddress": "52:54:00:00:00:5d", "referenceId": "", "deviceName": "v5d-10001", "ipAddress": "192.168.103.254", "params": "", "networkId": 65537, "guid": "", "type": "bridge"}], "sizeId": 0, "disks": [364, 365, 366, 367, 368], "creationTime": 1582792944, "imageId": 4, "storage": 14, "vcpus": 1, "memory": 512, "id": 93}] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_machines_reboot.json b/libcloud/test/compute/fixtures/gig_g8/POST_machines_reboot.json new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_machines_reboot.json @@ -0,0 +1 @@ +true diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_machines_start.json b/libcloud/test/compute/fixtures/gig_g8/POST_machines_start.json new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_machines_start.json @@ -0,0 +1 @@ +true diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_machines_stop.json b/libcloud/test/compute/fixtures/gig_g8/POST_machines_stop.json new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_machines_stop.json @@ -0,0 +1 @@ +true diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_portforwarding_create.json b/libcloud/test/compute/fixtures/gig_g8/POST_portforwarding_create.json new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_portforwarding_create.json @@ -0,0 +1 @@ +true diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_portforwarding_deleteByPort.json b/libcloud/test/compute/fixtures/gig_g8/POST_portforwarding_deleteByPort.json new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_portforwarding_deleteByPort.json @@ -0,0 +1 @@ +true diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_portforwarding_list.json b/libcloud/test/compute/fixtures/gig_g8/POST_portforwarding_list.json new file mode 100644 index 0000000000..4cc60fb852 --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_portforwarding_list.json @@ -0,0 +1 @@ +[{"protocol": "tcp", "localPort": "22", "machineName": "Fri Feb 28 19:54:00 2020 on cpu-04 (192.168.103.252)", "publicIp": "10.101.107.111", "localIp": "192.168.103.252", "machineId": 6268, "publicPort": "2400", "id": 0}, {"protocol": "tcp", "localPort": "22", "machineName": "Tue Mar 3 02:38:00 2020 on cpu-01 (192.168.103.254)", "publicIp": "10.101.107.111", "localIp": "192.168.103.254", "machineId": 7800, "publicPort": "2401", "id": 1}, {"protocol": "tcp", "localPort": "22", "machineName": "Tue Mar 3 03:22:00 2020 on cpu-03 (192.168.103.253)", "publicIp": "10.101.107.111", "localIp": "192.168.103.253", "machineId": 7801, "publicPort": "3100", "id": 2}] diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_sizes_list.json b/libcloud/test/compute/fixtures/gig_g8/POST_sizes_list.json new file mode 100644 index 0000000000..5022ccaf80 --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_sizes_list.json @@ -0,0 +1 @@ +[{"description": "", "disks": [10, 20, 50, 100, 250, 500, 1000, 2000], "vcpus": 1, "memory": 512, "id": 1, "name": "512 MiB Memory with 1 vcpu"}, {"description": "", "disks": [10, 20, 50, 100, 250, 500, 1000, 2000], "vcpus": 1, "memory": 1024, "id": 2, "name": "1 GiB Memory with 1 vcpu"}, {"description": "", "disks": [10, 20, 50, 100, 250, 500, 1000, 2000], "vcpus": 2, "memory": 2048, "id": 3, "name": "2 GiB Memory with 2 vcpus"}, {"description": "", "disks": [10, 20, 50, 100, 250, 500, 1000, 2000], "vcpus": 2, "memory": 4096, "id": 4, "name": "4 GiB Memory with 2 vcpus"}, {"description": "", "disks": [10, 20, 50, 100, 250, 500, 1000, 2000], "vcpus": 4, "memory": 8192, "id": 5, "name": "8 GiB Memory with 4 vcpus"}, {"description": "", "disks": [10, 20, 50, 100, 250, 500, 1000, 2000], "vcpus": 8, "memory": 16384, "id": 6, "name": "16 GiB Memory with 8 vcpus"}] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/gig_g8/POST_system_usermanager_whoami.json b/libcloud/test/compute/fixtures/gig_g8/POST_system_usermanager_whoami.json new file mode 100644 index 0000000000..56b1c1f329 --- /dev/null +++ b/libcloud/test/compute/fixtures/gig_g8/POST_system_usermanager_whoami.json @@ -0,0 +1 @@ +{"admin": true, "name": "admin"} diff --git a/libcloud/test/compute/fixtures/gogrid/image_list.json b/libcloud/test/compute/fixtures/gogrid/image_list.json deleted file mode 100644 index 761a14988b..0000000000 --- a/libcloud/test/compute/fixtures/gogrid/image_list.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "list": [ - { - "billingtokens": [ - { - "id": 46, - "name": "CentOS 5.3 32bit", - "price": 0 - } - ], - "description": "CentOS 5.3 (32-bit) w/ None", - "friendlyName": "CentOS 5.3 (32-bit) w/ None", - "id": 1531, - "isActive": true, - "isPublic": true, - "location": "gogrid/GSI-2c4c6672-69e1-4928-ac9d-a564521d55fe.img", - "name": "centos5.3_32_base", - "object": "serverimage", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "owner": { - "id": -1, - "name": "GoGrid", - "object": "customer" - }, - "price": 0, - "state": { - "description": "Image is available for adds", - "id": 2, - "name": "Available", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - }, - "updatedTime": 1257789046453 - }, - { - "billingtokens": [ - { - "id": 47, - "name": "CentOS 5.3 64bit", - "price": 0 - } - ], - "description": "CentOS 5.3 (64-bit) w/ None", - "friendlyName": "CentOS 5.3 (64-bit) w/ None", - "id": 1532, - "isActive": true, - "isPublic": true, - "location": "gogrid/GSI-939ef909-84b8-4a2f-ad56-02ccd7da05ff.img", - "name": "centos5.3_64_base", - "object": "serverimage", - "os": { - "description": "CentOS 5.3 (64-bit)", - "id": 17, - "name": "CentOS 5.3 (64-bit)", - "object": "option" - }, - "owner": { - "id": -1, - "name": "GoGrid", - "object": "customer" - }, - "price": 0, - "state": { - "description": "Image is available for adds", - "id": 2, - "name": "Available", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - }, - "updatedTime": 1257789076417 - }, - { - "billingtokens": [ - { - "id": 48, - "name": "RHEL 5.4 32bit", - "price": 0 - } - ], - "description": "RHEL 5.4 (32-bit) w/ None", - "friendlyName": "RHEL 5.4 (32-bit) w/ None", - "id": 1533, - "isActive": true, - "isPublic": true, - "location": "gogrid/GSI-4c88cb92-dd7b-4bb1-95b6-7cc93eb1d2aa.img", - "name": "rhel5.4_32_base", - "object": "serverimage", - "os": { - "description": "RHEL 5.4 (32-bit)", - "id": 18, - "name": "RHEL 5.4 (32-bit)", - "object": "option" - }, - "owner": { - "id": -1, - "name": "GoGrid", - "object": "customer" - }, - "price": 0, - "state": { - "description": "Image is available for adds", - "id": 2, - "name": "Available", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - }, - "updatedTime": 1257789076417 - }, - { - "billingtokens": [ - { - "id": 49, - "name": "RHEL 5.4 64bit", - "price": 0 - } - ], - "description": "RHEL 5.4 (64-bit) w/ None", - "friendlyName": "RHEL 5.4 (64-bit) w/ None", - "id": 1534, - "isActive": true, - "isPublic": true, - "location": "gogrid/GSI-2bd8ddb3-cc53-4a76-8188-0dce7537a422.img", - "name": "rhel5.4_64_base", - "object": "serverimage", - "os": { - "description": "RHEL 5.4 (64-bit)", - "id": 19, - "name": "RHEL 5.4 (64-bit)", - "object": "option" - }, - "owner": { - "id": -1, - "name": "GoGrid", - "object": "customer" - }, - "price": 0, - "state": { - "description": "Image is available for adds", - "id": 2, - "name": "Available", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - }, - "updatedTime": 1257789076417 - } - ], - "method": "/grid/image/list", - "status": "success", - "summary": { - "numpages": 0, - "returned": 59, - "start": 0, - "total": 59 - } -} diff --git a/libcloud/test/compute/fixtures/gogrid/image_save.json b/libcloud/test/compute/fixtures/gogrid/image_save.json deleted file mode 100644 index e20c6d8022..0000000000 --- a/libcloud/test/compute/fixtures/gogrid/image_save.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "list": [ - { - "architecture": { - "description": "32 bit OS", - "id": 1, - "name": "32-bit", - "object": "option" - }, - "billingtokens": [ - { - "id": 46, - "name": "CentOS 5.3 32bit", - "object": "billingtoken", - "price": 0 - } - ], - "createdTime": 1289119839685, - "description": "", - "friendlyName": "testimage", - "id": 5050, - "isActive": true, - "isPublic": false, - "location": "123/GSI-3ee65927-f80d-43df-92df-6c7e352f009c.img", - "name": "GSI-3ee65927-f80d-43df-92df-6c7e352f009c", - "object": "serverimage", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "owner": { - "id": 123, - "name": "name", - "object": "customer" - }, - "price": 0, - "state": { - "description": "Image is being saved", - "id": 1, - "name": "Saving", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - }, - "updatedTime": 1289119839685 - } - ], - "method": "/grid/image/save", - "status": "success", - "summary": { - "numpages": 0, - "returned": 1, - "start": 0, - "total": 1 - } -} diff --git a/libcloud/test/compute/fixtures/gogrid/ip_list.json b/libcloud/test/compute/fixtures/gogrid/ip_list.json deleted file mode 100644 index cf44eb9782..0000000000 --- a/libcloud/test/compute/fixtures/gogrid/ip_list.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "list": [ - { - "datacenter": { - "description": "US West 1 Datacenter", - "id": 1, - "name": "US-West-1", - "object": "option" - }, - "id": 5348099, - "ip": "192.168.75.66", - "object": "ip", - "public": true, - "state": { - "description": "IP is available to use", - "id": 1, - "name": "Unassigned", - "object": "option" - }, - "subnet": "192.168.75.64/255.255.255.240" - }, - { - "datacenter": { - "description": "US West 1 Datacenter", - "id": 1, - "name": "US-West-1", - "object": "option" - }, - "id": 5348100, - "ip": "192.168.75.67", - "object": "ip", - "public": true, - "state": { - "description": "IP is reserved or in use", - "id": 2, - "name": "Assigned", - "object": "option" - }, - "subnet": "192.168.75.64/255.255.255.240" - }, - { - "datacenter": { - "description": "US West 1 Datacenter", - "id": 1, - "name": "US-West-1", - "object": "option" - }, - "id": 5348101, - "ip": "192.168.75.68", - "object": "ip", - "public": false, - "state": { - "description": "IP is available to use", - "id": 1, - "name": "Unassigned", - "object": "option" - }, - "subnet": "192.168.75.64/255.255.255.240" - } - ], - "method": "/grid/ip/list", - "status": "success", - "summary": { - "numpages": 0, - "returned": 3, - "start": 0, - "total": 3 - } -} diff --git a/libcloud/test/compute/fixtures/gogrid/ip_list_empty.json b/libcloud/test/compute/fixtures/gogrid/ip_list_empty.json deleted file mode 100644 index 146bd9f45a..0000000000 --- a/libcloud/test/compute/fixtures/gogrid/ip_list_empty.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "list": [ - ], - "method": "/grid/ip/list", - "status": "success", - "summary": { - "numpages": 0, - "returned": 0, - "start": 0, - "total": 0 - } -} diff --git a/libcloud/test/compute/fixtures/gogrid/lookup_list_ip_datacenter.json b/libcloud/test/compute/fixtures/gogrid/lookup_list_ip_datacenter.json deleted file mode 100644 index 81a61c142e..0000000000 --- a/libcloud/test/compute/fixtures/gogrid/lookup_list_ip_datacenter.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "list": [ - { - "description": "US West 1 Datacenter", - "id": 1, - "name": "US-West-1", - "object": "option" - }, - { - "description": "US East 1 Datacenter", - "id": 2, - "name": "US-East-1", - "object": "option" - } - ], - "method": "/common/lookup/list", - "status": "success", - "summary": { - "numpages": 0, - "returned": 2, - "start": 0, - "total": 2 - } -} diff --git a/libcloud/test/compute/fixtures/gogrid/password_list.json b/libcloud/test/compute/fixtures/gogrid/password_list.json deleted file mode 100644 index a06a3ef7dd..0000000000 --- a/libcloud/test/compute/fixtures/gogrid/password_list.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "list": [ - { - "password": "bebebe", - "object": "password", - "username": "root", - "server": { - "id": 90967, - "image": { - "billingtokens": [ - { - "id": 46, - "name": "CentOS 5.3 32bit", - "price": 0 - } - ], - "description": "CentOS 5.3 (32-bit) w/ None", - "friendlyName": "CentOS 5.3 (32-bit) w/ None", - "id": 1531, - "isActive": true, - "isPublic": true, - "location": "gogrid/GSI-2c4c6672-69e1-4928-ac9d-a564521d55fe.img", - "name": "centos5.3_32_base", - "object": "serverimage", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "owner": { - "id": -1, - "name": "GoGrid", - "object": "customer" - }, - "price": 0, - "state": { - "description": "Image is available for adds", - "id": 2, - "name": "Available", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - }, - "updatedTime": 1257789046453 - }, - "ip": { - "id": 1659927, - "ip": "192.168.0.202", - "object": "ip", - "public": true, - "state": { - "description": "IP is reserved or in use", - "id": 2, - "name": "Assigned", - "object": "option" - }, - "subnet": "192.168.0.192/255.255.255.240" - }, - "isSandbox": false, - "name": "test1", - "object": "server", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "ram": { - "description": "Server with 512MB RAM", - "id": 1, - "name": "512MB", - "object": "option" - }, - "state": { - "description": "Server is in active state.", - "id": 1, - "name": "On", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - } - } - } - ], - "method": "/grid/server/list", - "status": "success", - "summary": { - "numpages": 0, - "returned": 1, - "start": 0, - "total": 1 - } -} diff --git a/libcloud/test/compute/fixtures/gogrid/server_add.json b/libcloud/test/compute/fixtures/gogrid/server_add.json deleted file mode 100644 index 35a4ca1af7..0000000000 --- a/libcloud/test/compute/fixtures/gogrid/server_add.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "list": [ - { - "image": { - "billingtokens": [ - { - "id": 46, - "name": "CentOS 5.3 32bit", - "price": 0 - } - ], - "description": "CentOS 5.3 (32-bit) w/ None", - "friendlyName": "CentOS 5.3 (32-bit) w/ None", - "id": 1531, - "isActive": true, - "isPublic": true, - "location": "gogrid/GSI-2c4c6672-69e1-4928-ac9d-a564521d55fe.img", - "name": "centos5.3_32_base", - "object": "serverimage", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "owner": { - "id": -1, - "name": "GoGrid", - "object": "customer" - }, - "price": 0, - "state": { - "description": "Image is available for adds", - "id": 2, - "name": "Available", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - }, - "updatedTime": 1257789046453 - }, - "ip": { - "id": 1659927, - "ip": "192.168.0.202", - "object": "ip", - "public": true, - "state": { - "description": "IP is reserved or in use", - "id": 2, - "name": "Assigned", - "object": "option" - }, - "subnet": "192.168.0.192/255.255.255.240" - }, - "isSandbox": false, - "name": "test1", - "object": "server", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "ram": { - "description": "Server with 512MB RAM", - "id": 1, - "name": "512MB", - "object": "option" - }, - "state": { - "description": "Server is in active state.", - "id": 1, - "name": "On", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - } - } - ], - "method": "/grid/server/add", - "status": "success", - "summary": { - "numpages": 0, - "returned": 1, - "start": 0, - "total": 1 - } -} diff --git a/libcloud/test/compute/fixtures/gogrid/server_delete.json b/libcloud/test/compute/fixtures/gogrid/server_delete.json deleted file mode 100644 index 068ff83013..0000000000 --- a/libcloud/test/compute/fixtures/gogrid/server_delete.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "list": [ - { - "id": 90967, - "image": { - "billingtokens": [ - { - "id": 46, - "name": "CentOS 5.3 32bit", - "price": 0 - } - ], - "description": "CentOS 5.3 (32-bit) w/ None", - "friendlyName": "CentOS 5.3 (32-bit) w/ None", - "id": 1531, - "isActive": true, - "isPublic": true, - "location": "gogrid/GSI-2c4c6672-69e1-4928-ac9d-a564521d55fe.img", - "name": "centos5.3_32_base", - "object": "serverimage", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "owner": { - "id": -1, - "name": "GoGrid", - "object": "customer" - }, - "price": 0, - "state": { - "description": "Image is available for adds", - "id": 2, - "name": "Available", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - }, - "updatedTime": 1257789046453 - }, - "ip": { - "id": 1659927, - "ip": "192.168.0.202", - "object": "ip", - "public": true, - "state": { - "description": "IP is reserved or in use", - "id": 2, - "name": "Assigned", - "object": "option" - }, - "subnet": "192.168.0.192/255.255.255.240" - }, - "isSandbox": false, - "name": "test1", - "object": "server", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "ram": { - "description": "Server with 512MB RAM", - "id": 1, - "name": "512MB", - "object": "option" - }, - "state": { - "description": "Server is in active state.", - "id": 1, - "name": "On", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - } - } - ], - "method": "/grid/server/delete", - "status": "success", - "summary": { - "numpages": 0, - "returned": 1, - "start": 0, - "total": 1 - } -} diff --git a/libcloud/test/compute/fixtures/gogrid/server_edit.json b/libcloud/test/compute/fixtures/gogrid/server_edit.json deleted file mode 100644 index 0133a1bb7f..0000000000 --- a/libcloud/test/compute/fixtures/gogrid/server_edit.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "list": [ - { - "id": 90967, - "image": { - "billingtokens": [ - { - "id": 46, - "name": "CentOS 5.3 32bit", - "price": 0 - } - ], - "description": "CentOS 5.3 (32-bit) w/ None", - "friendlyName": "CentOS 5.3 (32-bit) w/ None", - "id": 1531, - "isActive": true, - "isPublic": true, - "location": "gogrid/GSI-2c4c6672-69e1-4928-ac9d-a564521d55fe.img", - "name": "centos5.3_32_base", - "object": "serverimage", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "owner": { - "id": -1, - "name": "GoGrid", - "object": "customer" - }, - "price": 0, - "state": { - "description": "Image is available for adds", - "id": 2, - "name": "Available", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - }, - "updatedTime": 1257789046453 - }, - "ip": { - "id": 1659927, - "ip": "192.168.0.202", - "object": "ip", - "public": true, - "state": { - "description": "IP is reserved or in use", - "id": 2, - "name": "Assigned", - "object": "option" - }, - "subnet": "192.168.0.192/255.255.255.240" - }, - "isSandbox": false, - "name": "test1", - "object": "server", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "ram": { - "description": "Server with 512MB RAM", - "id": 1, - "name": "512MB", - "object": "option" - }, - "state": { - "description": "Server is in active state.", - "id": 1, - "name": "On", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - } - } - ], - "method": "/grid/server/edit", - "status": "success", - "summary": { - "numpages": 0, - "returned": 1, - "start": 0, - "total": 1 - } -} diff --git a/libcloud/test/compute/fixtures/gogrid/server_list.json b/libcloud/test/compute/fixtures/gogrid/server_list.json deleted file mode 100644 index 23e43ff78b..0000000000 --- a/libcloud/test/compute/fixtures/gogrid/server_list.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "list": [ - { - "id": 90967, - "image": { - "billingtokens": [ - { - "id": 46, - "name": "CentOS 5.3 32bit", - "price": 0 - } - ], - "description": "CentOS 5.3 (32-bit) w/ None", - "friendlyName": "CentOS 5.3 (32-bit) w/ None", - "id": 1531, - "isActive": true, - "isPublic": true, - "location": "gogrid/GSI-2c4c6672-69e1-4928-ac9d-a564521d55fe.img", - "name": "centos5.3_32_base", - "object": "serverimage", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "owner": { - "id": -1, - "name": "GoGrid", - "object": "customer" - }, - "price": 0, - "state": { - "description": "Image is available for adds", - "id": 2, - "name": "Available", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - }, - "updatedTime": 1257789046453 - }, - "ip": { - "id": 1659927, - "ip": "192.168.0.202", - "object": "ip", - "public": true, - "state": { - "description": "IP is reserved or in use", - "id": 2, - "name": "Assigned", - "object": "option" - }, - "subnet": "192.168.0.192/255.255.255.240" - }, - "isSandbox": false, - "name": "test1", - "description": "test server", - "object": "server", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "ram": { - "description": "Server with 512MB RAM", - "id": 1, - "name": "512MB", - "object": "option" - }, - "state": { - "description": "Server is in active state.", - "id": 1, - "name": "On", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - } - } - ], - "method": "/grid/server/list", - "status": "success", - "summary": { - "numpages": 0, - "returned": 1, - "start": 0, - "total": 1 - } -} diff --git a/libcloud/test/compute/fixtures/gogrid/server_power.json b/libcloud/test/compute/fixtures/gogrid/server_power.json deleted file mode 100644 index 71ba6780b8..0000000000 --- a/libcloud/test/compute/fixtures/gogrid/server_power.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "list": [ - { - "id": 90967, - "image": { - "billingtokens": [ - { - "id": 46, - "name": "CentOS 5.3 32bit", - "price": 0 - } - ], - "description": "CentOS 5.3 (32-bit) w/ None", - "friendlyName": "CentOS 5.3 (32-bit) w/ None", - "id": 1531, - "isActive": true, - "isPublic": true, - "location": "gogrid/GSI-2c4c6672-69e1-4928-ac9d-a564521d55fe.img", - "name": "centos5.3_32_base", - "object": "serverimage", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "owner": { - "id": -1, - "name": "GoGrid", - "object": "customer" - }, - "price": 0, - "state": { - "description": "Image is available for adds", - "id": 2, - "name": "Available", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - }, - "updatedTime": 1257789046453 - }, - "ip": { - "id": 1659927, - "ip": "192.168.0.202", - "object": "ip", - "public": true, - "state": { - "description": "IP is reserved or in use", - "id": 2, - "name": "Assigned", - "object": "option" - }, - "subnet": "192.168.0.192/255.255.255.240" - }, - "isSandbox": false, - "name": "test1", - "object": "server", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "ram": { - "description": "Server with 512MB RAM", - "id": 1, - "name": "512MB", - "object": "option" - }, - "state": { - "description": "Server is in active state.", - "id": 1, - "name": "On", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - } - } - ], - "method": "/grid/server/power", - "status": "success", - "summary": { - "numpages": 0, - "returned": 1, - "start": 0, - "total": 1 - } -} diff --git a/libcloud/test/compute/fixtures/gogrid/server_power_fail.json b/libcloud/test/compute/fixtures/gogrid/server_power_fail.json deleted file mode 100644 index b938016483..0000000000 --- a/libcloud/test/compute/fixtures/gogrid/server_power_fail.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "list": [ - { - "id": 90967, - "image": { - "billingtokens": [ - { - "id": 46, - "name": "CentOS 5.3 32bit", - "price": 0 - } - ], - "description": "CentOS 5.3 (32-bit) w/ None", - "friendlyName": "CentOS 5.3 (32-bit) w/ None", - "id": 1531, - "isActive": true, - "isPublic": true, - "location": "gogrid/GSI-2c4c6672-69e1-4928-ac9d-a564521d55fe.img", - "name": "centos5.3_32_base", - "object": "serverimage", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "owner": { - "id": -1, - "name": "GoGrid", - "object": "customer" - }, - "price": 0, - "state": { - "description": "Image is available for adds", - "id": 2, - "name": "Available", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - }, - "updatedTime": 1257789046453 - }, - "ip": { - "id": 1659927, - "ip": "192.168.0.202", - "object": "ip", - "public": true, - "state": { - "description": "IP is reserved or in use", - "id": 2, - "name": "Assigned", - "object": "option" - }, - "subnet": "192.168.0.192/255.255.255.240" - }, - "isSandbox": false, - "name": "test1", - "object": "server", - "os": { - "description": "CentOS 5.3 (32-bit)", - "id": 16, - "name": "CentOS 5.3 (32-bit)", - "object": "option" - }, - "ram": { - "description": "Server with 512MB RAM", - "id": 1, - "name": "512MB", - "object": "option" - }, - "state": { - "description": "Server is in active state.", - "id": 1, - "name": "On", - "object": "option" - }, - "type": { - "description": "Web or Application Server", - "id": 1, - "name": "Web Server", - "object": "option" - } - } - ], - "method": "/grid/server/power", - "status": "failure", - "summary": { - "numpages": 0, - "returned": 1, - "start": 0, - "total": 1 - } -} diff --git a/libcloud/test/compute/fixtures/gridscale/create_image.json b/libcloud/test/compute/fixtures/gridscale/create_image.json new file mode 100644 index 0000000000..ba433df0de --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/create_image.json @@ -0,0 +1,4 @@ +{ +"request_uuid": "x123xx1x-123x-1x12-123x-123xxx123x1x", +"object_uuid": "690de890-13c0-4e76-8a01-e10ba8786e53" +} diff --git a/libcloud/test/compute/fixtures/gridscale/create_image_dict.json b/libcloud/test/compute/fixtures/gridscale/create_image_dict.json new file mode 100644 index 0000000000..3714d5b712 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/create_image_dict.json @@ -0,0 +1,25 @@ +{ + "adf09edd-9411-43b1-b99e-b92070e65f22": { + "description": null, + "ostype": null, + "version": null, + "location_country": "de", + "location_name": "de/fra", + "capacity": 50, + "create_time": "2019-06-21T09:28:58Z", + "location_iata": "fra", + "name": "test.test", + "status": "active", + "labels": [], + "parent_uuid": "e66bb753_4a03_4ee2_a069_a601f393c9ee", + "usage_in_minutes": 225600, + "license_product_no": null, + "current_price": 0.99264, + "object_uuid": "690de890_13c0_4e76_8a01_e10ba8786e53", + "change_time": "2019-06-21T09:28:58Z", + "private": true, + "metadata": {}, + "distro": null, + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + } + } diff --git a/libcloud/test/compute/fixtures/gridscale/create_ip.json b/libcloud/test/compute/fixtures/gridscale/create_ip.json new file mode 100644 index 0000000000..0c9691dc65 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/create_ip.json @@ -0,0 +1,5 @@ + +{ +"request_uuid": "x123xx1x-123x-1x12-123x-123xxx123x1x", +"object_uuid": "690de890-13c0-4e76-8a01-e10ba8786e53" +} diff --git a/libcloud/test/compute/fixtures/gridscale/create_ip_response_dict.json b/libcloud/test/compute/fixtures/gridscale/create_ip_response_dict.json new file mode 100644 index 0000000000..481649c6ac --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/create_ip_response_dict.json @@ -0,0 +1,182 @@ +{ + "eaa06a81-39f5-48e4-ba5b-fe1be151118b": { + "create_time": "2019-06-07T15:00:03Z", + "name": "Default IP", + "location_country": "de", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "reverse_dns": "static-2a06-2380-0-1-229.ipv6.gridserver.io", + "current_price": 0, + "family": 6, + "location_iata": "fra", + "location_name": "de/fra", + "status": "active", + "relations": { + "loadbalancers": [], + "servers": [] + }, + "object_uuid": "eaa06a81-39f5-48e4-ba5b-fe1be151118b", + "change_time": "2019-06-07T15:00:03Z", + "failover": false, + "usage_in_minutes": 0, + "ip": "2a06:2380:0:1::229", + "delete_block": false, + "prefix": "2a06:2380:0:1::229/128", + "labels": [] + }, + "56b8d161-325b-4fd4-a453-6101cf563713": { + "create_time": "2019-06-07T12:57:26Z", + "name": "test.test_ip", + "location_country": "de", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "reverse_dns": "static-185-102-95-236.ipv4.gridserver.io", + "current_price": 1.47738, + "family": 4, + "location_iata": "fra", + "location_name": "de/fra", + "status": "active", + "relations": { + "loadbalancers": [], + "servers": [ + { + "create_time": "2019-06-07T12:57:30Z", + "server_uuid": "1479405e-d46c-47a2-91e8-eb43951c899f", + "server_name": "test.test" + } + ] + }, + "object_uuid": "56b8d161-325b-4fd4-a453-6101cf563713", + "change_time": "2019-06-07T12:57:26Z", + "failover": false, + "usage_in_minutes": 24623, + "ip": "185.102.95.236", + "delete_block": false, + "prefix": "185.102.95.236/32", + "labels": [] + }, + "0235e7c4-18c9-4b2f-a3c3-2d9624a67498": { + "create_time": "2019-06-07T14:59:17Z", + "name": "Default IP", + "location_country": "de", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "reverse_dns": "static-2a06-2380-0-1-211.ipv6.gridserver.io", + "current_price": 0, + "family": 6, + "location_iata": "fra", + "location_name": "de/fra", + "status": "active", + "relations": { + "loadbalancers": [], + "servers": [ + { + "create_time": "2019-06-07T14:59:47Z", + "server_uuid": "1479405e-d46c-47a2-91e8-eb43951c899f", + "server_name": "test.test" + } + ] + }, + "object_uuid": "0235e7c4-18c9-4b2f-a3c3-2d9624a67498", + "change_time": "2019-06-07T14:59:17Z", + "failover": false, + "usage_in_minutes": 0, + "ip": "2a06:2380:0:1::211", + "delete_block": false, + "prefix": "2a06:2380:0:1::211/128", + "labels": [] + }, + "ace17032-3127-4c9e-943b-a2a4679984a3": { + "create_time": "2019-06-14T09:47:37Z", + "name": "test.test_ip", + "location_country": "de", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "reverse_dns": "static-185-201-146-56.ipv4.gridserver.io", + "current_price": 0.88392, + "family": 4, + "location_iata": "fra", + "location_name": "de/fra", + "status": "active", + "relations": { + "loadbalancers": [], + "servers": [] + }, + "object_uuid": "ace17032-3127-4c9e-943b-a2a4679984a3", + "change_time": "2019-06-14T09:47:37Z", + "failover": false, + "usage_in_minutes": 14732, + "ip": "185.201.146.56", + "delete_block": false, + "prefix": "185.201.146.56/32", + "labels": [] + }, + "63b57604-40a2-454c-a143-69300ea6941c": { + "create_time": "2019-06-14T17:31:18Z", + "name": "test.test_ip", + "location_country": "de", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "reverse_dns": "static-185-102-95-79.ipv4.gridserver.io", + "current_price": 0.85614, + "family": 4, + "location_iata": "fra", + "location_name": "de/fra", + "status": "active", + "relations": { + "loadbalancers": [], + "servers": [] + }, + "object_uuid": "63b57604-40a2-454c-a143-69300ea6941c", + "change_time": "2019-06-14T17:31:18Z", + "failover": false, + "usage_in_minutes": 14269, + "ip": "185.102.95.79", + "delete_block": false, + "prefix": "185.102.95.79/32", + "labels": [] + }, + "fa81b132-6dd9-4fc6-b7f9-844f89e50b15": { + "create_time": "2019-06-07T13:42:55Z", + "name": "test.test_ip", + "location_country": "de", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "reverse_dns": "static-185-102-95-217.ipv4.gridserver.io", + "current_price": 1.47462, + "family": 4, + "location_iata": "fra", + "location_name": "de/fra", + "status": "active", + "relations": { + "loadbalancers": [], + "servers": [] + }, + "object_uuid": "fa81b132-6dd9-4fc6-b7f9-844f89e50b15", + "change_time": "2019-06-07T13:42:55Z", + "failover": false, + "usage_in_minutes": 24577, + "ip": "185.102.95.217", + "delete_block": false, + "prefix": "185.102.95.217/32", + "labels": [] + }, + "4f1bef38-b970-4ff3-b891-5ac03af5bdeb": { + "create_time": "2019-06-14T14:10:11Z", + "name": "test.test_ip", + "location_country": "de", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "reverse_dns": "static-185-201-147-66.ipv4.gridserver.io", + "current_price": 0.8682, + "family": 4, + "location_iata": "fra", + "location_name": "de/fra", + "status": "active", + "relations": { + "loadbalancers": [], + "servers": [] + }, + "object_uuid": "4f1bef38-b970-4ff3-b891-5ac03af5bdeb", + "change_time": "2019-06-14T14:10:11Z", + "failover": false, + "usage_in_minutes": 14470, + "ip": "185.201.147.66", + "delete_block": false, + "prefix": "185.201.147.66/32", + "labels": [] + } + } diff --git a/libcloud/test/compute/fixtures/gridscale/create_network.json b/libcloud/test/compute/fixtures/gridscale/create_network.json new file mode 100644 index 0000000000..f4a70e34f2 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/create_network.json @@ -0,0 +1,37 @@ +{ + "networks": { + "1196529b-a8de-417f-ac95-0e13ef4fdfd7": { + "delete_block": false, + "relations": { + "servers": [ + { + "bootdevice": false, + "create_time": "2019-06-07T14:59:47Z", + "ordering": 0, + "l3security": [ + "185.102.95.236/32" + ], + "mac": "16:63:95:5d:1f:01", + "object_name": "test.test", + "network_uuid": "1196529b-a8de-417f-ac95-0e13ef4fdfd7", + "object_uuid": "1479405e-d46c-47a2-91e8-eb43951c899f" + } + ], + "vlans": [] + }, + "labels": [], + "network_type": "network", + "change_time": "2019-04-08T09:10:08Z", + "status": "active", + "create_time": "2018-12-06T13:09:08Z", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "location_name": "de/fra", + "name": "network", + "location_iata": "fra", + "l2security": true, + "public_net": true, + "location_country": "de", + "object_uuid": "1196529b-a8de-417f-ac95-0e13ef4fdfd7" + } + } +} diff --git a/libcloud/test/compute/fixtures/gridscale/create_node.json b/libcloud/test/compute/fixtures/gridscale/create_node.json new file mode 100644 index 0000000000..0c9691dc65 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/create_node.json @@ -0,0 +1,5 @@ + +{ +"request_uuid": "x123xx1x-123x-1x12-123x-123xxx123x1x", +"object_uuid": "690de890-13c0-4e76-8a01-e10ba8786e53" +} diff --git a/libcloud/test/compute/fixtures/gridscale/create_node_dict.json b/libcloud/test/compute/fixtures/gridscale/create_node_dict.json new file mode 100644 index 0000000000..ee91718a32 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/create_node_dict.json @@ -0,0 +1,83 @@ +{ + "1479405e-d46c-47a2-91e8-eb43951c899f": { + "hardware_profile": "default", + "relations": { + "storages": [ + { + "storage_type": "storage", + "last_used_template": "a5112c72-c9fa-4a23-8115-5f6303eb047b", + "create_time": "2019-06-24T10:10:51Z", + "capacity": 50, + "lun": 0, + "controller": 0, + "target": 0, + "object_uuid": "e66bb753-4a03-4ee2-a069-a601f393c9ee", + "bootdevice": true, + "object_name": "linux", + "license_product_no": null, + "bus": 0 + } + ], + "networks": [ + { + "mac": "16:63:95:5d:1f:01", + "network_uuid": "1196529b-a8de-417f-ac95-0e13ef4fdfd7", + "network_type": "network", + "mcast": null, + "create_time": "2019-06-07T14:59:47Z", + "public_net": true, + "partner_uuid": "95a2980b-7012-43dd-81f2-07577cfcb9f0", + "ordering": 0, + "vlan": null, + "firewall": null, + "l2security": true, + "firewall_template_uuid": null, + "vxlan": null, + "object_uuid": "1196529b-a8de-417f-ac95-0e13ef4fdfd7", + "bootdevice": false, + "object_name": "network", + "l3security": [ + "185.102.95.236/32" + ] + } + ], + "isoimages": [], + "public_ips": [ + { + "object_uuid": "56b8d161-325b-4fd4-a453-6101cf563713", + "ip": "185.102.95.236", + "family": 4, + "create_time": "2019-06-07T12:57:30Z", + "prefix": "185.102.95.236/32" + }, + { + "object_uuid": "0235e7c4-18c9-4b2f-a3c3-2d9624a67498", + "ip": "2a06:2380:0:1::211", + "family": 6, + "create_time": "2019-06-07T14:59:47Z", + "prefix": "2a06:2380:0:1::211/128" + } + ] + }, + "memory": 10, + "location_iata": "fra", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "change_time": "2019-06-17T14:13:31Z", + "object_uuid": "1479405e-d46c-47a2-91e8-eb43951c899f", + "labels": [], + "usage_in_minutes_cores": 25030, + "cores": 2, + "console_token": "088f625818dc5b9114f8bee8e7f67d7b5510fc5159968a02752875f4b55ca911d59fd6cbe3eeb60358c0f353b1d7cbb9", + "availability_zone": null, + "location_name": "de/fra", + "create_time": "2019-06-07T12:56:44Z", + "location_country": "de", + "legacy": false, + "current_price": 17.89645, + "power": false, + "status": "active", + "auto_recovery": true, + "name": "test.test", + "usage_in_minutes_memory": 125150 + } + } diff --git a/libcloud/test/compute/fixtures/gridscale/create_node_response_dict.json b/libcloud/test/compute/fixtures/gridscale/create_node_response_dict.json new file mode 100644 index 0000000000..d6fed64549 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/create_node_response_dict.json @@ -0,0 +1,7 @@ +{ +"x123xx1x-123x-1x12-123x-123xxx123x1x": { +"create_time": "2018-06-05T11:31:12Z", +"status": "done", +"message": "Success." +} +} diff --git a/libcloud/test/compute/fixtures/gridscale/create_volume.json b/libcloud/test/compute/fixtures/gridscale/create_volume.json new file mode 100644 index 0000000000..ba433df0de --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/create_volume.json @@ -0,0 +1,4 @@ +{ +"request_uuid": "x123xx1x-123x-1x12-123x-123xxx123x1x", +"object_uuid": "690de890-13c0-4e76-8a01-e10ba8786e53" +} diff --git a/libcloud/test/compute/fixtures/gridscale/create_volume_response_dict.json b/libcloud/test/compute/fixtures/gridscale/create_volume_response_dict.json new file mode 100644 index 0000000000..a47bb048af --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/create_volume_response_dict.json @@ -0,0 +1,37 @@ +{ + "e66bb753-4a03-4ee2-a069-a601f393c9ee": { + "snapshots": [], + "capacity": 50, + "relations": { + "snapshot_schedules": [], + "servers": [ + { + "create_time": "2019-06-24T10:10:51Z", + "bootdevice": true, + "lun": 0, + "bus": 0, + "object_name": "test.test", + "target": 0, + "object_uuid": "1479405e-d46c-47a2-91e8-eb43951c899f", + "controller": 0 + } + ] + }, + "storage_type": "storage", + "last_used_template": "a5112c72-c9fa-4a23-8115-5f6303eb047b", + "object_uuid": "e66bb753-4a03-4ee2-a069-a601f393c9ee", + "license_product_no": null, + "location_country": "de", + "current_price": 3.09298, + "create_time": "2019-06-14T17:31:10Z", + "change_time": "2019-06-14T17:31:10Z", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "labels": [], + "name": "linux", + "usage_in_minutes": 702950, + "location_name": "de/fra", + "location_iata": "fra", + "status": "active", + "parent_uuid": null + } + } diff --git a/libcloud/test/compute/fixtures/gridscale/ex_list_ips.json b/libcloud/test/compute/fixtures/gridscale/ex_list_ips.json new file mode 100644 index 0000000000..8b98cd4ac2 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/ex_list_ips.json @@ -0,0 +1,34 @@ +{ + "ips": { + "56b8d161-325b-4fd4-a453-6101cf563713": { + "family": 4, + "location_uuid": "45ed677b-3702-4b36", + "object_uuid": "56b8d161-325b-4fd4", + "change_time": "2019-06-07T12:57:26Z", + "relations": { + "loadbalancers": [], + "servers": [ + { + "server_name": "test.test", + "server_uuid": "1479405e-d46c-47a2-91e8-eb43951c899f", + "create_time": "2019-06-07T12:57:30Z" + } + ] + }, + "create_time": "2019-06-07T12:57:26Z", + "location_name": "de/fra", + "location_country": "de", + "location_iata": "fra", + "ip": "185.102.95.236", + "labels": [], + "reverse_dns": "static-185-102-95-236.ipv4.gridserver.io", + "delete_block": false, + "failover": false, + "usage_in_minutes": 27893, + "current_price": 1.67358, + "status": "active", + "name": "test.test_ip", + "prefix": "185.102.95.236/32" + } + } +} diff --git a/libcloud/test/compute/fixtures/gridscale/ex_list_networks.json b/libcloud/test/compute/fixtures/gridscale/ex_list_networks.json new file mode 100644 index 0000000000..d7b44544f6 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/ex_list_networks.json @@ -0,0 +1,37 @@ +{ + "networks": { + "1196529b-a8de-417f-ac95-0e13ef4fdfd7": { + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "network_type": "network", + "delete_block": false, + "relations": { + "vlans": [], + "servers": [ + { + "ordering": 0, + "create_time": "2019-06-07T14:59:47Z", + "l3security": [ + "185.102.95.236/32" + ], + "mac": "16:63:95:5d:1f:01", + "object_name": "test.test", + "bootdevice": false, + "network_uuid": "1196529b-a8de-417f", + "object_uuid": "1479405e-d46c-47a2" + } + ] + }, + "location_iata": "fra", + "create_time": "2018-12-06T13:09:08Z", + "location_name": "de/fra", + "location_country": "de", + "name": "network", + "change_time": "2019-04-08T09:10:08Z", + "l2security": true, + "public_net": true, + "object_uuid": "1196529b-a8de-417f", + "status": "active", + "labels": [] + } + } +} diff --git a/libcloud/test/compute/fixtures/gridscale/ex_start_node.json b/libcloud/test/compute/fixtures/gridscale/ex_start_node.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/test/compute/fixtures/gridscale/get_image.json b/libcloud/test/compute/fixtures/gridscale/get_image.json new file mode 100644 index 0000000000..835365bafe --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/get_image.json @@ -0,0 +1,23 @@ +{ + "templates":{ + "capacity": 20, + "name": "Plesk", + "license_product_no": null, + "ostype": "1click", + "object_uuid": "12345", + "distro": "Plesk", + "change_time": "2019-01-03T17:06:49Z", + "location_country": "de", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "usage_in_minutes": 23795240, + "create_time": "2017-03-26T17:51:54Z", + "status": "active", + "labels": ["karl"], + "current_price": 104.699056, + "location_iata": "fra", + "location_name": "de/fra", + "version": "Ubuntu 16.04 LTS & Plesk Onyx", + "description": "Plesk", + "private": false +} +} diff --git a/libcloud/test/compute/fixtures/gridscale/ips_to_node.json b/libcloud/test/compute/fixtures/gridscale/ips_to_node.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/test/compute/fixtures/gridscale/list_images.json b/libcloud/test/compute/fixtures/gridscale/list_images.json new file mode 100644 index 0000000000..745ceb5017 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/list_images.json @@ -0,0 +1,588 @@ +{ + "templates": { + "adf09edd-9411-43b1-b99e-b92070e65f22": { + "description": null, + "ostype": null, + "version": null, + "location_country": "de", + "location_name": "de/fra", + "capacity": 50, + "create_time": "2019-06-21T09:28:58Z", + "location_iata": "fra", + "name": "test.test", + "status": "active", + "labels": [], + "usage_in_minutes": 225600, + "license_product_no": null, + "current_price": 0.99264, + "object_uuid": "adf09edd-9411-43b1-b99e-b92070e65f22", + "change_time": "2019-06-21T09:28:58Z", + "private": true, + "metadata": {}, + "distro": null, + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "ec4ef18f-84df-42bb-b7c4-c2957635ee53": { + "description": "no swap", + "ostype": "linux", + "version": "16.04 LTS", + "location_country": "de", + "location_name": "de/fra", + "capacity": 5, + "create_time": "2016-05-13T18:51:41Z", + "location_iata": "fra", + "name": "Ubuntu 16.04 LTS (Xenial Xerus)", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "ec4ef18f-84df-42bb-b7c4-c2957635ee53", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": {}, + "distro": "Ubuntu", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "4db64bfc-9fb2-4976-80b5-94ff43b1233a": { + "description": "(Bionic Beaver)", + "ostype": "linux", + "version": "18.04 LTS", + "location_country": "de", + "location_name": "de/fra", + "capacity": 10, + "create_time": "2018-05-03T08:49:33Z", + "location_iata": "fra", + "name": "Ubuntu 18.04 LTS", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "4db64bfc-9fb2-4976-80b5-94ff43b1233a", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": {}, + "distro": "Ubuntu", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "ae05b3d7-f9ca-4099-8f5a-ff75bc4bc5a4": { + "description": "Wordpress", + "ostype": "1click", + "version": "Ubuntu 16.04 LTS & Wordpress", + "location_country": "de", + "location_name": "de/fra", + "capacity": 3, + "create_time": "2017-04-10T15:38:20Z", + "location_iata": "fra", + "name": "WordPress", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "ae05b3d7-f9ca-4099-8f5a-ff75bc4bc5a4", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": { + "icon": "/img/assets/logos_marketplace/wordpress.png", + "description": { + "de": "# Übersicht\n\nWordPress ist eine freie Webanwendung zur Verwaltung der Inhalte einer Website (wie z. B. Texte und Bilder, aber auch Audio- und Video-Dateien). Sie bietet sich besonders zum Aufbau und zur Pflege eines Weblogs (\"Blog\") an, da sie jeden Beitrag einer oder mehreren frei erstellbaren Kategorien zuweisen kann und dazu automatisch die entsprechenden Navigationselemente erzeugt. Parallel kann WordPress auch hierarchische Seiten verwalten und gestattet den Einsatz als Content-Management-System (CMS).\n\n# Dokumentation\n\nNachdem der WordPress-Server fertiggestellt und eingeschaltet ist, verbinde dich mit Hilfe unserer VNC Konsole (>\\_) auf den Bildschirm des Servers. Dort findest du Informationen bezüglich Zugangsdaten und Zugriff auf WordPress.\n\nFür weitere Dokumentation kannst du die **[WordPress Dokumentation](https://codex.wordpress.org/Main_Page)** lesen.\n\n# Nutzungsbedingungen\n\nSiehe [GNU General Public License v2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) (GPL).", + "en": "# Overview\n\nWordPress is a free web application for managing the contents of a website (such as texts and images, but also audio and video files). It is particularly useful for building and maintaining a weblog (\"blog\"), as it can assign each post to one or more freely definable categories and automatically generates the corresponding navigation elements for this purpose. At the same time, WordPress can also manage hierarchical pages and allows its use as a content management system (CMS).\n\n# Documentation\n\nAfter the WordPress server is ready and turned on, connect to the server's screen using our VNC console (>\\_). There you will find information regarding login credentials and access to WordPress.\n\nFor more documentation you can read the **[WordPress documentation](https://codex.wordpress.org/Main_Page)**.\n\n# Terms of Use\n\nSee [GNU General Public License v2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) (GPL)." + }, + "setup": { + "storage_type": "storage_insane", + "memory": 2, + "capacity": 50, + "cores": 1 + }, + "os": "Ubuntu 16.04 LTS", + "other_software": { + "PHP": "7.0", + "MariaDB": "10.0", + "Apache": "2.4" + }, + "publisher": "WordPress Foundation", + "version": "4.7", + "category": "CMS", + "top": false, + "licence": "GNU General Public License v2 (GPLv2)", + "short_description": { + "de": "Das meistgenutzte CMS", + "en": "The most used CMS" + } + }, + "distro": "WordPress", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "c1f05dde-ed3c-4ab5-ab77-d3a9c6966852": { + "description": "Plesk", + "ostype": "1click", + "version": "Ubuntu 16.04 LTS & Plesk Onyx", + "location_country": "de", + "location_name": "de/fra", + "capacity": 20, + "create_time": "2017-03-26T17:51:54Z", + "location_iata": "fra", + "name": "Plesk", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "c1f05dde-ed3c-4ab5-ab77-d3a9c6966852", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": { + "icon": "/img/assets/logos_marketplace/plesk.png", + "description": { + "de": "# Übersicht\n\nPlesk ist eine Webserver-Distribution mit Konfigurationstool für Webhosting, entwickelt von Parallels Inc. (jetzt Odin).\nBenutzer können Server ohne detaillierte Kenntnisse des Betriebssystems verwalten. Es vereinfacht komplexe Operationen wie die Einrichtung eines Mail- und Webservers für eine Domain.\n\n# Dokumentation\n\nNachdem du den Plesk Server erstellt und gestartet hast, melde dich am besten als \"root\" per SSH am Server an. Nach erfolgreicher Anmeldung werden in der Konsole weitere Informationen zum Zugriff auf das plesk-Panel angezeigt.\n\nFür weitere Dokumentation kannst du die **[Plesk-Dokumentation](https://docs.plesk.com/en-US/onyx/)** lesen.\n\n# Nutzungsbedingungen\n\nSiehe [Plesk Nutzungsbedingungen](https://www.plesk.com/legal/#terms-of-use)", + "en": "# Overview\n\nPlesk is a web server distribution with configuration tool for web hosting, developed by Parallels Inc. (now Odin).\nUsers can manage servers without in-depth knowledge of the operating system. It simplifies complex operations such as setting up a mail and web server for a domain.\n\n# Documentation\n\nAfter you have created and started the Plesk server, log in to the server as \"root\" via SSH. After successful login, the console displays additional information about access to the plesk panel.\n\nFor more documentation you can read the **[Plesk documentation](https://docs.plesk.com/en-US/onyx/)**.\n\n# Terms of Use\n\nSee [Plesk Terms of use](https://www.plesk.com/legal/#terms-of-use)" + }, + "setup": { + "storage_type": "storage_insane", + "memory": 2, + "capacity": 50, + "cores": 1 + }, + "os": "Ubuntu 16.04 LTS", + "other_software": { + "PHP": "5.6 / 7.0 / 7.1", + "Apache": "2.4", + "MySQL": "5.7" + }, + "publisher": "Parallels Inc.", + "version": "17", + "category": "Adminpanel", + "top": false, + "licence": "Free trial", + "short_description": { + "de": "Innovatives Hosting Control Panel", + "en": "Innovative Hosting Control Panel" + } + }, + "distro": "Plesk", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "a3aa8787-7e6e-49fa-adae-6c694b612a65": { + "description": "no swap", + "ostype": "linux", + "version": "Debian 9", + "location_country": "de", + "location_name": "de/fra", + "capacity": 3, + "create_time": "2017-06-14T10:07:39Z", + "location_iata": "fra", + "name": "Debian 9", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "a3aa8787-7e6e-49fa-adae-6c694b612a65", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": {}, + "distro": "Debian", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "a5112c72-c9fa-4a23-8115-5f6303eb047b": { + "description": "no swap", + "ostype": "linux", + "version": "Debian 8", + "location_country": "de", + "location_name": "de/fra", + "capacity": 3, + "create_time": "2015-10-03T12:57:21Z", + "location_iata": "fra", + "name": "Debian 8 (64bit)", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "a5112c72-c9fa-4a23-8115-5f6303eb047b", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": {}, + "distro": "Debian", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "49b40a10-4ef0-4dd7-b113-d1266168fa1b": { + "description": "Marketplace Template - Ubuntu 16.04 LTS with LiveConfig", + "ostype": "marketplace", + "version": "Ubuntu 16.04 LTS", + "location_country": "de", + "location_name": "de/fra", + "capacity": 50, + "create_time": "2018-07-25T15:49:18Z", + "location_iata": "fra", + "name": "LiveConfig", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "49b40a10-4ef0-4dd7-b113-d1266168fa1b", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": { + "icon": "/img/assets/logos_marketplace/liveconfig.png", + "description": { + "de": "# Übersicht\n\nLiveConfig ist ein einzigartiges und besonders ressourcenschonendes Hosting Control Panel. Es ermöglicht dir die sichere Administration deiner Server über eine moderne, SSL-geschützte Weboberfläche. Dabei erkennt es automatisch die vorhandenen Softwarepakete und konfiguriert diese mittel quelloffener und anpassbarer Skripte. Die Multi-Server-Fähigkeit, Unabhängigkeit von PHP und Benutzer- und Rechteverwaltung sind nur einige der vielen Vorteile im Vergleich mit anderen Control Panels die LiveConfig bietet. \n\n## Features\n\n- Reseller, Kunden und User Management\n- Webspace-Einstellungen\n- PHP-Einstellungen\n- Hosting-Angebote\n- Systeminformationen\n- E-Mail Management\n- Application Installer\nu.v.m\n\n# Dokumentation\n\nNachdem der Liveconfig-Server fertiggestellt und eingeschaltet ist, verbinde dich mit Hilfe unserer VNC Konsole (>\\_) auf den Bildschirm des Servers. Dort findest du Informationen bezüglich Zugangsdaten und Zugriff auf Liveconfig so wie weitere Schritte um die Installation zu vervollständigen.\n\nFür weitere Dokumentation kannst du das **[Liveconfig Wiki](https://www.liveconfig.com/wiki/de/start)** lesen.\n", + "en": "# Overview\n\nLiveConfig is a unique and particularly resource-saving hosting control panel. It allows you to securely administer your servers via a modern, SSL-protected web interface. It automatically detects existing software packages and configures them using open source and customizable scripts. Multi-server capability, PHP independence, and user and rights management are just a few of the many advantages LiveConfig offers over other control panels. \n\n## Features\n\n- Resellers, customers and user management\n- webspace settings\n- PHP settings\n- hosting plans\n- system information\n- Email Management\n- application installer\nand much more\n\n# Documentation\n\nAfter the Liveconfig server is ready and turned on, connect to the server screen using our VNC console (>\\_). There you will find information about login credentials and access to Liveconfig and further steps to complete the installation.\n\nFor further documentation you can read the **[Liveconfig Wiki](https://www.liveconfig.com/wiki/de/start)**." + }, + "setup": { + "storage_type": "storage_insane", + "memory": 2, + "capacity": 50, + "cores": 1 + }, + "os": "Debian 9 (stretch)", + "other_software": { + "PHP": "7.0", + "Dovecot": "2.2", + "MariaDB": "10.1", + "Apache": "2.4", + "Postfix": "3.1", + "ProFTPd": "1.3" + }, + "publisher": "Keppler IT GmbH", + "version": "2.5", + "category": "Adminpanel", + "top": false, + "licence": "Commercial", + "short_description": { + "de": "Schlankes Hosting Control Panel", + "en": "Lightweight Hosting Control Panel" + } + }, + "distro": "LiveConfig", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "afafa5d2-d625-4f81-81f8-e5801b60a6c8": { + "description": "no swap", + "ostype": "linux", + "version": "Fedora 25 Server", + "location_country": "de", + "location_name": "de/fra", + "capacity": 3, + "create_time": "2017-03-06T11:24:42Z", + "location_iata": "fra", + "name": "Fedora 25 Server", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "afafa5d2-d625-4f81-81f8-e5801b60a6c8", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": {}, + "distro": "Fedora", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "0825de86-36f4-4695-b016-b8505cbb7b47": { + "description": "Redmine", + "ostype": "1click", + "version": "Ubuntu 16.04 LTS & Redmine 3", + "location_country": "de", + "location_name": "de/fra", + "capacity": 3, + "create_time": "2017-04-10T15:38:20Z", + "location_iata": "fra", + "name": "Redmine", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "0825de86-36f4-4695-b016-b8505cbb7b47", + "change_time": "2019-02-08T17:18:36Z", + "private": false, + "metadata": { + "icon": "/img/assets/logos_marketplace/redmine.png", + "description": { + "de": "# Übersicht\n\nRedmine ist eine webbasierte Projektmanagement Anwendung für große als auch kleine Projekte. Die in Ruby geschriebene Open-Source-Software kann flexibel eingesetzt werden und ist durch Plugins erweiterbar. Redmine gilt als professionelles Tool und wird von erfolgreichen Teams unter anderem für Projektplanung und -management, als Issue-Tracking-System, Wikis, zur Benutzer- und Ticketverwaltung und Dokumentenablage genutzt. Es hilft dabei die Projektarbeit durch Koordination und Bündelung von Aufgaben zu verbessern.\n\n## Features\n\nEinige der Features von Redmine sind:\n\n- Unterstützung mehrerer Projekte\n- Flexible rollenbasierte Zugriffskontrolle\n- Flexibles Problemverfolgungssystem\n- Gantt-Diagramm und Kalender\n- Verwaltung von Nachrichten, Dokumenten und Dateien\n- Feeds & E-Mail-Benachrichtigungen\n- Pro Projekt-Wiki\n- Pro Projekt-Foren\n- Zeiterfassung\n- Benutzerdefinierte Felder für Probleme, Zeiteinträge, Projekte und Benutzer\n- SCM-Integration (SVN, CVS, Git, Mercurial und Bazaar)\n- Issue-Erstellung per E-Mail\n- Unterstützung mehrerer LDAP-Authentifizierungen\n- Unterstützung der Benutzer-Selbstregistrierung\n- Mehrsprachige Unterstützung\n- Unterstützung mehrerer Datenbanken\n\n# Dokumentation\n\nNachdem der Redmine-Server fertiggestellt und eingeschaltet ist, verbinde dich mit Hilfe unserer VNC Konsole (>\\_) auf den Bildschirm des Servers. Dort findest du Informationen bezüglich Zugangsdaten und Zugriff auf Redmine.\n\nFür weitere Dokumentation kannst du den **[Redmine Guide](https://www.redmine.org/projects/redmine/wiki/Guide)** lesen.\n\n# Nutzungsbedingungen\n\nSiehe [GNU General Public License v2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) (GPL).\n", + "en": "# Overview\n\nRedmine is a flexible project management web application. Written using the Ruby on Rails framework, it is cross-platform and cross-database.\n\nRedmine is open source and released under the terms of the [GNU General Public License v2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) (GPL).\n\n## Features\n\nSome of the main features of Redmine are:\n\n- Multiple projects support\n- Flexible role based access control\n- Flexible issue tracking system\n- Gantt chart and calendar\n- News, documents & files management\n- Feeds & email notifications\n- Per project wiki\n- Per project forums\n- Time tracking\n- Custom fields for issues, time-entries, projects and users\n- SCM integration (SVN, CVS, Git, Mercurial and Bazaar)\n- Issue creation via email\n- Multiple LDAP authentication support\n- User self-registration support\n- Multilanguage support\n- Multiple databases support\n\n# Documentation\n\nAfter the Redmine server is ready and turned on, connect to the server screen using our VNC console (>\\_). There you will find information regarding login credentials and access to Redmine.\n\nFor further documentation you can read the **[Redmine guide](https://www.redmine.org/projects/redmine/wiki/Guide)**.\n\n# Terms of use\n\nSee [GNU General Public License v2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) (GPL).\n" + }, + "setup": { + "storage_type": "storage_insane", + "memory": 2, + "capacity": 50, + "cores": 1 + }, + "os": "Ubuntu 16.04 LTS", + "other_software": { + "Python": "2.7", + "MariaDB": "10.0", + "Apache": "2.4" + }, + "publisher": "redmine.org", + "version": "3.2", + "category": "project management", + "top": false, + "licence": "GNU General Public License v2 (GPLv2)", + "short_description": { + "de": "Flexible Projektmanagement Anwendung", + "en": "Flexible project management application" + } + }, + "distro": "Redmine", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "dbb3e965-bfa0-411e-b324-86e82b3f36ec": { + "description": null, + "ostype": "linux", + "version": "CentOS 7 Core (x86_64)", + "location_country": "de", + "location_name": "de/fra", + "capacity": 3, + "create_time": "2017-04-16T12:13:21Z", + "location_iata": "fra", + "name": "CentOS 7 (x86_64)", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "dbb3e965-bfa0-411e-b324-86e82b3f36ec", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": {}, + "distro": "CentOS", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "9739b4db-7986-4c98-b337-6ff2f098e88e": { + "description": "Marketplace Template - Ubuntu 16.04 LTS with Cloudplan", + "ostype": "marketplace", + "version": "Ubuntu 16.04 LTS", + "location_country": "de", + "location_name": "de/fra", + "capacity": 50, + "create_time": "2018-07-25T15:49:18Z", + "location_iata": "fra", + "name": "Cloudplan", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "9739b4db-7986-4c98-b337-6ff2f098e88e", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": { + "icon": "/img/assets/logos_marketplace/cloudplan.png", + "description": { + "de": "# Übersicht\n\ncloudplan ist eine sichere private Cloud Lösung auf Peer-to-Peer Basis. Durch eine intelligente und selbst-organisierte P2P-Technologie ist ein Synchronisieren und Teilen von Unternehmensdaten bei 100 % Datensouveränität möglich. Daneben kannst du Remote Arbeitsplätze nahtlos und sicher Anbinden ohne ein VPN einrichten und betreiben zu müssen. So lassen sich lokal begrenzte oder globale Speicherstrukturen aufbauen, die aus heterogenen Hardware-Plattformen bestehen und beliebig skalierbar sind. cloudplan richtet sich vorwiegend an Unternehmen, die ihre Datenhoheit behalten wollen, kann jedoch auch von Einzelanwendern genutzt werden.\n\n## Features\n\n- Grenzenlose Synchronisation\n- Hybrid Cloud fähig\n- AES 256 Verschlüsselung\n- Automatisches Backup\n- Intelligente Lastverteilung\n- Rechteverwaltung auf Ordnerebene\n\n# Dokumentation\n\nNachdem der cloudplan-Server fertiggestellt und eingeschaltet ist, verbinde dich mit Hilfe unserer VNC Konsole (>\\_) auf den Bildschirm des Servers. Dort findest du Informationen bezüglich Zugangsdaten und Zugriff auf cloudplan so wie weitere Schritte um die Installation zu vervollständigen.\n\nFür weitere Dokumentation kannst du die **[cloudplan Dokumentation](https://portal.cloudplan.net/support/gettingstarted)** lesen.\n", + "en": "# Overview\n\ncloudplan is a secure private cloud solution on a peer-to-peer basis. Intelligent and self-organized P2P technology makes it possible to synchronize and share company data with 100% data sovereignty. In addition, you can connect remote workstations seamlessly and securely without having to set up and operate a VPN. In this way, locally limited or global storage structures can be set up, which consist of heterogeneous hardware platforms and can be scaled as required. cloudplan is primarily aimed at companies that want to retain their data sovereignty, but can also be used by individual users.\n\n## Features\n\n- Boundless synchronization\n- Hybrid cloud capable\n- AES 256 encryption\n- Automatic backup\n- Intelligent load distribution\n- Rights management at folder level\n\n# Documentation\n\nAfter the cloud plan server is ready and turned on, connect to the server screen using our VNC console (>\\_). There you will find information regarding login credentials and access to cloudplan and further steps to complete the installation.\n\nFor more documentation you can read the **[cloudplan Documentation](https://portal.cloudplan.net/support/gettingstarted)**.\n" + }, + "setup": { + "storage_type": "storage_insane", + "memory": 2, + "capacity": 50, + "cores": 1 + }, + "os": "Debian 9", + "other_software": [], + "publisher": "cloudplan GmbH", + "version": "1.0.161", + "category": "Cloud Storage", + "top": false, + "licence": "Commercial", + "short_description": { + "de": "Sichere private Cloud Lösung", + "en": "Secure private cloud solution" + } + }, + "distro": "Cloudplan", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "af8c9961-1f27-487c-b19f-dc2b23d156c3": { + "description": "Marketplace Template - Ubuntu 16.04 LTS with Kopano", + "ostype": "marketplace", + "version": "Ubuntu 16.04 LTS", + "location_country": "de", + "location_name": "de/fra", + "capacity": 50, + "create_time": "2018-07-25T15:49:18Z", + "location_iata": "fra", + "name": "Kopano", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "af8c9961-1f27-487c-b19f-dc2b23d156c3", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": { + "icon": "/img/assets/logos_marketplace/kopano.png", + "description": { + "de": "# Übersicht\n\nKopano ist eine professionelle plattformunabhängige E-Mail und Collaboration Groupware für den Einsatz in Unternehmen und Teams. Die linux basierte Open-Source-Software gilt als echte und kostengünstige Alternative zu Microsoft Exchange. Neben den Groupware Kernfunktionen setzt die Software auf modernere Zusammenarbeitstechniken wie Meetings im Web oder Gruppenchats. Die leistungsstarke Software überzeugt durch einfache Bedienung und ist auf dem Desktop und mobil einsetzbar. \n\n## Features\n\n- Outlook-Anbindung mittels ActiveSync (Z-Push)\n- Zugriff über Outlook oder Webapp und DeskApp, im Outlook \"Look & Feel\"\n- Active-Sync Anbindung für die Echtzeit-Synchronisation mobiler Endgeräte\n- SSL-Verschlüsselung\n- Spam- und Virenfilter mit Webinterface\n- einfache Postfach/Mailserver-Integration aus vorhandenen Systemen\n\n# Dokumentation\n\nNachdem der Kopano-Server fertiggestellt und eingeschaltet ist, verbinde dich mit Hilfe unserer VNC Konsole (>\\_) auf den Bildschirm des Servers. Dort findest du Informationen bezüglich Zugangsdaten und Zugriff auf Kopano so wie weitere Schritte um die Installation zu vervollständigen.\n\nFür weitere Dokumentation kannst du die **[Kopano Knowledgebase](https://kb.kopano.io/)** lesen.\n", + "en": "# Overview\n\nKopano is a professional platform-independent e-mail and collaboration groupware for use in companies and teams. The linux-based open source software is a real and cost-effective alternative to Microsoft Exchange. In addition to the groupware core functions, the software uses more modern collaboration techniques such as meetings on the web or group chats. The powerful software is easy to use and can be used on the desktop and mobile. \n\n## Features\n\n- Outlook connection via ActiveSync (Z-Push)\n- Access via Outlook or Webapp and DeskApp, in Outlook \"Look & Feel\"\n- Active-Sync connection for real-time synchronization of mobile devices\n- SSL encoding\n- Spam and virus filter with web interface\n- Simple mailbox/mail server integration from existing systems\n\n# Documentation\n\nAfter the Kopano server is ready and turned on, connect to the server screen using our VNC console (>\\_). There you will find information regarding login credentials and access to Kopano and further steps to complete the installation.\n\nFor further documentation you can read the **[Kopano Knowledgebase](https://kb.kopano.io/)**.\n" + }, + "setup": { + "storage_type": "storage_insane", + "memory": 2, + "capacity": 50, + "cores": 1 + }, + "os": "Debian 9 (stretch)", + "other_software": { + "PHP": "7.0", + "MariaDB": "10.1", + "NGINX": "1.10" + }, + "publisher": "Kopano GmbH", + "version": "8.5", + "category": "Collaboration", + "top": false, + "licence": "Commercial", + "short_description": { + "de": "Professionelle Kollaborations Groupware", + "en": "Professional collaboration groupware" + } + }, + "distro": "Kopano", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "48e7f519-84d5-4c9a-86db-010865902012": { + "description": "SPLA-Licensed", + "ostype": "windows", + "version": "Windows Server 2016 Standard", + "location_country": "de", + "location_name": "de/fra", + "capacity": 32, + "create_time": "2016-10-24T14:50:23Z", + "location_iata": "fra", + "name": "Windows Server 2016", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": 800002, + "current_price": 0, + "object_uuid": "48e7f519-84d5-4c9a-86db-010865902012", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": {}, + "distro": "Windows Server", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "b2e6b10f-5a77-4327-9f7e-9b9dea826bf1": { + "description": "SPLA-Licensed", + "ostype": "windows", + "version": "Windows Server 2012 R2 Standard", + "location_country": "de", + "location_name": "de/fra", + "capacity": 32, + "create_time": "2015-10-12T14:11:22Z", + "location_iata": "fra", + "name": "Windows Server 2012 R2", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": 800001, + "current_price": 0, + "object_uuid": "b2e6b10f-5a77-4327-9f7e-9b9dea826bf1", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": {}, + "distro": "Windows Server", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "42be618a-254e-41cf-a9a1-c97dae7cf5c7": { + "description": "SPLA-Licensed", + "ostype": "windows", + "version": "Windows Server 2019 Standard", + "location_country": "de", + "location_name": "de/fra", + "capacity": 30, + "create_time": "2019-03-25T15:10:39Z", + "location_iata": "fra", + "name": "Windows Server 2019", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": 800003, + "current_price": 0, + "object_uuid": "42be618a-254e-41cf-a9a1-c97dae7cf5c7", + "change_time": "2019-05-06T13:42:11Z", + "private": false, + "metadata": {}, + "distro": "Windows Server", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "44ca25cc-7da8-479a-a957-dd9363e7c44a": { + "description": "Marketplace Template - Ubuntu 16.04 LTS with Benno", + "ostype": "marketplace", + "version": "Ubuntu 16.04 LTS", + "location_country": "de", + "location_name": "de/fra", + "capacity": 50, + "create_time": "2018-07-25T15:49:18Z", + "location_iata": "fra", + "name": "Benno", + "status": "active", + "labels": [], + "usage_in_minutes": 0, + "license_product_no": null, + "current_price": 0, + "object_uuid": "44ca25cc-7da8-479a-a957-dd9363e7c44a", + "change_time": "2019-01-03T17:06:49Z", + "private": false, + "metadata": { + "icon": "/img/assets/logos_marketplace/benno.png", + "description": { + "de": "# Übersicht \n\nBenno ist ein Tool zur E-Mail Archivierung das eine revisionssichere und gesetzeskonforme Speicherung ermöglicht. Durch offene Schnittstellen ist es kompatibel mit allen gängigen Mailserver und Groupware-Lösungen. E-Mails werden nebst aller Anlagen und Kopfzeilen (Mailheader) indexiert und abgelegt. E-Mail-Anhänge wie bspw. PDF, MS Office, OpenDocument (LibreOffice, OpenOffice.org) usw. werden ebenso volltext-indexiert, wie die eigentliche E-Mail-Nachricht selbst. Dank der leistungsstarken Suche können E-Mails schnell und einfach aufgefunden werden. \n\n## Features\n\n- Modernes Design\n- Integrierte Benutzerverwaltung\n- Revisionssicher und gesetzeskonform\n- REST API\n\n# Dokumentation\n\nNachdem der Benno-Server fertiggestellt und eingeschaltet ist, verbinde dich mit Hilfe unserer VNC Konsole (>\\_) auf den Bildschirm des Servers. Dort findest du Informationen bezüglich Zugangsdaten und Zugriff auf Benno so wie weitere Schritte um die Installation zu vervollständigen.\n\nFür weitere Dokumentation kannst du das **[Benno Wiki](https://wiki.benno-mailarchiv.de/doku.php)** lesen.", + "en": "# Overview \n\nBenno is a tool for e-mail archiving that enables audit-proof and legally compliant storage. Open interfaces make it compatible with all common mail servers and groupware solutions. Emails are indexed and stored along with all attachments and headers (mail headers). E-mail attachments such as PDF, MS Office, OpenDocument (LibreOffice, OpenOffice.org) etc. are indexed in full text, just like the actual e-mail message itself. Thanks to the powerful search function, e-mails can be found quickly and easily. \n\n## Features\n\n- Modern design\n- Integrated user management\n- audit-proof and in compliance with the law\n- REST API\n\n# Documentation\n\nAfter the Benno server is ready and turned on, connect to the server's screen using our VNC console (>\\_). There you will find information regarding login credentials and access to Benno and further steps to complete the installation.\n\nFor further documentation you can read the **[Benno Wiki](https://wiki.benno-mailarchiv.de/doku.php)**." + }, + "setup": { + "storage_type": "storage_insane", + "memory": 2, + "capacity": 50, + "cores": 1 + }, + "os": "Debian 9 (stretch)", + "other_software": { + "PHP": "7.0", + "Apache": "2.4", + "OpenJDK": "8" + }, + "publisher": "LWsystems GmbH", + "version": "2.4", + "category": "Archiving", + "top": false, + "licence": "Commercial", + "short_description": { + "de": "Tool zur E-Mail Archivierung", + "en": "Email archiving tool" + } + }, + "distro": "Benno", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + }, + "1b3cb7fb-9988-4ba5-8537-b9d2ec8e5882": { + "description": null, + "ostype": null, + "version": null, + "location_country": "de", + "location_name": "de/fra", + "capacity": 50, + "create_time": "2019-06-20T17:41:27Z", + "location_iata": "fra", + "name": "test.test", + "status": "active", + "labels": [], + "usage_in_minutes": 272950, + "license_product_no": null, + "current_price": 1.20098, + "object_uuid": "1b3cb7fb-9988-4ba5-8537-b9d2ec8e5882", + "change_time": "2019-06-20T17:41:27Z", + "private": true, + "metadata": {}, + "distro": null, + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950" + } + } +} diff --git a/libcloud/test/compute/fixtures/gridscale/list_key_pairs.json b/libcloud/test/compute/fixtures/gridscale/list_key_pairs.json new file mode 100644 index 0000000000..44aa9fb630 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/list_key_pairs.json @@ -0,0 +1,24 @@ +{ + "sshkeys": { + "f7360eb9-2d36-42cc-83da-71162bcb9396": { + "name": "karl", + "create_time": "2019-04-08T09:35:55Z", + "status": "active", + "object_uuid": "f7360eb9-2d36-42cc-83da-71162bcb9396", + "user_uuid": "959440bd-88cf-4ff0-beef-8cf82b803749", + "labels": [], + "change_time": "2019-04-08T09:35:55Z", + "sshkey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC" + }, + "b1682d3a-1869-4bdc-8ffe-e74a261d300c": { + "name": "karl", + "create_time": "2019-04-08T09:28:39Z", + "status": "active", + "object_uuid": "b1682d3a-1869-4bdc-8ffe-e74a261d300c", + "user_uuid": "959440bd-88cf-4ff0-beef-8cf82b803749", + "labels": [], + "change_time": "2019-04-08T09:28:39Z", + "sshkey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC" + } + } +} diff --git a/libcloud/test/compute/fixtures/gridscale/list_locations.json b/libcloud/test/compute/fixtures/gridscale/list_locations.json new file mode 100644 index 0000000000..b7b44da5d8 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/list_locations.json @@ -0,0 +1,20 @@ +{ + "locations": { + "8328a5bc-e66e-4edc-8aae-2e2bf07fdb28": { + "name": "de/fra2", + "status": "active", + "iata": "fra", + "object_uuid": "8328a5bc-e66e-4edc-8aae-2e2bf07fdb28", + "labels": [], + "country": "de" + }, + "45ed677b-3702-4b36-be2a-a2eab9827950": { + "name": "de/fra", + "status": "active", + "iata": "fra", + "object_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "labels": [], + "country": "de" + } + } +} diff --git a/libcloud/test/compute/fixtures/gridscale/list_nodes.json b/libcloud/test/compute/fixtures/gridscale/list_nodes.json new file mode 100644 index 0000000000..0761ba8668 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/list_nodes.json @@ -0,0 +1,85 @@ +{ + "servers": { + "1479405e-d46c-47a2-91e8-eb43951c899f": { + "hardware_profile": "default", + "relations": { + "storages": [ + { + "storage_type": "storage", + "last_used_template": "a5112c72-c9fa-4a23-8115-5f6303eb047b", + "create_time": "2019-06-24T10:10:51Z", + "capacity": 50, + "lun": 0, + "controller": 0, + "target": 0, + "object_uuid": "e66bb753-4a03-4ee2-a069-a601f393c9ee", + "bootdevice": true, + "object_name": "linux", + "license_product_no": null, + "bus": 0 + } + ], + "networks": [ + { + "mac": "16:63:95:5d:1f:01", + "network_uuid": "1196529b-a8de-417f-ac95-0e13ef4fdfd7", + "network_type": "network", + "mcast": null, + "create_time": "2019-06-07T14:59:47Z", + "public_net": true, + "partner_uuid": "95a2980b-7012-43dd-81f2-07577cfcb9f0", + "ordering": 0, + "vlan": null, + "firewall": null, + "l2security": true, + "firewall_template_uuid": null, + "vxlan": null, + "object_uuid": "1196529b-a8de-417f-ac95-0e13ef4fdfd7", + "bootdevice": false, + "object_name": "network", + "l3security": [ + "185.102.95.236/32" + ] + } + ], + "isoimages": [], + "public_ips": [ + { + "object_uuid": "56b8d161-325b-4fd4-a453-6101cf563713", + "ip": "185.102.95.236", + "family": 4, + "create_time": "2019-06-07T12:57:30Z", + "prefix": "185.102.95.236/32" + }, + { + "object_uuid": "0235e7c4-18c9-4b2f-a3c3-2d9624a67498", + "ip": "2a06:2380:0:1::211", + "family": 6, + "create_time": "2019-06-07T14:59:47Z", + "prefix": "2a06:2380:0:1::211/128" + } + ] + }, + "memory": 10, + "location_iata": "fra", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "change_time": "2019-06-17T14:13:31Z", + "object_uuid": "1479405e-d46c-47a2-91e8-eb43951c899f", + "labels": [], + "usage_in_minutes_cores": 25030, + "cores": 2, + "console_token": "088f625818dc5b9114f8bee8e7f67d7b5510fc5159968a02752875f4b55ca911d59fd6cbe3eeb60358c0f353b1d7cbb9", + "availability_zone": null, + "location_name": "de/fra", + "create_time": "2019-06-07T12:56:44Z", + "location_country": "de", + "legacy": false, + "current_price": 17.89645, + "power": false, + "status": "active", + "auto_recovery": true, + "name": "test.test", + "usage_in_minutes_memory": 125150 + } + } +} diff --git a/libcloud/test/compute/fixtures/gridscale/list_volume_snapshots.json b/libcloud/test/compute/fixtures/gridscale/list_volume_snapshots.json new file mode 100644 index 0000000000..a304662729 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/list_volume_snapshots.json @@ -0,0 +1,22 @@ +{ + "snapshots": { + "d755de62-4d75-4d61-addd-a5c9743a5deb": { + "change_time": "2019-06-24T13:02:55Z", + "location_name": "de/fra", + "status": "active", + "parent_name": "linux", + "create_time": "2019-06-24T13:02:55Z", + "labels": [], + "parent_uuid": "e66bb753-4a03-4ee2-a069-a601f393c9ee", + "location_country": "de", + "capacity": 50, + "last_used_template": null, + "object_uuid": "d755de62-4d75-4d61-addd-a5c9743a5deb", + "location_iata": "fra", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "name": "linux Snapshot", + "current_price": 5.5e-05, + "usage_in_minutes": 50 + } + } +} diff --git a/libcloud/test/compute/fixtures/gridscale/list_volumes.json b/libcloud/test/compute/fixtures/gridscale/list_volumes.json new file mode 100644 index 0000000000..60d16169e4 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/list_volumes.json @@ -0,0 +1,39 @@ +{ + "storages": { + "e66bb753-4a03-4ee2-a069-a601f393c9ee": { + "snapshots": [], + "capacity": 50, + "relations": { + "snapshot_schedules": [], + "servers": [ + { + "create_time": "2019-06-24T10:10:51Z", + "bootdevice": true, + "lun": 0, + "bus": 0, + "object_name": "test.test", + "target": 0, + "object_uuid": "1479405e-d46c-47a2-91e8-eb43951c899f", + "controller": 0 + } + ] + }, + "storage_type": "storage", + "last_used_template": "a5112c72-c9fa-4a23-8115-5f6303eb047b", + "object_uuid": "e66bb753-4a03-4ee2-a069-a601f393c9ee", + "license_product_no": null, + "location_country": "de", + "current_price": 3.09298, + "create_time": "2019-06-14T17:31:10Z", + "change_time": "2019-06-14T17:31:10Z", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "labels": [], + "name": "linux", + "usage_in_minutes": 702950, + "location_name": "de/fra", + "location_iata": "fra", + "status": "active", + "parent_uuid": null + } + } +} diff --git a/libcloud/test/compute/fixtures/gridscale/list_volumes_empty.json b/libcloud/test/compute/fixtures/gridscale/list_volumes_empty.json new file mode 100644 index 0000000000..67c34d54ec --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/list_volumes_empty.json @@ -0,0 +1,3 @@ +{ + "storages": {} +} diff --git a/libcloud/test/compute/fixtures/gridscale/network_to_node.json b/libcloud/test/compute/fixtures/gridscale/network_to_node.json new file mode 100644 index 0000000000..f98d322db8 --- /dev/null +++ b/libcloud/test/compute/fixtures/gridscale/network_to_node.json @@ -0,0 +1,35 @@ + { + "1196529b-a8de-417f-ac95-0e13ef4fdfd7": { + "delete_block": false, + "relations": { + "servers": [ + { + "bootdevice": false, + "create_time": "2019-06-07T14:59:47Z", + "ordering": 0, + "l3security": [ + "185.102.95.236/32" + ], + "mac": "16:63:95:5d:1f:01", + "object_name": "test.test", + "network_uuid": "1196529b-a8de-417f-ac95-0e13ef4fdfd7", + "object_uuid": "1479405e-d46c-47a2-91e8-eb43951c899f" + } + ], + "vlans": [] + }, + "labels": [], + "network_type": "network", + "change_time": "2019-04-08T09:10:08Z", + "status": "active", + "create_time": "2018-12-06T13:09:08Z", + "location_uuid": "45ed677b-3702-4b36-be2a-a2eab9827950", + "location_name": "de/fra", + "name": "network", + "location_iata": "fra", + "l2security": true, + "public_net": true, + "location_country": "de", + "object_uuid": "1196529b-a8de-417f-ac95-0e13ef4fdfd7" + } + } diff --git a/libcloud/test/compute/fixtures/gridscale/volume_to_node.json b/libcloud/test/compute/fixtures/gridscale/volume_to_node.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/test/compute/fixtures/hostvirtual/list_locations.json b/libcloud/test/compute/fixtures/hostvirtual/list_locations.json index 4172105250..3c23099094 100644 --- a/libcloud/test/compute/fixtures/hostvirtual/list_locations.json +++ b/libcloud/test/compute/fixtures/hostvirtual/list_locations.json @@ -1,46 +1,106 @@ -[ - { - "id": "3", - "name": "SJC - San Jose, CA" - }, - { - "id": "13", - "name": "IAD2- Reston, VA" - }, - { - "id": "21", - "name": "LAX3 - Los Angeles, CA" - }, - { - "id": "31", - "name": "CHI - Chicago, IL" - }, - { - "id": "41", - "name": "NYC - New York, NY" - }, - { - "id": "61", - "name": "MAA - Chennai (Madras), India" - }, - { - "id": "71", - "name": "LON - London, United Kingdom" - }, - { - "id": "72", - "name": "AMS2 - Amsterdam, NL" - }, - { - "id": "82", - "name": "FRA - Paris, France" - }, - { - "id": "83", - "name": "HK - Hong Kong, HK" - }, - { - "id": "101", - "name": "DFW - Dallas, TX" +{ + "SJC - San Jose, CA": { + "name": "SJC - San Jose, CA", + "id": "3" + }, + "IAD - Reston, VA": { + "name": "IAD - Reston, VA", + "id": "13" + }, + "LAX - Los Angeles, CA": { + "name": "LAX - Los Angeles, CA", + "id": "21" + }, + "CHI - Chicago, IL": { + "name": "CHI - Chicago, IL", + "id": "31" + }, + "LGA - New York, NY": { + "name": "LGA - New York, NY", + "id": "41" + }, + "MAA - Chennai (Madras), India": { + "name": "MAA - Chennai (Madras), India", + "id": "61" + }, + "LHR - London, United Kingdom": { + "name": "LHR - London, United Kingdom", + "id": "71" + }, + "AMS - Amsterdam, NL": { + "name": "AMS - Amsterdam, NL", + "id": "72" + }, + "CDG - Paris, France": { + "name": "CDG - Paris, France", + "id": "82" + }, + "HKG - Hong Kong, HK": { + "name": "HKG - Hong Kong, HK", + "id": "83" + }, + "DFW - Dallas, TX": { + "name": "DFW - Dallas, TX", + "id": "101" + }, + "SVM - StrongVM, DDoS Protected": { + "name": "SVM - StrongVM, DDoS Protected", + "id": "121" + }, + "DEN - Denver, CO": { + "name": "DEN - Denver, CO", + "id": "122" + }, + "MIA - Miami, FL": { + "name": "MIA - Miami, FL", + "id": "123" + }, + "SEA - Seattle, WA": { + "name": "SEA - Seattle, WA", + "id": "124" + }, + "TOR - Toronto, CA": { + "name": "TOR - Toronto, CA", + "id": "127" + }, + "SYD - Sydney, AU": { + "name": "SYD - Sydney, AU", + "id": "137" + }, + "OTP - Bucharest, RO": { + "name": "OTP - Bucharest, RO", + "id": "146" + }, + "FRA - Frankfurt, DE": { + "name": "FRA - Frankfurt, DE", + "id": "164" + }, + "SIN - Singapore, SG": { + "name": "SIN - Singapore, SG", + "id": "173" + }, + "GRU - Sao Paulo, Brazil": { + "name": "GRU - Sao Paulo, Brazil", + "id": "182" + }, + "SJC2 - San Jose, CA": { + "name": "SJC2 - San Jose, CA", + "id": "227" + }, + "RDU - Raleigh, NC": { + "name": "RDU - Raleigh, NC", + "id": "236" + }, + "IAD3 - Ashburn, VA": { + "name": "IAD3 - Ashburn, VA", + "id": "245" + }, + "DFW2 - Dallas, TX": { + "name": "DFW2 - Dallas, TX", + "id": "281" + }, + "PHX - Phoenix, AZ": { + "name": "PHX - Phoenix, AZ", + "id": "290" } -] +} diff --git a/libcloud/test/compute/fixtures/ibm_sce/allocate_address.xml b/libcloud/test/compute/fixtures/ibm_sce/allocate_address.xml deleted file mode 100644 index e786c0e2b0..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/allocate_address.xml +++ /dev/null @@ -1 +0,0 @@ -
RESERVED14129279520001223PRIMARY0user@domain.com
\ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/attach_volume.xml b/libcloud/test/compute/fixtures/ibm_sce/attach_volume.xml deleted file mode 100644 index 89b4e13a2c..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/attach_volume.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/create.xml b/libcloud/test/compute/fixtures/ibm_sce/create.xml deleted file mode 100644 index 71d8811434..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/create.xml +++ /dev/null @@ -1 +0,0 @@ -28558128558RationalInsight4woodser@us.ibm.com11LARGEMyPublicKey02010-04-19T10:03:34.327-04:002010-04-26T10:03:43.610-04:00SUSE Linux Enterprise10 SP2OS diff --git a/libcloud/test/compute/fixtures/ibm_sce/create_volume.xml b/libcloud/test/compute/fixtures/ibm_sce/create_volume.xml deleted file mode 100644 index 920471c553..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/create_volume.xml +++ /dev/null @@ -1 +0,0 @@ -3929314120001208user@domain.comtest-volumeraw25602012-08-20T12:25:02.792Z2011-08-12T00:00:00.000ZUSD0.001CNT020 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/delete.xml b/libcloud/test/compute/fixtures/ibm_sce/delete.xml deleted file mode 100644 index 7f2027262e..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/delete.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/libcloud/test/compute/fixtures/ibm_sce/delete_address.xml b/libcloud/test/compute/fixtures/ibm_sce/delete_address.xml deleted file mode 100644 index 23b3278ded..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/delete_address.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/destroy_image.xml b/libcloud/test/compute/fixtures/ibm_sce/destroy_image.xml deleted file mode 100644 index a957946ae0..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/destroy_image.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/destroy_volume.xml b/libcloud/test/compute/fixtures/ibm_sce/destroy_volume.xml deleted file mode 100644 index 5b0b35fa42..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/destroy_volume.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/detach_volume.xml b/libcloud/test/compute/fixtures/ibm_sce/detach_volume.xml deleted file mode 100644 index e3683e450d..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/detach_volume.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/images.xml b/libcloud/test/compute/fixtures/ibm_sce/images.xml deleted file mode 100644 index 91732f7072..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/images.xml +++ /dev/null @@ -1,2 +0,0 @@ - -2fd2d0478b132490897526b9b4433a334Rational Build Forge Agent11SYSTEMPUBLICi386SUSE Linux Enterprise/10 SP2Rational Build Forge provides an adaptive process execution framework that automates, orchestrates, manages, and tracks all the processes between each handoff within the assembly line of software development, creating an automated software factory.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{A233F5A0-05A5-F21D-3E92-3793B722DFBD}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{A233F5A0-05A5-F21D-3E92-3793B722DFBD}/1.0/GettingStarted.htmlSMALLMEDIUMLARGE2009-04-25T00:00:00.000-04:00384e900960c3d4b648fa6d4670aed2cd1SUSE 10 SP211SYSTEMPUBLICi386SUSE Linux Enterprise/10 SP2SuSE v10.2 Base OS Imagehttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{07F112A1-84A7-72BF-B8FD-B36011E0E433}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{07F112A1-84A7-72BF-B8FD-B36011E0E433}/1.0/GettingStarted.htmlSMALLMEDIUMLARGE2009-04-25T00:00:00.000-04:0015a72d3e7bb1cb4942ab0da2968e2e77bbWebSphere Application Server and Rational Agent Controller11SYSTEMPUBLICi386SUSE Linux Enterprise/10 SP2WebSphere Application Server and Rational Agent Controller enables a performance based foundation to build, reuse, run, integrate and manage Service Oriented Architecture (SOA) applications and services.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{86E8E71D-29A3-86DE-8A26-792C5E839D92}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{86E8E71D-29A3-86DE-8A26-792C5E839D92}/1.0/GettingStarted.htmlSMALLMEDIUMLARGE2009-04-25T00:00:00.000-04:00117da905ba0fdf4d8b8f94e7f4ef43c1beRational Insight11SYSTEMPUBLICi386SUSE Linux Enterprise/10 SP2Rational Insight helps organizations reduce time to market, improve quality, and take greater control of software and systems development and delivery. It provides objective dashboards and best practice metrics to identify risks, status, and trends.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{4F774DCF-1469-EAAB-FBC3-64AE241CF8E8}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{4F774DCF-1469-EAAB-FBC3-64AE241CF8E8}/1.0/GettingStarted.htmlLARGE2009-04-25T00:00:00.000-04:0018edf7ad43f75943b1b0c0f915dba8d86cDB2 Express-C11SYSTEMPUBLICi386SUSE Linux Enterprise/10 SP2DB2 Express-C is an entry-level edition of the DB2 database server for the developer community. It has standard relational functionality and includes pureXML, and other features of DB2 for Linux, Unix, and Windows (LUW).https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{E69488DE-FB79-63CD-E51E-79505A1309BD}/2.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{E69488DE-FB79-63CD-E51E-79505A1309BD}/2.0/GettingStarted.htmlSMALLMEDIUMLARGE2009-04-25T00:00:00.000-04:0021c03be6800bf043c0b44c584545e04099Informix Dynamic Server Developer Edition11SYSTEMPUBLICi386SUSE Linux Enterprise/10 SP2Informix Dynamic Server (IDS) Developer Edition is a development version of the IDS Enterprise Edition. IDS is designed to meet the database server needs of small-size to large-size enterprise businesses.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{9B0C8F66-9639-CA0A-0A94-7928D7DAD6CB}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{9B0C8F66-9639-CA0A-0A94-7928D7DAD6CB}/1.0/GettingStarted.htmlSMALLMEDIUMLARGE2009-04-25T00:00:00.000-04:00229b2b6482ba374a6ab4bb3585414a910aWebSphere sMash with AppBuilder11SYSTEMPUBLICi386SUSE Linux Enterprise/10 SP2WebSphere sMash® provides a web platform that includes support for dynamic scripting in PHP and Groovy.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{88E74AC6-9CCB-2710-7E9B-936DA2CE496C}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{88E74AC6-9CCB-2710-7E9B-936DA2CE496C}/1.0/GettingStarted.htmlSMALLMEDIUMLARGE2009-04-25T00:00:00.000-04:001000150416662e71fae44bdba4d7bb502a09c5e7DB2 Enterprise V9.7 (32-bit, 90-day trial)11leonsp@ca.ibm.comPUBLICi386SuSE v10.2DB2 Enterprise V9.7 (32-bit, 90-day trial)https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{38F2AB86-9F03-E463-024D-A9ABC3AE3831}/2.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{38F2AB86-9F03-E463-024D-A9ABC3AE3831}/2.0/GettingStarted.htmlSMALLMEDIUMLARGE2009-11-09T17:01:28.000-05:00100020639da8863714964624b8b13631642c785bRHEL 5.4 Base OS11youngdj@us.ibm.comPUBLICi386Redhat Enterprise Linux (32-bit)/5.4Red Hat Enterprise Linux 5.4 Base OShttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{34904879-E794-A2D8-2D7C-2E8D6AD6AE77}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{34904879-E794-A2D8-2D7C-2E8D6AD6AE77}/1.0/GettingStarted.htmlSMALLMEDIUMLARGE2009-11-18T13:51:12.000-05:0010002573e5f09a64667e4faeaf3ac661600ec6caRational Build Forge11leighw@us.ibm.comPUBLICi386SUSE Linux Enterprise/10 SP2Rational Build Forge provides an adaptive process execution framework that automates, orchestrates, manages, and tracks all the processes between each handoff within the assembly line of software development, creating an automated software factory.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{22E039C6-108E-B626-ECC9-E2C9B62479FF}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{22E039C6-108E-B626-ECC9-E2C9B62479FF}/1.0/GettingStarted.htmlMEDIUMLARGE2009-12-08T16:34:37.000-05:00100030563e276d758ed842caafe77770d60dedeaRational Asset Manager 7.2.0.111gmendel@us.ibm.comPUBLICi386Redhat Enterprise Linux (32-bit)/5.4Rational Asset Manager helps to create, modify, govern, find and reuse development assets, including SOA and systems development assets. It facilitates the reuse of all types of software development related assets, potentially saving development time.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{296C6DDF-B87B-327B-3E5A-F2C50C353A69}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{296C6DDF-B87B-327B-3E5A-F2C50C353A69}/1.0/GettingStarted.htmlMEDIUMLARGE2009-12-14T14:30:57.000-05:0010003854e3067f999edf4914932295cfb5f79d59WebSphere Portal/WCM 6.1.511mlamb@us.ibm.comPUBLICi386SUSE Linux Enterprise/10 SP2IBM® WebSphere® Portal Server enables you to quickly consolidate applications and content into role-based applications, complete with search, personalization, and security capabilities.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{279F3E12-A7EF-0768-135B-F08B66DF8F71}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{279F3E12-A7EF-0768-135B-F08B66DF8F71}/1.0/GettingStarted.htmlSMALLMEDIUMLARGE2010-01-12T18:06:29.000-05:00100038640112efd8f1e144998f2a70a165d00bd3Rational Quality Manager11brownms@gmail.comPUBLICi386Redhat Enterprise Linux (32-bit)/5.4Rational Quality Manager provides a collaborative application lifecycle management (ALM) environment for test planning, construction, and execution.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{9DA927BA-2CEF-1686-71B0-2BAC468B7445}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{9DA927BA-2CEF-1686-71B0-2BAC468B7445}/1.0/GettingStarted.htmlSMALLMEDIUMLARGE2010-01-15T09:40:12.000-05:00100038653fbf6936e5cb42b5959ad9837add054fIBM Mashup Center with IBM Lotus Widget Factory11mgilmore@us.ibm.comPUBLICi386SUSE Linux Enterprise/10 SP2IBM Mashup Center is an end-to-end enterprise mashup platform, supporting rapid assembly of dynamic web applications with the management, security, and governance capabilities.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{0F867D03-588B-BA51-4E18-4CE9D11AECFC}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{0F867D03-588B-BA51-4E18-4CE9D11AECFC}/1.0/GettingStarted.htmlSMALLMEDIUMLARGE2010-01-15T10:44:24.000-05:0010003780425e2dfef95647498561f98c4de356abRational Team Concert11sonia_dimitrov@ca.ibm.comPUBLICi386Redhat Enterprise Linux (32-bit)/5.4Rational Team Concert is a collaborative software delivery environment that empowers project teams to simplify, automate and govern software delivery.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{679CA6F5-1E8E-267B-0C84-F7B0B41DF1DC}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{679CA6F5-1E8E-267B-0C84-F7B0B41DF1DC}/1.0/GettingStarted.htmlMEDIUMLARGE2010-01-19T14:13:58.000-05:0010003785c4867b72f2fc43fe982e76c76c32efaaLotus Forms Turbo 3.5.111rlintern@ca.ibm.comPUBLICi386SUSE Linux Enterprise/10 SP2Lotus Forms Turbo requires no training and is designed to help customers address basic form software requirements such as surveys, applications, feedback, orders, request for submission, and more - without involvement from the IT department.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{846AD7D3-9A0F-E02C-89D2-BE250CAE2318}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{846AD7D3-9A0F-E02C-89D2-BE250CAE2318}/1.0/GettingStarted.htmlLARGE2010-01-22T13:27:08.000-05:0010005598Rational Requirements Composer11mutdosch@us.ibm.comPUBLICi386Redhat Enterprise Linux (32-bit)/5.4Rational Requirements Composer helps teams define and use requirements effectively across the project lifecycle.https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{28C7B870-2C0A-003F-F886-B89F5B413B77}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{28C7B870-2C0A-003F-F886-B89F5B413B77}/1.0/GettingStarted.htmlMEDIUMLARGE2010-02-08T11:43:18.000-05:0010007509Rational Software Architecture11danberg@us.ibm.comPUBLICi386SUSE Linux Enterprise/10 SP2Rational Software Architect for WebSphere with the Cloud Client plug-ins created on 2/22/10 8:06 PMhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{2C6FB6D2-CB87-C4A0-CDE0-5AAF03E214B2}/1.1/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{2C6FB6D2-CB87-C4A0-CDE0-5AAF03E214B2}/1.1/GettingStarted.htmlLARGE2010-02-22T20:03:18.000-05:0010008319WebSphere Feature Pack for OSGi Apps and JPA 2.011radavenp@us.ibm.comPUBLICi386SUSE Linux Enterprise/10 SP2IBM WebSphere Application Server V7.0 Fix Pack 7, Feature Pack for OSGi Applications and Java Persistence API 2.0 Open Beta, and Feature Pack for Service Component Architecture (SCA) V1.0.1 Fix Pack V1.0.1.1https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{A397B7CD-A1C7-1956-7AEF-6AB495E37958}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{A397B7CD-A1C7-1956-7AEF-6AB495E37958}/1.0/GettingStarted.htmlSMALLMEDIUMLARGE2010-03-14T21:06:38.000-04:0010008273Rational Software Architect for WebSphere11danberg@us.ibm.comPUBLICi386SUSE Linux Enterprise/10 SP2Rational Software Architect for WebSphere with the Cloud Client plug-ins created on 3/15/10 12:21 PMhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{839D92BB-DEA5-9820-8E2E-AE5D0A6DEAE3}/1.1/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{839D92BB-DEA5-9820-8E2E-AE5D0A6DEAE3}/1.1/GettingStarted.htmlLARGE2010-03-15T12:17:26.000-04:0010008404Rational Application Developer11khiamt@ca.ibm.comPUBLICi386SUSE Linux Enterprise/10 SP2An Eclipse-based IDE with visual development features that helps Java developers rapidly design, develop, assemble, test, profile and deploy high quality Java/J2EE, Portal, Web/Web 2.0, Web services and SOA applications. (03/16/2010)https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{6A957586-A17A-4927-7C71-0FDE280DB66B}/1.0/parameters.xmlhttps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{6A957586-A17A-4927-7C71-0FDE280DB66B}/1.0/GettingStarted.htmlMEDIUMLARGE2010-03-16T00:10:30.000-04:00 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/instances.xml b/libcloud/test/compute/fixtures/ibm_sce/instances.xml deleted file mode 100644 index aecd2d5fed..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/instances.xml +++ /dev/null @@ -1 +0,0 @@ -26557126557Insight Instancewoodser@us.ibm.com11LARGEPublic keyvm519.developer.ihost.com129.33.196.12852010-04-06T15:40:24.745-04:002010-04-19T04:00:00.000-04:00SUSE Linux Enterprise10 SP2OS28193128193RAD instancewoodser@us.ibm.com10008404MEDIUMasdff22010-04-15T15:20:10.317-04:002010-04-22T15:20:19.564-04:00SUSE Linux Enterprise10 SP2OS28194128194RSAwoodser@us.ibm.com10007509LARGEasdff22010-04-15T15:23:04.753-04:002010-04-22T15:23:13.658-04:00SUSE Linux Enterprise10 SP2OS \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/instances_deleted.xml b/libcloud/test/compute/fixtures/ibm_sce/instances_deleted.xml deleted file mode 100644 index 05e8644254..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/instances_deleted.xml +++ /dev/null @@ -1 +0,0 @@ -26557126557Insight Instancewoodser@us.ibm.com11LARGEPublic keyvm519.developer.ihost.com129.33.196.12852010-04-06T15:40:24.745-04:002010-04-19T04:00:00.000-04:00SUSE Linux Enterprise10 SP2OS28194128194RSAwoodser@us.ibm.com10007509LARGEasdff22010-04-15T15:23:04.753-04:002010-04-22T15:23:13.658-04:00SUSE Linux Enterprise10 SP2OS \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/list_addresses.xml b/libcloud/test/compute/fixtures/ibm_sce/list_addresses.xml deleted file mode 100644 index 6af5238e0d..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/list_addresses.xml +++ /dev/null @@ -1 +0,0 @@ -
RESERVED170.225.160.218vhost021814129279520001223PRIMARY2user@dmain.com
\ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/list_storage_offerings.xml b/libcloud/test/compute/fixtures/ibm_sce/list_storage_offerings.xml deleted file mode 100644 index ed96dc6416..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/list_storage_offerings.xml +++ /dev/null @@ -1 +0,0 @@ -2000120861Small256256EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR2000120882Small256256EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR2000120961Medium512512EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR2000120982Medium512512EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR2000120841Small256256EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR2000120941Medium512512EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR20001208121Small256256EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR20001209121Medium512512EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR2000121061Large20482048EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR2000121082Large20482048EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR2000121041Large20482048EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR20001210121Large20482048EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR20001208101Small256256EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR20001209101Medium512512EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR20001208141Small256256EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR20001209141Medium512512EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR20001210101Large20482048EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR20001210141Large20482048EXT3RAW2011-08-12T00:00:00.000ZUSD0.00001UHR \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/list_volumes.xml b/libcloud/test/compute/fixtures/ibm_sce/list_volumes.xml deleted file mode 100644 index a6c2617604..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/list_volumes.xml +++ /dev/null @@ -1 +0,0 @@ -39281141200012100user@domain.comlibcloudvolraw204842012-08-19T13:46:50.000Z2011-08-12T00:00:00.000ZUSD0.001CNT020 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/locations.xml b/libcloud/test/compute/fixtures/ibm_sce/locations.xml deleted file mode 100644 index 68012dec35..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/locations.xml +++ /dev/null @@ -1 +0,0 @@ -41Raleigh, U.S.AThis data center is located in Raleigh, North Carolina, U.S.A. The services provided are: Guest Instances, Image Capture, Persistent Storage, Reserved IP, Private VLAN/VPN.RTPext3rawArea2gpfs2 of SONAS1Area1gpfs1 of SONAS1161Ehningen, GermanyThis data center is located in Ehningen(near Baden-Wurttemberg), Germany. The services provided are: Guest Instances, Image Capture, Persistent Storage, Reserved IP, Private VLAN/VPN.EHNext3rawArea2gpfs2 of SONAS1Area1gpfs1 of SONAS1182Boulder1, U.S.AThis data center is located in Boulder(near Denver), Colorado, U.S.A. The services provided are: Guest Instances, Image Capture, Persistent Storage, Reserved IP, Private VLAN/VPN.us-co-dc1ext3raw1101Markham, CanadaThis data center is located in Markham(near Toronto), Ontario, Canada. The services provided are: Guest Instances, Image Capture, Persistent Storage, Reserved IP, Private VLAN/VPN.ca-on-dc1ext3raw1121Makuhari, JapanThis data center is located in Makuhari(near Tokoyo), Japan. The services provided are: Guest Instances, Image Capture, Persistent Storage, Reserved IP, Private VLAN/VPN.ap-jp-dc1ext3raw1141Singapore, SingaporeThis data center is located in Singapore. The services provided are: Guest Instances, Image Capture, Persistent Storage, Reserved IP, Private VLAN/VPN.ap-sg-dc1ext3raw1 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/ibm_sce/reboot_active.xml b/libcloud/test/compute/fixtures/ibm_sce/reboot_active.xml deleted file mode 100644 index 2a43c1cbaf..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/reboot_active.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/libcloud/test/compute/fixtures/ibm_sce/sizes.xml b/libcloud/test/compute/fixtures/ibm_sce/sizes.xml deleted file mode 100644 index 2a43c1cbaf..0000000000 --- a/libcloud/test/compute/fixtures/ibm_sce/sizes.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/libcloud/test/compute/fixtures/joyent/my_datasets.json b/libcloud/test/compute/fixtures/joyent/my_datasets.json deleted file mode 100644 index 75c6fe291b..0000000000 --- a/libcloud/test/compute/fixtures/joyent/my_datasets.json +++ /dev/null @@ -1 +0,0 @@ -[{"id":"f953e97e-4991-11e1-9ea4-27c6e7e8afda","urn":"sdc:sdc:nodejs:1.3.3","name":"nodejs","os":"smartos","type":"smartmachine","description":"Node.js git-deploy PaaS dataset","default":false,"requirements":{},"version":"1.3.3","created":"2012-02-14T03:54:01+00:00"},{"id":"71101322-43a5-11e1-8f01-cf2a3031a7f4","urn":"sdc:sdc:ubuntu-10.04:1.0.1","name":"ubuntu-10.04","os":"linux","type":"virtualmachine","description":"Ubuntu 10.04 VM 1.0.1","default":false,"requirements":{},"version":"1.0.1","created":"2012-02-22T18:27:32+00:00"},{"id":"7a4f84be-df6d-11e0-a504-3f6609d83831","urn":"sdc:admin:windows2008r2:1.5.0","name":"windows2008r2","os":"windows","type":"virtualmachine","description":"Windows 2008r2 Enterprise Edition","default":false,"requirements":{"max_memory":32768,"min_memory":4096},"version":"1.5.0","created":"2012-02-16T19:31:01+00:00"},{"id":"e4cd7b9e-4330-11e1-81cf-3bb50a972bda","urn":"sdc:sdc:centos-6:1.0.1","name":"centos-6","os":"linux","type":"virtualmachine","description":"Centos 6 VM 1.0.1","default":false,"requirements":{},"version":"1.0.1","created":"2012-02-15T20:04:18+00:00"},{"id":"988c2f4e-4314-11e1-8dc3-2bc6d58f4be2","urn":"sdc:sdc:centos-5.7:1.2.1","name":"centos-5.7","os":"linux","type":"virtualmachine","description":"Centos 5.7 VM 1.2.1","default":false,"requirements":{},"version":"1.2.1","created":"2012-02-14T05:53:49+00:00"},{"id":"e6ac6784-44b3-11e1-8555-87c3dd87aafe","urn":"sdc:sdc:debian-6.03:1.0.0","name":"debian-6.03","os":"linux","type":"virtualmachine","description":"Debian 6.03 VM 1.0.0","default":false,"requirements":{},"version":"1.0.0","created":"2012-02-14T05:21:53+00:00"},{"id":"3f8a3d02-43e4-11e1-9565-7f82a075e289","urn":"sdc:sdc:fedora-14:1.0.1","name":"fedora-14","os":"linux","type":"virtualmachine","description":"Fedora 14 VM 1.0.1","default":false,"requirements":{},"version":"1.0.1","created":"2012-02-14T05:20:52+00:00"},{"id":"d239389c-7535-11e1-b60a-6f75edc139df","urn":"sdc:sdc:mongodb:1.2.4","name":"mongodb","os":"smartos","type":"smartmachine","description":"MongoDB SmartMachine","default":false,"requirements":{},"version":"1.2.4","created":"2012-03-23T22:33:31+00:00"},{"id":"98f38e14-6f83-11e1-bc32-2b9d0a8b6759","urn":"sdc:sdc:mongodb:1.1.1","name":"mongodb","os":"smartos","type":"smartmachine","description":"MongoDB SmartMachine","default":false,"requirements":{},"version":"1.1.1","created":"2012-03-16T16:54:14+00:00"},{"id":"64d81cee-689e-11e1-a130-232647306089","urn":"local:admin:stingray-standard-1gbps:1.2.0","name":"stingray-standard-1gbps","os":"smartos","type":"smartmachine","description":"Riverbed Stingray v8.1 (formerly Zeus) Traffic Manager Hi-Throughput SmartMachine","default":false,"requirements":{},"version":"1.2.0","created":"2012-03-09T01:49:40+00:00"},{"id":"29a2fb18-689d-11e1-a2a5-47b01f708bb0","urn":"local:admin:stingray-enterprise-1gbps:1.2.0","name":"stingray-enterprise-1gbps","os":"smartos","type":"smartmachine","description":"Riverbed Stingray v8.1 (formerly Zeus) Traffic Manager Enterprise Hi-Throughput SmartMachine","default":false,"requirements":{},"version":"1.2.0","created":"2012-03-09T01:49:12+00:00"},{"id":"27750b5c-689c-11e1-a67e-6331aba2c777","urn":"local:admin:stingray-enterprise-200mbps:1.2.0","name":"stingray-enterprise-200mbps","os":"smartos","type":"smartmachine","description":"Riverbed Stingray v8.1 (formerly Zeus) Traffic Manager Enterprise SmartMachine","default":false,"requirements":{},"version":"1.2.0","created":"2012-03-09T01:49:19+00:00"},{"id":"56ffd3bc-689b-11e1-837f-735e255247ac","urn":"local:admin:stingray-standard-200mbps:1.2.0","name":"stingray-standard-200mbps","os":"smartos","type":"smartmachine","description":"Riverbed Stingray v8.1 (formerly Zeus) Traffic Manager SmartMachine","default":false,"requirements":{},"version":"1.2.0","created":"2012-03-09T01:49:49+00:00"},{"id":"c79e581a-689a-11e1-91f3-932bbde56874","urn":"local:admin:stingray-lb-200mbps:1.2.0","name":"stingray-lb-200mbps","os":"smartos","type":"smartmachine","description":"Riverbed Stingray v8.1 (formerly Zeus) Load Balancer SmartMachine","default":false,"requirements":{},"version":"1.2.0","created":"2012-03-09T01:49:26+00:00"},{"id":"4ca85e3a-689a-11e1-a5df-1b5ffe7065e9","urn":"local:admin:stingray-simple-lb-200mbps:1.2.0","name":"stingray-simple-lb-200mbps","os":"smartos","type":"smartmachine","description":"Riverbed Stingray v8.1 (formerly Zeus) Simple Load Balancer SmartMachine","default":false,"requirements":{},"version":"1.2.0","created":"2012-03-09T01:49:33+00:00"},{"id":"8c4c0f30-66df-11e1-a3f4-0f8e0a382b60","urn":"sdc:sdc:percona:1.3.9","name":"percona","os":"smartos","type":"smartmachine","description":"Percona SmartMachine","default":false,"requirements":{},"version":"1.3.9","created":"2012-03-05T16:41:01+00:00"},{"id":"618d80f8-66d5-11e1-998e-e384c47940f0","urn":"sdc:sdc:mongodb:1.0.9","name":"mongodb","os":"smartos","type":"smartmachine","description":"MongoDB SmartMachine","default":false,"requirements":{},"version":"1.0.9","created":"2012-03-05T15:29:21+00:00"},{"id":"a54da3a0-6319-11e1-a3d9-9fdedd2f9e17","urn":"sdc:sdc:riak:1.5.6","name":"riak","os":"smartos","type":"smartmachine","description":"Riak SmartMachine template","default":false,"requirements":{},"version":"1.5.6","created":"2012-03-01T16:18:13+00:00"},{"id":"81641caa-6321-11e1-a79a-731161c6d519","urn":"local:admin:riakeds:1.5.6","name":"riakeds","os":"smartos","type":"smartmachine","description":"Riak EDS SmartMachine template","default":false,"requirements":{},"version":"1.5.6","created":"2012-03-01T19:52:37+00:00"},{"id":"f4bc70ca-5e2c-11e1-8380-fb28785857cb","urn":"sdc:sdc:smartosplus64:3.1.0","name":"smartosplus64","os":"smartos","type":"smartmachine","description":"Generic multi-purpose SmartMachine template","default":false,"requirements":{},"version":"3.1.0","created":"2012-03-02T15:30:58+00:00"},{"id":"a963d5d0-5e29-11e1-a4d7-a31977b1e6dd","urn":"sdc:sdc:smartosplus:3.1.0","name":"smartosplus","os":"smartos","type":"smartmachine","description":"Generic multi-purpose SmartMachine template","default":false,"requirements":{},"version":"3.1.0","created":"2012-03-02T15:24:10+00:00"},{"id":"31bc4dbe-5e06-11e1-907c-5bed6b255fd1","urn":"sdc:sdc:smartos64:1.5.4","name":"smartos64","os":"smartos","type":"smartmachine","description":"Base template to build other templates on","default":false,"requirements":{},"version":"1.5.4","created":"2012-03-02T15:20:17+00:00"},{"id":"489754f2-5e01-11e1-8ff8-f770c2116b0d","urn":"sdc:sdc:smartos:1.5.4","name":"smartos","os":"smartos","type":"smartmachine","description":"Base template to build other templates on","default":false,"requirements":{},"version":"1.5.4","created":"2012-03-02T15:16:12+00:00"},{"id":"e05dbcac-1d44-11e1-b8ab-bf1bc04c2d65","urn":"sdc:sdc:smartosplus64:3.0.7","name":"smartosplus64","os":"smartos","type":"smartmachine","description":"Generic multi-purpose SmartMachine template","default":false,"requirements":{},"version":"3.0.7","created":"2012-02-13T19:18:56+00:00"},{"id":"fcc5996a-1d34-11e1-899e-7bd98b87947a","urn":"sdc:sdc:smartosplus:3.0.7","name":"smartosplus","os":"smartos","type":"smartmachine","description":"Generic multi-purpose SmartMachine template","default":false,"requirements":{},"version":"3.0.7","created":"2012-02-13T19:22:05+00:00"},{"id":"5fef6eda-05f2-11e1-90fc-13dac5e4a347","urn":"sdc:sdc:percona:1.2.2","name":"percona","os":"smartos","type":"smartmachine","description":"Percona SmartMachine","default":false,"requirements":{},"version":"1.2.2","created":"2012-02-13T19:23:12+00:00"},{"id":"34359ccc-21d2-2e4e-87e8-69fb36412008","urn":"sdc:sdc:windows2008r2standard:1.5.1","name":"windows2008r2standard","os":"windows","type":"virtualmachine","description":"windows2008r2standard VM image","default":false,"requirements":{"max_memory":32768,"min_memory":4096},"version":"1.5.1","created":"2012-03-13T18:25:53+00:00"},{"id":"a9380908-ea0e-11e0-aeee-4ba794c83c33","urn":"sdc:sdc:percona:1.0.7","name":"percona","os":"smartos","type":"smartmachine","description":"Percona SmartMachine","default":false,"requirements":{},"version":"1.0.7","created":"2012-02-13T19:24:17+00:00"},{"id":"df3589dc-df9a-11e0-a3a3-07ceee3e7d54","urn":"sdc:sdc:smartosplus64:3.0.4","name":"smartosplus64","os":"smartos","type":"smartmachine","description":"Generic multi-purpose SmartMachine template","default":false,"requirements":{},"version":"3.0.4","created":"2012-02-13T19:27:27+00:00"},{"id":"aded640a-df98-11e0-b050-1f55ff3ddfa7","urn":"sdc:sdc:smartosplus:3.0.4","name":"smartosplus","os":"smartos","type":"smartmachine","description":"Generic multi-purpose SmartMachine template","default":false,"requirements":{},"version":"3.0.4","created":"2012-02-13T19:30:28+00:00"},{"id":"3fcf35d2-dd79-11e0-bdcd-b3c7ac8aeea6","urn":"sdc:sdc:mysql:1.4.1","name":"mysql","os":"smartos","type":"smartmachine","description":"MySQL SmartMachine","default":false,"requirements":{},"version":"1.4.1","created":"2012-02-13T19:32:51+00:00"},{"id":"141194fa-dd77-11e0-8539-27dd8d8264b8","urn":"sdc:sdc:smartos64:1.4.7","name":"smartos64","os":"smartos","type":"smartmachine","description":"Base template to build other templates on","default":false,"requirements":{},"version":"1.4.7","created":"2012-02-13T19:33:21+00:00"},{"id":"f8ea0bb8-dd75-11e0-87c3-af5352ad3bd6","urn":"sdc:sdc:smartos:1.4.7","name":"smartos","os":"smartos","type":"smartmachine","description":"Base template to build other templates on","default":false,"requirements":{},"version":"1.4.7","created":"2012-02-13T19:33:50+00:00"}] diff --git a/libcloud/test/compute/fixtures/joyent/my_machines.json b/libcloud/test/compute/fixtures/joyent/my_machines.json deleted file mode 100644 index 1446492487..0000000000 --- a/libcloud/test/compute/fixtures/joyent/my_machines.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"id":"2fb67f5f-53f2-40ab-9d99-b9ff68cfb2ab","name":"testlc1","type":"virtualmachine","state":"running","dataset":"sdc:sdc:ubuntu-10.04:1.0.1","ips":["165.225.129.129","10.112.1.130"],"memory":1024,"disk":30720,"metadata":{"root_authorized_keys":"ssh-rsa abc== JoyentSSH\n"},"created":"2012-04-11T04:08:32+00:00","updated":"2012-04-11T04:08:42+00:00"}, -{"id":"2fb67f5f-53f2-40ab-9d99-b9ff68cfb2ab","name":"testlc2","type":"virtualmachine","state":"running","dataset":"sdc:sdc:ubuntu-10.04:1.0.1","ips":["165.225.129.128","10.112.1.131"],"memory":1024,"disk":30720,"metadata":{"root_authorized_keys":"ssh-rsa abc== Joyent SSH\n", "credentials": {"root": "abc"}},"created":"2012-04-11T04:08:32+00:00","updated":"2012-04-11T04:08:42+00:00"}] diff --git a/libcloud/test/compute/fixtures/joyent/my_machines_create.json b/libcloud/test/compute/fixtures/joyent/my_machines_create.json deleted file mode 100644 index 7565823735..0000000000 --- a/libcloud/test/compute/fixtures/joyent/my_machines_create.json +++ /dev/null @@ -1 +0,0 @@ -{"id":"2fb67f5f-53f2-40ab-9d99-b9ff68cfb2ab","name":"testlc","type":"virtualmachine","state":"provisioning","dataset":"sdc:sdc:ubuntu-10.04:1.0.1","ips":["165.225.129.129","10.112.1.130"],"memory":1024,"disk":30720,"metadata":{"root_authorized_keys":"ssh-rsa abcd== Joyent SSH\n"},"created":"2012-04-11T04:08:27+00:00","updated":"2012-04-11T04:08:27+00:00"} diff --git a/libcloud/test/compute/fixtures/joyent/my_packages.json b/libcloud/test/compute/fixtures/joyent/my_packages.json deleted file mode 100644 index a38acde0b3..0000000000 --- a/libcloud/test/compute/fixtures/joyent/my_packages.json +++ /dev/null @@ -1 +0,0 @@ -[{"name":"Large 16GB","memory":16384,"disk":491520,"vcpus":3,"swap":32768,"default":false},{"name":"XL 8GB High CPU","memory":8192,"disk":245760,"vcpus":4,"swap":16384,"default":false},{"name":"XL 32GB","memory":32768,"disk":778240,"vcpus":4,"swap":65536,"default":false},{"name":"XXL 48GB","memory":49152,"disk":1048576,"vcpus":8,"swap":98304,"default":false},{"name":"XXXL 64GB ","memory":65536,"disk":1572864,"vcpus":12,"swap":131072,"default":false},{"name":"Medium 1GB High-CPU","memory":1024,"disk":61440,"vcpus":2,"swap":2048,"default":false},{"name":"Small 1GB","memory":1024,"disk":30720,"vcpus":1,"swap":2048,"default":true},{"name":"Medium 2GB","memory":2048,"disk":61440,"vcpus":1,"swap":4096,"default":false},{"name":"Medium 4GB","memory":4096,"disk":122880,"vcpus":1,"swap":8192,"default":false},{"name":"Large 8GB","memory":8192,"disk":245760,"vcpus":2,"swap":16384,"default":false}] diff --git a/libcloud/test/compute/fixtures/kamatera/capabilities_datacenter_EU.json b/libcloud/test/compute/fixtures/kamatera/capabilities_datacenter_EU.json new file mode 100644 index 0000000000..b08070260c --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/capabilities_datacenter_EU.json @@ -0,0 +1,203 @@ +{ + "diskSizeGB": [ + 5, + 10, + 15, + 20, + 30, + 40, + 50, + 60, + 80, + 100, + 150, + 200, + 250, + 300, + 350, + 400, + 450, + 500, + 600, + 700, + 800, + 900, + 1000 + ], + "monthlyTrafficPackage": { + "b20": "20Mbit/sec unmetered on 10Gbit/sec port", + "t5000": "5000GB/month on 10Gbit/sec port" + }, + "defaultMonthlyTrafficPackage": "t5000", + "cpuTypes": [ + { + "id": "B", + "name": "Type B - General Purpose", + "description": "Server CPUs are assigned to a dedicated physical CPU Thread with reserved resources guaranteed.", + "cpuCores": [ + 1, + 2, + 4, + 6, + 8, + 12, + 16, + 20, + 24, + 28, + 32, + 36, + 40, + 48, + 56, + 64, + 72 + ], + "ramMB": [ + 256, + 512, + 1024, + 2048, + 3072, + 4096, + 6144, + 8192, + 10240, + 12288, + 16384, + 24576, + 32768, + 49152, + 65536, + 98304, + 131072, + 200704, + 262144, + 327680, + 393216 + ] + }, + { + "id": "D", + "name": "Type D - Dedicated", + "description": "Server CPU are assigned to a dedicated physical CPU Core (2 threads) with reserved resources guaranteed.", + "cpuCores": [ + 1, + 2, + 4, + 6, + 8, + 12, + 16, + 20 + ], + "ramMB": [ + 256, + 512, + 1024, + 2048, + 3072, + 4096, + 6144, + 8192, + 10240, + 12288, + 16384, + 24576, + 32768, + 49152, + 65536, + 98304, + 131072, + 200704, + 262144, + 327680, + 393216 + ] + }, + { + "id": "T", + "name": "Type T - Burstable", + "description": "Server CPUs are assigned to a dedicated physical CPU thread with reserved resources guaranteed.", + "cpuCores": [ + 1, + 2, + 4, + 6, + 8, + 12, + 16, + 20, + 24, + 28, + 32, + 36, + 40, + 48, + 56, + 64, + 72 + ], + "ramMB": [ + 256, + 512, + 1024, + 2048, + 3072, + 4096, + 6144, + 8192, + 10240, + 12288, + 16384, + 24576, + 32768, + 49152, + 65536, + 98304, + 131072, + 200704, + 262144, + 327680, + 393216 + ] + }, + { + "id": "A", + "name": "Type A - Availability", + "description": "Server CPUs are assigned to a non-dedicated physical CPU thread with no resources guaranteed.", + "cpuCores": [ + 1, + 2, + 4, + 6, + 8, + 12, + 16, + 20, + 24, + 28, + 32 + ], + "ramMB": [ + 256, + 512, + 1024, + 2048, + 3072, + 4096, + 6144, + 8192, + 10240, + 12288, + 16384, + 24576, + 32768, + 49152, + 65536, + 98304, + 131072 + ] + } + ] +} diff --git a/libcloud/test/compute/fixtures/kamatera/create_server.json b/libcloud/test/compute/fixtures/kamatera/create_server.json new file mode 100644 index 0000000000..e47a100d9a --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/create_server.json @@ -0,0 +1 @@ +{"commandIds": [12345], "password": "Aa12345678910!!!!"} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kamatera/create_server_sshkey.json b/libcloud/test/compute/fixtures/kamatera/create_server_sshkey.json new file mode 100644 index 0000000000..8c7e3c789f --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/create_server_sshkey.json @@ -0,0 +1 @@ +[12345] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kamatera/datacenters.json b/libcloud/test/compute/fixtures/kamatera/datacenters.json new file mode 100644 index 0000000000..19bea8d77a --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/datacenters.json @@ -0,0 +1,80 @@ +[ + { + "id": "AS", + "name": "China", + "category": "Asia", + "subCategory": "Hong Kong" + }, + { + "id": "CA-TR", + "name": "Canada", + "category": "North America", + "subCategory": "Toronto" + }, + { + "id": "EU", + "name": "The Netherlands", + "category": "Europe", + "subCategory": "Amsterdam" + }, + { + "id": "EU-FR", + "name": "Germany", + "category": "Europe", + "subCategory": "Frankfurt" + }, + { + "id": "EU-LO", + "name": "United Kingdom", + "category": "Europe", + "subCategory": "London" + }, + { + "id": "IL", + "name": "Israel", + "category": "Middle East", + "subCategory": "Rosh Haayin" + }, + { + "id": "IL-JR", + "name": "Israel", + "category": "Middle East", + "subCategory": "Jerusalem" + }, + { + "id": "IL-PT", + "name": "Israel", + "category": "Middle East", + "subCategory": "Petach Tikva" + }, + { + "id": "IL-RH", + "name": "Israel", + "category": "Middle East", + "subCategory": "Rosh Haayin 2" + }, + { + "id": "IL-TA", + "name": "Israel", + "category": "Middle East", + "subCategory": "Tel Aviv" + }, + { + "id": "US-NY2", + "name": "United States", + "category": "North America", + "subCategory": "New York" + }, + { + "id": "US-SC", + "name": "United States", + "category": "North America", + "subCategory": "Santa Clara" + }, + { + "id": "US-TX", + "name": "United States", + "category": "North America", + "subCategory": "Texas" + } +] diff --git a/libcloud/test/compute/fixtures/kamatera/failed_auth.json b/libcloud/test/compute/fixtures/kamatera/failed_auth.json new file mode 100644 index 0000000000..a0b64b63f6 --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/failed_auth.json @@ -0,0 +1,3 @@ +{ + "message": "{\"errors\":[{\"code\":1,\"info\":\"you are not logged in\"}]}" +} diff --git a/libcloud/test/compute/fixtures/kamatera/images_datacenter_EU.json b/libcloud/test/compute/fixtures/kamatera/images_datacenter_EU.json new file mode 100644 index 0000000000..11d90956d9 --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/images_datacenter_EU.json @@ -0,0 +1,604 @@ +[ + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C2987c9641fd2619a149ba2ca01a", + "name": "CentOS 8.0 64-bit - Minimal Configuration", + "code": "8.0 64bit_minimal", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C29b85c6367d215d403f44c28f48", + "name": "CentOS 8.0 64-bit - Basic Server Configuration", + "code": "8.0 64bit_basic_server", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C296c6b68a57dd7054c4d3c6eef2", + "name": "CentOS 7.7 64-bit - minimal Configuration", + "code": "7.7 64bit_minimal", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C29c28b0fa58c52bb361202dc2be", + "name": "CentOS 7.7 64-bit - Basic Server Configuration", + "code": "7.7 64bit_basic_server", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C291195abef23f2815c6f7cc301a", + "name": "CentOS 7.4 64-bit - Minimal Configuration", + "code": "7.4 64bit_minimal", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C291a7dbc4a539dc4500ed1975c5", + "name": "CentOS 7.4 64-bit - Basic Server Configuration", + "code": "7.4 64bit_basic_server", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C2979e186bf7a61242f3bc49c945", + "name": "CentOS 6.9 64-bit - Minimal Configuration", + "code": "6.9 64bit_minimal", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C2924b678625c2b07d04b4978e18", + "name": "CentOS 6.9 64-bit - Basic Server Configuration", + "code": "6.9 64bit_basic_server", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C296c816785af0416189ce873152", + "name": "CentOS 6.9 32-bit - Minimal Configuration", + "code": "6.9 32bit_minimal", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C2982cc1f899e74c4f39a9e81998", + "name": "CentOS 6.9 32-bit - Basic Server Configuration", + "code": "6.9 32bit_basic_server", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C29c258bce8d868fa38afb946073", + "name": "CentOS 5.11 64-bit - Minimal Configuration", + "code": "5.11 64bit_minimal", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C29c9bfc5ab3a09ff3a80dfe46ce", + "name": "CentOS 5.11 64-bit - Basic Server Configuration", + "code": "5.11 64bit_basic_server", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C29786f615663312af9d49bba1ef", + "name": "CentOS 5.11 32-bit - Minimal Configuration", + "code": "5.11 32bit_minimal", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "CentOS", + "id": "EU:6000C29b6395b4cc22896d745fa1a5c4", + "name": "CentOS 5.11 32-bit Basic Server Configuration", + "code": "5.11 32bit_basic_server", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "Debian", + "id": "EU:6000C291c63645ada7e3b2f48f1b7c14", + "name": "Debian version 9.11 (stretch) 64-bit", + "code": "9.11 64bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "Debian", + "id": "EU:6000C29bb8fde673f515caf9bed695a1", + "name": "Debian version 8.9 (jessie) 64-bit", + "code": "8.9 64bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "Debian", + "id": "EU:6000C29a9eb2046f9d486e0297051ec8", + "name": "Debian version 8.9 (jessie) 32-bit", + "code": "8.9 32bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "Debian", + "id": "EU:6000C29541e39a9892043d7237503d06", + "name": "Debian version 7.11 (wheezy) 64-bit", + "code": "7.11 64bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "Debian", + "id": "EU:6000C29cebd37daa2ee4d7f6de19e931", + "name": "Debian version 7.11 (wheezy) 32-bit", + "code": "7.11 32bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "Debian", + "id": "EU:6000C2905f500f62665b27b1510cdbe3", + "name": "Debian version 10.0 (buster) 64-bit", + "code": "10.0 64bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "FreeBSD", + "id": "EU:6000C29e4131d66b806c25c48ab0b810", + "name": "FreeBSD 12.1 64-bit", + "code": "12.1 64bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "FreeBSD", + "id": "EU:6000C2903191e36bbd4f9e8b089291d5", + "name": "FreeBSD 11.3 64-bit", + "code": "11.3 64bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "FreeBSD", + "id": "EU:6000C298bb2e4ea0f1891cd81735d24e", + "name": "FreeBSD 11.1 64-bit", + "code": "11.1 64bit", + "osDiskSizeGB": 2, + "ramMBMin": { + "A": 512, + "B": 512, + "T": 512, + "D": 512 + } + }, + { + "datacenter": "EU", + "os": "FreeBSD", + "id": "EU:6000C2983bdd8b531ecfc6d892a35aa4", + "name": "FreeBSD 11.1 32-bit", + "code": "11.1 32bit", + "osDiskSizeGB": 2, + "ramMBMin": { + "A": 512, + "B": 512, + "T": 512, + "D": 512 + } + }, + { + "datacenter": "EU", + "os": "Ubuntu", + "id": "EU:6000C2904fc6d8295d2b6d9687ed955e", + "name": "Ubuntu Server version 18.04 LTS (bionic) 64-bit, \n\nOptimized for best performance and with minimal OS services (OS use only 80MB RAM).\n\nProvisioning of this server takes 5 minutes longer as latest OS updates are downloaded and installed.", + "code": "18.04 64bit_optimized_updated", + "osDiskSizeGB": 4, + "ramMBMin": { + "A": 512, + "B": 512, + "T": 512, + "D": 512 + } + }, + { + "datacenter": "EU", + "os": "Ubuntu", + "id": "EU:6000C29040fd67b51a229d7e641fba22", + "name": "Ubuntu Server version 18.04 LTS (bionic) 64-bit.\nOptimized for best performance and with minimal OS services (OS use only 80MB RAM).", + "code": "18.04 64bit_optimized", + "osDiskSizeGB": 4, + "ramMBMin": { + "A": 512, + "B": 512, + "T": 512, + "D": 512 + } + }, + { + "datacenter": "EU", + "os": "Ubuntu", + "id": "EU:6000C29a5a7220dcf84716e7bba74215", + "name": "Ubuntu Server version 18.04 LTS (bionic) 64-bit", + "code": "18.04 64bit", + "osDiskSizeGB": 4, + "ramMBMin": { + "A": 512, + "B": 512, + "T": 512, + "D": 512 + } + }, + { + "datacenter": "EU", + "os": "Ubuntu", + "id": "EU:6000C298bbb2d3b6e9721f4f4f3c5bf0", + "name": "Ubuntu Server version 16.04 LTS (xenial) 64-bit", + "code": "16.04 64bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 512, + "B": 512, + "T": 512, + "D": 512 + } + }, + { + "datacenter": "EU", + "os": "Ubuntu", + "id": "EU:6000C2901a61dff371f4d1d34bd9548b", + "name": "Ubuntu Server version 16.04 LTS (xenial) 32-bit", + "code": "16.04 32bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "Ubuntu", + "id": "EU:6000C29188a2a1c97070d1d6fb71ee89", + "name": "Ubuntu Server version 15.04 (vivid) 64-bit", + "code": "15.04 64bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "Ubuntu", + "id": "EU:6000C299f04969dee8d55d2d3f0dbb96", + "name": "Ubuntu Server version 14.04 LTS (trusty) 64-bit", + "code": "14.04 64bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "Ubuntu", + "id": "EU:6000C295834b332b89f79521cdabca9e", + "name": "Ubuntu Server version 14.04 LTS (trusty) 32-bit", + "code": "14.04 32bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "Ubuntu", + "id": "EU:6000C29574cbda93387eac758727a6c9", + "name": "Ubuntu Server version 12.04 LTS (precise) 64-bit", + "code": "12.04 64bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "Ubuntu", + "id": "EU:6000C296d934a62e14bd45586beeec3f", + "name": "Ubuntu Server version 12.04 LTS (precise) 32-bit", + "code": "12.04 32bit", + "osDiskSizeGB": 5, + "ramMBMin": { + "A": 256, + "B": 256, + "T": 256, + "D": 256 + } + }, + { + "datacenter": "EU", + "os": "Windows", + "id": "EU:6000C29e1066cc75286eac3058d7204a", + "name": "Microsoft Windows Server 2019 Standard 64-bit", + "code": "2019_standard 64bit", + "osDiskSizeGB": 30, + "ramMBMin": { + "A": 1024, + "B": 1024, + "T": 1024, + "D": 1024 + } + }, + { + "datacenter": "EU", + "os": "Windows", + "id": "EU:6000C29d57e683a6170662bb6c4386e1", + "name": "Microsoft Windows Server 2019 Datacenter 64-bit", + "code": "2019_datacenter 64bit", + "osDiskSizeGB": 30, + "ramMBMin": { + "A": 1024, + "B": 1024, + "T": 1024, + "D": 1024 + } + }, + { + "datacenter": "EU", + "os": "Windows", + "id": "EU:6000C29a99c7cc5d67b773c85d017307", + "name": "Microsoft Windows Server 2016 Standard 64-bit", + "code": "2016_standard 64bit", + "osDiskSizeGB": 25, + "ramMBMin": { + "A": 1024, + "B": 1024, + "T": 1024, + "D": 1024 + } + }, + { + "datacenter": "EU", + "os": "Windows", + "id": "EU:6000C298abe9aa378af7832e3d7de7b6", + "name": "Microsoft Windows Server 2016 Datacenter 64-bit", + "code": "2016_datacenter 64bit", + "osDiskSizeGB": 25, + "ramMBMin": { + "A": 1024, + "B": 1024, + "T": 1024, + "D": 1024 + } + }, + { + "datacenter": "EU", + "os": "Windows", + "id": "EU:6000C294c507a05a21df616f2da61aa5", + "name": "Microsoft Windows Server 2012 R2 Standard 64-bit", + "code": "2012_r2_standard 64bit", + "osDiskSizeGB": 30, + "ramMBMin": { + "A": 1024, + "B": 1024, + "T": 1024, + "D": 1024 + } + }, + { + "datacenter": "EU", + "os": "Windows", + "id": "EU:6000C298807c04093ca0b86ab7486044", + "name": "Microsoft Windows Server 2012 R2 Datacenter 64-bit", + "code": "2012_r2_datacenter 64bit", + "osDiskSizeGB": 30, + "ramMBMin": { + "A": 1024, + "B": 1024, + "T": 1024, + "D": 1024 + } + }, + { + "datacenter": "EU", + "os": "Windows", + "id": "EU:6000C29e684efebf574b286df3b4ff4f", + "name": "Microsoft Windows Server 2008 R2 Standard 64-bit", + "code": "2008_r2_standard 64bit", + "osDiskSizeGB": 25, + "ramMBMin": { + "A": 1024, + "B": 1024, + "T": 1024, + "D": 1024 + } + }, + { + "datacenter": "EU", + "os": "Windows", + "id": "EU:6000C298c677d7da830e4f3ae1765c7e", + "name": "Microsoft Windows Server 2008 R2 Enterpriser 64-bit", + "code": "2008_r2_enterprise 64bit", + "osDiskSizeGB": 25, + "ramMBMin": { + "A": 1024, + "B": 1024, + "T": 1024, + "D": 1024 + } + }, + { + "datacenter": "EU", + "os": "Windows", + "id": "EU:6000C2960d7769492105a558d145c7d3", + "name": "Microsoft Windows Server 2008 R2 Datacenter 64-bit", + "code": "2008_r2_datacenter 64bit", + "osDiskSizeGB": 25, + "ramMBMin": { + "A": 1024, + "B": 1024, + "T": 1024, + "D": 1024 + } + } +] diff --git a/libcloud/test/compute/fixtures/kamatera/queue_12345-1.json b/libcloud/test/compute/fixtures/kamatera/queue_12345-1.json new file mode 100644 index 0000000000..a7ee568186 --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/queue_12345-1.json @@ -0,0 +1,5 @@ +[ + { + "status": "pending" + } +] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kamatera/queue_12345-2.json b/libcloud/test/compute/fixtures/kamatera/queue_12345-2.json new file mode 100644 index 0000000000..9cca9f4618 --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/queue_12345-2.json @@ -0,0 +1,5 @@ +[ + { + "status": "executing" + } +] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kamatera/queue_12345-3.json b/libcloud/test/compute/fixtures/kamatera/queue_12345-3.json new file mode 100644 index 0000000000..efbcea2c24 --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/queue_12345-3.json @@ -0,0 +1,6 @@ +[ + { + "status": "progress", + "log": "Name: my-server\nCreating..." + } +] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kamatera/queue_12345-4.json b/libcloud/test/compute/fixtures/kamatera/queue_12345-4.json new file mode 100644 index 0000000000..55a979ddcf --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/queue_12345-4.json @@ -0,0 +1,6 @@ +[ + { + "status": "complete", + "log": "Name: my-server\nCreating...\nDone" + } +] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kamatera/server_info.json b/libcloud/test/compute/fixtures/kamatera/server_info.json new file mode 100644 index 0000000000..62405006cc --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/server_info.json @@ -0,0 +1,11 @@ +[{ + "id": "XXXX-YYYY-ZZZZ", + "name": "my-server", + "power": "on", + "datacenter": "IL", + "networks": [ + {"network" : "wan-il", "ips": ["1.2.3.4"]}, + {"network" : "12345-my-vlan", "ips": ["5.6.7.8"]} + ], + "billing": "monthly" +}] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kamatera/server_operation.json b/libcloud/test/compute/fixtures/kamatera/server_operation.json new file mode 100644 index 0000000000..8c7e3c789f --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/server_operation.json @@ -0,0 +1 @@ +[12345] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kamatera/servers.json b/libcloud/test/compute/fixtures/kamatera/servers.json new file mode 100644 index 0000000000..6dba6282e8 --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/servers.json @@ -0,0 +1,8 @@ +[ + { + "id": "XXXX-YYYY-ZZZZ", + "name": "test_server", + "power": "on", + "datacenter": "IL" + } +] \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kamatera/sizes_datacenter_EU.json b/libcloud/test/compute/fixtures/kamatera/sizes_datacenter_EU.json new file mode 100644 index 0000000000..70d28b47d9 --- /dev/null +++ b/libcloud/test/compute/fixtures/kamatera/sizes_datacenter_EU.json @@ -0,0 +1,26 @@ +[ + { + "id": "small", + "ramMB": 4096, + "cpuCores": 2, + "cpuType": "B", + "diskSizeGB": 30, + "monthlyTrafficPackage": "t5000" + }, + { + "id": "medium", + "ramMB": 8192, + "cpuCores": 4, + "cpuType": "B", + "diskSizeGB": 60, + "monthlyTrafficPackage": "t5000" + }, + { + "id": "large", + "ramMB": 16384, + "cpuCores": 8, + "cpuType": "B", + "diskSizeGB": 100, + "monthlyTrafficPackage": "t5000" + } +] diff --git a/libcloud/test/compute/fixtures/ktucloud/listIpForwardingRules_default.json b/libcloud/test/compute/fixtures/ktucloud/listIpForwardingRules_default.json new file mode 100644 index 0000000000..20fbc42d3d --- /dev/null +++ b/libcloud/test/compute/fixtures/ktucloud/listIpForwardingRules_default.json @@ -0,0 +1 @@ +{ "listipforwardingrulesresponse" : { "count":1 ,"ipforwardingrule" : [ {"id":"772fd410-6649-43ed-befa-77be986b8906","protocol":"tcp","virtualmachineid":"2600","virtualmachinename":"test","virtualmachinedisplayname":"test","ipaddressid":34000,"ipaddress":"1.1.1.116","startport":33,"endport":34,"state":"Active"} ] } } diff --git a/libcloud/test/compute/fixtures/kubevirt/_api_v1_namespaces.json b/libcloud/test/compute/fixtures/kubevirt/_api_v1_namespaces.json new file mode 100644 index 0000000000..3be5559f89 --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/_api_v1_namespaces.json @@ -0,0 +1,115 @@ +{ + "apiVersion": "v1", + "metadata": { + "selfLink": "/api/v1/namespaces", + "resourceVersion": "227032" + }, + "kind": "NamespaceList", + "items": [ + { + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "metadata": { + "name": "default", + "creationTimestamp": "2019-12-01T15:54:25Z", + "selfLink": "/api/v1/namespaces/default", + "resourceVersion": "146", + "uid": "a5370eda-e8d8-4a1b-a97b-aeb9271bdcf8" + }, + "status": { + "phase": "Active" + } + }, + { + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "metadata": { + "name": "kube-node-lease", + "creationTimestamp": "2019-12-01T15:54:23Z", + "selfLink": "/api/v1/namespaces/kube-node-lease", + "resourceVersion": "39", + "uid": "0f934934-aefd-4d8d-862a-dd123b51b966" + }, + "status": { + "phase": "Active" + } + }, + { + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "metadata": { + "name": "kube-public", + "creationTimestamp": "2019-12-01T15:54:23Z", + "selfLink": "/api/v1/namespaces/kube-public", + "resourceVersion": "38", + "uid": "8f7c5fec-fc55-4057-9cf4-b2b0441848bd" + }, + "status": { + "phase": "Active" + } + }, + { + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "metadata": { + "name": "kube-system", + "creationTimestamp": "2019-12-01T15:54:23Z", + "selfLink": "/api/v1/namespaces/kube-system", + "resourceVersion": "37", + "uid": "9263771e-166e-4b6b-8fbf-6a9af569ac93" + }, + "status": { + "phase": "Active" + } + }, + { + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "metadata": { + "labels": { + "kubevirt.io": "" + }, + "selfLink": "/api/v1/namespaces/kubevirt", + "name": "kubevirt", + "creationTimestamp": "2019-12-01T15:58:27Z", + "resourceVersion": "689", + "uid": "e6d3d7e8-0ee5-428b-8e17-5187779e5627" + }, + "status": { + "phase": "Active" + } + }, + { + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "metadata": { + "name": "testreqlim", + "creationTimestamp": "2019-12-01T15:54:25Z", + "selfLink": "/api/v1/namespaces/default", + "resourceVersion": "146", + "uid": "5341e71d-e8d8-4a1b-a97b-52864eb3dd7d" + }, + "status": { + "phase": "Active" + } + } + ] + } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/create_vm.json b/libcloud/test/compute/fixtures/kubevirt/create_vm.json new file mode 100644 index 0000000000..e86eedd7ba --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/create_vm.json @@ -0,0 +1,83 @@ +{ + "metadata": { + "creationTimestamp": "2019-12-23T13:33:14Z", + "namespace": "default", + "resourceVersion": "911058", + "generation": 1, + "name": "testcreatenode", + "labels": { + "kubevirt.io/vm": "testcreatenode" + }, + "uid": "e553010d-e904-436f-a92a-396be0f8bd4c", + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines/testcreatenode" + }, + "spec": { + "running": false, + "template": { + "metadata": { + "labels": { + "kubevirt.io/vm": "testcreatenode" + } + }, + "spec": { + "volumes": [ + { + "persistentVolumeClaim": { + "claimName": "mypvc2" + }, + "name": "anpvc" + }, + { + "name": "boot-disk", + "containerDisk": { + "image": "kubevirt/cirros-registry-disk-demo" + } + } + ], + "networks": [ + { + "name": "netw1", + "pod": {} + } + ], + "terminationGracePeriodSeconds": 0, + "domain": { + "resources": { + "requests": { + "memory": "128M" + } + }, + "cpu": {}, + "devices": { + "interfaces": [ + { + "name": "netw1", + "masquerade": {} + } + ], + "disks": [ + { + "name": "anpvc", + "disk": { + "bus": "virtio" + } + }, + { + "name": "boot-disk", + "disk": { + "bus": "virtio" + } + } + ], + "networkInterfaceMultiqueue": false + }, + "machine": { + "type": "" + } + } + } + } + }, + "kind": "VirtualMachine", + "apiVersion": "kubevirt.io/v1alpha3" + } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/create_vm_reqlim.json b/libcloud/test/compute/fixtures/kubevirt/create_vm_reqlim.json new file mode 100644 index 0000000000..2f23647387 --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/create_vm_reqlim.json @@ -0,0 +1,218 @@ +{ + "apiVersion": "kubevirt.io/v1alpha3", + "kind": "VirtualMachine", + "metadata": { + "annotations": { + "kubevirt.io/latest-observed-api-version": "v1", + "kubevirt.io/storage-observed-api-version": "v1alpha3" + }, + "creationTimestamp": "2024-06-18T08:48:27Z", + "generation": 2, + "labels": { + "kubevirt.io/vm": "vm-test-tumbleweed-07" + }, + "managedFields": [ + { + "apiVersion": "kubevirt.io/v1alpha3", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:labels": { + ".": {}, + "f:kubevirt.io/vm": {} + } + }, + "f:spec": { + ".": {}, + "f:running": {}, + "f:template": { + ".": {}, + "f:metadata": { + ".": {}, + "f:labels": { + ".": {}, + "f:kubevirt.io/vm": {} + } + }, + "f:spec": { + ".": {}, + "f:domain": { + ".": {}, + "f:devices": { + ".": {}, + "f:disks": {}, + "f:interfaces": {}, + "f:networkInterfaceMultiqueue": {} + }, + "f:machine": { + ".": {}, + "f:type": {} + }, + "f:resources": { + ".": {}, + "f:limits": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + }, + "f:requests": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + } + } + }, + "f:networks": {}, + "f:terminationGracePeriodSeconds": {}, + "f:volumes": {} + } + } + } + }, + "manager": "libcloud", + "operation": "Update", + "time": "2024-06-18T08:48:28Z" + }, + { + "apiVersion": "kubevirt.io/v1alpha3", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:kubevirt.io/latest-observed-api-version": {}, + "f:kubevirt.io/storage-observed-api-version": {} + } + }, + "f:status": { + ".": {}, + "f:conditions": {}, + "f:created": {}, + "f:printableStatus": {}, + "f:ready": {}, + "f:volumeSnapshotStatuses": {} + } + }, + "manager": "Go-http-client", + "operation": "Update", + "time": "2024-06-18T08:49:04Z" + } + ], + "name": "vm-test-tumbleweed-07", + "namespace": "testreqlim", + "resourceVersion": "543653381", + "selfLink": "/apis/kubevirt.io/v1/namespaces/testreqlim/virtualmachines/vm-test-tumbleweed-07", + "uid": "2654b6fe-f230-4d18-8d80-c5d540ce360f" + }, + "spec": { + "running": true, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "kubevirt.io/vm": "vm-test-tumbleweed-07" + } + }, + "spec": { + "domain": { + "devices": { + "disks": [ + { + "disk": { + "bus": "virtio" + }, + "name": "boot-disk-36c21c0b-e7dc-4ec6-b997-ac1f987e7cea" + }, + { + "disk": { + "bus": "virtio" + }, + "name": "auth-cloudinit-9303dc4a-2464-410a-b7ed-deba78cff2e4" + } + ], + "interfaces": [ + { + "bridge": {}, + "name": "default" + } + ], + "networkInterfaceMultiqueue": false + }, + "machine": { + "type": "q35" + }, + "resources": { + "limits": { + "cpu": "2", + "memory": "4Gi" + }, + "requests": { + "cpu": "1m", + "memory": "1Mi" + } + } + }, + "networks": [ + { + "name": "default", + "pod": {} + } + ], + "terminationGracePeriodSeconds": 0, + "volumes": [ + { + "containerDisk": { + "image": "registry.internal.com/kubevirt-vmidisks/tumbleweed:240531" + }, + "name": "boot-disk-36c21c0b-e7dc-4ec6-b997-ac1f987e7cea" + }, + { + "cloudInitNoCloud": { + "userData": "#cloud-config\nssh_authorized_keys:\n - ssh-rsa FAKEKEY foo@bar.com\n" + }, + "name": "auth-cloudinit-9303dc4a-2464-410a-b7ed-deba78cff2e4" + } + ] + } + } + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2024-06-18T08:34:48Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": null, + "message": "cannot migrate VMI which does not use masquerade to connect to the pod network", + "reason": "InterfaceNotLiveMigratable", + "status": "False", + "type": "LiveMigratable" + }, + { + "lastProbeTime": "2024-06-18T08:35:18Z", + "lastTransitionTime": null, + "status": "True", + "type": "AgentConnected" + } + ], + "created": true, + "printableStatus": "Running", + "ready": true, + "volumeSnapshotStatuses": [ + { + "enabled": false, + "name": "boot-disk-36c21c0b-e7dc-4ec6-b997-ac1f987e7cea", + "reason": "Snapshot is not supported for this volumeSource type [boot-disk-36c21c0b-e7dc-4ec6-b997-ac1f987e7cea]" + }, + { + "enabled": false, + "name": "auth-cloudinit-9303dc4a-2464-410a-b7ed-deba78cff2e4", + "reason": "Snapshot is not supported for this volumeSource type [auth-cloudinit-9303dc4a-2464-410a-b7ed-deba78cff2e4]" + } + ] + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/delete_vmi_testvm.json b/libcloud/test/compute/fixtures/kubevirt/delete_vmi_testvm.json new file mode 100644 index 0000000000..1e4a5db232 --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/delete_vmi_testvm.json @@ -0,0 +1,132 @@ +{ + "apiVersion": "kubevirt.io/v1alpha3", + "status": { + "phase": "Running", + "migrationMethod": "BlockMigration", + "conditions": [ + { + "type": "LiveMigratable", + "lastTransitionTime": null, + "message": "cannot migrate VMI with a bridge interface connected to a pod network", + "status": "False", + "lastProbeTime": null, + "reason": "InterfaceNotLiveMigratable" + }, + { + "type": "Ready", + "lastTransitionTime": "2019-12-08T13:17:48Z", + "status": "True", + "lastProbeTime": null + } + ], + "guestOSInfo": {}, + "nodeName": "minikube", + "interfaces": [ + { + "ipAddress": "172.17.0.11", + "name": "default", + "mac": "02:42:ac:11:00:0b" + } + ], + "qosClass": "Burstable" + }, + "kind": "VirtualMachineInstance", + "metadata": { + "generateName": "testvm", + "deletionGracePeriodSeconds": 0, + "labels": { + "kubevirt.io/nodeName": "minikube", + "kubevirt.io/size": "small", + "kubevirt.io/domain": "testvm" + }, + "annotations": { + "kubevirt.io/latest-observed-api-version": "v1alpha3", + "kubevirt.io/storage-observed-api-version": "v1alpha3" + }, + "namespace": "default", + "creationTimestamp": "2019-12-08T13:17:41Z", + "name": "testvm", + "generation": 9, + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachineinstances/testvm", + "ownerReferences": [ + { + "apiVersion": "kubevirt.io/v1alpha3", + "name": "testvm", + "kind": "VirtualMachine", + "blockOwnerDeletion": true, + "uid": "74fd7665-fbd6-4565-977c-96bd21fb785a", + "controller": true + } + ], + "deletionTimestamp": "2019-12-08T13:18:54Z", + "resourceVersion": "276064", + "finalizers": [ + "foregroundDeleteVirtualMachine" + ], + "uid": "4106caa7-836f-40fe-b872-6f46be4eb6cf" + }, + "spec": { + "domain": { + "devices": { + "disks": [ + { + "disk": { + "bus": "virtio" + }, + "name": "containerdisk" + }, + { + "disk": { + "bus": "virtio" + }, + "name": "cloudinitdisk" + } + ], + "interfaces": [ + { + "name": "default", + "bridge": {} + } + ] + }, + "firmware": { + "uuid": "5a9fc181-957e-5c32-9e5a-2de5e9673531" + }, + "machine": { + "type": "q35" + }, + "resources": { + "requests": { + "cpu": "100m", + "memory": "64M" + } + }, + "features": { + "acpi": { + "enabled": true + } + } + }, + "networks": [ + { + "name": "default", + "pod": {} + } + ], + "volumes": [ + { + "name": "containerdisk", + "containerDisk": { + "image": "kubevirt/cirros-registry-disk-demo", + "imagePullPolicy": "Always" + } + }, + { + "cloudInitNoCloud": { + "userDataBase64": "SGkuXG4=" + }, + "name": "cloudinitdisk" + } + ] + } + } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/get_default_vms.json b/libcloud/test/compute/fixtures/kubevirt/get_default_vms.json new file mode 100644 index 0000000000..67615bb7ab --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/get_default_vms.json @@ -0,0 +1,99 @@ +{ + "items": [ + { + "spec": { + "template": { + "spec": { + "domain": { + "resources": { + "requests": { + "memory": "64M" + } + }, + "devices": { + "disks": [ + { + "name": "containerdisk", + "disk": { + "bus": "virtio" + } + }, + { + "name": "cloudinitdisk", + "disk": { + "bus": "virtio" + } + } + ], + "interfaces": [ + { + "name": "default", + "bridge": {} + } + ] + }, + "machine": { + "type": "" + } + }, + "networks": [ + { + "name": "default", + "pod": {} + } + ], + "volumes": [ + { + "name": "containerdisk", + "containerDisk": { + "image": "kubevirt/cirros-registry-disk-demo" + } + }, + { + "cloudInitNoCloud": { + "userDataBase64": "SGkuXG4=" + }, + "name": "cloudinitdisk" + } + ] + }, + "metadata": { + "creationTimestamp": null, + "labels": { + "kubevirt.io/domain": "testvm", + "kubevirt.io/size": "small" + } + } + }, + "running": true + }, + "apiVersion": "kubevirt.io/v1alpha3", + "metadata": { + "annotations": { + "kubevirt.io/latest-observed-api-version": "v1alpha3", + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"kubevirt.io/v1alpha3\",\"kind\":\"VirtualMachine\",\"metadata\":{\"annotations\":{},\"name\":\"testvm\",\"namespace\":\"default\"},\"spec\":{\"running\":false,\"template\":{\"metadata\":{\"labels\":{\"kubevirt.io/domain\":\"testvm\",\"kubevirt.io/size\":\"small\"}},\"spec\":{\"domain\":{\"devices\":{\"disks\":[{\"disk\":{\"bus\":\"virtio\"},\"name\":\"containerdisk\"},{\"disk\":{\"bus\":\"virtio\"},\"name\":\"cloudinitdisk\"}],\"interfaces\":[{\"bridge\":{},\"name\":\"default\"}]},\"resources\":{\"requests\":{\"memory\":\"64M\"}}},\"networks\":[{\"name\":\"default\",\"pod\":{}}],\"volumes\":[{\"containerDisk\":{\"image\":\"kubevirt/cirros-registry-disk-demo\"},\"name\":\"containerdisk\"},{\"cloudInitNoCloud\":{\"userDataBase64\":\"SGkuXG4=\"},\"name\":\"cloudinitdisk\"}]}}}}\n", + "kubevirt.io/storage-observed-api-version": "v1alpha3" + }, + "creationTimestamp": "2019-12-02T15:35:14Z", + "generation": 39, + "namespace": "default", + "name": "testvm", + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines/testvm", + "resourceVersion": "284863", + "uid": "74fd7665-fbd6-4565-977c-96bd21fb785a" + }, + "kind": "VirtualMachine", + "status": { + "ready": true, + "created": true + } + } + ], + "apiVersion": "kubevirt.io/v1alpha3", + "metadata": { + "continue": "", + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines", + "resourceVersion": "285618" + }, + "kind": "VirtualMachineList" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/get_default_vms_after_create_vm.json b/libcloud/test/compute/fixtures/kubevirt/get_default_vms_after_create_vm.json new file mode 100644 index 0000000000..80a12f07f6 --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/get_default_vms_after_create_vm.json @@ -0,0 +1,182 @@ +{ + "items": [ + { + "spec": { + "template": { + "spec": { + "domain": { + "resources": { + "requests": { + "memory": "64M" + } + }, + "devices": { + "disks": [ + { + "name": "containerdisk", + "disk": { + "bus": "virtio" + } + }, + { + "name": "cloudinitdisk", + "disk": { + "bus": "virtio" + } + } + ], + "interfaces": [ + { + "name": "default", + "bridge": {} + } + ] + }, + "machine": { + "type": "" + } + }, + "networks": [ + { + "name": "default", + "pod": {} + } + ], + "volumes": [ + { + "name": "containerdisk", + "containerDisk": { + "image": "kubevirt/cirros-registry-disk-demo" + } + }, + { + "cloudInitNoCloud": { + "userDataBase64": "SGkuXG4=" + }, + "name": "cloudinitdisk" + } + ] + }, + "metadata": { + "creationTimestamp": null, + "labels": { + "kubevirt.io/domain": "testvm", + "kubevirt.io/size": "small" + } + } + }, + "running": true + }, + "apiVersion": "kubevirt.io/v1alpha3", + "metadata": { + "annotations": { + "kubevirt.io/latest-observed-api-version": "v1alpha3", + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"kubevirt.io/v1alpha3\",\"kind\":\"VirtualMachine\",\"metadata\":{\"annotations\":{},\"name\":\"testvm\",\"namespace\":\"default\"},\"spec\":{\"running\":false,\"template\":{\"metadata\":{\"labels\":{\"kubevirt.io/domain\":\"testvm\",\"kubevirt.io/size\":\"small\"}},\"spec\":{\"domain\":{\"devices\":{\"disks\":[{\"disk\":{\"bus\":\"virtio\"},\"name\":\"containerdisk\"},{\"disk\":{\"bus\":\"virtio\"},\"name\":\"cloudinitdisk\"}],\"interfaces\":[{\"bridge\":{},\"name\":\"default\"}]},\"resources\":{\"requests\":{\"memory\":\"64M\"}}},\"networks\":[{\"name\":\"default\",\"pod\":{}}],\"volumes\":[{\"containerDisk\":{\"image\":\"kubevirt/cirros-registry-disk-demo\"},\"name\":\"containerdisk\"},{\"cloudInitNoCloud\":{\"userDataBase64\":\"SGkuXG4=\"},\"name\":\"cloudinitdisk\"}]}}}}\n", + "kubevirt.io/storage-observed-api-version": "v1alpha3" + }, + "creationTimestamp": "2019-12-02T15:35:14Z", + "generation": 39, + "namespace": "default", + "name": "testvm", + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines/testvm", + "resourceVersion": "284863", + "uid": "74fd7665-fbd6-4565-977c-96bd21fb785a" + }, + "kind": "VirtualMachine", + "status": { + "ready": true, + "created": true + } + }, + { + "metadata": { + "creationTimestamp": "2019-12-23T13:33:14Z", + "namespace": "default", + "resourceVersion": "911058", + "generation": 1, + "name": "testcreatenode", + "labels": { + "kubevirt.io/vm": "testcreatenode" + }, + "uid": "e553010d-e904-436f-a92a-396be0f8bd4c", + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines/testcreatenode" + }, + "spec": { + "running": false, + "template": { + "metadata": { + "labels": { + "kubevirt.io/vm": "testcreatenode" + } + }, + "spec": { + "volumes": [ + { + "persistentVolumeClaim": { + "claimName": "mypvc2" + }, + "name": "anpvc" + }, + { + "name": "boot-disk", + "containerDisk": { + "image": "kubevirt/cirros-registry-disk-demo" + } + } + ], + "networks": [ + { + "name": "netw1", + "pod": {} + } + ], + "terminationGracePeriodSeconds": 0, + "domain": { + "resources": { + "requests": { + "memory": "128M" + } + }, + "cpu": {}, + "devices": { + "interfaces": [ + { + "name": "netw1", + "masquerade": {} + } + ], + "disks": [ + { + "name": "anpvc", + "disk": { + "bus": "virtio" + } + }, + { + "name": "boot-disk", + "disk": { + "bus": "virtio" + } + } + ], + "networkInterfaceMultiqueue": false + }, + "machine": { + "type": "" + } + } + } + } + }, + "kind": "VirtualMachine", + "apiVersion": "kubevirt.io/v1alpha3" + } + ], + "apiVersion": "kubevirt.io/v1alpha3", + "metadata": { + "continue": "", + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines", + "resourceVersion": "285618" + }, + "kind": "VirtualMachineList" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/get_kube_node_lease_vms.json b/libcloud/test/compute/fixtures/kubevirt/get_kube_node_lease_vms.json new file mode 100644 index 0000000000..9109ad5961 --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/get_kube_node_lease_vms.json @@ -0,0 +1,10 @@ +{ + "kind": "VirtualMachineList", + "items": [], + "metadata": { + "continue": "", + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/kube-node-lease/virtualmachines", + "resourceVersion": "242134" + }, + "apiVersion": "kubevirt.io/v1alpha3" + } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/get_kube_public_vms.json b/libcloud/test/compute/fixtures/kubevirt/get_kube_public_vms.json new file mode 100644 index 0000000000..b6e6771198 --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/get_kube_public_vms.json @@ -0,0 +1,10 @@ +{ + "kind": "VirtualMachineList", + "items": [], + "metadata": { + "continue": "", + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/kube-public/virtualmachines", + "resourceVersion": "243536" + }, + "apiVersion": "kubevirt.io/v1alpha3" + } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/get_kube_system_vms.json b/libcloud/test/compute/fixtures/kubevirt/get_kube_system_vms.json new file mode 100644 index 0000000000..a56eeaa56c --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/get_kube_system_vms.json @@ -0,0 +1,10 @@ +{ + "kind": "VirtualMachineList", + "items": [], + "metadata": { + "continue": "", + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/kube-system/virtualmachines", + "resourceVersion": "243702" + }, + "apiVersion": "kubevirt.io/v1alpha3" + } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/get_kubevirt_vms.json b/libcloud/test/compute/fixtures/kubevirt/get_kubevirt_vms.json new file mode 100644 index 0000000000..15c22b0b8a --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/get_kubevirt_vms.json @@ -0,0 +1,10 @@ +{ + "kind": "VirtualMachineList", + "items": [], + "metadata": { + "continue": "", + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/kubevirt/virtualmachines", + "resourceVersion": "245647" + }, + "apiVersion": "kubevirt.io/v1alpha3" + } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/get_pods.json b/libcloud/test/compute/fixtures/kubevirt/get_pods.json new file mode 100644 index 0000000000..e69a555262 --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/get_pods.json @@ -0,0 +1,322 @@ +{ + "items": [ + { + "status": { + "startTime": "2019-12-08T13:34:37Z", + "conditions": [ + { + "type": "Initialized", + "lastTransitionTime": "2019-12-08T13:34:37Z", + "lastProbeTime": null, + "status": "True" + }, + { + "type": "Ready", + "lastTransitionTime": "2019-12-08T13:34:44Z", + "lastProbeTime": null, + "status": "True" + }, + { + "type": "ContainersReady", + "lastTransitionTime": "2019-12-08T13:34:44Z", + "lastProbeTime": null, + "status": "True" + }, + { + "type": "PodScheduled", + "lastTransitionTime": "2019-12-08T13:34:37Z", + "lastProbeTime": null, + "status": "True" + } + ], + "containerStatuses": [ + { + "imageID": "docker-pullable://kubevirt/virt-launcher@sha256:eb68bf622cc5802f77d85587b414810fa7d4d7e0aeefc7ab1591b3b6efe8db3c", + "name": "compute", + "restartCount": 0, + "image": "sha256:73568f22b146ceff112103b53855fdb3ebdaea0a48988e3b0636a66fb3260a4a", + "lastState": {}, + "started": true, + "state": { + "running": { + "startedAt": "2019-12-08T13:34:38Z" + } + }, + "containerID": "docker://aa579ffde24182bb934722bfb0d3de5fbfc27a03ae91c76a32230d8e8dec7d6b", + "ready": true + }, + { + "imageID": "docker-pullable://kubevirt/cirros-registry-disk-demo@sha256:657bfaaea4720e494058da55b35b302065d384576d49fa17be32d10e8ddfe2e7", + "name": "volumecontainerdisk", + "restartCount": 0, + "image": "kubevirt/cirros-registry-disk-demo:latest", + "lastState": {}, + "started": true, + "state": { + "running": { + "startedAt": "2019-12-08T13:34:40Z" + } + }, + "containerID": "docker://67a5b13cb5ad3a3bccde84e1388103018d6abd8cbec095c19ca1057b9c87c2c2", + "ready": true + } + ], + "qosClass": "Burstable", + "hostIP": "192.168.39.242", + "phase": "Running", + "podIP": "172.17.0.11", + "podIPs": [ + { + "ip": "172.17.0.11" + } + ] + }, + "metadata": { + "creationTimestamp": "2019-12-08T13:34:37Z", + "name": "virt-launcher-testvm-4sdfc", + "generateName": "virt-launcher-testvm-", + "ownerReferences": [ + { + "apiVersion": "kubevirt.io/v1alpha3", + "name": "testvm", + "kind": "VirtualMachineInstance", + "blockOwnerDeletion": true, + "uid": "3909c8af-73b9-4797-b70d-1c06e0923101", + "controller": true + } + ], + "selfLink": "/api/v1/namespaces/default/pods/virt-launcher-testvm-4sdfc", + "uid": "633f0272-4550-4805-ac26-2d7b4d7d186a", + "labels": { + "kubevirt.io": "virt-launcher", + "kubevirt.io/size": "small", + "kubevirt.io/domain": "testvm", + "kubevirt.io/created-by": "3909c8af-73b9-4797-b70d-1c06e0923101" + }, + "resourceVersion": "276430", + "annotations": { + "kubevirt.io/domain": "testvm" + }, + "namespace": "default" + }, + "spec": { + "enableServiceLinks": true, + "terminationGracePeriodSeconds": 60, + "securityContext": { + "seLinuxOptions": { + "type": "virt_launcher.process" + }, + "runAsUser": 0 + }, + "volumes": [ + { + "emptyDir": {}, + "name": "infra-ready-mount" + }, + { + "hostPath": { + "type": "", + "path": "/var/run/kubevirt" + }, + "name": "virt-share-dir" + }, + { + "hostPath": { + "type": "", + "path": "/var/lib/kubevirt/init/usr/bin" + }, + "name": "virt-bin-share-dir" + }, + { + "emptyDir": {}, + "name": "libvirt-runtime" + }, + { + "emptyDir": {}, + "name": "ephemeral-disks" + }, + { + "hostPath": { + "type": "", + "path": "/var/run/kubevirt/container-disks/3909c8af-73b9-4797-b70d-1c06e0923101" + }, + "name": "container-disks" + } + ], + "automountServiceAccountToken": false, + "priority": 0, + "serviceAccountName": "default", + "serviceAccount": "default", + "hostname": "testvm", + "schedulerName": "default-scheduler", + "containers": [ + { + "volumeMounts": [ + { + "mountPath": "/var/run/kubevirt-ephemeral-disks", + "name": "ephemeral-disks" + }, + { + "mountPath": "/var/run/kubevirt/container-disks", + "name": "container-disks", + "mountPropagation": "HostToContainer" + }, + { + "mountPath": "/var/run/kubevirt", + "name": "virt-share-dir" + }, + { + "mountPath": "/var/run/libvirt", + "name": "libvirt-runtime" + }, + { + "mountPath": "/var/run/kubevirt-infra", + "name": "infra-ready-mount" + } + ], + "name": "compute", + "imagePullPolicy": "IfNotPresent", + "command": [ + "/usr/bin/virt-launcher", + "--qemu-timeout", + "5m", + "--name", + "testvm", + "--uid", + "3909c8af-73b9-4797-b70d-1c06e0923101", + "--namespace", + "default", + "--kubevirt-share-dir", + "/var/run/kubevirt", + "--ephemeral-disk-dir", + "/var/run/kubevirt-ephemeral-disks", + "--container-disk-dir", + "/var/run/kubevirt/container-disks", + "--readiness-file", + "/var/run/kubevirt-infra/healthy", + "--grace-period-seconds", + "45", + "--hook-sidecars", + "0", + "--less-pvc-space-toleration", + "10" + ], + "terminationMessagePath": "/dev/termination-log", + "image": "index.docker.io/kubevirt/virt-launcher@sha256:eb68bf622cc5802f77d85587b414810fa7d4d7e0aeefc7ab1591b3b6efe8db3c", + "securityContext": { + "privileged": false, + "runAsUser": 0, + "capabilities": { + "add": [ + "NET_ADMIN", + "SYS_NICE" + ] + } + }, + "terminationMessagePolicy": "File", + "resources": { + "limits": { + "devices.kubevirt.io/tun": "1", + "devices.kubevirt.io/vhost-net": "1", + "devices.kubevirt.io/kvm": "1" + }, + "requests": { + "devices.kubevirt.io/tun": "1", + "cpu": "100m", + "memory": "225679432", + "devices.kubevirt.io/vhost-net": "1", + "devices.kubevirt.io/kvm": "1" + } + }, + "readinessProbe": { + "timeoutSeconds": 5, + "failureThreshold": 5, + "successThreshold": 1, + "initialDelaySeconds": 4, + "exec": { + "command": [ + "cat", + "/var/run/kubevirt-infra/healthy" + ] + }, + "periodSeconds": 1 + } + }, + { + "volumeMounts": [ + { + "mountPath": "/var/run/kubevirt-ephemeral-disks/container-disk-data/3909c8af-73b9-4797-b70d-1c06e0923101", + "name": "container-disks" + }, + { + "mountPath": "/usr/bin", + "name": "virt-bin-share-dir" + } + ], + "name": "volumecontainerdisk", + "imagePullPolicy": "Always", + "command": [ + "/usr/bin/container-disk" + ], + "args": [ + "--copy-path", + "/var/run/kubevirt-ephemeral-disks/container-disk-data/3909c8af-73b9-4797-b70d-1c06e0923101/disk_0" + ], + "terminationMessagePath": "/dev/termination-log", + "image": "kubevirt/cirros-registry-disk-demo", + "terminationMessagePolicy": "File", + "resources": { + "limits": { + "cpu": "100m", + "memory": "40M" + }, + "requests": { + "cpu": "10m", + "memory": "1M" + } + }, + "readinessProbe": { + "timeoutSeconds": 1, + "failureThreshold": 5, + "successThreshold": 1, + "initialDelaySeconds": 1, + "exec": { + "command": [ + "/usr/bin/container-disk", + "--health-check" + ] + }, + "periodSeconds": 1 + } + } + ], + "nodeSelector": { + "kubevirt.io/schedulable": "true" + }, + "nodeName": "minikube", + "dnsPolicy": "ClusterFirst", + "tolerations": [ + { + "operator": "Exists", + "tolerationSeconds": 300, + "effect": "NoExecute", + "key": "node.kubernetes.io/not-ready" + }, + { + "operator": "Exists", + "tolerationSeconds": 300, + "effect": "NoExecute", + "key": "node.kubernetes.io/unreachable" + } + ], + "restartPolicy": "Never" + } + } + ], + "apiVersion": "v1", + "kind": "PodList", + "metadata": { + "resourceVersion": "277853", + "selfLink": "/api/v1/namespaces/default/pods" + } + } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/get_pvcs.json b/libcloud/test/compute/fixtures/kubevirt/get_pvcs.json new file mode 100644 index 0000000000..05af01fd8a --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/get_pvcs.json @@ -0,0 +1,150 @@ +{ + "kind": "PersistentVolumeClaimList", + "apiVersion": "v1", + "metadata": { + "selfLink": "/api/v1/namespaces/default/persistentvolumeclaims", + "resourceVersion": "330771690" + }, + "items": [ + { + "metadata": { + "name": "mypvc2", + "namespace": "default", + "selfLink": "/api/v1/namespaces/default/persistentvolumeclaims/mypvc2", + "uid": "cd6f5a57-02c8-4012-8461-960ce49f95dd", + "resourceVersion": "324384796", + "creationTimestamp": "2023-12-19T07:17:53Z", + "labels": { + "alerts.k8s.io/KubePersistentVolumeFillingUp": "disabled", + "app": "containerized-data-importer", + "app.kubernetes.io/component": "storage", + "app.kubernetes.io/managed-by": "cdi-controller" + }, + "annotations": { + "cdi.kubevirt.io/storage.condition.bound": "false", + "cdi.kubevirt.io/storage.condition.bound.message": "Claim Pending", + "cdi.kubevirt.io/storage.condition.bound.reason": "Claim Pending", + "cdi.kubevirt.io/storage.contentType": "", + "cdi.kubevirt.io/storage.import.endpoint": "docker://quay.io/containerdisks/ubuntu:22.04", + "cdi.kubevirt.io/storage.import.importPodName": "importer-mypvc2", + "cdi.kubevirt.io/storage.import.requiresScratch": "false", + "cdi.kubevirt.io/storage.import.source": "registry", + "cdi.kubevirt.io/storage.pod.phase": "Pending", + "cdi.kubevirt.io/storage.pod.restarts": "0", + "cdi.kubevirt.io/storage.preallocation.requested": "false", + "volume.beta.kubernetes.io/storage-provisioner": "example.com/external-nfs" + }, + "ownerReferences": [ + { + "apiVersion": "cdi.kubevirt.io/v1beta1", + "kind": "DataVolume", + "name": "mypvc2", + "uid": "66470738-e865-4f18-95b1-86c40ff6a3d2", + "controller": true, + "blockOwnerDeletion": true + } + ], + "finalizers": [ + "kubernetes.io/pvc-protection" + ], + "managedFields": [ + { + "manager": "cdi-controller", + "operation": "Update", + "apiVersion": "v1", + "time": "2023-12-19T07:17:53Z", + "fieldsType": "FieldsV1", + "fieldsV1": {"f:metadata":{"f:annotations":{".":{},"f:cdi.kubevirt.io/storage.condition.bound":{},"f:cdi.kubevirt.io/storage.condition.bound.message":{},"f:cdi.kubevirt.io/storage.condition.bound.reason":{},"f:cdi.kubevirt.io/storage.contentType":{},"f:cdi.kubevirt.io/storage.import.endpoint":{},"f:cdi.kubevirt.io/storage.import.importPodName":{},"f:cdi.kubevirt.io/storage.import.requiresScratch":{},"f:cdi.kubevirt.io/storage.import.source":{},"f:cdi.kubevirt.io/storage.pod.phase":{},"f:cdi.kubevirt.io/storage.pod.restarts":{},"f:cdi.kubevirt.io/storage.preallocation.requested":{}},"f:labels":{".":{},"f:alerts.k8s.io/KubePersistentVolumeFillingUp":{},"f:app":{},"f:app.kubernetes.io/component":{},"f:app.kubernetes.io/managed-by":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"66170738-e845-4f58-99b1-88c40ff6a3d2\"}":{".":{},"f:apiVersion":{},"f:blockOwnerDeletion":{},"f:controller":{},"f:kind":{},"f:name":{},"f:uid":{}}}},"f:spec":{"f:accessModes":{},"f:resources":{"f:requests":{".":{},"f:storage":{}}},"f:storageClassName":{},"f:volumeMode":{}},"f:status":{"f:phase":{}}} + }, + { + "manager": "kube-controller-manager", + "operation": "Update", + "apiVersion": "v1", + "time": "2023-12-19T07:18:03Z", + "fieldsType": "FieldsV1", + "fieldsV1": {"f:metadata":{"f:annotations":{"f:volume.beta.kubernetes.io/storage-provisioner":{}}}} + } + ] + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "20Gi" + } + }, + "storageClassName": "example-nfs", + "volumeMode": "Filesystem" + }, + "status": { + "phase": "Pending" + } + }, + { + "metadata": { + "name": "mypvc2-scratch", + "namespace": "default", + "selfLink": "/api/v1/namespaces/default/persistentvolumeclaims/mypvc2-scratch", + "uid": "cf849c48-a91e-4c34-9639-0591824437dc", + "resourceVersion": "324384797", + "creationTimestamp": "2023-12-19T07:17:53Z", + "labels": { + "app": "containerized-data-importer", + "app.kubernetes.io/component": "storage", + "app.kubernetes.io/managed-by": "cdi-controller" + }, + "annotations": { + "volume.beta.kubernetes.io/storage-provisioner": "example.com/external-nfs" + }, + "ownerReferences": [ + { + "apiVersion": "v1", + "kind": "Pod", + "name": "importer-mypvc2", + "uid": "572c58a2-857d-4dc8-b2f6-0eff76a5a18a", + "controller": true, + "blockOwnerDeletion": true + } + ], + "finalizers": [ + "kubernetes.io/pvc-protection" + ], + "managedFields": [ + { + "manager": "cdi-controller", + "operation": "Update", + "apiVersion": "v1", + "time": "2023-12-19T07:17:53Z", + "fieldsType": "FieldsV1", + "fieldsV1": {"f:metadata":{"f:labels":{".":{},"f:app":{},"f:app.kubernetes.io/component":{},"f:app.kubernetes.io/managed-by":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"570c58a2-858d-4dd8-b0f6-0eff76a5a38a\"}":{".":{},"f:apiVersion":{},"f:blockOwnerDeletion":{},"f:controller":{},"f:kind":{},"f:name":{},"f:uid":{}}}},"f:spec":{"f:accessModes":{},"f:resources":{"f:requests":{".":{},"f:storage":{}}},"f:storageClassName":{},"f:volumeMode":{}},"f:status":{"f:phase":{}}} + }, + { + "manager": "kube-controller-manager", + "operation": "Update", + "apiVersion": "v1", + "time": "2023-12-19T07:17:53Z", + "fieldsType": "FieldsV1", + "fieldsV1": {"f:metadata":{"f:annotations":{".":{},"f:volume.beta.kubernetes.io/storage-provisioner":{}}}} + } + ] + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "20Gi" + } + }, + "storageClassName": "example-nfs", + "volumeMode": "Filesystem" + }, + "status": { + "phase": "Pending" + } + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/get_services.json b/libcloud/test/compute/fixtures/kubevirt/get_services.json new file mode 100644 index 0000000000..ab567e4e1f --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/get_services.json @@ -0,0 +1,56 @@ +{"kind": "ServiceList", + "apiVersion": "v1", + "metadata": + {"selfLink": "/api/v1/namespaces/kubevirt/services", "resourceVersion": "34596194"}, + "items": + [{"metadata": + {"name": "kubevirt-operator-webhook", "namespace": "kubevirt", + "selfLink": "/api/v1/namespaces/kubevirt/services/kubevirt-operator-webhook", + "uid": "14b736f5-c135-4af4-b0c7-7395d1009f70", "resourceVersion": "34388137", + "creationTimestamp": "2020-07-22T15:48:27Z", + "labels": + {"app.kubernetes.io/managed-by": "kubevirt-operator", "kubevirt.io": "", "prometheus.kubevirt.io": ""}, + "annotations": + {"kubevirt.io/install-strategy-identifier": "bea570209e6ec804f964c31126509110fcdeef04", + "kubevirt.io/install-strategy-registry": "index.docker.io/kubevirt", + "kubevirt.io/install-strategy-version": "v0.31.0"}}, + "spec": {"ports": [{"name": "webhooks", "protocol": "TCP", "port": 443, "targetPort": "webhooks"}], + "selector": {"kubevirt.io": "virt-operator"}, "clusterIP": "10.111.39.5", "type": "ClusterIP", + "sessionAffinity": "None"}, + "status": {"loadBalancer": {}}}, + {"metadata": + {"name": "kubevirt-prometheus-metrics", "namespace": "kubevirt", + "selfLink": "/api/v1/namespaces/kubevirt/services/kubevirt-prometheus-metrics", + "uid": "cd5e6e0d-45c7-46b5-9545-043aabb75b4e", "resourceVersion": "34388129", + "creationTimestamp": "2020-07-22T15:48:27Z", + "labels": + {"app.kubernetes.io/managed-by": "kubevirt-operator", "kubevirt.io": "", "prometheus.kubevirt.io": ""}, + "annotations": + {"kubevirt.io/install-strategy-identifier": "bea570209e6ec804f964c31126509110fcdeef04", + "kubevirt.io/install-strategy-registry": "index.docker.io/kubevirt", + "kubevirt.io/install-strategy-version": "v0.31.0"}}, + "spec": {"ports": [{"name": "metrics", "protocol": "TCP", "port": 443, "targetPort": "metrics"}], + "selector": {"prometheus.kubevirt.io": ""}, "clusterIP": "10.96.229.208", "type": "ClusterIP", + "sessionAffinity": "None"}, "status": {"loadBalancer": {}}}, + {"metadata": + {"name": "service-nodeport-testv", "namespace": "kubevirt", + "selfLink": "/api/v1/namespaces/kubevirt/services/service-nodeport-testv", + "uid": "ae733a33-9c18-46b7-9042-b49fcf453594", "resourceVersion": "34405970", + "creationTimestamp": "2020-07-22T17:03:50Z", + "labels": + {"service": "kubevirt.io"}}, + "spec": {"ports": [{"name": "port-11222", "protocol": "TCP", "port": 11222, "targetPort": 10000, "nodePort": 32531}], + "selector": {"kubevirt.io/vm": "testv"}, "clusterIP": "10.102.54.176", "type": "NodePort", + "sessionAffinity": "None", "externalTrafficPolicy": "Cluster"}, "status": {"loadBalancer": {}}}, + {"metadata": + {"name": "virt-api", "namespace": "kubevirt", "selfLink": "/api/v1/namespaces/kubevirt/services/virt-api", + "uid": "8785768d-8bcb-41f4-8e7d-0255185116ce", "resourceVersion": "34388132", + "creationTimestamp": "2020-07-22T15:48:27Z", + "labels": + {"app.kubernetes.io/managed-by": "kubevirt-operator", "kubevirt.io": "virt-api"}, + "annotations": {"kubevirt.io/install-strategy-identifier": "bea570209e6ec804f964c31126509110fcdeef04", + "kubevirt.io/install-strategy-registry": "index.docker.io/kubevirt", + "kubevirt.io/install-strategy-version": "v0.31.0"}}, + "spec": {"ports": [{"protocol": "TCP", "port": 443, "targetPort": 8443}], + "selector": {"kubevirt.io": "virt-api"}, "clusterIP": "10.106.250.243", "type": "ClusterIP", + "sessionAffinity": "None"}, "status": {"loadBalancer": {}}}]} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/get_testreqlim_vms_after_create_vm.json b/libcloud/test/compute/fixtures/kubevirt/get_testreqlim_vms_after_create_vm.json new file mode 100644 index 0000000000..971583c957 --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/get_testreqlim_vms_after_create_vm.json @@ -0,0 +1,317 @@ +{ + "items": [ + { + "spec": { + "template": { + "spec": { + "domain": { + "resources": { + "requests": { + "memory": "64M" + } + }, + "devices": { + "disks": [ + { + "name": "containerdisk", + "disk": { + "bus": "virtio" + } + }, + { + "name": "cloudinitdisk", + "disk": { + "bus": "virtio" + } + } + ], + "interfaces": [ + { + "name": "default", + "bridge": {} + } + ] + }, + "machine": { + "type": "" + } + }, + "networks": [ + { + "name": "default", + "pod": {} + } + ], + "volumes": [ + { + "name": "containerdisk", + "containerDisk": { + "image": "kubevirt/cirros-registry-disk-demo" + } + }, + { + "cloudInitNoCloud": { + "userDataBase64": "SGkuXG4=" + }, + "name": "cloudinitdisk" + } + ] + }, + "metadata": { + "creationTimestamp": null, + "labels": { + "kubevirt.io/domain": "testvm", + "kubevirt.io/size": "small" + } + } + }, + "running": true + }, + "apiVersion": "kubevirt.io/v1alpha3", + "metadata": { + "annotations": { + "kubevirt.io/latest-observed-api-version": "v1alpha3", + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"kubevirt.io/v1alpha3\",\"kind\":\"VirtualMachine\",\"metadata\":{\"annotations\":{},\"name\":\"testvm\",\"namespace\":\"default\"},\"spec\":{\"running\":false,\"template\":{\"metadata\":{\"labels\":{\"kubevirt.io/domain\":\"testvm\",\"kubevirt.io/size\":\"small\"}},\"spec\":{\"domain\":{\"devices\":{\"disks\":[{\"disk\":{\"bus\":\"virtio\"},\"name\":\"containerdisk\"},{\"disk\":{\"bus\":\"virtio\"},\"name\":\"cloudinitdisk\"}],\"interfaces\":[{\"bridge\":{},\"name\":\"default\"}]},\"resources\":{\"requests\":{\"memory\":\"64M\"}}},\"networks\":[{\"name\":\"default\",\"pod\":{}}],\"volumes\":[{\"containerDisk\":{\"image\":\"kubevirt/cirros-registry-disk-demo\"},\"name\":\"containerdisk\"},{\"cloudInitNoCloud\":{\"userDataBase64\":\"SGkuXG4=\"},\"name\":\"cloudinitdisk\"}]}}}}\n", + "kubevirt.io/storage-observed-api-version": "v1alpha3" + }, + "creationTimestamp": "2019-12-02T15:35:14Z", + "generation": 39, + "namespace": "default", + "name": "testvm", + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines/testvm", + "resourceVersion": "284863", + "uid": "74fd7665-fbd6-4565-977c-96bd21fb785a" + }, + "kind": "VirtualMachine", + "status": { + "ready": true, + "created": true + } + }, + { + "apiVersion": "kubevirt.io/v1alpha3", + "kind": "VirtualMachine", + "metadata": { + "annotations": { + "kubevirt.io/latest-observed-api-version": "v1", + "kubevirt.io/storage-observed-api-version": "v1alpha3" + }, + "creationTimestamp": "2024-06-18T08:48:27Z", + "generation": 2, + "labels": { + "kubevirt.io/vm": "vm-test-tumbleweed-07" + }, + "managedFields": [ + { + "apiVersion": "kubevirt.io/v1alpha3", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:labels": { + ".": {}, + "f:kubevirt.io/vm": {} + } + }, + "f:spec": { + ".": {}, + "f:running": {}, + "f:template": { + ".": {}, + "f:metadata": { + ".": {}, + "f:labels": { + ".": {}, + "f:kubevirt.io/vm": {} + } + }, + "f:spec": { + ".": {}, + "f:domain": { + ".": {}, + "f:devices": { + ".": {}, + "f:disks": {}, + "f:interfaces": {}, + "f:networkInterfaceMultiqueue": {} + }, + "f:machine": { + ".": {}, + "f:type": {} + }, + "f:resources": { + ".": {}, + "f:limits": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + }, + "f:requests": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + } + } + }, + "f:networks": {}, + "f:terminationGracePeriodSeconds": {}, + "f:volumes": {} + } + } + } + }, + "manager": "libcloud", + "operation": "Update", + "time": "2024-06-18T08:48:28Z" + }, + { + "apiVersion": "kubevirt.io/v1alpha3", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:kubevirt.io/latest-observed-api-version": {}, + "f:kubevirt.io/storage-observed-api-version": {} + } + }, + "f:status": { + ".": {}, + "f:conditions": {}, + "f:created": {}, + "f:printableStatus": {}, + "f:ready": {}, + "f:volumeSnapshotStatuses": {} + } + }, + "manager": "Go-http-client", + "operation": "Update", + "time": "2024-06-18T08:49:04Z" + } + ], + "name": "vm-test-tumbleweed-07", + "namespace": "testreqlim", + "resourceVersion": "543653381", + "selfLink": "/apis/kubevirt.io/v1/namespaces/testreqlim/virtualmachines/vm-test-tumbleweed-07", + "uid": "2654b6fe-f230-4d18-8d80-c5d540ce360f" + }, + "spec": { + "running": true, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "kubevirt.io/vm": "vm-test-tumbleweed-07" + } + }, + "spec": { + "domain": { + "devices": { + "disks": [ + { + "disk": { + "bus": "virtio" + }, + "name": "boot-disk-36c21c0b-e7dc-4ec6-b997-ac1f987e7cea" + }, + { + "disk": { + "bus": "virtio" + }, + "name": "auth-cloudinit-9303dc4a-2464-410a-b7ed-deba78cff2e4" + } + ], + "interfaces": [ + { + "bridge": {}, + "name": "default" + } + ], + "networkInterfaceMultiqueue": false + }, + "machine": { + "type": "q35" + }, + "resources": { + "limits": { + "cpu": "2", + "memory": "4Gi" + }, + "requests": { + "cpu": "1m", + "memory": "1Mi" + } + } + }, + "networks": [ + { + "name": "default", + "pod": {} + } + ], + "terminationGracePeriodSeconds": 0, + "volumes": [ + { + "containerDisk": { + "image": "registry.internal.com/kubevirt-vmidisks/tumbleweed:240531" + }, + "name": "boot-disk-36c21c0b-e7dc-4ec6-b997-ac1f987e7cea" + }, + { + "cloudInitNoCloud": { + "userData": "#cloud-config\nssh_authorized_keys:\n - ssh-rsa FAKEKEY foo@bar.com\n" + }, + "name": "auth-cloudinit-9303dc4a-2464-410a-b7ed-deba78cff2e4" + } + ] + } + } + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2024-06-18T08:34:48Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": null, + "message": "cannot migrate VMI which does not use masquerade to connect to the pod network", + "reason": "InterfaceNotLiveMigratable", + "status": "False", + "type": "LiveMigratable" + }, + { + "lastProbeTime": "2024-06-18T08:35:18Z", + "lastTransitionTime": null, + "status": "True", + "type": "AgentConnected" + } + ], + "created": true, + "printableStatus": "Running", + "ready": true, + "volumeSnapshotStatuses": [ + { + "enabled": false, + "name": "boot-disk-36c21c0b-e7dc-4ec6-b997-ac1f987e7cea", + "reason": "Snapshot is not supported for this volumeSource type [boot-disk-36c21c0b-e7dc-4ec6-b997-ac1f987e7cea]" + }, + { + "enabled": false, + "name": "auth-cloudinit-9303dc4a-2464-410a-b7ed-deba78cff2e4", + "reason": "Snapshot is not supported for this volumeSource type [auth-cloudinit-9303dc4a-2464-410a-b7ed-deba78cff2e4]" + } + ] + } + } + ], + "apiVersion": "kubevirt.io/v1alpha3", + "metadata": { + "continue": "", + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines", + "resourceVersion": "285618" + }, + "kind": "VirtualMachineList" +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/get_vm_test_tumbleweed_07.json b/libcloud/test/compute/fixtures/kubevirt/get_vm_test_tumbleweed_07.json new file mode 100644 index 0000000000..2f23647387 --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/get_vm_test_tumbleweed_07.json @@ -0,0 +1,218 @@ +{ + "apiVersion": "kubevirt.io/v1alpha3", + "kind": "VirtualMachine", + "metadata": { + "annotations": { + "kubevirt.io/latest-observed-api-version": "v1", + "kubevirt.io/storage-observed-api-version": "v1alpha3" + }, + "creationTimestamp": "2024-06-18T08:48:27Z", + "generation": 2, + "labels": { + "kubevirt.io/vm": "vm-test-tumbleweed-07" + }, + "managedFields": [ + { + "apiVersion": "kubevirt.io/v1alpha3", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:labels": { + ".": {}, + "f:kubevirt.io/vm": {} + } + }, + "f:spec": { + ".": {}, + "f:running": {}, + "f:template": { + ".": {}, + "f:metadata": { + ".": {}, + "f:labels": { + ".": {}, + "f:kubevirt.io/vm": {} + } + }, + "f:spec": { + ".": {}, + "f:domain": { + ".": {}, + "f:devices": { + ".": {}, + "f:disks": {}, + "f:interfaces": {}, + "f:networkInterfaceMultiqueue": {} + }, + "f:machine": { + ".": {}, + "f:type": {} + }, + "f:resources": { + ".": {}, + "f:limits": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + }, + "f:requests": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + } + } + }, + "f:networks": {}, + "f:terminationGracePeriodSeconds": {}, + "f:volumes": {} + } + } + } + }, + "manager": "libcloud", + "operation": "Update", + "time": "2024-06-18T08:48:28Z" + }, + { + "apiVersion": "kubevirt.io/v1alpha3", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:kubevirt.io/latest-observed-api-version": {}, + "f:kubevirt.io/storage-observed-api-version": {} + } + }, + "f:status": { + ".": {}, + "f:conditions": {}, + "f:created": {}, + "f:printableStatus": {}, + "f:ready": {}, + "f:volumeSnapshotStatuses": {} + } + }, + "manager": "Go-http-client", + "operation": "Update", + "time": "2024-06-18T08:49:04Z" + } + ], + "name": "vm-test-tumbleweed-07", + "namespace": "testreqlim", + "resourceVersion": "543653381", + "selfLink": "/apis/kubevirt.io/v1/namespaces/testreqlim/virtualmachines/vm-test-tumbleweed-07", + "uid": "2654b6fe-f230-4d18-8d80-c5d540ce360f" + }, + "spec": { + "running": true, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "kubevirt.io/vm": "vm-test-tumbleweed-07" + } + }, + "spec": { + "domain": { + "devices": { + "disks": [ + { + "disk": { + "bus": "virtio" + }, + "name": "boot-disk-36c21c0b-e7dc-4ec6-b997-ac1f987e7cea" + }, + { + "disk": { + "bus": "virtio" + }, + "name": "auth-cloudinit-9303dc4a-2464-410a-b7ed-deba78cff2e4" + } + ], + "interfaces": [ + { + "bridge": {}, + "name": "default" + } + ], + "networkInterfaceMultiqueue": false + }, + "machine": { + "type": "q35" + }, + "resources": { + "limits": { + "cpu": "2", + "memory": "4Gi" + }, + "requests": { + "cpu": "1m", + "memory": "1Mi" + } + } + }, + "networks": [ + { + "name": "default", + "pod": {} + } + ], + "terminationGracePeriodSeconds": 0, + "volumes": [ + { + "containerDisk": { + "image": "registry.internal.com/kubevirt-vmidisks/tumbleweed:240531" + }, + "name": "boot-disk-36c21c0b-e7dc-4ec6-b997-ac1f987e7cea" + }, + { + "cloudInitNoCloud": { + "userData": "#cloud-config\nssh_authorized_keys:\n - ssh-rsa FAKEKEY foo@bar.com\n" + }, + "name": "auth-cloudinit-9303dc4a-2464-410a-b7ed-deba78cff2e4" + } + ] + } + } + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2024-06-18T08:34:48Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": null, + "message": "cannot migrate VMI which does not use masquerade to connect to the pod network", + "reason": "InterfaceNotLiveMigratable", + "status": "False", + "type": "LiveMigratable" + }, + { + "lastProbeTime": "2024-06-18T08:35:18Z", + "lastTransitionTime": null, + "status": "True", + "type": "AgentConnected" + } + ], + "created": true, + "printableStatus": "Running", + "ready": true, + "volumeSnapshotStatuses": [ + { + "enabled": false, + "name": "boot-disk-36c21c0b-e7dc-4ec6-b997-ac1f987e7cea", + "reason": "Snapshot is not supported for this volumeSource type [boot-disk-36c21c0b-e7dc-4ec6-b997-ac1f987e7cea]" + }, + { + "enabled": false, + "name": "auth-cloudinit-9303dc4a-2464-410a-b7ed-deba78cff2e4", + "reason": "Snapshot is not supported for this volumeSource type [auth-cloudinit-9303dc4a-2464-410a-b7ed-deba78cff2e4]" + } + ] + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/start_testvm.json b/libcloud/test/compute/fixtures/kubevirt/start_testvm.json new file mode 100644 index 0000000000..e6a314a5b5 --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/start_testvm.json @@ -0,0 +1,85 @@ +{ + "status": {}, + "spec": { + "running": true, + "template": { + "spec": { + "volumes": [ + { + "containerDisk": { + "image": "kubevirt/cirros-registry-disk-demo" + }, + "name": "containerdisk" + }, + { + "name": "cloudinitdisk", + "cloudInitNoCloud": { + "userDataBase64": "SGkuXG4=" + } + } + ], + "networks": [ + { + "name": "default", + "pod": {} + } + ], + "domain": { + "machine": { + "type": "" + }, + "resources": { + "requests": { + "memory": "64M" + } + }, + "devices": { + "disks": [ + { + "disk": { + "bus": "virtio" + }, + "name": "containerdisk" + }, + { + "disk": { + "bus": "virtio" + }, + "name": "cloudinitdisk" + } + ], + "interfaces": [ + { + "name": "default", + "bridge": {} + } + ] + } + } + }, + "metadata": { + "labels": { + "kubevirt.io/domain": "testvm", + "kubevirt.io/size": "small" + }, + "creationTimestamp": null + } + } + }, + "kind": "VirtualMachine", + "metadata": { + "name": "testvm", + "resourceVersion": "253345", + "annotations": { + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"kubevirt.io/v1alpha3\",\"kind\":\"VirtualMachine\",\"metadata\":{\"annotations\":{},\"name\":\"testvm\",\"namespace\":\"default\"},\"spec\":{\"running\":false,\"template\":{\"metadata\":{\"labels\":{\"kubevirt.io/domain\":\"testvm\",\"kubevirt.io/size\":\"small\"}},\"spec\":{\"domain\":{\"devices\":{\"disks\":[{\"disk\":{\"bus\":\"virtio\"},\"name\":\"containerdisk\"},{\"disk\":{\"bus\":\"virtio\"},\"name\":\"cloudinitdisk\"}],\"interfaces\":[{\"bridge\":{},\"name\":\"default\"}]},\"resources\":{\"requests\":{\"memory\":\"64M\"}}},\"networks\":[{\"name\":\"default\",\"pod\":{}}],\"volumes\":[{\"containerDisk\":{\"image\":\"kubevirt/cirros-registry-disk-demo\"},\"name\":\"containerdisk\"},{\"cloudInitNoCloud\":{\"userDataBase64\":\"SGkuXG4=\"},\"name\":\"cloudinitdisk\"}]}}}}\n", + "kubevirt.io/storage-observed-api-version": "v1alpha3", + "kubevirt.io/latest-observed-api-version": "v1alpha3" + }, + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines/testvm", + "uid": "74fd7665-fbd6-4565-977c-96bd21fb785a", + "creationTimestamp": "2019-12-02T15:35:14Z", + "generation": 20, + "namespace": "default" + }, + "apiVersion": "kubevirt.io/v1alpha3" + } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/kubevirt/stop_testvm.json b/libcloud/test/compute/fixtures/kubevirt/stop_testvm.json new file mode 100644 index 0000000000..cf9ed0e5df --- /dev/null +++ b/libcloud/test/compute/fixtures/kubevirt/stop_testvm.json @@ -0,0 +1,88 @@ +{ + "status": { + "created": true, + "ready": true + }, + "spec": { + "running": false, + "template": { + "spec": { + "volumes": [ + { + "containerDisk": { + "image": "kubevirt/cirros-registry-disk-demo" + }, + "name": "containerdisk" + }, + { + "name": "cloudinitdisk", + "cloudInitNoCloud": { + "userDataBase64": "SGkuXG4=" + } + } + ], + "networks": [ + { + "name": "default", + "pod": {} + } + ], + "domain": { + "machine": { + "type": "" + }, + "resources": { + "requests": { + "memory": "64M" + } + }, + "devices": { + "disks": [ + { + "disk": { + "bus": "virtio" + }, + "name": "containerdisk" + }, + { + "disk": { + "bus": "virtio" + }, + "name": "cloudinitdisk" + } + ], + "interfaces": [ + { + "name": "default", + "bridge": {} + } + ] + } + } + }, + "metadata": { + "labels": { + "kubevirt.io/domain": "testvm", + "kubevirt.io/size": "small" + }, + "creationTimestamp": null + } + } + }, + "kind": "VirtualMachine", + "metadata": { + "name": "testvm", + "resourceVersion": "254958", + "annotations": { + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"kubevirt.io/v1alpha3\",\"kind\":\"VirtualMachine\",\"metadata\":{\"annotations\":{},\"name\":\"testvm\",\"namespace\":\"default\"},\"spec\":{\"running\":false,\"template\":{\"metadata\":{\"labels\":{\"kubevirt.io/domain\":\"testvm\",\"kubevirt.io/size\":\"small\"}},\"spec\":{\"domain\":{\"devices\":{\"disks\":[{\"disk\":{\"bus\":\"virtio\"},\"name\":\"containerdisk\"},{\"disk\":{\"bus\":\"virtio\"},\"name\":\"cloudinitdisk\"}],\"interfaces\":[{\"bridge\":{},\"name\":\"default\"}]},\"resources\":{\"requests\":{\"memory\":\"64M\"}}},\"networks\":[{\"name\":\"default\",\"pod\":{}}],\"volumes\":[{\"containerDisk\":{\"image\":\"kubevirt/cirros-registry-disk-demo\"},\"name\":\"containerdisk\"},{\"cloudInitNoCloud\":{\"userDataBase64\":\"SGkuXG4=\"},\"name\":\"cloudinitdisk\"}]}}}}\n", + "kubevirt.io/storage-observed-api-version": "v1alpha3", + "kubevirt.io/latest-observed-api-version": "v1alpha3" + }, + "selfLink": "/apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines/testvm", + "uid": "74fd7665-fbd6-4565-977c-96bd21fb785a", + "creationTimestamp": "2019-12-02T15:35:14Z", + "generation": 23, + "namespace": "default" + }, + "apiVersion": "kubevirt.io/v1alpha3" + } \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/linode/_avail_datacenters.json b/libcloud/test/compute/fixtures/linode/_avail_datacenters.json deleted file mode 100644 index eb169623b1..0000000000 --- a/libcloud/test/compute/fixtures/linode/_avail_datacenters.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "ERRORARRAY": [], - "DATA": [ - { - "LOCATION": "Dallas, TX, USA", - "DATACENTERID": 2, - "ABBR": "dallas" - }, - { - "LOCATION": "Fremont, CA, USA", - "DATACENTERID": 3, - "ABBR": "fremont" - }, - { - "LOCATION": "Atlanta, GA, USA", - "DATACENTERID": 4, - "ABBR": "atlanta" - }, - { - "LOCATION": "Newark, NJ, USA", - "DATACENTERID": 6, - "ABBR": "newark" - }, - { - "LOCATION": "London, England, UK", - "DATACENTERID": 7, - "ABBR": "london" - }, - { - "LOCATION": "Tokyo, JP", - "DATACENTERID": 8, - "ABBR": "tokyo" - } - ], - "ACTION": "avail.datacenters" -} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/linode/_avail_distributions.json b/libcloud/test/compute/fixtures/linode/_avail_distributions.json deleted file mode 100644 index f1bdee61b9..0000000000 --- a/libcloud/test/compute/fixtures/linode/_avail_distributions.json +++ /dev/null @@ -1,246 +0,0 @@ -{ - "ERRORARRAY": [], - "DATA": [ - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 112, - "IS64BIT": 1, - "LABEL": "Arch Linux 2013.06", - "MINIMAGESIZE": 500, - "CREATE_DT": "2013-06-06 02:45:11.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 89, - "IS64BIT": 1, - "LABEL": "CentOS 6.2", - "MINIMAGESIZE": 800, - "CREATE_DT": "2011-07-19 11:38:20.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 78, - "IS64BIT": 1, - "LABEL": "Debian 6", - "MINIMAGESIZE": 550, - "CREATE_DT": "2011-02-08 16:54:31.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 109, - "IS64BIT": 1, - "LABEL": "Debian 7", - "MINIMAGESIZE": 660, - "CREATE_DT": "2013-05-08 11:31:32.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 114, - "IS64BIT": 1, - "LABEL": "Fedora 19", - "MINIMAGESIZE": 750, - "CREATE_DT": "2013-08-26 15:29:21.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 53, - "IS64BIT": 1, - "LABEL": "Gentoo", - "MINIMAGESIZE": 1000, - "CREATE_DT": "2009-04-04 00:00:00.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 115, - "IS64BIT": 1, - "LABEL": "openSUSE 12.3", - "MINIMAGESIZE": 1024, - "CREATE_DT": "2013-09-19 10:49:09.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 87, - "IS64BIT": 1, - "LABEL": "Slackware 13.37", - "MINIMAGESIZE": 600, - "CREATE_DT": "2011-06-05 15:11:59.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 65, - "IS64BIT": 1, - "LABEL": "Ubuntu 10.04 LTS", - "MINIMAGESIZE": 450, - "CREATE_DT": "2010-04-29 00:00:00.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 99, - "IS64BIT": 1, - "LABEL": "Ubuntu 12.04 LTS", - "MINIMAGESIZE": 600, - "CREATE_DT": "2012-04-26 17:25:16.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 111, - "IS64BIT": 1, - "LABEL": "Ubuntu 13.04", - "MINIMAGESIZE": 770, - "CREATE_DT": "2013-05-08 11:31:32.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 113, - "IS64BIT": 0, - "LABEL": "Arch Linux 2013.06 32bit", - "MINIMAGESIZE": 500, - "CREATE_DT": "2013-06-06 02:45:11.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 88, - "IS64BIT": 0, - "LABEL": "CentOS 6.2 32bit", - "MINIMAGESIZE": 800, - "CREATE_DT": "2011-07-19 11:38:20.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 77, - "IS64BIT": 0, - "LABEL": "Debian 6 32bit", - "MINIMAGESIZE": 550, - "CREATE_DT": "2011-02-08 16:54:31.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 108, - "IS64BIT": 0, - "LABEL": "Debian 7 32bit", - "MINIMAGESIZE": 660, - "CREATE_DT": "2013-05-08 11:31:32.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 72, - "IS64BIT": 0, - "LABEL": "Gentoo 32bit", - "MINIMAGESIZE": 1000, - "CREATE_DT": "2010-09-13 00:00:00.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 86, - "IS64BIT": 0, - "LABEL": "Slackware 13.37 32bit", - "MINIMAGESIZE": 600, - "CREATE_DT": "2011-06-05 15:11:59.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 64, - "IS64BIT": 0, - "LABEL": "Ubuntu 10.04 LTS 32bit", - "MINIMAGESIZE": 450, - "CREATE_DT": "2010-04-29 00:00:00.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 98, - "IS64BIT": 0, - "LABEL": "Ubuntu 12.04 LTS 32bit", - "MINIMAGESIZE": 600, - "CREATE_DT": "2012-04-26 17:25:16.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 110, - "IS64BIT": 0, - "LABEL": "Ubuntu 13.04 32bit", - "MINIMAGESIZE": 770, - "CREATE_DT": "2013-05-08 11:31:32.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 105, - "IS64BIT": 1, - "LABEL": "Arch Linux 2012.10", - "MINIMAGESIZE": 500, - "CREATE_DT": "2012-10-22 15:00:49.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 60, - "IS64BIT": 1, - "LABEL": "CentOS 5.6 64bit", - "MINIMAGESIZE": 950, - "CREATE_DT": "2009-08-17 00:00:00.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 100, - "IS64BIT": 1, - "LABEL": "Fedora 17", - "MINIMAGESIZE": 800, - "CREATE_DT": "2012-05-31 16:03:49.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 97, - "IS64BIT": 1, - "LABEL": "openSUSE 12.1", - "MINIMAGESIZE": 1000, - "CREATE_DT": "2012-04-13 11:43:30.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 107, - "IS64BIT": 1, - "LABEL": "Ubuntu 12.10", - "MINIMAGESIZE": 660, - "CREATE_DT": "2012-11-06 11:51:25.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 104, - "IS64BIT": 0, - "LABEL": "Arch Linux 2012.10 32bit", - "MINIMAGESIZE": 500, - "CREATE_DT": "2012-10-22 15:00:49.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 59, - "IS64BIT": 0, - "LABEL": "CentOS 5.6 32bit", - "MINIMAGESIZE": 950, - "CREATE_DT": "2009-08-17 00:00:00.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 101, - "IS64BIT": 0, - "LABEL": "Fedora 17 32bit", - "MINIMAGESIZE": 800, - "CREATE_DT": "2012-05-31 16:03:49.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 96, - "IS64BIT": 0, - "LABEL": "openSUSE 12.1 32bit", - "MINIMAGESIZE": 1000, - "CREATE_DT": "2012-04-13 11:43:30.0" - }, - { - "REQUIRESPVOPSKERNEL": 1, - "DISTRIBUTIONID": 106, - "IS64BIT": 0, - "LABEL": "Ubuntu 12.10 32bit", - "MINIMAGESIZE": 660, - "CREATE_DT": "2012-11-06 11:51:25.0" - } - ], - "ACTION": "avail.distributions" -} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/linode/_avail_kernels.json b/libcloud/test/compute/fixtures/linode/_avail_kernels.json deleted file mode 100644 index 9552c46c5f..0000000000 --- a/libcloud/test/compute/fixtures/linode/_avail_kernels.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "ERRORARRAY": [], - "ACTION": "avail.kernels", - "DATA": [ - { - "LABEL": "Latest 2.6 Stable (2.6.18.8-linode19)", - "ISXEN": 1, - "KERNELID": 60 - }, - { - "LABEL": "2.6.18.8-linode19", - "ISXEN": 1, - "KERNELID": 103 - }, - { - "LABEL": "2.6.30.5-linode20", - "ISXEN": 1, - "KERNELID": 105 - }, - { - "LABEL": "Latest 2.6 Stable (2.6.18.8-x86_64-linode7)", - "ISXEN": 1, - "KERNELID": 107 - }, - { - "LABEL": "2.6.18.8-x86_64-linode7", - "ISXEN": 1, - "KERNELID": 104 - }, - { - "LABEL": "2.6.30.5-x86_64-linode8", - "ISXEN": 1, - "KERNELID": 106 - }, - { - "LABEL": "pv-grub-x86_32", - "ISXEN": 1, - "KERNELID": 92 - }, - { - "LABEL": "pv-grub-x86_64", - "ISXEN": 1, - "KERNELID": 95 - }, - { - "LABEL": "Recovery - Finnix (kernel)", - "ISXEN": 1, - "KERNELID": 61 - }, - { - "LABEL": "2.6.18.8-domU-linode7", - "ISXEN": 1, - "KERNELID": 81 - }, - { - "LABEL": "2.6.18.8-linode10", - "ISXEN": 1, - "KERNELID": 89 - }, - { - "LABEL": "2.6.18.8-linode16", - "ISXEN": 1, - "KERNELID": 98 - }, - { - "LABEL": "2.6.24.4-linode8", - "ISXEN": 1, - "KERNELID": 84 - }, - { - "LABEL": "2.6.25-linode9", - "ISXEN": 1, - "KERNELID": 88 - }, - { - "LABEL": "2.6.25.10-linode12", - "ISXEN": 1, - "KERNELID": 90 - }, - { - "LABEL": "2.6.26-linode13", - "ISXEN": 1, - "KERNELID": 91 - }, - { - "LABEL": "2.6.27.4-linode14", - "ISXEN": 1, - "KERNELID": 93 - }, - { - "LABEL": "2.6.28-linode15", - "ISXEN": 1, - "KERNELID": 96 - }, - { - "LABEL": "2.6.28.3-linode17", - "ISXEN": 1, - "KERNELID": 99 - }, - { - "LABEL": "2.6.29-linode18", - "ISXEN": 1, - "KERNELID": 101 - }, - { - "LABEL": "2.6.16.38-x86_64-linode2", - "ISXEN": 1, - "KERNELID": 85 - }, - { - "LABEL": "2.6.18.8-x86_64-linode1", - "ISXEN": 1, - "KERNELID": 86 - }, - { - "LABEL": "2.6.27.4-x86_64-linode3", - "ISXEN": 1, - "KERNELID": 94 - }, - { - "LABEL": "2.6.28-x86_64-linode4", - "ISXEN": 1, - "KERNELID": 97 - }, - { - "LABEL": "2.6.28.3-x86_64-linode5", - "ISXEN": 1, - "KERNELID": 100 - }, - { - "LABEL": "2.6.29-x86_64-linode6", - "ISXEN": 1, - "KERNELID": 102 - }, - { - "LABEL": "3.9.3-x86-linode52", - "ISXEN": 1, - "KERNELID": 137 - }, - { - "LABEL": "3.9.3-x86_64-linode33", - "ISXEN": 1, - "KERNELID": 138 - } - ] -} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/linode/_avail_linodeplans.json b/libcloud/test/compute/fixtures/linode/_avail_linodeplans.json deleted file mode 100644 index ac2488934f..0000000000 --- a/libcloud/test/compute/fixtures/linode/_avail_linodeplans.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "ERRORARRAY": [], - "DATA": [{ - "CORES": 1, - "PRICE": 10.00, - "RAM": 1024, - "XFER": 2000, - "PLANID": 1, - "LABEL": "Linode 1024", - "AVAIL": { - "3": 500, - "2": 500, - "7": 500, - "6": 500, - "4": 500, - "8": 500 - }, - "DISK": 24, - "HOURLY": 0.0150 - }, { - "CORES": 2, - "PRICE": 20.00, - "RAM": 2048, - "XFER": 3000, - "PLANID": 2, - "LABEL": "Linode 2048", - "AVAIL": { - "3": 500, - "2": 500, - "7": 500, - "6": 500, - "4": 500, - "8": 500 - }, - "DISK": 48, - "HOURLY": 0.0300 - }, { - "CORES": 4, - "PRICE": 40.00, - "RAM": 4096, - "XFER": 4000, - "PLANID": 4, - "LABEL": "Linode 4096", - "AVAIL": { - "3": 500, - "2": 500, - "7": 500, - "6": 500, - "4": 500, - "8": 500 - }, - "DISK": 96, - "HOURLY": 0.0600 - }, { - "CORES": 6, - "PRICE": 80.00, - "RAM": 8192, - "XFER": 8000, - "PLANID": 6, - "LABEL": "Linode 8192", - "AVAIL": { - "3": 500, - "2": 500, - "7": 500, - "6": 500, - "4": 500, - "8": 500 - }, - "DISK": 192, - "HOURLY": 0.1200 - }, { - "CORES": 8, - "PRICE": 160.00, - "RAM": 16384, - "XFER": 16000, - "PLANID": 7, - "LABEL": "Linode 16384", - "AVAIL": { - "3": 500, - "2": 500, - "7": 500, - "6": 500, - "4": 500, - "8": 500 - }, - "DISK": 384, - "HOURLY": 0.2400 - }, { - "CORES": 12, - "PRICE": 320.00, - "RAM": 32768, - "XFER": 20000, - "PLANID": 8, - "LABEL": "Linode 32768", - "AVAIL": { - "3": 500, - "2": 500, - "7": 500, - "6": 500, - "4": 500, - "8": 500 - }, - "DISK": 768, - "HOURLY": 0.4800 - }, { - "CORES": 16, - "PRICE": 480.00, - "RAM": 49152, - "XFER": 20000, - "PLANID": 9, - "LABEL": "Linode 49152", - "AVAIL": { - "3": 500, - "2": 500, - "7": 500, - "6": 500, - "4": 500, - "8": 500 - }, - "DISK": 1152, - "HOURLY": 0.7200 - }, { - "CORES": 20, - "PRICE": 640.00, - "RAM": 65536, - "XFER": 20000, - "PLANID": 10, - "LABEL": "Linode 65536", - "AVAIL": { - "3": 500, - "2": 500, - "7": 500, - "6": 500, - "4": 500, - "8": 500 - }, - "DISK": 1536, - "HOURLY": 0.9600 - }, { - "CORES": 20, - "PRICE": 960.00, - "RAM": 98304, - "XFER": 20000, - "PLANID": 12, - "LABEL": "Linode 98304", - "AVAIL": { - "3": 500, - "2": 500, - "7": 500, - "6": 500, - "4": 500, - "8": 500 - }, - "DISK": 1920, - "HOURLY": 1.4400 - }], - "ACTION": "avail.linodeplans" -} diff --git a/libcloud/test/compute/fixtures/linode/_batch.json b/libcloud/test/compute/fixtures/linode/_batch.json deleted file mode 100644 index 36e28f9050..0000000000 --- a/libcloud/test/compute/fixtures/linode/_batch.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "ERRORARRAY": [], - "DATA": [ - { - "IPADDRESSID": 5384, - "RDNS_NAME": "li22-54.members.linode.com", - "LINODEID": 8098, - "ISPUBLIC": 1, - "IPADDRESS": "66.228.43.47" - }, - { - "IPADDRESSID": 5575, - "RDNS_NAME": "li22-245.members.linode.com", - "LINODEID": 8098, - "ISPUBLIC": 1, - "IPADDRESS": "75.127.96.245" - } - ], - "ACTION": "linode.ip.list" - } -] diff --git a/libcloud/test/compute/fixtures/linode/_linode_disk_list.json b/libcloud/test/compute/fixtures/linode/_linode_disk_list.json deleted file mode 100644 index 8ec05a9f1d..0000000000 --- a/libcloud/test/compute/fixtures/linode/_linode_disk_list.json +++ /dev/null @@ -1,28 +0,0 @@ -{ -"ERRORARRAY":[], -"ACTION":"linode.disk.list", -"DATA":[ - { - "UPDATE_DT":"2009-06-30 13:19:00.0", - "DISKID":55319, - "LABEL":"test label", - "TYPE":"ext3", - "LINODEID":8098, - "ISREADONLY":0, - "STATUS":1, - "CREATE_DT":"2008-04-04 10:08:06.0", - "SIZE":4096 - }, - { - "UPDATE_DT":"2009-07-18 12:53:043.0", - "DISKID":55320, - "LABEL":"256M Swap Image", - "TYPE":"swap", - "LINODEID":8098, - "ISREADONLY":0, - "STATUS":1, - "CREATE_DT":"2008-04-04 10:08:06.0", - "SIZE":256 - } - ] -} diff --git a/libcloud/test/compute/fixtures/linode/_linode_ip_list.json b/libcloud/test/compute/fixtures/linode/_linode_ip_list.json deleted file mode 100644 index 33a969ca68..0000000000 --- a/libcloud/test/compute/fixtures/linode/_linode_ip_list.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "ACTION": "linode.ip.list", - "DATA": [ - { - "IPADDRESS": "66.228.43.47", - "IPADDRESSID": 5384, - "ISPUBLIC": 1, - "LINODEID": 8098, - "RDNS_NAME": "li22-54.members.linode.com" - }, - { - "IPADDRESS": "75.127.96.245", - "IPADDRESSID": 5575, - "ISPUBLIC": 1, - "LINODEID": 8098, - "RDNS_NAME": "li22-245.members.linode.com" - } - ], - "ERRORARRAY": [] -} diff --git a/libcloud/test/compute/fixtures/linode/_linode_list.json b/libcloud/test/compute/fixtures/linode/_linode_list.json deleted file mode 100644 index 345f7cadbb..0000000000 --- a/libcloud/test/compute/fixtures/linode/_linode_list.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "ERRORARRAY": [], - "DATA": [ - { - "ALERT_CPU_ENABLED": 1, - "ALERT_BWIN_ENABLED": 1, - "ALERT_BWQUOTA_ENABLED": 1, - "BACKUPWINDOW": 0, - "ALERT_DISKIO_THRESHOLD": 1000, - "DISTRIBUTIONVENDOR": "Debian", - "WATCHDOG": 1, - "DATACENTERID": 6, - "STATUS": 1, - "ALERT_DISKIO_ENABLED": 1, - "CREATE_DT": "2012-05-04 19:31:30.0", - "TOTALHD": 49152, - "ALERT_BWQUOTA_THRESHOLD": 80, - "TOTALRAM": 2048, - "ALERT_BWIN_THRESHOLD": 5, - "LINODEID": 8098, - "ALERT_BWOUT_THRESHOLD": 5, - "ALERT_BWOUT_ENABLED": 1, - "BACKUPSENABLED": 1, - "ALERT_CPU_THRESHOLD": 90, - "PLANID": "2", - "BACKUPWEEKLYDAY": 0, - "LABEL": "api-node3", - "LPM_DISPLAYGROUP": "test", - "TOTALXFER": 3000 - } - ], - "ACTION": "linode.list" -} diff --git a/libcloud/test/compute/fixtures/linode_v4/allocate_private_address.json b/libcloud/test/compute/fixtures/linode_v4/allocate_private_address.json new file mode 100644 index 0000000000..57d692f5a9 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/allocate_private_address.json @@ -0,0 +1,11 @@ +{ + "address": "192.168.100.10", + "gateway": null, + "subnet_mask": "255.255.128.0", + "prefix": 17, + "type": "ipv4", + "public": false, + "rdns": null, + "linode_id": 22344420, + "region": "eu-west" +} diff --git a/libcloud/test/compute/fixtures/linode_v4/attach_volume_to_node.json b/libcloud/test/compute/fixtures/linode_v4/attach_volume_to_node.json new file mode 100644 index 0000000000..6bae8bc99d --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/attach_volume_to_node.json @@ -0,0 +1,15 @@ +{ + "id": 92030, + "status": "active", + "label": "Test_volume1", + "created": "2020-10-11T16:07:44", + "updated": "2020-10-11T16:07:44", + "filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_Test_volume1", + "size": 10, + "linode_id": 22344420, + "linode_label": "Test_123", + "region": "eu-west", + "tags": [ + "attached_test" + ] +} diff --git a/libcloud/test/compute/fixtures/linode_v4/clone_volume.json b/libcloud/test/compute/fixtures/linode_v4/clone_volume.json new file mode 100644 index 0000000000..3264431957 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/clone_volume.json @@ -0,0 +1,13 @@ +{ + "id": 23456, + "status": "creating", + "label": "TestingClone", + "created": "2020-10-11T16:44:07", + "updated": "2020-10-11T16:44:07", + "filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_TestingClone", + "size": 100, + "linode_id": null, + "linode_label": null, + "region": "eu-west", + "tags": [] +} diff --git a/libcloud/test/compute/fixtures/linode_v4/create_disk.json b/libcloud/test/compute/fixtures/linode_v4/create_disk.json new file mode 100644 index 0000000000..e2da298211 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/create_disk.json @@ -0,0 +1,9 @@ +{ + "id": 1234, + "status": "not ready", + "label": "TestingDisk", + "created": "2020-10-09T17:21:32", + "updated": "2020-10-09T17:21:32", + "filesystem": "ext4", + "size": 5000 +} diff --git a/libcloud/test/compute/fixtures/linode_v4/create_image.json b/libcloud/test/compute/fixtures/linode_v4/create_image.json new file mode 100644 index 0000000000..8e0465a893 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/create_image.json @@ -0,0 +1,15 @@ +{ + "id": "private/12345", + "label": "Test", + "description": "Test Image", + "created": "2020-10-11T17:27:54", + "updated": "2020-10-11T17:27:54", + "size": 25088, + "created_by": "unwebme", + "type": "manual", + "is_public": false, + "deprecated": false, + "vendor": null, + "expiry": null, + "eol": null +} diff --git a/libcloud/test/compute/fixtures/linode_v4/create_key_pair.json b/libcloud/test/compute/fixtures/linode_v4/create_key_pair.json new file mode 100644 index 0000000000..58572e4dd6 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/create_key_pair.json @@ -0,0 +1,6 @@ +{ + "created": "2018-01-01T00:01:01", + "id": 42, + "label": "My SSH Key", + "ssh_key": "ssh-rsa AAAA_valid_public_ssh_key_123456785== user@their-computer" +} diff --git a/libcloud/test/compute/fixtures/linode_v4/create_node.json b/libcloud/test/compute/fixtures/linode_v4/create_node.json new file mode 100644 index 0000000000..9a6c2edaa4 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/create_node.json @@ -0,0 +1,43 @@ +{ + "alerts": { + "cpu": 90, + "io": 10000, + "network_in": 10, + "network_out": 10, + "transfer_quota": 80 + }, + "backups": { + "enabled": true, + "last_successful": null, + "schedule": { + "day": null, + "window": null + } + }, + "created": "2020-10-09T10:21:35", + "group": "", + "hypervisor": "kvm", + "id": 45501392, + "image": "linode/centos7", + "ipv4": [ + "45.32.179.25", + "192.168.206.100" + ], + "ipv6": "2a39:7b00::f03c:92dd:f277:4ff4/64", + "label": "TestNode", + "region": "eu-west", + "specs": { + "disk": 25600, + "gpus": 0, + "memory": 1024, + "transfer": 1000, + "vcpus": 1 + }, + "status": "provisioning", + "tags": [ + "testing123" + ], + "type": "g6-nanode-1", + "updated": "2020-10-09T10:21:37", + "watchdog_enabled": true +} diff --git a/libcloud/test/compute/fixtures/linode_v4/create_node_no_image.json b/libcloud/test/compute/fixtures/linode_v4/create_node_no_image.json new file mode 100644 index 0000000000..974d11ab1b --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/create_node_no_image.json @@ -0,0 +1,42 @@ +{ + "alerts": { + "cpu": 90, + "io": 10000, + "network_in": 10, + "network_out": 10, + "transfer_quota": 80 + }, + "backups": { + "enabled": false, + "last_successful": null, + "schedule": { + "day": null, + "window": null + } + }, + "created": "2020-10-09T10:43:51", + "group": "", + "hypervisor": "kvm", + "id": 33431975, + "image": null, + "ipv4": [ + "45.32.179.25" + ], + "ipv6": "2d01:7ec0::fa3c:92ff:fe77:be77/64", + "label": "TestNode", + "region": "eu-west", + "specs": { + "disk": 25600, + "gpus": 0, + "memory": 1024, + "transfer": 1000, + "vcpus": 1 + }, + "status": "provisioning", + "tags": [ + "testing123" + ], + "type": "g6-nanode-1", + "updated": "2020-10-09T10:43:51", + "watchdog_enabled": true +} diff --git a/libcloud/test/compute/fixtures/linode_v4/create_volume.json b/libcloud/test/compute/fixtures/linode_v4/create_volume.json new file mode 100644 index 0000000000..b564e28baa --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/create_volume.json @@ -0,0 +1,16 @@ +{ + "id": 1234, + "status": "creating", + "label": "Volume1", + "created": "2020-10-09T18:35:50", + "updated": "2020-10-09T18:35:50", + "filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_Volume1", + "size": 50, + "linode_id": 22344420, + "linode_label": "new_name", + "region": "eu-west", + "tags": [ + "test123", + "testing" + ] +} diff --git a/libcloud/test/compute/fixtures/linode_v4/create_volume_unattached.json b/libcloud/test/compute/fixtures/linode_v4/create_volume_unattached.json new file mode 100644 index 0000000000..9bbd19131f --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/create_volume_unattached.json @@ -0,0 +1,16 @@ +{ + "id": 1234, + "status": "creating", + "label": "Volume1", + "created": "2020-10-09T18:26:03", + "updated": "2020-10-09T18:26:03", + "filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_Volume1", + "size": 50, + "linode_id": null, + "linode_label": null, + "region": "ap-west", + "tags": [ + "test123", + "testing" + ] +} diff --git a/libcloud/test/compute/fixtures/linode_v4/ex_get_node.json b/libcloud/test/compute/fixtures/linode_v4/ex_get_node.json new file mode 100644 index 0000000000..87e02c8fcb --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/ex_get_node.json @@ -0,0 +1,42 @@ +{ + "id": 22344420, + "label": "test_2", + "group": "", + "status": "running", + "created": "2020-12-07T14:58:19", + "updated": "2020-12-07T14:58:19", + "type": "g6-nanode-1", + "ipv4": [ + "212.71.239.24" + ], + "ipv6": "2a01:7e00::f03c:92ff:fe48:dc47/64", + "image": "linode/centos8", + "region": "eu-west", + "specs": { + "disk": 25600, + "memory": 1024, + "vcpus": 1, + "gpus": 0, + "transfer": 1000 + }, + "alerts": { + "cpu": 90, + "network_in": 10, + "network_out": 10, + "transfer_quota": 80, + "io": 10000 + }, + "backups": { + "enabled": false, + "schedule": { + "day": null, + "window": null + }, + "last_successful": null + }, + "hypervisor": "kvm", + "watchdog_enabled": true, + "tags": [ + "testing" + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/linode_v4/ex_get_volume.json b/libcloud/test/compute/fixtures/linode_v4/ex_get_volume.json new file mode 100644 index 0000000000..3ecffa6313 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/ex_get_volume.json @@ -0,0 +1,13 @@ +{ + "id": 123456, + "status": "active", + "label": "Testvolume1", + "created": "2020-12-07T15:31:38", + "updated": "2020-12-07T15:31:38", + "filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_Testvolume1", + "size": 10, + "linode_id": 456353688, + "linode_label": "new_name", + "region": "eu-west", + "tags": [] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/linode_v4/ex_rename_node.json b/libcloud/test/compute/fixtures/linode_v4/ex_rename_node.json new file mode 100644 index 0000000000..348a35e56b --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/ex_rename_node.json @@ -0,0 +1,42 @@ +{ + "id": 22344420, + "label": "new_name", + "group": "", + "status": "running", + "created": "2020-10-09T12:46:54", + "updated": "2020-10-09T12:46:54", + "type": "g6-nanode-1", + "ipv4": [ + "156.12.197.243" + ], + "ipv6": "2a01:7e00::f03c:92ff:fe77:e4bd/64", + "image": "linode/centos7", + "region": "eu-west", + "specs": { + "disk": 25600, + "memory": 1024, + "vcpus": 1, + "gpus": 0, + "transfer": 1000 + }, + "alerts": { + "cpu": 90, + "network_in": 10, + "network_out": 10, + "transfer_quota": 80, + "io": 10000 + }, + "backups": { + "enabled": false, + "schedule": { + "day": null, + "window": null + }, + "last_successful": null + }, + "hypervisor": "kvm", + "watchdog_enabled": true, + "tags": [ + "testing123" + ] +} diff --git a/libcloud/test/compute/fixtures/linode_v4/list_addresses.json b/libcloud/test/compute/fixtures/linode_v4/list_addresses.json new file mode 100644 index 0000000000..750977947f --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/list_addresses.json @@ -0,0 +1,40 @@ +{ + "page": 1, + "pages": 1, + "results": 3, + "data": [ + { + "address": "192.168.15.21", + "gateway": null, + "subnet_mask": "255.255.128.0", + "prefix": 17, + "type": "ipv4", + "public": false, + "rdns": null, + "linode_id": 123456, + "region": "eu-west" + }, + { + "address": "176.58.100.100", + "gateway": "176.58.100.1", + "subnet_mask": "255.255.255.0", + "prefix": 24, + "type": "ipv4", + "public": true, + "rdns": "rdns.linode.com", + "linode_id": 123456, + "region": "eu-west" + }, + { + "address": "1ad1:de00::f33c:92ddf:b177:ef4c", + "gateway": "fe80::1", + "subnet_mask": "ffff:ffff:ffff:ffff::", + "prefix": 64, + "type": "ipv6", + "rdns": null, + "linode_id": 123456, + "region": "eu-west", + "public": true + } + ] +} diff --git a/libcloud/test/compute/fixtures/linode_v4/list_addresses_for_node.json b/libcloud/test/compute/fixtures/linode_v4/list_addresses_for_node.json new file mode 100644 index 0000000000..c2a61d3c2d --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/list_addresses_for_node.json @@ -0,0 +1,57 @@ +{ + "ipv4": { + "public": [ + { + "address": "176.58.100.100", + "gateway": "1176.58.100.1", + "subnet_mask": "255.255.255.0", + "prefix": 24, + "type": "ipv4", + "public": true, + "rdns": "rdns.linode.com", + "linode_id": 22344420, + "region": "eu-west" + } + ], + "private": [ + { + "address": "192.168.15.21", + "gateway": null, + "subnet_mask": "255.255.128.0", + "prefix": 17, + "type": "ipv4", + "public": false, + "rdns": null, + "linode_id": 22344420, + "region": "eu-west" + } + ], + "shared": [], + "reserved": [] + }, + "ipv6": { + "slaac": { + "address": "ffff:ffff::ffff:ffff:ffff:ffff", + "gateway": "fe80::1", + "subnet_mask": "ffff:ffff:ffff:ffff::", + "prefix": 64, + "type": "ipv6", + "rdns": null, + "linode_id": 22344420, + "region": "eu-west", + "public": true + }, + "link_local": { + "address": "fffff:ffff::ffff:ffff:ffff:ffff", + "gateway": "fe80::1", + "subnet_mask": "ffff:ffff:ffff:ffff::", + "prefix": 64, + "type": "ipv6", + "rdns": null, + "linode_id": 22344420, + "region": "eu-west", + "public": false + }, + "global": [] + } +} diff --git a/libcloud/test/compute/fixtures/linode_v4/list_configs.json b/libcloud/test/compute/fixtures/linode_v4/list_configs.json new file mode 100644 index 0000000000..1d6069b806 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/list_configs.json @@ -0,0 +1,22 @@ +{ + "data": [ + { + "id": 123456, + "label": "My CentOS 7 Disk Profile", + "root_device": "/dev/sda", + "devices": { + "sda": { + "disk": 23517413, + "volume": null + }, + "sdb": { + "disk": 66517499, + "volume": null + } + } + } + ], + "page": 1, + "pages": 1, + "results": 1 +} diff --git a/libcloud/test/compute/fixtures/linode_v4/list_disks.json b/libcloud/test/compute/fixtures/linode_v4/list_disks.json new file mode 100644 index 0000000000..d8d05be08b --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/list_disks.json @@ -0,0 +1,25 @@ +{ + "data": [ + { + "id": 23517413, + "status": "ready", + "label": "CentOS 7 Disk", + "created": "2020-10-09T12:46:55", + "updated": "2020-10-09T14:17:33", + "filesystem": "ext4", + "size": 25088 + }, + { + "id": 66517499, + "status": "ready", + "label": "512 MB Swap Image", + "created": "2020-10-09T12:46:55", + "updated": "2020-10-09T14:17:40", + "filesystem": "swap", + "size": 512 + } + ], + "page": 1, + "pages": 1, + "results": 2 +} diff --git a/libcloud/test/compute/fixtures/linode_v4/list_images.json b/libcloud/test/compute/fixtures/linode_v4/list_images.json new file mode 100644 index 0000000000..a045f36c97 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/list_images.json @@ -0,0 +1,483 @@ +{ + "data": [ + { + "created": "2019-06-20T17:17:11", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2021-05-01T04:00:00", + "expiry": null, + "id": "linode/alpine3.10", + "is_public": true, + "label": "Alpine 3.10", + "size": 300, + "type": "manual", + "vendor": "Alpine" + }, + { + "created": "2019-12-23T17:05:51", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2021-11-01T04:00:00", + "expiry": null, + "id": "linode/alpine3.11", + "is_public": true, + "label": "Alpine 3.11", + "size": 300, + "type": "manual", + "vendor": "Alpine" + }, + { + "created": "2020-06-22T21:21:02", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2022-05-01T04:00:00", + "expiry": null, + "id": "linode/alpine3.12", + "is_public": true, + "label": "Alpine 3.12", + "size": 300, + "type": "manual", + "vendor": "Alpine" + }, + { + "created": "2019-02-06T21:57:45", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2020-11-01T04:00:00", + "expiry": null, + "id": "linode/alpine3.9", + "is_public": true, + "label": "Alpine 3.9", + "size": 300, + "type": "manual", + "vendor": "Alpine" + }, + { + "created": "2016-06-13T20:31:34", + "created_by": "linode", + "deprecated": false, + "description": "", + "eol": null, + "expiry": null, + "id": "linode/arch", + "is_public": true, + "label": "Arch Linux", + "size": 1900, + "type": "manual", + "vendor": "Arch" + }, + { + "created": "2014-07-08T14:07:21", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2024-06-30T04:00:00", + "expiry": null, + "id": "linode/centos7", + "is_public": true, + "label": "CentOS 7", + "size": 2000, + "type": "manual", + "vendor": "CentOS" + }, + { + "created": "2019-09-25T17:15:29", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2029-05-31T04:00:00", + "expiry": null, + "id": "linode/centos8", + "is_public": true, + "label": "CentOS 8", + "size": 2300, + "type": "manual", + "vendor": "CentOS" + }, + { + "created": "2019-07-07T12:24:54", + "created_by": "linode", + "deprecated": false, + "description": "", + "eol": "1970-01-01T05:00:00", + "expiry": null, + "id": "linode/debian10", + "is_public": true, + "label": "Debian 10", + "size": 1500, + "type": "manual", + "vendor": "Debian" + }, + { + "created": "2015-04-27T20:26:41", + "created_by": "linode", + "deprecated": false, + "description": "", + "eol": "2020-06-30T04:00:00", + "expiry": null, + "id": "linode/debian8", + "is_public": true, + "label": "Debian 8", + "size": 1300, + "type": "manual", + "vendor": "Debian" + }, + { + "created": "2017-06-16T20:02:29", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2022-01-01T05:00:00", + "expiry": null, + "id": "linode/debian9", + "is_public": true, + "label": "Debian 9", + "size": 1300, + "type": "manual", + "vendor": "Debian" + }, + { + "created": "2019-04-30T15:12:35", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2020-01-01T05:00:00", + "expiry": null, + "id": "linode/fedora30", + "is_public": true, + "label": "Fedora 30", + "size": 2300, + "type": "manual", + "vendor": "Fedora" + }, + { + "created": "2019-10-30T21:07:47", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2020-05-28T16:05:00", + "expiry": null, + "id": "linode/fedora31", + "is_public": true, + "label": "Fedora 31", + "size": 2500, + "type": "manual", + "vendor": "Fedora" + }, + { + "created": "2020-04-28T15:50:52", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2020-05-28T16:05:00", + "expiry": null, + "id": "linode/fedora32", + "is_public": true, + "label": "Fedora 32", + "size": 2600, + "type": "manual", + "vendor": "Fedora" + }, + { + "created": "2016-10-25T17:31:25", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": null, + "expiry": null, + "id": "linode/gentoo", + "is_public": true, + "label": "Gentoo", + "size": 4700, + "type": "manual", + "vendor": "Gentoo" + }, + { + "created": "2020-07-27T23:01:54", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2022-06-30T04:00:00", + "expiry": null, + "id": "linode/debian9-kube-v1.15.12", + "is_public": true, + "label": "Kubernetes 1.15.12 on Debian 9", + "size": 3000, + "type": "manual", + "vendor": "Debian" + }, + { + "created": "2020-07-27T22:59:54", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2022-06-30T04:00:00", + "expiry": null, + "id": "linode/debian9-kube-v1.16.13", + "is_public": true, + "label": "Kubernetes 1.16.13 on Debian 9", + "size": 3000, + "type": "manual", + "vendor": "Debian" + }, + { + "created": "2020-07-27T22:58:39", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2022-06-30T04:00:00", + "expiry": null, + "id": "linode/debian9-kube-v1.17.9", + "is_public": true, + "label": "Kubernetes 1.17.9 on Debian 9", + "size": 3000, + "type": "manual", + "vendor": "Debian" + }, + { + "created": "2020-09-21T14:49:17", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2022-09-30T16:00:00", + "expiry": null, + "id": "linode/debian9-kube-v1.18.8", + "is_public": true, + "label": "Kubernetes 1.18.8 on Debian 9", + "size": 3000, + "type": "manual", + "vendor": "Debian" + }, + { + "created": "2019-05-21T20:00:52", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2020-11-22T05:00:00", + "expiry": null, + "id": "linode/opensuse15.1", + "is_public": true, + "label": "openSUSE Leap 15.1", + "size": 3600, + "type": "manual", + "vendor": "openSUSE" + }, + { + "created": "2020-07-02T14:33:17", + "created_by": "linode", + "deprecated": false, + "description": null, + "eol": "2021-11-30T05:00:00", + "expiry": null, + "id": "linode/opensuse15.2", + "is_public": true, + "label": "openSUSE Leap 15.2", + "size": 1550, + "type": "manual", + "vendor": "openSUSE" + }, + { + "created": "2016-10-13T13:14:34", + "created_by": "linode", + "deprecated": false, + "description": "", + "eol": "1970-01-01T05:00:00", + "expiry": null, + "id": "linode/slackware14.2", + "is_public": true, + "label": "Slackware 14.2", + "size": 6000, + "type": "manual", + "vendor": "Slackware" + }, + { + "created": "2016-04-22T18:11:29", + "created_by": "linode", + "deprecated": false, + "description": "", + "eol": "2021-04-30T04:00:00", + "expiry": null, + "id": "linode/ubuntu16.04lts", + "is_public": true, + "label": "Ubuntu 16.04 LTS", + "size": 2600, + "type": "manual", + "vendor": "Ubuntu" + }, + { + "created": "2018-04-26T22:23:37", + "created_by": "linode", + "deprecated": false, + "description": "", + "eol": "2023-04-30T04:00:00", + "expiry": null, + "id": "linode/ubuntu18.04", + "is_public": true, + "label": "Ubuntu 18.04 LTS", + "size": 2700, + "type": "manual", + "vendor": "Ubuntu" + }, + { + "created": "2020-04-23T17:59:32", + "created_by": "linode", + "deprecated": false, + "description": "", + "eol": "2030-04-30T04:00:00", + "expiry": null, + "id": "linode/ubuntu20.04", + "is_public": true, + "label": "Ubuntu 20.04 LTS", + "size": 2900, + "type": "manual", + "vendor": "Ubuntu" + }, + { + "created": "2014-04-28T19:19:34", + "created_by": "linode", + "deprecated": true, + "description": null, + "eol": "2020-11-30T05:00:00", + "expiry": null, + "id": "linode/centos6.8", + "is_public": true, + "label": "CentOS 6.8", + "size": 1024, + "type": "manual", + "vendor": "CentOS" + }, + { + "created": "2017-06-06T20:44:00", + "created_by": "linode", + "deprecated": true, + "description": null, + "eol": "2020-05-26T04:00:00", + "expiry": null, + "id": "linode/containerlinux", + "is_public": true, + "label": "CoreOS Container Linux", + "size": 5000, + "type": "manual", + "vendor": "CoreOS" + }, + { + "created": "2017-12-14T21:06:30", + "created_by": "linode", + "deprecated": true, + "description": null, + "eol": "2019-10-23T04:00:00", + "expiry": null, + "id": "linode/fedora27", + "is_public": true, + "label": "Fedora 27", + "size": 1900, + "type": "manual", + "vendor": "Fedora" + }, + { + "created": "2018-05-01T16:06:52", + "created_by": "linode", + "deprecated": true, + "description": null, + "eol": "2019-10-23T04:00:00", + "expiry": null, + "id": "linode/fedora28", + "is_public": true, + "label": "Fedora 28", + "size": 2500, + "type": "manual", + "vendor": "Fedora" + }, + { + "created": "2018-10-30T17:00:44", + "created_by": "linode", + "deprecated": true, + "description": null, + "eol": "2019-11-30T05:00:00", + "expiry": null, + "id": "linode/fedora29", + "is_public": true, + "label": "Fedora 29", + "size": 2300, + "type": "manual", + "vendor": "Fedora" + }, + { + "created": "2018-05-24T21:27:09", + "created_by": "linode", + "deprecated": true, + "description": null, + "eol": "2019-11-30T05:00:00", + "expiry": null, + "id": "linode/opensuse15.0", + "is_public": true, + "label": "openSUSE Leap 15.0", + "size": 3400, + "type": "manual", + "vendor": "openSUSE" + }, + { + "created": "2017-07-27T18:03:05", + "created_by": "linode", + "deprecated": true, + "description": null, + "eol": "2019-10-23T04:00:00", + "expiry": null, + "id": "linode/opensuse42.3", + "is_public": true, + "label": "openSUSE Leap 42.3", + "size": 1900, + "type": "manual", + "vendor": "openSUSE" + }, + { + "created": "2013-11-25T16:11:02", + "created_by": "linode", + "deprecated": true, + "description": null, + "eol": null, + "expiry": null, + "id": "linode/slackware14.1", + "is_public": true, + "label": "Slackware 14.1", + "size": 1000, + "type": "manual", + "vendor": "Slackware" + }, + { + "created": "2014-04-17T19:42:07", + "created_by": "linode", + "deprecated": true, + "description": null, + "eol": "2019-10-23T04:00:00", + "expiry": null, + "id": "linode/ubuntu14.04lts", + "is_public": true, + "label": "Ubuntu 14.04 LTS", + "size": 1500, + "type": "manual", + "vendor": "Ubuntu" + }, + { + "created": "2019-10-18T15:33:03", + "created_by": "linode", + "deprecated": true, + "description": "", + "eol": "2020-07-31T04:00:00", + "expiry": null, + "id": "linode/ubuntu19.10", + "is_public": true, + "label": "Ubuntu 19.10", + "size": 2900, + "type": "manual", + "vendor": "Ubuntu" + } + ], + "page": 1, + "pages": 1, + "results": 34 +} diff --git a/libcloud/test/compute/fixtures/linode_v4/list_images_paginated_page_1.json b/libcloud/test/compute/fixtures/linode_v4/list_images_paginated_page_1.json new file mode 100644 index 0000000000..958ab2a691 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/list_images_paginated_page_1.json @@ -0,0 +1,357 @@ +{ + "data": [ + { + "id": "linode/alpine3.10", + "label": "Alpine 3.10", + "deprecated": false, + "size": 300, + "created": "2019-06-20T17:17:11", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Alpine", + "expiry": null, + "eol": "2021-05-01T04:00:00" + }, + { + "id": "linode/alpine3.11", + "label": "Alpine 3.11", + "deprecated": false, + "size": 300, + "created": "2019-12-23T17:05:51", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Alpine", + "expiry": null, + "eol": "2021-11-01T04:00:00" + }, + { + "id": "linode/alpine3.12", + "label": "Alpine 3.12", + "deprecated": false, + "size": 300, + "created": "2020-06-22T21:21:02", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Alpine", + "expiry": null, + "eol": "2022-05-01T04:00:00" + }, + { + "id": "linode/alpine3.9", + "label": "Alpine 3.9", + "deprecated": false, + "size": 300, + "created": "2019-02-06T21:57:45", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Alpine", + "expiry": null, + "eol": "2020-11-01T04:00:00" + }, + { + "id": "linode/arch", + "label": "Arch Linux", + "deprecated": false, + "size": 1900, + "created": "2016-06-13T20:31:34", + "description": "", + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Arch", + "expiry": null, + "eol": null + }, + { + "id": "linode/centos7", + "label": "CentOS 7", + "deprecated": false, + "size": 2000, + "created": "2014-07-08T14:07:21", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "CentOS", + "expiry": null, + "eol": "2024-06-30T04:00:00" + }, + { + "id": "linode/centos8", + "label": "CentOS 8", + "deprecated": false, + "size": 2300, + "created": "2019-09-25T17:15:29", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "CentOS", + "expiry": null, + "eol": "2029-05-31T04:00:00" + }, + { + "id": "linode/debian10", + "label": "Debian 10", + "deprecated": false, + "size": 1500, + "created": "2019-07-07T12:24:54", + "description": "", + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Debian", + "expiry": null, + "eol": "1970-01-01T05:00:00" + }, + { + "id": "linode/debian8", + "label": "Debian 8", + "deprecated": false, + "size": 1300, + "created": "2015-04-27T20:26:41", + "description": "", + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Debian", + "expiry": null, + "eol": "2020-06-30T04:00:00" + }, + { + "id": "linode/debian9", + "label": "Debian 9", + "deprecated": false, + "size": 1300, + "created": "2017-06-16T20:02:29", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Debian", + "expiry": null, + "eol": "2022-01-01T05:00:00" + }, + { + "id": "linode/fedora30", + "label": "Fedora 30", + "deprecated": false, + "size": 2300, + "created": "2019-04-30T15:12:35", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Fedora", + "expiry": null, + "eol": "2020-01-01T05:00:00" + }, + { + "id": "linode/fedora31", + "label": "Fedora 31", + "deprecated": false, + "size": 2500, + "created": "2019-10-30T21:07:47", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Fedora", + "expiry": null, + "eol": "2020-05-28T16:05:00" + }, + { + "id": "linode/fedora32", + "label": "Fedora 32", + "deprecated": false, + "size": 2600, + "created": "2020-04-28T15:50:52", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Fedora", + "expiry": null, + "eol": "2020-05-28T16:05:00" + }, + { + "id": "linode/gentoo", + "label": "Gentoo", + "deprecated": false, + "size": 4700, + "created": "2016-10-25T17:31:25", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Gentoo", + "expiry": null, + "eol": null + }, + { + "id": "linode/debian9-kube-v1.15.12", + "label": "Kubernetes 1.15.12 on Debian 9", + "deprecated": false, + "size": 3000, + "created": "2020-07-27T23:01:54", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Debian", + "expiry": null, + "eol": "2022-06-30T04:00:00" + }, + { + "id": "linode/debian9-kube-v1.16.13", + "label": "Kubernetes 1.16.13 on Debian 9", + "deprecated": false, + "size": 3000, + "created": "2020-07-27T22:59:54", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Debian", + "expiry": null, + "eol": "2022-06-30T04:00:00" + }, + { + "id": "linode/debian9-kube-v1.17.9", + "label": "Kubernetes 1.17.9 on Debian 9", + "deprecated": false, + "size": 3000, + "created": "2020-07-27T22:58:39", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Debian", + "expiry": null, + "eol": "2022-06-30T04:00:00" + }, + { + "id": "linode/debian9-kube-v1.18.8", + "label": "Kubernetes 1.18.8 on Debian 9", + "deprecated": false, + "size": 3000, + "created": "2020-09-21T14:49:17", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Debian", + "expiry": null, + "eol": "2022-09-30T16:00:00" + }, + { + "id": "linode/opensuse15.1", + "label": "openSUSE Leap 15.1", + "deprecated": false, + "size": 3600, + "created": "2019-05-21T20:00:52", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "openSUSE", + "expiry": null, + "eol": "2020-11-22T05:00:00" + }, + { + "id": "linode/opensuse15.2", + "label": "openSUSE Leap 15.2", + "deprecated": false, + "size": 1550, + "created": "2020-07-02T14:33:17", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "openSUSE", + "expiry": null, + "eol": "2021-11-30T05:00:00" + }, + { + "id": "linode/slackware14.2", + "label": "Slackware 14.2", + "deprecated": false, + "size": 6000, + "created": "2016-10-13T13:14:34", + "description": "", + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Slackware", + "expiry": null, + "eol": "1970-01-01T05:00:00" + }, + { + "id": "linode/ubuntu16.04lts", + "label": "Ubuntu 16.04 LTS", + "deprecated": false, + "size": 2600, + "created": "2016-04-22T18:11:29", + "description": "", + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Ubuntu", + "expiry": null, + "eol": "2021-04-30T04:00:00" + }, + { + "id": "linode/ubuntu18.04", + "label": "Ubuntu 18.04 LTS", + "deprecated": false, + "size": 2700, + "created": "2018-04-26T22:23:37", + "description": "", + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Ubuntu", + "expiry": null, + "eol": "2023-04-30T04:00:00" + }, + { + "id": "linode/ubuntu20.04", + "label": "Ubuntu 20.04 LTS", + "deprecated": false, + "size": 2900, + "created": "2020-04-23T17:59:32", + "description": "", + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Ubuntu", + "expiry": null, + "eol": "2030-04-30T04:00:00" + }, + { + "id": "linode/centos6.8", + "label": "CentOS 6.8", + "deprecated": true, + "size": 1024, + "created": "2014-04-28T19:19:34", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "CentOS", + "expiry": null, + "eol": "2020-11-30T05:00:00" + } + ], + "page": 1, + "pages": 2, + "results": 34 +} diff --git a/libcloud/test/compute/fixtures/linode_v4/list_images_paginated_page_2.json b/libcloud/test/compute/fixtures/linode_v4/list_images_paginated_page_2.json new file mode 100644 index 0000000000..a801cce94c --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/list_images_paginated_page_2.json @@ -0,0 +1,133 @@ +{ + "data": [ + { + "id": "linode/containerlinux", + "label": "CoreOS Container Linux", + "deprecated": true, + "size": 5000, + "created": "2017-06-06T20:44:00", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "CoreOS", + "expiry": null, + "eol": "2020-05-26T04:00:00" + }, + { + "id": "linode/fedora27", + "label": "Fedora 27", + "deprecated": true, + "size": 1900, + "created": "2017-12-14T21:06:30", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Fedora", + "expiry": null, + "eol": "2019-10-23T04:00:00" + }, + { + "id": "linode/fedora28", + "label": "Fedora 28", + "deprecated": true, + "size": 2500, + "created": "2018-05-01T16:06:52", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Fedora", + "expiry": null, + "eol": "2019-10-23T04:00:00" + }, + { + "id": "linode/fedora29", + "label": "Fedora 29", + "deprecated": true, + "size": 2300, + "created": "2018-10-30T17:00:44", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Fedora", + "expiry": null, + "eol": "2019-11-30T05:00:00" + }, + { + "id": "linode/opensuse15.0", + "label": "openSUSE Leap 15.0", + "deprecated": true, + "size": 3400, + "created": "2018-05-24T21:27:09", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "openSUSE", + "expiry": null, + "eol": "2019-11-30T05:00:00" + }, + { + "id": "linode/opensuse42.3", + "label": "openSUSE Leap 42.3", + "deprecated": true, + "size": 1900, + "created": "2017-07-27T18:03:05", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "openSUSE", + "expiry": null, + "eol": "2019-10-23T04:00:00" + }, + { + "id": "linode/slackware14.1", + "label": "Slackware 14.1", + "deprecated": true, + "size": 1000, + "created": "2013-11-25T16:11:02", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Slackware", + "expiry": null, + "eol": null + }, + { + "id": "linode/ubuntu14.04lts", + "label": "Ubuntu 14.04 LTS", + "deprecated": true, + "size": 1500, + "created": "2014-04-17T19:42:07", + "description": null, + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Ubuntu", + "expiry": null, + "eol": "2019-10-23T04:00:00" + }, + { + "id": "linode/ubuntu19.10", + "label": "Ubuntu 19.10", + "deprecated": true, + "size": 2900, + "created": "2019-10-18T15:33:03", + "description": "", + "created_by": "linode", + "type": "manual", + "is_public": true, + "vendor": "Ubuntu", + "expiry": null, + "eol": "2020-07-31T04:00:00" + } + ], + "page": 2, + "pages": 2, + "results": 34 +} diff --git a/libcloud/test/compute/fixtures/linode_v4/list_key_pairs.json b/libcloud/test/compute/fixtures/linode_v4/list_key_pairs.json new file mode 100644 index 0000000000..c476b05bd7 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/list_key_pairs.json @@ -0,0 +1,13 @@ +{ + "data": [ + { + "created": "2018-01-01T00:01:01", + "id": 42, + "label": "My SSH Key", + "ssh_key": "ssh-rsa AAAA_valid_public_ssh_key_123456785== user@their-computer" + } + ], + "page": 1, + "pages": 1, + "results": 1 +} diff --git a/libcloud/test/compute/fixtures/linode_v4/list_locations.json b/libcloud/test/compute/fixtures/linode_v4/list_locations.json new file mode 100644 index 0000000000..8ecabbbe40 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/list_locations.json @@ -0,0 +1,166 @@ +{ + "data": [ + { + "capabilities": [ + "Linodes", + "NodeBalancers", + "Block Storage", + "GPU Linodes", + "Kubernetes", + "Vlans" + ], + "country": "in", + "id": "ap-west", + "resolvers": { + "ipv4": "172.105.34.5,172.105.35.5,172.105.36.5,172.105.37.5,172.105.38.5,172.105.39.5,172.105.40.5,172.105.41.5,172.105.42.5,172.105.43.5", + "ipv6": "2400:8904::f03c:91ff:fea5:659,2400:8904::f03c:91ff:fea5:9282,2400:8904::f03c:91ff:fea5:b9b3,2400:8904::f03c:91ff:fea5:925a,2400:8904::f03c:91ff:fea5:22cb,2400:8904::f03c:91ff:fea5:227a,2400:8904::f03c:91ff:fea5:924c,2400:8904::f03c:91ff:fea5:f7e2,2400:8904::f03c:91ff:fea5:2205,2400:8904::f03c:91ff:fea5:9207" + }, + "status": "ok" + }, + { + "capabilities": [ + "Linodes", + "NodeBalancers", + "Block Storage", + "Kubernetes", + "Vlans" + ], + "country": "ca", + "id": "ca-central", + "resolvers": { + "ipv4": "172.105.0.5,172.105.3.5,172.105.4.5,172.105.5.5,172.105.6.5,172.105.7.5,172.105.8.5,172.105.9.5,172.105.10.5,172.105.11.5", + "ipv6": "2600:3c04::f03c:91ff:fea9:f63,2600:3c04::f03c:91ff:fea9:f6d,2600:3c04::f03c:91ff:fea9:f80,2600:3c04::f03c:91ff:fea9:f0f,2600:3c04::f03c:91ff:fea9:f99,2600:3c04::f03c:91ff:fea9:fbd,2600:3c04::f03c:91ff:fea9:fdd,2600:3c04::f03c:91ff:fea9:fe2,2600:3c04::f03c:91ff:fea9:f68,2600:3c04::f03c:91ff:fea9:f4a" + }, + "status": "ok" + }, + { + "capabilities": [ + "Linodes", + "NodeBalancers", + "Block Storage", + "Kubernetes", + "Cloud Firewall", + "Vlans" + ], + "country": "au", + "id": "ap-southeast", + "resolvers": { + "ipv4": "172.105.166.5,172.105.169.5,172.105.168.5,172.105.172.5,172.105.162.5,172.105.170.5,172.105.167.5,172.105.171.5,172.105.181.5,172.105.161.5", + "ipv6": "2400:8907::f03c:92ff:fe6e:ec8,2400:8907::f03c:92ff:fe6e:98e4,2400:8907::f03c:92ff:fe6e:1c58,2400:8907::f03c:92ff:fe6e:c299,2400:8907::f03c:92ff:fe6e:c210,2400:8907::f03c:92ff:fe6e:c219,2400:8907::f03c:92ff:fe6e:1c5c,2400:8907::f03c:92ff:fe6e:c24e,2400:8907::f03c:92ff:fe6e:e6b,2400:8907::f03c:92ff:fe6e:e3d" + }, + "status": "ok" + }, + { + "capabilities": [ + "Linodes", + "NodeBalancers", + "Block Storage", + "Kubernetes" + ], + "country": "us", + "id": "us-central", + "resolvers": { + "ipv4": "72.14.179.5,72.14.188.5,173.255.199.5,66.228.53.5,96.126.122.5,96.126.124.5,96.126.127.5,198.58.107.5,198.58.111.5,23.239.24.5", + "ipv6": "2600:3c00::2,2600:3c00::9,2600:3c00::7,2600:3c00::5,2600:3c00::3,2600:3c00::8,2600:3c00::6,2600:3c00::4,2600:3c00::c,2600:3c00::b" + }, + "status": "ok" + }, + { + "capabilities": [ + "Linodes", + "NodeBalancers", + "Block Storage", + "Kubernetes" + ], + "country": "us", + "id": "us-west", + "resolvers": { + "ipv4": "173.230.145.5,173.230.147.5,173.230.155.5,173.255.212.5,173.255.219.5,173.255.241.5,173.255.243.5,173.255.244.5,74.207.241.5,74.207.242.5", + "ipv6": "2600:3c01::2,2600:3c01::9,2600:3c01::5,2600:3c01::7,2600:3c01::3,2600:3c01::8,2600:3c01::4,2600:3c01::b,2600:3c01::c,2600:3c01::6" + }, + "status": "ok" + }, + { + "capabilities": [ + "Linodes", + "NodeBalancers", + "Block Storage", + "Object Storage", + "GPU Linodes", + "Kubernetes" + ], + "country": "us", + "id": "us-east", + "resolvers": { + "ipv4": "66.228.42.5,96.126.106.5,50.116.53.5,50.116.58.5,50.116.61.5,50.116.62.5,66.175.211.5,97.107.133.4,207.192.69.4,207.192.69.5", + "ipv6": "2600:3c03::7,2600:3c03::4,2600:3c03::9,2600:3c03::6,2600:3c03::3,2600:3c03::c,2600:3c03::5,2600:3c03::b,2600:3c03::2,2600:3c03::8" + }, + "status": "ok" + }, + { + "capabilities": [ + "Linodes", + "NodeBalancers", + "Block Storage", + "Kubernetes" + ], + "country": "uk", + "id": "eu-west", + "resolvers": { + "ipv4": "178.79.182.5,176.58.107.5,176.58.116.5,176.58.121.5,151.236.220.5,212.71.252.5,212.71.253.5,109.74.192.20,109.74.193.20,109.74.194.20", + "ipv6": "2a01:7e00::9,2a01:7e00::3,2a01:7e00::c,2a01:7e00::5,2a01:7e00::6,2a01:7e00::8,2a01:7e00::b,2a01:7e00::4,2a01:7e00::7,2a01:7e00::2" + }, + "status": "ok" + }, + { + "capabilities": [ + "Linodes", + "NodeBalancers", + "Block Storage", + "Object Storage", + "Kubernetes" + ], + "country": "sg", + "id": "ap-south", + "resolvers": { + "ipv4": "139.162.11.5,139.162.13.5,139.162.14.5,139.162.15.5,139.162.16.5,139.162.21.5,139.162.27.5,103.3.60.18,103.3.60.19,103.3.60.20", + "ipv6": "2400:8901::5,2400:8901::4,2400:8901::b,2400:8901::3,2400:8901::9,2400:8901::2,2400:8901::8,2400:8901::7,2400:8901::c,2400:8901::6" + }, + "status": "ok" + }, + { + "capabilities": [ + "Linodes", + "NodeBalancers", + "Block Storage", + "Object Storage", + "Kubernetes" + ], + "country": "de", + "id": "eu-central", + "resolvers": { + "ipv4": "139.162.130.5,139.162.131.5,139.162.132.5,139.162.133.5,139.162.134.5,139.162.135.5,139.162.136.5,139.162.137.5,139.162.138.5,139.162.139.5", + "ipv6": "2a01:7e01::5,2a01:7e01::9,2a01:7e01::7,2a01:7e01::c,2a01:7e01::2,2a01:7e01::4,2a01:7e01::3,2a01:7e01::6,2a01:7e01::b,2a01:7e01::8" + }, + "status": "ok" + }, + { + "capabilities": [ + "Linodes", + "NodeBalancers", + "Block Storage", + "Kubernetes" + ], + "country": "jp", + "id": "ap-northeast", + "resolvers": { + "ipv4": "139.162.66.5,139.162.67.5,139.162.68.5,139.162.69.5,139.162.70.5,139.162.71.5,139.162.72.5,139.162.73.5,139.162.74.5,139.162.75.5", + "ipv6": "2400:8902::3,2400:8902::6,2400:8902::c,2400:8902::4,2400:8902::2,2400:8902::8,2400:8902::7,2400:8902::5,2400:8902::b,2400:8902::9" + }, + "status": "ok" + } + ], + "page": 1, + "pages": 1, + "results": 10 +} diff --git a/libcloud/test/compute/fixtures/linode_v4/list_nodes.json b/libcloud/test/compute/fixtures/linode_v4/list_nodes.json new file mode 100644 index 0000000000..4505d41731 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/list_nodes.json @@ -0,0 +1,96 @@ +{ + "data": [ + { + "id": 22344420, + "label": "test_2", + "group": "", + "status": "running", + "created": "2020-10-08T18:51:29", + "updated": "2020-10-08T18:51:29", + "type": "g6-nanode-1", + "ipv4": [ + "138.89.34.81", + "192.168.1.230" + ], + "ipv6": "2a01:7e00::f03c:92ff:fe48:dc47/64", + "image": "linode/centos7", + "region": "eu-west", + "specs": { + "disk": 25600, + "memory": 1024, + "vcpus": 1, + "gpus": 0, + "transfer": 1000 + }, + "alerts": { + "cpu": 90, + "network_in": 10, + "network_out": 10, + "transfer_quota": 80, + "io": 10000 + }, + "backups": { + "enabled": false, + "schedule": { + "day": null, + "window": null + }, + "last_successful": null + }, + "hypervisor": "kvm", + "watchdog_enabled": true, + "tags": [ + "123", + "abcdefg", + "testing" + ] + }, + { + "id": 22344421, + "label": "test_1", + "group": "", + "status": "running", + "created": "2020-10-08T18:51:42", + "updated": "2020-10-08T18:51:42", + "type": "g6-nanode-1", + "ipv4": [ + "156.12.197.243" + ], + "ipv6": "2a01:7e00::f03c:92ff:fe48:dcf2/64", + "image": "linode/centos7", + "region": "eu-west", + "specs": { + "disk": 25600, + "memory": 1024, + "vcpus": 1, + "gpus": 0, + "transfer": 1000 + }, + "alerts": { + "cpu": 90, + "network_in": 10, + "network_out": 10, + "transfer_quota": 80, + "io": 10000 + }, + "backups": { + "enabled": false, + "schedule": { + "day": null, + "window": null + }, + "last_successful": null + }, + "hypervisor": "kvm", + "watchdog_enabled": true, + "tags": [ + "123", + "abcdefg", + "testing" + ] + } + ], + "page": 1, + "pages": 1, + "results": 2 +} diff --git a/libcloud/test/compute/fixtures/linode_v4/list_types.json b/libcloud/test/compute/fixtures/linode_v4/list_types.json new file mode 100644 index 0000000000..418e72c799 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/list_types.json @@ -0,0 +1,679 @@ +{ + "data": [ + { + "addons": { + "backups": { + "price": { + "hourly": 0.003, + "monthly": 2.0 + } + } + }, + "class": "nanode", + "disk": 25600, + "gpus": 0, + "id": "g6-nanode-1", + "label": "Nanode 1GB", + "memory": 1024, + "network_out": 1000, + "price": { + "hourly": 0.0075, + "monthly": 5.0 + }, + "successor": null, + "transfer": 1000, + "vcpus": 1 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.004, + "monthly": 2.5 + } + } + }, + "class": "standard", + "disk": 51200, + "gpus": 0, + "id": "g6-standard-1", + "label": "Linode 2GB", + "memory": 2048, + "network_out": 2000, + "price": { + "hourly": 0.015, + "monthly": 10.0 + }, + "successor": null, + "transfer": 2000, + "vcpus": 1 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.008, + "monthly": 5.0 + } + } + }, + "class": "standard", + "disk": 81920, + "gpus": 0, + "id": "g6-standard-2", + "label": "Linode 4GB", + "memory": 4096, + "network_out": 4000, + "price": { + "hourly": 0.03, + "monthly": 20.0 + }, + "successor": null, + "transfer": 4000, + "vcpus": 2 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.015, + "monthly": 10.0 + } + } + }, + "class": "standard", + "disk": 163840, + "gpus": 0, + "id": "g6-standard-4", + "label": "Linode 8GB", + "memory": 8192, + "network_out": 5000, + "price": { + "hourly": 0.06, + "monthly": 40.0 + }, + "successor": null, + "transfer": 5000, + "vcpus": 4 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.03, + "monthly": 20.0 + } + } + }, + "class": "standard", + "disk": 327680, + "gpus": 0, + "id": "g6-standard-6", + "label": "Linode 16GB", + "memory": 16384, + "network_out": 6000, + "price": { + "hourly": 0.12, + "monthly": 80.0 + }, + "successor": null, + "transfer": 8000, + "vcpus": 6 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.06, + "monthly": 40.0 + } + } + }, + "class": "standard", + "disk": 655360, + "gpus": 0, + "id": "g6-standard-8", + "label": "Linode 32GB", + "memory": 32768, + "network_out": 7000, + "price": { + "hourly": 0.24, + "monthly": 160.0 + }, + "successor": null, + "transfer": 16000, + "vcpus": 8 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.12, + "monthly": 80.0 + } + } + }, + "class": "standard", + "disk": 1310720, + "gpus": 0, + "id": "g6-standard-16", + "label": "Linode 64GB", + "memory": 65536, + "network_out": 9000, + "price": { + "hourly": 0.48, + "monthly": 320.0 + }, + "successor": null, + "transfer": 20000, + "vcpus": 16 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.18, + "monthly": 120.0 + } + } + }, + "class": "standard", + "disk": 1966080, + "gpus": 0, + "id": "g6-standard-20", + "label": "Linode 96GB", + "memory": 98304, + "network_out": 10000, + "price": { + "hourly": 0.72, + "monthly": 480.0 + }, + "successor": null, + "transfer": 20000, + "vcpus": 20 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.24, + "monthly": 160.0 + } + } + }, + "class": "standard", + "disk": 2621440, + "gpus": 0, + "id": "g6-standard-24", + "label": "Linode 128GB", + "memory": 131072, + "network_out": 11000, + "price": { + "hourly": 0.96, + "monthly": 640.0 + }, + "successor": null, + "transfer": 20000, + "vcpus": 24 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.36, + "monthly": 240.0 + } + } + }, + "class": "standard", + "disk": 3932160, + "gpus": 0, + "id": "g6-standard-32", + "label": "Linode 192GB", + "memory": 196608, + "network_out": 12000, + "price": { + "hourly": 1.44, + "monthly": 960.0 + }, + "successor": null, + "transfer": 20000, + "vcpus": 32 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.0075, + "monthly": 5.0 + } + } + }, + "class": "highmem", + "disk": 20480, + "gpus": 0, + "id": "g7-highmem-1", + "label": "Linode 24GB", + "memory": 24576, + "network_out": 5000, + "price": { + "hourly": 0.09, + "monthly": 60.0 + }, + "successor": null, + "transfer": 5000, + "vcpus": 2 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.015, + "monthly": 10.0 + } + } + }, + "class": "highmem", + "disk": 40960, + "gpus": 0, + "id": "g7-highmem-2", + "label": "Linode 48GB", + "memory": 49152, + "network_out": 6000, + "price": { + "hourly": 0.18, + "monthly": 120.0 + }, + "successor": null, + "transfer": 6000, + "vcpus": 2 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.03, + "monthly": 20.0 + } + } + }, + "class": "highmem", + "disk": 92160, + "gpus": 0, + "id": "g7-highmem-4", + "label": "Linode 90GB", + "memory": 92160, + "network_out": 7000, + "price": { + "hourly": 0.36, + "monthly": 240.0 + }, + "successor": null, + "transfer": 7000, + "vcpus": 4 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.06, + "monthly": 40.0 + } + } + }, + "class": "highmem", + "disk": 204800, + "gpus": 0, + "id": "g7-highmem-8", + "label": "Linode 150GB", + "memory": 153600, + "network_out": 8000, + "price": { + "hourly": 0.72, + "monthly": 480.0 + }, + "successor": null, + "transfer": 8000, + "vcpus": 8 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.12, + "monthly": 80.0 + } + } + }, + "class": "highmem", + "disk": 348160, + "gpus": 0, + "id": "g7-highmem-16", + "label": "Linode 300GB", + "memory": 307200, + "network_out": 9000, + "price": { + "hourly": 1.44, + "monthly": 960.0 + }, + "successor": null, + "transfer": 9000, + "vcpus": 16 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.008, + "monthly": 5.0 + } + } + }, + "class": "dedicated", + "disk": 81920, + "gpus": 0, + "id": "g6-dedicated-2", + "label": "Dedicated 4GB", + "memory": 4096, + "network_out": 4000, + "price": { + "hourly": 0.045, + "monthly": 30.0 + }, + "successor": null, + "transfer": 4000, + "vcpus": 2 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.015, + "monthly": 10.0 + } + } + }, + "class": "dedicated", + "disk": 163840, + "gpus": 0, + "id": "g6-dedicated-4", + "label": "Dedicated 8GB", + "memory": 8192, + "network_out": 5000, + "price": { + "hourly": 0.09, + "monthly": 60.0 + }, + "successor": null, + "transfer": 5000, + "vcpus": 4 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.03, + "monthly": 20.0 + } + } + }, + "class": "dedicated", + "disk": 327680, + "gpus": 0, + "id": "g6-dedicated-8", + "label": "Dedicated 16GB", + "memory": 16384, + "network_out": 6000, + "price": { + "hourly": 0.18, + "monthly": 120.0 + }, + "successor": null, + "transfer": 6000, + "vcpus": 8 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.06, + "monthly": 40.0 + } + } + }, + "class": "dedicated", + "disk": 655360, + "gpus": 0, + "id": "g6-dedicated-16", + "label": "Dedicated 32GB", + "memory": 32768, + "network_out": 7000, + "price": { + "hourly": 0.36, + "monthly": 240.0 + }, + "successor": null, + "transfer": 7000, + "vcpus": 16 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.12, + "monthly": 80.0 + } + } + }, + "class": "dedicated", + "disk": 1310720, + "gpus": 0, + "id": "g6-dedicated-32", + "label": "Dedicated 64GB", + "memory": 65536, + "network_out": 8000, + "price": { + "hourly": 0.72, + "monthly": 480.0 + }, + "successor": null, + "transfer": 8000, + "vcpus": 32 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.18, + "monthly": 120.0 + } + } + }, + "class": "dedicated", + "disk": 1966080, + "gpus": 0, + "id": "g6-dedicated-48", + "label": "Dedicated 96GB", + "memory": 98304, + "network_out": 9000, + "price": { + "hourly": 1.08, + "monthly": 720.0 + }, + "successor": null, + "transfer": 9000, + "vcpus": 48 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.24, + "monthly": 160.0 + } + } + }, + "class": "dedicated", + "disk": 2560000, + "gpus": 0, + "id": "g6-dedicated-50", + "label": "Dedicated 128GB", + "memory": 131072, + "network_out": 10000, + "price": { + "hourly": 1.44, + "monthly": 960.0 + }, + "successor": null, + "transfer": 10000, + "vcpus": 50 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.3, + "monthly": 200.0 + } + } + }, + "class": "dedicated", + "disk": 5120000, + "gpus": 0, + "id": "g6-dedicated-56", + "label": "Dedicated 256GB", + "memory": 262144, + "network_out": 11000, + "price": { + "hourly": 2.88, + "monthly": 1920.0 + }, + "successor": null, + "transfer": 11000, + "vcpus": 56 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.36, + "monthly": 240.0 + } + } + }, + "class": "dedicated", + "disk": 7372800, + "gpus": 0, + "id": "g6-dedicated-64", + "label": "Dedicated 512GB", + "memory": 524288, + "network_out": 12000, + "price": { + "hourly": 5.76, + "monthly": 3840.0 + }, + "successor": null, + "transfer": 12000, + "vcpus": 64 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.06, + "monthly": 40.0 + } + } + }, + "class": "gpu", + "disk": 655360, + "gpus": 1, + "id": "g1-gpu-rtx6000-1", + "label": "Dedicated 32GB + RTX6000 GPU x1", + "memory": 32768, + "network_out": 10000, + "price": { + "hourly": 1.5, + "monthly": 1000.0 + }, + "successor": null, + "transfer": 16000, + "vcpus": 8 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.12, + "monthly": 80.0 + } + } + }, + "class": "gpu", + "disk": 1310720, + "gpus": 2, + "id": "g1-gpu-rtx6000-2", + "label": "Dedicated 64GB + RTX6000 GPU x2", + "memory": 65536, + "network_out": 10000, + "price": { + "hourly": 3.0, + "monthly": 2000.0 + }, + "successor": null, + "transfer": 20000, + "vcpus": 16 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.18, + "monthly": 120.0 + } + } + }, + "class": "gpu", + "disk": 1966080, + "gpus": 3, + "id": "g1-gpu-rtx6000-3", + "label": "Dedicated 96GB + RTX6000 GPU x3", + "memory": 98304, + "network_out": 10000, + "price": { + "hourly": 4.5, + "monthly": 3000.0 + }, + "successor": null, + "transfer": 20000, + "vcpus": 20 + }, + { + "addons": { + "backups": { + "price": { + "hourly": 0.24, + "monthly": 160.0 + } + } + }, + "class": "gpu", + "disk": 2621440, + "gpus": 4, + "id": "g1-gpu-rtx6000-4", + "label": "Dedicated 128GB + RTX6000 GPU x4", + "memory": 131072, + "network_out": 10000, + "price": { + "hourly": 6.0, + "monthly": 4000.0 + }, + "successor": null, + "transfer": 20000, + "vcpus": 24 + } + ], + "page": 1, + "pages": 1, + "results": 28 +} diff --git a/libcloud/test/compute/fixtures/linode_v4/list_volumes.json b/libcloud/test/compute/fixtures/linode_v4/list_volumes.json new file mode 100644 index 0000000000..9d5f970e00 --- /dev/null +++ b/libcloud/test/compute/fixtures/linode_v4/list_volumes.json @@ -0,0 +1,37 @@ +{ + "data": [ + { + "id": 12345, + "status": "active", + "label": "Testvolume1", + "created": "2020-10-09T17:58:44", + "updated": "2020-10-09T17:58:44", + "filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_Testvolume1", + "size": 100, + "linode_id": 456353688, + "linode_label": "new_name", + "region": "eu-west", + "tags": [ + "attached_test" + ] + }, + { + "id": 123456, + "status": "active", + "label": "Test_unattached_volume", + "created": "2020-10-09T17:58:45", + "updated": "2020-10-09T17:58:45", + "filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_Test_unattached_volume", + "size": 100, + "linode_id": null, + "linode_label": null, + "region": "eu-west", + "tags": [ + "unattached_test" + ] + } + ], + "page": 1, + "pages": 1, + "results": 2 +} diff --git a/libcloud/test/compute/fixtures/maxihost/images.json b/libcloud/test/compute/fixtures/maxihost/images.json new file mode 100644 index 0000000000..37232bbbd1 --- /dev/null +++ b/libcloud/test/compute/fixtures/maxihost/images.json @@ -0,0 +1,14 @@ +{ + "operating-systems": [{ + "id": 297, + "slug": "ubuntu_18_04_x64_lts", + "operating_system": "Linux", + "distro": "Ubuntu", + "name": "Ubuntu (18.04 x64 LTS)", + "version": "18.04 x64 LTS", + "pricing": { + "brl_month": 0, + "usd_month": 0 + } + }] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/maxihost/keys.json b/libcloud/test/compute/fixtures/maxihost/keys.json new file mode 100644 index 0000000000..804210535a --- /dev/null +++ b/libcloud/test/compute/fixtures/maxihost/keys.json @@ -0,0 +1,17 @@ +{ + "ssh_keys": [{ + "id": 68, + "fingerprint": "77:08:a7:a5:f9:8c:e1:ab:7b:c3:d8:0c:cd:ac:8b:dd", + "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDllWt8eNqRWZeEVMXLOJsjs3rMmqwBbvEqTkpklPPMycMxYlTSOwrhQ47d1Fknt+/9PWEAYWB9YigP/HMv7wJfMgAaa9cmDivBFX31NIZYBjmgGXSqnpLsHeLGf7htAhGVu7hE+WYz+J04LnMKYLEv23DVqGaG1R6buKGJEbHVGlvJJ6SO0omTvB6r5xhRO8jgXq53Ubzvq2e8at73Htf/9c8lg6iC/iDTgZ8cGPUUj2b8YoUWY0g0rp3ljbngnjbUErF2LnlexiOrjWNLeVxLc9glkW1AkR06LgQmuouqEdmT98vPVZE8QMrdK5WZJkpxQzja3tMh3t7b1eAY6FaH", + "name": "test_key" + }], + "links": { + "self": "https://api.maxihost.com/account/keys?limit=1&page=1" + }, + "meta": { + "pages": { + "total": 1, + "count": 1 + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/maxihost/node.json b/libcloud/test/compute/fixtures/maxihost/node.json new file mode 100644 index 0000000000..bc6a634a14 --- /dev/null +++ b/libcloud/test/compute/fixtures/maxihost/node.json @@ -0,0 +1,46 @@ +{ + "id": 1419, + "description": "tester", + "type": "Bare Metal", + "type_id": 1, + "label": "1826823414", + "service_id": 6230, + "power_status": null, + "specs": { + "cpu": "Dual Intel Xeon E5-2680v3", + "disk": "2 x 1TB SSD", + "ram": "128GB" + }, + "location": { + "facility_name": "Equinix CH3", + "facility_code": "CH3", + "row_name": "314550", + "rack_name": "Default Rack", + "rack_position": "27" + }, + "operating_system": { + "name": "Ubuntu (18.04 x64 LTS)", + "slug": "ubuntu_18_04_x64_lts" + }, + "ips": [{ + "id": 9043, + "ip_address": "10.223.156.11", + "ip_description": "Private IPMI", + "device_id": 1379, + "device_hostname": "tester", + "device_label": "1826825814", + "service_id": 0, + "created_at": 1557343637, + "updated_at": 1557343666 + }, { + "id": 9042, + "ip_address": "185.233.186.01", + "ip_description": "Public IPv4", + "device_id": 1379, + "device_hostname": "tester", + "device_label": "1826825814", + "service_id": 0, + "created_at": 1557343657, + "updated_at": 1557343657 + }] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/maxihost/nodes.json b/libcloud/test/compute/fixtures/maxihost/nodes.json new file mode 100644 index 0000000000..cc85ecabc0 --- /dev/null +++ b/libcloud/test/compute/fixtures/maxihost/nodes.json @@ -0,0 +1,57 @@ +{ + "devices": [{ + "id": 1319, + "description": "tester", + "type": "Bare Metal", + "type_id": 1, + "label": "1826823414", + "service_id": 6230, + "power_status": null, + "specs": { + "cpu": "Dual Intel Xeon E5-2680v3", + "disk": "2 x 1TB SSD", + "ram": "128GB" + }, + "location": { + "facility_name": "Equinix CH3", + "facility_code": "CH3", + "row_name": "314550", + "rack_name": "Default Rack", + "rack_position": "27" + }, + "operating_system": { + "name": "Ubuntu (18.04 x64 LTS)", + "slug": "ubuntu_18_04_x64_lts" + }, + "ips": [{ + "id": 9043, + "ip_address": "10.223.186.11", + "ip_description": "Private IPMI", + "device_id": 1379, + "device_hostname": "tester", + "device_label": "1826825814", + "service_id": 0, + "created_at": 1557343657, + "updated_at": 1557343666 + }, { + "id": 9042, + "ip_address": "185.233.186.11", + "ip_description": "Public IPv4", + "device_id": 1379, + "device_hostname": "tester", + "device_label": "1826825814", + "service_id": 0, + "created_at": 1557343657, + "updated_at": 1557343657 + }] + }], + "links": { + "self": "https://api.maxihost.com/devices?limit=1&page=1" + }, + "meta": { + "pages": { + "total": 1, + "count": 1 + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/maxihost/plans.json b/libcloud/test/compute/fixtures/maxihost/plans.json new file mode 100644 index 0000000000..9fda3aec1b --- /dev/null +++ b/libcloud/test/compute/fixtures/maxihost/plans.json @@ -0,0 +1,36 @@ +{ + "servers": [{ + "id": 770, + "slug": "spot_770", + "name": "Spot", + "line": "baremetal", + "deploy_type": "automated", + "specs": { + "cpus": { + "count": 2, + "type": "Intel Xeon E5-2640v3", + "cores": "N/A", + "clock": "N/A" + }, + "memory": { + "total": "64GB" + }, + "drives": [{ + "count": 2, + "size": "500GB", + "type": "SSD" + }] + }, + "regions": [{ + "name": "Maxihost SP 1", + "code": "MH1", + "city": "Sao Paulo", + "country": "Brazil", + "in_stock": true + }], + "pricing": { + "brl_month": 1200, + "usd_month": 300 + } + }] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/maxihost/regions.json b/libcloud/test/compute/fixtures/maxihost/regions.json new file mode 100644 index 0000000000..9ee810dab9 --- /dev/null +++ b/libcloud/test/compute/fixtures/maxihost/regions.json @@ -0,0 +1,39 @@ +{ + "regions": [{ + "slug": "CH3", + "name": "Equinix CH3", + "location": { + "city": "Chicago", + "country": "US" + }, + "available": 1, + "features": ["bare_metal", "firewall", "ddos_protection"] + }, { + "slug": "MI1", + "name": "Equinix MI1", + "location": { + "city": "Miami", + "country": "US" + }, + "available": 1, + "features": ["bare_metal", "firewall", "ddos_protection"] + }, { + "slug": "MH1", + "name": "Maxihost MH1", + "location": { + "city": "Sao Paulo", + "country": "BR" + }, + "available": 1, + "features": ["bare_metal", "firewall", "ddos_protection"] + }], + "links": { + "self": "https://api.maxihost.com/regions?limit=3&page=1" + }, + "meta": { + "pages": { + "total": 1, + "count": 3 + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/meta/unicode.json b/libcloud/test/compute/fixtures/meta/unicode.json new file mode 100644 index 0000000000..85ed265310 --- /dev/null +++ b/libcloud/test/compute/fixtures/meta/unicode.json @@ -0,0 +1 @@ +{"test": "Ś"} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/meta/unicode.txt b/libcloud/test/compute/fixtures/meta/unicode.txt new file mode 100644 index 0000000000..9c3362a961 --- /dev/null +++ b/libcloud/test/compute/fixtures/meta/unicode.txt @@ -0,0 +1 @@ +Ś \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/meta/unicode.xml b/libcloud/test/compute/fixtures/meta/unicode.xml new file mode 100644 index 0000000000..0727063492 --- /dev/null +++ b/libcloud/test/compute/fixtures/meta/unicode.xml @@ -0,0 +1,2 @@ + +Ś \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/misc/test_dsa.key b/libcloud/test/compute/fixtures/misc/test_dsa.key new file mode 100644 index 0000000000..e10807f12f --- /dev/null +++ b/libcloud/test/compute/fixtures/misc/test_dsa.key @@ -0,0 +1,12 @@ +-----BEGIN DSA PRIVATE KEY----- +MIIBuwIBAAKBgQDngaYDZ30c6/7cJgEEbtl8FgKdwhba1Z7oOrOn4MI/6C42G1bY +wMuqZf4dBCglsdq39SHrcjbE8Vq54gPSOh3g4+uV9Rcg5IOoPLbwp2jQfF6f1FIb +sx7hrDCIqUcQccPSxetPBKmXI9RN8rZLaFuQeTnI65BKM98Ruwvq6SI2LwIVAPDP +hSeawaJI27mKqOfe5PPBSmyHAoGBAJMXxXmPD9sGaQ419DIpmZecJKBUAy9uXD8x +gbgeDpwfDaFJP8owByCKREocPFfi86LjCuQkyUKOfjYMN6iHIf1oEZjB8uJAatUr +FzI0ArXtUqOhwTLwTyFuUojE5own2WYsOAGByvgfyWjsGhvckYNhI4ODpNdPlxQ8 +ZamaPGPsAoGARmR7CCPjodxASvRbIyzaVpZoJ/Z6x7dAumV+ysrV1BVYd0lYukmn +jO1kKBWApqpH1ve9XDQYN8zgxM4b16L21kpoWQnZtXrY3GZ4/it9kUgyB7+NwacI +BlXa8cMDL7Q/69o0d54U0X/NeX5QxuYR6OMJlrkQB7oiW/P/1mwjQgECFGI9QPSc +h9pT9XHqn+1rZ4bK+QGA +-----END DSA PRIVATE KEY----- diff --git a/libcloud/test/compute/fixtures/misc/test_dsa_non_paramiko_recognized_header.key b/libcloud/test/compute/fixtures/misc/test_dsa_non_paramiko_recognized_header.key new file mode 100644 index 0000000000..c04c317e13 --- /dev/null +++ b/libcloud/test/compute/fixtures/misc/test_dsa_non_paramiko_recognized_header.key @@ -0,0 +1,12 @@ +-----BEGIN PRIVATE KEY----- +MIIBuwIBAAKBgQDngaYDZ30c6/7cJgEEbtl8FgKdwhba1Z7oOrOn4MI/6C42G1bY +wMuqZf4dBCglsdq39SHrcjbE8Vq54gPSOh3g4+uV9Rcg5IOoPLbwp2jQfF6f1FIb +sx7hrDCIqUcQccPSxetPBKmXI9RN8rZLaFuQeTnI65BKM98Ruwvq6SI2LwIVAPDP +hSeawaJI27mKqOfe5PPBSmyHAoGBAJMXxXmPD9sGaQ419DIpmZecJKBUAy9uXD8x +gbgeDpwfDaFJP8owByCKREocPFfi86LjCuQkyUKOfjYMN6iHIf1oEZjB8uJAatUr +FzI0ArXtUqOhwTLwTyFuUojE5own2WYsOAGByvgfyWjsGhvckYNhI4ODpNdPlxQ8 +ZamaPGPsAoGARmR7CCPjodxASvRbIyzaVpZoJ/Z6x7dAumV+ysrV1BVYd0lYukmn +jO1kKBWApqpH1ve9XDQYN8zgxM4b16L21kpoWQnZtXrY3GZ4/it9kUgyB7+NwacI +BlXa8cMDL7Q/69o0d54U0X/NeX5QxuYR6OMJlrkQB7oiW/P/1mwjQgECFGI9QPSc +h9pT9XHqn+1rZ4bK+QGA +-----END PRIVATE KEY----- diff --git a/libcloud/test/compute/fixtures/misc/test_ecdsa.key b/libcloud/test/compute/fixtures/misc/test_ecdsa.key new file mode 100644 index 0000000000..42d447340d --- /dev/null +++ b/libcloud/test/compute/fixtures/misc/test_ecdsa.key @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIKB6ty3yVyKEnfF/zprx0qwC76MsMlHY4HXCnqho2eKioAoGCCqGSM49 +AwEHoUQDQgAElI9mbdlaS+T9nHxY/59lFnn80EEecZDBHq4gLpccY8Mge5ZTMiMD +ADRvOqQ5R98Sxst765CAqXmRtz8vwoD96g== +-----END EC PRIVATE KEY----- diff --git a/libcloud/test/compute/fixtures/misc/test_ecdsa_non_paramiko_recognized_header.key b/libcloud/test/compute/fixtures/misc/test_ecdsa_non_paramiko_recognized_header.key new file mode 100644 index 0000000000..539aff6ca0 --- /dev/null +++ b/libcloud/test/compute/fixtures/misc/test_ecdsa_non_paramiko_recognized_header.key @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MHcCAQEEIKB6ty3yVyKEnfF/zprx0qwC76MsMlHY4HXCnqho2eKioAoGCCqGSM49 +AwEHoUQDQgAElI9mbdlaS+T9nHxY/59lFnn80EEecZDBHq4gLpccY8Mge5ZTMiMD +ADRvOqQ5R98Sxst765CAqXmRtz8vwoD96g== +-----END PRIVATE KEY----- diff --git a/libcloud/test/compute/fixtures/misc/test_ed25519.key b/libcloud/test/compute/fixtures/misc/test_ed25519.key new file mode 100644 index 0000000000..1755665f4b --- /dev/null +++ b/libcloud/test/compute/fixtures/misc/test_ed25519.key @@ -0,0 +1,7 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW +QyNTUxOQAAACBtOQwT+zCBuv1bdnloqU7eLXxPc43ELqdEZ0Lw0YVhXAAAAJgwUx9VMFMf +VQAAAAtzc2gtZWQyNTUxOQAAACBtOQwT+zCBuv1bdnloqU7eLXxPc43ELqdEZ0Lw0YVhXA +AAAEC2csRa7XD1MhNyYRrnqP9wPWm5UodVAJAjhknvE0vQIG05DBP7MIG6/Vt2eWipTt4t +fE9zjcQup0RnQvDRhWFcAAAAEWthbWlAa2FtaS1kZXNrdG9wAQIDBA== +-----END OPENSSH PRIVATE KEY----- diff --git a/libcloud/test/compute/fixtures/misc/test_ed25519.pub b/libcloud/test/compute/fixtures/misc/test_ed25519.pub new file mode 100644 index 0000000000..6304f1e7bd --- /dev/null +++ b/libcloud/test/compute/fixtures/misc/test_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG05DBP7MIG6/Vt2eWipTt4tfE9zjcQup0RnQvDRhWFc kami@kami-desktop diff --git a/libcloud/test/compute/fixtures/misc/dummy_rsa b/libcloud/test/compute/fixtures/misc/test_rsa.key similarity index 100% rename from libcloud/test/compute/fixtures/misc/dummy_rsa rename to libcloud/test/compute/fixtures/misc/test_rsa.key diff --git a/libcloud/test/compute/fixtures/misc/dummy_rsa.pub b/libcloud/test/compute/fixtures/misc/test_rsa.pub similarity index 100% rename from libcloud/test/compute/fixtures/misc/dummy_rsa.pub rename to libcloud/test/compute/fixtures/misc/test_rsa.pub diff --git a/libcloud/test/compute/fixtures/misc/test_rsa_2048b_pass_foobar.key b/libcloud/test/compute/fixtures/misc/test_rsa_2048b_pass_foobar.key new file mode 100644 index 0000000000..72e2785796 --- /dev/null +++ b/libcloud/test/compute/fixtures/misc/test_rsa_2048b_pass_foobar.key @@ -0,0 +1,39 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABB8vQSsS2 +c2ykD4sxPb3LakAAAAEAAAAAEAAAGXAAAAB3NzaC1yc2EAAAADAQABAAABgQDSteUVWXmU +HZV1OBJwhHKft722mNLBjLhARvblwyAhbA5oqSsd7lKiTMNbmln4VwBRJ73tJC55P1KL5U +rspvGkM1+6jd1QQvtFtxNNX4We7zxUbCuEfQo6wcDjxaYGxrVrc6MzAHT0DzCjOWz9XZAt +MqXhaV11hMzsg8IABWsjI9r9RU//6VOiaVbn/6lP9zPii6S/kbuoTbkXD7RBBFxdWfLIe5 +pL2Ov2oKEncW9VrBHANYObrmiPdSJxUpTM6w34UAK6BRHZO2EmzebVDdwXLrY7PpZIZUOM +E7IFtjDKOcQkOg0JEKPLGIJyZPr9iOVbDJiRfpqLRweG+Zu+9NzCOEmGq3CZpkZzCMr2yE +SV2o620+cbdK16ZhbJfwyQZi155geNE+swZQmtpcDhm2V++LwSwXZxjFZYvRwM6XVMKifo +6bRG3BAN0rPJ5GXqJA7LptRMtXHkhhXDrRJK3fg8/I07eLYaGc7Uic97XT9+oqIbXrx27Z +Q5N1PzKeQw7ycAAAWQ80tzeb+gpElRH1YutEbcJQ1D9PXyeVKyWX6PWpyebDL8EXTpIqyu +c3cJDXo+Q2LoE7yCNqcAdEpsu0UU1679g1Z3hvrKXNYm0tCYl8bYsytk/H0ld+kiK4vtlJ +TBuKPK/jdQWrNrg5dPBVUYhh2HWuhIwY4JhUHO/vyv4dvC9gs4mPeogf7vJYUrpxMrDf6n +frilRwPFHWnIxnJ48+ZtdShXK/qiSTaknKOkIqBru7WAfAE37JCRTcO7pmotPvz+0mdcYJ +EKh4batcWHhaXbMJR9S0kt1k1FVfg/Tu8NwWo+3bdalFx004erDyb9hO69GVbV/+KrGvKT +bZ8OSwSRbLXd/LcPrZZFyxuoUak3kZ2cXQs5sZUz9D05EW0qS927lZWk24N1uu+mdvsQNV +kaGlSzXFYlj/qGHNFwbO7w68KAom6gbp72ZHW/XYzCZGZn7zKQXT8/qcAkToxAmaB0mkf2 +/1H9omw/b2UNjyGGHFaqvzM7YfkUzAjBu5LD7ZKxH/Hi4Cacihw2KoljSlp3TGns5n4zY/ +HpME0EVUX6Ys8jOTqFoYWbsyq7tKCYhEmRjuy1j+EfPQT8Vqxy0I/FSAXydix8ASZL+lDV +bR3tB3g+cT+GhK3sG/Xhk2QkXoGkuFpMXYAUMoV6aEUyNkLTl5t1JxWPrpgxcHoF4pj6kJ +nG0eQYTIeAw7c7k0hE23SOvl7fGMzJRlMtsYAyroQwA0P4tflF/ejq9diLqtZwONwYw3ZG +iAOm8cZPK3hYxrR/tPQ+xit66SPHzkRpd+UNQXQ6rP4CYUygk5/a+yEVB0vPOwcEKEYbxw +MIVzDwIahiRP8sPIeXipumxEfoJRAnUGfZYssELFW/lmr+HjXHIjCWgbHm8LD4uFgWL8Y1 +axr84xBJaJzu5q+R2u6mJ5Oln69q/y3xbUmxUTPqSP0UFinyCi8l2mo3WPuYzlPl0QJQoG +8WtfHcKrF3i5sBNh4nwHAcL6rSX47rm6mV0hhnLR3lqgRLW2Sa9Ru1nAdEgg1cu5LSioX+ +6uZOzEX3ygVgc12n7L6BSbVO2hT/P+Y/RFugovlWNp7p0PbgXGOEMJhwIjn15zCIufIxbu +Nk+VwjD9zw8888Mxt6i2QgBDZ/HQlbMT9Q1nhSWdMZVwLIekMApTrvjZ1A1LaGvhIDEWqh +6jrw38jtb7+V73JRxLNjIPhYVQT8dH1OPw03G9szFLssHce9iPsi/YWop9GvRnU0djBdGp +2OVx1ilZPK/hryS8Be0g4xpOmLto5Gs3oUAo5GyPpYfvHfeI4oY/kjAtNAkBR/RR8vywtq +fFwBhaVmQRnzeUcqHd0oPQgZu/YGRYbcr9zw4yWD96MVV+qgkpcjvn2P+fMIdL81N2n0FH +VlHPqpCxSaz6x/0lYq9sq7BkfvUIPUjM813+6HFY3vQ5BthraVz9P6YZJOqLBTCL8/SnjK +8FDL6mN3SSBQboCBZAvl52cO3FJ3c5b8MgL1cJRf1De/bwkOZDQhYWjx3rjt7mNFLjxwkD +SfvYY0BsFHKKclvhqGvkivFr1YqIkJZ9B4z84QqSDwRd/pDPKXjuoNreCHNGTSGJ3X2HEo +6a1CDeOLXbclPcEkJHP+UV5thCL5B73Nbx+r06UI7DfcUtjJ+xIbt8XWNhQ4QlFbN4+n0X +O9/Zzk4f3JtiRUfufKVE7Qho8KjdLWCEzyJrnBTA0B90WXgl8dkpbF2HK1YZYjwG0G6LFW +hGhBlrwFijYAFw4xW93n8eFTzdrrzsX8fXQVr/xS35w87jB4zswh1hw4EcqHGPSF8MmPa1 +3DPEPxfRSIxB8bOSKBdwyejTT9SSoSWUEGi3+wZeUzhW8QOK74Z6s8CnusJxfjKGXNk21T +RxBHBC9duCtSFk1ARBGKu2WqmHY= +-----END OPENSSH PRIVATE KEY----- diff --git a/libcloud/test/compute/fixtures/misc/test_rsa_2048b_pass_foobar.pub b/libcloud/test/compute/fixtures/misc/test_rsa_2048b_pass_foobar.pub new file mode 100644 index 0000000000..9a5587979e --- /dev/null +++ b/libcloud/test/compute/fixtures/misc/test_rsa_2048b_pass_foobar.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDSteUVWXmUHZV1OBJwhHKft722mNLBjLhARvblwyAhbA5oqSsd7lKiTMNbmln4VwBRJ73tJC55P1KL5UrspvGkM1+6jd1QQvtFtxNNX4We7zxUbCuEfQo6wcDjxaYGxrVrc6MzAHT0DzCjOWz9XZAtMqXhaV11hMzsg8IABWsjI9r9RU//6VOiaVbn/6lP9zPii6S/kbuoTbkXD7RBBFxdWfLIe5pL2Ov2oKEncW9VrBHANYObrmiPdSJxUpTM6w34UAK6BRHZO2EmzebVDdwXLrY7PpZIZUOME7IFtjDKOcQkOg0JEKPLGIJyZPr9iOVbDJiRfpqLRweG+Zu+9NzCOEmGq3CZpkZzCMr2yESV2o620+cbdK16ZhbJfwyQZi155geNE+swZQmtpcDhm2V++LwSwXZxjFZYvRwM6XVMKifo6bRG3BAN0rPJ5GXqJA7LptRMtXHkhhXDrRJK3fg8/I07eLYaGc7Uic97XT9+oqIbXrx27ZQ5N1PzKeQw7yc= kami@kami-desktop diff --git a/libcloud/test/compute/fixtures/misc/test_rsa_non_paramiko_recognized_header.key b/libcloud/test/compute/fixtures/misc/test_rsa_non_paramiko_recognized_header.key new file mode 100644 index 0000000000..b06de137d3 --- /dev/null +++ b/libcloud/test/compute/fixtures/misc/test_rsa_non_paramiko_recognized_header.key @@ -0,0 +1,27 @@ +-----BEGIN PRIVATE KEY----- +MIIEogIBAAKCAQEAs0ya+QTUpUyAxbFWN81CbW23D7Fm8O1wxP3l0UPu9OO/dAES +irxNxbBEanTGb8HMdaLEdLBlXaYAIlf8+YhG+c9o7kKe8kCR3j4hJ3x0x/fTVSTf +mNQc7XIUaM9tuCGj/fO2zfn3fD5fztWAwssPm1+cyP3pAgvc/H03SNpdQG05ylZ+ +1I2QYymYtbjzGh9Nen6dN/aSDrZI7yIA1o3hsDoiY2Nb82l958UI3uJKaxGeBSpO +Mshutar3gWa/v9F6uqHDTmFEqQdvQGdCHHyWuz98jMVUc0kvWjdH5q5X95CBZFQM +uOQPNxn2aYjMaP7pU2jvfrU0sLpWT/tG8ZApJwIDAQABAoIBAECotZJr7YuW5TFl +3GPPP89aq5ObNDZaSjqgHUq0Ju5lW1uoL1mcwqcyA9ooNo+C4griIdq66jM1dALu +nCoYvQ/Ffl+94rgWFQSCf05QEYUzmCCyZXgltjDi3P1XIIgwiYVBaIErTdaeX8ql +MAQPWpd7iXzqJCc6w/zB4zgAl3Rt1Fb8GBFHlYf3VTpiU9LA5/IG04GoPk80OgiW +98lercisWT+nPrTMDu2GoEqqls8OkM9CcT5AgeXIpSF9nPmQgUQWXoqWkrZhD+eQ +mOxCqpqzwkW/JdsUaBqhPAJtK/eBHTPAfsOabQ5G6/Un1HejN0GTIR0GJzTSEOvi +blM3YuECgYEA53XL8c8S5ckc1BGfM22obY1daAVgFqsNpqVSV4OKKnRlcmtYaUXq +61vrQN/OG9Ogrr7FuL7HwavJnr3IbT8uET1/pUje/NQviERwSZWiNX++GUCSXUvq +hSe9LZb3ezTEkUROdGXOfl+TfI/bhojsk6egaqqKAVv8LR92cwzMD28CgYEAxk8T +x278NOLUn+F6ije186xpcI0JV+NydhXk40ViDHc7M2ycHNArc6iJzQIlQjkEDejK +yae3c3QMVtszwONSd6wPkPr9bLbiiT0UlG5gpGAGyEyYZjMQukg2e8ImnwMVMm2l +bJsrDI5CRq4G20CWPDqxzs8FTuX78tX4uewzJckCgYBmi1a2o8JAkZA3GDOLClsj +Zgzq5+7BPDlJCldntDxDQNwtDAfYZASHD2szi7P5uhGnOZfJmKRRVnV14ajpVaNo +OfHSXW2FX9BLM973itaZkyW6dFQkB104bvmuOAMez6sCnNuRUAVjEZ77AZUFjqYZ +aJt2hmWr4n/f0d+dax8A+wKBgEVV7LJ0KZZMIM9txKyC4gk6pPsHNNcX3TNQYGDe +J3P4VCicttCUMD0WFmgpceF/kd1TIWP0Uf35+z57EdNFJ9ZTwHWObAEQyI/3XTSw +ivWt5XEu5rIE9LpM+U+4CEzchRLGp2obrqeLLb0Mp7UNFfolA3otg8ucOcUj7v0C +ireRAoGAMM5MDDtWyduLH9srxC3PBKdD4Hi8dtzkQ9yAFYTJ0HB4vV7MmIZ2U2j7 +x2KTrPc/go/Jm7+UOmVa4LNkdRvXxVOlAxH85Hqr+n74mm/dWcS4dDWrZvL+Sn+l +GFa29M3Ix5SnlfFkZhijvTFLICC7XPTRj6uqVHscZVfENhAYGoU= +-----END PRIVATE KEY----- diff --git a/libcloud/test/compute/fixtures/misc/test_rsa_non_pem_format.key b/libcloud/test/compute/fixtures/misc/test_rsa_non_pem_format.key new file mode 100644 index 0000000000..1ebe5cf8a0 --- /dev/null +++ b/libcloud/test/compute/fixtures/misc/test_rsa_non_pem_format.key @@ -0,0 +1,27 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn +NhAAAAAwEAAQAAAQEA62PnwyPMECUdKQvMByS+PwgRp97IB1wIpeb9RdR8PC5HPzWHt/iO +wtoXEK4M6dRJ0x+u66gVygHXoH+zydTLu/3SaFwUvuoFRsyDeQZWkHPqvkFOqaGfbr99Um +h8crXJOeDi9sqI9JDZJAmJePLfHGQfv97lYWHSE7Pvp4cgM/CRqoGSMbfnHOPsLQujiFhe +S7uMHqv6oNA2ClVOl8uUIw0SVBl/4crMh9e8hlHMR+UHmuUMwwXmlHrFsh7J6A2nyu1V6K +MTOCLUpXX9LtN3XmvS+D6sfCzzc10L1jHAyswAN8abey1Z1V5jtGi2iSMRF4nccjGacn7p +OxnYYZtF9wAAA9BhFsUwYRbFMAAAAAdzc2gtcnNhAAABAQDrY+fDI8wQJR0pC8wHJL4/CB +Gn3sgHXAil5v1F1Hw8Lkc/NYe3+I7C2hcQrgzp1EnTH67rqBXKAdegf7PJ1Mu7/dJoXBS+ +6gVGzIN5BlaQc+q+QU6poZ9uv31SaHxytck54OL2yoj0kNkkCYl48t8cZB+/3uVhYdITs+ ++nhyAz8JGqgZIxt+cc4+wtC6OIWF5Lu4weq/qg0DYKVU6Xy5QjDRJUGX/hysyH17yGUcxH +5Qea5QzDBeaUesWyHsnoDafK7VXooxM4ItSldf0u03dea9L4Pqx8LPNzXQvWMcDKzAA3xp +t7LVnVXmO0aLaJIxEXidxyMZpyfuk7Gdhhm0X3AAAAAwEAAQAAAQEAhxaHzIK/ushB6ut9 +ROA+WlgcIdYFv8t+nw9obOnb/oGkm87xu4/nBkY5FHZ+rLcLQyGctlt5Xbwe7lo7aOo5ng +K1/PRTZ5lQO+hkz1Dm3vHXVyaNqWY65Ej6+A9E1GQlPpUkS/PCE3EJXNgoUAQ6LMX9PpUB +2RhVgr8yG1e+EG+2prcTZ5m++Z73kscoksJiAFwUqPfWLfNlHAYNVfchb/iaQHh++P9UJ8 +VqiISXKrRGCl/sSE9rksmXeaAGdmgPlp0q16GKn5ISNwoc6PwybJTqedixXXDMtyQVM+EN +z4w7+u2guKhP7OfZk5DyeKct2OSNhFdzni24F/EmZ4QlyQAAAIEA9s4pmYxrNXAroCi/1j +2S0dZL8KJowGkGZatNBFYZBJGyImRdzZ+5y1yEDFSGh6wzAGhRZmVJaVhHGhBLaULVj3Kl +wZhuxSpLm0Yr1Pl9rYPn4JOpO+ExbcepQ0ghEB3RGtmHk2IpbZ2AHlTFHhTrwz19GFTDF7 ++R1YfYb8zL7e8AAACBAPq0MFp4L5idhvliWdrG7DDeauwnmmSqRM2Zv8FgFloqsMHldkym +c//vLDJ2cu3e2advOrsSOXZTHFjd6M0Nek/0r8MtrboYWjx6wBiwBCwNItBnvzVYm7OoOi +HxcNLQnhFVCBn7qDDG/84jFM4MIJR66A3PGTnIMN1hrDiX/+LNAAAAgQDwXOZxZ8c/2O4y +vaJ0Gnq3wfXTZRQ/At/CwKznAJXmbR6On3LiaiU7q9jSLXGuRcpcjUjfXCQgr4t7hBTFc9 +5RJDe5J4wHdXIZPrLz1in0SnZ2q/KMb4UsYbfn8Ls6VCXPM0SYv0wJPbCetL0P0285bJiB +teUhr+JIm0vxcpaz0wAAABdrYW1pQGthbWktZGVsbC1sYXRpdHVkZQEC +-----END OPENSSH PRIVATE KEY----- diff --git a/libcloud/test/compute/fixtures/misc/test_rsa_non_pem_format.pub b/libcloud/test/compute/fixtures/misc/test_rsa_non_pem_format.pub new file mode 100644 index 0000000000..d21be7e3cd --- /dev/null +++ b/libcloud/test/compute/fixtures/misc/test_rsa_non_pem_format.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDrY+fDI8wQJR0pC8wHJL4/CBGn3sgHXAil5v1F1Hw8Lkc/NYe3+I7C2hcQrgzp1EnTH67rqBXKAdegf7PJ1Mu7/dJoXBS+6gVGzIN5BlaQc+q+QU6poZ9uv31SaHxytck54OL2yoj0kNkkCYl48t8cZB+/3uVhYdITs++nhyAz8JGqgZIxt+cc4+wtC6OIWF5Lu4weq/qg0DYKVU6Xy5QjDRJUGX/hysyH17yGUcxH5Qea5QzDBeaUesWyHsnoDafK7VXooxM4ItSldf0u03dea9L4Pqx8LPNzXQvWMcDKzAA3xpt7LVnVXmO0aLaJIxEXidxyMZpyfuk7Gdhhm0X3 kami@kami-dell-latitude diff --git a/libcloud/test/compute/fixtures/nephoscale/list_images.json b/libcloud/test/compute/fixtures/nephoscale/list_images.json deleted file mode 100644 index 1ede35dfcd..0000000000 --- a/libcloud/test/compute/fixtures/nephoscale/list_images.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "success": true, - "total_count": 18, - "subcode": 0, - "message": "Your request was processed successfully.", - "data": [ - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux CentOS 5.5 32-bit", - "uri": "https://api.nephoscale.com/image/server/3/", - "max_memory": 128, - "id": 3, - "is_default": true, - "create_time": "2010-12-20 14:25:36", - "architecture": "x86", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux CentOS 5.5 64-bit", - "uri": "https://api.nephoscale.com/image/server/5/", - "max_memory": 128, - "id": 5, - "is_default": true, - "create_time": "2010-12-20 14:25:36", - "architecture": "x86_64", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Windows Server 2008 64-bit", - "uri": "https://api.nephoscale.com/image/server/21/", - "max_memory": 128, - "id": 21, - "is_default": true, - "create_time": "2010-12-20 14:25:36", - "architecture": "x86_64", - "base_type": "windows" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux Debian Server 5.05 32-bit", - "uri": "https://api.nephoscale.com/image/server/23/", - "max_memory": 128, - "id": 23, - "is_default": true, - "create_time": "2010-12-20 16:51:20", - "architecture": "x86", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux Debian Server 5.05 64-bit", - "uri": "https://api.nephoscale.com/image/server/25/", - "max_memory": 128, - "id": 25, - "is_default": true, - "create_time": "2010-12-20 16:55:42", - "architecture": "x86_64", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Windows Server 2003 Enterprise 64-bit", - "uri": "https://api.nephoscale.com/image/server/33/", - "max_memory": 128, - "id": 33, - "is_default": true, - "create_time": "2011-03-02 14:20:49", - "architecture": "x86_64", - "base_type": "windows" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux CentOS 5.7 64-bit", - "uri": "https://api.nephoscale.com/image/server/41/", - "max_memory": 128, - "id": 41, - "is_default": true, - "create_time": "2011-09-19 17:30:04", - "architecture": "x86_64", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux Ubuntu Server 10.04 LTS 32-bit", - "uri": "https://api.nephoscale.com/image/server/43/", - "max_memory": 128, - "id": 43, - "is_default": true, - "create_time": "2011-10-01 02:26:17", - "architecture": "x86", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux CentOS 5.7 32-bit", - "uri": "https://api.nephoscale.com/image/server/45/", - "max_memory": 128, - "id": 45, - "is_default": true, - "create_time": "2011-10-05 19:41:30", - "architecture": "x86", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux Ubuntu Server 10.04 LTS 64-bit", - "uri": "https://api.nephoscale.com/image/server/49/", - "max_memory": 128, - "id": 49, - "is_default": true, - "create_time": "2011-10-08 05:01:10", - "architecture": "x86_64", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux Debian Server 6.0.3 64-bit", - "uri": "https://api.nephoscale.com/image/server/51/", - "max_memory": 128, - "id": 51, - "is_default": true, - "create_time": "2011-10-08 19:54:41", - "architecture": "x86_64", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux Debian 5.0.9 64-bit", - "uri": "https://api.nephoscale.com/image/server/55/", - "max_memory": 128, - "id": 55, - "is_default": false, - "create_time": "2011-10-13 12:53:36", - "architecture": "x86_64", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux Debian 5.0.9 32-bit", - "uri": "https://api.nephoscale.com/image/server/57/", - "max_memory": 128, - "id": 57, - "is_default": false, - "create_time": "2011-10-13 12:55:09", - "architecture": "x86", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux CentOS 6.2 64-bit", - "uri": "https://api.nephoscale.com/image/server/59/", - "max_memory": 128, - "id": 59, - "is_default": true, - "create_time": "2011-10-15 17:11:34", - "architecture": "x86_64", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux CentOS 5.8 64-bit", - "uri": "https://api.nephoscale.com/image/server/64/", - "max_memory": 128, - "id": 64, - "is_default": true, - "create_time": "2012-03-28 19:54:10", - "architecture": "x86_64", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux Ubuntu Server 12.04 LTS 64-bit", - "uri": "https://api.nephoscale.com/image/server/75/", - "max_memory": 128, - "id": 75, - "is_default": true, - "create_time": "2012-05-18 08:41:03", - "architecture": "x86_64", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "cloud", - "is_active": true, - "friendly_name": "VOD Cloud Storage Proxy (FTP:HTTP)", - "uri": "https://api.nephoscale.com/image/server/101/", - "max_memory": 128, - "id": 101, - "is_default": false, - "create_time": "2012-08-30 08:49:55", - "architecture": "x86_64", - "base_type": "linux" - }, - { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Debian 7.1 64-bit", - "uri": "https://api.nephoscale.com/image/server/177/", - "max_memory": 128, - "id": 177, - "is_default": true, - "create_time": "2013-09-10 16:12:10", - "architecture": "x86_64", - "base_type": "linux" - } - ], - "response": 200 -} diff --git a/libcloud/test/compute/fixtures/nephoscale/list_keys.json b/libcloud/test/compute/fixtures/nephoscale/list_keys.json deleted file mode 100644 index f6f9205ec7..0000000000 --- a/libcloud/test/compute/fixtures/nephoscale/list_keys.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "success": true, - "total_count": 2, - "subcode": 0, - "message": "Your request was processed successfully.", - "data": [ - { - "name": "mistio-ssh", - "key_group": 1, - "uri": "https://api.nephoscale.com/key/sshrsa/72209/", - "key_type": 2, - "create_time": "2013-10-02 07:24:37", - "id": 72209 - }, - { - "name": "mistio-testing", - "key_group": 4, - "uri": "https://api.nephoscale.com/key/password/72211/", - "key_type": 1, - "create_time": "2013-10-02 07:27:10", - "id": 72211 - } - ], - "response": 200 -} diff --git a/libcloud/test/compute/fixtures/nephoscale/list_locations.json b/libcloud/test/compute/fixtures/nephoscale/list_locations.json deleted file mode 100644 index 952fac4b6e..0000000000 --- a/libcloud/test/compute/fixtures/nephoscale/list_locations.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "success": true, - "total_count": 2, - "subcode": 0, - "message": "Your request was processed successfully.", - "data": [ - { - "datacenter": { - "airport_code": "SJC", - "name": "SJC-1", - "uri": "https://api.nephoscale.com/datacenter/1/", - "id": 1 - }, - "uri": "https://api.nephoscale.com/datacenter/zone/86945/", - "id": 86945, - "name": "SJC-1" - }, - { - "datacenter": { - "airport_code": "RIC", - "name": "RIC-1", - "uri": "https://api.nephoscale.com/datacenter/3/", - "id": 3 - }, - "uri": "https://api.nephoscale.com/datacenter/zone/87729/", - "id": 87729, - "name": "RIC-1" - } - ], - "response": 200 -} diff --git a/libcloud/test/compute/fixtures/nephoscale/list_nodes.json b/libcloud/test/compute/fixtures/nephoscale/list_nodes.json deleted file mode 100644 index 7fdff6c7a6..0000000000 --- a/libcloud/test/compute/fixtures/nephoscale/list_nodes.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "success": true, - "total_count": 2, - "subcode": 0, - "message": "Your request was processed successfully.", - "data": [ - { - "server_keys": [ - { - "key_type": 2, - "key_group": 1, - "id": 71757, - "uri": "https://api.nephoscale.com/key/sshrsa/71157/" - } - ], - "name": "mongodb-staging", - "zone": { - "uri": "https://api.nephoscale.com/datacenter/zone/88211/", - "id": 87729, - "name": "RIC-1" - }, - "image": { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux Ubuntu Server 10.04 LTS 64-bit", - "uri": "https://api.nephoscale.com/image/server/49/", - "max_memory": 128, - "id": 49, - "is_default": true, - "create_time": "2011-10-08 05:01:10", - "architecture": "x86_64", - "has_agent": true, - "base_type": "linux" - }, - "hostname": "mongodb-staging", - "podzone": "P1A2", - "uri": "https://api.nephoscale.com/server/cloud/87241/", - "ipaddresses": "198.89.117.16", - "power_status": "on", - "create_time": "2013-09-25 07:38:53", - "postinit_state": 1, - "console_keys": [ - { - "key_type": 1, - "key_group": 4, - "id": 71761, - "uri": "https://api.nephoscale.com/key/password/71761/" - } - ], - "memory": 512, - "service_type": { - "sku": { - "name": "CS05", - "description": "Cloud Server 0.5 GB RAM, 1 Core" - }, - "uri": "https://api.nephoscale.com/server/type/cloud/5/", - "friendly_name": "CS05 - 0.5GB, 1Core, 25GB", - "id": 5, - "billable_type": 1 - }, - "network_ports": [ - { - "macaddress": "00:16:3e:06:dc:41", - "devname": "eth0", - "network_domain": { - "domain_type": 0, - "name": "default_public_network_RIC" - } - }, - { - "macaddress": "00:16:3e:06:dc:45", - "devname": "eth1", - "network_domain": { - "domain_type": 1, - "name": "default_private_network_RIC" - } - } - ], - "id": 88241, - "is_console_enabled": true - }, - { - "server_keys": [ - { - "key_type": 2, - "key_group": 1, - "id": 72049, - "uri": "https://api.nephoscale.com/key/sshrsa/72049/" - } - ], - "name": "backup-server2", - "zone": { - "uri": "https://api.nephoscale.com/datacenter/zone/88751/", - "id": 87729, - "name": "RIC-1" - }, - "image": { - "max_cpu": 64, - "deployable_type": "both", - "is_active": true, - "friendly_name": "Linux Debian Server 6.0.3 64-bit", - "uri": "https://api.nephoscale.com/image/server/51/", - "max_memory": 128, - "id": 51, - "is_default": true, - "create_time": "2011-10-08 19:54:41", - "architecture": "x86_64", - "has_agent": true, - "base_type": "linux" - }, - "hostname": "backup-server2", - "podzone": "P1A2", - "uri": "https://api.nephoscale.com/server/cloud/88751/", - "ipaddresses": "198.89.112.115", - "power_status": "on", - "create_time": "2013-10-02 05:02:50", - "postinit_state": 1, - "console_keys": [ - { - "key_type": 1, - "key_group": 4, - "id": 72165, - "uri": "https://api.nephoscale.com/key/password/72165/" - } - ], - "memory": 512, - "service_type": { - "sku": { - "name": "CS05", - "description": "Cloud Server 0.5 GB RAM, 1 Core" - }, - "uri": "https://api.nephoscale.com/server/type/cloud/5/", - "friendly_name": "CS05 - 0.5GB, 1Core, 25GB", - "id": 5, - "billable_type": 1 - }, - "network_ports": [ - { - "macaddress": "00:16:3e:06:f5:2f", - "devname": "eth0", - "network_domain": { - "domain_type": 0, - "name": "default_public_network_RIC" - } - }, - { - "macaddress": "00:16:3e:06:f5:33", - "devname": "eth1", - "network_domain": { - "domain_type": 1, - "name": "default_private_network_RIC" - } - } - ], - "id": 88751, - "is_console_enabled": true - } - ], - "response": 200 -} diff --git a/libcloud/test/compute/fixtures/nephoscale/list_password_keys.json b/libcloud/test/compute/fixtures/nephoscale/list_password_keys.json deleted file mode 100644 index ca3c629f7f..0000000000 --- a/libcloud/test/compute/fixtures/nephoscale/list_password_keys.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "success": true, - "total_count": 1, - "subcode": 0, - "message": "Your request was processed successfully.", - "data": [ - { - "name": "mistio-testing", - "key_group": 4, - "uri": "https://api.nephoscale.com/key/password/72211/", - "key_type": 1, - "create_time": "2013-10-02 07:27:10", - "password": "23d493j5", - "id": 72211 - } - ], - "response": 200 -} diff --git a/libcloud/test/compute/fixtures/nephoscale/list_sizes.json b/libcloud/test/compute/fixtures/nephoscale/list_sizes.json deleted file mode 100644 index c6d89f398e..0000000000 --- a/libcloud/test/compute/fixtures/nephoscale/list_sizes.json +++ /dev/null @@ -1,178 +0,0 @@ -{ - "success": true, - "total_count": 13, - "subcode": 0, - "message": "Your request was processed successfully.", - "data": [ - { - "sku": { - "name": "CS16.16", - "description": "Cloud Server 16 GB RAM, 16 Cores" - }, - "storage": 800, - "ram": 16384, - "friendly_name": "CS16.16 - 16GB, 16Core, 800GB", - "uri": "https://api.nephoscale.com/server/type/cloud/1/", - "vcpus": 16, - "id": 1, - "billable_type": 1 - }, - { - "sku": { - "name": "CS1", - "description": "Cloud Server 1 GB RAM, 1 Core" - }, - "storage": 50, - "ram": 1024, - "friendly_name": "CS1 - 1GB, 1Core, 50GB", - "uri": "https://api.nephoscale.com/server/type/cloud/3/", - "vcpus": 1, - "id": 3, - "billable_type": 1 - }, - { - "sku": { - "name": "CS05", - "description": "Cloud Server 0.5 GB RAM, 1 Core" - }, - "storage": 25, - "ram": 512, - "friendly_name": "CS05 - 0.5GB, 1Core, 25GB", - "uri": "https://api.nephoscale.com/server/type/cloud/5/", - "vcpus": 1, - "id": 5, - "billable_type": 1 - }, - { - "sku": { - "name": "CS2.2", - "description": "Cloud Server 2 GB RAM, 2 Cores" - }, - "storage": 100, - "ram": 2048, - "friendly_name": "CS2.2 - 2GB, 2Core, 100GB", - "uri": "https://api.nephoscale.com/server/type/cloud/7/", - "vcpus": 2, - "id": 7, - "billable_type": 1 - }, - { - "sku": { - "name": "CS4.4", - "description": "Cloud Server 4 GB RAM, 4 Cores" - }, - "storage": 200, - "ram": 4096, - "friendly_name": "CS4.4 - 4GB, 4Core, 200GB", - "uri": "https://api.nephoscale.com/server/type/cloud/9/", - "vcpus": 4, - "id": 9, - "billable_type": 1 - }, - { - "sku": { - "name": "CS8.8", - "description": "Cloud Server 8 GB RAM, 8 Cores" - }, - "storage": 400, - "ram": 8192, - "friendly_name": "CS8.8 - 8GB, 8Core, 400GB", - "uri": "https://api.nephoscale.com/server/type/cloud/11/", - "vcpus": 8, - "id": 11, - "billable_type": 1 - }, - { - "sku": { - "name": "CS025", - "description": "Cloud Server 0.25 GB RAM" - }, - "storage": 15, - "ram": 256, - "friendly_name": "CS025 - 0.25GB, 10GB", - "uri": "https://api.nephoscale.com/server/type/cloud/27/", - "vcpus": 1, - "id": 27, - "billable_type": 1 - }, - { - "sku": { - "name": "CS2.1", - "description": "Cloud Server 2 GB RAM, 1 Core" - }, - "storage": 75, - "ram": 2048, - "friendly_name": "CS2.1 - 2GB, 1Core, 75GB", - "uri": "https://api.nephoscale.com/server/type/cloud/46/", - "vcpus": 1, - "id": 46, - "billable_type": 1 - }, - { - "sku": { - "name": "CS4.2", - "description": "Cloud Server 4 GB RAM, 2 Cores" - }, - "storage": 150, - "ram": 4096, - "friendly_name": "CS4.2 - 4GB, 2Core, 150GB", - "uri": "https://api.nephoscale.com/server/type/cloud/48/", - "vcpus": 2, - "id": 48, - "billable_type": 1 - }, - { - "sku": { - "name": "CS8.4", - "description": "Cloud Server 8 GB RAM, 4 Cores" - }, - "storage": 300, - "ram": 8192, - "friendly_name": "CS8.4 - 8GB, 4Core, 300GB", - "uri": "https://api.nephoscale.com/server/type/cloud/50/", - "vcpus": 4, - "id": 50, - "billable_type": 1 - }, - { - "sku": { - "name": "CS16.8", - "description": "Cloud Server 16 GB RAM, 8 Cores" - }, - "storage": 600, - "ram": 16384, - "friendly_name": "CS16.8 - 16GB, 8Core, 600GB", - "uri": "https://api.nephoscale.com/server/type/cloud/52/", - "vcpus": 8, - "id": 52, - "billable_type": 1 - }, - { - "sku": { - "name": "CS32.16", - "description": "Cloud Server 32 GB RAM, 16 Cores" - }, - "storage": 1200, - "ram": 32768, - "friendly_name": "CS32.16 - 32GB, 16Core, 1200GB", - "uri": "https://api.nephoscale.com/server/type/cloud/54/", - "vcpus": 16, - "id": 54, - "billable_type": 1 - }, - { - "sku": { - "name": "CS32.8", - "description": "Cloud Server 32 GB RAM, 8 Cores" - }, - "storage": 1000, - "ram": 32768, - "friendly_name": "CS32.8 - 32GB, 8Core, 1000GB", - "uri": "https://api.nephoscale.com/server/type/cloud/56/", - "vcpus": 8, - "id": 56, - "billable_type": 1 - } - ], - "response": 200 -} diff --git a/libcloud/test/compute/fixtures/nephoscale/list_ssh_keys.json b/libcloud/test/compute/fixtures/nephoscale/list_ssh_keys.json deleted file mode 100644 index dc83a8f0c0..0000000000 --- a/libcloud/test/compute/fixtures/nephoscale/list_ssh_keys.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "success": true, - "total_count": 1, - "subcode": 0, - "message": "Your request was processed successfully.", - "data": [ - { - "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBs+gQwoeFNa+4pYz2AKz5Op7EqrzeP3YsyTKxx7P9gt4aSt5w8Z+lRn3p3CVG+th5i6lZqOxWgCZ1kp2KEKNbSsA2HWl3OwkY8IqHGSEeMrF+3A2Ncz88kUIAWzCswxPY4uqb/yA4EzEQDk7PJj7Q1DruObhOm7qyHT40n2KJ3TqHJQlV9XE3RcXSaQcwUt0YFXFMx8wkgy0NKqqSiQuH8RofyfnOABEzKAARGbcQjZWxh2ITzUmwMxUCBa0X5wvblgcE6/pRZN5Xq6NQr2XEU5Z48+mLy6asdasdwrM0v10Y7ojDL/TosK/8T5+d5yaRsvtBlBstDZhNWY31n5iCLxx user@mistio", - "name": "mistio-ssh", - "key_group": 1, - "uri": "https://api.nephoscale.com/key/sshrsa/72209/", - "key_type": 2, - "create_time": "2013-10-02 07:24:37", - "id": 72209 - } - ], - "response": 200 -} diff --git a/libcloud/test/compute/fixtures/nephoscale/success_action.json b/libcloud/test/compute/fixtures/nephoscale/success_action.json deleted file mode 100644 index 62db155664..0000000000 --- a/libcloud/test/compute/fixtures/nephoscale/success_action.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "subcode": 0, - "message": "Your request was processed successfully.", - "data": { - "id": 141229, - "resource_type": "/job", - "uri": "https://api.nephoscale.com/job/141229/" - }, - "response": 202, - "success": true -} diff --git a/libcloud/test/compute/fixtures/nttcis/audit_log.csv b/libcloud/test/compute/fixtures/nttcis/audit_log.csv new file mode 100644 index 0000000000..6410373de6 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/audit_log.csv @@ -0,0 +1,25 @@ +UUID,Time,Create User,Department,Customer Defined 1,Customer Defined 2,Type,Name,Action,Details,Response Code +af779880-0531-45d3-be56-df41c459aa09,2016-09-11 23:59:37,ashaw_plat,,,,SERVER,ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7],Deploy Server,ATTEMPT: DEPLOY_SERVER 'ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7]', +d127748c-948f-41f0-b6a7-c0b5a2438bd6,2016-09-12 00:06:00,OEC_SYSTEM,,,,SERVER,ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7],Deploy Server,DEPLOY_SERVER 'ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7]',OK +85f978b2-0e2a-4ba3-a6ce-7567e329e842,2016-09-12 00:22:48,ashaw_plat,,,,SERVER,ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7],Start Server,ATTEMPT: START_SERVER 'ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7]', +afc67c82-381a-4ba1-b25e-2285a916d513,2016-09-12 00:23:00,OEC_SYSTEM,,,,SERVER,ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7],Start Server,START_SERVER 'ST2-DEV[10-0-0-5_8bf3420c-73cf-45ab-a923-a461ad87daf7]',OK +7378b530-9d37-4339-88d5-19428431fe07,2016-09-12 05:10:47,ashaw_plat,,,,IP_BLOCK,168.128.37.196,Add IP Block,ATTEMPT: ADD_PUBLIC_IP_BLOCK '168.128.37.196', +f978f690-13e8-4d7d-8ce3-1ca7e232df69,2016-09-12 05:10:48,ashaw_plat,,,,IP_BLOCK,168.128.37.196,Add IP Block,ADD_PUBLIC_IP_BLOCK '168.128.37.196',OK +822b7483-bb59-4659-9ab1-7a1ad25bacd7,2016-09-12 05:10:58,ashaw_plat,,,,NAT_RULE,10.0.0.5,Create NAT Rule,ATTEMPT: CREATE_NAT_RULE '10.0.0.5'(requestId:au_20160912T151058137+1000_07422779-ec2a-448e-81f4-87a333b79f3c), +2f29ebd2-2ee0-463f-9a46-2e62f09fcc74,2016-09-12 05:10:59,ashaw_plat,,,,NAT_RULE,10.0.0.5,Create NAT Rule,CREATE_NAT_RULE '10.0.0.5'(requestId:au_20160912T151058137+1000_07422779-ec2a-448e-81f4-87a333b79f3c),OK +503aa140-6da9-4fbe-b94e-b118fc5a473a,2016-09-13 04:08:55,mgreenwood_plat,,,,NAT_RULE,10.208.136.11,Add NAT Rule,ATTEMPT: ADD_NAT_RULE '10.208.136.11', +bb73bb95-a20c-46f8-9962-3862496793ff,2016-09-13 04:09:00,OEC_SYSTEM,,,,NAT_RULE,10.208.136.11,Add NAT Rule,ADD_NAT_RULE '10.208.136.11',OK +276ab194-ffb3-4516-920d-96cc068dfcfa,2016-09-13 04:11:54,mgreenwood_plat,,,,NAT_RULE,10.208.136.11,Delete NAT Rule,ATTEMPT: DELETE_NAT_RULE '10.208.136.11', +3bb0e6ad-48e1-4268-9423-4cd680edc404,2016-09-13 04:11:57,OEC_SYSTEM,,,,NAT_RULE,10.208.136.11,Delete NAT Rule,DELETE_NAT_RULE '10.208.136.11',OK +f9f2684a-796c-4f28-9448-949900f8f4fb,2016-09-13 04:16:22,mgreenwood_plat,,,,NAT_RULE,10.208.136.11,Add NAT Rule,ATTEMPT: ADD_NAT_RULE '10.208.136.11', +0bfbe81f-35fc-445e-a33e-f12a46c25115,2016-09-13 04:16:27,OEC_SYSTEM,,,,NAT_RULE,10.208.136.11,Add NAT Rule,ADD_NAT_RULE '10.208.136.11',OK +629da5f4-7fdc-4bc6-a408-66ab96f539c0,2016-09-13 04:27:19,mgreenwood_plat,,,,ACL_RULE,AD LDAP Port - For Testing,Add Acl Rule,ATTEMPT: Add Acl Rule AD LDAP Port - For Testing to network Aperture, +ecee1409-ce7d-496d-a41b-67662d884598,2016-09-13 04:27:22,mgreenwood_plat,,,,ACL_RULE,AD LDAP Port - For Testing,Add Acl Rule,Add Acl Rule AD LDAP Port - For Testing to network Aperture,OK +f6e84763-b911-4189-bf69-138e9a23de7a,2016-09-14 03:05:15,aakbar_plat,,,,SERVER,CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62]',OK +ef43056e-1cd0-48bf-80f6-12a4cad8e1c6,2016-09-14 03:05:24,aakbar_plat,,,,SERVER,CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62]',OK +13f38aa4-a86c-45c2-909f-2a6b96c0c761,2016-09-14 03:13:21,aakbar_plat,,,,SERVER,CaaS-CI[10-209-120-16_ce81b50b-70d4-44ae-94d8-c2af8c22b244],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-CI[10-209-120-16_ce81b50b-70d4-44ae-94d8-c2af8c22b244]',OK +22aa854c-17a2-4f48-82a1-c10a052dd932,2016-09-14 05:42:04,mkumar_plat,,,,SERVER,CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62]',OK +6c7f3847-e2e8-47c8-8fd0-8c444015ad19,2016-09-14 05:51:58,mkumar_plat,,,,SERVER,CaaS-CI[10-209-120-16_ce81b50b-70d4-44ae-94d8-c2af8c22b244],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-CI[10-209-120-16_ce81b50b-70d4-44ae-94d8-c2af8c22b244]',OK +69ddc5a5-b815-439b-9d32-a1d60345355b,2016-09-14 06:02:50,mkumar_plat,,,,SERVER,CaaS-CI[10-209-120-16_ce81b50b-70d4-44ae-94d8-c2af8c22b244],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-CI[10-209-120-16_ce81b50b-70d4-44ae-94d8-c2af8c22b244]',OK +4ffa5524-926b-4747-9924-581c316b6a60,2016-09-14 06:05:49,mkumar_plat,,,,SERVER,CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62]',OK +599718fe-f58c-439b-87ae-86fb1347708e,2016-09-14 06:06:21,mkumar_plat,,,,SERVER,CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62],Get Console Access Session Token,GENERATE_CONSOLE_ACCESS_SESSION_TOKEN 'CaaS-QA[10-209-120-14_e772c8c0-ee55-4e8f-82f9-22576b494a62]',OK diff --git a/libcloud/test/compute/fixtures/nttcis/cg_by_src_network_domain.xml b/libcloud/test/compute/fixtures/nttcis/cg_by_src_network_domain.xml new file mode 100644 index 0000000000..3594cbb350 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/cg_by_src_network_domain.xml @@ -0,0 +1,51 @@ + + + + sdk_test2_cg + A test consistency group + + + DRS-ProdEng-East-ND1 + + + DRS-ProdEng-West-ND1 + + + + src-sdk-test + + + tgt-sdk-test + + + 2018-11-12T20:53:10.000Z + DRS_MODE + + 0 + NORMAL + + + CG-Re-IP-Scenario-2 + CG-Re-IP-Scenario-2 + + + DRS-ProdEng-East-ND1 + + + DRS-ProdEng-West-ND1 + + + + Src-Re-IP-RHEL7 + + + Tgt-Re-IP-RHEL7 + + + 2018-11-16T15:41:48.000Z + DRS_MODE + + 0 + NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/change_disk_size.xml b/libcloud/test/compute/fixtures/nttcis/change_disk_size.xml new file mode 100644 index 0000000000..84d461f292 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/change_disk_size.xml @@ -0,0 +1,6 @@ + + + EXPAND_DISK + IN_PROGRESS + Request to Expand Disk has been accepted. Please use appropriate Get or List API for status. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/change_disk_speed.xml b/libcloud/test/compute/fixtures/nttcis/change_disk_speed.xml new file mode 100644 index 0000000000..647bf80407 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/change_disk_speed.xml @@ -0,0 +1,6 @@ + + + CHANGE_DISK_SPEED + IN_PROGRESS + Request to Change Disk Speed has been accepted. Please use appropriate Get or List API for status. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/change_nic_networkadapter_response.xml b/libcloud/test/compute/fixtures/nttcis/change_nic_networkadapter_response.xml new file mode 100644 index 0000000000..40b60a5558 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/change_nic_networkadapter_response.xml @@ -0,0 +1,7 @@ + + CHANGE_NETWORK_ADAPTER + IN_PROGRESS + Request to Change Network Adapter for NIC with Id has been +accepted and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/create_preview_server.xml b/libcloud/test/compute/fixtures/nttcis/create_preview_server.xml new file mode 100644 index 0000000000..6715c649e4 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/create_preview_server.xml @@ -0,0 +1,7 @@ + + + CREATE_SNAPSHOT_PREVIEW_SERVER + IN_PROGRESS + Request to Create Snapshot Preview Server has been accepted. Please use appropriate Get or List API for status. + + diff --git a/libcloud/test/compute/fixtures/nttcis/datacenter_snapshotWindows.xml b/libcloud/test/compute/fixtures/nttcis/datacenter_snapshotWindows.xml new file mode 100644 index 0000000000..2f73be2742 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/datacenter_snapshotWindows.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/libcloud/test/compute/fixtures/nttcis/deploy_customised_server.xml b/libcloud/test/compute/fixtures/nttcis/deploy_customised_server.xml new file mode 100644 index 0000000000..d84949420b --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/deploy_customised_server.xml @@ -0,0 +1,7 @@ + + + DEPLOY_UNCUSTOMIZED_SERVER + IN_PROGRESS + Request to deploy uncustomized Server 'Production Server' has been accepted and is being processed. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/detailed_usage_report.csv b/libcloud/test/compute/fixtures/nttcis/detailed_usage_report.csv new file mode 100644 index 0000000000..e746b476bf --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/detailed_usage_report.csv @@ -0,0 +1,42 @@ +Name,Type,Location,Private IP +Address,Status,"user:ATag","user:BTag","user:CTag",Start Time,End +Time,Duration (Hours),CPU Type,CPU Count, RAM (GB), Storage (GB),Economy +Storage (GB),CPU Hours,High Performance CPU Hours,RAM Hours,Storage +Hours,Economy Storage Hours,Bandwidth-In (GB),Bandwidth-Out (GB),Subadmin +Hours,Network Hours,Essentials Network Domain Hours,Advanced Network Domain +Hours,VLAN Hours,Public IP Hours,Cloud Files Account Hours,Cloud Storage (GB) +Server A,Server,NA1,10.162.12.16,Running,Bob,IT,,19/06/2014 04:16,19/06/2014 +11:17,7.03,Standard,1,2,10,0,7.03,0,14.05,70.27,0,0,0,0,0,0,0,0,0,0,0 +Server A,Server,NA1,10.162.12.16,Running,Bob,IT,,19/06/2014 11:17,20/06/2014 +00:00,12.71,High Performance,1,2,10,0,0,12.71,0,127.06,0,0,0,0,0,0,0,0,0,0,0 +Server B,Server,NA1,10.162.12.13,Running,Mary,IT,,19/06/2014 03:42,19/06/2014 +11:18,7.61,Essentials,1,2,10,0,0,0,15.22,76.1,0,0,0,0,0,0,0,0,0,0,0 +Server B,Server,NA1,10.162.12.13,Stopped,Mary,IT,,19/06/2014 11:18,19/06/2014 +23:18,12,Essentials,1,2,10,0,0,0,0,120,0,0,0,0,0,0,0,0,0,0,0 +Server B,Server,NA1,10.162.12.13,Stopped,Bob,IT,,19/06/2014 23:18,20/06/2014 +00:00,0.689722222,Essentials,1,2,10,0,0,0,0,6.897222223,0,0,0,0,0,0,0,0,0,0,0 +Customer Image A,Image,NA1,,Running,Bob,IT,,19/06/2014 03:30,20/06/2014 +00:00,20.5,,0,0,10,0,0,0,0,205,0,0,0,0,0,0,0,0,0,0,0 +Customer Image B,Image,NA1,,Running,Bob,IT,,19/06/2014 03:10,19/06/2014 +03:12,0.04,,0,0,10,0,0,0,0,0.44,0,0,0,0,0,0,0,0,0,0,0 +Joseph_F,Sub-Administrator,,,Running,Bob,IT,,19/06/2014 00:00,20/06/2014 +00:00,24,,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0 +Lguy,Sub-Administrator,,,Running,Mary,IT,,19/06/2014 00:00,20/06/2014 +00:00,24,,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0 +a network,Network,NA1,,Running,,IT,,19/06/2014 01:39,20/06/2014 +00:00,22.34,,0,0,0,0,0,0,0,0,0,0,0.9,0,22.34,0,0,0,0,0,0 +b network,Network,NA1,,Running,,IT,,19/06/2014 01:49,20/06/2014 +00:00,22.18,,0,0,0,0,0,0,0,0,0,0,7.1,0,22.18,0,0,0,0,0,0 +Rick's Network Domain,Network Domain,NA9,,Running,Bob,IT,,19/06/2014 +04:19,20/06/2014 00:00,19.68,,0,0,0,0,0,0,0,0,0,0,7.1,0,22.18,19.68,0,0,0,0,0 +Rick's VLAN,VLAN,NA9,,Running,Bob,IT,,19/06/2014 04:22,20/06/2014 +00:00,19.63,,0,0,0,0,0,0,0,0,0,0,0,0,22.18,0,0,19.63,0,0,0 +files1_koala,Cloud Files,,,Running,,IT,,19/06/2014 00:00,20/06/2014 +00:00,24,,0,0,0,0,0,0,0,0,0,0,0.5,0,0,0,0,0,0,24,52 +testbed,Cloud Files,,,Running,,IT,,19/06/2014 00:00,20/06/2014 +00:00,24,,0,0,0,0,0,0,0,0,0,0,0.01,0,0,0,0,0,0,24,100 +Network: b network IP Block: +168.143.92.136(4),IpBlock,NA1,,Reserved,Mary,IT,,19/06/2014 11:47,20/06/2014 +00:00,12.2,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48.82,0,0 +TOTAL for 19/06/14,,,,,,,,19/06/2014 00:00,20/06/2014 +00:00,24,,0,0,0,0,8,13,30,606,0,3,23,48,89,20,0,20,49,48,152 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/disable_server_snapshot_service.xml b/libcloud/test/compute/fixtures/nttcis/disable_server_snapshot_service.xml new file mode 100644 index 0000000000..32f3eb8b11 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/disable_server_snapshot_service.xml @@ -0,0 +1,6 @@ + + + DISABLE_SNAPSHOT_SERVICE + OK + Snapshot Service has been disabled. + diff --git a/libcloud/test/compute/fixtures/nttcis/drs_create_cg.xml b/libcloud/test/compute/fixtures/nttcis/drs_create_cg.xml new file mode 100644 index 0000000000..425fba0583 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/drs_create_cg.xml @@ -0,0 +1,7 @@ + + + CREATE_CONSISTENCY_GROUP + IN_PROGRESS + Request to Create Consistency Group has been accepted. Please use appropriate Get or List API for status. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/drs_delete_consistency_group.xml b/libcloud/test/compute/fixtures/nttcis/drs_delete_consistency_group.xml new file mode 100644 index 0000000000..c5fcffa1b1 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/drs_delete_consistency_group.xml @@ -0,0 +1,6 @@ + + + DELETE_CONSISTENCY_GROUP + IN_PROGRESS + Request to Delete Consistency Group has been accepted. Please use appropriate Get or List API for status. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/drs_expand_journal.xml b/libcloud/test/compute/fixtures/nttcis/drs_expand_journal.xml new file mode 100644 index 0000000000..032f2ff8dd --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/drs_expand_journal.xml @@ -0,0 +1,6 @@ + + + EXPAND_JOURNAL + IN_PROGRESS + Request to Expand DRS Journal Space has been accepted. Please use appropriate Get or List API for status. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_ineligible.xml b/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_ineligible.xml new file mode 100644 index 0000000000..75f51acabc --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_ineligible.xml @@ -0,0 +1,6 @@ + + + CREATE_CONSISTENCY_GROUP + INCOMPATIBLE_OPERATION + The drsEligible flag for target Server aee58575-38e2-495f-89d3-854e6a886411 must be set. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_not_supported.xml b/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_not_supported.xml new file mode 100644 index 0000000000..b78b5c82ef --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_not_supported.xml @@ -0,0 +1,6 @@ + + + CREATE_CONSISTENCY_GROUP + OPERATION_NOT_SUPPORTED + DRS is not supported between source Data Center NA9 and target Data Center NA12. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/drs_fail_create_consistency_group.xml b/libcloud/test/compute/fixtures/nttcis/drs_fail_create_consistency_group.xml new file mode 100644 index 0000000000..6ab6fa6d8a --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/drs_fail_create_consistency_group.xml @@ -0,0 +1,6 @@ + + + CREATE_CONSISTENCY_GROUP + NAME_NOT_UNIQUE + Another Consistency Group named 'sdk_test2_cg' already exists. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/drs_initiate_failover.xml b/libcloud/test/compute/fixtures/nttcis/drs_initiate_failover.xml new file mode 100644 index 0000000000..28f52e8f6c --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/drs_initiate_failover.xml @@ -0,0 +1,6 @@ + + + INITIATE_FAILOVER + IN_PROGRESS + Request to Initiate Failover has been accepted. Please use appropriate Get or List API for status. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/drs_invalid_status.xml b/libcloud/test/compute/fixtures/nttcis/drs_invalid_status.xml new file mode 100644 index 0000000000..e707d85993 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/drs_invalid_status.xml @@ -0,0 +1,6 @@ + + + INITIATE_FAILOVER + INVALID_STATUS + You cannot Initiate Failover because Consistency Group with id 195a426b-4559-4c79-849e-f22cdf2bfb6e is not in PREVIEWING_SNAPSHOT Operation Status. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/drs_snap_shots_by_min_max_time.xml b/libcloud/test/compute/fixtures/nttcis/drs_snap_shots_by_min_max_time.xml new file mode 100644 index 0000000000..a05202da96 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/drs_snap_shots_by_min_max_time.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/drs_snapshots_by_min.xml b/libcloud/test/compute/fixtures/nttcis/drs_snapshots_by_min.xml new file mode 100644 index 0000000000..c5ecc1a354 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/drs_snapshots_by_min.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/drs_start_failover_preview.xml b/libcloud/test/compute/fixtures/nttcis/drs_start_failover_preview.xml new file mode 100644 index 0000000000..353c223036 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/drs_start_failover_preview.xml @@ -0,0 +1,6 @@ + + + START_PREVIEW_SNAPSHOT + IN_PROGRESS + Request to Start Preview Snapshot has been accepted. Please use appropriate Get or List API for status. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/drs_stop_failover_preview.xml b/libcloud/test/compute/fixtures/nttcis/drs_stop_failover_preview.xml new file mode 100644 index 0000000000..386b6015c9 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/drs_stop_failover_preview.xml @@ -0,0 +1,6 @@ + + + STOP_PREVIEW_SNAPSHOT + IN_PROGRESS + Request to Stop Preview Snapshot has been accepted. Please use appropriate Get or List API for status. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/enable_snapshot_service.xml b/libcloud/test/compute/fixtures/nttcis/enable_snapshot_service.xml new file mode 100644 index 0000000000..df862c71ce --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/enable_snapshot_service.xml @@ -0,0 +1,7 @@ + + + ENABLE_SNAPSHOT_SERVICE + IN_PROGRESS + Request to Enable Snapshot Service has been accepted. Please use appropriate Get or List API for status. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/exchange_nic_vlans_response.xml b/libcloud/test/compute/fixtures/nttcis/exchange_nic_vlans_response.xml new file mode 100644 index 0000000000..d0e8315aa5 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/exchange_nic_vlans_response.xml @@ -0,0 +1,8 @@ + + EXCHANGE_NIC_VLANS + OK + Request to exchange VLANs for Server with Id +'1cec8cfb-69e7-4de9-8404-debf116f5242' has been accepted and is being +processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/geographic_regions.xml b/libcloud/test/compute/fixtures/nttcis/geographic_regions.xml new file mode 100644 index 0000000000..1ac025a9e8 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/geographic_regions.xml @@ -0,0 +1,75 @@ + + + + Africa + afapi.opsourcecloud.net + https://mea.mcp-services.net + https://af-monitoring.mcp-services.net + ftps-af.cloud-vpn.net + Africa/Johannesburg + ENABLED + + + Asia Pacific + apapi.opsourcecloud.net + https://ap.mcp-services.net + https://ap-monitoring.mcp-services.net + ftps-ap.cloud-vpn.net + Asia/Tokyo + ENABLED + + + Australia + auapi.opsourcecloud.net + https://au.mcp-services.net + https://au-monitoring.mcp-services.net + ftps-au.cloud-vpn.net + Australia/Sydney + ENABLED + + + Canada + api-canada.dimensiondata.com + https://canada.mcp-services.net + https://ca-monitoring.mcp-services.net + ftps-canada.cloud-vpn.net + America/Toronto + ENABLED + + + Europe + euapi.opsourcecloud.net + https://eu.mcp-services.net + https://eu-monitoring.mcp-services.net + ftps-eu.cloud-vpn.net + Europe/Amsterdam + ENABLED + + + Indonesia + idapi.opsourcecloud.net + https://id.mcp-services.net + https://id-monitoring.mcp-services.net + ftps-id.cloud-vpn.net + Asia/Jakarta + NOT_ENABLED + + + Israel + ilapi.opsourcecloud.net + https://il.mcp-services.net + https://il-monitoring.mcp-services.net + ftps-med-1.cloud-vpn.net + Asia/Jerusalem + NOT_ENABLED + + + North America + api.opsourcecloud.net + https://na.mcp-services.net + https://na-monitoring.mcp-services.net + ftps-na.cloud-vpn.net + America/New_York + ENABLED + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/get_cg_by_name_or_id.xml b/libcloud/test/compute/fixtures/nttcis/get_cg_by_name_or_id.xml new file mode 100644 index 0000000000..9b594d502e --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/get_cg_by_name_or_id.xml @@ -0,0 +1,27 @@ + + + + sdk_test2_cg + A test consistency group + + + DRS-ProdEng-East-ND1 + + + DRS-ProdEng-West-ND1 + + + + src-sdk-test + + + tgt-sdk-test + + + 2018-11-12T20:53:10.000Z + DRS_MODE + + 0 + NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/image_customerImage.xml b/libcloud/test/compute/fixtures/nttcis/image_customerImage.xml new file mode 100644 index 0000000000..16e679e8ac --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/image_customerImage.xml @@ -0,0 +1,57 @@ + + + + ImportedCustomerImage + + + + + + + 2 + + 2015-11-19T14:29:02.000Z + + + + + NORMAL + + + + + CustomerImageWithPricedSoftwareLabels + + + + + + + 1 + + MSSQL2008R2S + 2015-11-03T15:25:34.000Z + + + + NORMAL + + + + CopiedCustomerImage + + + + + + + 2 + + 2015-11-11T17:17:00.000Z + + + + NORMAL + + + diff --git a/libcloud/test/compute/fixtures/nttcis/image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c.xml b/libcloud/test/compute/fixtures/nttcis/image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c.xml new file mode 100644 index 0000000000..9ca90f8e73 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c.xml @@ -0,0 +1,19 @@ + + + CustomerImageWithPricedSoftwareLabels + + + + + + + 1 + + MSSQL2008R2S + 2015-11-03T15:25:34.000Z + + + + NORMAL + + diff --git a/libcloud/test/compute/fixtures/nttcis/image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d.xml b/libcloud/test/compute/fixtures/nttcis/image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d.xml new file mode 100644 index 0000000000..e604436c03 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d.xml @@ -0,0 +1,19 @@ + + + ImportedCustomerImage + + + + + + + 2 + + 2015-11-19T14:29:02.000Z + + + + + NORMAL + + diff --git a/libcloud/test/compute/fixtures/nttcis/image_osImage.xml b/libcloud/test/compute/fixtures/nttcis/image_osImage.xml new file mode 100644 index 0000000000..b31b42f48e --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/image_osImage.xml @@ -0,0 +1,40 @@ + + + + RedHat 6 64-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 4 + + 2015-09-17T11:23:48.000Z + T-RHEL-6-64-2-4-10 + + + + + + Win2012 DC 2 CPU + Windows 2012 Datacenter + + 4 + + 2015-09-17T11:44:43.000Z + T-WIN-2012-DATACTR-64-2-4-50 + + + + + + Win2008 Std 32-bit 2 CPU + Windows 2008 Enterprise R2 32-bit installed with Microsoft SQL Server 2012 Standard Edition + + 4 + + MSSQL2008R2S + 2014-11-20T12:54:22.000Z + T-WIN-2008-ENT-32-2-4-50 + + + + + diff --git a/libcloud/test/compute/fixtures/nttcis/image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a.xml b/libcloud/test/compute/fixtures/nttcis/image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a.xml new file mode 100644 index 0000000000..75e2f93d62 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a.xml @@ -0,0 +1,13 @@ + + + Win2012 DC 2 CPU + Windows 2012 Datacenter + + 4 + + 2015-09-17T11:44:43.000Z + T-WIN-2012-DATACTR-64-2-4-50 + + + + diff --git a/libcloud/test/compute/fixtures/nttcis/image_osImage_BAD_REQUEST.xml b/libcloud/test/compute/fixtures/nttcis/image_osImage_BAD_REQUEST.xml new file mode 100644 index 0000000000..009164843b --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/image_osImage_BAD_REQUEST.xml @@ -0,0 +1,6 @@ + + + GET_OS_IMAGE + RESOURCE_NOT_FOUND + Server Image 2ffa36c8-1848-49eb-b4fa-9d908775f68c not found. + diff --git a/libcloud/test/compute/fixtures/nttcis/image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c.xml b/libcloud/test/compute/fixtures/nttcis/image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c.xml new file mode 100644 index 0000000000..87d47f5615 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c.xml @@ -0,0 +1,14 @@ + + + RedHat 6 64-bit 2 CPU + RedHat 6.6 Enterprise (Santiago) 64-bit + + 4 + + 2015-09-17T11:23:48.000Z + T-RHEL-6-64-2-4-10 + + + + + diff --git a/libcloud/test/compute/fixtures/nttcis/import_image_response.xml b/libcloud/test/compute/fixtures/nttcis/import_image_response.xml new file mode 100644 index 0000000000..b51b0bfe7c --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/import_image_response.xml @@ -0,0 +1,8 @@ + + IMPORT_IMAGE + IN_PROGRESS + Request to import image has been accepted and is being +processed. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/infrastructure_datacenter.xml b/libcloud/test/compute/fixtures/nttcis/infrastructure_datacenter.xml new file mode 100644 index 0000000000..422060064c --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/infrastructure_datacenter.xml @@ -0,0 +1,188 @@ + + + + US - West + Santa Clara + California + US + https://na3.cloud-vpn.net + ftps-na.cloud-vpn.net + + + + + + High Performance + HPF + Faster than Standard. Uses 15000 RPM disk with Fast Cache. + + + Standard + STD + Standard Disk Speed + + + Economy + ECN + Slower than Standard. Uses 7200 RPM disk without Fast Cache. + + + + + + + + + + + + + + + US - East + Ashburn + Virginia + US + https://na1.cloud-vpn.net + ftps-na.cloud-vpn.net + + + + + + Standard + STD + Standard Disk Speed + + + + + + + + + + + + + + + US - East 2 + Ashburn + Virginia + US + https://na5.cloud-vpn.net + ftps-na.cloud-vpn.net + + + + + + High Performance + HPF + Faster than Standard. Uses 15000 RPM disk with Fast Cache. + + + Standard + STD + Standard Disk Speed + + + Economy + ECN + Slower than Standard. Uses 7200 RPM disk without Fast Cache. + + + + + + + + + + + + + + + US - East 3 - MCP 2.0 + Ashburn + Virginia + US + https://na9.cloud-vpn.net + ftps-na.cloud-vpn.net + + + + + + + + + Standard + STD + Standard Disk Speed + + + High Performance + HPF + Faster than Standard. Uses 15000 RPM disk with Fast Cache. + + + Economy + ECN + Slower than Standard. Uses 7200 RPM disk without Fast Cache. + + + + + + + + + + + + + + + US - West - MCP 2.0 + Santa Clara + California + US + https://na12.cloud-vpn.net + ftps-na.cloud-vpn.net + + + + + + + + + Standard + STD + Standard Disk Speed + + + High Performance + HPF + Faster than Standard. Uses 15000 RPM disk with Fast Cache. + + + Economy + ECN + Slower than Standard. Uses 7200 RPM disk without Fast Cache. + + + + + + + + + + + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/infrastructure_datacenter_NA9.xml b/libcloud/test/compute/fixtures/nttcis/infrastructure_datacenter_NA9.xml new file mode 100644 index 0000000000..396ad1016a --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/infrastructure_datacenter_NA9.xml @@ -0,0 +1,54 @@ + + + + US - East 3 - MCP 2.0 + Ashburn + Virginia + US + https://na9.cloud-vpn.net + ftps-na.cloud-vpn.net + + + + + + + + + Standard + STD + Standard Disk Speed + + + High Performance + HPF + Faster than Standard. Uses 15000 RPM disk with Fast Cache. + + + Economy + ECN + Slower than Standard. Uses 7200 RPM disk without Fast Cache. + + + Standard + Standard CPU Speed + + + High Performance + Faster and more consistent than Standard. Suitable for applications that are more CPU intensive. + + + + + + + + + + + + + + + + diff --git a/libcloud/test/compute/fixtures/nttcis/initiate_manual_snapshot.xml b/libcloud/test/compute/fixtures/nttcis/initiate_manual_snapshot.xml new file mode 100644 index 0000000000..7c461ed5c8 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/initiate_manual_snapshot.xml @@ -0,0 +1,7 @@ + + + INITIATE_MANUAL_SNAPSHOT + IN_PROGRESS + Request to Initiate Manual Snapshot has been accepted. Please use appropriate Get or List API for status. + + diff --git a/libcloud/test/compute/fixtures/nttcis/ip_address_list_create.xml b/libcloud/test/compute/fixtures/nttcis/ip_address_list_create.xml new file mode 100644 index 0000000000..09317ef89c --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/ip_address_list_create.xml @@ -0,0 +1,9 @@ + + + CREATE_IP_ADDRESS_LIST + OK + IP Address List 'myAddressList' has been created. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/ip_address_list_delete.xml b/libcloud/test/compute/fixtures/nttcis/ip_address_list_delete.xml new file mode 100644 index 0000000000..13f323ac5c --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/ip_address_list_delete.xml @@ -0,0 +1,10 @@ + + + DELETE_IP_ADDRESS_LIST + OK + IP Address List with Id 84e34850-595d-436e-a885-7cd37edb24a4 has + been deleted. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/ip_address_list_edit.xml b/libcloud/test/compute/fixtures/nttcis/ip_address_list_edit.xml new file mode 100644 index 0000000000..3462afac89 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/ip_address_list_edit.xml @@ -0,0 +1,10 @@ + + + EDIT_IP_ADDRESS_LIST + OK + IP Address List 'MyIpAddressList' has been edited + successfully. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/ip_address_lists.xml b/libcloud/test/compute/fixtures/nttcis/ip_address_lists.xml new file mode 100644 index 0000000000..708c882a90 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/ip_address_lists.xml @@ -0,0 +1,46 @@ + + + + TestIPList2 + Test web server IP addresses list + IPV4 + + + + + NORMAL + 2016-09-01T01:19:53.000Z + + + TestIPList_sub_2 + Test web server IP addresses list + IPV4 + + + + + + NORMAL + 2016-09-01T01:20:56.000Z + + + Test_IP_Address_List_2 + Test Description + IPV4 + + + NORMAL + 2016-09-05T05:37:56.000Z + + + Test_IP_Address_List_3 + Test Description + IPV4 + + + + + NORMAL + 2016-09-05T05:57:53.000Z + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/ip_address_lists_FILTERBYNAME.xml b/libcloud/test/compute/fixtures/nttcis/ip_address_lists_FILTERBYNAME.xml new file mode 100644 index 0000000000..301a10644d --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/ip_address_lists_FILTERBYNAME.xml @@ -0,0 +1,14 @@ + + + + Test_IP_Address_List_3 + Test Description + IPV4 + + + + + NORMAL + 2016-09-05T05:57:53.000Z + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/list_consistency_groups.xml b/libcloud/test/compute/fixtures/nttcis/list_consistency_groups.xml new file mode 100644 index 0000000000..1ebc5b199e --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/list_consistency_groups.xml @@ -0,0 +1,51 @@ + + + + sdk_test2_cg + A test consistency group + + + DRS-ProdEng-East-ND1 + + + DRS-ProdEng-West-ND1 + + + + src-sdk-test + + + tgt-sdk-test + + + 2018-11-12T20:53:10.000Z + DRS_MODE + + 0 + NORMAL + + + CG-Re-IP-Scenario-2 + CG-Re-IP-Scenario-2 + + + DRS-ProdEng-East-ND1 + + + DRS-ProdEng-West-ND1 + + + + Src-Re-IP-RHEL7 + + + Tgt-Re-IP-RHEL7 + + + 2018-11-16T15:41:48.000Z + DRS_MODE + + 0 + NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/list_drs_snapshots.xml b/libcloud/test/compute/fixtures/nttcis/list_drs_snapshots.xml new file mode 100644 index 0000000000..d149b9865b --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/list_drs_snapshots.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/list_server_snapshots.xml b/libcloud/test/compute/fixtures/nttcis/list_server_snapshots.xml new file mode 100644 index 0000000000..00968573b0 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/list_server_snapshots.xml @@ -0,0 +1,27 @@ + + + + 2018-08-15T12:00:47.000Z + 2019-08-15T12:00:47.000Z + SYSTEM + CRASH_CONSISTENT + INDEX_VALID + + + + 4 + + + + + + + + + + vmx-10 + + NORMAL + 2018-08-15T12:30:50.000Z + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/manual_snapshot_server.xml b/libcloud/test/compute/fixtures/nttcis/manual_snapshot_server.xml new file mode 100644 index 0000000000..0f3e7e5266 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/manual_snapshot_server.xml @@ -0,0 +1,26 @@ + + + test + auto_created_server + + 4 + + + + + + + + + + + 2018-11-15T19:23:36.000Z + true + true + NORMAL + + + + + + diff --git a/libcloud/test/compute/fixtures/nttcis/networkWithLocation.xml b/libcloud/test/compute/fixtures/nttcis/networkWithLocation.xml new file mode 100644 index 0000000000..227def20e2 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/networkWithLocation.xml @@ -0,0 +1,19 @@ + + + + 4bba37be-506f-11e3-b29c-001517c4643e + test-net1 + Test Network. + NA5 + 10.192.176.0 + false + + + 208e3a8e-9d2f-11e2-b29c-001517c4643e + Test Network + Network description + NA9 + 10.172.74.0 + false + + diff --git a/libcloud/test/compute/fixtures/nttcis/network_addPublicIpBlock.xml b/libcloud/test/compute/fixtures/nttcis/network_addPublicIpBlock.xml new file mode 100644 index 0000000000..5555132110 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_addPublicIpBlock.xml @@ -0,0 +1,7 @@ + + + ADD_PUBLIC_IP_BLOCK + OK + Public IPv4 Address Block has been added successfully to Network Domain d3320077-c2ce-4523-8c65-d417e766077b. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_createFirewallRule.xml b/libcloud/test/compute/fixtures/nttcis/network_createFirewallRule.xml new file mode 100644 index 0000000000..ac3162ec75 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_createFirewallRule.xml @@ -0,0 +1,8 @@ + + +CREATE_FIREWALL_RULE +OK +Request create Firewall Rule 'My.Rule.2' successful + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_createNatRule.xml b/libcloud/test/compute/fixtures/nttcis/network_createNatRule.xml new file mode 100644 index 0000000000..ff652a4b8c --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_createNatRule.xml @@ -0,0 +1,9 @@ + + +CREATE_NAT_RULE +OK +NAT Rule with Id d31c2db0-be6b-4d50-8744-9a7a534b5fba has been +created. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_deleteFirewallRule.xml b/libcloud/test/compute/fixtures/nttcis/network_deleteFirewallRule.xml new file mode 100644 index 0000000000..3016297aa0 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_deleteFirewallRule.xml @@ -0,0 +1,8 @@ + + +DELETE_FIREWALL_RULE +OK +Firewall Rule (Id:84e34850-595d-436e-a885-7cd37edb24a4) has been +deleted + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_deleteNatRule.xml b/libcloud/test/compute/fixtures/nttcis/network_deleteNatRule.xml new file mode 100644 index 0000000000..2d2cebce24 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_deleteNatRule.xml @@ -0,0 +1,8 @@ + + +DELETE_NAT_RULE +OK +NAT Rule with Id 2187a636-7ebb-49a1-a2ff-5d617f496dce has been +deleted. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_deleteNetworkDomain.xml b/libcloud/test/compute/fixtures/nttcis/network_deleteNetworkDomain.xml new file mode 100644 index 0000000000..a3cca2ed2a --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_deleteNetworkDomain.xml @@ -0,0 +1,8 @@ + + +DELETE_NETWORK_DOMAIN +IN_PROGRESS +Request to Delete Network Domain (Id: 8cdfd607-f429-4df6-9352- +162cfc0891be) has been accepted and is being processed + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_deleteVlan.xml b/libcloud/test/compute/fixtures/nttcis/network_deleteVlan.xml new file mode 100644 index 0000000000..9eae809721 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_deleteVlan.xml @@ -0,0 +1,8 @@ + + +DELETE_VLAN +IN_PROGRESS +Request to Delete VLAN (Id:0e56433f-d808-4669-821d-812769517ff8) +has been accepted and is being processed + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_deployNetworkDomain.xml b/libcloud/test/compute/fixtures/nttcis/network_deployNetworkDomain.xml new file mode 100644 index 0000000000..4269840867 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_deployNetworkDomain.xml @@ -0,0 +1,8 @@ + + +DEPLOY_NETWORK_DOMAIN +IN_PROGRESS +Request to Deploy Network Domain 'A Network Domain' has been +accepted and is being processed + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_deployVlan.xml b/libcloud/test/compute/fixtures/nttcis/network_deployVlan.xml new file mode 100644 index 0000000000..946a505acc --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_deployVlan.xml @@ -0,0 +1,9 @@ + + +DEPLOY_VLAN +IN_PROGRESS +Request to deploy VLAN 'Production VLAN' has been accepted and is +being processed. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_editFirewallRule.xml b/libcloud/test/compute/fixtures/nttcis/network_editFirewallRule.xml new file mode 100644 index 0000000000..eff18c4864 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_editFirewallRule.xml @@ -0,0 +1,8 @@ + + +EDIT_FIREWALL_RULE +OK +Firewall Rule with id 1aa3d0ce-d95d-4296-8338-9717e0d37ff9 has +been edited + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_editNetworkDomain.xml b/libcloud/test/compute/fixtures/nttcis/network_editNetworkDomain.xml new file mode 100644 index 0000000000..07d55e5689 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_editNetworkDomain.xml @@ -0,0 +1,7 @@ + + +EDIT_NETWORK_DOMAIN +OK +Network Domain 'Development Network Domain' was edited +successfully. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_editVlan.xml b/libcloud/test/compute/fixtures/nttcis/network_editVlan.xml new file mode 100644 index 0000000000..10d0010ca9 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_editVlan.xml @@ -0,0 +1,7 @@ + + +EDIT_VLAN +OK +VLAN 'test' was edited successfully + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_expandVlan.xml b/libcloud/test/compute/fixtures/nttcis/network_expandVlan.xml new file mode 100644 index 0000000000..03f91125df --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_expandVlan.xml @@ -0,0 +1,8 @@ + + +EXPAND_VLAN +IN_PROGRESS +Request to expand VLAN 'Production VLAN' has been accepted and is +being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_firewallRule.xml b/libcloud/test/compute/fixtures/nttcis/network_firewallRule.xml new file mode 100644 index 0000000000..50812cab61 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_firewallRule.xml @@ -0,0 +1,35 @@ + + + + b30c224c-c95b-4cd9-bb8b-bfdfb5486abf + CCDEFAULT.BlockOutboundMailIPv4 + DROP + IPV4 + TCP + + + + + + + + true + NORMAL + + + b30c224c-c95b-4cd9-bb8b-bfdfb5486abf + SpecificSourceIP + DROP + IPV4 + TCP + + + + + + + + true + NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c.xml b/libcloud/test/compute/fixtures/nttcis/network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c.xml new file mode 100644 index 0000000000..876f37d744 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c.xml @@ -0,0 +1,18 @@ + + +8cdfd607-f429-4df6-9352-162cfc0891be +CCDEFAULT.BlockOutboundMailIPv4 +DROP +IPV4 +TCP + + + + + + + +true +NORMAL + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_natRule.xml b/libcloud/test/compute/fixtures/nttcis/network_natRule.xml new file mode 100644 index 0000000000..7478df6b43 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_natRule.xml @@ -0,0 +1,21 @@ + + + +484174a2-ae74-4658-9e56- +50fc90e086cf +10.0.0.15 +165.180.12.18 +2015-03-06T13:43:45.000Z +NORMAL + + +484174a2-ae74-4658-9e56- +50fc90e086cf +10.0.0.16 +165.180.12.19 +2015-03-06T13:45:10.000Z +NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce.xml b/libcloud/test/compute/fixtures/nttcis/network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce.xml new file mode 100644 index 0000000000..6bf447d7e3 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce.xml @@ -0,0 +1,9 @@ + + +484174a2-ae74-4658-9e56-50fc90e086cf +10.0.0.16 +165.180.12.19 +2015-03-06T13:45:10.000Z +NORMAL + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_networkDomain.xml b/libcloud/test/compute/fixtures/nttcis/network_networkDomain.xml new file mode 100644 index 0000000000..cb7a078f93 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_networkDomain.xml @@ -0,0 +1,43 @@ + + + + Aurora + Project Aurora Demo Environments + ADVANCED + 168.128.2.136 + 2015-07-13T03:52:16.000Z + NORMAL + + + Test net domain + description of my network + ESSENTIALS + 168.128.26.20 + 2015-07-15T03:36:00.000Z + NORMAL + + + another networkj + net network netowkrm + ESSENTIALS + 168.128.26.22 + 2015-07-15T03:40:09.000Z + NORMAL + + + Imports + Imported servers + ADVANCED + 168.128.2.69 + 2015-08-18T03:53:02.000Z + NORMAL + + + Platform R2.0 Lab (MCP 2.0) + This is the R2.0 lab for Platform on MCP 2.0 + ESSENTIALS + 168.128.2.149 + 2015-08-25T01:39:22.000Z + NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be.xml b/libcloud/test/compute/fixtures/nttcis/network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be.xml new file mode 100644 index 0000000000..bdd1c6b42f --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be.xml @@ -0,0 +1,9 @@ + + + test + test2 + ESSENTIALS + 168.128.26.20 + 2015-07-15T03:36:00.000Z + NORMAL + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_publicIpBlock.xml b/libcloud/test/compute/fixtures/nttcis/network_publicIpBlock.xml new file mode 100644 index 0000000000..3a1c1b381d --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_publicIpBlock.xml @@ -0,0 +1,10 @@ + + + + 8cdfd607-f429-4df6-9352-162cfc0891be + 168.128.4.18 + 2 + 2015-07-13T04:07:37.000Z + NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba.xml b/libcloud/test/compute/fixtures/nttcis/network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba.xml new file mode 100644 index 0000000000..dc8814b47c --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba.xml @@ -0,0 +1,8 @@ + + + 8cdfd607-f429-4df6-9352-162cfc0891be + 168.128.4.18 + 2 + 2015-07-13T04:07:37.000Z + NORMAL + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8.xml b/libcloud/test/compute/fixtures/nttcis/network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8.xml new file mode 100644 index 0000000000..dc8814b47c --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8.xml @@ -0,0 +1,8 @@ + + + 8cdfd607-f429-4df6-9352-162cfc0891be + 168.128.4.18 + 2 + 2015-07-13T04:07:37.000Z + NORMAL + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_removePublicIpBlock.xml b/libcloud/test/compute/fixtures/nttcis/network_removePublicIpBlock.xml new file mode 100644 index 0000000000..8b6fe34e2a --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_removePublicIpBlock.xml @@ -0,0 +1,8 @@ + + +REMOVE_PUBLIC_IP_BLOCK +OK +Public Ip Block bef4334a-844b-11e4-a91c-0030487e0302 has been +removed successfully + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_vlan.xml b/libcloud/test/compute/fixtures/nttcis/network_vlan.xml new file mode 100644 index 0000000000..4575d8393e --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_vlan.xml @@ -0,0 +1,25 @@ + + + + + Primary + + + 10.0.0.1 + + 2607:f480:111:1336:0:0:0:1 + 2015-07-13T03:52:45.000Z + NORMAL + + + + Wi-Fi + Wi-Fi + + 10.230.98.1 + + 2607:f480:111:1199:0:0:0:1 + 2015-08-18T23:47:04.000Z + NORMAL + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/network_vlan_0e56433f_d808_4669_821d_812769517ff8.xml b/libcloud/test/compute/fixtures/nttcis/network_vlan_0e56433f_d808_4669_821d_812769517ff8.xml new file mode 100644 index 0000000000..7dcd5ccf64 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/network_vlan_0e56433f_d808_4669_821d_812769517ff8.xml @@ -0,0 +1,14 @@ + + + +Production VLAN +test2 + +10.0.3.1 + +2607:f480:1111:1153:0:0:0:1 +2015-02-13T10:56:44.000Z +NORMAL + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/oec_0_9_myaccount.xml b/libcloud/test/compute/fixtures/nttcis/oec_0_9_myaccount.xml new file mode 100644 index 0000000000..4f3b132879 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/oec_0_9_myaccount.xml @@ -0,0 +1,26 @@ + + + testuser + Test User + Test + User + test@example.com + 8a8f6abc-2745-4d8a-9cbc-8dabe5a7d0e4 + + + create image + + + reports + + + server + + + primary administrator + + + network + + + diff --git a/libcloud/test/compute/fixtures/nttcis/port_list_create.xml b/libcloud/test/compute/fixtures/nttcis/port_list_create.xml new file mode 100644 index 0000000000..eb1ba7ebe3 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/port_list_create.xml @@ -0,0 +1,9 @@ + + + CREATE_PORT_LIST + OK + Port List 'MyPortList' has been created. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/port_list_delete.xml b/libcloud/test/compute/fixtures/nttcis/port_list_delete.xml new file mode 100644 index 0000000000..6414c2615b --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/port_list_delete.xml @@ -0,0 +1,10 @@ + + + DELETE_PORT_LIST + OK + Port List with Id 84e34850-595d-436e-a885-7cd37edb24a4 has been + deleted. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/port_list_edit.xml b/libcloud/test/compute/fixtures/nttcis/port_list_edit.xml new file mode 100644 index 0000000000..fe95f5706c --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/port_list_edit.xml @@ -0,0 +1,8 @@ + + + EDIT_PORT_LIST + OK + Port List 'MyPortList' has been edited successfully. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/port_list_get.xml b/libcloud/test/compute/fixtures/nttcis/port_list_get.xml new file mode 100644 index 0000000000..815a48b41b --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/port_list_get.xml @@ -0,0 +1,15 @@ + + + MyPortList + Production Servers + + + + + + NORMAL + 2015-06-21T18:54:42.000Z + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/port_list_lists.xml b/libcloud/test/compute/fixtures/nttcis/port_list_lists.xml new file mode 100644 index 0000000000..e42bd47cad --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/port_list_lists.xml @@ -0,0 +1,38 @@ + + + + + MyPortList + Production Servers + + + + + + NORMAL + 2015-06-21T18:54:42.000Z + + + MyPortList2 + Core functions + + + + + NORMAL + 2016-09-01T01:36:49.000Z + + + Test_Port_List_1 + Test Description + + + + NORMAL + 2016-09-06T02:32:29.000Z + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/report_usageMonitoring.xml b/libcloud/test/compute/fixtures/nttcis/report_usageMonitoring.xml new file mode 100644 index 0000000000..dc32d95556 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/report_usageMonitoring.xml @@ -0,0 +1,8 @@ +Date,Location,Server,Server ID,Essentials Monitoring Hours,Advanced Monitoring +Hours +2/24/15,NA5,Server A,5a2378ba-11de-11e5-ad2a-ca9798323470,14.25,0 +2/24/15,NA5,Server B,6330a644-11de-11e5-ad2a-ca9798323470,0,8.64 +2/25/15,NA5,Server A,5a2378ba-11de-11e5-ad2a-ca9798323470,24,0 +2/25/15,NA5,Server B,6330a644-11de-11e5-ad2a-ca9798323470,0,24 +2/26/15,NA5,Server A,5a2378ba-11de-11e5-ad2a-ca9798323470,17.59,6.41 +2/26/15,NA5,Server B,6330a644-11de-11e5-ad2a-ca9798323470,2.11,21.89 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_GetServer.xml b/libcloud/test/compute/fixtures/nttcis/server_GetServer.xml new file mode 100644 index 0000000000..1103422653 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_GetServer.xml @@ -0,0 +1,42 @@ + + + Production Web Server + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + stopped + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + + **OR** + + diff --git a/libcloud/test/compute/fixtures/nttcis/server_addDisk.xml b/libcloud/test/compute/fixtures/nttcis/server_addDisk.xml new file mode 100644 index 0000000000..4e49bd5f4f --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_addDisk.xml @@ -0,0 +1,9 @@ + + + ADD_DISK + IN_PROGRESS + The request to add a 20 GB Standard Speed Disk on Server 'SERVER-1' has been accepted and is being processed. + + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_addNic.xml b/libcloud/test/compute/fixtures/nttcis/server_addNic.xml new file mode 100644 index 0000000000..56eeb024b2 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_addNic.xml @@ -0,0 +1,9 @@ + + +ADD_NIC +IN_PROGRESS +The request to add NIC for VLAN 'Subsystem VLAN' on Server +'Production Mail Server' has been accepted and is being processed.. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_antiAffinityRule_list.xml b/libcloud/test/compute/fixtures/nttcis/server_antiAffinityRule_list.xml new file mode 100644 index 0000000000..290b7e4010 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_antiAffinityRule_list.xml @@ -0,0 +1,42 @@ + + + + + ansible-test-image-rhel6 + my new node + + + + + + + ansible-custom-image-test-UAT + my new node + + + + + + + + + + rhel-ansible-full-test + RHEL Ansible Test + + + + + + + + rhel-ansible-full-test + RHEL Ansible Test + + + + + + + + diff --git a/libcloud/test/compute/fixtures/nttcis/server_antiAffinityRule_list_PAGINATED.xml b/libcloud/test/compute/fixtures/nttcis/server_antiAffinityRule_list_PAGINATED.xml new file mode 100644 index 0000000000..fdd5e01e12 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_antiAffinityRule_list_PAGINATED.xml @@ -0,0 +1,42 @@ + + + + + ansible-test-image-rhel6 + my new node + + + + + + + ansible-custom-image-test-UAT + my new node + + + + + + + + + + rhel-ansible-full-test + RHEL Ansible Test + + + + + + + + rhel-ansible-full-test + RHEL Ansible Test + + + + + + + + diff --git a/libcloud/test/compute/fixtures/nttcis/server_changeServerMonitoringPlan.xml b/libcloud/test/compute/fixtures/nttcis/server_changeServerMonitoringPlan.xml new file mode 100644 index 0000000000..654097d6af --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_changeServerMonitoringPlan.xml @@ -0,0 +1,8 @@ + + +CHANGE_SERVER_MONITORING_PLAN +OK +Monitoring on Server 'Production Server' has been changed to +Service Plan 'ADVANCED'. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_cleanServer.xml b/libcloud/test/compute/fixtures/nttcis/server_cleanServer.xml new file mode 100644 index 0000000000..011dfd4085 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_cleanServer.xml @@ -0,0 +1,9 @@ + + +CLEAN_SERVER +IN_PROGRESS +The request to clean a failed Server deployment for Server +e75ead52-692f-4314-8725-c8a4f4d13a87 has been accepted and is being processed. + diff --git a/libcloud/test/compute/fixtures/nttcis/server_clone_response.xml b/libcloud/test/compute/fixtures/nttcis/server_clone_response.xml new file mode 100644 index 0000000000..8f7c191d19 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_clone_response.xml @@ -0,0 +1,9 @@ + + CLONE_SERVER + IN_PROGRESS + Request to Clone Server '9ed47330-5561-11e5-8c14-b8ca3a5d9ef8' has been +accepted and is being processed. + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_createAntiAffinityRule.xml b/libcloud/test/compute/fixtures/nttcis/server_createAntiAffinityRule.xml new file mode 100644 index 0000000000..296dae2da4 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_createAntiAffinityRule.xml @@ -0,0 +1,6 @@ + + + CREATE_ANTI_AFFINITY_RULE + IN_PROGRESS + Request to Create Anti-Affinity Rule has been accepted. Please use appropriate Get or List API for status. + diff --git a/libcloud/test/compute/fixtures/nttcis/server_createAntiAffinityRule_FAIL.xml b/libcloud/test/compute/fixtures/nttcis/server_createAntiAffinityRule_FAIL.xml new file mode 100644 index 0000000000..2c625ad2d4 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_createAntiAffinityRule_FAIL.xml @@ -0,0 +1,8 @@ + + + >CREATE_ANTI_AFFINITY_RULE + CONFIGURATION_NOT_SUPPORTED + Server 'ansible-test-image-rhel6' (id 22f3544a-c874-4930-a31c-e9e513e51114) is already used in another Anti-Affinity Rule (id 07e3621a-a920-4a9a-943c-d8021f27f418) + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_deleteAntiAffinityRule.xml b/libcloud/test/compute/fixtures/nttcis/server_deleteAntiAffinityRule.xml new file mode 100644 index 0000000000..b5967e5cf6 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_deleteAntiAffinityRule.xml @@ -0,0 +1,7 @@ + + + DELETE_ANTI_AFFINITY_RULE + IN_PROGRESS + Request to Delete Anti-Affinity Rule has been accepted. Please use appropriate Get or List API for status. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_deleteAntiAffinityRule_FAIL.xml b/libcloud/test/compute/fixtures/nttcis/server_deleteAntiAffinityRule_FAIL.xml new file mode 100644 index 0000000000..8cee9e0073 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_deleteAntiAffinityRule_FAIL.xml @@ -0,0 +1,8 @@ + + + >CREATE_ANTI_AFFINITY_RULE + RESOURCE_NOT_FOUND + Anti-Affinity Rule '07e3621a-a920-4a9a-943c-d8021f27f418' not found + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_deleteServer.xml b/libcloud/test/compute/fixtures/nttcis/server_deleteServer.xml new file mode 100644 index 0000000000..c8e70dad6e --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_deleteServer.xml @@ -0,0 +1,9 @@ + + +DELETE_SERVER +IN_PROGRESS +Request to Delete Server (Id:d577a691-e116-4913-a440- +022d2729fc84) has been accepted and is being processed + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_deleteServer_RESOURCEBUSY.xml b/libcloud/test/compute/fixtures/nttcis/server_deleteServer_RESOURCEBUSY.xml new file mode 100644 index 0000000000..2df9e07c3b --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_deleteServer_RESOURCEBUSY.xml @@ -0,0 +1,8 @@ + + +DELETE_SERVER +RESOURCE_BUSY +Server is already busy + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_deployServer.xml b/libcloud/test/compute/fixtures/nttcis/server_deployServer.xml new file mode 100644 index 0000000000..05108c5ec5 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_deployServer.xml @@ -0,0 +1,8 @@ + + +DEPLOY +IN_PROGRESS +Request to deploy Server 'Production FTPS Server' has been +accepted and is being processed. + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_disableServerMonitoring.xml b/libcloud/test/compute/fixtures/nttcis/server_disableServerMonitoring.xml new file mode 100644 index 0000000000..63609de1a7 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_disableServerMonitoring.xml @@ -0,0 +1,8 @@ + + +DISABLE_SERVER_MONITORING +OK +Monitoring on Server 5783e93f-5370-44fc-a772-cd3c29a2ecaa has +been disabled. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_editServerMetadata.xml b/libcloud/test/compute/fixtures/nttcis/server_editServerMetadata.xml new file mode 100644 index 0000000000..19358e020d --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_editServerMetadata.xml @@ -0,0 +1,6 @@ + + +EDIT_SERVER_METADATA +OK +Server 'Production Server' has been edited successfully. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_enableServerMonitoring.xml b/libcloud/test/compute/fixtures/nttcis/server_enableServerMonitoring.xml new file mode 100644 index 0000000000..9b1b555412 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_enableServerMonitoring.xml @@ -0,0 +1,8 @@ + + +ENABLE_SERVER_MONITORING +OK +Monitoring on Server 'Production Server' has been +enabled. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_powerOffServer.xml b/libcloud/test/compute/fixtures/nttcis/server_powerOffServer.xml new file mode 100644 index 0000000000..549ea79832 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_powerOffServer.xml @@ -0,0 +1,8 @@ + + +POWER_OFF_SERVER +IN_PROGRESS +Request to power off Server 'Production Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_powerOffServer_INPROGRESS.xml b/libcloud/test/compute/fixtures/nttcis/server_powerOffServer_INPROGRESS.xml new file mode 100644 index 0000000000..8ddcca918e --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_powerOffServer_INPROGRESS.xml @@ -0,0 +1,8 @@ + + +POWER_OFF_SERVER +RESOURCE_BUSY +Request to power off Server 'Production Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_rebootServer.xml b/libcloud/test/compute/fixtures/nttcis/server_rebootServer.xml new file mode 100644 index 0000000000..38f098a08c --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_rebootServer.xml @@ -0,0 +1,8 @@ + + +REBOOT_SERVER +IN_PROGRESS +Request to reboot Server 'Production Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_rebootServer_RESOURCEBUSY.xml b/libcloud/test/compute/fixtures/nttcis/server_rebootServer_RESOURCEBUSY.xml new file mode 100644 index 0000000000..3defba48a2 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_rebootServer_RESOURCEBUSY.xml @@ -0,0 +1,7 @@ + + +REBOOT_SERVER +RESOURCE_BUSY +Request to reboot Server 'Production Server' did not work, server is busy. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_reconfigureServer.xml b/libcloud/test/compute/fixtures/nttcis/server_reconfigureServer.xml new file mode 100644 index 0000000000..e28e8d75fc --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_reconfigureServer.xml @@ -0,0 +1,5 @@ + + RECONFIGURE_SERVER + OK + Request to reconfigure Server 'Production Server' has been accepted and is being processed. + diff --git a/libcloud/test/compute/fixtures/nttcis/server_removeDisk.xml b/libcloud/test/compute/fixtures/nttcis/server_removeDisk.xml new file mode 100644 index 0000000000..8b2d17f038 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_removeDisk.xml @@ -0,0 +1,6 @@ + + + REMOVE_DISK + IN_PROGRESS + Request to Remove disk '540c4d86-4d84-11e4-a91c-0030487e0302' from Server 'Server 1' has been accepted and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_removeNic.xml b/libcloud/test/compute/fixtures/nttcis/server_removeNic.xml new file mode 100644 index 0000000000..61be4e32f1 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_removeNic.xml @@ -0,0 +1,9 @@ + + +REMOVE_NIC +IN_PROGRESS +Request to Remove NIC 5999db1d-725c-46ba-9d4e-d33991e61ab1 for +VLAN 'Subsystem VLAN' from Server 'Production Mail Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_resetServer.xml b/libcloud/test/compute/fixtures/nttcis/server_resetServer.xml new file mode 100644 index 0000000000..ece1a8bb41 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_resetServer.xml @@ -0,0 +1,8 @@ + + +RESET_SERVER +IN_PROGRESS +Request to reset Server 'Production Server' has been accepted and +is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_server.xml b/libcloud/test/compute/fixtures/nttcis/server_server.xml new file mode 100644 index 0000000000..bad0c4d3c8 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_server.xml @@ -0,0 +1,207 @@ + + + + + Production Web Server MCP 1 + nopassword0 + + + + + + 2 + + + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + NORMAL + + + + + Production Web Server MCP 1 + nopassword0 + + + + + + 2 + + + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + PENDING_ADD + + DEPLOY_SERVER_WITH_DISK_SPEED + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + + + + 4 + + + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + 4 + + + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + RECONFIGURE_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + + + + 4 + + + + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + UNKNOWN + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + Production Web Server MCP 21 + Server to host our main web application. + + 4 + + + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + false + UNKNOWN + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + 4 + + + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + false + NORMAL + + + + + + + diff --git a/libcloud/test/compute/fixtures/nttcis/server_server_NA3.xml b/libcloud/test/compute/fixtures/nttcis/server_server_NA3.xml new file mode 100644 index 0000000000..56e4492d76 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_server_NA3.xml @@ -0,0 +1,56 @@ + + + + + Production Web Server MCP 1 + nopassword0 + + + 2 + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + NORMAL + + + + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + + + diff --git a/libcloud/test/compute/fixtures/nttcis/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml b/libcloud/test/compute/fixtures/nttcis/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml new file mode 100644 index 0000000000..c933f29a3a --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml @@ -0,0 +1,30 @@ + + + Production Web Server + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + DEPLOY_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + diff --git a/libcloud/test/compute/fixtures/nttcis/server_server_paginated.xml b/libcloud/test/compute/fixtures/nttcis/server_server_paginated.xml new file mode 100644 index 0000000000..575d245955 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_server_paginated.xml @@ -0,0 +1,58 @@ + + + + + Production Web Server MCP 1 + nopassword0 + + + 2 + + + + + e9ec6eb4-4634-49de-b914-01eb74da5fb9 + 2015-08-11T16:51:05.000Z + true + true + NORMAL + + + + + + + + + Production Web Server MCP 2 + Server to host our main web application. + + + 4 + + + + + + + MSSQL2008R2S + 3ebf3c0f-90fe-4a8b-8585-6e65b316592c + 2015-12-02T10:31:33.000Z + true + true + PENDING_CHANGE + + SHUTDOWN_SERVER + 2015-12-02T11:07:40.000Z + devuser1 + + + + + + + + + diff --git a/libcloud/test/compute/fixtures/nttcis/server_server_paginated_empty.xml b/libcloud/test/compute/fixtures/nttcis/server_server_paginated_empty.xml new file mode 100644 index 0000000000..31f4c55d43 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_server_paginated_empty.xml @@ -0,0 +1 @@ + diff --git a/libcloud/test/compute/fixtures/nttcis/server_shutdownServer.xml b/libcloud/test/compute/fixtures/nttcis/server_shutdownServer.xml new file mode 100644 index 0000000000..937cb0d563 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_shutdownServer.xml @@ -0,0 +1,8 @@ + + +SHUTDOWN_SERVER +IN_PROGRESS +Request to shutdown Server 'Production Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_shutdownServer_INPROGRESS.xml b/libcloud/test/compute/fixtures/nttcis/server_shutdownServer_INPROGRESS.xml new file mode 100644 index 0000000000..386489cdc9 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_shutdownServer_INPROGRESS.xml @@ -0,0 +1,8 @@ + + +SHUTDOWN_SERVER +RESOURCE_BUSY +Request to shutdown Server 'Production Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_startServer.xml b/libcloud/test/compute/fixtures/nttcis/server_startServer.xml new file mode 100644 index 0000000000..4fb4589bb5 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_startServer.xml @@ -0,0 +1,8 @@ + + +START_SERVER +IN_PROGRESS +Request to start Server 'Production Server' has been accepted and +is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_startServer_INPROGRESS.xml b/libcloud/test/compute/fixtures/nttcis/server_startServer_INPROGRESS.xml new file mode 100644 index 0000000000..f5c30708b6 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_startServer_INPROGRESS.xml @@ -0,0 +1,8 @@ + + +START_SERVER +RESOURCE_BUSY +Request to start Server 'Production Server' has been accepted and +is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/server_updateVmwareTools.xml b/libcloud/test/compute/fixtures/nttcis/server_updateVmwareTools.xml new file mode 100644 index 0000000000..549ea79832 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/server_updateVmwareTools.xml @@ -0,0 +1,8 @@ + + +POWER_OFF_SERVER +IN_PROGRESS +Request to power off Server 'Production Server' has been accepted +and is being processed. + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/summary_usage_report.csv b/libcloud/test/compute/fixtures/nttcis/summary_usage_report.csv new file mode 100644 index 0000000000..e4b78e03fb --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/summary_usage_report.csv @@ -0,0 +1,13 @@ +DAY,Location,CPU Hours,RAM Hours,Storage Hours,Performance Storage +Hours,Bandwidth In,Bandwidth Out,Sub-Admin Hours,Network Hours,Public IP +Hours,Cloud Files Account Hours,Cloud Files (GB Days),Software +Units,Essentials Client Days,Advanced Client Days,Enterprise Client +Days,Essentials Backups (GB),Advanced Backups (GB),Enterprise Backups (GB) +01/01/2013,NA1,144,288,3360,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +02/01/2013,NA1,144,288,3360,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +03/01/2013,NA1,144,288,3360,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +04/01/2013,NA1,144,288,3360,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +05/01/2013,NA1,144,288,3360,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +06/01/2013,NA1,172,344,3958,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +07/01/2013,NA1,205,410,4783,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 +08/01/2013,NA1,216,432,5136,264,0,0,72,24,0,0,0,0,0,0,0,0,0,0 \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/nttcis/tag_applyTags.xml b/libcloud/test/compute/fixtures/nttcis/tag_applyTags.xml new file mode 100644 index 0000000000..91114bb38e --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_applyTags.xml @@ -0,0 +1,6 @@ + + + APPLY_TAGS + OK + Tag(s) successfully applied. + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_applyTags_BADREQUEST.xml b/libcloud/test/compute/fixtures/nttcis/tag_applyTags_BADREQUEST.xml new file mode 100644 index 0000000000..dec66ad77b --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_applyTags_BADREQUEST.xml @@ -0,0 +1,6 @@ + + + APPLY_TAGS + RESOURCE_NOT_FOUND + Tag Key(s) (ChangeNameTes) not found. + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_createTagKey.xml b/libcloud/test/compute/fixtures/nttcis/tag_createTagKey.xml new file mode 100644 index 0000000000..927812dc26 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_createTagKey.xml @@ -0,0 +1,7 @@ + + + CREATE_TAG_KEY + OK + Tag Key 'MyTestKey' has been created. + + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_createTagKey_BADREQUEST.xml b/libcloud/test/compute/fixtures/nttcis/tag_createTagKey_BADREQUEST.xml new file mode 100644 index 0000000000..eaa73abd55 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_createTagKey_BADREQUEST.xml @@ -0,0 +1,6 @@ + + + CREATE_TAG_KEY + NAME_NOT_UNIQUE + Another Tag Key named 'MyTestKey' already exists. + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_deleteTagKey.xml b/libcloud/test/compute/fixtures/nttcis/tag_deleteTagKey.xml new file mode 100644 index 0000000000..9fa8b5925b --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_deleteTagKey.xml @@ -0,0 +1,6 @@ + + + DELETE_TAG_KEY + OK + Tag Key (Id:4f921962-402d-438d-aa37-6f6a0392a1a9) has been deleted. + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_deleteTagKey_BADREQUEST.xml b/libcloud/test/compute/fixtures/nttcis/tag_deleteTagKey_BADREQUEST.xml new file mode 100644 index 0000000000..357f2d8e24 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_deleteTagKey_BADREQUEST.xml @@ -0,0 +1,6 @@ + + + DELETE_TAG_KEY + RESOURCE_NOT_FOUND + Tag Key fdafdsa not found. + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_editTagKey.xml b/libcloud/test/compute/fixtures/nttcis/tag_editTagKey.xml new file mode 100644 index 0000000000..f5e4d771ac --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_editTagKey.xml @@ -0,0 +1,6 @@ + + + EDIT_TAG_KEY + OK + Tag Key 'ChangeNameTest' has been edited. + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_editTagKey_BADREQUEST.xml b/libcloud/test/compute/fixtures/nttcis/tag_editTagKey_BADREQUEST.xml new file mode 100644 index 0000000000..cb0c706f2f --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_editTagKey_BADREQUEST.xml @@ -0,0 +1,6 @@ + + + EDIT_TAG_KEY + NO_CHANGE + At least one of name, description, valueRequired or displayOnReport must be changed from its current value. + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_removeTag.xml b/libcloud/test/compute/fixtures/nttcis/tag_removeTag.xml new file mode 100644 index 0000000000..1d3c9a3303 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_removeTag.xml @@ -0,0 +1,6 @@ + + + REMOVE_TAGS + OK + Tag(s) successfully removed. + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_removeTag_BADREQUEST.xml b/libcloud/test/compute/fixtures/nttcis/tag_removeTag_BADREQUEST.xml new file mode 100644 index 0000000000..c686a20fad --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_removeTag_BADREQUEST.xml @@ -0,0 +1,6 @@ + + + REMOVE_TAGS + RESOURCE_NOT_FOUND + Tag Key(s) (AaronTestModified) not applied to Server eb222a4a-fffd-4e4a-8346-1279ef621ab0. + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54.xml b/libcloud/test/compute/fixtures/nttcis/tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54.xml new file mode 100644 index 0000000000..6d1aa13583 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54.xml @@ -0,0 +1,6 @@ + + + LibcloudTest + true + true + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54_BADREQUEST.xml b/libcloud/test/compute/fixtures/nttcis/tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54_BADREQUEST.xml new file mode 100644 index 0000000000..d585d5a2b4 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54_BADREQUEST.xml @@ -0,0 +1,6 @@ + + + GET_TAG_KEY + RESOURCE_NOT_FOUND + Tag Key 5ab77f5f-5aa9-426f-8459-4eab34e03d5 not found. + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_tagKey_list.xml b/libcloud/test/compute/fixtures/nttcis/tag_tagKey_list.xml new file mode 100644 index 0000000000..a75b8c5746 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_tagKey_list.xml @@ -0,0 +1,19 @@ + + + + AaronTestModified + Testing for VMWare + true + true + + + LibcloudTest + true + true + + + MyTestKey + true + true + + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_tagKey_list_SINGLE.xml b/libcloud/test/compute/fixtures/nttcis/tag_tagKey_list_SINGLE.xml new file mode 100644 index 0000000000..8deaa969a9 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_tagKey_list_SINGLE.xml @@ -0,0 +1,8 @@ + + + + LibcloudTest + true + true + + diff --git a/libcloud/test/compute/fixtures/nttcis/tag_tag_list.xml b/libcloud/test/compute/fixtures/nttcis/tag_tag_list.xml new file mode 100644 index 0000000000..d79b648bd8 --- /dev/null +++ b/libcloud/test/compute/fixtures/nttcis/tag_tag_list.xml @@ -0,0 +1,36 @@ + + + + SERVER + 09242b55-3bc8-4cb7-b30c-4158267f58e6 + App server + NA9 + 5ab77f5f-5aa9-426f-8459-4eab34e03d54 + ChangeNameTest + No way! + true + true + + + NETWORK_DOMAIN + 1a16bf5e-583b-42c9-af94-a92d9ee1607f + An Ho1a Demo + NA9 + d047c609-93d7-4bc5-8fc9-732c85840075 + AaronTestModified + Success + true + true + + + SERVER + 77da591d-b58e-43ef-8bc2-ddde3f732893 + Test 1 + NA9 + d047c609-93d7-4bc5-8fc9-732c85840075 + AaronTestModified + Test VMware + true + true + + diff --git a/libcloud/test/compute/fixtures/onapp/create_node.json b/libcloud/test/compute/fixtures/onapp/create_node.json new file mode 100644 index 0000000000..435d92e4a7 --- /dev/null +++ b/libcloud/test/compute/fixtures/onapp/create_node.json @@ -0,0 +1,87 @@ +{ + "virtual_machine": { + "add_to_marketplace": false, + "admin_note": "", + "allow_resize_without_reboot": true, + "allowed_hot_migrate": true, + "allowed_swap": true, + "booted": true, + "built": true, + "cpu_priority": 100, + "cpu_shares": 100, + "cpu_sockets": 1, + "cpu_threads": 1, + "cpu_units": 1000, + "cpus": 2, + "created_at": "2015-01-16T02:06:19+07:00", + "customer_network_id": "", + "deleted_at": "", + "edge_server_type": "", + "enable_autoscale": false, + "enable_monitis": false, + "firewall_notrack": false, + "hostname": "onapp-new-fred", + "hypervisor_id": 24, + "id": 652, + "identifier": "456789", + "initial_root_password": "passwd", + "initial_root_password_encrypted": false, + "ip_addresses": [ + { + "ip_address": { + "address": "192.168.15.73", + "broadcast": "192.168.15.255", + "created_at": "2015-01-16T02:49:58+07:00", + "customer_network_id": "", + "disallowed_primary": false, + "free": false, + "gateway": "192.168.15.51", + "hypervisor_id": "", + "id": 2947, + "ip_address_pool_id": "", + "netmask": "255.255.255.0", + "network_address": "192.168.15.0", + "network_id": 39, + "pxe": false, + "updated_at": "2015-01-20T22:42:14+07:00", + "user_id": "" + } + } + ], + "label": "onapp-new-fred", + "local_remote_access_ip_address": "8.8.8.8", + "local_remote_access_port": 5967, + "locked": false, + "memory": 8192, + "min_disk_size": 5, + "monthly_bandwidth_used": 1887, + "note": "", + "operating_system": "linux", + "operating_system_distro": "ubunt", + "preferred_hvs": [ + 5, + 4, + 2, + 3, + 1, + 6 + ], + "price_per_hour": 0.0, + "price_per_hour_powered_off": 0.0, + "recovery_mode": "", + "remote_access_password": "passwd", + "service_password": "", + "state": "delivered", + "storage_server_type": "", + "strict_virtual_machine_id": "", + "support_incremental_backups": false, + "suspended": false, + "template_id": 93, + "template_label": "Ubuntu 12.04 x64", + "total_disk_size": 410, + "updated_at": "2015-02-28T07:54:47+07:00", + "user_id": 136, + "vip": "", + "xen_id": 161 + } +} diff --git a/libcloud/test/compute/fixtures/onapp/get_key_pair.json b/libcloud/test/compute/fixtures/onapp/get_key_pair.json new file mode 100644 index 0000000000..654861ad6c --- /dev/null +++ b/libcloud/test/compute/fixtures/onapp/get_key_pair.json @@ -0,0 +1,9 @@ +{ + "ssh_key": { + "id": 1, + "user_id": 123, + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8uuUqh0cXhx5s9AxlQHCWzQoS9w0qy/WN/I/CZuy4p+mQYhOYSqBi/aqf4/wySyOtzez785IGBriX24zk6vMcfSuB7wgHzCGZ433zAkdZu39nPPpCo3WWZmJ3GKYjEN+yNJNG8kR3OW3N0mRSId3ebFZoLUafli8sSt6XeXHgeLPfEvbpiEdKxHskRsZHP8JoM2tQD9Ms5/9KPbbhg4geeu9FO28kozacBdyQMS1db+45b9xz0L9GPYO0NasESq9cC4BvlhPvAFHDT1kio6DjjhZ5kUK7OcmRK+8/Jk+9cTSj9MzVMCwRni3HyA37/Mu4qBpDkR9sPwgJ9G/UY7ZP John@Johns-MacBook-Pro", + "created_at": "2017-03-22T19:11:32.000+05:30", + "updated_at": "2017-03-22T19:11:32.000+05:30" + } +} diff --git a/libcloud/test/compute/fixtures/onapp/import_key_pair.json b/libcloud/test/compute/fixtures/onapp/import_key_pair.json new file mode 100644 index 0000000000..b80b162f49 --- /dev/null +++ b/libcloud/test/compute/fixtures/onapp/import_key_pair.json @@ -0,0 +1,9 @@ +{ + "ssh_key": { + "id": 3, + "user_id": 123, + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8uuUq", + "created_at": "2017-03-22T19:11:32.000+05:30", + "updated_at": "2017-03-22T19:11:32.000+05:30" + } +} diff --git a/libcloud/test/compute/fixtures/onapp/list_images.json b/libcloud/test/compute/fixtures/onapp/list_images.json new file mode 100644 index 0000000000..aa70f32987 --- /dev/null +++ b/libcloud/test/compute/fixtures/onapp/list_images.json @@ -0,0 +1,47 @@ +[ + { + "image_template": { + "allow_resize_without_reboot": true, + "allowed_hot_migrate": true, + "allowed_swap": true, + "application_server": false, + "backup_server_id": "", + "baremetal_server": true, + "cdn": false, + "checksum": "f3ea0b39051d9c5fef3f7661c6318111", + "created_at": "2015-03-12T19:56:02+05:30", + "disk_target_device": "--- xen: sda kvm: hd ", + "draas": false, + "ext4": false, + "file_name": "centos-5.11-x64-1.1-xen.kvm.kvm_virtio.tar.gz", + "id": 123456, + "initial_password": "Password1", + "initial_username": "root", + "label": "CentOS 5.11 x64", + "manager_id": "", + "min_disk_size": 5, + "min_memory_size": 256, + "operating_system": "linux", + "operating_system_arch": "x64", + "operating_system_distro": "rhel", + "operating_system_edition": "", + "operating_system_tail": "", + "parent_template_id": "", + "properties": "", + "remote_id": "", + "resize_without_reboot_policy": {}, + "smart_server": true, + "state": "active", + "template_size": 323924, + "updated_at": "", + "user_id": "", + "version": "1.1", + "virtualization": [ + "xen", + "kvm", + "kvm_virtio" + ], + "type": "ImageTemplate" + } + } +] diff --git a/libcloud/test/compute/fixtures/onapp/list_key_pairs.json b/libcloud/test/compute/fixtures/onapp/list_key_pairs.json new file mode 100644 index 0000000000..2ee58c50ec --- /dev/null +++ b/libcloud/test/compute/fixtures/onapp/list_key_pairs.json @@ -0,0 +1,20 @@ +[ + { + "ssh_key": { + "id": 1, + "user_id": 123, + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8uuUqh0cXhx5s9AxlQHCWzQoS9w0qy/WN/I/CZuy4p+mQYhOYSqBi/aqf4/wySyOtzez785IGBriX24zk6vMcfSuB7wgHzCGZ433zAkdZu39nPPpCo3WWZmJ3GKYjEN+yNJNG8kR3OW3N0mRSId3ebFZoLUafli8sSt6XeXHgeLPfEvbpiEdKxHskRsZHP8JoM2tQD9Ms5/9KPbbhg4geeu9FO28kozacBdyQMS1db+45b9xz0L9GPYO0NasESq9cC4BvlhPvAFHDT1kio6DjjhZ5kUK7OcmRK+8/Jk+9cTSj9MzVMCwRni3HyA37/Mu4qBpDkR9sPwgJ9G/UY7ZP John@Johns-MacBook-Pro", + "created_at": "2017-03-22T19:11:32.000+05:30", + "updated_at": "2017-03-22T19:11:32.000+05:30" + } + }, + { + "ssh_key": { + "id": 2, + "user_id": 123, + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCx/N6Mm/8BapBlTPhjnrj06yyAKYDTfBgIOzhPzdq1rco6FS7JVUot3zY4pX3ZUkLJh5JDsNz9FyqyGpXBzO3G7QpDhGggjqfYxpsR9VQBDNC8YKpQdaa6j2s1yJsI0cb+/sQl9SC/9WyBCceK3mzPt5AsSzdY0hA2+jPYuCzvTT/S0qfsk2WyvA+fK7ue7yWD/8KSNQx2/xsP3GU+/Ck5D7w+8ck1oUVXAFoO/WUIEwbx5u9wurv73GsK6Pqgt1tjtNznS50JsyHmayeZzrX1hr33PE9IarlUzWAUj4zvpdDTpCm/u2f2UnmSJJ0cT45NUUG085WTyhy2ZHBz3jOT John@Johns-iMac", + "created_at": "2017-03-24T14:31:24.000+05:30", + "updated_at": "2017-03-24T14:31:24.000+05:30" + } + } +] diff --git a/libcloud/test/compute/fixtures/onapp/list_nodes.json b/libcloud/test/compute/fixtures/onapp/list_nodes.json new file mode 100644 index 0000000000..2b3b8f2f9a --- /dev/null +++ b/libcloud/test/compute/fixtures/onapp/list_nodes.json @@ -0,0 +1,89 @@ +[ + { + "virtual_machine": { + "add_to_marketplace": false, + "admin_note": "", + "allow_resize_without_reboot": true, + "allowed_hot_migrate": true, + "allowed_swap": true, + "booted": true, + "built": true, + "cpu_priority": 100, + "cpu_shares": 100, + "cpu_sockets": 1, + "cpu_threads": 1, + "cpu_units": 1000, + "cpus": 2, + "created_at": "2015-01-16T02:06:19+07:00", + "customer_network_id": "", + "deleted_at": "", + "edge_server_type": "", + "enable_autoscale": false, + "enable_monitis": false, + "firewall_notrack": false, + "hostname": "onapp-fred", + "hypervisor_id": 24, + "id": 652, + "identifier": "123456", + "initial_root_password": "passwd", + "initial_root_password_encrypted": false, + "ip_addresses": [ + { + "ip_address": { + "address": "192.168.15.72", + "broadcast": "192.168.15.255", + "created_at": "2015-01-16T02:49:58+07:00", + "customer_network_id": "", + "disallowed_primary": false, + "free": false, + "gateway": "192.168.15.51", + "hypervisor_id": "", + "id": 2947, + "ip_address_pool_id": "", + "netmask": "255.255.255.0", + "network_address": "192.168.15.0", + "network_id": 39, + "pxe": false, + "updated_at": "2015-01-20T22:42:14+07:00", + "user_id": "" + } + } + ], + "label": "onapp-fred", + "local_remote_access_ip_address": "9.9.9.9", + "local_remote_access_port": 5967, + "locked": false, + "memory": 8192, + "min_disk_size": 5, + "monthly_bandwidth_used": 1887, + "note": "", + "operating_system": "linux", + "operating_system_distro": "ubunt", + "preferred_hvs": [ + 5, + 4, + 2, + 3, + 1, + 6 + ], + "price_per_hour": 0.0, + "price_per_hour_powered_off": 0.0, + "recovery_mode": "", + "remote_access_password": "passwd", + "service_password": "", + "state": "delivered", + "storage_server_type": "", + "strict_virtual_machine_id": "", + "support_incremental_backups": false, + "suspended": false, + "template_id": 93, + "template_label": "Ubuntu 12.04 x64", + "total_disk_size": 410, + "updated_at": "2015-02-28T07:54:47+07:00", + "user_id": 136, + "vip": "", + "xen_id": 161 + } + } +] diff --git a/libcloud/test/compute/fixtures/onapp/profile.json b/libcloud/test/compute/fixtures/onapp/profile.json new file mode 100644 index 0000000000..5c3ae2626c --- /dev/null +++ b/libcloud/test/compute/fixtures/onapp/profile.json @@ -0,0 +1,12 @@ +{ + "user": { + "id": 123, + "identifier": "abcdef123345", + "email": "abc@example.com", + "first_name": "John", + "last_name": "Smith", + "status": "active", + "created_at": "2017-03-22T20:39:36.000+07:00", + "updated_at": "2017-03-22T20:39:36.000+07:00" + } +} diff --git a/libcloud/test/compute/fixtures/openstack/_v1_1__auth.json b/libcloud/test/compute/fixtures/openstack/_v1_1__auth.json index 365551d952..50d931fa84 100644 --- a/libcloud/test/compute/fixtures/openstack/_v1_1__auth.json +++ b/libcloud/test/compute/fixtures/openstack/_v1_1__auth.json @@ -2,7 +2,7 @@ "auth": { "token": { "id": "aaaaaaaaaaaa-bbb-cccccccccccccc", - "expires": "2031-11-23T21:00:14-06:00" + "expires": "2999-11-23T21:00:14-06:00" }, "serviceCatalog": { "cloudFilesCDN": [ diff --git a/libcloud/test/compute/fixtures/openstack/_v2_0__auth.json b/libcloud/test/compute/fixtures/openstack/_v2_0__auth.json index c40a8ee21c..3c9f5a7056 100644 --- a/libcloud/test/compute/fixtures/openstack/_v2_0__auth.json +++ b/libcloud/test/compute/fixtures/openstack/_v2_0__auth.json @@ -2,7 +2,7 @@ "access": { "token": { "id": "aaaaaaaaaaaa-bbb-cccccccccccccc", - "expires": "2031-11-23T21:00:14.000-06:00" + "expires": "2999-11-23T21:00:14.000-06:00" }, "serviceCatalog": [ { @@ -59,15 +59,125 @@ { "region": "RegionOne", "tenantId": "1337", - "publicURL": "https://127.0.0.1/v2/1337", - "versionInfo": "https://127.0.0.1/v2/", - "versionList": "https://127.0.0.1/", + "publicURL": "https://test_endpoint.com/v2/1337", + "versionInfo": "https://test_endpoint.com/v2/", + "versionList": "https://test_endpoint.com/", + "versionId": "2" + }, + { + "region": "fr1", + "tenantId": "1337", + "publicURL": "https://test_endpoint.com/v2/1337", + "versionInfo": "https://test_endpoint.com/v2/", + "versionList": "https://test_endpoint.com/", "versionId": "2" } ], "name": "nova", "type": "compute" }, + { + "endpoints": [ + { + "region": "RegionOne", + "tenantId": "1337", + "publicURL": "https://test_endpoint.com/v2/1337", + "versionInfo": "https://test_endpoint.com/v2/", + "versionList": "https://test_endpoint.com/", + "versionId": "2" + }, + { + "region": "fr1", + "tenantId": "1337", + "publicURL": "https://test_endpoint.com/v2/1337", + "versionInfo": "https://test_endpoint.com/v2/", + "versionList": "https://test_endpoint.com/", + "versionId": "2" + } + ], + "name": "glance", + "type": "image" + }, + { + "endpoints": [ + { + "region": "RegionOne", + "tenantId": "1337", + "publicURL": "https://test_endpoint.com/v2/1337", + "versionInfo": "https://test_endpoint.com/v2/", + "versionList": "https://test_endpoint.com/", + "versionId": "2" + }, + { + "region": "fr1", + "tenantId": "1337", + "publicURL": "https://test_endpoint.com/v2/1337", + "versionInfo": "https://test_endpoint.com/v2/", + "versionList": "https://test_endpoint.com/", + "versionId": "2" + } + ], + "name": "neutron", + "type": "network" + }, + { + "endpoints": [ + { + "region": "RegionOne", + "tenantId": "1337", + "publicURL": "https://test_endpoint.com/v2/1337", + "versionInfo": "https://test_endpoint.com/v2/", + "versionList": "https://test_endpoint.com/", + "versionId": "2" + }, + { + "region": "fr1", + "tenantId": "1337", + "publicURL": "https://test_endpoint.com/v2/1337", + "versionInfo": "https://test_endpoint.com/v2/", + "versionList": "https://test_endpoint.com/", + "versionId": "2" + } + ], + "name": "cinderv2", + "type": "volumev2" + }, + { + "endpoints": [ + { + "region": "RegionOne", + "tenantId": "1337", + "publicURL": "https://test_endpoint.com/v3/1337", + "versionInfo": "https://test_endpoint.com/v3/", + "versionList": "https://test_endpoint.com/", + "versionId": "2" + }, + { + "region": "fr1", + "tenantId": "1337", + "publicURL": "https://test_endpoint.com/v3/1337", + "versionInfo": "https://test_endpoint.com/v3/", + "versionList": "https://test_endpoint.com/", + "versionId": "2" + } + ], + "name": "cinderv3", + "type": "volumev3" + }, + { + "endpoints": [ + { + "region": "RegionOne", + "tenantId": "1337", + "publicURL": "https://test_endpoint.com/v1", + "versionInfo": "https://test_endpoint.com/v1/", + "versionList": "https://test_endpoint.com/", + "versionId": "1" + } + ], + "name": "blazar", + "type": "reservation" + }, { "endpoints": [ { diff --git a/libcloud/test/compute/fixtures/openstack/_v2_0__auth_deployment.json b/libcloud/test/compute/fixtures/openstack/_v2_0__auth_deployment.json index b3d16294a6..c5edae7313 100644 --- a/libcloud/test/compute/fixtures/openstack/_v2_0__auth_deployment.json +++ b/libcloud/test/compute/fixtures/openstack/_v2_0__auth_deployment.json @@ -2,7 +2,7 @@ "access": { "token": { "id": "aaaaaaaaaaaa-bbb-cccccccccccccc", - "expires": "2031-11-23T21:00:14.000-06:00" + "expires": "2999-11-23T21:00:14.000-06:00" }, "serviceCatalog": [ { diff --git a/libcloud/test/compute/fixtures/openstack/_v2_0__auth_lon.json b/libcloud/test/compute/fixtures/openstack/_v2_0__auth_lon.json index ba4a10d8ef..9bf4c7ee3b 100644 --- a/libcloud/test/compute/fixtures/openstack/_v2_0__auth_lon.json +++ b/libcloud/test/compute/fixtures/openstack/_v2_0__auth_lon.json @@ -2,7 +2,7 @@ "access": { "token": { "id": "aaaaaaaaaaaa-bbb-cccccccccccccc", - "expires": "2031-11-23T21:00:14.000-06:00" + "expires": "2999-11-23T21:00:14.000-06:00" }, "serviceCatalog": [ { diff --git a/libcloud/test/compute/fixtures/openstack/_v3__auth_unauthorized.json b/libcloud/test/compute/fixtures/openstack/_v3__auth_unauthorized.json new file mode 100644 index 0000000000..24a51c1e26 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack/_v3__auth_unauthorized.json @@ -0,0 +1 @@ +{"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}} diff --git a/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_ipv6.xml b/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_ipv6.xml new file mode 100644 index 0000000000..e75b8461f8 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_ipv6.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_no_ip.xml b/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_no_ip.xml new file mode 100644 index 0000000000..e75b8461f8 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_no_ip.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_b.json b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_b.json new file mode 100644 index 0000000000..293ac5bd59 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_b.json @@ -0,0 +1,17 @@ +{ + "user": + { + "name": "userwithoutemail", + "links": { + "self": "http://192.168.18.100:5000/v3/users/b" + }, + "domain_id": "default", + "enabled": true, + "id": "b" + }, + "links": { + "self": "http://192.168.18.100:5000/v3/users", + "previous": null, + "next": null + } +} diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_c.json b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_c.json new file mode 100644 index 0000000000..f254dcf822 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_c.json @@ -0,0 +1,14 @@ +{ + "user": + { + "name": "userwithoutenabled", + "links": { + "self": "http://192.168.18.100:5000/v3/users/c" + }, + "domain_id": "default", + "id": "c", + "email": "c@example.com", + "password_expires_at": null, + "options": {} + } +} diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_flavors_detail.json b/libcloud/test/compute/fixtures/openstack_v1.1/_flavors_detail.json deleted file mode 100644 index 77411e89c6..0000000000 --- a/libcloud/test/compute/fixtures/openstack_v1.1/_flavors_detail.json +++ /dev/null @@ -1 +0,0 @@ -{"flavors": [{"rxtx_quota": 2500, "name": "15.5GB slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/7", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/7", "rel": "bookmark"}], "ram": 16384, "vcpus": 8, "rxtx_cap": 200, "swap": 0, "disk": 620, "id": 7}, {"rxtx_quota": 600, "name": "1GB slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/3", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/3", "rel": "bookmark"}], "ram": 1024, "vcpus": 1, "rxtx_cap": 30, "swap": 0, "disk": 40, "id": 3}, {"rxtx_quota": 150, "name": "256 slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/1", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/1", "rel": "bookmark"}], "ram": 256, "vcpus": 1, "rxtx_cap": 10, "swap": 0, "disk": 10, "id": 1, "OS-FLV-EXT-DATA:ephemeral": 40, "OS-FLV-WITH-EXT-SPECS:extra_specs": {"policy_class": "standard_flavor", "class": "standard1", "disk_io_index": "2", "number_of_data_disks": "0"}}, {"rxtx_quota": 1200, "name": "2GB slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/4", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/4", "rel": "bookmark"}], "ram": 2048, "vcpus": 2, "rxtx_cap": 60, "swap": 0, "disk": 80, "id": 4}, {"rxtx_quota": 2500, "name": "30GB slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/8", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/8", "rel": "bookmark"}], "ram": 30720, "vcpus": 8, "rxtx_cap": 400, "swap": 0, "disk": 1200, "id": 8}, {"rxtx_quota": 2500, "name": "4GB slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/5", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/5", "rel": "bookmark"}], "ram": 4096, "vcpus": 2, "rxtx_cap": 100, "swap": 0, "disk": 160, "id": 5}, {"rxtx_quota": 300, "name": "512 slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/2", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/2", "rel": "bookmark"}], "ram": 512, "vcpus": 1, "rxtx_cap": 20, "swap": 0, "disk": 20, "id": 2}, {"rxtx_quota": 2500, "name": "8GB slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/6", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/6", "rel": "bookmark"}], "ram": 8192, "vcpus": 4, "rxtx_cap": 150, "swap": 0, "disk": 320, "id": 6}]} diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/README b/libcloud/test/compute/fixtures/openstack_v1_1/README similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/README rename to libcloud/test/compute/fixtures/openstack_v1_1/README diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_flavor_extra_specs.json b/libcloud/test/compute/fixtures/openstack_v1_1/_flavor_extra_specs.json new file mode 100644 index 0000000000..b9084c32dd --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_flavor_extra_specs.json @@ -0,0 +1,6 @@ +{ + "extra_specs": { + "hw:cpu_policy": "shared", + "hw:numa_nodes": "1" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_flavors_7.json b/libcloud/test/compute/fixtures/openstack_v1_1/_flavors_7.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_flavors_7.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_flavors_7.json diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_flavors_detail.json b/libcloud/test/compute/fixtures/openstack_v1_1/_flavors_detail.json new file mode 100644 index 0000000000..07ee93ec41 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_flavors_detail.json @@ -0,0 +1 @@ +{"flavors": [{"rxtx_quota": 2500, "name": "15.5GB slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/7", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/7", "rel": "bookmark"}], "ram": 16384, "vcpus": 8, "rxtx_cap": 200, "swap": 0, "disk": 620, "id": 7}, {"rxtx_quota": 600, "name": "1GB slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/3", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/3", "rel": "bookmark"}], "ram": 1024, "vcpus": 1, "rxtx_cap": 30, "swap": 0, "disk": 40, "id": 3}, {"rxtx_quota": 150, "name": "256 slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/1", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/1", "rel": "bookmark"}], "ram": 256, "vcpus": 1, "rxtx_cap": 10, "swap": 0, "disk": 10, "id": 1, "OS-FLV-EXT-DATA:ephemeral": 40, "OS-FLV-WITH-EXT-SPECS:extra_specs": {"policy_class": "standard_flavor", "class": "standard1", "disk_io_index": "2", "number_of_data_disks": "0"}, "OS-FLV-DISABLED:disabled": false}, {"rxtx_quota": 1200, "name": "2GB slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/4", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/4", "rel": "bookmark"}], "ram": 2048, "vcpus": 2, "rxtx_cap": 60, "swap": 0, "disk": 80, "id": 4}, {"rxtx_quota": 2500, "name": "30GB slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/8", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/8", "rel": "bookmark"}], "ram": 30720, "vcpus": 8, "rxtx_cap": 400, "swap": 0, "disk": 1200, "id": 8}, {"rxtx_quota": 2500, "name": "4GB slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/5", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/5", "rel": "bookmark"}], "ram": 4096, "vcpus": 2, "rxtx_cap": 100, "swap": 0, "disk": 160, "id": 5}, {"rxtx_quota": 300, "name": "512 slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/2", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/2", "rel": "bookmark"}], "ram": 512, "vcpus": 1, "rxtx_cap": 20, "swap": 0, "disk": 20, "id": 2}, {"rxtx_quota": 2500, "name": "8GB slice", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/flavors/6", "rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/flavors/6", "rel": "bookmark"}], "ram": 8192, "vcpus": 4, "rxtx_cap": 150, "swap": 0, "disk": 320, "id": 6}]} diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_floating_ip.json b/libcloud/test/compute/fixtures/openstack_v1_1/_floating_ip.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_floating_ip.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_floating_ip.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_floating_ip_pools.json b/libcloud/test/compute/fixtures/openstack_v1_1/_floating_ip_pools.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_floating_ip_pools.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_floating_ip_pools.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_floating_ips.json b/libcloud/test/compute/fixtures/openstack_v1_1/_floating_ips.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_floating_ips.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_floating_ips.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_images_13.json b/libcloud/test/compute/fixtures/openstack_v1_1/_images_13.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_images_13.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_images_13.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_images_4949f9ee_2421_4c81_8b49_13119446008b.json b/libcloud/test/compute/fixtures/openstack_v1_1/_images_4949f9ee_2421_4c81_8b49_13119446008b.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_images_4949f9ee_2421_4c81_8b49_13119446008b.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_images_4949f9ee_2421_4c81_8b49_13119446008b.json diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_images_8af1a54e_a1b2_4df8_b747_4bec97abc799_members.json b/libcloud/test/compute/fixtures/openstack_v1_1/_images_8af1a54e_a1b2_4df8_b747_4bec97abc799_members.json new file mode 100644 index 0000000000..ce54718fbb --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_images_8af1a54e_a1b2_4df8_b747_4bec97abc799_members.json @@ -0,0 +1,2 @@ +{"status": "accepted", "created_at": "2018-03-02T14:19:38Z", "updated_at": "2018-03-02T14:20:37Z", "image_id": "8af1a54e-a1b2-4df8-b747-4bec97abc799", "member_id": "e2151b1fe02d4a8a2d1f5fc331522c0a", "schema": "/v2/schemas/member"} + diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_images_9af1a54e_a1b2_4df8_b747_4bec97abc799_members.json b/libcloud/test/compute/fixtures/openstack_v1_1/_images_9af1a54e_a1b2_4df8_b747_4bec97abc799_members.json new file mode 100644 index 0000000000..3bc417458a --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_images_9af1a54e_a1b2_4df8_b747_4bec97abc799_members.json @@ -0,0 +1,2 @@ +{"status": "pending", "created_at": "2018-03-02T14:19:38Z", "updated_at": "2018-03-02T14:19:38Z", "image_id": "9af1a54e-a1b2-4df8-b747-4bec97abc799", "member_id": "e2151b1fe02d4a8a2d1f5fc331522c0a", "schema": "/v2/schemas/member"} + diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_images_d9a9cd9a_278a_444c_90a6_d24b8c688a63_members.json b/libcloud/test/compute/fixtures/openstack_v1_1/_images_d9a9cd9a_278a_444c_90a6_d24b8c688a63_members.json new file mode 100644 index 0000000000..b81f48d35e --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_images_d9a9cd9a_278a_444c_90a6_d24b8c688a63_members.json @@ -0,0 +1 @@ +{"members": [{"status": "accepted", "created_at": "2017-01-12T12:31:50Z", "updated_at": "2017-01-12T12:31:54Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "016926dff12345e8b10329f24c99745b", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:43:24Z", "updated_at": "2017-01-12T12:43:28Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "0cb96fe6d1a749a3b32733bf1fc5e3d8", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-19T08:06:33Z", "updated_at": "2017-01-19T08:06:58Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "0d6aa4aaa8624fa38621e23b84a583f6", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:19:38Z", "updated_at": "2017-01-12T12:19:41Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "0e3c876745274d13b6c2ab70f82f4503", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:15:44Z", "updated_at": "2017-01-12T12:15:47Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "13c07d734435bb1ea2faeeb23f8574c6", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-02-09T14:08:46Z", "updated_at": "2017-02-09T14:08:33Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "1a0ba874fcaf4a0c814dc85d2a2ef9bc", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-27T13:20:08Z", "updated_at": "2017-01-27T13:20:11Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "1ce2f38e23a44ab8bb6a2cc2b409de06", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:31:48Z", "updated_at": "2017-01-12T12:31:52Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "2b269ec4335745ef84562d4f1fabbb50", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T10:33:34Z", "updated_at": "2017-01-12T10:33:37Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "31eb590cf2014726bd3aa372f1e21383", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:27:14Z", "updated_at": "2017-01-12T12:27:17Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "32ab6a1cfa6f4c2da7233a27c7ab624c", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-19T08:24:39Z", "updated_at": "2017-01-19T08:24:42Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "3865bd651ee141c5b37b81e2333daaef", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-16T14:12:12Z", "updated_at": "2017-01-16T14:12:15Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "33a2b8475b3443738c443b94c3be6852", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-27T13:05:16Z", "updated_at": "2017-01-27T13:05:20Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "4b9aa0de831245e2b26f0b1b53d2b70b", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:21:31Z", "updated_at": "2017-01-12T12:21:34Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "4f1568969ad84c939cc9c396a43ad757", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:13:10Z", "updated_at": "2017-01-12T12:13:13Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "5a21d13639bc4141a3030c46e95e8ed4", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T10:13:37Z", "updated_at": "2017-01-12T10:13:40Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "679d169d15a8448a91cd66b1d34367d6", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-27T15:31:29Z", "updated_at": "2017-01-27T15:31:33Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "6c469adc3d464275abe13aabdd28b19a", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:30:29Z", "updated_at": "2017-01-12T12:30:32Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "6fbabd8cba81429cb35ff1df4bd2a62e", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-27T12:54:40Z", "updated_at": "2017-01-27T12:54:44Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "77a940af30ac444ea6734fd809138906", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-02-09T14:16:59Z", "updated_at": "2017-02-09T14:17:02Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "796deab733b14a3781f3f9cb07c834a5", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:12:41Z", "updated_at": "2017-01-12T12:12:44Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "84ee139deb75b133b5616571b989e780", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-02-09T14:01:22Z", "updated_at": "2017-02-09T14:01:26Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "88af7921eeda432ca47b09c0e6bd4aa3", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T10:56:07Z", "updated_at": "2017-01-12T10:56:10Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "ae394c8ecde5b09a8ba04aafefdac1e6", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:12:04Z", "updated_at": "2017-01-12T12:12:07Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "d146a26974104aa1ba3ba56bed8699dc", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-02-07T27:17:35Z", "updated_at": "2017-02-07T27:17:38Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "da1fe8eafd794ef8bda390dcf78c3927", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:21:27Z", "updated_at": "2017-01-12T12:21:21Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "da52660bdabf4adeab261a0fde666e80", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-19T08:22:21Z", "updated_at": "2017-01-19T08:22:24Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "e883313f4a864ef9933b3574f4ea3c42", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:31:51Z", "updated_at": "2017-01-12T12:31:54Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "ec9b3bcb5bac4f4ea3dd42afff28713a", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-12T12:15:08Z", "updated_at": "2017-01-12T12:15:12Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "fdfb81a8ffaa4f1d9d7b712ac3369332", "schema": "/v2/schemas/member"}, {"status": "accepted", "created_at": "2017-01-19T08:13:03Z", "updated_at": "2017-01-19T08:13:07Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "ffad303302884e96998c8d4564a263c2", "schema": "/v2/schemas/member"}], "schema": "/v2/schemas/members"} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_images_d9a9cd9a_278a_444c_90a6_d24b8c688a63_members_016926dff12345e8b10329f24c99745b.json b/libcloud/test/compute/fixtures/openstack_v1_1/_images_d9a9cd9a_278a_444c_90a6_d24b8c688a63_members_016926dff12345e8b10329f24c99745b.json new file mode 100644 index 0000000000..2e1024b4d4 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_images_d9a9cd9a_278a_444c_90a6_d24b8c688a63_members_016926dff12345e8b10329f24c99745b.json @@ -0,0 +1,2 @@ +{"status": "accepted", "created_at": "2017-01-12T12:31:50Z", "updated_at": "2017-01-12T12:31:54Z", "image_id": "d9a9cd9a-278a-444c-90a6-d24b8c688a63", "member_id": "016926dff12345e8b10329f24c99745b", "schema": "/v2/schemas/member"} + diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_images_detail.json b/libcloud/test/compute/fixtures/openstack_v1_1/_images_detail.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_images_detail.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_images_detail.json diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_images_f24a3c1b-d52a-4116-91da-25b3eee8f55d.json b/libcloud/test/compute/fixtures/openstack_v1_1/_images_f24a3c1b-d52a-4116-91da-25b3eee8f55d.json new file mode 100644 index 0000000000..03bbfaa945 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_images_f24a3c1b-d52a-4116-91da-25b3eee8f55d.json @@ -0,0 +1 @@ +{"status": "saving", "image_location": "snapshot", "image_state": "pending", "tags": [], "kernel_id": null, "container_format": "bare", "min_ram": 0, "ramdisk_id": null, "locations": [{"url": "file:///var/lib/glance/images/4949f9ee-2421-4c81-8b49-13119446008b", "metadata": {"mountpoint": "/var/lib/glance/images", "type": "nfs", "id": "NetApp1", "share_location": "nfs://some.ip.somewhere/blabla_data001"}}], "visibility": "private", "updated_at": "2017-11-28T10:19:49Z", "owner": "d85e344900774f5aad27e4e8e91205d6", "schema": "/v2/schemas/image", "file": "/v2/images/4949f9ee-2421-4c81-8b49-13119446008b/file", "min_disk": 40, "virtual_size": null, "base_image_ref": "5be2b652-a965-4ecb-a2b4-b9f83d7779e6", "size": 1256259584, "instance_uuid": "24f0a531-e45f-491b-86f2-3708dd45a478", "os_distro": "ubuntu", "user_id": "b0d846d9ac93452bb93857e0305584bd", "name": "new_image", "image_type": "snapshot", "checksum": "3530464d095c9d62771b99ebecd2d70b", "created_at": "2017-09-11T13:00:05Z", "disk_format": "qcow2", "id": "4949f9ee-2421-4c81-8b49-13119446008b", "protected": false, "os_type": "linux", "direct_url": "file:///var/lib/glance/images/4949f9ee-2421-4c81-8b49-13119446008b", "self": "/v2/images/4949f9ee-2421-4c81-8b49-13119446008b", "owner_id": "d85e344900774f5aad27e4e8e91205d6"} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_images_f24a3c1b-d52a-4116-91da-25b3eee8f55e.json b/libcloud/test/compute/fixtures/openstack_v1_1/_images_f24a3c1b-d52a-4116-91da-25b3eee8f55e.json new file mode 100644 index 0000000000..4d014cf4c2 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_images_f24a3c1b-d52a-4116-91da-25b3eee8f55e.json @@ -0,0 +1 @@ +{"status": "active", "image_location": "snapshot", "image_state": "available", "tags": [], "kernel_id": null, "container_format": "bare", "min_ram": 0, "ramdisk_id": null, "locations": [{"url": "file:///var/lib/glance/images/f24a3c1b-d52a-4116-91da-25b3eee8f55e", "metadata": {"mountpoint": "/var/lib/glance/images", "type": "nfs", "id": "NetApp1", "share_location": "nfs://some.ip.somewhere/blabla_data001"}}], "visibility": "shared", "updated_at": "2017-11-28T10:19:49Z", "owner": "d85e344900774f5aad27e4e8e91205d6", "schema": "/v2/schemas/image", "file": "/v2/images/f24a3c1b-d52a-4116-91da-25b3eee8f55e/file", "min_disk": 40, "virtual_size": null, "base_image_ref": "5be2b652-a965-4ecb-a2b4-b9f83d7779e6", "size": 1256259584, "instance_uuid": "24f0a531-e45f-491b-86f2-3708dd45a478", "os_distro": "ubuntu", "user_id": "b0d846d9ac93452bb93857e0305584bd", "name": "hypernode", "image_type": "snapshot", "checksum": "3530464d095c9d62771b99ebecd2d70b", "created_at": "2017-09-11T13:00:05Z", "disk_format": "qcow2", "id": "f24a3c1b-d52a-4116-91da-25b3eee8f55e", "protected": false, "os_type": "linux", "direct_url": "file:///var/lib/glance/images/f24a3c1b-d52a-4116-91da-25b3eee8f55e", "self": "/v2/images/f24a3c1b-d52a-4116-91da-25b3eee8f55e", "owner_id": "d85e344900774f5aad27e4e8e91205d6"} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_images_v2.json b/libcloud/test/compute/fixtures/openstack_v1_1/_images_v2.json new file mode 100644 index 0000000000..6517a33200 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_images_v2.json @@ -0,0 +1 @@ +{"images": [{"status": "active", "image_location": "snapshot", "image_state": "available", "tags": [], "kernel_id": null, "container_format": "bare", "min_ram": 0, "ramdisk_id": null, "locations": [{"url": "file:///var/lib/glance/images/f24a3c1b-d52a-4116-91da-25b3eee8f55e", "metadata": {"mountpoint": "/var/lib/glance/images", "type": "nfs", "id": "NetApp1", "share_location": "nfs://some.ip.somewhere/com_osp_data001"}}], "visibility": "shared", "updated_at": "2017-11-28T10:19:49Z", "owner": "d85e344900774f5aad27e4e8e91205d6", "schema": "/v2/schemas/image", "file": "/v2/images/f24a3c1b-d52a-4116-91da-25b3eee8f55e/file", "min_disk": 40, "virtual_size": null, "base_image_ref": "5be2b652-a965-4ecb-a2b4-b9f83d7779e6", "size": 1256259584, "instance_uuid": "24f0a531-e45f-491b-86f2-3708dd45a478", "os_distro": "ubuntu", "os_version": "16.04", "user_id": "b0d846d9ac93452bb93857e0305584bd", "name": "hypernode", "image_type": "snapshot", "checksum": "3530464d095c9d62771b99ebecd2d70b", "created_at": "2017-09-11T13:00:05Z", "disk_format": "qcow2", "id": "f24a3c1b-d52a-4116-91da-25b3eee8f55e", "protected": false, "os_type": "linux", "direct_url": "file:///var/lib/glance/images/f24a3c1b-d52a-4116-91da-25b3eee8f55e", "self": "/v2/images/f24a3c1b-d52a-4116-91da-25b3eee8f55e", "owner_id": "d85e344900774f5aad27e4e8e91205d6"}, {"status": "active", "image_location": "snapshot", "image_state": "available", "tags": [], "kernel_id": null, "container_format": "bare", "min_ram": 0, "ramdisk_id": null, "locations": [{"url": "file:///var/lib/glance/images/4bd743f8-7e7d-4568-8f31-b3f06b90e70a", "metadata": {"mountpoint": "/var/lib/glance/images", "type": "nfs", "id": "NetApp1", "share_location": "nfs://some.ip.somewhere/com_osp_data001"}}], "visibility": "private", "updated_at": "2017-09-07T13:07:33Z", "owner": "d85e344900774f5aad27e4e8e91205d6", "schema": "/v2/schemas/image", "file": "/v2/images/4bd743f8-7e7d-4568-8f31-b3f06b90e70a/file", "min_disk": 40, "virtual_size": null, "base_image_ref": "5be2b652-a965-4ecb-a2b4-b9f83d7779e6", "size": 1248264192, "instance_uuid": "b4166e71-f40b-4a5b-a489-87601ab8a600", "os_distro": "ubuntu", "user_id": "b0d846d9ac93452bb93857e0305584bd", "name": "hypernode", "image_type": "snapshot", "checksum": "1969ec22f73d524eb766b4c308e2192a", "created_at": "2017-09-07T13:06:24Z", "disk_format": "qcow2", "id": "4bd743f8-7e7d-4568-8f31-b3f06b90e70a", "protected": false, "os_type": "linux", "direct_url": "file:///var/lib/glance/images/4bd743f8-7e7d-4568-8f31-b3f06b90e70a", "self": "/v2/images/4bd743f8-7e7d-4568-8f31-b3f06b90e70a", "owner_id": "d85e344900774f5aad27e4e8e91205d6"}], "next": "/v2/images?marker=e7a40226-3523-4f0f-87d8-d8dc91bbf4a3", "schema": "/v2/schemas/images", "first": "/v2/images"} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_images_v2_invalid_next.json b/libcloud/test/compute/fixtures/openstack_v1_1/_images_v2_invalid_next.json new file mode 100644 index 0000000000..0d115bb266 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_images_v2_invalid_next.json @@ -0,0 +1 @@ +{"images": [{"status": "active", "image_location": "snapshot", "image_state": "available", "tags": [], "kernel_id": null, "container_format": "bare", "min_ram": 0, "ramdisk_id": null, "locations": [{"url": "file:///var/lib/glance/images/f24a3c1b-d52a-4116-91da-25b3eee8f55e", "metadata": {"mountpoint": "/var/lib/glance/images", "type": "nfs", "id": "NetApp1", "share_location": "nfs://some.ip.somewhere/com_osp_data001"}}], "visibility": "shared", "updated_at": "2017-11-28T10:19:49Z", "owner": "d85e344900774f5aad27e4e8e91205d6", "schema": "/v2/schemas/image", "file": "/v2/images/f24a3c1b-d52a-4116-91da-25b3eee8f55e/file", "min_disk": 40, "virtual_size": null, "base_image_ref": "5be2b652-a965-4ecb-a2b4-b9f83d7779e6", "size": 1256259584, "instance_uuid": "24f0a531-e45f-491b-86f2-3708dd45a478", "os_distro": "ubuntu", "user_id": "b0d846d9ac93452bb93857e0305584bd", "name": "hypernode", "image_type": "snapshot", "checksum": "3530464d095c9d62771b99ebecd2d70b", "created_at": "2017-09-11T13:00:05Z", "disk_format": "qcow2", "id": "f24a3c1b-d52a-4116-91da-25b3eee8f55e", "protected": false, "os_type": "linux", "direct_url": "file:///var/lib/glance/images/f24a3c1b-d52a-4116-91da-25b3eee8f55e", "self": "/v2/images/f24a3c1b-d52a-4116-91da-25b3eee8f55e", "owner_id": "d85e344900774f5aad27e4e8e91205d6"}, {"status": "active", "image_location": "snapshot", "image_state": "available", "tags": [], "kernel_id": null, "container_format": "bare", "min_ram": 0, "ramdisk_id": null, "locations": [{"url": "file:///var/lib/glance/images/4bd743f8-7e7d-4568-8f31-b3f06b90e70a", "metadata": {"mountpoint": "/var/lib/glance/images", "type": "nfs", "id": "NetApp1", "share_location": "nfs://some.ip.somewhere/com_osp_data001"}}], "visibility": "private", "updated_at": "2017-09-07T13:07:33Z", "owner": "d85e344900774f5aad27e4e8e91205d6", "schema": "/v2/schemas/image", "file": "/v2/images/4bd743f8-7e7d-4568-8f31-b3f06b90e70a/file", "min_disk": 40, "virtual_size": null, "base_image_ref": "5be2b652-a965-4ecb-a2b4-b9f83d7779e6", "size": 1248264192, "instance_uuid": "b4166e71-f40b-4a5b-a489-87601ab8a600", "os_distro": "ubuntu", "user_id": "b0d846d9ac93452bb93857e0305584bd", "name": "hypernode", "image_type": "snapshot", "checksum": "1969ec22f73d524eb766b4c308e2192a", "created_at": "2017-09-07T13:06:24Z", "disk_format": "qcow2", "id": "4bd743f8-7e7d-4568-8f31-b3f06b90e70a", "protected": false, "os_type": "linux", "direct_url": "file:///var/lib/glance/images/4bd743f8-7e7d-4568-8f31-b3f06b90e70a", "self": "/v2/images/4bd743f8-7e7d-4568-8f31-b3f06b90e70a", "owner_id": "d85e344900774f5aad27e4e8e91205d6"}], "next": "/v2/images", "schema": "/v2/schemas/images", "first": "/v2/images"} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_images_v2_page2.json b/libcloud/test/compute/fixtures/openstack_v1_1/_images_v2_page2.json new file mode 100644 index 0000000000..f4275ee4ad --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_images_v2_page2.json @@ -0,0 +1,50 @@ +{ + "images": [ + { + "status": "active", + "image_location": "snapshot", + "image_state": "available", + "tags": [], + "kernel_id": null, + "container_format": "bare", + "min_ram": 0, + "ramdisk_id": null, + "locations": [ + { + "url": "file:///var/lib/glance/images/f24a3c1b-d52a-4116-91da-25b3eee8f55c", + "metadata": { + "mountpoint": "/var/lib/glance/images", + "type": "nfs", + "id": "NetApp1", + "share_location": "nfs://some.ip.somewhere/com_osp_data001" + } + } + ], + "visibility": "shared", + "updated_at": "2017-11-28T10:19:50Z", + "owner": "d85e344900774f5aad27e4e8e91205d6", + "schema": "/v2/schemas/image", + "file": "/v2/images/f24a3c1b-d52a-4116-91da-25b3eee8f55c/file", + "min_disk": 40, + "virtual_size": null, + "base_image_ref": "5be2b652-a965-4ecb-a2b4-b9f83d7779e6", + "size": 1256259584, + "instance_uuid": "24f0a531-e45f-491b-86f2-3708dd45a478", + "os_distro": "ubuntu", + "user_id": "b0d846d9ac93452bb93857e0305584bd", + "name": "hypernode", + "image_type": "snapshot", + "checksum": "3530464d095c9d62771b99ebecd2d70c", + "created_at": "2017-09-11T13:00:05Z", + "disk_format": "qcow2", + "id": "f24a3c1b-d52a-4116-91da-25b3eee8f55c", + "protected": false, + "os_type": "linux", + "direct_url": "file:///var/lib/glance/images/f24a3c1b-d52a-4116-91da-25b3eee8f55c", + "self": "/v2/images/f24a3c1b-d52a-4116-91da-25b3eee8f55c", + "owner_id": "d85e344900774f5aad27e4e8e91205d6" + } + ], + "schema": "/v2/schemas/images", + "first": "/v2/images" +} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_leases.json b/libcloud/test/compute/fixtures/openstack_v1_1/_leases.json new file mode 100644 index 0000000000..2acb5fd9c4 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_leases.json @@ -0,0 +1,84 @@ +{ + "leases": [ + { + "id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466", + "name": "lease_foo", + "start_date": "2017-12-26T12:00:00.000000", + "end_date": "2017-12-27T12:00:00.000000", + "status":"PENDING", + "degraded": false, + "user_id": "5434f637520d4c17bbf254af034b0320", + "project_id": "aa45f56901ef45ee95e3d211097c0ea3", + "trust_id": "b442a580b9504ababf305bf2b4c49512", + "created_at": "2017-12-27 10:00:00", + "updated_at": null, + "reservations": [ + { + "id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36", + "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466", + "status": "pending", + "missing_resources": false, + "resources_changed": false, + "resource_id": "5e6c0e6e-f1e6-490b-baaf-50deacbbe371", + "resource_type": "physical:host", + "min": 4, + "max": 6, + "hypervisor_properties": "[\">=\", \"$vcpus\", \"4\"]", + "resource_properties": "", + "before_end": "default", + "created_at": "2017-12-27 10:00:00", + "updated_at": null + }, + { + "id": "ddc45423-f863-4e4e-8e7a-51d27cfec962", + "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466", + "status": "pending", + "missing_resources": false, + "resources_changed": false, + "resource_id": "0b901727-cca2-43ed-bcc8-c21b0982dcb1", + "resource_type": "virtual:instance", + "amount": 4, + "vcpus": 2, + "memory_mb": 4096, + "disk_gb": 100, + "affinity": false, + "resource_properties": "", + "flavor_id": "ddc45423-f863-4e4e-8e7a-51d27cfec962", + "server_group_id": "33cdfc42-5a04-4fcc-b190-1abebaa056bb", + "aggregate_id": 11, + "created_at": "2017-12-27 10:00:00", + "updated_at": null + } + ], + "events": [ + { + "id": "188a8584-f832-4df9-9a4a-51e6364420ff", + "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466", + "status": "UNDONE", + "event_type": "start_lease", + "time": "2017-12-26T12:00:00.000000", + "created_at": "2017-12-27 10:00:00", + "updated_at": null + }, + { + "id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56", + "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466", + "status": "UNDONE", + "event_type": "end_lease", + "time": "2017-12-27T12:00:00.000000", + "created_at": "2017-12-27 10:00:00", + "updated_at": null + }, + { + "id": "f583af71-ca21-4b66-87de-52211d118029", + "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466", + "status": "UNDONE", + "time": "2017-12-27T11:00:00.000000", + "event_type": "before_end_lease", + "created_at": "2017-12-27 10:00:00", + "updated_at": null + } + ] + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_os_hosts.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_hosts.json new file mode 100644 index 0000000000..ff773eb143 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_os_hosts.json @@ -0,0 +1,21 @@ +{ + "hosts": [ + { + "id": "1", + "hypervisor_hostname": "compute-1", + "hypervisor_type": "QEMU", + "hypervisor_version": 2010001, + "vcpus": 4, + "cpu_info": "{'arch': 'x86_64', 'model': 'cpu64-rhel6', 'vendor': 'Intel'}", + "memory_mb": 8192, + "local_gb": 100, + "service_name": "compute-1", + "reservable": true, + "status": null, + "trust_id": "5f67f11215cf4c52906453a181bfcfea", + "created_at": "2017-12-27 10:00:00", + "updated_at": null, + "extra_capability_sample": "foo" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_keypairs.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_keypairs.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_keypairs.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_keypairs.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_keypairs_create.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_keypairs_create.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_keypairs_create.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_keypairs_create.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_keypairs_create_import.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_keypairs_create_import.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_keypairs_create_import.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_keypairs_create_import.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_keypairs_get_one.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_keypairs_get_one.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_keypairs_get_one.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_keypairs_get_one.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_keypairs_not_found.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_keypairs_not_found.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_keypairs_not_found.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_keypairs_not_found.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_networks.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_networks.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_networks.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_networks.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_networks_POST.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_networks_POST.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_networks_POST.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_networks_POST.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_quota_sets_aTenantId.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_quota_sets_aTenantId.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_quota_sets_aTenantId.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_quota_sets_aTenantId.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_security_group_rules_create.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_security_group_rules_create.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_security_group_rules_create.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_security_group_rules_create.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_security_groups.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_security_groups.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_security_groups.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_security_groups.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_security_groups_create.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_security_groups_create.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_security_groups_create.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_security_groups_create.json diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshot.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshot.json new file mode 100644 index 0000000000..a79927a74b --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshot.json @@ -0,0 +1,11 @@ +{ + "snapshot": { + "id": "3fbbcccf-d058-4502-8844-6feeffdf4cb5", + "display_name": "snap-001", + "display_description": "Daily backup", + "volume_id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c", + "status": "available", + "size": 30, + "created_at": "2012-02-29T03:50:07Z" + } +} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshot_rackspace.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshot_rackspace.json new file mode 100644 index 0000000000..abb0b56176 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshot_rackspace.json @@ -0,0 +1,11 @@ +{ + "snapshot": { + "id": "3fbbcccf-d058-4502-8844-6feeffdf4cb5", + "displayName": "snap-001", + "displayDescription": "Daily backup", + "volumeId": "521752a6-acf6-4b2d-bc7a-119f9148cd8c", + "status": "available", + "size": 30, + "createdAt": "2012-02-29T03:50:07Z" + } +} diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_snapshots.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshots.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_snapshots.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshots.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_snapshots_create.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshots_create.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_snapshots_create.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshots_create.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_snapshots_create_rackspace.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshots_create_rackspace.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_snapshots_create_rackspace.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshots_create_rackspace.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_snapshots_rackspace.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshots_rackspace.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_snapshots_rackspace.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_snapshots_rackspace.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_volumes.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_volumes.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_volumes.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_volumes.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_volumes_cd76a3a1_c4ce_40f6_9b9f_07a61508938d.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_volumes_cd76a3a1_c4ce_40f6_9b9f_07a61508938d.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_volumes_cd76a3a1_c4ce_40f6_9b9f_07a61508938d.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_volumes_cd76a3a1_c4ce_40f6_9b9f_07a61508938d.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_os_volumes_create.json b/libcloud/test/compute/fixtures/openstack_v1_1/_os_volumes_create.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_os_volumes_create.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_os_volumes_create.json diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_port_v2.json b/libcloud/test/compute/fixtures/openstack_v1_1/_port_v2.json new file mode 100644 index 0000000000..52cae059f9 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_port_v2.json @@ -0,0 +1,32 @@ +{ + "port": { + "status": "BUILD", + "extra_dhcp_opts": [], + "description": "Some port description", + "allowed_address_pairs": [{"ip_address": "1.2.3.4"}, {"ip_address": "2.3.4.5"}], + "tags": [], + "network_id": "123c8a8c-6427-4e8f-a805-2035365f4d43", + "tenant_id": "abcdec85bee34bb0a44ab8255eb36abc", + "created_at": "2018-07-04T14:38:18Z", + "admin_state_up": true, + "updated_at": "2018-07-05T14:40:43Z", + "binding:vnic_type": "normal", + "device_owner": "compute:nova", + "name": "Some port name", + "revision_number": 2036, + "mac_address": "ba:12:12:8a:b2:73", + "port_security_enabled": true, + "project_id": "abcdec85bee34bb0a44ab8255eb36abc", + "fixed_ips": [ + { + "subnet_id": "1231a12a-125b-4329-a3c5-312ea86a7577", + "ip_address": "12.123.12.32" + } + ], + "id": "126da55e-cfcb-41c8-ae39-a26cb8a7e723", + "security_groups": [ + "abcfb112-5b5c-4c6b-8b3f-dbaee57df440" + ], + "device_id": "95e75643-2008-123f-ad13-e20ea64e3c87" + } +} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_ports_v2.json b/libcloud/test/compute/fixtures/openstack_v1_1/_ports_v2.json new file mode 100644 index 0000000000..61f2703505 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_ports_v2.json @@ -0,0 +1,184 @@ +{ + "ports": [ + { + "status": "BUILD", + "extra_dhcp_opts": [], + "description": "", + "allowed_address_pairs": [], + "tags": [], + "network_id": "123c8a8c-6427-4e8f-a805-2035365f4d43", + "tenant_id": "abcdec85bee34bb0a44ab8255eb36abc", + "created_at": "2018-07-04T14:38:18Z", + "admin_state_up": true, + "updated_at": "2018-07-05T14:40:43Z", + "binding:vnic_type": "normal", + "device_owner": "compute:nova", + "name": "", + "revision_number": 2036, + "mac_address": "ba:12:12:8a:b2:73", + "port_security_enabled": true, + "project_id": "abcdec85bee34bb0a44ab8255eb36abc", + "fixed_ips": [ + { + "subnet_id": "1231a12a-125b-4329-a3c5-312ea86a7577", + "ip_address": "12.123.12.32" + } + ], + "id": "126da55e-cfcb-41c8-ae39-a26cb8a7e723", + "security_groups": [ + "abcfb112-5b5c-4c6b-8b3f-dbaee57df440" + ], + "device_id": "95e75643-2008-123f-ad13-e20ea64e3c87" + }, + { + "status": "BUILD", + "extra_dhcp_opts": [], + "description": "porttest", + "allowed_address_pairs": [], + "tags": [], + "network_id": "123c8a8c-6427-4e8f-a805-2035365f4d43", + "tenant_id": "abcdec85bee34bb0a44ab8255eb36abc", + "created_at": "2018-07-05T12:38:50Z", + "admin_state_up": true, + "updated_at": "2018-07-05T14:40:43Z", + "binding:vnic_type": "normal", + "device_owner": "compute:nova", + "name": "porttest", + "revision_number": 865, + "mac_address": "ba:12:12:48:42:9b", + "port_security_enabled": true, + "project_id": "abcdec85bee34bb0a44ab8255eb36abc", + "fixed_ips": [ + { + "subnet_id": "1231a12a-125b-4329-a3c5-312ea86a7577", + "ip_address": "12.123.12.31" + } + ], + "id": "a8f3ddbe-9b29-41ac-9c0a-9ea7cc012dfb", + "security_groups": [ + "abcfb112-5b5c-4c6b-8b3f-dbaee57df440" + ], + "device_id": "7b4743a6-f7f7-4764-9854-cf43312e6d49" + }, + { + "status": "DOWN", + "extra_dhcp_opts": [], + "description": "", + "allowed_address_pairs": [], + "tags": [], + "network_id": "123c8a8c-6427-4e8f-a805-2035365f4d43", + "tenant_id": "abcdec85bee34bb0a44ab8255eb36abc", + "created_at": "2018-07-05T13:09:27Z", + "admin_state_up": true, + "updated_at": "2018-07-05T13:29:38Z", + "binding:vnic_type": "normal", + "device_owner": "compute:nova", + "name": "", + "revision_number": 10, + "mac_address": "ba:12:12:95:13:cc", + "port_security_enabled": true, + "project_id": "abcdec85bee34bb0a44ab8255eb36abc", + "fixed_ips": [ + { + "subnet_id": "1231a12a-125b-4329-a3c5-312ea86a7577", + "ip_address": "12.123.12.44" + } + ], + "id": "bad9af6a-121d-4772-9ae0-7d127b712f5d", + "security_groups": [ + "abcfb112-5b5c-4c6b-8b3f-dbaee57df440" + ], + "device_id": "500d78d1-f84f-4949-12da-5205c1237121" + }, + { + "status": "DOWN", + "extra_dhcp_opts": [], + "description": "testport", + "allowed_address_pairs": [], + "tags": [], + "network_id": "123c8a8c-6427-4e8f-a805-2035365f4d43", + "tenant_id": "abcdec85bee34bb0a44ab8255eb36abc", + "created_at": "2018-07-05T11:59:13Z", + "admin_state_up": true, + "updated_at": "2018-07-05T12:39:48Z", + "binding:vnic_type": "normal", + "device_owner": "", + "name": "testport", + "revision_number": 32, + "mac_address": "ba:12:12:6f:ea:12", + "port_security_enabled": true, + "project_id": "abcdec85bee34bb0a44ab8255eb36abc", + "fixed_ips": [ + { + "subnet_id": "1231a12a-125b-4329-a3c5-312ea86a7577", + "ip_address": "12.123.12.12" + } + ], + "id": "c21297ca-4e68-4384-badf-10903cd2cbb0", + "security_groups": [ + "abcfb112-5b5c-4c6b-8b3f-dbaee57df440" + ], + "device_id": "" + }, + { + "status": "DOWN", + "extra_dhcp_opts": [], + "description": "testport", + "allowed_address_pairs": [], + "tags": [], + "network_id": "123c8a8c-6427-4e8f-a805-2035365f4d43", + "tenant_id": "abcdec85bee34bb0a44ab8255eb36abc", + "created_at": "2018-07-05T11:56:59Z", + "admin_state_up": true, + "updated_at": "2018-07-05T11:57:00Z", + "binding:vnic_type": "normal", + "device_owner": "", + "name": "testport", + "revision_number": 3, + "mac_address": "ba:12:12:e6:03:ba", + "port_security_enabled": true, + "project_id": "abcdec85bee34bb0a44ab8255eb36abc", + "fixed_ips": [ + { + "subnet_id": "1231a12a-125b-4329-a3c5-312ea86a7577", + "ip_address": "12.123.12.28" + } + ], + "id": "ca335147-273c-4c72-9bab-11a122a95ce1", + "security_groups": [ + "abcfb112-5b5c-4c6b-8b3f-dbaee57df440" + ], + "device_id": "" + }, + { + "status": "DOWN", + "extra_dhcp_opts": [], + "allowed_address_pairs": [], + "tags": [], + "network_id": "123c8a8c-6427-4e8f-a805-2035365f4d43", + "tenant_id": "abcdec85bee34bb0a44ab8255eb36abc", + "created_at": "2018-07-05T11:12:17Z", + "admin_state_up": true, + "updated_at": "2018-07-05T11:12:17Z", + "binding:vnic_type": "normal", + "device_owner": "", + "name": "testport", + "revision_number": 3, + "mac_address": "ba:12:12:12:12:12", + "port_security_enabled": true, + "project_id": "abcdec85bee34bb0a44ab8255eb36abc", + "fixed_ips": [ + { + "subnet_id": "1231a12a-125b-4329-a3c5-312ea86a7577", + "ip_address": "12.123.12.12" + } + ], + "id": "a128dec6-4f3a-45c4-a89c-678f69a72044", + "security_groups": [ + "abcfb112-5b5c-4c6b-8b3f-dbaee57df440" + ], + "device_id": "" + } + ] +} + diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_12063_metadata_two_keys.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_12063_metadata_two_keys.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_12063_metadata_two_keys.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_12063_metadata_two_keys.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_12064.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_12064.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_12064.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_12064.json diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_servers_12064247.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_12064247.json new file mode 100644 index 0000000000..262660152e --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_12064247.json @@ -0,0 +1,68 @@ +{ + "server": { + "status": "ACTIVE", + "updated": "2011-10-11T00:44:20Z", + "hostId": "a024053a6201e6c6c12660aab3d8fd879e332e663a5e1fdbc02a0307", + "user_id": "rs-reach", + "name": "lc-test", + "links": [ + { + "href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/servers/12064247", + "rel": "self" + }, + { + "href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/servers/12064247", + "rel": "bookmark" + } + ], + "addresses": { + "public": [ + { + "version": 4, + "addr": "50.57.94.30" + }, + { + "version": 6, + "addr": "2001:4801:7808:52:16:3eff:fe77:32e3" + } + ], + "private": [ + { + "version": 4, + "addr": "10.182.64.29" + }, + { + "version": 6, + "addr": "fec0:4801:7808:52:16:3eff:fe6e:b7e2" + } + ] + }, + "tenant_id": "rs-reach-project", + "image": { + "id": "7", + "links": [ + { + "href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/images/7", + "rel": "bookmark" + } + ] + }, + "created": "2011-10-11T00:45:02Z", + "uuid": "ec53630b-e4fb-442a-a748-c376f5c4345b", + "accessIPv4": "", + "accessIPv6": "", + "key_name": null, + "progress": 100, + "flavor": { + "vcpus": 2, + "ram": 2048, + "disk": 2048, + "ephemeral": 2048, + "swap": 2048, + "original_name": "flavor_name" + }, + "config_drive": "", + "id": 12064247, + "metadata": {} + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_12064_updated_name_bob.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_12064_updated_name_bob.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_12064_updated_name_bob.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_12064_updated_name_bob.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_12065_os_volume_attachments.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_12065_os_volume_attachments.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_12065_os_volume_attachments.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_12065_os_volume_attachments.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_12086_console_output.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_12086_console_output.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_12086_console_output.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_12086_console_output.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_1c01300f-ef97-4937-8f03-ac676d6234be_os-security-groups.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_1c01300f-ef97-4937-8f03-ac676d6234be_os-security-groups.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_1c01300f-ef97-4937-8f03-ac676d6234be_os-security-groups.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_1c01300f-ef97-4937-8f03-ac676d6234be_os-security-groups.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_26f7fbee_8ce1_4c28_887a_bfe8e4bb10fe.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_26f7fbee_8ce1_4c28_887a_bfe8e4bb10fe.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_26f7fbee_8ce1_4c28_887a_bfe8e4bb10fe.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_26f7fbee_8ce1_4c28_887a_bfe8e4bb10fe.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_create.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_create.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_create.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_create.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_create_disk_config.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_create_disk_config.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_create_disk_config.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_create_disk_config.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_detail.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_detail.json similarity index 83% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_detail.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_detail.json index 1bc875d183..cddb138bc5 100644 --- a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_detail.json +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_detail.json @@ -58,6 +58,28 @@ "addr": "10.3.3.3", "version": 4 } + ], + "pubnet": [ + { + "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:79:90:aa", + "OS-EXT-IPS:type": "fixed", + "addr": "1.1.1.1", + "version": 4 + }, + { + "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:79:90:aa", + "OS-EXT-IPS:type": "floating", + "addr": "2.2.2.2", + "version": 4 + } + ], + "privnet": [ + { + "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:79:90:aa", + "OS-EXT-IPS:type": "floating", + "addr": "172.16.1.1", + "version": 4 + } ] }, "tenant_id": "rs-reach-project", @@ -85,6 +107,14 @@ } ] }, + "fault": { + "id": 1234, + "instance_uuid": "ec53630b-e4fb-442a-a748-c376f5c4345b", + "code": "500", + "message": "test message", + "details": "No valid host was found.", + "host": "912566d83a13fbb357ea3f13c629363d9f7e1ba3f925b49f3d2ab725" + }, "config_drive": "", "id": 12065, "metadata": {}, diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_detail_EMPTY.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_detail_EMPTY.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_detail_EMPTY.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_detail_EMPTY.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_detail_ERROR_STATE.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_detail_ERROR_STATE.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_detail_ERROR_STATE.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_detail_ERROR_STATE.json diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_servers_os_intefaces.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_os_intefaces.json new file mode 100644 index 0000000000..8ab3e79195 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_os_intefaces.json @@ -0,0 +1,16 @@ +{ + "interfaceAttachments": [ + { + "fixed_ips": [ + { + "ip_address": "192.168.1.3", + "subnet_id": "f8a6e8f8-c2ec-497c-9f23-da9616de54ef" + } + ], + "mac_addr": "fa:16:3e:4c:2c:30", + "net_id": "3cb9bc59-5699-4588-a4b1-b87f96708bc6", + "port_id": "ce531f90-199f-48c0-816c-13e38010b442", + "port_state": "ACTIVE" + } + ] +} diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_pause.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_pause.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_pause.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_pause.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_resume.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_resume.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_resume.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_resume.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_suspend.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_suspend.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_suspend.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_suspend.json diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_unpause.json b/libcloud/test/compute/fixtures/openstack_v1_1/_servers_unpause.json similarity index 100% rename from libcloud/test/compute/fixtures/openstack_v1.1/_servers_unpause.json rename to libcloud/test/compute/fixtures/openstack_v1_1/_servers_unpause.json diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__floatingip.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__floatingip.json new file mode 100644 index 0000000000..0ef2ef55b7 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__floatingip.json @@ -0,0 +1,23 @@ +{ + "floatingip": + { + "router_id": null, + "description": "for test", + "dns_domain": "my-domain.org.", + "dns_name": "myfip2", + "created_at": "2016-12-21T11:55:50Z", + "updated_at": "2016-12-21T11:55:53Z", + "revision_number": 2, + "project_id": "4969c491a3c74ee4af974e6d800c62de", + "tenant_id": "4969c491a3c74ee4af974e6d800c62de", + "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", + "fixed_ip_address": null, + "floating_ip_address": "10.3.1.42", + "port_id": null, + "id": "09ea1784-2f81-46dc-8c91-244b4df75bde", + "status": "DOWN", + "port_details": null, + "tags": ["tag1,tag2"], + "port_forwardings": [] + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__floatingips.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__floatingips.json new file mode 100644 index 0000000000..b55f48cf07 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__floatingips.json @@ -0,0 +1,136 @@ +{ + "floatingips": [ + { + "router_id": null, + "description": "for test", + "dns_domain": "my-domain.org.", + "dns_name": "myfip2", + "created_at": "2016-12-21T11:55:50Z", + "updated_at": "2016-12-21T11:55:53Z", + "revision_number": 2, + "project_id": "4969c491a3c74ee4af974e6d800c62de", + "tenant_id": "4969c491a3c74ee4af974e6d800c62de", + "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", + "fixed_ip_address": null, + "floating_ip_address": "10.3.1.42", + "port_id": null, + "id": "09ea1784-2f81-46dc-8c91-244b4df75bde", + "status": "DOWN", + "port_details": null, + "tags": ["tag1,tag2"], + "port_forwardings": [] + }, + { + "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", + "description": "for test", + "dns_domain": "my-domain.org.", + "dns_name": "myfip", + "created_at": "2016-12-21T10:55:50Z", + "updated_at": "2016-12-21T10:55:53Z", + "revision_number": 1, + "project_id": "4969c491a3c74ee4af974e6d800c62de", + "tenant_id": "4969c491a3c74ee4af974e6d800c62de", + "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", + "fixed_ip_address": "10.0.0.3", + "floating_ip_address": "10.3.1.1", + "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", + "id": "04c5336a-0629-4694-ba30-04b0bdfa88a4", + "status": "ACTIVE", + "port_details": { + "status": "ACTIVE", + "name": "", + "admin_state_up": true, + "network_id": "02dd8479-ef26-4398-a102-d19d0a7b3a1f", + "device_owner": "compute:nova", + "mac_address": "fa:16:3e:b1:3b:30", + "device_id": "fcfc96da-19e2-40fd-8497-f29da1b21143" + }, + "tags": ["tag1,tag2"], + "port_forwardings": [] + }, + { + "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", + "description": "for test", + "dns_domain": "my-domain.org.", + "dns_name": "myfip", + "created_at": "2016-12-21T10:55:50Z", + "updated_at": "2016-12-21T10:55:53Z", + "revision_number": 1, + "project_id": "4969c491a3c74ee4af974e6d800c62de", + "tenant_id": "4969c491a3c74ee4af974e6d800c62de", + "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", + "fixed_ip_address": "10.0.0.4", + "floating_ip_address": "10.3.1.2", + "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", + "id": "123c5336a-0629-4694-ba30-04b0bdfa88a4", + "status": "ACTIVE", + "port_details": { + "status": "ACTIVE", + "name": "", + "admin_state_up": true, + "network_id": "02dd8479-ef26-4398-a102-d19d0a7b3a1f", + "device_owner": "compute:None", + "mac_address": "fa:16:3e:b1:3b:30", + "device_id": "cb4fba64-19e2-40fd-8497-f29da1b21143" + }, + "tags": ["tag3"], + "port_forwardings": [] + }, + { + "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", + "description": "for test", + "dns_domain": "my-domain.org.", + "dns_name": "myfip", + "created_at": "2016-12-21T10:55:50Z", + "updated_at": "2016-12-21T10:55:53Z", + "revision_number": 1, + "project_id": "4969c491a3c74ee4af974e6d800c62de", + "tenant_id": "4969c491a3c74ee4af974e6d800c62de", + "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", + "fixed_ip_address": "10.0.0.4", + "floating_ip_address": "10.3.1.3", + "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", + "id": "123c5336a-0629-4694-ba30-04b0bdfa88a4", + "status": "ACTIVE", + "port_details": { + "status": "ACTIVE", + "name": "", + "admin_state_up": true, + "network_id": "02dd8479-ef26-4398-a102-d19d0a7b3a1f", + "device_owner": "compute:region", + "mac_address": "fa:16:3e:b1:3b:30", + "device_id": "cb4fba64-19e2-40fd-8497-f29da1b21143" + }, + "tags": ["tag3"], + "port_forwardings": [] + }, + { + "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", + "description": "for test", + "dns_domain": "my-domain.org.", + "dns_name": "myfip", + "created_at": "2016-12-21T10:55:50Z", + "updated_at": "2016-12-21T10:55:53Z", + "revision_number": 1, + "project_id": "4969c491a3c74ee4af974e6d800c62de", + "tenant_id": "4969c491a3c74ee4af974e6d800c62de", + "floating_network_id": "11111111-b977-4cfe-9cba-275c80debf57", + "fixed_ip_address": "10.0.0.5", + "floating_ip_address": "10.3.1.5", + "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", + "id": "123c5336a-0629-4694-ba30-04b0bdfa88a4", + "status": "ACTIVE", + "port_details": { + "status": "ACTIVE", + "name": "", + "admin_state_up": true, + "network_id": "02dd8479-ef26-4398-a102-d19d0a7b3a1f", + "device_owner": "compute:region", + "mac_address": "fa:16:3e:b1:3b:30", + "device_id": "cb4fba64-19e2-40fd-8497-f29da1b21143" + }, + "tags": ["tag3"], + "port_forwardings": [] + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__floatingips_ip_id.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__floatingips_ip_id.json new file mode 100644 index 0000000000..28ccdb6844 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__floatingips_ip_id.json @@ -0,0 +1,32 @@ +{ + "floatingips": [ + { + "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", + "description": "for test", + "dns_domain": "my-domain.org.", + "dns_name": "myfip", + "created_at": "2016-12-21T10:55:50Z", + "updated_at": "2016-12-21T10:55:53Z", + "revision_number": 1, + "project_id": "4969c491a3c74ee4af974e6d800c62de", + "tenant_id": "4969c491a3c74ee4af974e6d800c62de", + "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", + "fixed_ip_address": "10.0.0.3", + "floating_ip_address": "10.3.1.21", + "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", + "id": "04c5336a-0629-4694-ba30-04b0bdfa88a4", + "status": "ACTIVE", + "port_details": { + "status": "ACTIVE", + "name": "", + "admin_state_up": true, + "network_id": "02dd8479-ef26-4398-a102-d19d0a7b3a1f", + "device_owner": "compute:nova", + "mac_address": "fa:16:3e:b1:3b:30", + "device_id": "fcfc96da-19e2-40fd-8497-f29da1b21143" + }, + "tags": ["tag1,tag2"], + "port_forwardings": [] + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__floatingips_net_id.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__floatingips_net_id.json new file mode 100644 index 0000000000..638625a640 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__floatingips_net_id.json @@ -0,0 +1,108 @@ +{ + "floatingips": [ + { + "router_id": null, + "description": "for test", + "dns_domain": "my-domain.org.", + "dns_name": "myfip2", + "created_at": "2016-12-21T11:55:50Z", + "updated_at": "2016-12-21T11:55:53Z", + "revision_number": 2, + "project_id": "4969c491a3c74ee4af974e6d800c62de", + "tenant_id": "4969c491a3c74ee4af974e6d800c62de", + "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", + "fixed_ip_address": null, + "floating_ip_address": "10.3.1.42", + "port_id": null, + "id": "09ea1784-2f81-46dc-8c91-244b4df75bde", + "status": "DOWN", + "port_details": null, + "tags": ["tag1,tag2"], + "port_forwardings": [] + }, + { + "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", + "description": "for test", + "dns_domain": "my-domain.org.", + "dns_name": "myfip", + "created_at": "2016-12-21T10:55:50Z", + "updated_at": "2016-12-21T10:55:53Z", + "revision_number": 1, + "project_id": "4969c491a3c74ee4af974e6d800c62de", + "tenant_id": "4969c491a3c74ee4af974e6d800c62de", + "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", + "fixed_ip_address": "10.0.0.3", + "floating_ip_address": "10.3.1.1", + "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", + "id": "04c5336a-0629-4694-ba30-04b0bdfa88a4", + "status": "ACTIVE", + "port_details": { + "status": "ACTIVE", + "name": "", + "admin_state_up": true, + "network_id": "02dd8479-ef26-4398-a102-d19d0a7b3a1f", + "device_owner": "compute:nova", + "mac_address": "fa:16:3e:b1:3b:30", + "device_id": "fcfc96da-19e2-40fd-8497-f29da1b21143" + }, + "tags": ["tag1,tag2"], + "port_forwardings": [] + }, + { + "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", + "description": "for test", + "dns_domain": "my-domain.org.", + "dns_name": "myfip", + "created_at": "2016-12-21T10:55:50Z", + "updated_at": "2016-12-21T10:55:53Z", + "revision_number": 1, + "project_id": "4969c491a3c74ee4af974e6d800c62de", + "tenant_id": "4969c491a3c74ee4af974e6d800c62de", + "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", + "fixed_ip_address": "10.0.0.4", + "floating_ip_address": "10.3.1.2", + "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", + "id": "123c5336a-0629-4694-ba30-04b0bdfa88a4", + "status": "ACTIVE", + "port_details": { + "status": "ACTIVE", + "name": "", + "admin_state_up": true, + "network_id": "02dd8479-ef26-4398-a102-d19d0a7b3a1f", + "device_owner": "compute:None", + "mac_address": "fa:16:3e:b1:3b:30", + "device_id": "cb4fba64-19e2-40fd-8497-f29da1b21143" + }, + "tags": ["tag3"], + "port_forwardings": [] + }, + { + "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", + "description": "for test", + "dns_domain": "my-domain.org.", + "dns_name": "myfip", + "created_at": "2016-12-21T10:55:50Z", + "updated_at": "2016-12-21T10:55:53Z", + "revision_number": 1, + "project_id": "4969c491a3c74ee4af974e6d800c62de", + "tenant_id": "4969c491a3c74ee4af974e6d800c62de", + "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", + "fixed_ip_address": "10.0.0.4", + "floating_ip_address": "10.3.1.3", + "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", + "id": "123c5336a-0629-4694-ba30-04b0bdfa88a4", + "status": "ACTIVE", + "port_details": { + "status": "ACTIVE", + "name": "", + "admin_state_up": true, + "network_id": "02dd8479-ef26-4398-a102-d19d0a7b3a1f", + "device_owner": "compute:region", + "mac_address": "fa:16:3e:b1:3b:30", + "device_id": "cb4fba64-19e2-40fd-8497-f29da1b21143" + }, + "tags": ["tag3"], + "port_forwardings": [] + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__network.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__network.json new file mode 100644 index 0000000000..b1b6005700 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__network.json @@ -0,0 +1,33 @@ +{ + "network": { + "admin_state_up": true, + "availability_zone_hints": [], + "availability_zones": [ + "nova" + ], + "created_at": "2016-03-08T20:19:41", + "dns_domain": "my-domain.org.", + "id": "cc2dad14-827a-feea-416b-f13e50511a0a", + "ipv4_address_scope": null, + "ipv6_address_scope": null, + "l2_adjacency": false, + "mtu": 1500, + "name": "net2", + "port_security_enabled": true, + "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", + "qos_policy_id": "bfdb6c39f71e4d44b1dfbda245c50819", + "revision_number": 3, + "router:external": false, + "shared": false, + "status": "ACTIVE", + "subnets": [ + "08eae331-0402-425a-923c-34f7cfe39c1b" + ], + "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", + "updated_at": "2016-03-08T20:19:41", + "vlan_transparent": false, + "description": "", + "is_default": false, + "tags": ["tag1,tag2"] + } +} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__network_no_tags.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__network_no_tags.json new file mode 100644 index 0000000000..19e54b6a4f --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__network_no_tags.json @@ -0,0 +1,30 @@ +{ + "network": { + "admin_state_up": true, + "availability_zone_hints": [], + "availability_zones": [ + "nova" + ], + "created_at": "2016-03-08T20:19:41", + "dns_domain": "my-domain.org.", + "id": "e4e207ac-6707-432b-82b9-244f6859c394", + "ipv4_address_scope": null, + "ipv6_address_scope": null, + "l2_adjacency": false, + "mtu": 1500, + "name": "net2", + "port_security_enabled": true, + "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", + "qos_policy_id": "bfdb6c39f71e4d44b1dfbda245c50819", + "revision_number": 3, + "router:external": false, + "shared": false, + "status": "ACTIVE", + "subnets": [ + "08eae331-0402-425a-923c-34f7cfe39c1b" + ], + "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", + "updated_at": "2016-03-08T20:19:41", + "vlan_transparent": false + } +} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__network_quota.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__network_quota.json new file mode 100644 index 0000000000..0a6d5d1bb4 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__network_quota.json @@ -0,0 +1,44 @@ +{ + "quota": { + "floatingip": { + "used": 1, + "limit": 2, + "reserved": 0 + }, + "rbac_policy": { + "used": 4, + "limit": 10, + "reserved": 0 + }, + "subnetpool": { + "used": 2, + "limit": -1, + "reserved": 0 + }, + "security_group_rule": { + "used": 10, + "limit": 100, + "reserved": 1 + }, + "security_group": { + "used": 3, + "limit": 10, + "reserved": 0 + }, + "subnet": { + "used": 3, + "limit": 100, + "reserved": 0 + }, + "port": { + "used": 21, + "limit": 500, + "reserved": 3 + }, + "network" :{ + "used": 9, + "limit": 100, + "reserved": 2 + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__networks.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__networks.json new file mode 100644 index 0000000000..fac0dcf1c9 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__networks.json @@ -0,0 +1,64 @@ +{ + "networks": [ + { + "admin_state_up": true, + "availability_zone_hints": [], + "availability_zones": [ + "nova" + ], + "created_at": "2016-03-08T20:19:41", + "dns_domain": "my-domain.org.", + "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", + "ipv4_address_scope": null, + "ipv6_address_scope": null, + "l2_adjacency": false, + "mtu": 1500, + "name": "net1", + "port_security_enabled": true, + "project_id": "4fd44f30292945e481c7b8a0c8908869", + "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", + "revision_number": 1, + "router:external": false, + "shared": false, + "status": "ACTIVE", + "subnets": [ + "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" + ], + "tenant_id": "4fd44f30292945e481c7b8a0c8908869", + "updated_at": "2016-03-08T20:19:41", + "vlan_transparent": true, + "description": "", + "is_default": false + }, + { + "admin_state_up": true, + "availability_zone_hints": [], + "availability_zones": [ + "nova" + ], + "created_at": "2016-03-08T20:19:41", + "dns_domain": "my-domain.org.", + "id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324", + "ipv4_address_scope": null, + "ipv6_address_scope": null, + "l2_adjacency": false, + "mtu": 1500, + "name": "net2", + "port_security_enabled": true, + "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", + "qos_policy_id": "bfdb6c39f71e4d44b1dfbda245c50819", + "revision_number": 3, + "router:external": false, + "shared": false, + "status": "ACTIVE", + "subnets": [ + "08eae331-0402-425a-923c-34f7cfe39c1b" + ], + "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", + "updated_at": "2016-03-08T20:19:41", + "vlan_transparent": false, + "description": "", + "is_default": false + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__networks_POST.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__networks_POST.json new file mode 100644 index 0000000000..bf5b7485a0 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__networks_POST.json @@ -0,0 +1,33 @@ +{ + "network": + { + "admin_state_up": true, + "availability_zone_hints": [], + "availability_zones": [ + "nova" + ], + "created_at": "2016-03-08T20:19:41", + "dns_domain": "my-domain.org.", + "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", + "ipv4_address_scope": null, + "ipv6_address_scope": null, + "l2_adjacency": false, + "mtu": 1500, + "name": "net1", + "port_security_enabled": true, + "project_id": "4fd44f30292945e481c7b8a0c8908869", + "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", + "revision_number": 1, + "router:external": false, + "shared": false, + "status": "ACTIVE", + "subnets": [ + "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" + ], + "tenant_id": "4fd44f30292945e481c7b8a0c8908869", + "updated_at": "2016-03-08T20:19:41", + "vlan_transparent": true, + "description": "", + "is_default": false + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__networks_public.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__networks_public.json new file mode 100644 index 0000000000..4ac5688f76 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__networks_public.json @@ -0,0 +1,64 @@ +{ + "networks": [ + { + "admin_state_up": true, + "availability_zone_hints": [], + "availability_zones": [ + "nova" + ], + "created_at": "2016-03-08T20:19:41", + "dns_domain": "my-domain.org.", + "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", + "ipv4_address_scope": null, + "ipv6_address_scope": null, + "l2_adjacency": false, + "mtu": 1500, + "name": "public", + "port_security_enabled": true, + "project_id": "4fd44f30292945e481c7b8a0c8908869", + "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", + "revision_number": 1, + "router:external": true, + "shared": false, + "status": "ACTIVE", + "subnets": [ + "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" + ], + "tenant_id": "4fd44f30292945e481c7b8a0c8908869", + "updated_at": "2016-03-08T20:19:41", + "vlan_transparent": true, + "description": "", + "is_default": false + }, + { + "admin_state_up": true, + "availability_zone_hints": [], + "availability_zones": [ + "nova" + ], + "created_at": "2016-03-08T20:19:41", + "dns_domain": "my-domain.org.", + "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", + "ipv4_address_scope": null, + "ipv6_address_scope": null, + "l2_adjacency": false, + "mtu": 1500, + "name": "foobar", + "port_security_enabled": true, + "project_id": "4fd44f30292945e481c7b8a0c8908869", + "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", + "revision_number": 1, + "router:external": true, + "shared": false, + "status": "ACTIVE", + "subnets": [ + "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" + ], + "tenant_id": "4fd44f30292945e481c7b8a0c8908869", + "updated_at": "2016-03-08T20:19:41", + "vlan_transparent": true, + "description": "", + "is_default": false + } + ] +} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__os_server_group.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__os_server_group.json new file mode 100644 index 0000000000..5069d2fccd --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__os_server_group.json @@ -0,0 +1,11 @@ +{ + "server_group": { + "id": "616fb98f-46ca-475e-917e-2563e5a8cd19", + "name": "server_group_name", + "policy": "anti-affinity", + "rules": {"max_server_per_host": 3}, + "members": [], + "project_id": "6f70656e737461636b20342065766572", + "user_id": "fake" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__os_server_groups.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__os_server_groups.json new file mode 100644 index 0000000000..9f15aef98c --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__os_server_groups.json @@ -0,0 +1,22 @@ +{ + "server_groups": [ + { + "id": "616fb98f-46ca-475e-917e-2563e5a8cd19", + "name": "test", + "policy": "anti-affinity", + "rules": {"max_server_per_host": 3}, + "members": [], + "project_id": "6f70656e737461636b20342065766572", + "user_id": "fake" + }, + { + "id": "116fb98f-46ca-475e-917e-2563e5a8cd19", + "name": "server_group_name", + "policy": "anti-affinity", + "rules": {"max_server_per_host": 2}, + "members": [], + "project_id": "6f70656e737461636b20342065766572", + "user_id": "fake" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__quota_set.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__quota_set.json new file mode 100644 index 0000000000..0cf4d2d8ad --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__quota_set.json @@ -0,0 +1,75 @@ +{ + "quota_set": { + "cores": { + "in_use": 1, + "limit": 20, + "reserved": 0 + }, + "fixed_ips": { + "in_use": 0, + "limit": -1, + "reserved": 0 + }, + "floating_ips": { + "in_use": 0, + "limit": -1, + "reserved": 0 + }, + "id": "fake_tenant", + "injected_file_content_bytes": { + "in_use": 0, + "limit": 10240, + "reserved": 0 + }, + "injected_file_path_bytes": { + "in_use": 0, + "limit": 255, + "reserved": 0 + }, + "injected_files": { + "in_use": 0, + "limit": 5, + "reserved": 0 + }, + "instances": { + "in_use": 0, + "limit": 10, + "reserved": 0 + }, + "key_pairs": { + "in_use": 0, + "limit": 100, + "reserved": 0 + }, + "metadata_items": { + "in_use": 0, + "limit": 128, + "reserved": 0 + }, + "ram": { + "in_use": 0, + "limit": 51200, + "reserved": 0 + }, + "security_group_rules": { + "in_use": 0, + "limit": -1, + "reserved": 0 + }, + "security_groups": { + "in_use": 0, + "limit": -1, + "reserved": 0 + }, + "server_group_members": { + "in_use": 0, + "limit": 10, + "reserved": 0 + }, + "server_groups": { + "in_use": 0, + "limit": 10, + "reserved": 0 + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__router.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__router.json new file mode 100644 index 0000000000..0e0694711a --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__router.json @@ -0,0 +1,39 @@ +{ + "router": + { + "admin_state_up": true, + "availability_zone_hints": [], + "availability_zones": [ + "nova" + ], + "created_at": "2018-03-19T19:17:04Z", + "description": "", + "distributed": false, + "external_gateway_info": { + "enable_snat": true, + "external_fixed_ips": [ + { + "ip_address": "172.24.4.6", + "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" + }, + { + "ip_address": "2001:db8::9", + "subnet_id": "0c56df5d-ace5-46c8-8f4c-45fa4e334d18" + } + ], + "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" + }, + "flavor_id": "f7b14d9a-b0dc-4fbe-bb14-a0f4970a69e0", + "ha": false, + "id": "f8a44de0-fc8e-45df-93c7-f79bf3b01c95", + "name": "router1", + "revision_number": 1, + "routes": [], + "status": "ACTIVE", + "updated_at": "2018-03-19T19:17:22Z", + "project_id": "0bd18306d801447bb457a46252d82d13", + "tenant_id": "0bd18306d801447bb457a46252d82d13", + "service_type_id": null, + "tags": ["tag1,tag2"] + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__router_interface.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__router_interface.json new file mode 100644 index 0000000000..e11e75b884 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__router_interface.json @@ -0,0 +1,12 @@ +{ + "id": "915a14a6-867b-4af7-83d1-70efceb146f9", + "network_id": "91c013e2-d65a-474e-9177-c3e1799ca726", + "port_id": "2dc46bcc-d1f2-4077-b99e-91ee28afaff0", + "subnet_id": "a2f1f29d-571b-4533-907f-5803ab96ead1", + "subnet_ids": [ + "a2f1f29d-571b-4533-907f-5803ab96ead1" + ], + "project_id": "0bd18306d801447bb457a46252d82d13", + "tenant_id": "0bd18306d801447bb457a46252d82d13", + "tags": ["tag1,tag2"] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__routers.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__routers.json new file mode 100644 index 0000000000..b50da8aaba --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__routers.json @@ -0,0 +1,81 @@ +{ + "routers": [ + { + "admin_state_up": true, + "availability_zone_hints": [], + "availability_zones": [ + "nova" + ], + "created_at": "2018-03-19T19:17:04Z", + "description": "", + "distributed": false, + "external_gateway_info": { + "enable_snat": true, + "external_fixed_ips": [ + { + "ip_address": "172.24.4.3", + "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" + }, + { + "ip_address": "2001:db8::c", + "subnet_id": "0c56df5d-ace5-46c8-8f4c-45fa4e334d18" + } + ], + "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" + }, + "flavor_id": "f7b14d9a-b0dc-4fbe-bb14-a0f4970a69e0", + "ha": false, + "id": "915a14a6-867b-4af7-83d1-70efceb146f9", + "name": "router2", + "revision_number": 1, + "routes": [ + { + "destination": "179.24.1.0/24", + "nexthop": "172.24.3.99" + } + ], + "status": "ACTIVE", + "updated_at": "2018-03-19T19:17:22Z", + "project_id": "0bd18306d801447bb457a46252d82d13", + "tenant_id": "0bd18306d801447bb457a46252d82d13", + "service_type_id": null, + "tags": ["tag1,tag2"] + }, + { + "admin_state_up": true, + "availability_zone_hints": [], + "availability_zones": [ + "nova" + ], + "created_at": "2018-03-19T19:17:04Z", + "description": "", + "distributed": false, + "external_gateway_info": { + "enable_snat": true, + "external_fixed_ips": [ + { + "ip_address": "172.24.4.6", + "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" + }, + { + "ip_address": "2001:db8::9", + "subnet_id": "0c56df5d-ace5-46c8-8f4c-45fa4e334d18" + } + ], + "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" + }, + "flavor_id": "f7b14d9a-b0dc-4fbe-bb14-a0f4970a69e0", + "ha": false, + "id": "f8a44de0-fc8e-45df-93c7-f79bf3b01c95", + "name": "router1", + "revision_number": 1, + "routes": [], + "status": "ACTIVE", + "updated_at": "2018-03-19T19:17:22Z", + "project_id": "0bd18306d801447bb457a46252d82d13", + "tenant_id": "0bd18306d801447bb457a46252d82d13", + "service_type_id": null, + "tags": ["tag1,tag2"] + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__security_group.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__security_group.json new file mode 100644 index 0000000000..d01f206b50 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__security_group.json @@ -0,0 +1,10 @@ +{ + "security_group": + { + "description": "Test Security Group", + "id": 6, + "name": "test", + "security_group_rules": [], + "tenant_id": "68" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__security_group_rule.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__security_group_rule.json new file mode 100644 index 0000000000..2004b5de8f --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__security_group_rule.json @@ -0,0 +1,13 @@ +{ + "security_group_rule": + { + "security_group_id": 6, + "direction": "ingress", + "port_range_max": 16, + "port_range_min": 14, + "remote_ip_prefix": "0.0.0.0/0", + "id": 2, + "protocol": "tcp" + } +} + diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__security_groups.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__security_groups.json new file mode 100644 index 0000000000..57209014a0 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__security_groups.json @@ -0,0 +1,29 @@ +{ + "security_groups": [ + { + "description": "default", + "id": 2, + "name": "default", + "security_group_rules": [], + "tenant_id": "68" + }, + { + "description": "FTP Client-Server - Open 20-21 ports", + "id": 4, + "name": "ftp", + "security_group_rules": [ + { + "security_group_id": 4, + "direction": "ingress", + "port_range_max": 21, + "port_range_min": 20, + "remote_ip_prefix": "0.0.0.0/0", + "id": 1, + "protocol": "tcp" + } + ], + "tenant_id": "68" + } + ] +} + diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__snapshot.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__snapshot.json new file mode 100644 index 0000000000..3b4e846305 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__snapshot.json @@ -0,0 +1,14 @@ +{ + "snapshot": { + "status": "available", + "os-extended-snapshot-attributes:progress": "100%", + "description": "Daily backup", + "created_at": "2013-02-25T04:13:17.07Z", + "metadata": {}, + "volume_id": "5aa119a8-d25b-45a7-8d1b-88e127885635", + "os-extended-snapshot-attributes:project_id": "0c2eba2c5af04d3f9e9d0d410b371fde", + "size": 1, + "id": "3fbbcccf-d058-4502-8844-6feeffdf4cb5", + "name": "test" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__snapshots.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__snapshots.json new file mode 100644 index 0000000000..1fad9da7b0 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__snapshots.json @@ -0,0 +1,46 @@ +{ + "snapshots": [ + { + "status": "available", + "metadata": { + "name": "test" + }, + "os-extended-snapshot-attributes:progress": "100%", + "name": "snap-001", + "volume_id": "373f7b48-c4c1-4e70-9acc-086b39073506", + "os-extended-snapshot-attributes:project_id": "bab7d5c60cd041a0a36f7c4b6e1dd978", + "created_at": "2012-02-29T03:50:07Z", + "size": 1, + "id": "3fbbcccf-d058-4502-8844-6feeffdf4cb5", + "description": "volume snapshot" + }, + { + "status": "available", + "metadata": { + "name": "test" + }, + "os-extended-snapshot-attributes:progress": "100%", + "name": "test-volume-snapshot", + "volume_id": "6edbc2f4-1507-44f8-ac0d-eed1d2608d38", + "os-extended-snapshot-attributes:project_id": "bab7d5c60cd041a0a36f7c4b6e1dd978", + "created_at": "2015-11-29T02:25:51.000000", + "size": 1, + "id": "4fbbdccf-e058-6502-8844-6feeffdf4cb5", + "description": "volume snapshot" + }, + { + "status": "available", + "metadata": { + "name": "test" + }, + "os-extended-snapshot-attributes:progress": "100%", + "name": "test-volume-snapshot", + "volume_id": "373f7b48-c4c1-4e70-9acc-086b39073506", + "os-extended-snapshot-attributes:project_id": "bab7d5c60cd041a0a36f7c4b6e1dd978", + "created_at": "2013-02-29T03:50:07Z", + "size": 1, + "id": "1fbbcccf-d058-4502-8844-6feeffdf4cb5", + "description": "volume snapshot" + } + ] +} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__snapshots_paginate_start.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__snapshots_paginate_start.json new file mode 100644 index 0000000000..8603f67a9e --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__snapshots_paginate_start.json @@ -0,0 +1,52 @@ +{ + "snapshots_links": [ + { + "href": "https://api.example.com:8776/v2/abcdec85bee34bb0a44ab8255eb36fbd/snapshots?&marker=abcde279-4cc0-4b47-a4ee-ec9c9e474b1b", + "rel": "next" + } + ], + "snapshots": [ + { + "status": "available", + "metadata": { + "name": "test" + }, + "os-extended-snapshot-attributes:progress": "100%", + "name": "snap-101", + "volume_id": "473f7b48-c4c1-4e70-9acc-086b39073506", + "os-extended-snapshot-attributes:project_id": "bab7d5c60cd041a0a36f7c4b6e1dd978", + "created_at": "2012-02-29T03:50:07Z", + "size": 1, + "id": "3fbbcccf-d058-4502-8844-6feeffdf4cb5", + "description": "volume snapshot" + }, + { + "status": "available", + "metadata": { + "name": "test2" + }, + "os-extended-snapshot-attributes:progress": "100%", + "name": "test-volume-snapshot2", + "volume_id": "7edbc2f4-1507-44f8-ac0d-eed1d2608d38", + "os-extended-snapshot-attributes:project_id": "bab7d5c60cd041a0a36f7c4b6e1dd978", + "created_at": "2015-11-29T02:25:51.000000", + "size": 1, + "id": "5fbbdccf-e058-6502-8844-6feeffdf4cb5", + "description": "volume snapshot" + }, + { + "status": "available", + "metadata": { + "name": "test2" + }, + "os-extended-snapshot-attributes:progress": "100%", + "name": "test-volume-snapshot", + "volume_id": "473f7b48-c4c1-4e70-9acc-086b39073506", + "os-extended-snapshot-attributes:project_id": "bab7d5c60cd041a0a36f7c4b6e1dd978", + "created_at": "2013-02-29T03:50:07Z", + "size": 1, + "id": "2fbbcccf-d058-4502-8844-6feeffdf4cb5", + "description": "volume snapshot" + } + ] +} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__subnet.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__subnet.json new file mode 100644 index 0000000000..dba344a602 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__subnet.json @@ -0,0 +1,32 @@ +{ + "subnet": + { + "name": "name", + "enable_dhcp": true, + "network_id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324", + "segment_id": null, + "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", + "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", + "dns_nameservers": [], + "allocation_pools": [ + { + "start": "10.0.0.2", + "end": "10.0.0.254" + } + ], + "host_routes": [], + "ip_version": 4, + "gateway_ip": "10.0.0.1", + "cidr": "10.0.0.0/24", + "id": "08eae331-0402-425a-923c-34f7cfe39c1b", + "created_at": "2016-10-10T14:35:34Z", + "description": "", + "ipv6_address_mode": null, + "ipv6_ra_mode": null, + "revision_number": 2, + "service_types": [], + "subnetpool_id": null, + "tags": ["tag1,tag2"], + "updated_at": "2016-10-10T14:35:34Z" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__subnets.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__subnets.json new file mode 100644 index 0000000000..d3f276361d --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__subnets.json @@ -0,0 +1,62 @@ +{ + "subnets": [ + { + "name": "private-subnet", + "enable_dhcp": true, + "network_id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324", + "segment_id": null, + "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", + "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", + "dns_nameservers": [], + "allocation_pools": [ + { + "start": "10.0.0.2", + "end": "10.0.0.254" + } + ], + "host_routes": [], + "ip_version": 4, + "gateway_ip": "10.0.0.1", + "cidr": "10.0.0.0/24", + "id": "08eae331-0402-425a-923c-34f7cfe39c1b", + "created_at": "2016-10-10T14:35:34Z", + "description": "", + "ipv6_address_mode": null, + "ipv6_ra_mode": null, + "revision_number": 2, + "service_types": [], + "subnetpool_id": null, + "tags": ["tag1,tag2"], + "updated_at": "2016-10-10T14:35:34Z" + }, + { + "name": "my_subnet", + "enable_dhcp": true, + "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", + "segment_id": null, + "project_id": "4fd44f30292945e481c7b8a0c8908869", + "tenant_id": "4fd44f30292945e481c7b8a0c8908869", + "dns_nameservers": [], + "allocation_pools": [ + { + "start": "192.0.0.2", + "end": "192.255.255.254" + } + ], + "host_routes": [], + "ip_version": 4, + "gateway_ip": "192.0.0.1", + "cidr": "192.0.0.0/8", + "id": "54d6f61d-db07-451c-9ab3-b9609b6b6f0b", + "created_at": "2016-10-10T14:35:47Z", + "description": "", + "ipv6_address_mode": null, + "ipv6_ra_mode": null, + "revision_number": 2, + "service_types": [], + "subnetpool_id": null, + "tags": ["tag1,tag2"], + "updated_at": "2016-10-10T14:35:47Z" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__volume.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__volume.json new file mode 100644 index 0000000000..46587e69fb --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__volume.json @@ -0,0 +1,18 @@ +{ + "volume": { + "status": "available", + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "os-vol-host-attr:host": "ip-10-168-107-25", + "source_volid": null, + "snapshot_id": null, + "id": "cd76a3a1-c4ce-40f6-9b9f-07a61508938d", + "description": "Super volume.", + "name": "test", + "created_at": "2013-02-25T02:40:21.000000", + "volume_type": "None", + "size": 1, + "metadata": {} + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__volume_abc6a3a1_c4ce_40f6_9b9f_07a61508938d.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__volume_abc6a3a1_c4ce_40f6_9b9f_07a61508938d.json new file mode 100644 index 0000000000..7b009c1582 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__volume_abc6a3a1_c4ce_40f6_9b9f_07a61508938d.json @@ -0,0 +1,22 @@ +{ + "volume": { + "attachments": [ + { + "device": "/dev/vdb", + "id": "cd76a3a1-c4ce-40f6-9b9f-07a61508938d", + "server_id": "12065", + "volume_id": "cd76a3a1-c4ce-40f6-9b9f-07a61508938d" + } + ], + "availability_zone": "nova", + "created_at": "2013-06-24T11:20:13.000000", + "display_description": "", + "display_name": "test_volume_2", + "id": "cd76a3a1-c4ce-40f6-9b9f-07a61508938d", + "metadata": {}, + "size": 2, + "snapshot_id": null, + "status": "in-use", + "volume_type": "None" + } +} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__volumes.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__volumes.json new file mode 100644 index 0000000000..8415a184df --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v2_0__volumes.json @@ -0,0 +1,44 @@ +{ + "volumes": [ + { + "status": "in-use", + "attachments": [ + { + "server_id": "f4fda93b-06e0-4743-8117-bc8bcecd651b", + "attachment_id": "3b4db356-253d-4fab-bfa0-e3626c0b8405", + "volume_id": "6edbc2f4-1507-44f8-ac0d-eed1d2608d38", + "device": "/dev/vdb", + "id": "6edbc2f4-1507-44f8-ac0d-eed1d2608d38" + } + ], + "availability_zone": "nova", + "replication_status": "disabled", + "snapshot_id": null, + "id": "6edbc2f4-1507-44f8-ac0d-eed1d2608d38", + "size": 2, + "user_id": "32779452fcd34ae1a53a797ac8a1e064", + "metadata": {}, + "description": "", + "name": "test-volume-attachments", + "created_at": "2013-06-24T11:20:13.000000", + "volume_type": "lvmdriver-1" + }, + { + "status": "some-unknown-state", + "migration_status": null, + "attachments": [], + "availability_zone": "nova", + "replication_status": "disabled", + "snapshot_id": "01f48111-7866-4cd2-986a-e92683c4a363", + "id": "cfcec3bc-b736-4db5-9535-4c24112691b5", + "size": 50, + "user_id": "32779452fcd34ae1a53a797ac8a1e064", + "metadata": {}, + "description": "some description", + "name": "test_volume", + "bootable": "false", + "created_at": "2013-06-21T12:39:02.000000", + "volume_type": null + } + ] +} diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/_v3_0__volume_quota.json b/libcloud/test/compute/fixtures/openstack_v1_1/_v3_0__volume_quota.json new file mode 100644 index 0000000000..9fe9dff822 --- /dev/null +++ b/libcloud/test/compute/fixtures/openstack_v1_1/_v3_0__volume_quota.json @@ -0,0 +1,55 @@ +{ + "quota_set": { + "backup_gigabytes": { + "in_use": 0, + "limit": 1000, + "reserved": 0 + }, + "backups": { + "in_use": 0, + "limit": 10, + "reserved": 0 + }, + "gigabytes": { + "in_use": 10, + "limit": 1000, + "reserved": 0 + }, + "gigabytes___DEFAULT__": { + "in_use": 0, + "limit": -1, + "reserved": 0 + }, + "groups": { + "in_use": 0, + "limit": 10, + "reserved": 0 + }, + "id": "fake_tenant", + "per_volume_gigabytes": { + "in_use": 0, + "limit": -1, + "reserved": 0 + }, + "snapshots": { + "in_use": 0, + "limit": 10, + "reserved": 0 + }, + "snapshots___DEFAULT__": { + "in_use": 0, + "limit": -1, + "reserved": 0 + }, + "volumes": { + "in_use": 0, + "limit": 10, + "reserved": 0 + }, + "volumes___DEFAULT__": { + "in_use": 0, + "limit": -1, + "reserved": 0 + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/openstack_v1_1/delete_floating_ip_167_138_123_111.json b/libcloud/test/compute/fixtures/openstack_v1_1/delete_floating_ip_167_138_123_111.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation.xml b/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation.xml deleted file mode 100644 index ca27554d8e..0000000000 --- a/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - 53b4c05b-341e-4ac3-b688-bdd74e53ca9b - test-net1 - test-net1 description - NA1 - 10.162.1.0 - false - - diff --git a/libcloud/test/compute/fixtures/opsource/oec_0_9_base_image.xml b/libcloud/test/compute/fixtures/opsource/oec_0_9_base_image.xml deleted file mode 100644 index 3be14f069f..0000000000 --- a/libcloud/test/compute/fixtures/opsource/oec_0_9_base_image.xml +++ /dev/null @@ -1,339 +0,0 @@ - - - - 52ed8b72-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed8b72-ebea-11df-bdc1-001517c46384 - RedHat 5.5 64-bit 1 CPU - RedHat 5.5 Enterprise (Tikanga), 64-bit - - UNIX - REDHAT5/64 - - NA1 - 1 - 2048 - 10 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed8dca-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed8dca-ebea-11df-bdc1-001517c46384 - RedHat 5.5 64-bit 2 CPU - RedHat 5.5 Enterprise (Tikanga), 64-bit - - UNIX - REDHAT5/64 - - NA1 - 2 - 4096 - 10 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed8ed8-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed8ed8-ebea-11df-bdc1-001517c46384 - RedHat 5.5 64-bit 4 CPU - RedHat 5.5 Enterprise (Tikanga), 64-bit - - UNIX - REDHAT5/64 - - NA1 - 4 - 6144 - 10 - 0 - 1970-01-01T00:00:02.010Z - - - 6fc040ae-3605-11e0-bfb5-001517c46384 - /oec/base/image/6fc040ae-3605-11e0-bfb5-001517c46384 - RedHat 5.5 32-bit 1 CPU - RedHat 5.5 Enterprise (Tikanga), 32-bit - - UNIX - REDHAT5/32 - - NA1 - 1 - 2048 - 10 - 0 - 2011-02-11T17:36:19.000Z - - - 52ed92d4-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed92d4-ebea-11df-bdc1-001517c46384 - Ubuntu 8.04.4 2 CPU - Ubuntu 8.04.4 LTS, 64-bit - - UNIX - UBUNTU8/64 - - NA1 - 2 - 4096 - 10 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed876c-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed876c-ebea-11df-bdc1-001517c46384 - Win2008 Ent 64-bit R2 2 CPU - Windows 2008 Enterprise R2 64-bit - - WINDOWS - WIN2008R2E/64 - - NA1 - 2 - 4096 - 50 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed8a5a-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed8a5a-ebea-11df-bdc1-001517c46384 - Win2008 Ent 64-bit R2 4 CPU - Windows 2008 Enterprise R2 64-bit - - WINDOWS - WIN2008R2E/64 - - NA1 - 4 - 8192 - 50 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed865e-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed865e-ebea-11df-bdc1-001517c46384 - Win2008 Std 64-bit R2 2 CPU - Windows 2008 Standard R2 64-bit - - WINDOWS - WIN2008R2S/64 - - NA1 - 2 - 4096 - 50 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed7b96-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed7b96-ebea-11df-bdc1-001517c46384 - Win2008 Std 32-bit 1 CPU - Windows 2008 Standard SP2 32-bit - - WINDOWS - WIN2008S/32 - - NA1 - 1 - 2048 - 50 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed7cb8-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed7cb8-ebea-11df-bdc1-001517c46384 - Win2008 Std 32-bit 2 CPU - Windows 2008 Standard SP2 32-bit - - WINDOWS - WIN2008S/32 - - NA1 - 2 - 4096 - 50 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed7da8-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed7da8-ebea-11df-bdc1-001517c46384 - Win2008 Std 32-bit 4 CPU - Windows 2008 Standard SP2 32-bit - - WINDOWS - WIN2008S/32 - - NA1 - 4 - 4096 - 50 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed7ea2-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed7ea2-ebea-11df-bdc1-001517c46384 - Win2008 Ent 32-bit 2 CPU - Windows 2008 Enterprise SP2 32-bit - - WINDOWS - WIN2008E/32 - - NA1 - 2 - 4096 - 50 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed8fd2-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed8fd2-ebea-11df-bdc1-001517c46384 - Red Hat 4.8 32-bit 1 CPU - Red Hat ES 4.8 (Nahant), 32-bit - - UNIX - REDHAT4/32 - - NA1 - 1 - 2048 - 10 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed90cc-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed90cc-ebea-11df-bdc1-001517c46384 - CentOS 5.5 32-bit 1 CPU - CentOS release 5.5, 32-bit - - UNIX - CENTOS5/32 - - NA1 - 1 - 2048 - 10 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed91da-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed91da-ebea-11df-bdc1-001517c46384 - CentOS 5.5 64-bit 1 CPU - CentOS release 5.5, 64-bit - - UNIX - CENTOS5/64 - - NA1 - 1 - 2048 - 10 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed766e-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed766e-ebea-11df-bdc1-001517c46384 - Win2003 Ent 32-bit 1 CPU - Windows 2003 Enterprise SP2 32-bit - - WINDOWS - WIN2003E/32 - - NA1 - 1 - 2048 - 16 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed7876-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed7876-ebea-11df-bdc1-001517c46384 - Win2003 Ent 32-bit 2 CPU - Windows 2003 Enterprise SP2 32-bit - - WINDOWS - WIN2003E/32 - - NA1 - 2 - 4096 - 16 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed7984-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed7984-ebea-11df-bdc1-001517c46384 - Win2003 Ent 32-bit 4 CPU - Windows 2003 Enterprise SP2 32-bit - - WINDOWS - WIN2003E/32 - - NA1 - 4 - 4096 - 16 - 0 - 1970-01-01T00:00:02.010Z - - - 52ed7a88-ebea-11df-bdc1-001517c46384 - /oec/base/image/52ed7a88-ebea-11df-bdc1-001517c46384 - Win2003 Std 64-bit 2 CPU - Windows 2003 Standard x64 SP2, 64-bit - - WINDOWS - WIN2003S/64 - - NA1 - 2 - 4096 - 16 - 0 - 1970-01-01T00:00:02.010Z - - - 0c231ef0-2a42-11e0-bfb5-001517c46384 - /oec/base/image/0c231ef0-2a42-11e0-bfb5-001517c46384 - RedHat 64-bit 2 CPU with MySQL - RedHat 5.5 Enterprise with MySQL 5.5 installed - - UNIX - REDHAT5/64 - - NA1 - 2 - 8192 - 10 - 0 - 2011-01-27T18:19:58.000Z - - - 2fb5261a-2a42-11e0-bfb5-001517c46384 - /oec/base/image/2fb5261a-2a42-11e0-bfb5-001517c46384 - RedHat 64-bit 2 CPU with PostgreSQL - RedHat 5.5 Enterprise with PostgreSQL 9.0 installed - - UNIX - REDHAT5/64 - - NA1 - 2 - 8192 - 10 - 0 - 2011-01-27T18:20:57.000Z - - diff --git a/libcloud/test/compute/fixtures/ovh/auth_time_get.json b/libcloud/test/compute/fixtures/ovh/auth_time_get.json new file mode 100644 index 0000000000..f84eeec940 --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/auth_time_get.json @@ -0,0 +1 @@ +1437075564 diff --git a/libcloud/test/compute/fixtures/ovh/flavor_get.json b/libcloud/test/compute/fixtures/ovh/flavor_get.json new file mode 100644 index 0000000000..21b28b39f2 --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/flavor_get.json @@ -0,0 +1 @@ +[{"id":"foo-id","disk":80,"name":"ovh.intel.ha.l","ram":8192,"vcpus":2,"region":"SBG1","type":"ovh.ceph.eg","outboundBandwidth":511,"inboundBandwidth":511,"osType":"Linux"},{"id":"bar-id","disk":80,"name":"ovh.intel.ha.l","ram":8192,"vcpus":2,"region":"SBG1","type":"ovh.ceph.eg","outboundBandwidth":511,"inboundBandwidth":511,"osType":"Linux"}] diff --git a/libcloud/test/compute/fixtures/ovh/flavor_get_detail.json b/libcloud/test/compute/fixtures/ovh/flavor_get_detail.json new file mode 100644 index 0000000000..53d27c453c --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/flavor_get_detail.json @@ -0,0 +1 @@ +{"id":"foo-id","disk":80,"name":"ra.intel.ha.l","ram":8192,"vcpus":2,"region":"SBG-1","type":"ra.s","outboundBandwidth":511,"inboundBandwidth":511} diff --git a/libcloud/test/compute/fixtures/ovh/image_get.json b/libcloud/test/compute/fixtures/ovh/image_get.json new file mode 100644 index 0000000000..aa552d98ed --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/image_get.json @@ -0,0 +1 @@ +[{"id":"foo-id","name":"Debian 8","region":"SBG-1","visibility":"public","deprecated":false},{"id":"bar-id","name":"CentOs","region":"SBG-1","visibility":"public","deprecated":false}] diff --git a/libcloud/test/compute/fixtures/ovh/image_get_detail.json b/libcloud/test/compute/fixtures/ovh/image_get_detail.json new file mode 100644 index 0000000000..6048ed31ed --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/image_get_detail.json @@ -0,0 +1 @@ +{"id":"foo-id","name":"Debian 8","region":"SBG-1","visibility":"public","deprecated":false} diff --git a/libcloud/test/compute/fixtures/ovh/instance_get.json b/libcloud/test/compute/fixtures/ovh/instance_get.json new file mode 100644 index 0000000000..61f28c8af4 --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/instance_get.json @@ -0,0 +1 @@ +[{"id":"foo","name":"test_vm","ipAddresses":[{"networkId":"","version":4, "ip":"92.0.0.1","type":"public"}],"flavorId":"551dc104-4174-495a-af34-4aafe75f22ca","imageId":"1f3b49ad-3566-4838-93f8-b657a36b870f","sshKeyId":"6447567a6447746c655bad3d","status":"ACTIVE","created":"2015-05-29T11:20:48Z","region":"SBG1"}, {"id":"bar","name":"test_vm2","ipAddresses":[{"networkId":"","version":4, "ip":"92.0.0.2","type":"public"}],"flavorId":"551dc104-4174-495a-af34-4aafe75f22ca","imageId":"1f3b49ad-3566-4838-93f8-b657a36b870f","sshKeyId":"mykey","status":"ACTIVE","created":"2015-05-29T11:40:48Z","region":"SBG-1"}] diff --git a/libcloud/test/compute/fixtures/ovh/instance_get_detail.json b/libcloud/test/compute/fixtures/ovh/instance_get_detail.json new file mode 100644 index 0000000000..b5c5df80d8 --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/instance_get_detail.json @@ -0,0 +1 @@ +{"status":"ACTIVE","region":"SBG1","name":"test_vm","image":{"visibility":"public","status":"active","region":"SBG1","name":"Ubuntu12.04","minDisk":0,"size":2.19921875,"creationDate":"2016-06-01T07:39:56Z","minRam":0,"user":"ubuntu","id":"3031ed24-8337-4b09-94b5-e51c54bec6c8","type":"linux"},"created":"2016-10-05T19:17:14Z","sshKey":{"fingerPrint":"7d:25:ec:f9:53:91:95:13:45:f9:73:a1:33:f0:00:00","regions":["SBG1"],"name":"testkey","id":"6447567a6447746c65513d3d","publicKey":"ssh-rsaAAAAB3NzaC1yc2EAAAADAQABAAACAQC80oMgRmfbUzNWk/H2vlUl2ISHjLwIUFz+b9jB2hCXoWLluyQN4dZqebusWwUUpAzzBpUcrPLYKyPcI0H9eAJaieK1QQX7gfaWLZnvHgm64i3lkDM5HbXqxd5ZL7FqEb8UbYqiR0AK05/JCvz0ux0Qb1oXMKbs+cwYuWhTgr10tumbkSyv8MZ2hamtJt3W176F3NJuNBXTKvzWmFF6AFpdUQWMgbo86SKRlnR8Q+3YiTaaPxEXSpD120QYaDFWpdvVL+IMS5ywRrFqrDoHFbsUEPEjsPHSd/B7hbjacE8dkz5BxHAGse2vNrPzcTnvw2ovj4+xQymqH7nCxv4pD++YYzeLyhyU93Zq5e9Wp72zSSfqE4X8qJsGw+zj7RZThN/imRPrg+z96ZCIpxcvOt1gsQNXsHzF3dfThssO9JR/SjyTaGcy0yn7oyhI324YtwsaNmBXo3FdZTTaJ8MRHkwQolBvhCY74uHX6cZW38UHh1+O92ExLq4JWu1dx4r9o9yrkA78kl8IoXfstxr4dpAZQIh27Z+wqbw8cpwjvkDvFr1kcrK7aifhezpihrboizhgoibnzbnefnoapfnzpiafzipanfipzanfpznaipfzapfneirnsboiseibreiosbrioebgipapigbezpiabgipezbgpiabeiprbgzbg6jfGQ=="},"monthlyBilling":null,"id":"cc350b4a-b04b-41d2-959d-1f8f388877a2","ipAddresses":[{"networkId":"","version":4,"ip":"92.0.0.1","type":"public"}],"flavor":{"outboundBandwidth":102,"disk":10,"region":"SBG1","name":"vps-ssd-1","inboundBandwidth":102,"id":"98c1e679-5f2c-4069-b4da-4a4f7179b758","vcpus":1,"type":"ovh.vps-ssd","osType":"linux","ram":2000}} diff --git a/libcloud/test/compute/fixtures/ovh/instance_post.json b/libcloud/test/compute/fixtures/ovh/instance_post.json new file mode 100644 index 0000000000..15a4075aa4 --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/instance_post.json @@ -0,0 +1 @@ +{"instanceId":"df4e55cb-90e6-4f20-a604-7084f311f498","name":"testvm","ipv4":"","created":"2015-07-16T22:35:55Z","status":"BUILD","flavor":{"id":"551dc104-4174-495a-af34-4aafe75f22ca","disk":30,"name":"ra.intel.sb.l","ram":4096,"vcpus":1,"region":"SBG-1","type":"ra.sb"},"image":{"id":"1f3b49ad-3566-4838-93f8-b657a36b870f","name":"Debian 8","region":"SBG-1","visibility":"","deprecated":false},"sshKey":{"publicKey":"ssh-dss AAAAB3NzaC1kc3MAAACBALDA8LBVhtEDgns2AFtF4hO7BckyFWUyuwCUy1Frh8UZSkrhRtfNcrbir/qcoql5psB8k1+qdqfq6RB/wYjXAqtoVNF+ydCgh5D0aWKSveYH9F/zuwyH+CGcu+fBLo/q6JAqnXziFluK9jcnu1vam3FvTD9nAsx5UYSvdTo+axlbAAAAFQCFBEBKWuCabLfUQpAoiMQSNpCsFQAAAIAVHwW6+LyDPyS/o6aV6icX0Gw8K9AG4zjj+OZWd0HxJP/Rn7ND1YrY63WC2vUAbmR0hrmoa3dS1Fw6553n+Ks41z9xzLydW8jLiopI655LrDtnMEzDpIYtr8idKq3j3IvmBfynvzhmb0r101agiMdEKsUJjGQbRAbL42pej5ee5gAAAIAbdNorJ2iFrcz8OyYi25Vjap+gqFGUYMwaHlta26WWf+ZHQdX/Kqsc4n4twkb94jjoj7doiBjN7aRAr9f3JEDUboTatpdOzanU9gSrryCBykz5RK016wwOU8fxdmaar/U47qEKa4TYwmYyA5UH+KmbYmJExC5ovXlI25oAbc1eQg== amonthe@amonthe","name":"mykey","fingerPrint":"75:19:bf:48:dc:31:5b:91:b2:e5:ba:3b:fa:dc:ef:a7","region":"BHS-1"},"region":"SBG-1"} diff --git a/libcloud/test/compute/fixtures/ovh/pricing_get.json b/libcloud/test/compute/fixtures/ovh/pricing_get.json new file mode 100644 index 0000000000..83243de9fd --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/pricing_get.json @@ -0,0 +1 @@ +{"snapshots":[],"bandwidthStorage":[],"storage":[],"archive":[],"volumes":[],"bandwidthArchiveOut":[],"projectCreation":{"currencyCode":"USD","text":"$40USD","value":40},"instances":[{"flavorId":"foo-id","flavorName":"ra.intel.ha.l","region":"SBG-1","price":{"currencyCode":"USD","text":"$40USD","value":40},"monthlyPrice":{"currencyCode":"USD","text":"$40USD","value":40}}],"bandwidthArchiveIn":[]} diff --git a/libcloud/test/compute/fixtures/ovh/region_get.json b/libcloud/test/compute/fixtures/ovh/region_get.json new file mode 100644 index 0000000000..7ed3f0b5e8 --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/region_get.json @@ -0,0 +1 @@ +["SBG1","BHS1","GRA1"] diff --git a/libcloud/test/compute/fixtures/ovh/ssh_get.json b/libcloud/test/compute/fixtures/ovh/ssh_get.json new file mode 100644 index 0000000000..3013560c08 --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/ssh_get.json @@ -0,0 +1 @@ +[{"publicKey":"ssh-dss AAAAB3NzaC1kc3MAAACBALDA8LBVhtEDgns2AFtF4hO7BckyFWUyuwCUy1Frh8UZSkrhRtfNcrbir/qcoql5psB8k1+qdqfq6RB/wYjXAqtoVNF+ABCDE5D0aWKSveYH9F/zuwyABCDEu+fBLo/q6JAqnXziFluK9jcnu1vam3FvTABCDEx5UYSvdTo+axlbAAAAFQCFBEABCDEabLfUQpAoiMQSNpCsFQAAAIAVHwW6ABCDEyS/o6aV6icX0Gw8K9AG4zjj+OZWd0HxJP/RnABCDErY63WC2vUAbmR0hrmoa3dS1Fw6553n+Ks41z9xzLydWABCDEpI655LrDtnMEzDpIYtr8idKq3j3IvmBfynvzhmb0r101agiMdEKsUJjGQbRAbL42ABCDEe5gAAAIAbdNorJ2iFrcz8OyYi25Vjap+gqFGUYMwaHlta26WWf+ZHQABCDEsc4n4twkb94jjoj7doiBjN7aRABCDEJEDUboTatpdOzanU9gSrryCBykz5RK016wwOU8fxdmaar/U47qEKa4TYwmYyA5UH+KmbYmJExC5ovXlI25oAbc1eQg== user@host","name":"mykey","id":"ham-id","regions":["SGB1"]}] diff --git a/libcloud/test/compute/fixtures/ovh/ssh_get_detail.json b/libcloud/test/compute/fixtures/ovh/ssh_get_detail.json new file mode 100644 index 0000000000..b7fa97eb6f --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/ssh_get_detail.json @@ -0,0 +1 @@ +{"publicKey":"ssh-dss AAAAB3NzaC1kc3MAAACBALDA8LBVhtEDgns2AFtF4hO7BckyFWUyuwCUy1Frh8UZSkrhRtfNcrbir/qcoql5psB8k1+qdqfq6RB/wYjXAqtoVNF+ABCDE5D0aWKSveYH9F/zuwyABCDEu+fBLo/q6JAqnXziFluK9jcnu1vam3FvTABCDEx5UYSvdTo+axlbAAAAFQCFBEABCDEabLfUQpAoiMQSNpCsFQAAAIAVHwW6ABCDEyS/o6aV6icX0Gw8K9AG4zjj+OZWd0HxJP/RnABCDErY63WC2vUAbmR0hrmoa3dS1Fw6553n+Ks41z9xzLydWABCDEpI655LrDtnMEzDpIYtr8idKq3j3IvmBfynvzhmb0r101agiMdEKsUJjGQbRAbL42ABCDEe5gAAAIAbdNorJ2iFrcz8OyYi25Vjap+gqFGUYMwaHlta26WWf+ZHQABCDEsc4n4twkb94jjoj7doiBjN7aRABCDEJEDUboTatpdOzanU9gSrryCBykz5RK016wwOU8fxdmaar/U47qEKa4TYwmYyA5UH+KmbYmJExC5ovXlI25oAbc1eQg== user@host","name":"mykey","id":"ham-id","regions":["SGB1"]} diff --git a/libcloud/test/compute/fixtures/ovh/volume_get.json b/libcloud/test/compute/fixtures/ovh/volume_get.json new file mode 100644 index 0000000000..aa0b36026e --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/volume_get.json @@ -0,0 +1 @@ +[{"id": "foo", "attachedTo": [], "created": "2015-08-09T15:13:59.459187Z", "name": "testvol", "description": "", "size": 10, "status": "creating", "region": "SBG-1", "type": "classic" }] diff --git a/libcloud/test/compute/fixtures/ovh/volume_get_detail.json b/libcloud/test/compute/fixtures/ovh/volume_get_detail.json new file mode 100644 index 0000000000..861cb4e77d --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/volume_get_detail.json @@ -0,0 +1 @@ +{"id": "foo", "attachedTo": [], "created": "2015-08-09T15:13:59.459187Z", "name": "testvol", "description": "", "size": 10, "status": "creating", "region": "SBG-1", "type": "classic" } diff --git a/libcloud/test/compute/fixtures/ovh/volume_snapshot_get.json b/libcloud/test/compute/fixtures/ovh/volume_snapshot_get.json new file mode 100644 index 0000000000..a96446afae --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/volume_snapshot_get.json @@ -0,0 +1,22 @@ +[ + { + "volumeId": "foo", + "status": "available", + "region": "GRA1", + "name": "", + "description": "", + "size": 10, + "creationDate": "2016-10-10T17:33:02Z", + "id": "foo-snap" + }, + { + "volumeId": "bar", + "status": "available", + "region": "GRA1", + "name": "", + "description": "", + "size": 10, + "creationDate": "2016-10-09T17:33:02Z", + "id": "bar-snap" + } +] diff --git a/libcloud/test/compute/fixtures/ovh/volume_snapshot_get_details.json b/libcloud/test/compute/fixtures/ovh/volume_snapshot_get_details.json new file mode 100644 index 0000000000..63eb4d631f --- /dev/null +++ b/libcloud/test/compute/fixtures/ovh/volume_snapshot_get_details.json @@ -0,0 +1,10 @@ +{ + "volumeId": "foo", + "status": "available", + "region": "GRA1", + "name": "", + "description": "", + "size": 10, + "creationDate": "2016-10-10T17:33:02Z", + "id": "foo-snap" +} diff --git a/libcloud/test/compute/fixtures/profitbricks/attach_volume.xml b/libcloud/test/compute/fixtures/profitbricks/attach_volume.xml deleted file mode 100644 index 8b2b1f5fd0..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/attach_volume.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - 3613039 - c2df1871-6aac-458e-ad1a-ef3f530cb7aa - 4 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/create_node.xml b/libcloud/test/compute/fixtures/profitbricks/create_node.xml deleted file mode 100644 index ad515ba525..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/create_node.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3768523 - 3aefc31b-57e9-4af6-8348-af961ac00f74 - 3 - 7b18b85f-cc93-4c2d-abcc-5ce732d35750 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/create_volume.xml b/libcloud/test/compute/fixtures/profitbricks/create_volume.xml deleted file mode 100644 index 326879ad26..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/create_volume.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3532463 - 06eac419-c2b3-4761-aeb9-10efdd2cf292 - 3 - f54aeea3-667a-4460-8cf0-80909509df0c - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/destroy_node.xml b/libcloud/test/compute/fixtures/profitbricks/destroy_node.xml deleted file mode 100644 index 1dacfaf484..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/destroy_node.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - 3498434 - 782247bf-f12d-4f08-8050-302c02c4b2e0 - 2 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/destroy_volume.xml b/libcloud/test/compute/fixtures/profitbricks/destroy_volume.xml deleted file mode 100644 index 0591e1cc2e..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/destroy_volume.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - 3616447 - c2df1871-6aac-458e-ad1a-ef3f530cb7aa - 13 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/detach_volume.xml b/libcloud/test/compute/fixtures/profitbricks/detach_volume.xml deleted file mode 100644 index fafc327a2a..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/detach_volume.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - 3614242 - c2df1871-6aac-458e-ad1a-ef3f530cb7aa - 6 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_clear_datacenter.xml b/libcloud/test/compute/fixtures/profitbricks/ex_clear_datacenter.xml deleted file mode 100644 index 5259d45b13..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_clear_datacenter.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - 3339052 - 8669a69f-2274-4520-b51e-dbdf3986a476 - 2 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_create_datacenter.xml b/libcloud/test/compute/fixtures/profitbricks/ex_create_datacenter.xml deleted file mode 100644 index f4238d839d..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_create_datacenter.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3711001 - 0c793dd1-d4cd-4141-86f3-8b1a24b2d604 - 1 - us/las - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_create_network_interface.xml b/libcloud/test/compute/fixtures/profitbricks/ex_create_network_interface.xml deleted file mode 100644 index 830d41d948..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_create_network_interface.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3633314 - c2df1871-6aac-458e-ad1a-ef3f530cb7aa - 27 - 951e1b49-5f1b-4b2b-b7d9-263dba6e2ddd - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_datacenter.xml b/libcloud/test/compute/fixtures/profitbricks/ex_describe_datacenter.xml deleted file mode 100644 index cb4a1a086f..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_datacenter.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - 3719240 - a3e6f83a-8982-4d6a-aebc-60baf5755ede - 1 - StackPointCloud - AVAILABLE - us/las - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_network_interface.xml b/libcloud/test/compute/fixtures/profitbricks/ex_describe_network_interface.xml deleted file mode 100644 index e2235b98c9..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_network_interface.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - 3707226 - a3a2e730-0dc3-47e6-bac6-4c056d5e2aee - 6 - f1c7a244-2fa6-44ee-8fb6-871f337683a3 - 1 - false - c09f4f31-336c-4ad2-9ec7-591778513408 - 10.10.38.12 - 02:01:96:d7:60:e0 - - false - 01490a19-2b20-43cc-86a4-ff0b0460f076 - f1c7a244-2fa6-44ee-8fb6-871f337683a3 - AVAILABLE - - true - AVAILABLE - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_node.xml b/libcloud/test/compute/fixtures/profitbricks/ex_describe_node.xml deleted file mode 100644 index 5567e8f19b..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_node.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - 3706813 - a3a2e730-0dc3-47e6-bac6-4c056d5e2aee - 6 - c09f4f31-336c-4ad2-9ec7-591778513408 - server001 - 1 - 1024 - true - 10.10.38.12 - 162.254.26.14 - - true - VIRTIO - 1 - 50 - addb19d8-e664-43c1-bd2d-ad9210edc610 - storage001 - - - a3a2e730-0dc3-47e6-bac6-4c056d5e2aee - 6 - f1c7a244-2fa6-44ee-8fb6-871f337683a3 - 1 - false - c09f4f31-336c-4ad2-9ec7-591778513408 - 10.10.38.12 - 02:01:96:d7:60:e0 - - false - 01490a19-2b20-43cc-86a4-ff0b0460f076 - f1c7a244-2fa6-44ee-8fb6-871f337683a3 - AVAILABLE - - true - AVAILABLE - - - a3a2e730-0dc3-47e6-bac6-4c056d5e2aee - 6 - e6263870-cd70-42e4-956a-00f3bbec70e3 - PUBLIC - 3 - true - c09f4f31-336c-4ad2-9ec7-591778513408 - 162.254.26.14 - 02:01:9c:53:c3:50 - - false - c0fa291e-38c2-48a6-bd15-b66ba54ac18a - e6263870-cd70-42e4-956a-00f3bbec70e3 - AVAILABLE - - false - 162.254.26.1 - AVAILABLE - - AVAILABLE - RUNNING - 2014-07-16T18:53:05.109Z - 2014-07-16T19:57:51.577Z - LINUX - AUTO - true - true - true - true - true - true - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_volume.xml b/libcloud/test/compute/fixtures/profitbricks/ex_describe_volume.xml deleted file mode 100644 index 050b4b5b54..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_volume.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - 3767716 - 905f1346-d199-425d-a035-7dc28f6819cd - 2 - 00d0b9e7-e016-456f-85a0-517aa9a34bf5 - 50 - StackPointCloud-Volume - - cd59b162-0289-11e4-9f63-52540066fee9 - Debian-7-server-2014-07-01 - - AVAILABLE - 2014-07-21T17:37:45.958Z - 2014-07-21T17:37:45.958Z - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_destroy_datacenter.xml b/libcloud/test/compute/fixtures/profitbricks/ex_destroy_datacenter.xml deleted file mode 100644 index 4d36bdb2e9..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_destroy_datacenter.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - 3339313 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_destroy_network_interface.xml b/libcloud/test/compute/fixtures/profitbricks/ex_destroy_network_interface.xml deleted file mode 100644 index 6584f068f6..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_destroy_network_interface.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - 3634902 - c2df1871-6aac-458e-ad1a-ef3f530cb7aa - 31 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_list_datacenters.xml b/libcloud/test/compute/fixtures/profitbricks/ex_list_datacenters.xml deleted file mode 100644 index dfb924526f..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_list_datacenters.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - a3e6f83a-8982-4d6a-aebc-60baf5755ede - StackPointCloud - 1 - AVAILABLE - - - c68f77b8-7ecb-40e9-8b41-79415dffc0f1 - XYZ - 2 - AVAILABLE - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_list_network_interfaces.xml b/libcloud/test/compute/fixtures/profitbricks/ex_list_network_interfaces.xml deleted file mode 100644 index 7164f22151..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_list_network_interfaces.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - c2df1871-6aac-458e-ad1a-ef3f530cb7aa - 26 - 6b38a4f3-b851-4614-9e3a-5ddff4727727 - StackPointCloud - 3 - false - 234f0cf9-1efc-4ade-b829-036456584116 - 10.14.96.11 - 162.254.26.14 - 162.254.26.15 - 02:01:40:47:90:04 - - false - e93f74b2-d969-4b7d-8fad-3931b85dbc4d - - d6f7e726-c13d-464c-b454-cae726dac75d - ANY - 1.2.3.4 - 1.2.3.4 - - - 87773a01-b7e2-481e-8a44-d5ffac830292 - ICMP - - 6b38a4f3-b851-4614-9e3a-5ddff4727727 - AVAILABLE - - true - AVAILABLE - - - c2df1871-6aac-458e-ad1a-ef3f530cb7aa - 26 - 47e3b2ce-7846-41cc-8404-1475190e89a3 - 3 - false - 7fb5d34c-77c2-4452-b7b2-274fa0f46327 - 10.14.96.12 - 02:01:fe:1c:81:73 - - false - d3d1d8b9-0dd5-4866-8429-a1817be7b6e9 - 47e3b2ce-7846-41cc-8404-1475190e89a3 - AVAILABLE - - true - AVAILABLE - - - c2df1871-6aac-458e-ad1a-ef3f530cb7aa - 26 - cbd00ace-d210-43e8-8cb7-097ad6b33e82 - 1 - true - 234f0cf9-1efc-4ade-b829-036456584116 - 208.94.38.110 - 02:01:e9:20:cd:81 - - false - a1a2e1da-7672-4a5c-af62-6c37edaffd26 - cbd00ace-d210-43e8-8cb7-097ad6b33e82 - INPROCESS - - true - 208.94.38.1 - AVAILABLE - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_start_node.xml b/libcloud/test/compute/fixtures/profitbricks/ex_start_node.xml deleted file mode 100644 index f83d6a4550..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_start_node.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - 3494585 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_stop_node.xml b/libcloud/test/compute/fixtures/profitbricks/ex_stop_node.xml deleted file mode 100644 index f83d6a4550..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_stop_node.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - 3494585 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_update_datacenter.xml b/libcloud/test/compute/fixtures/profitbricks/ex_update_datacenter.xml deleted file mode 100644 index 270aa41cd6..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_update_datacenter.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - 3325148 - d96dfafc-9a8c-4c0e-8a0c-857a15db572d - 3 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_update_network_interface.xml b/libcloud/test/compute/fixtures/profitbricks/ex_update_network_interface.xml deleted file mode 100644 index f9f8e0d43b..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_update_network_interface.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - 3665310 - aab9454d-c442-4d06-9dd7-7c6121ae5ca2 - 3 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_update_node.xml b/libcloud/test/compute/fixtures/profitbricks/ex_update_node.xml deleted file mode 100644 index 03693a7765..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_update_node.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - 3623299 - c2df1871-6aac-458e-ad1a-ef3f530cb7aa - 18 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_update_volume.xml b/libcloud/test/compute/fixtures/profitbricks/ex_update_volume.xml deleted file mode 100644 index 03693a7765..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/ex_update_volume.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - 3623299 - c2df1871-6aac-458e-ad1a-ef3f530cb7aa - 18 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/list_images.xml b/libcloud/test/compute/fixtures/profitbricks/list_images.xml deleted file mode 100644 index 3c8ac7b1f2..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/list_images.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - false - 03b6c3e7-f2ad-11e3-a036-52540066fee9 - windows-2012-r2-server-2014-06 - 11264 - HDD - false - WINDOWS - true - NORTH_AMERICA - true - - - true - cd59b162-0289-11e4-9f63-52540066fee9 - Debian-7-server-2014-07-01 - 2048 - HDD - true - LINUX - true - NORTH_AMERICA - true - - - true - d2f627c4-0289-11e4-9f63-52540066fee9 - CentOS-6-server-2014-07-01 - 2048 - HDD - true - LINUX - true - NORTH_AMERICA - true - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/list_nodes.xml b/libcloud/test/compute/fixtures/profitbricks/list_nodes.xml deleted file mode 100644 index c392d25967..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/list_nodes.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - e1e8ec0d-b47f-4d39-a91b-6e885483c899 - 5 - c8e57d7b-e731-46ad-a913-1828c0562246 - server001 - 1 - 1024 - true - 10.13.198.11 - 162.254.25.197 - 10.10.108.12 - - true - VIRTIO - 1 - 50 - b07d7c20-8cd4-4502-aab1-c0195b7f18a1 - server001-storage001 - - - e1e8ec0d-b47f-4d39-a91b-6e885483c899 - 5 - 7fb08916-eb64-40b8-a081-fafe0e374145 - 2 - false - c8e57d7b-e731-46ad-a913-1828c0562246 - 10.10.108.12 - 02:01:b9:a5:81:d9 - - false - 27062b18-aab9-4046-9071-c375121fdcd4 - 7fb08916-eb64-40b8-a081-fafe0e374145 - AVAILABLE - - true - AVAILABLE - - - e1e8ec0d-b47f-4d39-a91b-6e885483c899 - 5 - 3f980c78-89b7-4f65-8e5d-28abc2f158aa - 3 - false - c8e57d7b-e731-46ad-a913-1828c0562246 - 10.13.198.11 - 02:01:7f:31:2f:71 - - false - b644fbfd-ff6f-4ba5-882c-d0478f327819 - 3f980c78-89b7-4f65-8e5d-28abc2f158aa - AVAILABLE - - true - AVAILABLE - - - e1e8ec0d-b47f-4d39-a91b-6e885483c899 - 5 - 8df3ec08-b6f7-4038-85eb-da6620d31aa5 - 1 - true - c8e57d7b-e731-46ad-a913-1828c0562246 - 162.254.25.197 - 02:01:1f:9c:f3:24 - - false - 0bd04380-b4f3-4013-96a2-d71d134fd895 - 8df3ec08-b6f7-4038-85eb-da6620d31aa5 - AVAILABLE - - true - 162.254.25.1 - AVAILABLE - - AVAILABLE - RUNNING - 2014-07-14T20:52:20.839Z - 2014-07-14T22:11:09.324Z - LINUX - ZONE_1 - - - e1e8ec0d-b47f-4d39-a91b-6e885483c899 - 5 - 7080c05b-1a91-4661-a217-60d864acee44 - server002 - 1 - 1024 - false - 10.13.198.12 - 10.10.108.11 - - true - VIRTIO - 1 - 50 - b96f49f6-c1d3-4250-8135-35c17c827657 - server002-storage001 - - - e1e8ec0d-b47f-4d39-a91b-6e885483c899 - 5 - f1e0a1c6-329b-4629-b95b-ba81a30a4d73 - 2 - false - 7080c05b-1a91-4661-a217-60d864acee44 - 10.10.108.11 - 02:01:58:5e:9a:3c - - false - 263d5a2c-c95b-4903-b290-a33cb47616c4 - f1e0a1c6-329b-4629-b95b-ba81a30a4d73 - AVAILABLE - - true - AVAILABLE - - - e1e8ec0d-b47f-4d39-a91b-6e885483c899 - 5 - 847c50c7-d7dc-4fe6-8216-e05dc7ea7b18 - 3 - false - 7080c05b-1a91-4661-a217-60d864acee44 - 10.13.198.12 - 02:01:1e:32:2f:40 - - false - 35c42660-94d5-483d-aca7-8e6e97507508 - 847c50c7-d7dc-4fe6-8216-e05dc7ea7b18 - AVAILABLE - - true - AVAILABLE - - AVAILABLE - RUNNING - 2014-07-14T21:40:12.265Z - 2014-07-14T22:11:09.324Z - LINUX - AUTO - - - 6571ecd4-8602-4692-ae14-2f85eedbc403 - 2 - c9b9b603-65a3-4f11-bd24-ff1b494a85e2 - server001 - 1 - 1024 - false - - true - VIRTIO - 1 - 50 - 06dad54e-85b2-4146-ab15-ef55cb121921 - Storage - - AVAILABLE - RUNNING - 2014-07-14T21:06:21.421Z - 2014-07-14T21:06:21.421Z - LINUX - ZONE_2 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/list_volumes.xml b/libcloud/test/compute/fixtures/profitbricks/list_volumes.xml deleted file mode 100644 index 5b7304279d..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/list_volumes.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 06eac419-c2b3-4761-aeb9-10efdd2cf292 - 2 - 453582cf-8d54-4ec8-bc0b-f9962f7fd232 - 50 - storage001 - - d2f627c4-0289-11e4-9f63-52540066fee9 - CentOS-6-server-2014-07-01 - - ebee7d83-912b-42f1-9b62-b953351a7e29 - AVAILABLE - 2014-07-15T03:19:38.252Z - 2014-07-15T03:28:58.724Z - - - 06eac419-c2b3-4761-aeb9-10efdd2cf292 - 2 - 4e547123-897b-4520-a74e-c4ae2ff62f92 - 50 - storage002 - - d2f627c4-0289-11e4-9f63-52540066fee9 - CentOS-6-server-2014-07-01 - - 86413124-8dd3-4708-8475-9b4e7d059401 - AVAILABLE - 2014-07-15T03:19:38.252Z - 2014-07-15T03:28:58.724Z - - - 06eac419-c2b3-4761-aeb9-10efdd2cf292 - 2 - 0c893ea8-6bd7-483f-9d72-5a2fc4edff83 - 50 - storage003 - - d2f627c4-0289-11e4-9f63-52540066fee9 - CentOS-6-server-2014-07-01 - - ebee7d83-912b-42f1-9b62-b953351a7e29 - AVAILABLE - 2014-07-15T03:28:58.724Z - 2014-07-15T03:28:58.724Z - - - 06eac419-c2b3-4761-aeb9-10efdd2cf292 - 2 - 6584f97e-90f3-4664-8d5b-8ff4539bf800 - 50 - storage004 - - 10033683-01e2-11e4-9f63-52540066fee9 - Ubuntu-13.10-server-2014-07-01 - - AVAILABLE - 2014-07-15T03:28:58.724Z - 2014-07-15T03:28:58.724Z - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/profitbricks/reboot_node.xml b/libcloud/test/compute/fixtures/profitbricks/reboot_node.xml deleted file mode 100644 index afb9e37f02..0000000000 --- a/libcloud/test/compute/fixtures/profitbricks/reboot_node.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - 3492524 - - - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/scaleway/create_image.json b/libcloud/test/compute/fixtures/scaleway/create_image.json new file mode 100644 index 0000000000..3ed8174ee4 --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/create_image.json @@ -0,0 +1,21 @@ +{ + "image": { + "arch": "arm", + "creation_date": "2014-05-22T12:56:56.984011+00:00", + "extra_volumes": "[]", + "from_image": null, + "from_server": null, + "id": "98bf3ac2-a1f5-471d-8c8f-1b706ab57ef0", + "marketplace_key": null, + "modification_date": "2014-05-22T12:56:56.984011+00:00", + "name": "my_image", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "public": false, + "root_volume": { + "size": 25000000000, + "id": "f0361e7b-cbe4-4882-a999-945192b7171b", + "volume_type": "l_ssd", + "name": "vol-0-1" + } + } +} diff --git a/libcloud/test/compute/fixtures/scaleway/create_node.json b/libcloud/test/compute/fixtures/scaleway/create_node.json new file mode 100644 index 0000000000..b6897eec97 --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/create_node.json @@ -0,0 +1,40 @@ +{ + "server": { + "bootscript": null, + "creation_date": "2014-05-22T12:57:22.514299+00:00", + "dynamic_ip_required": true, + "id": "741db378", + "image": { + "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", + "name": "ubuntu working" + }, + "location": null, + "name": "my_server", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "private_ip": null, + "public_ip": null, + "enable_ipv6": true, + "state": "stopped", + "ipv6": null, + "commercial_type": "VC1S", + "arch": "x86_64", + "tags": [ + "test", + "www" + ], + "volumes": { + "0": { + "export_uri": null, + "id": "d9257116-6919-49b4-a420-dcfdff51fcb1", + "name": "vol simple snapshot", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "server": { + "id": "3cb18e2d-f4f7-48f7-b452-59b88ae8fc8c", + "name": "my_server" + }, + "size": 10000000000, + "volume_type": "l_ssd" + } + } + } +} diff --git a/libcloud/test/compute/fixtures/scaleway/create_volume.json b/libcloud/test/compute/fixtures/scaleway/create_volume.json new file mode 100644 index 0000000000..ac4dbcffca --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/create_volume.json @@ -0,0 +1,13 @@ +{ + "volume": { + "creation_date": "2014-05-22T12:57:22.514299+00:00", + "modification_date": "2014-05-22T12:57:22.514299+00:00", + "export_uri": null, + "id": "c675f420-cfeb-48ff-ba2a-9d2a4dbe3fcd", + "name": "volume-0-3", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "server": null, + "size": 10000000000, + "volume_type": "l_ssd" + } +} diff --git a/libcloud/test/compute/fixtures/scaleway/create_volume_snapshot.json b/libcloud/test/compute/fixtures/scaleway/create_volume_snapshot.json new file mode 100644 index 0000000000..9d92d52de1 --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/create_volume_snapshot.json @@ -0,0 +1,15 @@ +{ + "snapshot": { + "base_volume": { + "id": "f929fe39-63f8-4be8-a80e-1e9c8ae22a76", + "name": "vol simple snapshot" + }, + "creation_date": "2014-05-22T12:10:05.596769+00:00", + "id": "f0361e7b-cbe4-4882-a999-945192b7171b", + "name": "snapshot-0-1", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "size": 10000000000, + "state": "snapshotting", + "volume_type": "l_ssd" + } +} diff --git a/libcloud/test/compute/fixtures/scaleway/error.json b/libcloud/test/compute/fixtures/scaleway/error.json new file mode 100644 index 0000000000..2b21f5d0a7 --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/error.json @@ -0,0 +1 @@ +{"message": "Authentication error", "type": "invalid_auth"} diff --git a/libcloud/test/compute/fixtures/scaleway/error_invalid_image.json b/libcloud/test/compute/fixtures/scaleway/error_invalid_image.json new file mode 100644 index 0000000000..2a07559da5 --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/error_invalid_image.json @@ -0,0 +1 @@ +{"message": "\"01234567-89ab-cdef-fedc-ba9876543210\" not found", "type": "unknown_resource"} diff --git a/libcloud/test/compute/fixtures/scaleway/get_image.json b/libcloud/test/compute/fixtures/scaleway/get_image.json new file mode 100644 index 0000000000..df98b3d28a --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/get_image.json @@ -0,0 +1,21 @@ +{ + "image": { + "arch": "arm", + "creation_date": "2014-05-22T12:56:56.984011+00:00", + "extra_volumes": "[]", + "from_image": null, + "from_server": null, + "id": "12345", + "marketplace_key": null, + "modification_date": "2014-05-22T12:56:56.984011+00:00", + "name": "my_image", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "public": false, + "root_volume": { + "size": 25000000000, + "id": "f0361e7b-cbe4-4882-a999-945192b7171b", + "volume_type": "l_ssd", + "name": "vol-0-1" + } + } +} diff --git a/libcloud/test/compute/fixtures/scaleway/list_availability.json b/libcloud/test/compute/fixtures/scaleway/list_availability.json new file mode 100644 index 0000000000..cdef1a5fd8 --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/list_availability.json @@ -0,0 +1,13 @@ +{ + "servers": { + "X64-120GB": { + "availability": "scarce" + }, + "START1-XS": { + "availability": "available" + }, + "ARM64-4GB": { + "availability": "shortage" + } + } +} diff --git a/libcloud/test/compute/fixtures/scaleway/list_images.json b/libcloud/test/compute/fixtures/scaleway/list_images.json new file mode 100644 index 0000000000..1151d8246f --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/list_images.json @@ -0,0 +1,42 @@ +{ + "images": [ + { + "arch": "arm", + "creation_date": "2014-05-22T12:56:56.984011+00:00", + "extra_volumes": "[]", + "from_image": null, + "from_server": null, + "id": "12345", + "marketplace_key": null, + "modification_date": "2014-05-22T12:56:56.984011+00:00", + "name": "my_image", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "public": false, + "root_volume": { + "size": 50000000000, + "id": "f0361e7b-cbe4-4882-a999-945192b7171b", + "volume_type": "l_ssd", + "name": "vol-0-1" + } + }, + { + "arch": "arm", + "creation_date": "2014-05-22T12:57:22.514299+00:00", + "extra_volumes": "[]", + "from_image": null, + "from_server": null, + "id": "54321", + "marketplace_key": null, + "modification_date": "2014-05-22T12:57:22.514299+00:00", + "name": "my_image_1", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "public": false, + "root_volume": { + "size": 25000000000, + "id": "f0361e7b-cbe4-4882-a999-945192b7171b", + "volume_type": "l_ssd", + "name": "vol-0-2" + } + } + ] +} diff --git a/libcloud/test/compute/fixtures/scaleway/list_nodes.json b/libcloud/test/compute/fixtures/scaleway/list_nodes.json new file mode 100644 index 0000000000..bc4019da1d --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/list_nodes.json @@ -0,0 +1,74 @@ +{ + "servers": [ + { + "bootscript": null, + "arch": "arm", + "creation_date": "2014-05-22T12:57:22.514299+00:00", + "dynamic_public_ip": false, + "id": "741db378", + "image": { + "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", + "name": "ubuntu working" + }, + "location": null, + "name": "my_server", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "private_ip": null, + "public_ip": null, + "state": "running", + "tags": [ + "test", + "www" + ], + "volumes": { + "0": { + "export_uri": null, + "id": "c1eb8f3a-4f0b-4b95-a71c-93223e457f5a", + "name": "vol simple snapshot", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "server": { + "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", + "name": "my_server" + }, + "size": 10000000000, + "volume_type": "l_ssd" + } + } + }, + { + "bootscript": null, + "arch": "arm", + "creation_date": "2014-05-22T12:57:22.514299+00:00", + "dynamic_public_ip": false, + "id": "0e9f85af", + "image": { + "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", + "name": "ubuntu working" + }, + "location": null, + "name": "my_server", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "private_ip": null, + "public_ip": null, + "state": "running", + "tags": [ + "test", + "www" + ], + "volumes": { + "0": { + "export_uri": null, + "id": "fb09bb31-ecd9-4dff-8b55-b6e45715199d", + "name": "vol simple snapshot", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "server": { + "id": "0e9f85af-b6aa-401e-a00d-484f832c5024", + "name": "my_server" + }, + "size": 10000000000, + "volume_type": "l_ssd" + } + } + } + ] +} diff --git a/libcloud/test/compute/fixtures/scaleway/list_nodes_empty.json b/libcloud/test/compute/fixtures/scaleway/list_nodes_empty.json new file mode 100644 index 0000000000..b69ad4f73a --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/list_nodes_empty.json @@ -0,0 +1,3 @@ +{ + "servers": [] +} diff --git a/libcloud/test/compute/fixtures/scaleway/list_sizes.json b/libcloud/test/compute/fixtures/scaleway/list_sizes.json new file mode 100644 index 0000000000..650d0f8037 --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/list_sizes.json @@ -0,0 +1,76 @@ +{ + "servers": { + "X64-120GB": { + "baremetal": false, + "monthly_price": null, + "volumes_constraint": { + "min_size": 500000000000, + "max_size": 1000000000000 + }, + "network": { + "interfaces": [ + { + "internal_bandwidth": null, + "internet_bandwidth": 1073741824 + } + ], + "sum_internal_bandwidth": null, + "sum_internet_bandwidth": 1073741824, + "ipv6_support": true + }, + "hourly_price": null, + "ncpus": 12, + "ram": 128849018880, + "arch": "x86_64", + "alt_names": [] + }, + "START1-XS": { + "baremetal": false, + "monthly_price": 1.99, + "volumes_constraint": { + "min_size": 25000000000, + "max_size": 25000000000 + }, + "network": { + "interfaces": [ + { + "internal_bandwidth": null, + "internet_bandwidth": 104857600 + } + ], + "sum_internal_bandwidth": null, + "sum_internet_bandwidth": 104857600, + "ipv6_support": true + }, + "hourly_price": 0.004, + "ncpus": 1, + "ram": 1073741824, + "arch": "x86_64", + "alt_names": [] + }, + "ARM64-4GB": { + "baremetal": false, + "monthly_price": 5.99, + "volumes_constraint": { + "min_size": 100000000000, + "max_size": 100000000000 + }, + "network": { + "interfaces": [ + { + "internal_bandwidth": null, + "internet_bandwidth": 209715200 + } + ], + "sum_internal_bandwidth": null, + "sum_internet_bandwidth": 209715200, + "ipv6_support": true + }, + "hourly_price": 0.012, + "ncpus": 6, + "ram": 4294967296, + "arch": "arm64", + "alt_names": [] + } + } +} diff --git a/libcloud/test/compute/fixtures/scaleway/list_volume_snapshots.json b/libcloud/test/compute/fixtures/scaleway/list_volume_snapshots.json new file mode 100644 index 0000000000..3db699de61 --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/list_volume_snapshots.json @@ -0,0 +1,30 @@ +{ + "snapshots": [ + { + "base_volume": { + "id": "f929fe39-63f8-4be8-a80e-1e9c8ae22a76", + "name": "vol simple snapshot" + }, + "creation_date": "2014-05-22T12:11:06.055998+00:00", + "id": "6f418e5f-b42d-4423-a0b5-349c74c454a4", + "name": "snapshot-0-1", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "size": 10000000000, + "state": "snapshotting", + "volume_type": "l_ssd" + }, + { + "base_volume": { + "id": "f929fe39-63f8-4be8-a80e-1e9c8ae22a76", + "name": "vol simple snapshot" + }, + "creation_date": "2014-05-22T12:13:09.877961+00:00", + "id": "c6ff5501-eb35-44b8-aa01-8777211a830b", + "name": "snapshot-0-2", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "size": 10000000000, + "state": "snapshotting", + "volume_type": "l_ssd" + } + ] +} diff --git a/libcloud/test/compute/fixtures/scaleway/list_volumes.json b/libcloud/test/compute/fixtures/scaleway/list_volumes.json new file mode 100644 index 0000000000..0af7b388aa --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/list_volumes.json @@ -0,0 +1,26 @@ +{ + "volumes": [ + { + "export_uri": null, + "creation_date": "2014-05-22T12:56:56.984011+00:00", + "modification_date": "2014-05-22T12:56:56.984011+00:00", + "id": "f929fe39-63f8-4be8-a80e-1e9c8ae22a76", + "name": "volume-0-1", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "server": null, + "size": 10000000000, + "volume_type": "l_ssd" + }, + { + "export_uri": null, + "creation_date": "2014-05-22T12:56:56.984011+00:00", + "modification_date": "2014-05-22T12:56:56.984011+00:00", + "id": "0facb6b5-b117-441a-81c1-f28b1d723779", + "name": "volume-0-2", + "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", + "server": null, + "size": 20000000000, + "volume_type": "l_ssd" + } + ] +} diff --git a/libcloud/test/compute/fixtures/scaleway/list_volumes_empty.json b/libcloud/test/compute/fixtures/scaleway/list_volumes_empty.json new file mode 100644 index 0000000000..67995cbc29 --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/list_volumes_empty.json @@ -0,0 +1,3 @@ +{ + "volumes": [] +} diff --git a/libcloud/test/compute/fixtures/scaleway/reboot_node.json b/libcloud/test/compute/fixtures/scaleway/reboot_node.json new file mode 100644 index 0000000000..fe0b4212b2 --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/reboot_node.json @@ -0,0 +1,9 @@ +{ + "task": { + "description": "server_reboot", + "href_from": "/servers/741db378/action", + "id": "741db378", + "progress": "0", + "status": "pending" + } +} diff --git a/libcloud/test/compute/fixtures/scaleway/token_info.json b/libcloud/test/compute/fixtures/scaleway/token_info.json new file mode 100644 index 0000000000..95b5b52ca8 --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/token_info.json @@ -0,0 +1,14 @@ +{ + "token": { + "creation_date": "2014-05-22T08:06:51.742826+00:00", + "expires": "2014-05-20T14:05:06.393875+00:00", + "id": "token", + "inherits_user_perms": true, + "permissions": [], + "roles": { + "organization": null, + "role": null + }, + "user_id": "5bea0358" + } +} diff --git a/libcloud/test/compute/fixtures/scaleway/user_info.json b/libcloud/test/compute/fixtures/scaleway/user_info.json new file mode 100644 index 0000000000..ec02901c98 --- /dev/null +++ b/libcloud/test/compute/fixtures/scaleway/user_info.json @@ -0,0 +1,15 @@ +{ + "user": { + "email": "jsnow@got.com", + "firstname": "John", + "fullname": "John Snow", + "id": "5bea0358", + "lastname": "Snow", + "organizations": null, + "roles": null, + "ssh_public_keys": [{ + "fingerprint": "f5:d1:78:ed:28:72:5f:e1:ac:94:fd:1f:e0:a3:48:6d", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDGk5 example" + }] + } +} diff --git a/libcloud/test/compute/fixtures/softlayer/SoftLayer_Account.xml b/libcloud/test/compute/fixtures/softlayer/SoftLayer_Account.xml deleted file mode 100644 index 0f38ef053f..0000000000 --- a/libcloud/test/compute/fixtures/softlayer/SoftLayer_Account.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - faultCode - SoftLayer_Account - - - faultString - Failed Call - - - - - diff --git a/libcloud/test/compute/fixtures/softlayer/empty.xml b/libcloud/test/compute/fixtures/softlayer/empty.xml deleted file mode 100644 index 1acdcc956a..0000000000 --- a/libcloud/test/compute/fixtures/softlayer/empty.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/softlayer/fail.xml b/libcloud/test/compute/fixtures/softlayer/fail.xml deleted file mode 100644 index 4cd0162f66..0000000000 --- a/libcloud/test/compute/fixtures/softlayer/fail.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - faultCode - fail - - - faultString - Failed Call - - - - - diff --git a/libcloud/test/compute/fixtures/softlayer/v3_SoftLayer_Account_getVirtualGuests.xml b/libcloud/test/compute/fixtures/softlayer/v3_SoftLayer_Account_getVirtualGuests.xml deleted file mode 100644 index b37dc47450..0000000000 --- a/libcloud/test/compute/fixtures/softlayer/v3_SoftLayer_Account_getVirtualGuests.xml +++ /dev/null @@ -1,1538 +0,0 @@ - - - - - - - - - - accountId - - 282402 - - - - createDate - - 2013-11-06T14:38:36+01:00 - - - - dedicatedAccountHostOnlyFlag - - 0 - - - - domain - - example.com - - - - fullyQualifiedDomainName - - libcloud-testing1.example.com - - - - hostname - - libcloud-testing1 - - - - id - - 2875152 - - - - lastPowerStateId - - - - - - lastVerifiedDate - - - - - - maxCpu - - 1 - - - - maxCpuUnits - - CORE - - - - maxMemory - - 2048 - - - - metricPollDate - - - - - - modifyDate - - 2013-11-06T14:41:25+01:00 - - - - startCpus - - 1 - - - - statusId - - 1001 - - - - uuid - - ab98fc82-9d74-bc34-6701-f88957ebbba8 - - - - billingItem - - - - allowCancellationFlag - - 1 - - - - cancellationDate - - - - - - categoryCode - - guest_core - - - - createDate - - 2013-11-06T14:38:38+01:00 - - - - currentHourlyCharge - - .112 - - - - cycleStartDate - - 2013-11-06T14:43:20+01:00 - - - - description - - 1 x 2.0 GHz Core - - - - domainName - - example.com - - - - hostName - - libcloud-testing1 - - - - hourlyRecurringFee - - .056 - - - - hoursUsed - - 2 - - - - id - - 16447700 - - - - laborFee - - 0 - - - - laborFeeTaxRate - - .21 - - - - lastBillDate - - 2013-11-06T14:43:20+01:00 - - - - modifyDate - - 2013-11-06T14:43:20+01:00 - - - - nextBillDate - - 2013-11-28T07:00:00+01:00 - - - - oneTimeFee - - 0 - - - - oneTimeFeeTaxRate - - .21 - - - - orderItemId - - 22662589 - - - - parentId - - - - - - recurringFee - - .112 - - - - recurringFeeTaxRate - - .21 - - - - recurringMonths - - 1 - - - - serviceProviderId - - 1 - - - - setupFee - - 0 - - - - setupFeeTaxRate - - .21 - - - - resourceTableId - - 2875152 - - - - - - - datacenter - - - - id - - 168642 - - - - longName - - San Jose 1 - - - - name - - sjc01 - - - - - - - globalIdentifier - - 9ee84f87-e558-4548-9b89-fe7d997706b8 - - - - operatingSystem - - - - hardwareId - - - - - - id - - 2200995 - - - - manufacturerLicenseInstance - - - - - - passwords - - - - - - - createDate - - 2013-11-06T14:38:56+01:00 - - - - id - - 1856975 - - - - modifyDate - - 2013-11-06T14:38:56+01:00 - - - - password - - L3TJVubf - - - - port - - - - - - softwareId - - 2200995 - - - - username - - root - - - - - - - - - - softwareLicense - - - - id - - 1523 - - - - softwareDescriptionId - - 1163 - - - - softwareDescription - - - - controlPanel - - 0 - - - - id - - 1163 - - - - longDescription - - Debian / Debian / 7.0.0-64 Minimal for CCI - - - - manufacturer - - Debian - - - - name - - Debian - - - - operatingSystem - - 1 - - - - referenceCode - - DEBIAN_7_64 - - - - upgradeSoftwareDescriptionId - - - - - - upgradeSwDescId - - - - - - version - - 7.0.0-64 Minimal for CCI - - - - virtualLicense - - 0 - - - - virtualizationPlatform - - 0 - - - - requiredUser - - root - - - - - - - - - - - - - powerState - - - - keyName - - RUNNING - - - - name - - Running - - - - - - - primaryBackendIpAddress - - 10.55.43.130 - - - - primaryIpAddress - - 50.23.95.202 - - - - - - - - accountId - - 282402 - - - - createDate - - 2013-11-06T15:14:52+01:00 - - - - dedicatedAccountHostOnlyFlag - - 0 - - - - domain - - example.com - - - - fullyQualifiedDomainName - - libcloud-testing2.example.com - - - - hostname - - libcloud-testing2 - - - - id - - 2875213 - - - - lastPowerStateId - - - - - - lastVerifiedDate - - - - - - maxCpu - - 1 - - - - maxCpuUnits - - CORE - - - - maxMemory - - 2048 - - - - metricPollDate - - - - - - modifyDate - - 2013-11-06T15:17:56+01:00 - - - - startCpus - - 1 - - - - statusId - - 1001 - - - - uuid - - 8f10bea1-3e26-70d7-d581-0d9e820eae0c - - - - billingItem - - - - allowCancellationFlag - - 1 - - - - cancellationDate - - - - - - categoryCode - - guest_core - - - - createDate - - 2013-11-06T15:14:55+01:00 - - - - currentHourlyCharge - - .056 - - - - cycleStartDate - - 2013-11-06T15:19:50+01:00 - - - - description - - 1 x 2.0 GHz Core - - - - domainName - - example.com - - - - hostName - - libcloud-testing2 - - - - hourlyRecurringFee - - .056 - - - - hoursUsed - - 1 - - - - id - - 16447908 - - - - laborFee - - 0 - - - - laborFeeTaxRate - - .21 - - - - lastBillDate - - 2013-11-06T15:19:50+01:00 - - - - modifyDate - - 2013-11-06T15:19:50+01:00 - - - - nextBillDate - - 2013-11-28T07:00:00+01:00 - - - - oneTimeFee - - 0 - - - - oneTimeFeeTaxRate - - .21 - - - - orderItemId - - 22663091 - - - - parentId - - - - - - recurringFee - - .056 - - - - recurringFeeTaxRate - - .21 - - - - recurringMonths - - 1 - - - - serviceProviderId - - 1 - - - - setupFee - - 0 - - - - setupFeeTaxRate - - .21 - - - - resourceTableId - - 2875213 - - - - - - - datacenter - - - - id - - 168642 - - - - longName - - San Jose 1 - - - - name - - sjc01 - - - - - - - globalIdentifier - - 5c704e34-6ee7-4efe-9722-af9d406fa930 - - - - operatingSystem - - - - hardwareId - - - - - - id - - 2201027 - - - - manufacturerLicenseInstance - - - - - - softwareLicense - - - - id - - 1523 - - - - softwareDescriptionId - - 1163 - - - - softwareDescription - - - - controlPanel - - 0 - - - - id - - 1163 - - - - longDescription - - Debian / Debian / 7.0.0-64 Minimal for CCI - - - - manufacturer - - Debian - - - - name - - Debian - - - - operatingSystem - - 1 - - - - referenceCode - - DEBIAN_7_64 - - - - upgradeSoftwareDescriptionId - - - - - - upgradeSwDescId - - - - - - version - - 7.0.0-64 Minimal for CCI - - - - virtualLicense - - 0 - - - - virtualizationPlatform - - 0 - - - - requiredUser - - root - - - - - - - - - - - - - powerState - - - - keyName - - INITIATING - - - - name - - Running - - - - - - - primaryBackendIpAddress - - 10.55.43.131 - - - - primaryIpAddress - - 50.23.95.203 - - - - - - - - accountId - - 282402 - - - - createDate - - 2013-11-06T15:36:53+01:00 - - - - dedicatedAccountHostOnlyFlag - - 0 - - - - domain - - example.com - - - - fullyQualifiedDomainName - - libcloud-testing.example.com - - - - hostname - - libcloud-testing - - - - id - - 2875273 - - - - lastPowerStateId - - - - - - lastVerifiedDate - - - - - - maxCpu - - 1 - - - - maxCpuUnits - - CORE - - - - maxMemory - - 2048 - - - - metricPollDate - - - - - - modifyDate - - 2013-11-06T15:39:35+01:00 - - - - startCpus - - 1 - - - - statusId - - 1001 - - - - uuid - - f86371c5-103b-34d3-ae27-e4dafa1c4718 - - - - billingItem - - - - allowCancellationFlag - - 1 - - - - cancellationDate - - - - - - categoryCode - - guest_core - - - - createDate - - 2013-11-06T15:36:55+01:00 - - - - currentHourlyCharge - - .056 - - - - cycleStartDate - - 2013-11-06T15:41:31+01:00 - - - - description - - 1 x 2.0 GHz Core - - - - domainName - - example.com - - - - hostName - - libcloud-testing - - - - hourlyRecurringFee - - .056 - - - - hoursUsed - - 1 - - - - id - - 16448162 - - - - laborFee - - 0 - - - - laborFeeTaxRate - - .21 - - - - lastBillDate - - 2013-11-06T15:41:31+01:00 - - - - modifyDate - - 2013-11-06T15:41:31+01:00 - - - - nextBillDate - - 2013-11-28T07:00:00+01:00 - - - - oneTimeFee - - 0 - - - - oneTimeFeeTaxRate - - .21 - - - - orderItemId - - 22663578 - - - - parentId - - - - - - recurringFee - - .056 - - - - recurringFeeTaxRate - - .21 - - - - recurringMonths - - 1 - - - - serviceProviderId - - 1 - - - - setupFee - - 0 - - - - setupFeeTaxRate - - .21 - - - - resourceTableId - - 2875273 - - - - - - - datacenter - - - - id - - 168642 - - - - longName - - San Jose 1 - - - - name - - sjc01 - - - - - - - globalIdentifier - - e8ab9d1c-edd8-4a1a-a13c-ff74838b5ab6 - - - - operatingSystem - - - - hardwareId - - - - - - id - - 2201049 - - - - manufacturerLicenseInstance - - - - - - passwords - - - - - - - createDate - - 2013-11-06T15:37:10+01:00 - - - - id - - 1857066 - - - - modifyDate - - 2013-11-06T15:37:10+01:00 - - - - password - - HmyHw89J - - - - port - - - - - - softwareId - - 2201049 - - - - username - - root - - - - - - - - - - softwareLicense - - - - id - - 1523 - - - - softwareDescriptionId - - 1163 - - - - softwareDescription - - - - controlPanel - - 0 - - - - id - - 1163 - - - - longDescription - - Debian / Debian / 7.0.0-64 Minimal for CCI - - - - manufacturer - - Debian - - - - name - - Debian - - - - operatingSystem - - 1 - - - - referenceCode - - DEBIAN_7_64 - - - - upgradeSoftwareDescriptionId - - - - - - upgradeSwDescId - - - - - - version - - 7.0.0-64 Minimal for CCI - - - - virtualLicense - - 0 - - - - virtualizationPlatform - - 0 - - - - requiredUser - - root - - - - - - - - - - - - - powerState - - - - keyName - - RUNNING - - - - name - - Running - - - - - - - primaryBackendIpAddress - - 10.55.43.132 - - - - primaryIpAddress - - 50.23.95.204 - - - - - - - - - - diff --git a/libcloud/test/compute/fixtures/softlayer/v3_SoftLayer_Location_Datacenter_getDatacenters.xml b/libcloud/test/compute/fixtures/softlayer/v3_SoftLayer_Location_Datacenter_getDatacenters.xml deleted file mode 100644 index b70419488e..0000000000 --- a/libcloud/test/compute/fixtures/softlayer/v3_SoftLayer_Location_Datacenter_getDatacenters.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - id - - 2 - - - - name - - dal05 - - - - longName - - Dallas 5 - - - - - - - - id - - 3 - - - - name - - dal01 - - - - longName - - Dallas - - - - - - - - id - - 18171 - - - - name - - sea01 - - - - longName - - Seattle - - - - - - - - id - - 37473 - - - - name - - wdc01 - - - - longName - - Washington, DC - - - - - - - - id - - 12345 - - - - name - - newcity01 - - - - longName - - New City - - - - - - - - - diff --git a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Account_getSshKeys.xml b/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Account_getSshKeys.xml deleted file mode 100644 index a06952c54c..0000000000 --- a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Account_getSshKeys.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - id - - 1 - - - - key - - ssh-key - - - - label - - test1 - - - - fingerprint - - 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 - - - - - - - - - - id - - 2 - - - - key - - ssh-key - - - - label - - test2 - - - - fingerprint - - 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 - - - - - - diff --git a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Security_Ssh_Key_createObject.xml b/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Security_Ssh_Key_createObject.xml deleted file mode 100644 index 716832eca3..0000000000 --- a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Security_Ssh_Key_createObject.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - id - - 1 - - - - key - - ssh-key - - - - label - - my-key-pair - - - - label - - my-key-pair - - - - fingerprint - - 1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f - - - - - - diff --git a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Security_Ssh_Key_deleteObject.xml b/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Security_Ssh_Key_deleteObject.xml deleted file mode 100644 index 119680e5dc..0000000000 --- a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Security_Ssh_Key_deleteObject.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - status - - success - - - - - - diff --git a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Security_Ssh_Key_getObject.xml b/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Security_Ssh_Key_getObject.xml deleted file mode 100644 index cf96523023..0000000000 --- a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Security_Ssh_Key_getObject.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - id - - 1 - - - - key - - ssh-key - - - - label - - test1 - - - - fingerprint - - 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 - - - - - - diff --git a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Virtual_Guest_createObject.xml b/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Virtual_Guest_createObject.xml deleted file mode 100644 index 09659cde75..0000000000 --- a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Virtual_Guest_createObject.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - accountId - - 12345 - - - - createDate - - 2013-01-01T19:31:22-06:00 - - - - dedicatedAccountHostOnlyFlag - - 0 - - - - domain - - domain.com - - - - fullyQualifiedDomainName - - hostname.domain.com - - - - hostname - - hostname - - - - id - - 123456 - - - - lastPowerStateId - - - - - - lastVerifiedDate - - - - - - maxCpu - - 2 - - - - maxCpuUnits - - CORE - - - - maxMemory - - 2048 - - - - metricPollDate - - - - - - modifyDate - - - - - - privateNetworkOnlyFlag - - 0 - - - - startCpus - - 2 - - - - statusId - - 1001 - - - - globalIdentifier - - f47ac10b-58cc-4372-a567-0e02b2c3d479 - - - - managedResourceFlag - - 0 - - - - powerState - - - - keyName - - HALTED - - - - name - - Halted - - - - - - - - - diff --git a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Virtual_Guest_getCreateObjectOptions.xml b/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Virtual_Guest_getCreateObjectOptions.xml deleted file mode 100644 index a6d94a6c5b..0000000000 --- a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Virtual_Guest_getCreateObjectOptions.xml +++ /dev/null @@ -1,12527 +0,0 @@ - - - - - - - blockDevices - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - 25 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 0 - - - - diskImage - - - - capacity - - 25 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .025 - - - - recurringFee - - 18 - - - - item - - - - description - - 100 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 0 - - - - diskImage - - - - capacity - - 100 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .012 - - - - recurringFee - - 8 - - - - item - - - - description - - 10 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 10 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .015 - - - - recurringFee - - 10 - - - - item - - - - description - - 20 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 20 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .016 - - - - recurringFee - - 11 - - - - item - - - - description - - 25 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 25 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .017 - - - - recurringFee - - 12 - - - - item - - - - description - - 30 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 30 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .019 - - - - recurringFee - - 14 - - - - item - - - - description - - 40 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 40 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .021 - - - - recurringFee - - 16 - - - - item - - - - description - - 50 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 50 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .023 - - - - recurringFee - - 17 - - - - item - - - - description - - 75 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 75 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .025 - - - - recurringFee - - 18 - - - - item - - - - description - - 100 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 100 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .028 - - - - recurringFee - - 19 - - - - item - - - - description - - 125 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 125 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .03 - - - - recurringFee - - 20 - - - - item - - - - description - - 150 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 150 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .035 - - - - recurringFee - - 21 - - - - item - - - - description - - 175 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 175 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .04 - - - - recurringFee - - 22 - - - - item - - - - description - - 200 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 200 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 25 - - - - item - - - - description - - 250 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 250 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .06 - - - - recurringFee - - 32.5 - - - - item - - - - description - - 300 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 300 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .07 - - - - recurringFee - - 40 - - - - item - - - - description - - 350 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 350 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .08 - - - - recurringFee - - 45 - - - - item - - - - description - - 400 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 400 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .1 - - - - recurringFee - - 50 - - - - item - - - - description - - 500 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 500 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .15 - - - - recurringFee - - 75 - - - - item - - - - description - - 750 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 750 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .2 - - - - recurringFee - - 100 - - - - item - - - - description - - 1,000 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 1000 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .25 - - - - recurringFee - - 150 - - - - item - - - - description - - 1,500 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 1500 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .3 - - - - recurringFee - - 200 - - - - item - - - - description - - 2,000 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 2000 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .012 - - - - recurringFee - - 8 - - - - item - - - - description - - 10 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 10 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .015 - - - - recurringFee - - 10 - - - - item - - - - description - - 20 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 20 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .016 - - - - recurringFee - - 11 - - - - item - - - - description - - 25 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 25 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .017 - - - - recurringFee - - 12 - - - - item - - - - description - - 30 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 30 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .019 - - - - recurringFee - - 14 - - - - item - - - - description - - 40 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 40 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .021 - - - - recurringFee - - 16 - - - - item - - - - description - - 50 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 50 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .023 - - - - recurringFee - - 17 - - - - item - - - - description - - 75 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 75 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .025 - - - - recurringFee - - 18 - - - - item - - - - description - - 100 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 100 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .028 - - - - recurringFee - - 19 - - - - item - - - - description - - 125 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 125 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .03 - - - - recurringFee - - 20 - - - - item - - - - description - - 150 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 150 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .035 - - - - recurringFee - - 21 - - - - item - - - - description - - 175 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 175 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .04 - - - - recurringFee - - 22 - - - - item - - - - description - - 200 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 200 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 25 - - - - item - - - - description - - 250 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 250 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .06 - - - - recurringFee - - 32.5 - - - - item - - - - description - - 300 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 300 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .07 - - - - recurringFee - - 40 - - - - item - - - - description - - 350 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 350 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .08 - - - - recurringFee - - 45 - - - - item - - - - description - - 400 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 400 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .1 - - - - recurringFee - - 50 - - - - item - - - - description - - 500 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 500 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .15 - - - - recurringFee - - 75 - - - - item - - - - description - - 750 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 750 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .2 - - - - recurringFee - - 100 - - - - item - - - - description - - 1,000 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 1000 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .25 - - - - recurringFee - - 150 - - - - item - - - - description - - 1,500 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 1500 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .3 - - - - recurringFee - - 200 - - - - item - - - - description - - 2,000 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 3 - - - - diskImage - - - - capacity - - 2000 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .012 - - - - recurringFee - - 8 - - - - item - - - - description - - 10 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 10 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .015 - - - - recurringFee - - 10 - - - - item - - - - description - - 20 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 20 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .016 - - - - recurringFee - - 11 - - - - item - - - - description - - 25 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 25 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .017 - - - - recurringFee - - 12 - - - - item - - - - description - - 30 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 30 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .019 - - - - recurringFee - - 14 - - - - item - - - - description - - 40 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 40 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .021 - - - - recurringFee - - 16 - - - - item - - - - description - - 50 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 50 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .023 - - - - recurringFee - - 17 - - - - item - - - - description - - 75 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 75 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .025 - - - - recurringFee - - 18 - - - - item - - - - description - - 100 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 100 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .028 - - - - recurringFee - - 19 - - - - item - - - - description - - 125 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 125 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .03 - - - - recurringFee - - 20 - - - - item - - - - description - - 150 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 150 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .035 - - - - recurringFee - - 21 - - - - item - - - - description - - 175 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 175 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .04 - - - - recurringFee - - 22 - - - - item - - - - description - - 200 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 200 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 25 - - - - item - - - - description - - 250 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 250 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .06 - - - - recurringFee - - 32.5 - - - - item - - - - description - - 300 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 300 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .07 - - - - recurringFee - - 40 - - - - item - - - - description - - 350 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 350 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .08 - - - - recurringFee - - 45 - - - - item - - - - description - - 400 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 400 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .1 - - - - recurringFee - - 50 - - - - item - - - - description - - 500 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 500 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .15 - - - - recurringFee - - 75 - - - - item - - - - description - - 750 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 750 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .2 - - - - recurringFee - - 100 - - - - item - - - - description - - 1,000 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 1000 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .25 - - - - recurringFee - - 150 - - - - item - - - - description - - 1,500 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 1500 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .3 - - - - recurringFee - - 200 - - - - item - - - - description - - 2,000 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 4 - - - - diskImage - - - - capacity - - 2000 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .012 - - - - recurringFee - - 8 - - - - item - - - - description - - 10 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 10 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .015 - - - - recurringFee - - 10 - - - - item - - - - description - - 20 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 20 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .016 - - - - recurringFee - - 11 - - - - item - - - - description - - 25 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 25 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .017 - - - - recurringFee - - 12 - - - - item - - - - description - - 30 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 30 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .019 - - - - recurringFee - - 14 - - - - item - - - - description - - 40 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 40 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .021 - - - - recurringFee - - 16 - - - - item - - - - description - - 50 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 50 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .023 - - - - recurringFee - - 17 - - - - item - - - - description - - 75 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 75 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .025 - - - - recurringFee - - 18 - - - - item - - - - description - - 100 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 100 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .028 - - - - recurringFee - - 19 - - - - item - - - - description - - 125 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 125 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .03 - - - - recurringFee - - 20 - - - - item - - - - description - - 150 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 150 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .035 - - - - recurringFee - - 21 - - - - item - - - - description - - 175 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 175 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .04 - - - - recurringFee - - 22 - - - - item - - - - description - - 200 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 200 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 25 - - - - item - - - - description - - 250 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 250 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .06 - - - - recurringFee - - 32.5 - - - - item - - - - description - - 300 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 300 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .07 - - - - recurringFee - - 40 - - - - item - - - - description - - 350 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 350 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .08 - - - - recurringFee - - 45 - - - - item - - - - description - - 400 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 400 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .1 - - - - recurringFee - - 50 - - - - item - - - - description - - 500 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 500 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .15 - - - - recurringFee - - 75 - - - - item - - - - description - - 750 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 750 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .2 - - - - recurringFee - - 100 - - - - item - - - - description - - 1,000 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 1000 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .25 - - - - recurringFee - - 150 - - - - item - - - - description - - 1,500 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 1500 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .3 - - - - recurringFee - - 200 - - - - item - - - - description - - 2,000 GB (SAN) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 5 - - - - diskImage - - - - capacity - - 2000 - - - - - - - - - - - - - localDiskFlag - - 0 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - 25 GB (LOCAL) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 0 - - - - diskImage - - - - capacity - - 25 - - - - - - - - - - - - - localDiskFlag - - 1 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .01 - - - - recurringFee - - 7 - - - - item - - - - description - - 100 GB (LOCAL) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 0 - - - - diskImage - - - - capacity - - 100 - - - - - - - - - - - - - localDiskFlag - - 1 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .005 - - - - recurringFee - - 3.25 - - - - item - - - - description - - 25 GB (LOCAL) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 25 - - - - - - - - - - - - - localDiskFlag - - 1 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .01 - - - - recurringFee - - 7 - - - - item - - - - description - - 100 GB (LOCAL) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 100 - - - - - - - - - - - - - localDiskFlag - - 1 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .015 - - - - recurringFee - - 9 - - - - item - - - - description - - 150 GB (LOCAL) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 150 - - - - - - - - - - - - - localDiskFlag - - 1 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .02 - - - - recurringFee - - 14 - - - - item - - - - description - - 200 GB (LOCAL) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 200 - - - - - - - - - - - - - localDiskFlag - - 1 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .03 - - - - recurringFee - - 21 - - - - item - - - - description - - 300 GB (LOCAL) - - - - - - - - - - template - - - - blockDevices - - - - - - - device - - 2 - - - - diskImage - - - - capacity - - 300 - - - - - - - - - - - - - localDiskFlag - - 1 - - - - - - - - - - - - - datacenters - - - - - - - template - - - - datacenter - - - - name - - ams01 - - - - - - - - - - - - - - template - - - - datacenter - - - - name - - dal05 - - - - - - - - - - - - - - template - - - - datacenter - - - - name - - dal06 - - - - - - - - - - - - - - template - - - - datacenter - - - - name - - sea01 - - - - - - - - - - - - - - template - - - - datacenter - - - - name - - sjc01 - - - - - - - - - - - - - - template - - - - datacenter - - - - name - - sng01 - - - - - - - - - - - - - - template - - - - datacenter - - - - name - - wdc01 - - - - - - - - - - - - - - - - memory - - - - - - - itemPrice - - - - hourlyRecurringFee - - .03 - - - - recurringFee - - 21 - - - - item - - - - description - - 1 GB - - - - - - - - - - template - - - - maxMemory - - 1024 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .06 - - - - recurringFee - - 42 - - - - item - - - - description - - 2 GB - - - - - - - - - - template - - - - maxMemory - - 2048 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .085 - - - - recurringFee - - 59.5 - - - - item - - - - description - - 3 GB - - - - - - - - - - template - - - - maxMemory - - 3072 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .11 - - - - recurringFee - - 77 - - - - item - - - - description - - 4 GB - - - - - - - - - - template - - - - maxMemory - - 4096 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .14 - - - - recurringFee - - 98 - - - - item - - - - description - - 5 GB - - - - - - - - - - template - - - - maxMemory - - 5120 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .165 - - - - recurringFee - - 115.5 - - - - item - - - - description - - 6 GB - - - - - - - - - - template - - - - maxMemory - - 6144 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .195 - - - - recurringFee - - 136.5 - - - - item - - - - description - - 7 GB - - - - - - - - - - template - - - - maxMemory - - 7168 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .215 - - - - recurringFee - - 150.5 - - - - item - - - - description - - 8 GB - - - - - - - - - - template - - - - maxMemory - - 8192 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .245 - - - - recurringFee - - 171.5 - - - - item - - - - description - - 9 GB - - - - - - - - - - template - - - - maxMemory - - 9216 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .265 - - - - recurringFee - - 185.5 - - - - item - - - - description - - 10 GB - - - - - - - - - - template - - - - maxMemory - - 10240 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .29 - - - - recurringFee - - 203 - - - - item - - - - description - - 11 GB - - - - - - - - - - template - - - - maxMemory - - 11264 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .31 - - - - recurringFee - - 217 - - - - item - - - - description - - 12 GB - - - - - - - - - - template - - - - maxMemory - - 12288 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .33 - - - - recurringFee - - 231 - - - - item - - - - description - - 13 GB - - - - - - - - - - template - - - - maxMemory - - 13312 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .345 - - - - recurringFee - - 241.5 - - - - item - - - - description - - 14 GB - - - - - - - - - - template - - - - maxMemory - - 14336 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .36 - - - - recurringFee - - 252 - - - - item - - - - description - - 15 GB - - - - - - - - - - template - - - - maxMemory - - 15360 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .375 - - - - recurringFee - - 262.5 - - - - item - - - - description - - 16 GB - - - - - - - - - - template - - - - maxMemory - - 16384 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .76 - - - - recurringFee - - 525 - - - - item - - - - description - - 32 GB - - - - - - - - - - template - - - - maxMemory - - 32768 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 3.5 - - - - recurringFee - - 2500 - - - - item - - - - description - - 48 GB - - - - - - - - - - template - - - - maxMemory - - 49152 - - - - - - - - - - - - - networkComponents - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - 10 Mbps Public & Private Networks - - - - - - - - - - template - - - - networkComponents - - - - - - - maxSpeed - - 10 - - - - - - - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - 100 Mbps Private Network - - - - - - - - - - template - - - - networkComponents - - - - - - - maxSpeed - - 100 - - - - - - - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .04 - - - - recurringFee - - 20 - - - - item - - - - description - - 1 Gbps Public & Private Networks - - - - - - - - - - template - - - - networkComponents - - - - - - - maxSpeed - - 1000 - - - - - - - - - - - - - - - - - - - operatingSystems - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - CentOS 6.0 - Minimal Install (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - CENTOS_6_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - CentOS 6.0 - Minimal Install (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - CENTOS_6_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - CentOS 5 - Minimal Install (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - CENTOS_5_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - CentOS 5 - Minimal Install (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - CENTOS_5_32 - - - - - - - - - - - itemPrice - - - - recurringFee - - 12 - - - - item - - - - description - - CloudLinux 6 (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - CLOUDLINUX_6_64 - - - - - - - - - - - itemPrice - - - - recurringFee - - 12 - - - - item - - - - description - - CloudLinux 6 (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - CLOUDLINUX_6_32 - - - - - - - - - - - itemPrice - - - - recurringFee - - 12 - - - - item - - - - description - - CloudLinux 5 (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - CLOUDLINUX_5_64 - - - - - - - - - - - itemPrice - - - - recurringFee - - 12 - - - - item - - - - description - - CloudLinux 5 (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - CLOUDLINUX_5_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Debian GNU/Linux 7.0 Wheezy/Stable - Minimal Install (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - DEBIAN_7_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Debian GNU/Linux 7.0 Wheezy/Stable - Minimal Install (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - DEBIAN_7_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Debian GNU/Linux 6.0 Squeeze/Stable - Minimal Install (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - DEBIAN_6_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Debian GNU/Linux 6.0 Squeeze/Stable - Minimal Install (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - DEBIAN_6_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Debian GNU/Linux 5.0 Lenny/Stable - Minimal Install (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - DEBIAN_5_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Debian GNU/Linux 5.0 Lenny/Stable - Minimal Install (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - DEBIAN_5_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .08 - - - - recurringFee - - 45 - - - - item - - - - description - - Red Hat Enterprise Linux 6 - Minimal Install (64 bit) (1 - 4 Core) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - REDHAT_6_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .12 - - - - recurringFee - - 100 - - - - item - - - - description - - Red Hat Enterprise Linux 6 - Minimal Install (64 bit) (5 - 100 Core) - - - - id - - -3839 - - - - softwareDescriptionId - - - - - - upgradeItemId - - - - - - softwareDescription - - - - controlPanel - - 0 - - - - id - - 795 - - - - longDescription - - Redhat / EL / 6.0-64 Minimal for CCI - - - - manufacturer - - Redhat - - - - name - - EL - - - - operatingSystem - - 1 - - - - referenceCode - - REDHAT_6_64 - - - - upgradeSoftwareDescriptionId - - - - - - upgradeSwDescId - - - - - - version - - 6.0-64 Minimal for CCI - - - - virtualLicense - - 0 - - - - virtualizationPlatform - - 0 - - - - requiredUser - - root - - - - - - - - - - - - - template - - - - operatingSystemReferenceCode - - REDHAT_6_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .08 - - - - recurringFee - - 45 - - - - item - - - - description - - Red Hat Enterprise Linux 6 - Minimal Install (32 bit) (1 - 4 Core) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - REDHAT_6_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .12 - - - - recurringFee - - 100 - - - - item - - - - description - - Red Hat Enterprise Linux 6 - Minimal Install (32 bit) (5 - 100 Core) - - - - id - - -3837 - - - - softwareDescriptionId - - - - - - upgradeItemId - - - - - - softwareDescription - - - - controlPanel - - 0 - - - - id - - 796 - - - - longDescription - - Redhat / EL / 6.0-32 Minimal for CCI - - - - manufacturer - - Redhat - - - - name - - EL - - - - operatingSystem - - 1 - - - - referenceCode - - REDHAT_6_32 - - - - upgradeSoftwareDescriptionId - - - - - - upgradeSwDescId - - - - - - version - - 6.0-32 Minimal for CCI - - - - virtualLicense - - 0 - - - - virtualizationPlatform - - 0 - - - - requiredUser - - root - - - - - - - - - - - - - template - - - - operatingSystemReferenceCode - - REDHAT_6_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .08 - - - - recurringFee - - 45 - - - - item - - - - description - - Red Hat Enterprise Linux 5 - Minimal Install (64 bit) (1 - 4 Core) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - REDHAT_5_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .12 - - - - recurringFee - - 100 - - - - item - - - - description - - Red Hat Enterprise Linux 5 - Minimal Install (64 bit) (5 - 100 Core) - - - - id - - -880 - - - - softwareDescriptionId - - - - - - upgradeItemId - - - - - - softwareDescription - - - - controlPanel - - 0 - - - - id - - 664 - - - - longDescription - - Redhat / EL / 5.5-64 Minimal for CCI - - - - manufacturer - - Redhat - - - - name - - EL - - - - operatingSystem - - 1 - - - - referenceCode - - REDHAT_5_64 - - - - upgradeSoftwareDescriptionId - - - - - - upgradeSwDescId - - - - - - version - - 5.5-64 Minimal for CCI - - - - virtualLicense - - 0 - - - - virtualizationPlatform - - 0 - - - - requiredUser - - root - - - - - - - - - - - - - template - - - - operatingSystemReferenceCode - - REDHAT_5_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .08 - - - - recurringFee - - 45 - - - - item - - - - description - - Red Hat Enterprise Linux 5 - Minimal Install (32 bit) (1 - 4 Core) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - REDHAT_5_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .12 - - - - recurringFee - - 100 - - - - item - - - - description - - Red Hat Enterprise Linux 5 - Minimal Install (32 bit) (5 - 100 Core) - - - - id - - -879 - - - - softwareDescriptionId - - - - - - upgradeItemId - - - - - - softwareDescription - - - - controlPanel - - 0 - - - - id - - 662 - - - - longDescription - - Redhat / EL / 5.5-32 Minimal for CCI - - - - manufacturer - - Redhat - - - - name - - EL - - - - operatingSystem - - 1 - - - - referenceCode - - REDHAT_5_32 - - - - upgradeSoftwareDescriptionId - - 927 - - - - upgradeSwDescId - - 927 - - - - version - - 5.5-32 Minimal for CCI - - - - virtualLicense - - 0 - - - - virtualizationPlatform - - 0 - - - - requiredUser - - root - - - - - - - - - - - - - template - - - - operatingSystemReferenceCode - - REDHAT_5_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Ubuntu Linux 12.04 LTS Precise Pangolin - Minimal Install (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - UBUNTU_12_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Ubuntu Linux 12.04 LTS Precise Pangolin - Minimal Install (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - UBUNTU_12_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Ubuntu Linux 10.04 LTS Lucid Lynx - Minimal Install (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - UBUNTU_10_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Ubuntu Linux 10.04 LTS Lucid Lynx - Minimal Install (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - UBUNTU_10_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Ubuntu Linux 8 LTS Hardy Heron - Minimal Install (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - UBUNTU_8_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Ubuntu Linux 8 LTS Hardy Heron - Minimal Install (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - UBUNTU_8_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Vyatta 6.6 Community Edition (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - VYATTACE_6.6_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - 0 - - - - recurringFee - - 0 - - - - item - - - - description - - Vyatta 6.5 Community Edition (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - VYATTACE_6.5_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 20 - - - - item - - - - description - - Windows Server 2012 Standard Edition (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2012-STD_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 20 - - - - item - - - - description - - Windows Server 2012 Datacenter Edition (64bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2012-DC_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 20 - - - - item - - - - description - - Windows Server 2008 Standard Edition SP2 (64bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2008-STD-SP2_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 20 - - - - item - - - - description - - Windows Server 2008 Standard Edition SP2 (32bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2008-STD-SP2_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 20 - - - - item - - - - description - - Windows Server 2008 Standard SP1 with R2 (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2008-STD-R2-SP1_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 20 - - - - item - - - - description - - Windows Server 2008 R2 Standard Edition (64bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2008-STD-R2_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .1 - - - - recurringFee - - 50 - - - - item - - - - description - - Windows Server 2008 Enterprise Edition SP2 (64bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2008-ENT-SP2_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .1 - - - - recurringFee - - 50 - - - - item - - - - description - - Windows Server 2008 Enterprise Edition SP2 (32bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2008-ENT-SP2_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .1 - - - - recurringFee - - 50 - - - - item - - - - description - - Windows Server 2008 R2 Enterprise Edition (64bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2008-ENT-R2_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 20 - - - - item - - - - description - - Windows Server 2008 Datacenter Edition SP2 (64bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2008-DC-SP2_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 20 - - - - item - - - - description - - Windows Server 2008 R2 Datacenter Edition (64bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2008-DC-R2_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 20 - - - - item - - - - description - - Windows Server 2003 Standard SP2 with R2 (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2003-STD-SP2-5_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 20 - - - - item - - - - description - - Windows Server 2003 Standard SP2 with R2 (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2003-STD-SP2-5_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 50 - - - - item - - - - description - - Windows Server 2003 Enterprise SP2 with R2 (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2003-ENT-SP2-5_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 50 - - - - item - - - - description - - Windows Server 2003 Enterprise SP2 with R2 (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2003-ENT-SP2-5_32 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 20 - - - - item - - - - description - - Windows Server 2003 Datacenter SP2 with R2 (64 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2003-DC-SP2-1_64 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .05 - - - - recurringFee - - 20 - - - - item - - - - description - - Windows Server 2003 Datacenter SP2 with R2 (32 bit) - - - - - - - - - - template - - - - operatingSystemReferenceCode - - WIN_2003-DC-SP2-1_32 - - - - - - - - - - - - - processors - - - - - - - itemPrice - - - - hourlyRecurringFee - - .07 - - - - recurringFee - - 29 - - - - item - - - - description - - 1 x 2.0 GHz Core - - - - - - - - - - template - - - - startCpus - - 1 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .14 - - - - recurringFee - - 78 - - - - item - - - - description - - 2 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 2 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .205 - - - - recurringFee - - 123.5 - - - - item - - - - description - - 3 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 3 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .265 - - - - recurringFee - - 165.5 - - - - item - - - - description - - 4 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 4 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .325 - - - - recurringFee - - 207.5 - - - - item - - - - description - - 5 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 5 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .39 - - - - recurringFee - - 253 - - - - item - - - - description - - 6 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 6 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .445 - - - - recurringFee - - 291.5 - - - - item - - - - description - - 7 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 7 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .495 - - - - recurringFee - - 326.5 - - - - item - - - - description - - 8 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 8 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .54 - - - - recurringFee - - 358 - - - - item - - - - description - - 9 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 9 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .59 - - - - recurringFee - - 393 - - - - item - - - - description - - 10 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 10 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .635 - - - - recurringFee - - 424.5 - - - - item - - - - description - - 11 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 11 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .66 - - - - recurringFee - - 442 - - - - item - - - - description - - 12 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 12 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .695 - - - - recurringFee - - 466.5 - - - - item - - - - description - - 13 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 13 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .72 - - - - recurringFee - - 484 - - - - item - - - - description - - 14 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 14 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .74 - - - - recurringFee - - 498 - - - - item - - - - description - - 15 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 15 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .75 - - - - recurringFee - - 505 - - - - item - - - - description - - 16 x 2.0 GHz Cores - - - - - - - - - - template - - - - startCpus - - 16 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .22 - - - - recurringFee - - 159 - - - - item - - - - description - - Private 1 x 2.0 GHz Core - - - - - - - - - - template - - - - dedicatedAccountHostOnlyFlag - - 1 - - - - startCpus - - 1 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .3 - - - - recurringFee - - 199 - - - - item - - - - description - - Private 2 x 2.0 GHz Cores - - - - - - - - - - template - - - - dedicatedAccountHostOnlyFlag - - 1 - - - - startCpus - - 2 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .44 - - - - recurringFee - - 299 - - - - item - - - - description - - Private 4 x 2.0 GHz Cores - - - - - - - - - - template - - - - dedicatedAccountHostOnlyFlag - - 1 - - - - startCpus - - 4 - - - - - - - - - - - itemPrice - - - - hourlyRecurringFee - - .58 - - - - recurringFee - - 399 - - - - item - - - - description - - Private 8 x 2.0 GHz Cores - - - - - - - - - - template - - - - dedicatedAccountHostOnlyFlag - - 1 - - - - startCpus - - 8 - - - - - - - - - - - - - - - diff --git a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Virtual_Guest_getObject.xml b/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Virtual_Guest_getObject.xml deleted file mode 100644 index cf84f2a24a..0000000000 --- a/libcloud/test/compute/fixtures/softlayer/v3__SoftLayer_Virtual_Guest_getObject.xml +++ /dev/null @@ -1,519 +0,0 @@ - - - - - - - accountId - - 282402 - - - - createDate - - 2013-11-12T19:33:57+01:00 - - - - dedicatedAccountHostOnlyFlag - - 0 - - - - domain - - example.com - - - - fullyQualifiedDomainName - - libcloud-testing.example.com - - - - hostname - - libcloud-testing - - - - id - - 2905761 - - - - lastPowerStateId - - - - - - lastVerifiedDate - - - - - - maxCpu - - 1 - - - - maxCpuUnits - - CORE - - - - maxMemory - - 2048 - - - - metricPollDate - - - - - - modifyDate - - 2013-11-12T19:36:55+01:00 - - - - startCpus - - 1 - - - - statusId - - 1001 - - - - uuid - - cbc33604-afd0-4820-57c3-6c68ae7c5fe0 - - - - billingItem - - - - allowCancellationFlag - - 1 - - - - cancellationDate - - - - - - categoryCode - - guest_core - - - - createDate - - 2013-11-12T19:33:59+01:00 - - - - currentHourlyCharge - - .056 - - - - cycleStartDate - - 2013-11-12T19:39:03+01:00 - - - - description - - 1 x 2.0 GHz Core - - - - domainName - - example.com - - - - hostName - - libcloud-testing - - - - hourlyRecurringFee - - .056 - - - - hoursUsed - - 1 - - - - id - - 16538495 - - - - laborFee - - 0 - - - - laborFeeTaxRate - - .21 - - - - lastBillDate - - 2013-11-12T19:39:03+01:00 - - - - modifyDate - - 2013-11-12T19:39:03+01:00 - - - - nextBillDate - - 2013-11-28T07:00:00+01:00 - - - - oneTimeFee - - 0 - - - - oneTimeFeeTaxRate - - .21 - - - - orderItemId - - 22774406 - - - - parentId - - - - - - recurringFee - - .056 - - - - recurringFeeTaxRate - - .21 - - - - recurringMonths - - 1 - - - - serviceProviderId - - 1 - - - - setupFee - - 0 - - - - setupFeeTaxRate - - .21 - - - - resourceTableId - - 2905761 - - - - - - - globalIdentifier - - 633fd9e3-4cf7-4c78-b746-c2b76e2c8b88 - - - - managedResourceFlag - - 0 - - - - operatingSystem - - - - hardwareId - - - - - - id - - 2211183 - - - - manufacturerLicenseInstance - - - - - - passwords - - - - - - - createDate - - 2013-11-12T19:34:16+01:00 - - - - id - - 1867597 - - - - modifyDate - - 2013-11-12T19:34:16+01:00 - - - - password - - LTSp4cpJ - - - - port - - - - - - softwareId - - 2211183 - - - - username - - root - - - - - - - - - - softwareLicense - - - - id - - 1523 - - - - softwareDescriptionId - - 1163 - - - - softwareDescription - - - - controlPanel - - 0 - - - - id - - 1163 - - - - longDescription - - Debian / Debian / 7.0.0-64 Minimal for CCI - - - - manufacturer - - Debian - - - - name - - Debian - - - - operatingSystem - - 1 - - - - referenceCode - - DEBIAN_7_64 - - - - upgradeSoftwareDescriptionId - - - - - - upgradeSwDescId - - - - - - version - - 7.0.0-64 Minimal for CCI - - - - virtualLicense - - 0 - - - - virtualizationPlatform - - 0 - - - - requiredUser - - root - - - - - - - - - - - - - powerState - - - - keyName - - RUNNING - - - - name - - Running - - - - - - - primaryBackendIpAddress - - 10.55.62.124 - - - - primaryIpAddress - - 50.97.215.202 - - - - provisionDate - - 2013-11-12T19:39:03+01:00 - - - - - - diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_plan.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_plan.json new file mode 100644 index 0000000000..c59dcf0854 --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_plan.json @@ -0,0 +1,38 @@ +{ + "plans" : { + "plan" : [ + { + "core_number" : 1, + "memory_amount" : 1024, + "name" : "1xCPU-1GB", + "public_traffic_out" : 2048, + "storage_size" : 30, + "storage_tier" : "maxiops" + }, + { + "core_number" : 2, + "memory_amount" : 2048, + "name" : "2xCPU-2GB", + "public_traffic_out" : 3072, + "storage_size" : 50, + "storage_tier" : "maxiops" + }, + { + "core_number" : 4, + "memory_amount" : 4096, + "name" : "4xCPU-4GB", + "public_traffic_out" : 4096, + "storage_size" : 100, + "storage_tier" : "maxiops" + }, + { + "core_number" : 6, + "memory_amount" : 8192, + "name" : "6xCPU-8GB", + "public_traffic_out" : 8192, + "storage_size" : 200, + "storage_tier" : "maxiops" + } + ] + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_price.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_price.json new file mode 100644 index 0000000000..3b9d3c6b2b --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_price.json @@ -0,0 +1,683 @@ +{ + "prices" : { + "zone" : [ + { + "firewall" : { + "amount" : 1, + "price" : 0.56 + }, + "io_request_backup" : { + "amount" : 1000000, + "price" : 0 + }, + "io_request_maxiops" : { + "amount" : 1000000, + "price" : 0 + }, + "ipv4_address" : { + "amount" : 1, + "price" : 0.336 + }, + "ipv6_address" : { + "amount" : 1, + "price" : 0 + }, + "name" : "de-fra1", + "public_ipv4_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv4_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "public_ipv6_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv6_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "server_core" : { + "amount" : 1, + "price" : 1.12 + }, + "server_memory" : { + "amount" : 256, + "price" : 0.14 + }, + "server_plan_12xCPU-32GB" : { + "amount" : 1, + "price" : 47.619 + }, + "server_plan_16xCPU-48GB" : { + "amount" : 1, + "price" : 71.4286 + }, + "server_plan_1xCPU-1GB" : { + "amount" : 1, + "price" : 1.488 + }, + "server_plan_20xCPU-64GB" : { + "amount" : 1, + "price" : 95.2381 + }, + "server_plan_2xCPU-2GB" : { + "amount" : 1, + "price" : 2.976 + }, + "server_plan_4xCPU-4GB" : { + "amount" : 1, + "price" : 5.952 + }, + "server_plan_6xCPU-8GB" : { + "amount" : 1, + "price" : 11.905 + }, + "server_plan_8xCPU-16GB" : { + "amount" : 1, + "price" : 23.8095 + }, + "storage_backup" : { + "amount" : 1, + "price" : 0.0078 + }, + "storage_maxiops" : { + "amount" : 1, + "price" : 0.031 + }, + "storage_template" : { + "amount" : 1, + "price" : 0.031 + } + }, + { + "firewall" : { + "amount" : 1, + "price" : 0.56 + }, + "io_request_backup" : { + "amount" : 1000000, + "price" : 0 + }, + "io_request_hdd" : { + "amount" : 1000000, + "price" : 0 + }, + "io_request_maxiops" : { + "amount" : 1000000, + "price" : 0 + }, + "ipv4_address" : { + "amount" : 1, + "price" : 0.336 + }, + "ipv6_address" : { + "amount" : 1, + "price" : 0 + }, + "name" : "fi-dev2", + "public_ipv4_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv4_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "public_ipv6_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv6_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "server_core" : { + "amount" : 1, + "price" : 1.24 + }, + "server_memory" : { + "amount" : 256, + "price" : 0.34 + }, + "server_plan_12xCPU-32GB" : { + "amount" : 1, + "price" : 71.4286 + }, + "server_plan_16xCPU-48GB" : { + "amount" : 1, + "price" : 107.1429 + }, + "server_plan_1xCPU-1GB" : { + "amount" : 1, + "price" : 2.232 + }, + "server_plan_20xCPU-64GB" : { + "amount" : 1, + "price" : 142.8571 + }, + "server_plan_2xCPU-2GB" : { + "amount" : 1, + "price" : 4.464 + }, + "server_plan_4xCPU-4GB" : { + "amount" : 1, + "price" : 8.928 + }, + "server_plan_6xCPU-8GB" : { + "amount" : 1, + "price" : 17.857 + }, + "server_plan_8xCPU-16GB" : { + "amount" : 1, + "price" : 35.7143 + }, + "storage_backup" : { + "amount" : 1, + "price" : 0.0078 + }, + "storage_hdd" : { + "amount" : 1, + "price" : 0.0145 + }, + "storage_maxiops" : { + "amount" : 1, + "price" : 0.031 + }, + "storage_template" : { + "amount" : 1, + "price" : 0.031 + } + }, + { + "firewall" : { + "amount" : 1, + "price" : 0.56 + }, + "io_request_backup" : { + "amount" : 1000000, + "price" : 0 + }, + "io_request_hdd" : { + "amount" : 1000000, + "price" : 0 + }, + "io_request_maxiops" : { + "amount" : 1000000, + "price" : 0 + }, + "io_request_ssd" : { + "amount" : 1000000, + "price" : 0 + }, + "ipv4_address" : { + "amount" : 1, + "price" : 0.336 + }, + "ipv6_address" : { + "amount" : 1, + "price" : 0 + }, + "name" : "fi-hel1", + "public_ipv4_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv4_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "public_ipv6_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv6_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "server_core" : { + "amount" : 1, + "price" : 1.24 + }, + "server_memory" : { + "amount" : 256, + "price" : 0.34 + }, + "server_plan_12xCPU-32GB" : { + "amount" : 1, + "price" : 71.4286 + }, + "server_plan_16xCPU-48GB" : { + "amount" : 1, + "price" : 107.1429 + }, + "server_plan_1xCPU-1GB" : { + "amount" : 1, + "price" : 2.232 + }, + "server_plan_20xCPU-64GB" : { + "amount" : 1, + "price" : 142.8571 + }, + "server_plan_2xCPU-2GB" : { + "amount" : 1, + "price" : 4.464 + }, + "server_plan_4xCPU-4GB" : { + "amount" : 1, + "price" : 8.928 + }, + "server_plan_6xCPU-8GB" : { + "amount" : 1, + "price" : 17.857 + }, + "server_plan_8xCPU-16GB" : { + "amount" : 1, + "price" : 35.7143 + }, + "storage_backup" : { + "amount" : 1, + "price" : 0.0078 + }, + "storage_hdd" : { + "amount" : 1, + "price" : 0.0145 + }, + "storage_maxiops" : { + "amount" : 1, + "price" : 0.031 + }, + "storage_ssd" : { + "amount" : 1, + "price" : 0.056 + }, + "storage_template" : { + "amount" : 1, + "price" : 0.031 + } + }, + { + "firewall" : { + "amount" : 1, + "price" : 0.56 + }, + "io_request_backup" : { + "amount" : 1000000, + "price" : 0 + }, + "io_request_maxiops" : { + "amount" : 1000000, + "price" : 0 + }, + "ipv4_address" : { + "amount" : 1, + "price" : 0.336 + }, + "ipv6_address" : { + "amount" : 1, + "price" : 0 + }, + "name" : "nl-ams1", + "public_ipv4_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv4_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "public_ipv6_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv6_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "server_core" : { + "amount" : 1, + "price" : 1.12 + }, + "server_memory" : { + "amount" : 256, + "price" : 0.14 + }, + "server_plan_12xCPU-32GB" : { + "amount" : 1, + "price" : 47.619 + }, + "server_plan_16xCPU-48GB" : { + "amount" : 1, + "price" : 71.4286 + }, + "server_plan_1xCPU-1GB" : { + "amount" : 1, + "price" : 1.488 + }, + "server_plan_20xCPU-64GB" : { + "amount" : 1, + "price" : 95.2381 + }, + "server_plan_2xCPU-2GB" : { + "amount" : 1, + "price" : 2.976 + }, + "server_plan_4xCPU-4GB" : { + "amount" : 1, + "price" : 5.952 + }, + "server_plan_6xCPU-8GB" : { + "amount" : 1, + "price" : 11.905 + }, + "server_plan_8xCPU-16GB" : { + "amount" : 1, + "price" : 23.8095 + }, + "storage_backup" : { + "amount" : 1, + "price" : 0.0078 + }, + "storage_maxiops" : { + "amount" : 1, + "price" : 0.031 + }, + "storage_template" : { + "amount" : 1, + "price" : 0.031 + } + }, + { + "firewall" : { + "amount" : 1, + "price" : 0.56 + }, + "io_request_backup" : { + "amount" : 1000000, + "price" : 0 + }, + "io_request_maxiops" : { + "amount" : 1000000, + "price" : 0 + }, + "ipv4_address" : { + "amount" : 1, + "price" : 0.336 + }, + "ipv6_address" : { + "amount" : 1, + "price" : 0 + }, + "name" : "sg-sin1", + "public_ipv4_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv4_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "public_ipv6_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv6_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "server_core" : { + "amount" : 1, + "price" : 1.12 + }, + "server_memory" : { + "amount" : 256, + "price" : 0.14 + }, + "server_plan_12xCPU-32GB" : { + "amount" : 1, + "price" : 47.619 + }, + "server_plan_16xCPU-48GB" : { + "amount" : 1, + "price" : 71.4286 + }, + "server_plan_1xCPU-1GB" : { + "amount" : 1, + "price" : 1.488 + }, + "server_plan_20xCPU-64GB" : { + "amount" : 1, + "price" : 95.2381 + }, + "server_plan_2xCPU-2GB" : { + "amount" : 1, + "price" : 2.976 + }, + "server_plan_4xCPU-4GB" : { + "amount" : 1, + "price" : 5.952 + }, + "server_plan_6xCPU-8GB" : { + "amount" : 1, + "price" : 11.905 + }, + "server_plan_8xCPU-16GB" : { + "amount" : 1, + "price" : 23.8095 + }, + "storage_backup" : { + "amount" : 1, + "price" : 0.0078 + }, + "storage_maxiops" : { + "amount" : 1, + "price" : 0.031 + }, + "storage_template" : { + "amount" : 1, + "price" : 0.031 + } + }, + { + "firewall" : { + "amount" : 1, + "price" : 0.56 + }, + "io_request_backup" : { + "amount" : 1000000, + "price" : 0 + }, + "io_request_hdd" : { + "amount" : 1000000, + "price" : 0 + }, + "io_request_maxiops" : { + "amount" : 1000000, + "price" : 0 + }, + "io_request_ssd" : { + "amount" : 1000000, + "price" : 0 + }, + "ipv4_address" : { + "amount" : 1, + "price" : 0.336 + }, + "ipv6_address" : { + "amount" : 1, + "price" : 0 + }, + "name" : "uk-lon1", + "public_ipv4_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv4_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "public_ipv6_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv6_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "server_core" : { + "amount" : 1, + "price" : 1.12 + }, + "server_memory" : { + "amount" : 256, + "price" : 0.14 + }, + "server_plan_12xCPU-32GB" : { + "amount" : 1, + "price" : 47.619 + }, + "server_plan_16xCPU-48GB" : { + "amount" : 1, + "price" : 71.4286 + }, + "server_plan_1xCPU-1GB" : { + "amount" : 1, + "price" : 1.488 + }, + "server_plan_20xCPU-64GB" : { + "amount" : 1, + "price" : 95.2381 + }, + "server_plan_2xCPU-2GB" : { + "amount" : 1, + "price" : 2.976 + }, + "server_plan_4xCPU-4GB" : { + "amount" : 1, + "price" : 5.952 + }, + "server_plan_6xCPU-8GB" : { + "amount" : 1, + "price" : 11.905 + }, + "server_plan_8xCPU-16GB" : { + "amount" : 1, + "price" : 23.8095 + }, + "storage_backup" : { + "amount" : 1, + "price" : 0.0078 + }, + "storage_hdd" : { + "amount" : 1, + "price" : 0.0078 + }, + "storage_maxiops" : { + "amount" : 1, + "price" : 0.031 + }, + "storage_ssd" : { + "amount" : 1, + "price" : 0.031 + }, + "storage_template" : { + "amount" : 1, + "price" : 0.031 + } + }, + { + "firewall" : { + "amount" : 1, + "price" : 0.56 + }, + "io_request_backup" : { + "amount" : 1000000, + "price" : 0 + }, + "io_request_maxiops" : { + "amount" : 1000000, + "price" : 0 + }, + "ipv4_address" : { + "amount" : 1, + "price" : 0.336 + }, + "ipv6_address" : { + "amount" : 1, + "price" : 0 + }, + "name" : "us-chi1", + "public_ipv4_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv4_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "public_ipv6_bandwidth_in" : { + "amount" : 1, + "price" : 0 + }, + "public_ipv6_bandwidth_out" : { + "amount" : 1, + "price" : 5.6 + }, + "server_core" : { + "amount" : 1, + "price" : 1.12 + }, + "server_memory" : { + "amount" : 256, + "price" : 0.14 + }, + "server_plan_12xCPU-32GB" : { + "amount" : 1, + "price" : 47.619 + }, + "server_plan_16xCPU-48GB" : { + "amount" : 1, + "price" : 71.4286 + }, + "server_plan_1xCPU-1GB" : { + "amount" : 1, + "price" : 1.488 + }, + "server_plan_20xCPU-64GB" : { + "amount" : 1, + "price" : 95.2381 + }, + "server_plan_2xCPU-2GB" : { + "amount" : 1, + "price" : 2.976 + }, + "server_plan_4xCPU-4GB" : { + "amount" : 1, + "price" : 5.952 + }, + "server_plan_6xCPU-8GB" : { + "amount" : 1, + "price" : 11.905 + }, + "server_plan_8xCPU-16GB" : { + "amount" : 1, + "price" : 23.8095 + }, + "storage_backup" : { + "amount" : 1, + "price" : 0.0078 + }, + "storage_maxiops" : { + "amount" : 1, + "price" : 0.031 + }, + "storage_template" : { + "amount" : 1, + "price" : 0.031 + } + } + ] + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_server.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_server.json new file mode 100644 index 0000000000..e2a7d0a3e0 --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_server.json @@ -0,0 +1,22 @@ +{ + "servers" : { + "server" : [ + { + "core_number" : "1", + "hostname" : "localhost", + "license" : 0, + "memory_amount" : "1024", + "plan" : "1xCPU-1GB", + "plan_ipv4_bytes" : "12267", + "plan_ipv6_bytes" : "4644", + "state" : "started", + "tags" : { + "tag" : [] + }, + "title" : "test_server", + "uuid" : "00f8c525-7e62-4108-8115-3958df5b43dc", + "zone" : "fi-hel1" + } + ] + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_server_00893c98-5d5a-4363-b177-88df518a2b60.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_server_00893c98-5d5a-4363-b177-88df518a2b60.json new file mode 100644 index 0000000000..c99fc0559d --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_server_00893c98-5d5a-4363-b177-88df518a2b60.json @@ -0,0 +1,58 @@ +{ + "server" : { + "boot_order" : "cdrom,disk", + "core_number" : "1", + "firewall" : "off", + "host" : 4297867907, + "hostname" : "localhost", + "ip_addresses" : { + "ip_address" : [ + { + "access" : "private", + "address" : "10.2.1.244", + "family" : "IPv4" + }, + { + "access" : "public", + "address" : "2a04:3541:1000:500:7cae:1dff:fead:5bde", + "family" : "IPv6" + }, + { + "access" : "public", + "address" : "83.136.254.34", + "family" : "IPv4", + "part_of_plan" : "yes" + } + ] + }, + "license" : 0, + "memory_amount" : "1024", + "nic_model" : "virtio", + "plan" : "1xCPU-1GB", + "plan_ipv4_bytes" : "0", + "plan_ipv6_bytes" : "0", + "state" : "stopped", + "storage_devices" : { + "storage_device" : [ + { + "address" : "virtio:0", + "part_of_plan" : "yes", + "storage" : "01839922-a675-4214-b10e-a4cf7953992f", + "storage_size" : 30, + "storage_title" : "localhost-disk0", + "type" : "disk" + } + ] + }, + "tags" : { + "tag" : [] + }, + "timezone" : "UTC", + "title" : "test", + "uuid" : "00893c98-5d5a-4363-b177-88df518a2b60", + "video_model" : "cirrus", + "vnc" : "off", + "vnc_password" : "Hf7qpJs8", + "zone" : "uk-lon1" + } +} diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_server_00f8c525-7e62-4108-8115-3958df5b43dc.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_server_00f8c525-7e62-4108-8115-3958df5b43dc.json new file mode 100644 index 0000000000..1278e6e121 --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_server_00f8c525-7e62-4108-8115-3958df5b43dc.json @@ -0,0 +1,57 @@ +{ + "server" : { + "boot_order" : "disk", + "core_number" : "1", + "firewall" : "off", + "host" : 4964762243, + "hostname" : "localhost", + "ip_addresses" : { + "ip_address" : [ + { + "access" : "private", + "address" : "10.1.7.68", + "family" : "IPv4" + }, + { + "access" : "public", + "address" : "2a04:3540:1000:310:7cae:1dff:fead:19dc", + "family" : "IPv6" + }, + { + "access" : "public", + "address" : "94.237.37.249", + "family" : "IPv4", + "part_of_plan" : "yes" + } + ] + }, + "license" : 0, + "memory_amount" : "1024", + "nic_model" : "virtio", + "plan" : "1xCPU-1GB", + "plan_ipv4_bytes" : "8242", + "plan_ipv6_bytes" : "3440", + "state" : "started", + "storage_devices" : { + "storage_device" : [ + { + "address" : "virtio:0", + "storage" : "01e5411f-37c9-4b8e-b0bb-4cad5119b3ea", + "storage_size" : 10, + "storage_title" : "Ubuntu Server 16.04 LTS (Xenial Xerus)", + "type" : "disk" + } + ] + }, + "tags" : { + "tag" : [] + }, + "timezone" : "UTC", + "title" : "test_server", + "uuid" : "00f8c525-7e62-4108-8115-3958df5b43dc", + "video_model" : "cirrus", + "vnc" : "off", + "vnc_password" : "r362XMmV", + "zone" : "fi-hel1" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_server_00f8c525-7e62-4108-8115-3958df5b43dc_restart.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_server_00f8c525-7e62-4108-8115-3958df5b43dc_restart.json new file mode 100644 index 0000000000..af904e4a45 --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_server_00f8c525-7e62-4108-8115-3958df5b43dc_restart.json @@ -0,0 +1,57 @@ +{ + "server" : { + "boot_order" : "disk", + "core_number" : "1", + "firewall" : "off", + "host" : 4964762243, + "hostname" : "localhost", + "ip_addresses" : { + "ip_address" : [ + { + "access" : "private", + "address" : "10.1.7.68", + "family" : "IPv4" + }, + { + "access" : "public", + "address" : "2a04:3540:1000:310:7cae:1dff:fead:19dc", + "family" : "IPv6" + }, + { + "access" : "public", + "address" : "94.237.37.249", + "family" : "IPv4", + "part_of_plan" : "yes" + } + ] + }, + "license" : 0, + "memory_amount" : "1024", + "nic_model" : "virtio", + "plan" : "1xCPU-1GB", + "plan_ipv4_bytes" : "218066", + "plan_ipv6_bytes" : "6450", + "state" : "started", + "storage_devices" : { + "storage_device" : [ + { + "address" : "virtio:0", + "storage" : "01e5411f-37c9-4b8e-b0bb-4cad5119b3ea", + "storage_size" : 10, + "storage_title" : "Ubuntu Server 16.04 LTS (Xenial Xerus)", + "type" : "disk" + } + ] + }, + "tags" : { + "tag" : [] + }, + "timezone" : "UTC", + "title" : "test_server", + "uuid" : "00f8c525-7e62-4108-8115-3958df5b43dc", + "video_model" : "cirrus", + "vnc" : "off", + "vnc_password" : "r362XMmV", + "zone" : "fi-hel1" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_server_from_cdrom.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_server_from_cdrom.json new file mode 100644 index 0000000000..b82f8c6f57 --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_server_from_cdrom.json @@ -0,0 +1,65 @@ +{ + "server" : { + "boot_order" : "disk", + "core_number" : "1", + "firewall" : "off", + "hostname" : "localhost", + "ip_addresses" : { + "ip_address" : [ + { + "access" : "private", + "address" : "10.1.2.26", + "family" : "IPv4" + }, + { + "access" : "public", + "address" : "2a04:3540:1000:310:7cae:1dff:fead:5683", + "family" : "IPv6" + }, + { + "access" : "public", + "address" : "94.237.37.215", + "family" : "IPv4", + "part_of_plan" : "yes" + } + ] + }, + "license" : 0, + "memory_amount" : "1024", + "nic_model" : "virtio", + "plan" : "1xCPU-1GB", + "plan_ipv4_bytes" : "0", + "plan_ipv6_bytes" : "0", + "progress" : "0", + "state" : "maintenance", + "storage_devices" : { + "storage_device" : [ + { + "address" : "virtio:0", + "part_of_plan" : "yes", + "storage" : "01898fe2-9909-471e-b33c-59d7896b48f5", + "storage_size" : 30, + "storage_title" : "Ubuntu Server 16.04 LTS (Xenial Xerus), 64-bit", + "type" : "disk" + }, + { + "address" : "ide:0:0", + "storage" : "01000000-0000-4000-8000-000030040101", + "storage_size" : 1, + "storage_title" : "Ubuntu Server 14.04 LTS", + "type" : "cdrom" + } + ] + }, + "tags" : { + "tag" : [] + }, + "timezone" : "UTC", + "title" : "test_server", + "uuid" : "00c68ee6-e6e1-4d5f-a213-4a1e063a3cbd", + "video_model" : "cirrus", + "vnc" : "off", + "vnc_password" : "5C4TVPf8", + "zone" : "fi-hel1" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_server_from_template.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_server_from_template.json new file mode 100644 index 0000000000..cde80cc8e9 --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_server_from_template.json @@ -0,0 +1,59 @@ +{ + "server" : { + "boot_order" : "disk", + "core_number" : "1", + "firewall" : "off", + "hostname" : "localhost", + "ip_addresses" : { + "ip_address" : [ + { + "access" : "private", + "address" : "10.1.3.163", + "family" : "IPv4" + }, + { + "access" : "public", + "address" : "2a04:3540:1000:310:7cae:1dff:fead:3332", + "family" : "IPv6" + }, + { + "access" : "public", + "address" : "94.237.37.216", + "family" : "IPv4", + "part_of_plan" : "yes" + } + ] + }, + "license" : 0, + "memory_amount" : "1024", + "nic_model" : "virtio", + "password" : "777gznbm", + "plan" : "1xCPU-1GB", + "plan_ipv4_bytes" : "0", + "plan_ipv6_bytes" : "0", + "progress" : "0", + "state" : "maintenance", + "storage_devices" : { + "storage_device" : [ + { + "address" : "virtio:0", + "storage" : "018e2c82-1c16-46b9-8b7d-aeaf8d8309a9", + "storage_size" : 10, + "storage_title" : "Ubuntu Server 16.04 LTS (Xenial Xerus)", + "type" : "disk" + } + ] + }, + "tags" : { + "tag" : [] + }, + "timezone" : "UTC", + "title" : "test_server", + "username" : "mlackman", + "uuid" : "00814aac-240f-4f08-9139-9697c9ffc0b7", + "video_model" : "cirrus", + "vnc" : "off", + "vnc_password" : "G4FvMjvg", + "zone" : "fi-hel1" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_01d4fcd4-e446-433b-8a9c-551a1284952e.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_01d4fcd4-e446-433b-8a9c-551a1284952e.json new file mode 100644 index 0000000000..10f3e77387 --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_01d4fcd4-e446-433b-8a9c-551a1284952e.json @@ -0,0 +1,22 @@ +{ + "storage": { + "access": "private", + "backup_rule": "", + "backups": { + "backup": [] + }, + "license": 0, + "servers": { + "server": [ + "00f8c525-7e62-4108-8115-3958df5b43dc" + ] + }, + "size": 50, + "state": "online", + "tier": "maxiops", + "title": "data", + "type": "normal", + "uuid": "01d4fcd4-e446-433b-8a9c-551a1284952e", + "zone": "fi-hel1" + } +} diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_cdrom.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_cdrom.json new file mode 100644 index 0000000000..5f45a2b670 --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_cdrom.json @@ -0,0 +1,411 @@ +{ + "storages" : { + "storage" : [ + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Windows Server 2003 R2 Standard (CD 1)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000010010101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Windows Server 2003 R2 Standard (CD 2)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000010010102" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Windows Server 2003 R2 Standard (CD 1)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000010010201" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Windows Server 2003 R2 Standard (CD 2)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000010010202" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Windows Server 2003 R2 Enterprise (CD 1)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000010020101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Windows Server 2003 R2 Enterprise (CD 2)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000010020102" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Windows Server 2003 R2 Enterprise (CD 1)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000010020201" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Windows Server 2003 R2 Enterprise (CD 2)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000010020202" + }, + { + "access" : "public", + "license" : 0, + "size" : 3, + "state" : "online", + "title" : "Windows Server 2008 R2 Datacenter", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000010030101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Windows Server 2003 R2 Datacenter", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000010040101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Windows Server 2003 R2 Datacenter", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000010040201" + }, + { + "access" : "public", + "license" : 0, + "size" : 4, + "state" : "online", + "title" : "Windows Server 2012", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000010050101" + }, + { + "access" : "public", + "license" : 0, + "size" : 5, + "state" : "online", + "title" : "Debian GNU/Linux 6.0.1 (Squeeze) (DVD)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000020010101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Debian GNU/Linux 6.0.1 (Squeeze) (netinst)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000020010201" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Debian GNU/Linux 6.0.1 (Squeeze) (netinst)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000020010301" + }, + { + "access" : "public", + "license" : 0, + "size" : 2, + "state" : "online", + "title" : "Debian GNU/Linux 6.0.1 (Squeeze) (live)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000020010401" + }, + { + "access" : "public", + "license" : 0, + "size" : 2, + "state" : "online", + "title" : "Debian GNU/Linux 6.0.1 (Squeeze) (live)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000020010501" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Debian GNU/Linux 7.8 (Wheezy)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000020020201" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Debian GNU/Linux 8.6.0 (Jessie)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000020030101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Debian GNU/Linux 9.0.0 (Stretch) Installation CD", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000020040101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Ubuntu Server 10.04", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000030010101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Ubuntu Server 10.04", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000030010201" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Ubuntu Server 11.04", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000030020101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Ubuntu Server 11.04", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000030020201" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Ubuntu Server 12.04", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000030030101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Ubuntu Server 14.04 LTS", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000030040101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Ubuntu Server 16.04 LTS (Xenial Xerus), 64-bit", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000030060101" + }, + { + "access" : "public", + "license" : 0, + "size" : 4, + "state" : "online", + "title" : "Fedora 16 (DVD)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000040010101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Fedora 16 (live)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000040010201" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Fedora 19", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000040020101" + }, + { + "access" : "public", + "license" : 0, + "size" : 4, + "state" : "online", + "title" : "CentOS 6.0 (DVD 1)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000050010101" + }, + { + "access" : "public", + "license" : 0, + "size" : 2, + "state" : "online", + "title" : "CentOS 6.0 (DVD 2)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000050010102" + }, + { + "access" : "public", + "license" : 0, + "size" : 4, + "state" : "online", + "title" : "CentOS 6.8 (DVD 1)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000050010103" + }, + { + "access" : "public", + "license" : 0, + "size" : 3, + "state" : "online", + "title" : "CentOS 6.8 (DVD 2)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000050010104" + }, + { + "access" : "public", + "license" : 0, + "size" : 4, + "state" : "online", + "title" : "CentOS 6.8 (DVD 1)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000050010105" + }, + { + "access" : "public", + "license" : 0, + "size" : 2, + "state" : "online", + "title" : "CentOS 6.8 (DVD 2)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000050010106" + }, + { + "access" : "public", + "license" : 0, + "size" : 5, + "state" : "online", + "title" : "CentOS 7.3-1611 DVD", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000050010301" + }, + { + "access" : "public", + "license" : 0, + "size" : 4, + "state" : "online", + "title" : "Knoppix 6.4.4", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000060010101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Arch Linux 2010.05", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000070010101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "CoreOS 607.0.0", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000080010101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "CoreOS 845.0.0", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000080010201" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "CoreOS Alpha (1032.1.0)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000080010501" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "CoreOS Stable (1068.8.0)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000080020101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "Gentoo Linux Minimal Installation CD (64bit)", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000090010101" + }, + { + "access" : "public", + "license" : 0, + "size" : 1, + "state" : "online", + "title" : "FreeBSD 11.0-RELEASE amd64 Installation CD", + "type" : "cdrom", + "uuid" : "01000000-0000-4000-8000-000100010101" + } + ] + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_create.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_create.json new file mode 100644 index 0000000000..60dc270948 --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_create.json @@ -0,0 +1,20 @@ +{ + "storage": { + "access": "private", + "backup_rule": "", + "backups": { + "backup": [] + }, + "license": 0, + "servers": { + "server": [] + }, + "size": 50, + "state": "online", + "tier": "maxiops", + "title": "data", + "type": "normal", + "uuid": "01d4fcd4-e446-433b-8a9c-551a1284952e", + "zone": "fi-hel1" + } +} diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_normal.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_normal.json new file mode 100644 index 0000000000..1fdc1cbef5 --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_normal.json @@ -0,0 +1,31 @@ +{ + "storages": { + "storage": [ + { + "access": "private", + "license": 0, + "size": 10, + "state": "online", + "tier": "hdd", + "title": "Operating system disk", + "type": "normal", + "uuid": "01eff7ad-168e-413e-83b0-054f6a28fa23", + "zone": "uk-lon1" + }, + { + "access": "private", + "license": 0, + "servers": { + "server": [] + }, + "size": 50, + "state": "online", + "tier": "maxiops", + "title": "data", + "type": "normal", + "uuid": "01d4fcd4-e446-433b-8a9c-551a1284952e", + "zone": "fi-hel1" + } + ] + } +} diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_template.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_template.json new file mode 100644 index 0000000000..12f42c26b8 --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_storage_template.json @@ -0,0 +1,114 @@ +{ + "storages" : { + "storage" : [ + { + "access" : "public", + "license" : 3.36, + "size" : 20, + "state" : "online", + "title" : "Windows Server 2012 R2 Datacenter", + "type" : "template", + "uuid" : "01000000-0000-4000-8000-000010050200" + }, + { + "access" : "public", + "license" : 0.694, + "size" : 20, + "state" : "online", + "title" : "Windows Server 2012 R2 Standard", + "type" : "template", + "uuid" : "01000000-0000-4000-8000-000010050300" + }, + { + "access" : "public", + "license" : 3.36, + "size" : 20, + "state" : "online", + "title" : "Windows Server 2016 Datacenter", + "type" : "template", + "uuid" : "01000000-0000-4000-8000-000010060200" + }, + { + "access" : "public", + "license" : 0.694, + "size" : 20, + "state" : "online", + "title" : "Windows Server 2016 Standard", + "type" : "template", + "uuid" : "01000000-0000-4000-8000-000010060300" + }, + { + "access" : "public", + "license" : 0, + "size" : 2, + "state" : "online", + "title" : "Debian GNU/Linux 7.8 (Wheezy)", + "type" : "template", + "uuid" : "01000000-0000-4000-8000-000020020100" + }, + { + "access" : "public", + "license" : 0, + "size" : 2, + "state" : "online", + "title" : "Debian GNU/Linux 8.7 (Jessie)", + "type" : "template", + "uuid" : "01000000-0000-4000-8000-000020030100" + }, + { + "access" : "public", + "license" : 0, + "size" : 2, + "state" : "online", + "title" : "Ubuntu Server 12.04 LTS (Precise Pangolin)", + "type" : "template", + "uuid" : "01000000-0000-4000-8000-000030030200" + }, + { + "access" : "public", + "license" : 0, + "size" : 2, + "state" : "online", + "title" : "Ubuntu Server 14.04 LTS (Trusty Tahr)", + "type" : "template", + "uuid" : "01000000-0000-4000-8000-000030040200" + }, + { + "access" : "public", + "license" : 0, + "size" : 2, + "state" : "online", + "title" : "Ubuntu Server 16.04 LTS (Xenial Xerus)", + "type" : "template", + "uuid" : "01000000-0000-4000-8000-000030060200" + }, + { + "access" : "public", + "license" : 0, + "size" : 2, + "state" : "online", + "title" : "CentOS 6.9", + "type" : "template", + "uuid" : "01000000-0000-4000-8000-000050010200" + }, + { + "access" : "public", + "license" : 0, + "size" : 2, + "state" : "online", + "title" : "CentOS 7.0", + "type" : "template", + "uuid" : "01000000-0000-4000-8000-000050010300" + }, + { + "access" : "public", + "license" : 0, + "size" : 5, + "state" : "online", + "title" : "CoreOS Stable 1068.8.0", + "type" : "template", + "uuid" : "01000000-0000-4000-8000-000080010200" + } + ] + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_zone.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_zone.json new file mode 100644 index 0000000000..19deb8db0d --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_zone.json @@ -0,0 +1,30 @@ +{ + "zones" : { + "zone" : [ + { + "description" : "Frankfurt #1", + "id" : "de-fra1" + }, + { + "description" : "Helsinki #1", + "id" : "fi-hel1" + }, + { + "description" : "Amsterdam #1", + "id" : "nl-ams1" + }, + { + "description" : "Singapore #1", + "id" : "sg-sin1" + }, + { + "description" : "London #1", + "id" : "uk-lon1" + }, + { + "description" : "Chicago #1", + "id" : "us-chi1" + } + ] + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/upcloud/api_1_2_zone_failed_auth.json b/libcloud/test/compute/fixtures/upcloud/api_1_2_zone_failed_auth.json new file mode 100644 index 0000000000..356841ca6f --- /dev/null +++ b/libcloud/test/compute/fixtures/upcloud/api_1_2_zone_failed_auth.json @@ -0,0 +1,6 @@ +{ + "error" : { + "error_code" : "AUTHENTICATION_FAILED", + "error_message" : "Authentication failed using the given username and password." + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vcloud_1_5/api_query_vm.xml b/libcloud/test/compute/fixtures/vcloud_1_5/api_query_vm.xml new file mode 100644 index 0000000000..04abc6d3e9 --- /dev/null +++ b/libcloud/test/compute/fixtures/vcloud_1_5/api_query_vm.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vcloud_1_5/api_task_2518935e_b315_4d8e_9e99_9275f751877c.xml b/libcloud/test/compute/fixtures/vcloud_1_5/api_task_2518935e_b315_4d8e_9e99_9275f751877c.xml new file mode 100644 index 0000000000..e9fcc23ffb --- /dev/null +++ b/libcloud/test/compute/fixtures/vcloud_1_5/api_task_2518935e_b315_4d8e_9e99_9275f751877c.xml @@ -0,0 +1,32 @@ + + + + + +
+ diff --git a/libcloud/test/compute/fixtures/vcloud_1_5/api_task_deploy.xml b/libcloud/test/compute/fixtures/vcloud_1_5/api_task_deploy.xml new file mode 100644 index 0000000000..c799b78f50 --- /dev/null +++ b/libcloud/test/compute/fixtures/vcloud_1_5/api_task_deploy.xml @@ -0,0 +1,7 @@ + + + + + + diff --git a/libcloud/test/compute/fixtures/vcloud_1_5/api_task_fab4b26f_4f2e_4d49_ad01_ae9324bbfe48.xml b/libcloud/test/compute/fixtures/vcloud_1_5/api_task_fab4b26f_4f2e_4d49_ad01_ae9324bbfe48.xml new file mode 100644 index 0000000000..d16cb7b579 --- /dev/null +++ b/libcloud/test/compute/fixtures/vcloud_1_5/api_task_fab4b26f_4f2e_4d49_ad01_ae9324bbfe48.xml @@ -0,0 +1,32 @@ + + + + + +
+ diff --git a/libcloud/test/compute/fixtures/vcloud_1_5/api_task_fe75d3af_f5a3_44a5_b016_ae0bdadfc32b.xml b/libcloud/test/compute/fixtures/vcloud_1_5/api_task_fe75d3af_f5a3_44a5_b016_ae0bdadfc32b.xml new file mode 100644 index 0000000000..f91c144523 --- /dev/null +++ b/libcloud/test/compute/fixtures/vcloud_1_5/api_task_fe75d3af_f5a3_44a5_b016_ae0bdadfc32b.xml @@ -0,0 +1,32 @@ + + + + + +
+ diff --git a/libcloud/test/compute/fixtures/vcloud_1_5/api_task_undeploy_power_off.xml b/libcloud/test/compute/fixtures/vcloud_1_5/api_task_undeploy_power_off.xml new file mode 100644 index 0000000000..05f0953f7c --- /dev/null +++ b/libcloud/test/compute/fixtures/vcloud_1_5/api_task_undeploy_power_off.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b.xml b/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b.xml index 78192f88dc..54104399c4 100644 --- a/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b.xml +++ b/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b.xml @@ -1,40 +1,40 @@ - - - - - - - - + + + + + + + - - + + - - - + + + - + Lease settings section - + 0 0 - + VApp startup section - + - + The list of logical networks - + The configuration parameters for logical networks - + @@ -125,7 +125,7 @@ - + Virtual hardware requirements diff --git a/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_create_snapshot.xml b/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_create_snapshot.xml new file mode 100644 index 0000000000..8aab54dc94 --- /dev/null +++ b/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_create_snapshot.xml @@ -0,0 +1,32 @@ + + + + + +
+ diff --git a/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_remove_snapshots.xml b/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_remove_snapshots.xml new file mode 100644 index 0000000000..3ff17de55f --- /dev/null +++ b/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_remove_snapshots.xml @@ -0,0 +1,32 @@ + + + + + +
+ diff --git a/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_revert_snapshot.xml b/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_revert_snapshot.xml new file mode 100644 index 0000000000..f91c144523 --- /dev/null +++ b/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_revert_snapshot.xml @@ -0,0 +1,32 @@ + + + + + +
+ diff --git a/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c.xml b/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c.xml index 75712d3f04..65ef6538cf 100644 --- a/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c.xml +++ b/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c.xml @@ -1,40 +1,40 @@ - - - - - - - - + + + + + + + - - + + - - - + + + - + Lease settings section - + 0 0 - + VApp startup section - + - + The list of logical networks - + The configuration parameters for logical networks - + @@ -125,7 +125,7 @@ - + Virtual hardware requirements diff --git a/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6d.xml b/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6d.xml new file mode 100644 index 0000000000..9f45d5c3b2 --- /dev/null +++ b/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6d.xml @@ -0,0 +1,292 @@ + + + + + + + + + + + + + + + + Test Description + + Lease settings section + + 86400 + 172800 + 2019-10-07T14:06:29.980725 + 2019-10-08T14:06:29.980725 + + + VApp startup section + + + + + The list of logical networks + + + + + + The configuration parameters for logical networks + + + + + + + true + 65.41.64.1 + 255.255.252.0 + 65.41.42.113 + 65.41.42.114 + vm.myorg.com + + + 65.41.67.1 + 65.41.67.254 + + + + + bridged + false + + + false + 3600 + 7200 + + 65.41.64.2 + 65.41.67.0 + + + + true + drop + false + + true + Allow all outgoing traffic + allow + + true + + -1 + Any + -1 + Any + out + false + + + + true + ipTranslation + allowTraffic + + + automatic + ScrumVM_Master + 0 + + + + + false + + + + + true + + + + + + false + + + + + + + + + + + + + + + + + + + Virtual hardware requirements + + Virtual Hardware Family + 0 + mgalet-test2 + vmx-07 + + + 00:50:56:01:00:99 + 0 + true + vCloud - Default + PCNet32 ethernet adapter + Network adapter 0 + 1 + PCNet32 + 10 + + + 0 + SCSI Controller + SCSI Controller 0 + 2 + lsilogic + 6 + + + 0 + Hard disk + Hard disk 1 + + 2000 + 2 + 17 + + + 0 + IDE Controller + IDE Controller 0 + 3 + 5 + + + 0 + false + CD/DVD Drive + CD/DVD Drive 1 + + 3002 + 3 + 15 + + + 0 + false + Floppy Drive + Floppy Drive 1 + + 8000 + 14 + + + hertz * 10^6 + Number of Virtual CPUs + 2 virtual CPU(s) + 4 + 0 + 3 + 2 + 0 + + + + byte * 2^20 + Memory Size + 4096 MB of memory + 5 + 0 + 4 + 4096 + 0 + + + + + + + + + + + + + + + + + Specifies the available VM network connections + 0 + + 0 + 192.168.0.100 + 192.168.0.103 + true + 00:50:56:01:00:d9 + POOL + + + + Specifies Guest OS Customization Settings + true + false + dd75d1d3-5b7b-48f0-aff3-69622ab7e045 + false + false + true + true + sN#9QH9# + false + mgalet-test2 + + + + Specifies Runtime info + + + ScrumVM_Master + + + VMware ESXi + 5.0.0 + VMware, Inc. + en + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libcloud/test/compute/fixtures/voxel/create_node.xml b/libcloud/test/compute/fixtures/voxel/create_node.xml deleted file mode 100644 index e33bdd6c44..0000000000 --- a/libcloud/test/compute/fixtures/voxel/create_node.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - 1234 - 1235386846 - QUEUED - - diff --git a/libcloud/test/compute/fixtures/voxel/failure.xml b/libcloud/test/compute/fixtures/voxel/failure.xml deleted file mode 100644 index 1424e812fd..0000000000 --- a/libcloud/test/compute/fixtures/voxel/failure.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/libcloud/test/compute/fixtures/voxel/images.xml b/libcloud/test/compute/fixtures/voxel/images.xml deleted file mode 100644 index 7d83ea6294..0000000000 --- a/libcloud/test/compute/fixtures/voxel/images.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - 32 - Linux - 2.6.18 - CentOS - 5.1 - root - - - ext3 - 880 - - Base install of CentOS 5.1 i386. - - - diff --git a/libcloud/test/compute/fixtures/voxel/locations.xml b/libcloud/test/compute/fixtures/voxel/locations.xml deleted file mode 100644 index a8b81b1d23..0000000000 --- a/libcloud/test/compute/fixtures/voxel/locations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - Amsterdam - - - New York - - - diff --git a/libcloud/test/compute/fixtures/voxel/nodes.xml b/libcloud/test/compute/fixtures/voxel/nodes.xml deleted file mode 100644 index f9a3117bab..0000000000 --- a/libcloud/test/compute/fixtures/voxel/nodes.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - Z100.12 - Virtual Server - Voxrox Intel Platform - - LGA7 - XO / 12th Floor - Private cage - primary - Row Z - Rack 100 - 12 - - - - 172.x.x.x - - - - - user - - - root - - -
zz.zz.us.voxel.net
- 55555 - user -
-
- Voxel TruManaged Server Configuration 1 -
- ... -
-
diff --git a/libcloud/test/compute/fixtures/voxel/success.xml b/libcloud/test/compute/fixtures/voxel/success.xml deleted file mode 100644 index c2d0c8d48e..0000000000 --- a/libcloud/test/compute/fixtures/voxel/success.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/libcloud/test/compute/fixtures/voxel/unauthorized.xml b/libcloud/test/compute/fixtures/voxel/unauthorized.xml deleted file mode 100644 index 89d7df0b04..0000000000 --- a/libcloud/test/compute/fixtures/voxel/unauthorized.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - voxel.devices.list - - 2010-02-10T23:39:25.808107+0000 - authshouldfail - ae069bb835e998622caaddaeff8c98e0 - - YOUR_SECRETtimestamp2010-02-10T23:39:25.808107+0000methodvoxel.devices.listkeyauthshouldfail - diff --git a/libcloud/test/compute/fixtures/vsphere/list_clusters.json b/libcloud/test/compute/fixtures/vsphere/list_clusters.json new file mode 100644 index 0000000000..1896a7eb76 --- /dev/null +++ b/libcloud/test/compute/fixtures/vsphere/list_clusters.json @@ -0,0 +1 @@ +{"value": []} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vsphere/list_hosts.json b/libcloud/test/compute/fixtures/vsphere/list_hosts.json new file mode 100644 index 0000000000..202050ab2a --- /dev/null +++ b/libcloud/test/compute/fixtures/vsphere/list_hosts.json @@ -0,0 +1,3 @@ +{"value": + [{"host": "host-74", "name": "100.100.100.100", "connection_state": "CONNECTED", "power_state": "POWERED_ON"}] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vsphere/list_interfaces.json b/libcloud/test/compute/fixtures/vsphere/list_interfaces.json new file mode 100644 index 0000000000..85abbcf966 --- /dev/null +++ b/libcloud/test/compute/fixtures/vsphere/list_interfaces.json @@ -0,0 +1,4 @@ +{"value": + [{"ipv4": {"mode": "STATIC", "default_gateway": "195.196.0.2", + "address": "195.196.197.198", "prefix": 29, "configurable": true}, + "name": "nic0", "mac": "00:0c:29:59:bd:12", "status": "up"}]} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vsphere/list_nodes.json b/libcloud/test/compute/fixtures/vsphere/list_nodes.json new file mode 100644 index 0000000000..b1cc2bbb06 --- /dev/null +++ b/libcloud/test/compute/fixtures/vsphere/list_nodes.json @@ -0,0 +1,3 @@ +{"value": +[{"memory_size_MiB": 19456, "vm": "vm-80", "name": "vCenter", "power_state": "POWERED_ON", "cpu_count": 4}] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vsphere/node_80.json b/libcloud/test/compute/fixtures/vsphere/node_80.json new file mode 100644 index 0000000000..d5bb3b0ce2 --- /dev/null +++ b/libcloud/test/compute/fixtures/vsphere/node_80.json @@ -0,0 +1,55 @@ +{"value": + {"instant_clone_frozen": false, "cdroms": + [{"value": {"start_connected": false, "backing": + {"auto_detect": false, "device_access_type": "EMULATION", "host_device": "CD/DVD drive 0", + "type": "HOST_DEVICE"}, "allow_guest_control": true, "ide": {"master": true, "primary": true}, + "label": "CD/DVD drive 1", "state": "NOT_CONNECTED", "type": "IDE"}, "key": "3000"}], "memory": + {"hot_add_increment_size_MiB": 128, "size_MiB": 19456, "hot_add_enabled": true, + "hot_add_limit_MiB": 311296}, "disks": [{"value": {"scsi": {"bus": 0, "unit": 0}, + "backing": {"vmdk_file": "[datastore1] vCenter/vCenter.vmdk", "type": "VMDK_FILE"}, + "label": "Hard disk 1", "type": "SCSI", "capacity": 51539607552}, "key": "2000"}, + {"value": {"scsi": {"bus": 0, "unit": 1}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_1.vmdk", "type": "VMDK_FILE"}, + "label": "Hard disk 2", "type": "SCSI", "capacity": 4447010816}, "key": "2001"}, + {"value": {"scsi": {"bus": 0, "unit": 2}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_2.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 3", "type": "SCSI", "capacity": 26843545600}, "key": "2002"}, + {"value": {"scsi": {"bus": 0, "unit": 3}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_3.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 4", "type": "SCSI", "capacity": 53687091200}, "key": "2003"}, + {"value": {"scsi": {"bus": 0, "unit": 4}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_4.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 5", "type": "SCSI", "capacity": 10737418240}, "key": "2004"}, + {"value": {"scsi": {"bus": 0, "unit": 5}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_5.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 6", "type": "SCSI", "capacity": 10737418240}, "key": "2005"}, + {"value": {"scsi": {"bus": 0, "unit": 6}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_6.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 7", "type": "SCSI", "capacity": 16106127360}, "key": "2006"}, + {"value": {"scsi": {"bus": 0, "unit": 8}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_7.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 8", "type": "SCSI", "capacity": 26843545600}, "key": "2008"}, + {"value": {"scsi": {"bus": 0, "unit": 9}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_8.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 9", "type": "SCSI", "capacity": 1073741824}, "key": "2009"}, + {"value": {"scsi": {"bus": 0, "unit": 10}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_9.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 10", "type": "SCSI", "capacity": 10737418240}, "key": "2010"}, + {"value": {"scsi": {"bus": 0, "unit": 11}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_10.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 11", "type": "SCSI", "capacity": 10737418240}, "key": "2011"}, + {"value": {"scsi": {"bus": 0, "unit": 12}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_11.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 12", "type": "SCSI", "capacity": 107374182400}, "key": "2012"}, + {"value": {"scsi": {"bus": 0, "unit": 13}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_12.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 13", "type": "SCSI", "capacity": 53687091200}, "key": "2013"}, + {"value": {"scsi": {"bus": 0, "unit": 14}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_13.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 14", "type": "SCSI", "capacity": 26843545600}, "key": "2014"}, + {"value": {"scsi": {"bus": 0, "unit": 15}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_14.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 15", "type": "SCSI", "capacity": 16106127360}, "key": "2015"}, + {"value": {"scsi": {"bus": 1, "unit": 0}, "backing": {"vmdk_file": "[datastore1] vCenter/vCenter_15.vmdk", + "type": "VMDK_FILE"}, "label": "Hard disk 16", "type": "SCSI", "capacity": 107374182400}, "key": "2016"}], + "parallel_ports": [], "sata_adapters": [], "cpu": {"hot_remove_enabled": true, "count": 4, "hot_add_enabled": true, + "cores_per_socket": 1}, "scsi_adapters": [{"value": {"pci_slot_number": 16, "scsi": {"bus": 0, "unit": 7}, + "label": "SCSI controller 0", "sharing": "NONE", "type": "LSILOGIC"}, "key": "1000"}, + {"value": {"pci_slot_number": 32, "scsi": {"bus": 1, "unit": 7}, "label": "SCSI controller 1", "sharing": "NONE", + "type": "LSILOGIC"}, "key": "1001"}], "power_state": "POWERED_ON", "floppies": [], + "identity": {"name": "vCenter", "instance_uuid": "52ff53d6-8ea3-7ecc-353f-2a493466600c", + "bios_uuid": "564d8b9e-a8a7-a621-b554-91443e59bd12"}, "nvme_adapters": [], "name": "vCenter", + "nics": [{"value": {"start_connected": true, "backing": {"network_name": "VM Network", + "type": "STANDARD_PORTGROUP", "network": "network-76"}, "mac_address": "00:0c:29:59:bd:12", + "mac_type": "GENERATED", "allow_guest_control": true, "wake_on_lan_enabled": true, + "label": "Network adapter 1", "state": "CONNECTED", "type": "VMXNET3", + "upt_compatibility_enabled": true}, "key": "4000"}], + "boot": {"delay": 0, "retry_delay": 10000, "enter_setup_mode": false, "type": "BIOS", "retry": false}, + "serial_ports": [], "boot_devices": [], "guest_OS": "OTHER_3X_LINUX_64", + "hardware": {"upgrade_policy": "NEVER", "upgrade_status": "NONE", "version": "VMX_10"}}} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vsphere/session_token.json b/libcloud/test/compute/fixtures/vsphere/session_token.json new file mode 100644 index 0000000000..4ea4584003 --- /dev/null +++ b/libcloud/test/compute/fixtures/vsphere/session_token.json @@ -0,0 +1 @@ +{"value": "48c202a15afb33000a14ca5fab43e27d"} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr/create_key_pair.json b/libcloud/test/compute/fixtures/vultr/create_key_pair.json new file mode 100644 index 0000000000..f43bc0ae7b --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr/create_key_pair.json @@ -0,0 +1,3 @@ +{ + "SSHKEYID": "5806ab4970aba" +} diff --git a/libcloud/test/compute/fixtures/vultr/create_node.json b/libcloud/test/compute/fixtures/vultr/create_node.json new file mode 100644 index 0000000000..2a58f23a5d --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr/create_node.json @@ -0,0 +1,3 @@ +{ + "SUBID": "41326859" +} diff --git a/libcloud/test/compute/fixtures/vultr/error_rate_limit.txt b/libcloud/test/compute/fixtures/vultr/error_rate_limit.txt new file mode 100644 index 0000000000..27def76b8a --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr/error_rate_limit.txt @@ -0,0 +1 @@ +Rate limit reached - please try your request again later. Current rate limit: 2 requests/sec \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr/list_images.json b/libcloud/test/compute/fixtures/vultr/list_images.json index 139f2afc7b..45a35961ce 100644 --- a/libcloud/test/compute/fixtures/vultr/list_images.json +++ b/libcloud/test/compute/fixtures/vultr/list_images.json @@ -1 +1,184 @@ -{"127":{"OSID":127,"name":"CentOS 6 x64","arch":"x64","family":"centos","windows":false},"147":{"OSID":147,"name":"CentOS 6 i386","arch":"i386","family":"centos","windows":false},"162":{"OSID":162,"name":"CentOS 5 x64","arch":"x64","family":"centos","windows":false},"163":{"OSID":163,"name":"CentOS 5 i386","arch":"i386","family":"centos","windows":false},"167":{"OSID":167,"name":"CentOS 7 x64","arch":"x64","family":"centos","windows":false},"160":{"OSID":160,"name":"Ubuntu 14.04 x64","arch":"x64","family":"ubuntu","windows":false},"161":{"OSID":161,"name":"Ubuntu 14.04 i386","arch":"i386","family":"ubuntu","windows":false},"128":{"OSID":128,"name":"Ubuntu 12.04 x64","arch":"x64","family":"ubuntu","windows":false},"148":{"OSID":148,"name":"Ubuntu 12.04 i386","arch":"i386","family":"ubuntu","windows":false},"181":{"OSID":181,"name":"Ubuntu 14.10 x64","arch":"x64","family":"ubuntu","windows":false},"182":{"OSID":182,"name":"Ubuntu 14.10 i386","arch":"i386","family":"ubuntu","windows":false},"139":{"OSID":139,"name":"Debian 7 x64 (wheezy)","arch":"x64","family":"debian","windows":false},"152":{"OSID":152,"name":"Debian 7 i386 (wheezy)","arch":"i386","family":"debian","windows":false},"140":{"OSID":140,"name":"FreeBSD 10 x64","arch":"x64","family":"freebsd","windows":false},"124":{"OSID":124,"name":"Windows 2012 R2 x64","arch":"x64","family":"windows","windows":true},"159":{"OSID":159,"name":"Custom","arch":"x64","family":"iso","windows":false},"164":{"OSID":164,"name":"Snapshot","arch":"x64","family":"snapshot","windows":false},"180":{"OSID":180,"name":"Backup","arch":"x64","family":"backup","windows":false}} \ No newline at end of file +{ + "127": { + "OSID": 127, + "name": "CentOS 6 x64", + "arch": "x64", + "family": "centos", + "windows": false + }, + "147": { + "OSID": 147, + "name": "CentOS 6 i386", + "arch": "i386", + "family": "centos", + "windows": false + }, + "167": { + "OSID": 167, + "name": "CentOS 7 x64", + "arch": "x64", + "family": "centos", + "windows": false + }, + "381": { + "OSID": 381, + "name": "CentOS 7 SELinux x64", + "arch": "x64", + "family": "centos", + "windows": false + }, + "362": { + "OSID": 362, + "name": "CentOS 8 x64", + "arch": "x64", + "family": "centos", + "windows": false + }, + "401": { + "OSID": 401, + "name": "CentOS 8 Stream x64", + "arch": "x64", + "family": "centos", + "windows": false + }, + "215": { + "OSID": 215, + "name": "Ubuntu 16.04 x64", + "arch": "x64", + "family": "ubuntu", + "windows": false + }, + "216": { + "OSID": 216, + "name": "Ubuntu 16.04 i386", + "arch": "i386", + "family": "ubuntu", + "windows": false + }, + "270": { + "OSID": 270, + "name": "Ubuntu 18.04 x64", + "arch": "x64", + "family": "ubuntu", + "windows": false + }, + "387": { + "OSID": 387, + "name": "Ubuntu 20.04 x64", + "arch": "x64", + "family": "ubuntu", + "windows": false + }, + "194": { + "OSID": 194, + "name": "Debian 8 i386 (jessie)", + "arch": "i386", + "family": "debian", + "windows": false + }, + "244": { + "OSID": 244, + "name": "Debian 9 x64 (stretch)", + "arch": "x64", + "family": "debian", + "windows": false + }, + "352": { + "OSID": 352, + "name": "Debian 10 x64 (buster)", + "arch": "x64", + "family": "debian", + "windows": false + }, + "230": { + "OSID": 230, + "name": "FreeBSD 11 x64", + "arch": "x64", + "family": "freebsd", + "windows": false + }, + "327": { + "OSID": 327, + "name": "FreeBSD 12 x64", + "arch": "x64", + "family": "freebsd", + "windows": false + }, + "366": { + "OSID": 366, + "name": "OpenBSD 6.6 x64", + "arch": "x64", + "family": "openbsd", + "windows": false + }, + "394": { + "OSID": 394, + "name": "OpenBSD 6.7 x64", + "arch": "x64", + "family": "openbsd", + "windows": false + }, + "391": { + "OSID": 391, + "name": "Fedora CoreOS", + "arch": "x64", + "family": "fedora-coreos", + "windows": false + }, + "367": { + "OSID": 367, + "name": "Fedora 31 x64", + "arch": "x64", + "family": "fedora", + "windows": false + }, + "389": { + "OSID": 389, + "name": "Fedora 32 x64", + "arch": "x64", + "family": "fedora", + "windows": false + }, + "124": { + "OSID": 124, + "name": "Windows 2012 R2 x64", + "arch": "x64", + "family": "windows", + "windows": true + }, + "240": { + "OSID": 240, + "name": "Windows 2016 x64", + "arch": "x64", + "family": "windows", + "windows": true + }, + "159": { + "OSID": 159, + "name": "Custom", + "arch": "x64", + "family": "iso", + "windows": false + }, + "164": { + "OSID": 164, + "name": "Snapshot", + "arch": "x64", + "family": "snapshot", + "windows": false + }, + "180": { + "OSID": 180, + "name": "Backup", + "arch": "x64", + "family": "backup", + "windows": false + }, + "186": { + "OSID": 186, + "name": "Application", + "arch": "x64", + "family": "application", + "windows": false + } +} diff --git a/libcloud/test/compute/fixtures/vultr/list_key_pairs.json b/libcloud/test/compute/fixtures/vultr/list_key_pairs.json new file mode 100644 index 0000000000..b8d5cad19e --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr/list_key_pairs.json @@ -0,0 +1,8 @@ +{ + "5806a8ef2a0c6": { + "SSHKEYID": "5806a8ef2a0c6", + "date_created": "2016-10-18 18:57:51", + "name": "test-key-pair", + "ssh_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZYMivN4KqJZ3dNEWeH20PUeB2ZnZRkk91K5SgxWrEotgpX4pMVM/9oxkh4bKw5CBzT6KAOghzLcBViFpNVjDyyet9wwVcy6cjuUynx63UtbTLB+r4D+bD/+/9rQTeckvGYg9Y8xIKL/oaVeCcdBM8JhSQZbZ/aARi2K79FWGH61azAqc/JCHT63f3FhspjdVpcVoVOjsZG3WG6Vymys2cXH1PM5qMgBbmp+5LkSv0LvUULyxcrtKkUyntPr1BvIFSNbo2lhXLwnM4DXONP6U/yMFte+ZwiajF7pUCdB9HqvXVU+IfswYSDuhHzL9j8+ZLQ2enF/lkkYxpMHE2t215 tester@test" + } +} diff --git a/libcloud/test/compute/fixtures/vultr/list_locations.json b/libcloud/test/compute/fixtures/vultr/list_locations.json index 6cf6d0ba46..63a6194a3b 100644 --- a/libcloud/test/compute/fixtures/vultr/list_locations.json +++ b/libcloud/test/compute/fixtures/vultr/list_locations.json @@ -1 +1,172 @@ -{"6":{"DCID":"6","name":"Atlanta","country":"US","continent":"North America","state":"GA"},"2":{"DCID":"2","name":"Chicago","country":"US","continent":"North America","state":"IL"},"3":{"DCID":"3","name":"Dallas","country":"US","continent":"North America","state":"TX"},"5":{"DCID":"5","name":"Los Angeles","country":"US","continent":"North America","state":"CA"},"39":{"DCID":"39","name":"Miami","country":"US","continent":"","state":"FL"},"1":{"DCID":"1","name":"New Jersey","country":"US","continent":"North America","state":"NJ"},"4":{"DCID":"4","name":"Seattle","country":"US","continent":"North America","state":"WA"},"12":{"DCID":"12","name":"Silicon Valley","country":"US","continent":"North America","state":"CA"},"7":{"DCID":"7","name":"Amsterdam","country":"NL","continent":"Europe","state":""},"25":{"DCID":"25","name":"Tokyo","country":"JP","continent":"Asia","state":""},"8":{"DCID":"8","name":"London","country":"GB","continent":"Europe","state":""},"24":{"DCID":"24","name":"France","country":"FR","continent":"Europe","state":""},"9":{"DCID":"9","name":"Frankfurt","country":"DE","continent":"Europe","state":""},"19":{"DCID":"19","name":"Australia","country":"AU","continent":"Australia","state":""}} +{ + "6": { + "DCID": "6", + "name": "Atlanta", + "country": "US", + "continent": "North America", + "state": "GA", + "ddos_protection": false, + "block_storage": false, + "regioncode": "ATL" + }, + "2": { + "DCID": "2", + "name": "Chicago", + "country": "US", + "continent": "North America", + "state": "IL", + "ddos_protection": true, + "block_storage": false, + "regioncode": "ORD" + }, + "3": { + "DCID": "3", + "name": "Dallas", + "country": "US", + "continent": "North America", + "state": "TX", + "ddos_protection": true, + "block_storage": false, + "regioncode": "DFW" + }, + "5": { + "DCID": "5", + "name": "Los Angeles", + "country": "US", + "continent": "North America", + "state": "CA", + "ddos_protection": true, + "block_storage": false, + "regioncode": "LAX" + }, + "39": { + "DCID": "39", + "name": "Miami", + "country": "US", + "continent": "North America", + "state": "FL", + "ddos_protection": true, + "block_storage": false, + "regioncode": "MIA" + }, + "1": { + "DCID": "1", + "name": "New Jersey", + "country": "US", + "continent": "North America", + "state": "NJ", + "ddos_protection": true, + "block_storage": true, + "regioncode": "EWR" + }, + "4": { + "DCID": "4", + "name": "Seattle", + "country": "US", + "continent": "North America", + "state": "WA", + "ddos_protection": true, + "block_storage": false, + "regioncode": "SEA" + }, + "12": { + "DCID": "12", + "name": "Silicon Valley", + "country": "US", + "continent": "North America", + "state": "CA", + "ddos_protection": true, + "block_storage": false, + "regioncode": "SJC" + }, + "40": { + "DCID": "40", + "name": "Singapore", + "country": "SG", + "continent": "Asia", + "state": "", + "ddos_protection": false, + "block_storage": false, + "regioncode": "SGP" + }, + "7": { + "DCID": "7", + "name": "Amsterdam", + "country": "NL", + "continent": "Europe", + "state": "", + "ddos_protection": true, + "block_storage": false, + "regioncode": "AMS" + }, + "34": { + "DCID": "34", + "name": "Seoul", + "country": "KR", + "continent": "Asia", + "state": "", + "ddos_protection": false, + "block_storage": false, + "regioncode": "ICN" + }, + "25": { + "DCID": "25", + "name": "Tokyo", + "country": "JP", + "continent": "Asia", + "state": "", + "ddos_protection": false, + "block_storage": false, + "regioncode": "NRT" + }, + "8": { + "DCID": "8", + "name": "London", + "country": "GB", + "continent": "Europe", + "state": "", + "ddos_protection": true, + "block_storage": false, + "regioncode": "LHR" + }, + "24": { + "DCID": "24", + "name": "Paris", + "country": "FR", + "continent": "Europe", + "state": "", + "ddos_protection": true, + "block_storage": false, + "regioncode": "CDG" + }, + "9": { + "DCID": "9", + "name": "Frankfurt", + "country": "DE", + "continent": "Europe", + "state": "", + "ddos_protection": true, + "block_storage": false, + "regioncode": "FRA" + }, + "22": { + "DCID": "22", + "name": "Toronto", + "country": "CA", + "continent": "North America", + "state": "", + "ddos_protection": false, + "block_storage": false, + "regioncode": "YTO" + }, + "19": { + "DCID": "19", + "name": "Sydney", + "country": "AU", + "continent": "Australia", + "state": "", + "ddos_protection": false, + "block_storage": false, + "regioncode": "SYD" + } +} diff --git a/libcloud/test/compute/fixtures/vultr/list_nodes.json b/libcloud/test/compute/fixtures/vultr/list_nodes.json index e12ba4a2a7..2648f5e404 100644 --- a/libcloud/test/compute/fixtures/vultr/list_nodes.json +++ b/libcloud/test/compute/fixtures/vultr/list_nodes.json @@ -1 +1,116 @@ -{"1":{"SUBID":"1","os":"Ubuntu 12.04 x64","ram":"1024 MB","disk":"Virtual 20 GB","main_ip":"108.61.206.153","vcpu_count":"1","location":"Los Angeles","DCID":"5","default_password":"twizewnatpom!7","date_created":"2014-03-21 12:46:35","pending_charges":"1.92","status":"active","cost_per_month":"7.00","current_bandwidth_gb":0.929,"allowed_bandwidth_gb":"2000","netmask_v4":"255.255.254.0","gateway_v4":"108.61.206.1","power_status":"running","VPSPLANID":"30","v6_network":"::","v6_main_ip":"","v6_network_size":"0","label":"","internal_ip":"","kvm_url":"https:\/\/my.vultr.com\/subs\/vps\/novnc\/api.php?data=IF3C6VCEN5NFOZ3VMM3FOV3JJVXUQV3OHBWDG6TUKI3VST3JMFDXOOCMIE3HCTBWKVJXOZZYF5BVMZ3IM5XXGWRZIVZW4S2WKAVTSMTQHFCG4QTCNFUEKOCXKY3CW3LGNF4HIVTVJ5GXM4CJORTU6SKYOBDE6WJVMZ3E4ZSVOB2FQ4KYF5DXC5CTJI4FETDIGBITQQZPGFLXKTSRKRJS6ODOMFKDSNLLNVETONSNKA2XQ6CWLJMW6L2EGI2U6SDNN5FGUTJYNB3UC5DXN46Q","auto_backups":"no"},"2":{"SUBID":"2","os":"Ubuntu 14.04 x64","ram":"768 MB","disk":"Virtual 15 GB","main_ip":"104.207.153.143","vcpu_count":"1","location":"Los Angeles","DCID":"5","default_password":"cewxoaezap!0","date_created":"2014-11-08 14:12:13","pending_charges":"0.01","status":"active","cost_per_month":"5.00","current_bandwidth_gb":0,"allowed_bandwidth_gb":"1000","netmask_v4":"255.255.254.0","gateway_v4":"104.207.152.1","power_status":"running","VPSPLANID":"29","v6_network":"::","v6_main_ip":"","v6_network_size":"0","label":"vultr-test1","internal_ip":"","kvm_url":"https:\/\/my.vultr.com\/subs\/vps\/novnc\/api.php?data=NBUUYMTDI4VXGVZXOFBE6UBWKFLWE43MI5EFOR3MJNZW4NRXLFBHA33BHF3C63LSOJRXAU2PO5GHM5LPOFAW2MSDMFZWUMCNNJRG6TRWJREWYNBLG5VTG2DEGIYWITKIGV2FA3JTNJVEETLOGBHFG42XLEZHG22VFNWHE5RUKFIWU3DSOJCS6WDQGJRDIZRPIU2HILZTKB4E4MZSNZIFEQ3SOFSDANCBHBBEWRLVGZEUEVDSJVQVKOKZNQ4GKSRSIJEG62TWMREG6USNIE6Q","auto_backups":"no"}} +{ + "41326859": { + "SUBID": "41326859", + "os": "CentOS SELinux 8 x64", + "ram": "1024 MB", + "disk": "Virtual 25 GB", + "main_ip": "217.69.11.158", + "vcpu_count": "1", + "location": "Paris", + "DCID": "24", + "default_password": "*7j6j6[#q", + "date_created": "2020-10-15 03:17:22", + "pending_charges": "0.04", + "status": "active", + "cost_per_month": "5.00", + "current_bandwidth_gb": 0, + "allowed_bandwidth_gb": "1000", + "netmask_v4": "255.255.254.0", + "gateway_v4": "217.69.10.1", + "power_status": "running", + "server_state": "locked", + "VPSPLANID": "201", + "v6_main_ip": "2001:19f0:6801:1cc8:5400:03ff:fe03:5478", + "v6_network_size": "64", + "v6_network": "2001:19f0:6801:1cc8::", + "v6_networks": [ + { + "v6_main_ip": "2001:19f0:6801:1cc8:5400:03ff:fe03:5478", + "v6_network_size": "64", + "v6_network": "2001:19f0:6801:1cc8::" + } + ], + "label": "labelname", + "internal_ip": "10.24.96.3", + "kvm_url": "https://my.vultr.com/subs/novnc/api.php?data=eawxFVZw2mXnhGUV", + "auto_backups": "yes", + "tag": "", + "OSID": "362", + "APPID": "0", + "FIREWALLGROUPID": "0" + }, + "41306569": { + "SUBID": "41306569", + "os": "Ubuntu 20.04 x64", + "ram": "1024 MB", + "disk": "Virtual 25 GB", + "main_ip": "45.76.43.87", + "vcpu_count": "1", + "location": "Amsterdam", + "DCID": "7", + "default_password": "h6*hrte6tg", + "date_created": "2020-10-14 09:37:50", + "pending_charges": "0.18", + "status": "active", + "cost_per_month": "5.00", + "current_bandwidth_gb": 0.026, + "allowed_bandwidth_gb": "1000", + "netmask_v4": "255.255.254.0", + "gateway_v4": "45.76.42.1", + "power_status": "running", + "server_state": "installingbooting", + "VPSPLANID": "201", + "v6_main_ip": "2001:19f0:5001:2b9c:5400:03ff:fe03:9568", + "v6_network_size": "64", + "v6_network": "2001:19f0:5001:2b9c::", + "v6_networks": [ + { + "v6_main_ip": "2001:19f0:5001:2b9c:5400:03ff:fe03:9568", + "v6_network_size": "64", + "v6_network": "2001:19f0:5001:2b9c::" + } + ], + "label": "libcloud-label", + "internal_ip": "10.7.96.85", + "kvm_url": "https://my.vultr.com/subs/novnc/api.php?data=erewawxFVZw2mXnhGUV", + "auto_backups": "yes", + "tag": "Web", + "OSID": "387", + "APPID": "0", + "FIREWALLGROUPID": "0" + }, + "41326895": { + "SUBID": "41326895", + "os": "Ubuntu 18.04 x64", + "ram": "2048 MB", + "disk": "Virtual 55 GB", + "main_ip": "136.244.113.89", + "vcpu_count": "1", + "location": "Paris", + "DCID": "24", + "default_password": "Dy4@K_Z1gvb!!8zw", + "date_created": "2020-10-15 03:17:54", + "pending_charges": "0.00", + "status": "pending", + "cost_per_month": "10.00", + "current_bandwidth_gb": 0, + "allowed_bandwidth_gb": "2000", + "netmask_v4": "255.255.254.0", + "gateway_v4": "136.244.112.1", + "power_status": "running", + "server_state": "none", + "VPSPLANID": "202", + "v6_main_ip": false, + "v6_network_size": "", + "v6_network": "", + "v6_networks": [], + "label": "servlabel", + "internal_ip": "", + "kvm_url": "", + "auto_backups": "no", + "tag": "", + "OSID": "270", + "APPID": "0", + "FIREWALLGROUPID": "4e83489b" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr/list_sizes.json b/libcloud/test/compute/fixtures/vultr/list_sizes.json index ded841de15..cb786dab0b 100644 --- a/libcloud/test/compute/fixtures/vultr/list_sizes.json +++ b/libcloud/test/compute/fixtures/vultr/list_sizes.json @@ -1 +1,405 @@ -{"31":{"VPSPLANID":"31","name":"768 MB RAM,15 GB SSD,0.20 TB BW","vcpu_count":"1","ram":"768","disk":"15","bandwidth":"0.20","bandwidth_gb":"204.8","price_per_month":"5.00","windows":false},"29":{"VPSPLANID":"29","name":"768 MB RAM,15 GB SSD,1.00 TB BW","vcpu_count":"1","ram":"768","disk":"15","bandwidth":"1.00","bandwidth_gb":"1024","price_per_month":"5.00","windows":false},"32":{"VPSPLANID":"32","name":"1024 MB RAM,20 GB SSD,0.40 TB BW","vcpu_count":"1","ram":"1024","disk":"20","bandwidth":"0.40","bandwidth_gb":"409.6","price_per_month":"7.00","windows":false},"30":{"VPSPLANID":"30","name":"1024 MB RAM,20 GB SSD,2.00 TB BW","vcpu_count":"1","ram":"1024","disk":"20","bandwidth":"2.00","bandwidth_gb":"2048","price_per_month":"7.00","windows":false},"3":{"VPSPLANID":"3","name":"2048 MB RAM,40 GB SSD,3.00 TB BW","vcpu_count":"2","ram":"2048","disk":"40","bandwidth":"3.00","bandwidth_gb":"3072","price_per_month":"15.00","windows":false},"8":{"VPSPLANID":"8","name":"2048 MB RAM,40 GB SSD,0.60 TB BW","vcpu_count":"2","ram":"2048","disk":"40","bandwidth":"0.60","bandwidth_gb":"614.4","price_per_month":"15.00","windows":false},"33":{"VPSPLANID":"33","name":"4096 MB RAM,65 GB SSD,0.80 TB BW","vcpu_count":"2","ram":"4096","disk":"65","bandwidth":"0.80","bandwidth_gb":"819.2","price_per_month":"35.00","windows":false},"27":{"VPSPLANID":"27","name":"4096 MB RAM,65 GB SSD,4.00 TB BW","vcpu_count":"2","ram":"4096","disk":"65","bandwidth":"4.00","bandwidth_gb":"4096","price_per_month":"35.00","windows":false},"28":{"VPSPLANID":"28","name":"8192 MB RAM,120 GB SSD,5.00 TB BW","vcpu_count":"4","ram":"8192","disk":"120","bandwidth":"5.00","bandwidth_gb":"5120","price_per_month":"70.00","windows":false},"34":{"VPSPLANID":"34","name":"8192 MB RAM,120 GB SSD,1.00 TB BW","vcpu_count":"4","ram":"8192","disk":"120","bandwidth":"1.00","bandwidth_gb":"1024","price_per_month":"70.00","windows":false},"11":{"VPSPLANID":"11","name":"512 MB RAM,160 GB SATA,1.00 TB BW","vcpu_count":"1","ram":"512","disk":"160","bandwidth":"1.00","bandwidth_gb":"1024","price_per_month":"5.00","windows":false},"78":{"VPSPLANID":"78","name":"16384 MB RAM,250 GB SSD,6.00 TB BW","vcpu_count":"8","ram":"16384","disk":"250","bandwidth":"6.00","bandwidth_gb":"6144","price_per_month":"149.95","windows":false},"71":{"VPSPLANID":"71","name":"16384 MB RAM,250 GB SSD,8.00 TB BW","vcpu_count":"4","ram":"16384","disk":"250","bandwidth":"8.00","bandwidth_gb":"8192","price_per_month":"125.00","windows":false},"68":{"VPSPLANID":"68","name":"16384 MB RAM,250 GB SSD,1.60 TB BW","vcpu_count":"4","ram":"16384","disk":"250","bandwidth":"1.60","bandwidth_gb":"1638.4","price_per_month":"125.00","windows":false},"12":{"VPSPLANID":"12","name":"1024 MB RAM,320 GB SATA,2.00 TB BW","vcpu_count":"1","ram":"1024","disk":"320","bandwidth":"2.00","bandwidth_gb":"2048","price_per_month":"8.00","windows":false},"62":{"VPSPLANID":"62","name":"1024 MB RAM,320 GB SATAPERF,1.00 TB BW, 10GigE","vcpu_count":"1","ram":"1024","disk":"320","bandwidth":"1.00","bandwidth_gb":"1024","price_per_month":"15.00","windows":false},"79":{"VPSPLANID":"79","name":"32768 MB RAM,400 GB SSD,7.00 TB BW","vcpu_count":"12","ram":"32768","disk":"400","bandwidth":"7.00","bandwidth_gb":"7168","price_per_month":"299.95","windows":false},"80":{"VPSPLANID":"80","name":"49152 MB RAM,600 GB SSD,8.00 TB BW","vcpu_count":"16","ram":"49152","disk":"600","bandwidth":"8.00","bandwidth_gb":"8192","price_per_month":"429.95","windows":false},"13":{"VPSPLANID":"13","name":"2048 MB RAM,640 GB SATA,3.00 TB BW","vcpu_count":"1","ram":"2048","disk":"640","bandwidth":"3.00","bandwidth_gb":"3072","price_per_month":"15.00","windows":false},"63":{"VPSPLANID":"63","name":"2048 MB RAM,640 GB SATAPERF,2.00 TB BW, 10GigE","vcpu_count":"1","ram":"2048","disk":"640","bandwidth":"2.00","bandwidth_gb":"2048","price_per_month":"25.00","windows":false},"81":{"VPSPLANID":"81","name":"65536 MB RAM,800 GB SSD,9.00 TB BW","vcpu_count":"24","ram":"65536","disk":"800","bandwidth":"9.00","bandwidth_gb":"9216","price_per_month":"599.95","windows":false},"64":{"VPSPLANID":"64","name":"4096 MB RAM,1280 GB SATAPERF,3.00 TB BW, 10GigE","vcpu_count":"2","ram":"4096","disk":"1280","bandwidth":"3.00","bandwidth_gb":"3072","price_per_month":"50.00","windows":false}} \ No newline at end of file +{ + "201": { + "VPSPLANID": "201", + "name": "1024 MB RAM,25 GB SSD,1.00 TB BW", + "vcpu_count": "1", + "ram": "1024", + "disk": "25", + "bandwidth": "1.00", + "bandwidth_gb": "1024", + "price_per_month": "5.00", + "plan_type": "SSD", + "windows": false, + "available_locations": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 12, + 19, + 22, + 24, + 25, + 39, + 40 + ] + }, + "202": { + "VPSPLANID": "202", + "name": "2048 MB RAM,55 GB SSD,2.00 TB BW", + "vcpu_count": "1", + "ram": "2048", + "disk": "55", + "bandwidth": "2.00", + "bandwidth_gb": "2048", + "price_per_month": "10.00", + "plan_type": "SSD", + "windows": false, + "available_locations": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 12, + 19, + 22, + 24, + 25, + 39, + 40 + ] + }, + "203": { + "VPSPLANID": "203", + "name": "4096 MB RAM,80 GB SSD,3.00 TB BW", + "vcpu_count": "2", + "ram": "4096", + "disk": "80", + "bandwidth": "3.00", + "bandwidth_gb": "3072", + "price_per_month": "20.00", + "plan_type": "SSD", + "windows": false, + "available_locations": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 12, + 19, + 22, + 24, + 25, + 39, + 40 + ] + }, + "204": { + "VPSPLANID": "204", + "name": "8192 MB RAM,160 GB SSD,4.00 TB BW", + "vcpu_count": "4", + "ram": "8192", + "disk": "160", + "bandwidth": "4.00", + "bandwidth_gb": "4096", + "price_per_month": "40.00", + "plan_type": "SSD", + "windows": false, + "available_locations": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 12, + 19, + 22, + 24, + 25, + 39, + 40 + ] + }, + "205": { + "VPSPLANID": "205", + "name": "16384 MB RAM,320 GB SSD,5.00 TB BW", + "vcpu_count": "6", + "ram": "16384", + "disk": "320", + "bandwidth": "5.00", + "bandwidth_gb": "5120", + "price_per_month": "80.00", + "plan_type": "SSD", + "windows": false, + "available_locations": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 12, + 19, + 22, + 24, + 25, + 39, + 40 + ] + }, + "206": { + "VPSPLANID": "206", + "name": "32768 MB RAM,640 GB SSD,6.00 TB BW", + "vcpu_count": "8", + "ram": "32768", + "disk": "640", + "bandwidth": "6.00", + "bandwidth_gb": "6144", + "price_per_month": "160.00", + "plan_type": "SSD", + "windows": false, + "available_locations": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 12, + 19, + 22, + 24, + 39 + ] + }, + "207": { + "VPSPLANID": "207", + "name": "65536 MB RAM,1280 GB SSD,10.00 TB BW", + "vcpu_count": "16", + "ram": "65536", + "disk": "1280", + "bandwidth": "10.00", + "bandwidth_gb": "10240", + "price_per_month": "320.00", + "plan_type": "SSD", + "windows": false, + "available_locations": [ + 2, + 3, + 5, + 7, + 12, + 19, + 24, + 39 + ] + }, + "208": { + "VPSPLANID": "208", + "name": "98304 MB RAM,1600 GB SSD,15.00 TB BW", + "vcpu_count": "24", + "ram": "98304", + "disk": "1600", + "bandwidth": "15.00", + "bandwidth_gb": "15360", + "price_per_month": "640.00", + "plan_type": "SSD", + "windows": false, + "available_locations": [ + 12 + ] + }, + "115": { + "VPSPLANID": "115", + "name": "8192 MB RAM,110 GB SSD,10.00 TB BW", + "vcpu_count": "2", + "ram": "8192", + "disk": "110", + "bandwidth": "10.00", + "bandwidth_gb": "10240", + "price_per_month": "60.00", + "plan_type": "DEDICATED", + "windows": false, + "available_locations": [ + 1, + 12, + 25 + ] + }, + "116": { + "VPSPLANID": "116", + "name": "16384 MB RAM,2x110 GB SSD,20.00 TB BW", + "vcpu_count": "4", + "ram": "16384", + "disk": "110", + "bandwidth": "20.00", + "bandwidth_gb": "20480", + "price_per_month": "120.00", + "plan_type": "DEDICATED", + "windows": false, + "available_locations": [ + 1 + ] + }, + "117": { + "VPSPLANID": "117", + "name": "24576 MB RAM,3x110 GB SSD,30.00 TB BW", + "vcpu_count": "6", + "ram": "24576", + "disk": "110", + "bandwidth": "30.00", + "bandwidth_gb": "30720", + "price_per_month": "180.00", + "plan_type": "DEDICATED", + "windows": false, + "available_locations": [ + 1 + ] + }, + "118": { + "VPSPLANID": "118", + "name": "32768 MB RAM,4x110 GB SSD,40.00 TB BW", + "vcpu_count": "8", + "ram": "32768", + "disk": "110", + "bandwidth": "40.00", + "bandwidth_gb": "40960", + "price_per_month": "240.00", + "plan_type": "DEDICATED", + "windows": false, + "available_locations": [ + 1 + ] + }, + "400": { + "VPSPLANID": "400", + "name": "1024 MB RAM,32 GB SSD,1.00 TB BW", + "vcpu_count": "1", + "ram": "1024", + "disk": "32", + "bandwidth": "1.00", + "bandwidth_gb": "1024", + "price_per_month": "6.00", + "plan_type": "HIGHFREQUENCY", + "windows": false, + "available_locations": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 12, + 19, + 22, + 24, + 25, + 39, + 40 + ] + }, + "401": { + "VPSPLANID": "401", + "name": "2048 MB RAM,64 GB SSD,2.00 TB BW", + "vcpu_count": "1", + "ram": "2048", + "disk": "64", + "bandwidth": "2.00", + "bandwidth_gb": "2048", + "price_per_month": "12.00", + "plan_type": "HIGHFREQUENCY", + "windows": false, + "available_locations": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 12, + 19, + 22, + 24, + 25, + 39, + 40 + ] + }, + "402": { + "VPSPLANID": "402", + "name": "4096 MB RAM,128 GB SSD,3.00 TB BW", + "vcpu_count": "2", + "ram": "4096", + "disk": "128", + "bandwidth": "3.00", + "bandwidth_gb": "3072", + "price_per_month": "24.00", + "plan_type": "HIGHFREQUENCY", + "windows": false, + "available_locations": [ + 1, + 4, + 5, + 7, + 12, + 19, + 22, + 24 + ] + }, + "403": { + "VPSPLANID": "403", + "name": "8192 MB RAM,256 GB SSD,4.00 TB BW", + "vcpu_count": "3", + "ram": "8192", + "disk": "256", + "bandwidth": "4.00", + "bandwidth_gb": "4096", + "price_per_month": "48.00", + "plan_type": "HIGHFREQUENCY", + "windows": false, + "available_locations": [ + 1, + 4, + 22 + ] + }, + "404": { + "VPSPLANID": "404", + "name": "16384 MB RAM,384 GB SSD,5.00 TB BW", + "vcpu_count": "4", + "ram": "16384", + "disk": "384", + "bandwidth": "5.00", + "bandwidth_gb": "5120", + "price_per_month": "96.00", + "plan_type": "HIGHFREQUENCY", + "windows": false, + "available_locations": [ + 22 + ] + }, + "405": { + "VPSPLANID": "405", + "name": "32768 MB RAM,512 GB SSD,6.00 TB BW", + "vcpu_count": "8", + "ram": "32768", + "disk": "512", + "bandwidth": "6.00", + "bandwidth_gb": "6144", + "price_per_month": "192.00", + "plan_type": "HIGHFREQUENCY", + "windows": false, + "available_locations": [] + }, + "406": { + "VPSPLANID": "406", + "name": "49152 MB RAM,768 GB SSD,8.00 TB BW", + "vcpu_count": "12", + "ram": "49152", + "disk": "768", + "bandwidth": "8.00", + "bandwidth_gb": "8192", + "price_per_month": "256.00", + "plan_type": "HIGHFREQUENCY", + "windows": false, + "available_locations": [] + } +} diff --git a/libcloud/test/compute/fixtures/vultr_v2/create_node.json b/libcloud/test/compute/fixtures/vultr_v2/create_node.json new file mode 100644 index 0000000000..0e6a26dd18 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/create_node.json @@ -0,0 +1,34 @@ +{ + "instance": { + "id": "123", + "os": "Fedora 34 x64", + "ram": 1024, + "disk": 0, + "main_ip": "0.0.0.0", + "vcpu_count": 1, + "region": "ams", + "plan": "vc2-1c-1gb", + "date_created": "2021-09-06T13:06:42+00:00", + "status": "pending", + "allowed_bandwidth": 1000, + "netmask_v4": "", + "gateway_v4": "0.0.0.0", + "power_status": "running", + "server_status": "none", + "v6_network": "", + "v6_main_ip": "", + "v6_network_size": 0, + "label": "test123", + "internal_ip": "10.7.96.6", + "kvm": "", + "tag": "dimgal1223444", + "os_id": 446, + "app_id": 0, + "image_id": "", + "firewall_group_id": "", + "features": [ + "ddos_protection" + ], + "default_password": "kB1?@aqK3QSk@)-q" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/create_node_bare_metal.json b/libcloud/test/compute/fixtures/vultr_v2/create_node_bare_metal.json new file mode 100644 index 0000000000..41d41ee29c --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/create_node_bare_metal.json @@ -0,0 +1,27 @@ +{ + "bare_metal": { + "id": "234", + "os": "Debian 11 x64 (bullseye)", + "ram": "32768 MB", + "disk": "2x 240GB SSD", + "main_ip": "", + "cpu_count": 4, + "region": "ams", + "date_created": "2021-09-06T16:57:22+00:00", + "status": "pending", + "netmask_v4": "", + "gateway_v4": "", + "plan": "vbm-4c-32gb", + "v6_network": "", + "v6_main_ip": "", + "v6_network_size": 0, + "label": "test1", + "tag": "", + "mac_address": 0, + "os_id": 477, + "app_id": 0, + "image_id": "", + "features": [], + "default_password": "" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/create_volume.json b/libcloud/test/compute/fixtures/vultr_v2/create_volume.json new file mode 100644 index 0000000000..dbbdb82034 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/create_volume.json @@ -0,0 +1,13 @@ +{ + "block": { + "id": "ec6d1ecc-aa70-4f18-8edd-887a258b1b45", + "date_created": "2021-09-02T09:58:24+00:00", + "cost": 1.5, + "status": "pending", + "size_gb": 15, + "region": "ewr", + "attached_to_instance": "", + "label": "test4", + "mount_id": "ewr-ec6d1eccaa704f" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/ex_create_network.json b/libcloud/test/compute/fixtures/vultr_v2/ex_create_network.json new file mode 100644 index 0000000000..644e5d7088 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/ex_create_network.json @@ -0,0 +1,10 @@ +{ + "network": { + "id": "123", + "date_created": "2021-09-02T15:01:38+00:00", + "region": "ams", + "description": "TestNetwork", + "v4_subnet": "10.0.0.0", + "v4_subnet_mask": 24 + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/ex_create_snapshot.json b/libcloud/test/compute/fixtures/vultr_v2/ex_create_snapshot.json new file mode 100644 index 0000000000..cd3573997c --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/ex_create_snapshot.json @@ -0,0 +1,11 @@ +{ + "snapshot": { + "id": "123", + "date_created": "2021-09-02T17:12:26+00:00", + "description": "Test Snapshot", + "size": 0, + "status": "pending", + "os_id": 362, + "app_id": 0 + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/ex_get_network.json b/libcloud/test/compute/fixtures/vultr_v2/ex_get_network.json new file mode 100644 index 0000000000..8de300c6c2 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/ex_get_network.json @@ -0,0 +1,10 @@ +{ + "network": { + "id": "123", + "date_created": "2021-09-02T14:23:48+00:00", + "region": "ams", + "description": "test1", + "v4_subnet": "10.7.96.0", + "v4_subnet_mask": 20 + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/ex_get_node.json b/libcloud/test/compute/fixtures/vultr_v2/ex_get_node.json new file mode 100644 index 0000000000..446ca3d88d --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/ex_get_node.json @@ -0,0 +1,31 @@ +{ + "instance": { + "id": "123", + "os": "Debian 11 x64", + "ram": 1024, + "disk": 25, + "main_ip": "45.76.36.72", + "vcpu_count": 1, + "region": "ams", + "plan": "vc2-1c-1gb", + "date_created": "2021-09-03T09:23:41+00:00", + "status": "active", + "allowed_bandwidth": 1000, + "netmask_v4": "255.255.254.0", + "gateway_v4": "45.76.36.1", + "power_status": "running", + "server_status": "ok", + "v6_network": "", + "v6_main_ip": "", + "v6_network_size": 0, + "label": "test", + "internal_ip": "", + "kvm": "https://my.vultr.com/subs/vps/novnc/api.php?data=djJ8cVloOXZ1WFhrSmEtYjJUM21pUnc3UTZVekgwOTZHSFd8I6WaGTC9G1k2TArpNPIrSyHQ8Swcfmt8N6LLV2pBopao7oRKYsm5E6uOSSdkQZxLMpuRrZcYEVc-pncPRKg3QVSlbERQOi6S8gfEWX9-7GEHdmHUub6wwK5YQe_4bn0ydQMrf1NZ97M2JKiqAaNyaaln8VGGUyO3_qOIC2zh4b2Y4cP8wfia8dDT1c6Nb-GGGHYf3FQt-n3joHeG", + "tag": "", + "os_id": 477, + "app_id": 0, + "image_id": "", + "firewall_group_id": "", + "features": [] + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/ex_get_snapshot.json b/libcloud/test/compute/fixtures/vultr_v2/ex_get_snapshot.json new file mode 100644 index 0000000000..c00ab78c57 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/ex_get_snapshot.json @@ -0,0 +1,11 @@ +{ + "snapshot": { + "id": "123", + "date_created": "2021-09-02T16:14:10+00:00", + "description": "test1", + "size": 26843545600, + "status": "complete", + "os_id": 362, + "app_id": 0 + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/ex_get_volume.json b/libcloud/test/compute/fixtures/vultr_v2/ex_get_volume.json new file mode 100644 index 0000000000..caab80d6cb --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/ex_get_volume.json @@ -0,0 +1,13 @@ +{ + "block": { + "id": "123", + "date_created": "2021-09-02T09:21:40+00:00", + "cost": 1, + "status": "active", + "size_gb": 10, + "region": "lax", + "attached_to_instance": "", + "label": "test2", + "mount_id": "lax-eabe34f30bc043" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/ex_list_available_sizes_for_location.json b/libcloud/test/compute/fixtures/vultr_v2/ex_list_available_sizes_for_location.json new file mode 100644 index 0000000000..b76ac9d3cb --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/ex_list_available_sizes_for_location.json @@ -0,0 +1,21 @@ +{ + "available_plans": [ + "vc2-1c-1gb", + "vc2-1c-2gb", + "vc2-2c-4gb", + "vc2-4c-8gb", + "vc2-6c-16gb", + "vc2-8c-32gb", + "vc2-16c-64gb", + "vc2-24c-96gb", + "vhf-1c-1gb", + "vhf-1c-2gb", + "vhf-2c-2gb", + "vhf-2c-4gb", + "vhf-3c-8gb", + "vhf-4c-16gb", + "vhf-6c-24gb", + "vhf-8c-32gb", + "vhf-12c-48gb" + ] +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/ex_list_bare_metal_nodes.json b/libcloud/test/compute/fixtures/vultr_v2/ex_list_bare_metal_nodes.json new file mode 100644 index 0000000000..3bb7528561 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/ex_list_bare_metal_nodes.json @@ -0,0 +1,59 @@ +{ + "bare_metals": [ + { + "id": "56386bca-5070-4ff1-ad80-2a6e1e7bd1f3", + "os": "Debian 11 x64 (bullseye)", + "ram": "32768 MB", + "disk": "2x 960GB SSD", + "main_ip": "140.82.58.195", + "cpu_count": 6, + "region": "ams", + "date_created": "2021-09-06T08:56:10+00:00", + "status": "pending", + "netmask_v4": "255.255.254.0", + "gateway_v4": "140.82.58.1", + "plan": "vbm-6c-32gb", + "v6_network": "", + "v6_main_ip": "", + "v6_network_size": 0, + "label": "test1", + "tag": "", + "mac_address": 66988322868494, + "os_id": 477, + "app_id": 0, + "image_id": "", + "features": [] + }, + { + "id": "234", + "os": "Debian 11 x64 (bullseye)", + "ram": "131072 MB", + "disk": "2x 2000GB NVMe", + "main_ip": "149.28.106.211", + "cpu_count": 8, + "region": "mia", + "date_created": "2021-09-06T08:56:36+00:00", + "status": "pending", + "netmask_v4": "255.255.254.0", + "gateway_v4": "149.28.106.1", + "plan": "vbm-8c-132gb", + "v6_network": "", + "v6_main_ip": "", + "v6_network_size": 0, + "label": "test2", + "tag": "", + "mac_address": 189250955239968, + "os_id": 477, + "app_id": 0, + "image_id": "", + "features": [] + } + ], + "meta": { + "total": 2, + "links": { + "next": "", + "prev": "" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/ex_list_bare_metal_sizes.json b/libcloud/test/compute/fixtures/vultr_v2/ex_list_bare_metal_sizes.json new file mode 100644 index 0000000000..9ad11f4af5 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/ex_list_bare_metal_sizes.json @@ -0,0 +1,88 @@ +{ + "plans_metal": [ + { + "id": "vbm-4c-32gb", + "cpu_count": 4, + "cpu_threads": 8, + "cpu_model": "E3-1270v6", + "ram": 32768, + "disk": 240, + "disk_count": 2, + "bandwidth": 5120, + "monthly_cost": 120, + "type": "SSD", + "locations": [ + "ewr", + "ams", + "sjc", + "mia" + ] + }, + { + "id": "vbm-8c-132gb", + "cpu_count": 8, + "cpu_threads": 16, + "cpu_model": "E-2288G", + "ram": 131072, + "disk": 2000, + "disk_count": 2, + "bandwidth": 10240, + "monthly_cost": 350, + "type": "NVMe", + "locations": [ + "ewr", + "ord", + "lax", + "atl", + "ams", + "lhr", + "sjc", + "nrt", + "mia", + "sgp" + ] + }, + { + "id": "vbm-6c-32gb", + "cpu_count": 6, + "cpu_threads": 12, + "cpu_model": "E-2286G", + "ram": 32768, + "disk": 960, + "disk_count": 2, + "bandwidth": 10240, + "monthly_cost": 185, + "type": "SSD", + "locations": [ + "ewr", + "lax", + "ams", + "lhr", + "mia", + "sgp" + ] + }, + { + "id": "vbm-24c-256gb-amd", + "cpu_count": 24, + "cpu_threads": 48, + "cpu_model": "EPYC 7443P", + "ram": 262144, + "disk": 480, + "disk_count": 2, + "bandwidth": 10240, + "monthly_cost": 800, + "type": "SSD", + "locations": [ + "ewr" + ] + } + ], + "meta": { + "total": 4, + "links": { + "next": "", + "prev": "" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/ex_list_networks.json b/libcloud/test/compute/fixtures/vultr_v2/ex_list_networks.json new file mode 100644 index 0000000000..01a62ef80c --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/ex_list_networks.json @@ -0,0 +1,27 @@ +{ + "networks": [ + { + "id": "123", + "date_created": "2021-09-02T14:23:48+00:00", + "region": "ams", + "description": "test1", + "v4_subnet": "10.7.96.0", + "v4_subnet_mask": 20 + }, + { + "id": "bff0c4e0-e459-4613-a14b-389954329b9d", + "date_created": "2021-09-02T14:37:25+00:00", + "region": "ams", + "description": "test3", + "v4_subnet": "192.168.0.0", + "v4_subnet_mask": 16 + } + ], + "meta": { + "total": 2, + "links": { + "next": "", + "prev": "" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/ex_list_snapshots.json b/libcloud/test/compute/fixtures/vultr_v2/ex_list_snapshots.json new file mode 100644 index 0000000000..6514be3c66 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/ex_list_snapshots.json @@ -0,0 +1,29 @@ +{ + "snapshots": [ + { + "id": "123", + "date_created": "2021-09-02T16:14:10+00:00", + "description": "test1", + "size": 26843545600, + "status": "complete", + "os_id": 362, + "app_id": 0 + }, + { + "id": "1234", + "date_created": "2021-09-02T16:34:11+00:00", + "description": "test2", + "size": 0, + "status": "pending", + "os_id": 362, + "app_id": 0 + } + ], + "meta": { + "total": 2, + "links": { + "next": "", + "prev": "" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/ex_resize_node.json b/libcloud/test/compute/fixtures/vultr_v2/ex_resize_node.json new file mode 100644 index 0000000000..80f54956a0 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/ex_resize_node.json @@ -0,0 +1,31 @@ +{ + "instance": { + "id": "123", + "os": "Debian 11 x64", + "ram": 1024, + "disk": 0, + "main_ip": "192.248.168.21", + "vcpu_count": 1, + "region": "lhr", + "plan": "vc2-1c-2gb", + "date_created": "2021-09-06T17:27:58+00:00", + "status": "resizing", + "allowed_bandwidth": 1000, + "netmask_v4": "255.255.254.0", + "gateway_v4": "192.248.168.1", + "power_status": "running", + "server_status": "locked", + "v6_network": "", + "v6_main_ip": "", + "v6_network_size": 0, + "label": "test4", + "internal_ip": "", + "kvm": "", + "tag": "", + "os_id": 477, + "app_id": 0, + "image_id": "", + "firewall_group_id": "", + "features": [] + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/get_key_pair.json b/libcloud/test/compute/fixtures/vultr_v2/get_key_pair.json new file mode 100644 index 0000000000..44c83f5b55 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/get_key_pair.json @@ -0,0 +1,8 @@ +{ + "ssh_key": { + "id": "123", + "date_created": "2019-09-20T11:14:26+00:00", + "name": "tester", + "ssh_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwRaxNA9gsFPVAIq4rkBjTtBAsofSJ0lJS3hPFHiwABpiihu45dcJtcmIqUO2jooVsKCfPJ/KrZ5DqhgPWbHJ/C+ZtHDhZ19jq022nfb+tfqCgwolKd8POlmivtpQdl3AaG4hm/Uh0VICAsrgp1o6EEzRLJE6vWrz4XaIUKYI1idzv/1kF2R9LBb60HXsQaIeV5z0036uy9d55wG+DtwUIpBBfyxevISS9n1kEI+MHi+Ci4D9dmE3SGm+9gDAZ2ZwPjWcAiUnf8SJ5CyA3MwUCa8czPgVMtpt5qZNYxilrGJEpPhnCHwT3YvUbh69F24kMDj2IX9LYjcvUsgIjXuxb" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/import_key_pair_from_string.json b/libcloud/test/compute/fixtures/vultr_v2/import_key_pair_from_string.json new file mode 100644 index 0000000000..59cbb914a4 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/import_key_pair_from_string.json @@ -0,0 +1,8 @@ +{ + "ssh_key": { + "id": "123", + "date_created": "2021-09-01T17:54:35+00:00", + "name": "tester", + "ssh_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwRaxNA9gsFPVAIq4rkBjTtBAsofSJ0lJS3hPFHiwABpiihu45dcJtcmIqUO2jooVsKCfPJ/KrZ5DqhgPWbHJ/C+ZtHDhZ19jq022nfb+tfqCgwolKd8POlmivtpQdl3AaG4hm/Uh0VICAsrgp1o6EEzRLJE6vWrz4XaIUKYI1idzv/1kF2R9LBb60HXsQaIeV5z0036uy9d55wG+DtwUIpBBfyxevISS9n1kEI+MHi+Ci4D9dmE3SGm+9gDAZ2ZwPjWcAiUnf8SJ5CyA3MwUCa8czPgVMtpt5qZNYxilrGJEpPhnCHwT3YvUbh69F24kMDj2IX9LYjcvUsgIjXuxb" + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/list_images.json b/libcloud/test/compute/fixtures/vultr_v2/list_images.json new file mode 100644 index 0000000000..ff9de0356b --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/list_images.json @@ -0,0 +1,191 @@ +{ + "os": [ + { + "id": 124, + "name": "Windows 2012 R2 x64", + "arch": "x64", + "family": "windows" + }, + { + "id": 159, + "name": "Custom", + "arch": "x64", + "family": "iso" + }, + { + "id": 164, + "name": "Snapshot", + "arch": "x64", + "family": "snapshot" + }, + { + "id": 167, + "name": "CentOS 7 x64", + "arch": "x64", + "family": "centos" + }, + { + "id": 180, + "name": "Backup", + "arch": "x64", + "family": "backup" + }, + { + "id": 186, + "name": "Application", + "arch": "x64", + "family": "application" + }, + { + "id": 194, + "name": "Debian 8 i386 (jessie)", + "arch": "i386", + "family": "debian" + }, + { + "id": 215, + "name": "Ubuntu 16.04 x64", + "arch": "x64", + "family": "ubuntu" + }, + { + "id": 216, + "name": "Ubuntu 16.04 i386", + "arch": "i386", + "family": "ubuntu" + }, + { + "id": 230, + "name": "FreeBSD 11 x64", + "arch": "x64", + "family": "freebsd" + }, + { + "id": 240, + "name": "Windows 2016 x64", + "arch": "x64", + "family": "windows" + }, + { + "id": 244, + "name": "Debian 9 x64 (stretch)", + "arch": "x64", + "family": "debian" + }, + { + "id": 270, + "name": "Ubuntu 18.04 x64", + "arch": "x64", + "family": "ubuntu" + }, + { + "id": 327, + "name": "FreeBSD 12 x64", + "arch": "x64", + "family": "freebsd" + }, + { + "id": 352, + "name": "Debian 10 x64 (buster)", + "arch": "x64", + "family": "debian" + }, + { + "id": 362, + "name": "CentOS 8 x64", + "arch": "x64", + "family": "centos" + }, + { + "id": 371, + "name": "Windows 2019 x64", + "arch": "x64", + "family": "windows" + }, + { + "id": 381, + "name": "CentOS 7 SELinux x64", + "arch": "x64", + "family": "centos" + }, + { + "id": 387, + "name": "Ubuntu 20.04 x64", + "arch": "x64", + "family": "ubuntu" + }, + { + "id": 401, + "name": "CentOS 8 Stream x64", + "arch": "x64", + "family": "centos" + }, + { + "id": 412, + "name": "OpenBSD 6.8 x64", + "arch": "x64", + "family": "openbsd" + }, + { + "id": 413, + "name": "Ubuntu 20.10 x64", + "arch": "x64", + "family": "ubuntu" + }, + { + "id": 415, + "name": "Fedora 33 x64", + "arch": "x64", + "family": "fedora" + }, + { + "id": 445, + "name": "Ubuntu 21.04 x64", + "arch": "x64", + "family": "ubuntu" + }, + { + "id": 446, + "name": "Fedora 34 x64", + "arch": "x64", + "family": "fedora" + }, + { + "id": 447, + "name": "FreeBSD 13 x64", + "arch": "x64", + "family": "freebsd" + }, + { + "id": 448, + "name": "Rocky Linux x64", + "arch": "x64", + "family": "rockylinux" + }, + { + "id": 450, + "name": "OpenBSD 6.9 x64", + "arch": "x64", + "family": "openbsd" + }, + { + "id": 452, + "name": "AlmaLinux x64", + "arch": "x64", + "family": "almalinux" + }, + { + "id": 477, + "name": "Debian 11 x64 (bullseye)", + "arch": "x64", + "family": "debian" + } + ], + "meta": { + "total": 30, + "links": { + "next": "", + "prev": "" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/list_images_paginated_1.json b/libcloud/test/compute/fixtures/vultr_v2/list_images_paginated_1.json new file mode 100644 index 0000000000..e4ee1ba5bf --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/list_images_paginated_1.json @@ -0,0 +1,71 @@ +{ + "os": [ + { + "id": 124, + "name": "Windows 2012 R2 x64", + "arch": "x64", + "family": "windows" + }, + { + "id": 159, + "name": "Custom", + "arch": "x64", + "family": "iso" + }, + { + "id": 164, + "name": "Snapshot", + "arch": "x64", + "family": "snapshot" + }, + { + "id": 167, + "name": "CentOS 7 x64", + "arch": "x64", + "family": "centos" + }, + { + "id": 180, + "name": "Backup", + "arch": "x64", + "family": "backup" + }, + { + "id": 186, + "name": "Application", + "arch": "x64", + "family": "application" + }, + { + "id": 194, + "name": "Debian 8 i386 (jessie)", + "arch": "i386", + "family": "debian" + }, + { + "id": 215, + "name": "Ubuntu 16.04 x64", + "arch": "x64", + "family": "ubuntu" + }, + { + "id": 216, + "name": "Ubuntu 16.04 i386", + "arch": "i386", + "family": "ubuntu" + }, + { + "id": 230, + "name": "FreeBSD 11 x64", + "arch": "x64", + "family": "freebsd" + } + ], + "meta": { + "total": 30, + "links": { + "next": "bmV4dF9fMjMw", + "prev": "" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/list_images_paginated_2.json b/libcloud/test/compute/fixtures/vultr_v2/list_images_paginated_2.json new file mode 100644 index 0000000000..ba4831319e --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/list_images_paginated_2.json @@ -0,0 +1,71 @@ +{ + "os": [ + { + "id": 240, + "name": "Windows 2016 x64", + "arch": "x64", + "family": "windows" + }, + { + "id": 244, + "name": "Debian 9 x64 (stretch)", + "arch": "x64", + "family": "debian" + }, + { + "id": 270, + "name": "Ubuntu 18.04 x64", + "arch": "x64", + "family": "ubuntu" + }, + { + "id": 327, + "name": "FreeBSD 12 x64", + "arch": "x64", + "family": "freebsd" + }, + { + "id": 352, + "name": "Debian 10 x64 (buster)", + "arch": "x64", + "family": "debian" + }, + { + "id": 362, + "name": "CentOS 8 x64", + "arch": "x64", + "family": "centos" + }, + { + "id": 371, + "name": "Windows 2019 x64", + "arch": "x64", + "family": "windows" + }, + { + "id": 381, + "name": "CentOS 7 SELinux x64", + "arch": "x64", + "family": "centos" + }, + { + "id": 387, + "name": "Ubuntu 20.04 x64", + "arch": "x64", + "family": "ubuntu" + }, + { + "id": 401, + "name": "CentOS 8 Stream x64", + "arch": "x64", + "family": "centos" + } + ], + "meta": { + "total": 30, + "links": { + "next": "bmV4dF9fNDAx", + "prev": "cHJldl9fMjQw" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/list_images_paginated_3.json b/libcloud/test/compute/fixtures/vultr_v2/list_images_paginated_3.json new file mode 100644 index 0000000000..0289b438b0 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/list_images_paginated_3.json @@ -0,0 +1,71 @@ +{ + "os": [ + { + "id": 412, + "name": "OpenBSD 6.8 x64", + "arch": "x64", + "family": "openbsd" + }, + { + "id": 413, + "name": "Ubuntu 20.10 x64", + "arch": "x64", + "family": "ubuntu" + }, + { + "id": 415, + "name": "Fedora 33 x64", + "arch": "x64", + "family": "fedora" + }, + { + "id": 445, + "name": "Ubuntu 21.04 x64", + "arch": "x64", + "family": "ubuntu" + }, + { + "id": 446, + "name": "Fedora 34 x64", + "arch": "x64", + "family": "fedora" + }, + { + "id": 447, + "name": "FreeBSD 13 x64", + "arch": "x64", + "family": "freebsd" + }, + { + "id": 448, + "name": "Rocky Linux x64", + "arch": "x64", + "family": "rockylinux" + }, + { + "id": 450, + "name": "OpenBSD 6.9 x64", + "arch": "x64", + "family": "openbsd" + }, + { + "id": 452, + "name": "AlmaLinux x64", + "arch": "x64", + "family": "almalinux" + }, + { + "id": 477, + "name": "Debian 11 x64 (bullseye)", + "arch": "x64", + "family": "debian" + } + ], + "meta": { + "total": 30, + "links": { + "next": "", + "prev": "cHJldl9fNDEy" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/list_key_pairs.json b/libcloud/test/compute/fixtures/vultr_v2/list_key_pairs.json new file mode 100644 index 0000000000..b4e4218688 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/list_key_pairs.json @@ -0,0 +1,17 @@ +{ + "ssh_keys": [ + { + "id": "123", + "date_created": "2019-09-20T11:14:26+00:00", + "name": "tester", + "ssh_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwRaxNA9gsFPVAIq4rkBjTtBAsofSJ0lJS3hPFHiwABpiihu45dcJtcmIqUO2jooVsKCfPJ/KrZ5DqhgPWbHJ/C+ZtHDhZ19jq022nfb+tfqCgwolKd8POlmivtpQdl3AaG4hm/Uh0VICAsrgp1o6EEzRLJE6vWrz4XaIUKYI1idzv/1kF2R9LBb60HXsQaIeV5z0036uy9d55wG+DtwUIpBBfyxevISS9n1kEI+MHi+Ci4D9dmE3SGm+9gDAZ2ZwPjWcAiUnf8SJ5CyA3MwUCa8czPgVMtpt5qZNYxilrGJEpPhnCHwT3YvUbh69F24kMDj2IX9LYjcvUsgIjXuxb" + } + ], + "meta": { + "total": 1, + "links": { + "next": "", + "prev": "" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/list_locations.json b/libcloud/test/compute/fixtures/vultr_v2/list_locations.json new file mode 100644 index 0000000000..30bbcf3eb8 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/list_locations.json @@ -0,0 +1,154 @@ +{ + "regions": [ + { + "id": "ams", + "city": "Amsterdam", + "country": "NL", + "continent": "Europe", + "options": [ + "ddos_protection" + ] + }, + { + "id": "atl", + "city": "Atlanta", + "country": "US", + "continent": "North America", + "options": [] + }, + { + "id": "cdg", + "city": "Paris", + "country": "FR", + "continent": "Europe", + "options": [ + "ddos_protection" + ] + }, + { + "id": "dfw", + "city": "Dallas", + "country": "US", + "continent": "North America", + "options": [ + "ddos_protection" + ] + }, + { + "id": "ewr", + "city": "New Jersey", + "country": "US", + "continent": "North America", + "options": [ + "ddos_protection", + "block_storage" + ] + }, + { + "id": "fra", + "city": "Frankfurt", + "country": "DE", + "continent": "Europe", + "options": [ + "ddos_protection" + ] + }, + { + "id": "icn", + "city": "Seoul", + "country": "KR", + "continent": "Asia", + "options": [] + }, + { + "id": "lax", + "city": "Los Angeles", + "country": "US", + "continent": "North America", + "options": [ + "ddos_protection", + "block_storage" + ] + }, + { + "id": "lhr", + "city": "London", + "country": "GB", + "continent": "Europe", + "options": [ + "ddos_protection" + ] + }, + { + "id": "mia", + "city": "Miami", + "country": "US", + "continent": "North America", + "options": [ + "ddos_protection" + ] + }, + { + "id": "nrt", + "city": "Tokyo", + "country": "JP", + "continent": "Asia", + "options": [] + }, + { + "id": "ord", + "city": "Chicago", + "country": "US", + "continent": "North America", + "options": [ + "ddos_protection" + ] + }, + { + "id": "sea", + "city": "Seattle", + "country": "US", + "continent": "North America", + "options": [ + "ddos_protection" + ] + }, + { + "id": "sgp", + "city": "Singapore", + "country": "SG", + "continent": "Asia", + "options": [] + }, + { + "id": "sjc", + "city": "Silicon Valley", + "country": "US", + "continent": "North America", + "options": [ + "ddos_protection" + ] + }, + { + "id": "syd", + "city": "Sydney", + "country": "AU", + "continent": "Australia", + "options": [] + }, + { + "id": "yto", + "city": "Toronto", + "country": "CA", + "continent": "North America", + "options": [] + } + ], + "meta": { + "total": 17, + "links": { + "next": "", + "prev": "" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/list_nodes.json b/libcloud/test/compute/fixtures/vultr_v2/list_nodes.json new file mode 100644 index 0000000000..991c821d36 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/list_nodes.json @@ -0,0 +1,98 @@ +{ + "instances": [ + { + "id": "123", + "os": "Debian 11 x64", + "ram": 2048, + "disk": 55, + "main_ip": "45.76.83.44", + "vcpu_count": 1, + "region": "fra", + "plan": "vc2-1c-2gb", + "date_created": "2021-09-01T13:25:48+00:00", + "status": "active", + "allowed_bandwidth": 2000, + "netmask_v4": "255.255.254.0", + "gateway_v4": "45.76.82.1", + "power_status": "running", + "server_status": "ok", + "v6_network": "", + "v6_main_ip": "", + "v6_network_size": 0, + "label": "test1", + "internal_ip": "", + "kvm": "https://my.vultr.com/subs/vps/novnc/api.php?data=djJ8ZVBnQ0JBLTRiZXVsbFEwUTQ5d1lCZm9pUTg1TU1HZW18_W82tMSskjZ-JcSOY5byxcZXKmqln0e78tNYhtpJTcRHLZux1wwA_4-H4_rgnV5a8Ab71igsIJYH13I-ciWkfMvq6pjEFhC-7Pn3yGyT12wKADTTn6ooqAHaoNAcMgF69Y4XkcQCyaaidGDDkizuIqoW-_wIDOOT6_qpsnSojXC4YT3NFWRT5eXhcfZ3yRTzL6QRrZALcg", + "tag": "", + "os_id": 477, + "app_id": 0, + "image_id": "", + "firewall_group_id": "", + "features": [] + }, + { + "id": "bccc8184-ae8b-49d9-ab7c-2dd5c507a4fd", + "os": "Debian 11 x64", + "ram": 2048, + "disk": 55, + "main_ip": "95.179.240.250", + "vcpu_count": 1, + "region": "fra", + "plan": "vc2-1c-2gb", + "date_created": "2021-09-01T13:25:48+00:00", + "status": "active", + "allowed_bandwidth": 2000, + "netmask_v4": "255.255.254.0", + "gateway_v4": "95.179.240.1", + "power_status": "running", + "server_status": "ok", + "v6_network": "", + "v6_main_ip": "", + "v6_network_size": 0, + "label": "test2", + "internal_ip": "", + "kvm": "https://my.vultr.com/subs/vps/novnc/api.php?data=djJ8NERxaGNOUTdBNTBCSGpSRXNSdUVrT1ZKQjQ5czNFZVF8XIBGjDtR2pnyEzCEiCQ1PdcS4DbBw2P5Fcjhji9d6UdVxpBaoyUuaHgU9EF8TKTXzdY68di17lCYMM4OeyVNL60FtOPdvzOHVS_bMvWfpINMqPMUWqaRmBKfhoU-pqjmsR8tdG0ikzYoISZjX2MCyjUb1NLOGlYhYZxtoeIGAN1WH1PEsNVGCN0sjedTU9mU_NWksEbChg", + "tag": "", + "os_id": 477, + "app_id": 0, + "image_id": "", + "firewall_group_id": "", + "features": [] + }, + { + "id": "75c17a64-e703-4d3e-9969-70d39b6db3bf", + "os": "Debian 11 x64", + "ram": 1024, + "disk": 25, + "main_ip": "209.250.231.249", + "vcpu_count": 1, + "region": "lhr", + "plan": "vc2-1c-1gb", + "date_created": "2021-09-01T13:46:07+00:00", + "status": "active", + "allowed_bandwidth": 1000, + "netmask_v4": "255.255.254.0", + "gateway_v4": "209.250.230.1", + "power_status": "running", + "server_status": "installingbooting", + "v6_network": "", + "v6_main_ip": "", + "v6_network_size": 0, + "label": "test3", + "internal_ip": "10.8.96.3", + "kvm": "https://my.vultr.com/subs/vps/novnc/api.php?data=djJ8R2ZXVDBFNlZPTUZ4MGZ6c05RWTRCbm8xNGEzQWQ3c1V8SEMN_h5Ck9zyOao1yJc0n7a9drQKMnEu_ywag_9t2tO7C3Q11XFXlEVXE72FbK7vlo66wrlXcELoE8uSoJEru-E1Tfe3caW_ponY80ZsA7gFzDaQ55rfhBZGt0kARmZE0Cn3P1D6LTFoZ2BWjHYAdXzFLBaHOzFNts95gFibsF1GAi1n4TtvQAMee4QpHaqcO8JOY7X3HQ", + "tag": "", + "os_id": 477, + "app_id": 0, + "image_id": "", + "firewall_group_id": "", + "features": [] + } + ], + "meta": { + "total": 3, + "links": { + "next": "", + "prev": "" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/list_sizes.json b/libcloud/test/compute/fixtures/vultr_v2/list_sizes.json new file mode 100644 index 0000000000..085e1e1d4a --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/list_sizes.json @@ -0,0 +1,518 @@ +{ + "plans": [ + { + "id": "vc2-1c-1gb", + "vcpu_count": 1, + "ram": 1024, + "disk": 25, + "disk_count": 1, + "bandwidth": 1024, + "monthly_cost": 5, + "type": "vc2", + "locations": [ + "ewr", + "ord", + "dfw", + "sea", + "lax", + "atl", + "ams", + "lhr", + "fra", + "sjc", + "syd", + "yto", + "cdg", + "nrt", + "icn", + "mia", + "sgp" + ] + }, + { + "id": "vc2-1c-2gb", + "vcpu_count": 1, + "ram": 2048, + "disk": 55, + "disk_count": 1, + "bandwidth": 2048, + "monthly_cost": 10, + "type": "vc2", + "locations": [ + "ewr", + "ord", + "dfw", + "sea", + "lax", + "atl", + "ams", + "lhr", + "fra", + "sjc", + "syd", + "yto", + "cdg", + "nrt", + "icn", + "mia", + "sgp" + ] + }, + { + "id": "vc2-2c-4gb", + "vcpu_count": 2, + "ram": 4096, + "disk": 80, + "disk_count": 1, + "bandwidth": 3072, + "monthly_cost": 20, + "type": "vc2", + "locations": [ + "ewr", + "ord", + "dfw", + "sea", + "lax", + "atl", + "ams", + "lhr", + "fra", + "sjc", + "syd", + "yto", + "cdg", + "nrt", + "icn", + "mia", + "sgp" + ] + }, + { + "id": "vc2-4c-8gb", + "vcpu_count": 4, + "ram": 8192, + "disk": 160, + "disk_count": 1, + "bandwidth": 4096, + "monthly_cost": 40, + "type": "vc2", + "locations": [ + "ewr", + "ord", + "dfw", + "sea", + "lax", + "atl", + "ams", + "lhr", + "fra", + "sjc", + "syd", + "yto", + "cdg", + "nrt", + "icn", + "mia", + "sgp" + ] + }, + { + "id": "vc2-6c-16gb", + "vcpu_count": 6, + "ram": 16384, + "disk": 320, + "disk_count": 1, + "bandwidth": 5120, + "monthly_cost": 80, + "type": "vc2", + "locations": [ + "ewr", + "ord", + "dfw", + "sea", + "lax", + "atl", + "ams", + "lhr", + "fra", + "sjc", + "syd", + "yto", + "cdg", + "nrt", + "icn", + "mia", + "sgp" + ] + }, + { + "id": "vc2-8c-32gb", + "vcpu_count": 8, + "ram": 32768, + "disk": 640, + "disk_count": 1, + "bandwidth": 6144, + "monthly_cost": 160, + "type": "vc2", + "locations": [ + "ewr", + "ord", + "dfw", + "sea", + "lax", + "atl", + "ams", + "lhr", + "fra", + "sjc", + "syd", + "yto", + "cdg", + "nrt", + "icn", + "mia", + "sgp" + ] + }, + { + "id": "vc2-16c-64gb", + "vcpu_count": 16, + "ram": 65536, + "disk": 1280, + "disk_count": 1, + "bandwidth": 10240, + "monthly_cost": 320, + "type": "vc2", + "locations": [ + "ewr", + "ord", + "dfw", + "sea", + "lax", + "ams", + "fra", + "sjc", + "syd", + "yto", + "cdg", + "nrt", + "icn", + "sgp" + ] + }, + { + "id": "vc2-24c-96gb", + "vcpu_count": 24, + "ram": 98304, + "disk": 1600, + "disk_count": 1, + "bandwidth": 15360, + "monthly_cost": 640, + "type": "vc2", + "locations": [ + "ewr", + "ord", + "sea", + "lax", + "ams", + "fra", + "sjc", + "syd", + "yto", + "cdg", + "nrt", + "icn", + "sgp" + ] + }, + { + "id": "vdc-2vcpu-8gb", + "vcpu_count": 2, + "ram": 8192, + "disk": 110, + "disk_count": 1, + "bandwidth": 10240, + "monthly_cost": 60, + "type": "vdc", + "locations": [ + "ewr", + "ord", + "dfw", + "lax", + "ams", + "lhr", + "fra", + "sjc", + "syd", + "nrt", + "mia" + ] + }, + { + "id": "vdc-4vcpu-16gb", + "vcpu_count": 4, + "ram": 16384, + "disk": 110, + "disk_count": 2, + "bandwidth": 20480, + "monthly_cost": 120, + "type": "vdc", + "locations": [ + "ewr", + "ord", + "dfw", + "sjc", + "syd", + "nrt" + ] + }, + { + "id": "vdc-6vcpu-24gb", + "vcpu_count": 6, + "ram": 24576, + "disk": 110, + "disk_count": 3, + "bandwidth": 30720, + "monthly_cost": 180, + "type": "vdc", + "locations": [ + "ewr" + ] + }, + { + "id": "vdc-8vcpu-32gb", + "vcpu_count": 8, + "ram": 32768, + "disk": 110, + "disk_count": 4, + "bandwidth": 40960, + "monthly_cost": 240, + "type": "vdc", + "locations": [] + }, + { + "id": "vhf-1c-1gb", + "vcpu_count": 1, + "ram": 1024, + "disk": 32, + "disk_count": 1, + "bandwidth": 1024, + "monthly_cost": 6, + "type": "vhf", + "locations": [ + "ewr", + "ord", + "dfw", + "sea", + "lax", + "atl", + "ams", + "lhr", + "fra", + "sjc", + "syd", + "yto", + "cdg", + "nrt", + "icn", + "mia", + "sgp" + ] + }, + { + "id": "vhf-1c-2gb", + "vcpu_count": 1, + "ram": 2048, + "disk": 64, + "disk_count": 1, + "bandwidth": 2048, + "monthly_cost": 12, + "type": "vhf", + "locations": [ + "ewr", + "ord", + "dfw", + "sea", + "lax", + "atl", + "ams", + "lhr", + "fra", + "sjc", + "syd", + "yto", + "cdg", + "nrt", + "icn", + "mia", + "sgp" + ] + }, + { + "id": "vhf-2c-2gb", + "vcpu_count": 2, + "ram": 2048, + "disk": 80, + "disk_count": 1, + "bandwidth": 3072, + "monthly_cost": 18, + "type": "vhf", + "locations": [ + "ewr", + "ord", + "dfw", + "sea", + "lax", + "atl", + "ams", + "lhr", + "fra", + "sjc", + "syd", + "yto", + "cdg", + "nrt", + "icn", + "mia", + "sgp" + ] + }, + { + "id": "vhf-2c-4gb", + "vcpu_count": 2, + "ram": 4096, + "disk": 128, + "disk_count": 1, + "bandwidth": 3072, + "monthly_cost": 24, + "type": "vhf", + "locations": [ + "ewr", + "ord", + "dfw", + "sea", + "lax", + "atl", + "ams", + "lhr", + "fra", + "sjc", + "syd", + "yto", + "cdg", + "nrt", + "icn", + "mia", + "sgp" + ] + }, + { + "id": "vhf-3c-8gb", + "vcpu_count": 3, + "ram": 8192, + "disk": 256, + "disk_count": 1, + "bandwidth": 4096, + "monthly_cost": 48, + "type": "vhf", + "locations": [ + "ewr", + "ord", + "dfw", + "sea", + "lax", + "atl", + "ams", + "fra", + "sjc", + "yto", + "cdg", + "nrt", + "icn" + ] + }, + { + "id": "vhf-4c-16gb", + "vcpu_count": 4, + "ram": 16384, + "disk": 384, + "disk_count": 1, + "bandwidth": 5120, + "monthly_cost": 96, + "type": "vhf", + "locations": [ + "ewr", + "ord", + "sea", + "atl", + "ams", + "sjc", + "yto", + "cdg", + "icn" + ] + }, + { + "id": "vhf-6c-24gb", + "vcpu_count": 6, + "ram": 24576, + "disk": 448, + "disk_count": 1, + "bandwidth": 6144, + "monthly_cost": 144, + "type": "vhf", + "locations": [ + "ewr", + "ord", + "sea", + "atl", + "ams", + "sjc", + "yto", + "cdg", + "icn" + ] + }, + { + "id": "vhf-8c-32gb", + "vcpu_count": 8, + "ram": 32768, + "disk": 512, + "disk_count": 1, + "bandwidth": 7168, + "monthly_cost": 192, + "type": "vhf", + "locations": [ + "ewr", + "ord", + "atl", + "sjc", + "yto", + "cdg", + "icn" + ] + }, + { + "id": "vhf-12c-48gb", + "vcpu_count": 12, + "ram": 49152, + "disk": 768, + "disk_count": 1, + "bandwidth": 8192, + "monthly_cost": 256, + "type": "vhf", + "locations": [ + "yto", + "cdg", + "icn" + ] + } + ], + "meta": { + "total": 21, + "links": { + "next": "", + "prev": "" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/fixtures/vultr_v2/list_volumes.json b/libcloud/test/compute/fixtures/vultr_v2/list_volumes.json new file mode 100644 index 0000000000..24aff5a007 --- /dev/null +++ b/libcloud/test/compute/fixtures/vultr_v2/list_volumes.json @@ -0,0 +1,33 @@ +{ + "blocks": [ + { + "id": "123", + "date_created": "2021-09-02T08:27:19+00:00", + "cost": 1, + "status": "active", + "size_gb": 10, + "region": "lax", + "attached_to_instance": "", + "label": "test1", + "mount_id": "lax-5fff2de3d2934e" + }, + { + "id": "1234", + "date_created": "2021-09-02T08:27:49+00:00", + "cost": 1, + "status": "active", + "size_gb": 10, + "region": "ewr", + "attached_to_instance": "", + "label": "", + "mount_id": "ewr-f9b12f0296f942" + } + ], + "meta": { + "total": 2, + "links": { + "next": "", + "prev": "" + } + } +} \ No newline at end of file diff --git a/libcloud/test/compute/test_abiquo.py b/libcloud/test/compute/test_abiquo.py index 55c82d4303..7117403c3a 100644 --- a/libcloud/test/compute/test_abiquo.py +++ b/libcloud/test/compute/test_abiquo.py @@ -15,38 +15,31 @@ """ Abiquo Test Suite """ -import unittest -import sys - -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET -from libcloud.utils.py3 import httplib +import sys -from libcloud.compute.drivers.abiquo import AbiquoNodeDriver -from libcloud.common.abiquo import ForbiddenError, get_href -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.compute.base import NodeLocation, NodeImage +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import ET, httplib +from libcloud.common.types import LibcloudError, InvalidCredsError +from libcloud.compute.base import NodeImage, NodeLocation from libcloud.test.compute import TestCaseMixin -from libcloud.test import MockHttpTestCase +from libcloud.common.abiquo import ForbiddenError, get_href from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.abiquo import AbiquoNodeDriver -class AbiquoNodeDriverTest(unittest.TestCase, TestCaseMixin): - +class AbiquoNodeDriverTest(TestCaseMixin, unittest.TestCase): """ Abiquo Node Driver test suite """ - def setUp(self): + @classmethod + def setUpClass(cls): """ Set up the driver with the main user """ - AbiquoNodeDriver.connectionCls.conn_classes = (AbiquoMockHttp, None) - self.driver = AbiquoNodeDriver('son', 'goku', - 'http://dummy.host.com/api') + AbiquoNodeDriver.connectionCls.conn_class = AbiquoMockHttp + cls.driver = AbiquoNodeDriver("son", "goku", "http://dummy.host.com/api") def test_unauthorized_controlled(self): """ @@ -55,8 +48,13 @@ def test_unauthorized_controlled(self): Test, through the 'login' method, that a '401 Unauthorized' raises a 'InvalidCredsError' instead of the 'MalformedUrlException' """ - self.assertRaises(InvalidCredsError, AbiquoNodeDriver, 'son', - 'goten', 'http://dummy.host.com/api') + self.assertRaises( + InvalidCredsError, + AbiquoNodeDriver, + "son", + "goten", + "http://dummy.host.com/api", + ) def test_forbidden_controlled(self): """ @@ -65,8 +63,8 @@ def test_forbidden_controlled(self): Test, through the 'list_images' method, that a '403 Forbidden' raises an 'ForbidenError' instead of the 'MalformedUrlException' """ - AbiquoNodeDriver.connectionCls.conn_classes = (AbiquoMockHttp, None) - conn = AbiquoNodeDriver('son', 'gohan', 'http://dummy.host.com/api') + AbiquoNodeDriver.connectionCls.conn_class = AbiquoMockHttp + conn = AbiquoNodeDriver("son", "gohan", "http://dummy.host.com/api") self.assertRaises(ForbiddenError, conn.list_images) def test_handle_other_errors_such_as_not_found(self): @@ -77,15 +75,14 @@ def test_handle_other_errors_such_as_not_found(self): that return an XMLResponse with the explanation of the errors are controlled. """ - self.driver = AbiquoNodeDriver('go', 'trunks', - 'http://dummy.host.com/api') + self.driver = AbiquoNodeDriver("go", "trunks", "http://dummy.host.com/api") self.assertRaises(LibcloudError, self.driver.list_images) def test_ex_create_and_delete_empty_group(self): """ Test the creation and deletion of an empty group. """ - group = self.driver.ex_create_group('libcloud_test_group') + group = self.driver.ex_create_group("libcloud_test_group") group.destroy() def test_create_node_no_image_raise_exception(self): @@ -95,7 +92,7 @@ def test_create_node_no_image_raise_exception(self): Test the 'create_node' function without 'image' parameter raises an Exception """ - self.assertRaises(LibcloudError, self.driver.create_node) + self.assertRaises(TypeError, self.driver.create_node) def test_list_locations_response(self): if not self.should_list_locations: @@ -110,16 +107,22 @@ def test_create_node_specify_location(self): """ image = self.driver.list_images()[0] location = self.driver.list_locations()[0] - self.driver.create_node(image=image, location=location) + self.driver.create_node(name=None, size=None, image=image, location=location) def test_create_node_specify_wrong_location(self): """ Test you can not create a node with wrong location. """ image = self.driver.list_images()[0] - location = NodeLocation(435, 'fake-location', 'Spain', self.driver) - self.assertRaises(LibcloudError, self.driver.create_node, image=image, - location=location) + location = NodeLocation(435, "fake-location", "Spain", self.driver) + self.assertRaises( + LibcloudError, + self.driver.create_node, + name=None, + size=None, + image=image, + location=location, + ) def test_create_node_specify_wrong_image(self): """ @@ -129,18 +132,24 @@ def test_create_node_specify_wrong_image(self): Test you can not create a node with incompatible image-location. """ # Create fake NodeImage - image = NodeImage(3234, 'dummy-image', self.driver) + image = NodeImage(3234, "dummy-image", self.driver) location = self.driver.list_locations()[0] # With this image, it should raise an Exception - self.assertRaises(LibcloudError, self.driver.create_node, image=image, - location=location) + self.assertRaises( + LibcloudError, + self.driver.create_node, + name=None, + size=None, + image=image, + location=location, + ) def test_create_node_specify_group_name(self): """ Test 'create_node' into a concrete group. """ image = self.driver.list_images()[0] - self.driver.create_node(image=image, group_name='new_group_name') + self.driver.create_node(name=None, size=None, image=image, ex_group_name="new_group_name") def test_create_group_location_does_not_exist(self): """ @@ -148,11 +157,14 @@ def test_create_group_location_does_not_exist(self): Defines a 'fake' location and tries to create a node into it. """ - location = NodeLocation(435, 'fake-location', 'Spain', self.driver) + location = NodeLocation(435, "fake-location", "Spain", self.driver) # With this location, it should raise an Exception - self.assertRaises(LibcloudError, self.driver.ex_create_group, - name='new_group_name', - location=location) + self.assertRaises( + LibcloudError, + self.driver.ex_create_group, + name="new_group_name", + location=location, + ) def test_destroy_node_response(self): """ @@ -162,8 +174,7 @@ def test_destroy_node_response(self): to be undeployed. (by default it returns an already undeployed node, for test creation). """ - self.driver = AbiquoNodeDriver('go', 'trunks', - 'http://dummy.host.com/api') + self.driver = AbiquoNodeDriver("go", "trunks", "http://dummy.host.com/api") node = self.driver.list_nodes()[0] ret = self.driver.destroy_node(node) self.assertTrue(ret) @@ -175,8 +186,7 @@ def test_destroy_node_response_failed(self): Test that the driver handles correctly when, for some reason, the 'destroy' job fails. """ - self.driver = AbiquoNodeDriver('muten', 'roshi', - 'http://dummy.host.com/api') + self.driver = AbiquoNodeDriver("muten", "roshi", "http://dummy.host.com/api") node = self.driver.list_nodes()[0] ret = self.driver.destroy_node(node) self.assertFalse(ret) @@ -187,8 +197,7 @@ def test_destroy_node_allocation_state(self): Try to destroy a node when the node is not running. """ - self.driver = AbiquoNodeDriver('ve', 'geta', - 'http://dummy.host.com/api') + self.driver = AbiquoNodeDriver("ve", "geta", "http://dummy.host.com/api") # Override the destroy to return a different node available to be # undeployed node = self.driver.list_nodes()[0] @@ -220,8 +229,7 @@ def test_destroy_deployed_group_failed(self): Test driver handles correctly when, for some reason, the asynchronous job fails. """ - self.driver = AbiquoNodeDriver('muten', 'roshi', - 'http://dummy.host.com/api') + self.driver = AbiquoNodeDriver("muten", "roshi", "http://dummy.host.com/api") location = self.driver.list_locations()[0] group = self.driver.ex_list_groups(location)[0] self.assertFalse(group.destroy()) @@ -233,8 +241,7 @@ def test_destroy_group_invalid_state(self): Test the Driver raises an exception when the group is in invalid temporal state. """ - self.driver = AbiquoNodeDriver('ve', 'geta', - 'http://dummy.host.com/api') + self.driver = AbiquoNodeDriver("ve", "geta", "http://dummy.host.com/api") location = self.driver.list_locations()[0] group = self.driver.ex_list_groups(location)[1] self.assertRaises(LibcloudError, group.destroy) @@ -246,7 +253,7 @@ def test_run_node(self): node = self.driver.list_nodes()[0] # Node is by default in NodeState.TERMINATED and AbiquoState == # 'NOT_ALLOCATED' - # so it is available to be runned + # so it is available to be ran self.driver.ex_run_node(node) def test_run_node_invalid_state(self): @@ -256,11 +263,10 @@ def test_run_node_invalid_state(self): Test the Driver raises an exception when try to run a node that is in invalid state to run. """ - self.driver = AbiquoNodeDriver('go', 'trunks', - 'http://dummy.host.com/api') + self.driver = AbiquoNodeDriver("go", "trunks", "http://dummy.host.com/api") node = self.driver.list_nodes()[0] # Node is by default in AbiquoState = 'ON' for user 'go:trunks' - # so is not available to be runned + # so is not available to be ran self.assertRaises(LibcloudError, self.driver.ex_run_node, node) def test_run_node_failed(self): @@ -270,15 +276,14 @@ def test_run_node_failed(self): Test driver handles correctly when, for some reason, the asynchronous job fails. """ - self.driver = AbiquoNodeDriver('ten', 'shin', - 'http://dummy.host.com/api') + self.driver = AbiquoNodeDriver("ten", "shin", "http://dummy.host.com/api") node = self.driver.list_nodes()[0] # Node is in the correct state, but it fails because of the # async task and it raises the error. self.assertRaises(LibcloudError, self.driver.ex_run_node, node) def test_get_href(self): - xml = ''' + xml = """ @@ -287,202 +292,216 @@ def test_get_href(self): -''' +""" elem = ET.XML(xml) - href = get_href(element=elem, rel='edit1') - self.assertEqual(href, '/admin/datacenters/2') - href = get_href(element=elem, rel='edit2') - self.assertEqual(href, '/admin/datacenters/3') - href = get_href(element=elem, rel='edit3') - self.assertEqual(href, '/admin/enterprises/1234') + href = get_href(element=elem, rel="edit1") + self.assertEqual(href, "/admin/datacenters/2") + href = get_href(element=elem, rel="edit2") + self.assertEqual(href, "/admin/datacenters/3") + href = get_href(element=elem, rel="edit3") + self.assertEqual(href, "/admin/enterprises/1234") -class AbiquoMockHttp(MockHttpTestCase): - +class AbiquoMockHttp(MockHttp): """ - Mock the functionallity of the remote Abiquo API. + Mock the functionality of the remote Abiquo API. """ - fixtures = ComputeFileFixtures('abiquo') - fixture_tag = 'default' + + fixtures = ComputeFileFixtures("abiquo") + fixture_tag = "default" def _api_login(self, method, url, body, headers): - if headers['Authorization'] == 'Basic c29uOmdvdGVu': - expected_response = self.fixtures.load('unauthorized_user.html') + if headers["Authorization"] == "Basic c29uOmdvdGVu": + expected_response = self.fixtures.load("unauthorized_user.html") expected_status = httplib.UNAUTHORIZED else: - expected_response = self.fixtures.load('login.xml') + expected_response = self.fixtures.load("login.xml") expected_status = httplib.OK - return (expected_status, expected_response, {}, '') + return (expected_status, expected_response, {}, "") def _api_cloud_virtualdatacenters(self, method, url, body, headers): - return (httplib.OK, self.fixtures.load('vdcs.xml'), {}, '') + return (httplib.OK, self.fixtures.load("vdcs.xml"), {}, "") def _api_cloud_virtualdatacenters_4(self, method, url, body, headers): - return (httplib.OK, self.fixtures.load('vdc_4.xml'), {}, '') + return (httplib.OK, self.fixtures.load("vdc_4.xml"), {}, "") def _api_cloud_virtualdatacenters_4_virtualappliances(self, method, url, body, headers): - if method == 'POST': - vapp_name = ET.XML(body).findtext('name') - if vapp_name == 'libcloud_test_group': + if method == "POST": + vapp_name = ET.XML(body).findtext("name") + if vapp_name == "libcloud_test_group": # we come from 'test_ex_create_and_delete_empty_group(self):' # method and so, we return the 'ok' return - response = self.fixtures.load('vdc_4_vapp_creation_ok.xml') - return (httplib.OK, response, {}, '') - elif vapp_name == 'new_group_name': + response = self.fixtures.load("vdc_4_vapp_creation_ok.xml") + return (httplib.OK, response, {}, "") + elif vapp_name == "new_group_name": # we come from 'test_ex_create_and_delete_empty_group(self):' # method and so, we return the 'ok' return - response = self.fixtures.load('vdc_4_vapp_creation_ok.xml') - return (httplib.OK, response, {}, '') + response = self.fixtures.load("vdc_4_vapp_creation_ok.xml") + return (httplib.OK, response, {}, "") else: # It will be a 'GET'; - return (httplib.OK, self.fixtures.load('vdc_4_vapps.xml'), {}, '') + return (httplib.OK, self.fixtures.load("vdc_4_vapps.xml"), {}, "") def _api_cloud_virtualdatacenters_4_virtualappliances_5(self, method, url, body, headers): - if method == 'GET': - if headers['Authorization'] == 'Basic dmU6Z2V0YQ==': + if method == "GET": + if headers["Authorization"] == "Basic dmU6Z2V0YQ==": # Try to destroy a group with 'needs_sync' state - response = self.fixtures.load('vdc_4_vapp_5_needs_sync.xml') + response = self.fixtures.load("vdc_4_vapp_5_needs_sync.xml") else: # Try to destroy a group with 'undeployed' state - response = self.fixtures.load('vdc_4_vapp_5.xml') - return (httplib.OK, response, {}, '') + response = self.fixtures.load("vdc_4_vapp_5.xml") + return (httplib.OK, response, {}, "") else: # it will be a 'DELETE' - return (httplib.NO_CONTENT, '', {}, '') + return (httplib.NO_CONTENT, "", {}, "") def _api_cloud_virtualdatacenters_4_virtualappliances_6(self, method, url, body, headers): - if method == 'GET': + if method == "GET": # deployed vapp - response = self.fixtures.load('vdc_4_vapp_6.xml') - return (httplib.OK, response, {}, '') + response = self.fixtures.load("vdc_4_vapp_6.xml") + return (httplib.OK, response, {}, "") else: # it will be a 'DELETE' - return (httplib.NO_CONTENT, '', {}, '') + return (httplib.NO_CONTENT, "", {}, "") - def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_tasks_1da8c8b6_86f6_49ef_9d29_57dcc73b875a(self, method, url, body, headers): - if headers['Authorization'] == 'Basic bXV0ZW46cm9zaGk=': + def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_tasks_1da8c8b6_86f6_49ef_9d29_57dcc73b875a( + self, method, url, body, headers + ): + if headers["Authorization"] == "Basic bXV0ZW46cm9zaGk=": # User 'muten:roshi' failed task - response = self.fixtures.load( - 'vdc_4_vapp_6_undeploy_task_failed.xml') + response = self.fixtures.load("vdc_4_vapp_6_undeploy_task_failed.xml") else: - response = self.fixtures.load('vdc_4_vapp_6_undeploy_task.xml') - return (httplib.OK, response, {}, '') + response = self.fixtures.load("vdc_4_vapp_6_undeploy_task.xml") + return (httplib.OK, response, {}, "") def _api_cloud_virtualdatacenters_4_virtualappliances_5_virtualmachines( - self, method, url, body, headers): + self, method, url, body, headers + ): # This virtual app never have virtual machines - if method == 'GET': - response = self.fixtures.load('vdc_4_vapp_5_vms.xml') - return (httplib.OK, response, {}, '') - elif method == 'POST': + if method == "GET": + response = self.fixtures.load("vdc_4_vapp_5_vms.xml") + return (httplib.OK, response, {}, "") + elif method == "POST": # it must be a POST - response = self.fixtures.load('vdc_4_vapp_6_vm_creation_ok.xml') - return (httplib.CREATED, response, {}, '') + response = self.fixtures.load("vdc_4_vapp_6_vm_creation_ok.xml") + return (httplib.CREATED, response, {}, "") def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines( - self, method, url, body, headers): + self, method, url, body, headers + ): # Default-created virtual app virtual machines' - if method == 'GET': - if headers['Authorization'] == 'Basic dmU6Z2V0YQ==': - response = self.fixtures.load('vdc_4_vapp_6_vms_allocated.xml') + if method == "GET": + if headers["Authorization"] == "Basic dmU6Z2V0YQ==": + response = self.fixtures.load("vdc_4_vapp_6_vms_allocated.xml") else: - response = self.fixtures.load('vdc_4_vapp_6_vms.xml') - return (httplib.OK, response, {}, '') + response = self.fixtures.load("vdc_4_vapp_6_vms.xml") + return (httplib.OK, response, {}, "") else: # it must be a POST - response = self.fixtures.load('vdc_4_vapp_6_vm_creation_ok.xml') - return (httplib.CREATED, response, {}, '') - - def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3(self, method, url, body, headers): - if (headers['Authorization'] == 'Basic Z286dHJ1bmtz' or - headers['Authorization'] == 'Basic bXV0ZW46cm9zaGk='): + response = self.fixtures.load("vdc_4_vapp_6_vm_creation_ok.xml") + return (httplib.CREATED, response, {}, "") + + def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3( + self, method, url, body, headers + ): + if ( + headers["Authorization"] == "Basic Z286dHJ1bmtz" + or headers["Authorization"] == "Basic bXV0ZW46cm9zaGk=" + ): # Undeploy node response = self.fixtures.load("vdc_4_vapp_6_vm_3_deployed.xml") - elif headers['Authorization'] == 'Basic dmU6Z2V0YQ==': + elif headers["Authorization"] == "Basic dmU6Z2V0YQ==": # Try to undeploy a node with 'allocation' state - response = self.fixtures.load('vdc_4_vapp_6_vm_3_allocated.xml') + response = self.fixtures.load("vdc_4_vapp_6_vm_3_allocated.xml") else: # Get node - response = self.fixtures.load('vdc_4_vapp_6_vm_3.xml') - return (httplib.OK, response, {}, '') - - def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_action_deploy(self, method, url, - body, headers): - response = self.fixtures.load('vdc_4_vapp_6_vm_3_deploy.xml') - return (httplib.CREATED, response, {}, '') - - def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_tasks_b44fe278_6b0f_4dfb_be81_7c03006a93cb(self, method, url, body, headers): - - if headers['Authorization'] == 'Basic dGVuOnNoaW4=': + response = self.fixtures.load("vdc_4_vapp_6_vm_3.xml") + return (httplib.OK, response, {}, "") + + def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_action_deploy( + self, method, url, body, headers + ): + response = self.fixtures.load("vdc_4_vapp_6_vm_3_deploy.xml") + return (httplib.CREATED, response, {}, "") + + def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_tasks_b44fe278_6b0f_4dfb_be81_7c03006a93cb( + self, method, url, body, headers + ): + if headers["Authorization"] == "Basic dGVuOnNoaW4=": # User 'ten:shin' failed task - response = self.fixtures.load( - 'vdc_4_vapp_6_vm_3_deploy_task_failed.xml') + response = self.fixtures.load("vdc_4_vapp_6_vm_3_deploy_task_failed.xml") else: - response = self.fixtures.load('vdc_4_vapp_6_vm_3_deploy_task.xml') - return (httplib.OK, response, {}, '') + response = self.fixtures.load("vdc_4_vapp_6_vm_3_deploy_task.xml") + return (httplib.OK, response, {}, "") def _api_cloud_virtualdatacenters_4_virtualappliances_6_action_undeploy( - self, method, url, body, headers): - response = self.fixtures.load('vdc_4_vapp_6_undeploy.xml') - return (httplib.OK, response, {}, '') - - def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_action_reset(self, method, - url, body, headers): - response = self.fixtures.load('vdc_4_vapp_6_vm_3_reset.xml') - return (httplib.CREATED, response, {}, '') - - def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_tasks_a8c9818e_f389_45b7_be2c_3db3a9689940(self, method, url, body, headers): - if headers['Authorization'] == 'Basic bXV0ZW46cm9zaGk=': + self, method, url, body, headers + ): + response = self.fixtures.load("vdc_4_vapp_6_undeploy.xml") + return (httplib.OK, response, {}, "") + + def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_action_reset( + self, method, url, body, headers + ): + response = self.fixtures.load("vdc_4_vapp_6_vm_3_reset.xml") + return (httplib.CREATED, response, {}, "") + + def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_tasks_a8c9818e_f389_45b7_be2c_3db3a9689940( + self, method, url, body, headers + ): + if headers["Authorization"] == "Basic bXV0ZW46cm9zaGk=": # User 'muten:roshi' failed task - response = self.fixtures.load( - 'vdc_4_vapp_6_undeploy_task_failed.xml') + response = self.fixtures.load("vdc_4_vapp_6_undeploy_task_failed.xml") else: - response = self.fixtures.load('vdc_4_vapp_6_vm_3_reset_task.xml') - return (httplib.OK, response, {}, '') + response = self.fixtures.load("vdc_4_vapp_6_vm_3_reset_task.xml") + return (httplib.OK, response, {}, "") - def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_action_undeploy(self, method, url, - body, headers): - response = self.fixtures.load('vdc_4_vapp_6_vm_3_undeploy.xml') - return (httplib.CREATED, response, {}, '') + def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_action_undeploy( + self, method, url, body, headers + ): + response = self.fixtures.load("vdc_4_vapp_6_vm_3_undeploy.xml") + return (httplib.CREATED, response, {}, "") - def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_network_nics(self, method, url, - body, headers): - response = self.fixtures.load('vdc_4_vapp_6_vm_3_nics.xml') - return (httplib.OK, response, {}, '') + def _api_cloud_virtualdatacenters_4_virtualappliances_6_virtualmachines_3_network_nics( + self, method, url, body, headers + ): + response = self.fixtures.load("vdc_4_vapp_6_vm_3_nics.xml") + return (httplib.OK, response, {}, "") def _api_admin_datacenters(self, method, url, body, headers): - return (httplib.OK, self.fixtures.load('dcs.xml'), {}, '') + return (httplib.OK, self.fixtures.load("dcs.xml"), {}, "") def _api_admin_enterprises_1(self, method, url, body, headers): - return (httplib.OK, self.fixtures.load('ent_1.xml'), {}, '') + return (httplib.OK, self.fixtures.load("ent_1.xml"), {}, "") def _api_admin_enterprises_1_datacenterrepositories(self, method, url, body, headers): # When the user is the common one for all the tests ('son, 'goku') # it creates this basic auth and we return the datacenters value - if headers['Authorization'] == 'Basic Z286dHJ1bmtz': + if headers["Authorization"] == "Basic Z286dHJ1bmtz": expected_response = self.fixtures.load("not_found_error.xml") - return (httplib.NOT_FOUND, expected_response, {}, '') - elif headers['Authorization'] != 'Basic c29uOmdvaGFu': - return (httplib.OK, self.fixtures.load('ent_1_dcreps.xml'), {}, '') + return (httplib.NOT_FOUND, expected_response, {}, "") + elif headers["Authorization"] != "Basic c29uOmdvaGFu": + return (httplib.OK, self.fixtures.load("ent_1_dcreps.xml"), {}, "") else: # son:gohan user: forbidden error expected_response = self.fixtures.load("privilege_errors.html") - return (httplib.FORBIDDEN, expected_response, {}, '') + return (httplib.FORBIDDEN, expected_response, {}, "") def _api_admin_enterprises_1_datacenterrepositories_2(self, method, url, body, headers): - return (httplib.OK, self.fixtures.load('ent_1_dcrep_2.xml'), {}, '') + return (httplib.OK, self.fixtures.load("ent_1_dcrep_2.xml"), {}, "") - def _api_admin_enterprises_1_datacenterrepositories_2_virtualmachinetemplates(self, method, url, body, headers): - return (httplib.OK, self.fixtures.load('ent_1_dcrep_2_templates.xml'), - {}, '') + def _api_admin_enterprises_1_datacenterrepositories_2_virtualmachinetemplates( + self, method, url, body, headers + ): + return (httplib.OK, self.fixtures.load("ent_1_dcrep_2_templates.xml"), {}, "") - def _api_admin_enterprises_1_datacenterrepositories_2_virtualmachinetemplates_11(self, method, url, body, headers): - return ( - httplib.OK, self.fixtures.load('ent_1_dcrep_2_template_11.xml'), - {}, '') + def _api_admin_enterprises_1_datacenterrepositories_2_virtualmachinetemplates_11( + self, method, url, body, headers + ): + return (httplib.OK, self.fixtures.load("ent_1_dcrep_2_template_11.xml"), {}, "") -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_auroracompute.py b/libcloud/test/compute/test_auroracompute.py index 7d0ea3a1fb..453b9fbb58 100644 --- a/libcloud/test/compute/test_auroracompute.py +++ b/libcloud/test/compute/test_auroracompute.py @@ -15,13 +15,34 @@ import sys -from libcloud.compute.drivers.auroracompute import AuroraComputeNodeDriver -from libcloud.test.compute.test_cloudstack import CloudStackCommonTestCase from libcloud.test import unittest +from libcloud.test.compute.test_cloudstack import CloudStackCommonTestCase +from libcloud.compute.drivers.auroracompute import AuroraComputeRegion, AuroraComputeNodeDriver class AuroraComputeNodeDriverTestCase(CloudStackCommonTestCase, unittest.TestCase): driver_klass = AuroraComputeNodeDriver -if __name__ == '__main__': + def test_api_host(self): + driver = self.driver_klass("invalid", "invalid") + self.assertEqual(driver.host, "api.auroracompute.eu") + + def test_without_region(self): + driver = self.driver_klass("invalid", "invalid") + self.assertEqual(driver.path, "/ams") + + def test_with_ams_region(self): + driver = self.driver_klass("invalid", "invalid", region=AuroraComputeRegion.AMS) + self.assertEqual(driver.path, "/ams") + + def test_with_miami_region(self): + driver = self.driver_klass("invalid", "invalid", region=AuroraComputeRegion.MIA) + self.assertEqual(driver.path, "/mia") + + def test_with_tokyo_region(self): + driver = self.driver_klass("invalid", "invalid", region=AuroraComputeRegion.TYO) + self.assertEqual(driver.path, "/tyo") + + +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_azure.py b/libcloud/test/compute/test_azure.py index ca293b924d..b42507c34b 100644 --- a/libcloud/test/compute/test_azure.py +++ b/libcloud/test/compute/test_azure.py @@ -17,30 +17,27 @@ import sys import libcloud.security -from libcloud.common.types import LibcloudError -from libcloud.compute.base import NodeAuthPassword, NodeImage, NodeSize -from libcloud.compute.drivers.azure import AZURE_SERVICE_MANAGEMENT_HOST - -from libcloud.test import unittest -from libcloud.test import LibcloudTestCase -from libcloud.test import MockHttp -from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.test import MockHttp, LibcloudTestCase, unittest from libcloud.utils.py3 import httplib -from libcloud.compute.base import Node, NodeState +from libcloud.common.types import LibcloudError +from libcloud.compute.base import Node, NodeSize, NodeImage, NodeState, NodeAuthPassword from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver +from libcloud.test.file_fixtures import ComputeFileFixtures class AzureNodeDriverTests(LibcloudTestCase): # required otherwise we get client side SSL verification libcloud.security.VERIFY_SSL_CERT = False - SUBSCRIPTION_ID = '3761b98b-673d-526c-8d55-fee918758e6e' - KEY_FILE = os.path.join(os.path.dirname(__file__), 'fixtures/azure/libcloud.pem') # empty file is fine + SUBSCRIPTION_ID = "3761b98b-673d-526c-8d55-fee918758e6e" + KEY_FILE = os.path.join( + os.path.dirname(__file__), "fixtures/azure/libcloud.pem" + ) # empty file is fine def setUp(self): Azure = get_driver(Provider.AZURE) - Azure.connectionCls.conn_classes = (None, AzureMockHttp) + Azure.connectionCls.conn_class = AzureMockHttp self.driver = Azure(self.SUBSCRIPTION_ID, self.KEY_FILE) def test_locations_returned_successfully(self): @@ -49,46 +46,40 @@ def test_locations_returned_successfully(self): location_names_result = list(a.name for a in locations) location_names_expected = [ - 'East Asia', - 'Southeast Asia', - 'North Europe', - 'West Europe', - 'East US', - 'North Central US', - 'West US' + "East Asia", + "Southeast Asia", + "North Europe", + "West Europe", + "East US", + "North Central US", + "West US", ] self.assertListEqual(location_names_result, location_names_expected) matched_location = next( - location for location in locations - if location.name == 'Southeast Asia' + location for location in locations if location.name == "Southeast Asia" ) services_result = matched_location.available_services - services_expected = [ - 'Compute', - 'Storage', - 'PersistentVMRole', - 'HighMemory' - ] + services_expected = ["Compute", "Storage", "PersistentVMRole", "HighMemory"] self.assertListEqual(services_result, services_expected) vm_role_sizes_result = matched_location.virtual_machine_role_sizes vm_role_sizes_expected = [ - 'A5', - 'A6', - 'A7', - 'Basic_A0', - 'Basic_A1', - 'Basic_A2', - 'Basic_A3', - 'Basic_A4', - 'ExtraLarge', - 'ExtraSmall', - 'Large', - 'Medium', - 'Small' + "A5", + "A6", + "A7", + "Basic_A0", + "Basic_A1", + "Basic_A2", + "Basic_A3", + "Basic_A4", + "ExtraLarge", + "ExtraSmall", + "Large", + "Medium", + "Small", ] self.assertListEqual(vm_role_sizes_result, vm_role_sizes_expected) @@ -102,9 +93,7 @@ def test_images_returned_successfully_filter_by_location(self): self.assertEqual(len(images), 207) def test_list_nodes_returned_successfully(self): - vmimages = self.driver.list_nodes( - ex_cloud_service_name="dcoddkinztest01" - ) + vmimages = self.driver.list_nodes(ex_cloud_service_name="dcoddkinztest01") self.assertEqual(len(vmimages), 2) img0 = vmimages[0] @@ -112,18 +101,16 @@ def test_list_nodes_returned_successfully(self): self.assertEqual(img0.name, "dc03") self.assertListEqual(img0.public_ips, ["191.235.135.62"]) self.assertListEqual(img0.private_ips, ["100.92.66.69"]) - self.assertEqual(img0.size, None) - self.assertEqual(img0.state, 0) + self.assertIsNone(img0.size) + self.assertEqual(img0.state, NodeState.RUNNING) self.assertTrue(isinstance(img0.extra, dict)) extra = img0.extra - self.assertEqual(extra["instance_size"], 'Small') - self.assertEqual(extra["power_state"], 'Started') - self.assertEqual(extra["ssh_port"], '22') + self.assertEqual(extra["instance_size"], "Small") + self.assertEqual(extra["power_state"], "Started") + self.assertEqual(extra["ssh_port"], "22") def test_list_nodes_returned_no_deployments(self): - nodes = self.driver.list_nodes( - ex_cloud_service_name="dcoddkinztest03" - ) + nodes = self.driver.list_nodes(ex_cloud_service_name="dcoddkinztest03") self.assertEqual(nodes, []) def test_list_nodes_returned_no_cloud_service(self): @@ -131,148 +118,136 @@ def test_list_nodes_returned_no_cloud_service(self): self.driver.list_nodes(ex_cloud_service_name="dcoddkinztest04") def test_restart_node_success(self): - node = Node( id="dc03", name="dc03", state=NodeState.RUNNING, public_ips=[], private_ips=[], - driver=self.driver + driver=self.driver, ) result = self.driver.reboot_node( node=node, ex_cloud_service_name="dcoddkinztest01", - ex_deployment_slot="Production" + ex_deployment_slot="Production", ) self.assertTrue(result) # simulating attempting to reboot a node that is already rebooting def test_restart_node_fail_no_deployment(self): - node = Node( id="dc03", name="dc03", state=NodeState.RUNNING, public_ips=[], private_ips=[], - driver=self.driver + driver=self.driver, ) with self.assertRaises(LibcloudError): self.driver.reboot_node( node=node, ex_cloud_service_name="dcoddkinztest02", - ex_deployment_slot="Production" + ex_deployment_slot="Production", ) def test_restart_node_fail_no_cloud_service(self): - node = Node( id="dc03", name="dc03", state=NodeState.RUNNING, public_ips=[], private_ips=[], - driver=self.driver + driver=self.driver, ) with self.assertRaises(LibcloudError): self.driver.reboot_node( node=node, ex_cloud_service_name="dcoddkinztest03", - ex_deployment_slot="Production" + ex_deployment_slot="Production", ) def test_restart_node_fail_node_not_found(self): - node = Node( id="dc13", name="dc13", state=NodeState.RUNNING, public_ips=[], private_ips=[], - driver=self.driver + driver=self.driver, ) result = self.driver.reboot_node( node=node, ex_cloud_service_name="dcoddkinztest01", - ex_deployment_slot="Production" + ex_deployment_slot="Production", ) self.assertFalse(result) def test_destroy_node_success_single_node_in_cloud_service(self): - node = Node( id="oddkinz1", name="oddkinz1", state=NodeState.RUNNING, public_ips=[], private_ips=[], - driver=self.driver + driver=self.driver, ) result = self.driver.destroy_node( - node=node, - ex_cloud_service_name="oddkinz1", - ex_deployment_slot="Production" + node=node, ex_cloud_service_name="oddkinz1", ex_deployment_slot="Production" ) self.assertTrue(result) def test_destroy_node_success_multiple_nodes_in_cloud_service(self): - node = Node( id="oddkinz1", name="oddkinz1", state=NodeState.RUNNING, public_ips=[], private_ips=[], - driver=self.driver + driver=self.driver, ) result = self.driver.destroy_node( - node=node, - ex_cloud_service_name="oddkinz2", - ex_deployment_slot="Production" + node=node, ex_cloud_service_name="oddkinz2", ex_deployment_slot="Production" ) self.assertTrue(result) def test_destroy_node_fail_node_does_not_exist(self): - node = Node( id="oddkinz2", name="oddkinz2", state=NodeState.RUNNING, public_ips=[], private_ips=[], - driver=self.driver + driver=self.driver, ) with self.assertRaises(LibcloudError): self.driver.destroy_node( node=node, ex_cloud_service_name="oddkinz2", - ex_deployment_slot="Production" + ex_deployment_slot="Production", ) def test_destroy_node_success_cloud_service_not_found(self): - node = Node( id="cloudredis", name="cloudredis", state=NodeState.RUNNING, public_ips=[], private_ips=[], - driver=self.driver + driver=self.driver, ) with self.assertRaises(LibcloudError): self.driver.destroy_node( node=node, ex_cloud_service_name="oddkinz5", - ex_deployment_slot="Production" + ex_deployment_slot="Production", ) def test_ex_create_cloud_service(self): @@ -281,10 +256,7 @@ def test_ex_create_cloud_service(self): def test_ex_create_cloud_service_service_exists(self): with self.assertRaises(LibcloudError): - self.driver.ex_create_cloud_service( - name="testdc1234", - location="North Europe" - ) + self.driver.ex_create_cloud_service(name="testdc1234", location="North Europe") def test_ex_destroy_cloud_service(self): result = self.driver.ex_destroy_cloud_service(name="testdc123") @@ -294,12 +266,28 @@ def test_ex_destroy_cloud_service_service_does_not_exist(self): with self.assertRaises(LibcloudError): self.driver.ex_destroy_cloud_service(name="testdc1234") + def test_ex_create_storage_service(self): + result = self.driver.ex_create_storage_service(name="testdss123", location="East US") + self.assertTrue(result) + + def test_ex_create_storage_service_service_exists(self): + with self.assertRaises(LibcloudError): + self.driver.ex_create_storage_service(name="dss123", location="East US") + + def test_ex_destroy_storage_service(self): + result = self.driver.ex_destroy_storage_service(name="testdss123") + self.assertTrue(result) + + def test_ex_destroy_storage_service_service_does_not_exist(self): + with self.assertRaises(LibcloudError): + self.driver.ex_destroy_storage_service(name="dss123") + def test_create_node_and_deployment_one_node(self): kwargs = { "ex_storage_service_name": "mtlytics", "ex_deployment_name": "dcoddkinztest02", "ex_deployment_slot": "Production", - "ex_admin_user_id": "azurecoder" + "ex_admin_user_id": "azurecoder", } auth = NodeAuthPassword("Pa55w0rd", False) @@ -313,21 +301,16 @@ def test_create_node_and_deployment_one_node(self): disk="30gb", bandwidth=0, price=0, - driver=self.driver + driver=self.driver, ) kwargs["image"] = NodeImage( id="5112500ae3b842c8b9c604889f8753c3__OpenLogic-CentOS-65-20140415", name="FakeImage", driver=self.driver, - extra={ - 'vm_image': False - } + extra={"vm_image": False}, ) - result = self.driver.create_node( - ex_cloud_service_name="testdcabc", - **kwargs - ) + result = self.driver.create_node(ex_cloud_service_name="testdcabc", **kwargs) self.assertIsNotNone(result) def test_create_node_and_deployment_second_node(self): @@ -335,7 +318,7 @@ def test_create_node_and_deployment_second_node(self): "ex_storage_service_name": "mtlytics", "ex_deployment_name": "dcoddkinztest02", "ex_deployment_slot": "Production", - "ex_admin_user_id": "azurecoder" + "ex_admin_user_id": "azurecoder", } auth = NodeAuthPassword("Pa55w0rd", False) @@ -348,263 +331,273 @@ def test_create_node_and_deployment_second_node(self): disk="30gb", bandwidth=0, price=0, - driver=self.driver + driver=self.driver, ) kwargs["image"] = NodeImage( id="5112500ae3b842c8b9c604889f8753c3__OpenLogic-CentOS-65-20140415", name="FakeImage", driver=self.driver, - extra={ - 'vm_image': False - } + extra={"vm_image": False}, ) kwargs["name"] = "dcoddkinztest03" - result = self.driver.create_node( - ex_cloud_service_name="testdcabc2", - **kwargs - ) + result = self.driver.create_node(ex_cloud_service_name="testdcabc2", **kwargs) self.assertIsNotNone(result) - def test_create_node_and_deployment_second_node_307_response(self): - kwargs = { - "ex_storage_service_name": "mtlytics", - "ex_deployment_name": "dcoddkinztest04", - "ex_deployment_slot": "Production", - "ex_admin_user_id": "azurecoder" - } - - auth = NodeAuthPassword("Pa55w0rd", False) - kwargs["auth"] = auth - - kwargs["size"] = NodeSize( - id="ExtraSmall", - name="ExtraSmall", - ram=1024, - disk="30gb", - bandwidth=0, - price=0, - driver=self.driver - ) - kwargs["image"] = NodeImage( - id="5112500ae3b842c8b9c604889f8753c3__OpenLogic-CentOS-65-20140415", - name="FakeImage", - driver=self.driver, - extra={ - 'vm_image': False - } - ) - kwargs["name"] = "dcoddkinztest04" - - with self.assertRaises(LibcloudError): - self.driver.create_node( - ex_cloud_service_name="testdcabc3", - **kwargs - ) - class AzureMockHttp(MockHttp): + fixtures = ComputeFileFixtures("azure") - fixtures = ComputeFileFixtures('azure') - - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz1_deploymentslots_Production(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz1_deploymentslots_Production( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz1_deploymentslots_Production.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz1_deploymentslots_Production.xml" + ) return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz1_deployments_dc01(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz1_deployments_dc01( + self, method, url, body, headers + ): return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz2_deploymentslots_Production(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz2_deploymentslots_Production( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz2_deploymentslots_Production.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz2_deploymentslots_Production.xml" + ) return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz2_deployments_dc03_roles_oddkinz1(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz2_deployments_dc03_roles_oddkinz1( + self, method, url, body, headers + ): return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz2_deployments_dc03_roles_oddkinz2(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz2_deployments_dc03_roles_oddkinz2( + self, method, url, body, headers + ): return (httplib.NOT_FOUND, body, headers, httplib.responses[httplib.NOT_FOUND]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz5_deploymentslots_Production(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz5_deploymentslots_Production( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz5_deploymentslots_Production.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz5_deploymentslots_Production.xml" + ) return (httplib.NOT_FOUND, body, headers, httplib.responses[httplib.NOT_FOUND]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deploymentslots_Production(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deploymentslots_Production( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deploymentslots_Production.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deploymentslots_Production.xml" + ) return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deployments_dc03_roleinstances_dc03(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deployments_dc03_roleinstances_dc03( + self, method, url, body, headers + ): headers["x-ms-request-id"] = "acc33f6756cda6fd96826394fce4c9f3" return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest02_deploymentslots_Production(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest02_deploymentslots_Production( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest02_deploymentslots_Production.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest02_deploymentslots_Production.xml" + ) return (httplib.NOT_FOUND, body, headers, httplib.responses[httplib.NOT_FOUND]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest03_deploymentslots_Production(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest03_deploymentslots_Production( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest03_deploymentslots_Production.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest03_deploymentslots_Production.xml" + ) return (httplib.NOT_FOUND, body, headers, httplib.responses[httplib.NOT_FOUND]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deployments_dc03_roleinstances_dc13(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deployments_dc03_roleinstances_dc13( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deployments_dc03_roleinstances_dc13.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deployments_dc03_roleinstances_dc13.xml" + ) return (httplib.NOT_FOUND, body, headers, httplib.responses[httplib.NOT_FOUND]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01.xml" + ) return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest03(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest03( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest03.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest03.xml" + ) return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest04(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest04( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest04.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest04.xml" + ) return (httplib.NOT_FOUND, body, headers, httplib.responses[httplib.NOT_FOUND]) def _3761b98b_673d_526c_8d55_fee918758e6e_services_images(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_images.xml') + body = self.fixtures.load("_3761b98b_673d_526c_8d55_fee918758e6e_services_images.xml") return (httplib.OK, body, headers, httplib.responses[httplib.OK]) def _3761b98b_673d_526c_8d55_fee918758e6e_services_vmimages(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_vmimages.xml') + body = self.fixtures.load("_3761b98b_673d_526c_8d55_fee918758e6e_services_vmimages.xml") return (httplib.OK, body, headers, httplib.responses[httplib.OK]) def _3761b98b_673d_526c_8d55_fee918758e6e_locations(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_locations.xml') + body = self.fixtures.load("_3761b98b_673d_526c_8d55_fee918758e6e_locations.xml") return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices( + self, method, url, body, headers + ): # request url is the same irrespective of serviceName, only way to differentiate if "testdc123" in body: return (httplib.CREATED, body, headers, httplib.responses[httplib.CREATED]) elif "testdc1234" in body: - return (httplib.CONFLICT, body, headers, httplib.responses[httplib.CONFLICT]) - - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdc123(self, method, url, body, headers): - return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdc1234(self, method, url, body, headers): - if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdc1234.xml') - - return (httplib.NOT_FOUND, body, headers, httplib.responses[httplib.NOT_FOUND]) - - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc(self, method, url, body, headers): - if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc.xml') + return ( + httplib.CONFLICT, + body, + headers, + httplib.responses[httplib.CONFLICT], + ) + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdc123( + self, method, url, body, headers + ): return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc_deployments(self, method, url, body, headers): - headers["x-ms-request-id"] = "acc33f6756cda6fd96826394fce4c9f3" - if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc_deployments.xml') - - return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) - - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2(self, method, url, body, headers): - if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2.xml') + def _3761b98b_673d_526c_8d55_fee918758e6e_services_storageservices( + self, method, url, body, headers + ): + # request url is the same irrespective of serviceName, only way to differentiate + if "testdss123" in body: + return ( + httplib.ACCEPTED, + body, + headers, + httplib.responses[httplib.ACCEPTED], + ) + elif "dss123" in body: + return ( + httplib.CONFLICT, + body, + headers, + httplib.responses[httplib.CONFLICT], + ) + def _3761b98b_673d_526c_8d55_fee918758e6e_services_storageservices_testdss123( + self, method, url, body, headers + ): return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deploymentslots_Production(self, method, url, body, headers): - + def _3761b98b_673d_526c_8d55_fee918758e6e_services_storageservices_dss123( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deploymentslots_Production.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_storageservices_dss123.xml" + ) - return (httplib.OK, body, headers, httplib.responses[httplib.OK]) + return (httplib.NOT_FOUND, body, headers, httplib.responses[httplib.NOT_FOUND]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deployments(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdc1234( + self, method, url, body, headers + ): + return (httplib.NOT_FOUND, body, headers, httplib.responses[httplib.NOT_FOUND]) + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deployments.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc.xml" + ) return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc_deployments_dcoddkinztest02_roles(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc_deployments( + self, method, url, body, headers + ): headers["x-ms-request-id"] = "acc33f6756cda6fd96826394fce4c9f3" - return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deployments_dcoddkinztest02_roles(self, method, url, body, headers): - headers["x-ms-request-id"] = "acc33f6756cda6fd96826394fce4c9f3" return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc3(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2.xml" + ) return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc_deploymentslots_Production(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deploymentslots_Production( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deploymentslots_Production.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deploymentslots_Production.xml" + ) return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc3_deploymentslots_Production(self, method, url, body, headers): - if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deploymentslots_Production.xml') - - return (httplib.OK, body, headers, httplib.responses[httplib.OK]) + def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deployments_dcoddkinztest02_roles( + self, method, url, body, headers + ): + headers["x-ms-request-id"] = "acc33f6756cda6fd96826394fce4c9f3" + return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc3_deployments(self, method, url, body, headers): + def _3761b98b_673d_526c_8d55_fee918758e6e_operations_acc33f6756cda6fd96826394fce4c9f3( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deployments.xml') + body = self.fixtures.load( + "_3761b98b_673d_526c_8d55_fee918758e6e_operations_acc33f6756cda6fd96826394fce4c9f3.xml" + ) return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc3_deployments_dcoddkinztest02_roles(self, method, url, body, headers): - redirect_host = "ussouth.management.core.windows.net" - - if not getattr(AzureMockHttp, "in_redirect", False): - setattr(AzureMockHttp, "in_redirect", True) - headers["Location"] = url.replace(AZURE_SERVICE_MANAGEMENT_HOST, redirect_host) - return (httplib.TEMPORARY_REDIRECT, None, headers, httplib.responses[httplib.TEMPORARY_REDIRECT]) - else: - delattr(AzureMockHttp, "in_redirect") - if redirect_host not in url: - if AZURE_SERVICE_MANAGEMENT_HOST in url: - return (httplib.TEMPORARY_REDIRECT, None, headers, httplib.responses[httplib.TEMPORARY_REDIRECT]) - else: - return (httplib.REQUEST_TIMEOUT, None, None, httplib.responses[httplib.REQUEST_TIMEOUT]) - - if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2.xml') - - return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - - def _3761b98b_673d_526c_8d55_fee918758e6e_operations_acc33f6756cda6fd96826394fce4c9f3(self, method, url, body, headers): - - if method == "GET": - body = self.fixtures.load('_3761b98b_673d_526c_8d55_fee918758e6e_operations_acc33f6756cda6fd96826394fce4c9f3.xml') - - return (httplib.OK, body, headers, httplib.responses[httplib.OK]) -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_azure_arm.py b/libcloud/test/compute/test_azure_arm.py new file mode 100644 index 0000000000..143ef1a2ca --- /dev/null +++ b/libcloud/test/compute/test_azure_arm.py @@ -0,0 +1,983 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License.import libcloud + +import sys +import json +import base64 +import functools +from datetime import datetime +from unittest import mock + +from libcloud.test import MockHttp, LibcloudTestCase, unittest +from libcloud.utils.py3 import httplib, parse_qs, urlparse, urlunquote +from libcloud.common.types import LibcloudError +from libcloud.compute.base import NodeSize, NodeLocation, StorageVolume, VolumeSnapshot +from libcloud.compute.types import Provider, NodeState, StorageVolumeState, VolumeSnapshotState +from libcloud.utils.iso8601 import UTC +from libcloud.common.exceptions import BaseHTTPError +from libcloud.compute.providers import get_driver +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.azure_arm import ( + AzureImage, + NodeAuthPassword, + AzureComputeGalleryImage, +) + + +class AzureNodeDriverTests(LibcloudTestCase): + TENANT_ID = "77777777-7777-7777-7777-777777777777" + SUBSCRIPTION_ID = "99999999" + APPLICATION_ID = "55555555-5555-5555-5555-555555555555" + APPLICATION_PASS = "p4ssw0rd" + + def setUp(self): + AzureMockHttp.type = None + Azure = get_driver(Provider.AZURE_ARM) + Azure.connectionCls.conn_class = AzureMockHttp + self.driver = Azure( + self.TENANT_ID, + self.SUBSCRIPTION_ID, + self.APPLICATION_ID, + self.APPLICATION_PASS, + ) + + def tearDown(self): + AzureMockHttp.responses = [] + + def test_get_image(self): + # Default storage suffix + image = self.driver.get_image(image_id="http://www.example.com/foo/image_name") + self.assertEqual(image.id, "https://www.blob.core.windows.net/foo/image_name") + self.assertEqual(image.name, "image_name") + + # Custom storage suffix + self.driver.connection.storage_suffix = ".core.chinacloudapi.cn" + image = self.driver.get_image(image_id="http://www.example.com/foo/image_name") + self.assertEqual(image.id, "https://www.blob.core.chinacloudapi.cn/foo/image_name") + self.assertEqual(image.name, "image_name") + + def test_locations_returned_successfully(self): + locations = self.driver.list_locations() + self.assertEqual( + [loc.name for loc in locations], + [ + "East US", + "East US 2", + "West US", + "Central US", + "South Central US", + "North Europe", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West", + ], + ) + + def test_sizes_returned_successfully(self): + location = self.driver.list_locations()[0] + sizes = self.driver.list_sizes(location=location) + self.assertEqual( + [size.name for size in sizes], ["Standard_A0", "Standard_A1", "Standard_A2"] + ) + + def test_ex_get_ratecard(self): + ratecard = self.driver.ex_get_ratecard("0026P") + self.assertEqual( + set(ratecard.keys()), + {"Currency", "Locale", "IsTaxIncluded", "OfferTerms", "Meters"}, + ) + + def test_create_node(self): + location = NodeLocation("any_location", "", "", self.driver) + size = NodeSize("any_size", "", 0, 0, 0, 0, driver=self.driver) + image = AzureImage("1", "1", "ubuntu", "pub", location.id, self.driver) + auth = NodeAuthPassword("any_password") + + node = self.driver.create_node( + "test-node-1", + size, + image, + location=location, + auth=auth, + ex_resource_group="000000", + ex_storage_account="000000", + ex_user_name="any_user", + ex_network="000000", + ex_subnet="000000", + ex_use_managed_disks=True, + ) + hardware_profile = node.extra["properties"]["hardwareProfile"] + os_profile = node.extra["properties"]["osProfile"] + storage_profile = node.extra["properties"]["storageProfile"] + + self.assertEqual(node.name, "test-node-1") + self.assertEqual(node.state, NodeState.UPDATING) + self.assertEqual(node.private_ips, ["10.0.0.1"]) + self.assertEqual(node.public_ips, []) + self.assertEqual(node.extra["location"], location.id) + self.assertEqual(hardware_profile["vmSize"], size.id) + self.assertEqual(os_profile["adminUsername"], "any_user") + self.assertEqual(os_profile["adminPassword"], "any_password") + self.assertTrue("managedDisk" in storage_profile["osDisk"]) + self.assertTrue("diskSizeGB" not in storage_profile["osDisk"]) + self.assertTrue("deleteOption" not in storage_profile["osDisk"]) + self.assertTrue( + storage_profile["imageReference"], + { + "publisher": image.publisher, + "offer": image.offer, + "sku": image.sku, + "version": image.version, + }, + ) + + def test_create_node_storage_account_not_provided_and_not_ex_use_managed_disks( + self, + ): + location = NodeLocation("any_location", "", "", self.driver) + size = NodeSize("any_size", "", 0, 0, 0, 0, driver=self.driver) + image = AzureImage("1", "1", "ubuntu", "pub", location.id, self.driver) + auth = NodeAuthPassword("any_password") + + # ex_storage_account=None and ex_use_managed_disks=False should throw + expected_msg = "ex_use_managed_disks is False, must provide ex_storage_account" + self.assertRaisesRegex( + ValueError, + expected_msg, + self.driver.create_node, + "test-node-1", + size, + image, + location=location, + auth=auth, + ex_resource_group="000000", + ex_storage_account=None, + ex_user_name="any_user", + ex_network="000000", + ex_subnet="000000", + ex_use_managed_disks=False, + ) + + # ex_storage_account=None and ex_use_managed_disks=True, should not throw + node = self.driver.create_node( + "test-node-1", + size, + image, + location=location, + auth=auth, + ex_resource_group="000000", + ex_storage_account=None, + ex_user_name="any_user", + ex_network="000000", + ex_subnet="000000", + ex_use_managed_disks=True, + ) + self.assertTrue(node) + + def test_create_node_ex_disk_size(self): + location = NodeLocation("any_location", "", "", self.driver) + size = NodeSize("any_size", "", 0, 0, 0, 0, driver=self.driver) + image = AzureImage("1", "1", "ubuntu", "pub", location.id, self.driver) + auth = NodeAuthPassword("any_password") + + node = self.driver.create_node( + "test-node-1", + size, + image, + location=location, + auth=auth, + ex_resource_group="000000", + ex_storage_account="000000", + ex_user_name="any_user", + ex_network="000000", + ex_subnet="000000", + ex_disk_size=100, + ex_use_managed_disks=True, + ) + hardware_profile = node.extra["properties"]["hardwareProfile"] + os_profile = node.extra["properties"]["osProfile"] + storage_profile = node.extra["properties"]["storageProfile"] + + self.assertEqual(node.name, "test-node-1") + self.assertEqual(node.state, NodeState.UPDATING) + self.assertEqual(node.private_ips, ["10.0.0.1"]) + self.assertEqual(node.public_ips, []) + self.assertEqual(node.extra["location"], location.id) + self.assertEqual(hardware_profile["vmSize"], size.id) + self.assertEqual(os_profile["adminUsername"], "any_user") + self.assertEqual(os_profile["adminPassword"], "any_password") + self.assertTrue("managedDisk" in storage_profile["osDisk"]) + self.assertEqual(storage_profile["osDisk"]["diskSizeGB"], 100) + self.assertTrue("deleteOption" not in storage_profile["osDisk"]) + self.assertTrue( + storage_profile["imageReference"], + { + "publisher": image.publisher, + "offer": image.offer, + "sku": image.sku, + "version": image.version, + }, + ) + + def test_create_node_ex_customdata(self): + location = NodeLocation("any_location", "", "", self.driver) + size = NodeSize("any_size", "", 0, 0, 0, 0, driver=self.driver) + image = AzureImage("1", "1", "ubuntu", "pub", location.id, self.driver) + auth = NodeAuthPassword("any_password") + + customdata = "#!/bin/bash\necho hello" + expected = base64.b64encode(customdata.encode("utf-8")).decode("utf-8") + + # ex_customdata provided as a str + node = self.driver.create_node( + "test-node-1", + size, + image, + location=location, + auth=auth, + ex_resource_group="000000", + ex_storage_account="000000", + ex_user_name="any_user", + ex_network="000000", + ex_subnet="000000", + ex_use_managed_disks=True, + ex_customdata=customdata, + ) + os_profile = node.extra["properties"]["osProfile"] + self.assertEqual(os_profile["customData"], expected) + # customData must be a JSON-serializable str, not bytes + self.assertIsInstance(os_profile["customData"], str) + json.dumps(node.extra["properties"]) + + # ex_customdata provided as bytes (regression for GH #1893) + node = self.driver.create_node( + "test-node-1", + size, + image, + location=location, + auth=auth, + ex_resource_group="000000", + ex_storage_account="000000", + ex_user_name="any_user", + ex_network="000000", + ex_subnet="000000", + ex_use_managed_disks=True, + ex_customdata=customdata.encode("utf-8"), + ) + os_profile = node.extra["properties"]["osProfile"] + self.assertEqual(os_profile["customData"], expected) + self.assertIsInstance(os_profile["customData"], str) + json.dumps(node.extra["properties"]) + + def test_create_node_ex_os_disk_delete(self): + location = NodeLocation("any_location", "", "", self.driver) + size = NodeSize("any_size", "", 0, 0, 0, 0, driver=self.driver) + image = AzureImage("1", "1", "ubuntu", "pub", location.id, self.driver) + auth = NodeAuthPassword("any_password") + + node = self.driver.create_node( + "test-node-1", + size, + image, + location=location, + auth=auth, + ex_resource_group="000000", + ex_storage_account="000000", + ex_user_name="any_user", + ex_network="000000", + ex_subnet="000000", + ex_use_managed_disks=True, + ex_os_disk_delete=True, + ) + hardware_profile = node.extra["properties"]["hardwareProfile"] + os_profile = node.extra["properties"]["osProfile"] + storage_profile = node.extra["properties"]["storageProfile"] + + self.assertEqual(node.name, "test-node-1") + self.assertEqual(node.state, NodeState.UPDATING) + self.assertEqual(node.private_ips, ["10.0.0.1"]) + self.assertEqual(node.public_ips, []) + self.assertEqual(node.extra["location"], location.id) + self.assertEqual(hardware_profile["vmSize"], size.id) + self.assertEqual(os_profile["adminUsername"], "any_user") + self.assertEqual(os_profile["adminPassword"], "any_password") + self.assertTrue("managedDisk" in storage_profile["osDisk"]) + self.assertTrue("diskSizeGB" not in storage_profile["osDisk"]) + self.assertEqual(storage_profile["osDisk"]["deleteOption"], "Delete") + self.assertTrue( + storage_profile["imageReference"], + { + "publisher": image.publisher, + "offer": image.offer, + "sku": image.sku, + "version": image.version, + }, + ) + + def test_create_node_compute_gallery_image(self): + location = NodeLocation("any_location", "", "", self.driver) + size = NodeSize("any_size", "", 0, 0, 0, 0, driver=self.driver) + image = AzureComputeGalleryImage( + "sub-id00", "resource-group00", "gallery00", "image00", self.driver + ) + auth = NodeAuthPassword("any_password") + + node = self.driver.create_node( + "test-node-1", + size, + image, + location=location, + auth=auth, + ex_resource_group="000000", + ex_storage_account="000000", + ex_user_name="any_user", + ex_network="000000", + ex_subnet="000000", + ex_use_managed_disks=True, + ) + hardware_profile = node.extra["properties"]["hardwareProfile"] + os_profile = node.extra["properties"]["osProfile"] + storage_profile = node.extra["properties"]["storageProfile"] + + self.assertEqual(node.name, "test-node-1") + self.assertEqual(node.state, NodeState.UPDATING) + self.assertEqual(node.private_ips, ["10.0.0.1"]) + self.assertEqual(node.public_ips, []) + self.assertEqual(node.extra["location"], location.id) + self.assertEqual(hardware_profile["vmSize"], size.id) + self.assertEqual(os_profile["adminUsername"], "any_user") + self.assertEqual(os_profile["adminPassword"], "any_password") + self.assertTrue("managedDisk" in storage_profile["osDisk"]) + self.assertTrue("diskSizeGB" not in storage_profile["osDisk"]) + self.assertTrue("deleteOption" not in storage_profile["osDisk"]) + self.assertTrue( + storage_profile["imageReference"], + { + "id": "/subscriptions/sub-id00/resourceGroups/resource-group00/providers/Microsoft.Compute/galleries/gallery00/images/image00" + }, + ) + + @mock.patch("time.sleep", return_value=None) + def test_destroy_node(self, time_sleep_mock): + def error(e, **kwargs): + raise e(**kwargs) + + node = self.driver.list_nodes()[0] + AzureMockHttp.responses = [ + # OK to the DELETE request + lambda f: (httplib.OK, None, {}, "OK"), + # 404 means node is gone + lambda f: error(BaseHTTPError, code=404, message="Not found"), + ] + ret = self.driver.destroy_node(node) + self.assertTrue(ret) + + def test_destroy_node__node_not_found(self): + """ + This simulates the case when destroy_node is being called for the 2nd + time because some related resource failed to clean up, so the DELETE + operation on the node will return 204 (because it was already deleted) + but the method should return success. + """ + + def error(e, **kwargs): + raise e(**kwargs) + + node = self.driver.list_nodes()[0] + AzureMockHttp.responses = [ + # 204 (No content) to the DELETE request on a deleted/non-existent node + lambda f: error(BaseHTTPError, code=204, message="No content"), + ] + ret = self.driver.destroy_node(node) + self.assertTrue(ret) + + @mock.patch("time.sleep", return_value=None) + def test_destroy_node__retry(self, time_sleep_mock): + def error(e, **kwargs): + raise e(**kwargs) + + node = self.driver.list_nodes()[0] + AzureMockHttp.responses = [ + # 202 - The delete will happen asynchronously + lambda f: error(BaseHTTPError, code=202, message="Deleting"), + # 200 means the node is still here - Try 1 + lambda f: (httplib.OK, None, {}, "OK"), + # 200 means the node is still here - Try 2 + lambda f: (httplib.OK, None, {}, "OK"), + # 200 means the node is still here - Try 3 + lambda f: (httplib.OK, None, {}, "OK"), + # 404 means node is gone - 4th retry: success! + lambda f: error(BaseHTTPError, code=404, message="Not found"), + ] + ret = self.driver.destroy_node(node) + self.assertTrue(ret) + self.assertEqual(4, time_sleep_mock.call_count) # Retries + + @mock.patch("time.sleep", return_value=None) + def test_destroy_node__os_managed_disk(self, time_sleep_mock): + def error(e, **kwargs): + raise e(**kwargs) + + node = self.driver.list_nodes()[0] + + # ok responses + for response in (200, 202, 204): + AzureMockHttp.responses = [ + # OK to the DELETE request + lambda f: (httplib.OK, None, {}, "OK"), + # 404 - Node destroyed + lambda f: error(BaseHTTPError, code=404, message="Not found"), + # 200 - NIC destroyed + lambda f: (httplib.OK, None, {}, "OK"), + # 200 - managed OS disk destroyed + lambda f: ( + (httplib.OK, None, {}, "OK") + if response == 200 + else error(BaseHTTPError, code=response, message="Deleted or deferred") + ), + ] + ret = self.driver.destroy_node(node, ex_destroy_os_disk=True) + self.assertTrue(ret) + + @mock.patch("time.sleep", return_value=None) + def test_destroy_node__os_managed_disk_error(self, time_sleep_mock): + def error(e, **kwargs): + raise e(**kwargs) + + node = self.driver.list_nodes()[0] + AzureMockHttp.responses = [ + # OK to the DELETE request + lambda f: (httplib.OK, None, {}, "OK"), + # 404 - Node destroyed + lambda f: error(BaseHTTPError, code=404, message="Not found"), + # 200 - NIC destroyed + lambda f: (httplib.OK, None, {}, "OK"), + # 500 - transient error when trying to destroy the OS disk + lambda f: error(BaseHTTPError, code=500, message="Cloud weather"), + ] + with self.assertRaises(BaseHTTPError): + self.driver.destroy_node(node, ex_destroy_os_disk=True) + + @mock.patch("time.sleep", return_value=None) + def test_destroy_node__destroy_nic_retries(self, time_sleep_mock): + def error(e, **kwargs): + raise e(**kwargs) + + node = self.driver.list_nodes()[0] + err = BaseHTTPError(code=400, message="[NicInUse] Cannot destroy") + with mock.patch.object(self.driver, "ex_destroy_nic") as m: + m.side_effect = [err] * 5 + [True] # 5 errors before a success + ret = self.driver.destroy_node(node) + self.assertTrue(ret) + self.assertEqual(6, m.call_count) # 6th call was a success + + m.side_effect = [err] * 10 + [True] # 10 errors before a success + with self.assertRaises(BaseHTTPError): + self.driver.destroy_node(node) + self.assertEqual(10, m.call_count) # try 10 times & fail + + @mock.patch("time.sleep", return_value=None) + def test_destroy_node__async(self, time_sleep_mock): + def error(e, **kwargs): + raise e(**kwargs) + + node = self.driver.list_nodes()[0] + AzureMockHttp.responses = [ + # 202 - The delete will happen asynchronously + lambda f: error(BaseHTTPError, code=202, message="Deleting"), + # 404 means node is gone + lambda f: error(BaseHTTPError, code=404, message="Not found"), + ] + ret = self.driver.destroy_node(node) + self.assertTrue(ret) + + @mock.patch("time.sleep", return_value=None) + def test_destroy_node__nic_not_cleaned_up(self, time_sleep_mock): + def error(e, **kwargs): + raise e(**kwargs) + + node = self.driver.list_nodes()[0] + AzureMockHttp.responses = [ + # OK to the DELETE request + lambda f: (httplib.OK, None, {}, "OK"), + # 404 means node is gone + lambda f: error(BaseHTTPError, code=404, message="Not found"), + # 500 - transient error when trying to clean up the NIC + lambda f: error(BaseHTTPError, code=500, message="Cloud weather"), + ] + with self.assertRaises(BaseHTTPError): + self.driver.destroy_node(node) + + def test_destroy_node__failed(self): + def error(e, **kwargs): + raise e(**kwargs) + + node = self.driver.list_nodes()[0] + AzureMockHttp.responses = [ + # 403 - There was some problem with your request + lambda f: error(BaseHTTPError, code=403, message="Forbidden"), + ] + with self.assertRaises(BaseHTTPError): + self.driver.destroy_node(node) + + @mock.patch( + "libcloud.compute.drivers.azure_arm.AzureNodeDriver" "._fetch_power_state", + return_value=NodeState.UPDATING, + ) + def test_list_nodes(self, fps_mock): + nodes = self.driver.list_nodes() + + self.assertEqual(len(nodes), 2) + + self.assertEqual(nodes[0].name, "test-node-1") + self.assertEqual(nodes[0].state, NodeState.UPDATING) + self.assertEqual(nodes[0].private_ips, ["10.0.0.1"]) + self.assertEqual(nodes[0].public_ips, []) + + self.assertEqual(nodes[1].name, "test-node-2") + self.assertEqual(nodes[1].state, NodeState.UPDATING) + self.assertEqual(nodes[1].private_ips, ["10.0.0.2"]) + self.assertEqual(nodes[1].public_ips, []) + + fps_mock.assert_called() + + @mock.patch( + "libcloud.compute.drivers.azure_arm.AzureNodeDriver._fetch_power_state", + return_value=NodeState.UPDATING, + ) + @mock.patch("libcloud.compute.drivers.azure_arm.LIST_NODES_PAGINATION_TIMEOUT", 1) + def test_list_nodes_pagination_timeout_reached(self, fps_mock): + # Verify we don't end up in an infinite loop in case server returns a bad response or + # similar + AzureMockHttp.type = "PAGINATION_INFINITE_LOOP" + nodes = self.driver.list_nodes() + self.assertTrue(len(nodes) >= 1) + + @mock.patch( + "libcloud.compute.drivers.azure_arm.AzureNodeDriver" "._fetch_power_state", + return_value=NodeState.UPDATING, + ) + def test_list_nodes__no_fetch_power_state(self, fps_mock): + nodes = self.driver.list_nodes(ex_fetch_power_state=False) + + self.assertEqual(len(nodes), 2) + + self.assertEqual(nodes[0].name, "test-node-1") + self.assertNotEqual(nodes[0].state, NodeState.UPDATING) + self.assertEqual(nodes[0].private_ips, ["10.0.0.1"]) + self.assertEqual(nodes[0].public_ips, []) + + self.assertEqual(nodes[1].name, "test-node-2") + self.assertNotEqual(nodes[1].state, NodeState.UPDATING) + self.assertEqual(nodes[1].private_ips, ["10.0.0.2"]) + self.assertEqual(nodes[1].public_ips, []) + + fps_mock.assert_not_called() + + def test_create_volume(self): + location = self.driver.list_locations()[-1] + volume = self.driver.create_volume( + 2, + "test-disk-1", + location, + ex_resource_group="000000", + ex_tags={"description": "MyVolume"}, + ex_zones=["1", "2", "3"], + ex_iops=12345, + ex_throughput=6789, + ) + + self.assertEqual(volume.size, 2) + self.assertEqual(volume.name, "test-disk-1") + self.assertEqual(volume.extra["name"], "test-disk-1") + self.assertEqual(volume.extra["tags"], {"description": "MyVolume"}) + self.assertEqual(volume.extra["location"], location.id) + self.assertEqual(volume.extra["sku"], {"name": "Standard_LRS", "tier": "Standard"}) + self.assertEqual(volume.extra["properties"]["creationData"]["createOption"], "Empty") + self.assertEqual(volume.extra["properties"]["provisioningState"], "Succeeded") + self.assertEqual(volume.extra["properties"]["diskState"], "Attached") + self.assertEqual(volume.state, StorageVolumeState.INUSE) + self.assertEqual(volume.extra["zones"], ["1", "2", "3"]) + self.assertEqual(volume.extra["properties"]["diskIopsReadWrite"], 12345) + self.assertEqual(volume.extra["properties"]["diskMBpsReadWrite"], 6789) + + def test_create_volume__with_snapshot(self): + location = self.driver.list_locations()[0] + snap_id = ( + "/subscriptions/99999999-9999-9999-9999-999999999999" + "/resourceGroups/000000/providers/Microsoft.Compute" + "/snapshots/test-snap-1" + ) + snapshot = VolumeSnapshot(id=snap_id, size=2, driver=self.driver) + + volume = self.driver.create_volume( + 2, + "test-disk-1", + location, + snapshot=snapshot, + ex_resource_group="000000", + ex_tags={"description": "MyVolume"}, + ) + + self.assertEqual(volume.extra["properties"]["creationData"]["createOption"], "Copy") + self.assertEqual(volume.extra["properties"]["creationData"]["sourceUri"], snap_id) + + def test_create_volume__required_kw(self): + location = self.driver.list_locations()[0] + fn = functools.partial(self.driver.create_volume, 2, "test-disk-1") + + self.assertRaises(ValueError, fn) + self.assertRaises(ValueError, fn, location=location) + self.assertRaises(ValueError, fn, ex_resource_group="000000") + + ret_value = fn(ex_resource_group="000000", location=location) + self.assertTrue(isinstance(ret_value, StorageVolume)) + + def test_list_volumes(self): + volumes = self.driver.list_volumes() + + self.assertEqual(len(volumes), 4) + + self.assertEqual(volumes[0].name, "test-disk-1") + self.assertEqual(volumes[0].size, 31) + self.assertEqual(volumes[0].extra["properties"]["provisioningState"], "Succeeded") + self.assertEqual(volumes[0].extra["properties"]["diskState"], "Attached") + self.assertEqual(volumes[0].state, StorageVolumeState.INUSE) + + self.assertEqual(volumes[1].name, "test-disk-2") + self.assertEqual(volumes[1].size, 31) + self.assertEqual(volumes[1].extra["properties"]["provisioningState"], "Updating") + self.assertEqual(volumes[1].extra["properties"]["diskState"], "Unattached") + self.assertEqual(volumes[1].state, StorageVolumeState.UPDATING) + + self.assertEqual(volumes[2].name, "test-disk-3") + self.assertEqual(volumes[2].size, 10) + self.assertEqual(volumes[2].extra["properties"]["provisioningState"], "Succeeded") + self.assertEqual(volumes[2].extra["properties"]["diskState"], "Unattached") + self.assertEqual(StorageVolumeState.AVAILABLE, volumes[2].state) + + self.assertEqual(volumes[3].name, "test-disk-4") + self.assertEqual(volumes[3].size, 1500) + self.assertEqual(volumes[3].extra["properties"]["provisioningState"], "Succeeded") + self.assertEqual(volumes[3].extra["properties"]["diskState"], "Attached") + self.assertEqual(StorageVolumeState.INUSE, volumes[3].state) + + def test_list_volumes__with_resource_group(self): + volumes = self.driver.list_volumes(ex_resource_group="111111") + + self.assertEqual(len(volumes), 1) + + self.assertEqual(volumes[0].name, "test-disk-3") + self.assertEqual(volumes[0].size, 10) + self.assertEqual(volumes[0].extra["properties"]["provisioningState"], "Succeeded") + self.assertEqual(volumes[0].extra["properties"]["diskState"], "Unattached") + self.assertEqual(volumes[0].state, StorageVolumeState.AVAILABLE) + + @mock.patch("libcloud.compute.drivers.azure_arm.LIST_VOLUMES_PAGINATION_TIMEOUT", 1) + def test_list_volumes_pagination_timeout(self): + # Verify we don't end up in an infinite loop in case server returns a bad response or + # similar + AzureMockHttp.type = "PAGINATION_INFINITE_LOOP" + volumes = self.driver.list_volumes() + self.assertTrue(len(volumes) >= 1) + + def test_attach_volume(self): + volumes = self.driver.list_volumes() + node = self.driver.list_nodes()[0] + + self.driver.attach_volume(node, volumes[0], ex_lun=0) + self.driver.attach_volume(node, volumes[1], ex_lun=15) + self.driver.attach_volume(node, volumes[2]) + + data_disks = node.extra["properties"]["storageProfile"]["dataDisks"] + luns = [disk["lun"] for disk in data_disks] + self.assertTrue(len(data_disks), len(volumes)) + self.assertTrue(set(luns), {0, 1, 15}) + + volumes = self.driver.list_volumes() + node = self.driver.list_nodes()[0] + for count in range(64): + self.driver.attach_volume(node, volumes[0]) + data_disks = node.extra["properties"]["storageProfile"]["dataDisks"] + luns = [disk["lun"] for disk in data_disks] + self.assertTrue(len(data_disks), 64) + self.assertTrue(set(luns), set(range(64))) + + def test_resize_volume(self): + volume = self.driver.list_volumes()[0] + original_size = volume.size + + volume = self.driver.ex_resize_volume(volume, volume.size + 8, "000000") + new_size = volume.size + + self.assertEqual(new_size, original_size + 8) + + def test_resize_node(self): + location = self.driver.list_locations()[0] + size = self.driver.list_sizes(location=location)[0] + node = self.driver.list_nodes()[0] + + value = self.driver.ex_resize_node(node, size) + + self.assertEqual(value["size"], size.id) + + def test_detach_volume(self): + volumes = self.driver.list_volumes() + node = self.driver.list_nodes()[0] + + for volume in volumes: + self.driver.attach_volume(node, volume) + + data_disks = node.extra["properties"]["storageProfile"]["dataDisks"] + self.assertEqual(len(data_disks), len(volumes)) + + for volume in volumes: + self.driver.detach_volume(volume, ex_node=node) + + data_disks = node.extra["properties"]["storageProfile"]["dataDisks"] + self.assertEqual(len(data_disks), 0) + + def test_destroy_volume(self): + volume = self.driver.list_volumes()[0] + ret_value = self.driver.destroy_volume(volume) + self.assertTrue(ret_value) + + def test_create_volume_snapshot(self): + location = self.driver.list_locations()[-1] + volume = self.driver.list_volumes()[0] + + snap = self.driver.create_volume_snapshot( + volume, "test-snap-1", location=location, ex_resource_group="000000" + ) + self.assertEqual(snap.name, "test-snap-1") + self.assertEqual(snap.extra["name"], "test-snap-1") + self.assertEqual(snap.size, 1) + self.assertEqual(snap.extra["source_id"], volume.id) + self.assertEqual(snap.state, VolumeSnapshotState.CREATING) + self.assertEqual(snap.extra["location"], location.id) + self.assertEqual(snap.extra["properties"]["provisioningState"], "Creating") + self.assertEqual(snap.extra["properties"]["diskState"], "Unattached") + # 2017-03-09T14:28:27.8655868+00:00" + self.assertEqual(datetime(2017, 3, 9, 14, 28, 27, 865586, tzinfo=UTC), snap.created) + + def test_create_volume_snapshot__required_kw(self): + location = self.driver.list_locations()[0] + volume = self.driver.list_volumes()[0] + + fn = functools.partial(self.driver.create_volume_snapshot, volume) + + self.assertRaises(ValueError, fn) + self.assertRaises(ValueError, fn, name="test-snap-1") + self.assertRaises(ValueError, fn, location=location) + self.assertRaises(ValueError, fn, ex_resource_group="000000") + + ret_value = fn(name="test-snap-1", ex_resource_group="000000", location=location) + self.assertTrue(isinstance(ret_value, VolumeSnapshot)) + + def test_list_snapshots(self): + snaps = self.driver.list_snapshots() + self.assertEqual(len(snaps), 4) + + self.assertEqual(snaps[0].name, "test-snap-1") + self.assertEqual(snaps[0].extra["name"], "test-snap-1") + self.assertEqual(snaps[0].state, VolumeSnapshotState.CREATING) + self.assertEqual( + snaps[0].extra["source_id"], + "/subscriptions/99999999-9999-9999-9999-999999999999" + "/resourceGroups/000000/providers/Microsoft.Compute" + "/disks/test-disk-1", + ) + self.assertEqual(snaps[0].size, 1) + self.assertEqual(snaps[0].extra["tags"]["test_snap"], "test") + self.assertTrue(isinstance(snaps[3].created, datetime)) + + self.assertEqual(snaps[3].name, "test-snap-4") + self.assertEqual(snaps[3].extra["name"], "test-snap-4") + self.assertEqual(snaps[3].state, VolumeSnapshotState.ERROR) + self.assertEqual( + snaps[3].extra["source_id"], + "/subscriptions/99999999-9999-9999-9999-999999999999" + "/resourceGroups/111111/providers/Microsoft.Compute" + "/disks/test-disk-4", + ) + self.assertEqual(snaps[3].size, 2) + self.assertTrue(isinstance(snaps[3].created, datetime)) + + def test_list_snapshots_in_resource_group(self): + snaps = self.driver.list_snapshots(ex_resource_group="111111") + self.assertEqual(len(snaps), 2) + + self.assertEqual(snaps[0].name, "test-snap-3") + self.assertEqual(snaps[0].extra["name"], "test-snap-3") + self.assertEqual(snaps[0].state, VolumeSnapshotState.ERROR) + self.assertEqual( + snaps[0].extra["source_id"], + "/subscriptions/99999999-9999-9999-9999-999999999999" + "/resourceGroups/111111/providers/Microsoft.Compute" + "/disks/test-disk-3", + ) + self.assertEqual(snaps[0].size, 2) + self.assertTrue(isinstance(snaps[0].created, datetime)) + + def test_list_volume_snapshots(self): + volume = self.driver.list_volumes()[0] + self.assertTrue(volume.name == "test-disk-1") + + snapshots = self.driver.list_volume_snapshots(volume) + self.assertEqual(len(snapshots), 1) + self.assertEqual(snapshots[0].name, "test-snap-1") + self.assertEqual(volume.id, snapshots[0].extra["source_id"]) + + def test_destroy_volume_snapshot(self): + snapshot = self.driver.list_snapshots()[0] + res_value = snapshot.destroy() + self.assertTrue(res_value) + + def test_delete_public_ip(self): + location = self.driver.list_locations()[0] + public_ip = self.driver.ex_create_public_ip( + name="test_public_ip", resource_group="REVIZOR", location=location + ) + res_value = self.driver.ex_delete_public_ip(public_ip) + self.assertTrue(res_value) + + def test_update_network_profile(self): + nics = self.driver.ex_list_nics() + node = self.driver.list_nodes()[0] + network_profile = node.extra["properties"]["networkProfile"] + primary_nic_exists = False + num_nics_before = len(network_profile["networkInterfaces"]) + + for nic in network_profile["networkInterfaces"]: + if "properties" in nic and nic["properties"]["primary"]: + primary_nic_exists = True + if not primary_nic_exists: + network_profile["networkInterfaces"][0]["properties"] = {"primary": True} + network_profile["networkInterfaces"].append({"id": nics[0].id}) + self.driver.ex_update_network_profile_of_node(node, network_profile) + + network_profile = node.extra["properties"]["networkProfile"] + num_nics_after = len(network_profile["networkInterfaces"]) + + self.assertEqual(num_nics_after, num_nics_before + 1) + + def test_update_nic_properties(self): + nics = self.driver.ex_list_nics() + nic_to_update = nics[0] + nic_properties = nic_to_update.extra + ip_configs = nic_properties["ipConfigurations"] + ip_configs[0]["properties"]["primary"] = True + updated_nic = self.driver.ex_update_nic_properties( + nic_to_update, resource_group="REVIZOR", properties=nic_properties + ) + self.assertTrue(updated_nic.extra["ipConfigurations"][0]["properties"]["primary"]) + + def test_check_ip_address_availability(self): + networks = self.driver.ex_list_networks() + result = self.driver.ex_check_ip_address_availability("REVIZOR", networks[0], "0.0.0.0") + self.assertFalse(result["available"]) + + def test_get_instance_vhd(self): + with mock.patch.object(self.driver, "_ex_delete_old_vhd"): + # Default storage suffix + vhd_url = self.driver._get_instance_vhd( + name="test1", ex_resource_group="000000", ex_storage_account="sga1" + ) + self.assertEqual(vhd_url, "https://sga1.blob.core.windows.net/vhds/test1-os_0.vhd") + + # Custom storage suffix + self.driver.connection.storage_suffix = ".core.chinacloudapi.cn" + vhd_url = self.driver._get_instance_vhd( + name="test1", ex_resource_group="000000", ex_storage_account="sga1" + ) + self.assertEqual(vhd_url, "https://sga1.blob.core.chinacloudapi.cn/vhds/test1-os_0.vhd") + + def test_get_instance_vhd__retries_ten_times(self): + with mock.patch.object(self.driver, "_ex_delete_old_vhd") as m: + # 10 retries are OK + m.side_effect = [False] * 9 + [True] + vhd_url = self.driver._get_instance_vhd( + name="test1", ex_resource_group="000000", ex_storage_account="sga1" + ) + self.assertEqual(vhd_url, "https://sga1.blob.core.windows.net/vhds/test1-os_9.vhd") + # Fail on the 11th + m.side_effect = [False] * 10 + [True] + with self.assertRaises(LibcloudError): + self.driver._get_instance_vhd( + name="test1", ex_resource_group="000000", ex_storage_account="sga1" + ) + + def test_ex_create_additional_capabilities(self): + add_cap = { + "ultraSSDEnabled": True, + "hibernationEnabled": True, + } + + node = self.driver.list_nodes()[0] + self.driver.ex_create_additional_capabilities(node, add_cap, "000000") + self.assertTrue(node.extra["properties"]["additionalCapabilities"]["ultraSSDEnabled"]) + self.assertTrue(node.extra["properties"]["additionalCapabilities"]["hibernationEnabled"]) + + +class AzureMockHttp(MockHttp): + fixtures = ComputeFileFixtures("azure_arm") + # List of callables to be run in order as responses. Fixture + # passed as argument. + responses = [] + + def _update(self, fixture, body): + for key, value in body.items(): + if isinstance(value, dict): + fixture[key] = self._update(fixture.get(key, {}), value) + else: + fixture[key] = body[key] + return fixture + + def __getattr__(self, n): + def fn(method, url, body, headers): + # Note: We use shorter fixture name so we don't exceed 143 + # character limit for file names + file_name = n.replace( + "99999999_9999_9999_9999_999999999999", + AzureNodeDriverTests.SUBSCRIPTION_ID, + ) + unquoted_url = urlunquote(url) + if "$skiptoken=" in unquoted_url and self.type != "PAGINATION_INFINITE_LOOP": + parsed_url = urlparse.urlparse(unquoted_url) + params = parse_qs(parsed_url.query) + file_name += "_" + params["$skiptoken"][0].split("!")[0] + fixture = self.fixtures.load(file_name + ".json") + + if method in ("POST", "PUT"): + try: + body = json.loads(body) + fixture_tmp = json.loads(fixture) + fixture_tmp = self._update(fixture_tmp, body) + fixture = json.dumps(fixture_tmp) + except ValueError: + pass + if (not n.endswith("_oauth2_token")) and len(self.responses) > 0: + f = self.responses.pop(0) + return f(fixture) + else: + return (httplib.OK, fixture, headers, httplib.responses[httplib.OK]) + + return fn + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_base.py b/libcloud/test/compute/test_base.py index 5173cf9cb1..75d08e9203 100644 --- a/libcloud/test/compute/test_base.py +++ b/libcloud/test/compute/test_base.py @@ -15,104 +15,107 @@ import sys import unittest -from libcloud.common.base import Response from libcloud.common.base import Connection, ConnectionKey, ConnectionUserAndKey from libcloud.common.types import LibcloudError -from libcloud.compute.base import Node, NodeSize, NodeImage, NodeDriver, StorageVolume -from libcloud.compute.base import NodeAuthSSHKey, NodeAuthPassword +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeDriver, + StorageVolume, + NodeAuthSSHKey, + NodeAuthPassword, +) from libcloud.compute.types import StorageVolumeState -from libcloud.test import MockResponse # pylint: disable-msg=E0611 - -class FakeDriver(object): +class FakeDriver: type = 0 class BaseTests(unittest.TestCase): - def test_base_node(self): - Node(id=0, name=0, state=0, public_ips=0, private_ips=0, - driver=FakeDriver()) + Node(id=0, name=0, state=0, public_ips=0, private_ips=0, driver=FakeDriver()) def test_base_node_size(self): - NodeSize(id=0, name=0, ram=0, disk=0, bandwidth=0, price=0, - driver=FakeDriver()) + NodeSize(id=0, name=0, ram=0, disk=0, bandwidth=0, price=0, driver=FakeDriver()) def test_base_node_image(self): NodeImage(id=0, name=0, driver=FakeDriver()) def test_base_storage_volume(self): - StorageVolume(id="0", name="0", size=10, driver=FakeDriver(), state=StorageVolumeState.AVAILABLE) - - def test_base_response(self): - Response(MockResponse(status=200, body='foo'), ConnectionKey('foo')) + StorageVolume( + id="0", + name="0", + size=10, + driver=FakeDriver(), + state=StorageVolumeState.AVAILABLE, + ) def test_base_node_driver(self): - NodeDriver('foo') + NodeDriver("foo") def test_base_connection_key(self): - ConnectionKey('foo') + ConnectionKey("foo") def test_base_connection_userkey(self): - ConnectionUserAndKey('foo', 'bar') + ConnectionUserAndKey("foo", "bar") def test_base_connection_timeout(self): Connection(timeout=10) class TestValidateAuth(unittest.TestCase): - def test_get_auth_ssh(self): - n = NodeDriver('foo') - n.features = {'create_node': ['ssh_key']} - auth = NodeAuthSSHKey('pubkey...') + n = NodeDriver("foo") + n.features = {"create_node": ["ssh_key"]} + auth = NodeAuthSSHKey("pubkey...") self.assertEqual(auth, n._get_and_check_auth(auth)) def test_get_auth_ssh_but_given_password(self): - n = NodeDriver('foo') - n.features = {'create_node': ['ssh_key']} - auth = NodeAuthPassword('password') + n = NodeDriver("foo") + n.features = {"create_node": ["ssh_key"]} + auth = NodeAuthPassword("password") self.assertRaises(LibcloudError, n._get_and_check_auth, auth) def test_get_auth_password(self): - n = NodeDriver('foo') - n.features = {'create_node': ['password']} - auth = NodeAuthPassword('password') + n = NodeDriver("foo") + n.features = {"create_node": ["password"]} + auth = NodeAuthPassword("password") self.assertEqual(auth, n._get_and_check_auth(auth)) def test_get_auth_password_but_given_ssh_key(self): - n = NodeDriver('foo') - n.features = {'create_node': ['password']} - auth = NodeAuthSSHKey('publickey') + n = NodeDriver("foo") + n.features = {"create_node": ["password"]} + auth = NodeAuthSSHKey("publickey") self.assertRaises(LibcloudError, n._get_and_check_auth, auth) def test_get_auth_default_ssh_key(self): - n = NodeDriver('foo') - n.features = {'create_node': ['ssh_key']} + n = NodeDriver("foo") + n.features = {"create_node": ["ssh_key"]} self.assertEqual(None, n._get_and_check_auth(None)) def test_get_auth_default_password(self): - n = NodeDriver('foo') - n.features = {'create_node': ['password']} + n = NodeDriver("foo") + n.features = {"create_node": ["password"]} auth = n._get_and_check_auth(None) self.assertTrue(isinstance(auth, NodeAuthPassword)) def test_get_auth_default_no_feature(self): - n = NodeDriver('foo') + n = NodeDriver("foo") self.assertEqual(None, n._get_and_check_auth(None)) def test_get_auth_generates_password_but_given_nonsense(self): - n = NodeDriver('foo') - n.features = {'create_node': ['generates_password']} + n = NodeDriver("foo") + n.features = {"create_node": ["generates_password"]} auth = "nonsense" self.assertRaises(LibcloudError, n._get_and_check_auth, auth) def test_get_auth_no_features_but_given_nonsense(self): - n = NodeDriver('foo') + n = NodeDriver("foo") auth = "nonsense" self.assertRaises(LibcloudError, n._get_and_check_auth, auth) -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_bluebox.py b/libcloud/test/compute/test_bluebox.py deleted file mode 100644 index bcee0a3161..0000000000 --- a/libcloud/test/compute/test_bluebox.py +++ /dev/null @@ -1,117 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import sys -import unittest -from libcloud.utils.py3 import httplib - -from libcloud.compute.drivers.bluebox import BlueboxNodeDriver as Bluebox -from libcloud.compute.base import Node, NodeAuthPassword -from libcloud.compute.types import NodeState - - -from libcloud.test import MockHttp -from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.test.secrets import BLUEBOX_PARAMS - - -class BlueboxTest(unittest.TestCase): - - def setUp(self): - Bluebox.connectionCls.conn_classes = (None, BlueboxMockHttp) - self.driver = Bluebox(*BLUEBOX_PARAMS) - - def test_create_node(self): - node = self.driver.create_node( - name='foo', - size=self.driver.list_sizes()[0], - image=self.driver.list_images()[0], - auth=NodeAuthPassword("test123") - ) - self.assertTrue(isinstance(node, Node)) - self.assertEqual(node.state, NodeState.PENDING) - self.assertEqual(node.name, 'foo.apitest.blueboxgrid.com') - - def test_list_nodes(self): - node = self.driver.list_nodes()[0] - self.assertEqual(node.name, 'foo.apitest.blueboxgrid.com') - self.assertEqual(node.state, NodeState.RUNNING) - - def test_list_sizes(self): - sizes = self.driver.list_sizes() - self.assertEqual(len(sizes), 4) - - ids = [s.id for s in sizes] - - for size in sizes: - self.assertTrue(size.price > 0) - - self.assertTrue('94fd37a7-2606-47f7-84d5-9000deda52ae' in ids) - self.assertTrue('b412f354-5056-4bf0-a42f-6ddd998aa092' in ids) - self.assertTrue('0cd183d3-0287-4b1a-8288-b3ea8302ed58' in ids) - self.assertTrue('b9b87a5b-2885-4a2e-b434-44a163ca6251' in ids) - - def test_list_images(self): - images = self.driver.list_images() - image = images[0] - self.assertEqual(len(images), 10) - self.assertEqual(image.name, 'CentOS 5 (Latest Release)') - self.assertEqual(image.id, 'c66b8145-f768-45ef-9878-395bf8b1b7ff') - - def test_reboot_node(self): - node = self.driver.list_nodes()[0] - ret = self.driver.reboot_node(node) - self.assertTrue(ret) - - def test_destroy_node(self): - node = self.driver.list_nodes()[0] - ret = self.driver.destroy_node(node) - self.assertTrue(ret) - - -class BlueboxMockHttp(MockHttp): - - fixtures = ComputeFileFixtures('bluebox') - - def _api_blocks_json(self, method, url, body, headers): - if method == "POST": - body = self.fixtures.load('api_blocks_json_post.json') - else: - body = self.fixtures.load('api_blocks_json.json') - return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - - def _api_block_products_json(self, method, url, body, headers): - body = self.fixtures.load('api_block_products_json.json') - return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - - def _api_block_templates_json(self, method, url, body, headers): - body = self.fixtures.load('api_block_templates_json.json') - return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - - def _api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_json(self, method, url, body, headers): - if method == 'DELETE': - body = self.fixtures.load( - 'api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_json_delete.json') - else: - body = self.fixtures.load( - 'api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_json.json') - return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - - def _api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_reboot_json(self, method, url, body, headers): - body = self.fixtures.load( - 'api_blocks_99df878c_6e5c_4945_a635_d94da9fd3146_reboot_json.json') - return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_brightbox.py b/libcloud/test/compute/test_brightbox.py index 651c34977a..1a7d9536c7 100644 --- a/libcloud/test/compute/test_brightbox.py +++ b/libcloud/test/compute/test_brightbox.py @@ -13,51 +13,48 @@ # See the License for the specific language governing permissions and # limitations under the License. import sys -import unittest import base64 +import unittest + +from libcloud.test import MockHttp +from libcloud.utils.py3 import b, httplib +from libcloud.common.types import InvalidCredsError +from libcloud.test.compute import TestCaseMixin +from libcloud.test.secrets import BRIGHTBOX_PARAMS +from libcloud.compute.types import NodeState +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.brightbox import BrightboxNodeDriver try: import simplejson as json except ImportError: import json -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import b - -from libcloud.common.types import InvalidCredsError -from libcloud.compute.drivers.brightbox import BrightboxNodeDriver -from libcloud.compute.types import NodeState - -from libcloud.test import MockHttp -from libcloud.test.compute import TestCaseMixin -from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.test.secrets import BRIGHTBOX_PARAMS -USER_DATA = '#!/bin/sh\ntest_script.sh\n' +USER_DATA = "#!/bin/sh\ntest_script.sh\n" class BrightboxTest(unittest.TestCase, TestCaseMixin): - def setUp(self): - BrightboxNodeDriver.connectionCls.conn_classes = ( - None, BrightboxMockHttp) + BrightboxNodeDriver.connectionCls.conn_class = BrightboxMockHttp BrightboxMockHttp.type = None + BrightboxNodeDriver.connectionCls.token = "test" self.driver = BrightboxNodeDriver(*BRIGHTBOX_PARAMS) def test_authentication(self): - BrightboxMockHttp.type = 'INVALID_CLIENT' + BrightboxMockHttp.type = "INVALID_CLIENT" self.assertRaises(InvalidCredsError, self.driver.list_nodes) - BrightboxMockHttp.type = 'UNAUTHORIZED_CLIENT' + BrightboxMockHttp.type = "UNAUTHORIZED_CLIENT" self.assertRaises(InvalidCredsError, self.driver.list_nodes) def test_invalid_api_version(self): - kwargs = {'api_version': '2.0'} + kwargs = {"api_version": "2.0"} self.driver = BrightboxNodeDriver(*BRIGHTBOX_PARAMS, **kwargs) self.assertRaises(Exception, self.driver.list_locations) def test_other_host(self): - kwargs = {'host': 'api.gbt.brightbox.com'} + kwargs = {"host": "api.gbt.brightbox.com"} self.driver = BrightboxNodeDriver(*BRIGHTBOX_PARAMS, **kwargs) locations = self.driver.list_locations() self.assertEqual(len(locations), 0) @@ -69,11 +66,10 @@ def test_list_nodes(self): self.assertEqual(len(nodes[1].public_ips), 1) self.assertEqual(len(nodes[0].private_ips), 1) self.assertEqual(len(nodes[1].private_ips), 1) - self.assertTrue('109.107.35.16' in nodes[0].public_ips) - self.assertTrue('10.74.210.210' in nodes[0].private_ips) - self.assertTrue('10.240.228.234' in nodes[1].private_ips) - self.assertTrue( - '2a02:1348:14c:393a:24:19ff:fef0:e4ea' in nodes[1].public_ips) + self.assertTrue("109.107.35.16" in nodes[0].public_ips) + self.assertTrue("10.74.210.210" in nodes[0].private_ips) + self.assertTrue("10.240.228.234" in nodes[1].private_ips) + self.assertTrue("2a02:1348:14c:393a:24:19ff:fef0:e4ea" in nodes[1].public_ips) self.assertEqual(nodes[0].state, NodeState.RUNNING) self.assertEqual(nodes[1].state, NodeState.RUNNING) @@ -83,29 +79,29 @@ def test_list_node_extras(self): self.assertFalse(nodes[1].size is None) self.assertFalse(nodes[0].image is None) self.assertFalse(nodes[1].image is None) - self.assertEqual(nodes[0].image.id, 'img-arm8f') - self.assertEqual(nodes[0].size.id, 'typ-urtky') - self.assertEqual(nodes[1].image.id, 'img-j93gd') - self.assertEqual(nodes[1].size.id, 'typ-qdiwq') - self.assertEqual(nodes[0].extra['fqdn'], 'srv-xvpn7.gb1.brightbox.com') - self.assertEqual(nodes[1].extra['fqdn'], 'srv-742vn.gb1.brightbox.com') - self.assertEqual(nodes[0].extra['hostname'], 'srv-xvpn7') - self.assertEqual(nodes[1].extra['hostname'], 'srv-742vn') - self.assertEqual(nodes[0].extra['status'], 'active') - self.assertEqual(nodes[1].extra['status'], 'active') - self.assertTrue('interfaces' in nodes[0].extra) - self.assertTrue('zone' in nodes[0].extra) - self.assertTrue('snapshots' in nodes[0].extra) - self.assertTrue('server_groups' in nodes[0].extra) - self.assertTrue('started_at' in nodes[0].extra) - self.assertTrue('created_at' in nodes[0].extra) - self.assertFalse('deleted_at' in nodes[0].extra) + self.assertEqual(nodes[0].image.id, "img-arm8f") + self.assertEqual(nodes[0].size.id, "typ-urtky") + self.assertEqual(nodes[1].image.id, "img-j93gd") + self.assertEqual(nodes[1].size.id, "typ-qdiwq") + self.assertEqual(nodes[0].extra["fqdn"], "srv-xvpn7.gb1.brightbox.com") + self.assertEqual(nodes[1].extra["fqdn"], "srv-742vn.gb1.brightbox.com") + self.assertEqual(nodes[0].extra["hostname"], "srv-xvpn7") + self.assertEqual(nodes[1].extra["hostname"], "srv-742vn") + self.assertEqual(nodes[0].extra["status"], "active") + self.assertEqual(nodes[1].extra["status"], "active") + self.assertTrue("interfaces" in nodes[0].extra) + self.assertTrue("zone" in nodes[0].extra) + self.assertTrue("snapshots" in nodes[0].extra) + self.assertTrue("server_groups" in nodes[0].extra) + self.assertTrue("started_at" in nodes[0].extra) + self.assertTrue("created_at" in nodes[0].extra) + self.assertFalse("deleted_at" in nodes[0].extra) def test_list_sizes(self): sizes = self.driver.list_sizes() self.assertEqual(len(sizes), 7) - self.assertEqual(sizes[0].id, 'typ-4nssg') - self.assertEqual(sizes[0].name, 'Brightbox Nano Instance') + self.assertEqual(sizes[0].id, "typ-4nssg") + self.assertEqual(sizes[0].name, "Brightbox Nano Instance") self.assertEqual(sizes[0].ram, 512) self.assertEqual(sizes[0].disk, 20480) self.assertEqual(sizes[0].bandwidth, 0) @@ -114,37 +110,37 @@ def test_list_sizes(self): def test_list_images(self): images = self.driver.list_images() self.assertEqual(len(images), 3) - self.assertEqual(images[0].id, 'img-99q79') - self.assertEqual(images[0].name, 'CentOS 5.5 server') - self.assertTrue('ancestor' in images[0].extra) - self.assertFalse('licence_name' in images[0].extra) + self.assertEqual(images[0].id, "img-99q79") + self.assertEqual(images[0].name, "CentOS 5.5 server") + self.assertTrue("ancestor" in images[0].extra) + self.assertFalse("licence_name" in images[0].extra) def test_list_images_extras(self): images = self.driver.list_images() extra = images[-1].extra - self.assertEqual(extra['arch'], 'i686') - self.assertFalse(extra['compatibility_mode']) - self.assertEqual(extra['created_at'], '2012-01-22T05:36:24Z') - self.assertTrue('description' in extra) - self.assertEqual(extra['disk_size'], 671) - self.assertFalse('min_ram' in extra) - self.assertFalse(extra['official']) - self.assertEqual(extra['owner'], 'acc-tqs4c') - self.assertTrue(extra['public']) - self.assertEqual(extra['source'], 'oneiric-i386-20178.gz') - self.assertEqual(extra['source_type'], 'upload') - self.assertEqual(extra['status'], 'deprecated') - self.assertEqual(extra['username'], 'ubuntu') - self.assertEqual(extra['virtual_size'], 1025) - self.assertFalse('ancestor' in extra) - self.assertFalse('licence_name' in extra) + self.assertEqual(extra["arch"], "i686") + self.assertFalse(extra["compatibility_mode"]) + self.assertEqual(extra["created_at"], "2012-01-22T05:36:24Z") + self.assertTrue("description" in extra) + self.assertEqual(extra["disk_size"], 671) + self.assertFalse("min_ram" in extra) + self.assertFalse(extra["official"]) + self.assertEqual(extra["owner"], "acc-tqs4c") + self.assertTrue(extra["public"]) + self.assertEqual(extra["source"], "oneiric-i386-20178.gz") + self.assertEqual(extra["source_type"], "upload") + self.assertEqual(extra["status"], "deprecated") + self.assertEqual(extra["username"], "ubuntu") + self.assertEqual(extra["virtual_size"], 1025) + self.assertFalse("ancestor" in extra) + self.assertFalse("licence_name" in extra) def test_list_locations(self): locations = self.driver.list_locations() - self.assertEqual(locations[0].id, 'zon-6mxqw') - self.assertEqual(locations[0].name, 'gb1-a') - self.assertEqual(locations[1].id, 'zon-remk1') - self.assertEqual(locations[1].name, 'gb1-b') + self.assertEqual(locations[0].id, "zon-6mxqw") + self.assertEqual(locations[0].name, "gb1-a") + self.assertEqual(locations[1].id, "zon-remk1") + self.assertEqual(locations[1].name, "gb1-b") def test_reboot_node_response(self): node = self.driver.list_nodes()[0] @@ -157,193 +153,207 @@ def test_destroy_node(self): def test_create_node(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] - node = self.driver.create_node( - name='Test Node', image=image, size=size) - self.assertEqual('srv-p61uj', node.id) - self.assertEqual('Test Node', node.name) - self.assertEqual('gb1-a', node.extra['zone'].name) + node = self.driver.create_node(name="Test Node", image=image, size=size) + self.assertEqual("srv-p61uj", node.id) + self.assertEqual("Test Node", node.name) + self.assertEqual("gb1-a", node.extra["zone"].name) def test_create_node_in_location(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] location = self.driver.list_locations()[1] - node = self.driver.create_node( - name='Test Node', image=image, size=size, location=location) - self.assertEqual('srv-nnumd', node.id) - self.assertEqual('Test Node', node.name) - self.assertEqual('gb1-b', node.extra['zone'].name) + node = self.driver.create_node(name="Test Node", image=image, size=size, location=location) + self.assertEqual("srv-nnumd", node.id) + self.assertEqual("Test Node", node.name) + self.assertEqual("gb1-b", node.extra["zone"].name) def test_create_node_with_user_data(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] node = self.driver.create_node( - name='Test Node', image=image, size=size, ex_userdata=USER_DATA) - decoded = base64.b64decode(b(node.extra['user_data'])).decode('ascii') - self.assertEqual('gb1-a', node.extra['zone'].name) + name="Test Node", image=image, size=size, ex_userdata=USER_DATA + ) + decoded = base64.b64decode(b(node.extra["user_data"])).decode("ascii") + self.assertEqual("gb1-a", node.extra["zone"].name) self.assertEqual(USER_DATA, decoded) def test_create_node_with_a_server_group(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] node = self.driver.create_node( - name='Test Node', image=image, size=size, ex_servergroup='grp-12345') - self.assertEqual('gb1-a', node.extra['zone'].name) - self.assertEqual(len(node.extra['server_groups']), 1) - self.assertEqual(node.extra['server_groups'][0]['id'], 'grp-12345') + name="Test Node", image=image, size=size, ex_servergroup="grp-12345" + ) + self.assertEqual("gb1-a", node.extra["zone"].name) + self.assertEqual(len(node.extra["server_groups"]), 1) + self.assertEqual(node.extra["server_groups"][0]["id"], "grp-12345") def test_create_node_with_a_list_of_server_groups(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] node = self.driver.create_node( - name='Test Node', image=image, size=size, ex_servergroup=['grp-12345', 'grp-67890']) - self.assertEqual('gb1-a', node.extra['zone'].name) - self.assertEqual(len(node.extra['server_groups']), 2) - self.assertEqual(node.extra['server_groups'][0]['id'], 'grp-12345') - self.assertEqual(node.extra['server_groups'][1]['id'], 'grp-67890') + name="Test Node", + image=image, + size=size, + ex_servergroup=["grp-12345", "grp-67890"], + ) + self.assertEqual("gb1-a", node.extra["zone"].name) + self.assertEqual(len(node.extra["server_groups"]), 2) + self.assertEqual(node.extra["server_groups"][0]["id"], "grp-12345") + self.assertEqual(node.extra["server_groups"][1]["id"], "grp-67890") def test_list_cloud_ips(self): cip_list = self.driver.ex_list_cloud_ips() self.assertEqual(len(cip_list), 4) - self.assertEqual(cip_list[2]['status'], 'mapped') + self.assertEqual(cip_list[2]["status"], "mapped") cip_check = cip_list[0] - self.assertEqual(cip_check['id'], 'cip-tlrp3') - self.assertEqual(cip_check['public_ip'], '109.107.35.16') - self.assertEqual( - cip_check['reverse_dns'], 'cip-109-107-35-16.gb1.brightbox.com') - self.assertEqual(cip_check['status'], 'unmapped') - self.assertTrue(cip_check['server'] is None) - self.assertTrue(cip_check['server_group'] is None) - self.assertTrue(cip_check['interface'] is None) - self.assertTrue(cip_check['load_balancer'] is None) + self.assertEqual(cip_check["id"], "cip-tlrp3") + self.assertEqual(cip_check["public_ip"], "109.107.35.16") + self.assertEqual(cip_check["reverse_dns"], "cip-109-107-35-16.gb1.brightbox.com") + self.assertEqual(cip_check["status"], "unmapped") + self.assertTrue(cip_check["server"] is None) + self.assertTrue(cip_check["server_group"] is None) + self.assertTrue(cip_check["interface"] is None) + self.assertTrue(cip_check["load_balancer"] is None) def test_create_cloud_ip(self): cip = self.driver.ex_create_cloud_ip() - self.assertEqual(cip['id'], 'cip-jsjc5') - self.assertEqual( - cip['reverse_dns'], 'cip-109-107-37-234.gb1.brightbox.com') + self.assertEqual(cip["id"], "cip-jsjc5") + self.assertEqual(cip["reverse_dns"], "cip-109-107-37-234.gb1.brightbox.com") def test_create_cloud_ip_with_dns(self): - cip = self.driver.ex_create_cloud_ip('fred.co.uk') - self.assertEqual(cip['id'], 'cip-jsjc5') - self.assertEqual(cip['reverse_dns'], 'fred.co.uk') + cip = self.driver.ex_create_cloud_ip("fred.co.uk") + self.assertEqual(cip["id"], "cip-jsjc5") + self.assertEqual(cip["reverse_dns"], "fred.co.uk") def test_map_cloud_ip(self): - self.assertTrue(self.driver.ex_map_cloud_ip('cip-jsjc5', 'int-ztqbx')) + self.assertTrue(self.driver.ex_map_cloud_ip("cip-jsjc5", "int-ztqbx")) def test_unmap_cloud_ip(self): - self.assertTrue(self.driver.ex_unmap_cloud_ip('cip-jsjc5')) + self.assertTrue(self.driver.ex_unmap_cloud_ip("cip-jsjc5")) def test_update_cloud_ip(self): - self.assertTrue( - self.driver.ex_update_cloud_ip('cip-jsjc5', 'fred.co.uk')) + self.assertTrue(self.driver.ex_update_cloud_ip("cip-jsjc5", "fred.co.uk")) def test_destroy_cloud_ip(self): - self.assertTrue(self.driver.ex_destroy_cloud_ip('cip-jsjc5')) + self.assertTrue(self.driver.ex_destroy_cloud_ip("cip-jsjc5")) class BrightboxMockHttp(MockHttp): - fixtures = ComputeFileFixtures('brightbox') + fixtures = ComputeFileFixtures("brightbox") def _token(self, method, url, body, headers): - if method == 'POST': - return self.response(httplib.OK, self.fixtures.load('token.json')) + if method == "POST": + return self.test_response(httplib.OK, self.fixtures.load("token.json")) def _token_INVALID_CLIENT(self, method, url, body, headers): - if method == 'POST': - return self.response(httplib.BAD_REQUEST, '{"error":"invalid_client"}') + if method == "POST": + return self.test_response(httplib.BAD_REQUEST, '{"error":"invalid_client"}') def _token_UNAUTHORIZED_CLIENT(self, method, url, body, headers): - if method == 'POST': - return self.response(httplib.UNAUTHORIZED, '{"error":"unauthorized_client"}') + if method == "POST": + return self.test_response(httplib.UNAUTHORIZED, '{"error":"unauthorized_client"}') + + def _1_0_servers_INVALID_CLIENT(self, method, url, body, headers): + return self.test_response(httplib.BAD_REQUEST, '{"error":"invalid_client"}') + + def _1_0_servers_UNAUTHORIZED_CLIENT(self, method, url, body, headers): + return self.test_response(httplib.UNAUTHORIZED, '{"error":"unauthorized_client"}') def _1_0_images(self, method, url, body, headers): - if method == 'GET': - return self.response(httplib.OK, self.fixtures.load('list_images.json')) + if method == "GET": + return self.test_response(httplib.OK, self.fixtures.load("list_images.json")) def _1_0_servers(self, method, url, body, headers): - if method == 'GET': - return self.response(httplib.OK, self.fixtures.load('list_servers.json')) - elif method == 'POST': + if method == "GET": + return self.test_response(httplib.OK, self.fixtures.load("list_servers.json")) + elif method == "POST": body = json.loads(body) - encoded = base64.b64encode(b(USER_DATA)).decode('ascii') - - if 'user_data' in body and body['user_data'] != encoded: - data = '{"error_name":"dodgy user data", "errors": ["User data not encoded properly"]}' - return self.response(httplib.BAD_REQUEST, data) - if body.get('zone', '') == 'zon-remk1': - node = json.loads( - self.fixtures.load('create_server_gb1_b.json')) + encoded = base64.b64encode(b(USER_DATA)).decode("ascii") + + if "user_data" in body and body["user_data"] != encoded: + data = ( + '{"error_name":"dodgy user data", "errors": ["User data not encoded properly"]}' + ) + return self.test_response(httplib.BAD_REQUEST, data) + if body.get("zone", "") == "zon-remk1": + node = json.loads(self.fixtures.load("create_server_gb1_b.json")) else: - node = json.loads( - self.fixtures.load('create_server_gb1_a.json')) - node['name'] = body['name'] - if 'server_groups' in body: - node['server_groups'] = [{'id': x} - for x in body['server_groups']] - if 'user_data' in body: - node['user_data'] = body['user_data'] - return self.response(httplib.ACCEPTED, json.dumps(node)) + node = json.loads(self.fixtures.load("create_server_gb1_a.json")) + node["name"] = body["name"] + if "server_groups" in body: + node["server_groups"] = [{"id": x} for x in body["server_groups"]] + if "user_data" in body: + node["user_data"] = body["user_data"] + return self.test_response(httplib.ACCEPTED, json.dumps(node)) def _1_0_servers_srv_xvpn7(self, method, url, body, headers): - if method == 'DELETE': - return self.response(httplib.ACCEPTED, '') + if method == "DELETE": + return self.test_response(httplib.ACCEPTED, "") def _1_0_server_types(self, method, url, body, headers): - if method == 'GET': - return self.response(httplib.OK, self.fixtures.load('list_server_types.json')) + if method == "GET": + return self.test_response(httplib.OK, self.fixtures.load("list_server_types.json")) def _1_0_zones(self, method, url, body, headers): - if method == 'GET': - if headers['Host'] == 'api.gbt.brightbox.com': - return self.response(httplib.OK, "{}") + if method == "GET": + if headers["Host"] == "api.gbt.brightbox.com": + return self.test_response(httplib.OK, "{}") else: - return self.response(httplib.OK, self.fixtures.load('list_zones.json')) + return self.test_response(httplib.OK, self.fixtures.load("list_zones.json")) def _2_0_zones(self, method, url, body, headers): data = '{"error_name":"unrecognised_endpoint", "errors": ["The request was for an unrecognised API endpoint"]}' - return self.response(httplib.BAD_REQUEST, data) + return self.test_response(httplib.BAD_REQUEST, data) def _1_0_cloud_ips(self, method, url, body, headers): - if method == 'GET': - return self.response(httplib.OK, self.fixtures.load('list_cloud_ips.json')) - elif method == 'POST': + if method == "GET": + return self.test_response(httplib.OK, self.fixtures.load("list_cloud_ips.json")) + elif method == "POST": if body: body = json.loads(body) - node = json.loads(self.fixtures.load('create_cloud_ip.json')) + node = json.loads(self.fixtures.load("create_cloud_ip.json")) - if 'reverse_dns' in body: - node['reverse_dns'] = body['reverse_dns'] - return self.response(httplib.ACCEPTED, json.dumps(node)) + if "reverse_dns" in body: + node["reverse_dns"] = body["reverse_dns"] + return self.test_response(httplib.ACCEPTED, json.dumps(node)) def _1_0_cloud_ips_cip_jsjc5(self, method, url, body, headers): - if method == 'DELETE': - return self.response(httplib.OK, '') - elif method == 'PUT': + if method == "DELETE": + return self.test_response(httplib.OK, "") + elif method == "PUT": body = json.loads(body) - if body.get('reverse_dns', None) == 'fred.co.uk': - return self.response(httplib.OK, '') + if body.get("reverse_dns", None) == "fred.co.uk": + return self.test_response(httplib.OK, "") else: - return self.response(httplib.BAD_REQUEST, '{"error_name":"bad dns", "errors": ["Bad dns"]}') + return self.test_response( + httplib.BAD_REQUEST, + '{"error_name":"bad dns", "errors": ["Bad dns"]}', + ) def _1_0_cloud_ips_cip_jsjc5_map(self, method, url, body, headers): - if method == 'POST': + if method == "POST": body = json.loads(body) - if 'destination' in body: - return self.response(httplib.ACCEPTED, '') + if "destination" in body: + return self.test_response(httplib.ACCEPTED, "") else: data = '{"error_name":"bad destination", "errors": ["Bad destination"]}' - return self.response(httplib.BAD_REQUEST, data) + return self.test_response(httplib.BAD_REQUEST, data) def _1_0_cloud_ips_cip_jsjc5_unmap(self, method, url, body, headers): - if method == 'POST': - return self.response(httplib.ACCEPTED, '') + if method == "POST": + return self.test_response(httplib.ACCEPTED, "") - def response(self, status, body): - return (status, body, {'content-type': 'application/json'}, httplib.responses[status]) + def test_response(self, status, body): + return ( + status, + body, + {"content-type": "application/json"}, + httplib.responses[status], + ) -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) # vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 diff --git a/libcloud/test/compute/test_cloudframes.py b/libcloud/test/compute/test_cloudframes.py deleted file mode 100644 index 1698198440..0000000000 --- a/libcloud/test/compute/test_cloudframes.py +++ /dev/null @@ -1,292 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import sys -import uuid -import base64 -import unittest -import datetime - -from libcloud.compute.base import Node, NodeImage, NodeLocation -from libcloud.compute.types import NodeState -from libcloud.compute.drivers.cloudframes import CloudFramesNodeDriver -from libcloud.compute.drivers.cloudframes import CloudFramesSnapshot - -from libcloud.utils.py3 import httplib, xmlrpclib, b -from libcloud.test import MockHttpTestCase -from libcloud.test.compute import TestCaseMixin -from libcloud.test.secrets import CLOUDFRAMES_PARAMS -from libcloud.test.file_fixtures import ComputeFileFixtures - - -# how many seconds to give the vm to boot and have VMWare tools start up -START_TIMEOUT = 300 - - -class CloudFramesMockHttp(MockHttpTestCase): - fixtures = ComputeFileFixtures('cloudframes') - - content_headers = { - 'Server': 'TwistedWeb/9.0.0', - 'Date': datetime.datetime.now().ctime(), - 'Content-Type': 'text/xml', - } - - def __getattr__(self, key): - if key == '_appserver_xmlrpc_http:__host:8888_appserver_xmlrpc': - return self._xmlrpc - raise AttributeError(key) - - def _xmlrpc(self, method, url, body, headers): - params, methodname = xmlrpclib.loads(body) - meth_name = methodname.replace('.', '_').replace('cloud_api_', '') - return getattr(self, meth_name)(method, url, params, headers) - - def _authenticate(self, headers): - self.assertTrue('Authorization' in headers.keys()) - self.assertTrue(headers['Authorization'].startswith('Basic ')) - auth = base64.b64decode( - b(headers['Authorization'].split(' ', 1)[1])).decode('ascii') - username, password = auth.split(':', 1) - self.assertEqual(username, CLOUDFRAMES_PARAMS[0]) - self.assertEqual(password, CLOUDFRAMES_PARAMS[1]) - - def cloudspace_find(self, method, url, params, headers): - self._authenticate(headers) - body = self.fixtures.load('_cloudspace_find.xml') - return (httplib.OK, body, self.content_headers, - httplib.responses[httplib.OK]) - - def machine_find(self, method, url, params, headers): - self._authenticate(headers) - if params[18]: - body = self.fixtures.load('_machine_find_templates.xml') - elif params[17] == 'PHYSICAL': - body = self.fixtures.load('_machine_find_physical.xml') - elif params[17] == 'VIRTUALSERVER': - body = self.fixtures.load('_machine_find_virtualserver.xml') - elif params[17] == 'VIRTUALDESKTOP': - body = self.fixtures.load('_machine_find_virtualdesktop.xml') - else: - raise Exception( - 'unknown machine.find query with params: %s' % params) - return (httplib.OK, body, self.content_headers, - httplib.responses[httplib.OK]) - - def machine_list(self, method, url, params, headers): - self._authenticate(headers) - body = None - if params[3]: - body = self.fixtures.load( - '_machine_list_machineguid_%s.xml' % params[3]) - if body: - return (httplib.OK, body, self.content_headers, - httplib.responses[httplib.OK]) - else: - return (httplib.INTERNAL_SERVER_ERROR, '', - self.content_headers, 'Could not parse request') - - def machine_delete(self, method, url, params, headers): - self._authenticate(headers) - body = self.fixtures.load('_machine_delete.xml') - return (httplib.OK, body, self.content_headers, - httplib.responses[httplib.OK]) - - def machine_stop(self, method, url, params, headers): - self._authenticate(headers) - body = self.fixtures.load('_machine_stop.xml') - return (httplib.OK, body, self.content_headers, - httplib.responses[httplib.OK]) - - def machine_reboot(self, method, url, params, headers): - self._authenticate(headers) - body = self.fixtures.load('_machine_reboot.xml') - return (httplib.OK, body, self.content_headers, - httplib.responses[httplib.OK]) - - def machine_createFromTemplate(self, method, url, params, headers): - self._authenticate(headers) - body = self.fixtures.load('_machine_createFromTemplate.xml') - return (httplib.OK, body, self.content_headers, - httplib.responses[httplib.OK]) - - def machine_start(self, method, url, params, headers): - self._authenticate(headers) - body = self.fixtures.load('_machine_start.xml') - return (httplib.OK, body, self.content_headers, - httplib.responses[httplib.OK]) - - def machine_snapshot(self, method, url, params, headers): - self._authenticate(headers) - body = self.fixtures.load('_machine_snapshot.xml') - return (httplib.OK, body, self.content_headers, - httplib.responses[httplib.OK]) - - def machine_listSnapshots(self, method, url, params, headers): - self._authenticate(headers) - body = self.fixtures.load('_machine_listSnapshots.xml') - return (httplib.OK, body, self.content_headers, - httplib.responses[httplib.OK]) - - def machine_rollback(self, method, url, params, headers): - self._authenticate(headers) - body = self.fixtures.load('_machine_rollback.xml') - return (httplib.OK, body, self.content_headers, - httplib.responses[httplib.OK]) - - def lan_find(self, method, url, params, headers): - self._authenticate(headers) - body = self.fixtures.load('_lan_find.xml') - return (httplib.OK, body, self.content_headers, - httplib.responses[httplib.OK]) - - -class CloudFramesTests(unittest.TestCase, TestCaseMixin): - - should_list_locations = True - should_have_pricing = False - should_list_volumes = False - - def __init__(self, name, url=None): - self.url = url - super(CloudFramesTests, self).__init__(name) - - def setUp(self): - if self.url: - args = () - kwargs = {'url': self.url} - else: - CloudFramesNodeDriver.connectionCls.conn_classes = ( - CloudFramesMockHttp, CloudFramesMockHttp) - args = CLOUDFRAMES_PARAMS - kwargs = {} - self.driver = CloudFramesNodeDriver(*args, **kwargs) - - def _retry_until_up(self, cmd, *args, **kwargs): - """ - When testing against a live system, this will cause the given command - to be retried until it succeeds. - (Calls like snapshot/reboot will fail until the vm has started fully.) - """ - now = datetime.datetime.now() - while not (datetime.datetime.now() - now).seconds > START_TIMEOUT: - try: - return cmd(*args, **kwargs) - except: - pass - else: - raise Exception('VMWare tools did not become available in time') - - def test_connection(self): - key, secret, secure, host, port = CLOUDFRAMES_PARAMS - CloudFramesNodeDriver(key, secret, secure, host) - CloudFramesNodeDriver(key, secret, secure, host, 80) - self.assertRaises(NotImplementedError, CloudFramesNodeDriver, - key, secret, True, host, 80) - CloudFramesNodeDriver(key, secret, secure, host, '80') - self.assertRaises(NotImplementedError, CloudFramesNodeDriver, - key, secure=secure, host=host) - self.assertRaises(NotImplementedError, CloudFramesNodeDriver, - secret=secret, secure=secure, host=host) - CloudFramesNodeDriver( - url='http://%s:%s@%s:80/appserver/xmlrpc' % (key, secret, host)) - CloudFramesNodeDriver( - url='http://%s:%s@%s/appserver/xmlrpc' % (key, secret, host)) - self.assertRaises(NotImplementedError, CloudFramesNodeDriver, - key=key, secret=secret, - url='https://%s/appserver/xmlrpc' % host) - self.assertRaises(NotImplementedError, CloudFramesNodeDriver, - key=key, secret=secret, secure=False, - url='https://%s/appserver/xmlrpc' % host) - self.assertRaises(NotImplementedError, CloudFramesNodeDriver, - url='http://%s@%s/appserver/xmlrpc' % (key, host)) - CloudFramesNodeDriver( - secret=secret, url='http://%s@%s/appserver/xmlrpc' % (key, host)) - self.assertRaises(NotImplementedError, CloudFramesNodeDriver, - url='http://%s/appserver/xmlrpc' % host) - self.assertRaises( - NotImplementedError, CloudFramesNodeDriver, - secret=secret, url='http://%s/appserver/xmlrpc' % host) - self.assertRaises(NotImplementedError, CloudFramesNodeDriver, - key=key, url='http://%s/appserver/xmlrpc' % host) - CloudFramesNodeDriver( - key=key, secret=secret, url='http://%s/appserver/xmlrpc' % host) - - def test_snapshot(self): - nodes = [node for node in self.driver.list_nodes() - if node.state == NodeState.RUNNING] - if not nodes: - raise Exception('No running vm to test snapshotting') - self._test_snapshot(nodes[0]) - - def _test_snapshot(self, node): - if self.url: - self.assertEqual(len(self.driver.ex_list_snapshots(node)), 0) - snapshot1 = self._retry_until_up( - self.driver.ex_snapshot_node, node) - self.assertTrue(isinstance(snapshot1, CloudFramesSnapshot)) - if self.url: - self.assertEqual(len(self.driver.ex_list_snapshots(node)), 1) - snapshot2 = self.driver.ex_snapshot_node(node) - self.assertTrue(isinstance(snapshot2, CloudFramesSnapshot)) - if self.url: - self.assertEqual(len(self.driver.ex_list_snapshots(node)), 2) - self.driver.ex_destroy_snapshot(node, snapshot2) - if self.url: - self.assertEqual(len(self.driver.ex_list_snapshots(node)), 1) - self.driver.ex_rollback_node(node, snapshot1) - if self.url: - self.assertEqual(len(self.driver.ex_list_snapshots(node)), 1) - self.driver.ex_destroy_snapshot(node, snapshot1) - - def test_comprehensive(self): - """ - Creates a node with the first location, image and size it finds. - - Then boots the node, reboots, creates two snapshots. - Deletes one snapshot, rolls back to the other, then destroys the node. - - In between these operations it verifies the node status and lists. - """ - if not self.url: - return - location = self.driver.list_locations()[0] - self.assertTrue(isinstance(location, NodeLocation)) - image = self.driver.list_images()[0] - self.assertTrue(isinstance(image, NodeImage)) - size = self.driver.list_sizes()[0] - name = 'AUTOTEST_%s' % uuid.uuid4() - node = self.driver.create_node( - image=image, name=name, size=size, location=location) - # give the node time to boot up and load the vmware tools - self.assertTrue(isinstance(node, Node)) - self.assertTrue(node.id in [x.id for x in self.driver.list_nodes()]) - self.assertTrue(node.state == NodeState.RUNNING) - self._test_snapshot(node) - self._retry_until_up(self.driver.reboot_node, node) - self.driver.destroy_node(node) - self.assertFalse(node.id in [x.id for x in self.driver.list_nodes()]) - - -if __name__ == '__main__': - # add a full url as first arg to this script to test against a live system - # fi: http://key:secret@host:port/appserver/xmlrpc - if len(sys.argv) > 1: - suite = unittest.TestSuite() - suite.addTest(CloudFramesTests('test_comprehensive', sys.argv[1])) - if not unittest.TextTestRunner().run(suite).wasSuccessful(): - sys.exit(1) - del sys.argv[1] - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_cloudscale.py b/libcloud/test/compute/test_cloudscale.py new file mode 100644 index 0000000000..4455d87a7e --- /dev/null +++ b/libcloud/test/compute/test_cloudscale.py @@ -0,0 +1,116 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import sys +import unittest + +from libcloud.test import MockHttp, LibcloudTestCase +from libcloud.utils.py3 import httplib +from libcloud.test.secrets import CLOUDSCALE_PARAMS +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.cloudscale import CloudscaleNodeDriver + +try: + import simplejson as json +except ImportError: + import json # NOQA + + +class CloudscaleTests(LibcloudTestCase): + def setUp(self): + CloudscaleNodeDriver.connectionCls.conn_class = CloudscaleMockHttp + self.driver = CloudscaleNodeDriver(*CLOUDSCALE_PARAMS) + + def test_list_images_success(self): + images = self.driver.list_images() + (image,) = images + self.assertTrue(image.id is not None) + self.assertTrue(image.name is not None) + + def test_list_sizes_success(self): + sizes = self.driver.list_sizes() + self.assertEqual(len(sizes), 2) + + size = sizes[0] + self.assertTrue(size.id is not None) + self.assertEqual(size.name, "Flex-2") + self.assertEqual(size.ram, 2048) + + size = sizes[1] + self.assertTrue(size.id is not None) + self.assertEqual(size.name, "Flex-4") + self.assertEqual(size.ram, 4096) + + def test_list_locations_not_existing(self): + # assertRaises doesn't exist in Python 2.5?! + try: + self.driver.list_locations() + except NotImplementedError: + pass + else: + assert False, "Did not raise the wished error." + + def test_list_nodes_success(self): + nodes = self.driver.list_nodes() + self.assertEqual(len(nodes), 1) + self.assertEqual(nodes[0].id, "47cec963-fcd2-482f-bdb6-24461b2d47b1") + self.assertEqual(nodes[0].public_ips, ["185.98.122.176", "2a06:c01:1:1902::7ab0:176"]) + + def test_reboot_node_success(self): + node = self.driver.list_nodes()[0] + result = self.driver.reboot_node(node) + self.assertTrue(result) + + def test_create_node_success(self): + test_size = self.driver.list_sizes()[0] + test_image = self.driver.list_images()[0] + created_node = self.driver.create_node("node-name", test_size, test_image) + self.assertEqual(created_node.id, "47cec963-fcd2-482f-bdb6-24461b2d47b1") + + def test_destroy_node_success(self): + node = self.driver.list_nodes()[0] + result = self.driver.destroy_node(node) + self.assertTrue(result) + + +class CloudscaleMockHttp(MockHttp): + fixtures = ComputeFileFixtures("cloudscale") + + def _v1_images(self, method, url, body, headers): + body = self.fixtures.load("list_images.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v1_flavors(self, method, url, body, headers): + body = self.fixtures.load("list_sizes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v1_servers(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_nodes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + body = self.fixtures.load("create_node.json") + response = httplib.responses[httplib.CREATED] + return (httplib.CREATED, body, {}, response) + + def _v1_servers_47cec963_fcd2_482f_bdb6_24461b2d47b1(self, method, url, body, headers): + assert method == "DELETE" + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT]) + + def _v1_servers_47cec963_fcd2_482f_bdb6_24461b2d47b1_reboot(self, method, url, body, headers): + return (httplib.OK, "", {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_cloudsigma_v1_0.py b/libcloud/test/compute/test_cloudsigma_v1_0.py index d8fb310a7f..a0deb3a664 100644 --- a/libcloud/test/compute/test_cloudsigma_v1_0.py +++ b/libcloud/test/compute/test_cloudsigma_v1_0.py @@ -15,29 +15,25 @@ import sys import unittest -from libcloud.utils.py3 import httplib - -from libcloud.compute.base import Node -from libcloud.compute.drivers.cloudsigma import CloudSigmaNodeDriver -from libcloud.compute.drivers.cloudsigma import CloudSigmaZrhNodeDriver -from libcloud.utils.misc import str2dicts, str2list, dict2str from libcloud.test import MockHttp +from libcloud.utils.py3 import httplib +from libcloud.utils.misc import dict2str, str2list, str2dicts +from libcloud.compute.base import Node from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.cloudsigma import CloudSigmaNodeDriver, CloudSigmaZrhNodeDriver -class CloudSigmaAPI10BaseTestCase(object): +class CloudSigmaAPI10BaseTestCase: should_list_locations = False driver_klass = CloudSigmaZrhNodeDriver driver_kwargs = {} def setUp(self): - self.driver = self.driver_klass(*self.driver_args, - **self.driver_kwargs) - - self.driver.connectionCls.conn_classes = (None, - CloudSigmaHttp) + self.driver_klass.connectionCls.conn_class = CloudSigmaHttp + CloudSigmaHttp.type = None + self.driver = self.driver_klass(*self.driver_args, **self.driver_kwargs) def test_list_nodes(self): nodes = self.driver.list_nodes() @@ -46,13 +42,13 @@ def test_list_nodes(self): node = nodes[0] self.assertEqual(node.public_ips[0], "1.2.3.4") - self.assertEqual(node.extra['smp'], 1) - self.assertEqual(node.extra['cpu'], 1100) - self.assertEqual(node.extra['mem'], 640) + self.assertEqual(node.extra["smp"], 1) + self.assertEqual(node.extra["cpu"], 1100) + self.assertEqual(node.extra["mem"], 640) def test_list_sizes(self): images = self.driver.list_sizes() - self.assertEqual(len(images), 9) + self.assertEqual(len(images), 10) def test_list_images(self): sizes = self.driver.list_images() @@ -81,8 +77,7 @@ def test_destroy_node(self): def test_create_node(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] - node = self.driver.create_node( - name="cloudsigma node", image=image, size=size) + node = self.driver.create_node(name="cloudsigma node", image=image, size=size) self.assertTrue(isinstance(node, Node)) def test_ex_static_ip_list(self): @@ -96,7 +91,7 @@ def test_ex_static_ip_create(self): self.assertEqual(len(list(result[1].keys())), 6) def test_ex_static_ip_destroy(self): - result = self.driver.ex_static_ip_destroy('1.2.3.4') + result = self.driver.ex_static_ip_destroy("1.2.3.4") self.assertTrue(result) def test_ex_drives_list(self): @@ -106,118 +101,103 @@ def test_ex_drives_list(self): def test_ex_drive_destroy(self): result = self.driver.ex_drive_destroy( # @@TR: this should be soft-coded: - 'd18119ce_7afa_474a_9242_e0384b160220') + "d18119ce_7afa_474a_9242_e0384b160220" + ) self.assertTrue(result) def test_ex_set_node_configuration(self): node = self.driver.list_nodes()[0] - result = self.driver.ex_set_node_configuration(node, **{'smp': 2}) + result = self.driver.ex_set_node_configuration(node, **{"smp": 2}) self.assertTrue(result) def test_str2dicts(self): - string = 'mem 1024\ncpu 2200\n\nmem2048\cpu 1100' + string = "mem 1024\ncpu 2200\n\nmem2048\\cpu 1100" result = str2dicts(string) self.assertEqual(len(result), 2) def test_str2list(self): - string = 'ip 1.2.3.4\nip 1.2.3.5\nip 1.2.3.6' + string = "ip 1.2.3.4\nip 1.2.3.5\nip 1.2.3.6" result = str2list(string) self.assertEqual(len(result), 3) - self.assertEqual(result[0], '1.2.3.4') - self.assertEqual(result[1], '1.2.3.5') - self.assertEqual(result[2], '1.2.3.6') + self.assertEqual(result[0], "1.2.3.4") + self.assertEqual(result[1], "1.2.3.5") + self.assertEqual(result[2], "1.2.3.6") def test_dict2str(self): - d = {'smp': 5, 'cpu': 2200, 'mem': 1024} + d = {"smp": 5, "cpu": 2200, "mem": 1024} result = dict2str(d) self.assertTrue(len(result) > 0) - self.assertTrue(result.find('smp 5') >= 0) - self.assertTrue(result.find('cpu 2200') >= 0) - self.assertTrue(result.find('mem 1024') >= 0) + self.assertTrue(result.find("smp 5") >= 0) + self.assertTrue(result.find("cpu 2200") >= 0) + self.assertTrue(result.find("mem 1024") >= 0) -class CloudSigmaAPI10DirectTestCase(CloudSigmaAPI10BaseTestCase, - unittest.TestCase): +class CloudSigmaAPI10DirectTestCase(CloudSigmaAPI10BaseTestCase, unittest.TestCase): driver_klass = CloudSigmaZrhNodeDriver - driver_args = ('foo', 'bar') + driver_args = ("foo", "bar") driver_kwargs = {} -class CloudSigmaAPI10IndiretTestCase(CloudSigmaAPI10BaseTestCase, - unittest.TestCase): +class CloudSigmaAPI10IndiretTestCase(CloudSigmaAPI10BaseTestCase, unittest.TestCase): driver_klass = CloudSigmaNodeDriver - driver_args = ('foo', 'bar') - driver_kwargs = {'api_version': '1.0'} + driver_args = ("foo", "bar") + driver_kwargs = {"api_version": "1.0"} class CloudSigmaHttp(MockHttp): - fixtures = ComputeFileFixtures('cloudsigma') + fixtures = ComputeFileFixtures("cloudsigma") def _drives_standard_info(self, method, url, body, headers): - body = self.fixtures.load('drives_standard_info.txt') + body = self.fixtures.load("drives_standard_info.txt") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _servers_62fe7cde_4fb9_4c63_bd8c_e757930066a0_start( - self, method, url, body, headers): - + def _servers_62fe7cde_4fb9_4c63_bd8c_e757930066a0_start(self, method, url, body, headers): return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _servers_62fe7cde_4fb9_4c63_bd8c_e757930066a0_stop( - self, method, url, body, headers): - + def _servers_62fe7cde_4fb9_4c63_bd8c_e757930066a0_stop(self, method, url, body, headers): return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.OK]) - def _servers_62fe7cde_4fb9_4c63_bd8c_e757930066a0_destroy( - self, method, url, body, headers): - - return (httplib.NO_CONTENT, - body, {}, httplib.responses[httplib.NO_CONTENT]) + def _servers_62fe7cde_4fb9_4c63_bd8c_e757930066a0_destroy(self, method, url, body, headers): + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) - def _drives_d18119ce_7afa_474a_9242_e0384b160220_clone( - self, method, url, body, headers): - - body = self.fixtures.load('drives_clone.txt') + def _drives_d18119ce_7afa_474a_9242_e0384b160220_clone(self, method, url, body, headers): + body = self.fixtures.load("drives_clone.txt") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _drives_a814def5_1789_49a0_bf88_7abe7bb1682a_info( - self, method, url, body, headers): - - body = self.fixtures.load('drives_single_info.txt') + def _drives_a814def5_1789_49a0_bf88_7abe7bb1682a_info(self, method, url, body, headers): + body = self.fixtures.load("drives_single_info.txt") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _drives_info(self, method, url, body, headers): - body = self.fixtures.load('drives_info.txt') + body = self.fixtures.load("drives_info.txt") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _servers_create(self, method, url, body, headers): - body = self.fixtures.load('servers_create.txt') + body = self.fixtures.load("servers_create.txt") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _servers_info(self, method, url, body, headers): - body = self.fixtures.load('servers_info.txt') + body = self.fixtures.load("servers_info.txt") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _resources_ip_list(self, method, url, body, headers): - body = self.fixtures.load('resources_ip_list.txt') + body = self.fixtures.load("resources_ip_list.txt") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _resources_ip_create(self, method, url, body, headers): - body = self.fixtures.load('resources_ip_create.txt') + body = self.fixtures.load("resources_ip_create.txt") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _resources_ip_1_2_3_4_destroy(self, method, url, body, headers): return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.OK]) - def _drives_d18119ce_7afa_474a_9242_e0384b160220_destroy( - self, method, url, body, headers): - + def _drives_d18119ce_7afa_474a_9242_e0384b160220_destroy(self, method, url, body, headers): return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.OK]) - def _servers_62fe7cde_4fb9_4c63_bd8c_e757930066a0_set( - self, method, url, body, headers): - - body = self.fixtures.load('servers_set.txt') + def _servers_62fe7cde_4fb9_4c63_bd8c_e757930066a0_set(self, method, url, body, headers): + body = self.fixtures.load("servers_set.txt") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) -if __name__ == '__main__': + +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_cloudsigma_v2_0.py b/libcloud/test/compute/test_cloudsigma_v2_0.py index 4bc66a5b90..a7eb489b07 100644 --- a/libcloud/test/compute/test_cloudsigma_v2_0.py +++ b/libcloud/test/compute/test_cloudsigma_v2_0.py @@ -15,103 +15,114 @@ import sys -try: - import simplejson as json -except: - import json - -from libcloud.utils.py3 import httplib - +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import httplib, assertRaisesRegex from libcloud.common.types import InvalidCredsError -from libcloud.compute.drivers.cloudsigma import CloudSigmaNodeDriver -from libcloud.compute.drivers.cloudsigma import CloudSigma_2_0_NodeDriver -from libcloud.compute.drivers.cloudsigma import CloudSigmaError from libcloud.compute.types import NodeState - -from libcloud.test import unittest -from libcloud.test import MockHttpTestCase from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.cloudsigma import ( + CloudSigmaError, + CloudSigmaNodeDriver, + CloudSigma_2_0_NodeDriver, +) + +try: + import simplejson as json +except Exception: + import json -class CloudSigmaAPI20BaseTestCase(object): +class CloudSigmaAPI20BaseTestCase: def setUp(self): - self.driver_klass.connectionCls.conn_classes = \ - (CloudSigmaMockHttp, CloudSigmaMockHttp) + self.driver_klass.connectionCls.conn_class = CloudSigmaMockHttp CloudSigmaMockHttp.type = None - CloudSigmaMockHttp.use_param = 'do' + CloudSigmaMockHttp.use_param = "do" - self.driver = self.driver_klass(*self.driver_args, - **self.driver_kwargs) + self.driver = self.driver_klass(*self.driver_args, **self.driver_kwargs) self.driver.DRIVE_TRANSITION_SLEEP_INTERVAL = 0.1 self.driver.DRIVE_TRANSITION_TIMEOUT = 1 self.node = self.driver.list_nodes()[0] def test_invalid_api_versions(self): - expected_msg = 'Unsupported API version: invalid' - self.assertRaisesRegexp(NotImplementedError, expected_msg, - CloudSigmaNodeDriver, 'username', 'password', - api_version='invalid') + expected_msg = "Unsupported API version: invalid" + assertRaisesRegex( + self, + NotImplementedError, + expected_msg, + CloudSigmaNodeDriver, + "username", + "password", + api_version="invalid", + ) def test_invalid_credentials(self): - CloudSigmaMockHttp.type = 'INVALID_CREDS' + CloudSigmaMockHttp.type = "INVALID_CREDS" self.assertRaises(InvalidCredsError, self.driver.list_nodes) def test_invalid_region(self): - expected_msg = 'Invalid region:' - self.assertRaisesRegexp(ValueError, expected_msg, - CloudSigma_2_0_NodeDriver, 'foo', 'bar', - region='invalid') + expected_msg = "Invalid region:" + assertRaisesRegex( + self, + ValueError, + expected_msg, + CloudSigma_2_0_NodeDriver, + "foo", + "bar", + region="invalid", + ) def test_list_sizes(self): sizes = self.driver.list_sizes() size = sizes[0] - self.assertEqual(size.id, 'micro-regular') + self.assertEqual(size.id, "small-1") def test_list_images(self): images = self.driver.list_images() image = images[0] - self.assertEqual(image.name, 'ubuntu-10.04-toMP') - self.assertEqual(image.extra['image_type'], 'preinst') - self.assertEqual(image.extra['media'], 'disk') - self.assertEqual(image.extra['os'], 'linux') + self.assertEqual(image.name, "ubuntu-10.04-toMP") + self.assertEqual(image.extra["image_type"], "preinst") + self.assertEqual(image.extra["media"], "disk") + self.assertEqual(image.extra["os"], "linux") def test_list_nodes(self): nodes = self.driver.list_nodes() node = nodes[0] self.assertEqual(len(nodes), 2) - self.assertEqual(node.id, '9de75ed6-fd33-45e2-963f-d405f31fd911') - self.assertEqual(node.name, 'test no drives') + self.assertEqual(node.id, "9de75ed6-fd33-45e2-963f-d405f31fd911") + self.assertEqual(node.name, "test no drives") self.assertEqual(node.state, NodeState.RUNNING) - self.assertEqual(node.public_ips, ['185.12.5.181', '178.22.68.55']) + self.assertEqual(node.public_ips, ["185.12.5.181", "178.22.68.55"]) self.assertEqual(node.private_ips, []) def test_create_node(self): image = self.driver.list_images()[0] size = self.driver.list_sizes()[0] - metadata = {'foo': 'bar'} + metadata = {"foo": "bar"} - node = self.driver.create_node(name='test node', size=size, image=image, - ex_metadata=metadata) - self.assertEqual(node.name, 'test node') - self.assertEqual(len(node.extra['nics']), 1) - self.assertEqual(node.extra['nics'][0]['ip_v4_conf']['conf'], 'dhcp') + node = self.driver.create_node( + name="test node", size=size, image=image, ex_metadata=metadata + ) + self.assertEqual(node.name, "test node") + self.assertEqual(len(node.extra["nics"]), 1) + self.assertEqual(node.extra["nics"][0]["ip_v4_conf"]["conf"], "dhcp") def test_create_node_with_vlan(self): image = self.driver.list_images()[0] size = self.driver.list_sizes()[0] - vlan_uuid = '39ae851d-433f-4ac2-a803-ffa24cb1fa3e' + vlan_uuid = "39ae851d-433f-4ac2-a803-ffa24cb1fa3e" - node = self.driver.create_node(name='test node vlan', size=size, - image=image, ex_vlan=vlan_uuid) - self.assertEqual(node.name, 'test node vlan') - self.assertEqual(len(node.extra['nics']), 2) - self.assertEqual(node.extra['nics'][0]['ip_v4_conf']['conf'], 'dhcp') - self.assertEqual(node.extra['nics'][1]['vlan']['uuid'], vlan_uuid) + node = self.driver.create_node( + name="test node vlan", size=size, image=image, ex_vlan=vlan_uuid + ) + self.assertEqual(node.name, "test node vlan") + self.assertEqual(len(node.extra["nics"]), 2) + self.assertEqual(node.extra["nics"][0]["ip_v4_conf"]["conf"], "dhcp") + self.assertEqual(node.extra["nics"][1]["vlan"]["uuid"], vlan_uuid) def test_destroy_node(self): status = self.driver.destroy_node(node=self.node) @@ -122,43 +133,64 @@ def test_ex_start_node(self): self.assertTrue(status) def test_ex_start_node_avoid_mode(self): - CloudSigmaMockHttp.type = 'AVOID_MODE' - ex_avoid = ['1', '2'] - status = self.driver.ex_start_node(node=self.node, - ex_avoid=ex_avoid) + CloudSigmaMockHttp.type = "AVOID_MODE" + ex_avoid = ["1", "2"] + status = self.driver.ex_start_node(node=self.node, ex_avoid=ex_avoid) self.assertTrue(status) def test_ex_start_node_already_started(self): - CloudSigmaMockHttp.type = 'ALREADY_STARTED' + CloudSigmaMockHttp.type = "ALREADY_STARTED" - expected_msg = 'Cannot start guest in state "started". Guest should ' \ - 'be in state "stopped' + expected_msg = 'Cannot start guest in state "started". Guest should ' 'be in state "stopped' - self.assertRaisesRegexp(CloudSigmaError, expected_msg, - self.driver.ex_start_node, node=self.node) + assertRaisesRegex( + self, + CloudSigmaError, + expected_msg, + self.driver.ex_start_node, + node=self.node, + ) def test_ex_stop_node(self): status = self.driver.ex_stop_node(node=self.node) self.assertTrue(status) def test_ex_stop_node_already_stopped(self): - CloudSigmaMockHttp.type = 'ALREADY_STOPPED' + CloudSigmaMockHttp.type = "ALREADY_STOPPED" expected_msg = 'Cannot stop guest in state "stopped"' - self.assertRaisesRegexp(CloudSigmaError, expected_msg, - self.driver.ex_stop_node, node=self.node) + assertRaisesRegex( + self, + CloudSigmaError, + expected_msg, + self.driver.ex_stop_node, + node=self.node, + ) + + def test_reboot_node(self): + status = self.driver.reboot_node(node=self.node) + self.assertTrue(status) + + def test_ex_get_node(self): + node_id = "3df825cb-9c1b-470d-acbd-03e1a966c046" + node = self.driver.ex_get_node(node_id) + + self.assertEqual(node.id, "3df825cb-9c1b-470d-acbd-03e1a966c046") + self.assertEqual(node.name, "test_server") + self.assertEqual(node.state, NodeState.RUNNING) + self.assertEqual(node.public_ips, ["162.213.38.202"]) + self.assertEqual(node.private_ips, []) def test_ex_clone_node(self): node_to_clone = self.driver.list_nodes()[0] - cloned_node = self.driver.ex_clone_node(node=node_to_clone, - name='test cloned node') - self.assertEqual(cloned_node.name, 'test cloned node') + cloned_node = self.driver.ex_clone_node(node=node_to_clone, name="test cloned node") + self.assertEqual(cloned_node.name, "test cloned node") def test_ex_open_vnc_tunnel(self): node = self.driver.list_nodes()[0] vnc_url = self.driver.ex_open_vnc_tunnel(node=node) - self.assertEqual(vnc_url, 'vnc://direct.lvs.cloudsigma.com:41111') + self.assertEqual(vnc_url, "vnc://direct.lvs.cloudsigma.com:41111") def test_ex_close_vnc_tunnel(self): node = self.driver.list_nodes()[0] @@ -169,45 +201,44 @@ def test_ex_list_library_drives(self): drives = self.driver.ex_list_library_drives() drive = drives[0] - self.assertEqual(drive.name, 'IPCop 2.0.2') - self.assertEqual(drive.size, 1000000000) - self.assertEqual(drive.media, 'cdrom') - self.assertEqual(drive.status, 'unmounted') + self.assertEqual(drive.name, "IPCop 2.0.2") + self.assertEqual(drive.size, 1) + self.assertEqual(drive.media, "cdrom") + self.assertEqual(drive.status, "unmounted") def test_ex_list_user_drives(self): drives = self.driver.ex_list_user_drives() drive = drives[0] - self.assertEqual(drive.name, 'test node 2-drive') - self.assertEqual(drive.size, 13958643712) - self.assertEqual(drive.media, 'disk') - self.assertEqual(drive.status, 'unmounted') + self.assertEqual(drive.name, "test node 2-drive") + self.assertEqual(drive.size, 13) + self.assertEqual(drive.media, "disk") + self.assertEqual(drive.status, "unmounted") def test_ex_create_drive(self): - CloudSigmaMockHttp.type = 'CREATE' + CloudSigmaMockHttp.type = "CREATE" - name = 'test drive 5' + name = "test drive 5" size = 2000 * 1024 * 1024 - drive = self.driver.ex_create_drive(name=name, size=size, media='disk') - self.assertEqual(drive.name, 'test drive 5') - self.assertEqual(drive.media, 'disk') + drive = self.driver.ex_create_drive(name=name, size=size, media="disk") + self.assertEqual(drive.name, "test drive 5") + self.assertEqual(drive.media, "disk") def test_ex_clone_drive(self): drive = self.driver.ex_list_user_drives()[0] - cloned_drive = self.driver.ex_clone_drive(drive=drive, - name='cloned drive') + cloned_drive = self.driver.ex_clone_drive(drive=drive, name="cloned drive") - self.assertEqual(cloned_drive.name, 'cloned drive') + self.assertEqual(cloned_drive.name, "cloned drive") def test_ex_resize_drive(self): drive = self.driver.ex_list_user_drives()[0] - size = 1111 * 1024 * 1024 + size = 10 resized_drive = self.driver.ex_resize_drive(drive=drive, size=size) - self.assertEqual(resized_drive.name, 'test drive 5') - self.assertEqual(resized_drive.media, 'disk') + self.assertEqual(resized_drive.name, "test drive 5") + self.assertEqual(resized_drive.media, "disk") self.assertEqual(resized_drive.size, size) def test_ex_list_firewall_policies(self): @@ -215,68 +246,69 @@ def test_ex_list_firewall_policies(self): policy = policies[1] rule = policy.rules[0] - self.assertEqual(policy.name, 'My awesome policy') - self.assertEqual(rule.action, 'drop') - self.assertEqual(rule.direction, 'out') - self.assertEqual(rule.dst_ip, '23.0.0.0/32') - self.assertEqual(rule.ip_proto, 'tcp') - self.assertEqual(rule.dst_port, None) - self.assertEqual(rule.src_ip, None) - self.assertEqual(rule.src_port, None) - self.assertEqual(rule.comment, 'Drop traffic from the VM to IP address 23.0.0.0/32') + self.assertEqual(policy.name, "My awesome policy") + self.assertEqual(rule.action, "drop") + self.assertEqual(rule.direction, "out") + self.assertEqual(rule.dst_ip, "23.0.0.0/32") + self.assertEqual(rule.ip_proto, "tcp") + self.assertIsNone(rule.dst_port) + self.assertIsNone(rule.src_ip) + self.assertIsNone(rule.src_port) + self.assertEqual(rule.comment, "Drop traffic from the VM to IP address 23.0.0.0/32") def test_ex_create_firewall_policy_no_rules(self): - CloudSigmaMockHttp.type = 'CREATE_NO_RULES' - policy = self.driver.ex_create_firewall_policy(name='test policy 1') + CloudSigmaMockHttp.type = "CREATE_NO_RULES" + policy = self.driver.ex_create_firewall_policy(name="test policy 1") - self.assertEqual(policy.name, 'test policy 1') + self.assertEqual(policy.name, "test policy 1") self.assertEqual(policy.rules, []) def test_ex_create_firewall_policy_with_rules(self): - CloudSigmaMockHttp.type = 'CREATE_WITH_RULES' + CloudSigmaMockHttp.type = "CREATE_WITH_RULES" rules = [ { - 'action': 'accept', - 'direction': 'out', - 'ip_proto': 'tcp', - 'src_ip': '127.0.0.1', - 'dst_ip': '127.0.0.1' + "action": "accept", + "direction": "out", + "ip_proto": "tcp", + "src_ip": "127.0.0.1", + "dst_ip": "127.0.0.1", } ] - policy = self.driver.ex_create_firewall_policy(name='test policy 2', - rules=rules) + policy = self.driver.ex_create_firewall_policy(name="test policy 2", rules=rules) rule = policy.rules[0] - self.assertEqual(policy.name, 'test policy 2') + self.assertEqual(policy.name, "test policy 2") self.assertEqual(len(policy.rules), 1) - self.assertEqual(rule.action, 'accept') - self.assertEqual(rule.direction, 'out') - self.assertEqual(rule.ip_proto, 'tcp') + self.assertEqual(rule.action, "accept") + self.assertEqual(rule.direction, "out") + self.assertEqual(rule.ip_proto, "tcp") def test_ex_attach_firewall_policy(self): policy = self.driver.ex_list_firewall_policies()[0] node = self.driver.list_nodes()[0] - CloudSigmaMockHttp.type = 'ATTACH_POLICY' - updated_node = self.driver.ex_attach_firewall_policy(policy=policy, - node=node) - nic = updated_node.extra['nics'][0] - self.assertEqual(nic['firewall_policy']['uuid'], - '461dfb8c-e641-43d7-a20e-32e2aa399086') + CloudSigmaMockHttp.type = "ATTACH_POLICY" + updated_node = self.driver.ex_attach_firewall_policy(policy=policy, node=node) + nic = updated_node.extra["nics"][0] + self.assertEqual(nic["firewall_policy"]["uuid"], "461dfb8c-e641-43d7-a20e-32e2aa399086") def test_ex_attach_firewall_policy_inexistent_nic(self): policy = self.driver.ex_list_firewall_policies()[0] node = self.driver.list_nodes()[0] - nic_mac = 'inexistent' - expected_msg = 'Cannot find the NIC interface to attach a policy to' - self.assertRaisesRegexp(ValueError, expected_msg, - self.driver.ex_attach_firewall_policy, - policy=policy, - node=node, - nic_mac=nic_mac) + nic_mac = "inexistent" + expected_msg = "Cannot find the NIC interface to attach a policy to" + assertRaisesRegex( + self, + ValueError, + expected_msg, + self.driver.ex_attach_firewall_policy, + policy=policy, + node=node, + nic_mac=nic_mac, + ) def test_ex_delete_firewall_policy(self): policy = self.driver.ex_list_firewall_policies()[0] @@ -287,25 +319,24 @@ def test_ex_list_tags(self): tags = self.driver.ex_list_tags() tag = tags[0] - self.assertEqual(tag.id, 'a010ec41-2ead-4630-a1d0-237fa77e4d4d') - self.assertEqual(tag.name, 'test tag 2') + self.assertEqual(tag.id, "a010ec41-2ead-4630-a1d0-237fa77e4d4d") + self.assertEqual(tag.name, "test tag 2") def test_ex_get_tag(self): - tag = self.driver.ex_get_tag(tag_id='a010ec41-2ead-4630-a1d0-237fa77e4d4d') + tag = self.driver.ex_get_tag(tag_id="a010ec41-2ead-4630-a1d0-237fa77e4d4d") - self.assertEqual(tag.id, 'a010ec41-2ead-4630-a1d0-237fa77e4d4d') - self.assertEqual(tag.name, 'test tag 2') + self.assertEqual(tag.id, "a010ec41-2ead-4630-a1d0-237fa77e4d4d") + self.assertEqual(tag.name, "test tag 2") def test_ex_create_tag(self): - tag = self.driver.ex_create_tag(name='test tag 3') - self.assertEqual(tag.name, 'test tag 3') + tag = self.driver.ex_create_tag(name="test tag 3") + self.assertEqual(tag.name, "test tag 3") def test_ex_create_tag_with_resources(self): - CloudSigmaMockHttp.type = 'WITH_RESOURCES' - resource_uuids = ['1'] - tag = self.driver.ex_create_tag(name='test tag 3', - resource_uuids=resource_uuids) - self.assertEqual(tag.name, 'test tag 3') + CloudSigmaMockHttp.type = "WITH_RESOURCES" + resource_uuids = ["1"] + tag = self.driver.ex_create_tag(name="test tag 3", resource_uuids=resource_uuids) + self.assertEqual(tag.name, "test tag 3") self.assertEqual(tag.resources, resource_uuids) def test_ex_tag_resource(self): @@ -313,22 +344,27 @@ def test_ex_tag_resource(self): tag = self.driver.ex_list_tags()[0] updated_tag = self.driver.ex_tag_resource(resource=node, tag=tag) - self.assertEqual(updated_tag.name, 'test tag 3') + self.assertEqual(updated_tag.name, "test tag 3") def test_ex_tag_resources(self): nodes = self.driver.list_nodes() tag = self.driver.ex_list_tags()[0] updated_tag = self.driver.ex_tag_resources(resources=nodes, tag=tag) - self.assertEqual(updated_tag.name, 'test tag 3') + self.assertEqual(updated_tag.name, "test tag 3") def test_ex_tag_resource_invalid_resource_object(self): tag = self.driver.ex_list_tags()[0] - expected_msg = 'Resource doesn\'t have id attribute' - self.assertRaisesRegexp(ValueError, expected_msg, - self.driver.ex_tag_resource, tag=tag, - resource={}) + expected_msg = "Resource doesn't have id attribute" + assertRaisesRegex( + self, + ValueError, + expected_msg, + self.driver.ex_tag_resource, + tag=tag, + resource={}, + ) def test_ex_delete_tag(self): tag = self.driver.ex_list_tags()[0] @@ -337,64 +373,69 @@ def test_ex_delete_tag(self): def test_ex_get_balance(self): balance = self.driver.ex_get_balance() - self.assertEqual(balance['balance'], '10.00') - self.assertEqual(balance['currency'], 'USD') + self.assertEqual(balance["balance"], "10.00") + self.assertEqual(balance["currency"], "USD") def test_ex_get_pricing(self): pricing = self.driver.ex_get_pricing() - self.assertTrue('current' in pricing) - self.assertTrue('next' in pricing) - self.assertTrue('objects' in pricing) + self.assertTrue("current" in pricing) + self.assertTrue("next" in pricing) + self.assertTrue("objects" in pricing) def test_ex_get_usage(self): pricing = self.driver.ex_get_usage() - self.assertTrue('balance' in pricing) - self.assertTrue('usage' in pricing) + self.assertTrue("balance" in pricing) + self.assertTrue("usage" in pricing) def test_ex_list_subscriptions(self): subscriptions = self.driver.ex_list_subscriptions() + self.assertEqual(len(subscriptions), 6) + subscription = subscriptions[0] - self.assertEqual(len(subscriptions), 5) - self.assertEqual(subscription.id, '7272') - self.assertEqual(subscription.resource, 'vlan') + self.assertEqual(subscription.id, "7272") + self.assertEqual(subscription.resource, "vlan") self.assertEqual(subscription.amount, 1) - self.assertEqual(subscription.period, '345 days, 0:00:00') - self.assertEqual(subscription.status, 'active') - self.assertEqual(subscription.price, '0E-20') + self.assertEqual(subscription.period, "345 days, 0:00:00") + self.assertEqual(subscription.status, "active") + self.assertEqual(subscription.price, "0E-20") + + subscription = subscriptions[-1] + self.assertEqual(subscription.id, "5555") + self.assertEqual(subscription.start_time, None) + self.assertEqual(subscription.end_time, None) def test_ex_create_subscription(self): - CloudSigmaMockHttp.type = 'CREATE_SUBSCRIPTION' - subscription = self.driver.ex_create_subscription(amount=1, - period='1 month', - resource='vlan') + CloudSigmaMockHttp.type = "CREATE_SUBSCRIPTION" + subscription = self.driver.ex_create_subscription( + amount=1, period="1 month", resource="vlan" + ) self.assertEqual(subscription.amount, 1) - self.assertEqual(subscription.period, '1 month') - self.assertEqual(subscription.resource, 'vlan') - self.assertEqual(subscription.price, '10.26666666666666666666666667') + self.assertEqual(subscription.period, "1 month") + self.assertEqual(subscription.resource, "vlan") + self.assertEqual(subscription.price, "10.26666666666666666666666667") self.assertEqual(subscription.auto_renew, False) - self.assertEqual(subscription.subscribed_object, '2494079f-8376-40bf-9b37-34d633b8a7b7') + self.assertEqual(subscription.subscribed_object, "2494079f-8376-40bf-9b37-34d633b8a7b7") def test_ex_list_subscriptions_status_filterting(self): - CloudSigmaMockHttp.type = 'STATUS_FILTER' - self.driver.ex_list_subscriptions(status='active') + CloudSigmaMockHttp.type = "STATUS_FILTER" + self.driver.ex_list_subscriptions(status="active") def test_ex_list_subscriptions_resource_filterting(self): - CloudSigmaMockHttp.type = 'RESOURCE_FILTER' - resources = ['cpu', 'mem'] + CloudSigmaMockHttp.type = "RESOURCE_FILTER" + resources = ["cpu", "mem"] self.driver.ex_list_subscriptions(resources=resources) def test_ex_toggle_subscription_auto_renew(self): subscription = self.driver.ex_list_subscriptions()[0] - status = self.driver.ex_toggle_subscription_auto_renew( - subscription=subscription) + status = self.driver.ex_toggle_subscription_auto_renew(subscription=subscription) self.assertTrue(status) def test_ex_list_capabilities(self): capabilities = self.driver.ex_list_capabilities() - self.assertEqual(capabilities['servers']['cpu']['min'], 250) + self.assertEqual(capabilities["servers"]["cpu"]["min"], 250) def test_ex_list_servers_availability_groups(self): groups = self.driver.ex_list_servers_availability_groups() @@ -407,240 +448,335 @@ def test_ex_list_drives_availability_groups(self): self.assertEqual(len(groups), 1) self.assertEqual(len(groups[0]), 11) + def test_ex_attach_drive(self): + node_id = "3df825cb-9c1b-470d-acbd-03e1a966c046" + node = self.driver.ex_get_node(node_id) + drives = self.driver.ex_list_user_drives() + drive = drives[0] + response = self.driver.ex_attach_drive(node, drive) + self.assertTrue(response) + + def test_ex_detach_drive(self): + node_id = "3df825cb-9c1b-470d-acbd-03e1a966c046" + node = self.driver.ex_get_node(node_id) + drives = self.driver.ex_list_user_drives() + drive = drives[0] + response = self.driver.ex_detach_drive(node, drive) + self.assertTrue(response) + def test_wait_for_drive_state_transition_timeout(self): drive = self.driver.ex_list_user_drives()[0] - state = 'timeout' - - expected_msg = 'Timed out while waiting for drive transition' - self.assertRaisesRegexp(Exception, expected_msg, - self.driver._wait_for_drive_state_transition, - drive=drive, state=state, - timeout=0.5) + state = "timeout" + + expected_msg = "Timed out while waiting for drive transition" + assertRaisesRegex( + self, + Exception, + expected_msg, + self.driver._wait_for_drive_state_transition, + drive=drive, + state=state, + timeout=0.5, + ) def test_wait_for_drive_state_transition_success(self): drive = self.driver.ex_list_user_drives()[0] - state = 'unmounted' + state = "unmounted" - drive = self.driver._wait_for_drive_state_transition(drive=drive, - state=state, - timeout=0.5) + drive = self.driver._wait_for_drive_state_transition(drive=drive, state=state, timeout=0.5) self.assertEqual(drive.status, state) + def test_list_key_pairs(self): + keys = self.driver.list_key_pairs() + + key = keys[0] + self.assertEqual(len(keys), 2) + self.assertEqual(key.name, "ala") + self.assertEqual(key.fingerprint, "8c:71:a2:f0:bc:a4:45:66:a8:59:77:6d:80:d5:a0:89") + self.assertEqual(key.extra["uuid"], "186106ac-afb5-40e5-a0de-6f0feba5a3d5") -class CloudSigmaAPI20DirectTestCase(CloudSigmaAPI20BaseTestCase, - unittest.TestCase): + def test_import_key_pair_from_string(self): + public_key = self.driver.list_key_pairs()[0].public_key + key = self.driver.import_key_pair_from_string("test_key", public_key) + self.assertEqual(key.name, "test_key") + self.assertIsNone(key.private_key) + self.assertEqual(key.extra["uuid"], "6d7db550-d1c5-4e3b-9c0a-e83f6a2b8244") + self.assertEqual(key.public_key, public_key) + + def test_get_key_pair(self): + uuid = self.driver.list_key_pairs()[0].extra["uuid"] + key = self.driver.get_key_pair(uuid) + self.assertEqual(key.name, "ala") + self.assertEqual(key.extra["uuid"], "186106ac-afb5-40e5-a0de-6f0feba5a3d5") + + def test_delete_key_pair(self): + key = self.driver.list_key_pairs()[0] + response = self.driver.delete_key_pair(key) + self.assertTrue(response) + + +class CloudSigmaAPI20DirectTestCase(CloudSigmaAPI20BaseTestCase, unittest.TestCase): driver_klass = CloudSigma_2_0_NodeDriver - driver_args = ('foo', 'bar') + driver_args = ("foo", "bar") driver_kwargs = {} -class CloudSigmaAPI20IndirectTestCase(CloudSigmaAPI20BaseTestCase, - unittest.TestCase): +class CloudSigmaAPI20IndirectTestCase(CloudSigmaAPI20BaseTestCase, unittest.TestCase): driver_klass = CloudSigmaNodeDriver - driver_args = ('foo', 'bar') - driver_kwargs = {'api_version': '2.0'} + driver_args = ("foo", "bar") + driver_kwargs = {"api_version": "2.0"} -class CloudSigmaMockHttp(MockHttpTestCase): - fixtures = ComputeFileFixtures('cloudsigma_2_0') +class CloudSigmaMockHttp(MockHttp, unittest.TestCase): + fixtures = ComputeFileFixtures("cloudsigma_2_0") def _api_2_0_servers_detail_INVALID_CREDS(self, method, url, body, headers): - body = self.fixtures.load('libdrives.json') - return (httplib.UNAUTHORIZED, body, {}, - httplib.responses[httplib.UNAUTHORIZED]) + body = self.fixtures.load("libdrives.json") + return (httplib.UNAUTHORIZED, body, {}, httplib.responses[httplib.UNAUTHORIZED]) def _api_2_0_libdrives(self, method, url, body, headers): - body = self.fixtures.load('libdrives.json') + body = self.fixtures.load("libdrives.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_servers_detail(self, method, url, body, headers): - body = self.fixtures.load('servers_detail_mixed_state.json') + body = self.fixtures.load("servers_detail_mixed_state.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911(self, method, url, body, headers): - body = '' + body = "" return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _api_2_0_servers(self, method, url, body, headers): - if method == 'POST': + if method == "POST": # create_node parsed = json.loads(body) - if 'vlan' in parsed['name']: - self.assertEqual(len(parsed['nics']), 2) - body = self.fixtures.load('servers_create_with_vlan.json') + if "vlan" in parsed["name"]: + self.assertEqual(len(parsed["nics"]), 2) + body = self.fixtures.load("servers_create_with_vlan.json") else: - body = self.fixtures.load('servers_create.json') + body = self.fixtures.load("servers_create.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) - def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_start(self, method, url, body, headers): - body = self.fixtures.load('start_success.json') + def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_start( + self, method, url, body, headers + ): + body = self.fixtures.load("start_success.json") return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_AVOID_MODE_start(self, method, url, body, headers): - self.assertUrlContainsQueryParams(url, {'avoid': '1,2'}) + def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_AVOID_MODE_start( + self, method, url, body, headers + ): + self.assertUrlContainsQueryParams(url, {"avoid": "1,2"}) - body = self.fixtures.load('start_success.json') + body = self.fixtures.load("start_success.json") return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_ALREADY_STARTED_start(self, method, url, body, headers): - body = self.fixtures.load('start_already_started.json') + def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_ALREADY_STARTED_start( + self, method, url, body, headers + ): + body = self.fixtures.load("start_already_started.json") return (httplib.FORBIDDEN, body, {}, httplib.responses[httplib.FORBIDDEN]) - def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_stop(self, method, url, body, headers): - body = self.fixtures.load('stop_success.json') + def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_stop( + self, method, url, body, headers + ): + body = self.fixtures.load("stop_success.json") return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_ALREADY_STOPPED_stop(self, method, url, body, headers): - body = self.fixtures.load('stop_already_stopped.json') + def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_ALREADY_STOPPED_stop( + self, method, url, body, headers + ): + body = self.fixtures.load("stop_already_stopped.json") return (httplib.FORBIDDEN, body, {}, httplib.responses[httplib.FORBIDDEN]) - def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_clone(self, method, url, body, headers): - body = self.fixtures.load('servers_clone.json') + def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_clone( + self, method, url, body, headers + ): + body = self.fixtures.load("servers_clone.json") return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_open_vnc(self, method, url, body, headers): - body = self.fixtures.load('servers_open_vnc.json') + def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_open_vnc( + self, method, url, body, headers + ): + body = self.fixtures.load("servers_open_vnc.json") return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_close_vnc(self, method, url, body, headers): - body = self.fixtures.load('servers_close_vnc.json') + def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_action_close_vnc( + self, method, url, body, headers + ): + body = self.fixtures.load("servers_close_vnc.json") return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) + def _api_2_0_servers_3df825cb_9c1b_470d_acbd_03e1a966c046(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("servers_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "PUT": + body = "" + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + def _api_2_0_drives_detail(self, method, url, body, headers): - body = self.fixtures.load('drives_detail.json') + body = self.fixtures.load("drives_detail.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_drives_b02311e2_a83c_4c12_af10_b30d51c86913(self, method, url, body, headers): - body = self.fixtures.load('drives_get.json') + body = self.fixtures.load("drives_get.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_drives_9d1d2cf3_08c1_462f_8485_f4b073560809(self, method, url, body, headers): - body = self.fixtures.load('drives_get.json') + body = self.fixtures.load("drives_get.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_drives_CREATE(self, method, url, body, headers): - body = self.fixtures.load('drives_create.json') + body = self.fixtures.load("drives_create.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) - def _api_2_0_drives_9d1d2cf3_08c1_462f_8485_f4b073560809_action_clone(self, method, url, body, headers): - body = self.fixtures.load('drives_clone.json') + def _api_2_0_drives_9d1d2cf3_08c1_462f_8485_f4b073560809_action_clone( + self, method, url, body, headers + ): + body = self.fixtures.load("drives_clone.json") return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - def _api_2_0_drives_5236b9ee_f735_42fd_a236_17558f9e12d3_action_clone(self, method, url, body, headers): - body = self.fixtures.load('drives_clone.json') + def _api_2_0_drives_5236b9ee_f735_42fd_a236_17558f9e12d3_action_clone( + self, method, url, body, headers + ): + body = self.fixtures.load("drives_clone.json") return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - def _api_2_0_drives_b02311e2_a83c_4c12_af10_b30d51c86913_action_resize(self, method, url, body, headers): - body = self.fixtures.load('drives_resize.json') + def _api_2_0_drives_b02311e2_a83c_4c12_af10_b30d51c86913_action_resize( + self, method, url, body, headers + ): + body = self.fixtures.load("drives_resize.json") return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - def _api_2_0_drives_9d1d2cf3_08c1_462f_8485_f4b073560809_action_resize(self, method, url, body, headers): - body = self.fixtures.load('drives_resize.json') + def _api_2_0_drives_9d1d2cf3_08c1_462f_8485_f4b073560809_action_resize( + self, method, url, body, headers + ): + body = self.fixtures.load("drives_resize.json") return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) def _api_2_0_fwpolicies_detail(self, method, url, body, headers): - body = self.fixtures.load('fwpolicies_detail.json') + body = self.fixtures.load("fwpolicies_detail.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_fwpolicies_CREATE_NO_RULES(self, method, url, body, headers): - body = self.fixtures.load('fwpolicies_create_no_rules.json') + body = self.fixtures.load("fwpolicies_create_no_rules.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _api_2_0_fwpolicies_CREATE_WITH_RULES(self, method, url, body, headers): - body = self.fixtures.load('fwpolicies_create_with_rules.json') + body = self.fixtures.load("fwpolicies_create_with_rules.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) - def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_ATTACH_POLICY(self, method, url, body, headers): - body = self.fixtures.load('servers_attach_policy.json') + def _api_2_0_servers_9de75ed6_fd33_45e2_963f_d405f31fd911_ATTACH_POLICY( + self, method, url, body, headers + ): + body = self.fixtures.load("servers_attach_policy.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _api_2_0_fwpolicies_0e339282_0cb5_41ac_a9db_727fb62ff2dc(self, method, url, body, headers): - if method == 'DELETE': - body = '' - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + if method == "DELETE": + body = "" + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _api_2_0_tags_detail(self, method, url, body, headers): - body = self.fixtures.load('tags_detail.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + raise AssertionError("Tag collection must use /tags/ rather than /tags/detail/") def _api_2_0_tags(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('tags_create.json') + if method == "GET": + assert url.split("?")[0].rstrip("/") == "/api/2.0/tags" + body = self.fixtures.load("tags_detail.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "POST": + body = self.fixtures.load("tags_create.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _api_2_0_tags_WITH_RESOURCES(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('tags_create_with_resources.json') + if method == "POST": + body = self.fixtures.load("tags_create_with_resources.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _api_2_0_tags_a010ec41_2ead_4630_a1d0_237fa77e4d4d(self, method, url, body, headers): - if method == 'GET': + if method == "GET": # ex_get_tag - body = self.fixtures.load('tags_get.json') + body = self.fixtures.load("tags_get.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - elif method == 'PUT': + elif method == "PUT": # ex_tag_resource - body = self.fixtures.load('tags_update.json') + body = self.fixtures.load("tags_update.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - elif method == 'DELETE': + elif method == "DELETE": # ex_delete_tag - body = '' - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + body = "" + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _api_2_0_balance(self, method, url, body, headers): - body = self.fixtures.load('balance.json') + body = self.fixtures.load("balance.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_pricing(self, method, url, body, headers): - body = self.fixtures.load('pricing.json') + body = self.fixtures.load("pricing.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_currentusage(self, method, url, body, headers): - body = self.fixtures.load('currentusage.json') + body = self.fixtures.load("currentusage.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_subscriptions(self, method, url, body, headers): - body = self.fixtures.load('subscriptions.json') + body = self.fixtures.load("subscriptions.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_subscriptions_STATUS_FILTER(self, method, url, body, headers): - self.assertUrlContainsQueryParams(url, {'status': 'active'}) + self.assertUrlContainsQueryParams(url, {"status": "active"}) - body = self.fixtures.load('subscriptions.json') + body = self.fixtures.load("subscriptions.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_subscriptions_RESOURCE_FILTER(self, method, url, body, headers): - expected_params = {'resource': 'cpu,mem', 'status': 'all'} + expected_params = {"resource": "cpu,mem", "status": "all"} self.assertUrlContainsQueryParams(url, expected_params) - body = self.fixtures.load('subscriptions.json') + body = self.fixtures.load("subscriptions.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_subscriptions_7272_action_auto_renew(self, method, url, body, headers): - body = '' + body = "" return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_subscriptions_CREATE_SUBSCRIPTION(self, method, url, body, headers): - body = self.fixtures.load('create_subscription.json') + body = self.fixtures.load("create_subscription.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_capabilities(self, method, url, body, headers): - body = self.fixtures.load('capabilities.json') + body = self.fixtures.load("capabilities.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_servers_availability_groups(self, method, url, body, headers): - body = self.fixtures.load('servers_avail_groups.json') + body = self.fixtures.load("servers_avail_groups.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _api_2_0_drives_availability_groups(self, method, url, body, headers): - body = self.fixtures.load('drives_avail_groups.json') + body = self.fixtures.load("drives_avail_groups.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + def _api_2_0_keypairs(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("keypairs_list.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "POST": + body = self.fixtures.load("keypairs_import.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + + def _api_2_0_keypairs_186106ac_afb5_40e5_a0de_6f0feba5a3d5(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("keypairs_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "DELETE": + body = "" + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_cloudstack.py b/libcloud/test/compute/test_cloudstack.py index 2e4930fb1a..6f9907d6e7 100644 --- a/libcloud/test/compute/test_cloudstack.py +++ b/libcloud/test/compute/test_cloudstack.py @@ -13,182 +13,190 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys import os +import sys -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlparse -from libcloud.utils.py3 import parse_qsl +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import httplib, urlparse, parse_qsl, assertRaisesRegex +from libcloud.common.types import ProviderError +from libcloud.compute.base import NodeSize, NodeImage, NodeLocation +from libcloud.test.compute import TestCaseMixin +from libcloud.compute.types import ( + Provider, + NodeState, + LibcloudError, + InvalidCredsError, + KeyPairDoesNotExistError, +) +from libcloud.compute.providers import get_driver +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.cloudstack import CloudStackNodeDriver, CloudStackAffinityGroupType try: import simplejson as json except ImportError: import json -from libcloud.common.types import ProviderError -from libcloud.compute.drivers.cloudstack import CloudStackNodeDriver, \ - CloudStackAffinityGroupType -from libcloud.compute.types import LibcloudError, Provider, InvalidCredsError -from libcloud.compute.types import KeyPairDoesNotExistError -from libcloud.compute.types import NodeState -from libcloud.compute.providers import get_driver - -from libcloud.test import unittest -from libcloud.test import MockHttpTestCase -from libcloud.test.compute import TestCaseMixin -from libcloud.test.file_fixtures import ComputeFileFixtures - class CloudStackCommonTestCase(TestCaseMixin): driver_klass = CloudStackNodeDriver def setUp(self): - self.driver_klass.connectionCls.conn_classes = \ - (None, CloudStackMockHttp) - self.driver = self.driver_klass('apikey', 'secret', - path='/test/path', - host='api.dummy.com') - self.driver.path = '/test/path' + self.driver_klass.connectionCls.conn_class = CloudStackMockHttp + self.driver = self.driver_klass("apikey", "secret", path="/test/path", host="api.dummy.com") + self.driver.path = "/test/path" self.driver.type = -1 CloudStackMockHttp.type = None - CloudStackMockHttp.fixture_tag = 'default' + CloudStackMockHttp.fixture_tag = "default" self.driver.connection.poll_interval = 0.0 def test_invalid_credentials(self): - CloudStackMockHttp.type = 'invalid_credentials' - driver = self.driver_klass('invalid', 'invalid', path='/test/path', - host='api.dummy.com') + CloudStackMockHttp.type = "invalid_credentials" + driver = self.driver_klass("invalid", "invalid", path="/test/path", host="api.dummy.com") self.assertRaises(InvalidCredsError, driver.list_nodes) def test_import_keypair_from_string_api_error(self): - CloudStackMockHttp.type = 'api_error' + CloudStackMockHttp.type = "api_error" - name = 'test-pair' - key_material = '' + name = "test-pair" + key_material = "" - expected_msg = 'Public key is invalid' - self.assertRaisesRegexp(ProviderError, expected_msg, - self.driver.import_key_pair_from_string, - name=name, key_material=key_material) + expected_msg = "Public key is invalid" + assertRaisesRegex( + self, + ProviderError, + expected_msg, + self.driver.import_key_pair_from_string, + name=name, + key_material=key_material, + ) def test_create_node_immediate_failure(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] - CloudStackMockHttp.fixture_tag = 'deployfail' + CloudStackMockHttp.fixture_tag = "deployfail" self.assertRaises( - Exception, - self.driver.create_node, - name='node-name', image=image, size=size) + Exception, self.driver.create_node, name="node-name", image=image, size=size + ) def test_create_node_delayed_failure(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] - CloudStackMockHttp.fixture_tag = 'deployfail2' + CloudStackMockHttp.fixture_tag = "deployfail2" self.assertRaises( - Exception, - self.driver.create_node, - name='node-name', image=image, size=size) + Exception, self.driver.create_node, name="node-name", image=image, size=size + ) def test_create_node_default_location_success(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] default_location = self.driver.list_locations()[0] - node = self.driver.create_node(name='fred', - image=image, - size=size) + node = self.driver.create_node(name="fred", image=image, size=size) - self.assertEqual(node.name, 'fred') + self.assertEqual(node.name, "fred") self.assertEqual(node.public_ips, []) - self.assertEqual(node.private_ips, ['192.168.1.2']) - self.assertEqual(node.extra['zone_id'], default_location.id) + self.assertEqual(node.private_ips, ["192.168.1.2"]) + self.assertEqual(node.extra["zone_id"], default_location.id) def test_create_node_ex_networks(self): - CloudStackMockHttp.fixture_tag = 'deploynetworks' + CloudStackMockHttp.fixture_tag = "deploynetworks" size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] location = self.driver.list_locations()[0] - networks = [nw for nw in self.driver.ex_list_networks() - if str(nw.zoneid) == str(location.id)] - - node = self.driver.create_node(name='deploynetworks', - location=location, - image=image, - size=size, - networks=networks) - self.assertEqual(node.name, 'deploynetworks') - self.assertEqual(node.extra['size_id'], size.id) - self.assertEqual(node.extra['zone_id'], location.id) - self.assertEqual(node.extra['image_id'], image.id) + networks = [ + nw for nw in self.driver.ex_list_networks() if str(nw.zoneid) == str(location.id) + ] + + node = self.driver.create_node( + name="deploynetworks", + location=location, + image=image, + size=size, + networks=networks, + ) + self.assertEqual(node.name, "deploynetworks") + self.assertEqual(node.extra["size_id"], size.id) + self.assertEqual(node.extra["zone_id"], location.id) + self.assertEqual(node.extra["image_id"], image.id) self.assertEqual(len(node.private_ips), 2) def test_create_node_ex_ipaddress(self): - CloudStackMockHttp.fixture_tag = 'deployip' + CloudStackMockHttp.fixture_tag = "deployip" size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] location = self.driver.list_locations()[0] - ipaddress = '10.1.0.128' - - networks = [nw for nw in self.driver.ex_list_networks() - if str(nw.zoneid) == str(location.id)] - - node = self.driver.create_node(name='deployip', - location=location, - image=image, - size=size, - networks=networks, - ex_ip_address=ipaddress) - self.assertEqual(node.name, 'deployip') - self.assertEqual(node.extra['size_id'], size.id) - self.assertEqual(node.extra['zone_id'], location.id) - self.assertEqual(node.extra['image_id'], image.id) + ipaddress = "10.1.0.128" + + networks = [ + nw for nw in self.driver.ex_list_networks() if str(nw.zoneid) == str(location.id) + ] + + node = self.driver.create_node( + name="deployip", + location=location, + image=image, + size=size, + networks=networks, + ex_ip_address=ipaddress, + ) + self.assertEqual(node.name, "deployip") + self.assertEqual(node.extra["size_id"], size.id) + self.assertEqual(node.extra["zone_id"], location.id) + self.assertEqual(node.extra["image_id"], image.id) self.assertEqual(node.private_ips[0], ipaddress) def test_create_node_ex_rootdisksize(self): - CloudStackMockHttp.fixture_tag = 'rootdisksize' + CloudStackMockHttp.fixture_tag = "rootdisksize" size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] location = self.driver.list_locations()[0] volumes = self.driver.list_volumes() - rootdisksize = '50' - - networks = [nw for nw in self.driver.ex_list_networks() - if str(nw.zoneid) == str(location.id)] - - node = self.driver.create_node(name='rootdisksize', - location=location, - image=image, - size=size, - networks=networks, - ex_rootdisksize=rootdisksize) - self.assertEqual(node.name, 'rootdisksize') - self.assertEqual(node.extra['size_id'], size.id) - self.assertEqual(node.extra['zone_id'], location.id) - self.assertEqual(node.extra['image_id'], image.id) + rootdisksize = "50" + + networks = [ + nw for nw in self.driver.ex_list_networks() if str(nw.zoneid) == str(location.id) + ] + + node = self.driver.create_node( + name="rootdisksize", + location=location, + image=image, + size=size, + networks=networks, + ex_rootdisksize=rootdisksize, + ) + self.assertEqual(node.name, "rootdisksize") + self.assertEqual(node.extra["size_id"], size.id) + self.assertEqual(node.extra["zone_id"], location.id) + self.assertEqual(node.extra["image_id"], image.id) self.assertEqual(1, len(volumes)) - self.assertEqual('ROOT-69941', volumes[0].name) + self.assertEqual("ROOT-69941", volumes[0].name) self.assertEqual(53687091200, volumes[0].size) def test_create_node_ex_start_vm_false(self): - CloudStackMockHttp.fixture_tag = 'stoppedvm' + CloudStackMockHttp.fixture_tag = "stoppedvm" size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] location = self.driver.list_locations()[0] - networks = [nw for nw in self.driver.ex_list_networks() - if str(nw.zoneid) == str(location.id)] + networks = [ + nw for nw in self.driver.ex_list_networks() if str(nw.zoneid) == str(location.id) + ] - node = self.driver.create_node(name='stopped_vm', - location=location, - image=image, - size=size, - networks=networks, - ex_start_vm=False) - self.assertEqual(node.name, 'stopped_vm') - self.assertEqual(node.extra['size_id'], size.id) - self.assertEqual(node.extra['zone_id'], location.id) - self.assertEqual(node.extra['image_id'], image.id) + node = self.driver.create_node( + name="stopped_vm", + location=location, + image=image, + size=size, + networks=networks, + ex_start_vm=False, + ) + self.assertEqual(node.name, "stopped_vm") + self.assertEqual(node.extra["size_id"], size.id) + self.assertEqual(node.extra["zone_id"], location.id) + self.assertEqual(node.extra["image_id"], image.id) self.assertEqual(node.state, NodeState.STOPPED) @@ -196,61 +204,69 @@ def test_create_node_ex_security_groups(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] location = self.driver.list_locations()[0] - sg = [sg['name'] for sg in self.driver.ex_list_security_groups()] - CloudStackMockHttp.fixture_tag = 'deploysecuritygroup' - node = self.driver.create_node(name='test', - location=location, - image=image, - size=size, - ex_security_groups=sg) - self.assertEqual(node.name, 'test') - self.assertEqual(node.extra['security_group'], sg) - self.assertEqual(node.id, 'fc4fd31a-16d3-49db-814a-56b39b9ef986') + sg = [sg["name"] for sg in self.driver.ex_list_security_groups()] + CloudStackMockHttp.fixture_tag = "deploysecuritygroup" + node = self.driver.create_node( + name="test", + location=location, + image=image, + size=size, + ex_security_groups=sg, + ) + self.assertEqual(node.name, "test") + self.assertEqual(node.extra["security_group"], sg) + self.assertEqual(node.id, "fc4fd31a-16d3-49db-814a-56b39b9ef986") def test_create_node_ex_keyname(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] location = self.driver.list_locations()[0] - CloudStackMockHttp.fixture_tag = 'deploykeyname' - node = self.driver.create_node(name='test', - location=location, - image=image, - size=size, - ex_keyname='foobar') - self.assertEqual(node.name, 'test') - self.assertEqual(node.extra['key_name'], 'foobar') + CloudStackMockHttp.fixture_tag = "deploykeyname" + node = self.driver.create_node( + name="test", location=location, image=image, size=size, ex_keyname="foobar" + ) + self.assertEqual(node.name, "test") + self.assertEqual(node.extra["key_name"], "foobar") + + def test_create_node_ex_userdata(self): + self.driver.path = "/test/path/userdata" + size = self.driver.list_sizes()[0] + image = self.driver.list_images()[0] + location = self.driver.list_locations()[0] + CloudStackMockHttp.fixture_tag = "deploykeyname" + node = self.driver.create_node( + name="test", location=location, image=image, size=size, ex_userdata="foobar" + ) + self.assertEqual(node.name, "test") def test_create_node_project(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] location = self.driver.list_locations()[0] project = self.driver.ex_list_projects()[0] - CloudStackMockHttp.fixture_tag = 'deployproject' - node = self.driver.create_node(name='test', - location=location, - image=image, - size=size, - project=project) - self.assertEqual(node.name, 'TestNode') - self.assertEqual(node.extra['project'], 'Test Project') + CloudStackMockHttp.fixture_tag = "deployproject" + node = self.driver.create_node( + name="test", location=location, image=image, size=size, project=project + ) + self.assertEqual(node.name, "TestNode") + self.assertEqual(node.extra["project"], "Test Project") def test_list_images_no_images_available(self): - CloudStackMockHttp.fixture_tag = 'notemplates' + CloudStackMockHttp.fixture_tag = "notemplates" images = self.driver.list_images() self.assertEqual(0, len(images)) def test_list_images(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'listTemplates_default.json') - templates = fixture['listtemplatesresponse']['template'] + _, fixture = self.driver.connection.connection._load_fixture("listTemplates_default.json") + templates = fixture["listtemplatesresponse"]["template"] images = self.driver.list_images() for i, image in enumerate(images): # NodeImage expects id to be a string, # the CloudStack fixture has an int - tid = str(templates[i]['id']) - tname = templates[i]['name'] + tid = str(templates[i]["id"]) + tname = templates[i]["name"] self.assertIsInstance(image.driver, CloudStackNodeDriver) self.assertEqual(image.id, tid) self.assertEqual(image.name, tname) @@ -259,110 +275,94 @@ def test_ex_list_disk_offerings(self): diskOfferings = self.driver.ex_list_disk_offerings() self.assertEqual(1, len(diskOfferings)) - diskOffering, = diskOfferings + (diskOffering,) = diskOfferings - self.assertEqual('Disk offer 1', diskOffering.name) + self.assertEqual("Disk offer 1", diskOffering.name) self.assertEqual(10, diskOffering.size) def test_ex_list_networks(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'listNetworks_default.json') - fixture_networks = fixture['listnetworksresponse']['network'] + _, fixture = self.driver.connection.connection._load_fixture("listNetworks_default.json") + fixture_networks = fixture["listnetworksresponse"]["network"] networks = self.driver.ex_list_networks() for i, network in enumerate(networks): - self.assertEqual(network.id, fixture_networks[i]['id']) - self.assertEqual( - network.displaytext, fixture_networks[i]['displaytext']) - self.assertEqual(network.name, fixture_networks[i]['name']) - self.assertEqual( - network.networkofferingid, - fixture_networks[i]['networkofferingid']) - self.assertEqual(network.zoneid, fixture_networks[i]['zoneid']) + self.assertEqual(network.id, fixture_networks[i]["id"]) + self.assertEqual(network.displaytext, fixture_networks[i]["displaytext"]) + self.assertEqual(network.name, fixture_networks[i]["name"]) + self.assertEqual(network.networkofferingid, fixture_networks[i]["networkofferingid"]) + self.assertEqual(network.zoneid, fixture_networks[i]["zoneid"]) def test_ex_list_network_offerings(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'listNetworkOfferings_default.json') - fixture_networkoffers = \ - fixture['listnetworkofferingsresponse']['networkoffering'] + _, fixture = self.driver.connection.connection._load_fixture( + "listNetworkOfferings_default.json" + ) + fixture_networkoffers = fixture["listnetworkofferingsresponse"]["networkoffering"] networkoffers = self.driver.ex_list_network_offerings() for i, networkoffer in enumerate(networkoffers): - self.assertEqual(networkoffer.id, fixture_networkoffers[i]['id']) - self.assertEqual(networkoffer.name, - fixture_networkoffers[i]['name']) - self.assertEqual(networkoffer.display_text, - fixture_networkoffers[i]['displaytext']) - self.assertEqual(networkoffer.for_vpc, - fixture_networkoffers[i]['forvpc']) - self.assertEqual(networkoffer.guest_ip_type, - fixture_networkoffers[i]['guestiptype']) - self.assertEqual(networkoffer.service_offering_id, - fixture_networkoffers[i]['serviceofferingid']) + self.assertEqual(networkoffer.id, fixture_networkoffers[i]["id"]) + self.assertEqual(networkoffer.name, fixture_networkoffers[i]["name"]) + self.assertEqual(networkoffer.display_text, fixture_networkoffers[i]["displaytext"]) + self.assertEqual(networkoffer.for_vpc, fixture_networkoffers[i]["forvpc"]) + self.assertEqual(networkoffer.guest_ip_type, fixture_networkoffers[i]["guestiptype"]) + self.assertEqual( + networkoffer.service_offering_id, + fixture_networkoffers[i]["serviceofferingid"], + ) def test_ex_create_network(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'createNetwork_default.json') + _, fixture = self.driver.connection.connection._load_fixture("createNetwork_default.json") - fixture_network = fixture['createnetworkresponse']['network'] + fixture_network = fixture["createnetworkresponse"]["network"] netoffer = self.driver.ex_list_network_offerings()[0] location = self.driver.list_locations()[0] - network = self.driver.ex_create_network(display_text='test', - name='test', - network_offering=netoffer, - location=location, - gateway='10.1.1.1', - netmask='255.255.255.0', - network_domain='cloud.local', - vpc_id="2", - project_id="2") - - self.assertEqual(network.name, fixture_network['name']) - self.assertEqual(network.displaytext, fixture_network['displaytext']) - self.assertEqual(network.id, fixture_network['id']) - self.assertEqual(network.extra['gateway'], fixture_network['gateway']) - self.assertEqual(network.extra['netmask'], fixture_network['netmask']) - self.assertEqual(network.networkofferingid, - fixture_network['networkofferingid']) - self.assertEqual(network.extra['vpc_id'], fixture_network['vpcid']) - self.assertEqual(network.extra['project_id'], - fixture_network['projectid']) + network = self.driver.ex_create_network( + display_text="test", + name="test", + network_offering=netoffer, + location=location, + gateway="10.1.1.1", + netmask="255.255.255.0", + network_domain="cloud.local", + vpc_id="2", + project_id="2", + ) + + self.assertEqual(network.name, fixture_network["name"]) + self.assertEqual(network.displaytext, fixture_network["displaytext"]) + self.assertEqual(network.id, fixture_network["id"]) + self.assertEqual(network.extra["gateway"], fixture_network["gateway"]) + self.assertEqual(network.extra["netmask"], fixture_network["netmask"]) + self.assertEqual(network.networkofferingid, fixture_network["networkofferingid"]) + self.assertEqual(network.extra["vpc_id"], fixture_network["vpcid"]) + self.assertEqual(network.extra["project_id"], fixture_network["projectid"]) def test_ex_delete_network(self): - network = self.driver.ex_list_networks()[0] result = self.driver.ex_delete_network(network=network) self.assertTrue(result) def test_ex_list_nics(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'listNics_default.json') + _, fixture = self.driver.connection.connection._load_fixture("listNics_default.json") - fixture_nic = fixture['listnicsresponse']['nic'] + fixture_nic = fixture["listnicsresponse"]["nic"] vm = self.driver.list_nodes()[0] nics = self.driver.ex_list_nics(vm) for i, nic in enumerate(nics): - self.assertEqual(nic.id, fixture_nic[i]['id']) - self.assertEqual(nic.network_id, - fixture_nic[i]['networkid']) - self.assertEqual(nic.net_mask, - fixture_nic[i]['netmask']) - self.assertEqual(nic.gateway, - fixture_nic[i]['gateway']) - self.assertEqual(nic.ip_address, - fixture_nic[i]['ipaddress']) - self.assertEqual(nic.is_default, - fixture_nic[i]['isdefault']) - self.assertEqual(nic.mac_address, - fixture_nic[i]['macaddress']) + self.assertEqual(nic.id, fixture_nic[i]["id"]) + self.assertEqual(nic.network_id, fixture_nic[i]["networkid"]) + self.assertEqual(nic.net_mask, fixture_nic[i]["netmask"]) + self.assertEqual(nic.gateway, fixture_nic[i]["gateway"]) + self.assertEqual(nic.ip_address, fixture_nic[i]["ipaddress"]) + self.assertEqual(nic.is_default, fixture_nic[i]["isdefault"]) + self.assertEqual(nic.mac_address, fixture_nic[i]["macaddress"]) def test_ex_add_nic_to_node(self): - vm = self.driver.list_nodes()[0] network = self.driver.ex_list_networks()[0] ip = "10.1.4.123" @@ -371,7 +371,6 @@ def test_ex_add_nic_to_node(self): self.assertTrue(result) def test_ex_remove_nic_from_node(self): - vm = self.driver.list_nodes()[0] nic = self.driver.ex_list_nics(node=vm)[0] @@ -379,139 +378,129 @@ def test_ex_remove_nic_from_node(self): self.assertTrue(result) def test_ex_list_vpc_offerings(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'listVPCOfferings_default.json') - fixture_vpcoffers = \ - fixture['listvpcofferingsresponse']['vpcoffering'] + _, fixture = self.driver.connection.connection._load_fixture( + "listVPCOfferings_default.json" + ) + fixture_vpcoffers = fixture["listvpcofferingsresponse"]["vpcoffering"] vpcoffers = self.driver.ex_list_vpc_offerings() for i, vpcoffer in enumerate(vpcoffers): - self.assertEqual(vpcoffer.id, fixture_vpcoffers[i]['id']) - self.assertEqual(vpcoffer.name, - fixture_vpcoffers[i]['name']) - self.assertEqual(vpcoffer.display_text, - fixture_vpcoffers[i]['displaytext']) + self.assertEqual(vpcoffer.id, fixture_vpcoffers[i]["id"]) + self.assertEqual(vpcoffer.name, fixture_vpcoffers[i]["name"]) + self.assertEqual(vpcoffer.display_text, fixture_vpcoffers[i]["displaytext"]) def test_ex_list_vpcs(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'listVPCs_default.json') - fixture_vpcs = fixture['listvpcsresponse']['vpc'] + _, fixture = self.driver.connection.connection._load_fixture("listVPCs_default.json") + fixture_vpcs = fixture["listvpcsresponse"]["vpc"] vpcs = self.driver.ex_list_vpcs() for i, vpc in enumerate(vpcs): - self.assertEqual(vpc.id, fixture_vpcs[i]['id']) - self.assertEqual(vpc.display_text, fixture_vpcs[i]['displaytext']) - self.assertEqual(vpc.name, fixture_vpcs[i]['name']) - self.assertEqual(vpc.vpc_offering_id, - fixture_vpcs[i]['vpcofferingid']) - self.assertEqual(vpc.zone_id, fixture_vpcs[i]['zoneid']) + self.assertEqual(vpc.id, fixture_vpcs[i]["id"]) + self.assertEqual(vpc.display_text, fixture_vpcs[i]["displaytext"]) + self.assertEqual(vpc.name, fixture_vpcs[i]["name"]) + self.assertEqual(vpc.vpc_offering_id, fixture_vpcs[i]["vpcofferingid"]) + self.assertEqual(vpc.zone_id, fixture_vpcs[i]["zoneid"]) def test_ex_list_routers(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'listRouters_default.json') - fixture_routers = fixture['listroutersresponse']['router'] + _, fixture = self.driver.connection.connection._load_fixture("listRouters_default.json") + fixture_routers = fixture["listroutersresponse"]["router"] routers = self.driver.ex_list_routers() for i, router in enumerate(routers): - self.assertEqual(router.id, fixture_routers[i]['id']) - self.assertEqual(router.name, fixture_routers[i]['name']) - self.assertEqual(router.state, fixture_routers[i]['state']) - self.assertEqual(router.public_ip, fixture_routers[i]['publicip']) - self.assertEqual(router.vpc_id, fixture_routers[i]['vpcid']) + self.assertEqual(router.id, fixture_routers[i]["id"]) + self.assertEqual(router.name, fixture_routers[i]["name"]) + self.assertEqual(router.state, fixture_routers[i]["state"]) + self.assertEqual(router.public_ip, fixture_routers[i]["publicip"]) + self.assertEqual(router.vpc_id, fixture_routers[i]["vpcid"]) def test_ex_create_vpc(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'createVPC_default.json') + _, fixture = self.driver.connection.connection._load_fixture("createVPC_default.json") - fixture_vpc = fixture['createvpcresponse'] + fixture_vpc = fixture["createvpcresponse"] vpcoffer = self.driver.ex_list_vpc_offerings()[0] - vpc = self.driver.ex_create_vpc(cidr='10.1.1.0/16', - display_text='cloud.local', - name='cloud.local', - vpc_offering=vpcoffer, - zone_id="2") + vpc = self.driver.ex_create_vpc( + cidr="10.1.1.0/16", + display_text="cloud.local", + name="cloud.local", + vpc_offering=vpcoffer, + zone_id="2", + ) - self.assertEqual(vpc.id, fixture_vpc['id']) + self.assertEqual(vpc.id, fixture_vpc["id"]) def test_ex_delete_vpc(self): - vpc = self.driver.ex_list_vpcs()[0] result = self.driver.ex_delete_vpc(vpc=vpc) self.assertTrue(result) def test_ex_create_network_acllist(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'createNetworkACLList_default.json') + _, fixture = self.driver.connection.connection._load_fixture( + "createNetworkACLList_default.json" + ) - fixture_network_acllist = fixture['createnetworkacllistresponse'] + fixture_network_acllist = fixture["createnetworkacllistresponse"] vpc = self.driver.ex_list_vpcs()[0] network_acllist = self.driver.ex_create_network_acllist( - name='test_acllist', - vpc_id=vpc.id, - description='test description') + name="test_acllist", vpc_id=vpc.id, description="test description" + ) - self.assertEqual(network_acllist.id, fixture_network_acllist['id']) + self.assertEqual(network_acllist.id, fixture_network_acllist["id"]) def test_ex_list_network_acllist(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'listNetworkACLLists_default.json') - fixture_acllist = \ - fixture['listnetworkacllistsresponse']['networkacllist'] + _, fixture = self.driver.connection.connection._load_fixture( + "listNetworkACLLists_default.json" + ) + fixture_acllist = fixture["listnetworkacllistsresponse"]["networkacllist"] acllist = self.driver.ex_list_network_acllists() for i, acllist in enumerate(acllist): - self.assertEqual(acllist.id, - fixture_acllist[i]['id']) - self.assertEqual(acllist.name, - fixture_acllist[i]['name']) - self.assertEqual(acllist.description, - fixture_acllist[i]['description']) + self.assertEqual(acllist.id, fixture_acllist[i]["id"]) + self.assertEqual(acllist.name, fixture_acllist[i]["name"]) + self.assertEqual(acllist.description, fixture_acllist[i]["description"]) def test_ex_create_network_acl(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'createNetworkACL_default.json') + _, fixture = self.driver.connection.connection._load_fixture( + "createNetworkACL_default.json" + ) - fixture_network_acllist = fixture['createnetworkaclresponse'] + fixture_network_acllist = fixture["createnetworkaclresponse"] acllist = self.driver.ex_list_network_acllists()[0] network_acl = self.driver.ex_create_network_acl( - protocol='test_acllist', + protocol="test_acllist", acl_id=acllist.id, - cidr_list='', - start_port='80', - end_port='80') + cidr_list="", + start_port="80", + end_port="80", + ) - self.assertEqual(network_acl.id, fixture_network_acllist['id']) + self.assertEqual(network_acl.id, fixture_network_acllist["id"]) def test_ex_list_projects(self): - _, fixture = CloudStackMockHttp()._load_fixture( - 'listProjects_default.json') - fixture_projects = fixture['listprojectsresponse']['project'] + _, fixture = self.driver.connection.connection._load_fixture("listProjects_default.json") + fixture_projects = fixture["listprojectsresponse"]["project"] projects = self.driver.ex_list_projects() for i, project in enumerate(projects): - self.assertEqual(project.id, fixture_projects[i]['id']) - self.assertEqual( - project.display_text, fixture_projects[i]['displaytext']) - self.assertEqual(project.name, fixture_projects[i]['name']) - self.assertEqual( - project.extra['domainid'], - fixture_projects[i]['domainid']) - self.assertEqual( - project.extra['cpulimit'], - fixture_projects[i]['cpulimit']) + self.assertEqual(project.id, fixture_projects[i]["id"]) + self.assertEqual(project.display_text, fixture_projects[i]["displaytext"]) + self.assertEqual(project.name, fixture_projects[i]["name"]) + self.assertEqual(project.extra["domainid"], fixture_projects[i]["domainid"]) + self.assertEqual(project.extra["cpulimit"], fixture_projects[i]["cpulimit"]) + # Note -1 represents unlimited + self.assertEqual(project.extra["networklimit"], -1) def test_create_volume(self): - volumeName = 'vol-0' + volumeName = "vol-0" location = self.driver.list_locations()[0] volume = self.driver.create_volume(10, volumeName, location) @@ -526,24 +515,50 @@ def test_create_volume_no_noncustomized_offering_with_size(self): location = self.driver.list_locations()[0] - self.assertRaises( - LibcloudError, - self.driver.create_volume, - 'vol-0', location, 11) + self.assertRaises(LibcloudError, self.driver.create_volume, "vol-0", location, 11) def test_create_volume_with_custom_disk_size_offering(self): - CloudStackMockHttp.fixture_tag = 'withcustomdisksize' + CloudStackMockHttp.fixture_tag = "withcustomdisksize" - volumeName = 'vol-0' + volumeName = "vol-0" location = self.driver.list_locations()[0] volume = self.driver.create_volume(10, volumeName, location) self.assertEqual(volumeName, volume.name) + def test_create_volume_no_matching_volume_type(self): + """If the ex_disk_type does not exit, then an exception should be + thrown.""" + + location = self.driver.list_locations()[0] + + self.assertRaises( + LibcloudError, + self.driver.create_volume, + "vol-0", + location, + 11, + ex_volume_type="FooVolumeType", + ) + + def test_create_volume_with_defined_volume_type(self): + CloudStackMockHttp.fixture_tag = "withvolumetype" + + volumeName = "vol-0" + volLocation = self.driver.list_locations()[0] + diskOffering = self.driver.ex_list_disk_offerings()[0] + volumeType = diskOffering.name + + volume = self.driver.create_volume( + 10, volumeName, location=volLocation, ex_volume_type=volumeType + ) + + self.assertEqual(volumeName, volume.name) + def test_attach_volume(self): node = self.driver.list_nodes()[0] - volumeName = 'vol-0' + volumeName = "vol-0" location = self.driver.list_locations()[0] volume = self.driver.create_volume(10, volumeName, location) @@ -552,14 +567,14 @@ def test_attach_volume(self): self.assertTrue(attachReturnVal) def test_detach_volume(self): - volumeName = 'gre-test-volume' + volumeName = "gre-test-volume" location = self.driver.list_locations()[0] volume = self.driver.create_volume(10, volumeName, location) res = self.driver.detach_volume(volume) self.assertTrue(res) def test_destroy_volume(self): - volumeName = 'gre-test-volume' + volumeName = "gre-test-volume" location = self.driver.list_locations()[0] volume = self.driver.create_volume(10, volumeName, location) res = self.driver.destroy_volume(volume) @@ -568,39 +583,99 @@ def test_destroy_volume(self): def test_list_volumes(self): volumes = self.driver.list_volumes() self.assertEqual(1, len(volumes)) - self.assertEqual('ROOT-69942', volumes[0].name) + self.assertEqual("ROOT-69942", volumes[0].name) + + def test_ex_get_volume(self): + volume = self.driver.ex_get_volume(2600) + self.assertEqual("ROOT-69942", volume.name) def test_list_nodes(self): nodes = self.driver.list_nodes() self.assertEqual(2, len(nodes)) - self.assertEqual('test', nodes[0].name) - self.assertEqual('2600', nodes[0].id) - self.assertEqual([], nodes[0].extra['security_group']) - self.assertEqual(None, nodes[0].extra['key_name']) + self.assertEqual("test", nodes[0].name) + self.assertEqual("2600", nodes[0].id) + self.assertEqual(0, len(nodes[0].private_ips)) + self.assertEqual([], nodes[0].extra["security_group"]) + self.assertEqual(None, nodes[0].extra["key_name"]) + self.assertEqual(1, len(nodes[0].public_ips)) + self.assertEqual("1.1.1.116", nodes[0].public_ips[0]) + self.assertEqual(1, len(nodes[0].extra["ip_addresses"])) + self.assertEqual(34000, nodes[0].extra["ip_addresses"][0].id) + self.assertEqual(1, len(nodes[0].extra["ip_forwarding_rules"])) + self.assertEqual( + "772fd410-6649-43ed-befa-77be986b8906", + nodes[0].extra["ip_forwarding_rules"][0].id, + ) + self.assertEqual(1, len(nodes[0].extra["port_forwarding_rules"])) + self.assertEqual( + "bc7ea3ee-a2c3-4b86-a53f-01bdaa1b2e32", + nodes[0].extra["port_forwarding_rules"][0].id, + ) + self.assertEqual({"testkey": "testvalue", "foo": "bar"}, nodes[0].extra["tags"]) + + def test_list_nodes_location_filter(self): + def list_nodes_mock(self, **kwargs): + self.assertTrue("zoneid" in kwargs) + self.assertEqual("1", kwargs.get("zoneid")) + + body, obj = self._load_fixture("listVirtualMachines_default.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + CloudStackMockHttp._cmd_listVirtualMachines = list_nodes_mock + try: + location = NodeLocation(1, "Sydney", "Unknown", self.driver) + self.driver.list_nodes(location=location) + finally: + del CloudStackMockHttp._cmd_listVirtualMachines + + def test_list_nodes_noipaddress_filter(self): + def list_nodes_mock(self, **kwargs): + body, obj = self._load_fixture("listVirtualMachines_noipaddress.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + CloudStackMockHttp._cmd_listVirtualMachines = list_nodes_mock + try: + self.driver.list_nodes() + finally: + del CloudStackMockHttp._cmd_listVirtualMachines + + def test_ex_get_node(self): + node = self.driver.ex_get_node(2600) + self.assertEqual("test", node.name) + self.assertEqual("2600", node.id) + self.assertEqual([], node.extra["security_group"]) + self.assertEqual(None, node.extra["key_name"]) + self.assertEqual(1, len(node.public_ips)) + self.assertEqual("1.1.1.116", node.public_ips[0]) + self.assertEqual(1, len(node.extra["ip_addresses"])) + self.assertEqual(34000, node.extra["ip_addresses"][0].id) + + def test_ex_get_node_doesnt_exist(self): + self.assertRaises(Exception, self.driver.ex_get_node(26), node_id=26) def test_list_locations(self): location = self.driver.list_locations()[0] - self.assertEqual('1', location.id) - self.assertEqual('Sydney', location.name) + self.assertEqual("1", location.id) + self.assertEqual("Sydney", location.name) def test_list_sizes(self): sizes = self.driver.list_sizes() - self.assertEqual('Compute Micro PRD', sizes[0].name) - self.assertEqual('105', sizes[0].id) + self.assertEqual("Compute Micro PRD", sizes[0].name) + self.assertEqual("105", sizes[0].id) self.assertEqual(384, sizes[0].ram) - self.assertEqual('Compute Large PRD', sizes[2].name) - self.assertEqual('69', sizes[2].id) + self.assertEqual("Compute Large PRD", sizes[2].name) + self.assertEqual("69", sizes[2].id) self.assertEqual(6964, sizes[2].ram) def test_ex_start_node(self): node = self.driver.list_nodes()[0] res = node.ex_start() - self.assertEqual('Starting', res) + self.assertEqual("Starting", res) def test_ex_stop_node(self): node = self.driver.list_nodes()[0] res = node.ex_stop() - self.assertEqual('Stopped', res) + self.assertEqual("Stopped", res) def test_destroy_node(self): node = self.driver.list_nodes()[0] @@ -619,79 +694,73 @@ def test_reboot_node(self): def test_list_key_pairs(self): keypairs = self.driver.list_key_pairs() - fingerprint = '00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:' + \ - '00:00:00:00:00' + fingerprint = "00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:" + "00:00:00:00:00" - self.assertEqual(keypairs[0].name, 'cs-keypair') + self.assertEqual(keypairs[0].name, "cs-keypair") self.assertEqual(keypairs[0].fingerprint, fingerprint) # Test old and deprecated way keypairs = self.driver.ex_list_keypairs() - self.assertEqual(keypairs[0]['name'], 'cs-keypair') - self.assertEqual(keypairs[0]['fingerprint'], fingerprint) + self.assertEqual(keypairs[0]["name"], "cs-keypair") + self.assertEqual(keypairs[0]["fingerprint"], fingerprint) def test_list_key_pairs_no_keypair_key(self): - CloudStackMockHttp.fixture_tag = 'no_keys' + CloudStackMockHttp.fixture_tag = "no_keys" keypairs = self.driver.list_key_pairs() self.assertEqual(keypairs, []) def test_get_key_pair(self): - CloudStackMockHttp.fixture_tag = 'get_one' - key_pair = self.driver.get_key_pair(name='cs-keypair') - self.assertEqual(key_pair.name, 'cs-keypair') + CloudStackMockHttp.fixture_tag = "get_one" + key_pair = self.driver.get_key_pair(name="cs-keypair") + self.assertEqual(key_pair.name, "cs-keypair") def test_get_key_pair_doesnt_exist(self): - CloudStackMockHttp.fixture_tag = 'get_one_doesnt_exist' + CloudStackMockHttp.fixture_tag = "get_one_doesnt_exist" - self.assertRaises(KeyPairDoesNotExistError, self.driver.get_key_pair, - name='does-not-exist') + self.assertRaises(KeyPairDoesNotExistError, self.driver.get_key_pair, name="does-not-exist") def test_create_keypair(self): - key_pair = self.driver.create_key_pair(name='test-keypair') + key_pair = self.driver.create_key_pair(name="test-keypair") - self.assertEqual(key_pair.name, 'test-keypair') + self.assertEqual(key_pair.name, "test-keypair") self.assertTrue(key_pair.fingerprint is not None) self.assertTrue(key_pair.private_key is not None) # Test old and deprecated way - res = self.driver.ex_create_keypair(name='test-keypair') - self.assertEqual(res['name'], 'test-keypair') - self.assertTrue(res['fingerprint'] is not None) - self.assertTrue(res['privateKey'] is not None) + res = self.driver.ex_create_keypair(name="test-keypair") + self.assertEqual(res["name"], "test-keypair") + self.assertTrue(res["fingerprint"] is not None) + self.assertTrue(res["privateKey"] is not None) def test_import_keypair_from_file(self): - fingerprint = 'c4:a1:e5:d4:50:84:a9:4c:6b:22:ee:d6:57:02:b8:15' - path = os.path.join(os.path.dirname(__file__), 'fixtures', - 'cloudstack', - 'dummy_rsa.pub') + fingerprint = "c4:a1:e5:d4:50:84:a9:4c:6b:22:ee:d6:57:02:b8:15" + path = os.path.join(os.path.dirname(__file__), "fixtures", "cloudstack", "dummy_rsa.pub") - key_pair = self.driver.import_key_pair_from_file('foobar', path) - self.assertEqual(key_pair.name, 'foobar') + key_pair = self.driver.import_key_pair_from_file("foobar", path) + self.assertEqual(key_pair.name, "foobar") self.assertEqual(key_pair.fingerprint, fingerprint) # Test old and deprecated way - res = self.driver.ex_import_keypair('foobar', path) - self.assertEqual(res['keyName'], 'foobar') - self.assertEqual(res['keyFingerprint'], fingerprint) + res = self.driver.ex_import_keypair("foobar", path) + self.assertEqual(res["keyName"], "foobar") + self.assertEqual(res["keyFingerprint"], fingerprint) def test_ex_import_keypair_from_string(self): - fingerprint = 'c4:a1:e5:d4:50:84:a9:4c:6b:22:ee:d6:57:02:b8:15' - path = os.path.join(os.path.dirname(__file__), 'fixtures', - 'cloudstack', - 'dummy_rsa.pub') + fingerprint = "c4:a1:e5:d4:50:84:a9:4c:6b:22:ee:d6:57:02:b8:15" + path = os.path.join(os.path.dirname(__file__), "fixtures", "cloudstack", "dummy_rsa.pub") fh = open(path) key_material = fh.read() fh.close() - key_pair = self.driver.import_key_pair_from_string('foobar', key_material=key_material) - self.assertEqual(key_pair.name, 'foobar') + key_pair = self.driver.import_key_pair_from_string("foobar", key_material=key_material) + self.assertEqual(key_pair.name, "foobar") self.assertEqual(key_pair.fingerprint, fingerprint) # Test old and deprecated way - res = self.driver.ex_import_keypair_from_string('foobar', key_material=key_material) - self.assertEqual(res['keyName'], 'foobar') - self.assertEqual(res['keyFingerprint'], fingerprint) + res = self.driver.ex_import_keypair_from_string("foobar", key_material=key_material) + self.assertEqual(res["keyName"], "foobar") + self.assertEqual(res["keyFingerprint"], fingerprint) def test_delete_key_pair(self): key_pair = self.driver.list_key_pairs()[0] @@ -700,85 +769,91 @@ def test_delete_key_pair(self): self.assertTrue(res) # Test old and deprecated way - res = self.driver.ex_delete_keypair(keypair='cs-keypair') + res = self.driver.ex_delete_keypair(keypair="cs-keypair") self.assertTrue(res) def test_ex_list_security_groups(self): groups = self.driver.ex_list_security_groups() self.assertEqual(2, len(groups)) - self.assertEqual(groups[0]['name'], 'default') - self.assertEqual(groups[1]['name'], 'mongodb') + self.assertEqual(groups[0]["name"], "default") + self.assertEqual(groups[1]["name"], "mongodb") def test_ex_list_security_groups_no_securitygroup_key(self): - CloudStackMockHttp.fixture_tag = 'no_groups' + CloudStackMockHttp.fixture_tag = "no_groups" groups = self.driver.ex_list_security_groups() self.assertEqual(groups, []) def test_ex_create_security_group(self): - group = self.driver.ex_create_security_group(name='MySG') - self.assertEqual(group['name'], 'MySG') + group = self.driver.ex_create_security_group(name="MySG") + self.assertEqual(group["name"], "MySG") def test_ex_delete_security_group(self): - res = self.driver.ex_delete_security_group(name='MySG') + res = self.driver.ex_delete_security_group(name="MySG") self.assertTrue(res) def test_ex_authorize_security_group_ingress(self): - res = self.driver.ex_authorize_security_group_ingress('MySG', - 'TCP', - '22', - '22', - '0.0.0.0/0') - self.assertTrue(res) + res = self.driver.ex_authorize_security_group_ingress( + "test_sg", "udp", "0.0.0.0/0", "0", "65535" + ) + self.assertEqual(res.get("name"), "test_sg") + self.assertTrue("ingressrule" in res) + rules = res["ingressrule"] + self.assertEqual(len(rules), 1) + rule = rules[0] + self.assertEqual(rule["cidr"], "0.0.0.0/0") + self.assertEqual(rule["endport"], 65535) + self.assertEqual(rule["protocol"], "udp") + self.assertEqual(rule["startport"], 0) def test_ex_create_affinity_group(self): - res = self.driver.ex_create_affinity_group('MyAG2', - CloudStackAffinityGroupType('MyAGType')) - self.assertEqual(res.name, 'MyAG2') + res = self.driver.ex_create_affinity_group("MyAG2", CloudStackAffinityGroupType("MyAGType")) + self.assertEqual(res.name, "MyAG2") self.assertIsInstance(res.type, CloudStackAffinityGroupType) - self.assertEqual(res.type.type, 'MyAGType') + self.assertEqual(res.type.type, "MyAGType") def test_ex_create_affinity_group_already_exists(self): - self.assertRaises(LibcloudError, - self.driver.ex_create_affinity_group, - 'MyAG', CloudStackAffinityGroupType('MyAGType')) + self.assertRaises( + LibcloudError, + self.driver.ex_create_affinity_group, + "MyAG", + CloudStackAffinityGroupType("MyAGType"), + ) def test_delete_ex_affinity_group(self): - afg = self.driver.ex_create_affinity_group('MyAG3', - CloudStackAffinityGroupType('MyAGType')) + afg = self.driver.ex_create_affinity_group("MyAG3", CloudStackAffinityGroupType("MyAGType")) res = self.driver.ex_delete_affinity_group(afg) self.assertTrue(res) def test_ex_update_node_affinity_group(self): affinity_group_list = self.driver.ex_list_affinity_groups() nodes = self.driver.list_nodes() - node = self.driver.ex_update_node_affinity_group(nodes[0], - affinity_group_list) - self.assertEqual(node.extra['affinity_group'][0], - affinity_group_list[0].id) + node = self.driver.ex_update_node_affinity_group(nodes[0], affinity_group_list) + self.assertEqual(node.extra["affinity_group"][0], affinity_group_list[0].id) def test_ex_list_affinity_groups(self): res = self.driver.ex_list_affinity_groups() self.assertEqual(len(res), 1) - self.assertEqual(res[0].id, '11112') - self.assertEqual(res[0].name, 'MyAG') + self.assertEqual(res[0].id, "11112") + self.assertEqual(res[0].name, "MyAG") self.assertIsInstance(res[0].type, CloudStackAffinityGroupType) - self.assertEqual(res[0].type.type, 'MyAGType') + self.assertEqual(res[0].type.type, "MyAGType") def test_ex_list_affinity_group_types(self): res = self.driver.ex_list_affinity_group_types() self.assertEqual(len(res), 1) self.assertIsInstance(res[0], CloudStackAffinityGroupType) - self.assertEqual(res[0].type, 'MyAGType') + self.assertEqual(res[0].type, "MyAGType") def test_ex_list_public_ips(self): ips = self.driver.ex_list_public_ips() - self.assertEqual(ips[0].address, '1.1.1.116') + self.assertEqual(ips[0].address, "1.1.1.116") + self.assertEqual(ips[0].virtualmachine_id, "2600") def test_ex_allocate_public_ip(self): addr = self.driver.ex_allocate_public_ip() - self.assertEqual(addr.address, '7.5.6.1') - self.assertEqual(addr.id, '10987171-8cc9-4d0a-b98f-1698c09ddd2d') + self.assertEqual(addr.address, "7.5.6.1") + self.assertEqual(addr.id, "10987171-8cc9-4d0a-b98f-1698c09ddd2d") def test_ex_release_public_ip(self): addresses = self.driver.ex_list_public_ips() @@ -793,15 +868,17 @@ def test_ex_create_port_forwarding_rule(self): public_port = 33 public_end_port = 34 openfirewall = True - protocol = 'TCP' - rule = self.driver.ex_create_port_forwarding_rule(node, - address, - private_port, - public_port, - protocol, - public_end_port, - private_end_port, - openfirewall) + protocol = "TCP" + rule = self.driver.ex_create_port_forwarding_rule( + node, + address, + private_port, + public_port, + protocol, + public_end_port, + private_end_port, + openfirewall, + ) self.assertEqual(rule.address, address) self.assertEqual(rule.protocol, protocol) self.assertEqual(rule.public_port, public_port) @@ -813,22 +890,22 @@ def test_ex_list_firewall_rules(self): rules = self.driver.ex_list_firewall_rules() self.assertEqual(len(rules), 1) rule = rules[0] - self.assertEqual(rule.address.address, '1.1.1.116') - self.assertEqual(rule.protocol, 'tcp') - self.assertEqual(rule.cidr_list, '192.168.0.0/16') + self.assertEqual(rule.address.address, "1.1.1.116") + self.assertEqual(rule.protocol, "tcp") + self.assertEqual(rule.cidr_list, "192.168.0.0/16") self.assertIsNone(rule.icmp_code) self.assertIsNone(rule.icmp_type) - self.assertEqual(rule.start_port, '33') - self.assertEqual(rule.end_port, '34') + self.assertEqual(rule.start_port, "33") + self.assertEqual(rule.end_port, "34") def test_ex_list_firewall_rules_icmp(self): - CloudStackMockHttp.fixture_tag = 'firewallicmp' + CloudStackMockHttp.fixture_tag = "firewallicmp" rules = self.driver.ex_list_firewall_rules() self.assertEqual(len(rules), 1) rule = rules[0] - self.assertEqual(rule.address.address, '1.1.1.116') - self.assertEqual(rule.protocol, 'icmp') - self.assertEqual(rule.cidr_list, '192.168.0.0/16') + self.assertEqual(rule.address.address, "1.1.1.116") + self.assertEqual(rule.protocol, "icmp") + self.assertEqual(rule.cidr_list, "192.168.0.0/16") self.assertEqual(rule.icmp_code, 0) self.assertEqual(rule.icmp_type, 8) self.assertIsNone(rule.start_port) @@ -841,15 +918,13 @@ def test_ex_delete_firewall_rule(self): def test_ex_create_firewall_rule(self): address = self.driver.ex_list_public_ips()[0] - cidr_list = '192.168.0.0/16' - protocol = 'TCP' + cidr_list = "192.168.0.0/16" + protocol = "TCP" start_port = 33 end_port = 34 - rule = self.driver.ex_create_firewall_rule(address, - cidr_list, - protocol, - start_port=start_port, - end_port=end_port) + rule = self.driver.ex_create_firewall_rule( + address, cidr_list, protocol, start_port=start_port, end_port=end_port + ) self.assertEqual(rule.address, address) self.assertEqual(rule.protocol, protocol) self.assertIsNone(rule.icmp_code) @@ -859,15 +934,13 @@ def test_ex_create_firewall_rule(self): def test_ex_create_firewall_rule_icmp(self): address = self.driver.ex_list_public_ips()[0] - cidr_list = '192.168.0.0/16' - protocol = 'icmp' + cidr_list = "192.168.0.0/16" + protocol = "icmp" icmp_code = 0 icmp_type = 8 - rule = self.driver.ex_create_firewall_rule(address, - cidr_list, - protocol, - icmp_code=icmp_code, - icmp_type=icmp_type) + rule = self.driver.ex_create_firewall_rule( + address, cidr_list, protocol, icmp_code=icmp_code, icmp_type=icmp_type + ) self.assertEqual(rule.address, address) self.assertEqual(rule.protocol, protocol) self.assertEqual(rule.icmp_code, 0) @@ -879,13 +952,13 @@ def test_ex_list_egress_firewall_rules(self): rules = self.driver.ex_list_egress_firewall_rules() self.assertEqual(len(rules), 1) rule = rules[0] - self.assertEqual(rule.network_id, '874be2ca-20a7-4360-80e9-7356c0018c0b') - self.assertEqual(rule.cidr_list, '192.168.0.0/16') - self.assertEqual(rule.protocol, 'tcp') + self.assertEqual(rule.network_id, "874be2ca-20a7-4360-80e9-7356c0018c0b") + self.assertEqual(rule.cidr_list, "192.168.0.0/16") + self.assertEqual(rule.protocol, "tcp") self.assertIsNone(rule.icmp_code) self.assertIsNone(rule.icmp_type) - self.assertEqual(rule.start_port, '80') - self.assertEqual(rule.end_port, '80') + self.assertEqual(rule.start_port, "80") + self.assertEqual(rule.end_port, "80") def test_ex_delete_egress_firewall_rule(self): rules = self.driver.ex_list_egress_firewall_rules() @@ -893,17 +966,14 @@ def test_ex_delete_egress_firewall_rule(self): self.assertTrue(res) def test_ex_create_egress_firewall_rule(self): - network_id = '874be2ca-20a7-4360-80e9-7356c0018c0b' - cidr_list = '192.168.0.0/16' - protocol = 'TCP' + network_id = "874be2ca-20a7-4360-80e9-7356c0018c0b" + cidr_list = "192.168.0.0/16" + protocol = "TCP" start_port = 33 end_port = 34 rule = self.driver.ex_create_egress_firewall_rule( - network_id, - cidr_list, - protocol, - start_port=start_port, - end_port=end_port) + network_id, cidr_list, protocol, start_port=start_port, end_port=end_port + ) self.assertEqual(rule.network_id, network_id) self.assertEqual(rule.cidr_list, cidr_list) @@ -918,12 +988,12 @@ def test_ex_list_port_forwarding_rules(self): self.assertEqual(len(rules), 1) rule = rules[0] self.assertTrue(rule.node) - self.assertEqual(rule.protocol, 'tcp') - self.assertEqual(rule.public_port, '33') - self.assertEqual(rule.public_end_port, '34') - self.assertEqual(rule.private_port, '33') - self.assertEqual(rule.private_end_port, '34') - self.assertEqual(rule.address.address, '1.1.1.116') + self.assertEqual(rule.protocol, "tcp") + self.assertEqual(rule.public_port, "33") + self.assertEqual(rule.public_end_port, "34") + self.assertEqual(rule.private_port, "33") + self.assertEqual(rule.private_end_port, "34") + self.assertEqual(rule.address.address, "1.1.1.116") def test_ex_delete_port_forwarding_rule(self): node = self.driver.list_nodes()[0] @@ -933,66 +1003,68 @@ def test_ex_delete_port_forwarding_rule(self): def test_node_ex_delete_port_forwarding_rule(self): node = self.driver.list_nodes()[0] - self.assertEqual(len(node.extra['port_forwarding_rules']), 1) - node.extra['port_forwarding_rules'][0].delete() - self.assertEqual(len(node.extra['port_forwarding_rules']), 0) + self.assertEqual(len(node.extra["port_forwarding_rules"]), 1) + node.extra["port_forwarding_rules"][0].delete() + self.assertEqual(len(node.extra["port_forwarding_rules"]), 0) def test_node_ex_create_port_forwarding_rule(self): node = self.driver.list_nodes()[0] - self.assertEqual(len(node.extra['port_forwarding_rules']), 1) + self.assertEqual(len(node.extra["port_forwarding_rules"]), 1) address = self.driver.ex_list_public_ips()[0] private_port = 33 private_end_port = 34 public_port = 33 public_end_port = 34 openfirewall = True - protocol = 'TCP' - rule = node.ex_create_port_forwarding_rule(address, - private_port, - public_port, - protocol, - public_end_port, - private_end_port, - openfirewall) + protocol = "TCP" + rule = node.ex_create_port_forwarding_rule( + address, + private_port, + public_port, + protocol, + public_end_port, + private_end_port, + openfirewall, + ) self.assertEqual(rule.address, address) self.assertEqual(rule.protocol, protocol) self.assertEqual(rule.public_port, public_port) self.assertEqual(rule.public_end_port, public_end_port) self.assertEqual(rule.private_port, private_port) self.assertEqual(rule.private_end_port, private_end_port) - self.assertEqual(len(node.extra['port_forwarding_rules']), 2) + self.assertEqual(len(node.extra["port_forwarding_rules"]), 2) def test_ex_list_ip_forwarding_rules(self): rules = self.driver.ex_list_ip_forwarding_rules() self.assertEqual(len(rules), 1) rule = rules[0] self.assertTrue(rule.node) - self.assertEqual(rule.protocol, 'tcp') + self.assertEqual(rule.protocol, "tcp") self.assertEqual(rule.start_port, 33) self.assertEqual(rule.end_port, 34) - self.assertEqual(rule.address.address, '1.1.1.116') + self.assertEqual(rule.address.address, "1.1.1.116") def test_ex_limits(self): limits = self.driver.ex_limits() - self.assertEqual(limits['max_images'], 20) - self.assertEqual(limits['max_networks'], 20) - self.assertEqual(limits['max_public_ips'], -1) - self.assertEqual(limits['max_vpc'], 20) - self.assertEqual(limits['max_instances'], 20) - self.assertEqual(limits['max_projects'], -1) - self.assertEqual(limits['max_volumes'], 20) - self.assertEqual(limits['max_snapshots'], 20) + self.assertEqual(limits["max_images"], 20) + self.assertEqual(limits["max_networks"], 20) + self.assertEqual(limits["max_public_ips"], -1) + self.assertEqual(limits["max_vpc"], 20) + self.assertEqual(limits["max_instances"], 20) + self.assertEqual(limits["max_projects"], -1) + self.assertEqual(limits["max_volumes"], 20) + self.assertEqual(limits["max_snapshots"], 20) def test_ex_create_tags(self): node = self.driver.list_nodes()[0] - tags = {'Region': 'Canada'} - resp = self.driver.ex_create_tags([node.id], 'UserVm', tags) + tags = {"Region": "Canada"} + resp = self.driver.ex_create_tags([node.id], "UserVm", tags) self.assertTrue(resp) def test_ex_delete_tags(self): node = self.driver.list_nodes()[0] - tag_keys = ['Region'] - resp = self.driver.ex_delete_tags([node.id], 'UserVm', tag_keys) + tag_keys = ["Region"] + resp = self.driver.ex_delete_tags([node.id], "UserVm", tag_keys) self.assertTrue(resp) def test_list_snapshots(self): @@ -1001,16 +1073,16 @@ def test_list_snapshots(self): snap = snapshots[0] self.assertEqual(snap.id, 188402) - self.assertEqual(snap.extra['name'], "i-123-87654-VM_ROOT-12344_20140917105548") - self.assertEqual(snap.extra['volume_id'], 89341) + self.assertEqual(snap.extra["name"], "i-123-87654-VM_ROOT-12344_20140917105548") + self.assertEqual(snap.extra["volume_id"], 89341) def test_create_volume_snapshot(self): volume = self.driver.list_volumes()[0] snapshot = self.driver.create_volume_snapshot(volume) self.assertEqual(snapshot.id, 190547) - self.assertEqual(snapshot.extra['name'], "i-123-87654-VM_ROOT-23456_20140917105548") - self.assertEqual(snapshot.extra['volume_id'], "fe1ada16-57a0-40ae-b577-01a153690fb4") + self.assertEqual(snapshot.extra["name"], "i-123-87654-VM_ROOT-23456_20140917105548") + self.assertEqual(snapshot.extra["volume_id"], "fe1ada16-57a0-40ae-b577-01a153690fb4") def test_destroy_volume_snapshot(self): snapshot = self.driver.list_snapshots()[0] @@ -1022,43 +1094,43 @@ def test_ex_create_snapshot_template(self): template = self.driver.ex_create_snapshot_template(snapshot, "test-libcloud-template", 99) - self.assertEqual(template.id, '10260') + self.assertEqual(template.id, "10260") self.assertEqual(template.name, "test-libcloud-template") - self.assertEqual(template.extra['displaytext'], "test-libcloud-template") - self.assertEqual(template.extra['hypervisor'], "VMware") - self.assertEqual(template.extra['os'], "Other Linux (64-bit)") + self.assertEqual(template.extra["displaytext"], "test-libcloud-template") + self.assertEqual(template.extra["hypervisor"], "VMware") + self.assertEqual(template.extra["os"], "Other Linux (64-bit)") def test_ex_list_os_types(self): os_types = self.driver.ex_list_os_types() self.assertEqual(len(os_types), 146) - self.assertEqual(os_types[0]['id'], 69) - self.assertEqual(os_types[0]['oscategoryid'], 7) - self.assertEqual(os_types[0]['description'], "Asianux 3(32-bit)") + self.assertEqual(os_types[0]["id"], 69) + self.assertEqual(os_types[0]["oscategoryid"], 7) + self.assertEqual(os_types[0]["description"], "Asianux 3(32-bit)") def test_ex_list_vpn_gateways(self): vpn_gateways = self.driver.ex_list_vpn_gateways() self.assertEqual(len(vpn_gateways), 1) - self.assertEqual(vpn_gateways[0].id, 'cffa0cab-d1da-42a7-92f6-41379267a29f') - self.assertEqual(vpn_gateways[0].account, 'some_account') - self.assertEqual(vpn_gateways[0].domain, 'some_domain') - self.assertEqual(vpn_gateways[0].domain_id, '9b397dea-25ef-4c5d-b47d-627eaebe8ed8') - self.assertEqual(vpn_gateways[0].public_ip, '1.2.3.4') - self.assertEqual(vpn_gateways[0].vpc_id, '4d25e181-8850-4d52-8ecb-a6f35bbbabde') + self.assertEqual(vpn_gateways[0].id, "cffa0cab-d1da-42a7-92f6-41379267a29f") + self.assertEqual(vpn_gateways[0].account, "some_account") + self.assertEqual(vpn_gateways[0].domain, "some_domain") + self.assertEqual(vpn_gateways[0].domain_id, "9b397dea-25ef-4c5d-b47d-627eaebe8ed8") + self.assertEqual(vpn_gateways[0].public_ip, "1.2.3.4") + self.assertEqual(vpn_gateways[0].vpc_id, "4d25e181-8850-4d52-8ecb-a6f35bbbabde") def test_ex_create_vpn_gateway(self): vpc = self.driver.ex_list_vpcs()[0] vpn_gateway = self.driver.ex_create_vpn_gateway(vpc) - self.assertEqual(vpn_gateway.id, '5ef6794e-cec8-4018-9fef-c4dacbadee14') - self.assertEqual(vpn_gateway.account, 'some_account') - self.assertEqual(vpn_gateway.domain, 'some_domain') - self.assertEqual(vpn_gateway.domain_id, '9b397dea-25ef-4c5d-b47d-627eaebe8ed8') - self.assertEqual(vpn_gateway.public_ip, '2.3.4.5') + self.assertEqual(vpn_gateway.id, "5ef6794e-cec8-4018-9fef-c4dacbadee14") + self.assertEqual(vpn_gateway.account, "some_account") + self.assertEqual(vpn_gateway.domain, "some_domain") + self.assertEqual(vpn_gateway.domain_id, "9b397dea-25ef-4c5d-b47d-627eaebe8ed8") + self.assertEqual(vpn_gateway.public_ip, "2.3.4.5") self.assertEqual(vpn_gateway.vpc_id, vpc.id) def test_ex_delete_vpn_gateway(self): @@ -1070,26 +1142,27 @@ def test_ex_list_vpn_customer_gateways(self): self.assertEqual(len(vpn_customer_gateways), 1) - self.assertEqual(vpn_customer_gateways[0].id, 'ea67eaae-1c2a-4e65-b910-441e77f69bea') - self.assertEqual(vpn_customer_gateways[0].cidr_list, '10.2.2.0/24') - self.assertEqual(vpn_customer_gateways[0].esp_policy, '3des-md5') - self.assertEqual(vpn_customer_gateways[0].gateway, '10.2.2.1') - self.assertEqual(vpn_customer_gateways[0].ike_policy, '3des-md5') - self.assertEqual(vpn_customer_gateways[0].ipsec_psk, 'some_psk') + self.assertEqual(vpn_customer_gateways[0].id, "ea67eaae-1c2a-4e65-b910-441e77f69bea") + self.assertEqual(vpn_customer_gateways[0].cidr_list, "10.2.2.0/24") + self.assertEqual(vpn_customer_gateways[0].esp_policy, "3des-md5") + self.assertEqual(vpn_customer_gateways[0].gateway, "10.2.2.1") + self.assertEqual(vpn_customer_gateways[0].ike_policy, "3des-md5") + self.assertEqual(vpn_customer_gateways[0].ipsec_psk, "some_psk") def test_ex_create_vpn_customer_gateway(self): vpn_customer_gateway = self.driver.ex_create_vpn_customer_gateway( - cidr_list='10.0.0.0/24', - esp_policy='3des-md5', - gateway='10.0.0.1', - ike_policy='3des-md5', - ipsec_psk='ipsecpsk') - - self.assertEqual(vpn_customer_gateway.id, 'cef3c766-116a-4e83-9844-7d08ab7d3fd4') - self.assertEqual(vpn_customer_gateway.esp_policy, '3des-md5') - self.assertEqual(vpn_customer_gateway.gateway, '10.0.0.1') - self.assertEqual(vpn_customer_gateway.ike_policy, '3des-md5') - self.assertEqual(vpn_customer_gateway.ipsec_psk, 'ipsecpsk') + cidr_list="10.0.0.0/24", + esp_policy="3des-md5", + gateway="10.0.0.1", + ike_policy="3des-md5", + ipsec_psk="ipsecpsk", + ) + + self.assertEqual(vpn_customer_gateway.id, "cef3c766-116a-4e83-9844-7d08ab7d3fd4") + self.assertEqual(vpn_customer_gateway.esp_policy, "3des-md5") + self.assertEqual(vpn_customer_gateway.gateway, "10.0.0.1") + self.assertEqual(vpn_customer_gateway.ike_policy, "3des-md5") + self.assertEqual(vpn_customer_gateway.ipsec_psk, "ipsecpsk") def test_ex_ex_delete_vpn_customer_gateway(self): vpn_customer_gateway = self.driver.ex_list_vpn_customer_gateways()[0] @@ -1100,25 +1173,29 @@ def test_ex_list_vpn_connections(self): self.assertEqual(len(vpn_connections), 1) - self.assertEqual(vpn_connections[0].id, '8f482d9a-6cee-453b-9e78-b0e1338ffce9') + self.assertEqual(vpn_connections[0].id, "8f482d9a-6cee-453b-9e78-b0e1338ffce9") self.assertEqual(vpn_connections[0].passive, False) - self.assertEqual(vpn_connections[0].vpn_customer_gateway_id, 'ea67eaae-1c2a-4e65-b910-441e77f69bea') - self.assertEqual(vpn_connections[0].vpn_gateway_id, 'cffa0cab-d1da-42a7-92f6-41379267a29f') - self.assertEqual(vpn_connections[0].state, 'Connected') + self.assertEqual( + vpn_connections[0].vpn_customer_gateway_id, + "ea67eaae-1c2a-4e65-b910-441e77f69bea", + ) + self.assertEqual(vpn_connections[0].vpn_gateway_id, "cffa0cab-d1da-42a7-92f6-41379267a29f") + self.assertEqual(vpn_connections[0].state, "Connected") def test_ex_create_vpn_connection(self): vpn_customer_gateway = self.driver.ex_list_vpn_customer_gateways()[0] vpn_gateway = self.driver.ex_list_vpn_gateways()[0] - vpn_connection = self.driver.ex_create_vpn_connection( - vpn_customer_gateway, - vpn_gateway) + vpn_connection = self.driver.ex_create_vpn_connection(vpn_customer_gateway, vpn_gateway) - self.assertEqual(vpn_connection.id, 'f45c3af8-f909-4f16-9d40-ed4409c575f8') + self.assertEqual(vpn_connection.id, "f45c3af8-f909-4f16-9d40-ed4409c575f8") self.assertEqual(vpn_connection.passive, False) - self.assertEqual(vpn_connection.vpn_customer_gateway_id, 'ea67eaae-1c2a-4e65-b910-441e77f69bea') - self.assertEqual(vpn_connection.vpn_gateway_id, 'cffa0cab-d1da-42a7-92f6-41379267a29f') - self.assertEqual(vpn_connection.state, 'Connected') + self.assertEqual( + vpn_connection.vpn_customer_gateway_id, + "ea67eaae-1c2a-4e65-b910-441e77f69bea", + ) + self.assertEqual(vpn_connection.vpn_gateway_id, "cffa0cab-d1da-42a7-92f6-41379267a29f") + self.assertEqual(vpn_connection.state, "Connected") def test_ex_delete_vpn_connection(self): vpn_connection = self.driver.ex_list_vpn_connections()[0] @@ -1128,95 +1205,116 @@ def test_ex_delete_vpn_connection(self): class CloudStackTestCase(CloudStackCommonTestCase, unittest.TestCase): def test_driver_instantiation(self): urls = [ - 'http://api.exoscale.ch/compute1', # http, default port - 'https://api.exoscale.ch/compute2', # https, default port - 'http://api.exoscale.ch:8888/compute3', # https, custom port - 'https://api.exoscale.ch:8787/compute4', # https, custom port - 'https://api.test.com/compute/endpoint' # https, default port + "http://api.exoscale.ch/compute1", # http, default port + "https://api.exoscale.ch/compute2", # https, default port + "http://api.exoscale.ch:8888/compute3", # https, custom port + "https://api.exoscale.ch:8787/compute4", # https, custom port + "https://api.test.com/compute/endpoint", # https, default port ] expected_values = [ - {'host': 'api.exoscale.ch', 'port': 80, 'path': '/compute1'}, - {'host': 'api.exoscale.ch', 'port': 443, 'path': '/compute2'}, - {'host': 'api.exoscale.ch', 'port': 8888, 'path': '/compute3'}, - {'host': 'api.exoscale.ch', 'port': 8787, 'path': '/compute4'}, - {'host': 'api.test.com', 'port': 443, 'path': '/compute/endpoint'} + {"host": "api.exoscale.ch", "port": 80, "path": "/compute1"}, + {"host": "api.exoscale.ch", "port": 443, "path": "/compute2"}, + {"host": "api.exoscale.ch", "port": 8888, "path": "/compute3"}, + {"host": "api.exoscale.ch", "port": 8787, "path": "/compute4"}, + {"host": "api.test.com", "port": 443, "path": "/compute/endpoint"}, ] cls = get_driver(Provider.CLOUDSTACK) for url, expected in zip(urls, expected_values): - driver = cls('key', 'secret', url=url) + driver = cls("key", "secret", url=url) - self.assertEqual(driver.host, expected['host']) - self.assertEqual(driver.path, expected['path']) - self.assertEqual(driver.connection.port, expected['port']) + self.assertEqual(driver.host, expected["host"]) + self.assertEqual(driver.path, expected["path"]) + self.assertEqual(driver.connection.port, expected["port"]) def test_user_must_provide_host_and_path_or_url(self): - expected_msg = ('When instantiating CloudStack driver directly ' - 'you also need to provide url or host and path ' - 'argument') + expected_msg = ( + "When instantiating CloudStack driver directly " + "you also need to provide url or host and path " + "argument" + ) cls = get_driver(Provider.CLOUDSTACK) - self.assertRaisesRegexp(Exception, expected_msg, cls, - 'key', 'secret') + assertRaisesRegex(self, Exception, expected_msg, cls, "key", "secret") try: - cls('key', 'secret', True, 'localhost', '/path') + cls("key", "secret", True, "localhost", "/path") except Exception: - self.fail('host and path provided but driver raised an exception') + self.fail("host and path provided but driver raised an exception") try: - cls('key', 'secret', url='https://api.exoscale.ch/compute') + cls("key", "secret", url="https://api.exoscale.ch/compute") except Exception: - self.fail('url provided but driver raised an exception') + self.fail("url provided but driver raised an exception") + + def test_restore(self): + template = NodeImage("aaa-bbb-ccc-ddd", "fake-img", None) + node = self.driver.list_nodes()[0] + res = node.ex_restore(template=template) + + self.assertEqual(res, template.id) + + def test_change_offerings(self): + offering = NodeSize("eee-fff-ggg-hhh", "fake-size", 1, 4, 5, 0.1, None) + + node = self.driver.list_nodes()[0] + res = node.ex_change_node_size(offering=offering) -class CloudStackMockHttp(MockHttpTestCase): - fixtures = ComputeFileFixtures('cloudstack') - fixture_tag = 'default' + self.assertEqual(res, offering.id) + + +class CloudStackMockHttp(MockHttp, unittest.TestCase): + fixtures = ComputeFileFixtures("cloudstack") + fixture_tag = "default" def _load_fixture(self, fixture): body = self.fixtures.load(fixture) return body, json.loads(body) def _test_path_invalid_credentials(self, method, url, body, headers): - body = '' - return (httplib.UNAUTHORIZED, body, {}, - httplib.responses[httplib.UNAUTHORIZED]) + body = "" + return (httplib.UNAUTHORIZED, body, {}, httplib.responses[httplib.UNAUTHORIZED]) def _test_path_api_error(self, method, url, body, headers): - body = self.fixtures.load('registerSSHKeyPair_error.json') - return (431, body, {}, - httplib.responses[httplib.OK]) + body = self.fixtures.load("registerSSHKeyPair_error.json") + return (431, body, {}, httplib.responses[httplib.OK]) def _test_path(self, method, url, body, headers): url = urlparse.urlparse(url) query = dict(parse_qsl(url.query)) - self.assertTrue('apiKey' in query) - self.assertTrue('command' in query) - self.assertTrue('response' in query) - self.assertTrue('signature' in query) + self.assertTrue("apiKey" in query) + self.assertTrue("command" in query) + self.assertTrue("response" in query) + self.assertTrue("signature" in query) - self.assertTrue(query['response'] == 'json') + self.assertTrue(query["response"] == "json") - del query['apiKey'] - del query['response'] - del query['signature'] - command = query.pop('command') + del query["apiKey"] + del query["response"] + del query["signature"] + command = query.pop("command") - if hasattr(self, '_cmd_' + command): - return getattr(self, '_cmd_' + command)(**query) + if hasattr(self, "_cmd_" + command): + return getattr(self, "_cmd_" + command)(**query) else: - fixture = command + '_' + self.fixture_tag + '.json' + fixture = command + "_" + self.fixture_tag + ".json" body, obj = self._load_fixture(fixture) - return (httplib.OK, body, obj, httplib.responses[httplib.OK]) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _test_path_userdata(self, method, url, body, headers): + if "deployVirtualMachine" in url: + self.assertUrlContainsQueryParams(url, {"userdata": "Zm9vYmFy"}) + return self._test_path(method, url, body, headers) def _cmd_queryAsyncJobResult(self, jobid): - fixture = 'queryAsyncJobResult' + '_' + str(jobid) + '.json' + fixture = "queryAsyncJobResult" + "_" + str(jobid) + ".json" body, obj = self._load_fixture(fixture) - return (httplib.OK, body, obj, httplib.responses[httplib.OK]) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_deployment.py b/libcloud/test/compute/test_deployment.py index 7fda79c541..b70b674dc1 100644 --- a/libcloud/test/compute/test_deployment.py +++ b/libcloud/test/compute/test_deployment.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more§ # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. @@ -14,49 +13,69 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement import os import sys import time import unittest +from unittest.mock import Mock, patch -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import u -from libcloud.utils.py3 import PY3 - -from libcloud.compute.deployment import MultiStepDeployment, Deployment -from libcloud.compute.deployment import SSHKeyDeployment, ScriptDeployment -from libcloud.compute.deployment import ScriptFileDeployment, FileDeployment -from libcloud.compute.base import Node -from libcloud.compute.types import NodeState, DeploymentError, LibcloudError -from libcloud.compute.ssh import BaseSSHClient +from libcloud.test import XML_HEADERS, MockHttp +from libcloud.utils.py3 import u, httplib, assertRaisesRegex +from libcloud.compute.ssh import BaseSSHClient, SSHCommandTimeoutError, have_paramiko +from libcloud.compute.base import Node, NodeAuthPassword +from libcloud.test.secrets import RACKSPACE_PARAMS +from libcloud.compute.types import NodeState, LibcloudError, DeploymentError +from libcloud.compute.deployment import ( + Deployment, + FileDeployment, + ScriptDeployment, + SSHKeyDeployment, + MultiStepDeployment, + ScriptFileDeployment, +) +from libcloud.test.file_fixtures import ComputeFileFixtures from libcloud.compute.drivers.rackspace import RackspaceFirstGenNodeDriver as Rackspace -from libcloud.test import MockHttp, XML_HEADERS -from libcloud.test.file_fixtures import ComputeFileFixtures -from mock import Mock, patch +# Keyword arguments which are specific to deploy_node() method, but not +# create_node() +DEPLOY_NODE_KWARGS = [ + "deploy", + "ssh_username", + "ssh_alternate_usernames", + "ssh_port", + "ssh_timeout", + "ssh_key", + "timeout", + "max_tries", + "ssh_interface", +] -from libcloud.test.secrets import RACKSPACE_PARAMS +FILE_PATH = "{0}home{0}ubuntu{0}relative.sh".format(os.path.sep) class MockDeployment(Deployment): - def run(self, node, client): return node class MockClient(BaseSSHClient): - - def __init__(self, *args, **kwargs): - self.stdout = '' - self.stderr = '' + def __init__(self, throw_on_timeout=False, *args, **kwargs): + self.stdout = "" + self.stderr = "" self.exit_status = 0 + self.throw_on_timeout = throw_on_timeout - def put(self, path, contents, chmod=755, mode='w'): + def put(self, path, contents, chmod=755, mode="w"): return contents - def run(self, name): + def putfo(self, path, fo, chmod=755): + return fo.read() + + def run(self, cmd, timeout=None): + if self.throw_on_timeout and timeout is not None: + raise ValueError("timeout") + return self.stdout, self.stderr, self.exit_status def delete(self, name): @@ -64,20 +83,29 @@ def delete(self, name): class DeploymentTests(unittest.TestCase): - def setUp(self): - Rackspace.connectionCls.conn_classes = (None, RackspaceMockHttp) + Rackspace.connectionCls.conn_class = RackspaceMockHttp RackspaceMockHttp.type = None self.driver = Rackspace(*RACKSPACE_PARAMS) # normally authentication happens lazily, but we force it here self.driver.connection._populate_hosts_and_request_paths() - self.driver.features = {'create_node': ['generates_password']} - self.node = Node(id=12345, name='test', state=NodeState.RUNNING, - public_ips=['1.2.3.4'], private_ips=['1.2.3.5'], - driver=Rackspace) - self.node2 = Node(id=123456, name='test', state=NodeState.RUNNING, - public_ips=['1.2.3.4'], private_ips=['1.2.3.5'], - driver=Rackspace) + self.driver.features = {"create_node": ["generates_password"]} + self.node = Node( + id=12345, + name="test", + state=NodeState.RUNNING, + public_ips=["1.2.3.4"], + private_ips=["1.2.3.5"], + driver=Rackspace, + ) + self.node2 = Node( + id=123456, + name="test", + state=NodeState.RUNNING, + public_ips=["1.2.3.4"], + private_ips=["1.2.3.5"], + driver=Rackspace, + ) def test_multi_step_deployment(self): msd = MultiStepDeployment() @@ -89,266 +117,384 @@ def test_multi_step_deployment(self): self.assertEqual(self.node, msd.run(node=self.node, client=None)) def test_ssh_key_deployment(self): - sshd = SSHKeyDeployment(key='1234') + sshd = SSHKeyDeployment(key="1234") - self.assertEqual(self.node, sshd.run(node=self.node, - client=MockClient(hostname='localhost'))) + self.assertEqual( + self.node, sshd.run(node=self.node, client=MockClient(hostname="localhost")) + ) def test_file_deployment(self): # use this file (__file__) for obtaining permissions - target = os.path.join('/tmp', os.path.basename(__file__)) + target = os.path.join("/tmp", os.path.basename(__file__)) fd = FileDeployment(__file__, target) self.assertEqual(target, fd.target) self.assertEqual(__file__, fd.source) - self.assertEqual(self.node, fd.run( - node=self.node, client=MockClient(hostname='localhost'))) + self.assertEqual(self.node, fd.run(node=self.node, client=MockClient(hostname="localhost"))) def test_script_deployment(self): - sd1 = ScriptDeployment(script='foobar', delete=True) - sd2 = ScriptDeployment(script='foobar', delete=False) - sd3 = ScriptDeployment( - script='foobar', delete=False, name='foobarname') - - self.assertTrue(sd1.name.find('deployment') != '1') - self.assertEqual(sd3.name, 'foobarname') - - self.assertEqual(self.node, sd1.run(node=self.node, - client=MockClient(hostname='localhost'))) - self.assertEqual(self.node, sd2.run(node=self.node, - client=MockClient(hostname='localhost'))) + sd1 = ScriptDeployment(script="foobar", delete=True) + sd2 = ScriptDeployment(script="foobar", delete=False) + sd3 = ScriptDeployment(script="foobar", delete=False, name="foobarname") + sd4 = ScriptDeployment(script="foobar", delete=False, name="foobarname", timeout=10) + + self.assertTrue(sd1.name.find("deployment") != "1") + self.assertEqual(sd3.name, "foobarname") + self.assertEqual(sd3.timeout, None) + self.assertEqual(sd4.timeout, 10) + + self.assertEqual( + self.node, sd1.run(node=self.node, client=MockClient(hostname="localhost")) + ) + self.assertEqual( + self.node, sd2.run(node=self.node, client=MockClient(hostname="localhost")) + ) + self.assertEqual( + self.node, sd3.run(node=self.node, client=MockClient(hostname="localhost")) + ) + + assertRaisesRegex( + self, + ValueError, + "timeout", + sd4.run, + node=self.node, + client=MockClient(hostname="localhost", throw_on_timeout=True), + ) def test_script_file_deployment(self): file_path = os.path.abspath(__file__) - with open(file_path, 'rb') as fp: + with open(file_path, "rb") as fp: content = fp.read() - if PY3: - content = content.decode('utf-8') + content = content.decode("utf-8") sfd1 = ScriptFileDeployment(script_file=file_path) self.assertEqual(sfd1.script, content) + self.assertEqual(sfd1.timeout, None) + + sfd2 = ScriptFileDeployment(script_file=file_path, timeout=20) + self.assertEqual(sfd2.timeout, 20) def test_script_deployment_relative_path(self): client = Mock() - client.put.return_value = '/home/ubuntu/relative.sh' - client.run.return_value = ('', '', 0) + client.put.return_value = FILE_PATH + client.run.return_value = ("", "", 0) - sd = ScriptDeployment(script='echo "foo"', name='relative.sh') + sd = ScriptDeployment(script='echo "foo"', name="relative.sh") sd.run(self.node, client) - client.run.assert_called_once_with('/home/ubuntu/relative.sh') + client.run.assert_called_once_with(FILE_PATH, timeout=None) def test_script_deployment_absolute_path(self): + file_path = "{0}root{0}relative.sh".format(os.path.sep) + client = Mock() - client.put.return_value = '/home/ubuntu/relative.sh' - client.run.return_value = ('', '', 0) + client.put.return_value = file_path + client.run.return_value = ("", "", 0) - sd = ScriptDeployment(script='echo "foo"', name='/root/relative.sh') + sd = ScriptDeployment(script='echo "foo"', name=file_path) sd.run(self.node, client) - client.run.assert_called_once_with('/root/relative.sh') + client.run.assert_called_once_with(file_path, timeout=None) def test_script_deployment_with_arguments(self): + file_path = "{0}root{0}relative.sh".format(os.path.sep) + client = Mock() - client.put.return_value = '/home/ubuntu/relative.sh' - client.run.return_value = ('', '', 0) + client.put.return_value = file_path + client.run.return_value = ("", "", 0) - args = ['arg1', 'arg2', '--option1=test'] - sd = ScriptDeployment(script='echo "foo"', args=args, - name='/root/relative.sh') + args = ["arg1", "arg2", "--option1=test"] + sd = ScriptDeployment(script='echo "foo"', args=args, name=file_path) sd.run(self.node, client) - expected = '/root/relative.sh arg1 arg2 --option1=test' - client.run.assert_called_once_with(expected) + expected = "%s arg1 arg2 --option1=test" % (file_path) + client.run.assert_called_once_with(expected, timeout=None) client.reset_mock() args = [] - sd = ScriptDeployment(script='echo "foo"', args=args, - name='/root/relative.sh') + sd = ScriptDeployment(script='echo "foo"', args=args, name=file_path) sd.run(self.node, client) - expected = '/root/relative.sh' - client.run.assert_called_once_with(expected) + expected = file_path + client.run.assert_called_once_with(expected, timeout=None) def test_script_file_deployment_with_arguments(self): file_path = os.path.abspath(__file__) client = Mock() - client.put.return_value = '/home/ubuntu/relative.sh' - client.run.return_value = ('', '', 0) + client.put.return_value = FILE_PATH + client.run.return_value = ("", "", 0) - args = ['arg1', 'arg2', '--option1=test', 'option2'] - sfd = ScriptFileDeployment(script_file=file_path, args=args, - name='/root/relative.sh') + args = ["arg1", "arg2", "--option1=test", "option2"] + sfd = ScriptFileDeployment(script_file=file_path, args=args, name=file_path) sfd.run(self.node, client) - expected = '/root/relative.sh arg1 arg2 --option1=test option2' - client.run.assert_called_once_with(expected) + expected = "%s arg1 arg2 --option1=test option2" % (file_path) + client.run.assert_called_once_with(expected, timeout=None) def test_script_deployment_and_sshkey_deployment_argument_types(self): - class FileObject(object): - + class FileObject: def __init__(self, name): self.name = name def read(self): - return 'bar' + return "bar" - ScriptDeployment(script='foobar') - ScriptDeployment(script=u('foobar')) - ScriptDeployment(script=FileObject('test')) + ScriptDeployment(script="foobar") + ScriptDeployment(script=u("foobar")) + ScriptDeployment(script=FileObject("test")) - SSHKeyDeployment(key='foobar') - SSHKeyDeployment(key=u('foobar')) - SSHKeyDeployment(key=FileObject('test')) + SSHKeyDeployment(key="foobar") + SSHKeyDeployment(key=u("foobar")) + SSHKeyDeployment(key=FileObject("test")) try: ScriptDeployment(script=[]) except TypeError: pass else: - self.fail('TypeError was not thrown') + self.fail("TypeError was not thrown") try: SSHKeyDeployment(key={}) except TypeError: pass else: - self.fail('TypeError was not thrown') + self.fail("TypeError was not thrown") def test_wait_until_running_running_instantly(self): node2, ips = self.driver.wait_until_running( - nodes=[self.node], wait_period=1, - timeout=0.5)[0] + nodes=[self.node], wait_period=0.1, timeout=0.5 + )[0] + self.assertEqual(self.node.uuid, node2.uuid) + self.assertEqual(["67.23.21.33"], ips) + + def test_wait_until_running_without_ip(self): + RackspaceMockHttp.type = "NO_IP" + + try: + node2, ips = self.driver.wait_until_running( + nodes=[self.node], wait_period=0.1, timeout=0.2 + )[0] + except LibcloudError as e: + self.assertTrue(e.value.find("Timed out after 0.2 second") != -1) + else: + self.fail("Exception was not thrown") + + def test_wait_until_running_with_only_ipv6(self): + RackspaceMockHttp.type = "IPV6" + + try: + node2, ips = self.driver.wait_until_running( + nodes=[self.node], wait_period=0.1, timeout=0.2 + )[0] + except LibcloudError as e: + self.assertTrue(e.value.find("Timed out after 0.2 second") != -1) + else: + self.fail("Exception was not thrown") + + def test_wait_until_running_with_ipv6_ok(self): + RackspaceMockHttp.type = "IPV6" + node2, ips = self.driver.wait_until_running( + nodes=[self.node], wait_period=1, force_ipv4=False, timeout=0.5 + )[0] self.assertEqual(self.node.uuid, node2.uuid) - self.assertEqual(['67.23.21.33'], ips) + self.assertEqual(["2001:DB8::1"], ips) - def test_wait_until_running_running_after_1_second(self): - RackspaceMockHttp.type = '05_SECOND_DELAY' + def test_wait_until_running_running_after_0_2_second(self): + RackspaceMockHttp.type = "05_SECOND_DELAY" node2, ips = self.driver.wait_until_running( - nodes=[self.node], wait_period=1, - timeout=0.5)[0] + nodes=[self.node], wait_period=0.2, timeout=0.1 + )[0] self.assertEqual(self.node.uuid, node2.uuid) - self.assertEqual(['67.23.21.33'], ips) + self.assertEqual(["67.23.21.33"], ips) - def test_wait_until_running_running_after_1_second_private_ips(self): - RackspaceMockHttp.type = '05_SECOND_DELAY' + def test_wait_until_running_running_after_0_2_second_private_ips(self): + RackspaceMockHttp.type = "05_SECOND_DELAY" node2, ips = self.driver.wait_until_running( - nodes=[self.node], wait_period=1, - timeout=0.5, ssh_interface='private_ips')[0] + nodes=[self.node], wait_period=0.2, timeout=0.1, ssh_interface="private_ips" + )[0] self.assertEqual(self.node.uuid, node2.uuid) - self.assertEqual(['10.176.168.218'], ips) + self.assertEqual(["10.176.168.218"], ips) def test_wait_until_running_invalid_ssh_interface_argument(self): try: - self.driver.wait_until_running(nodes=[self.node], wait_period=1, - ssh_interface='invalid') + self.driver.wait_until_running( + nodes=[self.node], wait_period=1, ssh_interface="invalid" + ) except ValueError: pass else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_wait_until_running_timeout(self): - RackspaceMockHttp.type = 'TIMEOUT' + RackspaceMockHttp.type = "TIMEOUT" try: - self.driver.wait_until_running(nodes=[self.node], wait_period=0.1, - timeout=0.5) - except LibcloudError: - e = sys.exc_info()[1] - self.assertTrue(e.value.find('Timed out') != -1) + self.driver.wait_until_running(nodes=[self.node], wait_period=0.1, timeout=0.2) + except LibcloudError as e: + self.assertTrue(e.value.find("Timed out") != -1) else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_wait_until_running_running_node_missing_from_list_nodes(self): - RackspaceMockHttp.type = 'MISSING' + RackspaceMockHttp.type = "MISSING" try: - self.driver.wait_until_running(nodes=[self.node], wait_period=0.1, - timeout=0.5) - except LibcloudError: - e = sys.exc_info()[1] - self.assertTrue(e.value.find('Timed out after 0.5 second') != -1) + self.driver.wait_until_running(nodes=[self.node], wait_period=0.1, timeout=0.2) + except LibcloudError as e: + self.assertTrue(e.value.find("Timed out after 0.2 second") != -1) else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_wait_until_running_running_multiple_nodes_have_same_uuid(self): - RackspaceMockHttp.type = 'SAME_UUID' + RackspaceMockHttp.type = "SAME_UUID" try: - self.driver.wait_until_running(nodes=[self.node], wait_period=0.1, - timeout=0.5) - except LibcloudError: - e = sys.exc_info()[1] - self.assertTrue( - e.value.find('Unable to match specified uuids') != -1) + self.driver.wait_until_running(nodes=[self.node], wait_period=0.1, timeout=0.2) + except LibcloudError as e: + self.assertTrue(e.value.find("Unable to match specified uuids") != -1) else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_wait_until_running_running_wait_for_multiple_nodes(self): - RackspaceMockHttp.type = 'MULTIPLE_NODES' + RackspaceMockHttp.type = "MULTIPLE_NODES" nodes = self.driver.wait_until_running( - nodes=[self.node, self.node2], wait_period=0.1, - timeout=0.5) + nodes=[self.node, self.node2], wait_period=0.1, timeout=0.5 + ) self.assertEqual(self.node.uuid, nodes[0][0].uuid) self.assertEqual(self.node2.uuid, nodes[1][0].uuid) - self.assertEqual(['67.23.21.33'], nodes[0][1]) - self.assertEqual(['67.23.21.34'], nodes[1][1]) + self.assertEqual(["67.23.21.33"], nodes[0][1]) + self.assertEqual(["67.23.21.34"], nodes[1][1]) def test_ssh_client_connect_success(self): mock_ssh_client = Mock() mock_ssh_client.return_value = None - ssh_client = self.driver._ssh_client_connect( - ssh_client=mock_ssh_client, - timeout=0.5) + ssh_client = self.driver._ssh_client_connect(ssh_client=mock_ssh_client, timeout=0.5) self.assertEqual(mock_ssh_client, ssh_client) def test_ssh_client_connect_timeout(self): mock_ssh_client = Mock() mock_ssh_client.connect = Mock() - mock_ssh_client.connect.side_effect = IOError('bam') + mock_ssh_client.connect.side_effect = IOError("bam") try: - self.driver._ssh_client_connect(ssh_client=mock_ssh_client, - timeout=0.5) - except LibcloudError: - e = sys.exc_info()[1] - self.assertTrue(e.value.find('Giving up') != -1) + self.driver._ssh_client_connect( + ssh_client=mock_ssh_client, wait_period=0.1, timeout=0.2 + ) + except LibcloudError as e: + self.assertTrue(e.value.find("Giving up") != -1) else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") + + @unittest.skipIf(not have_paramiko, "Skipping because paramiko is not available") + def test_ssh_client_connect_immediately_throws_on_fatal_execption(self): + # Verify that fatal exceptions are immediately propagated and ensure + # we don't try to retry on them + from paramiko.ssh_exception import SSHException, PasswordRequiredException + + mock_ssh_client = Mock() + mock_ssh_client.connect = Mock() + mock_ssh_client.connect.side_effect = IOError("bam") + + mock_exceptions = [ + SSHException("Invalid or unsupported key type"), + PasswordRequiredException("private key file is encrypted"), + SSHException("OpenSSH private key file checkints do not match"), + ] + + for mock_exception in mock_exceptions: + mock_ssh_client.connect = Mock(side_effect=mock_exception) + assertRaisesRegex( + self, + mock_exception.__class__, + str(mock_exception), + self.driver._ssh_client_connect, + ssh_client=mock_ssh_client, + wait_period=0.1, + timeout=0.2, + ) def test_run_deployment_script_success(self): task = Mock() ssh_client = Mock() - ssh_client2 = self.driver._run_deployment_script(task=task, - node=self.node, - ssh_client=ssh_client, - max_tries=2) + ssh_client2 = self.driver._run_deployment_script( + task=task, node=self.node, ssh_client=ssh_client, max_tries=2 + ) self.assertTrue(isinstance(ssh_client2, Mock)) def test_run_deployment_script_exception(self): task = Mock() task.run = Mock() - task.run.side_effect = Exception('bar') + task.run.side_effect = Exception("bar") + ssh_client = Mock() + + try: + self.driver._run_deployment_script( + task=task, node=self.node, ssh_client=ssh_client, max_tries=2 + ) + except LibcloudError as e: + self.assertTrue(e.value.find("Failed after 2 tries") != -1) + else: + self.fail("Exception was not thrown") + + def test_run_deployment_script_ssh_command_timeout_fatal_exception(self): + # We shouldn't retry on SSHCommandTimeoutError error since it's fatal + task = Mock() + task.run = Mock() + task.run.side_effect = SSHCommandTimeoutError("ls -la", 10) ssh_client = Mock() try: - self.driver._run_deployment_script(task=task, - node=self.node, - ssh_client=ssh_client, - max_tries=2) - except LibcloudError: - e = sys.exc_info()[1] - self.assertTrue(e.value.find('Failed after 2 tries') != -1) + self.driver._run_deployment_script( + task=task, node=self.node, ssh_client=ssh_client, max_tries=5 + ) + except SSHCommandTimeoutError as e: + self.assertTrue(e.message.find("Command didn't finish") != -1) else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") + + def test_run_deployment_script_reconnect_on_ssh_session_not_active(self): + # Verify that we try to reconnect if task.run() throws exception with + # "SSH client not active" message + global exception_counter + exception_counter = 0 - @patch('libcloud.compute.base.SSHClient') - @patch('libcloud.compute.ssh') + def mock_run(*args, **kwargs): + # Mock run() method which throws "SSH session not active" exception + # during first two calls and on third one it returns None. + global exception_counter + + exception_counter += 1 + + if exception_counter > 2: + return None + + raise Exception("SSH session not active") + + task = Mock() + task.run = Mock() + task.run = mock_run + ssh_client = Mock() + ssh_client.timeout = 20 + + self.assertEqual(ssh_client.connect.call_count, 0) + self.assertEqual(ssh_client.close.call_count, 0) + + self.driver._run_deployment_script( + task=task, node=self.node, ssh_client=ssh_client, max_tries=5 + ) + + self.assertEqual(ssh_client.connect.call_count, 2) + self.assertEqual(ssh_client.close.call_count, 2 + 1) + + @patch("libcloud.compute.base.SSHClient") + @patch("libcloud.compute.ssh") def test_deploy_node_success(self, mock_ssh_module, _): self.driver.create_node = Mock() self.driver.create_node.return_value = self.node @@ -359,49 +505,220 @@ def test_deploy_node_success(self, mock_ssh_module, _): node = self.driver.deploy_node(deploy=deploy) self.assertEqual(self.node.id, node.id) - @patch('libcloud.compute.base.SSHClient') - @patch('libcloud.compute.ssh') - def test_deploy_node_exception_run_deployment_script(self, mock_ssh_module, - _): + @patch("libcloud.compute.base.atexit") + @patch("libcloud.compute.base.SSHClient") + @patch("libcloud.compute.ssh") + def test_deploy_node_at_exit_func_functionality(self, mock_ssh_module, _, mock_at_exit): + self.driver.create_node = Mock() + self.driver.create_node.return_value = self.node + mock_ssh_module.have_paramiko = True + + deploy = Mock() + + def mock_at_exit_func(driver, node): + pass + + # On success, at exit handler should be unregistered + self.assertEqual(mock_at_exit.register.call_count, 0) + self.assertEqual(mock_at_exit.unregister.call_count, 0) + + node = self.driver.deploy_node(deploy=deploy, at_exit_func=mock_at_exit_func) + self.assertEqual(mock_at_exit.register.call_count, 1) + self.assertEqual(mock_at_exit.unregister.call_count, 1) + self.assertEqual(self.node.id, node.id) + + # On deploy failure, at exit handler should also be unregistered + mock_at_exit.reset_mock() + + deploy.run.side_effect = Exception("foo") + + self.assertEqual(mock_at_exit.register.call_count, 0) + self.assertEqual(mock_at_exit.unregister.call_count, 0) + + try: + self.driver.deploy_node(deploy=deploy, at_exit_func=mock_at_exit_func) + except DeploymentError as e: + self.assertTrue(e.node.id, self.node.id) + else: + self.fail("Exception was not thrown") + + self.assertEqual(mock_at_exit.register.call_count, 1) + self.assertEqual(mock_at_exit.unregister.call_count, 1) + + # But it should not be registered on create_node exception + mock_at_exit.reset_mock() + + self.driver.create_node = Mock(side_effect=Exception("Failure")) + + self.assertEqual(mock_at_exit.register.call_count, 0) + self.assertEqual(mock_at_exit.unregister.call_count, 0) + + try: + self.driver.deploy_node(deploy=deploy, at_exit_func=mock_at_exit_func) + except Exception as e: + self.assertTrue("Failure" in str(e)) + else: + self.fail("Exception was not thrown") + + self.assertEqual(mock_at_exit.register.call_count, 0) + self.assertEqual(mock_at_exit.unregister.call_count, 0) + + @patch("libcloud.compute.base.SSHClient") + @patch("libcloud.compute.ssh") + def test_deploy_node_deploy_node_kwargs_except_auth_are_not_propagated_on( + self, mock_ssh_module, _ + ): + # Verify that keyword arguments which are specific to deploy_node() + # are not propagated to create_node() + mock_ssh_module.have_paramiko = True + self.driver.create_node = Mock() + self.driver.create_node.return_value = self.node + self.driver._connect_and_run_deployment_script = Mock() + self.driver._wait_until_running = Mock() + + kwargs = {} + for key in DEPLOY_NODE_KWARGS: + kwargs[key] = key + + kwargs["ssh_interface"] = "public_ips" + kwargs["ssh_alternate_usernames"] = ["foo", "bar"] + kwargs["timeout"] = 10 + + auth = NodeAuthPassword("P@$$w0rd") + + node = self.driver.deploy_node( + name="name", + image="image", + size="size", + auth=auth, + ex_foo="ex_foo", + **kwargs, + ) + self.assertEqual(self.node.id, node.id) + self.assertEqual(self.driver.create_node.call_count, 1) + + call_kwargs = self.driver.create_node.call_args_list[0][1] + expected_call_kwargs = { + "name": "name", + "image": "image", + "size": "size", + "auth": auth, + "ex_foo": "ex_foo", + } + self.assertEqual(expected_call_kwargs, call_kwargs) + + # If driver throws an exception it should fall back to passing in all + # the arguments + global call_count + call_count = 0 + + def create_node( + name, + image, + size, + ex_custom_arg_1, + ex_custom_arg_2, + ex_foo=None, + auth=None, + **kwargs, + ): + global call_count + + call_count += 1 + if call_count == 1: + msg = "create_node() takes at least 5 arguments (7 given)" + raise TypeError(msg) + return self.node + + self.driver.create_node = create_node + + node = self.driver.deploy_node( + name="name", + image="image", + size="size", + auth=auth, + ex_foo="ex_foo", + ex_custom_arg_1="a", + ex_custom_arg_2="b", + **kwargs, + ) + self.assertEqual(self.node.id, node.id) + self.assertEqual(call_count, 2) + + call_count = 0 + + def create_node( + name, + image, + size, + ex_custom_arg_1, + ex_custom_arg_2, + ex_foo=None, + auth=None, + **kwargs, + ): + global call_count + + call_count += 1 + if call_count == 1: + msg = "create_node() missing 3 required positional arguments" + raise TypeError(msg) + return self.node + + self.driver.create_node = create_node + + node = self.driver.deploy_node( + name="name", + image="image", + size="size", + auth=auth, + ex_foo="ex_foo", + ex_custom_arg_1="a", + ex_custom_arg_2="b", + **kwargs, + ) + self.assertEqual(self.node.id, node.id) + self.assertEqual(call_count, 2) + + @patch("libcloud.compute.base.SSHClient") + @patch("libcloud.compute.ssh") + def test_deploy_node_exception_run_deployment_script(self, mock_ssh_module, _): self.driver.create_node = Mock() self.driver.create_node.return_value = self.node mock_ssh_module.have_paramiko = True deploy = Mock() deploy.run = Mock() - deploy.run.side_effect = Exception('foo') + deploy.run.side_effect = Exception("foo") try: self.driver.deploy_node(deploy=deploy) - except DeploymentError: - e = sys.exc_info()[1] + except DeploymentError as e: self.assertTrue(e.node.id, self.node.id) else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") - @patch('libcloud.compute.base.SSHClient') - @patch('libcloud.compute.ssh') - def test_deploy_node_exception_ssh_client_connect(self, mock_ssh_module, - ssh_client): + @patch("libcloud.compute.base.SSHClient") + @patch("libcloud.compute.ssh") + def test_deploy_node_exception_ssh_client_connect(self, mock_ssh_module, ssh_client): self.driver.create_node = Mock() self.driver.create_node.return_value = self.node mock_ssh_module.have_paramiko = True deploy = Mock() - ssh_client.side_effect = IOError('bar') + ssh_client.side_effect = IOError("bar") try: self.driver.deploy_node(deploy=deploy) - except DeploymentError: - e = sys.exc_info()[1] + except DeploymentError as e: self.assertTrue(e.node.id, self.node.id) else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") - @patch('libcloud.compute.ssh') + @patch("libcloud.compute.ssh") def test_deploy_node_depoy_node_not_implemented(self, mock_ssh_module): - self.driver.features = {'create_node': []} + self.driver.features = {"create_node": []} mock_ssh_module.have_paramiko = True try: @@ -409,7 +726,7 @@ def test_deploy_node_depoy_node_not_implemented(self, mock_ssh_module): except NotImplementedError: pass else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") self.driver.features = {} @@ -418,12 +735,12 @@ def test_deploy_node_depoy_node_not_implemented(self, mock_ssh_module): except NotImplementedError: pass else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") - @patch('libcloud.compute.base.SSHClient') - @patch('libcloud.compute.ssh') + @patch("libcloud.compute.base.SSHClient") + @patch("libcloud.compute.ssh") def test_deploy_node_password_auth(self, mock_ssh_module, _): - self.driver.features = {'create_node': ['password']} + self.driver.features = {"create_node": ["password"]} mock_ssh_module.have_paramiko = True self.driver.create_node = Mock() @@ -432,12 +749,10 @@ def test_deploy_node_password_auth(self, mock_ssh_module, _): node = self.driver.deploy_node(deploy=Mock()) self.assertEqual(self.node.id, node.id) - @patch('libcloud.compute.base.SSHClient') - @patch('libcloud.compute.ssh') - def test_exception_is_thrown_is_paramiko_is_not_available(self, - mock_ssh_module, - _): - self.driver.features = {'create_node': ['password']} + @patch("libcloud.compute.base.SSHClient") + @patch("libcloud.compute.ssh") + def test_exception_is_thrown_is_paramiko_is_not_available(self, mock_ssh_module, _): + self.driver.features = {"create_node": ["password"]} self.driver.create_node = Mock() self.driver.create_node.return_value = self.node @@ -445,11 +760,10 @@ def test_exception_is_thrown_is_paramiko_is_not_available(self, try: self.driver.deploy_node(deploy=Mock()) - except RuntimeError: - e = sys.exc_info()[1] - self.assertTrue(str(e).find('paramiko is not installed') != -1) + except RuntimeError as e: + self.assertTrue(str(e).find("paramiko is not installed") != -1) else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") mock_ssh_module.have_paramiko = True node = self.driver.deploy_node(deploy=Mock()) @@ -457,47 +771,46 @@ def test_exception_is_thrown_is_paramiko_is_not_available(self, class RackspaceMockHttp(MockHttp): - fixtures = ComputeFileFixtures('openstack') + fixtures = ComputeFileFixtures("openstack") def _v2_0_tokens(self, method, url, body, headers): - body = self.fixtures.load('_v2_0__auth_deployment.json') - headers = { - 'content-type': 'application/json' - } - return (httplib.OK, body, headers, - httplib.responses[httplib.OK]) + body = self.fixtures.load("_v2_0__auth_deployment.json") + headers = {"content-type": "application/json"} + return (httplib.OK, body, headers, httplib.responses[httplib.OK]) def _v1_0_slug_servers_detail(self, method, url, body, headers): - body = self.fixtures.load( - 'v1_slug_servers_detail_deployment_success.xml') + body = self.fixtures.load("v1_slug_servers_detail_deployment_success.xml") return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) def _v1_0_slug_servers_detail_05_SECOND_DELAY(self, method, url, body, headers): time.sleep(0.5) - body = self.fixtures.load( - 'v1_slug_servers_detail_deployment_success.xml') + body = self.fixtures.load("v1_slug_servers_detail_deployment_success.xml") return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) def _v1_0_slug_servers_detail_TIMEOUT(self, method, url, body, headers): - body = self.fixtures.load( - 'v1_slug_servers_detail_deployment_pending.xml') + body = self.fixtures.load("v1_slug_servers_detail_deployment_pending.xml") return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) def _v1_0_slug_servers_detail_MISSING(self, method, url, body, headers): - body = self.fixtures.load( - 'v1_slug_servers_detail_deployment_missing.xml') + body = self.fixtures.load("v1_slug_servers_detail_deployment_missing.xml") return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) def _v1_0_slug_servers_detail_SAME_UUID(self, method, url, body, headers): - body = self.fixtures.load( - 'v1_slug_servers_detail_deployment_same_uuid.xml') + body = self.fixtures.load("v1_slug_servers_detail_deployment_same_uuid.xml") return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) def _v1_0_slug_servers_detail_MULTIPLE_NODES(self, method, url, body, headers): - body = self.fixtures.load( - 'v1_slug_servers_detail_deployment_multiple_nodes.xml') + body = self.fixtures.load("v1_slug_servers_detail_deployment_multiple_nodes.xml") + return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) + + def _v1_0_slug_servers_detail_IPV6(self, method, url, body, headers): + body = self.fixtures.load("v1_slug_servers_detail_deployment_ipv6.xml") + return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) + + def _v1_0_slug_servers_detail_NO_IP(self, method, url, body, headers): + body = self.fixtures.load("v1_slug_servers_detail_deployment_no_ip.xml") return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_digitalocean_v1.py b/libcloud/test/compute/test_digitalocean_v1.py deleted file mode 100644 index 030e2ee07b..0000000000 --- a/libcloud/test/compute/test_digitalocean_v1.py +++ /dev/null @@ -1,182 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import sys -import unittest - -try: - import simplejson as json -except ImportError: - import json # NOQA - -from libcloud.utils.py3 import httplib - -from libcloud.common.types import InvalidCredsError -from libcloud.compute.base import NodeImage -from libcloud.compute.drivers.digitalocean import DigitalOceanNodeDriver - -from libcloud.test import LibcloudTestCase, MockHttpTestCase -from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.test.secrets import DIGITALOCEAN_v1_PARAMS - - -# class DigitalOceanTests(unittest.TestCase, TestCaseMixin): -class DigitalOcean_v1_Tests(LibcloudTestCase): - - def setUp(self): - DigitalOceanNodeDriver.connectionCls.conn_classes = \ - (None, DigitalOceanMockHttp) - DigitalOceanMockHttp.type = None - self.driver = DigitalOceanNodeDriver(*DIGITALOCEAN_v1_PARAMS, - api_version='v1') - - def test_authentication(self): - DigitalOceanMockHttp.type = 'UNAUTHORIZED_CLIENT' - self.assertRaises(InvalidCredsError, self.driver.list_nodes) - - def test_list_images_success(self): - images = self.driver.list_images() - self.assertTrue(len(images) >= 1) - - image = images[0] - self.assertTrue(image.id is not None) - self.assertTrue(image.name is not None) - - def test_list_sizes_success(self): - sizes = self.driver.list_sizes() - self.assertTrue(len(sizes) >= 1) - - size = sizes[0] - self.assertTrue(size.id is not None) - self.assertEqual(size.name, '512MB') - self.assertEqual(size.ram, 512) - - size = sizes[4] - self.assertTrue(size.id is not None) - self.assertEqual(size.name, '8GB') - self.assertEqual(size.ram, 8 * 1024) - - def test_list_locations_success(self): - locations = self.driver.list_locations() - self.assertTrue(len(locations) >= 1) - - location = locations[0] - self.assertEqual(location.id, '1') - self.assertEqual(location.name, 'New York 1') - - def test_list_nodes_success(self): - nodes = self.driver.list_nodes() - self.assertEqual(len(nodes), 1) - self.assertEqual(nodes[0].name, 'test-2') - self.assertEqual(nodes[0].public_ips, []) - self.assertEqual(nodes[0].extra['image_id'], 1601) - self.assertEqual(nodes[0].extra['size_id'], 66) - - def test_create_node_invalid_size(self): - image = NodeImage(id='invalid', name=None, driver=self.driver) - size = self.driver.list_sizes()[0] - location = self.driver.list_locations()[0] - - DigitalOceanMockHttp.type = 'INVALID_IMAGE' - expected_msg = r'You specified an invalid image for Droplet creation. \(code: 404\)' - self.assertRaisesRegexp(Exception, expected_msg, - self.driver.create_node, - name='test', size=size, image=image, - location=location) - - def test_reboot_node_success(self): - node = self.driver.list_nodes()[0] - result = self.driver.reboot_node(node) - self.assertTrue(result) - - def test_destroy_node_success(self): - node = self.driver.list_nodes()[0] - result = self.driver.destroy_node(node) - self.assertTrue(result) - - def test_ex_rename_node_success(self): - node = self.driver.list_nodes()[0] - result = self.driver.ex_rename_node(node, 'fedora helios') - self.assertTrue(result) - - def test_ex_list_ssh_keys(self): - keys = self.driver.ex_list_ssh_keys() - self.assertEqual(len(keys), 1) - - self.assertEqual(keys[0].id, 7717) - self.assertEqual(keys[0].name, 'test1') - self.assertEqual(keys[0].pub_key, None) - - def test_ex_destroy_ssh_key(self): - key = self.driver.ex_list_ssh_keys()[0] - result = self.driver.ex_destroy_ssh_key(key.id) - self.assertTrue(result) - - -class DigitalOceanMockHttp(MockHttpTestCase): - fixtures = ComputeFileFixtures('digitalocean_v1') - - def _v1_regions(self, method, url, body, headers): - body = self.fixtures.load('list_locations.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _v1_images(self, method, url, body, headers): - body = self.fixtures.load('list_images.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _v1_sizes(self, method, url, body, headers): - body = self.fixtures.load('list_sizes.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _v1_droplets(self, method, url, body, headers): - body = self.fixtures.load('list_nodes.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _v1_droplets_new_INVALID_IMAGE(self, method, url, body, headers): - # reboot_node - body = self.fixtures.load('error_invalid_image.json') - return (httplib.NOT_FOUND, body, {}, httplib.responses[httplib.NOT_FOUND]) - - def _v1_droplets_119461_reboot(self, method, url, body, headers): - # reboot_node - body = self.fixtures.load('reboot_node.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _v1_droplets_119461_destroy(self, method, url, body, headers): - # destroy_node - self.assertUrlContainsQueryParams(url, {'scrub_data': '1'}) - body = self.fixtures.load('destroy_node.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _v1_droplets_119461_rename(self, method, url, body, headers): - # reboot_node - self.assertUrlContainsQueryParams(url, {'name': 'fedora helios'}) - body = self.fixtures.load('ex_rename_node.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _v1_ssh_keys(self, method, url, body, headers): - body = self.fixtures.load('ex_list_ssh_keys.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _v1_ssh_keys_7717_destroy(self, method, url, body, headers): - # destroy_ssh_key - body = self.fixtures.load('ex_destroy_ssh_key.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _v1_droplets_UNAUTHORIZED_CLIENT(self, method, url, body, headers): - body = self.fixtures.load('error.txt') - return (httplib.FOUND, body, {}, httplib.responses[httplib.FOUND]) - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_digitalocean_v2.py b/libcloud/test/compute/test_digitalocean_v2.py index 127011a0ce..84eb5f01d5 100644 --- a/libcloud/test/compute/test_digitalocean_v2.py +++ b/libcloud/test/compute/test_digitalocean_v2.py @@ -14,34 +14,64 @@ # limitations under the License. import sys import unittest +from datetime import datetime + +from libcloud.http import LibcloudConnection +from libcloud.test import MockHttp, LibcloudTestCase +from libcloud.utils.py3 import httplib, assertRaisesRegex +from libcloud.common.types import InvalidCredsError +from libcloud.compute.base import NodeImage +from libcloud.test.secrets import DIGITALOCEAN_v1_PARAMS, DIGITALOCEAN_v2_PARAMS +from libcloud.utils.iso8601 import UTC +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.common.digitalocean import ( + DigitalOcean_v1_Error, + DigitalOceanBaseDriver, + DigitalOcean_v2_BaseDriver, +) +from libcloud.compute.drivers.digitalocean import ( + DigitalOceanNodeDriver, + DigitalOcean_v2_NodeDriver, +) try: import simplejson as json except ImportError: import json # NOQA -from libcloud.utils.py3 import httplib - -from libcloud.common.types import InvalidCredsError -from libcloud.compute.base import NodeImage -from libcloud.compute.drivers.digitalocean import DigitalOceanNodeDriver - -from libcloud.test import LibcloudTestCase, MockHttpTestCase -from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.test.secrets import DIGITALOCEAN_v2_PARAMS - # class DigitalOceanTests(unittest.TestCase, TestCaseMixin): class DigitalOcean_v2_Tests(LibcloudTestCase): - def setUp(self): - DigitalOceanNodeDriver.connectionCls.conn_classes = \ - (None, DigitalOceanMockHttp) - DigitalOceanMockHttp.type = None + DigitalOceanBaseDriver.connectionCls.conn_class = DigitalOceanComputeMockHttp + DigitalOcean_v2_BaseDriver.connectionCls.conn_class = DigitalOceanComputeMockHttp + DigitalOceanNodeDriver.connectionCls.conn_class = DigitalOceanComputeMockHttp + DigitalOcean_v2_NodeDriver.connectionCls.conn_class = DigitalOceanComputeMockHttp + DigitalOceanComputeMockHttp.type = None self.driver = DigitalOceanNodeDriver(*DIGITALOCEAN_v2_PARAMS) + def tearDown(self): + LibcloudConnection.type = None + DigitalOceanComputeMockHttp.type = None + + def test_v1_Error(self): + self.assertRaises( + DigitalOcean_v1_Error, + DigitalOceanNodeDriver, + *DIGITALOCEAN_v1_PARAMS, + api_version="v1", + ) + + def test_v2_uses_v1_key(self): + self.assertRaises( + InvalidCredsError, + DigitalOceanNodeDriver, + *DIGITALOCEAN_v1_PARAMS, + api_version="v2", + ) + def test_authentication(self): - DigitalOceanMockHttp.type = 'UNAUTHORIZED' + DigitalOceanComputeMockHttp.type = "UNAUTHORIZED" self.assertRaises(InvalidCredsError, self.driver.list_nodes) def test_list_images_success(self): @@ -58,107 +88,200 @@ def test_list_sizes_success(self): size = sizes[0] self.assertTrue(size.id is not None) - self.assertEqual(size.name, '512mb') + self.assertEqual(size.name, "512mb") self.assertEqual(size.ram, 512) size = sizes[1] self.assertTrue(size.id is not None) - self.assertEqual(size.name, '1gb') + self.assertEqual(size.name, "1gb") self.assertEqual(size.ram, 1024) + def test_list_sizes_filter_by_location_success(self): + location = self.driver.list_locations()[1] + sizes = self.driver.list_sizes(location=location) + self.assertTrue(len(sizes) >= 1) + + size = sizes[0] + self.assertTrue(size.id is not None) + self.assertEqual(size.name, "512mb") + self.assertTrue(location.id in size.extra["regions"]) + + location = self.driver.list_locations()[1] + location.id = "doesntexist" + sizes = self.driver.list_sizes(location=location) + self.assertEqual(len(sizes), 0) + def test_list_locations_success(self): locations = self.driver.list_locations() - self.assertTrue(len(locations) >= 1) + self.assertTrue(len(locations) == 2) location = locations[0] - self.assertEqual(location.id, 'nyc1') - self.assertEqual(location.name, 'New York 1') + self.assertEqual(location.id, "nyc1") + self.assertEqual(location.name, "New York 1") + + locations = self.driver.list_locations(ex_available=True) + self.assertTrue(len(locations) == 2) + + locations = self.driver.list_locations(ex_available=False) + self.assertTrue(len(locations) == 3) def test_list_nodes_success(self): nodes = self.driver.list_nodes() self.assertEqual(len(nodes), 1) - self.assertEqual(nodes[0].name, 'example.com') - self.assertEqual(nodes[0].public_ips, ['104.236.32.182']) - self.assertEqual(nodes[0].extra['image']['id'], 6918990) - self.assertEqual(nodes[0].extra['size_slug'], '512mb') + self.assertEqual(nodes[0].name, "ubuntu-s-1vcpu-1gb-sfo3-01") + self.assertEqual( + nodes[0].public_ips, + ["128.199.13.158", "2604:a880:4:1d0::142:9000"], + ) + self.assertEqual(nodes[0].extra["image"]["id"], 69463186) + self.assertEqual(nodes[0].extra["size_slug"], "s-1vcpu-1gb") + self.assertEqual(len(nodes[0].extra["tags"]), 0) + + def test_to_node_includes_ipv6_addresses(self): + # Both IPv4 and IPv6 addresses must be reported, and multiple + # addresses of the same type must all be kept. See GITHUB-1738. + data = { + "id": 1, + "name": "ipv6-droplet", + "status": "active", + "created_at": "2020-10-15T13:58:22Z", + "networks": { + "v4": [ + {"ip_address": "10.0.0.1", "type": "private"}, + {"ip_address": "10.0.0.2", "type": "private"}, + {"ip_address": "159.223.187.157", "type": "public"}, + {"ip_address": "159.223.187.158", "type": "public"}, + ], + "v6": [ + {"ip_address": "2604:a880:400:d0::1c58:e001", "type": "public"}, + ], + }, + } + node = self.driver._to_node(data) + self.assertEqual( + node.public_ips, + ["159.223.187.157", "159.223.187.158", "2604:a880:400:d0::1c58:e001"], + ) + self.assertEqual(node.private_ips, ["10.0.0.1", "10.0.0.2"]) + + def test_list_nodes_fills_created_datetime(self): + nodes = self.driver.list_nodes() + self.assertEqual(nodes[0].created_at, datetime(2020, 10, 15, 13, 58, 22, tzinfo=UTC)) def test_create_node_invalid_size(self): - image = NodeImage(id='invalid', name=None, driver=self.driver) + image = NodeImage(id="invalid", name=None, driver=self.driver) size = self.driver.list_sizes()[0] location = self.driver.list_locations()[0] - DigitalOceanMockHttp.type = 'INVALID_IMAGE' - expected_msg = r'You specified an invalid image for Droplet creation. \(code: 404\)' - self.assertRaisesRegexp(Exception, expected_msg, - self.driver.create_node, - name='test', size=size, image=image, - location=location) + DigitalOceanComputeMockHttp.type = "INVALID_IMAGE" + expected_msg = ( + r"You specified an invalid image for Droplet creation." + + r" \(code: (404|HTTPStatus.NOT_FOUND)\)" + ) + assertRaisesRegex( + self, + Exception, + expected_msg, + self.driver.create_node, + name="test", + size=size, + image=image, + location=location, + ) def test_reboot_node_success(self): node = self.driver.list_nodes()[0] - DigitalOceanMockHttp.type = 'REBOOT' + DigitalOceanComputeMockHttp.type = "REBOOT" result = self.driver.reboot_node(node) self.assertTrue(result) def test_create_image_success(self): node = self.driver.list_nodes()[0] - DigitalOceanMockHttp.type = 'SNAPSHOT' - result = self.driver.create_image(node, 'My snapshot') + DigitalOceanComputeMockHttp.type = "SNAPSHOT" + result = self.driver.create_image(node, "My snapshot") self.assertTrue(result) def test_get_image_success(self): image = self.driver.get_image(12345) - self.assertEqual(image.name, 'My snapshot') - self.assertEqual(image.id, '12345') - self.assertEqual(image.extra['distribution'], 'Ubuntu') + self.assertEqual(image.name, "My snapshot") + self.assertEqual(image.id, "12345") + self.assertEqual(image.extra["distribution"], "Ubuntu") def test_delete_image_success(self): image = self.driver.get_image(12345) - DigitalOceanMockHttp.type = 'DESTROY' + DigitalOceanComputeMockHttp.type = "DESTROY" result = self.driver.delete_image(image) self.assertTrue(result) def test_ex_power_on_node_success(self): node = self.driver.list_nodes()[0] - DigitalOceanMockHttp.type = 'POWERON' + DigitalOceanComputeMockHttp.type = "POWERON" result = self.driver.ex_power_on_node(node) self.assertTrue(result) def test_ex_shutdown_node_success(self): node = self.driver.list_nodes()[0] - DigitalOceanMockHttp.type = 'SHUTDOWN' + DigitalOceanComputeMockHttp.type = "SHUTDOWN" result = self.driver.ex_shutdown_node(node) self.assertTrue(result) + def test_ex_hard_reboot_success(self): + node = self.driver.list_nodes()[0] + DigitalOceanComputeMockHttp.type = "POWERCYCLE" + result = self.driver.ex_hard_reboot(node) + self.assertTrue(result) + + def test_ex_rebuild_node_success(self): + node = self.driver.list_nodes()[0] + DigitalOceanComputeMockHttp.type = "REBUILD" + result = self.driver.ex_rebuild_node(node) + self.assertTrue(result) + + def test_ex_resize_node_success(self): + node = self.driver.list_nodes()[0] + size = self.driver.list_sizes()[0] + DigitalOceanComputeMockHttp.type = "RESIZE" + result = self.driver.ex_resize_node(node, size) + self.assertTrue(result) + def test_destroy_node_success(self): node = self.driver.list_nodes()[0] - DigitalOceanMockHttp.type = 'DESTROY' + DigitalOceanComputeMockHttp.type = "DESTROY" result = self.driver.destroy_node(node) self.assertTrue(result) + def test_ex_change_kernel_success(self): + node = self.driver.list_nodes()[0] + DigitalOceanComputeMockHttp.type = "KERNELCHANGE" + result = self.driver.ex_change_kernel(node, 7515) + self.assertTrue(result) + + def test_ex_enable_ipv6_success(self): + node = self.driver.list_nodes()[0] + DigitalOceanComputeMockHttp.type = "ENABLEIPV6" + result = self.driver.ex_enable_ipv6(node) + self.assertTrue(result) + def test_ex_rename_node_success(self): node = self.driver.list_nodes()[0] - DigitalOceanMockHttp.type = 'RENAME' - result = self.driver.ex_rename_node(node, 'fedora helios') + DigitalOceanComputeMockHttp.type = "RENAME" + result = self.driver.ex_rename_node(node, "fedora helios") self.assertTrue(result) def test_list_key_pairs(self): keys = self.driver.list_key_pairs() self.assertEqual(len(keys), 1) - self.assertEqual(keys[0].extra['id'], 7717) - self.assertEqual(keys[0].name, 'test1') - self.assertEqual(keys[0].public_key, - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDGk5 example") + self.assertEqual(keys[0].extra["id"], 7717) + self.assertEqual(keys[0].name, "test1") + self.assertEqual(keys[0].public_key, "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDGk5 example") def test_create_key_pair(self): - DigitalOceanMockHttp.type = 'CREATE' + DigitalOceanComputeMockHttp.type = "CREATE" key = self.driver.create_key_pair( - name="test1", - public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQsxRiUKn example" + name="test1", public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQsxRiUKn example" ) self.assertEqual(key.name, "test1") - self.assertEqual(key.fingerprint, - "f5:d1:78:ed:28:72:5f:e1:ac:94:fd:1f:e0:a3:48:6d") + self.assertEqual(key.fingerprint, "f5:d1:78:ed:28:72:5f:e1:ac:94:fd:1f:e0:a3:48:6d") def test_delete_key_pair(self): key = self.driver.list_key_pairs()[0] @@ -166,103 +289,338 @@ def test_delete_key_pair(self): self.assertTrue(result) def test__paginated_request_single_page(self): - nodes = self.driver._paginated_request('/v2/droplets', 'droplets') - self.assertEqual(nodes[0]['name'], 'example.com') - self.assertEqual(nodes[0]['image']['id'], 6918990) - self.assertEqual(nodes[0]['size_slug'], '512mb') + nodes = self.driver._paginated_request("/v2/droplets", "droplets") + self.assertEqual(nodes[0]["name"], "ubuntu-s-1vcpu-1gb-sfo3-01") + self.assertEqual(nodes[0]["image"]["id"], 69463186) + self.assertEqual(nodes[0]["size_slug"], "s-1vcpu-1gb") def test__paginated_request_two_pages(self): - DigitalOceanMockHttp.type = 'PAGE_ONE' - nodes = self.driver._paginated_request('/v2/droplets', 'droplets') + DigitalOceanComputeMockHttp.type = "PAGE_ONE" + nodes = self.driver._paginated_request("/v2/droplets", "droplets") self.assertEqual(len(nodes), 2) + def test_list_volumes(self): + volumes = self.driver.list_volumes() + self.assertEqual(len(volumes), 1) + volume = volumes[0] + self.assertEqual(volume.id, "62766883-2c28-11e6-b8e6-000f53306ae1") + self.assertEqual(volume.name, "example") + self.assertEqual(volume.size, 4) + self.assertEqual(volume.driver, self.driver) + + def test_list_volumes_empty(self): + DigitalOceanComputeMockHttp.type = "EMPTY" + volumes = self.driver.list_volumes() + self.assertEqual(len(volumes), 0) + + def test_create_volume(self): + nyc1 = [r for r in self.driver.list_locations() if r.id == "nyc1"][0] + DigitalOceanComputeMockHttp.type = "CREATE" + volume = self.driver.create_volume(4, "example", nyc1) + self.assertEqual(volume.id, "62766883-2c28-11e6-b8e6-000f53306ae1") + self.assertEqual(volume.name, "example") + self.assertEqual(volume.size, 4) + self.assertEqual(volume.driver, self.driver) + + def test_attach_volume(self): + node = self.driver.list_nodes()[0] + volume = self.driver.list_volumes()[0] + DigitalOceanComputeMockHttp.type = "ATTACH" + resp = self.driver.attach_volume(node, volume) + self.assertTrue(resp) + + def test_detach_volume(self): + volume = self.driver.list_volumes()[0] + DigitalOceanComputeMockHttp.type = "DETACH" + resp = self.driver.detach_volume(volume) + self.assertTrue(resp) + + def test_destroy_volume(self): + volume = self.driver.list_volumes()[0] + DigitalOceanComputeMockHttp.type = "DESTROY" + resp = self.driver.destroy_volume(volume) + self.assertTrue(resp) + + def test_list_volume_snapshots(self): + volume = self.driver.list_volumes()[0] + snapshots = self.driver.list_volume_snapshots(volume) + self.assertEqual(len(snapshots), 3) + snapshot1, snapshot2, snapshot3 = snapshots + self.assertEqual(snapshot1.id, "c0def940-9324-11e6-9a56-000f533176b1") + self.assertEqual(snapshot2.id, "c2036724-9343-11e6-aef4-000f53315a41") + self.assertEqual(snapshot3.id, "d347e033-9343-11e6-9a56-000f533176b1") + + def test_create_volume_snapshot(self): + volume = self.driver.list_volumes()[0] + DigitalOceanComputeMockHttp.type = "CREATE" + snapshot = self.driver.create_volume_snapshot(volume, "test-snapshot") + self.assertEqual(snapshot.id, "c0def940-9324-11e6-9a56-000f533176b1") + self.assertEqual(snapshot.name, "test-snapshot") + self.assertEqual(volume.driver, self.driver) + + def test_delete_volume_snapshot(self): + volume = self.driver.list_volumes()[0] + snapshot = self.driver.list_volume_snapshots(volume)[0] + DigitalOceanComputeMockHttp.type = "DELETE" + result = self.driver.delete_volume_snapshot(snapshot) + self.assertTrue(result) + + def test_ex_get_node_details(self): + node = self.driver.ex_get_node_details("3164444") + self.assertEqual(node.name, "example.com") + self.assertEqual(node.public_ips, ["36.123.0.123"]) + self.assertEqual(node.extra["image"]["id"], 12089443) + self.assertEqual(node.extra["size_slug"], "8gb") + self.assertEqual(len(node.extra["tags"]), 2) + + def test_ex_create_floating_ip(self): + nyc1 = [r for r in self.driver.list_locations() if r.id == "nyc1"][0] + floating_ip = self.driver.ex_create_floating_ip(nyc1) + + # Note that this is the ID. There is no real ID for a floating IP at + # DigitalOcean, but the IP is unique so we can use that instead. + self.assertEqual(floating_ip.id, "167.138.123.111") + self.assertEqual(floating_ip.ip_address, "167.138.123.111") + self.assertEqual(floating_ip.extra["region"]["slug"], "nyc1") + # The newly created floating IP reserved to a region is not + # associated with any droplet. See the DigitalOcean API docs + # how to create a floating IP that is associated with an instance + # from the start. This API call creates an unattached IP. + self.assertIsNone(floating_ip.node_id) + + def test_ex_delete_floating_ip(self): + nyc1 = [r for r in self.driver.list_locations() if r.id == "nyc1"][0] + floating_ip = self.driver.ex_create_floating_ip(nyc1) + ret = self.driver.ex_delete_floating_ip(floating_ip) + + # The API returns 204 NO CONTENT if all is well. + self.assertTrue(ret) + + def test_floating_ip_can_be_deleted_by_calling_delete_on_floating_ip_object( + self, + ): # noqa: E501 + nyc1 = [r for r in self.driver.list_locations() if r.id == "nyc1"][0] + floating_ip = self.driver.ex_create_floating_ip(nyc1) + ret = floating_ip.delete() + + self.assertTrue(ret) + + def test_list_floating_ips(self): + floating_ips = self.driver.ex_list_floating_ips() + + self.assertEqual(len(floating_ips), 2, "Wrong floating IPs count") + + floating_ip = floating_ips[0] + self.assertEqual(floating_ip.id, "133.166.122.204") + self.assertEqual(floating_ip.ip_address, "133.166.122.204") + self.assertEqual(floating_ip.extra["region"]["slug"], "ams3") + self.assertEqual(84155775, floating_ip.node_id) + + def test_get_floating_ip(self): + floating_ip = self.driver.ex_get_floating_ip("133.166.122.204") + + self.assertEqual(floating_ip.id, "133.166.122.204") + self.assertEqual(floating_ip.ip_address, "133.166.122.204") + self.assertEqual(floating_ip.extra["region"]["slug"], "ams3") + self.assertEqual(84155775, floating_ip.node_id) + + def test_ex_attach_floating_ip_to_node(self): + node = self.driver.list_nodes()[0] + floating_ip = self.driver.ex_get_floating_ip("133.166.122.204") + + ret = self.driver.ex_attach_floating_ip_to_node(node, floating_ip) + + self.assertTrue(ret) + + def test_ex_detach_floating_ip_from_node(self): + node = self.driver.list_nodes()[0] + floating_ip = self.driver.ex_get_floating_ip("154.138.103.175") + + ret = self.driver.ex_detach_floating_ip_from_node(node, floating_ip) -class DigitalOceanMockHttp(MockHttpTestCase): - fixtures = ComputeFileFixtures('digitalocean_v2') + self.assertTrue(ret) + + +class DigitalOceanComputeMockHttp(MockHttp): + fixtures = ComputeFileFixtures("digitalocean_v2") def _v2_regions(self, method, url, body, headers): - body = self.fixtures.load('list_locations.json') + body = self.fixtures.load("list_locations.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _v2_images(self, method, url, body, headers): - body = self.fixtures.load('list_images.json') + body = self.fixtures.load("list_images.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _v2_sizes(self, method, url, body, headers): - body = self.fixtures.load('list_sizes.json') + body = self.fixtures.load("list_sizes.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _v2_droplets(self, method, url, body, headers): - body = self.fixtures.load('list_nodes.json') + body = self.fixtures.load("list_nodes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_droplets_3164444(self, method, url, body, headers): + body = self.fixtures.load("list_node.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _v2_droplets_INVALID_IMAGE(self, method, url, body, headers): - body = self.fixtures.load('error_invalid_image.json') - return (httplib.NOT_FOUND, body, {}, - httplib.responses[httplib.NOT_FOUND]) + body = self.fixtures.load("error_invalid_image.json") + return (httplib.NOT_FOUND, body, {}, httplib.responses[httplib.NOT_FOUND]) def _v2_droplets_3164444_actions_REBOOT(self, method, url, body, headers): # reboot_node - body = self.fixtures.load('reboot_node.json') + body = self.fixtures.load("reboot_node.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _v2_droplets_3164444_DESTROY(self, method, url, body, headers): # destroy_node - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_droplets_3164444_actions_KERNELCHANGE(self, method, url, body, headers): + # change_kernel + body = self.fixtures.load("ex_change_kernel.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + + def _v2_droplets_3164444_actions_ENABLEIPV6(self, method, url, body, headers): + # enable_ipv6 + body = self.fixtures.load("ex_enable_ipv6.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _v2_droplets_3164444_actions_RENAME(self, method, url, body, headers): # rename_node - body = self.fixtures.load('ex_rename_node.json') + body = self.fixtures.load("ex_rename_node.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _v2_droplets_3164444_actions_SNAPSHOT(self, method, url, body, headers): # create_image - body = self.fixtures.load('create_image.json') + body = self.fixtures.load("create_image.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _v2_images_12345(self, method, url, body, headers): # get_image - body = self.fixtures.load('get_image.json') + body = self.fixtures.load("get_image.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _v2_images_12345_DESTROY(self, method, url, body, headers): # delete_image - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _v2_droplets_3164444_actions_POWERON(self, method, url, body, headers): # ex_power_on_node - body = self.fixtures.load('ex_power_on_node.json') + body = self.fixtures.load("ex_power_on_node.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _v2_droplets_3164444_actions_SHUTDOWN(self, method, url, body, headers): # ex_shutdown_node - body = self.fixtures.load('ex_shutdown_node.json') + body = self.fixtures.load("ex_shutdown_node.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + def _v2_droplets_3164444_actions_POWERCYCLE(self, method, url, body, headers): + # ex_hard_reboot + body = self.fixtures.load("ex_hard_reboot.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.OK]) + + def _v2_droplets_3164444_actions_REBUILD(self, method, url, body, headers): + # ex_rebuild_node + body = self.fixtures.load("ex_rebuild_node.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.OK]) + + def _v2_droplets_3164444_actions_RESIZE(self, method, url, body, headers): + # ex_resize_node + body = self.fixtures.load("ex_resize_node.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.OK]) + def _v2_account_keys(self, method, url, body, headers): - body = self.fixtures.load('list_key_pairs.json') + body = self.fixtures.load("list_key_pairs.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _v2_account_keys_7717(self, method, url, body, headers): # destroy_ssh_key - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _v2_account_keys_CREATE(self, method, url, body, headers): # create_ssh_key - body = self.fixtures.load('create_key_pair.json') + body = self.fixtures.load("create_key_pair.json") return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _v2_droplets_UNAUTHORIZED(self, method, url, body, headers): - body = self.fixtures.load('error.json') - return (httplib.UNAUTHORIZED, body, {}, - httplib.responses[httplib.UNAUTHORIZED]) + body = self.fixtures.load("error.json") + return (httplib.UNAUTHORIZED, body, {}, httplib.responses[httplib.UNAUTHORIZED]) def _v2_droplets_PAGE_ONE(self, method, url, body, headers): - body = self.fixtures.load('list_nodes_page_1.json') + body = self.fixtures.load("list_nodes_page_1.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_volumes(self, method, url, body, headers): + body = self.fixtures.load("list_volumes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_volumes_EMPTY(self, method, url, body, headers): + body = self.fixtures.load("list_volumes_empty.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_volumes_CREATE(self, method, url, body, headers): + body = self.fixtures.load("create_volume.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + + def _v2_volumes_actions_ATTACH(self, method, url, body, headers): + body = self.fixtures.load("attach_volume.json") + return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) + + def _v2_volumes_DETACH(self, method, url, body, headers): + body = self.fixtures.load("detach_volume.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_volumes_62766883_2c28_11e6_b8e6_000f53306ae1_DESTROY(self, method, url, body, headers): + return (httplib.NO_CONTENT, None, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_volumes_62766883_2c28_11e6_b8e6_000f53306ae1_snapshots_CREATE( + self, method, url, body, headers + ): + body = self.fixtures.load("create_volume_snapshot.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + + def _v2_volumes_62766883_2c28_11e6_b8e6_000f53306ae1_snapshots( + self, method, url, body, headers + ): + body = self.fixtures.load("list_volume_snapshots.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) -if __name__ == '__main__': + def _v2_snapshots_c0def940_9324_11e6_9a56_000f533176b1_DELETE(self, method, url, body, headers): + return (httplib.NO_CONTENT, None, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_floating_ips(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("create_floating_ip.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "GET": + body = self.fixtures.load("list_floating_ips.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + raise NotImplementedError() + + def _v2_floating_ips_167_138_123_111(self, method, url, body, headers): + if method == "DELETE": + body = "" + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + else: + raise NotImplementedError() + + def _v2_floating_ips_133_166_122_204_actions(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("attach_floating_ip.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + else: + raise NotImplementedError() + + def _v2_floating_ips_154_138_103_175_actions(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("detach_floating_ip.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + else: + raise NotImplementedError() + + +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_dimensiondata_v2_3.py b/libcloud/test/compute/test_dimensiondata_v2_3.py new file mode 100644 index 0000000000..56edbefbe4 --- /dev/null +++ b/libcloud/test/compute/test_dimensiondata_v2_3.py @@ -0,0 +1,3572 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +from types import GeneratorType + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import ET, httplib +from libcloud.utils.xml import findall, findtext, fixxpath +from libcloud.common.types import InvalidCredsError +from libcloud.compute.base import Node, NodeLocation, NodeAuthPassword +from libcloud.test.compute import TestCaseMixin +from libcloud.test.secrets import DIMENSIONDATA_PARAMS +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.common.dimensiondata import ( + TYPES_URN, + DimensionDataTag, + DimensionDataPort, + DimensionDataTagKey, + DimensionDataPortList, + DimensionDataIpAddress, + DimensionDataServerDisk, + NetworkDomainServicePlan, + DimensionDataAPIException, + DimensionDataChildPortList, + DimensionDataIpAddressList, + DimensionDataServerVMWareTools, + DimensionDataChildIpAddressList, + DimensionDataServerCpuSpecification, +) +from libcloud.compute.drivers.dimensiondata import DimensionDataNic +from libcloud.compute.drivers.dimensiondata import DimensionDataNodeDriver as DimensionData + + +class DimensionData_v2_3_Tests(unittest.TestCase, TestCaseMixin): + def setUp(self): + DimensionData.connectionCls.active_api_version = "2.3" + DimensionData.connectionCls.conn_class = DimensionDataMockHttp + DimensionDataMockHttp.type = None + self.driver = DimensionData(*DIMENSIONDATA_PARAMS) + + def test_invalid_region(self): + with self.assertRaises(ValueError): + DimensionData(*DIMENSIONDATA_PARAMS, region="blah") + + def test_invalid_creds(self): + DimensionDataMockHttp.type = "UNAUTHORIZED" + with self.assertRaises(InvalidCredsError): + self.driver.list_nodes() + + def test_get_account_details(self): + DimensionDataMockHttp.type = None + ret = self.driver.connection.get_account_details() + self.assertEqual(ret.full_name, "Test User") + self.assertEqual(ret.first_name, "Test") + self.assertEqual(ret.email, "test@example.com") + + def test_list_locations_response(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_locations() + self.assertEqual(len(ret), 5) + first_loc = ret[0] + self.assertEqual(first_loc.id, "NA3") + self.assertEqual(first_loc.name, "US - West") + self.assertEqual(first_loc.country, "US") + + def test_list_nodes_response(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_nodes() + self.assertEqual(len(ret), 7) + + def test_node_extras(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_nodes() + self.assertTrue(isinstance(ret[0].extra["vmWareTools"], DimensionDataServerVMWareTools)) + self.assertTrue(isinstance(ret[0].extra["cpu"], DimensionDataServerCpuSpecification)) + self.assertTrue(isinstance(ret[0].extra["disks"], list)) + self.assertTrue(isinstance(ret[0].extra["disks"][0], DimensionDataServerDisk)) + self.assertEqual(ret[0].extra["disks"][0].size_gb, 10) + self.assertTrue(isinstance(ret[1].extra["disks"], list)) + self.assertTrue(isinstance(ret[1].extra["disks"][0], DimensionDataServerDisk)) + self.assertEqual(ret[1].extra["disks"][0].size_gb, 10) + + def test_server_states(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_nodes() + self.assertTrue(ret[0].state == "running") + self.assertTrue(ret[1].state == "starting") + self.assertTrue(ret[2].state == "stopping") + self.assertTrue(ret[3].state == "reconfiguring") + self.assertTrue(ret[4].state == "running") + self.assertTrue(ret[5].state == "terminated") + self.assertTrue(ret[6].state == "stopped") + self.assertEqual(len(ret), 7) + + def test_list_nodes_response_PAGINATED(self): + DimensionDataMockHttp.type = "PAGINATED" + ret = self.driver.list_nodes() + self.assertEqual(len(ret), 9) + + def test_paginated_mcp2_call_EMPTY(self): + # cache org + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "EMPTY" + node_list_generator = self.driver.connection.paginated_request_with_orgId_api_2( + "server/server" + ) + empty_node_list = [] + for node_list in node_list_generator: + empty_node_list.extend(node_list) + self.assertTrue(len(empty_node_list) == 0) + + def test_paginated_mcp2_call_PAGED_THEN_EMPTY(self): + # cache org + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "PAGED_THEN_EMPTY" + node_list_generator = self.driver.connection.paginated_request_with_orgId_api_2( + "server/server" + ) + final_node_list = [] + for node_list in node_list_generator: + final_node_list.extend(node_list) + self.assertTrue(len(final_node_list) == 2) + + def test_paginated_mcp2_call_with_page_size(self): + # cache org + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "PAGESIZE50" + node_list_generator = self.driver.connection.paginated_request_with_orgId_api_2( + "server/server", page_size=50 + ) + self.assertTrue(isinstance(node_list_generator, GeneratorType)) + + # We're making sure here the filters make it to the URL + # See _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_ALLFILTERS for asserts + def test_list_nodes_response_strings_ALLFILTERS(self): + DimensionDataMockHttp.type = "ALLFILTERS" + ret = self.driver.list_nodes( + ex_location="fake_loc", + ex_name="fake_name", + ex_ipv6="fake_ipv6", + ex_ipv4="fake_ipv4", + ex_vlan="fake_vlan", + ex_image="fake_image", + ex_deployed=True, + ex_started=True, + ex_state="fake_state", + ex_network="fake_network", + ex_network_domain="fake_network_domain", + ) + self.assertTrue(isinstance(ret, list)) + self.assertEqual(len(ret), 7) + + node = ret[3] + self.assertTrue(isinstance(node.extra["disks"], list)) + self.assertTrue(isinstance(node.extra["disks"][0], DimensionDataServerDisk)) + self.assertEqual(node.size.id, "1") + self.assertEqual(node.image.id, "3ebf3c0f-90fe-4a8b-8585-6e65b316592c") + self.assertEqual(node.image.name, "WIN2008S/32") + disk = node.extra["disks"][0] + self.assertEqual(disk.id, "c2e1f199-116e-4dbc-9960-68720b832b0a") + self.assertEqual(disk.scsi_id, 0) + self.assertEqual(disk.size_gb, 50) + self.assertEqual(disk.speed, "STANDARD") + self.assertEqual(disk.state, "NORMAL") + + def test_list_nodes_response_LOCATION(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_locations() + first_loc = ret[0] + ret = self.driver.list_nodes(ex_location=first_loc) + for node in ret: + self.assertEqual(node.extra["datacenterId"], "NA3") + + def test_list_nodes_response_LOCATION_STR(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_nodes(ex_location="NA3") + for node in ret: + self.assertEqual(node.extra["datacenterId"], "NA3") + + def test_list_sizes_response(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_sizes() + self.assertEqual(len(ret), 1) + size = ret[0] + self.assertEqual(size.name, "default") + + def test_reboot_node_response(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = node.reboot() + self.assertTrue(ret is True) + + def test_reboot_node_response_INPROGRESS(self): + DimensionDataMockHttp.type = "INPROGRESS" + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + with self.assertRaises(DimensionDataAPIException): + node.reboot() + + def test_destroy_node_response(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = node.destroy() + self.assertTrue(ret is True) + + def test_destroy_node_response_RESOURCE_BUSY(self): + DimensionDataMockHttp.type = "INPROGRESS" + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + with self.assertRaises(DimensionDataAPIException): + node.destroy() + + def test_list_images(self): + images = self.driver.list_images() + self.assertEqual(len(images), 3) + self.assertEqual(images[0].name, "RedHat 6 64-bit 2 CPU") + self.assertEqual(images[0].id, "c14b1a46-2428-44c1-9c1a-b20e6418d08c") + self.assertEqual(images[0].extra["location"].id, "NA9") + self.assertEqual(images[0].extra["cpu"].cpu_count, 2) + self.assertEqual(images[0].extra["OS_displayName"], "REDHAT6/64") + + def test_clean_failed_deployment_response_with_node(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_clean_failed_deployment(node) + self.assertTrue(ret is True) + + def test_clean_failed_deployment_response_with_node_id(self): + node = "e75ead52-692f-4314-8725-c8a4f4d13a87" + ret = self.driver.ex_clean_failed_deployment(node) + self.assertTrue(ret is True) + + def test_ex_list_customer_images(self): + images = self.driver.ex_list_customer_images() + self.assertEqual(len(images), 3) + self.assertEqual(images[0].name, "ImportedCustomerImage") + self.assertEqual(images[0].id, "5234e5c7-01de-4411-8b6e-baeb8d91cf5d") + self.assertEqual(images[0].extra["location"].id, "NA9") + self.assertEqual(images[0].extra["cpu"].cpu_count, 4) + self.assertEqual(images[0].extra["OS_displayName"], "REDHAT6/64") + + def test_create_mcp1_node_optional_param(self): + root_pw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + network = self.driver.ex_list_networks()[0] + cpu_spec = DimensionDataServerCpuSpecification( + cpu_count="4", cores_per_socket="2", performance="STANDARD" + ) + disks = [DimensionDataServerDisk(scsi_id="0", speed="HIGHPERFORMANCE")] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ex_memory_gb=8, + ex_disks=disks, + ex_cpu_specification=cpu_spec, + ex_primary_dns="10.0.0.5", + ex_secondary_dns="10.0.0.6", + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_mcp1_node_response_no_pass_random_gen(self): + image = self.driver.list_images()[0] + network = self.driver.ex_list_networks()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + self.assertTrue("password" in node.extra) + + def test_create_mcp1_node_response_no_pass_customer_windows(self): + image = self.driver.ex_list_customer_images()[1] + network = self.driver.ex_list_networks()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + self.assertTrue("password" in node.extra) + + def test_create_mcp1_node_response_no_pass_customer_windows_STR(self): + image = self.driver.ex_list_customer_images()[1].id + network = self.driver.ex_list_networks()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + self.assertTrue("password" in node.extra) + + def test_create_mcp1_node_response_no_pass_customer_linux(self): + image = self.driver.ex_list_customer_images()[0] + network = self.driver.ex_list_networks()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + self.assertTrue("password" not in node.extra) + + def test_create_mcp1_node_response_no_pass_customer_linux_STR(self): + image = self.driver.ex_list_customer_images()[0].id + network = self.driver.ex_list_networks()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + self.assertTrue("password" not in node.extra) + + def test_create_mcp1_node_response_STR(self): + rootPw = "pass123" + image = self.driver.list_images()[0].id + network = self.driver.ex_list_networks()[0].id + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_response_network_domain(self): + rootPw = NodeAuthPassword("pass123") + location = self.driver.ex_get_location_by_id("NA9") + image = self.driver.list_images(location=location)[0] + network_domain = self.driver.ex_list_network_domains(location=location)[0] + vlan = self.driver.ex_list_vlans(location=location)[0] + cpu = DimensionDataServerCpuSpecification( + cpu_count=4, cores_per_socket=1, performance="HIGHPERFORMANCE" + ) + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain=network_domain, + ex_vlan=vlan, + ex_is_started=False, + ex_cpu_specification=cpu, + ex_memory_gb=4, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_response_network_domain_STR(self): + rootPw = NodeAuthPassword("pass123") + location = self.driver.ex_get_location_by_id("NA9") + image = self.driver.list_images(location=location)[0] + network_domain = self.driver.ex_list_network_domains(location=location)[0].id + vlan = self.driver.ex_list_vlans(location=location)[0].id + cpu = DimensionDataServerCpuSpecification( + cpu_count=4, cores_per_socket=1, performance="HIGHPERFORMANCE" + ) + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain=network_domain, + ex_vlan=vlan, + ex_is_started=False, + ex_cpu_specification=cpu, + ex_memory_gb=4, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_mcp1_node_no_network(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(InvalidRequestError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network=None, + ex_is_started=False, + ) + + def test_create_node_mcp1_ipv4(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network="fakenetwork", + ex_primary_ipv4="10.0.0.1", + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_mcp1_network(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network="fakenetwork", + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_mcp2_vlan(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_vlan="fakevlan", + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_mcp2_ipv4(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_ipv4="10.0.0.1", + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_network_domain_no_vlan_or_ipv4(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fake_network_domain", + ex_is_started=False, + ) + + def test_create_node_response(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_vlan="fakevlan", + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_ms_time_zone(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_vlan="fakevlan", + ex_microsoft_time_zone="040", + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_ambigious_mcps_fail(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_network="fakenetwork", + ex_primary_nic_vlan="fakevlan", + ) + + def test_create_node_no_network_domain_fail(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, name="test3", image=image, auth=rootPw, ex_primary_nic_vlan="fakevlan" + ) + + def test_create_node_no_primary_nic_fail(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ) + + def test_create_node_primary_vlan_nic(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_vlan="fakevlan", + ex_primary_nic_network_adapter="v1000", + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_primary_ipv4(self): + rootPw = "pass123" + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_both_primary_nic_and_vlan_fail(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_primary_nic_vlan="fakevlan", + ) + + def test_create_node_cpu_specification(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + cpu_spec = DimensionDataServerCpuSpecification( + cpu_count="4", cores_per_socket="2", performance="STANDARD" + ) + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_cpu_specification=cpu_spec, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_memory(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_memory_gb=8, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_disks(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + disks = [DimensionDataServerDisk(scsi_id="0", speed="HIGHPERFORMANCE")] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_disks=disks, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_disks_fail(self): + root_pw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + disks = "blah" + with self.assertRaises(TypeError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_disks=disks, + ) + + def test_create_node_ipv4_gateway(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_ipv4_gateway="10.2.2.2", + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_network_domain_no_vlan_no_ipv4_fail(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fake_network_domain", + ex_is_started=False, + ) + + def test_create_node_mcp2_additional_nics_legacy(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + additional_vlans = ["fakevlan1", "fakevlan2"] + additional_ipv4 = ["10.0.0.2", "10.0.0.3"] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_ipv4="10.0.0.1", + ex_additional_nics_vlan=additional_vlans, + ex_additional_nics_ipv4=additional_ipv4, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_bad_additional_nics_ipv4(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(TypeError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fake_network_domain", + ex_vlan="fake_vlan", + ex_additional_nics_ipv4="badstring", + ex_is_started=False, + ) + + def test_create_node_additional_nics(self): + root_pw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + nic1 = DimensionDataNic(vlan="fake_vlan", network_adapter_name="v1000") + nic2 = DimensionDataNic(private_ip_v4="10.1.1.2", network_adapter_name="v1000") + additional_nics = [nic1, nic2] + + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_additional_nics=additional_nics, + ex_is_started=False, + ) + + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_additional_nics_vlan_ipv4_coexist_fail(self): + root_pw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + nic1 = DimensionDataNic( + private_ip_v4="10.1.1.1", vlan="fake_vlan", network_adapter_name="v1000" + ) + nic2 = DimensionDataNic( + private_ip_v4="10.1.1.2", vlan="fake_vlan2", network_adapter_name="v1000" + ) + additional_nics = [nic1, nic2] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_additional_nics=additional_nics, + ex_is_started=False, + ) + + def test_create_node_additional_nics_invalid_input_fail(self): + root_pw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + additional_nics = "blah" + with self.assertRaises(TypeError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_additional_nics=additional_nics, + ex_is_started=False, + ) + + def test_create_node_additional_nics_vlan_ipv4_not_exist_fail(self): + root_pw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + nic1 = DimensionDataNic(network_adapter_name="v1000") + nic2 = DimensionDataNic(network_adapter_name="v1000") + additional_nics = [nic1, nic2] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_additional_nics=additional_nics, + ex_is_started=False, + ) + + def test_create_node_bad_additional_nics_vlan(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(TypeError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fake_network_domain", + ex_vlan="fake_vlan", + ex_additional_nics_vlan="badstring", + ex_is_started=False, + ) + + def test_create_node_mcp2_indicate_dns(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test node dns", + ex_network_domain="fakenetworkdomain", + ex_primary_ipv4="10.0.0.1", + ex_primary_dns="8.8.8.8", + ex_secondary_dns="8.8.4.4", + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_ex_shutdown_graceful(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_shutdown_graceful(node) + self.assertTrue(ret is True) + + def test_ex_shutdown_graceful_INPROGRESS(self): + DimensionDataMockHttp.type = "INPROGRESS" + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_shutdown_graceful(node) + + def test_ex_start_node(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_start_node(node) + self.assertTrue(ret is True) + + def test_ex_start_node_INPROGRESS(self): + DimensionDataMockHttp.type = "INPROGRESS" + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_start_node(node) + + def test_ex_power_off(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_power_off(node) + self.assertTrue(ret is True) + + def test_ex_update_vm_tools(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_update_vm_tools(node) + self.assertTrue(ret is True) + + def test_ex_power_off_INPROGRESS(self): + DimensionDataMockHttp.type = "INPROGRESS" + node = Node( + id="11", + name=None, + state="STOPPING", + public_ips=None, + private_ips=None, + driver=self.driver, + ) + + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_power_off(node) + + def test_ex_reset(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_reset(node) + self.assertTrue(ret is True) + + def test_ex_attach_node_to_vlan(self): + node = self.driver.ex_get_node_by_id("e75ead52-692f-4314-8725-c8a4f4d13a87") + vlan = self.driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + ret = self.driver.ex_attach_node_to_vlan(node, vlan) + self.assertTrue(ret is True) + + def test_ex_destroy_nic(self): + node = self.driver.ex_destroy_nic("a202e51b-41c0-4cfc-add0-b1c62fc0ecf6") + self.assertTrue(node) + + def test_list_networks(self): + nets = self.driver.list_networks() + self.assertEqual(nets[0].name, "test-net1") + self.assertTrue(isinstance(nets[0].location, NodeLocation)) + + def test_ex_create_network(self): + location = self.driver.ex_get_location_by_id("NA9") + net = self.driver.ex_create_network(location, "Test Network", "test") + self.assertEqual(net.id, "208e3a8e-9d2f-11e2-b29c-001517c4643e") + self.assertEqual(net.name, "Test Network") + + def test_ex_create_network_NO_DESCRIPTION(self): + location = self.driver.ex_get_location_by_id("NA9") + net = self.driver.ex_create_network(location, "Test Network") + self.assertEqual(net.id, "208e3a8e-9d2f-11e2-b29c-001517c4643e") + self.assertEqual(net.name, "Test Network") + + def test_ex_delete_network(self): + net = self.driver.ex_list_networks()[0] + result = self.driver.ex_delete_network(net) + self.assertTrue(result) + + def test_ex_rename_network(self): + net = self.driver.ex_list_networks()[0] + result = self.driver.ex_rename_network(net, "barry") + self.assertTrue(result) + + def test_ex_create_network_domain(self): + location = self.driver.ex_get_location_by_id("NA9") + plan = NetworkDomainServicePlan.ADVANCED + net = self.driver.ex_create_network_domain( + location=location, name="test", description="test", service_plan=plan + ) + self.assertEqual(net.name, "test") + self.assertTrue(net.id, "f14a871f-9a25-470c-aef8-51e13202e1aa") + + def test_ex_create_network_domain_NO_DESCRIPTION(self): + location = self.driver.ex_get_location_by_id("NA9") + plan = NetworkDomainServicePlan.ADVANCED + net = self.driver.ex_create_network_domain( + location=location, name="test", service_plan=plan + ) + self.assertEqual(net.name, "test") + self.assertTrue(net.id, "f14a871f-9a25-470c-aef8-51e13202e1aa") + + def test_ex_get_network_domain(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + self.assertEqual(net.id, "8cdfd607-f429-4df6-9352-162cfc0891be") + self.assertEqual(net.description, "test2") + self.assertEqual(net.name, "test") + + def test_ex_update_network_domain(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + net.name = "new name" + net2 = self.driver.ex_update_network_domain(net) + self.assertEqual(net2.name, "new name") + + def test_ex_delete_network_domain(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + result = self.driver.ex_delete_network_domain(net) + self.assertTrue(result) + + def test_ex_list_networks(self): + nets = self.driver.ex_list_networks() + self.assertEqual(nets[0].name, "test-net1") + self.assertTrue(isinstance(nets[0].location, NodeLocation)) + + def test_ex_list_network_domains(self): + nets = self.driver.ex_list_network_domains() + self.assertEqual(nets[0].name, "Aurora") + self.assertTrue(isinstance(nets[0].location, NodeLocation)) + + def test_ex_list_network_domains_ALLFILTERS(self): + DimensionDataMockHttp.type = "ALLFILTERS" + nets = self.driver.ex_list_network_domains( + location="fake_location", + name="fake_name", + service_plan="fake_plan", + state="fake_state", + ) + self.assertEqual(nets[0].name, "Aurora") + self.assertTrue(isinstance(nets[0].location, NodeLocation)) + + def test_ex_list_vlans(self): + vlans = self.driver.ex_list_vlans() + self.assertEqual(vlans[0].name, "Primary") + + def test_ex_list_vlans_ALLFILTERS(self): + DimensionDataMockHttp.type = "ALLFILTERS" + vlans = self.driver.ex_list_vlans( + location="fake_location", + network_domain="fake_network_domain", + name="fake_name", + ipv4_address="fake_ipv4", + ipv6_address="fake_ipv6", + state="fake_state", + ) + self.assertEqual(vlans[0].name, "Primary") + + def test_ex_create_vlan( + self, + ): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + vlan = self.driver.ex_create_vlan( + network_domain=net, + name="test", + private_ipv4_base_address="10.3.4.0", + private_ipv4_prefix_size="24", + description="test vlan", + ) + self.assertEqual(vlan.id, "0e56433f-d808-4669-821d-812769517ff8") + + def test_ex_create_vlan_NO_DESCRIPTION( + self, + ): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + vlan = self.driver.ex_create_vlan( + network_domain=net, + name="test", + private_ipv4_base_address="10.3.4.0", + private_ipv4_prefix_size="24", + ) + self.assertEqual(vlan.id, "0e56433f-d808-4669-821d-812769517ff8") + + def test_ex_get_vlan(self): + vlan = self.driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + self.assertEqual(vlan.id, "0e56433f-d808-4669-821d-812769517ff8") + self.assertEqual(vlan.description, "test2") + self.assertEqual(vlan.status, "NORMAL") + self.assertEqual(vlan.name, "Production VLAN") + self.assertEqual(vlan.private_ipv4_range_address, "10.0.3.0") + self.assertEqual(vlan.private_ipv4_range_size, 24) + self.assertEqual(vlan.ipv6_range_size, 64) + self.assertEqual(vlan.ipv6_range_address, "2607:f480:1111:1153:0:0:0:0") + self.assertEqual(vlan.ipv4_gateway, "10.0.3.1") + self.assertEqual(vlan.ipv6_gateway, "2607:f480:1111:1153:0:0:0:1") + + def test_ex_wait_for_state(self): + self.driver.ex_wait_for_state( + "NORMAL", + self.driver.ex_get_vlan, + vlan_id="0e56433f-d808-4669-821d-812769517ff8", + poll_interval=0.1, + ) + + def test_ex_wait_for_state_NODE(self): + self.driver.ex_wait_for_state( + "running", + self.driver.ex_get_node_by_id, + id="e75ead52-692f-4314-8725-c8a4f4d13a87", + poll_interval=0.1, + ) + + def test_ex_wait_for_state_FAIL(self): + with self.assertRaises(DimensionDataAPIException) as context: + self.driver.ex_wait_for_state( + "starting", + self.driver.ex_get_node_by_id, + id="e75ead52-692f-4314-8725-c8a4f4d13a87", + poll_interval=0.1, + timeout=0.1, + ) + self.assertEqual(context.exception.code, "running") + self.assertTrue("timed out" in context.exception.msg) + + def test_ex_update_vlan(self): + vlan = self.driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + vlan.name = "new name" + vlan2 = self.driver.ex_update_vlan(vlan) + self.assertEqual(vlan2.name, "new name") + + def test_ex_delete_vlan(self): + vlan = self.driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + result = self.driver.ex_delete_vlan(vlan) + self.assertTrue(result) + + def test_ex_expand_vlan(self): + vlan = self.driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + vlan.private_ipv4_range_size = "23" + vlan = self.driver.ex_expand_vlan(vlan) + self.assertEqual(vlan.private_ipv4_range_size, "23") + + def test_ex_add_public_ip_block_to_network_domain(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + block = self.driver.ex_add_public_ip_block_to_network_domain(net) + self.assertEqual(block.id, "9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8") + + def test_ex_list_public_ip_blocks(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + blocks = self.driver.ex_list_public_ip_blocks(net) + self.assertEqual(blocks[0].base_ip, "168.128.4.18") + self.assertEqual(blocks[0].size, "2") + self.assertEqual(blocks[0].id, "9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8") + self.assertEqual(blocks[0].location.id, "NA9") + self.assertEqual(blocks[0].network_domain.id, net.id) + + def test_ex_get_public_ip_block(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + block = self.driver.ex_get_public_ip_block("9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8") + self.assertEqual(block.base_ip, "168.128.4.18") + self.assertEqual(block.size, "2") + self.assertEqual(block.id, "9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8") + self.assertEqual(block.location.id, "NA9") + self.assertEqual(block.network_domain.id, net.id) + + def test_ex_delete_public_ip_block(self): + block = self.driver.ex_get_public_ip_block("9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8") + result = self.driver.ex_delete_public_ip_block(block) + self.assertTrue(result) + + def test_ex_list_firewall_rules(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + self.assertEqual(rules[0].id, "756cba02-b0bc-48f4-aea5-9445870b6148") + self.assertEqual(rules[0].network_domain.id, "8cdfd607-f429-4df6-9352-162cfc0891be") + self.assertEqual(rules[0].name, "CCDEFAULT.BlockOutboundMailIPv4") + self.assertEqual(rules[0].action, "DROP") + self.assertEqual(rules[0].ip_version, "IPV4") + self.assertEqual(rules[0].protocol, "TCP") + self.assertEqual(rules[0].source.ip_address, "ANY") + self.assertTrue(rules[0].source.any_ip) + self.assertTrue(rules[0].destination.any_ip) + + def test_ex_create_firewall_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + rule = self.driver.ex_create_firewall_rule(net, rules[0], "FIRST") + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_create_firewall_rule_with_specific_source_ip(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + specific_source_ip_rule = list(filter(lambda x: x.name == "SpecificSourceIP", rules))[0] + rule = self.driver.ex_create_firewall_rule(net, specific_source_ip_rule, "FIRST") + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_create_firewall_rule_with_source_ip(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + specific_source_ip_rule = list(filter(lambda x: x.name == "SpecificSourceIP", rules))[0] + specific_source_ip_rule.source.any_ip = False + specific_source_ip_rule.source.ip_address = "10.0.0.1" + specific_source_ip_rule.source.ip_prefix_size = "15" + rule = self.driver.ex_create_firewall_rule(net, specific_source_ip_rule, "FIRST") + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_create_firewall_rule_with_any_ip(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + specific_source_ip_rule = list(filter(lambda x: x.name == "SpecificSourceIP", rules))[0] + specific_source_ip_rule.source.any_ip = True + rule = self.driver.ex_create_firewall_rule(net, specific_source_ip_rule, "FIRST") + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_create_firewall_rule_ip_prefix_size(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_list_firewall_rules(net)[0] + rule.source.address_list_id = None + rule.source.any_ip = False + rule.source.ip_address = "10.2.1.1" + rule.source.ip_prefix_size = "10" + rule.destination.address_list_id = None + rule.destination.any_ip = False + rule.destination.ip_address = "10.0.0.1" + rule.destination.ip_prefix_size = "20" + self.driver.ex_create_firewall_rule(net, rule, "LAST") + + def test_ex_create_firewall_rule_address_list(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_list_firewall_rules(net)[0] + rule.source.address_list_id = "12345" + rule.destination.address_list_id = "12345" + self.driver.ex_create_firewall_rule(net, rule, "LAST") + + def test_ex_create_firewall_rule_port_list(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_list_firewall_rules(net)[0] + rule.source.port_list_id = "12345" + rule.destination.port_list_id = "12345" + self.driver.ex_create_firewall_rule(net, rule, "LAST") + + def test_ex_create_firewall_rule_port(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_list_firewall_rules(net)[0] + rule.source.port_list_id = None + rule.source.port_begin = "8000" + rule.source.port_end = "8005" + rule.destination.port_list_id = None + rule.destination.port_begin = "7000" + rule.destination.port_end = "7005" + self.driver.ex_create_firewall_rule(net, rule, "LAST") + + def test_ex_create_firewall_rule_ALL_VALUES(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + for rule in rules: + self.driver.ex_create_firewall_rule(net, rule, "LAST") + + def test_ex_create_firewall_rule_WITH_POSITION_RULE(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + rule = self.driver.ex_create_firewall_rule(net, rules[-2], "BEFORE", rules[-1]) + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_create_firewall_rule_WITH_POSITION_RULE_STR(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + rule = self.driver.ex_create_firewall_rule( + net, rules[-2], "BEFORE", "RULE_WITH_SOURCE_AND_DEST" + ) + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_create_firewall_rule_FAIL_POSITION(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + with self.assertRaises(ValueError): + self.driver.ex_create_firewall_rule(net, rules[0], "BEFORE") + + def test_ex_create_firewall_rule_FAIL_POSITION_WITH_RULE(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + with self.assertRaises(ValueError): + self.driver.ex_create_firewall_rule(net, rules[0], "LAST", "RULE_WITH_SOURCE_AND_DEST") + + def test_ex_get_firewall_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_set_firewall_rule_state(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + result = self.driver.ex_set_firewall_rule_state(rule, False) + self.assertTrue(result) + + def test_ex_delete_firewall_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + result = self.driver.ex_delete_firewall_rule(rule) + self.assertTrue(result) + + def test_ex_edit_firewall_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.any_ip = True + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_source_ipaddresslist(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.address_list_id = "802abc9f-45a7-4efb-9d5a-810082368222" + rule.source.any_ip = False + rule.source.ip_address = "10.0.0.1" + rule.source.ip_prefix_size = 10 + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_destination_ipaddresslist(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.destination.address_list_id = "802abc9f-45a7-4efb-9d5a-810082368222" + rule.destination.any_ip = False + rule.destination.ip_address = "10.0.0.1" + rule.destination.ip_prefix_size = 10 + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_destination_ipaddress(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.address_list_id = None + rule.source.any_ip = False + rule.source.ip_address = "10.0.0.1" + rule.source.ip_prefix_size = "10" + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_source_ipaddress(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.destination.address_list_id = None + rule.destination.any_ip = False + rule.destination.ip_address = "10.0.0.1" + rule.destination.ip_prefix_size = "10" + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_with_relative_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + placement_rule = self.driver.ex_list_firewall_rules(network_domain=net)[-1] + result = self.driver.ex_edit_firewall_rule( + rule=rule, position="BEFORE", relative_rule_for_position=placement_rule + ) + self.assertTrue(result) + + def test_ex_edit_firewall_rule_with_relative_rule_by_name(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + placement_rule = self.driver.ex_list_firewall_rules(network_domain=net)[-1] + result = self.driver.ex_edit_firewall_rule( + rule=rule, position="BEFORE", relative_rule_for_position=placement_rule.name + ) + self.assertTrue(result) + + def test_ex_edit_firewall_rule_source_portlist(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.port_list_id = "802abc9f-45a7-4efb-9d5a-810082368222" + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_source_port(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.port_list_id = None + rule.source.port_begin = "3" + rule.source.port_end = "10" + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_destination_portlist(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.destination.port_list_id = "802abc9f-45a7-4efb-9d5a-810082368222" + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_destination_port(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.destination.port_list_id = None + rule.destination.port_begin = "3" + rule.destination.port_end = "10" + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_invalid_position_fail(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + with self.assertRaises(ValueError): + self.driver.ex_edit_firewall_rule(rule=rule, position="BEFORE") + + def test_ex_edit_firewall_rule_invalid_position_relative_rule_fail(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + relative_rule = self.driver.ex_list_firewall_rules(network_domain=net)[-1] + with self.assertRaises(ValueError): + self.driver.ex_edit_firewall_rule( + rule=rule, position="FIRST", relative_rule_for_position=relative_rule + ) + + def test_ex_create_nat_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_create_nat_rule(net, "1.2.3.4", "4.3.2.1") + self.assertEqual(rule.id, "d31c2db0-be6b-4d50-8744-9a7a534b5fba") + + def test_ex_list_nat_rules(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_nat_rules(net) + self.assertEqual(rules[0].id, "2187a636-7ebb-49a1-a2ff-5d617f496dce") + self.assertEqual(rules[0].internal_ip, "10.0.0.15") + self.assertEqual(rules[0].external_ip, "165.180.12.18") + + def test_ex_get_nat_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_nat_rule(net, "2187a636-7ebb-49a1-a2ff-5d617f496dce") + self.assertEqual(rule.id, "2187a636-7ebb-49a1-a2ff-5d617f496dce") + self.assertEqual(rule.internal_ip, "10.0.0.16") + self.assertEqual(rule.external_ip, "165.180.12.19") + + def test_ex_delete_nat_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_nat_rule(net, "2187a636-7ebb-49a1-a2ff-5d617f496dce") + result = self.driver.ex_delete_nat_rule(rule) + self.assertTrue(result) + + def test_ex_enable_monitoring(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_enable_monitoring(node, "ADVANCED") + self.assertTrue(result) + + def test_ex_disable_monitoring(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_disable_monitoring(node) + self.assertTrue(result) + + def test_ex_change_monitoring_plan(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_update_monitoring_plan(node, "ESSENTIALS") + self.assertTrue(result) + + def test_ex_add_storage_to_node(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_add_storage_to_node(node, 30, "PERFORMANCE") + self.assertTrue(result) + + def test_ex_remove_storage_from_node(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_remove_storage_from_node(node, 0) + self.assertTrue(result) + + def test_ex_change_storage_speed(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_change_storage_speed(node, 1, "PERFORMANCE") + self.assertTrue(result) + + def test_ex_change_storage_size(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_change_storage_size(node, 1, 100) + self.assertTrue(result) + + def test_ex_clone_node_to_image(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_clone_node_to_image(node, "my image", "a description") + self.assertTrue(result) + + def test_ex_update_node(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_update_node(node, "my new name", "a description", 2, 4048) + self.assertTrue(result) + + def test_ex_reconfigure_node(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_reconfigure_node(node, 4, 4, 1, "HIGHPERFORMANCE") + self.assertTrue(result) + + def test_ex_get_location_by_id(self): + location = self.driver.ex_get_location_by_id("NA9") + self.assertTrue(location.id, "NA9") + + def test_ex_get_location_by_id_NO_LOCATION(self): + location = self.driver.ex_get_location_by_id(None) + self.assertIsNone(location) + + def test_ex_get_base_image_by_id(self): + image_id = self.driver.list_images()[0].id + image = self.driver.ex_get_base_image_by_id(image_id) + self.assertEqual(image.extra["OS_type"], "UNIX") + + def test_ex_get_customer_image_by_id(self): + image_id = self.driver.ex_list_customer_images()[1].id + image = self.driver.ex_get_customer_image_by_id(image_id) + self.assertEqual(image.extra["OS_type"], "WINDOWS") + + def test_ex_get_image_by_id_base_img(self): + image_id = self.driver.list_images()[1].id + image = self.driver.ex_get_base_image_by_id(image_id) + self.assertEqual(image.extra["OS_type"], "WINDOWS") + + def test_ex_get_image_by_id_customer_img(self): + image_id = self.driver.ex_list_customer_images()[0].id + image = self.driver.ex_get_customer_image_by_id(image_id) + self.assertEqual(image.extra["OS_type"], "UNIX") + + def test_ex_get_image_by_id_customer_FAIL(self): + image_id = "FAKE_IMAGE_ID" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_get_base_image_by_id(image_id) + + def test_ex_create_anti_affinity_rule(self): + node_list = self.driver.list_nodes() + success = self.driver.ex_create_anti_affinity_rule([node_list[0], node_list[1]]) + self.assertTrue(success) + + def test_ex_create_anti_affinity_rule_TUPLE(self): + node_list = self.driver.list_nodes() + success = self.driver.ex_create_anti_affinity_rule((node_list[0], node_list[1])) + self.assertTrue(success) + + def test_ex_create_anti_affinity_rule_TUPLE_STR(self): + node_list = self.driver.list_nodes() + success = self.driver.ex_create_anti_affinity_rule((node_list[0].id, node_list[1].id)) + self.assertTrue(success) + + def test_ex_create_anti_affinity_rule_FAIL_STR(self): + node_list = "string" + with self.assertRaises(TypeError): + self.driver.ex_create_anti_affinity_rule(node_list) + + def test_ex_create_anti_affinity_rule_FAIL_EXISTING(self): + node_list = self.driver.list_nodes() + DimensionDataMockHttp.type = "FAIL_EXISTING" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_create_anti_affinity_rule((node_list[0], node_list[1])) + + def test_ex_delete_anti_affinity_rule(self): + net_domain = self.driver.ex_list_network_domains()[0] + rule = self.driver.ex_list_anti_affinity_rules(network_domain=net_domain)[0] + success = self.driver.ex_delete_anti_affinity_rule(rule) + self.assertTrue(success) + + def test_ex_delete_anti_affinity_rule_STR(self): + net_domain = self.driver.ex_list_network_domains()[0] + rule = self.driver.ex_list_anti_affinity_rules(network_domain=net_domain)[0] + success = self.driver.ex_delete_anti_affinity_rule(rule.id) + self.assertTrue(success) + + def test_ex_delete_anti_affinity_rule_FAIL(self): + net_domain = self.driver.ex_list_network_domains()[0] + rule = self.driver.ex_list_anti_affinity_rules(network_domain=net_domain)[0] + DimensionDataMockHttp.type = "FAIL" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_delete_anti_affinity_rule(rule) + + def test_ex_list_anti_affinity_rules_NETWORK_DOMAIN(self): + net_domain = self.driver.ex_list_network_domains()[0] + rules = self.driver.ex_list_anti_affinity_rules(network_domain=net_domain) + self.assertTrue(isinstance(rules, list)) + self.assertEqual(len(rules), 2) + self.assertTrue(isinstance(rules[0].id, str)) + self.assertTrue(isinstance(rules[0].node_list, list)) + + def test_ex_list_anti_affinity_rules_NETWORK(self): + network = self.driver.list_networks()[0] + rules = self.driver.ex_list_anti_affinity_rules(network=network) + self.assertTrue(isinstance(rules, list)) + self.assertEqual(len(rules), 2) + self.assertTrue(isinstance(rules[0].id, str)) + self.assertTrue(isinstance(rules[0].node_list, list)) + + def test_ex_list_anti_affinity_rules_NODE(self): + node = self.driver.list_nodes()[0] + rules = self.driver.ex_list_anti_affinity_rules(node=node) + self.assertTrue(isinstance(rules, list)) + self.assertEqual(len(rules), 2) + self.assertTrue(isinstance(rules[0].id, str)) + self.assertTrue(isinstance(rules[0].node_list, list)) + + def test_ex_list_anti_affinity_rules_PAGINATED(self): + net_domain = self.driver.ex_list_network_domains()[0] + DimensionDataMockHttp.type = "PAGINATED" + rules = self.driver.ex_list_anti_affinity_rules(network_domain=net_domain) + self.assertTrue(isinstance(rules, list)) + self.assertEqual(len(rules), 4) + self.assertTrue(isinstance(rules[0].id, str)) + self.assertTrue(isinstance(rules[0].node_list, list)) + + def test_ex_list_anti_affinity_rules_ALLFILTERS(self): + net_domain = self.driver.ex_list_network_domains()[0] + DimensionDataMockHttp.type = "ALLFILTERS" + rules = self.driver.ex_list_anti_affinity_rules( + network_domain=net_domain, filter_id="FAKE_ID", filter_state="FAKE_STATE" + ) + self.assertTrue(isinstance(rules, list)) + self.assertEqual(len(rules), 2) + self.assertTrue(isinstance(rules[0].id, str)) + self.assertTrue(isinstance(rules[0].node_list, list)) + + def test_ex_list_anti_affinity_rules_BAD_ARGS(self): + with self.assertRaises(ValueError): + self.driver.ex_list_anti_affinity_rules( + network="fake_network", network_domain="fake_network_domain" + ) + + def test_ex_create_tag_key(self): + success = self.driver.ex_create_tag_key("MyTestKey") + self.assertTrue(success) + + def test_ex_create_tag_key_ALLPARAMS(self): + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "ALLPARAMS" + success = self.driver.ex_create_tag_key( + "MyTestKey", + description="Test Key Desc.", + value_required=False, + display_on_report=False, + ) + self.assertTrue(success) + + def test_ex_create_tag_key_BADREQUEST(self): + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "BADREQUEST" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_create_tag_key("MyTestKey") + + def test_ex_list_tag_keys(self): + tag_keys = self.driver.ex_list_tag_keys() + self.assertTrue(isinstance(tag_keys, list)) + self.assertTrue(isinstance(tag_keys[0], DimensionDataTagKey)) + self.assertTrue(isinstance(tag_keys[0].id, str)) + + def test_ex_list_tag_keys_ALLFILTERS(self): + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "ALLFILTERS" + self.driver.ex_list_tag_keys( + id="fake_id", + name="fake_name", + value_required=False, + display_on_report=False, + ) + + def test_ex_get_tag_by_id(self): + tag = self.driver.ex_get_tag_key_by_id("d047c609-93d7-4bc5-8fc9-732c85840075") + self.assertTrue(isinstance(tag, DimensionDataTagKey)) + + def test_ex_get_tag_by_id_NOEXIST(self): + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "NOEXIST" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_get_tag_key_by_id("d047c609-93d7-4bc5-8fc9-732c85840075") + + def test_ex_get_tag_by_name(self): + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "SINGLE" + tag = self.driver.ex_get_tag_key_by_name("LibcloudTest") + self.assertTrue(isinstance(tag, DimensionDataTagKey)) + + def test_ex_get_tag_by_name_NOEXIST(self): + with self.assertRaises(ValueError): + self.driver.ex_get_tag_key_by_name("LibcloudTest") + + def test_ex_modify_tag_key_NAME(self): + tag_key = self.driver.ex_list_tag_keys()[0] + DimensionDataMockHttp.type = "NAME" + success = self.driver.ex_modify_tag_key(tag_key, name="NewName") + self.assertTrue(success) + + def test_ex_modify_tag_key_NOTNAME(self): + tag_key = self.driver.ex_list_tag_keys()[0] + DimensionDataMockHttp.type = "NOTNAME" + success = self.driver.ex_modify_tag_key( + tag_key, description="NewDesc", value_required=False, display_on_report=True + ) + self.assertTrue(success) + + def test_ex_modify_tag_key_NOCHANGE(self): + tag_key = self.driver.ex_list_tag_keys()[0] + DimensionDataMockHttp.type = "NOCHANGE" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_modify_tag_key(tag_key) + + def test_ex_remove_tag_key(self): + tag_key = self.driver.ex_list_tag_keys()[0] + success = self.driver.ex_remove_tag_key(tag_key) + self.assertTrue(success) + + def test_ex_remove_tag_key_NOEXIST(self): + tag_key = self.driver.ex_list_tag_keys()[0] + DimensionDataMockHttp.type = "NOEXIST" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_remove_tag_key(tag_key) + + def test_ex_apply_tag_to_asset(self): + node = self.driver.list_nodes()[0] + success = self.driver.ex_apply_tag_to_asset(node, "TagKeyName", "FakeValue") + self.assertTrue(success) + + def test_ex_apply_tag_to_asset_NOVALUE(self): + node = self.driver.list_nodes()[0] + DimensionDataMockHttp.type = "NOVALUE" + success = self.driver.ex_apply_tag_to_asset(node, "TagKeyName") + self.assertTrue(success) + + def test_ex_apply_tag_to_asset_NOTAGKEY(self): + node = self.driver.list_nodes()[0] + DimensionDataMockHttp.type = "NOTAGKEY" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_apply_tag_to_asset(node, "TagKeyNam") + + def test_ex_apply_tag_to_asset_BADASSETTYPE(self): + network = self.driver.list_networks()[0] + DimensionDataMockHttp.type = "NOTAGKEY" + with self.assertRaises(TypeError): + self.driver.ex_apply_tag_to_asset(network, "TagKeyNam") + + def test_ex_remove_tag_from_asset(self): + node = self.driver.list_nodes()[0] + success = self.driver.ex_remove_tag_from_asset(node, "TagKeyName") + self.assertTrue(success) + + def test_ex_remove_tag_from_asset_NOTAG(self): + node = self.driver.list_nodes()[0] + DimensionDataMockHttp.type = "NOTAG" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_remove_tag_from_asset(node, "TagKeyNam") + + def test_ex_list_tags(self): + tags = self.driver.ex_list_tags() + self.assertTrue(isinstance(tags, list)) + self.assertTrue(isinstance(tags[0], DimensionDataTag)) + self.assertTrue(len(tags) == 3) + + def test_ex_list_tags_ALLPARAMS(self): + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "ALLPARAMS" + tags = self.driver.ex_list_tags( + asset_id="fake_asset_id", + asset_type="fake_asset_type", + location="fake_location", + tag_key_name="fake_tag_key_name", + tag_key_id="fake_tag_key_id", + value="fake_value", + value_required=False, + display_on_report=False, + ) + self.assertTrue(isinstance(tags, list)) + self.assertTrue(isinstance(tags[0], DimensionDataTag)) + self.assertTrue(len(tags) == 3) + + def test_priv_location_to_location_id(self): + location = self.driver.ex_get_location_by_id("NA9") + self.assertEqual(self.driver._location_to_location_id(location), "NA9") + + def test_priv_location_to_location_id_STR(self): + self.assertEqual(self.driver._location_to_location_id("NA9"), "NA9") + + def test_priv_location_to_location_id_TYPEERROR(self): + with self.assertRaises(TypeError): + self.driver._location_to_location_id([1, 2, 3]) + + def test_priv_image_needs_auth_os_img(self): + image = self.driver.list_images()[1] + self.assertTrue(self.driver._image_needs_auth(image)) + + def test_priv_image_needs_auth_os_img_STR(self): + image = self.driver.list_images()[1].id + self.assertTrue(self.driver._image_needs_auth(image)) + + def test_priv_image_needs_auth_cust_img_windows(self): + image = self.driver.ex_list_customer_images()[1] + self.assertTrue(self.driver._image_needs_auth(image)) + + def test_priv_image_needs_auth_cust_img_windows_STR(self): + image = self.driver.ex_list_customer_images()[1].id + self.assertTrue(self.driver._image_needs_auth(image)) + + def test_priv_image_needs_auth_cust_img_linux(self): + image = self.driver.ex_list_customer_images()[0] + self.assertTrue(not self.driver._image_needs_auth(image)) + + def test_priv_image_needs_auth_cust_img_linux_STR(self): + image = self.driver.ex_list_customer_images()[0].id + self.assertTrue(not self.driver._image_needs_auth(image)) + + def test_summary_usage_report(self): + report = self.driver.ex_summary_usage_report("2016-06-01", "2016-06-30") + report_content = report + self.assertEqual(len(report_content), 13) + self.assertEqual(len(report_content[0]), 6) + + def test_detailed_usage_report(self): + report = self.driver.ex_detailed_usage_report("2016-06-01", "2016-06-30") + report_content = report + self.assertEqual(len(report_content), 42) + self.assertEqual(len(report_content[0]), 4) + + def test_audit_log_report(self): + report = self.driver.ex_audit_log_report("2016-06-01", "2016-06-30") + report_content = report + self.assertEqual(len(report_content), 25) + self.assertEqual(report_content[2][2], "OEC_SYSTEM") + + def test_ex_list_ip_address_list(self): + net_domain = self.driver.ex_list_network_domains()[0] + ip_list = self.driver.ex_list_ip_address_list(ex_network_domain=net_domain) + self.assertTrue(isinstance(ip_list, list)) + self.assertEqual(len(ip_list), 4) + self.assertTrue(isinstance(ip_list[0].name, str)) + self.assertTrue(isinstance(ip_list[0].description, str)) + self.assertTrue(isinstance(ip_list[0].ip_version, str)) + self.assertTrue(isinstance(ip_list[0].state, str)) + self.assertTrue(isinstance(ip_list[0].create_time, str)) + self.assertTrue(isinstance(ip_list[0].child_ip_address_lists, list)) + self.assertEqual(len(ip_list[1].child_ip_address_lists), 1) + self.assertTrue(isinstance(ip_list[1].child_ip_address_lists[0].name, str)) + + def test_ex_get_ip_address_list(self): + net_domain = self.driver.ex_list_network_domains()[0] + DimensionDataMockHttp.type = "FILTERBYNAME" + ip_list = self.driver.ex_get_ip_address_list( + ex_network_domain=net_domain.id, + ex_ip_address_list_name="Test_IP_Address_List_3", + ) + self.assertTrue(isinstance(ip_list, list)) + self.assertEqual(len(ip_list), 1) + self.assertTrue(isinstance(ip_list[0].name, str)) + self.assertTrue(isinstance(ip_list[0].description, str)) + self.assertTrue(isinstance(ip_list[0].ip_version, str)) + self.assertTrue(isinstance(ip_list[0].state, str)) + self.assertTrue(isinstance(ip_list[0].create_time, str)) + ips = ip_list[0].ip_address_collection + self.assertEqual(len(ips), 3) + self.assertTrue(isinstance(ips[0].begin, str)) + self.assertTrue(isinstance(ips[0].prefix_size, str)) + self.assertTrue(isinstance(ips[2].end, str)) + + def test_ex_create_ip_address_list_FAIL(self): + net_domain = self.driver.ex_list_network_domains()[0] + + with self.assertRaises(TypeError): + self.driver.ex_create_ip_address_list(ex_network_domain=net_domain.id) + + def test_ex_create_ip_address_list(self): + name = "Test_IP_Address_List_3" + description = "Test Description" + ip_version = "IPV4" + child_ip_address_list_id = "0291ef78-4059-4bc1-b433-3f6ad698dc41" + child_ip_address_list = DimensionDataChildIpAddressList( + id=child_ip_address_list_id, name="test_child_ip_addr_list" + ) + net_domain = self.driver.ex_list_network_domains()[0] + ip_address_1 = DimensionDataIpAddress(begin="190.2.2.100") + ip_address_2 = DimensionDataIpAddress(begin="190.2.2.106", end="190.2.2.108") + ip_address_3 = DimensionDataIpAddress(begin="190.2.2.0", prefix_size="24") + ip_address_collection = [ip_address_1, ip_address_2, ip_address_3] + + # Create IP Address List + success = self.driver.ex_create_ip_address_list( + ex_network_domain=net_domain, + name=name, + ip_version=ip_version, + description=description, + ip_address_collection=ip_address_collection, + child_ip_address_list=child_ip_address_list, + ) + + self.assertTrue(success) + + def test_ex_create_ip_address_list_STR(self): + name = "Test_IP_Address_List_3" + description = "Test Description" + ip_version = "IPV4" + child_ip_address_list_id = "0291ef78-4059-4bc1-b433-3f6ad698dc41" + net_domain = self.driver.ex_list_network_domains()[0] + ip_address_1 = DimensionDataIpAddress(begin="190.2.2.100") + ip_address_2 = DimensionDataIpAddress(begin="190.2.2.106", end="190.2.2.108") + ip_address_3 = DimensionDataIpAddress(begin="190.2.2.0", prefix_size="24") + ip_address_collection = [ip_address_1, ip_address_2, ip_address_3] + + # Create IP Address List + success = self.driver.ex_create_ip_address_list( + ex_network_domain=net_domain.id, + name=name, + ip_version=ip_version, + description=description, + ip_address_collection=ip_address_collection, + child_ip_address_list=child_ip_address_list_id, + ) + + self.assertTrue(success) + + def test_ex_edit_ip_address_list(self): + ip_address_1 = DimensionDataIpAddress(begin="190.2.2.111") + ip_address_collection = [ip_address_1] + + child_ip_address_list = DimensionDataChildIpAddressList( + id="2221ef78-4059-4bc1-b433-3f6ad698dc41", + name="test_child_ip_address_list edited", + ) + + ip_address_list = DimensionDataIpAddressList( + id="1111ef78-4059-4bc1-b433-3f6ad698d111", + name="test ip address list edited", + ip_version="IPv4", + description="test", + ip_address_collection=ip_address_collection, + child_ip_address_lists=child_ip_address_list, + state="NORMAL", + create_time="2015-09-29T02:49:45", + ) + + success = self.driver.ex_edit_ip_address_list( + ex_ip_address_list=ip_address_list, + description="test ip address list", + ip_address_collection=ip_address_collection, + child_ip_address_lists=child_ip_address_list, + ) + + self.assertTrue(success) + + def test_ex_edit_ip_address_list_STR(self): + ip_address_1 = DimensionDataIpAddress(begin="190.2.2.111") + ip_address_collection = [ip_address_1] + + child_ip_address_list = DimensionDataChildIpAddressList( + id="2221ef78-4059-4bc1-b433-3f6ad698dc41", + name="test_child_ip_address_list edited", + ) + + success = self.driver.ex_edit_ip_address_list( + ex_ip_address_list="84e34850-595d- 436e-a885-7cd37edb24a4", + description="test ip address list", + ip_address_collection=ip_address_collection, + child_ip_address_lists=child_ip_address_list, + ) + + self.assertTrue(success) + + def test_ex_delete_ip_address_list(self): + child_ip_address_list = DimensionDataChildIpAddressList( + id="2221ef78-4059-4bc1-b433-3f6ad698dc41", + name="test_child_ip_address_list edited", + ) + + ip_address_list = DimensionDataIpAddressList( + id="1111ef78-4059-4bc1-b433-3f6ad698d111", + name="test ip address list edited", + ip_version="IPv4", + description="test", + ip_address_collection=None, + child_ip_address_lists=child_ip_address_list, + state="NORMAL", + create_time="2015-09-29T02:49:45", + ) + + success = self.driver.ex_delete_ip_address_list(ex_ip_address_list=ip_address_list) + self.assertTrue(success) + + def test_ex_delete_ip_address_list_STR(self): + success = self.driver.ex_delete_ip_address_list( + ex_ip_address_list="111ef78-4059-4bc1-b433-3f6ad698d111" + ) + self.assertTrue(success) + + def test_ex_list_portlist(self): + net_domain = self.driver.ex_list_network_domains()[0] + portlist = self.driver.ex_list_portlist(ex_network_domain=net_domain) + self.assertTrue(isinstance(portlist, list)) + self.assertEqual(len(portlist), 3) + self.assertTrue(isinstance(portlist[0].name, str)) + self.assertTrue(isinstance(portlist[0].description, str)) + self.assertTrue(isinstance(portlist[0].state, str)) + self.assertTrue(isinstance(portlist[0].port_collection, list)) + self.assertTrue(isinstance(portlist[0].port_collection[0].begin, str)) + self.assertTrue(isinstance(portlist[0].port_collection[0].end, str)) + self.assertTrue(isinstance(portlist[0].child_portlist_list, list)) + self.assertTrue(isinstance(portlist[0].child_portlist_list[0].id, str)) + self.assertTrue(isinstance(portlist[0].child_portlist_list[0].name, str)) + self.assertTrue(isinstance(portlist[0].create_time, str)) + + def test_ex_get_port_list(self): + net_domain = self.driver.ex_list_network_domains()[0] + + portlist_id = self.driver.ex_list_portlist(ex_network_domain=net_domain)[0].id + + portlist = self.driver.ex_get_portlist(ex_portlist_id=portlist_id) + self.assertTrue(isinstance(portlist, DimensionDataPortList)) + + self.assertTrue(isinstance(portlist.name, str)) + self.assertTrue(isinstance(portlist.description, str)) + self.assertTrue(isinstance(portlist.state, str)) + self.assertTrue(isinstance(portlist.port_collection, list)) + self.assertTrue(isinstance(portlist.port_collection[0].begin, str)) + self.assertTrue(isinstance(portlist.port_collection[0].end, str)) + self.assertTrue(isinstance(portlist.child_portlist_list, list)) + self.assertTrue(isinstance(portlist.child_portlist_list[0].id, str)) + self.assertTrue(isinstance(portlist.child_portlist_list[0].name, str)) + self.assertTrue(isinstance(portlist.create_time, str)) + + def test_ex_get_portlist_STR(self): + net_domain = self.driver.ex_list_network_domains()[0] + + portlist = self.driver.ex_list_portlist(ex_network_domain=net_domain)[0] + + port_list = self.driver.ex_get_portlist(ex_portlist_id=portlist.id) + self.assertTrue(isinstance(port_list, DimensionDataPortList)) + + self.assertTrue(isinstance(port_list.name, str)) + self.assertTrue(isinstance(port_list.description, str)) + self.assertTrue(isinstance(port_list.state, str)) + self.assertTrue(isinstance(port_list.port_collection, list)) + self.assertTrue(isinstance(port_list.port_collection[0].begin, str)) + self.assertTrue(isinstance(port_list.port_collection[0].end, str)) + self.assertTrue(isinstance(port_list.child_portlist_list, list)) + self.assertTrue(isinstance(port_list.child_portlist_list[0].id, str)) + self.assertTrue(isinstance(port_list.child_portlist_list[0].name, str)) + self.assertTrue(isinstance(port_list.create_time, str)) + + def test_ex_create_portlist_NOCHILDPORTLIST(self): + name = "Test_Port_List" + description = "Test Description" + + net_domain = self.driver.ex_list_network_domains()[0] + + port_1 = DimensionDataPort(begin="8080") + port_2 = DimensionDataIpAddress(begin="8899", end="9023") + port_collection = [port_1, port_2] + + # Create IP Address List + success = self.driver.ex_create_portlist( + ex_network_domain=net_domain, + name=name, + description=description, + port_collection=port_collection, + ) + + self.assertTrue(success) + + def test_ex_create_portlist(self): + name = "Test_Port_List" + description = "Test Description" + + net_domain = self.driver.ex_list_network_domains()[0] + + port_1 = DimensionDataPort(begin="8080") + port_2 = DimensionDataIpAddress(begin="8899", end="9023") + port_collection = [port_1, port_2] + + child_port_1 = DimensionDataChildPortList( + id="333174a2-ae74-4658-9e56-50fc90e086cf", name="test port 1" + ) + child_port_2 = DimensionDataChildPortList( + id="311174a2-ae74-4658-9e56-50fc90e04444", name="test port 2" + ) + child_ports = [child_port_1, child_port_2] + + # Create IP Address List + success = self.driver.ex_create_portlist( + ex_network_domain=net_domain, + name=name, + description=description, + port_collection=port_collection, + child_portlist_list=child_ports, + ) + + self.assertTrue(success) + + def test_ex_create_portlist_STR(self): + name = "Test_Port_List" + description = "Test Description" + + net_domain = self.driver.ex_list_network_domains()[0] + + port_1 = DimensionDataPort(begin="8080") + port_2 = DimensionDataIpAddress(begin="8899", end="9023") + port_collection = [port_1, port_2] + + child_port_1 = DimensionDataChildPortList( + id="333174a2-ae74-4658-9e56-50fc90e086cf", name="test port 1" + ) + child_port_2 = DimensionDataChildPortList( + id="311174a2-ae74-4658-9e56-50fc90e04444", name="test port 2" + ) + child_ports_ids = [child_port_1.id, child_port_2.id] + + # Create IP Address List + success = self.driver.ex_create_portlist( + ex_network_domain=net_domain.id, + name=name, + description=description, + port_collection=port_collection, + child_portlist_list=child_ports_ids, + ) + + self.assertTrue(success) + + def test_ex_edit_portlist(self): + net_domain = self.driver.ex_list_network_domains()[0] + portlist = self.driver.ex_list_portlist(net_domain)[0] + + description = "Test Description" + + port_1 = DimensionDataPort(begin="8080") + port_2 = DimensionDataIpAddress(begin="8899", end="9023") + port_collection = [port_1, port_2] + + child_port_1 = DimensionDataChildPortList( + id="333174a2-ae74-4658-9e56-50fc90e086cf", name="test port 1" + ) + child_port_2 = DimensionDataChildPortList( + id="311174a2-ae74-4658-9e56-50fc90e04444", name="test port 2" + ) + child_ports = [child_port_1.id, child_port_2.id] + + # Create IP Address List + success = self.driver.ex_edit_portlist( + ex_portlist=portlist, + description=description, + port_collection=port_collection, + child_portlist_list=child_ports, + ) + self.assertTrue(success) + + def test_ex_edit_portlist_STR(self): + portlist_id = "484174a2-ae74-4658-9e56-50fc90e086cf" + description = "Test Description" + + port_1 = DimensionDataPort(begin="8080") + port_2 = DimensionDataIpAddress(begin="8899", end="9023") + port_collection = [port_1, port_2] + + child_port_1 = DimensionDataChildPortList( + id="333174a2-ae74-4658-9e56-50fc90e086cf", name="test port 1" + ) + child_port_2 = DimensionDataChildPortList( + id="311174a2-ae74-4658-9e56-50fc90e04444", name="test port 2" + ) + child_ports_ids = [child_port_1.id, child_port_2.id] + + # Create IP Address List + success = self.driver.ex_edit_portlist( + ex_portlist=portlist_id, + description=description, + port_collection=port_collection, + child_portlist_list=child_ports_ids, + ) + self.assertTrue(success) + + def test_ex_delete_portlist(self): + net_domain = self.driver.ex_list_network_domains()[0] + portlist = self.driver.ex_list_portlist(net_domain)[0] + + success = self.driver.ex_delete_portlist(ex_portlist=portlist) + self.assertTrue(success) + + def test_ex_delete_portlist_STR(self): + net_domain = self.driver.ex_list_network_domains()[0] + portlist = self.driver.ex_list_portlist(net_domain)[0] + + success = self.driver.ex_delete_portlist(ex_portlist=portlist.id) + self.assertTrue(success) + + +class InvalidRequestError(Exception): + def __init__(self, tag): + super().__init__("Invalid Request - %s" % tag) + + +class DimensionDataMockHttp(MockHttp): + fixtures = ComputeFileFixtures("dimensiondata") + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_report_usage( + self, method, url, body, headers + ): + body = self.fixtures.load("summary_usage_report.csv") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_report_usageDetailed( + self, method, url, body, headers + ): + body = self.fixtures.load("detailed_usage_report.csv") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_auditlog(self, method, url, body, headers): + body = self.fixtures.load("audit_log.csv") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_UNAUTHORIZED(self, method, url, body, headers): + return (httplib.UNAUTHORIZED, "", {}, httplib.responses[httplib.UNAUTHORIZED]) + + def _oec_0_9_myaccount(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_INPROGRESS(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_PAGINATED(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_ALLFILTERS(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_base_image(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_base_image.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_base_imageWithDiskSpeed(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_base_imageWithDiskSpeed.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployed( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployed.xml" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_pendingDeploy( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_pendingDeploy.xml" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11(self, method, url, body, headers): + body = None + action = url.split("?")[-1] + + if action == "restart": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart.xml" + ) + elif action == "shutdown": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown.xml" + ) + elif action == "delete": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete.xml" + ) + elif action == "start": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start.xml" + ) + elif action == "poweroff": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_INPROGRESS( + self, method, url, body, headers + ): + body = None + action = url.split("?")[-1] + + if action == "restart": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart_INPROGRESS.xml" + ) + elif action == "shutdown": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown_INPROGRESS.xml" + ) + elif action == "delete": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete_INPROGRESS.xml" + ) + elif action == "start": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start_INPROGRESS.xml" + ) + elif action == "poweroff": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff_INPROGRESS.xml" + ) + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server(self, method, url, body, headers): + body = self.fixtures.load("_oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation( + self, method, url, body, headers + ): + if method == "POST": + request = ET.fromstring(body) + if request.tag != "{http://oec.api.opsource.net/schemas/network}NewNetworkWithLocation": + raise InvalidRequestError(request.tag) + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation.xml" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation_NA9( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation.xml" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_4bba37be_506f_11e3_b29c_001517c4643e( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_4bba37be_506f_11e3_b29c_001517c4643e.xml" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSize( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSize.xml" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSpeed( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSpeed.xml" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1( + self, method, url, body, headers + ): + action = url.split("?")[-1] + if action == "delete": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1.xml" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "POST": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_POST.xml" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_create.xml" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_FAIL_EXISTING( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_create_FAIL.xml" + ) + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_07e3621a_a920_4a9a_943c_d8021f27f418( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_delete.xml" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_07e3621a_a920_4a9a_943c_d8021f27f418_FAIL( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_delete_FAIL.xml" + ) + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server(self, method, url, body, headers): + body = self.fixtures.load("server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deleteServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_deleteServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deleteServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_deleteServer_RESOURCEBUSY.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_rebootServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}rebootServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_rebootServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_rebootServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}rebootServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_rebootServer_RESOURCEBUSY.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server( + self, method, url, body, headers + ): + if url.endswith("datacenterId=NA3"): + body = self.fixtures.load("server_server_NA3.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + body = self.fixtures.load("server_server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGESIZE50( + self, method, url, body, headers + ): + if not url.endswith("pageSize=50"): + raise ValueError("pageSize is not set as expected") + body = self.fixtures.load("server_server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_EMPTY( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_paginated_empty.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGED_THEN_EMPTY( + self, method, url, body, headers + ): + if "pageNumber=2" in url: + body = self.fixtures.load("server_server_paginated_empty.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + body = self.fixtures.load("server_server_paginated.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGINATED( + self, method, url, body, headers + ): + if "pageNumber=2" in url: + body = self.fixtures.load("server_server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + body = self.fixtures.load("server_server_paginated.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGINATEDEMPTY( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_paginated_empty.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + for parameter in parameters: + key, value = parameter.split("=") + if key == "datacenterId": + assert value == "fake_loc" + elif key == "networkId": + assert value == "fake_network" + elif key == "networkDomainId": + assert value == "fake_network_domain" + elif key == "vlanId": + assert value == "fake_vlan" + elif key == "ipv6": + assert value == "fake_ipv6" + elif key == "privateIpv4": + assert value == "fake_ipv4" + elif key == "name": + assert value == "fake_name" + elif key == "state": + assert value == "fake_state" + elif key == "started": + assert value == "True" + elif key == "deployed": + assert value == "True" + elif key == "sourceImageId": + assert value == "fake_image" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("server_server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_antiAffinityRule( + self, method, url, body, headers + ): + body = self.fixtures.load("server_antiAffinityRule_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_antiAffinityRule_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + for parameter in parameters: + key, value = parameter.split("=") + if key == "id": + assert value == "FAKE_ID" + elif key == "state": + assert value == "FAKE_STATE" + elif key == "pageSize": + assert value == "250" + elif key == "networkDomainId": + pass + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("server_antiAffinityRule_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_antiAffinityRule_PAGINATED( + self, method, url, body, headers + ): + if "pageNumber=2" in url: + body = self.fixtures.load("server_antiAffinityRule_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + body = self.fixtures.load("server_antiAffinityRule_list_PAGINATED.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_infrastructure_datacenter( + self, method, url, body, headers + ): + if url.endswith("id=NA9"): + body = self.fixtures.load("infrastructure_datacenter_NA9.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + body = self.fixtures.load("infrastructure_datacenter.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_infrastructure_datacenter_ALLFILTERS( + self, method, url, body, headers + ): + if url.endswith("id=NA9"): + body = self.fixtures.load("infrastructure_datacenter_NA9.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + body = self.fixtures.load("infrastructure_datacenter.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_updateVmwareTools( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}updateVmwareTools": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_updateVmwareTools.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_startServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}startServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_startServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_startServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}startServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_startServer_INPROGRESS.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_shutdownServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}shutdownServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_shutdownServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_shutdownServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}shutdownServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_shutdownServer_INPROGRESS.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_resetServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}resetServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_resetServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_powerOffServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}powerOffServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_powerOffServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_powerOffServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}powerOffServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_powerOffServer_INPROGRESS.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_11_INPROGRESS( + self, method, url, body, headers + ): + body = self.fixtures.load("server_GetServer.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain( + self, method, url, body, headers + ): + body = self.fixtures.load("network_networkDomain.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + for parameter in parameters: + key, value = parameter.split("=") + if key == "datacenterId": + assert value == "fake_location" + elif key == "type": + assert value == "fake_plan" + elif key == "name": + assert value == "fake_name" + elif key == "state": + assert value == "fake_state" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("network_networkDomain.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_vlan( + self, method, url, body, headers + ): + body = self.fixtures.load("network_vlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_vlan_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + for parameter in parameters: + key, value = parameter.split("=") + if key == "datacenterId": + assert value == "fake_location" + elif key == "networkDomainId": + assert value == "fake_network_domain" + elif key == "ipv6Address": + assert value == "fake_ipv6" + elif key == "privateIpv4Address": + assert value == "fake_ipv4" + elif key == "name": + assert value == "fake_name" + elif key == "state": + assert value == "fake_state" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("network_vlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deployServer": + raise InvalidRequestError(request.tag) + + # Make sure the we either have a network tag with an IP or networkId + # Or Network info with a primary nic that has privateip or vlanid + network = request.find(fixxpath("network", TYPES_URN)) + network_info = request.find(fixxpath("networkInfo", TYPES_URN)) + if network is not None: + if network_info is not None: + raise InvalidRequestError("Request has both MCP1 and MCP2 values") + ipv4 = findtext(network, "privateIpv4", TYPES_URN) + networkId = findtext(network, "networkId", TYPES_URN) + if ipv4 is None and networkId is None: + raise InvalidRequestError( + "Invalid request MCP1 requests need privateIpv4 or networkId" + ) + elif network_info is not None: + if network is not None: + raise InvalidRequestError("Request has both MCP1 and MCP2 values") + primary_nic = network_info.find(fixxpath("primaryNic", TYPES_URN)) + ipv4 = findtext(primary_nic, "privateIpv4", TYPES_URN) + vlanId = findtext(primary_nic, "vlanId", TYPES_URN) + if ipv4 is None and vlanId is None: + raise InvalidRequestError( + "Invalid request MCP2 requests need privateIpv4 or vlanId" + ) + else: + raise InvalidRequestError( + "Invalid request, does not have network or network_info in XML" + ) + + body = self.fixtures.load("server_deployServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deployNetworkDomain( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deployNetworkDomain": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deployNetworkDomain.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be( + self, method, url, body, headers + ): + body = self.fixtures.load("network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be_ALLFILTERS( + self, method, url, body, headers + ): + body = self.fixtures.load("network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editNetworkDomain( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}editNetworkDomain": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_editNetworkDomain.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteNetworkDomain( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteNetworkDomain": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deleteNetworkDomain.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deployVlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deployVlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deployVlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_vlan_0e56433f_d808_4669_821d_812769517ff8( + self, method, url, body, headers + ): + body = self.fixtures.load("network_vlan_0e56433f_d808_4669_821d_812769517ff8.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editVlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}editVlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_editVlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteVlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteVlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deleteVlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_expandVlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}expandVlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_expandVlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_addPublicIpBlock( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}addPublicIpBlock": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_addPublicIpBlock.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba( + self, method, url, body, headers + ): + body = self.fixtures.load("network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_publicIpBlock( + self, method, url, body, headers + ): + body = self.fixtures.load("network_publicIpBlock.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8( + self, method, url, body, headers + ): + body = self.fixtures.load("network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_removePublicIpBlock( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}removePublicIpBlock": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_removePublicIpBlock.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_firewallRule( + self, method, url, body, headers + ): + body = self.fixtures.load("network_firewallRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createFirewallRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}createFirewallRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_createFirewallRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c( + self, method, url, body, headers + ): + body = self.fixtures.load("network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editFirewallRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}editFirewallRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_editFirewallRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteFirewallRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteFirewallRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deleteFirewallRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createNatRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}createNatRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_createNatRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_natRule( + self, method, url, body, headers + ): + body = self.fixtures.load("network_natRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce( + self, method, url, body, headers + ): + body = self.fixtures.load("network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteNatRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteNatRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deleteNatRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_addNic( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}addNic": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_addNic.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_removeNic( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}removeNic": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_removeNic.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_disableServerMonitoring( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}disableServerMonitoring": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_disableServerMonitoring.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_enableServerMonitoring( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}enableServerMonitoring": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_enableServerMonitoring.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_changeServerMonitoringPlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}changeServerMonitoringPlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_changeServerMonitoringPlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_BAD_REQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_BAD_REQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_FAKE_IMAGE_ID( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_BAD_REQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage( + self, method, url, body, headers + ): + body = self.fixtures.load("image_customerImage.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d( + self, method, url, body, headers + ): + body = self.fixtures.load("image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c( + self, method, url, body, headers + ): + body = self.fixtures.load("image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage_FAKE_IMAGE_ID( + self, method, url, body, headers + ): + body = self.fixtures.load("image_customerImage_BAD_REQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_reconfigureServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}reconfigureServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_reconfigureServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_cleanServer( + self, method, url, body, headers + ): + body = self.fixtures.load("server_cleanServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_addDisk( + self, method, url, body, headers + ): + body = self.fixtures.load("server_addDisk.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_removeDisk( + self, method, url, body, headers + ): + body = self.fixtures.load("server_removeDisk.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_createTagKey( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}createTagKey": + raise InvalidRequestError(request.tag) + name = findtext(request, "name", TYPES_URN) + description = findtext(request, "description", TYPES_URN) + value_required = findtext(request, "valueRequired", TYPES_URN) + display_on_report = findtext(request, "displayOnReport", TYPES_URN) + if name is None: + raise ValueError("Name must have a value in the request") + if description is not None: + raise ValueError("Default description for a tag should be blank") + if value_required is None or value_required != "true": + raise ValueError("Default valueRequired should be true") + if display_on_report is None or display_on_report != "true": + raise ValueError("Default displayOnReport should be true") + + body = self.fixtures.load("tag_createTagKey.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_createTagKey_ALLPARAMS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}createTagKey": + raise InvalidRequestError(request.tag) + name = findtext(request, "name", TYPES_URN) + description = findtext(request, "description", TYPES_URN) + value_required = findtext(request, "valueRequired", TYPES_URN) + display_on_report = findtext(request, "displayOnReport", TYPES_URN) + if name is None: + raise ValueError("Name must have a value in the request") + if description is None: + raise ValueError("Description should have a value") + if value_required is None or value_required != "false": + raise ValueError("valueRequired should be false") + if display_on_report is None or display_on_report != "false": + raise ValueError("displayOnReport should be false") + + body = self.fixtures.load("tag_createTagKey.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_createTagKey_BADREQUEST( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_createTagKey_BADREQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey(self, method, url, body, headers): + body = self.fixtures.load("tag_tagKey_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_SINGLE( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_tagKey_list_SINGLE.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + for parameter in parameters: + key, value = parameter.split("=") + if key == "id": + assert value == "fake_id" + elif key == "name": + assert value == "fake_name" + elif key == "valueRequired": + assert value == "false" + elif key == "displayOnReport": + assert value == "false" + elif key == "pageSize": + assert value == "250" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("tag_tagKey_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_d047c609_93d7_4bc5_8fc9_732c85840075( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_d047c609_93d7_4bc5_8fc9_732c85840075_NOEXIST( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54_BADREQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_editTagKey_NAME( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}editTagKey": + raise InvalidRequestError(request.tag) + name = findtext(request, "name", TYPES_URN) + description = findtext(request, "description", TYPES_URN) + value_required = findtext(request, "valueRequired", TYPES_URN) + display_on_report = findtext(request, "displayOnReport", TYPES_URN) + if name is None: + raise ValueError("Name must have a value in the request") + if description is not None: + raise ValueError("Description should be empty") + if value_required is not None: + raise ValueError("valueRequired should be empty") + if display_on_report is not None: + raise ValueError("displayOnReport should be empty") + body = self.fixtures.load("tag_editTagKey.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_editTagKey_NOTNAME( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}editTagKey": + raise InvalidRequestError(request.tag) + name = findtext(request, "name", TYPES_URN) + description = findtext(request, "description", TYPES_URN) + value_required = findtext(request, "valueRequired", TYPES_URN) + display_on_report = findtext(request, "displayOnReport", TYPES_URN) + if name is not None: + raise ValueError("Name should be empty") + if description is None: + raise ValueError("Description should not be empty") + if value_required is None: + raise ValueError("valueRequired should not be empty") + if display_on_report is None: + raise ValueError("displayOnReport should not be empty") + body = self.fixtures.load("tag_editTagKey.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_editTagKey_NOCHANGE( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_editTagKey_BADREQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_deleteTagKey( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteTagKey": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("tag_deleteTagKey.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_deleteTagKey_NOEXIST( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_deleteTagKey_BADREQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_applyTags( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}applyTags": + raise InvalidRequestError(request.tag) + asset_type = findtext(request, "assetType", TYPES_URN) + asset_id = findtext(request, "assetId", TYPES_URN) + tag = request.find(fixxpath("tag", TYPES_URN)) + tag_key_name = findtext(tag, "tagKeyName", TYPES_URN) + value = findtext(tag, "value", TYPES_URN) + if asset_type is None: + raise ValueError("assetType should not be empty") + if asset_id is None: + raise ValueError("assetId should not be empty") + if tag_key_name is None: + raise ValueError("tagKeyName should not be empty") + if value is None: + raise ValueError("value should not be empty") + + body = self.fixtures.load("tag_applyTags.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_applyTags_NOVALUE( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}applyTags": + raise InvalidRequestError(request.tag) + asset_type = findtext(request, "assetType", TYPES_URN) + asset_id = findtext(request, "assetId", TYPES_URN) + tag = request.find(fixxpath("tag", TYPES_URN)) + tag_key_name = findtext(tag, "tagKeyName", TYPES_URN) + value = findtext(tag, "value", TYPES_URN) + if asset_type is None: + raise ValueError("assetType should not be empty") + if asset_id is None: + raise ValueError("assetId should not be empty") + if tag_key_name is None: + raise ValueError("tagKeyName should not be empty") + if value is not None: + raise ValueError("value should be empty") + + body = self.fixtures.load("tag_applyTags.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_applyTags_NOTAGKEY( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_applyTags_BADREQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_removeTags( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}removeTags": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("tag_removeTag.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_removeTags_NOTAG( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_removeTag_BADREQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tag(self, method, url, body, headers): + body = self.fixtures.load("tag_tag_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tag_ALLPARAMS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + for parameter in parameters: + key, value = parameter.split("=") + if key == "assetId": + assert value == "fake_asset_id" + elif key == "assetType": + assert value == "fake_asset_type" + elif key == "valueRequired": + assert value == "false" + elif key == "displayOnReport": + assert value == "false" + elif key == "pageSize": + assert value == "250" + elif key == "datacenterId": + assert value == "fake_location" + elif key == "value": + assert value == "fake_value" + elif key == "tagKeyName": + assert value == "fake_tag_key_name" + elif key == "tagKeyId": + assert value == "fake_tag_key_id" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("tag_tag_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_ipAddressList( + self, method, url, body, headers + ): + body = self.fixtures.load("ip_address_lists.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_ipAddressList_FILTERBYNAME( + self, method, url, body, headers + ): + body = self.fixtures.load("ip_address_lists_FILTERBYNAME.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createIpAddressList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}" "createIpAddressList": + raise InvalidRequestError(request.tag) + + net_domain = findtext(request, "networkDomainId", TYPES_URN) + if net_domain is None: + raise ValueError("Network Domain should not be empty") + + name = findtext(request, "name", TYPES_URN) + if name is None: + raise ValueError("Name should not be empty") + + ip_version = findtext(request, "ipVersion", TYPES_URN) + if ip_version is None: + raise ValueError("IP Version should not be empty") + + ip_address_col_required = findall(request, "ipAddress", TYPES_URN) + child_ip_address_required = findall(request, "childIpAddressListId", TYPES_URN) + + if 0 == len(ip_address_col_required) and 0 == len(child_ip_address_required): + raise ValueError( + "At least one ipAddress element or " + "one childIpAddressListId element must be " + "provided." + ) + + if ip_address_col_required[0].get("begin") is None: + raise ValueError("IP Address should not be empty") + + body = self.fixtures.load("ip_address_list_create.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editIpAddressList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}" "editIpAddressList": + raise InvalidRequestError(request.tag) + + ip_address_list = request.get("id") + if ip_address_list is None: + raise ValueError("IpAddressList ID should not be empty") + + name = findtext(request, "name", TYPES_URN) + if name is not None: + raise ValueError("Name should not exists in request") + + ip_version = findtext(request, "ipVersion", TYPES_URN) + if ip_version is not None: + raise ValueError("IP Version should not exists in request") + + ip_address_col_required = findall(request, "ipAddress", TYPES_URN) + child_ip_address_required = findall(request, "childIpAddressListId", TYPES_URN) + + if 0 == len(ip_address_col_required) and 0 == len(child_ip_address_required): + raise ValueError( + "At least one ipAddress element or " + "one childIpAddressListId element must be " + "provided." + ) + + if ip_address_col_required[0].get("begin") is None: + raise ValueError("IP Address should not be empty") + + body = self.fixtures.load("ip_address_list_edit.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteIpAddressList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}" "deleteIpAddressList": + raise InvalidRequestError(request.tag) + + ip_address_list = request.get("id") + if ip_address_list is None: + raise ValueError("IpAddressList ID should not be empty") + + body = self.fixtures.load("ip_address_list_delete.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_portList( + self, method, url, body, headers + ): + body = self.fixtures.load("port_list_lists.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_portList_c8c92ea3_2da8_4d51_8153_f39bec794d69( + self, method, url, body, headers + ): + body = self.fixtures.load("port_list_get.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createPortList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}" "createPortList": + raise InvalidRequestError(request.tag) + + net_domain = findtext(request, "networkDomainId", TYPES_URN) + if net_domain is None: + raise ValueError("Network Domain should not be empty") + + ports_required = findall(request, "port", TYPES_URN) + child_port_list_required = findall(request, "childPortListId", TYPES_URN) + + if 0 == len(ports_required) and 0 == len(child_port_list_required): + raise ValueError( + "At least one port element or one " "childPortListId element must be provided" + ) + + if ports_required[0].get("begin") is None: + raise ValueError("PORT begin value should not be empty") + + body = self.fixtures.load("port_list_create.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editPortList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}" "editPortList": + raise InvalidRequestError(request.tag) + + ports_required = findall(request, "port", TYPES_URN) + child_port_list_required = findall(request, "childPortListId", TYPES_URN) + + if 0 == len(ports_required) and 0 == len(child_port_list_required): + raise ValueError( + "At least one port element or one " "childPortListId element must be provided" + ) + + if ports_required[0].get("begin") is None: + raise ValueError("PORT begin value should not be empty") + + body = self.fixtures.load("port_list_edit.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deletePortList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}" "deletePortList": + raise InvalidRequestError(request.tag) + + port_list = request.get("id") + if port_list is None: + raise ValueError("Port List ID should not be empty") + + body = self.fixtures.load("ip_address_list_delete.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_dimensiondata_v2_4.py b/libcloud/test/compute/test_dimensiondata_v2_4.py new file mode 100644 index 0000000000..0462420da4 --- /dev/null +++ b/libcloud/test/compute/test_dimensiondata_v2_4.py @@ -0,0 +1,3940 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +from types import GeneratorType + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import ET, httplib +from libcloud.utils.xml import findall, findtext, fixxpath +from libcloud.common.types import InvalidCredsError +from libcloud.compute.base import Node, NodeLocation, NodeAuthPassword +from libcloud.test.secrets import DIMENSIONDATA_PARAMS +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.common.dimensiondata import ( + TYPES_URN, + DimensionDataTag, + DimensionDataPort, + DimensionDataTagKey, + DimensionDataPortList, + DimensionDataIpAddress, + DimensionDataServerDisk, + NetworkDomainServicePlan, + DimensionDataAPIException, + DimensionDataChildPortList, + DimensionDataIpAddressList, + DimensionDataServerVMWareTools, + DimensionDataChildIpAddressList, + DimensionDataServerCpuSpecification, +) +from libcloud.compute.drivers.dimensiondata import DimensionDataNic +from libcloud.compute.drivers.dimensiondata import DimensionDataNodeDriver as DimensionData + + +class DimensionData_v2_4_Tests(unittest.TestCase): + def setUp(self): + DimensionData.connectionCls.active_api_version = "2.4" + DimensionData.connectionCls.conn_class = DimensionDataMockHttp + DimensionDataMockHttp.type = None + self.driver = DimensionData(*DIMENSIONDATA_PARAMS) + + def test_invalid_region(self): + with self.assertRaises(ValueError): + DimensionData(*DIMENSIONDATA_PARAMS, region="blah") + + def test_invalid_creds(self): + DimensionDataMockHttp.type = "UNAUTHORIZED" + with self.assertRaises(InvalidCredsError): + self.driver.list_nodes() + + def test_get_account_details(self): + DimensionDataMockHttp.type = None + ret = self.driver.connection.get_account_details() + self.assertEqual(ret.full_name, "Test User") + self.assertEqual(ret.first_name, "Test") + self.assertEqual(ret.email, "test@example.com") + + def test_list_locations_response(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_locations() + self.assertEqual(len(ret), 5) + first_loc = ret[0] + self.assertEqual(first_loc.id, "NA3") + self.assertEqual(first_loc.name, "US - West") + self.assertEqual(first_loc.country, "US") + + def test_list_nodes_response(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_nodes() + self.assertEqual(len(ret), 7) + + def test_node_extras(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_nodes() + self.assertTrue(isinstance(ret[0].extra["vmWareTools"], DimensionDataServerVMWareTools)) + self.assertTrue(isinstance(ret[0].extra["cpu"], DimensionDataServerCpuSpecification)) + self.assertTrue(isinstance(ret[0].extra["disks"], list)) + self.assertTrue(isinstance(ret[0].extra["disks"][0], DimensionDataServerDisk)) + self.assertEqual(ret[0].extra["disks"][0].size_gb, 10) + self.assertTrue(isinstance(ret[1].extra["disks"], list)) + self.assertTrue(isinstance(ret[1].extra["disks"][0], DimensionDataServerDisk)) + self.assertEqual(ret[1].extra["disks"][0].size_gb, 10) + + def test_server_states(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_nodes() + self.assertTrue(ret[0].state == "running") + self.assertTrue(ret[1].state == "starting") + self.assertTrue(ret[2].state == "stopping") + self.assertTrue(ret[3].state == "reconfiguring") + self.assertTrue(ret[4].state == "running") + self.assertTrue(ret[5].state == "terminated") + self.assertTrue(ret[6].state == "stopped") + self.assertEqual(len(ret), 7) + + def test_list_nodes_response_PAGINATED(self): + DimensionDataMockHttp.type = "PAGINATED" + ret = self.driver.list_nodes() + self.assertEqual(len(ret), 9) + + def test_paginated_mcp2_call_EMPTY(self): + # cache org + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "EMPTY" + node_list_generator = self.driver.connection.paginated_request_with_orgId_api_2( + "server/server" + ) + empty_node_list = [] + + for node_list in node_list_generator: + empty_node_list.extend(node_list) + self.assertTrue(len(empty_node_list) == 0) + + def test_paginated_mcp2_call_PAGED_THEN_EMPTY(self): + # cache org + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "PAGED_THEN_EMPTY" + node_list_generator = self.driver.connection.paginated_request_with_orgId_api_2( + "server/server" + ) + final_node_list = [] + + for node_list in node_list_generator: + final_node_list.extend(node_list) + self.assertTrue(len(final_node_list) == 2) + + def test_paginated_mcp2_call_with_page_size(self): + # cache org + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "PAGESIZE50" + node_list_generator = self.driver.connection.paginated_request_with_orgId_api_2( + "server/server", page_size=50 + ) + self.assertTrue(isinstance(node_list_generator, GeneratorType)) + + # We're making sure here the filters make it to the URL + # See _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_ALLFILTERS for asserts + def test_list_nodes_response_strings_ALLFILTERS(self): + DimensionDataMockHttp.type = "ALLFILTERS" + ret = self.driver.list_nodes( + ex_location="fake_loc", + ex_name="fake_name", + ex_ipv6="fake_ipv6", + ex_ipv4="fake_ipv4", + ex_vlan="fake_vlan", + ex_image="fake_image", + ex_deployed=True, + ex_started=True, + ex_state="fake_state", + ex_network="fake_network", + ex_network_domain="fake_network_domain", + ) + self.assertTrue(isinstance(ret, list)) + self.assertEqual(len(ret), 7) + + node = ret[3] + self.assertTrue(isinstance(node.extra["disks"], list)) + self.assertTrue(isinstance(node.extra["disks"][0], DimensionDataServerDisk)) + self.assertEqual(node.size.id, "1") + self.assertEqual(node.image.id, "3ebf3c0f-90fe-4a8b-8585-6e65b316592c") + self.assertEqual(node.image.name, "WIN2008S/32") + disk = node.extra["disks"][0] + self.assertEqual(disk.id, "c2e1f199-116e-4dbc-9960-68720b832b0a") + self.assertEqual(disk.scsi_id, 0) + self.assertEqual(disk.size_gb, 50) + self.assertEqual(disk.speed, "STANDARD") + self.assertEqual(disk.state, "NORMAL") + + def test_list_nodes_response_LOCATION(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_locations() + first_loc = ret[0] + ret = self.driver.list_nodes(ex_location=first_loc) + + for node in ret: + self.assertEqual(node.extra["datacenterId"], "NA3") + + def test_list_nodes_response_LOCATION_STR(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_nodes(ex_location="NA3") + + for node in ret: + self.assertEqual(node.extra["datacenterId"], "NA3") + + def test_list_sizes_response(self): + DimensionDataMockHttp.type = None + ret = self.driver.list_sizes() + self.assertEqual(len(ret), 1) + size = ret[0] + self.assertEqual(size.name, "default") + + def test_reboot_node_response(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = node.reboot() + self.assertTrue(ret is True) + + def test_reboot_node_response_INPROGRESS(self): + DimensionDataMockHttp.type = "INPROGRESS" + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + with self.assertRaises(DimensionDataAPIException): + node.reboot() + + def test_destroy_node_response(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = node.destroy() + self.assertTrue(ret is True) + + def test_destroy_node_response_RESOURCE_BUSY(self): + DimensionDataMockHttp.type = "INPROGRESS" + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + with self.assertRaises(DimensionDataAPIException): + node.destroy() + + def test_list_images(self): + images = self.driver.list_images() + self.assertEqual(len(images), 3) + self.assertEqual(images[0].name, "RedHat 6 64-bit 2 CPU") + self.assertEqual(images[0].id, "c14b1a46-2428-44c1-9c1a-b20e6418d08c") + self.assertEqual(images[0].extra["location"].id, "NA9") + self.assertEqual(images[0].extra["cpu"].cpu_count, 2) + self.assertEqual(images[0].extra["OS_displayName"], "REDHAT6/64") + + def test_clean_failed_deployment_response_with_node(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_clean_failed_deployment(node) + self.assertTrue(ret is True) + + def test_clean_failed_deployment_response_with_node_id(self): + node = "e75ead52-692f-4314-8725-c8a4f4d13a87" + ret = self.driver.ex_clean_failed_deployment(node) + self.assertTrue(ret is True) + + def test_ex_list_customer_images(self): + images = self.driver.ex_list_customer_images() + self.assertEqual(len(images), 3) + self.assertEqual(images[0].name, "ImportedCustomerImage") + self.assertEqual(images[0].id, "5234e5c7-01de-4411-8b6e-baeb8d91cf5d") + self.assertEqual(images[0].extra["location"].id, "NA9") + self.assertEqual(images[0].extra["cpu"].cpu_count, 4) + self.assertEqual(images[0].extra["OS_displayName"], "REDHAT6/64") + + def test_create_mcp1_node_optional_param(self): + root_pw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + network = self.driver.ex_list_networks()[0] + cpu_spec = DimensionDataServerCpuSpecification( + cpu_count="4", cores_per_socket="2", performance="STANDARD" + ) + disks = [DimensionDataServerDisk(scsi_id="0", speed="HIGHPERFORMANCE")] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ex_memory_gb=8, + ex_disks=disks, + ex_cpu_specification=cpu_spec, + ex_primary_dns="10.0.0.5", + ex_secondary_dns="10.0.0.6", + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_mcp1_node_response_no_pass_random_gen(self): + image = self.driver.list_images()[0] + network = self.driver.ex_list_networks()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + self.assertTrue("password" in node.extra) + + def test_create_mcp1_node_response_no_pass_customer_windows(self): + image = self.driver.ex_list_customer_images()[1] + network = self.driver.ex_list_networks()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + self.assertTrue("password" in node.extra) + + def test_create_mcp1_node_response_no_pass_customer_windows_STR(self): + image = self.driver.ex_list_customer_images()[1].id + network = self.driver.ex_list_networks()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + self.assertTrue("password" in node.extra) + + def test_create_mcp1_node_response_no_pass_customer_linux(self): + image = self.driver.ex_list_customer_images()[0] + network = self.driver.ex_list_networks()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + self.assertTrue("password" not in node.extra) + + def test_create_mcp1_node_response_no_pass_customer_linux_STR(self): + image = self.driver.ex_list_customer_images()[0].id + network = self.driver.ex_list_networks()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + self.assertTrue("password" not in node.extra) + + def test_create_mcp1_node_response_STR(self): + rootPw = "pass123" + image = self.driver.list_images()[0].id + network = self.driver.ex_list_networks()[0].id + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_response_network_domain(self): + rootPw = NodeAuthPassword("pass123") + location = self.driver.ex_get_location_by_id("NA9") + image = self.driver.list_images(location=location)[0] + network_domain = self.driver.ex_list_network_domains(location=location)[0] + vlan = self.driver.ex_list_vlans(location=location)[0] + cpu = DimensionDataServerCpuSpecification( + cpu_count=4, cores_per_socket=1, performance="HIGHPERFORMANCE" + ) + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain=network_domain, + ex_vlan=vlan, + ex_is_started=False, + ex_cpu_specification=cpu, + ex_memory_gb=4, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_response_network_domain_STR(self): + rootPw = NodeAuthPassword("pass123") + location = self.driver.ex_get_location_by_id("NA9") + image = self.driver.list_images(location=location)[0] + network_domain = self.driver.ex_list_network_domains(location=location)[0].id + vlan = self.driver.ex_list_vlans(location=location)[0].id + cpu = DimensionDataServerCpuSpecification( + cpu_count=4, cores_per_socket=1, performance="HIGHPERFORMANCE" + ) + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain=network_domain, + ex_vlan=vlan, + ex_is_started=False, + ex_cpu_specification=cpu, + ex_memory_gb=4, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_mcp1_node_no_network(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(InvalidRequestError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network=None, + ex_is_started=False, + ) + + def test_create_node_mcp1_ipv4(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network="fakenetwork", + ex_primary_ipv4="10.0.0.1", + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_mcp1_network(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network="fakenetwork", + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_mcp2_vlan(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_vlan="fakevlan", + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_mcp2_ipv4(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_ipv4="10.0.0.1", + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_network_domain_no_vlan_or_ipv4(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fake_network_domain", + ex_is_started=False, + ) + + def test_create_node_response(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_vlan="fakevlan", + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_ms_time_zone(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_vlan="fakevlan", + ex_microsoft_time_zone="040", + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_ambigious_mcps_fail(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_network="fakenetwork", + ex_primary_nic_vlan="fakevlan", + ) + + def test_create_node_no_network_domain_fail(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, name="test3", image=image, auth=rootPw, ex_primary_nic_vlan="fakevlan" + ) + + def test_create_node_no_primary_nic_fail(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ) + + def test_create_node_primary_vlan_nic(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_vlan="fakevlan", + ex_primary_nic_network_adapter="v1000", + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_primary_ipv4(self): + rootPw = "pass123" + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_both_primary_nic_and_vlan_fail(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_primary_nic_vlan="fakevlan", + ) + + def test_create_node_cpu_specification(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + cpu_spec = DimensionDataServerCpuSpecification( + cpu_count="4", cores_per_socket="2", performance="STANDARD" + ) + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_cpu_specification=cpu_spec, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_memory(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_memory_gb=8, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_disks(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + disks = [DimensionDataServerDisk(scsi_id="0", speed="HIGHPERFORMANCE")] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_disks=disks, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_disks_fail(self): + root_pw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + disks = "blah" + with self.assertRaises(TypeError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_disks=disks, + ) + + def test_create_node_ipv4_gateway(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_ipv4_gateway="10.2.2.2", + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_network_domain_no_vlan_no_ipv4_fail(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fake_network_domain", + ex_is_started=False, + ) + + def test_create_node_mcp2_additional_nics_legacy(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + additional_vlans = ["fakevlan1", "fakevlan2"] + additional_ipv4 = ["10.0.0.2", "10.0.0.3"] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_ipv4="10.0.0.1", + ex_additional_nics_vlan=additional_vlans, + ex_additional_nics_ipv4=additional_ipv4, + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_bad_additional_nics_ipv4(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(TypeError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fake_network_domain", + ex_vlan="fake_vlan", + ex_additional_nics_ipv4="badstring", + ex_is_started=False, + ) + + def test_create_node_additional_nics(self): + root_pw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + nic1 = DimensionDataNic(vlan="fake_vlan", network_adapter_name="v1000") + nic2 = DimensionDataNic(private_ip_v4="10.1.1.2", network_adapter_name="v1000") + additional_nics = [nic1, nic2] + + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_additional_nics=additional_nics, + ex_is_started=False, + ) + + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_create_node_additional_nics_vlan_ipv4_coexist_fail(self): + root_pw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + nic1 = DimensionDataNic( + private_ip_v4="10.1.1.1", vlan="fake_vlan", network_adapter_name="v1000" + ) + nic2 = DimensionDataNic( + private_ip_v4="10.1.1.2", vlan="fake_vlan2", network_adapter_name="v1000" + ) + additional_nics = [nic1, nic2] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_additional_nics=additional_nics, + ex_is_started=False, + ) + + def test_create_node_additional_nics_invalid_input_fail(self): + root_pw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + additional_nics = "blah" + with self.assertRaises(TypeError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_additional_nics=additional_nics, + ex_is_started=False, + ) + + def test_create_node_additional_nics_vlan_ipv4_not_exist_fail(self): + root_pw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + nic1 = DimensionDataNic(network_adapter_name="v1000") + nic2 = DimensionDataNic(network_adapter_name="v1000") + additional_nics = [nic1, nic2] + with self.assertRaises(ValueError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_additional_nics=additional_nics, + ex_is_started=False, + ) + + def test_create_node_bad_additional_nics_vlan(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + with self.assertRaises(TypeError): + self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fake_network_domain", + ex_vlan="fake_vlan", + ex_additional_nics_vlan="badstring", + ex_is_started=False, + ) + + def test_create_node_mcp2_indicate_dns(self): + rootPw = NodeAuthPassword("pass123") + image = self.driver.list_images()[0] + node = self.driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test node dns", + ex_network_domain="fakenetworkdomain", + ex_primary_ipv4="10.0.0.1", + ex_primary_dns="8.8.8.8", + ex_secondary_dns="8.8.4.4", + ex_is_started=False, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + self.assertEqual(node.extra["status"].action, "DEPLOY_SERVER") + + def test_ex_shutdown_graceful(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_shutdown_graceful(node) + self.assertTrue(ret is True) + + def test_ex_shutdown_graceful_INPROGRESS(self): + DimensionDataMockHttp.type = "INPROGRESS" + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_shutdown_graceful(node) + + def test_ex_start_node(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_start_node(node) + self.assertTrue(ret is True) + + def test_ex_start_node_INPROGRESS(self): + DimensionDataMockHttp.type = "INPROGRESS" + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_start_node(node) + + def test_ex_power_off(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_power_off(node) + self.assertTrue(ret is True) + + def test_ex_update_vm_tools(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_update_vm_tools(node) + self.assertTrue(ret is True) + + def test_ex_power_off_INPROGRESS(self): + DimensionDataMockHttp.type = "INPROGRESS" + node = Node( + id="11", + name=None, + state="STOPPING", + public_ips=None, + private_ips=None, + driver=self.driver, + ) + + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_power_off(node) + + def test_ex_reset(self): + node = Node( + id="11", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_reset(node) + self.assertTrue(ret is True) + + def test_ex_attach_node_to_vlan(self): + node = self.driver.ex_get_node_by_id("e75ead52-692f-4314-8725-c8a4f4d13a87") + vlan = self.driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + ret = self.driver.ex_attach_node_to_vlan(node, vlan) + self.assertTrue(ret is True) + + def test_ex_destroy_nic(self): + node = self.driver.ex_destroy_nic("a202e51b-41c0-4cfc-add0-b1c62fc0ecf6") + self.assertTrue(node) + + def test_list_networks(self): + nets = self.driver.list_networks() + self.assertEqual(nets[0].name, "test-net1") + self.assertTrue(isinstance(nets[0].location, NodeLocation)) + + def test_ex_create_network(self): + location = self.driver.ex_get_location_by_id("NA9") + net = self.driver.ex_create_network(location, "Test Network", "test") + self.assertEqual(net.id, "208e3a8e-9d2f-11e2-b29c-001517c4643e") + self.assertEqual(net.name, "Test Network") + + def test_ex_create_network_NO_DESCRIPTION(self): + location = self.driver.ex_get_location_by_id("NA9") + net = self.driver.ex_create_network(location, "Test Network") + self.assertEqual(net.id, "208e3a8e-9d2f-11e2-b29c-001517c4643e") + self.assertEqual(net.name, "Test Network") + + def test_ex_delete_network(self): + net = self.driver.ex_list_networks()[0] + result = self.driver.ex_delete_network(net) + self.assertTrue(result) + + def test_ex_rename_network(self): + net = self.driver.ex_list_networks()[0] + result = self.driver.ex_rename_network(net, "barry") + self.assertTrue(result) + + def test_ex_create_network_domain(self): + location = self.driver.ex_get_location_by_id("NA9") + plan = NetworkDomainServicePlan.ADVANCED + net = self.driver.ex_create_network_domain( + location=location, name="test", description="test", service_plan=plan + ) + self.assertEqual(net.name, "test") + self.assertTrue(net.id, "f14a871f-9a25-470c-aef8-51e13202e1aa") + + def test_ex_create_network_domain_NO_DESCRIPTION(self): + location = self.driver.ex_get_location_by_id("NA9") + plan = NetworkDomainServicePlan.ADVANCED + net = self.driver.ex_create_network_domain( + location=location, name="test", service_plan=plan + ) + self.assertEqual(net.name, "test") + self.assertTrue(net.id, "f14a871f-9a25-470c-aef8-51e13202e1aa") + + def test_ex_get_network_domain(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + self.assertEqual(net.id, "8cdfd607-f429-4df6-9352-162cfc0891be") + self.assertEqual(net.description, "test2") + self.assertEqual(net.name, "test") + + def test_ex_update_network_domain(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + net.name = "new name" + net2 = self.driver.ex_update_network_domain(net) + self.assertEqual(net2.name, "new name") + + def test_ex_delete_network_domain(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + result = self.driver.ex_delete_network_domain(net) + self.assertTrue(result) + + def test_ex_list_networks(self): + nets = self.driver.ex_list_networks() + self.assertEqual(nets[0].name, "test-net1") + self.assertTrue(isinstance(nets[0].location, NodeLocation)) + + def test_ex_list_network_domains(self): + nets = self.driver.ex_list_network_domains() + self.assertEqual(nets[0].name, "Aurora") + self.assertTrue(isinstance(nets[0].location, NodeLocation)) + + def test_ex_list_network_domains_ALLFILTERS(self): + DimensionDataMockHttp.type = "ALLFILTERS" + nets = self.driver.ex_list_network_domains( + location="fake_location", + name="fake_name", + service_plan="fake_plan", + state="fake_state", + ) + self.assertEqual(nets[0].name, "Aurora") + self.assertTrue(isinstance(nets[0].location, NodeLocation)) + + def test_ex_list_vlans(self): + vlans = self.driver.ex_list_vlans() + self.assertEqual(vlans[0].name, "Primary") + + def test_ex_list_vlans_ALLFILTERS(self): + DimensionDataMockHttp.type = "ALLFILTERS" + vlans = self.driver.ex_list_vlans( + location="fake_location", + network_domain="fake_network_domain", + name="fake_name", + ipv4_address="fake_ipv4", + ipv6_address="fake_ipv6", + state="fake_state", + ) + self.assertEqual(vlans[0].name, "Primary") + + def test_ex_create_vlan( + self, + ): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + vlan = self.driver.ex_create_vlan( + network_domain=net, + name="test", + private_ipv4_base_address="10.3.4.0", + private_ipv4_prefix_size="24", + description="test vlan", + ) + self.assertEqual(vlan.id, "0e56433f-d808-4669-821d-812769517ff8") + + def test_ex_create_vlan_NO_DESCRIPTION( + self, + ): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + vlan = self.driver.ex_create_vlan( + network_domain=net, + name="test", + private_ipv4_base_address="10.3.4.0", + private_ipv4_prefix_size="24", + ) + self.assertEqual(vlan.id, "0e56433f-d808-4669-821d-812769517ff8") + + def test_ex_get_vlan(self): + vlan = self.driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + self.assertEqual(vlan.id, "0e56433f-d808-4669-821d-812769517ff8") + self.assertEqual(vlan.description, "test2") + self.assertEqual(vlan.status, "NORMAL") + self.assertEqual(vlan.name, "Production VLAN") + self.assertEqual(vlan.private_ipv4_range_address, "10.0.3.0") + self.assertEqual(vlan.private_ipv4_range_size, 24) + self.assertEqual(vlan.ipv6_range_size, 64) + self.assertEqual(vlan.ipv6_range_address, "2607:f480:1111:1153:0:0:0:0") + self.assertEqual(vlan.ipv4_gateway, "10.0.3.1") + self.assertEqual(vlan.ipv6_gateway, "2607:f480:1111:1153:0:0:0:1") + + def test_ex_wait_for_state(self): + self.driver.ex_wait_for_state( + "NORMAL", + self.driver.ex_get_vlan, + vlan_id="0e56433f-d808-4669-821d-812769517ff8", + poll_interval=0.1, + ) + + def test_ex_wait_for_state_NODE(self): + self.driver.ex_wait_for_state( + "running", + self.driver.ex_get_node_by_id, + id="e75ead52-692f-4314-8725-c8a4f4d13a87", + poll_interval=0.1, + ) + + def test_ex_wait_for_state_FAIL(self): + with self.assertRaises(DimensionDataAPIException) as context: + self.driver.ex_wait_for_state( + "starting", + self.driver.ex_get_node_by_id, + id="e75ead52-692f-4314-8725-c8a4f4d13a87", + poll_interval=0.1, + timeout=0.1, + ) + self.assertEqual(context.exception.code, "running") + self.assertTrue("timed out" in context.exception.msg) + + def test_ex_update_vlan(self): + vlan = self.driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + vlan.name = "new name" + vlan2 = self.driver.ex_update_vlan(vlan) + self.assertEqual(vlan2.name, "new name") + + def test_ex_delete_vlan(self): + vlan = self.driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + result = self.driver.ex_delete_vlan(vlan) + self.assertTrue(result) + + def test_ex_expand_vlan(self): + vlan = self.driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + vlan.private_ipv4_range_size = "23" + vlan = self.driver.ex_expand_vlan(vlan) + self.assertEqual(vlan.private_ipv4_range_size, "23") + + def test_ex_add_public_ip_block_to_network_domain(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + block = self.driver.ex_add_public_ip_block_to_network_domain(net) + self.assertEqual(block.id, "9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8") + + def test_ex_list_public_ip_blocks(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + blocks = self.driver.ex_list_public_ip_blocks(net) + self.assertEqual(blocks[0].base_ip, "168.128.4.18") + self.assertEqual(blocks[0].size, "2") + self.assertEqual(blocks[0].id, "9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8") + self.assertEqual(blocks[0].location.id, "NA9") + self.assertEqual(blocks[0].network_domain.id, net.id) + + def test_ex_get_public_ip_block(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + block = self.driver.ex_get_public_ip_block("9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8") + self.assertEqual(block.base_ip, "168.128.4.18") + self.assertEqual(block.size, "2") + self.assertEqual(block.id, "9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8") + self.assertEqual(block.location.id, "NA9") + self.assertEqual(block.network_domain.id, net.id) + + def test_ex_delete_public_ip_block(self): + block = self.driver.ex_get_public_ip_block("9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8") + result = self.driver.ex_delete_public_ip_block(block) + self.assertTrue(result) + + def test_ex_list_firewall_rules(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + self.assertEqual(rules[0].id, "756cba02-b0bc-48f4-aea5-9445870b6148") + self.assertEqual(rules[0].network_domain.id, "8cdfd607-f429-4df6-9352-162cfc0891be") + self.assertEqual(rules[0].name, "CCDEFAULT.BlockOutboundMailIPv4") + self.assertEqual(rules[0].action, "DROP") + self.assertEqual(rules[0].ip_version, "IPV4") + self.assertEqual(rules[0].protocol, "TCP") + self.assertEqual(rules[0].source.ip_address, "ANY") + self.assertTrue(rules[0].source.any_ip) + self.assertTrue(rules[0].destination.any_ip) + + def test_ex_create_firewall_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + rule = self.driver.ex_create_firewall_rule(net, rules[0], "FIRST") + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_create_firewall_rule_with_specific_source_ip(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + specific_source_ip_rule = list(filter(lambda x: x.name == "SpecificSourceIP", rules))[0] + rule = self.driver.ex_create_firewall_rule(net, specific_source_ip_rule, "FIRST") + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_create_firewall_rule_with_source_ip(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + specific_source_ip_rule = list(filter(lambda x: x.name == "SpecificSourceIP", rules))[0] + specific_source_ip_rule.source.any_ip = False + specific_source_ip_rule.source.ip_address = "10.0.0.1" + specific_source_ip_rule.source.ip_prefix_size = "15" + rule = self.driver.ex_create_firewall_rule(net, specific_source_ip_rule, "FIRST") + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_create_firewall_rule_with_any_ip(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + specific_source_ip_rule = list(filter(lambda x: x.name == "SpecificSourceIP", rules))[0] + specific_source_ip_rule.source.any_ip = True + rule = self.driver.ex_create_firewall_rule(net, specific_source_ip_rule, "FIRST") + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_create_firewall_rule_ip_prefix_size(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_list_firewall_rules(net)[0] + rule.source.address_list_id = None + rule.source.any_ip = False + rule.source.ip_address = "10.2.1.1" + rule.source.ip_prefix_size = "10" + rule.destination.address_list_id = None + rule.destination.any_ip = False + rule.destination.ip_address = "10.0.0.1" + rule.destination.ip_prefix_size = "20" + self.driver.ex_create_firewall_rule(net, rule, "LAST") + + def test_ex_create_firewall_rule_address_list(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_list_firewall_rules(net)[0] + rule.source.address_list_id = "12345" + rule.destination.address_list_id = "12345" + self.driver.ex_create_firewall_rule(net, rule, "LAST") + + def test_ex_create_firewall_rule_port_list(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_list_firewall_rules(net)[0] + rule.source.port_list_id = "12345" + rule.destination.port_list_id = "12345" + self.driver.ex_create_firewall_rule(net, rule, "LAST") + + def test_ex_create_firewall_rule_port(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_list_firewall_rules(net)[0] + rule.source.port_list_id = None + rule.source.port_begin = "8000" + rule.source.port_end = "8005" + rule.destination.port_list_id = None + rule.destination.port_begin = "7000" + rule.destination.port_end = "7005" + self.driver.ex_create_firewall_rule(net, rule, "LAST") + + def test_ex_create_firewall_rule_ALL_VALUES(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + + for rule in rules: + self.driver.ex_create_firewall_rule(net, rule, "LAST") + + def test_ex_create_firewall_rule_WITH_POSITION_RULE(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + rule = self.driver.ex_create_firewall_rule(net, rules[-2], "BEFORE", rules[-1]) + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_create_firewall_rule_WITH_POSITION_RULE_STR(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + rule = self.driver.ex_create_firewall_rule( + net, rules[-2], "BEFORE", "RULE_WITH_SOURCE_AND_DEST" + ) + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_create_firewall_rule_FAIL_POSITION(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + with self.assertRaises(ValueError): + self.driver.ex_create_firewall_rule(net, rules[0], "BEFORE") + + def test_ex_create_firewall_rule_FAIL_POSITION_WITH_RULE(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_firewall_rules(net) + with self.assertRaises(ValueError): + self.driver.ex_create_firewall_rule(net, rules[0], "LAST", "RULE_WITH_SOURCE_AND_DEST") + + def test_ex_get_firewall_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + self.assertEqual(rule.id, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + + def test_ex_set_firewall_rule_state(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + result = self.driver.ex_set_firewall_rule_state(rule, False) + self.assertTrue(result) + + def test_ex_delete_firewall_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + result = self.driver.ex_delete_firewall_rule(rule) + self.assertTrue(result) + + def test_ex_edit_firewall_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.any_ip = True + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_source_ipaddresslist(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.address_list_id = "802abc9f-45a7-4efb-9d5a-810082368222" + rule.source.any_ip = False + rule.source.ip_address = "10.0.0.1" + rule.source.ip_prefix_size = 10 + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_destination_ipaddresslist(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.destination.address_list_id = "802abc9f-45a7-4efb-9d5a-810082368222" + rule.destination.any_ip = False + rule.destination.ip_address = "10.0.0.1" + rule.destination.ip_prefix_size = 10 + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_destination_ipaddress(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.address_list_id = None + rule.source.any_ip = False + rule.source.ip_address = "10.0.0.1" + rule.source.ip_prefix_size = "10" + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_source_ipaddress(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.destination.address_list_id = None + rule.destination.any_ip = False + rule.destination.ip_address = "10.0.0.1" + rule.destination.ip_prefix_size = "10" + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_with_relative_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + placement_rule = self.driver.ex_list_firewall_rules(network_domain=net)[-1] + result = self.driver.ex_edit_firewall_rule( + rule=rule, position="BEFORE", relative_rule_for_position=placement_rule + ) + self.assertTrue(result) + + def test_ex_edit_firewall_rule_with_relative_rule_by_name(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + placement_rule = self.driver.ex_list_firewall_rules(network_domain=net)[-1] + result = self.driver.ex_edit_firewall_rule( + rule=rule, position="BEFORE", relative_rule_for_position=placement_rule.name + ) + self.assertTrue(result) + + def test_ex_edit_firewall_rule_source_portlist(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.port_list_id = "802abc9f-45a7-4efb-9d5a-810082368222" + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_source_port(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.port_list_id = None + rule.source.port_begin = "3" + rule.source.port_end = "10" + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_destination_portlist(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.destination.port_list_id = "802abc9f-45a7-4efb-9d5a-810082368222" + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_destination_port(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.destination.port_list_id = None + rule.destination.port_begin = "3" + rule.destination.port_end = "10" + result = self.driver.ex_edit_firewall_rule(rule=rule, position="LAST") + self.assertTrue(result) + + def test_ex_edit_firewall_rule_invalid_position_fail(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + with self.assertRaises(ValueError): + self.driver.ex_edit_firewall_rule(rule=rule, position="BEFORE") + + def test_ex_edit_firewall_rule_invalid_position_relative_rule_fail(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + relative_rule = self.driver.ex_list_firewall_rules(network_domain=net)[-1] + with self.assertRaises(ValueError): + self.driver.ex_edit_firewall_rule( + rule=rule, position="FIRST", relative_rule_for_position=relative_rule + ) + + def test_ex_create_nat_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_create_nat_rule(net, "1.2.3.4", "4.3.2.1") + self.assertEqual(rule.id, "d31c2db0-be6b-4d50-8744-9a7a534b5fba") + + def test_ex_list_nat_rules(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = self.driver.ex_list_nat_rules(net) + self.assertEqual(rules[0].id, "2187a636-7ebb-49a1-a2ff-5d617f496dce") + self.assertEqual(rules[0].internal_ip, "10.0.0.15") + self.assertEqual(rules[0].external_ip, "165.180.12.18") + + def test_ex_get_nat_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_nat_rule(net, "2187a636-7ebb-49a1-a2ff-5d617f496dce") + self.assertEqual(rule.id, "2187a636-7ebb-49a1-a2ff-5d617f496dce") + self.assertEqual(rule.internal_ip, "10.0.0.16") + self.assertEqual(rule.external_ip, "165.180.12.19") + + def test_ex_delete_nat_rule(self): + net = self.driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = self.driver.ex_get_nat_rule(net, "2187a636-7ebb-49a1-a2ff-5d617f496dce") + result = self.driver.ex_delete_nat_rule(rule) + self.assertTrue(result) + + def test_ex_enable_monitoring(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_enable_monitoring(node, "ADVANCED") + self.assertTrue(result) + + def test_ex_disable_monitoring(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_disable_monitoring(node) + self.assertTrue(result) + + def test_ex_change_monitoring_plan(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_update_monitoring_plan(node, "ESSENTIALS") + self.assertTrue(result) + + def test_ex_add_storage_to_node(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_add_storage_to_node(node, 30, "PERFORMANCE") + self.assertTrue(result) + + def test_ex_remove_storage_from_node(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_remove_storage_from_node(node, 0) + self.assertTrue(result) + + def test_ex_change_storage_speed(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_change_storage_speed(node, 1, "PERFORMANCE") + self.assertTrue(result) + + def test_ex_change_storage_size(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_change_storage_size(node, 1, 100) + self.assertTrue(result) + + def test_ex_clone_node_to_image(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_clone_node_to_image(node, "my image", "a description") + self.assertTrue(result) + + def test_ex_update_node(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_update_node(node, "my new name", "a description", 2, 4048) + self.assertTrue(result) + + def test_ex_reconfigure_node(self): + node = self.driver.list_nodes()[0] + result = self.driver.ex_reconfigure_node(node, 4, 4, 1, "HIGHPERFORMANCE") + self.assertTrue(result) + + def test_ex_get_location_by_id(self): + location = self.driver.ex_get_location_by_id("NA9") + self.assertTrue(location.id, "NA9") + + def test_ex_get_location_by_id_NO_LOCATION(self): + location = self.driver.ex_get_location_by_id(None) + self.assertIsNone(location) + + def test_ex_get_base_image_by_id(self): + image_id = self.driver.list_images()[0].id + image = self.driver.ex_get_base_image_by_id(image_id) + self.assertEqual(image.extra["OS_type"], "UNIX") + + def test_ex_get_customer_image_by_id(self): + image_id = self.driver.ex_list_customer_images()[1].id + image = self.driver.ex_get_customer_image_by_id(image_id) + self.assertEqual(image.extra["OS_type"], "WINDOWS") + + def test_ex_get_image_by_id_base_img(self): + image_id = self.driver.list_images()[1].id + image = self.driver.ex_get_base_image_by_id(image_id) + self.assertEqual(image.extra["OS_type"], "WINDOWS") + + def test_ex_get_image_by_id_customer_img(self): + image_id = self.driver.ex_list_customer_images()[0].id + image = self.driver.ex_get_customer_image_by_id(image_id) + self.assertEqual(image.extra["OS_type"], "UNIX") + + def test_ex_get_image_by_id_customer_FAIL(self): + image_id = "FAKE_IMAGE_ID" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_get_base_image_by_id(image_id) + + def test_ex_create_anti_affinity_rule(self): + node_list = self.driver.list_nodes() + success = self.driver.ex_create_anti_affinity_rule([node_list[0], node_list[1]]) + self.assertTrue(success) + + def test_ex_create_anti_affinity_rule_TUPLE(self): + node_list = self.driver.list_nodes() + success = self.driver.ex_create_anti_affinity_rule((node_list[0], node_list[1])) + self.assertTrue(success) + + def test_ex_create_anti_affinity_rule_TUPLE_STR(self): + node_list = self.driver.list_nodes() + success = self.driver.ex_create_anti_affinity_rule((node_list[0].id, node_list[1].id)) + self.assertTrue(success) + + def test_ex_create_anti_affinity_rule_FAIL_STR(self): + node_list = "string" + with self.assertRaises(TypeError): + self.driver.ex_create_anti_affinity_rule(node_list) + + def test_ex_create_anti_affinity_rule_FAIL_EXISTING(self): + node_list = self.driver.list_nodes() + DimensionDataMockHttp.type = "FAIL_EXISTING" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_create_anti_affinity_rule((node_list[0], node_list[1])) + + def test_ex_delete_anti_affinity_rule(self): + net_domain = self.driver.ex_list_network_domains()[0] + rule = self.driver.ex_list_anti_affinity_rules(network_domain=net_domain)[0] + success = self.driver.ex_delete_anti_affinity_rule(rule) + self.assertTrue(success) + + def test_ex_delete_anti_affinity_rule_STR(self): + net_domain = self.driver.ex_list_network_domains()[0] + rule = self.driver.ex_list_anti_affinity_rules(network_domain=net_domain)[0] + success = self.driver.ex_delete_anti_affinity_rule(rule.id) + self.assertTrue(success) + + def test_ex_delete_anti_affinity_rule_FAIL(self): + net_domain = self.driver.ex_list_network_domains()[0] + rule = self.driver.ex_list_anti_affinity_rules(network_domain=net_domain)[0] + DimensionDataMockHttp.type = "FAIL" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_delete_anti_affinity_rule(rule) + + def test_ex_list_anti_affinity_rules_NETWORK_DOMAIN(self): + net_domain = self.driver.ex_list_network_domains()[0] + rules = self.driver.ex_list_anti_affinity_rules(network_domain=net_domain) + self.assertTrue(isinstance(rules, list)) + self.assertEqual(len(rules), 2) + self.assertTrue(isinstance(rules[0].id, str)) + self.assertTrue(isinstance(rules[0].node_list, list)) + + def test_ex_list_anti_affinity_rules_NETWORK(self): + network = self.driver.list_networks()[0] + rules = self.driver.ex_list_anti_affinity_rules(network=network) + self.assertTrue(isinstance(rules, list)) + self.assertEqual(len(rules), 2) + self.assertTrue(isinstance(rules[0].id, str)) + self.assertTrue(isinstance(rules[0].node_list, list)) + + def test_ex_list_anti_affinity_rules_NODE(self): + node = self.driver.list_nodes()[0] + rules = self.driver.ex_list_anti_affinity_rules(node=node) + self.assertTrue(isinstance(rules, list)) + self.assertEqual(len(rules), 2) + self.assertTrue(isinstance(rules[0].id, str)) + self.assertTrue(isinstance(rules[0].node_list, list)) + + def test_ex_list_anti_affinity_rules_PAGINATED(self): + net_domain = self.driver.ex_list_network_domains()[0] + DimensionDataMockHttp.type = "PAGINATED" + rules = self.driver.ex_list_anti_affinity_rules(network_domain=net_domain) + self.assertTrue(isinstance(rules, list)) + self.assertEqual(len(rules), 4) + self.assertTrue(isinstance(rules[0].id, str)) + self.assertTrue(isinstance(rules[0].node_list, list)) + + def test_ex_list_anti_affinity_rules_ALLFILTERS(self): + net_domain = self.driver.ex_list_network_domains()[0] + DimensionDataMockHttp.type = "ALLFILTERS" + rules = self.driver.ex_list_anti_affinity_rules( + network_domain=net_domain, filter_id="FAKE_ID", filter_state="FAKE_STATE" + ) + self.assertTrue(isinstance(rules, list)) + self.assertEqual(len(rules), 2) + self.assertTrue(isinstance(rules[0].id, str)) + self.assertTrue(isinstance(rules[0].node_list, list)) + + def test_ex_list_anti_affinity_rules_BAD_ARGS(self): + with self.assertRaises(ValueError): + self.driver.ex_list_anti_affinity_rules( + network="fake_network", network_domain="fake_network_domain" + ) + + def test_ex_create_tag_key(self): + success = self.driver.ex_create_tag_key("MyTestKey") + self.assertTrue(success) + + def test_ex_create_tag_key_ALLPARAMS(self): + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "ALLPARAMS" + success = self.driver.ex_create_tag_key( + "MyTestKey", + description="Test Key Desc.", + value_required=False, + display_on_report=False, + ) + self.assertTrue(success) + + def test_ex_create_tag_key_BADREQUEST(self): + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "BADREQUEST" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_create_tag_key("MyTestKey") + + def test_ex_list_tag_keys(self): + tag_keys = self.driver.ex_list_tag_keys() + self.assertTrue(isinstance(tag_keys, list)) + self.assertTrue(isinstance(tag_keys[0], DimensionDataTagKey)) + self.assertTrue(isinstance(tag_keys[0].id, str)) + + def test_ex_list_tag_keys_ALLFILTERS(self): + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "ALLFILTERS" + self.driver.ex_list_tag_keys( + id="fake_id", + name="fake_name", + value_required=False, + display_on_report=False, + ) + + def test_ex_get_tag_by_id(self): + tag = self.driver.ex_get_tag_key_by_id("d047c609-93d7-4bc5-8fc9-732c85840075") + self.assertTrue(isinstance(tag, DimensionDataTagKey)) + + def test_ex_get_tag_by_id_NOEXIST(self): + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "NOEXIST" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_get_tag_key_by_id("d047c609-93d7-4bc5-8fc9-732c85840075") + + def test_ex_get_tag_by_name(self): + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "SINGLE" + tag = self.driver.ex_get_tag_key_by_name("LibcloudTest") + self.assertTrue(isinstance(tag, DimensionDataTagKey)) + + def test_ex_get_tag_by_name_NOEXIST(self): + with self.assertRaises(ValueError): + self.driver.ex_get_tag_key_by_name("LibcloudTest") + + def test_ex_modify_tag_key_NAME(self): + tag_key = self.driver.ex_list_tag_keys()[0] + DimensionDataMockHttp.type = "NAME" + success = self.driver.ex_modify_tag_key(tag_key, name="NewName") + self.assertTrue(success) + + def test_ex_modify_tag_key_NOTNAME(self): + tag_key = self.driver.ex_list_tag_keys()[0] + DimensionDataMockHttp.type = "NOTNAME" + success = self.driver.ex_modify_tag_key( + tag_key, description="NewDesc", value_required=False, display_on_report=True + ) + self.assertTrue(success) + + def test_ex_modify_tag_key_NOCHANGE(self): + tag_key = self.driver.ex_list_tag_keys()[0] + DimensionDataMockHttp.type = "NOCHANGE" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_modify_tag_key(tag_key) + + def test_ex_remove_tag_key(self): + tag_key = self.driver.ex_list_tag_keys()[0] + success = self.driver.ex_remove_tag_key(tag_key) + self.assertTrue(success) + + def test_ex_remove_tag_key_NOEXIST(self): + tag_key = self.driver.ex_list_tag_keys()[0] + DimensionDataMockHttp.type = "NOEXIST" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_remove_tag_key(tag_key) + + def test_ex_apply_tag_to_asset(self): + node = self.driver.list_nodes()[0] + success = self.driver.ex_apply_tag_to_asset(node, "TagKeyName", "FakeValue") + self.assertTrue(success) + + def test_ex_apply_tag_to_asset_NOVALUE(self): + node = self.driver.list_nodes()[0] + DimensionDataMockHttp.type = "NOVALUE" + success = self.driver.ex_apply_tag_to_asset(node, "TagKeyName") + self.assertTrue(success) + + def test_ex_apply_tag_to_asset_NOTAGKEY(self): + node = self.driver.list_nodes()[0] + DimensionDataMockHttp.type = "NOTAGKEY" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_apply_tag_to_asset(node, "TagKeyNam") + + def test_ex_apply_tag_to_asset_BADASSETTYPE(self): + network = self.driver.list_networks()[0] + DimensionDataMockHttp.type = "NOTAGKEY" + with self.assertRaises(TypeError): + self.driver.ex_apply_tag_to_asset(network, "TagKeyNam") + + def test_ex_remove_tag_from_asset(self): + node = self.driver.list_nodes()[0] + success = self.driver.ex_remove_tag_from_asset(node, "TagKeyName") + self.assertTrue(success) + + def test_ex_remove_tag_from_asset_NOTAG(self): + node = self.driver.list_nodes()[0] + DimensionDataMockHttp.type = "NOTAG" + with self.assertRaises(DimensionDataAPIException): + self.driver.ex_remove_tag_from_asset(node, "TagKeyNam") + + def test_ex_list_tags(self): + tags = self.driver.ex_list_tags() + self.assertTrue(isinstance(tags, list)) + self.assertTrue(isinstance(tags[0], DimensionDataTag)) + self.assertTrue(len(tags) == 3) + + def test_ex_list_tags_ALLPARAMS(self): + self.driver.connection._get_orgId() + DimensionDataMockHttp.type = "ALLPARAMS" + tags = self.driver.ex_list_tags( + asset_id="fake_asset_id", + asset_type="fake_asset_type", + location="fake_location", + tag_key_name="fake_tag_key_name", + tag_key_id="fake_tag_key_id", + value="fake_value", + value_required=False, + display_on_report=False, + ) + self.assertTrue(isinstance(tags, list)) + self.assertTrue(isinstance(tags[0], DimensionDataTag)) + self.assertTrue(len(tags) == 3) + + def test_priv_location_to_location_id(self): + location = self.driver.ex_get_location_by_id("NA9") + self.assertEqual(self.driver._location_to_location_id(location), "NA9") + + def test_priv_location_to_location_id_STR(self): + self.assertEqual(self.driver._location_to_location_id("NA9"), "NA9") + + def test_priv_location_to_location_id_TYPEERROR(self): + with self.assertRaises(TypeError): + self.driver._location_to_location_id([1, 2, 3]) + + def test_priv_image_needs_auth_os_img(self): + image = self.driver.list_images()[1] + self.assertTrue(self.driver._image_needs_auth(image)) + + def test_priv_image_needs_auth_os_img_STR(self): + image = self.driver.list_images()[1].id + self.assertTrue(self.driver._image_needs_auth(image)) + + def test_priv_image_needs_auth_cust_img_windows(self): + image = self.driver.ex_list_customer_images()[1] + self.assertTrue(self.driver._image_needs_auth(image)) + + def test_priv_image_needs_auth_cust_img_windows_STR(self): + image = self.driver.ex_list_customer_images()[1].id + self.assertTrue(self.driver._image_needs_auth(image)) + + def test_priv_image_needs_auth_cust_img_linux(self): + image = self.driver.ex_list_customer_images()[0] + self.assertTrue(not self.driver._image_needs_auth(image)) + + def test_priv_image_needs_auth_cust_img_linux_STR(self): + image = self.driver.ex_list_customer_images()[0].id + self.assertTrue(not self.driver._image_needs_auth(image)) + + def test_summary_usage_report(self): + report = self.driver.ex_summary_usage_report("2016-06-01", "2016-06-30") + report_content = report + self.assertEqual(len(report_content), 13) + self.assertEqual(len(report_content[0]), 6) + + def test_detailed_usage_report(self): + report = self.driver.ex_detailed_usage_report("2016-06-01", "2016-06-30") + report_content = report + self.assertEqual(len(report_content), 42) + self.assertEqual(len(report_content[0]), 4) + + def test_audit_log_report(self): + report = self.driver.ex_audit_log_report("2016-06-01", "2016-06-30") + report_content = report + self.assertEqual(len(report_content), 25) + self.assertEqual(report_content[2][2], "OEC_SYSTEM") + + def test_ex_list_ip_address_list(self): + net_domain = self.driver.ex_list_network_domains()[0] + ip_list = self.driver.ex_list_ip_address_list(ex_network_domain=net_domain) + self.assertTrue(isinstance(ip_list, list)) + self.assertEqual(len(ip_list), 4) + self.assertTrue(isinstance(ip_list[0].name, str)) + self.assertTrue(isinstance(ip_list[0].description, str)) + self.assertTrue(isinstance(ip_list[0].ip_version, str)) + self.assertTrue(isinstance(ip_list[0].state, str)) + self.assertTrue(isinstance(ip_list[0].create_time, str)) + self.assertTrue(isinstance(ip_list[0].child_ip_address_lists, list)) + self.assertEqual(len(ip_list[1].child_ip_address_lists), 1) + self.assertTrue(isinstance(ip_list[1].child_ip_address_lists[0].name, str)) + + def test_ex_get_ip_address_list(self): + net_domain = self.driver.ex_list_network_domains()[0] + DimensionDataMockHttp.type = "FILTERBYNAME" + ip_list = self.driver.ex_get_ip_address_list( + ex_network_domain=net_domain.id, + ex_ip_address_list_name="Test_IP_Address_List_3", + ) + self.assertTrue(isinstance(ip_list, list)) + self.assertEqual(len(ip_list), 1) + self.assertTrue(isinstance(ip_list[0].name, str)) + self.assertTrue(isinstance(ip_list[0].description, str)) + self.assertTrue(isinstance(ip_list[0].ip_version, str)) + self.assertTrue(isinstance(ip_list[0].state, str)) + self.assertTrue(isinstance(ip_list[0].create_time, str)) + ips = ip_list[0].ip_address_collection + self.assertEqual(len(ips), 3) + self.assertTrue(isinstance(ips[0].begin, str)) + self.assertTrue(isinstance(ips[0].prefix_size, str)) + self.assertTrue(isinstance(ips[2].end, str)) + + def test_ex_create_ip_address_list_FAIL(self): + net_domain = self.driver.ex_list_network_domains()[0] + + with self.assertRaises(TypeError): + self.driver.ex_create_ip_address_list(ex_network_domain=net_domain.id) + + def test_ex_create_ip_address_list(self): + name = "Test_IP_Address_List_3" + description = "Test Description" + ip_version = "IPV4" + child_ip_address_list_id = "0291ef78-4059-4bc1-b433-3f6ad698dc41" + child_ip_address_list = DimensionDataChildIpAddressList( + id=child_ip_address_list_id, name="test_child_ip_addr_list" + ) + net_domain = self.driver.ex_list_network_domains()[0] + ip_address_1 = DimensionDataIpAddress(begin="190.2.2.100") + ip_address_2 = DimensionDataIpAddress(begin="190.2.2.106", end="190.2.2.108") + ip_address_3 = DimensionDataIpAddress(begin="190.2.2.0", prefix_size="24") + ip_address_collection = [ip_address_1, ip_address_2, ip_address_3] + + # Create IP Address List + success = self.driver.ex_create_ip_address_list( + ex_network_domain=net_domain, + name=name, + ip_version=ip_version, + description=description, + ip_address_collection=ip_address_collection, + child_ip_address_list=child_ip_address_list, + ) + + self.assertTrue(success) + + def test_ex_create_ip_address_list_STR(self): + name = "Test_IP_Address_List_3" + description = "Test Description" + ip_version = "IPV4" + child_ip_address_list_id = "0291ef78-4059-4bc1-b433-3f6ad698dc41" + net_domain = self.driver.ex_list_network_domains()[0] + ip_address_1 = DimensionDataIpAddress(begin="190.2.2.100") + ip_address_2 = DimensionDataIpAddress(begin="190.2.2.106", end="190.2.2.108") + ip_address_3 = DimensionDataIpAddress(begin="190.2.2.0", prefix_size="24") + ip_address_collection = [ip_address_1, ip_address_2, ip_address_3] + + # Create IP Address List + success = self.driver.ex_create_ip_address_list( + ex_network_domain=net_domain.id, + name=name, + ip_version=ip_version, + description=description, + ip_address_collection=ip_address_collection, + child_ip_address_list=child_ip_address_list_id, + ) + + self.assertTrue(success) + + def test_ex_edit_ip_address_list(self): + ip_address_1 = DimensionDataIpAddress(begin="190.2.2.111") + ip_address_collection = [ip_address_1] + + child_ip_address_list = DimensionDataChildIpAddressList( + id="2221ef78-4059-4bc1-b433-3f6ad698dc41", + name="test_child_ip_address_list edited", + ) + + ip_address_list = DimensionDataIpAddressList( + id="1111ef78-4059-4bc1-b433-3f6ad698d111", + name="test ip address list edited", + ip_version="IPv4", + description="test", + ip_address_collection=ip_address_collection, + child_ip_address_lists=child_ip_address_list, + state="NORMAL", + create_time="2015-09-29T02:49:45", + ) + + success = self.driver.ex_edit_ip_address_list( + ex_ip_address_list=ip_address_list, + description="test ip address list", + ip_address_collection=ip_address_collection, + child_ip_address_lists=child_ip_address_list, + ) + + self.assertTrue(success) + + def test_ex_edit_ip_address_list_STR(self): + ip_address_1 = DimensionDataIpAddress(begin="190.2.2.111") + ip_address_collection = [ip_address_1] + + child_ip_address_list = DimensionDataChildIpAddressList( + id="2221ef78-4059-4bc1-b433-3f6ad698dc41", + name="test_child_ip_address_list edited", + ) + + success = self.driver.ex_edit_ip_address_list( + ex_ip_address_list="84e34850-595d- 436e-a885-7cd37edb24a4", + description="test ip address list", + ip_address_collection=ip_address_collection, + child_ip_address_lists=child_ip_address_list, + ) + + self.assertTrue(success) + + def test_ex_delete_ip_address_list(self): + child_ip_address_list = DimensionDataChildIpAddressList( + id="2221ef78-4059-4bc1-b433-3f6ad698dc41", + name="test_child_ip_address_list edited", + ) + + ip_address_list = DimensionDataIpAddressList( + id="1111ef78-4059-4bc1-b433-3f6ad698d111", + name="test ip address list edited", + ip_version="IPv4", + description="test", + ip_address_collection=None, + child_ip_address_lists=child_ip_address_list, + state="NORMAL", + create_time="2015-09-29T02:49:45", + ) + + success = self.driver.ex_delete_ip_address_list(ex_ip_address_list=ip_address_list) + self.assertTrue(success) + + def test_ex_delete_ip_address_list_STR(self): + success = self.driver.ex_delete_ip_address_list( + ex_ip_address_list="111ef78-4059-4bc1-b433-3f6ad698d111" + ) + self.assertTrue(success) + + def test_ex_list_portlist(self): + net_domain = self.driver.ex_list_network_domains()[0] + portlist = self.driver.ex_list_portlist(ex_network_domain=net_domain) + self.assertTrue(isinstance(portlist, list)) + self.assertEqual(len(portlist), 3) + self.assertTrue(isinstance(portlist[0].name, str)) + self.assertTrue(isinstance(portlist[0].description, str)) + self.assertTrue(isinstance(portlist[0].state, str)) + self.assertTrue(isinstance(portlist[0].port_collection, list)) + self.assertTrue(isinstance(portlist[0].port_collection[0].begin, str)) + self.assertTrue(isinstance(portlist[0].port_collection[0].end, str)) + self.assertTrue(isinstance(portlist[0].child_portlist_list, list)) + self.assertTrue(isinstance(portlist[0].child_portlist_list[0].id, str)) + self.assertTrue(isinstance(portlist[0].child_portlist_list[0].name, str)) + self.assertTrue(isinstance(portlist[0].create_time, str)) + + def test_ex_get_port_list(self): + net_domain = self.driver.ex_list_network_domains()[0] + + portlist_id = self.driver.ex_list_portlist(ex_network_domain=net_domain)[0].id + + portlist = self.driver.ex_get_portlist(ex_portlist_id=portlist_id) + self.assertTrue(isinstance(portlist, DimensionDataPortList)) + + self.assertTrue(isinstance(portlist.name, str)) + self.assertTrue(isinstance(portlist.description, str)) + self.assertTrue(isinstance(portlist.state, str)) + self.assertTrue(isinstance(portlist.port_collection, list)) + self.assertTrue(isinstance(portlist.port_collection[0].begin, str)) + self.assertTrue(isinstance(portlist.port_collection[0].end, str)) + self.assertTrue(isinstance(portlist.child_portlist_list, list)) + self.assertTrue(isinstance(portlist.child_portlist_list[0].id, str)) + self.assertTrue(isinstance(portlist.child_portlist_list[0].name, str)) + self.assertTrue(isinstance(portlist.create_time, str)) + + def test_ex_get_portlist_STR(self): + net_domain = self.driver.ex_list_network_domains()[0] + + portlist = self.driver.ex_list_portlist(ex_network_domain=net_domain)[0] + + port_list = self.driver.ex_get_portlist(ex_portlist_id=portlist.id) + self.assertTrue(isinstance(port_list, DimensionDataPortList)) + + self.assertTrue(isinstance(port_list.name, str)) + self.assertTrue(isinstance(port_list.description, str)) + self.assertTrue(isinstance(port_list.state, str)) + self.assertTrue(isinstance(port_list.port_collection, list)) + self.assertTrue(isinstance(port_list.port_collection[0].begin, str)) + self.assertTrue(isinstance(port_list.port_collection[0].end, str)) + self.assertTrue(isinstance(port_list.child_portlist_list, list)) + self.assertTrue(isinstance(port_list.child_portlist_list[0].id, str)) + self.assertTrue(isinstance(port_list.child_portlist_list[0].name, str)) + self.assertTrue(isinstance(port_list.create_time, str)) + + def test_ex_create_portlist_NOCHILDPORTLIST(self): + name = "Test_Port_List" + description = "Test Description" + + net_domain = self.driver.ex_list_network_domains()[0] + + port_1 = DimensionDataPort(begin="8080") + port_2 = DimensionDataIpAddress(begin="8899", end="9023") + port_collection = [port_1, port_2] + + # Create IP Address List + success = self.driver.ex_create_portlist( + ex_network_domain=net_domain, + name=name, + description=description, + port_collection=port_collection, + ) + + self.assertTrue(success) + + def test_ex_create_portlist(self): + name = "Test_Port_List" + description = "Test Description" + + net_domain = self.driver.ex_list_network_domains()[0] + + port_1 = DimensionDataPort(begin="8080") + port_2 = DimensionDataIpAddress(begin="8899", end="9023") + port_collection = [port_1, port_2] + + child_port_1 = DimensionDataChildPortList( + id="333174a2-ae74-4658-9e56-50fc90e086cf", name="test port 1" + ) + child_port_2 = DimensionDataChildPortList( + id="311174a2-ae74-4658-9e56-50fc90e04444", name="test port 2" + ) + child_ports = [child_port_1, child_port_2] + + # Create IP Address List + success = self.driver.ex_create_portlist( + ex_network_domain=net_domain, + name=name, + description=description, + port_collection=port_collection, + child_portlist_list=child_ports, + ) + + self.assertTrue(success) + + def test_ex_create_portlist_STR(self): + name = "Test_Port_List" + description = "Test Description" + + net_domain = self.driver.ex_list_network_domains()[0] + + port_1 = DimensionDataPort(begin="8080") + port_2 = DimensionDataIpAddress(begin="8899", end="9023") + port_collection = [port_1, port_2] + + child_port_1 = DimensionDataChildPortList( + id="333174a2-ae74-4658-9e56-50fc90e086cf", name="test port 1" + ) + child_port_2 = DimensionDataChildPortList( + id="311174a2-ae74-4658-9e56-50fc90e04444", name="test port 2" + ) + child_ports_ids = [child_port_1.id, child_port_2.id] + + # Create IP Address List + success = self.driver.ex_create_portlist( + ex_network_domain=net_domain.id, + name=name, + description=description, + port_collection=port_collection, + child_portlist_list=child_ports_ids, + ) + + self.assertTrue(success) + + def test_ex_edit_portlist(self): + net_domain = self.driver.ex_list_network_domains()[0] + portlist = self.driver.ex_list_portlist(net_domain)[0] + + description = "Test Description" + + port_1 = DimensionDataPort(begin="8080") + port_2 = DimensionDataIpAddress(begin="8899", end="9023") + port_collection = [port_1, port_2] + + child_port_1 = DimensionDataChildPortList( + id="333174a2-ae74-4658-9e56-50fc90e086cf", name="test port 1" + ) + child_port_2 = DimensionDataChildPortList( + id="311174a2-ae74-4658-9e56-50fc90e04444", name="test port 2" + ) + child_ports = [child_port_1.id, child_port_2.id] + + # Create IP Address List + success = self.driver.ex_edit_portlist( + ex_portlist=portlist, + description=description, + port_collection=port_collection, + child_portlist_list=child_ports, + ) + self.assertTrue(success) + + def test_ex_edit_portlist_STR(self): + portlist_id = "484174a2-ae74-4658-9e56-50fc90e086cf" + description = "Test Description" + + port_1 = DimensionDataPort(begin="8080") + port_2 = DimensionDataIpAddress(begin="8899", end="9023") + port_collection = [port_1, port_2] + + child_port_1 = DimensionDataChildPortList( + id="333174a2-ae74-4658-9e56-50fc90e086cf", name="test port 1" + ) + child_port_2 = DimensionDataChildPortList( + id="311174a2-ae74-4658-9e56-50fc90e04444", name="test port 2" + ) + child_ports_ids = [child_port_1.id, child_port_2.id] + + # Create IP Address List + success = self.driver.ex_edit_portlist( + ex_portlist=portlist_id, + description=description, + port_collection=port_collection, + child_portlist_list=child_ports_ids, + ) + self.assertTrue(success) + + def test_ex_delete_portlist(self): + net_domain = self.driver.ex_list_network_domains()[0] + portlist = self.driver.ex_list_portlist(net_domain)[0] + + success = self.driver.ex_delete_portlist(ex_portlist=portlist) + self.assertTrue(success) + + def test_ex_delete_portlist_STR(self): + net_domain = self.driver.ex_list_network_domains()[0] + portlist = self.driver.ex_list_portlist(net_domain)[0] + + success = self.driver.ex_delete_portlist(ex_portlist=portlist.id) + self.assertTrue(success) + + def test_import_image(self): + tag_dictionaries = {"tagkey1_name": "dev test", "tagkey2_name": None} + success = self.driver.import_image( + ovf_package_name="aTestGocToNGoc2_export2.mf", + name="Libcloud NGOCImage_New 2", + description="test", + cluster_id="QA1_N2_VMWARE_1-01", + is_guest_os_customization="false", + tagkey_name_value_dictionaries=tag_dictionaries, + ) + self.assertTrue(success) + + def test_import_image_error_too_many_choice(self): + tag_dictionaries = {"tagkey1_name": "dev test", "tagkey2_name": None} + + with self.assertRaises(ValueError): + self.driver.import_image( + ovf_package_name="aTestGocToNGoc2_export2.mf", + name="Libcloud NGOCImage_New 2", + description="test", + cluster_id="QA1_N2_VMWARE_1-01", + datacenter_id="QA1_N1_VMWARE_1", + is_guest_os_customization="false", + tagkey_name_value_dictionaries=tag_dictionaries, + ) + + def test_import_image_error_missing_choice(self): + tag_dictionaries = {"tagkey1_name": "dev test", "tagkey2_name": None} + + with self.assertRaises(ValueError): + self.driver.import_image( + ovf_package_name="aTestGocToNGoc2_export2.mf", + name="Libcloud NGOCImage_New 2", + description="test", + cluster_id=None, + datacenter_id=None, + is_guest_os_customization="false", + tagkey_name_value_dictionaries=tag_dictionaries, + ) + + def test_exchange_nic_vlans(self): + success = self.driver.ex_exchange_nic_vlans( + nic_id_1="a4b4b42b-ccb5-416f-b052-ce7cb7fdff12", + nic_id_2="b39d09b8-ea65-424a-8fa6-c6f5a98afc69", + ) + self.assertTrue(success) + + def test_change_nic_network_adapter(self): + success = self.driver.ex_change_nic_network_adapter( + nic_id="0c55c269-20a5-4fec-8054-22a245a48fe4", network_adapter_name="E1000" + ) + self.assertTrue(success) + + def test_ex_create_node_uncustomized_mcp2_using_vlan(self): + # Get VLAN + vlan = self.driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + + # Create node using vlan instead of private IPv4 + node = self.driver.ex_create_node_uncustomized( + name="test_server_05", + image="fake_customer_image", + ex_network_domain="fakenetworkdomain", + ex_is_started=False, + ex_description=None, + ex_cluster_id=None, + ex_cpu_specification=None, + ex_memory_gb=None, + ex_primary_nic_private_ipv4=None, + ex_primary_nic_vlan=vlan, + ex_primary_nic_network_adapter=None, + ex_additional_nics=None, + ex_disks=None, + ex_tagid_value_pairs=None, + ex_tagname_value_pairs=None, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + + def test_ex_create_node_uncustomized_mcp2_using_ipv4(self): + node = self.driver.ex_create_node_uncustomized( + name="test_server_05", + image="fake_customer_image", + ex_network_domain="fakenetworkdomain", + ex_is_started=False, + ex_description=None, + ex_cluster_id=None, + ex_cpu_specification=None, + ex_memory_gb=None, + ex_primary_nic_private_ipv4="10.0.0.1", + ex_primary_nic_vlan=None, + ex_primary_nic_network_adapter=None, + ex_additional_nics=None, + ex_disks=None, + ex_tagid_value_pairs=None, + ex_tagname_value_pairs=None, + ) + self.assertEqual(node.id, "e75ead52-692f-4314-8725-c8a4f4d13a87") + + +class InvalidRequestError(Exception): + def __init__(self, tag): + super().__init__("Invalid Request - %s" % tag) + + +class DimensionDataMockHttp(MockHttp): + fixtures = ComputeFileFixtures("dimensiondata") + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_report_usage( + self, method, url, body, headers + ): + body = self.fixtures.load("summary_usage_report.csv") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_report_usageDetailed( + self, method, url, body, headers + ): + body = self.fixtures.load("detailed_usage_report.csv") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_auditlog(self, method, url, body, headers): + body = self.fixtures.load("audit_log.csv") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_UNAUTHORIZED(self, method, url, body, headers): + return (httplib.UNAUTHORIZED, "", {}, httplib.responses[httplib.UNAUTHORIZED]) + + def _oec_0_9_myaccount(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_INPROGRESS(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_PAGINATED(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_ALLFILTERS(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_base_image(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_base_image.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_base_imageWithDiskSpeed(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_base_imageWithDiskSpeed.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployed( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployed.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_pendingDeploy( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_pendingDeploy.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11(self, method, url, body, headers): + body = None + action = url.split("?")[-1] + + if action == "restart": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart.xml" + ) + elif action == "shutdown": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown.xml" + ) + elif action == "delete": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete.xml" + ) + elif action == "start": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start.xml" + ) + elif action == "poweroff": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_INPROGRESS( + self, method, url, body, headers + ): + body = None + action = url.split("?")[-1] + + if action == "restart": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart_INPROGRESS.xml" + ) + elif action == "shutdown": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown_INPROGRESS.xml" + ) + elif action == "delete": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete_INPROGRESS.xml" + ) + elif action == "start": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start_INPROGRESS.xml" + ) + elif action == "poweroff": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff_INPROGRESS.xml" + ) + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server(self, method, url, body, headers): + body = self.fixtures.load("_oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation( + self, method, url, body, headers + ): + if method == "POST": + request = ET.fromstring(body) + + if request.tag != "{http://oec.api.opsource.net/schemas/network}NewNetworkWithLocation": + raise InvalidRequestError(request.tag) + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation_NA9( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_4bba37be_506f_11e3_b29c_001517c4643e( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_4bba37be_506f_11e3_b29c_001517c4643e.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSize( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSize.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSpeed( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSpeed.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1( + self, method, url, body, headers + ): + action = url.split("?")[-1] + + if action == "delete": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + if method == "POST": + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_POST.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_create.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_FAIL_EXISTING( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_create_FAIL.xml" + ) + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_07e3621a_a920_4a9a_943c_d8021f27f418( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_delete.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_07e3621a_a920_4a9a_943c_d8021f27f418_FAIL( + self, method, url, body, headers + ): + body = self.fixtures.load( + "oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_delete_FAIL.xml" + ) + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server(self, method, url, body, headers): + body = self.fixtures.load("server.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deleteServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}deleteServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_deleteServer.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deleteServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}deleteServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_deleteServer_RESOURCEBUSY.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_rebootServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}rebootServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_rebootServer.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_rebootServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}rebootServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_rebootServer_RESOURCEBUSY.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server( + self, method, url, body, headers + ): + if url.endswith("datacenterId=NA3"): + body = self.fixtures.load("2_4/server_server_NA3.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + body = self.fixtures.load("2_4/server_server.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGESIZE50( + self, method, url, body, headers + ): + if not url.endswith("pageSize=50"): + raise ValueError("pageSize is not set as expected") + body = self.fixtures.load("2_4/server_server.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_EMPTY( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_paginated_empty.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGED_THEN_EMPTY( + self, method, url, body, headers + ): + if "pageNumber=2" in url: + body = self.fixtures.load("server_server_paginated_empty.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + body = self.fixtures.load("2_4/server_server_paginated.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGINATED( + self, method, url, body, headers + ): + if "pageNumber=2" in url: + body = self.fixtures.load("2_4/server_server.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + body = self.fixtures.load("2_4/server_server_paginated.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGINATEDEMPTY( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_paginated_empty.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + + for parameter in parameters: + key, value = parameter.split("=") + + if key == "datacenterId": + assert value == "fake_loc" + elif key == "networkId": + assert value == "fake_network" + elif key == "networkDomainId": + assert value == "fake_network_domain" + elif key == "vlanId": + assert value == "fake_vlan" + elif key == "ipv6": + assert value == "fake_ipv6" + elif key == "privateIpv4": + assert value == "fake_ipv4" + elif key == "name": + assert value == "fake_name" + elif key == "state": + assert value == "fake_state" + elif key == "started": + assert value == "True" + elif key == "deployed": + assert value == "True" + elif key == "sourceImageId": + assert value == "fake_image" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("2_4/server_server.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_antiAffinityRule( + self, method, url, body, headers + ): + body = self.fixtures.load("server_antiAffinityRule_list.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_antiAffinityRule_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + + for parameter in parameters: + key, value = parameter.split("=") + + if key == "id": + assert value == "FAKE_ID" + elif key == "state": + assert value == "FAKE_STATE" + elif key == "pageSize": + assert value == "250" + elif key == "networkDomainId": + pass + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("server_antiAffinityRule_list.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_antiAffinityRule_PAGINATED( + self, method, url, body, headers + ): + if "pageNumber=2" in url: + body = self.fixtures.load("server_antiAffinityRule_list.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + body = self.fixtures.load("server_antiAffinityRule_list_PAGINATED.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_infrastructure_datacenter( + self, method, url, body, headers + ): + if url.endswith("id=NA9"): + body = self.fixtures.load("infrastructure_datacenter_NA9.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + body = self.fixtures.load("infrastructure_datacenter.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_infrastructure_datacenter_ALLFILTERS( + self, method, url, body, headers + ): + if url.endswith("id=NA9"): + body = self.fixtures.load("infrastructure_datacenter_NA9.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + body = self.fixtures.load("infrastructure_datacenter.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_updateVmwareTools( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}updateVmwareTools": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_updateVmwareTools.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_startServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}startServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_startServer.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_startServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}startServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_startServer_INPROGRESS.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_shutdownServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}shutdownServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_shutdownServer.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_shutdownServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}shutdownServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_shutdownServer_INPROGRESS.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_resetServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}resetServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_resetServer.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_powerOffServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}powerOffServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_powerOffServer.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_powerOffServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}powerOffServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_powerOffServer_INPROGRESS.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_11_INPROGRESS( + self, method, url, body, headers + ): + body = self.fixtures.load("2_4/server_GetServer.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain( + self, method, url, body, headers + ): + body = self.fixtures.load("network_networkDomain.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + + for parameter in parameters: + key, value = parameter.split("=") + + if key == "datacenterId": + assert value == "fake_location" + elif key == "type": + assert value == "fake_plan" + elif key == "name": + assert value == "fake_name" + elif key == "state": + assert value == "fake_state" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("network_networkDomain.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_vlan( + self, method, url, body, headers + ): + body = self.fixtures.load("network_vlan.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_vlan_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + + for parameter in parameters: + key, value = parameter.split("=") + + if key == "datacenterId": + assert value == "fake_location" + elif key == "networkDomainId": + assert value == "fake_network_domain" + elif key == "ipv6Address": + assert value == "fake_ipv6" + elif key == "privateIpv4Address": + assert value == "fake_ipv4" + elif key == "name": + assert value == "fake_name" + elif key == "state": + assert value == "fake_state" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("network_vlan.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}deployServer": + raise InvalidRequestError(request.tag) + + # Make sure the we either have a network tag with an IP or networkId + # Or Network info with a primary nic that has privateip or vlanid + network = request.find(fixxpath("network", TYPES_URN)) + network_info = request.find(fixxpath("networkInfo", TYPES_URN)) + + if network is not None: + if network_info is not None: + raise InvalidRequestError("Request has both MCP1 and MCP2 values") + ipv4 = findtext(network, "privateIpv4", TYPES_URN) + networkId = findtext(network, "networkId", TYPES_URN) + + if ipv4 is None and networkId is None: + raise InvalidRequestError( + "Invalid request MCP1 requests need privateIpv4 or networkId" + ) + elif network_info is not None: + if network is not None: + raise InvalidRequestError("Request has both MCP1 and MCP2 values") + primary_nic = network_info.find(fixxpath("primaryNic", TYPES_URN)) + ipv4 = findtext(primary_nic, "privateIpv4", TYPES_URN) + vlanId = findtext(primary_nic, "vlanId", TYPES_URN) + + if ipv4 is None and vlanId is None: + raise InvalidRequestError( + "Invalid request MCP2 requests need privateIpv4 or vlanId" + ) + else: + raise InvalidRequestError( + "Invalid request, does not have network or network_info in XML" + ) + + body = self.fixtures.load("server_deployServer.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87( + self, method, url, body, headers + ): + body = self.fixtures.load("2_4/server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deployNetworkDomain( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}deployNetworkDomain": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deployNetworkDomain.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be( + self, method, url, body, headers + ): + body = self.fixtures.load("network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be_ALLFILTERS( + self, method, url, body, headers + ): + body = self.fixtures.load("network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editNetworkDomain( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}editNetworkDomain": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_editNetworkDomain.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteNetworkDomain( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}deleteNetworkDomain": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deleteNetworkDomain.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deployVlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}deployVlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deployVlan.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_vlan_0e56433f_d808_4669_821d_812769517ff8( + self, method, url, body, headers + ): + body = self.fixtures.load("network_vlan_0e56433f_d808_4669_821d_812769517ff8.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editVlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}editVlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_editVlan.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteVlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}deleteVlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deleteVlan.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_expandVlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}expandVlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_expandVlan.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_addPublicIpBlock( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}addPublicIpBlock": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_addPublicIpBlock.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba( + self, method, url, body, headers + ): + body = self.fixtures.load("network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_publicIpBlock( + self, method, url, body, headers + ): + body = self.fixtures.load("network_publicIpBlock.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8( + self, method, url, body, headers + ): + body = self.fixtures.load("network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_removePublicIpBlock( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}removePublicIpBlock": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_removePublicIpBlock.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_firewallRule( + self, method, url, body, headers + ): + body = self.fixtures.load("network_firewallRule.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createFirewallRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}createFirewallRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_createFirewallRule.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c( + self, method, url, body, headers + ): + body = self.fixtures.load("network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editFirewallRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}editFirewallRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_editFirewallRule.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteFirewallRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}deleteFirewallRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deleteFirewallRule.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createNatRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}createNatRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_createNatRule.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_natRule( + self, method, url, body, headers + ): + body = self.fixtures.load("network_natRule.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce( + self, method, url, body, headers + ): + body = self.fixtures.load("network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteNatRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}deleteNatRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deleteNatRule.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_addNic( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}addNic": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_addNic.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_removeNic( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}removeNic": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_removeNic.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_disableServerMonitoring( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}disableServerMonitoring": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_disableServerMonitoring.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_enableServerMonitoring( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}enableServerMonitoring": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_enableServerMonitoring.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_changeServerMonitoringPlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}changeServerMonitoringPlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_changeServerMonitoringPlan.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage( + self, method, url, body, headers + ): + body = self.fixtures.load("2_4/image_osImage.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c( + self, method, url, body, headers + ): + body = self.fixtures.load("2_4/image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a( + self, method, url, body, headers + ): + body = self.fixtures.load("2_4/image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_BAD_REQUEST.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_BAD_REQUEST.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_FAKE_IMAGE_ID( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_BAD_REQUEST.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage( + self, method, url, body, headers + ): + body = self.fixtures.load("2_4/image_customerImage.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d( + self, method, url, body, headers + ): + body = self.fixtures.load( + "2_4/image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c( + self, method, url, body, headers + ): + body = self.fixtures.load( + "2_4/image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c.xml" + ) + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage_FAKE_IMAGE_ID( + self, method, url, body, headers + ): + body = self.fixtures.load("image_customerImage_BAD_REQUEST.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_reconfigureServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}reconfigureServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_reconfigureServer.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_cleanServer( + self, method, url, body, headers + ): + body = self.fixtures.load("server_cleanServer.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_addDisk( + self, method, url, body, headers + ): + body = self.fixtures.load("server_addDisk.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_removeDisk( + self, method, url, body, headers + ): + body = self.fixtures.load("server_removeDisk.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_createTagKey( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}createTagKey": + raise InvalidRequestError(request.tag) + name = findtext(request, "name", TYPES_URN) + description = findtext(request, "description", TYPES_URN) + value_required = findtext(request, "valueRequired", TYPES_URN) + display_on_report = findtext(request, "displayOnReport", TYPES_URN) + + if name is None: + raise ValueError("Name must have a value in the request") + + if description is not None: + raise ValueError("Default description for a tag should be blank") + + if value_required is None or value_required != "true": + raise ValueError("Default valueRequired should be true") + + if display_on_report is None or display_on_report != "true": + raise ValueError("Default displayOnReport should be true") + + body = self.fixtures.load("tag_createTagKey.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_createTagKey_ALLPARAMS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}createTagKey": + raise InvalidRequestError(request.tag) + name = findtext(request, "name", TYPES_URN) + description = findtext(request, "description", TYPES_URN) + value_required = findtext(request, "valueRequired", TYPES_URN) + display_on_report = findtext(request, "displayOnReport", TYPES_URN) + + if name is None: + raise ValueError("Name must have a value in the request") + + if description is None: + raise ValueError("Description should have a value") + + if value_required is None or value_required != "false": + raise ValueError("valueRequired should be false") + + if display_on_report is None or display_on_report != "false": + raise ValueError("displayOnReport should be false") + + body = self.fixtures.load("tag_createTagKey.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_createTagKey_BADREQUEST( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_createTagKey_BADREQUEST.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey(self, method, url, body, headers): + body = self.fixtures.load("tag_tagKey_list.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_SINGLE( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_tagKey_list_SINGLE.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + + for parameter in parameters: + key, value = parameter.split("=") + + if key == "id": + assert value == "fake_id" + elif key == "name": + assert value == "fake_name" + elif key == "valueRequired": + assert value == "false" + elif key == "displayOnReport": + assert value == "false" + elif key == "pageSize": + assert value == "250" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("tag_tagKey_list.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_d047c609_93d7_4bc5_8fc9_732c85840075( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_d047c609_93d7_4bc5_8fc9_732c85840075_NOEXIST( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54_BADREQUEST.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_editTagKey_NAME( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}editTagKey": + raise InvalidRequestError(request.tag) + name = findtext(request, "name", TYPES_URN) + description = findtext(request, "description", TYPES_URN) + value_required = findtext(request, "valueRequired", TYPES_URN) + display_on_report = findtext(request, "displayOnReport", TYPES_URN) + + if name is None: + raise ValueError("Name must have a value in the request") + + if description is not None: + raise ValueError("Description should be empty") + + if value_required is not None: + raise ValueError("valueRequired should be empty") + + if display_on_report is not None: + raise ValueError("displayOnReport should be empty") + body = self.fixtures.load("tag_editTagKey.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_editTagKey_NOTNAME( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}editTagKey": + raise InvalidRequestError(request.tag) + name = findtext(request, "name", TYPES_URN) + description = findtext(request, "description", TYPES_URN) + value_required = findtext(request, "valueRequired", TYPES_URN) + display_on_report = findtext(request, "displayOnReport", TYPES_URN) + + if name is not None: + raise ValueError("Name should be empty") + + if description is None: + raise ValueError("Description should not be empty") + + if value_required is None: + raise ValueError("valueRequired should not be empty") + + if display_on_report is None: + raise ValueError("displayOnReport should not be empty") + body = self.fixtures.load("tag_editTagKey.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_editTagKey_NOCHANGE( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_editTagKey_BADREQUEST.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_deleteTagKey( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}deleteTagKey": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("tag_deleteTagKey.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_deleteTagKey_NOEXIST( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_deleteTagKey_BADREQUEST.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_applyTags( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}applyTags": + raise InvalidRequestError(request.tag) + asset_type = findtext(request, "assetType", TYPES_URN) + asset_id = findtext(request, "assetId", TYPES_URN) + tag = request.find(fixxpath("tag", TYPES_URN)) + tag_key_name = findtext(tag, "tagKeyName", TYPES_URN) + value = findtext(tag, "value", TYPES_URN) + + if asset_type is None: + raise ValueError("assetType should not be empty") + + if asset_id is None: + raise ValueError("assetId should not be empty") + + if tag_key_name is None: + raise ValueError("tagKeyName should not be empty") + + if value is None: + raise ValueError("value should not be empty") + + body = self.fixtures.load("tag_applyTags.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_applyTags_NOVALUE( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}applyTags": + raise InvalidRequestError(request.tag) + asset_type = findtext(request, "assetType", TYPES_URN) + asset_id = findtext(request, "assetId", TYPES_URN) + tag = request.find(fixxpath("tag", TYPES_URN)) + tag_key_name = findtext(tag, "tagKeyName", TYPES_URN) + value = findtext(tag, "value", TYPES_URN) + + if asset_type is None: + raise ValueError("assetType should not be empty") + + if asset_id is None: + raise ValueError("assetId should not be empty") + + if tag_key_name is None: + raise ValueError("tagKeyName should not be empty") + + if value is not None: + raise ValueError("value should be empty") + + body = self.fixtures.load("tag_applyTags.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_applyTags_NOTAGKEY( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_applyTags_BADREQUEST.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_removeTags( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}removeTags": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("tag_removeTag.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_removeTags_NOTAG( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_removeTag_BADREQUEST.xml") + + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tag(self, method, url, body, headers): + body = self.fixtures.load("tag_tag_list.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tag_ALLPARAMS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + + for parameter in parameters: + key, value = parameter.split("=") + + if key == "assetId": + assert value == "fake_asset_id" + elif key == "assetType": + assert value == "fake_asset_type" + elif key == "valueRequired": + assert value == "false" + elif key == "displayOnReport": + assert value == "false" + elif key == "pageSize": + assert value == "250" + elif key == "datacenterId": + assert value == "fake_location" + elif key == "value": + assert value == "fake_value" + elif key == "tagKeyName": + assert value == "fake_tag_key_name" + elif key == "tagKeyId": + assert value == "fake_tag_key_id" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("tag_tag_list.xml") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_ipAddressList( + self, method, url, body, headers + ): + body = self.fixtures.load("ip_address_lists.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_ipAddressList_FILTERBYNAME( + self, method, url, body, headers + ): + body = self.fixtures.load("ip_address_lists_FILTERBYNAME.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createIpAddressList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}" "createIpAddressList": + raise InvalidRequestError(request.tag) + + net_domain = findtext(request, "networkDomainId", TYPES_URN) + + if net_domain is None: + raise ValueError("Network Domain should not be empty") + + name = findtext(request, "name", TYPES_URN) + + if name is None: + raise ValueError("Name should not be empty") + + ip_version = findtext(request, "ipVersion", TYPES_URN) + + if ip_version is None: + raise ValueError("IP Version should not be empty") + + ip_address_col_required = findall(request, "ipAddress", TYPES_URN) + child_ip_address_required = findall(request, "childIpAddressListId", TYPES_URN) + + if 0 == len(ip_address_col_required) and 0 == len(child_ip_address_required): + raise ValueError( + "At least one ipAddress element or " + "one childIpAddressListId element must be " + "provided." + ) + + if ip_address_col_required[0].get("begin") is None: + raise ValueError("IP Address should not be empty") + + body = self.fixtures.load("ip_address_list_create.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editIpAddressList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}" "editIpAddressList": + raise InvalidRequestError(request.tag) + + ip_address_list = request.get("id") + + if ip_address_list is None: + raise ValueError("IpAddressList ID should not be empty") + + name = findtext(request, "name", TYPES_URN) + + if name is not None: + raise ValueError("Name should not exists in request") + + ip_version = findtext(request, "ipVersion", TYPES_URN) + + if ip_version is not None: + raise ValueError("IP Version should not exists in request") + + ip_address_col_required = findall(request, "ipAddress", TYPES_URN) + child_ip_address_required = findall(request, "childIpAddressListId", TYPES_URN) + + if 0 == len(ip_address_col_required) and 0 == len(child_ip_address_required): + raise ValueError( + "At least one ipAddress element or " + "one childIpAddressListId element must be " + "provided." + ) + + if ip_address_col_required[0].get("begin") is None: + raise ValueError("IP Address should not be empty") + + body = self.fixtures.load("ip_address_list_edit.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteIpAddressList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}" "deleteIpAddressList": + raise InvalidRequestError(request.tag) + + ip_address_list = request.get("id") + + if ip_address_list is None: + raise ValueError("IpAddressList ID should not be empty") + + body = self.fixtures.load("ip_address_list_delete.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_portList( + self, method, url, body, headers + ): + body = self.fixtures.load("port_list_lists.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_portList_c8c92ea3_2da8_4d51_8153_f39bec794d69( + self, method, url, body, headers + ): + body = self.fixtures.load("port_list_get.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createPortList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}" "createPortList": + raise InvalidRequestError(request.tag) + + net_domain = findtext(request, "networkDomainId", TYPES_URN) + + if net_domain is None: + raise ValueError("Network Domain should not be empty") + + ports_required = findall(request, "port", TYPES_URN) + child_port_list_required = findall(request, "childPortListId", TYPES_URN) + + if 0 == len(ports_required) and 0 == len(child_port_list_required): + raise ValueError( + "At least one port element or one " "childPortListId element must be provided" + ) + + if ports_required[0].get("begin") is None: + raise ValueError("PORT begin value should not be empty") + + body = self.fixtures.load("port_list_create.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editPortList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}" "editPortList": + raise InvalidRequestError(request.tag) + + ports_required = findall(request, "port", TYPES_URN) + child_port_list_required = findall(request, "childPortListId", TYPES_URN) + + if 0 == len(ports_required) and 0 == len(child_port_list_required): + raise ValueError( + "At least one port element or one " "childPortListId element must be provided" + ) + + if ports_required[0].get("begin") is None: + raise ValueError("PORT begin value should not be empty") + + body = self.fixtures.load("port_list_edit.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deletePortList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + + if request.tag != "{urn:didata.com:api:cloud:types}" "deletePortList": + raise InvalidRequestError(request.tag) + + port_list = request.get("id") + + if port_list is None: + raise ValueError("Port List ID should not be empty") + + body = self.fixtures.load("ip_address_list_delete.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_cloneServer( + self, method, url, body, headers + ): + body = self.fixtures.load("2_4/server_clone_response.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_importImage( + self, method, url, body, headers + ): + body = self.fixtures.load("2_4/import_image_response.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_exchangeNicVlans( + self, method, url, body, headers + ): + body = self.fixtures.load("2_4/exchange_nic_vlans_response.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_changeNetworkAdapter( + self, method, url, body, headers + ): + body = self.fixtures.load("2_4/change_nic_networkadapter_response.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployUncustomizedServer( + self, method, url, body, headers + ): + body = self.fixtures.load("2_4/deploy_customised_server.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_dreamhost.py b/libcloud/test/compute/test_dreamhost.py deleted file mode 100644 index 3f417262c6..0000000000 --- a/libcloud/test/compute/test_dreamhost.py +++ /dev/null @@ -1,284 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import sys -import unittest -from libcloud.utils.py3 import httplib - -try: - import simplejson as json -except ImportError: - import json - -from libcloud.common.types import InvalidCredsError -from libcloud.compute.drivers.dreamhost import DreamhostNodeDriver -from libcloud.compute.types import NodeState - -from libcloud.test import MockHttp -from libcloud.test.compute import TestCaseMixin -from libcloud.test.secrets import DREAMHOST_PARAMS - - -class DreamhostTest(unittest.TestCase, TestCaseMixin): - - def setUp(self): - DreamhostNodeDriver.connectionCls.conn_classes = ( - None, - DreamhostMockHttp - ) - DreamhostMockHttp.type = None - DreamhostMockHttp.use_param = 'cmd' - self.driver = DreamhostNodeDriver(*DREAMHOST_PARAMS) - - def test_invalid_creds(self): - """ - Tests the error-handling for passing a bad API Key to the DreamHost API - """ - DreamhostMockHttp.type = 'BAD_AUTH' - try: - self.driver.list_nodes() - self.assertTrue( - False) # Above command should have thrown an InvalidCredsException - except InvalidCredsError: - pass - - def test_list_nodes(self): - """ - Test list_nodes for DreamHost PS driver. Should return a list of two nodes: - - account_id: 000000 - ip: 75.119.203.51 - memory_mb: 500 - ps: ps22174 - start_date: 2010-02-25 - type: web - - account_id: 000000 - ip: 75.119.203.52 - memory_mb: 1500 - ps: ps22175 - start_date: 2010-02-25 - type: mysql - """ - - nodes = self.driver.list_nodes() - self.assertEqual(len(nodes), 2) - web_node = nodes[0] - mysql_node = nodes[1] - - # Web node tests - self.assertEqual(web_node.id, 'ps22174') - self.assertEqual(web_node.state, NodeState.UNKNOWN) - self.assertTrue('75.119.203.51' in web_node.public_ips) - self.assertTrue( - 'current_size' in web_node.extra and - web_node.extra['current_size'] == 500 - ) - self.assertTrue( - 'account_id' in web_node.extra and - web_node.extra['account_id'] == 000000 - ) - self.assertTrue( - 'type' in web_node.extra and - web_node.extra['type'] == 'web' - ) - # MySql node tests - self.assertEqual(mysql_node.id, 'ps22175') - self.assertEqual(mysql_node.state, NodeState.UNKNOWN) - self.assertTrue('75.119.203.52' in mysql_node.public_ips) - self.assertTrue( - 'current_size' in mysql_node.extra and - mysql_node.extra['current_size'] == 1500 - ) - self.assertTrue( - 'account_id' in mysql_node.extra and - mysql_node.extra['account_id'] == 000000 - ) - self.assertTrue( - 'type' in mysql_node.extra and - mysql_node.extra['type'] == 'mysql' - ) - - def test_create_node(self): - """ - Test create_node for DreamHost PS driver. - This is not remarkably compatible with libcloud. The DH API allows - users to specify what image they want to create and whether to move - all their data to the (web) PS. It does NOT accept a name, size, or - location. The only information it returns is the PS's context id - Once the PS is ready it will appear in the list generated by list_ps. - """ - new_node = self.driver.create_node( - image=self.driver.list_images()[0], - size=self.driver.list_sizes()[0], - movedata='no', - ) - self.assertEqual(new_node.id, 'ps12345') - self.assertEqual(new_node.state, NodeState.PENDING) - self.assertTrue( - 'type' in new_node.extra and - new_node.extra['type'] == 'web' - ) - - def test_destroy_node(self): - """ - Test destroy_node for DreamHost PS driver - """ - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver.destroy_node(node)) - - def test_destroy_node_failure(self): - """ - Test destroy_node failure for DreamHost PS driver - """ - node = self.driver.list_nodes()[0] - - DreamhostMockHttp.type = 'API_FAILURE' - self.assertFalse(self.driver.destroy_node(node)) - - def test_reboot_node(self): - """ - Test reboot_node for DreamHost PS driver. - """ - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver.reboot_node(node)) - - def test_reboot_node_failure(self): - """ - Test reboot_node failure for DreamHost PS driver - """ - node = self.driver.list_nodes()[0] - - DreamhostMockHttp.type = 'API_FAILURE' - self.assertFalse(self.driver.reboot_node(node)) - - def test_resize_node(self): - """ - Test resize_node for DreamHost PS driver - """ - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver._resize_node(node, 400)) - - def test_resize_node_failure(self): - """ - Test reboot_node faliure for DreamHost PS driver - """ - node = self.driver.list_nodes()[0] - - DreamhostMockHttp.type = 'API_FAILURE' - self.assertFalse(self.driver._resize_node(node, 400)) - - def test_list_images(self): - """ - Test list_images for DreamHost PS driver. - """ - images = self.driver.list_images() - self.assertEqual(len(images), 2) - self.assertEqual(images[0].id, 'web') - self.assertEqual(images[0].name, 'web') - self.assertEqual(images[1].id, 'mysql') - self.assertEqual(images[1].name, 'mysql') - - def test_list_sizes(self): - sizes = self.driver.list_sizes() - self.assertEqual(len(sizes), 5) - - size = [s for s in sizes if s.id == 'default'][0] - self.assertEqual(size.id, 'default') - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.ram, 2300) - self.assertEqual(size.price, 115) - - def test_list_locations(self): - try: - self.driver.list_locations() - except NotImplementedError: - pass - - def test_list_locations_response(self): - self.assertRaises(NotImplementedError, self.driver.list_locations) - - -class DreamhostMockHttp(MockHttp): - - def _BAD_AUTH_dreamhost_ps_list_ps(self, method, url, body, headers): - body = json.dumps({'data': 'invalid_api_key', 'result': 'error'}) - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _dreamhost_ps_add_ps(self, method, url, body, headers): - body = json.dumps( - {'data': {'added_web': 'ps12345'}, 'result': 'success'}) - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _dreamhost_ps_list_ps(self, method, url, body, headers): - data = [{ - 'account_id': 000000, - 'ip': '75.119.203.51', - 'memory_mb': 500, - 'ps': 'ps22174', - 'start_date': '2010-02-25', - 'type': 'web' - }, - { - 'account_id': 000000, - 'ip': '75.119.203.52', - 'memory_mb': 1500, - 'ps': 'ps22175', - 'start_date': '2010-02-25', - 'type': 'mysql' - }] - result = 'success' - body = json.dumps({'data': data, 'result': result}) - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _dreamhost_ps_list_images(self, method, url, body, headers): - data = [{ - 'description': 'Private web server', - 'image': 'web' - }, - { - 'description': 'Private MySQL server', - 'image': 'mysql' - }] - result = 'success' - body = json.dumps({'data': data, 'result': result}) - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _dreamhost_ps_reboot(self, method, url, body, headers): - body = json.dumps({'data': 'reboot_scheduled', 'result': 'success'}) - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _API_FAILURE_dreamhost_ps_reboot(self, method, url, body, headers): - body = json.dumps({'data': 'no_such_ps', 'result': 'error'}) - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _dreamhost_ps_set_size(self, method, url, body, headers): - body = json.dumps( - {'data': {'memory-mb': '500'}, 'result': 'success'}) - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _API_FAILURE_dreamhost_ps_set_size(self, method, url, body, headers): - body = json.dumps( - {'data': 'internal_error_setting_size', 'result': 'error'}) - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _dreamhost_ps_remove_ps(self, method, url, body, headers): - body = json.dumps({'data': 'removed_web', 'result': 'success'}) - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _API_FAILURE_dreamhost_ps_remove_ps(self, method, url, body, headers): - body = json.dumps({'data': 'no_such_ps', 'result': 'error'}) - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py index 6a5cdeb9f6..16440d5f3a 100644 --- a/libcloud/test/compute/test_ec2.py +++ b/libcloud/test/compute/test_ec2.py @@ -13,137 +13,231 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement import os import sys +import base64 from datetime import datetime -from libcloud.utils.iso8601 import UTC - -from libcloud.utils.py3 import httplib - -from libcloud.compute.drivers.ec2 import EC2NodeDriver -from libcloud.compute.drivers.ec2 import EC2USWestNodeDriver -from libcloud.compute.drivers.ec2 import EC2USWestOregonNodeDriver -from libcloud.compute.drivers.ec2 import EC2EUNodeDriver -from libcloud.compute.drivers.ec2 import EC2APSENodeDriver -from libcloud.compute.drivers.ec2 import EC2APNENodeDriver -from libcloud.compute.drivers.ec2 import EC2APSESydneyNodeDriver -from libcloud.compute.drivers.ec2 import EC2SAEastNodeDriver -from libcloud.compute.drivers.ec2 import EC2PlacementGroup -from libcloud.compute.drivers.ec2 import NimbusNodeDriver, EucNodeDriver -from libcloud.compute.drivers.ec2 import OutscaleSASNodeDriver -from libcloud.compute.drivers.ec2 import IdempotentParamError -from libcloud.compute.drivers.ec2 import REGION_DETAILS -from libcloud.compute.drivers.ec2 import ExEC2AvailabilityZone -from libcloud.compute.drivers.ec2 import EC2NetworkSubnet -from libcloud.compute.base import Node, NodeImage, NodeSize, NodeLocation -from libcloud.compute.base import StorageVolume, VolumeSnapshot -from libcloud.compute.types import KeyPairDoesNotExistError, StorageVolumeState - -from libcloud.test import MockHttpTestCase, LibcloudTestCase +from collections import OrderedDict + +from libcloud.test import MockHttp, LibcloudTestCase, unittest +from libcloud.utils.py3 import b, httplib, parse_qs +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeLocation, + StorageVolume, + VolumeSnapshot, +) from libcloud.test.compute import TestCaseMixin -from libcloud.test.file_fixtures import ComputeFileFixtures - -from libcloud.test import unittest from libcloud.test.secrets import EC2_PARAMS - - -null_fingerprint = '00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:' + \ - '00:00:00:00:00' +from libcloud.compute.types import ( + StorageVolumeState, + VolumeSnapshotState, + KeyPairDoesNotExistError, +) +from libcloud.utils.iso8601 import UTC +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.ec2 import ( + VALID_EC2_REGIONS, + EC2NodeDriver, + EucNodeDriver, + EC2NetworkSubnet, + NimbusNodeDriver, + EC2PlacementGroup, + EC2NetworkInterface, + IdempotentParamError, + ExEC2AvailabilityZone, + OutscaleSASNodeDriver, +) + +null_fingerprint = "00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:" + "00:00:00:00:00" class BaseEC2Tests(LibcloudTestCase): - def test_instantiate_driver_valid_regions(self): - regions = REGION_DETAILS.keys() - regions = [d for d in regions if d != 'nimbus'] + regions = VALID_EC2_REGIONS + regions = [d for d in regions if d != "nimbus" and d != "cn-north-1"] region_endpoints = [ - EC2NodeDriver(*EC2_PARAMS, **{'region': region}).connection.host for region in regions + EC2NodeDriver(*EC2_PARAMS, **{"region": region}).connection.host for region in regions ] # Verify that each driver doesn't get the same API host endpoint - self.assertEqual(len(region_endpoints), - len(set(region_endpoints)), - "Multiple Region Drivers were given the same API endpoint") + self.assertEqual( + len(region_endpoints), + len(set(region_endpoints)), + "Multiple Region Drivers were given the same API endpoint", + ) def test_instantiate_driver_invalid_regions(self): - for region in ['invalid', 'nimbus']: + for region in ["invalid", "nimbus"]: try: - EC2NodeDriver(*EC2_PARAMS, **{'region': region}) + EC2NodeDriver(*EC2_PARAMS, **{"region": region}) except ValueError: pass else: - self.fail('Invalid region, but exception was not thrown') + self.fail("Invalid region, but exception was not thrown") + + def test_list_sizes_valid_regions(self): + unsupported_regions = list() + + for region in VALID_EC2_REGIONS: + no_pricing = region in ["cn-north-1"] + driver = EC2NodeDriver(*EC2_PARAMS, **{"region": region}) + try: + sizes = driver.list_sizes() + if no_pricing: + self.assertTrue(all([s.price is None for s in sizes])) + except Exception: + unsupported_regions.append(region) + + if unsupported_regions: + self.fail("Cannot list sizes from ec2 regions: %s" % unsupported_regions) class EC2Tests(LibcloudTestCase, TestCaseMixin): - image_name = 'ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml' - region = 'us-east-1' + image_name = "ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml" + region = "us-east-1" def setUp(self): EC2MockHttp.test = self - EC2NodeDriver.connectionCls.conn_classes = (None, EC2MockHttp) - EC2MockHttp.use_param = 'Action' + EC2NodeDriver.connectionCls.conn_class = EC2MockHttp + EC2MockHttp.use_param = "Action" EC2MockHttp.type = None - self.driver = EC2NodeDriver(*EC2_PARAMS, - **{'region': self.region}) + self.driver = EC2NodeDriver(*EC2_PARAMS, **{"region": self.region}) + + def test_regions_and_signature_versions(self): + # Verify that correct signature versions are used for each region + driver = EC2NodeDriver(*EC2_PARAMS, region="us-east-1") + self.assertEqual(driver.signature_version, "2") + + driver = EC2NodeDriver(*EC2_PARAMS, region="us-east-2") + self.assertEqual(driver.signature_version, "4") + + driver = EC2NodeDriver(*EC2_PARAMS, region="eu-west-1") + self.assertEqual(driver.signature_version, "2") + + driver = EC2NodeDriver(*EC2_PARAMS, region="eu-west-3") + self.assertEqual(driver.signature_version, "4") + + driver = EC2NodeDriver(*EC2_PARAMS, region="ca-central-1") + self.assertEqual(driver.signature_version, "4") + + driver = EC2NodeDriver(*EC2_PARAMS, region="eu-central-1") + self.assertEqual(driver.signature_version, "4") + + driver = EC2NodeDriver(*EC2_PARAMS, region="eu-south-1") + self.assertEqual(driver.signature_version, "4") + + # Verify that signature_version can be overridden via constructor argument + driver = EC2NodeDriver(*EC2_PARAMS, region="us-east-1", signature_version="2") + self.assertEqual(driver.signature_version, "2") + + driver = EC2NodeDriver(*EC2_PARAMS, region="us-east-1", signature_version="4") + self.assertEqual(driver.signature_version, "4") + + driver = EC2NodeDriver(*EC2_PARAMS, region="eu-central-1", signature_version="2") + self.assertEqual(driver.signature_version, "2") + + driver = EC2NodeDriver(*EC2_PARAMS, region="eu-central-1", signature_version="4") + self.assertEqual(driver.signature_version, "4") + + driver = EC2NodeDriver(*EC2_PARAMS, region="ap-east-1") + self.assertEqual(driver.signature_version, "2") + + driver = EC2NodeDriver(*EC2_PARAMS, region="ap-east-1", signature_version="4") + self.assertEqual(driver.signature_version, "4") + + driver = EC2NodeDriver(*EC2_PARAMS, region="af-south-1") + self.assertEqual(driver.signature_version, "4") + + driver = EC2NodeDriver(*EC2_PARAMS, region="af-south-1", signature_version="4") + self.assertEqual(driver.signature_version, "4") + + def test_instantiate_driver_with_token(self): + token = "temporary_credentials_token" + driver = EC2NodeDriver(*EC2_PARAMS, **{"region": self.region, "token": token}) + self.assertTrue(hasattr(driver, "token"), "Driver has no attribute token") + self.assertEqual(token, driver.token, "Driver token does not match with provided token") + + def test_driver_with_token_signature_version(self): + token = "temporary_credentials_token" + driver = EC2NodeDriver(*EC2_PARAMS, **{"region": self.region, "token": token}) + kwargs = driver._ex_connection_class_kwargs() + self.assertIn("signature_version", kwargs) + self.assertEqual( + "4", + kwargs["signature_version"], + "Signature version is not 4 with temporary credentials", + ) def test_create_node(self): - image = NodeImage(id='ami-be3adfd7', - name=self.image_name, - driver=self.driver) - size = NodeSize('m1.small', 'Small Instance', None, None, None, None, - driver=self.driver) - node = self.driver.create_node(name='foo', image=image, size=size) - self.assertEqual(node.id, 'i-2ba64342') - self.assertEqual(node.name, 'foo') - self.assertEqual(node.extra['tags']['Name'], 'foo') - self.assertEqual(len(node.extra['tags']), 1) + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + node = self.driver.create_node(name="foo", image=image, size=size) + self.assertEqual(node.id, "i-2ba64342") + self.assertEqual(node.name, "foo") + self.assertEqual(node.extra["tags"]["Name"], "foo") + self.assertEqual(len(node.extra["tags"]), 1) def test_create_node_with_ex_mincount(self): - image = NodeImage(id='ami-be3adfd7', - name=self.image_name, - driver=self.driver) - size = NodeSize('m1.small', 'Small Instance', None, None, None, None, - driver=self.driver) - node = self.driver.create_node(name='foo', image=image, size=size, - ex_mincount=1, ex_maxcount=10) - self.assertEqual(node.id, 'i-2ba64342') - self.assertEqual(node.name, 'foo') - self.assertEqual(node.extra['tags']['Name'], 'foo') - self.assertEqual(len(node.extra['tags']), 1) + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + node = self.driver.create_node( + name="foo", image=image, size=size, ex_mincount=1, ex_maxcount=10 + ) + self.assertEqual(node.id, "i-2ba64342") + self.assertEqual(node.name, "foo") + self.assertEqual(node.extra["tags"]["Name"], "foo") + self.assertEqual(len(node.extra["tags"]), 1) + + def test_create_node_with_ex_assign_public_ip(self): + # assertions are done in _create_ex_assign_public_ip_RunInstances + EC2MockHttp.type = "create_ex_assign_public_ip" + image = NodeImage(id="ami-11111111", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + subnet = EC2NetworkSubnet("subnet-11111111", "test_subnet", "pending") + self.driver.create_node( + name="foo", + image=image, + size=size, + ex_subnet=subnet, + ex_security_group_ids=["sg-11111111"], + ex_assign_public_ip=True, + ) + + def test_create_node_with_ex_terminate_on_shutdown(self): + EC2MockHttp.type = "create_ex_terminate_on_shutdown" + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + + # The important part about the test is asserted inside + # EC2MockHttp._create_ex_terminate_on_shutdown + self.driver.create_node(name="foo", image=image, size=size, ex_terminate_on_shutdown=True) def test_create_node_with_metadata(self): - image = NodeImage(id='ami-be3adfd7', - name=self.image_name, - driver=self.driver) - size = NodeSize('m1.small', 'Small Instance', None, None, None, None, - driver=self.driver) - node = self.driver.create_node(name='foo', - image=image, - size=size, - ex_metadata={'Bar': 'baz', 'Num': '42'}) - self.assertEqual(node.name, 'foo') - self.assertEqual(node.extra['tags']['Name'], 'foo') - self.assertEqual(node.extra['tags']['Bar'], 'baz') - self.assertEqual(node.extra['tags']['Num'], '42') - self.assertEqual(len(node.extra['tags']), 3) + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + node = self.driver.create_node( + name="foo", image=image, size=size, ex_metadata={"Bar": "baz", "Num": "42"} + ) + self.assertEqual(node.name, "foo") + self.assertEqual(node.extra["tags"]["Name"], "foo") + self.assertEqual(node.extra["tags"]["Bar"], "baz") + self.assertEqual(node.extra["tags"]["Num"], "42") + self.assertEqual(len(node.extra["tags"]), 3) def test_create_node_idempotent(self): - EC2MockHttp.type = 'idempotent' - image = NodeImage(id='ami-be3adfd7', - name=self.image_name, - driver=self.driver) - size = NodeSize('m1.small', 'Small Instance', None, None, None, None, - driver=self.driver) - token = 'testclienttoken' - node = self.driver.create_node(name='foo', image=image, size=size, - ex_clienttoken=token) - self.assertEqual(node.id, 'i-2ba64342') - self.assertEqual(node.extra['client_token'], token) + EC2MockHttp.type = "idempotent" + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + token = "testclienttoken" + node = self.driver.create_node(name="foo", image=image, size=size, ex_clienttoken=token) + self.assertEqual(node.id, "i-2ba64342") + self.assertEqual(node.extra["client_token"], token) # from: http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/index.html?Run_Instance_Idempotency.html # If you repeat the request with the same client token, but change @@ -151,205 +245,234 @@ def test_create_node_idempotent(self): # IdempotentParameterMismatch error. # In our case, changing the parameter doesn't actually matter since we # are forcing the error response fixture. - EC2MockHttp.type = 'idempotent_mismatch' + EC2MockHttp.type = "idempotent_mismatch" idem_error = None # different count try: - self.driver.create_node(name='foo', image=image, size=size, - ex_mincount='2', ex_maxcount='2', - ex_clienttoken=token) - except IdempotentParamError: - e = sys.exc_info()[1] + self.driver.create_node( + name="foo", + image=image, + size=size, + ex_mincount="2", + ex_maxcount="2", + ex_clienttoken=token, + ) + except IdempotentParamError as e: idem_error = e self.assertTrue(idem_error is not None) def test_create_node_no_availability_zone(self): - image = NodeImage(id='ami-be3adfd7', - name=self.image_name, - driver=self.driver) - size = NodeSize('m1.small', 'Small Instance', None, None, None, None, - driver=self.driver) - node = self.driver.create_node(name='foo', image=image, size=size) - location = NodeLocation(0, 'Amazon US N. Virginia', 'US', self.driver) - self.assertEqual(node.id, 'i-2ba64342') - node = self.driver.create_node(name='foo', image=image, size=size, - location=location) - self.assertEqual(node.id, 'i-2ba64342') - self.assertEqual(node.name, 'foo') + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + node = self.driver.create_node(name="foo", image=image, size=size) + location = NodeLocation(0, "Amazon US N. Virginia", "US", self.driver) + self.assertEqual(node.id, "i-2ba64342") + node = self.driver.create_node(name="foo", image=image, size=size, location=location) + self.assertEqual(node.id, "i-2ba64342") + self.assertEqual(node.name, "foo") def test_list_nodes(self): node = self.driver.list_nodes()[0] public_ips = sorted(node.public_ips) - self.assertEqual(node.id, 'i-4382922a') + self.assertEqual(node.id, "i-4382922a") self.assertEqual(node.name, node.id) self.assertEqual(len(node.public_ips), 2) - self.assertEqual(node.extra['launch_time'], - '2013-12-02T11:58:11.000Z') - self.assertTrue('instance_type' in node.extra) - self.assertEqual(node.extra['availability'], 'us-east-1d') - self.assertEqual(node.extra['key_name'], 'fauxkey') - self.assertEqual(node.extra['monitoring'], 'disabled') - self.assertEqual(node.extra['image_id'], 'ami-3215fe5a') - self.assertEqual(len(node.extra['groups']), 2) - self.assertEqual(len(node.extra['block_device_mapping']), 1) - self.assertEqual(node.extra['block_device_mapping'][0]['device_name'], '/dev/sda1') - self.assertEqual(node.extra['block_device_mapping'][0]['ebs']['volume_id'], 'vol-5e312311') - self.assertTrue(node.extra['block_device_mapping'][0]['ebs']['delete']) - - self.assertEqual(public_ips[0], '1.2.3.4') - - nodes = self.driver.list_nodes(ex_node_ids=['i-4382922a', - 'i-8474834a']) + + self.assertEqual(node.extra["launch_time"], "2013-12-02T11:58:11.000Z") + self.assertEqual(node.created_at, datetime(2013, 12, 2, 11, 58, 11, tzinfo=UTC)) + + self.assertTrue("instance_type" in node.extra) + self.assertEqual(node.extra["availability"], "us-east-1d") + self.assertEqual(node.extra["key_name"], "fauxkey") + self.assertEqual(node.extra["monitoring"], "disabled") + self.assertEqual(node.extra["image_id"], "ami-3215fe5a") + self.assertEqual(len(node.extra["groups"]), 2) + self.assertEqual(len(node.extra["block_device_mapping"]), 1) + self.assertEqual(node.extra["block_device_mapping"][0]["device_name"], "/dev/sda1") + self.assertEqual(node.extra["block_device_mapping"][0]["ebs"]["volume_id"], "vol-5e312311") + self.assertTrue(node.extra["block_device_mapping"][0]["ebs"]["delete"]) + self.assertEqual(node.extra["block_device_mapping"][0]["ebs"]["status"], "attached") + self.assertEqual( + node.extra["block_device_mapping"][0]["ebs"]["attach_time"], + datetime(2013, 4, 9, 18, 1, 1, tzinfo=UTC), + ) + self.assertEqual(public_ips[0], "1.2.3.4") + + nodes = self.driver.list_nodes(ex_node_ids=["i-4382922a", "i-8474834a"]) ret_node1 = nodes[0] ret_node2 = nodes[1] - self.assertEqual(ret_node1.id, 'i-4382922a') - self.assertEqual(ret_node2.id, 'i-8474834a') - self.assertEqual(ret_node2.name, 'Test Server 2') - self.assertEqual(ret_node2.extra['subnet_id'], 'subnet-5fd9d412') - self.assertEqual(ret_node2.extra['vpc_id'], 'vpc-61dcd30e') - self.assertEqual(ret_node2.extra['tags']['Group'], 'VPC Test') - self.assertEqual(ret_node1.extra['launch_time'], - '2013-12-02T11:58:11.000Z') - self.assertTrue('instance_type' in ret_node1.extra) - self.assertEqual(ret_node2.extra['launch_time'], - '2013-12-02T15:58:29.000Z') - self.assertTrue('instance_type' in ret_node2.extra) + self.assertEqual(ret_node1.id, "i-4382922a") + self.assertEqual(ret_node2.id, "i-8474834a") + self.assertEqual(ret_node2.name, "Test Server 2") + self.assertEqual(ret_node2.extra["subnet_id"], "subnet-5fd9d412") + self.assertEqual(ret_node2.extra["vpc_id"], "vpc-61dcd30e") + self.assertEqual(ret_node2.extra["tags"]["Group"], "VPC Test") + + self.assertEqual(ret_node1.extra["launch_time"], "2013-12-02T11:58:11.000Z") + self.assertEqual(ret_node1.created_at, datetime(2013, 12, 2, 11, 58, 11, tzinfo=UTC)) + self.assertEqual(ret_node2.extra["launch_time"], "2013-12-02T15:58:29.000Z") + self.assertEqual(ret_node2.created_at, datetime(2013, 12, 2, 15, 58, 29, tzinfo=UTC)) + + self.assertIn("instance_type", ret_node1.extra) + self.assertIn("instance_type", ret_node2.extra) def test_ex_list_reserved_nodes(self): node = self.driver.ex_list_reserved_nodes()[0] - self.assertEqual(node.id, '93bbbca2-c500-49d0-9ede-9d8737400498') - self.assertEqual(node.state, 'active') - self.assertEqual(node.extra['instance_type'], 't1.micro') - self.assertEqual(node.extra['availability'], 'us-east-1b') - self.assertEqual(node.extra['start'], '2013-06-18T12:07:53.161Z') - self.assertEqual(node.extra['duration'], 31536000) - self.assertEqual(node.extra['usage_price'], 0.012) - self.assertEqual(node.extra['fixed_price'], 23.0) - self.assertEqual(node.extra['instance_count'], 1) - self.assertEqual(node.extra['description'], 'Linux/UNIX') - self.assertEqual(node.extra['instance_tenancy'], 'default') - self.assertEqual(node.extra['currency_code'], 'USD') - self.assertEqual(node.extra['offering_type'], 'Light Utilization') + self.assertEqual(node.id, "93bbbca2-c500-49d0-9ede-9d8737400498") + self.assertEqual(node.state, "active") + self.assertEqual(node.extra["instance_type"], "t1.micro") + self.assertEqual(node.extra["availability"], "us-east-1b") + self.assertEqual(node.extra["start"], "2013-06-18T12:07:53.161Z") + self.assertEqual(node.extra["end"], "2014-06-18T12:07:53.161Z") + self.assertEqual(node.extra["duration"], 31536000) + self.assertEqual(node.extra["usage_price"], 0.012) + self.assertEqual(node.extra["fixed_price"], 23.0) + self.assertEqual(node.extra["instance_count"], 1) + self.assertEqual(node.extra["description"], "Linux/UNIX") + self.assertEqual(node.extra["instance_tenancy"], "default") + self.assertEqual(node.extra["currency_code"], "USD") + self.assertEqual(node.extra["offering_type"], "Light Utilization") def test_list_location(self): locations = self.driver.list_locations() self.assertTrue(len(locations) > 0) - self.assertEqual(locations[0].name, 'eu-west-1a') + self.assertEqual(locations[0].name, "eu-west-1a") self.assertTrue(locations[0].availability_zone is not None) - self.assertTrue(isinstance(locations[0].availability_zone, - ExEC2AvailabilityZone)) + self.assertTrue(isinstance(locations[0].availability_zone, ExEC2AvailabilityZone)) def test_list_security_groups(self): groups = self.driver.ex_list_security_groups() - self.assertEqual(groups, ['WebServers', 'RangedPortsBySource']) + self.assertEqual(groups, ["WebServers", "RangedPortsBySource"]) def test_ex_delete_security_group_by_id(self): - group_id = 'sg-443d0a12' + group_id = "sg-443d0a12" retValue = self.driver.ex_delete_security_group_by_id(group_id) self.assertTrue(retValue) def test_delete_security_group_by_name(self): - group_name = 'WebServers' + group_name = "WebServers" retValue = self.driver.ex_delete_security_group_by_name(group_name) self.assertTrue(retValue) def test_ex_delete_security_group(self): - name = 'WebServers' + name = "WebServers" retValue = self.driver.ex_delete_security_group(name) self.assertTrue(retValue) def test_authorize_security_group(self): - resp = self.driver.ex_authorize_security_group('TestGroup', '22', '22', - '0.0.0.0/0') + resp = self.driver.ex_authorize_security_group("TestGroup", "22", "22", "0.0.0.0/0") self.assertTrue(resp) def test_authorize_security_group_ingress(self): - ranges = ['1.1.1.1/32', '2.2.2.2/32'] - resp = self.driver.ex_authorize_security_group_ingress('sg-42916629', 22, 22, cidr_ips=ranges) + ranges = ["1.1.1.1/32", "2.2.2.2/32"] + description = "automated authorised IP ingress test" + resp = self.driver.ex_authorize_security_group_ingress( + "sg-42916629", 22, 22, cidr_ips=ranges, description=description + ) self.assertTrue(resp) - groups = [{'group_id': 'sg-949265ff'}] - resp = self.driver.ex_authorize_security_group_ingress('sg-42916629', 22, 23, group_pairs=groups) + groups = [{"group_id": "sg-949265ff"}] + description = "automated authorised group ingress test" + resp = self.driver.ex_authorize_security_group_ingress( + "sg-42916629", 22, 23, group_pairs=groups, description=description + ) self.assertTrue(resp) def test_authorize_security_group_egress(self): - ranges = ['1.1.1.1/32', '2.2.2.2/32'] - resp = self.driver.ex_authorize_security_group_ingress('sg-42916629', 22, 22, cidr_ips=ranges) + ranges = ["1.1.1.1/32", "2.2.2.2/32"] + resp = self.driver.ex_authorize_security_group_ingress( + "sg-42916629", 22, 22, cidr_ips=ranges + ) self.assertTrue(resp) - groups = [{'group_id': 'sg-949265ff'}] - resp = self.driver.ex_authorize_security_group_ingress('sg-42916629', 22, 22, group_pairs=groups) + groups = [{"group_id": "sg-949265ff"}] + resp = self.driver.ex_authorize_security_group_ingress( + "sg-42916629", 22, 22, group_pairs=groups + ) self.assertTrue(resp) def test_revoke_security_group_ingress(self): - ranges = ['1.1.1.1/32', '2.2.2.2/32'] - resp = self.driver.ex_authorize_security_group_ingress('sg-42916629', 22, 22, cidr_ips=ranges) + ranges = ["1.1.1.1/32", "2.2.2.2/32"] + resp = self.driver.ex_authorize_security_group_ingress( + "sg-42916629", 22, 22, cidr_ips=ranges + ) self.assertTrue(resp) - groups = [{'group_id': 'sg-949265ff'}] - resp = self.driver.ex_authorize_security_group_ingress('sg-42916629', 22, 22, group_pairs=groups) + groups = [{"group_id": "sg-949265ff"}] + resp = self.driver.ex_authorize_security_group_ingress( + "sg-42916629", 22, 22, group_pairs=groups + ) self.assertTrue(resp) def test_revoke_security_group_egress(self): - ranges = ['1.1.1.1/32', '2.2.2.2/32'] - resp = self.driver.ex_authorize_security_group_ingress('sg-42916629', 22, 22, cidr_ips=ranges) + ranges = ["1.1.1.1/32", "2.2.2.2/32"] + resp = self.driver.ex_authorize_security_group_ingress( + "sg-42916629", 22, 22, cidr_ips=ranges + ) self.assertTrue(resp) - groups = [{'group_id': 'sg-949265ff'}] - resp = self.driver.ex_authorize_security_group_ingress('sg-42916629', 22, 22, group_pairs=groups) + groups = [{"group_id": "sg-949265ff"}] + resp = self.driver.ex_authorize_security_group_ingress( + "sg-42916629", 22, 22, group_pairs=groups + ) self.assertTrue(resp) def test_reboot_node(self): - node = Node('i-4382922a', None, None, None, None, self.driver) + node = Node("i-4382922a", None, None, None, None, self.driver) ret = self.driver.reboot_node(node) self.assertTrue(ret) def test_ex_start_node(self): - node = Node('i-4382922a', None, None, None, None, self.driver) + node = Node("i-4382922a", None, None, None, None, self.driver) ret = self.driver.ex_start_node(node) self.assertTrue(ret) def test_ex_stop_node(self): - node = Node('i-4382922a', None, None, None, None, self.driver) + node = Node("i-4382922a", None, None, None, None, self.driver) ret = self.driver.ex_stop_node(node) self.assertTrue(ret) def test_ex_create_node_with_ex_blockdevicemappings(self): - EC2MockHttp.type = 'create_ex_blockdevicemappings' + EC2MockHttp.type = "create_ex_blockdevicemappings" - image = NodeImage(id='ami-be3adfd7', - name=self.image_name, - driver=self.driver) - size = NodeSize('m1.small', 'Small Instance', None, None, None, None, - driver=self.driver) + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) mappings = [ - {'DeviceName': '/dev/sda1', 'Ebs.VolumeSize': 10}, - {'DeviceName': '/dev/sdb', 'VirtualName': 'ephemeral0'}, - {'DeviceName': '/dev/sdc', 'VirtualName': 'ephemeral1'} + {"DeviceName": "/dev/sda1", "Ebs.VolumeSize": 10}, + {"DeviceName": "/dev/sdb", "VirtualName": "ephemeral0"}, + {"DeviceName": "/dev/sdc", "VirtualName": "ephemeral1"}, ] - node = self.driver.create_node(name='foo', image=image, size=size, - ex_blockdevicemappings=mappings) - self.assertEqual(node.id, 'i-2ba64342') + node = self.driver.create_node( + name="foo", image=image, size=size, ex_blockdevicemappings=mappings + ) + self.assertEqual(node.id, "i-2ba64342") def test_ex_create_node_with_ex_blockdevicemappings_attribute_error(self): - EC2MockHttp.type = 'create_ex_blockdevicemappings' - - image = NodeImage(id='ami-be3adfd7', - name=self.image_name, - driver=self.driver) - size = NodeSize('m1.small', 'Small Instance', None, None, None, None, - driver=self.driver) - - mappings = 'this should be a list' - self.assertRaises(AttributeError, self.driver.create_node, name='foo', - image=image, size=size, - ex_blockdevicemappings=mappings) - - mappings = ['this should be a dict'] - self.assertRaises(AttributeError, self.driver.create_node, name='foo', - image=image, size=size, - ex_blockdevicemappings=mappings) + EC2MockHttp.type = "create_ex_blockdevicemappings" + + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + + mappings = "this should be a list" + self.assertRaises( + AttributeError, + self.driver.create_node, + name="foo", + image=image, + size=size, + ex_blockdevicemappings=mappings, + ) + + mappings = ["this should be a dict"] + self.assertRaises( + AttributeError, + self.driver.create_node, + name="foo", + image=image, + size=size, + ex_blockdevicemappings=mappings, + ) def test_destroy_node(self): - node = Node('i-4382922a', None, None, None, None, self.driver) + node = Node("i-4382922a", None, None, None, None, self.driver) ret = self.driver.destroy_node(node) self.assertTrue(ret) @@ -357,142 +480,143 @@ def test_list_sizes(self): region_old = self.driver.region_name names = [ - ('ec2_us_east', 'us-east-1'), - ('ec2_us_west', 'us-west-1'), - ('ec2_eu_west', 'eu-west-1'), - ('ec2_ap_southeast', 'ap-southeast-1'), - ('ec2_ap_northeast', 'ap-northeast-1'), - ('ec2_ap_southeast_2', 'ap-southeast-2') + ("ec2_us_east", "us-east-1"), + ("ec2_us_west", "us-west-1"), + ("ec2_us_west", "us-west-2"), + ("ec2_eu_west", "eu-west-1"), + ("ec2_ap_southeast", "ap-southeast-1"), + ("ec2_ap_northeast", "ap-northeast-1"), + ("ec2_ap_southeast_2", "ap-southeast-2"), + ("ec2_ap_south_1", "ap-south-1"), ] for api_name, region_name in names: self.driver.api_name = api_name self.driver.region_name = region_name sizes = self.driver.list_sizes() - - ids = [s.id for s in sizes] - self.assertTrue('t1.micro' in ids) - self.assertTrue('m1.small' in ids) - self.assertTrue('m1.large' in ids) - self.assertTrue('m1.xlarge' in ids) - self.assertTrue('c1.medium' in ids) - self.assertTrue('c1.xlarge' in ids) - self.assertTrue('m2.xlarge' in ids) - self.assertTrue('m2.2xlarge' in ids) - self.assertTrue('m2.4xlarge' in ids) - - if region_name == 'us-east-1': - self.assertEqual(len(sizes), 40) - self.assertTrue('cg1.4xlarge' in ids) - self.assertTrue('cc2.8xlarge' in ids) - self.assertTrue('cr1.8xlarge' in ids) - elif region_name == 'us-west-1': - self.assertEqual(len(sizes), 32) - if region_name == 'us-west-2': - self.assertEqual(len(sizes), 29) - elif region_name == 'ap-southeast-1': - self.assertEqual(len(sizes), 31) - elif region_name == 'ap-southeast-2': - self.assertEqual(len(sizes), 36) - elif region_name == 'eu-west-1': - self.assertEqual(len(sizes), 38) - + self.assertNotEqual(len(sizes), 0) self.driver.region_name = region_old def test_ex_create_node_with_ex_iam_profile(self): iamProfile = { - 'id': 'AIDGPMS9RO4H3FEXAMPLE', - 'name': 'Foo', - 'arn': 'arn:aws:iam:...' + "id": "AIDGPMS9RO4H3FEXAMPLE", + "name": "Foo", + "arn": "arn:aws:iam:...", } - image = NodeImage(id='ami-be3adfd7', - name=self.image_name, - driver=self.driver) - size = NodeSize('m1.small', 'Small Instance', None, None, None, None, - driver=self.driver) + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) EC2MockHttp.type = None - node1 = self.driver.create_node(name='foo', image=image, size=size) - EC2MockHttp.type = 'ex_iam_profile' - node2 = self.driver.create_node(name='bar', image=image, size=size, - ex_iam_profile=iamProfile['name']) - node3 = self.driver.create_node(name='bar', image=image, size=size, - ex_iam_profile=iamProfile['arn']) - - self.assertFalse(node1.extra['iam_profile']) - self.assertEqual(node2.extra['iam_profile'], iamProfile['id']) - self.assertEqual(node3.extra['iam_profile'], iamProfile['id']) + node1 = self.driver.create_node(name="foo", image=image, size=size) + EC2MockHttp.type = "ex_iam_profile" + node2 = self.driver.create_node( + name="bar", image=image, size=size, ex_iamprofile=iamProfile["name"] + ) + node3 = self.driver.create_node( + name="bar", image=image, size=size, ex_iamprofile=iamProfile["arn"] + ) + + self.assertFalse(node1.extra["iam_profile"]) + self.assertEqual(node2.extra["iam_profile"], iamProfile["id"]) + self.assertEqual(node3.extra["iam_profile"], iamProfile["id"]) + + def test_ex_create_node_with_ex_spot(self): + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + EC2MockHttp.type = "ex_spot" + node = self.driver.create_node(name="foo", image=image, size=size, ex_spot=True) + self.assertEqual(node.extra["instance_lifecycle"], "spot") + node = self.driver.create_node( + name="foo", image=image, size=size, ex_spot=True, ex_spot_max_price=1.5 + ) + self.assertEqual(node.extra["instance_lifecycle"], "spot") def test_list_images(self): images = self.driver.list_images() - self.assertEqual(len(images), 2) - location = '123456788908/Test Image' - self.assertEqual(images[0].id, 'ami-57ba933a') - self.assertEqual(images[0].name, 'Test Image') - self.assertEqual(images[0].extra['image_location'], location) - self.assertEqual(images[0].extra['architecture'], 'x86_64') - self.assertEqual(len(images[0].extra['block_device_mapping']), 2) - ephemeral = images[0].extra['block_device_mapping'][1]['virtual_name'] - self.assertEqual(ephemeral, 'ephemeral0') - - location = '123456788908/Test Image 2' - self.assertEqual(images[1].id, 'ami-85b2a8ae') - self.assertEqual(images[1].name, 'Test Image 2') - self.assertEqual(images[1].extra['image_location'], location) - self.assertEqual(images[1].extra['architecture'], 'x86_64') - size = images[1].extra['block_device_mapping'][0]['ebs']['volume_size'] + self.assertEqual(len(images), 3) + location = "123456788908/Test Image" + self.assertEqual(images[0].id, "ami-57ba933a") + self.assertEqual(images[0].name, "Test Image") + self.assertEqual(images[0].extra["image_location"], location) + self.assertEqual(images[0].extra["architecture"], "x86_64") + self.assertEqual(len(images[0].extra["block_device_mapping"]), 2) + ephemeral = images[0].extra["block_device_mapping"][1]["virtual_name"] + self.assertEqual(ephemeral, "ephemeral0") + billing_product1 = images[0].extra["billing_products"][0] + self.assertEqual(billing_product1, "ab-5dh78019") + self.assertIsInstance(images[0].extra["creation_date"], datetime) + + location = "123456788908/Test Image 2" + self.assertEqual(images[1].id, "ami-85b2a8ae") + self.assertEqual(images[1].name, "Test Image 2") + self.assertEqual(images[1].extra["image_location"], location) + self.assertEqual(images[1].extra["architecture"], "x86_64") + size = images[1].extra["block_device_mapping"][0]["ebs"]["volume_size"] + billing_product2 = images[1].extra["billing_products"][0] + self.assertEqual(billing_product2, "as-6dr90319") + self.assertEqual(size, 20) + self.assertIsNone(images[1].extra["creation_date"]) + + self.assertEqual(images[2].id, "ami-85b2a8ac") + self.assertEqual(images[2].name, "Test Image 3") self.assertEqual(size, 20) + self.assertIsNone(images[2].extra["creation_date"]) def test_list_images_with_image_ids(self): - EC2MockHttp.type = 'ex_imageids' - images = self.driver.list_images(ex_image_ids=['ami-57ba933a']) + EC2MockHttp.type = "ex_imageids" + images = self.driver.list_images(ex_image_ids=["ami-57ba933a"]) self.assertEqual(len(images), 1) - self.assertEqual(images[0].name, 'Test Image') + self.assertEqual(images[0].name, "Test Image") def test_list_images_with_executable_by(self): - images = self.driver.list_images(ex_executableby='self') + images = self.driver.list_images(ex_executableby="self") - self.assertEqual(len(images), 2) + self.assertEqual(len(images), 3) def test_get_image(self): - image = self.driver.get_image('ami-57ba933a') - self.assertEqual(image.id, 'ami-57ba933a') - self.assertEqual(image.name, 'Test Image') - self.assertEqual(image.extra['architecture'], 'x86_64') - self.assertEqual(len(image.extra['block_device_mapping']), 2) + image = self.driver.get_image("ami-57ba933a") + self.assertEqual(image.id, "ami-57ba933a") + self.assertEqual(image.name, "Test Image") + self.assertEqual(image.extra["architecture"], "x86_64") + self.assertEqual(len(image.extra["block_device_mapping"]), 2) + self.assertEqual(image.extra["billing_products"][0], "ab-5dh78019") + self.assertIsInstance(image.extra["creation_date"], datetime) def test_copy_image(self): image = self.driver.list_images()[0] - resp = self.driver.copy_image(image, 'us-east-1', - name='Faux Image', - description='Test Image Copy') - self.assertEqual(resp.id, 'ami-4db38224') + resp = self.driver.copy_image( + "us-east-1", image, name="Faux Image", description="Test Image Copy" + ) + self.assertEqual(resp.id, "ami-4db38224") def test_create_image(self): node = self.driver.list_nodes()[0] - mapping = [{'VirtualName': None, - 'Ebs': {'VolumeSize': 10, - 'VolumeType': 'standard', - 'DeleteOnTermination': 'true'}, - 'DeviceName': '/dev/sda1'}] + mapping = [ + { + "VirtualName": None, + "Ebs": { + "VolumeSize": 10, + "VolumeType": "standard", + "DeleteOnTermination": "true", + }, + "DeviceName": "/dev/sda1", + } + ] - resp = self.driver.create_image(node, - 'New Image', - description='New EBS Image', - block_device_mapping=mapping) - self.assertEqual(resp.id, 'ami-e9b38280') + resp = self.driver.create_image( + node, "New Image", description="New EBS Image", block_device_mapping=mapping + ) + self.assertEqual(resp.id, "ami-e9b38280") def test_create_image_no_mapping(self): node = self.driver.list_nodes()[0] - resp = self.driver.create_image(node, - 'New Image', - description='New EBS Image') - self.assertEqual(resp.id, 'ami-e9b38280') + resp = self.driver.create_image(node, "New Image", description="New EBS Image") + self.assertEqual(resp.id, "ami-e9b38280") def delete_image(self): images = self.driver.list_images() @@ -502,79 +626,117 @@ def delete_image(self): self.assertTrue(resp) def ex_register_image(self): - mapping = [{'DeviceName': '/dev/sda1', - 'Ebs': {'SnapshotId': 'snap-5ade3e4e'}}] - image = self.driver.ex_register_image(name='Test Image', - root_device_name='/dev/sda1', - description='My Image', - architecture='x86_64', - block_device_mapping=mapping) - self.assertEqual(image.id, 'ami-57c2fb3e') + mapping = [{"DeviceName": "/dev/sda1", "Ebs": {"SnapshotId": "snap-5ade3e4e"}}] + image = self.driver.ex_register_image( + name="Test Image", + root_device_name="/dev/sda1", + description="My Image", + architecture="x86_64", + block_device_mapping=mapping, + ena_support=True, + billing_products=["ab-5dh78019"], + sriov_net_support="simple", + ) + self.assertEqual(image.id, "ami-57c2fb3e") + + def test_ex_import_snapshot(self): + disk_container = [ + { + "Description": "Dummy import snapshot task", + "Format": "raw", + "UserBucket": {"S3Bucket": "dummy-bucket", "S3Key": "dummy-key"}, + } + ] + + snap = self.driver.ex_import_snapshot(disk_container=disk_container) + self.assertEqual(snap.id, "snap-0ea83e8a87e138f39") + + def test_wait_for_import_snapshot_completion(self): + snap = self.driver._wait_for_import_snapshot_completion( + import_task_id="import-snap-fhdysyq6" + ) + self.assertEqual(snap.id, "snap-0ea83e8a87e138f39") + + def test_timeout_wait_for_import_snapshot_completion(self): + import_task_id = "import-snap-fhdysyq6" + EC2MockHttp.type = "timeout" + with self.assertRaises(Exception) as context: + self.driver._wait_for_import_snapshot_completion( + import_task_id=import_task_id, timeout=0.01, interval=0.001 + ) + self.assertEqual( + "Timeout while waiting for import task Id %s" % import_task_id, + str(context.exception), + ) + + def test_ex_describe_import_snapshot_tasks(self): + snap = self.driver.ex_describe_import_snapshot_tasks(import_task_id="import-snap-fh7y6i6w<") + + self.assertEqual(snap.snapshotId, "snap-0ea83e8a87e138f39") + self.assertEqual(snap.status, "completed") def test_ex_list_availability_zones(self): availability_zones = self.driver.ex_list_availability_zones() availability_zone = availability_zones[0] self.assertTrue(len(availability_zones) > 0) - self.assertEqual(availability_zone.name, 'eu-west-1a') - self.assertEqual(availability_zone.zone_state, 'available') - self.assertEqual(availability_zone.region_name, 'eu-west-1') + self.assertEqual(availability_zone.name, "eu-west-1a") + self.assertEqual(availability_zone.zone_state, "available") + self.assertEqual(availability_zone.region_name, "eu-west-1") def test_list_keypairs(self): keypairs = self.driver.list_key_pairs() self.assertEqual(len(keypairs), 1) - self.assertEqual(keypairs[0].name, 'gsg-keypair') + self.assertEqual(keypairs[0].name, "gsg-keypair") self.assertEqual(keypairs[0].fingerprint, null_fingerprint) # Test old deprecated method keypairs = self.driver.ex_list_keypairs() self.assertEqual(len(keypairs), 1) - self.assertEqual(keypairs[0]['keyName'], 'gsg-keypair') - self.assertEqual(keypairs[0]['keyFingerprint'], null_fingerprint) + self.assertEqual(keypairs[0]["keyName"], "gsg-keypair") + self.assertEqual(keypairs[0]["keyFingerprint"], null_fingerprint) def test_get_key_pair(self): - EC2MockHttp.type = 'get_one' + EC2MockHttp.type = "get_one" - key_pair = self.driver.get_key_pair(name='gsg-keypair') - self.assertEqual(key_pair.name, 'gsg-keypair') + key_pair = self.driver.get_key_pair(name="gsg-keypair") + self.assertEqual(key_pair.name, "gsg-keypair") def test_get_key_pair_does_not_exist(self): - EC2MockHttp.type = 'doesnt_exist' + EC2MockHttp.type = "doesnt_exist" - self.assertRaises(KeyPairDoesNotExistError, self.driver.get_key_pair, - name='test-key-pair') + self.assertRaises(KeyPairDoesNotExistError, self.driver.get_key_pair, name="test-key-pair") def test_create_key_pair(self): - key_pair = self.driver.create_key_pair(name='test-keypair') + key_pair = self.driver.create_key_pair(name="test-keypair") - fingerprint = ('1f:51:ae:28:bf:89:e9:d8:1f:25:5d' - ':37:2d:7d:b8:ca:9f:f5:f1:6f') + fingerprint = "1f:51:ae:28:bf:89:e9:d8:1f:25:5d" ":37:2d:7d:b8:ca:9f:f5:f1:6f" - self.assertEqual(key_pair.name, 'my-key-pair') + self.assertEqual(key_pair.name, "my-key-pair") self.assertEqual(key_pair.fingerprint, fingerprint) self.assertTrue(key_pair.private_key is not None) # Test old and deprecated method - key_pair = self.driver.ex_create_keypair(name='test-keypair') - self.assertEqual(key_pair['keyFingerprint'], fingerprint) - self.assertTrue(key_pair['keyMaterial'] is not None) + key_pair = self.driver.ex_create_keypair(name="test-keypair") + self.assertEqual(key_pair["keyFingerprint"], fingerprint) + self.assertTrue(key_pair["keyMaterial"] is not None) def test_ex_describe_all_keypairs(self): keys = self.driver.ex_describe_all_keypairs() - self.assertEqual(keys, ['gsg-keypair']) + self.assertEqual(keys, ["gsg-keypair"]) def test_list_key_pairs(self): keypair1 = self.driver.list_key_pairs()[0] - self.assertEqual(keypair1.name, 'gsg-keypair') + self.assertEqual(keypair1.name, "gsg-keypair") self.assertEqual(keypair1.fingerprint, null_fingerprint) # Test backward compatibility - keypair2 = self.driver.ex_describe_keypairs('gsg-keypair') + keypair2 = self.driver.ex_describe_keypairs("gsg-keypair") - self.assertEqual(keypair2['keyName'], 'gsg-keypair') - self.assertEqual(keypair2['keyFingerprint'], null_fingerprint) + self.assertEqual(keypair2["keyName"], "gsg-keypair") + self.assertEqual(keypair2["keyFingerprint"], null_fingerprint) def test_delete_key_pair(self): keypair = self.driver.list_key_pairs()[0] @@ -583,183 +745,209 @@ def test_delete_key_pair(self): self.assertTrue(success) # Test old and deprecated method - resp = self.driver.ex_delete_keypair('gsg-keypair') + resp = self.driver.ex_delete_keypair("gsg-keypair") self.assertTrue(resp) def test_ex_describe_tags(self): - node = Node('i-4382922a', None, None, None, None, self.driver) + node = Node("i-4382922a", None, None, None, None, self.driver) tags = self.driver.ex_describe_tags(resource=node) self.assertEqual(len(tags), 3) - self.assertTrue('tag' in tags) - self.assertTrue('owner' in tags) - self.assertTrue('stack' in tags) + self.assertTrue("tag" in tags) + self.assertTrue("owner" in tags) + self.assertTrue("stack" in tags) def test_import_key_pair_from_string(self): - path = os.path.join(os.path.dirname(__file__), 'fixtures', 'misc', - 'dummy_rsa.pub') + path = os.path.join(os.path.dirname(__file__), "fixtures", "misc", "test_rsa.pub") - with open(path, 'r') as fp: + with open(path) as fp: key_material = fp.read() - key = self.driver.import_key_pair_from_string(name='keypair', - key_material=key_material) - self.assertEqual(key.name, 'keypair') + key = self.driver.import_key_pair_from_string(name="keypair", key_material=key_material) + self.assertEqual(key.name, "keypair") self.assertEqual(key.fingerprint, null_fingerprint) # Test old and deprecated method - key = self.driver.ex_import_keypair_from_string('keypair', - key_material) - self.assertEqual(key['keyName'], 'keypair') - self.assertEqual(key['keyFingerprint'], null_fingerprint) + key = self.driver.ex_import_keypair_from_string("keypair", key_material) + self.assertEqual(key["keyName"], "keypair") + self.assertEqual(key["keyFingerprint"], null_fingerprint) def test_import_key_pair_from_file(self): - path = os.path.join(os.path.dirname(__file__), 'fixtures', 'misc', - 'dummy_rsa.pub') + path = os.path.join(os.path.dirname(__file__), "fixtures", "misc", "test_rsa.pub") - key = self.driver.import_key_pair_from_file('keypair', path) - self.assertEqual(key.name, 'keypair') + key = self.driver.import_key_pair_from_file("keypair", path) + self.assertEqual(key.name, "keypair") self.assertEqual(key.fingerprint, null_fingerprint) # Test old and deprecated method - key = self.driver.ex_import_keypair('keypair', path) - self.assertEqual(key['keyName'], 'keypair') - self.assertEqual(key['keyFingerprint'], null_fingerprint) + key = self.driver.ex_import_keypair("keypair", path) + self.assertEqual(key["keyName"], "keypair") + self.assertEqual(key["keyFingerprint"], null_fingerprint) def test_ex_create_tags(self): - node = Node('i-4382922a', None, None, None, None, self.driver) - self.driver.ex_create_tags(node, {'sample': 'tag'}) + node = Node("i-4382922a", None, None, None, None, self.driver) + self.driver.ex_create_tags(node, {"sample": "tag"}) def test_ex_delete_tags(self): - node = Node('i-4382922a', None, None, None, None, self.driver) - self.driver.ex_delete_tags(node, {'sample': 'tag'}) + node = Node("i-4382922a", None, None, None, None, self.driver) + self.driver.ex_delete_tags(node, {"sample": "tag"}) + + def test_ex_delete_tags2(self): + node = Node("i-4382922a", None, None, None, None, self.driver) + self.driver.ex_create_tags(node, {"sample": "another tag"}) + self.driver.ex_delete_tags(node, {"sample": None}) def test_ex_describe_addresses_for_node(self): - node1 = Node('i-4382922a', None, None, None, None, self.driver) + node1 = Node("i-4382922a", None, None, None, None, self.driver) ip_addresses1 = self.driver.ex_describe_addresses_for_node(node1) - node2 = Node('i-4382922b', None, None, None, None, self.driver) - ip_addresses2 = sorted( - self.driver.ex_describe_addresses_for_node(node2)) - node3 = Node('i-4382922g', None, None, None, None, self.driver) - ip_addresses3 = sorted( - self.driver.ex_describe_addresses_for_node(node3)) + node2 = Node("i-4382922b", None, None, None, None, self.driver) + ip_addresses2 = sorted(self.driver.ex_describe_addresses_for_node(node2)) + node3 = Node("i-4382922g", None, None, None, None, self.driver) + ip_addresses3 = sorted(self.driver.ex_describe_addresses_for_node(node3)) self.assertEqual(len(ip_addresses1), 1) - self.assertEqual(ip_addresses1[0], '1.2.3.4') + self.assertEqual(ip_addresses1[0], "1.2.3.4") self.assertEqual(len(ip_addresses2), 2) - self.assertEqual(ip_addresses2[0], '1.2.3.5') - self.assertEqual(ip_addresses2[1], '1.2.3.6') + self.assertEqual(ip_addresses2[0], "1.2.3.5") + self.assertEqual(ip_addresses2[1], "1.2.3.6") self.assertEqual(len(ip_addresses3), 0) def test_ex_describe_addresses(self): - node1 = Node('i-4382922a', None, None, None, None, self.driver) - node2 = Node('i-4382922g', None, None, None, None, self.driver) + node1 = Node("i-4382922a", None, None, None, None, self.driver) + node2 = Node("i-4382922g", None, None, None, None, self.driver) nodes_elastic_ips1 = self.driver.ex_describe_addresses([node1]) nodes_elastic_ips2 = self.driver.ex_describe_addresses([node2]) self.assertEqual(len(nodes_elastic_ips1), 1) self.assertTrue(node1.id in nodes_elastic_ips1) - self.assertEqual(nodes_elastic_ips1[node1.id], ['1.2.3.4']) + self.assertEqual(nodes_elastic_ips1[node1.id], ["1.2.3.4"]) self.assertEqual(len(nodes_elastic_ips2), 1) self.assertTrue(node2.id in nodes_elastic_ips2) self.assertEqual(nodes_elastic_ips2[node2.id], []) def test_ex_describe_all_addresses(self): - EC2MockHttp.type = 'all_addresses' + EC2MockHttp.type = "all_addresses" elastic_ips1 = self.driver.ex_describe_all_addresses() - elastic_ips2 = self.driver.ex_describe_all_addresses( - only_associated=True) - self.assertEqual('1.2.3.7', elastic_ips1[3].ip) - self.assertEqual('vpc', elastic_ips1[3].domain) - self.assertEqual('eipalloc-992a5cf8', elastic_ips1[3].extra['allocation_id']) + elastic_ips2 = self.driver.ex_describe_all_addresses(only_associated=True) + self.assertEqual("1.2.3.7", elastic_ips1[3].ip) + self.assertEqual("vpc", elastic_ips1[3].domain) + self.assertEqual("eipalloc-992a5cf8", elastic_ips1[3].extra["allocation_id"]) self.assertEqual(len(elastic_ips2), 2) - self.assertEqual('1.2.3.5', elastic_ips2[1].ip) - self.assertEqual('vpc', elastic_ips2[1].domain) + self.assertEqual("1.2.3.5", elastic_ips2[1].ip) + self.assertEqual("vpc", elastic_ips2[1].domain) def test_ex_allocate_address(self): elastic_ip = self.driver.ex_allocate_address() - self.assertEqual('192.0.2.1', elastic_ip.ip) - self.assertEqual('standard', elastic_ip.domain) - EC2MockHttp.type = 'vpc' - elastic_ip = self.driver.ex_allocate_address(domain='vpc') - self.assertEqual('192.0.2.2', elastic_ip.ip) - self.assertEqual('vpc', elastic_ip.domain) - self.assertEqual('eipalloc-666d7f04', elastic_ip.extra['allocation_id']) + self.assertEqual("192.0.2.1", elastic_ip.ip) + self.assertEqual("standard", elastic_ip.domain) + EC2MockHttp.type = "vpc" + elastic_ip = self.driver.ex_allocate_address(domain="vpc") + self.assertEqual("192.0.2.2", elastic_ip.ip) + self.assertEqual("vpc", elastic_ip.domain) + self.assertEqual("eipalloc-666d7f04", elastic_ip.extra["allocation_id"]) def test_ex_release_address(self): - EC2MockHttp.type = 'all_addresses' + EC2MockHttp.type = "all_addresses" elastic_ips = self.driver.ex_describe_all_addresses() - EC2MockHttp.type = '' + EC2MockHttp.type = "" ret = self.driver.ex_release_address(elastic_ips[2]) self.assertTrue(ret) - ret = self.driver.ex_release_address(elastic_ips[0], domain='vpc') + ret = self.driver.ex_release_address(elastic_ips[0], domain="vpc") self.assertTrue(ret) - self.assertRaises(AttributeError, - self.driver.ex_release_address, - elastic_ips[0], - domain='bogus') + self.assertRaises( + AttributeError, + self.driver.ex_release_address, + elastic_ips[0], + domain="bogus", + ) def test_ex_associate_address_with_node(self): - node = Node('i-4382922a', None, None, None, None, self.driver) - EC2MockHttp.type = 'all_addresses' + node = Node("i-4382922a", None, None, None, None, self.driver) + EC2MockHttp.type = "all_addresses" elastic_ips = self.driver.ex_describe_all_addresses() - EC2MockHttp.type = '' - ret1 = self.driver.ex_associate_address_with_node( - node, elastic_ips[2]) - ret2 = self.driver.ex_associate_addresses( - node, elastic_ips[2]) + EC2MockHttp.type = "" + ret1 = self.driver.ex_associate_address_with_node(node, elastic_ips[2]) + ret2 = self.driver.ex_associate_addresses(node, elastic_ips[2]) self.assertEqual(None, ret1) self.assertEqual(None, ret2) - EC2MockHttp.type = 'vpc' - ret3 = self.driver.ex_associate_address_with_node( - node, elastic_ips[3], domain='vpc') - ret4 = self.driver.ex_associate_addresses( - node, elastic_ips[3], domain='vpc') - self.assertEqual('eipassoc-167a8073', ret3) - self.assertEqual('eipassoc-167a8073', ret4) - self.assertRaises(AttributeError, - self.driver.ex_associate_address_with_node, - node, - elastic_ips[1], - domain='bogus') + EC2MockHttp.type = "vpc" + ret3 = self.driver.ex_associate_address_with_node(node, elastic_ips[3], domain="vpc") + ret4 = self.driver.ex_associate_addresses(node, elastic_ips[3], domain="vpc") + self.assertEqual("eipassoc-167a8073", ret3) + self.assertEqual("eipassoc-167a8073", ret4) + self.assertRaises( + AttributeError, + self.driver.ex_associate_address_with_node, + node, + elastic_ips[1], + domain="bogus", + ) + + def test_ex_associate_address_with_network_interface(self): + node = Node("i-4382922a", None, None, None, None, self.driver) + interface = EC2NetworkInterface("eni-12345678", "secondary", "attached") + EC2MockHttp.type = "all_addresses" + elastic_ip = self.driver.ex_describe_all_addresses()[3] + EC2MockHttp.type = "interface" + association_id = self.driver.ex_associate_address_with_node( + node, elastic_ip, domain="vpc", network_interface=interface + ) + self.assertEqual("eipassoc-167a8073", association_id) + association_id = self.driver.ex_associate_addresses( + node, elastic_ip, domain="vpc", network_interface=interface + ) + self.assertEqual("eipassoc-167a8073", association_id) def test_ex_disassociate_address(self): - EC2MockHttp.type = 'all_addresses' + EC2MockHttp.type = "all_addresses" elastic_ips = self.driver.ex_describe_all_addresses() - EC2MockHttp.type = '' + EC2MockHttp.type = "" ret = self.driver.ex_disassociate_address(elastic_ips[2]) self.assertTrue(ret) # Test a VPC disassociation - ret = self.driver.ex_disassociate_address(elastic_ips[1], - domain='vpc') + ret = self.driver.ex_disassociate_address(elastic_ips[1], domain="vpc") self.assertTrue(ret) - self.assertRaises(AttributeError, - self.driver.ex_disassociate_address, - elastic_ips[1], - domain='bogus') + self.assertRaises( + AttributeError, + self.driver.ex_disassociate_address, + elastic_ips[1], + domain="bogus", + ) def test_ex_change_node_size_same_size(self): - size = NodeSize('m1.small', 'Small Instance', - None, None, None, None, driver=self.driver) - node = Node('i-4382922a', None, None, None, None, self.driver, - extra={'instancetype': 'm1.small'}) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + node = Node( + "i-4382922a", + None, + None, + None, + None, + self.driver, + extra={"instancetype": "m1.small"}, + ) try: self.driver.ex_change_node_size(node=node, new_size=size) except ValueError: pass else: - self.fail('Same size was passed, but an exception was not thrown') + self.fail("Same size was passed, but an exception was not thrown") def test_ex_change_node_size(self): - size = NodeSize('m1.large', 'Small Instance', - None, None, None, None, driver=self.driver) - node = Node('i-4382922a', None, None, None, None, self.driver, - extra={'instancetype': 'm1.small'}) + size = NodeSize("m1.large", "Small Instance", None, None, None, None, driver=self.driver) + node = Node( + "i-4382922a", + None, + None, + None, + None, + self.driver, + extra={"instancetype": "m1.small"}, + ) result = self.driver.ex_change_node_size(node=node, new_size=size) self.assertTrue(result) @@ -769,100 +957,163 @@ def test_list_volumes(self): self.assertEqual(len(volumes), 3) - self.assertEqual('vol-10ae5e2b', volumes[0].id) + self.assertEqual("vol-10ae5e2b", volumes[0].id) self.assertEqual(1, volumes[0].size) - self.assertEqual('available', volumes[0].extra['state']) + self.assertEqual("available", volumes[0].extra["state"]) self.assertEqual(StorageVolumeState.AVAILABLE, volumes[0].state) - self.assertEqual('vol-v24bfh75', volumes[1].id) + self.assertEqual("vol-v24bfh75", volumes[1].id) self.assertEqual(11, volumes[1].size) - self.assertIsNone(volumes[1].extra['snapshot_id']) - self.assertEqual('in-use', volumes[1].extra['state']) + self.assertIsNone(volumes[1].extra["snapshot_id"]) + self.assertEqual("in-use", volumes[1].extra["state"]) self.assertEqual(StorageVolumeState.INUSE, volumes[1].state) - self.assertEqual('vol-b6c851ec', volumes[2].id) + self.assertEqual("vol-b6c851ec", volumes[2].id) self.assertEqual(8, volumes[2].size) - self.assertEqual('some-unknown-status', volumes[2].extra['state']) - self.assertEqual('i-d334b4b3', volumes[2].extra['instance_id']) - self.assertEqual('/dev/sda1', volumes[2].extra['device']) - self.assertEqual('snap-30d37269', volumes[2].extra['snapshot_id']) + self.assertEqual("some-unknown-status", volumes[2].extra["state"]) + self.assertEqual("i-d334b4b3", volumes[2].extra["instance_id"]) + self.assertEqual("/dev/sda1", volumes[2].extra["device"]) + self.assertEqual("snap-30d37269", volumes[2].extra["snapshot_id"]) self.assertEqual(StorageVolumeState.UNKNOWN, volumes[2].state) + EC2MockHttp.type = "filters_nodes" + node = Node("i-d334b4b3", None, None, None, None, self.driver) + self.driver.list_volumes(node=node) + + EC2MockHttp.type = "filters_status" + self.driver.list_volumes(ex_filters={"status": "available"}) + def test_create_volume(self): location = self.driver.list_locations()[0] - vol = self.driver.create_volume(10, 'vol', location) + vol = self.driver.create_volume(10, "vol", location=location) + + self.assertEqual(10, vol.size) + self.assertEqual("vol", vol.name) + self.assertEqual("creating", vol.extra["state"]) + self.assertTrue(isinstance(vol.extra["create_time"], datetime)) + self.assertEqual(False, vol.extra["encrypted"]) + + expected_msg = "Invalid volume type specified: invalid-type" + self.assertRaisesRegex( + ValueError, + expected_msg, + self.driver.create_volume, + 10, + "invalid-vol", + location=location, + ex_volume_type="invalid-type", + ) + + def test_create_encrypted_volume(self): + location = self.driver.list_locations()[0] + vol = self.driver.create_volume( + 10, "vol", location, ex_encrypted=True, ex_kms_key_id="1234" + ) self.assertEqual(10, vol.size) - self.assertEqual('vol', vol.name) - self.assertEqual('creating', vol.extra['state']) - self.assertTrue(isinstance(vol.extra['create_time'], datetime)) + self.assertEqual("vol", vol.name) + self.assertEqual("creating", vol.extra["state"]) + self.assertTrue(isinstance(vol.extra["create_time"], datetime)) + self.assertEqual(True, vol.extra["encrypted"]) def test_destroy_volume(self): - vol = StorageVolume(id='vol-4282672b', name='test', - state=StorageVolumeState.AVAILABLE, - size=10, driver=self.driver) + vol = StorageVolume( + id="vol-4282672b", + name="test", + state=StorageVolumeState.AVAILABLE, + size=10, + driver=self.driver, + ) retValue = self.driver.destroy_volume(vol) self.assertTrue(retValue) def test_attach(self): - vol = StorageVolume(id='vol-4282672b', name='test', - size=10, state=StorageVolumeState.AVAILABLE, - driver=self.driver) + vol = StorageVolume( + id="vol-4282672b", + name="test", + size=10, + state=StorageVolumeState.AVAILABLE, + driver=self.driver, + ) - node = Node('i-4382922a', None, None, None, None, self.driver) - retValue = self.driver.attach_volume(node, vol, '/dev/sdh') + node = Node("i-4382922a", None, None, None, None, self.driver) + retValue = self.driver.attach_volume(node, vol, "/dev/sdh") self.assertTrue(retValue) def test_detach(self): - vol = StorageVolume(id='vol-4282672b', name='test', - state=StorageVolumeState.INUSE, - size=10, driver=self.driver) + vol = StorageVolume( + id="vol-4282672b", + name="test", + state=StorageVolumeState.INUSE, + size=10, + driver=self.driver, + ) retValue = self.driver.detach_volume(vol) self.assertTrue(retValue) def test_create_volume_snapshot(self): - vol = StorageVolume(id='vol-4282672b', name='test', - state=StorageVolumeState.AVAILABLE, - size=10, driver=self.driver) - snap = self.driver.create_volume_snapshot( - vol, 'Test snapshot') - self.assertEqual('snap-a7cb2hd9', snap.id) + vol = StorageVolume( + id="vol-4282672b", + name="test", + state=StorageVolumeState.AVAILABLE, + size=10, + driver=self.driver, + ) + snap = self.driver.create_volume_snapshot(vol, "Test snapshot") + self.assertEqual("snap-a7cb2hd9", snap.id) self.assertEqual(vol.size, snap.size) - self.assertEqual('Test snapshot', snap.extra['name']) - self.assertEqual(vol.id, snap.extra['volume_id']) - self.assertEqual('pending', snap.extra['state']) + self.assertEqual("Test snapshot", snap.extra["name"]) + self.assertEqual(vol.id, snap.extra["volume_id"]) + self.assertEqual("pending", snap.extra["state"]) + self.assertEqual(VolumeSnapshotState.CREATING, snap.state) # 2013-08-15T16:22:30.000Z self.assertEqual(datetime(2013, 8, 15, 16, 22, 30, tzinfo=UTC), snap.created) + def test_create_volume_snapshot_with_tags(self): + vol = StorageVolume( + id="vol-4282672b", + name="test", + state=StorageVolumeState.AVAILABLE, + size=10, + driver=self.driver, + ) + snap = self.driver.create_volume_snapshot( + vol, "Test snapshot", ex_metadata={"my_tag": "test"} + ) + self.assertEqual("test", snap.extra["tags"]["my_tag"]) + def test_list_snapshots(self): snaps = self.driver.list_snapshots() self.assertEqual(len(snaps), 3) - self.assertEqual('snap-428abd35', snaps[0].id) - self.assertEqual('vol-e020df80', snaps[0].extra['volume_id']) + self.assertEqual("snap-428abd35", snaps[0].id) + self.assertEqual(VolumeSnapshotState.CREATING, snaps[0].state) + self.assertEqual("vol-e020df80", snaps[0].extra["volume_id"]) self.assertEqual(30, snaps[0].size) - self.assertEqual('Daily Backup', snaps[0].extra['description']) + self.assertEqual("Daily Backup", snaps[0].extra["description"]) - self.assertEqual('snap-18349159', snaps[1].id) - self.assertEqual('vol-b5a2c1v9', snaps[1].extra['volume_id']) + self.assertEqual("snap-18349159", snaps[1].id) + self.assertEqual("DB Backup 1", snaps[1].name) + self.assertEqual(VolumeSnapshotState.AVAILABLE, snaps[1].state) + self.assertEqual("vol-b5a2c1v9", snaps[1].extra["volume_id"]) self.assertEqual(15, snaps[1].size) - self.assertEqual('Weekly backup', snaps[1].extra['description']) - self.assertEqual('DB Backup 1', snaps[1].extra['name']) + self.assertEqual("Weekly backup", snaps[1].extra["description"]) + self.assertEqual("DB Backup 1", snaps[1].extra["name"]) def test_list_volume_snapshots(self): volume = self.driver.list_volumes()[0] - assert volume.id == 'vol-10ae5e2b' + assert volume.id == "vol-10ae5e2b" snapshots = self.driver.list_volume_snapshots(volume) self.assertEqual(len(snapshots), 1) - self.assertEqual(snapshots[0].id, 'snap-18349160') + self.assertEqual(snapshots[0].id, "snap-18349160") def test_destroy_snapshot(self): - snap = VolumeSnapshot(id='snap-428abd35', size=10, driver=self.driver) + snap = VolumeSnapshot(id="snap-428abd35", size=10, driver=self.driver) resp = snap.destroy() self.assertTrue(resp) @@ -870,82 +1121,94 @@ def test_ex_modify_image_attribute(self): images = self.driver.list_images() image = images[0] - data = {'LaunchPermission.Add.1.Group': 'all'} + data = {"LaunchPermission.Add.1.Group": "all"} resp = self.driver.ex_modify_image_attribute(image, data) self.assertTrue(resp) + def test_ex_modify_snapshot_attribute(self): + snap = VolumeSnapshot(id="snap-1234567890abcdef0", size=10, driver=self.driver) + + data = {"CreateVolumePermission.Add.1.Group": "all"} + resp = self.driver.ex_modify_snapshot_attribute(snap, data) + self.assertTrue(resp) + def test_create_node_ex_security_groups(self): - EC2MockHttp.type = 'ex_security_groups' + EC2MockHttp.type = "ex_security_groups" - image = NodeImage(id='ami-be3adfd7', - name=self.image_name, - driver=self.driver) - size = NodeSize('m1.small', 'Small Instance', None, None, None, None, - driver=self.driver) + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) - security_groups = ['group1', 'group2'] + security_groups = ["group1", "group2"] # Old, deprecated argument name - self.driver.create_node(name='foo', image=image, size=size, - ex_securitygroup=security_groups) + self.driver.create_node( + name="foo", image=image, size=size, ex_securitygroup=security_groups + ) # New argument name - self.driver.create_node(name='foo', image=image, size=size, - ex_security_groups=security_groups) + self.driver.create_node( + name="foo", image=image, size=size, ex_security_groups=security_groups + ) # Test old and new arguments are mutually exclusive - self.assertRaises(ValueError, self.driver.create_node, - name='foo', image=image, size=size, - ex_securitygroup=security_groups, - ex_security_groups=security_groups) + self.assertRaises( + ValueError, + self.driver.create_node, + name="foo", + image=image, + size=size, + ex_securitygroup=security_groups, + ex_security_groups=security_groups, + ) def test_create_node_ex_security_group_ids(self): - EC2MockHttp.type = 'ex_security_group_ids' + EC2MockHttp.type = "ex_security_group_ids" - image = NodeImage(id='ami-be3adfd7', - name=self.image_name, - driver=self.driver) - size = NodeSize('m1.small', 'Small Instance', None, None, None, None, - driver=self.driver) + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) subnet = EC2NetworkSubnet(12345, "test_subnet", "pending") - security_groups = ['sg-1aa11a1a', 'sg-2bb22b2b'] - - self.driver.create_node(name='foo', image=image, size=size, - ex_security_group_ids=security_groups, - ex_subnet=subnet) - self.assertRaises(ValueError, self.driver.create_node, - name='foo', image=image, size=size, - ex_security_group_ids=security_groups) + security_groups = ["sg-1aa11a1a", "sg-2bb22b2b"] + + self.driver.create_node( + name="foo", + image=image, + size=size, + ex_security_group_ids=security_groups, + ex_subnet=subnet, + ) + self.assertRaises( + ValueError, + self.driver.create_node, + name="foo", + image=image, + size=size, + ex_security_group_ids=security_groups, + ) def test_ex_get_metadata_for_node(self): - image = NodeImage(id='ami-be3adfd7', - name=self.image_name, - driver=self.driver) - size = NodeSize('m1.small', 'Small Instance', None, None, None, None, - driver=self.driver) - node = self.driver.create_node(name='foo', - image=image, - size=size, - ex_metadata={'Bar': 'baz', 'Num': '42'}) + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + node = self.driver.create_node( + name="foo", image=image, size=size, ex_metadata={"Bar": "baz", "Num": "42"} + ) metadata = self.driver.ex_get_metadata_for_node(node) - self.assertEqual(metadata['Name'], 'foo') - self.assertEqual(metadata['Bar'], 'baz') - self.assertEqual(metadata['Num'], '42') + self.assertEqual(metadata["Name"], "foo") + self.assertEqual(metadata["Bar"], "baz") + self.assertEqual(metadata["Num"], "42") self.assertEqual(len(metadata), 3) def test_ex_get_limits(self): limits = self.driver.ex_get_limits() - expected = {'max-instances': 20, 'vpc-max-elastic-ips': 5, - 'max-elastic-ips': 5} - self.assertEqual(limits['resource'], expected) + expected = {"max-instances": 20, "vpc-max-elastic-ips": 5, "max-elastic-ips": 5} + self.assertEqual(limits["resource"], expected) def test_ex_create_security_group(self): - group = self.driver.ex_create_security_group("WebServers", - "Rules to protect web nodes", - "vpc-143cab4") + group = self.driver.ex_create_security_group( + "WebServers", "Rules to protect web nodes", "vpc-143cab4" + ) self.assertEqual(group["group_id"], "sg-52e2f530") @@ -970,41 +1233,46 @@ def test_ex_list_networks(self): self.assertEqual(len(vpcs), 2) - self.assertEqual('vpc-532335e1', vpcs[0].id) - self.assertEqual('vpc-532335e1', vpcs[0].name) - self.assertEqual('192.168.51.0/24', vpcs[0].cidr_block) - self.assertEqual('available', vpcs[0].extra['state']) - self.assertEqual('dopt-7eded312', vpcs[0].extra['dhcp_options_id']) + self.assertEqual("vpc-532335e1", vpcs[0].id) + self.assertEqual("vpc-532335e1", vpcs[0].name) + self.assertEqual("192.168.51.0/24", vpcs[0].cidr_block) + self.assertEqual("available", vpcs[0].extra["state"]) + self.assertEqual("dopt-7eded312", vpcs[0].extra["dhcp_options_id"]) - self.assertEqual('vpc-62ded30e', vpcs[1].id) - self.assertEqual('Test VPC', vpcs[1].name) - self.assertEqual('192.168.52.0/24', vpcs[1].cidr_block) - self.assertEqual('available', vpcs[1].extra['state']) - self.assertEqual('dopt-7eded312', vpcs[1].extra['dhcp_options_id']) + self.assertEqual("vpc-62ded30e", vpcs[1].id) + self.assertEqual("Test VPC", vpcs[1].name) + self.assertEqual("192.168.52.0/24", vpcs[1].cidr_block) + self.assertEqual("available", vpcs[1].extra["state"]) + self.assertEqual("dopt-7eded312", vpcs[1].extra["dhcp_options_id"]) def test_ex_list_networks_network_ids(self): - EC2MockHttp.type = 'network_ids' - network_ids = ['vpc-532335e1'] + EC2MockHttp.type = "network_ids" + network_ids = ["vpc-532335e1"] # We assert in the mock http method self.driver.ex_list_networks(network_ids=network_ids) def test_ex_list_networks_filters(self): - EC2MockHttp.type = 'filters' - filters = {'dhcp-options-id': 'dopt-7eded312', # matches two networks - 'cidr': '192.168.51.0/24'} # matches one network + EC2MockHttp.type = "filters" + + filters = OrderedDict( + [ + ("dhcp-options-id", "dopt-7eded312"), # matches two networks + ("cidr", "192.168.51.0/24"), # matches two networks + ] + ) # We assert in the mock http method self.driver.ex_list_networks(filters=filters) def test_ex_create_network(self): - vpc = self.driver.ex_create_network('192.168.55.0/24', - name='Test VPC', - instance_tenancy='default') + vpc = self.driver.ex_create_network( + "192.168.55.0/24", name="Test VPC", instance_tenancy="default" + ) - self.assertEqual('vpc-ad3527cf', vpc.id) - self.assertEqual('192.168.55.0/24', vpc.cidr_block) - self.assertEqual('pending', vpc.extra['state']) + self.assertEqual("vpc-ad3527cf", vpc.id) + self.assertEqual("192.168.55.0/24", vpc.cidr_block) + self.assertEqual("pending", vpc.extra["state"]) def test_ex_delete_network(self): vpcs = self.driver.ex_list_networks() @@ -1018,23 +1286,39 @@ def test_ex_list_subnets(self): self.assertEqual(len(subnets), 2) - self.assertEqual('subnet-ce0e7ce5', subnets[0].id) - self.assertEqual('available', subnets[0].state) - self.assertEqual(123, subnets[0].extra['available_ips']) + self.assertEqual("subnet-ce0e7ce5", subnets[0].id) + self.assertEqual("available", subnets[0].state) + self.assertEqual(123, subnets[0].extra["available_ips"]) - self.assertEqual('subnet-ce0e7ce6', subnets[1].id) - self.assertEqual('available', subnets[1].state) - self.assertEqual(59, subnets[1].extra['available_ips']) + self.assertEqual("subnet-ce0e7ce6", subnets[1].id) + self.assertEqual("available", subnets[1].state) + self.assertEqual(59, subnets[1].extra["available_ips"]) def test_ex_create_subnet(self): - subnet = self.driver.ex_create_subnet('vpc-532135d1', - '192.168.51.128/26', - 'us-east-1b', - name='Test Subnet') + subnet = self.driver.ex_create_subnet( + "vpc-532135d1", "192.168.51.128/26", "us-east-1b", name="Test Subnet" + ) + + self.assertEqual("subnet-ce0e7ce6", subnet.id) + self.assertEqual("pending", subnet.state) + self.assertEqual("vpc-532135d1", subnet.extra["vpc_id"]) + + def test_ex_modify_subnet_attribute(self): + subnet = self.driver.ex_list_subnets()[0] + resp = self.driver.ex_modify_subnet_attribute(subnet, "auto_public_ip", True) + self.assertTrue(resp) + resp = self.driver.ex_modify_subnet_attribute(subnet, "auto_ipv6", False) + self.assertTrue(resp) - self.assertEqual('subnet-ce0e7ce6', subnet.id) - self.assertEqual('pending', subnet.state) - self.assertEqual('vpc-532135d1', subnet.extra['vpc_id']) + expected_msg = "Unsupported attribute: invalid" + self.assertRaisesRegex( + ValueError, + expected_msg, + self.driver.ex_modify_subnet_attribute, + subnet, + "invalid", + True, + ) def test_ex_delete_subnet(self): subnet = self.driver.ex_list_subnets()[0] @@ -1044,33 +1328,30 @@ def test_ex_delete_subnet(self): def test_ex_get_console_output(self): node = self.driver.list_nodes()[0] resp = self.driver.ex_get_console_output(node) - self.assertEqual('Test String', resp['output']) + self.assertEqual("Test String", resp["output"]) def test_ex_list_network_interfaces(self): interfaces = self.driver.ex_list_network_interfaces() self.assertEqual(len(interfaces), 2) - self.assertEqual('eni-18e6c05e', interfaces[0].id) - self.assertEqual('in-use', interfaces[0].state) - self.assertEqual('0e:6e:df:72:78:af', - interfaces[0].extra['mac_address']) + self.assertEqual("eni-18e6c05e", interfaces[0].id) + self.assertEqual("in-use", interfaces[0].state) + self.assertEqual("0e:6e:df:72:78:af", interfaces[0].extra["mac_address"]) - self.assertEqual('eni-83e3c5c5', interfaces[1].id) - self.assertEqual('in-use', interfaces[1].state) - self.assertEqual('0e:93:0b:e9:e9:c4', - interfaces[1].extra['mac_address']) + self.assertEqual("eni-83e3c5c5", interfaces[1].id) + self.assertEqual("in-use", interfaces[1].state) + self.assertEqual("0e:93:0b:e9:e9:c4", interfaces[1].extra["mac_address"]) def test_ex_create_network_interface(self): subnet = self.driver.ex_list_subnets()[0] interface = self.driver.ex_create_network_interface( - subnet, - name='Test Interface', - description='My Test') + subnet, name="Test Interface", description="My Test" + ) - self.assertEqual('eni-2b36086d', interface.id) - self.assertEqual('pending', interface.state) - self.assertEqual('0e:bd:49:3e:11:74', interface.extra['mac_address']) + self.assertEqual("eni-2b36086d", interface.id) + self.assertEqual("pending", interface.state) + self.assertEqual("0e:bd:49:3e:11:74", interface.extra["mac_address"]) def test_ex_delete_network_interface(self): interface = self.driver.ex_list_network_interfaces()[0] @@ -1080,12 +1361,11 @@ def test_ex_delete_network_interface(self): def test_ex_attach_network_interface_to_node(self): node = self.driver.list_nodes()[0] interface = self.driver.ex_list_network_interfaces()[0] - resp = self.driver.ex_attach_network_interface_to_node(interface, - node, 1) + resp = self.driver.ex_attach_network_interface_to_node(interface, node, 1) self.assertTrue(resp) def test_ex_detach_network_interface(self): - resp = self.driver.ex_detach_network_interface('eni-attach-2b588b47') + resp = self.driver.ex_detach_network_interface("eni-attach-2b588b47") self.assertTrue(resp) def test_ex_list_internet_gateways(self): @@ -1093,15 +1373,15 @@ def test_ex_list_internet_gateways(self): self.assertEqual(len(gateways), 2) - self.assertEqual('igw-84dd3ae1', gateways[0].id) - self.assertEqual('igw-7fdae215', gateways[1].id) - self.assertEqual('available', gateways[1].state) - self.assertEqual('vpc-62cad41e', gateways[1].vpc_id) + self.assertEqual("igw-84dd3ae1", gateways[0].id) + self.assertEqual("igw-7fdae215", gateways[1].id) + self.assertEqual("available", gateways[1].state) + self.assertEqual("vpc-62cad41e", gateways[1].vpc_id) def test_ex_create_internet_gateway(self): gateway = self.driver.ex_create_internet_gateway() - self.assertEqual('igw-13ac2b36', gateway.id) + self.assertEqual("igw-13ac2b36", gateway.id) def test_ex_delete_internet_gateway(self): gateway = self.driver.ex_list_internet_gateways()[0] @@ -1120,485 +1400,587 @@ def test_ex_detach_internet_gateway(self): resp = self.driver.ex_detach_internet_gateway(gateway, network) self.assertTrue(resp) + def test_ex_modify_volume(self): + volume = self.driver.list_volumes()[0] + assert volume.id == "vol-10ae5e2b" + + params = {"VolumeType": "io1", "Size": 2, "Iops": 1000} + volume_modification = self.driver.ex_modify_volume(volume, params) + + self.assertIsNone(volume_modification.end_time) + self.assertEqual("modifying", volume_modification.modification_state) + self.assertEqual(300, volume_modification.original_iops) + self.assertEqual(1, volume_modification.original_size) + self.assertEqual("gp2", volume_modification.original_volume_type) + self.assertEqual(0, volume_modification.progress) + self.assertIsNone(volume_modification.status_message) + self.assertEqual(1000, volume_modification.target_iops) + self.assertEqual(2, volume_modification.target_size) + self.assertEqual("io1", volume_modification.target_volume_type) + self.assertEqual("vol-10ae5e2b", volume_modification.volume_id) + + def test_ex_describe_volumes_modifications(self): + modifications = self.driver.ex_describe_volumes_modifications() + + self.assertEqual(len(modifications), 2) + + self.assertIsNone(modifications[0].end_time) + self.assertEqual("optimizing", modifications[0].modification_state) + self.assertEqual(100, modifications[0].original_iops) + self.assertEqual(10, modifications[0].original_size) + self.assertEqual("gp2", modifications[0].original_volume_type) + self.assertEqual(3, modifications[0].progress) + self.assertIsNone(modifications[0].status_message) + self.assertEqual(10000, modifications[0].target_iops) + self.assertEqual(2000, modifications[0].target_size) + self.assertEqual("io1", modifications[0].target_volume_type) + self.assertEqual("vol-06397e7a0eEXAMPLE", modifications[0].volume_id) + + self.assertEqual("completed", modifications[1].modification_state) + self.assertEqual(100, modifications[1].original_iops) + self.assertEqual(8, modifications[1].original_size) + self.assertEqual("gp2", modifications[1].original_volume_type) + self.assertEqual(100, modifications[1].progress) + self.assertIsNone(modifications[1].status_message) + self.assertEqual(10000, modifications[1].target_iops) + self.assertEqual(200, modifications[1].target_size) + self.assertEqual("io1", modifications[1].target_volume_type) + self.assertEqual("vol-bEXAMPLE", modifications[1].volume_id) + + def test_params_is_not_simple_type_exception_is_thrown(self): + params = {"not": {"not": ["simple"]}} + + expected_msg = 'dictionary contains an attribute "not" which value' + self.assertRaisesRegex( + ValueError, expected_msg, self.driver.connection.request, "/", params=params + ) + + params = {"invalid": [1, 2, 3]} + + expected_msg = 'dictionary contains an attribute "invalid" which value' + self.assertRaisesRegex( + ValueError, expected_msg, self.driver.connection.request, "/", params=params + ) + class EC2USWest1Tests(EC2Tests): - region = 'us-west-1' + region = "us-west-1" class EC2USWest2Tests(EC2Tests): - region = 'us-west-2' + region = "us-west-2" class EC2EUWestTests(EC2Tests): - region = 'eu-west-1' + region = "eu-west-1" class EC2APSE1Tests(EC2Tests): - region = 'ap-southeast-1' + region = "ap-southeast-1" class EC2APNETests(EC2Tests): - region = 'ap-northeast-1' + region = "ap-northeast-1" class EC2APSE2Tests(EC2Tests): - region = 'ap-southeast-2' + region = "ap-southeast-2" class EC2SAEastTests(EC2Tests): - region = 'sa-east-1' - - -# Tests for the old, deprecated way of instantiating a driver. -class EC2OldStyleModelTests(EC2Tests): - driver_klass = EC2USWestNodeDriver - - def setUp(self): - EC2MockHttp.test = self - EC2NodeDriver.connectionCls.conn_classes = (None, EC2MockHttp) - EC2MockHttp.use_param = 'Action' - EC2MockHttp.type = None - - self.driver = self.driver_klass(*EC2_PARAMS) - - -class EC2USWest1OldStyleModelTests(EC2OldStyleModelTests): - driver_klass = EC2USWestNodeDriver - - -class EC2USWest2OldStyleModelTests(EC2OldStyleModelTests): - driver_klass = EC2USWestOregonNodeDriver - - -class EC2EUWestOldStyleModelTests(EC2OldStyleModelTests): - driver_klass = EC2EUNodeDriver + region = "sa-east-1" -class EC2APSE1OldStyleModelTests(EC2OldStyleModelTests): - driver_klass = EC2APSENodeDriver - - -class EC2APNEOldStyleModelTests(EC2OldStyleModelTests): - driver_klass = EC2APNENodeDriver - - -class EC2APSE2OldStyleModelTests(EC2OldStyleModelTests): - driver_klass = EC2APSESydneyNodeDriver - - -class EC2SAEastOldStyleModelTests(EC2OldStyleModelTests): - driver_klass = EC2SAEastNodeDriver - - -class EC2MockHttp(MockHttpTestCase): - fixtures = ComputeFileFixtures('ec2') +class EC2MockHttp(MockHttp, unittest.TestCase): + fixtures = ComputeFileFixtures("ec2") def _DescribeInstances(self, method, url, body, headers): - body = self.fixtures.load('describe_instances.xml') + body = self.fixtures.load("describe_instances.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeReservedInstances(self, method, url, body, headers): - body = self.fixtures.load('describe_reserved_instances.xml') + body = self.fixtures.load("describe_reserved_instances.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeAvailabilityZones(self, method, url, body, headers): - body = self.fixtures.load('describe_availability_zones.xml') + body = self.fixtures.load("describe_availability_zones.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _RebootInstances(self, method, url, body, headers): - body = self.fixtures.load('reboot_instances.xml') + body = self.fixtures.load("reboot_instances.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _StartInstances(self, method, url, body, headers): - body = self.fixtures.load('start_instances.xml') + body = self.fixtures.load("start_instances.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _StopInstances(self, method, url, body, headers): - body = self.fixtures.load('stop_instances.xml') + body = self.fixtures.load("stop_instances.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeSecurityGroups(self, method, url, body, headers): - body = self.fixtures.load('describe_security_groups.xml') + body = self.fixtures.load("describe_security_groups.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DeleteSecurityGroup(self, method, url, body, headers): - body = self.fixtures.load('delete_security_group.xml') + body = self.fixtures.load("delete_security_group.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _AuthorizeSecurityGroupIngress(self, method, url, body, headers): - body = self.fixtures.load('authorize_security_group_ingress.xml') + body = self.fixtures.load("authorize_security_group_ingress.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeImages(self, method, url, body, headers): - body = self.fixtures.load('describe_images.xml') + body = self.fixtures.load("describe_images.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _RegisterImages(self, method, url, body, headers): - body = self.fixtures.load('register_image.xml') + body = self.fixtures.load("register_image.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _ImportSnapshot(self, method, url, body, headers): + body = self.fixtures.load("import_snapshot.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _DescribeImportSnapshotTasks(self, method, url, body, headers): + body = self.fixtures.load("describe_import_snapshot_tasks.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _timeout_DescribeImportSnapshotTasks(self, method, url, body, headers): + body = self.fixtures.load("describe_import_snapshot_tasks_active.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _ex_imageids_DescribeImages(self, method, url, body, headers): - body = self.fixtures.load('describe_images_ex_imageids.xml') + body = self.fixtures.load("describe_images_ex_imageids.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _RunInstances(self, method, url, body, headers): - body = self.fixtures.load('run_instances.xml') + body = self.fixtures.load("run_instances.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _ex_user_data_RunInstances(self, method, url, body, headers): + # test_create_node_with_ex_userdata + if url.startswith("/"): + url = url[1:] + + if url.startswith("?"): + url = url[1:] + + params = parse_qs(url) + + self.assertTrue( + "UserData" in params, + "UserData not in params, actual params: %s" % (str(params)), + ) + user_data = base64.b64decode(b(params["UserData"][0])).decode("utf-8") + self.assertEqual(user_data, "foo\nbar\foo") + + body = self.fixtures.load("run_instances.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _create_ex_assign_public_ip_RunInstances(self, method, url, body, headers): + self.assertUrlContainsQueryParams( + url, + { + "NetworkInterface.1.AssociatePublicIpAddress": "true", + "NetworkInterface.1.DeleteOnTermination": "true", + "NetworkInterface.1.DeviceIndex": "0", + "NetworkInterface.1.SubnetId": "subnet-11111111", + "NetworkInterface.1.SecurityGroupId.1": "sg-11111111", + }, + ) + body = self.fixtures.load("run_instances_with_subnet_and_security_group.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _create_ex_terminate_on_shutdown_RunInstances(self, method, url, body, headers): + self.assertUrlContainsQueryParams(url, {"InstanceInitiatedShutdownBehavior": "terminate"}) + + body = self.fixtures.load("run_instances.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _ex_security_groups_RunInstances(self, method, url, body, headers): - self.assertUrlContainsQueryParams(url, {'SecurityGroup.1': 'group1'}) - self.assertUrlContainsQueryParams(url, {'SecurityGroup.2': 'group2'}) + self.assertUrlContainsQueryParams(url, {"SecurityGroup.1": "group1"}) + self.assertUrlContainsQueryParams(url, {"SecurityGroup.2": "group2"}) - body = self.fixtures.load('run_instances.xml') + body = self.fixtures.load("run_instances.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _ex_security_group_ids_RunInstances(self, method, url, body, headers): - self.assertUrlContainsQueryParams(url, {'SecurityGroupId.1': 'sg-1aa11a1a'}) - self.assertUrlContainsQueryParams(url, {'SecurityGroupId.2': 'sg-2bb22b2b'}) + self.assertUrlContainsQueryParams(url, {"SecurityGroupId.1": "sg-1aa11a1a"}) + self.assertUrlContainsQueryParams(url, {"SecurityGroupId.2": "sg-2bb22b2b"}) - body = self.fixtures.load('run_instances.xml') + body = self.fixtures.load("run_instances.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _create_ex_blockdevicemappings_RunInstances(self, method, url, body, headers): expected_params = { - 'BlockDeviceMapping.1.DeviceName': '/dev/sda1', - 'BlockDeviceMapping.1.Ebs.VolumeSize': '10', - 'BlockDeviceMapping.2.DeviceName': '/dev/sdb', - 'BlockDeviceMapping.2.VirtualName': 'ephemeral0', - 'BlockDeviceMapping.3.DeviceName': '/dev/sdc', - 'BlockDeviceMapping.3.VirtualName': 'ephemeral1' + "BlockDeviceMapping.1.DeviceName": "/dev/sda1", + "BlockDeviceMapping.1.Ebs.VolumeSize": "10", + "BlockDeviceMapping.2.DeviceName": "/dev/sdb", + "BlockDeviceMapping.2.VirtualName": "ephemeral0", + "BlockDeviceMapping.3.DeviceName": "/dev/sdc", + "BlockDeviceMapping.3.VirtualName": "ephemeral1", } self.assertUrlContainsQueryParams(url, expected_params) - body = self.fixtures.load('run_instances.xml') + body = self.fixtures.load("run_instances.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _idempotent_RunInstances(self, method, url, body, headers): - body = self.fixtures.load('run_instances_idem.xml') + body = self.fixtures.load("run_instances_idem.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _idempotent_mismatch_RunInstances(self, method, url, body, headers): - body = self.fixtures.load('run_instances_idem_mismatch.xml') + body = self.fixtures.load("run_instances_idem_mismatch.xml") return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.BAD_REQUEST]) def _ex_iam_profile_RunInstances(self, method, url, body, headers): - body = self.fixtures.load('run_instances_iam_profile.xml') + body = self.fixtures.load("run_instances_iam_profile.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _ex_spot_RunInstances(self, method, url, body, headers): + body = self.fixtures.load("run_instances_spot.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _TerminateInstances(self, method, url, body, headers): - body = self.fixtures.load('terminate_instances.xml') + body = self.fixtures.load("terminate_instances.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeKeyPairs(self, method, url, body, headers): - body = self.fixtures.load('describe_key_pairs.xml') + body = self.fixtures.load("describe_key_pairs.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _get_one_DescribeKeyPairs(self, method, url, body, headers): - self.assertUrlContainsQueryParams(url, {'KeyName': 'gsg-keypair'}) + self.assertUrlContainsQueryParams(url, {"KeyName": "gsg-keypair"}) - body = self.fixtures.load('describe_key_pairs.xml') + body = self.fixtures.load("describe_key_pairs.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _doesnt_exist_DescribeKeyPairs(self, method, url, body, headers): - body = self.fixtures.load('describe_key_pairs_doesnt_exist.xml') - return (httplib.BAD_REQUEST, body, {}, - httplib.responses[httplib.BAD_REQUEST]) + body = self.fixtures.load("describe_key_pairs_doesnt_exist.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.BAD_REQUEST]) def _CreateKeyPair(self, method, url, body, headers): - body = self.fixtures.load('create_key_pair.xml') + body = self.fixtures.load("create_key_pair.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _ImportKeyPair(self, method, url, body, headers): - body = self.fixtures.load('import_key_pair.xml') + body = self.fixtures.load("import_key_pair.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeTags(self, method, url, body, headers): - body = self.fixtures.load('describe_tags.xml') + body = self.fixtures.load("describe_tags.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _CreateTags(self, method, url, body, headers): - body = self.fixtures.load('create_tags.xml') + body = self.fixtures.load("create_tags.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DeleteTags(self, method, url, body, headers): - body = self.fixtures.load('delete_tags.xml') + body = self.fixtures.load("delete_tags.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeAddresses(self, method, url, body, headers): - body = self.fixtures.load('describe_addresses_multi.xml') + body = self.fixtures.load("describe_addresses_multi.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _AllocateAddress(self, method, url, body, headers): - body = self.fixtures.load('allocate_address.xml') + body = self.fixtures.load("allocate_address.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _vpc_AllocateAddress(self, method, url, body, headers): - body = self.fixtures.load('allocate_vpc_address.xml') + body = self.fixtures.load("allocate_vpc_address.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _AssociateAddress(self, method, url, body, headers): - body = self.fixtures.load('associate_address.xml') + body = self.fixtures.load("associate_address.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _vpc_AssociateAddress(self, method, url, body, headers): - body = self.fixtures.load('associate_vpc_address.xml') + params = parse_qs(url.split("?", 1)[1]) + self.assertEqual(["i-4382922a"], params["InstanceId"]) + self.assertNotIn("NetworkInterfaceId", params) + body = self.fixtures.load("associate_vpc_address.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _interface_AssociateAddress(self, method, url, body, headers): + params = parse_qs(url.split("?", 1)[1]) + self.assertEqual(["eni-12345678"], params["NetworkInterfaceId"]) + self.assertNotIn("InstanceId", params) + self.assertIn("AllocationId", params) + self.assertNotIn("PublicIp", params) + body = self.fixtures.load("associate_vpc_address.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DisassociateAddress(self, method, url, body, headers): - body = self.fixtures.load('disassociate_address.xml') + body = self.fixtures.load("disassociate_address.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _ReleaseAddress(self, method, url, body, headers): - body = self.fixtures.load('release_address.xml') + body = self.fixtures.load("release_address.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _all_addresses_DescribeAddresses(self, method, url, body, headers): - body = self.fixtures.load('describe_addresses_all.xml') + body = self.fixtures.load("describe_addresses_all.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _WITH_TAGS_DescribeAddresses(self, method, url, body, headers): - body = self.fixtures.load('describe_addresses_multi.xml') + body = self.fixtures.load("describe_addresses_multi.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _ModifyInstanceAttribute(self, method, url, body, headers): - body = self.fixtures.load('modify_instance_attribute.xml') + body = self.fixtures.load("modify_instance_attribute.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _idempotent_CreateTags(self, method, url, body, headers): - body = self.fixtures.load('create_tags.xml') + def _ModifySnapshotAttribute(self, method, url, body, headers): + body = self.fixtures.load("modify_snapshot_attribute.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _CreateVolume(self, method, url, body, headers): - body = self.fixtures.load('create_volume.xml') + if "KmsKeyId=" in url: + assert "Encrypted=1" in url, ( + "If a KmsKeyId is specified, the " "Encrypted flag must also be set." + ) + if "Encrypted=1" in url: + body = self.fixtures.load("create_encrypted_volume.xml") + else: + body = self.fixtures.load("create_volume.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DeleteVolume(self, method, url, body, headers): - body = self.fixtures.load('delete_volume.xml') + body = self.fixtures.load("delete_volume.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _AttachVolume(self, method, url, body, headers): - body = self.fixtures.load('attach_volume.xml') + body = self.fixtures.load("attach_volume.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DetachVolume(self, method, url, body, headers): - body = self.fixtures.load('detach_volume.xml') + body = self.fixtures.load("detach_volume.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeVolumes(self, method, url, body, headers): - body = self.fixtures.load('describe_volumes.xml') + body = self.fixtures.load("describe_volumes.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _filters_nodes_DescribeVolumes(self, method, url, body, headers): + expected_params = { + "Filter.1.Name": "attachment.instance-id", + "Filter.1.Value.1": "i-d334b4b3", + } + + self.assertUrlContainsQueryParams(url, expected_params) + + body = self.fixtures.load("describe_volumes.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _filters_status_DescribeVolumes(self, method, url, body, headers): + expected_params = {"Filter.1.Name": "status", "Filter.1.Value.1": "available"} + + self.assertUrlContainsQueryParams(url, expected_params) + + body = self.fixtures.load("describe_volumes.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _CreateSnapshot(self, method, url, body, headers): - body = self.fixtures.load('create_snapshot.xml') + body = self.fixtures.load("create_snapshot.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeSnapshots(self, method, url, body, headers): - body = self.fixtures.load('describe_snapshots.xml') + body = self.fixtures.load("describe_snapshots.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DeleteSnapshot(self, method, url, body, headers): - body = self.fixtures.load('delete_snapshot.xml') + body = self.fixtures.load("delete_snapshot.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _CopyImage(self, method, url, body, headers): - body = self.fixtures.load('copy_image.xml') + body = self.fixtures.load("copy_image.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _CreateImage(self, method, url, body, headers): - body = self.fixtures.load('create_image.xml') + body = self.fixtures.load("create_image.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DeregisterImage(self, method, url, body, headers): - body = self.fixtures.load('deregister_image.xml') + body = self.fixtures.load("deregister_image.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DeleteKeyPair(self, method, url, body, headers): - self.assertUrlContainsQueryParams(url, {'KeyName': 'gsg-keypair'}) + self.assertUrlContainsQueryParams(url, {"KeyName": "gsg-keypair"}) - body = self.fixtures.load('delete_key_pair.xml') + body = self.fixtures.load("delete_key_pair.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _ModifyImageAttribute(self, method, url, body, headers): - body = self.fixtures.load('modify_image_attribute.xml') + body = self.fixtures.load("modify_image_attribute.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeAccountAttributes(self, method, url, body, headers): - body = self.fixtures.load('describe_account_attributes.xml') + body = self.fixtures.load("describe_account_attributes.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _CreateSecurityGroup(self, method, url, body, headers): - body = self.fixtures.load('create_security_group.xml') + body = self.fixtures.load("create_security_group.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeVpcs(self, method, url, body, headers): - body = self.fixtures.load('describe_vpcs.xml') + body = self.fixtures.load("describe_vpcs.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _network_ids_DescribeVpcs(self, method, url, body, headers): - expected_params = { - 'VpcId.1': 'vpc-532335e1' - } + expected_params = {"VpcId.1": "vpc-532335e1"} self.assertUrlContainsQueryParams(url, expected_params) - body = self.fixtures.load('describe_vpcs.xml') + body = self.fixtures.load("describe_vpcs.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _filters_DescribeVpcs(self, method, url, body, headers): - expected_params_1 = { - 'Filter.1.Name': 'dhcp-options-id', - 'Filter.1.Value.1': 'dopt-7eded312', - 'Filter.2.Name': 'cidr', - 'Filter.2.Value.1': '192.168.51.0/24' - } - - expected_params_2 = { - 'Filter.1.Name': 'cidr', - 'Filter.1.Value.1': '192.168.51.0/24', - 'Filter.2.Name': 'dhcp-options-id', - 'Filter.2.Value.1': 'dopt-7eded312' + expected_params = { + "Filter.1.Name": "dhcp-options-id", + "Filter.1.Value.1": "dopt-7eded312", + "Filter.2.Name": "cidr", + "Filter.2.Value.1": "192.168.51.0/24", } - try: - self.assertUrlContainsQueryParams(url, expected_params_1) - except AssertionError: - # dict ordering is not guaranteed - self.assertUrlContainsQueryParams(url, expected_params_2) + self.assertUrlContainsQueryParams(url, expected_params) - body = self.fixtures.load('describe_vpcs.xml') + body = self.fixtures.load("describe_vpcs.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _CreateVpc(self, method, url, body, headers): - body = self.fixtures.load('create_vpc.xml') + body = self.fixtures.load("create_vpc.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DeleteVpc(self, method, url, body, headers): - body = self.fixtures.load('delete_vpc.xml') + body = self.fixtures.load("delete_vpc.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeSubnets(self, method, url, body, headers): - body = self.fixtures.load('describe_subnets.xml') + body = self.fixtures.load("describe_subnets.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _CreateSubnet(self, method, url, body, headers): - body = self.fixtures.load('create_subnet.xml') + body = self.fixtures.load("create_subnet.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _ModifySubnetAttribute(self, method, url, body, headers): + body = self.fixtures.load("modify_subnet_attribute.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DeleteSubnet(self, method, url, body, headers): - body = self.fixtures.load('delete_subnet.xml') + body = self.fixtures.load("delete_subnet.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _GetConsoleOutput(self, method, url, body, headers): - body = self.fixtures.load('get_console_output.xml') + body = self.fixtures.load("get_console_output.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeNetworkInterfaces(self, method, url, body, headers): - body = self.fixtures.load('describe_network_interfaces.xml') + body = self.fixtures.load("describe_network_interfaces.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _CreateNetworkInterface(self, method, url, body, headers): - body = self.fixtures.load('create_network_interface.xml') + body = self.fixtures.load("create_network_interface.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DeleteNetworkInterface(self, method, url, body, headers): - body = self.fixtures.load('delete_network_interface.xml') + body = self.fixtures.load("delete_network_interface.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _AttachNetworkInterface(self, method, url, body, headers): - body = self.fixtures.load('attach_network_interface.xml') + body = self.fixtures.load("attach_network_interface.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DetachNetworkInterface(self, method, url, body, headers): - body = self.fixtures.load('detach_network_interface.xml') + body = self.fixtures.load("detach_network_interface.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribeInternetGateways(self, method, url, body, headers): - body = self.fixtures.load('describe_internet_gateways.xml') + body = self.fixtures.load("describe_internet_gateways.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _CreateInternetGateway(self, method, url, body, headers): - body = self.fixtures.load('create_internet_gateway.xml') + body = self.fixtures.load("create_internet_gateway.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DeleteInternetGateway(self, method, url, body, headers): - body = self.fixtures.load('delete_internet_gateway.xml') + body = self.fixtures.load("delete_internet_gateway.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _AttachInternetGateway(self, method, url, body, headers): - body = self.fixtures.load('attach_internet_gateway.xml') + body = self.fixtures.load("attach_internet_gateway.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DetachInternetGateway(self, method, url, body, headers): - body = self.fixtures.load('detach_internet_gateway.xml') + body = self.fixtures.load("detach_internet_gateway.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _CreatePlacementGroup(self, method, url, body, headers): - body = self.fixtures.load('create_placement_groups.xml') + body = self.fixtures.load("create_placement_groups.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DeletePlacementGroup(self, method, url, body, headers): - body = self.fixtures.load('delete_placement_groups.xml') + body = self.fixtures.load("delete_placement_groups.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _DescribePlacementGroups(self, method, url, body, headers): - body = self.fixtures.load('describe_placement_groups.xml') + body = self.fixtures.load("describe_placement_groups.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _ModifyVolume(self, method, url, body, headers): + body = self.fixtures.load("modify_volume.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _DescribeVolumesModifications(self, method, url, body, headers): + body = self.fixtures.load("describe_volumes_modifications.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) class EucMockHttp(EC2MockHttp): - fixtures = ComputeFileFixtures('ec2') + fixtures = ComputeFileFixtures("ec2") - def _services_Eucalyptus_DescribeInstances(self, method, url, body, - headers): + def _services_Eucalyptus_DescribeInstances(self, method, url, body, headers): return self._DescribeInstances(method, url, body, headers) - def _services_Eucalyptus_DescribeImages(self, method, url, body, - headers): + def _services_Eucalyptus_DescribeImages(self, method, url, body, headers): return self._DescribeImages(method, url, body, headers) - def _services_Eucalyptus_DescribeAddresses(self, method, url, body, - headers): + def _services_Eucalyptus_DescribeAddresses(self, method, url, body, headers): return self._DescribeAddresses(method, url, body, headers) - def _services_Eucalyptus_RebootInstances(self, method, url, body, - headers): + def _services_Eucalyptus_RebootInstances(self, method, url, body, headers): return self._RebootInstances(method, url, body, headers) - def _services_Eucalyptus_TerminateInstances(self, method, url, body, - headers): + def _services_Eucalyptus_TerminateInstances(self, method, url, body, headers): return self._TerminateInstances(method, url, body, headers) - def _services_Eucalyptus_RunInstances(self, method, url, body, - headers): + def _services_Eucalyptus_RunInstances(self, method, url, body, headers): return self._RunInstances(method, url, body, headers) - def _services_Eucalyptus_CreateTags(self, method, url, body, - headers): - return self._CreateTags(method, url, body, headers) - - def _services_Eucalyptus_DescribeInstanceTypes(self, method, url, body, - headers): - body = self.fixtures.load('describe_instance_types.xml') + def _services_Eucalyptus_DescribeInstanceTypes(self, method, url, body, headers): + body = self.fixtures.load("describe_instance_types.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) class NimbusTests(EC2Tests): - def setUp(self): - NimbusNodeDriver.connectionCls.conn_classes = (None, EC2MockHttp) - EC2MockHttp.use_param = 'Action' + NimbusNodeDriver.connectionCls.conn_class = EC2MockHttp + EC2MockHttp.use_param = "Action" EC2MockHttp.type = None - self.driver = NimbusNodeDriver(key=EC2_PARAMS[0], secret=EC2_PARAMS[1], - host='some.nimbuscloud.com') + self.driver = NimbusNodeDriver( + key=EC2_PARAMS[0], secret=EC2_PARAMS[1], host="some.nimbuscloud.com" + ) def test_ex_describe_addresses_for_node(self): # overridden from EC2Tests -- Nimbus doesn't support elastic IPs. - node = Node('i-4382922a', None, None, None, None, self.driver) + node = Node("i-4382922a", None, None, None, None, self.driver) ip_addresses = self.driver.ex_describe_addresses_for_node(node) self.assertEqual(len(ip_addresses), 0) def test_ex_describe_addresses(self): # overridden from EC2Tests -- Nimbus doesn't support elastic IPs. - node = Node('i-4382922a', None, None, None, None, self.driver) + node = Node("i-4382922a", None, None, None, None, self.driver) nodes_elastic_ips = self.driver.ex_describe_addresses([node]) self.assertEqual(len(nodes_elastic_ips), 1) @@ -1608,45 +1990,60 @@ def test_list_sizes(self): sizes = self.driver.list_sizes() ids = [s.id for s in sizes] - self.assertTrue('m1.small' in ids) - self.assertTrue('m1.large' in ids) - self.assertTrue('m1.xlarge' in ids) + self.assertTrue("m1.small" in ids) + self.assertTrue("m1.large" in ids) + self.assertTrue("m1.xlarge" in ids) def test_list_nodes(self): # overridden from EC2Tests -- Nimbus doesn't support elastic IPs. node = self.driver.list_nodes()[0] self.assertExecutedMethodCount(0) public_ips = node.public_ips - self.assertEqual(node.id, 'i-4382922a') + self.assertEqual(node.id, "i-4382922a") self.assertEqual(len(node.public_ips), 1) - self.assertEqual(public_ips[0], '1.2.3.4') - self.assertEqual(node.extra['tags'], {}) + self.assertEqual(public_ips[0], "1.2.3.4") + self.assertEqual(node.extra["tags"], {}) node = self.driver.list_nodes()[1] self.assertExecutedMethodCount(0) public_ips = node.public_ips - self.assertEqual(node.id, 'i-8474834a') + self.assertEqual(node.id, "i-8474834a") self.assertEqual(len(node.public_ips), 1) - self.assertEqual(public_ips[0], '1.2.3.5') - self.assertEqual(node.extra['tags'], - {'Name': 'Test Server 2', 'Group': 'VPC Test'}) + self.assertEqual(public_ips[0], "1.2.3.5") + self.assertEqual(node.extra["tags"], {"Name": "Test Server 2", "Group": "VPC Test"}) def test_ex_create_tags(self): # Nimbus doesn't support creating tags so this one should be a # passthrough node = self.driver.list_nodes()[0] - self.driver.ex_create_tags(resource=node, tags={'foo': 'bar'}) + self.driver.ex_create_tags(resource=node, tags={"foo": "bar"}) self.assertExecutedMethodCount(0) + def test_create_volume_snapshot_with_tags(self): + vol = StorageVolume( + id="vol-4282672b", + name="test", + state=StorageVolumeState.AVAILABLE, + size=10, + driver=self.driver, + ) + snap = self.driver.create_volume_snapshot( + vol, "Test snapshot", ex_metadata={"my_tag": "test"} + ) + self.assertDictEqual({}, snap.extra["tags"]) -class EucTests(LibcloudTestCase, TestCaseMixin): +class EucTests(LibcloudTestCase, TestCaseMixin): def setUp(self): - EucNodeDriver.connectionCls.conn_classes = (None, EucMockHttp) - EC2MockHttp.use_param = 'Action' + EucNodeDriver.connectionCls.conn_class = EucMockHttp + EC2MockHttp.use_param = "Action" EC2MockHttp.type = None - self.driver = EucNodeDriver(key=EC2_PARAMS[0], secret=EC2_PARAMS[1], - host='some.eucalyptus.com', api_version='3.4.1') + self.driver = EucNodeDriver( + key=EC2_PARAMS[0], + secret=EC2_PARAMS[1], + host="some.eucalyptus.com", + api_version="3.4.1", + ) def test_list_locations_response(self): try: @@ -1654,7 +2051,7 @@ def test_list_locations_response(self): except Exception: pass else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_list_location(self): pass @@ -1663,41 +2060,39 @@ def test_list_sizes(self): sizes = self.driver.list_sizes() ids = [s.id for s in sizes] self.assertEqual(len(ids), 18) - self.assertTrue('t1.micro' in ids) - self.assertTrue('m1.medium' in ids) - self.assertTrue('m3.xlarge' in ids) + self.assertTrue("t1.micro" in ids) + self.assertTrue("m1.medium" in ids) + self.assertTrue("m3.xlarge" in ids) class OutscaleTests(EC2Tests): - def setUp(self): - OutscaleSASNodeDriver.connectionCls.conn_classes = (None, EC2MockHttp) - EC2MockHttp.use_param = 'Action' + OutscaleSASNodeDriver.connectionCls.conn_class = EC2MockHttp + EC2MockHttp.use_param = "Action" EC2MockHttp.type = None - self.driver = OutscaleSASNodeDriver(key=EC2_PARAMS[0], - secret=EC2_PARAMS[1], - host='some.outscalecloud.com') + self.driver = OutscaleSASNodeDriver( + key=EC2_PARAMS[0], secret=EC2_PARAMS[1], host="some.outscalecloud.com" + ) def test_ex_create_network(self): # overridden from EC2Tests -- Outscale don't support instance_tenancy - vpc = self.driver.ex_create_network('192.168.55.0/24', - name='Test VPC') + vpc = self.driver.ex_create_network("192.168.55.0/24", name="Test VPC") - self.assertEqual('vpc-ad3527cf', vpc.id) - self.assertEqual('192.168.55.0/24', vpc.cidr_block) - self.assertEqual('pending', vpc.extra['state']) + self.assertEqual("vpc-ad3527cf", vpc.id) + self.assertEqual("192.168.55.0/24", vpc.cidr_block) + self.assertEqual("pending", vpc.extra["state"]) def test_ex_copy_image(self): # overridden from EC2Tests -- Outscale does not support copying images image = self.driver.list_images()[0] try: - self.driver.ex_copy_image('us-east-1', image, - name='Faux Image', - description='Test Image Copy') + self.driver.ex_copy_image( + "us-east-1", image, name="Faux Image", description="Test Image Copy" + ) except NotImplementedError: pass else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_ex_get_limits(self): # overridden from EC2Tests -- Outscale does not support getting limits @@ -1706,20 +2101,19 @@ def test_ex_get_limits(self): except NotImplementedError: pass else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_ex_create_network_interface(self): # overridden from EC2Tests -- Outscale don't allow creating interfaces subnet = self.driver.ex_list_subnets()[0] try: self.driver.ex_create_network_interface( - subnet, - name='Test Interface', - description='My Test') + subnet, name="Test Interface", description="My Test" + ) except NotImplementedError: pass else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_ex_delete_network_interface(self): # overridden from EC2Tests -- Outscale don't allow deleting interfaces @@ -1729,7 +2123,7 @@ def test_ex_delete_network_interface(self): except NotImplementedError: pass else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_ex_attach_network_interface_to_node(self): # overridden from EC2Tests -- Outscale don't allow attaching interfaces @@ -1740,25 +2134,117 @@ def test_ex_attach_network_interface_to_node(self): except NotImplementedError: pass else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_ex_detach_network_interface(self): # overridden from EC2Tests -- Outscale don't allow detaching interfaces try: - self.driver.ex_detach_network_interface('eni-attach-2b588b47') + self.driver.ex_detach_network_interface("eni-attach-2b588b47") except NotImplementedError: pass else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_list_sizes(self): sizes = self.driver.list_sizes() ids = [s.id for s in sizes] - self.assertTrue('m1.small' in ids) - self.assertTrue('m1.large' in ids) - self.assertTrue('m1.xlarge' in ids) + self.assertTrue("m1.small" in ids) + self.assertTrue("m1.large" in ids) + self.assertTrue("m1.xlarge" in ids) + + def test_ex_create_node_with_ex_iam_profile(self): + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + + self.assertRaises( + NotImplementedError, + self.driver.create_node, + name="foo", + image=image, + size=size, + ex_iamprofile="foo", + ) + + def test_create_node_with_ex_userdata(self): + EC2MockHttp.type = "ex_user_data" + + image = NodeImage(id="ami-be3adfd7", name=self.image_name, driver=self.driver) + size = NodeSize("m1.small", "Small Instance", None, None, None, None, driver=self.driver) + + result = self.driver.create_node( + name="foo", image=image, size=size, ex_userdata="foo\nbar\foo" + ) + self.assertTrue(result) -if __name__ == '__main__': +class FCUMockHttp(EC2MockHttp): + fixtures = ComputeFileFixtures("fcu") + + def _DescribeQuotas(self, method, url, body, headers): + body = self.fixtures.load("ex_describe_quotas.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _DescribeProductTypes(self, method, url, body, headers): + body = self.fixtures.load("ex_describe_product_types.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _DescribeInstanceTypes(self, method, url, body, headers): + body = self.fixtures.load("ex_describe_instance_types.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _GetProductType(self, method, url, body, headers): + body = self.fixtures.load("ex_get_product_type.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _ModifyInstanceKeypair(self, method, url, body, headers): + body = self.fixtures.load("ex_modify_instance_keypair.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +class OutscaleFCUTests(LibcloudTestCase): + def setUp(self): + OutscaleSASNodeDriver.connectionCls.conn_class = FCUMockHttp + EC2MockHttp.use_param = "Action" + EC2MockHttp.type = None + self.driver = OutscaleSASNodeDriver( + key=EC2_PARAMS[0], secret=EC2_PARAMS[1], host="some.fcucloud.com" + ) + + def test_ex_describe_quotas(self): + is_truncated, quota = self.driver.ex_describe_quotas() + self.assertTrue(is_truncated == "true") + self.assertTrue("global" in quota.keys()) + self.assertTrue("vpc-00000000" in quota.keys()) + + def test_ex_describe_product_types(self): + product_types = self.driver.ex_describe_product_types() + pt = {} + for e in product_types: + pt[e["productTypeId"]] = e["description"] + self.assertTrue("0001" in pt.keys()) + self.assertTrue("MapR" in pt.values()) + self.assertTrue(pt["0002"] == "Windows") + + def test_ex_describe_instance_instance_types(self): + instance_types = self.driver.ex_describe_instance_types() + it = {} + for e in instance_types: + it[e["name"]] = e["memory"] + self.assertTrue("og4.4xlarge" in it.keys()) + self.assertTrue("oc2.8xlarge" in it.keys()) + self.assertTrue("68718428160" in it.values()) + self.assertTrue(it["m3.large"] == "8050966528") + + def test_ex_get_product_type(self): + product_type = self.driver.ex_get_product_type("ami-29ab9e54") + self.assertTrue(product_type["productTypeId"] == "0002") + self.assertTrue(product_type["description"] == "Windows") + + def test_ex_modify_instance_keypair(self): + r = self.driver.ex_modify_instance_keypair("i-57292bc5", "key_name") + self.assertTrue(r) + + +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_ecp.py b/libcloud/test/compute/test_ecp.py deleted file mode 100644 index c39875c5a8..0000000000 --- a/libcloud/test/compute/test_ecp.py +++ /dev/null @@ -1,131 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import sys -import unittest -from libcloud.utils.py3 import httplib - -from libcloud.compute.drivers.ecp import ECPNodeDriver -from libcloud.compute.types import NodeState - -from libcloud.test import MockHttp -from libcloud.test.compute import TestCaseMixin -from libcloud.test.file_fixtures import ComputeFileFixtures - -from libcloud.test.secrets import ECP_PARAMS - - -class ECPTests(unittest.TestCase, TestCaseMixin): - - def setUp(self): - ECPNodeDriver.connectionCls.conn_classes = (None, - ECPMockHttp) - self.driver = ECPNodeDriver(*ECP_PARAMS) - - def test_list_nodes(self): - nodes = self.driver.list_nodes() - self.assertEqual(len(nodes), 2) - node = nodes[0] - self.assertEqual(node.id, '1') - self.assertEqual(node.name, 'dummy-1') - self.assertEqual(node.public_ips[0], "42.78.124.75") - self.assertEqual(node.state, NodeState.RUNNING) - - def test_list_sizes(self): - sizes = self.driver.list_sizes() - self.assertEqual(len(sizes), 3) - size = sizes[0] - self.assertEqual(size.id, '1') - self.assertEqual(size.ram, 512) - self.assertEqual(size.disk, 0) - self.assertEqual(size.bandwidth, 0) - self.assertEqual(size.price, 0) - - def test_list_images(self): - images = self.driver.list_images() - self.assertEqual(len(images), 2) - self.assertEqual( - images[0].name, "centos54: AUTO import from /opt/enomalism2/repo/5d407a68-c76c-11de-86e5-000475cb7577.xvm2") - self.assertEqual(images[0].id, "1") - - name = "centos54 two: AUTO import from /opt/enomalism2/repo/5d407a68-c76c-11de-86e5-000475cb7577.xvm2" - self.assertEqual(images[1].name, name) - self.assertEqual(images[1].id, "2") - - def test_reboot_node(self): - # Raises exception on failure - node = self.driver.list_nodes()[0] - self.driver.reboot_node(node) - - def test_destroy_node(self): - # Raises exception on failure - node = self.driver.list_nodes()[0] - self.driver.destroy_node(node) - - def test_create_node(self): - # Raises exception on failure - size = self.driver.list_sizes()[0] - image = self.driver.list_images()[0] - node = self.driver.create_node( - name="api.ivan.net.nz", image=image, size=size) - self.assertEqual(node.name, "api.ivan.net.nz") - self.assertEqual(node.id, "1234") - - -class ECPMockHttp(MockHttp): - - fixtures = ComputeFileFixtures('ecp') - - def _modules_hosting(self, method, url, body, headers): - headers = {} - headers['set-cookie'] = 'vcloud-token=testtoken' - body = 'Anything' - return (httplib.OK, body, headers, httplib.responses[httplib.OK]) - - def _rest_hosting_vm_1(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('vm_1_get.json') - if method == 'POST': - if body.find('delete', 0): - body = self.fixtures.load('vm_1_action_delete.json') - if body.find('stop', 0): - body = self.fixtures.load('vm_1_action_stop.json') - if body.find('start', 0): - body = self.fixtures.load('vm_1_action_start.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _rest_hosting_vm(self, method, url, body, headers): - if method == 'PUT': - body = self.fixtures.load('vm_put.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _rest_hosting_vm_list(self, method, url, body, headers): - body = self.fixtures.load('vm_list.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _rest_hosting_htemplate_list(self, method, url, body, headers): - body = self.fixtures.load('htemplate_list.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _rest_hosting_network_list(self, method, url, body, headers): - body = self.fixtures.load('network_list.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _rest_hosting_ptemplate_list(self, method, url, body, headers): - body = self.fixtures.load('ptemplate_list.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_ecs.py b/libcloud/test/compute/test_ecs.py new file mode 100644 index 0000000000..6de84ec783 --- /dev/null +++ b/libcloud/test/compute/test_ecs.py @@ -0,0 +1,1059 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest + +from libcloud.test import MockHttp, LibcloudTestCase +from libcloud.utils.py3 import httplib +from libcloud.common.types import LibcloudError +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeLocation, + StorageVolume, + VolumeSnapshot, + NodeAuthPassword, +) +from libcloud.test.secrets import ECS_PARAMS +from libcloud.compute.types import NodeState, StorageVolumeState +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.ecs import ECSDriver + + +class ECSDriverTestCase(LibcloudTestCase): + region = "cn-qingdao" + zone = "cn-qingdao-b" + image_id = "ubuntu1404_64_20G_aliaegis_20150325.vhd" + + def setUp(self): + ECSMockHttp.test = self + ECSDriver.connectionCls.conn_class = ECSMockHttp + ECSMockHttp.use_param = "Action" + ECSMockHttp.type = None + + self.driver = ECSDriver(*ECS_PARAMS, region=self.region) + self.fake_size = NodeSize( + "ecs.t1.small", "ecs t1 small", None, None, None, None, self.driver + ) + self.fake_image = NodeImage(self.image_id, name="ubuntu 14.04 64bit", driver=self.driver) + self.fake_node = Node( + id="fake-node1", + name="fake-node", + state=NodeState.RUNNING, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + self.fake_volume = StorageVolume( + id="fake-volume1", + name="fake-volume", + size=self.fake_size, + driver=self.driver, + ) + self.fake_snapshot = VolumeSnapshot(id="fake-snapshot1", driver=self.driver) + self.fake_location = NodeLocation( + id=self.region, name=self.region, country=None, driver=self.driver + ) + self.fake_instance_id = "fake_instance_id" + self.fake_security_group_id = "fake_security_group_id" + + def test_list_nodes(self): + # the test describes two nodes: + # the first on a classic network and with public ip attached + # the second on a vpc with an elastic ip attached + vpc_ips = [None, "10.163.197.74"] + eips = ["", "114.215.124.73"] + nodes = self.driver.list_nodes() + self.assertIsNotNone(nodes) + self.assertEqual(2, len(nodes)) + for node, vpc_ip, eip in zip(nodes, vpc_ips, eips): + self.assertEqual("iZ28n7dkvovZ", node.name) + self.assertEqual("i-28n7dkvov", node.id) + self.assertEqual(NodeState.PENDING, node.state) + self.assertEqual(1, len(node.public_ips)) + self.assertEqual("114.215.124.73", node.public_ips[0]) + self.assertEqual(1, len(node.private_ips)) + self.assertEqual("10.163.197.74", node.private_ips[0]) + expected_extra = { + "image_id": "ubuntu1404_64_20G_aliaegis_20150325.vhd", + "description": "", + "instance_type_family": "ecs.t1", + "zone_id": "cn-qingdao-b", + "internet_charge_type": "PayByTraffic", + "serial_number": "ca0122d9-374d-4fce-9fc0-71f7c3eaf1c3", + "io_optimized": "false", + "device_available": "true", + "instance_network_type": "classic", + "hostname": "iZ28n7dkvovZ", + "instance_type": "ecs.t1.small", + "creation_time": "2015-12-27T07:35Z", + "instance_charge_type": "PostPaid", + "expired_time": "2999-09-08T16:00Z", + } + self._validate_extras(expected_extra, node.extra) + vpc = { + "vpc_id": "", + "vswitch_id": "", + "private_ip_address": vpc_ip, + "nat_ip_address": "", + } + self._validate_extras(vpc, node.extra["vpc_attributes"]) + eip_address = { + "allocation_id": "", + "ip_address": eip, + "internet_charge_type": "", + "bandwidth": None, + } + self._validate_extras(eip_address, node.extra["eip_address"]) + self.assertIsNone(node.extra["operation_locks"]["lock_reason"]) + + def test_list_nodes_with_ex_node_ids(self): + ECSMockHttp.type = "list_nodes_ex_node_ids" + nodes = self.driver.list_nodes(ex_node_ids=["i-28n7dkvov", "not-existed-id"]) + self.assertIsNotNone(nodes) + + def test_list_nodes_with_ex_filters(self): + ECSMockHttp.type = "list_nodes_ex_filters" + nodes = self.driver.list_nodes(ex_filters={"ZoneId": self.zone}) + self.assertIsNotNone(nodes) + + def _validate_extras(self, expected, actual): + self.assertIsNotNone(actual) + for key, value in iter(expected.items()): + self.assertTrue(key in actual) + self.assertEqual( + value, + actual[key], + ( + "extra %(key)s not equal, " + 'expected: "%(expected)s", ' + 'actual: "%(actual)s"' % {"key": key, "expected": value, "actual": actual[key]} + ), + ) + + def test_create_node(self): + ECSMockHttp.type = "create_node" + name = "test_create_node" + node = self.driver.create_node( + name=name, + image=self.fake_image, + size=self.fake_size, + ex_security_group_id="sg-28ou0f3xa", + ex_description="description", + ex_internet_charge_type="PayByTraffic", + ex_internet_max_bandwidth_out=1, + ex_internet_max_bandwidth_in=200, + ex_hostname="hostname", + auth=NodeAuthPassword("password"), + ex_io_optimized=True, + ex_system_disk={ + "category": "cloud", + "disk_name": "root", + "description": "sys", + }, + ex_vswitch_id="vswitch-id1", + ex_private_ip_address="1.1.1.2", + ex_client_token="client_token", + ) + self.assertIsNotNone(node) + + def test_create_node_with_data_disk(self): + ECSMockHttp.type = "create_node_with_data" + self.name = "test_create_node" + self.data_disk = { + "size": 5, + "category": self.driver.disk_categories.CLOUD, + "disk_name": "data1", + "description": "description", + "device": "/dev/xvdb", + "delete_with_instance": True, + } + node = self.driver.create_node( + name=self.name, + image=self.fake_image, + size=self.fake_size, + ex_security_group_id="sg-28ou0f3xa", + ex_data_disks=self.data_disk, + ) + self.assertIsNotNone(node) + + def test_list_sizes(self): + sizes = self.driver.list_sizes() + self.assertEqual(2, len(sizes)) + size = sizes[0] + self.assertEqual("ecs.t1.xsmall", size.id) + self.assertEqual("ecs.t1.xsmall", size.name) + self.assertEqual(0.5, size.ram) + self.assertEqual(1, size.extra["cpu_core_count"]) + self.assertEqual("ecs.t1", size.extra["instance_type_family"]) + size = sizes[1] + self.assertEqual("ecs.s2.small", size.id) + self.assertEqual("ecs.s2.small", size.name) + self.assertEqual(1.0, size.ram) + self.assertEqual(2, size.extra["cpu_core_count"]) + self.assertEqual("ecs.s2", size.extra["instance_type_family"]) + + def test_list_locations(self): + locations = self.driver.list_locations() + self.assertEqual(9, len(locations)) + location = locations[0] + self.assertEqual("ap-southeast-1", location.id) + self.assertIsNone(location.country) + + def test_create_node_without_sg_id_exception(self): + name = "test_create_node_without_sg_id_exception" + self.assertRaises( + AttributeError, + self.driver.create_node, + name=name, + image=self.fake_image, + size=self.fake_size, + ) + + def test_creat_node_paybytraffic_exception(self): + name = "test_create_node_paybytraffic_exception" + self.assertRaises( + AttributeError, + self.driver.create_node, + name=name, + image=self.fake_image, + size=self.fake_size, + ex_security_group_id="sg-id1", + ex_internet_charge_type="PayByTraffic", + ) + + def test_create_node_ex_system_disk_exception(self): + name = "test_creat_node_ex_system_disk_exception" + self.assertRaises( + AttributeError, + self.driver.create_node, + name=name, + image=self.fake_image, + size=self.fake_size, + ex_security_group_id="sg-id1", + ex_system_disk=None, + ) + + def test_create_node_ex_private_ip_address_exception(self): + name = "test_create_node_ex_private_ip_address_exception" + self.assertRaises( + AttributeError, + self.driver.create_node, + name=name, + image=self.fake_image, + size=self.fake_size, + ex_security_group_id="sg-id1", + ex_private_ip_address="1.1.1.2", + ) + + def test_reboot_node(self): + ECSMockHttp.type = "reboot_node" + result = self.driver.reboot_node(self.fake_node) + self.assertTrue(result) + + def test_reboot_node_with_ex_force_stop(self): + ECSMockHttp.type = "reboot_node_force_stop" + result = self.driver.reboot_node(self.fake_node, ex_force_stop=True) + self.assertTrue(result) + + def test_destroy_node(self): + ECSMockHttp.type = "destroy_node" + result = self.driver.destroy_node(self.fake_node) + self.assertTrue(result) + + def test_ex_start_node(self): + ECSMockHttp.type = "start_node" + result = self.driver.ex_start_node(self.fake_node) + self.assertTrue(result) + + def test_ex_stop_node(self): + ECSMockHttp.type = "stop_node" + result = self.driver.ex_stop_node(self.fake_node) + self.assertTrue(result) + + def test_stop_node_with_ex_force_stop(self): + ECSMockHttp.type = "stop_node_force_stop" + result = self.driver.ex_stop_node(self.fake_node, ex_force_stop=True) + self.assertTrue(result) + + def test_create_public_ip(self): + ECSMockHttp.type = "create_public_ip" + result = self.driver.create_public_ip(self.fake_instance_id) + self.assertTrue(result) + + def test_list_volumes(self): + volumes = self.driver.list_volumes() + self.assertEqual(2, len(volumes)) + volume = volumes[0] + self.assertEqual("d-28m5zbua0", volume.id) + self.assertEqual("", volume.name) + self.assertEqual(5, volume.size) + self.assertEqual(StorageVolumeState.AVAILABLE, volume.state) + expected_extras = { + "region_id": "cn-qingdao", + "zone_id": "cn-qingdao-b", + "description": "", + "type": "data", + "category": "cloud", + "image_id": "", + "source_snapshot_id": "", + "product_code": "", + "portable": True, + "instance_id": "", + "device": "", + "delete_with_instance": False, + "enable_auto_snapshot": False, + "creation_time": "2014-07-23T02:44:07Z", + "attached_time": "2014-07-23T07:47:35Z", + "detached_time": "2014-07-23T08:28:48Z", + "disk_charge_type": "PostPaid", + "operation_locks": {"lock_reason": None}, + } + self._validate_extras(expected_extras, volume.extra) + volume = volumes[1] + self.assertEqual("d-28zfrmo13", volume.id) + self.assertEqual("ubuntu1404sys", volume.name) + self.assertEqual(5, volume.size) + self.assertEqual(StorageVolumeState.INUSE, volume.state) + expected_extras = { + "region_id": "cn-qingdao", + "zone_id": "cn-qingdao-b", + "description": "Description", + "type": "system", + "category": "cloud", + "image_id": "ubuntu1404_64_20G_aliaegis_20150325.vhd", + "source_snapshot_id": "", + "product_code": "", + "portable": False, + "instance_id": "i-28whl2nj2", + "device": "/dev/xvda", + "delete_with_instance": True, + "enable_auto_snapshot": True, + "creation_time": "2014-07-23T02:44:06Z", + "attached_time": "2016-01-04T15:02:17Z", + "detached_time": "", + "disk_charge_type": "PostPaid", + "operation_locks": {"lock_reason": None}, + } + self._validate_extras(expected_extras, volume.extra) + + def test_list_volumes_with_ex_volume_ids(self): + ECSMockHttp.type = "list_volumes_ex_volume_ids" + volumes = self.driver.list_volumes(ex_volume_ids=["i-28n7dkvov", "not-existed-id"]) + self.assertIsNotNone(volumes) + + def test_list_volumes_with_ex_filters(self): + ECSMockHttp.type = "list_volumes_ex_filters" + ex_filters = {"InstanceId": self.fake_node.id} + volumes = self.driver.list_volumes(ex_filters=ex_filters) + self.assertIsNotNone(volumes) + + def test_list_volume_snapshots(self): + snapshots = self.driver.list_volume_snapshots(self.fake_volume) + self.assertEqual(1, len(snapshots)) + + def test_list_volume_snapshots_with_ex_snapshot_ids(self): + ECSMockHttp.type = "list_volume_snapshots_ex_snapshot_ids" + ex_snapshot_ids = ["fake-snapshot1"] + self.driver.list_volume_snapshots(self.fake_volume, ex_snapshot_ids=ex_snapshot_ids) + + def test_list_volume_snapshots_with_ex_filters(self): + ECSMockHttp.type = "list_volume_snapshots_ex_filters" + ex_filters = {"InstanceId": self.fake_node.id} + self.driver.list_volume_snapshots(self.fake_volume, ex_filters=ex_filters) + + def test_create_volume(self): + ECSMockHttp.type = "create_volume" + self.volume_size = 1 + self.volume_name = "fake-volume-name" + self.description = "fake-description" + self.disk_category = "system" + self.client_token = "client_token" + volume = self.driver.create_volume( + self.volume_size, + self.volume_name, + snapshot=self.fake_snapshot, + ex_zone_id=self.zone, + ex_description=self.description, + ex_disk_category=self.disk_category, + ex_client_token=self.client_token, + ) + self.assertIsNotNone(volume) + + def test_create_volume_without_ex_zone_id_exception(self): + self.assertRaises(AttributeError, self.driver.create_volume, 1, "fake-volume-name") + + def test_create_volume_snapshot(self): + ECSMockHttp.type = "create_volume_snapshot" + self.snapshot_name = "fake-snapshot1" + self.description = "fake-description" + self.client_token = "client-token" + snapshot = self.driver.create_volume_snapshot( + self.fake_volume, + name=self.snapshot_name, + ex_description=self.description, + ex_client_token=self.client_token, + ) + self.assertIsNotNone(snapshot) + + def test_attach_volume(self): + self.device = "/dev/sdb" + self.delete_with_instance = True + attached = self.driver.attach_volume( + self.fake_node, + self.fake_volume, + device=self.device, + ex_delete_with_instance=self.delete_with_instance, + ) + self.assertTrue(attached) + + def test_detach_volume(self): + self.instance_id = "fake-node1" + result = self.driver.detach_volume(self.fake_volume, ex_instance_id=self.instance_id) + self.assertTrue(result) + + def test_detach_volume_query_instance_id(self): + ECSMockHttp.type = "detach_volume" + result = self.driver.detach_volume(self.fake_volume) + self.assertTrue(result) + + def test_detach_volume_query_instance_id_exception(self): + self.assertRaises(AttributeError, self.driver.detach_volume, self.fake_volume) + + def test_destroy_volume(self): + ECSMockHttp.type = "destroy_volume" + result = self.driver.destroy_volume(self.fake_volume) + self.assertTrue(result) + + def test_destroy_volume_query_volumes_exception(self): + self.assertRaises(LibcloudError, self.driver.destroy_volume, self.fake_volume) + + def test_destroy_volume_state_exception(self): + ECSMockHttp.type = "destroy_volume_state" + self.assertRaises(LibcloudError, self.driver.destroy_volume, self.fake_volume) + + def test_destroy_volume_snapshot(self): + result = self.driver.destroy_volume_snapshot(self.fake_snapshot) + self.assertTrue(result) + + def test_destroy_volume_snapshot_exception(self): + self.assertRaises(AttributeError, self.driver.destroy_volume_snapshot, self.fake_volume) + + def test_list_images(self): + images = self.driver.list_images(self.fake_location) + self.assertEqual(1, len(images)) + image = images[0] + self.assertEqual("freebsd1001_64_20G_aliaegis_20150527.vhd", image.id) + self.assertEqual("freebsd1001_64_20G_aliaegis_20150527.vhd", image.name) + expected_extra = { + "image_version": "1.0.0", + "os_type": "linux", + "platform": "Freebsd", + "architecture": "x86_64", + "description": "freebsd1001_64_20G_aliaegis_20150527.vhd", + "size": 20, + "image_owner_alias": "system", + "os_name": "FreeBSD 10.1 64位", + "product_code": "", + "is_subscribed": False, + "progress": "100%", + "creation_time": "2015-06-19T07:25:42Z", + "usage": "instance", + "is_copied": False, + } + self._validate_extras(expected_extra, image.extra) + expected_dev_mappings = { + "snapshot_id": "", + "size": 20, + "device": "/dev/xvda", + "format": "", + "import_oss_bucket": "", + "import_oss_object": "", + } + self._validate_extras(expected_dev_mappings, image.extra["disk_device_mappings"]) + + def test_list_images_with_ex_image_ids(self): + ECSMockHttp.type = "list_images_ex_image_ids" + self.driver.list_images( + location=self.fake_location, + ex_image_ids=[self.fake_image.id, "not-existed"], + ) + + def test_list_images_with_ex_image_ids_type_exception(self): + self.assertRaises( + AttributeError, + self.driver.list_images, + location=self.fake_location, + ex_image_ids={"image_ids": "id1,id2"}, + ) + + def test_list_images_with_ex_filters(self): + ECSMockHttp.type = "list_images_ex_filters" + ex_filters = {"Status": "Available"} + self.driver.list_images(location=self.fake_location, ex_filters=ex_filters) + + def test_list_images_multiple_pages(self): + ECSMockHttp.type = "list_images_pages" + images = self.driver.list_images() + self.assertEqual(2, len(images)) + + def test_create_image(self): + self.image_name = "fake-image1" + self.description = "description" + self.image_version = "1.0.0" + self.client_token = "client_token" + image = self.driver.create_image( + None, + self.image_name, + self.description, + ex_snapshot_id=self.fake_snapshot.id, + ex_image_version=self.image_version, + ex_client_token=self.client_token, + ) + self.assertIsNotNone(image) + + def test_creaet_image_exception(self): + self.assertRaises(AttributeError, self.driver.create_image, None, None) + + def test_delete_image(self): + result = self.driver.delete_image(self.fake_image) + self.assertTrue(result) + + def test_get_image(self): + ECSMockHttp.type = "get_image" + image = self.driver.get_image(self.fake_image.id) + self.assertIsNotNone(image) + + def test_get_image_not_found_exception(self): + ECSMockHttp.type = "get_image_not_found" + self.assertRaises(LibcloudError, self.driver.get_image, self.fake_image.id) + + def test_copy_image(self): + self.image_name = "copied-image1" + self.description = "description" + self.dest_region = "cn-hangzhou" + self.client_token = "client-token" + image = self.driver.copy_image( + self.region, + self.fake_image, + self.image_name, + description=self.description, + ex_destination_region_id=self.dest_region, + ex_client_token=self.client_token, + ) + self.assertIsNotNone(image) + + def test_copy_image_in_the_same_region(self): + ECSMockHttp.type = "copy_image_same_region" + image = self.driver.copy_image(self.region, self.fake_image, None) + self.assertIsNotNone(image) + + def test_ex_create_security_group(self): + self.sg_description = "description" + self.client_token = "client-token" + sg_id = self.driver.ex_create_security_group( + description=self.sg_description, client_token=self.client_token + ) + self.assertEqual("sg-F876FF7BA", sg_id) + + def test_ex_list_security_groups(self): + sgs = self.driver.ex_list_security_groups() + self.assertEqual(1, len(sgs)) + sg = sgs[0] + self.assertEqual("sg-28ou0f3xa", sg.id) + self.assertEqual("sg-28ou0f3xa", sg.name) + self.assertEqual("System created security group.", sg.description) + self.assertEqual("", sg.vpc_id) + self.assertEqual("2015-06-26T08:35:30Z", sg.creation_time) + + def test_ex_join_security_group(self): + result = self.driver.ex_join_security_group( + self.fake_node, group_id=self.fake_security_group_id + ) + self.assertTrue(result) + + def test_ex_leave_security_group(self): + result = self.driver.ex_leave_security_group( + self.fake_node, group_id=self.fake_security_group_id + ) + self.assertTrue(result) + + def test_ex_delete_security_group_by_id(self): + result = self.driver.ex_delete_security_group_by_id(group_id=self.fake_security_group_id) + self.assertTrue(result) + + def test_ex_modify_security_group_by_id(self): + self.sg_name = "name" + self.sg_description = "description" + result = self.driver.ex_modify_security_group_by_id( + group_id=self.fake_security_group_id, + name=self.sg_name, + description=self.sg_description, + ) + self.assertTrue(result) + + def test_ex_list_security_groups_with_ex_filters(self): + ECSMockHttp.type = "list_sgs_filters" + self.vpc_id = "vpc1" + ex_filters = {"VpcId": self.vpc_id} + sgs = self.driver.ex_list_security_groups(ex_filters=ex_filters) + self.assertEqual(1, len(sgs)) + + def test_ex_list_security_group_attributes(self): + self.sga_nictype = "internet" + sgas = self.driver.ex_list_security_group_attributes( + group_id=self.fake_security_group_id, nic_type=self.sga_nictype + ) + self.assertEqual(1, len(sgas)) + sga = sgas[0] + self.assertEqual("ALL", sga.ip_protocol) + self.assertEqual("-1/-1", sga.port_range) + self.assertEqual("Accept", sga.policy) + self.assertEqual("internet", sga.nic_type) + + def test_ex_list_zones(self): + zones = self.driver.ex_list_zones() + self.assertEqual(1, len(zones)) + zone = zones[0] + self.assertEqual("cn-qingdao-b", zone.id) + self.assertEqual(self.driver, zone.driver) + self.assertEqual("青岛可用区B", zone.name) + self.assertIsNotNone(zone.available_resource_types) + self.assertEqual("IoOptimized", zone.available_resource_types[0]) + self.assertIsNotNone(zone.available_instance_types) + self.assertEqual("ecs.m2.medium", zone.available_instance_types[0]) + self.assertIsNotNone(zone.available_disk_categories) + self.assertEqual("cloud_ssd", zone.available_disk_categories[0]) + + +class ECSMockHttp(MockHttp): + fixtures = ComputeFileFixtures("ecs") + + def _DescribeInstances(self, method, url, body, headers): + resp_body = self.fixtures.load("describe_instances.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _list_nodes_ex_node_ids_DescribeInstances(self, method, url, body, headers): + params = {"InstanceIds": '["i-28n7dkvov", "not-existed-id"]'} + self.assertUrlContainsQueryParams(url, params) + return self._DescribeInstances(method, url, body, headers) + + def _list_nodes_ex_filters_DescribeInstances(self, method, url, body, headers): + params = {"ZoneId": self.test.zone} + self.assertUrlContainsQueryParams(url, params) + return self._DescribeInstances(method, url, body, headers) + + def _DescribeInstanceTypes(self, method, url, body, headers): + resp_body = self.fixtures.load("describe_instance_types.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _DescribeRegions(self, method, url, body, headers): + resp_body = self.fixtures.load("describe_regions.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _create_node_CreateInstance(self, method, url, body, headers): + params = { + "SecurityGroupId": "sg-28ou0f3xa", + "Description": "description", + "InternetChargeType": "PayByTraffic", + "InternetMaxBandwidthOut": "1", + "InternetMaxBandwidthIn": "200", + "HostName": "hostname", + "Password": "password", + "IoOptimized": "optimized", + "SystemDisk.Category": "cloud", + "SystemDisk.DiskName": "root", + "SystemDisk.Description": "sys", + "VSwitchId": "vswitch-id1", + "PrivateIpAddress": "1.1.1.2", + "ClientToken": "client_token", + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("create_instance.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _create_node_DescribeInstances(self, method, url, body, headers): + resp_body = self.fixtures.load("create_node_describe_instances.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _create_node_StartInstance(self, method, url, body, headers): + resp_body = self.fixtures.load("start_instance.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _create_node_with_data_CreateInstance(self, method, url, body, headers): + params = { + "SecurityGroupId": "sg-28ou0f3xa", + "DataDisk.1.Size": "5", + "DataDisk.1.Category": "cloud", + "DataDisk.1.DiskName": "data1", + "DataDisk.1.Description": "description", + "DataDisk.1.Device": "/dev/xvdb", + "DataDisk.1.DeleteWithInstance": "true", + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("create_instance.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _create_node_with_data_DescribeInstances(self, method, url, body, headers): + resp_body = self.fixtures.load("create_node_describe_instances.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _create_node_with_data_StartInstance(self, method, url, body, headers): + resp_body = self.fixtures.load("start_instance.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _reboot_node_RebootInstance(self, method, url, body, headers): + node_id = self.test.fake_node.id + self.assertUrlContainsQueryParams(url, {"InstanceId": node_id, "ForceStop": "false"}) + resp_body = self.fixtures.load("reboot_instance.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _reboot_node_DescribeInstances(self, method, url, body, headers): + resp_body = self.fixtures.load("reboot_node_describe_instances.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _reboot_node_force_stop_RebootInstance(self, method, url, body, headers): + node_id = self.test.fake_node.id + self.assertUrlContainsQueryParams(url, {"InstanceId": node_id, "ForceStop": "true"}) + resp_body = self.fixtures.load("reboot_instance.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _reboot_node_force_stop_DescribeInstances(self, method, url, body, headers): + resp_body = self.fixtures.load("reboot_node_describe_instances.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _destroy_node_DescribeInstances(self, method, url, body, headers): + resp_body = self.fixtures.load("destroy_node_describe_instances.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _destroy_node_DeleteInstance(self, method, url, body, headers): + node_id = self.test.fake_node.id + self.assertUrlContainsQueryParams(url, {"InstanceId": node_id}) + resp_body = self.fixtures.load("delete_instance.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _start_node_StartInstance(self, method, url, body, headers): + node_id = self.test.fake_node.id + self.assertUrlContainsQueryParams(url, {"InstanceId": node_id}) + resp_body = self.fixtures.load("start_instance.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _start_node_DescribeInstances(self, method, url, body, headers): + resp_body = self.fixtures.load("reboot_node_describe_instances.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _stop_node_StopInstance(self, method, url, body, headers): + node_id = self.test.fake_node.id + self.assertUrlContainsQueryParams(url, {"InstanceId": node_id, "ForceStop": "false"}) + resp_body = self.fixtures.load("stop_instance.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _stop_node_DescribeInstances(self, method, url, body, headers): + resp_body = self.fixtures.load("stop_node_describe_instances.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _stop_node_force_stop_StopInstance(self, method, url, body, headers): + node_id = self.test.fake_node.id + self.assertUrlContainsQueryParams(url, {"InstanceId": node_id, "ForceStop": "true"}) + resp_body = self.fixtures.load("stop_instance.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _stop_node_force_stop_DescribeInstances(self, method, url, body, headers): + resp_body = self.fixtures.load("stop_node_describe_instances.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _DescribeDisks(self, method, url, body, headers): + resp_body = self.fixtures.load("describe_disks.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _list_volumes_ex_volume_ids_DescribeDisks(self, method, url, body, headers): + region = self.test.region + params = {"DiskIds": '["i-28n7dkvov", "not-existed-id"]', "RegionId": region} + self.assertUrlContainsQueryParams(url, params) + return self._DescribeInstances(method, url, body, headers) + + def _list_volumes_ex_filters_DescribeDisks(self, method, url, body, headers): + params = {"InstanceId": self.test.fake_node.id} + self.assertUrlContainsQueryParams(url, params) + return self._DescribeDisks(method, url, body, headers) + + def _DescribeSnapshots(self, method, url, body, headers): + region = self.test.region + volume_id = self.test.fake_volume.id + params = {"RegionId": region, "DiskId": volume_id} + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("describe_snapshots.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _list_volume_snapshots_ex_snapshot_ids_DescribeSnapshots(self, method, url, body, headers): + params = {"RegionId": self.test.region, "SnapshotIds": '["fake-snapshot1"]'} + self.assertUrlContainsQueryParams(url, params) + return self._DescribeSnapshots(method, url, body, headers) + + def _list_volume_snapshots_ex_filters_DescribeSnapshots(self, method, url, body, headers): + params = {"InstanceId": self.test.fake_node.id} + self.assertUrlContainsQueryParams(url, params) + return self._DescribeSnapshots(method, url, body, headers) + + def _create_volume_CreateDisk(self, method, url, body, headers): + params = { + "RegionId": self.test.region, + "DiskName": self.test.volume_name, + "Size": str(self.test.volume_size), + "ZoneId": self.test.zone, + "SnapshotId": self.test.fake_snapshot.id, + "Description": self.test.description, + "DiskCategory": self.test.disk_category, + "ClientToken": self.test.client_token, + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("create_disk.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _create_volume_DescribeDisks(self, method, url, body, headers): + resp_body = self.fixtures.load("create_volume_describe_disks.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _create_volume_snapshot_CreateSnapshot(self, method, url, body, headers): + params = { + "DiskId": self.test.fake_volume.id, + "SnapshotName": self.test.snapshot_name, + "Description": self.test.description, + "ClientToken": self.test.client_token, + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("create_snapshot.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _create_volume_snapshot_DescribeSnapshots(self, method, url, body, headers): + resp_body = self.fixtures.load("describe_snapshots.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _AttachDisk(self, method, url, body, headers): + delete_with_instance = str(self.test.delete_with_instance).lower() + params = { + "InstanceId": self.test.fake_node.id, + "DiskId": self.test.fake_volume.id, + "Device": self.test.device, + "DeleteWithInstance": delete_with_instance, + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("attach_disk.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _DetachDisk(self, method, url, body, headers): + params = { + "DiskId": self.test.fake_volume.id, + "InstanceId": self.test.instance_id, + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("detach_disk.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _detach_volume_DescribeDisks(self, method, url, body, headers): + params = {"DiskIds": '["' + self.test.fake_volume.id + '"]'} + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("detach_volume_describe_disks.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _detach_volume_DetachDisk(self, method, url, body, headers): + params = {"DiskId": self.test.fake_volume.id, "InstanceId": "i-28whl2nj2"} + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("detach_disk.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _destroy_volume_DescribeDisks(self, method, url, body, headers): + params = {"DiskIds": '["' + self.test.fake_volume.id + '"]'} + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("destroy_volume_describe_disks.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _destroy_volume_DeleteDisk(self, method, url, body, headers): + params = {"DiskId": self.test.fake_volume.id} + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("delete_disk.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _destroy_volume_state_DescribeDisks(self, method, url, body, headers): + return self._detach_volume_DescribeDisks(method, url, body, headers) + + def _DeleteSnapshot(self, method, url, body, header): + params = {"SnapshotId": self.test.fake_snapshot.id} + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("delete_snapshot.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _DescribeImages(self, method, url, body, headers): + params = {"RegionId": self.test.fake_location.id} + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("describe_images.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _list_images_pages_DescribeImages(self, method, url, body, headers): + if "PageNumber=2" in url: + resp_body = self.fixtures.load("pages_describe_images_page2.xml") + else: + resp_body = self.fixtures.load("pages_describe_images.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _list_images_ex_image_ids_DescribeImages(self, method, url, body, headers): + params = {"ImageId": self.test.fake_image.id + ",not-existed"} + self.assertUrlContainsQueryParams(url, params) + return self._DescribeImages(method, url, body, headers) + + def _list_images_ex_filters_DescribeImages(self, method, url, body, headers): + params = {"Status": "Available"} + self.assertUrlContainsQueryParams(url, params) + return self._DescribeImages(method, url, body, headers) + + def _CreateImage(self, method, url, body, headers): + params = { + "RegionId": self.test.region, + "ImageName": self.test.image_name, + "Description": self.test.description, + "SnapshotId": self.test.fake_snapshot.id, + "ImageVersion": self.test.image_version, + "ClientToken": self.test.client_token, + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("create_image.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _DeleteImage(self, method, url, body, headers): + params = {"RegionId": self.test.region, "ImageId": self.test.fake_image.id} + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("delete_image.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _get_image_DescribeImages(self, method, url, body, headers): + params = {"RegionId": self.test.region, "ImageId": self.test.fake_image.id} + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("describe_images.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _get_image_not_found_DescribeImages(self, method, url, body, headers): + params = {"RegionId": self.test.region, "ImageId": self.test.fake_image.id} + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("get_image_describe_images.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _CopyImage(self, method, url, body, headers): + params = { + "RegionId": self.test.region, + "ImageId": self.test.fake_image.id, + "DestinationRegionId": self.test.dest_region, + "DestinationImageName": self.test.image_name, + "DestinationDescription": self.test.description, + "ClientToken": self.test.client_token, + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("copy_image.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _copy_image_same_region_CopyImage(self, method, url, body, headers): + params = { + "RegionId": self.test.region, + "ImageId": self.test.fake_image.id, + "DestinationRegionId": self.test.region, + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("copy_image.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _copy_image_same_region_DescribeImages(self, method, url, body, headers): + return self._DescribeImages(method, url, body, headers) + + def _DescribeSecurityGroups(self, method, url, body, headers): + params = {"RegionId": self.test.region} + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("describe_security_groups.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _JoinSecurityGroup(self, method, url, body, headers): + params = { + "InstanceId": self.test.fake_node.id, + "SecurityGroupId": self.test.fake_security_group_id, + } + self.assertUrlContainsQueryParams(url, params) + body = self.fixtures.load("join_security_group_by_id.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _LeaveSecurityGroup(self, method, url, body, headers): + params = { + "InstanceId": self.test.fake_node.id, + "SecurityGroupId": self.test.fake_security_group_id, + } + self.assertUrlContainsQueryParams(url, params) + body = self.fixtures.load("leave_security_group_by_id.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _list_sgs_filters_DescribeSecurityGroups(self, method, url, body, headers): + params = {"VpcId": self.test.vpc_id} + self.assertUrlContainsQueryParams(url, params) + return self._DescribeSecurityGroups(method, url, body, headers) + + def _CreateSecurityGroup(self, method, url, body, headers): + params = { + "RegionId": self.test.region, + "Description": self.test.sg_description, + "ClientToken": self.test.client_token, + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("create_security_group.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _DeleteSecurityGroup(self, method, url, body, headers): + params = { + "RegionId": self.test.region, + "SecurityGroupId": self.test.fake_security_group_id, + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("delete_security_group_by_id.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _ModifySecurityGroupAttribute(self, method, url, body, headers): + params = { + "RegionId": self.test.region, + "SecurityGroupId": self.test.fake_security_group_id, + "SecurityGroupName": self.test.sg_name, + "Description": self.test.sg_description, + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("modify_security_group_by_id.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _DescribeSecurityGroupAttribute(self, method, url, body, headers): + params = { + "RegionId": self.test.region, + "SecurityGroupId": self.test.fake_security_group_id, + "NicType": self.test.sga_nictype, + } + self.assertUrlContainsQueryParams(url, params) + resp_body = self.fixtures.load("describe_security_group_attributes.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _DescribeZones(self, method, url, body, headers): + resp_body = self.fixtures.load("describe_zones.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + def _create_public_ip_AllocatePublicIpAddress(self, method, url, body, headers): + resp_body = self.fixtures.load("create_public_ip.xml") + return (httplib.OK, resp_body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_elasticstack.py b/libcloud/test/compute/test_elasticstack.py deleted file mode 100644 index 40dea2eaef..0000000000 --- a/libcloud/test/compute/test_elasticstack.py +++ /dev/null @@ -1,282 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import sys -from libcloud.utils.py3 import httplib - -from libcloud.compute.base import Node -from libcloud.compute.drivers.elasticstack import ElasticStackException -from libcloud.compute.drivers.elastichosts import \ - ElasticHostsNodeDriver as ElasticHosts -from libcloud.compute.drivers.skalicloud import \ - SkaliCloudNodeDriver as SkaliCloud -from libcloud.compute.drivers.serverlove import \ - ServerLoveNodeDriver as ServerLove -from libcloud.common.types import InvalidCredsError, MalformedResponseError - -from libcloud.test import MockHttp, unittest -from libcloud.test.file_fixtures import ComputeFileFixtures - - -class ElasticStackTestCase(object): - - def setUp(self): - # Re-use ElasticHosts fixtures for the base ElasticStack platform tests - """ElasticStack.type = Provider.ELASTICHOSTS - ElasticStack.api_name = 'elastichosts' - - ElasticStackBaseConnection.host = 'test.com' - ElasticStack.connectionCls.conn_classes = (None, - ElasticStackMockHttp) - ElasticStack._standard_drives = ElasticHosts._standard_drives - - self.driver = ElasticStack('foo', 'bar') - """ - self.mockHttp = ElasticStackMockHttp - self.mockHttp.type = None - - self.node = Node(id=72258, name=None, state=None, public_ips=None, - private_ips=None, driver=self.driver) - - def test_invalid_creds(self): - self.mockHttp.type = 'UNAUTHORIZED' - try: - self.driver.list_nodes() - except InvalidCredsError: - e = sys.exc_info()[1] - self.assertEqual(True, isinstance(e, InvalidCredsError)) - else: - self.fail('test should have thrown') - - def test_malformed_response(self): - self.mockHttp.type = 'MALFORMED' - try: - self.driver.list_nodes() - except MalformedResponseError: - pass - else: - self.fail('test should have thrown') - - def test_parse_error(self): - self.mockHttp.type = 'PARSE_ERROR' - try: - self.driver.list_nodes() - except Exception: - e = sys.exc_info()[1] - self.assertTrue(str(e).find('X-Elastic-Error') != -1) - else: - self.fail('test should have thrown') - - def test_ex_set_node_configuration(self): - success = self.driver.ex_set_node_configuration(node=self.node, - name='name', - cpu='2') - self.assertTrue(success) - - def test_ex_set_node_configuration_invalid_keys(self): - try: - self.driver.ex_set_node_configuration(node=self.node, foo='bar') - except ElasticStackException: - pass - else: - self.fail( - 'Invalid option specified, but an exception was not thrown') - - def test_list_nodes(self): - nodes = self.driver.list_nodes() - self.assertTrue(isinstance(nodes, list)) - self.assertEqual(len(nodes), 1) - - node = nodes[0] - self.assertEqual(node.public_ips[0], "1.2.3.4") - self.assertEqual(node.public_ips[1], "1.2.3.5") - self.assertEqual(node.extra['smp'], 1) - self.assertEqual( - node.extra['ide:0:0'], "b6049e7a-aa1b-47f9-b21d-cdf2354e28d3") - - def test_list_offline_node(self): - self.mockHttp.type = 'OFFLINE' - - nodes = self.driver.list_nodes() - self.assertTrue(isinstance(nodes, list)) - self.assertEqual(len(nodes), 1) - - node = nodes[0] - self.assertEqual(len(node.public_ips), 0, "Public IPs was not empty") - self.assertNotIn('smp', node.extra) - self.assertNotIn('started', node.extra) - self.assertEqual( - node.extra['ide:0:0'], "b6049e7a-aa1b-47f9-b21d-cdf2354e28d3") - - def test_list_sizes(self): - images = self.driver.list_sizes() - self.assertEqual(len(images), 6) - image = [i for i in images if i.id == 'small'][0] - self.assertEqual(image.id, 'small') - self.assertEqual(image.name, 'Small instance') - self.assertEqual(image.cpu, 2000) - self.assertEqual(image.ram, 1700) - self.assertEqual(image.disk, 160) - self.assertTrue(isinstance(image.price, float)) - - def test_list_images(self): - images = self.driver.list_images() - self.assertEqual(len(images), len(self.driver._standard_drives)) - - for uuid, values in list(self.driver._standard_drives.items()): - self.assertEqual( - len([image for image in images if image.id == uuid]), 1) - - def test_reboot_node(self): - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver.reboot_node(node)) - - def test_destroy_node(self): - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver.destroy_node(node)) - - def test_create_node(self): - sizes = self.driver.list_sizes() - size = [s for s in sizes if s.id == 'large'][0] - image = self.image - - self.assertTrue(self.driver.create_node(name="api.ivan.net.nz", - image=image, size=size)) - - -class ElasticHostsTestCase(ElasticStackTestCase, unittest.TestCase): - - def setUp(self): - ElasticHosts.connectionCls.conn_classes = (None, - ElasticStackMockHttp) - - self.driver = ElasticHosts('foo', 'bar') - images = self.driver.list_images() - self.image = [i for i in images if - i.id == '38df0986-4d85-4b76-b502-3878ffc80161'][0] - super(ElasticHostsTestCase, self).setUp() - - def test_multiple_drivers_with_different_regions(self): - driver1 = ElasticHosts('foo', 'bar', region='lon-p') - driver2 = ElasticHosts('foo', 'bar', region='sat-p') - - self.assertTrue(driver1.connection.host.startswith('api-lon-p')) - self.assertTrue(driver2.connection.host.startswith('api-sat-p')) - - driver1.list_nodes() - driver2.list_nodes() - driver1.list_nodes() - - self.assertTrue(driver1.connection.host.startswith('api-lon-p')) - self.assertTrue(driver2.connection.host.startswith('api-sat-p')) - - def test_invalid_region(self): - expected_msg = r'Invalid region.+' - self.assertRaisesRegexp(ValueError, expected_msg, ElasticHosts, - 'foo', 'bar', region='invalid') - - -class SkaliCloudTestCase(ElasticStackTestCase, unittest.TestCase): - - def setUp(self): - SkaliCloud.connectionCls.conn_classes = (None, - ElasticStackMockHttp) - - self.driver = SkaliCloud('foo', 'bar') - - images = self.driver.list_images() - self.image = [i for i in images if - i.id == '90aa51f2-15c0-4cff-81ee-e93aa20b9468'][0] - super(SkaliCloudTestCase, self).setUp() - - -class ServerLoveTestCase(ElasticStackTestCase, unittest.TestCase): - - def setUp(self): - ServerLove.connectionCls.conn_classes = (None, - ElasticStackMockHttp) - - self.driver = ServerLove('foo', 'bar') - - images = self.driver.list_images() - self.image = [i for i in images if - i.id == '679f5f44-0be7-4745-a658-cccd4334c1aa'][0] - super(ServerLoveTestCase, self).setUp() - - -class ElasticStackMockHttp(MockHttp): - - fixtures = ComputeFileFixtures('elastichosts') - - def _servers_info_UNAUTHORIZED(self, method, url, body, headers): - return (httplib.UNAUTHORIZED, body, {}, httplib.responses[httplib.NO_CONTENT]) - - def _servers_info_MALFORMED(self, method, url, body, headers): - body = "{malformed: '" - return (httplib.OK, body, {}, httplib.responses[httplib.NO_CONTENT]) - - def _servers_info_PARSE_ERROR(self, method, url, body, headers): - return (505, body, {}, httplib.responses[httplib.NO_CONTENT]) - - def _servers_b605ca90_c3e6_4cee_85f8_a8ebdf8f9903_reset(self, method, url, body, headers): - return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) - - def _servers_b605ca90_c3e6_4cee_85f8_a8ebdf8f9903_destroy(self, method, url, body, headers): - return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) - - def _drives_create(self, method, url, body, headers): - body = self.fixtures.load('drives_create.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _drives_0012e24a_6eae_4279_9912_3432f698cec8_image_38df0986_4d85_4b76_b502_3878ffc80161_gunzip(self, method, - url, body, - headers): - # ElasticHosts image - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _drives_0012e24a_6eae_4279_9912_3432f698cec8_image_90aa51f2_15c0_4cff_81ee_e93aa20b9468_gunzip(self, method, - url, body, - headers): - # Skalikloud image - return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) - - def _drives_0012e24a_6eae_4279_9912_3432f698cec8_image_679f5f44_0be7_4745_a658_cccd4334c1aa_gunzip(self, method, - url, body, - headers): - # ServerLove image - return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) - - def _drives_0012e24a_6eae_4279_9912_3432f698cec8_info(self, method, url, body, headers): - body = self.fixtures.load('drives_info.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _servers_create(self, method, url, body, headers): - body = self.fixtures.load('servers_create.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _servers_info(self, method, url, body, headers): - body = self.fixtures.load('servers_info.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _servers_info_OFFLINE(self, method, url, body, headers): - body = self.fixtures.load('offline_servers_info.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _servers_72258_set(self, method, url, body, headers): - body = '{}' - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_equinixmetal.py b/libcloud/test/compute/test_equinixmetal.py new file mode 100644 index 0000000000..ec73014efc --- /dev/null +++ b/libcloud/test/compute/test_equinixmetal.py @@ -0,0 +1,470 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Maintainer: +# Based on code written by Jed Smith who based it on +# code written by Alex Polvi +# + +import sys +import unittest + +# This is causing test failures inder Python 3.5 +import libcloud.compute.drivers.equinixmetal +from libcloud.test import MockHttp +from libcloud.utils.py3 import httplib +from libcloud.compute.base import Node, KeyPair +from libcloud.test.compute import TestCaseMixin +from libcloud.compute.types import NodeState +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.equinixmetal import EquinixMetalNodeDriver + +libcloud.compute.drivers.equinixmetal.USE_ASYNC_IO_IF_AVAILABLE = False + +__all__ = ["EquinixMetalTest"] + + +class EquinixMetalTest(unittest.TestCase, TestCaseMixin): + def setUp(self): + EquinixMetalNodeDriver.connectionCls.conn_class = EquinixMetalMockHttp + self.driver = EquinixMetalNodeDriver("foo") + + def test_list_nodes(self): + nodes = self.driver.list_nodes("project-id") + self.assertEqual(len(nodes), 1) + node = nodes[0] + self.assertEqual(node.id, "1e52437e-bbbb-cccc-dddd-74a9dfd3d3bb") + self.assertEqual(node.name, "test-node") + self.assertEqual(node.state, NodeState.RUNNING) + self.assertTrue("147.75.255.255" in node.public_ips) + self.assertTrue("2604:EEEE::EE" in node.public_ips) + self.assertTrue("10.0.0.255" in node.private_ips) + self.assertEqual(node.extra["created_at"], "2015-05-03T15:50:49Z") + self.assertEqual(node.extra["updated_at"], "2015-05-03T16:00:08Z") + self.assertEqual(node.extra["billing_cycle"], "hourly") + self.assertEqual(node.extra["locked"], False) + self.assertEqual(node.size.id, "baremetal_1") + self.assertEqual(node.size.name, "Type 1 - 16384 RAM") + self.assertEqual(node.size.ram, 16384) + self.assertEqual(node.size.disk, 240) + self.assertEqual(node.size.price, 0.4) + self.assertEqual(node.size.extra["line"], "baremetal") + self.assertEqual(node.image.id, "ubuntu_14_04") + self.assertEqual(node.image.name, "Ubuntu 14.04 LTS") + self.assertEqual(node.image.extra["distro"], "ubuntu") + self.assertEqual(node.image.extra["version"], "14.04") + + def test_list_nodes_response(self): + nodes = self.driver.list_nodes("project-id") + self.assertTrue(isinstance(nodes, list)) + + for node in nodes: + self.assertTrue(isinstance(node, Node)) + + def test_list_locations(self): + locations = self.driver.list_locations() + self.assertEqual(len(locations), 1) + + def test_list_images(self): + images = self.driver.list_images() + self.assertEqual(len(images), 4) + + def test_list_sizes(self): + sizes = self.driver.list_sizes() + self.assertEqual(len(sizes), 2) + self.assertEqual(sizes[0].ram, 16 * 1024) + self.assertEqual(sizes[1].ram, 2 * 1024 * 1024) + + def test_create_node(self): + node = self.driver.create_node( + ex_project_id="project-id", + name="node-name", + size=self.driver.list_sizes()[0], + image=self.driver.list_images()[0], + location=self.driver.list_locations()[0], + ) + self.assertTrue(isinstance(node, Node)) + + def test_create_node_response(self): + size = self.driver.list_sizes()[0] + image = self.driver.list_images()[0] + location = self.driver.list_locations()[0] + node = self.driver.create_node( + ex_project_id="project-id", + name="node-name", + image=image, + size=size, + location=location, + ) + self.assertTrue(isinstance(node, Node)) + + def test_reboot_node(self): + node = self.driver.list_nodes("project-id")[0] + self.driver.reboot_node(node) + + def test_reboot_node_response(self): + node = self.driver.list_nodes("project-id")[0] + self.driver.reboot_node(node) + + def test_destroy_node(self): + node = self.driver.list_nodes("project-id")[0] + self.driver.destroy_node(node) + + def test_destroy_node_response(self): + node = self.driver.list_nodes("project-id")[0] + self.driver.destroy_node(node) + + def test_reinstall_node(self): + node = self.driver.list_nodes("project-id")[0] + self.driver.ex_reinstall_node(node) + + def test_rescue_node(self): + node = self.driver.list_nodes("project-id")[0] + self.driver.ex_rescue_node(node) + + def test_list_key_pairs(self): + keys = self.driver.list_key_pairs() + self.assertEqual(len(keys), 3) + + def test_create_key_pair(self): + key = self.driver.create_key_pair( + name="sshkey-name", + public_key="ssh-rsa AAAAB3NzaC1yc2EA\ +AAADAQABAAABAQDI4pIqzpb5g3992h+yr527VRcaB68KE4vPjWPPoiQws49KIs2NMcOzS9QE4641uW\ +1u5ML2HgQdfYKMF/YFGnI1Y6xV637DjhDyZYV9LasUH49npSSJjsBcsk9JGfUpNAOdcgpFzK8V90ei\ +OrOC5YncxdwwG8pwjFI9nNVPCl4hYEu1iXdyysHvkFfS2fklsNjLWrzfafPlaen+qcBxygCA0sFdW/\ +7er50aJeghdBHnE2WhIKLUkJxnKadznfAge7oEe+3LLAPfP+3yHyvp2+H0IzmVfYvAjnzliYetqQ8p\ +g5ZW2BiJzvqz5PebGS70y/ySCNW1qQmJURK/Wc1bt9en root@libcloud", + ) + self.assertTrue(isinstance(key, KeyPair)) + + def test_create_key_pair_requires_public_key(self): + with self.assertRaisesRegex(ValueError, "public_key is required"): + self.driver.create_key_pair(name="sshkey-name") + + def test_delete_key_pair(self): + key = self.driver.list_key_pairs()[0] + self.driver.delete_key_pair(key) + + def test_ex_list_projects(self): + projects = self.driver.ex_list_projects() + self.assertEqual(len(projects), 3) + + def test_ex_get_bgp_config_for_project(self): + config = self.driver.ex_get_bgp_config_for_project( + ex_project_id="4b653fce-6405-4300-9f7d-c587b7888fe5" + ) + self.assertEqual(config.get("status"), "enabled") + + def test_ex_get_bgp_config(self): + config = self.driver.ex_get_bgp_config() + self.assertEqual(len(config), 2) + + def test_ex_list_nodes_for_project(self): + nodes = self.driver.ex_list_nodes_for_project( + ex_project_id="4b653fce-6405-4300-9f7d-c587b7888fe5" + ) + self.assertEqual(nodes[0].public_ips, ["147.75.102.193", "2604:1380:2000:c100::3"]) + + def test_ex_create_bgp_session(self): + node = self.driver.list_nodes("project-id")[0] + session = self.driver.ex_create_bgp_session(node, "ipv4") + self.assertEqual(session["status"], "unknown") + + def test_ex_get_bgp_session(self): + session = self.driver.ex_get_bgp_session(self.driver.ex_list_bgp_sessions()[0]["id"]) + self.assertEqual(session["status"], "down") + + def test_ex_list_bgp_sessions_for_project(self): + sessions = self.driver.ex_list_bgp_sessions_for_project( + ex_project_id="4b653fce-6405-4300-9f7d-c587b7888fe5" + ) + self.assertEqual(sessions["bgp_sessions"][0]["status"], "down") + + def test_ex_list_bgp_sessions_for_node(self): + sessions = self.driver.ex_list_bgp_sessions_for_node(self.driver.list_nodes()[0]) + self.assertEqual(sessions["bgp_sessions"][0]["status"], "down") + + def test_ex_list_bgp_sessions(self): + sessions = self.driver.ex_list_bgp_sessions() + self.assertEqual(sessions[0]["status"], "down") + + def test_ex_delete_bgp_session(self): + self.driver.ex_delete_bgp_session(session_uuid="08f6b756-758b-4f1f-bfaf-b9b5479822d7") + + def test_ex_list_events_for_node(self): + events = self.driver.ex_list_events_for_node(self.driver.list_nodes()[0]) + self.assertEqual(events["events"][0]["ip"], "157.52.105.28") + + def test_ex_list_events_for_project(self): + events = self.driver.ex_list_events_for_project(self.driver.ex_list_projects()[0]) + self.assertEqual(events["meta"]["total"], len(events["events"])) + + def test_ex_get_node_bandwidth(self): + node = self.driver.list_nodes("project-id")[0] + bw = self.driver.ex_get_node_bandwidth(node, 1553194476, 1553198076) + self.assertTrue(len(bw["bandwidth"][0]["datapoints"][0]) > 0) + + def test_ex_update_node(self): + node = self.driver.list_nodes("project-id")[0] + self.driver.ex_update_node(node, description="new_description") + + def test_ex_describe_all_addresses_for_project(self): + addresses = self.driver.ex_describe_all_addresses_for_project( + "4b653fce-6405-4300-9f7d-c587b7888fe5" + ) + self.assertEqual(len(addresses), 5) + + def test_ex_describe_address(self): + address = self.driver.ex_describe_address( + ex_address_id="01c184f5-1413-4b0b-9f6d-ac993f6c9241" + ) + self.assertEqual(address["network"], "147.75.33.32") + + def test_ex_request_address_reservation(self): + response = self.driver.ex_request_address_reservation( + ex_project_id="3d27fd13-0466-4878-be22-9a4b5595a3df" + ) + assert response["global_ip"] + + def test_ex_associate_address_with_node(self): + node = self.driver.list_nodes("project-id")[0] + response = self.driver.ex_associate_address_with_node(node, "147.75.40.2/32") + assert response["enabled"] + + def test_ex_disassociate_address_with_node(self): + node = self.driver.list_nodes("project-id")[0] + assignments = self.driver.ex_list_ip_assignments_for_node(node) + + for ip_assignment in assignments["ip_addresses"]: + if ip_assignment["gateway"] == "147.75.40.2": + self.driver.ex_disassociate_address(ip_assignment["id"]) + + break + + +class EquinixMetalMockHttp(MockHttp): + fixtures = ComputeFileFixtures("equinixmetal") + + def _metal_v1_locations_metros(self, method, url, body, headers): + body = self.fixtures.load("metros.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_plans(self, method, url, body, headers): + body = self.fixtures.load("plans.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_3d27fd13_0466_4878_be22_9a4b5595a3df_plans( + self, method, url, body, headers + ): + body = self.fixtures.load("plans.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects(self, method, url, body, headers): + body = self.fixtures.load("projects.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_4b653fce_6405_4300_9f7d_c587b7888fe5_devices( + self, method, url, body, headers + ): + body = self.fixtures.load("devices_for_project.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_4a4bce6b_d2ef_41f8_95cf_0e2f32996440_devices( + self, method, url, body, headers + ): + body = self.fixtures.load("devices_for_project.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_3d27fd13_0466_4878_be22_9a4b5595a3df_devices( + self, method, url, body, headers + ): + body = self.fixtures.load("devices_for_project.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_4b653fce_6405_4300_9f7d_c587b7888fe5_ips( + self, method, url, body, headers + ): + body = self.fixtures.load("project_ips.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_3d27fd13_0466_4878_be22_9a4b5595a3df_ips( + self, method, url, body, headers + ): + if method == "POST": + body = self.fixtures.load("reserve_ip.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_4b653fce_6405_4300_9f7d_c587b7888fe5_bgp_config( + self, method, url, body, headers + ): + body = self.fixtures.load("bgp_config_project_1.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_3d27fd13_0466_4878_be22_9a4b5595a3df_bgp_config( + self, method, url, body, headers + ): + body = self.fixtures.load("bgp_config_project_1.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_4a4bce6b_d2ef_41f8_95cf_0e2f32996440_bgp_config( + self, method, url, body, headers + ): + body = self.fixtures.load("bgp_config_project_3.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_operating_systems(self, method, url, body, headers): + body = self.fixtures.load("operatingsystems.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_ssh_keys(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("sshkeys.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + if method == "POST": + body = self.fixtures.load("sshkey_create.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_ssh_keys_2c1a7f23_1dc6_4a37_948e_d9857d9f607c(self, method, url, body, headers): + if method == "DELETE": + return (httplib.OK, "", {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_project_id_devices(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("device_create.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "GET": + body = self.fixtures.load("devices.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_devices_1e52437e_bbbb_cccc_dddd_74a9dfd3d3bb(self, method, url, body, headers): + if method in ["DELETE", "PUT"]: + return (httplib.OK, "", {}, httplib.responses[httplib.OK]) + + def _metal_v1_devices_1e52437e_bbbb_cccc_dddd_74a9dfd3d3bb_actions( + self, method, url, body, headers + ): + return (httplib.OK, "", {}, httplib.responses[httplib.OK]) + + def _metal_v1_devices_1e52437e_bbbb_cccc_dddd_74a9dfd3d3bb_bgp_sessions( + self, method, url, body, headers + ): + if method == "POST": + body = self.fixtures.load("bgp_session_create.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_bgp_sessions_08f6b756_758b_4f1f_bfaf_b9b5479822d7( + self, method, url, body, headers + ): + body = self.fixtures.load("bgp_session_get.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_4b653fce_6405_4300_9f7d_c587b7888fe5_bgp_sessions( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("bgp_sessions.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_devices_905037a4_967c_4e81_b364_3a0603aa071b_bgp_sessions( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("bgp_sessions.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_4a4bce6b_d2ef_41f8_95cf_0e2f32996440_bgp_sessions( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("bgp_sessions.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_3d27fd13_0466_4878_be22_9a4b5595a3df_bgp_sessions( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("bgp_sessions.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_projects_3d27fd13_0466_4878_be22_9a4b5595a3df_events( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("project_events.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_devices_905037a4_967c_4e81_b364_3a0603aa071b_events( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("device_events.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_devices_1e52437e_bbbb_cccc_dddd_74a9dfd3d3bb_bandwidth( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("node_bandwidth.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_ips_01c184f5_1413_4b0b_9f6d_ac993f6c9241(self, method, url, body, headers): + body = self.fixtures.load("ip_address.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_devices_1e52437e_bbbb_cccc_dddd_74a9dfd3d3bb_ips( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("ip_assignments.json") + elif method == "POST": + body = self.fixtures.load("associate_ip.json") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _metal_v1_ips_aea4ee0c_675f_4b77_8337_8e13b868dd9c(self, method, url, body, headers): + if method == "DELETE": + return (httplib.OK, "", {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_exoscale.py b/libcloud/test/compute/test_exoscale.py index 1a4cbec088..71171e73c7 100644 --- a/libcloud/test/compute/test_exoscale.py +++ b/libcloud/test/compute/test_exoscale.py @@ -15,14 +15,14 @@ import sys +from libcloud.test import unittest from libcloud.compute.drivers.exoscale import ExoscaleNodeDriver from libcloud.test.compute.test_cloudstack import CloudStackCommonTestCase -from libcloud.test import unittest - class ExoscaleNodeDriverTestCase(CloudStackCommonTestCase, unittest.TestCase): driver_klass = ExoscaleNodeDriver -if __name__ == '__main__': + +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_gandi.py b/libcloud/test/compute/test_gandi.py index e4a11e8c56..349838cfef 100644 --- a/libcloud/test/compute/test_gandi.py +++ b/libcloud/test/compute/test_gandi.py @@ -13,29 +13,25 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest import sys import random import string +import unittest from libcloud.utils.py3 import httplib - -from libcloud.compute.drivers.gandi import GandiNodeDriver from libcloud.common.gandi import GandiException +from libcloud.test.secrets import GANDI_PARAMS from libcloud.compute.types import NodeState - from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.test.secrets import GANDI_PARAMS +from libcloud.compute.drivers.gandi import GandiNodeDriver from libcloud.test.common.test_gandi import BaseGandiMockHttp class GandiTests(unittest.TestCase): - - node_name = 'test2' + node_name = "test2" def setUp(self): - GandiNodeDriver.connectionCls.conn_classes = ( - GandiMockHttp, GandiMockHttp) + GandiNodeDriver.connectionCls.conn_class = GandiMockHttp GandiMockHttp.type = None self.driver = GandiNodeDriver(*GANDI_PARAMS) @@ -45,13 +41,11 @@ def test_list_nodes(self): self.assertTrue(len(nodes[0].public_ips) > 1) def test_list_locations(self): - loc = list(filter(lambda x: 'france' in x.country.lower(), - self.driver.list_locations()))[0] - self.assertEqual(loc.country, 'France') + loc = list(filter(lambda x: "france" in x.country.lower(), self.driver.list_locations()))[0] + self.assertEqual(loc.country, "France") def test_list_images(self): - loc = list(filter(lambda x: 'france' in x.country.lower(), - self.driver.list_locations()))[0] + loc = list(filter(lambda x: "france" in x.country.lower(), self.driver.list_locations()))[0] images = self.driver.list_images(loc) self.assertTrue(len(images) > 2) @@ -61,49 +55,47 @@ def test_list_sizes(self): def test_destroy_node_running(self): nodes = self.driver.list_nodes() - test_node = list(filter(lambda x: x.state == NodeState.RUNNING, - nodes))[0] + test_node = list(filter(lambda x: x.state == NodeState.RUNNING, nodes))[0] self.assertTrue(self.driver.destroy_node(test_node)) def test_destroy_node_halted(self): nodes = self.driver.list_nodes() - test_node = list(filter(lambda x: x.state == NodeState.TERMINATED, - nodes))[0] + test_node = list(filter(lambda x: x.state == NodeState.TERMINATED, nodes))[0] self.assertTrue(self.driver.destroy_node(test_node)) def test_reboot_node(self): nodes = self.driver.list_nodes() - test_node = list(filter(lambda x: x.state == NodeState.RUNNING, - nodes))[0] + test_node = list(filter(lambda x: x.state == NodeState.RUNNING, nodes))[0] self.assertTrue(self.driver.reboot_node(test_node)) def test_create_node(self): - login = 'libcloud' - passwd = ''.join(random.choice(string.ascii_letters) - for i in range(10)) + login = "libcloud" + passwd = "".join(random.choice(string.ascii_letters) for i in range(10)) # Get france datacenter - loc = list(filter(lambda x: 'france' in x.country.lower(), - self.driver.list_locations()))[0] + loc = list(filter(lambda x: "france" in x.country.lower(), self.driver.list_locations()))[0] # Get a debian image images = self.driver.list_images(loc) - images = [x for x in images if x.name.lower().startswith('debian')] - img = list(filter(lambda x: '5' in x.name, images))[0] + images = [x for x in images if x.name.lower().startswith("debian")] + img = list(filter(lambda x: "5" in x.name, images))[0] # Get a configuration size size = self.driver.list_sizes()[0] - node = self.driver.create_node(name=self.node_name, login=login, - password=passwd, image=img, - location=loc, size=size) + node = self.driver.create_node( + name=self.node_name, + login=login, + password=passwd, + image=img, + location=loc, + size=size, + ) self.assertEqual(node.name, self.node_name) def test_create_volume(self): - loc = list(filter(lambda x: 'france' in x.country.lower(), - self.driver.list_locations()))[0] - volume = self.driver.create_volume( - size=1024, name='libcloud', location=loc) - self.assertEqual(volume.name, 'libcloud') + loc = list(filter(lambda x: "france" in x.country.lower(), self.driver.list_locations()))[0] + volume = self.driver.create_volume(size=1024, name="libcloud", location=loc) + self.assertEqual(volume.name, "libcloud") self.assertEqual(volume.size, 1024) def test_list_volumes(self): @@ -112,8 +104,7 @@ def test_list_volumes(self): def test_destroy_volume(self): volumes = self.driver.list_volumes() - test_vol = list(filter(lambda x: x.name == 'test_disk', - volumes))[0] + test_vol = list(filter(lambda x: x.name == "test_disk", volumes))[0] self.assertTrue(self.driver.destroy_volume(test_vol)) def test_attach_volume(self): @@ -147,23 +138,45 @@ def test_ex_detach_interface(self): def test_ex_snapshot_disk(self): disks = self.driver.list_volumes() self.assertTrue(self.driver.ex_snapshot_disk(disks[2])) - self.assertRaises(GandiException, - self.driver.ex_snapshot_disk, disks[0]) + self.assertRaises(GandiException, self.driver.ex_snapshot_disk, disks[0]) def test_ex_update_disk(self): disks = self.driver.list_volumes() self.assertTrue(self.driver.ex_update_disk(disks[0], new_size=4096)) + def test_list_key_pairs(self): + keys = self.driver.list_key_pairs() + self.assertTrue(len(keys) > 0) -class GandiRatingTests(unittest.TestCase): + def test_get_key_pair(self): + key = self.driver.get_key_pair(10) + self.assertEqual(key.name, "testkey") + + def test_import_key_pair_from_string(self): + key = self.driver.import_key_pair_from_string("testkey", "12345") + self.assertEqual(key.name, "testkey") + self.assertEqual(key.extra["id"], 10) + + def test_delete_key_pair(self): + response = self.driver.delete_key_pair(10) + self.assertTrue(response) + + def test_ex_get_node(self): + node = self.driver.ex_get_node(34951) + self.assertEqual(node.name, "test2") + def test_ex_get_volume(self): + volume = self.driver.ex_get_volume(1263) + self.assertEqual(volume.name, "libcloud") + + +class GandiRatingTests(unittest.TestCase): """Tests where rating model is involved""" - node_name = 'test2' + node_name = "test2" def setUp(self): - GandiNodeDriver.connectionCls.conn_classes = ( - GandiMockRatingHttp, GandiMockRatingHttp) + GandiNodeDriver.connectionCls.conn_class = GandiMockRatingHttp GandiMockRatingHttp.type = None self.driver = GandiNodeDriver(*GANDI_PARAMS) @@ -172,151 +185,168 @@ def test_list_sizes(self): self.assertEqual(len(sizes), 4) def test_create_node(self): - login = 'libcloud' - passwd = ''.join(random.choice(string.ascii_letters) - for i in range(10)) + login = "libcloud" + passwd = "".join(random.choice(string.ascii_letters) for i in range(10)) # Get france datacenter - loc = list(filter(lambda x: 'france' in x.country.lower(), - self.driver.list_locations()))[0] + loc = list(filter(lambda x: "france" in x.country.lower(), self.driver.list_locations()))[0] # Get a debian image images = self.driver.list_images(loc) - images = [x for x in images if x.name.lower().startswith('debian')] - img = list(filter(lambda x: '5' in x.name, images))[0] + images = [x for x in images if x.name.lower().startswith("debian")] + img = list(filter(lambda x: "5" in x.name, images))[0] # Get a configuration size size = self.driver.list_sizes()[0] - node = self.driver.create_node(name=self.node_name, login=login, - password=passwd, image=img, - location=loc, size=size) + node = self.driver.create_node( + name=self.node_name, + login=login, + password=passwd, + image=img, + location=loc, + size=size, + ) self.assertEqual(node.name, self.node_name) class GandiMockHttp(BaseGandiMockHttp): - - fixtures = ComputeFileFixtures('gandi') + fixtures = ComputeFileFixtures("gandi") def _xmlrpc__hosting_datacenter_list(self, method, url, body, headers): - body = self.fixtures.load('datacenter_list.xml') + body = self.fixtures.load("datacenter_list.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_image_list(self, method, url, body, headers): - body = self.fixtures.load('image_list_dc0.xml') + body = self.fixtures.load("image_list_dc0.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_vm_list(self, method, url, body, headers): - body = self.fixtures.load('vm_list.xml') + body = self.fixtures.load("vm_list.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_ip_list(self, method, url, body, headers): - body = self.fixtures.load('ip_list.xml') + body = self.fixtures.load("ip_list.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_account_info(self, method, url, body, headers): - body = self.fixtures.load('account_info.xml') + body = self.fixtures.load("account_info.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_vm_info(self, method, url, body, headers): - body = self.fixtures.load('vm_info.xml') + body = self.fixtures.load("vm_info.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_vm_delete(self, method, url, body, headers): - body = self.fixtures.load('vm_delete.xml') + body = self.fixtures.load("vm_delete.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__operation_info(self, method, url, body, headers): - body = self.fixtures.load('operation_info.xml') + body = self.fixtures.load("operation_info.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_vm_create_from(self, method, url, body, headers): - body = self.fixtures.load('vm_create_from.xml') + body = self.fixtures.load("vm_create_from.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_vm_reboot(self, method, url, body, headers): - body = self.fixtures.load('vm_reboot.xml') + body = self.fixtures.load("vm_reboot.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_vm_stop(self, method, url, body, headers): - body = self.fixtures.load('vm_stop.xml') + body = self.fixtures.load("vm_stop.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_iface_list(self, method, url, body, headers): - body = self.fixtures.load('iface_list.xml') + body = self.fixtures.load("iface_list.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_disk_list(self, method, url, body, headers): - body = self.fixtures.load('disk_list.xml') + body = self.fixtures.load("disk_list.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_vm_iface_attach(self, method, url, body, headers): - body = self.fixtures.load('iface_attach.xml') + body = self.fixtures.load("iface_attach.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_vm_iface_detach(self, method, url, body, headers): - body = self.fixtures.load('iface_detach.xml') + body = self.fixtures.load("iface_detach.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_vm_disk_attach(self, method, url, body, headers): - body = self.fixtures.load('disk_attach.xml') + body = self.fixtures.load("disk_attach.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_vm_disk_detach(self, method, url, body, headers): - body = self.fixtures.load('disk_detach.xml') + body = self.fixtures.load("disk_detach.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_disk_create(self, method, url, body, headers): - body = self.fixtures.load('disk_create.xml') + body = self.fixtures.load("disk_create.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_disk_create_from(self, method, url, body, headers): - body = self.fixtures.load('disk_create_from.xml') + body = self.fixtures.load("disk_create_from.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_disk_info(self, method, url, body, headers): - body = self.fixtures.load('disk_info.xml') + body = self.fixtures.load("disk_info.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_disk_update(self, method, url, body, headers): - body = self.fixtures.load('disk_update.xml') + body = self.fixtures.load("disk_update.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_disk_delete(self, method, url, body, headers): - body = self.fixtures.load('disk_delete.xml') + body = self.fixtures.load("disk_delete.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + def _xmlrpc__hosting_ssh_info(self, method, url, body, headers): + body = self.fixtures.load("ssh_info.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) -class GandiMockRatingHttp(BaseGandiMockHttp): + def _xmlrpc__hosting_ssh_list(self, method, url, body, headers): + body = self.fixtures.load("ssh_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + def _xmlrpc__hosting_ssh_create(self, method, url, body, headers): + body = self.fixtures.load("ssh_info.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _xmlrpc__hosting_ssh_delete(self, method, url, body, headers): + body = self.fixtures.load("ssh_delete.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +class GandiMockRatingHttp(BaseGandiMockHttp): """Fixtures needed for tests related to rating model""" - fixtures = ComputeFileFixtures('gandi') + fixtures = ComputeFileFixtures("gandi") def _xmlrpc__hosting_datacenter_list(self, method, url, body, headers): - body = self.fixtures.load('datacenter_list.xml') + body = self.fixtures.load("datacenter_list.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_image_list(self, method, url, body, headers): - body = self.fixtures.load('image_list_dc0.xml') + body = self.fixtures.load("image_list_dc0.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_vm_create_from(self, method, url, body, headers): - body = self.fixtures.load('vm_create_from.xml') + body = self.fixtures.load("vm_create_from.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__operation_info(self, method, url, body, headers): - body = self.fixtures.load('operation_info.xml') + body = self.fixtures.load("operation_info.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _xmlrpc__hosting_vm_info(self, method, url, body, headers): - body = self.fixtures.load('vm_info.xml') + body = self.fixtures.load("vm_info.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) # Specific to rating tests def _xmlrpc__hosting_account_info(self, method, url, body, headers): - body = self.fixtures.load('account_info_rating.xml') + body = self.fixtures.load("account_info_rating.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py index 6759656097..2dc926a6c6 100644 --- a/libcloud/test/compute/test_gce.py +++ b/libcloud/test/compute/test_gce.py @@ -15,782 +15,1836 @@ """ Tests for Google Compute Engine Driver """ + import sys -import unittest import datetime +import unittest +from unittest import mock +from libcloud.test import MockHttp from libcloud.utils.py3 import httplib -from libcloud.compute.drivers.gce import (GCENodeDriver, API_VERSION, - timestamp_to_datetime, - GCEAddress, GCEBackendService, - GCEFirewall, GCEForwardingRule, - GCEHealthCheck, GCENetwork, - GCENodeImage, GCERoute, - GCETargetHttpProxy, GCEUrlMap, - GCEZone) -from libcloud.common.google import (GoogleBaseAuthConnection, - GoogleInstalledAppAuthConnection, - GoogleBaseConnection, - ResourceNotFoundError, ResourceExistsError) -from libcloud.test.common.test_google import GoogleAuthMockHttp from libcloud.compute.base import Node, StorageVolume - -from libcloud.test import MockHttpTestCase, LibcloudTestCase from libcloud.test.compute import TestCaseMixin -from libcloud.test.file_fixtures import ComputeFileFixtures - from libcloud.test.secrets import GCE_PARAMS, GCE_KEYWORD_PARAMS - - -class GCENodeDriverTest(LibcloudTestCase, TestCaseMixin): - +from libcloud.common.google import ( + GoogleBaseError, + ResourceExistsError, + ResourceNotFoundError, + GoogleBaseAuthConnection, +) +from libcloud.compute.types import NodeState +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.gce import ( + API_VERSION, + GCEZone, + GCERoute, + GCERegion, + GCEUrlMap, + GCEAddress, + GCEBackend, + GCENetwork, + GCEProject, + GCEFirewall, + GCENodeImage, + GCEFailedNode, + GCENodeDriver, + GCESubnetwork, + GCEHealthCheck, + GCEBackendService, + GCEForwardingRule, + GCETargetHttpProxy, + GCEMultipleNodesTimeoutError, + timestamp_to_datetime, +) +from libcloud.test.common.test_google import GoogleTestCase, GoogleAuthMockHttp + + +class GCENodeDriverTest(GoogleTestCase, TestCaseMixin): """ Google Compute Engine Test Class. """ + # Mock out a few specific calls that interact with the user, system or # environment. - GoogleBaseConnection._get_token_info_from_file = lambda x: None - GoogleBaseConnection._write_token_info_to_file = lambda x: None - GoogleInstalledAppAuthConnection.get_code = lambda x: '1234' GCEZone._now = lambda x: datetime.datetime(2013, 6, 26, 19, 0, 0) - datacenter = 'us-central1-a' + datacenter = "us-central1-a" def setUp(self): GCEMockHttp.test = self - GCENodeDriver.connectionCls.conn_classes = (GCEMockHttp, GCEMockHttp) - GoogleBaseAuthConnection.conn_classes = (GoogleAuthMockHttp, - GoogleAuthMockHttp) + GCENodeDriver.connectionCls.conn_class = GCEMockHttp + GoogleBaseAuthConnection.conn_class = GoogleAuthMockHttp GCEMockHttp.type = None kwargs = GCE_KEYWORD_PARAMS.copy() - kwargs['auth_type'] = 'IA' - kwargs['datacenter'] = self.datacenter + kwargs["auth_type"] = "IA" + kwargs["datacenter"] = self.datacenter self.driver = GCENodeDriver(*GCE_PARAMS, **kwargs) def test_default_scopes(self): - self.assertEqual(self.driver.scopes, None) + self.assertIsNone(self.driver.scopes) + + def test_build_service_account_gce_struct_default_service_account(self): + result = self.driver._build_service_accounts_gce_list(service_accounts=None) + self.assertEqual( + result, + [ + { + "email": "default", + "scopes": ["https://www.googleapis.com/auth/devstorage.read_only"], + } + ], + ) + + def test_build_service_account_gce_struct_no_service_account(self): + result = self.driver._build_service_accounts_gce_list(service_accounts=[]) + self.assertEqual(result, []) + + def test_build_service_account_gce_struct_custom_service_account(self): + data = [{"email": "1", "scopes": ["a"]}, {"email": "2", "scopes": ["b"]}] + expected_result = [ + {"email": "1", "scopes": ["https://www.googleapis.com/auth/a"]}, + {"email": "2", "scopes": ["https://www.googleapis.com/auth/b"]}, + ] + + result = self.driver._build_service_accounts_gce_list(service_accounts=data) + self.assertEqual(result, expected_result) def test_timestamp_to_datetime(self): - timestamp1 = '2013-06-26T10:05:19.340-07:00' + timestamp1 = "2013-06-26T10:05:19.340-07:00" datetime1 = datetime.datetime(2013, 6, 26, 17, 5, 19) self.assertEqual(timestamp_to_datetime(timestamp1), datetime1) - timestamp2 = '2013-06-26T17:43:15.000-00:00' + timestamp2 = "2013-06-26T17:43:15.000-00:00" datetime2 = datetime.datetime(2013, 6, 26, 17, 43, 15) self.assertEqual(timestamp_to_datetime(timestamp2), datetime2) def test_get_object_by_kind(self): obj = self.driver._get_object_by_kind(None) self.assertIsNone(obj) - obj = self.driver._get_object_by_kind('') + obj = self.driver._get_object_by_kind("") self.assertIsNone(obj) obj = self.driver._get_object_by_kind( - 'https://www.googleapis.com/compute/v1/projects/project_name/' - 'global/targetHttpProxies/web-proxy') - self.assertEqual(obj.name, 'web-proxy') + "https://www.googleapis.com/compute/v1/projects/project_name/" + "global/targetHttpProxies/web-proxy" + ) + self.assertEqual(obj.name, "web-proxy") def test_get_region_from_zone(self): - zone1 = self.driver.ex_get_zone('us-central1-a') - expected_region1 = 'us-central1' + zone1 = self.driver.ex_get_zone("us-central1-a") + expected_region1 = "us-central1" region1 = self.driver._get_region_from_zone(zone1) self.assertEqual(region1.name, expected_region1) - zone2 = self.driver.ex_get_zone('europe-west1-b') - expected_region2 = 'europe-west1' + zone2 = self.driver.ex_get_zone("europe-west1-b") + expected_region2 = "europe-west1" region2 = self.driver._get_region_from_zone(zone2) self.assertEqual(region2.name, expected_region2) + def test_get_volume(self): + volume_name = "lcdisk" + volume = self.driver.ex_get_volume(volume_name) + self.assertTrue(isinstance(volume, StorageVolume)) + self.assertEqual(volume.name, volume_name) + + def test_get_volume_location(self): + volume_name = "lcdisk" + location = self.driver.zone + volume = self.driver.ex_get_volume(volume_name, zone=location) + self.assertTrue(isinstance(volume, StorageVolume)) + self.assertEqual(volume.name, volume_name) + + def test_get_volume_location_name(self): + volume_name = "lcdisk" + location = self.driver.zone + volume = self.driver.ex_get_volume(volume_name, zone=location.name) + self.assertTrue(isinstance(volume, StorageVolume)) + self.assertEqual(volume.name, volume_name) + def test_find_zone_or_region(self): - zone1 = self.driver._find_zone_or_region('libcloud-demo-np-node', - 'instances') - self.assertEqual(zone1.name, 'us-central2-a') - zone2 = self.driver._find_zone_or_region( - 'libcloud-demo-europe-np-node', 'instances') - self.assertEqual(zone2.name, 'europe-west1-a') - region = self.driver._find_zone_or_region('libcloud-demo-address', - 'addresses', region=True) - self.assertEqual(region.name, 'us-central1') + zone1 = self.driver._find_zone_or_region("libcloud-demo-np-node", "instances") + self.assertEqual(zone1.name, "us-central2-a") + zone2 = self.driver._find_zone_or_region("libcloud-demo-europe-np-node", "instances") + self.assertEqual(zone2.name, "europe-west1-a") + region = self.driver._find_zone_or_region("libcloud-demo-address", "addresses", region=True) + self.assertEqual(region.name, "us-central1") def test_match_images(self): - project = 'debian-cloud' - image = self.driver._match_images(project, 'debian-7') - self.assertEqual(image.name, 'debian-7-wheezy-v20131120') - image = self.driver._match_images(project, 'backports') - self.assertEqual(image.name, 'backports-debian-7-wheezy-v20131127') + project = "debian-cloud" + image = self.driver._match_images(project, "debian-7") + self.assertEqual(image.name, "debian-7-wheezy-v20131120") + image = self.driver._match_images(project, "backports") + self.assertEqual(image.name, "backports-debian-7-wheezy-v20131127") + + def test_build_disk_gce_struct(self): + device_name = "disk_name" + disk_name = None + source = self.driver.ex_get_volume("lcdisk") + is_boot = True + # source as input + d = self.driver._build_disk_gce_struct( + device_name=device_name, source=source, disk_name=disk_name, is_boot=is_boot + ) + self.assertEqual(source.extra["selfLink"], d["source"]) + self.assertTrue(d["boot"]) + self.assertTrue(d["autoDelete"]) + self.assertEqual("READ_WRITE", d["mode"]) + self.assertFalse("initializeParams" in d) + + # image as input + device_name = "disk_name" + disk_type = self.driver.ex_get_disktype("pd-ssd", "us-central1-a") + image = self.driver.ex_get_image("debian-7") + source = None + is_boot = True + d = self.driver._build_disk_gce_struct( + device_name=device_name, disk_type=disk_type, image=image, is_boot=is_boot + ) + self.assertEqual("READ_WRITE", d["mode"]) + self.assertEqual("PERSISTENT", d["type"]) + self.assertTrue("initializeParams" in d and isinstance(d["initializeParams"], dict)) + self.assertTrue( + all(k in d["initializeParams"] for k in ["sourceImage", "diskType", "diskName"]) + ) + self.assertTrue(d["initializeParams"]["sourceImage"].startswith("https://")) + self.assertTrue(d["autoDelete"]) + self.assertTrue(d["boot"]) + + def test_build_network_gce_struct(self): + network = self.driver.ex_get_network("lcnetwork") + address = self.driver.ex_get_address("lcaddress") + internalip = self.driver.ex_get_address("testaddress") + subnetwork_name = "cf-972cf02e6ad49112" + subnetwork = self.driver.ex_get_subnetwork(subnetwork_name) + d = self.driver._build_network_gce_struct(network, subnetwork, address) + self.assertTrue("network" in d) + self.assertTrue("subnetwork" in d) + self.assertTrue("kind" in d and d["kind"] == "compute#instanceNetworkInterface") + self.assertEqual(d["accessConfigs"][0]["natIP"], address.address) + # test with internal IP + d = self.driver._build_network_gce_struct( + network, subnetwork, address, internal_ip=internalip + ) + self.assertTrue("network" in d) + self.assertTrue("subnetwork" in d) + self.assertTrue("kind" in d and d["kind"] == "compute#instanceNetworkInterface") + self.assertEqual(d["accessConfigs"][0]["natIP"], address.address) + self.assertEqual(d["networkIP"], internalip) + network = self.driver.ex_get_network("default") + d = self.driver._build_network_gce_struct(network) + self.assertTrue("network" in d) + self.assertFalse("subnetwork" in d) + self.assertTrue("kind" in d and d["kind"] == "compute#instanceNetworkInterface") + + def test_build_scheduling_gce_struct(self): + self.assertFalse(self.driver._build_scheduling_gce_struct(None, None, None)) + # on_host_maintenance bad value should raise a Valueerror + self.assertRaises( + ValueError, + self.driver._build_service_account_gce_struct, + 'on_host_maintenance="foobar"', + ) + # on_host_maintenance is 'MIGRATE' and prempt is True + self.assertRaises( + ValueError, + self.driver._build_service_account_gce_struct, + 'on_host_maintenance="MIGRATE"', + "preemptible=True", + ) + # automatic_restart is True and prempt is True + self.assertRaises( + ValueError, + self.driver._build_service_account_gce_struct, + 'automatic_restart="True"', + "preemptible=True", + ) + + actual = self.driver._build_scheduling_gce_struct("TERMINATE", True, False) + self.assertTrue("automaticRestart" in actual and actual["automaticRestart"] is True) + self.assertTrue( + "onHostMaintenance" in actual and actual["onHostMaintenance"] == "TERMINATE" + ) + self.assertTrue("preemptible" in actual) + self.assertFalse(actual["preemptible"]) + + def test_build_service_account_gce_struct(self): + self.assertRaises(ValueError, self.driver._build_service_account_gce_struct, None) + input = {"scopes": ["compute-ro"]} + actual = self.driver._build_service_account_gce_struct(input) + self.assertTrue("email" in actual) + self.assertTrue("scopes" in actual) + + input = {"scopes": ["compute-ro"], "email": "test@test.com"} + actual = self.driver._build_service_account_gce_struct(input) + self.assertTrue("email" in actual) + self.assertEqual(actual["email"], "test@test.com") + self.assertTrue("scopes" in actual) + + def test_build_service_account_gce_list(self): + # ensure we have a list + self.assertRaises(ValueError, self.driver._build_service_accounts_gce_list, "foo") + # no input + actual = self.driver._build_service_accounts_gce_list() + self.assertTrue(len(actual) == 1) + self.assertTrue("email" in actual[0]) + self.assertTrue("scopes" in actual[0]) + + def test_get_selflink_or_name(self): + network = self.driver.ex_get_network("lcnetwork") + + # object as input + actual = self.driver._get_selflink_or_name(network, False, "network") + self.assertEqual("lcnetwork", actual) + actual = self.driver._get_selflink_or_name(network, True, "network") + self.assertTrue(actual.startswith("https://")) + + # name-only as input + actual = self.driver._get_selflink_or_name("lcnetwork", True, "network") + self.assertTrue(actual.startswith("https://")) + + actual = self.driver._get_selflink_or_name("lcnetwork", False, "network") + self.assertTrue("lcnetwork", actual) + + # if selflinks is true, we need objname + self.assertRaises(ValueError, self.driver._get_selflink_or_name, "lcnetwork", True) def test_ex_get_serial_output(self): - self.assertRaises(ValueError, self.driver.ex_get_serial_output, 'foo') - node = self.driver.ex_get_node('node-name', 'us-central1-a') - self.assertTrue(self.driver.ex_get_serial_output(node), - 'This is some serial\r\noutput for you.') + self.assertRaises(ValueError, self.driver.ex_get_serial_output, "foo") + node = self.driver.ex_get_node("node-name", "us-central1-a") + self.assertTrue( + self.driver.ex_get_serial_output(node), + "This is some serial\r\noutput for you.", + ) + + def test_ex_list(self): + d = self.driver + # Test the default case for all list methods + # (except list_volume_snapshots, which requires an arg) + for list_fn in ( + d.ex_list_addresses, + d.ex_list_backendservices, + d.ex_list_disktypes, + d.ex_list_firewalls, + d.ex_list_forwarding_rules, + d.ex_list_healthchecks, + d.ex_list_networks, + d.ex_list_subnetworks, + d.ex_list_project_images, + d.ex_list_regions, + d.ex_list_routes, + d.ex_list_snapshots, + d.ex_list_targethttpproxies, + d.ex_list_targetinstances, + d.ex_list_targetpools, + d.ex_list_urlmaps, + d.ex_list_zones, + d.list_images, + d.list_locations, + d.list_nodes, + d.list_sizes, + d.list_volumes, + ): + full_list = [item.name for item in list_fn()] + li = d.ex_list(list_fn) + iter_list = [item.name for sublist in li for item in sublist] + self.assertEqual(full_list, iter_list) + + # Test paging & filtering with a single list function as they require + # additional test fixtures + list_fn = d.ex_list_regions + for count, sublist in zip((2, 1), d.ex_list(list_fn).page(2)): + self.assertTrue(len(sublist) == count) + for sublist in d.ex_list(list_fn).filter("name eq us-central1"): + self.assertTrue(len(sublist) == 1) + self.assertEqual(sublist[0].name, "us-central1") def test_ex_list_addresses(self): address_list = self.driver.ex_list_addresses() - address_list_all = self.driver.ex_list_addresses('all') - address_list_uc1 = self.driver.ex_list_addresses('us-central1') - address_list_global = self.driver.ex_list_addresses('global') + address_list_all = self.driver.ex_list_addresses("all") + address_list_uc1 = self.driver.ex_list_addresses("us-central1") + address_list_global = self.driver.ex_list_addresses("global") self.assertEqual(len(address_list), 2) self.assertEqual(len(address_list_all), 5) self.assertEqual(len(address_list_global), 1) - self.assertEqual(address_list[0].name, 'libcloud-demo-address') - self.assertEqual(address_list_uc1[0].name, 'libcloud-demo-address') - self.assertEqual(address_list_global[0].name, 'lcaddressglobal') + self.assertEqual(address_list[0].name, "libcloud-demo-address") + self.assertEqual(address_list_uc1[0].name, "libcloud-demo-address") + self.assertEqual(address_list_global[0].name, "lcaddressglobal") names = [a.name for a in address_list_all] - self.assertTrue('libcloud-demo-address' in names) + self.assertTrue("libcloud-demo-address" in names) def test_ex_list_backendservices(self): - self.backendservices_mock = 'empty' + self.backendservices_mock = "empty" backendservices_list = self.driver.ex_list_backendservices() self.assertListEqual(backendservices_list, []) - self.backendservices_mock = 'web-service' + self.backendservices_mock = "web-service" backendservices_list = self.driver.ex_list_backendservices() web_service = backendservices_list[0] - self.assertEqual(web_service.name, 'web-service') + self.assertEqual(web_service.name, "web-service") self.assertEqual(len(web_service.healthchecks), 1) self.assertEqual(len(web_service.backends), 2) def test_ex_list_healthchecks(self): healthchecks = self.driver.ex_list_healthchecks() self.assertEqual(len(healthchecks), 3) - self.assertEqual(healthchecks[0].name, 'basic-check') + self.assertEqual(healthchecks[0].name, "basic-check") def test_ex_list_firewalls(self): firewalls = self.driver.ex_list_firewalls() self.assertEqual(len(firewalls), 5) - self.assertEqual(firewalls[0].name, 'default-allow-internal') + self.assertEqual(firewalls[0].name, "default-allow-internal") def test_ex_list_forwarding_rules(self): forwarding_rules = self.driver.ex_list_forwarding_rules() - forwarding_rules_all = self.driver.ex_list_forwarding_rules('all') - forwarding_rules_uc1 = self.driver.ex_list_forwarding_rules( - 'us-central1') + forwarding_rules_all = self.driver.ex_list_forwarding_rules("all") + forwarding_rules_uc1 = self.driver.ex_list_forwarding_rules("us-central1") self.assertEqual(len(forwarding_rules), 2) self.assertEqual(len(forwarding_rules_all), 2) - self.assertEqual(forwarding_rules[0].name, 'lcforwardingrule') - self.assertEqual(forwarding_rules_uc1[0].name, 'lcforwardingrule') + self.assertEqual(forwarding_rules[0].name, "lcforwardingrule") + self.assertEqual(forwarding_rules_uc1[0].name, "lcforwardingrule") names = [f.name for f in forwarding_rules_all] - self.assertTrue('lcforwardingrule' in names) + self.assertTrue("lcforwardingrule" in names) def test_ex_list_forwarding_rules_global(self): forwarding_rules = self.driver.ex_list_forwarding_rules(global_rules=True) self.assertEqual(len(forwarding_rules), 2) - self.assertEqual(forwarding_rules[0].name, 'http-rule') + self.assertEqual(forwarding_rules[0].name, "http-rule") names = [f.name for f in forwarding_rules] - self.assertListEqual(names, ['http-rule', 'http-rule2']) + self.assertListEqual(names, ["http-rule", "http-rule2"]) def test_list_images(self): local_images = self.driver.list_images() all_deprecated_images = self.driver.list_images(ex_include_deprecated=True) - debian_images = self.driver.list_images(ex_project='debian-cloud') - local_plus_deb = self.driver.list_images(['debian-cloud', 'project_name']) - self.assertEqual(len(local_images), 23) - self.assertEqual(len(all_deprecated_images), 156) + debian_images = self.driver.list_images(ex_project="debian-cloud") + local_plus_deb = self.driver.list_images(ex_project=["debian-cloud", "project_name"]) + self.assertEqual(len(local_images), 52) + self.assertEqual(len(all_deprecated_images), 180) self.assertEqual(len(debian_images), 2) - self.assertEqual(len(local_plus_deb), 3) - self.assertEqual(local_images[0].name, 'aws-ubuntu') - self.assertEqual(debian_images[1].name, 'debian-7-wheezy-v20131120') + self.assertEqual(len(local_plus_deb), 6) + self.assertEqual(local_images[0].name, "custom-image1") + self.assertEqual(local_images[2].name, "custom-image") + self.assertEqual(debian_images[1].name, "debian-7-wheezy-v20131120") + + def test_ex_destroy_instancegroup(self): + name = "myname" + zone = "us-central1-a" + uig = self.driver.ex_get_instancegroup(name, zone) + self.assertTrue(self.driver.ex_destroy_instancegroup(uig)) + + def test_ex_get_instancegroup(self): + name = "myname" + loc = "us-central1-a" + actual = self.driver.ex_get_instancegroup(name, loc) + self.assertEqual(actual.name, name) + self.assertEqual(actual.zone.name, loc) + + def test_ex_create_instancegroup(self): + name = "myname" + loc = "us-central1-a" + actual = self.driver.ex_create_instancegroup(name, loc) + self.assertEqual(actual.name, name) + self.assertEqual(actual.zone.name, loc) + + def test_ex_list_instancegroups(self): + loc = "us-central1-a" + actual = self.driver.ex_list_instancegroups(loc) + self.assertTrue(len(actual) == 2) + self.assertEqual(actual[0].name, "myname") + self.assertEqual(actual[1].name, "myname2") + + def test_ex_list_instancegroups_zone_attribute_not_present_in_response(self): + GCEMockHttp.type = "zone_attribute_not_present" + loc = "us-central1-a" + actual = self.driver.ex_list_instancegroups(loc) + self.assertTrue(len(actual) == 2) + self.assertEqual(actual[0].name, "myname") + self.assertEqual(actual[1].name, "myname2") + + def test_ex_instancegroup_list_instances(self): + name = "myname" + loc = "us-central1-a" + gceobj = self.driver.ex_get_instancegroup(name, loc) + actual = self.driver.ex_instancegroup_list_instances(gceobj) + self.assertTrue(len(actual) == 2) + for node in actual: + self.assertTrue(isinstance(node, Node)) + self.assertEqual(loc, node.extra["zone"].name) + + def test_ex_instancegroup_add_instances(self): + name = "myname" + loc = "us-central1-a" + gceobj = self.driver.ex_get_instancegroup(name, loc) + node_name = self.driver.ex_get_node("node-name", loc) + lcnode = self.driver.ex_get_node("lcnode-001", loc) + node_list = [node_name, lcnode] + self.assertTrue(self.driver.ex_instancegroup_add_instances(gceobj, node_list)) + + def test_ex_instancegroup_remove_instances(self): + name = "myname" + loc = "us-central1-a" + gceobj = self.driver.ex_get_instancegroup(name, loc) + node_name = self.driver.ex_get_node("node-name", loc) + lcnode = self.driver.ex_get_node("lcnode-001", loc) + node_list = [node_name, lcnode] + self.assertTrue(self.driver.ex_instancegroup_remove_instances(gceobj, node_list)) + + def test_ex_instancegroup_set_named_ports(self): + name = "myname" + loc = "us-central1-a" + gceobj = self.driver.ex_get_instancegroup(name, loc) + named_ports = [{"name": "foo", "port": 4444}] + # base case + self.assertTrue(self.driver.ex_instancegroup_set_named_ports(gceobj, named_ports)) + # specify nothing, default is empty list + self.assertTrue(self.driver.ex_instancegroup_set_named_ports(gceobj)) + # specify empty list + self.assertTrue(self.driver.ex_instancegroup_set_named_ports(gceobj, [])) + # raise valueerror if string is passed in + self.assertRaises( + ValueError, self.driver.ex_instancegroup_set_named_ports, gceobj, "foobar" + ) + # raise valueerror if dictionary is passed in + self.assertRaises( + ValueError, + self.driver.ex_instancegroup_set_named_ports, + gceobj, + {"name": "foo", "port": 4444}, + ) + + def test_ex_instancegroupmanager_set_autohealing_policies(self): + kwargs = { + "host": "lchost", + "path": "/lc", + "port": 8000, + "interval": 10, + "timeout": 10, + "unhealthy_threshold": 4, + "healthy_threshold": 3, + "description": "test healthcheck", + } + healthcheck_name = "lchealthcheck" + hc = self.driver.ex_create_healthcheck(healthcheck_name, **kwargs) + + ig_name = "myinstancegroup" + ig_zone = "us-central1-a" + manager = self.driver.ex_get_instancegroupmanager(ig_name, ig_zone) + + res = self.driver.ex_instancegroupmanager_set_autohealingpolicies( + manager=manager, healthcheck=hc, initialdelaysec=2 + ) + self.assertTrue(res) + + res = manager.set_autohealingpolicies(healthcheck=hc, initialdelaysec=2) + self.assertTrue(res) + + def test_ex_create_instancegroupmanager(self): + name = "myinstancegroup" + zone = "us-central1-a" + size = 4 + template_name = "my-instance-template1" + template = self.driver.ex_get_instancetemplate(template_name) + mig = self.driver.ex_create_instancegroupmanager( + name, zone, template, size, base_instance_name="base-foo" + ) + + self.assertEqual(mig.name, name) + self.assertEqual(mig.size, size) + self.assertEqual(mig.zone.name, zone) + + def test_ex_create_instancegroupmanager_shared_network(self): + name = "myinstancegroup-shared-network" + zone = "us-central1-a" + size = 4 + template_name = "my-instance-template-shared-network" + template = self.driver.ex_get_instancetemplate(template_name) + mig = self.driver.ex_create_instancegroupmanager( + name, zone, template, size, base_instance_name="base-foo" + ) + + self.assertEqual(mig.name, name) + self.assertEqual(mig.size, size) + self.assertEqual(mig.zone.name, zone) + + def test_ex_create_instancetemplate(self): + name = "my-instance-template1" + actual = self.driver.ex_create_instancetemplate( + name, size="n1-standard-1", image="debian-7", network="default" + ) + self.assertEqual(actual.name, name) + self.assertEqual(actual.extra["properties"]["machineType"], "n1-standard-1") def test_list_locations(self): locations = self.driver.list_locations() - self.assertEqual(len(locations), 5) - self.assertEqual(locations[0].name, 'europe-west1-a') + self.assertEqual(len(locations), 6) + self.assertEqual(locations[0].name, "asia-east1-a") def test_ex_list_routes(self): routes = self.driver.ex_list_routes() self.assertEqual(len(routes), 3) - self.assertTrue('lcdemoroute' in [route.name for route in routes]) + self.assertTrue("lcdemoroute" in [route.name for route in routes]) + + def test_ex_list_sslcertificate(self): + ssl_name = "example" + certs = self.driver.ex_list_sslcertificates() + self.assertEqual(certs[0].name, ssl_name) + self.assertTrue(len(certs) == 1) + + def test_ex_list_subnetworks(self): + subnetworks = self.driver.ex_list_subnetworks() + self.assertEqual(len(subnetworks), 1) + self.assertEqual(subnetworks[0].name, "cf-972cf02e6ad49112") + self.assertEqual(subnetworks[0].cidr, "10.128.0.0/20") + subnetworks = self.driver.ex_list_subnetworks("all") + self.assertEqual(len(subnetworks), 4) + + def test_ex_create_sslcertificate(self): + ssl_name = "example" + private_key = "-----BEGIN RSA PRIVATE KEY-----\nfoobar==\n-----END RSA PRIVATE KEY-----\n" + certificate = "-----BEGIN CERTIFICATE-----\nfoobar==\n-----END CERTIFICATE-----\n" + ssl = self.driver.ex_create_sslcertificate( + ssl_name, certificate=certificate, private_key=private_key + ) + self.assertEqual(ssl_name, ssl.name) + self.assertEqual(certificate, ssl.certificate) + + def test_ex_create_subnetwork(self): + name = "cf-972cf02e6ad49112" + cidr = "10.128.0.0/20" + network_name = "cf" + network = self.driver.ex_get_network(network_name) + region_name = "us-central1" + region = self.driver.ex_get_region(region_name) + description = "LCTestSubnet" + privateipgoogleaccess = True + secondaryipranges = [{"rangeName": "secondary", "ipCidrRange": "192.168.168.0/24"}] + # test by network/region name + subnet = self.driver.ex_create_subnetwork( + name, + cidr, + network_name, + region_name, + description=description, + privateipgoogleaccess=privateipgoogleaccess, + secondaryipranges=secondaryipranges, + ) + self.assertTrue(isinstance(subnet, GCESubnetwork)) + self.assertTrue(isinstance(subnet.region, GCERegion)) + self.assertTrue(isinstance(subnet.network, GCENetwork)) + self.assertEqual(subnet.name, name) + self.assertEqual(subnet.cidr, cidr) + self.assertEqual(subnet.extra["privateIpGoogleAccess"], privateipgoogleaccess) + self.assertEqual(subnet.extra["secondaryIpRanges"], secondaryipranges) + # test by network/region object + subnet = self.driver.ex_create_subnetwork(name, cidr, network, region) + self.assertTrue(isinstance(subnet, GCESubnetwork)) + self.assertTrue(isinstance(subnet.region, GCERegion)) + self.assertTrue(isinstance(subnet.network, GCENetwork)) + self.assertEqual(subnet.name, name) + self.assertEqual(subnet.cidr, cidr) + self.assertEqual(subnet.extra["privateIpGoogleAccess"], privateipgoogleaccess) + self.assertEqual(subnet.extra["secondaryIpRanges"], secondaryipranges) + + def test_ex_destroy_subnetwork(self): + name = "cf-972cf02e6ad49112" + region_name = "us-central1" + region = self.driver.ex_get_region(region_name) + # delete with no region + self.assertTrue(self.driver.ex_destroy_subnetwork(name)) + # delete with region name + self.assertTrue(self.driver.ex_destroy_subnetwork(name, region_name)) + # delete with region object + self.assertTrue(self.driver.ex_destroy_subnetwork(name, region)) + + def test_ex_get_sslcertificate(self): + ssl_name = "example" + ssl = self.driver.ex_get_sslcertificate(ssl_name) + self.assertEqual(ssl.name, ssl_name) + self.assertTrue(hasattr(ssl, "certificate")) + self.assertTrue(len(ssl.certificate)) + + def test_ex_get_accelerator_type(self): + name = "nvidia-tesla-k80" + zone = self.driver.ex_get_zone("us-central1-a") + accelerator_type = self.driver.ex_get_accelerator_type(name, zone) + self.assertEqual(accelerator_type.name, name) + self.assertEqual(accelerator_type.zone, zone) + + def test_ex_get_subnetwork(self): + name = "cf-972cf02e6ad49112" + region_name = "us-central1" + region = self.driver.ex_get_region(region_name) + # fetch by no region + subnetwork = self.driver.ex_get_subnetwork(name) + self.assertEqual(subnetwork.name, name) + # fetch by region name + subnetwork = self.driver.ex_get_subnetwork(name, region_name) + self.assertEqual(subnetwork.name, name) + # fetch by region object + subnetwork = self.driver.ex_get_subnetwork(name, region) + self.assertEqual(subnetwork.name, name) + # do the same but this time by resource URL + url = "https://www.googleapis.com/compute/v1/projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112" + # fetch by no region + subnetwork = self.driver.ex_get_subnetwork(url) + self.assertEqual(subnetwork.name, name) + self.assertEqual(subnetwork.region.name, region_name) + # test with a subnetwork that is under a different project + url_other = "https://www.googleapis.com/compute/v1/projects/other_name/regions/us-central1/subnetworks/cf-972cf02e6ad49114" + subnetwork = self.driver.ex_get_subnetwork(url_other) + self.assertEqual(subnetwork.name, "cf-972cf02e6ad49114") def test_ex_list_networks(self): networks = self.driver.ex_list_networks() self.assertEqual(len(networks), 3) - self.assertEqual(networks[0].name, 'default') + self.assertEqual(networks[0].name, "cf") + self.assertEqual(networks[0].mode, "auto") + self.assertEqual(len(networks[0].subnetworks), 4) + self.assertEqual(networks[1].name, "custom") + self.assertEqual(networks[1].mode, "custom") + self.assertEqual(len(networks[1].subnetworks), 1) + self.assertEqual(networks[2].name, "default") + self.assertEqual(networks[2].mode, "legacy") def test_list_nodes(self): nodes = self.driver.list_nodes() - nodes_all = self.driver.list_nodes(ex_zone='all') - nodes_uc1a = self.driver.list_nodes(ex_zone='us-central1-a') + nodes_all = self.driver.list_nodes(ex_zone="all") + nodes_uc1a = self.driver.list_nodes(ex_zone="us-central1-a") + nodes_uc1b = self.driver.list_nodes(ex_zone="us-central1-b") self.assertEqual(len(nodes), 1) self.assertEqual(len(nodes_all), 8) self.assertEqual(len(nodes_uc1a), 1) - self.assertEqual(nodes[0].name, 'node-name') - self.assertEqual(nodes_uc1a[0].name, 'node-name') + self.assertEqual(len(nodes_uc1b), 0) + self.assertEqual(nodes[0].name, "node-name") + self.assertEqual(nodes_uc1a[0].name, "node-name") + self.assertEqual(nodes_uc1a[0].extra["cpuPlatform"], "Intel Skylake") + self.assertEqual(nodes_uc1a[0].extra["minCpuPlatform"], "Intel Skylake") + names = [n.name for n in nodes_all] - self.assertTrue('node-name' in names) + self.assertTrue("node-name" in names) + + states = [n.state for n in nodes_all] + self.assertTrue(NodeState.SUSPENDED in states) def test_ex_list_regions(self): regions = self.driver.ex_list_regions() self.assertEqual(len(regions), 3) - self.assertEqual(regions[0].name, 'europe-west1') + self.assertEqual(regions[0].name, "europe-west1") def test_ex_list_snapshots(self): snapshots = self.driver.ex_list_snapshots() self.assertEqual(len(snapshots), 2) - self.assertEqual(snapshots[0].name, 'lcsnapshot') + self.assertEqual(snapshots[0].name, "lcsnapshot") def test_ex_list_targethttpproxies(self): target_proxies = self.driver.ex_list_targethttpproxies() self.assertEqual(len(target_proxies), 2) - self.assertEqual(target_proxies[0].name, 'web-proxy') + self.assertEqual(target_proxies[0].name, "web-proxy") names = [t.name for t in target_proxies] - self.assertListEqual(names, ['web-proxy', 'web-proxy2']) + self.assertListEqual(names, ["web-proxy", "web-proxy2"]) def test_ex_list_targetinstances(self): target_instances = self.driver.ex_list_targetinstances() - target_instances_all = self.driver.ex_list_targetinstances('all') - target_instances_uc1 = self.driver.ex_list_targetinstances('us-central1-a') + target_instances_all = self.driver.ex_list_targetinstances("all") + target_instances_uc1 = self.driver.ex_list_targetinstances("us-central1-a") self.assertEqual(len(target_instances), 2) self.assertEqual(len(target_instances_all), 2) self.assertEqual(len(target_instances_uc1), 2) - self.assertEqual(target_instances[0].name, 'hello') - self.assertEqual(target_instances_uc1[0].name, 'hello') + self.assertEqual(target_instances[0].name, "hello") + self.assertEqual(target_instances_uc1[0].name, "hello") names = [t.name for t in target_instances_all] - self.assertTrue('lctargetinstance' in names) + self.assertTrue("lctargetinstance" in names) def test_ex_list_targetpools(self): target_pools = self.driver.ex_list_targetpools() - target_pools_all = self.driver.ex_list_targetpools('all') - target_pools_uc1 = self.driver.ex_list_targetpools('us-central1') + target_pools_all = self.driver.ex_list_targetpools("all") + target_pools_uc1 = self.driver.ex_list_targetpools("us-central1") self.assertEqual(len(target_pools), 4) self.assertEqual(len(target_pools_all), 5) self.assertEqual(len(target_pools_uc1), 4) - self.assertEqual(target_pools[0].name, 'lctargetpool') - self.assertEqual(target_pools_uc1[0].name, 'lctargetpool') + self.assertEqual(target_pools[0].name, "lctargetpool") + self.assertEqual(target_pools_uc1[0].name, "lctargetpool") names = [t.name for t in target_pools_all] - self.assertTrue('www-pool' in names) + self.assertTrue("www-pool" in names) def test_list_sizes(self): sizes = self.driver.list_sizes() - sizes_all = self.driver.list_sizes('all') - self.assertEqual(len(sizes), 22) + sizes_all = self.driver.list_sizes("all") + self.assertEqual(len(sizes), 23) self.assertEqual(len(sizes_all), 100) - self.assertEqual(sizes[0].name, 'f1-micro') - self.assertEqual(sizes[0].extra['zone'].name, 'us-central1-a') + self.assertEqual(sizes[0].name, "f1-micro") + self.assertEqual(sizes[0].extra["zone"].name, "us-central1-a") + self.assertEqual(sizes[1].name, "a2-highgpu-1g") + self.assertEqual(len(sizes[1].extra["accelerators"]), 1) + self.assertEqual( + sizes[1].extra["accelerators"][0]["guestAcceleratorType"], + "nvidia-tesla-v100", + ) names = [s.name for s in sizes_all] - self.assertEqual(names.count('n1-standard-1'), 5) + self.assertEqual(names.count("n1-standard-1"), 5) def test_ex_get_license(self): - license = self.driver.ex_get_license('suse-cloud', 'sles-12') - self.assertEqual(license.name, 'sles-12') + license = self.driver.ex_get_license("suse-cloud", "sles-12") + self.assertEqual(license.name, "sles-12") self.assertTrue(license.charges_use_fee) def test_list_disktypes(self): disktypes = self.driver.ex_list_disktypes() - disktypes_all = self.driver.ex_list_disktypes('all') - disktypes_uc1a = self.driver.ex_list_disktypes('us-central1-a') + disktypes_all = self.driver.ex_list_disktypes("all") + disktypes_uc1a = self.driver.ex_list_disktypes("us-central1-a") self.assertEqual(len(disktypes), 2) self.assertEqual(len(disktypes_all), 9) self.assertEqual(len(disktypes_uc1a), 2) - self.assertEqual(disktypes[0].name, 'pd-ssd') - self.assertEqual(disktypes_uc1a[0].name, 'pd-ssd') + self.assertEqual(disktypes[0].name, "pd-ssd") + self.assertEqual(disktypes_uc1a[0].name, "pd-ssd") names = [v.name for v in disktypes_all] - self.assertTrue('pd-standard' in names) - self.assertTrue('local-ssd' in names) + self.assertTrue("pd-standard" in names) + self.assertTrue("local-ssd" in names) + + def test_ex_list_instancegroupmanagers(self): + instancegroupmanagers = self.driver.ex_list_instancegroupmanagers() + instancegroupmanagers_all = self.driver.ex_list_instancegroupmanagers("all") + instancegroupmanagers_ue1b = self.driver.ex_list_instancegroupmanagers("us-east1-b") + self.assertEqual(len(instancegroupmanagers), 1) + self.assertEqual(len(instancegroupmanagers_all), 2) + self.assertEqual(len(instancegroupmanagers_ue1b), 1) + + def test_ex_instancegroupmanager_list_managed_instances(self): + ig_name = "myinstancegroup" + ig_zone = "us-central1-a" + mig = self.driver.ex_get_instancegroupmanager(ig_name, ig_zone) + instances = mig.list_managed_instances() + self.assertTrue(all([x["currentAction"] == "NONE" for x in instances])) + self.assertTrue("base-foo-2vld" in [x["name"] for x in instances]) + self.assertEqual(len(instances), 4) + + def test_ex_list_instancetemplates(self): + instancetemplates = self.driver.ex_list_instancetemplates() + self.assertEqual(len(instancetemplates), 1) + self.assertEqual(instancetemplates[0].name, "my-instance-template1") + + def test_ex_list_autoscalers(self): + autoscalers = self.driver.ex_list_autoscalers("all") + self.assertEqual(len(autoscalers), 1) + self.assertEqual(autoscalers[0].name, "my-autoscaler") def test_ex_list_urlmaps(self): urlmaps_list = self.driver.ex_list_urlmaps() web_map = urlmaps_list[0] - self.assertEqual(web_map.name, 'web-map') + self.assertEqual(web_map.name, "web-map") self.assertEqual(len(web_map.host_rules), 0) self.assertEqual(len(web_map.path_matchers), 0) self.assertEqual(len(web_map.tests), 0) def test_list_volumes(self): volumes = self.driver.list_volumes() - volumes_all = self.driver.list_volumes('all') - volumes_uc1a = self.driver.list_volumes('us-central1-a') + volumes_all = self.driver.list_volumes("all") + volumes_uc1a = self.driver.list_volumes("us-central1-a") self.assertEqual(len(volumes), 2) - self.assertEqual(len(volumes_all), 10) + self.assertEqual(len(volumes_all), 17) self.assertEqual(len(volumes_uc1a), 2) - self.assertEqual(volumes[0].name, 'lcdisk') - self.assertEqual(volumes_uc1a[0].name, 'lcdisk') + self.assertEqual(volumes[0].name, "lcdisk") + self.assertEqual(volumes_uc1a[0].name, "lcdisk") names = [v.name for v in volumes_all] - self.assertTrue('libcloud-demo-europe-boot-disk' in names) + self.assertTrue("libcloud-demo-europe-boot-disk" in names) def test_ex_list_zones(self): zones = self.driver.ex_list_zones() - self.assertEqual(len(zones), 5) - self.assertEqual(zones[0].name, 'europe-west1-a') + self.assertEqual(len(zones), 6) + self.assertEqual(zones[0].name, "asia-east1-a") def test_ex_create_address_global(self): - address_name = 'lcaddressglobal' - address = self.driver.ex_create_address(address_name, 'global') + address_name = "lcaddressglobal" + address = self.driver.ex_create_address(address_name, "global") self.assertTrue(isinstance(address, GCEAddress)) self.assertEqual(address.name, address_name) - self.assertEqual(address.region, 'global') + self.assertEqual(address.region, "global") def test_ex_create_address(self): - address_name = 'lcaddress' + address_name = "lcaddress" address = self.driver.ex_create_address(address_name) self.assertTrue(isinstance(address, GCEAddress)) self.assertEqual(address.name, address_name) + def test_ex_create_address_internal(self): + address_name = "lcaddressinternal" + address = self.driver.ex_create_address( + address_name, + region="us-central1", + address="10.128.0.12", + address_type="INTERNAL", + subnetwork="subnet-1", + ) + self.assertTrue(isinstance(address, GCEAddress)) + self.assertEqual(address.name, address_name) + self.assertEqual(address.address, "10.128.0.12") + + self.assertRaises( + ValueError, + self.driver.ex_create_address, + address_name, + address_type="WRONG", + ) + self.assertRaises( + ValueError, + self.driver.ex_create_address, + address_name, + address_type="EXTERNAL", + subnetwork="subnet-1", + ) + + def test_ex_create_backend(self): + # Note: this is an internal object, no API call is made + # and no fixture is needed specifically for GCEBackend, however + # it does rely on an InstanceGroup object. + ig = self.driver.ex_get_instancegroup("myinstancegroup", "us-central1-a") + + backend = self.driver.ex_create_backend(ig) + + self.assertTrue(isinstance(backend, GCEBackend)) + self.assertEqual(backend.name, "{}/instanceGroups/{}".format(ig.zone.name, ig.name)) + self.assertEqual(backend.instance_group.name, ig.name) + self.assertEqual(backend.balancing_mode, "UTILIZATION") + def test_ex_create_backendservice(self): - backendservice_name = 'web-service' + backendservice_name = "web-service" + + ig1 = self.driver.ex_get_instancegroup("myinstancegroup", "us-central1-a") + backend1 = self.driver.ex_create_backend(ig1) + ig2 = self.driver.ex_get_instancegroup("myinstancegroup2", "us-central1-a") + backend2 = self.driver.ex_create_backend(ig2) + backendservice = self.driver.ex_create_backendservice( name=backendservice_name, - healthchecks=['lchealthcheck']) + healthchecks=["lchealthcheck"], + backends=[backend1, backend2], + ) self.assertTrue(isinstance(backendservice, GCEBackendService)) self.assertEqual(backendservice.name, backendservice_name) + self.assertEqual(len(backendservice.backends), 2) + ig_links = [ig1.extra["selfLink"], ig2.extra["selfLink"]] + for be in backendservice.backends: + self.assertTrue(be["group"] in ig_links) def test_ex_create_healthcheck(self): - healthcheck_name = 'lchealthcheck' - kwargs = {'host': 'lchost', - 'path': '/lc', - 'port': 8000, - 'interval': 10, - 'timeout': 10, - 'unhealthy_threshold': 4, - 'healthy_threshold': 3, - 'description': 'test healthcheck'} + healthcheck_name = "lchealthcheck" + kwargs = { + "host": "lchost", + "path": "/lc", + "port": 8000, + "interval": 10, + "timeout": 10, + "unhealthy_threshold": 4, + "healthy_threshold": 3, + "description": "test healthcheck", + } hc = self.driver.ex_create_healthcheck(healthcheck_name, **kwargs) self.assertTrue(isinstance(hc, GCEHealthCheck)) self.assertEqual(hc.name, healthcheck_name) - self.assertEqual(hc.path, '/lc') + self.assertEqual(hc.path, "/lc") self.assertEqual(hc.port, 8000) self.assertEqual(hc.interval, 10) - self.assertEqual(hc.extra['host'], 'lchost') - self.assertEqual(hc.extra['description'], 'test healthcheck') + self.assertEqual(hc.extra["host"], "lchost") + self.assertEqual(hc.extra["description"], "test healthcheck") def test_ex_create_image(self): - volume = self.driver.ex_get_volume('lcdisk') - image = self.driver.ex_create_image('coreos', volume) + volume = self.driver.ex_get_volume("lcdisk") + description = "CoreOS, CoreOS stable, 1520.6.0, amd64-usr published on 2017-10-12" + name = "coreos" + family = "coreos-stable" + licenses = ["projects/coreos-cloud/global/licenses/coreos-stable"] + guest_os_features = ["VIRTIO_SCSI_MULTIQUEUE"] + expected_features = [{"type": "VIRTIO_SCSI_MULTIQUEUE"}] + mock_request = mock.Mock() + mock_request.side_effect = self.driver.connection.async_request + self.driver.connection.async_request = mock_request + + image = self.driver.ex_create_image( + name, + volume, + description=description, + family=family, + guest_os_features=guest_os_features, + ex_licenses=licenses, + ) self.assertTrue(isinstance(image, GCENodeImage)) - self.assertTrue(image.name.startswith('coreos')) - self.assertEqual(image.extra['description'], 'CoreOS beta 522.3.0') + self.assertTrue(image.name.startswith(name)) + self.assertEqual(image.extra["description"], description) + self.assertEqual(image.extra["family"], family) + self.assertEqual(image.extra["guestOsFeatures"], expected_features) + self.assertEqual(image.extra["licenses"][0].name, licenses[0].split("/")[-1]) + expected_data = { + "description": description, + "family": family, + "guestOsFeatures": expected_features, + "name": name, + "licenses": licenses, + "sourceDisk": volume.extra["selfLink"], + "zone": volume.extra["zone"].name, + } + mock_request.assert_called_once_with("/global/images", data=expected_data, method="POST") + + def test_ex_copy_image(self): + name = "coreos" + url = "gs://storage.core-os.net/coreos/amd64-generic/247.0.0/coreos_production_gce.tar.gz" + description = "CoreOS, CoreOS stable, 1520.6.0, amd64-usr published on 2017-10-12" + family = "coreos-stable" + guest_os_features = ["VIRTIO_SCSI_MULTIQUEUE"] + expected_features = [{"type": "VIRTIO_SCSI_MULTIQUEUE"}] + image = self.driver.ex_copy_image( + name, + url, + description=description, + family=family, + guest_os_features=guest_os_features, + ) + self.assertTrue(image.name.startswith(name)) + self.assertEqual(image.extra["description"], description) + self.assertEqual(image.extra["family"], family) + self.assertEqual(image.extra["guestOsFeatures"], expected_features) def test_ex_create_firewall(self): - firewall_name = 'lcfirewall' - allowed = [{'IPProtocol': 'tcp', 'ports': ['4567']}] - source_tags = ['libcloud'] - firewall = self.driver.ex_create_firewall(firewall_name, allowed, - source_tags=source_tags) + name = "lcfirewall" + priority = 900 + description = "Libcloud Test Firewall" + allowed = [{"IPProtocol": "tcp", "ports": ["4567"]}] + source_service_accounts = ["lcsource@gserviceaccount.com"] + target_tags = ["libcloud"] + network = "default" + firewall = self.driver.ex_create_firewall( + name, + allowed, + description=description, + network=network, + priority=priority, + target_tags=target_tags, + source_service_accounts=source_service_accounts, + ) self.assertTrue(isinstance(firewall, GCEFirewall)) - self.assertEqual(firewall.name, firewall_name) + self.assertEqual(firewall.name, name) + + def test_ex_create_firewall_egress(self): + name = "lcfirewall-egress" + priority = 900 + direction = "EGRESS" + description = "Libcloud Egress Firewall" + allowed = [{"IPProtocol": "tcp", "ports": ["4567"]}] + target_service_accounts = ["lctarget@gserviceaccount.com"] + target_ranges = ["8.8.8.8/32"] + network = "default" + firewall = self.driver.ex_create_firewall( + name, + allowed, + description=description, + network=network, + priority=priority, + direction=direction, + target_ranges=target_ranges, + target_service_accounts=target_service_accounts, + ) + self.assertTrue(isinstance(firewall, GCEFirewall)) + self.assertEqual(firewall.name, name) + + def test_ex_create_firewall_deny(self): + name = "lcfirewall-deny" + priority = 900 + denied = [{"IPProtocol": "tcp", "ports": ["4567"]}] + description = "Libcloud Deny Firewall" + source_ranges = ["10.240.100.0/24"] + source_tags = ["libcloud"] + network = "default" + firewall = self.driver.ex_create_firewall( + name, + denied=denied, + description=description, + network=network, + priority=priority, + source_tags=source_tags, + source_ranges=source_ranges, + ) + self.assertTrue(isinstance(firewall, GCEFirewall)) + self.assertEqual(firewall.name, name) def test_ex_create_forwarding_rule(self): - fwr_name = 'lcforwardingrule' - targetpool = 'lctargetpool' - region = 'us-central1' - address = 'lcaddress' - port_range = '8000-8500' - description = 'test forwarding rule' - fwr = self.driver.ex_create_forwarding_rule(fwr_name, targetpool, - region=region, - address=address, - port_range=port_range, - description=description) + fwr_name = "lcforwardingrule" + targetpool = "lctargetpool" + region = "us-central1" + address = "lcaddress" + port_range = "8000-8500" + description = "test forwarding rule" + fwr = self.driver.ex_create_forwarding_rule( + fwr_name, + targetpool, + region=region, + address=address, + port_range=port_range, + description=description, + ) self.assertTrue(isinstance(fwr, GCEForwardingRule)) self.assertEqual(fwr.name, fwr_name) self.assertEqual(fwr.region.name, region) - self.assertEqual(fwr.protocol, 'TCP') - self.assertEqual(fwr.extra['portRange'], port_range) - self.assertEqual(fwr.extra['description'], description) + self.assertEqual(fwr.protocol, "TCP") + self.assertEqual(fwr.extra["portRange"], port_range) + self.assertEqual(fwr.extra["description"], description) def test_ex_create_forwarding_rule_global(self): - fwr_name = 'http-rule' - target_name = 'web-proxy' - address = 'lcaddressglobal' - port_range = '80-80' - description = 'global forwarding rule' - for target in (target_name, - self.driver.ex_get_targethttpproxy(target_name)): - fwr = self.driver.ex_create_forwarding_rule(fwr_name, target, - global_rule=True, - address=address, - port_range=port_range, - description=description) + fwr_name = "http-rule" + target_name = "web-proxy" + address = "lcaddressglobal" + port_range = "80-80" + description = "global forwarding rule" + for target in (target_name, self.driver.ex_get_targethttpproxy(target_name)): + fwr = self.driver.ex_create_forwarding_rule( + fwr_name, + target, + global_rule=True, + address=address, + port_range=port_range, + description=description, + ) self.assertTrue(isinstance(fwr, GCEForwardingRule)) self.assertEqual(fwr.name, fwr_name) - self.assertEqual(fwr.extra['portRange'], port_range) - self.assertEqual(fwr.extra['description'], description) + self.assertEqual(fwr.extra["portRange"], port_range) + self.assertEqual(fwr.extra["description"], description) def test_ex_create_forwarding_rule_targetpool_keyword(self): """Test backwards compatibility with the targetpool kwarg.""" - fwr_name = 'lcforwardingrule' - targetpool = 'lctargetpool' - region = 'us-central1' - address = self.driver.ex_get_address('lcaddress') - port_range = '8000-8500' - description = 'test forwarding rule' - fwr = self.driver.ex_create_forwarding_rule(fwr_name, - targetpool=targetpool, - region=region, - address=address, - port_range=port_range, - description=description) + fwr_name = "lcforwardingrule" + targetpool = "lctargetpool" + region = "us-central1" + address = self.driver.ex_get_address("lcaddress") + port_range = "8000-8500" + description = "test forwarding rule" + fwr = self.driver.ex_create_forwarding_rule( + fwr_name, + targetpool=targetpool, + region=region, + address=address, + port_range=port_range, + description=description, + ) self.assertTrue(isinstance(fwr, GCEForwardingRule)) self.assertEqual(fwr.name, fwr_name) self.assertEqual(fwr.region.name, region) - self.assertEqual(fwr.protocol, 'TCP') - self.assertEqual(fwr.extra['portRange'], port_range) - self.assertEqual(fwr.extra['description'], description) + self.assertEqual(fwr.protocol, "TCP") + self.assertEqual(fwr.extra["portRange"], port_range) + self.assertEqual(fwr.extra["description"], description) def test_ex_create_route(self): - route_name = 'lcdemoroute' - dest_range = '192.168.25.0/24' + route_name = "lcdemoroute" + dest_range = "192.168.25.0/24" priority = 1000 route = self.driver.ex_create_route(route_name, dest_range) self.assertTrue(isinstance(route, GCERoute)) self.assertEqual(route.name, route_name) self.assertEqual(route.priority, priority) self.assertTrue("tag1" in route.tags) - self.assertTrue(route.extra['nextHopInstance'].endswith('libcloud-100')) + self.assertTrue(route.extra["nextHopInstance"].endswith("libcloud-100")) self.assertEqual(route.dest_range, dest_range) def test_ex_create_network(self): - network_name = 'lcnetwork' - cidr = '10.11.0.0/16' - network = self.driver.ex_create_network(network_name, cidr) + network_name = "lcnetwork" + cidr = "10.11.0.0/16" + routing_mode = "REGIONAL" + network = self.driver.ex_create_network(network_name, cidr, routing_mode="regional") self.assertTrue(isinstance(network, GCENetwork)) self.assertEqual(network.name, network_name) self.assertEqual(network.cidr, cidr) + # Test using more options + description = "A custom network" + network = self.driver.ex_create_network( + network_name, cidr, description=description, routing_mode=routing_mode + ) + self.assertEqual(network.extra["description"], description) + self.assertEqual(network.extra["routingConfig"]["routingMode"], routing_mode) + + def test_ex_create_network_bad_options(self): + network_name = "lcnetwork" + cidr = "10.11.0.0/16" + self.assertRaises( + ValueError, self.driver.ex_create_network, network_name, cidr, mode="auto" + ) + self.assertRaises( + ValueError, self.driver.ex_create_network, network_name, cidr, mode="foobar" + ) + self.assertRaises( + ValueError, self.driver.ex_create_network, network_name, None, mode="legacy" + ) + self.assertRaises( + ValueError, + self.driver.ex_create_network, + network_name, + cidr, + routing_mode="universal", + ) + + def test_ex_set_machine_type_notstopped(self): + # get running node, change machine type + zone = "us-central1-a" + node = self.driver.ex_get_node("node-name", zone) + self.assertRaises(GoogleBaseError, self.driver.ex_set_machine_type, node, "custom-4-61440") + + def test_ex_set_machine_type(self): + # get stopped node, change machine type + zone = "us-central1-a" + node = self.driver.ex_get_node("stopped-node", zone) + self.assertEqual(node.size, "n1-standard-1") + self.assertEqual(node.extra["status"], "TERMINATED") + self.assertTrue(self.driver.ex_set_machine_type(node, "custom-4-11264")) + def test_ex_node_start(self): - zone = 'us-central1-a' - node = self.driver.ex_get_node('stopped-node', zone) + zone = "us-central1-a" + node = self.driver.ex_get_node("stopped-node", zone) self.assertTrue(self.driver.ex_start_node(node)) def test_ex_node_stop(self): - zone = 'us-central1-a' - node = self.driver.ex_get_node('node-name', zone) + zone = "us-central1-a" + node = self.driver.ex_get_node("node-name", zone) self.assertTrue(self.driver.ex_stop_node(node)) # try and stop a stopped node (should work) - zone = 'us-central1-a' - node = self.driver.ex_get_node('stopped-node', zone) + zone = "us-central1-a" + node = self.driver.ex_get_node("stopped-node", zone) self.assertTrue(self.driver.ex_stop_node(node)) def test_create_node_req(self): - image = self.driver.ex_get_image('debian-7') - size = self.driver.ex_get_size('n1-standard-1') + image = self.driver.ex_get_image("debian-7") + size = self.driver.ex_get_size("n1-standard-1") location = self.driver.zone - network = self.driver.ex_get_network('default') - tags = ['libcloud'] - metadata = [{'key': 'test_key', 'value': 'test_value'}] - boot_disk = self.driver.ex_get_volume('lcdisk') - node_request, node_data = self.driver._create_node_req('lcnode', size, - image, location, - network, tags, - metadata, - boot_disk) - self.assertEqual(node_request, '/zones/%s/instances' % location.name) - self.assertEqual(node_data['metadata']['items'][0]['key'], 'test_key') - self.assertEqual(node_data['tags']['items'][0], 'libcloud') - self.assertEqual(node_data['name'], 'lcnode') - self.assertTrue(node_data['disks'][0]['boot']) - self.assertIsInstance(node_data['serviceAccounts'], list) - self.assertIsInstance(node_data['serviceAccounts'][0], dict) - self.assertEqual(node_data['serviceAccounts'][0]['email'], 'default') - self.assertIsInstance(node_data['serviceAccounts'][0]['scopes'], list) - self.assertEqual(len(node_data['serviceAccounts'][0]['scopes']), 1) + network = self.driver.ex_get_network("default") + tags = ["libcloud"] + metadata = [{"key": "test_key", "value": "test_value"}] + boot_disk = self.driver.ex_get_volume("lcdisk") + node_request, node_data = self.driver._create_node_req( + "lcnode", size, image, location, network, tags, metadata, boot_disk + ) + self.assertEqual(node_request, "/zones/%s/instances" % location.name) + self.assertEqual(node_data["metadata"]["items"][0]["key"], "test_key") + self.assertEqual(node_data["tags"]["items"][0], "libcloud") + self.assertEqual(node_data["name"], "lcnode") + self.assertTrue(node_data["disks"][0]["boot"]) + self.assertIsInstance(node_data["serviceAccounts"], list) + self.assertIsInstance(node_data["serviceAccounts"][0], dict) + self.assertEqual(node_data["serviceAccounts"][0]["email"], "default") + self.assertIsInstance(node_data["serviceAccounts"][0]["scopes"], list) + self.assertEqual(len(node_data["serviceAccounts"][0]["scopes"]), 1) + self.assertEqual(len(node_data["networkInterfaces"]), 1) + self.assertTrue(node_data["networkInterfaces"][0]["network"].startswith("https://")) + + def test_create_node_location_not_provided(self): + # location is not specified neither via datacenter constructor argument + # nor via location method argument + node_name = "node-name" + size = self.driver.ex_get_size("n1-standard-1") + del size.extra["zone"] + image = self.driver.ex_get_image("debian-7") + self.driver.zone = None + + expected_msg = "Zone not provided" + self.assertRaisesRegex( + ValueError, expected_msg, self.driver.create_node, node_name, size, image + ) + + def test_create_node_location_not_provided_inferred_from_size(self): + # test a scenario where node location is inferred from NodeSize zone attribute + node_name = "node-name" + size = self.driver.ex_get_size("n1-standard-1") + image = self.driver.ex_get_image("debian-7") + zone = self.driver.ex_list_zones()[0] + zone = self.driver.ex_get_zone("us-central1-a") + + self.driver.zone = None + size.extra["zone"] = zone + + node = self.driver.create_node(node_name, size, image) + self.assertTrue(node) + + def test_create_node_network_opts(self): + node_name = "node-name" + size = self.driver.ex_get_size("n1-standard-1") + image = self.driver.ex_get_image("debian-7") + zone = self.driver.ex_get_zone("us-central1-a") + network = self.driver.ex_get_network("lcnetwork") + address = self.driver.ex_get_address("lcaddress") + ex_nic_gce_struct = [ + { + "network": "global/networks/lcnetwork", + "accessConfigs": [{"name": "lcnetwork-test", "type": "ONE_TO_ONE_NAT"}], + } + ] + # Test using default + node = self.driver.create_node(node_name, size, image) + self.assertEqual(node.extra["networkInterfaces"][0]["name"], "nic0") + + # Test using just the network + node = self.driver.create_node(node_name, size, image, location=zone, ex_network=network) + self.assertEqual(node.extra["networkInterfaces"][0]["name"], "nic0") + + # Test using just the struct + node = self.driver.create_node( + node_name, size, image, location=zone, ex_nic_gce_struct=ex_nic_gce_struct + ) + self.assertEqual(node.extra["networkInterfaces"][0]["name"], "nic0") + + # Test both address and struct, should fail + self.assertRaises( + ValueError, + self.driver.create_node, + node_name, + size, + image, + location=zone, + external_ip=address, + ex_nic_gce_struct=ex_nic_gce_struct, + ) + + # Test both ex_network and struct, should fail + self.assertRaises( + ValueError, + self.driver.create_node, + node_name, + size, + image, + location=zone, + ex_network=network, + ex_nic_gce_struct=ex_nic_gce_struct, + ) + + def test_create_node_subnetwork_opts(self): + node_name = "sn-node-name" + size = self.driver.ex_get_size("n1-standard-1") + image = self.driver.ex_get_image("debian-7") + zone = self.driver.ex_get_zone("us-central1-a") + network = self.driver.ex_get_network("custom-network") + subnetwork = self.driver.ex_get_subnetwork("cf-972cf02e6ad49112") + + ex_nic_gce_struct = [ + { + "network": "global/networks/custom-network", + "subnetwork": "projects/project_name/regions/us-central1/subnetworks/cf-972cf02e6ad49112", + "accessConfigs": [{"name": "External NAT", "type": "ONE_TO_ONE_NAT"}], + } + ] + # Test using just the network and subnetwork + node = self.driver.create_node( + node_name, + size, + image, + location=zone, + ex_network=network, + ex_subnetwork=subnetwork, + ) + self.assertEqual(node.extra["networkInterfaces"][0]["name"], "nic0") + self.assertEqual( + node.extra["networkInterfaces"][0]["subnetwork"].split("/")[-1], + "cf-972cf02e6ad49112", + ) + + # Test using just the struct + node = self.driver.create_node( + node_name, size, image, location=zone, ex_nic_gce_struct=ex_nic_gce_struct + ) + self.assertEqual(node.extra["networkInterfaces"][0]["name"], "nic0") + self.assertEqual( + node.extra["networkInterfaces"][0]["subnetwork"].split("/")[-1], + "cf-972cf02e6ad49112", + ) + + # Test using subnetwork selfLink + node = self.driver.create_node( + node_name, + size, + image, + location=zone, + ex_network=network, + ex_subnetwork=subnetwork.extra["selfLink"], + ) + self.assertEqual(node.extra["networkInterfaces"][0]["name"], "nic0") + self.assertEqual( + node.extra["networkInterfaces"][0]["subnetwork"].split("/")[-1], + "cf-972cf02e6ad49112", + ) def test_create_node_disk_opts(self): - node_name = 'node-name' - size = self.driver.ex_get_size('n1-standard-1') - image = self.driver.ex_get_image('debian-7') - boot_disk = self.driver.ex_get_volume('lcdisk') - disk_type = self.driver.ex_get_disktype('pd-ssd', 'us-central1-a') + node_name = "node-name" + size = self.driver.ex_get_size("n1-standard-1") + image = self.driver.ex_get_image("debian-7") + boot_disk = self.driver.ex_get_volume("lcdisk") + disk_type = self.driver.ex_get_disktype("pd-ssd", "us-central1-a") DEMO_BASE_NAME = "lc-test" gce_disk_struct = [ { "type": "PERSISTENT", - "deviceName": '%s-gstruct' % DEMO_BASE_NAME, + "deviceName": "%s-gstruct" % DEMO_BASE_NAME, "initializeParams": { - "diskName": '%s-gstruct' % DEMO_BASE_NAME, - "sourceImage": image.extra['selfLink'] + "diskName": "%s-gstruct" % DEMO_BASE_NAME, + "sourceImage": image.extra["selfLink"], }, "boot": True, - "autoDelete": True + "autoDelete": True, }, { "type": "SCRATCH", - "deviceName": '%s-gstruct-lssd' % DEMO_BASE_NAME, - "initializeParams": { - "diskType": disk_type.extra['selfLink'] - }, - "autoDelete": True - } + "deviceName": "%s-gstruct-lssd" % DEMO_BASE_NAME, + "initializeParams": {"diskType": disk_type.extra["selfLink"]}, + "autoDelete": True, + }, ] - self.assertRaises(ValueError, self.driver.create_node, node_name, - size, None) + self.assertRaises(ValueError, self.driver.create_node, node_name, size, None) node = self.driver.create_node(node_name, size, image) self.assertTrue(isinstance(node, Node)) - node = self.driver.create_node(node_name, size, None, - ex_boot_disk=boot_disk) + node = self.driver.create_node(node_name, size, None, ex_boot_disk=boot_disk) self.assertTrue(isinstance(node, Node)) - node = self.driver.create_node(node_name, size, None, - ex_disks_gce_struct=gce_disk_struct) + node = self.driver.create_node(node_name, size, None, ex_disks_gce_struct=gce_disk_struct) self.assertTrue(isinstance(node, Node)) - self.assertRaises(ValueError, self.driver.create_node, node_name, - size, None, ex_boot_disk=boot_disk, - ex_disks_gce_struct=gce_disk_struct) + self.assertRaises( + ValueError, + self.driver.create_node, + node_name, + size, + None, + ex_boot_disk=boot_disk, + ex_disks_gce_struct=gce_disk_struct, + ) def test_create_node(self): - node_name = 'node-name' - image = self.driver.ex_get_image('debian-7') - size = self.driver.ex_get_size('n1-standard-1') + node_name = "node-name" + image = self.driver.ex_get_image("debian-7") + size = self.driver.ex_get_size("n1-standard-1") node = self.driver.create_node(node_name, size, image) self.assertTrue(isinstance(node, Node)) self.assertEqual(node.name, node_name) + def test_create_node_disk_size(self): + node_name = "node-name" + image = self.driver.ex_get_image("debian-7") + size = self.driver.ex_get_size("n1-standard-1") + disk_size = 25 + node = self.driver.create_node(node_name, size, image, ex_disk_size=disk_size) + self.assertTrue(isinstance(node, Node)) + self.assertEqual(node.name, node_name) + self.assertEqual(node.extra["boot_disk"].size, str(disk_size)) + + def test_create_node_image_family(self): + node_name = "node-name" + size = self.driver.ex_get_size("n1-standard-1") + node = self.driver.create_node(node_name, size, image=None, ex_image_family="coreos-stable") + self.assertTrue(isinstance(node, Node)) + self.assertEqual(node.name, node_name) + + image = self.driver.ex_get_image("debian-7") + self.assertRaises( + ValueError, + self.driver.create_node, + node_name, + size, + image, + ex_image_family="coreos-stable", + ) + def test_create_node_req_with_serviceaccounts(self): - image = self.driver.ex_get_image('debian-7') - size = self.driver.ex_get_size('n1-standard-1') + image = self.driver.ex_get_image("debian-7") + size = self.driver.ex_get_size("n1-standard-1") location = self.driver.zone - network = self.driver.ex_get_network('default') + network = self.driver.ex_get_network("default") # ex_service_accounts with specific scopes, default 'email' - ex_sa = [{'scopes': ['compute-ro', 'pubsub', 'storage-ro']}] - node_request, node_data = self.driver._create_node_req('lcnode', size, - image, location, - network, - ex_service_accounts=ex_sa) - self.assertIsInstance(node_data['serviceAccounts'], list) - self.assertIsInstance(node_data['serviceAccounts'][0], dict) - self.assertEqual(node_data['serviceAccounts'][0]['email'], 'default') - self.assertIsInstance(node_data['serviceAccounts'][0]['scopes'], list) - self.assertEqual(len(node_data['serviceAccounts'][0]['scopes']), 3) - self.assertTrue('https://www.googleapis.com/auth/devstorage.read_only' - in node_data['serviceAccounts'][0]['scopes']) - self.assertTrue('https://www.googleapis.com/auth/compute.readonly' - in node_data['serviceAccounts'][0]['scopes']) + ex_sa = [{"scopes": ["compute-ro", "pubsub", "storage-ro"]}] + node_request, node_data = self.driver._create_node_req( + "lcnode", size, image, location, network, ex_service_accounts=ex_sa + ) + self.assertIsInstance(node_data["serviceAccounts"], list) + self.assertIsInstance(node_data["serviceAccounts"][0], dict) + self.assertEqual(node_data["serviceAccounts"][0]["email"], "default") + self.assertIsInstance(node_data["serviceAccounts"][0]["scopes"], list) + self.assertEqual(len(node_data["serviceAccounts"][0]["scopes"]), 3) + self.assertTrue( + "https://www.googleapis.com/auth/devstorage.read_only" + in node_data["serviceAccounts"][0]["scopes"] + ) + self.assertTrue( + "https://www.googleapis.com/auth/compute.readonly" + in node_data["serviceAccounts"][0]["scopes"] + ) def test_format_metadata(self): - in_md = [{'key': 'k0', 'value': 'v0'}, {'key': 'k1', 'value': 'v1'}] - out_md = self.driver._format_metadata('fp', in_md) - self.assertTrue('fingerprint' in out_md) - self.assertEqual(out_md['fingerprint'], 'fp') - self.assertTrue('items' in out_md) - self.assertEqual(len(out_md['items']), 2) - self.assertTrue(out_md['items'][0]['key'] in ['k0', 'k1']) - self.assertTrue(out_md['items'][0]['value'] in ['v0', 'v1']) - - in_md = [{'k0': 'v0'}, {'k1': 'v1'}] - out_md = self.driver._format_metadata('fp', in_md) - self.assertTrue('fingerprint' in out_md) - self.assertEqual(out_md['fingerprint'], 'fp') - self.assertTrue('items' in out_md) - self.assertEqual(len(out_md['items']), 2) - self.assertTrue(out_md['items'][0]['key'] in ['k0', 'k1']) - self.assertTrue(out_md['items'][0]['value'] in ['v0', 'v1']) - - in_md = {'key': 'k0', 'value': 'v0'} - out_md = self.driver._format_metadata('fp', in_md) - self.assertTrue('fingerprint' in out_md) - self.assertEqual(out_md['fingerprint'], 'fp') - self.assertTrue('items' in out_md) - self.assertEqual(len(out_md['items']), 1, out_md) - self.assertEqual(out_md['items'][0]['key'], 'k0') - self.assertEqual(out_md['items'][0]['value'], 'v0') - - in_md = {'k0': 'v0'} - out_md = self.driver._format_metadata('fp', in_md) - self.assertTrue('fingerprint' in out_md) - self.assertEqual(out_md['fingerprint'], 'fp') - self.assertTrue('items' in out_md) - self.assertEqual(len(out_md['items']), 1) - self.assertEqual(out_md['items'][0]['key'], 'k0') - self.assertEqual(out_md['items'][0]['value'], 'v0') - - in_md = {'k0': 'v0', 'k1': 'v1', 'k2': 'v2'} - out_md = self.driver._format_metadata('fp', in_md) - self.assertTrue('fingerprint' in out_md) - self.assertEqual(out_md['fingerprint'], 'fp') - self.assertTrue('items' in out_md) - self.assertEqual(len(out_md['items']), 3) - keys = [x['key'] for x in out_md['items']] - vals = [x['value'] for x in out_md['items']] + in_md = [{"key": "k0", "value": "v0"}, {"key": "k1", "value": "v1"}] + out_md = self.driver._format_metadata("fp", in_md) + self.assertTrue("fingerprint" in out_md) + self.assertEqual(out_md["fingerprint"], "fp") + self.assertTrue("items" in out_md) + self.assertEqual(len(out_md["items"]), 2) + self.assertTrue(out_md["items"][0]["key"] in ["k0", "k1"]) + self.assertTrue(out_md["items"][0]["value"] in ["v0", "v1"]) + + in_md = [{"k0": "v0"}, {"k1": "v1"}] + out_md = self.driver._format_metadata("fp", in_md) + self.assertTrue("fingerprint" in out_md) + self.assertEqual(out_md["fingerprint"], "fp") + self.assertTrue("items" in out_md) + self.assertEqual(len(out_md["items"]), 2) + self.assertTrue(out_md["items"][0]["key"] in ["k0", "k1"]) + self.assertTrue(out_md["items"][0]["value"] in ["v0", "v1"]) + + in_md = {"key": "k0", "value": "v0"} + out_md = self.driver._format_metadata("fp", in_md) + self.assertTrue("fingerprint" in out_md) + self.assertEqual(out_md["fingerprint"], "fp") + self.assertTrue("items" in out_md) + self.assertEqual(len(out_md["items"]), 1, out_md) + self.assertEqual(out_md["items"][0]["key"], "k0") + self.assertEqual(out_md["items"][0]["value"], "v0") + + in_md = {"k0": "v0"} + out_md = self.driver._format_metadata("fp", in_md) + self.assertTrue("fingerprint" in out_md) + self.assertEqual(out_md["fingerprint"], "fp") + self.assertTrue("items" in out_md) + self.assertEqual(len(out_md["items"]), 1) + self.assertEqual(out_md["items"][0]["key"], "k0") + self.assertEqual(out_md["items"][0]["value"], "v0") + + in_md = {"k0": "v0", "k1": "v1", "k2": "v2"} + out_md = self.driver._format_metadata("fp", in_md) + self.assertTrue("fingerprint" in out_md) + self.assertEqual(out_md["fingerprint"], "fp") + self.assertTrue("items" in out_md) + self.assertEqual(len(out_md["items"]), 3) + keys = [x["key"] for x in out_md["items"]] + vals = [x["value"] for x in out_md["items"]] keys.sort() vals.sort() - self.assertEqual(keys, ['k0', 'k1', 'k2']) - self.assertEqual(vals, ['v0', 'v1', 'v2']) - - in_md = {'items': [{'key': 'k0', 'value': 'v0'}, - {'key': 'k1', 'value': 'v1'}]} - out_md = self.driver._format_metadata('fp', in_md) - self.assertTrue('fingerprint' in out_md) - self.assertEqual(out_md['fingerprint'], 'fp') - self.assertTrue('items' in out_md) - self.assertEqual(len(out_md['items']), 2) - self.assertTrue(out_md['items'][0]['key'] in ['k0', 'k1']) - self.assertTrue(out_md['items'][0]['value'] in ['v0', 'v1']) - - in_md = {'items': 'foo'} - self.assertRaises(ValueError, self.driver._format_metadata, 'fp', in_md) - in_md = {'items': {'key': 'k1', 'value': 'v0'}} - self.assertRaises(ValueError, self.driver._format_metadata, 'fp', in_md) - in_md = ['k0', 'v1'] - self.assertRaises(ValueError, self.driver._format_metadata, 'fp', in_md) + self.assertEqual(keys, ["k0", "k1", "k2"]) + self.assertEqual(vals, ["v0", "v1", "v2"]) + + in_md = {"items": [{"key": "k0", "value": "v0"}, {"key": "k1", "value": "v1"}]} + out_md = self.driver._format_metadata("fp", in_md) + self.assertTrue("fingerprint" in out_md) + self.assertEqual(out_md["fingerprint"], "fp") + self.assertTrue("items" in out_md) + self.assertEqual(len(out_md["items"]), 2) + self.assertTrue(out_md["items"][0]["key"] in ["k0", "k1"]) + self.assertTrue(out_md["items"][0]["value"] in ["v0", "v1"]) + + in_md = {"items": "foo"} + self.assertRaises(ValueError, self.driver._format_metadata, "fp", in_md) + in_md = {"items": {"key": "k1", "value": "v0"}} + self.assertRaises(ValueError, self.driver._format_metadata, "fp", in_md) + in_md = ["k0", "v1"] + self.assertRaises(ValueError, self.driver._format_metadata, "fp", in_md) def test_create_node_with_metadata(self): - node_name = 'node-name' - image = self.driver.ex_get_image('debian-7') - size = self.driver.ex_get_size('n1-standard-1') - zone = self.driver.ex_get_zone('us-central1-a') + node_name = "node-name" + image = self.driver.ex_get_image("debian-7") + size = self.driver.ex_get_size("n1-standard-1") + zone = self.driver.ex_get_zone("us-central1-a") # md is a list of dicts, each with 'key' and 'value' for # backwards compatibility - md = [{'key': 'k0', 'value': 'v0'}, {'key': 'k1', 'value': 'v1'}] - request, data = self.driver._create_node_req(node_name, size, image, - zone, metadata=md) - self.assertTrue('items' in data['metadata']) - self.assertEqual(len(data['metadata']['items']), 2) + md = [{"key": "k0", "value": "v0"}, {"key": "k1", "value": "v1"}] + request, data = self.driver._create_node_req(node_name, size, image, zone, metadata=md) + self.assertTrue("items" in data["metadata"]) + self.assertEqual(len(data["metadata"]["items"]), 2) # md doesn't contain "items" key - md = {'key': 'key1', 'value': 'value1'} - request, data = self.driver._create_node_req(node_name, size, image, - zone, metadata=md) - self.assertTrue('items' in data['metadata']) - self.assertEqual(len(data['metadata']['items']), 1) + md = {"key": "key1", "value": "value1"} + request, data = self.driver._create_node_req(node_name, size, image, zone, metadata=md) + self.assertTrue("items" in data["metadata"]) + self.assertEqual(len(data["metadata"]["items"]), 1) # md contains "items" key - md = {'items': [{'key': 'k0', 'value': 'v0'}]} - request, data = self.driver._create_node_req(node_name, size, image, - zone, metadata=md) - self.assertTrue('items' in data['metadata']) - self.assertEqual(len(data['metadata']['items']), 1) - self.assertEqual(data['metadata']['items'][0]['key'], 'k0') - self.assertEqual(data['metadata']['items'][0]['value'], 'v0') + md = {"items": [{"key": "k0", "value": "v0"}]} + request, data = self.driver._create_node_req(node_name, size, image, zone, metadata=md) + self.assertTrue("items" in data["metadata"]) + self.assertEqual(len(data["metadata"]["items"]), 1) + self.assertEqual(data["metadata"]["items"][0]["key"], "k0") + self.assertEqual(data["metadata"]["items"][0]["value"], "v0") + + def test_create_node_with_accelerator(self): + node_name = "node-name" + image = self.driver.ex_get_image("debian-7") + size = self.driver.ex_get_size("n1-standard-1") + zone = self.driver.ex_get_zone("us-central1-a") + request, data = self.driver._create_node_req( + node_name, + size, + image, + zone, + ex_accelerator_type="nvidia-tesla-k80", + ex_accelerator_count=3, + ) + self.assertTrue("guestAccelerators" in data) + self.assertEqual(len(data["guestAccelerators"]), 1) + self.assertTrue("nvidia-tesla-k80" in data["guestAccelerators"][0]["acceleratorType"]) + self.assertEqual(data["guestAccelerators"][0]["acceleratorCount"], 3) + + def test_create_node_with_labels(self): + node_name = "node-name" + image = self.driver.ex_get_image("debian-7") + size = self.driver.ex_get_size("n1-standard-1") + zone = self.driver.ex_get_zone("us-central1-a") + + # labels is a dict + labels = {"label1": "v1", "label2": "v2"} + request, data = self.driver._create_node_req(node_name, size, image, zone, ex_labels=labels) + self.assertTrue(data["labels"] is not None) + self.assertEqual(len(data["labels"]), 2) + self.assertEqual(data["labels"]["label1"], "v1") + self.assertEqual(data["labels"]["label2"], "v2") def test_create_node_existing(self): - node_name = 'libcloud-demo-europe-np-node' - image = self.driver.ex_get_image('debian-7') - size = self.driver.ex_get_size('n1-standard-1', zone='europe-west1-a') - self.assertRaises(ResourceExistsError, self.driver.create_node, - node_name, size, image, location='europe-west1-a') + node_name = "libcloud-demo-europe-np-node" + image = self.driver.ex_get_image("debian-7") + size = self.driver.ex_get_size("n1-standard-1", zone="europe-west1-a") + self.assertRaises( + ResourceExistsError, + self.driver.create_node, + node_name, + size, + image, + location="europe-west1-a", + ) def test_ex_create_multiple_nodes(self): - base_name = 'lcnode' - image = self.driver.ex_get_image('debian-7') - size = self.driver.ex_get_size('n1-standard-1') + base_name = "lcnode" + image = self.driver.ex_get_image("debian-7") + size = self.driver.ex_get_size("n1-standard-1") number = 2 - nodes = self.driver.ex_create_multiple_nodes(base_name, size, image, - number) + disk_size = "25" + # NOTE: We use small poll_interval to speed up the tests + nodes = self.driver.ex_create_multiple_nodes( + base_name, size, image, number, ex_disk_size=disk_size, poll_interval=0.1 + ) self.assertEqual(len(nodes), 2) self.assertTrue(isinstance(nodes[0], Node)) self.assertTrue(isinstance(nodes[1], Node)) - self.assertEqual(nodes[0].name, '%s-000' % base_name) - self.assertEqual(nodes[1].name, '%s-001' % base_name) + self.assertEqual(nodes[0].name, "%s-000" % base_name) + self.assertEqual(nodes[1].name, "%s-001" % base_name) + self.assertEqual(nodes[0].extra["boot_disk"].size, disk_size) + self.assertEqual(nodes[1].extra["boot_disk"].size, disk_size) + + def test_ex_create_multiple_nodes_image_family(self): + base_name = "lcnode" + image = None + size = self.driver.ex_get_size("n1-standard-1") + number = 2 + # NOTE: We use small poll_interval to speed up the tests + nodes = self.driver.ex_create_multiple_nodes( + base_name, + size, + image, + number, + ex_image_family="coreos-stable", + poll_interval=0.1, + ) + self.assertEqual(len(nodes), 2) + self.assertTrue(isinstance(nodes[0], Node)) + self.assertTrue(isinstance(nodes[1], Node)) + self.assertEqual(nodes[0].name, "%s-000" % base_name) + self.assertEqual(nodes[1].name, "%s-001" % base_name) + + image = self.driver.ex_get_image("debian-7") + self.assertRaises( + ValueError, + self.driver.ex_create_multiple_nodes, + base_name, + size, + image, + number, + ex_image_family="coreos-stable", + ) + + def test_ex_create_multiple_nodes_timeout_preserves_progress(self): + image = self.driver.ex_get_image("debian-7") + size = self.driver.ex_get_size("n1-standard-1") + created = Node("node-id", "lcnode-000", NodeState.RUNNING, [], [], self.driver) + failed = GCEFailedNode("lcnode-001", "quota exceeded", "QUOTA_EXCEEDED") + + def create_node(status, node_attrs): + if status["name"] == created.name: + status["node"] = created + elif status["name"] == failed.name: + status["node"] = failed + else: + status["node_response"] = {"selfLink": "pending-operation"} + + with ( + mock.patch.object(self.driver, "_multi_create_node", side_effect=create_node), + mock.patch("libcloud.compute.drivers.gce.time") as clock, + mock.patch.object(self.driver, "destroy_node") as destroy, + ): + clock.time.side_effect = [0, 0, 5] + with self.assertRaises(GCEMultipleNodesTimeoutError) as raised: + self.driver.ex_create_multiple_nodes( + "lcnode", size, image, 3, timeout=5, poll_interval=0 + ) + error = raised.exception + self.assertEqual(error.nodes, [created, failed]) + self.assertEqual(error.pending_node_names, ["lcnode-002"]) + self.assertIn("5 sec", str(error)) + self.assertIs(error.driver, self.driver) + destroy.assert_not_called() + + def test_ex_create_multiple_nodes_timeout_before_start(self): + image = self.driver.ex_get_image("debian-7") + size = self.driver.ex_get_size("n1-standard-1") + with mock.patch.object(self.driver, "_multi_create_node") as create: + with self.assertRaises(GCEMultipleNodesTimeoutError) as raised: + self.driver.ex_create_multiple_nodes("lcnode", size, image, 2, timeout=0) + self.assertEqual(raised.exception.nodes, []) + self.assertEqual(raised.exception.pending_node_names, ["lcnode-000", "lcnode-001"]) + create.assert_not_called() def test_ex_create_targethttpproxy(self): - proxy_name = 'web-proxy' - urlmap_name = 'web-map' + proxy_name = "web-proxy" + urlmap_name = "web-map" for urlmap in (urlmap_name, self.driver.ex_get_urlmap(urlmap_name)): proxy = self.driver.ex_create_targethttpproxy(proxy_name, urlmap) self.assertTrue(isinstance(proxy, GCETargetHttpProxy)) self.assertEqual(proxy_name, proxy.name) def test_ex_create_targetinstance(self): - targetinstance_name = 'lctargetinstance' - zone = 'us-central1-a' - node = self.driver.ex_get_node('node-name', zone) + targetinstance_name = "lctargetinstance" + zone = "us-central1-a" + node = self.driver.ex_get_node("node-name", zone) targetinstance = self.driver.ex_create_targetinstance( - targetinstance_name, zone=zone, node=node) + targetinstance_name, zone=zone, node=node + ) self.assertEqual(targetinstance.name, targetinstance_name) self.assertEqual(targetinstance.zone.name, zone) def test_ex_create_targetpool(self): - targetpool_name = 'lctargetpool' - region = 'us-central1' - healthchecks = ['libcloud-lb-demo-healthcheck'] - node1 = self.driver.ex_get_node('libcloud-lb-demo-www-000', - 'us-central1-b') - node2 = self.driver.ex_get_node('libcloud-lb-demo-www-001', - 'us-central1-b') + targetpool_name = "lctargetpool" + region = "us-central1" + healthchecks = ["libcloud-lb-demo-healthcheck"] + node1 = self.driver.ex_get_node("libcloud-lb-demo-www-000", "us-central1-b") + node2 = self.driver.ex_get_node("libcloud-lb-demo-www-001", "us-central1-b") nodes = [node1, node2] targetpool = self.driver.ex_create_targetpool( - targetpool_name, region=region, healthchecks=healthchecks, - nodes=nodes) + targetpool_name, region=region, healthchecks=healthchecks, nodes=nodes + ) self.assertEqual(targetpool.name, targetpool_name) self.assertEqual(len(targetpool.nodes), len(nodes)) self.assertEqual(targetpool.region.name, region) def test_ex_create_targetpool_session_affinity(self): - targetpool_name = 'lctargetpool-sticky' - region = 'us-central1' - session_affinity = 'CLIENT_IP_PROTO' + targetpool_name = "lctargetpool-sticky" + region = "us-central1" + session_affinity = "CLIENT_IP_PROTO" targetpool = self.driver.ex_create_targetpool( - targetpool_name, region=region, - session_affinity=session_affinity) + targetpool_name, region=region, session_affinity=session_affinity + ) self.assertEqual(targetpool.name, targetpool_name) - self.assertEqual(targetpool.extra.get('sessionAffinity'), - session_affinity) + self.assertEqual(targetpool.extra.get("sessionAffinity"), session_affinity) def test_ex_create_urlmap(self): - urlmap_name = 'web-map' - for service in ('web-service', - self.driver.ex_get_backendservice('web-service')): + urlmap_name = "web-map" + for service in ( + "web-service", + self.driver.ex_get_backendservice("web-service"), + ): urlmap = self.driver.ex_create_urlmap(urlmap_name, service) self.assertTrue(isinstance(urlmap, GCEUrlMap)) self.assertEqual(urlmap_name, urlmap.name) + def test_create_volume_image_family(self): + volume_name = "lcdisk" + size = 10 + volume = self.driver.create_volume(size, volume_name, ex_image_family="coreos-stable") + self.assertTrue(isinstance(volume, StorageVolume)) + self.assertEqual(volume.name, volume_name) + + image = self.driver.ex_get_image("debian-7") + self.assertRaises( + ValueError, + self.driver.create_volume, + size, + volume_name, + image=image, + ex_image_family="coreos-stable", + ) + + def test_create_volume_location(self): + volume_name = "lcdisk" + size = 10 + zone = self.driver.zone + volume = self.driver.create_volume(size, volume_name, location=zone) + self.assertTrue(isinstance(volume, StorageVolume)) + self.assertEqual(volume.name, volume_name) + def test_ex_create_volume_snapshot(self): - snapshot_name = 'lcsnapshot' - volume = self.driver.ex_get_volume('lcdisk') + snapshot_name = "lcsnapshot" + volume = self.driver.ex_get_volume("lcdisk") snapshot = volume.snapshot(snapshot_name) + self.assertEqual(snapshot.name, snapshot_name) - self.assertEqual(snapshot.size, '10') + self.assertEqual(snapshot.size, "10") def test_create_volume_ssd(self): - volume_name = 'lcdisk' + volume_name = "lcdisk" size = 10 - volume = self.driver.create_volume(size, volume_name, - ex_disk_type='pd-ssd') + volume = self.driver.create_volume(size, volume_name, ex_disk_type="pd-ssd") self.assertTrue(isinstance(volume, StorageVolume)) - self.assertEqual(volume.extra['type'], 'pd-ssd') + self.assertEqual(volume.extra["type"], "pd-ssd") def test_create_volume(self): - volume_name = 'lcdisk' + volume_name = "lcdisk" size = 10 volume = self.driver.create_volume(size, volume_name) self.assertTrue(isinstance(volume, StorageVolume)) self.assertEqual(volume.name, volume_name) + def test_ex_set_volume_labels(self): + volume_name = "lcdisk" + zone = self.driver.zone + volume_labels = {"one": "1", "two": "2", "three": "3"} + size = 10 + new_vol = self.driver.create_volume(size, volume_name, location=zone) + self.assertTrue(self.driver.ex_set_volume_labels(new_vol, labels=volume_labels)) + exist_vol = self.driver.ex_get_volume(volume_name, self.driver.zone) + self.assertEqual(exist_vol.extra["labels"], volume_labels) + def test_ex_update_healthcheck(self): - healthcheck_name = 'lchealthcheck' + healthcheck_name = "lchealthcheck" healthcheck = self.driver.ex_get_healthcheck(healthcheck_name) healthcheck.port = 9000 healthcheck2 = self.driver.ex_update_healthcheck(healthcheck) self.assertTrue(isinstance(healthcheck2, GCEHealthCheck)) def test_ex_update_firewall(self): - firewall_name = 'lcfirewall' + firewall_name = "lcfirewall" firewall = self.driver.ex_get_firewall(firewall_name) - firewall.source_ranges = ['10.0.0.0/16'] - firewall.source_tags = ['libcloud', 'test'] + firewall.source_ranges = ["10.0.0.0/16"] + firewall.description = "LCFirewall-2" firewall2 = self.driver.ex_update_firewall(firewall) self.assertTrue(isinstance(firewall2, GCEFirewall)) def test_ex_targetpool_gethealth(self): - targetpool = self.driver.ex_get_targetpool('lb-pool') - health = targetpool.get_health('libcloud-lb-demo-www-000') + targetpool = self.driver.ex_get_targetpool("lb-pool") + health = targetpool.get_health("libcloud-lb-demo-www-000") self.assertEqual(len(health), 1) - self.assertTrue('node' in health[0]) - self.assertTrue('health' in health[0]) - self.assertEqual(health[0]['health'], 'UNHEALTHY') + self.assertTrue("node" in health[0]) + self.assertTrue("health" in health[0]) + self.assertEqual(health[0]["health"], "UNHEALTHY") def test_ex_targetpool_with_backup_pool(self): - targetpool = self.driver.ex_get_targetpool('lb-pool') - self.assertTrue('backupPool' in targetpool.extra) - self.assertTrue('failoverRatio' in targetpool.extra) + targetpool = self.driver.ex_get_targetpool("lb-pool") + self.assertTrue("backupPool" in targetpool.extra) + self.assertTrue("failoverRatio" in targetpool.extra) def test_ex_targetpool_setbackup(self): - targetpool = self.driver.ex_get_targetpool('lb-pool') - backup_targetpool = self.driver.ex_get_targetpool('backup-pool') - self.assertTrue(targetpool.set_backup_targetpool(backup_targetpool, - 0.1)) + targetpool = self.driver.ex_get_targetpool("lb-pool") + backup_targetpool = self.driver.ex_get_targetpool("backup-pool") + self.assertTrue(targetpool.set_backup_targetpool(backup_targetpool, 0.1)) def test_ex_targetpool_remove_add_node(self): - targetpool = self.driver.ex_get_targetpool('lctargetpool') - node = self.driver.ex_get_node('libcloud-lb-demo-www-001', - 'us-central1-b') + targetpool = self.driver.ex_get_targetpool("lctargetpool") + node = self.driver.ex_get_node("libcloud-lb-demo-www-001", "us-central1-b") remove_node = self.driver.ex_targetpool_remove_node(targetpool, node) self.assertTrue(remove_node) self.assertEqual(len(targetpool.nodes), 1) - add_node = self.driver.ex_targetpool_add_node(targetpool, node.extra['selfLink']) + add_node = self.driver.ex_targetpool_add_node(targetpool, node.extra["selfLink"]) self.assertTrue(add_node) self.assertEqual(len(targetpool.nodes), 2) - remove_node = self.driver.ex_targetpool_remove_node(targetpool, node.extra['selfLink']) + remove_node = self.driver.ex_targetpool_remove_node(targetpool, node.extra["selfLink"]) self.assertTrue(remove_node) self.assertEqual(len(targetpool.nodes), 1) @@ -799,50 +1853,59 @@ def test_ex_targetpool_remove_add_node(self): self.assertEqual(len(targetpool.nodes), 2) # check that duplicates are filtered - add_node = self.driver.ex_targetpool_add_node(targetpool, node.extra['selfLink']) + add_node = self.driver.ex_targetpool_add_node(targetpool, node.extra["selfLink"]) self.assertTrue(add_node) self.assertEqual(len(targetpool.nodes), 2) def test_ex_targetpool_remove_add_healthcheck(self): - targetpool = self.driver.ex_get_targetpool('lctargetpool') - healthcheck = self.driver.ex_get_healthcheck( - 'libcloud-lb-demo-healthcheck') - remove_healthcheck = self.driver.ex_targetpool_remove_healthcheck( - targetpool, healthcheck) + targetpool = self.driver.ex_get_targetpool("lctargetpool") + healthcheck = self.driver.ex_get_healthcheck("libcloud-lb-demo-healthcheck") + remove_healthcheck = self.driver.ex_targetpool_remove_healthcheck(targetpool, healthcheck) self.assertTrue(remove_healthcheck) self.assertEqual(len(targetpool.healthchecks), 0) - add_healthcheck = self.driver.ex_targetpool_add_healthcheck( - targetpool, healthcheck) + add_healthcheck = self.driver.ex_targetpool_add_healthcheck(targetpool, healthcheck) self.assertTrue(add_healthcheck) self.assertEqual(len(targetpool.healthchecks), 1) def test_reboot_node(self): - node = self.driver.ex_get_node('node-name') + node = self.driver.ex_get_node("node-name") reboot = self.driver.reboot_node(node) self.assertTrue(reboot) def test_ex_set_node_tags(self): - new_tags = ['libcloud'] - node = self.driver.ex_get_node('node-name') + new_tags = ["libcloud"] + node = self.driver.ex_get_node("node-name") set_tags = self.driver.ex_set_node_tags(node, new_tags) self.assertTrue(set_tags) def test_attach_volume_invalid_usecase(self): - node = self.driver.ex_get_node('node-name') + node = self.driver.ex_get_node("node-name") self.assertRaises(ValueError, self.driver.attach_volume, node, None) - self.assertRaises(ValueError, self.driver.attach_volume, node, None, - ex_source='foo/bar', device=None) + self.assertRaises( + ValueError, + self.driver.attach_volume, + node, + None, + ex_source="foo/bar", + device=None, + ) def test_attach_volume(self): - volume = self.driver.ex_get_volume('lcdisk') - node = self.driver.ex_get_node('node-name') + volume = self.driver.ex_get_volume("lcdisk") + node = self.driver.ex_get_node("node-name") attach = volume.attach(node) self.assertTrue(attach) + def test_ex_resize_volume(self): + volume = self.driver.ex_get_volume("lcdisk") + desired_size = int(volume.size) + 8 + resize = self.driver.ex_resize_volume(volume, desired_size) + self.assertTrue(resize) + def test_detach_volume(self): - volume = self.driver.ex_get_volume('lcdisk') - node = self.driver.ex_get_node('node-name') + volume = self.driver.ex_get_volume("lcdisk") + node = self.driver.ex_get_node("node-name") # This fails since the node is required detach = volume.detach() self.assertFalse(detach) @@ -851,295 +1914,343 @@ def test_detach_volume(self): self.assertTrue(detach) def test_ex_destroy_address_global(self): - address = self.driver.ex_get_address('lcaddressglobal', 'global') - self.assertEqual(address.name, 'lcaddressglobal') - self.assertEqual(address.region, 'global') + address = self.driver.ex_get_address("lcaddressglobal", "global") + self.assertEqual(address.name, "lcaddressglobal") + self.assertEqual(address.region, "global") destroyed = address.destroy() self.assertTrue(destroyed) def test_ex_destroy_address(self): - address = self.driver.ex_get_address('lcaddress') + address = self.driver.ex_get_address("lcaddress") destroyed = address.destroy() self.assertTrue(destroyed) def test_ex_destroy_backendservice(self): - backendservice = self.driver.ex_get_backendservice('web-service') + backendservice = self.driver.ex_get_backendservice("web-service") destroyed = backendservice.destroy() self.assertTrue(destroyed) def test_ex_destroy_healthcheck(self): - hc = self.driver.ex_get_healthcheck('lchealthcheck') + hc = self.driver.ex_get_healthcheck("lchealthcheck") destroyed = hc.destroy() self.assertTrue(destroyed) def test_ex_delete_image(self): - self.assertRaises(ResourceNotFoundError, - self.driver.ex_get_image, 'missing-image') - self.assertRaises(ResourceNotFoundError, - self.driver.ex_delete_image, 'missing-image') + self.assertRaises(ResourceNotFoundError, self.driver.ex_get_image, "missing-image") + self.assertRaises(ResourceNotFoundError, self.driver.ex_delete_image, "missing-image") - image = self.driver.ex_get_image('debian-7') + image = self.driver.ex_get_image("debian-7") deleted = self.driver.ex_delete_image(image) self.assertTrue(deleted) def test_ex_deprecate_image(self): - dep_ts = '2064-03-11T20:18:36.194-07:00' - obs_ts = '2074-03-11T20:18:36.194-07:00' - del_ts = '2084-03-11T20:18:36.194-07:00' - image = self.driver.ex_get_image('debian-7-wheezy-v20131014') - deprecated = image.deprecate('debian-7', 'DEPRECATED', - deprecated=dep_ts, - obsolete=obs_ts, - deleted=del_ts) + dep_ts = "2064-03-11T20:18:36.194-07:00" + obs_ts = "2074-03-11T20:18:36.194-07:00" + del_ts = "2084-03-11T20:18:36.194-07:00" + image = self.driver.ex_get_image("debian-7-wheezy-v20131014") + deprecated = image.deprecate( + "debian-7", "DEPRECATED", deprecated=dep_ts, obsolete=obs_ts, deleted=del_ts + ) self.assertTrue(deprecated) - self.assertEqual(image.extra['deprecated']['deprecated'], dep_ts) - self.assertEqual(image.extra['deprecated']['obsolete'], obs_ts) - self.assertEqual(image.extra['deprecated']['deleted'], del_ts) + self.assertEqual(image.extra["deprecated"]["deprecated"], dep_ts) + self.assertEqual(image.extra["deprecated"]["obsolete"], obs_ts) + self.assertEqual(image.extra["deprecated"]["deleted"], del_ts) def test_ex_destroy_firewall(self): - firewall = self.driver.ex_get_firewall('lcfirewall') + firewall = self.driver.ex_get_firewall("lcfirewall") destroyed = firewall.destroy() self.assertTrue(destroyed) def test_ex_destroy_forwarding_rule(self): - fwr = self.driver.ex_get_forwarding_rule('lcforwardingrule') + fwr = self.driver.ex_get_forwarding_rule("lcforwardingrule") destroyed = fwr.destroy() self.assertTrue(destroyed) def test_ex_destroy_forwarding_rule_global(self): - fwr = self.driver.ex_get_forwarding_rule('http-rule', global_rule=True) + fwr = self.driver.ex_get_forwarding_rule("http-rule", global_rule=True) destroyed = fwr.destroy() self.assertTrue(destroyed) def test_ex_destroy_route(self): - route = self.driver.ex_get_route('lcdemoroute') + route = self.driver.ex_get_route("lcdemoroute") destroyed = route.destroy() self.assertTrue(destroyed) def test_ex_destroy_network(self): - network = self.driver.ex_get_network('lcnetwork') + network = self.driver.ex_get_network("lcnetwork") destroyed = network.destroy() self.assertTrue(destroyed) def test_destroy_node(self): - node = self.driver.ex_get_node('node-name') + node = self.driver.ex_get_node("node-name") destroyed = node.destroy() self.assertTrue(destroyed) def test_ex_destroy_multiple_nodes(self): nodes = [] - nodes.append(self.driver.ex_get_node('lcnode-000')) - nodes.append(self.driver.ex_get_node('lcnode-001')) + nodes.append(self.driver.ex_get_node("lcnode-000")) + nodes.append(self.driver.ex_get_node("lcnode-001")) destroyed = self.driver.ex_destroy_multiple_nodes(nodes) for d in destroyed: self.assertTrue(d) def test_destroy_targethttpproxy(self): - proxy = self.driver.ex_get_targethttpproxy('web-proxy') + proxy = self.driver.ex_get_targethttpproxy("web-proxy") destroyed = proxy.destroy() self.assertTrue(destroyed) def test_destroy_targetinstance(self): - targetinstance = self.driver.ex_get_targetinstance('lctargetinstance') - self.assertEqual(targetinstance.name, 'lctargetinstance') + targetinstance = self.driver.ex_get_targetinstance("lctargetinstance") + self.assertEqual(targetinstance.name, "lctargetinstance") destroyed = targetinstance.destroy() self.assertTrue(destroyed) def test_destroy_targetpool(self): - targetpool = self.driver.ex_get_targetpool('lctargetpool') + targetpool = self.driver.ex_get_targetpool("lctargetpool") destroyed = targetpool.destroy() self.assertTrue(destroyed) def test_destroy_urlmap(self): - urlmap = self.driver.ex_get_urlmap('web-map') + urlmap = self.driver.ex_get_urlmap("web-map") destroyed = urlmap.destroy() self.assertTrue(destroyed) def test_destroy_volume(self): - disk = self.driver.ex_get_volume('lcdisk') + disk = self.driver.ex_get_volume("lcdisk") destroyed = disk.destroy() self.assertTrue(destroyed) def test_ex_set_volume_auto_delete(self): - node = self.driver.ex_get_node('node-name') - volume = node.extra['boot_disk'] - auto_delete = self.driver.ex_set_volume_auto_delete( - volume, node) + node = self.driver.ex_get_node("node-name") + volume = node.extra["boot_disk"] + auto_delete = self.driver.ex_set_volume_auto_delete(volume, node) self.assertTrue(auto_delete) def test_destroy_volume_snapshot(self): - snapshot = self.driver.ex_get_snapshot('lcsnapshot') + snapshot = self.driver.ex_get_snapshot("lcsnapshot") destroyed = snapshot.destroy() self.assertTrue(destroyed) def test_ex_get_address_global(self): - address_name = 'lcaddressglobal' - address = self.driver.ex_get_address(address_name, 'global') + address_name = "lcaddressglobal" + address = self.driver.ex_get_address(address_name, "global") self.assertEqual(address.name, address_name) - self.assertEqual(address.address, '173.99.99.99') - self.assertEqual(address.region, 'global') - self.assertEqual(address.extra['status'], 'RESERVED') + self.assertEqual(address.address, "173.99.99.99") + self.assertEqual(address.region, "global") + self.assertEqual(address.extra["status"], "RESERVED") def test_ex_get_address(self): - address_name = 'lcaddress' + address_name = "lcaddress" address = self.driver.ex_get_address(address_name) self.assertEqual(address.name, address_name) - self.assertEqual(address.address, '173.255.113.20') - self.assertEqual(address.region.name, 'us-central1') - self.assertEqual(address.extra['status'], 'RESERVED') + self.assertEqual(address.address, "173.255.113.20") + self.assertEqual(address.region.name, "us-central1") + self.assertEqual(address.extra["status"], "RESERVED") def test_ex_get_backendservice(self): - web_service = self.driver.ex_get_backendservice('web-service') - self.assertEqual(web_service.name, 'web-service') - self.assertEqual(web_service.protocol, 'HTTP') + web_service = self.driver.ex_get_backendservice("web-service") + self.assertEqual(web_service.name, "web-service") + self.assertEqual(web_service.protocol, "HTTP") self.assertEqual(web_service.port, 80) self.assertEqual(web_service.timeout, 30) - self.assertEqual(web_service.healthchecks[0].name, 'basic-check') + self.assertEqual(web_service.healthchecks[0].name, "basic-check") self.assertEqual(len(web_service.healthchecks), 1) backends = web_service.backends self.assertEqual(len(backends), 2) - self.assertEqual(backends[0]['balancingMode'], 'RATE') - self.assertEqual(backends[0]['maxRate'], 100) - self.assertEqual(backends[0]['capacityScaler'], 1.0) + self.assertEqual(backends[0]["balancingMode"], "RATE") + self.assertEqual(backends[0]["maxRate"], 100) + self.assertEqual(backends[0]["capacityScaler"], 1.0) - web_service = self.driver.ex_get_backendservice('no-backends') - self.assertEqual(web_service.name, 'web-service') - self.assertEqual(web_service.healthchecks[0].name, 'basic-check') + web_service = self.driver.ex_get_backendservice("no-backends") + self.assertEqual(web_service.name, "web-service") + self.assertEqual(web_service.healthchecks[0].name, "basic-check") self.assertEqual(len(web_service.healthchecks), 1) self.assertEqual(len(web_service.backends), 0) def test_ex_get_healthcheck(self): - healthcheck_name = 'lchealthcheck' + healthcheck_name = "lchealthcheck" healthcheck = self.driver.ex_get_healthcheck(healthcheck_name) self.assertEqual(healthcheck.name, healthcheck_name) self.assertEqual(healthcheck.port, 8000) - self.assertEqual(healthcheck.path, '/lc') + self.assertEqual(healthcheck.path, "/lc") def test_ex_get_firewall(self): - firewall_name = 'lcfirewall' + firewall_name = "lcfirewall" firewall = self.driver.ex_get_firewall(firewall_name) self.assertEqual(firewall.name, firewall_name) - self.assertEqual(firewall.network.name, 'default') - self.assertEqual(firewall.source_tags, ['libcloud']) + self.assertEqual(firewall.network.name, "default") + self.assertEqual(firewall.target_tags, ["libcloud"]) def test_ex_get_forwarding_rule(self): - fwr_name = 'lcforwardingrule' + fwr_name = "lcforwardingrule" fwr = self.driver.ex_get_forwarding_rule(fwr_name) self.assertEqual(fwr.name, fwr_name) - self.assertEqual(fwr.extra['portRange'], '8000-8500') - self.assertEqual(fwr.targetpool.name, 'lctargetpool') - self.assertEqual(fwr.protocol, 'TCP') + self.assertEqual(fwr.extra["portRange"], "8000-8500") + self.assertEqual(fwr.targetpool.name, "lctargetpool") + self.assertEqual(fwr.protocol, "TCP") def test_ex_get_forwarding_rule_global(self): - fwr_name = 'http-rule' + fwr_name = "http-rule" fwr = self.driver.ex_get_forwarding_rule(fwr_name, global_rule=True) self.assertEqual(fwr.name, fwr_name) - self.assertEqual(fwr.extra['portRange'], '80-80') - self.assertEqual(fwr.targetpool.name, 'web-proxy') - self.assertEqual(fwr.protocol, 'TCP') - self.assertEqual(fwr.address, '192.0.2.1') - self.assertEqual(fwr.targetpool.name, 'web-proxy') + self.assertEqual(fwr.extra["portRange"], "80-80") + self.assertEqual(fwr.targetpool.name, "web-proxy") + self.assertEqual(fwr.protocol, "TCP") + self.assertEqual(fwr.address, "192.0.2.1") + self.assertEqual(fwr.targetpool.name, "web-proxy") def test_ex_get_image_license(self): - image = self.driver.ex_get_image('sles-12-v20141023') - self.assertTrue('licenses' in image.extra) - self.assertEqual(image.extra['licenses'][0].name, 'sles-12') - self.assertTrue(image.extra['licenses'][0].charges_use_fee) + image = self.driver.ex_get_image("sles-12-v20141023") + self.assertTrue("licenses" in image.extra) + self.assertEqual(image.extra["licenses"][0].name, "sles-12") + self.assertTrue(image.extra["licenses"][0].charges_use_fee) def test_ex_get_image(self): - partial_name = 'debian-7' + partial_name = "debian-7" image = self.driver.ex_get_image(partial_name) - self.assertEqual(image.name, 'debian-7-wheezy-v20131120') + self.assertEqual(image.name, "debian-7-wheezy-v20131120") # A 'debian-7' image exists in the local project - self.assertTrue(image.extra['description'].startswith('Debian')) + self.assertTrue(image.extra["description"].startswith("Debian")) - partial_name = 'debian-6' + partial_name = "debian-6" image = self.driver.ex_get_image(partial_name) - self.assertEqual(image.name, 'debian-6-squeeze-v20130926') - self.assertTrue(image.extra['description'].startswith('Debian')) - - partial_name = 'debian-7' - image = self.driver.ex_get_image(partial_name, ['debian-cloud']) - self.assertEqual(image.name, 'debian-7-wheezy-v20131120') - - def test_ex_copy_image(self): - name = 'coreos' - url = 'gs://storage.core-os.net/coreos/amd64-generic/247.0.0/coreos_production_gce.tar.gz' - description = 'CoreOS beta 522.3.0' - image = self.driver.ex_copy_image(name, url, description) - self.assertTrue(image.name.startswith(name)) - self.assertEqual(image.extra['description'], description) + self.assertEqual(image.name, "debian-6-squeeze-v20130926") + self.assertTrue(image.extra["description"].startswith("Debian")) + + partial_name = "debian-7" + image = self.driver.ex_get_image(partial_name, ["debian-cloud"]) + self.assertEqual(image.name, "debian-7-wheezy-v20131120") + + partial_name = "debian-7" + self.assertRaises( + ResourceNotFoundError, + self.driver.ex_get_image, + partial_name, + "suse-cloud", + ex_standard_projects=False, + ) + + def test_ex_get_image_from_family(self): + family = "coreos-beta" + description = "CoreOS beta 522.3.0" + image = self.driver.ex_get_image_from_family(family) + self.assertEqual(image.name, "coreos-beta-522-3-0-v20141226") + self.assertEqual(image.extra["description"], description) + self.assertEqual(image.extra["family"], family) + + url = ( + "https://www.googleapis.com/compute/v1/projects/coreos-cloud/" + "global/images/family/coreos-beta" + ) + image = self.driver.ex_get_image_from_family(url) + self.assertEqual(image.name, "coreos-beta-522-3-0-v20141226") + self.assertEqual(image.extra["description"], description) + self.assertEqual(image.extra["family"], family) + + project_list = ["coreos-cloud"] + image = self.driver.ex_get_image_from_family( + family, ex_project_list=project_list, ex_standard_projects=False + ) + self.assertEqual(image.name, "coreos-beta-522-3-0-v20141226") + self.assertEqual(image.extra["description"], description) + self.assertEqual(image.extra["family"], family) + + self.assertRaises(ResourceNotFoundError, self.driver.ex_get_image_from_family, "nofamily") def test_ex_get_route(self): - route_name = 'lcdemoroute' + route_name = "lcdemoroute" route = self.driver.ex_get_route(route_name) self.assertEqual(route.name, route_name) - self.assertEqual(route.dest_range, '192.168.25.0/24') + self.assertEqual(route.dest_range, "192.168.25.0/24") self.assertEqual(route.priority, 1000) def test_ex_get_network(self): - network_name = 'lcnetwork' + network_name = "lcnetwork" network = self.driver.ex_get_network(network_name) self.assertEqual(network.name, network_name) - self.assertEqual(network.cidr, '10.11.0.0/16') - self.assertEqual(network.extra['gatewayIPv4'], '10.11.0.1') - self.assertEqual(network.extra['description'], 'A custom network') + self.assertEqual(network.cidr, "10.11.0.0/16") + self.assertEqual(network.extra["gatewayIPv4"], "10.11.0.1") + self.assertEqual(network.extra["description"], "A custom network") + # do the same but this time with URL + url = ( + "https://www.googleapis.com/compute/v1/projects/project_name/global/networks/lcnetwork" + ) + network = self.driver.ex_get_network(url) + self.assertEqual(network.name, network_name) + self.assertEqual(network.cidr, "10.11.0.0/16") + self.assertEqual(network.extra["gatewayIPv4"], "10.11.0.1") + self.assertEqual(network.extra["description"], "A custom network") + # do the same but with a network under a different project + url_other = ( + "https://www.googleapis.com/compute/v1/projects/other_name/global/networks/lcnetwork" + ) + network = self.driver.ex_get_network(url_other) + self.assertEqual(network.name, network_name) + self.assertEqual(network.cidr, "10.11.0.0/16") + self.assertEqual(network.extra["gatewayIPv4"], "10.11.0.1") + self.assertEqual(network.extra["description"], "A custom network") def test_ex_get_node(self): - node_name = 'node-name' - zone = 'us-central1-a' + node_name = "node-name" + zone = "us-central1-a" node = self.driver.ex_get_node(node_name, zone) self.assertEqual(node.name, node_name) - self.assertEqual(node.size, 'n1-standard-1') - removed_node = 'libcloud-lb-demo-www-002' - self.assertRaises(ResourceNotFoundError, self.driver.ex_get_node, - removed_node, 'us-central1-b') - missing_node = 'dummy-node' - self.assertRaises(ResourceNotFoundError, self.driver.ex_get_node, - missing_node, 'all') + self.assertEqual(node.size, "n1-standard-1") + removed_node = "libcloud-lb-demo-www-002" + self.assertRaises( + ResourceNotFoundError, + self.driver.ex_get_node, + removed_node, + "us-central1-b", + ) + missing_node = "dummy-node" + self.assertRaises(ResourceNotFoundError, self.driver.ex_get_node, missing_node, "all") def test_ex_get_project(self): project = self.driver.ex_get_project() - self.assertEqual(project.name, 'project_name') + self.assertEqual(project.name, "project_name") networks_quota = project.quotas[1] - self.assertEqual(networks_quota['usage'], 3) - self.assertEqual(networks_quota['limit'], 5) - self.assertEqual(networks_quota['metric'], 'NETWORKS') - self.assertTrue('fingerprint' in project.extra['commonInstanceMetadata']) - self.assertTrue('items' in project.extra['commonInstanceMetadata']) - self.assertTrue('usageExportLocation' in project.extra) - self.assertTrue('bucketName' in project.extra['usageExportLocation']) - self.assertEqual(project.extra['usageExportLocation']['bucketName'], 'gs://graphite-usage-reports') + self.assertEqual(networks_quota["usage"], 3) + self.assertEqual(networks_quota["limit"], 5) + self.assertEqual(networks_quota["metric"], "NETWORKS") + self.assertTrue("fingerprint" in project.extra["commonInstanceMetadata"]) + self.assertTrue("items" in project.extra["commonInstanceMetadata"]) + self.assertTrue("usageExportLocation" in project.extra) + self.assertTrue("bucketName" in project.extra["usageExportLocation"]) + self.assertEqual( + project.extra["usageExportLocation"]["bucketName"], + "gs://graphite-usage-reports", + ) def test_ex_add_access_config(self): - self.assertRaises(ValueError, self.driver.ex_add_access_config, - 'node', 'name', 'nic') - node = self.driver.ex_get_node('node-name', 'us-central1-a') - self.assertTrue(self.driver.ex_add_access_config(node, 'foo', 'bar')) + self.assertRaises(ValueError, self.driver.ex_add_access_config, "node", "name", "nic") + node = self.driver.ex_get_node("node-name", "us-central1-a") + self.assertTrue(self.driver.ex_add_access_config(node, "foo", "bar")) def test_ex_delete_access_config(self): - self.assertRaises(ValueError, self.driver.ex_add_access_config, - 'node', 'name', 'nic') - node = self.driver.ex_get_node('node-name', 'us-central1-a') - self.assertTrue(self.driver.ex_delete_access_config(node, 'foo', 'bar')) + self.assertRaises(ValueError, self.driver.ex_add_access_config, "node", "name", "nic") + node = self.driver.ex_get_node("node-name", "us-central1-a") + self.assertTrue(self.driver.ex_delete_access_config(node, "foo", "bar")) def test_ex_set_usage_export_bucket(self): - self.assertRaises(ValueError, - self.driver.ex_set_usage_export_bucket, 'foo') - bucket_name = 'gs://foo' + self.assertRaises(ValueError, self.driver.ex_set_usage_export_bucket, "foo") + bucket_name = "gs://foo" self.driver.ex_set_usage_export_bucket(bucket_name) - bucket_name = 'https://www.googleapis.com/foo' + bucket_name = "https://www.googleapis.com/foo" self.driver.ex_set_usage_export_bucket(bucket_name) + project = GCEProject(id=None, name=None, metadata=None, quotas=None, driver=self.driver) + project.set_usage_export_bucket(bucket=bucket_name) + def test__set_project_metadata(self): self.assertEqual(len(self.driver._set_project_metadata(None, False, "")), 0) # 'delete' metadata, but retain current sshKeys md = self.driver._set_project_metadata(None, False, "this is a test") self.assertEqual(len(md), 1) - self.assertEqual(md[0]['key'], 'sshKeys') - self.assertEqual(md[0]['value'], 'this is a test') + self.assertEqual(md[0]["key"], "sshKeys") + self.assertEqual(md[0]["value"], "this is a test") # 'delete' metadata *and* any existing sshKeys md = self.driver._set_project_metadata(None, True, "this is a test") @@ -1148,1222 +2259,1818 @@ def test__set_project_metadata(self): # add new metadata, keep existing sshKeys, since the new value also # has 'sshKeys', we want the final struct to only have one ke/value # of sshKeys and it should be the "current_keys" - gce_md = {'items': [{'key': 'foo', 'value': 'one'}, - {'key': 'sshKeys', 'value': 'another test'}]} + gce_md = { + "items": [ + {"key": "foo", "value": "one"}, + {"key": "sshKeys", "value": "another test"}, + ] + } md = self.driver._set_project_metadata(gce_md, False, "this is a test") self.assertEqual(len(md), 2, str(md)) sshKeys = "" count = 0 for d in md: - if d['key'] == 'sshKeys': + if d["key"] == "sshKeys": count += 1 - sshKeys = d['value'] - self.assertEqual(sshKeys, 'this is a test') + sshKeys = d["value"] + self.assertEqual(sshKeys, "this is a test") self.assertEqual(count, 1) # add new metadata, overwrite existing sshKeys, in this case, the # existing 'sshKeys' value should be replaced - gce_md = {'items': [{'key': 'foo', 'value': 'one'}, - {'key': 'sshKeys', 'value': 'another test'}]} + gce_md = { + "items": [ + {"key": "foo", "value": "one"}, + {"key": "sshKeys", "value": "another test"}, + ] + } md = self.driver._set_project_metadata(gce_md, True, "this is a test") self.assertEqual(len(md), 2, str(md)) sshKeys = "" count = 0 for d in md: - if d['key'] == 'sshKeys': + if d["key"] == "sshKeys": count += 1 - sshKeys = d['value'] - self.assertEqual(sshKeys, 'another test') + sshKeys = d["value"] + self.assertEqual(sshKeys, "another test") self.assertEqual(count, 1) # add new metadata, remove existing sshKeys. in this case, we had an # 'sshKeys' entry, but it will be removed entirely - gce_md = {'items': [{'key': 'foo', 'value': 'one'}, - {'key': 'nokeys', 'value': 'two'}]} + gce_md = {"items": [{"key": "foo", "value": "one"}, {"key": "nokeys", "value": "two"}]} md = self.driver._set_project_metadata(gce_md, True, "this is a test") self.assertEqual(len(md), 2, str(md)) sshKeys = "" count = 0 for d in md: - if d['key'] == 'sshKeys': + if d["key"] == "sshKeys": count += 1 - sshKeys = d['value'] - self.assertEqual(sshKeys, '') + sshKeys = d["value"] + self.assertEqual(sshKeys, "") self.assertEqual(count, 0) def test_ex_set_common_instance_metadata(self): # test non-dict - self.assertRaises(ValueError, - self.driver.ex_set_common_instance_metadata, - ['bad', 'type']) + self.assertRaises(ValueError, self.driver.ex_set_common_instance_metadata, ["bad", "type"]) # test standard python dict - pydict = {'key': 'pydict', 'value': 1} + pydict = {"key": "pydict", "value": 1} self.driver.ex_set_common_instance_metadata(pydict) # test GCE badly formatted dict - bad_gcedict = {'items': 'foo'} - self.assertRaises(ValueError, - self.driver.ex_set_common_instance_metadata, - bad_gcedict) + bad_gcedict = {"items": "foo"} + self.assertRaises(ValueError, self.driver.ex_set_common_instance_metadata, bad_gcedict) # test gce formatted dict - gcedict = {'items': [{'key': 'gcedict1', 'value': 'v1'}, - {'key': 'gcedict2', 'value': 'v2'}]} + gcedict = { + "items": [ + {"key": "gcedict1", "value": "v1"}, + {"key": "gcedict2", "value": "v2"}, + ] + } self.driver.ex_set_common_instance_metadata(gcedict) + # Verify project notation works + project = GCEProject(id=None, name=None, metadata=None, quotas=None, driver=self.driver) + project.set_common_instance_metadata(metadata=gcedict) + def test_ex_set_node_metadata(self): - node = self.driver.ex_get_node('node-name', 'us-central1-a') + node = self.driver.ex_get_node("node-name", "us-central1-a") # test non-dict - self.assertRaises(ValueError, self.driver.ex_set_node_metadata, - node, ['bad', 'type']) + self.assertRaises(ValueError, self.driver.ex_set_node_metadata, node, ["bad", "type"]) # test standard python dict - pydict = {'key': 'pydict', 'value': 1} + pydict = {"key": "pydict", "value": 1} self.driver.ex_set_node_metadata(node, pydict) # test GCE badly formatted dict - bad_gcedict = {'items': 'foo'} - self.assertRaises(ValueError, self.driver.ex_set_node_metadata, - node, bad_gcedict) + bad_gcedict = {"items": "foo"} + self.assertRaises(ValueError, self.driver.ex_set_node_metadata, node, bad_gcedict) # test gce formatted dict - gcedict = {'items': [{'key': 'gcedict1', 'value': 'v1'}, - {'key': 'gcedict2', 'value': 'v2'}]} + gcedict = { + "items": [ + {"key": "gcedict1", "value": "v1"}, + {"key": "gcedict2", "value": "v2"}, + ] + } self.driver.ex_set_node_metadata(node, gcedict) + def test_ex_set_node_labels(self): + node = self.driver.ex_get_node("node-name", "us-central1-a") + # Test basic values + simplelabel = {"key": "value"} + self.driver.ex_set_node_labels(node, simplelabel) + # Test multiple values + multilabels = {"item1": "val1", "item2": "val2"} + self.driver.ex_set_node_labels(node, multilabels) + + def test_ex_set_image_labels(self): + image = self.driver.ex_get_image("custom-image") + # Test basic values + simplelabel = {"foo": "bar"} + self.driver.ex_set_image_labels(image, simplelabel) + image = self.driver.ex_get_image("custom-image") + self.assertTrue("foo" in image.extra["labels"]) + # Test multiple values + multilabels = {"one": "1", "two": "two"} + self.driver.ex_set_image_labels(image, multilabels) + image = self.driver.ex_get_image("custom-image") + self.assertEqual(len(image.extra["labels"]), 3) + self.assertTrue("two" in image.extra["labels"]) + self.assertTrue("two" in image.extra["labels"]) + def test_ex_get_region(self): - region_name = 'us-central1' + region_name = "us-central1" region = self.driver.ex_get_region(region_name) self.assertEqual(region.name, region_name) - self.assertEqual(region.status, 'UP') - self.assertEqual(region.zones[0].name, 'us-central1-a') + self.assertEqual(region.status, "UP") + self.assertEqual(region.zones[0].name, "us-central1-a") def test_ex_get_size(self): - size_name = 'n1-standard-1' + size_name = "n1-standard-1" size = self.driver.ex_get_size(size_name) self.assertEqual(size.name, size_name) - self.assertEqual(size.extra['zone'].name, 'us-central1-a') + self.assertEqual(size.extra["zone"].name, "us-central1-a") self.assertEqual(size.disk, 10) self.assertEqual(size.ram, 3840) - self.assertEqual(size.extra['guestCpus'], 1) + self.assertEqual(size.extra["guestCpus"], 1) def test_ex_get_targethttpproxy(self): - targethttpproxy_name = 'web-proxy' - targethttpproxy = self.driver.ex_get_targethttpproxy( - targethttpproxy_name) + targethttpproxy_name = "web-proxy" + targethttpproxy = self.driver.ex_get_targethttpproxy(targethttpproxy_name) self.assertEqual(targethttpproxy.name, targethttpproxy_name) - self.assertEqual(targethttpproxy.urlmap.name, 'web-map') + self.assertEqual(targethttpproxy.urlmap.name, "web-map") def test_ex_get_targetinstance(self): - targetinstance_name = 'lctargetinstance' + targetinstance_name = "lctargetinstance" targetinstance = self.driver.ex_get_targetinstance(targetinstance_name) self.assertEqual(targetinstance.name, targetinstance_name) - self.assertEqual(targetinstance.zone.name, 'us-central1-a') + self.assertEqual(targetinstance.zone.name, "us-central1-a") def test_ex_get_targetpool(self): - targetpool_name = 'lctargetpool' + targetpool_name = "lctargetpool" targetpool = self.driver.ex_get_targetpool(targetpool_name) self.assertEqual(targetpool.name, targetpool_name) self.assertEqual(len(targetpool.nodes), 2) - self.assertEqual(targetpool.region.name, 'us-central1') + self.assertEqual(targetpool.region.name, "us-central1") + + def test_ex_get_instancegroupmanager(self): + igmgr_name = "myinstancegroup" + igmgr = self.driver.ex_get_instancegroupmanager(igmgr_name, "us-central1-b") + self.assertEqual(igmgr.name, igmgr_name) + self.assertEqual(igmgr.size, 4) + self.assertEqual(igmgr.zone.name, "us-central1-b") + + # search all zones + igmgr = self.driver.ex_get_instancegroupmanager(igmgr_name) + self.assertEqual(igmgr.name, igmgr_name) + self.assertEqual(igmgr.size, 4) + self.assertEqual(igmgr.zone.name, "us-central1-a") + + def test_ex_get_instancetemplate(self): + instancetemplate_name = "my-instance-template1" + instancetemplate = self.driver.ex_get_instancetemplate(instancetemplate_name) + self.assertEqual(instancetemplate.name, instancetemplate_name) + self.assertEqual(instancetemplate.extra["properties"]["machineType"], "n1-standard-1") def test_ex_get_snapshot(self): - snapshot_name = 'lcsnapshot' + snapshot_name = "lcsnapshot" snapshot = self.driver.ex_get_snapshot(snapshot_name) self.assertEqual(snapshot.name, snapshot_name) - self.assertEqual(snapshot.size, '10') - self.assertEqual(snapshot.status, 'READY') + self.assertEqual(snapshot.size, "10") + self.assertEqual(snapshot.status, "READY") def test_ex_get_urlmap(self): - urlmap_name = 'web-map' + urlmap_name = "web-map" urlmap = self.driver.ex_get_urlmap(urlmap_name) self.assertEqual(urlmap.name, urlmap_name) - self.assertEqual(urlmap.default_service.name, 'web-service') + self.assertEqual(urlmap.default_service.name, "web-service") def test_ex_get_volume(self): - volume_name = 'lcdisk' + volume_name = "lcdisk" volume = self.driver.ex_get_volume(volume_name) self.assertEqual(volume.name, volume_name) - self.assertEqual(volume.size, '10') - self.assertEqual(volume.extra['status'], 'READY') - self.assertEqual(volume.extra['type'], 'pd-ssd') + self.assertEqual(volume.size, "10") + self.assertEqual(volume.extra["status"], "READY") + self.assertEqual(volume.extra["type"], "pd-ssd") def test_ex_get_disktype(self): - disktype_name = 'pd-ssd' - disktype_zone = 'us-central1-a' + disktype_name = "pd-ssd" + disktype_zone = "us-central1-a" disktype = self.driver.ex_get_disktype(disktype_name, disktype_zone) self.assertEqual(disktype.name, disktype_name) self.assertEqual(disktype.zone.name, disktype_zone) - self.assertEqual(disktype.extra['description'], 'SSD Persistent Disk') - self.assertEqual(disktype.extra['valid_disk_size'], '10GB-10240GB') - self.assertEqual(disktype.extra['default_disk_size_gb'], '100') + self.assertEqual(disktype.extra["description"], "SSD Persistent Disk") + self.assertEqual(disktype.extra["valid_disk_size"], "10GB-10240GB") + self.assertEqual(disktype.extra["default_disk_size_gb"], "100") + + # zone not set + disktype_name = "pd-ssd" + disktype = self.driver.ex_get_disktype(disktype_name) + self.assertEqual(disktype.name, disktype_name) def test_ex_get_zone(self): - zone_name = 'us-central1-b' + zone_name = "us-central1-b" zone = self.driver.ex_get_zone(zone_name) self.assertEqual(zone.name, zone_name) self.assertFalse(zone.time_until_mw) self.assertFalse(zone.next_mw_duration) - zone_no_mw = self.driver.ex_get_zone('us-central1-a') - self.assertEqual(zone_no_mw.time_until_mw, None) + zone_no_mw = self.driver.ex_get_zone("us-central1-a") + self.assertIsNone(zone_no_mw.time_until_mw) + + def test_driver_zone_attributes(self): + zones = self.driver.ex_list_zones() + self.assertEqual(len(self.driver.zone_dict), len(zones)) + self.assertEqual(len(self.driver.zone_list), len(zones)) + for zone, fetched_zone in zip(self.driver.zone_list, zones): + self.assertEqual(zone.id, fetched_zone.id) + self.assertEqual(zone.name, fetched_zone.name) + self.assertEqual(zone.status, fetched_zone.status) + + def test_driver_region_attributes(self): + regions = self.driver.ex_list_regions() + self.assertEqual(len(self.driver.region_dict), len(regions)) + self.assertEqual(len(self.driver.region_list), len(regions)) + for region, fetched_region in zip(self.driver.region_list, regions): + self.assertEqual(region.id, fetched_region.id) + self.assertEqual(region.name, fetched_region.name) + self.assertEqual(region.status, fetched_region.status) + + +class GCENodeDriverTest2(GoogleTestCase): + """ + GCE Test Class, test node driver without passing `datacenter` parameter on initialization. + """ + + def setUp(self): + GCEMockHttp.test = self + GCENodeDriver.connectionCls.conn_class = GCEMockHttp + GoogleBaseAuthConnection.conn_class = GoogleAuthMockHttp + GCEMockHttp.type = None + kwargs = GCE_KEYWORD_PARAMS.copy() + kwargs["auth_type"] = "IA" + self.driver = GCENodeDriver(*GCE_PARAMS, **kwargs) + + def test_zone_attributes(self): + self.assertIsNone(self.driver._zone_dict) + self.assertIsNone(self.driver._zone_list) + + zones = self.driver.ex_list_zones() + + self.assertEqual(len(self.driver.zone_list), len(zones)) + self.assertEqual(len(self.driver.zone_dict), len(zones)) + for zone, fetched_zone in zip(self.driver.zone_list, zones): + self.assertEqual(zone.id, fetched_zone.id) + self.assertEqual(zone.name, fetched_zone.name) + self.assertEqual(zone.status, fetched_zone.status) + + def test_region_attributes(self): + self.assertIsNone(self.driver._region_dict) + self.assertIsNone(self.driver._region_list) + + regions = self.driver.ex_list_regions() + + self.assertEqual(len(self.driver.region_list), len(regions)) + self.assertEqual(len(self.driver.region_dict), len(regions)) + for region, fetched_region in zip(self.driver.region_list, regions): + self.assertEqual(region.id, fetched_region.id) + self.assertEqual(region.name, fetched_region.name) + self.assertEqual(region.status, fetched_region.status) -class GCEMockHttp(MockHttpTestCase): - fixtures = ComputeFileFixtures('gce') - json_hdr = {'content-type': 'application/json; charset=UTF-8'} +class GCEMockHttp(MockHttp, unittest.TestCase): + fixtures = ComputeFileFixtures("gce") + json_hdr = {"content-type": "application/json; charset=UTF-8"} def _get_method_name(self, type, use_param, qs, path): - api_path = '/compute/%s' % API_VERSION - project_path = '/projects/%s' % GCE_KEYWORD_PARAMS['project'] - path = path.replace(api_path, '') + api_path = "/compute/%s" % API_VERSION + project_path = "/projects/%s" % GCE_KEYWORD_PARAMS["project"] + path = path.replace(api_path, "") # This replace is separate, since there is a call with a different # project name - path = path.replace(project_path, '') + path = path.replace(project_path, "") # The path to get project information is the base path, so use a fake # '/project' path instead if not path: - path = '/project' - method_name = super(GCEMockHttp, self)._get_method_name(type, - use_param, - qs, path) + path = "/project" + method_name = super()._get_method_name(type, use_param, qs, path) return method_name def _setUsageExportBucket(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('setUsageExportBucket_post.json') + if method == "POST": + body = self.fixtures.load("setUsageExportBucket_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instances_custom_node(self, method, url, body, header): + body = self.fixtures.load("zones_us_central1_a_instances_custom_node.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instances_node_name_setMachineType(self, method, url, body, header): + body = self.fixtures.load("zones_us_central1_a_instances_node_name_setMachineType.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_operations_operation_setMachineType_notstopped( + self, method, url, body, header + ): + body = self.fixtures.load( + "zones_us_central1_a_operations_operation_setMachineType_notstopped.json" + ) + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instances_custom_node_setMachineType(self, method, url, body, header): + body = { + "error": { + "errors": [ + { + "domain": "global", + "reason": "invalid", + "message": "Invalid value for field 'resource.machineTypes': " + "'projects/project_name/zones/us-central1-a/machineTypes/custom-1-61440'. Resource was not found.", + } + ], + "code": 400, + "message": "Invalid value for field 'resource.machineTypes': " + "'projects/project_name/zones/us-central1-a/machineTypes/custom-1-61440'. Resource was not found.", + } + } + return ( + httplib.BAD_REQUEST, + body, + self.json_hdr, + httplib.responses[httplib.BAD_REQUEST], + ) + + def _zones_us_central1_a_instances_stopped_node_setMachineType(self, method, url, body, header): + body = self.fixtures.load("zones_us_central1_a_instances_stopped_node_setMachineType.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_operations_operation_setMachineType(self, method, url, body, header): + body = self.fixtures.load("zones_us_central1_a_operations_operation_setMachineType.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_startnode(self, method, url, body, header): - body = self.fixtures.load('zones_us_central1_a_operations_operation_startnode.json') + body = self.fixtures.load("zones_us_central1_a_operations_operation_startnode.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_instances_stopped_node_start(self, method, url, body, header): - body = self.fixtures.load('zones_us_central1_a_instances_stopped_node_start.json') + body = self.fixtures.load("zones_us_central1_a_instances_stopped_node_start.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_instances_stopped_node_stop(self, method, url, body, header): - body = self.fixtures.load('zones_us_central1_a_instances_stopped_node_stop.json') + body = self.fixtures.load("zones_us_central1_a_instances_stopped_node_stop.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_instances_stopped_node(self, method, url, body, headers): - body = self.fixtures.load('zones_us_central1_a_instances_stopped_node.json') + body = self.fixtures.load("zones_us_central1_a_instances_stopped_node.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_stopnode(self, method, url, body, headers): - body = self.fixtures.load('zones_us_central1_a_operations_operation_stopnode.json') + body = self.fixtures.load("zones_us_central1_a_operations_operation_stopnode.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_instances_node_name_stop(self, method, url, body, headers): - body = self.fixtures.load('zones_us_central1_a_instances_node_name_stop.json') + body = self.fixtures.load("zones_us_central1_a_instances_node_name_stop.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_acceleratorTypes_nvidia_tesla_k80(self, method, url, body, headers): + body = self.fixtures.load("zones_us_central1_a_acceleratorTypes_nvidia_tesla_k80.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_instances_node_name_setMetadata(self, method, url, body, headers): - body = self.fixtures.load('zones_us_central1_a_instances_node_name_setMetadata_post.json') + body = self.fixtures.load("zones_us_central1_a_instances_node_name_setMetadata_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instances_node_name_setLabels(self, method, url, body, headers): + body = self.fixtures.load("zones_us_central1_a_instances_node_name_setLabels_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_images_custom_image_setLabels(self, method, url, body, headers): + self.assertTrue("global/images/custom-image/setLabels" in url) + body = self.fixtures.load("global_custom_image_setLabels_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _setCommonInstanceMetadata(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('setCommonInstanceMetadata_post.json') + if method == "POST": + body = self.fixtures.load("setCommonInstanceMetadata_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _aggregated_subnetworks(self, method, url, body, headers): + body = self.fixtures.load("aggregated_subnetworks.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _aggregated_addresses(self, method, url, body, headers): - body = self.fixtures.load('aggregated_addresses.json') + body = self.fixtures.load("aggregated_addresses.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _aggregated_diskTypes(self, method, url, body, headers): - body = self.fixtures.load('aggregated_disktypes.json') + body = self.fixtures.load("aggregated_disktypes.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _aggregated_disks(self, method, url, body, headers): - body = self.fixtures.load('aggregated_disks.json') + body = self.fixtures.load("aggregated_disks.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _aggregated_forwardingRules(self, method, url, body, headers): - body = self.fixtures.load('aggregated_forwardingRules.json') + body = self.fixtures.load("aggregated_forwardingRules.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _aggregated_instances(self, method, url, body, headers): - body = self.fixtures.load('aggregated_instances.json') + body = self.fixtures.load("aggregated_instances.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _aggregated_instanceGroupManagers(self, method, url, body, headers): + body = self.fixtures.load("aggregated_instanceGroupManagers.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _aggregated_machineTypes(self, method, url, body, headers): - body = self.fixtures.load('aggregated_machineTypes.json') + body = self.fixtures.load("aggregated_machineTypes.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _aggregated_targetInstances(self, method, url, body, headers): - body = self.fixtures.load('aggregated_targetInstances.json') + body = self.fixtures.load("aggregated_targetInstances.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _aggregated_targetPools(self, method, url, body, headers): - body = self.fixtures.load('aggregated_targetPools.json') + body = self.fixtures.load("aggregated_targetPools.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_backendServices(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('global_backendServices_post.json') + if method == "POST": + body = self.fixtures.load("global_backendServices_post.json") else: - body = self.fixtures.load('global_backendServices-%s.json' % - self.test.backendservices_mock) + backend_name = getattr(self.test, "backendservices_mock", "web-service") + body = self.fixtures.load("global_backendServices-%s.json" % backend_name) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_backendServices_no_backends(self, method, url, body, headers): - body = self.fixtures.load('global_backendServices_no_backends.json') + body = self.fixtures.load("global_backendServices_no_backends.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_backendServices_web_service(self, method, url, body, headers): - if method == 'DELETE': - body = self.fixtures.load( - 'global_backendServices_web_service_delete.json') + if method == "DELETE": + body = self.fixtures.load("global_backendServices_web_service_delete.json") else: - body = self.fixtures.load('global_backendServices_web_service.json') + body = self.fixtures.load("global_backendServices_web_service.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_forwardingRules(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('global_forwardingRules_post.json') + if method == "POST": + body = self.fixtures.load("global_forwardingRules_post.json") else: - body = self.fixtures.load('global_forwardingRules.json') + body = self.fixtures.load("global_forwardingRules.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_forwardingRules_http_rule(self, method, url, body, headers): - if method == 'DELETE': - body = self.fixtures.load('global_forwardingRules_http_rule_delete.json') + if method == "DELETE": + body = self.fixtures.load("global_forwardingRules_http_rule_delete.json") else: - body = self.fixtures.load('global_forwardingRules_http_rule.json') + body = self.fixtures.load("global_forwardingRules_http_rule.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_httpHealthChecks(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('global_httpHealthChecks_post.json') + if method == "POST": + body = self.fixtures.load("global_httpHealthChecks_post.json") else: - body = self.fixtures.load('global_httpHealthChecks.json') + body = self.fixtures.load("global_httpHealthChecks.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_httpHealthChecks_default_health_check(self, method, url, body, headers): - body = self.fixtures.load('global_httpHealthChecks_basic-check.json') + body = self.fixtures.load("global_httpHealthChecks_basic-check.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_httpHealthChecks_basic_check(self, method, url, body, headers): - body = self.fixtures.load('global_httpHealthChecks_basic-check.json') + body = self.fixtures.load("global_httpHealthChecks_basic-check.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_httpHealthChecks_libcloud_lb_demo_healthcheck( - self, method, url, body, headers): - body = self.fixtures.load( - 'global_httpHealthChecks_libcloud-lb-demo-healthcheck.json') + def _global_httpHealthChecks_libcloud_lb_demo_healthcheck(self, method, url, body, headers): + body = self.fixtures.load("global_httpHealthChecks_libcloud-lb-demo-healthcheck.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_httpHealthChecks_lchealthcheck(self, method, url, body, - headers): - if method == 'DELETE': - body = self.fixtures.load( - 'global_httpHealthChecks_lchealthcheck_delete.json') - elif method == 'PUT': - body = self.fixtures.load( - 'global_httpHealthChecks_lchealthcheck_put.json') + def _global_httpHealthChecks_lchealthcheck(self, method, url, body, headers): + if method == "DELETE": + body = self.fixtures.load("global_httpHealthChecks_lchealthcheck_delete.json") + elif method == "PUT": + body = self.fixtures.load("global_httpHealthChecks_lchealthcheck_put.json") else: - body = self.fixtures.load( - 'global_httpHealthChecks_lchealthcheck.json') + body = self.fixtures.load("global_httpHealthChecks_lchealthcheck.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_firewalls(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('global_firewalls_post.json') + if method == "POST": + body = self.fixtures.load("global_firewalls_post.json") else: - body = self.fixtures.load('global_firewalls.json') + body = self.fixtures.load("global_firewalls.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_firewalls_lcfirewall(self, method, url, body, headers): - if method == 'DELETE': - body = self.fixtures.load( - 'global_firewalls_lcfirewall_delete.json') - elif method == 'PUT': - body = self.fixtures.load('global_firewalls_lcfirewall_put.json') + if method == "DELETE": + body = self.fixtures.load("global_firewalls_lcfirewall_delete.json") + elif method == "PUT": + body = self.fixtures.load("global_firewalls_lcfirewall_put.json") else: - body = self.fixtures.load('global_firewalls_lcfirewall.json') + body = self.fixtures.load("global_firewalls_lcfirewall.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_images(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('global_images_post.json') - else: - body = self.fixtures.load('global_images.json') + def _global_firewalls_lcfirewall_egress(self, method, url, body, headers): + body = self.fixtures.load("global_firewalls_lcfirewall-egress.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_images_debian_7_wheezy_v20131120( - self, method, url, body, headers): - body = self.fixtures.load('global_images_debian_7_wheezy_v20131120_delete.json') + def _global_firewalls_lcfirewall_deny(self, method, url, body, headers): + body = self.fixtures.load("global_firewalls_lcfirewall-deny.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_images_debian_7_wheezy_v20131014_deprecate( - self, method, url, body, headers): - body = self.fixtures.load('global_images_debian_7_wheezy_v20131014_deprecate.json') - return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + def _global_images(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("global_images_post.json") + elif "maxResults" in url and "pageToken" not in url: + body = self.fixtures.load("global_images_paged.json") + else: + if "maxResults" in url: + self.assertIn("pageToken=token", url) + body = self.fixtures.load("global_images.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_images_debian_7_wheezy_v20131120(self, method, url, body, headers): + body = self.fixtures.load("global_images_debian_7_wheezy_v20131120_delete.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_images_debian_7_wheezy_v20131014_deprecate(self, method, url, body, headers): + body = self.fixtures.load("global_images_debian_7_wheezy_v20131014_deprecate.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_images_family_coreos_beta(self, method, url, body, headers): + body = self.fixtures.load("global_images_family_notfound.json") + return ( + httplib.NOT_FOUND, + body, + self.json_hdr, + httplib.responses[httplib.NOT_FOUND], + ) + + def _global_images_family_coreos_stable(self, method, url, body, headers): + body = self.fixtures.load("global_images_family_notfound.json") + return ( + httplib.NOT_FOUND, + body, + self.json_hdr, + httplib.responses[httplib.NOT_FOUND], + ) + + def _global_images_family_nofamily(self, method, url, body, headers): + body = self.fixtures.load("global_images_family_notfound.json") + return ( + httplib.NOT_FOUND, + body, + self.json_hdr, + httplib.responses[httplib.NOT_FOUND], + ) def _global_routes(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('global_routes_post.json') + if method == "POST": + body = self.fixtures.load("global_routes_post.json") else: - body = self.fixtures.load('global_routes.json') + body = self.fixtures.load("global_routes.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_networks(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('global_networks_post.json') + if method == "POST": + body = self.fixtures.load("global_networks_post.json") else: - body = self.fixtures.load('global_networks.json') + body = self.fixtures.load("global_networks.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_networks_custom_network(self, method, url, body, headers): + body = self.fixtures.load("global_networks_custom_network.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_networks_cf(self, method, url, body, headers): + body = self.fixtures.load("global_networks_cf.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_networks_default(self, method, url, body, headers): - body = self.fixtures.load('global_networks_default.json') + body = self.fixtures.load("global_networks_default.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_networks_libcloud_demo_network(self, method, url, body, - headers): - body = self.fixtures.load('global_networks_libcloud-demo-network.json') + def _global_networks_libcloud_demo_network(self, method, url, body, headers): + body = self.fixtures.load("global_networks_libcloud-demo-network.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_networks_libcloud_demo_europe_network(self, method, url, body, - headers): - body = self.fixtures.load( - 'global_networks_libcloud-demo-europe-network.json') + def _global_networks_libcloud_demo_europe_network(self, method, url, body, headers): + body = self.fixtures.load("global_networks_libcloud-demo-europe-network.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_routes_lcdemoroute(self, method, url, body, headers): - if method == 'DELETE': - body = self.fixtures.load('global_routes_lcdemoroute_delete.json') + if method == "DELETE": + body = self.fixtures.load("global_routes_lcdemoroute_delete.json") else: - body = self.fixtures.load('global_routes_lcdemoroute.json') + body = self.fixtures.load("global_routes_lcdemoroute.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_networks_lcnetwork(self, method, url, body, headers): - if method == 'DELETE': - body = self.fixtures.load('global_networks_lcnetwork_delete.json') + if method == "DELETE": + body = self.fixtures.load("global_networks_lcnetwork_delete.json") else: - body = self.fixtures.load('global_networks_lcnetwork.json') + body = self.fixtures.load("global_networks_lcnetwork.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_snapshots(self, method, url, body, headers): - body = self.fixtures.load('global_snapshots.json') + body = self.fixtures.load("global_snapshots.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_snapshots_lcsnapshot(self, method, url, body, headers): - if method == 'DELETE': - body = self.fixtures.load( - 'global_snapshots_lcsnapshot_delete.json') + if method == "DELETE": + body = self.fixtures.load("global_snapshots_lcsnapshot_delete.json") else: - body = self.fixtures.load('global_snapshots_lcsnapshot.json') + body = self.fixtures.load("global_snapshots_lcsnapshot.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_operations_operation_setUsageExportBucket( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_setUsageExportBucket.json') + def _global_operations_operation_setUsageExportBucket(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_setUsageExportBucket.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_operations_operation_setCommonInstanceMetadata( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_setCommonInstanceMetadata.json') + def _global_operations_operation_setCommonInstanceMetadata(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_setCommonInstanceMetadata.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_operations_operation_global_backendServices_post( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_backendServices_post.json') + def _global_operations_operation_global_backendServices_post(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_global_backendServices_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_backendServices_web_service_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_global_backendServices_web_service_delete' - '.json') + "operations_operation_global_backendServices_web_service_delete" ".json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_forwardingRules_http_rule_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_global_forwardingRules_http_rule_delete.json') + "operations_operation_global_forwardingRules_http_rule_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_operations_operation_global_forwardingRules_post( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_forwardingRules_post.json') + def _global_operations_operation_global_forwardingRules_post(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_global_forwardingRules_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_httpHealthChecks_lchealthcheck_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_global_httpHealthChecks_lchealthcheck_delete.json') + "operations_operation_global_httpHealthChecks_lchealthcheck_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_operations_operation_global_images_debian7_delete( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_images_debian7_delete.json') + def _global_operations_operation_global_images_debian7_delete(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_global_images_debian7_delete.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_httpHealthChecks_lchealthcheck_put( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_global_httpHealthChecks_lchealthcheck_delete.json') + "operations_operation_global_httpHealthChecks_lchealthcheck_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_operations_operation_global_httpHealthChecks_post( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_httpHealthChecks_post.json') + def _global_operations_operation_global_httpHealthChecks_post(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_global_httpHealthChecks_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_firewalls_lcfirewall_delete( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_firewalls_lcfirewall_delete.json') + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_global_firewalls_lcfirewall_delete.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_firewalls_lcfirewall_put( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_firewalls_lcfirewall_put.json') + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_global_firewalls_lcfirewall_put.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_operations_operation_global_firewalls_post( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_firewalls_post.json') + def _global_operations_operation_global_firewalls_post(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_global_firewalls_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_routes_lcdemoroute_delete( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_routes_lcdemoroute_delete.json') + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_global_routes_lcdemoroute_delete.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_networks_lcnetwork_delete( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_networks_lcnetwork_delete.json') + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_global_networks_lcnetwork_delete.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_operations_operation_global_routes_post( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_routes_post.json') + def _global_operations_operation_global_routes_post(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_global_routes_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_operations_operation_global_networks_post( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_networks_post.json') + def _global_operations_operation_global_networks_post(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_global_networks_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_snapshots_lcsnapshot_delete( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_snapshots_lcsnapshot_delete.json') + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_global_snapshots_lcsnapshot_delete.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_operations_operation_global_image_post( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_image_post.json') + def _global_operations_operation_global_image_post(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_global_image_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_addresses_lcaddressglobal_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_global_addresses_lcaddressglobal_delete.json') + "operations_operation_global_addresses_lcaddressglobal_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_targetHttpProxies_post( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_targetHttpProxies_post.json') + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_global_targetHttpProxies_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_targetHttpProxies_web_proxy_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_global_targetHttpProxies_web_proxy_delete' - '.json') + "operations_operation_global_targetHttpProxies_web_proxy_delete" ".json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_operations_operation_global_urlMaps_post( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_urlMaps_post.json') + def _global_operations_operation_global_urlMaps_post(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_global_urlMaps_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_operations_operation_global_urlMaps_web_map_delete( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_global_urlMaps_web_map_delete.json') + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_global_urlMaps_web_map_delete.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_targetHttpProxies(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('global_targetHttpProxies_post.json') + if method == "POST": + body = self.fixtures.load("global_targetHttpProxies_post.json") else: - body = self.fixtures.load('global_targetHttpProxies.json') + body = self.fixtures.load("global_targetHttpProxies.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_targetHttpProxies_web_proxy(self, method, url, body, headers): - if method == 'DELETE': - body = self.fixtures.load( - 'global_targetHttpProxies_web_proxy_delete.json') + if method == "DELETE": + body = self.fixtures.load("global_targetHttpProxies_web_proxy_delete.json") else: - body = self.fixtures.load('global_targetHttpProxies_web_proxy.json') + body = self.fixtures.load("global_targetHttpProxies_web_proxy.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_urlMaps(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('global_urlMaps_post.json') + if method == "POST": + body = self.fixtures.load("global_urlMaps_post.json") else: - body = self.fixtures.load('global_urlMaps.json') + body = self.fixtures.load("global_urlMaps.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_urlMaps_web_map(self, method, url, body, headers): - if method == 'DELETE': - body = self.fixtures.load('global_urlMaps_web_map_delete.json') + if method == "DELETE": + body = self.fixtures.load("global_urlMaps_web_map_delete.json") else: - body = self.fixtures.load('global_urlMaps_web_map.json') + body = self.fixtures.load("global_urlMaps_web_map.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _regions_us_central1_operations_operation_regions_us_central1_addresses_lcaddress_delete( - self, method, url, body, headers): + def _regions_us_east1_subnetworks_cf_972cf02e6ad49113(self, method, url, body, headers): + body = self.fixtures.load("regions_us-east1_subnetworks_cf_972cf02e6ad49113.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _regions_us_central1_subnetworks_cf_972cf02e6ad49112(self, method, url, body, headers): + body = self.fixtures.load("regions_us-central1_subnetworks_cf_972cf02e6ad49112.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _projects_other_name_regions_us_central1(self, method, url, body, headers): + body = self.fixtures.load("projects_other_name_regions_us-central1.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _projects_other_name_global_networks_lcnetwork(self, method, url, body, headers): + body = self.fixtures.load("projects_other_name_global_networks_lcnetwork.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _projects_other_name_global_networks_cf(self, method, url, body, headers): + body = self.fixtures.load("projects_other_name_global_networks_cf.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _projects_other_name_global_networks_shared_network_for_mig( + self, method, url, body, headers + ): + body = self.fixtures.load("projects_other_name_global_networks_shared_network_for_mig.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _projects_other_name_regions_us_central1_subnetworks_cf_972cf02e6ad49114( + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_regions_us-central1_addresses_lcaddress_delete.json') + "projects_other_name_regions_us-central1_subnetworks_cf_972cf02e6ad49114.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _global_operations_operation_global_addresses_post( - self, method, url, body, headers): + def _projects_other_name_regions_us_central1_subnetworks_shared_subnetwork_for_mig( + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_global_addresses_post.json') + "projects_other_name_regions_us-central1_subnetworks_shared_subnetwork_for_mig.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _regions_us_central1_operations_operation_regions_us_central1_addresses_post( - self, method, url, body, headers): + def _regions_us_central1_operations_operation_regions_us_central1_addresses_lcaddress_delete( + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_regions_us-central1_addresses_post.json') + "operations_operation_regions_us-central1_addresses_lcaddress_delete.json" + ) + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_operations_operation_global_addresses_post(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_global_addresses_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _regions_us_central1_operations_operation_regions_us_central1_addresses_post( + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_regions_us-central1_addresses_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _regions_us_central1_operations_operation_regions_us_central1_subnetworks_post( + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_regions_us-central1_subnetworks_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_operations_operation_regions_us_central1_forwardingRules_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_regions_us-central1_forwardingRules_post.json') + "operations_operation_regions_us-central1_forwardingRules_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_operations_operation_regions_us_central1_forwardingRules_lcforwardingrule_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_regions_us-central1_forwardingRules_lcforwardingrule_delete.json') + "operations_operation_regions_us-central1_forwardingRules_lcforwardingrule_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_instances_node_name_deleteAccessConfig(self, method, url, body, headers): + def _zones_us_central1_a_instances_node_name_deleteAccessConfig( + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_instances_node_name_deleteAccessConfig_post.json') + "operations_operation_zones_us-central1-a_instances_node_name_deleteAccessConfig_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_instances_node_name_serialPort(self, method, url, body, headers): - body = self.fixtures.load( - 'zones_us-central1-a_instances_node_name_getSerialOutput.json') + body = self.fixtures.load("zones_us-central1-a_instances_node_name_getSerialOutput.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_instances_node_name_addAccessConfig(self, method, url, body, headers): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_instances_node_name_addAccessConfig_post.json') + "operations_operation_zones_us-central1-a_instances_node_name_addAccessConfig_post.json" + ) + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_operations_operation_setMetadata_post( + self, method, url, body, headers + ): + body = self.fixtures.load( + "operations_operation_zones_us_central1_a_node_name_setMetadata_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_operations_operation_setMetadata_post(self, method, url, body, headers): + def _zones_us_central1_a_operations_operation_setLabels_post(self, method, url, body, headers): body = self.fixtures.load( - 'operations_operation_zones_us_central1_a_node_name_setMetadata_post.json') + "operations_operation_zones_us_central1_a_node_name_setLabels_post.json" + ) + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_operations_operation_setImageLabels_post(self, method, url, body, headers): + body = self.fixtures.load("global_operations_operation_setImageLabels_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_targetInstances_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_targetInstances_post.json') + "operations_operation_zones_us-central1-a_targetInstances_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_operations_operation_regions_us_central1_targetPools_post( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_regions_us-central1_targetPools_post.json') + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_regions_us-central1_targetPools_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_instances_node_name_addAccessConfig_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_instances_node_name_addAccessConfig_done.json') + "operations_operation_zones_us-central1-a_instances_node_name_addAccessConfig_done.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_instances_node_name_deleteAccessConfig_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_instances_node_name_deleteAccessConfig_done.json') + "operations_operation_zones_us-central1-a_instances_node_name_deleteAccessConfig_done.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_targetInstances_lctargetinstance_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_targetInstances_lctargetinstance_delete.json') + "operations_operation_zones_us-central1-a_targetInstances_lctargetinstance_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_operations_operation_regions_us_central1_targetPools_lctargetpool_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_regions_us-central1_targetPools_lctargetpool_delete.json') + "operations_operation_regions_us-central1_targetPools_lctargetpool_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_operations_operation_regions_us_central1_targetPools_lctargetpool_removeHealthCheck_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_regions_us-central1_targetPools_lctargetpool_removeHealthCheck_post.json') + "operations_operation_regions_us-central1_targetPools_lctargetpool_removeHealthCheck_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_operations_operation_regions_us_central1_targetPools_lctargetpool_addHealthCheck_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_regions_us-central1_targetPools_lctargetpool_addHealthCheck_post.json') + "operations_operation_regions_us-central1_targetPools_lctargetpool_addHealthCheck_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_operations_operation_regions_us_central1_targetPools_lctargetpool_removeInstance_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_regions_us-central1_targetPools_lctargetpool_removeInstance_post.json') + "operations_operation_regions_us-central1_targetPools_lctargetpool_removeInstance_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_operations_operation_regions_us_central1_targetPools_lb_pool_setBackup_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_regions_us-central1_targetPools_lb_pool_setBackup_post.json') + "operations_operation_regions_us-central1_targetPools_lb_pool_setBackup_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_operations_operation_regions_us_central1_targetPools_lctargetpool_addInstance_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_regions_us-central1_targetPools_lctargetpool_addInstance_post.json') + "operations_operation_regions_us-central1_targetPools_lctargetpool_addInstance_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_disks_lcdisk_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_disks_lcdisk_delete.json') + "operations_operation_zones_us-central1-a_disks_lcdisk_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_instances_node_name_setDiskAutoDelete( - self, method, url, body, headers): - body = self.fixtures.load( - 'zones_us_central1_a_instances_node_name_setDiskAutoDelete.json') + self, method, url, body, headers + ): + body = self.fixtures.load("zones_us_central1_a_instances_node_name_setDiskAutoDelete.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_volume_auto_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'zones_us_central1_a_operations_operation_volume_auto_delete.json') + "zones_us_central1_a_operations_operation_volume_auto_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_disks_lcdisk_createSnapshot_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_disks_lcdisk_createSnapshot_post.json') + "operations_operation_zones_us-central1-a_disks_lcdisk_createSnapshot_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_operations_operation_zones_us_central1_a_disks_post( - self, method, url, body, headers): + def _zones_us_central1_a_operations_operation_zones_us_central1_a_disks_lcdisk_resize_post( + self, method, url, body, headers + ): + body = self.fixtures.load( + "operations_operation_zones_us-central1-a_disks_lcdisk_resize_post.json" + ) + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_operations_operation_zones_us_central1_a_disks_lcdisk_setLabels_post( + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_disks_post.json') + "operations_operation_zones_us-central1-a_disks_lcdisk_setLabels_post.json" + ) + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_operations_operation_zones_us_central1_a_disks_post( + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_zones_us-central1-a_disks_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_instances_lcnode_000_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_instances_lcnode-000_delete.json') + "operations_operation_zones_us-central1-a_instances_lcnode-000_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_instances_lcnode_001_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_instances_lcnode-001_delete.json') + "operations_operation_zones_us-central1-a_instances_lcnode-001_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_instances_node_name_delete( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_instances_node-name_delete.json') + "operations_operation_zones_us-central1-a_instances_node-name_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_instances_node_name_attachDisk_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_instances_node-name_attachDisk_post.json') + "operations_operation_zones_us-central1-a_instances_node-name_attachDisk_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_instances_node_name_detachDisk_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_instances_node-name_detachDisk_post.json') + "operations_operation_zones_us-central1-a_instances_node-name_detachDisk_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_instances_node_name_setTags_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_instances_node-name_setTags_post.json') + "operations_operation_zones_us-central1-a_instances_node-name_setTags_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_instances_node_name_reset_post( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_instances_node-name_reset_post.json') + "operations_operation_zones_us-central1-a_instances_node-name_reset_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_europe_west1_a_operations_operation_zones_europe_west1_a_instances_post( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_zones_europe-west1-a_instances_post.json') + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_zones_europe-west1-a_instances_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_operations_operation_zones_us_central1_a_instances_post( - self, method, url, body, headers): - body = self.fixtures.load( - 'operations_operation_zones_us-central1-a_instances_post.json') + self, method, url, body, headers + ): + body = self.fixtures.load("operations_operation_zones_us-central1-a_instances_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _project(self, method, url, body, headers): - body = self.fixtures.load('project.json') + body = self.fixtures.load("project.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _projects_windows_cloud_global_licenses_windows_server_2008_r2_dc(self, method, url, body, headers): - body = self.fixtures.load('projects_windows-cloud_global_licenses_windows_server_2008_r2_dc.json') + def _projects_windows_cloud_global_licenses_windows_server_2008_r2_dc( + self, method, url, body, headers + ): + body = self.fixtures.load( + "projects_windows-cloud_global_licenses_windows_server_2008_r2_dc.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _projects_suse_cloud_global_licenses_sles_11(self, method, url, body, headers): - body = self.fixtures.load('projects_suse-cloud_global_licenses_sles_11.json') + body = self.fixtures.load("projects_suse-cloud_global_licenses_sles_11.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _projects_rhel_cloud_global_licenses_rhel_7_server(self, method, url, body, headers): - body = self.fixtures.load('projects_rhel-cloud_global_licenses_rhel_server.json') + body = self.fixtures.load("projects_rhel-cloud_global_licenses_rhel_server.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _projects_coreos_cloud_global_licenses_coreos_stable(self, method, url, body, headers): + body = self.fixtures.load("projects_coreos-cloud_global_licenses_coreos_stable.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _projects_suse_cloud_global_licenses_sles_12(self, method, url, body, headers): - body = self.fixtures.load('projects_suse-cloud_global_licenses_sles_12.json') + body = self.fixtures.load("projects_suse-cloud_global_licenses_sles_12.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _projects_windows_cloud_global_images(self, method, url, body, header): - body = self.fixtures.load('projects_windows-cloud_global_images.json') + body = self.fixtures.load("projects_windows-cloud_global_images.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _projects_windows_sql_cloud_global_images(self, method, url, body, header): + body = self.fixtures.load("projects_windows-sql-cloud_global_images.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _projects_rhel_cloud_global_images(self, method, url, boyd, header): - body = self.fixtures.load('projects_rhel-cloud_global_images.json') + def _projects_rhel_cloud_global_images(self, method, url, body, header): + body = self.fixtures.load("projects_rhel-cloud_global_images.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _projects_gce_nvme_global_images(self, method, url, boyd, header): - body = self.fixtures.load('projects_gce-nvme_global_images.json') + def _projects_coreos_cloud_global_images(self, method, url, body, header): + body = self.fixtures.load("projects_coreos-cloud_global_images.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _projects_coreos_cloud_global_images(self, method, url, boyd, header): - body = self.fixtures.load('projects_coreos-cloud_global_images.json') + def _projects_coreos_cloud_global_images_family_coreos_beta(self, method, url, body, header): + body = self.fixtures.load("projects_coreos-cloud_global_images_family_coreos_beta.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _projects_opensuse_cloud_global_images(self, method, url, boyd, header): - body = self.fixtures.load('projects_opensuse-cloud_global_images.json') + def _projects_coreos_cloud_global_images_family_coreos_stable(self, method, url, body, header): + body = self.fixtures.load("projects_coreos-cloud_global_images_family_coreos_stable.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _projects_google_containers_global_images(self, method, url, boyd, header): - body = self.fixtures.load('projects_google-containers_global_images.json') + def _projects_cos_cloud_global_images(self, method, url, body, header): + body = self.fixtures.load("projects_cos-cloud_global_images.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _projects_opensuse_cloud_global_images(self, method, url, body, header): + body = self.fixtures.load("projects_opensuse-cloud_global_images.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _projects_ubuntu_os_cloud_global_images(self, method, url, body, header): - body = self.fixtures.load('projects_ubuntu-os-cloud_global_images.json') + body = self.fixtures.load("projects_ubuntu-os-cloud_global_images.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _projects_centos_cloud_global_images(self, method, url, body, header): - body = self.fixtures.load('projects_centos-cloud_global_images.json') + body = self.fixtures.load("projects_centos-cloud_global_images.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _projects_suse_cloud_global_images(self, method, url, body, headers): - body = self.fixtures.load('projects_suse-cloud_global_images.json') + body = self.fixtures.load("projects_suse-cloud_global_images.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _projects_suse_byos_cloud_global_images(self, method, url, body, headers): + body = self.fixtures.load("projects_suse-byos-cloud_global_images.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _projects_suse_sap_cloud_global_images(self, method, url, body, headers): + body = self.fixtures.load("projects_suse-sap-cloud_global_images.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _projects_debian_cloud_global_images(self, method, url, body, headers): - body = self.fixtures.load('projects_debian-cloud_global_images.json') + body = self.fixtures.load("projects_debian-cloud_global_images.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions(self, method, url, body, headers): - body = self.fixtures.load( - 'regions.json') + if "pageToken" in url or "filter" in url: + body = self.fixtures.load("regions-paged-2.json") + elif "maxResults" in url: + body = self.fixtures.load("regions-paged-1.json") + else: + body = self.fixtures.load("regions.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_addresses(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load( - 'global_addresses_post.json') + if method == "POST": + body = self.fixtures.load("global_addresses_post.json") else: - body = self.fixtures.load('global_addresses.json') + body = self.fixtures.load("global_addresses.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _regions_europe_west1(self, method, url, body, headers): + body = self.fixtures.load("regions_europe-west1.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _regions_asia_east1(self, method, url, body, headers): + body = self.fixtures.load("regions_asia-east1.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _regions_us_central1(self, method, url, body, headers): + body = self.fixtures.load("regions_us-central1.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _regions_us_east1(self, method, url, body, headers): + body = self.fixtures.load("regions_us-east1.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _regions_us_central1_subnetworks(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("regions_us-central1_subnetworks_post.json") + else: + body = self.fixtures.load("regions_us-central1_subnetworks.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_addresses(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load( - 'regions_us-central1_addresses_post.json') + if method == "POST": + body = self.fixtures.load("regions_us-central1_addresses_post.json") else: - body = self.fixtures.load('regions_us-central1_addresses.json') + body = self.fixtures.load("regions_us-central1_addresses.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _global_addresses_lcaddressglobal(self, method, url, body, headers): - if method == 'DELETE': - body = self.fixtures.load( - 'global_addresses_lcaddressglobal_delete.json') + if method == "DELETE": + body = self.fixtures.load("global_addresses_lcaddressglobal_delete.json") else: - body = self.fixtures.load('global_addresses_lcaddressglobal.json') + body = self.fixtures.load("global_addresses_lcaddressglobal.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _regions_us_central1_addresses_lcaddress(self, method, url, body, - headers): - if method == 'DELETE': - body = self.fixtures.load( - 'regions_us-central1_addresses_lcaddress_delete.json') + def _regions_us_central1_addresses_lcaddress(self, method, url, body, headers): + if method == "DELETE": + body = self.fixtures.load("regions_us-central1_addresses_lcaddress_delete.json") else: - body = self.fixtures.load( - 'regions_us-central1_addresses_lcaddress.json') + body = self.fixtures.load("regions_us-central1_addresses_lcaddress.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _regions_us_central1_addresses_testaddress(self, method, url, body, headers): + body = self.fixtures.load("regions_us-central1_addresses_testaddress.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _regions_us_central1_subnetworks_subnet_1(self, method, url, body, headers): + body = self.fixtures.load("regions_us-central1_subnetworks_subnet_1.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _regions_us_central1_addresses_lcaddressinternal(self, method, url, body, headers): + body = self.fixtures.load("regions_us-central1_addresses_lcaddressinternal.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_forwardingRules(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load( - 'regions_us-central1_forwardingRules_post.json') + if method == "POST": + body = self.fixtures.load("regions_us-central1_forwardingRules_post.json") else: - body = self.fixtures.load( - 'regions_us-central1_forwardingRules.json') + body = self.fixtures.load("regions_us-central1_forwardingRules.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _regions_us_central1_forwardingRules_libcloud_lb_demo_lb( - self, method, url, body, headers): - body = self.fixtures.load( - 'regions_us-central1_forwardingRules_libcloud-lb-demo-lb.json') + def _regions_us_central1_forwardingRules_libcloud_lb_demo_lb(self, method, url, body, headers): + body = self.fixtures.load("regions_us-central1_forwardingRules_libcloud-lb-demo-lb.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _regions_us_central1_forwardingRules_lcforwardingrule( - self, method, url, body, headers): - if method == 'DELETE': + def _regions_us_central1_forwardingRules_lcforwardingrule(self, method, url, body, headers): + if method == "DELETE": body = self.fixtures.load( - 'regions_us-central1_forwardingRules_lcforwardingrule_delete.json') + "regions_us-central1_forwardingRules_lcforwardingrule_delete.json" + ) else: - body = self.fixtures.load( - 'regions_us-central1_forwardingRules_lcforwardingrule.json') + body = self.fixtures.load("regions_us-central1_forwardingRules_lcforwardingrule.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_targetInstances(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load( - 'zones_us-central1-a_targetInstances_post.json') + if method == "POST": + body = self.fixtures.load("zones_us-central1-a_targetInstances_post.json") else: - body = self.fixtures.load('zones_us-central1-a_targetInstances.json') + body = self.fixtures.load("zones_us-central1-a_targetInstances.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_targetPools(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load( - 'regions_us-central1_targetPools_post.json') + if method == "POST": + body = self.fixtures.load("regions_us-central1_targetPools_post.json") else: - body = self.fixtures.load('regions_us-central1_targetPools.json') + body = self.fixtures.load("regions_us-central1_targetPools.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_targetInstances_lctargetinstance(self, method, url, body, headers): - if method == 'DELETE': + if method == "DELETE": body = self.fixtures.load( - 'zones_us-central1-a_targetInstances_lctargetinstance_delete.json') + "zones_us-central1-a_targetInstances_lctargetinstance_delete.json" + ) else: - body = self.fixtures.load( - 'zones_us-central1-a_targetInstances_lctargetinstance.json') + body = self.fixtures.load("zones_us-central1-a_targetInstances_lctargetinstance.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_targetPools_lb_pool_getHealth(self, method, url, body, headers): - body = self.fixtures.load( - 'regions_us-central1_targetPools_lb_pool_getHealth.json') + body = self.fixtures.load("regions_us-central1_targetPools_lb_pool_getHealth.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_targetPools_lb_pool(self, method, url, body, headers): - body = self.fixtures.load( - 'regions_us-central1_targetPools_lb_pool.json') + body = self.fixtures.load("regions_us-central1_targetPools_lb_pool.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _regions_us_central1_targetPools_lctargetpool(self, method, url, - body, headers): - if method == 'DELETE': - body = self.fixtures.load( - 'regions_us-central1_targetPools_lctargetpool_delete.json') + def _regions_us_central1_targetPools_lctargetpool(self, method, url, body, headers): + if method == "DELETE": + body = self.fixtures.load("regions_us-central1_targetPools_lctargetpool_delete.json") else: - body = self.fixtures.load( - 'regions_us-central1_targetPools_lctargetpool.json') + body = self.fixtures.load("regions_us-central1_targetPools_lctargetpool.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _regions_us_central1_targetPools_lctargetpool_sticky(self, method, url, - body, headers): - body = self.fixtures.load( - 'regions_us-central1_targetPools_lctargetpool_sticky.json') + def _regions_us_central1_targetPools_lctargetpool_sticky(self, method, url, body, headers): + body = self.fixtures.load("regions_us-central1_targetPools_lctargetpool_sticky.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _regions_us_central1_targetPools_backup_pool( - self, method, url, body, headers): - body = self.fixtures.load( - 'regions_us-central1_targetPools_backup_pool.json') + def _regions_us_central1_targetPools_backup_pool(self, method, url, body, headers): + body = self.fixtures.load("regions_us-central1_targetPools_backup_pool.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _regions_us_central1_targetPools_libcloud_lb_demo_lb_tp( - self, method, url, body, headers): - body = self.fixtures.load( - 'regions_us-central1_targetPools_libcloud-lb-demo-lb-tp.json') + def _regions_us_central1_targetPools_libcloud_lb_demo_lb_tp(self, method, url, body, headers): + body = self.fixtures.load("regions_us-central1_targetPools_libcloud-lb-demo-lb-tp.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_targetPools_lctargetpool_removeHealthCheck( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'regions_us-central1_targetPools_lctargetpool_removeHealthCheck_post.json') + "regions_us-central1_targetPools_lctargetpool_removeHealthCheck_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_targetPools_lctargetpool_addHealthCheck( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'regions_us-central1_targetPools_lctargetpool_addHealthCheck_post.json') + "regions_us-central1_targetPools_lctargetpool_addHealthCheck_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _regions_us_central1_targetPools_lctargetpool_removeInstance( - self, method, url, body, headers): + self, method, url, body, headers + ): body = self.fixtures.load( - 'regions_us-central1_targetPools_lctargetpool_removeInstance_post.json') + "regions_us-central1_targetPools_lctargetpool_removeInstance_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _regions_us_central1_targetPools_lb_pool_setBackup( - self, method, url, body, headers): - body = self.fixtures.load( - 'regions_us-central1_targetPools_lb_pool_setBackup_post.json') + def _regions_us_central1_targetPools_lb_pool_setBackup(self, method, url, body, headers): + body = self.fixtures.load("regions_us-central1_targetPools_lb_pool_setBackup_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _regions_us_central1_targetPools_lctargetpool_addInstance( - self, method, url, body, headers): + def _regions_us_central1_targetPools_lctargetpool_addInstance(self, method, url, body, headers): body = self.fixtures.load( - 'regions_us-central1_targetPools_lctargetpool_addInstance_post.json') + "regions_us-central1_targetPools_lctargetpool_addInstance_post.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones(self, method, url, body, headers): - body = self.fixtures.load('zones.json') + body = self.fixtures.load("zones.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_asia_east_1a(self, method, url, body, headers): + body = self.fixtures.load("zones_asia-east1-a.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_asia_east1_b(self, method, url, body, headers): + body = self.fixtures.load("zones_asia-east1-b.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_east1_b(self, method, url, body, headers): + body = self.fixtures.load("zones_us-east1-b.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_diskTypes(self, method, url, body, headers): - body = self.fixtures.load('zones_us-central1-a_diskTypes.json') + body = self.fixtures.load("zones_us-central1-a_diskTypes.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_diskTypes_pd_standard(self, method, url, body, headers): - body = self.fixtures.load('zones_us-central1-a_diskTypes_pd_standard.json') + body = self.fixtures.load("zones_us-central1-a_diskTypes_pd_standard.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_diskTypes_pd_ssd(self, method, url, body, headers): - body = self.fixtures.load('zones_us-central1-a_diskTypes_pd_ssd.json') + body = self.fixtures.load("zones_us-central1-a_diskTypes_pd_ssd.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_disks(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('zones_us-central1-a_disks_post.json') + if method == "POST": + body = self.fixtures.load("zones_us-central1-a_disks_post.json") else: - body = self.fixtures.load('zones_us-central1-a_disks.json') + body = self.fixtures.load("zones_us-central1-a_disks.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_disks_lcdisk(self, method, url, body, headers): - if method == 'DELETE': - body = self.fixtures.load( - 'zones_us-central1-a_disks_lcdisk_delete.json') + if method == "DELETE": + body = self.fixtures.load("zones_us-central1-a_disks_lcdisk_delete.json") else: - body = self.fixtures.load('zones_us-central1-a_disks_lcdisk.json') + body = self.fixtures.load("zones_us-central1-a_disks_lcdisk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_disks_lcdisk_createSnapshot(self, method, url, - body, headers): - body = self.fixtures.load( - 'zones_us-central1-a_disks_lcdisk_createSnapshot_post.json') + def _zones_us_central1_a_disks_lcdisk_createSnapshot(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_disks_lcdisk_createSnapshot_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_disks_lcdisk_resize(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_disks_lcdisk_resize_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_disks_lcdisk_setLabels(self, method, url, body, header): + body = self.fixtures.load("zones_us-central1-a_disks_lcdisk_setLabel_post.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_disks_node_name(self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_disks_lcnode_000( - self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + def _zones_us_central1_a_disks_lcnode_000(self, method, url, body, headers): + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_disks_lcnode_001( - self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + def _zones_us_central1_a_disks_lcnode_001(self, method, url, body, headers): + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_b_disks_libcloud_lb_demo_www_000( - self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + def _zones_us_central1_b_disks_libcloud_lb_demo_www_000(self, method, url, body, headers): + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_b_disks_libcloud_lb_demo_www_001( - self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + def _zones_us_central1_b_disks_libcloud_lb_demo_www_001(self, method, url, body, headers): + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_b_disks_libcloud_lb_demo_www_002( - self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + def _zones_us_central1_b_disks_libcloud_lb_demo_www_002(self, method, url, body, headers): + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central2_a_disks_libcloud_demo_boot_disk( - self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + def _zones_us_central2_a_disks_libcloud_demo_boot_disk(self, method, url, body, headers): + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central2_a_disks_libcloud_demo_np_node( - self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + def _zones_us_central2_a_disks_libcloud_demo_np_node(self, method, url, body, headers): + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central2_a_disks_libcloud_demo_multiple_nodes_000( - self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + self, method, url, body, headers + ): + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central2_a_disks_libcloud_demo_multiple_nodes_001( - self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + self, method, url, body, headers + ): + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_europe_west1_a_disks(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('zones_us-central1-a_disks_post.json') + if method == "POST": + body = self.fixtures.load("zones_us-central1-a_disks_post.json") else: - body = self.fixtures.load('zones_us-central1-a_disks.json') + body = self.fixtures.load("zones_us-central1-a_disks.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_europe_west1_a_disks_libcloud_demo_europe_np_node( - self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + def _zones_europe_west1_a_disks_libcloud_demo_europe_np_node(self, method, url, body, headers): + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_europe_west1_a_disks_libcloud_demo_europe_boot_disk( - self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + self, method, url, body, headers + ): + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_europe_west1_a_disks_libcloud_demo_europe_multiple_nodes_000( - self, method, url, body, headers): - body = self.fixtures.load('generic_disk.json') + self, method, url, body, headers + ): + body = self.fixtures.load("generic_disk.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_europe_west1_a_instances(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load( - 'zones_europe-west1-a_instances_post.json') + if method == "POST": + body = self.fixtures.load("zones_europe-west1-a_instances_post.json") else: - body = self.fixtures.load('zones_europe-west1-a_instances.json') + body = self.fixtures.load("zones_europe-west1-a_instances.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_b_instances(self, method, url, body, headers): + if method == "GET": + body = "{}" return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_europe_west1_a_diskTypes_pd_standard(self, method, url, body, headers): - body = self.fixtures.load('zones_europe-west1-a_diskTypes_pd_standard.json') + body = self.fixtures.load("zones_europe-west1-a_diskTypes_pd_standard.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) def _zones_us_central1_a_instances(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load( - 'zones_us-central1-a_instances_post.json') + if method == "POST": + body = self.fixtures.load("zones_us-central1-a_instances_post.json") + else: + body = self.fixtures.load("zones_us-central1-a_instances.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instances_sn_node_name(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_instances_sn-node-name.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instances_node_name(self, method, url, body, headers): + if method == "DELETE": + body = self.fixtures.load("zones_us-central1-a_instances_node-name_delete.json") + else: + body = self.fixtures.load("zones_us-central1-a_instances_node-name.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instances_node_name_attachDisk(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_instances_node-name_attachDisk_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instances_node_name_detachDisk(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_instances_node-name_detachDisk_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instances_node_name_setTags(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_instances_node-name_setTags_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instances_node_name_reset(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_instances_node-name_reset_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instances_lcnode_000(self, method, url, body, headers): + if method == "DELETE": + body = self.fixtures.load("zones_us-central1-a_instances_lcnode-000_delete.json") + else: + body = self.fixtures.load("zones_us-central1-a_instances_lcnode-000.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instances_lcnode_001(self, method, url, body, headers): + if method == "DELETE": + body = self.fixtures.load("zones_us-central1-a_instances_lcnode-001_delete.json") else: - body = self.fixtures.load('zones_us-central1-a_instances.json') + body = self.fixtures.load("zones_us-central1-a_instances_lcnode-001.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_b_instances_libcloud_lb_nopubip_001(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-b_instances_libcloud-lb-nopubip-001.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_b_instances_libcloud_lb_demo_www_000(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-b_instances_libcloud-lb-demo-www-000.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_b_instances_libcloud_lb_demo_www_001(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-b_instances_libcloud-lb-demo-www-001.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_b_instances_libcloud_lb_demo_www_002(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-b_instances_libcloud-lb-demo-www-002.json") + return ( + httplib.NOT_FOUND, + body, + self.json_hdr, + httplib.responses[httplib.NOT_FOUND], + ) + + def _zones_us_central1_a(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_instances_node_name(self, method, url, body, - headers): - if method == 'DELETE': + def _zones_us_central1_a_machineTypes(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_machineTypes.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_europe_west1_a_machineTypes_n1_standard_1(self, method, url, body, headers): + body = self.fixtures.load("zones_europe-west1-a_machineTypes_n1-standard-1.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_machineTypes_n1_standard_1(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_machineTypes_n1-standard-1.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instanceGroups_myinstancegroup(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_instanceGroup_myinstancegroup.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instanceGroups_myinstancegroup2(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_instanceGroup_myinstancegroup2.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_b_instanceGroups_myinstancegroup(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-b_instanceGroup_myinstancegroup.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_east1_b_instanceGroups_myinstancegroup(self, method, url, body, headers): + body = self.fixtures.load("zones_us-east1-b_instanceGroup_myinstancegroup.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instanceGroups_myinstancegroup_shared_network( + self, method, url, body, headers + ): + body = self.fixtures.load( + "zones_us-central1-a_instanceGroup_myinstancegroup_shared_network.json" + ) + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instanceGroupManagers_myinstancegroup( + self, method, url, body, headers + ): + if method == "PATCH": + # test_ex_instancegroupmanager_set_autohealing_policies body = self.fixtures.load( - 'zones_us-central1-a_instances_node-name_delete.json') + "zones_us-central1-a_operations_operation_zones_us-central1-a_instanceGroupManagers_insert_post.json" + ) else: body = self.fixtures.load( - 'zones_us-central1-a_instances_node-name.json') + "zones_us-central1-a_instanceGroupManagers_myinstancegroup.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_instances_node_name_attachDisk( - self, method, url, body, headers): + def _zones_us_central1_a_instanceGroupManagers_myinstancegroup_shared_network( + self, method, url, body, headers + ): body = self.fixtures.load( - 'zones_us-central1-a_instances_node-name_attachDisk_post.json') + "zones_us-central1-a_instanceGroupManagers_myinstancegroup_shared_network.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_instances_node_name_detachDisk( - self, method, url, body, headers): + def _zones_us_central1_b_instanceGroupManagers_myinstancegroup( + self, method, url, body, headers + ): + body = self.fixtures.load("zones_us-central1-b_instanceGroupManagers_myinstancegroup.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instanceGroupManagers_myinstancegroup_listManagedInstances( + self, method, url, body, headers + ): body = self.fixtures.load( - 'zones_us-central1-a_instances_node-name_detachDisk_post.json') + "_zones_us_central1_a_instanceGroupManagers_myinstancegroup_listManagedInstances.json" + ) + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_east1_b_instanceGroupManagers(self, method, url, body, headers): + body = self.fixtures.load("zones_us-east1-b_instanceGroupManagers.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_instances_node_name_setTags( - self, method, url, body, headers): + def _zones_us_central1_a_instanceGroupManagers(self, method, url, body, headers): + # do an insert. Returns an operations link, which then + # returns the MIG URI. + if method == "POST": + body = self.fixtures.load("zones_us-central1-a_instanceGroupManagers_insert.json") + else: + body = self.fixtures.load("zones_us-central1-a_instanceGroupManagers.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_operations_operation_zones_us_central1_a_instanceGroupManagers_insert_post( + self, method, url, body, headers + ): body = self.fixtures.load( - 'zones_us-central1-a_instances_node-name_setTags_post.json') + "zones_us-central1-a_operations_operation_zones_us-central1-a_instanceGroupManagers_insert_post.json" + ) + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_instanceTemplates(self, method, url, body, headers): + if method == "POST": + # insert + body = self.fixtures.load("global_instanceTemplates_insert.json") + else: + # get or list call + body = self.fixtures.load("global_instanceTemplates.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_operations_operation_global_instanceTemplates_my_instance_template1_insert( + self, method, url, body, headers + ): + """Redirects from _global_instanceTemplates""" + body = self.fixtures.load("operations_operation_global_instanceTemplates_insert.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_instances_node_name_reset( - self, method, url, body, headers): + def _global_instanceTemplates_my_instance_template1(self, method, url, body, headers): + body = self.fixtures.load("global_instanceTemplates_my_instance_template1.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_instanceTemplates_my_instance_template_shared_network( + self, method, url, body, headers + ): body = self.fixtures.load( - 'zones_us-central1-a_instances_node-name_reset_post.json') + "global_instanceTemplates_my_instance_template_shared_network.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_instances_lcnode_000(self, method, url, body, - headers): - if method == 'DELETE': - body = self.fixtures.load( - 'zones_us-central1-a_instances_lcnode-000_delete.json') + def _aggregated_autoscalers(self, method, url, body, headers): + body = self.fixtures.load("aggregated_autoscalers.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_sslCertificates(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("global_sslcertificates_post.json") else: - body = self.fixtures.load( - 'zones_us-central1-a_instances_lcnode-000.json') + body = self.fixtures.load("global_sslcertificates.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_instances_lcnode_001(self, method, url, body, - headers): - if method == 'DELETE': - body = self.fixtures.load( - 'zones_us-central1-a_instances_lcnode-001_delete.json') + def _global_sslCertificates_example(self, method, url, body, headers): + body = self.fixtures.load("global_sslcertificates_example.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _global_operations_operation_global_sslcertificates_post(self, method, url, body, headers): + body = self.fixtures.load("operations_operation_global_sslcertificates_post.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instanceGroups_myname(self, method, url, body, headers): + if method == "DELETE": + # delete + body = self.fixtures.load("zones_us_central1_a_instanceGroups_myname_delete.json") else: - body = self.fixtures.load( - 'zones_us-central1-a_instances_lcnode-001.json') + # get or list call + body = self.fixtures.load("zones_us_central1_a_instanceGroups_myname.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_b_instances_libcloud_lb_demo_www_000( - self, method, url, body, headers): + def _zones_us_central1_a_operations_operation_zones_us_central1_a_instanceGroups_myname_delete( + self, method, url, body, headers + ): + """Redirects from _zones_us_central1_a_instanceGroups_myname""" body = self.fixtures.load( - 'zones_us-central1-b_instances_libcloud-lb-demo-www-000.json') + "operations_operation_zones_us_central1_a_instanceGroups_myname_delete.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_b_instances_libcloud_lb_demo_www_001( - self, method, url, body, headers): - body = self.fixtures.load( - 'zones_us-central1-b_instances_libcloud-lb-demo-www-001.json') + def _zones_us_central1_a_instanceGroups(self, method, url, body, headers): + if method == "POST": + # insert + body = self.fixtures.load("zones_us_central1_a_instanceGroups_insert.json") + else: + # get or list call + body = self.fixtures.load("zones_us_central1_a_instanceGroups.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instanceGroups_zone_attribute_not_present( + self, method, url, body, headers + ): + if method == "GET": + # get or list call + body = self.fixtures.load( + "zones_us_central1_a_instanceGroups_zone_attribute_not_present.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_b_instances_libcloud_lb_demo_www_002( - self, method, url, body, headers): + def _zones_us_central1_a_operations_operation_zones_us_central1_a_instanceGroups_myname_insert( + self, method, url, body, headers + ): + """Redirects from _zones_us_central1_a_instanceGroups""" body = self.fixtures.load( - 'zones_us-central1-b_instances_libcloud-lb-demo-www-002.json') - return (httplib.NOT_FOUND, body, self.json_hdr, - httplib.responses[httplib.NOT_FOUND]) + "operations_operation_zones_us_central1_a_instanceGroups_insert.json" + ) + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a(self, method, url, body, headers): - body = self.fixtures.load('zones_us-central1-a.json') + def _zones_us_central1_a_instanceGroups_myname_listInstances(self, method, url, body, headers): + # POST + body = self.fixtures.load("zones_us_central1_a_instanceGroups_myname_listInstances.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_machineTypes(self, method, url, body, headers): - body = self.fixtures.load('zones_us-central1-a_machineTypes.json') + def _zones_us_central1_a_instanceGroups_myname_addInstances(self, method, url, body, headers): + # POST + body = self.fixtures.load("zones_us_central1_a_instanceGroups_myname_addInstances.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_europe_west1_a_machineTypes_n1_standard_1(self, method, url, - body, headers): + def _zones_us_central1_a_operations_operation_zones_us_central1_a_instanceGroups_myname_addInstances( + self, method, url, body, headers + ): + """Redirects from _zones_us_central1_a_instanceGroups_myname_addInstances""" body = self.fixtures.load( - 'zones_europe-west1-a_machineTypes_n1-standard-1.json') + "operations_operation_zones_us_central1_a_instanceGroups_myname_addInstances.json" + ) + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instanceGroups_myname_removeInstances( + self, method, url, body, headers + ): + # POST + body = self.fixtures.load("zones_us_central1_a_instanceGroups_myname_removeInstances.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_operations_operation_zones_us_central1_a_instanceGroups_myname_removeInstances( + self, method, url, body, headers + ): + """Redirects from _zones_us_central1_a_instanceGroups_myname_removeInstances""" + body = self.fixtures.load( + "operations_operation_zones_us_central1_a_instanceGroups_myname_removeInstances.json" + ) + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_instanceGroups_myname_setNamedPorts(self, method, url, body, headers): + # POST + body = self.fixtures.load("zones_us_central1_a_instanceGroups_myname_setNamedPorts.json") return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) - def _zones_us_central1_a_machineTypes_n1_standard_1(self, method, url, - body, headers): + def _zones_us_central1_a_operations_operation_zones_us_central1_a_instanceGroups_myname_setNamedPorts( + self, method, url, body, headers + ): + """Redirects from _zones_us_central1_a_instanceGroups_myname_setNamedPorts""" body = self.fixtures.load( - 'zones_us-central1-a_machineTypes_n1-standard-1.json') + "operations_operation_zones_us_central1_a_instanceGroups_myname_setNamedPorts.json" + ) return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_gig_g8.py b/libcloud/test/compute/test_gig_g8.py new file mode 100644 index 0000000000..bd77c6737a --- /dev/null +++ b/libcloud/test/compute/test_gig_g8.py @@ -0,0 +1,190 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import sys +import json +import time +import base64 +import unittest +from unittest import mock + +import libcloud.common.gig_g8 +from libcloud.test import MockHttp +from libcloud.utils.py3 import httplib +from libcloud.compute.base import Node, NodeSize, NodeImage, StorageVolume +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.gig_g8 import G8Network, G8NodeDriver, G8PortForward + +# For tests we don't want to actually verify a token since we use an expired on +original_is_jwt_expired = libcloud.common.gig_g8.is_jwt_expired + + +def mock_is_jwt_expired(jwt): + return False + + +class G8MockHttp(MockHttp): + """Fixtures needed for tests related to rating model""" + + fixtures = ComputeFileFixtures("gig_g8") + + def __getattr__(self, key): + def method(method, path, params, headers): + response = self.fixtures.load("{}_{}.json".format(method, key.lstrip("_"))) + return (httplib.OK, response, {}, httplib.responses[httplib.OK]) + + return method + + +@mock.patch("libcloud.common.gig_g8.is_jwt_expired", mock_is_jwt_expired) +class G8Tests(unittest.TestCase): + def setUp(self): + G8NodeDriver.connectionCls.conn_class = G8MockHttp + self.driver = G8NodeDriver( + 1, + "header.eyJhenAiOiJkZndlcmdyZWdyZSIsImV4cCI6MTU5MDUyMzEwNSwiaXNzIjoiaXRzeW91b25saW5lIiwicmVmcmVzaF90b2tlbiI6Inh4eHh4eHgiLCJzY29wZSI6WyJ1c2VyOmFkbWluIl0sInVzZXJuYW1lIjoiZXhhbXBsZSJ9.signature", + "https://myg8.example.com", + ) + + def test_list_networks(self): + networks = self.driver.ex_list_networks() + self.assertGreater(len(networks), 0) + for network in networks: + self.assertIsInstance(network, G8Network) + + def test_list_nodes(self): + nodes = self.driver.list_nodes() + self.assertGreater(len(nodes), 0) + for node in nodes: + self.assertIsInstance(node, Node) + + def test_list_sizes(self): + sizes = self.driver.list_sizes() + self.assertGreater(len(sizes), 0) + for size in sizes: + self.assertIsInstance(size, NodeSize) + + def test_list_images(self): + images = self.driver.list_images() + self.assertGreater(len(images), 0) + for image in images: + self.assertIsInstance(image, NodeImage) + + def test_create_node(self): + image = self.driver.list_images()[0] + size = self.driver.list_sizes()[0] + network = self.driver.ex_list_networks()[0] + node = self.driver.create_node( + "my test", size, image, ex_network=network, ex_description="my description" + ) + self.assertIsInstance(node, Node) + + def test_stop_node(self): + node = self.driver.list_nodes()[0] + result = self.driver.stop_node(node) + self.assertTrue(result) + + def test_reboot_node(self): + node = self.driver.list_nodes()[0] + result = self.driver.reboot_node(node) + self.assertTrue(result) + + def test_destroy_node(self): + node = self.driver.list_nodes()[0] + result = self.driver.destroy_node(node) + self.assertTrue(result) + + def test_start_node(self): + node = self.driver.list_nodes()[0] + result = self.driver.start_node(node) + self.assertTrue(result) + + def test_create_network(self): + network = self.driver.ex_create_network("my network") + self.assertIsInstance(network, G8Network) + + def test_destroy_network(self): + network = self.driver.ex_list_networks()[0] + result = self.driver.ex_destroy_network(network) + self.assertTrue(result) + + def test_list_portforward(self): + network = self.driver.ex_list_networks()[0] + forwards = self.driver.ex_list_portforwards(network) + self.assertGreater(len(forwards), 0) + for forward in forwards: + self.assertIsInstance(forward, G8PortForward) + + def test_create_forward(self): + network = self.driver.ex_list_networks()[0] + node = self.driver.list_nodes()[0] + result = self.driver.ex_create_portforward(network, node, 34022, 22) + self.assertIsInstance(result, G8PortForward) + + def test_delete_portforward(self): + network = self.driver.ex_list_networks()[0] + forward = self.driver.ex_list_portforwards(network)[0] + res = self.driver.ex_delete_portforward(forward) + self.assertTrue(res) + + def test_list_volumes(self): + volumes = self.driver.list_volumes() + self.assertGreater(len(volumes), 1) + for volume in volumes: + self.assertIsInstance(volume, StorageVolume) + + def test_create_volume(self): + volume = self.driver.create_volume(10, "my volume", "my description") + self.assertIsInstance(volume, StorageVolume) + + def test_destroy_volume(self): + volume = self.driver.list_volumes()[0] + res = self.driver.destroy_volume(volume) + self.assertTrue(res) + + def test_attach_volume(self): + volume = self.driver.list_volumes()[0] + node = self.driver.list_nodes()[0] + res = self.driver.attach_volume(node, volume) + self.assertTrue(res) + + def test_detach_volume(self): + volume = self.driver.list_volumes()[0] + node = self.driver.list_nodes()[0] + res = self.driver.detach_volume(node, volume) + self.assertTrue(res) + + def test_is_jwt_expired(self): + data = { + "azp": "example", + "exp": int(time.time()), + "iss": "itsyouonline", + "refresh_token": "xxxxxxx", + "scope": ["user:admin"], + "username": "example", + } + + def contruct_jwt(data): + jsondata = json.dumps(data).encode() + return "header.{}.signature".format(base64.encodebytes(jsondata).decode()) + + libcloud.common.gig_g8.is_jwt_expired = original_is_jwt_expired + + self.assertTrue(libcloud.common.gig_g8.is_jwt_expired(contruct_jwt(data))) + data["exp"] = int(time.time()) + 300 # expire in 5min + self.assertFalse(libcloud.common.gig_g8.is_jwt_expired(contruct_jwt(data))) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_gogrid.py b/libcloud/test/compute/test_gogrid.py deleted file mode 100644 index f7ceae63c6..0000000000 --- a/libcloud/test/compute/test_gogrid.py +++ /dev/null @@ -1,283 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import sys -import unittest - -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlparse -from libcloud.utils.py3 import parse_qs - -from libcloud.compute.base import NodeState, NodeLocation -from libcloud.common.types import LibcloudError, InvalidCredsError -from libcloud.common.gogrid import GoGridIpAddress -from libcloud.compute.drivers.gogrid import GoGridNodeDriver -from libcloud.compute.base import Node, NodeImage, NodeSize - -from libcloud.test import MockHttp # pylint: disable-msg=E0611 -from libcloud.test.compute import TestCaseMixin # pylint: disable-msg=E0611 -from libcloud.test.file_fixtures import ComputeFileFixtures # pylint: disable-msg=E0611 - - -class GoGridTests(unittest.TestCase, TestCaseMixin): - - def setUp(self): - GoGridNodeDriver.connectionCls.conn_classes = (None, GoGridMockHttp) - GoGridMockHttp.type = None - self.driver = GoGridNodeDriver("foo", "bar") - - def _get_test_512Mb_node_size(self): - return NodeSize(id='512Mb', - name=None, - ram=None, - disk=None, - bandwidth=None, - price=None, - driver=self.driver) - - def test_create_node(self): - image = NodeImage(1531, None, self.driver) - node = self.driver.create_node( - name='test1', - image=image, - size=self._get_test_512Mb_node_size()) - self.assertEqual(node.name, 'test1') - self.assertTrue(node.id is not None) - self.assertEqual(node.extra['password'], 'bebebe') - - def test_list_nodes(self): - node = self.driver.list_nodes()[0] - - self.assertEqual(node.id, '90967') - self.assertEqual(node.extra['password'], 'bebebe') - self.assertEqual(node.extra['description'], 'test server') - - def test_reboot_node(self): - node = Node(90967, None, None, None, None, self.driver) - ret = self.driver.reboot_node(node) - self.assertTrue(ret) - - def test_reboot_node_not_successful(self): - GoGridMockHttp.type = 'FAIL' - node = Node(90967, None, None, None, None, self.driver) - - try: - self.driver.reboot_node(node) - except Exception: - pass - else: - self.fail('Exception was not thrown') - - def test_destroy_node(self): - node = Node(90967, None, None, None, None, self.driver) - ret = self.driver.destroy_node(node) - self.assertTrue(ret) - - def test_list_images(self): - images = self.driver.list_images() - image = images[0] - self.assertEqual(len(images), 4) - self.assertEqual(image.name, 'CentOS 5.3 (32-bit) w/ None') - self.assertEqual(image.id, '1531') - - location = NodeLocation( - id='gogrid/GSI-939ef909-84b8-4a2f-ad56-02ccd7da05ff.img', - name='test location', country='Slovenia', - driver=self.driver) - images = self.driver.list_images(location=location) - image = images[0] - self.assertEqual(len(images), 4) - self.assertEqual(image.name, 'CentOS 5.3 (32-bit) w/ None') - self.assertEqual(image.id, '1531') - - def test_malformed_reply(self): - GoGridMockHttp.type = 'FAIL' - try: - self.driver.list_images() - except LibcloudError: - e = sys.exc_info()[1] - self.assertTrue(isinstance(e, LibcloudError)) - else: - self.fail("test should have thrown") - - def test_invalid_creds(self): - GoGridMockHttp.type = 'FAIL' - try: - self.driver.list_nodes() - except InvalidCredsError: - e = sys.exc_info()[1] - self.assertTrue(e.driver is not None) - self.assertEqual(e.driver.name, self.driver.name) - else: - self.fail("test should have thrown") - - def test_node_creation_without_free_public_ips(self): - GoGridMockHttp.type = 'NOPUBIPS' - try: - image = NodeImage(1531, None, self.driver) - self.driver.create_node( - name='test1', - image=image, - size=self._get_test_512Mb_node_size()) - except LibcloudError: - e = sys.exc_info()[1] - self.assertTrue(isinstance(e, LibcloudError)) - self.assertTrue(e.driver is not None) - self.assertEqual(e.driver.name, self.driver.name) - else: - self.fail("test should have thrown") - - def test_list_locations(self): - locations = self.driver.list_locations() - location_names = [location.name for location in locations] - - self.assertEqual(len(locations), 2) - for i in 0, 1: - self.assertTrue(isinstance(locations[i], NodeLocation)) - self.assertTrue("US-West-1" in location_names) - self.assertTrue("US-East-1" in location_names) - - def test_ex_save_image(self): - node = self.driver.list_nodes()[0] - image = self.driver.ex_save_image(node, "testimage") - self.assertEqual(image.name, "testimage") - - def test_ex_edit_image(self): - image = self.driver.list_images()[0] - ret = self.driver.ex_edit_image(image=image, public=False, - ex_description="test", name="testname") - - self.assertTrue(isinstance(ret, NodeImage)) - - def test_ex_edit_node(self): - node = Node(id=90967, name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver) - ret = self.driver.ex_edit_node(node=node, - size=self._get_test_512Mb_node_size()) - - self.assertTrue(isinstance(ret, Node)) - - def test_ex_list_ips(self): - ips = self.driver.ex_list_ips() - - expected_ips = {"192.168.75.66": GoGridIpAddress(id="5348099", - ip="192.168.75.66", public=True, state="Unassigned", - subnet="192.168.75.64/255.255.255.240"), - "192.168.75.67": GoGridIpAddress(id="5348100", - ip="192.168.75.67", public=True, state="Assigned", - subnet="192.168.75.64/255.255.255.240"), - "192.168.75.68": GoGridIpAddress(id="5348101", - ip="192.168.75.68", public=False, state="Unassigned", - subnet="192.168.75.64/255.255.255.240")} - - self.assertEqual(len(expected_ips), 3) - - for ip in ips: - self.assertTrue(ip.ip in expected_ips) - self.assertEqual(ip.public, expected_ips[ip.ip].public) - self.assertEqual(ip.state, expected_ips[ip.ip].state) - self.assertEqual(ip.subnet, expected_ips[ip.ip].subnet) - - del expected_ips[ip.ip] - - self.assertEqual(len(expected_ips), 0) - - def test_get_state_invalid(self): - state = self.driver._get_state('invalid') - self.assertEqual(state, NodeState.UNKNOWN) - - -class GoGridMockHttp(MockHttp): - - fixtures = ComputeFileFixtures('gogrid') - - def _api_grid_image_list(self, method, url, body, headers): - body = self.fixtures.load('image_list.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _api_grid_image_list_FAIL(self, method, url, body, headers): - body = "

some non valid json here

" - return (httplib.SERVICE_UNAVAILABLE, body, {}, - httplib.responses[httplib.SERVICE_UNAVAILABLE]) - - def _api_grid_server_list(self, method, url, body, headers): - body = self.fixtures.load('server_list.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - _api_grid_server_list_NOPUBIPS = _api_grid_server_list - - def _api_grid_server_list_FAIL(self, method, url, body, headers): - return (httplib.FORBIDDEN, - "123", {}, httplib.responses[httplib.FORBIDDEN]) - - def _api_grid_ip_list(self, method, url, body, headers): - body = self.fixtures.load('ip_list.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _api_grid_ip_list_NOPUBIPS(self, method, url, body, headers): - body = self.fixtures.load('ip_list_empty.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _api_grid_server_power(self, method, url, body, headers): - body = self.fixtures.load('server_power.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _api_grid_server_power_FAIL(self, method, url, body, headers): - body = self.fixtures.load('server_power_fail.json') - return (httplib.NOT_FOUND, body, {}, httplib.responses[httplib.OK]) - - def _api_grid_server_add(self, method, url, body, headers): - body = self.fixtures.load('server_add.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - _api_grid_server_add_NOPUBIPS = _api_grid_server_add - - def _api_grid_server_delete(self, method, url, body, headers): - body = self.fixtures.load('server_delete.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _api_grid_server_edit(self, method, url, body, headers): - body = self.fixtures.load('server_edit.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _api_support_password_list(self, method, url, body, headers): - body = self.fixtures.load('password_list.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - _api_support_password_list_NOPUBIPS = _api_support_password_list - - def _api_grid_image_save(self, method, url, body, headers): - body = self.fixtures.load('image_save.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _api_grid_image_edit(self, method, url, body, headers): - # edit method is quite similar to save method from the response - # perspective - body = self.fixtures.load('image_save.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _api_common_lookup_list(self, method, url, body, headers): - _valid_lookups = ("ip.datacenter",) - - lookup = parse_qs(urlparse.urlparse(url).query)["lookup"][0] - if lookup in _valid_lookups: - fixture_path = "lookup_list_%s.json" % \ - (lookup.replace(".", "_")) - else: - raise NotImplementedError - body = self.fixtures.load(fixture_path) - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_gridscale.py b/libcloud/test/compute/test_gridscale.py new file mode 100644 index 0000000000..5d4f97e492 --- /dev/null +++ b/libcloud/test/compute/test_gridscale.py @@ -0,0 +1,426 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest +from datetime import datetime + +from libcloud.test import MockHttp, LibcloudTestCase +from libcloud.utils.py3 import httplib +from libcloud.compute.base import NodeSize +from libcloud.test.secrets import GRIDSCALE_PARAMS +from libcloud.utils.iso8601 import UTC +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.gridscale import GridscaleNodeDriver + + +class Gridscale_Tests(LibcloudTestCase): + def setUp(self): + GridscaleNodeDriver.connectionCls.conn_class = GridscaleMockHttp + GridscaleMockHttp.type = None + self.driver = GridscaleNodeDriver(*GRIDSCALE_PARAMS) + + def test_create_node_success(self): + image = self.driver.list_images()[0] + size = NodeSize( + id=0, + name="test", + bandwidth=0, + price=0, + ram=10240, + driver=self.driver, + disk=50, + extra={"cores": 2}, + ) + location = self.driver.list_locations()[0] + sshkey = ["b1682d3a-1869-4bdc-8ffe-e74a261d300c"] + GridscaleMockHttp.type = "POST" + node = self.driver.create_node( + name="test", + size=size, + image=image, + location=location, + ex_ssh_key_ids=sshkey, + ) + + self.assertEqual(node.name, "test.test") + self.assertEqual(node.public_ips, ["185.102.95.236", "2a06:2380:0:1::211"]) + + def test_create_image_success(self): + node = self.driver.list_nodes()[0] + GridscaleMockHttp.type = "POST" + image = self.driver.create_image(node, "test.test") + self.assertTrue(image) + + def test_list_nodes_success(self): + nodes = self.driver.list_nodes() + self.assertEqual(len(nodes), 1) + self.assertEqual(nodes[0].name, "test.test") + self.assertEqual(nodes[0].public_ips, ["185.102.95.236", "2a06:2380:0:1::211"]) + self.assertEqual(nodes[0].extra["cores"], 2) + self.assertEqual(nodes[0].extra["memory"], 10240) + + def test_list_locations_success(self): + locations = self.driver.list_locations() + self.assertTrue(len(locations) >= 1) + + def test_list_volumes(self): + volumes = self.driver.list_volumes() + self.assertEqual(len(volumes), 1) + volume = volumes[0] + self.assertEqual(volume.id, "e66bb753-4a03-4ee2-a069-a601f393c9ee") + self.assertEqual(volume.name, "linux") + self.assertEqual(volume.size, 50) + self.assertEqual(volume.driver, self.driver) + + def test_list_images_success(self): + images = self.driver.list_images() + self.assertTrue(len(images) >= 1) + + image = images[0] + self.assertTrue(image.id is not None) + self.assertTrue(image.name is not None) + + def test_list_key_pairs(self): + keys = self.driver.list_key_pairs() + self.assertEqual(len(keys), 2) + self.assertEqual(keys[0].name, "karl") + self.assertEqual(keys[0].public_key, "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC") + + def test_list_volume_snapshots(self): + volume = self.driver.list_volumes()[0] + snapshots = self.driver.list_volume_snapshots(volume) + + self.assertEqual(len(snapshots), 1) + self.assertEqual(snapshots[0].id, "d755de62-4d75-4d61-addd-a5c9743a5deb") + + def test_list_volumes_empty(self): + GridscaleMockHttp.type = "EMPTY" + volumes = self.driver.list_volumes() + self.assertEqual(len(volumes), 0) + + def test_ex_list_networks(self): + networks = self.driver.ex_list_networks()[0] + self.assertEqual(networks.id, "1196529b-a8de-417f") + + def test_ex_list_ips(self): + ip = self.driver.ex_list_ips()[0] + self.assertEqual(ip.id, "56b8d161-325b-4fd4") + + def test_ex_destroy_ip(self): + ip = self.driver.ex_list_ips()[0] + + GridscaleMockHttp.type = "DELETE" + self.assertTrue(self.driver.ex_destroy_ip(ip)) + + def test_ex_destroy_network(self): + network = self.driver.ex_list_networks()[0] + + GridscaleMockHttp.type = "DELETE" + self.assertTrue(self.driver.ex_destroy_network(network)) + + def test_destroy_node_success(self): + # Regular destroy + node = self.driver.list_nodes()[0] + GridscaleMockHttp.type = "DELETE" + + res = self.driver.destroy_node(node) + self.assertTrue(res) + + # Destroy associated resources + res = self.driver.destroy_node(node, ex_destroy_associated_resources=True) + self.assertTrue(res) + + def test_destroy_volume(self): + volume = self.driver.list_volumes()[0] + GridscaleMockHttp.type = "DELETE" + res = self.driver.destroy_volume(volume) + self.assertTrue(res) + + def test_destroy_volume_snapshot(self): + volume = self.driver.list_volumes()[0] + snapshot = self.driver.list_volume_snapshots(volume)[0] + GridscaleMockHttp.type = "DELETE" + res = self.driver.destroy_volume_snapshot(snapshot) + self.assertTrue(res) + + def test_get_image_success(self): + image = self.driver.get_image("12345") + self.assertEqual(image.id, "12345") + + def test_list_nodes_fills_created_datetime(self): + nodes = self.driver.list_nodes() + self.assertEqual(nodes[0].created_at, datetime(2019, 6, 7, 12, 56, 44, tzinfo=UTC)) + + def test_ex_list_volumes_for_node(self): + node = self.driver.list_nodes()[0] + volumes = self.driver.ex_list_volumes_for_node(node=node) + self.assertEqual(len(volumes), 1) + self.assertEqual(volumes[0].size, 50) + + def test_ex_list_ips_for_node(self): + node = self.driver.list_nodes()[0] + ips = self.driver.ex_list_ips_for_node(node=node) + self.assertEqual(len(ips), 1) + self.assertEqual(ips[0].ip_address, "185.102.95.236") + + def test_ex_rename_node(self): + node = self.driver.list_nodes()[0] + self.assertTrue(self.driver.ex_rename_node(node, name="new-name")) + + def test_ex_rename_volume(self): + volume = self.driver.list_volumes()[0] + self.assertTrue(self.driver.ex_rename_volume(volume, name="new-name")) + + def test_ex_network(self): + network = self.driver.ex_list_networks()[0] + self.assertTrue(self.driver.ex_rename_network(network, name="new-name")) + + +class GridscaleMockHttp(MockHttp): + fixtures = ComputeFileFixtures("gridscale") + + def _objects_servers(self, method, url, body, headers): + body = self.fixtures.load("list_nodes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_locations(self, method, url, body, headers): + body = self.fixtures.load("list_locations.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_storages(self, method, url, body, headers): + body = self.fixtures.load("list_volumes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_storages_DELETE(self, method, url, body, headers): + # test_destroy_node_success + body = self.fixtures.load("list_volumes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_ips_DELETE(self, method, url, body, headers): + # test_destroy_node_success + body = self.fixtures.load("ex_list_ips.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_ips_56b8d161_325b_4fd4_DELETE(self, method, url, body, headers): + # test_destroy_node_success + return (httplib.NO_CONTENT, None, {}, httplib.responses[httplib.NO_CONTENT]) + + def _objects_storages_EMPTY(self, method, url, body, headers): + body = self.fixtures.load("list_volumes_empty.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_templates(self, method, url, body, headers): + body = self.fixtures.load("list_images.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_sshkeys(self, method, url, body, headers): + body = self.fixtures.load("list_key_pairs.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_storages_e66bb753_4a03_4ee2_a069_a601f393c9ee_snapshots( + self, method, url, body, headers + ): + body = self.fixtures.load("list_volume_snapshots.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_servers_1479405e_d46c_47a2_91e8_eb43951c899f(self, method, url, body, headers): + # test_ex_rename_node + if method == "PATCH": + return (httplib.NO_CONTENT, None, {}, httplib.responses[httplib.NO_CONTENT]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_storages_e66bb753_4a03_4ee2_a069_a601f393c9ee(self, method, url, body, headers): + # test_ex_rename_node + if method == "PATCH": + return (httplib.NO_CONTENT, None, {}, httplib.responses[httplib.NO_CONTENT]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_networks_1196529b_a8de_417f(self, method, url, body, headers): + # test_ex_rename_network + if method == "PATCH": + return (httplib.NO_CONTENT, None, {}, httplib.responses[httplib.NO_CONTENT]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_servers_POST(self, method, url, body, headers): + # create_node + if method == "POST": + body = self.fixtures.load("create_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _requests_x123xx1x_123x_1x12_123x_123xxx123x1x_POST(self, method, url, body, headers): + body = self.fixtures.load("create_node_response_dict.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_servers_690de890_13c0_4e76_8a01_e10ba8786e53_POST( + self, method, url, body, headers + ): + body = self.fixtures.load("create_node_dict.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + # create_volume + def _objects_storages_POST(self, method, url, body, headers): + body = self.fixtures.load("create_volume.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_storages_690de890_13c0_4e76_8a01_e10ba8786e53_POST( + self, method, url, body, headers + ): + body = self.fixtures.load("create_volume_response_dict.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_ips_POST(self, method, url, body, headers): + # ex_create_ip + if method == "POST": + body = self.fixtures.load("create_ip.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_ips_690de890_13c0_4e76_8a01_e10ba8786e53_POST(self, method, url, body, headers): + body = self.fixtures.load("create_ip_response_dict.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_servers_1479405e_d46c_47a2_91e8_eb43951c899f_storages_POST( + self, method, url, body, headers + ): + body = self.fixtures.load("volume_to_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_servers_1479405e_d46c_47a2_91e8_eb43951c899f_ips_POST( + self, method, url, body, headers + ): + body = self.fixtures.load("ips_to_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_networks_POST(self, method, url, body, headers): + body = self.fixtures.load("create_network.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_networks_1196529b_a8de_417f_DELETE(self, method, url, body, headers): + # test_ex_destroy_network + if method == "DELETE": + return (httplib.NO_CONTENT, None, {}, httplib.responses[httplib.NO_CONTENT]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_servers_1479405e_d46c_47a2_91e8_eb43951c899f_networks_POST( + self, method, url, body, headers + ): + body = self.fixtures.load("network_to_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_servers_1479405e_d46c_47a2_91e8_eb43951c899f_power_POST( + self, method, url, body, headers + ): + if method == "PATCH": + body = self.fixtures.load("ex_start_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_servers_1479405e_d46c_47a2_91e8_eb43951c899f_POST( + self, method, url, body, headers + ): + body = self.fixtures.load("create_node_dict.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_networks(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("ex_list_networks.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_ips(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("ex_list_ips.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_servers_1479405e_d46c_47a2_91e8_eb43951c899f_DELETE( + self, method, url, body, headers + ): + if method == "DELETE": + return (httplib.NO_CONTENT, None, {}, httplib.responses[httplib.NO_CONTENT]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_storages_e66bb753_4a03_4ee2_a069_a601f393c9ee_DELETE( + self, method, url, body, headers + ): + if method == "DELETE": + return (httplib.NO_CONTENT, None, {}, httplib.responses[httplib.NO_CONTENT]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_storages_e66bb753_4a03_4ee2_a069_a601f393c9ee_snapshots_d755de62_4d75_4d61_addd_a5c9743a5deb_DELETE( + self, method, url, body, headers + ): + if method == "DELETE": + return (httplib.NO_CONTENT, None, {}, httplib.responses[httplib.NO_CONTENT]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_templates_POST(self, method, url, body, headers): + # create_image + if method == "POST": + body = self.fixtures.load("create_image.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_storages_e66bb753_4a03_4ee2_a069_a601f393c9ee_snapshots_POST( + self, method, url, body, headers + ): + # create_image + if method == "POST": + body = self.fixtures.load("create_image.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_storages_e66bb753_4a03_4ee2_a069_a601f393c9ee_snapshots_690de890_13c0_4e76_8a01_e10ba8786e53_POST( + self, method, url, body, headers + ): + # create_image + body = self.fixtures.load("create_image_dict.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _objects_templates_690de890_13c0_4e76_8a01_e10ba8786e53_POST( + self, method, url, body, headers + ): + # create_image + if method == "GET": + body = self.fixtures.load("create_image_dict.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: # pragma: no cover + raise ValueError("Invalid method") + + def _objects_templates_12345(self, method, url, body, headers): + # get_image + if method == "GET": + body = self.fixtures.load("get_image.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: # pragma: no cover + raise ValueError("Invalid method") + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_gridspot.py b/libcloud/test/compute/test_gridspot.py deleted file mode 100644 index 4e4de1b348..0000000000 --- a/libcloud/test/compute/test_gridspot.py +++ /dev/null @@ -1,229 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import sys -import unittest -from libcloud.utils.py3 import httplib - -try: - import simplejson as json -except ImportError: - import json - -from libcloud.common.types import InvalidCredsError -from libcloud.compute.drivers.gridspot import GridspotNodeDriver -from libcloud.compute.types import NodeState - -from libcloud.test import MockHttp -from libcloud.test.compute import TestCaseMixin -from libcloud.test.secrets import GRIDSPOT_PARAMS - - -class GridspotTest(unittest.TestCase, TestCaseMixin): - - def setUp(self): - GridspotNodeDriver.connectionCls.conn_classes = ( - None, - GridspotMockHttp - ) - GridspotMockHttp.type = None - self.driver = GridspotNodeDriver(*GRIDSPOT_PARAMS) - - def test_invalid_creds(self): - """ - Tests the error-handling for passing a bad API Key to the Gridspot API - """ - GridspotMockHttp.type = 'BAD_AUTH' - self.assertRaises(InvalidCredsError, self.driver.list_nodes) - - def test_list_nodes(self): - nodes = self.driver.list_nodes() - self.assertEqual(len(nodes), 2) - - running_node = nodes[0] - starting_node = nodes[1] - - self.assertEqual(running_node.id, 'inst_CP2WrQi2WIS4iheyAVkQYw') - self.assertEqual(running_node.state, NodeState.RUNNING) - self.assertTrue('69.4.239.74' in running_node.public_ips) - self.assertEqual(running_node.extra['port'], 62394) - self.assertEqual(running_node.extra['vm_ram'], 1429436743) - self.assertEqual(running_node.extra['start_state_time'], 1342108905) - self.assertEqual(running_node.extra['vm_num_logical_cores'], 8) - self.assertEqual(running_node.extra['vm_num_physical_cores'], 4) - self.assertEqual(running_node.extra['winning_bid_id'], - 'bid_X5xhotGYiGUk7_RmIqVafA') - self.assertFalse('ended_state_time' in running_node.extra) - self.assertEqual(running_node.extra['running_state_time'], 1342108989) - - self.assertEqual(starting_node.id, 'inst_CP2WrQi2WIS4iheyAVkQYw2') - self.assertEqual(starting_node.state, NodeState.PENDING) - self.assertTrue('69.4.239.74' in starting_node.public_ips) - self.assertEqual(starting_node.extra['port'], 62395) - self.assertEqual(starting_node.extra['vm_ram'], 1429436744) - self.assertEqual(starting_node.extra['start_state_time'], 1342108906) - self.assertEqual(starting_node.extra['vm_num_logical_cores'], 7) - self.assertEqual(starting_node.extra['vm_num_physical_cores'], 5) - self.assertEqual(starting_node.extra['winning_bid_id'], - 'bid_X5xhotGYiGUk7_RmIqVafA1') - self.assertFalse('ended_state_time' in starting_node.extra) - self.assertEqual(starting_node.extra['running_state_time'], 1342108990) - - def test_create_node(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_destroy_node(self): - """ - Test destroy_node for Gridspot driver - """ - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver.destroy_node(node)) - - def test_destroy_node_failure(self): - """ - Gridspot does not fail a destroy node unless the parameters are bad, in - which case it 404s - """ - pass - - def test_reboot_node(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_reboot_node_failure(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_resize_node(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_reboot_node_response(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_list_images_response(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_create_node_response(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_destroy_node_response(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_list_sizes_response(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_resize_node_failure(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_list_images(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_list_sizes(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_list_locations(self): - """ - Gridspot does not implement this functionality - """ - pass - - def test_list_locations_response(self): - """ - Gridspot does not implement this functionality - """ - pass - - -class GridspotMockHttp(MockHttp): - - def _compute_api_v1_list_instances_BAD_AUTH(self, method, url, body, - headers): - return (httplib.NOT_FOUND, "", {}, - httplib.responses[httplib.NOT_FOUND]) - - def _compute_api_v1_list_instances(self, method, url, body, headers): - body = json.dumps({ - "instances": [ - { - "instance_id": "inst_CP2WrQi2WIS4iheyAVkQYw", - "vm_num_logical_cores": 8, - "vm_num_physical_cores": 4, - "winning_bid_id": "bid_X5xhotGYiGUk7_RmIqVafA", - "vm_ram": 1429436743, - "start_state_time": 1342108905, - "vm_ssh_wan_ip_endpoint": "69.4.239.74:62394", - "current_state": "Running", - "ended_state_time": "null", - "running_state_time": 1342108989 - }, - { - "instance_id": "inst_CP2WrQi2WIS4iheyAVkQYw2", - "vm_num_logical_cores": 7, - "vm_num_physical_cores": 5, - "winning_bid_id": "bid_X5xhotGYiGUk7_RmIqVafA1", - "vm_ram": 1429436744, - "start_state_time": 1342108906, - "vm_ssh_wan_ip_endpoint": "69.4.239.74:62395", - "current_state": "Starting", - "ended_state_time": "null", - "running_state_time": 1342108990 - } - ], - "exception_name": "" - }) - - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _compute_api_v1_stop_instance(self, method, url, body, headers): - body = json.dumps({"exception_name": ""}) - - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_hostvirtual.py b/libcloud/test/compute/test_hostvirtual.py deleted file mode 100644 index 42cedc9490..0000000000 --- a/libcloud/test/compute/test_hostvirtual.py +++ /dev/null @@ -1,218 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import sys -import unittest - -from libcloud.utils.py3 import httplib - -from libcloud.compute.drivers.hostvirtual import HostVirtualNodeDriver -from libcloud.compute.types import NodeState -from libcloud.compute.base import NodeAuthPassword -from libcloud.test import MockHttp -from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.test.secrets import HOSTVIRTUAL_PARAMS - - -class HostVirtualTest(unittest.TestCase): - - def setUp(self): - HostVirtualNodeDriver.connectionCls.conn_classes = ( - None, HostVirtualMockHttp) - self.driver = HostVirtualNodeDriver(*HOSTVIRTUAL_PARAMS) - - def test_list_nodes(self): - nodes = self.driver.list_nodes() - self.assertEqual(len(nodes), 4) - self.assertEqual(len(nodes[0].public_ips), 1) - self.assertEqual(len(nodes[1].public_ips), 1) - self.assertEqual(len(nodes[0].private_ips), 0) - self.assertEqual(len(nodes[1].private_ips), 0) - self.assertTrue('208.111.39.118' in nodes[1].public_ips) - self.assertTrue('208.111.45.250' in nodes[0].public_ips) - self.assertEqual(nodes[3].state, NodeState.RUNNING) - self.assertEqual(nodes[1].state, NodeState.TERMINATED) - - def test_list_sizes(self): - sizes = self.driver.list_sizes() - self.assertEqual(len(sizes), 14) - self.assertEqual(sizes[0].id, '31') - self.assertEqual(sizes[4].id, '71') - self.assertEqual(sizes[2].ram, '512MB') - self.assertEqual(sizes[2].disk, '20GB') - self.assertEqual(sizes[3].bandwidth, '600GB') - self.assertEqual(sizes[1].price, '15.00') - - def test_list_images(self): - images = self.driver.list_images() - self.assertEqual(len(images), 8) - self.assertEqual(images[0].id, '1739') - self.assertEqual(images[0].name, 'Gentoo 2012 (0619) i386') - - def test_list_locations(self): - locations = self.driver.list_locations() - self.assertEqual(locations[0].id, '3') - self.assertEqual(locations[0].name, 'SJC - San Jose, CA') - self.assertEqual(locations[1].id, '13') - self.assertEqual(locations[1].name, 'IAD2- Reston, VA') - - def test_reboot_node(self): - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver.reboot_node(node)) - - def test_ex_get_node(self): - node = self.driver.ex_get_node(node_id='62291') - self.assertEqual(node.id, '62291') - self.assertEqual(node.name, 'server1.vr-cluster.org') - self.assertEqual(node.state, NodeState.TERMINATED) - self.assertTrue('208.111.45.250' in node.public_ips) - - def test_ex_list_packages(self): - pkgs = self.driver.ex_list_packages() - self.assertEqual(len(pkgs), 3) - self.assertEqual(pkgs[1]['mbpkgid'], '176018') - self.assertEqual(pkgs[2]['package_status'], 'Suspended') - - def test_ex_order_package(self): - sizes = self.driver.list_sizes() - pkg = self.driver.ex_order_package(sizes[0]) - self.assertEqual(pkg['id'], '62291') - - def test_ex_cancel_package(self): - node = self.driver.list_nodes()[0] - result = self.driver.ex_cancel_package(node) - self.assertEqual(result['status'], 'success') - - def test_ex_unlink_package(self): - node = self.driver.list_nodes()[0] - result = self.driver.ex_unlink_package(node) - self.assertEqual(result['status'], 'success') - - def test_ex_stop_node(self): - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver.ex_stop_node(node)) - - def test_ex_start_node(self): - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver.ex_start_node(node)) - - def test_destroy_node(self): - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver.destroy_node(node)) - - def test_ex_delete_node(self): - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver.ex_delete_node(node)) - - def test_create_node(self): - auth = NodeAuthPassword('vr!@#hosted#@!') - size = self.driver.list_sizes()[0] - image = self.driver.list_images()[0] - node = self.driver.create_node( - name='test.com', - image=image, - size=size, - auth=auth - ) - self.assertEqual('62291', node.id) - self.assertEqual('server1.vr-cluster.org', node.name) - - def test_ex_provision_node(self): - node = self.driver.list_nodes()[0] - auth = NodeAuthPassword('vr!@#hosted#@!') - self.assertTrue(self.driver.ex_provision_node( - node=node, - auth=auth - )) - - def test_create_node_in_location(self): - auth = NodeAuthPassword('vr!@#hosted#@!') - size = self.driver.list_sizes()[0] - image = self.driver.list_images()[0] - location = self.driver.list_locations()[1] - node = self.driver.create_node( - name='test.com', - image=image, - size=size, - auth=auth, - location=location - ) - self.assertEqual('62291', node.id) - self.assertEqual('server1.vr-cluster.org', node.name) - - -class HostVirtualMockHttp(MockHttp): - fixtures = ComputeFileFixtures('hostvirtual') - - def _cloud_servers(self, method, url, body, headers): - body = self.fixtures.load('list_nodes.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_server(self, method, url, body, headers): - body = self.fixtures.load('get_node.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_packages(self, method, url, body, headers): - body = self.fixtures.load('list_packages.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_sizes(self, method, url, body, headers): - body = self.fixtures.load('list_sizes.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_images(self, method, url, body, headers): - body = self.fixtures.load('list_images.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_locations(self, method, url, body, headers): - body = self.fixtures.load('list_locations.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_server_delete(self, method, url, body, headers): - body = self.fixtures.load('cancel_package.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_server_reboot(self, method, url, body, headers): - body = self.fixtures.load('node_reboot.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_server_shutdown(self, method, url, body, headers): - body = self.fixtures.load('node_stop.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_server_start(self, method, url, body, headers): - body = self.fixtures.load('node_start.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_server_build(self, method, url, body, headers): - body = self.fixtures.load('order_package.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_buy(self, method, url, body, headers): - body = self.fixtures.load('order_package.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_cancel(self, method, url, body, headers): - body = self.fixtures.load('cancel_package.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _cloud_unlink(self, method, url, body, headers): - body = self.fixtures.load('unlink_package.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - -if __name__ == '__main__': - sys.exit(unittest.main()) - -# vim:autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=python diff --git a/libcloud/test/compute/test_ibm_sce.py b/libcloud/test/compute/test_ibm_sce.py deleted file mode 100644 index 55071a43e8..0000000000 --- a/libcloud/test/compute/test_ibm_sce.py +++ /dev/null @@ -1,325 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -import unittest -from libcloud.utils.py3 import httplib -import sys - -from libcloud.compute.types import InvalidCredsError -from libcloud.compute.drivers.ibm_sce import IBMNodeDriver as IBM -from libcloud.compute.base import Node, NodeImage, NodeSize, NodeLocation - -from libcloud.test import MockHttp -from libcloud.test.compute import TestCaseMixin -from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.test.secrets import IBM_PARAMS - - -class IBMTests(unittest.TestCase, TestCaseMixin): - - """ - Tests the IBM SmartCloud Enterprise driver. - """ - - def setUp(self): - IBM.connectionCls.conn_classes = (None, IBMMockHttp) - IBMMockHttp.type = None - self.driver = IBM(*IBM_PARAMS) - - def test_auth(self): - IBMMockHttp.type = 'UNAUTHORIZED' - - try: - self.driver.list_nodes() - except InvalidCredsError: - e = sys.exc_info()[1] - self.assertTrue(isinstance(e, InvalidCredsError)) - self.assertEqual(e.value, '401: Unauthorized') - else: - self.fail('test should have thrown') - - def test_list_nodes(self): - ret = self.driver.list_nodes() - self.assertEqual(len(ret), 3) - self.assertEqual(ret[0].id, '26557') - self.assertEqual(ret[0].name, 'Insight Instance') - self.assertEqual(ret[0].public_ips, ['129.33.196.128']) - self.assertEqual(ret[0].private_ips, []) # Private IPs not supported - self.assertEqual(ret[1].public_ips, []) # Node is non-active (no IP) - self.assertEqual(ret[1].private_ips, []) - self.assertEqual(ret[1].id, '28193') - - def test_list_sizes(self): - ret = self.driver.list_sizes() - self.assertEqual(len(ret), 9) # 9 instance configurations supported - self.assertEqual(ret[0].id, 'BRZ32.1/2048/60*175') - self.assertEqual(ret[1].id, 'BRZ64.2/4096/60*500*350') - self.assertEqual(ret[2].id, 'COP32.1/2048/60') - self.assertEqual(ret[0].name, 'Bronze 32 bit') - self.assertEqual(ret[0].disk, None) - - def test_list_images(self): - ret = self.driver.list_images() - self.assertEqual(len(ret), 21) - self.assertEqual(ret[10].name, "Rational Asset Manager 7.2.0.1") - self.assertEqual(ret[9].id, '10002573') - - def test_list_locations(self): - ret = self.driver.list_locations() - self.assertEqual(len(ret), 6) - self.assertEqual(ret[0].id, '41') - self.assertEqual(ret[0].name, 'Raleigh') - self.assertEqual(ret[0].country, 'U.S.A') - - def test_create_node(self): - # Test creation of node - IBMMockHttp.type = 'CREATE' - image = NodeImage(id=11, name='Rational Insight', driver=self.driver) - size = NodeSize('LARGE', 'LARGE', None, None, None, None, self.driver) - location = NodeLocation('1', 'POK', 'US', driver=self.driver) - ret = self.driver.create_node(name='RationalInsight4', - image=image, - size=size, - location=location, - publicKey='MyPublicKey', - configurationData={ - 'insight_admin_password': 'myPassword1', - 'db2_admin_password': 'myPassword2', - 'report_user_password': 'myPassword3'}) - self.assertTrue(isinstance(ret, Node)) - self.assertEqual(ret.name, 'RationalInsight4') - - # Test creation attempt with invalid location - IBMMockHttp.type = 'CREATE_INVALID' - location = NodeLocation('3', 'DOESNOTEXIST', 'US', driver=self.driver) - try: - ret = self.driver.create_node(name='RationalInsight5', - image=image, - size=size, - location=location, - publicKey='MyPublicKey', - configurationData={ - 'insight_admin_password': 'myPassword1', - 'db2_admin_password': 'myPassword2', - 'report_user_password': 'myPassword3'}) - except Exception: - e = sys.exc_info()[1] - self.assertEqual(e.args[0], 'Error 412: No DataCenter with id: 3') - else: - self.fail('test should have thrown') - - def test_destroy_node(self): - # Delete existent node - nodes = self.driver.list_nodes() # retrieves 3 nodes - self.assertEqual(len(nodes), 3) - IBMMockHttp.type = 'DELETE' - toDelete = nodes[1] - ret = self.driver.destroy_node(toDelete) - self.assertTrue(ret) - - # Delete non-existent node - IBMMockHttp.type = 'DELETED' - nodes = self.driver.list_nodes() # retrieves 2 nodes - self.assertEqual(len(nodes), 2) - try: - self.driver.destroy_node(toDelete) # delete non-existent node - except Exception: - e = sys.exc_info()[1] - self.assertEqual(e.args[0], 'Error 404: Invalid Instance ID 28193') - else: - self.fail('test should have thrown') - - def test_reboot_node(self): - nodes = self.driver.list_nodes() - IBMMockHttp.type = 'REBOOT' - - # Reboot active node - self.assertEqual(len(nodes), 3) - ret = self.driver.reboot_node(nodes[0]) - self.assertTrue(ret) - - # Reboot inactive node - try: - ret = self.driver.reboot_node(nodes[1]) - except Exception: - e = sys.exc_info()[1] - self.assertEqual( - e.args[0], 'Error 412: Instance must be in the Active state') - else: - self.fail('test should have thrown') - - def test_list_volumes(self): - ret = self.driver.list_volumes() - self.assertEqual(len(ret), 1) - self.assertEqual(ret[0].name, 'libcloudvol') - self.assertEqual(ret[0].extra['location'], '141') - self.assertEqual(ret[0].size, '2048') - self.assertEqual(ret[0].id, '39281') - - def test_attach_volume(self): - vols = self.driver.list_volumes() - nodes = self.driver.list_nodes() - IBMMockHttp.type = 'ATTACH' - ret = self.driver.attach_volume(nodes[0], vols[0]) - self.assertTrue(ret) - - def test_create_volume(self): - IBMMockHttp.type = 'CREATE' - ret = self.driver.create_volume('256', - 'test-volume', - location='141', - format='RAW', - offering_id='20001208') - self.assertEqual(ret.id, '39293') - self.assertEqual(ret.size, '256') - self.assertEqual(ret.name, 'test-volume') - self.assertEqual(ret.extra['location'], '141') - - def test_destroy_volume(self): - vols = self.driver.list_volumes() - IBMMockHttp.type = 'DESTROY' - ret = self.driver.destroy_volume(vols[0]) - self.assertTrue(ret) - - def test_ex_destroy_image(self): - image = self.driver.list_images() - IBMMockHttp.type = 'DESTROY' - ret = self.driver.ex_destroy_image(image[0]) - self.assertTrue(ret) - - def test_detach_volume(self): - nodes = self.driver.list_nodes() - vols = self.driver.list_volumes() - IBMMockHttp.type = 'DETACH' - ret = self.driver.detach_volume(nodes[0], vols[0]) - self.assertTrue(ret) - - def test_ex_allocate_address(self): - IBMMockHttp.type = 'ALLOCATE' - ret = self.driver.ex_allocate_address('141', '20001223') - self.assertEqual(ret.id, '292795') - self.assertEqual(ret.state, '0') - self.assertEqual(ret.options['location'], '141') - - def test_ex_delete_address(self): - IBMMockHttp.type = 'DELETE' - ret = self.driver.ex_delete_address('292795') - self.assertTrue(ret) - - def test_ex_list_addresses(self): - ret = self.driver.ex_list_addresses() - self.assertEqual(ret[0].ip, '170.225.160.218') - self.assertEqual(ret[0].options['location'], '141') - self.assertEqual(ret[0].id, '292795') - self.assertEqual(ret[0].state, '2') - - def test_ex_list_storage_offerings(self): - ret = self.driver.ex_list_storage_offerings() - self.assertEqual(ret[0].name, 'Small') - self.assertEqual(ret[0].location, '61') - self.assertEqual(ret[0].id, '20001208') - - -class IBMMockHttp(MockHttp): - fixtures = ComputeFileFixtures('ibm_sce') - - def _computecloud_enterprise_api_rest_20100331_instances(self, method, url, body, headers): - body = self.fixtures.load('instances.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_instances_DELETED(self, method, url, body, headers): - body = self.fixtures.load('instances_deleted.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_instances_UNAUTHORIZED(self, method, url, body, headers): - return (httplib.UNAUTHORIZED, body, {}, httplib.responses[httplib.UNAUTHORIZED]) - - def _computecloud_enterprise_api_rest_20100331_offerings_image(self, method, url, body, headers): - body = self.fixtures.load('images.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_locations(self, method, url, body, headers): - body = self.fixtures.load('locations.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_instances_26557_REBOOT(self, method, url, body, headers): - body = self.fixtures.load('reboot_active.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_instances_28193_REBOOT(self, method, url, body, headers): - return (412, 'Error 412: Instance must be in the Active state', {}, 'Precondition Failed') - - def _computecloud_enterprise_api_rest_20100331_instances_28193_DELETE(self, method, url, body, headers): - body = self.fixtures.load('delete.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_instances_28193_DELETED(self, method, url, body, headers): - return (404, 'Error 404: Invalid Instance ID 28193', {}, 'Precondition Failed') - - def _computecloud_enterprise_api_rest_20100331_instances_CREATE(self, method, url, body, headers): - body = self.fixtures.load('create.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_instances_CREATE_INVALID(self, method, url, body, headers): - return (412, 'Error 412: No DataCenter with id: 3', {}, 'Precondition Failed') - - def _computecloud_enterprise_api_rest_20100331_storage(self, method, url, body, headers): - body = self.fixtures.load('list_volumes.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_instances_26557_ATTACH(self, method, url, body, headers): - body = self.fixtures.load('attach_volume.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_storage_CREATE(self, method, url, body, headers): - body = self.fixtures.load('create_volume.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_storage_39281_DESTROY(self, method, url, body, headers): - body = self.fixtures.load('destroy_volume.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_offerings_image_2_DESTROY(self, method, url, body, headers): - body = self.fixtures.load('destroy_image.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_instances_26557_DETACH(self, method, url, body, headers): - body = self.fixtures.load('detach_volume.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_addresses_ALLOCATE(self, method, url, body, headers): - body = self.fixtures.load('allocate_address.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_addresses_292795_DELETE(self, method, url, body, headers): - body = self.fixtures.load('delete_address.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_addresses(self, method, url, body, headers): - body = self.fixtures.load('list_addresses.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _computecloud_enterprise_api_rest_20100331_offerings_storage(self, method, url, body, headers): - body = self.fixtures.load('list_storage_offerings.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - # This is only to accommodate the response tests built into test\__init__.py - def _computecloud_enterprise_api_rest_20100331_instances_26557(self, method, url, body, headers): - if method == 'DELETE': - body = self.fixtures.load('delete.xml') - else: - body = self.fixtures.load('reboot_active.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_ikoula.py b/libcloud/test/compute/test_ikoula.py index 45dda25f4b..3acc9e73a3 100644 --- a/libcloud/test/compute/test_ikoula.py +++ b/libcloud/test/compute/test_ikoula.py @@ -15,14 +15,14 @@ import sys +from libcloud.test import unittest from libcloud.compute.drivers.ikoula import IkoulaNodeDriver from libcloud.test.compute.test_cloudstack import CloudStackCommonTestCase -from libcloud.test import unittest - class IkoulaNodeDriverTestCase(CloudStackCommonTestCase, unittest.TestCase): driver_klass = IkoulaNodeDriver -if __name__ == '__main__': + +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_internetsolutions.py b/libcloud/test/compute/test_internetsolutions.py new file mode 100644 index 0000000000..e86a6293c8 --- /dev/null +++ b/libcloud/test/compute/test_internetsolutions.py @@ -0,0 +1,30 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import unittest + +from libcloud.compute.drivers.internetsolutions import InternetSolutionsNodeDriver +from libcloud.test.compute.test_dimensiondata_v2_3 import ( + DimensionDataMockHttp, + DimensionData_v2_3_Tests, +) + + +class InternetSolutionsNodeDriverTests(DimensionData_v2_3_Tests, unittest.TestCase): + def setUp(self): + InternetSolutionsNodeDriver.connectionCls.conn_class = DimensionDataMockHttp + InternetSolutionsNodeDriver.connectionCls.active_api_version = "2.3" + DimensionDataMockHttp.type = None + self.driver = InternetSolutionsNodeDriver("user", "password") diff --git a/libcloud/test/compute/test_joyent.py b/libcloud/test/compute/test_joyent.py deleted file mode 100644 index 90718fc6a8..0000000000 --- a/libcloud/test/compute/test_joyent.py +++ /dev/null @@ -1,138 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import sys - -from libcloud.utils.py3 import httplib -from libcloud.common.types import LibcloudError -from libcloud.compute.base import NodeState -from libcloud.compute.drivers.joyent import JoyentNodeDriver - -from libcloud.test import MockHttp, unittest -from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.test.secrets import JOYENT_PARAMS - - -class JoyentTestCase(unittest.TestCase): - - def setUp(self): - JoyentNodeDriver.connectionCls.conn_classes = (None, JoyentHttp) - self.driver = JoyentNodeDriver(*JOYENT_PARAMS) - - def test_instantiate_multiple_drivers_with_different_region(self): - kwargs1 = {'region': 'us-east-1'} - kwargs2 = {'region': 'us-west-1'} - driver1 = JoyentNodeDriver(*JOYENT_PARAMS, **kwargs1) - driver2 = JoyentNodeDriver(*JOYENT_PARAMS, **kwargs2) - - self.assertTrue(driver1.connection.host.startswith(kwargs1['region'])) - self.assertTrue(driver2.connection.host.startswith(kwargs2['region'])) - - driver1.list_nodes() - driver2.list_nodes() - driver1.list_nodes() - - self.assertTrue(driver1.connection.host.startswith(kwargs1['region'])) - self.assertTrue(driver2.connection.host.startswith(kwargs2['region'])) - - def test_location_backward_compatibility(self): - kwargs = {'location': 'us-west-1'} - driver = JoyentNodeDriver(*JOYENT_PARAMS, **kwargs) - self.assertTrue(driver.connection.host.startswith(kwargs['location'])) - - def test_instantiate_invalid_region(self): - expected_msg = 'Invalid region.+' - - self.assertRaisesRegexp(LibcloudError, expected_msg, JoyentNodeDriver, - 'user', 'key', location='invalid') - self.assertRaisesRegexp(LibcloudError, expected_msg, JoyentNodeDriver, - 'user', 'key', region='invalid') - - def test_list_sizes(self): - sizes = self.driver.list_sizes() - - self.assertEqual(sizes[0].ram, 16384) - - def test_list_images(self): - images = self.driver.list_images() - - self.assertEqual(images[0].name, 'nodejs') - - def test_list_nodes_with_and_without_credentials(self): - nodes = self.driver.list_nodes() - self.assertEqual(len(nodes), 2) - - node = nodes[0] - self.assertEqual(node.public_ips[0], '165.225.129.129') - self.assertEqual(node.private_ips[0], '10.112.1.130') - self.assertEqual(node.state, NodeState.RUNNING) - - node = nodes[1] - self.assertEqual(node.public_ips[0], '165.225.129.128') - self.assertEqual(node.private_ips[0], '10.112.1.131') - self.assertEqual(node.state, NodeState.RUNNING) - self.assertEqual(node.extra['password'], 'abc') - - def test_create_node(self): - image = self.driver.list_images()[0] - size = self.driver.list_sizes()[0] - node = self.driver.create_node(image=image, size=size, name='testlc') - - self.assertEqual(node.name, 'testlc') - - def test_ex_stop_node(self): - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver.ex_stop_node(node)) - - def test_ex_start_node(self): - node = self.driver.list_nodes()[0] - self.assertTrue(self.driver.ex_start_node(node)) - - def test_ex_get_node(self): - node_id = '2fb67f5f-53f2-40ab-9d99-b9ff68cfb2ab' - node = self.driver.ex_get_node(node_id) - self.assertEqual(node.name, 'testlc') - - missing_node = 'dummy-node' - self.assertRaises(Exception, self.driver.ex_get_node, - missing_node, 'all') - - -class JoyentHttp(MockHttp): - fixtures = ComputeFileFixtures('joyent') - - def _my_packages(self, method, url, body, headers): - body = self.fixtures.load('my_packages.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _my_datasets(self, method, url, body, headers): - body = self.fixtures.load('my_datasets.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _my_machines(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('my_machines.json') - elif method == 'POST': - body = self.fixtures.load('my_machines_create.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _my_machines_2fb67f5f_53f2_40ab_9d99_b9ff68cfb2ab(self, method, url, - body, headers): - body = self.fixtures.load('my_machines_create.json') - return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_kamatera.py b/libcloud/test/compute/test_kamatera.py new file mode 100644 index 0000000000..ee16fb3cf3 --- /dev/null +++ b/libcloud/test/compute/test_kamatera.py @@ -0,0 +1,262 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import sys +import json + +from libcloud.test import MockHttp, LibcloudTestCase, unittest +from libcloud.compute import providers +from libcloud.utils.py3 import httplib +from libcloud.compute.base import NodeImage, NodeLocation, NodeAuthSSHKey +from libcloud.test.secrets import KAMATERA_PARAMS +from libcloud.compute.types import Provider, NodeState +from libcloud.common.exceptions import BaseHTTPError +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.kamatera import KamateraNodeDriver + + +class KamateraAuthenticationTests(LibcloudTestCase): + def setUp(self): + KamateraNodeDriver.connectionCls.conn_class = KamateraMockHttp + self.driver = KamateraNodeDriver("nosuchuser", "nopwd") + + def test_authentication_fails(self): + with self.assertRaises(BaseHTTPError): + self.driver.list_locations() + + +class KamateraNodeDriverTests(LibcloudTestCase): + def setUp(self): + KamateraTestDriver.connectionCls.conn_class = KamateraMockHttp + self.driver = KamateraTestDriver(*KAMATERA_PARAMS) + self.eu_node_location = NodeLocation( + id="EU", name="Amsterdam", country="The Netherlands", driver=self.driver + ) + self.il_node_location = NodeLocation( + id="IL", name="Rosh Haayin", country="Israel", driver=self.driver + ) + self.centos_8_EU_node_image = NodeImage( + id="EU:6000C2987c9641fd2619a149ba2ca01a", + name="CentOS 8.0 64-bit - Minimal Configuration", + driver=self.driver, + extra={ + "datacenter": "EU", + "os": "CentOS", + "code": "8.0 64bit_minimal", + "osDiskSizeGB": 5, + "ramMBMin": {"A": 256, "B": 256, "T": 256, "D": 256}, + }, + ) + self.small_node_size = self.driver.ex_get_size( + ramMB=4096, + diskSizeGB=30, + cpuType="B", + cpuCores=2, + monthlyTrafficPackage="t5000", + id="small", + name="small", + ) + + def test_creating_driver(self): + cls = providers.get_driver(Provider.KAMATERA) + self.assertIs(cls, KamateraNodeDriver) + + def test_features(self): + features = self.driver.features["create_node"] + self.assertIn("password", features) + self.assertIn("generates_password", features) + self.assertIn("ssh_key", features) + + def test_list_locations(self): + locations = self.driver.list_locations() + self.assertTrue(len(locations) == 13) + self.assert_object(self.il_node_location, objects=locations) + + def test_list_sizes(self): + sizes = self.driver.list_sizes(self.eu_node_location) + self.assertTrue(len(sizes) >= 1) + self.assert_object(self.small_node_size, objects=sizes) + + def test_list_images(self): + images = self.driver.list_images(self.eu_node_location) + self.assertTrue(len(images) > 10) + self.assert_object(self.centos_8_EU_node_image, objects=images) + + def test_ex_list_capabilities(self): + capabilities = self.driver.ex_list_capabilities(self.eu_node_location) + self.assertEqual( + { + "cpuTypes", + "defaultMonthlyTrafficPackage", + "diskSizeGB", + "monthlyTrafficPackage", + }, + set(capabilities.keys()), + ) + self.assertTrue(len(capabilities["cpuTypes"]), 4) + self.assertEqual( + {"id", "description", "name", "ramMB", "cpuCores"}, + set(capabilities["cpuTypes"][0]), + ) + + def test_create_node(self): + node = self.driver.create_node( + name="test_server", + size=self.small_node_size, + image=self.centos_8_EU_node_image, + location=self.eu_node_location, + ) + + self.assertTrue(len(node.id) > 8) + self.assertEqual(node.name, "my-server") + self.assertEqual(node.state, NodeState.RUNNING) + self.assertTrue(len(node.public_ips) > 0) + self.assertTrue(len(node.private_ips) > 0) + self.assertEqual(node.driver, self.driver) + self.assertTrue(len(node.extra["generated_password"]) > 0) + + def test_create_node_with_ssh_keys(self): + node = self.driver.create_node( + name="test_server_pubkey", + size=self.small_node_size, + image=self.centos_8_EU_node_image, + location=self.eu_node_location, + auth=NodeAuthSSHKey("publickey"), + ) + + self.assertTrue(len(node.id) > 8) + self.assertEqual(node.name, "my-server") + self.assertEqual(node.state, NodeState.RUNNING) + self.assertTrue(len(node.public_ips) > 0) + self.assertTrue(len(node.private_ips) > 0) + self.assertEqual(node.driver, self.driver) + self.assertFalse("generated_password" in node.extra) + + def test_list_nodes(self): + nodes = self.driver.list_nodes() + self.assertTrue(len(nodes) >= 1) + node = nodes[0] + self.assertEqual(node.name, "test_server") + self.assertEqual(node.state, NodeState.RUNNING) + self.assertEqual(node.driver, self.driver) + + def test_list_nodes_full(self): + nodes = self.driver.list_nodes(ex_full_details=True) + self.assertTrue(len(nodes) >= 1) + node = nodes[0] + self.assertEqual(node.name, "my-server") + self.assertEqual(node.state, NodeState.RUNNING) + self.assertTrue(len(node.public_ips) > 0) + self.assertTrue(len(node.private_ips) > 0) + self.assertEqual(node.driver, self.driver) + + def test_reboot_node(self): + nodes = self.driver.list_nodes() + success = self.driver.reboot_node(nodes[0]) + self.assertTrue(success) + + def assert_object(self, expected_object, objects): + same_data = any([self.objects_equals(expected_object, obj) for obj in objects]) + self.assertTrue( + same_data, + "Objects does not match ({}, {})".format(expected_object, objects[:2]), + ) + + def objects_equals(self, expected_obj, obj): + for name in vars(expected_obj): + expected_data = getattr(expected_obj, name) + actual_data = getattr(obj, name) + same_data = self.data_equals(expected_data, actual_data) + if not same_data: + break + return same_data + + def data_equals(self, expected_data, actual_data): + if isinstance(expected_data, dict): + return self.dicts_equals(expected_data, actual_data) + else: + return expected_data == actual_data + + def dicts_equals(self, d1, d2): + dict_keys_same = set(d1.keys()) == set(d2.keys()) + if not dict_keys_same: + return False + + for key in d1.keys(): + if d1[key] != d2[key]: + return False + + return True + + +class KamateraTestDriver(KamateraNodeDriver): + def ex_wait_command(self, *args, **kwargs): + kwargs["poll_interval_seconds"] = 0 + return KamateraNodeDriver.ex_wait_command(self, *args, **kwargs) + + +class KamateraMockHttp(MockHttp): + fixtures = ComputeFileFixtures("kamatera") + + def _service_server(self, method, url, body, headers): + client_id, secret = headers["AuthClientId"], headers["AuthSecret"] + if client_id == "nosuchuser" and secret == "nopwd": + body = self.fixtures.load("failed_auth.json") + status = httplib.UNAUTHORIZED + else: + if url == "/service/server" and json.loads(body).get("ssh-key"): + body = self.fixtures.load("create_server_sshkey.json") + else: + body = self.fixtures.load( + { + "/service/server?datacenter=1": "datacenters.json", + "/service/server?sizes=1&datacenter=EU": "sizes_datacenter_EU.json", + "/service/server?images=1&datacenter=EU": "images_datacenter_EU.json", + "/service/server?capabilities=1&datacenter=EU": "capabilities_datacenter_EU.json", + "/service/server": "create_server.json", + }[url] + ) + status = httplib.OK + return status, body, {}, httplib.responses[status] + + def _service_queue(self, method, url, body, headers): + if not hasattr(self, "_service_queue_call_count"): + self._service_queue_call_count = 0 + self._service_queue_call_count += 1 + body = self.fixtures.load( + {"/service/queue?id=12345": "queue_12345-%s.json" % self._service_queue_call_count}[url] + ) + status = httplib.OK + return status, body, {}, httplib.responses[status] + + def _service_server_info(self, method, url, body, headers): + body = self.fixtures.load({"/service/server/info": "server_info.json"}[url]) + status = httplib.OK + return status, body, {}, httplib.responses[status] + + def _service_servers(self, method, url, body, headers): + body = self.fixtures.load({"/service/servers": "servers.json"}[url]) + status = httplib.OK + return status, body, {}, httplib.responses[status] + + def _service_server_reboot(self, method, url, body, headers): + body = self.fixtures.load({"/service/server/reboot": "server_operation.json"}[url]) + status = httplib.OK + return status, body, {}, httplib.responses[status] + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_ktucloud.py b/libcloud/test/compute/test_ktucloud.py index 2a27de1152..1f305b8050 100644 --- a/libcloud/test/compute/test_ktucloud.py +++ b/libcloud/test/compute/test_ktucloud.py @@ -16,55 +16,47 @@ import sys import unittest -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import urlparse -from libcloud.utils.py3 import parse_qsl +from libcloud.test import MockHttp +from libcloud.utils.py3 import httplib, urlparse, parse_qsl +from libcloud.test.compute import TestCaseMixin +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.ktucloud import KTUCloudNodeDriver try: import simplejson as json except ImportError: import json -from libcloud.compute.drivers.ktucloud import KTUCloudNodeDriver - -from libcloud.test import MockHttpTestCase -from libcloud.test.compute import TestCaseMixin -from libcloud.test.file_fixtures import ComputeFileFixtures - class KTUCloudNodeDriverTest(unittest.TestCase, TestCaseMixin): - def setUp(self): - KTUCloudNodeDriver.connectionCls.conn_classes = \ - (None, KTUCloudStackMockHttp) - self.driver = KTUCloudNodeDriver('apikey', 'secret', - path='/test/path', - host='api.dummy.com') - self.driver.path = '/test/path' + KTUCloudNodeDriver.connectionCls.conn_class = KTUCloudStackMockHttp + self.driver = KTUCloudNodeDriver( + "apikey", "secret", path="/test/path", host="api.dummy.com" + ) + self.driver.path = "/test/path" self.driver.type = -1 - KTUCloudStackMockHttp.fixture_tag = 'default' + KTUCloudStackMockHttp.fixture_tag = "default" self.driver.connection.poll_interval = 0.0 def test_create_node_immediate_failure(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] - KTUCloudStackMockHttp.fixture_tag = 'deployfail' + KTUCloudStackMockHttp.fixture_tag = "deployfail" self.assertRaises( - Exception, - self.driver.create_node, - name='node-name', image=image, size=size) + Exception, self.driver.create_node, name="node-name", image=image, size=size + ) def test_create_node_delayed_failure(self): size = self.driver.list_sizes()[0] image = self.driver.list_images()[0] - KTUCloudStackMockHttp.fixture_tag = 'deployfail2' + KTUCloudStackMockHttp.fixture_tag = "deployfail2" self.assertRaises( - Exception, - self.driver.create_node, - name='node-name', image=image, size=size) + Exception, self.driver.create_node, name="node-name", image=image, size=size + ) def test_list_images_no_images_available(self): - KTUCloudStackMockHttp.fixture_tag = 'notemplates' + KTUCloudStackMockHttp.fixture_tag = "notemplates" images = self.driver.list_images() self.assertEqual(0, len(images)) @@ -78,7 +70,7 @@ def test_list_sizes_available(self): self.assertEqual(112, len(sizes)) def test_list_sizes_nodisk(self): - KTUCloudStackMockHttp.fixture_tag = 'nodisk' + KTUCloudStackMockHttp.fixture_tag = "nodisk" sizes = self.driver.list_sizes() self.assertEqual(2, len(sizes)) @@ -91,9 +83,9 @@ def test_list_sizes_nodisk(self): self.assertTrue(check) -class KTUCloudStackMockHttp(MockHttpTestCase): - fixtures = ComputeFileFixtures('ktucloud') - fixture_tag = 'default' +class KTUCloudStackMockHttp(MockHttp, unittest.TestCase): + fixtures = ComputeFileFixtures("ktucloud") + fixture_tag = "default" def _load_fixture(self, fixture): body = self.fixtures.load(fixture) @@ -103,29 +95,30 @@ def _test_path(self, method, url, body, headers): url = urlparse.urlparse(url) query = dict(parse_qsl(url.query)) - self.assertTrue('apiKey' in query) - self.assertTrue('command' in query) - self.assertTrue('response' in query) - self.assertTrue('signature' in query) + self.assertTrue("apiKey" in query) + self.assertTrue("command" in query) + self.assertTrue("response" in query) + self.assertTrue("signature" in query) - self.assertTrue(query['response'] == 'json') + self.assertTrue(query["response"] == "json") - del query['apiKey'] - del query['response'] - del query['signature'] - command = query.pop('command') + del query["apiKey"] + del query["response"] + del query["signature"] + command = query.pop("command") - if hasattr(self, '_cmd_' + command): - return getattr(self, '_cmd_' + command)(**query) + if hasattr(self, "_cmd_" + command): + return getattr(self, "_cmd_" + command)(**query) else: - fixture = command + '_' + self.fixture_tag + '.json' + fixture = command + "_" + self.fixture_tag + ".json" body, obj = self._load_fixture(fixture) - return (httplib.OK, body, obj, httplib.responses[httplib.OK]) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _cmd_queryAsyncJobResult(self, jobid): - fixture = 'queryAsyncJobResult' + '_' + str(jobid) + '.json' + fixture = "queryAsyncJobResult" + "_" + str(jobid) + ".json" body, obj = self._load_fixture(fixture) - return (httplib.OK, body, obj, httplib.responses[httplib.OK]) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_kubevirt.py b/libcloud/test/compute/test_kubevirt.py new file mode 100644 index 0000000000..d983cb17d6 --- /dev/null +++ b/libcloud/test/compute/test_kubevirt.py @@ -0,0 +1,639 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import sys +import copy +import json + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import httplib +from libcloud.compute.base import NodeLocation, NodeAuthSSHKey, NodeAuthPassword +from libcloud.compute.types import NodeState +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.kubevirt import ( + KubeVirtNodeSize, + KubeVirtNodeImage, + KubeVirtNodeDriver, + _memory_in_MB, + _deep_merge_dict, +) +from libcloud.test.common.test_kubernetes import KubernetesAuthTestCaseMixin + + +class KubeVirtTestCase(unittest.TestCase, KubernetesAuthTestCaseMixin): + driver_cls = KubeVirtNodeDriver + fixtures = ComputeFileFixtures("kubevirt") + + def setUp(self): + KubeVirtNodeDriver.connectionCls.conn_class = KubeVirtMockHttp + self.driver = KubeVirtNodeDriver( + key="user", secret="pass", secure=True, host="foo", port=6443 + ) + + def test_list_locations(self): + locations = self.driver.list_locations() + self.assertEqual(len(locations), 6) + self.assertEqual(locations[0].name, "default") + self.assertEqual(locations[1].name, "kube-node-lease") + self.assertEqual(locations[2].name, "kube-public") + self.assertEqual(locations[3].name, "kube-system") + + namespace4 = locations[0].driver.list_locations()[4].name + self.assertEqual(namespace4, "kubevirt") + id4 = locations[2].driver.list_locations()[4].id + self.assertEqual(id4, "e6d3d7e8-0ee5-428b-8e17-5187779e5627") + + def test_list_nodes(self): + nodes = self.driver.list_nodes(location="default") + id0 = "74fd7665-fbd6-4565-977c-96bd21fb785a" + + self.assertEqual(len(nodes), 1) + self.assertEqual(nodes[0].extra["namespace"], "default") + valid_node_states = {NodeState.RUNNING, NodeState.PENDING, NodeState.STOPPED} + self.assertTrue(nodes[0].state in valid_node_states) + self.assertEqual(nodes[0].name, "testvm") + self.assertEqual(nodes[0].id, id0) + + def test_destroy_node(self): + nodes = self.driver.list_nodes() + to_destroy = nodes[-1] + resp = self.driver.destroy_node(to_destroy) + self.assertTrue(resp) + + def test_start_node(self): + nodes = self.driver.list_nodes() + r1 = self.driver.start_node(nodes[0]) + self.assertTrue(r1) + + def test_stop_node(self): + nodes = self.driver.list_nodes() + r1 = self.driver.stop_node(nodes[0]) + self.assertTrue(r1) + + def test_reboot_node(self): + nodes = self.driver.list_nodes() + for node in nodes: + if node.name == "testvm": + resp = self.driver.reboot_node(node) + + self.assertTrue(resp) + + def test_create_node(self): + node = self.driver.create_node( + name="testcreatenode", + size=KubeVirtNodeSize(cpu=1, ram=128), + image=KubeVirtNodeImage("kubevirt/cirros-registry-disk-demo"), + ex_disks=[ + { + "name": "anpvc", + "bus": "virtio", + "device": "disk", + "disk_type": "persistentVolumeClaim", + "volume_spec": {"claim_name": "mypvc2"}, + }, + ], + ex_network={ + "name": "netw1", + "network_type": "pod", + "interface": "masquerade", + }, + ) + self.assertEqual(node.name, "testcreatenode") + self.assertEqual(node.size.extra["cpu"], 1) + self.assertEqual(node.size.ram, 128) + + def test_create_node_default_net(self): + node = self.driver.create_node( + name="testcreatenode", + size=KubeVirtNodeSize(cpu=1, ram=128), + image=KubeVirtNodeImage("kubevirt/cirros-registry-disk-demo"), + ex_disks=[ + { + "name": "anpvc", + "bus": "virtio", + "device": "disk", + "disk_type": "persistentVolumeClaim", + "volume_spec": {"claim_name": "mypvc2"}, + }, + ], + ) + self.assertEqual(node.name, "testcreatenode") + self.assertEqual(node.size.extra["cpu"], 1) + self.assertEqual(node.size.ram, 128) + + def test_create_node_legacy_3_tuple_net(self): + node = self.driver.create_node( + name="testcreatenode", + size=KubeVirtNodeSize(cpu=1, ram=128), + image=KubeVirtNodeImage("kubevirt/cirros-registry-disk-demo"), + ex_disks=[ + { + "name": "anpvc", + "bus": "virtio", + "device": "disk", + "disk_type": "persistentVolumeClaim", + "volume_spec": {"claim_name": "mypvc2"}, + }, + ], + ex_network=("pod", "masquerade", "netw1"), + ) + self.assertEqual(node.name, "testcreatenode") + self.assertEqual(node.size.extra["cpu"], 1) + self.assertEqual(node.size.ram, 128) + + def test_create_node_auth_and_cloud_init(self): + try: + self.driver.create_node( + name="testcreatenode", + size=KubeVirtNodeSize(cpu=1, ram=128), + image=KubeVirtNodeImage("kubevirt/cirros-registry-disk-demo"), + auth=NodeAuthPassword("password"), + ex_disks=[ + { + "name": "anpvc", + "bus": "virtio", + "device": "disk", + "disk_type": "persistentVolumeClaim", + "volume_spec": {"claim_name": "mypvc2"}, + }, + { + "name": "cloudinit", + "bus": "virtio", + "device": "cdrom", + "disk_type": "cloudInitConfigDrive", + "volume_spec": { + "cloudInitNoCloud": { + "userData": "echo 'hello world'", + } + }, + }, + ], + ) + except ValueError as e: + self.assertIn("auth and cloudInit at the same time", str(e)) + else: + self.fail("Expected ValueError") + + def test_create_node_bad_pvc(self): + try: + self.driver.create_node( + name="testcreatenode", + size=KubeVirtNodeSize(cpu=1, ram=128), + image=KubeVirtNodeImage("kubevirt/cirros-registry-disk-demo"), + ex_disks=[ + { + "name": "badpvc", + "bus": "virtio", + "device": "disk", + "disk_type": "persistentVolumeClaim", + "volume_spec": { + "claim_name": "notexistnewpvc", + "storage_class_name": "longhorn", + # missing size + }, + }, + ], + ) + except KeyError as e: + self.assertIn("size", str(e)) + self.assertIn("storage_class_name", str(e)) + self.assertIn("both required", str(e)) + else: + self.fail("Expected KeyError") + + def test_create_node_ex_template(self): + # missing the optional metadata & required apiVersion + # metadata will be added by the driver + # and apiVersion missing will raise an error by _create_node_with_template + template = { + "kind": "VirtualMachine", + "spec": { + "running": False, + "template": { + "spec": { + "domain": { + "devices": { + "disks": [], + "interfaces": [], + "networkInterfaceMultiqueue": False, + }, + "machine": {"type": ""}, + "resources": {"requests": {}, "limits": {}}, + }, + "networks": [], + "terminationGracePeriodSeconds": 0, + "volumes": [], + }, + }, + }, + } + try: + self.driver.create_node( + name="testcreatenode", + # size & image should be ignored when ex_template is provided + size=KubeVirtNodeSize(cpu=1, ram=128), + image=KubeVirtNodeImage("kubevirt/cirros-registry-disk-demo"), + ex_template=template, + ) + except ValueError as e: + self.assertEqual(str(e), "The template must have an apiVersion: kubevirt.io/v1alpha3") + else: + self.fail("Expected ValueError") + + def test_create_node_req_lim(self): + node = self.driver.create_node( + name="vm-test-tumbleweed-07", + size=KubeVirtNodeSize( + cpu=2, + ram=4096, + cpu_request="1m", + ram_request=1, + ), + image=KubeVirtNodeImage( + name="registry.internal.com/kubevirt-vmidisks/tumbleweed:240531" + ), + location=NodeLocation( + id="5341e71d-e8d8-4a1b-a97b-52864eb3dd7d", + name="testreqlim", + country="", + driver=self.driver, + ), + auth=NodeAuthSSHKey("ssh-rsa FAKEKEY foo@bar.com"), + ex_network={ + "network_type": "pod", + "interface": "bridge", + "name": "default", + }, + ) + self.assertEqual(node.name, "vm-test-tumbleweed-07") + self.assertEqual(node.size.extra["cpu"], 2) + self.assertEqual(node.size.extra["cpu_request"], "1m") + self.assertEqual(node.size.ram, 4096) + self.assertEqual(node.size.extra["ram_request"], 1) + + def test_memory_in_MB(self): + self.assertEqual(_memory_in_MB("128Mi"), 128) + self.assertEqual(_memory_in_MB("128M"), 128) + + self.assertEqual(_memory_in_MB("134217728"), 128) + self.assertEqual(_memory_in_MB(134217728), 128) + + self.assertEqual(_memory_in_MB("128Gi"), 128 * 1024) + self.assertEqual(_memory_in_MB("128G"), 128 * 1000) + + self.assertEqual(_memory_in_MB("1920Ki"), 1920 // 1024) + self.assertEqual(_memory_in_MB("1920K"), 1920 // 1000) + + self.assertEqual(_memory_in_MB("1Ti"), 1 * 1024 * 1024) + self.assertEqual(_memory_in_MB("1T"), 1 * 1000 * 1000) + + def test_deep_merge_dict(self): + a = {"domain": {"devices": 0}, "volumes": [1, 2, 3], "network": {}} + b = {"domain": {"machine": "non-exist-in-a", "devices": 1024}, "volumes": [4, 5, 6]} + expected_result = { + "domain": {"machine": "non-exist-in-a", "devices": 1024}, + "volumes": [1, 2, 3], + "network": {}, + } + self.assertEqual(_deep_merge_dict(a, b), expected_result) + + a = {"domain": {"devices": 1024}, "volumes": [1, 2, 3], "network": {}} + b = {"domain": {"machine": "non-exist-in-a", "devices": 0}, "volumes": [4, 5, 6]} + expected_result = { + "domain": {"machine": "non-exist-in-a", "devices": 1024}, + "volumes": [1, 2, 3], + "network": {}, + } + self.assertEqual(_deep_merge_dict(a, b), expected_result) + + a = {"domain": {"devices": 0}, "volumes": [1, 2, 3], "network": {}} + b = {"domain": {"machine": "non-exist-in-a", "devices": 0}, "volumes": [4, 5, 6]} + expected_result = { + "domain": {"machine": "non-exist-in-a", "devices": 0}, + "volumes": [1, 2, 3], + "network": {}, + } + self.assertEqual(_deep_merge_dict(a, b), expected_result) + + a = {"domain": {"devices": 1024}, "volumes": [1, 2, 3], "network": {}} + b = {"domain": {"machine": "non-exist-in-a", "devices": 1024}, "volumes": [4, 5, 6]} + expected_result = { + "domain": {"machine": "non-exist-in-a", "devices": 1024}, + "volumes": [1, 2, 3], + "network": {}, + } + self.assertEqual(_deep_merge_dict(a, b), expected_result) + + a = {"domain": {"devices": 1024}, "volumes": [1, 2, 3], "network": {}} + b = {"domain": {"machine": "non-exist-in-a", "devices": 2048}, "volumes": [4, 5, 6]} + expected_result = { + "domain": {"machine": "non-exist-in-a", "devices": 1024}, + "volumes": [1, 2, 3], + "network": {}, + } + self.assertEqual(_deep_merge_dict(a, b), expected_result) + + a = {"domain": {"devices": 1024}, "volumes": [1, 2, 3], "network": {}} + b = { + "domain": {"machine": "non-exist-in-a", "devices": 1024, "foo": "bar"}, + "volumes": [4, 5, 6], + } + expected_result = { + "domain": {"machine": "non-exist-in-a", "devices": 1024, "foo": "bar"}, + "volumes": [1, 2, 3], + "network": {}, + } + self.assertEqual(_deep_merge_dict(a, b), expected_result) + + a = {"domain": {"devices": 1024}, "volumes": [1, 2, 3], "network": {}} + b = { + "domain": {"machine": "non-exist-in-a", "devices": 1024, "foo": ""}, + "volumes": [4, 5, 6], + } + expected_result = { + "domain": {"machine": "non-exist-in-a", "devices": 1024, "foo": ""}, + "volumes": [1, 2, 3], + "network": {}, + } + self.assertEqual(_deep_merge_dict(a, b), expected_result) + + a = {"domain": {"devices": 1024}, "volumes": [1, 2, 3], "network": {}} + b = { + "domain": {"machine": "non-exist-in-a", "devices": 1024, "foo": None}, + "volumes": [4, 5, 6], + } + expected_result = { + "domain": {"machine": "non-exist-in-a", "devices": 1024, "foo": None}, + "volumes": [1, 2, 3], + "network": {}, + } + self.assertEqual(_deep_merge_dict(a, b), expected_result) + + def test_create_node_auth(self): + mock_vm = { + "spec": {"template": {"spec": {"domain": {"devices": {"disks": []}}, "volumes": []}}} + } + cases = [ + NodeAuthPassword("password"), + NodeAuthSSHKey("ssh-rsa FAKEKEY foo@bar.com"), + NodeAuthPassword("bad\npassword\nwith\nnew\nline"), + NodeAuthPassword("bad\npassword\n\fwith\tnot\b\b\b printable\a\n\rcharacters\b\n"), + NodeAuthPassword("bad\npassword\nwith\n\"double\" and 'single' quotes"), + NodeAuthSSHKey("ssh-rsa bad\nkey\nwith new line injected hacker@yaml.security"), + NodeAuthSSHKey( + "ssh-rsa bad\n\akey\b\b\b\nwith many\a \"injected' chars hacker@yaml.security" + ), + ] + for a in cases: + try: + vm = copy.deepcopy(mock_vm) + self.driver._create_node_auth(vm, a) + user_data = vm["spec"]["template"]["spec"]["volumes"][0]["cloudInitNoCloud"][ + "userData" + ] + self.assertTrue(isinstance(user_data, str)) + # 1. make sure there are no newlines escaped + if isinstance(a, NodeAuthSSHKey): + # >>> public_key = "ssh-rsa FAKEKEY foo@bar.com" + # >>> a = ( + # ... """#cloud-config\n""" """ssh_authorized_keys:\n""" """ - {}\n""" + # ... ).format(public_key) + # >>> len(a.splitlines()) + # 3 + self.assertEqual(len(user_data.splitlines()), 3) + elif isinstance(a, NodeAuthPassword): + # >>> password = "password" + # >>> a = ( + # ... """#cloud-config\n""" + # ... """password: {}\n""" + # ... """chpasswd: {{ expire: False }}\n""" + # ... """ssh_pwauth: True\n""" + # ... ).format(password) + # >>> len(a.splitlines()) + # 4 + self.assertEqual(len(user_data.splitlines()), 4) + # 2. check if the quotes are well-escaped + for line in user_data.splitlines(): + key = "" # public key or password + if line.startswith(" - "): + key = line[4:] + self.assertEqual(key, json.dumps(a.pubkey.strip())) + elif line.startswith("password: "): + key = line[10:] + self.assertEqual(key, json.dumps(a.password.strip())) + else: + continue + self.assertTrue(key.startswith('"')) + self.assertTrue(key.endswith('"')) + # all double quotes inside must be escaped + for i, c in enumerate(key[1:-1]): + if c == '"': + # since enumerate starts from key[1:], + # so c is key[i+1], + # and key[i] is the previous char + self.assertEqual(key[i], "\\") + + except Exception as e: + self.fail(f"Failed to create node auth for {a}: {e}") + + +class KubeVirtMockHttp(MockHttp): + fixtures = ComputeFileFixtures("kubevirt") + + did_create_vm = False + did_create_vm_test_size_req_lim = False + + def _api_v1_namespaces(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_api_v1_namespaces.json") + else: + raise AssertionError("Unsupported method") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _apis_kubevirt_io_v1alpha3_namespaces_default_virtualmachines( + self, method, url, body, headers + ): + if method == "GET": + if self.did_create_vm: + body = self.fixtures.load("get_default_vms_after_create_vm.json") + else: + body = self.fixtures.load("get_default_vms.json") + resp = httplib.OK + elif method == "POST": + body = self.fixtures.load("create_vm.json") + resp = httplib.CREATED + self.did_create_vm = True + else: + AssertionError("Unsupported method") + return (resp, body, {}, httplib.responses[httplib.OK]) + + def _apis_kubevirt_io_v1alpha3_namespaces_kube_node_lease_virtualmachines( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("get_kube_node_lease_vms.json") + elif method == "POST": + pass + else: + AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _apis_kubevirt_io_v1alpha3_namespaces_kube_public_virtualmachines( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("get_kube_public_vms.json") + elif method == "POST": + pass + else: + AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _apis_kubevirt_io_v1alpha3_namespaces_kube_system_virtualmachines( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("get_kube_system_vms.json") + elif method == "POST": + pass + else: + AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _apis_kubevirt_io_v1alpha3_namespaces_kubevirt_virtualmachines( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("get_kube_public_vms.json") + else: + AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _apis_kubevirt_io_v1alpha3_namespaces_default_virtualmachines_testcreatenode( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("create_vm.json") + else: + AssertionError("Unsupported method") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _apis_kubevirt_io_v1alpha3_namespaces_default_virtualmachines_testvm( + self, method, url, body, headers + ): + header = "application/merge-patch+json" + data_stop = {"spec": {"running": False}} + data_start = {"spec": {"running": True}} + + if method == "PATCH" and headers["Content-Type"] == header and body == data_start: + body = self.fixtures.load("start_testvm.json") + + elif method == "PATCH" and headers["Content-Type"] == header and body == data_stop: + body = self.fixtures.load("stop_testvm.json") + + else: + AssertionError("Unsupported method") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _apis_kubevirt_io_v1alpha3_namespaces_default_virtualmachines_vm_cirros( + self, method, url, body, headers + ): + header = "application/merge-patch+json" + data_stop = {"spec": {"running": False}} + data_start = {"spec": {"running": True}} + + if method == "PATCH" and headers["Content-Type"] == header and body == data_start: + body = self.fixtures.load("start_vm_cirros.json") + + elif method == "PATCH" and headers["Content-Type"] == header and body == data_stop: + body = self.fixtures.load("stop_vm_cirros.json") + + else: + AssertionError("Unsupported method") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _apis_kubevirt_io_v1alpha3_namespaces_default_virtualmachineinstances_testvm( + self, method, url, body, headers + ): + if method == "DELETE": + body = self.fixtures.load("delete_vmi_testvm.json") + else: + AssertionError("Unsupported method") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _api_v1_namespaces_default_pods(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("get_pods.json") + else: + AssertionError("Unsupported method") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _api_v1_namespaces_default_services(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("get_services.json") + else: + AssertionError("Unsupported method") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _api_v1_namespaces_default_persistentvolumeclaims(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("get_pvcs.json") + else: + AssertionError("Unsupported method") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _apis_kubevirt_io_v1alpha3_namespaces_testreqlim_virtualmachines( + self, method, url, body, headers + ): + if method == "GET": + if self.did_create_vm_test_size_req_lim: + body = self.fixtures.load("get_testreqlim_vms_after_create_vm.json") + else: + body = self.fixtures.load("get_default_vms.json") + resp = httplib.OK + elif method == "POST": + body = self.fixtures.load("create_vm_reqlim.json") + resp = httplib.CREATED + self.did_create_vm_test_size_req_lim = True + else: + AssertionError("Unsupported method") + return (resp, body, {}, httplib.responses[httplib.OK]) + + def _api_v1_namespaces_testreqlim_services(self, method, url, body, headers): + return self._api_v1_namespaces_default_services(method, url, body, headers) + + def _api_v1_namespaces_testreqlim_pods(self, method, url, body, headers): + return self._api_v1_namespaces_default_pods(method, url, body, headers) + + def _apis_kubevirt_io_v1alpha3_namespaces_testreqlim_virtualmachines_vm_test_tumbleweed_07( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("get_vm_test_tumbleweed_07.json") + else: + AssertionError("Unsupported method") + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_libvirt_driver.py b/libcloud/test/compute/test_libvirt_driver.py new file mode 100644 index 0000000000..4a2f874974 --- /dev/null +++ b/libcloud/test/compute/test_libvirt_driver.py @@ -0,0 +1,84 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +from unittest import mock + +from libcloud.test import unittest +from libcloud.compute.drivers.libvirt_driver import LibvirtNodeDriver, have_libvirt + +__all__ = ["LibvirtNodeDriverTestCase"] + + +@unittest.skipIf(not have_libvirt, "libvirt not available, skipping tests") +@mock.patch("libcloud.compute.drivers.libvirt_driver.libvirt", autospec=True) +class LibvirtNodeDriverTestCase(unittest.TestCase): + arp_output_str = """? (1.2.10.80) at 52:54:00:bc:f9:6c [ether] on br0 +? (1.2.10.33) at 52:54:00:04:89:51 [ether] on br0 +? (1.2.10.97) at 52:54:00:c6:40:ec [ether] on br0 +? (1.2.10.40) at 52:54:00:77:1c:83 [ether] on br0""" + ip_output_str = """1.2.10.80 dev br0 lladdr 52:54:00:bc:f9:6c STALE +1.2.10.33 dev br0 lladdr 52:54:00:04:89:51 REACHABLE +1.2.10.97 dev br0 lladdr 52:54:00:c6:40:ec DELAY +1.2.10.40 dev br0 lladdr 52:54:00:77:1c:83 STALE""" + bad_output_str = """1.2.10.80 dev br0 52:54:00:bc:f9:6c STALE +1.2.10.33 dev br0 lladdr 52:54:00:04:89:51 REACHABLE +1.2.10.97 dev br0 lladdr +1.2.10.40 dev br0 lladdr 52:54:00:77:1c:83 STALE""" + + from libcloud.utils.py3 import b + + arp_output_str = b(arp_output_str) + ip_output_str = b(ip_output_str) + bad_output_str = b(bad_output_str) + + def _assert_arp_table(self, arp_table): + self.assertIn("52:54:00:bc:f9:6c", arp_table) + self.assertIn("52:54:00:04:89:51", arp_table) + self.assertIn("52:54:00:c6:40:ec", arp_table) + self.assertIn("52:54:00:77:1c:83", arp_table) + self.assertIn("1.2.10.80", arp_table["52:54:00:bc:f9:6c"]) + self.assertIn("1.2.10.33", arp_table["52:54:00:04:89:51"]) + self.assertIn("1.2.10.97", arp_table["52:54:00:c6:40:ec"]) + self.assertIn("1.2.10.40", arp_table["52:54:00:77:1c:83"]) + + def test_arp_map(self, *args, **keywargs): + driver = LibvirtNodeDriver("") + arp_table = driver._parse_ip_table_arp(self.arp_output_str) + self._assert_arp_table(arp_table) + + def test_ip_map(self, *args, **keywargs): + driver = LibvirtNodeDriver("") + arp_table = driver._parse_ip_table_neigh(self.ip_output_str) + self._assert_arp_table(arp_table) + + def test_bad_map(self, *args, **keywargs): + driver = LibvirtNodeDriver("") + arp_table = driver._parse_ip_table_neigh(self.bad_output_str) + # we should at least get the correctly formatted lines + self.assertEqual(len(arp_table), 2) + arp_table = driver._parse_ip_table_neigh(self.arp_output_str) + # nothing should match if the wrong output is sent + self.assertEqual(len(arp_table), 0) + + def test_list_nodes(self, *args, **keywargs): + driver = LibvirtNodeDriver("") + nodes = driver.list_nodes() + self.assertEqual(type([]), type(nodes)) + self.assertEqual(len(nodes), 0) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_linode.py b/libcloud/test/compute/test_linode.py deleted file mode 100644 index 9a35f07c9f..0000000000 --- a/libcloud/test/compute/test_linode.py +++ /dev/null @@ -1,198 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Maintainer: Jed Smith -# Based upon code written by Alex Polvi -# - -import sys -import unittest -from libcloud.utils.py3 import httplib - -from libcloud.compute.drivers.linode import LinodeNodeDriver -from libcloud.compute.base import Node, NodeAuthPassword -from libcloud.compute.base import NodeAuthSSHKey, StorageVolume - -from libcloud.test import MockHttp -from libcloud.test.compute import TestCaseMixin -from libcloud.test.file_fixtures import ComputeFileFixtures - - -class LinodeTest(unittest.TestCase, TestCaseMixin): - # The Linode test suite - - def setUp(self): - LinodeNodeDriver.connectionCls.conn_classes = (None, LinodeMockHttp) - LinodeMockHttp.use_param = 'api_action' - self.driver = LinodeNodeDriver('foo') - - def test_list_nodes(self): - nodes = self.driver.list_nodes() - self.assertEqual(len(nodes), 1) - node = nodes[0] - self.assertEqual(node.id, "8098") - self.assertEqual(node.name, 'api-node3') - self.assertEqual(node.extra['PLANID'], '2') - self.assertTrue('75.127.96.245' in node.public_ips) - self.assertEqual(node.private_ips, []) - - def test_reboot_node(self): - # An exception would indicate failure - node = self.driver.list_nodes()[0] - self.driver.reboot_node(node) - - def test_destroy_node(self): - # An exception would indicate failure - node = self.driver.list_nodes()[0] - self.driver.destroy_node(node) - - def test_create_node_password_auth(self): - # Will exception on failure - self.driver.create_node(name="Test", - location=self.driver.list_locations()[0], - size=self.driver.list_sizes()[0], - image=self.driver.list_images()[6], - auth=NodeAuthPassword("test123")) - - def test_create_node_ssh_key_auth(self): - # Will exception on failure - node = self.driver.create_node(name="Test", - location=self.driver.list_locations()[ - 0], - size=self.driver.list_sizes()[0], - image=self.driver.list_images()[6], - auth=NodeAuthSSHKey('foo')) - self.assertTrue(isinstance(node, Node)) - - def test_list_sizes(self): - sizes = self.driver.list_sizes() - self.assertEqual(len(sizes), 9) - for size in sizes: - self.assertEqual(size.ram, int(size.name.split(" ")[1])) - - def test_list_images(self): - images = self.driver.list_images() - self.assertEqual(len(images), 30) - - def test_create_node_response(self): - # should return a node object - node = self.driver.create_node(name="node-name", - location=self.driver.list_locations()[ - 0], - size=self.driver.list_sizes()[0], - image=self.driver.list_images()[0], - auth=NodeAuthPassword("foobar")) - self.assertTrue(isinstance(node, Node)) - - def test_destroy_volume(self): - # Will exception on failure - node = self.driver.list_nodes()[0] - volume = StorageVolume(id=55648, name="test", size=1024, - driver=self.driver, extra={"LINODEID": node.id}) - self.driver.destroy_volume(volume) - - def test_ex_create_volume(self): - # should return a StorageVolume object - node = self.driver.list_nodes()[0] - volume = self.driver.ex_create_volume(size=4096, - name="Another test image", - node=node, - fs_type="ext4") - self.assertTrue(isinstance(volume, StorageVolume)) - - def test_ex_list_volumes(self): - # should return list of StorageVolume objects - node = self.driver.list_nodes()[0] - volumes = self.driver.ex_list_volumes(node=node) - - self.assertTrue(isinstance(volumes, list)) - self.assertTrue(isinstance(volumes[0], StorageVolume)) - self.assertEqual(len(volumes), 2) - - -class LinodeMockHttp(MockHttp): - fixtures = ComputeFileFixtures('linode') - - def _avail_datacenters(self, method, url, body, headers): - body = self.fixtures.load('_avail_datacenters.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _avail_linodeplans(self, method, url, body, headers): - body = self.fixtures.load('_avail_linodeplans.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _avail_distributions(self, method, url, body, headers): - body = self.fixtures.load('_avail_distributions.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _linode_create(self, method, url, body, headers): - body = '{"ERRORARRAY":[],"ACTION":"linode.create","DATA":{"LinodeID":8098}}' - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _linode_disk_create(self, method, url, body, headers): - body = '{"ERRORARRAY":[],"ACTION":"linode.disk.create","DATA":{"JobID":1298,"DiskID":55647}}' - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _linode_disk_delete(self, method, url, body, headers): - body = '{"ERRORARRAY":[],"ACTION":"linode.disk.delete","DATA":{"JobID":1298,"DiskID":55648}}' - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _linode_disk_createfromdistribution(self, method, url, body, headers): - body = '{"ERRORARRAY":[],"ACTION":"linode.disk.createFromDistribution","DATA":{"JobID":1298,"DiskID":55647}}' - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _linode_disk_list(self, method, url, body, headers): - body = self.fixtures.load('_linode_disk_list.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _linode_delete(self, method, url, body, headers): - body = '{"ERRORARRAY":[],"ACTION":"linode.delete","DATA":{"LinodeID":8098}}' - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _linode_update(self, method, url, body, headers): - body = '{"ERRORARRAY":[],"ACTION":"linode.update","DATA":{"LinodeID":8098}}' - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _linode_reboot(self, method, url, body, headers): - body = '{"ERRORARRAY":[],"ACTION":"linode.reboot","DATA":{"JobID":1305}}' - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _avail_kernels(self, method, url, body, headers): - body = self.fixtures.load('_avail_kernels.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _linode_boot(self, method, url, body, headers): - body = '{"ERRORARRAY":[],"ACTION":"linode.boot","DATA":{"JobID":1300}}' - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _linode_config_create(self, method, url, body, headers): - body = '{"ERRORARRAY":[],"ACTION":"linode.config.create","DATA":{"ConfigID":31239}}' - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _linode_list(self, method, url, body, headers): - body = self.fixtures.load('_linode_list.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _linode_ip_list(self, method, url, body, headers): - body = self.fixtures.load('_linode_ip_list.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _batch(self, method, url, body, headers): - body = self.fixtures.load('_batch.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_linode_v4.py b/libcloud/test/compute/test_linode_v4.py new file mode 100644 index 0000000000..bdf3d6aaed --- /dev/null +++ b/libcloud/test/compute/test_linode_v4.py @@ -0,0 +1,628 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import json +import base64 +import unittest +from datetime import datetime + +from libcloud.test import MockHttp +from libcloud.utils.py3 import httplib +from libcloud.common.types import LibcloudError, InvalidCredsError +from libcloud.compute.base import Node, KeyPair, NodeImage, NodeState, StorageVolume +from libcloud.test.compute import TestCaseMixin +from libcloud.common.linode import LinodeDisk, LinodeIPAddress, LinodeExceptionV4 +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.linode import LinodeNodeDriver, LinodeNodeDriverV4 + +EX_USERDATA = """ +#!/bin/sh + +echo "test" +exit 1 +""".strip() + + +class LinodeTestsV4(unittest.TestCase, TestCaseMixin): + should_list_volumes = True + + def setUp(self): + LinodeNodeDriver.connectionCls.conn_class = LinodeMockHttpV4 + LinodeMockHttpV4.type = None + self.driver = LinodeNodeDriver("foo", api_version="4.0") + + def test_unknown_api_version(self): + self.assertRaises(NotImplementedError, LinodeNodeDriver, "foo", api_version="2.0") + + def test_removed_api_version(self): + self.assertRaises(NotImplementedError, LinodeNodeDriver, "foo", api_version="3.0") + + def test_correct_class_is_used(self): + self.assertIsInstance(self.driver, LinodeNodeDriverV4) + + def test_list_sizes(self): + sizes = self.driver.list_sizes() + self.assertEqual(len(sizes), 28) + size = sizes[0] + self.assertEqual(size.id, "g6-nanode-1") + for size in sizes: + self.assertIsInstance(size.price, float) + if size.extra["class"] == "gpu": + self.assertGreater(size.extra["gpus"], 0) + else: + self.assertEqual(size.extra["gpus"], 0) + + def test_list_images(self): + images = self.driver.list_images() + self.assertEqual(len(images), 34) + image = images[0] + self.assertEqual(image.id, "linode/alpine3.10") + self.assertEqual(image.extra["type"], "manual") + self.assertEqual(image.extra["vendor"], "Alpine") + for image in images: + self.assertIsInstance(image.extra["size"], int) + self.assertTrue(image.extra["is_public"]) + + def test_list_key_pairs(self): + keypairs = self.driver.list_key_pairs() + self.assertIsInstance(keypairs, list) + self.assertEqual(len(keypairs), 1) + self.assertEqual(keypairs[0].extra["id"], 42) + + def test_create_key_pair(self): + keypair = self.driver.create_key_pair( + "mykey", public_key="ssh-rsa AAAA_valid_public_ssh_key_123456785== user@their-computer" + ) + self.assertIsInstance(keypair, KeyPair) + self.assertEqual(keypair.extra["id"], 42) + + def test_list_locations(self): + locations = self.driver.list_locations() + self.assertEqual(len(locations), 10) + location = locations[0] + self.assertEqual(location.country, "IN") + self.assertEqual(location.id, "ap-west") + self.assertEqual(location.extra["status"], "ok") + self.assertIsInstance(location.extra["capabilities"], list) + + def test_create_node_response(self): + size = self.driver.list_sizes()[0] + image = self.driver.list_images()[0] + location = self.driver.list_locations()[0] + node = self.driver.create_node( + "node-name", + size=size, + image=image, + location=location, + root_pass="test123456", + ) + self.assertTrue(isinstance(node, Node)) + + def test_create_node_with_ex_userdata(self): + size = self.driver.list_sizes()[0] + image = self.driver.list_images()[0] + location = self.driver.list_locations()[0] + + LinodeMockHttpV4.type = "EX_USERDATA" + + node = self.driver.create_node( + "node-name", + size=size, + image=image, + location=location, + root_pass="test123456", + ex_userdata=EX_USERDATA, + ) + self.assertTrue(isinstance(node, Node)) + + def test_list_nodes(self): + nodes = self.driver.list_nodes() + self.assertEqual(len(nodes), 2) + node = nodes[0] + node_2 = nodes[1] + self.assertEqual(node.id, "22344420") + self.assertEqual(node.public_ips, ["138.89.34.81"]) + self.assertEqual(node.private_ips, ["192.168.1.230"]) + self.assertEqual(node.extra["hypervisor"], "kvm") + self.assertEqual(node_2.public_ips, ["156.12.197.243"]) + self.assertEqual(node_2.private_ips, []) + + def test_list_nodes_UNAUTHORIZED(self): + LinodeMockHttpV4.type = "UNAUTHORIZED" + with self.assertRaises(InvalidCredsError): + self.driver.list_nodes() + + def test_list_nodes_fills_datetime(self): + nodes = self.driver.list_nodes() + self.assertEqual(nodes[0].created_at, datetime(2020, 10, 8, 18, 51, 29)) + + def test_create_node(self): + image = self.driver.list_images()[0] + size = self.driver.list_sizes()[0] + location = self.driver.list_locations()[0] + + node = self.driver.create_node( + "TestNode", + size, + image=image, + location=location, + root_pass="test123456", + ex_backups_enabled=True, + ex_tags=["testing123"], + ex_private_ip=True, + ) + + self.assertEqual(node.name, "TestNode") + self.assertEqual(len(node.private_ips), 1) + self.assertTrue(node.extra["backups"]["enabled"]) + self.assertEqual(node.extra["tags"], ["testing123"]) + + def test_create_node_no_root_pass(self): + image = self.driver.list_images()[0] + size = self.driver.list_sizes()[0] + location = self.driver.list_locations()[0] + + with self.assertRaises(LinodeExceptionV4): + self.driver.create_node("TestNode", size, image=image, location=location) + + def test_create_node_no_image(self): + size = self.driver.list_sizes()[0] + location = self.driver.list_locations()[0] + LinodeMockHttpV4.type = "NO_IMAGE" + node = self.driver.create_node( + "TestNode", size, None, location=location, ex_tags=["testing123"] + ) + + self.assertIsNone(node.image) + self.assertEqual(node.name, "TestNode") + self.assertFalse(node.extra["backups"]["enabled"]) + self.assertEqual(node.extra["tags"], ["testing123"]) + self.assertEqual(len(node.private_ips), 0) + + def test_create_node_invalid_name(self): + size = self.driver.list_sizes()[0] + location = self.driver.list_locations()[0] + + with self.assertRaises(LinodeExceptionV4): + self.driver.create_node(location, "Test__Node", size, None) + with self.assertRaises(LinodeExceptionV4): + self.driver.create_node(location, "Test Node", size, None) + with self.assertRaises(LinodeExceptionV4): + self.driver.create_node(location, "Test--Node", size, None) + with self.assertRaises(LinodeExceptionV4): + self.driver.create_node(location, "Test..Node", size, None) + + def test_reboot_node(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + result = self.driver.reboot_node(node) + self.assertTrue(result) + + def test_start_node(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + result = self.driver.start_node(node) + self.assertTrue(result) + + def test_start_node_error(self): + LinodeMockHttpV4.type = "ALREADY_BOOTED" + node = Node("22344420", None, NodeState.RUNNING, None, None, driver=self.driver) + with self.assertRaises(LibcloudError): + self.driver.start_node(node) + + def test_stop_node(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + result = self.driver.stop_node(node) + self.assertTrue(result) + + def test_destroy_node(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + result = self.driver.stop_node(node) + self.assertTrue(result) + + def test_ex_rename_node(self): + node = Node("22344420", "name1", None, None, None, driver=self.driver) + renamed_node = self.driver.ex_rename_node(node, "new_name") + self.assertEqual(renamed_node.name, "new_name") + + def test_ex_resize_node(self): + node = Node("22344420", None, None, None, None, driver=self.driver, size="g6-nanode-1") + size = self.driver.list_sizes()[0] + result = self.driver.ex_resize_node(node, size=size) + self.assertTrue(result) + + def test_ex_get_node(self): + node_id = "22344420" + node = self.driver.ex_get_node(node_id) + self.assertEqual(node.name, "test_2") + self.assertEqual(node.image, "linode/centos8") + self.assertEqual(node.extra["tags"], ["testing"]) + self.assertEqual(node.public_ips, ["212.71.239.24"]) + self.assertEqual(node.extra["hypervisor"], "kvm") + + def test_ex_list_disks(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + disks = self.driver.ex_list_disks(node) + disk = disks[0] + self.assertEqual(disk.name, "CentOS 7 Disk") + self.assertEqual(disk.size, 25088) + for disk in disks: + self.assertIsInstance(disk, LinodeDisk) + + def test_ex_create_disk(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + image = self.driver.list_images()[0] + disk = self.driver.ex_create_disk( + 5000, "TestDisk", node, "ext4", image=image, ex_root_pass="testing123" + ) + self.assertIsInstance(disk, LinodeDisk) + self.assertEqual(disk.size, 5000) + self.assertEqual(disk.filesystem, "ext4") + self.assertEqual(disk.name, "TestingDisk") + + def test_ex_create_disk_no_image(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + disk = self.driver.ex_create_disk(5000, "TestDisk", node, "ext4") + self.assertIsInstance(disk, LinodeDisk) + self.assertEqual(disk.size, 5000) + self.assertEqual(disk.filesystem, "ext4") + self.assertEqual(disk.name, "TestingDisk") + + def test_ex_create_disk_exception_no_root_pass(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + image = self.driver.list_images()[0] + with self.assertRaises(LinodeExceptionV4): + self.driver.ex_create_disk(5000, "TestDisk", node, "ext4", image=image) + + def test_ex_create_disk_exception_invalid_fs(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + image = self.driver.list_images()[0] + with self.assertRaises(LinodeExceptionV4): + self.driver.ex_create_disk( + 5000, + "TestDisk", + node, + "random_fs", + image=image, + ex_root_pass="testing123", + ) + + def test_ex_destroy_disk(self): + node = Node("22344420", None, NodeState.STOPPED, None, None, driver=self.driver) + disk = LinodeDisk("23517413", None, None, None, self.driver, None) + result = self.driver.ex_destroy_disk(node, disk) + self.assertTrue(result) + + def test_ex_destroy_disk_exception(self): + node = Node("22344420", None, NodeState.RUNNING, None, None, driver=self.driver) + disk = LinodeDisk("23517413", None, None, None, self.driver, None) + with self.assertRaises(LinodeExceptionV4): + self.driver.ex_destroy_disk(node, disk) + + def test_list_volumes(self): + volumes = self.driver.list_volumes() + self.assertEqual(len(volumes), 2) + volume = volumes[0] + volume_2 = volumes[1] + self.assertEqual(volume.id, "12345") + self.assertEqual(volume.name, "Testvolume1") + self.assertEqual(volume.size, 100) + self.assertEqual(volume.extra["linode_id"], 456353688) + self.assertIsNone(volume_2.extra["linode_id"]) + + def test_create_volume(self): + node = Node("22344420", None, NodeState.RUNNING, None, None, driver=self.driver) + volume = self.driver.create_volume(50, "Volume1", node=node, tags=["test123", "testing"]) + + self.assertEqual(volume.extra["linode_id"], 22344420) + self.assertEqual(volume.size, 50) + self.assertEqual(volume.name, "Volume1") + self.assertEqual(volume.extra["tags"], ["test123", "testing"]) + + def test_create_volume_unattached(self): + location = self.driver.list_locations()[0] + LinodeMockHttpV4.type = "UNATTACHED" + volume = self.driver.create_volume( + 50, "Volume1", location=location, tags=["test123", "testing"] + ) + + self.assertEqual(volume.size, 50) + self.assertEqual(volume.name, "Volume1") + self.assertEqual(volume.extra["tags"], ["test123", "testing"]) + + def test_create_volume_invalid_name(self): + location = self.driver.list_locations()[0] + with self.assertRaises(LinodeExceptionV4): + self.driver.create_volume(50, "Volume__1", location=location) + with self.assertRaises(LinodeExceptionV4): + self.driver.create_volume(50, "Volume 1", location=location) + with self.assertRaises(LinodeExceptionV4): + self.driver.create_volume(50, "Volume--1", location=location) + + def test_attach_volume_already_attached(self): + volume = self.driver.list_volumes()[0] + node = self.driver.list_nodes()[0] + with self.assertRaises(LinodeExceptionV4): + self.driver.attach_volume(node, volume) + + def test_attach_volume(self): + volume = self.driver.list_volumes()[1] + node = self.driver.list_nodes()[0] + attached_volume = self.driver.attach_volume(node, volume) + self.assertIsInstance(attached_volume, StorageVolume) + self.assertEqual(str(attached_volume.extra["linode_id"]), node.id) + + def test_detach_volume(self): + volume = self.driver.list_volumes()[0] + result = self.driver.detach_volume(volume) + self.assertTrue(result) + + def test_detach_volume_already_detached(self): + volume = self.driver.list_volumes()[1] + with self.assertRaises(LinodeExceptionV4): + self.driver.detach_volume(volume) + + def test_destroy_volume(self): + volume = self.driver.list_volumes()[1] + result = self.driver.destroy_volume(volume) + self.assertTrue(result) + + def test_destroy_volume_attached(self): + volume = self.driver.list_volumes()[0] + with self.assertRaises(LinodeExceptionV4): + self.driver.destroy_volume(volume) + + def test_ex_resize_volume(self): + volume = self.driver.list_volumes()[0] + size = 200 + result = self.driver.ex_resize_volume(volume, size) + self.assertTrue(result) + + def test_ex_resize_volume_resize_down(self): + volume = self.driver.list_volumes()[0] + size = 50 + with self.assertRaises(LinodeExceptionV4): + self.driver.ex_resize_volume(volume, size) + + def test_ex_clone_volume(self): + volume = self.driver.list_volumes()[0] + cloned_volume = self.driver.ex_clone_volume(volume, "TestingClone") + self.assertIsInstance(cloned_volume, StorageVolume) + self.assertEqual(volume.size, cloned_volume.size) + self.assertEqual(cloned_volume.name, "TestingClone") + + def test_ex_get_volume(self): + volume_id = "123456" + volume = self.driver.ex_get_volume(volume_id) + + self.assertEqual(volume.name, "Testvolume1") + self.assertEqual(volume.size, 10) + self.assertEqual(volume.extra["linode_id"], 456353688) + + def test_create_image(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + image = self.driver.create_image(node, name="Test", description="Test Image") + self.assertIsInstance(image, NodeImage) + self.assertEqual(image.name, "Test") + self.assertEqual(image.extra["description"], "Test Image") + + def test_ex_get_primary_disk(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + disk = self.driver.ex_get_primary_disk(node) + self.assertIsInstance(disk, LinodeDisk) + self.assertEqual(disk.id, "23517413") + + def test_delete_image(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + image = self.driver.create_image(node, name="Test", description="Test Image") + result = self.driver.delete_image(image) + self.assertTrue(result) + + def test_ex_list_addresses(self): + ips = self.driver.ex_list_addresses() + self.assertEqual(len(ips), 3) + ip = ips[0] + self.assertEqual(ip.inet, "192.168.15.21") + self.assertEqual(ip.version, "ipv4") + self.assertFalse(ip.public) + for ip in ips: + self.assertIsInstance(ip, LinodeIPAddress) + + def test_ex_list_node_addresses(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + ips = self.driver.ex_list_node_addresses(node) + ip = ips[0] + self.assertEqual(ip.inet, "176.58.100.100") + self.assertEqual(ip.version, "ipv4") + self.assertTrue(ip.public) + for ip in ips: + self.assertIsInstance(ip, LinodeIPAddress) + self.assertEqual(node.id, str(ip.extra["node_id"])) + + def test_ex_allocate_private_address(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + ip = self.driver.ex_allocate_private_address(node) + self.assertIsInstance(ip, LinodeIPAddress) + self.assertEqual(ip.version, "ipv4") + self.assertEqual(ip.inet, "192.168.100.10") + + def test_ex_share_address(self): + node = Node("22344420", None, None, None, None, driver=self.driver) + ips = self.driver.ex_list_addresses() + result = self.driver.ex_share_address(node, ips) + self.assertTrue(result) + + def test__paginated_request_two_pages(self): + LinodeMockHttpV4.type = "PAGINATED" + images = self.driver.list_images() + self.assertEqual(len(images), 34) + + +class LinodeMockHttpV4(MockHttp, unittest.TestCase): + fixtures = ComputeFileFixtures("linode_v4") + + def _v4_profile_sshkeys(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_key_pairs.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "POST": + body = self.fixtures.load("create_key_pair.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_regions(self, method, url, body, headers): + body = self.fixtures.load("list_locations.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_images(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_images.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "POST": + body = self.fixtures.load("create_image.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_images_PAGINATED(self, method, url, body, headers): + if "page=2" not in url: + body = self.fixtures.load("list_images_paginated_page_1.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + body = self.fixtures.load("list_images_paginated_page_2.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_types(self, method, url, body, headers): + body = self.fixtures.load("list_types.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_instances(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_nodes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "POST": + body = self.fixtures.load("create_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_instances_EX_USERDATA(self, method, url, body, headers): + if method == "POST": + body = json.loads(body) + self.assertTrue("metadata" in body) + self.assertTrue("user_data" in body["metadata"]) + body_userdata_decoded = base64.b64decode(body["metadata"]["user_data"]).decode("utf-8") + self.assertEqual(body_userdata_decoded, EX_USERDATA) + + body = self.fixtures.load("create_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_instances_NO_IMAGE(self, method, url, body, headers): + body = self.fixtures.load("create_node_no_image.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_instances_UNAUTHORIZED(self, method, url, body, headers): + body = '{"errors": [{"reason": "Invalid Token"}]}' + return (httplib.UNAUTHORIZED, body, {}, httplib.responses[httplib.UNAUTHORIZED]) + + def _v4_linode_instances_22344420_reboot(self, method, url, body, headers): + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_instances_22344420_boot(self, method, url, body, headers): + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_instances_22344420_boot_ALREADY_BOOTED(self, method, url, body, headers): + body = '{"errors": [{"reason": "Linode 22344420 already booted."}]}' + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.BAD_REQUEST]) + + def _v4_linode_instances_22344420_shutdown(self, method, url, body, headers): + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_instances_22344420(self, method, url, body, headers): + if method == "DELETE": + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "PUT": + body = self.fixtures.load("ex_rename_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "GET": + body = self.fixtures.load("ex_get_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_instances_22344420_resize(self, method, url, body, headers): + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_instances_22344420_disks(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_disks.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "POST": + body = self.fixtures.load("create_disk.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_instances_22344420_configs(self, method, url, body, headers): + body = self.fixtures.load("list_configs.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_instances_22344420_disks_23517413(self, method, url, body, headers): + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_volumes(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_volumes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "POST": + body = self.fixtures.load("create_volume.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_volumes_UNATTACHED(self, method, url, body, headers): + body = self.fixtures.load("create_volume_unattached.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_volumes_123456_attach(self, method, url, body, headers): + body = self.fixtures.load("attach_volume_to_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_volumes_12345_detach(self, method, url, body, headers): + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_volumes_123456(self, method, url, body, headers): + if method == "DELETE": + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "GET": + body = self.fixtures.load("ex_get_volume.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_volumes_12345_resize(self, method, url, body, headers): + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_volumes_12345_clone(self, method, url, body, headers): + body = self.fixtures.load("clone_volume.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_images_private_12345(self, method, url, body, headers): + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_networking_ips(self, method, url, body, headers): + body = self.fixtures.load("list_addresses.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_linode_instances_22344420_ips(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_addresses_for_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "POST": + body = self.fixtures.load("allocate_private_address.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v4_networking_ipv4_share(self, method, url, body, headers): + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_maxihost.py b/libcloud/test/compute/test_maxihost.py new file mode 100644 index 0000000000..ff2d722670 --- /dev/null +++ b/libcloud/test/compute/test_maxihost.py @@ -0,0 +1,120 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest + +from libcloud.test import MockHttp +from libcloud.utils.py3 import httplib +from libcloud.compute.base import Node +from libcloud.test.compute import TestCaseMixin +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.maxihost import MaxihostNodeDriver + + +class MaxihostTest(unittest.TestCase, TestCaseMixin): + def setUp(self): + MaxihostNodeDriver.connectionCls.conn_class = MaxihostMockHttp + self.driver = MaxihostNodeDriver("foo") + + def test_list_sizes(self): + sizes = self.driver.list_sizes() + self.assertEqual(len(sizes), 1) + + def test_list_locations(self): + locations = self.driver.list_locations() + self.assertEqual(len(locations), 3) + + def test_list_images(self): + images = self.driver.list_images() + self.assertEqual(len(images), 1) + image = images[0] + self.assertEqual(image.id, "ubuntu_18_04_x64_lts") + + def test_list_key_pairs(self): + keys = self.driver.list_key_pairs() + self.assertEqual(len(keys), 1) + key = keys[0] + self.assertEqual(key.name, "test_key") + self.assertEqual(key.fingerprint, "77:08:a7:a5:f9:8c:e1:ab:7b:c3:d8:0c:cd:ac:8b:dd") + + def test_create_key_pair_requires_public_key(self): + with self.assertRaisesRegex(ValueError, "public_key is required"): + self.driver.create_key_pair(name="test-key") + + def test_list_nodes(self): + nodes = self.driver.list_nodes() + self.assertEqual(len(nodes), 1) + node = nodes[0] + self.assertEqual(node.name, "tester") + + def test_create_node_response(self): + # should return a node object + size = self.driver.list_sizes()[0] + image = self.driver.list_images()[0] + location = self.driver.list_locations()[0] + node = self.driver.create_node(name="node-name", image=image, size=size, location=location) + self.assertTrue(isinstance(node, Node)) + + def test_create_node_requires_location(self): + size = self.driver.list_sizes()[0] + image = self.driver.list_images()[0] + + with self.assertRaisesRegex(ValueError, "location is required"): + self.driver.create_node(name="node-name", image=image, size=size) + + def test_destroy_node_response(self): + node = self.driver.list_nodes()[0] + ret = self.driver.destroy_node(node) + self.assertTrue(ret) + + +class MaxihostMockHttp(MockHttp): + fixtures = ComputeFileFixtures("maxihost") + + def _plans(self, method, url, body, headers): + body = self.fixtures.load("plans.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _regions(self, method, url, body, headers): + body = self.fixtures.load("regions.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _plans_operating_systems(self, method, url, body, headers): + body = self.fixtures.load("images.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _devices(self, method, url, body, headers): + body = self.fixtures.load("nodes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _devices_1319(self, method, url, body, headers): + if method == "DELETE": + body = "{}" + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + raise ValueError("Unsupported method: %s" % (method)) + + def _devices_1319_actions(self, method, url, body, headers): + body = self.fixtures.load("node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _account_keys(self, method, url, body, headers): + body = self.fixtures.load("keys.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_nephoscale.py b/libcloud/test/compute/test_nephoscale.py deleted file mode 100644 index 0a0af0add8..0000000000 --- a/libcloud/test/compute/test_nephoscale.py +++ /dev/null @@ -1,188 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Created by Markos Gogoulos (https://mist.io) -# - -import sys -import unittest -from libcloud.utils.py3 import httplib - -from libcloud.compute.drivers.nephoscale import NephoscaleNodeDriver - -from libcloud.test import MockHttp -from libcloud.test.compute import TestCaseMixin -from libcloud.test.file_fixtures import ComputeFileFixtures - - -class NephoScaleTest(unittest.TestCase, TestCaseMixin): - - def setUp(self): - NephoscaleNodeDriver.connectionCls.conn_classes = ( - NephoscaleMockHttp, NephoscaleMockHttp) - self.driver = NephoscaleNodeDriver('user', 'password') - - def test_list_sizes(self): - sizes = self.driver.list_sizes() - self.assertEqual(len(sizes), 13) - for size in sizes: - self.assertEqual(type(size.disk), int) - self.assertEqual(type(size.ram), int) - - def test_list_images(self): - images = self.driver.list_images() - self.assertEqual(len(images), 18) - for image in images: - arch = image.extra.get('architecture') - self.assertTrue(arch.startswith('x86')) - - def test_list_locations(self): - locations = self.driver.list_locations() - self.assertEqual(len(locations), 2) - self.assertEqual(locations[0].name, "SJC-1") - - def test_list_nodes(self): - nodes = self.driver.list_nodes() - self.assertEqual(len(nodes), 2) - self.assertEqual(nodes[0].extra.get('zone'), 'RIC-1') - self.assertEqual(nodes[0].name, 'mongodb-staging') - self.assertEqual(nodes[0].extra.get('service_type'), - 'CS05 - 0.5GB, 1Core, 25GB') - - def test_list_keys(self): - keys = self.driver.ex_list_keypairs() - self.assertEqual(len(keys), 2) - self.assertEqual(keys[0].name, 'mistio-ssh') - - def test_list_ssh_keys(self): - ssh_keys = self.driver.ex_list_keypairs(ssh=True) - self.assertEqual(len(ssh_keys), 1) - self.assertTrue(ssh_keys[0].public_key.startswith('ssh-rsa')) - - def test_list_password_keys(self): - password_keys = self.driver.ex_list_keypairs(password=True) - self.assertEqual(len(password_keys), 1) - self.assertEqual(password_keys[0].password, '23d493j5') - - def test_reboot_node(self): - node = self.driver.list_nodes()[0] - result = self.driver.reboot_node(node) - self.assertTrue(result) - - def test_destroy_node(self): - node = self.driver.list_nodes()[0] - result = self.driver.destroy_node(node) - self.assertTrue(result) - - def test_stop_node(self): - node = self.driver.list_nodes()[0] - result = self.driver.ex_stop_node(node) - self.assertTrue(result) - - def test_start_node(self): - node = self.driver.list_nodes()[0] - result = self.driver.ex_start_node(node) - self.assertTrue(result) - - def test_rename_node(self): - node = self.driver.list_nodes()[0] - result = self.driver.rename_node(node, 'new-name') - self.assertTrue(result) - - def test_create_node(self): - name = 'mongodb-staging' - size = self.driver.list_sizes()[0] - image = self.driver.list_images()[3] - node = self.driver.create_node(name=name, - size=size, - nowait=True, - image=image) - self.assertEqual(node.name, 'mongodb-staging') - - def test_create_node_no_name(self): - size = self.driver.list_sizes()[0] - image = self.driver.list_images()[3] - self.assertRaises(TypeError, self.driver.create_node, size=size, - image=image) - - def test_delete_ssh_keys(self): - self.assertTrue(self.driver.ex_delete_keypair(key_id=72209, ssh=True)) - - def test_delete_password_keys(self): - self.assertTrue(self.driver.ex_delete_keypair(key_id=72211)) - - -class NephoscaleMockHttp(MockHttp): - fixtures = ComputeFileFixtures('nephoscale') - - def _server_type_cloud(self, method, url, body, headers): - body = self.fixtures.load('list_sizes.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _server_cloud(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('success_action.json') - else: - body = self.fixtures.load('list_nodes.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _image_server(self, method, url, body, headers): - body = self.fixtures.load('list_images.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _datacenter_zone(self, method, url, body, headers): - body = self.fixtures.load('list_locations.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _key(self, method, url, body, headers): - body = self.fixtures.load('list_keys.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _key_sshrsa(self, method, url, body, headers): - body = self.fixtures.load('list_ssh_keys.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _key_password(self, method, url, body, headers): - body = self.fixtures.load('list_password_keys.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _server_cloud_88241(self, method, url, body, headers): - body = self.fixtures.load('success_action.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _server_cloud_88241_initiator_restart(self, method, url, body, - headers): - body = self.fixtures.load('success_action.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _server_cloud_88241_initiator_start(self, method, url, body, headers): - body = self.fixtures.load('success_action.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _server_cloud_88241_initiator_stop(self, method, url, body, headers): - body = self.fixtures.load('success_action.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _key_password_72211(self, method, url, body, headers): - body = self.fixtures.load('success_action.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _key_sshrsa_72209(self, method, url, body, headers): - body = self.fixtures.load('success_action.json') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_ntta.py b/libcloud/test/compute/test_ntta.py new file mode 100644 index 0000000000..39b305ab30 --- /dev/null +++ b/libcloud/test/compute/test_ntta.py @@ -0,0 +1,30 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import unittest + +from libcloud.compute.drivers.ntta import NTTAmericaNodeDriver +from libcloud.test.compute.test_dimensiondata_v2_3 import ( + DimensionDataMockHttp, + DimensionData_v2_3_Tests, +) + + +class NTTAmericaNodeDriverTests(DimensionData_v2_3_Tests, unittest.TestCase): + def setUp(self): + NTTAmericaNodeDriver.connectionCls.conn_class = DimensionDataMockHttp + NTTAmericaNodeDriver.connectionCls.active_api_version = "2.3" + DimensionDataMockHttp.type = None + self.driver = NTTAmericaNodeDriver("user", "password") diff --git a/libcloud/test/compute/test_nttcis.py b/libcloud/test/compute/test_nttcis.py new file mode 100644 index 0000000000..f1788a0d8d --- /dev/null +++ b/libcloud/test/compute/test_nttcis.py @@ -0,0 +1,3527 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest +from types import GeneratorType + +import pytest + +from libcloud.test import MockHttp +from libcloud.utils.py3 import ET, httplib +from libcloud.utils.xml import findall, findtext, fixxpath +from libcloud.common.types import InvalidCredsError +from libcloud.compute.base import Node, NodeLocation, NodeAuthPassword +from libcloud.test.secrets import NTTCIS_PARAMS +from libcloud.common.nttcis import ( + TYPES_URN, + NttCisTag, + ClassFactory, + NttCisTagKey, + NttCisServerDisk, + NttCisAPIException, + NttCisServerVMWareTools, + NetworkDomainServicePlan, + NttCisServerCpuSpecification, +) +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.nttcis import NttCisNic +from libcloud.compute.drivers.nttcis import NttCisNodeDriver as NttCis + + +@pytest.fixture() +def driver(): + NttCis.connectionCls.active_api_version = "2.7" + NttCis.connectionCls.conn_class = NttCisMockHttp + NttCisMockHttp.type = None + driver = NttCis(*NTTCIS_PARAMS) + return driver + + +def test_auth_fails(driver): + with pytest.raises(ValueError): + NttCis(*NTTCIS_PARAMS, region="blah") + + +def test_get_account_details(driver): + NttCisMockHttp.type = None + ret = driver.connection.get_account_details() + assert ret.full_name == "Test User" + assert ret.first_name == "Test" + assert ret.email == "test@example.com" + + +def test_invalid_creds(driver): + NttCisMockHttp.type = "UNAUTHORIZED" + with pytest.raises(InvalidCredsError): + driver.list_nodes() + + +def test_list_locations_response(driver): + NttCisMockHttp.type = None + ret = driver.list_locations() + assert len(ret) == 5 + first_loc = ret[0] + assert first_loc.id == "NA3" + assert first_loc.name == "US - West" + assert first_loc.country == "US" + + +def test_list_nodes_response(driver): + NttCisMockHttp.type = None + ret = driver.list_nodes() + assert len(ret) == 7 + + +def test_node_extras(driver): + NttCisMockHttp.type = None + ret = driver.list_nodes() + assert isinstance(ret[0].extra["vmWareTools"], NttCisServerVMWareTools) + assert isinstance(ret[0].extra["cpu"], NttCisServerCpuSpecification) + assert isinstance(ret[0].extra["disks"], list) + assert isinstance(ret[0].extra["disks"][0], NttCisServerDisk) + assert ret[0].extra["disks"][0].size_gb, 10 + assert isinstance(ret[1].extra["disks"], list) + assert isinstance(ret[1].extra["disks"][0], NttCisServerDisk) + assert ret[1].extra["disks"][0].size_gb, 10 + + +def test_server_states(driver): + NttCisMockHttp.type = None + ret = driver.list_nodes() + assert ret[0].state == "running" + assert ret[1].state == "starting" + assert ret[2].state == "stopping" + assert ret[3].state == "reconfiguring" + assert ret[4].state == "running" + assert ret[5].state == "terminated" + assert ret[6].state == "stopped" + assert len(ret) == 7 + + +def test_list_nodes_response_PAGINATED(driver): + NttCisMockHttp.type = "PAGINATED" + ret = driver.list_nodes() + assert len(ret) == 7 + + +def test_paginated_mcp2_call_EMPTY(driver): + # cache org + driver.connection._get_orgId() + NttCisMockHttp.type = "EMPTY" + node_list_generator = driver.connection.paginated_request_with_orgId_api_2("server/server") + empty_node_list = [] + for node_list in node_list_generator: + empty_node_list.extend(node_list) + assert len(empty_node_list) == 0 + + +def test_paginated_mcp2_call_PAGED_THEN_EMPTY(driver): + # cache org + driver.connection._get_orgId() + NttCisMockHttp.type = "PAGED_THEN_EMPTY" + node_list_generator = driver.connection.paginated_request_with_orgId_api_2("server/server") + final_node_list = [] + for node_list in node_list_generator: + final_node_list.extend(node_list) + assert len(final_node_list) == 2 + + +def test_paginated_mcp2_call_with_page_size(driver): + # cache org + driver.connection._get_orgId() + NttCisMockHttp.type = "PAGESIZE50" + node_list_generator = driver.connection.paginated_request_with_orgId_api_2( + "server/server", page_size=50 + ) + assert isinstance(node_list_generator, GeneratorType) + + +# We're making sure here the filters make it to the URL +# See _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_ALLFILTERS for asserts +def test_list_nodes_response_strings_ALLFILTERS(driver): + NttCisMockHttp.type = "ALLFILTERS" + ret = driver.list_nodes( + ex_location="fake_loc", + ex_name="fake_name", + ex_ipv6="fake_ipv6", + ex_ipv4="fake_ipv4", + ex_vlan="fake_vlan", + ex_image="fake_image", + ex_deployed=True, + ex_started=True, + ex_state="fake_state", + ex_network_domain="fake_network_domain", + ) + assert isinstance(ret, list) + assert len(ret) == 7 + + node = ret[3] + assert isinstance(node.extra["disks"], list) + assert isinstance(node.extra["disks"][0], NttCisServerDisk) + assert node.image.id == "3ebf3c0f-90fe-4a8b-8585-6e65b316592c" + assert node.image.name == "WIN2008S/32" + disk = node.extra["disks"][0] + assert disk.id == "c2e1f199-116e-4dbc-9960-68720b832b0a" + assert disk.scsi_id == 0 + assert disk.size_gb == 50 + assert disk.speed == "STANDARD" + assert disk.state == "NORMAL" + + +def test_list_nodes_response_LOCATION(driver): + NttCisMockHttp.type = None + ret = driver.list_locations() + first_loc = ret[0] + ret = driver.list_nodes(ex_location=first_loc) + for node in ret: + assert node.extra["datacenterId"] == "NA3" + + +def test_list_nodes_response_LOCATION_STR(driver): + NttCisMockHttp.type = None + ret = driver.list_nodes(ex_location="NA3") + for node in ret: + assert node.extra["datacenterId"] == "NA3" + + +def test_list_sizes_response(driver): + NttCisMockHttp.type = None + ret = driver.list_sizes() + assert len(ret) == 1 + size = ret[0] + assert size.name == "default" + + +def test_list_datacenter_snapshot_windows(driver): + NttCisMockHttp.type = None + ret = driver.list_snapshot_windows("f1d6a564-490e-4166-b91d-feddc1f92025", "ADVANCED") + assert isinstance(ret[0], dict) + + +def test_list_snapshots(driver): + NttCisMockHttp.type = None + snapshots = driver.list_snapshots("sdk_server_1", page_size=1) + assert len(snapshots) == 1 + assert snapshots[0]["id"] == "d11940a8-1455-43bf-a2de-b51a38c2aa94" + + +def test_enable_snapshot_service(driver): + NttCisMockHttp.type = None + window_id = "ea646520-4272-11e8-838c-180373fb68df" + node = "e1eb7d71-93c9-4b9c-807c-e05932dc8143" + result = driver.ex_enable_snapshots(node, window_id) + assert result is True + + +def test_initiate_manual_snapshot(driver): + NttCisMockHttp.type = None + result = driver.ex_initiate_manual_snapshot("test", "e1eb7d71-93c9-4b9c-807c-e05932dc8143") + assert result is True + + +def test_create_snapshot_preview_server(driver): + snapshot_id = "dd9a9e7e-2de7-4543-adef-bb1fda7ac030" + server_name = "test_snapshot" + start = "true" + nic_connected = "true" + result = driver.ex_create_snapshot_preview_server( + snapshot_id, server_name, start, nic_connected + ) + assert result is True + + +def test_disable_node_snapshot(driver): + node = "e1eb7d71-93c9-4b9c-807c-e05932dc8143" + assert driver.ex_disable_snapshots(node) is True + + +def test_reboot_node_response(driver): + node = Node(id="11", name=None, state=None, public_ips=None, private_ips=None, driver=driver) + ret = node.reboot() + assert ret is True + + +def test_reboot_node_response_INPROGRESS(driver): + NttCisMockHttp.type = "INPROGRESS" + node = Node(id="11", name=None, state=None, public_ips=None, private_ips=None, driver=driver) + with pytest.raises(NttCisAPIException): + node.reboot() + + +def test_destroy_node_response(driver): + node = Node(id="11", name=None, state=None, public_ips=None, private_ips=None, driver=driver) + ret = node.destroy() + assert ret is True + + +def test_destroy_node_response_RESOURCE_BUSY(driver): + NttCisMockHttp.type = "INPROGRESS" + node = Node(id="11", name=None, state=None, public_ips=None, private_ips=None, driver=driver) + with pytest.raises(NttCisAPIException): + node.destroy() + + +def test_list_images(driver): + images = driver.list_images() + assert len(images) == 3 + assert images[0].name == "RedHat 6 64-bit 2 CPU" + assert images[0].id == "c14b1a46-2428-44c1-9c1a-b20e6418d08c" + assert images[0].extra["location"].id == "NA9" + assert images[0].extra["cpu"].cpu_count == 2 + assert images[0].extra["OS_displayName"] == "REDHAT6/64" + + +def test_clean_failed_deployment_response_with_node(driver): + node = Node(id="11", name=None, state=None, public_ips=None, private_ips=None, driver=driver) + ret = driver.ex_clean_failed_deployment(node) + assert ret is True + + +def test_clean_failed_deployment_response_with_node_id(driver): + node = "e75ead52-692f-4314-8725-c8a4f4d13a87" + ret = driver.ex_clean_failed_deployment(node) + assert ret is True + + +def test_ex_list_customer_images(driver): + images = driver.ex_list_customer_images() + assert len(images) == 3 + assert images[0].name == "ImportedCustomerImage" + assert images[0].id == "5234e5c7-01de-4411-8b6e-baeb8d91cf5d" + assert images[0].extra["location"].id == "NA9" + assert images[0].extra["cpu"].cpu_count == 4 + assert images[0].extra["OS_displayName"] == "REDHAT6/64" + + +def test_create_mcp1_node_optional_param(driver): + root_pw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + network = driver.ex_list_networks()[0] + cpu_spec = NttCisServerCpuSpecification( + cpu_count="4", cores_per_socket="2", performance="STANDARD" + ) + disks = [NttCisServerDisk(scsi_id="0", speed="HIGHPERFORMANCE")] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ex_memory_gb=8, + ex_disks=disks, + ex_cpu_specification=cpu_spec, + ex_primary_dns="10.0.0.5", + ex_secondary_dns="10.0.0.6", + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_mcp1_node_response_no_pass_random_gen(driver): + image = driver.list_images()[0] + network = driver.ex_list_networks()[0] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + assert "password" in node.extra + + +def test_create_mcp1_node_response_no_pass_customer_windows(driver): + image = driver.ex_list_customer_images()[1] + network = driver.ex_list_networks()[0] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + assert "password" in node.extra + + +def test_create_mcp1_node_response_no_pass_customer_windows_STR(driver): + image = driver.ex_list_customer_images()[1].id + network = driver.ex_list_networks()[0] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + assert "password" in node.extra + + +def test_create_mcp1_node_response_no_pass_customer_linux(driver): + image = driver.ex_list_customer_images()[0] + network = driver.ex_list_networks()[0] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + assert "password" not in node.extra + + +def test_create_mcp1_node_response_no_pass_customer_linux_STR(driver): + image = driver.ex_list_customer_images()[0].id + network = driver.ex_list_networks()[0] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=None, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + assert "password" not in node.extra + + +def test_create_mcp1_node_response_STR(driver): + rootPw = "pass123" + image = driver.list_images()[0].id + network = driver.ex_list_networks()[0].id + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network=network, + ex_is_started=False, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_mcp1_node_no_network(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + with pytest.raises(InvalidRequestError): + driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network=None, + ex_is_started=False, + ) + + +def test_create_node_mcp1_ipv4(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network="fakenetwork", + ex_primary_ipv4="10.0.0.1", + ex_is_started=False, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_mcp1_network(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network="fakenetwork", + ex_is_started=False, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_response_network_domain(driver): + rootPw = NodeAuthPassword("pass123") + location = driver.ex_get_location_by_id("NA9") + image = driver.list_images(location=location)[0] + network_domain = driver.ex_list_network_domains(location=location)[0] + vlan = driver.ex_list_vlans(location=location)[0] + cpu = NttCisServerCpuSpecification( + cpu_count=4, cores_per_socket=1, performance="HIGHPERFORMANCE" + ) + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain=network_domain, + ex_vlan=vlan, + ex_is_started=False, + ex_cpu_specification=cpu, + ex_memory_gb=4, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_response_network_domain_STR(driver): + rootPw = NodeAuthPassword("pass123") + location = driver.ex_get_location_by_id("NA9") + image = driver.list_images(location=location)[0] + network_domain = driver.ex_list_network_domains(location=location)[0].id + vlan = driver.ex_list_vlans(location=location)[0].id + cpu = NttCisServerCpuSpecification( + cpu_count=4, cores_per_socket=1, performance="HIGHPERFORMANCE" + ) + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain=network_domain, + ex_vlan=vlan, + ex_is_started=False, + ex_cpu_specification=cpu, + ex_memory_gb=4, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_mcp2_vlan(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_vlan="fakevlan", + ex_is_started=False, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_mcp2_ipv4(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_ipv4="10.0.0.1", + ex_is_started=False, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_network_domain_no_vlan_or_ipv4(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + with pytest.raises(ValueError): + driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fake_network_domain", + ex_is_started=False, + ) + + +def test_create_node_response(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + node = driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_vlan="fakevlan", + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_ms_time_zone(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + node = driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_vlan="fakevlan", + ex_microsoft_time_zone="040", + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_ambigious_mcps_fail(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + with pytest.raises(ValueError): + driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_network="fakenetwork", + ex_primary_nic_vlan="fakevlan", + ) + + +def test_create_node_no_network_domain_fail(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + with pytest.raises(ValueError): + driver.create_node( + size=None, name="test3", image=image, auth=rootPw, ex_primary_nic_vlan="fakevlan" + ) + + +def test_create_node_no_primary_nic_fail(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + with pytest.raises(ValueError): + driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ) + + +def test_create_node_primary_vlan_nic(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + node = driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_vlan="fakevlan", + ex_primary_nic_network_adapter="v1000", + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_primary_ipv4(driver): + rootPw = "pass123" + image = driver.list_images()[0] + node = driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_both_primary_nic_and_vlan_fail(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + with pytest.raises(ValueError): + driver.create_node( + size=None, + name="test3", + image=image, + auth=rootPw, + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_primary_nic_vlan="fakevlan", + ) + + +def test_create_node_cpu_specification(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + cpu_spec = NttCisServerCpuSpecification( + cpu_count="4", cores_per_socket="2", performance="STANDARD" + ) + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_cpu_specification=cpu_spec, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_memory(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_memory_gb=8, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_disks(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + disks = [NttCisServerDisk(scsi_id="0", speed="HIGHPERFORMANCE")] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_disks=disks, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_disks_fail(driver): + root_pw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + disks = "blah" + with pytest.raises(TypeError): + driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_disks=disks, + ) + + +def test_create_node_ipv4_gateway(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_is_started=False, + ex_ipv4_gateway="10.2.2.2", + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_network_domain_no_vlan_no_ipv4_fail(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + with pytest.raises(ValueError): + driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fake_network_domain", + ex_is_started=False, + ) + + +def test_create_node_mcp2_additional_nics_legacy(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + additional_vlans = ["fakevlan1", "fakevlan2"] + additional_ipv4 = ["10.0.0.2", "10.0.0.3"] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_ipv4="10.0.0.1", + ex_additional_nics_vlan=additional_vlans, + ex_additional_nics_ipv4=additional_ipv4, + ex_is_started=False, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_bad_additional_nics_ipv4(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + with pytest.raises(TypeError): + driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fake_network_domain", + ex_vlan="fake_vlan", + ex_additional_nics_ipv4="badstring", + ex_is_started=False, + ) + + +def test_create_node_additional_nics(driver): + root_pw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + nic1 = NttCisNic(vlan="fake_vlan", network_adapter_name="v1000") + nic2 = NttCisNic(private_ip_v4="10.1.1.2", network_adapter_name="v1000") + additional_nics = [nic1, nic2] + + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_additional_nics=additional_nics, + ex_is_started=False, + ) + + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_create_node_additional_nics_vlan_ipv4_coexist_fail(driver): + root_pw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + nic1 = NttCisNic(private_ip_v4="10.1.1.1", vlan="fake_vlan", network_adapter_name="v1000") + nic2 = NttCisNic(private_ip_v4="10.1.1.2", vlan="fake_vlan2", network_adapter_name="v1000") + additional_nics = [nic1, nic2] + with pytest.raises(ValueError): + driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_additional_nics=additional_nics, + ex_is_started=False, + ) + + +def test_create_node_additional_nics_invalid_input_fail(driver): + root_pw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + additional_nics = "blah" + with pytest.raises(TypeError): + driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_additional_nics=additional_nics, + ex_is_started=False, + ) + + +def test_create_node_additional_nics_vlan_ipv4_not_exist_fail(driver): + root_pw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + nic1 = NttCisNic(network_adapter_name="v1000") + nic2 = NttCisNic(network_adapter_name="v1000") + additional_nics = [nic1, nic2] + with pytest.raises(ValueError): + driver.create_node( + size=None, + name="test2", + image=image, + auth=root_pw, + ex_description="test2 node", + ex_network_domain="fakenetworkdomain", + ex_primary_nic_private_ipv4="10.0.0.1", + ex_additional_nics=additional_nics, + ex_is_started=False, + ) + + +def test_create_node_bad_additional_nics_vlan(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + with pytest.raises(TypeError): + driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test2 node", + ex_network_domain="fake_network_domain", + ex_vlan="fake_vlan", + ex_additional_nics_vlan="badstring", + ex_is_started=False, + ) + + +def test_create_node_mcp2_indicate_dns(driver): + rootPw = NodeAuthPassword("pass123") + image = driver.list_images()[0] + node = driver.create_node( + size=None, + name="test2", + image=image, + auth=rootPw, + ex_description="test node dns", + ex_network_domain="fakenetworkdomain", + ex_primary_ipv4="10.0.0.1", + ex_primary_dns="8.8.8.8", + ex_secondary_dns="8.8.4.4", + ex_is_started=False, + ) + assert node.id == "e75ead52-692f-4314-8725-c8a4f4d13a87" + assert node.extra["status"].action == "DEPLOY_SERVER" + + +def test_ex_shutdown_graceful(driver): + node = Node(id="11", name=None, state=None, public_ips=None, private_ips=None, driver=driver) + ret = driver.ex_shutdown_graceful(node) + assert ret is True + + +def test_ex_shutdown_graceful_INPROGRESS(driver): + NttCisMockHttp.type = "INPROGRESS" + node = Node(id="11", name=None, state=None, public_ips=None, private_ips=None, driver=driver) + with pytest.raises(NttCisAPIException): + driver.ex_shutdown_graceful(node) + + +def test_ex_start_node(driver): + node = Node(id="11", name=None, state=None, public_ips=None, private_ips=None, driver=driver) + ret = driver.ex_start_node(node) + assert ret is True + + +def test_ex_start_node_INPROGRESS(driver): + NttCisMockHttp.type = "INPROGRESS" + node = Node(id="11", name=None, state=None, public_ips=None, private_ips=None, driver=driver) + with pytest.raises(NttCisAPIException): + driver.ex_start_node(node) + + +def test_ex_power_off(driver): + node = Node(id="11", name=None, state=None, public_ips=None, private_ips=None, driver=driver) + ret = driver.ex_power_off(node) + assert ret is True + + +def test_ex_update_vm_tools(driver): + node = Node(id="11", name=None, state=None, public_ips=None, private_ips=None, driver=driver) + ret = driver.ex_update_vm_tools(node) + assert ret is True + + +def test_ex_power_off_INPROGRESS(driver): + NttCisMockHttp.type = "INPROGRESS" + node = Node( + id="11", + name=None, + state="STOPPING", + public_ips=None, + private_ips=None, + driver=driver, + ) + + with pytest.raises(NttCisAPIException): + driver.ex_power_off(node) + + +def test_ex_reset(driver): + node = Node(id="11", name=None, state=None, public_ips=None, private_ips=None, driver=driver) + ret = driver.ex_reset(node) + assert ret is True + + +def test_ex_attach_node_to_vlan(driver): + node = driver.ex_get_node_by_id("e75ead52-692f-4314-8725-c8a4f4d13a87") + vlan = driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + ret = driver.ex_attach_node_to_vlan(node, vlan) + assert ret is True + + +def test_ex_destroy_nic(driver): + node = driver.ex_destroy_nic("a202e51b-41c0-4cfc-add0-b1c62fc0ecf6") + assert node is True + + +def test_ex_create_network_domain(driver): + location = driver.ex_get_location_by_id("NA9") + plan = NetworkDomainServicePlan.ADVANCED + net = driver.ex_create_network_domain( + location=location, name="test", description="test", service_plan=plan + ) + assert net.name == "test" + assert net.id == "f14a871f-9a25-470c-aef8-51e13202e1aa" + + +def test_ex_create_network_domain_NO_DESCRIPTION(driver): + location = driver.ex_get_location_by_id("NA9") + plan = NetworkDomainServicePlan.ADVANCED + net = driver.ex_create_network_domain(location=location, name="test", service_plan=plan) + assert net.name == "test" + assert net.id == "f14a871f-9a25-470c-aef8-51e13202e1aa" + + +def test_ex_get_network_domain(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + assert net.id == "8cdfd607-f429-4df6-9352-162cfc0891be" + assert net.description == "test2" + assert net.name == "test" + + +def test_ex_update_network_domain(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + net.name = "new name" + net2 = driver.ex_update_network_domain(net) + assert net2.name == "new name" + + +def test_ex_delete_network_domain(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + result = driver.ex_delete_network_domain(net) + assert result is True + + +def test_ex_list_network_domains(driver): + nets = driver.ex_list_network_domains() + assert nets[0].name == "Aurora" + assert isinstance(nets[0].location, NodeLocation) + + +def test_ex_list_network_domains_ALLFILTERS(driver): + NttCisMockHttp.type = "ALLFILTERS" + nets = driver.ex_list_network_domains( + location="fake_location", + name="fake_name", + service_plan="fake_plan", + state="fake_state", + ) + assert nets[0].name == "Aurora" + assert isinstance(nets[0].location, NodeLocation) + + +def test_ex_list_vlans(driver): + vlans = driver.ex_list_vlans() + assert vlans[0].name == "Primary" + + +def test_ex_list_vlans_ALLFILTERS(driver): + NttCisMockHttp.type = "ALLFILTERS" + vlans = driver.ex_list_vlans( + location="fake_location", + network_domain="fake_network_domain", + name="fake_name", + ipv4_address="fake_ipv4", + ipv6_address="fake_ipv6", + state="fake_state", + ) + assert vlans[0].name == "Primary" + + +def test_ex_create_vlan( + driver, +): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + vlan = driver.ex_create_vlan( + network_domain=net, + name="test", + private_ipv4_base_address="10.3.4.0", + private_ipv4_prefix_size="24", + description="test vlan", + ) + assert vlan.id == "0e56433f-d808-4669-821d-812769517ff8" + + +def test_ex_create_vlan_NO_DESCRIPTION( + driver, +): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + vlan = driver.ex_create_vlan( + network_domain=net, + name="test", + private_ipv4_base_address="10.3.4.0", + private_ipv4_prefix_size="24", + ) + assert vlan.id == "0e56433f-d808-4669-821d-812769517ff8" + + +def test_ex_get_vlan(driver): + vlan = driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + assert vlan.id == "0e56433f-d808-4669-821d-812769517ff8" + assert vlan.description == "test2" + assert vlan.status == "NORMAL" + assert vlan.name == "Production VLAN" + assert vlan.private_ipv4_range_address == "10.0.3.0" + assert vlan.private_ipv4_range_size == 24 + assert vlan.ipv6_range_size == 64 + assert vlan.ipv6_range_address == "2607:f480:1111:1153:0:0:0:0" + assert vlan.ipv4_gateway == "10.0.3.1" + assert vlan.ipv6_gateway == "2607:f480:1111:1153:0:0:0:1" + + +def test_ex_wait_for_state(driver): + driver.ex_wait_for_state( + "NORMAL", + driver.ex_get_vlan, + vlan_id="0e56433f-d808-4669-821d-812769517ff8", + poll_interval=0.1, + ) + + +def test_ex_wait_for_state_NODE(driver): + driver.ex_wait_for_state( + "running", + driver.ex_get_node_by_id, + id="e75ead52-692f-4314-8725-c8a4f4d13a87", + poll_interval=0.1, + ) + + +def test_ex_wait_for_state_FAIL(driver): + with pytest.raises(NttCisAPIException) as context: + driver.ex_wait_for_state( + "starting", + driver.ex_get_node_by_id, + id="e75ead52-692f-4314-8725-c8a4f4d13a87", + poll_interval=0.1, + timeout=0.1, + ) + assert context.value.code == "running" + assert "timed out" in context.value.msg + + +def test_ex_update_vlan(driver): + vlan = driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + vlan.name = "new name" + vlan2 = driver.ex_update_vlan(vlan) + assert vlan2.name == "new name" + + +def test_ex_delete_vlan(driver): + vlan = driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + result = driver.ex_delete_vlan(vlan) + assert result is True + + +def test_ex_expand_vlan(driver): + vlan = driver.ex_get_vlan("0e56433f-d808-4669-821d-812769517ff8") + vlan.private_ipv4_range_size = "23" + vlan = driver.ex_expand_vlan(vlan) + assert vlan.private_ipv4_range_size == "23" + + +def test_ex_add_public_ip_block_to_network_domain(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + block = driver.ex_add_public_ip_block_to_network_domain(net) + assert block.id == "9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8" + + +def test_ex_list_public_ip_blocks(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + blocks = driver.ex_list_public_ip_blocks(net) + assert blocks[0].base_ip == "168.128.4.18" + assert blocks[0].size == "2" + assert blocks[0].id == "9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8" + assert blocks[0].location.id == "NA9" + assert blocks[0].network_domain.id == net.id + + +def test_ex_get_public_ip_block(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + block = driver.ex_get_public_ip_block("9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8") + assert block.base_ip == "168.128.4.18" + assert block.size == "2" + assert block.id == "9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8" + assert block.location.id == "NA9" + assert block.network_domain.id == net.id + + +def test_ex_delete_public_ip_block(driver): + block = driver.ex_get_public_ip_block("9945dc4a-bdce-11e4-8c14-b8ca3a5d9ef8") + result = driver.ex_delete_public_ip_block(block) + assert result is True + + +def test_ex_list_firewall_rules(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = driver.ex_list_firewall_rules(net) + assert rules[0].id == "756cba02-b0bc-48f4-aea5-9445870b6148" + assert rules[0].network_domain.id == "8cdfd607-f429-4df6-9352-162cfc0891be" + assert rules[0].name == "CCDEFAULT.BlockOutboundMailIPv4" + assert rules[0].action == "DROP" + assert rules[0].ip_version, "IPV4" + assert rules[0].protocol == "TCP" + assert rules[0].source.ip_address == "ANY" + assert rules[0].source.any_ip is True + assert rules[0].destination.any_ip is True + + +def test_ex_create_firewall_rule(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = driver.ex_list_firewall_rules(net) + rule = driver.ex_create_firewall_rule( + net, + rules[0].name, + rules[0].action, + rules[0].ip_version, + rules[0].protocol, + rules[0].source, + rules[0].destination, + "FIRST", + ) + assert rule.id == "d0a20f59-77b9-4f28-a63b-e58496b73a6c" + + +def test_ex_create_firewall_rule_with_specific_source_ip(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = driver.ex_list_firewall_rules(net) + specific_source_ip_rule = list(filter(lambda x: x.name == "SpecificSourceIP", rules))[0] + rule = driver.ex_create_firewall_rule( + net, + specific_source_ip_rule.name, + specific_source_ip_rule.action, + specific_source_ip_rule.ip_version, + specific_source_ip_rule.protocol, + specific_source_ip_rule.source, + specific_source_ip_rule.destination, + "FIRST", + ) + assert rule.id == "d0a20f59-77b9-4f28-a63b-e58496b73a6c" + + +def test_ex_create_firewall_rule_with_source_ip(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = driver.ex_list_firewall_rules(net) + specific_source_ip_rule = list(filter(lambda x: x.name == "SpecificSourceIP", rules))[0] + specific_source_ip_rule.source.any_ip = False + specific_source_ip_rule.source.ip_address = "10.0.0.1" + specific_source_ip_rule.source.ip_prefix_size = "15" + rule = driver.ex_create_firewall_rule( + net, + specific_source_ip_rule.name, + specific_source_ip_rule.action, + specific_source_ip_rule.ip_version, + specific_source_ip_rule.protocol, + specific_source_ip_rule.source, + specific_source_ip_rule.destination, + "FIRST", + ) + assert rule.id == "d0a20f59-77b9-4f28-a63b-e58496b73a6c" + + +def test_ex_create_firewall_rule_with_any_ip(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = driver.ex_list_firewall_rules(net) + specific_source_ip_rule = list(filter(lambda x: x.name == "SpecificSourceIP", rules))[0] + specific_source_ip_rule.source.any_ip = True + rule = driver.ex_create_firewall_rule( + net, + specific_source_ip_rule.name, + specific_source_ip_rule.action, + specific_source_ip_rule.ip_version, + specific_source_ip_rule.protocol, + specific_source_ip_rule.source, + specific_source_ip_rule.destination, + "FIRST", + ) + assert rule.id == "d0a20f59-77b9-4f28-a63b-e58496b73a6c" + + +def test_ex_create_firewall_rule_ip_prefix_size(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_list_firewall_rules(net)[0] + rule.source.address_list_id = None + rule.source.any_ip = False + rule.source.ip_address = "10.2.1.1" + rule.source.ip_prefix_size = "10" + rule.destination.address_list_id = None + rule.destination.any_ip = False + rule.destination.ip_address = "10.0.0.1" + rule.destination.ip_prefix_size = "20" + driver.ex_create_firewall_rule( + net, + rule.name, + rule.action, + rule.ip_version, + rule.protocol, + rule.source, + rule.destination, + "LAST", + ) + + +def test_ex_create_firewall_rule_address_list(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_list_firewall_rules(net)[0] + rule.source.address_list_id = "12345" + rule.destination.address_list_id = "12345" + driver.ex_create_firewall_rule( + net, + rule.name, + rule.action, + rule.ip_version, + rule.protocol, + rule.source, + rule.destination, + "LAST", + ) + + +def test_ex_create_firewall_rule_port_list(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_list_firewall_rules(net)[0] + rule.source.port_list_id = "12345" + rule.destination.port_list_id = "12345" + driver.ex_create_firewall_rule( + net, + rule.name, + rule.action, + rule.ip_version, + rule.protocol, + rule.source, + rule.destination, + "LAST", + ) + + +def test_ex_create_firewall_rule_port(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_list_firewall_rules(net)[0] + rule.source.port_list_id = None + rule.source.port_begin = "8000" + rule.source.port_end = "8005" + rule.destination.port_list_id = None + rule.destination.port_begin = "7000" + rule.destination.port_end = "7005" + driver.ex_create_firewall_rule( + net, + rule.name, + rule.action, + rule.ip_version, + rule.protocol, + rule.source, + rule.destination, + "LAST", + ) + + +def test_ex_create_firewall_rule_ALL_VALUES(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = driver.ex_list_firewall_rules(net) + for rule in rules: + driver.ex_create_firewall_rule( + net, + rule.name, + rule.action, + rule.ip_version, + rule.protocol, + rule.source, + rule.destination, + "LAST", + ) + + +def test_ex_create_firewall_rule_WITH_POSITION_RULE(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = driver.ex_list_firewall_rules(net) + rule = driver.ex_create_firewall_rule( + net, + rules[-2].name, + rules[-2].action, + rules[-2].ip_version, + rules[-2].protocol, + rules[-2].source, + rules[-2].destination, + "BEFORE", + position_relative_to_rule=rules[-1], + ) + assert rule.id == "d0a20f59-77b9-4f28-a63b-e58496b73a6c" + + +def test_ex_create_firewall_rule_WITH_POSITION_RULE_STR(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = driver.ex_list_firewall_rules(net) + rule = driver.ex_create_firewall_rule( + net, + rules[-2].name, + rules[-2].action, + rules[-2].ip_version, + rules[-2].protocol, + rules[-2].source, + rules[-2].destination, + "BEFORE", + position_relative_to_rule="RULE_WITH_SOURCE_AND_DEST", + ) + assert rule.id == "d0a20f59-77b9-4f28-a63b-e58496b73a6c" + + +def test_ex_create_firewall_rule_FAIL_POSITION(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = driver.ex_list_firewall_rules(net) + with pytest.raises(ValueError): + driver.ex_create_firewall_rule( + net, + rules[0].name, + rules[0].action, + rules[0].ip_version, + rules[0].protocol, + rules[0].source, + rules[0].destination, + "BEFORE", + ) + + +def test_ex_create_firewall_rule_FAIL_POSITION_WITH_RULE(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = driver.ex_list_firewall_rules(net) + with pytest.raises(ValueError): + driver.ex_create_firewall_rule( + net, + rules[0].name, + rules[0].action, + rules[0].ip_version, + rules[0].protocol, + rules[0].source, + rules[0].destination, + "LAST", + position_relative_to_rule="RULE_WITH_SOURCE_AND_DEST", + ) + + +def test_ex_get_firewall_rule(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + assert rule.id == "d0a20f59-77b9-4f28-a63b-e58496b73a6c" + + +def test_ex_set_firewall_rule_state(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + result = driver.ex_set_firewall_rule_state(rule, False) + assert result is True + + +def test_ex_delete_firewall_rule(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + result = driver.ex_delete_firewall_rule(rule) + assert result is True + + +def test_ex_edit_firewall_rule(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.any_ip = True + result = driver.ex_edit_firewall_rule(rule=rule, position="LAST") + assert result is True + + +def test_ex_edit_firewall_rule_source_ipaddresslist(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.address_list_id = "802abc9f-45a7-4efb-9d5a-810082368222" + rule.source.any_ip = False + rule.source.ip_address = "10.0.0.1" + rule.source.ip_prefix_size = 10 + result = driver.ex_edit_firewall_rule(rule=rule, position="LAST") + assert result is True + + +def test_ex_edit_firewall_rule_destination_ipaddresslist(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.destination.address_list_id = "802abc9f-45a7-4efb-9d5a-810082368222" + rule.destination.any_ip = False + rule.destination.ip_address = "10.0.0.1" + rule.destination.ip_prefix_size = 10 + result = driver.ex_edit_firewall_rule(rule=rule, position="LAST") + assert result is True + + +def test_ex_edit_firewall_rule_destination_ipaddress(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.address_list_id = None + rule.source.any_ip = False + rule.source.ip_address = "10.0.0.1" + rule.source.ip_prefix_size = "10" + result = driver.ex_edit_firewall_rule(rule=rule, position="LAST") + assert result is True + + +def test_ex_edit_firewall_rule_source_ipaddress(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.destination.address_list_id = None + rule.destination.any_ip = False + rule.destination.ip_address = "10.0.0.1" + rule.destination.ip_prefix_size = "10" + result = driver.ex_edit_firewall_rule(rule=rule, position="LAST") + assert result is True + + +def test_ex_edit_firewall_rule_with_relative_rule(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + placement_rule = driver.ex_list_firewall_rules(network_domain=net)[-1] + result = driver.ex_edit_firewall_rule( + rule=rule, position="BEFORE", relative_rule_for_position=placement_rule + ) + assert result is True + + +def test_ex_edit_firewall_rule_with_relative_rule_by_name(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + placement_rule = driver.ex_list_firewall_rules(network_domain=net)[-1] + result = driver.ex_edit_firewall_rule( + rule=rule, position="BEFORE", relative_rule_for_position=placement_rule.name + ) + assert result is True + + +def test_ex_edit_firewall_rule_source_portlist(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.port_list_id = "802abc9f-45a7-4efb-9d5a-810082368222" + result = driver.ex_edit_firewall_rule(rule=rule, position="LAST") + assert result is True + + +def test_ex_edit_firewall_rule_source_port(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.source.port_list_id = None + rule.source.port_begin = "3" + rule.source.port_end = "10" + result = driver.ex_edit_firewall_rule(rule=rule, position="LAST") + assert result is True + + +def test_ex_edit_firewall_rule_destination_portlist(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.destination.port_list_id = "802abc9f-45a7-4efb-9d5a-810082368222" + result = driver.ex_edit_firewall_rule(rule=rule, position="LAST") + assert result is True + + +def test_ex_edit_firewall_rule_destination_port(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + rule.destination.port_list_id = None + rule.destination.port_begin = "3" + rule.destination.port_end = "10" + result = driver.ex_edit_firewall_rule(rule=rule, position="LAST") + assert result is True + + +def test_ex_edit_firewall_rule_invalid_position_fail(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + with pytest.raises(ValueError): + driver.ex_edit_firewall_rule(rule=rule, position="BEFORE") + + +def test_ex_edit_firewall_rule_invalid_position_relative_rule_fail(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_firewall_rule(net, "d0a20f59-77b9-4f28-a63b-e58496b73a6c") + relative_rule = driver.ex_list_firewall_rules(network_domain=net)[-1] + with pytest.raises(ValueError): + driver.ex_edit_firewall_rule( + rule=rule, position="FIRST", relative_rule_for_position=relative_rule + ) + + +def test_ex_create_nat_rule(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_create_nat_rule(net, "1.2.3.4", "4.3.2.1") + assert rule.id == "d31c2db0-be6b-4d50-8744-9a7a534b5fba" + + +def test_ex_list_nat_rules(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rules = driver.ex_list_nat_rules(net) + assert rules[0].id == "2187a636-7ebb-49a1-a2ff-5d617f496dce" + assert rules[0].internal_ip == "10.0.0.15" + assert rules[0].external_ip == "165.180.12.18" + + +def test_ex_get_nat_rule(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_nat_rule(net, "2187a636-7ebb-49a1-a2ff-5d617f496dce") + assert rule.id == "2187a636-7ebb-49a1-a2ff-5d617f496dce" + assert rule.internal_ip == "10.0.0.16" + assert rule.external_ip == "165.180.12.19" + + +def test_ex_delete_nat_rule(driver): + net = driver.ex_get_network_domain("8cdfd607-f429-4df6-9352-162cfc0891be") + rule = driver.ex_get_nat_rule(net, "2187a636-7ebb-49a1-a2ff-5d617f496dce") + result = driver.ex_delete_nat_rule(rule) + assert result is True + + +def test_ex_enable_monitoring(driver): + node = driver.list_nodes()[0] + result = driver.ex_enable_monitoring(node, "ADVANCED") + assert result is True + + +def test_ex_disable_monitoring(driver): + node = driver.list_nodes()[0] + result = driver.ex_disable_monitoring(node) + assert result is True + + +def test_ex_change_monitoring_plan(driver): + node = driver.list_nodes()[0] + result = driver.ex_update_monitoring_plan(node, "ESSENTIALS") + assert result is True + + +def test_ex_add_storage_to_node(driver): + node = driver.list_nodes()[0] + result = driver.ex_add_storage_to_node(30, node, "PERFORMANCE") + assert result is True + + +def test_ex_remove_storage_from_node(driver): + node = driver.list_nodes()[0] + result = driver.ex_remove_storage_from_node(node, 0) + assert result is True + + +def test_ex_change_storage_speed(driver): + result = driver.ex_change_storage_speed("1", "PERFORMANCE") + assert result is True + + +def test_ex_change_storage_size(driver): + result = driver.ex_change_storage_size("1", 100) + assert result is True + + +def test_ex_clone_node_to_image(driver): + node = driver.list_nodes()[0] + result = driver.ex_clone_node_to_image(node, "my image", "a description") + assert result is True + + +def test_ex_edit_metadata(driver): + node = driver.list_nodes()[0] + result = driver.ex_edit_metadata(node, "my new name", "a description") + assert result is True + + +def test_ex_reconfigure_node(driver): + node = driver.list_nodes()[0] + result = driver.ex_reconfigure_node(node, 4, 4, 1, "HIGHPERFORMANCE") + assert result is True + + +def test_ex_get_location_by_id(driver): + location = driver.ex_get_location_by_id("NA9") + assert location.id == "NA9" + + +def test_ex_get_location_by_id_NO_LOCATION(driver): + location = driver.ex_get_location_by_id(None) + assert location is None + + +def test_ex_get_base_image_by_id(driver): + image_id = driver.list_images()[0].id + image = driver.ex_get_base_image_by_id(image_id) + assert image.extra["OS_type"] == "UNIX" + + +def test_ex_get_customer_image_by_id(driver): + image_id = driver.ex_list_customer_images()[1].id + image = driver.ex_get_customer_image_by_id(image_id) + assert image.extra["OS_type"] == "WINDOWS" + + +def test_ex_get_image_by_id_base_img(driver): + image_id = driver.list_images()[1].id + image = driver.ex_get_base_image_by_id(image_id) + assert image.extra["OS_type"] == "WINDOWS" + + +def test_ex_get_image_by_id_customer_img(driver): + image_id = driver.ex_list_customer_images()[0].id + image = driver.ex_get_customer_image_by_id(image_id) + assert image.extra["OS_type"] == "UNIX" + + +def test_ex_get_image_by_id_customer_FAIL(driver): + image_id = "FAKE_IMAGE_ID" + with pytest.raises(NttCisAPIException): + driver.ex_get_base_image_by_id(image_id) + + +def test_ex_create_anti_affinity_rule(driver): + node_list = driver.list_nodes() + success = driver.ex_create_anti_affinity_rule([node_list[0], node_list[1]]) + assert success is True + + +def test_ex_create_anti_affinity_rule_TUPLE(driver): + node_list = driver.list_nodes() + success = driver.ex_create_anti_affinity_rule((node_list[0], node_list[1])) + assert success is True + + +def test_ex_create_anti_affinity_rule_TUPLE_STR(driver): + node_list = driver.list_nodes() + success = driver.ex_create_anti_affinity_rule((node_list[0].id, node_list[1].id)) + assert success is True + + +def test_ex_create_anti_affinity_rule_FAIL_STR(driver): + node_list = "string" + with pytest.raises(TypeError): + driver.ex_create_anti_affinity_rule(node_list) + + +def test_ex_create_anti_affinity_rule_FAIL_EXISTING(driver): + node_list = driver.list_nodes() + NttCisMockHttp.type = "FAIL_EXISTING" + with pytest.raises(NttCisAPIException): + driver.ex_create_anti_affinity_rule((node_list[0], node_list[1])) + + +def test_ex_delete_anti_affinity_rule(driver): + net_domain = driver.ex_list_network_domains()[0] + rule = driver.ex_list_anti_affinity_rules(network_domain=net_domain)[0].id + success = driver.ex_delete_anti_affinity_rule(rule) + assert success is True + + +def test_ex_delete_anti_affinity_rule_STR(driver): + net_domain = driver.ex_list_network_domains()[0] + rule = driver.ex_list_anti_affinity_rules(network_domain=net_domain)[0] + success = driver.ex_delete_anti_affinity_rule(rule.id) + assert success is True + + +def test_ex_delete_anti_affinity_rule_FAIL(driver): + net_domain = driver.ex_list_network_domains()[0] + rule = driver.ex_list_anti_affinity_rules(network_domain=net_domain)[0] + NttCisMockHttp.type = "FAIL" + with pytest.raises(NttCisAPIException): + driver.ex_delete_anti_affinity_rule(rule.id) + + +def test_ex_list_anti_affinity_rules_NETWORK_DOMAIN(driver): + net_domain = driver.ex_list_network_domains()[0] + rules = driver.ex_list_anti_affinity_rules(network_domain=net_domain) + assert isinstance(rules, list) + assert len(rules) == 2 + assert isinstance(rules[0].id, str) + assert isinstance(rules[0].node_list, list) + + +def test_ex_list_anti_affinity_rules_NODE(driver): + node = driver.list_nodes()[0] + rules = driver.ex_list_anti_affinity_rules(node=node) + assert isinstance(rules, list) + assert len(rules) == 2 + assert isinstance(rules[0].id, str) + assert isinstance(rules[0].node_list, list) + + +def test_ex_list_anti_affinity_rules_PAGINATED(driver): + net_domain = driver.ex_list_network_domains()[0] + NttCisMockHttp.type = "PAGINATED" + rules = driver.ex_list_anti_affinity_rules(network_domain=net_domain) + assert isinstance(rules, list) + assert len(rules) == 4 + assert isinstance(rules[0].id, str) + assert isinstance(rules[0].node_list, list) + + +def test_ex_list_anti_affinity_rules_ALLFILTERS(driver): + net_domain = driver.ex_list_network_domains()[0] + NttCisMockHttp.type = "ALLFILTERS" + rules = driver.ex_list_anti_affinity_rules( + network_domain=net_domain, filter_id="FAKE_ID", filter_state="FAKE_STATE" + ) + assert isinstance(rules, list) + assert len(rules) == 2 + assert isinstance(rules[0].id, str) + assert isinstance(rules[0].node_list, list) + + +def test_ex_list_anti_affinity_rules_BAD_ARGS(driver): + with pytest.raises(ValueError): + driver.ex_list_anti_affinity_rules( + network="fake_network", network_domain="fake_network_domain" + ) + + +def test_ex_create_tag_key(driver): + success = driver.ex_create_tag_key("MyTestKey") + assert success is True + + +def test_ex_create_tag_key_ALLPARAMS(driver): + driver.connection._get_orgId() + NttCisMockHttp.type = "ALLPARAMS" + success = driver.ex_create_tag_key( + "MyTestKey", + description="Test Key Desc.", + value_required=False, + display_on_report=False, + ) + assert success is True + + +def test_ex_create_tag_key_BADREQUEST(driver): + driver.connection._get_orgId() + NttCisMockHttp.type = "BADREQUEST" + with pytest.raises(NttCisAPIException): + driver.ex_create_tag_key("MyTestKey") + + +def test_ex_list_tag_keys(driver): + tag_keys = driver.ex_list_tag_keys() + assert isinstance(tag_keys, list) + assert isinstance(tag_keys[0], NttCisTagKey) + assert isinstance(tag_keys[0].id, str) + + +def test_ex_list_tag_keys_ALLFILTERS(driver): + driver.connection._get_orgId() + NttCisMockHttp.type = "ALLFILTERS" + driver.ex_list_tag_keys( + id="fake_id", name="fake_name", value_required=False, display_on_report=False + ) + + +def test_ex_get_tag_by_id(driver): + tag = driver.ex_get_tag_key_by_id("d047c609-93d7-4bc5-8fc9-732c85840075") + assert isinstance(tag, NttCisTagKey) + + +def test_ex_get_tag_by_id_NOEXIST(driver): + driver.connection._get_orgId() + NttCisMockHttp.type = "NOEXIST" + with pytest.raises(NttCisAPIException): + driver.ex_get_tag_key_by_id("d047c609-93d7-4bc5-8fc9-732c85840075") + + +def test_ex_get_tag_by_name(driver): + driver.connection._get_orgId() + NttCisMockHttp.type = "SINGLE" + tag = driver.ex_get_tag_key_by_name("LibcloudTest") + assert isinstance(tag, NttCisTagKey) + + +def test_ex_get_tag_by_name_NOEXIST(driver): + with pytest.raises(ValueError): + driver.ex_get_tag_key_by_name("LibcloudTest") + + +def test_ex_modify_tag_key_NAME(driver): + tag_key = driver.ex_list_tag_keys()[0] + NttCisMockHttp.type = "NAME" + success = driver.ex_modify_tag_key(tag_key, name="NewName") + assert success is True + + +def test_ex_modify_tag_key_NOTNAME(driver): + tag_key = driver.ex_list_tag_keys()[0] + NttCisMockHttp.type = "NOTNAME" + success = driver.ex_modify_tag_key( + tag_key, description="NewDesc", value_required=False, display_on_report=True + ) + assert success is True + + +def test_ex_modify_tag_key_NOCHANGE(driver): + tag_key = driver.ex_list_tag_keys()[0] + NttCisMockHttp.type = "NOCHANGE" + with pytest.raises(NttCisAPIException): + driver.ex_modify_tag_key(tag_key) + + +def test_ex_remove_tag_key(driver): + tag_key = driver.ex_list_tag_keys()[0] + success = driver.ex_remove_tag_key(tag_key) + assert success is True + + +def test_ex_remove_tag_key_NOEXIST(driver): + tag_key = driver.ex_list_tag_keys()[0] + NttCisMockHttp.type = "NOEXIST" + with pytest.raises(NttCisAPIException): + driver.ex_remove_tag_key(tag_key) + + +def test_ex_apply_tag_to_asset(driver): + node = driver.list_nodes()[0] + success = driver.ex_apply_tag_to_asset(node, "TagKeyName", "FakeValue") + assert success is True + + +def test_ex_apply_tag_to_asset_NOVALUE(driver): + node = driver.list_nodes()[0] + NttCisMockHttp.type = "NOVALUE" + success = driver.ex_apply_tag_to_asset(node, "TagKeyName") + assert success is True + + +def test_ex_apply_tag_to_asset_NOTAGKEY(driver): + node = driver.list_nodes()[0] + NttCisMockHttp.type = "NOTAGKEY" + with pytest.raises(NttCisAPIException): + driver.ex_apply_tag_to_asset(node, "TagKeyNam") + + +def test_ex_remove_tag_from_asset(driver): + node = driver.list_nodes()[0] + success = driver.ex_remove_tag_from_asset(node, "TagKeyName") + assert success is True + + +def test_ex_remove_tag_from_asset_NOTAG(driver): + node = driver.list_nodes()[0] + NttCisMockHttp.type = "NOTAG" + with pytest.raises(NttCisAPIException): + driver.ex_remove_tag_from_asset(node, "TagKeyNam") + + +def test_ex_list_tags(driver): + tags = driver.ex_list_tags() + assert isinstance(tags, list) + assert isinstance(tags[0], NttCisTag) + assert len(tags) == 3 + + +def test_ex_list_tags_ALLPARAMS(driver): + driver.connection._get_orgId() + NttCisMockHttp.type = "ALLPARAMS" + tags = driver.ex_list_tags( + asset_id="fake_asset_id", + asset_type="fake_asset_type", + location="fake_location", + tag_key_name="fake_tag_key_name", + tag_key_id="fake_tag_key_id", + value="fake_value", + value_required=False, + display_on_report=False, + ) + assert isinstance(tags, list) + assert isinstance(tags[0], NttCisTag) + assert len(tags) == 3 + + +def test_list_consistency_groups(driver): + cgs = driver.ex_list_consistency_groups() + assert isinstance(cgs, list) + + +def test_list_cg_by_src_net_domain(driver): + nd = "f9d6a249-c922-4fa1-9f0f-de5b452c4026" + cgs = driver.ex_list_consistency_groups(source_network_domain_id=nd) + assert cgs[0].name == "sdk_test2_cg" + + +def test_list_cg_by_name(driver): + NttCisMockHttp.type = "CG_BY_NAME" + name = "sdk_test2_cg" + cg = driver.ex_list_consistency_groups(name=name) + assert cg[0].id == "195a426b-4559-4c79-849e-f22cdf2bfb6e" + + +def test_get_consistency_group_by_id(driver): + NttCisMockHttp.type = None + cgs = driver.ex_list_consistency_groups() + cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id + cg = driver.ex_get_consistency_group(cg_id) + assert hasattr(cg, "description") + + +def test_get_drs_snapshots(driver): + NttCisMockHttp.type = None + cgs = driver.ex_list_consistency_groups() + cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id + snaps = driver.ex_list_consistency_group_snapshots(cg_id) + assert hasattr(snaps, "journalUsageGb") + assert isinstance(snaps, ClassFactory) + + +def test_get_drs_snapshots_by_min_max(driver): + cgs = driver.ex_list_consistency_groups() + cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id + snaps = driver.ex_list_consistency_group_snapshots( + cg_id, + create_time_min="2018-11-28T00:00:00.000Z", + create_time_max="2018-11-29T00:00:00.000Z", + ) + for snap in snaps.snapshot: + assert "2018-12" not in snap + + +def test_expand_drs_journal(driver): + cgs = driver.ex_list_consistency_groups(name="sdk_test2_cg") + cg_id = cgs[0].id + expand_by = "100" + result = driver.ex_expand_journal(cg_id, expand_by) + assert result is True + + +def test_start_drs_snapshot_preview(driver): + cg_id = "195a426b-4559-4c79-849e-f22cdf2bfb6e" + snapshot_id = "3893" + result = driver.ex_start_drs_failover_preview(cg_id, snapshot_id) + assert result is True + + +def test_stop_drs_snapshot_preivew(driver): + cg_id = "195a426b-4559-4c79-849e-f22cdf2bfb6e" + result = driver.ex_stop_drs_failover_preview(cg_id) + assert result is True + + +def test_start_drs_failover_invalid_status(driver): + NttCisMockHttp.type = "INVALID_STATUS" + cg_id = "195a426b-4559-4c79-849e-f22cdf2bfb6e" + with pytest.raises(NttCisAPIException) as excinfo: + driver.ex_initiate_drs_failover(cg_id) + assert "INVALID_STATUS" in excinfo.value.code + + +def test_initiate_drs_failover(driver): + cg_id = "195a426b-4559-4c79-849e-f22cdf2bfb6e" + result = driver.ex_initiate_drs_failover(cg_id) + assert result is True + + +def test_create_drs_fail_not_supported(driver): + NttCisMockHttp.type = "FAIL_NOT_SUPPORTED" + src_id = "032f3967-00e4-4780-b4ef-8587460f9dd4" + target_id = "aee58575-38e2-495f-89d3-854e6a886411" + with pytest.raises(NttCisAPIException) as excinfo: + driver.ex_create_consistency_group( + "sdk_cg", "100", src_id, target_id, description="A test consistency group" + ) + exception_msg = excinfo.value.msg + assert ( + exception_msg + == "DRS is not supported between source Data Center NA9 and target Data Center NA12." + ) + + +def test_create_drs_cg_fail_ineligble(driver): + NttCisMockHttp.type = "FAIL_INELIGIBLE" + src_id = "032f3967-00e4-4780-b4ef-8587460f9dd4" + target_id = "aee58575-38e2-495f-89d3-854e6a886411" + with pytest.raises(NttCisAPIException) as excinfo: + driver.ex_create_consistency_group( + "sdk_test2_cg", + "100", + src_id, + target_id, + description="A test consistency group", + ) + exception_msg = excinfo.value.msg + assert ( + exception_msg + == "The drsEligible flag for target Server aee58575-38e2-495f-89d3-854e6a886411 must be set." + ) + + +def test_create_drs_cg(driver): + src_id = "032f3967-00e4-4780-b4ef-8587460f9dd4" + target_id = "aee58575-38e2-495f-89d3-854e6a886411" + result = driver.ex_create_consistency_group( + "sdk_test2_cg2", + "100", + src_id, + target_id, + description="A test consistency group", + ) + assert result is True + + +def test_delete_consistency_group(driver): + cg_id = "fad067be-6ca7-495d-99dc-7921c5f2ca5" + result = driver.ex_delete_consistency_group(cg_id) + assert result is True + + +class InvalidRequestError(Exception): + def __init__(self, tag): + super().__init__("Invalid Request - %s" % tag) + + +class NttCisMockHttp(MockHttp): + fixtures = ComputeFileFixtures("nttcis") + + def _oec_0_9_myaccount_UNAUTHORIZED(self, method, url, body, headers): + return (httplib.UNAUTHORIZED, "", {}, httplib.responses[httplib.UNAUTHORIZED]) + + def _oec_0_9_myaccount(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_INPROGRESS(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_PAGINATED(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_ALLFILTERS(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_NET_DOMAIN(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_CG_BY_NAME(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_MIN_MAX(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_MIN(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_INVALID_STATUS(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_FAIL_INELIGIBLE(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_FAIL_NOT_SUPPORTED(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _oec_0_9_myaccount_DYNAMIC(self, method, url, body, headers): + body = self.fixtures.load("oec_0_9_myaccount.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation( + self, method, url, body, headers + ): + body = self.fixtures.load("networkWithLocation.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server(self, method, url, body, headers): + body = self.fixtures.load("server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deleteServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_deleteServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deleteServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_deleteServer_RESOURCEBUSY.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_rebootServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}rebootServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_rebootServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_rebootServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}rebootServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_rebootServer_RESOURCEBUSY.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server( + self, method, url, body, headers + ): + if url.endswith("datacenterId=NA3"): + body = self.fixtures.load("server_server_NA3.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + body = self.fixtures.load("server_server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGESIZE50( + self, method, url, body, headers + ): + if not url.endswith("pageSize=50"): + raise ValueError("pageSize is not set as expected") + body = self.fixtures.load("server_server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_EMPTY( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_paginated_empty.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGED_THEN_EMPTY( + self, method, url, body, headers + ): + if "pageNumber=2" in url: + body = self.fixtures.load("server_server_paginated_empty.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + body = self.fixtures.load("server_server_paginated.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGINATED( + self, method, url, body, headers + ): + if "pageNumber=2" in url: + body = self.fixtures.load("server_server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + body = self.fixtures.load("server_server_paginated.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGINATEDEMPTY( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_paginated_empty.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + for parameter in parameters: + key, value = parameter.split("=") + if key == "datacenterId": + assert value == "fake_loc" + elif key == "networkId": + assert value == "fake_network" + elif key == "networkDomainId": + assert value == "fake_network_domain" + elif key == "vlanId": + assert value == "fake_vlan" + elif key == "ipv6": + assert value == "fake_ipv6" + elif key == "privateIpv4": + assert value == "fake_ipv4" + elif key == "name": + assert value == "fake_name" + elif key == "state": + assert value == "fake_state" + elif key == "started": + assert value == "True" + elif key == "deployed": + assert value == "True" + elif key == "sourceImageId": + assert value == "fake_image" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("server_server.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_antiAffinityRule( + self, method, url, body, headers + ): + body = self.fixtures.load("server_antiAffinityRule_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_antiAffinityRule_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + for parameter in parameters: + key, value = parameter.split("=") + if key == "id": + assert value == "FAKE_ID" + elif key == "state": + assert value == "FAKE_STATE" + elif key == "pageSize": + assert value == "250" + elif key == "networkDomainId": + pass + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("server_antiAffinityRule_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_createAntiAffinityRule( + self, method, url, body, headers + ): + body = self.fixtures.load("server_createAntiAffinityRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_antiAffinityRule_PAGINATED( + self, method, url, body, headers + ): + if "pageNumber=2" in url: + body = self.fixtures.load("server_antiAffinityRule_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + body = self.fixtures.load("server_antiAffinityRule_list_PAGINATED.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_createAntiAffinityRule_FAIL_EXISTING( + self, method, url, body, headers + ): + body = self.fixtures.load("server_createAntiAffinityRule_FAIL.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deleteAntiAffinityRule( + self, method, url, body, headers + ): + body = self.fixtures.load("server_deleteAntiAffinityRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deleteAntiAffinityRule_FAIL( + self, method, url, body, headers + ): + body = self.fixtures.load("server_createAntiAffinityRule_FAIL.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_infrastructure_snapshotWindow( + self, method, url, body, headers + ): + body = self.fixtures.load("datacenter_snapshotWindows.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_infrastructure_datacenter( + self, method, url, body, headers + ): + if url.endswith("id=NA9"): + body = self.fixtures.load("infrastructure_datacenter_NA9.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + body = self.fixtures.load("infrastructure_datacenter.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_infrastructure_datacenter_ALLFILTERS( + self, method, url, body, headers + ): + if url.endswith("id=NA9"): + body = self.fixtures.load("infrastructure_datacenter_NA9.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + body = self.fixtures.load("infrastructure_datacenter.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_updateVmwareTools( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}updateVmwareTools": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_updateVmwareTools.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_startServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}startServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_startServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_startServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}startServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_startServer_INPROGRESS.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_shutdownServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}shutdownServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_shutdownServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_shutdownServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}shutdownServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_shutdownServer_INPROGRESS.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_resetServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}resetServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_resetServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_powerOffServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}powerOffServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_powerOffServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_powerOffServer_INPROGRESS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}powerOffServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_powerOffServer_INPROGRESS.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_11_INPROGRESS( + self, method, url, body, headers + ): + body = self.fixtures.load("server_GetServer.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain( + self, method, url, body, headers + ): + body = self.fixtures.load("network_networkDomain.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + for parameter in parameters: + key, value = parameter.split("=") + if key == "datacenterId": + assert value == "fake_location" + elif key == "type": + assert value == "fake_plan" + elif key == "name": + assert value == "fake_name" + elif key == "state": + assert value == "fake_state" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("network_networkDomain.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_vlan( + self, method, url, body, headers + ): + body = self.fixtures.load("network_vlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_vlan_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + for parameter in parameters: + key, value = parameter.split("=") + if key == "datacenterId": + assert value == "fake_location" + elif key == "networkDomainId": + assert value == "fake_network_domain" + elif key == "ipv6Address": + assert value == "fake_ipv6" + elif key == "privateIpv4Address": + assert value == "fake_ipv4" + elif key == "name": + assert value == "fake_name" + elif key == "state": + assert value == "fake_state" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("network_vlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deployServer": + raise InvalidRequestError(request.tag) + + # Make sure the we either have a network tag with an IP or networkId + # Or Network info with a primary nic that has privateip or vlanid + network = request.find(fixxpath("network", TYPES_URN)) + network_info = request.find(fixxpath("networkInfo", TYPES_URN)) + if network is not None: + if network_info is not None: + raise InvalidRequestError("Request has both MCP1 and MCP2 values") + ipv4 = findtext(network, "privateIpv4", TYPES_URN) + networkId = findtext(network, "networkId", TYPES_URN) + if ipv4 is None and networkId is None: + raise InvalidRequestError( + "Invalid request MCP1 requests need privateIpv4 or networkId" + ) + elif network_info is not None: + if network is not None: + raise InvalidRequestError("Request has both MCP1 and MCP2 values") + primary_nic = network_info.find(fixxpath("primaryNic", TYPES_URN)) + ipv4 = findtext(primary_nic, "privateIpv4", TYPES_URN) + vlanId = findtext(primary_nic, "vlanId", TYPES_URN) + if ipv4 is None and vlanId is None: + raise InvalidRequestError( + "Invalid request MCP2 requests need privateIpv4 or vlanId" + ) + else: + raise InvalidRequestError( + "Invalid request, does not have network or network_info in XML" + ) + + body = self.fixtures.load("server_deployServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87( + self, method, url, body, headers + ): + body = self.fixtures.load("server_server_e75ead52_692f_4314_8725_c8a4f4d13a87.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deployNetworkDomain( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deployNetworkDomain": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deployNetworkDomain.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be( + self, method, url, body, headers + ): + body = self.fixtures.load("network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be_ALLFILTERS( + self, method, url, body, headers + ): + body = self.fixtures.load("network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editNetworkDomain( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}editNetworkDomain": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_editNetworkDomain.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteNetworkDomain( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteNetworkDomain": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deleteNetworkDomain.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deployVlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deployVlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deployVlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_vlan_0e56433f_d808_4669_821d_812769517ff8( + self, method, url, body, headers + ): + body = self.fixtures.load("network_vlan_0e56433f_d808_4669_821d_812769517ff8.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editVlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}editVlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_editVlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteVlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteVlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deleteVlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_expandVlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}expandVlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_expandVlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_addPublicIpBlock( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}addPublicIpBlock": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_addPublicIpBlock.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba( + self, method, url, body, headers + ): + body = self.fixtures.load("network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_publicIpBlock( + self, method, url, body, headers + ): + body = self.fixtures.load("network_publicIpBlock.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8( + self, method, url, body, headers + ): + body = self.fixtures.load("network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_removePublicIpBlock( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}removePublicIpBlock": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_removePublicIpBlock.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_firewallRule( + self, method, url, body, headers + ): + body = self.fixtures.load("network_firewallRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createFirewallRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}createFirewallRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_createFirewallRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c( + self, method, url, body, headers + ): + body = self.fixtures.load("network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editFirewallRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}editFirewallRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_editFirewallRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteFirewallRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteFirewallRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deleteFirewallRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createNatRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}createNatRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_createNatRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_natRule( + self, method, url, body, headers + ): + body = self.fixtures.load("network_natRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce( + self, method, url, body, headers + ): + body = self.fixtures.load("network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteNatRule( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteNatRule": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("network_deleteNatRule.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_addNic( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}addNic": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_addNic.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_removeNic( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}removeNic": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_removeNic.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_disableServerMonitoring( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}disableServerMonitoring": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_disableServerMonitoring.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_enableServerMonitoring( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}enableServerMonitoring": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_enableServerMonitoring.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_changeServerMonitoringPlan( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}changeServerMonitoringPlan": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_changeServerMonitoringPlan.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_BAD_REQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_BAD_REQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_FAKE_IMAGE_ID( + self, method, url, body, headers + ): + body = self.fixtures.load("image_osImage_BAD_REQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage( + self, method, url, body, headers + ): + body = self.fixtures.load("image_customerImage.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d( + self, method, url, body, headers + ): + body = self.fixtures.load("image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c( + self, method, url, body, headers + ): + body = self.fixtures.load("image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage_FAKE_IMAGE_ID( + self, method, url, body, headers + ): + body = self.fixtures.load("image_customerImage_BAD_REQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_reconfigureServer( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}reconfigureServer": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("server_reconfigureServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_cleanServer( + self, method, url, body, headers + ): + body = self.fixtures.load("server_cleanServer.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_addDisk( + self, method, url, body, headers + ): + body = self.fixtures.load("server_addDisk.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_changeDiskSpeed( + self, method, url, body, headers + ): + body = self.fixtures.load("change_disk_speed.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_expandDisk( + self, method, url, body, headers + ): + body = self.fixtures.load("change_disk_size.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_removeDisk( + self, method, url, body, headers + ): + body = self.fixtures.load("server_removeDisk.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_editServerMetadata( + self, method, url, body, headers + ): + body = self.fixtures.load("server_editServerMetadata.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_createTagKey( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}createTagKey": + raise InvalidRequestError(request.tag) + name = findtext(request, "name", TYPES_URN) + description = findtext(request, "description", TYPES_URN) + value_required = findtext(request, "valueRequired", TYPES_URN) + display_on_report = findtext(request, "displayOnReport", TYPES_URN) + if name is None: + raise ValueError("Name must have a value in the request") + if description is not None: + raise ValueError("Default description for a tag should be blank") + if value_required is None or value_required != "true": + raise ValueError("Default valueRequired should be true") + if display_on_report is None or display_on_report != "true": + raise ValueError("Default displayOnReport should be true") + + body = self.fixtures.load("tag_createTagKey.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_createTagKey_ALLPARAMS( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}createTagKey": + raise InvalidRequestError(request.tag) + name = findtext(request, "name", TYPES_URN) + description = findtext(request, "description", TYPES_URN) + value_required = findtext(request, "valueRequired", TYPES_URN) + display_on_report = findtext(request, "displayOnReport", TYPES_URN) + if name is None: + raise ValueError("Name must have a value in the request") + if description is None: + raise ValueError("Description should have a value") + if value_required is None or value_required != "false": + raise ValueError("valueRequired should be false") + if display_on_report is None or display_on_report != "false": + raise ValueError("displayOnReport should be false") + + body = self.fixtures.load("tag_createTagKey.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_createTagKey_BADREQUEST( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_createTagKey_BADREQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey(self, method, url, body, headers): + body = self.fixtures.load("tag_tagKey_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_SINGLE( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_tagKey_list_SINGLE.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_ALLFILTERS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + for parameter in parameters: + key, value = parameter.split("=") + if key == "id": + assert value == "fake_id" + elif key == "name": + assert value == "fake_name" + elif key == "valueRequired": + assert value == "false" + elif key == "displayOnReport": + assert value == "false" + elif key == "pageSize": + assert value == "250" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("tag_tagKey_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_d047c609_93d7_4bc5_8fc9_732c85840075( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_d047c609_93d7_4bc5_8fc9_732c85840075_NOEXIST( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_tagKey_5ab77f5f_5aa9_426f_8459_4eab34e03d54_BADREQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_editTagKey_NAME( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}editTagKey": + raise InvalidRequestError(request.tag) + name = findtext(request, "name", TYPES_URN) + description = findtext(request, "description", TYPES_URN) + value_required = findtext(request, "valueRequired", TYPES_URN) + display_on_report = findtext(request, "displayOnReport", TYPES_URN) + if name is None: + raise ValueError("Name must have a value in the request") + if description is not None: + raise ValueError("Description should be empty") + if value_required is not None: + raise ValueError("valueRequired should be empty") + if display_on_report is not None: + raise ValueError("displayOnReport should be empty") + body = self.fixtures.load("tag_editTagKey.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_editTagKey_NOTNAME( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}editTagKey": + raise InvalidRequestError(request.tag) + name = findtext(request, "name", TYPES_URN) + description = findtext(request, "description", TYPES_URN) + value_required = findtext(request, "valueRequired", TYPES_URN) + display_on_report = findtext(request, "displayOnReport", TYPES_URN) + if name is not None: + raise ValueError("Name should be empty") + if description is None: + raise ValueError("Description should not be empty") + if value_required is None: + raise ValueError("valueRequired should not be empty") + if display_on_report is None: + raise ValueError("displayOnReport should not be empty") + body = self.fixtures.load("tag_editTagKey.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_editTagKey_NOCHANGE( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_editTagKey_BADREQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_deleteTagKey( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}deleteTagKey": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("tag_deleteTagKey.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_deleteTagKey_NOEXIST( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_deleteTagKey_BADREQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_applyTags( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}applyTags": + raise InvalidRequestError(request.tag) + asset_type = findtext(request, "assetType", TYPES_URN) + asset_id = findtext(request, "assetId", TYPES_URN) + tag = request.find(fixxpath("tag", TYPES_URN)) + tag_key_name = findtext(tag, "tagKeyName", TYPES_URN) + value = findtext(tag, "value", TYPES_URN) + if asset_type is None: + raise ValueError("assetType should not be empty") + if asset_id is None: + raise ValueError("assetId should not be empty") + if tag_key_name is None: + raise ValueError("tagKeyName should not be empty") + if value is None: + raise ValueError("value should not be empty") + + body = self.fixtures.load("tag_applyTags.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_applyTags_NOVALUE( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}applyTags": + raise InvalidRequestError(request.tag) + asset_type = findtext(request, "assetType", TYPES_URN) + asset_id = findtext(request, "assetId", TYPES_URN) + tag = request.find(fixxpath("tag", TYPES_URN)) + tag_key_name = findtext(tag, "tagKeyName", TYPES_URN) + value = findtext(tag, "value", TYPES_URN) + if asset_type is None: + raise ValueError("assetType should not be empty") + if asset_id is None: + raise ValueError("assetId should not be empty") + if tag_key_name is None: + raise ValueError("tagKeyName should not be empty") + if value is not None: + raise ValueError("value should be empty") + + body = self.fixtures.load("tag_applyTags.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_applyTags_NOTAGKEY( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_applyTags_BADREQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_removeTags( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}removeTags": + raise InvalidRequestError(request.tag) + body = self.fixtures.load("tag_removeTag.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_removeTags_NOTAG( + self, method, url, body, headers + ): + body = self.fixtures.load("tag_removeTag_BADREQUEST.xml") + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tag(self, method, url, body, headers): + body = self.fixtures.load("tag_tag_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tag_ALLPARAMS( + self, method, url, body, headers + ): + _, params = url.split("?") + parameters = params.split("&") + for parameter in parameters: + key, value = parameter.split("=") + if key == "assetId": + assert value == "fake_asset_id" + elif key == "assetType": + assert value == "fake_asset_type" + elif key == "valueRequired": + assert value == "false" + elif key == "displayOnReport": + assert value == "false" + elif key == "pageSize": + assert value == "250" + elif key == "datacenterId": + assert value == "fake_location" + elif key == "value": + assert value == "fake_value" + elif key == "tagKeyName": + assert value == "fake_tag_key_name" + elif key == "tagKeyId": + assert value == "fake_tag_key_id" + else: + raise ValueError("Could not find in url parameters {}:{}".format(key, value)) + body = self.fixtures.load("tag_tag_list.xml") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_ipAddressList( + self, method, url, body, headers + ): + body = self.fixtures.load("ip_address_lists.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_ipAddressList_FILTERBYNAME( + self, method, url, body, headers + ): + body = self.fixtures.load("ip_address_lists_FILTERBYNAME.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createIpAddressList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}" "createIpAddressList": + raise InvalidRequestError(request.tag) + + net_domain = findtext(request, "networkDomainId", TYPES_URN) + if net_domain is None: + raise ValueError("Network Domain should not be empty") + + name = findtext(request, "name", TYPES_URN) + if name is None: + raise ValueError("Name should not be empty") + + ip_version = findtext(request, "ipVersion", TYPES_URN) + if ip_version is None: + raise ValueError("IP Version should not be empty") + + ip_address_col_required = findall(request, "ipAddress", TYPES_URN) + child_ip_address_required = findall(request, "childIpAddressListId", TYPES_URN) + + if 0 == len(ip_address_col_required) and 0 == len(child_ip_address_required): + raise ValueError( + "At least one ipAddress element or " + "one childIpAddressListId element must be " + "provided." + ) + + if ip_address_col_required[0].get("begin") is None: + raise ValueError("IP Address should not be empty") + + body = self.fixtures.load("ip_address_list_create.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editIpAddressList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}" "editIpAddressList": + raise InvalidRequestError(request.tag) + + ip_address_list = request.get("id") + if ip_address_list is None: + raise ValueError("IpAddressList ID should not be empty") + + name = findtext(request, "name", TYPES_URN) + if name is not None: + raise ValueError("Name should not exists in request") + + ip_version = findtext(request, "ipVersion", TYPES_URN) + if ip_version is not None: + raise ValueError("IP Version should not exists in request") + + ip_address_col_required = findall(request, "ipAddress", TYPES_URN) + child_ip_address_required = findall(request, "childIpAddressListId", TYPES_URN) + + if 0 == len(ip_address_col_required) and 0 == len(child_ip_address_required): + raise ValueError( + "At least one ipAddress element or " + "one childIpAddressListId element must be " + "provided." + ) + + if ip_address_col_required[0].get("begin") is None: + raise ValueError("IP Address should not be empty") + + body = self.fixtures.load("ip_address_list_edit.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteIpAddressList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}" "deleteIpAddressList": + raise InvalidRequestError(request.tag) + + ip_address_list = request.get("id") + if ip_address_list is None: + raise ValueError("IpAddressList ID should not be empty") + + body = self.fixtures.load("ip_address_list_delete.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_portList( + self, method, url, body, headers + ): + body = self.fixtures.load("port_list_lists.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_portList_c8c92ea3_2da8_4d51_8153_f39bec794d69( + self, method, url, body, headers + ): + body = self.fixtures.load("port_list_get.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createPortList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}" "createPortList": + raise InvalidRequestError(request.tag) + + net_domain = findtext(request, "networkDomainId", TYPES_URN) + if net_domain is None: + raise ValueError("Network Domain should not be empty") + + ports_required = findall(request, "port", TYPES_URN) + child_port_list_required = findall(request, "childPortListId", TYPES_URN) + + if 0 == len(ports_required) and 0 == len(child_port_list_required): + raise ValueError( + "At least one port element or one " "childPortListId element must be provided" + ) + + if ports_required[0].get("begin") is None: + raise ValueError("PORT begin value should not be empty") + + body = self.fixtures.load("port_list_create.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editPortList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}" "editPortList": + raise InvalidRequestError(request.tag) + + ports_required = findall(request, "port", TYPES_URN) + child_port_list_required = findall(request, "childPortListId", TYPES_URN) + + if 0 == len(ports_required) and 0 == len(child_port_list_required): + raise ValueError( + "At least one port element or one " "childPortListId element must be provided" + ) + + if ports_required[0].get("begin") is None: + raise ValueError("PORT begin value should not be empty") + + body = self.fixtures.load("port_list_edit.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deletePortList( + self, method, url, body, headers + ): + request = ET.fromstring(body) + if request.tag != "{urn:didata.com:api:cloud:types}" "deletePortList": + raise InvalidRequestError(request.tag) + + port_list = request.get("id") + if port_list is None: + raise ValueError("Port List ID should not be empty") + + body = self.fixtures.load("ip_address_list_delete.xml") + + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_cloneServer( + self, method, url, body, headers + ): + body = self.fixtures.load("server_clone_response.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_importImage( + self, method, url, body, headers + ): + body = self.fixtures.load("import_image_response.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_exchangeNicVlans( + self, method, url, body, headers + ): + body = self.fixtures.load("exchange_nic_vlans_response.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_changeNetworkAdapter( + self, method, url, body, headers + ): + body = self.fixtures.load("change_nic_networkadapter_response.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployUncustomizedServer( + self, method, url, body, headers + ): + body = self.fixtures.load("deploy_customised_server.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_snapshot_snapshot( + self, method, url, body, headers + ): + body = self.fixtures.load("list_server_snapshots.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_snapshot_enableSnapshotService( + self, method, url, body, headers + ): + body = self.fixtures.load("enable_snapshot_service.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_snapshot_initiateManualSnapshot( + self, method, url, body, headers + ): + body = self.fixtures.load("initiate_manual_snapshot.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e1eb7d71_93c9_4b9c_807c_e05932dc8143( + self, method, url, body, headers + ): + body = self.fixtures.load("manual_snapshot_server.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_snapshot_createSnapshotPreviewServer( + self, method, url, body, headers + ): + body = self.fixtures.load("create_preview_server.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_snapshot_disableSnapshotService( + self, method, url, body, headers + ): + body = self.fixtures.load("disable_server_snapshot_service.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_consistencyGroup( + self, method, url, body, headers + ): + body = self.fixtures.load("list_consistency_groups.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_consistencyGroup_NET_DOMAIN( + self, method, url, body, headers + ): + body = self.fixtures.load("cg_by_src_network_domain.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_consistencyGroup_CG_BY_NAME( + self, method, url, body, headers + ): + body = self.fixtures.load("get_cg_by_name_or_id.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_consistencyGroup_195a426b_4559_4c79_849e_f22cdf2bfb6e( + self, method, url, body, headers + ): + body = self.fixtures.load("get_cg_by_name_or_id.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_snapshot( + self, method, url, body, headers + ): + body = self.fixtures.load("list_drs_snapshots.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_snapshot_MIN_MAX( + self, method, url, body, headers + ): + body = self.fixtures.load("drs_snap_shots_by_min_max_time.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_snapshot_MIN( + self, method, url, body, headers + ): + body = self.fixtures.load("drs_snap_shots_by_min.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_expandJournal( + self, method, url, body, headers + ): + body = self.fixtures.load("drs_expand_journal.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_startPreviewSnapshot( + self, method, url, body, headers + ): + body = self.fixtures.load("drs_start_failover_preview.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_stopPreviewSnapshot( + self, method, url, body, headers + ): + body = self.fixtures.load("drs_stop_failover_preview.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_initiateFailover_INVALID_STATUS( + self, method, url, body, headers + ): + body = self.fixtures.load("drs_invalid_status.xml") + return httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_initiateFailover( + self, method, url, body, headers + ): + body = self.fixtures.load("drs_initiate_failover.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_createConsistencyGroup_FAIL_INELIGIBLE( + self, method, url, body, headers + ): + body = self.fixtures.load("drs_fail_create_cg_ineligible.xml") + return httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_createConsistencyGroup_FAIL_NOT_SUPPORTED( + self, method, url, body, headers + ): + body = self.fixtures.load("drs_fail_create_cg_not_supported.xml") + return httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_createConsistencyGroup( + self, method, url, body, headers + ): + body = self.fixtures.load("drs_create_cg.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_deleteConsistencyGroup( + self, method, url, body, headers + ): + body = self.fixtures.load("drs_delete_consistency_group.xml") + return httplib.OK, body, {}, httplib.responses[httplib.OK] + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_onapp.py b/libcloud/test/compute/test_onapp.py new file mode 100644 index 0000000000..e97f0716f1 --- /dev/null +++ b/libcloud/test/compute/test_onapp.py @@ -0,0 +1,168 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest + +from libcloud.test import MockHttp, LibcloudTestCase +from libcloud.utils.py3 import httplib +from libcloud.compute.base import Node +from libcloud.test.secrets import ONAPP_PARAMS +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.onapp import OnAppNodeDriver + + +class OnAppNodeTestCase(LibcloudTestCase): + driver_klass = OnAppNodeDriver + + def setUp(self): + self.driver_klass.connectionCls.conn_class = OnAppMockHttp + + self.driver = OnAppNodeDriver(*ONAPP_PARAMS) + + def test_create_node(self): + node = self.driver.create_node( + name="onapp-new-fred", + size=None, + image=None, + ex_memory=512, + ex_cpus=4, + ex_cpu_shares=4, + ex_hostname="onapp-new-fred", + ex_template_id="template_id", + ex_primary_disk_size=100, + ex_swap_disk_size=1, + ex_required_virtual_machine_build=0, + ex_required_ip_address_assignment=0, + ) + + extra = node.extra + + self.assertEqual("onapp-new-fred", node.name) + self.assertEqual("456789", node.id) + self.assertEqual("456789", node.id) + + self.assertEqual("delivered", node.state) + + self.assertEqual(True, extra["booted"]) + self.assertEqual("passwd", extra["initial_root_password"]) + self.assertEqual("8.8.8.8", extra["local_remote_access_ip_address"]) + + self.assertEqual(["192.168.15.73"], node.private_ips) + self.assertEqual([], node.public_ips) + + def test_destroy_node(self): + node = Node( + "identABC", + "testnode", + ["123.123.123.123"], + [], + {"state": "test", "template_id": 88}, + None, + ) + res = self.driver.destroy_node(node=node) + self.assertTrue(res) + + def test_list_nodes(self): + nodes = self.driver.list_nodes() + extra = nodes[0].extra + private_ips = nodes[0].private_ips + + self.assertEqual(1, len(nodes)) + self.assertEqual("onapp-fred", nodes[0].name) + self.assertEqual("123456", nodes[0].id) + + self.assertEqual(True, extra["booted"]) + self.assertEqual("passwd", extra["initial_root_password"]) + self.assertEqual("9.9.9.9", extra["local_remote_access_ip_address"]) + + self.assertEqual(1, len(private_ips)) + self.assertEqual("192.168.15.72", private_ips[0]) + + def test_list_images(self): + images = self.driver.list_images() + extra = images[0].extra + + self.assertEqual(1, len(images)) + self.assertEqual("CentOS 5.11 x64", images[0].name) + self.assertEqual("123456", images[0].id) + + self.assertEqual(True, extra["allowed_swap"]) + self.assertEqual(256, extra["min_memory_size"]) + self.assertEqual("rhel", extra["distribution"]) + + def test_list_key_pairs(self): + keys = self.driver.list_key_pairs() + self.assertEqual(2, len(keys)) + self.assertEqual(1, keys[0].name) + self.assertIsNotNone(keys[0].public_key) + self.assertIsNotNone(keys[1].public_key) + + def test_get_key_pair(self): + key = self.driver.get_key_pair(1) + self.assertEqual(1, key.name) + self.assertIsNotNone(key.public_key) + + def test_import_key_pair_from_string(self): + key = self.driver.import_key_pair_from_string( + "name", "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8uuUq" + ) + self.assertEqual(3, key.name) + self.assertEqual("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8uuUq", key.public_key) + + def test_delete_key_pair(self): + key = self.driver.get_key_pair(1) + response = self.driver.delete_key_pair(key) + self.assertTrue(response) + + +class OnAppMockHttp(MockHttp): + fixtures = ComputeFileFixtures("onapp") + + def _virtual_machines_json(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_nodes.json") + else: + body = self.fixtures.load("create_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _virtual_machines_identABC_json(self, method, url, body, headers): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT]) + + def _templates_json(self, method, url, body, headers): + body = self.fixtures.load("list_images.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _profile_json(self, method, url, body, headers): + body = self.fixtures.load("profile.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _users_123_ssh_keys_json(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_key_pairs.json") + else: + body = self.fixtures.load("import_key_pair.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _users_123_ssh_keys_1_json(self, method, url, body, headers): + body = self.fixtures.load("get_key_pair.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _settings_ssh_keys_1_json(self, method, url, body, headers): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_opennebula.py b/libcloud/test/compute/test_opennebula.py index 8dcedfd767..9f23914030 100644 --- a/libcloud/test/compute/test_opennebula.py +++ b/libcloud/test/compute/test_opennebula.py @@ -20,51 +20,28 @@ OpenNebula.org test suite. """ -__docformat__ = 'epytext' +__docformat__ = "epytext" -import unittest import sys +import unittest +import libcloud.compute.drivers.opennebula +from libcloud.test import MockHttp from libcloud.utils.py3 import httplib - -from libcloud.compute.base import Node, NodeImage, NodeSize, NodeState -from libcloud.compute.drivers.opennebula import OpenNebulaNodeDriver -from libcloud.compute.drivers.opennebula import OpenNebulaNetwork -from libcloud.compute.drivers.opennebula import OpenNebulaResponse -from libcloud.compute.drivers.opennebula import OpenNebulaNodeSize -from libcloud.compute.drivers.opennebula import ACTION - -from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.common.types import InvalidCredsError -from libcloud.test import MockResponse, MockHttp -from libcloud.test.compute import TestCaseMixin - +from libcloud.compute.base import Node, NodeSize, NodeImage, NodeState from libcloud.test.secrets import OPENNEBULA_PARAMS +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.opennebula import ( + ACTION, + OpenNebulaNetwork, + OpenNebulaNodeSize, + OpenNebulaNodeDriver, +) +libcloud.compute.drivers.opennebula.API_HOST = "dummy" -class OpenNebulaCaseMixin(TestCaseMixin): - - def test_reboot_node_response(self): - pass - - -class OpenNebula_ResponseTests(unittest.TestCase): - XML = """""" - - def test_unauthorized_response(self): - http_response = MockResponse(httplib.UNAUTHORIZED, - OpenNebula_ResponseTests.XML, - headers={'content-type': - 'application/xml'}) - try: - OpenNebulaResponse(http_response, None).parse_body() - except InvalidCredsError: - exceptionType = sys.exc_info()[0] - self.assertEqual(exceptionType, type(InvalidCredsError())) - - -class OpenNebula_1_4_Tests(unittest.TestCase, OpenNebulaCaseMixin): +class OpenNebula_1_4_Tests(unittest.TestCase): """ OpenNebula.org test suite for OpenNebula v1.4. """ @@ -73,41 +50,59 @@ def setUp(self): """ Setup test environment. """ - OpenNebulaNodeDriver.connectionCls.conn_classes = ( - OpenNebula_1_4_MockHttp, OpenNebula_1_4_MockHttp) - self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ('1.4',)) + OpenNebulaNodeDriver.connectionCls.conn_class = OpenNebula_1_4_MockHttp + self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ("1.4",), host="dummy") def test_create_node(self): """ Test create_node functionality. """ - image = NodeImage(id=5, name='Ubuntu 9.04 LAMP', driver=self.driver) - size = NodeSize(id=1, name='small', ram=None, disk=None, - bandwidth=None, price=None, driver=self.driver) + image = NodeImage(id=5, name="Ubuntu 9.04 LAMP", driver=self.driver) + size = NodeSize( + id=1, + name="small", + ram=None, + disk=None, + bandwidth=None, + price=None, + driver=self.driver, + ) networks = list() - networks.append(OpenNebulaNetwork(id=5, name='Network 5', - address='192.168.0.0', size=256, driver=self.driver)) - networks.append(OpenNebulaNetwork(id=15, name='Network 15', - address='192.168.1.0', size=256, driver=self.driver)) - - node = self.driver.create_node(name='Compute 5', image=image, - size=size, networks=networks) - - self.assertEqual(node.id, '5') - self.assertEqual(node.name, 'Compute 5') - self.assertEqual(node.state, - OpenNebulaNodeDriver.NODE_STATE_MAP['ACTIVE']) - self.assertEqual(node.public_ips[0].name, None) - self.assertEqual(node.public_ips[0].id, '5') - self.assertEqual(node.public_ips[0].address, '192.168.0.1') + networks.append( + OpenNebulaNetwork( + id=5, + name="Network 5", + address="192.168.0.0", + size=256, + driver=self.driver, + ) + ) + networks.append( + OpenNebulaNetwork( + id=15, + name="Network 15", + address="192.168.1.0", + size=256, + driver=self.driver, + ) + ) + + node = self.driver.create_node(name="Compute 5", image=image, size=size, networks=networks) + + self.assertEqual(node.id, "5") + self.assertEqual(node.name, "Compute 5") + self.assertEqual(node.state, OpenNebulaNodeDriver.NODE_STATE_MAP["ACTIVE"]) + self.assertIsNone(node.public_ips[0].name) + self.assertEqual(node.public_ips[0].id, "5") + self.assertEqual(node.public_ips[0].address, "192.168.0.1") self.assertEqual(node.public_ips[0].size, 1) - self.assertEqual(node.public_ips[1].name, None) - self.assertEqual(node.public_ips[1].id, '15') - self.assertEqual(node.public_ips[1].address, '192.168.1.1') + self.assertIsNone(node.public_ips[1].name) + self.assertEqual(node.public_ips[1].id, "15") + self.assertEqual(node.public_ips[1].address, "192.168.1.1") self.assertEqual(node.public_ips[1].size, 1) self.assertEqual(node.private_ips, []) - self.assertEqual(node.image.id, '5') - self.assertEqual(node.image.extra['dev'], 'sda1') + self.assertEqual(node.image.id, "5") + self.assertEqual(node.image.extra["dev"], "sda1") def test_destroy_node(self): """ @@ -125,52 +120,49 @@ def test_list_nodes(self): self.assertEqual(len(nodes), 3) node = nodes[0] - self.assertEqual(node.id, '5') - self.assertEqual(node.name, 'Compute 5') - self.assertEqual(node.state, - OpenNebulaNodeDriver.NODE_STATE_MAP['ACTIVE']) - self.assertEqual(node.public_ips[0].id, '5') - self.assertEqual(node.public_ips[0].name, None) - self.assertEqual(node.public_ips[0].address, '192.168.0.1') + self.assertEqual(node.id, "5") + self.assertEqual(node.name, "Compute 5") + self.assertEqual(node.state, OpenNebulaNodeDriver.NODE_STATE_MAP["ACTIVE"]) + self.assertEqual(node.public_ips[0].id, "5") + self.assertIsNone(node.public_ips[0].name) + self.assertEqual(node.public_ips[0].address, "192.168.0.1") self.assertEqual(node.public_ips[0].size, 1) - self.assertEqual(node.public_ips[1].id, '15') - self.assertEqual(node.public_ips[1].name, None) - self.assertEqual(node.public_ips[1].address, '192.168.1.1') + self.assertEqual(node.public_ips[1].id, "15") + self.assertIsNone(node.public_ips[1].name) + self.assertEqual(node.public_ips[1].address, "192.168.1.1") self.assertEqual(node.public_ips[1].size, 1) self.assertEqual(node.private_ips, []) - self.assertEqual(node.image.id, '5') - self.assertEqual(node.image.extra['dev'], 'sda1') + self.assertEqual(node.image.id, "5") + self.assertEqual(node.image.extra["dev"], "sda1") node = nodes[1] - self.assertEqual(node.id, '15') - self.assertEqual(node.name, 'Compute 15') - self.assertEqual(node.state, - OpenNebulaNodeDriver.NODE_STATE_MAP['ACTIVE']) - self.assertEqual(node.public_ips[0].id, '5') - self.assertEqual(node.public_ips[0].name, None) - self.assertEqual(node.public_ips[0].address, '192.168.0.2') + self.assertEqual(node.id, "15") + self.assertEqual(node.name, "Compute 15") + self.assertEqual(node.state, OpenNebulaNodeDriver.NODE_STATE_MAP["ACTIVE"]) + self.assertEqual(node.public_ips[0].id, "5") + self.assertIsNone(node.public_ips[0].name) + self.assertEqual(node.public_ips[0].address, "192.168.0.2") self.assertEqual(node.public_ips[0].size, 1) - self.assertEqual(node.public_ips[1].id, '15') - self.assertEqual(node.public_ips[1].name, None) - self.assertEqual(node.public_ips[1].address, '192.168.1.2') + self.assertEqual(node.public_ips[1].id, "15") + self.assertIsNone(node.public_ips[1].name) + self.assertEqual(node.public_ips[1].address, "192.168.1.2") self.assertEqual(node.public_ips[1].size, 1) self.assertEqual(node.private_ips, []) - self.assertEqual(node.image.id, '15') - self.assertEqual(node.image.extra['dev'], 'sda1') + self.assertEqual(node.image.id, "15") + self.assertEqual(node.image.extra["dev"], "sda1") node = nodes[2] - self.assertEqual(node.id, '25') - self.assertEqual(node.name, 'Compute 25') - self.assertEqual(node.state, - NodeState.UNKNOWN) - self.assertEqual(node.public_ips[0].id, '5') - self.assertEqual(node.public_ips[0].name, None) - self.assertEqual(node.public_ips[0].address, '192.168.0.3') + self.assertEqual(node.id, "25") + self.assertEqual(node.name, "Compute 25") + self.assertEqual(node.state, NodeState.UNKNOWN) + self.assertEqual(node.public_ips[0].id, "5") + self.assertIsNone(node.public_ips[0].name) + self.assertEqual(node.public_ips[0].address, "192.168.0.3") self.assertEqual(node.public_ips[0].size, 1) - self.assertEqual(node.public_ips[1].id, '15') - self.assertEqual(node.public_ips[1].name, None) - self.assertEqual(node.public_ips[1].address, '192.168.1.3') + self.assertEqual(node.public_ips[1].id, "15") + self.assertIsNone(node.public_ips[1].name) + self.assertEqual(node.public_ips[1].address, "192.168.1.3") self.assertEqual(node.public_ips[1].size, 1) self.assertEqual(node.private_ips, []) - self.assertEqual(node.image, None) + self.assertIsNone(node.image) def test_list_images(self): """ @@ -180,17 +172,15 @@ def test_list_images(self): self.assertEqual(len(images), 2) image = images[0] - self.assertEqual(image.id, '5') - self.assertEqual(image.name, 'Ubuntu 9.04 LAMP') - self.assertEqual(image.extra['size'], '2048') - self.assertEqual(image.extra['url'], - 'file:///images/ubuntu/jaunty.img') + self.assertEqual(image.id, "5") + self.assertEqual(image.name, "Ubuntu 9.04 LAMP") + self.assertEqual(image.extra["size"], "2048") + self.assertEqual(image.extra["url"], "file:///images/ubuntu/jaunty.img") image = images[1] - self.assertEqual(image.id, '15') - self.assertEqual(image.name, 'Ubuntu 9.04 LAMP') - self.assertEqual(image.extra['size'], '2048') - self.assertEqual(image.extra['url'], - 'file:///images/ubuntu/jaunty.img') + self.assertEqual(image.id, "15") + self.assertEqual(image.name, "Ubuntu 9.04 LAMP") + self.assertEqual(image.extra["size"], "2048") + self.assertEqual(image.extra["url"], "file:///images/ubuntu/jaunty.img") def test_list_sizes(self): """ @@ -200,26 +190,26 @@ def test_list_sizes(self): self.assertEqual(len(sizes), 3) size = sizes[0] - self.assertEqual(size.id, '1') - self.assertEqual(size.name, 'small') - self.assertEqual(size.ram, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertEqual(size.id, "1") + self.assertEqual(size.name, "small") + self.assertIsNone(size.ram) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) size = sizes[1] - self.assertEqual(size.id, '2') - self.assertEqual(size.name, 'medium') - self.assertEqual(size.ram, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertEqual(size.id, "2") + self.assertEqual(size.name, "medium") + self.assertIsNone(size.ram) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) size = sizes[2] - self.assertEqual(size.id, '3') - self.assertEqual(size.name, 'large') - self.assertEqual(size.ram, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertEqual(size.id, "3") + self.assertEqual(size.name, "large") + self.assertIsNone(size.ram) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) def test_list_locations(self): """ @@ -229,9 +219,9 @@ def test_list_locations(self): self.assertEqual(len(locations), 1) location = locations[0] - self.assertEqual(location.id, '0') - self.assertEqual(location.name, '') - self.assertEqual(location.country, '') + self.assertEqual(location.id, "0") + self.assertEqual(location.name, "") + self.assertEqual(location.country, "") def test_ex_list_networks(self): """ @@ -241,15 +231,15 @@ def test_ex_list_networks(self): self.assertEqual(len(networks), 2) network = networks[0] - self.assertEqual(network.id, '5') - self.assertEqual(network.name, 'Network 5') - self.assertEqual(network.address, '192.168.0.0') - self.assertEqual(network.size, '256') + self.assertEqual(network.id, "5") + self.assertEqual(network.name, "Network 5") + self.assertEqual(network.address, "192.168.0.0") + self.assertEqual(network.size, "256") network = networks[1] - self.assertEqual(network.id, '15') - self.assertEqual(network.name, 'Network 15') - self.assertEqual(network.address, '192.168.1.0') - self.assertEqual(network.size, '256') + self.assertEqual(network.id, "15") + self.assertEqual(network.name, "Network 15") + self.assertEqual(network.address, "192.168.1.0") + self.assertEqual(network.size, "256") def test_ex_node_action(self): """ @@ -260,8 +250,7 @@ def test_ex_node_action(self): self.assertTrue(ret) -class OpenNebula_2_0_Tests(unittest.TestCase, OpenNebulaCaseMixin): - +class OpenNebula_2_0_Tests(unittest.TestCase): """ OpenNebula.org test suite for OpenNebula v2.0 through v2.2. """ @@ -270,52 +259,70 @@ def setUp(self): """ Setup test environment. """ - OpenNebulaNodeDriver.connectionCls.conn_classes = ( - OpenNebula_2_0_MockHttp, OpenNebula_2_0_MockHttp) - self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ('2.0',)) + OpenNebulaNodeDriver.connectionCls.conn_class = OpenNebula_2_0_MockHttp + self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ("2.0",), host="dummy") def test_create_node(self): """ Test create_node functionality. """ - image = NodeImage(id=5, name='Ubuntu 9.04 LAMP', driver=self.driver) - size = OpenNebulaNodeSize(id=1, name='small', ram=1024, cpu=1, - disk=None, bandwidth=None, price=None, - driver=self.driver) + image = NodeImage(id=5, name="Ubuntu 9.04 LAMP", driver=self.driver) + size = OpenNebulaNodeSize( + id=1, + name="small", + ram=1024, + cpu=1, + disk=None, + bandwidth=None, + price=None, + driver=self.driver, + ) networks = list() - networks.append(OpenNebulaNetwork(id=5, name='Network 5', - address='192.168.0.0', size=256, driver=self.driver)) - networks.append(OpenNebulaNetwork(id=15, name='Network 15', - address='192.168.1.0', size=256, driver=self.driver)) - context = {'hostname': 'compute-5'} - - node = self.driver.create_node(name='Compute 5', image=image, - size=size, networks=networks, - context=context) - - self.assertEqual(node.id, '5') - self.assertEqual(node.name, 'Compute 5') - self.assertEqual(node.state, - OpenNebulaNodeDriver.NODE_STATE_MAP['ACTIVE']) - self.assertEqual(node.public_ips[0].id, '5') - self.assertEqual(node.public_ips[0].name, 'Network 5') - self.assertEqual(node.public_ips[0].address, '192.168.0.1') + networks.append( + OpenNebulaNetwork( + id=5, + name="Network 5", + address="192.168.0.0", + size=256, + driver=self.driver, + ) + ) + networks.append( + OpenNebulaNetwork( + id=15, + name="Network 15", + address="192.168.1.0", + size=256, + driver=self.driver, + ) + ) + context = {"hostname": "compute-5"} + + node = self.driver.create_node( + name="Compute 5", image=image, size=size, networks=networks, context=context + ) + + self.assertEqual(node.id, "5") + self.assertEqual(node.name, "Compute 5") + self.assertEqual(node.state, OpenNebulaNodeDriver.NODE_STATE_MAP["ACTIVE"]) + self.assertEqual(node.public_ips[0].id, "5") + self.assertEqual(node.public_ips[0].name, "Network 5") + self.assertEqual(node.public_ips[0].address, "192.168.0.1") self.assertEqual(node.public_ips[0].size, 1) - self.assertEqual(node.public_ips[0].extra['mac'], '02:00:c0:a8:00:01') - self.assertEqual(node.public_ips[1].id, '15') - self.assertEqual(node.public_ips[1].name, 'Network 15') - self.assertEqual(node.public_ips[1].address, '192.168.1.1') + self.assertEqual(node.public_ips[0].extra["mac"], "02:00:c0:a8:00:01") + self.assertEqual(node.public_ips[1].id, "15") + self.assertEqual(node.public_ips[1].name, "Network 15") + self.assertEqual(node.public_ips[1].address, "192.168.1.1") self.assertEqual(node.public_ips[1].size, 1) - self.assertEqual(node.public_ips[1].extra['mac'], '02:00:c0:a8:01:01') + self.assertEqual(node.public_ips[1].extra["mac"], "02:00:c0:a8:01:01") self.assertEqual(node.private_ips, []) - self.assertTrue(len([s for s in self.driver.list_sizes() - if s.id == node.size.id]) == 1) - self.assertEqual(node.image.id, '5') - self.assertEqual(node.image.name, 'Ubuntu 9.04 LAMP') - self.assertEqual(node.image.extra['type'], 'DISK') - self.assertEqual(node.image.extra['target'], 'hda') - context = node.extra['context'] - self.assertEqual(context['hostname'], 'compute-5') + self.assertTrue(len([s for s in self.driver.list_sizes() if s.id == node.size.id]) == 1) + self.assertEqual(node.image.id, "5") + self.assertEqual(node.image.name, "Ubuntu 9.04 LAMP") + self.assertEqual(node.image.extra["type"], "DISK") + self.assertEqual(node.image.extra["target"], "hda") + context = node.extra["context"] + self.assertEqual(context["hostname"], "compute-5") def test_destroy_node(self): """ @@ -333,100 +340,97 @@ def test_list_nodes(self): self.assertEqual(len(nodes), 3) node = nodes[0] - self.assertEqual(node.id, '5') - self.assertEqual(node.name, 'Compute 5') - self.assertEqual(node.state, - OpenNebulaNodeDriver.NODE_STATE_MAP['ACTIVE']) - self.assertEqual(node.public_ips[0].id, '5') - self.assertEqual(node.public_ips[0].name, 'Network 5') - self.assertEqual(node.public_ips[0].address, '192.168.0.1') + self.assertEqual(node.id, "5") + self.assertEqual(node.name, "Compute 5") + self.assertEqual(node.state, OpenNebulaNodeDriver.NODE_STATE_MAP["ACTIVE"]) + self.assertEqual(node.public_ips[0].id, "5") + self.assertEqual(node.public_ips[0].name, "Network 5") + self.assertEqual(node.public_ips[0].address, "192.168.0.1") self.assertEqual(node.public_ips[0].size, 1) - self.assertEqual(node.public_ips[0].extra['mac'], '02:00:c0:a8:00:01') - self.assertEqual(node.public_ips[1].id, '15') - self.assertEqual(node.public_ips[1].name, 'Network 15') - self.assertEqual(node.public_ips[1].address, '192.168.1.1') + self.assertEqual(node.public_ips[0].extra["mac"], "02:00:c0:a8:00:01") + self.assertEqual(node.public_ips[1].id, "15") + self.assertEqual(node.public_ips[1].name, "Network 15") + self.assertEqual(node.public_ips[1].address, "192.168.1.1") self.assertEqual(node.public_ips[1].size, 1) - self.assertEqual(node.public_ips[1].extra['mac'], '02:00:c0:a8:01:01') + self.assertEqual(node.public_ips[1].extra["mac"], "02:00:c0:a8:01:01") self.assertEqual(node.private_ips, []) - self.assertTrue(len([size for size in self.driver.list_sizes() - if size.id == node.size.id]) == 1) - self.assertEqual(node.size.id, '1') - self.assertEqual(node.size.name, 'small') + self.assertTrue( + len([size for size in self.driver.list_sizes() if size.id == node.size.id]) == 1 + ) + self.assertEqual(node.size.id, "1") + self.assertEqual(node.size.name, "small") self.assertEqual(node.size.ram, 1024) - self.assertTrue(node.size.cpu is None or isinstance(node.size.cpu, - int)) - self.assertTrue(node.size.vcpu is None or isinstance(node.size.vcpu, - int)) + self.assertTrue(node.size.cpu is None or isinstance(node.size.cpu, int)) + self.assertTrue(node.size.vcpu is None or isinstance(node.size.vcpu, int)) self.assertEqual(node.size.cpu, 1) - self.assertEqual(node.size.vcpu, None) - self.assertEqual(node.size.disk, None) - self.assertEqual(node.size.bandwidth, None) - self.assertEqual(node.size.price, None) - self.assertTrue(len([image for image in self.driver.list_images() - if image.id == node.image.id]) == 1) - self.assertEqual(node.image.id, '5') - self.assertEqual(node.image.name, 'Ubuntu 9.04 LAMP') - self.assertEqual(node.image.extra['type'], 'DISK') - self.assertEqual(node.image.extra['target'], 'hda') - context = node.extra['context'] - self.assertEqual(context['hostname'], 'compute-5') + self.assertIsNone(node.size.vcpu) + self.assertIsNone(node.size.disk) + self.assertIsNone(node.size.bandwidth) + self.assertIsNone(node.size.price) + self.assertTrue( + len([image for image in self.driver.list_images() if image.id == node.image.id]) == 1 + ) + self.assertEqual(node.image.id, "5") + self.assertEqual(node.image.name, "Ubuntu 9.04 LAMP") + self.assertEqual(node.image.extra["type"], "DISK") + self.assertEqual(node.image.extra["target"], "hda") + context = node.extra["context"] + self.assertEqual(context["hostname"], "compute-5") node = nodes[1] - self.assertEqual(node.id, '15') - self.assertEqual(node.name, 'Compute 15') - self.assertEqual(node.state, - OpenNebulaNodeDriver.NODE_STATE_MAP['ACTIVE']) - self.assertEqual(node.public_ips[0].id, '5') - self.assertEqual(node.public_ips[0].name, 'Network 5') - self.assertEqual(node.public_ips[0].address, '192.168.0.2') + self.assertEqual(node.id, "15") + self.assertEqual(node.name, "Compute 15") + self.assertEqual(node.state, OpenNebulaNodeDriver.NODE_STATE_MAP["ACTIVE"]) + self.assertEqual(node.public_ips[0].id, "5") + self.assertEqual(node.public_ips[0].name, "Network 5") + self.assertEqual(node.public_ips[0].address, "192.168.0.2") self.assertEqual(node.public_ips[0].size, 1) - self.assertEqual(node.public_ips[0].extra['mac'], '02:00:c0:a8:00:02') - self.assertEqual(node.public_ips[1].id, '15') - self.assertEqual(node.public_ips[1].name, 'Network 15') - self.assertEqual(node.public_ips[1].address, '192.168.1.2') + self.assertEqual(node.public_ips[0].extra["mac"], "02:00:c0:a8:00:02") + self.assertEqual(node.public_ips[1].id, "15") + self.assertEqual(node.public_ips[1].name, "Network 15") + self.assertEqual(node.public_ips[1].address, "192.168.1.2") self.assertEqual(node.public_ips[1].size, 1) - self.assertEqual(node.public_ips[1].extra['mac'], '02:00:c0:a8:01:02') + self.assertEqual(node.public_ips[1].extra["mac"], "02:00:c0:a8:01:02") self.assertEqual(node.private_ips, []) - self.assertTrue(len([size for size in self.driver.list_sizes() - if size.id == node.size.id]) == 1) - self.assertEqual(node.size.id, '1') - self.assertEqual(node.size.name, 'small') + self.assertTrue( + len([size for size in self.driver.list_sizes() if size.id == node.size.id]) == 1 + ) + self.assertEqual(node.size.id, "1") + self.assertEqual(node.size.name, "small") self.assertEqual(node.size.ram, 1024) - self.assertTrue(node.size.cpu is None or isinstance(node.size.cpu, - int)) - self.assertTrue(node.size.vcpu is None or isinstance(node.size.vcpu, - int)) + self.assertTrue(node.size.cpu is None or isinstance(node.size.cpu, int)) + self.assertTrue(node.size.vcpu is None or isinstance(node.size.vcpu, int)) self.assertEqual(node.size.cpu, 1) - self.assertEqual(node.size.vcpu, None) - self.assertEqual(node.size.disk, None) - self.assertEqual(node.size.bandwidth, None) - self.assertEqual(node.size.price, None) - self.assertTrue(len([image for image in self.driver.list_images() - if image.id == node.image.id]) == 1) - self.assertEqual(node.image.id, '15') - self.assertEqual(node.image.name, 'Ubuntu 9.04 LAMP') - self.assertEqual(node.image.extra['type'], 'DISK') - self.assertEqual(node.image.extra['target'], 'hda') - context = node.extra['context'] - self.assertEqual(context['hostname'], 'compute-15') + self.assertIsNone(node.size.vcpu) + self.assertIsNone(node.size.disk) + self.assertIsNone(node.size.bandwidth) + self.assertIsNone(node.size.price) + self.assertTrue( + len([image for image in self.driver.list_images() if image.id == node.image.id]) == 1 + ) + self.assertEqual(node.image.id, "15") + self.assertEqual(node.image.name, "Ubuntu 9.04 LAMP") + self.assertEqual(node.image.extra["type"], "DISK") + self.assertEqual(node.image.extra["target"], "hda") + context = node.extra["context"] + self.assertEqual(context["hostname"], "compute-15") node = nodes[2] - self.assertEqual(node.id, '25') - self.assertEqual(node.name, 'Compute 25') - self.assertEqual(node.state, - NodeState.UNKNOWN) - self.assertEqual(node.public_ips[0].id, '5') - self.assertEqual(node.public_ips[0].name, 'Network 5') - self.assertEqual(node.public_ips[0].address, '192.168.0.3') + self.assertEqual(node.id, "25") + self.assertEqual(node.name, "Compute 25") + self.assertEqual(node.state, NodeState.UNKNOWN) + self.assertEqual(node.public_ips[0].id, "5") + self.assertEqual(node.public_ips[0].name, "Network 5") + self.assertEqual(node.public_ips[0].address, "192.168.0.3") self.assertEqual(node.public_ips[0].size, 1) - self.assertEqual(node.public_ips[0].extra['mac'], '02:00:c0:a8:00:03') - self.assertEqual(node.public_ips[1].id, '15') - self.assertEqual(node.public_ips[1].name, 'Network 15') - self.assertEqual(node.public_ips[1].address, '192.168.1.3') + self.assertEqual(node.public_ips[0].extra["mac"], "02:00:c0:a8:00:03") + self.assertEqual(node.public_ips[1].id, "15") + self.assertEqual(node.public_ips[1].name, "Network 15") + self.assertEqual(node.public_ips[1].address, "192.168.1.3") self.assertEqual(node.public_ips[1].size, 1) - self.assertEqual(node.public_ips[1].extra['mac'], '02:00:c0:a8:01:03') + self.assertEqual(node.public_ips[1].extra["mac"], "02:00:c0:a8:01:03") self.assertEqual(node.private_ips, []) - self.assertEqual(node.size, None) - self.assertEqual(node.image, None) - context = node.extra['context'] + self.assertIsNone(node.size) + self.assertIsNone(node.image) + context = node.extra["context"] self.assertEqual(context, {}) def test_list_images(self): @@ -437,19 +441,17 @@ def test_list_images(self): self.assertEqual(len(images), 2) image = images[0] - self.assertEqual(image.id, '5') - self.assertEqual(image.name, 'Ubuntu 9.04 LAMP') - self.assertEqual(image.extra['description'], - 'Ubuntu 9.04 LAMP Description') - self.assertEqual(image.extra['type'], 'OS') - self.assertEqual(image.extra['size'], '2048') + self.assertEqual(image.id, "5") + self.assertEqual(image.name, "Ubuntu 9.04 LAMP") + self.assertEqual(image.extra["description"], "Ubuntu 9.04 LAMP Description") + self.assertEqual(image.extra["type"], "OS") + self.assertEqual(image.extra["size"], "2048") image = images[1] - self.assertEqual(image.id, '15') - self.assertEqual(image.name, 'Ubuntu 9.04 LAMP') - self.assertEqual(image.extra['description'], - 'Ubuntu 9.04 LAMP Description') - self.assertEqual(image.extra['type'], 'OS') - self.assertEqual(image.extra['size'], '2048') + self.assertEqual(image.id, "15") + self.assertEqual(image.name, "Ubuntu 9.04 LAMP") + self.assertEqual(image.extra["description"], "Ubuntu 9.04 LAMP Description") + self.assertEqual(image.extra["type"], "OS") + self.assertEqual(image.extra["size"], "2048") def test_list_sizes(self): """ @@ -459,47 +461,47 @@ def test_list_sizes(self): self.assertEqual(len(sizes), 4) size = sizes[0] - self.assertEqual(size.id, '1') - self.assertEqual(size.name, 'small') + self.assertEqual(size.id, "1") + self.assertEqual(size.name, "small") self.assertEqual(size.ram, 1024) self.assertTrue(size.cpu is None or isinstance(size.cpu, int)) self.assertTrue(size.vcpu is None or isinstance(size.vcpu, int)) self.assertEqual(size.cpu, 1) - self.assertEqual(size.vcpu, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertIsNone(size.vcpu) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) size = sizes[1] - self.assertEqual(size.id, '2') - self.assertEqual(size.name, 'medium') + self.assertEqual(size.id, "2") + self.assertEqual(size.name, "medium") self.assertEqual(size.ram, 4096) self.assertTrue(size.cpu is None or isinstance(size.cpu, int)) self.assertTrue(size.vcpu is None or isinstance(size.vcpu, int)) self.assertEqual(size.cpu, 4) - self.assertEqual(size.vcpu, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertIsNone(size.vcpu) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) size = sizes[2] - self.assertEqual(size.id, '3') - self.assertEqual(size.name, 'large') + self.assertEqual(size.id, "3") + self.assertEqual(size.name, "large") self.assertEqual(size.ram, 8192) self.assertTrue(size.cpu is None or isinstance(size.cpu, int)) self.assertTrue(size.vcpu is None or isinstance(size.vcpu, int)) self.assertEqual(size.cpu, 8) - self.assertEqual(size.vcpu, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertIsNone(size.vcpu) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) size = sizes[3] - self.assertEqual(size.id, '4') - self.assertEqual(size.name, 'custom') + self.assertEqual(size.id, "4") + self.assertEqual(size.name, "custom") self.assertEqual(size.ram, 0) self.assertEqual(size.cpu, 0) - self.assertEqual(size.vcpu, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertIsNone(size.vcpu) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) def test_list_locations(self): """ @@ -509,9 +511,9 @@ def test_list_locations(self): self.assertEqual(len(locations), 1) location = locations[0] - self.assertEqual(location.id, '0') - self.assertEqual(location.name, '') - self.assertEqual(location.country, '') + self.assertEqual(location.id, "0") + self.assertEqual(location.name, "") + self.assertEqual(location.country, "") def test_ex_list_networks(self): """ @@ -521,19 +523,18 @@ def test_ex_list_networks(self): self.assertEqual(len(networks), 2) network = networks[0] - self.assertEqual(network.id, '5') - self.assertEqual(network.name, 'Network 5') - self.assertEqual(network.address, '192.168.0.0') - self.assertEqual(network.size, '256') + self.assertEqual(network.id, "5") + self.assertEqual(network.name, "Network 5") + self.assertEqual(network.address, "192.168.0.0") + self.assertEqual(network.size, "256") network = networks[1] - self.assertEqual(network.id, '15') - self.assertEqual(network.name, 'Network 15') - self.assertEqual(network.address, '192.168.1.0') - self.assertEqual(network.size, '256') + self.assertEqual(network.id, "15") + self.assertEqual(network.name, "Network 15") + self.assertEqual(network.address, "192.168.1.0") + self.assertEqual(network.size, "256") -class OpenNebula_3_0_Tests(unittest.TestCase, OpenNebulaCaseMixin): - +class OpenNebula_3_0_Tests(unittest.TestCase): """ OpenNebula.org test suite for OpenNebula v3.0. """ @@ -542,9 +543,8 @@ def setUp(self): """ Setup test environment. """ - OpenNebulaNodeDriver.connectionCls.conn_classes = ( - OpenNebula_3_0_MockHttp, OpenNebula_3_0_MockHttp) - self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ('3.0',)) + OpenNebulaNodeDriver.connectionCls.conn_class = OpenNebula_3_0_MockHttp + self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ("3.0",), host="dummy") def test_ex_list_networks(self): """ @@ -554,30 +554,29 @@ def test_ex_list_networks(self): self.assertEqual(len(networks), 2) network = networks[0] - self.assertEqual(network.id, '5') - self.assertEqual(network.name, 'Network 5') - self.assertEqual(network.address, '192.168.0.0') - self.assertEqual(network.size, '256') - self.assertEqual(network.extra['public'], 'YES') + self.assertEqual(network.id, "5") + self.assertEqual(network.name, "Network 5") + self.assertEqual(network.address, "192.168.0.0") + self.assertEqual(network.size, "256") + self.assertEqual(network.extra["public"], "YES") network = networks[1] - self.assertEqual(network.id, '15') - self.assertEqual(network.name, 'Network 15') - self.assertEqual(network.address, '192.168.1.0') - self.assertEqual(network.size, '256') - self.assertEqual(network.extra['public'], 'NO') + self.assertEqual(network.id, "15") + self.assertEqual(network.name, "Network 15") + self.assertEqual(network.address, "192.168.1.0") + self.assertEqual(network.size, "256") + self.assertEqual(network.extra["public"], "NO") def test_ex_node_set_save_name(self): """ Test ex_node_action functionality. """ - image = NodeImage(id=5, name='Ubuntu 9.04 LAMP', driver=self.driver) + image = NodeImage(id=5, name="Ubuntu 9.04 LAMP", driver=self.driver) node = Node(5, None, None, None, None, self.driver, image=image) - ret = self.driver.ex_node_set_save_name(node, 'test') + ret = self.driver.ex_node_set_save_name(node, "test") self.assertTrue(ret) -class OpenNebula_3_2_Tests(unittest.TestCase, OpenNebulaCaseMixin): - +class OpenNebula_3_2_Tests(unittest.TestCase): """ OpenNebula.org test suite for OpenNebula v3.2. """ @@ -586,15 +585,14 @@ def setUp(self): """ Setup test environment. """ - OpenNebulaNodeDriver.connectionCls.conn_classes = ( - OpenNebula_3_2_MockHttp, OpenNebula_3_2_MockHttp) - self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ('3.2',)) + OpenNebulaNodeDriver.connectionCls.conn_class = OpenNebula_3_2_MockHttp + self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ("3.2",), host="dummy") def test_reboot_node(self): """ Test reboot_node functionality. """ - image = NodeImage(id=5, name='Ubuntu 9.04 LAMP', driver=self.driver) + image = NodeImage(id=5, name="Ubuntu 9.04 LAMP", driver=self.driver) node = Node(5, None, None, None, None, self.driver, image=image) ret = self.driver.reboot_node(node) self.assertTrue(ret) @@ -607,42 +605,41 @@ def test_list_sizes(self): self.assertEqual(len(sizes), 3) size = sizes[0] - self.assertEqual(size.id, '1') - self.assertEqual(size.name, 'small') + self.assertEqual(size.id, "1") + self.assertEqual(size.name, "small") self.assertEqual(size.ram, 1024) self.assertTrue(size.cpu is None or isinstance(size.cpu, float)) self.assertTrue(size.vcpu is None or isinstance(size.vcpu, int)) self.assertEqual(size.cpu, 1) - self.assertEqual(size.vcpu, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertIsNone(size.vcpu) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) size = sizes[1] - self.assertEqual(size.id, '2') - self.assertEqual(size.name, 'medium') + self.assertEqual(size.id, "2") + self.assertEqual(size.name, "medium") self.assertEqual(size.ram, 4096) self.assertTrue(size.cpu is None or isinstance(size.cpu, float)) self.assertTrue(size.vcpu is None or isinstance(size.vcpu, int)) self.assertEqual(size.cpu, 4) - self.assertEqual(size.vcpu, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertIsNone(size.vcpu) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) size = sizes[2] - self.assertEqual(size.id, '3') - self.assertEqual(size.name, 'large') + self.assertEqual(size.id, "3") + self.assertEqual(size.name, "large") self.assertEqual(size.ram, 8192) self.assertTrue(size.cpu is None or isinstance(size.cpu, float)) self.assertTrue(size.vcpu is None or isinstance(size.vcpu, int)) self.assertEqual(size.cpu, 8) - self.assertEqual(size.vcpu, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertIsNone(size.vcpu) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) -class OpenNebula_3_6_Tests(unittest.TestCase, OpenNebulaCaseMixin): - +class OpenNebula_3_6_Tests(unittest.TestCase): """ OpenNebula.org test suite for OpenNebula v3.6. """ @@ -651,16 +648,15 @@ def setUp(self): """ Setup test environment. """ - OpenNebulaNodeDriver.connectionCls.conn_classes = ( - OpenNebula_3_6_MockHttp, OpenNebula_3_6_MockHttp) - self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ('3.6',)) + OpenNebulaNodeDriver.connectionCls.conn_class = OpenNebula_3_6_MockHttp + self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ("3.6",), host="dummy") def test_create_volume(self): - new_volume = self.driver.create_volume(1000, 'test-volume') + new_volume = self.driver.create_volume(1000, "test-volume") - self.assertEqual(new_volume.id, '5') + self.assertEqual(new_volume.id, "5") self.assertEqual(new_volume.size, 1000) - self.assertEqual(new_volume.name, 'test-volume') + self.assertEqual(new_volume.name, "test-volume") def test_destroy_volume(self): images = self.driver.list_images() @@ -678,7 +674,7 @@ def test_attach_volume(self): images = self.driver.list_images() image = images[0] - ret = self.driver.attach_volume(node, image, 'sda') + ret = self.driver.attach_volume(node, image, "sda") self.assertTrue(ret) def test_detach_volume(self): @@ -701,18 +697,17 @@ def test_list_volumes(self): self.assertEqual(len(volumes), 2) volume = volumes[0] - self.assertEqual(volume.id, '5') + self.assertEqual(volume.id, "5") self.assertEqual(volume.size, 2048) - self.assertEqual(volume.name, 'Ubuntu 9.04 LAMP') + self.assertEqual(volume.name, "Ubuntu 9.04 LAMP") volume = volumes[1] - self.assertEqual(volume.id, '15') + self.assertEqual(volume.id, "15") self.assertEqual(volume.size, 1024) - self.assertEqual(volume.name, 'Debian Sid') - + self.assertEqual(volume.name, "Debian Sid") -class OpenNebula_3_8_Tests(unittest.TestCase, OpenNebulaCaseMixin): +class OpenNebula_3_8_Tests(unittest.TestCase): """ OpenNebula.org test suite for OpenNebula v3.8. """ @@ -721,9 +716,8 @@ def setUp(self): """ Setup test environment. """ - OpenNebulaNodeDriver.connectionCls.conn_classes = ( - OpenNebula_3_8_MockHttp, OpenNebula_3_8_MockHttp) - self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ('3.8',)) + OpenNebulaNodeDriver.connectionCls.conn_class = OpenNebula_3_8_MockHttp + self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ("3.8",), host="dummy") def test_list_sizes(self): """ @@ -733,541 +727,499 @@ def test_list_sizes(self): self.assertEqual(len(sizes), 3) size = sizes[0] - self.assertEqual(size.id, '1') - self.assertEqual(size.name, 'small') + self.assertEqual(size.id, "1") + self.assertEqual(size.name, "small") self.assertEqual(size.ram, 1024) self.assertEqual(size.cpu, 1) - self.assertEqual(size.vcpu, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertIsNone(size.vcpu) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) size = sizes[1] - self.assertEqual(size.id, '2') - self.assertEqual(size.name, 'medium') + self.assertEqual(size.id, "2") + self.assertEqual(size.name, "medium") self.assertEqual(size.ram, 4096) self.assertEqual(size.cpu, 4) - self.assertEqual(size.vcpu, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertIsNone(size.vcpu) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) size = sizes[2] - self.assertEqual(size.id, '3') - self.assertEqual(size.name, 'large') + self.assertEqual(size.id, "3") + self.assertEqual(size.name, "large") self.assertEqual(size.ram, 8192) self.assertEqual(size.cpu, 8) - self.assertEqual(size.vcpu, None) - self.assertEqual(size.disk, None) - self.assertEqual(size.bandwidth, None) - self.assertEqual(size.price, None) + self.assertIsNone(size.vcpu) + self.assertIsNone(size.disk) + self.assertIsNone(size.bandwidth) + self.assertIsNone(size.price) class OpenNebula_1_4_MockHttp(MockHttp): - """ Mock HTTP server for testing v1.4 of the OpenNebula.org compute driver. """ - fixtures = ComputeFileFixtures('opennebula_1_4') + fixtures = ComputeFileFixtures("opennebula_1_4") def _compute(self, method, url, body, headers): """ Compute pool resources. """ - if method == 'GET': - body = self.fixtures.load('computes.xml') + if method == "GET": + body = self.fixtures.load("computes.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'POST': - body = self.fixtures.load('compute_5.xml') - return (httplib.CREATED, body, {}, - httplib.responses[httplib.CREATED]) + if method == "POST": + body = self.fixtures.load("compute_5.xml") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _storage(self, method, url, body, headers): """ Storage pool resources. """ - if method == 'GET': - body = self.fixtures.load('storage.xml') + if method == "GET": + body = self.fixtures.load("storage.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'POST': - body = self.fixtures.load('disk_5.xml') - return (httplib.CREATED, body, {}, - httplib.responses[httplib.CREATED]) + if method == "POST": + body = self.fixtures.load("disk_5.xml") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _network(self, method, url, body, headers): """ Network pool resources. """ - if method == 'GET': - body = self.fixtures.load('networks.xml') + if method == "GET": + body = self.fixtures.load("networks.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'POST': - body = self.fixtures.load('network_5.xml') - return (httplib.CREATED, body, {}, - httplib.responses[httplib.CREATED]) + if method == "POST": + body = self.fixtures.load("network_5.xml") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _compute_5(self, method, url, body, headers): """ Compute entry resource. """ - if method == 'GET': - body = self.fixtures.load('compute_5.xml') + if method == "GET": + body = self.fixtures.load("compute_5.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'PUT': + if method == "PUT": body = "" - return (httplib.ACCEPTED, body, {}, - httplib.responses[httplib.ACCEPTED]) + return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.OK, body, {}, - httplib.responses[httplib.OK]) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _compute_15(self, method, url, body, headers): """ Compute entry resource. """ - if method == 'GET': - body = self.fixtures.load('compute_15.xml') + if method == "GET": + body = self.fixtures.load("compute_15.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'PUT': + if method == "PUT": body = "" - return (httplib.ACCEPTED, body, {}, - httplib.responses[httplib.ACCEPTED]) + return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.OK, body, {}, - httplib.responses[httplib.OK]) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _compute_25(self, method, url, body, headers): """ Compute entry resource. """ - if method == 'GET': - body = self.fixtures.load('compute_25.xml') + if method == "GET": + body = self.fixtures.load("compute_25.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'PUT': + if method == "PUT": body = "" - return (httplib.ACCEPTED, body, {}, - httplib.responses[httplib.ACCEPTED]) + return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.OK, body, {}, - httplib.responses[httplib.OK]) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _storage_5(self, method, url, body, headers): """ Storage entry resource. """ - if method == 'GET': - body = self.fixtures.load('disk_5.xml') + if method == "GET": + body = self.fixtures.load("disk_5.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.OK, body, {}, - httplib.responses[httplib.OK]) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _storage_15(self, method, url, body, headers): """ Storage entry resource. """ - if method == 'GET': - body = self.fixtures.load('disk_15.xml') + if method == "GET": + body = self.fixtures.load("disk_15.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.OK, body, {}, - httplib.responses[httplib.OK]) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _network_5(self, method, url, body, headers): """ Network entry resource. """ - if method == 'GET': - body = self.fixtures.load('network_5.xml') + if method == "GET": + body = self.fixtures.load("network_5.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.OK, body, {}, - httplib.responses[httplib.OK]) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _network_15(self, method, url, body, headers): """ Network entry resource. """ - if method == 'GET': - body = self.fixtures.load('network_15.xml') + if method == "GET": + body = self.fixtures.load("network_15.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.OK, body, {}, - httplib.responses[httplib.OK]) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) class OpenNebula_2_0_MockHttp(MockHttp): - """ Mock HTTP server for testing v2.0 through v3.2 of the OpenNebula.org compute driver. """ - fixtures = ComputeFileFixtures('opennebula_2_0') + fixtures = ComputeFileFixtures("opennebula_2_0") def _compute(self, method, url, body, headers): """ Compute pool resources. """ - if method == 'GET': - body = self.fixtures.load('compute_collection.xml') + if method == "GET": + body = self.fixtures.load("compute_collection.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'POST': - body = self.fixtures.load('compute_5.xml') - return (httplib.CREATED, body, {}, - httplib.responses[httplib.CREATED]) + if method == "POST": + body = self.fixtures.load("compute_5.xml") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _storage(self, method, url, body, headers): """ Storage pool resources. """ - if method == 'GET': - body = self.fixtures.load('storage_collection.xml') + if method == "GET": + body = self.fixtures.load("storage_collection.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'POST': - body = self.fixtures.load('storage_5.xml') - return (httplib.CREATED, body, {}, - httplib.responses[httplib.CREATED]) + if method == "POST": + body = self.fixtures.load("storage_5.xml") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _network(self, method, url, body, headers): """ Network pool resources. """ - if method == 'GET': - body = self.fixtures.load('network_collection.xml') + if method == "GET": + body = self.fixtures.load("network_collection.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'POST': - body = self.fixtures.load('network_5.xml') - return (httplib.CREATED, body, {}, - httplib.responses[httplib.CREATED]) + if method == "POST": + body = self.fixtures.load("network_5.xml") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _compute_5(self, method, url, body, headers): """ Compute entry resource. """ - if method == 'GET': - body = self.fixtures.load('compute_5.xml') + if method == "GET": + body = self.fixtures.load("compute_5.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'PUT': + if method == "PUT": body = "" - return (httplib.ACCEPTED, body, {}, - httplib.responses[httplib.ACCEPTED]) + return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _compute_15(self, method, url, body, headers): """ Compute entry resource. """ - if method == 'GET': - body = self.fixtures.load('compute_15.xml') + if method == "GET": + body = self.fixtures.load("compute_15.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'PUT': + if method == "PUT": body = "" - return (httplib.ACCEPTED, body, {}, - httplib.responses[httplib.ACCEPTED]) + return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _compute_25(self, method, url, body, headers): """ Compute entry resource. """ - if method == 'GET': - body = self.fixtures.load('compute_25.xml') + if method == "GET": + body = self.fixtures.load("compute_25.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'PUT': + if method == "PUT": body = "" - return (httplib.ACCEPTED, body, {}, - httplib.responses[httplib.ACCEPTED]) + return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _storage_5(self, method, url, body, headers): """ Storage entry resource. """ - if method == 'GET': - body = self.fixtures.load('storage_5.xml') + if method == "GET": + body = self.fixtures.load("storage_5.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _storage_15(self, method, url, body, headers): """ Storage entry resource. """ - if method == 'GET': - body = self.fixtures.load('storage_15.xml') + if method == "GET": + body = self.fixtures.load("storage_15.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _network_5(self, method, url, body, headers): """ Network entry resource. """ - if method == 'GET': - body = self.fixtures.load('network_5.xml') + if method == "GET": + body = self.fixtures.load("network_5.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _network_15(self, method, url, body, headers): """ Network entry resource. """ - if method == 'GET': - body = self.fixtures.load('network_15.xml') + if method == "GET": + body = self.fixtures.load("network_15.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) class OpenNebula_3_0_MockHttp(OpenNebula_2_0_MockHttp): - """ Mock HTTP server for testing v3.0 of the OpenNebula.org compute driver. """ - fixtures_3_0 = ComputeFileFixtures('opennebula_3_0') + fixtures_3_0 = ComputeFileFixtures("opennebula_3_0") def _network(self, method, url, body, headers): """ Network pool resources. """ - if method == 'GET': - body = self.fixtures_3_0.load('network_collection.xml') + if method == "GET": + body = self.fixtures_3_0.load("network_collection.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'POST': - body = self.fixtures.load('network_5.xml') - return (httplib.CREATED, body, {}, - httplib.responses[httplib.CREATED]) + if method == "POST": + body = self.fixtures.load("network_5.xml") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _network_5(self, method, url, body, headers): """ Network entry resource. """ - if method == 'GET': - body = self.fixtures_3_0.load('network_5.xml') + if method == "GET": + body = self.fixtures_3_0.load("network_5.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _network_15(self, method, url, body, headers): """ Network entry resource. """ - if method == 'GET': - body = self.fixtures_3_0.load('network_15.xml') + if method == "GET": + body = self.fixtures_3_0.load("network_15.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) class OpenNebula_3_2_MockHttp(OpenNebula_3_0_MockHttp): - """ Mock HTTP server for testing v3.2 of the OpenNebula.org compute driver. """ - fixtures_3_2 = ComputeFileFixtures('opennebula_3_2') + fixtures_3_2 = ComputeFileFixtures("opennebula_3_2") def _compute_5(self, method, url, body, headers): """ Compute entry resource. """ - if method == 'GET': - body = self.fixtures.load('compute_5.xml') + if method == "GET": + body = self.fixtures.load("compute_5.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'PUT': + if method == "PUT": body = "" - return (httplib.ACCEPTED, body, {}, - httplib.responses[httplib.ACCEPTED]) + return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _instance_type(self, method, url, body, headers): """ Instance type pool. """ - if method == 'GET': - body = self.fixtures_3_2.load('instance_type_collection.xml') + if method == "GET": + body = self.fixtures_3_2.load("instance_type_collection.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) class OpenNebula_3_6_MockHttp(OpenNebula_3_2_MockHttp): - """ Mock HTTP server for testing v3.6 of the OpenNebula.org compute driver. """ - fixtures_3_6 = ComputeFileFixtures('opennebula_3_6') + fixtures_3_6 = ComputeFileFixtures("opennebula_3_6") def _storage(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('storage_collection.xml') + if method == "GET": + body = self.fixtures.load("storage_collection.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'POST': - body = self.fixtures_3_6.load('storage_5.xml') - return (httplib.CREATED, body, {}, - httplib.responses[httplib.CREATED]) + if method == "POST": + body = self.fixtures_3_6.load("storage_5.xml") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) def _compute_5(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures_3_6.load('compute_5.xml') + if method == "GET": + body = self.fixtures_3_6.load("compute_5.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'PUT': + if method == "PUT": body = "" - return (httplib.ACCEPTED, body, {}, - httplib.responses[httplib.ACCEPTED]) + return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _compute_5_action(self, method, url, body, headers): - body = self.fixtures_3_6.load('compute_5.xml') - if method == 'POST': - return (httplib.ACCEPTED, body, {}, - httplib.responses[httplib.ACCEPTED]) + body = self.fixtures_3_6.load("compute_5.xml") + if method == "POST": + return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - if method == 'GET': + if method == "GET": return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _compute_15(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures_3_6.load('compute_15.xml') + if method == "GET": + body = self.fixtures_3_6.load("compute_15.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - if method == 'PUT': + if method == "PUT": body = "" - return (httplib.ACCEPTED, body, {}, - httplib.responses[httplib.ACCEPTED]) + return (httplib.ACCEPTED, body, {}, httplib.responses[httplib.ACCEPTED]) - if method == 'DELETE': + if method == "DELETE": body = "" - return (httplib.NO_CONTENT, body, {}, - httplib.responses[httplib.NO_CONTENT]) + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) def _storage_10(self, method, url, body, headers): """ Storage entry resource. """ - if method == 'GET': - body = self.fixtures_3_6.load('disk_10.xml') + if method == "GET": + body = self.fixtures_3_6.load("disk_10.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _storage_15(self, method, url, body, headers): """ Storage entry resource. """ - if method == 'GET': - body = self.fixtures_3_6.load('disk_15.xml') + if method == "GET": + body = self.fixtures_3_6.load("disk_15.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) class OpenNebula_3_8_MockHttp(OpenNebula_3_2_MockHttp): - """ Mock HTTP server for testing v3.8 of the OpenNebula.org compute driver. """ - fixtures_3_8 = ComputeFileFixtures('opennebula_3_8') + fixtures_3_8 = ComputeFileFixtures("opennebula_3_8") def _instance_type(self, method, url, body, headers): """ Instance type pool. """ - if method == 'GET': - body = self.fixtures_3_8.load('instance_type_collection.xml') + if method == "GET": + body = self.fixtures_3_8.load("instance_type_collection.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _instance_type_small(self, method, url, body, headers): """ Small instance type. """ - if method == 'GET': - body = self.fixtures_3_8.load('instance_type_small.xml') + if method == "GET": + body = self.fixtures_3_8.load("instance_type_small.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _instance_type_medium(self, method, url, body, headers): """ Medium instance type pool. """ - if method == 'GET': - body = self.fixtures_3_8.load('instance_type_medium.xml') + if method == "GET": + body = self.fixtures_3_8.load("instance_type_medium.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _instance_type_large(self, method, url, body, headers): """ Large instance type pool. """ - if method == 'GET': - body = self.fixtures_3_8.load('instance_type_large.xml') + if method == "GET": + body = self.fixtures_3_8.load("instance_type_large.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) -if __name__ == '__main__': + +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py index d80d6ce35f..2c85ec6c32 100644 --- a/libcloud/test/compute/test_openstack.py +++ b/libcloud/test/compute/test_openstack.py @@ -13,77 +13,107 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import with_statement import os import sys -import unittest import datetime -from libcloud.utils.iso8601 import UTC - -try: - import simplejson as json -except ImportError: - import json - -from mock import Mock, patch +import unittest +from unittest import mock +from unittest.mock import Mock, patch -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import method_type -from libcloud.utils.py3 import u +import pytest +import requests_mock -from libcloud.common.types import InvalidCredsError, MalformedResponseError, \ - LibcloudError -from libcloud.compute.types import Provider, KeyPairDoesNotExistError, StorageVolumeState +from libcloud.test import XML_HEADERS, MockHttp +from libcloud.pricing import set_pricing, clear_pricing_data +from libcloud.utils.py3 import u, httplib, method_type +from libcloud.common.base import LibcloudConnection +from libcloud.common.types import LibcloudError, InvalidCredsError, MalformedResponseError +from libcloud.compute.base import Node, NodeSize, NodeImage +from libcloud.test.compute import TestCaseMixin +from libcloud.test.secrets import OPENSTACK_PARAMS +from libcloud.compute.types import ( + Provider, + StorageVolumeState, + VolumeSnapshotState, + NodeImageMemberState, + KeyPairDoesNotExistError, +) +from libcloud.utils.iso8601 import UTC +from libcloud.common.exceptions import BaseHTTPError from libcloud.compute.providers import get_driver +from libcloud.test.file_fixtures import OpenStackFixtures, ComputeFileFixtures +from libcloud.common.openstack_identity import ( + AUTH_VERSIONS_WITH_EXPIRES, + OpenStackAuthenticationCache, +) from libcloud.compute.drivers.openstack import ( - OpenStack_1_0_NodeDriver, OpenStack_1_0_Response, - OpenStack_1_1_NodeDriver, OpenStackSecurityGroup, - OpenStackSecurityGroupRule, OpenStack_1_1_FloatingIpPool, - OpenStack_1_1_FloatingIpAddress, OpenStackKeyPair + OpenStackKeyPair, + OpenStackNetwork, + OpenStackException, + OpenStack_2_NodeDriver, + OpenStackSecurityGroup, + OpenStack_2_ServerGroup, + OpenStack_1_0_Connection, + OpenStack_1_0_NodeDriver, + OpenStack_1_1_NodeDriver, + OpenStack_2_FloatingIpPool, + OpenStackSecurityGroupRule, + OpenStack_1_1_FloatingIpPool, + OpenStack_2_PortInterfaceState, + OpenStack_1_1_FloatingIpAddress, ) -from libcloud.compute.base import Node, NodeImage, NodeSize -from libcloud.pricing import set_pricing, clear_pricing_data -from libcloud.test import MockResponse, MockHttpTestCase, XML_HEADERS -from libcloud.test.file_fixtures import ComputeFileFixtures, OpenStackFixtures -from libcloud.test.compute import TestCaseMixin +try: + import simplejson as json +except ImportError: + import json -from libcloud.test.secrets import OPENSTACK_PARAMS BASE_DIR = os.path.abspath(os.path.split(__file__)[0]) -class OpenStack_1_0_ResponseTestCase(unittest.TestCase): - XML = """""" - - def test_simple_xml_content_type_handling(self): - http_response = MockResponse( - 200, OpenStack_1_0_ResponseTestCase.XML, headers={'content-type': 'application/xml'}) - body = OpenStack_1_0_Response(http_response, None).parse_body() - - self.assertTrue(hasattr(body, 'tag'), "Body should be parsed as XML") - - def test_extended_xml_content_type_handling(self): - http_response = MockResponse(200, - OpenStack_1_0_ResponseTestCase.XML, - headers={'content-type': 'application/xml; charset=UTF-8'}) - body = OpenStack_1_0_Response(http_response, None).parse_body() - - self.assertTrue(hasattr(body, 'tag'), "Body should be parsed as XML") - - def test_non_xml_content_type_handling(self): - RESPONSE_BODY = "Accepted" - - http_response = MockResponse( - 202, RESPONSE_BODY, headers={'content-type': 'text/html'}) - body = OpenStack_1_0_Response(http_response, None).parse_body() - - self.assertEqual( - body, RESPONSE_BODY, "Non-XML body should be returned as is") - - -class OpenStack_1_0_Tests(unittest.TestCase, TestCaseMixin): +class OpenStackAuthTests(unittest.TestCase): + def setUp(self): + OpenStack_1_0_NodeDriver.connectionCls = OpenStack_1_0_Connection + OpenStack_1_0_NodeDriver.connectionCls.conn_class = LibcloudConnection + + def test_auth_host_passed(self): + forced_auth = "http://x.y.z.y:5000" + d = OpenStack_1_0_NodeDriver( + "user", + "correct_password", + ex_force_auth_version="2.0_password", + ex_force_auth_url="http://x.y.z.y:5000", + ex_tenant_name="admin", + ) + self.assertEqual(d._ex_force_auth_url, forced_auth) + + with requests_mock.Mocker() as mock: + body2 = ComputeFileFixtures("openstack").load("_v2_0__auth.json") + + mock.register_uri( + "POST", + "http://x.y.z.y:5000/v2.0/tokens", + text=body2, + headers={"content-type": "application/json; charset=UTF-8"}, + ) + d.connection._populate_hosts_and_request_paths() + self.assertEqual(d.connection.host, "test_endpoint.com") + + def test_driver_instantiation_invalid_auth(self): + with pytest.raises(LibcloudError): + d = OpenStack_1_0_NodeDriver( + "user", + "correct_password", + ex_force_auth_version="5.0", + ex_force_auth_url="http://x.y.z.y:5000", + ex_tenant_name="admin", + ) + d.list_nodes() + + +class OpenStack_1_0_Tests(TestCaseMixin, unittest.TestCase): should_list_locations = False should_list_volumes = False @@ -96,6 +126,7 @@ class OpenStack_1_0_Tests(unittest.TestCase, TestCaseMixin): def create_driver(self): if self is not OpenStack_1_0_FactoryMethodTests: self.driver_type = self.driver_klass + return self.driver_type(*self.driver_args, **self.driver_kwargs) def setUp(self): @@ -104,10 +135,10 @@ def setUp(self): # driver def get_endpoint(*args, **kwargs): return "https://servers.api.rackspacecloud.com/v1.0/slug" + self.driver_klass.connectionCls.get_endpoint = get_endpoint - self.driver_klass.connectionCls.conn_classes = (OpenStackMockHttp, - OpenStackMockHttp) + self.driver_klass.connectionCls.conn_class = OpenStackMockHttp self.driver_klass.connectionCls.auth_url = "https://auth.api.example.com" OpenStackMockHttp.type = None @@ -117,26 +148,27 @@ def get_endpoint(*args, **kwargs): self.driver.connection._populate_hosts_and_request_paths() clear_pricing_data() - @patch('libcloud.common.openstack.OpenStackServiceCatalog') + @patch("libcloud.common.openstack.OpenStackServiceCatalog") def test_populate_hosts_and_requests_path(self, _): tomorrow = datetime.datetime.today() + datetime.timedelta(1) cls = self.driver_klass.connectionCls count = 5 - # Test authentication and token re-use - con = cls('username', 'key') + # Test authentication and token reuse + con = cls("username", "key") osa = con.get_auth_class() mocked_auth_method = Mock() osa.authenticate = mocked_auth_method # Valid token returned on first call, should be reused. + for i in range(0, count): con._populate_hosts_and_request_paths() if i == 0: - osa.auth_token = '1234' + osa.auth_token = "1234" osa.auth_token_expires = tomorrow self.assertEqual(mocked_auth_method.call_count, 1) @@ -145,8 +177,12 @@ def test_populate_hosts_and_requests_path(self, _): osa.auth_token_expires = None # ex_force_auth_token provided, authenticate should never be called - con = cls('username', 'key', ex_force_base_url='http://ponies', - ex_force_auth_token='1234') + con = cls( + "username", + "key", + ex_force_base_url="http://ponies", + ex_force_auth_token="1234", + ) osa = con.get_auth_class() mocked_auth_method = Mock() @@ -159,167 +195,205 @@ def test_populate_hosts_and_requests_path(self, _): def test_auth_token_is_set(self): self.driver.connection._populate_hosts_and_request_paths() - self.assertEqual( - self.driver.connection.auth_token, "aaaaaaaaaaaa-bbb-cccccccccccccc") + self.assertEqual(self.driver.connection.auth_token, "aaaaaaaaaaaa-bbb-cccccccccccccc") def test_auth_token_expires_is_set(self): self.driver.connection._populate_hosts_and_request_paths() expires = self.driver.connection.auth_token_expires - self.assertEqual(expires.isoformat(), "2031-11-23T21:00:14-06:00") + self.assertEqual(expires.isoformat(), "2999-11-23T21:00:14-06:00") def test_auth(self): - if self.driver.connection._auth_version == '2.0': + if self.driver.connection._auth_version == "2.0": return - OpenStackMockHttp.type = 'UNAUTHORIZED' + OpenStackMockHttp.type = "UNAUTHORIZED" try: self.driver = self.create_driver() self.driver.list_nodes() - except InvalidCredsError: - e = sys.exc_info()[1] + except InvalidCredsError as e: self.assertEqual(True, isinstance(e, InvalidCredsError)) else: - self.fail('test should have thrown') + self.fail("test should have thrown") def test_auth_missing_key(self): - if self.driver.connection._auth_version == '2.0': + if self.driver.connection._auth_version == "2.0": return - OpenStackMockHttp.type = 'UNAUTHORIZED_MISSING_KEY' + OpenStackMockHttp.type = "UNAUTHORIZED_MISSING_KEY" try: self.driver = self.create_driver() self.driver.list_nodes() - except MalformedResponseError: - e = sys.exc_info()[1] + except MalformedResponseError as e: self.assertEqual(True, isinstance(e, MalformedResponseError)) else: - self.fail('test should have thrown') + self.fail("test should have thrown") def test_auth_server_error(self): - if self.driver.connection._auth_version == '2.0': + if self.driver.connection._auth_version == "2.0": return - OpenStackMockHttp.type = 'INTERNAL_SERVER_ERROR' + OpenStackMockHttp.type = "INTERNAL_SERVER_ERROR" try: self.driver = self.create_driver() self.driver.list_nodes() - except MalformedResponseError: - e = sys.exc_info()[1] + except MalformedResponseError as e: self.assertEqual(True, isinstance(e, MalformedResponseError)) else: - self.fail('test should have thrown') + self.fail("test should have thrown") + + def test_ex_auth_cache_passed_to_identity_connection(self): + kwargs = self.driver_kwargs.copy() + kwargs["ex_auth_cache"] = OpenStackMockAuthCache() + driver = self.driver_type(*self.driver_args, **kwargs) + driver.list_nodes() + self.assertEqual(kwargs["ex_auth_cache"], driver.connection.get_auth_class().auth_cache) + + def test_unauthorized_clears_cached_auth_context(self): + auth_cache = OpenStackMockAuthCache() + self.assertEqual(len(auth_cache), 0) + + kwargs = self.driver_kwargs.copy() + kwargs["ex_auth_cache"] = auth_cache + driver = self.driver_type(*self.driver_args, **kwargs) + driver.list_nodes() + + # Token was cached + self.assertEqual(len(auth_cache), 1) + + # Simulate token being revoked + self.driver_klass.connectionCls.conn_class.type = "UNAUTHORIZED" + with pytest.raises(BaseHTTPError): + driver.list_nodes() + + # Token was evicted + self.assertEqual(len(auth_cache), 0) def test_error_parsing_when_body_is_missing_message(self): - OpenStackMockHttp.type = 'NO_MESSAGE_IN_ERROR_BODY' + OpenStackMockHttp.type = "NO_MESSAGE_IN_ERROR_BODY" try: self.driver.list_images() - except Exception: - e = sys.exc_info()[1] + except Exception as e: self.assertEqual(True, isinstance(e, Exception)) else: - self.fail('test should have thrown') + self.fail("test should have thrown") def test_list_locations(self): locations = self.driver.list_locations() self.assertEqual(len(locations), 1) def test_list_nodes(self): - OpenStackMockHttp.type = 'EMPTY' + OpenStackMockHttp.type = "EMPTY" ret = self.driver.list_nodes() self.assertEqual(len(ret), 0) OpenStackMockHttp.type = None ret = self.driver.list_nodes() self.assertEqual(len(ret), 1) node = ret[0] - self.assertEqual('67.23.21.33', node.public_ips[0]) - self.assertTrue('10.176.168.218' in node.private_ips) - self.assertEqual(node.extra.get('flavorId'), '1') - self.assertEqual(node.extra.get('imageId'), '11') - self.assertEqual(type(node.extra.get('metadata')), type(dict())) + self.assertEqual("67.23.21.33", node.public_ips[0]) + self.assertTrue("10.176.168.218" in node.private_ips) + self.assertEqual(node.extra.get("flavorId"), "1") + self.assertEqual(node.extra.get("imageId"), "11") + self.assertEqual(type(node.extra.get("metadata")), type(dict())) - OpenStackMockHttp.type = 'METADATA' + OpenStackMockHttp.type = "METADATA" ret = self.driver.list_nodes() self.assertEqual(len(ret), 1) node = ret[0] - self.assertEqual(type(node.extra.get('metadata')), type(dict())) - self.assertEqual(node.extra.get('metadata').get('somekey'), - 'somevalue') + self.assertEqual(type(node.extra.get("metadata")), type(dict())) + self.assertEqual(node.extra.get("metadata").get("somekey"), "somevalue") OpenStackMockHttp.type = None def test_list_images(self): ret = self.driver.list_images() - expected = {10: {'serverId': None, - 'status': 'ACTIVE', - 'created': '2009-07-20T09:14:37-05:00', - 'updated': '2009-07-20T09:14:37-05:00', - 'progress': None, - 'minDisk': None, - 'minRam': None}, - 11: {'serverId': '91221', - 'status': 'ACTIVE', - 'created': '2009-11-29T20:22:09-06:00', - 'updated': '2009-11-29T20:24:08-06:00', - 'progress': '100', - 'minDisk': '5', - 'minRam': '256'}} + expected = { + 10: { + "serverId": None, + "status": "ACTIVE", + "created": "2009-07-20T09:14:37-05:00", + "updated": "2009-07-20T09:14:37-05:00", + "progress": None, + "minDisk": None, + "minRam": None, + }, + 11: { + "serverId": "91221", + "status": "ACTIVE", + "created": "2009-11-29T20:22:09-06:00", + "updated": "2009-11-29T20:24:08-06:00", + "progress": "100", + "minDisk": "5", + "minRam": "256", + }, + } + for ret_idx, extra in list(expected.items()): for key, value in list(extra.items()): self.assertEqual(ret[ret_idx].extra[key], value) def test_create_node(self): - image = NodeImage(id=11, name='Ubuntu 8.10 (intrepid)', - driver=self.driver) - size = NodeSize(1, '256 slice', None, None, None, None, - driver=self.driver) - node = self.driver.create_node(name='racktest', image=image, size=size) - self.assertEqual(node.name, 'racktest') - self.assertEqual(node.extra.get('password'), 'racktestvJq7d3') + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + node = self.driver.create_node(name="racktest", image=image, size=size) + self.assertEqual(node.name, "racktest") + self.assertEqual(node.extra.get("password"), "racktestvJq7d3") def test_create_node_without_adminPass(self): - OpenStackMockHttp.type = 'NO_ADMIN_PASS' - image = NodeImage(id=11, name='Ubuntu 8.10 (intrepid)', - driver=self.driver) - size = NodeSize(1, '256 slice', None, None, None, None, - driver=self.driver) - node = self.driver.create_node(name='racktest', image=image, size=size) - self.assertEqual(node.name, 'racktest') - self.assertEqual(node.extra.get('password'), None) + OpenStackMockHttp.type = "NO_ADMIN_PASS" + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + node = self.driver.create_node(name="racktest", image=image, size=size) + self.assertEqual(node.name, "racktest") + self.assertIsNone(node.extra.get("password")) def test_create_node_ex_shared_ip_group(self): - OpenStackMockHttp.type = 'EX_SHARED_IP_GROUP' - image = NodeImage(id=11, name='Ubuntu 8.10 (intrepid)', - driver=self.driver) - size = NodeSize(1, '256 slice', None, None, None, None, - driver=self.driver) - node = self.driver.create_node(name='racktest', image=image, size=size, - ex_shared_ip_group_id='12345') - self.assertEqual(node.name, 'racktest') - self.assertEqual(node.extra.get('password'), 'racktestvJq7d3') + OpenStackMockHttp.type = "EX_SHARED_IP_GROUP" + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + node = self.driver.create_node( + name="racktest", image=image, size=size, ex_shared_ip_group_id="12345" + ) + self.assertEqual(node.name, "racktest") + self.assertEqual(node.extra.get("password"), "racktestvJq7d3") def test_create_node_with_metadata(self): - OpenStackMockHttp.type = 'METADATA' - image = NodeImage(id=11, name='Ubuntu 8.10 (intrepid)', - driver=self.driver) - size = NodeSize(1, '256 slice', None, None, None, None, - driver=self.driver) - metadata = {'a': 'b', 'c': 'd'} - files = {'/file1': 'content1', '/file2': 'content2'} - node = self.driver.create_node(name='racktest', image=image, size=size, - metadata=metadata, files=files) - self.assertEqual(node.name, 'racktest') - self.assertEqual(node.extra.get('password'), 'racktestvJq7d3') - self.assertEqual(node.extra.get('metadata'), metadata) + OpenStackMockHttp.type = "METADATA" + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + metadata = {"a": "b", "c": "d"} + files = {"/file1": "content1", "/file2": "content2"} + node = self.driver.create_node( + name="racktest", + image=image, + size=size, + ex_metadata=metadata, + ex_files=files, + ) + self.assertEqual(node.name, "racktest") + self.assertEqual(node.extra.get("password"), "racktestvJq7d3") + self.assertEqual(node.extra.get("metadata"), metadata) def test_reboot_node(self): - node = Node(id=72258, name=None, state=None, public_ips=None, - private_ips=None, driver=self.driver) + node = Node( + id=72258, + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) ret = node.reboot() self.assertTrue(ret is True) def test_destroy_node(self): - node = Node(id=72258, name=None, state=None, public_ips=None, - private_ips=None, driver=self.driver) + node = Node( + id=72258, + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) ret = node.destroy() self.assertTrue(ret is True) @@ -329,33 +403,38 @@ def test_ex_limits(self): self.assertTrue("absolute" in limits) def test_create_image(self): - node = Node(id=444222, name=None, state=None, public_ips=None, - private_ips=None, driver=self.driver) + node = Node( + id=444222, + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) image = self.driver.create_image(node, "imgtest") self.assertEqual(image.name, "imgtest") self.assertEqual(image.id, "12345") def test_delete_image(self): - image = NodeImage(id=333111, name='Ubuntu 8.10 (intrepid)', - driver=self.driver) + image = NodeImage(id=333111, name="Ubuntu 8.10 (intrepid)", driver=self.driver) ret = self.driver.delete_image(image) self.assertTrue(ret) def test_ex_list_ip_addresses(self): ret = self.driver.ex_list_ip_addresses(node_id=72258) self.assertEqual(2, len(ret.public_addresses)) - self.assertTrue('67.23.10.131' in ret.public_addresses) - self.assertTrue('67.23.10.132' in ret.public_addresses) + self.assertTrue("67.23.10.131" in ret.public_addresses) + self.assertTrue("67.23.10.132" in ret.public_addresses) self.assertEqual(1, len(ret.private_addresses)) - self.assertTrue('10.176.42.16' in ret.private_addresses) + self.assertTrue("10.176.42.16" in ret.private_addresses) def test_ex_list_ip_groups(self): ret = self.driver.ex_list_ip_groups() self.assertEqual(2, len(ret)) - self.assertEqual('1234', ret[0].id) - self.assertEqual('Shared IP Group 1', ret[0].name) - self.assertEqual('5678', ret[1].id) - self.assertEqual('Shared IP Group 2', ret[1].name) + self.assertEqual("1234", ret[0].id) + self.assertEqual("Shared IP Group 1", ret[0].name) + self.assertEqual("5678", ret[1].id) + self.assertEqual("Shared IP Group 2", ret[1].name) self.assertTrue(ret[0].servers is None) def test_ex_list_ip_groups_detail(self): @@ -363,82 +442,95 @@ def test_ex_list_ip_groups_detail(self): self.assertEqual(2, len(ret)) - self.assertEqual('1234', ret[0].id) - self.assertEqual('Shared IP Group 1', ret[0].name) + self.assertEqual("1234", ret[0].id) + self.assertEqual("Shared IP Group 1", ret[0].name) self.assertEqual(2, len(ret[0].servers)) - self.assertEqual('422', ret[0].servers[0]) - self.assertEqual('3445', ret[0].servers[1]) + self.assertEqual("422", ret[0].servers[0]) + self.assertEqual("3445", ret[0].servers[1]) - self.assertEqual('5678', ret[1].id) - self.assertEqual('Shared IP Group 2', ret[1].name) + self.assertEqual("5678", ret[1].id) + self.assertEqual("Shared IP Group 2", ret[1].name) self.assertEqual(3, len(ret[1].servers)) - self.assertEqual('23203', ret[1].servers[0]) - self.assertEqual('2456', ret[1].servers[1]) - self.assertEqual('9891', ret[1].servers[2]) + self.assertEqual("23203", ret[1].servers[0]) + self.assertEqual("2456", ret[1].servers[1]) + self.assertEqual("9891", ret[1].servers[2]) def test_ex_create_ip_group(self): - ret = self.driver.ex_create_ip_group('Shared IP Group 1', '5467') - self.assertEqual('1234', ret.id) - self.assertEqual('Shared IP Group 1', ret.name) + ret = self.driver.ex_create_ip_group("Shared IP Group 1", "5467") + self.assertEqual("1234", ret.id) + self.assertEqual("Shared IP Group 1", ret.name) self.assertEqual(1, len(ret.servers)) - self.assertEqual('422', ret.servers[0]) + self.assertEqual("422", ret.servers[0]) def test_ex_delete_ip_group(self): - ret = self.driver.ex_delete_ip_group('5467') + ret = self.driver.ex_delete_ip_group("5467") self.assertEqual(True, ret) def test_ex_share_ip(self): - ret = self.driver.ex_share_ip('1234', '3445', '67.23.21.133') + ret = self.driver.ex_share_ip("1234", "3445", "67.23.21.133") self.assertEqual(True, ret) def test_ex_unshare_ip(self): - ret = self.driver.ex_unshare_ip('3445', '67.23.21.133') + ret = self.driver.ex_unshare_ip("3445", "67.23.21.133") self.assertEqual(True, ret) def test_ex_resize(self): - node = Node(id=444222, name=None, state=None, public_ips=None, - private_ips=None, driver=self.driver) - size = NodeSize(1, '256 slice', None, None, None, None, - driver=self.driver) + node = Node( + id=444222, + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) self.assertTrue(self.driver.ex_resize(node=node, size=size)) def test_ex_confirm_resize(self): - node = Node(id=444222, name=None, state=None, public_ips=None, - private_ips=None, driver=self.driver) + node = Node( + id=444222, + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) self.assertTrue(self.driver.ex_confirm_resize(node=node)) def test_ex_revert_resize(self): - node = Node(id=444222, name=None, state=None, public_ips=None, - private_ips=None, driver=self.driver) + node = Node( + id=444222, + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) self.assertTrue(self.driver.ex_revert_resize(node=node)) def test_list_sizes(self): sizes = self.driver.list_sizes() - self.assertEqual(len(sizes), 7, 'Wrong sizes count') + self.assertEqual(len(sizes), 7, "Wrong sizes count") for size in sizes: - self.assertTrue(isinstance(size.price, float), - 'Wrong size price type') + self.assertTrue(isinstance(size.price, float), "Wrong size price type") - if self.driver.api_name == 'openstack': - self.assertEqual(size.price, 0, - 'Size price should be zero by default') + if self.driver.api_name == "openstack": + self.assertEqual(size.price, 0, "Size price should be zero by default") def test_list_sizes_with_specified_pricing(self): - if self.driver.api_name != 'openstack': + if self.driver.api_name != "openstack": return - pricing = dict((str(i), i) for i in range(1, 8)) + pricing = {str(i): i for i in range(1, 8)} - set_pricing(driver_type='compute', driver_name='openstack', - pricing=pricing) + set_pricing(driver_type="compute", driver_name="openstack", pricing=pricing) sizes = self.driver.list_sizes() - self.assertEqual(len(sizes), 7, 'Wrong sizes count') + self.assertEqual(len(sizes), 7, "Wrong sizes count") for size in sizes: - self.assertTrue(isinstance(size.price, float), - 'Wrong size price type') + self.assertTrue(isinstance(size.price, float), "Wrong size price type") self.assertEqual(float(size.price), float(pricing[size.id])) @@ -448,139 +540,221 @@ class OpenStack_1_0_FactoryMethodTests(OpenStack_1_0_Tests): driver_klass = OpenStack_1_0_NodeDriver driver_type = get_driver(Provider.OPENSTACK) - driver_args = OPENSTACK_PARAMS + ('1.0',) + driver_args = OPENSTACK_PARAMS + ("1.0",) def test_factory_method_invalid_version(self): try: - self.driver_type(*(OPENSTACK_PARAMS + ('15.5',))) + self.driver_type(*(OPENSTACK_PARAMS + ("15.5",))) except NotImplementedError: pass else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") -class OpenStackMockHttp(MockHttpTestCase): - fixtures = ComputeFileFixtures('openstack') +class OpenStackMockHttp(MockHttp, unittest.TestCase): + fixtures = ComputeFileFixtures("openstack") auth_fixtures = OpenStackFixtures() - json_content_headers = {'content-type': 'application/json; charset=UTF-8'} + json_content_headers = {"content-type": "application/json; charset=UTF-8"} # fake auth token response def _v1_0(self, method, url, body, headers): headers = { - 'x-server-management-url': 'https://servers.api.rackspacecloud.com/v1.0/slug', - 'x-auth-token': 'FE011C19-CF86-4F87-BE5D-9229145D7A06', - 'x-cdn-management-url': 'https://cdn.clouddrive.com/v1/MossoCloudFS_FE011C19-CF86-4F87-BE5D-9229145D7A06', - 'x-storage-token': 'FE011C19-CF86-4F87-BE5D-9229145D7A06', - 'x-storage-url': 'https://storage4.clouddrive.com/v1/MossoCloudFS_FE011C19-CF86-4F87-BE5D-9229145D7A06'} + "x-server-management-url": "https://servers.api.rackspacecloud.com/v1.0/slug", + "x-auth-token": "FE011C19-CF86-4F87-BE5D-9229145D7A06", + "x-cdn-management-url": "https://cdn.clouddrive.com/v1/MossoCloudFS_FE011C19-CF86-4F87-BE5D-9229145D7A06", + "x-storage-token": "FE011C19-CF86-4F87-BE5D-9229145D7A06", + "x-storage-url": "https://storage4.clouddrive.com/v1/MossoCloudFS_FE011C19-CF86-4F87-BE5D-9229145D7A06", + } + return (httplib.NO_CONTENT, "", headers, httplib.responses[httplib.NO_CONTENT]) def _v1_0_UNAUTHORIZED(self, method, url, body, headers): return (httplib.UNAUTHORIZED, "", {}, httplib.responses[httplib.UNAUTHORIZED]) def _v1_0_INTERNAL_SERVER_ERROR(self, method, url, body, headers): - return (httplib.INTERNAL_SERVER_ERROR, "

500: Internal Server Error

", {}, - httplib.responses[httplib.INTERNAL_SERVER_ERROR]) + return ( + httplib.INTERNAL_SERVER_ERROR, + "

500: Internal Server Error

", + {}, + httplib.responses[httplib.INTERNAL_SERVER_ERROR], + ) def _v1_0_slug_images_detail_NO_MESSAGE_IN_ERROR_BODY(self, method, url, body, headers): - body = self.fixtures.load('300_multiple_choices.json') - return (httplib.MULTIPLE_CHOICES, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("300_multiple_choices.json") + + return ( + httplib.MULTIPLE_CHOICES, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_0_UNAUTHORIZED_MISSING_KEY(self, method, url, body, headers): headers = { - 'x-server-management-url': 'https://servers.api.rackspacecloud.com/v1.0/slug', - 'x-auth-tokenx': 'FE011C19-CF86-4F87-BE5D-9229145D7A06', - 'x-cdn-management-url': 'https://cdn.clouddrive.com/v1/MossoCloudFS_FE011C19-CF86-4F87-BE5D-9229145D7A06'} + "x-server-management-url": "https://servers.api.rackspacecloud.com/v1.0/slug", + "x-auth-tokenx": "FE011C19-CF86-4F87-BE5D-9229145D7A06", + "x-cdn-management-url": "https://cdn.clouddrive.com/v1/MossoCloudFS_FE011C19-CF86-4F87-BE5D-9229145D7A06", + } + return (httplib.NO_CONTENT, "", headers, httplib.responses[httplib.NO_CONTENT]) def _v2_0_tokens(self, method, url, body, headers): - body = self.auth_fixtures.load('_v2_0__auth.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.auth_fixtures.load("_v2_0__auth.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_0_slug_servers_detail_EMPTY(self, method, url, body, headers): - body = self.fixtures.load('v1_slug_servers_detail_empty.xml') + body = self.fixtures.load("v1_slug_servers_detail_empty.xml") + return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) def _v1_0_slug_servers_detail(self, method, url, body, headers): - body = self.fixtures.load('v1_slug_servers_detail.xml') + body = self.fixtures.load("v1_slug_servers_detail.xml") + return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) def _v1_0_slug_servers_detail_METADATA(self, method, url, body, headers): - body = self.fixtures.load('v1_slug_servers_detail_metadata.xml') + body = self.fixtures.load("v1_slug_servers_detail_metadata.xml") + return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) + def _v1_0_slug_servers_detail_UNAUTHORIZED(self, method, url, body, headers): + return (httplib.UNAUTHORIZED, "", {}, httplib.responses[httplib.UNAUTHORIZED]) + def _v1_0_slug_images_333111(self, method, url, body, headers): if method != "DELETE": raise NotImplementedError() # this is currently used for deletion of an image # as such it should not accept GET/POST - return(httplib.NO_CONTENT, "", "", httplib.responses[httplib.NO_CONTENT]) + + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT]) def _v1_0_slug_images(self, method, url, body, headers): if method != "POST": raise NotImplementedError() # this is currently used for creation of new image with # POST request, don't handle GET to avoid possible confusion - body = self.fixtures.load('v1_slug_images_post.xml') - return (httplib.ACCEPTED, body, XML_HEADERS, httplib.responses[httplib.ACCEPTED]) + body = self.fixtures.load("v1_slug_images_post.xml") + + return ( + httplib.ACCEPTED, + body, + XML_HEADERS, + httplib.responses[httplib.ACCEPTED], + ) def _v1_0_slug_images_detail(self, method, url, body, headers): - body = self.fixtures.load('v1_slug_images_detail.xml') + if method != "GET": + raise ValueError("Invalid method: %s" % (method)) + + body = self.fixtures.load("v1_slug_images_detail.xml") + + return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) + + def _v1_0_slug_images_detail_invalid_next(self, method, url, body, headers): + if method != "GET": + raise ValueError("Invalid method: %s" % (method)) + + body = self.fixtures.load("v1_slug_images_detail.xml") + return (httplib.OK, body, XML_HEADERS, httplib.responses[httplib.OK]) def _v1_0_slug_servers(self, method, url, body, headers): - body = self.fixtures.load('v1_slug_servers.xml') - return (httplib.ACCEPTED, body, XML_HEADERS, httplib.responses[httplib.ACCEPTED]) + body = self.fixtures.load("v1_slug_servers.xml") + + return ( + httplib.ACCEPTED, + body, + XML_HEADERS, + httplib.responses[httplib.ACCEPTED], + ) def _v1_0_slug_servers_NO_ADMIN_PASS(self, method, url, body, headers): - body = self.fixtures.load('v1_slug_servers_no_admin_pass.xml') - return (httplib.ACCEPTED, body, XML_HEADERS, httplib.responses[httplib.ACCEPTED]) + body = self.fixtures.load("v1_slug_servers_no_admin_pass.xml") + + return ( + httplib.ACCEPTED, + body, + XML_HEADERS, + httplib.responses[httplib.ACCEPTED], + ) def _v1_0_slug_servers_EX_SHARED_IP_GROUP(self, method, url, body, headers): # test_create_node_ex_shared_ip_group # Verify that the body contains sharedIpGroupId XML element body = u(body) self.assertTrue(body.find('sharedIpGroupId="12345"') != -1) - body = self.fixtures.load('v1_slug_servers.xml') - return (httplib.ACCEPTED, body, XML_HEADERS, httplib.responses[httplib.ACCEPTED]) + body = self.fixtures.load("v1_slug_servers.xml") + + return ( + httplib.ACCEPTED, + body, + XML_HEADERS, + httplib.responses[httplib.ACCEPTED], + ) def _v1_0_slug_servers_METADATA(self, method, url, body, headers): - body = self.fixtures.load('v1_slug_servers_metadata.xml') - return (httplib.ACCEPTED, body, XML_HEADERS, httplib.responses[httplib.ACCEPTED]) + body = self.fixtures.load("v1_slug_servers_metadata.xml") + + return ( + httplib.ACCEPTED, + body, + XML_HEADERS, + httplib.responses[httplib.ACCEPTED], + ) def _v1_0_slug_servers_72258_action(self, method, url, body, headers): if method != "POST" or body[:8] != "500: Internal Server Error", {'content-type': 'text/html'}, - httplib.responses[httplib.INTERNAL_SERVER_ERROR]) + return ( + httplib.INTERNAL_SERVER_ERROR, + "

500: Internal Server Error

", + {"content-type": "text/html"}, + httplib.responses[httplib.INTERNAL_SERVER_ERROR], + ) class OpenStack_1_1_Tests(unittest.TestCase, TestCaseMixin): @@ -629,17 +847,17 @@ class OpenStack_1_1_Tests(unittest.TestCase, TestCaseMixin): driver_klass = OpenStack_1_1_NodeDriver driver_type = OpenStack_1_1_NodeDriver driver_args = OPENSTACK_PARAMS - driver_kwargs = {'ex_force_auth_version': '2.0'} + driver_kwargs = {"ex_force_auth_version": "2.0"} @classmethod def create_driver(self): if self is not OpenStack_1_1_FactoryMethodTests: self.driver_type = self.driver_klass + return self.driver_type(*self.driver_args, **self.driver_kwargs) def setUp(self): - self.driver_klass.connectionCls.conn_classes = ( - OpenStack_2_0_MockHttp, OpenStack_2_0_MockHttp) + self.driver_klass.connectionCls.conn_class = OpenStack_2_0_MockHttp self.driver_klass.connectionCls.auth_url = "https://auth.api.example.com" OpenStackMockHttp.type = None @@ -655,10 +873,10 @@ def setUp(self): def _force_reauthentication(self): """ - Trash current auth token so driver will be forced to re-authentication + Trash current auth token so driver will be forced to re-authenticate on next request. """ - self.driver.connection._ex_force_base_url = 'http://ex_force_base_url.com:666/forced_url' + self.driver.connection._ex_force_base_url = "http://ex_force_base_url.com:666/forced_url" self.driver.connection.auth_token = None self.driver.connection.auth_token_expires = None self.driver.connection._osa.auth_token = None @@ -668,296 +886,377 @@ def test_auth_token_is_set(self): self._force_reauthentication() self.driver.connection._populate_hosts_and_request_paths() - self.assertEqual( - self.driver.connection.auth_token, "aaaaaaaaaaaa-bbb-cccccccccccccc") + self.assertEqual(self.driver.connection.auth_token, "aaaaaaaaaaaa-bbb-cccccccccccccc") def test_auth_token_expires_is_set(self): self._force_reauthentication() self.driver.connection._populate_hosts_and_request_paths() expires = self.driver.connection.auth_token_expires - self.assertEqual(expires.isoformat(), "2031-11-23T21:00:14-06:00") + self.assertEqual(expires.isoformat(), "2999-11-23T21:00:14-06:00") def test_ex_force_base_url(self): # change base url and trash the current auth token so we can # re-authenticate - self.driver.connection._ex_force_base_url = 'http://ex_force_base_url.com:666/forced_url' + self.driver.connection._ex_force_base_url = "http://ex_force_base_url.com:666/forced_url" self.driver.connection.auth_token = None self.driver.connection._populate_hosts_and_request_paths() # assert that we use the base url and not the auth url - self.assertEqual(self.driver.connection.host, 'ex_force_base_url.com') - self.assertEqual(self.driver.connection.port, '666') - self.assertEqual(self.driver.connection.request_path, '/forced_url') + self.assertEqual(self.driver.connection.host, "ex_force_base_url.com") + self.assertEqual(self.driver.connection.port, 666) + self.assertEqual(self.driver.connection.request_path, "/forced_url") def test_get_endpoint_populates_host_port_and_request_path(self): # simulate a subclass overriding this method - self.driver.connection.get_endpoint = lambda: 'http://endpoint_auth_url.com:1555/service_url' + self.driver.connection.get_endpoint = ( + lambda: "http://endpoint_auth_url.com:1555/service_url" + ) self.driver.connection.auth_token = None self.driver.connection._ex_force_base_url = None self.driver.connection._populate_hosts_and_request_paths() # assert that we use the result of get endpoint - self.assertEqual(self.driver.connection.host, 'endpoint_auth_url.com') - self.assertEqual(self.driver.connection.port, '1555') - self.assertEqual(self.driver.connection.request_path, '/service_url') + self.assertEqual(self.driver.connection.host, "endpoint_auth_url.com") + self.assertEqual(self.driver.connection.port, 1555) + self.assertEqual(self.driver.connection.request_path, "/service_url") def test_set_auth_token_populates_host_port_and_request_path(self): # change base url and trash the current auth token so we can # re-authenticate - self.driver.connection._ex_force_base_url = 'http://some_other_ex_force_base_url.com:1222/some-service' + self.driver.connection._ex_force_base_url = ( + "http://some_other_ex_force_base_url.com:1222/some-service" + ) self.driver.connection.auth_token = "preset-auth-token" self.driver.connection._populate_hosts_and_request_paths() # assert that we use the base url and not the auth url - self.assertEqual( - self.driver.connection.host, 'some_other_ex_force_base_url.com') - self.assertEqual(self.driver.connection.port, '1222') - self.assertEqual(self.driver.connection.request_path, '/some-service') + self.assertEqual(self.driver.connection.host, "some_other_ex_force_base_url.com") + self.assertEqual(self.driver.connection.port, 1222) + self.assertEqual(self.driver.connection.request_path, "/some-service") def test_auth_token_without_base_url_raises_exception(self): kwargs = { - 'ex_force_auth_version': '2.0', - 'ex_force_auth_token': 'preset-auth-token' + "ex_force_auth_version": "2.0", + "ex_force_auth_token": "preset-auth-token", } try: self.driver_type(*self.driver_args, **kwargs) - self.fail('Expected failure setting auth token without base url') + self.fail("Expected failure setting auth token without base url") except LibcloudError: pass else: - self.fail('Expected failure setting auth token without base url') + self.fail("Expected failure setting auth token without base url") def test_ex_force_auth_token_passed_to_connection(self): - base_url = 'https://servers.api.rackspacecloud.com/v1.1/slug' + base_url = "https://servers.api.rackspacecloud.com/v1.1/slug" kwargs = { - 'ex_force_auth_version': '2.0', - 'ex_force_auth_token': 'preset-auth-token', - 'ex_force_base_url': base_url + "ex_force_auth_version": "2.0", + "ex_force_auth_token": "preset-auth-token", + "ex_force_base_url": base_url, } driver = self.driver_type(*self.driver_args, **kwargs) driver.list_nodes() - self.assertEqual(kwargs['ex_force_auth_token'], - driver.connection.auth_token) - self.assertEqual('servers.api.rackspacecloud.com', - driver.connection.host) - self.assertEqual('/v1.1/slug', driver.connection.request_path) + self.assertEqual(kwargs["ex_force_auth_token"], driver.connection.auth_token) + self.assertEqual("servers.api.rackspacecloud.com", driver.connection.host) + self.assertEqual("/v1.1/slug", driver.connection.request_path) self.assertEqual(443, driver.connection.port) + def test_ex_auth_cache_passed_to_identity_connection(self): + kwargs = self.driver_kwargs.copy() + kwargs["ex_auth_cache"] = OpenStackMockAuthCache() + driver = self.driver_type(*self.driver_args, **kwargs) + driver.connection.get_auth_class() + driver.list_nodes() + self.assertEqual(kwargs["ex_auth_cache"], driver.connection.get_auth_class().auth_cache) + + def test_unauthorized_clears_cached_auth_context(self): + auth_cache = OpenStackMockAuthCache() + self.assertEqual(len(auth_cache), 0) + + kwargs = self.driver_kwargs.copy() + kwargs["ex_auth_cache"] = auth_cache + driver = self.driver_type(*self.driver_args, **kwargs) + driver.list_nodes() + + # Token was cached + self.assertEqual(len(auth_cache), 1) + + # Simulate token being revoked + self.driver_klass.connectionCls.conn_class.type = "UNAUTHORIZED" + with pytest.raises(BaseHTTPError): + driver.list_nodes() + + # Token was evicted + self.assertEqual(len(auth_cache), 0) + def test_list_nodes(self): nodes = self.driver.list_nodes() self.assertEqual(len(nodes), 2) node = nodes[0] - self.assertEqual('12065', node.id) + self.assertEqual("12065", node.id) # test public IPv4 - self.assertTrue('12.16.18.28' in node.public_ips) - self.assertTrue('50.57.94.35' in node.public_ips) + self.assertTrue("12.16.18.28" in node.public_ips) + self.assertTrue("50.57.94.35" in node.public_ips) + + # fixed public ip + self.assertTrue("1.1.1.1" in node.public_ips) - # floating ip - self.assertTrue('192.168.3.3' in node.public_ips) + # floating public ip + self.assertTrue("2.2.2.2" in node.public_ips) # test public IPv6 - self.assertTrue( - '2001:4801:7808:52:16:3eff:fe47:788a' in node.public_ips) + self.assertTrue("2001:4801:7808:52:16:3eff:fe47:788a" in node.public_ips) # test private IPv4 - self.assertTrue('10.182.64.34' in node.private_ips) + self.assertTrue("10.182.64.34" in node.private_ips) + + # fixed private ip + self.assertTrue("10.3.3.3" in node.private_ips) - # floating ip - self.assertTrue('10.3.3.3' in node.private_ips) + # floating private ip + self.assertTrue("192.168.3.3" in node.private_ips) + self.assertTrue("172.16.1.1" in node.private_ips) # test private IPv6 - self.assertTrue( - 'fec0:4801:7808:52:16:3eff:fe60:187d' in node.private_ips) - - self.assertEqual(node.extra.get('flavorId'), '2') - self.assertEqual(node.extra.get('imageId'), '7') - self.assertEqual(node.extra.get('metadata'), {}) - self.assertEqual(node.extra['updated'], '2011-10-11T00:50:04Z') - self.assertEqual(node.extra['created'], '2011-10-11T00:51:39Z') - self.assertEqual(node.extra.get('userId'), 'rs-reach') - self.assertEqual(node.extra.get('hostId'), '912566d83a13fbb357ea' - '3f13c629363d9f7e1ba3f' - '925b49f3d2ab725') - self.assertEqual(node.extra.get('disk_config'), 'AUTO') - self.assertEqual(node.extra.get('task_state'), 'spawning') - self.assertEqual(node.extra.get('vm_state'), 'active') - self.assertEqual(node.extra.get('power_state'), 1) - self.assertEqual(node.extra.get('progress'), 25) + self.assertTrue("fec0:4801:7808:52:16:3eff:fe60:187d" in node.private_ips) + + # test creation date + self.assertEqual(node.created_at, datetime.datetime(2011, 10, 11, 0, 51, 39, tzinfo=UTC)) + + self.assertEqual(node.extra.get("flavorId"), "2") + self.assertEqual(node.extra.get("imageId"), "7") + self.assertEqual(node.extra.get("metadata"), {}) + self.assertEqual(node.extra["updated"], "2011-10-11T00:50:04Z") + self.assertEqual(node.extra["created"], "2011-10-11T00:51:39Z") + self.assertEqual(node.extra.get("userId"), "rs-reach") + self.assertEqual( + node.extra.get("hostId"), + "912566d83a13fbb357ea" "3f13c629363d9f7e1ba3f" "925b49f3d2ab725", + ) + self.assertEqual(node.extra.get("disk_config"), "AUTO") + self.assertEqual(node.extra.get("task_state"), "spawning") + self.assertEqual(node.extra.get("vm_state"), "active") + self.assertEqual(node.extra.get("power_state"), 1) + self.assertEqual(node.extra.get("progress"), 25) + self.assertEqual(node.extra.get("fault")["id"], 1234) + self.assertTrue(node.extra.get("service_name") is not None) + self.assertTrue(node.extra.get("uri") is not None) def test_list_nodes_no_image_id_attribute(self): # Regression test for LIBCLOD-455 - self.driver_klass.connectionCls.conn_classes[0].type = 'ERROR_STATE_NO_IMAGE_ID' - self.driver_klass.connectionCls.conn_classes[1].type = 'ERROR_STATE_NO_IMAGE_ID' + self.driver_klass.connectionCls.conn_class.type = "ERROR_STATE_NO_IMAGE_ID" nodes = self.driver.list_nodes() - self.assertEqual(nodes[0].extra['imageId'], None) + self.assertIsNone(nodes[0].extra["imageId"]) def test_list_volumes(self): volumes = self.driver.list_volumes() self.assertEqual(len(volumes), 2) volume = volumes[0] - self.assertEqual('cd76a3a1-c4ce-40f6-9b9f-07a61508938d', volume.id) - self.assertEqual('test_volume_2', volume.name) + self.assertEqual("cd76a3a1-c4ce-40f6-9b9f-07a61508938d", volume.id) + self.assertEqual("test_volume_2", volume.name) self.assertEqual(StorageVolumeState.AVAILABLE, volume.state) self.assertEqual(2, volume.size) - self.assertEqual(volume.extra, { - 'description': '', - 'attachments': [{ - 'id': 'cd76a3a1-c4ce-40f6-9b9f-07a61508938d', - "device": "/dev/vdb", - "serverId": "12065", - "volumeId": "cd76a3a1-c4ce-40f6-9b9f-07a61508938d", - }], - 'snapshot_id': None, - 'state': 'available', - 'location': 'nova', - 'volume_type': 'None', - 'metadata': {}, - 'created_at': '2013-06-24T11:20:13.000000', - }) + self.assertEqual( + volume.extra, + { + "description": "", + "attachments": [ + { + "id": "cd76a3a1-c4ce-40f6-9b9f-07a61508938d", + "device": "/dev/vdb", + "serverId": "12065", + "volumeId": "cd76a3a1-c4ce-40f6-9b9f-07a61508938d", + } + ], + "snapshot_id": None, + "state": "available", + "location": "nova", + "volume_type": "None", + "metadata": {}, + "created_at": "2013-06-24T11:20:13.000000", + }, + ) # also test that unknown state resolves to StorageVolumeState.UNKNOWN volume = volumes[1] - self.assertEqual('cfcec3bc-b736-4db5-9535-4c24112691b5', volume.id) - self.assertEqual('test_volume', volume.name) + self.assertEqual("cfcec3bc-b736-4db5-9535-4c24112691b5", volume.id) + self.assertEqual("test_volume", volume.name) self.assertEqual(50, volume.size) self.assertEqual(StorageVolumeState.UNKNOWN, volume.state) - self.assertEqual(volume.extra, { - 'description': 'some description', - 'attachments': [], - 'snapshot_id': '01f48111-7866-4cd2-986a-e92683c4a363', - 'state': 'some-unknown-state', - 'location': 'nova', - 'volume_type': 'None', - 'metadata': {}, - 'created_at': '2013-06-21T12:39:02.000000', - }) + self.assertEqual( + volume.extra, + { + "description": "some description", + "attachments": [], + "snapshot_id": "01f48111-7866-4cd2-986a-e92683c4a363", + "state": "some-unknown-state", + "location": "nova", + "volume_type": "None", + "metadata": {}, + "created_at": "2013-06-21T12:39:02.000000", + }, + ) def test_list_sizes(self): sizes = self.driver.list_sizes() - self.assertEqual(len(sizes), 8, 'Wrong sizes count') + self.assertEqual(len(sizes), 8, "Wrong sizes count") for size in sizes: - self.assertTrue(isinstance(size.price, float), - 'Wrong size price type') + self.assertTrue( + size.price is None or isinstance(size.price, float), + "Wrong size price type", + ) self.assertTrue(isinstance(size.ram, int)) self.assertTrue(isinstance(size.vcpus, int)) self.assertTrue(isinstance(size.disk, int)) self.assertTrue(isinstance(size.swap, int)) - self.assertTrue(isinstance(size.ephemeral_disk, int) or - size.ephemeral_disk is None) + self.assertTrue(isinstance(size.ephemeral_disk, int) or size.ephemeral_disk is None) self.assertTrue(isinstance(size.extra, dict)) - if size.id == '1': + + if size.id == "1": self.assertEqual(size.ephemeral_disk, 40) - self.assertEqual(size.extra, { - "policy_class": "standard_flavor", - "class": "standard1", - "disk_io_index": "2", - "number_of_data_disks": "0" - }) + self.assertEqual( + size.extra, + { + "policy_class": "standard_flavor", + "class": "standard1", + "disk_io_index": "2", + "number_of_data_disks": "0", + "disabled": False, + }, + ) self.assertEqual(sizes[0].vcpus, 8) def test_list_sizes_with_specified_pricing(self): + pricing = {str(i): i * 5.0 for i in range(1, 9)} - pricing = dict((str(i), i * 5.0) for i in range(1, 9)) - - set_pricing(driver_type='compute', - driver_name=self.driver.api_name, pricing=pricing) + set_pricing(driver_type="compute", driver_name=self.driver.api_name, pricing=pricing) sizes = self.driver.list_sizes() - self.assertEqual(len(sizes), 8, 'Wrong sizes count') + self.assertEqual(len(sizes), 8, "Wrong sizes count") for size in sizes: - self.assertTrue(isinstance(size.price, float), - 'Wrong size price type') + self.assertTrue(isinstance(size.price, float), "Wrong size price type") - self.assertEqual(size.price, pricing[size.id], - 'Size price should match') + self.assertEqual(size.price, pricing[size.id], "Size price should match") def test_list_images(self): images = self.driver.list_images() - self.assertEqual(len(images), 13, 'Wrong images count') + self.assertEqual(len(images), 13, "Wrong images count") image = images[0] - self.assertEqual(image.id, '13') - self.assertEqual(image.name, 'Windows 2008 SP2 x86 (B24)') - self.assertEqual(image.extra['updated'], '2011-08-06T18:14:02Z') - self.assertEqual(image.extra['created'], '2011-08-06T18:13:11Z') - self.assertEqual(image.extra['status'], 'ACTIVE') - self.assertEqual(image.extra['metadata']['os_type'], 'windows') - self.assertEqual( - image.extra['serverId'], '52415800-8b69-11e0-9b19-734f335aa7b3') - self.assertEqual(image.extra['minDisk'], 0) - self.assertEqual(image.extra['minRam'], 0) + self.assertEqual(image.id, "13") + self.assertEqual(image.name, "Windows 2008 SP2 x86 (B24)") + self.assertEqual(image.extra["updated"], "2011-08-06T18:14:02Z") + self.assertEqual(image.extra["created"], "2011-08-06T18:13:11Z") + self.assertEqual(image.extra["status"], "ACTIVE") + self.assertEqual(image.extra["metadata"]["os_type"], "windows") + self.assertEqual(image.extra["serverId"], "52415800-8b69-11e0-9b19-734f335aa7b3") + self.assertEqual(image.extra["minDisk"], 0) + self.assertEqual(image.extra["minRam"], 0) def test_create_node(self): - image = NodeImage( - id=11, name='Ubuntu 8.10 (intrepid)', driver=self.driver) - size = NodeSize( - 1, '256 slice', None, None, None, None, driver=self.driver) - node = self.driver.create_node(name='racktest', image=image, size=size) - self.assertEqual(node.id, '26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe') - self.assertEqual(node.name, 'racktest') - self.assertEqual(node.extra['password'], 'racktestvJq7d3') - self.assertEqual(node.extra['metadata']['My Server Name'], 'Apache1') + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + node = self.driver.create_node(name="racktest", image=image, size=size) + self.assertEqual(node.id, "26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe") + self.assertEqual(node.name, "racktest") + self.assertEqual(node.extra["password"], "racktestvJq7d3") + self.assertEqual(node.extra["metadata"]["My Server Name"], "Apache1") def test_create_node_with_ex_keyname_and_ex_userdata(self): - image = NodeImage( - id=11, name='Ubuntu 8.10 (intrepid)', driver=self.driver) - size = NodeSize( - 1, '256 slice', None, None, None, None, driver=self.driver) - node = self.driver.create_node(name='racktest', image=image, size=size, - ex_keyname='devstack', - ex_userdata='sample data') - self.assertEqual(node.id, '26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe') - self.assertEqual(node.name, 'racktest') - self.assertEqual(node.extra['password'], 'racktestvJq7d3') - self.assertEqual(node.extra['metadata']['My Server Name'], 'Apache1') - self.assertEqual(node.extra['key_name'], 'devstack') + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + node = self.driver.create_node( + name="racktest", + image=image, + size=size, + ex_keyname="devstack", + ex_userdata="sample data", + ) + self.assertEqual(node.id, "26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe") + self.assertEqual(node.name, "racktest") + self.assertEqual(node.extra["password"], "racktestvJq7d3") + self.assertEqual(node.extra["metadata"]["My Server Name"], "Apache1") + self.assertEqual(node.extra["key_name"], "devstack") def test_create_node_with_availability_zone(self): - image = NodeImage( - id=11, name='Ubuntu 8.10 (intrepid)', driver=self.driver) - size = NodeSize( - 1, '256 slice', None, None, None, None, driver=self.driver) - node = self.driver.create_node(name='racktest', image=image, size=size, - availability_zone='testaz') - self.assertEqual(node.id, '26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe') - self.assertEqual(node.name, 'racktest') - self.assertEqual(node.extra['password'], 'racktestvJq7d3') - self.assertEqual(node.extra['metadata']['My Server Name'], 'Apache1') - self.assertEqual(node.extra['availability_zone'], 'testaz') + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + node = self.driver.create_node( + name="racktest", image=image, size=size, ex_availability_zone="testaz" + ) + self.assertEqual(node.id, "26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe") + self.assertEqual(node.name, "racktest") + self.assertEqual(node.extra["password"], "racktestvJq7d3") + self.assertEqual(node.extra["metadata"]["My Server Name"], "Apache1") + self.assertEqual(node.extra["availability_zone"], "testaz") def test_create_node_with_ex_disk_config(self): - OpenStack_1_1_MockHttp.type = 'EX_DISK_CONFIG' - image = NodeImage( - id=11, name='Ubuntu 8.10 (intrepid)', driver=self.driver) - size = NodeSize( - 1, '256 slice', None, None, None, None, driver=self.driver) - node = self.driver.create_node(name='racktest', image=image, size=size, - ex_disk_config='AUTO') - self.assertEqual(node.id, '26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe') - self.assertEqual(node.name, 'racktest') - self.assertEqual(node.extra['disk_config'], 'AUTO') + OpenStack_1_1_MockHttp.type = "EX_DISK_CONFIG" + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + node = self.driver.create_node( + name="racktest", image=image, size=size, ex_disk_config="AUTO" + ) + self.assertEqual(node.id, "26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe") + self.assertEqual(node.name, "racktest") + self.assertEqual(node.extra["disk_config"], "AUTO") def test_create_node_with_ex_config_drive(self): - OpenStack_1_1_MockHttp.type = 'EX_CONFIG_DRIVE' - image = NodeImage( - id=11, name='Ubuntu 8.10 (intrepid)', driver=self.driver) - size = NodeSize( - 1, '256 slice', None, None, None, None, driver=self.driver) - node = self.driver.create_node(name='racktest', image=image, size=size, - ex_config_drive=True) - self.assertEqual(node.id, '26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe') - self.assertEqual(node.name, 'racktest') - self.assertTrue(node.extra['config_drive']) + OpenStack_1_1_MockHttp.type = "EX_CONFIG_DRIVE" + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + node = self.driver.create_node( + name="racktest", image=image, size=size, ex_config_drive=True + ) + self.assertEqual(node.id, "26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe") + self.assertEqual(node.name, "racktest") + self.assertTrue(node.extra["config_drive"]) + + def test_create_node_from_bootable_volume(self): + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + + node = self.driver.create_node( + image=None, + name="racktest", + size=size, + ex_blockdevicemappings=[ + { + "boot_index": 0, + "uuid": "ee7ee330-b454-4414-8e9f-c70c558dd3af", + "source_type": "volume", + "destination_type": "volume", + "delete_on_termination": False, + } + ], + ) + + self.assertEqual(node.id, "26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe") + self.assertEqual(node.name, "racktest") + self.assertEqual(node.extra["password"], "racktestvJq7d3") + self.assertEqual(node.extra["metadata"]["My Server Name"], "Apache1") + + def test_create_node_with_ex_files(self): + OpenStack_2_0_MockHttp.type = "EX_FILES" + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + files = {"/file1": "content1", "/file2": "content2"} + node = self.driver.create_node(name="racktest", image=image, size=size, ex_files=files) + self.assertEqual(node.id, "26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe") + self.assertEqual(node.name, "racktest") + OpenStack_2_0_MockHttp.type = "EX_FILES_NONE" + node = self.driver.create_node(name="racktest", image=image, size=size) + self.assertEqual(node.id, "26f7fbee-8ce1-4c28-887a-bfe8e4bb10fe") + self.assertEqual(node.name, "racktest") def test_destroy_node(self): self.assertTrue(self.node.destroy()) @@ -966,617 +1265,1494 @@ def test_reboot_node(self): self.assertTrue(self.node.reboot()) def test_create_volume(self): - volume = self.driver.create_volume(1, 'test') - self.assertEqual(volume.name, 'test') + volume = self.driver.create_volume(1, "test") + self.assertEqual(volume.name, "test") self.assertEqual(volume.size, 1) + def test_create_volume_passes_location_to_request_only_if_not_none(self): + with patch.object(self.driver.connection, "request") as mock_request: + self.driver.create_volume(1, "test", location="mylocation") + name, args, kwargs = mock_request.mock_calls[0] + self.assertEqual(kwargs["data"]["volume"]["availability_zone"], "mylocation") + + def test_create_volume_does_not_pass_location_to_request_if_none(self): + with patch.object(self.driver.connection, "request") as mock_request: + self.driver.create_volume(1, "test") + name, args, kwargs = mock_request.mock_calls[0] + self.assertFalse("availability_zone" in kwargs["data"]["volume"]) + + def test_create_volume_passes_volume_type_to_request_only_if_not_none(self): + with patch.object(self.driver.connection, "request") as mock_request: + self.driver.create_volume(1, "test", ex_volume_type="myvolumetype") + name, args, kwargs = mock_request.mock_calls[0] + self.assertEqual(kwargs["data"]["volume"]["volume_type"], "myvolumetype") + + def test_create_volume_does_not_pass_volume_type_to_request_if_none(self): + with patch.object(self.driver.connection, "request") as mock_request: + self.driver.create_volume(1, "test") + name, args, kwargs = mock_request.mock_calls[0] + self.assertFalse("volume_type" in kwargs["data"]["volume"]) + def test_destroy_volume(self): - volume = self.driver.ex_get_volume( - 'cd76a3a1-c4ce-40f6-9b9f-07a61508938d') + volume = self.driver.ex_get_volume("cd76a3a1-c4ce-40f6-9b9f-07a61508938d") self.assertEqual(self.driver.destroy_volume(volume), True) def test_attach_volume(self): node = self.driver.list_nodes()[0] - volume = self.driver.ex_get_volume( - 'cd76a3a1-c4ce-40f6-9b9f-07a61508938d') - self.assertEqual( - self.driver.attach_volume(node, volume, '/dev/sdb'), True) + volume = self.driver.ex_get_volume("cd76a3a1-c4ce-40f6-9b9f-07a61508938d") + self.assertEqual(self.driver.attach_volume(node, volume, "/dev/sdb"), True) + + def test_attach_volume_device_auto(self): + node = self.driver.list_nodes()[0] + volume = self.driver.ex_get_volume("cd76a3a1-c4ce-40f6-9b9f-07a61508938d") + + OpenStack_2_0_MockHttp.type = "DEVICE_AUTO" + + self.assertEqual(self.driver.attach_volume(node, volume, "auto"), True) def test_detach_volume(self): node = self.driver.list_nodes()[0] - volume = self.driver.ex_get_volume( - 'cd76a3a1-c4ce-40f6-9b9f-07a61508938d') - self.assertEqual( - self.driver.attach_volume(node, volume, '/dev/sdb'), True) + volume = self.driver.ex_get_volume("cd76a3a1-c4ce-40f6-9b9f-07a61508938d") + self.assertEqual(self.driver.attach_volume(node, volume, "/dev/sdb"), True) self.assertEqual(self.driver.detach_volume(volume), True) def test_ex_set_password(self): - self.assertTrue(self.driver.ex_set_password(self.node, 'New1&53jPass')) + self.assertTrue(self.driver.ex_set_password(self.node, "New1&53jPass")) def test_ex_rebuild(self): - image = NodeImage(id=11, name='Ubuntu 8.10 (intrepid)', - driver=self.driver) + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) success = self.driver.ex_rebuild(self.node, image=image) self.assertTrue(success) def test_ex_rebuild_with_ex_disk_config(self): - image = NodeImage(id=58, name='Ubuntu 10.10 (intrepid)', - driver=self.driver) - node = Node(id=12066, name=None, state=None, public_ips=None, - private_ips=None, driver=self.driver) - success = self.driver.ex_rebuild(node, image=image, - ex_disk_config='MANUAL') + image = NodeImage(id=58, name="Ubuntu 10.10 (intrepid)", driver=self.driver) + node = Node( + id=12066, + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + success = self.driver.ex_rebuild(node, image=image, ex_disk_config="MANUAL") self.assertTrue(success) def test_ex_rebuild_with_ex_config_drive(self): - image = NodeImage(id=58, name='Ubuntu 10.10 (intrepid)', - driver=self.driver) - node = Node(id=12066, name=None, state=None, public_ips=None, - private_ips=None, driver=self.driver) - success = self.driver.ex_rebuild(node, image=image, - ex_disk_config='MANUAL', - ex_config_drive=True) + image = NodeImage(id=58, name="Ubuntu 10.10 (intrepid)", driver=self.driver) + node = Node( + id=12066, + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + success = self.driver.ex_rebuild( + node, image=image, ex_disk_config="MANUAL", ex_config_drive=True + ) self.assertTrue(success) def test_ex_resize(self): - size = NodeSize(1, '256 slice', None, None, None, None, - driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) try: self.driver.ex_resize(self.node, size) - except Exception: - e = sys.exc_info()[1] - self.fail('An error was raised: ' + repr(e)) + except Exception as e: + self.fail("An error was raised: " + repr(e)) def test_ex_confirm_resize(self): try: self.driver.ex_confirm_resize(self.node) - except Exception: - e = sys.exc_info()[1] - self.fail('An error was raised: ' + repr(e)) + except Exception as e: + self.fail("An error was raised: " + repr(e)) def test_ex_revert_resize(self): try: self.driver.ex_revert_resize(self.node) - except Exception: - e = sys.exc_info()[1] - self.fail('An error was raised: ' + repr(e)) + except Exception as e: + self.fail("An error was raised: " + repr(e)) def test_create_image(self): - image = self.driver.create_image(self.node, 'new_image') - self.assertEqual(image.name, 'new_image') - self.assertEqual(image.id, '4949f9ee-2421-4c81-8b49-13119446008b') + image = self.driver.create_image(self.node, "new_image") + self.assertEqual(image.name, "new_image") + self.assertEqual(image.id, "4949f9ee-2421-4c81-8b49-13119446008b") + + def test_create_image_with_description_and_metadata(self): + metadata = {"version": "1.0"} + response = Mock( + headers={ + "location": ( + "http://127.0.0.1/v1.1/68/images/" "4949f9ee-2421-4c81-8b49-13119446008b" + ) + } + ) + + with mock.patch.object(self.driver, "_node_action", return_value=response) as action: + self.driver.create_image( + self.node, + "new_image", + description="Image description", + metadata=metadata, + ) + + action.assert_called_once_with( + self.node, + "createImage", + name="new_image", + metadata={"version": "1.0", "description": "Image description"}, + ) + self.assertEqual(metadata, {"version": "1.0"}) def test_ex_set_server_name(self): old_node = Node( - id='12064', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver, + id="12064", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, ) - new_node = self.driver.ex_set_server_name(old_node, 'Bob') - self.assertEqual('Bob', new_node.name) + new_node = self.driver.ex_set_server_name(old_node, "Bob") + self.assertEqual("Bob", new_node.name) def test_ex_set_metadata(self): old_node = Node( - id='12063', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver, + id="12063", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, ) - metadata = {'Image Version': '2.1', 'Server Label': 'Web Head 1'} + metadata = {"Image Version": "2.1", "Server Label": "Web Head 1"} returned_metadata = self.driver.ex_set_metadata(old_node, metadata) self.assertEqual(metadata, returned_metadata) def test_ex_get_metadata(self): node = Node( - id='12063', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver, + id="12063", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, ) - metadata = {'Image Version': '2.1', 'Server Label': 'Web Head 1'} + metadata = {"Image Version": "2.1", "Server Label": "Web Head 1"} returned_metadata = self.driver.ex_get_metadata(node) self.assertEqual(metadata, returned_metadata) def test_ex_update_node(self): old_node = Node( - id='12064', - name=None, state=None, public_ips=None, private_ips=None, driver=self.driver, + id="12064", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, ) - new_node = self.driver.ex_update_node(old_node, name='Bob') + new_node = self.driver.ex_update_node(old_node, name="Bob") self.assertTrue(new_node) - self.assertEqual('Bob', new_node.name) - self.assertEqual('50.57.94.30', new_node.public_ips[0]) + self.assertEqual("Bob", new_node.name) + self.assertEqual("50.57.94.30", new_node.public_ips[0]) def test_ex_get_node_details(self): - node_id = '12064' + node_id = "12064" + node = self.driver.ex_get_node_details(node_id) + self.assertEqual(node.id, "12064") + self.assertEqual(node.name, "lc-test") + + def test_ex_get_node_details_returns_none_if_node_does_not_exist(self): + node = self.driver.ex_get_node_details("does-not-exist") + self.assertTrue(node is None) + + def test_ex_get_node_details_microversion_2_47(self): + node_id = "12064247" node = self.driver.ex_get_node_details(node_id) - self.assertEqual(node.id, '12064') - self.assertEqual(node.name, 'lc-test') + self.assertEqual(node.id, "12064247") + self.assertEqual(node.name, "lc-test") + self.assertEqual(node.extra["flavor_details"]["vcpus"], 2) def test_ex_get_size(self): - size_id = '7' + size_id = "7" size = self.driver.ex_get_size(size_id) self.assertEqual(size.id, size_id) - self.assertEqual(size.name, '15.5GB slice') + self.assertEqual(size.name, "15.5GB slice") + + def test_ex_get_size_extra_specs(self): + size_id = "7" + extra_specs = self.driver.ex_get_size_extra_specs(size_id) + self.assertEqual(extra_specs, {"hw:cpu_policy": "shared", "hw:numa_nodes": "1"}) def test_get_image(self): - image_id = '13' + image_id = "13" image = self.driver.get_image(image_id) self.assertEqual(image.id, image_id) - self.assertEqual(image.name, 'Windows 2008 SP2 x86 (B24)') - self.assertEqual(image.extra['serverId'], None) - self.assertEqual(image.extra['minDisk'], "5") - self.assertEqual(image.extra['minRam'], "256") + self.assertEqual(image.name, "Windows 2008 SP2 x86 (B24)") + self.assertIsNone(image.extra["serverId"]) + self.assertEqual(image.extra["minDisk"], "5") + self.assertEqual(image.extra["minRam"], "256") + self.assertIsNone(image.extra["visibility"]) def test_delete_image(self): image = NodeImage( - id='26365521-8c62-11f9-2c33-283d153ecc3a', name='My Backup', driver=self.driver) + id="26365521-8c62-11f9-2c33-283d153ecc3a", + name="My Backup", + driver=self.driver, + ) result = self.driver.delete_image(image) self.assertTrue(result) def test_extract_image_id_from_url(self): - url = 'http://127.0.0.1/v1.1/68/images/1d4a8ea9-aae7-4242-a42d-5ff4702f2f14' - url_two = 'http://127.0.0.1/v1.1/68/images/13' + url = "http://127.0.0.1/v1.1/68/images/1d4a8ea9-aae7-4242-a42d-5ff4702f2f14" + url_two = "http://127.0.0.1/v1.1/68/images/13" image_id = self.driver._extract_image_id_from_url(url) image_id_two = self.driver._extract_image_id_from_url(url_two) - self.assertEqual(image_id, '1d4a8ea9-aae7-4242-a42d-5ff4702f2f14') - self.assertEqual(image_id_two, '13') + self.assertEqual(image_id, "1d4a8ea9-aae7-4242-a42d-5ff4702f2f14") + self.assertEqual(image_id_two, "13") def test_ex_rescue_with_password(self): - node = Node(id=12064, name=None, state=None, public_ips=None, - private_ips=None, driver=self.driver) - n = self.driver.ex_rescue(node, 'foo') - self.assertEqual(n.extra['password'], 'foo') + node = Node( + id=12064, + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + n = self.driver.ex_rescue(node, "foo") + self.assertEqual(n.extra["password"], "foo") def test_ex_rescue_no_password(self): - node = Node(id=12064, name=None, state=None, public_ips=None, - private_ips=None, driver=self.driver) + node = Node( + id=12064, + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) n = self.driver.ex_rescue(node) - self.assertEqual(n.extra['password'], 'foo') + self.assertEqual(n.extra["password"], "foo") def test_ex_unrescue(self): - node = Node(id=12064, name=None, state=None, public_ips=None, - private_ips=None, driver=self.driver) + node = Node( + id=12064, + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) result = self.driver.ex_unrescue(node) self.assertTrue(result) def test_ex_get_node_security_groups(self): - node = Node(id='1c01300f-ef97-4937-8f03-ac676d6234be', name=None, - state=None, public_ips=None, private_ips=None, driver=self.driver) + node = Node( + id="1c01300f-ef97-4937-8f03-ac676d6234be", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) security_groups = self.driver.ex_get_node_security_groups(node) - self.assertEqual( - len(security_groups), 2, 'Wrong security groups count') + self.assertEqual(len(security_groups), 2, "Wrong security groups count") security_group = security_groups[1] self.assertEqual(security_group.id, 4) - self.assertEqual(security_group.tenant_id, '68') - self.assertEqual(security_group.name, 'ftp') - self.assertEqual( - security_group.description, 'FTP Client-Server - Open 20-21 ports') + self.assertEqual(security_group.tenant_id, "68") + self.assertEqual(security_group.name, "ftp") + self.assertEqual(security_group.description, "FTP Client-Server - Open 20-21 ports") self.assertEqual(security_group.rules[0].id, 1) self.assertEqual(security_group.rules[0].parent_group_id, 4) self.assertEqual(security_group.rules[0].ip_protocol, "tcp") self.assertEqual(security_group.rules[0].from_port, 20) self.assertEqual(security_group.rules[0].to_port, 21) - self.assertEqual(security_group.rules[0].ip_range, '0.0.0.0/0') + self.assertEqual(security_group.rules[0].ip_range, "0.0.0.0/0") def test_ex_list_security_groups(self): security_groups = self.driver.ex_list_security_groups() - self.assertEqual( - len(security_groups), 2, 'Wrong security groups count') + self.assertEqual(len(security_groups), 2, "Wrong security groups count") security_group = security_groups[1] self.assertEqual(security_group.id, 4) - self.assertEqual(security_group.tenant_id, '68') - self.assertEqual(security_group.name, 'ftp') - self.assertEqual( - security_group.description, 'FTP Client-Server - Open 20-21 ports') + self.assertEqual(security_group.tenant_id, "68") + self.assertEqual(security_group.name, "ftp") + self.assertEqual(security_group.description, "FTP Client-Server - Open 20-21 ports") self.assertEqual(security_group.rules[0].id, 1) self.assertEqual(security_group.rules[0].parent_group_id, 4) self.assertEqual(security_group.rules[0].ip_protocol, "tcp") self.assertEqual(security_group.rules[0].from_port, 20) self.assertEqual(security_group.rules[0].to_port, 21) - self.assertEqual(security_group.rules[0].ip_range, '0.0.0.0/0') + self.assertEqual(security_group.rules[0].ip_range, "0.0.0.0/0") def test_ex_create_security_group(self): - name = 'test' - description = 'Test Security Group' - security_group = self.driver.ex_create_security_group( - name, description) + name = "test" + description = "Test Security Group" + security_group = self.driver.ex_create_security_group(name, description) self.assertEqual(security_group.id, 6) - self.assertEqual(security_group.tenant_id, '68') + self.assertEqual(security_group.tenant_id, "68") self.assertEqual(security_group.name, name) self.assertEqual(security_group.description, description) self.assertEqual(len(security_group.rules), 0) def test_ex_delete_security_group(self): security_group = OpenStackSecurityGroup( - id=6, tenant_id=None, name=None, description=None, driver=self.driver) + id=6, tenant_id=None, name=None, description=None, driver=self.driver + ) result = self.driver.ex_delete_security_group(security_group) self.assertTrue(result) def test_ex_create_security_group_rule(self): security_group = OpenStackSecurityGroup( - id=6, tenant_id=None, name=None, description=None, driver=self.driver) + id=6, tenant_id=None, name=None, description=None, driver=self.driver + ) security_group_rule = self.driver.ex_create_security_group_rule( - security_group, 'tcp', 14, 16, '0.0.0.0/0') + security_group, "tcp", 14, 16, "0.0.0.0/0" + ) self.assertEqual(security_group_rule.id, 2) self.assertEqual(security_group_rule.parent_group_id, 6) - self.assertEqual(security_group_rule.ip_protocol, 'tcp') + self.assertEqual(security_group_rule.ip_protocol, "tcp") self.assertEqual(security_group_rule.from_port, 14) self.assertEqual(security_group_rule.to_port, 16) - self.assertEqual(security_group_rule.ip_range, '0.0.0.0/0') - self.assertEqual(security_group_rule.tenant_id, None) + self.assertEqual(security_group_rule.ip_range, "0.0.0.0/0") + self.assertIsNone(security_group_rule.tenant_id) def test_ex_delete_security_group_rule(self): security_group_rule = OpenStackSecurityGroupRule( - id=2, parent_group_id=None, ip_protocol=None, from_port=None, to_port=None, driver=self.driver) + id=2, + parent_group_id=None, + ip_protocol=None, + from_port=None, + to_port=None, + driver=self.driver, + ) result = self.driver.ex_delete_security_group_rule(security_group_rule) self.assertTrue(result) def test_list_key_pairs(self): keypairs = self.driver.list_key_pairs() - self.assertEqual(len(keypairs), 2, 'Wrong keypairs count') + self.assertEqual(len(keypairs), 2, "Wrong keypairs count") keypair = keypairs[1] - self.assertEqual(keypair.name, 'key2') - self.assertEqual( - keypair.fingerprint, '5d:66:33:ae:99:0f:fb:cb:86:f2:bc:ae:53:99:b6:ed') + self.assertEqual(keypair.name, "key2") + self.assertEqual(keypair.fingerprint, "5d:66:33:ae:99:0f:fb:cb:86:f2:bc:ae:53:99:b6:ed") self.assertTrue(len(keypair.public_key) > 10) - self.assertEqual(keypair.private_key, None) + self.assertIsNone(keypair.private_key) def test_get_key_pair(self): - key_pair = self.driver.get_key_pair(name='test-key-pair') + key_pair = self.driver.get_key_pair(name="test-key-pair") - self.assertEqual(key_pair.name, 'test-key-pair') + self.assertEqual(key_pair.name, "test-key-pair") def test_get_key_pair_doesnt_exist(self): - self.assertRaises(KeyPairDoesNotExistError, - self.driver.get_key_pair, - name='doesnt-exist') + self.assertRaises(KeyPairDoesNotExistError, self.driver.get_key_pair, name="doesnt-exist") def test_create_key_pair(self): - name = 'key0' + name = "key0" keypair = self.driver.create_key_pair(name=name) self.assertEqual(keypair.name, name) - self.assertEqual(keypair.fingerprint, - '80:f8:03:a7:8e:c1:c3:b1:7e:c5:8c:50:04:5e:1c:5b') + self.assertEqual(keypair.fingerprint, "80:f8:03:a7:8e:c1:c3:b1:7e:c5:8c:50:04:5e:1c:5b") self.assertTrue(len(keypair.public_key) > 10) self.assertTrue(len(keypair.private_key) > 10) def test_import_key_pair_from_file(self): - name = 'key3' - path = os.path.join( - os.path.dirname(__file__), 'fixtures', 'misc', 'dummy_rsa.pub') - pub_key = open(path, 'r').read() - keypair = self.driver.import_key_pair_from_file(name=name, - key_file_path=path) + name = "key3" + path = os.path.join(os.path.dirname(__file__), "fixtures", "misc", "test_rsa.pub") + + with open(path) as fp: + pub_key = fp.read() + + keypair = self.driver.import_key_pair_from_file(name=name, key_file_path=path) self.assertEqual(keypair.name, name) - self.assertEqual( - keypair.fingerprint, '97:10:a6:e7:92:65:7e:69:fe:e6:81:8f:39:3c:8f:5a') + self.assertEqual(keypair.fingerprint, "97:10:a6:e7:92:65:7e:69:fe:e6:81:8f:39:3c:8f:5a") self.assertEqual(keypair.public_key, pub_key) - self.assertEqual(keypair.private_key, None) + self.assertIsNone(keypair.private_key) def test_import_key_pair_from_string(self): - name = 'key3' - path = os.path.join( - os.path.dirname(__file__), 'fixtures', 'misc', 'dummy_rsa.pub') - pub_key = open(path, 'r').read() - keypair = self.driver.import_key_pair_from_string(name=name, - key_material=pub_key) + name = "key3" + path = os.path.join(os.path.dirname(__file__), "fixtures", "misc", "test_rsa.pub") + + with open(path) as fp: + pub_key = fp.read() + + keypair = self.driver.import_key_pair_from_string(name=name, key_material=pub_key) self.assertEqual(keypair.name, name) - self.assertEqual( - keypair.fingerprint, '97:10:a6:e7:92:65:7e:69:fe:e6:81:8f:39:3c:8f:5a') + self.assertEqual(keypair.fingerprint, "97:10:a6:e7:92:65:7e:69:fe:e6:81:8f:39:3c:8f:5a") self.assertEqual(keypair.public_key, pub_key) - self.assertEqual(keypair.private_key, None) + self.assertIsNone(keypair.private_key) def test_delete_key_pair(self): keypair = OpenStackKeyPair( - name='key1', fingerprint=None, public_key=None, driver=self.driver) + name="key1", fingerprint=None, public_key=None, driver=self.driver + ) result = self.driver.delete_key_pair(key_pair=keypair) self.assertTrue(result) def test_ex_list_floating_ip_pools(self): ret = self.driver.ex_list_floating_ip_pools() - self.assertEqual(ret[0].name, 'public') - self.assertEqual(ret[1].name, 'foobar') + self.assertEqual(ret[0].name, "public") + self.assertEqual(ret[1].name, "foobar") def test_ex_attach_floating_ip_to_node(self): - image = NodeImage( - id=11, name='Ubuntu 8.10 (intrepid)', driver=self.driver) - size = NodeSize( - 1, '256 slice', None, None, None, None, driver=self.driver) - node = self.driver.create_node(name='racktest', image=image, size=size) + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + node = self.driver.create_node(name="racktest", image=image, size=size) node.id = 4242 - ip = '42.42.42.42' + ip = "42.42.42.42" self.assertTrue(self.driver.ex_attach_floating_ip_to_node(node, ip)) def test_detach_floating_ip_from_node(self): - image = NodeImage( - id=11, name='Ubuntu 8.10 (intrepid)', driver=self.driver) - size = NodeSize( - 1, '256 slice', None, None, None, None, driver=self.driver) - node = self.driver.create_node(name='racktest', image=image, size=size) + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + node = self.driver.create_node(name="racktest", image=image, size=size) node.id = 4242 - ip = '42.42.42.42' + ip = "42.42.42.42" self.assertTrue(self.driver.ex_detach_floating_ip_from_node(node, ip)) def test_OpenStack_1_1_FloatingIpPool_list_floating_ips(self): - pool = OpenStack_1_1_FloatingIpPool('foo', self.driver.connection) + pool = OpenStack_1_1_FloatingIpPool("foo", self.driver.connection) ret = pool.list_floating_ips() - self.assertEqual(ret[0].id, '09ea1784-2f81-46dc-8c91-244b4df75bde') + self.assertEqual(ret[0].id, "09ea1784-2f81-46dc-8c91-244b4df75bde") self.assertEqual(ret[0].pool, pool) - self.assertEqual(ret[0].ip_address, '10.3.1.42') - self.assertEqual(ret[0].node_id, None) - self.assertEqual(ret[1].id, '04c5336a-0629-4694-ba30-04b0bdfa88a4') + self.assertEqual(ret[0].ip_address, "10.3.1.42") + self.assertIsNone(ret[0].node_id) + self.assertEqual(ret[1].id, "04c5336a-0629-4694-ba30-04b0bdfa88a4") self.assertEqual(ret[1].pool, pool) - self.assertEqual(ret[1].ip_address, '10.3.1.1') - self.assertEqual( - ret[1].node_id, 'fcfc96da-19e2-40fd-8497-f29da1b21143') + self.assertEqual(ret[1].ip_address, "10.3.1.1") + self.assertEqual(ret[1].node_id, "fcfc96da-19e2-40fd-8497-f29da1b21143") def test_OpenStack_1_1_FloatingIpPool_get_floating_ip(self): - pool = OpenStack_1_1_FloatingIpPool('foo', self.driver.connection) - ret = pool.get_floating_ip('10.3.1.42') + pool = OpenStack_1_1_FloatingIpPool("foo", self.driver.connection) + ret = pool.get_floating_ip("10.3.1.42") - self.assertEqual(ret.id, '09ea1784-2f81-46dc-8c91-244b4df75bde') + self.assertEqual(ret.id, "09ea1784-2f81-46dc-8c91-244b4df75bde") self.assertEqual(ret.pool, pool) - self.assertEqual(ret.ip_address, '10.3.1.42') - self.assertEqual(ret.node_id, None) + self.assertEqual(ret.ip_address, "10.3.1.42") + self.assertIsNone(ret.node_id) + + ret = pool.get_floating_ip("1.2.3.4") + self.assertIsNone(ret) def test_OpenStack_1_1_FloatingIpPool_create_floating_ip(self): - pool = OpenStack_1_1_FloatingIpPool('foo', self.driver.connection) + pool = OpenStack_1_1_FloatingIpPool("foo", self.driver.connection) ret = pool.create_floating_ip() - self.assertEqual(ret.id, '09ea1784-2f81-46dc-8c91-244b4df75bde') + self.assertEqual(ret.id, "09ea1784-2f81-46dc-8c91-244b4df75bde") self.assertEqual(ret.pool, pool) - self.assertEqual(ret.ip_address, '10.3.1.42') - self.assertEqual(ret.node_id, None) + self.assertEqual(ret.ip_address, "10.3.1.42") + self.assertIsNone(ret.node_id) def test_OpenStack_1_1_FloatingIpPool_delete_floating_ip(self): - pool = OpenStack_1_1_FloatingIpPool('foo', self.driver.connection) - ip = OpenStack_1_1_FloatingIpAddress('foo-bar-id', '42.42.42.42', pool) + pool = OpenStack_1_1_FloatingIpPool("foo", self.driver.connection) + ip = OpenStack_1_1_FloatingIpAddress("foo-bar-id", "42.42.42.42", pool) self.assertTrue(pool.delete_floating_ip(ip)) def test_OpenStack_1_1_FloatingIpAddress_delete(self): - pool = OpenStack_1_1_FloatingIpPool('foo', self.driver.connection) + pool = OpenStack_1_1_FloatingIpPool("foo", self.driver.connection) pool.delete_floating_ip = Mock() - ip = OpenStack_1_1_FloatingIpAddress('foo-bar-id', '42.42.42.42', pool) + ip = OpenStack_1_1_FloatingIpAddress("foo-bar-id", "42.42.42.42", pool) ip.pool.delete_floating_ip() self.assertEqual(pool.delete_floating_ip.call_count, 1) - def test_ex_list_network(self): - networks = self.driver.ex_list_networks() - network = networks[0] + def test_OpenStack_2_FloatingIpPool_list_floating_ips(self): + pool = OpenStack_2_FloatingIpPool(1, "foo", self.driver.connection) + ret = pool.list_floating_ips() - self.assertEqual(len(networks), 3) - self.assertEqual(network.name, 'test1') - self.assertEqual(network.cidr, '127.0.0.0/24') + self.assertEqual(ret[0].id, "09ea1784-2f81-46dc-8c91-244b4df75bde") + self.assertEqual(ret[0].get_pool(), pool) + self.assertEqual(ret[0].ip_address, "10.3.1.42") + self.assertEqual(ret[0].get_node_id(), None) + self.assertEqual(ret[1].id, "04c5336a-0629-4694-ba30-04b0bdfa88a4") + self.assertEqual(ret[1].get_pool(), pool) + self.assertEqual(ret[1].ip_address, "10.3.1.1") + self.assertEqual(ret[1].get_node_id(), "fcfc96da-19e2-40fd-8497-f29da1b21143") + self.assertEqual(ret[2].id, "123c5336a-0629-4694-ba30-04b0bdfa88a4") + self.assertEqual(ret[2].get_pool(), pool) + self.assertEqual(ret[2].ip_address, "10.3.1.2") + self.assertEqual(ret[2].get_node_id(), "cb4fba64-19e2-40fd-8497-f29da1b21143") + self.assertEqual(ret[3].id, "123c5336a-0629-4694-ba30-04b0bdfa88a4") + self.assertEqual(ret[3].get_pool(), pool) + self.assertEqual(ret[3].ip_address, "10.3.1.3") + self.assertEqual(ret[3].get_node_id(), "cb4fba64-19e2-40fd-8497-f29da1b21143") + + def test_OpenStack_2_FloatingIpPool_get_floating_ip(self): + pool = OpenStack_2_FloatingIpPool(1, "foo", self.driver.connection) + ret = pool.get_floating_ip("10.3.1.42") + + self.assertEqual(ret.id, "09ea1784-2f81-46dc-8c91-244b4df75bde") + self.assertEqual(ret.pool, pool) + self.assertEqual(ret.ip_address, "10.3.1.42") + self.assertEqual(ret.node_id, None) - def test_ex_create_network(self): - network = self.driver.ex_create_network(name='test1', - cidr='127.0.0.0/24') - self.assertEqual(network.name, 'test1') - self.assertEqual(network.cidr, '127.0.0.0/24') + def test_OpenStack_2_FloatingIpPool_create_floating_ip(self): + pool = OpenStack_2_FloatingIpPool(1, "foo", self.driver.connection) + ret = pool.create_floating_ip() - def test_ex_delete_network(self): - network = self.driver.ex_list_networks()[0] - self.assertTrue(self.driver.ex_delete_network(network=network)) + self.assertEqual(ret.id, "09ea1784-2f81-46dc-8c91-244b4df75bde") + self.assertEqual(ret.pool, pool) + self.assertEqual(ret.ip_address, "10.3.1.42") + self.assertEqual(ret.node_id, None) + + def test_OpenStack_2_FloatingIpPool_delete_floating_ip(self): + pool = OpenStack_2_FloatingIpPool(1, "foo", self.driver.connection) + ip = OpenStack_1_1_FloatingIpAddress("foo-bar-id", "42.42.42.42", pool) + + self.assertTrue(pool.delete_floating_ip(ip)) + + def test_OpenStack_2_FloatingIpAddress_delete(self): + pool = OpenStack_2_FloatingIpPool(1, "foo", self.driver.connection) + pool.delete_floating_ip = Mock() + ip = OpenStack_1_1_FloatingIpAddress("foo-bar-id", "42.42.42.42", pool) + + ip.pool.delete_floating_ip() + + self.assertEqual(pool.delete_floating_ip.call_count, 1) def test_ex_get_metadata_for_node(self): - image = NodeImage(id=11, name='Ubuntu 8.10 (intrepid)', driver=self.driver) - size = NodeSize(1, '256 slice', None, None, None, None, driver=self.driver) - node = self.driver.create_node(name='foo', - image=image, - size=size) + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + node = self.driver.create_node(name="foo", image=image, size=size) metadata = self.driver.ex_get_metadata_for_node(node) - self.assertEqual(metadata['My Server Name'], 'Apache1') + self.assertEqual(metadata["My Server Name"], "Apache1") self.assertEqual(len(metadata), 1) def test_ex_pause_node(self): node = Node( - id='12063', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver, + id="12063", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, ) ret = self.driver.ex_pause_node(node) self.assertTrue(ret is True) def test_ex_unpause_node(self): node = Node( - id='12063', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver, + id="12063", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, ) ret = self.driver.ex_unpause_node(node) self.assertTrue(ret is True) + def test_ex_stop_node(self): + node = Node( + id="12063", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_stop_node(node) + self.assertTrue(ret is True) + + def test_ex_start_node(self): + node = Node( + id="12063", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ret = self.driver.ex_start_node(node) + self.assertTrue(ret is True) + def test_ex_suspend_node(self): node = Node( - id='12063', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver, + id="12063", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, ) ret = self.driver.ex_suspend_node(node) self.assertTrue(ret is True) def test_ex_resume_node(self): node = Node( - id='12063', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver, + id="12063", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, ) ret = self.driver.ex_resume_node(node) self.assertTrue(ret is True) def test_ex_get_console_output(self): node = Node( - id='12086', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver, + id="12086", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, ) resp = self.driver.ex_get_console_output(node) - expected_output = 'FAKE CONSOLE OUTPUT\nANOTHER\nLAST LINE' - self.assertEqual(resp['output'], expected_output) + expected_output = "FAKE CONSOLE OUTPUT\nANOTHER\nLAST LINE" + self.assertEqual(resp["output"], expected_output) def test_ex_list_snapshots(self): - if self.driver_type.type == 'rackspace': - self.conn_classes[0].type = 'RACKSPACE' - self.conn_classes[1].type = 'RACKSPACE' + if self.driver_type.type == "rackspace": + self.conn_class.type = "RACKSPACE" snapshots = self.driver.ex_list_snapshots() self.assertEqual(len(snapshots), 3) self.assertEqual(snapshots[0].created, datetime.datetime(2012, 2, 29, 3, 50, 7, tzinfo=UTC)) - self.assertEqual(snapshots[0].extra['created'], "2012-02-29T03:50:07Z") - self.assertEqual(snapshots[0].extra['name'], 'snap-001') + self.assertEqual(snapshots[0].extra["created"], "2012-02-29T03:50:07Z") + self.assertEqual(snapshots[0].extra["name"], "snap-001") + self.assertEqual(snapshots[0].name, "snap-001") + self.assertEqual(snapshots[0].state, VolumeSnapshotState.AVAILABLE) # invalid date is parsed as None assert snapshots[2].created is None + def test_ex_get_snapshot(self): + if self.driver_type.type == "rackspace": + self.conn_class.type = "RACKSPACE" + + snapshot = self.driver.ex_get_snapshot("3fbbcccf-d058-4502-8844-6feeffdf4cb5") + self.assertEqual(snapshot.created, datetime.datetime(2012, 2, 29, 3, 50, 7, tzinfo=UTC)) + self.assertEqual(snapshot.extra["created"], "2012-02-29T03:50:07Z") + self.assertEqual(snapshot.extra["name"], "snap-001") + self.assertEqual(snapshot.name, "snap-001") + self.assertEqual(snapshot.state, VolumeSnapshotState.AVAILABLE) + def test_list_volume_snapshots(self): volume = self.driver.list_volumes()[0] # rackspace needs a different mocked response for snapshots, but not for volumes - if self.driver_type.type == 'rackspace': - self.conn_classes[0].type = 'RACKSPACE' - self.conn_classes[1].type = 'RACKSPACE' + + if self.driver_type.type == "rackspace": + self.conn_class.type = "RACKSPACE" snapshots = self.driver.list_volume_snapshots(volume) self.assertEqual(len(snapshots), 1) - self.assertEqual(snapshots[0].id, '4fbbdccf-e058-6502-8844-6feeffdf4cb5') + self.assertEqual(snapshots[0].id, "4fbbdccf-e058-6502-8844-6feeffdf4cb5") def test_create_volume_snapshot(self): volume = self.driver.list_volumes()[0] - if self.driver_type.type == 'rackspace': - self.conn_classes[0].type = 'RACKSPACE' - self.conn_classes[1].type = 'RACKSPACE' - ret = self.driver.create_volume_snapshot(volume, - 'Test Volume', - ex_description='This is a test', - ex_force=True) - self.assertEqual(ret.id, '3fbbcccf-d058-4502-8844-6feeffdf4cb5') + if self.driver_type.type == "rackspace": + self.conn_class.type = "RACKSPACE" + + ret = self.driver.create_volume_snapshot( + volume, "Test Volume", ex_description="This is a test", ex_force=True + ) + self.assertEqual(ret.id, "3fbbcccf-d058-4502-8844-6feeffdf4cb5") def test_ex_create_snapshot(self): volume = self.driver.list_volumes()[0] - if self.driver_type.type == 'rackspace': - self.conn_classes[0].type = 'RACKSPACE' - self.conn_classes[1].type = 'RACKSPACE' - ret = self.driver.ex_create_snapshot(volume, - 'Test Volume', - description='This is a test', - force=True) - self.assertEqual(ret.id, '3fbbcccf-d058-4502-8844-6feeffdf4cb5') + if self.driver_type.type == "rackspace": + self.conn_class.type = "RACKSPACE" + + ret = self.driver.ex_create_snapshot( + volume, "Test Volume", description="This is a test", force=True + ) + self.assertEqual(ret.id, "3fbbcccf-d058-4502-8844-6feeffdf4cb5") + + def test_ex_create_snapshot_does_not_post_optional_parameters_if_none(self): + volume = self.driver.list_volumes()[0] + with patch.object(self.driver, "_to_snapshot"): + with patch.object(self.driver.connection, "request") as mock_request: + self.driver.create_volume_snapshot( + volume, name=None, ex_description=None, ex_force=True + ) + + name, args, kwargs = mock_request.mock_calls[0] + self.assertFalse("display_name" in kwargs["data"]["snapshot"]) + self.assertFalse("display_description" in kwargs["data"]["snapshot"]) def test_destroy_volume_snapshot(self): - if self.driver_type.type == 'rackspace': - self.conn_classes[0].type = 'RACKSPACE' - self.conn_classes[1].type = 'RACKSPACE' + if self.driver_type.type == "rackspace": + self.conn_class.type = "RACKSPACE" snapshot = self.driver.ex_list_snapshots()[0] ret = self.driver.destroy_volume_snapshot(snapshot) self.assertTrue(ret) def test_ex_delete_snapshot(self): - if self.driver_type.type == 'rackspace': - self.conn_classes[0].type = 'RACKSPACE' - self.conn_classes[1].type = 'RACKSPACE' + if self.driver_type.type == "rackspace": + self.conn_class.type = "RACKSPACE" snapshot = self.driver.ex_list_snapshots()[0] ret = self.driver.ex_delete_snapshot(snapshot) self.assertTrue(ret) -class OpenStack_1_1_FactoryMethodTests(OpenStack_1_1_Tests): - should_list_locations = False - should_list_volumes = True +class OpenStack_2_Tests(OpenStack_1_1_Tests): + driver_klass = OpenStack_2_NodeDriver + driver_type = OpenStack_2_NodeDriver + driver_kwargs = { + "ex_force_auth_version": "2.0", + "ex_force_auth_url": "https://auth.api.example.com", + } + + def setUp(self): + super().setUp() + self.driver_klass.image_connectionCls.conn_class = OpenStack_2_0_MockHttp + self.driver_klass.image_connectionCls.auth_url = "https://auth.api.example.com" + # normally authentication happens lazily, but we force it here + self.driver.image_connection._populate_hosts_and_request_paths() + + self.driver_klass.network_connectionCls.conn_class = OpenStack_2_0_MockHttp + self.driver_klass.network_connectionCls.auth_url = "https://auth.api.example.com" + # normally authentication happens lazily, but we force it here + self.driver.network_connection._populate_hosts_and_request_paths() + + self.driver_klass.volumev2_connectionCls.conn_class = OpenStack_2_0_MockHttp + self.driver_klass.volumev2_connectionCls.auth_url = "https://auth.api.example.com" + # normally authentication happens lazily, but we force it here + self.driver.volumev2_connection._populate_hosts_and_request_paths() + + self.driver_klass.volumev3_connectionCls.conn_class = OpenStack_2_0_MockHttp + self.driver_klass.volumev3_connectionCls.auth_url = "https://auth.api.example.com" + # normally authentication happens lazily, but we force it here + self.driver.volumev3_connection._populate_hosts_and_request_paths() + + self.driver_klass.reservation_connectionCls.conn_class = OpenStack_2_0_MockHttp + self.driver_klass.reservation_connectionCls.auth_url = "https://auth.api.example.com" + # normally authentication happens lazily, but we force it here + self.driver.reservation_connection._populate_hosts_and_request_paths() + + def test__paginated_request_single_page(self): + snapshots = self.driver._paginated_request( + "/snapshots/detail", "snapshots", self.driver._get_volume_connection() + )["snapshots"] + + self.assertEqual(len(snapshots), 3) + self.assertEqual(snapshots[0]["name"], "snap-001") + + def test__paginated_request_two_pages(self): + snapshots = self.driver._paginated_request( + "/snapshots/detail?unit_test=paginate", + "snapshots", + self.driver._get_volume_connection(), + )["snapshots"] + + self.assertEqual(len(snapshots), 6) + self.assertEqual(snapshots[0]["name"], "snap-101") + self.assertEqual(snapshots[3]["name"], "snap-001") + + def test_list_images_with_pagination_invalid_response_no_infinite_loop(self): + # "next" attribute matches the current page, but it shouldn't result in + # an infinite loop + OpenStack_2_0_MockHttp.type = "invalid_next" + ret = self.driver.list_images() + self.assertEqual(len(ret), 2) + + # NOTE: We use a smaller limit to speed tests up. + @mock.patch("libcloud.compute.drivers.openstack.PAGINATION_LIMIT", 10) + def test__paginated_request_raises_if_stuck_in_a_loop(self): + with pytest.raises(OpenStackException): + self.driver._paginated_request( + "/snapshots/detail?unit_test=pagination_loop", + "snapshots", + self.driver._get_volume_connection(), + ) + + def test_ex_force_auth_token_passed_to_connection(self): + base_url = "https://servers.api.rackspacecloud.com/v1.1/slug" + kwargs = { + "ex_force_auth_version": "2.0", + "ex_force_auth_token": "preset-auth-token", + "ex_force_auth_url": "https://auth.api.example.com", + "ex_force_base_url": base_url, + } + + driver = self.driver_type(*self.driver_args, **kwargs) + driver.list_nodes() + + self.assertEqual(kwargs["ex_force_auth_token"], driver.connection.auth_token) + self.assertEqual("servers.api.rackspacecloud.com", driver.connection.host) + self.assertEqual("/v1.1/slug", driver.connection.request_path) + self.assertEqual(443, driver.connection.port) + + def test_get_image(self): + image_id = "f24a3c1b-d52a-4116-91da-25b3eee8f55e" + image = self.driver.get_image(image_id) + self.assertEqual(image.id, image_id) + self.assertEqual(image.name, "hypernode") + self.assertIsNone(image.extra["serverId"]) + self.assertEqual(image.extra["minDisk"], 40) + self.assertEqual(image.extra["minRam"], 0) + self.assertEqual(image.extra["visibility"], "shared") + + def test_list_images(self): + images = self.driver.list_images() + self.assertEqual(len(images), 3, "Wrong images count") + + image = images[0] + self.assertEqual(image.id, "f24a3c1b-d52a-4116-91da-25b3eee8f55e") + self.assertEqual(image.name, "hypernode") + self.assertEqual(image.extra["updated"], "2017-11-28T10:19:49Z") + self.assertEqual(image.extra["created"], "2017-09-11T13:00:05Z") + self.assertEqual(image.extra["status"], "active") + self.assertEqual(image.extra["os_type"], "linux") + self.assertEqual(image.extra["os_version"], "16.04") + self.assertEqual(image.extra["os_distro"], "ubuntu") + self.assertIsNone(image.extra["serverId"]) + self.assertEqual(image.extra["minDisk"], 40) + self.assertEqual(image.extra["minRam"], 0) + + def test_ex_update_image(self): + image_id = "f24a3c1b-d52a-4116-91da-25b3eee8f55e" + data = {"op": "replace", "path": "/visibility", "value": "shared"} + image = self.driver.ex_update_image(image_id, data) + self.assertEqual(image.name, "hypernode") + self.assertIsNone(image.extra["serverId"]) + self.assertEqual(image.extra["minDisk"], 40) + self.assertEqual(image.extra["minRam"], 0) + self.assertEqual(image.extra["visibility"], "shared") + + def test_ex_list_image_members(self): + image_id = "d9a9cd9a-278a-444c-90a6-d24b8c688a63" + image_member_id = "016926dff12345e8b10329f24c99745b" + image_members = self.driver.ex_list_image_members(image_id) + self.assertEqual(len(image_members), 30, "Wrong image member count") + + image_member = image_members[0] + self.assertEqual(image_member.id, image_member_id) + self.assertEqual(image_member.image_id, image_id) + self.assertEqual(image_member.state, NodeImageMemberState.ACCEPTED) + self.assertEqual(image_member.created, "2017-01-12T12:31:50Z") + self.assertEqual(image_member.extra["updated"], "2017-01-12T12:31:54Z") + self.assertEqual(image_member.extra["schema"], "/v2/schemas/member") + + def test_ex_create_image_member(self): + image_id = "9af1a54e-a1b2-4df8-b747-4bec97abc799" + image_member_id = "e2151b1fe02d4a8a2d1f5fc331522c0a" + image_member = self.driver.ex_create_image_member(image_id, image_member_id) + + self.assertEqual(image_member.id, image_member_id) + self.assertEqual(image_member.image_id, image_id) + self.assertEqual(image_member.state, NodeImageMemberState.PENDING) + self.assertEqual(image_member.created, "2018-03-02T14:19:38Z") + self.assertEqual(image_member.extra["updated"], "2018-03-02T14:19:38Z") + self.assertEqual(image_member.extra["schema"], "/v2/schemas/member") + + def test_ex_get_image_member(self): + image_id = "d9a9cd9a-278a-444c-90a6-d24b8c688a63" + image_member_id = "016926dff12345e8b10329f24c99745b" + image_member = self.driver.ex_get_image_member(image_id, image_member_id) + + self.assertEqual(image_member.id, image_member_id) + self.assertEqual(image_member.image_id, image_id) + self.assertEqual(image_member.state, NodeImageMemberState.ACCEPTED) + self.assertEqual(image_member.created, "2017-01-12T12:31:50Z") + self.assertEqual(image_member.extra["updated"], "2017-01-12T12:31:54Z") + self.assertEqual(image_member.extra["schema"], "/v2/schemas/member") + + def test_ex_accept_image_member(self): + image_id = "8af1a54e-a1b2-4df8-b747-4bec97abc799" + image_member_id = "e2151b1fe02d4a8a2d1f5fc331522c0a" + image_member = self.driver.ex_accept_image_member(image_id, image_member_id) + + self.assertEqual(image_member.id, image_member_id) + self.assertEqual(image_member.image_id, image_id) + self.assertEqual(image_member.state, NodeImageMemberState.ACCEPTED) + self.assertEqual(image_member.created, "2018-03-02T14:19:38Z") + self.assertEqual(image_member.extra["updated"], "2018-03-02T14:20:37Z") + self.assertEqual(image_member.extra["schema"], "/v2/schemas/member") + + def test_ex_list_networks(self): + networks = self.driver.ex_list_networks() + network = networks[0] + + self.assertEqual(len(networks), 2) + self.assertEqual(network.name, "net1") + self.assertEqual(network.extra["subnets"], ["54d6f61d-db07-451c-9ab3-b9609b6b6f0b"]) + + def test_ex_get_network(self): + network = self.driver.ex_get_network("cc2dad14-827a-feea-416b-f13e50511a0a") + + self.assertEqual(network.id, "cc2dad14-827a-feea-416b-f13e50511a0a") + self.assertTrue(isinstance(network, OpenStackNetwork)) + self.assertEqual(network.name, "net2") + self.assertEqual(network.extra["is_default"], False) + self.assertEqual(network.extra["tags"], ["tag1,tag2"]) + + network = self.driver.ex_get_network("e4e207ac-6707-432b-82b9-244f6859c394") + + self.assertEqual(network.id, "e4e207ac-6707-432b-82b9-244f6859c394") + self.assertTrue(isinstance(network, OpenStackNetwork)) + self.assertEqual(network.name, "net2") + self.assertNotIn("tags", network.extra) + + def test_ex_list_subnets(self): + subnets = self.driver.ex_list_subnets() + subnet = subnets[0] + + self.assertEqual(len(subnets), 2) + self.assertEqual(subnet.name, "private-subnet") + self.assertEqual(subnet.cidr, "10.0.0.0/24") + + def test_ex_create_subnet(self): + network = self.driver.ex_list_networks()[0] + subnet = self.driver.ex_create_subnet( + "name", network, "10.0.0.0/24", ip_version=4, dns_nameservers=["10.0.0.01"] + ) + + self.assertEqual(subnet.name, "name") + self.assertEqual(subnet.cidr, "10.0.0.0/24") + + def test_ex_delete_subnet(self): + subnet = self.driver.ex_list_subnets()[0] + self.assertTrue(self.driver.ex_delete_subnet(subnet=subnet)) + + def test_ex_update_subnet(self): + subnet = self.driver.ex_list_subnets()[0] + subnet = self.driver.ex_update_subnet(subnet, name="net2") + self.assertEqual(subnet.name, "name") + + def test_ex_list_network(self): + networks = self.driver.ex_list_networks() + network = networks[0] + + self.assertEqual(len(networks), 2) + self.assertEqual(network.name, "net1") + + def test_ex_create_network(self): + network = self.driver.ex_create_network(name="net1", cidr="127.0.0.0/24") + self.assertEqual(network.name, "net1") + + def test_ex_delete_network(self): + network = self.driver.ex_list_networks()[0] + self.assertTrue(self.driver.ex_delete_network(network=network)) + + def test_ex_list_ports(self): + ports = self.driver.ex_list_ports() + + port = ports[0] + self.assertEqual(port.id, "126da55e-cfcb-41c8-ae39-a26cb8a7e723") + self.assertEqual(port.state, OpenStack_2_PortInterfaceState.BUILD) + self.assertEqual(port.created, "2018-07-04T14:38:18Z") + self.assertEqual(port.extra["network_id"], "123c8a8c-6427-4e8f-a805-2035365f4d43") + self.assertEqual(port.extra["project_id"], "abcdec85bee34bb0a44ab8255eb36abc") + self.assertEqual(port.extra["tenant_id"], "abcdec85bee34bb0a44ab8255eb36abc") + self.assertEqual(port.extra["name"], "") + + def test_ex_create_port(self): + network = OpenStackNetwork( + id="123c8a8c-6427-4e8f-a805-2035365f4d43", + name="test-network", + cidr="1.2.3.4", + driver=self.driver, + ) + port = self.driver.ex_create_port( + network=network, + description="Some port description", + name="Some port name", + admin_state_up=True, + ) + + self.assertEqual(port.id, "126da55e-cfcb-41c8-ae39-a26cb8a7e723") + self.assertEqual(port.state, OpenStack_2_PortInterfaceState.BUILD) + self.assertEqual(port.created, "2018-07-04T14:38:18Z") + self.assertEqual(port.extra["network_id"], "123c8a8c-6427-4e8f-a805-2035365f4d43") + self.assertEqual(port.extra["project_id"], "abcdec85bee34bb0a44ab8255eb36abc") + self.assertEqual(port.extra["tenant_id"], "abcdec85bee34bb0a44ab8255eb36abc") + self.assertEqual(port.extra["admin_state_up"], True) + self.assertEqual(port.extra["name"], "Some port name") + self.assertEqual(port.extra["description"], "Some port description") + + def test_ex_get_port(self): + port = self.driver.ex_get_port("126da55e-cfcb-41c8-ae39-a26cb8a7e723") + + self.assertEqual(port.id, "126da55e-cfcb-41c8-ae39-a26cb8a7e723") + self.assertEqual(port.state, OpenStack_2_PortInterfaceState.BUILD) + self.assertEqual(port.created, "2018-07-04T14:38:18Z") + self.assertEqual(port.extra["network_id"], "123c8a8c-6427-4e8f-a805-2035365f4d43") + self.assertEqual(port.extra["project_id"], "abcdec85bee34bb0a44ab8255eb36abc") + self.assertEqual(port.extra["tenant_id"], "abcdec85bee34bb0a44ab8255eb36abc") + self.assertEqual(port.extra["name"], "Some port name") + + def test_ex_delete_port(self): + ports = self.driver.ex_list_ports() + port = ports[0] + + ret = self.driver.ex_delete_port(port) + + self.assertTrue(ret) + + def test_ex_update_port(self): + port = self.driver.ex_get_port("126da55e-cfcb-41c8-ae39-a26cb8a7e723") + ret = self.driver.ex_update_port(port, port_security_enabled=False) + self.assertEqual(ret.extra["name"], "Some port name") + + def test_ex_update_port_allowed_address_pairs(self): + allowed_address_pairs = [{"ip_address": "1.2.3.4"}, {"ip_address": "2.3.4.5"}] + port = self.driver.ex_get_port("126da55e-cfcb-41c8-ae39-a26cb8a7e723") + ret = self.driver.ex_update_port(port, allowed_address_pairs=allowed_address_pairs) + self.assertEqual(ret.extra["allowed_address_pairs"], allowed_address_pairs) + + def test_detach_port_interface(self): + node = Node( + id="1c01300f-ef97-4937-8f03-ac676d6234be", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ports = self.driver.ex_list_ports() + port = ports[0] + + ret = self.driver.ex_detach_port_interface(node, port) + + self.assertTrue(ret) + + def test_attach_port_interface(self): + node = Node( + id="1c01300f-ef97-4937-8f03-ac676d6234be", + name=None, + state=None, + public_ips=None, + private_ips=None, + driver=self.driver, + ) + ports = self.driver.ex_list_ports() + port = ports[0] + + ret = self.driver.ex_attach_port_interface(node, port) + + self.assertTrue(ret) + + def test_list_volumes(self): + volumes = self.driver.list_volumes() + self.assertEqual(len(volumes), 2) + volume = volumes[0] + + self.assertEqual("6edbc2f4-1507-44f8-ac0d-eed1d2608d38", volume.id) + self.assertEqual("test-volume-attachments", volume.name) + self.assertEqual(StorageVolumeState.INUSE, volume.state) + self.assertEqual(2, volume.size) + self.assertEqual( + volume.extra, + { + "description": "", + "attachments": [ + { + "attachment_id": "3b4db356-253d-4fab-bfa0-e3626c0b8405", + "id": "6edbc2f4-1507-44f8-ac0d-eed1d2608d38", + "device": "/dev/vdb", + "server_id": "f4fda93b-06e0-4743-8117-bc8bcecd651b", + "volume_id": "6edbc2f4-1507-44f8-ac0d-eed1d2608d38", + } + ], + "snapshot_id": None, + "state": "in-use", + "location": "nova", + "volume_type": "lvmdriver-1", + "metadata": {}, + "created_at": "2013-06-24T11:20:13.000000", + }, + ) + + # also test that unknown state resolves to StorageVolumeState.UNKNOWN + volume = volumes[1] + self.assertEqual("cfcec3bc-b736-4db5-9535-4c24112691b5", volume.id) + self.assertEqual("test_volume", volume.name) + self.assertEqual(50, volume.size) + self.assertEqual(StorageVolumeState.UNKNOWN, volume.state) + self.assertEqual( + volume.extra, + { + "description": "some description", + "attachments": [], + "snapshot_id": "01f48111-7866-4cd2-986a-e92683c4a363", + "state": "some-unknown-state", + "location": "nova", + "volume_type": None, + "metadata": {}, + "created_at": "2013-06-21T12:39:02.000000", + }, + ) + + def test_create_volume_passes_location_to_request_only_if_not_none(self): + with patch.object(self.driver._get_volume_connection(), "request") as mock_request: + self.driver.create_volume(1, "test", location="mylocation") + name, args, kwargs = mock_request.mock_calls[0] + self.assertEqual(kwargs["data"]["volume"]["availability_zone"], "mylocation") + + def test_create_volume_does_not_pass_location_to_request_if_none(self): + with patch.object(self.driver._get_volume_connection(), "request") as mock_request: + self.driver.create_volume(1, "test") + name, args, kwargs = mock_request.mock_calls[0] + self.assertFalse("availability_zone" in kwargs["data"]["volume"]) + + def test_create_volume_passes_volume_type_to_request_only_if_not_none(self): + with patch.object(self.driver._get_volume_connection(), "request") as mock_request: + self.driver.create_volume(1, "test", ex_volume_type="myvolumetype") + name, args, kwargs = mock_request.mock_calls[0] + self.assertEqual(kwargs["data"]["volume"]["volume_type"], "myvolumetype") + + def test_create_volume_does_not_pass_volume_type_to_request_if_none(self): + with patch.object(self.driver._get_volume_connection(), "request") as mock_request: + self.driver.create_volume(1, "test") + name, args, kwargs = mock_request.mock_calls[0] + self.assertFalse("volume_type" in kwargs["data"]["volume"]) + + def test_create_volume_passes_image_ref_to_request_only_if_not_none(self): + with patch.object(self.driver._get_volume_connection(), "request") as mock_request: + self.driver.create_volume( + 1, "test", ex_image_ref="353c4bd2-b28f-4857-9b7b-808db4397d03" + ) + name, args, kwargs = mock_request.mock_calls[0] + self.assertEqual( + kwargs["data"]["volume"]["imageRef"], + "353c4bd2-b28f-4857-9b7b-808db4397d03", + ) + + def test_create_volume_does_not_pass_image_ref_to_request_if_none(self): + with patch.object(self.driver._get_volume_connection(), "request") as mock_request: + self.driver.create_volume(1, "test") + name, args, kwargs = mock_request.mock_calls[0] + self.assertFalse("imageRef" in kwargs["data"]["volume"]) + + def test_ex_create_snapshot_does_not_post_optional_parameters_if_none(self): + volume = self.driver.list_volumes()[0] + with patch.object(self.driver, "_to_snapshot"): + with patch.object(self.driver._get_volume_connection(), "request") as mock_request: + self.driver.create_volume_snapshot( + volume, name=None, ex_description=None, ex_force=True + ) + + name, args, kwargs = mock_request.mock_calls[0] + self.assertFalse("display_name" in kwargs["data"]["snapshot"]) + self.assertFalse("display_description" in kwargs["data"]["snapshot"]) + + def test_ex_list_routers(self): + routers = self.driver.ex_list_routers() + router = routers[0] + + self.assertEqual(len(routers), 2) + self.assertEqual(router.name, "router2") + self.assertEqual(router.status, "ACTIVE") + self.assertEqual( + router.extra["routes"], + [{"destination": "179.24.1.0/24", "nexthop": "172.24.3.99"}], + ) + + def test_ex_create_router(self): + router = self.driver.ex_create_router("router1", admin_state_up=True) + + self.assertEqual(router.name, "router1") + + def test_ex_delete_router(self): + router = self.driver.ex_list_routers()[1] + self.assertTrue(self.driver.ex_delete_router(router=router)) + + def test_manage_router_interfaces(self): + router = self.driver.ex_list_routers()[1] + port = self.driver.ex_list_ports()[0] + subnet = self.driver.ex_list_subnets()[0] + self.assertTrue(self.driver.ex_add_router_port(router, port)) + self.assertTrue(self.driver.ex_del_router_port(router, port)) + self.assertTrue(self.driver.ex_add_router_subnet(router, subnet)) + self.assertTrue(self.driver.ex_del_router_subnet(router, subnet)) + + def test_detach_volume(self): + node = self.driver.list_nodes()[0] + volume = self.driver.ex_get_volume("abc6a3a1-c4ce-40f6-9b9f-07a61508938d") + self.assertEqual(self.driver.attach_volume(node, volume, "/dev/sdb"), True) + self.assertEqual(self.driver.detach_volume(volume), True) + + def test_ex_remove_security_group_from_node(self): + security_group = OpenStackSecurityGroup("sgid", None, "sgname", "", self.driver) + node = Node("1000", "node", None, [], [], self.driver) + ret = self.driver.ex_remove_security_group_from_node(security_group, node) + self.assertTrue(ret) + + def test_force_net_url(self): + d = OpenStack_2_NodeDriver( + "user", + "correct_password", + ex_force_auth_version="2.0_password", + ex_force_auth_url="http://x.y.z.y:5000", + ex_force_network_url="http://network.com:9696", + ex_tenant_name="admin", + ) + self.assertEqual(d._ex_force_base_url, None) + + def test_ex_get_quota_set(self): + quota_set = self.driver.ex_get_quota_set("tenant_id") + self.assertEqual(quota_set.cores.limit, 20) + self.assertEqual(quota_set.cores.in_use, 1) + self.assertEqual(quota_set.cores.reserved, 0) + + def test_ex_get_network_quota(self): + quota_set = self.driver.ex_get_network_quotas("tenant_id") + self.assertEqual(quota_set.floatingip.limit, 2) + self.assertEqual(quota_set.floatingip.in_use, 1) + self.assertEqual(quota_set.floatingip.reserved, 0) + + def test_ex_get_volume_quota(self): + quota_set = self.driver.ex_get_volume_quotas("tenant_id") + self.assertEqual(quota_set.gigabytes.limit, 1000) + self.assertEqual(quota_set.gigabytes.in_use, 10) + self.assertEqual(quota_set.gigabytes.reserved, 0) + + def test_ex_list_server_groups(self): + server_groups = self.driver.ex_list_server_groups() + self.assertEqual(len(server_groups), 2) + self.assertEqual(server_groups[1].name, "server_group_name") + + def test_ex_get_server_group(self): + server_group = self.driver.ex_get_server_group("616fb98f-46ca-475e-917e-2563e5a8cd19") + self.assertEqual(server_group.name, "server_group_name") + self.assertEqual(server_group.policy, "anti-affinity") + + def test_ex_del_server_group(self): + server_group = OpenStack_2_ServerGroup( + "616fb98f-46ca-475e-917e-2563e5a8cd19", "name", "anti-affinity" + ) + res = self.driver.ex_del_server_group(server_group) + self.assertTrue(res) + + def test_ex_add_server_group(self): + server_group = self.driver.ex_add_server_group("server_group_name", "anti-affinity") + self.assertEqual(server_group.name, "server_group_name") + self.assertEqual(server_group.policy, "anti-affinity") + + def test_ex_list_floating_ips(self): + ret = self.driver.ex_list_floating_ips() + + self.assertEqual(ret[0].id, "09ea1784-2f81-46dc-8c91-244b4df75bde") + self.assertEqual(ret[0].get_pool(), None) + self.assertEqual(ret[0].ip_address, "10.3.1.42") + self.assertEqual(ret[0].get_node_id(), None) + self.assertEqual(ret[1].id, "04c5336a-0629-4694-ba30-04b0bdfa88a4") + self.assertEqual(ret[1].get_pool(), None) + self.assertEqual(ret[1].ip_address, "10.3.1.1") + self.assertEqual(ret[1].get_node_id(), "fcfc96da-19e2-40fd-8497-f29da1b21143") + self.assertEqual(ret[2].id, "123c5336a-0629-4694-ba30-04b0bdfa88a4") + self.assertEqual(ret[2].get_pool(), None) + self.assertEqual(ret[2].ip_address, "10.3.1.2") + self.assertEqual(ret[2].get_node_id(), "cb4fba64-19e2-40fd-8497-f29da1b21143") + self.assertEqual(ret[3].id, "123c5336a-0629-4694-ba30-04b0bdfa88a4") + self.assertEqual(ret[3].get_pool(), None) + self.assertEqual(ret[3].ip_address, "10.3.1.3") + self.assertEqual(ret[3].get_node_id(), "cb4fba64-19e2-40fd-8497-f29da1b21143") + self.assertEqual(ret[4].id, "123c5336a-0629-4694-ba30-04b0bdfa88a4") + self.assertEqual(ret[4].get_pool(), None) + self.assertEqual(ret[4].ip_address, "10.3.1.5") + self.assertEqual(ret[4].get_node_id(), "cb4fba64-19e2-40fd-8497-f29da1b21143") + + def test_ex_get_floating_ip(self): + float_ip = self.driver.ex_get_floating_ip("10.0.0.1") + + self.assertEqual(float_ip.ip_address, "10.3.1.21") + self.assertEqual(float_ip.id, "04c5336a-0629-4694-ba30-04b0bdfa88a4") + + def test_ex_create_floating_ip(self): + ret = self.driver.ex_create_floating_ip("public") + + self.assertEqual(ret.id, "09ea1784-2f81-46dc-8c91-244b4df75bde") + self.assertEqual(ret.pool.name, "public") + self.assertEqual(ret.ip_address, "10.3.1.42") + self.assertEqual(ret.node_id, None) + + def test_ex_delete_floating_ip(self): + ip = OpenStack_1_1_FloatingIpAddress("foo-bar-id", "42.42.42.42", None) + self.assertTrue(self.driver.ex_delete_floating_ip(ip)) + + def test_ex_list_leases(self): + leases = self.driver.ex_list_leases() + self.assertEqual(len(leases), 1) + self.assertEqual(leases[0].id, "6ee55c78-ac52-41a6-99af-2d2d73bcc466") + self.assertEqual(leases[0].name, "lease_foo") + self.assertEqual(leases[0].start, "2017-12-26T12:00:00.000000") + self.assertEqual(leases[0].end, "2017-12-27T12:00:00.000000") + self.assertEqual(leases[0].status, "PENDING") + + def test_ex_list_hosts(self): + hosts = self.driver.ex_list_hosts() + self.assertEqual(len(hosts), 1) + self.assertEqual(hosts[0].id, "1") + self.assertEqual(hosts[0].hypervisor_hostname, "compute-1") + self.assertEqual(hosts[0].vcpus, 4) + + def test_ex_attach_floating_ip_to_node(self): + image = NodeImage(id=11, name="Ubuntu 8.10 (intrepid)", driver=self.driver) + size = NodeSize(1, "256 slice", None, None, None, None, driver=self.driver) + node = self.driver.create_node(name="racktest", image=image, size=size) + node.id = 4242 + ip = "42.42.42.42" + port_id = "ce531f90-199f-48c0-816c-13e38010b442" + + self.assertTrue(self.driver.ex_attach_floating_ip_to_node(node, ip, port_id)) + + +class OpenStack_1_1_FactoryMethodTests(OpenStack_1_1_Tests): + should_list_locations = False + should_list_volumes = True driver_klass = OpenStack_1_1_NodeDriver driver_type = get_driver(Provider.OPENSTACK) - driver_args = OPENSTACK_PARAMS + ('1.1',) - driver_kwargs = {'ex_force_auth_version': '2.0'} + driver_args = OPENSTACK_PARAMS + ("1.1",) + driver_kwargs = {"ex_force_auth_version": "2.0"} -class OpenStack_1_1_MockHttp(MockHttpTestCase): - fixtures = ComputeFileFixtures('openstack_v1.1') +class OpenStack_1_1_MockHttp(MockHttp, unittest.TestCase): + fixtures = ComputeFileFixtures("openstack_v1_1") auth_fixtures = OpenStackFixtures() - json_content_headers = {'content-type': 'application/json; charset=UTF-8'} + json_content_headers = {"content-type": "application/json; charset=UTF-8"} def _v2_0_tokens(self, method, url, body, headers): - body = self.auth_fixtures.load('_v2_0__auth.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.auth_fixtures.load("_v2_0__auth.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_0(self, method, url, body, headers): headers = { - 'x-auth-token': 'FE011C19-CF86-4F87-BE5D-9229145D7A06', - 'x-server-management-url': 'https://api.example.com/v1.1/slug', + "x-auth-token": "FE011C19-CF86-4F87-BE5D-9229145D7A06", + "x-server-management-url": "https://api.example.com/v1.1/slug", } + return (httplib.NO_CONTENT, "", headers, httplib.responses[httplib.NO_CONTENT]) def _v1_1_slug_servers_detail(self, method, url, body, headers): - body = self.fixtures.load('_servers_detail.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_servers_detail.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_servers_detail_ERROR_STATE_NO_IMAGE_ID(self, method, url, body, headers): - body = self.fixtures.load('_servers_detail_ERROR_STATE.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_servers_detail_ERROR_STATE.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_servers_detail_UNAUTHORIZED(self, method, url, body, headers): + return (httplib.UNAUTHORIZED, "", {}, httplib.responses[httplib.UNAUTHORIZED]) + + def _v2_1337_servers_does_not_exist(self, *args, **kwargs): + return httplib.NOT_FOUND, None, {}, httplib.responses[httplib.NOT_FOUND] def _v1_1_slug_flavors_detail(self, method, url, body, headers): - body = self.fixtures.load('_flavors_detail.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_flavors_detail.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_images_detail(self, method, url, body, headers): - body = self.fixtures.load('_images_detail.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_images_detail.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_servers(self, method, url, body, headers): if method == "POST": - body = self.fixtures.load('_servers_create.json') + body = self.fixtures.load("_servers_create.json") elif method == "GET": - body = self.fixtures.load('_servers.json') + body = self.fixtures.load("_servers.json") else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_servers_26f7fbee_8ce1_4c28_887a_bfe8e4bb10fe(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load( - '_servers_26f7fbee_8ce1_4c28_887a_bfe8e4bb10fe.json') + body = self.fixtures.load("_servers_26f7fbee_8ce1_4c28_887a_bfe8e4bb10fe.json") else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_servers_12065_action(self, method, url, body, headers): if method != "POST": - self.fail('HTTP method other than POST to action URL') + self.fail("HTTP method other than POST to action URL") return (httplib.ACCEPTED, "", {}, httplib.responses[httplib.ACCEPTED]) def _v1_1_slug_servers_12064_action(self, method, url, body, headers): if method != "POST": - self.fail('HTTP method other than POST to action URL') + self.fail("HTTP method other than POST to action URL") + if "createImage" in json.loads(body): - return (httplib.ACCEPTED, "", - {"location": "http://127.0.0.1/v1.1/68/images/4949f9ee-2421-4c81-8b49-13119446008b"}, - httplib.responses[httplib.ACCEPTED]) + return ( + httplib.ACCEPTED, + "", + { + "location": "http://127.0.0.1/v1.1/68/images/4949f9ee-2421-4c81-8b49-13119446008b" + }, + httplib.responses[httplib.ACCEPTED], + ) elif "rescue" in json.loads(body): - return (httplib.OK, '{"adminPass": "foo"}', {}, - httplib.responses[httplib.OK]) + return ( + httplib.OK, + '{"adminPass": "foo"}', + {}, + httplib.responses[httplib.OK], + ) return (httplib.ACCEPTED, "", {}, httplib.responses[httplib.ACCEPTED]) def _v1_1_slug_servers_12066_action(self, method, url, body, headers): if method != "POST": - self.fail('HTTP method other than POST to action URL') + self.fail("HTTP method other than POST to action URL") + if "rebuild" not in json.loads(body): self.fail("Did not get expected action (rebuild) in action URL") - self.assertTrue('\"OS-DCF:diskConfig\": \"MANUAL\"' in body, - msg="Manual disk configuration option was not specified in rebuild body: " + body) + self.assertTrue( + '"OS-DCF:diskConfig": "MANUAL"' in body, + msg="Manual disk configuration option was not specified in rebuild body: " + body, + ) return (httplib.ACCEPTED, "", {}, httplib.responses[httplib.ACCEPTED]) @@ -1588,11 +2764,23 @@ def _v1_1_slug_servers_12065(self, method, url, body, headers): def _v1_1_slug_servers_12064(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_servers_12064.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_servers_12064.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) elif method == "PUT": - body = self.fixtures.load('_servers_12064_updated_name_bob.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_servers_12064_updated_name_bob.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) elif method == "DELETE": return (httplib.ACCEPTED, "", {}, httplib.responses[httplib.ACCEPTED]) else: @@ -1600,35 +2788,219 @@ def _v1_1_slug_servers_12064(self, method, url, body, headers): def _v1_1_slug_servers_12062(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_servers_12064.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_servers_12064.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v1_1_slug_servers_12064247(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_servers_12064247.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_servers_12063_metadata(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_servers_12063_metadata_two_keys.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_servers_12063_metadata_two_keys.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) elif method == "PUT": - body = self.fixtures.load('_servers_12063_metadata_two_keys.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_servers_12063_metadata_two_keys.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_servers_EX_DISK_CONFIG(self, method, url, body, headers): if method == "POST": body = u(body) - self.assertTrue(body.find('\"OS-DCF:diskConfig\": \"AUTO\"')) - body = self.fixtures.load('_servers_create_disk_config.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + self.assertTrue(body.find('"OS-DCF:diskConfig": "AUTO"')) + body = self.fixtures.load("_servers_create_disk_config.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v1_1_slug_servers_EX_FILES(self, method, url, body, headers): + if method == "POST": + body = u(body) + personality = [ + {"path": "/file1", "contents": "Y29udGVudDE="}, + {"path": "/file2", "contents": "Y29udGVudDI="}, + ] + self.assertEqual(json.loads(body)["server"]["personality"], personality) + body = self.fixtures.load("_servers_create.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v1_1_slug_servers_EX_FILES_NONE(self, method, url, body, headers): + if method == "POST": + body = u(body) + self.assertNotIn('"personality"', body) + body = self.fixtures.load("_servers_create.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_flavors_7(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_flavors_7.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_flavors_7.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) else: raise NotImplementedError() def _v1_1_slug_images_13(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_images_13.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_images_13.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + raise NotImplementedError() + + def _v2_1337_v2_images_f24a3c1b_d52a_4116_91da_25b3eee8f55e(self, method, url, body, headers): + if method == "GET" or method == "PATCH": + body = self.fixtures.load("_images_f24a3c1b-d52a-4116-91da-25b3eee8f55e.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + raise NotImplementedError() + + def _v2_1337_v2_images_d9a9cd9a_278a_444c_90a6_d24b8c688a63_members( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("_images_d9a9cd9a_278a_444c_90a6_d24b8c688a63_members.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + raise NotImplementedError() + + def _v2_1337_v2_images_9af1a54e_a1b2_4df8_b747_4bec97abc799_members( + self, method, url, body, headers + ): + if method == "POST": + body = self.fixtures.load("_images_9af1a54e_a1b2_4df8_b747_4bec97abc799_members.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + raise NotImplementedError() + + def _v2_1337_v2_images_8af1a54e_a1b2_4df8_b747_4bec97abc799_members_e2151b1fe02d4a8a2d1f5fc331522c0a( + self, method, url, body, headers + ): + if method == "PUT": + body = self.fixtures.load("_images_8af1a54e_a1b2_4df8_b747_4bec97abc799_members.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + raise NotImplementedError() + + def _v2_1337_v2_images_d9a9cd9a_278a_444c_90a6_d24b8c688a63_members_016926dff12345e8b10329f24c99745b( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load( + "_images_d9a9cd9a_278a_444c_90a6_d24b8c688a63_members_016926dff12345e8b10329f24c99745b.json" + ) + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + raise NotImplementedError() + + def _v2_1337_v2_images(self, method, url, body, headers): + if method == "GET": + # 2nd (and last) page of images + + if "marker=e7a40226-3523-4f0f-87d8-d8dc91bbf4a3" in url: + body = self.fixtures.load("_images_v2_page2.json") + else: + # first page of images + body = self.fixtures.load("_images_v2.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + raise NotImplementedError() + + def _v2_1337_v2_images_invalid_next(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_images_v2_invalid_next.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) else: raise NotImplementedError() @@ -1640,30 +3012,165 @@ def _v1_1_slug_images_26365521_8c62_11f9_2c33_283d153ecc3a(self, method, url, bo def _v1_1_slug_images_4949f9ee_2421_4c81_8b49_13119446008b(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load( - '_images_4949f9ee_2421_4c81_8b49_13119446008b.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_images_4949f9ee_2421_4c81_8b49_13119446008b.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + raise NotImplementedError() + + def _v2_1337_v2_images_4949f9ee_2421_4c81_8b49_13119446008b(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_images_f24a3c1b-d52a-4116-91da-25b3eee8f55d.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + raise NotImplementedError() + + def _v2_1337_v2_0_ports(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_ports_v2.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + elif method == "POST": + body = self.fixtures.load("_port_v2.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + raise NotImplementedError() + + def _v2_1337_v2_0_ports_126da55e_cfcb_41c8_ae39_a26cb8a7e723(self, method, url, body, headers): + if method == "DELETE": + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT]) + elif method == "GET": + body = self.fixtures.load("_port_v2.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + elif method == "PUT": + if body: + body = self.fixtures.load("_port_v2.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + return ( + httplib.INTERNAL_SERVER_ERROR, + "", + {}, + httplib.responses[httplib.INTERNAL_SERVER_ERROR], + ) + else: + raise NotImplementedError() + + def _v2_1337_servers_12065_os_volume_attachments_DEVICE_AUTO(self, method, url, body, headers): + # test_attach_volume_device_auto + + if method == "POST": + if "rackspace" not in self.__class__.__name__.lower(): + body = json.loads(body) + self.assertEqual(body["volumeAttachment"]["device"], None) + + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT]) + else: + raise NotImplementedError() + + def _v2_1337_servers_1c01300f_ef97_4937_8f03_ac676d6234be_os_interface_126da55e_cfcb_41c8_ae39_a26cb8a7e723( + self, method, url, body, headers + ): + if method == "DELETE": + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT]) + else: + raise NotImplementedError() + + def _v2_1337_servers_1c01300f_ef97_4937_8f03_ac676d6234be_os_interface( + self, method, url, body, headers + ): + if method == "POST": + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT]) else: raise NotImplementedError() - def _v1_1_slug_servers_1c01300f_ef97_4937_8f03_ac676d6234be_os_security_groups(self, method, url, body, headers): + def _v2_1337_servers_26f7fbee_8ce1_4c28_887a_bfe8e4bb10fe_EX_FILES( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("_servers_26f7fbee_8ce1_4c28_887a_bfe8e4bb10fe.json") + else: + raise NotImplementedError() + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_servers_26f7fbee_8ce1_4c28_887a_bfe8e4bb10fe_EX_FILES_NONE( + self, method, url, body, headers + ): + return self._v2_1337_servers_26f7fbee_8ce1_4c28_887a_bfe8e4bb10fe_EX_FILES( + method, url, body, headers + ) + + def _v1_1_slug_servers_1c01300f_ef97_4937_8f03_ac676d6234be_os_security_groups( + self, method, url, body, headers + ): if method == "GET": body = self.fixtures.load( - '_servers_1c01300f-ef97-4937-8f03-ac676d6234be_os-security-groups.json') + "_servers_1c01300f-ef97-4937-8f03-ac676d6234be_os-security-groups.json" + ) else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_os_security_groups(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_os_security_groups.json') + body = self.fixtures.load("_os_security_groups.json") elif method == "POST": - body = self.fixtures.load('_os_security_groups_create.json') + body = self.fixtures.load("_os_security_groups_create.json") else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_os_security_groups_6(self, method, url, body, headers): if method == "DELETE": @@ -1673,11 +3180,16 @@ def _v1_1_slug_os_security_groups_6(self, method, url, body, headers): def _v1_1_slug_os_security_group_rules(self, method, url, body, headers): if method == "POST": - body = self.fixtures.load('_os_security_group_rules_create.json') + body = self.fixtures.load("_os_security_group_rules_create.json") else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_os_security_group_rules_2(self, method, url, body, headers): if method == "DELETE": @@ -1687,33 +3199,47 @@ def _v1_1_slug_os_security_group_rules_2(self, method, url, body, headers): def _v1_1_slug_os_keypairs(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_os_keypairs.json') + body = self.fixtures.load("_os_keypairs.json") elif method == "POST": - if 'public_key' in body: - body = self.fixtures.load('_os_keypairs_create_import.json') + if "public_key" in body: + body = self.fixtures.load("_os_keypairs_create_import.json") else: - body = self.fixtures.load('_os_keypairs_create.json') + body = self.fixtures.load("_os_keypairs_create.json") else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_os_keypairs_test_key_pair(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('_os_keypairs_get_one.json') + if method == "GET": + body = self.fixtures.load("_os_keypairs_get_one.json") else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_os_keypairs_doesnt_exist(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('_os_keypairs_not_found.json') + if method == "GET": + body = self.fixtures.load("_os_keypairs_not_found.json") else: raise NotImplementedError() - return (httplib.NOT_FOUND, body, self.json_content_headers, - httplib.responses[httplib.NOT_FOUND]) + return ( + httplib.NOT_FOUND, + body, + self.json_content_headers, + httplib.responses[httplib.NOT_FOUND], + ) def _v1_1_slug_os_keypairs_key1(self, method, url, body, headers): if method == "DELETE": @@ -1723,153 +3249,830 @@ def _v1_1_slug_os_keypairs_key1(self, method, url, body, headers): def _v1_1_slug_os_volumes(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_os_volumes.json') + body = self.fixtures.load("_os_volumes.json") elif method == "POST": - body = self.fixtures.load('_os_volumes_create.json') + body = self.fixtures.load("_os_volumes_create.json") else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) - def _v1_1_slug_os_volumes_cd76a3a1_c4ce_40f6_9b9f_07a61508938d(self, method, url, body, headers): + def _v1_1_slug_os_volumes_cd76a3a1_c4ce_40f6_9b9f_07a61508938d( + self, method, url, body, headers + ): if method == "GET": - body = self.fixtures.load( - '_os_volumes_cd76a3a1_c4ce_40f6_9b9f_07a61508938d.json') + body = self.fixtures.load("_os_volumes_cd76a3a1_c4ce_40f6_9b9f_07a61508938d.json") elif method == "DELETE": - body = '' + body = "" else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_servers_12065_os_volume_attachments(self, method, url, body, headers): if method == "POST": - body = self.fixtures.load( - '_servers_12065_os_volume_attachments.json') + if "rackspace" not in self.__class__.__name__.lower(): + body = json.loads(body) + self.assertEqual(body["volumeAttachment"]["device"], "/dev/sdb") + + body = self.fixtures.load("_servers_12065_os_volume_attachments.json") else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) - def _v1_1_slug_servers_12065_os_volume_attachments_cd76a3a1_c4ce_40f6_9b9f_07a61508938d(self, method, url, body, - headers): + def _v1_1_slug_servers_12065_os_volume_attachments_cd76a3a1_c4ce_40f6_9b9f_07a61508938d( + self, method, url, body, headers + ): if method == "DELETE": - body = '' + body = "" else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) def _v1_1_slug_os_floating_ip_pools(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_floating_ip_pools.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_floating_ip_pools.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) else: raise NotImplementedError() def _v1_1_slug_os_floating_ips_foo_bar_id(self, method, url, body, headers): if method == "DELETE": - body = '' - return (httplib.ACCEPTED, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = "" + + return ( + httplib.ACCEPTED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) else: raise NotImplementedError() def _v1_1_slug_os_floating_ips(self, method, url, body, headers): if method == "GET": - body = self.fixtures.load('_floating_ips.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_floating_ips.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) elif method == "POST": - body = self.fixtures.load('_floating_ip.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = self.fixtures.load("_floating_ip.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) else: raise NotImplementedError() def _v1_1_slug_servers_4242_action(self, method, url, body, headers): if method == "POST": - body = '' - return (httplib.ACCEPTED, body, self.json_content_headers, httplib.responses[httplib.OK]) + body = "" + + return ( + httplib.ACCEPTED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) - def _v1_1_slug_os_networks(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('_os_networks.json') - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) - elif method == 'POST': - body = self.fixtures.load('_os_networks_POST.json') - return (httplib.ACCEPTED, body, self.json_content_headers, httplib.responses[httplib.OK]) + if method == "GET": + body = self.fixtures.load("_os_networks.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + elif method == "POST": + body = self.fixtures.load("_os_networks_POST.json") + + return ( + httplib.ACCEPTED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) raise NotImplementedError() - def _v1_1_slug_os_networks_f13e5051_feea_416b_827a_1a0acc2dad14(self, method, url, body, headers): - if method == 'DELETE': - body = '' - return (httplib.ACCEPTED, body, self.json_content_headers, httplib.responses[httplib.OK]) + def _v1_1_slug_os_networks_f13e5051_feea_416b_827a_1a0acc2dad14( + self, method, url, body, headers + ): + if method == "DELETE": + body = "" + + return ( + httplib.ACCEPTED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) raise NotImplementedError() def _v1_1_slug_servers_72258_action(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('_servers_suspend.json') - return (httplib.ACCEPTED, body, self.json_content_headers, httplib.responses[httplib.OK]) + if method == "POST": + body = self.fixtures.load("_servers_suspend.json") + + return ( + httplib.ACCEPTED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) - def _v1_1_slug_servers_12063_action(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('_servers_unpause.json') - return (httplib.ACCEPTED, body, self.json_content_headers, httplib.responses[httplib.OK]) + if method == "POST": + body = self.fixtures.load("_servers_unpause.json") + + return ( + httplib.ACCEPTED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) - def _v1_1_slug_servers_12086_action(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('_servers_12086_console_output.json') - return (httplib.ACCEPTED, body, self.json_content_headers, httplib.responses[httplib.OK]) + if method == "POST": + body = self.fixtures.load("_servers_12086_console_output.json") + + return ( + httplib.ACCEPTED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) else: raise NotImplementedError() def _v1_1_slug_os_snapshots(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('_os_snapshots.json') - elif method == 'POST': - body = self.fixtures.load('_os_snapshots_create.json') + if method == "GET": + body = self.fixtures.load("_os_snapshots.json") + elif method == "POST": + body = self.fixtures.load("_os_snapshots_create.json") else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) - def _v1_1_slug_os_snapshots_RACKSPACE(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('_os_snapshots_rackspace.json') - elif method == 'POST': - body = self.fixtures.load('_os_snapshots_create_rackspace.json') + def _v1_1_slug_os_snapshots_3fbbcccf_d058_4502_8844_6feeffdf4cb5( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("_os_snapshot.json") + status_code = httplib.OK + elif method == "DELETE": + body = "" + status_code = httplib.NO_CONTENT else: raise NotImplementedError() - return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + status_code, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) - def _v1_1_slug_os_snapshots_3fbbcccf_d058_4502_8844_6feeffdf4cb5(self, method, url, body, headers): - if method == 'DELETE': - body = '' + def _v1_1_slug_os_snapshots_3fbbcccf_d058_4502_8844_6feeffdf4cb5_RACKSPACE( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("_os_snapshot_rackspace.json") + status_code = httplib.OK + elif method == "DELETE": + body = "" status_code = httplib.NO_CONTENT else: raise NotImplementedError() - return (status_code, body, self.json_content_headers, httplib.responses[httplib.OK]) + return ( + status_code, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) - def _v1_1_slug_os_snapshots_3fbbcccf_d058_4502_8844_6feeffdf4cb5_RACKSPACE(self, method, url, body, headers): - if method == 'DELETE': - body = '' - status_code = httplib.NO_CONTENT + def _v1_1_slug_os_snapshots_RACKSPACE(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_os_snapshots_rackspace.json") + elif method == "POST": + body = self.fixtures.load("_os_snapshots_create_rackspace.json") + else: + raise NotImplementedError() + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_networks(self, method, url, body, headers): + if method == "GET": + if "router:external=True" in url: + body = self.fixtures.load("_v2_0__networks_public.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + body = self.fixtures.load("_v2_0__networks.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + elif method == "POST": + body = self.fixtures.load("_v2_0__networks_POST.json") + + return ( + httplib.ACCEPTED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + raise NotImplementedError() + + def _v2_1337_v2_0_networks_cc2dad14_827a_feea_416b_f13e50511a0a( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("_v2_0__network.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + raise NotImplementedError() + + def _v2_1337_v2_0_networks_e4e207ac_6707_432b_82b9_244f6859c394( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("_v2_0__network_no_tags.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + raise NotImplementedError() + + def _v2_1337_v2_0_networks_d32019d3_bc6e_4319_9c1d_6722fc136a22( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("_v2_0__networks_POST.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + elif method == "DELETE": + body = "" + + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_subnets_08eae331_0402_425a_923c_34f7cfe39c1b( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("_v2_0__subnet.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + if method == "DELETE": + body = "" + + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + elif method == "PUT": + body = self.fixtures.load("_v2_0__subnet.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_subnets(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("_v2_0__subnet.json") + + return ( + httplib.CREATED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + body = self.fixtures.load("_v2_0__subnets.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v3_1337_volumes_detail(self, method, url, body, headers): + body = self.fixtures.load("_v2_0__volumes.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v3_1337_volumes(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("_v2_0__volume.json") + + return ( + httplib.CREATED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v3_1337_volumes_cd76a3a1_c4ce_40f6_9b9f_07a61508938d(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_v2_0__volume.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + if method == "DELETE": + body = "" + + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v3_1337_volumes_abc6a3a1_c4ce_40f6_9b9f_07a61508938d(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_v2_0__volume_abc6a3a1_c4ce_40f6_9b9f_07a61508938d.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + if method == "DELETE": + body = "" + + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v3_1337_snapshots_detail(self, method, url, body, headers): + if ( + "unit_test=paginate" in url and "marker" not in url + ) or "unit_test=pagination_loop" in url: + body = self.fixtures.load("_v2_0__snapshots_paginate_start.json") + else: + body = self.fixtures.load("_v2_0__snapshots.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v3_1337_snapshots(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("_v2_0__snapshot.json") + + return ( + httplib.CREATED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v3_1337_snapshots_3fbbcccf_d058_4502_8844_6feeffdf4cb5(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_v2_0__snapshot.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + if method == "DELETE": + body = "" + + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_security_groups(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("_v2_0__security_group.json") + + return ( + httplib.CREATED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + if method == "GET": + body = self.fixtures.load("_v2_0__security_groups.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_security_groups_6(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_v2_0__security_group.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + if method == "DELETE": + body = "" + + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_security_group_rules(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("_v2_0__security_group_rule.json") + + return ( + httplib.CREATED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_security_group_rules_2(self, method, url, body, headers): + if method == "DELETE": + body = "" + + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_floatingips(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("_v2_0__floatingip.json") + + return ( + httplib.CREATED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + if method == "GET": + if "floating_network_id=" in url: + body = self.fixtures.load("_v2_0__floatingips_net_id.json") + elif "floating_ip_address" in url: + body = self.fixtures.load("_v2_0__floatingips_ip_id.json") + else: + body = self.fixtures.load("_v2_0__floatingips.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_floatingips_foo_bar_id(self, method, url, body, headers): + if method == "DELETE": + body = "" + + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_floatingips_09ea1784_2f81_46dc_8c91_244b4df75bde( + self, method, url, body, headers + ): + if method == "PUT": + self.assertIn( + body, + [ + '{"floatingip": {"port_id": "ce531f90-199f-48c0-816c-13e38010b442"}}', + '{"floatingip": {"port_id": null}}', + ], + ) + body = "" + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_routers_f8a44de0_fc8e_45df_93c7_f79bf3b01c95( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("_v2_0__router.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + if method == "DELETE": + body = "" + + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_routers(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("_v2_0__router.json") + + return ( + httplib.CREATED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + else: + body = self.fixtures.load("_v2_0__routers.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_routers_f8a44de0_fc8e_45df_93c7_f79bf3b01c95_add_router_interface( + self, method, url, body, headers + ): + if method == "PUT": + body = self.fixtures.load("_v2_0__router_interface.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_v2_0_routers_f8a44de0_fc8e_45df_93c7_f79bf3b01c95_remove_router_interface( + self, method, url, body, headers + ): + if method == "PUT": + body = self.fixtures.load("_v2_0__router_interface.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_os_quota_sets_tenant_id_detail(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_v2_0__quota_set.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_flavors_7_os_extra_specs(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_flavor_extra_specs.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) else: raise NotImplementedError() - return (status_code, body, self.json_content_headers, httplib.responses[httplib.OK]) + def _v2_1337_servers_1000_action(self, method, url, body, headers): + if method != "POST" or body != '{"removeSecurityGroup": {"name": "sgname"}}': + raise NotImplementedError(body) + + return httplib.ACCEPTED, None, {}, httplib.responses[httplib.ACCEPTED] + + def _v2_1337_v2_0_quotas_tenant_id_details_json(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_v2_0__network_quota.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v3_1337_os_quota_sets_tenant_id(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_v3_0__volume_quota.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_os_server_groups(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_v2_0__os_server_groups.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + elif method == "POST": + body = self.fixtures.load("_v2_0__os_server_group.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_os_server_groups_616fb98f_46ca_475e_917e_2563e5a8cd19( + self, method, url, body, headers + ): + if method == "GET": + body = self.fixtures.load("_v2_0__os_server_group.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + elif method == "DELETE": + body = "" + + return ( + httplib.NO_CONTENT, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v2_1337_servers_4242_os_interface(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_servers_os_intefaces.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v1_leases(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_leases.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + + def _v1_os_hosts(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_os_hosts.json") + + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) # This exists because the nova compute url in devstack has v2 in there but the v1.1 fixtures @@ -1877,28 +4080,106 @@ def _v1_1_slug_os_snapshots_3fbbcccf_d058_4502_8844_6feeffdf4cb5_RACKSPACE(self, class OpenStack_2_0_MockHttp(OpenStack_1_1_MockHttp): - def __init__(self, *args, **kwargs): - super(OpenStack_2_0_MockHttp, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) methods1 = OpenStack_1_1_MockHttp.__dict__ - names1 = [m for m in methods1 if m.find('_v1_1') == 0] + names1 = [m for m in methods1 if m.find("_v1_1") == 0] for name in names1: method = methods1[name] - new_name = name.replace('_v1_1_slug_', '_v2_1337_') - setattr(self, new_name, method_type(method, self, - OpenStack_2_0_MockHttp)) + new_name = name.replace("_v1_1_slug_", "_v2_1337_") + setattr(self, new_name, method_type(method, self, OpenStack_2_0_MockHttp)) + + def _v2_0_tenants_UNAUTHORIZED(self, method, url, body, headers): + return (httplib.UNAUTHORIZED, "", {}, httplib.responses[httplib.UNAUTHORIZED]) + + +class OpenStack_AllAuthVersions_MockHttp(MockHttp): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + # Lazy import to avoid cyclic dependency issue + from libcloud.test.common.test_openstack_identity import ( + OpenStackIdentity_2_0_MockHttp, + OpenStackIdentity_3_0_MockHttp, + OpenStackIdentity_3_0_AppCred_MockHttp, + ) + + self.mock_http = OpenStackMockHttp(*args, **kwargs) + self.mock_http_1_1 = OpenStack_1_1_MockHttp(*args, **kwargs) + self.mock_http_2_0 = OpenStack_2_0_MockHttp(*args, **kwargs) + self.mock_http_2_0_identity = OpenStackIdentity_2_0_MockHttp(*args, **kwargs) + self.mock_http_3_0_identity = OpenStackIdentity_3_0_MockHttp(*args, **kwargs) + self.mock_http_3_0_appcred_identity = OpenStackIdentity_3_0_AppCred_MockHttp( + *args, **kwargs + ) + + def _v1_0_slug_servers_detail(self, method, url, body, headers): + return self.mock_http_1_1._v1_1_slug_servers_detail( + method=method, url=url, body=body, headers=headers + ) + + def _v1_1_auth(self, method, url, body, headers): + return self.mock_http._v1_1_auth(method=method, url=url, body=body, headers=headers) + + def _v2_0_tokens(self, method, url, body, headers): + return self.mock_http_2_0._v2_0_tokens(method=method, url=url, body=body, headers=headers) + + def _v2_1337_servers_detail(self, method, url, body, headers): + return self.mock_http_2_0._v2_1337_servers_detail( + method=method, url=url, body=body, headers=headers + ) + + def _v2_0_tenants(self, method, url, body, headers): + return self.mock_http_2_0_identity._v2_0_tenants( + method=method, url=url, body=body, headers=headers + ) + + def _v2_9c4693dce56b493b9b83197d900f7fba_servers_detail(self, method, url, body, headers): + return self.mock_http_1_1._v1_1_slug_servers_detail( + method=method, url=url, body=body, headers=headers + ) + + def _v3_OS_FEDERATION_identity_providers_user_name_protocols_tenant_name_auth( + self, method, url, body, headers + ): + return self.mock_http_3_0_identity._v3_OS_FEDERATION_identity_providers_test_user_id_protocols_test_tenant_auth( + method=method, url=url, body=body, headers=headers + ) + + def _v3_auth_tokens(self, method, url, body, headers): + if "application_credential" in body: + return self.mock_http_3_0_appcred_identity._v3_auth_tokens( + method=method, url=url, body=body, headers=headers + ) + elif "token" in body: + return self.mock_http_3_0_identity._v3_auth_tokens( + method=method, url=url, body=body, headers=headers + ) + else: + return self.mock_http_3_0_identity._v3_auth_tokens( + method=method, url=url, body=body, headers=headers + ) + + def _v3_0_auth_tokens(self, method, url, body, headers): + return self.mock_http_3_0_identity._v3_0_auth_tokens( + method=method, url=url, body=body, headers=headers + ) + + def _v3_auth_projects(self, method, url, body, headers): + return self.mock_http_3_0_identity._v3_auth_projects( + method=method, url=url, body=body, headers=headers + ) class OpenStack_1_1_Auth_2_0_Tests(OpenStack_1_1_Tests): - driver_args = OPENSTACK_PARAMS + ('1.1',) - driver_kwargs = {'ex_force_auth_version': '2.0'} + driver_args = OPENSTACK_PARAMS + ("1.1",) + driver_kwargs = {"ex_force_auth_version": "2.0"} def setUp(self): - self.driver_klass.connectionCls.conn_classes = \ - (OpenStack_2_0_MockHttp, OpenStack_2_0_MockHttp) + self.driver_klass.connectionCls.conn_class = OpenStack_2_0_MockHttp self.driver_klass.connectionCls.auth_url = "https://auth.api.example.com" OpenStackMockHttp.type = None OpenStack_1_1_MockHttp.type = None @@ -1911,13 +4192,111 @@ def setUp(self): def test_auth_user_info_is_set(self): self.driver.connection._populate_hosts_and_request_paths() - self.assertEqual(self.driver.connection.auth_user_info, { - 'id': '7', - 'name': 'testuser', - 'roles': [{'description': 'Default Role.', - 'id': 'identity:default', - 'name': 'identity:default'}]}) + self.assertEqual( + self.driver.connection.auth_user_info, + { + "id": "7", + "name": "testuser", + "roles": [ + { + "description": "Default Role.", + "id": "identity:default", + "name": "identity:default", + } + ], + }, + ) + + +class OpenStack_AuthVersions_Tests(unittest.TestCase): + def setUp(self): + # monkeypatch get_endpoint because the base openstack driver doesn't actually + # work with old devstack but this class/tests are still used by the rackspace + # driver + self.originalGetEndpoint = OpenStack_1_1_NodeDriver.connectionCls.get_endpoint + self.originalConnectionCls = OpenStack_1_1_NodeDriver.connectionCls + + def get_endpoint(*args, **kwargs): + return "https://servers.api.rackspacecloud.com/v1.0/slug" + + OpenStack_1_1_NodeDriver.connectionCls.get_endpoint = get_endpoint + OpenStack_1_1_NodeDriver.connectionCls.conn_class = OpenStack_AllAuthVersions_MockHttp + + OpenStackMockHttp.type = None + OpenStack_1_1_MockHttp.type = None + OpenStack_2_0_MockHttp.type = None + + def tearDown(self): + OpenStack_1_1_NodeDriver.connectionCls.get_endpoint = self.originalGetEndpoint + OpenStack_1_1_NodeDriver.connectionCls.conn_class = self.originalConnectionCls + + OpenStackMockHttp.type = None + OpenStack_1_1_MockHttp.type = None + OpenStack_2_0_MockHttp.type = None + + def test_ex_force_auth_version_all_possible_values(self): + """ + Test case which verifies that the driver can be correctly instantiated using all the + supported API versions. + """ + cls = get_driver(Provider.OPENSTACK) + + for auth_version in AUTH_VERSIONS_WITH_EXPIRES: + driver_kwargs = {} + + if auth_version in ["1.1", "3.0"]: + # 1.1 is old and deprecated, 3.0 is not exposed directly to the end user + + continue + + user_id = OPENSTACK_PARAMS[0] + key = OPENSTACK_PARAMS[1] + + if auth_version.startswith("3.x"): + driver_kwargs["ex_domain_name"] = "test_domain" + driver_kwargs["ex_tenant_domain_id"] = "test_tenant_domain_id" + driver_kwargs["ex_force_service_region"] = "regionOne" + driver_kwargs["ex_tenant_name"] = "tenant-name" + + if auth_version == "3.x_oidc_access_token": + key = "test_key" + driver_kwargs["ex_domain_name"] = None + + elif auth_version == "3.x_appcred": + user_id = "appcred_id" + key = "appcred_secret" + + driver = cls( + user_id, + key, + ex_force_auth_url="http://x.y.z.y:5000", + ex_force_auth_version=auth_version, + **driver_kwargs, + ) + nodes = driver.list_nodes() + self.assertTrue(len(nodes) >= 1) + + +class OpenStackMockAuthCache(OpenStackAuthenticationCache): + def __init__(self): + self.reset() + + def get(self, key): + return self.store.get(key) + + def put(self, key, context): + self.store[key] = context + + def clear(self, key): + if key in self.store: + del self.store[key] + + def reset(self): + self.store = {} + + def __len__(self): + return len(self.store) -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_opsource.py b/libcloud/test/compute/test_opsource.py deleted file mode 100644 index b39bf23853..0000000000 --- a/libcloud/test/compute/test_opsource.py +++ /dev/null @@ -1,251 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import sys -import unittest -from libcloud.utils.py3 import httplib - -from libcloud.common.types import InvalidCredsError -from libcloud.compute.drivers.opsource import OpsourceNodeDriver as Opsource -from libcloud.compute.drivers.opsource import OpsourceAPIException -from libcloud.compute.base import Node, NodeAuthPassword, NodeLocation - -from libcloud.test import MockHttp -from libcloud.test.compute import TestCaseMixin -from libcloud.test.file_fixtures import ComputeFileFixtures - -from libcloud.test.secrets import OPSOURCE_PARAMS - - -class OpsourceTests(unittest.TestCase, TestCaseMixin): - - def setUp(self): - Opsource.connectionCls.conn_classes = (None, OpsourceMockHttp) - OpsourceMockHttp.type = None - self.driver = Opsource(*OPSOURCE_PARAMS) - - def test_invalid_creds(self): - OpsourceMockHttp.type = 'UNAUTHORIZED' - try: - self.driver.list_nodes() - self.assertTrue( - False) # Above command should have thrown an InvalidCredsException - except InvalidCredsError: - pass - - def test_list_sizes_response(self): - OpsourceMockHttp.type = None - ret = self.driver.list_sizes() - self.assertEqual(len(ret), 1) - size = ret[0] - self.assertEqual(size.name, 'default') - - def test_reboot_node_response(self): - node = Node(id='11', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver) - ret = node.reboot() - self.assertTrue(ret is True) - - def test_reboot_node_response_INPROGRESS(self): - OpsourceMockHttp.type = 'INPROGRESS' - node = Node(id='11', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver) - try: - node.reboot() - self.assertTrue( - False) # above command should have thrown OpsourceAPIException - except OpsourceAPIException: - pass - - def test_destroy_node_response(self): - node = Node(id='11', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver) - ret = node.destroy() - self.assertTrue(ret is True) - - def test_destroy_node_response_INPROGRESS(self): - OpsourceMockHttp.type = 'INPROGRESS' - node = Node(id='11', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver) - try: - node.destroy() - self.assertTrue( - False) # above command should have thrown OpsourceAPIException - except OpsourceAPIException: - pass - - def test_create_node_response(self): - rootPw = NodeAuthPassword('pass123') - image = self.driver.list_images()[0] - network = self.driver.ex_list_networks()[0] - node = self.driver.create_node(name='test2', image=image, auth=rootPw, - ex_description='test2 node', ex_network=network, - ex_isStarted=False) - self.assertEqual(node.id, 'e75ead52-692f-4314-8725-c8a4f4d13a87') - self.assertEqual(node.extra['status'].action, 'DEPLOY_SERVER') - - def test_ex_shutdown_graceful(self): - node = Node(id='11', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver) - ret = self.driver.ex_shutdown_graceful(node) - self.assertTrue(ret is True) - - def test_ex_shutdown_graceful_INPROGRESS(self): - OpsourceMockHttp.type = 'INPROGRESS' - node = Node(id='11', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver) - try: - self.driver.ex_shutdown_graceful(node) - self.assertTrue( - False) # above command should have thrown OpsourceAPIException - except OpsourceAPIException: - pass - - def test_ex_start_node(self): - node = Node(id='11', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver) - ret = self.driver.ex_start_node(node) - self.assertTrue(ret is True) - - def test_ex_start_node_INPROGRESS(self): - OpsourceMockHttp.type = 'INPROGRESS' - node = Node(id='11', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver) - try: - self.driver.ex_start_node(node) - self.assertTrue( - False) # above command should have thrown OpsourceAPIException - except OpsourceAPIException: - pass - - def test_ex_power_off(self): - node = Node(id='11', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver) - ret = self.driver.ex_power_off(node) - self.assertTrue(ret is True) - - def test_ex_power_off_INPROGRESS(self): - OpsourceMockHttp.type = 'INPROGRESS' - node = Node(id='11', name=None, state=None, - public_ips=None, private_ips=None, driver=self.driver) - try: - self.driver.ex_power_off(node) - self.assertTrue( - False) # above command should have thrown OpsourceAPIException - except OpsourceAPIException: - pass - - def test_ex_list_networks(self): - nets = self.driver.ex_list_networks() - self.assertEqual(nets[0].name, 'test-net1') - self.assertTrue(isinstance(nets[0].location, NodeLocation)) - - def test_node_public_ip(self): - nodes = self.driver.list_nodes() - node = [n for n in nodes if n.id == - 'abadbc7e-9e10-46ca-9d4a-194bcc6b6c16'][0] - self.assertEqual(node.public_ips[0], '200.16.132.7') - - -class OpsourceMockHttp(MockHttp): - - fixtures = ComputeFileFixtures('opsource') - - def _oec_0_9_myaccount_UNAUTHORIZED(self, method, url, body, headers): - return (httplib.UNAUTHORIZED, "", {}, httplib.responses[httplib.UNAUTHORIZED]) - - def _oec_0_9_myaccount(self, method, url, body, headers): - body = self.fixtures.load('oec_0_9_myaccount.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _oec_0_9_myaccount_INPROGRESS(self, method, url, body, headers): - body = self.fixtures.load('oec_0_9_myaccount.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _oec_0_9_base_image(self, method, url, body, headers): - body = self.fixtures.load('oec_0_9_base_image.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployed(self, method, url, body, headers): - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployed.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_pendingDeploy(self, method, url, body, headers): - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_pendingDeploy.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter(self, method, url, body, headers): - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11(self, method, url, body, headers): - body = None - action = url.split('?')[-1] - - if action == 'restart': - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart.xml') - elif action == 'shutdown': - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown.xml') - elif action == 'delete': - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete.xml') - elif action == 'start': - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start.xml') - elif action == 'poweroff': - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff.xml') - - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_INPROGRESS(self, method, url, body, headers): - body = None - action = url.split('?')[-1] - - if action == 'restart': - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_restart_INPROGRESS.xml') - elif action == 'shutdown': - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_shutdown_INPROGRESS.xml') - elif action == 'delete': - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_delete_INPROGRESS.xml') - elif action == 'start': - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_start_INPROGRESS.xml') - elif action == 'poweroff': - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_poweroff_INPROGRESS.xml') - - return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]) - - def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server(self, method, url, body, headers): - body = self.fixtures.load( - '_oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation(self, method, url, body, headers): - body = self.fixtures.load( - 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_outscale.py b/libcloud/test/compute/test_outscale.py new file mode 100644 index 0000000000..0f1c8322f0 --- /dev/null +++ b/libcloud/test/compute/test_outscale.py @@ -0,0 +1,348 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +import inspect +import unittest +from unittest.mock import Mock + +from libcloud.compute.base import NodeDriver, NodeLocation +from libcloud.compute.drivers.outscale import OutscaleNodeDriver + + +class OutscaleNodeDriverTest(unittest.TestCase): + STANDARD_METHODS_UNDER_TEST = { + "attach_volume", + "create_image", + "create_key_pair", + "create_node", + "create_volume", + "create_volume_snapshot", + "delete_image", + "delete_key_pair", + "destroy_node", + "destroy_volume", + "destroy_volume_snapshot", + "detach_volume", + "get_image", + "get_key_pair", + "list_images", + "list_key_pairs", + "list_locations", + "list_nodes", + "list_volume_snapshots", + "list_volumes", + "reboot_node", + "start_node", + "stop_node", + } + + def setUp(self): + self.driver = OutscaleNodeDriver("key", "secret") + self._set_response({}, status_code=400) + + def _set_response(self, payload, status_code=200): + response = Mock(status_code=400) + response.status_code = status_code + response.json.return_value = payload + self.driver._call_api = Mock(return_value=response) + + def test_all_standard_methods_are_covered(self): + standard_methods = { + name + for name, method in NodeDriver.__dict__.items() + if inspect.isfunction(method) and not name.startswith("_") + } + implemented_methods = { + name + for name, method in OutscaleNodeDriver.__dict__.items() + if inspect.isfunction(method) and name in standard_methods + } + + self.assertEqual(implemented_methods, self.STANDARD_METHODS_UNDER_TEST) + + def test_list_locations(self): + expected = [Mock()] + self.driver._to_locations = Mock(return_value=expected) + self._set_response({"Locations": [{"Code": "eu-west-2a"}]}) + + result = self.driver.list_locations() + + self.assertEqual(result, expected) + self.driver._to_locations.assert_called_once_with([{"Code": "eu-west-2a"}]) + self.driver._call_api.assert_called_once_with("ReadLocations", '{"DryRun": false}') + + def test_create_node(self): + image = Mock(id="ami-1") + expected = Mock() + self.driver._to_node = Mock(return_value=expected) + self._set_response({"Vms": [{"VmId": "vm-1"}]}) + + result = self.driver.create_node(name=None, size=None, image=image) + + self.assertEqual(result, expected) + action, data = self.driver._call_api.call_args.args + self.assertEqual(action, "CreateVms") + self.assertEqual(json.loads(data)["ImageId"], image.id) + + def test_node_power_operations(self): + node = Mock(id="vm-1") + operations = { + "reboot_node": "RebootVms", + "start_node": "StartVms", + "stop_node": "StopVms", + } + + for method_name, action in operations.items(): + with self.subTest(method=method_name): + self._set_response({}) + result = getattr(self.driver, method_name)(node) + + self.assertTrue(result) + actual_action, data = self.driver._call_api.call_args.args + self.assertEqual(actual_action, action) + self.assertEqual(json.loads(data)["VmIds"], [node.id]) + + def test_list_nodes(self): + expected = [Mock()] + self.driver._to_nodes = Mock(return_value=expected) + self._set_response({"Vms": [{"VmId": "vm-1"}]}) + + result = self.driver.list_nodes() + + self.assertEqual(result, expected) + self.driver._to_nodes.assert_called_once_with([{"VmId": "vm-1"}]) + self.driver._call_api.assert_called_once_with("ReadVms", "{}") + + def test_destroy_node(self): + node = Mock(id="vm-1") + self._set_response({}) + + self.assertTrue(self.driver.destroy_node(node)) + + action, data = self.driver._call_api.call_args.args + self.assertEqual(action, "DeleteVms") + self.assertEqual(json.loads(data)["VmIds"], node.id) + + def test_create_image(self): + node = Mock(id="vm-1") + expected = Mock() + self.driver._to_node_image = Mock(return_value=expected) + self._set_response({"Image": {"ImageId": "ami-1"}}) + + result = self.driver.create_image(node, "image-name", "description") + + self.assertEqual(result, expected) + action, data = self.driver._call_api.call_args.args + self.assertEqual(action, "CreateImage") + self.assertEqual(json.loads(data)["VmId"], node.id) + + def test_list_images(self): + images = [{"ImageId": "ami-1"}] + self._set_response({"Images": images}) + + self.assertEqual(self.driver.list_images(), images) + self.assertEqual(self.driver._call_api.call_args.args[0], "ReadImages") + + def test_get_image(self): + expected = Mock() + self.driver._to_node_image = Mock(return_value=expected) + self._set_response({"Images": [{"ImageId": "ami-1"}]}) + + result = self.driver.get_image("ami-1") + + self.assertEqual(result, expected) + self.driver._to_node_image.assert_called_once_with({"ImageId": "ami-1"}) + + def test_delete_image(self): + image = Mock(id="ami-1") + self._set_response({}) + + self.assertTrue(self.driver.delete_image(image)) + + action, data = self.driver._call_api.call_args.args + self.assertEqual(action, "DeleteImage") + self.assertEqual(json.loads(data)["ImageId"], image.id) + + def test_create_key_pair(self): + expected = Mock() + self.driver._to_key_pair = Mock(return_value=expected) + self._set_response({"Keypair": {"KeypairName": "key-name"}}) + + result = self.driver.create_key_pair("key-name") + + self.assertEqual(result, expected) + self.driver._to_key_pair.assert_called_once_with({"KeypairName": "key-name"}) + + def test_list_key_pairs(self): + expected = [Mock()] + self.driver._to_key_pairs = Mock(return_value=expected) + self._set_response({"Keypairs": [{"KeypairName": "key-name"}]}) + + result = self.driver.list_key_pairs() + + self.assertEqual(result, expected) + self.driver._to_key_pairs.assert_called_once_with([{"KeypairName": "key-name"}]) + + def test_get_key_pair(self): + expected = Mock() + self.driver._to_key_pair = Mock(return_value=expected) + self._set_response({"Keypairs": [{"KeypairName": "key-name"}]}) + + result = self.driver.get_key_pair("key-name") + + self.assertEqual(result, expected) + self.driver._to_key_pair.assert_called_once_with({"KeypairName": "key-name"}) + + def test_delete_key_pair(self): + key_pair = Mock(name="key-name") + key_pair.name = "key-name" + self._set_response({}) + + self.assertTrue(self.driver.delete_key_pair(key_pair)) + + action, data = self.driver._call_api.call_args.args + self.assertEqual(action, "DeleteKeypair") + self.assertEqual(json.loads(data)["KeypairName"], key_pair.name) + + def test_create_volume_snapshot(self): + volume = Mock(id="vol-1") + expected = Mock() + self.driver._to_snapshot = Mock(return_value=expected) + self._set_response({"Volume": {"SnapshotId": "snap-1"}}) + + result = self.driver.create_volume_snapshot(volume, name="snapshot") + + self.assertEqual(result, expected) + action, data = self.driver._call_api.call_args.args + self.assertEqual(action, "CreateSnapshot") + self.assertEqual(json.loads(data)["VolumeId"], volume.id) + + def test_list_volume_snapshots(self): + volume = Mock(id="vol-1") + expected = [Mock()] + self.driver._to_snapshots = Mock(return_value=expected) + self._set_response({"Snapshots": [{"SnapshotId": "snap-1"}]}) + + result = self.driver.list_volume_snapshots(volume) + + self.assertEqual(result, expected) + action, data = self.driver._call_api.call_args.args + self.assertEqual(action, "ReadSnapshots") + self.assertEqual(data["Filters"]["VolumeIds"], [volume.id]) + + def test_destroy_volume_snapshot(self): + snapshot = Mock(id="snap-1") + self._set_response({}) + + self.assertTrue(self.driver.destroy_volume_snapshot(snapshot)) + + action, data = self.driver._call_api.call_args.args + self.assertEqual(action, "DeleteSnapshot") + self.assertEqual(json.loads(data)["SnapshotId"], snapshot.id) + + def test_create_volume_uses_location_as_subregion(self): + location = NodeLocation( + id="eu-west-2a", + name="eu-west-2a, France", + country="France", + driver=self.driver, + ) + expected = Mock() + self.driver._to_volume = Mock(return_value=expected) + self._set_response({"Volume": {"VolumeId": "vol-1"}}) + + result = self.driver.create_volume(size=10, name="volume", location=location) + + self.assertEqual(result, expected) + _, data = self.driver._call_api.call_args.args + self.assertEqual(json.loads(data)["SubregionName"], location.id) + + def test_create_volume_prefers_explicit_subregion(self): + location = NodeLocation( + id="eu-west-2a", + name="eu-west-2a, France", + country="France", + driver=self.driver, + ) + + self.driver.create_volume( + size=10, + name="volume", + location=location, + ex_subregion_name="eu-west-2b", + ) + + _, data = self.driver._call_api.call_args.args + self.assertEqual(json.loads(data)["SubregionName"], "eu-west-2b") + + def test_create_volume_requires_location_or_subregion(self): + with self.assertRaisesRegex(ValueError, "location or ex_subregion_name is required"): + self.driver.create_volume(size=10, name="volume") + + self.driver._call_api.assert_not_called() + + def test_list_volumes(self): + expected = [Mock()] + self.driver._to_volumes = Mock(return_value=expected) + self._set_response({"Volumes": [{"VolumeId": "vol-1"}]}) + + result = self.driver.list_volumes() + + self.assertEqual(result, expected) + self.driver._to_volumes.assert_called_once_with([{"VolumeId": "vol-1"}]) + + def test_destroy_volume(self): + volume = Mock(id="vol-1") + self._set_response({}) + + self.assertTrue(self.driver.destroy_volume(volume)) + + action, data = self.driver._call_api.call_args.args + self.assertEqual(action, "DeleteVolume") + self.assertEqual(json.loads(data)["VolumeId"], volume.id) + + def test_attach_volume(self): + node = Mock(id="vm-1") + volume = Mock(id="vol-1") + self._set_response({}) + + self.assertTrue(self.driver.attach_volume(node, volume, device="/dev/sdb")) + + action, data = self.driver._call_api.call_args.args + self.assertEqual(action, "LinkVolume") + self.assertEqual( + json.loads(data), + { + "VmId": node.id, + "VolumeId": volume.id, + "DeviceName": "/dev/sdb", + }, + ) + + def test_detach_volume(self): + volume = Mock(id="vol-1") + self._set_response({}) + + self.assertTrue(self.driver.detach_volume(volume, ex_force_unlink=True)) + + action, data = self.driver._call_api.call_args.args + self.assertEqual(action, "UnlinkVolume") + self.assertEqual(json.loads(data)["VolumeId"], volume.id) + self.assertTrue(json.loads(data)["ForceUnlink"]) + + +if __name__ == "__main__": + unittest.main() diff --git a/libcloud/test/compute/test_ovh.py b/libcloud/test/compute/test_ovh.py new file mode 100644 index 0000000000..9a2834a117 --- /dev/null +++ b/libcloud/test/compute/test_ovh.py @@ -0,0 +1,445 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import sys +import unittest +from unittest.mock import patch + +from libcloud.http import LibcloudConnection +from libcloud.test import no_internet +from libcloud.utils.py3 import httplib +from libcloud.compute.base import NodeAuthSSHKey +from libcloud.test.secrets import OVH_PARAMS +from libcloud.common.exceptions import BaseHTTPError +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.ovh import OvhNodeDriver +from libcloud.test.common.test_ovh import BaseOvhMockHttp + + +class OvhMockHttp(BaseOvhMockHttp): + """Fixtures needed for tests related to rating model""" + + fixtures = ComputeFileFixtures("ovh") + + def _json_1_0_auth_time_get(self, method, url, body, headers): + body = self.fixtures.load("auth_time_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_region_get(self, method, url, body, headers): + body = self.fixtures.load("region_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_flavor_get(self, method, url, body, headers): + body = self.fixtures.load("flavor_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_flavor_region_SBG1_get(self, method, url, body, headers): + body = self.fixtures.load("flavor_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_flavor_foo_id_get(self, method, url, body, headers): + body = self.fixtures.load("flavor_get_detail.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_image_get(self, method, url, body, headers): + body = self.fixtures.load("image_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_image_foo_id_get(self, method, url, body, headers): + body = self.fixtures.load("image_get_detail.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_sshkey_region_SBG1_get(self, method, url, body, headers): + body = self.fixtures.load("ssh_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_sshkey_post(self, method, url, body, headers): + body = self.fixtures.load("ssh_get_detail.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_ssh_mykey_get(self, method, url, body, headers): + body = self.fixtures.load("ssh_get_detail.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_instance_get(self, method, url, body, headers): + body = self.fixtures.load("instance_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_instance_foo_get(self, method, url, body, headers): + body = self.fixtures.load("instance_get_detail.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_instance_foo_delete(self, method, url, body, headers): + return (httplib.OK, "", {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_instance_post(self, method, url, body, headers): + body = self.fixtures.load("instance_get_detail.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_volume_get(self, method, url, body, headers): + body = self.fixtures.load("volume_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_volume_post(self, method, url, body, headers): + body = self.fixtures.load("volume_get_detail.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_volume_foo_get(self, method, url, body, headers): + body = self.fixtures.load("volume_get_detail.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_volume_foo_delete(self, method, url, body, headers): + return (httplib.OK, "", {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_volume_foo_attach_post(self, method, url, body, headers): + body = self.fixtures.load("volume_get_detail.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_volume_foo_detach_post(self, method, url, body, headers): + body = self.fixtures.load("volume_get_detail.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_volume_snapshot_region_SBG_1_get( + self, method, url, body, headers + ): + body = self.fixtures.load("volume_snapshot_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_volume_snapshot_get(self, method, url, body, headers): + body = self.fixtures.load("volume_snapshot_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_volume_snapshot_foo_get( + self, method, url, body, headers + ): + body = self.fixtures.load("volume_snapshot_get_details.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_volume_snapshot_foo_snap_delete( + self, method, url, body, headers + ): + return (httplib.OK, None, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_volume_foo_snapshot__post( + self, method, url, body, headers + ): + body = self.fixtures.load("volume_snapshot_get_details.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_subsidiaryPrice_ovhSubsidiary_US_flavorId_foo_id_get( + self, method, url, body, headers + ): + return self._json_1_0_cloud_subsidiaryPrice_flavorId_foo_id_ovhSubsidiary_US_get( + method, url, body, headers + ) + + def _json_1_0_cloud_subsidiaryPrice_flavorId_foo_id_ovhSubsidiary_US_get( + self, method, url, body, headers + ): + body = self.fixtures.load("pricing_get.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _json_1_0_cloud_project_project_id_instance_get_invalid_app_key_error( + self, method, url, body, headers + ): + body = '{"message":"Invalid application key"}' + return (httplib.UNAUTHORIZED, body, {}, httplib.responses[httplib.OK]) + + +@patch("libcloud.common.ovh.OvhConnection._timedelta", 42) +class OvhTests(unittest.TestCase): + def setUp(self): + OvhNodeDriver.connectionCls.conn_class = OvhMockHttp + OvhMockHttp.type = None + self.driver = OvhNodeDriver(*OVH_PARAMS) + + def test_region_argument(self): + driver = OvhNodeDriver(*OVH_PARAMS) + self.assertEqual(driver.connection.host, "api.ovh.com") + + driver = OvhNodeDriver(*OVH_PARAMS, region=None) + self.assertEqual(driver.connection.host, "api.ovh.com") + + driver = OvhNodeDriver(*OVH_PARAMS, region="ca") + + driver = OvhNodeDriver(*OVH_PARAMS, region="eu") + self.assertEqual(driver.connection.host, "eu.api.ovh.com") + + driver = OvhNodeDriver(*OVH_PARAMS, region="ca") + self.assertEqual(driver.connection.host, "ca.api.ovh.com") + + @unittest.skipIf(no_internet(), "Internet is not reachable") + def test_list_nodes_invalid_region(self): + OvhNodeDriver.connectionCls.conn_class = LibcloudConnection + driver = OvhNodeDriver(*OVH_PARAMS, region="invalid") + + expected_msg = r"invalid region argument was passed.*Used host: invalid.api.ovh.com.*" + self.assertRaisesRegex(ValueError, expected_msg, driver.list_nodes) + + expected_msg = r"invalid region argument was passed.*Used host: invalid.api.ovh.com.*" + self.assertRaisesRegex( + ValueError, expected_msg, driver.connection.request_consumer_key, "1" + ) + + def test_invalid_application_key_correct_error(self): + OvhMockHttp.type = "invalid_app_key_error" + driver = OvhNodeDriver("appkeyinvalid", "application_secret", "project_id", "consumer_key") + + expected_msg = r"Invalid application key" + self.assertRaisesRegex(BaseHTTPError, expected_msg, driver.list_nodes) + + def test_list_locations(self): + locations = self.driver.list_locations() + self.assertTrue(len(locations) > 0) + + def test_to_location_uses_region_code_as_id_and_name(self): + location = self.driver._to_location("eu-west-par") + self.assertEqual(location.id, "eu-west-par") + self.assertEqual(location.name, "eu-west-par") + self.assertEqual(location.country, "") + + def test_list_images(self): + images = self.driver.list_images() + self.assertTrue(len(images) > 0) + + def test_get_image(self): + image = self.driver.get_image("foo-id") + self.assertEqual(image.id, "foo-id") + + def test_list_sizes(self): + sizes = self.driver.list_sizes() + self.assertTrue(len(sizes) > 0) + + def test_get_size(self): + size = self.driver.ex_get_size("foo-id") + self.assertEqual(size.id, "foo-id") + + def test_list_key_pairs(self): + keys = self.driver.list_sizes() + self.assertTrue(len(keys) > 0) + + def test_get_key_pair(self): + location = self.driver.list_locations()[0] + key = self.driver.get_key_pair("mykey", location) + self.assertEqual(key.name, "mykey") + + def test_import_key_pair_from_string(self): + location = self.driver.list_locations()[0] + key = self.driver.import_key_pair_from_string("mykey", "material", location) + self.assertEqual(key.name, "mykey") + + def test_list_nodes(self): + nodes = self.driver.list_nodes() + self.assertTrue(len(nodes) > 0) + + def test_get_node(self): + node = self.driver.ex_get_node("foo") + self.assertEqual(node.name, "test_vm") + + def test_create_node(self): + location = self.driver.list_locations()[0] + image = self.driver.list_sizes(location)[0] + size = self.driver.list_sizes(location)[0] + node = self.driver.create_node(name="test_vm", image=image, size=size, location=location) + self.assertEqual(node.name, "test_vm") + + def test_create_node_with_auth_imports_keypair(self): + location = self.driver.list_locations()[0] + image = self.driver.list_sizes(location)[0] + size = self.driver.list_sizes(location)[0] + key_pair = self.driver.list_key_pairs(location)[0] + auth = NodeAuthSSHKey("new public key") + connection_request = self.driver.connection.request + + with patch( + "libcloud.compute.drivers.ovh.get_pubkey_ssh2_fingerprint", + return_value="fingerprint", + ): + with patch("libcloud.compute.drivers.ovh.get_pubkey_comment", return_value="test"): + with patch.object(self.driver, "list_key_pairs", return_value=[]): + with patch.object( + self.driver, "import_key_pair_from_string", return_value=key_pair + ) as import_key_pair: + with patch.object(self.driver, "get_key_pair", return_value=key_pair): + with patch.object( + self.driver.connection, + "request", + wraps=connection_request, + ) as request: + self.driver.create_node( + name="test_vm", + image=image, + size=size, + location=location, + auth=auth, + ) + + import_key_pair.assert_called_once_with( + "test-fingerprint", auth.pubkey, ex_location=location + ) + self.assertEqual(request.call_args_list[-1].kwargs["data"]["sshKeyId"], "ham-id") + + def test_create_node_with_auth_existing_keypair(self): + location = self.driver.list_locations()[0] + image = self.driver.list_sizes(location)[0] + size = self.driver.list_sizes(location)[0] + key_pair = self.driver.list_key_pairs(location)[0] + auth = NodeAuthSSHKey("same key with a different comment") + connection_request = self.driver.connection.request + + with patch( + "libcloud.compute.drivers.ovh.get_pubkey_ssh2_fingerprint", + return_value="same-fingerprint", + ): + with patch.object(self.driver, "list_key_pairs", return_value=[key_pair]): + with patch.object(self.driver, "import_key_pair_from_string") as import_key_pair: + with patch.object(self.driver, "get_key_pair", return_value=key_pair): + with patch.object( + self.driver.connection, + "request", + wraps=connection_request, + ) as request: + self.driver.create_node( + name="test_vm", + image=image, + size=size, + location=location, + auth=auth, + ) + + import_key_pair.assert_not_called() + self.assertEqual(request.call_args_list[-1].kwargs["data"]["sshKeyId"], "ham-id") + + def test_create_node_rejects_auth_with_keyname(self): + location = self.driver.list_locations()[0] + image = self.driver.list_sizes(location)[0] + size = self.driver.list_sizes(location)[0] + + with self.assertRaisesRegex(AttributeError, "Cannot specify auth and ex_keyname"): + self.driver.create_node( + name="test_vm", + image=image, + size=size, + location=location, + auth=NodeAuthSSHKey("public key"), + ex_keyname="mykey", + ) + + def test_ex_find_or_import_keypair_handles_duplicate_key(self): + location = self.driver.list_locations()[0] + key_pair = self.driver.list_key_pairs(location)[0] + auth_pubkey = "public key" + + with patch( + "libcloud.compute.drivers.ovh.get_pubkey_ssh2_fingerprint", + return_value="same-fingerprint", + ): + with patch.object(self.driver, "list_key_pairs", side_effect=[[], [key_pair]]): + with patch.object( + self.driver, + "import_key_pair_from_string", + side_effect=BaseHTTPError(409, "Key already exists"), + ): + result = self.driver.ex_find_or_import_keypair_by_key_material( + location, auth_pubkey + ) + + self.assertEqual(result, {"keyName": key_pair.name, "keyId": key_pair.extra["id"]}) + + def test_ex_find_or_import_keypair_without_public_key_comment(self): + location = self.driver.list_locations()[0] + key_pair = self.driver.list_key_pairs(location)[0] + pubkey = ( + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOfbWSXOlqvYjZmRO84/lIoV4gvuX+" + "P1lLg50MMg6jZjLZIlYY081XPRmuom0xY0+BO++J2KgLl7gxJ6xMsKK2VQ+TakdfAH20" + "XfMcTohd/zVCeWsbqZQvEhVXBo4hPIktcfNz0u9Ez3EtInO+kb7raLcRhOVi9QmOkOrC" + "WtQU9mS71AWJuqI9H0YAnTiI8Hs5bn2tpMIqmTXT3g2bwywC25x1Nx9Hy0/FP+KUL6Ag" + "vDXv47l+TgSDfTBEkvq+IF1ITrnaOG+nRE02oZC6cwHYTifM/IOollkujxIQmi2Z+j66" + "OHSrjnEQugr0FqGJF2ygKfIh/i2u3fVLM60qE2NN" + ) + + with patch( + "libcloud.compute.drivers.ovh.get_pubkey_ssh2_fingerprint", + return_value="fingerprint", + ): + with patch.object(self.driver, "list_key_pairs", return_value=[]): + with patch.object( + self.driver, "import_key_pair_from_string", return_value=key_pair + ) as import_key_pair: + result = self.driver.ex_find_or_import_keypair_by_key_material(location, pubkey) + + import_key_pair.assert_called_once_with("unnamed-fingerprint", pubkey, ex_location=location) + self.assertEqual(result, {"keyName": key_pair.name, "keyId": key_pair.extra["id"]}) + + def test_resizing_node(self): + self.assertTrue(self.driver.NODE_STATE_MAP["RESIZE"]) + + def test_destroy_node(self): + node = self.driver.list_nodes()[0] + self.driver.destroy_node(node) + + def test_list_volumes(self): + volumes = self.driver.list_volumes() + self.assertTrue(len(volumes) > 0) + + def test_get_volume(self): + volume = self.driver.ex_get_volume("foo") + self.assertEqual(volume.name, "testvol") + + def test_create_volume(self): + location = self.driver.list_locations()[0] + volume = self.driver.create_volume(size=10, name="testvol", location=location) + self.assertEqual(volume.name, "testvol") + + def test_destroy_volume(self): + volume = self.driver.list_volumes()[0] + self.driver.destroy_volume(volume) + + def test_attach_volume(self): + node = self.driver.list_nodes()[0] + volume = self.driver.ex_get_volume("foo") + response = self.driver.attach_volume(node=node, volume=volume) + self.assertTrue(response) + + def test_detach_volume(self): + node = self.driver.list_nodes()[0] + volume = self.driver.ex_get_volume("foo") + response = self.driver.detach_volume(ex_node=node, volume=volume) + self.assertTrue(response) + + def test_ex_list_snapshots(self): + self.driver.ex_list_snapshots() + + def test_ex_get_volume_snapshot(self): + self.driver.ex_get_volume_snapshot("foo") + + def test_list_volume_snapshots(self): + volume = self.driver.ex_get_volume("foo") + self.driver.list_volume_snapshots(volume) + + def test_create_volume_snapshot(self): + volume = self.driver.ex_get_volume("foo") + self.driver.create_volume_snapshot(volume) + + def test_destroy_volume_snapshot(self): + snapshot = self.driver.ex_get_volume_snapshot("foo") + result = self.driver.destroy_volume_snapshot(snapshot) + self.assertTrue(result) + + def test_get_pricing(self): + self.driver.ex_get_pricing("foo-id") + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_profitbricks.py b/libcloud/test/compute/test_profitbricks.py deleted file mode 100644 index 0b7567d912..0000000000 --- a/libcloud/test/compute/test_profitbricks.py +++ /dev/null @@ -1,509 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import sys - -from libcloud.utils.py3 import httplib -from libcloud.test import MockHttp -from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.compute.types import Provider -from libcloud.compute.types import NodeState -from libcloud.compute.providers import get_driver -from libcloud.test import unittest -from libcloud.test.secrets import PROFIT_BRICKS_PARAMS - - -class ProfitBricksTests(unittest.TestCase): - - def setUp(self): - ProfitBricks = get_driver(Provider.PROFIT_BRICKS) - ProfitBricks.connectionCls.conn_classes = (None, ProfitBricksMockHttp) - self.driver = ProfitBricks(*PROFIT_BRICKS_PARAMS) - - ''' Server Function Tests - ''' - def test_list_nodes(self): - nodes = self.driver.list_nodes() - - self.assertEqual(len(nodes), 3) - - node = nodes[0] - self.assertEqual(node.id, "c8e57d7b-e731-46ad-a913-1828c0562246") - self.assertEqual(node.name, "server001") - self.assertEqual(node.state, 0) - self.assertEqual(node.public_ips, ['162.254.25.197']) - self.assertEqual(node.private_ips, ['10.10.108.12', '10.13.198.11']) - self.assertEqual(node.extra['datacenter_id'], "e1e8ec0d-b47f-4d39-a91b-6e885483c899") - self.assertEqual(node.extra['datacenter_version'], "5") - self.assertEqual(node.extra['provisioning_state'], 0) - self.assertEqual(node.extra['creation_time'], "2014-07-14T20:52:20.839Z") - self.assertEqual(node.extra['last_modification_time'], "2014-07-14T22:11:09.324Z") - self.assertEqual(node.extra['os_type'], "LINUX") - self.assertEqual(node.extra['availability_zone'], "ZONE_1") - - def test_ex_describe_node(self): - image = type('NodeImage', (object,), - dict(id="cd59b162-0289-11e4-9f63-52540066fee9", - name="Debian-7-server-2014-07-01")) - size = type('NodeSize', (object,), - dict(id="2", - name="Small Instance", - ram=2048, - disk=50, - extra={'cores': 1})) - - node = self.driver.create_node(name="SPC-Server", - image=image, - size=size) - - self.assertEqual(node.id, "7b18b85f-cc93-4c2d-abcc-5ce732d35750") - - def test_reboot_node(self): - node = type('Node', (object,), - dict(id="c8e57d7b-e731-46ad-a913-1828c0562246")) - reboot = self.driver.reboot_node(node=node) - - self.assertTrue(reboot) - - def test_ex_stop_node(self): - node = type('Node', (object,), - dict(id="c8e57d7b-e731-46ad-a913-1828c0562246")) - stop = self.driver.ex_stop_node(node=node) - - self.assertTrue(stop) - - def test_ex_start_node(self): - node = type('Node', (object,), - dict(id="c8e57d7b-e731-46ad-a913-1828c0562246")) - start = self.driver.ex_start_node(node=node) - - self.assertTrue(start) - - def test_destroy_node(self): - node = type('Node', (object,), - dict(id="c8e57d7b-e731-46ad-a913-1828c0562246")) - destroy = self.driver.destroy_node(node=node) - - self.assertTrue(destroy) - - def test_ex_update_node(self): - node = type('Node', (object,), - dict(id="c8e57d7b-e731-46ad-a913-1828c0562246")) - - zone = type('ExProfitBricksAvailabilityZone', (object,), - dict(name="ZONE_2")) - - update = self.driver.ex_update_node(node=node, ram=2048, cores=2, name="server002", availability_zone=zone) - - self.assertTrue(update) - - ''' Volume Function Tests - ''' - def test_list_volumes(self): - volumes = self.driver.list_volumes() - - self.assertEqual(len(volumes), 4) - - volume = volumes[0] - self.assertEqual(volume.id, "453582cf-8d54-4ec8-bc0b-f9962f7fd232") - self.assertEqual(volume.name, "storage001") - self.assertEqual(volume.size, 50) - self.assertEqual(volume.extra['server_id'], "ebee7d83-912b-42f1-9b62-b953351a7e29") - self.assertEqual(volume.extra['provisioning_state'], 0) - self.assertEqual(volume.extra['creation_time'], "2014-07-15T03:19:38.252Z") - self.assertEqual(volume.extra['last_modification_time'], "2014-07-15T03:28:58.724Z") - self.assertEqual(volume.extra['image_id'], "d2f627c4-0289-11e4-9f63-52540066fee9") - self.assertEqual(volume.extra['image_name'], "CentOS-6-server-2014-07-01") - self.assertEqual(volume.extra['datacenter_id'], "06eac419-c2b3-4761-aeb9-10efdd2cf292") - - def test_create_volume(self): - datacenter = type('Datacenter', (object,), - dict(id="8669a69f-2274-4520-b51e-dbdf3986a476")) - - image = type('NodeImage', (object,), - dict(id="cd59b162-0289-11e4-9f63-52540066fee9")) - - create = self.driver.create_volume(name="StackPointCloudStorage001", - size=50, - ex_datacenter=datacenter, - ex_image=image) - - self.assertTrue(create) - - def test_attach_volume_general(self): - volume = type('StorageVolume', (object,), - dict(id="8669a69f-2274-4520-b51e-dbdf3986a476")) - - node = type('Node', (object,), - dict(id="cd59b162-0289-11e4-9f63-52540066fee9")) - - attach = self.driver.attach_volume(node=node, - volume=volume, - device=None, ex_bus_type=None) - - self.assertTrue(attach) - - def test_attach_volume_device_defined(self): - volume = type('StorageVolume', (object,), - dict(id="8669a69f-2274-4520-b51e-dbdf3986a476")) - - node = type('Node', (object,), - dict(id="cd59b162-0289-11e4-9f63-52540066fee9")) - - attach = self.driver.attach_volume(node=node, volume=volume, device=1, ex_bus_type=None) - - self.assertTrue(attach) - - def test_attach_volume_bus_type_defined(self): - volume = type('StorageVolume', (object,), - dict(id="8669a69f-2274-4520-b51e-dbdf3986a476")) - - node = type('Node', (object,), - dict(id="cd59b162-0289-11e4-9f63-52540066fee9")) - - attach = self.driver.attach_volume(node=node, - volume=volume, - device=None, - ex_bus_type="IDE") - - self.assertTrue(attach) - - def test_attach_volume_options_defined(self): - volume = type('StorageVolume', (object,), - dict(id="8669a69f-2274-4520-b51e-dbdf3986a476")) - - node = type('Node', (object,), - dict(id="cd59b162-0289-11e4-9f63-52540066fee9")) - - attach = self.driver.attach_volume(node=node, volume=volume, - device=1, ex_bus_type="IDE") - - self.assertTrue(attach) - - def test_detach_volume(self): - volume = type('StorageVolume', (object,), - dict(id="8669a69f-2274-4520-b51e-dbdf3986a476", - extra={'server_id': "cd59b162-0289-11e4-9f63-52540066fee9"} - )) - - attach = self.driver.detach_volume(volume=volume) - - self.assertTrue(attach) - - def test_destroy_volume(self): - volume = type('StorageVolume', (object,), - dict(id="8669a69f-2274-4520-b51e-dbdf3986a476")) - - destroy = self.driver.destroy_volume(volume=volume) - - self.assertTrue(destroy) - - def test_update_volume(self): - volume = type('StorageVolume', (object,), - dict(id="8669a69f-2274-4520-b51e-dbdf3986a476")) - - destroy = self.driver.ex_update_volume(volume=volume) - - self.assertTrue(destroy) - - def test_ex_describe_volume(self): - describe = self.driver.ex_describe_volume(volume_id="8669a69f-2274-4520-b51e-dbdf3986a476") - - self.assertEqual(describe.id, "00d0b9e7-e016-456f-85a0-517aa9a34bf5") - self.assertEqual(describe.size, 50) - self.assertEqual(describe.name, "StackPointCloud-Volume") - self.assertEqual(describe.extra['provisioning_state'], NodeState.RUNNING) - - ''' Image Function Tests - ''' - def test_list_images(self): - images = self.driver.list_images() - - self.assertEqual(len(images), 3) - - image = images[0] - self.assertEqual(image.extra['cpu_hotpluggable'], "false") - self.assertEqual(image.id, "03b6c3e7-f2ad-11e3-a036-52540066fee9") - self.assertEqual(image.name, "windows-2012-r2-server-2014-06") - self.assertEqual(image.extra['image_size'], "11264") - self.assertEqual(image.extra['image_type'], "HDD") - self.assertEqual(image.extra['memory_hotpluggable'], "false") - self.assertEqual(image.extra['os_type'], "WINDOWS") - self.assertEqual(image.extra['public'], "true") - self.assertEqual(image.extra['location'], None) - self.assertEqual(image.extra['writeable'], "true") - - ''' Datacenter Function Tests - ''' - def test_ex_create_datacenter(self): - datacenter = self.driver.ex_create_datacenter(name="StackPointCloud", - location="us/la") - - self.assertEqual(datacenter.id, '0c793dd1-d4cd-4141-86f3-8b1a24b2d604') - self.assertEqual(datacenter.extra['location'], 'us/las') - self.assertEqual(datacenter.version, '1') - - def test_ex_destroy_datacenter(self): - datacenter = type('Datacenter', (object,), - dict(id="8669a69f-2274-4520-b51e-dbdf3986a476")) - destroy = self.driver.ex_destroy_datacenter(datacenter=datacenter) - - self.assertTrue(destroy) - - def test_ex_describe_datacenter(self): - datacenter = type('Datacenter', (object,), - dict(id="d96dfafc-9a8c-4c0e-8a0c-857a15db572d")) - describe = self.driver.ex_describe_datacenter(datacenter_id=datacenter.id) - - self.assertEqual(describe.id, 'a3e6f83a-8982-4d6a-aebc-60baf5755ede') - self.assertEqual(describe.name, 'StackPointCloud') - self.assertEqual(describe.version, '1') - self.assertEqual(describe.extra['location'], 'us/las') - self.assertEqual(describe.extra['provisioning_state'], NodeState.RUNNING) - - def test_ex_clear_datacenter(self): - datacenter = type('Datacenter', (object,), - dict(id="8669a69f-2274-4520-b51e-dbdf3986a476")) - clear = self.driver.ex_clear_datacenter(datacenter=datacenter) - - self.assertTrue(clear) - - def test_ex_list_datacenters(self): - datacenters = self.driver.ex_list_datacenters() - - self.assertEqual(len(datacenters), 2) - - dc1 = datacenters[0] - self.assertEqual(dc1.id, "a3e6f83a-8982-4d6a-aebc-60baf5755ede") - self.assertEqual(dc1.name, "StackPointCloud") - self.assertEqual(dc1.version, "1") - - def test_ex_rename_datacenter(self): - datacenter = type('Datacenter', (object,), - dict(id="d96dfafc-9a8c-4c0e-8a0c-857a15db572d")) - - update = self.driver.ex_rename_datacenter(datacenter=datacenter, - name="StackPointCloud") - - self.assertTrue(update) - - def test_list_locations(self): - locations = self.driver.list_locations() - self.assertEqual(len(locations), 3) - - locationNamesResult = sorted(list(a.name for a in locations)) - locationNamesExpected = ['de/fkb', 'de/fra', 'us/las'] - - self.assertEqual(locationNamesResult, locationNamesExpected) - - ''' Availability Zone Tests - ''' - - def test_ex_list_availability_zones(self): - zones = self.driver.ex_list_availability_zones() - self.assertEqual(len(zones), 3) - - zoneNamesResult = sorted(list(a.name for a in zones)) - zoneNamesExpected = ['AUTO', 'ZONE_1', 'ZONE_2'] - - self.assertEqual(zoneNamesResult, zoneNamesExpected) - - ''' Interface Tests - ''' - - def test_ex_list_interfaces(self): - interfaces = self.driver.ex_list_network_interfaces() - - self.assertEqual(len(interfaces), 3) - - interface = interfaces[0] - self.assertEqual(interface.id, "6b38a4f3-b851-4614-9e3a-5ddff4727727") - self.assertEqual(interface.name, "StackPointCloud") - self.assertEqual(interface.state, 0) - self.assertEqual(interface.extra['server_id'], "234f0cf9-1efc-4ade-b829-036456584116") - self.assertEqual(interface.extra['lan_id'], '3') - self.assertEqual(interface.extra['internet_access'], 'false') - self.assertEqual(interface.extra['mac_address'], "02:01:40:47:90:04") - self.assertEqual(interface.extra['dhcp_active'], "true") - self.assertEqual(interface.extra['gateway_ip'], None) - self.assertEqual(interface.extra['ips'], ['10.14.96.11', '162.254.26.14', '162.254.26.15']) - - def test_ex_create_network_interface(self): - node = type('Node', (object,), - dict(id="cd59b162-0289-11e4-9f63-52540066fee9")) - - interface = self.driver.ex_create_network_interface(node=node) - self.assertEqual(interface.id, '6b38a4f3-b851-4614-9e3a-5ddff4727727') - - def test_ex_destroy_network_interface(self): - network_interface = type('ProfitBricksNetworkInterface', (object,), - dict( - id="cd59b162-0289-11e4-9f63-52540066fee9")) - - destroy = self.driver.ex_destroy_network_interface( - network_interface=network_interface) - - self.assertTrue(destroy) - - def test_ex_update_network_interface(self): - network_interface = type('ProfitBricksNetworkInterface', (object,), - dict( - id="cd59b162-0289-11e4-9f63-52540066fee9")) - - create = self.driver.ex_update_network_interface( - network_interface=network_interface) - - self.assertTrue(create) - - def test_ex_describe_network_interface(self): - network_interface = type('ProfitBricksNetworkInterface', (object,), - dict( - id="cd59b162-0289-11e4-9f63-52540066fee9")) - - describe = self.driver.ex_describe_network_interface(network_interface=network_interface) - - self.assertEqual(describe.id, "f1c7a244-2fa6-44ee-8fb6-871f337683a3") - self.assertEqual(describe.name, None) - self.assertEqual(describe.state, 0) - self.assertEqual(describe.extra['datacenter_id'], "a3a2e730-0dc3-47e6-bac6-4c056d5e2aee") - self.assertEqual(describe.extra['datacenter_version'], "6") - self.assertEqual(describe.extra['server_id'], "c09f4f31-336c-4ad2-9ec7-591778513408") - self.assertEqual(describe.extra['lan_id'], "1") - self.assertEqual(describe.extra['internet_access'], "false") - self.assertEqual(describe.extra['mac_address'], "02:01:96:d7:60:e0") - self.assertEqual(describe.extra['dhcp_active'], "true") - self.assertEqual(describe.extra['gateway_ip'], None) - self.assertEqual(describe.extra['ips'], ['10.10.38.12']) - - def test_list_sizes(self): - sizes = self.driver.list_sizes() - - self.assertEqual(len(sizes), 7) - - -class ProfitBricksMockHttp(MockHttp): - - fixtures = ComputeFileFixtures('profitbricks') - - def _1_3_clearDataCenter(self, method, url, body, headers): - body = self.fixtures.load('ex_clear_datacenter.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_createDataCenter(self, method, url, body, headers): - body = self.fixtures.load('ex_create_datacenter.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_deleteDataCenter(self, method, url, body, headers): - body = self.fixtures.load('ex_destroy_datacenter.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_getDataCenter(self, method, url, body, headers): - body = self.fixtures.load('ex_describe_datacenter.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_getAllDataCenters(self, method, url, body, headers): - body = self.fixtures.load('ex_list_datacenters.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_updateDataCenter(self, method, url, body, headers): - body = self.fixtures.load('ex_update_datacenter.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_getAllImages(self, method, url, body, headers): - body = self.fixtures.load('list_images.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_getAllServers(self, method, url, body, headers): - body = self.fixtures.load('list_nodes.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_resetServer(self, method, url, body, headers): - body = self.fixtures.load('reboot_node.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_stopServer(self, method, url, body, headers): - body = self.fixtures.load('ex_stop_node.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_startServer(self, method, url, body, headers): - body = self.fixtures.load('ex_start_node.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_deleteServer(self, method, url, body, headers): - body = self.fixtures.load('destroy_node.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_getAllStorages(self, method, url, body, headers): - body = self.fixtures.load('list_volumes.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_createStorage(self, method, url, body, headers): - body = self.fixtures.load('create_volume.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_connectStorageToServer(self, method, url, body, headers): - body = self.fixtures.load('attach_volume.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_disconnectStorageFromServer(self, method, url, body, headers): - body = self.fixtures.load('detach_volume.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_deleteStorage(self, method, url, body, headers): - body = self.fixtures.load('destroy_volume.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_updateStorage(self, method, url, body, headers): - body = self.fixtures.load('ex_update_volume.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_updateServer(self, method, url, body, headers): - body = self.fixtures.load('ex_update_node.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_getNic(self, method, url, body, headers): - body = self.fixtures.load('ex_describe_network_interface.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_getAllNic(self, method, url, body, headers): - body = self.fixtures.load('ex_list_network_interfaces.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_createNic(self, method, url, body, headers): - body = self.fixtures.load('ex_list_network_interfaces.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_deleteNic(self, method, url, body, headers): - body = self.fixtures.load('ex_destroy_network_interface.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_updateNic(self, method, url, body, headers): - body = self.fixtures.load('ex_update_network_interface.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_getServer(self, method, url, body, headers): - body = self.fixtures.load('ex_describe_node.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_getStorage(self, method, url, body, headers): - body = self.fixtures.load('ex_describe_volume.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _1_3_createServer(self, method, url, body, headers): - body = self.fixtures.load('create_node.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_rackspace.py b/libcloud/test/compute/test_rackspace.py index e24b87301f..1a05b5ae91 100644 --- a/libcloud/test/compute/test_rackspace.py +++ b/libcloud/test/compute/test_rackspace.py @@ -15,19 +15,25 @@ import sys import unittest -from libcloud.utils.py3 import method_type -from libcloud.utils.py3 import httplib -from libcloud.compute.providers import DEPRECATED_RACKSPACE_PROVIDERS -from libcloud.compute.providers import get_driver -from libcloud.compute.drivers.rackspace import RackspaceFirstGenNodeDriver -from libcloud.compute.drivers.rackspace import RackspaceNodeDriver -from libcloud.test.compute.test_openstack import OpenStack_1_0_Tests -from libcloud.test.compute.test_openstack import OpenStack_1_1_Tests, \ - OpenStack_1_1_MockHttp from libcloud.pricing import clear_pricing_data - -from libcloud.test.secrets import RACKSPACE_NOVA_PARAMS -from libcloud.test.secrets import RACKSPACE_PARAMS +from libcloud.utils.py3 import httplib, method_type +from libcloud.test.secrets import RACKSPACE_PARAMS, RACKSPACE_NOVA_PARAMS +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver +from libcloud.compute.drivers.rackspace import RackspaceNodeDriver, RackspaceFirstGenNodeDriver +from libcloud.test.compute.test_openstack import ( + OpenStack_1_0_Tests, + OpenStack_1_1_Tests, + OpenStack_1_1_MockHttp, +) + +DEPRECATED_RACKSPACE_PROVIDERS = [ + Provider.RACKSPACE_UK, + Provider.RACKSPACE_NOVA_BETA, + Provider.RACKSPACE_NOVA_DFW, + Provider.RACKSPACE_NOVA_LON, + Provider.RACKSPACE_NOVA_ORD, +] class RackspaceusFirstGenUsTests(OpenStack_1_0_Tests): @@ -37,17 +43,16 @@ class RackspaceusFirstGenUsTests(OpenStack_1_0_Tests): driver_klass = RackspaceFirstGenNodeDriver driver_type = RackspaceFirstGenNodeDriver driver_args = RACKSPACE_PARAMS - driver_kwargs = {'region': 'us'} + driver_kwargs = {"region": "us"} def test_error_is_thrown_on_accessing_old_constant(self): for provider in DEPRECATED_RACKSPACE_PROVIDERS: try: get_driver(provider) - except Exception: - e = sys.exc_info()[1] - self.assertTrue(str(e).find('has been removed') != -1) + except Exception as e: + self.assertTrue(str(e).find("has been removed") != -1) else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_list_sizes_pricing(self): sizes = self.driver.list_sizes() @@ -63,7 +68,7 @@ class RackspaceusFirstGenUkTests(OpenStack_1_0_Tests): driver_klass = RackspaceFirstGenNodeDriver driver_type = RackspaceFirstGenNodeDriver driver_args = RACKSPACE_PARAMS - driver_kwargs = {'region': 'uk'} + driver_kwargs = {"region": "uk"} def test_list_sizes_pricing(self): sizes = self.driver.list_sizes() @@ -73,72 +78,82 @@ def test_list_sizes_pricing(self): class RackspaceNovaMockHttp(OpenStack_1_1_MockHttp): - def __init__(self, *args, **kwargs): - super(RackspaceNovaMockHttp, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) methods1 = OpenStack_1_1_MockHttp.__dict__ - names1 = [m for m in methods1 if m.find('_v1_1') == 0] + names1 = [m for m in methods1 if m.find("_v1_1") == 0] for name in names1: method = methods1[name] - new_name = name.replace('_v1_1_slug_', '_v2_1337_') - setattr(self, new_name, method_type(method, self, - RackspaceNovaMockHttp)) + new_name = name.replace("_v1_1_slug_", "_v2_1337_") + setattr(self, new_name, method_type(method, self, RackspaceNovaMockHttp)) def _v2_1337_os_networksv2(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('_os_networks.json') - return (httplib.OK, body, self.json_content_headers, - httplib.responses[httplib.OK]) - elif method == 'POST': - body = self.fixtures.load('_os_networks_POST.json') - return (httplib.ACCEPTED, body, self.json_content_headers, - httplib.responses[httplib.OK]) + if method == "GET": + body = self.fixtures.load("_os_networks.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) + elif method == "POST": + body = self.fixtures.load("_os_networks_POST.json") + return ( + httplib.ACCEPTED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) raise NotImplementedError() - def _v2_1337_os_networksv2_f13e5051_feea_416b_827a_1a0acc2dad14(self, - method, - url, body, - headers): - if method == 'DELETE': - body = '' - return (httplib.ACCEPTED, body, self.json_content_headers, - httplib.responses[httplib.OK]) + def _v2_1337_os_networksv2_f13e5051_feea_416b_827a_1a0acc2dad14( + self, method, url, body, headers + ): + if method == "DELETE": + body = "" + return ( + httplib.ACCEPTED, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) raise NotImplementedError() class RackspaceNovaLonMockHttp(RackspaceNovaMockHttp): - def _v2_0_tokens(self, method, url, body, headers): - body = self.auth_fixtures.load('_v2_0__auth_lon.json') - return (httplib.OK, body, self.json_content_headers, - httplib.responses[httplib.OK]) + body = self.auth_fixtures.load("_v2_0__auth_lon.json") + return ( + httplib.OK, + body, + self.json_content_headers, + httplib.responses[httplib.OK], + ) # Does not derive from TestCase because it should not be used by setup.py test -class BaseRackspaceNovaTestCase(object): - conn_classes = (RackspaceNovaMockHttp, RackspaceNovaMockHttp) - auth_url = 'https://auth.api.example.com' +class BaseRackspaceNovaTestCase: + conn_class = RackspaceNovaMockHttp + auth_url = "https://auth.api.example.com" def create_driver(self): return self.driver_type(*self.driver_args, **self.driver_kwargs) def setUp(self): - self.driver_klass.connectionCls.conn_classes = self.conn_classes + self.driver_klass.connectionCls.conn_class = self.conn_class self.driver_klass.connectionCls.auth_url = self.auth_url - self.conn_classes[0].type = None - self.conn_classes[1].type = None + self.conn_class.type = None self.driver = self.create_driver() # normally authentication happens lazily, but we force it here self.driver.connection._populate_hosts_and_request_paths() clear_pricing_data() self.node = self.driver.list_nodes()[1] - def test_service_catalog_contais_right_endpoint(self): - self.assertEqual(self.driver.connection.get_endpoint(), - self.expected_endpoint) + def test_service_catalog_contains_right_endpoint(self): + self.assertEqual(self.driver.connection.get_endpoint(), self.expected_endpoint) def test_list_sizes_pricing(self): sizes = self.driver.list_sizes() @@ -149,66 +164,61 @@ def test_list_sizes_pricing(self): class RackspaceNovaDfwTests(BaseRackspaceNovaTestCase, OpenStack_1_1_Tests): - driver_klass = RackspaceNodeDriver driver_type = RackspaceNodeDriver driver_args = RACKSPACE_NOVA_PARAMS - driver_kwargs = {'region': 'dfw'} + driver_kwargs = {"region": "dfw"} - expected_endpoint = 'https://dfw.servers.api.rackspacecloud.com/v2/1337' + expected_endpoint = "https://dfw.servers.api.rackspacecloud.com/v2/1337" class RackspaceNovaOrdTests(BaseRackspaceNovaTestCase, OpenStack_1_1_Tests): - driver_klass = RackspaceNodeDriver driver_type = RackspaceNodeDriver driver_args = RACKSPACE_NOVA_PARAMS - driver_kwargs = {'region': 'ord'} + driver_kwargs = {"region": "ord"} - expected_endpoint = 'https://ord.servers.api.rackspacecloud.com/v2/1337' + expected_endpoint = "https://ord.servers.api.rackspacecloud.com/v2/1337" class RackspaceNovaIadTests(BaseRackspaceNovaTestCase, OpenStack_1_1_Tests): - driver_klass = RackspaceNodeDriver driver_type = RackspaceNodeDriver driver_args = RACKSPACE_NOVA_PARAMS - driver_kwargs = {'region': 'iad'} + driver_kwargs = {"region": "iad"} - expected_endpoint = 'https://iad.servers.api.rackspacecloud.com/v2/1337' + expected_endpoint = "https://iad.servers.api.rackspacecloud.com/v2/1337" class RackspaceNovaLonTests(BaseRackspaceNovaTestCase, OpenStack_1_1_Tests): - driver_klass = RackspaceNodeDriver driver_type = RackspaceNodeDriver driver_args = RACKSPACE_NOVA_PARAMS - driver_kwargs = {'region': 'lon'} + driver_kwargs = {"region": "lon"} - conn_classes = (RackspaceNovaLonMockHttp, RackspaceNovaLonMockHttp) - auth_url = 'https://lon.auth.api.example.com' + conn_class = RackspaceNovaLonMockHttp + auth_url = "https://lon.auth.api.example.com" - expected_endpoint = 'https://lon.servers.api.rackspacecloud.com/v2/1337' + expected_endpoint = "https://lon.servers.api.rackspacecloud.com/v2/1337" class RackspaceNovaSydTests(BaseRackspaceNovaTestCase, OpenStack_1_1_Tests): - driver_klass = RackspaceNodeDriver driver_type = RackspaceNodeDriver driver_args = RACKSPACE_NOVA_PARAMS - driver_kwargs = {'region': 'syd'} + driver_kwargs = {"region": "syd"} - expected_endpoint = 'https://syd.servers.api.rackspacecloud.com/v2/1337' + expected_endpoint = "https://syd.servers.api.rackspacecloud.com/v2/1337" class RackspaceNovaHkgTests(BaseRackspaceNovaTestCase, OpenStack_1_1_Tests): - driver_klass = RackspaceNodeDriver driver_type = RackspaceNodeDriver driver_args = RACKSPACE_NOVA_PARAMS - driver_kwargs = {'region': 'hkg'} + driver_kwargs = {"region": "hkg"} + + expected_endpoint = "https://hkg.servers.api.rackspacecloud.com/v2/1337" - expected_endpoint = 'https://hkg.servers.api.rackspacecloud.com/v2/1337' -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_rimuhosting.py b/libcloud/test/compute/test_rimuhosting.py index f8eb3ab16b..3af9fddaed 100644 --- a/libcloud/test/compute/test_rimuhosting.py +++ b/libcloud/test/compute/test_rimuhosting.py @@ -16,21 +16,18 @@ import sys import unittest -from libcloud.utils.py3 import httplib - -from libcloud.compute.drivers.rimuhosting import RimuHostingNodeDriver from libcloud.test import MockHttp +from libcloud.utils.py3 import httplib from libcloud.test.compute import TestCaseMixin from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.rimuhosting import RimuHostingNodeDriver class RimuHostingTest(unittest.TestCase, TestCaseMixin): - def setUp(self): - RimuHostingNodeDriver.connectionCls.conn_classes = (None, - RimuHostingMockHttp) - self.driver = RimuHostingNodeDriver('foo') + RimuHostingNodeDriver.connectionCls.conn_class = RimuHostingMockHttp + self.driver = RimuHostingNodeDriver("foo") def test_list_nodes(self): nodes = self.driver.list_nodes() @@ -38,7 +35,7 @@ def test_list_nodes(self): node = nodes[0] self.assertEqual(node.public_ips[0], "1.2.3.4") self.assertEqual(node.public_ips[1], "1.2.3.5") - self.assertEqual(node.extra['order_oid'], 88833465) + self.assertEqual(node.extra["order_oid"], 88833465) self.assertEqual(node.id, "order-88833465-api-ivan-net-nz") def test_list_sizes(self): @@ -54,8 +51,7 @@ def test_list_images(self): images = self.driver.list_images() self.assertEqual(len(images), 6) image = images[0] - self.assertEqual(image.name, "Debian 5.0 (aka Lenny, RimuHosting" - " recommended distro)") + self.assertEqual(image.name, "Debian 5.0 (aka Lenny, RimuHosting" " recommended distro)") self.assertEqual(image.id, "lenny") def test_reboot_node(self): @@ -76,38 +72,34 @@ def test_create_node(self): class RimuHostingMockHttp(MockHttp): - - fixtures = ComputeFileFixtures('rimuhosting') + fixtures = ComputeFileFixtures("rimuhosting") def _r_orders(self, method, url, body, headers): - body = self.fixtures.load('r_orders.json') + body = self.fixtures.load("r_orders.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _r_pricing_plans(self, method, url, body, headers): - body = self.fixtures.load('r_pricing_plans.json') + body = self.fixtures.load("r_pricing_plans.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _r_distributions(self, method, url, body, headers): - body = self.fixtures.load('r_distributions.json') + body = self.fixtures.load("r_distributions.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _r_orders_new_vps(self, method, url, body, headers): - body = self.fixtures.load('r_orders_new_vps.json') + body = self.fixtures.load("r_orders_new_vps.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _r_orders_order_88833465_api_ivan_net_nz_vps(self, method, url, body, headers): - body = self.fixtures.load( - 'r_orders_order_88833465_api_ivan_net_nz_vps.json') + body = self.fixtures.load("r_orders_order_88833465_api_ivan_net_nz_vps.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _r_orders_order_88833465_api_ivan_net_nz_vps_running_state( - self, method, - url, body, - headers): - body = self.fixtures.load( - 'r_orders_order_88833465_api_ivan_net_nz_vps_running_state.json') + self, method, url, body, headers + ): + body = self.fixtures.load("r_orders_order_88833465_api_ivan_net_nz_vps_running_state.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_scaleway.py b/libcloud/test/compute/test_scaleway.py new file mode 100644 index 0000000000..eb3c1b563e --- /dev/null +++ b/libcloud/test/compute/test_scaleway.py @@ -0,0 +1,321 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import sys +import unittest +from datetime import datetime + +from libcloud.test import MockHttp, LibcloudTestCase +from libcloud.utils.py3 import httplib, assertRaisesRegex +from libcloud.compute.base import NodeImage +from libcloud.test.secrets import SCALEWAY_PARAMS +from libcloud.utils.iso8601 import UTC +from libcloud.common.exceptions import BaseHTTPError +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.scaleway import ScalewayNodeDriver + +try: + import simplejson as json +except ImportError: + import json # NOQA + + +# class ScalewayTests(unittest.TestCase, TestCaseMixin): +class Scaleway_Tests(LibcloudTestCase): + def setUp(self): + ScalewayNodeDriver.connectionCls.conn_class = ScalewayMockHttp + ScalewayMockHttp.type = None + self.driver = ScalewayNodeDriver(*SCALEWAY_PARAMS) + + def test_authentication(self): + ScalewayMockHttp.type = "UNAUTHORIZED" + assertRaisesRegex(self, BaseHTTPError, "Authentication error", self.driver.list_nodes) + + def test_list_locations_success(self): + locations = self.driver.list_locations() + self.assertTrue(len(locations) >= 1) + + location = locations[0] + self.assertEqual(location.id, "par1") + self.assertEqual(location.name, "Paris 1") + + def test_list_sizes_success(self): + sizes = self.driver.list_sizes() + self.assertTrue(len(sizes) >= 1) + + size = sizes[0] + self.assertTrue(size.id is not None) + self.assertEqual(size.name, "ARM64-4GB") + self.assertEqual(size.ram, 4096) + + size = sizes[1] + self.assertTrue(size.id is not None) + self.assertEqual(size.name, "START1-XS") + self.assertEqual(size.ram, 1024) + + size = sizes[2] + self.assertTrue(size.id is not None) + self.assertEqual(size.name, "X64-120GB") + self.assertEqual(size.ram, 122880) + + def test_list_images_success(self): + images = self.driver.list_images() + self.assertTrue(len(images) >= 1) + + image = images[0] + self.assertTrue(image.id is not None) + self.assertTrue(image.name is not None) + + def test_create_image_success(self): + node = self.driver.list_nodes()[0] + ScalewayMockHttp.type = "POST" + image = self.driver.create_image(node, "my_image") + self.assertEqual(image.name, "my_image") + self.assertEqual(image.id, "98bf3ac2-a1f5-471d-8c8f-1b706ab57ef0") + self.assertEqual(image.extra["arch"], "arm") + + def test_delete_image_success(self): + image = self.driver.get_image(12345) + ScalewayMockHttp.type = "DELETE" + result = self.driver.delete_image(image) + self.assertTrue(result) + + def test_get_image_success(self): + image = self.driver.get_image(12345) + self.assertEqual(image.name, "my_image") + self.assertEqual(image.id, "12345") + self.assertEqual(image.extra["arch"], "arm") + + def test_list_nodes_success(self): + nodes = self.driver.list_nodes() + self.assertEqual(len(nodes), 2) + self.assertEqual(nodes[0].name, "my_server") + self.assertEqual(nodes[0].public_ips, []) + self.assertEqual( + nodes[0].extra["volumes"]["0"]["id"], "c1eb8f3a-4f0b-4b95-a71c-93223e457f5a" + ) + self.assertEqual(nodes[0].extra["organization"], "000a115d-2852-4b0a-9ce8-47f1134ba95a") + + def test_list_nodes_fills_created_datetime(self): + nodes = self.driver.list_nodes() + self.assertEqual(nodes[0].created_at, datetime(2014, 5, 22, 12, 57, 22, 514298, tzinfo=UTC)) + + def test_create_node_success(self): + image = self.driver.list_images()[0] + size = self.driver.list_sizes()[0] + location = self.driver.list_locations()[0] + + ScalewayMockHttp.type = "POST" + node = self.driver.create_node(name="test", size=size, image=image, region=location) + self.assertEqual(node.name, "my_server") + self.assertEqual(node.public_ips, []) + self.assertEqual(node.extra["volumes"]["0"]["id"], "d9257116-6919-49b4-a420-dcfdff51fcb1") + self.assertEqual(node.extra["organization"], "000a115d-2852-4b0a-9ce8-47f1134ba95a") + + def test_create_node_invalid_size(self): + image = NodeImage(id="01234567-89ab-cdef-fedc-ba9876543210", name=None, driver=self.driver) + size = self.driver.list_sizes()[0] + location = self.driver.list_locations()[0] + + ScalewayMockHttp.type = "INVALID_IMAGE" + expected_msg = '" not found' + assertRaisesRegex( + self, + Exception, + expected_msg, + self.driver.create_node, + name="test", + size=size, + image=image, + region=location, + ) + + def test_reboot_node_success(self): + node = self.driver.list_nodes()[0] + ScalewayMockHttp.type = "REBOOT" + result = self.driver.reboot_node(node) + self.assertTrue(result) + + def test_destroy_node_success(self): + node = self.driver.list_nodes()[0] + ScalewayMockHttp.type = "TERMINATE" + result = self.driver.destroy_node(node) + self.assertTrue(result) + + def test_list_volumes(self): + volumes = self.driver.list_volumes() + self.assertEqual(len(volumes), 2) + volume = volumes[0] + self.assertEqual(volume.id, "f929fe39-63f8-4be8-a80e-1e9c8ae22a76") + self.assertEqual(volume.name, "volume-0-1") + self.assertEqual(volume.size, 10) + self.assertEqual(volume.driver, self.driver) + + def test_list_volumes_empty(self): + ScalewayMockHttp.type = "EMPTY" + volumes = self.driver.list_volumes() + self.assertEqual(len(volumes), 0) + + def test_list_volume_snapshots(self): + volume = self.driver.list_volumes()[0] + snapshots = self.driver.list_volume_snapshots(volume) + self.assertEqual(len(snapshots), 2) + snapshot1, snapshot2 = snapshots + self.assertEqual(snapshot1.id, "6f418e5f-b42d-4423-a0b5-349c74c454a4") + self.assertEqual(snapshot2.id, "c6ff5501-eb35-44b8-aa01-8777211a830b") + + def test_create_volume(self): + par1 = [r for r in self.driver.list_locations() if r.id == "par1"][0] + ScalewayMockHttp.type = "POST" + volume = self.driver.create_volume(10, "volume-0-3", par1) + self.assertEqual(volume.id, "c675f420-cfeb-48ff-ba2a-9d2a4dbe3fcd") + self.assertEqual(volume.name, "volume-0-3") + self.assertEqual(volume.size, 10) + self.assertEqual(volume.driver, self.driver) + + def test_create_volume_snapshot(self): + volume = self.driver.list_volumes()[0] + ScalewayMockHttp.type = "POST" + snapshot = self.driver.create_volume_snapshot(volume, "snapshot-0-1") + self.assertEqual(snapshot.id, "f0361e7b-cbe4-4882-a999-945192b7171b") + self.assertEqual(snapshot.extra["volume_type"], "l_ssd") + self.assertEqual(volume.driver, self.driver) + + def test_destroy_volume(self): + volume = self.driver.list_volumes()[0] + ScalewayMockHttp.type = "DELETE" + resp = self.driver.destroy_volume(volume) + self.assertTrue(resp) + + def test_destroy_volume_snapshot(self): + volume = self.driver.list_volumes()[0] + snapshot = self.driver.list_volume_snapshots(volume)[0] + ScalewayMockHttp.type = "DELETE" + result = self.driver.destroy_volume_snapshot(snapshot) + self.assertTrue(result) + + def test_list_key_pairs(self): + keys = self.driver.list_key_pairs() + self.assertEqual(len(keys), 1) + self.assertEqual(keys[0].name, "example") + self.assertEqual(keys[0].public_key, "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDGk5") + self.assertEqual(keys[0].fingerprint, "f5:d1:78:ed:28:72:5f:e1:ac:94:fd:1f:e0:a3:48:6d") + + def test_import_key_pair_from_string(self): + result = self.driver.import_key_pair_from_string( + name="example", key_material="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDGk5" + ) + self.assertTrue(result) + + def test_delete_key_pair(self): + key = self.driver.list_key_pairs()[0] + result = self.driver.delete_key_pair(key) + self.assertTrue(result) + + +class ScalewayMockHttp(MockHttp): + fixtures = ComputeFileFixtures("scaleway") + + def _products_servers(self, method, url, body, headers): + body = self.fixtures.load("list_sizes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _products_servers_availability(self, method, url, body, headers): + body = self.fixtures.load("list_availability.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _servers_UNAUTHORIZED(self, method, url, body, headers): + body = self.fixtures.load("error.json") + return (httplib.UNAUTHORIZED, body, {}, httplib.responses[httplib.UNAUTHORIZED]) + + def _images(self, method, url, body, headers): + body = self.fixtures.load("list_images.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _images_POST(self, method, url, body, headers): + # create_image + body = self.fixtures.load("create_image.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + + def _images_12345_DELETE(self, method, url, body, headers): + # delete_image + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _images_12345(self, method, url, body, headers): + # get_image + body = self.fixtures.load("get_image.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _servers(self, method, url, body, headers): + body = self.fixtures.load("list_nodes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _servers_POST(self, method, url, body, headers): + body = self.fixtures.load("create_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _servers_741db378_action_POST(self, method, url, body, headers): + # reboot_node + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _servers_INVALID_IMAGE(self, method, url, body, headers): + body = self.fixtures.load("error_invalid_image.json") + return (httplib.NOT_FOUND, body, {}, httplib.responses[httplib.NOT_FOUND]) + + def _servers_741db378_action_REBOOT(self, method, url, body, headers): + # reboot_node + body = self.fixtures.load("reboot_node.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + + def _servers_741db378_action_TERMINATE(self, method, url, body, headers): + # destroy_node + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _volumes(self, method, url, body, headers): + body = self.fixtures.load("list_volumes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _volumes_EMPTY(self, method, url, body, headers): + body = self.fixtures.load("list_volumes_empty.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _snapshots(self, method, url, body, headers): + body = self.fixtures.load("list_volume_snapshots.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _volumes_POST(self, method, url, body, headers): + body = self.fixtures.load("create_volume.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + + def _snapshots_POST(self, method, url, body, headers): + body = self.fixtures.load("create_volume_snapshot.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + + def _volumes_f929fe39_63f8_4be8_a80e_1e9c8ae22a76_DELETE(self, method, url, body, headers): + return (httplib.NO_CONTENT, None, {}, httplib.responses[httplib.NO_CONTENT]) + + def _snapshots_6f418e5f_b42d_4423_a0b5_349c74c454a4_DELETE(self, method, url, body, headers): + return (httplib.NO_CONTENT, None, {}, httplib.responses[httplib.NO_CONTENT]) + + def _tokens_token(self, method, url, body, headers): + body = self.fixtures.load("token_info.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _users_5bea0358(self, method, url, body, headers): + body = self.fixtures.load("user_info.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_softlayer.py b/libcloud/test/compute/test_softlayer.py deleted file mode 100644 index 8f4536b024..0000000000 --- a/libcloud/test/compute/test_softlayer.py +++ /dev/null @@ -1,255 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import unittest -import sys - -try: - import Crypto - Crypto - crypto = True -except ImportError: - crypto = False - -from libcloud.common.types import InvalidCredsError - -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import xmlrpclib -from libcloud.utils.py3 import next - -from libcloud.compute.drivers.softlayer import SoftLayerNodeDriver as SoftLayer -from libcloud.compute.drivers.softlayer import SoftLayerException, \ - NODE_STATE_MAP -from libcloud.compute.types import NodeState, KeyPairDoesNotExistError - -from libcloud.test import MockHttp # pylint: disable-msg=E0611 -from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.test.secrets import SOFTLAYER_PARAMS - -null_fingerprint = '00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:' + \ - '00:00:00:00:00' - - -class SoftLayerTests(unittest.TestCase): - - def setUp(self): - SoftLayer.connectionCls.conn_classes = ( - SoftLayerMockHttp, SoftLayerMockHttp) - SoftLayerMockHttp.type = None - self.driver = SoftLayer(*SOFTLAYER_PARAMS) - - def test_list_nodes(self): - nodes = self.driver.list_nodes() - node = nodes[0] - self.assertEqual(node.name, 'libcloud-testing1.example.com') - self.assertEqual(node.state, NodeState.RUNNING) - self.assertEqual(node.extra['password'], 'L3TJVubf') - - def test_initializing_state(self): - nodes = self.driver.list_nodes() - node = nodes[1] - self.assertEqual(node.state, NODE_STATE_MAP['INITIATING']) - - def test_list_locations(self): - locations = self.driver.list_locations() - dal = next(l for l in locations if l.id == 'dal05') - self.assertEqual(dal.country, 'US') - self.assertEqual(dal.id, 'dal05') - self.assertEqual(dal.name, 'Dallas - Central U.S.') - - def test_list_images(self): - images = self.driver.list_images() - image = images[0] - self.assertEqual(image.id, 'CENTOS_6_64') - - def test_list_sizes(self): - sizes = self.driver.list_sizes() - self.assertEqual(len(sizes), 13) - - def test_create_node(self): - node = self.driver.create_node(name="libcloud-testing", - location=self.driver.list_locations()[0], - size=self.driver.list_sizes()[0], - image=self.driver.list_images()[0]) - self.assertEqual(node.name, 'libcloud-testing.example.com') - self.assertEqual(node.state, NODE_STATE_MAP['RUNNING']) - - def test_create_fail(self): - SoftLayerMockHttp.type = "SOFTLAYEREXCEPTION" - self.assertRaises( - SoftLayerException, - self.driver.create_node, - name="SOFTLAYEREXCEPTION", - location=self.driver.list_locations()[0], - size=self.driver.list_sizes()[0], - image=self.driver.list_images()[0]) - - def test_create_creds_error(self): - SoftLayerMockHttp.type = "INVALIDCREDSERROR" - self.assertRaises( - InvalidCredsError, - self.driver.create_node, - name="INVALIDCREDSERROR", - location=self.driver.list_locations()[0], - size=self.driver.list_sizes()[0], - image=self.driver.list_images()[0]) - - def test_create_node_no_location(self): - self.driver.create_node(name="Test", - size=self.driver.list_sizes()[0], - image=self.driver.list_images()[0]) - - def test_create_node_no_image(self): - self.driver.create_node(name="Test", size=self.driver.list_sizes()[0]) - - def test_create_node_san(self): - self.driver.create_node(name="Test", ex_local_disk=False) - - def test_create_node_domain_for_name(self): - self.driver.create_node(name="libcloud.org") - - def test_create_node_ex_options(self): - self.driver.create_node(name="Test", - location=self.driver.list_locations()[0], - size=self.driver.list_sizes()[0], - image=self.driver.list_images()[0], - ex_domain='libcloud.org', - ex_cpus=2, - ex_ram=2048, - ex_disk=100, - ex_key='test1', - ex_bandwidth=10, - ex_local_disk=False, - ex_datacenter='Dal05', - ex_os='UBUNTU_LATEST') - - def test_reboot_node(self): - node = self.driver.list_nodes()[0] - self.driver.reboot_node(node) - - def test_destroy_node(self): - node = self.driver.list_nodes()[0] - self.driver.destroy_node(node) - - def test_list_keypairs(self): - keypairs = self.driver.list_key_pairs() - self.assertEqual(len(keypairs), 2) - self.assertEqual(keypairs[0].name, 'test1') - self.assertEqual(keypairs[0].fingerprint, null_fingerprint) - - def test_get_key_pair(self): - key_pair = self.driver.get_key_pair(name='test1') - self.assertEqual(key_pair.name, 'test1') - - def test_get_key_pair_does_not_exist(self): - self.assertRaises(KeyPairDoesNotExistError, self.driver.get_key_pair, - name='test-key-pair') - - def test_create_key_pair(self): - if crypto: - key_pair = self.driver.create_key_pair(name='my-key-pair') - fingerprint = ('1f:51:ae:28:bf:89:e9:d8:1f:25:5d' - ':37:2d:7d:b8:ca:9f:f5:f1:6f') - - self.assertEqual(key_pair.name, 'my-key-pair') - self.assertEqual(key_pair.fingerprint, fingerprint) - self.assertTrue(key_pair.private_key is not None) - else: - self.assertRaises(NotImplementedError, self.driver.create_key_pair, - name='my-key-pair') - - def test_delete_key_pair(self): - success = self.driver.delete_key_pair('test1') - self.assertTrue(success) - - -class SoftLayerMockHttp(MockHttp): - fixtures = ComputeFileFixtures('softlayer') - - def _get_method_name(self, type, use_param, qs, path): - return "_xmlrpc" - - def _xmlrpc(self, method, url, body, headers): - params, meth_name = xmlrpclib.loads(body) - url = url.replace("/", "_") - meth_name = "%s_%s" % (url, meth_name) - return getattr(self, meth_name)(method, url, body, headers) - - def _xmlrpc_v3_SoftLayer_Virtual_Guest_getCreateObjectOptions( - self, method, url, body, headers): - body = self.fixtures.load( - 'v3__SoftLayer_Virtual_Guest_getCreateObjectOptions.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _xmlrpc_v3_SoftLayer_Account_getVirtualGuests( - self, method, url, body, headers): - body = self.fixtures.load('v3_SoftLayer_Account_getVirtualGuests.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _xmlrpc_v3_SoftLayer_Location_Datacenter_getDatacenters( - self, method, url, body, headers): - body = self.fixtures.load( - 'v3_SoftLayer_Location_Datacenter_getDatacenters.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _xmlrpc_v3_SoftLayer_Virtual_Guest_createObject( - self, method, url, body, headers): - fixture = { - None: 'v3__SoftLayer_Virtual_Guest_createObject.xml', - 'INVALIDCREDSERROR': 'SoftLayer_Account.xml', - 'SOFTLAYEREXCEPTION': 'fail.xml', - }[self.type] - body = self.fixtures.load(fixture) - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _xmlrpc_v3_SoftLayer_Virtual_Guest_getObject( - self, method, url, body, headers): - body = self.fixtures.load( - 'v3__SoftLayer_Virtual_Guest_getObject.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _xmlrpc_v3_SoftLayer_Virtual_Guest_rebootSoft( - self, method, url, body, headers): - body = self.fixtures.load('empty.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _xmlrpc_v3_SoftLayer_Virtual_Guest_deleteObject( - self, method, url, body, headers): - body = self.fixtures.load('empty.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _xmlrpc_v3_SoftLayer_Account_getSshKeys( - self, method, url, body, headers): - body = self.fixtures.load('v3__SoftLayer_Account_getSshKeys.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _xmlrpc_v3_SoftLayer_Security_Ssh_Key_getObject( - self, method, url, body, headers): - body = self.fixtures.load('v3__SoftLayer_Security_Ssh_Key_getObject.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _xmlrpc_v3_SoftLayer_Security_Ssh_Key_createObject( - self, method, url, body, headers): - body = self.fixtures.load('v3__SoftLayer_Security_Ssh_Key_createObject.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _xmlrpc_v3_SoftLayer_Security_Ssh_Key_deleteObject( - self, method, url, body, headers): - body = self.fixtures.load('v3__SoftLayer_Security_Ssh_Key_deleteObject.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_ssh_client.py b/libcloud/test/compute/test_ssh_client.py index 857f4e2eea..0d1d6e9366 100644 --- a/libcloud/test/compute/test_ssh_client.py +++ b/libcloud/test/compute/test_ssh_client.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more§ # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. @@ -14,165 +13,422 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import -from __future__ import with_statement import os import sys import tempfile +from unittest.mock import Mock, MagicMock, call, patch from libcloud import _init_once -from libcloud.test import LibcloudTestCase -from libcloud.test import unittest -from libcloud.compute.ssh import ParamikoSSHClient -from libcloud.compute.ssh import ShellOutSSHClient -from libcloud.compute.ssh import have_paramiko - -from libcloud.utils.py3 import StringIO - -from mock import patch, Mock +from libcloud.test import LibcloudTestCase, unittest +from libcloud.utils.py3 import StringIO, u, assertRaisesRegex +from libcloud.compute.ssh import ParamikoSSHClient, ShellOutSSHClient, have_paramiko if not have_paramiko: ParamikoSSHClient = None # NOQA + paramiko_version = () else: import paramiko + paramiko_version = tuple(int(x) for x in paramiko.__version__.split(".")) -class ParamikoSSHClientTests(LibcloudTestCase): - @patch('paramiko.SSHClient', Mock) +@unittest.skipIf(not have_paramiko, "Skipping because paramiko is not available") +class ParamikoSSHClientTests(LibcloudTestCase): + @patch("paramiko.SSHClient", Mock) def setUp(self): """ Creates the object patching the actual connection. """ - conn_params = {'hostname': 'dummy.host.org', - 'port': 8822, - 'username': 'ubuntu', - 'key': '~/.ssh/ubuntu_ssh', - 'timeout': '600'} + conn_params = { + "hostname": "dummy.host.org", + "port": 8822, + "username": "ubuntu", + "key": "~/.ssh/ubuntu_ssh", + "timeout": "600", + } _, self.tmp_file = tempfile.mkstemp() - os.environ['LIBCLOUD_DEBUG'] = self.tmp_file + os.environ["LIBCLOUD_DEBUG"] = self.tmp_file _init_once() self.ssh_cli = ParamikoSSHClient(**conn_params) - @patch('paramiko.SSHClient', Mock) + def tearDown(self): + if "LIBCLOUD_DEBUG" in os.environ: + del os.environ["LIBCLOUD_DEBUG"] + + @patch("paramiko.SSHClient", Mock) def test_create_with_password(self): - conn_params = {'hostname': 'dummy.host.org', - 'username': 'ubuntu', - 'password': 'ubuntu'} + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "password": "ubuntu", + } mock = ParamikoSSHClient(**conn_params) mock.connect() - expected_conn = {'username': 'ubuntu', - 'password': 'ubuntu', - 'allow_agent': False, - 'hostname': 'dummy.host.org', - 'look_for_keys': False, - 'port': 22} + expected_conn = { + "username": "ubuntu", + "password": "ubuntu", + "allow_agent": False, + "hostname": "dummy.host.org", + "look_for_keys": False, + "port": 22, + } mock.client.connect.assert_called_once_with(**expected_conn) - self.assertLogMsg('Connecting to server') + self.assertLogMsg("Connecting to server") - @patch('paramiko.SSHClient', Mock) + @patch("paramiko.SSHClient", Mock) def test_deprecated_key_argument(self): - conn_params = {'hostname': 'dummy.host.org', - 'username': 'ubuntu', - 'key': 'id_rsa'} + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "key": "id_rsa", + } mock = ParamikoSSHClient(**conn_params) mock.connect() - expected_conn = {'username': 'ubuntu', - 'allow_agent': False, - 'hostname': 'dummy.host.org', - 'look_for_keys': False, - 'key_filename': 'id_rsa', - 'port': 22} + expected_conn = { + "username": "ubuntu", + "allow_agent": False, + "hostname": "dummy.host.org", + "look_for_keys": False, + "key_filename": "id_rsa", + "port": 22, + } mock.client.connect.assert_called_once_with(**expected_conn) - self.assertLogMsg('Connecting to server') + self.assertLogMsg("Connecting to server") def test_key_files_and_key_material_arguments_are_mutual_exclusive(self): - conn_params = {'hostname': 'dummy.host.org', - 'username': 'ubuntu', - 'key_files': 'id_rsa', - 'key_material': 'key'} + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "key_files": "id_rsa", + "key_material": "key", + } - expected_msg = ('key_files and key_material arguments are mutually ' - 'exclusive') - self.assertRaisesRegexp(ValueError, expected_msg, - ParamikoSSHClient, **conn_params) + expected_msg = "key_files and key_material arguments are mutually " "exclusive" + assertRaisesRegex(self, ValueError, expected_msg, ParamikoSSHClient, **conn_params) - @patch('paramiko.SSHClient', Mock) + @patch("paramiko.SSHClient", Mock) def test_key_material_argument(self): - path = os.path.join(os.path.dirname(__file__), - 'fixtures', 'misc', 'dummy_rsa') + path = os.path.join(os.path.dirname(__file__), "fixtures", "misc", "test_rsa.key") - with open(path, 'r') as fp: + with open(path) as fp: private_key = fp.read() - conn_params = {'hostname': 'dummy.host.org', - 'username': 'ubuntu', - 'key_material': private_key} + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "key_material": private_key, + } mock = ParamikoSSHClient(**conn_params) mock.connect() pkey = paramiko.RSAKey.from_private_key(StringIO(private_key)) - expected_conn = {'username': 'ubuntu', - 'allow_agent': False, - 'hostname': 'dummy.host.org', - 'look_for_keys': False, - 'pkey': pkey, - 'port': 22} + expected_conn = { + "username": "ubuntu", + "allow_agent": False, + "hostname": "dummy.host.org", + "look_for_keys": False, + "pkey": pkey, + "port": 22, + } mock.client.connect.assert_called_once_with(**expected_conn) - self.assertLogMsg('Connecting to server') + self.assertLogMsg("Connecting to server") - @patch('paramiko.SSHClient', Mock) + @patch("paramiko.SSHClient", Mock) def test_key_material_argument_invalid_key(self): - conn_params = {'hostname': 'dummy.host.org', - 'username': 'ubuntu', - 'key_material': 'id_rsa'} + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "key_material": "id_rsa", + } mock = ParamikoSSHClient(**conn_params) - expected_msg = 'Invalid or unsupported key type' - self.assertRaisesRegexp(paramiko.ssh_exception.SSHException, - expected_msg, mock.connect) + expected_msg = "Invalid or unsupported key type" + assertRaisesRegex(self, paramiko.ssh_exception.SSHException, expected_msg, mock.connect) + + @patch("paramiko.SSHClient", Mock) + @unittest.skipIf( + paramiko_version >= (2, 7, 0), + "New versions of paramiko support OPENSSH key format", + ) + def test_key_file_non_pem_format_error(self): + path = os.path.join( + os.path.dirname(__file__), "fixtures", "misc", "test_rsa_non_pem_format.key" + ) + + # Supplied as key_material + with open(path) as fp: + private_key = fp.read() + + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "key_material": private_key, + } + + mock = ParamikoSSHClient(**conn_params) + + expected_msg = "Invalid or unsupported key type" + assertRaisesRegex(self, paramiko.ssh_exception.SSHException, expected_msg, mock.connect) + + @patch("paramiko.SSHClient", Mock) + def test_password_protected_key_no_password_provided_1(self): + path = os.path.join( + os.path.dirname(__file__), + "fixtures", + "misc", + "test_rsa_2048b_pass_foobar.key", + ) + + # Supplied as key_material + with open(path) as fp: + private_key = fp.read() + + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "key_material": private_key, + } + + mock = ParamikoSSHClient(**conn_params) + + expected_msg = "private key file is encrypted" + assertRaisesRegex( + self, + paramiko.ssh_exception.PasswordRequiredException, + expected_msg, + mock.connect, + ) + + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "key_files": path, + } + + mock = ParamikoSSHClient(**conn_params) + + expected_msg = "private key file is encrypted" + assertRaisesRegex( + self, + paramiko.ssh_exception.PasswordRequiredException, + expected_msg, + mock.connect, + ) + + @patch("paramiko.SSHClient", Mock) + def test_password_protected_key_no_password_provided_2(self): + path = os.path.join( + os.path.dirname(__file__), + "fixtures", + "misc", + "test_rsa_2048b_pass_foobar.key", + ) + + # Supplied as key_material + with open(path) as fp: + private_key = fp.read() + + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "key_material": private_key, + "password": "invalid", + } + + mock = ParamikoSSHClient(**conn_params) + + expected_msg = "OpenSSH private key file checkints do not match" + assertRaisesRegex(self, paramiko.ssh_exception.SSHException, expected_msg, mock.connect) + + @patch("paramiko.SSHClient", Mock) + def test_password_protected_key_valid_password_provided(self): + path = os.path.join( + os.path.dirname(__file__), + "fixtures", + "misc", + "test_rsa_2048b_pass_foobar.key", + ) + + # Supplied as key_material + with open(path) as fp: + private_key = fp.read() + + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "key_material": private_key, + "password": "foobar", + } + + mock = ParamikoSSHClient(**conn_params) + self.assertTrue(mock.connect()) + + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "key_files": path, + "password": "foobar", + } + + mock = ParamikoSSHClient(**conn_params) + self.assertTrue(mock.connect()) + + @patch("paramiko.SSHClient", Mock) + def test_ed25519_key_type(self): + path = os.path.join(os.path.dirname(__file__), "fixtures", "misc", "test_ed25519.key") + + # Supplied as key_material + with open(path) as fp: + private_key = fp.read() + + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "key_material": private_key, + } + + mock = ParamikoSSHClient(**conn_params) + self.assertTrue(mock.connect()) + + def test_key_material_valid_pem_keys_invalid_header_auto_conversion(self): + # Test a scenario where valid PEM keys with invalid headers which is + # not recognized by paramiko are automatically converted in a format + # which is recognized by paramiko + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + + # 1. RSA key type with header which is not supported by paramiko + path = os.path.join( + os.path.dirname(__file__), + "fixtures", + "misc", + "test_rsa_non_paramiko_recognized_header.key", + ) + + with open(path) as fp: + private_key = fp.read() + + pkey = client._get_pkey_object(key=private_key) + self.assertTrue(pkey) + self.assertTrue(isinstance(pkey, paramiko.RSAKey)) + + # 2. DSA key type with header which is not supported by paramiko + # ... and only for paramiko < 4 + if paramiko_version < (4, 0, 0): + path = os.path.join( + os.path.dirname(__file__), + "fixtures", + "misc", + "test_dsa_non_paramiko_recognized_header.key", + ) + + with open(path) as fp: + private_key = fp.read() + + pkey = client._get_pkey_object(key=private_key) + self.assertTrue(pkey) + self.assertTrue(isinstance(pkey, paramiko.DSSKey)) + + # 3. ECDSA key type with header which is not supported by paramiko + path = os.path.join( + os.path.dirname(__file__), + "fixtures", + "misc", + "test_ecdsa_non_paramiko_recognized_header.key", + ) + + with open(path) as fp: + private_key = fp.read() + + pkey = client._get_pkey_object(key=private_key) + self.assertTrue(pkey) + self.assertTrue(isinstance(pkey, paramiko.ECDSAKey)) + + def test_key_material_valid_pem_keys(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + + # 1. RSA key type with header which is not supported by paramiko + path = os.path.join(os.path.dirname(__file__), "fixtures", "misc", "test_rsa.key") + + with open(path) as fp: + private_key = fp.read() + + pkey = client._get_pkey_object(key=private_key) + self.assertTrue(pkey) + self.assertTrue(isinstance(pkey, paramiko.RSAKey)) + + # 2. DSA key type with header which is not supported by paramiko + # ... and only for paramiko < 4 + if paramiko_version < (4, 0, 0): + path = os.path.join(os.path.dirname(__file__), "fixtures", "misc", "test_dsa.key") + + with open(path) as fp: + private_key = fp.read() + + pkey = client._get_pkey_object(key=private_key) + self.assertTrue(pkey) + self.assertTrue(isinstance(pkey, paramiko.DSSKey)) + + # 3. ECDSA key type with header which is not supported by paramiko + path = os.path.join(os.path.dirname(__file__), "fixtures", "misc", "test_ecdsa.key") + + with open(path) as fp: + private_key = fp.read() + + pkey = client._get_pkey_object(key=private_key) + self.assertTrue(pkey) + self.assertTrue(isinstance(pkey, paramiko.ECDSAKey)) - @patch('paramiko.SSHClient', Mock) + @patch("paramiko.SSHClient", Mock) def test_create_with_key(self): - conn_params = {'hostname': 'dummy.host.org', - 'username': 'ubuntu', - 'key_files': 'id_rsa'} + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "key_files": "id_rsa", + } mock = ParamikoSSHClient(**conn_params) mock.connect() - expected_conn = {'username': 'ubuntu', - 'allow_agent': False, - 'hostname': 'dummy.host.org', - 'look_for_keys': False, - 'key_filename': 'id_rsa', - 'port': 22} + expected_conn = { + "username": "ubuntu", + "allow_agent": False, + "hostname": "dummy.host.org", + "look_for_keys": False, + "key_filename": "id_rsa", + "port": 22, + } mock.client.connect.assert_called_once_with(**expected_conn) - self.assertLogMsg('Connecting to server') + self.assertLogMsg("Connecting to server") - @patch('paramiko.SSHClient', Mock) + @patch("paramiko.SSHClient", Mock) def test_create_with_password_and_key(self): - conn_params = {'hostname': 'dummy.host.org', - 'username': 'ubuntu', - 'password': 'ubuntu', - 'key': 'id_rsa'} + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "password": "ubuntu", + "key": "id_rsa", + } mock = ParamikoSSHClient(**conn_params) mock.connect() - expected_conn = {'username': 'ubuntu', - 'password': 'ubuntu', - 'allow_agent': False, - 'hostname': 'dummy.host.org', - 'look_for_keys': False, - 'key_filename': 'id_rsa', - 'port': 22} + expected_conn = { + "username": "ubuntu", + "password": "ubuntu", + "allow_agent": False, + "hostname": "dummy.host.org", + "look_for_keys": False, + "key_filename": "id_rsa", + "port": 22, + } mock.client.connect.assert_called_once_with(**expected_conn) - self.assertLogMsg('Connecting to server') + self.assertLogMsg("Connecting to server") - @patch('paramiko.SSHClient', Mock) + @patch("paramiko.SSHClient", Mock) def test_create_without_credentials(self): """ Initialize object with no credentials. @@ -180,18 +436,21 @@ def test_create_without_credentials(self): Just to have better coverage, initialize the object without 'password' neither 'key'. """ - conn_params = {'hostname': 'dummy.host.org', - 'username': 'ubuntu'} + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} mock = ParamikoSSHClient(**conn_params) mock.connect() - expected_conn = {'username': 'ubuntu', - 'hostname': 'dummy.host.org', - 'allow_agent': True, - 'look_for_keys': True, - 'port': 22} + expected_conn = { + "username": "ubuntu", + "hostname": "dummy.host.org", + "allow_agent": True, + "look_for_keys": True, + "port": 22, + } mock.client.connect.assert_called_once_with(**expected_conn) + @patch.object(ParamikoSSHClient, "_consume_stdout", MagicMock(return_value=StringIO(""))) + @patch.object(ParamikoSSHClient, "_consume_stderr", MagicMock(return_value=StringIO(""))) def test_basic_usage_absolute_path(self): """ Basic execution. @@ -203,28 +462,29 @@ def test_basic_usage_absolute_path(self): # Connect behavior mock.connect() mock_cli = mock.client # The actual mocked object: SSHClient - expected_conn = {'username': 'ubuntu', - 'key_filename': '~/.ssh/ubuntu_ssh', - 'allow_agent': False, - 'hostname': 'dummy.host.org', - 'look_for_keys': False, - 'timeout': '600', - 'port': 8822} + + expected_conn = { + "username": "ubuntu", + "key_filename": "~/.ssh/ubuntu_ssh", + "allow_agent": False, + "hostname": "dummy.host.org", + "look_for_keys": False, + "timeout": "600", + "port": 8822, + } mock_cli.connect.assert_called_once_with(**expected_conn) mock.put(sd) # Make assertions over 'put' method - mock_cli.open_sftp().chdir.assert_called_with('root') - mock_cli.open_sftp().file.assert_called_once_with('random_script.sh', - mode='w') + mock_cli.open_sftp().chdir.assert_called_with("root") + mock_cli.open_sftp().file.assert_called_once_with("random_script.sh", mode="w") mock.run(sd) # Make assertions over 'run' method - mock_cli.get_transport().open_session().exec_command \ - .assert_called_once_with(sd) - self.assertLogMsg('Executing command (cmd=/root/random_script.sh)') - self.assertLogMsg('Command finished') + mock_cli.get_transport().open_session().exec_command.assert_called_once_with(sd) + self.assertLogMsg("Executing command (cmd=/root/random_script.sh)") + self.assertLogMsg("Command finished") mock.close() @@ -234,45 +494,360 @@ def test_delete_script(self): """ mock = self.ssh_cli # script to execute - sd = '/root/random_script.sh' + sd = "/root/random_script.sh" mock.connect() mock.delete(sd) # Make assertions over the 'delete' method mock.client.open_sftp().unlink.assert_called_with(sd) - self.assertLogMsg('Deleting file') + self.assertLogMsg("Deleting file") mock.close() - self.assertLogMsg('Closing server connection') + self.assertLogMsg("Closing server connection") def assertLogMsg(self, expected_msg): - with open(self.tmp_file, 'r') as fp: + with open(self.tmp_file) as fp: content = fp.read() self.assertTrue(content.find(expected_msg) != -1) + def test_consume_stdout(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + client.CHUNK_SIZE = 1024 + + chan = Mock() + chan.recv_ready.side_effect = [True, True, False] + chan.recv.side_effect = ["123", "456"] + + stdout = client._consume_stdout(chan).getvalue() + self.assertEqual(u("123456"), stdout) + self.assertEqual(len(stdout), 6) + + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + client.CHUNK_SIZE = 1024 + + chan = Mock() + chan.recv_ready.side_effect = [True, True, False] + chan.recv.side_effect = ["987", "6543210"] + + stdout = client._consume_stdout(chan).getvalue() + self.assertEqual(u("9876543210"), stdout) + self.assertEqual(len(stdout), 10) + + def test_consume_stderr(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + client.CHUNK_SIZE = 1024 + + chan = Mock() + chan.recv_stderr_ready.side_effect = [True, True, False] + chan.recv_stderr.side_effect = ["123", "456"] + + stderr = client._consume_stderr(chan).getvalue() + self.assertEqual(u("123456"), stderr) + self.assertEqual(len(stderr), 6) + + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + client.CHUNK_SIZE = 1024 + + chan = Mock() + chan.recv_stderr_ready.side_effect = [True, True, False] + chan.recv_stderr.side_effect = ["987", "6543210"] + + stderr = client._consume_stderr(chan).getvalue() + self.assertEqual(u("9876543210"), stderr) + self.assertEqual(len(stderr), 10) + + def test_consume_stdout_chunk_contains_part_of_multi_byte_utf8_character(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + client.CHUNK_SIZE = 1 + + chan = Mock() + chan.recv_ready.side_effect = [True, True, True, True, False] + chan.recv.side_effect = ["\xf0", "\x90", "\x8d", "\x88"] + + stdout = client._consume_stdout(chan).getvalue() + self.assertEqual("ð\x90\x8d\x88", stdout) + self.assertEqual(len(stdout), 4) + + def test_consume_stderr_chunk_contains_part_of_multi_byte_utf8_character(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + client.CHUNK_SIZE = 1 + + chan = Mock() + chan.recv_stderr_ready.side_effect = [True, True, True, True, False] + chan.recv_stderr.side_effect = ["\xf0", "\x90", "\x8d", "\x88"] + + stderr = client._consume_stderr(chan).getvalue() + self.assertEqual("ð\x90\x8d\x88", stderr) + self.assertEqual(len(stderr), 4) + + def test_consume_stdout_chunk_contains_non_utf8_character(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + client.CHUNK_SIZE = 1 + + chan = Mock() + chan.recv_ready.side_effect = [True, True, True, False] + chan.recv.side_effect = ["🤦".encode("utf-32"), "a", "b"] + + stdout = client._consume_stdout(chan).getvalue() + if sys.byteorder == "little": + self.assertEqual("\x00\x00&\x01\x00ab", stdout) + else: + self.assertEqual("\x00\x00\x00\x01&ab", stdout) + self.assertEqual(len(stdout), 7) -if not ParamikoSSHClient: - class ParamikoSSHClientTests(LibcloudTestCase): # NOQA - pass + def test_consume_stderr_chunk_contains_non_utf8_character(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + client.CHUNK_SIZE = 1 + chan = Mock() + chan.recv_stderr_ready.side_effect = [True, True, True, False] + chan.recv_stderr.side_effect = ["🤦".encode("utf-32"), "a", "b"] -class ShellOutSSHClientTests(LibcloudTestCase): + stderr = client._consume_stderr(chan).getvalue() + if sys.byteorder == "little": + self.assertEqual("\x00\x00&\x01\x00ab", stderr) + else: + self.assertEqual("\x00\x00\x00\x01&ab", stderr) + self.assertEqual(len(stderr), 7) + + def test_keep_alive_and_compression(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + + mock_transport = Mock() + client.client.get_transport = Mock(return_value=mock_transport) + + transport = client._get_transport() + self.assertEqual(transport.set_keepalive.call_count, 0) + self.assertEqual(transport.use_compression.call_count, 0) + + conn_params = { + "hostname": "dummy.host.org", + "username": "ubuntu", + "keep_alive": 15, + "use_compression": True, + } + client = ParamikoSSHClient(**conn_params) + + mock_transport = Mock() + client.client.get_transport = Mock(return_value=mock_transport) + + transport = client._get_transport() + self.assertEqual(transport.set_keepalive.call_count, 1) + self.assertEqual(transport.use_compression.call_count, 1) + + def test_put_absolute_path(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + + mock_client = Mock() + mock_sftp_client = Mock() + mock_transport = Mock() + + mock_client.get_transport.return_value = mock_transport + mock_sftp_client.getcwd.return_value = "/mock/cwd" + client.client = mock_client + client.sftp_client = mock_sftp_client + + result = client.put(path="/test/remote/path.txt", contents="foo bar", chmod=455, mode="w") + self.assertEqual(result, "/test/remote/path.txt") + + calls = [call("/"), call("test"), call("remote")] + mock_sftp_client.chdir.assert_has_calls(calls, any_order=False) + + calls = [ + call("path.txt", mode="w"), + call().write("foo bar"), + call().chmod(455), + call().close(), + ] + mock_sftp_client.file.assert_has_calls(calls, any_order=False) + + def test_put_absolute_path_windows(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + + mock_client = Mock() + mock_sftp_client = Mock() + mock_transport = Mock() + + mock_client.get_transport.return_value = mock_transport + mock_sftp_client.getcwd.return_value = "C:\\Administrator" + client.client = mock_client + client.sftp_client = mock_sftp_client + + result = client.put(path="C:\\users\\user1\\1.txt", contents="foo bar", chmod=455, mode="w") + self.assertEqual(result, "C:\\users\\user1\\1.txt") + + result = client.put(path="\\users\\user1\\1.txt", contents="foo bar", chmod=455, mode="w") + self.assertEqual(result, "\\users\\user1\\1.txt") + + result = client.put(path="1.txt", contents="foo bar", chmod=455, mode="w") + self.assertEqual(result, "C:\\Administrator\\1.txt") + + mock_client.get_transport.return_value = mock_transport + mock_sftp_client.getcwd.return_value = "/C:\\User1" + client.client = mock_client + client.sftp_client = mock_sftp_client + + result = client.put(path="1.txt", contents="foo bar", chmod=455, mode="w") + self.assertEqual(result, "C:\\User1\\1.txt") + + def test_put_relative_path(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + + mock_client = Mock() + mock_sftp_client = Mock() + mock_transport = Mock() + + mock_client.get_transport.return_value = mock_transport + mock_sftp_client.getcwd.return_value = "/mock/cwd" + client.client = mock_client + client.sftp_client = mock_sftp_client + + result = client.put(path="path2.txt", contents="foo bar 2", chmod=466, mode="a") + self.assertEqual(result, "/mock/cwd/path2.txt") + + calls = [call(".")] + mock_sftp_client.chdir.assert_has_calls(calls, any_order=False) + + calls = [ + call("path2.txt", mode="a"), + call().write("foo bar 2"), + call().chmod(466), + call().close(), + ] + mock_sftp_client.file.assert_has_calls(calls, any_order=False) + + def test_putfo_absolute_path(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + + mock_client = Mock() + mock_sftp_client = Mock() + mock_transport = Mock() + + mock_client.get_transport.return_value = mock_transport + mock_sftp_client.getcwd.return_value = "/mock/cwd" + client.client = mock_client + client.sftp_client = mock_sftp_client + mock_fo = StringIO("mock stream data 1") + + result = client.putfo(path="/test/remote/path.txt", fo=mock_fo, chmod=455) + self.assertEqual(result, "/test/remote/path.txt") + + calls = [call("/"), call("test"), call("remote")] + mock_sftp_client.chdir.assert_has_calls(calls, any_order=False) + + mock_sftp_client.putfo.assert_called_once_with(mock_fo, "/test/remote/path.txt") + + calls = [call("path.txt"), call().chmod(455), call().close()] + mock_sftp_client.file.assert_has_calls(calls, any_order=False) + + def test_putfo_relative_path(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + + mock_client = Mock() + mock_sftp_client = Mock() + mock_transport = Mock() + + mock_client.get_transport.return_value = mock_transport + mock_sftp_client.getcwd.return_value = "/mock/cwd" + client.client = mock_client + client.sftp_client = mock_sftp_client + + mock_fo = StringIO("mock stream data 2") + + result = client.putfo(path="path2.txt", fo=mock_fo, chmod=466) + self.assertEqual(result, "/mock/cwd/path2.txt") + + calls = [call(".")] + mock_sftp_client.chdir.assert_has_calls(calls, any_order=False) + + mock_sftp_client.putfo.assert_called_once_with(mock_fo, "path2.txt") + + calls = [call("path2.txt"), call().chmod(466), call().close()] + mock_sftp_client.file.assert_has_calls(calls, any_order=False) + + def test_get_sftp_client(self): + conn_params = {"hostname": "dummy.host.org", "username": "ubuntu"} + client = ParamikoSSHClient(**conn_params) + + # 1. sftp connection is not opened yet, new one should be opened + mock_client = Mock() + mock_sft_client = Mock() + mock_client.open_sftp.return_value = mock_sft_client + client.client = mock_client + + self.assertEqual(mock_client.open_sftp.call_count, 0) + self.assertEqual(client._get_sftp_client(), mock_sft_client) + self.assertEqual(mock_client.open_sftp.call_count, 1) + + # 2. existing sftp connection which is already opened is reused + mock_client = Mock() + mock_sft_client = Mock() + client.client = mock_client + client.sftp_client = mock_sft_client + + self.assertEqual(mock_client.open_sftp.call_count, 0) + self.assertEqual(client._get_sftp_client(), mock_sft_client) + self.assertEqual(mock_client.open_sftp.call_count, 0) + + # 3. existing connection is already opened, but it throws + # "socket closed" error, we should establish a new one + mock_client = Mock() + mock_sftp_client = Mock() + + client.client = mock_client + client.sftp_client = mock_sftp_client + + mock_sftp_client.listdir.side_effect = OSError("Socket is closed") + + self.assertEqual(mock_client.open_sftp.call_count, 0) + sftp_client = client._get_sftp_client() + self.assertTrue(sftp_client != mock_sft_client) + self.assertTrue(sftp_client) + self.assertTrue(client._get_sftp_client()) + self.assertEqual(mock_client.open_sftp.call_count, 1) + + # 4. fatal exceptions should be propagated + mock_client = Mock() + mock_sftp_client = Mock() + + client.client = mock_client + client.sftp_client = mock_sftp_client + + mock_sftp_client.listdir.side_effect = Exception("Fatal exception") + + self.assertEqual(mock_client.open_sftp.call_count, 0) + self.assertRaisesRegex(Exception, "Fatal exception", client._get_sftp_client) + + +class ShellOutSSHClientTests(LibcloudTestCase): def test_password_auth_not_supported(self): try: - ShellOutSSHClient(hostname='localhost', username='foo', - password='bar') - except ValueError: - e = sys.exc_info()[1] + ShellOutSSHClient(hostname="localhost", username="foo", password="bar") + except ValueError as e: msg = str(e) - self.assertTrue('ShellOutSSHClient only supports key auth' in msg) + self.assertTrue("ShellOutSSHClient only supports key auth" in msg) else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_ssh_executable_not_available(self): - class MockChild(object): + class MockChild: returncode = 127 def communicate(*args, **kwargs): @@ -281,41 +856,40 @@ def communicate(*args, **kwargs): def mock_popen(*args, **kwargs): return MockChild() - with patch('subprocess.Popen', mock_popen): + with patch("subprocess.Popen", mock_popen): try: - ShellOutSSHClient(hostname='localhost', username='foo') - except ValueError: - e = sys.exc_info()[1] + ShellOutSSHClient(hostname="localhost", username="foo") + except ValueError as e: msg = str(e) - self.assertTrue('ssh client is not available' in msg) + self.assertTrue("ssh client is not available" in msg) else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_connect_success(self): - client = ShellOutSSHClient(hostname='localhost', username='root') + client = ShellOutSSHClient(hostname="localhost", username="root") self.assertTrue(client.connect()) def test_close_success(self): - client = ShellOutSSHClient(hostname='localhost', username='root') + client = ShellOutSSHClient(hostname="localhost", username="root") self.assertTrue(client.close()) def test_get_base_ssh_command(self): - client1 = ShellOutSSHClient(hostname='localhost', username='root') - client2 = ShellOutSSHClient(hostname='localhost', username='root', - key='/home/my.key') - client3 = ShellOutSSHClient(hostname='localhost', username='root', - key='/home/my.key', timeout=5) + client1 = ShellOutSSHClient(hostname="localhost", username="root") + client2 = ShellOutSSHClient(hostname="localhost", username="root", key="/home/my.key") + client3 = ShellOutSSHClient( + hostname="localhost", username="root", key="/home/my.key", timeout=5 + ) cmd1 = client1._get_base_ssh_command() cmd2 = client2._get_base_ssh_command() cmd3 = client3._get_base_ssh_command() - self.assertEqual(cmd1, ['ssh', 'root@localhost']) - self.assertEqual(cmd2, ['ssh', '-i', '/home/my.key', - 'root@localhost']) - self.assertEqual(cmd3, ['ssh', '-i', '/home/my.key', - '-oConnectTimeout=5', 'root@localhost']) + self.assertEqual(cmd1, ["ssh", "root@localhost"]) + self.assertEqual(cmd2, ["ssh", "-i", "/home/my.key", "root@localhost"]) + self.assertEqual( + cmd3, ["ssh", "-i", "/home/my.key", "-oConnectTimeout=5", "root@localhost"] + ) -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_types.py b/libcloud/test/compute/test_types.py new file mode 100644 index 0000000000..c3fb6c8461 --- /dev/null +++ b/libcloud/test/compute/test_types.py @@ -0,0 +1,87 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest +from unittest import TestCase + +from libcloud.compute.types import ( + Type, + Provider, + NodeState, + StorageVolumeState, + VolumeSnapshotState, +) + + +class TestType(Type): + INUSE = "inuse" + NOTINUSE = "NOTINUSE" + + +class TestTestType(TestCase): + model = TestType + + def test_provider_tostring(self): + self.assertEqual(Provider.tostring(TestType.INUSE), "INUSE") + self.assertEqual(Provider.tostring(TestType.NOTINUSE), "NOTINUSE") + + def test_provider_fromstring(self): + self.assertEqual(TestType.fromstring("inuse"), TestType.INUSE) + self.assertEqual(TestType.fromstring("NOTINUSE"), TestType.NOTINUSE) + + def test_provider_fromstring_caseinsensitive(self): + self.assertEqual(TestType.fromstring("INUSE"), TestType.INUSE) + self.assertEqual(TestType.fromstring("notinuse"), TestType.NOTINUSE) + + def test_compare_as_string(self): + self.assertTrue(TestType.INUSE == "inuse") + self.assertFalse(TestType.INUSE == "bar") + + +class TestProvider(TestCase): + def test_provider_tostring(self): + self.assertEqual(Provider.tostring(Provider.RACKSPACE), "RACKSPACE") + + def test_provider_fromstring(self): + self.assertEqual(Provider.fromstring("rackspace"), Provider.RACKSPACE) + + +class TestNodeState(TestCase): + def test_nodestate_tostring(self): + self.assertEqual(NodeState.tostring(NodeState.RUNNING), "RUNNING") + + def test_nodestate_fromstring(self): + self.assertEqual(NodeState.fromstring("running"), NodeState.RUNNING) + + +class TestStorageVolumeState(TestCase): + def test_storagevolumestate_tostring(self): + self.assertEqual(StorageVolumeState.tostring(StorageVolumeState.AVAILABLE), "AVAILABLE") + + def test_storagevolumestate_fromstring(self): + self.assertEqual(StorageVolumeState.fromstring("available"), StorageVolumeState.AVAILABLE) + + +class TestVolumeSnapshotState(TestCase): + def test_volumesnapshotstate_tostring(self): + self.assertEqual(VolumeSnapshotState.tostring(VolumeSnapshotState.AVAILABLE), "AVAILABLE") + + def test_volumesnapshotstate_fromstring(self): + self.assertEqual(VolumeSnapshotState.fromstring("available"), VolumeSnapshotState.AVAILABLE) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_upcloud.py b/libcloud/test/compute/test_upcloud.py new file mode 100644 index 0000000000..aaa585ddeb --- /dev/null +++ b/libcloud/test/compute/test_upcloud.py @@ -0,0 +1,671 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import re +import sys +import json +import base64 + +from libcloud.test import MockHttp, LibcloudTestCase, unittest +from libcloud.compute import providers +from libcloud.utils.py3 import httplib, ensure_string +from libcloud.common.types import InvalidCredsError +from libcloud.compute.base import ( + Node, + NodeSize, + NodeImage, + NodeLocation, + StorageVolume, + NodeAuthSSHKey, +) +from libcloud.test.secrets import UPCLOUD_PARAMS +from libcloud.compute.types import Provider, NodeState +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.upcloud import UpcloudDriver, UpcloudResponse + + +class UpcloudPersistResponse(UpcloudResponse): + def parse_body(self): + import os + + path = os.path.abspath( + os.path.join( + os.path.dirname(os.path.abspath(__file__)), + os.path.pardir, + "compute", + "fixtures", + "upcloud", + ) + ) + filename = "api" + self.request.path_url.replace("/", "_").replace(".", "_") + ".json" + filename = os.path.join(path, filename) + if not os.path.exists(filename): + with open(filename, "w+") as f: + f.write(self.body) + return super().parse_body() + + +class UpcloudAuthenticationTests(LibcloudTestCase): + def setUp(self): + UpcloudDriver.connectionCls.conn_class = UpcloudMockHttp + self.driver = UpcloudDriver("nosuchuser", "nopwd") + + def test_authentication_fails(self): + with self.assertRaises(InvalidCredsError): + self.driver.list_locations() + + def test_authentication_with_api_token(self): + driver = UpcloudDriver(token="test-token") + driver.list_locations() + + self.assertEqual(UpcloudMockHttp.last_authorization, "Bearer test-token") + + def test_authentication_requires_basic_credentials_or_token(self): + with self.assertRaises(ValueError): + UpcloudDriver() + + +class UpcloudDriverTests(LibcloudTestCase): + def setUp(self): + UpcloudDriver.connectionCls.conn_class = UpcloudMockHttp + # UpcloudDriver.connectionCls.responseCls = UpcloudPersistResponse + self.driver = UpcloudDriver(*UPCLOUD_PARAMS) + + def test_creating_driver(self): + cls = providers.get_driver(Provider.UPCLOUD) + self.assertIs(cls, UpcloudDriver) + + def test_features(self): + features = self.driver.features["create_node"] + self.assertIn("ssh_key", features) + self.assertIn("generates_password", features) + + def test_list_locations(self): + locations = self.driver.list_locations() + self.assertTrue(len(locations) >= 1) + expected_node_location = NodeLocation( + id="fi-hel1", name="Helsinki #1", country="FI", driver=self.driver + ) + self.assert_object(expected_node_location, objects=locations) + + def test_list_sizes(self): + location = NodeLocation(id="fi-hel1", name="Helsinki #1", country="FI", driver=self.driver) + sizes = self.driver.list_sizes(location) + self.assertTrue(len(sizes) >= 1) + expected_node_size = NodeSize( + id="1xCPU-1GB", + name="1xCPU-1GB", + ram=1024, + disk=30, + bandwidth=2048, + price=2.232, + driver=self.driver, + extra={"core_number": 1, "storage_tier": "maxiops"}, + ) + self.assert_object(expected_node_size, objects=sizes) + + def test_list_images(self): + images = self.driver.list_images() + self.assertTrue(len(images) >= 1) + expected_node_image = NodeImage( + id="01000000-0000-4000-8000-000010010101", + name="Windows Server 2003 R2 Standard (CD 1)", + driver=self.driver, + extra={ + "access": "public", + "license": 0, + "size": 1, + "state": "online", + "type": "cdrom", + }, + ) + self.assert_object(expected_node_image, objects=images) + + def test_create_node_from_template(self): + image = NodeImage( + id="01000000-0000-4000-8000-000030060200", + name="Ubuntu Server 16.04 LTS (Xenial Xerus)", + extra={"type": "template"}, + driver=self.driver, + ) + location = NodeLocation(id="fi-hel1", name="Helsinki #1", country="FI", driver=self.driver) + size = NodeSize( + id="1xCPU-1GB", + name="1xCPU-1GB", + ram=1024, + disk=30, + bandwidth=2048, + extra={"storage_tier": "maxiops"}, + price=None, + driver=self.driver, + ) + node = self.driver.create_node( + name="test_server", + size=size, + image=image, + location=location, + ex_hostname="myhost.somewhere", + ) + + self.assertTrue( + re.match( + "^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$", + node.id, + ) + ) + self.assertEqual(node.name, "test_server") + self.assertEqual(node.state, NodeState.STARTING) + self.assertTrue(len(node.public_ips) > 0) + self.assertTrue(len(node.private_ips) > 0) + self.assertEqual(node.driver, self.driver) + self.assertTrue(len(node.extra["password"]) > 0) + self.assertTrue(len(node.extra["vnc_password"]) > 0) + + def test_create_node_with_ssh_keys(self): + image = NodeImage( + id="01000000-0000-4000-8000-000030060200", + name="Ubuntu Server 16.04 LTS (Xenial Xerus)", + extra={"type": "template"}, + driver=self.driver, + ) + location = NodeLocation(id="fi-hel1", name="Helsinki #1", country="FI", driver=self.driver) + size = NodeSize( + id="1xCPU-1GB", + name="1xCPU-1GB", + ram=1024, + disk=30, + bandwidth=2048, + extra={"storage_tier": "maxiops"}, + price=None, + driver=self.driver, + ) + + auth = NodeAuthSSHKey("publikey") + node = self.driver.create_node( + name="test_server", size=size, image=image, location=location, auth=auth + ) + self.assertTrue( + re.match( + "^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$", + node.id, + ) + ) + self.assertEqual(node.name, "test_server") + self.assertEqual(node.state, NodeState.STARTING) + self.assertTrue(len(node.public_ips) > 0) + self.assertTrue(len(node.private_ips) > 0) + self.assertEqual(node.driver, self.driver) + + def test_create_node_with_extra_storage_devices(self): + image = NodeImage( + id="01000000-0000-4000-8000-000030060200", + name="Ubuntu Server 16.04 LTS (Xenial Xerus)", + extra={"type": "template"}, + driver=self.driver, + ) + location = NodeLocation(id="fi-hel1", name="Helsinki #1", country="FI", driver=self.driver) + size = NodeSize( + id="1xCPU-1GB", + name="1xCPU-1GB", + ram=1024, + disk=30, + bandwidth=2048, + extra={"storage_tier": "maxiops"}, + price=None, + driver=self.driver, + ) + extra_storage = { + "action": "create", + "title": "data", + "size": 25, + "tier": "maxiops", + } + + self.driver.create_node( + name="test_server", + size=size, + image=image, + location=location, + ex_storage_devices=[extra_storage], + ) + + storage_devices = UpcloudMockHttp.last_request_body["server"]["storage_devices"][ + "storage_device" + ] + self.assertEqual(len(storage_devices), 2) + self.assertEqual(storage_devices[1], extra_storage) + + def test_create_node_with_metadata_enabled(self): + image = NodeImage( + id="01000000-0000-4000-8000-000030060200", + name="Ubuntu Server 16.04 LTS (Xenial Xerus)", + extra={"type": "template"}, + driver=self.driver, + ) + location = NodeLocation(id="fi-hel1", name="Helsinki #1", country="FI", driver=self.driver) + size = NodeSize( + id="1xCPU-1GB", + name="1xCPU-1GB", + ram=1024, + disk=30, + bandwidth=2048, + extra={"storage_tier": "maxiops"}, + price=None, + driver=self.driver, + ) + + self.driver.create_node( + name="test_server", + size=size, + image=image, + location=location, + ex_metadata="yes", + ) + + self.assertEqual(UpcloudMockHttp.last_request_body["server"]["metadata"], "yes") + + def test_list_volumes(self): + volumes = self.driver.list_volumes() + self.assertEqual(len(volumes), 2) + + volume = volumes[0] + self.assertIsInstance(volume, StorageVolume) + self.assertEqual(volume.id, "01eff7ad-168e-413e-83b0-054f6a28fa23") + self.assertEqual(volume.name, "Operating system disk") + self.assertEqual(volume.size, 10) + self.assertEqual(volume.extra["tier"], "hdd") + self.assertEqual(volume.extra["zone"], "uk-lon1") + + def test_create_volume(self): + location = NodeLocation(id="fi-hel1", name="Helsinki #1", country="FI", driver=self.driver) + volume = self.driver.create_volume( + size=50, + name="data", + location=location, + ex_tier="maxiops", + ) + + self.assertEqual(volume.id, "01d4fcd4-e446-433b-8a9c-551a1284952e") + self.assertEqual(volume.name, "data") + self.assertEqual(volume.size, 50) + request_storage = UpcloudMockHttp.last_request_body["storage"] + self.assertEqual(request_storage["tier"], "maxiops") + self.assertNotIn("encrypted", request_storage) + self.assertNotIn("labels", request_storage) + + def test_create_volume_requires_location(self): + with self.assertRaises(ValueError): + self.driver.create_volume(size=50, name="data") + + def test_attach_volume(self): + node = self.driver.list_nodes()[0] + volume = self.driver.list_volumes()[1] + + success = self.driver.attach_volume(node, volume, device="scsi") + + self.assertTrue(success) + request_device = UpcloudMockHttp.last_request_body["storage_device"] + self.assertEqual(request_device["storage"], volume.id) + self.assertEqual(request_device["address"], "scsi") + self.assertEqual(request_device["boot_disk"], "0") + + def test_detach_volume(self): + node = self.driver.list_nodes()[0] + volume = self.driver.list_volumes()[1] + self.assertTrue(self.driver.detach_volume(volume, ex_node=node, ex_address="scsi:0:0")) + + request_device = UpcloudMockHttp.last_request_body["storage_device"] + self.assertEqual(request_device["address"], "scsi:0:0") + + def test_detach_volume_requires_node_and_address(self): + volume = self.driver.list_volumes()[1] + with self.assertRaises(ValueError): + self.driver.detach_volume(volume) + + def test_destroy_volume(self): + volume = self.driver.list_volumes()[1] + self.assertTrue(self.driver.destroy_volume(volume)) + + def test_ex_list_firewall_rules(self): + node = self.driver.list_nodes()[0] + + rules = self.driver.ex_list_firewall_rules(node) + + self.assertEqual(len(rules), 2) + self.assertEqual(rules[0]["direction"], "in") + self.assertEqual(rules[0]["destination_port_start"], "22") + + def test_ex_get_firewall_rule(self): + node = self.driver.list_nodes()[0] + + rule = self.driver.ex_get_firewall_rule(node, 1) + + self.assertEqual(rule["position"], "1") + self.assertEqual(rule["action"], "accept") + + def test_ex_create_firewall_rule(self): + node = self.driver.list_nodes()[0] + rule = { + "direction": "in", + "family": "IPv4", + "protocol": "tcp", + "destination_port_start": "22", + "destination_port_end": "22", + "action": "accept", + "comment": "Allow SSH", + } + + created_rule = self.driver.ex_create_firewall_rule(node, rule) + + self.assertEqual(created_rule["position"], "1") + self.assertEqual( + UpcloudMockHttp.last_request_body, + {"firewall_rule": rule}, + ) + + def test_ex_create_firewall_rules(self): + node = self.driver.list_nodes()[0] + rules = [ + { + "direction": "in", + "family": "IPv4", + "protocol": "tcp", + "destination_port_start": "22", + "destination_port_end": "22", + "action": "accept", + "comment": "Allow SSH", + }, + {"direction": "in", "action": "drop"}, + ] + + success = self.driver.ex_create_firewall_rules(node, rules) + + self.assertTrue(success) + self.assertEqual( + UpcloudMockHttp.last_request_body, + {"firewall_rules": {"firewall_rule": rules}}, + ) + + def test_ex_delete_firewall_rule(self): + node = self.driver.list_nodes()[0] + + self.assertTrue(self.driver.ex_delete_firewall_rule(node, 1)) + + def test_list_nodes(self): + nodes = self.driver.list_nodes() + + self.assertTrue(len(nodes) >= 1) + node = nodes[0] + self.assertEqual(node.name, "test_server") + self.assertEqual(node.state, NodeState.RUNNING) + self.assertTrue(len(node.public_ips) > 0) + self.assertTrue(len(node.private_ips) > 0) + self.assertEqual(node.driver, self.driver) + + def test_to_node_without_vnc_password(self): + server = { + "uuid": "00f8c525-7e62-4108-8115-3958df5b43dc", + "title": "test_server", + "state": "started", + "ip_addresses": { + "ip_address": [ + {"access": "public", "address": "203.0.113.10"}, + {"access": "private", "address": "10.0.0.10"}, + ] + }, + } + + node = self.driver._to_node(server) + + self.assertEqual(node.extra, {}) + + def test_reboot_node(self): + nodes = self.driver.list_nodes() + success = self.driver.reboot_node(nodes[0]) + self.assertTrue(success) + + def test_start_node(self): + nodes = self.driver.list_nodes() + success = self.driver.start_node(nodes[0]) + + self.assertTrue(success) + self.assertIsNone(UpcloudMockHttp.last_request_body) + + def test_stop_node(self): + nodes = self.driver.list_nodes() + success = self.driver.stop_node(nodes[0], ex_stop_type="soft", ex_timeout=60) + + self.assertTrue(success) + self.assertEqual( + UpcloudMockHttp.last_request_body, + {"stop_server": {"stop_type": "soft", "timeout": 60}}, + ) + + def test_destroy_node(self): + if UpcloudDriver.connectionCls.conn_class == UpcloudMockHttp: + nodes = [ + Node( + id="00893c98_5d5a_4363_b177_88df518a2b60", + name="", + state="", + public_ips=[], + private_ips=[], + driver=self.driver, + ) + ] + else: + nodes = self.driver.list_nodes() + success = self.driver.destroy_node(nodes[0]) + self.assertTrue(success) + + def assert_object(self, expected_object, objects): + same_data = any([self.objects_equals(expected_object, obj) for obj in objects]) + self.assertTrue(same_data, "Objects does not match") + + def objects_equals(self, expected_obj, obj): + for name in vars(expected_obj): + expected_data = getattr(expected_obj, name) + actual_data = getattr(obj, name) + same_data = self.data_equals(expected_data, actual_data) + if not same_data: + break + return same_data + + def data_equals(self, expected_data, actual_data): + if isinstance(expected_data, dict): + return self.dicts_equals(expected_data, actual_data) + else: + return expected_data == actual_data + + def dicts_equals(self, d1, d2): + dict_keys_same = set(d1.keys()) == set(d2.keys()) + if not dict_keys_same: + return False + + for key in d1.keys(): + if d1[key] != d2[key]: + return False + + return True + + +class UpcloudMockHttp(MockHttp): + fixtures = ComputeFileFixtures("upcloud") + last_request_body = None + last_authorization = None + + def _1_3_zone(self, method, url, body, headers): + self.__class__.last_authorization = headers["Authorization"] + auth_type, auth_value = headers["Authorization"].split(" ", 1) + + if auth_type == "Bearer": + body = self.fixtures.load("api_1_2_zone.json") + status_code = httplib.OK + else: + username, password = ensure_string(base64.b64decode(auth_value)).split(":") + if username == "nosuchuser" and password == "nopwd": + body = self.fixtures.load("api_1_2_zone_failed_auth.json") + status_code = httplib.UNAUTHORIZED + else: + body = self.fixtures.load("api_1_2_zone.json") + status_code = httplib.OK + + return (status_code, body, {}, httplib.responses[httplib.OK]) + + def _1_3_plan(self, method, url, body, headers): + body = self.fixtures.load("api_1_2_plan.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_storage_cdrom(self, method, url, body, headers): + body = self.fixtures.load("api_1_2_storage_cdrom.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_storage_template(self, method, url, body, headers): + body = self.fixtures.load("api_1_2_storage_template.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_price(self, method, url, body, headers): + body = self.fixtures.load("api_1_2_price.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_server(self, method, url, body, headers): + if method == "POST": + dbody = json.loads(body) + self.__class__.last_request_body = dbody + storages = dbody["server"]["storage_devices"]["storage_device"] + if any(["type" in storage and storage["type"] == "cdrom" for storage in storages]): + body = self.fixtures.load("api_1_2_server_from_cdrom.json") + else: + body = self.fixtures.load("api_1_2_server_from_template.json") + else: + body = self.fixtures.load("api_1_2_server.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_storage_normal(self, method, url, body, headers): + body = self.fixtures.load("api_1_2_storage_normal.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_storage(self, method, url, body, headers): + self.__class__.last_request_body = json.loads(body) + body = self.fixtures.load("api_1_2_storage_create.json") + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + + def _1_3_server_00f8c525_7e62_4108_8115_3958df5b43dc_storage_attach( + self, method, url, body, headers + ): + self.__class__.last_request_body = json.loads(body) + body = self.fixtures.load("api_1_2_server_00f8c525-7e62-4108-8115-3958df5b43dc.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_server_00f8c525_7e62_4108_8115_3958df5b43dc_storage_detach( + self, method, url, body, headers + ): + self.__class__.last_request_body = json.loads(body) + body = self.fixtures.load("api_1_2_server_00f8c525-7e62-4108-8115-3958df5b43dc.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_storage_01d4fcd4_e446_433b_8a9c_551a1284952e(self, method, url, body, headers): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT]) + + def _1_3_server_00f8c525_7e62_4108_8115_3958df5b43dc_firewall_rule( + self, method, url, body, headers + ): + firewall_rule = { + "action": "accept", + "comment": "Allow SSH", + "destination_address_end": "", + "destination_address_start": "", + "destination_port_end": "22", + "destination_port_start": "22", + "direction": "in", + "family": "IPv4", + "icmp_type": "", + "position": "1", + "protocol": "tcp", + "source_address_end": "", + "source_address_start": "", + "source_port_end": "", + "source_port_start": "", + } + if method == "GET": + body = json.dumps( + { + "firewall_rules": { + "firewall_rule": [ + firewall_rule, + {"action": "drop", "direction": "in", "position": "2"}, + ] + } + } + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + if method == "POST": + self.__class__.last_request_body = json.loads(body) + body = json.dumps({"firewall_rule": firewall_rule}) + return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED]) + + self.__class__.last_request_body = json.loads(body) + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT]) + + def _1_3_server_00f8c525_7e62_4108_8115_3958df5b43dc_firewall_rule_1( + self, method, url, body, headers + ): + if method == "DELETE": + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT]) + + body = json.dumps( + { + "firewall_rule": { + "action": "accept", + "comment": "Allow SSH", + "destination_port_end": "22", + "destination_port_start": "22", + "direction": "in", + "family": "IPv4", + "position": "1", + "protocol": "tcp", + } + } + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_server_00f8c525_7e62_4108_8115_3958df5b43dc(self, method, url, body, headers): + body = self.fixtures.load("api_1_2_server_00f8c525-7e62-4108-8115-3958df5b43dc.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_server_00f8c525_7e62_4108_8115_3958df5b43dc_restart(self, method, url, body, headers): + body = self.fixtures.load( + "api_1_2_server_00f8c525-7e62-4108-8115-3958df5b43dc_restart.json" + ) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_server_00f8c525_7e62_4108_8115_3958df5b43dc_start(self, method, url, body, headers): + self.__class__.last_request_body = body + body = self.fixtures.load("api_1_2_server_00f8c525-7e62-4108-8115-3958df5b43dc.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_server_00f8c525_7e62_4108_8115_3958df5b43dc_stop(self, method, url, body, headers): + self.__class__.last_request_body = json.loads(body) + body = self.fixtures.load("api_1_2_server_00f8c525-7e62-4108-8115-3958df5b43dc.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _1_3_server_00893c98_5d5a_4363_b177_88df518a2b60(self, method, url, body, headers): + body = self.fixtures.load("api_1_2_server_00893c98-5d5a-4363-b177-88df518a2b60.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_vcl.py b/libcloud/test/compute/test_vcl.py index 31d0fb09f8..ce3fc8fb80 100644 --- a/libcloud/test/compute/test_vcl.py +++ b/libcloud/test/compute/test_vcl.py @@ -13,38 +13,33 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest import sys - -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import xmlrpclib - -from libcloud.compute.drivers.vcl import VCLNodeDriver as VCL -from libcloud.compute.types import NodeState +import unittest from libcloud.test import MockHttp -from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.utils.py3 import httplib, xmlrpclib from libcloud.test.secrets import VCL_PARAMS +from libcloud.compute.types import NodeState +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.vcl import VCLNodeDriver as VCL class VCLTests(unittest.TestCase): - def setUp(self): - VCL.connectionCls.conn_classes = ( - VCLMockHttp, VCLMockHttp) + VCL.connectionCls.conn_class = VCLMockHttp VCLMockHttp.type = None self.driver = VCL(*VCL_PARAMS) def test_list_nodes(self): - node = self.driver.list_nodes(ipaddr='192.168.1.1')[0] - self.assertEqual(node.name, 'CentOS 5.4 Base (32 bit VM)') + node = self.driver.list_nodes(ipaddr="192.168.1.1")[0] + self.assertEqual(node.name, "CentOS 5.4 Base (32 bit VM)") self.assertEqual(node.state, NodeState.RUNNING) - self.assertEqual(node.extra['pass'], 'ehkNGW') + self.assertEqual(node.extra["pass"], "ehkNGW") def test_list_images(self): images = self.driver.list_images() image = images[0] - self.assertEqual(image.id, '8') + self.assertEqual(image.id, "8") def test_list_sizes(self): sizes = self.driver.list_sizes() @@ -52,34 +47,31 @@ def test_list_sizes(self): def test_create_node(self): image = self.driver.list_images()[0] - node = self.driver.create_node(image=image) - self.assertEqual(node.id, '51') + node = self.driver.create_node(name=None, size=None, image=image) + self.assertEqual(node.id, "51") def test_destroy_node(self): - node = self.driver.list_nodes(ipaddr='192.168.1.1')[0] + node = self.driver.list_nodes(ipaddr="192.168.1.1")[0] self.assertTrue(self.driver.destroy_node(node)) def test_ex_update_node_access(self): - node = self.driver.list_nodes(ipaddr='192.168.1.1')[0] - node = self.driver.ex_update_node_access(node, ipaddr='192.168.1.2') - self.assertEqual(node.name, 'CentOS 5.4 Base (32 bit VM)') + node = self.driver.list_nodes(ipaddr="192.168.1.1")[0] + node = self.driver.ex_update_node_access(node, ipaddr="192.168.1.2") + self.assertEqual(node.name, "CentOS 5.4 Base (32 bit VM)") self.assertEqual(node.state, NodeState.RUNNING) - self.assertEqual(node.extra['pass'], 'ehkNGW') + self.assertEqual(node.extra["pass"], "ehkNGW") def test_ex_extend_request_time(self): - node = self.driver.list_nodes(ipaddr='192.168.1.1')[0] + node = self.driver.list_nodes(ipaddr="192.168.1.1")[0] self.assertTrue(self.driver.ex_extend_request_time(node, 60)) def test_ex_get_request_end_time(self): - node = self.driver.list_nodes(ipaddr='192.168.1.1')[0] - self.assertEqual( - self.driver.ex_get_request_end_time(node), - 1334168100 - ) + node = self.driver.list_nodes(ipaddr="192.168.1.1")[0] + self.assertEqual(self.driver.ex_get_request_end_time(node), 1334168100) class VCLMockHttp(MockHttp): - fixtures = ComputeFileFixtures('vcl') + fixtures = ComputeFileFixtures("vcl") def _get_method_name(self, type, use_param, qs, path): return "_xmlrpc" @@ -87,41 +79,37 @@ def _get_method_name(self, type, use_param, qs, path): def _xmlrpc(self, method, url, body, headers): params, meth_name = xmlrpclib.loads(body) if self.type: - meth_name = "%s_%s" % (meth_name, self.type) + meth_name = "{}_{}".format(meth_name, self.type) return getattr(self, meth_name)(method, url, body, headers) def XMLRPCgetImages(self, method, url, body, headers): - body = self.fixtures.load('XMLRPCgetImages.xml') + body = self.fixtures.load("XMLRPCgetImages.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def XMLRPCextendRequest(self, method, url, body, headers): - body = self.fixtures.load('XMLRPCextendRequest.xml') + body = self.fixtures.load("XMLRPCextendRequest.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def XMLRPCgetRequestIds(self, method, url, body, headers): - body = self.fixtures.load( - 'XMLRPCgetRequestIds.xml') + body = self.fixtures.load("XMLRPCgetRequestIds.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def XMLRPCgetRequestStatus(self, method, url, body, headers): - body = self.fixtures.load( - 'XMLRPCgetRequestStatus.xml') + body = self.fixtures.load("XMLRPCgetRequestStatus.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def XMLRPCendRequest(self, method, url, body, headers): - body = self.fixtures.load( - 'XMLRPCendRequest.xml') + body = self.fixtures.load("XMLRPCendRequest.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def XMLRPCaddRequest(self, method, url, body, headers): - body = self.fixtures.load( - 'XMLRPCaddRequest.xml') + body = self.fixtures.load("XMLRPCaddRequest.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def XMLRPCgetRequestConnectData(self, method, url, body, headers): - body = self.fixtures.load( - 'XMLRPCgetRequestConnectData.xml') + body = self.fixtures.load("XMLRPCgetRequestConnectData.xml") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) -if __name__ == '__main__': + +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_vcloud.py b/libcloud/test/compute/test_vcloud.py index fc801bebbf..86754a5323 100644 --- a/libcloud/test/compute/test_vcloud.py +++ b/libcloud/test/compute/test_vcloud.py @@ -13,42 +13,82 @@ # See the License for the specific language governing permissions and # limitations under the License. + +import re import sys +import datetime import unittest - -try: - from lxml import etree as ET -except ImportError: - from xml.etree import ElementTree as ET - -from libcloud.utils.py3 import httplib, b - -from libcloud.compute.drivers.vcloud import TerremarkDriver, VCloudNodeDriver, Subject -from libcloud.compute.drivers.vcloud import VCloud_1_5_NodeDriver, ControlAccess -from libcloud.compute.drivers.vcloud import VCloud_5_1_NodeDriver -from libcloud.compute.drivers.vcloud import Vdc -from libcloud.compute.base import Node, NodeImage -from libcloud.compute.types import NodeState +import traceback +from unittest.mock import patch, mock_open from libcloud.test import MockHttp +from libcloud.utils.py3 import ET, PY2, b, httplib, assertRaisesRegex +from libcloud.compute.base import Node, NodeImage from libcloud.test.compute import TestCaseMixin +from libcloud.test.secrets import VCLOUD_PARAMS +from libcloud.compute.types import NodeState +from libcloud.utils.iso8601 import UTC from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.vcloud import ( + Vdc, + Lease, + Subject, + ControlAccess, + TerremarkDriver, + VCloudNodeDriver, + VCloud_1_5_NodeDriver, + VCloud_5_1_NodeDriver, + VCloud_5_5_NodeDriver, + Instantiate_1_5_VAppXML, + fixxpath, + get_url_path, +) + +BUILTINS = "__builtin__" if PY2 else "builtins" + + +def print_parameterized_failure(names_values): + """ + Print failure information for a failed, parameterized test. + This includes a traceback and parameter values. -from libcloud.test.secrets import VCLOUD_PARAMS + :param names_values: Name, value pairs for parameters of test at failure + :type names_values: ``list`` of (``str``, ``Any``) + :return: None + :rtype: ``None`` + """ + formatted_names_values = ( + " {name}={value}".format(name=name, value=value) for name, value in names_values + ) + traceback.print_exc() + print( + "Data values:\n{values}\n".format(values="\n".join(formatted_names_values)), + file=sys.stderr, + ) + + +class CallException(Exception): + """ + For halting method execution with mocking + """ + + pass -class TerremarkTests(unittest.TestCase, TestCaseMixin): +class TerremarkTests(unittest.TestCase, TestCaseMixin): def setUp(self): VCloudNodeDriver.connectionCls.host = "test" - VCloudNodeDriver.connectionCls.conn_classes = (None, TerremarkMockHttp) + VCloudNodeDriver.connectionCls.conn_class = TerremarkMockHttp TerremarkMockHttp.type = None self.driver = TerremarkDriver(*VCLOUD_PARAMS) def test_list_images(self): ret = self.driver.list_images() self.assertEqual( - ret[0].id, 'https://services.vcloudexpress.terremark.com/api/v0.8/vAppTemplate/5') + ret[0].id, + "https://services.vcloudexpress.terremark.com/api/v0.8/vAppTemplate/5", + ) def test_list_sizes(self): ret = self.driver.list_sizes() @@ -58,27 +98,29 @@ def test_create_node(self): image = self.driver.list_images()[0] size = self.driver.list_sizes()[0] node = self.driver.create_node( - name='testerpart2', + name="testerpart2", image=image, size=size, - vdc='https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224', - network='https://services.vcloudexpress.terremark.com/api/v0.8/network/725', - cpus=2, + ex_vdc="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224", + ex_network="https://services.vcloudexpress.terremark.com/api/v0.8/network/725", + ex_cpus=2, ) self.assertTrue(isinstance(node, Node)) self.assertEqual( - node.id, 'https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031') - self.assertEqual(node.name, 'testerpart2') + node.id, "https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031" + ) + self.assertEqual(node.name, "testerpart2") def test_list_nodes(self): ret = self.driver.list_nodes() node = ret[0] self.assertEqual( - node.id, 'https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031') - self.assertEqual(node.name, 'testerpart2') + node.id, "https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031" + ) + self.assertEqual(node.name, "testerpart2") self.assertEqual(node.state, NodeState.RUNNING) self.assertEqual(node.public_ips, []) - self.assertEqual(node.private_ips, ['10.112.78.69']) + self.assertEqual(node.private_ips, ["10.112.78.69"]) def test_reboot_node(self): node = self.driver.list_nodes()[0] @@ -92,18 +134,18 @@ def test_destroy_node(self): class VCloud_1_5_Tests(unittest.TestCase, TestCaseMixin): - def setUp(self): - VCloudNodeDriver.connectionCls.host = 'test' - VCloudNodeDriver.connectionCls.conn_classes = ( - None, VCloud_1_5_MockHttp) + VCloudNodeDriver.connectionCls.host = "test" + VCloudNodeDriver.connectionCls.conn_class = VCloud_1_5_MockHttp VCloud_1_5_MockHttp.type = None self.driver = VCloud_1_5_NodeDriver(*VCLOUD_PARAMS) def test_list_images(self): ret = self.driver.list_images() self.assertEqual( - 'https://vm-vcloud/api/vAppTemplate/vappTemplate-ac1bc027-bf8c-4050-8643-4971f691c158', ret[0].id) + "https://vm-vcloud/api/vAppTemplate/vappTemplate-ac1bc027-bf8c-4050-8643-4971f691c158", + ret[0].id, + ) def test_list_sizes(self): ret = self.driver.list_sizes() @@ -112,66 +154,102 @@ def test_list_sizes(self): def test_networks(self): ret = self.driver.networks self.assertEqual( - ret[0].get('href'), 'https://vm-vcloud/api/network/dca8b667-6c8f-4c3e-be57-7a9425dba4f4') + ret[0].get("href"), + "https://vm-vcloud/api/network/dca8b667-6c8f-4c3e-be57-7a9425dba4f4", + ) def test_create_node(self): image = self.driver.list_images()[0] size = self.driver.list_sizes()[0] node = self.driver.create_node( - name='testNode', + name="testNode", image=image, size=size, - ex_vdc='MyVdc', - ex_network='vCloud - Default', + ex_vdc="MyVdc", + ex_network="vCloud - Default", cpus=2, ) self.assertTrue(isinstance(node, Node)) self.assertEqual( - 'https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a', node.id) - self.assertEqual('testNode', node.name) + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a", + node.id, + ) + self.assertEqual("testNode", node.name) def test_create_node_clone(self): image = self.driver.list_nodes()[0] - node = self.driver.create_node(name='testNode', image=image) + node = self.driver.create_node(size=None, name="testNode", image=image) self.assertTrue(isinstance(node, Node)) self.assertEqual( - 'https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a', node.id) - self.assertEqual('testNode', node.name) + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a", + node.id, + ) + self.assertEqual("testNode", node.name) def test_list_nodes(self): ret = self.driver.list_nodes() node = ret[0] self.assertEqual( - node.id, 'https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a') - self.assertEqual(node.name, 'testNode') + node.id, + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a", + ) + self.assertEqual(node.name, "testNode") self.assertEqual(node.state, NodeState.RUNNING) - self.assertEqual(node.public_ips, ['65.41.67.2']) - self.assertEqual(node.private_ips, ['65.41.67.2']) - self.assertEqual(node.extra, {'vdc': 'MyVdc', - 'vms': [{ - 'id': 'https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045', - 'name': 'testVm', - 'state': NodeState.RUNNING, - 'public_ips': ['65.41.67.2'], - 'private_ips': ['65.41.67.2'], - 'os_type': 'rhel5_64Guest' - }]}) + self.assertEqual(node.public_ips, ["65.41.67.2"]) + self.assertEqual(node.private_ips, ["65.41.67.2"]) + self.assertEqual( + node.extra, + { + "description": None, + "lease_settings": Lease( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/leaseSettingsSection/", + deployment_lease=0, + storage_lease=0, + ), + "vdc": "MyVdc", + "vms": [ + { + "id": "https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045", + "name": "testVm", + "state": NodeState.RUNNING, + "public_ips": ["65.41.67.2"], + "private_ips": ["65.41.67.2"], + "os_type": "rhel5_64Guest", + } + ], + }, + ) node = ret[1] self.assertEqual( - node.id, 'https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b') - self.assertEqual(node.name, 'testNode2') + node.id, + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b", + ) + self.assertEqual(node.name, "testNode2") self.assertEqual(node.state, NodeState.RUNNING) - self.assertEqual(node.public_ips, ['192.168.0.103']) - self.assertEqual(node.private_ips, ['192.168.0.100']) - self.assertEqual(node.extra, {'vdc': 'MyVdc', - 'vms': [{ - 'id': 'https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e046', - 'name': 'testVm2', - 'state': NodeState.RUNNING, - 'public_ips': ['192.168.0.103'], - 'private_ips': ['192.168.0.100'], - 'os_type': 'rhel5_64Guest' - }]}) + self.assertEqual(node.public_ips, ["192.168.0.103"]) + self.assertEqual(node.private_ips, ["192.168.0.100"]) + self.assertEqual( + node.extra, + { + "description": None, + "lease_settings": Lease( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b/leaseSettingsSection/", + deployment_lease=0, + storage_lease=0, + ), + "vdc": "MyVdc", + "vms": [ + { + "id": "https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e046", + "name": "testVm2", + "state": NodeState.RUNNING, + "public_ips": ["192.168.0.103"], + "private_ips": ["192.168.0.100"], + "os_type": "rhel5_64Guest", + } + ], + }, + ) def test_reboot_node(self): node = self.driver.list_nodes()[0] @@ -185,164 +263,645 @@ def test_destroy_node(self): def test_validate_vm_names(self): # valid inputs - self.driver._validate_vm_names(['host-n-ame-name']) - self.driver._validate_vm_names(['tc-mybuild-b1']) + self.driver._validate_vm_names(["host-n-ame-name"]) + self.driver._validate_vm_names(["tc-mybuild-b1"]) self.driver._validate_vm_names(None) # invalid inputs - self.assertRaises( - ValueError, self.driver._validate_vm_names, ['invalid.host']) - self.assertRaises( - ValueError, self.driver._validate_vm_names, ['inv-alid.host']) - self.assertRaises( - ValueError, self.driver._validate_vm_names, ['hostnametoooolong']) - self.assertRaises( - ValueError, self.driver._validate_vm_names, ['host$name']) + self.assertRaises(ValueError, self.driver._validate_vm_names, ["invalid.host"]) + self.assertRaises(ValueError, self.driver._validate_vm_names, ["inv-alid.host"]) + self.assertRaises(ValueError, self.driver._validate_vm_names, ["hostnametoooolong"]) + self.assertRaises(ValueError, self.driver._validate_vm_names, ["host$name"]) + self.assertRaises(ValueError, self.driver._validate_vm_names, ["hostname-"]) + self.assertRaises(ValueError, self.driver._validate_vm_names, ["hostname."]) + self.assertRaises(ValueError, self.driver._validate_vm_names, [".hostname"]) + self.assertRaises(ValueError, self.driver._validate_vm_names, ["-hostname"]) def test_change_vm_names(self): self.driver._change_vm_names( - '/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a', ['changed1', 'changed2']) + "/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a", + ["changed1", "changed2"], + ) + + def test_change_vm_admin_password(self): + self.driver.ex_change_vm_admin_password( + "/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a", "12345678" + ) def test_is_node(self): - self.assertTrue(self.driver._is_node( - Node('testId', 'testNode', state=0, public_ips=[], private_ips=[], driver=self.driver))) - self.assertFalse(self.driver._is_node( - NodeImage('testId', 'testNode', driver=self.driver))) + self.assertTrue( + self.driver._is_node( + Node( + "testId", + "testNode", + state=0, + public_ips=[], + private_ips=[], + driver=self.driver, + ) + ) + ) + self.assertFalse(self.driver._is_node(NodeImage("testId", "testNode", driver=self.driver))) + + def test_ex_deploy(self): + node = self.driver.ex_deploy_node( + Node( + "/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a", + "testNode", + state=0, + public_ips=[], + private_ips=[], + driver=self.driver, + ), + ex_force_customization=False, + ) + self.assertEqual(node.state, NodeState.RUNNING) def test_ex_undeploy(self): node = self.driver.ex_undeploy_node( - Node('https://test/api/vApp/undeployTest', 'testNode', state=0, - public_ips=[], private_ips=[], driver=self.driver)) + Node( + "https://test/api/vApp/undeployTest", + "testNode", + state=0, + public_ips=[], + private_ips=[], + driver=self.driver, + ) + ) self.assertEqual(node.state, NodeState.STOPPED) def test_ex_undeploy_with_error(self): node = self.driver.ex_undeploy_node( - Node('https://test/api/vApp/undeployErrorTest', 'testNode', - state=0, public_ips=[], private_ips=[], driver=self.driver)) + Node( + "https://test/api/vApp/undeployErrorTest", + "testNode", + state=0, + public_ips=[], + private_ips=[], + driver=self.driver, + ) + ) + self.assertEqual(node.state, NodeState.STOPPED) + + def test_ex_undeploy_power_off(self): + node = self.driver.ex_undeploy_node( + Node( + "https://test/api/vApp/undeployPowerOffTest", + "testNode", + state=0, + public_ips=[], + private_ips=[], + driver=self.driver, + ), + shutdown=False, + ) self.assertEqual(node.state, NodeState.STOPPED) def test_ex_find_node(self): - node = self.driver.ex_find_node('testNode') + node = self.driver.ex_find_node("testNode") self.assertEqual(node.name, "testNode") - node = self.driver.ex_find_node('testNode', self.driver.vdcs[0]) + node = self.driver.ex_find_node("testNode", self.driver.vdcs[0]) self.assertEqual(node.name, "testNode") - node = self.driver.ex_find_node('testNonExisting', self.driver.vdcs[0]) - self.assertEqual(node, None) + node = self.driver.ex_find_node("testNonExisting", self.driver.vdcs[0]) + self.assertIsNone(node) def test_ex_add_vm_disk__with_invalid_values(self): - self.assertRaises( - ValueError, self.driver.ex_add_vm_disk, 'dummy', 'invalid value') - self.assertRaises( - ValueError, self.driver.ex_add_vm_disk, 'dummy', '-1') + self.assertRaises(ValueError, self.driver.ex_add_vm_disk, "dummy", "invalid value") + self.assertRaises(ValueError, self.driver.ex_add_vm_disk, "dummy", "-1") def test_ex_add_vm_disk(self): - self.driver.ex_add_vm_disk('https://test/api/vApp/vm-test', '20') + self.driver.ex_add_vm_disk("https://test/api/vApp/vm-test", "20") def test_ex_set_vm_cpu__with_invalid_values(self): - self.assertRaises(ValueError, self.driver.ex_set_vm_cpu, 'dummy', 50) - self.assertRaises(ValueError, self.driver.ex_set_vm_cpu, 'dummy', -1) + self.assertRaises(ValueError, self.driver.ex_set_vm_cpu, "dummy", 50) + self.assertRaises(ValueError, self.driver.ex_set_vm_cpu, "dummy", -1) def test_ex_set_vm_cpu(self): - self.driver.ex_set_vm_cpu('https://test/api/vApp/vm-test', 4) + self.driver.ex_set_vm_cpu("https://test/api/vApp/vm-test", 4) def test_ex_set_vm_memory__with_invalid_values(self): - self.assertRaises( - ValueError, self.driver.ex_set_vm_memory, 'dummy', 777) - self.assertRaises( - ValueError, self.driver.ex_set_vm_memory, 'dummy', -1024) + self.assertRaises(ValueError, self.driver.ex_set_vm_memory, "dummy", 777) + self.assertRaises(ValueError, self.driver.ex_set_vm_memory, "dummy", -1024) def test_ex_set_vm_memory(self): - self.driver.ex_set_vm_memory('https://test/api/vApp/vm-test', 1024) + self.driver.ex_set_vm_memory("https://test/api/vApp/vm-test", 1024) def test_vdcs(self): vdcs = self.driver.vdcs self.assertEqual(len(vdcs), 1) self.assertEqual( - vdcs[0].id, 'https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0') - self.assertEqual(vdcs[0].name, 'MyVdc') - self.assertEqual(vdcs[0].allocation_model, 'AllocationPool') + vdcs[0].id, "https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0" + ) + self.assertEqual(vdcs[0].name, "MyVdc") + self.assertEqual(vdcs[0].allocation_model, "AllocationPool") self.assertEqual(vdcs[0].storage.limit, 5120000) self.assertEqual(vdcs[0].storage.used, 1984512) - self.assertEqual(vdcs[0].storage.units, 'MB') + self.assertEqual(vdcs[0].storage.units, "MB") self.assertEqual(vdcs[0].cpu.limit, 160000) self.assertEqual(vdcs[0].cpu.used, 0) - self.assertEqual(vdcs[0].cpu.units, 'MHz') + self.assertEqual(vdcs[0].cpu.units, "MHz") self.assertEqual(vdcs[0].memory.limit, 527360) self.assertEqual(vdcs[0].memory.used, 130752) - self.assertEqual(vdcs[0].memory.units, 'MB') + self.assertEqual(vdcs[0].memory.units, "MB") def test_ex_list_nodes(self): - self.assertEqual( - len(self.driver.ex_list_nodes()), len(self.driver.list_nodes())) + self.assertEqual(len(self.driver.ex_list_nodes()), len(self.driver.list_nodes())) def test_ex_list_nodes__masked_exception(self): """ Test that we don't mask other exceptions. """ - brokenVdc = Vdc('/api/vdc/brokenVdc', 'brokenVdc', self.driver) + brokenVdc = Vdc("/api/vdc/brokenVdc", "brokenVdc", self.driver) self.assertRaises(AnotherError, self.driver.ex_list_nodes, (brokenVdc)) def test_ex_power_off(self): node = Node( - 'https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b', - 'testNode', NodeState.RUNNING, [], [], self.driver) + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b", + "testNode", + NodeState.RUNNING, + [], + [], + self.driver, + ) self.driver.ex_power_off_node(node) def test_ex_query(self): results = self.driver.ex_query( - 'user', filter='name==jrambo', page=2, page_size=30, sort_desc='startDate') + "user", filter="name==jrambo", page=2, page_size=30, sort_desc="startDate" + ) self.assertEqual(len(results), 1) - self.assertEqual(results[0]['type'], 'UserRecord') - self.assertEqual(results[0]['name'], 'jrambo') - self.assertEqual(results[0]['isLdapUser'], 'true') + self.assertEqual(results[0]["type"], "UserRecord") + self.assertEqual(results[0]["name"], "jrambo") + self.assertEqual(results[0]["isLdapUser"], "true") def test_ex_get_control_access(self): node = Node( - 'https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b', - 'testNode', NodeState.RUNNING, [], [], self.driver) + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b", + "testNode", + NodeState.RUNNING, + [], + [], + self.driver, + ) control_access = self.driver.ex_get_control_access(node) - self.assertEqual( - control_access.everyone_access_level, ControlAccess.AccessLevel.READ_ONLY) + self.assertEqual(control_access.everyone_access_level, ControlAccess.AccessLevel.READ_ONLY) self.assertEqual(len(control_access.subjects), 1) - self.assertEqual(control_access.subjects[0].type, 'group') - self.assertEqual(control_access.subjects[0].name, 'MyGroup') - self.assertEqual(control_access.subjects[ - 0].id, 'https://vm-vcloud/api/admin/group/b8202c48-7151-4e61-9a6c-155474c7d413') - self.assertEqual(control_access.subjects[ - 0].access_level, ControlAccess.AccessLevel.FULL_CONTROL) + self.assertEqual(control_access.subjects[0].type, "group") + self.assertEqual(control_access.subjects[0].name, "MyGroup") + self.assertEqual( + control_access.subjects[0].id, + "https://vm-vcloud/api/admin/group/b8202c48-7151-4e61-9a6c-155474c7d413", + ) + self.assertEqual( + control_access.subjects[0].access_level, + ControlAccess.AccessLevel.FULL_CONTROL, + ) def test_ex_set_control_access(self): node = Node( - 'https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b', - 'testNode', NodeState.RUNNING, [], [], self.driver) - control_access = ControlAccess(node, None, [Subject( - name='MyGroup', - type='group', - access_level=ControlAccess.AccessLevel.FULL_CONTROL)]) + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b", + "testNode", + NodeState.RUNNING, + [], + [], + self.driver, + ) + control_access = ControlAccess( + node, + None, + [ + Subject( + name="MyGroup", + type="group", + access_level=ControlAccess.AccessLevel.FULL_CONTROL, + ) + ], + ) self.driver.ex_set_control_access(node, control_access) def test_ex_get_metadata(self): node = Node( - 'https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b', - 'testNode', NodeState.RUNNING, [], [], self.driver) + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b", + "testNode", + NodeState.RUNNING, + [], + [], + self.driver, + ) metadata = self.driver.ex_get_metadata(node) - self.assertEqual(metadata, {'owners': 'msamia@netsuite.com'}) + self.assertEqual(metadata, {"owners": "msamia@netsuite.com"}) def test_ex_set_metadata_entry(self): node = Node( - 'https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b', - 'testNode', NodeState.RUNNING, [], [], self.driver) - self.driver.ex_set_metadata_entry(node, 'foo', 'bar') + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b", + "testNode", + NodeState.RUNNING, + [], + [], + self.driver, + ) + self.driver.ex_set_metadata_entry(node, "foo", "bar") + def test_ex_find_vm_nodes(self): + nodes = self.driver.ex_find_vm_nodes("testVm2") + self.assertEqual(len(nodes), 1) + self.assertEqual( + nodes[0].id, + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b", + ) -class VCloud_5_1_Tests(unittest.TestCase, TestCaseMixin): + def test_get_node(self): + node = self.driver._ex_get_node( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a" + ) + self.assertEqual(node.name, "testNode") + + def test_get_node_forbidden(self): + self.assertRaises( + Exception, + self.driver._ex_get_node, + "https://vm-vcloud/api/vApp/vapp-access-to-resource-forbidden", + ) + + def test_to_node_description(self): + node = self.driver._ex_get_node( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a" + ) + self.assertIsNone(node.extra["description"]) + node = self.driver._ex_get_node( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6d" + ) + self.assertEqual(node.extra["description"], "Test Description") + + def test_to_node_lease_settings(self): + node = self.driver._ex_get_node( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a" + ) + lease = Lease( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/leaseSettingsSection/", + deployment_lease=0, + storage_lease=0, + ) + self.assertEqual(node.extra["lease_settings"], lease) + node = self.driver._ex_get_node( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6d" + ) + # 2019-10-07T14:06:29.980725 + lease = Lease( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6d/leaseSettingsSection/", + deployment_lease=86400, + storage_lease=172800, + deployment_lease_expiration=datetime.datetime( + year=2019, + month=10, + day=7, + hour=14, + minute=6, + second=29, + microsecond=980725, + tzinfo=UTC, + ), + storage_lease_expiration=datetime.datetime( + year=2019, + month=10, + day=8, + hour=14, + minute=6, + second=29, + microsecond=980725, + tzinfo=UTC, + ), + ) + self.assertEqual(node.extra["lease_settings"], lease) + + def test_remove_admin_password(self): + pass_enabled_xml = "{text}" + pass_enabled_true = pass_enabled_xml.format(text="true") + pass_enabled_false = pass_enabled_xml.format(text="false") + pass_auto_xml = "{text}" + pass_auto_true = pass_auto_xml.format(text="true") + pass_auto_false = pass_auto_xml.format(text="false") + passwd = "testpassword" + assertion_error = False + + for admin_pass_enabled, admin_pass_auto, admin_pass, pass_exists in ( + (pass_enabled_true, pass_auto_true, passwd, False), + (pass_enabled_true, pass_auto_true, "", False), + (pass_enabled_true, pass_auto_false, passwd, True), + (pass_enabled_true, pass_auto_false, "", False), + (pass_enabled_true, "", passwd, False), + (pass_enabled_true, "", "", False), + (pass_enabled_false, pass_auto_true, passwd, False), + (pass_enabled_false, pass_auto_true, "", False), + (pass_enabled_false, pass_auto_false, passwd, False), + (pass_enabled_false, pass_auto_false, "", False), + (pass_enabled_false, "", passwd, False), + (pass_enabled_false, "", "", False), + ("", pass_auto_true, passwd, False), + ("", pass_auto_true, "", False), + ("", pass_auto_false, passwd, False), + ("", pass_auto_false, "", False), + ("", "", passwd, False), + ("", "", "", False), + ): + try: + guest_customization_section = ET.fromstring( + '' + + admin_pass_enabled + + admin_pass_auto + + admin_pass + + "" + ) + self.driver._remove_admin_password(guest_customization_section) + admin_pass_element = guest_customization_section.find( + fixxpath(guest_customization_section, "AdminPassword") + ) + + if pass_exists: + self.assertIsNotNone(admin_pass_element) + else: + self.assertIsNone(admin_pass_element) + except AssertionError: + assertion_error = True + print_parameterized_failure( + [ + ("admin_pass_enabled", admin_pass_enabled), + ("admin_pass_auto", admin_pass_auto), + ("admin_pass", admin_pass), + ("pass_exists", pass_exists), + ] + ) + + if assertion_error: + self.fail(msg="Assertion error(s) encountered. Details above.") + + @patch( + "libcloud.compute.drivers.vcloud.VCloud_1_5_NodeDriver._get_vm_elements", + side_effect=CallException("Called"), + ) + def test_change_vm_script_text_and_file_logic(self, _): + assertion_error = False + + for ( + vm_script_file, + vm_script_text, + open_succeeds, + open_call_count, + returned_early, + ) in ( + (None, None, True, 0, True), + (None, None, False, 0, True), + (None, "script text", True, 0, False), + (None, "script text", False, 0, False), + ("file.sh", None, True, 1, False), + ("file.sh", None, False, 1, True), + ("file.sh", "script text", True, 0, False), + ("file.sh", "script text", False, 0, False), + ): + try: + if open_succeeds: + open_mock = patch(BUILTINS + ".open", mock_open(read_data="script text")) + else: + open_mock = patch(BUILTINS + ".open", side_effect=Exception()) + with open_mock as mocked_open: + try: + self.driver._change_vm_script( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6d", + vm_script=vm_script_file, + vm_script_text=vm_script_text, + ) + returned_early_res = True + except CallException: + returned_early_res = False + self.assertEqual(mocked_open.call_count, open_call_count) + self.assertEqual(returned_early_res, returned_early) + except AssertionError: + assertion_error = True + print_parameterized_failure( + [ + ("vm_script_file", vm_script_file), + ("vm_script_text", vm_script_text), + ("open_succeeds", open_succeeds), + ("open_call_count", open_call_count), + ("returned_early", returned_early), + ] + ) + + if assertion_error: + self.fail(msg="Assertion error(s) encountered. Details above.") + + def test_build_xmltree_description(self): + instantiate_xml = Instantiate_1_5_VAppXML( + name="testNode", + template="https://vm-vcloud/api/vAppTemplate/vappTemplate-ac1bc027-bf8c-4050-8643-4971f691c158", + network=None, + vm_network=None, + vm_fence=None, + description=None, + ) + self.assertIsNone(instantiate_xml.description) + self.assertIsNone(instantiate_xml.root.find("Description")) + + test_description = "Test Description" + instantiate_xml = Instantiate_1_5_VAppXML( + name="testNode", + template="https://vm-vcloud/api/vAppTemplate/vappTemplate-ac1bc027-bf8c-4050-8643-4971f691c158", + network=None, + vm_network=None, + vm_fence=None, + description=test_description, + ) + self.assertEqual(instantiate_xml.description, test_description) + description_elem = instantiate_xml.root.find("Description") + self.assertIsNotNone(description_elem) + self.assertEqual(description_elem.text, test_description) + + def test_to_lease(self): + res = self.driver.connection.request( + get_url_path("https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6d"), + headers={"Content-Type": "application/vnd.vmware.vcloud.vApp+xml"}, + ) + lease_settings_section = res.object.find(fixxpath(res.object, "LeaseSettingsSection")) + lease = Lease.to_lease(lease_element=lease_settings_section) + self.assertEqual(lease.deployment_lease, 86400) + self.assertEqual( + lease.deployment_lease_expiration, + datetime.datetime( + year=2019, + month=10, + day=7, + hour=14, + minute=6, + second=29, + microsecond=980725, + tzinfo=UTC, + ), + ) + self.assertEqual(lease.storage_lease, 172800) + self.assertEqual( + lease.storage_lease_expiration, + datetime.datetime( + year=2019, + month=10, + day=8, + hour=14, + minute=6, + second=29, + microsecond=980725, + tzinfo=UTC, + ), + ) + + def test_lease_get_time_deployed(self): + deployment_datetime = datetime.datetime( + year=2019, + month=10, + day=6, + hour=14, + minute=6, + second=29, + microsecond=980725, + tzinfo=UTC, + ) + deployment_lease_exp_actual = datetime.datetime( + year=2019, + month=10, + day=7, + hour=14, + minute=6, + second=29, + microsecond=980725, + tzinfo=UTC, + ) + storage_lease_exp_actual = datetime.datetime( + year=2019, + month=10, + day=8, + hour=14, + minute=6, + second=29, + microsecond=980725, + tzinfo=UTC, + ) + assertion_error = False + + for ( + deployment_lease, + storage_lease, + deployment_lease_exp, + storage_lease_exp, + exception, + res, + ) in ( + (None, None, None, None, True, None), + (None, None, None, storage_lease_exp_actual, True, None), + (None, None, deployment_lease_exp_actual, None, True, None), + ( + None, + None, + deployment_lease_exp_actual, + storage_lease_exp_actual, + True, + None, + ), + (None, 172800, None, None, True, None), + (None, 172800, None, storage_lease_exp_actual, False, deployment_datetime), + ( + None, + 172800, + deployment_lease_exp_actual, + None, + True, + deployment_datetime, + ), + ( + None, + 172800, + deployment_lease_exp_actual, + storage_lease_exp_actual, + False, + deployment_datetime, + ), + (86400, None, None, None, True, None), + (86400, None, None, storage_lease_exp_actual, True, None), + ( + 86400, + None, + deployment_lease_exp_actual, + None, + False, + deployment_datetime, + ), + ( + 86400, + None, + deployment_lease_exp_actual, + storage_lease_exp_actual, + False, + deployment_datetime, + ), + (86400, 172800, None, None, True, None), + (86400, 172800, None, storage_lease_exp_actual, False, deployment_datetime), + ( + 86400, + 172800, + deployment_lease_exp_actual, + None, + False, + deployment_datetime, + ), + ( + 86400, + 172800, + deployment_lease_exp_actual, + storage_lease_exp_actual, + False, + deployment_datetime, + ), + ): + try: + lease = Lease( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/leaseSettingsSection/", + deployment_lease=deployment_lease, + storage_lease=storage_lease, + deployment_lease_expiration=deployment_lease_exp, + storage_lease_expiration=storage_lease_exp, + ) + + if exception: + with assertRaisesRegex( + self, + Exception, + re.escape( + "Cannot get time deployed. Missing complete lease and expiration information." + ), + ): + lease.get_deployment_time() + else: + self.assertEqual(lease.get_deployment_time(), res) + except AssertionError: + assertion_error = True + print_parameterized_failure( + [ + ("deployment_lease", deployment_lease), + ("storage_lease", storage_lease), + ("deployment_lease_exp", deployment_lease_exp), + ("storage_lease_exp", storage_lease_exp), + ("exception", exception), + ("res", res), + ] + ) + + if assertion_error: + self.fail(msg="Assertion error(s) encountered. Details above.") + + +class VCloud_5_1_Tests(unittest.TestCase, TestCaseMixin): def setUp(self): - VCloudNodeDriver.connectionCls.host = 'test' - VCloudNodeDriver.connectionCls.conn_classes = ( - None, VCloud_1_5_MockHttp) + VCloudNodeDriver.connectionCls.host = "test" + VCloudNodeDriver.connectionCls.conn_class = VCloud_1_5_MockHttp VCloud_1_5_MockHttp.type = None - self.driver = VCloudNodeDriver( - *VCLOUD_PARAMS, **{'api_version': '5.1'}) + self.driver = VCloudNodeDriver(*VCLOUD_PARAMS, **{"api_version": "5.1"}) self.assertTrue(isinstance(self.driver, VCloud_5_1_NodeDriver)) @@ -355,13 +914,13 @@ def _test_create_node_valid_ex_vm_memory(self): for value in values: self.driver.create_node( - name='testerpart2', + name="testerpart2", image=image, size=size, - vdc='https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224', - network='https://services.vcloudexpress.terremark.com/api/v0.8/network/725', + vdc="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224", + network="https://services.vcloudexpress.terremark.com/api/v0.8/network/725", cpus=2, - ex_vm_memory=value + ex_vm_memory=value, ) def test_create_node_invalid_ex_vm_memory(self): @@ -373,100 +932,161 @@ def test_create_node_invalid_ex_vm_memory(self): for value in values: try: self.driver.create_node( - name='testerpart2', + name="testerpart2", image=image, size=size, - vdc='https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224', - network='https://services.vcloudexpress.terremark.com/api/v0.8/network/725', + vdc="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224", + network="https://services.vcloudexpress.terremark.com/api/v0.8/network/725", cpus=2, - ex_vm_memory=value + ex_vm_memory=value, ) except ValueError: pass else: - self.fail('Exception was not thrown') + self.fail("Exception was not thrown") def test_list_images(self): ret = self.driver.list_images() self.assertEqual( - 'https://vm-vcloud/api/vAppTemplate/vappTemplate-ac1bc027-bf8c-4050-8643-4971f691c158', ret[0].id) + "https://vm-vcloud/api/vAppTemplate/vappTemplate-ac1bc027-bf8c-4050-8643-4971f691c158", + ret[0].id, + ) -class TerremarkMockHttp(MockHttp): +class VCloud_5_5_Tests(unittest.TestCase, TestCaseMixin): + def setUp(self): + VCloudNodeDriver.connectionCls.host = "test" + VCloudNodeDriver.connectionCls.conn_class = VCloud_5_5_MockHttp + VCloud_5_5_MockHttp.type = None + self.driver = VCloudNodeDriver(*VCLOUD_PARAMS, **{"api_version": "5.5"}) + + self.assertTrue(isinstance(self.driver, VCloud_5_5_NodeDriver)) + + def test_ex_create_snapshot(self): + node = Node( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b", + "testNode", + NodeState.RUNNING, + [], + [], + self.driver, + ) + self.driver.ex_create_snapshot(node) + + def test_ex_remove_snapshots(self): + node = Node( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b", + "testNode", + NodeState.RUNNING, + [], + [], + self.driver, + ) + self.driver.ex_remove_snapshots(node) + + def test_ex_revert_to_snapshot(self): + node = Node( + "https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b", + "testNode", + NodeState.RUNNING, + [], + [], + self.driver, + ) + self.driver.ex_revert_to_snapshot(node) + + def test_ex_acquire_mks_ticket(self): + node = self.driver.ex_find_node("testNode") + self.driver.ex_acquire_mks_ticket(node.id) + + def test_get_auth_headers(self): + headers = self.driver.connection._get_auth_headers() + self.assertEqual(headers["Accept"], "application/*+xml;version=5.5") - fixtures = ComputeFileFixtures('terremark') + +class TerremarkMockHttp(MockHttp): + fixtures = ComputeFileFixtures("terremark") def _api_v0_8_login(self, method, url, body, headers): - headers['set-cookie'] = 'vcloud-token=testtoken' - body = self.fixtures.load('api_v0_8_login.xml') + headers["set-cookie"] = "vcloud-token=testtoken" + body = self.fixtures.load("api_v0_8_login.xml") + return (httplib.OK, body, headers, httplib.responses[httplib.OK]) def _api_v0_8_org_240(self, method, url, body, headers): - body = self.fixtures.load('api_v0_8_org_240.xml') + body = self.fixtures.load("api_v0_8_org_240.xml") + return (httplib.OK, body, headers, httplib.responses[httplib.OK]) def _api_v0_8_vdc_224(self, method, url, body, headers): - body = self.fixtures.load('api_v0_8_vdc_224.xml') + body = self.fixtures.load("api_v0_8_vdc_224.xml") + return (httplib.OK, body, headers, httplib.responses[httplib.OK]) def _api_v0_8_vdc_224_catalog(self, method, url, body, headers): - body = self.fixtures.load('api_v0_8_vdc_224_catalog.xml') + body = self.fixtures.load("api_v0_8_vdc_224_catalog.xml") + return (httplib.OK, body, headers, httplib.responses[httplib.OK]) def _api_v0_8_catalogItem_5(self, method, url, body, headers): - body = self.fixtures.load('api_v0_8_catalogItem_5.xml') + body = self.fixtures.load("api_v0_8_catalogItem_5.xml") + return (httplib.OK, body, headers, httplib.responses[httplib.OK]) def _api_v0_8_vdc_224_action_instantiateVAppTemplate(self, method, url, body, headers): - body = self.fixtures.load( - 'api_v0_8_vdc_224_action_instantiateVAppTemplate.xml') + body = self.fixtures.load("api_v0_8_vdc_224_action_instantiateVAppTemplate.xml") + return (httplib.OK, body, headers, httplib.responses[httplib.OK]) def _api_v0_8_vapp_14031_action_deploy(self, method, url, body, headers): - body = self.fixtures.load('api_v0_8_vapp_14031_action_deploy.xml') + body = self.fixtures.load("api_v0_8_vapp_14031_action_deploy.xml") + return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) def _api_v0_8_task_10496(self, method, url, body, headers): - body = self.fixtures.load('api_v0_8_task_10496.xml') + body = self.fixtures.load("api_v0_8_task_10496.xml") + return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) def _api_v0_8_vapp_14031_power_action_powerOn(self, method, url, body, headers): - body = self.fixtures.load( - 'api_v0_8_vapp_14031_power_action_powerOn.xml') + body = self.fixtures.load("api_v0_8_vapp_14031_power_action_powerOn.xml") + return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) def _api_v0_8_vapp_14031(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load('api_v0_8_vapp_14031_get.xml') - elif method == 'DELETE': - body = '' + if method == "GET": + body = self.fixtures.load("api_v0_8_vapp_14031_get.xml") + elif method == "DELETE": + body = "" + return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) def _api_v0_8_vapp_14031_power_action_reset(self, method, url, body, headers): - body = self.fixtures.load('api_v0_8_vapp_14031_power_action_reset.xml') + body = self.fixtures.load("api_v0_8_vapp_14031_power_action_reset.xml") + return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) def _api_v0_8_vapp_14031_power_action_poweroff(self, method, url, body, headers): - body = self.fixtures.load( - 'api_v0_8_vapp_14031_power_action_poweroff.xml') + body = self.fixtures.load("api_v0_8_vapp_14031_power_action_poweroff.xml") + return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) def _api_v0_8_task_11001(self, method, url, body, headers): - body = self.fixtures.load('api_v0_8_task_11001.xml') + body = self.fixtures.load("api_v0_8_task_11001.xml") + return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]) class AnotherErrorMember(Exception): - """ helper class for the synthetic exception """ def __init__(self): - self.tag = 'Error' + self.tag = "Error" def get(self, foo): - return 'ACCESS_TO_RESOURCE_IS_FORBIDDEN_1' + return "ACCESS_TO_RESOURCE_IS_FORBIDDEN_1" class AnotherError(Exception): @@ -474,244 +1094,384 @@ class AnotherError(Exception): class VCloud_1_5_MockHttp(MockHttp, unittest.TestCase): + fixtures = ComputeFileFixtures("vcloud_1_5") - fixtures = ComputeFileFixtures('vcloud_1_5') - - def request(self, method, url, body=None, headers=None, raw=False): - self.assertTrue(url.startswith('/api/'), - ('"%s" is invalid. Needs to ' - 'start with "/api". The passed URL should be just ' - 'the path, not full URL.', url)) - super(VCloud_1_5_MockHttp, self).request(method, url, body, headers, - raw) + def request(self, method, url, body=None, headers=None, raw=False, stream=False): + self.assertTrue( + url.startswith("/api/"), + ( + '"%s" is invalid. Needs to ' + 'start with "/api". The passed URL should be just ' + "the path, not full URL.", + url, + ), + ) + super().request(method, url, body, headers, raw) def _api_sessions(self, method, url, body, headers): - headers['x-vcloud-authorization'] = 'testtoken' - body = self.fixtures.load('api_sessions.xml') + headers["x-vcloud-authorization"] = "testtoken" + body = self.fixtures.load("api_sessions.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_org(self, method, url, body, headers): - body = self.fixtures.load('api_org.xml') + body = self.fixtures.load("api_org.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_org_96726c78_4ae3_402f_b08b_7a78c6903d2a(self, method, url, body, headers): - body = self.fixtures.load( - 'api_org_96726c78_4ae3_402f_b08b_7a78c6903d2a.xml') + body = self.fixtures.load("api_org_96726c78_4ae3_402f_b08b_7a78c6903d2a.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_network_dca8b667_6c8f_4c3e_be57_7a9425dba4f4(self, method, url, body, headers): - body = self.fixtures.load( - 'api_network_dca8b667_6c8f_4c3e_be57_7a9425dba4f4.xml') + body = self.fixtures.load("api_network_dca8b667_6c8f_4c3e_be57_7a9425dba4f4.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0(self, method, url, body, headers): - body = self.fixtures.load( - 'api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0.xml') + body = self.fixtures.load("api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_vdc_brokenVdc(self, method, url, body, headers): - body = self.fixtures.load('api_vdc_brokenVdc.xml') + body = self.fixtures.load("api_vdc_brokenVdc.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_vApp_vapp_errorRaiser(self, method, url, body, headers): m = AnotherErrorMember() raise AnotherError(m) - def _api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0_action_instantiateVAppTemplate(self, method, url, body, headers): + def _api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0_action_instantiateVAppTemplate( + self, method, url, body, headers + ): body = self.fixtures.load( - 'api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0_action_instantiateVAppTemplate.xml') + "api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0_action_instantiateVAppTemplate.xml" + ) + return httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED] - def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a_power_action_powerOn(self, method, url, body, headers): - return self._api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_power_action_all(method, url, body, headers) + def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a_power_action_powerOn( + self, method, url, body, headers + ): + return self._api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_power_action_all( + method, url, body, headers + ) # Clone - def _api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0_action_cloneVApp(self, method, url, body, headers): + def _api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0_action_cloneVApp( + self, method, url, body, headers + ): body = self.fixtures.load( - 'api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0_action_cloneVApp.xml') + "api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0_action_cloneVApp.xml" + ) + return httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED] - def _api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045_networkConnectionSection(self, method, url, body, headers): - body = self.fixtures.load( - 'api_task_b034df55_fe81_4798_bc81_1f0fd0ead450.xml') + def _api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045_networkConnectionSection( + self, method, url, body, headers + ): + body = self.fixtures.load("api_task_b034df55_fe81_4798_bc81_1f0fd0ead450.xml") + return httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED] def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a(self, method, url, body, headers): status = httplib.OK - if method == 'GET': - body = self.fixtures.load( - 'api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a.xml') + + if method == "GET": + body = self.fixtures.load("api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a.xml") status = httplib.OK - elif method == 'DELETE': - body = self.fixtures.load( - 'api_task_b034df55_fe81_4798_bc81_1f0fd0ead450.xml') + elif method == "DELETE": + body = self.fixtures.load("api_task_b034df55_fe81_4798_bc81_1f0fd0ead450.xml") status = httplib.ACCEPTED + return status, body, headers, httplib.responses[status] def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b(self, method, url, body, headers): - body = self.fixtures.load( - 'api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b.xml') + body = self.fixtures.load("api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c(self, method, url, body, headers): - body = self.fixtures.load( - 'api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c.xml') + body = self.fixtures.load("api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045(self, method, url, body, headers): body = self.fixtures.load( - 'put_api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045_guestCustomizationSection.xml') + "put_api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045_guestCustomizationSection.xml" + ) + return httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED] - def _api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045_guestCustomizationSection(self, method, url, body, headers): - if method == 'GET': + def _api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045_guestCustomizationSection( + self, method, url, body, headers + ): + if method == "GET": body = self.fixtures.load( - 'get_api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045_guestCustomizationSection.xml') + "get_api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045_guestCustomizationSection.xml" + ) status = httplib.OK else: body = self.fixtures.load( - 'put_api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045_guestCustomizationSection.xml') + "put_api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045_guestCustomizationSection.xml" + ) status = httplib.ACCEPTED + return status, body, headers, httplib.responses[status] - def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a_power_action_reset(self, method, url, body, headers): - return self._api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_power_action_all(method, url, body, headers) + def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a_power_action_reset( + self, method, url, body, headers + ): + return self._api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_power_action_all( + method, url, body, headers + ) def _api_task_b034df55_fe81_4798_bc81_1f0fd0ead450(self, method, url, body, headers): - body = self.fixtures.load( - 'api_task_b034df55_fe81_4798_bc81_1f0fd0ead450.xml') + body = self.fixtures.load("api_task_b034df55_fe81_4798_bc81_1f0fd0ead450.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_catalog_cddb3cb2_3394_4b14_b831_11fbc4028da4(self, method, url, body, headers): - body = self.fixtures.load( - 'api_catalog_cddb3cb2_3394_4b14_b831_11fbc4028da4.xml') + body = self.fixtures.load("api_catalog_cddb3cb2_3394_4b14_b831_11fbc4028da4.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_catalogItem_3132e037_759b_4627_9056_ca66466fa607(self, method, url, body, headers): - body = self.fixtures.load( - 'api_catalogItem_3132e037_759b_4627_9056_ca66466fa607.xml') + body = self.fixtures.load("api_catalogItem_3132e037_759b_4627_9056_ca66466fa607.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] + def _api_vApp_deployTest(self, method, url, body, headers): + body = self.fixtures.load("api_task_deploy.xml") + + return httplib.OK, body, headers, httplib.responses[httplib.OK] + + def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a_action_deploy( + self, method, url, body, headers + ): + body = self.fixtures.load("api_task_deploy.xml") + + return httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED] + + def _api_task_deploy(self, method, url, body, headers): + body = self.fixtures.load("api_task_deploy.xml") + + return httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED] + def _api_vApp_undeployTest(self, method, url, body, headers): - body = self.fixtures.load('api_vApp_undeployTest.xml') + body = self.fixtures.load("api_vApp_undeployTest.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_vApp_undeployTest_action_undeploy(self, method, url, body, headers): - body = self.fixtures.load('api_task_undeploy.xml') + body = self.fixtures.load("api_task_undeploy.xml") + return httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED] def _api_task_undeploy(self, method, url, body, headers): - body = self.fixtures.load('api_task_undeploy.xml') + body = self.fixtures.load("api_task_undeploy.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_vApp_undeployErrorTest(self, method, url, body, headers): - body = self.fixtures.load('api_vApp_undeployTest.xml') + body = self.fixtures.load("api_vApp_undeployTest.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_vApp_undeployErrorTest_action_undeploy(self, method, url, body, headers): - if b('shutdown') in b(body): - body = self.fixtures.load('api_task_undeploy_error.xml') + if b("shutdown") in b(body): + body = self.fixtures.load("api_task_undeploy_error.xml") else: - body = self.fixtures.load('api_task_undeploy.xml') + body = self.fixtures.load("api_task_undeploy.xml") + return httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED] def _api_task_undeployError(self, method, url, body, headers): - body = self.fixtures.load('api_task_undeploy_error.xml') + body = self.fixtures.load("api_task_undeploy_error.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] + def _api_vApp_undeployPowerOffTest(self, method, url, body, headers): + return self._api_vApp_undeployTest(method, url, body, headers) + + def _api_vApp_undeployPowerOffTest_action_undeploy(self, method, url, body, headers): + self.assertIn(b("powerOff"), b(body)) + + return self._api_vApp_undeployTest_action_undeploy(method, url, body, headers) + def _api_vApp_vapp_access_to_resource_forbidden(self, method, url, body, headers): raise Exception( - ET.fromstring(self.fixtures.load('api_vApp_vapp_access_to_resource_forbidden.xml'))) + ET.fromstring(self.fixtures.load("api_vApp_vapp_access_to_resource_forbidden.xml")) + ) def _api_vApp_vm_test(self, method, url, body, headers): - body = self.fixtures.load('api_vApp_vm_test.xml') + body = self.fixtures.load("api_vApp_vm_test.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_vApp_vm_test_virtualHardwareSection_disks(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load( - 'get_api_vApp_vm_test_virtualHardwareSection_disks.xml') + if method == "GET": + body = self.fixtures.load("get_api_vApp_vm_test_virtualHardwareSection_disks.xml") status = httplib.OK else: - body = self.fixtures.load( - 'put_api_vApp_vm_test_virtualHardwareSection_disks.xml') + body = self.fixtures.load("put_api_vApp_vm_test_virtualHardwareSection_disks.xml") status = httplib.ACCEPTED + return status, body, headers, httplib.responses[status] def _api_vApp_vm_test_virtualHardwareSection_cpu(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load( - 'get_api_vApp_vm_test_virtualHardwareSection_cpu.xml') + if method == "GET": + body = self.fixtures.load("get_api_vApp_vm_test_virtualHardwareSection_cpu.xml") status = httplib.OK else: - body = self.fixtures.load( - 'put_api_vApp_vm_test_virtualHardwareSection_cpu.xml') + body = self.fixtures.load("put_api_vApp_vm_test_virtualHardwareSection_cpu.xml") status = httplib.ACCEPTED + return status, body, headers, httplib.responses[status] def _api_vApp_vm_test_virtualHardwareSection_memory(self, method, url, body, headers): - if method == 'GET': - body = self.fixtures.load( - 'get_api_vApp_vm_test_virtualHardwareSection_memory.xml') + if method == "GET": + body = self.fixtures.load("get_api_vApp_vm_test_virtualHardwareSection_memory.xml") status = httplib.OK else: - body = self.fixtures.load( - 'put_api_vApp_vm_test_virtualHardwareSection_memory.xml') + body = self.fixtures.load("put_api_vApp_vm_test_virtualHardwareSection_memory.xml") status = httplib.ACCEPTED + return status, body, headers, httplib.responses[status] - def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_power_action_powerOff(self, method, url, body, headers): - return self._api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_power_action_all(method, url, body, headers) + def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_power_action_powerOff( + self, method, url, body, headers + ): + return self._api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_power_action_all( + method, url, body, headers + ) - def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_power_action_all(self, method, url, body, headers): - assert method == 'POST' + def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_power_action_all( + self, method, url, body, headers + ): + assert method == "POST" body = self.fixtures.load( - 'api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a_power_action_all.xml') + "api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a_power_action_all.xml" + ) + return httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED] def _api_query(self, method, url, body, headers): - assert method == 'GET' - if 'type=user' in url: - self.assertTrue('page=2' in url) - self.assertTrue('filter=(name==jrambo)' in url) - self.assertTrue('sortDesc=startDate') - body = self.fixtures.load('api_query_user.xml') - elif 'type=group' in url: - body = self.fixtures.load('api_query_group.xml') + assert method == "GET" + + if "type=user" in url: + self.assertTrue("page=2" in url) + self.assertTrue("filter=(name==jrambo)" in url) + self.assertTrue("sortDesc=startDate") + body = self.fixtures.load("api_query_user.xml") + elif "type=group" in url: + body = self.fixtures.load("api_query_group.xml") + elif "type=vm" in url and "filter=(name==testVm2)" in url: + body = self.fixtures.load("api_query_vm.xml") else: - raise AssertionError('Unexpected query type') + raise AssertionError("Unexpected query type") + return httplib.OK, body, headers, httplib.responses[httplib.OK] - def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_metadata(self, method, url, body, headers): - if method == 'POST': - body = self.fixtures.load('api_vapp_post_metadata.xml') + def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_metadata( + self, method, url, body, headers + ): + if method == "POST": + body = self.fixtures.load("api_vapp_post_metadata.xml") + return httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED] else: - body = self.fixtures.load('api_vapp_get_metadata.xml') + body = self.fixtures.load("api_vapp_get_metadata.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] - def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_controlAccess(self, method, url, body, headers): + def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_controlAccess( + self, method, url, body, headers + ): body = self.fixtures.load( - 'api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a_controlAccess.xml') + "api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a_controlAccess.xml" + ) + return httplib.OK, body, headers, httplib.responses[httplib.OK] - def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_action_controlAccess(self, method, url, body, headers): + def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_action_controlAccess( + self, method, url, body, headers + ): body = str(body) - self.assertTrue(method == 'POST') + self.assertTrue(method == "POST") + self.assertTrue("false" in body) self.assertTrue( - 'false' in body) - self.assertTrue( - '' in body) - self.assertTrue('FullControl' in body) + '' + in body + ) + self.assertTrue("FullControl" in body) body = self.fixtures.load( - 'api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a_controlAccess.xml') + "api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6a_controlAccess.xml" + ) + return httplib.OK, body, headers, httplib.responses[httplib.OK] def _api_admin_group_b8202c48_7151_4e61_9a6c_155474c7d413(self, method, url, body, headers): + body = self.fixtures.load("api_admin_group_b8202c48_7151_4e61_9a6c_155474c7d413.xml") + + return httplib.OK, body, headers, httplib.responses[httplib.OK] + + def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6d(self, method, url, body, headers): + body = self.fixtures.load("api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6d.xml") + + return httplib.OK, body, headers, httplib.responses[httplib.OK] + + +class VCloud_5_5_MockHttp(VCloud_1_5_MockHttp): + # TODO: Move 5.5 fixtures to their own folder + + def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_action_createSnapshot( + self, method, url, body, headers + ): + assert method == "POST" body = self.fixtures.load( - 'api_admin_group_b8202c48_7151_4e61_9a6c_155474c7d413.xml') + "api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_create_snapshot.xml" + ) + + return httplib.OK, body, headers, httplib.responses[httplib.OK] + + def _api_task_fab4b26f_4f2e_4d49_ad01_ae9324bbfe48(self, method, url, body, headers): + body = self.fixtures.load("api_task_b034df55_fe81_4798_bc81_1f0fd0ead450.xml") + + return httplib.OK, body, headers, httplib.responses[httplib.OK] + + def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_action_removeAllSnapshots( + self, method, url, body, headers + ): + assert method == "POST" + body = self.fixtures.load( + "api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_remove_snapshots.xml" + ) + + return httplib.OK, body, headers, httplib.responses[httplib.OK] + + def _api_task_2518935e_b315_4d8e_9e99_9275f751877c(self, method, url, body, headers): + body = self.fixtures.load("api_task_2518935e_b315_4d8e_9e99_9275f751877c.xml") + + return httplib.OK, body, headers, httplib.responses[httplib.OK] + + def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_action_revertToCurrentSnapshot( + self, method, url, body, headers + ): + assert method == "POST" + body = self.fixtures.load( + "api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b_revert_snapshot.xml" + ) + + return httplib.OK, body, headers, httplib.responses[httplib.OK] + + def _api_task_fe75d3af_f5a3_44a5_b016_ae0bdadfc32b(self, method, url, body, headers): + body = self.fixtures.load("api_task_fe75d3af_f5a3_44a5_b016_ae0bdadfc32b.xml") + return httplib.OK, body, headers, httplib.responses[httplib.OK] -if __name__ == '__main__': +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_voxel.py b/libcloud/test/compute/test_voxel.py deleted file mode 100644 index e8ea8b0874..0000000000 --- a/libcloud/test/compute/test_voxel.py +++ /dev/null @@ -1,170 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import sys -import unittest -from libcloud.utils.py3 import httplib - -from libcloud.compute.base import Node, NodeSize, NodeImage, NodeLocation -from libcloud.compute.drivers.voxel import VoxelNodeDriver as Voxel -from libcloud.compute.types import InvalidCredsError - -from libcloud.test import MockHttp -from libcloud.test.file_fixtures import ComputeFileFixtures - -from libcloud.test.secrets import VOXEL_PARAMS - - -class VoxelTest(unittest.TestCase): - - def setUp(self): - - Voxel.connectionCls.conn_classes = (None, VoxelMockHttp) - VoxelMockHttp.type = None - self.driver = Voxel(*VOXEL_PARAMS) - - def test_auth_failed(self): - VoxelMockHttp.type = 'UNAUTHORIZED' - try: - self.driver.list_nodes() - except Exception: - e = sys.exc_info()[1] - self.assertTrue(isinstance(e, InvalidCredsError)) - else: - self.fail('test should have thrown') - - def test_response_failure(self): - VoxelMockHttp.type = 'FAILURE' - - try: - self.driver.list_nodes() - except Exception: - pass - else: - self.fail('Invalid response, but exception was not thrown') - - def test_list_nodes(self): - VoxelMockHttp.type = 'LIST_NODES' - nodes = self.driver.list_nodes() - - self.assertEqual(len(nodes), 1) - self.assertEqual(nodes[0].name, 'www.voxel.net') - - def test_list_sizes(self): - sizes = self.driver.list_sizes() - - self.assertEqual(len(sizes), 13) - - def test_list_images(self): - VoxelMockHttp.type = 'LIST_IMAGES' - images = self.driver.list_images() - - self.assertEqual(len(images), 1) - - def test_list_locations(self): - VoxelMockHttp.type = 'LIST_LOCATIONS' - locations = self.driver.list_locations() - - self.assertEqual(len(locations), 2) - self.assertEqual(locations[0].name, 'Amsterdam') - - def test_create_node_invalid_disk_size(self): - image = NodeImage( - id=1, name='Ubuntu 8.10 (intrepid)', driver=self.driver) - size = NodeSize( - 1, '256 slice', None, None, None, None, driver=self.driver) - location = NodeLocation(id=1, name='Europe', country='England', - driver=self.driver) - - try: - self.driver.create_node(name='foo', image=image, size=size, - location=location) - except ValueError: - pass - else: - self.fail('Invalid disk size provided but an exception was not' - ' thrown') - - def test_create_node(self): - VoxelMockHttp.type = 'CREATE_NODE' - image = NodeImage( - id=1, name='Ubuntu 8.10 (intrepid)', driver=self.driver) - size = NodeSize( - 1, '256 slice', 1024, 500, None, None, driver=self.driver) - location = NodeLocation(id=1, name='Europe', country='England', - driver=self.driver) - - node = self.driver.create_node(name='foo', image=image, size=size, - location=location) - self.assertEqual(node.id, '1234') - - node = self.driver.create_node(name='foo', image=image, size=size, - location=location, voxel_access=True) - self.assertEqual(node.id, '1234') - - def test_reboot_node(self): - VoxelMockHttp.type = 'REBOOT_NODE' - node = Node( - id=72258, name=None, state=None, public_ips=None, private_ips=None, - driver=self.driver) - - self.assertTrue(node.reboot()) - - def test_destroy_node(self): - VoxelMockHttp.type = 'DESTROY_NODE' - node = Node( - id=72258, name=None, state=None, public_ips=None, private_ips=None, - driver=self.driver) - - self.assertTrue(node.destroy()) - - -class VoxelMockHttp(MockHttp): - - fixtures = ComputeFileFixtures('voxel') - - def _UNAUTHORIZED(self, method, url, body, headers): - body = self.fixtures.load('unauthorized.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _FAILURE(self, method, url, body, headers): - body = self.fixtures.load('failure.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _LIST_NODES(self, method, url, body, headers): - body = self.fixtures.load('nodes.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _LIST_IMAGES(self, method, url, body, headers): - body = self.fixtures.load('images.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _LIST_LOCATIONS(self, method, url, body, headers): - body = self.fixtures.load('locations.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _CREATE_NODE(self, method, url, body, headers): - body = self.fixtures.load('create_node.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _REBOOT_NODE(self, method, url, body, headers): - body = self.fixtures.load('success.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - - def _DESTROY_NODE(self, method, url, body, headers): - body = self.fixtures.load('success.xml') - return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - -if __name__ == '__main__': - sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_vpsnet.py b/libcloud/test/compute/test_vpsnet.py index 9053a46406..c35e17f24c 100644 --- a/libcloud/test/compute/test_vpsnet.py +++ b/libcloud/test/compute/test_vpsnet.py @@ -14,86 +14,83 @@ # limitations under the License. import sys import unittest -from libcloud.utils.py3 import httplib - -from libcloud.compute.drivers.vpsnet import VPSNetNodeDriver -from libcloud.compute.base import Node -from libcloud.compute.types import NodeState from libcloud.test import MockHttp +from libcloud.utils.py3 import httplib +from libcloud.compute.base import Node from libcloud.test.compute import TestCaseMixin - from libcloud.test.secrets import VPSNET_PARAMS +from libcloud.compute.types import NodeState from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.vpsnet import VPSNetNodeDriver class VPSNetTests(unittest.TestCase, TestCaseMixin): - def setUp(self): - VPSNetNodeDriver.connectionCls.conn_classes = (None, VPSNetMockHttp) + VPSNetNodeDriver.connectionCls.conn_class = VPSNetMockHttp self.driver = VPSNetNodeDriver(*VPSNET_PARAMS) def test_create_node(self): - VPSNetMockHttp.type = 'create' + VPSNetMockHttp.type = "create" image = self.driver.list_images()[0] size = self.driver.list_sizes()[0] - node = self.driver.create_node('foo', image, size) - self.assertEqual(node.name, 'foo') + node = self.driver.create_node("foo", image, size) + self.assertEqual(node.name, "foo") def test_list_nodes(self): - VPSNetMockHttp.type = 'virtual_machines' + VPSNetMockHttp.type = "virtual_machines" node = self.driver.list_nodes()[0] - self.assertEqual(node.id, '1384') + self.assertEqual(node.id, "1384") self.assertEqual(node.state, NodeState.RUNNING) def test_reboot_node(self): - VPSNetMockHttp.type = 'virtual_machines' + VPSNetMockHttp.type = "virtual_machines" node = self.driver.list_nodes()[0] - VPSNetMockHttp.type = 'reboot' + VPSNetMockHttp.type = "reboot" ret = self.driver.reboot_node(node) self.assertEqual(ret, True) def test_destroy_node(self): - VPSNetMockHttp.type = 'delete' - node = Node('2222', None, None, None, None, self.driver) + VPSNetMockHttp.type = "delete" + node = Node("2222", None, None, None, None, self.driver) ret = self.driver.destroy_node(node) self.assertTrue(ret) - VPSNetMockHttp.type = 'delete_fail' - node = Node('2223', None, None, None, None, self.driver) + VPSNetMockHttp.type = "delete_fail" + node = Node("2223", None, None, None, None, self.driver) self.assertRaises(Exception, self.driver.destroy_node, node) def test_list_images(self): - VPSNetMockHttp.type = 'templates' + VPSNetMockHttp.type = "templates" ret = self.driver.list_images() - self.assertEqual(ret[0].id, '9') - self.assertEqual(ret[-1].id, '160') + self.assertEqual(ret[0].id, "9") + self.assertEqual(ret[-1].id, "160") def test_list_sizes(self): - VPSNetMockHttp.type = 'sizes' + VPSNetMockHttp.type = "sizes" ret = self.driver.list_sizes() self.assertEqual(len(ret), 1) - self.assertEqual(ret[0].id, '1') - self.assertEqual(ret[0].name, '1 Node') + self.assertEqual(ret[0].id, "1") + self.assertEqual(ret[0].name, "1 Node") def test_destroy_node_response(self): # should return a node object - node = Node('2222', None, None, None, None, self.driver) - VPSNetMockHttp.type = 'delete' + node = Node("2222", None, None, None, None, self.driver) + VPSNetMockHttp.type = "delete" ret = self.driver.destroy_node(node) self.assertTrue(isinstance(ret, bool)) def test_reboot_node_response(self): # should return a node object - VPSNetMockHttp.type = 'virtual_machines' + VPSNetMockHttp.type = "virtual_machines" node = self.driver.list_nodes()[0] - VPSNetMockHttp.type = 'reboot' + VPSNetMockHttp.type = "reboot" ret = self.driver.reboot_node(node) self.assertTrue(isinstance(ret, bool)) class VPSNetMockHttp(MockHttp): - fixtures = ComputeFileFixtures('vpsnet') + fixtures = ComputeFileFixtures("vpsnet") def _nodes_api10json_sizes(self, method, url, body, headers): body = """[{"slice":{"virtual_machine_id":8592,"id":12256,"consumer_id":0}}, @@ -108,10 +105,10 @@ def _nodes_api10json_create(self, method, url, body, headers): return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _virtual_machines_2222_api10json_delete_fail(self, method, url, body, headers): - return (httplib.FORBIDDEN, '', {}, httplib.responses[httplib.FORBIDDEN]) + return (httplib.FORBIDDEN, "", {}, httplib.responses[httplib.FORBIDDEN]) def _virtual_machines_2222_api10json_delete(self, method, url, body, headers): - return (httplib.OK, '', {}, httplib.responses[httplib.OK]) + return (httplib.OK, "", {}, httplib.responses[httplib.OK]) def _virtual_machines_1384_reboot_api10json_reboot(self, method, url, body, headers): body = """{ @@ -199,7 +196,7 @@ def _virtual_machines_api10json_virtual_machines(self, method, url, body, header return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _available_clouds_api10json_templates(self, method, url, body, headers): - body = self.fixtures.load('_available_clouds_api10json_templates.json') + body = self.fixtures.load("_available_clouds_api10json_templates.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _available_clouds_api10json_create(self, method, url, body, headers): @@ -208,5 +205,6 @@ def _available_clouds_api10json_create(self, method, url, body, headers): """ return (httplib.OK, body, {}, httplib.responses[httplib.OK]) -if __name__ == '__main__': + +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_vsphere.py b/libcloud/test/compute/test_vsphere.py new file mode 100644 index 0000000000..c328a98d5d --- /dev/null +++ b/libcloud/test/compute/test_vsphere.py @@ -0,0 +1,143 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import httplib +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.vsphere import VSphere_REST_NodeDriver + + +class KubeVirtTestCase(unittest.TestCase): + driver_cls = VSphere_REST_NodeDriver + fixtures = ComputeFileFixtures("vsphere") + + def setUp(self): + VSphere_REST_NodeDriver.connectionCls.conn_class = VSphereMockHttp + self.driver = VSphere_REST_NodeDriver( + key="user", secret="pass", secure=True, host="foo", port=443 + ) + + def test_list_nodes(self): + vm_id = "vm-80" + nodes = self.driver.list_nodes() + self.assertEqual(len(nodes), 1) + self.assertEqual(nodes[0].name, "vCenter") + self.assertEqual(nodes[0].id, vm_id) + + def test_list_locations(self): + locations = self.driver.list_locations() + self.assertEqual(len(locations), 1) + self.assertEqual(locations[0].id, "host-74") + self.assertEqual(locations[0].name, "100.100.100.100") + + def test_destroy_node(self): + nodes = self.driver.list_nodes() + to_destroy = nodes[-1] + resp = self.driver.destroy_node(to_destroy) + self.assertTrue(resp) + + def test_start_node(self): + nodes = self.driver.list_nodes() + resp = self.driver.start_node(nodes[0]) + self.assertTrue(resp) + + def test_stop_node(self): + nodes = self.driver.list_nodes() + resp = self.driver.stop_node(nodes[0]) + self.assertTrue(resp) + + def test_reboot_node(self): + nodes = self.driver.list_nodes() + resp = self.driver.reboot_node(nodes[0]) + self.assertTrue(resp) + + +class VSphereMockHttp(MockHttp): + fixtures = ComputeFileFixtures("vsphere") + + def _rest_com_vmware_cis_session(self, method, url, body, headers): + if method == "POST": + body = self.fixtures.load("session_token.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _rest_vcenter_vm(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_nodes.json") + elif method == "POST": + return + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _rest_vcenter_vm_vm_80(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("node_80.json") + elif method == "POST": + return + elif method == "DELETE": + body = "" + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _rest_vcenter_cluster(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_clusters.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _rest_vcenter_host(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_hosts.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _rest_appliance_networking_interfaces(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_interfaces.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _rest_vcenter_vm_vm_80_power_stop(self, method, url, body, headers): + if method != "POST": + raise AssertionError("Unsupported method") + body = "" + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _rest_vcenter_vm_vm_80_power_start(self, method, url, body, headers): + if method != "POST": + raise AssertionError("Unsupported method") + body = "" + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _rest_vcenter_vm_vm_80_power_reset(self, method, url, body, headers): + if method != "POST": + raise AssertionError("Unsupported method") + body = "" + + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_vultr.py b/libcloud/test/compute/test_vultr.py index 066cc86e26..e2ac3f3751 100644 --- a/libcloud/test/compute/test_vultr.py +++ b/libcloud/test/compute/test_vultr.py @@ -15,28 +15,34 @@ import sys import unittest +from libcloud.test import MockHttp, LibcloudTestCase +from libcloud.utils.py3 import httplib +from libcloud.common.types import ServiceUnavailableError +from libcloud.compute.base import NodeSize, NodeImage +from libcloud.test.secrets import VULTR_PARAMS +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.vultr import VultrNodeDriver, VultrNodeDriverV1 + try: - import simplejson as json + import simplejson as json # pylint: disable=unused-import except ImportError: + # pylint: disable=unused-import import json # NOQA -from libcloud.utils.py3 import httplib - -from libcloud.compute.drivers.vultr import VultrNodeDriver - -from libcloud.test import LibcloudTestCase, MockHttpTestCase -from libcloud.test.file_fixtures import ComputeFileFixtures -from libcloud.test.secrets import VULTR_PARAMS - # class VultrTests(unittest.TestCase, TestCaseMixin): class VultrTests(LibcloudTestCase): - def setUp(self): - VultrNodeDriver.connectionCls.conn_classes = \ - (VultrMockHttp, VultrMockHttp) + VultrNodeDriver.connectionCls.conn_class = VultrMockHttp VultrMockHttp.type = None - self.driver = VultrNodeDriver(*VULTR_PARAMS) + self.driver = VultrNodeDriver(*VULTR_PARAMS, api_version="1") + + def test_correct_class_is_used(self): + self.assertIsInstance(self.driver, VultrNodeDriverV1) + + def test_list_images_dont_require_api_key(self): + self.driver.list_images() + self.assertFalse(self.driver.connection.require_api_key()) def test_list_images_success(self): images = self.driver.list_images() @@ -46,69 +52,185 @@ def test_list_images_success(self): self.assertTrue(image.id is not None) self.assertTrue(image.name is not None) + def test_list_sizes_dont_require_api_key(self): + self.driver.list_sizes() + self.assertFalse(self.driver.connection.require_api_key()) + def test_list_sizes_success(self): + """count of current plans""" sizes = self.driver.list_sizes() - self.assertTrue(len(sizes) == 22) + self.assertTrue(len(sizes) == 19) size = sizes[0] - self.assertTrue(size.id is not None) - self.assertEqual(size.name, '512 MB RAM,160 GB SATA,1.00 TB BW') - self.assertEqual(size.ram, 512) + self.assertTrue(size.id.isdigit()) + self.assertEqual(size.name, "8192 MB RAM,110 GB SSD,10.00 TB BW") + self.assertEqual(size.ram, 8192) - size = sizes[21] - self.assertTrue(size.id is not None) - self.assertEqual(size.name, '65536 MB RAM,800 GB SSD,9.00 TB BW') - self.assertEqual(size.ram, 65536) + size = sizes[16] + self.assertTrue(size.id.isdigit()) + self.assertEqual(size.name, "16384 MB RAM,384 GB SSD,5.00 TB BW") + self.assertEqual(size.ram, 16384) + + def test_list_locations_dont_require_api_key(self): + self.driver.list_locations() + self.assertFalse(self.driver.connection.require_api_key()) def test_list_locations_success(self): locations = self.driver.list_locations() self.assertTrue(len(locations) >= 1) location = locations[0] - self.assertEqual(location.id, '1') - self.assertEqual(location.name, 'New Jersey') + self.assertEqual(location.id, "1") + self.assertEqual(location.name, "New Jersey") + self.assertEqual(location.extra["continent"], "North America") + + def test_list_locations_extra_success(self): + locations = self.driver.list_locations() + self.assertTrue(len(locations) >= 1) + extra_keys = [ + "continent", + "state", + "ddos_protection", + "block_storage", + "regioncode", + ] + for location in locations: + self.assertTrue(len(location.extra.keys()) >= 5) + self.assertTrue(all(item in location.extra.keys() for item in extra_keys)) + + def test_list_nodes_require_api_key(self): + self.driver.list_nodes() + self.assertTrue(self.driver.connection.require_api_key()) def test_list_nodes_success(self): nodes = self.driver.list_nodes() - self.assertEqual(len(nodes), 2) - self.assertEqual(nodes[0].id, '1') - self.assertEqual(nodes[0].public_ips, ['108.61.206.153']) + self.assertEqual(len(nodes), 3) + self.assertTrue(nodes[0].id.isdigit()) + self.assertEqual(nodes[0].id, "41306569") + self.assertEqual(nodes[0].public_ips, ["45.76.43.87"]) + self.assertEqual(nodes[0].private_ips, ["10.7.96.85"]) + self.assertEqual(nodes[2].private_ips, []) + + def test_list_nodes_image_success(self): + nodes = self.driver.list_nodes() + node = nodes[0] + self.assertTrue(isinstance(node.image, NodeImage)) + + def test_list_nodes_size_success(self): + nodes = self.driver.list_nodes() + node = nodes[0] + self.assertTrue(isinstance(node.size, NodeSize)) + + def test_list_nodes_success_extra(self): + extra_keys = [ + "default_password", + "pending_charges", + "cost_per_month", + ] + nodes = self.driver.list_nodes() + for node in nodes: + self.assertTrue(len(node.extra.keys()) > 5) + self.assertTrue(all(item in node.extra.keys() for item in extra_keys)) def test_reboot_node_success(self): node = self.driver.list_nodes()[0] result = self.driver.reboot_node(node) self.assertTrue(result) + def test_create_node_success(self): + test_size = self.driver.list_sizes()[0] + test_image = self.driver.list_images()[0] + test_location = self.driver.list_locations()[0] + created_node = self.driver.create_node("test-node", test_size, test_image, test_location) + self.assertEqual(created_node.id, "41326859") + def test_destroy_node_success(self): node = self.driver.list_nodes()[0] result = self.driver.destroy_node(node) self.assertTrue(result) + def test_list_key_pairs_success(self): + key_pairs = self.driver.list_key_pairs() + self.assertEqual(len(key_pairs), 1) + key_pair = key_pairs[0] + self.assertEqual(key_pair.id, "5806a8ef2a0c6") + self.assertEqual(key_pair.name, "test-key-pair") + + def test_create_key_pair_success(self): + res = self.driver.create_key_pair("test-key-pair") + self.assertTrue(res) + + def test_delete_key_pair_success(self): + key_pairs = self.driver.list_key_pairs() + key_pair = key_pairs[0] + res = self.driver.delete_key_pair(key_pair) + self.assertTrue(res) + + def test_rate_limit(self): + VultrMockHttp.type = "SERVICE_UNAVAILABLE" + self.assertRaises(ServiceUnavailableError, self.driver.list_nodes) + -class VultrMockHttp(MockHttpTestCase): - fixtures = ComputeFileFixtures('vultr') +class VultrMockHttp(MockHttp): + fixtures = ComputeFileFixtures("vultr") + # pylint: disable=unused-argument def _v1_regions_list(self, method, url, body, headers): - body = self.fixtures.load('list_locations.json') + body = self.fixtures.load("list_locations.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + # pylint: disable=unused-argument def _v1_os_list(self, method, url, body, headers): - body = self.fixtures.load('list_images.json') + body = self.fixtures.load("list_images.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + # pylint: disable=unused-argument def _v1_plans_list(self, method, url, body, headers): - body = self.fixtures.load('list_sizes.json') + body = self.fixtures.load("list_sizes.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + # pylint: disable=unused-argument def _v1_server_list(self, method, url, body, headers): - body = self.fixtures.load('list_nodes.json') + body = self.fixtures.load("list_nodes.json") return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + # pylint: disable=unused-argument + def _v1_server_list_SERVICE_UNAVAILABLE(self, method, url, body, headers): + body = self.fixtures.load("error_rate_limit.txt") + return ( + httplib.SERVICE_UNAVAILABLE, + body, + {}, + httplib.responses[httplib.SERVICE_UNAVAILABLE], + ) + + # pylint: disable=unused-argument + def _v1_server_create(self, method, url, body, headers): + body = self.fixtures.load("create_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + # pylint: disable=unused-argument def _v1_server_destroy(self, method, url, body, headers): return (httplib.OK, "", {}, httplib.responses[httplib.OK]) + # pylint: disable=unused-argument def _v1_server_reboot(self, method, url, body, headers): return (httplib.OK, "", {}, httplib.responses[httplib.OK]) -if __name__ == '__main__': + # pylint: disable=unused-argument + def _v1_sshkey_list(self, method, url, body, headers): + body = self.fixtures.load("list_key_pairs.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + # pylint: disable=unused-argument + def _v1_sshkey_create(self, method, url, body, headers): + body = self.fixtures.load("create_key_pair.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + # pylint: disable=unused-argument + def _v1_sshkey_destroy(self, method, url, body, headers): + return (httplib.OK, "", {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/libcloud/test/compute/test_vultr_v2.py b/libcloud/test/compute/test_vultr_v2.py new file mode 100644 index 0000000000..532337bafe --- /dev/null +++ b/libcloud/test/compute/test_vultr_v2.py @@ -0,0 +1,525 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest + +from libcloud.test import MockHttp +from libcloud.utils.py3 import httplib +from libcloud.common.vultr import VultrException +from libcloud.test.file_fixtures import ComputeFileFixtures +from libcloud.compute.drivers.vultr import VultrNodeDriver, VultrNodeDriverV2 + + +class VultrTestsV2(unittest.TestCase): + def setUp(self): + VultrNodeDriver.connectionCls.conn_class = VultrMockHttpV2 + VultrMockHttpV2.type = None + self.driver = VultrNodeDriver("foo") + + def test_unknown_api_version(self): + self.assertRaises(NotImplementedError, VultrNodeDriver, "foo", api_version="3") + + def test_correct_class_is_used(self): + self.assertIsInstance(self.driver, VultrNodeDriverV2) + + def test_list_sizes(self): + sizes = self.driver.list_sizes() + self.assertEqual(len(sizes), 25) + size = sizes[0] + self.assertEqual(size.id, "vc2-1c-1gb") + self.assertEqual(size.name, "vc2-1c-1gb") + for size in sizes: + self.assertIsInstance(size.price, int) + self.assertIsInstance(size.ram, int) + self.assertIsInstance(size.disk, int) + + def test_list_images(self): + images = self.driver.list_images() + self.assertEqual(len(images), 30) + image = images[0] + self.assertEqual(image.id, "124") + self.assertEqual(image.name, "Windows 2012 R2 x64") + self.assertEqual(image.extra["arch"], "x64") + self.assertEqual(image.extra["family"], "windows") + + def test_list_locations(self): + locations = self.driver.list_locations() + self.assertEqual(len(locations), 17) + location = locations[0] + self.assertEqual(location.country, "NL") + self.assertEqual(location.id, "ams") + self.assertEqual(location.name, "Amsterdam") + self.assertIsInstance(location.extra["option"], list) + + def test_list_nodes(self): + nodes = self.driver.list_nodes(ex_list_bare_metals=False) + self.assertEqual(len(nodes), 3) + node = nodes[0] + self.assertEqual(node.id, "123") + self.assertEqual(node.name, "test1") + self.assertEqual(node.image, "477") + self.assertEqual(node.size, "vc2-1c-2gb") + self.assertEqual(node.extra["location"], "fra") + self.assertIn("45.76.83.44", node.public_ips) + for node in nodes: + self.assertIsInstance(node.public_ips, list) + self.assertIsInstance(node.private_ips, list) + self.assertIsInstance(node.extra["vcpu_count"], int) + self.assertIsInstance(node.extra["ram"], int) + self.assertIsInstance(node.extra["disk"], int) + self.assertIsInstance(node.extra["allowed_bandwidth"], int) + + def test_list_nodes_with_bare_metals(self): + nodes = self.driver.list_nodes() + self.assertEqual(len(nodes), 5) + node = nodes[0] + self.assertEqual(node.id, "123") + self.assertEqual(node.name, "test1") + self.assertEqual(node.image, "477") + self.assertEqual(node.size, "vc2-1c-2gb") + self.assertEqual(node.extra["vcpu_count"], 1) + self.assertEqual(node.extra["location"], "fra") + self.assertFalse(node.extra["is_bare_metal"]) + self.assertIn("45.76.83.44", node.public_ips) + node = nodes[-1] + self.assertEqual(node.id, "234") + self.assertEqual(node.size, "vbm-8c-132gb") + self.assertEqual(node.state, "pending") + self.assertEqual(node.extra["cpu_count"], 8) + self.assertEqual(node.extra["location"], "mia") + self.assertTrue(node.extra["is_bare_metal"]) + self.assertEqual(node.extra["mac_address"], 189250955239968) + + def test_create_node(self): + name = "test123" + image = self.driver.list_images()[0] + size = self.driver.list_sizes()[0] + location = self.driver.list_locations()[0] + node = self.driver.create_node(name=name, image=image, size=size, location=location) + self.assertEqual(node.id, "123") + self.assertEqual(node.name, "test123") + self.assertEqual(node.image, "446") + self.assertFalse(node.extra["is_bare_metal"]) + + def test_destroy_node(self): + node = self.driver.list_nodes()[0] + response = self.driver.destroy_node(node) + self.assertTrue(response) + + def test_start_node(self): + node = self.driver.list_nodes()[0] + response = self.driver.start_node(node) + self.assertTrue(response) + + def test_reboot_node(self): + node = self.driver.list_nodes()[0] + response = self.driver.reboot_node(node) + self.assertTrue(response) + + def test_ex_stop_nodes(self): + nodes = self.driver.list_nodes() + response = self.driver.ex_stop_nodes(nodes) + self.assertTrue(response) + + def test_stop_node(self): + node = self.driver.list_nodes()[0] + response = self.driver.stop_node(node) + self.assertTrue(response) + + def test_ex_get_node(self): + node = self.driver.ex_get_node("123") + self.assertEqual(node.name, "test") + self.assertEqual(node.id, "123") + self.assertEqual(node.size, "vc2-1c-1gb") + self.assertEqual(node.image, "477") + self.assertEqual(node.state, "running") + self.assertIn("45.76.36.72", node.public_ips) + + def test_ex_resize_node(self): + node = self.driver.ex_get_node("123") + size = self.driver.list_sizes()[1] + node = self.driver.ex_resize_node(node, size) + self.assertEqual(node.id, "123") + self.assertEqual(node.size, "vc2-1c-2gb") + self.assertEqual(node.name, "test4") + self.assertIn("192.248.168.21", node.public_ips) + + def test_list_key_pairs(self): + keys = self.driver.list_key_pairs() + self.assertEqual(len(keys), 1) + key = keys[0] + self.assertEqual(key.name, "tester") + self.assertIsNone(key.private_key) + self.assertEqual(key.extra["id"], "123") + + def test_list_key_pairs_UNAUTHORIZED(self): + VultrMockHttpV2.type = "UNAUTHORIZED" + with self.assertRaises(VultrException): + self.driver.list_key_pairs() + + def test_get_key_pair(self): + key_id = "123" + key = self.driver.get_key_pair(key_id) + self.assertEqual(key.name, "tester") + self.assertEqual(key.extra["id"], "123") + self.assertIsNone(key.private_key) + + def test_import_key_pair_from_string(self): + name = "tester" + key_material = "material" + key = self.driver.import_key_pair_from_string(name, key_material) + self.assertEqual(key.name, "tester") + self.assertEqual(key.extra["id"], "123") + self.assertIsNone(key.private_key) + + def test_delete_key_pair(self): + keys = self.driver.list_key_pairs() + key = keys[0] + response = self.driver.delete_key_pair(key) + self.assertTrue(response) + + def test_list_volumes(self): + volumes = self.driver.list_volumes() + self.assertEqual(len(volumes), 2) + volume = volumes[0] + self.assertEqual(volume.name, "test1") + self.assertEqual(volume.id, "123") + self.assertEqual(volume.size, 10) + self.assertEqual(volume.state, "available") + + def test_create_volume(self): + volume = self.driver.create_volume(size=15, name="test4", location="ewr") + self.assertEqual(volume.name, "test4") + self.assertEqual(volume.id, "ec6d1ecc-aa70-4f18-8edd-887a258b1b45") + self.assertEqual(volume.size, 15) + self.assertEqual(volume.state, "creating") + self.assertEqual(volume.extra["location"], "ewr") + + def test_attach_volume(self): + volume = self.driver.list_volumes()[0] + node = self.driver.list_nodes()[0] + response = self.driver.attach_volume(node, volume) + self.assertTrue(response) + + def test_attach_volume_WRONG_LOCATION(self): + volume = self.driver.list_volumes()[1] + node = self.driver.list_nodes()[0] + VultrMockHttpV2.type = "WRONG_LOCATION" + with self.assertRaises(VultrException): + self.driver.attach_volume(node, volume) + + def test_detach_volume(self): + volume = self.driver.list_volumes()[0] + response = self.driver.detach_volume(volume) + self.assertTrue(response) + + def test_destroy_volume(self): + volume = self.driver.list_volumes()[0] + response = self.driver.destroy_volume(volume) + self.assertTrue(response) + + def test_ex_get_volume(self): + volume = self.driver.ex_get_volume("123") + self.assertEqual(volume.id, "123") + self.assertEqual(volume.name, "test2") + self.assertEqual(volume.state, "available") + + def test_ex_resize_volume(self): + volume = self.driver.list_volumes()[0] + response = self.driver.ex_resize_volume(volume, 20) + self.assertTrue(response) + + def test_ex_list_available_sizes_for_location(self): + location = self.driver.list_locations()[0] + available_sizes = self.driver.ex_list_available_sizes_for_location(location) + self.assertTrue(isinstance(available_sizes, list)) + + def test_ex_list_networks(self): + networks = self.driver.ex_list_networks() + self.assertEqual(len(networks), 2) + network = networks[0] + self.assertEqual(network.id, "123") + self.assertEqual(network.cidr_block, "10.7.96.0/20") + self.assertEqual(network.location, "ams") + + def test_ex_get_network(self): + network = self.driver.ex_get_network("123") + self.assertEqual(network.id, "123") + self.assertEqual(network.cidr_block, "10.7.96.0/20") + self.assertEqual(network.location, "ams") + + def test_ex_create_network(self): + network = self.driver.ex_create_network("10.0.0.0/24", "ams", "TestNetwork") + self.assertEqual(network.id, "123") + self.assertEqual(network.cidr_block, "10.0.0.0/24") + self.assertEqual(network.location, "ams") + + def test_ex_destroy_network(self): + network = self.driver.ex_get_network("123") + response = self.driver.ex_destroy_network(network) + self.assertTrue(response) + + def ex_list_snapshots(self): + snapshots = self.driver.ex_list_snapshots() + self.assertEqual(len(snapshots), 2) + snapshot = snapshots[0] + self.assertEqual(snapshot.id, "123") + self.assertEqual(snapshot.size, "25.0") + self.assertEqual(snapshot.state, "available") + snapshot = snapshots[1] + self.assertEqual(snapshot.id, "1234") + self.assertEqual(snapshot.size, "25.0") + self.assertEqual(snapshot.state, "creating") + + def test_ex_get_snapshot(self): + snapshot = self.driver.ex_get_snapshot("123") + self.assertEqual(snapshot.id, "123") + self.assertEqual(snapshot.size, 25.0) + self.assertEqual(snapshot.state, "available") + + def test_ex_create_snapshot(self): + node = self.driver.list_nodes()[0] + snapshot = self.driver.ex_create_snapshot(node) + self.assertEqual(snapshot.id, "123") + self.assertEqual(snapshot.size, 0) + self.assertEqual(snapshot.state, "creating") + + def test_ex_delete_snapshot(self): + snapshot = self.driver.ex_get_snapshot("123") + response = self.driver.ex_delete_snapshot(snapshot) + self.assertTrue(response) + + def test_ex_list_bare_metal_sizes(self): + sizes = self.driver.ex_list_bare_metal_sizes() + self.assertEqual(len(sizes), 4) + for size in sizes: + self.assertIsInstance(size.extra["cpu_count"], int) + self.assertIsInstance(size.extra["cpu_threads"], int) + self.assertIsInstance(size.extra["cpu_model"], str) + + def test_create_bare_metal_node(self): + image = self.driver.list_images()[0] + location = self.driver.list_locations()[0] + size = self.driver.list_sizes()[-1] + node = self.driver.create_node(name="test1", image=image, location=location, size=size) + self.assertEqual(node.name, "test1") + self.assertEqual(node.id, "234") + self.assertTrue(node.extra["is_bare_metal"]) + self.assertEqual(node.extra["cpu_count"], 4) + + def test_reboot_bare_metal_node(self): + nodes = self.driver.list_nodes() + node = nodes[-1] + self.assertTrue(node.extra["is_bare_metal"]) + response = self.driver.reboot_node(node) + self.assertTrue(response) + + def test_start_bare_metal_node(self): + nodes = self.driver.list_nodes() + node = nodes[-1] + self.assertTrue(node.extra["is_bare_metal"]) + response = self.driver.start_node(node) + self.assertTrue(response) + + def test_stop_bare_metal_node(self): + nodes = self.driver.list_nodes() + node = nodes[-1] + self.assertTrue(node.extra["is_bare_metal"]) + response = self.driver.stop_node(node) + self.assertTrue(response) + + def test_destroy_bare_metal_node(self): + nodes = self.driver.list_nodes() + node = nodes[-1] + self.assertTrue(node.extra["is_bare_metal"]) + response = self.driver.destroy_node(node) + self.assertTrue(response) + + def test_pagination(self): + images = self.driver.list_images() + VultrMockHttpV2.type = "PAGINATED" + paginated_images = self.driver.list_images() + self.assertEqual(len(images), len(paginated_images)) + for first, second in zip(images, paginated_images): + self.assertEqual(first.id, second.id) + self.assertEqual(first.name, second.name) + self.assertDictEqual(first.extra, second.extra) + + +class VultrMockHttpV2(MockHttp): + fixtures = ComputeFileFixtures("vultr_v2") + + def _v2_regions(self, method, url, body, headers): + body = self.fixtures.load("list_locations.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_os(self, method, url, body, headers): + body = self.fixtures.load("list_images.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_plans(self, method, url, body, headers): + body = self.fixtures.load("list_sizes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_instances(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_nodes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "POST": + body = self.fixtures.load("create_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_bare_metals(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("ex_list_bare_metal_nodes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "POST": + body = self.fixtures.load("create_node_bare_metal.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_instances_123(self, method, url, body, headers): + if method == "DELETE": + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + elif method == "GET": + body = self.fixtures.load("ex_get_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "PATCH": + body = self.fixtures.load("ex_resize_node.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_instances_123_start(self, method, url, body, headers): + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_instances_123_reboot(self, method, url, body, headers): + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_instances_halt(self, method, url, body, headers): + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_ssh_keys(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_key_pairs.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "POST": + body = self.fixtures.load("import_key_pair_from_string.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_ssh_keys_UNAUTHORIZED(self, method, url, body, headers): + body = '{"error":"Invalid API token.","status":401}' + return (httplib.UNAUTHORIZED, body, {}, httplib.responses[httplib.UNAUTHORIZED]) + + def _v2_ssh_keys_123(self, method, url, body, headers): + if method == "DELETE": + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "GET": + body = self.fixtures.load("get_key_pair.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_blocks(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("list_volumes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "POST": + body = self.fixtures.load("create_volume.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_blocks_123(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("ex_get_volume.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "DELETE": + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + elif method == "PATCH": + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_blocks_123_attach(self, method, url, body, headers): + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_blocks_1234_attach_WRONG_LOCATION(self, method, url, body, headers): + body = ( + '{"error": "unable to attach: Block storage volume must be in ' + 'the same region as the server it is attached to.",' + ' "status": 400}' + ) + return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.BAD_REQUEST]) + + def _v2_blocks_123_detach(self, method, url, body, headers): + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_regions_ams_availability(self, method, url, body, headers): + body = self.fixtures.load("ex_list_available_sizes_for_location.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_private_networks(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("ex_list_networks.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "POST": + body = self.fixtures.load("ex_create_network.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_private_networks_123(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("ex_get_network.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "DELETE": + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_os_PAGINATED(self, method, url, body, headers): + if "cursor" not in url: + body = self.fixtures.load("list_images_paginated_1.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif "cursor=bmV4dF9fMjMw" in url: + body = self.fixtures.load("list_images_paginated_2.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + else: + body = self.fixtures.load("list_images_paginated_3.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_snapshots(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("ex_list_snapshots.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "POST": + body = self.fixtures.load("ex_create_snapshot.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_snapshots_123(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("ex_get_snapshot.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + elif method == "DELETE": + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_bare_metals_234_reboot(self, method, url, body, headers): + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_bare_metals_234_start(self, method, url, body, headers): + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_bare_metals_234_halt(self, method, url, body, headers): + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_bare_metals_234(self, method, url, body, headers): + return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + + def _v2_plans_metal(self, method, url, body, headers): + body = self.fixtures.load("ex_list_bare_metal_sizes.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/conftest.py b/libcloud/test/conftest.py new file mode 100644 index 0000000000..bbc6ad8281 --- /dev/null +++ b/libcloud/test/conftest.py @@ -0,0 +1,40 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os.path + +import pytest + + +def pytest_configure(config): + """Check that secrets.py is valid""" + + this_dir = os.path.abspath(os.path.split(__file__)[0]) + secrets_current = os.path.join(this_dir, "secrets.py") + secrets_dist = os.path.join(this_dir, "secrets.py-dist") + + if not os.path.isfile(secrets_current): + print("Missing " + secrets_current) + print("Maybe you forgot to copy it from -dist:") + print("cp libcloud/test/secrets.py-dist libcloud/test/secrets.py") + pytest.exit("Secrets file missing") + + mtime_current = os.path.getmtime(secrets_current) + mtime_dist = os.path.getmtime(secrets_dist) + + if mtime_dist > mtime_current: + print("It looks like test/secrets.py file is out of date.") + print("Please copy the new secrets.py-dist file over otherwise" + " tests might fail") + pytest.exit("Secrets file out of date") diff --git a/libcloud/test/container/__init__.py b/libcloud/test/container/__init__.py new file mode 100644 index 0000000000..c7c303bf9d --- /dev/null +++ b/libcloud/test/container/__init__.py @@ -0,0 +1,30 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.container.base import ContainerImage + + +class TestCaseMixin: + def test_list_images_response(self): + images = self.driver.list_images() + self.assertTrue(isinstance(images, list)) + for image in images: + self.assertTrue(isinstance(image, ContainerImage)) + + +if __name__ == "__main__": + import doctest + + doctest.testmod() diff --git a/libcloud/test/container/fixtures/docker/linux_124/container_a68.json b/libcloud/test/container/fixtures/docker/linux_124/container_a68.json new file mode 100644 index 0000000000..e4aab0dc8b --- /dev/null +++ b/libcloud/test/container/fixtures/docker/linux_124/container_a68.json @@ -0,0 +1,163 @@ +{ + "Id": "a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303", + "Created": "2015-12-23T01:05:40.56937184Z", + "Path": "/entrypoint.sh", + "Args": [ + "None" + ], + "State": { + "Status": "running", + "Running": false, + "Paused": false, + "Restarting": false, + "OOMKilled": false, + "Dead": false, + "Pid": 0, + "ExitCode": 127, + "Error": "", + "StartedAt": "2015-12-23T01:06:29.018395755Z", + "FinishedAt": "2015-12-23T01:06:30.144487212Z" + }, + "Image": "cf55d61f5307b7a18a45980971d6cfd40b737dd661879c4a6b3f2aecc3bc37b0", + "ResolvConfPath": "/var/lib/docker/containers/a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303/resolv.conf", + "HostnamePath": "/var/lib/docker/containers/a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303/hostname", + "HostsPath": "/var/lib/docker/containers/a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303/hosts", + "LogPath": "/var/lib/docker/containers/a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303/a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303-json.log", + "Name": "/gigantic_goldberg", + "RestartCount": 0, + "Driver": "aufs", + "ExecDriver": "native-0.2", + "MountLabel": "", + "ProcessLabel": "", + "AppArmorProfile": "", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": null, + "Memory": 0, + "MemoryReservation": 0, + "MemorySwap": 0, + "KernelMemory": 0, + "CpuShares": 0, + "CpuPeriod": 0, + "CpusetCpus": "", + "CpusetMems": "", + "CpuQuota": 0, + "BlkioWeight": 0, + "OomKillDisable": false, + "MemorySwappiness": null, + "Privileged": false, + "PortBindings": {}, + "Links": null, + "PublishAllPorts": true, + "Dns": null, + "DnsOptions": null, + "DnsSearch": null, + "ExtraHosts": null, + "VolumesFrom": null, + "Devices": null, + "NetworkMode": "default", + "IpcMode": "", + "PidMode": "", + "UTSMode": "", + "CapAdd": null, + "CapDrop": null, + "GroupAdd": null, + "RestartPolicy": { + "Name": "", + "MaximumRetryCount": 0 + }, + "SecurityOpt": null, + "ReadonlyRootfs": false, + "Ulimits": null, + "LogConfig": { + "Type": "json-file", + "Config": {} + }, + "CgroupParent": "", + "ConsoleSize": [ + 0, + 0 + ], + "VolumeDriver": "" + }, + "GraphDriver": { + "Name": "aufs", + "Data": null + }, + "Mounts": [ + { + "Name": "b1a70d8e1ebd7d5865e59ff91cf06357e3ef4d829af44c31675c2d0a24894444", + "Source": "/var/lib/docker/volumes/b1a70d8e1ebd7d5865e59ff91cf06357e3ef4d829af44c31675c2d0a24894444/_data", + "Destination": "/data/db", + "Driver": "local", + "Mode": "", + "RW": true + } + ], + "Config": { + "Hostname": "a68c1872c746", + "Domainname": "", + "User": "", + "AttachStdin": true, + "AttachStdout": true, + "AttachStderr": true, + "ExposedPorts": { + "27017/tcp": {} + }, + "Tty": true, + "OpenStdin": true, + "StdinOnce": false, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "GPG_KEYS=DFFA3DCF326E302C4787673A01C4E7FAAAB2461C \t42F3E95A2C4F08279C4960ADD68FA50FEA312927", + "MONGO_MAJOR=3.2", + "MONGO_VERSION=3.2.0" + ], + "Cmd": [ + "None" + ], + "Image": "mongo:latest", + "Volumes": { + "/data/db": {} + }, + "WorkingDir": "", + "Entrypoint": [ + "/entrypoint.sh" + ], + "OnBuild": null, + "Labels": {} + }, + "NetworkSettings": { + "Bridge": "", + "SandboxID": "", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "Ports": null, + "SandboxKey": "", + "SecondaryIPAddresses": null, + "SecondaryIPv6Addresses": null, + "EndpointID": "", + "Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "MacAddress": "", + "Networks": { + "bridge": { + "EndpointID": "", + "Gateway": "", + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "" + } + } + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker/linux_124/containers.json b/libcloud/test/container/fixtures/docker/linux_124/containers.json new file mode 100644 index 0000000000..3228e3f10c --- /dev/null +++ b/libcloud/test/container/fixtures/docker/linux_124/containers.json @@ -0,0 +1,143 @@ +[ + { + "Id": "160936dc54fe8c332095676d9379003534b8cddd7565fa63018996e06dae1b6b", + "Names": [ + "/hubot" + ], + "Image": "stackstorm/hubot", + "ImageID": "05c5761707b3970a9bf17c00886176add79ac087b4d6a500ac87985bf8ec07b1", + "Command": "/app/bin/hubot", + "Created": 1450130345, + "Ports": [], + "Labels": {}, + "Status": "Exited (137) 11 minutes ago", + "HostConfig": { + "NetworkMode": "bridge" + } + }, + { + "Id": "f159072147ee7d253e21ec8fd2778a27ac29d7fc5f865641900d16665b46215a", + "Names": [ + "/mongo" + ], + "Image": "mongo", + "ImageID": "cf55d61f5307b7a18a45980971d6cfd40b737dd661879c4a6b3f2aecc3bc37b0", + "Command": "/entrypoint.sh mongod", + "Created": 1450130332, + "Ports": [], + "Labels": {}, + "Status": "Exited (14) 2 hours ago", + "HostConfig": { + "NetworkMode": "bridge" + } + }, + { + "Id": "e687b33f9ced0153104308e6ff7a2138b8cc026fa4085d31da831a02ed0dc03d", + "Names": [ + "/rabbitmq" + ], + "Image": "rabbitmq", + "ImageID": "448afeda0388b18c6f3be18c7aaece29e0f8dbdfab30364e678c382bab1037c5", + "Command": "/docker-entrypoint.sh rabbitmq-server", + "Created": 1450130331, + "Ports": [ + { + "IP": "0.0.0.0", + "PrivatePort": 5672, + "PublicPort": 5672, + "Type": "tcp" + }, + { + "PrivatePort": 25672, + "Type": "tcp" + }, + { + "PrivatePort": 4369, + "Type": "tcp" + }, + { + "PrivatePort": 5671, + "Type": "tcp" + } + ], + "Labels": {}, + "Status": "Exited (137) 11 minutes ago", + "HostConfig": { + "NetworkMode": "bridge" + } + }, + { + "Id": "b82c16423c6dbb7cd1564f8fc413c822df45cc0c7aa35c24683a1329af6ec102", + "Names": [ + "/fervent_bhabha" + ], + "Image": "rabbitmq", + "ImageID": "448afeda0388b18c6f3be18c7aaece29e0f8dbdfab30364e678c382bab1037c5", + "Command": "/docker-entrypoint.sh rabbitmq-server", + "Created": 1450059506, + "Ports": [ + { + "PrivatePort": 4369, + "Type": "tcp" + }, + { + "PrivatePort": 5671, + "Type": "tcp" + }, + { + "IP": "0.0.0.0", + "PrivatePort": 5672, + "PublicPort": 5672, + "Type": "tcp" + }, + { + "PrivatePort": 25672, + "Type": "tcp" + } + ], + "Labels": {}, + "Status": "Dead", + "HostConfig": { + "NetworkMode": "bridge" + } + }, + { + "Id": "8cc5481aa4621578f8dd2c942d74e27e75170c6899ea012db7a44ea5f1ba2069", + "Names": [ + "/suspicious_swirles" + ], + "Image": "mongo", + "ImageID": "cf55d61f5307b7a18a45980971d6cfd40b737dd661879c4a6b3f2aecc3bc37b0", + "Command": "/entrypoint.sh mongod", + "Created": 1450059505, + "Ports": [ + { + "IP": "0.0.0.0", + "PrivatePort": 27017, + "PublicPort": 27017, + "Type": "tcp" + } + ], + "Labels": {}, + "Status": "Dead", + "HostConfig": { + "NetworkMode": "bridge" + } + }, + { + "Id": "598b3e4d15a406390baaa2947f910e7b52b810a4120028692ed309247f2e8346", + "Names": [ + "/mongodata" + ], + "Image": "mongo", + "ImageID": "cf55d61f5307b7a18a45980971d6cfd40b737dd661879c4a6b3f2aecc3bc37b0", + "Command": "/entrypoint.sh /bin/true", + "Created": 1449637213, + "Ports": [], + "Labels": {}, + "Status": "Created", + "HostConfig": { + "NetworkMode": "default" + } + } +] \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker/linux_124/create_container.json b/libcloud/test/container/fixtures/docker/linux_124/create_container.json new file mode 100644 index 0000000000..e05a941720 --- /dev/null +++ b/libcloud/test/container/fixtures/docker/linux_124/create_container.json @@ -0,0 +1,4 @@ +{ + "Id": "a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303", + "Warnings": null +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker/linux_124/create_image.txt b/libcloud/test/container/fixtures/docker/linux_124/create_image.txt new file mode 100644 index 0000000000..9eeee420f3 --- /dev/null +++ b/libcloud/test/container/fixtures/docker/linux_124/create_image.txt @@ -0,0 +1,238 @@ +{"status":"Pulling from library/ubuntu","id":"12.04"} +{"status":"Pulling fs layer","progressDetail":{},"id":"36cef014d5d4"} +{"status":"Pulling fs layer","progressDetail":{},"id":"0d99ad4de1d2"} +{"status":"Pulling fs layer","progressDetail":{},"id":"3e32dbf1ab94"} +{"status":"Pulling fs layer","progressDetail":{},"id":"44710c456ffc"} +{"status":"Pulling fs layer","progressDetail":{},"id":"56e70ac3b314"} +{"status":"Waiting","progressDetail":{},"id":"44710c456ffc"} +{"status":"Waiting","progressDetail":{},"id":"56e70ac3b314"} +{"status":"Downloading","progressDetail":{"current":419,"total":419},"progress":"[==================================================\u003e] 419 B/419 B","id":"3e32dbf1ab94"} +{"status":"Verifying Checksum","progressDetail":{},"id":"3e32dbf1ab94"} +{"status":"Download complete","progressDetail":{},"id":"3e32dbf1ab94"} +{"status":"Downloading","progressDetail":{"current":16384,"total":57935},"progress":"[==============\u003e ] 16.38 kB/57.94 kB","id":"0d99ad4de1d2"} +{"status":"Downloading","progressDetail":{"current":32768,"total":57935},"progress":"[============================\u003e ] 32.77 kB/57.94 kB","id":"0d99ad4de1d2"} +{"status":"Downloading","progressDetail":{"current":57935,"total":57935},"progress":"[==================================================\u003e] 57.94 kB/57.94 kB","id":"0d99ad4de1d2"} +{"status":"Verifying Checksum","progressDetail":{},"id":"0d99ad4de1d2"} +{"status":"Download complete","progressDetail":{},"id":"0d99ad4de1d2"} +{"status":"Downloading","progressDetail":{"current":162,"total":162},"progress":"[==================================================\u003e] 162 B/162 B","id":"56e70ac3b314"} +{"status":"Verifying Checksum","progressDetail":{},"id":"56e70ac3b314"} +{"status":"Download complete","progressDetail":{},"id":"56e70ac3b314"} +{"status":"Downloading","progressDetail":{"current":682,"total":682},"progress":"[==================================================\u003e] 682 B/682 B","id":"44710c456ffc"} +{"status":"Verifying Checksum","progressDetail":{},"id":"44710c456ffc"} +{"status":"Download complete","progressDetail":{},"id":"44710c456ffc"} +{"status":"Downloading","progressDetail":{"current":392563,"total":39081844},"progress":"[\u003e ] 392.6 kB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":783955,"total":39081844},"progress":"[=\u003e ] 784 kB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":1178995,"total":39081844},"progress":"[=\u003e ] 1.179 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":1572211,"total":39081844},"progress":"[==\u003e ] 1.572 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":1965427,"total":39081844},"progress":"[==\u003e ] 1.965 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":2358643,"total":39081844},"progress":"[===\u003e ] 2.359 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":2751859,"total":39081844},"progress":"[===\u003e ] 2.752 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":3145075,"total":39081844},"progress":"[====\u003e ] 3.145 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":3538291,"total":39081844},"progress":"[====\u003e ] 3.538 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":3931507,"total":39081844},"progress":"[=====\u003e ] 3.932 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":4324723,"total":39081844},"progress":"[=====\u003e ] 4.325 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":4717939,"total":39081844},"progress":"[======\u003e ] 4.718 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":5111155,"total":39081844},"progress":"[======\u003e ] 5.111 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":5504371,"total":39081844},"progress":"[=======\u003e ] 5.504 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":5897587,"total":39081844},"progress":"[=======\u003e ] 5.898 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":6290803,"total":39081844},"progress":"[========\u003e ] 6.291 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":6684019,"total":39081844},"progress":"[========\u003e ] 6.684 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":7077235,"total":39081844},"progress":"[=========\u003e ] 7.077 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":7470451,"total":39081844},"progress":"[=========\u003e ] 7.47 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":7863667,"total":39081844},"progress":"[==========\u003e ] 7.864 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":8256883,"total":39081844},"progress":"[==========\u003e ] 8.257 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":8650099,"total":39081844},"progress":"[===========\u003e ] 8.65 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":9043315,"total":39081844},"progress":"[===========\u003e ] 9.043 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":9436531,"total":39081844},"progress":"[============\u003e ] 9.437 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":9829747,"total":39081844},"progress":"[============\u003e ] 9.83 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":10222963,"total":39081844},"progress":"[=============\u003e ] 10.22 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":10616179,"total":39081844},"progress":"[=============\u003e ] 10.62 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":11009395,"total":39081844},"progress":"[==============\u003e ] 11.01 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":11402611,"total":39081844},"progress":"[==============\u003e ] 11.4 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":11795827,"total":39081844},"progress":"[===============\u003e ] 11.8 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":12189043,"total":39081844},"progress":"[===============\u003e ] 12.19 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":12582259,"total":39081844},"progress":"[================\u003e ] 12.58 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":12975475,"total":39081844},"progress":"[================\u003e ] 12.98 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":13368691,"total":39081844},"progress":"[=================\u003e ] 13.37 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":13761907,"total":39081844},"progress":"[=================\u003e ] 13.76 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":14155123,"total":39081844},"progress":"[==================\u003e ] 14.16 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":14548339,"total":39081844},"progress":"[==================\u003e ] 14.55 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":14941555,"total":39081844},"progress":"[===================\u003e ] 14.94 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":15334771,"total":39081844},"progress":"[===================\u003e ] 15.33 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":15727987,"total":39081844},"progress":"[====================\u003e ] 15.73 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":16121203,"total":39081844},"progress":"[====================\u003e ] 16.12 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":16514419,"total":39081844},"progress":"[=====================\u003e ] 16.51 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":16907635,"total":39081844},"progress":"[=====================\u003e ] 16.91 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":17300851,"total":39081844},"progress":"[======================\u003e ] 17.3 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":17694067,"total":39081844},"progress":"[======================\u003e ] 17.69 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":18087283,"total":39081844},"progress":"[=======================\u003e ] 18.09 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":18480499,"total":39081844},"progress":"[=======================\u003e ] 18.48 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":18873715,"total":39081844},"progress":"[========================\u003e ] 18.87 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":19266931,"total":39081844},"progress":"[========================\u003e ] 19.27 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":19660147,"total":39081844},"progress":"[=========================\u003e ] 19.66 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":20053363,"total":39081844},"progress":"[=========================\u003e ] 20.05 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":20446579,"total":39081844},"progress":"[==========================\u003e ] 20.45 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":20839795,"total":39081844},"progress":"[==========================\u003e ] 20.84 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":21233011,"total":39081844},"progress":"[===========================\u003e ] 21.23 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":21626227,"total":39081844},"progress":"[===========================\u003e ] 21.63 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":22019443,"total":39081844},"progress":"[============================\u003e ] 22.02 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":22412659,"total":39081844},"progress":"[============================\u003e ] 22.41 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":22805875,"total":39081844},"progress":"[=============================\u003e ] 22.81 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":23199091,"total":39081844},"progress":"[=============================\u003e ] 23.2 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":23592307,"total":39081844},"progress":"[==============================\u003e ] 23.59 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":23985523,"total":39081844},"progress":"[==============================\u003e ] 23.99 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":24378739,"total":39081844},"progress":"[===============================\u003e ] 24.38 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":24771955,"total":39081844},"progress":"[===============================\u003e ] 24.77 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":25165171,"total":39081844},"progress":"[================================\u003e ] 25.17 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":25558387,"total":39081844},"progress":"[================================\u003e ] 25.56 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":25951603,"total":39081844},"progress":"[=================================\u003e ] 25.95 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":26344819,"total":39081844},"progress":"[=================================\u003e ] 26.34 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":26738035,"total":39081844},"progress":"[==================================\u003e ] 26.74 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":27131251,"total":39081844},"progress":"[==================================\u003e ] 27.13 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":27524467,"total":39081844},"progress":"[===================================\u003e ] 27.52 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":27917683,"total":39081844},"progress":"[===================================\u003e ] 27.92 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":28310899,"total":39081844},"progress":"[====================================\u003e ] 28.31 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":28704115,"total":39081844},"progress":"[====================================\u003e ] 28.7 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":29097331,"total":39081844},"progress":"[=====================================\u003e ] 29.1 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":29490547,"total":39081844},"progress":"[=====================================\u003e ] 29.49 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":29883763,"total":39081844},"progress":"[======================================\u003e ] 29.88 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":30276979,"total":39081844},"progress":"[======================================\u003e ] 30.28 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":30670195,"total":39081844},"progress":"[=======================================\u003e ] 30.67 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":31063411,"total":39081844},"progress":"[=======================================\u003e ] 31.06 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":31456627,"total":39081844},"progress":"[========================================\u003e ] 31.46 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":31849843,"total":39081844},"progress":"[========================================\u003e ] 31.85 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":32243059,"total":39081844},"progress":"[=========================================\u003e ] 32.24 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":32636275,"total":39081844},"progress":"[=========================================\u003e ] 32.64 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":33029491,"total":39081844},"progress":"[==========================================\u003e ] 33.03 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":33422707,"total":39081844},"progress":"[==========================================\u003e ] 33.42 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":33815923,"total":39081844},"progress":"[===========================================\u003e ] 33.82 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":34209139,"total":39081844},"progress":"[===========================================\u003e ] 34.21 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":34602355,"total":39081844},"progress":"[============================================\u003e ] 34.6 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":34995571,"total":39081844},"progress":"[============================================\u003e ] 35 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":35388787,"total":39081844},"progress":"[=============================================\u003e ] 35.39 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":35782003,"total":39081844},"progress":"[=============================================\u003e ] 35.78 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":36175219,"total":39081844},"progress":"[==============================================\u003e ] 36.18 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":36568435,"total":39081844},"progress":"[==============================================\u003e ] 36.57 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":36961651,"total":39081844},"progress":"[===============================================\u003e ] 36.96 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":37354867,"total":39081844},"progress":"[===============================================\u003e ] 37.35 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":37748083,"total":39081844},"progress":"[================================================\u003e ] 37.75 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":38141299,"total":39081844},"progress":"[================================================\u003e ] 38.14 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":38534515,"total":39081844},"progress":"[=================================================\u003e ] 38.53 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":38927731,"total":39081844},"progress":"[=================================================\u003e ] 38.93 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Download complete","progressDetail":{},"id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":393216,"total":39081844},"progress":"[\u003e ] 393.2 kB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":786432,"total":39081844},"progress":"[=\u003e ] 786.4 kB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":1179648,"total":39081844},"progress":"[=\u003e ] 1.18 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":1572864,"total":39081844},"progress":"[==\u003e ] 1.573 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":1966080,"total":39081844},"progress":"[==\u003e ] 1.966 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":2359296,"total":39081844},"progress":"[===\u003e ] 2.359 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":2752512,"total":39081844},"progress":"[===\u003e ] 2.753 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":3145728,"total":39081844},"progress":"[====\u003e ] 3.146 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":3538944,"total":39081844},"progress":"[====\u003e ] 3.539 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":3932160,"total":39081844},"progress":"[=====\u003e ] 3.932 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":4325376,"total":39081844},"progress":"[=====\u003e ] 4.325 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":4718592,"total":39081844},"progress":"[======\u003e ] 4.719 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":5111808,"total":39081844},"progress":"[======\u003e ] 5.112 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":5505024,"total":39081844},"progress":"[=======\u003e ] 5.505 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":5898240,"total":39081844},"progress":"[=======\u003e ] 5.898 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":6291456,"total":39081844},"progress":"[========\u003e ] 6.291 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":6684672,"total":39081844},"progress":"[========\u003e ] 6.685 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":7077888,"total":39081844},"progress":"[=========\u003e ] 7.078 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":7471104,"total":39081844},"progress":"[=========\u003e ] 7.471 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":7864320,"total":39081844},"progress":"[==========\u003e ] 7.864 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":8257536,"total":39081844},"progress":"[==========\u003e ] 8.258 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":8650752,"total":39081844},"progress":"[===========\u003e ] 8.651 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":9043968,"total":39081844},"progress":"[===========\u003e ] 9.044 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":9437184,"total":39081844},"progress":"[============\u003e ] 9.437 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":9830400,"total":39081844},"progress":"[============\u003e ] 9.83 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":10223616,"total":39081844},"progress":"[=============\u003e ] 10.22 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":10616832,"total":39081844},"progress":"[=============\u003e ] 10.62 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":11010048,"total":39081844},"progress":"[==============\u003e ] 11.01 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":11403264,"total":39081844},"progress":"[==============\u003e ] 11.4 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":11796480,"total":39081844},"progress":"[===============\u003e ] 11.8 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":12189696,"total":39081844},"progress":"[===============\u003e ] 12.19 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":12582912,"total":39081844},"progress":"[================\u003e ] 12.58 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":12976128,"total":39081844},"progress":"[================\u003e ] 12.98 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":13369344,"total":39081844},"progress":"[=================\u003e ] 13.37 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":13762560,"total":39081844},"progress":"[=================\u003e ] 13.76 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":14155776,"total":39081844},"progress":"[==================\u003e ] 14.16 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":14548992,"total":39081844},"progress":"[==================\u003e ] 14.55 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":14942208,"total":39081844},"progress":"[===================\u003e ] 14.94 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":15335424,"total":39081844},"progress":"[===================\u003e ] 15.34 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":15728640,"total":39081844},"progress":"[====================\u003e ] 15.73 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":16121856,"total":39081844},"progress":"[====================\u003e ] 16.12 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":16515072,"total":39081844},"progress":"[=====================\u003e ] 16.52 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":16908288,"total":39081844},"progress":"[=====================\u003e ] 16.91 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":17301504,"total":39081844},"progress":"[======================\u003e ] 17.3 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":17694720,"total":39081844},"progress":"[======================\u003e ] 17.69 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":18087936,"total":39081844},"progress":"[=======================\u003e ] 18.09 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":18481152,"total":39081844},"progress":"[=======================\u003e ] 18.48 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":18874368,"total":39081844},"progress":"[========================\u003e ] 18.87 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":19267584,"total":39081844},"progress":"[========================\u003e ] 19.27 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":19660800,"total":39081844},"progress":"[=========================\u003e ] 19.66 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":20054016,"total":39081844},"progress":"[=========================\u003e ] 20.05 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":20447232,"total":39081844},"progress":"[==========================\u003e ] 20.45 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":20840448,"total":39081844},"progress":"[==========================\u003e ] 20.84 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":21233664,"total":39081844},"progress":"[===========================\u003e ] 21.23 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":21626880,"total":39081844},"progress":"[===========================\u003e ] 21.63 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":22020096,"total":39081844},"progress":"[============================\u003e ] 22.02 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":22413312,"total":39081844},"progress":"[============================\u003e ] 22.41 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":22806528,"total":39081844},"progress":"[=============================\u003e ] 22.81 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":23199744,"total":39081844},"progress":"[=============================\u003e ] 23.2 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":23592960,"total":39081844},"progress":"[==============================\u003e ] 23.59 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":23986176,"total":39081844},"progress":"[==============================\u003e ] 23.99 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":24379392,"total":39081844},"progress":"[===============================\u003e ] 24.38 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":24772608,"total":39081844},"progress":"[===============================\u003e ] 24.77 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":25165824,"total":39081844},"progress":"[================================\u003e ] 25.17 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":25559040,"total":39081844},"progress":"[================================\u003e ] 25.56 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":25952256,"total":39081844},"progress":"[=================================\u003e ] 25.95 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":26345472,"total":39081844},"progress":"[=================================\u003e ] 26.35 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":26738688,"total":39081844},"progress":"[==================================\u003e ] 26.74 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":27131904,"total":39081844},"progress":"[==================================\u003e ] 27.13 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":27525120,"total":39081844},"progress":"[===================================\u003e ] 27.53 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":27918336,"total":39081844},"progress":"[===================================\u003e ] 27.92 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":28311552,"total":39081844},"progress":"[====================================\u003e ] 28.31 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":28704768,"total":39081844},"progress":"[====================================\u003e ] 28.7 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":29097984,"total":39081844},"progress":"[=====================================\u003e ] 29.1 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":29491200,"total":39081844},"progress":"[=====================================\u003e ] 29.49 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":29884416,"total":39081844},"progress":"[======================================\u003e ] 29.88 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":30277632,"total":39081844},"progress":"[======================================\u003e ] 30.28 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":30670848,"total":39081844},"progress":"[=======================================\u003e ] 30.67 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":31064064,"total":39081844},"progress":"[=======================================\u003e ] 31.06 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":31457280,"total":39081844},"progress":"[========================================\u003e ] 31.46 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":31850496,"total":39081844},"progress":"[========================================\u003e ] 31.85 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":32243712,"total":39081844},"progress":"[=========================================\u003e ] 32.24 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":32636928,"total":39081844},"progress":"[=========================================\u003e ] 32.64 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":33030144,"total":39081844},"progress":"[==========================================\u003e ] 33.03 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":33423360,"total":39081844},"progress":"[==========================================\u003e ] 33.42 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":33816576,"total":39081844},"progress":"[===========================================\u003e ] 33.82 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":34209792,"total":39081844},"progress":"[===========================================\u003e ] 34.21 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":34603008,"total":39081844},"progress":"[============================================\u003e ] 34.6 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":34996224,"total":39081844},"progress":"[============================================\u003e ] 35 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":35389440,"total":39081844},"progress":"[=============================================\u003e ] 35.39 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":35782656,"total":39081844},"progress":"[=============================================\u003e ] 35.78 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":36175872,"total":39081844},"progress":"[==============================================\u003e ] 36.18 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":36569088,"total":39081844},"progress":"[==============================================\u003e ] 36.57 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":36962304,"total":39081844},"progress":"[===============================================\u003e ] 36.96 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":37355520,"total":39081844},"progress":"[===============================================\u003e ] 37.36 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":37748736,"total":39081844},"progress":"[================================================\u003e ] 37.75 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":38141952,"total":39081844},"progress":"[================================================\u003e ] 38.14 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":38535168,"total":39081844},"progress":"[=================================================\u003e ] 38.54 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":38928384,"total":39081844},"progress":"[=================================================\u003e ] 38.93 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":39081844,"total":39081844},"progress":"[==================================================\u003e] 39.08 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Pull complete","progressDetail":{},"id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":32768,"total":57935},"progress":"[============================\u003e ] 32.77 kB/57.94 kB","id":"0d99ad4de1d2"} +{"status":"Extracting","progressDetail":{"current":57935,"total":57935},"progress":"[==================================================\u003e] 57.94 kB/57.94 kB","id":"0d99ad4de1d2"} +{"status":"Extracting","progressDetail":{"current":57935,"total":57935},"progress":"[==================================================\u003e] 57.94 kB/57.94 kB","id":"0d99ad4de1d2"} +{"status":"Pull complete","progressDetail":{},"id":"0d99ad4de1d2"} +{"status":"Extracting","progressDetail":{"current":419,"total":419},"progress":"[==================================================\u003e] 419 B/419 B","id":"3e32dbf1ab94"} +{"status":"Extracting","progressDetail":{"current":419,"total":419},"progress":"[==================================================\u003e] 419 B/419 B","id":"3e32dbf1ab94"} +{"status":"Pull complete","progressDetail":{},"id":"3e32dbf1ab94"} +{"status":"Extracting","progressDetail":{"current":682,"total":682},"progress":"[==================================================\u003e] 682 B/682 B","id":"44710c456ffc"} +{"status":"Extracting","progressDetail":{"current":682,"total":682},"progress":"[==================================================\u003e] 682 B/682 B","id":"44710c456ffc"} +{"status":"Pull complete","progressDetail":{},"id":"44710c456ffc"} +{"status":"Extracting","progressDetail":{"current":162,"total":162},"progress":"[==================================================\u003e] 162 B/162 B","id":"56e70ac3b314"} +{"status":"Extracting","progressDetail":{"current":162,"total":162},"progress":"[==================================================\u003e] 162 B/162 B","id":"56e70ac3b314"} +{"status":"Pull complete","progressDetail":{},"id":"56e70ac3b314"} +{"status":"Digest: sha256:992069aee4016783df6345315302fa59681aae51a8eeb2f889dea59290f21787"} +{"status":"Status: Downloaded newer image for ubuntu:12.04"} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker/linux_124/images.json b/libcloud/test/container/fixtures/docker/linux_124/images.json new file mode 100644 index 0000000000..ac04cf38cb --- /dev/null +++ b/libcloud/test/container/fixtures/docker/linux_124/images.json @@ -0,0 +1,50 @@ +[ + { + "Id": "cf55d61f5307b7a18a45980971d6cfd40b737dd661879c4a6b3f2aecc3bc37b0", + "ParentId": "3e408cde1b7f6276b9ead7b8111d80a367f9223dfbbd4102ea89a5fc42947960", + "RepoTags": [ + "mongo:latest" + ], + "RepoDigests": [], + "Created": 1449618009, + "Size": 0, + "VirtualSize": 316957672, + "Labels": null + }, + { + "Id": "05c5761707b3970a9bf17c00886176add79ac087b4d6a500ac87985bf8ec07b1", + "ParentId": "be7965ce1bef5d2e3b27efb3f4fe2253683bc7144d2ebae614e9e7155066c833", + "RepoTags": [ + "stackstorm/hubot:latest" + ], + "RepoDigests": [], + "Created": 1449466772, + "Size": 0, + "VirtualSize": 550102318, + "Labels": {} + }, + { + "Id": "448afeda0388b18c6f3be18c7aaece29e0f8dbdfab30364e678c382bab1037c5", + "ParentId": "67edbf589f9af9b2c6f87e8481ec0299c50bfce5f9b98b95316c7235494c7bea", + "RepoTags": [ + "rabbitmq:latest" + ], + "RepoDigests": [], + "Created": 1449312753, + "Size": 0, + "VirtualSize": 304310861, + "Labels": null + }, + { + "Id": "9da5438fedb2e9a1e11a3361c4a53e0801ed1f8f4c014d83a5a514f0c60892bf", + "ParentId": "64ccc5e9d20c638849eadddab4f23204c3fcdd62d497cdbd0ecf44d863b086c8", + "RepoTags": [ + "mongo:2.4.14" + ], + "RepoDigests": [], + "Created": 1449299455, + "Size": 0, + "VirtualSize": 344445131, + "Labels": null + } +] \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker/linux_124/logs.txt b/libcloud/test/container/fixtures/docker/linux_124/logs.txt new file mode 100644 index 0000000000..12c3a44e48 --- /dev/null +++ b/libcloud/test/container/fixtures/docker/linux_124/logs.txt @@ -0,0 +1 @@ +/entrypoint.sh: line 19: exec: None: not found diff --git a/libcloud/test/container/fixtures/docker/linux_124/search.json b/libcloud/test/container/fixtures/docker/linux_124/search.json new file mode 100644 index 0000000000..dd9454c9b7 --- /dev/null +++ b/libcloud/test/container/fixtures/docker/linux_124/search.json @@ -0,0 +1,202 @@ +[ + { + "star_count": 1502, + "is_official": true, + "name": "mysql", + "is_trusted": false, + "is_automated": false, + "description": "MySQL is a widely used, open-source relational database management system (RDBMS)." + }, + { + "star_count": 80, + "is_official": false, + "name": "mysql/mysql-server", + "is_trusted": true, + "is_automated": true, + "description": "Optimized MySQL Server Docker images. Created, maintained and supported by the MySQL team at Oracle" + }, + { + "star_count": 31, + "is_official": false, + "name": "centurylink/mysql", + "is_trusted": true, + "is_automated": true, + "description": "Image containing mysql. Optimized to be linked to another image/container." + }, + { + "star_count": 6, + "is_official": false, + "name": "appcontainers/mysql", + "is_trusted": true, + "is_automated": true, + "description": "CentOS/Ubuntu/Debian based customizible MySQL 5.5 Container - 284MB/283MB/245MB - Updated 12/14/2015" + }, + { + "star_count": 2, + "is_official": false, + "name": "alterway/mysql", + "is_trusted": true, + "is_automated": true, + "description": "Docker Mysql" + }, + { + "star_count": 0, + "is_official": false, + "name": "tozd/mysql", + "is_trusted": true, + "is_automated": true, + "description": "MySQL (MariaDB fork) Docker image." + }, + { + "star_count": 0, + "is_official": false, + "name": "wenzizone/mysql", + "is_trusted": true, + "is_automated": true, + "description": "mysql" + }, + { + "star_count": 0, + "is_official": false, + "name": "dockerizedrupal/mysql", + "is_trusted": true, + "is_automated": true, + "description": "docker-mysql" + }, + { + "star_count": 2, + "is_official": false, + "name": "azukiapp/mysql", + "is_trusted": true, + "is_automated": true, + "description": "Docker image to run MySQL by Azuki - http://azk.io" + }, + { + "star_count": 1, + "is_official": false, + "name": "phpmentors/mysql", + "is_trusted": true, + "is_automated": true, + "description": "MySQL server image" + }, + { + "star_count": 0, + "is_official": false, + "name": "lancehudson/docker-mysql", + "is_trusted": true, + "is_automated": true, + "description": "MySQL is a widely used, open-source relational database management system (RDBMS)." + }, + { + "star_count": 1, + "is_official": false, + "name": "bahmni/mysql", + "is_trusted": true, + "is_automated": true, + "description": "Mysql container for bahmni. Contains the openmrs database" + }, + { + "star_count": 2, + "is_official": false, + "name": "yfix/mysql", + "is_trusted": true, + "is_automated": true, + "description": "Yfix docker built mysql" + }, + { + "star_count": 23, + "is_official": false, + "name": "sameersbn/mysql", + "is_trusted": true, + "is_automated": true, + "description": "" + }, + { + "star_count": 0, + "is_official": false, + "name": "nanobox/mysql", + "is_trusted": true, + "is_automated": true, + "description": "MySQL service for nanobox.io" + }, + { + "star_count": 0, + "is_official": false, + "name": "withinboredom/mysql", + "is_trusted": true, + "is_automated": true, + "description": "A MySQL container using s6 and Consul -- built on tatum/mysql" + }, + { + "star_count": 4, + "is_official": false, + "name": "marvambass/mysql", + "is_trusted": true, + "is_automated": true, + "description": "MySQL Server based on Ubuntu 14.04" + }, + { + "star_count": 14, + "is_official": false, + "name": "google/mysql", + "is_trusted": true, + "is_automated": true, + "description": "MySQL server for Google Compute Engine" + }, + { + "star_count": 1, + "is_official": false, + "name": "frodenas/mysql", + "is_trusted": true, + "is_automated": true, + "description": "A Docker Image for MySQL" + }, + { + "star_count": 0, + "is_official": false, + "name": "ahmet2mir/mysql", + "is_trusted": true, + "is_automated": true, + "description": "This is a Debian based image with MySQL server installed listening on port 3306. " + }, + { + "star_count": 25, + "is_official": false, + "name": "wnameless/mysql-phpmyadmin", + "is_trusted": true, + "is_automated": true, + "description": "MySQL + phpMyAdmin\nhttps://index.docker.io/u/wnameless/mysql-phpmyadmin/" + }, + { + "star_count": 0, + "is_official": false, + "name": "drupaldocker/mysql", + "is_trusted": true, + "is_automated": true, + "description": "MySQL for Drupal" + }, + { + "star_count": 0, + "is_official": false, + "name": "tetraweb/mysql", + "is_trusted": true, + "is_automated": true, + "description": "" + }, + { + "star_count": 1, + "is_official": false, + "name": "boomtownroi/mysql-dev", + "is_trusted": true, + "is_automated": true, + "description": "A mysql box with consul integration for development. Based on tatum box" + }, + { + "star_count": 5, + "is_official": false, + "name": "ioggstream/mysql", + "is_trusted": true, + "is_automated": true, + "description": "MySQL Image with Master-Slave replication" + } +] \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker/linux_124/version.json b/libcloud/test/container/fixtures/docker/linux_124/version.json new file mode 100644 index 0000000000..3b51d72d7b --- /dev/null +++ b/libcloud/test/container/fixtures/docker/linux_124/version.json @@ -0,0 +1,10 @@ +{ + "Version": "1.9.1", + "ApiVersion": "1.21", + "GitCommit": "a34a1d5", + "GoVersion": "go1.4.3", + "Os": "linux", + "Arch": "amd64", + "KernelVersion": "3.13.0-46-generic", + "BuildTime": "Fri Nov 20 17:56:04 UTC 2015" +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker/mac_124/containers.json b/libcloud/test/container/fixtures/docker/mac_124/containers.json new file mode 100644 index 0000000000..95b61d38c5 --- /dev/null +++ b/libcloud/test/container/fixtures/docker/mac_124/containers.json @@ -0,0 +1,242 @@ +[{ + "Id": "160936dc54fe8c332095676d9379003534b8cddd7565fa63018996e06dae1b6b", + "Names": ["/hubot"], + "Image": "stackstorm/hubot", + "ImageID": "sha256:0d409d33b27e47423b049f7f863faa08655a8c901749c2b25b93ca67d01a470d", + "Command": "nginx -g 'daemon off;'", + "Created": 1466734872, + "Ports": [{ + "PrivatePort": 443, + "Type": "tcp" + }, { + "PrivatePort": 80, + "Type": "tcp" + } + ], + "Labels": {}, + "State": "running", + "Status": "Up 4 seconds", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "beceac1c78e75bd5f8a13a60e3bf95b76aa45cac2d31978ae77934da17c16cc8", + "EndpointID": "d0c614dcdd1c6a89765c989640239a27ab3a99a5ca3dbd1de7494b939f39652c", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.7", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:07" + } + } + }, + "Mounts": [] + }, { + "Id": "6089a78e3e938a6a693601ad8a3f416d39273f8d2b4d3d3971b82eaa05281d08", + "Names": ["/fervent_noether"], + "Image": "nginx", + "ImageID": "sha256:0d409d33b27e47423b049f7f863faa08655a8c901749c2b25b93ca67d01a470d", + "Command": "nginx -g 'daemon off;'", + "Created": 1466734871, + "Ports": [{ + "PrivatePort": 443, + "Type": "tcp" + }, { + "PrivatePort": 80, + "Type": "tcp" + } + ], + "Labels": {}, + "State": "running", + "Status": "Up 5 seconds", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "beceac1c78e75bd5f8a13a60e3bf95b76aa45cac2d31978ae77934da17c16cc8", + "EndpointID": "1298dfe058795ed277e539e80e00cb88bbbcbb08051b1f43f979f878e959e9c4", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.6", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:06" + } + } + }, + "Mounts": [] + }, { + "Id": "1fa078bc0c56b94a81e62586aebab06042abc524df45fc3197eaff31dd61705f", + "Names": ["/cranky_nobel"], + "Image": "nginx", + "ImageID": "sha256:0d409d33b27e47423b049f7f863faa08655a8c901749c2b25b93ca67d01a470d", + "Command": "nginx -g 'daemon off;'", + "Created": 1466734869, + "Ports": [{ + "PrivatePort": 443, + "Type": "tcp" + }, { + "PrivatePort": 80, + "Type": "tcp" + } + ], + "Labels": {}, + "State": "running", + "Status": "Up 6 seconds", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "beceac1c78e75bd5f8a13a60e3bf95b76aa45cac2d31978ae77934da17c16cc8", + "EndpointID": "4985fa8a74f2997ee0794c1866e6492dbc9124705d41596fa27bb4c2505739fb", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.5", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:05" + } + } + }, + "Mounts": [] + }, { + "Id": "15faa50fa2a41f417cee3f2013fc150d0f90d9ed3102d8533e65099d50476e4d", + "Names": ["/sharp_kilby"], + "Image": "nginx", + "ImageID": "sha256:0d409d33b27e47423b049f7f863faa08655a8c901749c2b25b93ca67d01a470d", + "Command": "nginx -g 'daemon off;'", + "Created": 1466734868, + "Ports": [{ + "PrivatePort": 443, + "Type": "tcp" + }, { + "PrivatePort": 80, + "Type": "tcp" + } + ], + "Labels": {}, + "State": "running", + "Status": "Up 7 seconds", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "beceac1c78e75bd5f8a13a60e3bf95b76aa45cac2d31978ae77934da17c16cc8", + "EndpointID": "912a856ada2ab2e84a95ff2ca5236b9e84976e3daf4844623ba80228bb244660", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.4", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:04" + } + } + }, + "Mounts": [] + }, { + "Id": "c3bd5b03b4d5a636344b75271781c3402341db6be1e76168cb602c5d79439519", + "Names": ["/agitated_lalande"], + "Image": "nginx", + "ImageID": "sha256:0d409d33b27e47423b049f7f863faa08655a8c901749c2b25b93ca67d01a470d", + "Command": "nginx -g 'daemon off;'", + "Created": 1466734867, + "Ports": [{ + "PrivatePort": 443, + "Type": "tcp" + }, { + "PrivatePort": 80, + "Type": "tcp" + } + ], + "Labels": {}, + "State": "running", + "Status": "Up 9 seconds", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "beceac1c78e75bd5f8a13a60e3bf95b76aa45cac2d31978ae77934da17c16cc8", + "EndpointID": "2856237f86f145817f3807996c3e89c9ad019d45a29c98cb0ab165abebe11ef9", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.3", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:03" + } + } + }, + "Mounts": [] + }, { + "Id": "5ad88cda3edccb5523ddd6831a399f406434ef0fc35dc24caa6cd09ee08b7826", + "Names": ["/elated_euler"], + "Image": "nginx", + "ImageID": "sha256:0d409d33b27e47423b049f7f863faa08655a8c901749c2b25b93ca67d01a470d", + "Command": "nginx -g 'daemon off;'", + "Created": 1466734255, + "Ports": [{ + "PrivatePort": 443, + "Type": "tcp" + }, { + "PrivatePort": 80, + "Type": "tcp" + } + ], + "Labels": {}, + "State": "running", + "Status": "Up 10 minutes", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "beceac1c78e75bd5f8a13a60e3bf95b76aa45cac2d31978ae77934da17c16cc8", + "EndpointID": "80646c52b170bffbde82cffd0fff2c7096ecf55b47ec297481127b2a4e622416", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:02" + } + } + }, + "Mounts": [] + } +] \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker/mac_124/create_container.json b/libcloud/test/container/fixtures/docker/mac_124/create_container.json new file mode 100644 index 0000000000..e05a941720 --- /dev/null +++ b/libcloud/test/container/fixtures/docker/mac_124/create_container.json @@ -0,0 +1,4 @@ +{ + "Id": "a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303", + "Warnings": null +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker/mac_124/create_image.txt b/libcloud/test/container/fixtures/docker/mac_124/create_image.txt new file mode 100644 index 0000000000..9eeee420f3 --- /dev/null +++ b/libcloud/test/container/fixtures/docker/mac_124/create_image.txt @@ -0,0 +1,238 @@ +{"status":"Pulling from library/ubuntu","id":"12.04"} +{"status":"Pulling fs layer","progressDetail":{},"id":"36cef014d5d4"} +{"status":"Pulling fs layer","progressDetail":{},"id":"0d99ad4de1d2"} +{"status":"Pulling fs layer","progressDetail":{},"id":"3e32dbf1ab94"} +{"status":"Pulling fs layer","progressDetail":{},"id":"44710c456ffc"} +{"status":"Pulling fs layer","progressDetail":{},"id":"56e70ac3b314"} +{"status":"Waiting","progressDetail":{},"id":"44710c456ffc"} +{"status":"Waiting","progressDetail":{},"id":"56e70ac3b314"} +{"status":"Downloading","progressDetail":{"current":419,"total":419},"progress":"[==================================================\u003e] 419 B/419 B","id":"3e32dbf1ab94"} +{"status":"Verifying Checksum","progressDetail":{},"id":"3e32dbf1ab94"} +{"status":"Download complete","progressDetail":{},"id":"3e32dbf1ab94"} +{"status":"Downloading","progressDetail":{"current":16384,"total":57935},"progress":"[==============\u003e ] 16.38 kB/57.94 kB","id":"0d99ad4de1d2"} +{"status":"Downloading","progressDetail":{"current":32768,"total":57935},"progress":"[============================\u003e ] 32.77 kB/57.94 kB","id":"0d99ad4de1d2"} +{"status":"Downloading","progressDetail":{"current":57935,"total":57935},"progress":"[==================================================\u003e] 57.94 kB/57.94 kB","id":"0d99ad4de1d2"} +{"status":"Verifying Checksum","progressDetail":{},"id":"0d99ad4de1d2"} +{"status":"Download complete","progressDetail":{},"id":"0d99ad4de1d2"} +{"status":"Downloading","progressDetail":{"current":162,"total":162},"progress":"[==================================================\u003e] 162 B/162 B","id":"56e70ac3b314"} +{"status":"Verifying Checksum","progressDetail":{},"id":"56e70ac3b314"} +{"status":"Download complete","progressDetail":{},"id":"56e70ac3b314"} +{"status":"Downloading","progressDetail":{"current":682,"total":682},"progress":"[==================================================\u003e] 682 B/682 B","id":"44710c456ffc"} +{"status":"Verifying Checksum","progressDetail":{},"id":"44710c456ffc"} +{"status":"Download complete","progressDetail":{},"id":"44710c456ffc"} +{"status":"Downloading","progressDetail":{"current":392563,"total":39081844},"progress":"[\u003e ] 392.6 kB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":783955,"total":39081844},"progress":"[=\u003e ] 784 kB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":1178995,"total":39081844},"progress":"[=\u003e ] 1.179 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":1572211,"total":39081844},"progress":"[==\u003e ] 1.572 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":1965427,"total":39081844},"progress":"[==\u003e ] 1.965 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":2358643,"total":39081844},"progress":"[===\u003e ] 2.359 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":2751859,"total":39081844},"progress":"[===\u003e ] 2.752 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":3145075,"total":39081844},"progress":"[====\u003e ] 3.145 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":3538291,"total":39081844},"progress":"[====\u003e ] 3.538 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":3931507,"total":39081844},"progress":"[=====\u003e ] 3.932 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":4324723,"total":39081844},"progress":"[=====\u003e ] 4.325 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":4717939,"total":39081844},"progress":"[======\u003e ] 4.718 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":5111155,"total":39081844},"progress":"[======\u003e ] 5.111 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":5504371,"total":39081844},"progress":"[=======\u003e ] 5.504 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":5897587,"total":39081844},"progress":"[=======\u003e ] 5.898 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":6290803,"total":39081844},"progress":"[========\u003e ] 6.291 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":6684019,"total":39081844},"progress":"[========\u003e ] 6.684 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":7077235,"total":39081844},"progress":"[=========\u003e ] 7.077 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":7470451,"total":39081844},"progress":"[=========\u003e ] 7.47 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":7863667,"total":39081844},"progress":"[==========\u003e ] 7.864 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":8256883,"total":39081844},"progress":"[==========\u003e ] 8.257 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":8650099,"total":39081844},"progress":"[===========\u003e ] 8.65 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":9043315,"total":39081844},"progress":"[===========\u003e ] 9.043 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":9436531,"total":39081844},"progress":"[============\u003e ] 9.437 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":9829747,"total":39081844},"progress":"[============\u003e ] 9.83 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":10222963,"total":39081844},"progress":"[=============\u003e ] 10.22 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":10616179,"total":39081844},"progress":"[=============\u003e ] 10.62 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":11009395,"total":39081844},"progress":"[==============\u003e ] 11.01 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":11402611,"total":39081844},"progress":"[==============\u003e ] 11.4 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":11795827,"total":39081844},"progress":"[===============\u003e ] 11.8 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":12189043,"total":39081844},"progress":"[===============\u003e ] 12.19 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":12582259,"total":39081844},"progress":"[================\u003e ] 12.58 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":12975475,"total":39081844},"progress":"[================\u003e ] 12.98 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":13368691,"total":39081844},"progress":"[=================\u003e ] 13.37 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":13761907,"total":39081844},"progress":"[=================\u003e ] 13.76 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":14155123,"total":39081844},"progress":"[==================\u003e ] 14.16 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":14548339,"total":39081844},"progress":"[==================\u003e ] 14.55 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":14941555,"total":39081844},"progress":"[===================\u003e ] 14.94 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":15334771,"total":39081844},"progress":"[===================\u003e ] 15.33 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":15727987,"total":39081844},"progress":"[====================\u003e ] 15.73 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":16121203,"total":39081844},"progress":"[====================\u003e ] 16.12 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":16514419,"total":39081844},"progress":"[=====================\u003e ] 16.51 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":16907635,"total":39081844},"progress":"[=====================\u003e ] 16.91 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":17300851,"total":39081844},"progress":"[======================\u003e ] 17.3 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":17694067,"total":39081844},"progress":"[======================\u003e ] 17.69 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":18087283,"total":39081844},"progress":"[=======================\u003e ] 18.09 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":18480499,"total":39081844},"progress":"[=======================\u003e ] 18.48 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":18873715,"total":39081844},"progress":"[========================\u003e ] 18.87 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":19266931,"total":39081844},"progress":"[========================\u003e ] 19.27 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":19660147,"total":39081844},"progress":"[=========================\u003e ] 19.66 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":20053363,"total":39081844},"progress":"[=========================\u003e ] 20.05 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":20446579,"total":39081844},"progress":"[==========================\u003e ] 20.45 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":20839795,"total":39081844},"progress":"[==========================\u003e ] 20.84 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":21233011,"total":39081844},"progress":"[===========================\u003e ] 21.23 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":21626227,"total":39081844},"progress":"[===========================\u003e ] 21.63 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":22019443,"total":39081844},"progress":"[============================\u003e ] 22.02 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":22412659,"total":39081844},"progress":"[============================\u003e ] 22.41 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":22805875,"total":39081844},"progress":"[=============================\u003e ] 22.81 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":23199091,"total":39081844},"progress":"[=============================\u003e ] 23.2 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":23592307,"total":39081844},"progress":"[==============================\u003e ] 23.59 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":23985523,"total":39081844},"progress":"[==============================\u003e ] 23.99 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":24378739,"total":39081844},"progress":"[===============================\u003e ] 24.38 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":24771955,"total":39081844},"progress":"[===============================\u003e ] 24.77 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":25165171,"total":39081844},"progress":"[================================\u003e ] 25.17 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":25558387,"total":39081844},"progress":"[================================\u003e ] 25.56 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":25951603,"total":39081844},"progress":"[=================================\u003e ] 25.95 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":26344819,"total":39081844},"progress":"[=================================\u003e ] 26.34 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":26738035,"total":39081844},"progress":"[==================================\u003e ] 26.74 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":27131251,"total":39081844},"progress":"[==================================\u003e ] 27.13 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":27524467,"total":39081844},"progress":"[===================================\u003e ] 27.52 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":27917683,"total":39081844},"progress":"[===================================\u003e ] 27.92 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":28310899,"total":39081844},"progress":"[====================================\u003e ] 28.31 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":28704115,"total":39081844},"progress":"[====================================\u003e ] 28.7 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":29097331,"total":39081844},"progress":"[=====================================\u003e ] 29.1 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":29490547,"total":39081844},"progress":"[=====================================\u003e ] 29.49 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":29883763,"total":39081844},"progress":"[======================================\u003e ] 29.88 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":30276979,"total":39081844},"progress":"[======================================\u003e ] 30.28 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":30670195,"total":39081844},"progress":"[=======================================\u003e ] 30.67 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":31063411,"total":39081844},"progress":"[=======================================\u003e ] 31.06 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":31456627,"total":39081844},"progress":"[========================================\u003e ] 31.46 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":31849843,"total":39081844},"progress":"[========================================\u003e ] 31.85 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":32243059,"total":39081844},"progress":"[=========================================\u003e ] 32.24 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":32636275,"total":39081844},"progress":"[=========================================\u003e ] 32.64 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":33029491,"total":39081844},"progress":"[==========================================\u003e ] 33.03 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":33422707,"total":39081844},"progress":"[==========================================\u003e ] 33.42 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":33815923,"total":39081844},"progress":"[===========================================\u003e ] 33.82 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":34209139,"total":39081844},"progress":"[===========================================\u003e ] 34.21 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":34602355,"total":39081844},"progress":"[============================================\u003e ] 34.6 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":34995571,"total":39081844},"progress":"[============================================\u003e ] 35 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":35388787,"total":39081844},"progress":"[=============================================\u003e ] 35.39 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":35782003,"total":39081844},"progress":"[=============================================\u003e ] 35.78 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":36175219,"total":39081844},"progress":"[==============================================\u003e ] 36.18 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":36568435,"total":39081844},"progress":"[==============================================\u003e ] 36.57 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":36961651,"total":39081844},"progress":"[===============================================\u003e ] 36.96 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":37354867,"total":39081844},"progress":"[===============================================\u003e ] 37.35 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":37748083,"total":39081844},"progress":"[================================================\u003e ] 37.75 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":38141299,"total":39081844},"progress":"[================================================\u003e ] 38.14 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":38534515,"total":39081844},"progress":"[=================================================\u003e ] 38.53 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Downloading","progressDetail":{"current":38927731,"total":39081844},"progress":"[=================================================\u003e ] 38.93 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Download complete","progressDetail":{},"id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":393216,"total":39081844},"progress":"[\u003e ] 393.2 kB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":786432,"total":39081844},"progress":"[=\u003e ] 786.4 kB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":1179648,"total":39081844},"progress":"[=\u003e ] 1.18 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":1572864,"total":39081844},"progress":"[==\u003e ] 1.573 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":1966080,"total":39081844},"progress":"[==\u003e ] 1.966 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":2359296,"total":39081844},"progress":"[===\u003e ] 2.359 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":2752512,"total":39081844},"progress":"[===\u003e ] 2.753 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":3145728,"total":39081844},"progress":"[====\u003e ] 3.146 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":3538944,"total":39081844},"progress":"[====\u003e ] 3.539 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":3932160,"total":39081844},"progress":"[=====\u003e ] 3.932 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":4325376,"total":39081844},"progress":"[=====\u003e ] 4.325 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":4718592,"total":39081844},"progress":"[======\u003e ] 4.719 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":5111808,"total":39081844},"progress":"[======\u003e ] 5.112 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":5505024,"total":39081844},"progress":"[=======\u003e ] 5.505 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":5898240,"total":39081844},"progress":"[=======\u003e ] 5.898 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":6291456,"total":39081844},"progress":"[========\u003e ] 6.291 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":6684672,"total":39081844},"progress":"[========\u003e ] 6.685 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":7077888,"total":39081844},"progress":"[=========\u003e ] 7.078 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":7471104,"total":39081844},"progress":"[=========\u003e ] 7.471 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":7864320,"total":39081844},"progress":"[==========\u003e ] 7.864 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":8257536,"total":39081844},"progress":"[==========\u003e ] 8.258 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":8650752,"total":39081844},"progress":"[===========\u003e ] 8.651 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":9043968,"total":39081844},"progress":"[===========\u003e ] 9.044 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":9437184,"total":39081844},"progress":"[============\u003e ] 9.437 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":9830400,"total":39081844},"progress":"[============\u003e ] 9.83 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":10223616,"total":39081844},"progress":"[=============\u003e ] 10.22 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":10616832,"total":39081844},"progress":"[=============\u003e ] 10.62 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":11010048,"total":39081844},"progress":"[==============\u003e ] 11.01 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":11403264,"total":39081844},"progress":"[==============\u003e ] 11.4 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":11796480,"total":39081844},"progress":"[===============\u003e ] 11.8 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":12189696,"total":39081844},"progress":"[===============\u003e ] 12.19 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":12582912,"total":39081844},"progress":"[================\u003e ] 12.58 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":12976128,"total":39081844},"progress":"[================\u003e ] 12.98 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":13369344,"total":39081844},"progress":"[=================\u003e ] 13.37 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":13762560,"total":39081844},"progress":"[=================\u003e ] 13.76 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":14155776,"total":39081844},"progress":"[==================\u003e ] 14.16 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":14548992,"total":39081844},"progress":"[==================\u003e ] 14.55 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":14942208,"total":39081844},"progress":"[===================\u003e ] 14.94 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":15335424,"total":39081844},"progress":"[===================\u003e ] 15.34 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":15728640,"total":39081844},"progress":"[====================\u003e ] 15.73 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":16121856,"total":39081844},"progress":"[====================\u003e ] 16.12 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":16515072,"total":39081844},"progress":"[=====================\u003e ] 16.52 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":16908288,"total":39081844},"progress":"[=====================\u003e ] 16.91 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":17301504,"total":39081844},"progress":"[======================\u003e ] 17.3 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":17694720,"total":39081844},"progress":"[======================\u003e ] 17.69 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":18087936,"total":39081844},"progress":"[=======================\u003e ] 18.09 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":18481152,"total":39081844},"progress":"[=======================\u003e ] 18.48 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":18874368,"total":39081844},"progress":"[========================\u003e ] 18.87 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":19267584,"total":39081844},"progress":"[========================\u003e ] 19.27 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":19660800,"total":39081844},"progress":"[=========================\u003e ] 19.66 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":20054016,"total":39081844},"progress":"[=========================\u003e ] 20.05 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":20447232,"total":39081844},"progress":"[==========================\u003e ] 20.45 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":20840448,"total":39081844},"progress":"[==========================\u003e ] 20.84 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":21233664,"total":39081844},"progress":"[===========================\u003e ] 21.23 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":21626880,"total":39081844},"progress":"[===========================\u003e ] 21.63 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":22020096,"total":39081844},"progress":"[============================\u003e ] 22.02 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":22413312,"total":39081844},"progress":"[============================\u003e ] 22.41 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":22806528,"total":39081844},"progress":"[=============================\u003e ] 22.81 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":23199744,"total":39081844},"progress":"[=============================\u003e ] 23.2 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":23592960,"total":39081844},"progress":"[==============================\u003e ] 23.59 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":23986176,"total":39081844},"progress":"[==============================\u003e ] 23.99 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":24379392,"total":39081844},"progress":"[===============================\u003e ] 24.38 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":24772608,"total":39081844},"progress":"[===============================\u003e ] 24.77 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":25165824,"total":39081844},"progress":"[================================\u003e ] 25.17 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":25559040,"total":39081844},"progress":"[================================\u003e ] 25.56 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":25952256,"total":39081844},"progress":"[=================================\u003e ] 25.95 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":26345472,"total":39081844},"progress":"[=================================\u003e ] 26.35 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":26738688,"total":39081844},"progress":"[==================================\u003e ] 26.74 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":27131904,"total":39081844},"progress":"[==================================\u003e ] 27.13 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":27525120,"total":39081844},"progress":"[===================================\u003e ] 27.53 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":27918336,"total":39081844},"progress":"[===================================\u003e ] 27.92 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":28311552,"total":39081844},"progress":"[====================================\u003e ] 28.31 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":28704768,"total":39081844},"progress":"[====================================\u003e ] 28.7 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":29097984,"total":39081844},"progress":"[=====================================\u003e ] 29.1 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":29491200,"total":39081844},"progress":"[=====================================\u003e ] 29.49 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":29884416,"total":39081844},"progress":"[======================================\u003e ] 29.88 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":30277632,"total":39081844},"progress":"[======================================\u003e ] 30.28 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":30670848,"total":39081844},"progress":"[=======================================\u003e ] 30.67 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":31064064,"total":39081844},"progress":"[=======================================\u003e ] 31.06 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":31457280,"total":39081844},"progress":"[========================================\u003e ] 31.46 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":31850496,"total":39081844},"progress":"[========================================\u003e ] 31.85 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":32243712,"total":39081844},"progress":"[=========================================\u003e ] 32.24 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":32636928,"total":39081844},"progress":"[=========================================\u003e ] 32.64 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":33030144,"total":39081844},"progress":"[==========================================\u003e ] 33.03 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":33423360,"total":39081844},"progress":"[==========================================\u003e ] 33.42 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":33816576,"total":39081844},"progress":"[===========================================\u003e ] 33.82 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":34209792,"total":39081844},"progress":"[===========================================\u003e ] 34.21 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":34603008,"total":39081844},"progress":"[============================================\u003e ] 34.6 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":34996224,"total":39081844},"progress":"[============================================\u003e ] 35 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":35389440,"total":39081844},"progress":"[=============================================\u003e ] 35.39 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":35782656,"total":39081844},"progress":"[=============================================\u003e ] 35.78 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":36175872,"total":39081844},"progress":"[==============================================\u003e ] 36.18 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":36569088,"total":39081844},"progress":"[==============================================\u003e ] 36.57 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":36962304,"total":39081844},"progress":"[===============================================\u003e ] 36.96 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":37355520,"total":39081844},"progress":"[===============================================\u003e ] 37.36 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":37748736,"total":39081844},"progress":"[================================================\u003e ] 37.75 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":38141952,"total":39081844},"progress":"[================================================\u003e ] 38.14 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":38535168,"total":39081844},"progress":"[=================================================\u003e ] 38.54 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":38928384,"total":39081844},"progress":"[=================================================\u003e ] 38.93 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":39081844,"total":39081844},"progress":"[==================================================\u003e] 39.08 MB/39.08 MB","id":"36cef014d5d4"} +{"status":"Pull complete","progressDetail":{},"id":"36cef014d5d4"} +{"status":"Extracting","progressDetail":{"current":32768,"total":57935},"progress":"[============================\u003e ] 32.77 kB/57.94 kB","id":"0d99ad4de1d2"} +{"status":"Extracting","progressDetail":{"current":57935,"total":57935},"progress":"[==================================================\u003e] 57.94 kB/57.94 kB","id":"0d99ad4de1d2"} +{"status":"Extracting","progressDetail":{"current":57935,"total":57935},"progress":"[==================================================\u003e] 57.94 kB/57.94 kB","id":"0d99ad4de1d2"} +{"status":"Pull complete","progressDetail":{},"id":"0d99ad4de1d2"} +{"status":"Extracting","progressDetail":{"current":419,"total":419},"progress":"[==================================================\u003e] 419 B/419 B","id":"3e32dbf1ab94"} +{"status":"Extracting","progressDetail":{"current":419,"total":419},"progress":"[==================================================\u003e] 419 B/419 B","id":"3e32dbf1ab94"} +{"status":"Pull complete","progressDetail":{},"id":"3e32dbf1ab94"} +{"status":"Extracting","progressDetail":{"current":682,"total":682},"progress":"[==================================================\u003e] 682 B/682 B","id":"44710c456ffc"} +{"status":"Extracting","progressDetail":{"current":682,"total":682},"progress":"[==================================================\u003e] 682 B/682 B","id":"44710c456ffc"} +{"status":"Pull complete","progressDetail":{},"id":"44710c456ffc"} +{"status":"Extracting","progressDetail":{"current":162,"total":162},"progress":"[==================================================\u003e] 162 B/162 B","id":"56e70ac3b314"} +{"status":"Extracting","progressDetail":{"current":162,"total":162},"progress":"[==================================================\u003e] 162 B/162 B","id":"56e70ac3b314"} +{"status":"Pull complete","progressDetail":{},"id":"56e70ac3b314"} +{"status":"Digest: sha256:992069aee4016783df6345315302fa59681aae51a8eeb2f889dea59290f21787"} +{"status":"Status: Downloaded newer image for ubuntu:12.04"} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker/mac_124/search.json b/libcloud/test/container/fixtures/docker/mac_124/search.json new file mode 100644 index 0000000000..42d1f859d2 --- /dev/null +++ b/libcloud/test/container/fixtures/docker/mac_124/search.json @@ -0,0 +1,152 @@ +[{ + "star_count": 2558, + "is_official": true, + "name": "mysql", + "is_automated": false, + "description": "MySQL is a widely used, open-source relational database management system (RDBMS)." + }, { + "star_count": 164, + "is_official": false, + "name": "mysql/mysql-server", + "is_automated": true, + "description": "Optimized MySQL Server Docker images. Created, maintained and supported by the MySQL team at Oracle" + }, { + "star_count": 0, + "is_official": false, + "name": "tozd/mysql", + "is_automated": true, + "description": "MySQL (MariaDB fork) Docker image." + }, { + "star_count": 45, + "is_official": false, + "name": "centurylink/mysql", + "is_automated": true, + "description": "Image containing mysql. Optimized to be linked to another image/container." + }, { + "star_count": 8, + "is_official": false, + "name": "appcontainers/mysql", + "is_automated": true, + "description": "Centos/Debian Based Customizable MySQL Container - Updated 06/16/2016" + }, { + "star_count": 2, + "is_official": false, + "name": "alterway/mysql", + "is_automated": true, + "description": "Docker Mysql" + }, { + "star_count": 2, + "is_official": false, + "name": "drupaldocker/mysql", + "is_automated": true, + "description": "MySQL for Drupal" + }, { + "star_count": 2, + "is_official": false, + "name": "yfix/mysql", + "is_automated": true, + "description": "Yfix docker built mysql" + }, { + "star_count": 1, + "is_official": false, + "name": "phpmentors/mysql", + "is_automated": true, + "description": "MySQL server image" + }, { + "star_count": 0, + "is_official": false, + "name": "cloudposse/mysql", + "is_automated": true, + "description": "Improved `mysql` service with support for `mysqld_safe` and `fixtures` loaded from `mysqldump.sql`" + }, { + "star_count": 0, + "is_official": false, + "name": "nanobox/mysql", + "is_automated": true, + "description": "MySQL service for nanobox.io" + }, { + "star_count": 36, + "is_official": false, + "name": "sameersbn/mysql", + "is_automated": true, + "description": "" + }, { + "star_count": 0, + "is_official": false, + "name": "vukor/mysql", + "is_automated": true, + "description": "Build for MySQL. Project available on https://github.com/vukor/docker-web-stack" + }, { + "star_count": 6, + "is_official": false, + "name": "marvambass/mysql", + "is_automated": true, + "description": "MySQL Server based on Ubuntu 14.04" + }, { + "star_count": 0, + "is_official": false, + "name": "lancehudson/docker-mysql", + "is_automated": true, + "description": "MySQL is a widely used, open-source relational database management system (RDBMS)." + }, { + "star_count": 1, + "is_official": false, + "name": "sin30/mysql", + "is_automated": true, + "description": "MySQL images with my own config files." + }, { + "star_count": 2, + "is_official": false, + "name": "azukiapp/mysql", + "is_automated": true, + "description": "Docker image to run MySQL by Azuki - http://azk.io" + }, { + "star_count": 1, + "is_official": false, + "name": "kaluzki/mysql", + "is_automated": true, + "description": "mysql" + }, { + "star_count": 0, + "is_official": false, + "name": "livingobjects/mysql", + "is_automated": true, + "description": "MySQL" + }, { + "star_count": 0, + "is_official": false, + "name": "akilli/mysql", + "is_automated": true, + "description": "akilli/base based MySQL image" + }, { + "star_count": 0, + "is_official": false, + "name": "projectomakase/mysql", + "is_automated": true, + "description": "Docker image for MySQL" + }, { + "star_count": 1, + "is_official": false, + "name": "tetraweb/mysql", + "is_automated": true, + "description": "" + }, { + "star_count": 0, + "is_official": false, + "name": "dockerizedrupal/mysql", + "is_automated": true, + "description": "docker-mysql" + }, { + "star_count": 1, + "is_official": false, + "name": "debezium/example-mysql", + "is_automated": true, + "description": "Example MySQL database server with a simple Inventory database, useful for demos and tutorials." + }, { + "star_count": 16, + "is_official": false, + "name": "google/mysql", + "is_automated": true, + "description": "MySQL server for Google Compute Engine" + } +] \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker/mac_124/version.json b/libcloud/test/container/fixtures/docker/mac_124/version.json new file mode 100644 index 0000000000..e07d4669b6 --- /dev/null +++ b/libcloud/test/container/fixtures/docker/mac_124/version.json @@ -0,0 +1,11 @@ +{ + "Version": "1.12.0-rc2", + "ApiVersion": "1.24", + "GitCommit": "a7119de", + "GoVersion": "go1.6.2", + "Os": "linux", + "Arch": "amd64", + "KernelVersion": "4.4.13-moby", + "Experimental": true, + "BuildTime": "2016-06-17T22:09:20.440355664+00:00" +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker_utils/v2_repositories_library_ubuntu.json b/libcloud/test/container/fixtures/docker_utils/v2_repositories_library_ubuntu.json new file mode 100644 index 0000000000..d60b25d4d1 --- /dev/null +++ b/libcloud/test/container/fixtures/docker_utils/v2_repositories_library_ubuntu.json @@ -0,0 +1,15 @@ +{ + "user": "library", + "name": "ubuntu", + "namespace": "library", + "status": 1, + "description": "Ubuntu is a Debian-based Linux operating system based on free software.", + "is_private": false, + "is_automated": false, + "can_edit": false, + "star_count": 2954, + "pull_count": 37627788, + "last_updated": "2016-01-04T19:00:53.547174Z", + "has_starred": false, + "full_description": "# Supported tags and respective `Dockerfile` links\n\n-\t[`12.04.5`, `12.04`, `precise-20151208`, `precise` (*precise/Dockerfile*)](https://github.com/tianon/docker-brew-ubuntu-core/blob/d7f2045ad9b08962d9728f6d9910fa252282b85f/precise/Dockerfile)\n-\t[`14.04.3`, `14.04`, `trusty-20151218`, `trusty`, `latest` (*trusty/Dockerfile*)](https://github.com/tianon/docker-brew-ubuntu-core/blob/d7f2045ad9b08962d9728f6d9910fa252282b85f/trusty/Dockerfile)\n-\t[`15.04`, `vivid-20151208`, `vivid` (*vivid/Dockerfile*)](https://github.com/tianon/docker-brew-ubuntu-core/blob/d7f2045ad9b08962d9728f6d9910fa252282b85f/vivid/Dockerfile)\n-\t[`15.10`, `wily-20151208`, `wily` (*wily/Dockerfile*)](https://github.com/tianon/docker-brew-ubuntu-core/blob/d7f2045ad9b08962d9728f6d9910fa252282b85f/wily/Dockerfile)\n-\t[`16.04`, `xenial-20151218.1`, `xenial` (*xenial/Dockerfile*)](https://github.com/tianon/docker-brew-ubuntu-core/blob/d7f2045ad9b08962d9728f6d9910fa252282b85f/xenial/Dockerfile)\n\nFor more information about this image and its history, please see [the relevant manifest file (`library/ubuntu`)](https://github.com/docker-library/official-images/blob/master/library/ubuntu). This image is updated via pull requests to [the `docker-library/official-images` GitHub repo](https://github.com/docker-library/official-images).\n\nFor detailed information about the virtual/transfer sizes and individual layers of each of the above supported tags, please see [the `ubuntu/tag-details.md` file](https://github.com/docker-library/docs/blob/master/ubuntu/tag-details.md) in [the `docker-library/docs` GitHub repo](https://github.com/docker-library/docs).\n\n# What is Ubuntu?\n\nUbuntu is a Debian-based Linux operating system, with Unity as its default desktop environment. It is based on free software and named after the Southern African philosophy of ubuntu (literally, \"human-ness\"), which often is translated as \"humanity towards others\" or \"the belief in a universal bond of sharing that connects all humanity\".\n\nDevelopment of Ubuntu is led by UK-based Canonical Ltd., a company owned by South African entrepreneur Mark Shuttleworth. Canonical generates revenue through the sale of technical support and other services related to Ubuntu. The Ubuntu project is publicly committed to the principles of open-source software development; people are encouraged to use free software, study how it works, improve upon it, and distribute it.\n\n> [wikipedia.org/wiki/Ubuntu_(operating_system)](https://en.wikipedia.org/wiki/Ubuntu_%28operating_system%29)\n\n![logo](https://raw.githubusercontent.com/docker-library/docs/01c12653951b2fe592c1f93a13b4e289ada0e3a1/ubuntu/logo.png)\n\n# What's in this image?\n\n## `/etc/apt/sources.list`\n\n### `ubuntu:14.04`\n\n```console\n$ docker run ubuntu:14.04 grep -v '^#' /etc/apt/sources.list\n\ndeb http://archive.ubuntu.com/ubuntu/ trusty main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted\n\ndeb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted\n\ndeb http://archive.ubuntu.com/ubuntu/ trusty universe\ndeb-src http://archive.ubuntu.com/ubuntu/ trusty universe\ndeb http://archive.ubuntu.com/ubuntu/ trusty-updates universe\ndeb-src http://archive.ubuntu.com/ubuntu/ trusty-updates universe\n\n\ndeb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted\ndeb http://archive.ubuntu.com/ubuntu/ trusty-security universe\ndeb-src http://archive.ubuntu.com/ubuntu/ trusty-security universe\n```\n\n### `ubuntu:12.04`\n\n```console\n$ docker run ubuntu:12.04 cat /etc/apt/sources.list\n\ndeb http://archive.ubuntu.com/ubuntu/ precise main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ precise main restricted\n\ndeb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted\n\ndeb http://archive.ubuntu.com/ubuntu/ precise universe\ndeb-src http://archive.ubuntu.com/ubuntu/ precise universe\ndeb http://archive.ubuntu.com/ubuntu/ precise-updates universe\ndeb-src http://archive.ubuntu.com/ubuntu/ precise-updates universe\n\n\ndeb http://archive.ubuntu.com/ubuntu/ precise-security main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ precise-security main restricted\ndeb http://archive.ubuntu.com/ubuntu/ precise-security universe\ndeb-src http://archive.ubuntu.com/ubuntu/ precise-security universe\n```\n\n# Supported Docker versions\n\nThis image is officially supported on Docker version 1.9.1.\n\nSupport for older versions (down to 1.6) is provided on a best-effort basis.\n\nPlease see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.\n\n# User Feedback\n\n## Documentation\n\nDocumentation for this image is stored in the [`ubuntu/` directory](https://github.com/docker-library/docs/tree/master/ubuntu) of the [`docker-library/docs` GitHub repo](https://github.com/docker-library/docs). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/docker-library/docs/blob/master/README.md) before attempting a pull request.\n\n## Issues\n\nIf you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/tianon/docker-brew-ubuntu-core/issues).\n\nYou can also reach many of the official image maintainers via the `#docker-library` IRC channel on [Freenode](https://freenode.net).\n\n## Contributing\n\nYou are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.\n\nBefore you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/tianon/docker-brew-ubuntu-core/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing." +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker_utils/v2_repositories_library_ubuntu_tags.json b/libcloud/test/container/fixtures/docker_utils/v2_repositories_library_ubuntu_tags.json new file mode 100644 index 0000000000..f3914c939a --- /dev/null +++ b/libcloud/test/container/fixtures/docker_utils/v2_repositories_library_ubuntu_tags.json @@ -0,0 +1,975 @@ +{ + "count": 88, + "next": null, + "previous": null, + "results": [ + { + "name": "xenial", + "full_size": 47439662, + "id": 1589976, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2016-01-04T19:00:51.344198Z", + "image_id": null, + "v2": true + }, + { + "name": "xenial-20151218.1", + "full_size": 47439662, + "id": 1589974, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2016-01-04T19:00:45.326998Z", + "image_id": null, + "v2": true + }, + { + "name": "16.04", + "full_size": 47439662, + "id": 1589970, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2016-01-04T19:00:39.215205Z", + "image_id": null, + "v2": true + }, + { + "name": "wily", + "full_size": 50294202, + "id": 2332, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": "2016-01-04T19:00:30.141301Z", + "image_id": null, + "v2": true + }, + { + "name": "wily-20151208", + "full_size": 50294202, + "id": 1509180, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2016-01-04T19:00:24.324323Z", + "image_id": null, + "v2": true + }, + { + "name": "15.10", + "full_size": 50294202, + "id": 2327, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": "2016-01-04T19:00:18.625895Z", + "image_id": null, + "v2": true + }, + { + "name": "vivid", + "full_size": 49334628, + "id": 2329, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": "2016-01-04T19:00:12.764756Z", + "image_id": null, + "v2": true + }, + { + "name": "vivid-20151208", + "full_size": 49334628, + "id": 1509158, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2016-01-04T19:00:07.282476Z", + "image_id": null, + "v2": true + }, + { + "name": "15.04", + "full_size": 49334628, + "id": 2298, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": "2016-01-04T19:00:01.659187Z", + "image_id": null, + "v2": true + }, + { + "name": "latest", + "full_size": 65747044, + "id": 2343, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": "2016-01-04T18:59:54.779484Z", + "image_id": null, + "v2": true + }, + { + "name": "trusty", + "full_size": 65747044, + "id": 2305, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": "2016-01-04T18:59:49.102906Z", + "image_id": null, + "v2": true + }, + { + "name": "trusty-20151218", + "full_size": 65747044, + "id": 1657173, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2016-01-04T18:59:43.103725Z", + "image_id": null, + "v2": true + }, + { + "name": "14.04", + "full_size": 65747044, + "id": 2324, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": "2016-01-04T18:59:37.496154Z", + "image_id": null, + "v2": true + }, + { + "name": "14.04.3", + "full_size": 65747044, + "id": 693829, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2016-01-04T18:58:46.261151Z", + "image_id": null, + "v2": true + }, + { + "name": "precise", + "full_size": 44194573, + "id": 2292, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": "2016-01-04T18:57:33.494399Z", + "image_id": null, + "v2": true + }, + { + "name": "precise-20151208", + "full_size": 44194573, + "id": 1509115, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2016-01-04T18:57:22.912930Z", + "image_id": null, + "v2": true + }, + { + "name": "12.04", + "full_size": 44194573, + "id": 2310, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": "2016-01-04T18:57:14.495660Z", + "image_id": null, + "v2": true + }, + { + "name": "12.04.5", + "full_size": 44194573, + "id": 2295, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": "2016-01-04T18:57:08.237857Z", + "image_id": null, + "v2": true + }, + { + "name": "trusty-20151208", + "full_size": 65742980, + "id": 1509143, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2015-12-18T18:26:56.770757Z", + "image_id": null, + "v2": true + }, + { + "name": "wily-20151019", + "full_size": 49817335, + "id": 1168566, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2015-12-08T09:04:03.336941Z", + "image_id": null, + "v2": true + }, + { + "name": "vivid-20151111", + "full_size": 49333876, + "id": 1389462, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2015-12-08T09:02:56.243906Z", + "image_id": null, + "v2": true + }, + { + "name": "trusty-20151028", + "full_size": 65742789, + "id": 1313714, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2015-12-08T09:02:32.340602Z", + "image_id": null, + "v2": true + }, + { + "name": "precise-20151028", + "full_size": 44096878, + "id": 1313721, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2015-12-08T09:02:07.834932Z", + "image_id": null, + "v2": true + }, + { + "name": "vivid-20151106", + "full_size": 49329280, + "id": 1313735, + "repository": 130, + "creator": 2215, + "last_updater": 213249, + "last_updated": "2015-11-21T01:14:52.126272Z", + "image_id": null, + "v2": true + }, + { + "name": "12.10", + "full_size": 58078433, + "id": 2339, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:42:40.878495Z", + "image_id": null, + "v2": true + }, + { + "name": "trusty-20150218.1", + "full_size": 65832655, + "id": 2325, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:42:29.777917Z", + "image_id": null, + "v2": true + }, + { + "name": "utopic-20150211", + "full_size": 68374766, + "id": 2307, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:41:34.805100Z", + "image_id": null, + "v2": true + }, + { + "name": "quantal", + "full_size": 58078433, + "id": 2341, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:40:29.962553Z", + "image_id": null, + "v2": true + }, + { + "name": "14.04.1", + "full_size": 65827193, + "id": 2322, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:39:42.479726Z", + "image_id": null, + "v2": true + }, + { + "name": "raring", + "full_size": 57667348, + "id": 2316, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:38:47.745980Z", + "image_id": null, + "v2": true + }, + { + "name": "vivid-20150218", + "full_size": 44122689, + "id": 2320, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:38:37.964774Z", + "image_id": null, + "v2": true + }, + { + "name": "vivid-20150309", + "full_size": 49448856, + "id": 2317, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:37:59.209284Z", + "image_id": null, + "v2": true + }, + { + "name": "10.04", + "full_size": 63533781, + "id": 2299, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:37:16.010344Z", + "image_id": null, + "v2": true + }, + { + "name": "saucy", + "full_size": 60522580, + "id": 2301, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:37:04.113916Z", + "image_id": null, + "v2": true + }, + { + "name": "precise-20150228.11", + "full_size": 43657047, + "id": 2331, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:36:51.552688Z", + "image_id": null, + "v2": true + }, + { + "name": "utopic-20150228.11", + "full_size": 68379536, + "id": 2318, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:36:02.986916Z", + "image_id": null, + "v2": true + }, + { + "name": "13.10", + "full_size": 60522580, + "id": 2304, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:34:52.333445Z", + "image_id": null, + "v2": true + }, + { + "name": "13.04", + "full_size": 57667348, + "id": 2294, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:33:49.391093Z", + "image_id": null, + "v2": true + }, + { + "name": "precise-20150212", + "full_size": 43616335, + "id": 2340, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:32:59.135708Z", + "image_id": null, + "v2": true + }, + { + "name": "trusty-20150228.11", + "full_size": 65828716, + "id": 2323, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:32:14.798440Z", + "image_id": null, + "v2": true + }, + { + "name": "lucid", + "full_size": 63533781, + "id": 2321, + "repository": 130, + "creator": 7, + "last_updater": 134455, + "last_updated": "2015-11-14T14:31:11.758283Z", + "image_id": null, + "v2": true + }, + { + "name": "vivid-20151021", + "full_size": 49328003, + "id": 1168551, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2015-10-28T12:21:31.210637Z", + "image_id": null, + "v2": true + }, + { + "name": "trusty-20151021", + "full_size": 65741561, + "id": 1168539, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2015-10-28T12:21:07.780326Z", + "image_id": null, + "v2": true + }, + { + "name": "precise-20151020", + "full_size": 44096883, + "id": 1168524, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": "2015-10-28T12:20:39.816211Z", + "image_id": null, + "v2": true + }, + { + "name": "wily-20151009", + "full_size": 49844614, + "id": 1096696, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "trusty-20151009", + "full_size": 65861875, + "id": 1096682, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "wily-20151006", + "full_size": 49861095, + "id": 1081815, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "vivid-20150930", + "full_size": 49345386, + "id": 1081804, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "trusty-20151001", + "full_size": 65757468, + "id": 1081789, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "precise-20150924", + "full_size": 44037965, + "id": 1081772, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "wily-20150829", + "full_size": 49614664, + "id": 828778, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "wily-20150818", + "full_size": 50298307, + "id": 778618, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "precise-20150813", + "full_size": 43977816, + "id": 776393, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "vivid-20150813", + "full_size": 49343696, + "id": 776144, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "trusty-20150814", + "full_size": 65859249, + "id": 775535, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "wily-20150807", + "full_size": 50528668, + "id": 693839, + "repository": 130, + "creator": 2215, + "last_updater": 213249, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "trusty-20150806", + "full_size": 65857914, + "id": 693834, + "repository": 130, + "creator": 2215, + "last_updater": 213249, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "wily-20150731", + "full_size": 50488452, + "id": 674054, + "repository": 130, + "creator": 2215, + "last_updater": 213249, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "vivid-20150802", + "full_size": 49340063, + "id": 674043, + "repository": 130, + "creator": 2215, + "last_updater": 213249, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "trusty-20150730", + "full_size": 65860360, + "id": 674034, + "repository": 130, + "creator": 2215, + "last_updater": 213249, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "precise-20150729", + "full_size": 43967445, + "id": 674016, + "repository": 130, + "creator": 2215, + "last_updater": 213249, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "wily-20150708", + "full_size": 50494409, + "id": 541269, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "utopic-20150625", + "full_size": 68399747, + "id": 541258, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "trusty-20150630", + "full_size": 65858138, + "id": 541253, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "precise-20150626", + "full_size": 43878461, + "id": 541246, + "repository": 130, + "creator": 2215, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "vivid-20150528", + "full_size": 131333439, + "id": 2338, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "utopic-20150528", + "full_size": 194454267, + "id": 2337, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "utopic", + "full_size": 68399747, + "id": 2336, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "precise-20150528", + "full_size": 133416464, + "id": 2335, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "utopic-20150319", + "full_size": 194424279, + "id": 2334, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "utopic-20150418", + "full_size": 194463410, + "id": 2333, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "precise-20150427", + "full_size": 132465012, + "id": 2330, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "trusty-20150612", + "full_size": 188284994, + "id": 2328, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "wily-20150528.1", + "full_size": 132392276, + "id": 2326, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "vivid-20150319.1", + "full_size": 131685773, + "id": 2315, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "14.04.2", + "full_size": 65860360, + "id": 2314, + "repository": 130, + "creator": 7, + "last_updater": 213249, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "trusty-20150528", + "full_size": 188281989, + "id": 2313, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "precise-20150612", + "full_size": 133706040, + "id": 2312, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "trusty-20150320", + "full_size": 188300556, + "id": 2311, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "vivid-20150611", + "full_size": 49338475, + "id": 2309, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "trusty-20150427", + "full_size": 188278440, + "id": 2308, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "wily-20150611", + "full_size": 133648792, + "id": 2306, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "utopic-20150612", + "full_size": 194462706, + "id": 2303, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "utopic-20150427", + "full_size": 194461653, + "id": 2302, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "precise-20150320", + "full_size": 131886863, + "id": 2300, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "14.10", + "full_size": 68399747, + "id": 2297, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": null, + "image_id": null, + "v2": true + }, + { + "name": "vivid-20150427", + "full_size": 131302888, + "id": 2296, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + }, + { + "name": "vivid-20150421", + "full_size": 131279915, + "id": 2293, + "repository": 130, + "creator": 7, + "last_updater": 7, + "last_updated": null, + "image_id": null, + "v2": false + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/docker_utils/v2_repositories_library_ubuntu_tags_latest.json b/libcloud/test/container/fixtures/docker_utils/v2_repositories_library_ubuntu_tags_latest.json new file mode 100644 index 0000000000..c5ce942bcc --- /dev/null +++ b/libcloud/test/container/fixtures/docker_utils/v2_repositories_library_ubuntu_tags_latest.json @@ -0,0 +1,11 @@ +{ + "name": "latest", + "full_size": 65747044, + "id": 2343, + "repository": 130, + "creator": 7, + "last_updater": 2215, + "last_updated": "2016-01-04T18:59:54.779484Z", + "image_id": null, + "v2": true +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/createcluster.json b/libcloud/test/container/fixtures/ecs/createcluster.json new file mode 100644 index 0000000000..eb6ced3baa --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/createcluster.json @@ -0,0 +1,11 @@ +{ + "cluster": { + "activeServicesCount": 0, + "clusterArn": "arn:aws:ecs:ap-southeast-2:647433528374:cluster/my-cluster", + "clusterName": "my-cluster", + "pendingTasksCount": 0, + "registeredContainerInstancesCount": 0, + "runningTasksCount": 0, + "status": "ACTIVE" + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/createservice.json b/libcloud/test/container/fixtures/ecs/createservice.json new file mode 100644 index 0000000000..2f9d421e84 --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/createservice.json @@ -0,0 +1,30 @@ +{ + "service": { + "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default", + "deploymentConfiguration": { + "maximumPercent": 200, + "minimumHealthyPercent": 100 + }, + "deployments": [ + { + "createdAt": 1430326887.362, + "desiredCount": 10, + "id": "ecs-svc/9223370606527888445", + "pendingCount": 0, + "runningCount": 0, + "status": "PRIMARY", + "taskDefinition": "arn:aws:ecs:us-east-1:012345678910:task-definition/ecs-demo:1", + "updatedAt": 1430326887.362 + } + ], + "desiredCount": 10, + "events": [], + "loadBalancers": [], + "pendingCount": 0, + "runningCount": 0, + "serviceArn": "arn:aws:ecs:us-east-1:012345678910:service/test", + "serviceName": "test", + "status": "ACTIVE", + "taskDefinition": "arn:aws:ecs:us-east-1:012345678910:task-definition/ecs-demo:1" + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/deletecluster.json b/libcloud/test/container/fixtures/ecs/deletecluster.json new file mode 100644 index 0000000000..9c8c0cdb32 --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/deletecluster.json @@ -0,0 +1,11 @@ +{ + "cluster": { + "activeServicesCount": 0, + "clusterArn": "arn:aws:ecs:ap-southeast-2:647433528374:cluster/my-cluster", + "clusterName": "my-cluster", + "pendingTasksCount": 0, + "registeredContainerInstancesCount": 0, + "runningTasksCount": 0, + "status": "INACTIVE" + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/deleteservice.json b/libcloud/test/container/fixtures/ecs/deleteservice.json new file mode 100644 index 0000000000..d89d3233b0 --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/deleteservice.json @@ -0,0 +1,30 @@ +{ + "service": { + "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default", + "deploymentConfiguration": { + "maximumPercent": 200, + "minimumHealthyPercent": 100 + }, + "deployments": [ + { + "createdAt": 1430320735.285, + "desiredCount": 0, + "id": "ecs-svc/9223370606534040511", + "pendingCount": 0, + "runningCount": 0, + "status": "PRIMARY", + "taskDefinition": "arn:aws:ecs:us-east-1:012345678910:task-definition/sleep360:27", + "updatedAt": 1430320735.285 + } + ], + "desiredCount": 0, + "events": [], + "loadBalancers": [], + "pendingCount": 0, + "runningCount": 0, + "serviceArn": "arn:aws:ecs:us-east-1:012345678910:service/test", + "serviceName": "test", + "status": "DRAINING", + "taskDefinition": "arn:aws:ecs:us-east-1:012345678910:task-definition/sleep360:27" + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/describeclusters.json b/libcloud/test/container/fixtures/ecs/describeclusters.json new file mode 100644 index 0000000000..1e894261a7 --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/describeclusters.json @@ -0,0 +1,14 @@ +{ + "clusters": [ + { + "activeServicesCount": 1, + "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default", + "clusterName": "default", + "pendingTasksCount": 0, + "registeredContainerInstancesCount": 0, + "runningTasksCount": 0, + "status": "ACTIVE" + } + ], + "failures": [] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/describerepositories.json b/libcloud/test/container/fixtures/ecs/describerepositories.json new file mode 100644 index 0000000000..c79400552a --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/describerepositories.json @@ -0,0 +1,8 @@ +{ + "repositories": [{ + "registryId": "647433528374", + "repositoryArn": "arn:aws:ecr:us-east-1:647433528374:repository/my-images", + "repositoryName": "my-images" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/describeservices.json b/libcloud/test/container/fixtures/ecs/describeservices.json new file mode 100644 index 0000000000..76acc75af6 --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/describeservices.json @@ -0,0 +1,33 @@ +{ + "failures": [], + "services": [ + { + "clusterArn": "arn:aws:ecs:us-west-2:012345678910:cluster/telemetry", + "deploymentConfiguration": { + "maximumPercent": 200, + "minimumHealthyPercent": 100 + }, + "deployments": [ + { + "createdAt": 1432829320.611, + "desiredCount": 4, + "id": "ecs-svc/9223370604025455196", + "pendingCount": 0, + "runningCount": 4, + "status": "PRIMARY", + "taskDefinition": "arn:aws:ecs:us-west-2:012345678910:task-definition/hpcc-t2-medium:1", + "updatedAt": 1432829320.611 + } + ], + "desiredCount": 4, + "events": [], + "loadBalancers": [], + "pendingCount": 0, + "runningCount": 4, + "serviceArn": "arn:aws:ecs:us-west-2:012345678910:service/bunker-buster", + "serviceName": "test", + "status": "ACTIVE", + "taskDefinition": "arn:aws:ecs:us-west-2:012345678910:task-definition/hpcc-t2-medium:1" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/describetasks.json b/libcloud/test/container/fixtures/ecs/describetasks.json new file mode 100644 index 0000000000..1dd5f1bba0 --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/describetasks.json @@ -0,0 +1,35 @@ +{ + "failures": [], + "tasks": [{ + "clusterArn": "arn:aws:ecs:ap-southeast-2:647433528374:cluster/default", + "containerInstanceArn": "arn:aws:ecs:ap-southeast-2:647433528374:container-instance/13b83f4b-d557-48a6-a4d7-2b0e8068e62b", + "containers": [{ + "containerArn": "arn:aws:ecs:ap-southeast-2:647433528374:container/d56d4e2c-9804-42a7-9f2a-6029cb50d4a2", + "lastStatus": "RUNNING", + "name": "simple-app", + "networkBindings": [{ + "bindIP": "0.0.0.0", + "containerPort": 80, + "hostPort": 80, + "protocol": "tcp" + } + ], + "taskArn": "arn:aws:ecs:ap-southeast-2:647433528374:task/c15bcab8-39e6-4c28-a47d-27b433269e5c" + } + ], + "createdAt": 1.451468104403E9, + "desiredStatus": "RUNNING", + "lastStatus": "RUNNING", + "overrides": { + "containerOverrides": [{ + "name": "simple-app" + } + ] + }, + "startedAt": 1.45146812139E9, + "startedBy": "ecs-svc/9223370585386692588", + "taskArn": "arn:aws:ecs:ap-southeast-2:647433528374:task/c15bcab8-39e6-4c28-a47d-27b433269e5c", + "taskDefinitionArn": "arn:aws:ecs:ap-southeast-2:647433528374:task-definition/console-sample-app-static:1" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/getauthorizationtoken.json b/libcloud/test/container/fixtures/ecs/getauthorizationtoken.json new file mode 100644 index 0000000000..469c9efd8d --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/getauthorizationtoken.json @@ -0,0 +1,9 @@ +{ + "authorizationData": [ + { + "authorizationToken": "QVdTOkNpQzErSHF1ZXZPcUR...", + "expiresAt": 1448878779.809, + "proxyEndpoint": "https://012345678910.dkr.ecr.us-east-1.amazonaws.com" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/listclusters.json b/libcloud/test/container/fixtures/ecs/listclusters.json new file mode 100644 index 0000000000..11c0d0e20b --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/listclusters.json @@ -0,0 +1 @@ +{"clusterArns":["arn:aws:ecs:ap-southeast-2:647433528374:cluster/my-cluster","arn:aws:ecs:ap-southeast-2:647433528374:cluster/default"]} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/listimages.json b/libcloud/test/container/fixtures/ecs/listimages.json new file mode 100644 index 0000000000..ae598f0efc --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/listimages.json @@ -0,0 +1,7 @@ +{ + "imageIds": [{ + "imageDigest": "sha256:9bacaf947ed397fcc9afb7359a1a8eaa1f6944ba8cd4ddca1c69bdcf4acf12a2", + "imageTag": "latest" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/listservices.json b/libcloud/test/container/fixtures/ecs/listservices.json new file mode 100644 index 0000000000..62a3cf5dee --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/listservices.json @@ -0,0 +1,6 @@ +{ + "serviceArns": [ + "arn:aws:ecs:us-east-1:012345678910:service/hello_world", + "arn:aws:ecs:us-east-1:012345678910:service/ecs-simple-service" + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/listtasks.json b/libcloud/test/container/fixtures/ecs/listtasks.json new file mode 100644 index 0000000000..644ff731da --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/listtasks.json @@ -0,0 +1,8 @@ +{ + "taskArns": [ + "arn:aws:ecs:us-east-1:012345678910:task/0b69d5c0-d655-4695-98cd-5d2d526d9d5a", + "arn:aws:ecs:us-east-1:012345678910:task/51a01bdf-d00e-487e-ab14-7645330b6207", + "arn:aws:ecs:us-east-1:012345678910:task/b0b28bb8-2be3-4810-b52b-88df129d893c", + "arn:aws:ecs:us-east-1:012345678910:task/c09f0188-7f87-4b0f-bfc3-16296622b6fe" + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/registertaskdefinition.json b/libcloud/test/container/fixtures/ecs/registertaskdefinition.json new file mode 100644 index 0000000000..fd53f9d4d5 --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/registertaskdefinition.json @@ -0,0 +1,21 @@ +{ + "taskDefinition": { + "containerDefinitions": [{ + "cpu": 10, + "environment": [], + "essential": true, + "image": "simple-app", + "memory": 500, + "mountPoints": [], + "name": "my-simple-app", + "portMappings": [], + "volumesFrom": [] + } + ], + "family": "my-simple-app", + "revision": 1, + "status": "ACTIVE", + "taskDefinitionArn": "arn:aws:ecs:ap-southeast-2:647433528374:task-definition/my-simple-app:1", + "volumes": [] + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/runtask.json b/libcloud/test/container/fixtures/ecs/runtask.json new file mode 100644 index 0000000000..d53c97a638 --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/runtask.json @@ -0,0 +1,26 @@ +{ + "failures": [], + "tasks": [{ + "clusterArn": "arn:aws:ecs:ap-southeast-2:647433528374:cluster/default", + "containerInstanceArn": "arn:aws:ecs:ap-southeast-2:647433528374:container-instance/13b83f4b-d557-48a6-a4d7-2b0e8068e62b", + "containers": [{ + "containerArn": "arn:aws:ecs:ap-southeast-2:647433528374:container/e443d10f-dea3-481e-8a1e-966b9ad4e498", + "lastStatus": "PENDING", + "name": "my-simple-app", + "taskArn": "arn:aws:ecs:ap-southeast-2:647433528374:task/b7c76236-b96f-4de1-93c8-9da3c30ccc23" + } + ], + "createdAt": 1.45181726008E9, + "desiredStatus": "RUNNING", + "lastStatus": "PENDING", + "overrides": { + "containerOverrides": [{ + "name": "my-simple-app" + } + ] + }, + "taskArn": "arn:aws:ecs:ap-southeast-2:647433528374:task/b7c76236-b96f-4de1-93c8-9da3c30ccc23", + "taskDefinitionArn": "arn:aws:ecs:ap-southeast-2:647433528374:task-definition/my-simple-app:1" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/ecs/stoptask.json b/libcloud/test/container/fixtures/ecs/stoptask.json new file mode 100644 index 0000000000..72b5ebb71a --- /dev/null +++ b/libcloud/test/container/fixtures/ecs/stoptask.json @@ -0,0 +1,42 @@ +{ + "task": { + "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default", + "containerInstanceArn": "arn:aws:ecs:us-east-1:012345678910:container-instance/8db248d6-16a7-42b5-b9f9-43d3b1ad9430", + "containers": [ + { + "containerArn": "arn:aws:ecs:us-east-1:012345678910:container/05a5528c-77f6-4e5b-8f9a-2b0a1928a926", + "lastStatus": "RUNNING", + "name": "mysql", + "networkBindings": [], + "taskArn": "arn:aws:ecs:us-east-1:012345678910:task/a126249b-b7e4-4b06-9d8f-1b56e75a99b5" + }, + { + "containerArn": "arn:aws:ecs:us-east-1:012345678910:container/37234a82-77f6-41d7-b54b-591f1e278093", + "lastStatus": "RUNNING", + "name": "wordpress", + "networkBindings": [ + { + "bindIP": "0.0.0.0", + "containerPort": 80, + "hostPort": 80 + } + ], + "taskArn": "arn:aws:ecs:us-east-1:012345678910:task/a126249b-b7e4-4b06-9d8f-1b56e75a99b5" + } + ], + "desiredStatus": "STOPPED", + "lastStatus": "RUNNING", + "overrides": { + "containerOverrides": [ + { + "name": "mysql" + }, + { + "name": "wordpress" + } + ] + }, + "taskArn": "arn:aws:ecs:us-east-1:012345678910:task/a126249b-b7e4-4b06-9d8f-1b56e75a99b5", + "taskDefinitionArn": "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:11" + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/gke/zones_us-central1-a_instance_serverconfig.json b/libcloud/test/container/fixtures/gke/zones_us-central1-a_instance_serverconfig.json new file mode 100644 index 0000000000..2b9685c6e6 --- /dev/null +++ b/libcloud/test/container/fixtures/gke/zones_us-central1-a_instance_serverconfig.json @@ -0,0 +1 @@ +{"validImageTypes": ["CONTAINER_VM", "COS"], "validNodeVersions": ["1.6.4", "1.6.2", "1.5.7", "1.5.6", "1.4.9"], "defaultClusterVersion": "1.6.4", "validMasterVersions": ["1.6.4", "1.5.7"], "defaultImageType": "COS"} diff --git a/libcloud/test/container/fixtures/gke/zones_us-central1-a_list.json b/libcloud/test/container/fixtures/gke/zones_us-central1-a_list.json new file mode 100644 index 0000000000..5c6770bea1 --- /dev/null +++ b/libcloud/test/container/fixtures/gke/zones_us-central1-a_list.json @@ -0,0 +1,29 @@ +{"clusters": [{ + "currentMasterVersion": "1.6.4", + "currentNodeCount": 3, + "currentNodeVersion": "1.6.4", + "initialClusterVersion": "1.6.4", + "locations": ["us-central1-a"], + "loggingService": "logging.googleapis.com", + "name": "cluster-1", + "network": "default", + "nodeConfig": {"diskSizeGb": 100, + "imageType": "COS", + "machineType": "n1-standard-1", + "oauthScopes": ["https://www.googleapis.com/auth/compute"], + "serviceAccount": "default"}, + "nodeIpv4CidrSize": 24, + "nodePools": [{"autoscaling": {}, + "config": {"diskSizeGb": 100, + "serviceAccount": "default"}, + "initialNodeCount": 3, + "instanceGroupUrls": ["https://www.googleapis.com/compute/v1/projects/project_name"], + "management": {}, + "name": "default-pool", + "status": "RUNNING", + "version": "1.6.4"}], + "selfLink": "https://container.googleapis.com/v1/projects/", + "servicesIpv4Cidr": "XX.XX.XXX.X/20", + "status": "RUNNING", + "subnetwork": "default", + "zone": "us-central1-a"}]} diff --git a/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces.json b/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces.json new file mode 100644 index 0000000000..38e8bec1ac --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces.json @@ -0,0 +1,44 @@ +{ + "kind": "NamespaceList", + "apiVersion": "v1", + "metadata": { + "selfLink": "/api/v1/namespaces", + "resourceVersion": "443" + }, + "items": [ + { + "metadata": { + "name": "default", + "selfLink": "/api/v1/namespaces/default", + "uid": "43e99cf9-b99d-11e5-8d53-0050568157ec", + "resourceVersion": "6", + "creationTimestamp": "2016-01-13T02:28:00Z" + }, + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "status": { + "phase": "Active" + } + }, + { + "metadata": { + "name": "test", + "selfLink": "/api/v1/namespaces/test", + "uid": "7cb89199-b9a6-11e5-8d53-0050568157ec", + "resourceVersion": "419", + "creationTimestamp": "2016-01-13T03:34:01Z" + }, + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "status": { + "phase": "Active" + } + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces_default.json b/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces_default.json new file mode 100644 index 0000000000..d59d2c1c15 --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces_default.json @@ -0,0 +1,19 @@ +{ + "kind": "Namespace", + "apiVersion": "v1", + "metadata": { + "name": "default", + "selfLink": "/api/v1/namespaces/default", + "uid": "43e99cf9-b99d-11e5-8d53-0050568157ec", + "resourceVersion": "6", + "creationTimestamp": "2016-01-13T02:28:00Z" + }, + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "status": { + "phase": "Active" + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces_default_DELETE.json b/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces_default_DELETE.json new file mode 100644 index 0000000000..8b47e269e7 --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces_default_DELETE.json @@ -0,0 +1,20 @@ +{ + "kind": "Namespace", + "apiVersion": "v1", + "metadata": { + "name": "test", + "selfLink": "/api/v1/namespaces/test", + "uid": "7cb89199-b9a6-11e5-8d53-0050568157ec", + "resourceVersion": "447", + "creationTimestamp": "2016-01-13T03:34:01Z", + "deletionTimestamp": "2016-01-13T03:38:05Z" + }, + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "status": { + "phase": "Terminating" + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces_default_pods_POST.json b/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces_default_pods_POST.json new file mode 100644 index 0000000000..49387d1467 --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces_default_pods_POST.json @@ -0,0 +1,47 @@ +{ + "kind": "Pod", + "apiVersion": "v1", + "metadata": { + "name": "hello-world", + "namespace": "default", + "selfLink": "/api/v1/namespaces/default/pods/hello-world", + "uid": "1fad5411-b9af-11e5-8701-0050568157ec", + "resourceVersion": "32", + "creationTimestamp": "2016-01-13T04:35:50Z" + }, + "spec": { + "volumes": [ + { + "name": "default-token-dpyh0", + "secret": { + "secretName": "default-token-dpyh0" + } + } + ], + "containers": [ + { + "name": "hello-world", + "image": "ubuntu:14.04", + "resources": {}, + "volumeMounts": [ + { + "name": "default-token-dpyh0", + "readOnly": true, + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent" + } + ], + "restartPolicy": "Always", + "terminationGracePeriodSeconds": 30, + "dnsPolicy": "ClusterFirst", + "serviceAccountName": "default", + "serviceAccount": "default", + "securityContext": {} + }, + "status": { + "phase": "Pending" + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces_test.json b/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces_test.json new file mode 100644 index 0000000000..fddefa0a0c --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_api_v1_namespaces_test.json @@ -0,0 +1,19 @@ +{ + "kind": "Namespace", + "apiVersion": "v1", + "metadata": { + "name": "test", + "selfLink": "/api/v1/namespaces/test", + "uid": "7cb89199-b9a6-11e5-8d53-0050568157ec", + "resourceVersion": "419", + "creationTimestamp": "2016-01-13T03:34:01Z" + }, + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "status": { + "phase": "Active" + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/kubernetes/_api_v1_nodes.json b/libcloud/test/container/fixtures/kubernetes/_api_v1_nodes.json new file mode 100644 index 0000000000..2664914b1f --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_api_v1_nodes.json @@ -0,0 +1,81 @@ +{ + "kind": "NodeList", + "apiVersion": "v1", + "metadata": { + "selfLink": "/api/v1/nodes", + "resourceVersion": "24" + }, + "items": [ + { + "metadata": { + "name": "127.0.0.1", + "selfLink": "/api/v1/nodes/127.0.0.1", + "uid": "45949cbb-b99d-11e5-8d53-0050568157ec", + "resourceVersion": "24", + "creationTimestamp": "2016-01-13T02:28:03Z", + "labels": { + "kubernetes.io/hostname": "127.0.0.1" + } + }, + "spec": { + "externalID": "127.0.0.1" + }, + "status": { + "capacity": { + "cpu": "2", + "memory": "4048236Ki", + "pods": "40" + }, + "allocatable": { + "cpu": "2", + "memory": "4048236Ki", + "pods": "40" + }, + "conditions": [ + { + "type": "OutOfDisk", + "status": "False", + "lastHeartbeatTime": "2016-01-13T02:28:53Z", + "lastTransitionTime": "2016-01-13T02:28:03Z", + "reason": "KubeletHasSufficientDisk", + "message": "kubelet has sufficient disk space available" + }, + { + "type": "Ready", + "status": "True", + "lastHeartbeatTime": "2016-01-13T02:28:53Z", + "lastTransitionTime": "2016-01-13T02:28:03Z", + "reason": "KubeletReady", + "message": "kubelet is posting ready status" + } + ], + "addresses": [ + { + "type": "LegacyHostIP", + "address": "127.0.0.1" + }, + { + "type": "InternalIP", + "address": "127.0.0.1" + } + ], + "daemonEndpoints": { + "kubeletEndpoint": { + "Port": 10250 + } + }, + "nodeInfo": { + "machineID": "1d9faaba9168d4b4a3416e99000002a2", + "systemUUID": "42015AA3-9AF2-D089-9105-63CEF89EFE35", + "bootID": "c31fdd67-f995-4be5-942d-10df26b40501", + "kernelVersion": "3.13.0-46-generic", + "osImage": "Ubuntu 14.04.2 LTS", + "containerRuntimeVersion": "docker://1.9.1", + "kubeletVersion": "v1.2.0-alpha.5.848+3f2e99b7e7d6d8", + "kubeProxyVersion": "v1.2.0-alpha.5.848+3f2e99b7e7d6d8" + }, + "images": null + } + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/kubernetes/_api_v1_nodes_127_0_0_1.json b/libcloud/test/container/fixtures/kubernetes/_api_v1_nodes_127_0_0_1.json new file mode 100644 index 0000000000..1077b73fb9 --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_api_v1_nodes_127_0_0_1.json @@ -0,0 +1,73 @@ +{ + "kind": "Node", + "apiVersion": "v1", + "metadata": { + "name": "127.0.0.1", + "selfLink": "/api/v1/nodes/127.0.0.1", + "uid": "45949cbb-b99d-11e5-8d53-0050568157ec", + "resourceVersion": "184", + "creationTimestamp": "2016-01-13T02:28:03Z", + "labels": { + "kubernetes.io/hostname": "127.0.0.1" + } + }, + "spec": { + "externalID": "127.0.0.1" + }, + "status": { + "capacity": { + "cpu": "2", + "memory": "4048236Ki", + "pods": "40" + }, + "allocatable": { + "cpu": "2", + "memory": "4048236Ki", + "pods": "40" + }, + "conditions": [ + { + "type": "OutOfDisk", + "status": "False", + "lastHeartbeatTime": "2016-01-13T02:55:34Z", + "lastTransitionTime": "2016-01-13T02:28:03Z", + "reason": "KubeletHasSufficientDisk", + "message": "kubelet has sufficient disk space available" + }, + { + "type": "Ready", + "status": "True", + "lastHeartbeatTime": "2016-01-13T02:55:34Z", + "lastTransitionTime": "2016-01-13T02:28:03Z", + "reason": "KubeletReady", + "message": "kubelet is posting ready status" + } + ], + "addresses": [ + { + "type": "LegacyHostIP", + "address": "127.0.0.1" + }, + { + "type": "InternalIP", + "address": "127.0.0.1" + } + ], + "daemonEndpoints": { + "kubeletEndpoint": { + "Port": 10250 + } + }, + "nodeInfo": { + "machineID": "1d9faaba9168d4b4a3416e99000002a2", + "systemUUID": "42015AA3-9AF2-D089-9105-63CEF89EFE35", + "bootID": "c31fdd67-f995-4be5-942d-10df26b40501", + "kernelVersion": "3.13.0-46-generic", + "osImage": "Ubuntu 14.04.2 LTS", + "containerRuntimeVersion": "docker://1.9.1", + "kubeletVersion": "v1.2.0-alpha.5.848+3f2e99b7e7d6d8", + "kubeProxyVersion": "v1.2.0-alpha.5.848+3f2e99b7e7d6d8" + }, + "images": null + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/kubernetes/_api_v1_pods.json b/libcloud/test/container/fixtures/kubernetes/_api_v1_pods.json new file mode 100644 index 0000000000..f29ffdc5b7 --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_api_v1_pods.json @@ -0,0 +1,94 @@ +{ + "kind": "PodList", + "apiVersion": "v1", + "metadata": { + "selfLink": "/api/v1/pods", + "resourceVersion": "63" + }, + "items": [ + { + "metadata": { + "name": "hello-world", + "namespace": "default", + "selfLink": "/api/v1/namespaces/default/pods/hello-world", + "uid": "1fad5411-b9af-11e5-8701-0050568157ec", + "resourceVersion": "62", + "creationTimestamp": "2016-01-13T04:35:50Z" + }, + "spec": { + "volumes": [ + { + "name": "default-token-dpyh0", + "secret": { + "secretName": "default-token-dpyh0" + } + } + ], + "containers": [ + { + "name": "hello-world", + "image": "ubuntu:14.04", + "resources": {}, + "volumeMounts": [ + { + "name": "default-token-dpyh0", + "readOnly": true, + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent" + } + ], + "restartPolicy": "Always", + "terminationGracePeriodSeconds": 30, + "dnsPolicy": "ClusterFirst", + "serviceAccountName": "default", + "serviceAccount": "default", + "nodeName": "127.0.0.1", + "securityContext": {} + }, + "status": { + "phase": "Running", + "conditions": [ + { + "type": "Ready", + "status": "False", + "lastProbeTime": null, + "lastTransitionTime": "2016-01-13T04:37:09Z", + "reason": "ContainersNotReady", + "message": "containers with unready status: [hello-world]" + } + ], + "hostIP": "127.0.0.1", + "podIP": "172.17.0.2", + "startTime": "2016-01-13T04:35:50Z", + "containerStatuses": [ + { + "name": "hello-world", + "state": { + "waiting": { + "reason": "CrashLoopBackOff", + "message": "Back-off 20s restarting failed container=hello-world pod=hello-world_default(1fad5411-b9af-11e5-8701-0050568157ec)" + } + }, + "lastState": { + "terminated": { + "exitCode": 0, + "reason": "Completed", + "startedAt": "2016-01-13T04:37:07Z", + "finishedAt": "2016-01-13T04:37:07Z", + "containerID": "docker://3c48b5cda79bce4c8866f02a3b96a024edb8f660d10e7d1755e9ced49ef47b36" + } + }, + "ready": false, + "restartCount": 2, + "image": "ubuntu:14.04", + "imageID": "docker://c4bea91afef3764163fd506f5c1090be1d34a9b63ece81867cb863455937048e", + "containerID": "docker://3c48b5cda79bce4c8866f02a3b96a024edb8f660d10e7d1755e9ced49ef47b36" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/kubernetes/_api_v1_services.json b/libcloud/test/container/fixtures/kubernetes/_api_v1_services.json new file mode 100644 index 0000000000..0b23869f72 --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_api_v1_services.json @@ -0,0 +1,215 @@ +{ + "kind": "ServiceList", + "apiVersion": "v1", + "metadata": { + "resourceVersion": "4012552" + }, + "items": [ + { + "metadata": { + "name": "kubernetes", + "namespace": "default", + "uid": "982864d3-308b-4e6f-bd12-77285f611a32", + "resourceVersion": "200", + "creationTimestamp": "2021-08-03T17:28:59Z", + "labels": { + "component": "apiserver", + "provider": "kubernetes" + }, + "managedFields": [ + { + "manager": "kube-apiserver", + "operation": "Update", + "apiVersion": "v1", + "time": "2021-08-03T17:28:59Z", + "fieldsType": "FieldsV1", + "fieldsV1": {"f:metadata":{"f:labels":{".":{},"f:component":{},"f:provider":{}}},"f:spec":{"f:clusterIP":{},"f:ipFamilyPolicy":{},"f:ports":{".":{},"k:{\"port\":443,\"protocol\":\"TCP\"}":{".":{},"f:name":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:sessionAffinity":{},"f:type":{}}} + } + ] + }, + "spec": { + "ports": [ + { + "name": "https", + "protocol": "TCP", + "port": 443, + "targetPort": 443 + } + ], + "clusterIP": "10.52.0.1", + "clusterIPs": [ + "10.52.0.1" + ], + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": { + + } + } + }, + { + "metadata": { + "name": "default-http-backend", + "namespace": "kube-system", + "uid": "cc581dba-6375-40cb-9470-627f109e83a5", + "resourceVersion": "371", + "creationTimestamp": "2021-08-03T17:29:34Z", + "labels": { + "addonmanager.kubernetes.io/mode": "Reconcile", + "k8s-app": "glbc", + "kubernetes.io/cluster-service": "true", + "kubernetes.io/name": "GLBCDefaultBackend" + }, + "annotations": { + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"k8s-app\":\"glbc\",\"kubernetes.io/cluster-service\":\"true\",\"kubernetes.io/name\":\"GLBCDefaultBackend\"},\"name\":\"default-http-backend\",\"namespace\":\"kube-system\"},\"spec\":{\"ports\":[{\"name\":\"http\",\"port\":80,\"protocol\":\"TCP\",\"targetPort\":8080}],\"selector\":{\"k8s-app\":\"glbc\"},\"type\":\"NodePort\"}}\n" + }, + "managedFields": [ + { + "manager": "kubectl-client-side-apply", + "operation": "Update", + "apiVersion": "v1", + "time": "2021-08-03T17:29:34Z", + "fieldsType": "FieldsV1", + "fieldsV1": {"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}},"f:labels":{".":{},"f:addonmanager.kubernetes.io/mode":{},"f:k8s-app":{},"f:kubernetes.io/cluster-service":{},"f:kubernetes.io/name":{}}},"f:spec":{"f:externalTrafficPolicy":{},"f:ports":{".":{},"k:{\"port\":80,\"protocol\":\"TCP\"}":{".":{},"f:name":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:selector":{".":{},"f:k8s-app":{}},"f:sessionAffinity":{},"f:type":{}}} + } + ] + }, + "spec": { + "ports": [ + { + "name": "http", + "protocol": "TCP", + "port": 80, + "targetPort": 8080, + "nodePort": 31542 + } + ], + "selector": { + "k8s-app": "glbc" + }, + "clusterIP": "10.52.11.183", + "clusterIPs": [ + "10.52.11.183" + ], + "type": "NodePort", + "sessionAffinity": "None", + "externalTrafficPolicy": "Cluster" + }, + "status": { + "loadBalancer": { + + } + } + }, + { + "metadata": { + "name": "kube-dns", + "namespace": "kube-system", + "uid": "91b33767-1026-439c-a391-1a04c46c55b9", + "resourceVersion": "356", + "creationTimestamp": "2021-08-03T17:29:34Z", + "labels": { + "addonmanager.kubernetes.io/mode": "Reconcile", + "k8s-app": "kube-dns", + "kubernetes.io/cluster-service": "true", + "kubernetes.io/name": "KubeDNS" + }, + "annotations": { + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"k8s-app\":\"kube-dns\",\"kubernetes.io/cluster-service\":\"true\",\"kubernetes.io/name\":\"KubeDNS\"},\"name\":\"kube-dns\",\"namespace\":\"kube-system\"},\"spec\":{\"clusterIP\":\"10.52.0.10\",\"ports\":[{\"name\":\"dns\",\"port\":53,\"protocol\":\"UDP\"},{\"name\":\"dns-tcp\",\"port\":53,\"protocol\":\"TCP\"}],\"selector\":{\"k8s-app\":\"kube-dns\"}}}\n" + }, + "managedFields": [ + { + "manager": "kubectl-client-side-apply", + "operation": "Update", + "apiVersion": "v1", + "time": "2021-08-03T17:29:34Z", + "fieldsType": "FieldsV1", + "fieldsV1": {"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}},"f:labels":{".":{},"f:addonmanager.kubernetes.io/mode":{},"f:k8s-app":{},"f:kubernetes.io/cluster-service":{},"f:kubernetes.io/name":{}}},"f:spec":{"f:clusterIP":{},"f:ports":{".":{},"k:{\"port\":53,\"protocol\":\"TCP\"}":{".":{},"f:name":{},"f:port":{},"f:protocol":{},"f:targetPort":{}},"k:{\"port\":53,\"protocol\":\"UDP\"}":{".":{},"f:name":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:selector":{".":{},"f:k8s-app":{}},"f:sessionAffinity":{},"f:type":{}}} + } + ] + }, + "spec": { + "ports": [ + { + "name": "dns", + "protocol": "UDP", + "port": 53, + "targetPort": 53 + }, + { + "name": "dns-tcp", + "protocol": "TCP", + "port": 53, + "targetPort": 53 + } + ], + "selector": { + "k8s-app": "kube-dns" + }, + "clusterIP": "10.52.0.10", + "clusterIPs": [ + "10.52.0.10" + ], + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": { + + } + } + }, + { + "metadata": { + "name": "metrics-server", + "namespace": "kube-system", + "uid": "84c2cd5d-b3ee-4280-9a69-8b59dcbd4e29", + "resourceVersion": "445", + "creationTimestamp": "2021-08-03T17:29:35Z", + "labels": { + "addonmanager.kubernetes.io/mode": "Reconcile", + "kubernetes.io/cluster-service": "true", + "kubernetes.io/name": "Metrics-server" + }, + "annotations": { + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"kubernetes.io/cluster-service\":\"true\",\"kubernetes.io/name\":\"Metrics-server\"},\"name\":\"metrics-server\",\"namespace\":\"kube-system\"},\"spec\":{\"ports\":[{\"port\":443,\"protocol\":\"TCP\",\"targetPort\":\"https\"}],\"selector\":{\"k8s-app\":\"metrics-server\"}}}\n" + }, + "managedFields": [ + { + "manager": "kubectl-client-side-apply", + "operation": "Update", + "apiVersion": "v1", + "time": "2021-08-03T17:29:35Z", + "fieldsType": "FieldsV1", + "fieldsV1": {"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}},"f:labels":{".":{},"f:addonmanager.kubernetes.io/mode":{},"f:kubernetes.io/cluster-service":{},"f:kubernetes.io/name":{}}},"f:spec":{"f:ports":{".":{},"k:{\"port\":443,\"protocol\":\"TCP\"}":{".":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:selector":{".":{},"f:k8s-app":{}},"f:sessionAffinity":{},"f:type":{}}} + } + ] + }, + "spec": { + "ports": [ + { + "protocol": "TCP", + "port": 443, + "targetPort": "https" + } + ], + "selector": { + "k8s-app": "metrics-server" + }, + "clusterIP": "10.52.10.211", + "clusterIPs": [ + "10.52.10.211" + ], + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": { + + } + } + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/kubernetes/_apis_apps_v1_deployments.json b/libcloud/test/container/fixtures/kubernetes/_apis_apps_v1_deployments.json new file mode 100644 index 0000000000..9d47080257 --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_apis_apps_v1_deployments.json @@ -0,0 +1,2884 @@ +{ + "kind": "DeploymentList", + "apiVersion": "apps/v1", + "metadata": { + "resourceVersion": "26016" + }, + "items": [ + { + "metadata": { + "name": "event-exporter-gke", + "namespace": "kube-system", + "uid": "aea45586-9a4a-4a01-805c-719f431316c0", + "resourceVersion": "1257", + "generation": 1, + "creationTimestamp": "2022-03-17T10:40:24Z", + "labels": { + "addonmanager.kubernetes.io/mode": "Reconcile", + "k8s-app": "event-exporter", + "kubernetes.io/cluster-service": "true", + "version": "v0.3.5" + }, + "annotations": { + "deployment.kubernetes.io/revision": "1", + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"k8s-app\":\"event-exporter\",\"kubernetes.io/cluster-service\":\"true\",\"version\":\"v0.3.5\"},\"name\":\"event-exporter-gke\",\"namespace\":\"kube-system\"},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"k8s-app\":\"event-exporter\"}},\"template\":{\"metadata\":{\"annotations\":{\"components.gke.io/component-name\":\"event-exporter\",\"components.gke.io/component-version\":\"1.0.10\"},\"labels\":{\"k8s-app\":\"event-exporter\",\"version\":\"v0.3.5\"}},\"spec\":{\"containers\":[{\"command\":[\"/event-exporter\",\"-sink-opts=-stackdriver-resource-model=new -endpoint=https://logging.googleapis.com\",\"-prometheus-endpoint=:8080\"],\"image\":\"gke.gcr.io/event-exporter:v0.3.5-gke.0\",\"name\":\"event-exporter\",\"securityContext\":{\"allowPrivilegeEscalation\":false,\"capabilities\":{\"drop\":[\"all\"]}}},{\"command\":[\"/monitor\",\"--stackdriver-prefix=container.googleapis.com/internal/addons\",\"--api-override=https://monitoring.googleapis.com/\",\"--source=event_exporter:http://localhost:8080?whitelisted=stackdriver_sink_received_entry_count,stackdriver_sink_request_count,stackdriver_sink_successfully_sent_entry_count\",\"--pod-id=$(POD_NAME)\",\"--namespace-id=$(POD_NAMESPACE)\",\"--node-name=$(NODE_NAME)\"],\"env\":[{\"name\":\"POD_NAME\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.name\"}}},{\"name\":\"POD_NAMESPACE\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"}}},{\"name\":\"NODE_NAME\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"spec.nodeName\"}}}],\"image\":\"gke.gcr.io/prometheus-to-sd:v0.10.0-gke.0\",\"name\":\"prometheus-to-sd-exporter\",\"securityContext\":{\"allowPrivilegeEscalation\":false,\"capabilities\":{\"drop\":[\"all\"]}}}],\"nodeSelector\":{\"kubernetes.io/os\":\"linux\"},\"securityContext\":{\"runAsGroup\":1000,\"runAsUser\":1000},\"serviceAccountName\":\"event-exporter-sa\",\"terminationGracePeriodSeconds\":120,\"tolerations\":[{\"key\":\"components.gke.io/gke-managed-components\",\"operator\":\"Exists\"}],\"volumes\":[{\"hostPath\":{\"path\":\"/etc/ssl/certs\"},\"name\":\"ssl-certs\"}]}}}}\n" + }, + "managedFields": [ + { + "manager": "kubectl-client-side-apply", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:40:24Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:kubectl.kubernetes.io/last-applied-configuration": {} + }, + "f:labels": { + ".": {}, + "f:addonmanager.kubernetes.io/mode": {}, + "f:k8s-app": {}, + "f:kubernetes.io/cluster-service": {}, + "f:version": {} + } + }, + "f:spec": { + "f:progressDeadlineSeconds": {}, + "f:replicas": {}, + "f:revisionHistoryLimit": {}, + "f:selector": {}, + "f:strategy": { + "f:rollingUpdate": { + ".": {}, + "f:maxSurge": {}, + "f:maxUnavailable": {} + }, + "f:type": {} + }, + "f:template": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:components.gke.io/component-name": {}, + "f:components.gke.io/component-version": {} + }, + "f:labels": { + ".": {}, + "f:k8s-app": {}, + "f:version": {} + } + }, + "f:spec": { + "f:containers": { + "k:{\"name\":\"event-exporter\"}": { + ".": {}, + "f:command": {}, + "f:image": {}, + "f:imagePullPolicy": {}, + "f:name": {}, + "f:resources": {}, + "f:securityContext": { + ".": {}, + "f:allowPrivilegeEscalation": {}, + "f:capabilities": { + ".": {}, + "f:drop": {} + } + }, + "f:terminationMessagePath": {}, + "f:terminationMessagePolicy": {} + }, + "k:{\"name\":\"prometheus-to-sd-exporter\"}": { + ".": {}, + "f:command": {}, + "f:env": { + ".": {}, + "k:{\"name\":\"NODE_NAME\"}": { + ".": {}, + "f:name": {}, + "f:valueFrom": { + ".": {}, + "f:fieldRef": { + ".": {}, + "f:apiVersion": {}, + "f:fieldPath": {} + } + } + }, + "k:{\"name\":\"POD_NAME\"}": { + ".": {}, + "f:name": {}, + "f:valueFrom": { + ".": {}, + "f:fieldRef": { + ".": {}, + "f:apiVersion": {}, + "f:fieldPath": {} + } + } + }, + "k:{\"name\":\"POD_NAMESPACE\"}": { + ".": {}, + "f:name": {}, + "f:valueFrom": { + ".": {}, + "f:fieldRef": { + ".": {}, + "f:apiVersion": {}, + "f:fieldPath": {} + } + } + } + }, + "f:image": {}, + "f:imagePullPolicy": {}, + "f:name": {}, + "f:resources": {}, + "f:securityContext": { + ".": {}, + "f:allowPrivilegeEscalation": {}, + "f:capabilities": { + ".": {}, + "f:drop": {} + } + }, + "f:terminationMessagePath": {}, + "f:terminationMessagePolicy": {} + } + }, + "f:dnsPolicy": {}, + "f:nodeSelector": { + ".": {}, + "f:kubernetes.io/os": {} + }, + "f:restartPolicy": {}, + "f:schedulerName": {}, + "f:securityContext": { + ".": {}, + "f:runAsGroup": {}, + "f:runAsUser": {} + }, + "f:serviceAccount": {}, + "f:serviceAccountName": {}, + "f:terminationGracePeriodSeconds": {}, + "f:tolerations": {}, + "f:volumes": { + ".": {}, + "k:{\"name\":\"ssl-certs\"}": { + ".": {}, + "f:hostPath": { + ".": {}, + "f:path": {}, + "f:type": {} + }, + "f:name": {} + } + } + } + } + } + } + }, + { + "manager": "kube-controller-manager", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:41:33Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + "f:deployment.kubernetes.io/revision": {} + } + }, + "f:status": { + "f:availableReplicas": {}, + "f:conditions": { + ".": {}, + "k:{\"type\":\"Available\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + }, + "k:{\"type\":\"Progressing\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + } + }, + "f:observedGeneration": {}, + "f:readyReplicas": {}, + "f:replicas": {}, + "f:updatedReplicas": {} + } + } + } + ] + }, + "spec": { + "replicas": 1, + "selector": { + "matchLabels": { + "k8s-app": "event-exporter" + } + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "k8s-app": "event-exporter", + "version": "v0.3.5" + }, + "annotations": { + "components.gke.io/component-name": "event-exporter", + "components.gke.io/component-version": "1.0.10" + } + }, + "spec": { + "volumes": [ + { + "name": "ssl-certs", + "hostPath": { + "path": "/etc/ssl/certs", + "type": "" + } + } + ], + "containers": [ + { + "name": "event-exporter", + "image": "gke.gcr.io/event-exporter:v0.3.5-gke.0", + "command": [ + "/event-exporter", + "-sink-opts=-stackdriver-resource-model=new -endpoint=https://logging.googleapis.com", + "-prometheus-endpoint=:8080" + ], + "resources": {}, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": { + "drop": [ + "all" + ] + }, + "allowPrivilegeEscalation": false + } + }, + { + "name": "prometheus-to-sd-exporter", + "image": "gke.gcr.io/prometheus-to-sd:v0.10.0-gke.0", + "command": [ + "/monitor", + "--stackdriver-prefix=container.googleapis.com/internal/addons", + "--api-override=https://monitoring.googleapis.com/", + "--source=event_exporter:http://localhost:8080?whitelisted=stackdriver_sink_received_entry_count,stackdriver_sink_request_count,stackdriver_sink_successfully_sent_entry_count", + "--pod-id=$(POD_NAME)", + "--namespace-id=$(POD_NAMESPACE)", + "--node-name=$(NODE_NAME)" + ], + "env": [ + { + "name": "POD_NAME", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.name" + } + } + }, + { + "name": "POD_NAMESPACE", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + } + } + }, + { + "name": "NODE_NAME", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "spec.nodeName" + } + } + } + ], + "resources": {}, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": { + "drop": [ + "all" + ] + }, + "allowPrivilegeEscalation": false + } + } + ], + "restartPolicy": "Always", + "terminationGracePeriodSeconds": 120, + "dnsPolicy": "ClusterFirst", + "nodeSelector": { + "kubernetes.io/os": "linux" + }, + "serviceAccountName": "event-exporter-sa", + "serviceAccount": "event-exporter-sa", + "securityContext": { + "runAsUser": 1000, + "runAsGroup": 1000 + }, + "schedulerName": "default-scheduler", + "tolerations": [ + { + "key": "components.gke.io/gke-managed-components", + "operator": "Exists" + } + ] + } + }, + "strategy": { + "type": "RollingUpdate", + "rollingUpdate": { + "maxUnavailable": "25%", + "maxSurge": "25%" + } + }, + "revisionHistoryLimit": 10, + "progressDeadlineSeconds": 600 + }, + "status": { + "observedGeneration": 1, + "replicas": 1, + "updatedReplicas": 1, + "readyReplicas": 1, + "availableReplicas": 1, + "conditions": [ + { + "type": "Available", + "status": "True", + "lastUpdateTime": "2022-03-17T10:41:33Z", + "lastTransitionTime": "2022-03-17T10:41:33Z", + "reason": "MinimumReplicasAvailable", + "message": "Deployment has minimum availability." + }, + { + "type": "Progressing", + "status": "True", + "lastUpdateTime": "2022-03-17T10:41:33Z", + "lastTransitionTime": "2022-03-17T10:40:24Z", + "reason": "NewReplicaSetAvailable", + "message": "ReplicaSet \"event-exporter-gke-5479fd58c8\" has successfully progressed." + } + ] + } + }, + { + "metadata": { + "name": "konnectivity-agent", + "namespace": "kube-system", + "uid": "0597835f-bc6a-4806-83d5-134c39b54cff", + "resourceVersion": "1196", + "generation": 2, + "creationTimestamp": "2022-03-17T10:40:31Z", + "labels": { + "addonmanager.kubernetes.io/mode": "Reconcile", + "k8s-app": "konnectivity-agent" + }, + "annotations": { + "components.gke.io/layer": "addon", + "deployment.kubernetes.io/revision": "1", + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{\"components.gke.io/layer\":\"addon\"},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"k8s-app\":\"konnectivity-agent\"},\"name\":\"konnectivity-agent\",\"namespace\":\"kube-system\"},\"spec\":{\"selector\":{\"matchLabels\":{\"k8s-app\":\"konnectivity-agent\"}},\"strategy\":{\"type\":\"RollingUpdate\"},\"template\":{\"metadata\":{\"annotations\":{\"cluster-autoscaler.kubernetes.io/safe-to-evict\":\"true\",\"components.gke.io/component-name\":\"konnectivitynetworkproxy-combined\",\"components.gke.io/component-version\":\"1.3.3\"},\"labels\":{\"k8s-app\":\"konnectivity-agent\"}},\"spec\":{\"containers\":[{\"args\":[\"--logtostderr=true\",\"--ca-cert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt\",\"--proxy-server-host=35.246.18.56\",\"--proxy-server-port=8132\",\"--health-server-port=8093\",\"--admin-server-port=8094\",\"--sync-interval=5s\",\"--probe-interval=5s\",\"--service-account-token-path=/var/run/secrets/tokens/konnectivity-agent-token\",\"--v=3\"],\"command\":[\"/proxy-agent\"],\"env\":[{\"name\":\"POD_NAME\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.name\"}}},{\"name\":\"POD_NAMESPACE\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"}}}],\"image\":\"gke.gcr.io/proxy-agent:v0.0.24-gke.0\",\"livenessProbe\":{\"httpGet\":{\"path\":\"/healthz\",\"port\":8093},\"initialDelaySeconds\":15,\"timeoutSeconds\":15},\"name\":\"konnectivity-agent\",\"ports\":[{\"containerPort\":8093,\"name\":\"metrics\",\"protocol\":\"TCP\"}],\"resources\":{\"limits\":{\"memory\":\"125Mi\"},\"requests\":{\"cpu\":\"10m\",\"memory\":\"30Mi\"}},\"securityContext\":{\"allowPrivilegeEscalation\":false,\"capabilities\":{\"drop\":[\"all\"]}},\"volumeMounts\":[{\"mountPath\":\"/var/run/secrets/tokens\",\"name\":\"konnectivity-agent-token\"}]}],\"nodeSelector\":{\"beta.kubernetes.io/os\":\"linux\"},\"priorityClassName\":\"system-cluster-critical\",\"securityContext\":{\"fsGroup\":1000,\"runAsGroup\":1000,\"runAsUser\":1000},\"serviceAccountName\":\"konnectivity-agent\",\"tolerations\":[{\"key\":\"CriticalAddonsOnly\",\"operator\":\"Exists\"},{\"effect\":\"NoSchedule\",\"key\":\"sandbox.gke.io/runtime\",\"operator\":\"Equal\",\"value\":\"gvisor\"},{\"key\":\"components.gke.io/gke-managed-components\",\"operator\":\"Exists\"}],\"topologySpreadConstraints\":[{\"labelSelector\":{\"matchLabels\":{\"k8s-app\":\"konnectivity-agent\"}},\"maxSkew\":1,\"topologyKey\":\"topology.kubernetes.io/zone\",\"whenUnsatisfiable\":\"ScheduleAnyway\"},{\"labelSelector\":{\"matchLabels\":{\"k8s-app\":\"konnectivity-agent\"}},\"maxSkew\":1,\"topologyKey\":\"kubernetes.io/hostname\",\"whenUnsatisfiable\":\"ScheduleAnyway\"}],\"volumes\":[{\"name\":\"konnectivity-agent-token\",\"projected\":{\"sources\":[{\"serviceAccountToken\":{\"audience\":\"system:konnectivity-server\",\"path\":\"konnectivity-agent-token\"}}]}}]}}}}\n" + }, + "managedFields": [ + { + "manager": "kubectl-client-side-apply", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:40:31Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:components.gke.io/layer": {}, + "f:kubectl.kubernetes.io/last-applied-configuration": {} + }, + "f:labels": { + ".": {}, + "f:addonmanager.kubernetes.io/mode": {}, + "f:k8s-app": {} + } + }, + "f:spec": { + "f:progressDeadlineSeconds": {}, + "f:replicas": {}, + "f:revisionHistoryLimit": {}, + "f:selector": {}, + "f:strategy": { + "f:rollingUpdate": { + ".": {}, + "f:maxSurge": {}, + "f:maxUnavailable": {} + }, + "f:type": {} + }, + "f:template": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:cluster-autoscaler.kubernetes.io/safe-to-evict": {}, + "f:components.gke.io/component-name": {}, + "f:components.gke.io/component-version": {} + }, + "f:labels": { + ".": {}, + "f:k8s-app": {} + } + }, + "f:spec": { + "f:containers": { + "k:{\"name\":\"konnectivity-agent\"}": { + ".": {}, + "f:args": {}, + "f:command": {}, + "f:env": { + ".": {}, + "k:{\"name\":\"POD_NAME\"}": { + ".": {}, + "f:name": {}, + "f:valueFrom": { + ".": {}, + "f:fieldRef": { + ".": {}, + "f:apiVersion": {}, + "f:fieldPath": {} + } + } + }, + "k:{\"name\":\"POD_NAMESPACE\"}": { + ".": {}, + "f:name": {}, + "f:valueFrom": { + ".": {}, + "f:fieldRef": { + ".": {}, + "f:apiVersion": {}, + "f:fieldPath": {} + } + } + } + }, + "f:image": {}, + "f:imagePullPolicy": {}, + "f:livenessProbe": { + ".": {}, + "f:failureThreshold": {}, + "f:httpGet": { + ".": {}, + "f:path": {}, + "f:port": {}, + "f:scheme": {} + }, + "f:initialDelaySeconds": {}, + "f:periodSeconds": {}, + "f:successThreshold": {}, + "f:timeoutSeconds": {} + }, + "f:name": {}, + "f:ports": { + ".": {}, + "k:{\"containerPort\":8093,\"protocol\":\"TCP\"}": { + ".": {}, + "f:containerPort": {}, + "f:name": {}, + "f:protocol": {} + } + }, + "f:resources": { + ".": {}, + "f:limits": { + ".": {}, + "f:memory": {} + }, + "f:requests": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + } + }, + "f:securityContext": { + ".": {}, + "f:allowPrivilegeEscalation": {}, + "f:capabilities": { + ".": {}, + "f:drop": {} + } + }, + "f:terminationMessagePath": {}, + "f:terminationMessagePolicy": {}, + "f:volumeMounts": { + ".": {}, + "k:{\"mountPath\":\"/var/run/secrets/tokens\"}": { + ".": {}, + "f:mountPath": {}, + "f:name": {} + } + } + } + }, + "f:dnsPolicy": {}, + "f:nodeSelector": { + ".": {}, + "f:beta.kubernetes.io/os": {} + }, + "f:priorityClassName": {}, + "f:restartPolicy": {}, + "f:schedulerName": {}, + "f:securityContext": { + ".": {}, + "f:fsGroup": {}, + "f:runAsGroup": {}, + "f:runAsUser": {} + }, + "f:serviceAccount": {}, + "f:serviceAccountName": {}, + "f:terminationGracePeriodSeconds": {}, + "f:tolerations": {}, + "f:topologySpreadConstraints": { + ".": {}, + "k:{\"topologyKey\":\"kubernetes.io/hostname\",\"whenUnsatisfiable\":\"ScheduleAnyway\"}": { + ".": {}, + "f:labelSelector": {}, + "f:maxSkew": {}, + "f:topologyKey": {}, + "f:whenUnsatisfiable": {} + }, + "k:{\"topologyKey\":\"topology.kubernetes.io/zone\",\"whenUnsatisfiable\":\"ScheduleAnyway\"}": { + ".": {}, + "f:labelSelector": {}, + "f:maxSkew": {}, + "f:topologyKey": {}, + "f:whenUnsatisfiable": {} + } + }, + "f:volumes": { + ".": {}, + "k:{\"name\":\"konnectivity-agent-token\"}": { + ".": {}, + "f:name": {}, + "f:projected": { + ".": {}, + "f:defaultMode": {}, + "f:sources": {} + } + } + } + } + } + } + } + }, + { + "manager": "kube-controller-manager", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:41:27Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + "f:deployment.kubernetes.io/revision": {} + } + }, + "f:status": { + "f:availableReplicas": {}, + "f:conditions": { + ".": {}, + "k:{\"type\":\"Available\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + }, + "k:{\"type\":\"Progressing\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + } + }, + "f:observedGeneration": {}, + "f:readyReplicas": {}, + "f:replicas": {}, + "f:updatedReplicas": {} + } + } + } + ] + }, + "spec": { + "replicas": 3, + "selector": { + "matchLabels": { + "k8s-app": "konnectivity-agent" + } + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "k8s-app": "konnectivity-agent" + }, + "annotations": { + "cluster-autoscaler.kubernetes.io/safe-to-evict": "true", + "components.gke.io/component-name": "konnectivitynetworkproxy-combined", + "components.gke.io/component-version": "1.3.3" + } + }, + "spec": { + "volumes": [ + { + "name": "konnectivity-agent-token", + "projected": { + "sources": [ + { + "serviceAccountToken": { + "audience": "system:konnectivity-server", + "expirationSeconds": 3600, + "path": "konnectivity-agent-token" + } + } + ], + "defaultMode": 420 + } + } + ], + "containers": [ + { + "name": "konnectivity-agent", + "image": "gke.gcr.io/proxy-agent:v0.0.24-gke.0", + "command": [ + "/proxy-agent" + ], + "args": [ + "--logtostderr=true", + "--ca-cert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt", + "--proxy-server-host=35.246.18.56", + "--proxy-server-port=8132", + "--health-server-port=8093", + "--admin-server-port=8094", + "--sync-interval=5s", + "--probe-interval=5s", + "--service-account-token-path=/var/run/secrets/tokens/konnectivity-agent-token", + "--v=3" + ], + "ports": [ + { + "name": "metrics", + "containerPort": 8093, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "POD_NAME", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.name" + } + } + }, + { + "name": "POD_NAMESPACE", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + } + } + } + ], + "resources": { + "limits": { + "memory": "125Mi" + }, + "requests": { + "cpu": "10m", + "memory": "30Mi" + } + }, + "volumeMounts": [ + { + "name": "konnectivity-agent-token", + "mountPath": "/var/run/secrets/tokens" + } + ], + "livenessProbe": { + "httpGet": { + "path": "/healthz", + "port": 8093, + "scheme": "HTTP" + }, + "initialDelaySeconds": 15, + "timeoutSeconds": 15, + "periodSeconds": 10, + "successThreshold": 1, + "failureThreshold": 3 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": { + "drop": [ + "all" + ] + }, + "allowPrivilegeEscalation": false + } + } + ], + "restartPolicy": "Always", + "terminationGracePeriodSeconds": 30, + "dnsPolicy": "ClusterFirst", + "nodeSelector": { + "beta.kubernetes.io/os": "linux" + }, + "serviceAccountName": "konnectivity-agent", + "serviceAccount": "konnectivity-agent", + "securityContext": { + "runAsUser": 1000, + "runAsGroup": 1000, + "fsGroup": 1000 + }, + "schedulerName": "default-scheduler", + "tolerations": [ + { + "key": "CriticalAddonsOnly", + "operator": "Exists" + }, + { + "key": "sandbox.gke.io/runtime", + "operator": "Equal", + "value": "gvisor", + "effect": "NoSchedule" + }, + { + "key": "components.gke.io/gke-managed-components", + "operator": "Exists" + } + ], + "priorityClassName": "system-cluster-critical", + "topologySpreadConstraints": [ + { + "maxSkew": 1, + "topologyKey": "topology.kubernetes.io/zone", + "whenUnsatisfiable": "ScheduleAnyway", + "labelSelector": { + "matchLabels": { + "k8s-app": "konnectivity-agent" + } + } + }, + { + "maxSkew": 1, + "topologyKey": "kubernetes.io/hostname", + "whenUnsatisfiable": "ScheduleAnyway", + "labelSelector": { + "matchLabels": { + "k8s-app": "konnectivity-agent" + } + } + } + ] + } + }, + "strategy": { + "type": "RollingUpdate", + "rollingUpdate": { + "maxUnavailable": "25%", + "maxSurge": "25%" + } + }, + "revisionHistoryLimit": 10, + "progressDeadlineSeconds": 600 + }, + "status": { + "observedGeneration": 2, + "replicas": 3, + "updatedReplicas": 3, + "readyReplicas": 3, + "availableReplicas": 3, + "conditions": [ + { + "type": "Progressing", + "status": "True", + "lastUpdateTime": "2022-03-17T10:41:11Z", + "lastTransitionTime": "2022-03-17T10:40:31Z", + "reason": "NewReplicaSetAvailable", + "message": "ReplicaSet \"konnectivity-agent-8645bc5688\" has successfully progressed." + }, + { + "type": "Available", + "status": "True", + "lastUpdateTime": "2022-03-17T10:41:27Z", + "lastTransitionTime": "2022-03-17T10:41:27Z", + "reason": "MinimumReplicasAvailable", + "message": "Deployment has minimum availability." + } + ] + } + }, + { + "metadata": { + "name": "konnectivity-agent-autoscaler", + "namespace": "kube-system", + "uid": "19a56785-1c16-4ad1-89b5-b46ae8fdfc87", + "resourceVersion": "1091", + "generation": 1, + "creationTimestamp": "2022-03-17T10:40:24Z", + "labels": { + "addonmanager.kubernetes.io/mode": "Reconcile", + "k8s-app": "konnectivity-agent-autoscaler", + "kubernetes.io/cluster-service": "true" + }, + "annotations": { + "components.gke.io/layer": "addon", + "deployment.kubernetes.io/revision": "1", + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{\"components.gke.io/layer\":\"addon\"},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"k8s-app\":\"konnectivity-agent-autoscaler\",\"kubernetes.io/cluster-service\":\"true\"},\"name\":\"konnectivity-agent-autoscaler\",\"namespace\":\"kube-system\"},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"k8s-app\":\"konnectivity-agent-autoscaler\"}},\"template\":{\"metadata\":{\"annotations\":{\"cluster-autoscaler.kubernetes.io/safe-to-evict\":\"true\",\"components.gke.io/component-name\":\"konnectivitynetworkproxy-combined\",\"components.gke.io/component-version\":\"1.3.3\"},\"labels\":{\"k8s-app\":\"konnectivity-agent-autoscaler\"}},\"spec\":{\"containers\":[{\"command\":[\"/cluster-proportional-autoscaler\",\"--namespace=kube-system\",\"--configmap=konnectivity-agent-autoscaler-config\",\"--target=deployment/konnectivity-agent\",\"--logtostderr=true\",\"--v=2\"],\"image\":\"gke.gcr.io/cluster-proportional-autoscaler:1.8.4-gke.1\",\"name\":\"autoscaler\",\"resources\":{\"requests\":{\"cpu\":\"10m\",\"memory\":\"10M\"}},\"securityContext\":{\"allowPrivilegeEscalation\":false,\"capabilities\":{\"drop\":[\"all\"]}}}],\"nodeSelector\":{\"beta.kubernetes.io/os\":\"linux\"},\"priorityClassName\":\"system-cluster-critical\",\"securityContext\":{\"runAsGroup\":1000,\"runAsUser\":1000},\"serviceAccountName\":\"konnectivity-agent-cpha\",\"tolerations\":[{\"key\":\"CriticalAddonsOnly\",\"operator\":\"Exists\"},{\"key\":\"components.gke.io/gke-managed-components\",\"operator\":\"Exists\"}]}}}}\n" + }, + "managedFields": [ + { + "manager": "kubectl-client-side-apply", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:40:24Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:components.gke.io/layer": {}, + "f:kubectl.kubernetes.io/last-applied-configuration": {} + }, + "f:labels": { + ".": {}, + "f:addonmanager.kubernetes.io/mode": {}, + "f:k8s-app": {}, + "f:kubernetes.io/cluster-service": {} + } + }, + "f:spec": { + "f:progressDeadlineSeconds": {}, + "f:replicas": {}, + "f:revisionHistoryLimit": {}, + "f:selector": {}, + "f:strategy": { + "f:rollingUpdate": { + ".": {}, + "f:maxSurge": {}, + "f:maxUnavailable": {} + }, + "f:type": {} + }, + "f:template": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:cluster-autoscaler.kubernetes.io/safe-to-evict": {}, + "f:components.gke.io/component-name": {}, + "f:components.gke.io/component-version": {} + }, + "f:labels": { + ".": {}, + "f:k8s-app": {} + } + }, + "f:spec": { + "f:containers": { + "k:{\"name\":\"autoscaler\"}": { + ".": {}, + "f:command": {}, + "f:image": {}, + "f:imagePullPolicy": {}, + "f:name": {}, + "f:resources": { + ".": {}, + "f:requests": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + } + }, + "f:securityContext": { + ".": {}, + "f:allowPrivilegeEscalation": {}, + "f:capabilities": { + ".": {}, + "f:drop": {} + } + }, + "f:terminationMessagePath": {}, + "f:terminationMessagePolicy": {} + } + }, + "f:dnsPolicy": {}, + "f:nodeSelector": { + ".": {}, + "f:beta.kubernetes.io/os": {} + }, + "f:priorityClassName": {}, + "f:restartPolicy": {}, + "f:schedulerName": {}, + "f:securityContext": { + ".": {}, + "f:runAsGroup": {}, + "f:runAsUser": {} + }, + "f:serviceAccount": {}, + "f:serviceAccountName": {}, + "f:terminationGracePeriodSeconds": {}, + "f:tolerations": {} + } + } + } + } + }, + { + "manager": "kube-controller-manager", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:41:13Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + "f:deployment.kubernetes.io/revision": {} + } + }, + "f:status": { + "f:availableReplicas": {}, + "f:conditions": { + ".": {}, + "k:{\"type\":\"Available\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + }, + "k:{\"type\":\"Progressing\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + } + }, + "f:observedGeneration": {}, + "f:readyReplicas": {}, + "f:replicas": {}, + "f:updatedReplicas": {} + } + } + } + ] + }, + "spec": { + "replicas": 1, + "selector": { + "matchLabels": { + "k8s-app": "konnectivity-agent-autoscaler" + } + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "k8s-app": "konnectivity-agent-autoscaler" + }, + "annotations": { + "cluster-autoscaler.kubernetes.io/safe-to-evict": "true", + "components.gke.io/component-name": "konnectivitynetworkproxy-combined", + "components.gke.io/component-version": "1.3.3" + } + }, + "spec": { + "containers": [ + { + "name": "autoscaler", + "image": "gke.gcr.io/cluster-proportional-autoscaler:1.8.4-gke.1", + "command": [ + "/cluster-proportional-autoscaler", + "--namespace=kube-system", + "--configmap=konnectivity-agent-autoscaler-config", + "--target=deployment/konnectivity-agent", + "--logtostderr=true", + "--v=2" + ], + "resources": { + "requests": { + "cpu": "10m", + "memory": "10M" + } + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": { + "drop": [ + "all" + ] + }, + "allowPrivilegeEscalation": false + } + } + ], + "restartPolicy": "Always", + "terminationGracePeriodSeconds": 30, + "dnsPolicy": "ClusterFirst", + "nodeSelector": { + "beta.kubernetes.io/os": "linux" + }, + "serviceAccountName": "konnectivity-agent-cpha", + "serviceAccount": "konnectivity-agent-cpha", + "securityContext": { + "runAsUser": 1000, + "runAsGroup": 1000 + }, + "schedulerName": "default-scheduler", + "tolerations": [ + { + "key": "CriticalAddonsOnly", + "operator": "Exists" + }, + { + "key": "components.gke.io/gke-managed-components", + "operator": "Exists" + } + ], + "priorityClassName": "system-cluster-critical" + } + }, + "strategy": { + "type": "RollingUpdate", + "rollingUpdate": { + "maxUnavailable": "25%", + "maxSurge": "25%" + } + }, + "revisionHistoryLimit": 10, + "progressDeadlineSeconds": 600 + }, + "status": { + "observedGeneration": 1, + "replicas": 1, + "updatedReplicas": 1, + "readyReplicas": 1, + "availableReplicas": 1, + "conditions": [ + { + "type": "Available", + "status": "True", + "lastUpdateTime": "2022-03-17T10:41:13Z", + "lastTransitionTime": "2022-03-17T10:41:13Z", + "reason": "MinimumReplicasAvailable", + "message": "Deployment has minimum availability." + }, + { + "type": "Progressing", + "status": "True", + "lastUpdateTime": "2022-03-17T10:41:13Z", + "lastTransitionTime": "2022-03-17T10:40:24Z", + "reason": "NewReplicaSetAvailable", + "message": "ReplicaSet \"konnectivity-agent-autoscaler-ddccb8b95\" has successfully progressed." + } + ] + } + }, + { + "metadata": { + "name": "kube-dns", + "namespace": "kube-system", + "uid": "27b406aa-aa8d-4d3a-802d-6469dc16b2a6", + "resourceVersion": "1334", + "generation": 2, + "creationTimestamp": "2022-03-17T10:40:23Z", + "labels": { + "addonmanager.kubernetes.io/mode": "Reconcile", + "k8s-app": "kube-dns", + "kubernetes.io/cluster-service": "true" + }, + "annotations": { + "deployment.kubernetes.io/revision": "1", + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"k8s-app\":\"kube-dns\",\"kubernetes.io/cluster-service\":\"true\"},\"name\":\"kube-dns\",\"namespace\":\"kube-system\"},\"spec\":{\"selector\":{\"matchLabels\":{\"k8s-app\":\"kube-dns\"}},\"strategy\":{\"rollingUpdate\":{\"maxSurge\":\"10%\",\"maxUnavailable\":0}},\"template\":{\"metadata\":{\"annotations\":{\"components.gke.io/component-name\":\"kubedns\",\"prometheus.io/port\":\"10054\",\"prometheus.io/scrape\":\"true\",\"scheduler.alpha.kubernetes.io/critical-pod\":\"\",\"seccomp.security.alpha.kubernetes.io/pod\":\"runtime/default\"},\"labels\":{\"k8s-app\":\"kube-dns\"}},\"spec\":{\"affinity\":{\"podAntiAffinity\":{\"preferredDuringSchedulingIgnoredDuringExecution\":[{\"podAffinityTerm\":{\"labelSelector\":{\"matchExpressions\":[{\"key\":\"k8s-app\",\"operator\":\"In\",\"values\":[\"kube-dns\"]}]},\"topologyKey\":\"kubernetes.io/hostname\"},\"weight\":100}]}},\"containers\":[{\"args\":[\"--domain=cluster.local.\",\"--dns-port=10053\",\"--config-dir=/kube-dns-config\",\"--v=2\"],\"env\":[{\"name\":\"PROMETHEUS_PORT\",\"value\":\"10055\"}],\"image\":\"gke.gcr.io/k8s-dns-kube-dns:1.21.0-gke.0\",\"livenessProbe\":{\"failureThreshold\":5,\"httpGet\":{\"path\":\"/healthcheck/kubedns\",\"port\":10054,\"scheme\":\"HTTP\"},\"initialDelaySeconds\":60,\"successThreshold\":1,\"timeoutSeconds\":5},\"name\":\"kubedns\",\"ports\":[{\"containerPort\":10053,\"name\":\"dns-local\",\"protocol\":\"UDP\"},{\"containerPort\":10053,\"name\":\"dns-tcp-local\",\"protocol\":\"TCP\"},{\"containerPort\":10055,\"name\":\"metrics\",\"protocol\":\"TCP\"}],\"readinessProbe\":{\"httpGet\":{\"path\":\"/readiness\",\"port\":8081,\"scheme\":\"HTTP\"},\"initialDelaySeconds\":3,\"timeoutSeconds\":5},\"resources\":{\"limits\":{\"memory\":\"210Mi\"},\"requests\":{\"cpu\":\"100m\",\"memory\":\"70Mi\"}},\"securityContext\":{\"allowPrivilegeEscalation\":false,\"readOnlyRootFilesystem\":true,\"runAsGroup\":1001,\"runAsUser\":1001},\"volumeMounts\":[{\"mountPath\":\"/kube-dns-config\",\"name\":\"kube-dns-config\"}]},{\"args\":[\"-v=2\",\"-logtostderr\",\"-configDir=/etc/k8s/dns/dnsmasq-nanny\",\"-restartDnsmasq=true\",\"--\",\"-k\",\"--cache-size=1000\",\"--no-negcache\",\"--dns-forward-max=1500\",\"--log-facility=-\",\"--server=/cluster.local/127.0.0.1#10053\",\"--server=/in-addr.arpa/127.0.0.1#10053\",\"--server=/ip6.arpa/127.0.0.1#10053\"],\"image\":\"gke.gcr.io/k8s-dns-dnsmasq-nanny:1.21.0-gke.0\",\"livenessProbe\":{\"failureThreshold\":5,\"httpGet\":{\"path\":\"/healthcheck/dnsmasq\",\"port\":10054,\"scheme\":\"HTTP\"},\"initialDelaySeconds\":60,\"successThreshold\":1,\"timeoutSeconds\":5},\"name\":\"dnsmasq\",\"ports\":[{\"containerPort\":53,\"name\":\"dns\",\"protocol\":\"UDP\"},{\"containerPort\":53,\"name\":\"dns-tcp\",\"protocol\":\"TCP\"}],\"resources\":{\"requests\":{\"cpu\":\"150m\",\"memory\":\"20Mi\"}},\"securityContext\":{\"capabilities\":{\"add\":[\"NET_BIND_SERVICE\",\"SETGID\"],\"drop\":[\"all\"]}},\"volumeMounts\":[{\"mountPath\":\"/etc/k8s/dns/dnsmasq-nanny\",\"name\":\"kube-dns-config\"}]},{\"args\":[\"--v=2\",\"--logtostderr\",\"--probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.cluster.local,5,SRV\",\"--probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.cluster.local,5,SRV\"],\"image\":\"gke.gcr.io/k8s-dns-sidecar:1.21.0-gke.0\",\"livenessProbe\":{\"failureThreshold\":5,\"httpGet\":{\"path\":\"/metrics\",\"port\":10054,\"scheme\":\"HTTP\"},\"initialDelaySeconds\":60,\"successThreshold\":1,\"timeoutSeconds\":5},\"name\":\"sidecar\",\"ports\":[{\"containerPort\":10054,\"name\":\"metrics\",\"protocol\":\"TCP\"}],\"resources\":{\"requests\":{\"cpu\":\"10m\",\"memory\":\"20Mi\"}},\"securityContext\":{\"allowPrivilegeEscalation\":false,\"readOnlyRootFilesystem\":true,\"runAsGroup\":1001,\"runAsUser\":1001}},{\"command\":[\"/monitor\",\"--source=kubedns:http://localhost:10054?whitelisted=probe_kubedns_latency_ms,probe_kubedns_errors,dnsmasq_misses,dnsmasq_hits\",\"--stackdriver-prefix=container.googleapis.com/internal/addons\",\"--api-override=https://monitoring.googleapis.com/\",\"--pod-id=$(POD_NAME)\",\"--namespace-id=$(POD_NAMESPACE)\",\"--v=2\"],\"env\":[{\"name\":\"POD_NAME\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.name\"}}},{\"name\":\"POD_NAMESPACE\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"}}}],\"image\":\"gke.gcr.io/prometheus-to-sd:v0.4.2\",\"name\":\"prometheus-to-sd\",\"securityContext\":{\"allowPrivilegeEscalation\":false,\"readOnlyRootFilesystem\":true,\"runAsGroup\":1001,\"runAsUser\":1001}}],\"dnsPolicy\":\"Default\",\"nodeSelector\":{\"kubernetes.io/os\":\"linux\"},\"priorityClassName\":\"system-cluster-critical\",\"securityContext\":{\"fsGroup\":65534,\"supplementalGroups\":[65534]},\"serviceAccountName\":\"kube-dns\",\"tolerations\":[{\"key\":\"CriticalAddonsOnly\",\"operator\":\"Exists\"},{\"key\":\"components.gke.io/gke-managed-components\",\"operator\":\"Exists\"}],\"volumes\":[{\"configMap\":{\"name\":\"kube-dns\",\"optional\":true},\"name\":\"kube-dns-config\"}]}}}}\n" + }, + "managedFields": [ + { + "manager": "kubectl-client-side-apply", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:40:23Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:kubectl.kubernetes.io/last-applied-configuration": {} + }, + "f:labels": { + ".": {}, + "f:addonmanager.kubernetes.io/mode": {}, + "f:k8s-app": {}, + "f:kubernetes.io/cluster-service": {} + } + }, + "f:spec": { + "f:progressDeadlineSeconds": {}, + "f:replicas": {}, + "f:revisionHistoryLimit": {}, + "f:selector": {}, + "f:strategy": { + "f:rollingUpdate": { + ".": {}, + "f:maxSurge": {}, + "f:maxUnavailable": {} + }, + "f:type": {} + }, + "f:template": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:components.gke.io/component-name": {}, + "f:prometheus.io/port": {}, + "f:prometheus.io/scrape": {}, + "f:scheduler.alpha.kubernetes.io/critical-pod": {}, + "f:seccomp.security.alpha.kubernetes.io/pod": {} + }, + "f:labels": { + ".": {}, + "f:k8s-app": {} + } + }, + "f:spec": { + "f:affinity": { + ".": {}, + "f:podAntiAffinity": { + ".": {}, + "f:preferredDuringSchedulingIgnoredDuringExecution": {} + } + }, + "f:containers": { + "k:{\"name\":\"dnsmasq\"}": { + ".": {}, + "f:args": {}, + "f:image": {}, + "f:imagePullPolicy": {}, + "f:livenessProbe": { + ".": {}, + "f:failureThreshold": {}, + "f:httpGet": { + ".": {}, + "f:path": {}, + "f:port": {}, + "f:scheme": {} + }, + "f:initialDelaySeconds": {}, + "f:periodSeconds": {}, + "f:successThreshold": {}, + "f:timeoutSeconds": {} + }, + "f:name": {}, + "f:ports": { + ".": {}, + "k:{\"containerPort\":53,\"protocol\":\"TCP\"}": { + ".": {}, + "f:containerPort": {}, + "f:name": {}, + "f:protocol": {} + }, + "k:{\"containerPort\":53,\"protocol\":\"UDP\"}": { + ".": {}, + "f:containerPort": {}, + "f:name": {}, + "f:protocol": {} + } + }, + "f:resources": { + ".": {}, + "f:requests": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + } + }, + "f:securityContext": { + ".": {}, + "f:capabilities": { + ".": {}, + "f:add": {}, + "f:drop": {} + } + }, + "f:terminationMessagePath": {}, + "f:terminationMessagePolicy": {}, + "f:volumeMounts": { + ".": {}, + "k:{\"mountPath\":\"/etc/k8s/dns/dnsmasq-nanny\"}": { + ".": {}, + "f:mountPath": {}, + "f:name": {} + } + } + }, + "k:{\"name\":\"kubedns\"}": { + ".": {}, + "f:args": {}, + "f:env": { + ".": {}, + "k:{\"name\":\"PROMETHEUS_PORT\"}": { + ".": {}, + "f:name": {}, + "f:value": {} + } + }, + "f:image": {}, + "f:imagePullPolicy": {}, + "f:livenessProbe": { + ".": {}, + "f:failureThreshold": {}, + "f:httpGet": { + ".": {}, + "f:path": {}, + "f:port": {}, + "f:scheme": {} + }, + "f:initialDelaySeconds": {}, + "f:periodSeconds": {}, + "f:successThreshold": {}, + "f:timeoutSeconds": {} + }, + "f:name": {}, + "f:ports": { + ".": {}, + "k:{\"containerPort\":10053,\"protocol\":\"TCP\"}": { + ".": {}, + "f:containerPort": {}, + "f:name": {}, + "f:protocol": {} + }, + "k:{\"containerPort\":10053,\"protocol\":\"UDP\"}": { + ".": {}, + "f:containerPort": {}, + "f:name": {}, + "f:protocol": {} + }, + "k:{\"containerPort\":10055,\"protocol\":\"TCP\"}": { + ".": {}, + "f:containerPort": {}, + "f:name": {}, + "f:protocol": {} + } + }, + "f:readinessProbe": { + ".": {}, + "f:failureThreshold": {}, + "f:httpGet": { + ".": {}, + "f:path": {}, + "f:port": {}, + "f:scheme": {} + }, + "f:initialDelaySeconds": {}, + "f:periodSeconds": {}, + "f:successThreshold": {}, + "f:timeoutSeconds": {} + }, + "f:resources": { + ".": {}, + "f:limits": { + ".": {}, + "f:memory": {} + }, + "f:requests": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + } + }, + "f:securityContext": { + ".": {}, + "f:allowPrivilegeEscalation": {}, + "f:readOnlyRootFilesystem": {}, + "f:runAsGroup": {}, + "f:runAsUser": {} + }, + "f:terminationMessagePath": {}, + "f:terminationMessagePolicy": {}, + "f:volumeMounts": { + ".": {}, + "k:{\"mountPath\":\"/kube-dns-config\"}": { + ".": {}, + "f:mountPath": {}, + "f:name": {} + } + } + }, + "k:{\"name\":\"prometheus-to-sd\"}": { + ".": {}, + "f:command": {}, + "f:env": { + ".": {}, + "k:{\"name\":\"POD_NAME\"}": { + ".": {}, + "f:name": {}, + "f:valueFrom": { + ".": {}, + "f:fieldRef": { + ".": {}, + "f:apiVersion": {}, + "f:fieldPath": {} + } + } + }, + "k:{\"name\":\"POD_NAMESPACE\"}": { + ".": {}, + "f:name": {}, + "f:valueFrom": { + ".": {}, + "f:fieldRef": { + ".": {}, + "f:apiVersion": {}, + "f:fieldPath": {} + } + } + } + }, + "f:image": {}, + "f:imagePullPolicy": {}, + "f:name": {}, + "f:resources": {}, + "f:securityContext": { + ".": {}, + "f:allowPrivilegeEscalation": {}, + "f:readOnlyRootFilesystem": {}, + "f:runAsGroup": {}, + "f:runAsUser": {} + }, + "f:terminationMessagePath": {}, + "f:terminationMessagePolicy": {} + }, + "k:{\"name\":\"sidecar\"}": { + ".": {}, + "f:args": {}, + "f:image": {}, + "f:imagePullPolicy": {}, + "f:livenessProbe": { + ".": {}, + "f:failureThreshold": {}, + "f:httpGet": { + ".": {}, + "f:path": {}, + "f:port": {}, + "f:scheme": {} + }, + "f:initialDelaySeconds": {}, + "f:periodSeconds": {}, + "f:successThreshold": {}, + "f:timeoutSeconds": {} + }, + "f:name": {}, + "f:ports": { + ".": {}, + "k:{\"containerPort\":10054,\"protocol\":\"TCP\"}": { + ".": {}, + "f:containerPort": {}, + "f:name": {}, + "f:protocol": {} + } + }, + "f:resources": { + ".": {}, + "f:requests": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + } + }, + "f:securityContext": { + ".": {}, + "f:allowPrivilegeEscalation": {}, + "f:readOnlyRootFilesystem": {}, + "f:runAsGroup": {}, + "f:runAsUser": {} + }, + "f:terminationMessagePath": {}, + "f:terminationMessagePolicy": {} + } + }, + "f:dnsPolicy": {}, + "f:nodeSelector": { + ".": {}, + "f:kubernetes.io/os": {} + }, + "f:priorityClassName": {}, + "f:restartPolicy": {}, + "f:schedulerName": {}, + "f:securityContext": { + ".": {}, + "f:fsGroup": {}, + "f:supplementalGroups": {} + }, + "f:serviceAccount": {}, + "f:serviceAccountName": {}, + "f:terminationGracePeriodSeconds": {}, + "f:tolerations": {}, + "f:volumes": { + ".": {}, + "k:{\"name\":\"kube-dns-config\"}": { + ".": {}, + "f:configMap": { + ".": {}, + "f:defaultMode": {}, + "f:name": {}, + "f:optional": {} + }, + "f:name": {} + } + } + } + } + } + } + }, + { + "manager": "kube-controller-manager", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:41:39Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + "f:deployment.kubernetes.io/revision": {} + } + }, + "f:status": { + "f:availableReplicas": {}, + "f:conditions": { + ".": {}, + "k:{\"type\":\"Available\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + }, + "k:{\"type\":\"Progressing\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + } + }, + "f:observedGeneration": {}, + "f:readyReplicas": {}, + "f:replicas": {}, + "f:updatedReplicas": {} + } + } + } + ] + }, + "spec": { + "replicas": 2, + "selector": { + "matchLabels": { + "k8s-app": "kube-dns" + } + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "k8s-app": "kube-dns" + }, + "annotations": { + "components.gke.io/component-name": "kubedns", + "prometheus.io/port": "10054", + "prometheus.io/scrape": "true", + "scheduler.alpha.kubernetes.io/critical-pod": "", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + } + }, + "spec": { + "volumes": [ + { + "name": "kube-dns-config", + "configMap": { + "name": "kube-dns", + "defaultMode": 420, + "optional": true + } + } + ], + "containers": [ + { + "name": "kubedns", + "image": "gke.gcr.io/k8s-dns-kube-dns:1.21.0-gke.0", + "args": [ + "--domain=cluster.local.", + "--dns-port=10053", + "--config-dir=/kube-dns-config", + "--v=2" + ], + "ports": [ + { + "name": "dns-local", + "containerPort": 10053, + "protocol": "UDP" + }, + { + "name": "dns-tcp-local", + "containerPort": 10053, + "protocol": "TCP" + }, + { + "name": "metrics", + "containerPort": 10055, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "PROMETHEUS_PORT", + "value": "10055" + } + ], + "resources": { + "limits": { + "memory": "210Mi" + }, + "requests": { + "cpu": "100m", + "memory": "70Mi" + } + }, + "volumeMounts": [ + { + "name": "kube-dns-config", + "mountPath": "/kube-dns-config" + } + ], + "livenessProbe": { + "httpGet": { + "path": "/healthcheck/kubedns", + "port": 10054, + "scheme": "HTTP" + }, + "initialDelaySeconds": 60, + "timeoutSeconds": 5, + "periodSeconds": 10, + "successThreshold": 1, + "failureThreshold": 5 + }, + "readinessProbe": { + "httpGet": { + "path": "/readiness", + "port": 8081, + "scheme": "HTTP" + }, + "initialDelaySeconds": 3, + "timeoutSeconds": 5, + "periodSeconds": 10, + "successThreshold": 1, + "failureThreshold": 3 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "runAsUser": 1001, + "runAsGroup": 1001, + "readOnlyRootFilesystem": true, + "allowPrivilegeEscalation": false + } + }, + { + "name": "dnsmasq", + "image": "gke.gcr.io/k8s-dns-dnsmasq-nanny:1.21.0-gke.0", + "args": [ + "-v=2", + "-logtostderr", + "-configDir=/etc/k8s/dns/dnsmasq-nanny", + "-restartDnsmasq=true", + "--", + "-k", + "--cache-size=1000", + "--no-negcache", + "--dns-forward-max=1500", + "--log-facility=-", + "--server=/cluster.local/127.0.0.1#10053", + "--server=/in-addr.arpa/127.0.0.1#10053", + "--server=/ip6.arpa/127.0.0.1#10053" + ], + "ports": [ + { + "name": "dns", + "containerPort": 53, + "protocol": "UDP" + }, + { + "name": "dns-tcp", + "containerPort": 53, + "protocol": "TCP" + } + ], + "resources": { + "requests": { + "cpu": "150m", + "memory": "20Mi" + } + }, + "volumeMounts": [ + { + "name": "kube-dns-config", + "mountPath": "/etc/k8s/dns/dnsmasq-nanny" + } + ], + "livenessProbe": { + "httpGet": { + "path": "/healthcheck/dnsmasq", + "port": 10054, + "scheme": "HTTP" + }, + "initialDelaySeconds": 60, + "timeoutSeconds": 5, + "periodSeconds": 10, + "successThreshold": 1, + "failureThreshold": 5 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": { + "add": [ + "NET_BIND_SERVICE", + "SETGID" + ], + "drop": [ + "all" + ] + } + } + }, + { + "name": "sidecar", + "image": "gke.gcr.io/k8s-dns-sidecar:1.21.0-gke.0", + "args": [ + "--v=2", + "--logtostderr", + "--probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.cluster.local,5,SRV", + "--probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.cluster.local,5,SRV" + ], + "ports": [ + { + "name": "metrics", + "containerPort": 10054, + "protocol": "TCP" + } + ], + "resources": { + "requests": { + "cpu": "10m", + "memory": "20Mi" + } + }, + "livenessProbe": { + "httpGet": { + "path": "/metrics", + "port": 10054, + "scheme": "HTTP" + }, + "initialDelaySeconds": 60, + "timeoutSeconds": 5, + "periodSeconds": 10, + "successThreshold": 1, + "failureThreshold": 5 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "runAsUser": 1001, + "runAsGroup": 1001, + "readOnlyRootFilesystem": true, + "allowPrivilegeEscalation": false + } + }, + { + "name": "prometheus-to-sd", + "image": "gke.gcr.io/prometheus-to-sd:v0.4.2", + "command": [ + "/monitor", + "--source=kubedns:http://localhost:10054?whitelisted=probe_kubedns_latency_ms,probe_kubedns_errors,dnsmasq_misses,dnsmasq_hits", + "--stackdriver-prefix=container.googleapis.com/internal/addons", + "--api-override=https://monitoring.googleapis.com/", + "--pod-id=$(POD_NAME)", + "--namespace-id=$(POD_NAMESPACE)", + "--v=2" + ], + "env": [ + { + "name": "POD_NAME", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.name" + } + } + }, + { + "name": "POD_NAMESPACE", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + } + } + } + ], + "resources": {}, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "runAsUser": 1001, + "runAsGroup": 1001, + "readOnlyRootFilesystem": true, + "allowPrivilegeEscalation": false + } + } + ], + "restartPolicy": "Always", + "terminationGracePeriodSeconds": 30, + "dnsPolicy": "Default", + "nodeSelector": { + "kubernetes.io/os": "linux" + }, + "serviceAccountName": "kube-dns", + "serviceAccount": "kube-dns", + "securityContext": { + "supplementalGroups": [ + 65534 + ], + "fsGroup": 65534 + }, + "affinity": { + "podAntiAffinity": { + "preferredDuringSchedulingIgnoredDuringExecution": [ + { + "weight": 100, + "podAffinityTerm": { + "labelSelector": { + "matchExpressions": [ + { + "key": "k8s-app", + "operator": "In", + "values": [ + "kube-dns" + ] + } + ] + }, + "topologyKey": "kubernetes.io/hostname" + } + } + ] + } + }, + "schedulerName": "default-scheduler", + "tolerations": [ + { + "key": "CriticalAddonsOnly", + "operator": "Exists" + }, + { + "key": "components.gke.io/gke-managed-components", + "operator": "Exists" + } + ], + "priorityClassName": "system-cluster-critical" + } + }, + "strategy": { + "type": "RollingUpdate", + "rollingUpdate": { + "maxUnavailable": 0, + "maxSurge": "10%" + } + }, + "revisionHistoryLimit": 10, + "progressDeadlineSeconds": 600 + }, + "status": { + "observedGeneration": 2, + "replicas": 2, + "updatedReplicas": 2, + "readyReplicas": 2, + "availableReplicas": 2, + "conditions": [ + { + "type": "Available", + "status": "True", + "lastUpdateTime": "2022-03-17T10:41:39Z", + "lastTransitionTime": "2022-03-17T10:41:39Z", + "reason": "MinimumReplicasAvailable", + "message": "Deployment has minimum availability." + }, + { + "type": "Progressing", + "status": "True", + "lastUpdateTime": "2022-03-17T10:41:39Z", + "lastTransitionTime": "2022-03-17T10:40:23Z", + "reason": "NewReplicaSetAvailable", + "message": "ReplicaSet \"kube-dns-697dc8fc8b\" has successfully progressed." + } + ] + } + }, + { + "metadata": { + "name": "kube-dns-autoscaler", + "namespace": "kube-system", + "uid": "5aa906ed-b66d-497b-a9df-36047ac08e05", + "resourceVersion": "884", + "generation": 1, + "creationTimestamp": "2022-03-17T10:40:23Z", + "labels": { + "addonmanager.kubernetes.io/mode": "Reconcile", + "k8s-app": "kube-dns-autoscaler", + "kubernetes.io/cluster-service": "true" + }, + "annotations": { + "deployment.kubernetes.io/revision": "1", + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"k8s-app\":\"kube-dns-autoscaler\",\"kubernetes.io/cluster-service\":\"true\"},\"name\":\"kube-dns-autoscaler\",\"namespace\":\"kube-system\"},\"spec\":{\"selector\":{\"matchLabels\":{\"k8s-app\":\"kube-dns-autoscaler\"}},\"template\":{\"metadata\":{\"labels\":{\"k8s-app\":\"kube-dns-autoscaler\"}},\"spec\":{\"containers\":[{\"command\":[\"/cluster-proportional-autoscaler\",\"--namespace=kube-system\",\"--configmap=kube-dns-autoscaler\",\"--target=Deployment/kube-dns\",\"--default-params={\\\"linear\\\":{\\\"coresPerReplica\\\":256,\\\"nodesPerReplica\\\":16,\\\"preventSinglePointFailure\\\":true,\\\"includeUnschedulableNodes\\\":true}}\",\"--logtostderr=true\",\"--v=2\"],\"image\":\"gke.gcr.io/cluster-proportional-autoscaler-amd64:1.8.1-gke.0\",\"name\":\"autoscaler\",\"resources\":{\"requests\":{\"cpu\":\"20m\",\"memory\":\"10Mi\"}}}],\"nodeSelector\":{\"kubernetes.io/os\":\"linux\"},\"priorityClassName\":\"system-cluster-critical\",\"securityContext\":{\"fsGroup\":65534,\"seccompProfile\":{\"type\":\"RuntimeDefault\"},\"supplementalGroups\":[65534]},\"serviceAccountName\":\"kube-dns-autoscaler\",\"tolerations\":[{\"key\":\"CriticalAddonsOnly\",\"operator\":\"Exists\"},{\"key\":\"components.gke.io/gke-managed-components\",\"operator\":\"Exists\"}]}}}}\n" + }, + "managedFields": [ + { + "manager": "kubectl-client-side-apply", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:40:23Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:kubectl.kubernetes.io/last-applied-configuration": {} + }, + "f:labels": { + ".": {}, + "f:addonmanager.kubernetes.io/mode": {}, + "f:k8s-app": {}, + "f:kubernetes.io/cluster-service": {} + } + }, + "f:spec": { + "f:progressDeadlineSeconds": {}, + "f:replicas": {}, + "f:revisionHistoryLimit": {}, + "f:selector": {}, + "f:strategy": { + "f:rollingUpdate": { + ".": {}, + "f:maxSurge": {}, + "f:maxUnavailable": {} + }, + "f:type": {} + }, + "f:template": { + "f:metadata": { + "f:labels": { + ".": {}, + "f:k8s-app": {} + } + }, + "f:spec": { + "f:containers": { + "k:{\"name\":\"autoscaler\"}": { + ".": {}, + "f:command": {}, + "f:image": {}, + "f:imagePullPolicy": {}, + "f:name": {}, + "f:resources": { + ".": {}, + "f:requests": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + } + }, + "f:terminationMessagePath": {}, + "f:terminationMessagePolicy": {} + } + }, + "f:dnsPolicy": {}, + "f:nodeSelector": { + ".": {}, + "f:kubernetes.io/os": {} + }, + "f:priorityClassName": {}, + "f:restartPolicy": {}, + "f:schedulerName": {}, + "f:securityContext": { + ".": {}, + "f:fsGroup": {}, + "f:seccompProfile": { + ".": {}, + "f:type": {} + }, + "f:supplementalGroups": {} + }, + "f:serviceAccount": {}, + "f:serviceAccountName": {}, + "f:terminationGracePeriodSeconds": {}, + "f:tolerations": {} + } + } + } + } + }, + { + "manager": "kube-controller-manager", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:40:50Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + "f:deployment.kubernetes.io/revision": {} + } + }, + "f:status": { + "f:availableReplicas": {}, + "f:conditions": { + ".": {}, + "k:{\"type\":\"Available\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + }, + "k:{\"type\":\"Progressing\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + } + }, + "f:observedGeneration": {}, + "f:readyReplicas": {}, + "f:replicas": {}, + "f:updatedReplicas": {} + } + } + } + ] + }, + "spec": { + "replicas": 1, + "selector": { + "matchLabels": { + "k8s-app": "kube-dns-autoscaler" + } + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "k8s-app": "kube-dns-autoscaler" + } + }, + "spec": { + "containers": [ + { + "name": "autoscaler", + "image": "gke.gcr.io/cluster-proportional-autoscaler-amd64:1.8.1-gke.0", + "command": [ + "/cluster-proportional-autoscaler", + "--namespace=kube-system", + "--configmap=kube-dns-autoscaler", + "--target=Deployment/kube-dns", + "--default-params={\"linear\":{\"coresPerReplica\":256,\"nodesPerReplica\":16,\"preventSinglePointFailure\":true,\"includeUnschedulableNodes\":true}}", + "--logtostderr=true", + "--v=2" + ], + "resources": { + "requests": { + "cpu": "20m", + "memory": "10Mi" + } + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "IfNotPresent" + } + ], + "restartPolicy": "Always", + "terminationGracePeriodSeconds": 30, + "dnsPolicy": "ClusterFirst", + "nodeSelector": { + "kubernetes.io/os": "linux" + }, + "serviceAccountName": "kube-dns-autoscaler", + "serviceAccount": "kube-dns-autoscaler", + "securityContext": { + "supplementalGroups": [ + 65534 + ], + "fsGroup": 65534, + "seccompProfile": { + "type": "RuntimeDefault" + } + }, + "schedulerName": "default-scheduler", + "tolerations": [ + { + "key": "CriticalAddonsOnly", + "operator": "Exists" + }, + { + "key": "components.gke.io/gke-managed-components", + "operator": "Exists" + } + ], + "priorityClassName": "system-cluster-critical" + } + }, + "strategy": { + "type": "RollingUpdate", + "rollingUpdate": { + "maxUnavailable": "25%", + "maxSurge": "25%" + } + }, + "revisionHistoryLimit": 10, + "progressDeadlineSeconds": 600 + }, + "status": { + "observedGeneration": 1, + "replicas": 1, + "updatedReplicas": 1, + "readyReplicas": 1, + "availableReplicas": 1, + "conditions": [ + { + "type": "Available", + "status": "True", + "lastUpdateTime": "2022-03-17T10:40:50Z", + "lastTransitionTime": "2022-03-17T10:40:50Z", + "reason": "MinimumReplicasAvailable", + "message": "Deployment has minimum availability." + }, + { + "type": "Progressing", + "status": "True", + "lastUpdateTime": "2022-03-17T10:40:50Z", + "lastTransitionTime": "2022-03-17T10:40:23Z", + "reason": "NewReplicaSetAvailable", + "message": "ReplicaSet \"kube-dns-autoscaler-844c9d9448\" has successfully progressed." + } + ] + } + }, + { + "metadata": { + "name": "l7-default-backend", + "namespace": "kube-system", + "uid": "07e2e517-23d3-4685-a222-f22272cca0ac", + "resourceVersion": "1052", + "generation": 1, + "creationTimestamp": "2022-03-17T10:40:24Z", + "labels": { + "addonmanager.kubernetes.io/mode": "Reconcile", + "k8s-app": "glbc", + "kubernetes.io/cluster-service": "true", + "kubernetes.io/name": "GLBC" + }, + "annotations": { + "components.gke.io/layer": "addon", + "deployment.kubernetes.io/revision": "1", + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{\"components.gke.io/layer\":\"addon\",\"seccomp.security.alpha.kubernetes.io/pod\":\"runtime/default\"},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"k8s-app\":\"glbc\",\"kubernetes.io/cluster-service\":\"true\",\"kubernetes.io/name\":\"GLBC\"},\"name\":\"l7-default-backend\",\"namespace\":\"kube-system\"},\"spec\":{\"selector\":{\"matchLabels\":{\"k8s-app\":\"glbc\"}},\"template\":{\"metadata\":{\"annotations\":{\"components.gke.io/component-name\":\"l7-lb-controller-combined\",\"components.gke.io/component-version\":\"1.14.7-gke.0\",\"seccomp.security.alpha.kubernetes.io/pod\":\"runtime/default\"},\"labels\":{\"k8s-app\":\"glbc\",\"name\":\"glbc\"}},\"spec\":{\"containers\":[{\"image\":\"gke.gcr.io/ingress-gce-404-server-with-metrics:v1.13.4\",\"livenessProbe\":{\"httpGet\":{\"path\":\"/healthz\",\"port\":8080,\"scheme\":\"HTTP\"},\"initialDelaySeconds\":30,\"timeoutSeconds\":5},\"name\":\"default-http-backend\",\"ports\":[{\"containerPort\":8080}],\"resources\":{\"requests\":{\"cpu\":\"10m\",\"memory\":\"20Mi\"}},\"securityContext\":{\"allowPrivilegeEscalation\":false,\"capabilities\":{\"drop\":[\"all\"]},\"runAsGroup\":1000,\"runAsUser\":1000}}],\"tolerations\":[{\"key\":\"components.gke.io/gke-managed-components\",\"operator\":\"Exists\"}]}}}}\n", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + }, + "managedFields": [ + { + "manager": "kubectl-client-side-apply", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:40:24Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:components.gke.io/layer": {}, + "f:kubectl.kubernetes.io/last-applied-configuration": {}, + "f:seccomp.security.alpha.kubernetes.io/pod": {} + }, + "f:labels": { + ".": {}, + "f:addonmanager.kubernetes.io/mode": {}, + "f:k8s-app": {}, + "f:kubernetes.io/cluster-service": {}, + "f:kubernetes.io/name": {} + } + }, + "f:spec": { + "f:progressDeadlineSeconds": {}, + "f:replicas": {}, + "f:revisionHistoryLimit": {}, + "f:selector": {}, + "f:strategy": { + "f:rollingUpdate": { + ".": {}, + "f:maxSurge": {}, + "f:maxUnavailable": {} + }, + "f:type": {} + }, + "f:template": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:components.gke.io/component-name": {}, + "f:components.gke.io/component-version": {}, + "f:seccomp.security.alpha.kubernetes.io/pod": {} + }, + "f:labels": { + ".": {}, + "f:k8s-app": {}, + "f:name": {} + } + }, + "f:spec": { + "f:containers": { + "k:{\"name\":\"default-http-backend\"}": { + ".": {}, + "f:image": {}, + "f:imagePullPolicy": {}, + "f:livenessProbe": { + ".": {}, + "f:failureThreshold": {}, + "f:httpGet": { + ".": {}, + "f:path": {}, + "f:port": {}, + "f:scheme": {} + }, + "f:initialDelaySeconds": {}, + "f:periodSeconds": {}, + "f:successThreshold": {}, + "f:timeoutSeconds": {} + }, + "f:name": {}, + "f:ports": { + ".": {}, + "k:{\"containerPort\":8080,\"protocol\":\"TCP\"}": { + ".": {}, + "f:containerPort": {}, + "f:protocol": {} + } + }, + "f:resources": { + ".": {}, + "f:requests": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + } + }, + "f:securityContext": { + ".": {}, + "f:allowPrivilegeEscalation": {}, + "f:capabilities": { + ".": {}, + "f:drop": {} + }, + "f:runAsGroup": {}, + "f:runAsUser": {} + }, + "f:terminationMessagePath": {}, + "f:terminationMessagePolicy": {} + } + }, + "f:dnsPolicy": {}, + "f:restartPolicy": {}, + "f:schedulerName": {}, + "f:securityContext": {}, + "f:terminationGracePeriodSeconds": {}, + "f:tolerations": {} + } + } + } + } + }, + { + "manager": "kube-controller-manager", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:41:10Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + "f:deployment.kubernetes.io/revision": {} + } + }, + "f:status": { + "f:availableReplicas": {}, + "f:conditions": { + ".": {}, + "k:{\"type\":\"Available\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + }, + "k:{\"type\":\"Progressing\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + } + }, + "f:observedGeneration": {}, + "f:readyReplicas": {}, + "f:replicas": {}, + "f:updatedReplicas": {} + } + } + } + ] + }, + "spec": { + "replicas": 1, + "selector": { + "matchLabels": { + "k8s-app": "glbc" + } + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "k8s-app": "glbc", + "name": "glbc" + }, + "annotations": { + "components.gke.io/component-name": "l7-lb-controller-combined", + "components.gke.io/component-version": "1.14.7-gke.0", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + } + }, + "spec": { + "containers": [ + { + "name": "default-http-backend", + "image": "gke.gcr.io/ingress-gce-404-server-with-metrics:v1.13.4", + "ports": [ + { + "containerPort": 8080, + "protocol": "TCP" + } + ], + "resources": { + "requests": { + "cpu": "10m", + "memory": "20Mi" + } + }, + "livenessProbe": { + "httpGet": { + "path": "/healthz", + "port": 8080, + "scheme": "HTTP" + }, + "initialDelaySeconds": 30, + "timeoutSeconds": 5, + "periodSeconds": 10, + "successThreshold": 1, + "failureThreshold": 3 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": { + "drop": [ + "all" + ] + }, + "runAsUser": 1000, + "runAsGroup": 1000, + "allowPrivilegeEscalation": false + } + } + ], + "restartPolicy": "Always", + "terminationGracePeriodSeconds": 30, + "dnsPolicy": "ClusterFirst", + "securityContext": {}, + "schedulerName": "default-scheduler", + "tolerations": [ + { + "key": "components.gke.io/gke-managed-components", + "operator": "Exists" + } + ] + } + }, + "strategy": { + "type": "RollingUpdate", + "rollingUpdate": { + "maxUnavailable": "25%", + "maxSurge": "25%" + } + }, + "revisionHistoryLimit": 10, + "progressDeadlineSeconds": 600 + }, + "status": { + "observedGeneration": 1, + "replicas": 1, + "updatedReplicas": 1, + "readyReplicas": 1, + "availableReplicas": 1, + "conditions": [ + { + "type": "Available", + "status": "True", + "lastUpdateTime": "2022-03-17T10:41:10Z", + "lastTransitionTime": "2022-03-17T10:41:10Z", + "reason": "MinimumReplicasAvailable", + "message": "Deployment has minimum availability." + }, + { + "type": "Progressing", + "status": "True", + "lastUpdateTime": "2022-03-17T10:41:10Z", + "lastTransitionTime": "2022-03-17T10:40:24Z", + "reason": "NewReplicaSetAvailable", + "message": "ReplicaSet \"l7-default-backend-69fb9fd9f9\" has successfully progressed." + } + ] + } + }, + { + "metadata": { + "name": "metrics-server-v0.4.5", + "namespace": "kube-system", + "uid": "dfb2c758-87ad-4254-8b8d-f3a487078a41", + "resourceVersion": "1368", + "generation": 2, + "creationTimestamp": "2022-03-17T10:40:38Z", + "labels": { + "addonmanager.kubernetes.io/mode": "Reconcile", + "k8s-app": "metrics-server", + "version": "v0.4.5" + }, + "annotations": { + "deployment.kubernetes.io/revision": "2", + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"k8s-app\":\"metrics-server\",\"version\":\"v0.4.5\"},\"name\":\"metrics-server-v0.4.5\",\"namespace\":\"kube-system\"},\"spec\":{\"selector\":{\"matchLabels\":{\"k8s-app\":\"metrics-server\",\"version\":\"v0.4.5\"}},\"template\":{\"metadata\":{\"labels\":{\"k8s-app\":\"metrics-server\",\"version\":\"v0.4.5\"},\"name\":\"metrics-server\"},\"spec\":{\"containers\":[{\"command\":[\"/metrics-server\",\"--metric-resolution=30s\",\"--kubelet-port=10255\",\"--deprecated-kubelet-completely-insecure=true\",\"--kubelet-preferred-address-types=InternalIP,Hostname,InternalDNS,ExternalDNS,ExternalIP\",\"--cert-dir=/tmp\",\"--secure-port=10250\"],\"image\":\"gcr.io/gke-release/metrics-server-amd64:v0.4.5-gke.0\",\"name\":\"metrics-server\",\"ports\":[{\"containerPort\":10250,\"name\":\"https\",\"protocol\":\"TCP\"}],\"volumeMounts\":[{\"mountPath\":\"/tmp\",\"name\":\"tmp-dir\"}]},{\"command\":[\"/pod_nanny\",\"--config-dir=/etc/config\",\"--cpu=40m\",\"--extra-cpu=0.5m\",\"--memory=35Mi\",\"--extra-memory=4Mi\",\"--threshold=5\",\"--deployment=metrics-server-v0.4.5\",\"--container=metrics-server\",\"--poll-period=30000\",\"--estimator=exponential\",\"--scale-down-delay=24h\",\"--minClusterSize=5\",\"--use-metrics=true\"],\"env\":[{\"name\":\"MY_POD_NAME\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.name\"}}},{\"name\":\"MY_POD_NAMESPACE\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"}}}],\"image\":\"gke.gcr.io/addon-resizer:1.8.13-gke.0\",\"name\":\"metrics-server-nanny\",\"resources\":{\"limits\":{\"cpu\":\"100m\",\"memory\":\"300Mi\"},\"requests\":{\"cpu\":\"5m\",\"memory\":\"50Mi\"}},\"volumeMounts\":[{\"mountPath\":\"/etc/config\",\"name\":\"metrics-server-config-volume\"}]}],\"nodeSelector\":{\"kubernetes.io/os\":\"linux\"},\"priorityClassName\":\"system-cluster-critical\",\"securityContext\":{\"seccompProfile\":{\"type\":\"RuntimeDefault\"}},\"serviceAccountName\":\"metrics-server\",\"tolerations\":[{\"key\":\"CriticalAddonsOnly\",\"operator\":\"Exists\"},{\"key\":\"components.gke.io/gke-managed-components\",\"operator\":\"Exists\"}],\"volumes\":[{\"configMap\":{\"name\":\"metrics-server-config\"},\"name\":\"metrics-server-config-volume\"},{\"emptyDir\":{},\"name\":\"tmp-dir\"}]}}}}\n" + }, + "managedFields": [ + { + "manager": "kubectl-client-side-apply", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:40:38Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:kubectl.kubernetes.io/last-applied-configuration": {} + }, + "f:labels": { + ".": {}, + "f:addonmanager.kubernetes.io/mode": {}, + "f:k8s-app": {}, + "f:version": {} + } + }, + "f:spec": { + "f:progressDeadlineSeconds": {}, + "f:replicas": {}, + "f:revisionHistoryLimit": {}, + "f:selector": {}, + "f:strategy": { + "f:rollingUpdate": { + ".": {}, + "f:maxSurge": {}, + "f:maxUnavailable": {} + }, + "f:type": {} + }, + "f:template": { + "f:metadata": { + "f:labels": { + ".": {}, + "f:k8s-app": {}, + "f:version": {} + }, + "f:name": {} + }, + "f:spec": { + "f:containers": { + "k:{\"name\":\"metrics-server\"}": { + ".": {}, + "f:command": {}, + "f:image": {}, + "f:imagePullPolicy": {}, + "f:name": {}, + "f:ports": { + ".": {}, + "k:{\"containerPort\":10250,\"protocol\":\"TCP\"}": { + ".": {}, + "f:containerPort": {}, + "f:name": {}, + "f:protocol": {} + } + }, + "f:resources": {}, + "f:terminationMessagePath": {}, + "f:terminationMessagePolicy": {}, + "f:volumeMounts": { + ".": {}, + "k:{\"mountPath\":\"/tmp\"}": { + ".": {}, + "f:mountPath": {}, + "f:name": {} + } + } + }, + "k:{\"name\":\"metrics-server-nanny\"}": { + ".": {}, + "f:command": {}, + "f:env": { + ".": {}, + "k:{\"name\":\"MY_POD_NAME\"}": { + ".": {}, + "f:name": {}, + "f:valueFrom": { + ".": {}, + "f:fieldRef": { + ".": {}, + "f:apiVersion": {}, + "f:fieldPath": {} + } + } + }, + "k:{\"name\":\"MY_POD_NAMESPACE\"}": { + ".": {}, + "f:name": {}, + "f:valueFrom": { + ".": {}, + "f:fieldRef": { + ".": {}, + "f:apiVersion": {}, + "f:fieldPath": {} + } + } + } + }, + "f:image": {}, + "f:imagePullPolicy": {}, + "f:name": {}, + "f:resources": { + ".": {}, + "f:limits": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + }, + "f:requests": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + } + }, + "f:terminationMessagePath": {}, + "f:terminationMessagePolicy": {}, + "f:volumeMounts": { + ".": {}, + "k:{\"mountPath\":\"/etc/config\"}": { + ".": {}, + "f:mountPath": {}, + "f:name": {} + } + } + } + }, + "f:dnsPolicy": {}, + "f:nodeSelector": { + ".": {}, + "f:kubernetes.io/os": {} + }, + "f:priorityClassName": {}, + "f:restartPolicy": {}, + "f:schedulerName": {}, + "f:securityContext": { + ".": {}, + "f:seccompProfile": { + ".": {}, + "f:type": {} + } + }, + "f:serviceAccount": {}, + "f:serviceAccountName": {}, + "f:terminationGracePeriodSeconds": {}, + "f:tolerations": {}, + "f:volumes": { + ".": {}, + "k:{\"name\":\"metrics-server-config-volume\"}": { + ".": {}, + "f:configMap": { + ".": {}, + "f:defaultMode": {}, + "f:name": {} + }, + "f:name": {} + }, + "k:{\"name\":\"tmp-dir\"}": { + ".": {}, + "f:emptyDir": {}, + "f:name": {} + } + } + } + } + } + } + }, + { + "manager": "pod_nanny", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:41:03Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:spec": { + "f:template": { + "f:spec": { + "f:containers": { + "k:{\"name\":\"metrics-server\"}": { + "f:resources": { + "f:limits": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + }, + "f:requests": { + ".": {}, + "f:cpu": {}, + "f:memory": {} + } + } + } + } + } + } + } + } + }, + { + "manager": "kube-controller-manager", + "operation": "Update", + "apiVersion": "apps/v1", + "time": "2022-03-17T10:41:41Z", + "fieldsType": "FieldsV1", + "fieldsV1": { + "f:metadata": { + "f:annotations": { + "f:deployment.kubernetes.io/revision": {} + } + }, + "f:status": { + "f:availableReplicas": {}, + "f:conditions": { + ".": {}, + "k:{\"type\":\"Available\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + }, + "k:{\"type\":\"Progressing\"}": { + ".": {}, + "f:lastTransitionTime": {}, + "f:lastUpdateTime": {}, + "f:message": {}, + "f:reason": {}, + "f:status": {}, + "f:type": {} + } + }, + "f:observedGeneration": {}, + "f:readyReplicas": {}, + "f:replicas": {}, + "f:updatedReplicas": {} + } + } + } + ] + }, + "spec": { + "replicas": 1, + "selector": { + "matchLabels": { + "k8s-app": "metrics-server", + "version": "v0.4.5" + } + }, + "template": { + "metadata": { + "name": "metrics-server", + "creationTimestamp": null, + "labels": { + "k8s-app": "metrics-server", + "version": "v0.4.5" + } + }, + "spec": { + "volumes": [ + { + "name": "metrics-server-config-volume", + "configMap": { + "name": "metrics-server-config", + "defaultMode": 420 + } + }, + { + "name": "tmp-dir", + "emptyDir": {} + } + ], + "containers": [ + { + "name": "metrics-server", + "image": "gcr.io/gke-release/metrics-server-amd64:v0.4.5-gke.0", + "command": [ + "/metrics-server", + "--metric-resolution=30s", + "--kubelet-port=10255", + "--deprecated-kubelet-completely-insecure=true", + "--kubelet-preferred-address-types=InternalIP,Hostname,InternalDNS,ExternalDNS,ExternalIP", + "--cert-dir=/tmp", + "--secure-port=10250" + ], + "ports": [ + { + "name": "https", + "containerPort": 10250, + "protocol": "TCP" + } + ], + "resources": { + "limits": { + "cpu": "43m", + "memory": "55Mi" + }, + "requests": { + "cpu": "43m", + "memory": "55Mi" + } + }, + "volumeMounts": [ + { + "name": "tmp-dir", + "mountPath": "/tmp" + } + ], + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "IfNotPresent" + }, + { + "name": "metrics-server-nanny", + "image": "gke.gcr.io/addon-resizer:1.8.13-gke.0", + "command": [ + "/pod_nanny", + "--config-dir=/etc/config", + "--cpu=40m", + "--extra-cpu=0.5m", + "--memory=35Mi", + "--extra-memory=4Mi", + "--threshold=5", + "--deployment=metrics-server-v0.4.5", + "--container=metrics-server", + "--poll-period=30000", + "--estimator=exponential", + "--scale-down-delay=24h", + "--minClusterSize=5", + "--use-metrics=true" + ], + "env": [ + { + "name": "MY_POD_NAME", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.name" + } + } + }, + { + "name": "MY_POD_NAMESPACE", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + } + } + } + ], + "resources": { + "limits": { + "cpu": "100m", + "memory": "300Mi" + }, + "requests": { + "cpu": "5m", + "memory": "50Mi" + } + }, + "volumeMounts": [ + { + "name": "metrics-server-config-volume", + "mountPath": "/etc/config" + } + ], + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "IfNotPresent" + } + ], + "restartPolicy": "Always", + "terminationGracePeriodSeconds": 30, + "dnsPolicy": "ClusterFirst", + "nodeSelector": { + "kubernetes.io/os": "linux" + }, + "serviceAccountName": "metrics-server", + "serviceAccount": "metrics-server", + "securityContext": { + "seccompProfile": { + "type": "RuntimeDefault" + } + }, + "schedulerName": "default-scheduler", + "tolerations": [ + { + "key": "CriticalAddonsOnly", + "operator": "Exists" + }, + { + "key": "components.gke.io/gke-managed-components", + "operator": "Exists" + } + ], + "priorityClassName": "system-cluster-critical" + } + }, + "strategy": { + "type": "RollingUpdate", + "rollingUpdate": { + "maxUnavailable": "25%", + "maxSurge": "25%" + } + }, + "revisionHistoryLimit": 10, + "progressDeadlineSeconds": 600 + }, + "status": { + "observedGeneration": 2, + "replicas": 1, + "updatedReplicas": 1, + "readyReplicas": 1, + "availableReplicas": 1, + "conditions": [ + { + "type": "Available", + "status": "True", + "lastUpdateTime": "2022-03-17T10:41:03Z", + "lastTransitionTime": "2022-03-17T10:41:03Z", + "reason": "MinimumReplicasAvailable", + "message": "Deployment has minimum availability." + }, + { + "type": "Progressing", + "status": "True", + "lastUpdateTime": "2022-03-17T10:41:41Z", + "lastTransitionTime": "2022-03-17T10:40:38Z", + "reason": "NewReplicaSetAvailable", + "message": "ReplicaSet \"metrics-server-v0.4.5-bbb794dcc\" has successfully progressed." + } + ] + } + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/kubernetes/_apis_metrics_k8s_io_v1beta1_nodes.json b/libcloud/test/container/fixtures/kubernetes/_apis_metrics_k8s_io_v1beta1_nodes.json new file mode 100644 index 0000000000..a23ac69bef --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_apis_metrics_k8s_io_v1beta1_nodes.json @@ -0,0 +1,22 @@ +{ + "kind": "NodeMetricsList", + "apiVersion": "metrics.k8s.io/v1beta1", + "metadata": { + "selfLink": "/apis/metrics.k8s.io/v1beta1/nodes" + }, + "items": [ + { + "metadata": { + "name": "gke-cluster-3-default-pool-76fd57f7-l83v", + "selfLink": "/apis/metrics.k8s.io/v1beta1/nodes/gke-cluster-3-default-pool-76fd57f7-l83v", + "creationTimestamp": "2021-08-13T10:24:45Z" + }, + "timestamp": "2021-08-13T10:24:26Z", + "window": "30s", + "usage": { + "cpu": "110691045n", + "memory": "801112Ki" + } + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/kubernetes/_apis_metrics_k8s_io_v1beta1_pods.json b/libcloud/test/container/fixtures/kubernetes/_apis_metrics_k8s_io_v1beta1_pods.json new file mode 100644 index 0000000000..a40e0abbc8 --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_apis_metrics_k8s_io_v1beta1_pods.json @@ -0,0 +1,255 @@ +{ + "kind": "PodMetricsList", + "apiVersion": "metrics.k8s.io/v1beta1", + "metadata": { + "selfLink": "/apis/metrics.k8s.io/v1beta1/pods" + }, + "items": [ + { + "metadata": { + "name": "gke-metrics-agent-sfjzj", + "namespace": "kube-system", + "selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/gke-metrics-agent-sfjzj", + "creationTimestamp": "2021-08-13T10:25:22Z" + }, + "timestamp": "2021-08-13T10:24:42Z", + "window": "30s", + "containers": [ + { + "name": "gke-metrics-agent", + "usage": { + "cpu": "704595n", + "memory": "24716Ki" + } + } + ] + }, + { + "metadata": { + "name": "stackdriver-metadata-agent-cluster-level-849ff68b6d-fphxl", + "namespace": "kube-system", + "selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/stackdriver-metadata-agent-cluster-level-849ff68b6d-fphxl", + "creationTimestamp": "2021-08-13T10:25:22Z" + }, + "timestamp": "2021-08-13T10:24:47Z", + "window": "30s", + "containers": [ + { + "name": "metadata-agent-nanny", + "usage": { + "cpu": "30081564n", + "memory": "7376Ki" + } + }, + { + "name": "metadata-agent", + "usage": { + "cpu": "1435158n", + "memory": "20224Ki" + } + } + ] + }, + { + "metadata": { + "name": "event-exporter-gke-67986489c8-g47rz", + "namespace": "kube-system", + "selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/event-exporter-gke-67986489c8-g47rz", + "creationTimestamp": "2021-08-13T10:25:22Z" + }, + "timestamp": "2021-08-13T10:24:57Z", + "window": "30s", + "containers": [ + { + "name": "prometheus-to-sd-exporter", + "usage": { + "cpu": "36247n", + "memory": "7552Ki" + } + }, + { + "name": "event-exporter", + "usage": { + "cpu": "21094n", + "memory": "8012Ki" + } + } + ] + }, + { + "metadata": { + "name": "fluentbit-gke-ntfb8", + "namespace": "kube-system", + "selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/fluentbit-gke-ntfb8", + "creationTimestamp": "2021-08-13T10:25:22Z" + }, + "timestamp": "2021-08-13T10:24:47Z", + "window": "30s", + "containers": [ + { + "name": "fluentbit", + "usage": { + "cpu": "1710930n", + "memory": "10424Ki" + } + }, + { + "name": "fluentbit-gke", + "usage": { + "cpu": "511171n", + "memory": "12780Ki" + } + } + ] + }, + { + "metadata": { + "name": "l7-default-backend-56cb9644f6-tx6xv", + "namespace": "kube-system", + "selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/l7-default-backend-56cb9644f6-tx6xv", + "creationTimestamp": "2021-08-13T10:25:22Z" + }, + "timestamp": "2021-08-13T10:24:57Z", + "window": "30s", + "containers": [ + { + "name": "default-http-backend", + "usage": { + "cpu": "70131n", + "memory": "2752Ki" + } + } + ] + }, + { + "metadata": { + "name": "kube-dns-autoscaler-844c9d9448-4h4th", + "namespace": "kube-system", + "selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/kube-dns-autoscaler-844c9d9448-4h4th", + "creationTimestamp": "2021-08-13T10:25:22Z" + }, + "timestamp": "2021-08-13T10:24:50Z", + "window": "30s", + "containers": [ + { + "name": "autoscaler", + "usage": { + "cpu": "100385n", + "memory": "14604Ki" + } + } + ] + }, + { + "metadata": { + "name": "pdcsi-node-k5h6d", + "namespace": "kube-system", + "selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/pdcsi-node-k5h6d", + "creationTimestamp": "2021-08-13T10:25:22Z" + }, + "timestamp": "2021-08-13T10:24:49Z", + "window": "30s", + "containers": [ + { + "name": "csi-driver-registrar", + "usage": { + "cpu": "23137n", + "memory": "3964Ki" + } + }, + { + "name": "gce-pd-driver", + "usage": { + "cpu": "33474n", + "memory": "4360Ki" + } + } + ] + }, + { + "metadata": { + "name": "kube-proxy-gke-cluster-3-default-pool-76fd57f7-l83v", + "namespace": "kube-system", + "selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/kube-proxy-gke-cluster-3-default-pool-76fd57f7-l83v", + "creationTimestamp": "2021-08-13T10:25:22Z" + }, + "timestamp": "2021-08-13T10:24:53Z", + "window": "30s", + "containers": [ + { + "name": "kube-proxy", + "usage": { + "cpu": "244320n", + "memory": "32760Ki" + } + } + ] + }, + { + "metadata": { + "name": "kube-dns-6c7b8dc9f9-flm9k", + "namespace": "kube-system", + "selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/kube-dns-6c7b8dc9f9-flm9k", + "creationTimestamp": "2021-08-13T10:25:22Z" + }, + "timestamp": "2021-08-13T10:24:50Z", + "window": "30s", + "containers": [ + { + "name": "dnsmasq", + "usage": { + "cpu": "166912n", + "memory": "4244Ki" + } + }, + { + "name": "prometheus-to-sd", + "usage": { + "cpu": "10123n", + "memory": "8500Ki" + } + }, + { + "name": "kubedns", + "usage": { + "cpu": "673332n", + "memory": "6632Ki" + } + }, + { + "name": "sidecar", + "usage": { + "cpu": "682950n", + "memory": "5736Ki" + } + } + ] + }, + { + "metadata": { + "name": "metrics-server-v0.3.6-9c5bbf784-gqkx2", + "namespace": "kube-system", + "selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/metrics-server-v0.3.6-9c5bbf784-gqkx2", + "creationTimestamp": "2021-08-13T10:25:22Z" + }, + "timestamp": "2021-08-13T10:24:53Z", + "window": "30s", + "containers": [ + { + "name": "metrics-server-nanny", + "usage": { + "cpu": "25366453n", + "memory": "7568Ki" + } + }, + { + "name": "metrics-server", + "usage": { + "cpu": "215384n", + "memory": "14928Ki" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/kubernetes/_version.json b/libcloud/test/container/fixtures/kubernetes/_version.json new file mode 100644 index 0000000000..f082f20866 --- /dev/null +++ b/libcloud/test/container/fixtures/kubernetes/_version.json @@ -0,0 +1,11 @@ +{ + "major": "1", + "minor": "20+", + "gitVersion": "v1.20.8-gke.900", + "gitCommit": "28ab8501be88ea42e897ca8514d7cd0b436253d9", + "gitTreeState": "clean", + "buildDate": "2021-06-30T09:23:36Z", + "goVersion": "go1.15.13b5", + "compiler": "gc", + "platform": "linux/amd64" +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/background_op.json b/libcloud/test/container/fixtures/lxd/linux_124/background_op.json new file mode 100644 index 0000000000..efbf2c1847 --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/background_op.json @@ -0,0 +1,7 @@ +{ + "type": "async", + "status": "OK", + "status_code": 100, + "operation": "/1.0/operations/1", + "metadata": {"id": 1} +} diff --git a/libcloud/test/container/fixtures/lxd/linux_124/containers.json b/libcloud/test/container/fixtures/lxd/linux_124/containers.json new file mode 100644 index 0000000000..b29ee691bf --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/containers.json @@ -0,0 +1,6 @@ +{ + "type": "sync", + "status": "Success", + "status_code": 200, + "metadata": ["/1.0/containers/first_lxd_container", "/1.0/containers/second_lxd_container" ] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/endpoints_sucess.json b/libcloud/test/container/fixtures/lxd/linux_124/endpoints_sucess.json new file mode 100644 index 0000000000..f7d815fb05 --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/endpoints_sucess.json @@ -0,0 +1,6 @@ +{ + "type": "sync", + "status": "Success", + "status_code": 200, + "metadata": ["linux_124"] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/first_lxd_container.json b/libcloud/test/container/fixtures/lxd/linux_124/first_lxd_container.json new file mode 100644 index 0000000000..e327064424 --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/first_lxd_container.json @@ -0,0 +1,46 @@ +{ + "type": "sync", + "status": "Success", + "status_code": 200, + "metadata": { + "name": "first_lxd_container", + "status": "Running", + "architecture": "x86_64", + "ephemeral":"False", + "config": + { + "volatile.base_image": "7ed08b435c92cd8a8a884c88e8722f2e7546a51e891982a90ea9c15619d7df9b", + "image.version": "ubuntu", + "image.architecture": "amd64", + "image.description": "Ubuntu 16.04 LTS", + "image.os": "Linux", + "image.release": "16.04", + "image.serial": "7ed08b435c92cd8a8a884c88e8722f2e7546a51e891982a90ea9c15619d7df9b", + "image.type": "container" + }, + "network": + { + "eth0": + { + "addresses": + [{"family": "inet", "address": "10.186.59.84", "netmask": "24", "scope": "global"}, + {"family": "inet6", "address": "fd42:64ae:f6a0:898e:216:3eff:fe55:980f", "netmask": "64", "scope": "global"}, + {"family": "inet6", "address": "fe80::216:3eff:fe55:980f", "netmask": "64", "scope": "link"}], + "counters": {"bytes_received": 3682174, "bytes_sent": 179726, "packets_received": 3170, "packets_sent": 2222}, + "hwaddr": "00:16:3e:55:98:0f", + "host_name": "vethb8cb9e2e", + "mtu": 1500, + "state": "up", "type": "broadcast" + }, + "lo":{"addresses":[{"family": "inet", "address": "127.0.0.1", "netmask": "8", "scope": "local"}, + {"family": "inet6", "address": "::1", "netmask": "128", "scope": "local"}], + "counters": {"bytes_received": 0, "bytes_sent": 0, "packets_received": 0, "packets_sent": 0}, + "hwaddr":"", + "host_name":"", + "mtu": 65536, + "state":"up", + "type":"loopback" + } + } + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/image.json b/libcloud/test/container/fixtures/lxd/linux_124/image.json new file mode 100644 index 0000000000..a3282beff4 --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/image.json @@ -0,0 +1,36 @@ +{ + "type": "sync", + "status": "Success", + "status_code": 200, + "metadata": { + "aliases": [ + { + "name": "trusty", + "description": "" + } + ], + "architecture": "x86_64", + "auto_update": true, + "cached": false, + "fingerprint": "54c8caac1f61901ed86c68f24af5f5d3672bdc62c71d04f06df3a59e95684473", + "filename": "ubuntu-trusty-14.04-amd64-server-20160201.tar.xz", + "properties": { + "architecture": "x86_64", + "description": "Ubuntu 14.04 LTS server (20160201)", + "os": "ubuntu", + "release": "trusty" + }, + "update_source": { + "server": "https://10.1.2.4:8443", + "protocol": "lxd", + "certificate": "PEM certificate", + "alias": "ubuntu/trusty/amd64" + }, + "public": false, + "size": 123792592, + "created_at": "2016-02-01T21:07:41Z", + "expires_at": "1970-01-01T00:00:00Z", + "last_used_at": "1970-01-01T00:00:00Z", + "uploaded_at": "2016-02-16T00:44:47Z" + } +} diff --git a/libcloud/test/container/fixtures/lxd/linux_124/images.json b/libcloud/test/container/fixtures/lxd/linux_124/images.json new file mode 100644 index 0000000000..760e982a1c --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/images.json @@ -0,0 +1,6 @@ +{ + "type": "sync", + "status": "Success", + "status_code": 200, + "metadata":["/1.0/images/54c8caac1f61901ed86c68f24af5f5d3672bdc62c71d04f06df3a59e95684473"] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/no_meta_pool.json b/libcloud/test/container/fixtures/lxd/linux_124/no_meta_pool.json new file mode 100644 index 0000000000..13141e3f00 --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/no_meta_pool.json @@ -0,0 +1,9 @@ +{ + "type": "sync", + "status": "Success", + "status_code": 200, + "operation": "", + "error_code": 0, + "error": "", + "metadata": {} +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/operation_1_wait.json b/libcloud/test/container/fixtures/lxd/linux_124/operation_1_wait.json new file mode 100644 index 0000000000..33f234b19a --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/operation_1_wait.json @@ -0,0 +1,6 @@ +{ + "type": "async", + "status": "OK", + "status_code": 200, + "metadata": {} +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/second_lxd_container.json b/libcloud/test/container/fixtures/lxd/linux_124/second_lxd_container.json new file mode 100644 index 0000000000..6efc253a8b --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/second_lxd_container.json @@ -0,0 +1,45 @@ +{ + "type": "sync", + "status": "Success", + "status_code": 200, + "metadata": { + "name": "second_lxd_container", + "status": "Stopped", + "architecture": "x86_64", + "ephemeral":"False", + "config": + { + "volatile.base_image": "7ed08b435c92cd8a8a884c88e8722f2e7546a51e891982a90ea9c15619d7df9b", + "image.version": "ubuntu", + "image.architecture": "amd64", + "image.description": "Ubuntu 16.04 LTS", + "image.os": "Linux", + "image.release": "16.04", + "image.serial": "7ed08b435c92cd8a8a884c88e8722f2e7546a51e891982a90ea9c15619d7df9b", + "image.type": "container" + }, + "network": {"eth0": + { + "addresses": + [{"family": "inet", "address": "10.186.59.84", "netmask": "24", "scope": "global"}, + {"family": "inet6", "address": "fd42:64ae:f6a0:898e:216:3eff:fe55:980f", "netmask": "64", "scope": "global"}, + {"family": "inet6", "address": "fe80::216:3eff:fe55:980f", "netmask": "64", "scope": "link"}], + "counters": {"bytes_received": 3682174, "bytes_sent": 179726, "packets_received": 3170, "packets_sent": 2222}, + "hwaddr": "00:16:3e:55:98:0f", + "host_name": "vethb8cb9e2e", + "mtu": 1500, + "state": "up", + "type": "broadcast" + }, + "lo":{"addresses":[{"family": "inet", "address": "127.0.0.1", "netmask": "8", "scope": "local"}, + {"family": "inet6", "address": "::1", "netmask": "128", "scope": "local"}], + "counters": {"bytes_received": 0, "bytes_sent": 0, "packets_received": 0, "packets_sent": 0}, + "hwaddr": "", + "host_name": "", + "mtu": 65536, + "state": "up", + "type": "loopback" + } + } + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/storage_pool_1.json b/libcloud/test/container/fixtures/lxd/linux_124/storage_pool_1.json new file mode 100644 index 0000000000..6a916c1d20 --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/storage_pool_1.json @@ -0,0 +1,15 @@ +{"type": "sync", "status": "Success", "status_code": 200,"operation": "", + "error_code": 0, + "error": "", + "metadata": { + "name": "pool1", + "driver": "zfs", + "used_by": ["/1.0/containers/alp1", "/1.0/containers/alp10", "/1.0/images/62e850a334bb9d99cac00b2e618e0291e5e7bb7db56c4246ecaf8e46fa0631a6" ], + "config": { + "size": "61203283968", + "source": "/home/chb/mnt/l2/disks/default.img", + "volume.size": "0", + "zfs.pool_name": "default" + } + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/storage_pool_2.json b/libcloud/test/container/fixtures/lxd/linux_124/storage_pool_2.json new file mode 100644 index 0000000000..9a90d01407 --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/storage_pool_2.json @@ -0,0 +1,19 @@ +{ + "type": "sync", + "status": "Success", + "status_code": 200, + "operation": "", + "error_code": 0, + "error": "", + "metadata": { + "name": "pool2", + "driver": "zfs", + "used_by": ["/1.0/containers/alp1", "/1.0/containers/alp10", "/1.0/images/62e850a334bb9d99cac00b2e618e0291e5e7bb7db56c4246ecaf8e46fa0631a6"], + "config": { + "size": "61203283968", + "source": "/home/chb/mnt/l2/disks/default.img", + "volume.size": "0", + "zfs.pool_name": "default" + } + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/storage_pool_delete_fail.json b/libcloud/test/container/fixtures/lxd/linux_124/storage_pool_delete_fail.json new file mode 100644 index 0000000000..0328936783 --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/storage_pool_delete_fail.json @@ -0,0 +1 @@ +{"type": "error", "error": "Failure", "status_code": 400} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/storage_pool_delete_sucess.json b/libcloud/test/container/fixtures/lxd/linux_124/storage_pool_delete_sucess.json new file mode 100644 index 0000000000..fbf61a9941 --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/storage_pool_delete_sucess.json @@ -0,0 +1 @@ +{"type": "sync", "status": "Success", "status_code": 200, "metadata": {}} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/storage_pools.json b/libcloud/test/container/fixtures/lxd/linux_124/storage_pools.json new file mode 100644 index 0000000000..c219541313 --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/storage_pools.json @@ -0,0 +1,2 @@ +{"type": "sync", "status": "Success", "status_code": 200, "metadata": ["/1.0/storage-pools/pool1", "/1.0/storage-pools/pool2"] +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/lxd/linux_124/version.json b/libcloud/test/container/fixtures/lxd/linux_124/version.json new file mode 100644 index 0000000000..3795af1b81 --- /dev/null +++ b/libcloud/test/container/fixtures/lxd/linux_124/version.json @@ -0,0 +1,12 @@ +{ + "type": "sync", + "status": "Success", + "status_code": 200, + "metadata": { + "api_extensions": [], + "api_status": "stable", + "api_version": "linux_124", + "auth": "guest", + "public": false + } +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/deploy_container.json b/libcloud/test/container/fixtures/rancher/deploy_container.json new file mode 100644 index 0000000000..bfe09633df --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/deploy_container.json @@ -0,0 +1,109 @@ +{ + "id": "1i31", + "type": "container", + "links": { + "self": "http://172.30.0.100:8080/v1/containers/1i31", + "account": "http://172.30.0.100:8080/v1/containers/1i31/account", + "credentials": "http://172.30.0.100:8080/v1/containers/1i31/credentials", + "healthcheckInstanceHostMaps": "http://172.30.0.100:8080/v1/containers/1i31/healthcheckinstancehostmaps", + "hosts": "http://172.30.0.100:8080/v1/containers/1i31/hosts", + "instanceLabels": "http://172.30.0.100:8080/v1/containers/1i31/instancelabels", + "instanceLinks": "http://172.30.0.100:8080/v1/containers/1i31/instancelinks", + "instances": "http://172.30.0.100:8080/v1/containers/1i31/instances", + "mounts": "http://172.30.0.100:8080/v1/containers/1i31/mounts", + "ports": "http://172.30.0.100:8080/v1/containers/1i31/ports", + "serviceEvents": "http://172.30.0.100:8080/v1/containers/1i31/serviceevents", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/containers/1i31/serviceexposemaps", + "services": "http://172.30.0.100:8080/v1/containers/1i31/services", + "targetInstanceLinks": "http://172.30.0.100:8080/v1/containers/1i31/targetinstancelinks", + "volumes": "http://172.30.0.100:8080/v1/containers/1i31/volumes", + "stats": "http://172.30.0.100:8080/v1/containers/1i31/stats", + "containerStats": "http://172.30.0.100:8080/v1/containers/1i31/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/containers/1i31/?action=update", + "error": "http://172.30.0.100:8080/v1/containers/1i31/?action=error", + "remove": "http://172.30.0.100:8080/v1/containers/1i31/?action=remove", + "start": "http://172.30.0.100:8080/v1/containers/1i31/?action=start", + "logs": "http://172.30.0.100:8080/v1/containers/1i31/?action=logs", + "setlabels": "http://172.30.0.100:8080/v1/containers/1i31/?action=setlabels" + }, + "name": "newcontainer", + "state": "running", + "accountId": "1a5", + "blkioDeviceOptions": null, + "build": null, + "capAdd": null, + "capDrop": null, + "command": null, + "cpuSet": null, + "cpuShares": null, + "createIndex": null, + "created": "2016-10-06T15:55:58Z", + "createdTS": 1475769358000, + "dataVolumeMounts": {}, + "dataVolumes": [], + "dataVolumesFrom": null, + "deploymentUnitUuid": null, + "description": null, + "devices": null, + "dns": [ + "169.254.169.250" + ], + "dnsSearch": [ + "rancher.internal" + ], + "dockerPorts": [], + "domainName": null, + "entryPoint": null, + "environment": { + "STORAGE_TYPE": "file" + }, + "expose": null, + "externalId": "ab334bd25d25db7b94fdcead8f5c023b05bed424f56243187aa90f5ef7f07b09", + "extraHosts": null, + "firstRunning": "2016-10-06T15:56:00Z", + "firstRunningTS": 1475769360000, + "healthCheck": null, + "healthState": null, + "hostId": "1h1", + "hostname": null, + "imageUuid": "docker:rlister/hastebin:latest", + "kind": "container", + "labels": { + "io.rancher.container.uuid": "6d3dcf5f-28b8-4e60-9bf1-618b76a9a805", + "io.rancher.container.name": "newcontainer", + "io.rancher.container.ip": "10.42.204.104/16" + }, + "logConfig": null, + "lxcConf": null, + "memory": null, + "memorySwap": null, + "nativeContainer": false, + "networkContainerId": null, + "networkMode": "managed", + "pidMode": null, + "ports": null, + "primaryIpAddress": "10.42.204.104", + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "registryCredentialId": null, + "removed": null, + "requestedHostId": null, + "restartPolicy": null, + "securityOpt": null, + "startCount": 1, + "startOnCreate": true, + "stdinOpen": false, + "systemContainer": null, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "tty": false, + "user": null, + "uuid": "6d3dcf5f-28b8-4e60-9bf1-618b76a9a805", + "version": "0", + "volumeDriver": null, + "workingDir": null +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/ex_activate_service.json b/libcloud/test/container/fixtures/rancher/ex_activate_service.json new file mode 100644 index 0000000000..a103ef57b7 --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/ex_activate_service.json @@ -0,0 +1,198 @@ +{ + "id": "1s6", + "type": "service", + "links": { + "self": "http://172.30.0.100:8080/v1/services/1s6", + "account": "http://172.30.0.100:8080/v1/services/1s6/account", + "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s6/consumedbyservices", + "consumedservices": "http://172.30.0.100:8080/v1/services/1s6/consumedservices", + "environment": "http://172.30.0.100:8080/v1/services/1s6/environment", + "instances": "http://172.30.0.100:8080/v1/services/1s6/instances", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s6/serviceexposemaps", + "containerStats": "http://172.30.0.100:8080/v1/services/1s6/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/services/1s6/?action=update", + "restart": "http://172.30.0.100:8080/v1/services/1s6/?action=restart", + "remove": "http://172.30.0.100:8080/v1/services/1s6/?action=remove", + "setservicelinks": "http://172.30.0.100:8080/v1/services/1s6/?action=setservicelinks", + "removeservicelink": "http://172.30.0.100:8080/v1/services/1s6/?action=removeservicelink", + "upgrade": "http://172.30.0.100:8080/v1/services/1s6/?action=upgrade", + "addservicelink": "http://172.30.0.100:8080/v1/services/1s6/?action=addservicelink", + "deactivate": "http://172.30.0.100:8080/v1/services/1s6/?action=deactivate" + }, + "name": "123", + "state": "active", + "accountId": "1a5", + "assignServiceIpAddress": false, + "createIndex": 1, + "created": "2016-09-22T18:28:04Z", + "createdTS": 1474568884000, + "currentScale": 1, + "description": null, + "environmentId": "1e2", + "externalId": null, + "fqdn": null, + "healthState": "healthy", + "kind": "service", + "launchConfig": { + "capAdd": [], + "capDrop": [], + "count": null, + "cpuSet": null, + "cpuShares": null, + "dataVolumes": [], + "dataVolumesFrom": [], + "description": null, + "devices": [], + "dns": [], + "dnsSearch": [], + "domainName": null, + "hostname": null, + "imageUuid": "docker:ubuntu:trusty", + "kind": "container", + "labels": { + "io.rancher.container.pull_image": "always" + }, + "logConfig": { + "config": {}, + "driver": "" + }, + "memory": null, + "memoryMb": null, + "memorySwap": null, + "networkMode": "managed", + "pidMode": null, + "ports": [], + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "requestedIpAddress": null, + "startOnCreate": true, + "stdinOpen": true, + "tty": true, + "user": null, + "userdata": null, + "version": "0bdea468-c3e9-4562-951c-d543958e966a", + "volumeDriver": null, + "workingDir": null, + "dataVolumesFromLaunchConfigs": [], + "networkLaunchConfig": null, + "vcpu": 1 + }, + "metadata": null, + "publicEndpoints": null, + "removed": null, + "retainIp": null, + "scale": 1, + "scalePolicy": null, + "secondaryLaunchConfigs": [], + "selectorContainer": null, + "selectorLink": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "upgrade": { + "inServiceStrategy": { + "batchSize": 1, + "intervalMillis": 2000, + "launchConfig": { + "capAdd": [], + "capDrop": [], + "count": null, + "cpuSet": null, + "cpuShares": null, + "dataVolumes": [], + "dataVolumesFrom": [], + "description": null, + "devices": [], + "dns": [], + "dnsSearch": [], + "domainName": null, + "hostname": null, + "imageUuid": "docker:ubuntu:trusty", + "kind": "container", + "labels": { + "io.rancher.container.pull_image": "always" + }, + "logConfig": { + "config": {}, + "driver": "" + }, + "memory": null, + "memoryMb": null, + "memorySwap": null, + "networkMode": "managed", + "pidMode": null, + "ports": [], + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "requestedIpAddress": null, + "startOnCreate": true, + "stdinOpen": true, + "tty": true, + "user": null, + "userdata": null, + "version": "0bdea468-c3e9-4562-951c-d543958e966a", + "volumeDriver": null, + "workingDir": null, + "dataVolumesFromLaunchConfigs": [], + "networkLaunchConfig": null, + "vcpu": 1 + }, + "previousLaunchConfig": { + "capAdd": [], + "capDrop": [], + "count": null, + "cpuSet": null, + "cpuShares": null, + "dataVolumes": [], + "dataVolumesFrom": [], + "description": null, + "devices": [], + "dns": [], + "dnsSearch": [], + "domainName": null, + "hostname": null, + "imageUuid": "docker:ubuntu:trusty", + "kind": "container", + "labels": { + "io.rancher.container.pull_image": "always" + }, + "logConfig": { + "config": {}, + "driver": "" + }, + "memory": null, + "memoryMb": null, + "memorySwap": null, + "networkMode": "managed", + "pidMode": null, + "ports": [], + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "requestedIpAddress": null, + "startOnCreate": true, + "stdinOpen": true, + "tty": true, + "user": null, + "userdata": null, + "version": "0", + "volumeDriver": null, + "workingDir": null, + "dataVolumesFromLaunchConfigs": [], + "networkLaunchConfig": null, + "vcpu": 1 + }, + "previousSecondaryLaunchConfigs": [], + "secondaryLaunchConfigs": [], + "startFirst": true + }, + "toServiceStrategy": null + }, + "uuid": "c0ae4d08-e20a-45ef-9fb9-ad9f7cdeeb15", + "vip": null +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/ex_activate_stack.json b/libcloud/test/container/fixtures/rancher/ex_activate_stack.json new file mode 100644 index 0000000000..65148eba5e --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/ex_activate_stack.json @@ -0,0 +1,52 @@ +{ + "id": "1e1", + "type": "environment", + "links": { + "self": "http://172.30.0.100:8080/v1/environments/1e1", + "account": "http://172.30.0.100:8080/v1/environments/1e1/account", + "services": "http://172.30.0.100:8080/v1/environments/1e1/services", + "composeConfig": "http://172.30.0.100:8080/v1/environments/1e1/composeconfig" + }, + "actions": { + "upgrade": "http://172.30.0.100:8080/v1/environments/1e1/?action=upgrade", + "update": "http://172.30.0.100:8080/v1/environments/1e1/?action=update", + "remove": "http://172.30.0.100:8080/v1/environments/1e1/?action=remove", + "addoutputs": "http://172.30.0.100:8080/v1/environments/1e1/?action=addoutputs", + "activateservices": "http://172.30.0.100:8080/v1/environments/1e1/?action=activateservices", + "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e1/?action=deactivateservices", + "exportconfig": "http://172.30.0.100:8080/v1/environments/1e1/?action=exportconfig" + }, + "name": "Concrete5", + "state": "active", + "accountId": "1a5", + "created": "2016-09-22T17:58:53Z", + "createdTS": 1474567133000, + "description": null, + "dockerCompose": "CMSMysql:\r\n environment:\r\n MYSQL_ROOT_PASSWORD: ${root_password}\r\n MYSQL_DATABASE: ${db_name}\r\n MYSQL_USER: ${db_username}\r\n MYSQL_PASSWORD: ${db_password}\r\n labels:\r\n io.rancher.container.pull_image: always\r\n tty: true\r\n image: mysql\r\n volumes:\r\n - ${db_data_location}:/var/lib/mysql\r\n stdin_open: true\r\n volume_driver: ${volume_driver}\r\n\r\nCMSConfig:\r\n image: opensaas/concrete5\r\n tty: true\r\n stdin_open: true\r\n links:\r\n - CMSMysql:mysql\r\n volumes:\r\n - ${cms_application_data}:/var/www/html/application\r\n - ${cms_packages_data}:/var/www/html/packages\r\n labels:\r\n io.rancher.container.hostname_override: container_name\r\n io.rancher.container.start_once: true\r\n volume_driver: ${volume_driver}\r\n command: bash -c \"chown -R www-data. application; chown -R www-data. packages; sleep 2m; php -f concrete/bin/concrete5.php c5:install --db-server=mysql --db-username=${db_username} --db-password=${db_password} --db-database=${db_name} --site=${cms_sitename} --admin-email=${cms_admin_email} --admin-password=${cms_admin_password} -n -vvv\"\r\n\r\nConcrete5App:\r\n labels:\r\n io.rancher.container.pull_image: always\r\n io.rancher.sidekicks: CMSConfig\r\n tty: true\r\n links:\r\n - CMSMysql:mysql\r\n image: opensaas/concrete5\r\n volumes:\r\n - ${cms_application_data}:/var/www/html/application\r\n - ${cms_packages_data}:/var/www/html/packages\r\n volume_driver: ${volume_driver}\r\n stdin_open: true", + "environment": { + "root_password": "password", + "db_name": "CMS_DB", + "db_username": "CMS_USER", + "db_password": "password", + "db_data_location": "CMS_DB_DATA", + "volume_driver": "", + "cms_application_data": "CMS_APP_DATA", + "cms_packages_data": "CMS_PACK_DATA", + "cms_admin_email": "admin@example.com", + "cms_admin_password": "password", + "cms_sitename": "MySite" + }, + "externalId": "catalog://community:Concrete5:1", + "healthState": "unhealthy", + "kind": "environment", + "outputs": null, + "previousEnvironment": null, + "previousExternalId": null, + "rancherCompose": ".catalog:\r\n name: \"Concrete5\"\r\n version: \"v0.2\"\r\n description: \"Concrete5 CMS\"\r\n uuid: Concrete5-1\r\n minimum_rancher_version: v0.51.0\r\n questions:\r\n - variable: root_password\r\n description: \"MySQL root password - keep this password complex and secure\"\r\n label: \"MySQL Root Password\"\r\n required: true\r\n default: \"password\"\r\n type: \"string\"\r\n - variable: db_name\r\n description: \"MySQL Database Name - to use in the Concrete5 setup\"\r\n label: \"MySQL Database Name\"\r\n required: true\r\n default: \"CMS_DB\"\r\n type: \"string\"\r\n - variable: db_username\r\n description: \"MySQL Username - to use in the Concrete5 setup\"\r\n label: \"MySQL Username\"\r\n required: true\r\n default: \"CMS_USER\"\r\n type: \"string\"\r\n - variable: db_password\r\n description: \"MySQL password for the above user - to use in the Concrete5 setup\"\r\n label: \"MySQL Password\"\r\n required: true\r\n default: \"password\"\r\n type: \"string\"\r\n - variable: db_data_location\r\n description: \"Location on the host for the database files\"\r\n label: \"DB Data Location\"\r\n required: true\r\n default: \"CMS_DB_DATA\"\r\n type: \"string\"\r\n - variable: volume_driver\r\n description: \"Volume Driver for the persistant data locations requires docker 1.7\"\r\n label: \"Volume Driver\"\r\n type: \"string\"\r\n - variable: cms_application_data\r\n description: \"Concrcte5 application folder for persistant data storage\"\r\n label: \"Application Folder\"\r\n required: true\r\n default: \"CMS_APP_DATA\"\r\n type: \"string\"\r\n - variable: cms_packages_data\r\n description: \"Concrcte5 packages folder for persistant data storage\"\r\n label: \"Packages Folder\"\r\n required: true\r\n default: \"CMS_PACK_DATA\"\r\n type: \"string\"\r\n - variable: cms_admin_email\r\n description: \"Concrcete5 admin email address\"\r\n label: \"Admin Email\"\r\n required: true\r\n default: \"admin@example.com\"\r\n type: \"string\"\r\n - variable: cms_admin_password\r\n description: \"Concrcete5 admin password\"\r\n label: \"Admin Password\"\r\n required: true\r\n default: \"password\"\r\n type: \"string\"\r\n - variable: cms_sitename\r\n description: \"Concrcete5 Sitename\"\r\n label: \"Sitename\"\r\n required: true\r\n default: \"MySite\"\r\n type: \"string\"\r\nCMSMysql:\r\n scale: 1\r\nConcrete5App:\r\n scale: 1\r\n\r\n", + "removed": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "uuid": "e129ed27-3823-4e2e-af62-4565d68995d4" +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/ex_deploy_service.json b/libcloud/test/container/fixtures/rancher/ex_deploy_service.json new file mode 100644 index 0000000000..e30bc47800 --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/ex_deploy_service.json @@ -0,0 +1,66 @@ +{ + "id": "1s13", + "type": "service", + "links": { + "self": "http://172.30.0.100:8080/v1/services/1s13", + "account": "http://172.30.0.100:8080/v1/services/1s13/account", + "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s13/consumedbyservices", + "consumedservices": "http://172.30.0.100:8080/v1/services/1s13/consumedservices", + "environment": "http://172.30.0.100:8080/v1/services/1s13/environment", + "instances": "http://172.30.0.100:8080/v1/services/1s13/instances", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s13/serviceexposemaps", + "containerStats": "http://172.30.0.100:8080/v1/services/1s13/containerstats" + }, + "actions": { + "setservicelinks": "http://172.30.0.100:8080/v1/services/1s13/?action=setservicelinks", + "removeservicelink": "http://172.30.0.100:8080/v1/services/1s13/?action=removeservicelink", + "addservicelink": "http://172.30.0.100:8080/v1/services/1s13/?action=addservicelink" + }, + "name": "newservice", + "state": "active", + "accountId": "1a5", + "assignServiceIpAddress": false, + "createIndex": 1, + "created": "2016-10-06T15:31:35Z", + "createdTS": 1475767895000, + "currentScale": 1, + "description": null, + "environmentId": "1e6", + "externalId": null, + "fqdn": null, + "healthState": "unhealthy", + "kind": "service", + "launchConfig": { + "environment": { + "root_password": "password" + }, + "imageUuid": "docker:rlister/hastebin:latest", + "kind": "container", + "networkMode": "managed", + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "startOnCreate": true, + "stdinOpen": false, + "tty": false, + "version": "0", + "vcpu": 1 + }, + "metadata": null, + "publicEndpoints": null, + "removed": "2016-10-06T15:45:03Z", + "removedTS": 1475768703000, + "retainIp": null, + "scale": 1, + "scalePolicy": null, + "secondaryLaunchConfigs": [], + "selectorContainer": null, + "selectorLink": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "upgrade": null, + "uuid": "de2cd54f-9936-49fb-a41a-35653c4510f7", + "vip": null +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/ex_deploy_stack.json b/libcloud/test/container/fixtures/rancher/ex_deploy_stack.json new file mode 100644 index 0000000000..38b1db449e --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/ex_deploy_stack.json @@ -0,0 +1,40 @@ +{ + "id": "1e9", + "type": "environment", + "links": { + "self": "http://172.30.0.100:8080/v1/environments/1e9", + "account": "http://172.30.0.100:8080/v1/environments/1e9/account", + "services": "http://172.30.0.100:8080/v1/environments/1e9/services", + "composeConfig": "http://172.30.0.100:8080/v1/environments/1e9/composeconfig" + }, + "actions": { + "upgrade": "http://172.30.0.100:8080/v1/environments/1e9/?action=upgrade", + "update": "http://172.30.0.100:8080/v1/environments/1e9/?action=update", + "remove": "http://172.30.0.100:8080/v1/environments/1e9/?action=remove", + "addoutputs": "http://172.30.0.100:8080/v1/environments/1e9/?action=addoutputs", + "activateservices": "http://172.30.0.100:8080/v1/environments/1e9/?action=activateservices", + "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e9/?action=deactivateservices", + "exportconfig": "http://172.30.0.100:8080/v1/environments/1e9/?action=exportconfig" + }, + "name": "newstack", + "state": "active", + "accountId": "1a5", + "created": "2016-10-06T14:12:34Z", + "createdTS": 1475763154000, + "description": null, + "dockerCompose": null, + "environment": {"root_password": "password"}, + "externalId": null, + "healthState": "healthy", + "kind": "environment", + "outputs": null, + "previousEnvironment": null, + "previousExternalId": null, + "rancherCompose": null, + "removed": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "uuid": "7f8b1836-5619-4e19-adfe-6967fe55bda7" +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/ex_destroy_service.json b/libcloud/test/container/fixtures/rancher/ex_destroy_service.json new file mode 100644 index 0000000000..6af70adabd --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/ex_destroy_service.json @@ -0,0 +1,66 @@ +{ + "id": "1s13", + "type": "service", + "links": { + "self": "http://172.30.0.100:8080/v1/services/1s13", + "account": "http://172.30.0.100:8080/v1/services/1s13/account", + "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s13/consumedbyservices", + "consumedservices": "http://172.30.0.100:8080/v1/services/1s13/consumedservices", + "environment": "http://172.30.0.100:8080/v1/services/1s13/environment", + "instances": "http://172.30.0.100:8080/v1/services/1s13/instances", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s13/serviceexposemaps", + "containerStats": "http://172.30.0.100:8080/v1/services/1s13/containerstats" + }, + "actions": { + "setservicelinks": "http://172.30.0.100:8080/v1/services/1s13/?action=setservicelinks", + "removeservicelink": "http://172.30.0.100:8080/v1/services/1s13/?action=removeservicelink", + "addservicelink": "http://172.30.0.100:8080/v1/services/1s13/?action=addservicelink" + }, + "name": "newservice", + "state": "removing", + "accountId": "1a5", + "assignServiceIpAddress": false, + "createIndex": 1, + "created": "2016-10-06T15:31:35Z", + "createdTS": 1475767895000, + "currentScale": 1, + "description": null, + "environmentId": "1e6", + "externalId": null, + "fqdn": null, + "healthState": "unhealthy", + "kind": "service", + "launchConfig": { + "environment": { + "root_password": "password" + }, + "imageUuid": "docker:rlister/hastebin:latest", + "kind": "container", + "networkMode": "managed", + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "startOnCreate": true, + "stdinOpen": false, + "tty": false, + "version": "0", + "vcpu": 1 + }, + "metadata": null, + "publicEndpoints": null, + "removed": "2016-10-06T15:45:03Z", + "removedTS": 1475768703000, + "retainIp": null, + "scale": 1, + "scalePolicy": null, + "secondaryLaunchConfigs": [], + "selectorContainer": null, + "selectorLink": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "upgrade": null, + "uuid": "de2cd54f-9936-49fb-a41a-35653c4510f7", + "vip": null +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/ex_destroy_stack.json b/libcloud/test/container/fixtures/rancher/ex_destroy_stack.json new file mode 100644 index 0000000000..daef943c63 --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/ex_destroy_stack.json @@ -0,0 +1,40 @@ +{ + "id": "1e10", + "type": "environment", + "links": { + "self": "http://172.30.0.100:8080/v1/environments/1e10", + "account": "http://172.30.0.100:8080/v1/environments/1e10/account", + "services": "http://172.30.0.100:8080/v1/environments/1e10/services", + "composeConfig": "http://172.30.0.100:8080/v1/environments/1e10/composeconfig" + }, + "actions": { + "addoutputs": "http://172.30.0.100:8080/v1/environments/1e10/?action=addoutputs", + "activateservices": "http://172.30.0.100:8080/v1/environments/1e10/?action=activateservices", + "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e10/?action=deactivateservices", + "exportconfig": "http://172.30.0.100:8080/v1/environments/1e10/?action=exportconfig" + }, + "name": "newstack1", + "state": "removing", + "accountId": "1a5", + "created": "2016-10-06T14:15:41Z", + "createdTS": 1475763341000, + "description": null, + "dockerCompose": null, + "environment": { + "root_password": "password" + }, + "externalId": null, + "healthState": "healthy", + "kind": "environment", + "outputs": null, + "previousEnvironment": null, + "previousExternalId": null, + "rancherCompose": null, + "removed": "2016-10-06T14:56:16Z", + "removedTS": 1475765776000, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "uuid": "289f380f-d00a-4faf-b69f-53a559dbfd05" +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/ex_list_services.json b/libcloud/test/container/fixtures/rancher/ex_list_services.json new file mode 100644 index 0000000000..789bca8641 --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/ex_list_services.json @@ -0,0 +1,536 @@ +{ + "type": "collection", + "resourceType": "service", + "links": { + "self": "http://172.30.0.100:8080/v1/services" + }, + "createTypes": { + "dnsService": "http://172.30.0.100:8080/v1/dnsservices", + "externalService": "http://172.30.0.100:8080/v1/externalservices", + "loadBalancerService": "http://172.30.0.100:8080/v1/loadbalancerservices", + "service": "http://172.30.0.100:8080/v1/services" + }, + "actions": {}, + "data": [ + { + "id": "1s1", + "type": "service", + "links": { + "self": "http://172.30.0.100:8080/v1/services/1s1", + "account": "http://172.30.0.100:8080/v1/services/1s1/account", + "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s1/consumedbyservices", + "consumedservices": "http://172.30.0.100:8080/v1/services/1s1/consumedservices", + "environment": "http://172.30.0.100:8080/v1/services/1s1/environment", + "instances": "http://172.30.0.100:8080/v1/services/1s1/instances", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s1/serviceexposemaps", + "containerStats": "http://172.30.0.100:8080/v1/services/1s1/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/services/1s1/?action=update", + "remove": "http://172.30.0.100:8080/v1/services/1s1/?action=remove", + "setservicelinks": "http://172.30.0.100:8080/v1/services/1s1/?action=setservicelinks", + "removeservicelink": "http://172.30.0.100:8080/v1/services/1s1/?action=removeservicelink", + "activate": "http://172.30.0.100:8080/v1/services/1s1/?action=activate", + "upgrade": "http://172.30.0.100:8080/v1/services/1s1/?action=upgrade", + "addservicelink": "http://172.30.0.100:8080/v1/services/1s1/?action=addservicelink" + }, + "name": "CMSMysql", + "state": "inactive", + "accountId": "1a5", + "assignServiceIpAddress": false, + "createIndex": 1, + "created": "2016-09-22T17:58:54Z", + "createdTS": 1474567134000, + "currentScale": 1, + "description": null, + "environmentId": "1e1", + "externalId": null, + "fqdn": null, + "healthState": "unhealthy", + "kind": "service", + "launchConfig": { + "dataVolumes": [ + "CMS_DB_DATA:/var/lib/mysql" + ], + "environment": { + "MYSQL_DATABASE": "CMS_DB", + "MYSQL_PASSWORD": "password", + "MYSQL_ROOT_PASSWORD": "password", + "MYSQL_USER": "CMS_USER" + }, + "imageUuid": "docker:mysql", + "kind": "container", + "labels": { + "io.rancher.container.pull_image": "always", + "io.rancher.service.hash": "c5d6bacef4be47a5ca5d1517a1d33319d024cdde" + }, + "logConfig": {}, + "networkMode": "managed", + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "startOnCreate": true, + "stdinOpen": true, + "tty": true, + "version": "0", + "vcpu": 1 + }, + "metadata": { + "io.rancher.service.hash": "41ccfd7f8023f2efcc758a925a9f461d607c990d" + }, + "publicEndpoints": null, + "removed": null, + "retainIp": null, + "scale": 1, + "scalePolicy": null, + "secondaryLaunchConfigs": [], + "selectorContainer": null, + "selectorLink": null, + "startOnCreate": false, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "upgrade": null, + "uuid": "85f4e9fc-c311-45a0-9a1a-a9da229aaa2a", + "vip": null + }, + { + "id": "1s2", + "type": "service", + "links": { + "self": "http://172.30.0.100:8080/v1/services/1s2", + "account": "http://172.30.0.100:8080/v1/services/1s2/account", + "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s2/consumedbyservices", + "consumedservices": "http://172.30.0.100:8080/v1/services/1s2/consumedservices", + "environment": "http://172.30.0.100:8080/v1/services/1s2/environment", + "instances": "http://172.30.0.100:8080/v1/services/1s2/instances", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s2/serviceexposemaps", + "containerStats": "http://172.30.0.100:8080/v1/services/1s2/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/services/1s2/?action=update", + "remove": "http://172.30.0.100:8080/v1/services/1s2/?action=remove", + "setservicelinks": "http://172.30.0.100:8080/v1/services/1s2/?action=setservicelinks", + "removeservicelink": "http://172.30.0.100:8080/v1/services/1s2/?action=removeservicelink", + "activate": "http://172.30.0.100:8080/v1/services/1s2/?action=activate", + "upgrade": "http://172.30.0.100:8080/v1/services/1s2/?action=upgrade", + "addservicelink": "http://172.30.0.100:8080/v1/services/1s2/?action=addservicelink" + }, + "name": "Concrete5App", + "state": "inactive", + "accountId": "1a5", + "assignServiceIpAddress": false, + "createIndex": 2, + "created": "2016-09-22T17:58:54Z", + "createdTS": 1474567134000, + "currentScale": 1, + "description": null, + "environmentId": "1e1", + "externalId": null, + "fqdn": null, + "healthState": "degraded", + "kind": "service", + "launchConfig": { + "dataVolumes": [ + "CMS_APP_DATA:/var/www/html/application", + "CMS_PACK_DATA:/var/www/html/packages" + ], + "imageUuid": "docker:opensaas/concrete5", + "kind": "container", + "labels": { + "io.rancher.container.pull_image": "always", + "io.rancher.service.hash": "6033469e7596fd16896eb87b3a99f50af2dbf522", + "io.rancher.sidekicks": "CMSConfig" + }, + "logConfig": {}, + "networkMode": "managed", + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "startOnCreate": true, + "stdinOpen": true, + "tty": true, + "version": "0", + "vcpu": 1 + }, + "metadata": { + "io.rancher.service.hash": "037726f2f6d389022953a652a5d3e5775415d0b0" + }, + "publicEndpoints": null, + "removed": null, + "retainIp": null, + "scale": 1, + "scalePolicy": null, + "secondaryLaunchConfigs": [ + { + "command": [ + "bash", + "-c", + "chown -R www-data. application; chown -R www-data. packages; sleep 2m; php -f concrete/bin/concrete5.php c5:install --db-server=mysql --db-username=CMS_USER --db-password=password --db-database=CMS_DB --site=MySite --admin-email=admin@example.com --admin-password=password -n -vvv" + ], + "dataVolumes": [ + "CMS_APP_DATA:/var/www/html/application", + "CMS_PACK_DATA:/var/www/html/packages" + ], + "imageUuid": "docker:opensaas/concrete5", + "labels": { + "io.rancher.container.hostname_override": "container_name", + "io.rancher.container.start_once": "true", + "io.rancher.service.hash": "db08c70dbb11ff2955a5cac93c2c6e5e1ac95e7e" + }, + "logConfig": {}, + "name": "CMSConfig", + "networkMode": "managed", + "startOnCreate": true, + "stdinOpen": true, + "tty": true, + "kind": "container", + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "vcpu": 1, + "version": "0" + } + ], + "selectorContainer": null, + "selectorLink": null, + "startOnCreate": false, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "upgrade": null, + "uuid": "1d824bd6-e18b-4ac4-8ea1-5cd0a3c7e234", + "vip": null + }, + { + "id": "1s3", + "type": "service", + "links": { + "self": "http://172.30.0.100:8080/v1/services/1s3", + "account": "http://172.30.0.100:8080/v1/services/1s3/account", + "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s3/consumedbyservices", + "consumedservices": "http://172.30.0.100:8080/v1/services/1s3/consumedservices", + "environment": "http://172.30.0.100:8080/v1/services/1s3/environment", + "instances": "http://172.30.0.100:8080/v1/services/1s3/instances", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s3/serviceexposemaps", + "containerStats": "http://172.30.0.100:8080/v1/services/1s3/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/services/1s3/?action=update", + "restart": "http://172.30.0.100:8080/v1/services/1s3/?action=restart", + "remove": "http://172.30.0.100:8080/v1/services/1s3/?action=remove", + "setservicelinks": "http://172.30.0.100:8080/v1/services/1s3/?action=setservicelinks", + "removeservicelink": "http://172.30.0.100:8080/v1/services/1s3/?action=removeservicelink", + "upgrade": "http://172.30.0.100:8080/v1/services/1s3/?action=upgrade", + "addservicelink": "http://172.30.0.100:8080/v1/services/1s3/?action=addservicelink", + "deactivate": "http://172.30.0.100:8080/v1/services/1s3/?action=deactivate" + }, + "name": "ghost", + "state": "active", + "accountId": "1a5", + "assignServiceIpAddress": false, + "createIndex": 1, + "created": "2016-09-22T18:00:26Z", + "createdTS": 1474567226000, + "currentScale": 1, + "description": null, + "environmentId": "1e2", + "externalId": null, + "fqdn": null, + "healthState": "healthy", + "kind": "service", + "launchConfig": { + "imageUuid": "docker:ghost", + "kind": "container", + "labels": { + "io.rancher.service.hash": "af9b5ddd2891271b12a88129e2bc37ff57998182" + }, + "logConfig": {}, + "networkMode": "managed", + "ports": [ + "80:2368/tcp" + ], + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "startOnCreate": true, + "stdinOpen": false, + "tty": false, + "version": "0", + "vcpu": 1 + }, + "metadata": { + "io.rancher.service.hash": "f49280e1f709117b76693b638834791e4f4ef0fd" + }, + "publicEndpoints": [ + { + "ipAddress": "172.30.0.101", + "port": 80, + "serviceId": "1s3", + "hostId": "1h1", + "instanceId": "1i5" + } + ], + "removed": null, + "retainIp": null, + "scale": 1, + "scalePolicy": null, + "secondaryLaunchConfigs": [], + "selectorContainer": null, + "selectorLink": null, + "startOnCreate": false, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "upgrade": null, + "uuid": "c2ce7050-e5b5-42c7-a9fb-8ed8d33a4884", + "vip": null + }, + { + "id": "1s6", + "type": "service", + "links": { + "self": "http://172.30.0.100:8080/v1/services/1s6", + "account": "http://172.30.0.100:8080/v1/services/1s6/account", + "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s6/consumedbyservices", + "consumedservices": "http://172.30.0.100:8080/v1/services/1s6/consumedservices", + "environment": "http://172.30.0.100:8080/v1/services/1s6/environment", + "instances": "http://172.30.0.100:8080/v1/services/1s6/instances", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s6/serviceexposemaps", + "containerStats": "http://172.30.0.100:8080/v1/services/1s6/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/services/1s6/?action=update", + "restart": "http://172.30.0.100:8080/v1/services/1s6/?action=restart", + "remove": "http://172.30.0.100:8080/v1/services/1s6/?action=remove", + "setservicelinks": "http://172.30.0.100:8080/v1/services/1s6/?action=setservicelinks", + "removeservicelink": "http://172.30.0.100:8080/v1/services/1s6/?action=removeservicelink", + "upgrade": "http://172.30.0.100:8080/v1/services/1s6/?action=upgrade", + "addservicelink": "http://172.30.0.100:8080/v1/services/1s6/?action=addservicelink", + "deactivate": "http://172.30.0.100:8080/v1/services/1s6/?action=deactivate" + }, + "name": "123", + "state": "active", + "accountId": "1a5", + "assignServiceIpAddress": false, + "createIndex": 1, + "created": "2016-09-22T18:28:04Z", + "createdTS": 1474568884000, + "currentScale": 1, + "description": null, + "environmentId": "1e2", + "externalId": null, + "fqdn": null, + "healthState": "healthy", + "kind": "service", + "launchConfig": { + "capAdd": [], + "capDrop": [], + "count": null, + "cpuSet": null, + "cpuShares": null, + "dataVolumes": [], + "dataVolumesFrom": [], + "description": null, + "devices": [], + "dns": [], + "dnsSearch": [], + "domainName": null, + "hostname": null, + "imageUuid": "docker:ubuntu:trusty", + "kind": "container", + "labels": { + "io.rancher.container.pull_image": "always" + }, + "logConfig": { + "config": {}, + "driver": "" + }, + "memory": null, + "memoryMb": null, + "memorySwap": null, + "networkMode": "managed", + "pidMode": null, + "ports": [], + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "requestedIpAddress": null, + "startOnCreate": true, + "stdinOpen": true, + "tty": true, + "user": null, + "userdata": null, + "version": "0bdea468-c3e9-4562-951c-d543958e966a", + "volumeDriver": null, + "workingDir": null, + "dataVolumesFromLaunchConfigs": [], + "networkLaunchConfig": null, + "vcpu": 1 + }, + "metadata": null, + "publicEndpoints": null, + "removed": null, + "retainIp": null, + "scale": 1, + "scalePolicy": null, + "secondaryLaunchConfigs": [], + "selectorContainer": null, + "selectorLink": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "upgrade": { + "inServiceStrategy": { + "batchSize": 1, + "intervalMillis": 2000, + "launchConfig": { + "capAdd": [], + "capDrop": [], + "count": null, + "cpuSet": null, + "cpuShares": null, + "dataVolumes": [], + "dataVolumesFrom": [], + "description": null, + "devices": [], + "dns": [], + "dnsSearch": [], + "domainName": null, + "hostname": null, + "imageUuid": "docker:ubuntu:trusty", + "kind": "container", + "labels": { + "io.rancher.container.pull_image": "always" + }, + "logConfig": { + "config": {}, + "driver": "" + }, + "memory": null, + "memoryMb": null, + "memorySwap": null, + "networkMode": "managed", + "pidMode": null, + "ports": [], + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "requestedIpAddress": null, + "startOnCreate": true, + "stdinOpen": true, + "tty": true, + "user": null, + "userdata": null, + "version": "0bdea468-c3e9-4562-951c-d543958e966a", + "volumeDriver": null, + "workingDir": null, + "dataVolumesFromLaunchConfigs": [], + "networkLaunchConfig": null, + "vcpu": 1 + }, + "previousLaunchConfig": { + "capAdd": [], + "capDrop": [], + "count": null, + "cpuSet": null, + "cpuShares": null, + "dataVolumes": [], + "dataVolumesFrom": [], + "description": null, + "devices": [], + "dns": [], + "dnsSearch": [], + "domainName": null, + "hostname": null, + "imageUuid": "docker:ubuntu:trusty", + "kind": "container", + "labels": { + "io.rancher.container.pull_image": "always" + }, + "logConfig": { + "config": {}, + "driver": "" + }, + "memory": null, + "memoryMb": null, + "memorySwap": null, + "networkMode": "managed", + "pidMode": null, + "ports": [], + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "requestedIpAddress": null, + "startOnCreate": true, + "stdinOpen": true, + "tty": true, + "user": null, + "userdata": null, + "version": "0", + "volumeDriver": null, + "workingDir": null, + "dataVolumesFromLaunchConfigs": [], + "networkLaunchConfig": null, + "vcpu": 1 + }, + "previousSecondaryLaunchConfigs": [], + "secondaryLaunchConfigs": [], + "startFirst": true + }, + "toServiceStrategy": null + }, + "uuid": "c0ae4d08-e20a-45ef-9fb9-ad9f7cdeeb15", + "vip": null + } + ], + "sortLinks": { + "accountId": "http://172.30.0.100:8080/v1/services?limit=4&sort=accountId", + "createIndex": "http://172.30.0.100:8080/v1/services?limit=4&sort=createIndex", + "created": "http://172.30.0.100:8080/v1/services?limit=4&sort=created", + "description": "http://172.30.0.100:8080/v1/services?limit=4&sort=description", + "environmentId": "http://172.30.0.100:8080/v1/services?limit=4&sort=environmentId", + "externalId": "http://172.30.0.100:8080/v1/services?limit=4&sort=externalId", + "healthState": "http://172.30.0.100:8080/v1/services?limit=4&sort=healthState", + "id": "http://172.30.0.100:8080/v1/services?limit=4&sort=id", + "kind": "http://172.30.0.100:8080/v1/services?limit=4&sort=kind", + "name": "http://172.30.0.100:8080/v1/services?limit=4&sort=name", + "removeTime": "http://172.30.0.100:8080/v1/services?limit=4&sort=removeTime", + "removed": "http://172.30.0.100:8080/v1/services?limit=4&sort=removed", + "selectorContainer": "http://172.30.0.100:8080/v1/services?limit=4&sort=selectorContainer", + "selectorLink": "http://172.30.0.100:8080/v1/services?limit=4&sort=selectorLink", + "state": "http://172.30.0.100:8080/v1/services?limit=4&sort=state", + "uuid": "http://172.30.0.100:8080/v1/services?limit=4&sort=uuid", + "vip": "http://172.30.0.100:8080/v1/services?limit=4&sort=vip" + }, + "pagination": { + "first": null, + "previous": null, + "next": "http://172.30.0.100:8080/v1/services?limit=4&marker=m4", + "limit": 4, + "total": null, + "partial": true + }, + "sort": null, + "filters": { + "accountId": null, + "createIndex": null, + "created": null, + "description": null, + "environmentId": null, + "externalId": null, + "healthState": null, + "id": null, + "kind": null, + "name": null, + "removeTime": null, + "removed": null, + "selectorContainer": null, + "selectorLink": null, + "state": null, + "uuid": null, + "vip": null + }, + "createDefaults": {} +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/ex_list_stacks.json b/libcloud/test/container/fixtures/rancher/ex_list_stacks.json new file mode 100644 index 0000000000..d2d1c3c42e --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/ex_list_stacks.json @@ -0,0 +1,310 @@ +{ + "type": "collection", + "resourceType": "environment", + "links": { + "self": "http://172.30.0.100:8080/v1/environments" + }, + "createTypes": { + "composeProject": "http://172.30.0.100:8080/v1/composeprojects", + "environment": "http://172.30.0.100:8080/v1/environments" + }, + "actions": {}, + "data": [ + { + "id": "1e1", + "type": "environment", + "links": { + "self": "http://172.30.0.100:8080/v1/environments/1e1", + "account": "http://172.30.0.100:8080/v1/environments/1e1/account", + "services": "http://172.30.0.100:8080/v1/environments/1e1/services", + "composeConfig": "http://172.30.0.100:8080/v1/environments/1e1/composeconfig" + }, + "actions": { + "upgrade": "http://172.30.0.100:8080/v1/environments/1e1/?action=upgrade", + "update": "http://172.30.0.100:8080/v1/environments/1e1/?action=update", + "remove": "http://172.30.0.100:8080/v1/environments/1e1/?action=remove", + "addoutputs": "http://172.30.0.100:8080/v1/environments/1e1/?action=addoutputs", + "activateservices": "http://172.30.0.100:8080/v1/environments/1e1/?action=activateservices", + "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e1/?action=deactivateservices", + "exportconfig": "http://172.30.0.100:8080/v1/environments/1e1/?action=exportconfig" + }, + "name": "Concrete5", + "state": "active", + "accountId": "1a5", + "created": "2016-09-22T17:58:53Z", + "createdTS": 1474567133000, + "description": null, + "dockerCompose": "CMSMysql:\r\n environment:\r\n MYSQL_ROOT_PASSWORD: ${root_password}\r\n MYSQL_DATABASE: ${db_name}\r\n MYSQL_USER: ${db_username}\r\n MYSQL_PASSWORD: ${db_password}\r\n labels:\r\n io.rancher.container.pull_image: always\r\n tty: true\r\n image: mysql\r\n volumes:\r\n - ${db_data_location}:/var/lib/mysql\r\n stdin_open: true\r\n volume_driver: ${volume_driver}\r\n\r\nCMSConfig:\r\n image: opensaas/concrete5\r\n tty: true\r\n stdin_open: true\r\n links:\r\n - CMSMysql:mysql\r\n volumes:\r\n - ${cms_application_data}:/var/www/html/application\r\n - ${cms_packages_data}:/var/www/html/packages\r\n labels:\r\n io.rancher.container.hostname_override: container_name\r\n io.rancher.container.start_once: true\r\n volume_driver: ${volume_driver}\r\n command: bash -c \"chown -R www-data. application; chown -R www-data. packages; sleep 2m; php -f concrete/bin/concrete5.php c5:install --db-server=mysql --db-username=${db_username} --db-password=${db_password} --db-database=${db_name} --site=${cms_sitename} --admin-email=${cms_admin_email} --admin-password=${cms_admin_password} -n -vvv\"\r\n\r\nConcrete5App:\r\n labels:\r\n io.rancher.container.pull_image: always\r\n io.rancher.sidekicks: CMSConfig\r\n tty: true\r\n links:\r\n - CMSMysql:mysql\r\n image: opensaas/concrete5\r\n volumes:\r\n - ${cms_application_data}:/var/www/html/application\r\n - ${cms_packages_data}:/var/www/html/packages\r\n volume_driver: ${volume_driver}\r\n stdin_open: true", + "environment": { + "root_password": "password", + "db_name": "CMS_DB", + "db_username": "CMS_USER", + "db_password": "password", + "db_data_location": "CMS_DB_DATA", + "volume_driver": "", + "cms_application_data": "CMS_APP_DATA", + "cms_packages_data": "CMS_PACK_DATA", + "cms_admin_email": "admin@example.com", + "cms_admin_password": "password", + "cms_sitename": "MySite" + }, + "externalId": "catalog://community:Concrete5:1", + "healthState": "healthy", + "kind": "environment", + "outputs": null, + "previousEnvironment": null, + "previousExternalId": null, + "rancherCompose": ".catalog:\r\n name: \"Concrete5\"\r\n version: \"v0.2\"\r\n description: \"Concrete5 CMS\"\r\n uuid: Concrete5-1\r\n minimum_rancher_version: v0.51.0\r\n questions:\r\n - variable: root_password\r\n description: \"MySQL root password - keep this password complex and secure\"\r\n label: \"MySQL Root Password\"\r\n required: true\r\n default: \"password\"\r\n type: \"string\"\r\n - variable: db_name\r\n description: \"MySQL Database Name - to use in the Concrete5 setup\"\r\n label: \"MySQL Database Name\"\r\n required: true\r\n default: \"CMS_DB\"\r\n type: \"string\"\r\n - variable: db_username\r\n description: \"MySQL Username - to use in the Concrete5 setup\"\r\n label: \"MySQL Username\"\r\n required: true\r\n default: \"CMS_USER\"\r\n type: \"string\"\r\n - variable: db_password\r\n description: \"MySQL password for the above user - to use in the Concrete5 setup\"\r\n label: \"MySQL Password\"\r\n required: true\r\n default: \"password\"\r\n type: \"string\"\r\n - variable: db_data_location\r\n description: \"Location on the host for the database files\"\r\n label: \"DB Data Location\"\r\n required: true\r\n default: \"CMS_DB_DATA\"\r\n type: \"string\"\r\n - variable: volume_driver\r\n description: \"Volume Driver for the persistant data locations requires docker 1.7\"\r\n label: \"Volume Driver\"\r\n type: \"string\"\r\n - variable: cms_application_data\r\n description: \"Concrcte5 application folder for persistant data storage\"\r\n label: \"Application Folder\"\r\n required: true\r\n default: \"CMS_APP_DATA\"\r\n type: \"string\"\r\n - variable: cms_packages_data\r\n description: \"Concrcte5 packages folder for persistant data storage\"\r\n label: \"Packages Folder\"\r\n required: true\r\n default: \"CMS_PACK_DATA\"\r\n type: \"string\"\r\n - variable: cms_admin_email\r\n description: \"Concrcete5 admin email address\"\r\n label: \"Admin Email\"\r\n required: true\r\n default: \"admin@example.com\"\r\n type: \"string\"\r\n - variable: cms_admin_password\r\n description: \"Concrcete5 admin password\"\r\n label: \"Admin Password\"\r\n required: true\r\n default: \"password\"\r\n type: \"string\"\r\n - variable: cms_sitename\r\n description: \"Concrcete5 Sitename\"\r\n label: \"Sitename\"\r\n required: true\r\n default: \"MySite\"\r\n type: \"string\"\r\nCMSMysql:\r\n scale: 1\r\nConcrete5App:\r\n scale: 1\r\n\r\n", + "removed": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "uuid": "e129ed27-3823-4e2e-af62-4565d68995d4" + }, + { + "id": "1e2", + "type": "environment", + "links": { + "self": "http://172.30.0.100:8080/v1/environments/1e2", + "account": "http://172.30.0.100:8080/v1/environments/1e2/account", + "services": "http://172.30.0.100:8080/v1/environments/1e2/services", + "composeConfig": "http://172.30.0.100:8080/v1/environments/1e2/composeconfig" + }, + "actions": { + "upgrade": "http://172.30.0.100:8080/v1/environments/1e2/?action=upgrade", + "update": "http://172.30.0.100:8080/v1/environments/1e2/?action=update", + "remove": "http://172.30.0.100:8080/v1/environments/1e2/?action=remove", + "addoutputs": "http://172.30.0.100:8080/v1/environments/1e2/?action=addoutputs", + "activateservices": "http://172.30.0.100:8080/v1/environments/1e2/?action=activateservices", + "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e2/?action=deactivateservices", + "exportconfig": "http://172.30.0.100:8080/v1/environments/1e2/?action=exportconfig" + }, + "name": "ghost", + "state": "active", + "accountId": "1a5", + "created": "2016-09-22T18:00:25Z", + "createdTS": 1474567225000, + "description": null, + "dockerCompose": "ghost:\n image: ghost\n ports:\n - ${public_port}:2368\n", + "environment": { + "public_port": "80" + }, + "externalId": "catalog://community:ghost:0", + "healthState": "healthy", + "kind": "environment", + "outputs": null, + "previousEnvironment": null, + "previousExternalId": null, + "rancherCompose": ".catalog:\n name: \"Ghost\"\n version: \"v0.1-educaas\"\n description: \"Blog powered by Ghost. Requires no database\"\n uuid: ghost-0\n minimum_rancher_version: v0.51.0\n questions:\n - variable: public_port\n description: \"public port to access the blog\"\n label: \"Public Port\"\n required: true\n default: \"80\"\n type: \"int\"\nghost:\n", + "removed": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "uuid": "4c335202-2ca7-41f1-8702-4984518566ec" + }, + { + "id": "1e5", + "type": "environment", + "links": { + "self": "http://172.30.0.100:8080/v1/environments/1e5", + "account": "http://172.30.0.100:8080/v1/environments/1e5/account", + "services": "http://172.30.0.100:8080/v1/environments/1e5/services", + "composeConfig": "http://172.30.0.100:8080/v1/environments/1e5/composeconfig" + }, + "actions": { + "upgrade": "http://172.30.0.100:8080/v1/environments/1e5/?action=upgrade", + "update": "http://172.30.0.100:8080/v1/environments/1e5/?action=update", + "remove": "http://172.30.0.100:8080/v1/environments/1e5/?action=remove", + "addoutputs": "http://172.30.0.100:8080/v1/environments/1e5/?action=addoutputs", + "activateservices": "http://172.30.0.100:8080/v1/environments/1e5/?action=activateservices", + "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e5/?action=deactivateservices", + "exportconfig": "http://172.30.0.100:8080/v1/environments/1e5/?action=exportconfig" + }, + "name": "heyk", + "state": "active", + "accountId": "1a5", + "created": "2016-09-29T20:40:14Z", + "createdTS": 1475181614000, + "description": null, + "dockerCompose": null, + "environment": null, + "externalId": null, + "healthState": "healthy", + "kind": "environment", + "outputs": null, + "previousEnvironment": null, + "previousExternalId": null, + "rancherCompose": null, + "removed": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "uuid": "d5a39304-9247-4a31-8662-7dba98238105" + }, + { + "id": "1e6", + "type": "environment", + "links": { + "self": "http://172.30.0.100:8080/v1/environments/1e6", + "account": "http://172.30.0.100:8080/v1/environments/1e6/account", + "services": "http://172.30.0.100:8080/v1/environments/1e6/services", + "composeConfig": "http://172.30.0.100:8080/v1/environments/1e6/composeconfig" + }, + "actions": { + "upgrade": "http://172.30.0.100:8080/v1/environments/1e6/?action=upgrade", + "update": "http://172.30.0.100:8080/v1/environments/1e6/?action=update", + "remove": "http://172.30.0.100:8080/v1/environments/1e6/?action=remove", + "addoutputs": "http://172.30.0.100:8080/v1/environments/1e6/?action=addoutputs", + "activateservices": "http://172.30.0.100:8080/v1/environments/1e6/?action=activateservices", + "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e6/?action=deactivateservices", + "exportconfig": "http://172.30.0.100:8080/v1/environments/1e6/?action=exportconfig" + }, + "name": "ilikegurls", + "state": "active", + "accountId": "1a5", + "created": "2016-10-06T00:40:23Z", + "createdTS": 1475714423000, + "description": null, + "dockerCompose": null, + "environment": null, + "externalId": null, + "healthState": "healthy", + "kind": "environment", + "outputs": null, + "previousEnvironment": null, + "previousExternalId": null, + "rancherCompose": null, + "removed": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "uuid": "19101511-6dcb-49f7-a8e1-063bcded1956" + }, + { + "id": "1e7", + "type": "environment", + "links": { + "self": "http://172.30.0.100:8080/v1/environments/1e7", + "account": "http://172.30.0.100:8080/v1/environments/1e7/account", + "services": "http://172.30.0.100:8080/v1/environments/1e7/services", + "composeConfig": "http://172.30.0.100:8080/v1/environments/1e7/composeconfig" + }, + "actions": { + "upgrade": "http://172.30.0.100:8080/v1/environments/1e7/?action=upgrade", + "update": "http://172.30.0.100:8080/v1/environments/1e7/?action=update", + "remove": "http://172.30.0.100:8080/v1/environments/1e7/?action=remove", + "addoutputs": "http://172.30.0.100:8080/v1/environments/1e7/?action=addoutputs", + "activateservices": "http://172.30.0.100:8080/v1/environments/1e7/?action=activateservices", + "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e7/?action=deactivateservices", + "exportconfig": "http://172.30.0.100:8080/v1/environments/1e7/?action=exportconfig" + }, + "name": "maybethisyear", + "state": "active", + "accountId": "1a5", + "created": "2016-10-06T00:41:17Z", + "createdTS": 1475714477000, + "description": null, + "dockerCompose": null, + "environment": null, + "externalId": null, + "healthState": "healthy", + "kind": "environment", + "outputs": null, + "previousEnvironment": null, + "previousExternalId": null, + "rancherCompose": null, + "removed": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "uuid": "250c66f6-cd36-4c12-8767-deb5c35d0a05" + }, + { + "id": "1e8", + "type": "environment", + "links": { + "self": "http://172.30.0.100:8080/v1/environments/1e8", + "account": "http://172.30.0.100:8080/v1/environments/1e8/account", + "services": "http://172.30.0.100:8080/v1/environments/1e8/services", + "composeConfig": "http://172.30.0.100:8080/v1/environments/1e8/composeconfig" + }, + "actions": { + "upgrade": "http://172.30.0.100:8080/v1/environments/1e8/?action=upgrade", + "update": "http://172.30.0.100:8080/v1/environments/1e8/?action=update", + "remove": "http://172.30.0.100:8080/v1/environments/1e8/?action=remove", + "addoutputs": "http://172.30.0.100:8080/v1/environments/1e8/?action=addoutputs", + "activateservices": "http://172.30.0.100:8080/v1/environments/1e8/?action=activateservices", + "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e8/?action=deactivateservices", + "exportconfig": "http://172.30.0.100:8080/v1/environments/1e8/?action=exportconfig" + }, + "name": "oh-another", + "state": "active", + "accountId": "1a5", + "created": "2016-10-06T00:51:34Z", + "createdTS": 1475715094000, + "description": null, + "dockerCompose": null, + "environment": null, + "externalId": null, + "healthState": "healthy", + "kind": "environment", + "outputs": null, + "previousEnvironment": null, + "previousExternalId": null, + "rancherCompose": null, + "removed": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "uuid": "a777dd5e-e524-43c8-8783-d7bb14bcffb6" + } + ], + "sortLinks": { + "accountId": "http://172.30.0.100:8080/v1/environments?limit=6&sort=accountId", + "created": "http://172.30.0.100:8080/v1/environments?limit=6&sort=created", + "description": "http://172.30.0.100:8080/v1/environments?limit=6&sort=description", + "externalId": "http://172.30.0.100:8080/v1/environments?limit=6&sort=externalId", + "healthState": "http://172.30.0.100:8080/v1/environments?limit=6&sort=healthState", + "id": "http://172.30.0.100:8080/v1/environments?limit=6&sort=id", + "kind": "http://172.30.0.100:8080/v1/environments?limit=6&sort=kind", + "name": "http://172.30.0.100:8080/v1/environments?limit=6&sort=name", + "removeTime": "http://172.30.0.100:8080/v1/environments?limit=6&sort=removeTime", + "removed": "http://172.30.0.100:8080/v1/environments?limit=6&sort=removed", + "state": "http://172.30.0.100:8080/v1/environments?limit=6&sort=state", + "uuid": "http://172.30.0.100:8080/v1/environments?limit=6&sort=uuid" + }, + "pagination": { + "first": null, + "previous": null, + "next": "http://172.30.0.100:8080/v1/environments?limit=6&marker=m6", + "limit": 6, + "total": null, + "partial": true + }, + "sort": null, + "filters": { + "accountId": null, + "created": null, + "description": null, + "externalId": null, + "healthState": [ + { + "modifier": "eq", + "value": "healthy" + } + ], "id": null, + "kind": null, + "name": null, + "removeTime": null, + "removed": null, + "state": null, + "uuid": null + }, + "createDefaults": {} +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/ex_search_containers.json b/libcloud/test/container/fixtures/rancher/ex_search_containers.json new file mode 100644 index 0000000000..8cd05659e8 --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/ex_search_containers.json @@ -0,0 +1,212 @@ +{ + "type": "collection", + "resourceType": "container", + "links": { + "self": "http://172.30.0.100:8080/v1/containers" + }, + "createTypes": { + "container": "http://172.30.0.100:8080/v1/containers", + "launchConfig": "http://172.30.0.100:8080/v1/launchconfigs", + "virtualMachine": "http://172.30.0.100:8080/v1/virtualmachines" + }, + "actions": {}, + "data": [ + { + "id": "1i2", + "type": "container", + "links": { + "self": "http://172.30.0.100:8080/v1/containers/1i2", + "account": "http://172.30.0.100:8080/v1/containers/1i2/account", + "credentials": "http://172.30.0.100:8080/v1/containers/1i2/credentials", + "healthcheckInstanceHostMaps": "http://172.30.0.100:8080/v1/containers/1i2/healthcheckinstancehostmaps", + "hosts": "http://172.30.0.100:8080/v1/containers/1i2/hosts", + "instanceLabels": "http://172.30.0.100:8080/v1/containers/1i2/instancelabels", + "instanceLinks": "http://172.30.0.100:8080/v1/containers/1i2/instancelinks", + "instances": "http://172.30.0.100:8080/v1/containers/1i2/instances", + "mounts": "http://172.30.0.100:8080/v1/containers/1i2/mounts", + "ports": "http://172.30.0.100:8080/v1/containers/1i2/ports", + "serviceEvents": "http://172.30.0.100:8080/v1/containers/1i2/serviceevents", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/containers/1i2/serviceexposemaps", + "services": "http://172.30.0.100:8080/v1/containers/1i2/services", + "targetInstanceLinks": "http://172.30.0.100:8080/v1/containers/1i2/targetinstancelinks", + "volumes": "http://172.30.0.100:8080/v1/containers/1i2/volumes", + "stats": "http://172.30.0.100:8080/v1/containers/1i2/stats", + "containerStats": "http://172.30.0.100:8080/v1/containers/1i2/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/containers/1i2/?action=update", + "stop": "http://172.30.0.100:8080/v1/containers/1i2/?action=stop", + "restart": "http://172.30.0.100:8080/v1/containers/1i2/?action=restart", + "migrate": "http://172.30.0.100:8080/v1/containers/1i2/?action=migrate", + "logs": "http://172.30.0.100:8080/v1/containers/1i2/?action=logs", + "setlabels": "http://172.30.0.100:8080/v1/containers/1i2/?action=setlabels", + "execute": "http://172.30.0.100:8080/v1/containers/1i2/?action=execute", + "proxy": "http://172.30.0.100:8080/v1/containers/1i2/?action=proxy" + }, + "name": "Network Agent", + "state": "running", + "accountId": "1a5", + "blkioDeviceOptions": null, + "build": null, + "capAdd": null, + "capDrop": null, + "command": null, + "cpuSet": null, + "cpuShares": null, + "createIndex": null, + "created": "2016-09-22T17:58:57Z", + "createdTS": 1474567137000, + "dataVolumeMounts": {}, + "dataVolumes": [ + "/var/lib/rancher/etc:/var/lib/rancher/etc:ro" + ], + "dataVolumesFrom": null, + "deploymentUnitUuid": null, + "description": null, + "devices": null, + "dns": null, + "dnsSearch": null, + "domainName": null, + "entryPoint": null, + "environment": null, + "expose": null, + "externalId": "129c67adc9fa084fbc8e1f963db0180896b88af3dca69c7e8fe0493284e4651c", + "extraHosts": null, + "firstRunning": "2016-09-22T17:59:11Z", + "firstRunningTS": 1474567151000, + "healthCheck": null, + "healthState": null, + "hostId": "1h1", + "hostname": null, + "imageUuid": "docker:rancher/agent-instance:v0.8.3", + "kind": "container", + "labels": { + "io.rancher.container.system": "NetworkAgent", + "io.rancher.container.uuid": "b0f88089-d28b-4388-93a7-889b750cd7cb", + "io.rancher.container.name": "Network Agent", + "io.rancher.container.agent_id": "2", + "io.rancher.container.ip": "10.42.247.188/16" + }, + "logConfig": null, + "lxcConf": null, + "memory": null, + "memorySwap": null, + "nativeContainer": false, + "networkContainerId": null, + "networkIds": [], + "networkMode": null, + "pidMode": null, + "ports": null, + "primaryIpAddress": "10.42.247.188", + "privileged": true, + "publishAllPorts": false, + "readOnly": false, + "registryCredentialId": null, + "removed": null, + "requestedHostId": null, + "restartPolicy": null, + "securityOpt": null, + "startCount": 3, + "startOnCreate": true, + "stdinOpen": false, + "systemContainer": "NetworkAgent", + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "tty": false, + "user": null, + "uuid": "b0f88089-d28b-4388-93a7-889b750cd7cb", + "version": "0", + "volumeDriver": null, + "workingDir": null + } + ], + "sortLinks": { + "accountId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=accountId", + "agentId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=agentId", + "allocationState": "http://172.30.0.100:8080/v1/containers?limit=2&sort=allocationState", + "compute": "http://172.30.0.100:8080/v1/containers?limit=2&sort=compute", + "createIndex": "http://172.30.0.100:8080/v1/containers?limit=2&sort=createIndex", + "created": "http://172.30.0.100:8080/v1/containers?limit=2&sort=created", + "deploymentUnitUuid": "http://172.30.0.100:8080/v1/containers?limit=2&sort=deploymentUnitUuid", + "description": "http://172.30.0.100:8080/v1/containers?limit=2&sort=description", + "dnsInternal": "http://172.30.0.100:8080/v1/containers?limit=2&sort=dnsInternal", + "dnsSearchInternal": "http://172.30.0.100:8080/v1/containers?limit=2&sort=dnsSearchInternal", + "domain": "http://172.30.0.100:8080/v1/containers?limit=2&sort=domain", + "externalId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=externalId", + "firstRunning": "http://172.30.0.100:8080/v1/containers?limit=2&sort=firstRunning", + "healthState": "http://172.30.0.100:8080/v1/containers?limit=2&sort=healthState", + "healthUpdated": "http://172.30.0.100:8080/v1/containers?limit=2&sort=healthUpdated", + "hostname": "http://172.30.0.100:8080/v1/containers?limit=2&sort=hostname", + "id": "http://172.30.0.100:8080/v1/containers?limit=2&sort=id", + "imageId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=imageId", + "instanceTriggeredStop": "http://172.30.0.100:8080/v1/containers?limit=2&sort=instanceTriggeredStop", + "kind": "http://172.30.0.100:8080/v1/containers?limit=2&sort=kind", + "memoryMb": "http://172.30.0.100:8080/v1/containers?limit=2&sort=memoryMb", + "name": "http://172.30.0.100:8080/v1/containers?limit=2&sort=name", + "nativeContainer": "http://172.30.0.100:8080/v1/containers?limit=2&sort=nativeContainer", + "networkContainerId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=networkContainerId", + "offeringId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=offeringId", + "registryCredentialId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=registryCredentialId", + "removeTime": "http://172.30.0.100:8080/v1/containers?limit=2&sort=removeTime", + "removed": "http://172.30.0.100:8080/v1/containers?limit=2&sort=removed", + "serviceIndexId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=serviceIndexId", + "startCount": "http://172.30.0.100:8080/v1/containers?limit=2&sort=startCount", + "state": "http://172.30.0.100:8080/v1/containers?limit=2&sort=state", + "systemContainer": "http://172.30.0.100:8080/v1/containers?limit=2&sort=systemContainer", + "token": "http://172.30.0.100:8080/v1/containers?limit=2&sort=token", + "userdata": "http://172.30.0.100:8080/v1/containers?limit=2&sort=userdata", + "uuid": "http://172.30.0.100:8080/v1/containers?limit=2&sort=uuid", + "version": "http://172.30.0.100:8080/v1/containers?limit=2&sort=version", + "zoneId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=zoneId" + }, + "pagination": { + "first": null, + "previous": null, + "next": "http://172.30.0.100:8080/v1/containers?limit=2&marker=m2", + "limit": 2, + "total": null, + "partial": true + }, + "sort": null, + "filters": { + "accountId": null, + "agentId": null, + "allocationState": null, + "compute": null, + "createIndex": null, + "created": null, + "deploymentUnitUuid": null, + "description": null, + "dnsInternal": null, + "dnsSearchInternal": null, + "domain": null, + "externalId": null, + "firstRunning": null, + "healthState": null, + "healthUpdated": null, + "hostname": null, + "id": null, + "imageId": null, + "instanceTriggeredStop": null, + "kind": null, + "memoryMb": null, + "name": null, + "nativeContainer": null, + "networkContainerId": null, + "offeringId": null, + "registryCredentialId": null, + "removeTime": null, + "removed": null, + "serviceIndexId": null, + "startCount": null, + "state": null, + "systemContainer": null, + "token": null, + "userdata": null, + "uuid": null, + "version": null, + "zoneId": null + }, + "createDefaults": {} +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/ex_search_services.json b/libcloud/test/container/fixtures/rancher/ex_search_services.json new file mode 100644 index 0000000000..56be671269 --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/ex_search_services.json @@ -0,0 +1,346 @@ +{ + "type": "collection", + "resourceType": "service", + "links": { + "self": "http://172.30.0.100:8080/v1/services" + }, + "createTypes": { + "dnsService": "http://172.30.0.100:8080/v1/dnsservices", + "externalService": "http://172.30.0.100:8080/v1/externalservices", + "loadBalancerService": "http://172.30.0.100:8080/v1/loadbalancerservices", + "service": "http://172.30.0.100:8080/v1/services" + }, + "actions": {}, + "data": [ + { + "id": "1s3", + "type": "service", + "links": { + "self": "http://172.30.0.100:8080/v1/services/1s3", + "account": "http://172.30.0.100:8080/v1/services/1s3/account", + "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s3/consumedbyservices", + "consumedservices": "http://172.30.0.100:8080/v1/services/1s3/consumedservices", + "environment": "http://172.30.0.100:8080/v1/services/1s3/environment", + "instances": "http://172.30.0.100:8080/v1/services/1s3/instances", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s3/serviceexposemaps", + "containerStats": "http://172.30.0.100:8080/v1/services/1s3/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/services/1s3/?action=update", + "restart": "http://172.30.0.100:8080/v1/services/1s3/?action=restart", + "remove": "http://172.30.0.100:8080/v1/services/1s3/?action=remove", + "setservicelinks": "http://172.30.0.100:8080/v1/services/1s3/?action=setservicelinks", + "removeservicelink": "http://172.30.0.100:8080/v1/services/1s3/?action=removeservicelink", + "upgrade": "http://172.30.0.100:8080/v1/services/1s3/?action=upgrade", + "addservicelink": "http://172.30.0.100:8080/v1/services/1s3/?action=addservicelink", + "deactivate": "http://172.30.0.100:8080/v1/services/1s3/?action=deactivate" + }, + "name": "ghost", + "state": "active", + "accountId": "1a5", + "assignServiceIpAddress": false, + "createIndex": 1, + "created": "2016-09-22T18:00:26Z", + "createdTS": 1474567226000, + "currentScale": 1, + "description": null, + "environmentId": "1e2", + "externalId": null, + "fqdn": null, + "healthState": "healthy", + "kind": "service", + "launchConfig": { + "imageUuid": "docker:ghost", + "kind": "container", + "labels": { + "io.rancher.service.hash": "af9b5ddd2891271b12a88129e2bc37ff57998182" + }, + "logConfig": {}, + "networkMode": "managed", + "ports": [ + "80:2368/tcp" + ], + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "startOnCreate": true, + "stdinOpen": false, + "tty": false, + "version": "0", + "vcpu": 1 + }, + "metadata": { + "io.rancher.service.hash": "f49280e1f709117b76693b638834791e4f4ef0fd" + }, + "publicEndpoints": [ + { + "ipAddress": "172.30.0.101", + "port": 80, + "serviceId": "1s3", + "hostId": "1h1", + "instanceId": "1i5" + } + ], + "removed": null, + "retainIp": null, + "scale": 1, + "scalePolicy": null, + "secondaryLaunchConfigs": [], + "selectorContainer": null, + "selectorLink": null, + "startOnCreate": false, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "upgrade": null, + "uuid": "c2ce7050-e5b5-42c7-a9fb-8ed8d33a4884", + "vip": null + }, + { + "id": "1s6", + "type": "service", + "links": { + "self": "http://172.30.0.100:8080/v1/services/1s6", + "account": "http://172.30.0.100:8080/v1/services/1s6/account", + "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s6/consumedbyservices", + "consumedservices": "http://172.30.0.100:8080/v1/services/1s6/consumedservices", + "environment": "http://172.30.0.100:8080/v1/services/1s6/environment", + "instances": "http://172.30.0.100:8080/v1/services/1s6/instances", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s6/serviceexposemaps", + "containerStats": "http://172.30.0.100:8080/v1/services/1s6/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/services/1s6/?action=update", + "restart": "http://172.30.0.100:8080/v1/services/1s6/?action=restart", + "remove": "http://172.30.0.100:8080/v1/services/1s6/?action=remove", + "setservicelinks": "http://172.30.0.100:8080/v1/services/1s6/?action=setservicelinks", + "removeservicelink": "http://172.30.0.100:8080/v1/services/1s6/?action=removeservicelink", + "upgrade": "http://172.30.0.100:8080/v1/services/1s6/?action=upgrade", + "addservicelink": "http://172.30.0.100:8080/v1/services/1s6/?action=addservicelink", + "deactivate": "http://172.30.0.100:8080/v1/services/1s6/?action=deactivate" + }, + "name": "123", + "state": "active", + "accountId": "1a5", + "assignServiceIpAddress": false, + "createIndex": 1, + "created": "2016-09-22T18:28:04Z", + "createdTS": 1474568884000, + "currentScale": 1, + "description": null, + "environmentId": "1e2", + "externalId": null, + "fqdn": null, + "healthState": "healthy", + "kind": "service", + "launchConfig": { + "capAdd": [], + "capDrop": [], + "count": null, + "cpuSet": null, + "cpuShares": null, + "dataVolumes": [], + "dataVolumesFrom": [], + "description": null, + "devices": [], + "dns": [], + "dnsSearch": [], + "domainName": null, + "hostname": null, + "imageUuid": "docker:ubuntu:trusty", + "kind": "container", + "labels": { + "io.rancher.container.pull_image": "always" + }, + "logConfig": { + "config": {}, + "driver": "" + }, + "memory": null, + "memoryMb": null, + "memorySwap": null, + "networkMode": "managed", + "pidMode": null, + "ports": [], + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "requestedIpAddress": null, + "startOnCreate": true, + "stdinOpen": true, + "tty": true, + "user": null, + "userdata": null, + "version": "0bdea468-c3e9-4562-951c-d543958e966a", + "volumeDriver": null, + "workingDir": null, + "dataVolumesFromLaunchConfigs": [], + "networkLaunchConfig": null, + "vcpu": 1 + }, + "metadata": null, + "publicEndpoints": null, + "removed": null, + "retainIp": null, + "scale": 1, + "scalePolicy": null, + "secondaryLaunchConfigs": [], + "selectorContainer": null, + "selectorLink": null, + "startOnCreate": true, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "upgrade": { + "inServiceStrategy": { + "batchSize": 1, + "intervalMillis": 2000, + "launchConfig": { + "capAdd": [], + "capDrop": [], + "count": null, + "cpuSet": null, + "cpuShares": null, + "dataVolumes": [], + "dataVolumesFrom": [], + "description": null, + "devices": [], + "dns": [], + "dnsSearch": [], + "domainName": null, + "hostname": null, + "imageUuid": "docker:ubuntu:trusty", + "kind": "container", + "labels": { + "io.rancher.container.pull_image": "always" + }, + "logConfig": { + "config": {}, + "driver": "" + }, + "memory": null, + "memoryMb": null, + "memorySwap": null, + "networkMode": "managed", + "pidMode": null, + "ports": [], + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "requestedIpAddress": null, + "startOnCreate": true, + "stdinOpen": true, + "tty": true, + "user": null, + "userdata": null, + "version": "0bdea468-c3e9-4562-951c-d543958e966a", + "volumeDriver": null, + "workingDir": null, + "dataVolumesFromLaunchConfigs": [], + "networkLaunchConfig": null, + "vcpu": 1 + }, + "previousLaunchConfig": { + "capAdd": [], + "capDrop": [], + "count": null, + "cpuSet": null, + "cpuShares": null, + "dataVolumes": [], + "dataVolumesFrom": [], + "description": null, + "devices": [], + "dns": [], + "dnsSearch": [], + "domainName": null, + "hostname": null, + "imageUuid": "docker:ubuntu:trusty", + "kind": "container", + "labels": { + "io.rancher.container.pull_image": "always" + }, + "logConfig": { + "config": {}, + "driver": "" + }, + "memory": null, + "memoryMb": null, + "memorySwap": null, + "networkMode": "managed", + "pidMode": null, + "ports": [], + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "requestedIpAddress": null, + "startOnCreate": true, + "stdinOpen": true, + "tty": true, + "user": null, + "userdata": null, + "version": "0", + "volumeDriver": null, + "workingDir": null, + "dataVolumesFromLaunchConfigs": [], + "networkLaunchConfig": null, + "vcpu": 1 + }, + "previousSecondaryLaunchConfigs": [], + "secondaryLaunchConfigs": [], + "startFirst": true + }, + "toServiceStrategy": null + }, + "uuid": "c0ae4d08-e20a-45ef-9fb9-ad9f7cdeeb15", + "vip": null + } + ], + "sortLinks": { + "accountId": "http://172.30.0.100:8080/v1/services?limit=4&sort=accountId", + "createIndex": "http://172.30.0.100:8080/v1/services?limit=4&sort=createIndex", + "created": "http://172.30.0.100:8080/v1/services?limit=4&sort=created", + "description": "http://172.30.0.100:8080/v1/services?limit=4&sort=description", + "environmentId": "http://172.30.0.100:8080/v1/services?limit=4&sort=environmentId", + "externalId": "http://172.30.0.100:8080/v1/services?limit=4&sort=externalId", + "healthState": "http://172.30.0.100:8080/v1/services?limit=4&sort=healthState", + "id": "http://172.30.0.100:8080/v1/services?limit=4&sort=id", + "kind": "http://172.30.0.100:8080/v1/services?limit=4&sort=kind", + "name": "http://172.30.0.100:8080/v1/services?limit=4&sort=name", + "removeTime": "http://172.30.0.100:8080/v1/services?limit=4&sort=removeTime", + "removed": "http://172.30.0.100:8080/v1/services?limit=4&sort=removed", + "selectorContainer": "http://172.30.0.100:8080/v1/services?limit=4&sort=selectorContainer", + "selectorLink": "http://172.30.0.100:8080/v1/services?limit=4&sort=selectorLink", + "state": "http://172.30.0.100:8080/v1/services?limit=4&sort=state", + "uuid": "http://172.30.0.100:8080/v1/services?limit=4&sort=uuid", + "vip": "http://172.30.0.100:8080/v1/services?limit=4&sort=vip" + }, + "pagination": { + "first": null, + "previous": null, + "next": "http://172.30.0.100:8080/v1/services?limit=4&marker=m4", + "limit": 4, + "total": null, + "partial": true + }, + "sort": null, + "filters": { + "accountId": null, + "createIndex": null, + "created": null, + "description": null, + "environmentId": null, + "externalId": null, + "healthState": null, + "id": null, + "kind": null, + "name": null, + "removeTime": null, + "removed": null, + "selectorContainer": null, + "selectorLink": null, + "state": null, + "uuid": null, + "vip": null + }, + "createDefaults": {} +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/list_containers.json b/libcloud/test/container/fixtures/rancher/list_containers.json new file mode 100644 index 0000000000..e55d786379 --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/list_containers.json @@ -0,0 +1,336 @@ +{ + "type": "collection", + "resourceType": "container", + "links": { + "self": "http://172.30.0.100:8080/v1/containers" + }, + "createTypes": { + "container": "http://172.30.0.100:8080/v1/containers", + "launchConfig": "http://172.30.0.100:8080/v1/launchconfigs", + "virtualMachine": "http://172.30.0.100:8080/v1/virtualmachines" + }, + "actions": {}, + "data": [ + { + "id": "1i1", + "type": "container", + "links": { + "self": "http://172.30.0.100:8080/v1/containers/1i1", + "account": "http://172.30.0.100:8080/v1/containers/1i1/account", + "credentials": "http://172.30.0.100:8080/v1/containers/1i1/credentials", + "healthcheckInstanceHostMaps": "http://172.30.0.100:8080/v1/containers/1i1/healthcheckinstancehostmaps", + "hosts": "http://172.30.0.100:8080/v1/containers/1i1/hosts", + "instanceLabels": "http://172.30.0.100:8080/v1/containers/1i1/instancelabels", + "instanceLinks": "http://172.30.0.100:8080/v1/containers/1i1/instancelinks", + "instances": "http://172.30.0.100:8080/v1/containers/1i1/instances", + "mounts": "http://172.30.0.100:8080/v1/containers/1i1/mounts", + "ports": "http://172.30.0.100:8080/v1/containers/1i1/ports", + "serviceEvents": "http://172.30.0.100:8080/v1/containers/1i1/serviceevents", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/containers/1i1/serviceexposemaps", + "services": "http://172.30.0.100:8080/v1/containers/1i1/services", + "targetInstanceLinks": "http://172.30.0.100:8080/v1/containers/1i1/targetinstancelinks", + "volumes": "http://172.30.0.100:8080/v1/containers/1i1/volumes", + "stats": "http://172.30.0.100:8080/v1/containers/1i1/stats", + "containerStats": "http://172.30.0.100:8080/v1/containers/1i1/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/containers/1i1/?action=update", + "error": "http://172.30.0.100:8080/v1/containers/1i1/?action=error", + "remove": "http://172.30.0.100:8080/v1/containers/1i1/?action=remove", + "start": "http://172.30.0.100:8080/v1/containers/1i1/?action=start", + "logs": "http://172.30.0.100:8080/v1/containers/1i1/?action=logs", + "setlabels": "http://172.30.0.100:8080/v1/containers/1i1/?action=setlabels" + }, + "name": "Concrete5_CMSMysql_1", + "state": "stopped", + "accountId": "1a5", + "blkioDeviceOptions": null, + "build": null, + "capAdd": null, + "capDrop": null, + "command": null, + "cpuSet": null, + "cpuShares": null, + "createIndex": 1, + "created": "2016-09-22T17:58:55Z", + "createdTS": 1474567135000, + "dataVolumeMounts": {}, + "dataVolumes": [ + "CMS_DB_DATA:/var/lib/mysql" + ], + "dataVolumesFrom": null, + "deploymentUnitUuid": "761675e2-7fc7-4fbf-a825-132429a44349", + "description": null, + "devices": null, + "dns": [ + "169.254.169.250" + ], + "dnsSearch": [ + "concrete5.rancher.internal", + "cmsmysql.concrete5.rancher.internal", + "rancher.internal" + ], + "dockerPorts": [], + "domainName": null, + "entryPoint": null, + "environment": { + "MYSQL_DATABASE": "CMS_DB", + "MYSQL_PASSWORD": "password", + "MYSQL_ROOT_PASSWORD": "password", + "MYSQL_USER": "CMS_USER" + }, + "expose": null, + "externalId": "957136960bd1b51acf5a6c0079d0e35b8d5c14f54722a3063ceb868e85fd3758", + "extraHosts": null, + "firstRunning": "2016-09-22T17:59:40Z", + "firstRunningTS": 1474567180000, + "healthCheck": null, + "healthState": null, + "hostId": "1h1", + "hostname": null, + "imageUuid": "docker:mysql", + "kind": "container", + "labels": { + "io.rancher.project.name": "Concrete5", + "io.rancher.container.pull_image": "always", + "io.rancher.service.deployment.unit": "761675e2-7fc7-4fbf-a825-132429a44349", + "io.rancher.service.launch.config": "io.rancher.service.primary.launch.config", + "io.rancher.project_service.name": "Concrete5/CMSMysql", + "io.rancher.stack.name": "Concrete5", + "io.rancher.stack_service.name": "Concrete5/CMSMysql", + "io.rancher.service.hash": "c5d6bacef4be47a5ca5d1517a1d33319d024cdde", + "io.rancher.container.uuid": "a1140e7c-9260-423e-a7d0-8f5f7bb8e946", + "io.rancher.container.name": "Concrete5_CMSMysql_1", + "io.rancher.container.ip": "10.42.80.96/16" + }, + "logConfig": {}, + "lxcConf": null, + "memory": null, + "memorySwap": null, + "nativeContainer": false, + "networkContainerId": null, + "networkMode": "managed", + "pidMode": null, + "ports": null, + "primaryIpAddress": "10.42.80.96", + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "registryCredentialId": null, + "removed": null, + "requestedHostId": null, + "restartPolicy": null, + "securityOpt": null, + "startCount": 4, + "startOnCreate": true, + "stdinOpen": true, + "systemContainer": null, + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "tty": true, + "user": null, + "uuid": "a1140e7c-9260-423e-a7d0-8f5f7bb8e946", + "version": "0", + "volumeDriver": null, + "workingDir": null + }, + { + "id": "1i2", + "type": "container", + "links": { + "self": "http://172.30.0.100:8080/v1/containers/1i2", + "account": "http://172.30.0.100:8080/v1/containers/1i2/account", + "credentials": "http://172.30.0.100:8080/v1/containers/1i2/credentials", + "healthcheckInstanceHostMaps": "http://172.30.0.100:8080/v1/containers/1i2/healthcheckinstancehostmaps", + "hosts": "http://172.30.0.100:8080/v1/containers/1i2/hosts", + "instanceLabels": "http://172.30.0.100:8080/v1/containers/1i2/instancelabels", + "instanceLinks": "http://172.30.0.100:8080/v1/containers/1i2/instancelinks", + "instances": "http://172.30.0.100:8080/v1/containers/1i2/instances", + "mounts": "http://172.30.0.100:8080/v1/containers/1i2/mounts", + "ports": "http://172.30.0.100:8080/v1/containers/1i2/ports", + "serviceEvents": "http://172.30.0.100:8080/v1/containers/1i2/serviceevents", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/containers/1i2/serviceexposemaps", + "services": "http://172.30.0.100:8080/v1/containers/1i2/services", + "targetInstanceLinks": "http://172.30.0.100:8080/v1/containers/1i2/targetinstancelinks", + "volumes": "http://172.30.0.100:8080/v1/containers/1i2/volumes", + "stats": "http://172.30.0.100:8080/v1/containers/1i2/stats", + "containerStats": "http://172.30.0.100:8080/v1/containers/1i2/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/containers/1i2/?action=update", + "stop": "http://172.30.0.100:8080/v1/containers/1i2/?action=stop", + "restart": "http://172.30.0.100:8080/v1/containers/1i2/?action=restart", + "migrate": "http://172.30.0.100:8080/v1/containers/1i2/?action=migrate", + "logs": "http://172.30.0.100:8080/v1/containers/1i2/?action=logs", + "setlabels": "http://172.30.0.100:8080/v1/containers/1i2/?action=setlabels", + "execute": "http://172.30.0.100:8080/v1/containers/1i2/?action=execute", + "proxy": "http://172.30.0.100:8080/v1/containers/1i2/?action=proxy" + }, + "name": "Network Agent", + "state": "running", + "accountId": "1a5", + "blkioDeviceOptions": null, + "build": null, + "capAdd": null, + "capDrop": null, + "command": null, + "cpuSet": null, + "cpuShares": null, + "createIndex": null, + "created": "2016-09-22T17:58:57Z", + "createdTS": 1474567137000, + "dataVolumeMounts": {}, + "dataVolumes": [ + "/var/lib/rancher/etc:/var/lib/rancher/etc:ro" + ], + "dataVolumesFrom": null, + "deploymentUnitUuid": null, + "description": null, + "devices": null, + "dns": null, + "dnsSearch": null, + "domainName": null, + "entryPoint": null, + "environment": null, + "expose": null, + "externalId": "129c67adc9fa084fbc8e1f963db0180896b88af3dca69c7e8fe0493284e4651c", + "extraHosts": null, + "firstRunning": "2016-09-22T17:59:11Z", + "firstRunningTS": 1474567151000, + "healthCheck": null, + "healthState": null, + "hostId": "1h1", + "hostname": null, + "imageUuid": "docker:rancher/agent-instance:v0.8.3", + "kind": "container", + "labels": { + "io.rancher.container.system": "NetworkAgent", + "io.rancher.container.uuid": "b0f88089-d28b-4388-93a7-889b750cd7cb", + "io.rancher.container.name": "Network Agent", + "io.rancher.container.agent_id": "2", + "io.rancher.container.ip": "10.42.247.188/16" + }, + "logConfig": null, + "lxcConf": null, + "memory": null, + "memorySwap": null, + "nativeContainer": false, + "networkContainerId": null, + "networkIds": [], + "networkMode": null, + "pidMode": null, + "ports": null, + "primaryIpAddress": "10.42.247.188", + "privileged": true, + "publishAllPorts": false, + "readOnly": false, + "registryCredentialId": null, + "removed": null, + "requestedHostId": null, + "restartPolicy": null, + "securityOpt": null, + "startCount": 3, + "startOnCreate": true, + "stdinOpen": false, + "systemContainer": "NetworkAgent", + "transitioning": "no", + "transitioningMessage": null, + "transitioningProgress": null, + "tty": false, + "user": null, + "uuid": "b0f88089-d28b-4388-93a7-889b750cd7cb", + "version": "0", + "volumeDriver": null, + "workingDir": null + } + ], + "sortLinks": { + "accountId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=accountId", + "agentId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=agentId", + "allocationState": "http://172.30.0.100:8080/v1/containers?limit=2&sort=allocationState", + "compute": "http://172.30.0.100:8080/v1/containers?limit=2&sort=compute", + "createIndex": "http://172.30.0.100:8080/v1/containers?limit=2&sort=createIndex", + "created": "http://172.30.0.100:8080/v1/containers?limit=2&sort=created", + "deploymentUnitUuid": "http://172.30.0.100:8080/v1/containers?limit=2&sort=deploymentUnitUuid", + "description": "http://172.30.0.100:8080/v1/containers?limit=2&sort=description", + "dnsInternal": "http://172.30.0.100:8080/v1/containers?limit=2&sort=dnsInternal", + "dnsSearchInternal": "http://172.30.0.100:8080/v1/containers?limit=2&sort=dnsSearchInternal", + "domain": "http://172.30.0.100:8080/v1/containers?limit=2&sort=domain", + "externalId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=externalId", + "firstRunning": "http://172.30.0.100:8080/v1/containers?limit=2&sort=firstRunning", + "healthState": "http://172.30.0.100:8080/v1/containers?limit=2&sort=healthState", + "healthUpdated": "http://172.30.0.100:8080/v1/containers?limit=2&sort=healthUpdated", + "hostname": "http://172.30.0.100:8080/v1/containers?limit=2&sort=hostname", + "id": "http://172.30.0.100:8080/v1/containers?limit=2&sort=id", + "imageId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=imageId", + "instanceTriggeredStop": "http://172.30.0.100:8080/v1/containers?limit=2&sort=instanceTriggeredStop", + "kind": "http://172.30.0.100:8080/v1/containers?limit=2&sort=kind", + "memoryMb": "http://172.30.0.100:8080/v1/containers?limit=2&sort=memoryMb", + "name": "http://172.30.0.100:8080/v1/containers?limit=2&sort=name", + "nativeContainer": "http://172.30.0.100:8080/v1/containers?limit=2&sort=nativeContainer", + "networkContainerId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=networkContainerId", + "offeringId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=offeringId", + "registryCredentialId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=registryCredentialId", + "removeTime": "http://172.30.0.100:8080/v1/containers?limit=2&sort=removeTime", + "removed": "http://172.30.0.100:8080/v1/containers?limit=2&sort=removed", + "serviceIndexId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=serviceIndexId", + "startCount": "http://172.30.0.100:8080/v1/containers?limit=2&sort=startCount", + "state": "http://172.30.0.100:8080/v1/containers?limit=2&sort=state", + "systemContainer": "http://172.30.0.100:8080/v1/containers?limit=2&sort=systemContainer", + "token": "http://172.30.0.100:8080/v1/containers?limit=2&sort=token", + "userdata": "http://172.30.0.100:8080/v1/containers?limit=2&sort=userdata", + "uuid": "http://172.30.0.100:8080/v1/containers?limit=2&sort=uuid", + "version": "http://172.30.0.100:8080/v1/containers?limit=2&sort=version", + "zoneId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=zoneId" + }, + "pagination": { + "first": null, + "previous": null, + "next": "http://172.30.0.100:8080/v1/containers?limit=2&marker=m2", + "limit": 2, + "total": null, + "partial": true + }, + "sort": null, + "filters": { + "accountId": null, + "agentId": null, + "allocationState": null, + "compute": null, + "createIndex": null, + "created": null, + "deploymentUnitUuid": null, + "description": null, + "dnsInternal": null, + "dnsSearchInternal": null, + "domain": null, + "externalId": null, + "firstRunning": null, + "healthState": null, + "healthUpdated": null, + "hostname": null, + "id": null, + "imageId": null, + "instanceTriggeredStop": null, + "kind": null, + "memoryMb": null, + "name": null, + "nativeContainer": null, + "networkContainerId": null, + "offeringId": null, + "registryCredentialId": null, + "removeTime": null, + "removed": null, + "serviceIndexId": null, + "startCount": null, + "state": null, + "systemContainer": null, + "token": null, + "userdata": null, + "uuid": null, + "version": null, + "zoneId": null + }, + "createDefaults": {} +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/start_container.json b/libcloud/test/container/fixtures/rancher/start_container.json new file mode 100644 index 0000000000..f70ef024de --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/start_container.json @@ -0,0 +1,109 @@ +{ + "id": "1i31", + "type": "container", + "links": { + "self": "http://172.30.0.100:8080/v1/containers/1i31", + "account": "http://172.30.0.100:8080/v1/containers/1i31/account", + "credentials": "http://172.30.0.100:8080/v1/containers/1i31/credentials", + "healthcheckInstanceHostMaps": "http://172.30.0.100:8080/v1/containers/1i31/healthcheckinstancehostmaps", + "hosts": "http://172.30.0.100:8080/v1/containers/1i31/hosts", + "instanceLabels": "http://172.30.0.100:8080/v1/containers/1i31/instancelabels", + "instanceLinks": "http://172.30.0.100:8080/v1/containers/1i31/instancelinks", + "instances": "http://172.30.0.100:8080/v1/containers/1i31/instances", + "mounts": "http://172.30.0.100:8080/v1/containers/1i31/mounts", + "ports": "http://172.30.0.100:8080/v1/containers/1i31/ports", + "serviceEvents": "http://172.30.0.100:8080/v1/containers/1i31/serviceevents", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/containers/1i31/serviceexposemaps", + "services": "http://172.30.0.100:8080/v1/containers/1i31/services", + "targetInstanceLinks": "http://172.30.0.100:8080/v1/containers/1i31/targetinstancelinks", + "volumes": "http://172.30.0.100:8080/v1/containers/1i31/volumes", + "stats": "http://172.30.0.100:8080/v1/containers/1i31/stats", + "containerStats": "http://172.30.0.100:8080/v1/containers/1i31/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/containers/1i31/?action=update", + "error": "http://172.30.0.100:8080/v1/containers/1i31/?action=error", + "remove": "http://172.30.0.100:8080/v1/containers/1i31/?action=remove", + "start": "http://172.30.0.100:8080/v1/containers/1i31/?action=start", + "logs": "http://172.30.0.100:8080/v1/containers/1i31/?action=logs", + "setlabels": "http://172.30.0.100:8080/v1/containers/1i31/?action=setlabels" + }, + "name": "newcontainer", + "state": "starting", + "accountId": "1a5", + "blkioDeviceOptions": null, + "build": null, + "capAdd": null, + "capDrop": null, + "command": null, + "cpuSet": null, + "cpuShares": null, + "createIndex": null, + "created": "2016-10-06T15:55:58Z", + "createdTS": 1475769358000, + "dataVolumeMounts": {}, + "dataVolumes": [], + "dataVolumesFrom": null, + "deploymentUnitUuid": null, + "description": null, + "devices": null, + "dns": [ + "169.254.169.250" + ], + "dnsSearch": [ + "rancher.internal" + ], + "dockerPorts": [], + "domainName": null, + "entryPoint": null, + "environment": { + "STORAGE_TYPE": "file" + }, + "expose": null, + "externalId": "ab334bd25d25db7b94fdcead8f5c023b05bed424f56243187aa90f5ef7f07b09", + "extraHosts": null, + "firstRunning": "2016-10-06T15:56:00Z", + "firstRunningTS": 1475769360000, + "healthCheck": null, + "healthState": null, + "hostId": "1h1", + "hostname": null, + "imageUuid": "docker:rlister/hastebin:latest", + "kind": "container", + "labels": { + "io.rancher.container.uuid": "6d3dcf5f-28b8-4e60-9bf1-618b76a9a805", + "io.rancher.container.name": "newcontainer", + "io.rancher.container.ip": "10.42.204.104/16" + }, + "logConfig": null, + "lxcConf": null, + "memory": null, + "memorySwap": null, + "nativeContainer": false, + "networkContainerId": null, + "networkMode": "managed", + "pidMode": null, + "ports": null, + "primaryIpAddress": "10.42.204.104", + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "registryCredentialId": null, + "removed": null, + "requestedHostId": null, + "restartPolicy": null, + "securityOpt": null, + "startCount": 1, + "startOnCreate": true, + "stdinOpen": false, + "systemContainer": null, + "transitioning": "yes", + "transitioningMessage": null, + "transitioningProgress": null, + "tty": false, + "user": null, + "uuid": "6d3dcf5f-28b8-4e60-9bf1-618b76a9a805", + "version": "0", + "volumeDriver": null, + "workingDir": null +} \ No newline at end of file diff --git a/libcloud/test/container/fixtures/rancher/stop_container.json b/libcloud/test/container/fixtures/rancher/stop_container.json new file mode 100644 index 0000000000..fad41a69e5 --- /dev/null +++ b/libcloud/test/container/fixtures/rancher/stop_container.json @@ -0,0 +1,109 @@ +{ + "id": "1i31", + "type": "container", + "links": { + "self": "http://172.30.0.100:8080/v1/containers/1i31", + "account": "http://172.30.0.100:8080/v1/containers/1i31/account", + "credentials": "http://172.30.0.100:8080/v1/containers/1i31/credentials", + "healthcheckInstanceHostMaps": "http://172.30.0.100:8080/v1/containers/1i31/healthcheckinstancehostmaps", + "hosts": "http://172.30.0.100:8080/v1/containers/1i31/hosts", + "instanceLabels": "http://172.30.0.100:8080/v1/containers/1i31/instancelabels", + "instanceLinks": "http://172.30.0.100:8080/v1/containers/1i31/instancelinks", + "instances": "http://172.30.0.100:8080/v1/containers/1i31/instances", + "mounts": "http://172.30.0.100:8080/v1/containers/1i31/mounts", + "ports": "http://172.30.0.100:8080/v1/containers/1i31/ports", + "serviceEvents": "http://172.30.0.100:8080/v1/containers/1i31/serviceevents", + "serviceExposeMaps": "http://172.30.0.100:8080/v1/containers/1i31/serviceexposemaps", + "services": "http://172.30.0.100:8080/v1/containers/1i31/services", + "targetInstanceLinks": "http://172.30.0.100:8080/v1/containers/1i31/targetinstancelinks", + "volumes": "http://172.30.0.100:8080/v1/containers/1i31/volumes", + "stats": "http://172.30.0.100:8080/v1/containers/1i31/stats", + "containerStats": "http://172.30.0.100:8080/v1/containers/1i31/containerstats" + }, + "actions": { + "update": "http://172.30.0.100:8080/v1/containers/1i31/?action=update", + "error": "http://172.30.0.100:8080/v1/containers/1i31/?action=error", + "remove": "http://172.30.0.100:8080/v1/containers/1i31/?action=remove", + "start": "http://172.30.0.100:8080/v1/containers/1i31/?action=start", + "logs": "http://172.30.0.100:8080/v1/containers/1i31/?action=logs", + "setlabels": "http://172.30.0.100:8080/v1/containers/1i31/?action=setlabels" + }, + "name": "newcontainer", + "state": "stopping", + "accountId": "1a5", + "blkioDeviceOptions": null, + "build": null, + "capAdd": null, + "capDrop": null, + "command": null, + "cpuSet": null, + "cpuShares": null, + "createIndex": null, + "created": "2016-10-06T15:55:58Z", + "createdTS": 1475769358000, + "dataVolumeMounts": {}, + "dataVolumes": [], + "dataVolumesFrom": null, + "deploymentUnitUuid": null, + "description": null, + "devices": null, + "dns": [ + "169.254.169.250" + ], + "dnsSearch": [ + "rancher.internal" + ], + "dockerPorts": [], + "domainName": null, + "entryPoint": null, + "environment": { + "STORAGE_TYPE": "file" + }, + "expose": null, + "externalId": "ab334bd25d25db7b94fdcead8f5c023b05bed424f56243187aa90f5ef7f07b09", + "extraHosts": null, + "firstRunning": "2016-10-06T15:56:00Z", + "firstRunningTS": 1475769360000, + "healthCheck": null, + "healthState": null, + "hostId": "1h1", + "hostname": null, + "imageUuid": "docker:rlister/hastebin:latest", + "kind": "container", + "labels": { + "io.rancher.container.uuid": "6d3dcf5f-28b8-4e60-9bf1-618b76a9a805", + "io.rancher.container.name": "newcontainer", + "io.rancher.container.ip": "10.42.204.104/16" + }, + "logConfig": null, + "lxcConf": null, + "memory": null, + "memorySwap": null, + "nativeContainer": false, + "networkContainerId": null, + "networkMode": "managed", + "pidMode": null, + "ports": null, + "primaryIpAddress": "10.42.204.104", + "privileged": false, + "publishAllPorts": false, + "readOnly": false, + "registryCredentialId": null, + "removed": null, + "requestedHostId": null, + "restartPolicy": null, + "securityOpt": null, + "startCount": 1, + "startOnCreate": true, + "stdinOpen": false, + "systemContainer": null, + "transitioning": "yes", + "transitioningMessage": null, + "transitioningProgress": null, + "tty": false, + "user": null, + "uuid": "6d3dcf5f-28b8-4e60-9bf1-618b76a9a805", + "version": "0", + "volumeDriver": null, + "workingDir": null +} \ No newline at end of file diff --git a/libcloud/test/container/test_docker.py b/libcloud/test/container/test_docker.py new file mode 100644 index 0000000000..6fd5533621 --- /dev/null +++ b/libcloud/test/container/test_docker.py @@ -0,0 +1,351 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import json +from unittest.mock import patch + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import httplib +from libcloud.test.secrets import CONTAINER_PARAMS_DOCKER +from libcloud.container.base import ContainerImage +from libcloud.test.file_fixtures import ContainerFileFixtures +from libcloud.container.drivers.docker import DockerContainerDriver + + +class DockerContainerDriverTestCase(unittest.TestCase): + def setUp(self): + # Create a test driver for each version + versions = ("linux_124", "mac_124") + self.drivers = [] + for version in versions: + DockerContainerDriver.connectionCls.conn_class = DockerMockHttp + DockerMockHttp.type = None + DockerMockHttp.use_param = "a" + driver = DockerContainerDriver(*CONTAINER_PARAMS_DOCKER) + driver.version = version + self.drivers.append(driver) + + def test_list_images(self): + for driver in self.drivers: + images = driver.list_images() + self.assertEqual(len(images), 4) + self.assertIsInstance(images[0], ContainerImage) + self.assertEqual( + images[0].id, + "cf55d61f5307b7a18a45980971d6cfd40b737dd661879c4a6b3f2aecc3bc37b0", + ) + self.assertEqual(images[0].name, "mongo:latest") + + def test_install_image(self): + for driver in self.drivers: + image = driver.install_image("ubuntu:12.04") + self.assertTrue(image is not None) + self.assertEqual( + image.id, + "992069aee4016783df6345315302fa59681aae51a8eeb2f889dea59290f21787", + ) + + def test_list_containers(self): + for driver in self.drivers: + containers = driver.list_containers(all=True) + self.assertEqual(len(containers), 6) + self.assertEqual( + containers[0].id, + "160936dc54fe8c332095676d9379003534b8cddd7565fa63018996e06dae1b6b", + ) + self.assertEqual(containers[0].name, "hubot") + self.assertEqual(containers[0].image.name, "stackstorm/hubot") + + def test_deploy_container(self): + for driver in self.drivers: + image = driver.list_images()[0] + container = driver.deploy_container(image=image, name="test") + self.assertEqual( + container.id, + "a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303", + ) + self.assertEqual(container.name, "gigantic_goldberg") + + def test_deploy_container_command_payload(self): + cases = ( + ({}, None), + ({"command": None}, None), + ({"command": ""}, []), + ({"command": " "}, []), + ({"command": 'echo "hello world"'}, ["echo", "hello world"]), + ({"command": "None"}, ["None"]), + ) + for driver in self.drivers: + image = driver.list_images()[0] + for kwargs, expected in cases: + with self.subTest(version=driver.version, kwargs=kwargs): + with patch.object( + driver.connection, "request", wraps=driver.connection.request + ) as request: + driver.deploy_container(image=image, name="test", start=False, **kwargs) + payload = json.loads(request.call_args_list[0][1]["data"]) + self.assertEqual(payload["Image"], image.name) + if expected is None: + self.assertNotIn("Cmd", payload) + else: + self.assertEqual(payload["Cmd"], expected) + + def test_get_container(self): + for driver in self.drivers: + container = driver.get_container( + "a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303" + ) + self.assertEqual( + container.id, + "a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303", + ) + self.assertEqual(container.name, "gigantic_goldberg") + self.assertEqual(container.state, "running") + + def test_start_container(self): + for driver in self.drivers: + container = driver.get_container( + "a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303" + ) + container.start() + + def test_stop_container(self): + for driver in self.drivers: + container = driver.get_container( + "a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303" + ) + container.stop() + + def test_restart_container(self): + for driver in self.drivers: + container = driver.get_container( + "a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303" + ) + container.restart() + + def test_delete_container(self): + for driver in self.drivers: + container = driver.get_container( + "a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303" + ) + container.destroy() + + def test_ex_rename_container(self): + for driver in self.drivers: + container = driver.get_container( + "a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303" + ) + driver.ex_rename_container(container, "bob") + + def test_ex_get_logs(self): + for driver in self.drivers: + container = driver.get_container( + "a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303" + ) + logs = driver.ex_get_logs(container) + self.assertTrue(logs is not None) + + def test_ex_search_images(self): + for driver in self.drivers: + images = driver.ex_search_images("mysql") + self.assertEqual(len(images), 25) + self.assertEqual(images[0].name, "mysql") + + +class DockerMockHttp(MockHttp): + fixtures = ContainerFileFixtures("docker") + version = None + + def _version(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("linux_124/version.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _vlinux_124_images_search(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("linux_124/search.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _vmac_124_images_search(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("mac_124/search.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _vlinux_124_images_json(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("linux_124/images.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _vmac_124_images_json(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("linux_124/images.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _vlinux_124_images_create(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("linux_124/create_image.txt"), + {"Content-Type": "application/json", "transfer-encoding": "chunked"}, + httplib.responses[httplib.OK], + ) + + def _vmac_124_images_create(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("mac_124/create_image.txt"), + {"Content-Type": "application/json", "transfer-encoding": "chunked"}, + httplib.responses[httplib.OK], + ) + + def _vlinux_124_containers_json(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("linux_124/containers.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _vmac_124_containers_json(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("mac_124/containers.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _vlinux_124_containers_create(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("linux_124/create_container.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _vmac_124_containers_create(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("mac_124/create_container.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303( + self, method, url, body, headers + ): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.OK]) + + def _vmac_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303( + self, method, url, body, headers + ): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.OK]) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_start( + self, method, url, body, headers + ): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.OK]) + + def _vmac_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_start( + self, method, url, body, headers + ): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.OK]) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_restart( + self, method, url, body, headers + ): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.OK]) + + def _vmac_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_restart( + self, method, url, body, headers + ): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.OK]) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_rename( + self, method, url, body, headers + ): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.OK]) + + def _vmac_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_rename( + self, method, url, body, headers + ): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.OK]) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_stop( + self, method, url, body, headers + ): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.OK]) + + def _vmac_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_stop( + self, method, url, body, headers + ): + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.OK]) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_json( + self, method, url, body, headers + ): + return ( + httplib.OK, + self.fixtures.load("linux_124/container_a68.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _vmac_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_json( + self, method, url, body, headers + ): + return ( + httplib.OK, + self.fixtures.load("linux_124/container_a68.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_logs( + self, method, url, body, headers + ): + return ( + httplib.OK, + self.fixtures.load("linux_124/logs.txt"), + {"content-type": "text/plain"}, + httplib.responses[httplib.OK], + ) + + def _vmac_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_logs( + self, method, url, body, headers + ): + return ( + httplib.OK, + self.fixtures.load("linux_124/logs.txt"), + {"content-type": "text/plain"}, + httplib.responses[httplib.OK], + ) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/container/test_docker_utils.py b/libcloud/test/container/test_docker_utils.py new file mode 100644 index 0000000000..ae32f806ab --- /dev/null +++ b/libcloud/test/container/test_docker_utils.py @@ -0,0 +1,73 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import httplib +from libcloud.test.file_fixtures import ContainerFileFixtures +from libcloud.container.utils.docker import HubClient + + +class DockerUtilitiesTestCase(unittest.TestCase): + def setUp(self): + HubClient.connectionCls.conn_class = DockerMockHttp + DockerMockHttp.type = None + DockerMockHttp.use_param = "a" + self.driver = HubClient() + + def test_list_tags(self): + tags = self.driver.list_images("ubuntu", max_count=100) + self.assertEqual(len(tags), 88) + self.assertEqual(tags[0].name, "registry.hub.docker.com/ubuntu:xenial") + + def test_get_repository(self): + repo = self.driver.get_repository("ubuntu") + self.assertEqual(repo["name"], "ubuntu") + + def test_get_image(self): + image = self.driver.get_image("ubuntu", "latest") + self.assertEqual(image.id, "2343") + self.assertEqual(image.name, "registry.hub.docker.com/ubuntu:latest") + self.assertEqual(image.path, "registry.hub.docker.com/ubuntu:latest") + + +class DockerMockHttp(MockHttp): + fixtures = ContainerFileFixtures("docker_utils") + + def _v2_repositories_library_ubuntu_tags_latest(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("v2_repositories_library_ubuntu_tags_latest.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_repositories_library_ubuntu_tags(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("v2_repositories_library_ubuntu_tags.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _v2_repositories_library_ubuntu(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("v2_repositories_library_ubuntu.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/container/test_ecs.py b/libcloud/test/container/test_ecs.py new file mode 100644 index 0000000000..8ab381bbb4 --- /dev/null +++ b/libcloud/test/container/test_ecs.py @@ -0,0 +1,204 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import httplib +from libcloud.test.secrets import CONTAINER_PARAMS_ECS +from libcloud.container.base import Container, ContainerImage, ContainerCluster +from libcloud.test.file_fixtures import ContainerFileFixtures +from libcloud.container.drivers.ecs import ElasticContainerDriver +from libcloud.container.utils.docker import RegistryClient + + +class ElasticContainerDriverTestCase(unittest.TestCase): + def setUp(self): + ElasticContainerDriver.connectionCls.conn_class = ECSMockHttp + ECSMockHttp.type = None + ECSMockHttp.use_param = "a" + ElasticContainerDriver.ecrConnectionClass.conn_class = ECSMockHttp + + self.driver = ElasticContainerDriver(*CONTAINER_PARAMS_ECS) + + def test_list_clusters(self): + clusters = self.driver.list_clusters() + self.assertEqual(len(clusters), 1) + self.assertEqual(clusters[0].id, "arn:aws:ecs:us-east-1:012345678910:cluster/default") + self.assertEqual(clusters[0].name, "default") + + def test_create_cluster(self): + cluster = self.driver.create_cluster("my-cluster") + self.assertEqual(cluster.name, "my-cluster") + + def test_destroy_cluster(self): + self.assertTrue( + self.driver.destroy_cluster( + ContainerCluster( + id="arn:aws:ecs:us-east-1:012345678910:cluster/jim", + name="jim", + driver=self.driver, + ) + ) + ) + + def test_list_containers(self): + containers = self.driver.list_containers() + self.assertEqual(len(containers), 1) + + def test_list_containers_for_cluster(self): + cluster = self.driver.list_clusters()[0] + containers = self.driver.list_containers(cluster=cluster) + self.assertEqual(len(containers), 1) + + def test_deploy_container(self): + container = self.driver.deploy_container( + name="jim", + image=ContainerImage( + id=None, name="mysql", path="mysql", version=None, driver=self.driver + ), + ) + self.assertEqual( + container.id, + "arn:aws:ecs:ap-southeast-2:647433528374:container/e443d10f-dea3-481e-8a1e-966b9ad4e498", + ) + + def test_get_container(self): + container = self.driver.get_container( + "arn:aws:ecs:us-east-1:012345678910:container/76c980a8-2454-4a9c-acc4-9eb103117273" + ) + self.assertEqual( + container.id, + "arn:aws:ecs:ap-southeast-2:647433528374:container/d56d4e2c-9804-42a7-9f2a-6029cb50d4a2", + ) + self.assertEqual(container.name, "simple-app") + self.assertEqual(container.image.name, "simple-app") + + def test_start_container(self): + container = self.driver.start_container( + Container( + id=None, + name=None, + image=None, + state=None, + ip_addresses=None, + driver=self.driver, + extra={"taskDefinitionArn": ""}, + ) + ) + self.assertFalse(container is None) + + def test_stop_container(self): + container = self.driver.stop_container( + Container( + id=None, + name=None, + image=None, + state=None, + ip_addresses=None, + driver=self.driver, + extra={"taskArn": "12345", "taskDefinitionArn": "123556"}, + ) + ) + self.assertFalse(container is None) + + def test_restart_container(self): + container = self.driver.restart_container( + Container( + id=None, + name=None, + image=None, + state=None, + ip_addresses=None, + driver=self.driver, + extra={"taskArn": "12345", "taskDefinitionArn": "123556"}, + ) + ) + self.assertFalse(container is None) + + def test_list_images(self): + images = self.driver.list_images("my-images") + self.assertEqual(len(images), 1) + self.assertEqual( + images[0].name, "647433528374.dkr.ecr.region.amazonaws.com/my-images:latest" + ) + + def test_ex_create_service(self): + cluster = self.driver.list_clusters()[0] + task_definition = self.driver.list_containers()[0].extra["taskDefinitionArn"] + service = self.driver.ex_create_service( + cluster=cluster, name="jim", task_definition=task_definition + ) + self.assertEqual(service["serviceName"], "test") + + def test_ex_list_service_arns(self): + arns = self.driver.ex_list_service_arns() + self.assertEqual(len(arns), 2) + + def test_ex_describe_service(self): + arn = self.driver.ex_list_service_arns()[0] + service = self.driver.ex_describe_service(arn) + self.assertEqual(service["serviceName"], "test") + + def test_ex_destroy_service(self): + arn = self.driver.ex_list_service_arns()[0] + service = self.driver.ex_destroy_service(arn) + self.assertEqual(service["status"], "DRAINING") + + def test_ex_get_registry_client(self): + client = self.driver.ex_get_registry_client("my-images") + self.assertIsInstance(client, RegistryClient) + + +class ECSMockHttp(MockHttp): + fixtures = ContainerFileFixtures("ecs") + fixture_map = { + "DescribeClusters": "describeclusters.json", + "CreateCluster": "createcluster.json", + "DeleteCluster": "deletecluster.json", + "DescribeTasks": "describetasks.json", + "ListTasks": "listtasks.json", + "ListClusters": "listclusters.json", + "RegisterTaskDefinition": "registertaskdefinition.json", + "RunTask": "runtask.json", + "StopTask": "stoptask.json", + "ListImages": "listimages.json", + "DescribeRepositories": "describerepositories.json", + "CreateService": "createservice.json", + "ListServices": "listservices.json", + "DescribeServices": "describeservices.json", + "DeleteService": "deleteservice.json", + "GetAuthorizationToken": "getauthorizationtoken.json", + } + + def root(self, method, url, body, headers): + target = headers["x-amz-target"] + + # Workaround for host not being correctly set for the tests + if "%s" in self.host: + self.host = self.host % ("region") + + if target is not None: + type = target.split(".")[-1] + if type is None or self.fixture_map.get(type) is None: + raise AssertionError("Unsupported request type %s" % (target)) + body = self.fixtures.load(self.fixture_map.get(type)) + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/container/test_gke.py b/libcloud/test/container/test_gke.py new file mode 100644 index 0000000000..07f42c5f45 --- /dev/null +++ b/libcloud/test/container/test_gke.py @@ -0,0 +1,89 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Tests for Google Container Engine Driver +""" + +import sys +import unittest + +from libcloud.test import MockHttp +from libcloud.utils.py3 import httplib +from libcloud.test.secrets import GKE_PARAMS, GKE_KEYWORD_PARAMS +from libcloud.common.google import GoogleBaseAuthConnection +from libcloud.test.container import TestCaseMixin +from libcloud.test.file_fixtures import ContainerFileFixtures +from libcloud.container.drivers.gke import API_VERSION, GKEContainerDriver +from libcloud.test.common.test_google import GoogleTestCase, GoogleAuthMockHttp + + +class GKEContainerDriverTestCase(GoogleTestCase, TestCaseMixin): + """ + Google Compute Engine Test Class. + """ + + # Mock out a few specific calls that interact with the user, system or + # environment. + datacenter = "us-central1-a" + + def setUp(self): + GKEMockHttp.test = self + GKEContainerDriver.connectionCls.conn_class = GKEMockHttp + GoogleBaseAuthConnection.conn_class = GoogleAuthMockHttp + GKEMockHttp.type = None + kwargs = GKE_KEYWORD_PARAMS.copy() + kwargs["auth_type"] = "IA" + kwargs["datacenter"] = self.datacenter + self.driver = GKEContainerDriver(*GKE_PARAMS, **kwargs) + + def test_list_images_response(self): + config = self.driver.list_clusters(ex_zone="us-central1-a") + assert "clusters" in config + assert config["clusters"][0]["zone"] == "us-central1-a" + + def test_server_config(self): + config = self.driver.get_server_config() + assert "validImageTypes" in config + + +class GKEMockHttp(MockHttp): + fixtures = ContainerFileFixtures("gke") + json_hdr = {"content-type": "application/json; charset=UTF-8"} + + def _get_method_name(self, type, use_param, qs, path): + api_path = "/%s" % API_VERSION + project_path = "/projects/%s" % GKE_KEYWORD_PARAMS["project"] + path = path.replace(api_path, "") + # This replace is separate, since there is a call with a different + # project name + path = path.replace(project_path, "") + # The path to get project information is the base path, so use a fake + # '/project' path instead + if not path: + path = "/project" + method_name = super()._get_method_name(type, use_param, qs, path) + return method_name + + def _zones_us_central1_a_serverconfig(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_instance_serverconfig.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _zones_us_central1_a_clusters(self, method, url, body, headers): + body = self.fixtures.load("zones_us-central1-a_list.json") + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/container/test_kubernetes.py b/libcloud/test/container/test_kubernetes.py new file mode 100644 index 0000000000..8762fb241a --- /dev/null +++ b/libcloud/test/container/test_kubernetes.py @@ -0,0 +1,323 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import httplib +from libcloud.test.secrets import CONTAINER_PARAMS_KUBERNETES +from libcloud.container.base import ContainerImage +from libcloud.test.file_fixtures import ContainerFileFixtures +from libcloud.test.common.test_kubernetes import KubernetesAuthTestCaseMixin +from libcloud.container.drivers.kubernetes import ( + KubernetesContainerDriver, + to_n_cpus, + to_cpu_str, + to_n_bytes, + sum_resources, + to_memory_str, +) + + +class KubernetesContainerDriverTestCase(unittest.TestCase, KubernetesAuthTestCaseMixin): + driver_cls = KubernetesContainerDriver + + def setUp(self): + KubernetesContainerDriver.connectionCls.conn_class = KubernetesMockHttp + KubernetesMockHttp.type = None + KubernetesMockHttp.use_param = "a" + self.driver = KubernetesContainerDriver(*CONTAINER_PARAMS_KUBERNETES) + + def test_list_containers(self): + containers = self.driver.list_containers() + self.assertEqual(len(containers), 1) + self.assertEqual( + containers[0].id, + "docker://3c48b5cda79bce4c8866f02a3b96a024edb8f660d10e7d1755e9ced49ef47b36", + ) + self.assertEqual(containers[0].name, "hello-world") + + def test_deploy_container(self): + image = ContainerImage( + id=None, name="hello-world", path=None, driver=self.driver, version=None + ) + container = self.driver.deploy_container("hello-world", image=image) + self.assertEqual(container.name, "hello-world") + + def test_get_container(self): + container = self.driver.get_container( + "docker://3c48b5cda79bce4c8866f02a3b96a024edb8f660d10e7d1755e9ced49ef47b36" + ) + assert ( + container.id + == "docker://3c48b5cda79bce4c8866f02a3b96a024edb8f660d10e7d1755e9ced49ef47b36" + ) + + def test_list_namespaces(self): + namespaces = self.driver.list_namespaces() + self.assertEqual(len(namespaces), 2) + self.assertEqual(namespaces[0].id, "default") + self.assertEqual(namespaces[0].name, "default") + + def test_get_namespace(self): + namespace = self.driver.get_namespace("default") + self.assertEqual(namespace.id, "default") + self.assertEqual(namespace.name, "default") + + def test_create_namespace(self): + namespace = self.driver.create_namespace("test") + self.assertEqual(namespace.id, "test") + self.assertEqual(namespace.name, "test") + + def test_delete_namespace(self): + namespace = self.driver.get_namespace("default") + result = self.driver.delete_namespace(namespace) + self.assertTrue(result) + + def test_list_pods(self): + pods = self.driver.ex_list_pods() + self.assertEqual(len(pods), 1) + self.assertEqual(pods[0].id, "1fad5411-b9af-11e5-8701-0050568157ec") + self.assertEqual(pods[0].name, "hello-world") + + def test_destroy_pod(self): + result = self.driver.ex_destroy_pod("default", "default") + self.assertTrue(result) + + def test_list_nodes(self): + nodes = self.driver.ex_list_nodes() + self.assertEqual(len(nodes), 1) + self.assertEqual(nodes[0].id, "45949cbb-b99d-11e5-8d53-0050568157ec") + self.assertEqual(nodes[0].name, "127.0.0.1") + + def test_destroy_node(self): + result = self.driver.ex_destroy_node("127.0.0.1") + self.assertTrue(result) + + def test_get_version(self): + version = self.driver.ex_get_version() + self.assertEqual(version, "v1.20.8-gke.900") + + def test_list_nodes_metrics(self): + nodes_metrics = self.driver.ex_list_nodes_metrics() + self.assertEqual(len(nodes_metrics), 1) + self.assertEqual( + nodes_metrics[0]["metadata"]["name"], + "gke-cluster-3-default-pool-76fd57f7-l83v", + ) + + def test_list_pods_metrics(self): + pods_metrics = self.driver.ex_list_pods_metrics() + self.assertEqual(len(pods_metrics), 10) + self.assertEqual(pods_metrics[0]["metadata"]["name"], "gke-metrics-agent-sfjzj") + self.assertEqual( + pods_metrics[1]["metadata"]["name"], + "stackdriver-metadata-agent-cluster-level-849ff68b6d-fphxl", + ) + self.assertEqual(pods_metrics[2]["metadata"]["name"], "event-exporter-gke-67986489c8-g47rz") + + def test_list_services(self): + services = self.driver.ex_list_services() + self.assertEqual(len(services), 4) + self.assertEqual(services[0]["metadata"]["name"], "kubernetes") + self.assertEqual(services[1]["metadata"]["name"], "default-http-backend") + self.assertEqual(services[2]["metadata"]["name"], "kube-dns") + + def test_list_deployments(self): + deployments = self.driver.ex_list_deployments() + self.assertEqual(len(deployments), 7) + deployment = deployments[0] + self.assertEqual(deployment.id, "aea45586-9a4a-4a01-805c-719f431316c0") + self.assertEqual(deployment.name, "event-exporter-gke") + self.assertEqual(deployment.namespace, "kube-system") + for deployment in deployments: + self.assertIsInstance(deployment.replicas, int) + self.assertIsInstance(deployment.selector, dict) + + def test_to_n_bytes(self): + memory = "0" + self.assertEqual(to_n_bytes(memory), 0) + memory = "1000Ki" + self.assertEqual(to_n_bytes(memory), 1_024_000) + memory = "100K" + self.assertEqual(to_n_bytes(memory), 100_000) + memory = "512Mi" + self.assertEqual(to_n_bytes(memory), 536_870_912) + memory = "900M" + self.assertEqual(to_n_bytes(memory), 900_000_000) + memory = "10Gi" + self.assertEqual(to_n_bytes(memory), 10_737_418_240) + memory = "10G" + self.assertEqual(to_n_bytes(memory), 10_000_000_000) + + def test_to_memory_str(self): + memory = 0 + self.assertEqual(to_memory_str(memory), "0K") + memory = 1_024_000 + self.assertEqual(to_memory_str(memory), "1000Ki") + memory = 100_000 + self.assertEqual(to_memory_str(memory), "100K") + memory = 536_870_912 + self.assertEqual(to_memory_str(memory), "512Mi") + memory = 900_000_000 + self.assertEqual(to_memory_str(memory), "900M") + memory = 10_737_418_240 + self.assertEqual(to_memory_str(memory), "10Gi") + memory = 10_000_000_000 + self.assertEqual(to_memory_str(memory), "10G") + + def test_to_cpu_str(self): + cpu = 0 + self.assertEqual(to_cpu_str(cpu), "0") + cpu = 0.5 + self.assertEqual(to_cpu_str(cpu), "500m") + cpu = 2 + self.assertEqual(to_cpu_str(cpu), "2000m") + cpu = 0.000001 + self.assertEqual(to_cpu_str(cpu), "1u") + cpu = 0.0005 + self.assertEqual(to_cpu_str(cpu), "500u") + cpu = 0.000000001 + self.assertEqual(to_cpu_str(cpu), "1n") + cpu = 0.0000005 + self.assertEqual(to_cpu_str(cpu), "500n") + + def test_to_n_cpus(self): + cpu = "0m" + self.assertEqual(to_n_cpus(cpu), 0) + cpu = "2" + self.assertEqual(to_n_cpus(cpu), 2) + cpu = "500m" + self.assertEqual(to_n_cpus(cpu), 0.5) + cpu = "500m" + self.assertEqual(to_n_cpus(cpu), 0.5) + cpu = "2000m" + self.assertEqual(to_n_cpus(cpu), 2) + cpu = "1u" + self.assertEqual(to_n_cpus(cpu), 0.000001) + cpu = "500u" + self.assertEqual(to_n_cpus(cpu), 0.0005) + cpu = "1n" + self.assertEqual(to_n_cpus(cpu), 0.000000001) + cpu = "500n" + self.assertEqual(to_n_cpus(cpu), 0.0000005) + + def test_sum_resources(self): + resource_1 = {"cpu": "1", "memory": "1000Mi"} + resource_2 = {"cpu": "2", "memory": "2000Mi"} + self.assertDictEqual( + sum_resources(resource_1, resource_2), + {"cpu": "3000m", "memory": "3000Mi"}, + ) + resource_3 = {"cpu": "1500m", "memory": "1Gi"} + self.assertDictEqual( + sum_resources(resource_1, resource_2, resource_3), + {"cpu": "4500m", "memory": "4024Mi"}, + ) + + +class KubernetesMockHttp(MockHttp): + fixtures = ContainerFileFixtures("kubernetes") + + def _api_v1_pods(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_api_v1_pods.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _api_v1_namespaces(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_api_v1_namespaces.json") + elif method == "POST": + body = self.fixtures.load("_api_v1_namespaces_test.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _api_v1_namespaces_default(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_api_v1_namespaces_default.json") + elif method == "DELETE": + body = self.fixtures.load("_api_v1_namespaces_default_DELETE.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _api_v1_namespaces_default_pods(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_api_v1_namespaces_default_pods.json") + elif method == "POST": + body = self.fixtures.load("_api_v1_namespaces_default_pods_POST.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _api_v1_namespaces_default_pods_default(self, method, url, body, headers): + if method == "DELETE": + body = None + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _api_v1_nodes(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_api_v1_nodes.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _api_v1_nodes_127_0_0_1(self, method, url, body, headers): + if method == "DELETE": + body = None + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _api_v1_services(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_api_v1_services.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _version(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_version.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _apis_metrics_k8s_io_v1beta1_nodes(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_apis_metrics_k8s_io_v1beta1_nodes.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _apis_metrics_k8s_io_v1beta1_pods(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("_apis_metrics_k8s_io_v1beta1_pods.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _apis_apps_v1_deployments(self, method, url, body, headers): + body = self.fixtures.load("_apis_apps_v1_deployments.json") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/container/test_lxd.py b/libcloud/test/container/test_lxd.py new file mode 100644 index 0000000000..732bfd6753 --- /dev/null +++ b/libcloud/test/container/test_lxd.py @@ -0,0 +1,335 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import httplib +from libcloud.test.secrets import CONTAINER_PARAMS_LXD +from libcloud.container.base import Container, ContainerImage +from libcloud.test.file_fixtures import ContainerFileFixtures +from libcloud.container.drivers.lxd import ( + LXDServerInfo, + LXDStoragePool, + LXDAPIException, + LXDContainerDriver, +) + + +class LXDContainerDriverTestCase(unittest.TestCase): + """ + Unit tests for LXDContainerDriver + """ + + def setUp(self): + # Create a test driver for each version + versions = ("linux_124",) + self.drivers = [] + for version in versions: + LXDContainerDriver.connectionCls.conn_class = LXDMockHttp + LXDMockHttp.type = None + LXDMockHttp.use_param = "a" + driver = LXDContainerDriver(*CONTAINER_PARAMS_LXD) + driver.connectionCls.conn_class = LXDMockHttp + driver.version = version + self.drivers.append(driver) + + def test_ex_get_api_endpoints_trusted(self): + for driver in self.drivers: + api = driver.ex_get_api_endpoints() + self.assertEqual(api[0], driver.version) + + def test_ex_get_server_configuration(self): + for driver in self.drivers: + server_config = driver.ex_get_server_configuration() + self.assertIsInstance(server_config, LXDServerInfo) + self.assertEqual(server_config.api_extensions, []) + self.assertEqual(server_config.api_status, "stable") + self.assertEqual(server_config.api_version, "linux_124") + self.assertEqual(server_config.auth, "guest") + self.assertEqual(server_config.public, False) + + def test_list_images(self): + img_id = "54c8caac1f61901ed86c68f24af5f5d3672bdc62c71d04f06df3a59e95684473" + for driver in self.drivers: + images = driver.list_images() + self.assertEqual(len(images), 1) + self.assertIsInstance(images[0], ContainerImage) + self.assertEqual(images[0].id, img_id) + self.assertEqual(images[0].name, "trusty") + + def test_list_containers(self): + for driver in self.drivers: + containers = driver.list_containers() + self.assertEqual(len(containers), 2) + self.assertIsInstance(containers[0], Container) + self.assertIsInstance(containers[1], Container) + self.assertEqual(containers[0].name, "first_lxd_container") + self.assertEqual(containers[1].name, "second_lxd_container") + + def test_get_container(self): + for driver in self.drivers: + container = driver.get_container(id="second_lxd_container") + self.assertIsInstance(container, Container) + self.assertEqual(container.name, "second_lxd_container") + self.assertEqual(container.id, "second_lxd_container") + self.assertEqual(container.state, "stopped") + + def test_start_container(self): + for driver in self.drivers: + container = driver.get_container(id="first_lxd_container") + container.start() + self.assertEqual(container.state, "running") + + def test_stop_container(self): + for driver in self.drivers: + container = driver.get_container(id="second_lxd_container") + container.stop() + self.assertEqual(container.state, "stopped") + + def test_restart_container(self): + for driver in self.drivers: + container = driver.get_container(id="second_lxd_container") + container.restart() + + def test_delete_container(self): + for driver in self.drivers: + container = driver.get_container(id="second_lxd_container") + container.destroy() + + def test_deploy_container(self): + for driver in self.drivers: + image = ContainerImage(id=None, name=None, path=None, version=None, driver=driver) + container = driver.deploy_container( + name="first_lxd_container", + image=image, + parameters='{"source":{"type":"image", ' + '"fingerprint":"7ed08b435c92cd8a8a884c88e8722f2e7546a51e891982a90ea9c15619d7df9b"}}', + ) + self.assertIsInstance(container, Container) + self.assertEqual(container.name, "first_lxd_container") + + # test images + def test_install_image_no_dict(self): + with self.assertRaises(LXDAPIException) as exc: + for driver in self.drivers: + driver.install_image(path=None) + self.assertEqual( + str(exc), + "Install an image for LXD requires specification of image_data", + ) + + # test storage pools + + def test_list_storage_pools(self): + for driver in self.drivers: + pools = driver.ex_list_storage_pools() + self.assertEqual(len(pools), 2) + self.assertIsInstance(pools[0], LXDStoragePool) + self.assertIsInstance(pools[1], LXDStoragePool) + self.assertEqual(pools[0].name, "pool1") + self.assertEqual(pools[1].name, "pool2") + + def test_get_storage_pool_no_metadata(self): + with self.assertRaises(LXDAPIException) as exc: + for driver in self.drivers: + driver.ex_get_storage_pool(id="pool3") + self.assertEqual(str(exc), "Storage pool with name pool3 has no data") + + def test_delete_storage_pool(self): + for driver in self.drivers: + driver.ex_delete_storage_pool(id="pool1") + + def test_delete_storage_pool_fail(self): + with self.assertRaises(LXDAPIException): + for driver in self.drivers: + driver.ex_delete_storage_pool(id="pool2") + + +class LXDMockHttp(MockHttp): + fixtures = ContainerFileFixtures("lxd") + version = None + + def _version(self, method, url, body, headers): + if method == "GET": + body = self.fixtures.load("linux_124/version.json") + else: + raise AssertionError("Unsupported method") + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def root(self, method, url, body, headers): + json = self.fixtures.load("linux_124/endpoints_sucess.json") + return (httplib.OK, json, {}, httplib.responses[httplib.OK]) + + def _linux_124(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("linux_124/version.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _linux_124_images(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("linux_124/images.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _linux_124_images_54c8caac1f61901ed86c68f24af5f5d3672bdc62c71d04f06df3a59e95684473( + self, method, url, body, headers + ): + return ( + httplib.OK, + self.fixtures.load("linux_124/image.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _linux_124_containers(self, method, url, body, headers): + if method == "GET": + return ( + httplib.OK, + self.fixtures.load("linux_124/containers.json"), + {}, + httplib.responses[httplib.OK], + ) + elif method == "POST" or method == "PUT": + # we do a POST when we create a container + # we will return a dummy background operation + return ( + httplib.OK, + self.fixtures.load("linux_124/background_op.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _linux_124_containers_first_lxd_container(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("linux_124/first_lxd_container.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _linux_124_containers_second_lxd_container(self, method, url, body, headers): + if method == "PUT" or method == "DELETE": + json = self.fixtures.load("linux_124/background_op.json") + return (httplib.OK, json, {}, httplib.responses[httplib.OK]) + elif method == "GET": + return ( + httplib.OK, + self.fixtures.load("linux_124/second_lxd_container.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _linux_124_containers_first_lxd_container_state(self, method, url, body, headers): + if method == "PUT" or method == "DELETE": + json = self.fixtures.load("linux_124/background_op.json") + return (httplib.OK, json, {}, httplib.responses[httplib.OK]) + elif method == "GET": + json = self.fixtures.load("linux_124/first_lxd_container.json") + return (httplib.OK, json, {}, httplib.responses[httplib.OK]) + + def _linux_124_containers_second_lxd_container_state(self, method, url, body, headers): + if method == "PUT" or method == "DELETE": + json = self.fixtures.load("linux_124/background_op.json") + return (httplib.OK, json, {}, httplib.responses[httplib.OK]) + elif method == "GET": + json = self.fixtures.load("linux_124/second_lxd_container.json") + return (httplib.OK, json, {}, httplib.responses[httplib.OK]) + + def _linux_124_operations_1_wait(self, method, url, body, header): + return ( + httplib.OK, + self.fixtures.load("linux_124/operation_1_wait.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _linux_124_storage_pools(self, method, url, body, header): + if method == "GET": + json = self.fixtures.load("linux_124/storage_pools.json") + return (httplib.OK, json, {}, httplib.responses[httplib.OK]) + + def _linux_124_storage_pools_pool1(self, method, url, body, header): + if method == "GET": + json = self.fixtures.load("linux_124/storage_pool_1.json") + return (httplib.OK, json, {}, httplib.responses[httplib.OK]) + elif method == "DELETE": + return ( + httplib.OK, + self.fixtures.load("linux_124/storage_pool_delete_sucess.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _linux_124_storage_pools_pool2(self, method, url, body, header): + if method == "GET": + json = self.fixtures.load("linux_124/storage_pool_2.json") + return (httplib.OK, json, {}, httplib.responses[httplib.OK]) + elif method == "DELETE": + return ( + httplib.OK, + self.fixtures.load("linux_124/storage_pool_delete_fail.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _linux_124_storage_pools_pool3(self, method, url, body, header): + if method == "GET": + json = self.fixtures.load("linux_124/no_meta_pool.json") + return (httplib.OK, json, {}, httplib.responses[httplib.OK]) + + """ + def _vlinux_124_containers_create( + self, method, url, body, headers): + return (httplib.OK, self.fixtures.load('linux_124/create_container.json'), {}, httplib.responses[httplib.OK]) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303( + self, method, url, body, headers): + return (httplib.NO_CONTENT, '', {}, httplib.responses[httplib.OK]) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_start( + self, method, url, body, headers): + return (httplib.NO_CONTENT, '', {}, httplib.responses[httplib.OK]) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_restart( + self, method, url, body, headers): + return (httplib.NO_CONTENT, '', {}, httplib.responses[httplib.OK]) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_rename( + self, method, url, body, headers): + return (httplib.NO_CONTENT, '', {}, httplib.responses[httplib.OK]) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_stop( + self, method, url, body, headers): + return (httplib.NO_CONTENT, '', {}, httplib.responses[httplib.OK]) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_json( + self, method, url, body, headers): + return (httplib.OK, self.fixtures.load('linux_124/container_a68.json'), {}, httplib.responses[httplib.OK]) + + def _vlinux_124_containers_a68c1872c74630522c7aa74b85558b06824c5e672cee334296c50fb209825303_logs( + self, method, url, body, headers): + return (httplib.OK, self.fixtures.load('linux_124/logs.txt'), {'content-type': 'text/plain'}, + httplib.responses[httplib.OK]) + """ + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/container/test_rancher.py b/libcloud/test/container/test_rancher.py new file mode 100644 index 0000000000..25e4ebd28f --- /dev/null +++ b/libcloud/test/container/test_rancher.py @@ -0,0 +1,386 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys + +from libcloud.test import MockHttp, unittest +from libcloud.utils.py3 import httplib +from libcloud.test.secrets import CONTAINER_PARAMS_RANCHER +from libcloud.container.base import ContainerImage +from libcloud.test.file_fixtures import ContainerFileFixtures +from libcloud.container.drivers.rancher import RancherContainerDriver + +# --------------------------------------------------------------------------- # +# Mock Classes + + +class RancherMockHttp(MockHttp): + fixtures = ContainerFileFixtures("rancher") + + def _v1_environments(self, method, url, body, headers): + if method == "GET": + return ( + httplib.OK, + self.fixtures.load("ex_list_stacks.json"), + {}, + httplib.responses[httplib.OK], + ) + else: + return ( + httplib.OK, + self.fixtures.load("ex_deploy_stack.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _v1_environments_1e9(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("ex_deploy_stack.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _v1_environments_1e10(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("ex_destroy_stack.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _v1_environments_1e1(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("ex_activate_stack.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _v1_services(self, method, url, body, headers): + if "?healthState=healthy" in url: + return ( + httplib.OK, + self.fixtures.load("ex_search_services.json"), + {}, + httplib.responses[httplib.OK], + ) + elif method == "GET": + return ( + httplib.OK, + self.fixtures.load("ex_list_services.json"), + {}, + httplib.responses[httplib.OK], + ) + else: + return ( + httplib.OK, + self.fixtures.load("ex_deploy_service.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _v1_services_1s13(self, method, url, body, headers): + if method == "GET": + return ( + httplib.OK, + self.fixtures.load("ex_deploy_service.json"), + {}, + httplib.responses[httplib.OK], + ) + elif method == "DELETE": + return ( + httplib.OK, + self.fixtures.load("ex_destroy_service.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _v1_services_1s6(self, method, url, body, headers): + return ( + httplib.OK, + self.fixtures.load("ex_activate_service.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _v1_containers(self, method, url, body, headers): + if "?state=running" in url: + return ( + httplib.OK, + self.fixtures.load("ex_search_containers.json"), + {}, + httplib.responses[httplib.OK], + ) + elif method == "POST": + return ( + httplib.OK, + self.fixtures.load("deploy_container.json"), + {}, + httplib.responses[httplib.OK], + ) + return ( + httplib.OK, + self.fixtures.load("list_containers.json"), + {}, + httplib.responses[httplib.OK], + ) + + def _v1_containers_1i31(self, method, url, body, headers): + if method == "GET": + return ( + httplib.OK, + self.fixtures.load("deploy_container.json"), + {}, + httplib.responses[httplib.OK], + ) + elif method == "DELETE" or "?action=stop" in url: + return ( + httplib.OK, + self.fixtures.load("stop_container.json"), + {}, + httplib.responses[httplib.OK], + ) + elif "?action=start" in url: + return ( + httplib.OK, + self.fixtures.load("start_container.json"), + {}, + httplib.responses[httplib.OK], + ) + else: + return ( + httplib.OK, + self.fixtures.load("deploy_container.json"), + {}, + httplib.responses[httplib.OK], + ) + + +RancherContainerDriver.connectionCls.conn_class = RancherMockHttp +RancherMockHttp.type = None +RancherMockHttp.use_param = "a" + + +# --------------------------------------------------------------------------- # +# Test Cases + + +class RancherContainerDriverInitTestCase(unittest.TestCase): + """ + Tests for testing the different permutations of the driver initialization + string. + """ + + def test_full_url_string(self): + """ + Test a 'full' URL string, which contains a scheme, port, and base path. + """ + path = "http://myhostname:1234/base" + driver = RancherContainerDriver(*CONTAINER_PARAMS_RANCHER, host=path) + + self.assertEqual(driver.secure, False) + self.assertEqual(driver.connection.host, "myhostname") + self.assertEqual(driver.connection.port, 1234) + self.assertEqual(driver.baseuri, "/base") + + def test_url_string_no_port(self): + """ + Test a partial URL string, which contains a scheme, and base path. + """ + path = "http://myhostname/base" + driver = RancherContainerDriver(*CONTAINER_PARAMS_RANCHER, host=path, port=1234) + + self.assertEqual(driver.secure, False) + self.assertEqual(driver.connection.host, "myhostname") + self.assertEqual(driver.connection.port, 1234) + self.assertEqual(driver.baseuri, "/base") + + def test_url_string_no_scheme(self): + """ + Test a partial URL string, which contains a port, and base path. + """ + path = "myhostname:1234/base" + driver = RancherContainerDriver(*CONTAINER_PARAMS_RANCHER, host=path) + + self.assertEqual(driver.secure, True) + self.assertEqual(driver.connection.host, "myhostname") + self.assertEqual(driver.connection.port, 1234) + self.assertEqual(driver.baseuri, "/base") + + def test_url_string_no_base_path(self): + """ + Test a partial URL string, which contains a scheme, and a port. + """ + path = "http://myhostname:1234" + driver = RancherContainerDriver(*CONTAINER_PARAMS_RANCHER, host=path) + + self.assertEqual(driver.secure, False) + self.assertEqual(driver.connection.host, "myhostname") + self.assertEqual(driver.connection.port, 1234) + self.assertEqual(driver.baseuri, "/v%s" % driver.version) + + +class RancherContainerDriverTestCase(unittest.TestCase): + def setUp(self): + self.driver = RancherContainerDriver(*CONTAINER_PARAMS_RANCHER) + + # Stacks + def test_ex_list_stacks(self): + stacks = self.driver.ex_list_stacks() + self.assertEqual(len(stacks), 6) + self.assertEqual(stacks[0]["id"], "1e1") + + def test_ex_deploy_stack(self): + stack = self.driver.ex_deploy_stack( + name="newstack", environment={"root_password": "password"} + ) + self.assertEqual(stack["id"], "1e9") + self.assertEqual(stack["environment"]["root_password"], "password") + + def test_ex_get_stack(self): + # also uses ex_deploy_stack.json + stack = self.driver.ex_get_stack("1e9") + self.assertEqual(stack["id"], "1e9") + self.assertEqual(stack["environment"]["root_password"], "password") + + def test_ex_search_stacks(self): + stacks = self.driver.ex_search_stacks({"healthState": "healthy"}) + self.assertEqual(len(stacks), 6) + self.assertEqual(stacks[0]["healthState"], "healthy") + + def test_ex_destroy_stack(self): + response = self.driver.ex_destroy_stack("1e10") + self.assertEqual(response, True) + + def test_ex_activate_stack(self): + response = self.driver.ex_activate_stack("1e1") + self.assertEqual(response, True) + + def test_ex_deactivate_stack(self): + # also uses ex_activate_stack.json + response = self.driver.ex_activate_stack("1e1") + self.assertEqual(response, True) + + def test_ex_list_services(self): + services = self.driver.ex_list_services() + self.assertEqual(len(services), 4) + self.assertEqual(services[0]["id"], "1s1") + + def test_ex_deploy_service(self): + image = ContainerImage( + id="hastebin", + name="hastebin", + path="rlister/hastebin", + version="latest", + driver=None, + ) + service = self.driver.ex_deploy_service( + name="newservice", + environment_id="1e1", + image=image, + environment={"root_password": "password"}, + ) + self.assertEqual(service["id"], "1s13") + self.assertEqual(service["environmentId"], "1e6") + self.assertEqual(service["launchConfig"]["environment"]["root_password"], "password") + self.assertEqual(service["launchConfig"]["imageUuid"], "docker:rlister/hastebin:latest") + + def test_ex_get_service(self): + # also uses ex_deploy_service.json + service = self.driver.ex_get_service("1s13") + self.assertEqual(service["id"], "1s13") + self.assertEqual(service["environmentId"], "1e6") + self.assertEqual(service["launchConfig"]["environment"]["root_password"], "password") + + def test_ex_search_services(self): + services = self.driver.ex_search_services({"healthState": "healthy"}) + self.assertEqual(len(services), 2) + self.assertEqual(services[0]["healthState"], "healthy") + + def test_ex_destroy_service(self): + # Not sure how to do these with returns in mockhttp + response = self.driver.ex_destroy_service("1s13") + self.assertEqual(response, True) + + def test_ex_activate_service(self): + response = self.driver.ex_activate_service("1s6") + self.assertEqual(response, True) + + def test_ex_deactivate_service(self): + # also uses ex_activate_service.json + response = self.driver.ex_activate_service("1s6") + self.assertEqual(response, True) + + def test_list_containers(self): + containers = self.driver.list_containers() + self.assertEqual(len(containers), 2) + self.assertEqual(containers[0].id, "1i1") + + def test_deploy_container(self): + container = self.driver.deploy_container( + name="newcontainer", + image=ContainerImage( + id="hastebin", + name="hastebin", + path="rlister/hastebin", + version="latest", + driver=None, + ), + environment={"STORAGE_TYPE": "file"}, + networkMode="managed", + ) + self.assertEqual(container.id, "1i31") + self.assertEqual(container.name, "newcontainer") + self.assertEqual(container.extra["environment"], {"STORAGE_TYPE": "file"}) + + def test_get_container(self): + # also uses ex_deploy_container.json + container = self.driver.get_container("1i31") + self.assertEqual(container.id, "1i31") + self.assertEqual(container.name, "newcontainer") + self.assertEqual(container.extra["environment"], {"STORAGE_TYPE": "file"}) + + def test_start_container(self): + container = self.driver.get_container("1i31") + started = container.start() + self.assertEqual(started.id, "1i31") + self.assertEqual(started.name, "newcontainer") + self.assertEqual(started.state, "pending") + self.assertEqual(started.extra["state"], "starting") + + def test_stop_container(self): + container = self.driver.get_container("1i31") + stopped = container.stop() + self.assertEqual(stopped.id, "1i31") + self.assertEqual(stopped.name, "newcontainer") + self.assertEqual(stopped.state, "pending") + self.assertEqual(stopped.extra["state"], "stopping") + + def test_ex_search_containers(self): + containers = self.driver.ex_search_containers({"state": "running"}) + self.assertEqual(len(containers), 1) + + def test_destroy_container(self): + container = self.driver.get_container("1i31") + destroyed = container.destroy() + self.assertEqual(destroyed.id, "1i31") + self.assertEqual(destroyed.name, "newcontainer") + self.assertEqual(destroyed.state, "pending") + self.assertEqual(destroyed.extra["state"], "stopping") + + +if __name__ == "__main__": + sys.exit(unittest.main()) diff --git a/libcloud/test/dns/fixtures/auroradns/zone_create.json b/libcloud/test/dns/fixtures/auroradns/zone_create.json new file mode 100644 index 0000000000..5f3694a458 --- /dev/null +++ b/libcloud/test/dns/fixtures/auroradns/zone_create.json @@ -0,0 +1,11 @@ + { + "created":"2015-05-21T13:51:12Z", + "id":"ffb62570-8414-4578-a346-526b44e320b7", + "account_id": "7be65324-6e97-4b73-9427-0f4abcf7d216", + "cluster_id": "734f21f4-765e-4fea-b571-eedef73b20c5", + "name":"example.com", + "servers":[ + "ns1.auroradns.eu", + "ns2.auroradns.info" + ] + } diff --git a/libcloud/test/dns/fixtures/auroradns/zone_example_com.json b/libcloud/test/dns/fixtures/auroradns/zone_example_com.json new file mode 100644 index 0000000000..5f3694a458 --- /dev/null +++ b/libcloud/test/dns/fixtures/auroradns/zone_example_com.json @@ -0,0 +1,11 @@ + { + "created":"2015-05-21T13:51:12Z", + "id":"ffb62570-8414-4578-a346-526b44e320b7", + "account_id": "7be65324-6e97-4b73-9427-0f4abcf7d216", + "cluster_id": "734f21f4-765e-4fea-b571-eedef73b20c5", + "name":"example.com", + "servers":[ + "ns1.auroradns.eu", + "ns2.auroradns.info" + ] + } diff --git a/libcloud/test/dns/fixtures/auroradns/zone_example_com_health_check.json b/libcloud/test/dns/fixtures/auroradns/zone_example_com_health_check.json new file mode 100644 index 0000000000..a00f0ce99f --- /dev/null +++ b/libcloud/test/dns/fixtures/auroradns/zone_example_com_health_check.json @@ -0,0 +1,14 @@ +{ + "created": "2015-08-07T13:56:59Z", + "enabled": true, + "health": true, + "hostname": "www.pcextreme.nl", + "id": "9990ec60-d592-4673-9e7e-9220ed42ee0b", + "interval": 10, + "ipaddress": "109.72.87.252", + "next_run": "2015-08-10T14:22:32Z", + "path": "/", + "port": 8080, + "threshold": 3, + "type": "HTTP" +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/auroradns/zone_example_com_health_checks.json b/libcloud/test/dns/fixtures/auroradns/zone_example_com_health_checks.json new file mode 100644 index 0000000000..177fdebf44 --- /dev/null +++ b/libcloud/test/dns/fixtures/auroradns/zone_example_com_health_checks.json @@ -0,0 +1,44 @@ +[ + { + "created": "2015-08-07T13:56:59Z", + "enabled": true, + "health": true, + "hostname": "www.pcextreme.nl", + "id": "9990ec60-d592-4673-9e7e-9220ed42ee0b", + "interval": 60, + "ipaddress": "109.72.87.252", + "next_run": "2015-08-10T14:22:32Z", + "path": "/", + "port": 80, + "threshold": 3, + "type": "HTTP" + }, + { + "created": "2015-08-07T13:56:59Z", + "enabled": true, + "health": true, + "hostname": "www.pcextreme.nl", + "id": "3f29a813-6a25-41c5-a45e-f771347de526", + "interval": 60, + "ipaddress": "2a00:f10:101::3eb:1", + "next_run": "2015-08-10T14:22:32Z", + "path": "/", + "port": 80, + "threshold": 3, + "type": "HTTP" + }, + { + "created": "2015-08-07T13:56:59Z", + "enabled": true, + "health": true, + "hostname": "www.pcextreme.nl", + "id": "7719a4c5-b319-46e7-a917-3dc57bdab1d4", + "interval": 60, + "ipaddress": null, + "next_run": "2015-08-10T14:22:32Z", + "path": "/", + "port": 80, + "threshold": 3, + "type": "HTTP" + } +] \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/auroradns/zone_example_com_record_localhost.json b/libcloud/test/dns/fixtures/auroradns/zone_example_com_record_localhost.json new file mode 100644 index 0000000000..baf7fdf0df --- /dev/null +++ b/libcloud/test/dns/fixtures/auroradns/zone_example_com_record_localhost.json @@ -0,0 +1,12 @@ +{ + "id": "5592f1ff", + "content": "127.0.0.1", + "disabled": false, + "health_check_id": null, + "name": "localhost", + "prio": null, + "ttl": 900, + "type": "A", + "created": "2015-08-07T13:56:51Z", + "modified": "2015-08-07T14:11:40Z" +} diff --git a/libcloud/test/dns/fixtures/auroradns/zone_example_com_records.json b/libcloud/test/dns/fixtures/auroradns/zone_example_com_records.json new file mode 100644 index 0000000000..c10aa1b657 --- /dev/null +++ b/libcloud/test/dns/fixtures/auroradns/zone_example_com_records.json @@ -0,0 +1,38 @@ +[ + { + "content":"ns1.auroradns.eu admin.auroradns.eu 2015021901 86400 7200 604800 300", + "created":"2015-08-07T13:56:51Z", + "disabled":false, + "health_check_id":null, + "id":"8f4a27b2-0b15-4ed7-b652-813b23c2027f", + "modified":"2015-08-07T14:11:40Z", + "name":"", + "prio":null, + "ttl":3600, + "type":"SOA" + }, + { + "content":"ns1.auroradns.eu", + "created":"2015-08-07T13:56:50Z", + "disabled":false, + "health_check_id":null, + "id":"4d8aaffc-2e43-49c6-82cc-a26d01a159bc", + "modified":"2015-08-07T14:11:40Z", + "name":"", + "prio":null, + "ttl":3600, + "type":"NS" + }, + { + "content":"109.72.87.137", + "created":"2015-08-07T13:56:50Z", + "disabled":false, + "health_check_id":"aecad772-9234-4722-9a05-66ad5ff6a5b0", + "id":"30245a1a-5569-4136-900f-864f088c60ee", + "modified":"2015-08-10T14:10:17Z", + "name":"smtp", + "prio":null, + "ttl":3600, + "type":"A" + } +] diff --git a/libcloud/test/dns/fixtures/auroradns/zone_list.json b/libcloud/test/dns/fixtures/auroradns/zone_list.json new file mode 100644 index 0000000000..c96e113e1d --- /dev/null +++ b/libcloud/test/dns/fixtures/auroradns/zone_list.json @@ -0,0 +1,24 @@ +[ + { + "created":"2015-05-21T13:51:12Z", + "id":"ffb62570-8414-4578-a346-526b44e320b7", + "account_id": "7be65324-6e97-4b73-9427-0f4abcf7d216", + "cluster_id": "734f21f4-765e-4fea-b571-eedef73b20c5", + "name":"auroradns1.eu", + "servers":[ + "ns1.auroradns.eu", + "ns2.auroradns.info" + ] + }, + { + "created":"2015-07-07T08:15:14Z", + "id":"e3c012266-72e5-48a1-ad3d-ffa7daa06dc5", + "account_id": "78971987-f0a0-4714-8926-5d9206601aa9", + "cluster_id": "d842505b-8dd9-4597-a34d-93fde6b61818", + "name":"auroradns2.nl", + "servers":[ + "ns1.auroradns.eu", + "ns2.auroradns.info" + ] + } +] diff --git a/libcloud/test/dns/fixtures/buddyns/create_zone_success.json b/libcloud/test/dns/fixtures/buddyns/create_zone_success.json new file mode 100644 index 0000000000..82151a0d25 --- /dev/null +++ b/libcloud/test/dns/fixtures/buddyns/create_zone_success.json @@ -0,0 +1,8 @@ +{ "name": "microsoft.com", + "name_idn": "microsoft.com", + "serial": null, + "master": "65.55.37.62", + "creation_ts": null, + "status": "https://www.buddyns.com/api/v2/zone/anexample.com/status/", + "delegation": "https://www.buddyns.com/api/v2/zone/anexample.com/delegation/" +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/buddyns/delete_zone_success.json b/libcloud/test/dns/fixtures/buddyns/delete_zone_success.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/test/dns/fixtures/buddyns/empty_zones_list.json b/libcloud/test/dns/fixtures/buddyns/empty_zones_list.json new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/libcloud/test/dns/fixtures/buddyns/empty_zones_list.json @@ -0,0 +1 @@ +[] diff --git a/libcloud/test/dns/fixtures/buddyns/get_zone_success.json b/libcloud/test/dns/fixtures/buddyns/get_zone_success.json new file mode 100644 index 0000000000..9ced5183c8 --- /dev/null +++ b/libcloud/test/dns/fixtures/buddyns/get_zone_success.json @@ -0,0 +1,7 @@ +{ "name": "myexample.com", + "name_idn": "myexample.com", + "serial": null, + "master": "65.55.37.62", + "creation_ts": "2016-04-09T06:20:05.140", + "status": "https://www.buddyns.com/api/v2/zone/myexample.com/status/", + "delegation": "https://www.buddyns.com/api/v2/zone/myexample.com/delegation/"} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/buddyns/list_zones.json b/libcloud/test/dns/fixtures/buddyns/list_zones.json new file mode 100644 index 0000000000..0465dd5561 --- /dev/null +++ b/libcloud/test/dns/fixtures/buddyns/list_zones.json @@ -0,0 +1,18 @@ +[ { + "name" : "microsoft.com", + "name_idn" : "microsoft.com", + "creation_ts" : "2013-11-06T19:39:38.205", + "master" : "65.55.37.62", + "serial" : 2013110601, + "status": "/api/v2/zone/microsoft.com/status/", + "delegation": "/api/v2/zone/microsoft.com/delegation/" +}, +{ + "name" : "google.de", + "name_idn" : "google.de", + "creation_ts" : "2012-06-06T19:53:07.269", + "master" : "154.15.200.6", + "serial" : 1383743519, + "status": "google.de/status/", + "delegation": "/api/v2/zone/b?cher.de/delegation/" + } ] \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/buddyns/zone_already_exists.json b/libcloud/test/dns/fixtures/buddyns/zone_already_exists.json new file mode 100644 index 0000000000..55a07e150f --- /dev/null +++ b/libcloud/test/dns/fixtures/buddyns/zone_already_exists.json @@ -0,0 +1,3 @@ + {"errors": + {"name": ["Zone with this Domain already exists."]}, + "detail": "Invalid zone submitted for addition."} diff --git a/libcloud/test/dns/fixtures/buddyns/zone_does_not_exist.json b/libcloud/test/dns/fixtures/buddyns/zone_does_not_exist.json new file mode 100644 index 0000000000..ae53cb6a5b --- /dev/null +++ b/libcloud/test/dns/fixtures/buddyns/zone_does_not_exist.json @@ -0,0 +1 @@ +{"detail": "Not found"} diff --git a/libcloud/test/dns/fixtures/cloudflare/error_with_error_chain.json b/libcloud/test/dns/fixtures/cloudflare/error_with_error_chain.json new file mode 100644 index 0000000000..62ef689a02 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/error_with_error_chain.json @@ -0,0 +1 @@ + {"result":null,"success":false,"errors":[{"code":1004,"message":"DNS Validation Error","error_chain":[{"code":9011,"message":"Length of content is invalid"}]}],"messages":[]} diff --git a/libcloud/test/dns/fixtures/cloudflare/memberships_GET.json b/libcloud/test/dns/fixtures/cloudflare/memberships_GET.json new file mode 100644 index 0000000000..0e9b82fd65 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/memberships_GET.json @@ -0,0 +1,110 @@ +{ + "result": [ + { + "id": "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", + "status": "accepted", + "permissions": { + "access": { + "read": true, + "edit": true + }, + "analytics": { + "read": true, + "edit": false + }, + "app": { + "read": false, + "edit": true + }, + "auditlogs": { + "read": true, + "edit": false + }, + "billing": { + "read": true, + "edit": true + }, + "cache_purge": { + "read": false, + "edit": true + }, + "dns_records": { + "read": true, + "edit": true + }, + "lb": { + "read": true, + "edit": true + }, + "legal": { + "read": true, + "edit": true + }, + "logs": { + "read": true, + "edit": true + }, + "member": { + "read": true, + "edit": true + }, + "organization": { + "read": true, + "edit": true + }, + "ssl": { + "read": true, + "edit": true + }, + "stream": { + "read": true, + "edit": true + }, + "subscription": { + "read": true, + "edit": true + }, + "waf": { + "read": true, + "edit": true + }, + "webhooks": { + "read": true, + "edit": true + }, + "worker": { + "read": true, + "edit": true + }, + "zone": { + "read": true, + "edit": true + }, + "zone_settings": { + "read": true, + "edit": true + } + }, + "roles": [ + "Super Administrator - All Privileges" + ], + "account": { + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "name": "cloudflare@test.com's Account", + "settings": { + "enforce_twofactor": false + } + } + } + ], + "result_info": { + "page": 1, + "per_page": 20, + "total_pages": 1, + "count": 1, + "total_count": 1 + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/cloudflare/record_DELETE.json b/libcloud/test/dns/fixtures/cloudflare/record_DELETE.json new file mode 100644 index 0000000000..fd43e90a29 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/record_DELETE.json @@ -0,0 +1,8 @@ +{ + "result": { + "id": "364797364" + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/cloudflare/record_GET.json b/libcloud/test/dns/fixtures/cloudflare/record_GET.json new file mode 100644 index 0000000000..ca90b95520 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/record_GET.json @@ -0,0 +1,22 @@ +{ + "result": { + "id": "364797364", + "type": "A", + "name": "example.com", + "content": "192.30.252.153", + "proxiable": true, + "proxied": true, + "ttl": 1, + "locked": false, + "modified_on": "2018-12-22T21:28:00.801892Z", + "created_on": "2018-12-22T21:28:00.801892Z", + "meta": { + "auto_added": false, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/cloudflare/record_GET_400.json b/libcloud/test/dns/fixtures/cloudflare/record_GET_400.json new file mode 100644 index 0000000000..a58e830ee6 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/record_GET_400.json @@ -0,0 +1,15 @@ +{ + "success": false, + "errors": [ + { + "code": 7003, + "message": "Could not route to /zones/1234/dns_records/invalid, perhaps your object identifier is invalid?" + }, + { + "code": 7000, + "message": "No route for that URI" + } + ], + "messages": [], + "result": null +} diff --git a/libcloud/test/dns/fixtures/cloudflare/record_GET_404.json b/libcloud/test/dns/fixtures/cloudflare/record_GET_404.json new file mode 100644 index 0000000000..1917889d06 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/record_GET_404.json @@ -0,0 +1,11 @@ +{ + "success": false, + "errors": [ + { + "code": 1002, + "message": "Invalid dns record identifier" + } + ], + "messages": [], + "result": null +} diff --git a/libcloud/test/dns/fixtures/cloudflare/record_PUT.json b/libcloud/test/dns/fixtures/cloudflare/record_PUT.json new file mode 100644 index 0000000000..6da11f74f9 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/record_PUT.json @@ -0,0 +1,22 @@ +{ + "result": { + "id": "412561327", + "type": "A", + "name": "test6.example.com", + "content": "127.0.0.4", + "proxiable": true, + "proxied": true, + "ttl": 1, + "locked": false, + "modified_on": "2018-12-22T21:28:00.801892Z", + "created_on": "2018-12-22T21:28:00.801892Z", + "meta": { + "auto_added": false, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/cloudflare/records_GET_1.json b/libcloud/test/dns/fixtures/cloudflare/records_GET_1.json new file mode 100644 index 0000000000..2ee5a436a1 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/records_GET_1.json @@ -0,0 +1,117 @@ +{ + "result": [ + { + "id": "364797364", + "type": "A", + "name": "example.com", + "content": "192.30.252.153", + "proxiable": true, + "proxied": true, + "ttl": 1, + "locked": false, + "modified_on": "2018-12-22T21:28:00.801892Z", + "created_on": "2018-12-22T21:28:00.801892Z", + "meta": { + "auto_added": false, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + { + "id": "r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1", + "type": "A", + "name": "example.com", + "content": "192.30.252.154", + "proxiable": true, + "proxied": true, + "ttl": 1, + "locked": false, + "modified_on": "2018-12-22T21:28:03.346998Z", + "created_on": "2018-12-22T21:28:03.346998Z", + "meta": { + "auto_added": false, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + { + "id": "r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2r2", + "type": "CNAME", + "name": "email.example.com", + "content": "mailgun.org", + "proxiable": true, + "proxied": false, + "ttl": 1, + "locked": false, + "modified_on": "2018-12-22T20:29:48.453923Z", + "created_on": "2018-12-22T20:29:48.453923Z", + "meta": { + "auto_added": true, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + { + "id": "r3r3r3r3r3r3r3r3r3r3r3r3r3r3r3r3", + "type": "CNAME", + "name": "foo.example.com", + "content": "foo.com", + "proxiable": true, + "proxied": false, + "ttl": 1, + "locked": false, + "modified_on": "2019-05-30T01:43:01.509188Z", + "created_on": "2019-05-30T01:43:01.509188Z", + "meta": { + "auto_added": false, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + { + "id": "364982413", + "type": "CNAME", + "name": "yesyes", + "content": "verify.bing.com", + "proxiable": true, + "proxied": true, + "ttl": 1, + "locked": false, + "modified_on": "2018-12-22T21:29:46.874918Z", + "created_on": "2018-12-22T21:29:46.874918Z", + "meta": { + "auto_added": false, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + { + "content": "aspmx3.googlemail.com", + "created_on": "2015-09-04T23:06:50.625895Z", + "id": "78526", + "locked": false, + "meta": { + "auto_added": true, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + }, + "modified_on": "2015-09-04T23:06:50.625895Z", + "name": "foo.bar", + "priority": 30, + "proxiable": false, + "proxied": false, + "ttl": 1, + "type": "MX" + } + ], + "result_info": { + "page": 1, + "per_page": 5, + "total_pages": 2, + "count": 5, + "total_count": 9 + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/cloudflare/records_GET_2.json b/libcloud/test/dns/fixtures/cloudflare/records_GET_2.json new file mode 100644 index 0000000000..0c8c3152ff --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/records_GET_2.json @@ -0,0 +1,107 @@ +{ + "result": [ + { + "id": "r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4", + "type": "MX", + "name": "example.com", + "content": "mxa.mailgun.org", + "proxiable": false, + "proxied": false, + "ttl": 1, + "priority": 1, + "locked": false, + "modified_on": "2018-12-22T20:29:48.532399Z", + "created_on": "2018-12-22T20:29:48.532399Z", + "meta": { + "auto_added": true, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + { + "id": "r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5r5", + "type": "MX", + "name": "example.com", + "content": "mxb.mailgun.org", + "proxiable": false, + "proxied": false, + "ttl": 1, + "priority": 2, + "locked": false, + "modified_on": "2018-12-22T20:29:48.540671Z", + "created_on": "2018-12-22T20:29:48.540671Z", + "meta": { + "auto_added": true, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + { + "id": "r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6", + "type": "TXT", + "name": "example.com", + "content": "v=spf1 include:mailgun.org ~all", + "proxiable": false, + "proxied": false, + "ttl": 1, + "locked": false, + "modified_on": "2018-12-22T20:29:48.512931Z", + "created_on": "2018-12-22T20:29:48.512931Z", + "meta": { + "auto_added": true, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + { + "id": "r7r7r7r7r7r7r7r7r7r7r7r7r7r7r7r7", + "type": "TXT", + "name": "pic._domainkey.example.com", + "content": "k=rsa; ...", + "proxiable": false, + "proxied": false, + "ttl": 1, + "locked": false, + "modified_on": "2018-12-22T20:29:48.523230Z", + "created_on": "2018-12-22T20:29:48.523230Z", + "meta": { + "auto_added": true, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + { + "id": "r8", + "name": "test1", + "type": "CAA", + "content": "0\tissue\ttest.example.com", + "proxiable": false, + "proxied": false, + "ttl": 1, + "locked": false, + "data": { + "flags": 0, + "tag": "issue", + "value": "test.example.com" + }, + "meta": { + "auto_added": false, + "managed_by_apps": false, + "managed_by_argo_tunnel": false, + "source": "primary" + }, + "created_on": "2020-06-01T14:02:37.544331Z", + "modified_on": "2020-06-01T14:02:37.544331Z" + } + ], + "result_info": { + "page": 2, + "per_page": 5, + "total_pages": 2, + "count": 4, + "total_count": 9 + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/cloudflare/records_POST.json b/libcloud/test/dns/fixtures/cloudflare/records_POST.json new file mode 100644 index 0000000000..d5adf3f988 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/records_POST.json @@ -0,0 +1,22 @@ +{ + "result": { + "id": "412561327", + "type": "A", + "name": "test5.example.com", + "content": "127.0.0.3", + "proxiable": true, + "proxied": true, + "ttl": 1, + "locked": false, + "modified_on": "2018-12-22T21:28:00.801892Z", + "created_on": "2018-12-22T21:28:00.801892Z", + "meta": { + "auto_added": false, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/cloudflare/records_POST_sshfp.json b/libcloud/test/dns/fixtures/cloudflare/records_POST_sshfp.json new file mode 100644 index 0000000000..66b609f6c7 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/records_POST_sshfp.json @@ -0,0 +1,22 @@ +{ + "result": { + "id": "200", + "type": "SSHFP", + "name": "test_sshfp.example.com", + "content": "2 1 ABCDEF12345", + "proxiable": true, + "proxied": true, + "ttl": 1, + "locked": false, + "modified_on": "2018-12-22T21:28:00.801892Z", + "created_on": "2018-12-22T21:28:00.801892Z", + "meta": { + "auto_added": false, + "managed_by_apps": false, + "managed_by_argo_tunnel": false + } + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/cloudflare/zone_DELETE.json b/libcloud/test/dns/fixtures/cloudflare/zone_DELETE.json new file mode 100644 index 0000000000..a0732bc6f5 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/zone_DELETE.json @@ -0,0 +1,8 @@ +{ + "result": { + "id": "1234" + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/cloudflare/zone_GET.json b/libcloud/test/dns/fixtures/cloudflare/zone_GET.json new file mode 100644 index 0000000000..0e914a7e5f --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/zone_GET.json @@ -0,0 +1,93 @@ +{ + "result": { + "id": "1234", + "name": "example.com", + "status": "active", + "paused": false, + "type": "full", + "development_mode": 0, + "name_servers": [ + "anna.ns.cloudflare.com", + "john.ns.cloudflare.com" + ], + "original_name_servers": [ + "amir.ns.cloudflare.com", + "dee.ns.cloudflare.com" + ], + "original_registrar": null, + "original_dnshost": null, + "modified_on": "2019-05-30T01:43:01.509188Z", + "created_on": "2018-12-22T20:29:41.313041Z", + "activated_on": "2018-12-22T21:14:27.799913Z", + "meta": { + "step": 3, + "wildcard_proxiable": false, + "custom_certificate_quota": 0, + "page_rule_quota": 3, + "phishing_detected": false, + "multiple_railguns_allowed": false + }, + "owner": { + "id": "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", + "type": "user", + "email": "cloudflare@test.com" + }, + "account": { + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "name": "cloudflare@test.com" + }, + "permissions": [ + "#access:edit", + "#access:read", + "#analytics:read", + "#app:edit", + "#auditlogs:read", + "#billing:edit", + "#billing:read", + "#cache_purge:edit", + "#dns_records:edit", + "#dns_records:read", + "#lb:edit", + "#lb:read", + "#legal:edit", + "#legal:read", + "#logs:edit", + "#logs:read", + "#member:edit", + "#member:read", + "#organization:edit", + "#organization:read", + "#ssl:edit", + "#ssl:read", + "#stream:edit", + "#stream:read", + "#subscription:edit", + "#subscription:read", + "#waf:edit", + "#waf:read", + "#webhooks:edit", + "#webhooks:read", + "#worker:edit", + "#worker:read", + "#zone:edit", + "#zone:read", + "#zone_settings:edit", + "#zone_settings:read" + ], + "plan": { + "id": "0feeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + "name": "Free Website", + "price": 0, + "currency": "USD", + "frequency": "", + "is_subscribed": true, + "can_subscribe": false, + "legacy_id": "free", + "legacy_discount": false, + "externally_managed": false + } + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/cloudflare/zone_GET_400.json b/libcloud/test/dns/fixtures/cloudflare/zone_GET_400.json new file mode 100644 index 0000000000..2660e93573 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/zone_GET_400.json @@ -0,0 +1,15 @@ +{ + "success": false, + "errors": [ + { + "code": 7003, + "message": "Could not route to /zones/invalid, perhaps your object identifier is invalid?" + }, + { + "code": 7000, + "message": "No route for that URI" + } + ], + "messages": [], + "result": null +} diff --git a/libcloud/test/dns/fixtures/cloudflare/zone_GET_404.json b/libcloud/test/dns/fixtures/cloudflare/zone_GET_404.json new file mode 100644 index 0000000000..7fe3f0023c --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/zone_GET_404.json @@ -0,0 +1,11 @@ +{ + "success": false, + "errors": [ + { + "code": 1001, + "message": "Invalid zone identifier" + } + ], + "messages": [], + "result": null +} diff --git a/libcloud/test/dns/fixtures/cloudflare/zone_PATCH.json b/libcloud/test/dns/fixtures/cloudflare/zone_PATCH.json new file mode 100644 index 0000000000..ae641c9a23 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/zone_PATCH.json @@ -0,0 +1,93 @@ +{ + "result": { + "id": "1234", + "name": "example.com", + "status": "active", + "paused": true, + "type": "full", + "development_mode": 0, + "name_servers": [ + "anna.ns.cloudflare.com", + "john.ns.cloudflare.com" + ], + "original_name_servers": [ + "amir.ns.cloudflare.com", + "dee.ns.cloudflare.com" + ], + "original_registrar": null, + "original_dnshost": null, + "modified_on": "2019-05-30T01:43:02.509188Z", + "created_on": "2018-12-22T20:29:41.313041Z", + "activated_on": "2018-12-22T21:14:27.799913Z", + "meta": { + "step": 3, + "wildcard_proxiable": false, + "custom_certificate_quota": 0, + "page_rule_quota": 3, + "phishing_detected": false, + "multiple_railguns_allowed": false + }, + "owner": { + "id": "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", + "type": "user", + "email": "cloudflare@test.com" + }, + "account": { + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "name": "cloudflare@test.com" + }, + "permissions": [ + "#access:edit", + "#access:read", + "#analytics:read", + "#app:edit", + "#auditlogs:read", + "#billing:edit", + "#billing:read", + "#cache_purge:edit", + "#dns_records:edit", + "#dns_records:read", + "#lb:edit", + "#lb:read", + "#legal:edit", + "#legal:read", + "#logs:edit", + "#logs:read", + "#member:edit", + "#member:read", + "#organization:edit", + "#organization:read", + "#ssl:edit", + "#ssl:read", + "#stream:edit", + "#stream:read", + "#subscription:edit", + "#subscription:read", + "#waf:edit", + "#waf:read", + "#webhooks:edit", + "#webhooks:read", + "#worker:edit", + "#worker:read", + "#zone:edit", + "#zone:read", + "#zone_settings:edit", + "#zone_settings:read" + ], + "plan": { + "id": "0feeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + "name": "Free Website", + "price": 0, + "currency": "USD", + "frequency": "", + "is_subscribed": true, + "can_subscribe": false, + "legacy_id": "free", + "legacy_discount": false, + "externally_managed": false + } + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/cloudflare/zones_GET.json b/libcloud/test/dns/fixtures/cloudflare/zones_GET.json new file mode 100644 index 0000000000..da6e442091 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/zones_GET.json @@ -0,0 +1,102 @@ +{ + "result": [ + { + "id": "1234", + "name": "example.com", + "status": "active", + "paused": false, + "type": "full", + "development_mode": 0, + "name_servers": [ + "anna.ns.cloudflare.com", + "john.ns.cloudflare.com" + ], + "original_name_servers": [ + "amir.ns.cloudflare.com", + "dee.ns.cloudflare.com" + ], + "original_registrar": null, + "original_dnshost": null, + "modified_on": "2019-05-30T01:43:01.509188Z", + "created_on": "2018-12-22T20:29:41.313041Z", + "activated_on": "2018-12-22T21:14:27.799913Z", + "meta": { + "step": 3, + "wildcard_proxiable": false, + "custom_certificate_quota": 0, + "page_rule_quota": 3, + "phishing_detected": false, + "multiple_railguns_allowed": false + }, + "owner": { + "id": "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", + "type": "user", + "email": "cloudflare@test.com" + }, + "account": { + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "name": "cloudflare@test.com" + }, + "permissions": [ + "#access:edit", + "#access:read", + "#analytics:read", + "#app:edit", + "#auditlogs:read", + "#billing:edit", + "#billing:read", + "#cache_purge:edit", + "#dns_records:edit", + "#dns_records:read", + "#lb:edit", + "#lb:read", + "#legal:edit", + "#legal:read", + "#logs:edit", + "#logs:read", + "#member:edit", + "#member:read", + "#organization:edit", + "#organization:read", + "#ssl:edit", + "#ssl:read", + "#stream:edit", + "#stream:read", + "#subscription:edit", + "#subscription:read", + "#waf:edit", + "#waf:read", + "#webhooks:edit", + "#webhooks:read", + "#worker:edit", + "#worker:read", + "#zone:edit", + "#zone:read", + "#zone_settings:edit", + "#zone_settings:read" + ], + "plan": { + "id": "0feeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + "name": "Free Website", + "price": 0, + "currency": "USD", + "frequency": "", + "is_subscribed": true, + "can_subscribe": false, + "legacy_id": "free", + "legacy_discount": false, + "externally_managed": false + } + } + ], + "result_info": { + "page": 1, + "per_page": 20, + "total_pages": 1, + "count": 1, + "total_count": 1 + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/cloudflare/zones_POST.json b/libcloud/test/dns/fixtures/cloudflare/zones_POST.json new file mode 100644 index 0000000000..80435f6234 --- /dev/null +++ b/libcloud/test/dns/fixtures/cloudflare/zones_POST.json @@ -0,0 +1,93 @@ +{ + "result": { + "id": "6789", + "name": "example2.com", + "status": "pending", + "paused": false, + "type": "full", + "development_mode": 0, + "name_servers": [ + "anna.ns.cloudflare.com", + "john.ns.cloudflare.com" + ], + "original_name_servers": [ + "amir.ns.cloudflare.com", + "dee.ns.cloudflare.com" + ], + "original_registrar": null, + "original_dnshost": null, + "modified_on": "2019-05-30T02:09:25.975712Z", + "created_on": "2019-05-30T02:09:25.975712Z", + "activated_on": null, + "meta": { + "step": 4, + "wildcard_proxiable": false, + "custom_certificate_quota": 0, + "page_rule_quota": 3, + "phishing_detected": false, + "multiple_railguns_allowed": false + }, + "owner": { + "id": "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", + "type": "user", + "email": "cloudflare@test.com" + }, + "account": { + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "name": "cloudflare@test.com" + }, + "permissions": [ + "#access:edit", + "#access:read", + "#analytics:read", + "#app:edit", + "#auditlogs:read", + "#billing:edit", + "#billing:read", + "#cache_purge:edit", + "#dns_records:edit", + "#dns_records:read", + "#lb:edit", + "#lb:read", + "#legal:edit", + "#legal:read", + "#logs:edit", + "#logs:read", + "#member:edit", + "#member:read", + "#organization:edit", + "#organization:read", + "#ssl:edit", + "#ssl:read", + "#stream:edit", + "#stream:read", + "#subscription:edit", + "#subscription:read", + "#waf:edit", + "#waf:read", + "#webhooks:edit", + "#webhooks:read", + "#worker:edit", + "#worker:read", + "#zone:edit", + "#zone:read", + "#zone_settings:edit", + "#zone_settings:read" + ], + "plan": { + "id": "0feeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + "name": "Free Website", + "price": 0, + "currency": "USD", + "frequency": "", + "is_subscribed": true, + "can_subscribe": false, + "legacy_id": "free", + "legacy_discount": false, + "externally_managed": false + } + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains.json new file mode 100644 index 0000000000..f00d3a3693 --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains.json @@ -0,0 +1 @@ +{"domains":[{"name":"testdomain","ttl":1800,"zone_file":"$ORIGIN testdomain.\n$TTL 1800\ntestdomain. IN SOA ns1.digitalocean.com. hostmaster.testdomain. 1428768671 10800 3600 604800 1800\ntestdomain. 1800 IN NS ns1.digitalocean.com.\ntestdomain. 1800 IN NS ns2.digitalocean.com.\ntestdomain. 1800 IN NS ns3.digitalocean.com.\ntestdomain. 1800 IN A 123.45.67.89\n"}],"links":{},"meta":{"total":1}} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_CREATE.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_CREATE.json new file mode 100644 index 0000000000..b5b37f0ab4 --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_CREATE.json @@ -0,0 +1 @@ +{"domain":{"name":"testdomain","ttl":null,"zone_file":null}} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_EMPTY.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_EMPTY.json new file mode 100644 index 0000000000..2b7209c2ec --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_EMPTY.json @@ -0,0 +1 @@ +{"domains":[],"links":{},"meta":{"total":0}} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_UNAUTHORIZED.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_UNAUTHORIZED.json new file mode 100644 index 0000000000..415d9ef049 --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_UNAUTHORIZED.json @@ -0,0 +1 @@ +{"id":"unauthorized","message":"Unable to authenticate you."} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_UNPROCESSABLE_ENTITY.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_UNPROCESSABLE_ENTITY.json new file mode 100644 index 0000000000..102aa9d202 --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_UNPROCESSABLE_ENTITY.json @@ -0,0 +1 @@ +{"id":"unprocessable_entity","message":"Request body malformed."} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain.json new file mode 100644 index 0000000000..cf6cf378e2 --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain.json @@ -0,0 +1 @@ +{"domain":{"name":"testdomain","ttl":1800,"zone_file":"$ORIGIN testdomain.\n$TTL 1800\ntestdomain. IN SOA ns1.digitalocean.com. hostmaster.testdomain. 1428768671 10800 3600 604800 1800\ntestdomain. 1800 IN NS ns1.digitalocean.com.\ntestdomain. 1800 IN NS ns2.digitalocean.com.\ntestdomain. 1800 IN NS ns3.digitalocean.com.\ntestdomain. 1800 IN A 123.45.67.89\n"}} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_NOT_FOUND.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_NOT_FOUND.json new file mode 100644 index 0000000000..fa6104043b --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_NOT_FOUND.json @@ -0,0 +1 @@ +{"id":"not_found","message":"The resource you were accessing could not be found."} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records.json new file mode 100644 index 0000000000..fce3068ff3 --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records.json @@ -0,0 +1 @@ +{ "domain_records": [ { "id": 1234560, "type": "NS", "name": "@", "data": "ns1.digitalocean.com", "priority": null, "port": null, "ttl": 1800, "weight": null }, { "id": 1234561, "type": "NS", "name": "@", "data": "ns2.digitalocean.com", "priority": null, "port": null, "ttl": 1800, "weight": null }, { "id": 1234562, "type": "NS", "name": "@", "data": "ns3.digitalocean.com", "priority": null, "port": null, "ttl": 1800, "weight": null }, { "id": 1234564, "type": "A", "name": "@", "data": "123.45.67.89", "priority": null, "port": null, "ttl": 1800, "weight": null }, { "id": 1234567, "type": "A", "name": "@", "data": "123.45.67.99", "priority": null, "port": null, "weight": null } ], "links": {}, "meta": { "total": 5 } } diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234560.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234560.json new file mode 100644 index 0000000000..b7dec294f3 --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234560.json @@ -0,0 +1 @@ +{"domain_record":{"id":1234560,"type":"NS","name":"@","data":"ns1.digitalocean.com","priority":null,"port":null,"ttl": 1800,"weight":null}} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234561.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234561.json new file mode 100644 index 0000000000..aa8638da17 --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234561.json @@ -0,0 +1 @@ +{"domain_record":{"id":1234561,"type":"NS","name":"@","data":"ns2.digitalocean.com","priority":null,"port":null,"ttl": 1800,"weight":null}} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234562.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234562.json new file mode 100644 index 0000000000..c35697c972 --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234562.json @@ -0,0 +1 @@ +{"domain_record":{"id":1234563,"type":"NS","name":"@","data":"ns3.digitalocean.com","priority":null,"port":null,"ttl": 1800,"weight":null}} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234564.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234564.json new file mode 100644 index 0000000000..0d76ab4bc8 --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234564.json @@ -0,0 +1 @@ +{"domain_record":{"id":1234564,"type":"A","name":"@","data":"123.45.67.89","priority":null,"port":null,"ttl": 1800,"weight":null}} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234564_NOT_FOUND.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234564_NOT_FOUND.json new file mode 100644 index 0000000000..fa6104043b --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234564_NOT_FOUND.json @@ -0,0 +1 @@ +{"id":"not_found","message":"The resource you were accessing could not be found."} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234564_UPDATE.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234564_UPDATE.json new file mode 100644 index 0000000000..4ac1da8d14 --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_1234564_UPDATE.json @@ -0,0 +1 @@ +{"domain_record":{"id":1234564,"type":"A","name":"@","data":"234.56.78.90","priority":null,"port":null,"ttl": 60,"weight":null}} diff --git a/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_CREATE.json b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_CREATE.json new file mode 100644 index 0000000000..74ff10f1ac --- /dev/null +++ b/libcloud/test/dns/fixtures/digitalocean/_v2_domains_testdomain_records_CREATE.json @@ -0,0 +1 @@ +{"domain_record":{"id":1234565,"type":"A","name":"sub","data":"234.56.78.90","priority":null,"port":null,"ttl": 60,"weight":null}} diff --git a/libcloud/test/dns/fixtures/dnsimple/create_domain.json b/libcloud/test/dns/fixtures/dnsimple/create_domain.json new file mode 100644 index 0000000000..ace9f32a04 --- /dev/null +++ b/libcloud/test/dns/fixtures/dnsimple/create_domain.json @@ -0,0 +1,20 @@ +{ + "domain": { + "id": 1, + "user_id": 21, + "registrant_id": 321, + "name": "example.com", + "unicode_name": "example.com", + "token": "domain-token", + "state": "hosted", + "language": null, + "lockable": false, + "auto_renew": true, + "whois_protected": false, + "record_count": 5, + "service_count": 1, + "expires_on": null, + "created_at": "2012-09-27T14:25:57.646Z", + "updated_at": "2014-12-15T20:27:04.552Z" + } +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnsimple/create_domain_record.json b/libcloud/test/dns/fixtures/dnsimple/create_domain_record.json new file mode 100644 index 0000000000..4534a9d154 --- /dev/null +++ b/libcloud/test/dns/fixtures/dnsimple/create_domain_record.json @@ -0,0 +1,13 @@ +{ + "record": { + "content": "mail.example.com", + "created_at": "2013-01-29T14:25:38Z", + "domain_id": 28, + "id": 172, + "name": "", + "prio": 10, + "record_type": "MX", + "ttl": 3600, + "updated_at": "2013-01-29T14:25:38Z" + } +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnsimple/get_domain.json b/libcloud/test/dns/fixtures/dnsimple/get_domain.json new file mode 100644 index 0000000000..ae2dda9cee --- /dev/null +++ b/libcloud/test/dns/fixtures/dnsimple/get_domain.json @@ -0,0 +1,20 @@ +{ + "domain": { + "id": 1, + "user_id": 21, + "registrant_id": 321, + "name": "example.com", + "unicode_name": "example.com", + "token": "domain-token", + "state": "registered", + "language": null, + "lockable": false, + "auto_renew": true, + "whois_protected": false, + "record_count": 5, + "service_count": 1, + "expires_on": "2015-09-27", + "created_at": "2012-09-27T14:25:57.646Z", + "updated_at": "2014-12-15T20:27:04.552Z" + } +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnsimple/get_domain_record.json b/libcloud/test/dns/fixtures/dnsimple/get_domain_record.json new file mode 100644 index 0000000000..08d666549e --- /dev/null +++ b/libcloud/test/dns/fixtures/dnsimple/get_domain_record.json @@ -0,0 +1,13 @@ +{ + "record": { + "name": "www", + "ttl": 3600, + "created_at": "2010-07-01T08:01:18Z", + "updated_at": "2010-10-21T15:47:47Z", + "domain_id": 1, + "id": 123, + "content": "example.com", + "record_type": "CNAME", + "prio": null + } +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnsimple/list_domain_records.json b/libcloud/test/dns/fixtures/dnsimple/list_domain_records.json new file mode 100644 index 0000000000..71a6ff94fa --- /dev/null +++ b/libcloud/test/dns/fixtures/dnsimple/list_domain_records.json @@ -0,0 +1,42 @@ +[ + { + "record": { + "name": "", + "ttl": 3600, + "created_at": "2010-07-04T04:41:31Z", + "updated_at": "2010-10-21T15:47:47Z", + "domain_id": 1, + "id": 31, + "content": "1.2.3.4", + "record_type": "A", + "prio": null + } + }, + { + "record": { + "name": "www", + "ttl": 3600, + "created_at": "2010-07-01T08:01:18Z", + "updated_at": "2010-10-21T15:47:47Z", + "domain_id": 1, + "id": 2, + "content": "example.com", + "record_type": "CNAME", + "prio": null + } + }, + { + "record": { + "name": "", + "ttl": 3600, + "created_at": "2010-07-04T04:42:11Z", + "updated_at": "2010-10-21T15:47:47Z", + "pdns_identifier": "40", + "domain_id": 1, + "id": 32, + "content": "mail.example.com", + "record_type": "MX", + "prio": 10 + } + } +] \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnsimple/list_domains.json b/libcloud/test/dns/fixtures/dnsimple/list_domains.json new file mode 100644 index 0000000000..282cc30978 --- /dev/null +++ b/libcloud/test/dns/fixtures/dnsimple/list_domains.json @@ -0,0 +1,42 @@ +[ + { + "domain": { + "id": 1, + "user_id": 21, + "registrant_id": 321, + "name": "example.com", + "unicode_name": "example.com", + "token": "domain-token", + "state": "registered", + "language": null, + "lockable": false, + "auto_renew": true, + "whois_protected": false, + "record_count": 5, + "service_count": 1, + "expires_on": "2015-09-27", + "created_at": "2012-09-27T14:25:57.646Z", + "updated_at": "2014-12-15T20:27:04.552Z" + } + }, + { + "domain": { + "id": 2, + "user_id": 22, + "registrant_id": 322, + "name": "example.com", + "unicode_name": "example.it", + "token": "domain-token", + "state": "hosted", + "language": null, + "lockable": false, + "auto_renew": true, + "whois_protected": false, + "record_count": 5, + "service_count": 1, + "expires_on": null, + "created_at": "2012-09-27T14:25:57.646Z", + "updated_at": "2014-12-15T20:27:04.552Z" + } + } +] \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnsimple/update_domain_record.json b/libcloud/test/dns/fixtures/dnsimple/update_domain_record.json new file mode 100644 index 0000000000..92036635c0 --- /dev/null +++ b/libcloud/test/dns/fixtures/dnsimple/update_domain_record.json @@ -0,0 +1,13 @@ +{ + "record": { + "name": "www", + "ttl": 4500, + "created_at": "2010-07-01T08:01:18Z", + "updated_at": "2010-10-21T15:47:47Z", + "domain_id": 1, + "id": 123, + "content": "updated.com", + "record_type": "CNAME", + "prio": null + } +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnspod/create_zone_success.json b/libcloud/test/dns/fixtures/dnspod/create_zone_success.json new file mode 100644 index 0000000000..663db1c164 --- /dev/null +++ b/libcloud/test/dns/fixtures/dnspod/create_zone_success.json @@ -0,0 +1,12 @@ +{ + "status": { + "code":"1", + "message":"Action completed successful", + "created_at":"2012-08-29 22:12:35" + }, + "domain": { + "id":"3", + "punycode":"api2.com", + "domain":"api2.com" + } +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnspod/delete_record_record_does_not_exist.json b/libcloud/test/dns/fixtures/dnspod/delete_record_record_does_not_exist.json new file mode 100644 index 0000000000..937cc46801 --- /dev/null +++ b/libcloud/test/dns/fixtures/dnspod/delete_record_record_does_not_exist.json @@ -0,0 +1 @@ +{"status": {"message": "Record id invalid", "code": "8", "created_at": "2016-05-13 15:05:46"}} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnspod/delete_record_success.json b/libcloud/test/dns/fixtures/dnspod/delete_record_success.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/test/dns/fixtures/dnspod/delete_zone_success.json b/libcloud/test/dns/fixtures/dnspod/delete_zone_success.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libcloud/test/dns/fixtures/dnspod/empty_zones_list.json b/libcloud/test/dns/fixtures/dnspod/empty_zones_list.json new file mode 100644 index 0000000000..4b97ed2230 --- /dev/null +++ b/libcloud/test/dns/fixtures/dnspod/empty_zones_list.json @@ -0,0 +1 @@ +{"status":{"code":"9","message":"No domains","created_at":"2016-04-24 19:02:23"}} diff --git a/libcloud/test/dns/fixtures/dnspod/get_record.json b/libcloud/test/dns/fixtures/dnspod/get_record.json new file mode 100644 index 0000000000..8462239ed5 --- /dev/null +++ b/libcloud/test/dns/fixtures/dnspod/get_record.json @@ -0,0 +1,26 @@ +{ + "status": { + "code": "1", + "message": "Action completed successful", + "created_at": "2014-06-05 10:07:05" + }, + "domain": { + "id": "9", + "domain": "dnspod.com", + "domain_grade": "DP_Free" + }, + "record": { + "id": "50", + "sub_domain": "@", + "record_type": "A", + "record_line": "Default", + "value": "96.126.115.73", + "mx": "0", + "ttl": "600", + "enabled": "1", + "monitor_status": "", + "remark": "", + "updated_on": "2014-06-05 09:47:59", + "domain_id": "9" + } +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnspod/get_zone_success.json b/libcloud/test/dns/fixtures/dnspod/get_zone_success.json new file mode 100644 index 0000000000..725eef703f --- /dev/null +++ b/libcloud/test/dns/fixtures/dnspod/get_zone_success.json @@ -0,0 +1,28 @@ +{ + "status": { + "code": "1", + "message": "Action completed successful", + "created_at": "2014-06-04 21:25:21" + }, + "domain": { + "id": "6", + "name": "dnspod.com", + "punycode": "dnspod.com", + "grade": "DP_Free", + "grade_title": "Free", + "status": "enable", + "ext_status": "notexist", + "records": "3", + "group_id": "1", + "is_mark": "no", + "remark": false, + "is_vip": "no", + "searchengine_push": "yes", + "beian": "no", + "user_id": "730060", + "created_on": "2014-06-04 16:19:31", + "updated_on": "2014-06-04 16:20:05", + "ttl": "600", + "owner": "yizero@qq.com" + } +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnspod/list_records.json b/libcloud/test/dns/fixtures/dnspod/list_records.json new file mode 100644 index 0000000000..c44c12b5fe --- /dev/null +++ b/libcloud/test/dns/fixtures/dnspod/list_records.json @@ -0,0 +1,93 @@ +{ + "status": { + "code": "1", + "message": "Action completed successful", + "created_at": "2014-06-05 09:58:40" + }, + "domain": { + "id": "9", + "name": "dnspod.com", + "punycode": "dnspod.com", + "grade": "DP_Free", + "owner": "yizerowu@dnspod.com" + }, + "info": { + "sub_domains": "5", + "record_total": "5" + }, + "records": [ + { + "id": "50", + "name": "@", + "line": "Default", + "type": "A", + "ttl": "600", + "value": "96.126.115.73", + "mx": "0", + "enabled": "1", + "status": "enabled", + "monitor_status": "", + "remark": "", + "updated_on": "2014-06-05 09:47:59" + }, + { + "id": "49", + "name": "@", + "line": "Default", + "type": "MX", + "ttl": "600", + "value": "cloudmx.qq.com.", + "mx": "5", + "enabled": "1", + "status": "enabled", + "monitor_status": "", + "remark": "", + "updated_on": "2014-06-05 09:47:59" + }, + { + "id": "46", + "name": "@", + "line": "Default", + "type": "NS", + "ttl": "600", + "value": "a.dnspod.com.", + "mx": "0", + "enabled": "1", + "status": "enabled", + "monitor_status": "", + "remark": "", + "updated_on": "2014-06-05 09:47:40", + "hold": "hold" + }, + { + "id": "47", + "name": "@", + "line": "Default", + "type": "NS", + "ttl": "600", + "value": "b.dnspod.com.", + "mx": "0", + "enabled": "1", + "status": "enabled", + "monitor_status": "", + "remark": "", + "updated_on": "2014-06-05 09:47:40", + "hold": "hold" + }, + { + "id": "48", + "name": "@", + "line": "Default", + "type": "NS", + "ttl": "600", + "value": "c.dnspod.com.", + "mx": "0", + "enabled": "1", + "status": "enabled", + "monitor_status": "", + "remark": "", + "updated_on": "2014-06-05 09:47:40", + "hold": "hold" + } + ] + } \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnspod/list_zones.json b/libcloud/test/dns/fixtures/dnspod/list_zones.json new file mode 100644 index 0000000000..c8c367c92e --- /dev/null +++ b/libcloud/test/dns/fixtures/dnspod/list_zones.json @@ -0,0 +1,42 @@ +{ + "status": { + "code": "1", + "message": "Action completed successful", + "created_at": "2014-06-04 21:22:08" + }, + "info": { + "domain_total": 1, + "all_total": 1, + "mine_total": 1, + "share_total": 0, + "vip_total": 0, + "ismark_total": 0, + "pause_total": 0, + "error_total": 1, + "lock_total": 0, + "spam_total": 0, + "vip_expire": 0, + "share_out_total": 0 + }, + "domains": [ + { + "id": 6, + "name": "dnspod.com", + "grade": "DP_Free", + "grade_title": "Free", + "status": "enable", + "ext_status": "notexist", + "records": "3", + "group_id": "1", + "is_mark": "no", + "remark": "", + "is_vip": "no", + "searchengine_push": "yes", + "beian": "no", + "created_on": "2014-06-04 16:19:31", + "updated_on": "2014-06-04 16:20:05", + "ttl": "600", + "owner": "yizero@qq.com" + } + ] +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnspod/record_already_exists.json b/libcloud/test/dns/fixtures/dnspod/record_already_exists.json new file mode 100644 index 0000000000..e7ed523bea --- /dev/null +++ b/libcloud/test/dns/fixtures/dnspod/record_already_exists.json @@ -0,0 +1,8 @@ +{ + "status": + { + "message": "Record impacted, same record exists or CNAME/URL impacted", + "code": "31", + "created_at": "2016-05-15 16:16:41" + } +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnspod/zone_already_exists.json b/libcloud/test/dns/fixtures/dnspod/zone_already_exists.json new file mode 100644 index 0000000000..4eddb978c4 --- /dev/null +++ b/libcloud/test/dns/fixtures/dnspod/zone_already_exists.json @@ -0,0 +1 @@ +{"status": {"message": "Domain is exists", "code": "7", "created_at": "2016-05-08 20:24:50"}} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/dnspod/zone_does_not_exist.json b/libcloud/test/dns/fixtures/dnspod/zone_does_not_exist.json new file mode 100644 index 0000000000..e529872a2e --- /dev/null +++ b/libcloud/test/dns/fixtures/dnspod/zone_does_not_exist.json @@ -0,0 +1 @@ +{"status": {"message": "Domain id invalid", "code": "6", "created_at": "2016-05-08 18:50:57"}} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/create_record_NO_EXTRA_PARAMS.xml b/libcloud/test/dns/fixtures/durabledns/create_record_NO_EXTRA_PARAMS.xml new file mode 100644 index 0000000000..c9e1059ed9 --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/create_record_NO_EXTRA_PARAMS.xml @@ -0,0 +1,8 @@ + + + + + 353367855 + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/create_record_WITH_EXTRA_PARAMS.xml b/libcloud/test/dns/fixtures/durabledns/create_record_WITH_EXTRA_PARAMS.xml new file mode 100644 index 0000000000..c9e1059ed9 --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/create_record_WITH_EXTRA_PARAMS.xml @@ -0,0 +1,8 @@ + + + + + 353367855 + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/create_record_ZONE_DOES_NOT_EXIST.xml b/libcloud/test/dns/fixtures/durabledns/create_record_ZONE_DOES_NOT_EXIST.xml new file mode 100644 index 0000000000..d316e574ec --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/create_record_ZONE_DOES_NOT_EXIST.xml @@ -0,0 +1,11 @@ + + + + + SERVER + + Zone does not exist + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/create_zone.xml b/libcloud/test/dns/fixtures/durabledns/create_zone.xml new file mode 100644 index 0000000000..b99331945e --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/create_zone.xml @@ -0,0 +1,8 @@ + + + + + 302811 + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/create_zone_ZONE_ALREADY_EXIST.xml b/libcloud/test/dns/fixtures/durabledns/create_zone_ZONE_ALREADY_EXIST.xml new file mode 100644 index 0000000000..0663787e62 --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/create_zone_ZONE_ALREADY_EXIST.xml @@ -0,0 +1,11 @@ + + + + + SERVER + + Zone Already Exists + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/delete_record.xml b/libcloud/test/dns/fixtures/durabledns/delete_record.xml new file mode 100644 index 0000000000..146648ebec --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/delete_record.xml @@ -0,0 +1,8 @@ + + + + + Success + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/delete_record_RECORD_DOES_NOT_EXIST.xml b/libcloud/test/dns/fixtures/durabledns/delete_record_RECORD_DOES_NOT_EXIST.xml new file mode 100644 index 0000000000..14b22481ce --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/delete_record_RECORD_DOES_NOT_EXIST.xml @@ -0,0 +1,8 @@ + + + + + Record does not exists + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/delete_record_ZONE_DOES_NOT_EXIST.xml b/libcloud/test/dns/fixtures/durabledns/delete_record_ZONE_DOES_NOT_EXIST.xml new file mode 100644 index 0000000000..a9b3c123a2 --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/delete_record_ZONE_DOES_NOT_EXIST.xml @@ -0,0 +1,11 @@ + + + + + SERVER + + Zone does not exist + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/delete_zone.xml b/libcloud/test/dns/fixtures/durabledns/delete_zone.xml new file mode 100644 index 0000000000..2a014a73b6 --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/delete_zone.xml @@ -0,0 +1,8 @@ + + + + + Success + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/delete_zone_ZONE_DOES_NOT_EXIST.xml b/libcloud/test/dns/fixtures/durabledns/delete_zone_ZONE_DOES_NOT_EXIST.xml new file mode 100644 index 0000000000..d316e574ec --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/delete_zone_ZONE_DOES_NOT_EXIST.xml @@ -0,0 +1,11 @@ + + + + + SERVER + + Zone does not exist + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/get_record.xml b/libcloud/test/dns/fixtures/durabledns/get_record.xml new file mode 100644 index 0000000000..31471d5888 --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/get_record.xml @@ -0,0 +1,13 @@ + + + + + 353286987 + record1 + A + 192.168.0.1 + 1 + 3600 + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/get_record_RECORD_DOES_NOT_EXIST.xml b/libcloud/test/dns/fixtures/durabledns/get_record_RECORD_DOES_NOT_EXIST.xml new file mode 100644 index 0000000000..226ac999fd --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/get_record_RECORD_DOES_NOT_EXIST.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/get_record_ZONE_DOES_NOT_EXIST.xml b/libcloud/test/dns/fixtures/durabledns/get_record_ZONE_DOES_NOT_EXIST.xml new file mode 100644 index 0000000000..d316e574ec --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/get_record_ZONE_DOES_NOT_EXIST.xml @@ -0,0 +1,11 @@ + + + + + SERVER + + Zone does not exist + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/get_zone.xml b/libcloud/test/dns/fixtures/durabledns/get_zone.xml new file mode 100644 index 0000000000..9bac17f8ab --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/get_zone.xml @@ -0,0 +1,17 @@ + + + + myzone.com. + ns1.durabledns.com. + mail.myzone.com + 1437473456 + 13000 + 7200 + 1300 + 13 + 1300 + 127.0.0.1/32 + 127.0.0.1/32,127.0.0.100/32 + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/get_zone_NO_EXTRA_PARAMS.xml b/libcloud/test/dns/fixtures/durabledns/get_zone_NO_EXTRA_PARAMS.xml new file mode 100644 index 0000000000..423e83f869 --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/get_zone_NO_EXTRA_PARAMS.xml @@ -0,0 +1,17 @@ + + + + myzone.com. + ns1.durabledns.com. + support.durabledns.com + 1437473456 + 28800 + 7200 + 604800 + 82000 + 3600 + + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/get_zone_UPDATE_ZONE.xml b/libcloud/test/dns/fixtures/durabledns/get_zone_UPDATE_ZONE.xml new file mode 100644 index 0000000000..e123e171a0 --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/get_zone_UPDATE_ZONE.xml @@ -0,0 +1,17 @@ + + + + myzone.com. + ns1.durabledns.com. + mail.myzone.com + 1437475078 + 13000 + 7200 + 8000 + 5000 + 4000 + 127.0.0.1 + 127.0.0.1 + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/get_zone_WITH_EXTRA_PARAMS.xml b/libcloud/test/dns/fixtures/durabledns/get_zone_WITH_EXTRA_PARAMS.xml new file mode 100644 index 0000000000..57e1a8ff90 --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/get_zone_WITH_EXTRA_PARAMS.xml @@ -0,0 +1,17 @@ + + + + myzone.com. + ns1.durabledns.com. + mail.myzone.com + 1437473456 + 28800 + 7200 + 604800 + 50000 + 4000 + + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/get_zone_ZONE_DOES_NOT_EXIST.xml b/libcloud/test/dns/fixtures/durabledns/get_zone_ZONE_DOES_NOT_EXIST.xml new file mode 100644 index 0000000000..d316e574ec --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/get_zone_ZONE_DOES_NOT_EXIST.xml @@ -0,0 +1,11 @@ + + + + + SERVER + + Zone does not exist + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/list_records.xml b/libcloud/test/dns/fixtures/durabledns/list_records.xml new file mode 100644 index 0000000000..aef6bb3ec8 --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/list_records.xml @@ -0,0 +1,21 @@ + + + + + + + 353286987 + record1 + A + 192.168.0.1 + + + 353286997 + record2 + A + 127.0.0.1 + + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/list_records_ZONE_DOES_NOT_EXIST.xml b/libcloud/test/dns/fixtures/durabledns/list_records_ZONE_DOES_NOT_EXIST.xml new file mode 100644 index 0000000000..d316e574ec --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/list_records_ZONE_DOES_NOT_EXIST.xml @@ -0,0 +1,11 @@ + + + + + SERVER + + Zone does not exist + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/list_zones.xml b/libcloud/test/dns/fixtures/durabledns/list_zones.xml new file mode 100644 index 0000000000..e0e969201c --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/list_zones.xml @@ -0,0 +1,15 @@ + + + + + + + myzone.com. + + + myzone2.com. + + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/update_record.xml b/libcloud/test/dns/fixtures/durabledns/update_record.xml new file mode 100644 index 0000000000..9e5645d3ae --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/update_record.xml @@ -0,0 +1,8 @@ + + + + + Success + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/update_record_ZONE_DOES_NOT_EXIST.xml b/libcloud/test/dns/fixtures/durabledns/update_record_ZONE_DOES_NOT_EXIST.xml new file mode 100644 index 0000000000..d316e574ec --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/update_record_ZONE_DOES_NOT_EXIST.xml @@ -0,0 +1,11 @@ + + + + + SERVER + + Zone does not exist + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/update_record_success.xml b/libcloud/test/dns/fixtures/durabledns/update_record_success.xml new file mode 100644 index 0000000000..2555ae6bad --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/update_record_success.xml @@ -0,0 +1,14 @@ +\n + + \n + + \n + + \n + \n Success\n + \n + + \n + + \n + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/update_zone_UPDATE_ZONE.xml b/libcloud/test/dns/fixtures/durabledns/update_zone_UPDATE_ZONE.xml new file mode 100644 index 0000000000..dd1c0f78f3 --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/update_zone_UPDATE_ZONE.xml @@ -0,0 +1,8 @@ + + + + + Success + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/durabledns/update_zone_ZONE_DOES_NOT_EXIST.xml b/libcloud/test/dns/fixtures/durabledns/update_zone_ZONE_DOES_NOT_EXIST.xml new file mode 100644 index 0000000000..d316e574ec --- /dev/null +++ b/libcloud/test/dns/fixtures/durabledns/update_zone_ZONE_DOES_NOT_EXIST.xml @@ -0,0 +1,11 @@ + + + + + SERVER + + Zone does not exist + + + + \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/gandi/list_records.xml b/libcloud/test/dns/fixtures/gandi/list_records.xml index e91c565448..2499036dd1 100644 --- a/libcloud/test/dns/fixtures/gandi/list_records.xml +++ b/libcloud/test/dns/fixtures/gandi/list_records.xml @@ -78,7 +78,33 @@ 208.111.35.173 + + + + + + id + 47234 + + + name + + + + ttl + 86400 + + + type + MX + + + value + 15 aspmx.l.google.com + + + diff --git a/libcloud/test/dns/fixtures/gandi_live/create_bad_zone.json b/libcloud/test/dns/fixtures/gandi_live/create_bad_zone.json new file mode 100644 index 0000000000..ebf2faed35 --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/create_bad_zone.json @@ -0,0 +1,6 @@ +{ + "code": 409, + "message": "Zone badexample.com already exists", + "object": "HTTPConflict", + "cause": "Duplicate Entry" +} diff --git a/libcloud/test/dns/fixtures/gandi_live/create_domain.json b/libcloud/test/dns/fixtures/gandi_live/create_domain.json new file mode 100644 index 0000000000..6a3b89bc2e --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/create_domain.json @@ -0,0 +1,3 @@ +{ + "message": "Domain Created" +} diff --git a/libcloud/test/dns/fixtures/gandi_live/create_existing_record.json b/libcloud/test/dns/fixtures/gandi_live/create_existing_record.json new file mode 100644 index 0000000000..c084fef37f --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/create_existing_record.json @@ -0,0 +1,6 @@ +{ + "code": 409, + "message": "Record bob already exists", + "object": "HTTPConflict", + "cause": "Duplicate Entry" +} diff --git a/libcloud/test/dns/fixtures/gandi_live/create_record.json b/libcloud/test/dns/fixtures/gandi_live/create_record.json new file mode 100644 index 0000000000..75ee54a67c --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/create_record.json @@ -0,0 +1,3 @@ +{ + "message": "Zone Record Created" +} diff --git a/libcloud/test/dns/fixtures/gandi_live/create_zone.json b/libcloud/test/dns/fixtures/gandi_live/create_zone.json new file mode 100644 index 0000000000..7404cffc33 --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/create_zone.json @@ -0,0 +1,3 @@ +{ + "message": "Zone Created" +} diff --git a/libcloud/test/dns/fixtures/gandi_live/get_bad_zone.json b/libcloud/test/dns/fixtures/gandi_live/get_bad_zone.json new file mode 100644 index 0000000000..b929cbb6bc --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/get_bad_zone.json @@ -0,0 +1,9 @@ +{ + "zone_uuid": "12346" + "domain_keys_href": "https://dns.api.gandi.net/api/v5/domains/badexample.com/keys", + "fqdn": "badexample.com", + "zone_href": "https://dns.api.gandi.net/api/v5/zones/12346", + "zone_records_href": "https://dns.api.gandi.net/api/v5/zones/12346/records", + "domain_records_href": "https://dns.api.gandi.net/api/v5/domains/badexample.com/records", + "domain_href": "https://dns.api.gandi.net/api/v5/domains/badexample.com" +} diff --git a/libcloud/test/dns/fixtures/gandi_live/get_mx_record.json b/libcloud/test/dns/fixtures/gandi_live/get_mx_record.json new file mode 100644 index 0000000000..eb1aad4eb0 --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/get_mx_record.json @@ -0,0 +1,9 @@ +{ + "rrset_type": "MX", + "rrset_ttl": 10800, + "rrset_name": "lists", + "rrset_values": [ + "10 mail", + "20 mail2" + ] +} diff --git a/libcloud/test/dns/fixtures/gandi_live/get_nonexistent_record.json b/libcloud/test/dns/fixtures/gandi_live/get_nonexistent_record.json new file mode 100644 index 0000000000..3ede42a876 --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/get_nonexistent_record.json @@ -0,0 +1,6 @@ +{ + "code": 404, + "message": "Unknown record", + "object": "LocalizedHTTPNotFound", + "cause": "Not Found" +} diff --git a/libcloud/test/dns/fixtures/gandi_live/get_nonexistent_zone.json b/libcloud/test/dns/fixtures/gandi_live/get_nonexistent_zone.json new file mode 100644 index 0000000000..a9e5f58c88 --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/get_nonexistent_zone.json @@ -0,0 +1,6 @@ +{ + "code": 404, + "message": "Unknown zone", + "object": "LocalizedHTTPNotFound", + "cause": "Not Found" +} diff --git a/libcloud/test/dns/fixtures/gandi_live/get_record.json b/libcloud/test/dns/fixtures/gandi_live/get_record.json new file mode 100644 index 0000000000..be94391c00 --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/get_record.json @@ -0,0 +1,8 @@ +{ + "rrset_type": "A", + "rrset_ttl": 9600, + "rrset_name": "bob", + "rrset_values": [ + "127.0.1.1" + ] +} diff --git a/libcloud/test/dns/fixtures/gandi_live/get_zone.json b/libcloud/test/dns/fixtures/gandi_live/get_zone.json new file mode 100644 index 0000000000..bb8724ce34 --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/get_zone.json @@ -0,0 +1,9 @@ +{ + "zone_uuid": "12345", + "domain_keys_href": "https://dns.api.gandi.net/api/v5/domains/example.com/keys", + "fqdn": "example.com", + "zone_href": "https://dns.api.gandi.net/api/v5/zones/12345", + "zone_records_href": "https://dns.api.gandi.net/api/v5/zones/12345/records", + "domain_records_href": "https://dns.api.gandi.net/api/v5/domains/example.com/records", + "domain_href": "https://dns.api.gandi.net/api/v5/domains/example.com" +} diff --git a/libcloud/test/dns/fixtures/gandi_live/list_records.json b/libcloud/test/dns/fixtures/gandi_live/list_records.json new file mode 100644 index 0000000000..bfba5e1a8a --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/list_records.json @@ -0,0 +1,26 @@ +[ + { + "rrset_type": "A", + "rrset_ttl": 10800, + "rrset_name": "@", + "rrset_values": [ + "127.0.0.1" + ] + }, + { + "rrset_type": "CNAME", + "rrset_ttl": 3600, + "rrset_name": "www", + "rrset_values": [ + "bob.example.com." + ] + }, + { + "rrset_type": "A", + "rrset_ttl": 9600, + "rrset_name": "bob", + "rrset_values": [ + "127.0.1.1" + ] + } +] diff --git a/libcloud/test/dns/fixtures/gandi_live/list_records_bind.txt b/libcloud/test/dns/fixtures/gandi_live/list_records_bind.txt new file mode 100644 index 0000000000..177b3b4c22 --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/list_records_bind.txt @@ -0,0 +1,3 @@ +@ 10800 IN A 127.0.0.1 +www 3600 IN CNAME bob.example.com. +bob 9600 IN A 127.0.1.1 diff --git a/libcloud/test/dns/fixtures/gandi_live/list_zones.json b/libcloud/test/dns/fixtures/gandi_live/list_zones.json new file mode 100644 index 0000000000..551fa46bc5 --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/list_zones.json @@ -0,0 +1,12 @@ +[ + { + "fqdn": "example.com", + "domain_href": "https://dns.api.gandi.net/api/v5/domains/example.com", + "domain_records_href": "https://dns.api.gandi.net/api/v5/domains/example.com/records" + }, + { + "fqdn": "example.net", + "domain_href": "https://dns.api.gandi.net/api/v5/domains/example.net", + "domain_records_href": "https://dns.api.gandi.net/api/v5/domains/example.net/records" + } +] diff --git a/libcloud/test/dns/fixtures/gandi_live/update_bad_record.json b/libcloud/test/dns/fixtures/gandi_live/update_bad_record.json new file mode 100644 index 0000000000..ee5cd32153 --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/update_bad_record.json @@ -0,0 +1,13 @@ +{ + "code": 400, + "message": "foo must be set", + "object": "HTTPBadRequest", + "cause": "No foo set.", + "errors": [ + { + "location": "body", + "name": "foo", + "description": "'' is not a foo" + } + ] +} diff --git a/libcloud/test/dns/fixtures/gandi_live/update_gandi_zone.json b/libcloud/test/dns/fixtures/gandi_live/update_gandi_zone.json new file mode 100644 index 0000000000..049733ffe4 --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/update_gandi_zone.json @@ -0,0 +1,3 @@ +{ + "message": "Request Accepted" +} diff --git a/libcloud/test/dns/fixtures/gandi_live/update_mx_record.json b/libcloud/test/dns/fixtures/gandi_live/update_mx_record.json new file mode 100644 index 0000000000..253d7f64df --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/update_mx_record.json @@ -0,0 +1,3 @@ +{ + "message": "Zone Record Updated" +} diff --git a/libcloud/test/dns/fixtures/gandi_live/update_record.json b/libcloud/test/dns/fixtures/gandi_live/update_record.json new file mode 100644 index 0000000000..253d7f64df --- /dev/null +++ b/libcloud/test/dns/fixtures/gandi_live/update_record.json @@ -0,0 +1,3 @@ +{ + "message": "Zone Record Updated" +} diff --git a/libcloud/test/dns/fixtures/godaddy/purchase_request.json b/libcloud/test/dns/fixtures/godaddy/purchase_request.json new file mode 100644 index 0000000000..cd7533b1b1 --- /dev/null +++ b/libcloud/test/dns/fixtures/godaddy/purchase_request.json @@ -0,0 +1,88 @@ +{ + "domain": " ", + "consent": { + "agreementKeys": [ + " " + ], + "agreedBy": " ", + "agreedAt": " " + }, + "period": 1, + "nameServers": [ + " " + ], + "renewAuto": true, + "privacy": false, + "contactRegistrant": { + "nameFirst": " ", + "nameMiddle": " ", + "nameLast": " ", + "organization": " ", + "jobTitle": " ", + "email": " ", + "phone": " ", + "fax": " ", + "addressMailing": { + "address1": " ", + "address2": " ", + "city": " ", + "state": " ", + "postalCode": " ", + "country": "US" + } + }, + "contactAdmin": { + "nameFirst": " ", + "nameMiddle": " ", + "nameLast": " ", + "organization": " ", + "jobTitle": " ", + "email": " ", + "phone": " ", + "fax": " ", + "addressMailing": { + "address1": " ", + "address2": " ", + "city": " ", + "state": " ", + "postalCode": " ", + "country": "US" + } + }, + "contactTech": { + "nameFirst": " ", + "nameMiddle": " ", + "nameLast": " ", + "organization": " ", + "jobTitle": " ", + "email": " ", + "phone": " ", + "fax": " ", + "addressMailing": { + "address1": " ", + "address2": " ", + "city": " ", + "state": " ", + "postalCode": " ", + "country": "US" + } + }, + "contactBilling": { + "nameFirst": " ", + "nameMiddle": " ", + "nameLast": " ", + "organization": " ", + "jobTitle": " ", + "email": " ", + "phone": " ", + "fax": " ", + "addressMailing": { + "address1": " ", + "address2": " ", + "city": " ", + "state": " ", + "postalCode": " ", + "country": "US" + } + } +} \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/godaddy/v1_domains.json b/libcloud/test/dns/fixtures/godaddy/v1_domains.json new file mode 100644 index 0000000000..64fa1caa76 --- /dev/null +++ b/libcloud/test/dns/fixtures/godaddy/v1_domains.json @@ -0,0 +1,77 @@ +[ + { + "domainId": 177184419, + "domain": "aperture-platform.com", + "status": "ACTIVE", + "expires": "2016-09-25T19:29:32Z", + "expirationProtected": false, + "holdRegistrar": false, + "limited": false, + "locked": true, + "privacy": false, + "renewAuto": true, + "renewable": true, + "smart": false, + "transferProtected": false + }, + { + "domainId": 203342445, + "domain": "dd-innovation-days.com", + "status": "ACTIVE", + "expires": "2016-11-15T20:10:17Z", + "expirationProtected": false, + "holdRegistrar": false, + "limited": false, + "locked": true, + "privacy": false, + "renewAuto": true, + "renewable": true, + "smart": false, + "transferProtected": false + }, + { + "domainId": 183117834, + "domain": "givesourcing.com", + "status": "ACTIVE", + "expires": "2017-01-01T19:00:40Z", + "expirationProtected": false, + "holdRegistrar": false, + "limited": false, + "locked": true, + "privacy": false, + "renewAuto": true, + "renewable": true, + "smart": false, + "transferProtected": false + }, + { + "domainId": 200411864, + "domain": "service-layer.com", + "status": "ACTIVE", + "expires": "2018-09-30T18:22:00Z", + "expirationProtected": false, + "holdRegistrar": false, + "limited": false, + "locked": true, + "privacy": false, + "renewAuto": true, + "renewable": true, + "smart": false, + "transferProtected": false + }, + { + "domainId": 183221633, + "domain": "sourcewise.org", + "status": "ACTIVE", + "expires": "2017-01-04T04:02:07Z", + "expirationProtected": false, + "holdRegistrar": false, + "limited": false, + "locked": true, + "privacy": false, + "renewAuto": true, + "renewable": true, + "smart": false, + "transferProtected": false + } +] \ No newline at end of file diff --git a/libcloud/test/dns/fixtures/godaddy/v1_domains_agreements.json b/libcloud/test/dns/fixtures/godaddy/v1_domains_agreements.json new file mode 100644 index 0000000000..15f964b94f --- /dev/null +++ b/libcloud/test/dns/fixtures/godaddy/v1_domains_agreements.json @@ -0,0 +1,8 @@ +[ + { + "agreementKey": "DNRA", + "title": "Domain Name Registration Agreement", + "url": "http://www.secureserver.net/agreements/ShowDoc.aspx?pageid=7959&pl_id=1", + "content": "\n\nDomain Name Registration and Customer Service Agreement\n